ccseapps-2.5/0000755000175000017500000000000011634153217014316 5ustar amckinstryamckinstryccseapps-2.5/NOTES0000644000175000017500000000126511634153073015135 0ustar amckinstryamckinstry From Akira: Akira has mucked with the header files. The reason for this is as follows: -> The serial build of Boxlib fakes MPI under the covers -> When we try to build an AVT boxlib reader, a parallel version of the reader is built. -> That reader links against MPI, which conflicts with the way the Boxlib library fakes MPI under the covers. -> Problems emerge. So use Akira's headers. As far as building Boxlib: -> Untar the tarball in this directory. -> Go to the Boxlib subdirectory and modify the GNUmakefile. -> It will figure out the platform, etc. -> You pretty much just need to specify the dimension. -> Rename the library to be something like libbox2D.a or libbox3D.a ccseapps-2.5/CCSEApps/0000755000175000017500000000000011634153073015657 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/mglib/0000755000175000017500000000000011634153073016751 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/mglib/Banner.html0000644000175000017500000000056711634153073021054 0ustar amckinstryamckinstry

Problems with this Web page should be sent to webmaster@mothra.lbl.gov

Bugs in the software should be sent to guthamr-bugs@mothra.lbl.gov

(C)opyright by Lawrence Berkeley National Laboratory ccseapps-2.5/CCSEApps/mglib/Make.package0000644000175000017500000000156211634153073021147 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.2 1999/04/01 21:43:11 car Exp $ # MGLIB_BASE=EXE ifeq ($(LBASE),mg) MGLIB_BASE=LIB endif C$(MGLIB_BASE)_sources += ABecLaplacian.cpp BndryData.cpp CGSolver.cpp \ InterpBndryData.cpp LinOp.cpp \ Mask.cpp MultiGrid.cpp C$(MGLIB_BASE)_sources += Laplacian.cpp C$(MGLIB_BASE)_headers += ABecLaplacian.H BndryData.H BoundCond.H \ CGSolver.H InterpBndryData.H LO_BCTYPES.H \ LinOp.H Mask.H MultiGrid.H C$(MGLIB_BASE)_headers += Laplacian.H F$(MGLIB_BASE)_headers += ABec_F.H CG_F.H INTERPBNDRYDATA_F.H LO_F.H \ LP_F.H MG_F.H F$(MGLIB_BASE)_sources += ABec_$(DIM)D.F ABec_UTIL.F CG_$(DIM)D.F \ INTERPBNDRYDATA_$(DIM)D.F LO_$(DIM)D.F \ LO_UTIL.F LP_$(DIM)D.F MG_$(DIM)D.F ccseapps-2.5/CCSEApps/mglib/InterpBndryData.H0000644000175000017500000001431411634153073022117 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _INTERPBNDRYDATA_H_ #define _INTERPBNDRYDATA_H_ // // $Id: InterpBndryData.H,v 1.8 2000/10/02 20:51:16 lijewski Exp $ // #include #include #include #include #include #include #include #include //@Man: /*@Memo: An InterpBndryData object adds to a BndryData object the ability to manipulate and set the data stored in the boundary cells. */ /*@Doc: The "Interpbndrydata" class is a virtual base class derived from BndryData. It is intended to provide a more physical method for filling boundary-related data. Boundary values in a BndryData object are stored in FabSets around each grid in the domain, and the InterpBndryData class provides a mechanism for filling these FabSets, consistent with AMR-like numerical discretizations. When asked to set it's boundary values, an InterpBndryData object: \begin{enumerate} \item Fills with physical boundary values if the FAB is on the domain boundary ({\it the corresponding values are presumed to be stored in the ghost cells of a MultiFab given to the boundary filling routine}) \item Fills on intersection with data from the VALID region of the input MultiFab, ensuring that adjacent FABs use consistent data at their intersection, and otherwise, \item Fills with values interpolated from a coarser FAB that bounds the cells that do not meet the above two criteria \end{enumerate} This class does NOT provide a copy constructor or assignment operator. */ class InterpBndryData : public BndryData { public: // //@ManDoc: default constructor // InterpBndryData () : BndryData() {} // //@ManDoc: constructor for given BoxArray, etc // InterpBndryData (const BoxArray& _grids, int _ncomp, const Geometry& geom); // //@ManDoc: Copy constructor. // InterpBndryData (const InterpBndryData& rhs) : BndryData(rhs) {} // //@ManDoc: Copy assignment operator. // InterpBndryData& operator= (const InterpBndryData& rhs) { if (!(this == &rhs)) { BndryData::operator=(rhs); } return *this; } // //@ManDoc: interpret user BCs to those expected by LinOp: takes integer ratio and // is a wrapper to the IntVect version // void setBndryConds (const BCRec& phys_bc, int ratio); // //@ManDoc: interpret user BCs to those expected by LinOp: takes IntVect ratio // virtual void setBndryConds (const BCRec& phys_bc, IntVect& ratio, int comp=0) = 0; // //@ManDoc: set bndry values at coarse level (non interpolation performed) // void setBndryValues (const MultiFab& mf, int mf_start, int bnd_start, int num_comp, const BCRec& phys_bc); // //@ManDoc: set bndry values at fine level, performing necessary interpolations // void setBndryValues (::BndryRegister& crse, int c_start, const MultiFab& fine, int f_start, int bnd_start, int num_comp, int ratio, const BCRec& phys_bc); // //@ManDoc: set bndry values at fine level, performing necessary interpolations // void setBndryValues (::BndryRegister& crse, int c_start, const MultiFab& fine, int f_start, int bnd_start, int num_comp, IntVect& ratio, const BCRec& phys_bc); }; inline void InterpBndryData::setBndryValues (::BndryRegister& crse, int c_start, const MultiFab& fine, int f_start, int bnd_start, int num_comp, int ratio, const BCRec& bc) { IntVect ratio_vect = ratio * IntVect::TheUnitVector(); setBndryValues(crse,c_start,fine,f_start,bnd_start,num_comp,ratio_vect,bc); } inline void InterpBndryData::setBndryConds (const BCRec& phys_bc, int ratio) { IntVect ratio_vect = ratio * IntVect::TheUnitVector(); setBndryConds(phys_bc, ratio_vect); } #endif /*_INTERPBNDRYDATA_H_*/ ccseapps-2.5/CCSEApps/mglib/Mask.H0000644000175000017500000001223211634153073017755 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MASK_H_ #define _MASK_H_ // // $Id: Mask.H,v 1.5 2001/08/01 21:51:04 lijewski Exp $ // #include #include //@Man: /*@Memo: A Mask is a derived Fab class whose elements maintain a logical "TRUE" or "FALSE" state. A Mask can perform several elementary logical operations on its data members. */ /*@Doc: Implement a logical class Mask to maintain the TRUE or FALSE state of elements in a box. A Mask can perform element-wise logical operations, but is otherwise very similar to an FArrayBox object. A Mask object can set its components based on comparing (a subregion of a) real-valued FArrayBox element magnitudes to a scalar value, or by "and", "or" operations with (the a subregion of) other Masks. This class does NOT provide a copy constructor or assignment operator. */ class Mask : public BaseFab { public: // //@ManDoc: default constructor // Mask () : BaseFab() {} // //@ManDoc: allocating constructor (nc=number of components) // Mask (const Box& bx, int nc = 1) : BaseFab(bx,nc) {} // //@ManDoc: construct from input stream // Mask (std::istream& is); // //@ManDoc: destructor // virtual ~Mask () {} // //@ManDoc: Initialize from stream. // friend std::istream& operator>> (std::istream&, Mask&); // //@ManDoc: initialize from stream, FAB-style // void readFrom (std::istream&); // //@ManDoc: output to stream // friend std::ostream& operator<< (std::ostream&, const Mask&); // //@ManDoc: output to stream, FAB-style // void writeOn (std::ostream&) const; // //@ManDoc: in-place And operator // Mask& operator&= (const Mask& src) { return And(src); } // //@ManDoc: in-place And // Mask& And (const Mask& src); // //@ManDoc: as above, but specify source/destination/number of components // Mask& And (const Mask& src, int srccomp, int destcomp, int numcomp = 1); // //@ManDoc: as above, and specify subregion // Mask& And (const Mask& src, const Box& subbox, int srccomp, int destcomp, int numcomp = 1); // //@ManDoc: in-pace And, over source components to destination components, // and on intersection of source and destination boxes // Mask& And (const Mask& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp = 1); // //@ManDoc: in-place Or operator // Mask& operator|= (const Mask& src) { return Or(src); } // //@ManDoc: in-place Or // Mask& Or (const Mask& src); // //@ManDoc: as above, but specify source/destination/number of components // Mask& Or (const Mask& src, int srccomp, int destcomp, int numcomp = 1); // //@ManDoc: as above, and specify subregion // Mask& Or (const Mask& src, const Box& subbox, int srccomp, int destcomp, int numcomp = 1); // //@ManDoc: in-pace Or, over source components to destination components, // and on intersection of source and destination boxes // Mask& Or (const Mask& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp = 1); private: // // Disallow copy constructor and operator. // Mask& operator= (const Mask&); Mask (const Mask&); }; #endif /*_MASK_H_*/ ccseapps-2.5/CCSEApps/mglib/MG_F.H0000644000175000017500000000550411634153073017636 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MG_F_H_ #define _MG_F_H_ /* ** $Id: MG_F.H,v 1.3 2002/04/26 22:10:02 lijewski Exp $ */ #include #if defined(BL_LANG_FORT) #if (BL_SPACEDIM == 2) #define FORT_AVERAGE average2dgen #define FORT_INTERP interp2dgen #endif #if (BL_SPACEDIM == 3) #define FORT_AVERAGE average3dgen #define FORT_INTERP interp3dgen #endif #else #if (BL_SPACEDIM == 2) #if defined(BL_FORT_USE_UPPERCASE) #define FORT_AVERAGE AVERAGE2DGEN #define FORT_INTERP INTERP2DGEN #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_AVERAGE average2dgen #define FORT_INTERP interp2dgen #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_AVERAGE average2dgen_ #define FORT_INTERP interp2dgen_ #endif #endif #if (BL_SPACEDIM == 3) #if defined(BL_FORT_USE_UPPERCASE) #define FORT_AVERAGE AVERAGE3DGEN #define FORT_INTERP INTERP3DGEN #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_AVERAGE average3dgen #define FORT_INTERP interp3dgen #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_AVERAGE average3dgen_ #define FORT_INTERP interp3dgen_ #endif #endif #include extern "C" { void FORT_AVERAGE ( Real* crse, ARLIM_P(crse_lo), ARLIM_P(crse_hi), const Real* fine, ARLIM_P(fine_lo), ARLIM_P(fine_hi), const int *tlo, const int *thi, const int *nc); void FORT_INTERP ( Real* fine, ARLIM_P(fine_lo), ARLIM_P(fine_hi), const Real* crse, ARLIM_P(crse_lo), ARLIM_P(crse_hi), const int *tlo, const int *thi, const int *nc); } #endif #endif /*_MG_F_H_*/ ccseapps-2.5/CCSEApps/mglib/ABecLaplacian.cpp0000644000175000017500000004465211634153073022067 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ABecLaplacian.cpp,v 1.20 2002/11/20 16:52:07 lijewski Exp $ // #include #include #include #include #include #include #include Real ABecLaplacian::a_def = 0.0; Real ABecLaplacian::b_def = 1.0; Real ABecLaplacian::alpha_def = 1.0; Real ABecLaplacian::beta_def = 1.0; ABecLaplacian::ABecLaplacian (const BndryData& _bd, Real _h) : LinOp(_bd,_h), alpha(alpha_def), beta(beta_def) { initCoefficients(_bd.boxes()); } ABecLaplacian::ABecLaplacian (const BndryData& _bd, const Real* _h) : LinOp(_bd,_h), alpha(alpha_def), beta(beta_def) { initCoefficients(_bd.boxes()); } ABecLaplacian::~ABecLaplacian () { clearToLevel(-1); } Real ABecLaplacian::norm(int nm, int level) { BL_ASSERT(nm == 0); const MultiFab& a = aCoefficients(level); D_TERM(const MultiFab& bX = bCoefficients(0,level);, const MultiFab& bY = bCoefficients(1,level);, const MultiFab& bZ = bCoefficients(2,level);); const int nc = a.nComp(); Real res = 0.0; for (MFIter amfi(a); amfi.isValid(); ++amfi) { Real tres; #if (BL_SPACEDIM==2) FORT_NORMA(&tres, &alpha, &beta, a[amfi].dataPtr(), ARLIM(a[amfi].loVect()), ARLIM(a[amfi].hiVect()), bX[amfi].dataPtr(), ARLIM(bX[amfi].loVect()), ARLIM(bX[amfi].hiVect()), bY[amfi].dataPtr(), ARLIM(bY[amfi].loVect()), ARLIM(bY[amfi].hiVect()), amfi.validbox().loVect(), amfi.validbox().hiVect(), &nc, h[level]); #elif (BL_SPACEDIM==3) FORT_NORMA(&tres, &alpha, &beta, a[amfi].dataPtr(), ARLIM(a[amfi].loVect()), ARLIM(a[amfi].hiVect()), bX[amfi].dataPtr(), ARLIM(bX[amfi].loVect()), ARLIM(bX[amfi].hiVect()), bY[amfi].dataPtr(), ARLIM(bY[amfi].loVect()), ARLIM(bY[amfi].hiVect()), bZ[amfi].dataPtr(), ARLIM(bZ[amfi].loVect()), ARLIM(bZ[amfi].hiVect()), amfi.validbox().loVect(), amfi.validbox().hiVect(), &nc, h[level]); #endif res = std::max(res, tres); } ParallelDescriptor::ReduceRealMax(res); return res; } void ABecLaplacian::clearToLevel (int level) { BL_ASSERT(level >= -1); for (int i = level+1; i < numLevels(); ++i) { delete acoefs[i]; a_valid[i] = false; for (int j = 0; j < BL_SPACEDIM; ++j) { delete bcoefs[i][j]; } b_valid[i] = false; } } void ABecLaplacian::prepareForLevel (int level) { LinOp::prepareForLevel(level); if (level == 0 ) return; prepareForLevel(level-1); // // If coefficients were marked invalid, or if not yet made, make new ones // (Note: makeCoefficients is a LinOp routine, and it allocates AND // fills coefficients. A more efficient implementation would allocate // and fill in separate steps--we could then use the a_valid bool // along with the length of a_valid to separately determine whether to // fill or allocate the coefficient MultiFabs. // if (level >= a_valid.size() || a_valid[level] == false) { if (acoefs.size() < level+1) { acoefs.resize(level+1); acoefs[level] = new MultiFab; } else { delete acoefs[level]; acoefs[level] = new MultiFab; } makeCoefficients(*acoefs[level], *acoefs[level-1], level); a_valid.resize(level+1); a_valid[level] = true; } if (level >= b_valid.size() || b_valid[level] == false) { if (bcoefs.size() < level+1) { bcoefs.resize(level+1); for(int i = 0; i < BL_SPACEDIM; ++i) bcoefs[level][i] = new MultiFab; } else { for(int i = 0; i < BL_SPACEDIM; ++i) { delete bcoefs[level][i]; bcoefs[level][i] = new MultiFab; } } for (int i = 0; i < BL_SPACEDIM; ++i) { makeCoefficients(*bcoefs[level][i], *bcoefs[level-1][i], level); } b_valid.resize(level+1); b_valid[level] = true; } } void ABecLaplacian::initCoefficients (const BoxArray& _ba) { const int nComp=1; const int nGrow=0; acoefs.resize(1); bcoefs.resize(1); acoefs[0] = new MultiFab(_ba, nComp, nGrow, Fab_allocate); acoefs[0]->setVal(a_def); a_valid.resize(1); a_valid[0] = true; for (int i = 0; i < BL_SPACEDIM; ++i) { BoxArray edge_boxes(_ba); edge_boxes.surroundingNodes(i); bcoefs[0][i] = new MultiFab(edge_boxes, nComp, nGrow, Fab_allocate); bcoefs[0][i]->setVal(b_def); } b_valid.resize(1); b_valid[0] = true; } void ABecLaplacian::invalidate_a_to_level (int lev) { lev = (lev >= 0 ? lev : 0); for (int i = lev; i < numLevels(); i++) a_valid[i] = false; } void ABecLaplacian::invalidate_b_to_level (int lev) { lev = (lev >= 0 ? lev : 0); for (int i = lev; i < numLevels(); i++) b_valid[i] = false; } void ABecLaplacian::compFlux (D_DECL(MultiFab &xflux, MultiFab &yflux, MultiFab &zflux), MultiFab& in, const BC_Mode& bc_mode) { compFlux(D_DECL(xflux, yflux, zflux), in, bc_mode, true); } void ABecLaplacian::compFlux (D_DECL(MultiFab &xflux, MultiFab &yflux, MultiFab &zflux), MultiFab& in, const BC_Mode& bc_mode, bool do_ApplyBC) { int level = 0; int src_comp = 0; int num_comp = 1; if (do_ApplyBC) applyBC(in,src_comp,num_comp,level,bc_mode); const BoxArray& bxa = gbox[level]; const MultiFab& a = aCoefficients(level); D_TERM(const MultiFab& bX = bCoefficients(0,level);, const MultiFab& bY = bCoefficients(1,level);, const MultiFab& bZ = bCoefficients(2,level);); int nc = in.nComp(); for (MFIter inmfi(in); inmfi.isValid(); ++inmfi) { BL_ASSERT(bxa[inmfi.index()] == inmfi.validbox()); FORT_FLUX(in[inmfi].dataPtr(), ARLIM(in[inmfi].loVect()), ARLIM(in[inmfi].hiVect()), &alpha, &beta, a[inmfi].dataPtr(), ARLIM(a[inmfi].loVect()), ARLIM(a[inmfi].hiVect()), bX[inmfi].dataPtr(), ARLIM(bX[inmfi].loVect()), ARLIM(bX[inmfi].hiVect()), bY[inmfi].dataPtr(), ARLIM(bY[inmfi].loVect()), ARLIM(bY[inmfi].hiVect()), #if (BL_SPACEDIM == 3) bZ[inmfi].dataPtr(), ARLIM(bZ[inmfi].loVect()), ARLIM(bZ[inmfi].hiVect()), #endif inmfi.validbox().loVect(), inmfi.validbox().hiVect(), &nc, h[level], xflux[inmfi].dataPtr(), ARLIM(xflux[inmfi].loVect()), ARLIM(xflux[inmfi].hiVect()), yflux[inmfi].dataPtr(), ARLIM(yflux[inmfi].loVect()), ARLIM(yflux[inmfi].hiVect()) #if (BL_SPACEDIM == 3) ,zflux[inmfi].dataPtr(), ARLIM(zflux[inmfi].loVect()), ARLIM(zflux[inmfi].hiVect()) #endif ); } } #ifdef BL_THREADS class task_gsrb : public WorkQueue::task { public: task_gsrb(FArrayBox& solnL_, const FArrayBox& rhsL_, Real alpha_, Real beta_, const FArrayBox& a_, D_DECL(const FArrayBox& bX_, const FArrayBox& bY_, const FArrayBox& bZ_), const FArrayBox& f0_, const Mask& m0_, const FArrayBox& f1_, const Mask& m1_, const FArrayBox& f2_, const Mask& m2_, const FArrayBox& f3_, const Mask& m3_, #if BL_SPACEDIM == 3 const FArrayBox& f4_, const Mask& m4_, const FArrayBox& f5_, const Mask& m5_, #endif const Box& vbox_, int nc_, const Real* h_, int redBlackFlag_) : solnL(solnL_), rhsL(rhsL_), alpha(alpha_), beta(beta_), a(a_), D_DECL(bX(bX_), bY(bY_), bZ(bZ_)), f0(f0_), m0(m0_), f1(f1_), m1(m1_), f2(f2_), m2(m2_), f3(f3_), m3(m3_), #if BL_SPACEDIM == 3 f4(f4_), m4(m4_), f5(f5_), m5(m5_), #endif vbox(vbox_), nc(nc_), h(h_), redBlackFlag(redBlackFlag_) {} virtual void run(); private: FArrayBox& solnL; const FArrayBox& rhsL; const Real alpha, beta; const FArrayBox& a; D_TERM(const FArrayBox& bX, ;const FArrayBox& bY, ;const FArrayBox& bZ); const FArrayBox& f0; const Mask& m0; const FArrayBox& f1; const Mask& m1; const FArrayBox& f2; const Mask& m2; const FArrayBox& f3; const Mask& m3; #if BL_SPACEDIM == 3 const FArrayBox& f4; const Mask& m4; const FArrayBox& f5; const Mask& m5; #endif const Box vbox; const int nc; const Real* h; const int redBlackFlag; }; void task_gsrb::run () { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::run()"); FORT_GSRB(solnL.dataPtr(), ARLIM(solnL.loVect()),ARLIM(solnL.hiVect()), rhsL.dataPtr(), ARLIM(rhsL.loVect()), ARLIM(rhsL.hiVect()), &alpha, &beta, a.dataPtr(), ARLIM(a.loVect()), ARLIM(a.hiVect()), bX.dataPtr(), ARLIM(bX.loVect()), ARLIM(bX.hiVect()), bY.dataPtr(), ARLIM(bY.loVect()), ARLIM(bY.hiVect()), #if BL_SPACEDIM==3 bZ.dataPtr(), ARLIM(bZ.loVect()), ARLIM(bZ.hiVect()), #endif f0.dataPtr(), ARLIM(f0.loVect()), ARLIM(f0.hiVect()), m0.dataPtr(), ARLIM(m0.loVect()), ARLIM(m0.hiVect()), f1.dataPtr(), ARLIM(f1.loVect()), ARLIM(f1.hiVect()), m1.dataPtr(), ARLIM(m1.loVect()), ARLIM(m1.hiVect()), f2.dataPtr(), ARLIM(f2.loVect()), ARLIM(f2.hiVect()), m2.dataPtr(), ARLIM(m2.loVect()), ARLIM(m2.hiVect()), f3.dataPtr(), ARLIM(f3.loVect()), ARLIM(f3.hiVect()), m3.dataPtr(), ARLIM(m3.loVect()), ARLIM(m3.hiVect()), #if BL_SPACEDIM==3 f4.dataPtr(), ARLIM(f4.loVect()), ARLIM(f4.hiVect()), m4.dataPtr(), ARLIM(m4.loVect()), ARLIM(m4.hiVect()), f5.dataPtr(), ARLIM(f5.loVect()), ARLIM(f5.hiVect()), m5.dataPtr(), ARLIM(m5.loVect()), ARLIM(m5.hiVect()), #endif vbox.loVect(), vbox.hiVect(), &nc, h, &redBlackFlag); } #endif // // Must be defined for MultiGrid/CGSolver to work. // void ABecLaplacian::Fsmooth (MultiFab& solnL, const MultiFab& rhsL, int level, int redBlackFlag) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::Fsmooth()"); const BoxArray& bxa = gbox[level]; OrientationIter oitr; const FabSet& f0 = (*undrrelxr[level])[oitr()]; oitr++; const FabSet& f1 = (*undrrelxr[level])[oitr()]; oitr++; const FabSet& f2 = (*undrrelxr[level])[oitr()]; oitr++; const FabSet& f3 = (*undrrelxr[level])[oitr()]; oitr++; #if (BL_SPACEDIM > 2) const FabSet& f4 = (*undrrelxr[level])[oitr()]; oitr++; const FabSet& f5 = (*undrrelxr[level])[oitr()]; oitr++; #endif const MultiFab& a = aCoefficients(level); D_TERM(const MultiFab &bX = bCoefficients(0,level);, const MultiFab &bY = bCoefficients(1,level);, const MultiFab &bZ = bCoefficients(2,level);); const int nc = solnL.nComp(); for (MFIter solnLmfi(solnL); solnLmfi.isValid(); ++solnLmfi) { oitr.rewind(); const int gn = solnLmfi.index(); const Mask& m0 = *maskvals[level][gn][oitr()]; oitr++; const Mask& m1 = *maskvals[level][gn][oitr()]; oitr++; const Mask& m2 = *maskvals[level][gn][oitr()]; oitr++; const Mask& m3 = *maskvals[level][gn][oitr()]; oitr++; #if (BL_SPACEDIM > 2) const Mask& m4 = *maskvals[level][gn][oitr()]; oitr++; const Mask& m5 = *maskvals[level][gn][oitr()]; oitr++; #endif BL_ASSERT(bxa[solnLmfi.index()] == solnLmfi.validbox()); #ifdef BL_THREADS BoxLib::theWorkQueue().add(new task_gsrb(solnL[gn], rhsL[gn], alpha, beta, a[gn], D_DECL(bX[gn], bY[gn], bZ[gn]), f0[gn], m0, f1[gn], m1, f2[gn], m2, f3[gn], m3, #if BL_SPACEDIM == 3 f4[gn], m4, f5[gn], m5, #endif solnLmfi.validbox(), nc, h[level], redBlackFlag)); #else #if (BL_SPACEDIM == 2) FORT_GSRB(solnL[solnLmfi].dataPtr(), ARLIM(solnL[solnLmfi].loVect()),ARLIM(solnL[solnLmfi].hiVect()), rhsL[solnLmfi].dataPtr(), ARLIM(rhsL[solnLmfi].loVect()), ARLIM(rhsL[solnLmfi].hiVect()), &alpha, &beta, a[solnLmfi].dataPtr(), ARLIM(a[solnLmfi].loVect()), ARLIM(a[solnLmfi].hiVect()), bX[solnLmfi].dataPtr(), ARLIM(bX[solnLmfi].loVect()), ARLIM(bX[solnLmfi].hiVect()), bY[solnLmfi].dataPtr(), ARLIM(bY[solnLmfi].loVect()), ARLIM(bY[solnLmfi].hiVect()), f0[solnLmfi.index()].dataPtr(), ARLIM(f0[solnLmfi.index()].loVect()), ARLIM(f0[solnLmfi.index()].hiVect()), m0.dataPtr(), ARLIM(m0.loVect()), ARLIM(m0.hiVect()), f1[solnLmfi.index()].dataPtr(), ARLIM(f1[solnLmfi.index()].loVect()), ARLIM(f1[solnLmfi.index()].hiVect()), m1.dataPtr(), ARLIM(m1.loVect()), ARLIM(m1.hiVect()), f2[solnLmfi.index()].dataPtr(), ARLIM(f2[solnLmfi.index()].loVect()), ARLIM(f2[solnLmfi.index()].hiVect()), m2.dataPtr(), ARLIM(m2.loVect()), ARLIM(m2.hiVect()), f3[solnLmfi.index()].dataPtr(), ARLIM(f3[solnLmfi.index()].loVect()), ARLIM(f3[solnLmfi.index()].hiVect()), m3.dataPtr(), ARLIM(m3.loVect()), ARLIM(m3.hiVect()), solnLmfi.validbox().loVect(), solnLmfi.validbox().hiVect(), &nc, h[level], &redBlackFlag); #endif #if (BL_SPACEDIM == 3) FORT_GSRB(solnL[solnLmfi].dataPtr(), ARLIM(solnL[solnLmfi].loVect()),ARLIM(solnL[solnLmfi].hiVect()), rhsL[solnLmfi].dataPtr(), ARLIM(rhsL[solnLmfi].loVect()), ARLIM(rhsL[solnLmfi].hiVect()), &alpha, &beta, a[solnLmfi].dataPtr(), ARLIM(a[solnLmfi].loVect()), ARLIM(a[solnLmfi].hiVect()), bX[solnLmfi].dataPtr(), ARLIM(bX[solnLmfi].loVect()), ARLIM(bX[solnLmfi].hiVect()), bY[solnLmfi].dataPtr(), ARLIM(bY[solnLmfi].loVect()), ARLIM(bY[solnLmfi].hiVect()), bZ[solnLmfi].dataPtr(), ARLIM(bZ[solnLmfi].loVect()), ARLIM(bZ[solnLmfi].hiVect()), f0[solnLmfi.index()].dataPtr(), ARLIM(f0[solnLmfi.index()].loVect()), ARLIM(f0[solnLmfi.index()].hiVect()), m0.dataPtr(), ARLIM(m0.loVect()), ARLIM(m0.hiVect()), f1[solnLmfi.index()].dataPtr(), ARLIM(f1[solnLmfi.index()].loVect()), ARLIM(f1[solnLmfi.index()].hiVect()), m1.dataPtr(), ARLIM(m1.loVect()), ARLIM(m1.hiVect()), f2[solnLmfi.index()].dataPtr(), ARLIM(f2[solnLmfi.index()].loVect()), ARLIM(f2[solnLmfi.index()].hiVect()), m2.dataPtr(), ARLIM(m2.loVect()), ARLIM(m2.hiVect()), f3[solnLmfi.index()].dataPtr(), ARLIM(f3[solnLmfi.index()].loVect()), ARLIM(f3[solnLmfi.index()].hiVect()), m3.dataPtr(), ARLIM(m3.loVect()), ARLIM(m3.hiVect()), f4[solnLmfi.index()].dataPtr(), ARLIM(f4[solnLmfi.index()].loVect()), ARLIM(f4[solnLmfi.index()].hiVect()), m4.dataPtr(), ARLIM(m4.loVect()), ARLIM(m4.hiVect()), f5[solnLmfi.index()].dataPtr(), ARLIM(f5[solnLmfi.index()].loVect()), ARLIM(f5[solnLmfi.index()].hiVect()), m5.dataPtr(), ARLIM(m5.loVect()), ARLIM(m5.hiVect()), solnLmfi.validbox().loVect(), solnLmfi.validbox().hiVect(), &nc, h[level], &redBlackFlag); #endif #endif } BoxLib::theWorkQueue().wait(); } void ABecLaplacian::Fapply (MultiFab& y, const MultiFab& x, int level) { const BoxArray& bxa = gbox[level]; const MultiFab& a = aCoefficients(level); D_TERM(const MultiFab& bX = bCoefficients(0,level);, const MultiFab& bY = bCoefficients(1,level);, const MultiFab& bZ = bCoefficients(2,level);); const int nc = y.nComp(); for (MFIter ymfi(y); ymfi.isValid(); ++ymfi) { BL_ASSERT(bxa[ymfi.index()] == ymfi.validbox()); #if (BL_SPACEDIM == 2) FORT_ADOTX(y[ymfi].dataPtr(), ARLIM(y[ymfi].loVect()),ARLIM(y[ymfi].hiVect()), x[ymfi].dataPtr(), ARLIM(x[ymfi].loVect()), ARLIM(x[ymfi].hiVect()), &alpha, &beta, a[ymfi].dataPtr(), ARLIM(a[ymfi].loVect()), ARLIM(a[ymfi].hiVect()), bX[ymfi].dataPtr(), ARLIM(bX[ymfi].loVect()), ARLIM(bX[ymfi].hiVect()), bY[ymfi].dataPtr(), ARLIM(bY[ymfi].loVect()), ARLIM(bY[ymfi].hiVect()), ymfi.validbox().loVect(), ymfi.validbox().hiVect(), &nc, h[level]); #endif #if (BL_SPACEDIM ==3) FORT_ADOTX(y[ymfi].dataPtr(), ARLIM(y[ymfi].loVect()), ARLIM(y[ymfi].hiVect()), x[ymfi].dataPtr(), ARLIM(x[ymfi].loVect()), ARLIM(x[ymfi].hiVect()), &alpha, &beta, a[ymfi].dataPtr(), ARLIM(a[ymfi].loVect()), ARLIM(a[ymfi].hiVect()), bX[ymfi].dataPtr(), ARLIM(bX[ymfi].loVect()), ARLIM(bX[ymfi].hiVect()), bY[ymfi].dataPtr(), ARLIM(bY[ymfi].loVect()), ARLIM(bY[ymfi].hiVect()), bZ[ymfi].dataPtr(), ARLIM(bZ[ymfi].loVect()), ARLIM(bZ[ymfi].hiVect()), ymfi.validbox().loVect(), ymfi.validbox().hiVect(), &nc, h[level]); #endif } } ccseapps-2.5/CCSEApps/mglib/MultiGrid.cpp0000644000175000017500000004232711634153073021365 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MultiGrid.cpp,v 1.32 2003/03/12 21:03:32 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include bool MultiGrid::initialized = false; int MultiGrid::def_nu_0 = 1; int MultiGrid::def_nu_1 = 2; int MultiGrid::def_nu_2 = 2; int MultiGrid::def_nu_f = 8; int MultiGrid::def_maxiter = 40; int MultiGrid::def_maxiter_b = 80; int MultiGrid::def_numiter = -1; int MultiGrid::def_verbose = 0; int MultiGrid::def_usecg = 1; #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA Real MultiGrid::def_rtol_b = 0.001; #else Real MultiGrid::def_rtol_b = 0.01; #endif Real MultiGrid::def_atol_b = -1.0; int MultiGrid::def_nu_b = 0; int MultiGrid::def_numLevelsMAX = 1024; int MultiGrid::def_smooth_on_cg_unstable = 0; CGSolver::Solver MultiGrid::def_cg_solver = CGSolver::BiCGStab; static Real norm_inf (const MultiFab& res) { Real restot = 0.0; for (MFIter mfi(res); mfi.isValid(); ++mfi) { restot = std::max(restot, res[mfi].norm(mfi.validbox(), 0)); } ParallelDescriptor::ReduceRealMax(restot); return restot; } static void Spacer (std::ostream& os, int lev) { for (int k = 0; k < lev; k++) { os << " "; } } void MultiGrid::initialize () { ParmParse pp("mg"); initialized = true; pp.query("maxiter", def_maxiter); pp.query("maxiter_b", def_maxiter_b); pp.query("numiter", def_numiter); pp.query("nu_0", def_nu_0); pp.query("nu_1", def_nu_1); pp.query("nu_2", def_nu_2); pp.query("nu_f", def_nu_f); pp.query("v", def_verbose); pp.query("verbose", def_verbose); pp.query("usecg", def_usecg); pp.query("rtol_b", def_rtol_b); pp.query("bot_atol", def_atol_b); pp.query("nu_b", def_nu_b); pp.query("numLevelsMAX", def_numLevelsMAX); pp.query("smooth_on_cg_unstable", def_smooth_on_cg_unstable); int ii; if (pp.query("cg_solver", ii )) { switch (ii) { case 0: def_cg_solver = CGSolver::CG; break; case 1: def_cg_solver = CGSolver::BiCGStab; break; case 2: def_cg_solver = CGSolver::CG_Alt; break; default: BoxLib::Error("MultiGrid::initialize(): bad cg_solver value"); } } if (ParallelDescriptor::IOProcessor() && def_verbose) { std::cout << "MultiGrid settings...\n"; std::cout << " def_nu_0 = " << def_nu_0 << '\n'; std::cout << " def_nu_1 = " << def_nu_1 << '\n'; std::cout << " def_nu_2 = " << def_nu_2 << '\n'; std::cout << " def_nu_f = " << def_nu_f << '\n'; std::cout << " def_maxiter = " << def_maxiter << '\n'; std::cout << " def_usecg = " << def_usecg << '\n'; std::cout << " def_maxiter_b = " << def_maxiter_b << '\n'; std::cout << " def_rtol_b = " << def_rtol_b << '\n'; std::cout << " def_atol_b = " << def_atol_b << '\n'; std::cout << " def_nu_b = " << def_nu_b << '\n'; std::cout << " def_numLevelsMAX = " << def_numLevelsMAX << '\n'; std::cout << " def_smooth_on_cg_unstable = " << def_smooth_on_cg_unstable << '\n'; std::cout << " def_cg_solver = " << def_cg_solver << '\n'; } } MultiGrid::MultiGrid (LinOp &_Lp) : initialsolution(0), Lp(_Lp) { if (!initialized) initialize(); maxiter = def_maxiter; numiter = def_numiter; nu_0 = def_nu_0; nu_1 = def_nu_1; nu_2 = def_nu_2; nu_f = def_nu_f; usecg = def_usecg; verbose = def_verbose; maxiter_b = def_maxiter_b; rtol_b = def_rtol_b; atol_b = def_atol_b; nu_b = def_nu_b; numLevelsMAX = def_numLevelsMAX; smooth_on_cg_unstable = def_smooth_on_cg_unstable; cg_solver = def_cg_solver; numlevels = numLevels(); if ( ParallelDescriptor::IOProcessor() && verbose == 1 ) { BoxArray tmp = Lp.boxArray(); std::cout << "MultiGrid: numlevels = " << numlevels << ": ngrid = " << tmp.size() << ", npts = ["; for ( int i = 0; i < numlevels; ++i ) { if ( i > 0 ) tmp.coarsen(2); std::cout << tmp.numPts() << " "; } std::cout << "]" << std::endl; } if ( ParallelDescriptor::IOProcessor() && verbose > 2 ) { std::cout << "MultiGrid: " << numlevels << " multigrid levels created for this solve" << '\n'; std::cout << "Grids: " << '\n'; BoxArray tmp = Lp.boxArray(); for (int i = 0; i < numlevels; ++i) { if (i > 0) tmp.coarsen(2); std::cout << " Level: " << i << '\n'; for (int k = 0; k < tmp.size(); k++) { const Box& b = tmp[k]; std::cout << " [" << k << "]: " << b << " "; for (int j = 0; j < BL_SPACEDIM; j++) std::cout << b.length(j) << ' '; std::cout << '\n'; } } } } MultiGrid::~MultiGrid () { delete initialsolution; for (int i = 0; i < cor.size(); ++i) { delete res[i]; delete rhs[i]; delete cor[i]; } } Real MultiGrid::errorEstimate (int level, LinOp::BC_Mode bc_mode) { Lp.residual(*res[level], *rhs[level], *cor[level], level, bc_mode); return norm_inf(*res[level]); } void MultiGrid::prepareForLevel (int level) { // // Build this level by allocating reqd internal MultiFabs if necessary. // if (cor.size() > level) return; res.resize(level+1, (MultiFab*)0); rhs.resize(level+1, (MultiFab*)0); cor.resize(level+1, (MultiFab*)0); Lp.prepareForLevel(level); if (cor[level] == 0) { res[level] = new MultiFab(Lp.boxArray(level), 1, 1, Fab_allocate); rhs[level] = new MultiFab(Lp.boxArray(level), 1, 1, Fab_allocate); cor[level] = new MultiFab(Lp.boxArray(level), 1, 1, Fab_allocate); if (level == 0) { initialsolution = new MultiFab(Lp.boxArray(0), 1, 1, Fab_allocate); } } } void MultiGrid::residualCorrectionForm (MultiFab& resL, const MultiFab& rhsL, MultiFab& solnL, const MultiFab& inisol, LinOp::BC_Mode bc_mode, int level) { // // Using the linearity of the operator, Lp, we can solve this system // instead by solving for the correction required to the initial guess. // initialsolution->copy(inisol); solnL.copy(inisol); Lp.residual(resL, rhsL, solnL, level, bc_mode); solnL.setVal(0.0); } void MultiGrid::solve (MultiFab& _sol, const MultiFab& _rhs, Real _eps_rel, Real _eps_abs, LinOp::BC_Mode bc_mode) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::solve()"); // // Prepare memory for new level, and solve the general boundary // value problem to within relative error _eps_rel. Customized // to solve at level=0. // const int level = 0; prepareForLevel(level); residualCorrectionForm(*rhs[level],_rhs,*cor[level],_sol,bc_mode,level); if (!solve_(_sol, _eps_rel, _eps_abs, LinOp::Homogeneous_BC, level)) { BoxLib::Error("MultiGrid:: failed to converge!"); } } int MultiGrid::solve_ (MultiFab& _sol, Real eps_rel, Real eps_abs, LinOp::BC_Mode bc_mode, int level) { // // Relax system maxiter times, stop if relative error <= _eps_rel or // if absolute err <= _abs_eps // int returnVal = 0; const Real error0 = errorEstimate(level, bc_mode); Real error = error0; if (ParallelDescriptor::IOProcessor() && verbose) { Spacer(std::cout, level); std::cout << "MultiGrid: Initial error (error0) = " << error0 << '\n'; } if (ParallelDescriptor::IOProcessor() && eps_rel < 1.0e-16 && eps_rel > 0) { std::cout << "MultiGrid: Tolerance " << eps_rel << " < 1e-16 is probably set too low" << '\n'; } // // Initialize correction to zero at this level (auto-filled at levels below) // (*cor[level]).setVal(0.0); // // Note: if eps_rel, eps_abs < 0 then that test is effectively bypassed // const Real norm_rhs = norm_inf(*rhs[level]); const Real norm_Lp = Lp.norm(0, level); const Real new_error_0 = norm_rhs; Real norm_cor = 0.0; int nit = 1; for ( ; error > eps_abs && error > eps_rel*(norm_Lp*norm_cor+norm_rhs) && nit <= maxiter; ++nit) { relax(*cor[level], *rhs[level], level, eps_rel, eps_abs, bc_mode); norm_cor = norm_inf(*cor[level]); error = errorEstimate(level, bc_mode); if (ParallelDescriptor::IOProcessor() && verbose > 1 ) { const Real rel_error = (error0 != 0) ? error/new_error_0 : 0; Spacer(std::cout, level); std::cout << "MultiGrid: Iteration " << nit << " error/error0 " << rel_error << '\n'; } } if ( ParallelDescriptor::IOProcessor() && verbose ) { const Real rel_error = (error0 != 0) ? error/error0 : 0; Spacer(std::cout, level); std::cout << "MultiGrid: iterations(" << nit << ") rel_error( " << rel_error << ")" << std::endl; } if ( nit == numiter || error <= eps_rel*(norm_Lp*norm_cor+norm_rhs) || error <= eps_abs ) { // // Omit ghost update since maybe not initialized in calling routine. // Add to boundary values stored in initialsolution. // _sol.copy(*cor[level]); _sol.plus(*initialsolution,0,_sol.nComp(),0); returnVal = 1; } // // Otherwise, failed to solve satisfactorily // return returnVal; } int MultiGrid::numLevels () const { int ng = Lp.numGrids(); int lv = numLevelsMAX; // // The routine `falls through' since coarsening and refining // a unit box does not yield the initial box. // const BoxArray& bs = Lp.boxArray(0); for (int i = 0; i < ng; ++i) { int llv = 0; Box tmp = bs[i]; for (;;) { Box ctmp = tmp; ctmp.coarsen(2); Box rctmp = ctmp; rctmp.refine(2); if (tmp != rctmp || ctmp.numPts() == 1) break; llv++; tmp = ctmp; } // // Set number of levels so that every box can be refined to there. // if (lv >= llv) lv = llv; } return lv+1; // Including coarsest. } void MultiGrid::relax (MultiFab& solL, MultiFab& rhsL, int level, Real eps_rel, Real eps_abs, LinOp::BC_Mode bc_mode) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::relax()"); // // Recursively relax system. Equivalent to multigrid V-cycle. // At coarsest grid, call coarsestSmooth. // if (level < numlevels - 1 ) { for (int i = preSmooth() ; i > 0 ; i--) { Lp.smooth(solL, rhsL, level, bc_mode); } Lp.residual(*res[level], rhsL, solL, level, bc_mode); prepareForLevel(level+1); average(*rhs[level+1], *res[level]); cor[level+1]->setVal(0.0); for (int i = cntRelax(); i > 0 ; i--) { relax(*cor[level+1],*rhs[level+1],level+1,eps_rel,eps_abs,bc_mode); } interpolate(solL, *cor[level+1]); for (int i = postSmooth(); i > 0 ; i--) { Lp.smooth(solL, rhsL, level, bc_mode); } } else { coarsestSmooth(solL, rhsL, level, eps_rel, eps_abs, bc_mode, usecg); } } void MultiGrid::coarsestSmooth (MultiFab& solL, MultiFab& rhsL, int level, Real eps_rel, Real eps_abs, LinOp::BC_Mode bc_mode, int local_usecg) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "coarsestSmooth()"); prepareForLevel(level); if (local_usecg == 0) { Real error0; if (verbose) { error0 = errorEstimate(level, bc_mode); if (ParallelDescriptor::IOProcessor()) std::cout << " Bottom Smoother: Initial error (error0) = " << error0 << '\n'; } for (int i = finalSmooth(); i > 0; i--) { Lp.smooth(solL, rhsL, level, bc_mode); if (verbose > 1 || (i == 1 && verbose)) { Real error = errorEstimate(level, bc_mode); const Real rel_error = (error0 != 0) ? error/error0 : 0; if (ParallelDescriptor::IOProcessor()) std::cout << " Bottom Smoother: Iteration " << i << " error/error0 " << rel_error << '\n'; } } } else { bool use_mg_precond = false; CGSolver cg(Lp, use_mg_precond, level); cg.setExpert(true); cg.setMaxIter(maxiter_b); int ret = cg.solve(solL, rhsL, rtol_b, atol_b, bc_mode, cg_solver); if (ret != 0) { if (smooth_on_cg_unstable) { // // If the CG solver returns a nonzero value indicating // the problem is unstable. Assume this is not an accuracy // issue and pound on it with the smoother. // if (ParallelDescriptor::IOProcessor() && def_verbose) { std::cout << "MultiGrid::coarsestSmooth(): CGSolver returns nonzero. Smoothing...." << std::endl; } coarsestSmooth(solL, rhsL, level, eps_rel, eps_abs, bc_mode, 0); } else { // // cg failure probably indicates loss of precision accident. // setting solL to 0 should be ok. // solL.setVal(0); if (ParallelDescriptor::IOProcessor() && def_verbose) { std::cout << "MultiGrid::coarsestSmooth(): setting coarse corr to zero" << std::endl; } } } for (int i = 0; i < nu_b; i++) { Lp.smooth(solL, rhsL, level, bc_mode); } } } void MultiGrid::average (MultiFab& c, const MultiFab& f) { // // Use Fortran function to average down (restrict) f to c. // for (MFIter cmfi(c); cmfi.isValid(); ++cmfi) { BL_ASSERT(c.boxArray().get(cmfi.index()) == cmfi.validbox()); const Box& bx = cmfi.validbox(); int nc = c.nComp(); FORT_AVERAGE(c[cmfi].dataPtr(), ARLIM(c[cmfi].loVect()), ARLIM(c[cmfi].hiVect()), f[cmfi].dataPtr(), ARLIM(f[cmfi].loVect()), ARLIM(f[cmfi].hiVect()), bx.loVect(), bx.hiVect(), &nc); } } void MultiGrid::interpolate (MultiFab& f, const MultiFab& c) { // // Use fortran function to interpolate up (prolong) c to f // Note: returns f=f+P(c) , i.e. ADDS interp'd c to f. // for (MFIter fmfi(f); fmfi.isValid(); ++fmfi) { const Box& bx = c.boxArray()[fmfi.index()]; int nc = f.nComp(); FORT_INTERP(f[fmfi].dataPtr(), ARLIM(f[fmfi].loVect()), ARLIM(f[fmfi].hiVect()), c[fmfi].dataPtr(), ARLIM(c[fmfi].loVect()), ARLIM(c[fmfi].hiVect()), bx.loVect(), bx.hiVect(), &nc); } } ccseapps-2.5/CCSEApps/mglib/GNUmakefile0000644000175000017500000000356711634153073021036 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.8 2000/06/01 20:59:38 car Exp $ # PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) PRECISION = DOUBLE DEBUG = TRUE DIM = 3 COMP = KCC USE_MPI = TRUE # # The base name of the library we're building. # LBASE = mg # # Where libraries and include files will be installed. # INSTALL_ROOT = $(TOP) include $(TOP)/mk/Make.defs Make.package INCLUDE_LOCATIONS += $(TOP)/include # # Libraries to close against. # ifeq ($(COMP), KCC) LibsToCloseAgainst := $(TOP)/lib/$(machineSuffix)/libamr$(DIM)d.a LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libbndry$(DIM)d.a LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libbox$(DIM)d.a endif all: $(optionsLib) include $(TOP)/mk/Make.rules # # Temp stuff for doing html docs. # _docHeaders := $(sort $(wildcard *.H)) _htmlDir := html # # This will make the HTML files in the directory html provided # any of the relevant .H files have changed more recently than the # directory itself. # html: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ $(RM) -r $(_htmlDir); \ mkdir -p $(_htmlDir); \ doc++ -f -j -B Banner.html -d $(_htmlDir) $(_docHeaders); \ fi MgLib.tex: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ doc++ -f -t -j -o MgLib.tex -ep docxx_squish $(_docHeaders); \ sed '/[\]usepackage[{]docxx[}]/d' < MgLib.tex > .junk; \ mv .junk MgLib.tex; \ fi MgLib.dvi: MgLib.tex latex MgLib.tex; latex MgLib.tex MgLib.ps: MgLib.dvi dvips MgLib.dvi -o MgLib.ps # # Install the PostScript file into $(INSTALL_ROOT)/ps # install_ps: MgLib.ps -if [ ! -d $(INSTALL_ROOT)/ps ]; then \ mkdir -p $(INSTALL_ROOT)/ps; \ chmod 755 $(INSTALL_ROOT)/ps; \ fi $(INSTALL_DATA) MgLib.ps $(INSTALL_ROOT)/ps ccseapps-2.5/CCSEApps/mglib/Mask.cpp0000644000175000017500000001216111634153073020351 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Mask.cpp,v 1.6 2001/08/01 21:51:04 lijewski Exp $ // #include #include #include #include const char NL = '\n'; const char SP = ' '; Mask::Mask (std::istream& is) { readFrom(is); } std::ostream& operator<< (std::ostream& os, const Mask& m) { int ncomp = m.nComp(); os << "(Mask: " << m.box() << SP << ncomp << NL; IntVect sm = m.box().smallEnd(); IntVect bg = m.box().bigEnd(); for (IntVect p = sm; p <= bg; m.box().next(p)) { os << p; for (int k = 0; k < ncomp; k++) os << " " << m(p,k); os << NL; } os << ")\n"; BL_ASSERT(os.good()); return os; } std::istream& operator>> (std::istream& is, Mask& m) { is.ignore(BL_IGNORE_MAX,':'); Box b; int ncomp; is >> b >> ncomp; is.ignore(BL_IGNORE_MAX, '\n'); m.resize(b,ncomp); IntVect sm = b.smallEnd(); IntVect bg = b.bigEnd(); IntVect q; for (IntVect p = sm; p <= bg; b.next(p)) { is >> q; BL_ASSERT( p == q); for( int k=0; k> m(p,k); is.ignore(BL_IGNORE_MAX, '\n'); } is.ignore(BL_IGNORE_MAX,'\n'); BL_ASSERT(is.good()); return is; } void Mask::writeOn (std::ostream& os) const { os << "(Mask: " << domain << SP << nvar << NL; const int* ptr = dataPtr(); int len = domain.numPts(); os.write( (char*) ptr, len*sizeof(int) ); os << ")\n"; } void Mask::readFrom (std::istream& is) { is.ignore(BL_IGNORE_MAX,':'); Box b; int ncomp; is >> b >> ncomp; is.ignore(BL_IGNORE_MAX, '\n'); resize(b,ncomp); int *ptr = dataPtr(); int len = domain.numPts(); is.read( (char*) ptr, len*sizeof(int) ); is.ignore(BL_IGNORE_MAX, '\n'); } Mask& Mask::And (const Mask& src) { ForAllThisXC(int,src) { thisR = (thisR ? srcR : 0); } EndForTX; return *this; } Mask& Mask::And (const Mask& src, int srccomp, int destcomp, int numcomp) { Box domain(box()); ForAllThisBNNXC(int,domain,destcomp,numcomp,src,srccomp) { thisR = (thisR ? srcR : 0); } EndForTX; return *this; } Mask& Mask::And (const Mask& src, const Box& subbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXC(int,subbox,destcomp,numcomp,src,srccomp) { thisR = (thisR ? srcR : 0); } EndForTX; return *this; } Mask& Mask::And (const Mask& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXCBN(int,destbox,destcomp,numcomp,src,srcbox,srccomp) { thisR = (thisR ? srcR : 0); } EndForTX; return *this; } Mask& Mask::Or (const Mask& src) { ForAllThisXC(int,src) { thisR = (thisR ? 1 : srcR); } EndForTX; return *this; } Mask& Mask::Or (const Mask& src, int srccomp, int destcomp, int numcomp) { Box domain(box()); ForAllThisBNNXC(int,domain,destcomp,numcomp,src,srccomp) { thisR = (thisR ? 1 : srcR); } EndForTX; return *this; } Mask& Mask::Or (const Mask& src, const Box& subbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXC(int,subbox,destcomp,numcomp,src,srccomp) { thisR = (thisR ? 1 : srcR); } EndForTX; return *this; } Mask& Mask::Or (const Mask& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXCBN(int,destbox,destcomp,numcomp,src,srcbox,srccomp) { thisR = (thisR ? 1 : srcR); } EndForTX; return *this; } ccseapps-2.5/CCSEApps/mglib/LP_2D.F0000644000175000017500000001674411634153073017734 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: LP_2D.F,v 1.5 2002/08/29 22:14:39 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include #include "LP_F.H" #include "ArrayLim.H" c----------------------------------------------------------------------- c c Gauss-Seidel Red-Black (GSRB): c Apply the GSRB relaxation to the state phi for the equation c L(phi) = Div(Grad(phi(x))) = rhs(x) central differenced, according c to the arrays of boundary masks (m#) and auxiliary data (f#). c c In general, if the linear operator L=gamma*y-rho, the GS relaxation c is y = (R - rho)/gamma. Near a boundary, the ghost data is filled c using a polynomial interpolant based on the "old" phi values, so c L=(gamma-delta)*y - rho + delta*yOld. The resulting iteration is c c y = (R - delta*yOld + rho)/(gamma - delta) c c This expression is valid additionally in the interior provided c delta->0 there. delta is constructed by summing all the c contributions to the central stencil element coming from boundary c interpolants. The f#s contain the corresponding coefficient of c the interpolating polynomial. The masks are set > 0 if the boundary c value was filled with an interpolant involving the central stencil c element. c c----------------------------------------------------------------------- subroutine FORT_GSRB ( $ phi, DIMS(phi), $ rhs, DIMS(rhs), $ f0, DIMS(f0), m0, DIMS(m0), $ f1, DIMS(f1), m1, DIMS(m1), $ f2, DIMS(f2), m2, DIMS(m2), $ f3, DIMS(f3), m3, DIMS(m3), $ lo, hi, nc, $ h, redblack $ ) integer nc integer DIMDEC(phi) REAL_T phi(DIMV(phi),nc) integer DIMDEC(rhs) REAL_T rhs(DIMV(rhs),nc) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) integer DIMDEC(f0) integer DIMDEC(f1) integer DIMDEC(f2) integer DIMDEC(f3) REAL_T f0(DIMV(f0)) REAL_T f1(DIMV(f1)) REAL_T f2(DIMV(f2)) REAL_T f3(DIMV(f3)) integer DIMDEC(m0) integer DIMDEC(m1) integer DIMDEC(m2) integer DIMDEC(m3) integer m0(DIMV(m0)) integer m1(DIMV(m1)) integer m2(DIMV(m2)) integer m3(DIMV(m3)) integer redblack REAL_T h c integer i, j, ioff, n c REAL_T cf0, cf1, cf2, cf3 REAL_T delta, gamma, rho c gamma = 4.0D0 do n = 1, nc do j = lo(2), hi(2) ioff = MOD(j + redblack,2) do i = lo(1) + ioff,hi(1),2 c cf0 = cvmgt(f0(lo(1),j), 0.0D0, $ (i .eq. lo(1)) .and. (m0(lo(1)-1,j).gt.0)) cf1 = cvmgt(f1(i,lo(2)), 0.0D0, $ (j .eq. lo(2)) .and. (m1(i,lo(2)-1).gt.0)) cf2 = cvmgt(f2(hi(1),j), 0.0D0, $ (i .eq. hi(1)) .and. (m2(hi(1)+1,j).gt.0)) cf3 = cvmgt(f3(i,hi(2)), 0.0D0, $ (j .eq. hi(2)) .and. (m3(i,hi(2)+1).gt.0)) c delta = cf0 + cf1 + cf2 + cf3 c rho = phi(i-1,j,n) + phi(i+1,j,n) $ + phi(i,j-1,n) + phi(i,j+1,n) c phi(i,j,n) = (rhs(i,j,n)*h*h - rho + phi(i,j,n)*delta) $ / (delta - gamma) c end do end do end do end c----------------------------------------------------------------------- c c Solve Preconditioned system here c subroutine FORT_CGPRECND( $ zz, DIMS(zz), $ rho, $ rr, DIMS(rr), $ lo, hi, nc, $ h $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(zz) REAL_T zz(DIMV(zz),nc) integer DIMDEC(rr) REAL_T rr(DIMV(rr),nc) REAL_T h REAL_T rho c integer i integer j integer n REAL_T denom c rho = 0.0D0 denom = -h**2/4.0D0 do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) zz(i,j,n) = rr(i,j,n)*denom rho = rho + zz(i,j,n)*rr(i,j,n) end do end do end do c end c----------------------------------------------------------------------- c c Fill in a matrix x vector operator here c subroutine FORT_ADOTX( $ y, DIMS(y), $ x, DIMS(x), $ lo, hi, nc, $ h $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(y) REAL_T y(DIMV(y),nc) integer DIMDEC(x) REAL_T x(DIMV(x),nc) REAL_T h c integer i, j, n REAL_T scal c scal = 1.0D0/h**2 c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) y(i,j,n) = scal* $ ( x(i-1,j,n) + x(i+1,j,n) $ + x(i,j-1,n) + x(i,j+1,n) $ - 4*x(i,j,n) ) end do end do end do c end c----------------------------------------------------------------------- subroutine FORT_ESTANORM( & lo, hi, nc, & h & ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer i, j, n REAL_T h,res c res = 8.0D0/h**2 end c----------------------------------------------------------------------- c c Fill in fluxes c subroutine FORT_FLUX( $ x,DIMS(x), $ lo,hi,nc, $ h, $ xflux,DIMS(xflux), $ yflux,DIMS(yflux) $ ) implicit none integer lo(BL_SPACEDIM), hi(BL_SPACEDIM), nc integer DIMDEC(x) integer DIMDEC(xflux) integer DIMDEC(yflux) REAL_T x(DIMV(x),nc) REAL_T xflux(DIMV(xflux),nc) REAL_T yflux(DIMV(yflux),nc) REAL_T h(BL_SPACEDIM) c REAL_T dhx, dhy integer i,j,n c dhx = one/h(1) dhy = one/h(2) c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1)+1 xflux(i,j,n) = - dhx*( x(i,j,n) - x(i-1,j,n) ) end do end do end do do n = 1, nc do j = lo(2), hi(2)+1 do i = lo(1), hi(1) yflux(i,j,n) = - dhy*( x(i,j,n) - x(i,j-1,n) ) end do end do end do end ccseapps-2.5/CCSEApps/mglib/LO_BCTYPES.H0000644000175000017500000000272111634153073020567 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _LO_BCTYPES_H_ #define _LO_BCTYPES_H_ /* * $Id: LO_BCTYPES.H,v 1.1 1998/03/24 07:06:14 almgren Exp $ */ #define LO_DIRICHLET 101 #define LO_NEUMANN 102 #define LO_REFLECT_ODD 103 #endif ccseapps-2.5/CCSEApps/mglib/CGSolver.cpp0000644000175000017500000006567511634153073021164 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: CGSolver.cpp,v 1.32 2003/03/12 21:03:32 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include int CGSolver::initialized = 0; int CGSolver::def_maxiter = 40; int CGSolver::def_verbose = 0; CGSolver::Solver CGSolver::def_cg_solver = BiCGStab; double CGSolver::def_unstable_criterion = 10.; static void Spacer (std::ostream& os, int lev) { for (int k = 0; k < lev; k++) { os << " "; } } void CGSolver::initialize () { ParmParse pp("cg"); pp.query("maxiter", def_maxiter); pp.query("v", def_verbose); pp.query("verbose", def_verbose); pp.query("unstable_criterion",def_unstable_criterion); int ii; if (pp.query("cg_solver", ii)) { switch (ii) { case 0: def_cg_solver = CG; break; case 1: def_cg_solver = BiCGStab; break; case 2: def_cg_solver = CG_Alt; break; default: BoxLib::Error("CGSolver::initialize(): bad cg_solver"); } } if (ParallelDescriptor::IOProcessor() && def_verbose) { std::cout << "CGSolver settings...\n"; std::cout << " def_maxiter = " << def_maxiter << '\n'; std::cout << " def_unstable_criterion = " << def_unstable_criterion << '\n'; std::cout << " def_cg_solver = " << def_cg_solver << '\n'; } initialized = 1; } CGSolver::CGSolver (LinOp& _Lp, bool _use_mg_precond, int _lev) : isExpert(false), Lp(_Lp), mg_precond(0), lev(_lev), use_mg_precond(_use_mg_precond) { if (!initialized) initialize(); maxiter = def_maxiter; verbose = def_verbose; cg_solver = def_cg_solver; set_mg_precond(); } void CGSolver::set_mg_precond () { delete mg_precond; if (use_mg_precond) { mg_precond = new MultiGrid(Lp); mg_precond->setNumIter(1); } } CGSolver::~CGSolver () { delete mg_precond; } static Real norm_inf (const MultiFab& res) { Real restot = 0.0; for (MFIter mfi(res); mfi.isValid(); ++mfi) { restot = std::max(restot, res[mfi].norm(mfi.validbox(), 0)); } ParallelDescriptor::ReduceRealMax(restot); return restot; } int CGSolver::solve (MultiFab& sol, const MultiFab& rhs, Real eps_rel, Real eps_abs, LinOp::BC_Mode bc_mode, Solver solver) { if ( solver == Automatic ) solver = cg_solver; if ( solver == CG ) return solve_cg(sol, rhs, eps_rel, eps_abs, bc_mode); if ( solver == BiCGStab ) return solve_bicgstab(sol, rhs, eps_rel, eps_abs, bc_mode); if ( solver == CG_Alt ) return solve_00(sol, rhs, eps_rel, eps_abs, bc_mode); return solve_00(sol, rhs, eps_rel, eps_abs, bc_mode); } int CGSolver::solve_00 (MultiFab& sol, const MultiFab& rhs, Real eps_rel, Real eps_abs, LinOp::BC_Mode bc_mode) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::solve_00()"); // // algorithm: // // k=0;r=rhs-A*soln_0; // while (||r_k||^2_2 > eps^2*||r_o||^2_2 && k < maxiter { // k++ // solve Mz_k-1 = r_k-1 (if preconditioning, else z_k-1 = r_k-1) // rho_k-1 = r_k-1^T z_k-1 // if (k=1) { p_1 = z_0 } // else { beta = rho_k-1/rho_k-2; p = z + beta*p } // w = Ap // alpha = rho_k-1/p^tw // x += alpha p // r -= alpha w // } // BL_ASSERT(sol.boxArray() == Lp.boxArray(lev)); BL_ASSERT(rhs.boxArray() == Lp.boxArray(lev)); int nghost = 1; int ncomp = sol.nComp(); MultiFab* s = new MultiFab(sol.boxArray(), ncomp, nghost, Fab_allocate); MultiFab* r = new MultiFab(sol.boxArray(), ncomp, nghost, Fab_allocate); MultiFab* z = new MultiFab(sol.boxArray(), ncomp, nghost, Fab_allocate); MultiFab* w = new MultiFab(sol.boxArray(), ncomp, nghost, Fab_allocate); MultiFab* p = new MultiFab(sol.boxArray(), ncomp, nghost, Fab_allocate); // // Copy initial guess into a temp multifab guaranteed to have ghost cells. // int srccomp=0; int destcomp=0; ncomp=1; nghost=0; s->copy(sol,srccomp,destcomp,ncomp); /* This routine assumes the LinOp is linear, and that when bc_mode = LinOp::Homogeneous_BC, LinOp::apply() on a zero vector will return a zero vector. Given that, we define the problem we solve here from the original equation: Lp(sol) = rhs --> Lp(s) + Lp(sol,bc_mode=LinOp::Homogeneous_BC) = rhs where s is set to the incoming solution guess. Rewriting, Lp(sol,bc_mode=LinOp::Homogeneous_BC) = r [ = rhs - Lp(s) ]. CG needs the residual of this equation on our initial guess. But because we made the above assumption, r - Lp(sol,bc_mode=LinOp::Homogeneous_BC) = r = rhs - Lp(s) Which is simply the residual of the original equation evaluated at the initial guess. Thus we get by with only one call to Lp.residual. Without this assumption, we'd need two. */ Lp.residual((*r), rhs, (*s), lev, bc_mode); // // Set initial guess for correction to 0. // sol.setVal(0.0); // // Set bc_mode=homogeneous // LinOp::BC_Mode temp_bc_mode=LinOp::Homogeneous_BC; Real rnorm = norm_inf(*r); Real rnorm0 = rnorm; Real minrnorm = rnorm; int ret = 0; // will return this value if all goes well if (verbose > 0 && ParallelDescriptor::IOProcessor()) { Spacer(std::cout, lev); std::cout << "CGsolver: Initial error (error0) = " << rnorm0 << '\n'; } Real beta, rho, rhoold = 0.0; /* The MultiFab copies used below to update z and p require nghost=0 to avoid the possibility of filling valid regions with uninitialized data in the invalid regions of neighboring grids. The default behavior in MultiFab copies will likely be changed in the future. */ // // If eps_rel or eps_abs < 0: that test is effectively bypassed. // int nit = 1; for (; nit <= maxiter && rnorm > eps_rel*rnorm0 && rnorm > eps_abs; ++nit) { if (use_mg_precond) { // // Solve Mz_k-1 = r_k-1 and rho_k-1 = r_k-1^T z_k-1 // z->setVal(0.); mg_precond->solve(*z, *r, eps_rel, eps_abs, temp_bc_mode); } else { // // No preconditioner, z_k-1 = r_k-1 and rho_k-1 = r_k-1^T r_k-1. // srccomp=0; destcomp=0; ncomp=1; z->copy((*r), srccomp, destcomp, ncomp); } rho = 0.0; int ncomp = z->nComp(); const BoxArray& gbox = r->boxArray(); for (MFIter rmfi(*r); rmfi.isValid(); ++rmfi) { Real trho; BL_ASSERT(rmfi.validbox() == gbox[rmfi.index()]); FORT_CGXDOTY(&trho,(*z)[rmfi].dataPtr(), ARLIM((*z)[rmfi].loVect()),ARLIM((*z)[rmfi].hiVect()), (*r)[rmfi].dataPtr(), ARLIM((*r)[rmfi].loVect()),ARLIM((*r)[rmfi].hiVect()), rmfi.validbox().loVect(),rmfi.validbox().hiVect(), &ncomp); rho += trho; } ParallelDescriptor::ReduceRealSum(rho); if (nit == 1) { // // k=1, p_1 = z_0 // srccomp=0; destcomp=0; ncomp=1; nghost=0; p->copy(*z, srccomp, destcomp, ncomp); } else { // // k>1, beta = rho_k-1/rho_k-2 and p = z + beta*p // beta = rho/rhoold; advance(*p, beta, *z); } // // w = Ap, and compute Transpose(p).w // Real pw = axp(*w, *p, temp_bc_mode); // // alpha = rho_k-1/p^tw // Real alpha; if( pw != 0. ){ alpha = rho/pw; } else { ret = 1; break; } if (ParallelDescriptor::IOProcessor() && verbose > 2) { Spacer(std::cout, lev); std::cout << "CGSolver_00:" << " nit " << nit << " pw " << pw << " rho " << rho << " alpha " << alpha; if (nit == 1) { std::cout << " beta undefined ..."; } else { std::cout << " beta " << beta << " ..."; } } // // x += alpha p and r -= alpha w // rhoold = rho; update(sol, alpha, *r, *p, *w); rnorm = norm_inf(*r); if (rnorm > def_unstable_criterion*minrnorm) { ret = 2; break; } else if (rnorm < minrnorm) { minrnorm = rnorm; } if (ParallelDescriptor::IOProcessor()) { if (verbose > 1 || (((eps_rel > 0. && rnorm < eps_rel*rnorm0) || (eps_abs > 0. && rnorm < eps_abs)) && verbose)) { const Real rel_error = (rnorm0 != 0) ? rnorm/rnorm0 : 0; Spacer(std::cout, lev); std::cout << "CGSolver_00: Iteration " << std::setw(4) << nit << " error/error0 " << rel_error << '\n'; } } } if (ParallelDescriptor::IOProcessor()) { if (verbose > 0 || (((eps_rel > 0. && rnorm < eps_rel*rnorm0) || (eps_abs > 0. && rnorm < eps_abs)) && verbose)) { const Real rel_error = (rnorm0 != 0) ? rnorm/rnorm0 : 0; Spacer(std::cout, lev); std::cout << "CGSolver_00: Final: Iteration " << std::setw(4) << nit << " error/error0 " << rel_error << '\n'; } } if (ret != 0 && isExpert == false) { BoxLib::Error("CGSolver_00:: apparent accuracy problem; try expert setting or change unstable_criterion"); } if (ret==0 && rnorm > eps_rel*rnorm0 && rnorm > eps_abs) { BoxLib::Error("CGSolver_00:: failed to converge!"); } // // Omit ghost update since maybe not initialized in calling routine. // BoxLib_1.99 has no MultiFab::plus(MultiFab&) member, which would // operate only in valid regions; do explicitly. Add to boundary // values stored in initialsolution. // if (ret == 0) { srccomp=0; ncomp=1; nghost=0; sol.plus(*s,srccomp,ncomp,nghost); } delete s; delete r; delete w; delete p; delete z; return ret; } void CGSolver::advance (MultiFab& p, Real beta, const MultiFab& z) { // // Compute p = z + beta p // const BoxArray& gbox = Lp.boxArray(lev); int ncomp = p.nComp(); const BoxArray& zbox = z.boxArray(); for (MFIter pmfi(p); pmfi.isValid(); ++pmfi) { BL_ASSERT(zbox[pmfi.index()] == gbox[pmfi.index()]); FORT_CGADVCP(p[pmfi].dataPtr(), ARLIM(p[pmfi].loVect()), ARLIM(p[pmfi].hiVect()), z[pmfi].dataPtr(), ARLIM(z[pmfi].loVect()), ARLIM(z[pmfi].hiVect()), &beta, zbox[pmfi.index()].loVect(), zbox[pmfi.index()].hiVect(), &ncomp); } } void CGSolver::update (MultiFab& sol, Real alpha, MultiFab& r, const MultiFab& p, const MultiFab& w) { // // compute x =+ alpha p and r -= alpha w // const BoxArray& gbox = Lp.boxArray(lev); int ncomp = r.nComp(); for (MFIter solmfi(sol); solmfi.isValid(); ++solmfi) { BL_ASSERT(solmfi.validbox() == gbox[solmfi.index()]); FORT_CGUPDATE(sol[solmfi].dataPtr(), ARLIM(sol[solmfi].loVect()), ARLIM(sol[solmfi].hiVect()), r[solmfi].dataPtr(), ARLIM(r[solmfi].loVect()), ARLIM(r[solmfi].hiVect()), &alpha, w[solmfi].dataPtr(), ARLIM(w[solmfi].loVect()), ARLIM(w[solmfi].hiVect()), p[solmfi].dataPtr(), ARLIM(p[solmfi].loVect()), ARLIM(p[solmfi].hiVect()), solmfi.validbox().loVect(), solmfi.validbox().hiVect(), &ncomp); } } Real CGSolver::axp (MultiFab& w, MultiFab& p, LinOp::BC_Mode bc_mode) { // // Compute w = A.p, and return Transpose(p).w // Real pw = 0.0; const BoxArray& gbox = Lp.boxArray(lev); Lp.apply(w, p, lev, bc_mode); int ncomp = p.nComp(); for (MFIter pmfi(p); pmfi.isValid(); ++pmfi) { Real tpw; BL_ASSERT(pmfi.validbox() == gbox[pmfi.index()]); FORT_CGXDOTY(&tpw, p[pmfi].dataPtr(), ARLIM(p[pmfi].loVect()), ARLIM(p[pmfi].hiVect()), w[pmfi].dataPtr(), ARLIM(w[pmfi].loVect()), ARLIM(w[pmfi].hiVect()), pmfi.validbox().loVect(), pmfi.validbox().hiVect(), &ncomp); pw += tpw; } ParallelDescriptor::ReduceRealSum(pw); return pw; } static void sxay (MultiFab& ss, const MultiFab& xx, Real a, const MultiFab& yy) { const int ncomp = ss.nComp(); for (MFIter smfi(ss); smfi.isValid(); ++smfi) { FORT_CGSXAY(ss[smfi].dataPtr(), ARLIM(ss[smfi].loVect()), ARLIM(ss[smfi].hiVect()), xx[smfi].dataPtr(), ARLIM(xx[smfi].loVect()), ARLIM(xx[smfi].hiVect()), &a, yy[smfi].dataPtr(), ARLIM(yy[smfi].loVect()), ARLIM(yy[smfi].hiVect()), smfi.validbox().loVect(), smfi.validbox().hiVect(), &ncomp); } } Real dotxy (const MultiFab& r, const MultiFab& z) { BL_PROFILE("CGSolver::dotxy"); int ncomp = z.nComp(); Real rho = 0.0; for (MFIter rmfi(r); rmfi.isValid(); ++rmfi) { Real trho; FORT_CGXDOTY(&trho, z[rmfi].dataPtr(), ARLIM(z[rmfi].loVect()),ARLIM(z[rmfi].hiVect()), r[rmfi].dataPtr(), ARLIM(r[rmfi].loVect()),ARLIM(r[rmfi].hiVect()), rmfi.validbox().loVect(),rmfi.validbox().hiVect(), &ncomp); rho += trho; } ParallelDescriptor::ReduceRealSum(rho); return rho; } int CGSolver::solve_bicgstab (MultiFab& sol, const MultiFab& rhs, Real eps_rel, Real eps_abs, LinOp::BC_Mode bc_mode) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::solve_bicgstab()"); const int nghost = 1; const int ncomp = 1; BL_ASSERT(sol.boxArray() == Lp.boxArray(lev)); BL_ASSERT(rhs.boxArray() == Lp.boxArray(lev)); BL_ASSERT(sol.nComp() == 1); MultiFab sorig(sol.boxArray(), ncomp, nghost); MultiFab s(sol.boxArray(), ncomp, nghost); MultiFab sh(sol.boxArray(), ncomp, nghost); MultiFab r(sol.boxArray(), ncomp, nghost); MultiFab rh(sol.boxArray(), ncomp, nghost); MultiFab p(sol.boxArray(), ncomp, nghost); MultiFab ph(sol.boxArray(), ncomp, nghost); MultiFab v(sol.boxArray(), ncomp, nghost); MultiFab t(sol.boxArray(), ncomp, nghost); if (verbose && false) { std::cout << "eps_rel = " << eps_rel << std::endl; std::cout << "eps_abs = " << eps_abs << std::endl; std::cout << "lp.norm = " << Lp.norm(0, lev) << std::endl; std::cout << "sol.norm_inf = " << norm_inf(sol) << std::endl; std::cout << "rhs.norm_inf = " << norm_inf(rhs) << std::endl; } sorig.copy(sol); Lp.residual(r, rhs, sorig, lev, bc_mode); rh.copy(r); sol.setVal(0.0); const LinOp::BC_Mode temp_bc_mode=LinOp::Homogeneous_BC; Real rnorm = norm_inf(r); const Real rnorm0 = rnorm; const Real Lp_norm = Lp.norm(0, lev); const Real rh_norm = rnorm0; Real sol_norm = 0.0; if (verbose > 0 && ParallelDescriptor::IOProcessor()) { Spacer(std::cout, lev); std::cout << "CGSolver_bicgstab: Initial error (error0) = " << rnorm0 << '\n'; } int ret = 0; // will return this value if all goes well Real rho_1 = 0, alpha = 0, omega = 0; int nit = 1; if ( rnorm == 0.0 || rnorm < eps_rel*(Lp_norm*sol_norm + rh_norm ) || rnorm < eps_abs ) { if (verbose > 0 && ParallelDescriptor::IOProcessor()) { Spacer(std::cout, lev); std::cout << "CGSolver_bicgstab: niter = 0," << ", rnorm = " << rnorm << ", eps_rel*(Lp_norm*sol_norm + rh_norm )" << eps_rel*(Lp_norm*sol_norm + rh_norm ) << ", eps_abs = " << eps_abs << std::endl; } return 0; } for (; nit <= maxiter; ++nit) { Real rho = dotxy(rh, r); if ( rho == 0 ) { ret = 1; break; } if ( nit == 1 ) { p.copy(r); } else { Real beta = (rho/rho_1)*(alpha/omega); sxay(p, p, -omega, v); sxay(p, r, beta, p); } if ( use_mg_precond ) { ph.setVal(0.0); mg_precond->solve(ph, p, eps_rel, eps_abs, temp_bc_mode); } else { ph.copy(p); } Lp.apply(v, ph, lev, temp_bc_mode); if ( Real rhTv = dotxy(rh, v) ) { alpha = rho/rhTv; } else { ret = 2; break; } sxay(sol, sol, alpha, ph); sxay(s, r, -alpha, v); rnorm = norm_inf(s); #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA sol_norm = norm_inf(sol); if ( rnorm < eps_rel*(Lp_norm*sol_norm + rh_norm ) || rnorm < eps_abs ) { break; } #else if ( rnorm < eps_rel*rnorm0 || rnorm < eps_abs ) { break; } #endif if (ParallelDescriptor::IOProcessor()) { if (verbose > 1 || (((eps_rel > 0. && rnorm < eps_rel*rnorm0) || (eps_abs > 0. && rnorm < eps_abs)) && verbose)) { Spacer(std::cout, lev); std::cout << "CGSolver_bicgstab: Half Iter " << std::setw(4) << nit << " rel. err. " << rnorm/(Lp_norm*sol_norm+rh_norm) << '\n'; } } if ( use_mg_precond ) { sh.setVal(0.0); mg_precond->solve(sh, s, eps_rel, eps_abs, temp_bc_mode); } else { sh.copy(s); } Lp.apply(t, sh, lev, temp_bc_mode); if ( Real tTt = dotxy(t,t) ) { omega = dotxy(t,s)/tTt; } else { ret = 3; break; } sxay(sol, sol, omega, sh); sxay(r, s, -omega, t); rnorm = norm_inf(r); #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA sol_norm = norm_inf(sol); if ( rnorm < eps_rel*(Lp_norm*sol_norm + rh_norm ) || rnorm < eps_abs ) { break; } #else if ( rnorm < eps_rel*rnorm0 || rnorm < eps_abs ) { break; } #endif if ( omega == 0 ) { ret = 4; break; } if (ParallelDescriptor::IOProcessor()) { if (verbose > 1 || (((eps_rel > 0. && rnorm < eps_rel*rnorm0) || (eps_abs > 0. && rnorm < eps_abs)) && verbose)) { Spacer(std::cout, lev); std::cout << "CGSolver_bicgstab: Iteration " << std::setw(4) << nit << " rel. err. " << rnorm/(Lp_norm*sol_norm+rh_norm) << '\n'; } } rho_1 = rho; } // std::cout << "norm(R) = " << rnorm << endl; // std::cout << "AX+B = " << Lp.norm(0,lev)*norm(sol) + norm(rhs) << endl; if (ParallelDescriptor::IOProcessor()) { if (verbose > 0 || (((eps_rel > 0. && rnorm < eps_rel*rnorm0) || (eps_abs > 0. && rnorm < eps_abs)) && verbose)) { Spacer(std::cout, lev); std::cout << "CGSolver_bicgstab: Final: Iteration " << std::setw(4) << nit << " rel. err. " << rnorm/(Lp_norm*sol_norm+rh_norm) << '\n'; } } if( ret != 0 && isExpert == false ) { BoxLib::Error("CGSolver_bicgstab:: apparent accuracy problem; try expert setting or change unstable_criterion"); } #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA if ( ret == 0 && rnorm > eps_rel*(Lp_norm*sol_norm + rh_norm ) && rnorm > eps_abs ) { BoxLib::Error("CGSolver_bicgstab:: failed to converge!"); } #else if ( ret == 0 && rnorm > eps_rel*rnorm0 && rnorm > eps_abs) { BoxLib::Error("CGSolver_bicgstab:: failed to converge!"); } #endif if ( ret == 0 ) { sol.plus(sorig, 0, 1, 0); } return ret; } int CGSolver::solve_cg (MultiFab& sol, const MultiFab& rhs, Real eps_rel, Real eps_abs, LinOp::BC_Mode bc_mode) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::solve_cg()"); const int nghost = 1; const int ncomp = sol.nComp(); BL_ASSERT(sol.boxArray() == Lp.boxArray(lev)); BL_ASSERT(rhs.boxArray() == Lp.boxArray(lev)); BL_ASSERT(ncomp == 1 ); MultiFab sorig(sol.boxArray(), ncomp, nghost); MultiFab r(sol.boxArray(), ncomp, nghost); MultiFab z(sol.boxArray(), ncomp, nghost); MultiFab q(sol.boxArray(), ncomp, nghost); MultiFab p(sol.boxArray(), ncomp, nghost); sorig.copy(sol); Lp.residual(r, rhs, sorig, lev, bc_mode); sol.setVal(0.0); const LinOp::BC_Mode temp_bc_mode=LinOp::Homogeneous_BC; Real rnorm = norm_inf(r); const Real rnorm0 = rnorm; Real minrnorm = rnorm; if (verbose > 0 && ParallelDescriptor::IOProcessor()) { Spacer(std::cout, lev); std::cout << "CGsolver_cg: Initial error (error0) = " << rnorm0 << '\n'; } const Real Lp_norm = Lp.norm(0, lev); const Real rh_norm = rnorm0; Real sol_norm = 0.0; int ret = 0; // will return this value if all goes well Real rho_1 = 0; int nit = 1; if ( rnorm == 0.0 || rnorm < eps_rel*(Lp_norm*sol_norm + rh_norm ) || rnorm < eps_abs ) { if (verbose > 0 && ParallelDescriptor::IOProcessor()) { Spacer(std::cout, lev); std::cout << "CGSolver_cg: niter = 0," << ", rnorm = " << rnorm << ", eps_rel*(Lp_norm*sol_norm + rh_norm )" << eps_rel*(Lp_norm*sol_norm + rh_norm ) << ", eps_abs = " << eps_abs << std::endl; } return 0; } for (; nit <= maxiter; ++nit) { if (use_mg_precond) { z.setVal(0.); mg_precond->solve(z, r, eps_rel, eps_abs, temp_bc_mode); } else { z.copy(r); } Real rho = dotxy(z,r); if (nit == 1) { p.copy(z); } else { Real beta = rho/rho_1; sxay(p, z, beta, p); } Lp.apply(q, p, lev, temp_bc_mode); Real alpha; if ( Real pw = dotxy(p, q) ) { alpha = rho/pw; } else { ret = 1; break; } if (ParallelDescriptor::IOProcessor() && verbose > 2) { Spacer(std::cout, lev); std::cout << "CGSolver_cg:" << " nit " << nit << " rho " << rho << " alpha " << alpha; } sxay(sol, sol, alpha, p); sxay( r, r,-alpha, q); rnorm = norm_inf(r); sol_norm = norm_inf(sol); #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA if ( rnorm < eps_rel*(Lp_norm*sol_norm + rh_norm) || rnorm < eps_abs ) { break; } #else if ( rnorm < eps_rel*rnorm0 || rnorm < eps_abs ) { break; } #endif if( rnorm > def_unstable_criterion*minrnorm ) { ret = 2; break; } else if( rnorm < minrnorm ) { minrnorm = rnorm; } if (ParallelDescriptor::IOProcessor()) { if (verbose > 1 || (((eps_rel > 0. && rnorm < eps_rel*rnorm0) || (eps_abs > 0. && rnorm < eps_abs)) && verbose)) { Spacer(std::cout, lev); std::cout << "CGSolver_cg: Iteration " << std::setw(4) << nit << " rel. err. " << rnorm/(Lp_norm*sol_norm+rh_norm) << '\n'; } } rho_1 = rho; } if (ParallelDescriptor::IOProcessor()) { if (verbose > 0 || (((eps_rel > 0. && rnorm < eps_rel*rnorm0) || (eps_abs > 0. && rnorm < eps_abs)) && verbose)) { Spacer(std::cout, lev); std::cout << "CGSolver_cg: Final: Iteration " << std::setw(4) << nit << " rel. err. " << rnorm/(Lp_norm*sol_norm+rh_norm) << '\n'; } } if ( ret != 0 && !isExpert ) { BoxLib::Error("CGSolver_cg:: apparent accuracy problem; try expert setting or change unstable_criterion"); } #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA if ( ret == 0 && rnorm > eps_rel*(Lp_norm*sol_norm + rh_norm) && rnorm > eps_abs ) { BoxLib::Error("CGSolver_cg:: failed to converge!"); } #else if ( ret == 0 && rnorm > eps_rel*rnorm0 && rnorm > eps_abs ) { BoxLib::Error("CGSolver_cg:: failed to converge!"); } #endif if ( ret == 0 ) { sol.plus(sorig, 0, 1, 0); } return ret; } ccseapps-2.5/CCSEApps/mglib/ABec_F.H0000644000175000017500000002232511634153073020125 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _AABBEC_F_H_ #define _AABBEC_F_H_ /* ** $Id: ABec_F.H,v 1.5 2002/04/26 22:10:02 lijewski Exp $ */ #include #if defined(BL_LANG_FORT) #if (BL_SPACEDIM == 2) #define FORT_GSRB gsrb2daabbec #define FORT_CGPRECND cgprecnd2daabbec #define FORT_ADOTX adotx2daabbec #define FORT_NORMA norma2daabbec #define FORT_FLUX flux2daabbec #endif #if (BL_SPACEDIM == 3) #define FORT_GSRB gsrb3daabbec #define FORT_CGPRECND cgprecnd3daabbec #define FORT_ADOTX adotx3daabbec #define FORT_NORMA norma3daabbec #define FORT_FLUX flux3daabbec #endif #else #if (BL_SPACEDIM == 2) #if defined(BL_FORT_USE_UPPERCASE) #define FORT_GSRB GSRB2DAABBEC #define FORT_CGPRECND CGPRECND2DAABBEC #define FORT_ADOTX ADOTX2DAABBEC #define FORT_NORMA NORMA2DAABBEC #define FORT_FLUX FLUX2DAABBEC #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_GSRB gsrb2daabbec #define FORT_CGPRECND cgprecnd2daabbec #define FORT_ADOTX adotx2daabbec #define FORT_NORMA norma2daabbec #define FORT_FLUX flux2daabbec #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_GSRB gsrb2daabbec_ #define FORT_CGPRECND cgprecnd2daabbec_ #define FORT_ADOTX adotx2daabbec_ #define FORT_NORMA norma2daabbec_ #define FORT_FLUX flux2daabbec_ #endif #endif #if (BL_SPACEDIM == 3) #if defined(BL_FORT_USE_UPPERCASE) #define FORT_GSRB GSRB3DAABBEC #define FORT_CGPRECND CGPRECND3DAABBEC #define FORT_ADOTX ADOTX3DAABBEC #define FORT_NORMA NORMA3DAABBEC #define FORT_FLUX FLUX3DAABBEC #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_GSRB gsrb3daabbec #define FORT_CGPRECND cgprecnd3daabbec #define FORT_ADOTX adotx3daabbec #define FORT_NORMA norma3daabbec #define FORT_FLUX flux3daabbec #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_GSRB gsrb3daabbec_ #define FORT_CGPRECND cgprecnd3daabbec_ #define FORT_ADOTX adotx3daabbec_ #define FORT_NORMA norma3daabbec_ #define FORT_FLUX flux3daabbec_ #endif #endif #include extern "C" { #if (BL_SPACEDIM == 2) void FORT_GSRB ( Real* phi , ARLIM_P(phi_lo), ARLIM_P(phi_hi), const Real* rhs , ARLIM_P(rhs_lo), ARLIM_P(phi_hi), const Real* alpha, const Real* beta, const Real* a , ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* bX , ARLIM_P(bX_lo), ARLIM_P(bX_hi), const Real* bY , ARLIM_P(bY_lo), ARLIM_P(bY_hi), const Real* den0, ARLIM_P(den0_lo),ARLIM_P(den0_hi), const int* m0 , ARLIM_P(m0_lo), ARLIM_P(m0_hi), const Real* den1, ARLIM_P(den1_lo),ARLIM_P(den1_hi), const int* m1 , ARLIM_P(m1_lo), ARLIM_P(m1_hi), const Real* den2, ARLIM_P(den2_lo),ARLIM_P(den2_hi), const int* m2 , ARLIM_P(m2_lo), ARLIM_P(m2_hi), const Real* den3, ARLIM_P(den3_lo),ARLIM_P(den3_hi), const int* m3 , ARLIM_P(m3_lo), ARLIM_P(m3_hi), const int* lo, const int* hi, const int *nc, const Real *h, const int* redblack ); void FORT_CGPRECND( Real *tmpz , ARLIM_P(tmpz_lo), ARLIM_P(tmpz_hi), Real *rho, const Real *tmpr, ARLIM_P(tmpr_lo), ARLIM_P(tmpr_hi), const Real* alpha, const Real* beta, const Real* a , ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* bX, ARLIM_P(bX_lo), ARLIM_P(bX_hi), const Real* bY, ARLIM_P(bY_lo), ARLIM_P(bY_hi), const int *lo, const int *hi, const int *nc, const Real *h ); void FORT_ADOTX( Real *y , ARLIM_P(y_lo), ARLIM_P(y_hi), const Real *x, ARLIM_P(x_lo), ARLIM_P(x_hi), const Real* alpha, const Real* beta, const Real* a , ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* bX, ARLIM_P(bX_lo), ARLIM_P(bX_hi), const Real* bY, ARLIM_P(bY_lo), ARLIM_P(bY_hi), const int *lo, const int *hi, const int *nc, const Real *h ); void FORT_NORMA( Real* res , const Real* alpha, const Real* beta, const Real* a , ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* bX, ARLIM_P(bX_lo), ARLIM_P(bX_hi), const Real* bY, ARLIM_P(bY_lo), ARLIM_P(bY_hi), const int *lo, const int *hi, const int *nc, const Real *h ); void FORT_FLUX( const Real *x, ARLIM_P(x_lo), ARLIM_P(x_hi), const Real* alpha, const Real* beta, const Real* a , ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* bX, ARLIM_P(bX_lo), ARLIM_P(bX_hi), const Real* bY, ARLIM_P(bY_lo), ARLIM_P(bY_hi), const int *lo, const int *hi, const int *nc, const Real *h, const Real* xflux, ARLIM_P(xflux_lo), ARLIM_P(xflux_hi), const Real* yflux, ARLIM_P(yflux_lo), ARLIM_P(yflux_hi) ); #endif #if (BL_SPACEDIM == 3) void FORT_GSRB ( Real* phi, ARLIM_P(phi_lo), ARLIM_P(phi_hi), const Real* rhs, ARLIM_P(rhs_lo), ARLIM_P(rhs_hi), const Real* alpha, const Real* beta, const Real* a , ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* bX, ARLIM_P(bX_lo), ARLIM_P(bX_hi), const Real* bY, ARLIM_P(bY_lo), ARLIM_P(bY_hi), const Real* bZ, ARLIM_P(bZ_lo), ARLIM_P(bZ_hi), const Real* den0, ARLIM_P(den0_lo), ARLIM_P(den0_hi), const int* m0 , ARLIM_P(m0_lo), ARLIM_P(m0_hi), const Real* den1, ARLIM_P(den1_lo), ARLIM_P(den1_hi), const int* m1 , ARLIM_P(m1_lo), ARLIM_P(m1_hi), const Real* den2, ARLIM_P(den2_lo), ARLIM_P(den2_hi), const int* m2 , ARLIM_P(m2_lo), ARLIM_P(m2_hi), const Real* den3, ARLIM_P(den3_lo), ARLIM_P(den3_hi), const int* m3 , ARLIM_P(m3_lo), ARLIM_P(m3_hi), const Real* den4, ARLIM_P(den4_lo), ARLIM_P(den4_hi), const int* m4 , ARLIM_P(m4_lo), ARLIM_P(m4_hi), const Real* den5, ARLIM_P(den5_lo), ARLIM_P(den5_hi), const int* m5 , ARLIM_P(m5_lo), ARLIM_P(m5_hi), const int* lo, const int* hi, const int *nc, const Real *h, const int* redblack ); void FORT_CGPRECND( Real *tmpz , ARLIM_P(tmpz_lo), ARLIM_P(tmpz_hi), Real *rho, const Real *tmpr, ARLIM_P(tmpr_lo), ARLIM_P(tmpr_hi), const Real* alpha, const Real* beta, const Real* a , ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* bX, ARLIM_P(bX_lo), ARLIM_P(bX_hi), const Real* bY, ARLIM_P(bY_lo), ARLIM_P(bY_hi), const Real* bZ, ARLIM_P(bZ_lo), ARLIM_P(bZ_hi), const int *lo, const int *hi, const int *nc, const Real *h ); void FORT_ADOTX( Real *y , ARLIM_P(y_lo), ARLIM_P(y_hi), const Real *x, ARLIM_P(x_lo), ARLIM_P(x_hi), const Real* alpha, const Real* beta, const Real* a , ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* bX, ARLIM_P(bX_lo), ARLIM_P(bX_hi), const Real* bY, ARLIM_P(bY_lo), ARLIM_P(bY_hi), const Real* bZ, ARLIM_P(bZ_lo), ARLIM_P(bZ_hi), const int *lo, const int *hi, const int *nc, const Real *h ); void FORT_NORMA( Real* res , const Real* alpha, const Real* beta, const Real* a , ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* bX, ARLIM_P(bX_lo), ARLIM_P(bX_hi), const Real* bY, ARLIM_P(bY_lo), ARLIM_P(bY_hi), const Real* bZ, ARLIM_P(bZ_lo), ARLIM_P(bZ_hi), const int *lo, const int *hi, const int *nc, const Real *h ); void FORT_FLUX( const Real *x, ARLIM_P(x_lo), ARLIM_P(x_hi), const Real* alpha, const Real* beta, const Real* a , ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* bX, ARLIM_P(bX_lo), ARLIM_P(bX_hi), const Real* bY, ARLIM_P(bY_lo), ARLIM_P(bY_hi), const Real* bZ, ARLIM_P(bZ_lo), ARLIM_P(bZ_hi), const int *lo, const int *hi, const int *nc, const Real *h, Real* xflux, ARLIM_P(xflux_lo), ARLIM_P(xflux_hi), Real* yflux, ARLIM_P(yflux_lo), ARLIM_P(yflux_hi), Real* zflux, ARLIM_P(zflux_lo), ARLIM_P(zflux_hi) ); #endif } #endif #endif /*_AABBEC_F_H_*/ ccseapps-2.5/CCSEApps/mglib/InterpBndryData.cpp0000644000175000017500000002001011634153073022500 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: InterpBndryData.cpp,v 1.16 2002/11/12 17:08:48 lijewski Exp $ // #include #include #include #include #include static BDInterpFunc* bdfunc[2*BL_SPACEDIM]; static int bdfunc_set = 0; static void bdfunc_init () { Orientation xloface(0,Orientation::low); Orientation xhiface(0,Orientation::high); bdfunc[xloface] = FORT_BDINTERPXLO; bdfunc[xhiface] = FORT_BDINTERPXHI; #if (BL_SPACEDIM > 1) Orientation yloface(1,Orientation::low); Orientation yhiface(1,Orientation::high); bdfunc[yloface] = FORT_BDINTERPYLO; bdfunc[yhiface] = FORT_BDINTERPYHI; #endif #if (BL_SPACEDIM > 2) Orientation zloface(2,Orientation::low); Orientation zhiface(2,Orientation::high); bdfunc[zloface] = FORT_BDINTERPZLO; bdfunc[zhiface] = FORT_BDINTERPZHI; #endif } #if (BL_SPACEDIM == 2) #define NUMDERIV 2 #endif #if (BL_SPACEDIM == 3) #define NUMDERIV 5 #endif #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); #define DEF_CLIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ const Real* fabdat = (fab).dataPtr(); InterpBndryData::InterpBndryData (const BoxArray& _grids, int _ncomp, const Geometry& geom) : BndryData(_grids,_ncomp,geom) {} // // At the coarsest level the bndry values are taken from adjacent grids. // void InterpBndryData::setBndryValues (const MultiFab& mf, int mf_start, int bnd_start, int num_comp, const BCRec& bc) { // // Check that boxarrays are identical. // BL_ASSERT(grids.size()); BL_ASSERT(grids == mf.boxArray()); IntVect ref_ratio = IntVect::TheUnitVector(); for (int n = bnd_start; n < bnd_start+num_comp; ++n) setBndryConds(bc, ref_ratio, n); for (MFIter mfi(mf); mfi.isValid(); ++mfi) { BL_ASSERT(grids[mfi.index()] == mfi.validbox()); const Box& bx = grids[mfi.index()]; for (OrientationIter fi; fi; ++fi) { Orientation face(fi()); if (bx[face]==geom.Domain()[face] && !geom.isPeriodic(face.coordDir())) { // // Physical bndry, copy from grid. // FArrayBox& bnd_fab = bndry[face][mfi.index()]; bnd_fab.copy(mf[mfi.index()],mf_start,bnd_start,num_comp); } } } } // // (1) set bndry type and location of bndry value on each face of // each grid // (2) set actual bndry value by: // (A) Interpolate from crse bndryRegister at crse/fine interface // (B) Copy from ghost region of MultiFab at physical bndry // void InterpBndryData::setBndryValues (::BndryRegister& crse, int c_start, const MultiFab& fine, int f_start, int bnd_start, int num_comp, IntVect& ratio, const BCRec& bc) { if (!bdfunc_set) bdfunc_init(); // // Check that boxarrays are identical. // BL_ASSERT(grids.size()); BL_ASSERT(grids == fine.boxArray()); // // Set bndry types and bclocs. // setBndryConds(bc, ratio); // // First interpolate from coarse to fine on bndry. // const Box& fine_domain = geom.Domain(); // // Mask turned off if covered by fine grid. // Real* derives = 0; int tmplen = 0; for (MFIter fine_mfi(fine); fine_mfi.isValid(); ++fine_mfi) { BL_ASSERT(grids[fine_mfi.index()] == fine_mfi.validbox()); const Box& fine_bx = fine_mfi.validbox(); Box crse_bx = BoxLib::coarsen(fine_bx,ratio); const int* cblo = crse_bx.loVect(); const int* cbhi = crse_bx.hiVect(); int mxlen = crse_bx.longside() + 2; if (pow(float(mxlen), float(BL_SPACEDIM-1)) > tmplen) { delete [] derives; tmplen = mxlen; #if (BL_SPACEDIM > 2) tmplen *= mxlen; #endif derives = new Real[tmplen*NUMDERIV]; } const int* lo = fine_bx.loVect(); const int* hi = fine_bx.hiVect(); const FArrayBox &fine_grd = fine[fine_mfi]; for (OrientationIter fi; fi; ++fi) { Orientation face(fi()); int dir = face.coordDir(); if (fine_bx[face] != fine_domain[face] || geom.isPeriodic(dir)) { // // Internal or periodic edge, interpolate from crse data. // const Mask& mask = masks[face][fine_mfi.index()]; const int* mlo = mask.loVect(); const int* mhi = mask.hiVect(); const int* mdat = mask.dataPtr(); const FArrayBox& crse_fab = crse[face][fine_mfi.index()]; const int* clo = crse_fab.loVect(); const int* chi = crse_fab.hiVect(); const Real* cdat = crse_fab.dataPtr(c_start); FArrayBox& bnd_fab = bndry[face][fine_mfi.index()]; const int* blo = bnd_fab.loVect(); const int* bhi = bnd_fab.hiVect(); Real* bdat = bnd_fab.dataPtr(bnd_start); int is_not_covered = BndryData::not_covered; Box crsebnd = BoxLib::adjCell(crse_bx,face,1); for (int k=0;k #include "CG_F.H" #include "ArrayLim.H" c----------------------------------------------------------------------- c c CGUPDATE: Modify the input arrays as follows: c c phi = phi + a*pp c rr = rr - a*ww through range lo:hi c c phi <=> c rr <=> c a <= c ww <= c pp <= c c----------------------------------------------------------------------- subroutine FORT_CGUPDATE( $ phi, DIMS(phi), $ rr, DIMS(rr), $ a, $ ww, DIMS(ww), $ pp, DIMS(pp), $ lo, hi, nc $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(rr) REAL_T rr(DIMV(rr),nc) integer DIMDEC(ww) REAL_T ww(DIMV(ww),nc) integer DIMDEC(pp) REAL_T pp(DIMV(pp),nc) integer DIMDEC(phi) REAL_T phi(DIMV(phi),nc) REAL_T a c ::: wyc change -- why was a a vector? c REAL_T a(nc) c integer i,j,k,n c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i,j,k,n) = phi(i,j,k,n) + a * pp(i,j,k,n) rr(i,j,k,n) = rr(i,j,k,n) - a * ww(i,j,k,n) c ::: wyc change -- why was a a vector? c phi(i,j,k,n) = phi(i,j,k,n) + a(n) * pp(i,j,k,n) c rr(i,j,k,n) = rr(i,j,k,n) - a(n) * ww(i,j,k,n) end do end do end do end do c end c----------------------------------------------------------------------- c c CGADVCP: Modify the input arrays as follows: c c pp = rr + b*pp through range lo:hi c c pp <=> c rr <=> c b <= c c----------------------------------------------------------------------- subroutine FORT_CGADVCP( $ pp, DIMS(pp), $ rr, DIMS(rr), $ b, $ lo, hi, nc $ ) c integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(rr) REAL_T rr(DIMV(rr),nc) integer DIMDEC(pp) REAL_T pp(DIMV(pp),nc) REAL_T b c ::: wyc change c REAL_T b(nc) c c integer i,j,k,n c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) pp(i,j,k,n) = rr(i,j,k,n) + b*pp(i,j,k,n) c pp(i,j,k,n) = rr(i,j,k,n) + b(n)*pp(i,j,k,n) end do end do end do end do c end c----------------------------------------------------------------------- c c CGAXP: Modify the input as follows: c c pw = Transpose(pp) . ww through range lo:hi c c pw => c pp <= c ww <= c c----------------------------------------------------------------------- subroutine FORT_CGXDOTY( $ pw, $ pp, DIMS(pp), $ ww, DIMS(ww), $ lo, hi, nc $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(ww) REAL_T ww(DIMV(ww),nc) integer DIMDEC(pp) REAL_T pp(DIMV(pp),nc) REAL_T pw c integer i, j, k, n c pw = 0.0D0 do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) pw = pw + pp(i,j,k,n)*ww(i,j,k,n) end do end do end do end do c end c----------------------------------------------------------------------- subroutine FORT_CGSXAY( $ ss, DIMS(ss), $ xx, DIMS(xx), $ a, $ yy, DIMS(yy), $ lo, hi, nc $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(ss) REAL_T ss(DIMV(ss),nc) integer DIMDEC(xx) REAL_T xx(DIMV(xx),nc) integer DIMDEC(yy) REAL_T yy(DIMV(yy),nc) REAL_T a c integer i, j, k, n c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) ss(i,j,k,n) = xx(i,j,k,n) + a*yy(i,j,k,n) end do end do end do end do c end ccseapps-2.5/CCSEApps/mglib/MultiGrid.H0000644000175000017500000003740311634153073020771 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MULTIGRID_H_ #define _MULTIGRID_H_ // // $Id: MultiGrid.H,v 1.11 2001/08/01 21:51:04 lijewski Exp $ // #include #include #include #include #include #include #include #include //@Man: /*@Memo: A MultiGrid solves the linear equation, L(phi)=rhs, for a LinOp L and MultiFabs rhs and phi using a V-type cycle of the MultiGrid algorithm */ /*@Doc: A MultiGrid object solves the linear equation, L(phi)=rhs for a LinOp L, and MultiFabs phi and rhs. A MultiGrid is constructed with a fully initialized 2D or 3D LinOp, and responds to "solve" requests of various signatures, ultimately performing a recursive "relax" operation over a hierachy of grid levels. The LinOp therefore must employ "levels" of application, as well as be able to provide an implementation of the Gauss-Seidel red-black iterations on all levels. At the coarsest level, the user has the option of applying the GSRB smoother a set number of iterations. Optionally, a Conjugate Gradient solver, CGSolver, may be used to solve the coarsest system. If the user chooses to use the conjugate gradient bottom solve, the absolute and relative tolerances of this solve are independently settable distinct from the tolerances of the mg solve. However, it rarely makes sense to stop cg after a fixed number of iterations, so that capability was omited, wrt the mg options. As a final option, the user may choose to follow the cg solve with a fixed number of relaxation passes (the relaxer within the class LinOp). The solve request (implicitly) includes a flag as to whether the system is to be solved with homogeneous boundary conditions or no. If homogeneous BCs are requested, all boundary information within the LinOp is used, except that the values of boundary FabSets are zeroed. Implementation Note: This algorithm implements solution of equations in a way that requires linearity of the operator. In "residual correction form", equations are solved only for the "correction" to the initial guess that is required to solve the desired system. In particular, boundary conditions are assumed to be satisfied after a single application of the linear operator (therefore, the correction is homogeneous at the boundary). As a result, after putting the problem in residual correction form, the entire system MG hierarchy has homigeneous boundary conditions (thus avoiding the need to interpolate BC values, and simplifying the logic of the coarse-fine transfer operations). This solver therefore cannot incorporate fully nonlinear systems. Default settings: There are a number of options in the multigrid algorithm details. In addition to changing the actual smoothers employed, the user has access to the following parameters (defaults shown in parentheses): \begin{itemize} \item nu\_1(2) Number of passes of the pre-smoother \item nu\_2(2) Number of passes of the post-smoother \item nu\_0(1) Number of passes of the coarse-grid smoother per cycle \item nu\_f(8) Number of passes of the bottom smoother (if not using the conjugate-gradient bottom solve) \item maxiter(40) Maximum number of full multigrid cycles allowed to solve the system \item numiter(-1) Number of full multigrid cycles to perform (should be less than maxiter for fixed number of MG cycles; value is ignored if < 0) \item verbose(0) Verbosity (1-results, 2-progress) \item usecg(1) Whether to use the conjugate-gradient solver for the coarsest (bottom) solve of the multigrid hierarchy \item atol\_b(-1.0) Absolute error tolerance (<0 => ignored) for cg \item rtol\_b(.01) Relative error tolerance (<0 => ignored) for cg \item nu\_b(0) Number of passes of the bottom smoother taken {\it AFTER} the cg bottom solve (value ignored if <= 0) \item numLevelsMAX(1024) maximum number of mg levels \end{itemize} This class does NOT provide a copy constructor or assignment operator. */ class MultiGrid { public: // //@ManDoc: constructor // MultiGrid (LinOp& _Lp); // //@ManDoc: destructor // virtual ~MultiGrid (); // //@ManDoc: solve the system to relative err eps\_rel, absolute err eps\_abs // virtual void solve (MultiFab& solution, const MultiFab& _rhs, Real eps_rel = -1.0, Real eps_abs = -1.0, LinOp::BC_Mode bc_mode=LinOp::Inhomogeneous_BC); // //@ManDoc: return the linear operator // LinOp& linOp (); // //@ManDoc: set the maximum permitted multigrid iterations // void setMaxIter (int _maxiter); // //@ManDoc: return the maximum permitted multigrid iterations // int getMaxIter () const; // //@ManDoc: set the number of multigrid iterations to perform // void setNumIter (int _numiter); // //@ManDoc: return the number of multigrid iterations // int getNumIter () const; // //@ManDoc: set the flag for whether to use CGSolver at coarsest level // void setUseCG (int _usecg); // //@ManDoc: return the flag for whether to use CGSolver at coarsest level // int getUseCG () const; // //@ManDoc: set/return the number of multigrid levels // int getNumLevels (int _numlevels); // //@ManDoc: return the number of multigrid levels // int getNumLevels () const; // //@ManDoc: set the verbosity value // void setVerbose (int _verbose); // //@ManDoc: return the verbosity value // int getVerbose (); // //@ManDoc: set the number of passes of the pre-smoother // void set_preSmooth (int pre_smooth); // //@ManDoc: set the number of passes of the post-smoother // void set_postSmooth (int post_smooth); // //@ManDoc: set the number of passes of the coarse-grid smoother/mg iteration // void set_cntRelax (int cnt_relax); // //@ManDoc: set the number of passes of the bottom mg relaxer // void set_finalSmooth (int final_smooth); // //@ManDoc: Return the number of pre-smooth iterations at the level // int preSmooth () const; // //@ManDoc: Return the number of post-smooth iterations at the level // int postSmooth () const; // //@ManDoc: Return the number of level relaxations (not implemented) // int cntRelax () const; // //@ManDoc: Return the number of smoothing passes at bottom of MG (if no cg) // int finalSmooth () const; // //@ManDoc: set the maximum permitted absolute tolerance (<0 bypasses test) // void set_atol_b (Real atol); // //@ManDoc: get the maximum permitted absolute tolerance // Real get_atol_b () const; // //@ManDoc: set the maximum permitted relative tolerance (<0 bypasses test) // void set_rtol_b (Real rtol); // //@ManDoc: get the maximum permitted relative tolerance // Real get_rtol_b () const; // //@ManDoc: set the number of post-cg relax passes // void set_nu_b (int _nu_b); // //@ManDoc: set the number of post-cg relax passes // int get_nu_b () const; CGSolver::Solver getCGSolver() const; void setCGSolver(CGSolver::Solver solver_); void set_maxiter_b (int n); // //@ManDoc: get the maximum permitted relative tolerance // int get_maxiter_b () const; protected: //@ManMemo: Internal members // //@ManDoc: Solve the linear system to relative and absolute tolerance // virtual int solve_ (MultiFab& _sol, Real _eps_rel, Real _eps_abs, LinOp::BC_Mode bc_mode, int level); // //@ManDoc: Put the system in r-c form // void residualCorrectionForm (MultiFab& newrhs, const MultiFab& oldrhs, MultiFab& initialsolution, const MultiFab& inisol, LinOp::BC_Mode bc_mode, int level); // //@ManDoc: Make space, set switches for new solution level // void prepareForLevel (int level); // //@ManDoc: Compute the number of multigrid levels, assuming ratio=2 // int numLevels () const; // //@ManDoc: Return scalar estimate of error // virtual Real errorEstimate (int level, LinOp::BC_Mode bc_mode); // //@ManDoc: Transfer MultiFab from fine to coarse level // void average (MultiFab& c, const MultiFab& f); // //@ManDoc: Transfer MultiFab from coarse to fine level // void interpolate (MultiFab& f, const MultiFab& c); // //@ManDoc: Perform a MG V-cycle // void relax (MultiFab& solL, MultiFab& rhsL, int level, Real eps_rel, Real eps_abs, LinOp::BC_Mode bc_mode); // //@ManDoc: Perform relaxation at bottom of V-cycle // virtual void coarsestSmooth (MultiFab& solL, MultiFab& rhsL, int level, Real eps_rel, Real eps_abs, LinOp::BC_Mode bc_mode, int local_usecg); // //@ManDoc: default flag, whether to use CG at bottom of MG cycle // static int def_usecg; // //@ManDoc: set flags, etc // static void initialize (); // //@ManDoc: default number of level, pre-, post- and bottom smooths // static int def_nu_0, def_nu_1, def_nu_2, def_nu_f; // //@ManDoc: default number of post-cg relax passes // static int def_nu_b; // //@ManDoc: default maximum number of complete MG cycle iterations // static int def_maxiter; // //@ManDoc: default number of complete MG cycle iterations to perform // static int def_numiter; // //@ManDoc: default verbosity // static int def_verbose; // //@ManDoc: default relative, absolute tolerance for cg solve // static Real def_rtol_b, def_atol_b; static int def_maxiter_b; // //@ManDoc: default maximum number of mg levels // static int def_numLevelsMAX; // //@ManDoc: default flag controlling the behaviour when the cg solver returns indicating unstable // static int def_smooth_on_cg_unstable; // static CGSolver::Solver def_cg_solver; CGSolver::Solver cg_solver; // //@ManDoc: verbosity // int verbose; // //@ManDoc: Number of MG levels // int numlevels; // //@ManDoc: current maximum number of allowed iterations // int maxiter; // //@ManDoc: current number of iterations to take // int numiter; // //@ManDoc: current number of level, pre-, post- and bottom smooths // int nu_0, nu_1, nu_2, nu_f; // //@ManDoc: current number of post-cg relax passes // int nu_b; // //@ManDoc: current flag, whether to use CG at bottom of MG cycle // int usecg; // //@ManDoc: relative, absolute tolerance, maxiter for cg bottom solver. // Real rtol_b, atol_b; int maxiter_b; // //@ManDoc: maximum number of mg levels // int numLevelsMAX; // //@ManDoc: flag controlling the behaviour when the cg solver returns indicating unstable // int smooth_on_cg_unstable; // //@ManDoc: internal temp data to store initial guess of solution // MultiFab* initialsolution; // //@ManDoc: internal temp data // Array< MultiFab* > res; // //@ManDoc: internal temp data // Array< MultiFab* > rhs; // //@ManDoc: internal temp data // Array< MultiFab* > cor; // //@ManDoc: internal reference to linear operator // LinOp &Lp; private: // // Flag, whether initialized. // static bool initialized; // // Disallow copy constructor, assignment operator // MultiGrid (const MultiGrid&); MultiGrid& operator= (const MultiGrid&); }; inline LinOp& MultiGrid::linOp () { return Lp; } inline void MultiGrid::setMaxIter (int _maxiter) { maxiter = _maxiter; } inline int MultiGrid::getMaxIter () const { return maxiter; } inline void MultiGrid::setNumIter (int _numiter) { numiter = _numiter; } inline int MultiGrid::getNumIter () const { return numiter; } inline void MultiGrid::setUseCG (int _usecg) { usecg = _usecg; } inline int MultiGrid::getUseCG () const { return usecg; } inline int MultiGrid::getNumLevels () const { return numlevels; } inline void MultiGrid::setVerbose (int _verbose) { verbose = _verbose; } inline int MultiGrid::getVerbose () { return verbose; } inline void MultiGrid::set_preSmooth (int pre_smooth) { nu_1 = pre_smooth; } inline void MultiGrid::set_postSmooth (int post_smooth) { nu_2 = post_smooth; } inline void MultiGrid::set_cntRelax (int cnt_relax) { nu_0 = cnt_relax; } inline void MultiGrid::set_finalSmooth (int final_smooth) { nu_f = final_smooth; } inline int MultiGrid::preSmooth () const { return nu_1; } inline int MultiGrid::postSmooth () const { return nu_2; } inline int MultiGrid::cntRelax () const { return nu_0; } inline int MultiGrid::finalSmooth () const { return nu_f; } inline void MultiGrid::set_atol_b (Real atol) { atol_b = atol; } inline Real MultiGrid::get_atol_b () const { return atol_b; } inline void MultiGrid::set_rtol_b (Real rtol) { rtol_b = rtol; } inline Real MultiGrid::get_rtol_b () const { return rtol_b; } inline void MultiGrid::set_maxiter_b (int n) { maxiter_b = n; } inline int MultiGrid::get_maxiter_b () const { return maxiter_b; } inline void MultiGrid::set_nu_b (int _nu_b) { nu_b = _nu_b; } inline int MultiGrid::get_nu_b () const { return nu_b; } inline void MultiGrid::setCGSolver (CGSolver::Solver cg_solver_) { cg_solver = cg_solver_; } inline CGSolver::Solver MultiGrid::getCGSolver () const { return cg_solver; } inline int MultiGrid::getNumLevels (int _numlevels) { BL_ASSERT(_numlevels >= 0); int oldnumlevels = numlevels; numlevels = std::min(_numlevels, numLevels()); return oldnumlevels; } #endif /*_MULTIGRID_H_*/ ccseapps-2.5/CCSEApps/mglib/MG_2D.F0000644000175000017500000000600111634153073017705 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: MG_2D.F,v 1.3 1999/02/03 00:39:25 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include #include "MG_F.H" #include "ArrayLim.H" c----------------------------------------------------------------------- subroutine FORT_AVERAGE ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc $ ) integer nc integer DIMDEC(f) integer DIMDEC(c) integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) REAL_T f(DIMV(f),nc) REAL_T c(DIMV(c),nc) c integer i integer j integer n REAL_T denom parameter(denom=fourth) c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) c(i,j,n) = ( $ f(2*i+1,2*j+1,n) + f(2*i ,2*j+1,n) $ + f(2*i+1,2*j,n ) + f(2*i ,2*j ,n))*denom end do end do end do c end c----------------------------------------------------------------------- subroutine FORT_INTERP ( $ f, DIMS(f), $ c, DIMS(c), $ lo, hi, nc $ ) integer nc integer DIMDEC(f) integer DIMDEC(c) integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) REAL_T f(DIMV(f),nc) REAL_T c(DIMV(c),nc) c integer i integer j integer n c do n = 1, nc do j = lo(2), hi(2) cdir$ ivdep do i = lo(1), hi(1) f(2*i+1,2*j+1,n) = c(i,j,n) + f(2*i+1,2*j+1,n) f(2*i ,2*j+1,n) = c(i,j,n) + f(2*i ,2*j+1,n) f(2*i+1,2*j ,n) = c(i,j,n) + f(2*i+1,2*j ,n) f(2*i ,2*j ,n) = c(i,j,n) + f(2*i ,2*j ,n) end do end do end do c end ccseapps-2.5/CCSEApps/mglib/BndryData.cpp0000644000175000017500000002255311634153073021334 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BndryData.cpp,v 1.17 2002/11/26 22:47:22 lijewski Exp $ // #include #include #include #include #include // Mask info required for this many cells past grid edge // (here, e.g. ref=4, crse stencil width=3, and let stencil slide 2 past grid edge) int BndryData::NTangHalfWidth = 5; BndryData::BndryData (const BoxArray& _grids, int _ncomp, const Geometry& _geom) : geom(_geom) { define(_grids,_ncomp,_geom); } void BndryData::init (const BndryData& src) { // // Got to save the geometric info. // geom = src.geom; // // Redefine grids and bndry array. // const int ngrd = grids.size(); const int ncomp = src.nComp(); for (OrientationIter fi; fi; ++fi) { const Orientation face = fi(); bcond[face].resize(ngrd); for (int grd = 0; grd < ngrd; ++grd) { bcond[face][grd].resize(ncomp); for (int n = 0; n < ncomp; ++n) bcond[face][grd][n] = src.bcond[face][grd][n]; } bcloc[face].resize(ngrd); masks[face].resize(ngrd); for (FabSetIter bfsi(bndry[face]); bfsi.isValid(); ++bfsi) { const int grd = bfsi.index(); bcloc[face][grd] = src.bcloc[face][grd]; const Mask& src_mask = src.masks[face][grd]; Mask* m = new Mask(src_mask.box(),src_mask.nComp()); m->copy(src_mask); masks[face].set(grd,m); } } } BndryData::BndryData (const BndryData& src) : BndryRegister(src) { init(src); } BndryData& BndryData::operator= (const BndryData& src) { BndryRegister::operator=(src); clear_masks(); init(src); return *this; } BndryData::~BndryData () { // // Masks was not allocated with PArrayManage -- manually dealloc. // clear_masks(); } void BndryData::clear_masks () { for (OrientationIter oitr; oitr; oitr++) { const Orientation face = oitr(); for (int k = 0; k < masks[face].size(); k++) { if (masks[face].defined(k)) { delete masks[face].remove(k); } } } } void BndryData::define (const BoxArray& _grids, int _ncomp, const Geometry& _geom) { geom = _geom; BndryRegister::setBoxes(_grids); const int ngrd = grids.size(); BL_ASSERT(ngrd > 0); Array pshifts(27); for (OrientationIter fi; fi; ++fi) { const Orientation face = fi(); const int coord_dir = face.coordDir(); masks[face].resize(ngrd); bcloc[face].resize(ngrd); bcond[face].resize(ngrd); for (int ig = 0; ig < ngrd; ++ig) { bcond[face][ig].resize(_ncomp); } BndryRegister::define(face,IndexType::TheCellType(),0,1,0,_ncomp); // // Alloc mask and set to quad_interp value. // for (FabSetIter bfsi(bndry[face]); bfsi.isValid(); ++bfsi) { Box face_box = BoxLib::adjCell(grids[bfsi.index()], face, 1); // // Extend box in directions orthogonal to face normal. // for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (dir == coord_dir) continue; face_box.grow(dir,NTangHalfWidth); } Mask* m = new Mask(face_box); m->setVal(outside_domain,0); Box dbox = geom.Domain() & face_box; m->setVal(not_covered,dbox,0); // // Now have to set as not_covered the periodic translates as well. // if (geom.isAnyPeriodic()) { geom.periodicShift(geom.Domain(), face_box, pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { m->shift(pshifts[iiv]); Box target = geom.Domain() & m->box(); m->setVal(not_covered,target,0); m->shift(-pshifts[iiv]); } } masks[face].set(bfsi.index(),m); // // Turn mask off on intersection with grids at this level. // for (int g = 0; g < ngrd; g++) { Box ovlp = grids[g] & face_box; if (ovlp.ok()) { m->setVal(covered,ovlp,0); } } // // Handle special cases if is periodic. // if (geom.isAnyPeriodic() && !geom.Domain().contains(face_box)) { geom.periodicShift(geom.Domain(), face_box, pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { m->shift(pshifts[iiv]); for (int g = 0; g < ngrd; g++) { Box ovlp = grids[g] & m->box(); if (ovlp.ok()) { m->setVal(covered,ovlp,0); } } m->shift(-pshifts[iiv]); } } } } } std::ostream& operator<< (std::ostream& os, const BndryData& bd) { if (ParallelDescriptor::NProcs() != 1) BoxLib::Abort("BndryData::operator<<(): not implemented in parallel"); const BoxArray& grds = bd.boxes(); const int ngrds = grds.size(); const int ncomp = bd.bcond[0][0].size(); os << "[BndryData with " << ngrds << " grids and " << ncomp << " comps:\n"; for (int grd = 0; grd < ngrds; grd++) { for (OrientationIter face; face; ++face) { Orientation f = face(); os << "::: face " << f << " of grid " << grds[grd] << "\nBC = "; for (int i = 0; i < ncomp; ++i) os << bd.bcond[f][grd][i] << ' '; os << " LOC = " << bd.bcloc[f][grd] << '\n'; os << bd.masks[f][grd]; os << bd.bndry[f][grd]; } os << "------------------------------------------------" << std::endl; } return os; } void BndryData::writeOn (std::ostream& os) const { int ngrds = grids.size(); int ncomp = bcond[0][0].size(); os << ngrds << " " << ncomp << std::endl; for (int grd = 0; grd < ngrds; grd++) { os << grids[grd] << std::endl; } os << geom << std::endl; for (int grd = 0; grd < ngrds; grd++) { for (OrientationIter face; face; ++face) { Orientation f = face(); for (int cmp = 0; cmp < ncomp; cmp++) os << bcond[f][grd][cmp] << " "; os << std::endl; os << bcloc[f][grd] << std::endl; } } for (OrientationIter face; face; ++face) { Orientation f = face(); for (int grd = 0; grd < ngrds; grd++) { masks[f][grd].writeOn(os); bndry[f][grd].writeOn(os); } } } void BndryData::readFrom (std::istream& is) { int tmpNgrids, tmpNcomp; is >> tmpNgrids >> tmpNcomp; BoxArray tmpBa(tmpNgrids); for (int grd = 0; grd < tmpNgrids; grd++) { Box readBox; is >> readBox; tmpBa.set(grd, readBox); } Geometry tmpGeom; is >> tmpGeom; define(tmpBa, tmpNcomp, tmpGeom); for (int grd = 0; grd < tmpNgrids; grd++) { for (OrientationIter face; face; ++face) { Orientation f = face(); int intBc; for (int cmp = 0; cmp < tmpNcomp; cmp++) { is >> intBc; setBoundCond(f, grd, cmp, BoundCond(intBc)); } Real realBcLoc; is >> realBcLoc; setBoundLoc(f, grd, realBcLoc); } } for (OrientationIter face; face; ++face) { Orientation f = face(); for (int grd = 0; grd < tmpNgrids; grd++) { masks[f][grd].readFrom(is); bndry[f][grd].readFrom(is); } } } ccseapps-2.5/CCSEApps/mglib/BoundCond.H0000644000175000017500000000540011634153073020734 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BOUNDCOND_H_ #define _BOUNDCOND_H_ // // $Id: BoundCond.H,v 1.8 2000/10/02 20:51:15 lijewski Exp $ // #include //@Man: /*@Memo: Maintain an identifier for boundary condition types. */ /*@Doc: This is a placeholder for more extensive boundary condition implementations, which might include stencils, etc. Presently, boundary conditions are specified via an integer identifier. This class maintains that integer. */ class BoundCond { public: // //@ManDoc: Initializes boundary condition type to default. // BoundCond () : bctype(-1) {} // //@ManDoc: Initializes boundary condition type to specified value. // BoundCond (int _bctype) : bctype(_bctype) {} // //@ManDoc: Copy constructor. // BoundCond (const BoundCond& rhs) : bctype(rhs.bctype) {} // //@ManDoc: Copy assignment operator. // BoundCond& operator= (const BoundCond& rhs) { if (!(this == &rhs)) { bctype = rhs.bctype; } return *this; } // //@ManDoc: Return index of boundary condition type. // operator int () const { BL_ASSERT(bctype != -1); return bctype; } // //@ManDoc: Set index of boundary condition type. // BoundCond& operator= (const int _bctype) { bctype = _bctype; return *this; } private: // // Index of boundary condition type. // int bctype; }; #endif /*_BOUNDCOND_H_*/ ccseapps-2.5/CCSEApps/mglib/Laplacian.H0000644000175000017500000000755611634153073020763 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _LAPLACIAN_H_ #define _LAPLACIAN_H_ // // $Id: Laplacian.H,v 1.6 2000/10/02 20:51:16 lijewski Exp $ // #include //@Man: /*@Memo: A Laplacian tailors the description of a linear operator to apply the second-order central difference approximation to the laplacian differential operator on a cell-centered MultiFab of data */ /*@Doc: A Laplacian tailors a LinOp (a virtual base class for general linear operators) to compute the second-order central difference approximation to the laplacian differential operator, L(phi) = div(grad(phi)), on a cell-centered MultiFab, phi. This class provides the necessary implementations for applying the operator and for smoothing a guessed solution for the linear equation system, L(phi) = rhs (where rhs is another cell-centered MultiFab). These customizations are designed for 2D and 3D, with uniform, constant mesh spacing in all directions. Application of the operator and smoothing are "level" operations, and therefore must access "hidden" level data (such as boundary conditions, etc) as required, in concert with the semantics of the underlying LinOp defintions. Accordingly, these implementations are "protected" and called only by the publically accessible members of the virtual base class, LinOp. Note that these implementations may therefore assume that boundary (ghost) nodes and other pertinent information are filled properly by the base class functions prior to call. This class does NOT provide a copy constructor or assignment operator. */ class Laplacian : public LinOp { public: // //@ManDoc: constructor (merely falls through to LinOp constructor) // Laplacian (const BndryData& bd, Real _h) : LinOp(bd,_h) {} // //@ManDoc: destructor // ~Laplacian() {} // //@ManDoc: Compute flux associated with the op // virtual void compFlux (D_DECL(MultiFab &xflux, MultiFab &yflux, MultiFab &zflux), MultiFab& in, const BC_Mode& bc_mode); virtual Real norm (int nm = 0, int level = 0); protected: // //@ManDoc: compute out=L(in) at level=level // virtual void Fapply (MultiFab& out, const MultiFab& in, int level); // //@ManDoc: apply smoother to improve residual to L(solnL)=rhsL // virtual void Fsmooth (MultiFab& solnL, const MultiFab& rhsL, int level, int rgbflag); }; #endif /*_LAPLACIAN_H_*/ ccseapps-2.5/CCSEApps/mglib/ABec_UTIL.F0000644000175000017500000000433611634153073020515 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: ABec_UTIL.F,v 1.3 2003/02/18 20:54:40 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include c----------------------------------------------------------------------- c c Tridiagonal solve c subroutine tridiag(a,b,c,r,u,n) integer n integer nmax REAL_T a(n) REAL_T b(n) REAL_T c(n) REAL_T r(n) REAL_T u(n) parameter (nmax = 4098) integer j REAL_T bet REAL_T gam(nmax) if (n .gt. nmax ) call bl_error('tridiag: size exceeded') if (b(1) .eq. 0) call bl_error('tridiag: CANT HAVE B(1) = ZERO') bet = b(1) u(1) = r(1)/bet do j = 2,n gam(j) = c(j-1)/bet bet = b(j) - a(j)*gam(j) if (bet .eq. 0) call bl_error('tridiag: TRIDIAG FAILED') u(j) = (r(j)-a(j)*u(j-1))/bet end do do j = n-1,1,-1 u(j) = u(j) - gam(j+1)*u(j+1) end do return end ccseapps-2.5/CCSEApps/mglib/INTERPBNDRYDATA_2D.F0000644000175000017500000005667711634153073021664 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: INTERPBNDRYDATA_2D.F,v 1.3 2002/10/19 18:33:57 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "BC_TYPES.H" #include "REAL.H" #include "CONSTANTS.H" #include "INTERPBNDRYDATA_F.H" #include "ArrayLim.H" #define USE_REORG_VERSION #define SDIM 2 #define NUMDERIV 2 #define XDER 1 #define X2DER 2 c --------------------------------------------------------------- c :: FORT_BDINTERPXLO : Interpolation on Xlo Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables to interpolate c :: ratios(2) => refinement ratios c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array c --------------------------------------------------------------- subroutine FORT_BDINTERPXLO (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratios,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives) integer nvar, ratios(2), not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(mask) integer DIMDEC(crse) integer DIMDEC(cb) REAL_T bdry(DIMV(bdry),nvar) REAL_T derives(DIM2(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx, ainterp integer i, j, ic, jc, off, n integer jclo, jchi, ratioy #ifndef USE_REORG_VERSION ratioy = ratios(2) jclo = ARG_L2(cb) jchi = ARG_H2(cb) ic = ARG_L1(cb)-1 i = lo(1)-1 do n = 1, nvar c ::::: define interp coefs do jc = jclo, jchi j = ratioy*jc derives(jc,XDER) = half * (crse(ic,jc+1,n) - crse(ic,jc-1,n)) derives(jc,X2DER) = crse(ic,jc+1,n) & - crse(ic,jc ,n) * two & + crse(ic,jc-1,n) if (mask(i,j-1) .ne. not_covered) then derives(jc,XDER) = crse(ic,jc+1,n) - crse(ic,jc ,n) derives(jc,X2DER) = zero c Can we do better by sliding stencil up? if (mask(i,j+2*ratioy) .eq. not_covered) then derives(jc,XDER) = half*(-three*crse(ic,jc,n) & + four*crse(ic,jc+1,n) & - crse(ic,jc+2,n)) derives(jc,X2DER) = crse(ic,jc+2,n) & - crse(ic,jc+1,n) * two & + crse(ic ,jc,n) end if end if if (mask(i,j+ratioy) .ne. not_covered) then derives(jc,XDER) = crse(ic,jc ,n) - crse(ic,jc-1,n) derives(jc,X2DER) = zero c Can we do better by sliding stencil down? if (mask(i,j+ratioy) .eq. not_covered) then derives(jc,XDER) = half*(three*crse(ic,jc,n) & - four*crse(ic,jc-1,n) & + crse(ic,jc-2,n)) derives(jc,X2DER) = crse(ic,jc,n) & - crse(ic,jc-1,n) * two & + crse(ic,jc-2,n) end if end if if (mask(i,j-1) .ne. not_covered .and. $ mask(i,j+ratioy) .ne. not_covered) then derives(jc,XDER) = zero end if end do c ::::: interpolate to fine grid do off = 0, ratioy - 1 xx = (dble(off - ratioy/2) + half)/ratioy do jc = jclo, jchi j = ratioy*jc + off bdry(i,j,n) = crse(ic,jc,n) & + derives(jc,XDER) *xx & + half*derives(jc,X2DER)*xx**2 end do end do end do #else integer Norder, NN, m parameter (Norder = 3) REAL_T x(Norder), y(Norder), c(Norder), xInt ratioy = ratios(2) jclo = ARG_L2(cb) jchi = ARG_H2(cb) ic = ARG_L1(cb)-1 i = lo(1)-1 do n=1,nvar do jc=jclo,jchi j = ratioy*jc NN = 1 y(NN) = crse(ic,jc,n) x(NN) = zero if (mask(i,j-1).eq.not_covered) then NN=NN+1 y(NN) = crse(ic,jc-1,n) x(NN) = -one else if (mask(i,j+2*ratioy).eq.not_covered) then NN=NN+1 y(NN) = crse(ic,jc+2,n) x(NN) = two endif if (mask(i,j+ratioy).eq.not_covered) then NN=NN+1 y(NN) = crse(ic,jc+1,n) x(NN) = one else if (mask(i,j-ratioy-1).eq.not_covered) then NN=NN+1 y(NN) = crse(ic,jc-2,n) x(NN) = -two endif if ( (mask(i,j-1).ne.not_covered).and. & (mask(i,j+ratioy).ne.not_covered) ) NN = 1 do off = 0,ratioy-1 xInt = (dble(off - ratioy/2) + half)/ratioy call polyInterpCoeff(xInt, x, NN, c) bdry(i,j+off,n) = zero do m=1,NN bdry(i,j+off,n) = bdry(i,j+off,n) + c(m)*y(m) end do end do end do end do #endif return end c --------------------------------------------------------------- c :: FORT_BDINTERPXHI : Interpolation on Xhi Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables to interpolate c :: ratios(2) => refinement ratios c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array c --------------------------------------------------------------- subroutine FORT_BDINTERPXHI (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratios,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives) integer nvar, ratios(2), not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(mask) integer DIMDEC(cb) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),nvar) REAL_T derives(DIM2(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx, ainterp integer i, j, ic, jc, off, n integer jclo, jchi, ratioy #ifndef USE_REORG_VERSION ratioy = ratios(2) jclo = ARG_L2(cb) jchi = ARG_H2(cb) ic = ARG_H1(cb)+1 i = hi(1)+1 do n = 1, nvar c ::::: define interp coefs do jc = jclo, jchi j = ratioy*jc derives(jc,XDER) = half * (crse(ic,jc+1,n) - crse(ic,jc-1,n)) derives(jc,X2DER) = crse(ic,jc+1,n) & - crse(ic,jc ,n) * two & + crse(ic,jc-1,n) if (mask(i,j-1) .ne. not_covered) then derives(jc,XDER) = crse(ic,jc+1,n) - crse(ic,jc ,n) derives(jc,X2DER) = zero c Can we do better by sliding stencil up? if (mask(i,j+2*ratioy) .eq. not_covered) then derives(jc,XDER) = half*(-three*crse(ic,jc,n) & + four*crse(ic,jc+1,n) & - crse(ic,jc+2,n)) derives(jc,X2DER) = crse(ic,jc+2,n) & - crse(ic,jc+1,n) * two & + crse(ic ,jc,n) end if end if if (mask(i,j+ratioy) .ne. not_covered) then derives(jc,XDER) = crse(ic,jc ,n) - crse(ic,jc-1,n) derives(jc,X2DER) = zero c Can we do better by sliding stencil down? if (mask(i,j+ratioy) .eq. not_covered) then derives(jc,XDER) = half*(three*crse(ic,jc,n) & - four*crse(ic,jc-1,n) & + crse(ic,jc-2,n)) derives(jc,X2DER) = crse(ic,jc,n) & - crse(ic,jc-1,n) * two & + crse(ic,jc-2,n) end if end if if (mask(i,j-1) .ne. not_covered .and. $ mask(i,j+ratioy) .ne. not_covered) then derives(jc,XDER) = zero derives(jc,X2DER) = zero end if end do c ::::: interpolate to fine grid do off = 0, ratioy - 1 xx = (dble(off - ratioy/2) + half)/ratioy do jc = jclo, jchi j = ratioy*jc + off bdry(i,j,n) = crse(ic,jc,n) & + derives(jc,XDER) *xx & + half*derives(jc,X2DER)*xx**2 end do end do end do #else integer Norder, NN, m parameter (Norder = 3) REAL_T x(Norder), y(Norder), c(Norder), xInt ratioy = ratios(2) jclo = ARG_L2(cb) jchi = ARG_H2(cb) ic = ARG_H1(cb)+1 i = hi(1)+1 do n=1,nvar do jc=jclo,jchi j = ratioy*jc NN = 1 y(NN) = crse(ic,jc,n) x(NN) = zero if (mask(i,j-1).eq.not_covered) then NN=NN+1 y(NN) = crse(ic,jc-1,n) x(NN) = -one else if (mask(i,j+2*ratioy).eq.not_covered) then NN=NN+1 y(NN) = crse(ic,jc+2,n) x(NN) = two endif if (mask(i,j+ratioy).eq.not_covered) then NN=NN+1 y(NN) = crse(ic,jc+1,n) x(NN) = one else if (mask(i,j-ratioy-1).eq.not_covered) then NN=NN+1 y(NN) = crse(ic,jc-2,n) x(NN) = -two endif if ( (mask(i,j-1).ne.not_covered).and. & (mask(i,j+ratioy).ne.not_covered) ) NN = 1 do off = 0,ratioy-1 xInt = (dble(off - ratioy/2) + half)/ratioy call polyInterpCoeff(xInt, x, NN, c) bdry(i,j+off,n) = zero do m=1,NN bdry(i,j+off,n) = bdry(i,j+off,n) + c(m)*y(m) end do end do end do end do #endif return end c --------------------------------------------------------------- c :: FORT_BDINTERPYLO : Interpolation on Ylo Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables to interpolate c :: ratios(2) => refinement ratios c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array c --------------------------------------------------------------- subroutine FORT_BDINTERPYLO (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratios,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives) integer nvar, ratios(2), not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(mask) integer DIMDEC(cb) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),nvar) REAL_T derives(DIM1(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx, ainterp integer i, j, ic, jc, off, n integer iclo, ichi, ratiox #ifndef USE_REORG_VERSION ratiox = ratios(1) iclo = ARG_L1(cb) ichi = ARG_H1(cb) jc = ARG_L2(cb)-1 j = lo(2)-1 do n = 1, nvar c ::::: define interp coefs do ic = iclo, ichi i = ratiox*ic derives(ic,XDER) = half * (crse(ic+1,jc,n) - crse(ic-1,jc,n)) derives(ic,X2DER) = crse(ic+1,jc,n) & - crse(ic ,jc,n) * two & + crse(ic-1,jc,n) if (mask(i-1,j) .ne. not_covered) then derives(ic,XDER) = crse(ic+1,jc,n) - crse(ic ,jc,n) derives(ic,X2DER) = zero c Can we do better by sliding stencil to the right if (mask(i+2*ratiox,j) .eq. not_covered) then derives(ic,XDER) = half*(-three*crse(ic,jc,n) & + four*crse(ic+1,jc,n) & - crse(ic+2,jc,n)) derives(ic,X2DER) = crse(ic+2,jc,n) & - crse(ic+1,jc,n) * two & + crse(ic ,jc,n) end if end if if (mask(i+ratiox,j) .ne. not_covered) then derives(ic,XDER) = crse(ic ,jc,n) - crse(ic-1,jc,n) derives(ic,X2DER) = zero end if c Can we do better by sliding stencil to the left if (mask(i-ratiox,j) .eq. not_covered) then derives(ic,XDER) = half*(three*crse(ic,jc,n) & - four*crse(ic-1,jc,n) & + crse(ic-2,jc,n)) derives(ic,X2DER) = crse(ic,jc,n) & - crse(ic-1,jc,n) * two & + crse(ic-2,jc,n) end if if (mask(i-1,j) .ne. not_covered .and. $ mask(i+ratiox,j) .ne. not_covered) then derives(ic,XDER) = zero derives(ic,X2DER) = zero end if end do c ::::: interpolate to fine grid do off = 0, ratiox - 1 xx = (dble(off - ratiox/2) + half)/ratiox do ic = iclo, ichi i = ratiox*ic + off bdry(i,j,n) = crse(ic,jc,n) & + derives(ic,XDER) *xx & + half*derives(ic,X2DER)*xx**2 end do end do end do #else integer Norder, NN, m parameter (Norder = 3) REAL_T x(Norder), y(Norder), c(Norder), xInt ratiox = ratios(1) iclo = ARG_L1(cb) ichi = ARG_H1(cb) jc = ARG_L2(cb)-1 j = lo(2)-1 do n=1,nvar do ic=iclo,ichi i = ratiox*ic NN = 1 y(NN) = crse(ic,jc,n) x(NN) = zero if (mask(i-1,j).eq.not_covered) then NN=NN+1 y(NN) = crse(ic-1,jc,n) x(NN) = -one else if (mask(i+2*ratiox,j).eq.not_covered) then NN=NN+1 y(NN) = crse(ic+2,jc,n) x(NN) = two endif if (mask(i+ratiox,j).eq.not_covered) then NN=NN+1 y(NN) = crse(ic+1,jc,n) x(NN) = one else if (mask(i-ratiox-1,j).eq.not_covered) then NN=NN+1 y(NN) = crse(ic-2,jc,n) x(NN) = -two endif if ( (mask(i-1,j).ne.not_covered).and. & (mask(i+ratiox,j).ne.not_covered) ) NN = 1 do off = 0,ratiox-1 xInt = (dble(off - ratiox/2) + half)/ratiox call polyInterpCoeff(xInt, x, NN, c) bdry(i+off,j,n) = zero do m=1,NN bdry(i+off,j,n) = bdry(i+off,j,n) + c(m)*y(m) end do end do end do end do #endif return end c --------------------------------------------------------------- c :: FORT_BDINTERPYHI : Interpolation on Yhi Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables to interpolate c :: ratios(2) => refinement ratios c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array c --------------------------------------------------------------- subroutine FORT_BDINTERPYHI (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratios,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives) integer nvar, ratios(2), not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(mask) integer DIMDEC(cb) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),nvar) REAL_T derives(DIM1(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx, ainterp integer i, j, ic, jc, off, n integer iclo, ichi, ratiox #ifndef USE_REORG_VERSION ratiox = ratios(1) iclo = ARG_L1(cb) ichi = ARG_H1(cb) jc = ARG_H2(cb)+1 j = hi(2)+1 do n = 1, nvar c ::::: define interp coefs do ic = iclo, ichi i = ratiox*ic derives(ic,XDER) = half * (crse(ic+1,jc,n) - crse(ic-1,jc,n)) derives(ic,X2DER) = crse(ic+1,jc,n) & - crse(ic ,jc,n) * two & + crse(ic-1,jc,n) if (mask(i-1,j) .ne. not_covered) then derives(ic,XDER) = crse(ic+1,jc,n) - crse(ic ,jc,n) derives(ic,X2DER) = zero c Can we do better by sliding stencil to the right if (mask(i+2*ratiox,j) .eq. not_covered) then derives(ic,XDER) = half*(-three*crse(ic,jc,n) & + four*crse(ic+1,jc,n) & - crse(ic+2,jc,n)) derives(ic,X2DER) = crse(ic+2,jc,n) & - crse(ic+1,jc,n) * two & + crse(ic ,jc,n) end if end if if (mask(i+ratiox,j) .ne. not_covered) then derives(ic,XDER) = crse(ic ,jc,n) - crse(ic-1,jc,n) derives(ic,X2DER) = zero c Can we do better by sliding stencil to the left if (mask(i-ratiox,j) .eq. not_covered) then derives(ic,XDER) = half*(three*crse(ic,jc,n) & - four*crse(ic-1,jc,n) & + crse(ic-2,jc,n)) derives(ic,X2DER) = crse(ic,jc,n) & - crse(ic-1,jc,n) * two & + crse(ic-2,jc,n) end if end if if (mask(i-1,j) .ne. not_covered .and. $ mask(i+ratiox,j) .ne. not_covered) then derives(ic,XDER) = zero derives(ic,X2DER) = zero end if end do c ::::: interpolate to fine grid do off = 0, ratiox - 1 xx = (dble(off - ratiox/2) + half)/ratiox do ic = iclo, ichi i = ratiox*ic + off bdry(i,j,n) = crse(ic,jc,n) & + derives(ic,XDER) *xx & + half*derives(ic,X2DER)*xx**2 end do end do end do #else integer Norder, NN, m parameter (Norder = 3) REAL_T x(Norder), y(Norder), c(Norder), xInt ratiox = ratios(1) iclo = ARG_L1(cb) ichi = ARG_H1(cb) jc = ARG_H2(cb)+1 j = hi(2)+1 do n=1,nvar do ic=iclo,ichi i = ratiox*ic NN = 1 y(NN) = crse(ic,jc,n) x(NN) = zero if (mask(i-1,j).eq.not_covered) then NN=NN+1 y(NN) = crse(ic-1,jc,n) x(NN) = -one else if (mask(i+2*ratiox,j).eq.not_covered) then NN=NN+1 y(NN) = crse(ic+2,jc,n) x(NN) = two endif if (mask(i+ratiox,j).eq.not_covered) then NN=NN+1 y(NN) = crse(ic+1,jc,n) x(NN) = one else if (mask(i-ratiox-1,j).eq.not_covered) then NN=NN+1 y(NN) = crse(ic-2,jc,n) x(NN) = -two endif if ( (mask(i-1,j).ne.not_covered).and. & (mask(i+ratiox,j).ne.not_covered) ) NN = 1 do off = 0,ratiox-1 xInt = (dble(off - ratiox/2) + half)/ratiox call polyInterpCoeff(xInt, x, NN, c) bdry(i+off,j,n) = zero do m=1,NN bdry(i+off,j,n) = bdry(i+off,j,n) + c(m)*y(m) end do end do end do end do #endif return end ccseapps-2.5/CCSEApps/mglib/ABec_3D.F0000644000175000017500000005105511634153073020206 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: ABec_3D.F,v 1.8 2002/11/27 21:54:35 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include "ABec_F.H" #include "ArrayLim.H" #include "CONSTANTS.H" c----------------------------------------------------------------------- c c Gauss-Seidel Red-Black (GSRB): c Apply the GSRB relaxation to the state phi for the equation c L(phi) = alpha*a(x)*phi(x) - beta*Div(b(x)Grad(phi(x))) = rhs(x) c central differenced, according to the arrays of boundary c masks (m#) and auxiliary data (f#). c c In general, if the linear operator L=gamma*y-rho, the GS relaxation c is y = (R - rho)/gamma. Near a boundary, the ghost data is filled c using a polynomial interpolant based on the "old" phi values, so c L=(gamma-delta)*y - rho + delta*yOld. The resulting iteration is c c y = (R - delta*yOld + rho)/(gamma - delta) c c This expression is valid additionally in the interior provided c delta->0 there. delta is constructed by summing all the c contributions to the central stencil element coming from boundary c interpolants. The f#s contain the corresponding coefficient of c the interpolating polynomial. The masks are set > 0 if the boundary c value was filled with an interpolant involving the central stencil c element. c c----------------------------------------------------------------------- subroutine FORT_GSRB ( $ phi,DIMS(phi), $ rhs,DIMS(rhs), $ alpha, beta, $ a, DIMS(a), $ bX, DIMS(bX), $ bY, DIMS(bY), $ bZ, DIMS(bZ), $ f0, DIMS(f0), $ m0, DIMS(m0), $ f1, DIMS(f1), $ m1, DIMS(m1), $ f2, DIMS(f2), $ m2, DIMS(m2), $ f3, DIMS(f3), $ m3, DIMS(m3), $ f4, DIMS(f4), $ m4, DIMS(m4), $ f5, DIMS(f5), $ m5, DIMS(m5), $ lo,hi,nc, $ h,redblack $ ) REAL_T alpha, beta integer DIMDEC(phi) integer DIMDEC(rhs) integer DIMDEC(a) integer DIMDEC(bX) integer DIMDEC(bY) integer DIMDEC(bZ) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) integer nc integer redblack integer DIMDEC(f0) REAL_T f0(DIMV(f0)) integer DIMDEC(f1) REAL_T f1(DIMV(f1)) integer DIMDEC(f2) REAL_T f2(DIMV(f2)) integer DIMDEC(f3) REAL_T f3(DIMV(f3)) integer DIMDEC(f4) REAL_T f4(DIMV(f4)) integer DIMDEC(f5) REAL_T f5(DIMV(f5)) integer DIMDEC(m0) integer m0(DIMV(m0)) integer DIMDEC(m1) integer m1(DIMV(m1)) integer DIMDEC(m2) integer m2(DIMV(m2)) integer DIMDEC(m3) integer m3(DIMV(m3)) integer DIMDEC(m4) integer m4(DIMV(m4)) integer DIMDEC(m5) integer m5(DIMV(m5)) REAL_T h(BL_SPACEDIM) REAL_T phi(DIMV(phi),nc) REAL_T rhs(DIMV(rhs),nc) REAL_T a(DIMV(a)) REAL_T bX(DIMV(bX)) REAL_T bY(DIMV(bY)) REAL_T bZ(DIMV(bZ)) c integer i, j, k, ioff, n c REAL_T dhx, dhy, dhz, cf0, cf1, cf2, cf3, cf4, cf5 REAL_T delta, gamma, rho, rho_xy, rho_yz, rho_xz c integer do_line integer LSDIM parameter (LSDIM=127) REAL_T a_ls(0:LSDIM) REAL_T b_ls(0:LSDIM) REAL_T c_ls(0:LSDIM) REAL_T r_ls(0:LSDIM) REAL_T u_ls(0:LSDIM) integer ilen,jlen,klen ilen = hi(1)-lo(1)+1 jlen = hi(2)-lo(2)+1 klen = hi(3)-lo(3)+1 #if 0 if (klen .gt. ilen .and. klen .gt. jlen) then do_line = 3 if (klen .gt. LSDIM) then print *,'TOO BIG FOR LINE SOLVE IN GSRB: klen = ',klen call bl_error("stop") endif else if (jlen .gt. ilen .and. jlen .gt. klen) then do_line = 2 if (jlen .gt. LSDIM) then print *,'JLEN TOO BIG FOR LINE SOLVE IN GSRB: jlen = ',jlen call bl_error("stop") endif else if (ilen .gt. jlen .and. ilen .gt. klen) then do_line = 1 if (ilen .gt. LSDIM) then print *,'ILEN TOO BIG FOR LINE SOLVE IN GSRB: ilen = ',ilen call bl_error("stop") endif else do_line = 0 endif #endif do_line = 0 dhx = beta/h(1)**2 dhy = beta/h(2)**2 dhz = beta/h(3)**2 do n = 1, nc if (do_line .eq. 0) then do k = lo(3), hi(3) do j = lo(2), hi(2) ioff = MOD(j + k + redblack,2) do i = lo(1) + ioff,hi(1),2 c cf0 = cvmgt(f0(lo(1),j,k), 0.0D0, $ (i .eq. lo(1)) .and. (m0(lo(1)-1,j,k).gt.0)) cf1 = cvmgt(f1(i,lo(2),k), 0.D00, $ (j .eq. lo(2)) .and. (m1(i,lo(2)-1,k).gt.0)) cf2 = cvmgt(f2(i,j,lo(3)), 0.0D0, $ (k .eq. lo(3)) .and. (m2(i,j,lo(3)-1).gt.0)) cf3 = cvmgt(f3(hi(1),j,k), 0.0D0, $ (i .eq. hi(1)) .and. (m3(hi(1)+1,j,k).gt.0)) cf4 = cvmgt(f4(i,hi(2),k), 0.0D0, $ (j .eq. hi(2)) .and. (m4(i,hi(2)+1,k).gt.0)) cf5 = cvmgt(f5(i,j,hi(3)), 0.0D0, $ (k .eq. hi(3)) .and. (m5(i,j,hi(3)+1).gt.0)) c delta = dhx*(bX(i,j,k)*cf0 + bX(i+1,j,k)*cf3) $ + dhy*(bY(i,j,k)*cf1 + bY(i,j+1,k)*cf4) $ + dhz*(bZ(i,j,k)*cf2 + bZ(i,j,k+1)*cf5) c gamma = alpha*a(i,j,k) $ + dhx*(bX(i,j,k)+bX(i+1,j,k)) $ + dhy*(bY(i,j,k)+bY(i,j+1,k)) $ + dhz*(bZ(i,j,k)+bZ(i,j,k+1)) c rho = dhx*( bX(i ,j,k)*phi(i-1,j,k,n) $ + bX(i+1,j,k)*phi(i+1,j,k,n) ) $ + dhy*( bY(i,j ,k)*phi(i,j-1,k,n) $ + bY(i,j+1,k)*phi(i,j+1,k,n) ) $ + dhz*( bZ(i,j,k )*phi(i,j,k-1,n) $ + bZ(i,j,k+1)*phi(i,j,k+1,n) ) c phi(i,j,k,n) = (rhs(i,j,k,n)+rho-phi(i,j,k,n)*delta) $ / (gamma - delta) c end do end do end do else if (do_line .eq. 3) then do j = lo(2), hi(2) ioff = MOD(j + redblack,2) do i = lo(1) + ioff,hi(1),2 c do k = lo(3),hi(3) cf0 = cvmgt(f0(lo(1),j,k), 0.0D0, $ (i .eq. lo(1)) .and. (m0(lo(1)-1,j,k).gt.0)) cf1 = cvmgt(f1(i,lo(2),k), 0.0D0, $ (j .eq. lo(2)) .and. (m1(i,lo(2)-1,k).gt.0)) cf2 = cvmgt(f2(i,j,lo(3)), 0.0D0, $ (k .eq. lo(3)) .and. (m2(i,j,lo(3)-1).gt.0)) cf3 = cvmgt(f3(hi(1),j,k), 0.0D0, $ (i .eq. hi(1)) .and. (m3(hi(1)+1,j,k).gt.0)) cf4 = cvmgt(f4(i,hi(2),k), 0.0D0, $ (j .eq. hi(2)) .and. (m4(i,hi(2)+1,k).gt.0)) cf5 = cvmgt(f5(i,j,hi(3)), 0.0D0, $ (k .eq. hi(3)) .and. (m5(i,j,hi(3)+1).gt.0)) c delta = dhx*(bX(i,j,k)*cf0 + bX(i+1,j,k)*cf3) $ + dhy*(bY(i,j,k)*cf1 + bY(i,j+1,k)*cf4) $ + dhz*(bZ(i,j,k)*cf2 + bZ(i,j,k+1)*cf5) c gamma = alpha*a(i,j,k) $ + dhx*(bX(i,j,k)+bX(i+1,j,k)) $ + dhy*(bY(i,j,k)+bY(i,j+1,k)) $ + dhz*(bZ(i,j,k)+bZ(i,j,k+1)) c rho_xy = dhx*( bX(i ,j,k)*phi(i-1,j,k,n) $ + bX(i+1,j,k)*phi(i+1,j,k,n) ) $ + dhy*( bY(i,j ,k)*phi(i,j-1,k,n) $ + bY(i,j+1,k)*phi(i,j+1,k,n) ) a_ls(k-lo(3)) = -dhz*bZ(i,j,k) b_ls(k-lo(3)) = gamma - delta c_ls(k-lo(3)) = -dhz*bZ(i,j,k+1) r_ls(k-lo(3)) = rhs(i,j,k,n) + rho_xy - phi(i,j,k,n)*delta if (k .eq. lo(3)) $ r_ls(k-lo(3)) = r_ls(k-lo(3)) + dhz*bZ(i,j,k)*phi(i,j,k-1,n) if (k .eq. hi(3)) $ r_ls(k-lo(3)) = r_ls(k-lo(3)) + dhz*bZ(i,j,k+1)*phi(i,j,k+1,n) end do c call tridiag(a_ls,b_ls,c_ls,r_ls,u_ls,klen) do k = lo(3),hi(3) phi(i,j,k,n) = u_ls(k-lo(3)) end do c end do end do else if (do_line .eq. 2) then do k = lo(3), hi(3) ioff = MOD(k + redblack,2) do i = lo(1) + ioff,hi(1),2 c do j = lo(2),hi(2) cf0 = cvmgt(f0(lo(1),j,k), 0.0D0, $ (i .eq. lo(1)) .and. (m0(lo(1)-1,j,k).gt.0)) cf1 = cvmgt(f1(i,lo(2),k), 0.0D0, $ (j .eq. lo(2)) .and. (m1(i,lo(2)-1,k).gt.0)) cf2 = cvmgt(f2(i,j,lo(3)), 0.0D0, $ (k .eq. lo(3)) .and. (m2(i,j,lo(3)-1).gt.0)) cf3 = cvmgt(f3(hi(1),j,k), 0.0D0, $ (i .eq. hi(1)) .and. (m3(hi(1)+1,j,k).gt.0)) cf4 = cvmgt(f4(i,hi(2),k), 0.0D0, $ (j .eq. hi(2)) .and. (m4(i,hi(2)+1,k).gt.0)) cf5 = cvmgt(f5(i,j,hi(3)), 0.0D0, $ (k .eq. hi(3)) .and. (m5(i,j,hi(3)+1).gt.0)) c delta = dhx*(bX(i,j,k)*cf0 + bX(i+1,j,k)*cf3) $ + dhy*(bY(i,j,k)*cf1 + bY(i,j+1,k)*cf4) $ + dhz*(bZ(i,j,k)*cf2 + bZ(i,j,k+1)*cf5) c gamma = alpha*a(i,j,k) $ + dhx*(bX(i,j,k)+bX(i+1,j,k)) $ + dhy*(bY(i,j,k)+bY(i,j+1,k)) $ + dhz*(bZ(i,j,k)+bZ(i,j,k+1)) c rho_xz = dhx*( bX(i ,j,k)*phi(i-1,j,k,n) $ + bX(i+1,j,k)*phi(i+1,j,k,n) ) $ + dhz*( bZ(i,j,k )*phi(i,j,k-1,n) $ + bZ(i,j,k+1)*phi(i,j,k+1,n) ) a_ls(j-lo(2)) = -dhy*bY(i,j,k) b_ls(j-lo(2)) = gamma - delta c_ls(j-lo(2)) = -dhy*bY(i,j+1,k) r_ls(j-lo(2)) = rhs(i,j,k,n) + rho_xz - phi(i,j,k,n)*delta if (j .eq. lo(2)) $ r_ls(j-lo(2)) = r_ls(j-lo(2)) + dhy*bY(i,j,k)*phi(i,j-1,k,n) if (j .eq. hi(2)) $ r_ls(j-lo(2)) = r_ls(j-lo(2)) + dhy*bY(i,j+1,k)*phi(i,j+1,k,n) end do c call tridiag(a_ls,b_ls,c_ls,r_ls,u_ls,jlen) do j = lo(2),hi(2) phi(i,j,k,n) = u_ls(j-lo(2)) end do c end do end do else if (do_line .eq. 1) then do k = lo(3), hi(3) ioff = MOD(k + redblack,2) do j = lo(2) + ioff,hi(2),2 c do i = lo(1),hi(1) cf0 = cvmgt(f0(lo(1),j,k), 0.0D0, $ (i .eq. lo(1)) .and. (m0(lo(1)-1,j,k).gt.0)) cf1 = cvmgt(f1(i,lo(2),k), 0.0D0, $ (j .eq. lo(2)) .and. (m1(i,lo(2)-1,k).gt.0)) cf2 = cvmgt(f2(i,j,lo(3)), 0.0D0, $ (k .eq. lo(3)) .and. (m2(i,j,lo(3)-1).gt.0)) cf3 = cvmgt(f3(hi(1),j,k), 0.0D0, $ (i .eq. hi(1)) .and. (m3(hi(1)+1,j,k).gt.0)) cf4 = cvmgt(f4(i,hi(2),k), 0.0D0, $ (j .eq. hi(2)) .and. (m4(i,hi(2)+1,k).gt.0)) cf5 = cvmgt(f5(i,j,hi(3)), 0.0D0, $ (k .eq. hi(3)) .and. (m5(i,j,hi(3)+1).gt.0)) c delta = dhx*(bX(i,j,k)*cf0 + bX(i+1,j,k)*cf3) $ + dhy*(bY(i,j,k)*cf1 + bY(i,j+1,k)*cf4) $ + dhz*(bZ(i,j,k)*cf2 + bZ(i,j,k+1)*cf5) c gamma = alpha*a(i,j,k) $ + dhx*(bX(i,j,k)+bX(i+1,j,k)) $ + dhy*(bY(i,j,k)+bY(i,j+1,k)) $ + dhz*(bZ(i,j,k)+bZ(i,j,k+1)) c rho_yz = dhy*( bY(i,j ,k)*phi(i,j-1,k,n) $ + bY(i,j+1,k)*phi(i,j+1,k,n) ) $ + dhz*( bZ(i,j,k )*phi(i,j,k-1,n) $ + bZ(i,j,k+1)*phi(i,j,k+1,n) ) a_ls(i-lo(1)) = -dhx*bX(i,j,k) b_ls(i-lo(1)) = gamma - delta c_ls(i-lo(1)) = -dhx*bX(i+1,j,k) r_ls(i-lo(1)) = rhs(i,j,k,n) + rho_yz - phi(i,j,k,n)*delta if (i .eq. lo(1)) $ r_ls(i-lo(1)) = r_ls(i-lo(1)) + dhx*bX(i,j,k)*phi(i-1,j,k,n) if (i .eq. hi(1)) $ r_ls(i-lo(1)) = r_ls(i-lo(1)) + dhx*bX(i+1,j,k)*phi(i+1,j,k,n) end do c call tridiag(a_ls,b_ls,c_ls,r_ls,u_ls,ilen) do i = lo(1),hi(1) phi(i,j,k,n) = u_ls(i-lo(1)) end do c end do end do endif end do c end c----------------------------------------------------------------------- c c Solve Preconditioned system here c subroutine FORT_CGPRECND( $ zz,DIMS(zz), $ rho, $ rr,DIMS(rr), $ alpha, beta, $ a, DIMS(a), $ bX,DIMS(bX), $ bY,DIMS(bY), $ bZ,DIMS(bZ), $ lo,hi,nc, $ h $ ) REAL_T alpha, beta integer lo(BL_SPACEDIM), hi(BL_SPACEDIM), nc integer DIMDEC(zz) integer DIMDEC(rr) integer DIMDEC(a) integer DIMDEC(bX) integer DIMDEC(bY) integer DIMDEC(bZ) REAL_T zz(DIMV(zz),nc) REAL_T rr(DIMV(rr),nc) REAL_T a(DIMV(a)) REAL_T bX(DIMV(bX)) REAL_T bY(DIMV(bY)) REAL_T bZ(DIMV(bZ)) REAL_T h(BL_SPACEDIM), rho c integer i,j, k, n REAL_T de, dhx, dhy, dhz c rho = 0.0D0 dhx = beta/h(1)**2 dhy = beta/h(2)**2 dhz = beta/h(3)**2 do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) de = 1.0D0/(alpha*a(i,j,k) $ + dhx*(bX(i+1,j,k)+bX(i,j,k)) $ + dhy*(bY(i,j+1,k)+bY(i,j,k)) $ + dhz*(bZ(i,j,k+1)+bZ(i,j,k)) $ ) zz(i,j,k,n) = rr(i,j,k,n)*de rho = rho + zz(i,j,k,n)*rr(i,j,k,n) end do end do end do end do c end c----------------------------------------------------------------------- c c Fill in a matrix x vector operator here c subroutine FORT_ADOTX( $ y,DIMS(y), $ x,DIMS(x), $ alpha, beta, $ a, DIMS(a), $ bX,DIMS(bX), $ bY,DIMS(bY), $ bZ,DIMS(bZ), $ lo,hi,nc, $ h $ ) REAL_T alpha, beta integer lo(BL_SPACEDIM), hi(BL_SPACEDIM), nc integer DIMDEC(y) integer DIMDEC(x) integer DIMDEC(a) integer DIMDEC(bX) integer DIMDEC(bY) integer DIMDEC(bZ) REAL_T y(DIMV(y),nc) REAL_T x(DIMV(x),nc) REAL_T a(DIMV(a)) REAL_T bX(DIMV(bX)) REAL_T bY(DIMV(bY)) REAL_T bZ(DIMV(bZ)) REAL_T h(BL_SPACEDIM) c integer i,j,k,n REAL_T dhx,dhy,dhz c dhx = beta/h(1)**2 dhy = beta/h(2)**2 dhz = beta/h(3)**2 c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) y(i,j,k,n) = alpha*a(i,j,k)*x(i,j,k,n) $ - dhx* $ ( bX(i+1,j,k)*( x(i+1,j,k,n) - x(i ,j,k,n) ) $ - bX(i ,j,k)*( x(i ,j,k,n) - x(i-1,j,k,n) ) ) $ - dhy* $ ( bY(i,j+1,k)*( x(i,j+1,k,n) - x(i,j ,k,n) ) $ - bY(i,j ,k)*( x(i,j ,k,n) - x(i,j-1,k,n) ) ) $ - dhz* $ ( bZ(i,j,k+1)*( x(i,j,k+1,n) - x(i,j,k ,n) ) $ - bZ(i,j,k )*( x(i,j,k ,n) - x(i,j,k-1,n) ) ) end do end do end do end do end c----------------------------------------------------------------------- c c Fill in a matrix x vector operator here c subroutine FORT_NORMA( & res, $ alpha, beta, $ a, DIMS(a), $ bX,DIMS(bX), $ bY,DIMS(bY), $ bZ,DIMS(bZ), $ lo,hi,nc, $ h $ ) REAL_T alpha, beta, res integer lo(BL_SPACEDIM), hi(BL_SPACEDIM), nc integer DIMDEC(a) integer DIMDEC(bX) integer DIMDEC(bY) integer DIMDEC(bZ) REAL_T a(DIMV(a)) REAL_T bX(DIMV(bX)) REAL_T bY(DIMV(bY)) REAL_T bZ(DIMV(bZ)) REAL_T h(BL_SPACEDIM) c integer i,j,k,n REAL_T dhx,dhy,dhz c dhx = beta/h(1)**2 dhy = beta/h(2)**2 dhz = beta/h(3)**2 c res = 0.0D0 do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) res = max(res, & abs(alpha*a(i,j,k) & + dhx*(bX(i+1,j,k) + bX(i,j,k)) & + dhy*(bY(i,j+1,k) + bY(i,j,k)) $ - dhz*(bZ(i,j,k+1) + bZ(i,j,k))) & + abs( -dhx*bX(i+1,j,k)) + abs( -dhx*bX(i,j,k)) & + abs( -dhy*bY(i,j+1,k)) + abs( -dhy*bY(i,j,k)) & + abs( -dhz*bZ(i,j,k+1)) + abs( -dhz*bZ(i,j,k))) end do end do end do end do end c----------------------------------------------------------------------- c c Fill in fluxes c subroutine FORT_FLUX( $ x,DIMS(x), $ alpha, beta, $ a, DIMS(a), $ bX,DIMS(bX), $ bY,DIMS(bY), $ bZ,DIMS(bZ), $ lo,hi,nc, $ h, $ xflux,DIMS(xflux), $ yflux,DIMS(yflux), $ zflux,DIMS(zflux) $ ) implicit none REAL_T alpha, beta integer lo(BL_SPACEDIM), hi(BL_SPACEDIM), nc integer DIMDEC(x) integer DIMDEC(a) integer DIMDEC(bX) integer DIMDEC(bY) integer DIMDEC(bZ) integer DIMDEC(xflux) integer DIMDEC(yflux) integer DIMDEC(zflux) REAL_T x(DIMV(x),nc) REAL_T a(DIMV(a)) REAL_T bX(DIMV(bX)) REAL_T bY(DIMV(bY)) REAL_T bZ(DIMV(bZ)) REAL_T xflux(DIMV(xflux),nc) REAL_T yflux(DIMV(yflux),nc) REAL_T zflux(DIMV(zflux),nc) REAL_T h(BL_SPACEDIM) c REAL_T dhx, dhy, dhz integer i,j,k,n c dhx = one/h(1) dhy = one/h(2) dhz = one/h(3) c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1)+1 xflux(i,j,k,n) = - dhx*bX(i,j,k)*( x(i,j,k,n) - x(i-1,j,k,n) ) end do end do end do end do do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2)+1 do i = lo(1), hi(1) yflux(i,j,k,n) = - dhy*bY(i,j,k)*( x(i,j,k,n) - x(i,j-1,k,n) ) end do end do end do end do do n = 1, nc do k = lo(3), hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) zflux(i,j,k,n) = - dhz*bZ(i,j,k)*( x(i,j,k,n) - x(i,j,k-1,n) ) end do end do end do end do end ccseapps-2.5/CCSEApps/mglib/LinOp.H0000644000175000017500000003065111634153073020110 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _LINOP_H_ #define _LINOP_H_ // // $Id: LinOp.H,v 1.15 2001/08/01 21:51:04 lijewski Exp $ // #include #include #include #include #include #include #include //@Man: /*@Memo: A LinOp is a virtual base class for general linear operators capable of acting on MultiFabs. All implementation and access functions are designed to make a LinOp object useful for representing and solving a set of linear equations on a union of rectangles in 2D or 3D. */ /*@Doc: A LinOp contains all the information necessary to construct and maintain a linear operator which acts on a cell-centered MultiFab. It is a virtual base class, and therefore cannot itself be instantiated. The virtual functions implement "apply" and "smooth" operators (for the internal nodes), and therefore determine the mathematical character of the operator. LinOp, on the other hand, determines the implementation, filling ghost cells and creating coarsened versions of the domain and operator, etc. necessary for solving linear systems. LinOp is designed specifically for representing discrete approximations to partial differential operators. It requires a BndryData object, which maintains ghost cell data surrounding each rectangle in the domain, as well as position and boundary condition type specifiers. It also requires a (vector/scalar) grid spacing. On levels above the base level, LinOp internally recognizes adjacent domain rectangles (using methods similar to those in the BndryData class) and when applying boundary conditions (filling ghost cell regions) will give preference to "valid" data (i.e. ghost cells covered by adjacent grids are filled with the corresponding data from the interior of that adjacent grid rather than via the auxiliary boundary instructions). A LinOp constructs a set of "levels", which are useful for linear solution methods such as multigrid. On each grid, a new level is created by uniformly coarsening the grid structure by a factor of two in each coordinate direction (and then allocating and initializing any internal data necessary--new level grid spacing, for example). A LinOp can fill boundary ghost cells, compute a "norm" and coordinate the "apply" and "smooth" operations at each level. Note that there are the same number of levels on each grid in the LinOp's domain. If a boundary type specifier indicates the type "BndryData:: LO\_DIRICHLET", the ghost cells not covered by adjacent grids are filled on demand by a polynomial interpolant (of settable order) to compute the value specified in the BndryData FabSets along the edge of the grid boxes. A value is put into the ghost cell of the input multifab that can be assumed to exist outside the domain, at equal spacing with the rest of the nodes. "BndryData::LO\_NEUMANN" conditions result in ghost cells filled by second order extrapolation, and results in again filling the ghost cell with a value appropriate for application in a constant spacing cell-centered discretization. The order of the interpolant is set by default in this class to 2, which is compatible with most simple algebraic relaxation methods for linear systems based on numerical PDE's. The interpolant can be queried/set via member functions, and is applied uniformly over the domain. The boundary location is specified as a distance from the wall of the grid block, and is given in the same units that the grid spacing, h, is specified. All the member functions of LinOp which interact directly with the apply() member take a BC\_Mode flag. The BC\_mode can be either Homogeneous\_BC, or Inhomogeneous\_BC. It is a strict requirement of the linear operator that LinOp::apply(out,in,level,bc\_mode=Homogeneous\_BC) acting on in=0 returns out=0. This class does NOT provide a copy constructor or assignment operator. */ class LinOp { public: enum BC_Mode { Homogeneous_BC = 0, Inhomogeneous_BC }; // //@ManDoc: allocate a LinOp for this box array, boundary and (uniform) spacing info // LinOp (const BndryData& mgb, const Real _h); // //@ManDoc: allocate a LinOp for this box array, boundary data and spacing array info // LinOp (const BndryData& mgb, const Real* _h); // //@ManDoc: alocate a LinOp w/level structure beginning at the // specified level of this LinOp // LinOp (const LinOp& _Lp, int level); // //@ManDoc: destructor // virtual ~LinOp (); // //@ManDoc: applies level LinOp to "in", returns "out", uses BC\_mode flag // virtual void apply (MultiFab& out, MultiFab& in, int level = 0, LinOp::BC_Mode bc_mode = LinOp::Inhomogeneous_BC); // //@ManDoc: fills level boundary cells using BC\_mode flag, int. BC data if reqd // void applyBC (MultiFab& inout, int src_comp, int num_comp, int level = 0, LinOp::BC_Mode bc_mode = LinOp::Inhomogeneous_BC); // //@ManDoc: compute the level residual = rhsL - L(solnL) // virtual void residual (MultiFab& residL, const MultiFab& rhsL, MultiFab& solnL, int level = 0, LinOp::BC_Mode bc_mode = LinOp::Inhomogeneous_BC); // //@ManDoc: smooth the level system L(solnL)=rhsL // void smooth (MultiFab& solnL, const MultiFab& rhsL, int level = 0, LinOp::BC_Mode bc_mode = LinOp::Inhomogeneous_BC); // // Estimate the norm of the operator // virtual Real norm (int nm = 0, int level = 0); // //@ManDoc: Compute flux associated with the op // virtual void compFlux (D_DECL(MultiFab &xflux, MultiFab &yflux, MultiFab &zflux), MultiFab& in, const BC_Mode& bc_mode=Inhomogeneous_BC) = 0; // //@ManDoc: return the boundary data object // const BndryData& bndryData () const; // //@ManDoc: set the boundary data object // void bndryData (const BndryData& bd); // //@ManDoc: return the box array // const BoxArray& boxArray (int level = 0) const; // //@ManDoc: return the number of grids // int numGrids () const; // //@ManDoc: return the number of levels // int numLevels () const; // //@ManDoc: return the order of the boundary condition interpolant // int maxOrder () const; // //@ManDoc: set the order of the boundary condition interpolant // int maxOrder (int maxorder_); // //@ManDoc: construct/allocate internal data necessary for adding a new level // virtual void prepareForLevel (int level); // //@ManDoc: Output operator internal to an ASCII stream // friend std::ostream& operator<< (std::ostream& os, const LinOp& lp); protected: // //@ManDoc: Remove internal data necessary for a level and all higher. // virtual void clearToLevel (int level) {} // //@ManDoc: Virtual to apply the level operator to the internal nodes of // "in", return result in "out" // virtual void Fapply (MultiFab& out, const MultiFab& in, int level) = 0; // //@ManDoc: Virtual to carry out the level smoothing operation for // L(solnL)=rhsL on internal nodes. Modify solnL in place. // virtual void Fsmooth (MultiFab& solnL, const MultiFab& rhsL, int level, int rgbflag) = 0; // //@ManDoc: build coefficients at coarser level by interpolating "fine" // (builds in appropriate node/cell centering) // void makeCoefficients (MultiFab& crs, const MultiFab& fine, int level); // //@ManDoc: Initialize LinOp internal data. // static void initialize (); // //@ManDoc: Helper function for object construction. // void initConstruct (const Real* _h); // //@ManDoc: Array (on level) of Tuples (on dimension) of grid spacings // std::vector< Tuple< Real, BL_SPACEDIM > > h; // //@ManDoc: Array (on level) of BoxArray's of LinOp's domain // std::vector< BoxArray > gbox; // //@ManDoc: Array (on level) of pointers to BndryRegisters along each grid // for scratch data required to modify internal stencil on boundary // std::vector< CpClassPtr > undrrelxr; // //@ManDoc: Array (on level) of Arrays (on grid) of Arrays (on orientation) // of pointers to Masks for whether boundary Fabs are covered, // not\_covered, outside\_domain // // FIXME: This should really be an array of integer BndryRegisters // Array< Array< Array< Mask*> > > maskvals; // //@ManDoc: boundary data class // BndryData bgb; // //@ManDoc: Array (on level) of geometry objects. Needed for determining // whether stuff intersects on periodic domains // std::vector< Geometry > geomarray; // //@ManDoc: flag (=1 if use harmonic averaged interpolation for coefficients, // =0 is arithmetic averaging) // int harmavg; // //@ManDoc: flag (>0 is verbose execution) // int verbose; // //@ManDoc: maximum interpolation order used for constructing Dirichlet // ghost node values // int maxorder; // //@ManDoc: flag (=1 if internal data initialized) // static bool initialized; // //@ManDoc: default value for harm\_avg // static int def_harmavg; // //@ManDoc: default value for verbose // static int def_verbose; // //@ManDoc: default maximum BC interpolant order // static int def_maxorder; private: // // Not implemented. // LinOp (const LinOp& rhs); void operator = (const LinOp& rhs); }; inline const BndryData& LinOp::bndryData () const { return bgb; } inline void LinOp::bndryData (const BndryData& bd) { BL_ASSERT(gbox[0] == bd.boxes()); bgb = bd; } inline int LinOp::numLevels () const { return h.size(); } inline const BoxArray& LinOp::boxArray (int level) const { BL_ASSERT(level < numLevels()); return gbox[level]; } inline int LinOp::numGrids () const { return gbox[0].size(); } inline int LinOp::maxOrder () const { return maxorder; } inline int LinOp::maxOrder (int maxorder_) { BL_ASSERT(maxorder_ >= 2); maxorder_ = (maxorder_ < 2 ? 2 : maxorder_ ); int omaxorder = maxorder; maxorder = maxorder_; return omaxorder; } #endif /*_LINOP_H_*/ ccseapps-2.5/CCSEApps/mglib/INTERPBNDRYDATA_F.H0000644000175000017500000000714511634153073021570 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _INTERPBNDRY_F_H_ #define _INTERPBNDRY_F_H_ /* ** $Id: INTERPBNDRYDATA_F.H,v 1.3 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_BDINTERPXLO bdintrpxlo # define FORT_BDINTERPXHI bdintrpxhi # if (BL_SPACEDIM > 1) # define FORT_BDINTERPYLO bdintrpylo # define FORT_BDINTERPYHI bdintrpyhi # endif # if (BL_SPACEDIM > 2) # define FORT_BDINTERPZLO bdintrpzlo # define FORT_BDINTERPZHI bdintrpzhi # endif #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_BDINTERPXLO BDINTRPXLO # define FORT_BDINTERPXHI BDINTRPXHI # if (BL_SPACEDIM > 1) # define FORT_BDINTERPYLO BDINTRPYLO # define FORT_BDINTERPYHI BDINTRPYHI # endif # if (BL_SPACEDIM > 2) # define FORT_BDINTERPZLO BDINTRPZLO # define FORT_BDINTERPZHI BDINTRPZHI # endif # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_BDINTERPXLO bdintrpxlo # define FORT_BDINTERPXHI bdintrpxhi # if (BL_SPACEDIM > 1) # define FORT_BDINTERPYLO bdintrpylo # define FORT_BDINTERPYHI bdintrpyhi # endif # if (BL_SPACEDIM > 2) # define FORT_BDINTERPZLO bdintrpzlo # define FORT_BDINTERPZHI bdintrpzhi # endif # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_BDINTERPXLO bdintrpxlo_ # define FORT_BDINTERPXHI bdintrpxhi_ # if (BL_SPACEDIM > 1) # define FORT_BDINTERPYLO bdintrpylo_ # define FORT_BDINTERPYHI bdintrpyhi_ # endif # if (BL_SPACEDIM > 2) # define FORT_BDINTERPZLO bdintrpzlo_ # define FORT_BDINTERPZHI bdintrpzhi_ # endif #endif #include typedef void BDInterpFunc(Real* bndr, ARLIM_P(blo), ARLIM_P(bhi), const int* lo, const int* hi, ARLIM_P(cblo), ARLIM_P(cbhi), const int* nvar, const int* ratio, const int* not_covered, const int* mask, ARLIM_P(mlo), ARLIM_P(mhi), const Real* crse, ARLIM_P(clo), ARLIM_P(chi), Real* derives); extern "C" { BDInterpFunc FORT_BDINTERPXLO; BDInterpFunc FORT_BDINTERPXHI; #if (BL_SPACEDIM > 1) BDInterpFunc FORT_BDINTERPYLO; BDInterpFunc FORT_BDINTERPYHI; #endif #if (BL_SPACEDIM > 2) BDInterpFunc FORT_BDINTERPZLO; BDInterpFunc FORT_BDINTERPZHI; #endif } #endif #endif /*_INTERPBNDRY_F_H_*/ ccseapps-2.5/CCSEApps/mglib/LO_3D.F0000644000175000017500000007274211634153073017734 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: LO_3D.F,v 1.4 2002/11/27 21:54:35 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include #include "LO_BCTYPES.H" #include "LO_F.H" #include "ArrayLim.H" c----------------------------------------------------------------------- subroutine FORT_RESIDL ( $ res, DIMS(res), $ rhs, DIMS(rhs), $ phi, DIMS(phi), $ lo, hi, nc $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(phi) REAL_T phi(DIMV(phi),nc) integer DIMDEC(rhs) REAL_T rhs(DIMV(rhs),nc) integer DIMDEC(res) REAL_T res(DIMV(res),nc) c integer i integer j integer k integer n c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) res(i,j,k,n) = rhs(i,j,k,n) - phi(i,j,k,n) end do end do end do end do c end c----------------------------------------------------------------------- subroutine FORT_HARMONIC_AVERAGEEC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc, $ cdir $ ) c integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer cdir integer DIMDEC(f) REAL_T f(DIMV(f),nc) integer DIMDEC(c) REAL_T c(DIMV(c),nc) c REAL_T factor parameter(factor=four) integer n integer i integer j integer k c if ( cdir .eq. 0 ) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1)+1 c c(i,j,k,n) = factor/( $ + 1.0D0/f(2*i,2*j ,2*k ,n) $ + 1.0D0/f(2*i,2*j+1,2*k ,n) $ + 1.0D0/f(2*i,2*j ,2*k+1,n) $ + 1.0D0/f(2*i,2*j+1,2*k+1,n) ) c end do end do end do end do else if (cdir .eq. 1 ) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2)+1 do i = lo(1), hi(1) c c(i,j,k,n) = factor/( $ + 1.0D0/f(2*i ,2*j,2*k ,n) $ + 1.0D0/f(2*i+1,2*j,2*k ,n) $ + 1.0D0/f(2*i ,2*j,2*k+1,n) $ + 1.0D0/f(2*i+1,2*j,2*k+1,n) ) c end do end do end do end do else if (cdir .eq. 2 ) then do n = 1, nc do k = lo(3), hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) c c(i,j,k,n) = factor/( $ + 1.0D0/f(2*i ,2*j ,2*k,n) $ + 1.0D0/f(2*i+1,2*j ,2*k,n) $ + 1.0D0/f(2*i ,2*j+1,2*k,n) $ + 1.0D0/f(2*i+1,2*j+1,2*k,n) ) c end do end do end do end do end if c end c----------------------------------------------------------------------- subroutine FORT_AVERAGEEC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc, $ cdir $ ) c integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer cdir integer DIMDEC(f) REAL_T f(DIMV(f),nc) integer DIMDEC(c) REAL_T c(DIMV(c),nc) c integer n integer i integer j integer k REAL_T factor parameter(factor = fourth) c if ( cdir .eq. 0 ) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1)+1 c c(i,j,k,n) = factor*( $ + f(2*i,2*j ,2*k ,n) $ + f(2*i,2*j+1,2*k ,n) $ + f(2*i,2*j ,2*k+1,n) $ + f(2*i,2*j+1,2*k+1,n) ) c end do end do end do end do else if (cdir .eq. 1 ) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2)+1 do i = lo(1), hi(1) c c(i,j,k,n) = factor*( $ + f(2*i ,2*j,2*k ,n) $ + f(2*i+1,2*j,2*k ,n) $ + f(2*i ,2*j,2*k+1,n) $ + f(2*i+1,2*j,2*k+1,n) ) c end do end do end do end do else if (cdir .eq. 2 ) then do n = 1, nc do k = lo(3), hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) c c(i,j,k,n) = factor*( $ + f(2*i ,2*j ,2*k,n) $ + f(2*i+1,2*j ,2*k,n) $ + f(2*i ,2*j+1,2*k,n) $ + f(2*i+1,2*j+1,2*k,n) ) c end do end do end do end do end if c end c----------------------------------------------------------------------- subroutine FORT_AVERAGECC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc $ ) c integer nc integer DIMDEC(f) integer DIMDEC(c) integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) REAL_T f(DIMV(f),nc) REAL_T c(DIMV(c),nc) c integer i integer j integer k integer n REAL_T factor parameter(factor=eighth) c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) c c(i,j,k,n) = factor*( $ + f(2*i+1,2*j+1,2*k ,n) $ + f(2*i ,2*j+1,2*k ,n) $ + f(2*i+1,2*j ,2*k ,n) $ + f(2*i ,2*j ,2*k ,n) $ + f(2*i+1,2*j+1,2*k+1,n) $ + f(2*i ,2*j+1,2*k+1,n) $ + f(2*i+1,2*j ,2*k+1,n) $ + f(2*i ,2*j ,2*k+1,n) ) c end do end do end do end do c end c----------------------------------------------------------------------- subroutine FORT_APPLYBC ( $ flagden, flagbc, maxorder, $ phi, DIMS(phi), $ cdir, bct, bcl, $ bcval, DIMS(bcval), $ mask, DIMS(mask), $ den, DIMS(den), $ lo, hi, nc, $ h $ ) c c If the boundary is of Neumann type, set the ghost cell value to c that of the outermost point in the valid data (2nd order accurate) c and then fill the "den" array with the value "1" c c c If flagbc==1: c c If the boundary is of Dirichlet type, construct a polynomial c interpolation through the boundary location and internal points c (at locations x(-1:len-2) that generates the ghost cell value (at c location xInt). Then fill the ghost cell with the interpolated value. c If flagden==1, load the "den" array with the interpolation c coefficient corresponding to outermost point in the valid region c ( the coef(0) corresponding to the location x(0) ) c c Note: c The bc type = LO_REFLECT_ODD is a special type of dirichlet condition, c in that we want a "zeroth" order interpolant to fill the ghost cell. c If this were treated in the normal way, then ALL boundaries would be c low order. c integer maxorder integer nc, cdir, flagden, flagbc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(phi) REAL_T phi(DIMV(phi),nc) integer DIMDEC(den) REAL_T den(DIMV(den)) integer DIMDEC(bcval) REAL_T bcval(DIMV(bcval),nc) integer DIMDEC(mask) integer mask(DIMV(mask)) integer bct REAL_T bcl REAL_T h(BL_SPACEDIM) c integer i integer j integer k integer n logical is_dirichlet logical is_neumann logical is_odd REAL_T xb c integer lenx integer leny integer lenz integer m c integer Lmaxorder integer maxmaxorder parameter(maxmaxorder=4) REAL_T x(-1:maxmaxorder-2) REAL_T coef(-1:maxmaxorder-2) REAL_T xInt c is_dirichlet(i) = ( i .eq. LO_DIRICHLET ) is_neumann(i) = (i .eq. LO_NEUMANN) c if ( maxorder .eq. -1 ) then Lmaxorder = maxmaxorder else Lmaxorder = MIN(maxorder,maxmaxorder) end if lenx = MIN(hi(1)-lo(1), Lmaxorder-2) leny = MIN(hi(2)-lo(2), Lmaxorder-2) lenz = MIN(hi(3)-lo(3), Lmaxorder-2) c c TODO: c In order for this to work with growing multigrid, must c sort xa[] because it is possible for the xb value to lay c within this range. c c The Left face of the grid c if(cdir .eq. 0) then if (is_neumann(bct)) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) phi(lo(1)-1,j,k,n) = cvmgt( $ phi(lo(1),j,k,n), $ phi(lo(1)-1,j,k,n), $ mask(lo(1)-1,j,k) .gt. 0) end do end do end do if ( flagden .eq. 1) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(lo(1),j,k) = 1.0D0 end do end do end if else if (is_dirichlet(bct)) then do m=0,lenx x(m) = m + 0.5D0 end do x(-1) = - bcl/h(1) xInt = - 0.5D0 call polyInterpCoeff(xInt, x, lenx+2, coef) do n = 1, nc if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) phi(lo(1)-1, j, k, n) = cvmgt( $ bcval(lo(1)-1,j,k,n)*coef(-1), $ phi(lo(1)-1, j,k, n), $ mask(lo(1)-1,j,k) .gt. 0) end do end do else do k = lo(3), hi(3) do j = lo(2), hi(2) phi(lo(1)-1, j, k, n) = cvmgt( $ 0.0D0, $ phi(lo(1)-1, j, k, n), $ mask(lo(1)-1,j, k) .gt. 0) end do end do end if do m = 0, lenx do k = lo(3), hi(3) do j = lo(2), hi(2) phi(lo(1)-1,j,k,n) = cvmgt( $ phi(lo(1)-1,j,k,n) $ + phi(lo(1)+m, j, k, n)*coef(m), $ phi(lo(1)-1,j,k,n), $ mask(lo(1)-1,j,k) .gt. 0) end do end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(lo(1),j,k) = cvmgt(coef(0), 0.0D0, $ mask(lo(1)-1,j,k) .gt. 0) end do end do end if else if ( bct .eq. LO_REFLECT_ODD ) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) phi(lo(1)-1, j, k, n) = cvmgt( $ -phi(lo(1),j,k,n), $ phi(lo(1)-1,j,k,n), $ mask(lo(1)-1,j,k) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(lo(1),j,k) = cvmgt(-1.0D0, 0.0D0, $ mask(lo(1)-1,j,k) .gt. 0) end do end do end if else print *,'UNKNOWN BC ON LEFT FACE IN APPLYBC' call bl_error("stop") end if end if c c The Right face of the grid c if(cdir .eq. 3) then if(is_neumann(bct)) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) phi(hi(1)+1,j,k,n) = cvmgt( $ phi(hi(1), j, k, n), $ phi(hi(1)+1, j, k, n), $ mask(hi(1)+1,j,k) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(hi(1),j,k) = 1.0D0 end do end do end if else if (is_dirichlet(bct)) then do m=0,lenx x(m) = m + 0.5D0 end do x(-1) = - bcl/h(1) xInt = - 0.5D0 call polyInterpCoeff(xInt, x, lenx+2, coef) do n = 1, nc if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) phi(hi(1)+1,j,k,n) = cvmgt( $ bcval(hi(1)+1,j,k,n)*coef(-1), $ phi(hi(1)+1,j,k,n), $ mask(hi(1)+1,j,k) .gt. 0) end do end do else do k = lo(3), hi(3) do j = lo(2), hi(2) phi(hi(1)+1,j,k,n) = cvmgt( $ 0.0D0, $ phi(hi(1)+1,j,k,n), $ mask(hi(1)+1,j,k) .gt. 0) end do end do end if do m = 0, lenx do k = lo(3), hi(3) do j = lo(2), hi(2) phi(hi(1)+1,j,k,n) = cvmgt( $ phi(hi(1)+1,j,k,n) $ + phi(hi(1)-m,j,k,n)*coef(m), $ phi(hi(1)+1,j,k,n), $ mask(hi(1)+1,j,k) .gt. 0) end do end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(hi(1),j,k) = cvmgt(coef(0), 0.0D0, $ mask(hi(1)+1,j,k) .gt. 0) end do end do end if else if ( bct .eq. LO_REFLECT_ODD ) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) phi(hi(1)+1, j, k, n) = cvmgt( $ -phi(hi(1),j,k,n), $ phi(hi(1)+1,j,k,n), $ mask(hi(1)+1,j,k) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(hi(1),j,k) = cvmgt(-1.0D0, 0.0D0, $ mask(hi(1)+1,j,k) .gt. 0) end do end do end if else print *,'UNKNOWN BC ON RIGHT FACE IN APPLYBC' call bl_error("stop") end if end if c c The Bottom of the Grid c if(cdir .eq. 1) then if(is_neumann(bct)) then do n = 1, nc do k = lo(3), hi(3) do i = lo(1),hi(1) phi(i,lo(2)-1,k,n) = cvmgt( $ phi(i,lo(2),k,n), $ phi(i,lo(2)-1,k,n), $ mask(i,lo(2)-1,k) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1),hi(1) den(i,lo(2),k) = 1.0D0 end do end do end if else if (is_dirichlet(bct)) then do m=0,leny x(m) = m + 0.5D0 end do x(-1) = - bcl/h(2) xInt = - 0.5D0 call polyInterpCoeff(xInt, x, leny+2, coef) do n = 1, nc if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) phi(i,lo(2)-1,k,n) = cvmgt( $ bcval(i,lo(2)-1,k,n)*coef(-1), $ phi(i,lo(2)-1,k,n), $ mask(i,lo(2)-1,k) .gt. 0) end do end do else do k = lo(3), hi(3) do i = lo(1), hi(1) phi(i,lo(2)-1,k,n) = cvmgt( $ 0.0D0, $ phi(i,lo(2)-1,k,n), $ mask(i,lo(2)-1,k) .gt. 0) end do end do end if do m = 0, leny do k = lo(3), hi(3) do i = lo(1), hi(1) phi(i, lo(2)-1, k, n) = cvmgt( $ phi(i, lo(2)-1,k,n) $ + phi(i, lo(2)+m, k,n)*coef(m), $ phi(i, lo(2)-1, k, n), $ mask(i, lo(2)-1, k) .gt. 0) end do end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i, lo(2),k) = cvmgt(coef(0), 0.0D0, $ mask(i, lo(2)-1,k) .gt. 0) end do end do end if else if ( bct .eq. LO_REFLECT_ODD ) then do n = 1, nc do k = lo(3), hi(3) do i = lo(1), hi(1) phi(i, lo(2)-1, k, n) = cvmgt( $ -phi(i,lo(2),k,n), $ phi(i,lo(2)-1,k,n), $ mask(i,lo(2)-1,k) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,lo(2),k) = cvmgt(-1.0D0, 0.0D0, $ mask(i,lo(2)-1,k) .gt. 0) end do end do end if else print *,'UNKNOWN BC ON BOTTOM FACE IN APPLYBC' call bl_error("stop") end if end if c c The top of the grid c if (cdir .eq. 4) then if(is_neumann(bct)) then do n = 1, nc do k = lo(3), hi(3) do i = lo(1), hi(1) phi(i,hi(2)+1,k,n) = cvmgt( $ phi(i,hi(2),k,n), $ phi(i,hi(2)+1,k,n), $ mask(i,hi(2)+1,k) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,hi(2),k) = 1.0D0 end do end do end if else if (is_dirichlet(bct)) then do m=0,leny x(m) = m + 0.5D0 end do x(-1) = - bcl/h(2) xInt = - 0.5D0 call polyInterpCoeff(xInt, x, leny+2, coef) do n = 1, nc if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) phi(i,hi(2)+1,k,n) = cvmgt( $ bcval(i,hi(2)+1,k,n)*coef(-1), $ phi(i,hi(2)+1,k,n), $ mask(i,hi(2)+1,k) .gt. 0) end do end do else do k = lo(3), hi(3) do i = lo(1), hi(1) phi(i,hi(2)+1,k,n) = cvmgt( $ 0.0D0, $ phi(i,hi(2)+1,k,n), $ mask(i,hi(2)+1,k) .gt. 0) end do end do end if do m = 0, leny do k = lo(3), hi(3) do i = lo(1), hi(1) phi(i, hi(2)+1,k,n) = cvmgt( $ phi(i,hi(2)+1,k,n) $ + phi(i, hi(2)-m,k,n)*coef(m), $ phi(i,hi(2)+1,k,n), $ mask(i,hi(2)+1,k) .gt. 0) end do end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,hi(2),k) = cvmgt(coef(0), 0.0D0, $ mask(i,hi(2)+1,k) .gt. 0) end do end do end if else if ( bct .eq. LO_REFLECT_ODD ) then do n = 1, nc do k = lo(3), hi(3) do i = lo(1), hi(1) phi(i, hi(2)+1, k, n) = cvmgt( $ -phi(i,hi(2),k,n), $ phi(i,hi(2)+1,k,n), $ mask(i,hi(2)+1,k) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,hi(2),k) = cvmgt(-1.0D0, 0.0D0, $ mask(i,hi(2)+1,k) .gt. 0) end do end do end if else print *,'UNKNOWN BC ON TOP FACE IN APPLYBC' call bl_error("stop") end if end if c c The Front of the Grid c if(cdir .eq. 2) then if(is_neumann(bct)) then do n = 1, nc do j = lo(2), hi(2) do i = lo(1),hi(1) phi(i,j,lo(3)-1,n) = cvmgt( $ phi(i,j,lo(3),n), $ phi(i,j,lo(3)-1,n), $ mask(i,j,lo(3)-1) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1),hi(1) den(i,j,lo(3)) = 1.0D0 end do end do end if else if (is_dirichlet(bct)) then do m=0,lenz x(m) = m + 0.5D0 end do x(-1) = - bcl/h(3) xInt = - 0.5D0 call polyInterpCoeff(xInt, x, lenz+2, coef) do n = 1, nc if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i,j,lo(3)-1,n) = cvmgt( $ bcval(i,j,lo(3)-1,n)*coef(-1), $ phi(i,j,lo(3)-1,n), $ mask(i,j,lo(3)-1) .gt. 0) end do end do else do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i,j,lo(3)-1,n) = cvmgt( $ 0.0D0, $ phi(i,j,lo(3)-1,n), $ mask(i,j,lo(3)-1) .gt. 0) end do end do end if do m = 0, lenz do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i, j, lo(3)-1, n) = cvmgt( $ phi(i, j, lo(3)-1,n) $ + phi(i, j, lo(3)+m, n)*coef(m), $ phi(i, j, lo(3)-1,n), $ mask(i, j, lo(3)-1) .gt. 0) end do end do end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i, j, lo(3)) = cvmgt(coef(0), 0.0D0, $ mask(i, j, lo(3)-1) .gt. 0) end do end do end if else if ( bct .eq. LO_REFLECT_ODD ) then do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i, j, lo(3)-1, n) = cvmgt( $ -phi(i,j,lo(3),n), $ phi(i,j,lo(3)-1,n), $ mask(i,j,lo(3)-1) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j,lo(3)) = cvmgt(-1.0D0, 0.0D0, $ mask(i,j,lo(3)-1) .gt. 0) end do end do end if else print *,'UNKNOWN BC ON FRONT FACE IN APPLYBC' call bl_error("stop") end if end if c c The back of the grid c if (cdir .eq. 5) then if(is_neumann(bct)) then do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i,j, hi(3)+1,n) = cvmgt( $ phi(i,j, hi(3),n), $ phi(i,j, hi(3)+1,n), $ mask(i,j, hi(3)+1) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j, hi(3)) = 1.0D0 end do end do end if else if (is_dirichlet(bct)) then do m=0,lenz x(m) = m + 0.5D0 end do x(-1) = - bcl/h(3) xInt = - 0.5D0 call polyInterpCoeff(xInt, x, lenz+2, coef) do n = 1, nc if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i,j, hi(3)+1,n) = cvmgt( $ bcval(i,j, hi(3)+1,n)*coef(-1), $ phi(i,j, hi(3)+1,n), $ mask(i,j, hi(3)+1) .gt. 0) end do end do else do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i,j, hi(3)+1,n) = cvmgt( $ 0.0D0, $ phi(i,j, hi(3)+1,n), $ mask(i,j, hi(3)+1) .gt. 0) end do end do end if do m = 0, lenz do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i, j, hi(3)+1,n) = cvmgt( $ phi(i,j, hi(3)+1,n) $ + phi(i, j, hi(3)-m,n)*coef(m), $ phi(i,j, hi(3)+1,n), $ mask(i,j, hi(3)+1) .gt. 0) end do end do end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j, hi(3)) = cvmgt(coef(0), 0.0D0, $ mask(i,j, hi(3)+1) .gt. 0) end do end do end if else if ( bct .eq. LO_REFLECT_ODD ) then do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i, j, hi(3)+1, n) = cvmgt( $ -phi(i,j,hi(3),n), $ phi(i,j,hi(3)+1,n), $ mask(i,j,hi(3)+1) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j,hi(3)) = cvmgt(-1.0D0, 0.0D0, $ mask(i,j,hi(3)+1) .gt. 0) end do end do end if else print *,'UNKNOWN BC ON BACK FACE IN APPLYBC' call bl_error("stop") end if end if c end ccseapps-2.5/CCSEApps/mglib/LO_2D.F0000644000175000017500000004401611634153073017724 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: LO_2D.F,v 1.5 2002/11/27 21:54:35 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include #include "LO_BCTYPES.H" #include "LO_F.H" #include "ArrayLim.H" c----------------------------------------------------------------------- subroutine FORT_RESIDL ( $ res, DIMS(res), $ rhs, DIMS(rhs), $ phi, DIMS(phi), $ lo, hi, nc $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(phi) REAL_T phi(DIMV(phi),nc) integer DIMDEC(rhs) REAL_T rhs(DIMV(rhs),nc) integer DIMDEC(res) REAL_T res(DIMV(res),nc) c integer i integer j integer n c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) res(i,j,n) = rhs(i,j,n) - phi(i,j,n) end do end do end do c end c----------------------------------------------------------------------- subroutine FORT_HARMONIC_AVERAGEEC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc, $ cdir $ ) c integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer cdir integer DIMDEC(f) REAL_T f(DIMV(f),nc) integer DIMDEC(c) REAL_T c(DIMV(c),nc) c REAL_T factor, den parameter(factor=2.00D0) integer n integer i integer j c if ( cdir .eq. 0 ) then do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1)+1 den = f(2*i,2*j,n) + f(2*i,2*j+1,n) if (den .ne. 0.0D0) then c(i,j,n) = factor*f(2*i,2*j,n)*f(2*i,2*j+1,n)/den else c(i,j,n) = 0.0D0 end if end do end do end do else if (cdir .eq. 1 ) then do n = 1, nc do j = lo(2), hi(2)+1 do i = lo(1), hi(1) den = f(2*i,2*j,n) + f(2*i+1,2*j,n) if (den .ne. 0.0D0) then c(i,j,n) = factor*f(2*i,2*j,n)*f(2*i+1,2*j,n)/den else c(i,j,n) = 0.0D0 end if end do end do end do end if c end c----------------------------------------------------------------------- subroutine FORT_AVERAGEEC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc, $ cdir $ ) c integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer cdir integer DIMDEC(f) REAL_T f(DIMV(f),nc) integer DIMDEC(c) REAL_T c(DIMV(c),nc) c integer n integer i integer j REAL_T denom parameter(denom=half) c if (cdir .eq. 0 ) then do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1)+1 c(i,j,n) = (f(2*i,2*j,n) + f(2*i,2*j+1,n))*denom end do end do end do else if (cdir .eq. 1) then do n = 1, nc do j = lo(2), hi(2)+1 do i = lo(1), hi(1) c(i,j,n) = (f(2*i,2*j,n) + f(2*i+1,2*j,n))*denom end do end do end do end if c end c----------------------------------------------------------------------- subroutine FORT_AVERAGECC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc $ ) c integer nc integer DIMDEC(f) integer DIMDEC(c) integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) REAL_T f(DIMV(f),nc) REAL_T c(DIMV(c),nc) c integer i integer j integer n REAL_T denom parameter(denom=fourth) c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) c(i,j,n) = ( $ f(2*i+1,2*j+1,n) + f(2*i ,2*j+1,n) $ + f(2*i+1,2*j ,n) + f(2*i ,2*j ,n))*denom end do end do end do c end c----------------------------------------------------------------------- subroutine FORT_APPLYBC ( $ flagden, flagbc, maxorder, $ phi, DIMS(phi), $ cdir, bct, bcl, $ bcval, DIMS(bcval), $ mask, DIMS(mask), $ den, DIMS(den), $ lo, hi, nc, $ h $ ) c c If the boundary is of Neumann type, set the ghost cell value to c that of the outermost point in the valid data (2nd order accurate) c and then fill the "den" array with the value "1" c c c If flagbc==1: c c If the boundary is of Dirichlet type, construct a polynomial c interpolation through the boundary location and internal points c (at locations x(-1:len-2) that generates the ghost cell value (at c location xInt). Then fill the ghost cell with the interpolated value. c If flagden==1, load the "den" array with the interpolation c coefficient corresponding to outermost point in the valid region c ( the coef(0) corresponding to the location x(0) ) c c Note: c The bc type = LO_REFLECT_ODD is a special type of boundary condition. c integer maxorder integer nc, cdir, flagden, flagbc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(phi) REAL_T phi(DIMV(phi),nc) integer DIMDEC(den) REAL_T den(DIMV(den)) integer DIMDEC(bcval) REAL_T bcval(DIMV(bcval),nc) integer DIMDEC(mask) integer mask(DIMV(mask)) integer bct REAL_T bcl REAL_T h(BL_SPACEDIM) c integer i integer j integer n logical is_dirichlet logical is_neumann logical is_odd REAL_T xb c integer lenx integer leny integer m c integer Lmaxorder integer maxmaxorder parameter(maxmaxorder=4) REAL_T x(-1:maxmaxorder-2) REAL_T coef(-1:maxmaxorder-2) REAL_T xInt c is_dirichlet(i) = ( i .eq. LO_DIRICHLET ) is_neumann(i) = ( i .eq. LO_NEUMANN ) c if ( maxorder .eq. -1 ) then Lmaxorder = maxmaxorder else Lmaxorder = MIN(maxorder,maxmaxorder) end if lenx = MIN(hi(1)-lo(1), Lmaxorder-2) leny = MIN(hi(2)-lo(2), Lmaxorder-2) c c TODO: c In order for this to work with growing multigrid, must c sort xa[] because it is possible for the xb value to lay c within this range. c c The Left face of the grid c if(cdir .eq. 0) then if (is_neumann(bct)) then do n = 1, nc do j = lo(2), hi(2) phi(lo(1)-1,j,n) = cvmgt( $ phi(lo(1),j,n), $ phi(lo(1)-1,j,n), $ mask(lo(1)-1,j) .gt. 0) end do end do if ( flagden .eq. 1) then do j = lo(2), hi(2) den(lo(1),j) = 1.0D0 end do end if else if (is_dirichlet(bct)) then do m=0,lenx x(m) = m + 0.5D0 end do x(-1) = - bcl/h(1) xInt = - 0.5D0 call polyInterpCoeff(xInt, x, lenx+2, coef) do n = 1, nc if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) phi(lo(1)-1, j, n) = cvmgt( $ bcval(lo(1)-1,j,n)*coef(-1), $ phi(lo(1)-1, j, n), $ mask(lo(1)-1,j) .gt. 0) end do else do j = lo(2), hi(2) phi(lo(1)-1, j, n) = cvmgt( $ 0.0D0, $ phi(lo(1)-1, j, n), $ mask(lo(1)-1,j) .gt. 0) end do end if do m = 0, lenx do j = lo(2), hi(2) phi(lo(1)-1,j,n) = cvmgt( $ phi(lo(1)-1,j,n) $ + phi(lo(1)+m, j, n)*coef(m), $ phi(lo(1)-1,j,n), $ mask(lo(1)-1,j) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(lo(1),j) = cvmgt(coef(0), 0.0D0, $ mask(lo(1)-1,j) .gt. 0) end do end if else if ( bct .eq. LO_REFLECT_ODD ) then do n = 1, nc do j = lo(2), hi(2) phi(lo(1)-1, j, n) = cvmgt( $ -phi(lo(1),j,n), $ phi(lo(1)-1, j, n), $ mask(lo(1)-1,j) .gt. 0) end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(lo(1),j) = cvmgt(-1.0D0, 0.0D0, $ mask(lo(1)-1,j) .gt. 0) end do end if else print *,'UNKNOWN BC ON LEFT FACE IN APPLYBC' call bl_error("stop") end if end if c c The Right face of the grid c if(cdir .eq. 2) then if(is_neumann(bct)) then do n = 1, nc do j = lo(2), hi(2) phi(hi(1)+1,j,n) = cvmgt( $ phi(hi(1), j, n), $ phi(hi(1)+1, j, n), $ mask(hi(1)+1,j) .gt. 0) end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(hi(1),j) = 1.0D0 end do end if else if (is_dirichlet(bct)) then do m=0,lenx x(m) = m + 0.5D0 end do x(-1) = - bcl/h(1) xInt = - 0.5D0 call polyInterpCoeff(xInt, x, lenx+2, coef) do n = 1, nc if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) phi(hi(1)+1,j,n) = cvmgt( $ bcval(hi(1)+1,j,n)*coef(-1), $ phi(hi(1)+1,j,n), $ mask(hi(1)+1,j) .gt. 0) end do else do j = lo(2), hi(2) phi(hi(1)+1,j,n) = cvmgt( $ 0.0D0, $ phi(hi(1)+1,j,n), $ mask(hi(1)+1,j) .gt. 0) end do end if do m = 0, lenx do j = lo(2), hi(2) phi(hi(1)+1,j,n) = cvmgt( $ phi(hi(1)+1,j,n) $ + phi(hi(1)-m,j,n)*coef(m), $ phi(hi(1)+1,j,n), $ mask(hi(1)+1,j) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(hi(1),j) = cvmgt(coef(0), 0.0D0, $ mask(hi(1)+1,j) .gt. 0) end do end if else if ( bct .eq. LO_REFLECT_ODD ) then do n = 1, nc do j = lo(2), hi(2) phi(hi(1)+1, j, n) = cvmgt( $ -phi(hi(1),j,n), $ phi(hi(1)+1, j, n), $ mask(hi(1)+1,j) .gt. 0) end do end do if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(hi(1),j) = cvmgt(-1.0D0, 0.0D0, $ mask(hi(1)+1,j) .gt. 0) end do end if else print *,'UNKNOWN BC ON RIGHT FACE IN APPLYBC' call bl_error("stop") end if end if c c The Bottom of the Grid c if(cdir .eq. 1) then if(is_neumann(bct)) then do n = 1, nc do i = lo(1),hi(1) phi(i,lo(2)-1,n) = cvmgt( $ phi(i,lo(2),n), $ phi(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) end do end do if ( flagden .eq. 1 ) then do i = lo(1),hi(1) den(i,lo(2)) = 1.0D0 end do end if else if (is_dirichlet(bct)) then do m=0,leny x(m) = m + 0.5D0 end do x(-1) = - bcl/h(2) xInt = - 0.5D0 call polyInterpCoeff(xInt, x, leny+2, coef) do n = 1, nc if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) phi(i,lo(2)-1,n) = cvmgt( $ bcval(i,lo(2)-1,n)*coef(-1), $ phi(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) end do else do i = lo(1), hi(1) phi(i,lo(2)-1,n) = cvmgt( $ 0.0D0, $ phi(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) end do end if do m = 0, leny do i = lo(1), hi(1) phi(i, lo(2)-1, n) = cvmgt( $ phi(i, lo(2)-1,n) $ + phi(i, lo(2)+m,n)*coef(m), $ phi(i, lo(2)-1, n), $ mask(i, lo(2)-1) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i, lo(2)) = cvmgt(coef(0), 0.0D0, $ mask(i, lo(2)-1) .gt. 0) end do end if else if ( bct .eq. LO_REFLECT_ODD ) then do n = 1, nc do i = lo(1), hi(1) phi(i,lo(2)-1,n) = cvmgt( $ -phi(i,lo(2),n), $ phi(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) end do end do if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,lo(2)) = cvmgt(-1.0D0, 0.0D0, $ mask(i,lo(2)-1) .gt. 0) end do end if else print *,'UNKNOWN BC ON BOTTOM FACE IN APPLYBC' call bl_error("stop") end if end if c c The top of the grid c if (cdir .eq. 3) then if(is_neumann(bct)) then do n = 1, nc do i = lo(1), hi(1) phi(i,hi(2)+1,n) = cvmgt( $ phi(i,hi(2),n), $ phi(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) end do end do if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,hi(2)) = 1.0D0 end do end if else if (is_dirichlet(bct)) then if ( bct .eq. LO_REFLECT_ODD ) leny = 0 do m=0,leny x(m) = m + 0.5D0 end do x(-1) = - bcl/h(2) xInt = - 0.5D0 call polyInterpCoeff(xInt, x, leny+2, coef) do n = 1, nc if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) phi(i,hi(2)+1,n) = cvmgt( $ bcval(i,hi(2)+1,n)*coef(-1), $ phi(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) end do else do i = lo(1), hi(1) phi(i,hi(2)+1,n) = cvmgt( $ 0.0D0, $ phi(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) end do end if do m = 0, leny do i = lo(1), hi(1) phi(i, hi(2)+1,n) = cvmgt( $ phi(i,hi(2)+1,n) $ + phi(i, hi(2)-m,n)*coef(m), $ phi(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) end do end do end do if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,hi(2)) = cvmgt(coef(0), 0.0D0, $ mask(i,hi(2)+1) .gt. 0) end do end if else if ( bct .eq. LO_REFLECT_ODD ) then do n = 1, nc do i = lo(1), hi(1) phi(i,hi(2)+1,n) = cvmgt( $ -phi(i,hi(2),n), $ phi(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) end do end do if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,hi(2)) = cvmgt(-1.0D0, 0.0D0, $ mask(i,hi(2)+1) .gt. 0) end do end if else print *,'UNKNOWN BC ON TOP FACE IN APPLYBC' call bl_error("stop") end if end if c end ccseapps-2.5/CCSEApps/mglib/CG_2D.F0000644000175000017500000001240011634153073017673 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c $Id: CG_2D.F,v 1.5 2002/08/29 22:14:39 car Exp $ #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include "CG_F.H" #include "ArrayLim.H" c----------------------------------------------------------------------- c c CGUPDATE: Modify the input arrays as follows: c c phi = phi + a*pp c rr = rr - a*ww through range lo:hi c c phi <=> c rr <=> c a <= c ww <= c pp <= c c----------------------------------------------------------------------- subroutine FORT_CGUPDATE( $ phi, DIMS(phi), $ rr, DIMS(rr), $ a, $ ww, DIMS(ww), $ pp, DIMS(pp), $ lo, hi, nc $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(rr) REAL_T rr(DIMV(rr),nc) integer DIMDEC(ww) REAL_T ww(DIMV(ww),nc) integer DIMDEC(pp) REAL_T pp(DIMV(pp),nc) integer DIMDEC(phi) REAL_T phi(DIMV(phi),nc) REAL_T a c ... wyc change --- why was a a vector? c REAL_T a(nc) c integer i,j,n c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) phi(i,j,n) = phi(i,j,n) + a * pp(i,j,n) rr(i,j,n) = rr(i,j,n) - a * ww(i,j,n) c .... wyc change --- why was a a vector? c phi(i,j,n) = phi(i,j,n) + a(n) * pp(i,j,n) c rr(i,j,n) = rr(i,j,n) - a(n) * ww(i,j,n) end do end do end do c end c----------------------------------------------------------------------- c c CGADVCP: Modify the input arrays as follows: c c pp = rr + b*pp through range lo:hi c c pp <=> c rr <=> c b <= c c----------------------------------------------------------------------- subroutine FORT_CGADVCP( $ pp, DIMS(pp), $ rr, DIMS(rr), $ b, $ lo, hi, nc $ ) c integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(rr) REAL_T rr(DIMV(rr),nc) integer DIMDEC(pp) REAL_T pp(DIMV(pp),nc) REAL_T b c ... wyc change c REAL_T b(nc) c integer i,j,n c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) pp(i,j,n) = rr(i,j,n) + b*pp(i,j,n) c ... wyc change ... c pp(i,j,n) = rr(i,j,n) + b(n)*pp(i,j,n) end do end do end do c end c----------------------------------------------------------------------- c c CGXDOTY: Modify the input as follows: c c pw = Transpose(pp) . ww through range lo:hi c c pw => c pp <= c ww <= c c----------------------------------------------------------------------- subroutine FORT_CGXDOTY( $ pw, $ pp, DIMS(pp), $ ww, DIMS(ww), $ lo, hi, nc $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(ww) REAL_T ww(DIMV(ww),nc) integer DIMDEC(pp) REAL_T pp(DIMV(pp),nc) REAL_T pw c integer i, j, n c pw = 0.0D0 do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) pw = pw + pp(i,j,n)*ww(i,j,n) end do end do end do c end c----------------------------------------------------------------------- subroutine FORT_CGSXAY( $ ss, DIMS(ss), $ xx, DIMS(xx), $ a, $ yy, DIMS(yy), $ lo, hi, nc $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(ss) REAL_T ss(DIMV(ss),nc) integer DIMDEC(xx) REAL_T xx(DIMV(xx),nc) integer DIMDEC(yy) REAL_T yy(DIMV(yy),nc) REAL_T a c integer i, j, n c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) ss(i,j,n) = xx(i,j,n) + a*yy(i,j,n) end do end do end do c end ccseapps-2.5/CCSEApps/mglib/INTERPBNDRYDATA_3D.F0000644000175000017500000007440711634153073021654 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: INTERPBNDRYDATA_3D.F,v 1.2 2002/10/19 18:33:57 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "BC_TYPES.H" #include "REAL.H" #include "CONSTANTS.H" #include "INTERPBNDRYDATA_F.H" #include "ArrayLim.H" #define SDIM 3 #define NUMDERIV 5 #define XDER 1 #define YDER 2 #define X2DER 3 #define Y2DER 4 #define XYDER 5 c --------------------------------------------------------------- c :: FORT_BDINTERPXLO : Interpolation on Xlo Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables to interpolate c :: ratios(3) => refinement ratios c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPXLO (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratios,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives) integer nvar, ratios(3), not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),nvar) REAL_T derives(DIM23(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx, yy, ainterp integer i, j, k, ic, jc, kc, joff, koff, n integer jclo, jchi, kclo, kchi, ratioy, ratioz ratioy = ratios(2) ratioz = ratios(3) kclo = ARG_L3(cb) kchi = ARG_H3(cb) jclo = ARG_L2(cb) jchi = ARG_H2(cb) ic = ARG_L1(cb)-1 i = lo(1)-1 do n = 1, nvar c ::::: define interp coefs do kc = kclo, kchi k = ratioz*kc do jc = jclo, jchi j = ratioy*jc derives(jc,kc,XDER) = half*(crse(ic,jc+1,kc,n) - crse(ic,jc-1,kc,n)) derives(jc,kc,X2DER) = half*(crse(ic,jc+1,kc,n) - two*crse(ic,jc,kc,n) & + crse(ic,jc-1,kc,n)) derives(jc,kc,YDER) = half*(crse(ic,jc,kc+1,n) - crse(ic,jc,kc-1,n)) derives(jc,kc,Y2DER) = half*(crse(ic,jc,kc+1,n) - two*crse(ic,jc,kc,n) & + crse(ic,jc,kc-1,n)) derives(jc,kc,XYDER) = forth*(crse(ic,jc+1,kc+1,n) - crse(ic,jc-1,kc+1,n) & + crse(ic,jc-1,kc-1,n) - crse(ic,jc+1,kc-1,n)) if (mask(i,j-1,k) .ne. not_covered) then derives(jc,kc,XDER) = crse(ic,jc+1,kc,n) - crse(ic,jc,kc,n) derives(jc,kc,X2DER) = zero end if if (mask(i,j+ratioy,k) .ne. not_covered) then derives(jc,kc,XDER) = crse(ic,jc,kc,n) - crse(ic,jc-1,kc,n) derives(jc,kc,X2DER) = zero end if if (mask(i,j-1,k) .ne. not_covered .and. $ mask(i,j+ratioy,k) .ne. not_covered) then derives(jc,kc,XDER) = zero end if if (mask(i,j,k-1) .ne. not_covered) then derives(jc,kc,YDER) = crse(ic,jc,kc+1,n) - crse(ic,jc,kc,n) derives(jc,kc,Y2DER) = zero end if if (mask(i,j,k+ratioz) .ne. not_covered) then derives(jc,kc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc,kc-1,n) derives(jc,kc,Y2DER) = zero end if if (mask(i,j,k-1) .ne. not_covered .and. $ mask(i,j,k+ratioz) .ne. not_covered) then derives(jc,kc,YDER) = zero end if if ( $ ( mask(i,j+ratioy,k+ratioz) .ne. not_covered ) .or. $ ( mask(i,j-1,k+ratioz) .ne. not_covered ) .or. $ ( mask(i,j+ratioy,k-1) .ne. not_covered ) .or. $ ( mask(i,j-1,k-1) .ne. not_covered ) ) then derives(jc,kc,XYDER) = zero end if end do end do c ::::: interpolate to fine grid do koff = 0, ratioz - 1 yy = (dble(koff - ratioz/2) + half)/ratioz do kc = kclo,kchi k = ratioz*kc + koff do joff = 0, ratioy - 1 xx = (dble(joff - ratioy/2) + half)/ratioy do jc = jclo, jchi j = ratioy*jc + joff bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(jc,kc,XDER) & + derives(jc,kc,X2DER)*xx**2 + yy*derives(jc,kc,YDER) & + derives(jc,kc,Y2DER)*yy**2 + xx*yy*derives(jc,kc,XYDER) end do end do end do end do end do return end c --------------------------------------------------------------- c :: FORT_BDINTERPXHI : Interpolation on Xhi Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables to interpolate c :: ratios(3) => refinement ratios c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPXHI (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratios,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives) integer nvar, ratios(3), not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),nvar) REAL_T derives(DIM23(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx, yy, ainterp integer i, j, k, ic, jc, kc, joff, koff, n integer jclo, jchi, kclo, kchi, ratioy, ratioz ratioy = ratios(2) ratioz = ratios(3) kclo = ARG_L3(cb) kchi = ARG_H3(cb) jclo = ARG_L2(cb) jchi = ARG_H2(cb) ic = ARG_H1(cb)+1 i = hi(1)+1 do n = 1, nvar c ::::: define interp coefs do kc = kclo, kchi k = ratioz*kc do jc = jclo, jchi j = ratioy*jc derives(jc,kc,XDER) = half*(crse(ic,jc+1,kc,n) - crse(ic,jc-1,kc,n)) derives(jc,kc,X2DER) = half*(crse(ic,jc+1,kc,n) - two*crse(ic,jc,kc,n) & + crse(ic,jc-1,kc,n)) derives(jc,kc,YDER) = half*(crse(ic,jc,kc+1,n) - crse(ic,jc,kc-1,n)) derives(jc,kc,Y2DER) = half*(crse(ic,jc,kc+1,n) - two*crse(ic,jc,kc,n) & + crse(ic,jc,kc-1,n)) derives(jc,kc,XYDER) = forth*(crse(ic,jc+1,kc+1,n) - crse(ic,jc-1,kc+1,n) & + crse(ic,jc-1,kc-1,n) - crse(ic,jc+1,kc-1,n)) if (mask(i,j-1,k) .ne. not_covered) then derives(jc,kc,XDER) = crse(ic,jc+1,kc,n) - crse(ic,jc,kc,n) derives(jc,kc,X2DER) = zero end if if (mask(i,j+ratioy,k) .ne. not_covered) then derives(jc,kc,XDER) = crse(ic,jc,kc,n) - crse(ic,jc-1,kc,n) derives(jc,kc,X2DER) = zero end if if (mask(i,j-1,k) .ne. not_covered .and. $ mask(i,j+ratioy,k) .ne. not_covered) then derives(jc,kc,XDER) = zero end if if (mask(i,j,k-1) .ne. not_covered) then derives(jc,kc,YDER) = crse(ic,jc,kc+1,n) - crse(ic,jc,kc,n) derives(jc,kc,Y2DER) = zero end if if (mask(i,j,k+ratioz) .ne. not_covered) then derives(jc,kc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc,kc-1,n) derives(jc,kc,Y2DER) = zero end if if (mask(i,j,k-1) .ne. not_covered .and. $ mask(i,j,k+ratioz) .ne. not_covered) then derives(jc,kc,YDER) = zero end if if ( $ ( mask(i,j+ratioy,k+ratioz) .ne. not_covered ) .or. $ ( mask(i,j-1,k+ratioz) .ne. not_covered ) .or. $ ( mask(i,j+ratioy,k-1) .ne. not_covered ) .or. $ ( mask(i,j-1,k-1) .ne. not_covered ) ) then derives(jc,kc,XYDER) = zero end if end do end do c ::::: interpolate to fine grid do koff = 0, ratioz - 1 yy = (dble(koff - ratioz/2) + half)/ratioz do kc = kclo,kchi k = ratioz*kc + koff do joff = 0, ratioy - 1 xx = (dble(joff - ratioy/2) + half)/ratioy do jc = jclo, jchi j = ratioy*jc + joff bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(jc,kc,XDER) & + derives(jc,kc,X2DER)*xx**2 + yy*derives(jc,kc,YDER) & + derives(jc,kc,Y2DER)*yy**2 + xx*yy*derives(jc,kc,XYDER) end do end do end do end do end do return end c --------------------------------------------------------------- c :: FORT_BDINTERPYLO : Interpolation on Ylo Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables to interpolate c :: ratios(3) => refinement ratios c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPYLO (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratios,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives) integer nvar, ratios(3), not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),nvar) REAL_T derives(DIM13(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx, yy, ainterp integer i, j, k, ic, jc, kc, ioff, koff, n integer iclo, ichi, kclo, kchi, ratiox, ratioz ratiox = ratios(1) ratioz = ratios(3) kclo = ARG_L3(cb) kchi = ARG_H3(cb) iclo = ARG_L1(cb) ichi = ARG_H1(cb) jc = ARG_L2(cb)-1 j = lo(2)-1 do n = 1, nvar c ::::: define interp coefs do kc = kclo, kchi k = ratioz*kc do ic = iclo, ichi i = ratiox*ic derives(ic,kc,XDER) = half*(crse(ic+1,jc,kc,n) - crse(ic-1,jc,kc,n)) derives(ic,kc,X2DER) = half*(crse(ic+1,jc,kc,n) - two*crse(ic,jc,kc,n) & + crse(ic-1,jc,kc,n)) derives(ic,kc,YDER) = half*(crse(ic,jc,kc+1,n) - crse(ic,jc,kc-1,n)) derives(ic,kc,Y2DER) = half*(crse(ic,jc,kc+1,n) - two*crse(ic,jc,kc,n) & + crse(ic,jc,kc-1,n)) derives(ic,kc,XYDER) = forth*(crse(ic+1,jc,kc+1,n) - crse(ic-1,jc,kc+1,n) & + crse(ic-1,jc,kc-1,n) - crse(ic+1,jc,kc-1,n)) if (mask(i-1,j,k) .ne. not_covered) then derives(ic,kc,XDER) = crse(ic+1,jc,kc,n) - crse(ic,jc,kc,n) derives(ic,kc,X2DER) = zero end if if (mask(i+ratiox,j,k) .ne. not_covered) then derives(ic,kc,XDER) = crse(ic,jc,kc,n) - crse(ic-1,jc,kc,n) derives(ic,kc,X2DER) = zero end if if (mask(i-1,j,k) .ne. not_covered .and. $ mask(i+ratiox,j,k) .ne. not_covered) then derives(ic,kc,XDER) = zero end if if (mask(i,j,k-1) .ne. not_covered) then derives(ic,kc,YDER) = crse(ic,jc,kc+1,n) - crse(ic,jc,kc,n) derives(ic,kc,Y2DER) = zero end if if (mask(i,j,k+ratioz) .ne. not_covered) then derives(ic,kc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc,kc-1,n) derives(ic,kc,Y2DER) = zero end if if (mask(i,j,k-1) .ne. not_covered .and. $ mask(i,j,k+ratioz) .ne. not_covered) then derives(ic,kc,YDER) = zero end if if ( $ ( mask(i+ratiox,j,k+ratioz) .ne. not_covered ) .or. $ ( mask(i-1,j,k+ratioz) .ne. not_covered ) .or. $ ( mask(i+ratiox,j,k-1) .ne. not_covered ) .or. $ ( mask(i-1,j,k-1) .ne. not_covered ) ) then derives(ic,kc,XYDER) = zero end if end do end do c ::::: interpolate to fine grid do koff = 0, ratioz - 1 yy = (dble(koff - ratioz/2) + half)/ratioz do kc = kclo,kchi k = ratioz*kc + koff do ioff = 0, ratiox - 1 xx = (dble(ioff - ratiox/2) + half)/ratiox do ic = iclo, ichi i = ratiox*ic + ioff bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(ic,kc,XDER) & + derives(ic,kc,X2DER)*xx**2 + yy*derives(ic,kc,YDER) & + derives(ic,kc,Y2DER)*yy**2 + xx*yy*derives(ic,kc,XYDER) end do end do end do end do end do return end c --------------------------------------------------------------- c :: FORT_BDINTERPYHI : Interpolation on Yhi Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables to interpolate c :: ratios(3) => refinement ratios c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPYHI (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratios,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives) integer nvar, ratios(3), not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),nvar) REAL_T derives(DIM13(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx, yy, ainterp integer i, j, k, ic, jc, kc, ioff, koff, n integer iclo, ichi, kclo, kchi, ratiox, ratioz ratiox = ratios(1) ratioz = ratios(3) kclo = ARG_L3(cb) kchi = ARG_H3(cb) iclo = ARG_L1(cb) ichi = ARG_H1(cb) jc = ARG_H2(cb)+1 j = hi(2)+1 do n = 1, nvar c ::::: define interp coefs do kc = kclo, kchi k = ratioz*kc do ic = iclo, ichi i = ratiox*ic derives(ic,kc,XDER) = half*(crse(ic+1,jc,kc,n) - crse(ic-1,jc,kc,n)) derives(ic,kc,X2DER) = half*(crse(ic+1,jc,kc,n) - two*crse(ic,jc,kc,n) & + crse(ic-1,jc,kc,n)) derives(ic,kc,YDER) = half*(crse(ic,jc,kc+1,n) - crse(ic,jc,kc-1,n)) derives(ic,kc,Y2DER) = half*(crse(ic,jc,kc+1,n) - two*crse(ic,jc,kc,n) & + crse(ic,jc,kc-1,n)) derives(ic,kc,XYDER) = forth*(crse(ic+1,jc,kc+1,n) - crse(ic-1,jc,kc+1,n) & + crse(ic-1,jc,kc-1,n) - crse(ic+1,jc,kc-1,n)) if (mask(i-1,j,k) .ne. not_covered) then derives(ic,kc,XDER) = crse(ic+1,jc,kc,n) - crse(ic,jc,kc,n) derives(ic,kc,X2DER) = zero end if if (mask(i+ratiox,j,k) .ne. not_covered) then derives(ic,kc,XDER) = crse(ic,jc,kc,n) - crse(ic-1,jc,kc,n) derives(ic,kc,X2DER) = zero end if if (mask(i-1,j,k) .ne. not_covered .and. $ mask(i+ratiox,j,k) .ne. not_covered) then derives(ic,kc,XDER) = zero end if if (mask(i,j,k-1) .ne. not_covered) then derives(ic,kc,YDER) = crse(ic,jc,kc+1,n) - crse(ic,jc,kc,n) derives(ic,kc,Y2DER) = zero end if if (mask(i,j,k+ratioz) .ne. not_covered) then derives(ic,kc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc,kc-1,n) derives(ic,kc,Y2DER) = zero end if if (mask(i,j,k-1) .ne. not_covered .and. $ mask(i,j,k+ratioz) .ne. not_covered) then derives(ic,kc,YDER) = zero end if if ( $ ( mask(i+ratiox,j,k+ratioz) .ne. not_covered ) .or. $ ( mask(i-1,j,k+ratioz) .ne. not_covered ) .or. $ ( mask(i+ratiox,j,k-1) .ne. not_covered ) .or. $ ( mask(i-1,j,k-1) .ne. not_covered ) ) then derives(ic,kc,XYDER) = zero end if end do end do c ::::: interpolate to fine grid do koff = 0, ratioz - 1 yy = (dble(koff - ratioz/2) + half)/ratioz do kc = kclo,kchi k = ratioz*kc + koff do ioff = 0, ratiox - 1 xx = (dble(ioff - ratiox/2) + half)/ratiox do ic = iclo, ichi i = ratiox*ic + ioff bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(ic,kc,XDER) & + derives(ic,kc,X2DER)*xx**2 + yy*derives(ic,kc,YDER) & + derives(ic,kc,Y2DER)*yy**2 + xx*yy*derives(ic,kc,XYDER) end do end do end do end do end do return end c --------------------------------------------------------------- c :: FORT_BDINTERPZLO : Interpolation on Zlo Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables to interpolate c :: ratios(3) => refinement ratios c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPZLO (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratios,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives) integer nvar, ratios(3), not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),nvar) REAL_T derives(DIM12(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx, yy, ainterp integer i, j, k, ic, jc, kc, ioff, joff, n integer iclo, ichi, jclo, jchi, ratiox, ratioy ratiox = ratios(1) ratioy = ratios(2) jclo = ARG_L2(cb) jchi = ARG_H2(cb) iclo = ARG_L1(cb) ichi = ARG_H1(cb) kc = ARG_L3(cb)-1 k = lo(3)-1 do n = 1, nvar c ::::: define interp coefs do jc = jclo, jchi j = ratioy*jc do ic = iclo, ichi i = ratiox*ic derives(ic,jc,XDER) = half*(crse(ic+1,jc,kc,n) - crse(ic-1,jc,kc,n) ) derives(ic,jc,X2DER) = half*(crse(ic+1,jc,kc,n) - two*crse(ic,jc,kc,n) + crse(ic-1,jc,kc,n) ) derives(ic,jc,YDER) = half*(crse(ic,jc+1,kc,n) - crse(ic,jc-1,kc,n) ) derives(ic,jc,Y2DER) = half*(crse(ic,jc+1,kc,n) - two*crse(ic,jc,kc,n) + crse(ic,jc-1,kc,n) ) derives(ic,jc,XYDER) = forth*(crse(ic+1,jc+1,kc,n) - crse(ic-1,jc+1,kc,n) & + crse(ic-1,jc-1,kc,n) - crse(ic+1,jc-1,kc,n)) if (mask(i-1,j,k) .ne. not_covered) then derives(ic,jc,XDER) = crse(ic+1,jc,kc,n) - crse(ic,jc,kc,n) derives(ic,jc,X2DER) = zero end if if (mask(i+ratiox,j,k) .ne. not_covered) then derives(ic,jc,XDER) = crse(ic,jc,kc,n) - crse(ic-1,jc,kc,n) derives(ic,jc,X2DER) = zero end if if (mask(i-1,j,k) .ne. not_covered .and. $ mask(i+ratiox,j,k) .ne. not_covered) then derives(ic,jc,XDER) = zero end if if (mask(i,j-1,k) .ne. not_covered) then derives(ic,jc,YDER) = crse(ic,jc+1,kc,n) - crse(ic,jc,kc,n) derives(ic,jc,Y2DER) = zero end if if (mask(i,j+ratioy,k) .ne. not_covered) then derives(ic,jc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc-1,kc,n) derives(ic,jc,Y2DER) = zero end if if (mask(i,j-1,k) .ne. not_covered .and. $ mask(i,j+ratioy,k) .ne. not_covered) then derives(ic,jc,YDER) = zero end if if ( $ ( mask(i+ratiox,j+ratioy,k) .ne. not_covered ) .or. $ ( mask(i-1,j+ratioy,k) .ne. not_covered ) .or. $ ( mask(i+ratiox,j-1,k) .ne. not_covered ) .or. $ ( mask(i-1,j-1,k) .ne. not_covered ) ) then derives(ic,jc,XYDER) = zero end if end do end do c ::::: interpolate to fine grid do joff = 0, ratioy - 1 yy = (dble(joff - ratioy/2) + half)/ratioy do jc = jclo,jchi j = ratioy*jc + joff do ioff = 0, ratiox - 1 xx = (dble(ioff - ratiox/2) + half)/ratiox do ic = iclo, ichi i = ratiox*ic + ioff bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(ic,jc,XDER) & + derives(ic,jc,X2DER)*xx**2 + yy*derives(ic,jc,YDER) & + derives(ic,jc,Y2DER)*yy**2 + xx*yy*derives(ic,jc,XYDER) end do end do end do end do end do return end c --------------------------------------------------------------- c :: FORT_BDINTERPZHI : Interpolation on Zhi Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables to interpolate c :: ratios(3) => refinement ratios c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPZHI (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratios,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives) integer nvar, ratios(3), not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),nvar) REAL_T derives(DIM12(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx, yy, ainterp integer i, j, k, ic, jc, kc, ioff, joff, n integer iclo, ichi, jclo, jchi, ratiox, ratioy ratiox = ratios(1) ratioy = ratios(2) jclo = ARG_L2(cb) jchi = ARG_H2(cb) iclo = ARG_L1(cb) ichi = ARG_H1(cb) kc = ARG_H3(cb)+1 k = hi(3)+1 do n = 1, nvar c ::::: define interp coefs do jc = jclo, jchi j = ratioy*jc do ic = iclo, ichi i = ratiox*ic derives(ic,jc,XDER) = half*(crse(ic+1,jc,kc,n) - crse(ic-1,jc,kc,n)) derives(ic,jc,X2DER) = half*(crse(ic+1,jc,kc,n) - two*crse(ic,jc,kc,n) & + crse(ic-1,jc,kc,n)) derives(ic,jc,YDER) = half*(crse(ic,jc+1,kc,n) - crse(ic,jc-1,kc,n)) derives(ic,jc,Y2DER) = half*(crse(ic,jc+1,kc,n) - two*crse(ic,jc,kc,n) & + crse(ic,jc-1,kc,n)) derives(ic,jc,XYDER) = forth*(crse(ic+1,jc+1,kc,n) - crse(ic-1,jc+1,kc,n) & + crse(ic-1,jc-1,kc,n) - crse(ic+1,jc-1,kc,n)) if (mask(i-1,j,k) .ne. not_covered) then derives(ic,jc,XDER) = crse(ic+1,jc,kc,n) - crse(ic,jc,kc,n) derives(ic,jc,X2DER) = zero end if if (mask(i+ratiox,j,k) .ne. not_covered) then derives(ic,jc,XDER) = crse(ic,jc,kc,n) - crse(ic-1,jc,kc,n) derives(ic,jc,X2DER) = zero end if if (mask(i-1,j,k) .ne. not_covered .and. $ mask(i+ratiox,j,k) .ne. not_covered) then derives(ic,jc,XDER) = zero end if if (mask(i,j-1,k) .ne. not_covered) then derives(ic,jc,YDER) = crse(ic,jc+1,kc,n) - crse(ic,jc,kc,n) derives(ic,jc,Y2DER) = zero end if if (mask(i,j+ratioy,k) .ne. not_covered) then derives(ic,jc,YDER) = crse(ic,jc,kc,n) - crse(ic,jc-1,kc,n) derives(ic,jc,Y2DER) = zero end if if (mask(i,j-1,k) .ne. not_covered .and. $ mask(i,j+ratioy,k) .ne. not_covered) then derives(ic,jc,YDER) = zero end if if ( $ ( mask(i+ratiox,j+ratioy,k) .ne. not_covered ) .or. $ ( mask(i-1,j+ratioy,k) .ne. not_covered ) .or. $ ( mask(i+ratiox,j-1,k) .ne. not_covered ) .or. $ ( mask(i-1,j-1,k) .ne. not_covered ) ) then derives(ic,jc,XYDER) = zero end if end do end do c ::::: interpolate to fine grid do joff = 0, ratioy - 1 yy = (dble(joff - ratioy/2) + half)/ratioy do jc = jclo,jchi j = ratioy*jc + joff do ioff = 0, ratiox - 1 xx = (dble(ioff - ratiox/2) + half)/ratiox do ic = iclo, ichi i = ratiox*ic + ioff bdry(i,j,k,n) = crse(ic,jc,kc,n) + xx*derives(ic,jc,XDER) & + derives(ic,jc,X2DER)*xx**2 + yy*derives(ic,jc,YDER) & + derives(ic,jc,Y2DER)*yy**2 + xx*yy*derives(ic,jc,XYDER) end do end do end do end do end do return end #undef NUMDERIV #undef XDER #undef YDER #undef X2DER #undef Y2DER #undef XYDER ccseapps-2.5/CCSEApps/mglib/LP_3D.F0000644000175000017500000002125211634153073017723 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: LP_3D.F,v 1.4 2002/08/29 22:14:39 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include #include "LP_F.H" #include "ArrayLim.H" c----------------------------------------------------------------------- c c Gauss-Seidel Red-Black (GSRB): c Apply the GSRB relaxation to the state phi for the equation c L(phi) = Div(Grad(phi(x))) = rhs(x) central differenced, according c to the arrays of boundary masks (m#) and auxiliary data (f#). c c In general, if the linear operator L=gamma*y-rho, the GS relaxation c is y = (R - rho)/gamma. Near a boundary, the ghost data is filled c using a polynomial interpolant based on the "old" phi values, so c L=(gamma-delta)*y - rho + delta*yOld. The resulting iteration is c c y = (R - delta*yOld + rho)/(gamma - delta) c c This expression is valid additionally in the interior provided c delta->0 there. delta is constructed by summing all the c contributions to the central stencil element coming from boundary c interpolants. The f#s contain the corresponding coefficient of c the interpolating polynomial. The masks are set > 0 if the boundary c value was filled with an interpolant involving the central stencil c element. c c----------------------------------------------------------------------- subroutine FORT_GSRB ( $ phi, DIMS(phi), $ rhs, DIMS(rhs), $ f0, DIMS(f0), m0, DIMS(m0), $ f1, DIMS(f1), m1, DIMS(m1), $ f2, DIMS(f2), m2, DIMS(m2), $ f3, DIMS(f3), m3, DIMS(m3), $ f4, DIMS(f4), m4, DIMS(m4), $ f5, DIMS(f5), m5, DIMS(m5), $ lo, hi, nc, $ h, redblack $ ) integer nc integer DIMDEC(phi) REAL_T phi(DIMV(phi),nc) integer DIMDEC(rhs) REAL_T rhs(DIMV(rhs),nc) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) integer redblack integer DIMDEC(f0) integer DIMDEC(f1) integer DIMDEC(f2) integer DIMDEC(f3) integer DIMDEC(f4) integer DIMDEC(f5) REAL_T f0(DIMV(f0)) REAL_T f1(DIMV(f1)) REAL_T f2(DIMV(f2)) REAL_T f3(DIMV(f3)) REAL_T f4(DIMV(f4)) REAL_T f5(DIMV(f5)) integer DIMDEC(m0) integer DIMDEC(m1) integer DIMDEC(m2) integer DIMDEC(m3) integer DIMDEC(m4) integer DIMDEC(m5) integer m0(DIMV(m0)) integer m1(DIMV(m1)) integer m2(DIMV(m2)) integer m3(DIMV(m3)) integer m4(DIMV(m4)) integer m5(DIMV(m5)) REAL_T h c integer i, j, k, ioff, n c REAL_T cf0, cf1, cf2, cf3, cf4, cf5 REAL_T delta, gamma, rho c gamma = 6.0D0 do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) ioff = MOD(j + k + redblack,2) do i = lo(1) + ioff,hi(1),2 c cf0 = cvmgt(f0(lo(1),j,k), 0.0D0, $ (i .eq. lo(1)) .and. (m0(lo(1)-1,j,k).gt.0)) cf1 = cvmgt(f1(i,lo(2),k), 0.0D0, $ (j .eq. lo(2)) .and. (m1(i,lo(2)-1,k).gt.0)) cf2 = cvmgt(f2(i,j,lo(3)), 0.0D0, $ (k .eq. lo(3)) .and. (m2(i,j,lo(3)-1).gt.0)) cf3 = cvmgt(f3(hi(1),j,k), 0.0D0, $ (i .eq. hi(1)) .and. (m3(hi(1)+1,j,k).gt.0)) cf4 = cvmgt(f4(i,hi(2),k), 0.0D0, $ (j .eq. hi(2)) .and. (m4(i,hi(2)+1,k).gt.0)) cf5 = cvmgt(f5(i,j,hi(3)), 0.0D0, $ (k .eq. hi(3)) .and. (m5(i,j,hi(3)+1).gt.0)) c delta = cf0 + cf1 + cf2 + cf3 + cf4 + cf5 c rho = phi(i-1,j,k,n) + phi(i+1,j,k,n) $ + phi(i,j-1,k,n) + phi(i,j+1,k,n) $ + phi(i,j,k-1,n) + phi(i,j,k+1,n) c phi(i,j,k,n) $ = (rhs(i,j,k,n)*h*h - rho + phi(i,j,k,n)*delta) $ / (delta - gamma) c end do end do end do end do c end c----------------------------------------------------------------------- c c Solve Preconditioned system here c subroutine FORT_CGPRECND( $ zz, DIMS(zz), $ rho, $ rr, DIMS(rr), $ lo, hi, nc, $ h $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(zz) REAL_T zz(DIMV(zz),nc) integer DIMDEC(rr) REAL_T rr(DIMV(rr),nc) REAL_T h REAL_T rho c integer i integer j integer k integer n REAL_T denom c rho = 0.0D0 denom = -h**2*sixth do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) zz(i,j,k,n) = rr(i,j,k,n)*denom rho = rho + zz(i,j,k,n)*rr(i,j,k,n) end do end do end do end do c end c----------------------------------------------------------------------- c c Fill in a matrix x vector operator here c subroutine FORT_ADOTX( $ y, DIMS(y), $ x, DIMS(x), $ lo, hi, nc, $ h $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(y) REAL_T y(DIMV(y),nc) integer DIMDEC(x) REAL_T x(DIMV(x),nc) REAL_T h c integer i, j, k, n REAL_T scal c scal = 1.0D0/h**2 c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) y(i,j,k,n) = scal* $ ( x(i-1,j,k,n) + x(i+1,j,k,n) $ + x(i,j-1,k,n) + x(i,j+1,k,n) $ + x(i,j,k-1,n) + x(i,j,k+1,n) $ - 6*x(i,j,k,n) ) end do end do end do end do c end c----------------------------------------------------------------------- c c Fill in fluxes c subroutine FORT_FLUX( $ x,DIMS(x), $ lo,hi,nc, $ h, $ xflux,DIMS(xflux), $ yflux,DIMS(yflux), $ zflux,DIMS(zflux) $ ) implicit none integer lo(BL_SPACEDIM), hi(BL_SPACEDIM), nc integer DIMDEC(x) integer DIMDEC(xflux) integer DIMDEC(yflux) integer DIMDEC(zflux) REAL_T x(DIMV(x),nc) REAL_T xflux(DIMV(xflux),nc) REAL_T yflux(DIMV(yflux),nc) REAL_T zflux(DIMV(zflux),nc) REAL_T h(BL_SPACEDIM) c REAL_T dhx, dhy, dhz integer i,j,k,n c dhx = one/h(1) dhy = one/h(2) dhz = one/h(3) c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1)+1 xflux(i,j,k,n) = - dhx*( x(i,j,k,n) - x(i-1,j,k,n) ) end do end do end do end do do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2)+1 do i = lo(1), hi(1) yflux(i,j,k,n) = - dhy*( x(i,j,k,n) - x(i,j-1,k,n) ) end do end do end do end do do n = 1, nc do k = lo(3), hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) zflux(i,j,k,n) = - dhz*( x(i,j,k,n) - x(i,j,k-1,n) ) end do end do end do end do end ccseapps-2.5/CCSEApps/mglib/.cvsignore0000644000175000017500000000022511634153073020750 0ustar amckinstryamckinstry*.for Debug Debug3D Release Release3D lib hglib___ *.ncb *.opt *.plg grdlog ti_files chk[0-9][0-9][0-9][0-9] plt[0-9][0-9][0-9][0-9] *.pixie *.Addrs ccseapps-2.5/CCSEApps/mglib/Laplacian.cpp0000644000175000017500000001555111634153073021350 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Laplacian.cpp,v 1.13 2001/08/09 22:42:00 marc Exp $ // #include #include #include Real Laplacian::norm (int nm, int level) { switch ( nm ) { case 0: return 8.0/(h[level][0]*h[level][0]); } BoxLib::Error("Bad Laplacian::norm"); return -1.0; } void Laplacian::compFlux (D_DECL(MultiFab &xflux, MultiFab &yflux, MultiFab &zflux), MultiFab& in, const BC_Mode& bc_mode) { int level = 0; int src_comp = 0; int num_comp = 1; applyBC(in,src_comp,num_comp,level,bc_mode); const BoxArray& bxa = gbox[level]; int nc = in.nComp(); for (MFIter inmfi(in); inmfi.isValid(); ++inmfi) { BL_ASSERT(bxa[inmfi.index()] == inmfi.validbox()); FORT_FLUX(in[inmfi].dataPtr(), ARLIM(in[inmfi].loVect()), ARLIM(in[inmfi].hiVect()), inmfi.validbox().loVect(), inmfi.validbox().hiVect(), &nc, h[level], xflux[inmfi].dataPtr(), ARLIM(xflux[inmfi].loVect()), ARLIM(xflux[inmfi].hiVect()), yflux[inmfi].dataPtr(), ARLIM(yflux[inmfi].loVect()), ARLIM(yflux[inmfi].hiVect()) #if (BL_SPACEDIM == 3) ,zflux[inmfi].dataPtr(), ARLIM(zflux[inmfi].loVect()), ARLIM(zflux[inmfi].hiVect()) #endif ); } } void Laplacian::Fsmooth (MultiFab& solnL, const MultiFab& rhsL, int level, int redBlackFlag) { const BoxArray& bxa = gbox[level]; OrientationIter oitr; const FabSet& f0 = (*undrrelxr[level])[oitr()]; oitr++; const FabSet& f1 = (*undrrelxr[level])[oitr()]; oitr++; const FabSet& f2 = (*undrrelxr[level])[oitr()]; oitr++; const FabSet& f3 = (*undrrelxr[level])[oitr()]; oitr++; #if (BL_SPACEDIM > 2) const FabSet& f4 = (*undrrelxr[level])[oitr()]; oitr++; const FabSet& f5 = (*undrrelxr[level])[oitr()]; oitr++; #endif int nc = rhsL.nComp(); for (MFIter solnLmfi(solnL); solnLmfi.isValid(); ++solnLmfi) { oitr.rewind(); int gn = solnLmfi.index(); const Mask& m0 = *maskvals[level][gn][oitr()]; oitr++; const Mask& m1 = *maskvals[level][gn][oitr()]; oitr++; const Mask& m2 = *maskvals[level][gn][oitr()]; oitr++; const Mask& m3 = *maskvals[level][gn][oitr()]; oitr++; #if (BL_SPACEDIM > 2 ) const Mask& m4 = *maskvals[level][gn][oitr()]; oitr++; const Mask& m5 = *maskvals[level][gn][oitr()]; oitr++; #endif BL_ASSERT(bxa[solnLmfi.index()] == solnLmfi.validbox()); #if (BL_SPACEDIM == 2) FORT_GSRB( solnL[solnLmfi].dataPtr(), ARLIM(solnL[solnLmfi].loVect()),ARLIM(solnL[solnLmfi].hiVect()), rhsL[solnLmfi].dataPtr(), ARLIM(rhsL[solnLmfi].loVect()), ARLIM(rhsL[solnLmfi].hiVect()), f0[solnLmfi].dataPtr(), ARLIM(f0[solnLmfi].loVect()), ARLIM(f0[solnLmfi].hiVect()), m0.dataPtr(), ARLIM(m0.loVect()), ARLIM(m0.hiVect()), f1[solnLmfi].dataPtr(), ARLIM(f1[solnLmfi].loVect()), ARLIM(f1[solnLmfi].hiVect()), m1.dataPtr(), ARLIM(m1.loVect()), ARLIM(m1.hiVect()), f2[solnLmfi].dataPtr(), ARLIM(f2[solnLmfi].loVect()), ARLIM(f2[solnLmfi].hiVect()), m2.dataPtr(), ARLIM(m2.loVect()), ARLIM(m2.hiVect()), f3[solnLmfi].dataPtr(), ARLIM(f3[solnLmfi].loVect()), ARLIM(f3[solnLmfi].hiVect()), m3.dataPtr(), ARLIM(m3.loVect()), ARLIM(m3.hiVect()), solnLmfi.validbox().loVect(), solnLmfi.validbox().hiVect(), &nc, h[level], &redBlackFlag); #endif #if (BL_SPACEDIM == 3) FORT_GSRB( solnL[solnLmfi].dataPtr(), ARLIM(solnL[solnLmfi].loVect()),ARLIM(solnL[solnLmfi].hiVect()), rhsL[solnLmfi].dataPtr(), ARLIM(rhsL[solnLmfi].loVect()), ARLIM(rhsL[solnLmfi].hiVect()), f0[solnLmfi].dataPtr(), ARLIM(f0[solnLmfi].loVect()), ARLIM(f0[solnLmfi].hiVect()), m0.dataPtr(), ARLIM(m0.loVect()), ARLIM(m0.hiVect()), f1[solnLmfi].dataPtr(), ARLIM(f1[solnLmfi].loVect()), ARLIM(f1[solnLmfi].hiVect()), m1.dataPtr(), ARLIM(m1.loVect()), ARLIM(m1.hiVect()), f2[solnLmfi].dataPtr(), ARLIM(f2[solnLmfi].loVect()), ARLIM(f2[solnLmfi].hiVect()), m2.dataPtr(), ARLIM(m2.loVect()), ARLIM(m2.hiVect()), f3[solnLmfi].dataPtr(), ARLIM(f3[solnLmfi].loVect()), ARLIM(f3[solnLmfi].hiVect()), m3.dataPtr(), ARLIM(m3.loVect()), ARLIM(m3.hiVect()), f4[solnLmfi].dataPtr(), ARLIM(f4[solnLmfi].loVect()), ARLIM(f4[solnLmfi].hiVect()), m4.dataPtr(), ARLIM(m4.loVect()), ARLIM(m4.hiVect()), f5[solnLmfi].dataPtr(), ARLIM(f5[solnLmfi].loVect()), ARLIM(f5[solnLmfi].hiVect()), m5.dataPtr(), ARLIM(m5.loVect()), ARLIM(m5.hiVect()), solnLmfi.validbox().loVect(), solnLmfi.validbox().hiVect(), &nc, h[level], &redBlackFlag); #endif } } void Laplacian::Fapply (MultiFab& y, const MultiFab& x, int level) { int nc = y.nComp(); for (MFIter ymfi(y); ymfi.isValid(); ++ymfi) { FORT_ADOTX(y[ymfi].dataPtr(), ARLIM(y[ymfi].loVect()), ARLIM(y[ymfi].hiVect()), x[ymfi].dataPtr(), ARLIM(x[ymfi].loVect()), ARLIM(x[ymfi].hiVect()), ymfi.validbox().loVect(), ymfi.validbox().hiVect(), &nc, h[level]); } } ccseapps-2.5/CCSEApps/mglib/ABec_2D.F0000644000175000017500000003367411634153073020214 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: ABec_2D.F,v 1.9 2002/11/27 21:54:35 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include "ABec_F.H" #include "ArrayLim.H" #include "CONSTANTS.H" c----------------------------------------------------------------------- c c Gauss-Seidel Red-Black (GSRB): c Apply the GSRB relaxation to the state phi for the equation c L(phi) = alpha*a(x)*phi(x) - beta*Div(b(x)Grad(phi(x))) = rhs(x) c central differenced, according to the arrays of boundary c masks (m#) and auxiliary data (f#). c c In general, if the linear operator L=gamma*y-rho, the GS relaxation c is y = (R - rho)/gamma. Near a boundary, the ghost data is filled c using a polynomial interpolant based on the "old" phi values, so c L=(gamma-delta)*y - rho + delta*yOld. The resulting iteration is c c y = (R - delta*yOld + rho)/(gamma - delta) c c This expression is valid additionally in the interior provided c delta->0 there. delta is constructed by summing all the c contributions to the central stencil element coming from boundary c interpolants. The f#s contain the corresponding coefficient of c the interpolating polynomial. The masks are set > 0 if the boundary c value was filled with an interpolant involving the central stencil c element. c c----------------------------------------------------------------------- subroutine FORT_GSRB ( $ phi,DIMS(phi), $ rhs,DIMS(rhs), $ alpha, beta, $ a, DIMS(a), $ bX, DIMS(bX), $ bY, DIMS(bY), $ f0, DIMS(f0), $ m0, DIMS(m0), $ f1, DIMS(f1), $ m1, DIMS(m1), $ f2, DIMS(f2), $ m2, DIMS(m2), $ f3, DIMS(f3), $ m3, DIMS(m3), $ lo,hi,nc, $ h,redblack $ ) REAL_T alpha, beta integer DIMDEC(phi) integer DIMDEC(rhs) integer DIMDEC(a) integer DIMDEC(bX) integer DIMDEC(bY) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) integer nc integer redblack integer DIMDEC(f0) REAL_T f0(DIMV(f0)) integer DIMDEC(f1) REAL_T f1(DIMV(f1)) integer DIMDEC(f2) REAL_T f2(DIMV(f2)) integer DIMDEC(f3) REAL_T f3(DIMV(f3)) integer DIMDEC(m0) integer m0(DIMV(m0)) integer DIMDEC(m1) integer m1(DIMV(m1)) integer DIMDEC(m2) integer m2(DIMV(m2)) integer DIMDEC(m3) integer m3(DIMV(m3)) REAL_T h(BL_SPACEDIM) REAL_T phi(DIMV(phi),nc) REAL_T rhs(DIMV(rhs),nc) REAL_T a(DIMV(a)) REAL_T bX(DIMV(bX)) REAL_T bY(DIMV(bY)) c integer i, j, ioff, n c REAL_T dhx, dhy, cf0, cf1, cf2, cf3 REAL_T delta, gamma, rho, rho_x, rho_y integer LSDIM parameter(LSDIM=127) REAL_T a_ls(0:LSDIM) REAL_T b_ls(0:LSDIM) REAL_T c_ls(0:LSDIM) REAL_T r_ls(0:LSDIM) REAL_T u_ls(0:LSDIM) integer do_line integer ilen,jlen if (h(2). gt. 1.5D0*h(1)) then do_line = 1 ilen = hi(1)-lo(1)+1 if (ilen .gt. LSDIM) then print *,'TOO BIG FOR LINE SOLVE IN GSRB: ilen = ',ilen call bl_error("stop") end if else if (h(1) .gt. 1.5D0*h(2)) then do_line = 2 jlen = hi(2)-lo(2)+1 if (jlen .gt. LSDIM) then print *,'TOO BIG FOR LINE SOLVE IN GSRB: jlen = ',jlen call bl_error("stop") end if else do_line = 0 end if c dhx = beta/h(1)**2 dhy = beta/h(2)**2 do n = 1, nc if (do_line .eq. 0) then do j = lo(2), hi(2) ioff = MOD(j + redblack,2) do i = lo(1) + ioff,hi(1),2 c cf0 = cvmgt(f0(lo(1),j), 0.0D0, $ (i .eq. lo(1)) .and. (m0(lo(1)-1,j).gt.0)) cf1 = cvmgt(f1(i,lo(2)), 0.0D0, $ (j .eq. lo(2)) .and. (m1(i,lo(2)-1).gt.0)) cf2 = cvmgt(f2(hi(1),j), 0.0D0, $ (i .eq. hi(1)) .and. (m2(hi(1)+1,j).gt.0)) cf3 = cvmgt(f3(i,hi(2)), 0.0D0, $ (j .eq. hi(2)) .and. (m3(i,hi(2)+1).gt.0)) c delta = dhx*(bX(i,j)*cf0 + bX(i+1,j)*cf2) $ + dhy*(bY(i,j)*cf1 + bY(i,j+1)*cf3) c gamma = alpha*a(i,j) $ + dhx*( bX(i,j) + bX(i+1,j) ) $ + dhy*( bY(i,j) + bY(i,j+1) ) c rho = dhx*(bX(i,j)*phi(i-1,j,n) + bX(i+1,j)*phi(i+1,j,n)) $ +dhy*(bY(i,j)*phi(i,j-1,n) + bY(i,j+1)*phi(i,j+1,n)) c phi(i,j,n) = (rhs(i,j,n) + rho - phi(i,j,n)*delta) $ / (gamma - delta) c end do end do else if (do_line .eq. 2) then do i = lo(1) + redblack,hi(1),2 do j = lo(2), hi(2) c cf0 = cvmgt(f0(lo(1),j), 0.0D0, $ (i .eq. lo(1)) .and. (m0(lo(1)-1,j).gt.0)) cf1 = cvmgt(f1(i,lo(2)), 0.0D0, $ (j .eq. lo(2)) .and. (m1(i,lo(2)-1).gt.0)) cf2 = cvmgt(f2(hi(1),j), 0.0D0, $ (i .eq. hi(1)) .and. (m2(hi(1)+1,j).gt.0)) cf3 = cvmgt(f3(i,hi(2)), 0.0D0, $ (j .eq. hi(2)) .and. (m3(i,hi(2)+1).gt.0)) c delta = dhx*(bX(i,j)*cf0 + bX(i+1,j)*cf2) $ + dhy*(bY(i,j)*cf1 + bY(i,j+1)*cf3) c gamma = alpha*a(i,j) $ + dhx*( bX(i,j) + bX(i+1,j) ) $ + dhy*( bY(i,j) + bY(i,j+1) ) c rho_x = dhx*(bX(i,j)*phi(i-1,j,n) + bX(i+1,j)*phi(i+1,j,n)) a_ls(j-lo(2)) = -dhy*bY(i,j) b_ls(j-lo(2)) = gamma - delta c_ls(j-lo(2)) = -dhy*bY(i,j+1) r_ls(j-lo(2)) = rhs(i,j,n) + rho_x - phi(i,j,n)*delta if (j .eq. lo(2)) $ r_ls(j-lo(2)) = r_ls(j-lo(2)) + dhy*bY(i,j)*phi(i,j-1,n) if (j .eq. hi(2)) $ r_ls(j-lo(2)) = r_ls(j-lo(2)) + dhy*bY(i,j+1)*phi(i,j+1,n) end do call tridiag(a_ls,b_ls,c_ls,r_ls,u_ls,jlen) c do j = lo(2), hi(2) phi(i,j,n) = u_ls(j-lo(2)) end do end do else if (do_line .eq. 1) then do j = lo(2) + redblack,hi(2),2 do i = lo(1), hi(1) c cf0 = cvmgt(f0(lo(1),j), 0.0D0, $ (i .eq. lo(1)) .and. (m0(lo(1)-1,j).gt.0)) cf1 = cvmgt(f1(i,lo(2)), 0.0D0, $ (j .eq. lo(2)) .and. (m1(i,lo(2)-1).gt.0)) cf2 = cvmgt(f2(hi(1),j), 0.0D0, $ (i .eq. hi(1)) .and. (m2(hi(1)+1,j).gt.0)) cf3 = cvmgt(f3(i,hi(2)), 0.0D0, $ (j .eq. hi(2)) .and. (m3(i,hi(2)+1).gt.0)) c delta = dhx*(bX(i,j)*cf0 + bX(i+1,j)*cf2) $ + dhy*(bY(i,j)*cf1 + bY(i,j+1)*cf3) c gamma = alpha*a(i,j) $ + dhx*( bX(i,j) + bX(i+1,j) ) $ + dhy*( bY(i,j) + bY(i,j+1) ) c rho_y = dhy*(bY(i,j)*phi(i,j-1,n) + bY(i,j+1)*phi(i,j+1,n)) a_ls(i-lo(1)) = -dhx*bX(i,j) b_ls(i-lo(1)) = gamma - delta c_ls(i-lo(1)) = -dhx*bX(i+1,j) r_ls(i-lo(1)) = rhs(i,j,n) + rho_y - phi(i,j,n)*delta if (i .eq. lo(1)) $ r_ls(i-lo(1)) = r_ls(i-lo(1)) + dhx*bX(i,j)*phi(i-1,j,n) if (i .eq. hi(1)) $ r_ls(i-lo(1)) = r_ls(i-lo(1)) + dhx*bX(i+1,j)*phi(i+1,j,n) end do call tridiag(a_ls,b_ls,c_ls,r_ls,u_ls,ilen) c do i = lo(1), hi(1) phi(i,j,n) = u_ls(i-lo(1)) end do end do else print *,'BOGUS DO_LINE ' call bl_error("stop") end if end do end c----------------------------------------------------------------------- c c Solve Preconditioned system here c subroutine FORT_CGPRECND( $ zz,DIMS(zz), $ rho, $ rr,DIMS(rr), $ alpha, beta, $ a, DIMS(a), $ bX,DIMS(bX), $ bY,DIMS(bY), $ lo,hi,nc, $ h $ ) REAL_T alpha, beta integer lo(BL_SPACEDIM), hi(BL_SPACEDIM), nc integer DIMDEC(zz) integer DIMDEC(rr) integer DIMDEC(a) integer DIMDEC(bX) integer DIMDEC(bY) REAL_T zz(DIMV(zz),nc) REAL_T rr(DIMV(rr),nc) REAL_T a(DIMV(a)) REAL_T bX(DIMV(bX)) REAL_T bY(DIMV(bY)) REAL_T h(BL_SPACEDIM), rho c integer i,j, n REAL_T de, dhx, dhy c rho = 0 dhx = beta/h(1)**2 dhy = beta/h(2)**2 do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) de = 1.0D0/(alpha*a(i,j) + dhx*(bX(i+1,j)+bX(i,j)) $ + dhy*(bY(i,j+1)+bY(i,j)) $ ) zz(i,j,n) = rr(i,j,n)*de rho = rho + zz(i,j,n)*rr(i,j,n) end do end do end do c end c----------------------------------------------------------------------- c c Fill in a matrix x vector operator here c subroutine FORT_ADOTX( $ y,DIMS(y), $ x,DIMS(x), $ alpha, beta, $ a, DIMS(a), $ bX,DIMS(bX), $ bY,DIMS(bY), $ lo,hi,nc, $ h $ ) REAL_T alpha, beta integer lo(BL_SPACEDIM), hi(BL_SPACEDIM), nc integer DIMDEC(y) integer DIMDEC(x) integer DIMDEC(a) integer DIMDEC(bX) integer DIMDEC(bY) REAL_T y(DIMV(y),nc) REAL_T x(DIMV(x),nc) REAL_T a(DIMV(a)) REAL_T bX(DIMV(bX)) REAL_T bY(DIMV(bY)) REAL_T h(BL_SPACEDIM) c integer i,j,n REAL_T uxx,uyy,dhx,dhy c dhx = beta/h(1)**2 dhy = beta/h(2)**2 c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) y(i,j,n) = alpha*a(i,j)*x(i,j,n) $ - dhx* $ ( bX(i+1,j)*( x(i+1,j,n) - x(i ,j,n) ) $ - bX(i ,j)*( x(i ,j,n) - x(i-1,j,n) ) ) $ - dhy* $ ( bY(i,j+1)*( x(i,j+1,n) - x(i,j ,n) ) $ - bY(i,j )*( x(i,j ,n) - x(i,j-1,n) ) ) end do end do end do end c----------------------------------------------------------------------- c c Fill in a matrix x vector operator here c subroutine FORT_NORMA( & res, $ alpha, beta, $ a, DIMS(a), $ bX,DIMS(bX), $ bY,DIMS(bY), $ lo,hi,nc, $ h $ ) REAL_T res REAL_T alpha, beta integer lo(BL_SPACEDIM), hi(BL_SPACEDIM), nc integer DIMDEC(a) integer DIMDEC(bX) integer DIMDEC(bY) REAL_T a(DIMV(a)) REAL_T bX(DIMV(bX)) REAL_T bY(DIMV(bY)) REAL_T h(BL_SPACEDIM) c integer i,j,n REAL_T uxx,uyy,dhx,dhy c dhx = beta/h(1)**2 dhy = beta/h(2)**2 c res = 0.0D0 do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) res = max(res, & + abs( alpha*a(i,j) & + dhx * (bX(i+1,j) + bX(i,j)) & + dhy * (bY(i,j+1) + bY(i,j))) $ + abs(-dhx*bX(i+1,j)) + abs(-dhx*bX(i,j)) & + abs(-dhy*bY(i,j+1)) + abs(-dhy*bY(i,j))) end do end do end do end c----------------------------------------------------------------------- c c Fill in fluxes c subroutine FORT_FLUX( $ x,DIMS(x), $ alpha, beta, $ a, DIMS(a), $ bX,DIMS(bX), $ bY,DIMS(bY), $ lo,hi,nc, $ h, $ xflux,DIMS(xflux), $ yflux,DIMS(yflux) $ ) implicit none REAL_T alpha, beta integer lo(BL_SPACEDIM), hi(BL_SPACEDIM), nc integer DIMDEC(x) integer DIMDEC(a) integer DIMDEC(bX) integer DIMDEC(bY) integer DIMDEC(xflux) integer DIMDEC(yflux) REAL_T x(DIMV(x),nc) REAL_T a(DIMV(a)) REAL_T bX(DIMV(bX)) REAL_T bY(DIMV(bY)) REAL_T xflux(DIMV(xflux),nc) REAL_T yflux(DIMV(yflux),nc) REAL_T h(BL_SPACEDIM) c REAL_T dhx, dhy integer i,j,n c dhx = one/h(1) dhy = one/h(2) c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1)+1 xflux(i,j,n) = - dhx*bX(i,j)*( x(i,j,n) - x(i-1,j,n) ) end do end do end do do n = 1, nc do j = lo(2), hi(2)+1 do i = lo(1), hi(1) yflux(i,j,n) = - dhy*bY(i,j)*( x(i,j,n) - x(i,j-1,n) ) end do end do end do end ccseapps-2.5/CCSEApps/mglib/MG_3D.F0000644000175000017500000001005011634153073017705 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: MG_3D.F,v 1.2 1998/12/14 20:23:47 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include #include "MG_F.H" #include "ArrayLim.H" c----------------------------------------------------------------------- subroutine FORT_AVERAGE ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc $ ) integer nc integer DIMDEC(c) integer DIMDEC(f) integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) REAL_T f(DIMV(f),nc) REAL_T c(DIMV(c),nc) c integer i, i2, i2p1 integer j, j2, j2p1 integer k, k2, k2p1 integer n REAL_T denom parameter(denom=eighth) c do n = 1, nc do k = lo(3), hi(3) k2 = 2*k k2p1 = k2 + 1 do j = lo(2), hi(2) j2 = 2*j j2p1 = j2 + 1 cdir$ ivdep do i = lo(1), hi(1) i2 = 2*i i2p1 = i2 + 1 c c(i,j,k,n) = ( $ + f(i2p1,j2p1,k2 ,n) + f(i2,j2p1,k2 ,n) $ + f(i2p1,j2 ,k2 ,n) + f(i2,j2 ,k2 ,n) $ + f(i2p1,j2p1,k2p1,n) + f(i2,j2p1,k2p1,n) $ + f(i2p1,j2 ,k2p1,n) + f(i2,j2 ,k2p1,n) $ )*denom c end do end do end do end do c end c----------------------------------------------------------------------- subroutine FORT_INTERP ( $ f, DIMS(f), $ c, DIMS(c), $ lo, hi, nc $ ) integer nc integer DIMDEC(f) integer DIMDEC(c) integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) REAL_T f(DIMV(f),nc) REAL_T c(DIMV(c),nc) c integer i, i2, i2p1 integer j, j2, j2p1 integer k, k2, k2p1 integer n c do n = 1, nc do k = lo(3), hi(3) k2 = 2*k k2p1 = k2 + 1 do j = lo(2), hi(2) j2 = 2*j j2p1 = j2 + 1 cdir$ ivdep do i = lo(1), hi(1) i2 = 2*i i2p1 = i2 + 1 c f(i2p1,j2p1,k2 ,n) = c(i,j,k,n) + f(i2p1,j2p1,k2 ,n) f(i2 ,j2p1,k2 ,n) = c(i,j,k,n) + f(i2 ,j2p1,k2 ,n) f(i2p1,j2 ,k2 ,n) = c(i,j,k,n) + f(i2p1,j2 ,k2 ,n) f(i2 ,j2 ,k2 ,n) = c(i,j,k,n) + f(i2 ,j2 ,k2 ,n) f(i2p1,j2p1,k2p1,n) = c(i,j,k,n) + f(i2p1,j2p1,k2p1,n) f(i2 ,j2p1,k2p1,n) = c(i,j,k,n) + f(i2 ,j2p1,k2p1,n) f(i2p1,j2 ,k2p1,n) = c(i,j,k,n) + f(i2p1,j2 ,k2p1,n) f(i2 ,j2 ,k2p1,n) = c(i,j,k,n) + f(i2 ,j2 ,k2p1,n) c end do end do end do end do c end ccseapps-2.5/CCSEApps/mglib/ABecLaplacian.H0000644000175000017500000002363711634153073021474 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _ABecLAPLACIAN_H_ #define _ABecLAPLACIAN_H_ // // $Id: ABecLaplacian.H,v 1.11 2002/11/20 16:55:55 lijewski Exp $ // #include #include //@Man: /*@Memo: An ABecLaplacian tailors the description of a linear operator to apply the second-order central difference approximation to the differential operator, alpha*a(x).phi - beta*div[b(x).grad(phi)], on a cell-centered MultiFab, phi. Here, alpha and beta are constants, a(x) is a cell-centered MultiFab, and b(x) is a vector of wall-centered MultiFabs, 1 per dimension. phi can have multiple components, but all coefficient info is scalar, and norm reports on ALL components together. */ /*@Doc: An ABecLaplacian tailors a LinOp (a virtual base class for general linear operators) to compute the second-order central difference approximation to the differential operator, \begin{center} alpha*a(x).phi - beta*div[b(x).grad(phi)], \end{center} on a cell-centered MultiFab, phi. Here, alpha and beta are constants, a(x) is a cell-centered MultiFab, and b(x) is a vector of wall-centered MultiFabs, 1 per dimension. phi can have multiple components, but all coefficient info is scalar, and norm reports on ALL components together. This class provides the necessary implementations for applying the operator, and for smoothing a guessed solution to the linear equation system, L(phi) = rhs (where rhs is another cell-centered MultiFab). This class also provides access functions to set/control the coefficient MulitFabs a and b, as well as the scalars, alpha and beta. These customizations are designed for 2D and 3D, with constant (but not necessarily equal) mesh spacing in each direction. Application of the operator and smoothing are "level" operations, and therefore must access "hidden" level data (such as boundary conditions, etc) as required, in concert with the semantics of the underlying LinOp defintions. Accordingly, these implementations are "protected" and called only by the publically accessible members of the virtual base class, LinOp. Note that these implementations may therefore assume that boundary (ghost) nodes and other pertinent information are filled properly by the base class functions prior to call. Defaults are as follows for the coefficients: \begin{itemize} \item alpha = 1.0 \item beta = 1.0 \item a (MultiFab) = 0.0 \item b (MultiFab) = 1.0 \end{itemize} This class does NOT provide a copy constructor or assignment operator. */ class ABecLaplacian : public LinOp { public: // //@ManDoc: constructor for box array, boundary data and scalar mesh spacing // ABecLaplacian (const BndryData& bd, Real _h); // //@ManDoc: constructor for box array, boundary data and vector mesh spacing // ABecLaplacian (const BndryData& bd, const Real* _h); // //@ManDoc: destructor // virtual ~ABecLaplacian (); // //@ManDoc: Compute extensive (area-weighted) flux associated with the op // virtual void compFlux (D_DECL(MultiFab &xflux, MultiFab &yflux, MultiFab &zflux), MultiFab& in, const BC_Mode& bc_mode=Inhomogeneous_BC); void compFlux (D_DECL(MultiFab &xflux, MultiFab &yflux, MultiFab &zflux), MultiFab& in, const BC_Mode& bc_mode, bool do_ApplyBC); // //@ManDoc: Set scalar coefficients. // void setScalars (Real _alpha, Real _beta); // //@ManDoc: get scalar alpha coefficient // Real get_alpha () const; // //@ManDoc: get scalar beta coefficient // Real get_beta () const; // //@ManDoc: return reference to "a" coefficients for base level // const MultiFab& aCoefficients (int level = 0); // //@ManDoc: return reference to "b" coefficients for base level // const MultiFab& bCoefficients (int dir, int level=0); // //@ManDoc: copy \_a into "a" coeffs for base level // void aCoefficients (const MultiFab& _a); // //@ManDoc: copy \_b into "b" coeffs in "dir" coordinate direction for base level // void bCoefficients (const MultiFab& _b, int dir); // //@ManDoc: alternative (older) version of above members // void setCoefficients (const MultiFab& _a, const MultiFab& _bX, const MultiFab& _bY); // //@ManDoc: collective version of above members (taking an array of MultiFabs for "b") // void setCoefficients (const MultiFab& _a, const MultiFab* _b); // //@ManDoc: allocate/fill internal data for new level // virtual void prepareForLevel (int level); // //@ManDoc: remove internal data for this level and all levels above // virtual void clearToLevel (int level); // //@ManDoc: set flags so that a coeffs at lev and coarser require recalculation // void invalidate_a_to_level (int lev); // //@ManDoc: set flags so that b coeffs at lev and coarser require recalculation // void invalidate_b_to_level (int lev); virtual Real norm (int nm = 0, int level = 0); protected: // //@ManDoc: initialize a full set (a,b) of coefficients on the box array // void initCoefficients (const BoxArray &_ba); // //@ManDoc: compute out=L(in) at level=level // virtual void Fapply (MultiFab& out, const MultiFab& in, int level); // //@ManDoc: apply smoother to improve residual to L(solnL)=rhsL // virtual void Fsmooth (MultiFab& solnL, const MultiFab& rhsL, int level, int rgbflag); // //@ManDoc: Array (on level) of "a" coefficients // Array< MultiFab* > acoefs; // //@ManDoc: Array (on level) of Tuple (on dimension) of "b" coefficients // Array< Tuple< MultiFab*, BL_SPACEDIM> > bcoefs; // //@ManDoc: Scalar "alpha" coefficient // Real alpha; // //@ManDoc: Scalar "beta" coefficient // Real beta; private: // // Flag, can a coeffs be trusted at a level. // std::vector a_valid; // // Flag, can b coeffs be trusted at a level. // std::vector b_valid; // // Default value for a (MultiFab) coefficient. // static Real a_def; // // Default value for b (MultiFab) coefficient. // static Real b_def; // // Default value for alpha (scalar) coefficient. // static Real alpha_def; // // Default value for beta (scalar) coefficient. // static Real beta_def; // // Disallow copy constructors (for now...to be fixed) // ABecLaplacian (const ABecLaplacian&); ABecLaplacian& operator= (const ABecLaplacian&); }; inline Real ABecLaplacian::get_alpha () const { return alpha; } inline Real ABecLaplacian::get_beta () const { return beta; } inline void ABecLaplacian::aCoefficients (const MultiFab& _a) { BL_ASSERT(_a.ok()); BL_ASSERT(_a.boxArray() == (acoefs[0])->boxArray()); invalidate_a_to_level(0); (*acoefs[0]).copy(_a,0,0,1); } inline void ABecLaplacian::bCoefficients (const MultiFab& _b, int dir) { BL_ASSERT(_b.ok()); BL_ASSERT(_b.boxArray() == (bcoefs[0][dir])->boxArray()); invalidate_b_to_level(0); (*bcoefs[0][dir]).copy(_b,0,0,1); } inline const MultiFab& ABecLaplacian::aCoefficients (int level) { prepareForLevel(level); return *acoefs[level]; } inline const MultiFab& ABecLaplacian::bCoefficients (int dir,int level) { prepareForLevel(level); return *bcoefs[level][dir]; } inline void ABecLaplacian::setCoefficients (const MultiFab &_a, const MultiFab &_bX, const MultiFab &_bY) { aCoefficients(_a); bCoefficients(_bX, 0); bCoefficients(_bY, 1); } inline void ABecLaplacian::setCoefficients (const MultiFab& _a, const MultiFab* _b) { aCoefficients(_a); for (int n = 0; n < BL_SPACEDIM; ++n) bCoefficients(_b[n], n); } inline void ABecLaplacian::setScalars (Real _alpha, Real _beta) { alpha = _alpha; beta = _beta; } #endif /*_ABecLAPLACIAN_H_*/ ccseapps-2.5/CCSEApps/mglib/LP_F.H0000644000175000017500000001353711634153073017653 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _LP_F_H_ #define _LP_F_H_ /* ** $Id: LP_F.H,v 1.7 2002/04/26 22:10:02 lijewski Exp $ */ #include #if defined(BL_LANG_FORT) #if (BL_SPACEDIM == 2) #define FORT_GSRB gsrb2dsim #define FORT_CGPRECND cgprecnd2dsim #define FORT_ADOTX adotx2dsim #define FORT_FLUX flux2dsim #endif #if (BL_SPACEDIM == 3) #define FORT_GSRB gsrb3dsim #define FORT_CGPRECND cgprecnd3dsim #define FORT_ADOTX adotx3dsim #define FORT_FLUX flux3dsim #endif #else #if (BL_SPACEDIM == 2) #if defined(BL_FORT_USE_UPPERCASE) #define FORT_GSRB GSRB2DSIM #define FORT_CGPRECND CGPRECND2DSIM #define FORT_ADOTX ADOTX2DSIM #define FORT_FLUX FLUX2DSIM #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_GSRB gsrb2dsim #define FORT_CGPRECND cgprecnd2dsim #define FORT_ADOTX adotx2dsim #define FORT_FLUX flux2dsim #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_GSRB gsrb2dsim_ #define FORT_CGPRECND cgprecnd2dsim_ #define FORT_ADOTX adotx2dsim_ #define FORT_FLUX flux2dsim_ #endif #endif #if (BL_SPACEDIM == 3) #if defined(BL_FORT_USE_UPPERCASE) #define FORT_GSRB GSRB3DSIM #define FORT_CGPRECND CGPRECND3DSIM #define FORT_ADOTX ADOTX3DSIM #define FORT_FLUX FLUX3DSIM #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_GSRB gsrb3dsim #define FORT_CGPRECND cgprecnd3dsim #define FORT_ADOTX adotx3dsim #define FORT_FLUX flux3dsim #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_GSRB gsrb3dsim_ #define FORT_CGPRECND cgprecnd3dsim_ #define FORT_ADOTX adotx3dsim_ #define FORT_FLUX flux3dsim_ #endif #endif #include extern "C" { #if (BL_SPACEDIM == 2) void FORT_GSRB ( Real* phi , ARLIM_P(phi_lo), ARLIM_P(phi_hi), const Real* rhs , ARLIM_P(rhs_lo), ARLIM_P(rhs_hi), const Real* den0, ARLIM_P(den0_lo), ARLIM_P(den0_hi), const int* m0 , ARLIM_P(m0_lo), ARLIM_P(m0_hi), const Real* den1, ARLIM_P(den1_lo), ARLIM_P(den1_hi), const int* m1 , ARLIM_P(m1_lo), ARLIM_P(m1_hi), const Real* den2, ARLIM_P(den2_lo), ARLIM_P(den2_hi), const int* m2 , ARLIM_P(m2_lo), ARLIM_P(m2_hi), const Real* den3, ARLIM_P(den3_lo), ARLIM_P(den3_hi), const int* m3 , ARLIM_P(m3_lo), ARLIM_P(m3_hi), const int* lo, const int* hi, const int *nc, const Real *h, const int* redblack ); void FORT_FLUX( const Real *x, ARLIM_P(x_lo), ARLIM_P(x_hi), const int *lo, const int *hi, const int *nc, const Real *h, Real* xflux, ARLIM_P(xflux_lo), ARLIM_P(xflux_hi), Real* yflux, ARLIM_P(yflux_lo), ARLIM_P(yflux_hi) ); #endif #if (BL_SPACEDIM == 3) void FORT_GSRB ( Real* phi , ARLIM_P(phi_lo), ARLIM_P(phi_hi), const Real* rhs , ARLIM_P(rhs_lo), ARLIM_P(rhs_hi), const Real* den0, ARLIM_P(den0_lo), ARLIM_P(den0_hi), const int* m0 , ARLIM_P(m0_lo), ARLIM_P(m0_hi), const Real* den1, ARLIM_P(den1_lo), ARLIM_P(den1_hi), const int* m1 , ARLIM_P(m1_lo), ARLIM_P(m1_hi), const Real* den2, ARLIM_P(den2_lo), ARLIM_P(den2_hi), const int* m2 , ARLIM_P(m2_lo), ARLIM_P(m2_hi), const Real* den3, ARLIM_P(den3_lo), ARLIM_P(den3_hi), const int* m3 , ARLIM_P(m3_lo), ARLIM_P(m3_hi), const Real* den4, ARLIM_P(den4), ARLIM_P(den4_hi), const int* m4 , ARLIM_P(m4), ARLIM_P(m4_hi), const Real* den5, ARLIM_P(den5), ARLIM_P(den5_hi), const int* m5 , ARLIM_P(m5), ARLIM_P(m5_hi), const int* lo, const int* hi, const int *nc, const Real *h, const int* redblack ); void FORT_FLUX( const Real *x, ARLIM_P(x_lo), ARLIM_P(x_hi), const int *lo, const int *hi, const int *nc, const Real *h, Real* xflux, ARLIM_P(xflux_lo), ARLIM_P(xflux_hi), Real* yflux, ARLIM_P(yflux_lo), ARLIM_P(yflux_hi), Real* zflux, ARLIM_P(zflux_lo), ARLIM_P(zflux_hi) ); #endif void FORT_CGPRECND( Real *tmpz, ARLIM_P(tmpz_lo), ARLIM_P(tmzr_hi), Real *rho, const Real *tmpr, ARLIM_P(tmpr_lo), ARLIM_P(tmpr_hi), const int *lo, const int *hi, const int *nc, const Real *h ); void FORT_ADOTX( Real *y, ARLIM_P(y_lo), ARLIM_P(y_hi), const Real *x, ARLIM_P(x_lo), ARLIM_P(x_hi), const int *lo, const int *hi, const int *nc, const Real *h ); void FORT_ESTANORM( Real* H, const int *lo, const int *hi, const int *nc, const Real *h ); } #endif #endif /*_LP_F_H_*/ ccseapps-2.5/CCSEApps/mglib/LO_UTIL.F0000644000175000017500000000761611634153073020241 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: LO_UTIL.F,v 1.3 2002/10/19 18:33:57 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #undef TESTING_POLYNOMINTERPCOEFFS #ifdef TESTING_POLYNOMINTERPCOEFFS #define NORDER 3 #define REAL_T real*8 #define zero 0.d0 #define one 1.d0 #else #include #include #endif c polyInterpCoeff: c c This routine returns the Lagrange interpolating coefficients for a c polynomial through N points, evaluated at xInt (see Numerical Recipes, c v2, p102, e.g.): c c (x-x2)(x-x3)...(x-xN) (x-x1)(x-x2)...(x-x(N-1)) c P(x) = ----------------------- y1 + ... + ------------------------ yN c (x1-x2)(x1-x3)...(x1-xN) (x1-x2)(x1-x3)...(x1-xN) c c P(xInt) = sum_(i=1)^(N) y[i]*c[i] c subroutine polyInterpCoeff(xInt, x, N, c) implicit none integer N, i, j REAL_T xInt, x(N), c(N), num, den do j=1,N num = one den = one do i = 1,j-1 num = num*(xInt - x(i)) den = den*(x(j) - x(i)) end do do i = j+1,N num = num*(xInt - x(i)) den = den*(x(j) - x(i)) end do #ifndef NDEBUG if (den .eq. zero) STOP 'polyInterpCoeff::invalid data' #endif c(j) = num/den end do return end #ifdef TESTING_POLYNOMINTERPCOEFFS c c This is a test driver for the routine polyInterpCoeff. Sample data c is created from the statement function, and the location of the c boundary node and internal nodes are set, as apporpriate. The c number of points created is equal to the test NORDER set at the c top of this file through a define. The coefficients are computed, c and then the ghost cell value is constructed from the resulting c coefficients and written out. c program polyInterpCoeffTest integer i, j REAL_T c(NORDER), y(NORDER), yInt REAL_T x(NORDER), const, yfunc, xx, xInt c c Make data, locations yfunc(xx) = (2*xx-one)**(NORDER-1) + const const = -one x(1) = zero y(1) = yfunc(x(1)) do j=2,NORDER x(j) = j - 1.5D0*one y(j) = yfunc(x(j)) end do c c Set interpolation point to ghost cell location xInt = (x(2) - x(3))*0.5D0 c c Call routine call polyInterpCoeff(xInt,x,NORDER,c) c c Evaluate result yInt = zero do j=1,NORDER yInt = yInt + c(j)*y(j) end do c c Dump output write(6,*) 'x = ',x write(6,*) 'y = ',y write(6,*) 'c = ',c write(6,*) 'Interpolated y = ',yInt end #endif ccseapps-2.5/CCSEApps/mglib/BndryData.H0000644000175000017500000002162211634153073020735 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BNDRYDATA_H_ #define _BNDRYDATA_H_ // // $Id: BndryData.H,v 1.12 2001/08/01 21:51:03 lijewski Exp $ // #include #include #include #include #include #include #include #include //@Man: /*@Memo: A BndryData stores and manipulates boundary data information on each side of each box in a BoxArray. */ /*@Doc: A BndryData contains a BndryRegister about each side of each grid in a Boxarray. These data are used to store information along the outer layer of each grid (at the same level of coarseness), such as the value of boundary conditions there. Also, for each boundary, this class maintains a BoundCond identifier and a location. This "location" often specifies where, in physical space, a value, which is stored in the boundary registers, will be applied by a solver (although interpretation of this information is application-specific). In addition to boundary condition values, types and locations, and BndryDate object maintains a mask for each boundary value. Given a Geometry describing the physical "domain" of application, a BndryData object fills the mask arrays with a mask value to indicate if the node is outside the domain (outside_domain), or, if not, whether it lays within the valid region of an adjacent grid (covered), or not (not_covered). This mask data is created upon non-default class instantiation. */ class BndryData : private BndryRegister { public: // //@ManDoc: return the array of Boxes // BndryRegister::boxes; // //@ManDoc: return the number of Boxes // BndryRegister::size; // //@ManDoc: mask values enumeration // enum MaskVal { covered = 0, not_covered = 1, outside_domain = 2, NumMaskVals = 3 }; // //@ManDoc: default constructor // BndryData() : BndryRegister () {} /*@ManDoc: constructor specifying number of components and box of physical domain (cell-centered) */ BndryData (const BoxArray& grids, int ncomp, const Geometry& geom); // //@ManDoc: destructor // virtual ~BndryData (); // //@ManDoc: copy constructor // BndryData (const BndryData& src); // //@ManDoc: copy assignment operator // BndryData& operator= (const BndryData& src); // //@ManDoc: alocate bndry fabs along given face // void define (const BoxArray& grids, int ncomp, const Geometry& geom); // //@ManDoc: write to output stream // friend std::ostream& operator<< (std::ostream& os, const BndryData& bd); // //@ManDoc: return FabSet on given face // const FabSet& bndryValues (const Orientation& face) const; // //@ManDoc: return boundary location on given face // const Array& bndryLocs (const Orientation& face) const; // //@ManDoc: return boundary type specifyer on given face // const Array >& bndryConds (const Orientation& face) const; // //@ManDoc: return boundary mask on given face // const PArray& bndryMasks (const Orientation& face) const; // //@ManDoc: return number of components for which this object is inteded // int nComp () const; // //@ManDoc: return domain used to define masks // const Box& getDomain () const; // //@ManDoc: return geometry used to define masks // const Geometry& getGeom () const; // //@ManDoc: set values of boundary Fab for given orientation on nth grid // void setValue (const Orientation& face, int n, Real val); // //@ManDoc: set mask values for given orientation on nth grid // void setMaskValue (const Orientation& face, int n, int val); // //@ManDoc: set boundary type specifier for given orientation on nth grid // void setBoundCond (const Orientation& face, int n, int comp, const BoundCond& bcn); // //@ManDoc: set boundary location for given orientation on nth grid // void setBoundLoc (const Orientation& face, int n, Real val); // //@ManDoc: implement public access to const BndryRegister::operator[] // const FabSet& operator[] (const Orientation& face) const; // //@ManDoc: implement public access to BndryRegister::operator[] // FabSet& operator[] (const Orientation& face); // //@ManDoc: write the boundary data object to an ostream // void writeOn (std::ostream& os) const; // //@ManDoc: read the boundary data object from an istream // void readFrom (std::istream& is); protected: // // Helper function for copy constructor and assigment operator. // void init (const BndryData& src); // //@ManDoc: protect BndryRegister grids. // BndryRegister::grids; // //@ManDoc: protect BndryRegister FabSets. // BndryRegister::bndry; // // The data. // // Array (on orientation)(on grid)(on component) of boundary // condition type specifiers. // Array< Array > bcond[2*BL_SPACEDIM]; // // Array (on orientation) of boundary condition locations. // Array bcloc[2*BL_SPACEDIM]; // // Array (on orientation) of boundary condition mask arrays (FAB-like) // PArray masks[2*BL_SPACEDIM]; // // Domain used for mask defintions. // Geometry geom; private: // // Free memory taken by masks for this BndryData object. // void clear_masks (); static int NTangHalfWidth; }; inline const FabSet& BndryData::bndryValues (const Orientation& _face) const { return bndry[_face]; } inline const Array& BndryData::bndryLocs (const Orientation& _face) const { return bcloc[_face]; } inline const Array >& BndryData::bndryConds (const Orientation& _face) const { return bcond[_face]; } inline const PArray& BndryData::bndryMasks (const Orientation& _face) const { return masks[_face]; } inline int BndryData::nComp () const { return bcond[0][0].size(); } inline const Box& BndryData::getDomain () const { return geom.Domain(); } inline const Geometry& BndryData::getGeom () const { return geom; } inline void BndryData::setValue (const Orientation& _face, int _n, Real _val) { bndry[_face][_n].setVal(_val); } inline void BndryData::setMaskValue (const Orientation& _face, int _n, int _val) { masks[_face][_n].setVal(_val); } inline void BndryData::setBoundCond (const Orientation& _face, int _n, int _comp, const BoundCond& _bcn) { bcond[_face][_n][_comp] = _bcn; } inline void BndryData::setBoundLoc (const Orientation& _face, int _n, Real _val) { bcloc[_face][_n] = _val; } inline const FabSet& BndryData::operator[] (const Orientation& _face) const { return BndryRegister::bndry[_face]; } inline FabSet& BndryData::operator[] (const Orientation& _face) { return BndryRegister::bndry[_face]; } #endif /*_BNDRYDATA_H_*/ ccseapps-2.5/CCSEApps/mglib/CGSolver.H0000644000175000017500000002433511634153073020555 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _CGSOLVER_H_ #define _CGSOLVER_H_ // // $Id: CGSolver.H,v 1.10 2001/08/01 21:51:03 lijewski Exp $ // #include #include #include #include #include class MultiGrid; //@Man: /*@Memo: A CGSolver solves the linear equation, L(phi)=rhs, for a LinOp L and MultiFabs rhs and phi, using the conjugate gradient algorithm, either vanilla, or preconditioned via a single V-cycle of multigrid. */ /*@Doc: A CGSolver object solves the linear equation, L(phi)=rhs for a LinOp L, and MultiFabs phi and rhs. A CGSolver is constructed with a fully initialized 2D or 3D LinOp, and responds to "solve" requests of various signatures. The solve request (implicitly) includes a flag as to whether the system is to be solved with homogeneous boundary conditions or no. If homogeneous BCs are requested, all boundary information within the LinOp is used, except that the values of boundary FabSets are zeroed. The algorithm follows closely that described of p15 of the SIAM book, "Templates for the Solution of Linear Systems". Before solving a system, a small number of control parameters may be modified (maximum number of allowed iterations, reporting verbosity, etc). Also, either on construction or via member access functions, the user may choose to use a V-cycle 1-step MultiGrid preconditioner within the CG loop by setting the appropriate bool flag (see members/ctrs below). The MG preconditioner used is just an instantiation of a MultiGrid class object (the MultiGrid class is documented separately). Implementation Notes: \begin{itemize} \item This algorithm implements solution of equations in a way that requires linearity of the operator. In "residual correction form", equations are solved only for the "correction" to the initial guess that is required to solve the desired system. In particular, boundary conditions are assumed to be satisfied after a single application of the linear operator (therefore, the correction is homogeneous at the boundary). As a result, after putting the problem in residual correction form, the entire system CG system has homigeneous boundary conditions. This solver therefore cannot incorporate fully nonlinear systems. \item In general, a LinOp has the ability to apply high-order interpolation methods for computing boundary values. However, if the operator used in this CGSolver is non-symmetric, cg performance suffers tremendously. As a result, BC's should be applied with interpolants of order less than or equal to 2. We do not enforce this condition rigourosly, since it would interfere with the user's definition of the operator. If cg performance is bad however, setting the LinOp's maxorder=2 is a good place to start. \item CGSolver can fail to converge, or more likely diverge, if you run into a solvability problem (likely the accuracy cannot be achieved). CGSolver can be put into a different mode by using setExpert, where instead of bombing out, solve() returns an error code. 0 means good, 1 means loss-of-accuracy, 2 means iteration count exceeded. \end{itemize} Default settings: The user has access to the following options in the cg algorithm: \begin{itemize} \item maxiter(40) Maximum number of cg cycles allowed to solve the system before abandoning \item verbose(0) Verbosity (1-results, 2-progress, 3-detailed progress) \item use\_mg\_precond(false) Whether to use the V-cycle multigrid solver for the preconditioner system \item unstable\_criterion(10) if norm of residual grows by more than this factor, it is taken as signal that you've run into a solvability problem. \end{itemize} This class does NOT provide a copy constructor or assignment operator. */ class CGSolver { public: enum Solver { CG, BiCGStab, CG_Alt, Automatic}; // //@ManDoc: constructor // CGSolver (LinOp& _Lp, bool _use_mg_precond = false, int _lev = 0); // //@ManDoc: destructor // virtual ~CGSolver (); // //@ManDoc: solve the system, Lp(solnL)=rhsL to relative err, tolerance // RETURNS AN INT!!!! indicating success or failure. // 0 means success // 1 means failed for loss of precision // 2 means iterations exceeded // int solve (MultiFab& solnL, const MultiFab& rhsL, Real eps_rel = -1.0, Real eps_abs = -1.0, LinOp::BC_Mode bc_mode = LinOp::Inhomogeneous_BC, Solver cg_solver_ = Automatic); // //@ManDoc: set maximum allowed number of CG iterations // void setMaxIter (int _maxiter); // //@ManDoc: get maximum allowed number of CG iterations // int getMaxIter () const; // //@ManDoc: set expert mode void setExpert( bool flag ) { isExpert = flag; } // //@ManDoc: get expert flag bool getExpert() { return isExpert; } // //@ManDoc: set flag determining whether MG preconditioning is used // void setUseMGPrecond (bool _use_mg_precond); // //@ManDoc: get flag determining whether MG preconditioning is used // bool getUseMGPrecond () const; // //@ManDoc: set the verbosity value // void setVerbose (int _verbose); // //@ManDoc: return the verbosity value // int getVerbose (); void setCGSolver(Solver cg_solver_); Solver getCGSolver() const; protected: int solve_00 (MultiFab& solnL, const MultiFab& rhsL, Real eps_rel = -1.0, Real eps_abs = -1.0, LinOp::BC_Mode bc_mode = LinOp::Inhomogeneous_BC); int solve_cg (MultiFab& solnL, const MultiFab& rhsL, Real eps_rel = -1.0, Real eps_abs = -1.0, LinOp::BC_Mode bc_mode = LinOp::Inhomogeneous_BC); int solve_bicgstab (MultiFab& solnL, const MultiFab& rhsL, Real eps_rel = -1.0, Real eps_abs = -1.0, LinOp::BC_Mode bc_mode = LinOp::Inhomogeneous_BC); // //@ManDoc: construct work space, initialize parameters // static void initialize (); // //@ManDoc: if (use\_mg\_precond == 1) then define the MultiGrid * mg\_precond // virtual void set_mg_precond (); // //@ManDoc: compute p = z + beta p in the CG algorithm // void advance (MultiFab& p, Real beta, const MultiFab& z); // //@ManDoc: compute x =+ alpha p and r -= alpha w in the CG algorithm // void update (MultiFab& sol, Real alpha, MultiFab& r, const MultiFab& p, const MultiFab& w); // //@ManDoc: compute w = A.p, and return Transpose(p).w in the CG algorithm // Real axp (MultiFab& w, MultiFab& p, LinOp::BC_Mode bc_mode); // //@ManDoc: Initialized yet? // static int initialized; // //@ManDoc: Default maximum number of allowed iterations. // static int def_maxiter; // //@ManDoc: default unstable_criterion used to test for loss of accuracy in // static double def_unstable_criterion; // //@ManDoc: flag determining action when error conditions are hit // bool isExpert; // //@ManDoc: Default verbosity flag. // static int def_verbose; static Solver def_cg_solver; Solver cg_solver; // // The data. // LinOp& Lp; // Operator for linear system to be solved. MultiGrid* mg_precond; // MultiGrid solver to be used as preconditioner int maxiter; // Current maximum number of allowed iterations. int verbose; // Current verbosity level. int lev; // Level of the linear operator to use bool use_mg_precond; // Use multigrid as a preconditioner. private: // // Disable copy constructor and assignment operator. // CGSolver (const CGSolver&); CGSolver& operator= (const CGSolver&); }; inline void CGSolver::setMaxIter (int _maxiter) { maxiter = _maxiter; } inline int CGSolver::getMaxIter () const { return maxiter; } inline void CGSolver::setUseMGPrecond (bool _use_mg_precond) { use_mg_precond = _use_mg_precond; set_mg_precond(); } inline bool CGSolver::getUseMGPrecond () const { return use_mg_precond; } inline void CGSolver::setVerbose (int _verbose) { verbose = _verbose; } inline int CGSolver::getVerbose () { return verbose; } inline void CGSolver::setCGSolver(Solver cg_solver_) { cg_solver = cg_solver_; } inline CGSolver::Solver CGSolver::getCGSolver() const { return cg_solver; } #endif /*_CGSOLVER_H_*/ ccseapps-2.5/CCSEApps/mglib/CG_F.H0000644000175000017500000001022711634153073017622 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _CG_F_H_ #define _CG_F_H_ /* ** $Id: CG_F.H,v 1.4 2002/04/26 22:10:02 lijewski Exp $ */ #include #if defined(BL_LANG_FORT) #if (BL_SPACEDIM == 2) #define FORT_CGUPDATE cgupdate2dgen #define FORT_CGADVCP cgadvcp2dgen #define FORT_CGXDOTY cgxdoty2dgen #define FORT_CGSXAY cgsxay2dgen #endif #if (BL_SPACEDIM == 3) #define FORT_CGUPDATE cgupdate3dgen #define FORT_CGADVCP cgadvcp3dgen #define FORT_CGXDOTY cgxdoty3dgen #define FORT_CGSXAY cgsxay3dgen #endif #else #if defined(BL_FORT_USE_UPPERCASE) # if (BL_SPACEDIM == 2) # define FORT_CGUPDATE CGUPDATE2DGEN # define FORT_CGADVCP CGADVCP2DGEN # define FORT_CGXDOTY CGXDOTY2DGEN # define FORT_CGSXAY CGSXAY2DGEN # endif # if (BL_SPACEDIM == 3) # define FORT_CGUPDATE CGUPDATE3DGEN # define FORT_CGADVCP CGADVCP3DGEN # define FORT_CGXDOTY CGXDOTY3DGEN # define FORT_CGSXAY CGSXAY3DGEN # endif #elif defined(BL_FORT_USE_LOWERCASE) # if (BL_SPACEDIM == 2) # define FORT_CGUPDATE cgupdate2dgen # define FORT_CGADVCP cgadvcp2dgen # define FORT_CGXDOTY cgxdoty2dgen # define FORT_CGSXAY cgsxay2dgen # endif # if (BL_SPACEDIM == 3) # define FORT_CGUPDATE cgupdate3dgen # define FORT_CGADVCP cgadvcp3dgen # define FORT_CGXDOTY cgxdoty3dgen # define FORT_CGSXAY cgsxay3dgen # endif #elif defined(BL_FORT_USE_UNDERSCORE) # if (BL_SPACEDIM == 2) # define FORT_CGUPDATE cgupdate2dgen_ # define FORT_CGADVCP cgadvcp2dgen_ # define FORT_CGXDOTY cgxdoty2dgen_ # define FORT_CGSXAY cgsxay2dgen_ # endif # if (BL_SPACEDIM == 3) # define FORT_CGUPDATE cgupdate3dgen_ # define FORT_CGADVCP cgadvcp3dgen_ # define FORT_CGXDOTY cgxdoty3dgen_ # define FORT_CGSXAY cgsxay3dgen_ # endif #endif #include extern "C" { void FORT_CGUPDATE ( Real* phi, ARLIM_P(phi_lo), ARLIM_P(phi_hi), Real* tmpr, ARLIM_P(tmpr_lo), ARLIM_P(tmpr_hi), const Real *h, const Real* tmpw, ARLIM_P(tmpw_lo), ARLIM_P(tmpw_hi), const Real* tmpp, ARLIM_P(tmpp_lo), ARLIM_P(tmpp_hi), const int* lo, const int* hi, const int* nc ); void FORT_CGADVCP ( Real* tmpp, ARLIM_P(tmpp_lo), ARLIM_P(tmpp_hi), const Real* tmpr, ARLIM_P(tmpr_lo), ARLIM_P(tmpr_hi), const Real *b, const int* lo, const int* hi, const int* nc ); void FORT_CGXDOTY ( Real *pw, const Real* phi, ARLIM_P(phi_lo), ARLIM_P(phi_hi), const Real* tmpw, ARLIM_P(tmpw_lo), ARLIM_P(tmpw_hi), const int* lo, const int* hi, const int* nc ); void FORT_CGSXAY ( Real* s, ARLIM_P(s_lo), ARLIM_P(s_hi), const Real* x, ARLIM_P(x_lo), ARLIM_P(x_hi), const Real* a, const Real* y, ARLIM_P(y_lo), ARLIM_P(y_hi), const int* lo, const int* hi, const int* nc ); } #endif #endif /*_CG_F_H_*/ ccseapps-2.5/CCSEApps/mglib/lo_bctypes.fi0000644000175000017500000000062111634153073021433 0ustar amckinstryamckinstryc----------------------------------------------------------------------- c Should reflect the same contents as LO_BCTYPES.H c $Id: lo_bctypes.fi,v 1.1 2002/11/08 18:34:42 car Exp $ c integer LO_DIRICHLET integer LO_NEUMANN integer LO_REFLECT_ODD parameter ( & LO_DIRICHLET = 101, & LO_NEUMANN = 102, & LO_REFLECT_ODD = 103 & ) ccseapps-2.5/CCSEApps/mglib/LinOp.cpp0000644000175000017500000005347611634153073020515 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: LinOp.cpp,v 1.30 2002/11/26 22:47:22 lijewski Exp $ // #include #include #include #include #include #include #include #include #include bool LinOp::initialized = false; int LinOp::def_harmavg = 0; int LinOp::def_verbose = 0; int LinOp::def_maxorder = 2; #ifndef NDEBUG // // LinOp::applyBC fills LinOp_grow ghost cells with data expected in // LinOp::apply therefore, the incoming MultiFab to LinOp::applyBC better // have this many ghost allocated. // const int LinOp_grow = 1; #endif void LinOp::initialize () { ParmParse pp("Lp"); pp.query("harmavg", def_harmavg); pp.query("v", def_verbose); pp.query("maxorder", def_maxorder); if (ParallelDescriptor::IOProcessor() && def_verbose) { std::cout << "def_harmavg = " << def_harmavg << '\n'; std::cout << "def_maxorder = " << def_maxorder << '\n'; } initialized = true; } LinOp::LinOp (const BndryData& _bgb, const Real _h) : bgb(_bgb) { Real __h[BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; i++) { __h[i] = _h; } initConstruct(__h); } LinOp::LinOp (const BndryData& _bgb, const Real* _h) : bgb(_bgb) { initConstruct(_h); } LinOp::~LinOp () { for (int i = 0; i < maskvals.size(); ++i) { for (int j = 0; j < maskvals[i].size(); ++j) { for (int k = 0; k < maskvals[i][j].size(); ++k) { delete maskvals[i][j][k]; } } } } LinOp::LinOp (const LinOp& _lp, int level) : bgb(_lp.bgb) { harmavg = _lp.harmavg; verbose = _lp.verbose; gbox.resize(1); gbox[0] = _lp.boxArray(level); geomarray.resize(1); geomarray[0] = bgb.getGeom(); h.resize(1); BL_ASSERT(_lp.numLevels() > level); h[0] = _lp.h[level]; undrrelxr.resize(1); undrrelxr[0] = _lp.undrrelxr[level]; } void LinOp::initConstruct (const Real* _h) { if (!initialized) initialize(); harmavg = def_harmavg; verbose = def_verbose; gbox.resize(1); const int level = 0; gbox[level] = bgb.boxes(); geomarray.resize(1); geomarray[level] = bgb.getGeom(); h.resize(1); maxorder = def_maxorder; for (int i = 0; i < BL_SPACEDIM; i++) { h[level][i] = _h[i]; } undrrelxr.resize(1); undrrelxr[level] = new BndryRegister(gbox[level], 1, 0, 0, 1); maskvals.resize(1); maskvals[level].resize(gbox[level].size()); // // For each orientation, build NULL masks, then use distributed allocation. // for (int i = 0; i < gbox[level].size(); i++) { maskvals[level][i].resize(2*BL_SPACEDIM, 0); } for (OrientationIter oitr; oitr; ++oitr) { Orientation face = oitr(); const FabSet& bndry = bgb[face]; for (int i = 0; i < gbox[level].size(); i++) { if (bndry.DistributionMap()[i] == ParallelDescriptor::MyProc()) { const PArray& pam = bgb.bndryMasks(face); BL_ASSERT(maskvals[level][i][face] == 0); maskvals[level][i][face] = new Mask(pam[i].box(), 1); maskvals[level][i][face]->copy(pam[i]); } } } } void LinOp::apply (MultiFab& out, MultiFab& in, int level, LinOp::BC_Mode bc_mode) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "apply()"); applyBC(in,0,1,level,bc_mode); Fapply(out,in,level); } #ifdef BL_THREADS class task_applybc_orientation : public WorkQueue::task { public: task_applybc_orientation(const OrientationIter& oitr_, int level_, int flagden_, int flagbc_, int maxorder_, MultiFab& inout_, int src_comp_, int num_comp_, int cdr_, const Array< Array >& b_, const Array& r_, const FabSet& fs_, const Array< Array< Array< Mask*> > >& maskvals_, FabSet& f_, int nc_, const Real* h_); virtual void run(); private: const OrientationIter oitr; const int level; const int flagden; const int flagbc; const int maxorder; MultiFab& inout; const int src_comp; const int num_comp; const int cdr; const Array< Array >& b; const Array< Real>& r; const FabSet& fs; const Array< Array< Array< Mask*> > >& maskvals; FabSet& f; int nc; const Real* h; }; task_applybc_orientation::task_applybc_orientation(const OrientationIter& oitr_, int level_, int flagden_, int flagbc_, int maxorder_, MultiFab& inout_, int src_comp_, int num_comp_, int cdr_, const Array< Array >& b_, const Array& r_, const FabSet& fs_, const Array< Array< Array< Mask*> > >& maskvals_, FabSet& f_, int nc_, const Real* h_) : oitr(oitr_), level(level_), flagden(flagden_), flagbc(flagbc_), maxorder(maxorder_), inout(inout_), src_comp(src_comp_), num_comp(num_comp_), cdr(cdr_), b(b_), r(r_), fs(fs_), maskvals(maskvals_), f(f_), nc(nc_), h(h_) {} void task_applybc_orientation::run() { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::run()"); const int comp = 0; for (MFIter inoutmfi(inout); inoutmfi.isValid(); ++inoutmfi) { const int gn = inoutmfi.index(); const Mask& m = *maskvals[level][gn][oitr()]; Real bcl = r[gn]; int bct = b[gn][comp]; FORT_APPLYBC(&flagden, &flagbc, &maxorder, inout[inoutmfi].dataPtr(src_comp), ARLIM(inout[inoutmfi].loVect()), ARLIM(inout[inoutmfi].hiVect()), &cdr, &bct, &bcl, fs[inoutmfi].dataPtr(), ARLIM(fs[inoutmfi].loVect()), ARLIM(fs[inoutmfi].hiVect()), m.dataPtr(), ARLIM(m.loVect()), ARLIM(m.hiVect()), f[inoutmfi].dataPtr(), ARLIM(f[inoutmfi].loVect()), ARLIM(f[inoutmfi].hiVect()), inoutmfi.validbox().loVect(), inoutmfi.validbox().hiVect(), &nc, h); } } class task_applybc : public WorkQueue::task { public: task_applybc(int flagden_, int flagbc_, int maxorder_, FArrayBox& inout_, int srccomp_, int cdr_, int bct_, Real bcl_, const FArrayBox& fs_, const Mask& m_, FArrayBox& f_, const Box& vbox_, int nc_, const Real* h_); virtual void run(); private: const int flagden; const int flagbc; const int maxorder; FArrayBox& inout; int src_comp; const int cdr; const int bcl; Real bct; const FArrayBox& fs; const Mask& m; FArrayBox& f; const Box vbox; int nc; const Real* h; }; task_applybc::task_applybc(int flagden_, int flagbc_, int maxorder_, FArrayBox& inout_, int srccomp_, int cdr_, int bcl_, Real bct_, const FArrayBox& fs_, const Mask& m_, FArrayBox& f_, const Box& vbox_, int nc_, const Real* h_) : flagden(flagden_), flagbc(flagbc_), maxorder(maxorder_), inout(inout_), src_comp(srccomp_), cdr(cdr_), bcl(bcl_), bct(bct_), fs(fs_), m(m_), f(f_), vbox(vbox_), nc(nc_), h(h_) {} void task_applybc::run() { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::run()"); FORT_APPLYBC(&flagden, &flagbc, &maxorder, inout.dataPtr(src_comp), ARLIM(inout.loVect()), ARLIM(inout.hiVect()), &cdr, &bcl, &bct, fs.dataPtr(), ARLIM(fs.loVect()), ARLIM(fs.hiVect()), m.dataPtr(), ARLIM(m.loVect()), ARLIM(m.hiVect()), f.dataPtr(), ARLIM(f.loVect()), ARLIM(f.hiVect()), vbox.loVect(), vbox.hiVect(), &nc, h); } #endif void LinOp::applyBC (MultiFab& inout, int src_comp, int num_comp, int level, LinOp::BC_Mode bc_mode) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::applyBC()"); // // The inout MultiFab needs at least LinOp_grow ghost cells for applyBC. // BL_ASSERT(inout.nGrow() >= LinOp_grow); // // The inout MultiFab must have at least Periodic_BC_grow cells for the // algorithms taking care of periodic boundary conditions. // BL_ASSERT(inout.nGrow() >= LinOp_grow); // // No coarsened boundary values, cannot apply inhomog at lev>0. // BL_ASSERT(!(level > 0 && bc_mode == Inhomogeneous_BC)); int flagden = 1; // Fill in undrrelxr. int flagbc = 1; // Fill boundary data. if (bc_mode == LinOp::Homogeneous_BC) flagbc = 0; // No data if homog. // // Only single-component solves supported (verified) by this class. // BL_ASSERT(num_comp == 1); inout.FillBoundary(src_comp,num_comp); prepareForLevel(level); // // Do periodic fixup. // geomarray[level].FillPeriodicBoundary(inout,src_comp,num_comp); // // Fill boundary cells. // for (OrientationIter oitr; oitr; ++oitr) { const Array< Array >& b = bgb.bndryConds(oitr()); const Array& r = bgb.bndryLocs(oitr()); FabSet& f = (*undrrelxr[level])[oitr()]; int cdr = oitr(); const FabSet& fs = bgb.bndryValues(oitr()); #ifdef BL_THREADS #if 1 BoxLib::theWorkQueue().add(new task_applybc_orientation(oitr, level, flagden, flagbc, maxorder, inout, src_comp, num_comp, cdr, b, r, fs, maskvals, f, num_comp, h[level])); #else for (MFIter inoutmfi(inout); inoutmfi.isValid(); ++inoutmfi) { const int gn = inoutmfi.index(); BL_ASSERT(gbox[level][inoutmfi.index()] == inoutmfi.validbox()); const Mask& m = *maskvals[level][gn][oitr()]; Real bcl = r[gn]; int bct = b[gn][comp]; BoxLib::theWorkQueue().add(new task_applybc(flagden, flagbc, maxorder, inout[gn], src_comp, num_comp, cdr, bct, bcl, fs[gn], m, f[gn], inoutmfi.validbox(), num_comp, h[level])); } #endif #else const int comp = 0; for (MFIter inoutmfi(inout); inoutmfi.isValid(); ++inoutmfi) { const int gn = inoutmfi.index(); BL_ASSERT(gbox[level][inoutmfi.index()] == inoutmfi.validbox()); const Mask& m = *maskvals[level][gn][oitr()]; Real bcl = r[gn]; int bct = b[gn][comp]; FORT_APPLYBC(&flagden, &flagbc, &maxorder, inout[inoutmfi].dataPtr(src_comp), ARLIM(inout[inoutmfi].loVect()), ARLIM(inout[inoutmfi].hiVect()), &cdr, &bct, &bcl, fs[inoutmfi].dataPtr(), ARLIM(fs[inoutmfi].loVect()), ARLIM(fs[inoutmfi].hiVect()), m.dataPtr(), ARLIM(m.loVect()), ARLIM(m.hiVect()), f[inoutmfi].dataPtr(), ARLIM(f[inoutmfi].loVect()), ARLIM(f[inoutmfi].hiVect()), inoutmfi.validbox().loVect(), inoutmfi.validbox().hiVect(), &num_comp, h[level]); } #endif } BoxLib::theWorkQueue().wait(); } void LinOp::residual (MultiFab& residL, const MultiFab& rhsL, MultiFab& solnL, int level, LinOp::BC_Mode bc_mode) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "residual()"); apply(residL, solnL, level, bc_mode); for (MFIter solnLmfi(solnL); solnLmfi.isValid(); ++solnLmfi) { int nc = residL.nComp(); // // Only single-component solves supported (verified) by this class. // BL_ASSERT(nc == 1); BL_ASSERT(gbox[level][solnLmfi.index()] == solnLmfi.validbox()); FORT_RESIDL( residL[solnLmfi].dataPtr(), ARLIM(residL[solnLmfi].loVect()), ARLIM(residL[solnLmfi].hiVect()), rhsL[solnLmfi].dataPtr(), ARLIM(rhsL[solnLmfi].loVect()), ARLIM(rhsL[solnLmfi].hiVect()), residL[solnLmfi].dataPtr(), ARLIM(residL[solnLmfi].loVect()), ARLIM(residL[solnLmfi].hiVect()), solnLmfi.validbox().loVect(), solnLmfi.validbox().hiVect(), &nc); } } void LinOp::smooth (MultiFab& solnL, const MultiFab& rhsL, int level, LinOp::BC_Mode bc_mode) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::smooth()"); for (int redBlackFlag = 0; redBlackFlag < 2; redBlackFlag++) { applyBC(solnL, 0, 1, level, bc_mode); Fsmooth(solnL, rhsL, level, redBlackFlag); } } Real LinOp::norm (int nm, int level) { BoxLib::Error("Placeholder for pure virtual function"); return 0.0; } void LinOp::prepareForLevel (int level) { if (level == 0) return; LinOp::prepareForLevel(level-1); if (h.size() > level) return; // // Assume from here down that this is a new level one coarser than existing // BL_ASSERT(h.size() == level); h.resize(level+1); for (int i = 0; i < BL_SPACEDIM; ++i) { h[level][i] = h[level-1][i]*2.0; } geomarray.resize(level+1); geomarray[level].define(BoxLib::coarsen(geomarray[level-1].Domain(),2)); const Box& curdomain = geomarray[level].Domain(); // // Add a box to the new coarser level (assign removes old BoxArray). // gbox.resize(level+1); gbox[level] = gbox[level-1]; gbox[level].coarsen(2); // // Add the BndryRegister of relax values to the new coarser level. // BL_ASSERT(undrrelxr.size() == level); undrrelxr.resize(level+1); undrrelxr[level] = new BndryRegister(gbox[level], 1, 0, 0, 1); // // Add an Array of Array of maskvals to the new coarser level // For each orientation, build NULL masks, then use distributed allocation // Initial masks for coarse levels, ignore outside_domain possibility since // we always solve homogeneous equation on coarse levels. // BL_ASSERT(maskvals.size() == level); maskvals.resize(level+1); maskvals[level].resize(gbox[level].size()); for (int i = 0; i < gbox[level].size(); i++) { maskvals[level][i].resize(2*BL_SPACEDIM, (Mask*)0); } Array pshifts(27); for (OrientationIter oitr; oitr; ++oitr) { Orientation face = oitr(); // // Use bgb's distribution map for masks. // for (FabSetIter bndryfsi(bgb[face]); bndryfsi.isValid(); ++bndryfsi) { int gn = bndryfsi.index(); Box bx_k = BoxLib::adjCell(gbox[level][gn], face, 1); BL_ASSERT(maskvals[level][gn][face] == 0); maskvals[level][gn][face] = new Mask(bx_k, 1); Mask& curmask = *(maskvals[level][gn][face]); curmask.setVal(BndryData::not_covered); for (int gno = 0; gno < gbox[level].size(); ++gno) { Box btmp = gbox[level][gno] & bx_k; if (gno != gn && btmp.ok()) { curmask.setVal(BndryData::covered, btmp,0); } } // // Now take care of periodic wraparounds. // Geometry& curgeom = geomarray[level]; if (curgeom.isAnyPeriodic() && !curdomain.contains(bx_k)) { curgeom.periodicShift(curdomain, bx_k, pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { curmask.shift(pshifts[iiv]); for (int gno = 0; gno < gbox[level].size(); ++gno) { Box btmp = gbox[level][gno] & curmask.box(); curmask.setVal(BndryData::covered, btmp,0); } curmask.shift(-pshifts[iiv]); } } } } } void LinOp::makeCoefficients (MultiFab& cs, const MultiFab& fn, int level) { int nc = 1; // // Determine index type of incoming MultiFab. // const IndexType iType(fn.boxArray()[0].ixType()); const IndexType cType(D_DECL(IndexType::CELL, IndexType::CELL, IndexType::CELL)); const IndexType xType(D_DECL(IndexType::NODE, IndexType::CELL, IndexType::CELL)); const IndexType yType(D_DECL(IndexType::CELL, IndexType::NODE, IndexType::CELL)); #if (BL_SPACEDIM == 3) const IndexType zType(D_DECL(IndexType::CELL, IndexType::CELL, IndexType::NODE)); #endif int cdir; if (iType == cType) { cdir = -1; } else if (iType == xType) { cdir = 0; } else if (iType == yType) { cdir = 1; #if (BL_SPACEDIM == 3) } else if (iType == zType) { cdir = 2; #endif } else { BoxLib::Error("LinOp::makeCoeffients: Bad index type"); } BoxArray d(gbox[level]); if (cdir >= 0) d.surroundingNodes(cdir); // // Only single-component solves supported (verified) by this class. // const int nComp=1; const int nGrow=0; cs.define(d, nComp, nGrow, Fab_allocate); const BoxArray& grids = gbox[level]; MFIter csmfi(cs); switch (cdir) { case -1: for ( ; csmfi.isValid(); ++csmfi) { FORT_AVERAGECC(cs[csmfi].dataPtr(), ARLIM(cs[csmfi].loVect()), ARLIM(cs[csmfi].hiVect()),fn[csmfi].dataPtr(), ARLIM(fn[csmfi].loVect()),ARLIM(fn[csmfi].hiVect()), grids[csmfi.index()].loVect(), grids[csmfi.index()].hiVect(), &nc); } break; case 0: case 1: case 2: if (harmavg) { for ( ; csmfi.isValid(); ++csmfi) { FORT_HARMONIC_AVERAGEEC(cs[csmfi].dataPtr(), ARLIM(cs[csmfi].loVect()), ARLIM(cs[csmfi].hiVect()), fn[csmfi].dataPtr(), ARLIM(fn[csmfi].loVect()), ARLIM(fn[csmfi].hiVect()), grids[csmfi.index()].loVect(), grids[csmfi.index()].hiVect(), &nc,&cdir); } } else { for ( ; csmfi.isValid(); ++csmfi) { FORT_AVERAGEEC(cs[csmfi].dataPtr(),ARLIM(cs[csmfi].loVect()), ARLIM(cs[csmfi].hiVect()),fn[csmfi].dataPtr(), ARLIM(fn[csmfi].loVect()),ARLIM(fn[csmfi].hiVect()), grids[csmfi.index()].loVect(), grids[csmfi.index()].hiVect(),&nc, &cdir); } } break; default: BoxLib::Error("LinOp:: bad coefficient coarsening direction!"); } } std::ostream& operator<< (std::ostream& os, const LinOp& lp) { if (ParallelDescriptor::IOProcessor()) { os << "LinOp" << '\n'; os << "Grids: " << '\n'; for (int level = 0; level < lp.h.size(); ++level) { os << " level = " << level << ": " << lp.gbox[level] << '\n'; } os << "Grid Spacing: " << '\n'; for (int level = 0; level < lp.h.size(); ++level) { os << " level = " << level << ", dx = "; for (int d =0; d < BL_SPACEDIM; ++d) { os << lp.h[level][d] << " "; } os << '\n'; } os << "Harmonic average? " << (lp.harmavg == 1 ? "yes" : "no") << '\n'; os << "Verbosity: " << lp.verbose << '\n'; os << "Max Order: " << lp.maxorder << '\n'; } if (ParallelDescriptor::IOProcessor()) { os << "Masks:" << '\n'; } for (int level = 0; level < lp.h.size(); ++level) { if (ParallelDescriptor::IOProcessor()) os << "level = " << level << '\n'; for (int nproc = 0; nproc < ParallelDescriptor::NProcs(); ++nproc) { if (nproc == ParallelDescriptor::MyProc()) { os << "Processor " << nproc << '\n'; for (OrientationIter oitr; oitr; ++oitr) { Orientation face = oitr(); for (int i=0; i #include #include #include #include #include #include #include #include #include #include #include #include //#include static Real mfnorm_0_valid (const MultiFab& mf) { Real r = 0; for ( MFIter cmfi(mf); cmfi.isValid(); ++cmfi ) { Real s = mf[cmfi].norm(cmfi.validbox(), 0, 0, mf[cmfi].nComp()); r = (r > s) ? r : s; } ParallelDescriptor::ReduceRealMax(r); return r; } static Real mfnorm_2_valid (const MultiFab& mf) { Real r = 0; for ( MFIter cmfi(mf); cmfi.isValid(); ++cmfi ) { Real s = mf[cmfi].norm(cmfi.validbox(), 2, 0, mf[cmfi].nComp()); r += s*s; } ParallelDescriptor::ReduceRealSum(r); return ::sqrt(r); } BoxList readBoxList (std::string file, Box& domain); int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); std::cout << std::setprecision(15); ParmParse pp; std::cout << "maxthreads = " << BoxLib::theWorkQueue().max_threads() << std::endl; // Obtain prob domain and box-list, set H per phys domain [0:1]Xn Box container; #if (BL_SPACEDIM == 2) std::string boxfile("grids/gr.2_small_a") ; pp.query("boxes", boxfile); #elif (BL_SPACEDIM == 3) std::string boxfile("grids/gr.3_small_a") ; pp.query("boxes", boxfile); #endif BoxArray bs(readBoxList(boxfile,container)); Geometry geom( container ); Real H[BL_SPACEDIM]; for ( int n=0; nsetVal(1.0); } // Initialize boundary data, set boundary condition flags and locations: // (phys boundaries set to dirichlet on cell walls) BndryData bd(bs, 1, geom); int comp = 0; for ( int n=0; n b; b[0]=1.0; pp.query("b0", b[0]); b[1]=1.0; pp.query("b1", b[1]); #if (BL_SPACEDIM > 2) b[2]=1.0; pp.query("b2", b[2]); #endif MultiFab acoefs; acoefs.define(bs, Ncomp, Nghost, Fab_allocate); acoefs.setVal(a); MultiFab bcoefs[BL_SPACEDIM]; for ( int n=0; n> domain; int numbox = 0; boxspec >> numbox; for ( int i=0; i> tmpbox; if( ! domain.contains(tmpbox)) { std::cerr << "readBoxList: bogus box " << tmpbox << '\n'; exit(1); } retval.push_back(tmpbox); } boxspec.close(); return retval; } ccseapps-2.5/CCSEApps/mglib/Test/GNUmakefile0000644000175000017500000000416411634153073021747 0ustar amckinstryamckinstryPRECISION = DOUBLE PROFILE = FALSE PROFILE = TRUE DEBUG = FALSE DEBUG = TRUE DIM = 3 DIM = 2 COMP = KCC COMP = g++ USE_MPI=TRUE USE_MPI=FALSE USE_THREADS=FALSE USE_THREADS=TRUE STRICTLY=TRUE USE_ARRAYVIEW = TRUE USE_ARRAYVIEW = FALSE PBOXLIB_HOME := ../.. EBASE = main LBASE = include $(PBOXLIB_HOME)/mk/Make.defs # multigrid test sources CEXE_sources += $(EBASE).cpp include Make.package include $(PBOXLIB_HOME)/bndrylib/Make.package include $(PBOXLIB_HOME)/mglib/Make.package include $(PBOXLIB_HOME)/BoxLib/Make.package #include $(PBOXLIB_HOME)/util/Make.package INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/bndrylib vpathdir += $(PBOXLIB_HOME)/bndrylib INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/BoxLib vpathdir += $(PBOXLIB_HOME)/BoxLib INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/iamrlib vpathdir += $(PBOXLIB_HOME)/iamrlib INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/mglib vpathdir += $(PBOXLIB_HOME)/mglib #INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/util #vpathdir += $(PBOXLIB_HOME)/util # We need these from amrlib CEXE_sources += BCRec.cpp CEXE_headers += BCRec.H BC_Types.H INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/amrlib vpathdir += $(PBOXLIB_HOME)/amrlib # Needed from AmrVis CEXE_headers += AmrData.H INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/pAmrvis vpathdir += $(PBOXLIB_HOME)/pAmrvis ifeq ($(DEBUG),TRUE) ifeq ($(USE_ARRAYVIEW),TRUE) ARRAYVIEWDIR = $(PBOXLIB_HOME)/util INCLUDE_LOCATIONS += $(ARRAYVIEWDIR) CEXE_headers += DatasetClient.H ArrayView.H CEXE_sources += DatasetClient.cpp DEFINES += -DBL_USE_ARRAYVIEW #DEFINES += -DBL_ARRAYVIEW_TAGBOX endif CEXE_headers += TV_TempWrite.H endif ifeq ($(MACHINE),OSF1) 3RD=1 3RD= ifdef 3RD # FOR RUNNING 3RD ONLY LDFLAGS += --link_command_prefix 3rd #CXXDEBF = +K0 --link_command_prefix 3rd -non_shared LDFLAGS += -non_shared -v #LIBRARIES += -ldnet_stub #FDEBF += -automatic # FOR RUNNING 3RD ONLY endif DEFINES += -DBL3_NANOSLEEP LIBRARIES+=-lrt FFLAGS += -automatic endif CXXFLAGS += CXXOPTF += CXXDEBF += CFLAGS += COPTF += CDEBF += vpath %.cpp : . $(vpathdir) vpath %.F : . $(vpathdir) all: $(executable) include $(PBOXLIB_HOME)/mk/Make.rules ccseapps-2.5/CCSEApps/mglib/Test/amrvis.defaults0000644000175000017500000000045511634153073022726 0ustar amckinstryamckinstrypalette Palette initialderived blank initialscale 3 numberformat %7.5f numberformat %12.8f maxpixmapsize 1000000 reservesystemcolors 24 showboxes TRUE windowheight 550 windowwidth 800 fabordering alpha ccseapps-2.5/CCSEApps/mglib/Test/Palette0000644000175000017500000000140011634153073021204 0ustar amckinstryamckinstry #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúöñíéäàÛ×ÓÎÊÅÁ½¸´¯«§¢ž™•‘Œˆƒ #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ccseapps-2.5/CCSEApps/mglib/Test/macprojTest.cpp0000644000175000017500000002020611634153073022667 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: macprojTest.cpp,v 1.2 2001/08/21 22:15:37 car Exp $ // // In order to use this utility to mimic a mac projection solve from the // full AMR code, the lines of code below need to be added to the top // of mac_level_driver in MacOperator.cpp. This will dump the required // information. The data sent to cout needs to be set in the input and // grid files for this test utility. The boundary data and multifabs will // be read directly. // //cout << grids << endl; //cout << "use_cg_solve = " << use_cg_solve << endl; //cout << "level = " << level << endl; //cout << "Density = " << Density << endl; //cout << "dx = " << dx[0] << " " << dx[1] << " " << dx[2] << endl; //cout << "dt = " << dt << endl; //cout << "mac_tol = " << mac_tol << endl; //cout << "mac_abs_tol = " << mac_abs_tol << endl; //cout << "rhs_scale = " << rhs_scale << endl; //ofstream macOS; //macOS.open("mac_bndry_OS",ios::out|ios::binary); //mac_bndry.writeOn(macOS); //macOS.close(); // // // #include #include #include #include #include #include #include #include #include #include #include #include #include static Real mfnorm_0_valid (const MultiFab& mf) { Real r = 0; for ( ConstMultiFabIterator cmfi(mf); cmfi.isValid(); ++cmfi ) { Real s = cmfi->norm(cmfi.validbox(), 0, 0, cmfi->nComp()); r = (r > s) ? r : s; } ParallelDescriptor::ReduceRealMax(r); return r; } static Real mfnorm_2_valid (const MultiFab& mf) { Real r = 0; for ( ConstMultiFabIterator cmfi(mf); cmfi.isValid(); ++cmfi ) { Real s = cmfi->norm(cmfi.validbox(), 2, 0, cmfi->nComp()); r += s*s; } ParallelDescriptor::ReduceRealSum(r); return ::sqrt(r); } BoxList readBoxList(aString file, Box& domain); void mac_driver (const MacBndry& mac_bndry, const BoxArray& grids, int use_cg_solve, int Density, const Real* dx, Real dt, Real mac_tol, Real mac_abs_tol, Real rhs_scale, MultiFab* area, MultiFab& volume, MultiFab& S, MultiFab& Rhs, MultiFab* u_mac, MultiFab* mac_phi); int main (int argc, char* argv[]) { BoxLib::Initialize(argc, argv); // // Instantiate after we're running in Parallel. // // // Obtain prob domain and box-list, set dx // Box container; #if (BL_SPACEDIM == 2) aString boxfile("grids/gr.2_mac_tst"); #elif (BL_SPACEDIM == 3) aString boxfile("grids/gr.3_mac_tst"); #endif ParmParse pp; pp.query("boxes", boxfile); BoxArray bs(readBoxList(boxfile, container)); Geometry geom( container ); Real dx[BL_SPACEDIM]; for ( int n=0; n> domain; int numbox; boxspec >> numbox; for ( int i=0; i> tmpbox; if( ! domain.contains(tmpbox)) { cerr << "readBoxList: bogus box " << tmpbox << '\n'; exit(1); } retval.append(tmpbox); } boxspec.close(); return retval; } // // This routine is intended to mimic the mac_level_driver in MacOperator.cpp. // So, we can read in the appropriate MultiFabs and then pass them to this // routine // void mac_driver (const MacBndry& mac_bndry, const BoxArray& grids, int use_cg_solve, int Density, const Real* dx, Real dt, Real mac_tol, Real mac_abs_tol, Real rhs_scale, MultiFab* area, MultiFab& volume, MultiFab& S, MultiFab& Rhs, MultiFab* u_mac, MultiFab* mac_phi) { MacOperator mac_op(mac_bndry,dx); mac_op.setCoefficients(area,S,Density,dx); mac_op.defRHS(area,volume,Rhs,u_mac,rhs_scale); mac_op.maxOrder(2); if (use_cg_solve && mac_op.maxOrder() != 2) { BoxLib::Error("Can't use CGSolver with maxorder > 2"); } // // Construct MultiGrid or CGSolver object and solve system. // if (use_cg_solve) { bool use_mg_precond = true; CGSolver mac_cg(mac_op,use_mg_precond); mac_cg.solve(*mac_phi,Rhs,mac_tol,mac_abs_tol); } else { MultiGrid mac_mg(mac_op); mac_mg.solve(*mac_phi,Rhs,mac_tol,mac_abs_tol); } } ccseapps-2.5/CCSEApps/mglib/Test/.cvsignore0000644000175000017500000000002311634153073021663 0ustar amckinstryamckinstryti_files bl3_prof* ccseapps-2.5/CCSEApps/mglib/Test/vpramps.dat0000644000175000017500000000013611634153073022052 0ustar amckinstryamckinstry1 2 5 0 42 140 220 255 0.0 0.0 0.1 0.8 1.0 4 0 4 128 255 0.0 0.6 0.8 1.0 0.10 0.90 ccseapps-2.5/CCSEApps/mglib/Test/grids/0000755000175000017500000000000011634153073021000 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/mglib/Test/grids/in.3_stack_a0000644000175000017500000000017611634153073023163 0ustar amckinstryamckinstryboxes = grids/gr.3_stack_a geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 16.0 24.0 16.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_disjoint_e0000644000175000017500000000016511634153073023702 0ustar amckinstryamckinstryboxes = grids/gr.2_disjoint_e geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 16.0 12.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_3x20000644000175000017500000000022511634153073022166 0ustar amckinstryamckinstry((0,0)(31,47)(0,0)) 6 ((0,0)(15,15)(0,0)) ((16,0)(31,15)(0,0)) ((0,16)(15,31)(0,0)) ((16,16)(31,31)(0,0)) ((0,32)(15,47)(0,0)) ((16,32)(31,47)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_stack_a0000644000175000017500000000016211634153073023155 0ustar amckinstryamckinstryboxes = grids/gr.2_stack_a geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 16.0 48.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_3boxes_b0000644000175000017500000000012511634153073023255 0ustar amckinstryamckinstry((0,0)(63,63)(0,0)) 3 ((0,0)(31,63)(0,0)) ((32,0)(63,31)(0,0)) ((32,32)(63,63)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_small_a0000644000175000017500000000015611634153073023163 0ustar amckinstryamckinstryboxes = grids/gr.2_small_a geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 7.0 7.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_big0000644000175000017500000000015611634153073022314 0ustar amckinstryamckinstryboxes = grids/gr.2_big geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 64.0 64.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.3_shiftedUp0000644000175000017500000000020011634153073023475 0ustar amckinstryamckinstryboxes = grids/gr.3_shiftedUp geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 16.0 24.0 32.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_2x2_b0000644000175000017500000000007711634153073022473 0ustar amckinstryamckinstry((0,0)(63,63)(0,0)) 2 ((0,0)(31,63)(0,0)) ((32,0)(63,63)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.3_disjoint_c0000644000175000017500000000020711634153073023700 0ustar amckinstryamckinstry((0,0,0)(15,23,23)(0,0,0)) 4 ((0,0,0)(7,7,7)(0,0,0)) ((8,16,0)(15,23,7)(0,0,0)) ((0,0,16)(7,7,23)(0,0,0)) ((8,16,16)(15,23,23)(0,0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_2x2_c0000644000175000017500000000016011634153073022463 0ustar amckinstryamckinstryboxes = grids/gr.2_2x2_c geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 64.0 64.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_2x2_a0000644000175000017500000000016011634153073022461 0ustar amckinstryamckinstryboxes = grids/gr.2_2x2_a geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 32.0 64.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.3_shiftedUp0000644000175000017500000000012411634153073023504 0ustar amckinstryamckinstry((0,0,0)(15,23,31)(0,0,0)) 2 ((0,8,0)(15,23,15)(0,0,0)) ((0,0,16)(15,15,31)(0,0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_small_b0000644000175000017500000000016211634153073023161 0ustar amckinstryamckinstryboxes = grids/gr.2_small_b geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 8.0 16.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2per_2x2_c0000644000175000017500000000023011634153073023170 0ustar amckinstryamckinstryboxes = grids/gr.2_2x2_c geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 32.0 32.0 #-geometry.period_0 #-geometry.period_1 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_big0000644000175000017500000000005211634153073022311 0ustar amckinstryamckinstry((0,0)(63,63)(0,0)) 1 ((0,0)(63,63)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_small_a0000644000175000017500000000004611634153073023163 0ustar amckinstryamckinstry((0,0)(7,7)(0,0)) 1 ((0,0)(7,7)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_disjoint_b0000644000175000017500000000016511634153073023677 0ustar amckinstryamckinstryboxes = grids/gr.2_disjoint_b geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 32.0 32.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.3_disjoint_b0000644000175000017500000000011511634153073023675 0ustar amckinstryamckinstry((0,0,0)(7,7,23)(0,0,0)) 2 ((0,0,0)(7,7,7)(0,0,0)) ((0,0,16)(7,7,23)(0,0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_3boxes_c0000644000175000017500000000016311634153073023256 0ustar amckinstryamckinstryboxes = grids/gr.2_3boxes_c geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 64.0 64.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_stack_a0000644000175000017500000000007711634153073023164 0ustar amckinstryamckinstry((0,0)(15,47)(0,0)) 2 ((0,0)(15,31)(0,0)) ((0,32)(15,47)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.3_disjoint_b0000644000175000017500000000020111634153073023667 0ustar amckinstryamckinstryboxes = grids/gr.3_disjoint_b geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 8.0 8.0 24.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_2x2_c0000644000175000017500000000015211634153073022466 0ustar amckinstryamckinstry((0,0)(63,63)(0,0)) 4 ((0,0)(31,31)(0,0)) ((32,0)(63,31)(0,0)) ((0,32)(31,63)(0,0)) ((32,32)(63,63)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_3boxes_a0000644000175000017500000000016311634153073023254 0ustar amckinstryamckinstryboxes = grids/gr.2_3boxes_a geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 32.0 48.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_disjoint_d0000644000175000017500000000012011634153073023672 0ustar amckinstryamckinstry((0,0)(15,15)(0,0)) 3 ((0,0)(7,7)(0,0)) ((8,0)(15,7)(0,0)) ((0,12)(15,15)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_stack_d0000644000175000017500000000016211634153073023160 0ustar amckinstryamckinstryboxes = grids/gr.2_stack_d geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 16.0 64.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_disjoint_a0000644000175000017500000000007511634153073023700 0ustar amckinstryamckinstry((0,0)(31,15)(0,0)) 2 ((0,0)(7,15)(0,0)) ((14,0)(31,7)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_19boxes0000644000175000017500000000120511634153073023043 0ustar amckinstryamckinstry ((0,0)(511,255)(0,0)) 19 ((0,72)(135,119)(0,0)) ((288,80)(399,119)(0,0)) ((160,48)(215,71)(0,0)) ((0,136)(135,183)(0,0)) ((400,72)(511,119)(0,0)) ((152,72)(231,103)(0,0)) ((280,144)(351,167)(0,0)) ((496,128)(511,143)(0,0)) ((280,120)(383,143)(0,0)) ((152,104)(191,207)(0,0)) ((352,144)(511,183)(0,0)) ((456,120)(487,143)(0,0)) ((384,120)(391,127)(0,0)) ((192,152)(231,175)(0,0)) ((400,128)(431,143)(0,0)) ((384,136)(399,143)(0,0)) ((192,176)(207,207)(0,0)) ((432,136)(455,143)(0,0)) ((208,176)(231,191)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_disjoint_c0000644000175000017500000000007411634153073023701 0ustar amckinstryamckinstry((0,0)(15,15)(0,0)) 2 ((0,0)(7,7)(0,0)) ((8,8)(15,15)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.3_disjoint_c0000644000175000017500000000020111634153073023670 0ustar amckinstryamckinstryboxes = grids/gr.3_disjoint_c geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 16.0 24.0 24.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.3_disjoint_a0000644000175000017500000000020111634153073023666 0ustar amckinstryamckinstryboxes = grids/gr.3_disjoint_a geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 16.0 16.0 32.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.3_2boxes_a0000644000175000017500000000017711634153073023261 0ustar amckinstryamckinstryboxes = grids/gr.3_2boxes_a geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 8.0 8.0 16.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.3_small_a0000644000175000017500000000006211634153073023162 0ustar amckinstryamckinstry((0,0,0)(7,7,7)(0,0,0)) 1 ((0,0,0)(7,7,7)(0,0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.3per_2x3x40000644000175000017500000000026511634153073023154 0ustar amckinstryamckinstryboxes = grids/gr.3_2x3x4 geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 16.0 24.0 32.0 -geometry.period_0 -geometry.period_1 -geometry.period_2 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_disjoint_c0000644000175000017500000000016511634153073023700 0ustar amckinstryamckinstryboxes = grids/gr.2_disjoint_c geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 16.0 16.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.3_2x3x40000644000175000017500000000017411634153073022444 0ustar amckinstryamckinstryboxes = grids/gr.3_2x3x4 geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 16.0 24.0 32.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.3_big0000644000175000017500000000017211634153073022313 0ustar amckinstryamckinstryboxes = grids/gr.3_big geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 64.0 64.0 64.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.3_mac_tst0000644000175000017500000000222511634153073023207 0ustar amckinstryamckinstry(( 0, 0, 0) ( 7,39, 7) (0,0,0)) 40 ((0,0,0) (3,3,3) (0,0,0)) ((4,0,0) (7,3,3) (0,0,0)) ((0,36,0) (3,39,3) (0,0,0)) ((0,32,0) (3,35,3) (0,0,0)) ((0,28,0) (3,31,3) (0,0,0)) ((0,24,0) (3,27,3) (0,0,0)) ((0,20,0) (3,23,3) (0,0,0)) ((0,16,0) (3,19,3) (0,0,0)) ((0,12,0) (3,15,3) (0,0,0)) ((0,8,0) (3,11,3) (0,0,0)) ((0,4,0) (3,7,3) (0,0,0)) ((0,0,4) (3,3,7) (0,0,0)) ((4,36,0) (7,39,3) (0,0,0)) ((4,32,0) (7,35,3) (0,0,0)) ((4,28,0) (7,31,3) (0,0,0)) ((4,24,0) (7,27,3) (0,0,0)) ((4,20,0) (7,23,3) (0,0,0)) ((4,16,0) (7,19,3) (0,0,0)) ((4,12,0) (7,15,3) (0,0,0)) ((4,8,0) (7,11,3) (0,0,0)) ((4,4,0) (7,7,3) (0,0,0)) ((4,0,4) (7,3,7) (0,0,0)) ((0,36,4) (3,39,7) (0,0,0)) ((0,32,4) (3,35,7) (0,0,0)) ((0,28,4) (3,31,7) (0,0,0)) ((0,24,4) (3,27,7) (0,0,0)) ((0,20,4) (3,23,7) (0,0,0)) ((0,16,4) (3,19,7) (0,0,0)) ((0,12,4) (3,15,7) (0,0,0)) ((0,8,4) (3,11,7) (0,0,0)) ((0,4,4) (3,7,7) (0,0,0)) ((4,36,4) (7,39,7) (0,0,0)) ((4,32,4) (7,35,7) (0,0,0)) ((4,28,4) (7,31,7) (0,0,0)) ((4,24,4) (7,27,7) (0,0,0)) ((4,20,4) (7,23,7) (0,0,0)) ((4,16,4) (7,19,7) (0,0,0)) ((4,12,4) (7,15,7) (0,0,0)) ((4,8,4) (7,11,7) (0,0,0)) ((4,4,4) (7,7,7) (0,0,0)) 1 (( 0, 0, 0) ( 7,39, 7) (0,0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_stack_b0000644000175000017500000000007711634153073023165 0ustar amckinstryamckinstry((0,0)(47,31)(0,0)) 2 ((0,0)(31,31)(0,0)) ((32,0)(47,31)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_3boxes_c0000644000175000017500000000012511634153073023256 0ustar amckinstryamckinstry((0,0)(63,63)(0,0)) 3 ((0,0)(15,63)(0,0)) ((16,0)(63,31)(0,0)) ((16,32)(63,63)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_disjoint_a0000644000175000017500000000016511634153073023676 0ustar amckinstryamckinstryboxes = grids/gr.2_disjoint_a geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 32.0 16.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_19boxes0000644000175000017500000000016611634153073023046 0ustar amckinstryamckinstryboxes = grids/gr.2_19boxes geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 512.0 256.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_disjoint_b0000644000175000017500000000007611634153073023702 0ustar amckinstryamckinstry((0,0)(31,31)(0,0)) 2 ((0,0)(7,7)(0,0)) ((24,24)(31,31)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.3_mac_tst0000644000175000017500000000101011634153073023174 0ustar amckinstryamckinstryboxes = grids/gr.3_mac_tst geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 0.16 0.8 .16 use_cg_solve = 0 Density = 3 dt = 0.0001543470841 mac_tol = 1e-12 mac_abs_tol = 1e-14 rhs_scale = 12957.80877 dump_norm = true mg.numLevelsMAX=1 mg.v = 4 mg.usecg = 1 mg.nu_0 = 1 mg.nu_1 = 4 mg.nu_2 = 4 mg.nu_f = 40 mg.maxiter = 100 cg.maxiter = 40 # default 40 cg.unstable_criterion = 10. # default 10. cg.v = 4 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_2x2_a0000644000175000017500000000015211634153073022464 0ustar amckinstryamckinstry((0,0)(31,63)(0,0)) 4 ((0,0)(15,31)(0,0)) ((16,0)(31,31)(0,0)) ((0,32)(15,63)(0,0)) ((16,32)(31,63)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_stack_d0000644000175000017500000000007711634153073023167 0ustar amckinstryamckinstry((0,0)(15,63)(0,0)) 2 ((0,0)(15,31)(0,0)) ((0,32)(15,63)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_stack_b0000644000175000017500000000016211634153073023156 0ustar amckinstryamckinstryboxes = grids/gr.2_stack_b geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 48.0 32.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_3boxes_a0000644000175000017500000000012411634153073023253 0ustar amckinstryamckinstry((0,0)(31,47)(0,0)) 3 ((0,0)(15,31)(0,0)) ((16,0)(31,31)(0,0)) ((0,32)(31,47)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_disjoint_e0000644000175000017500000000007411634153073023703 0ustar amckinstryamckinstry((0,0)(15,11)(0,0)) 2 ((0,0)(7,7)(0,0)) ((8,4)(15,11)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_2x2_b0000644000175000017500000000016011634153073022462 0ustar amckinstryamckinstryboxes = grids/gr.2_2x2_b geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 64.0 64.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.3_disjoint_a0000644000175000017500000000012411634153073023674 0ustar amckinstryamckinstry((0,0,0)(15,15,31)(0,0,0)) 2 ((0,0,0)(15,15,15)(0,0,0)) ((8,8,24)(15,15,31)(0,0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.3_2boxes_a0000644000175000017500000000011411634153073023252 0ustar amckinstryamckinstry((0,0,0)(7,7,15)(0,0,0)) 2 ((0,0,0)(7,7,7)(0,0,0)) ((0,0,8)(7,7,15)(0,0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.3_2x3x40000644000175000017500000000124111634153073022442 0ustar amckinstryamckinstry((0,0,0)(15,23,31)(0,0,0)) 24 ((0,0,0)(7,7,7)(0,0,0)) ((8,0,0)(15,7,7)(0,0,0)) ((0,8,0)(7,15,7)(0,0,0)) ((8,8,0)(15,15,7)(0,0,0)) ((0,16,0)(7,23,7)(0,0,0)) ((8,16,0)(15,23,7)(0,0,0)) ((0,0,8)(7,7,15)(0,0,0)) ((8,0,8)(15,7,15)(0,0,0)) ((0,8,8)(7,15,15)(0,0,0)) ((8,8,8)(15,15,15)(0,0,0)) ((0,16,8)(7,23,15)(0,0,0)) ((8,16,8)(15,23,15)(0,0,0)) ((0,0,16)(7,7,23)(0,0,0)) ((8,0,16)(15,7,23)(0,0,0)) ((0,8,16)(7,15,23)(0,0,0)) ((8,8,16)(15,15,23)(0,0,0)) ((0,16,16)(7,23,23)(0,0,0)) ((8,16,16)(15,23,23)(0,0,0)) ((0,0,24)(7,7,31)(0,0,0)) ((8,0,24)(15,7,31)(0,0,0)) ((0,8,24)(7,15,31)(0,0,0)) ((8,8,24)(15,15,31)(0,0,0)) ((0,16,24)(7,23,31)(0,0,0)) ((8,16,24)(15,23,31)(0,0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.3_small_a0000644000175000017500000000017611634153073023166 0ustar amckinstryamckinstryboxes = grids/gr.3_small_a geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 0.0 geometry.prob_hi = 8.0 8.0 8.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_stack_c0000644000175000017500000000016211634153073023157 0ustar amckinstryamckinstryboxes = grids/gr.2_stack_c geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 16.0 48.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_3boxes_b0000644000175000017500000000016311634153073023255 0ustar amckinstryamckinstryboxes = grids/gr.2_3boxes_b geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 64.0 64.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_disjoint_d0000644000175000017500000000016511634153073023701 0ustar amckinstryamckinstryboxes = grids/gr.2_disjoint_d geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 16.0 16.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_stack_c0000644000175000017500000000007711634153073023166 0ustar amckinstryamckinstry((0,0)(15,47)(0,0)) 2 ((0,0)(15,15)(0,0)) ((0,16)(15,47)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.2_small_b0000644000175000017500000000007211634153073023163 0ustar amckinstryamckinstry((0,0)(7,15)(0,0)) 2 ((0,0)(7,7)(0,0)) ((0,8)(7,15)(0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.3_big0000644000175000017500000000007011634153073022312 0ustar amckinstryamckinstry((0,0,0)(63,63,63)(0,0,0)) 1 ((0,0,0)(63,63,63)(0,0,0)) ccseapps-2.5/CCSEApps/mglib/Test/grids/in.2_3x20000644000175000017500000000015611634153073022167 0ustar amckinstryamckinstryboxes = grids/gr.2_3x2 geometry.coord_sys = 0 geometry.prob_lo = 0.0 0.0 geometry.prob_hi = 32.0 48.0 ccseapps-2.5/CCSEApps/mglib/Test/grids/gr.3_stack_a0000644000175000017500000000024411634153073023161 0ustar amckinstryamckinstry((0,0,0)(15,23,15)(0,0,0)) 5 ((0,0,0)(15,15,15)(0,0,0)) ((0,16,0)(7,23,7)(0,0,0)) ((8,16,0)(15,23,7)(0,0,0)) ((0,16,8)(7,23,15)(0,0,0)) ((8,16,8)(15,23,15)(0,0,0)) ccseapps-2.5/CCSEApps/mglib/LO_F.H0000644000175000017500000001216111634153073017642 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _LO_F_H_ #define _LO_F_H_ /* ** $Id: LO_F.H,v 1.3 2002/04/26 22:10:02 lijewski Exp $ */ #include #if defined(BL_LANG_FORT) #if (BL_SPACEDIM == 2) #define FORT_AVERAGECC averagecc2dgen #define FORT_AVERAGEEC averageec2dgen #define FORT_HARMONIC_AVERAGEEC haraverageec2dgen #define FORT_APPLYBC applybc2dgen #define FORT_RESIDL resid2dgen #endif #if (BL_SPACEDIM == 3) #define FORT_AVERAGECC averagecc3dgen #define FORT_AVERAGEEC averageec3dgen #define FORT_HARMONIC_AVERAGEEC haraverageec3dgen #define FORT_APPLYBC applybc3dgen #define FORT_RESIDL resid3dgen #endif #else #if (BL_SPACEDIM == 2) #if defined(BL_FORT_USE_UPPERCASE) #define FORT_AVERAGECC AVERAGECC2DGEN #define FORT_AVERAGEEC AVERAGEEC2DGEN #define FORT_HARMONIC_AVERAGEEC HARAVERAGEEC2DGEN #define FORT_APPLYBC APPLYBC2DGEN #define FORT_RESIDL RESID2DGEN #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_AVERAGECC averagecc2dgen #define FORT_AVERAGEEC averageec2dgen #define FORT_HARMONIC_AVERAGEEC haraverageec2dgen #define FORT_APPLYBC applybc2dgen #define FORT_RESIDL resid2dgen #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_AVERAGECC averagecc2dgen_ #define FORT_AVERAGEEC averageec2dgen_ #define FORT_HARMONIC_AVERAGEEC haraverageec2dgen_ #define FORT_APPLYBC applybc2dgen_ #define FORT_RESIDL resid2dgen_ #endif #endif #if (BL_SPACEDIM == 3) #if defined(BL_FORT_USE_UPPERCASE) #define FORT_AVERAGECC AVERAGECC3DGEN #define FORT_AVERAGEEC AVERAGEEC3DGEN #define FORT_HARMONIC_AVERAGEEC HARAVERAGEEC3DGEN #define FORT_APPLYBC APPLYBC3DGEN #define FORT_RESIDL RESID3DGEN #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_AVERAGECC averagecc3dgen #define FORT_AVERAGEEC averageec3dgen #define FORT_HARMONIC_AVERAGEEC haraverageec3dgen #define FORT_APPLYBC applybc3dgen #define FORT_RESIDL resid3dgen #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_AVERAGECC averagecc3dgen_ #define FORT_AVERAGEEC averageec3dgen_ #define FORT_HARMONIC_AVERAGEEC haraverageec3dgen_ #define FORT_APPLYBC applybc3dgen_ #define FORT_RESIDL resid3dgen_ #endif #endif #include extern "C" { void FORT_RESIDL ( Real* res , ARLIM_P(res_lo), ARLIM_P(res_hi), const Real* rhs, ARLIM_P(rhs_lo), ARLIM_P(rhs_hi), const Real* phi, ARLIM_P(phi_lo), ARLIM_P(phi_hi), const int* lo, const int* hi, const int* nc ); void FORT_APPLYBC( const int *flagden, const int *flagbc, const int *maxorder, Real *phi, ARLIM_P(phi_lo), ARLIM_P(phi_hi), const int *cdr, const int *bct, const Real *bcl, const Real *bcval, ARLIM_P(bcval_lo), ARLIM_P(bcval_hi), const int *mask, ARLIM_P(mask_lo), ARLIM_P(mask_hi), Real *den, ARLIM_P(den_lo), ARLIM_P(den_hi), const int *lo, const int *hi, const int *nc, const Real *h ); void FORT_AVERAGECC ( Real* crseX, ARLIM_P(crseX_lo), ARLIM_P(crseX_hi), const Real* fineX, ARLIM_P(fineX_lo), ARLIM_P(fineX_hi), const int *tlo, const int *thi, const int *nc ); void FORT_AVERAGEEC ( Real* crseX, ARLIM_P(crseX_lo), ARLIM_P(crseX_hi), const Real* fineX, ARLIM_P(fineX_lo), ARLIM_P(fineX_hi), const int *tlo, const int *thi, const int *nc, const int *axis ); void FORT_HARMONIC_AVERAGEEC ( Real* crseX, ARLIM_P(crseX_lo), ARLIM_P(crseX_hi), const Real* fineX, ARLIM_P(fineX_lo), ARLIM_P(fineX_hi), const int *tlo, const int *thi, const int *nc, const int *axis ); } #endif #endif /*_LO_F_H_*/ ccseapps-2.5/CCSEApps/mglib/OpenSource.txt0000644000175000017500000002434611634153073021605 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: MGLib Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/scripts/0000755000175000017500000000000011634153073017346 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/scripts/dsp.mak0000644000175000017500000002375111634153073020636 0ustar amckinstryamckinstry#!/bin/sh USAGE="Usage: $myName [-p project] [-t paralleltopdir] [-v prversion] [-d spacedim] [-o outfile] [-O <0, 1>] [-f namefile] [-S] filenames" myName=$0 PROJ=IAMRAll TOP=..\.. DIM=2 OFILE=$PROJ.dsp OLEVEL=0 # 0 - DEBUG, 1 - Release VERSION=0 SERIAL=0 NFILE= # # Parse command arguments, exit if incorrect usage # if [ $# = 0 ] then echo $USAGE exit fi #set -- `getopt p:t:d:o:O:f:v:S $*` if [ $? != 0 ] then echo $USAGE exit fi for argument in $* do case $argument in -p) shift;PROJ=$1;shift;; -t) shift;TOP=`echo $1 | sed 's/\\//\\\/g'`;shift;; -d) shift;DIM=$1;shift;; -o) shift;OFILE=$1;shift;; -O) shift;OLEVEL=$1;shift;; -f) shift;NFILE=$1;shift;; -v) shift;VERSION=$1;shift;; -S) shift;SERIAL=1;; --) shift;break;; esac done files=$* vN=5 if [ ${VERSION} = v9 ] then vN=9 fi CPROJVERS='/D "BL_PRVERSION='${vN}\" FPROJVERS='/DBL_PRVERSION='${vN} CPROJDEF= FPROJDEF= if [ ${SERIAL} = 1 ] then CPROJDEF='/D "BL_USE_HGPROJ_SERIAL"' FPROJDEF='/DBL_USE_HGPROJ_SERIAL' fi if [ -n $NFILE ] then files=`cat $NFILE` $files fi OptString=Debug if [ $OLEVEL = 1 ] then OptString=Release fi # # Split up the infiles # FEXE_sources= CEXE_sources= CEXE_headers= fEXE_sources= IncludeLocations= for f in `cat $NFILE` do if [ `echo $f | fgrep .F` ] then FEXE_sources="${FEXE_sources} $f" else if [ `echo $f | fgrep .cpp` ] then CEXE_sources="${CEXE_sources} $f" else if [ `echo $f | grep '\.[hH]'` ] then CEXE_headers="${CEXE_headers} $f" else if [ `echo $f | fgrep .f` ] then fEXE_sources="${fEXE_sources} $f" else dir=`echo $f | tr '\\/' '\\\'` IncludeLocations="$IncludeLocations $dir" fi fi fi fi done cdirlist= for d in $IncludeLocations do cdirlist="$cdirlist /I \"$d\"" done fdirlist= for d in $IncludeLocations do fdirlist="$fdirlist /S$d" done cat > $OFILE << EOF # Microsoft Developer Studio Project File - Name="$PROJ" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=$PROJ - Win32 $OptString !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "$PROJ.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "$PROJ.mak" CFG="$PROJ - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "$PROJ - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "$PROJ - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe F90=df.exe RSC=rc.exe !IF "\$(CFG)" == "$PROJ - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE F90 /compile_only /include:"Release/" /nologo /warn:nofileopt # ADD F90 /assume:noaccuracy_sensitive /compile_only /debug:none /iface:cref /include:"Release/" /math_library:fast /nologo /threads /tune:k7 /warn:nofileopt /unroll:4 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GR /GX /O2 $cdirlist /I "C:\WMPI\include" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /D "BL_USE_DOUBLE" /D "BL_ARCH_IEEE" /D "BL_USE_NEW_HFILES" /D "BL_SPACEDIM=${DIM}" ${CPROJDEF} ${CPROJVERS} /D "BL_PARALLEL_IO" /D "BL_FORT_USE_UPPERCASE" /D "BL_LANG_CC" /D "BL_USE_CHEM" /D for="if(0);else for" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dformt.lib /nologo /subsystem:console /machine:I386 /include:"__matherr" !ELSEIF "\$(CFG)" == "$PROJ - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE F90 /check:bounds /compile_only /debug:full /include:"Debug/" /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD F90 /browser /check:bounds /compile_only /dbglibs /debug:full /iface:cref /include:"Debug/" /libs:static /nologo /traceback /warn:argument_checking /optimize:0 /threads /warn:nofileopt # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MTd /W3 /Gm /GR /GX /ZI /Od $cdirlist /I "C:\WMPI\include" /D "_CONSOLE" /D "_MBCS" /D "_DEBUG" /D "WIN32" /D "BL_USE_DOUBLE" /D "BL_ARCH_IEEE" /D "BL_USE_NEW_HFILES" /D "BL_SPACEDIM=${DIM}" ${CPROJDEF} ${CPROJVERS} /D "BL_PARALLEL_IO" /D "BL_FORT_USE_UPPERCASE" /D "BL_LANG_CC" /D "BL_USE_CHEM" /D for="if(0);else for" /FR /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dformt.lib /nologo /subsystem:console /debug /machine:I386 /include:"__matherr" /pdbtype:sept !ENDIF # Begin Target # Name "$PROJ - Win32 Release" # Name "$PROJ - Win32 Debug" EOF # # Do C++ sources # cat >> $OFILE <> $OFILE << EOF # Begin Source File SOURCE=$cppfile # End Source File EOF done cat >> $OFILE << EOF # End Group EOF # # Do C++ headers # cat >> $OFILE <> $OFILE << EOF # Begin Source File SOURCE=$cpphdr # End Source File EOF done cat >> $OFILE << EOF # End Group EOF # # Do processed fortran sources # cat >> $OFILE << EOF # Begin Group "Fortran" # PROP Default_Filter "" EOF for file in $fEXE_sources do forfile=`echo $file | sed 's/\\//\\\/g'` cat >> $OFILE << EOF # Begin Source File SOURCE=$forfile # End Source File EOF done cat >> $OFILE << EOF # Begin Group "TEMPS-Debug" # PROP Default_Filter "FOR" EOF for file in $FEXE_sources do filer=`basename $file .F` ffile=$filer.FOR forfile=`echo $ffile | sed 's/\\//\\\/g'` cat >> $OFILE << EOF # Begin Source File SOURCE=Debug\\Fort\\$forfile !IF "\$(CFG)" == "$PROJ - Win32 Release" # PROP Exclude_From_Build 1 !ELSEIF "\$(CFG)" == "$PROJ - Win32 Debug" !ENDIF # End Source File EOF done cat >> $OFILE << EOF # End Group EOF cat >> $OFILE << EOF # Begin Group "TEMPS-Release" # PROP Default_Filter "FOR" EOF for file in $FEXE_sources do filer=`basename $file .F` ffile=$filer.FOR forfile=`echo $ffile | sed 's/\\//\\\/g'` cat >> $OFILE << EOF # Begin Source File SOURCE=Release\\Fort\\$forfile !IF "\$(CFG)" == "$PROJ - Win32 Release" !ELSEIF "\$(CFG)" == "$PROJ - Win32 Debug" # PROP Exclude_From_Build 1 !ENDIF # End Source File EOF done cat >> $OFILE << EOF # End Group EOF # # Do preprocessing for Fortran sources # for file in $FEXE_sources do ifile=`basename $file .F` ffile=`echo $file | sed 's/\\//\\\/g'` cat >> $OFILE << EOF # Begin Source File SOURCE=$ffile !IF "\$(CFG)" == "$PROJ - Win32 Release" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=$ffile InputName=$ifile "Release\\Fort\\\$(InputName).FOR" : \$(SOURCE) "\$(INTDIR)" "\$(OUTDIR)" fpp /m /ansi /nologo $fdirlist /DBL_LANG_FORT /DBL_SPACEDIM=${DIM} /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH /DBL_USE_CHEM ${FPROJDEF} ${FPROJVERS} \$(InputPath) | perl ${TOP}\scripts\strip72 -c > Release\\Fort\\\$(InputName).FOR # End Custom Build !ELSEIF "\$(CFG)" == "$PROJ - Win32 Debug" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=$ffile InputName=$ifile "Debug\\Fort\\\$(InputName).FOR" : \$(SOURCE) "\$(INTDIR)" "\$(OUTDIR)" fpp /m /ansi /nologo $fdirlist /DBL_LANG_FORT /DBL_SPACEDIM=${DIM} /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH /DBL_USE_CHEM ${FPROJDEF} ${FPROJVERS} \$(InputPath) | perl ${TOP}\scripts\strip72 -c > Debug\\Fort\\\$(InputName).FOR # End Custom Build !ENDIF # End Source File EOF done cat >> $OFILE << EOF # End Group EOF cat >> $OFILE << EOF # End Target # End Project EOF # Add lf's needed by Windows junk perl -e 'while(<>) {s/\n/\r\n/;print;}' < $OFILE > junk.$$ mv junk.$$ $OFILE exit 0 ccseapps-2.5/CCSEApps/scripts/dsp.lib.mak0000644000175000017500000002075711634153073021406 0ustar amckinstryamckinstry#!/bin/sh USAGE="Usage: $myName [-p project] [-t paralleltopdir] [-v prversion] [-d spacedim] [-o outfile] [-O <0, 1>] [-f namefile] [-S] filenames" myName=$0 PROJ=IAMRAll TOP=..\.. DIM=2 OFILE=$PROJ.dsp OLEVEL=0 # 0 - DEBUG, 1 - Release VERSION=0 SERIAL=0 NFILE= # # Parse command arguments, exit if incorrect usage # if [ $# = 0 ] then echo $USAGE exit fi #set -- `getopt p:t:d:o:O:f:v:S $*` if [ $? != 0 ] then echo $USAGE exit fi for argument in $* do case $argument in -p) shift;PROJ=$1;shift;; -t) shift;TOP=`echo $1 | sed 's/\\//\\\/g'`;shift;; -d) shift;DIM=$1;shift;; -o) shift;OFILE=$1;shift;; -O) shift;OLEVEL=$1;shift;; -f) shift;NFILE=$1;shift;; -v) shift;VERSION=$1;shift;; -S) shift;SERIAL=1;; --) shift;break;; esac done files=$* vN=5 if [ ${VERSION} = v9 ] then vN=9 fi CPROJVERS='/D "BL_PRVERSION='${vN}\" FPROJVERS='/DBL_PRVERSION='${vN} CPROJDEF= FPROJDEF= if [ ${SERIAL} = 1 ] then CPROJDEF='/D "BL_USE_HGPROJ_SERIAL"' FPROJDEF='/DBL_USE_HGPROJ_SERIAL' fi if [ -n $NFILE ] then files=`cat $NFILE` $files fi OptString=Debug if [ $OLEVEL = 1 ] then OptString=Release fi # # Split up the infiles # FEXE_sources= CEXE_sources= CEXE_headers= fEXE_sources= IncludeLocations= for f in `cat $NFILE` do if [ `echo $f | fgrep .F` ] then FEXE_sources="${FEXE_sources} $f" else if [ `echo $f | fgrep .cpp` ] then CEXE_sources="${CEXE_sources} $f" else if [ `echo $f | grep '\.[hH]'` ] then CEXE_headers="${CEXE_headers} $f" else if [ `echo $f | fgrep .f` ] then fEXE_sources="${fEXE_sources} $f" else dir=`echo $f | tr '\\/' '\\\'` IncludeLocations="$IncludeLocations $dir" fi fi fi fi done cdirlist= for d in $IncludeLocations do cdirlist="$cdirlist /I \"$d\"" done fdirlist= for d in $IncludeLocations do fdirlist="$fdirlist /S$d" done cat > $OFILE << EOF # Microsoft Developer Studio Project File - Name="$PROJ" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=$PROJ - Win32 $OptString !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "$PROJ.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "$PROJ.mak" CFG="$PROJ - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "$PROJ - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "$PROJ - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe F90=df.exe RSC=rc.exe !IF "\$(CFG)" == "$PROJ - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE F90 /compile_only /nologo /warn:nofileopt # ADD F90 /assume:noaccuracy_sensitive /compile_only /debug:none /iface:cref /include:"Release/" /math_library:fast /nologo /threads /tune:k7 /warn:nofileopt /unroll:4 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_LIB" /YX /FD /D "_MBCS" /c # ADD CPP /nologo /MD /W3 /GR /GX /O2 $cdirlist /I "C:\WMPI\include" /D "NDEBUG" /D "_LIB" /D "BL_LANG_CC" /D "WIN32" /D "_MBCS" /D "BL_USE_DOUBLE" /D "BL_ARCH_IEEE" /D "BL_SPACEDIM=${DIM}" ${CPROJDEF} ${CPROJVERS} /D "BL_PARALLEL_IO" /D "BL_FORT_USE_UPPERCASE" /D "BL_LANG_CC" /D for="if(0);else for" /YX /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ELSEIF "\$(CFG)" == "$PROJ - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE F90 /check:bounds /compile_only /debug:full /nologo /warn:argument_checking /warn:nofileopt # ADD F90 /browser /check:bounds /compile_only /dbglibs /debug:full /iface:cref /libs:dll /nologo /threads /warn:argument_checking /warn:nofileopt # SUBTRACT F90 /traceback # ADD BASE CPP /nologo /W3 /GX /Od /D "WIN32" /D "_DEBUG" /D "_LIB" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /Gm /Gi /GR /GX /ZI /Od $cdirlist /I "C:\WMPI\include" /D "_CONSOLE" /D "_MBCS" /D "_DEBUG" /D "WIN32" /D "BL_USE_DOUBLE" /D "BL_ARCH_IEEE" /D "BL_THREADS" /D "BL_SPACEDIM=${DIM}" ${CPROJDEF} ${CPROJVERS} /D "BL_PARALLEL_IO" /D "BL_FORT_USE_UPPERCASE" /D "BL_LANG_CC" /D for="if(0);else for" /FR /YX /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ENDIF # Begin Target # Name "$PROJ - Win32 Release" # Name "$PROJ - Win32 Debug" EOF # # Do C++ sources # cat >> $OFILE <> $OFILE << EOF # Begin Source File SOURCE=$cppfile # End Source File EOF done cat >> $OFILE << EOF # End Group EOF # # Do C++ headers # cat >> $OFILE <> $OFILE << EOF # Begin Source File SOURCE=$cpphdr # End Source File EOF done cat >> $OFILE << EOF # End Group EOF # # Do processed fortran sources # cat >> $OFILE << EOF # Begin Group "Fortran" # PROP Default_Filter "" EOF for file in $fEXE_sources do forfile=`echo $file | sed 's/\\//\\\/g'` cat >> $OFILE << EOF # Begin Source File SOURCE=$forfile # End Source File EOF done cat >> $OFILE << EOF # Begin Group "TEMPS-Debug" # PROP Default_Filter "FOR" EOF for file in $FEXE_sources do filer=`basename $file .F` ffile=$filer.FOR forfile=`echo $ffile | sed 's/\\//\\\/g'` cat >> $OFILE << EOF # Begin Source File SOURCE=Debug\\Fort\\$forfile !IF "\$(CFG)" == "$PROJ - Win32 Release" # PROP Exclude_From_Build 1 !ELSEIF "\$(CFG)" == "$PROJ - Win32 Debug" !ENDIF # End Source File EOF done cat >> $OFILE << EOF # End Group EOF cat >> $OFILE << EOF # Begin Group "TEMPS-Release" # PROP Default_Filter "FOR" EOF for file in $FEXE_sources do filer=`basename $file .F` ffile=$filer.FOR forfile=`echo $ffile | sed 's/\\//\\\/g'` cat >> $OFILE << EOF # Begin Source File SOURCE=Release\\Fort\\$forfile !IF "\$(CFG)" == "$PROJ - Win32 Release" !ELSEIF "\$(CFG)" == "$PROJ - Win32 Debug" # PROP Exclude_From_Build 1 !ENDIF # End Source File EOF done cat >> $OFILE << EOF # End Group EOF # # Do preprocessing for Fortran sources # for file in $FEXE_sources do ifile=`basename $file .F` ffile=`echo $file | sed 's/\\//\\\/g'` cat >> $OFILE << EOF # Begin Source File SOURCE=$ffile !IF "\$(CFG)" == "$PROJ - Win32 Release" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=$ffile InputName=$ifile "Release\\Fort\\\$(InputName).FOR" : \$(SOURCE) "\$(INTDIR)" "\$(OUTDIR)" fpp /m /ansi /nologo $fdirlist /DBL_LANG_FORT /DBL_SPACEDIM=${DIM} /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH /DBL_USE_CHEM ${FPROJDEF} ${FPROJVERS} \$(InputPath) | perl ${TOP}\scripts\strip72 -c > Release\\Fort\\\$(InputName).FOR # End Custom Build !ELSEIF "\$(CFG)" == "$PROJ - Win32 Debug" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=$ffile InputName=$ifile "Debug\\Fort\\\$(InputName).FOR" : \$(SOURCE) "\$(INTDIR)" "\$(OUTDIR)" fpp /m /ansi /nologo $fdirlist /DBL_LANG_FORT /DBL_SPACEDIM=${DIM} /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH /DBL_USE_CHEM ${FPROJDEF} ${FPROJVERS} \$(InputPath) | perl ${TOP}\scripts\strip72 -c > Debug\\Fort\\\$(InputName).FOR # End Custom Build !ENDIF # End Source File EOF done cat >> $OFILE << EOF # End Group EOF cat >> $OFILE << EOF # End Target # End Project EOF # Add lf's needed by Windows junk perl -e 'while(<>) {s/\n/\r\n/;print;}' < $OFILE > junk.$$ mv junk.$$ $OFILE exit 0 ccseapps-2.5/CCSEApps/scripts/install-sh0000644000175000017500000001124411634153073021351 0ustar amckinstryamckinstry#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" tranformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 ccseapps-2.5/CCSEApps/scripts/strip720000644000175000017500000002610611634153073020610 0ustar amckinstryamckinstry#!/usr/local/gnu/bin/perl # "$Id: strip72,v 1.7 2001/05/18 16:49:24 car Exp $" # ------------------------------------------------------------------------- # This PERL script will act as a filter for FORTRAN code. # It will: # (1) expand tabs on non-comment lines # (2) replace multiple blank lines with a single blank line # (3) split lines at or before column 72 and preserve indention # (4) translate CRAY conditional vector merge statements # into equivalent if-then-else statements (if requested). # This will even work on nested conditions vector merge statements. # (5) translates DUMARR(a) -> a,a_lo,a_hi to be used in # the summy arguments lists of subroutines, function calls, etc. # (6) translates DECL(typ,name,n1,n2,...nm) into an array # declaration. For example: # DECL(integer,a,nvar) # is replaced by the lines: (if SDIM = 2) # integer a_lo(2),a_hi(2) # integer a(a_lo(1):a_hi(1),a_lo(2):a_hi(2),nvar) # # Usage: strip72 [-c] [-s SDIM] # -c => convert cvmgX to if-then-else statments # Without -c it will leave cvmgX in code # -s => use next argument as SPACEDIM, default = 2 # reads from standard input of list of files, # writes to standard output. # # Author: Michael Welcome # Lawrence Livermore National Laboratory # Date: 8/26/94 # MODIFY: 8/1/95 # ------------------------------------------------------------------------- # check command line for -c flag $do_cvmgX = 0; $debug = 0; $SDIM = 2; # read command line options while ($ARGV[0] =~ /^-/) { $_ = shift; if (/^-c/i) { $do_cvmgX = 1; } elsif (/^-d/i) { $debug = 1; } elsif (/^-s/i) { $SDIM = shift } else { die "invalid argument: $_\n"; } } $dash_line = "-" x 50 . "\n"; # look ahead loop: read first line and continue until input is exhausted. $_ = "\n"; while ($_) { print $dash_line if $debug; # gather all continuation lines of statement # gather all comments in @comment # replace multiple blank lines with single blank line $line = $_; @comments = (); $nskip = 0; while (<>) { # if comment, gather for later printing # and continue searching for continuation lines if (/^c/i) { push(@comments,$_); next; } if (/^[!]/i) { push(@comments,$_); next; } # if blank line and no previous blank line, save it in @comments if (/^\s*$/) { next if $nskip > 0; push(@comments,"\n"); $nskip++; next; } # skip lines with CPP control characters in first column next if /^\#/; # if not a continuation line, drop out of loop last if !/^ \S/; # found a continuation line chop($line); chop(); # remove continuation statement and leading white space s/^ \S\s*//; # collapse other white space s/\s+/ /g; # append to current line and add newline char $line .= $_ . "\n"; } print "DB: AFTER GATHER : $line" if $debug; # all continuation lines have been gathered in $line # search for all occurances of DUMARR(a) and expand to # "a,a_lo,a_hi" if ($line =~ /^\s+.*DUMARR/) { # while ($line =~ /.*DUMARR\s*\(\s*(\w+)\s*\)/) { while ($line =~ /DUMARR\s*\(\s*(\w+)\s*\)/) { $args = "$1,$1_lo,$1_hi"; $line = $`.$args.$'; } } # now expand tabs while ($line =~ /(\t)/) { $_n = index($line,$1); # locaton of tab $_len = 8 - ($_n % 8); # number of spaces to next tab stop substr($line,$_n,1) = " " x $_len; # replace with spaces } # search line for DECL statement and replace with declarations if ($line =~ /^\s+DECL\s*\(([^\)]*)/) { ($typ,$aname,@rest) = split(/,/,$1); $line =~ /^\s*/; $indent = $&; $lines[0] = $indent . "integer $aname"."_lo($SDIM), $aname"."_hi($SDIM)\n"; $lines[1] = $indent . "$typ $aname("; foreach $dim (1 .. $SDIM) { $lines[1] .= "$aname"."_lo(".$dim."):$aname"."_hi(".$dim.")"; $lines[1] .= "," if $dim < $SDIM; } if (@rest > 0) { $lines[1] .= "," . join(",",@rest); } $lines[1] .= ")\n"; } else { @lines = ($line); } # put line in an array of lines # check for conditional vector merge statement if ($do_cvmgX && $line =~ /.*=\s*cvmg[pPmMnNzZtT]\s*\(/o) { # @lines will contain the equivalent if-then-else statement # with proper indention preserved. @lines = &expand_cvmgX($line); } # if we got here, the line has been split into # possibly multiple lines by the cvmgX splitter # now output each line so that each has a length < 72 foreach $ln (@lines) { if (length($ln) <= 73) { print $ln; } else { &chop_line($ln); } } # now that line is out, print comments that where # collected in the forward search for continuation lines. # This preserves the order of comments and code. foreach $ln (@comments) { print $ln; } } # ------------------------------------------------------------------- # Subroutine expand_cvmgX # input is a string containing cvmgX statement # output is array of strings containing equivalent # if-then-else statements # Note, this is a recursive subroutine # ------------------------------------------------------------------- sub expand_cvmgX { print "DB: SUB expand_cvmgX with @_[0]" if $debug; # recursive, so need local variables local($_line) = @_[0]; local(@args, @out); # remove newline char chop($_line); # get indention string and strip white_space $_line =~ /^\s*/; $indent = $&; $_line =~ s/\s+//g; # statement looks like =cvmgX(a,b,c), = (a,b,c) # collect LHS and RHS $_line =~ /=cvmg/i; $lhs = $`; $rhs = $'; $type = substr($rhs,0,1); # strip off type and outer parens substr($rhs,0,2) = ""; chop($rhs); # collect a, b, c searching for comma, matching parens $len = length($rhs); $chunk = 0; @args = ("","",""); $paren = 0; for ($i=0; $i<$len; $i++) { # examine ith character in string $ch = substr($rhs,$i,1); if (($ch eq ",") && ($paren == 0)) { # found comma seperator, start gathering next arg $chunk++; die "$0 : too many args to cvmg$type\n" if $chunk > 2; } else { # gather char, incr or decr paren count $args[$chunk] .= $ch; $paren++ if $ch eq "("; $paren-- if $ch eq ")"; } } if ($debug) { print "LHS = $lhs, TYPE = $type, RHS = $rhs\n"; print "A = $args[0]\n"; print "B = $args[1]\n"; print "C = $args[2]\n"; } # make sure conditional does not contain a cvmgX statement if ($args[2] =~ /.*=\s*cvmg[pPmMnNzZtT]\s*\(/) { die "$0 : cvmg$type in conditional: $args[2]\n"; } # determine type of conditional vector merge statement, build # components of conditional statement $type =~ tr/A-Z/a-z/; if ($type eq "p") { $cmp1 = " .ge. 0.0"; $pre2 = ""; $cmp2 = " .lt. 0.0"; } elsif ($type eq "m") { $cmp1 = " .lt. 0.0"; $pre2 = ""; $cmp2 = " .ge. 0.0"; } elsif ($type eq "n") { $cmp1 = " .ne. 0.0"; $pre2 = ""; $cmp2 = " .eq. 0.0"; } elsif ($type eq "z") { $cmp1 = " .eq. 0.0"; $pre2 = ""; $cmp2 = " .ne. 0.0"; } elsif ($type eq "t") { $cmp1 = ""; $pre2 = " .not. ("; $cmp2 = ")"; } else { die "$0 : cvmg$type not a conditional vector merge\n"; } # produce output # recursively apply translator if statement contains # another conditional vector merge if ($lhs eq $args[0]) { # single branch if statement $out[0] = $indent . "if (" . $pre2 . $args[2] . $cmp2 . ") then\n"; $out[1] = $indent . " " . $lhs . " = " . $args[1] . "\n"; $out[2] = $indent . "endif\n"; if ($out[1] =~ /.*=\s*cvmg[pPmMnNzZtT]\s*\(/) { splice(@out,1,1,&expand_cvmgX($out[1])); } } elsif ($lhs eq $args[1]) { # single branch if statement $out[0] = $indent . "if (" . $args[2] . $cmp1 . ") then\n"; $out[1] = $indent . " " . $lhs . " = " . $args[0] . "\n"; $out[2] = $indent . "endif\n"; if ($out[1] =~ /.*=\s*cvmg[pPmMnNzZtT]\s*\(/) { splice(@out,1,1,&expand_cvmgX($out[1])); } } else { # double branch if statement $out[0] = $indent . "if (" . $args[2] . $cmp1 . ") then\n"; $out[1] = $indent . " " . $lhs . " = " . $args[0] . "\n"; $out[2] = $indent . "else\n"; $out[3] = $indent . " " . $lhs . " = " . $args[1] . "\n"; $out[4] = $indent . "endif\n"; if ($out[3] =~ /.*=\s*cvmg[pPmMnNzZtT]\s*\(/) { splice(@out,3,1,&expand_cvmgX($out[3])); } if ($out[1] =~ /.*=\s*cvmg[pPmMnNzZtT]\s*\(/) { splice(@out,1,1,&expand_cvmgX($out[1])); } } return @out; } # ------------------------------------------------------------------- # Subroutine chop_line # input is a string containing a long line # side effect is to chop the line into shorter continuation # lines and write to standard output. # NOTE: preserves indention of input line # ------------------------------------------------------------------- sub chop_line { local($_line) = @_; print "DB: SUB chop_line with line = $_line" if $debug; # NOTE: tabs have been expanded at this point chop($_line); $_line =~ s/^.{5}\s*//; # find possible label and leading white space $indent1 = $&; # string containing label and white space # $indent2 = $&; # string containing continuation and white space $indent2 = " &"; # hardwire removal of white space : MSD-11-06-98 $i_len = length($indent1); # length of leading white space # try stripping multiple white space, see if that solves problem $_line =~ s/\s+/ /g; # replace multiple spaces with single space if (length($_line) <= 72-$i_len) { print $indent1, $_line, "\n"; return 1; } # if we got here the line is still too long $mx_len = 72 - $i_len; # num allowed char after indent $line_no = 0; $no_split_chars = "'[a-zA-Z0-9_\.]"; while (($_len = length($_line)) > 0) { # find closest word bndry prior to $l_len and split there $pos = $_len; if ($pos >= $mx_len) { $pos = $mx_len-1; while ($pos >= 0 && (substr($_line,$pos,1) =~ /$no_split_chars/o)) { $pos--; } } die "Failed to chop long line. Try adding spaces!!!\n\n==> $_line\n" if $pos <= 0; # make header so that it indents correct number of chars $header = ($line_no == 0 ? $indent1 : $indent2); # print portion that will fit on this line print $header , substr($_line,0,$pos+1) , "\n"; # increment line count and remove portion of line that has # just been printed. $line_no++; substr($_line,0,$pos+1) = ""; $mx_len = 70 - $i_len; # num allowed char after indent } if ($line_no > 19) { warn "$0: produced $line_no continuation lines\n"; } } ccseapps-2.5/CCSEApps/scripts/mkdep0000644000175000017500000001221511634153073020372 0ustar amckinstryamckinstry#!/usr/bin/perl # ------------------------------------------------------------------ # Perl script to generate a "make"-style dependency list for a # C, C++, or FORTRAN source file with CPP include directives. # # Usage: mk_dep -DBG [-I

]* [-X]* filename ... # Notes: * -I defines a search path for include files # * -DBG turn on debug flag # + -fortran: parse fortran style include directives # * -X means disgard entries with this path (NOT IMPLEMENTED) # * searches current directory only if -I. is in search # path or #include directive uses double quotes rather # than angle brackets. # * dependency list is sent to standard output # * follows all #include directives, even those protected # by #if and #ifdef directives. # * ignores include files not found in search path # * Includes corresponding .C files for .H files including # template definitions # * No duplications in dependency list # # Author: Michael Welcome # 4/26/95 # Lawrence Livermore National Laboratory # ------------------------------------------------------------------ $debug = 0; @incldir = (""); $fortran = 0; # search command line for -I and -X options while ($ARGV[0] =~ /^-/) { $_ = shift; if (/^-I(.+)/) { die "$1 does not exist\n" if (!-e $1); die "$1 not a directory\n" if (!-d $1); die "cannot read $1\n" if (!-r $1); push(@incldir,("$1/")); } elsif (/^-X(.+)/) { die "Sorry, -X option not implemented\n"; push(@excldir,($1)); } elsif (/^-DBG/) { $debug = 1; } elsif (/^-fortran/) { $fortran = 1; } else { die "invalid argument: $_\n"; } } foreach $ifile (@ARGV) { print "PARSING FILE: @ARGV\n" if $debug; die "cannot read $ifile\n" if (!(-e $ifile && -r _)); #define object file # strip path from filename ($ofile = $ARGV[0]) =~ s#.*/##; # change suffix to .o ($ofile = $ifile) =~ s/\.[^.\/]*$/.o/; if ( $fortran ) { @searchlist = ("$ifile\'"); } else { @searchlist = ("$ifile\""); } %usedfiles = (); %deptable = (); $usedfiles{ $ifile } = 1; while (@searchlist) { # get next file off search list $file = shift(@searchlist); # NOTE: the last char in $file is either a double quote (") or # a right angle bracket (>). Strip off this character and # save it. If it is a quote, search current directory first. # If its a right angle bracket, only search directories # specified with -I options. $incltype = chop $file; # NOTE: if the first char in $file is a "/" indicating an absolute # path, do not search directory list $abspath = ($file =~ /^\// ? 1 : 0); foreach $d (@incldir) { if ($d ne "" && $abspath) { # this is an absolute path, dont search current directory next; } if ($d eq "" && $incltype eq ">") { # dont search current directory next; } $dep = "$d$file"; print "Will search $d for $file:: $dep\n" if $debug; if (-e $dep) { # file found, build dependency, enter in table # print "$ofile: $dep\n"; $deptable{ $dep } = 1; # grep file for includes and, if not seen before, add # to end of search list open(FL,"$dep") || die "cant open $dep\n"; while () { if (/^\s*#\s*include\s+["<]\s*([^">]+[">])/) { if ($usedfiles{ $1 }++ == 0) { print " ::: including ::$1::\n" if $debug; # this file not searched yet, add to list # NOTE: last char is either double quote # or right angle bracket. push(@searchlist,($1)); } } elsif ($fortran && /^[ \t]+include\s+'([^']+['])/i) { if ($usedfiles{ $1 }++ == 0) { print " ::: inluding ::$1::\n" if $debug; push(@searchlist,($1)); } } } # if this file is a header (.H) and it includes template # declarations, add the corresponcing .C file to the # searchlist. # Assume the .C file is in the same directory as the .H if ($file =~ /\S*\.[Hh]$/) { $Cfile = $file; $Cfile =~ s/\.H$/\.C/; $Cfile =~ s/\.h$/\.c/; print "Found Header file $dep\n" if $debug; print " . . Corresponding .C file is: $Cfile\n" if $debug; # position file pointer to beginning of file seek(FL,0,0); # search for template declarations while () { # search for string "template" not in a comment s/\/\/.*//; if (/template/) { print "$dep contains template\n" if $debug; print "$_" if $debug; $inclCfile = $Cfile . $incltype; if ($usedfiles{ $inclCfile } == 0) { # print " ::: including ::$inclCfile::\n"; # this file not searched yet, add to list # NOTE: last char is either double quote # or right angle bracket. push(@searchlist,($inclCfile)); } # mark as used file $usedfiles{ $inclCfile }++; # stop searching for tempate last; } } } # since file was found in search path, jump out of loop last; } } # print "@searchlist\n" id $debug; } # now generate dependency list for $dep (keys %deptable) { print "$ofile: $dep\n"; } } ccseapps-2.5/CCSEApps/scripts/compressor0000644000175000017500000000312011634153073021461 0ustar amckinstryamckinstry#!/bin/ksh -p # # Prefix's for chk and plt files. # pidfile=compressor.pid chk_prefix=chk plt_prefix=plt if [ -f $pidfile ]; then echo 2>&1 "compressor lock file " $pidfile " already exists" exit -1 fi echo $$ > $pidfile trap '/bin/rm -f $pidfile' EXIT HUP TERM XCPU KILL # # Number of seconds to sleep before checking again. # N=60 # # Tar up and then remove plt and chk directories. # function tar_up_and_rm_files { if [ ! -f $pidfile ]; then echo "compressor: $pidfile has been removed, exiting" exit fi # # Take all but the final chk file -- want job chaining to work. # Strip out any tar files that are lying around. # chklist=$(ls -d ${chk_prefix}* 2>/dev/null | grep -v tar) if [ "$chklist" ] then nl=$(echo "$chklist" | wc -l) nl=$(expr $nl - 1) if [ $nl -eq 0 ] then chklist="" else chklist=$(echo "$chklist" | head -$nl) fi fi # # Take all but the final plt file. # We want to ensure they're completely written to disk. # Strip out any tar files that are lying around. # pltlist=$(ls -d ${plt_prefix}* 2>/dev/null | grep -v tar) if [ "$pltlist" ] then nl=$(echo "$pltlist" | wc -l) nl=$(expr $nl - 1) if [ $nl -eq 0 ] then pltlist="" else pltlist=$(echo "$pltlist" | head -$nl) fi fi list="$chklist $pltlist" for dir in ${list} do if [ -d ${dir} ] then if `tar cf ${dir}.tar ${dir}` then rm -rf ${dir} fi fi done } # # Looping waiting for plt and chk directories to appear. # while true do tar_up_and_rm_files sleep $N done ccseapps-2.5/CCSEApps/pAmrDerive/0000755000175000017500000000000011634153073017715 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/pAmrDerive/Make.package0000644000175000017500000000071611634153073022113 0ustar amckinstryamckinstryCEXE_headers += DataServices.H AmrData.H XYPlotDataList.H AmrvisConstants.H CEXE_sources += DataServices.cpp AmrData.cpp XYPlotDataList.cpp ifeq ($(DIM),3) FEXE_sources += DERIVE_3D.F FABUTIL_3D.F else FEXE_sources += DERIVE_2D.F FABUTIL_2D.F COORDSYS_2D.F endif ifeq ($(EBASE), AmrDeriveQuench) include $(CHEMDIR)/Make.package endif ifeq ($(EBASE), AmrDeriveIntScalLen) FEXE_headers += AmrDeriveIntScalLen_F.H FEXE_sources += AmrDeriveIntScalLen_3D.F endif ccseapps-2.5/CCSEApps/pAmrDerive/AmrDerivePeriodicFab.cpp0000644000175000017500000001277611634153073024404 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // ---------------------------------------------------------------------- // AmrDerivePeriodicFab.cpp // ---------------------------------------------------------------------- #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "Utility.H" const int XDIR = 0; const int YDIR = 1; #if (BL_SPACEDIM == 3) const int ZDIR = 2; #endif #define SHOWVAL(val) { \ cout << #val << " = " << val << '\n'; } void PrintUsage(char *progName); // ---------------------------------------------------------------------- int main(int argc, char *argv[]) { if(argc == 1) { PrintUsage(argv[0]); } ParmParse pp(argc-1,argv+1); FArrayBox::setFormat(FABio::FAB_IEEE_32); std::string iFile; std::string oFile; pp.get("infile", iFile); pp.get("outfile", oFile); SHOWVAL(iFile) SHOWVAL(oFile) ifstream inFabStream(iFile.c_str()); FArrayBox inFab(inFabStream); SHOWVAL(inFab.box()); inFabStream.close(); Box grownBox(inFab.box()); bool bPerX(false), bPerY(false), bPerZ(false); int nPerX(0), nPerY(0), nPerZ(0); if(pp.contains("perx")) { bPerX = true; pp.query("perx", nPerX); grownBox.growHi(XDIR, inFab.box().length(XDIR) * nPerX); } if(pp.contains("pery")) { bPerY = true; pp.query("pery", nPerY); grownBox.growHi(YDIR, inFab.box().length(YDIR) * nPerY); } #if (BL_SPACEDIM == 3) if(pp.contains("perz")) { bPerZ = true; pp.query("perz", nPerZ); grownBox.growHi(ZDIR, inFab.box().length(ZDIR) * nPerZ); } #endif SHOWVAL(grownBox); FArrayBox grownFab(grownBox, inFab.nComp()); Box progressiveGrownBox(inFab.box()); int srcComp(0), destComp(0), nComps(inFab.nComp()); grownFab.copy(inFab, inFab.box()); if(bPerX) { Box srcBox(progressiveGrownBox); SHOWVAL(progressiveGrownBox); for(int nShifts(1); nShifts <= nPerX; ++nShifts) { // start at 1 progressiveGrownBox.shift(XDIR, inFab.box().length(XDIR) * nShifts); cout << "----- shifted: "; SHOWVAL(progressiveGrownBox); cout << "----- copying from: "; SHOWVAL(srcBox); cout << "----- copying to: "; SHOWVAL(progressiveGrownBox); grownFab.copy(grownFab, srcBox, srcComp, progressiveGrownBox, destComp, nComps); progressiveGrownBox.shift(XDIR, -inFab.box().length(XDIR) * nShifts); cout << "----- unshifted: "; SHOWVAL(progressiveGrownBox); } progressiveGrownBox.growHi(XDIR, inFab.box().length(XDIR) * nPerX); } if(bPerY) { Box srcBox(progressiveGrownBox); for(int nShifts(1); nShifts <= nPerY; ++nShifts) { // start at 1 progressiveGrownBox.shift(YDIR, inFab.box().length(YDIR) * nShifts); grownFab.copy(grownFab, srcBox, srcComp, progressiveGrownBox, destComp, nComps); progressiveGrownBox.shift(YDIR, -inFab.box().length(YDIR) * nShifts); } progressiveGrownBox.growHi(YDIR, inFab.box().length(YDIR) * nPerY); } #if (BL_SPACEDIM == 3) if(bPerZ) { Box srcBox(progressiveGrownBox); for(int nShifts(1); nShifts <= nPerZ; ++nShifts) { // start at 1 progressiveGrownBox.shift(ZDIR, inFab.box().length(ZDIR) * nShifts); grownFab.copy(grownFab, srcBox, srcComp, progressiveGrownBox, destComp, nComps); progressiveGrownBox.shift(ZDIR, -inFab.box().length(ZDIR) * nShifts); } progressiveGrownBox.growHi(ZDIR, inFab.box().length(ZDIR) * nPerZ); } #endif ofstream outFabStream(oFile.c_str()); grownFab.writeOn(outFabStream); outFabStream.close(); } // ---------------------------------------------------------------------- void PrintUsage(char *progName) { cout << '\n'; cout << "Usage:" << '\n'; cout << progName << '\n'; cout << " infile = inputFileName" << '\n'; cout << " outfile = outputFileName" << '\n'; cout << " [perx = nTimes]" << '\n'; cout << " [pery = nTimes]" << '\n'; cout << " [perz = nTimes]" << '\n'; cout << '\n'; exit(-1); } // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveYIntegrals.cpp0000644000175000017500000001250511634153073024304 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // This is another version of AmrDerive.cpp that calculates integrals of // quantities and writes out scalars instead of plotfiles. // // currently hardcoded for sum_rhoYO2 (quantity 6) // and sum_rhoYC2H2 (quantity 9) // // i'll update it to allow user input of quantity number. v. // #include #include #include #include using std::set_new_handler; #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" static void PrintUsage (char* progName) { cout << "\nUsage:\n" << progName << "\n\tinfile = inputFileName" << "\n\t[-help]" << "\n\n"; exit(1); } static Real SumMass (AmrData& amrData, const int compNumber) { Real sum = 0; // // The component number of density in MultiFab. // const int ncomp = compNumber; int finest_level = amrData.FinestLevel(); FArrayBox fab; for (int iLevel = 0; iLevel <= finest_level; ++iLevel) { const Real* dx = amrData.DxLevel()[iLevel].dataPtr(); MultiFabIterator ntmfi(amrData.GetGrids(iLevel, ncomp)); for ( ; ntmfi.isValid(); ++ntmfi) { // // Make copy of FAB so that we can change it. // fab.resize(ntmfi.fabbox(), 1); //fab.copy(ntmfi(), ncomp, 0, 1); fab.copy(ntmfi(), 0, 0, 1); if (iLevel < finest_level) { const BoxArray& f_box = amrData.boxArray(iLevel+1); for (int j = 0; j < f_box.length(); j++) { Box c_box = ::coarsen(f_box[j],amrData.RefRatio()[iLevel]); c_box &= ntmfi.validbox(); if (c_box.ok()) fab.setVal(0.0, c_box, 0); } } Real s; const Real* dat = fab.dataPtr(); const int* dlo = fab.loVect(); const int* dhi = fab.hiVect(); const int* lo = ntmfi.validbox().loVect(); const int* hi = ntmfi.validbox().hiVect(); int nz = hi[1]-lo[1]+1; Array tmp(nz); FORT_SUMMASS(dat,ARLIM(dlo),ARLIM(dhi),ARLIM(lo),ARLIM(hi), dx,&s,tmp.dataPtr()); sum += s; } } ParallelDescriptor::ReduceRealSum(sum); return sum; } int main (int argc, char* argv[]) { // // Make sure to catch new failures. // set_new_handler(Utility::OutOfMemory); if (argc == 1) PrintUsage(argv[0]); //int iLevel; ParallelDescriptor::StartParallel(&argc, &argv); ParmParse pp(argc-1,argv+1); if (pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Set default info. // Real gam = 1.667; FORT_SETGAMMA(&gam); // // Scan the arguments. // aString iFile; pp.query("infile", iFile); if (iFile.isNull()) BoxLib::Abort("You must specify `infile'"); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(iFile, fileType); if ( ! dataServices.AmrDataOk()) { // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); } AmrData& amrData = dataServices.AmrDataRef(); BL_ASSERT(amrData.NComp() == NSTATECOMPS); Real sum_rhoYO2 = SumMass(amrData, 6); Real sum_rhoYC2H2 = SumMass(amrData, 9); if (ParallelDescriptor::IOProcessor()) { const Array& size = amrData.ProbSize(); Real volume = D_TERM(size[0],*size[1],*size[2]); BL_ASSERT(volume > 0); cout << "time = " << amrData.Time() << " sum_rhoYO2 = " << sum_rhoYO2 << " sum_rhoYC2H2 = " << sum_rhoYC2H2 << endl; } DataServices::Dispatch(DataServices::ExitRequest, NULL); } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveStochTD.cpp0000644000175000017500000020076411634153073023541 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrDeriveStochTD.cpp,v 1.27 2002/08/16 18:59:11 lijewski Exp $ // // This is the time-dependent version that reads input from PlotFiles. // #include #include #include #include #include #include #include #include #include #include #include #ifndef WIN32 #include #endif #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" #include "Tuple.H" #include "Profiler.H" #include "Thread.H" #include "WorkQueue.H" #include "ChemKinDriver.H" #include "Geometry.H" #include "xtra_F.H" // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif // // ParmParse'd arguments ... // static bool build_prob_dist = false; static bool calc_lambda_max = false; static bool do_not_write_trajs = false; static bool do_not_write_events = false; static bool write_intermediate_plotfiles = false; static int seed = 12345; static int init_spec; static int n_particles; D_TERM(static Real init_x = .0000125;, static Real init_y = .0000125;, static Real init_z = .0000125;); static Real dt = .00001; static Real dt_spec = -1; static Real stop_time = 0; static Real strt_time = 0; static Real conc_epsilon = 1.0e-10; static Real chem_limiter = 0.1; static std::string TrajFile; static std::string EventFile; static std::string EdgeDataFile; static std::string chemInFile; static std::string chemOutFile; static std::string thermInFile; static std::string tranInFile; static std::string TraceElement; static std::string InitialSpecies; static Array TimeSteps; static Array PlotFiles; // // Stuff we set from the AmrData object after reading PlotFile. // static int is_rz; static int finest_level; static Array ref_ratio; static Array prob_lo; static Array prob_hi; static Array prob_domain; static Array geom; static Array< Array > dx; static Array< Array > dxinv; D_TERM(static PArray A_mf(PArrayManage);, static PArray C_mf(PArrayManage);, static PArray E_mf(PArrayManage);); D_TERM(static PArray B_mf(PArrayManage);, static PArray D_mf(PArrayManage);, static PArray F_mf(PArrayManage);); static PArray U_mf(PArrayManage); static PArray Rf_mf(PArrayManage); static PArray Rr_mf(PArrayManage); static PArray Conc_mf(PArrayManage); static PArray Prob_mf(PArrayManage); // // Other global data. // static Array pedges; static std::vector edgedata; static Array< Array > AccumProb; // // Particles on our trajectory (includes time) ... // typedef Tuple PartPos; // // Position in space. // typedef Tuple X; static void ScanArguments () { ParmParse pp; pp.query("dt", dt); BL_ASSERT(dt != 0); pp.query("dt_spec", dt_spec); pp.query("strt_time", strt_time); pp.query("stop_time", stop_time); BL_ASSERT(stop_time > 0); BL_ASSERT(strt_time >= 0); BL_ASSERT(stop_time > strt_time); BL_ASSERT(dt_spec != 0); pp.query("seed", seed); pp.query("edgedatafile", EdgeDataFile); if (EdgeDataFile.empty()) BoxLib::Abort("You must specify `edgedatafile'"); pp.query("event_file", EventFile); if (EventFile.empty()) BoxLib::Abort("You must specify `event_file'"); pp.query("traj_file", TrajFile); if (TrajFile.empty()) BoxLib::Abort("You must specify `traj_file'"); if (pp.contains("plot_files")) { PlotFiles.resize(pp.countval("plot_files")); for (int i = 0; i < PlotFiles.size(); i++) pp.get("plot_files", PlotFiles[i], i); // // Calculate TimeSteps. // TimeSteps.resize(PlotFiles.size()); for (int i = 0; i < TimeSteps.size()-1; i++) { DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(PlotFiles[i+1], fileType); if (!dataServices.AmrDataOk()) // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); TimeSteps[i] = dataServices.AmrDataRef().Time(); } TimeSteps[TimeSteps.size()-1] = stop_time; for (int i = TimeSteps.size()-1; i > 0; i--) BL_ASSERT(TimeSteps[i-1] < TimeSteps[i]); } BL_ASSERT(PlotFiles.size() > 0); BL_ASSERT(TimeSteps.size() > 0); BL_ASSERT(strt_time < TimeSteps[0]); BL_ASSERT(TimeSteps.size() == PlotFiles.size()); pp.query("chem_infile", chemInFile); if (chemInFile.empty()) BoxLib::Abort("You must specify `chem_infile'"); pp.query("chem_outfile", chemOutFile); if (chemOutFile.empty()) BoxLib::Abort("You must specify `chem_outfile'"); pp.query("therm_infile", thermInFile); if (thermInFile.empty()) BoxLib::Abort("You must specify `therm_infile'"); pp.query("tran_infile", tranInFile); if (tranInFile.empty()) BoxLib::Abort("You must specify `tran_infile'"); pp.query("trace_element", TraceElement); if (TraceElement.empty()) BoxLib::Abort("You must specify `trace_element'"); // // Append `.seed=N' to EventFile & TrajFile // char buf[12]; TrajFile += ".seed="; EventFile += ".seed="; sprintf(buf, "%d", seed); TrajFile += buf; EventFile += buf; pp.query("calc_lambda_max", calc_lambda_max); pp.query("do_not_write_events", do_not_write_events); pp.query("do_not_write_trajs", do_not_write_trajs); pp.query("write_intermediate_plotfiles", write_intermediate_plotfiles); pp.query("conc_epsilon", conc_epsilon); pp.query("chem_limiter", chem_limiter); BL_ASSERT(conc_epsilon > 0); BL_ASSERT(chem_limiter > 0); D_TERM(pp.query("init_x", init_x);, pp.query("init_y", init_y);, pp.query("init_z", init_z);); pp.query("initial_species", InitialSpecies); pp.query("n_particles", n_particles); BL_ASSERT(n_particles > 0); pp.query("build_prob_dist", build_prob_dist); if (ParallelDescriptor::IOProcessor()) { std::cout << "dt = " << dt << '\n'; std::cout << "dt_spec = " << dt_spec << '\n'; std::cout << "strt_time = " << strt_time << '\n'; std::cout << "stop_time = " << stop_time << '\n'; std::cout << "seed = " << seed << '\n'; std::cout << "edgedatafile = " << EdgeDataFile << '\n'; std::cout << "plot_files ="; for (int i = 0; i < PlotFiles.size(); i++) std::cout << ' ' << PlotFiles[i]; std::cout << std::endl; std::cout << "time_steps ="; for (int i = 0; i < TimeSteps.size(); i++) std::cout << ' ' << TimeSteps[i]; std::cout << std::endl; std::cout << "traj_file = " << TrajFile << '\n'; std::cout << "event_file = " << EventFile << '\n'; std::cout << "chem_infile = " << chemInFile << '\n'; std::cout << "chem_outfile = " << chemOutFile << '\n'; std::cout << "therm_infile = " << thermInFile << '\n'; std::cout << "tran_infile = " << tranInFile << '\n'; std::cout << "trace_element = " << TraceElement << '\n'; if (calc_lambda_max) std::cout << "calc_lambda_max = true" << '\n'; if (do_not_write_events) std::cout << "do_not_write_events = true" << '\n'; if (do_not_write_trajs) std::cout << "do_not_write_trajs = true" << '\n'; if (write_intermediate_plotfiles) std::cout << "write_intermediate_plotfiles = true" << '\n'; std::cout << "Using conc_epsilon = " << conc_epsilon << '\n'; std::cout << "Using chem_limiter = " << chem_limiter << '\n'; D_TERM(std::cout << "init_x = " << init_x << '\n';, std::cout << "init_y = " << init_y << '\n';, std::cout << "init_z = " << init_z << '\n';); std::cout << "initial_species = " << InitialSpecies << '\n'; std::cout << "n_particles = " << n_particles << '\n'; std::cout << "build_prob_dist = " << build_prob_dist << '\n'; } } static void PrintUsage (char* progName) { if (ParallelDescriptor::IOProcessor()) std::cout << "Usage: " << progName << " inputfile" << '\n'; exit(1); } static Real FFF (Real s) { const Real R1 = .007; const Real R2 = .014; const Real A = (R2*R2-R1*R1)/(4*std::log(R1/R2)); const Real B = (R1*R1*log(R2)-R2*R2*log(R1))/(4*log(R1/R2)); Real result = 8 * A * std::log(s); s *= s; result += (s + 8*B -4*A); result *= s/16; return result; } static Real LookupTable[1001]; static void BuildLookupTable () { const Real R1 = .007; const Real R2 = .014; const Real Dx = .001*(R2-R1); const Real FFFR1 = FFF(R1); const Real FFFR2 = FFF(R2); for (int i = 0; i < 1001; i++) { Real s = R1+i*Dx; LookupTable[i] = (FFF(s)-FFFR1)/(FFFR2-FFFR1); } } static Real RandomXPos (BoxLib::mt19937& rand) { const Real Rn = rand.d1_value(); const Real Rf = .006; #if 1 // // Carbon stuff. // return Rf * sqrt(1-sqrt(1-Rn)); #else // // Nitrogen stuff. // const Real Ratio1 = 220.0/3380.0; const Real Ratio2 = 3160.0/3380.0; const Real R1 = .007; const Real R2 = .014; const Real Dx = .001*(R2-R1); if (Rn < Ratio1) { return Rf * sqrt(1-sqrt(1-Rn/Ratio1)); } else { Real x = (Rn-Ratio1)/Ratio2; int i = 0; for ( ; i < 1000; i++) if (x < LookupTable[i]) break; return R1+(i-1+(x-LookupTable[i-1])/(LookupTable[i]-LookupTable[i-1]))*Dx; } #endif } static void ReadEdgeData () { BL_ASSERT(!EdgeDataFile.empty()); if (ParallelDescriptor::IOProcessor()) std::cout << "Reading edgefile ... " << std::endl; std::ifstream ifs; ifs.open(EdgeDataFile.c_str(), std::ios::in); if (!ifs.good()) BoxLib::FileOpenFailed(EdgeDataFile); int N, cnt, tmp; ifs >> N; BL_ASSERT(N > 0); pedges.resize(N); if (ParallelDescriptor::IOProcessor()) std::cout << "N = " << N << '\n'; for (int i = 0; i < N; i++) { ifs >> cnt; BL_ASSERT(cnt > 0); pedges[i] = edgedata.size(); edgedata.push_back(cnt); for (int j = 0; j < 4*cnt; j++) { ifs >> tmp; edgedata.push_back(tmp); } } if (!ifs.good()) BoxLib::Abort("Failure reading EdgeData file"); if (ParallelDescriptor::IOProcessor()) { std::cout << "EdgeData on startup:\n"; for (int i = 0; i < pedges.size(); i++) { int cnt = edgedata[pedges[i]]; std::cout << cnt << ' '; for (int j = 1; j <= 4*cnt; j++) std::cout << edgedata[pedges[i]+j] << ' '; std::cout << '\n'; } } } static void TwiddleConc (PArray& conc) { std::cout << "Twiddling concentration ... " << std::endl; // // First normalize it. // for (int ispec = 0; ispec < conc[0].nComp(); ispec++) { Real c_floor = 0; for (int lev = 0; lev < conc.size(); lev++) { for (MFIter mfi(conc[lev]); mfi.isValid(); ++mfi) { const Box& vb = mfi.validbox(); c_floor = std::max(c_floor,conc[lev][mfi].max(vb,ispec)*conc_epsilon); } } if (ParallelDescriptor::IOProcessor()) { std::cout << "c_floor(" << ispec << "): " << c_floor << std::endl; } for (int lev = 0; lev < conc.size(); lev++) { for (MFIter mfi(conc[lev]); mfi.isValid(); ++mfi) { const long N = conc[lev][mfi].box().numPts(); Real* data = conc[lev][mfi].dataPtr(ispec); for (long i = 0; i < N; i++) { data[i] = std::max(data[i],c_floor); } } } } std::cout << "Done twiddling concentration. " << std::endl; } static void MassageConc () { std::cout << "Massaging concentration ... " << std::endl; // // We've already been Twiddle()d. // We invert it so we can multiply by it instead of divide. // for (int lev = 0; lev < Conc_mf.size(); lev++) { for (MFIter mfi(Conc_mf[lev]); mfi.isValid(); ++mfi) { Conc_mf[lev][mfi].invert(1.0); } } // // We now set those cells covered by fine grid to zero. // This simplified some of our algorithms. // const int Ncomp = Conc_mf[0].nComp(); for (int l = 0; l <= finest_level; l++) { for (MFIter mfi(Conc_mf[l]); mfi.isValid(); ++mfi) { if (l < finest_level) { const BoxArray& f_ba = Conc_mf[l+1].boxArray(); for (int j = 0; j < f_ba.size(); j++) { Box c_box = BoxLib::coarsen(f_ba[j],ref_ratio[l]); if (c_box.intersects(Conc_mf[l][mfi].box())) { Box isect = c_box & Conc_mf[l][mfi].box(); Conc_mf[l][mfi].setVal(0,isect,0,Ncomp); } } } } } std::cout << "Done massaging concentration. " << std::endl; } static void Twiddle_DiffCoeffs () { // // B = A + B; C = A + B + C; D = A + B + C + D; ... // for (int l = 0; l <= finest_level; l++) { for (MFIter mfi(A_mf[l]); mfi.isValid(); ++mfi) { B_mf[l][mfi] += A_mf[l][mfi]; C_mf[l][mfi] += B_mf[l][mfi]; D_mf[l][mfi] += C_mf[l][mfi]; #if BL_SPACEDIM==3 E_mf[l][mfi] += D_mf[l][mfi]; F_mf[l][mfi] += E_mf[l][mfi]; #endif } } } static void ClonePlotfile (AmrData& amrData, PArray& mfout, std::string& oFile, const Array& names) { // // Sink up grow cells under valid region. // for (int i = 0; i < mfout.size(); i++) mfout[i].FillBoundary(); if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(oFile,0755)) BoxLib::CreateDirectoryFailed(oFile); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string oFileHeader(oFile); oFileHeader += "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream os; os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); if (ParallelDescriptor::IOProcessor()) std::cout << "Opening file = " << oFileHeader << '\n'; os.open(oFileHeader.c_str(), std::ios::out|std::ios::binary); if (os.fail()) BoxLib::FileOpenFailed(oFileHeader); // // Start writing plotfile. // os << amrData.PlotFileVersion() << '\n'; int n_var = mfout[0].nComp(); os << n_var << '\n'; for (int n = 0; n < n_var; n++) os << names[n] << '\n'; os << BL_SPACEDIM << '\n'; os << amrData.Time() << '\n'; const int finestLevel = mfout.size() - 1; os << finestLevel << '\n'; for (int i = 0; i < BL_SPACEDIM; i++) os << amrData.ProbLo()[i] << ' '; os << '\n'; for (int i = 0; i < BL_SPACEDIM; i++) os << amrData.ProbHi()[i] << ' '; os << '\n'; for (int i = 0; i < finestLevel; i++) os << amrData.RefRatio()[i] << ' '; os << '\n'; for (int i = 0; i <= finestLevel; i++) os << amrData.ProbDomain()[i] << ' '; os << '\n'; for (int i = 0; i <= finestLevel; i++) os << 0 << ' '; os << '\n'; for (int i = 0; i <= finestLevel; i++) { for (int k = 0; k < BL_SPACEDIM; k++) os << amrData.DxLevel()[i][k] << ' '; os << '\n'; } os << amrData.CoordSys() << '\n'; os << "0\n"; // The bndry data width. // // Write out level by level. // for (int iLevel = 0; iLevel <= finestLevel; ++iLevel) { // // Write state data. // int nGrids = amrData.boxArray(iLevel).size(); char buf[64]; sprintf(buf, "Level_%d", iLevel); if (ParallelDescriptor::IOProcessor()) { os << iLevel << ' ' << nGrids << ' ' << amrData.Time() << '\n'; os << 0 << '\n'; for (int i = 0; i < nGrids; ++i) { for (int n = 0; n < BL_SPACEDIM; n++) { os << amrData.GridLocLo()[iLevel][i][n] << ' ' << amrData.GridLocHi()[iLevel][i][n] << '\n'; } } // // Build the directory to hold the MultiFabs at this level. // std::string Level(oFile); Level += '/'; Level += buf; if (!BoxLib::UtilCreateDirectory(Level, 0755)) BoxLib::CreateDirectoryFailed(Level); } // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); // // Now build the full relative pathname of the MultiFab. // static const std::string MultiFabBaseName("/MultiFab"); std::string PathName(oFile); PathName += '/'; PathName += buf; PathName += MultiFabBaseName; if (ParallelDescriptor::IOProcessor()) { // // The full name relative to the Header file. // std::string RelativePathName(buf); RelativePathName += MultiFabBaseName; os << RelativePathName << '\n'; } // // Write out ghost cells as is ... // VisMF::Write(mfout[iLevel], PathName, VisMF::OneFilePerCPU, false); } os.close(); } static std::vector Tokenize (const std::string& str, const std::string& sep) { std::vector ptr; // // Make copy of line that we can modify. // char* line = new char[str.size()+1]; (void) strcpy(line, str.c_str()); char* token = 0; if (!((token = strtok(line, sep.c_str())) == 0)) { ptr.push_back(token); while (!((token = strtok(0, sep.c_str())) == 0)) ptr.push_back(token); } vector tokens(ptr.size()); for (int i = 1; i < ptr.size(); i++) { char* p = ptr[i]; while (strchr(sep.c_str(),*(p-1)) != 0) *--p = 0; } for (int i = 0; i < ptr.size(); i++) tokens[i] = ptr[i]; delete line; return tokens; } static std::string GetFileRoot (const std::string& infile) { std::vector tokens = Tokenize(infile,std::string("/")); return tokens[tokens.size()-1]; } static void WriteOutPlotFiles (const std::string& infile, ChemKinDriver& ckd, AmrData& amrData, int Nspec, int Nreac, const Array& chemnames, vector& trSp, vector& trRxn) { if (!write_intermediate_plotfiles) return; std::string nfile_conc(GetFileRoot(infile)+"_conc"); Array nnames_conc(Nspec); for (int j = 0; j < Nspec; ++j) nnames_conc[j] = "C(" + chemnames[ckd.index(trSp[j])] + ")"; std::cout << "Writing Concentration to " << nfile_conc << std::endl; ClonePlotfile(amrData,Conc_mf,nfile_conc,nnames_conc); std::string nfile_rf(GetFileRoot(infile)+"_rf"); std::string nfile_rr(GetFileRoot(infile)+"_rr"); Array nnames_rf(Nreac); for (int j = 0; j < Nreac; ++j) nnames_rf[j] = ckd.reactionString(trRxn[j]); std::cout << "Writing Forward Rates to " << nfile_rf << std::endl; ClonePlotfile(amrData,Rf_mf,nfile_rf,nnames_rf); std::cout << "Writing Backward Rates to " << nfile_rr << std::endl; ClonePlotfile(amrData,Rr_mf,nfile_rr,nnames_rf); const char* VelName[3] = { "x_velocity", "y_velocity", "z_velocity" }; std::string nfile_u(GetFileRoot(infile)+"_u"); Array nnames_u(BL_SPACEDIM); for (int j = 0; j < BL_SPACEDIM; ++j) nnames_u[j] = VelName[j]; std::cout << "Writing Velocity to " << nfile_u << std::endl; ClonePlotfile(amrData,U_mf,nfile_u,nnames_u); std::string nfile_a(GetFileRoot(infile)+"_a"); Array nnames_a(Nspec); for (int j = 0; j < Nspec; ++j) nnames_a[j] = "a_" + chemnames[ckd.index(trSp[j])]; std::cout << "Writing A to " << nfile_a << std::endl; ClonePlotfile(amrData,A_mf,nfile_a,nnames_a); std::string nfile_b(GetFileRoot(infile)+"_b"); Array nnames_b(Nspec); for (int j = 0; j < Nspec; ++j) nnames_b[j] = "b_" + chemnames[ckd.index(trSp[j])]; std::cout << "Writing B to " << nfile_b << std::endl; ClonePlotfile(amrData,B_mf,nfile_b,nnames_b); std::string nfile_c(GetFileRoot(infile)+"_c"); Array nnames_c(Nspec); for (int j = 0; j < Nspec; ++j) nnames_c[j] = "c_" + chemnames[ckd.index(trSp[j])]; std::cout << "Writing C to " << nfile_c << std::endl; ClonePlotfile(amrData,C_mf,nfile_c,nnames_c); std::string nfile_d(GetFileRoot(infile)+"_d"); Array nnames_d(Nspec); for (int j = 0; j < Nspec; ++j) nnames_d[j] = "d_" + chemnames[ckd.index(trSp[j])]; std::cout << "Writing D to " << nfile_d << std::endl; ClonePlotfile(amrData,D_mf,nfile_d,nnames_d); #if BL_SPACEDIM==3 std::string nfile_e(GetFileRoot(infile)+"_e"); Array nnames_e(Nspec); for (int j = 0; j < Nspec; ++j) nnames_e[j] = "e_" + chemnames[ckd.index(trSp[j])]; std::cout << "Writing E to " << nfile_e << std::endl; ClonePlotfile(amrData,E_mf,nfile_e,nnames_e); std::string nfile_f(GetFileRoot(infile)+"_f"); Array nnames_f(Nspec); for (int j = 0; j < Nspec; ++j) nnames_f[j] = "f_" + chemnames[ckd.index(trSp[j])]; std::cout << "Writing F to " << nfile_f << std::endl; ClonePlotfile(amrData,E_mf,nfile_f,nnames_f); #endif } static void ReadPlotFile (ChemKinDriver& ckd, const std::string& file) { const int MyProc = ParallelDescriptor::MyProc(); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(file, fileType); if (!dataServices.AmrDataOk()) // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); const int Nlev = amrData.FinestLevel() + 1; const bool use_all_species = false; const Real Patm = 1.0; // // Set some globals ... // is_rz = amrData.CoordSys() == CoordSys::RZ; prob_lo = amrData.ProbLo(); prob_hi = amrData.ProbHi(); ref_ratio = amrData.RefRatio(); prob_domain = amrData.ProbDomain(); finest_level = amrData.FinestLevel(); dx.resize(finest_level+1); dxinv.resize(finest_level+1); geom.resize(finest_level+1); for (int l = 0; l <= finest_level; l++) { dx[l] = amrData.DxLevel()[l]; dxinv[l] = amrData.DxLevel()[l]; for (int i = 0; i < BL_SPACEDIM; i++) dxinv[l][i] = 1.0/dx[l][i]; RealBox rb(prob_lo.dataPtr(),prob_hi.dataPtr()); geom[l].define(prob_domain[l], &rb, amrData.CoordSys()); } // // Reclaim any old memory ... // D_TERM(A_mf.clear();, C_mf.clear();, E_mf.clear();); D_TERM(B_mf.clear();, D_mf.clear();, F_mf.clear();); U_mf.clear(); Rf_mf.clear(); Rr_mf.clear(); Conc_mf.clear(); // // Size our PArrays ... // D_TERM(A_mf.resize(Nlev);, C_mf.resize(Nlev);, E_mf.resize(Nlev);); D_TERM(B_mf.resize(Nlev);, D_mf.resize(Nlev);, F_mf.resize(Nlev);); U_mf.resize(Nlev); Rf_mf.resize(Nlev); Rr_mf.resize(Nlev); Conc_mf.resize(Nlev); const Array plotnames = amrData.PlotVarNames(); const Array chemnames = ckd.speciesNames(); int idT = -1, idX = -1, idU = -1, idR = -1; for (int i = 0; i < plotnames.size(); ++i) { if (plotnames[i] == "temp") idT = i; if (plotnames[i] == "X(" + chemnames[0] + ")" ) idX = i; if (plotnames[i] == "x_velocity") idU = i; if (plotnames[i] == "density") idR = i; } BL_ASSERT(idT >= 0); BL_ASSERT(idX >= 0); BL_ASSERT(idU >= 0); BL_ASSERT(idR >= 0); vector trSp; vector trRx; for (int i = 0; i < chemnames.size(); i++) if (use_all_species || ckd.numberOfElementXinSpeciesY(TraceElement,chemnames[i]) > 0) trSp.push_back(chemnames[i]); for (int i = 0; i < ckd.numReactions(); i++) { if (use_all_species) { trRx.push_back(i); } else { std::map net; Array< std::pair > coef = ckd.specCoeffsInReactions(i); for (int j = 0; j < coef.size(); j++) { const int co = coef[j].second; const std::string& sp = coef[j].first; if (std::count(trSp.begin(),trSp.end(),sp) > 0) { if (net.find(sp) == net.end()) { net[sp] = co; } else { net[sp] += co; if (net[sp] == 0) net.erase(sp); } } } if (!net.empty()) trRx.push_back(i); } } // // Got to set init_spec. // init_spec = -1; for (int i = 0; i < trSp.size(); i++) if (chemnames[ckd.index(trSp[i])] == InitialSpecies) init_spec = i; BL_ASSERT(init_spec != -1); std::cout << "init_spec = " << init_spec << std::endl; const int Nspec = trSp.size(); const int Nreac = trRx.size(); std::cout << "Nspec = " << Nspec << std::endl; std::cout << "Nreac = " << Nreac << std::endl; for (int i = 0; i < trSp.size(); i++) std::cout << i << ": " << chemnames[ckd.index(trSp[i])] << std::endl; Array rxnIDs(Nreac); for (int i = 0; i < Nreac; i++) rxnIDs[i] = trRx[i]; FArrayBox tmpfab; PArray temp(Nlev,PArrayManage); PArray mole(Nlev,PArrayManage); for (int lev = 0; lev < Nlev; ++lev) { temp.set(lev,new MultiFab(amrData.boxArray(lev),1,1)); mole.set(lev,new MultiFab(amrData.boxArray(lev),ckd.numSpecies(),1)); std::cout << "Reading mole & temp data at lev=" << lev << " ... " << std::flush; temp[lev].copy(amrData.GetGrids(lev,idT),0,0,1); amrData.FlushGrids(idT); for (int j = 0; j < ckd.numSpecies(); ++j) { mole[lev].copy(amrData.GetGrids(lev,idX+j),0,j,1); amrData.FlushGrids(idX+j); } for (MFIter mfi(mole[lev]); mfi.isValid(); ++mfi) { const Box& box = mfi.validbox(); int ncompM = mole[lev].nComp(); int ncompT = temp[lev].nComp(); FORT_PUSHVTOG(box.loVect(),box.hiVect(), box.loVect(), box.hiVect(), temp[lev][mfi].dataPtr(), ARLIM(temp[lev][mfi].loVect()), ARLIM(temp[lev][mfi].hiVect()),&ncompT); FORT_PUSHVTOG(box.loVect(),box.hiVect(), box.loVect(), box.hiVect(), mole[lev][mfi].dataPtr(), ARLIM(mole[lev][mfi].loVect()), ARLIM(mole[lev][mfi].hiVect()),&ncompM); } temp[lev].FillBoundary(); mole[lev].FillBoundary(); geom[lev].FillPeriodicBoundary(temp[lev]); geom[lev].FillPeriodicBoundary(mole[lev]); for (MFIter mfi(mole[lev]); mfi.isValid(); ++mfi) { FArrayBox& x = mole[lev][mfi]; FArrayBox& t = temp[lev][mfi]; Box bx = t.box() & amrData.ProbDomain()[lev]; ckd.moleFracToMassFrac(x,x,bx,0,0); ckd.normalizeMassFrac(x,x,"N2",bx,0,0); ckd.massFracToMolarConc(x,x,t,Patm,bx,0,0,0); // // mole now contains concentration ... // } std::cout << "done" << std::endl; } // // Got to twiddle the concentration. // Then save the twiddle'd concentration into Conc_mf. // Then convert the twiddle'd concentration back to mole fractions. // TwiddleConc(mole); for (int lev = 0; lev < mole.size(); lev++) { mole[lev].FillBoundary(); geom[lev].FillPeriodicBoundary(mole[lev]); } for (int lev = 0; lev < Nlev; ++lev) { std::cout << "Building Conc lev=" << lev << " ... " << std::flush; Conc_mf.set(lev,new MultiFab(amrData.boxArray(lev),Nspec,0)); for (MFIter mfi(mole[lev]); mfi.isValid(); ++mfi) { FArrayBox& c = Conc_mf[lev][mfi]; FArrayBox& x = mole[lev][mfi]; for (int i = 0; i < Nspec; i++) c.copy(x,ckd.index(trSp[i]),i,1); ckd.molarConcToMoleFrac(x,x,x.box(),0,0); // // mole now contains twiddle'd mole fractions. // } std::cout << "done" << std::endl; } for (int lev = 0; lev < Nlev; ++lev) { std::cout << "Building Rf & Rr lev=" << lev << " ... " << std::flush; Rf_mf.set(lev,new MultiFab(amrData.boxArray(lev),Nreac,0)); Rr_mf.set(lev,new MultiFab(amrData.boxArray(lev),Nreac,0)); for (MFIter mfi(mole[lev]); mfi.isValid(); ++mfi) { FArrayBox& f = Rf_mf[lev][mfi]; FArrayBox& r = Rr_mf[lev][mfi]; FArrayBox& t = temp[lev][mfi]; FArrayBox& x = mole[lev][mfi]; Box bx = t.box() & amrData.ProbDomain()[lev]; ckd.fwdRevReacRatesGivenXTP(f,r,rxnIDs,x,t,Patm,bx,0,0,0,0); ckd.moleFracToMassFrac(x,x,bx,0,0); ckd.normalizeMassFrac(x,x,"N2",bx,0,0); // // mole now contains mass fractions!!! // } std::cout << "done" << std::endl; } // // Now do velocity ... // for (int lev = 0; lev < Nlev; ++lev) { U_mf.set(lev,new MultiFab(amrData.boxArray(lev),BL_SPACEDIM,0)); std::cout << "Reading velocity data at lev=" << lev << " ... " << std::flush; for (int j = 0; j < BL_SPACEDIM; ++j) { U_mf[lev].copy(amrData.GetGrids(lev,idU+j),0,j,1); amrData.FlushGrids(idU+j); } std::cout << "done" << std::endl; } // // Now do a, b, c & d ... // for (int lev = 0; lev < Nlev; ++lev) { FArrayBox rho, rhoDr; D_TERM(A_mf.set(lev,new MultiFab(amrData.boxArray(lev),Nspec,0));, C_mf.set(lev,new MultiFab(amrData.boxArray(lev),Nspec,0));, E_mf.set(lev,new MultiFab(amrData.boxArray(lev),Nspec,0));); D_TERM(B_mf.set(lev,new MultiFab(amrData.boxArray(lev),Nspec,0));, D_mf.set(lev,new MultiFab(amrData.boxArray(lev),Nspec,0));, F_mf.set(lev,new MultiFab(amrData.boxArray(lev),Nspec,0));); std::cout << "Building Diffusion Coefficients at lev=" << lev << " ... " << std::flush; // // We have temp and mass fractions over grow cells within ProbDomain. // for (MFIter mfi(mole[lev]); mfi.isValid(); ++mfi) { Box bx = mole[lev][mfi].box() & amrData.ProbDomain()[lev]; rho.resize(bx,1); rhoDr.resize(bx,ckd.numSpecies()); rho.setVal(0); rhoDr.setVal(0); amrData.FillVar(&rho,bx,lev,plotnames[idR],MyProc); ckd.getMixAveragedRhoDiff(rhoDr,mole[lev][mfi],temp[lev][mfi],Patm,bx,0,0,0); IntVect se = bx.smallEnd(); IntVect be = bx.bigEnd(); D_TERM(const Real dx = amrData.DxLevel()[lev][0];, const Real dy = amrData.DxLevel()[lev][1];, const Real dz = amrData.DxLevel()[lev][2];); #if BL_SPACEDIM==2 if (is_rz) { FArrayBox getR; getR.resize(bx,1); getR.setVal(0); // // Set rhoDr to rhodiff*r // const Real dr = amrData.DxLevel()[lev][0]; for (int i = se[0]; i <= be[0]; i++) { IntVect sbse = IntVect(i,se[1]); IntVect sbbe = IntVect(i,be[1]); getR.setVal((i+0.5)*dr,Box(sbse,sbbe),0,1); } for (int i = 0; i < ckd.numSpecies(); i++) rhoDr.mult(getR,0,i,1); // // Set rho to rho*r*dr*dr*2 // for (int i = se[0]; i <= be[0]; i++) { const IntVect sbse = IntVect(i,se[1]); const IntVect sbbe = IntVect(i,be[1]); getR.setVal((i+0.5)*dr*dr*dr*2,Box(sbse,sbbe),0,1); } rho.mult(getR); } #endif tmpfab.resize(bx,1); for (int i = 0; i < Nspec; i++) { tmpfab.copy(rhoDr,ckd.index(trSp[i]),0,1); D_TERM(FArrayBox& afab = A_mf[lev][mfi];, FArrayBox& cfab = C_mf[lev][mfi];, FArrayBox& efab = E_mf[lev][mfi];); D_TERM(FArrayBox& bfab = B_mf[lev][mfi];, FArrayBox& dfab = D_mf[lev][mfi];, FArrayBox& ffab = F_mf[lev][mfi];); afab.copy(tmpfab,0,i,1); tmpfab.shift(0,1); afab.plus(tmpfab,0,i,1); tmpfab.shift(0,-1); afab.divide(rho,0,i,1); bfab.copy(tmpfab,0,i,1); tmpfab.shift(0,-1); bfab.plus(tmpfab,0,i,1); tmpfab.shift(0,1); bfab.divide(rho,0,i,1); cfab.copy(tmpfab,0,i,1); tmpfab.shift(1,1); cfab.plus(tmpfab,0,i,1); tmpfab.shift(1,-1); cfab.divide(rho,0,i,1); dfab.copy(tmpfab,0,i,1); tmpfab.shift(1,-1); dfab.plus(tmpfab,0,i,1); tmpfab.shift(1,1); dfab.divide(rho,0,i,1); #if BL_SPACEDIM==3 efab.copy(tmpfab,0,i,1); tmpfab.shift(2,1); efab.plus(tmpfab,0,i,1); tmpfab.shift(2,-1); efab.divide(rho,0,i,1); ffab.copy(tmpfab,0,i,1); tmpfab.shift(2,-1); ffab.plus(tmpfab,0,i,1); tmpfab.shift(2,1); ffab.divide(rho,0,i,1); #endif if (!is_rz) { D_TERM(afab.divide(dx*dx*2,i,1);, cfab.divide(dy*dy*2,i,1);, efab.divide(dz*dz*2,i,1);); D_TERM(bfab.divide(dx*dx*2,i,1);, dfab.divide(dy*dy*2,i,1);, ffab.divide(dz*dz*2,i,1);); } } } amrData.FlushGrids(idR); const Box& domain = amrData.ProbDomain()[lev]; // // Zero out diffusion coefficients on physical // boundary, unless we're periodic in that direction. // if (!geom[lev].isPeriodic(0)) { A_mf[lev].setVal(0,domain & Box(domain).shift(0,-domain.length(0)+1),0,Nspec,0); B_mf[lev].setVal(0,domain & Box(domain).shift(0, domain.length(0)-1),0,Nspec,0); } if (!geom[lev].isPeriodic(1)) { C_mf[lev].setVal(0,domain & Box(domain).shift(1,-domain.length(1)+1),0,Nspec,0); D_mf[lev].setVal(0,domain & Box(domain).shift(1, domain.length(1)-1),0,Nspec,0); } #if BL_SPACEDIM==3 if (!geom[lev].isPeriodic(2)) { E_mf[lev].setVal(0,domain & Box(domain).shift(2,-domain.length(2)+1),0,Nspec,0); F_mf[lev].setVal(0,domain & Box(domain).shift(2, domain.length(2)-1),0,Nspec,0); } #endif std::cout << "done" << std::endl; } WriteOutPlotFiles(file,ckd,amrData,Nspec,Nreac,chemnames,trSp,trRx); MassageConc(); Twiddle_DiffCoeffs(); // // Some sanity checks ... // BL_ASSERT(A_mf.size() == B_mf.size()); BL_ASSERT(A_mf.size() == C_mf.size()); BL_ASSERT(A_mf.size() == D_mf.size()); BL_ASSERT(A_mf.size() == U_mf.size()); BL_ASSERT(A_mf.size() == Rf_mf.size()); BL_ASSERT(A_mf.size() == Rr_mf.size()); BL_ASSERT(A_mf.size() == Conc_mf.size()); BL_ASSERT(A_mf[0].boxArray() == B_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == C_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == D_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == U_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == Rf_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == Rr_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == Conc_mf[0].boxArray()); // // Print out some stuff ... // if (ParallelDescriptor::IOProcessor()) { std::cout << "finest_level = " << finest_level << '\n'; for (int l = 0; l <= finest_level; l++) { std::cout << "dx[" << l << "]: "; for (int i = 0; i < BL_SPACEDIM; i++) std::cout << dx[l][i] << ' '; std::cout << '\n'; std::cout << "prob_domain[" << l << "]: " << prob_domain[l] << '\n'; } std::cout << "ref_ratio: "; for (int l = 0; l < finest_level; l++) std::cout << ref_ratio[l] << ' '; std::cout << '\n'; } } static void WriteEvent (int part, X& xpos, int spec, int reac, Real time, std::ostream& eofs) { if (do_not_write_events) return; // int oprec = eofs.precision(20); eofs << part << ' '; for (int i = 0; i < BL_SPACEDIM; i++) { eofs << xpos[i] << ' '; } // eofs.precision(oprec); eofs << spec << ' ' << reac << ' ' << time << '\n'; if (!eofs.good()) BoxLib::Abort("Problem with the event output file"); } static void WriteTrajectory (int particleNo, const std::vector& trajectory, std::ofstream& traj_ofs) { if (do_not_write_trajs) return; // // Only write out every N ... // const int N = 25; traj_ofs << particleNo << ":\n"; for (int i = 0; i < trajectory.size(); i++) { if (i % N == 0) { traj_ofs << trajectory[i][0] << ' ' << trajectory[i][1] << ' ' << trajectory[i][2] << '\n'; } } if (!traj_ofs.good()) BoxLib::Abort("Problem with the trajectory file"); } static void UpdateTrajectory (const X& x, Real t, std::vector& traj) { if (do_not_write_trajs) return; PartPos p; D_TERM(p[0] = x[0];, p[1] = x[1];, p[2] = x[2];) p[BL_SPACEDIM] = t; traj.push_back(p); } static void MaxLambda () { if (ParallelDescriptor::IOProcessor()) std::cout << "Calculating Max Lambda ..." << std::endl; const int nspec = pedges.size(); BL_ASSERT(nspec == Conc_mf[0].nComp()); BL_ASSERT(finest_level+1 == Conc_mf.size()); // // Now do the appropriate computation over levels using C_tmp. // // This relies on the Concentration being zero'd under fine grids. // for (int spec = 0; spec < nspec; spec++) { Real lmax = 0; const int start = pedges[spec]; const int nedge = edgedata[start]; for (int l = 0; l <= finest_level; l++) { const MultiFab& Rf = Rf_mf[l]; const MultiFab& Rr = Rr_mf[l]; const MultiFab& Conc = Conc_mf[l]; for (MFIter mfi(Conc); mfi.isValid(); ++mfi) { const Box& bx = Conc[mfi].box(); const FArrayBox& rf = Rf[mfi]; const FArrayBox& rr = Rr[mfi]; const FArrayBox& conc = Conc[mfi]; for (IntVect p = bx.smallEnd(); p <= bx.bigEnd(); bx.next(p)) { Real lambda = 0; for (int ie = 0; ie < nedge; ie++) { const int rxnid = edgedata[start+ie*4+1]; const int factor = edgedata[start+ie*4+2]; const int nu = edgedata[start+ie*4+4]; const Real X = nu*conc(p,spec)/factor; if (factor > 0) { lambda += X*rf(p,rxnid); } else { lambda -= X*rr(p,rxnid); } } lmax = std::max(lmax,lambda); } } } if (ParallelDescriptor::IOProcessor()) { std::cout << "spec = " << spec << ", lmax = " << lmax << std::endl; } } exit(0); } static void MaxDtLambda (int spec, Real& dt, int lev, int idx, const IntVect& iv) { Real lambda = 0; const int start = pedges[spec]; const int nedge = edgedata[start]; const FArrayBox& rf = Rf_mf[lev][idx]; const FArrayBox& rr = Rr_mf[lev][idx]; const FArrayBox& conc = Conc_mf[lev][idx]; for (int ie = 0; ie < nedge; ie++) { const int rxnid = edgedata[start+ie*4+1]; const int factor = edgedata[start+ie*4+2]; const int nu = edgedata[start+ie*4+4]; const Real X = nu*conc(iv,spec)/factor; if (factor > 0) { lambda += X*rf(iv,rxnid); } else { lambda -= X*rr(iv,rxnid); } } if (lambda > 0) dt = std::min(dt,chem_limiter/lambda); } static void Chemistry (int& spec, int& rxn, Real dt, int lev, int idx, const IntVect& iv, BoxLib::mt19937& rand) { const Real rn = rand.d1_value(); Real lambda = 0; const int start = pedges[spec]; const int nedge = edgedata[start]; const FArrayBox& rf = Rf_mf[lev][idx]; const FArrayBox& rr = Rr_mf[lev][idx]; const FArrayBox& conc = Conc_mf[lev][idx]; for (int ie = 0; ie < nedge; ie++) { const int rxnid = edgedata[start+ie*4+1]; const int factor = edgedata[start+ie*4+2]; const int tospec = edgedata[start+ie*4+3]; const int nu = edgedata[start+ie*4+4]; const Real X = nu*conc(iv,spec)*dt/factor; if (factor > 0) { lambda += X*rf(iv,rxnid); } else { lambda -= X*rr(iv,rxnid); } if (rn < lambda) { rxn = rxnid; spec = tospec; break; } } } static IntVect Index (const X& x, int lev) { IntVect iv; D_TERM(iv[0]=int((x[0]-prob_lo[0])*dxinv[lev][0]);, iv[1]=int((x[1]-prob_lo[1])*dxinv[lev][1]);, iv[2]=int((x[2]-prob_lo[2])*dxinv[lev][2]);); iv += prob_domain[lev].smallEnd(); return iv; } static bool Where (const X& x, int& lev, int& idx, IntVect& iv) { for (lev = finest_level; lev >= 0; lev--) { iv = Index(x,lev); const BoxArray& ba = A_mf[lev].boxArray(); for (idx = 0; idx < ba.size(); idx++) if (ba[idx].contains(iv)) return true; } return false; } static void GetInitialPosition (int& spec, int rxn, Real t, std::vector& traj, int i, X& x, IntVect& iv, int& lev, int& idx, std::ostream& eofs, BoxLib::mt19937& rand) { // D_TERM(x[0]=(build_prob_dist?0:RandomXPos(rand));,x[1]=init_y;,x[2]=init_z;) // x[0]=.0115; // x[1]=.01 + .0075 * rand.d1_value(); D_TERM(x[0]=init_x;, x[1]=init_y;, x[2]=init_z;); if (build_prob_dist) { const Real rn = rand.d1_value(); // // Find level and index in Prob_mf containing appropriate probability. // int l, i; // // Find first AccumProb[lev][idx] combo >= rn ... // for (l = 0; l <= finest_level; l++) for (i = 0; i < AccumProb[l].size(); i++) if (rn <= AccumProb[l][i]) goto gotit; gotit: BL_ASSERT(l >= 0 && l <= finest_level); BL_ASSERT(i >= 0 && i < AccumProb[l].size()); const FArrayBox& Prob = Prob_mf[l][i]; const int* p_lo = Prob.box().loVect(); const int* p_hi = Prob.box().hiVect(); FORT_SELECTPOS(Prob.dataPtr(), ARLIM(p_lo), ARLIM(p_hi), &rn, D_DECL(&dx[l][0],&dx[l][1],&dx[l][2]), D_DECL(&x[0],&x[1],&x[2])); } UpdateTrajectory(x,t,traj); WriteEvent(i,x,spec,rxn,t,eofs); // // Now that we have x set lev, idx and iv ... // bool found = Where(x,lev,idx,iv); BL_ASSERT(found == true); if (build_prob_dist) { Real dt_tmp = 1.0e20; MaxDtLambda(spec,dt_tmp,lev,idx,iv); dt_tmp *= 10; const int old_spec = spec; Chemistry(spec,rxn,dt_tmp,lev,idx,iv,rand); if (spec != old_spec) WriteEvent(i,x,spec,rxn,t,eofs); } } static void BuildProbDist () { Prob_mf.resize(finest_level+1); AccumProb.resize(finest_level+1); for (int l = 0; l <= finest_level; l++) { Prob_mf.set(l, new MultiFab(A_mf[l].boxArray(),1,0)); AccumProb[l].resize(Prob_mf[l].size(),0); Prob_mf[l].setVal(0); } const int elen = edgedata.size(); const int nspec = pedges.size(); const int nreac = Rf_mf[0].nComp(); for (int l = 0; l <= finest_level; l++) { for (MFIter mfi(Prob_mf[l]); mfi.isValid(); ++mfi) { const int* a_lo = Rf_mf[l][mfi].box().loVect(); const int* a_hi = Rf_mf[l][mfi].box().hiVect(); const int* p_lo = Prob_mf[l][mfi].box().loVect(); const int* p_hi = Prob_mf[l][mfi].box().hiVect(); FORT_PROBFAB(Rf_mf[l][mfi].dataPtr(), ARLIM(a_lo), ARLIM(a_hi), Rr_mf[l][mfi].dataPtr(), Prob_mf[l][mfi].dataPtr(), ARLIM(p_lo), ARLIM(p_hi), &nspec, &nreac, &init_spec, (int*)&edgedata[0], &elen, pedges.dataPtr(), &is_rz, D_DECL(&dx[l][0],&dx[l][1],&dx[l][2])); if (l < finest_level) { const BoxArray& f_ba = Prob_mf[l+1].boxArray(); for (int j = 0; j < f_ba.size(); j++) { Box c_box = BoxLib::coarsen(f_ba[j],ref_ratio[l]); if (c_box.intersects(Prob_mf[l][mfi].box())) { Box isect = c_box & Prob_mf[l][mfi].box(); Prob_mf[l][mfi].setVal(0,isect,0); } } } } } Real totreact = 0; for (int l = 0; l <= finest_level; l++) for (MFIter mfi(Prob_mf[l]); mfi.isValid(); ++mfi) totreact += Prob_mf[l][mfi].sum(0); Real cumprob = 0; for (int l = 0; l <= finest_level; l++) { for (MFIter mfi(Prob_mf[l]); mfi.isValid(); ++mfi) { const int* p_lo = Prob_mf[l][mfi].box().loVect(); const int* p_hi = Prob_mf[l][mfi].box().hiVect(); FORT_ACCUMPROB(Prob_mf[l][mfi].dataPtr(), ARLIM(p_lo), ARLIM(p_hi), &totreact, &cumprob); } } if (ParallelDescriptor::IOProcessor()) { std::cout << "cumulative probability: " << cumprob << std::endl; } totreact = 0; for (int l = 0; l <= finest_level; l++) { for (MFIter mfi(Prob_mf[l]); mfi.isValid(); ++mfi) { totreact += Prob_mf[l][mfi].sum(0); AccumProb[l][mfi.index()] = totreact; } } // // Force sum to 1 just to be safe !!! // AccumProb[finest_level][AccumProb[finest_level].size()-1] = 1; } static void MaxOverBox (int spec, int lev, const Box& bx, Real& dmax) { const MultiFab& mf = (BL_SPACEDIM == 2) ? D_mf[lev] : F_mf[lev]; for (MFIter mfi(mf); mfi.isValid(); ++mfi) { const FArrayBox& fab = mf[mfi]; const Box ibx = bx & fab.box(); if (ibx.ok()) { for (IntVect p = ibx.smallEnd(); p <= ibx.bigEnd(); ibx.next(p)) { dmax = std::max(dmax,fab(p,spec)); } } } } static void MaxDtDiffusion (int spec, Real& dt, const IntVect& iv, int lev) { Box bx(iv,iv); Real dmax = 0; MaxOverBox(spec, lev, BoxLib::grow(bx,2), dmax); if (lev < finest_level) { MaxOverBox(spec, lev+1, BoxLib::grow(BoxLib::refine(bx,ref_ratio[lev]),2), dmax); } if (dmax > 0) dt = std::min(dt,0.1/dmax); } static void UpdateCellPosition (X& x, int& lev, int& idx, IntVect& iv, const IntVect& iv_tmp, bool& calc_diff_dt, bool& out_of_bounds) { if (!prob_domain[lev].contains(iv_tmp)) { out_of_bounds = true; } else { calc_diff_dt = true; const FArrayBox& c = Conc_mf[lev][idx]; if (c.box().contains(iv_tmp) && c(iv_tmp,0) > 0) { // // Recall that concentration is nonzero except under // fine grid. If we got here we must still be in the // same fab. That it to say, lev and idx are OK, just // set iv. // iv = iv_tmp; } else { bool found = Where(x,lev,idx,iv); BL_ASSERT(found == true); } } } static void TwiddlePosition (X& x, int lev) { if (is_rz) { if (x[0] < 0) { x[0] = -x[0]; } } else if (geom[lev].isAnyPeriodic()) { for (int i = 0; i < BL_SPACEDIM; i++) { if (geom[lev].isPeriodic(i) && x[i] < prob_lo[i]) { x[i] = prob_hi[i] - (prob_lo[i] - x[i]); } if (geom[lev].isPeriodic(i) && x[i] > prob_hi[i]) { x[i] = prob_lo[i] + (x[i] - prob_hi[i]); } } } } static void AdvanceParticles (int tid, int beg, int cnt, Real dt, Real tstrt, Real tstop, Array& particles, Array& species, BoxLib::mt19937& rand, std::ofstream& eofs, std::ofstream& tofs) { const int NoReac = -1; const Real dtsave = dt; for (int i = beg; i < cnt+beg; i++) { X x = particles[i]; Real t = tstrt; int rxn = NoReac; int spec = species[i]; bool reacted = dt_spec < 0 ? true : false; bool calc_diff_dt = true; bool out_of_bounds = false; Real dt_diff_save = dtsave; int lev; // What level in the AmrData hierarchy? int idx; // What index into BoxArray at that level? IntVect iv; // What cell position in that Box? IntVect iv_tmp; std::vector traj; if (t == strt_time) { // // This sets x, iv, lev and idx (among possibly others) ... // GetInitialPosition(spec,rxn,t,traj,i,x,iv,lev,idx,eofs,rand); } else if (!Where(x,lev,idx,iv)) { // // This particles is already done. // Don't output any more stuff to the Event/Traj files. // goto skip; } while (t < tstop) { dt = dt_diff_save; // // Get maximum dt for diffusion. // if (calc_diff_dt) { dt = dtsave; MaxDtDiffusion(spec,dt,iv,lev); dt_diff_save = dt; calc_diff_dt = false; } dt = std::min(dt,tstop-t); // // Advect x ... // D_TERM(x[0]+=U_mf[lev][idx](iv,0)*dt;, x[1]+=U_mf[lev][idx](iv,1)*dt;, x[2]+=U_mf[lev][idx](iv,2)*dt;); // // Do appropriate boundary manipulations. // TwiddlePosition(x,lev); iv_tmp = Index(x,lev); if (!(iv == iv_tmp)) { UpdateCellPosition(x,lev,idx,iv,iv_tmp,calc_diff_dt,out_of_bounds); if (out_of_bounds) goto done; } // // Diffuse x ... // const Real rn = rand.d1_value(); if (rn < A_mf[lev][idx](iv,spec)*dt) x[0] -= dx[lev][0]; else if (rn < B_mf[lev][idx](iv,spec)*dt) x[0] += dx[lev][0]; else if (rn < C_mf[lev][idx](iv,spec)*dt) x[1] -= dx[lev][1]; else if (rn < D_mf[lev][idx](iv,spec)*dt) x[1] += dx[lev][1]; #if BL_SPACEDIM==3 else if (rn < E_mf[lev][idx](iv,spec)*dt) x[2] -= dx[lev][2]; else if (rn < F_mf[lev][idx](iv,spec)*dt) x[2] += dx[lev][2]; #endif t += dt; // // Do appropriate boundary manipulations. // TwiddlePosition(x,lev); iv_tmp = Index(x,lev); if (!(iv == iv_tmp)) { UpdateCellPosition(x,lev,idx,iv,iv_tmp,calc_diff_dt,out_of_bounds); if (out_of_bounds) goto done; UpdateTrajectory(x,t,traj); } // // The particle does not move from here on down. // Real t_chem = 0; Real dt_chem = dt; bool calc_chem_dt = true; do { if (calc_chem_dt) { dt_chem = dt; calc_chem_dt = false; MaxDtLambda(spec,dt_chem,lev,idx,iv); } dt_chem = std::min(dt_chem,dt-t_chem); if (!reacted) dt_chem = dt_spec; const int old_spec = spec; Chemistry(spec,rxn,dt_chem,lev,idx,iv,rand); if (spec != old_spec) { reacted = calc_chem_dt = true; WriteEvent(i,x,spec,rxn,t,eofs); } t_chem += dt_chem; } while (t_chem < dt); } done: if (out_of_bounds || t >= stop_time) WriteEvent(i,x,spec,NoReac,t,eofs); UpdateTrajectory(x,t,traj); if (spec != init_spec) WriteTrajectory(i,traj,tofs); skip: species[i] = spec; particles[i] = x; } } class task_advance : public WorkQueue::task { public: task_advance (int tid, int beg, int cnt, Real dt, Real t_strt, Real t_stop, Array& particles, Array& species, BoxLib::mt19937& rn, std::ofstream& eofs, std::ofstream& tofs) : m_tid(tid), m_beg(beg), m_cnt(cnt), m_dt(dt), m_tstrt(t_strt), m_tstop(t_stop), m_particles(particles), m_species(species), m_rn(rn), m_eofs(eofs), m_tofs(tofs) {} virtual void run (); private: int m_tid; int m_beg; int m_cnt; Real m_dt; Real m_tstrt; Real m_tstop; Array& m_particles; Array& m_species; BoxLib::mt19937& m_rn; std::ofstream& m_eofs; std::ofstream& m_tofs; }; void task_advance::run () { AdvanceParticles(m_tid, m_beg, m_cnt, m_dt, m_tstrt, m_tstop, m_particles, m_species, m_rn, m_eofs, m_tofs); } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc < 2) PrintUsage(argv[0]); const Real run_strt = ParallelDescriptor::second(); const int NProcs = ParallelDescriptor::NProcs(); const int MyProc = ParallelDescriptor::MyProc(); const int IOProc = ParallelDescriptor::IOProcessorNumber(); ScanArguments(); ChemKinDriver ckd(chemInFile,chemOutFile,thermInFile,tranInFile); Real plt_time = 0; // Time spent reading plot files. Array particles(n_particles); Array species(n_particles); int nthreads = BoxLib::theWorkQueue().max_threads(); if (nthreads == 0) nthreads = 1; PArray rn(nthreads,PArrayManage); for (int tid = 0; tid < nthreads; tid++) rn.set(tid,new BoxLib::mt19937(seed+tid*101)); PArray eofs(nthreads,PArrayManage); PArray tofs(nthreads,PArrayManage); for (int tid = 0; tid < nthreads; tid++) { eofs.set(tid,new std::ofstream); tofs.set(tid,new std::ofstream); // // Append node & thread id to file names ... // std::string EFile = EventFile; std::string TFile = TrajFile; char buf[12]; sprintf(buf, ".%02d.%02d", ParallelDescriptor::MyProc(), tid); TFile += buf; EFile += buf; if (!do_not_write_events) { eofs[tid].open(EFile.c_str(), std::ios::trunc|std::ios::out); if (!eofs[tid].good()) BoxLib::FileOpenFailed(EFile); } if (!do_not_write_trajs) { tofs[tid].open (TFile.c_str(),std::ios::trunc|std::ios::out); if (!tofs[tid].good()) BoxLib::FileOpenFailed(TFile); } } const int ParticlesPerNode = n_particles / NProcs; const int ParticlesPerThread = ParticlesPerNode / nthreads; for (int n = 0; n < PlotFiles.size(); n++) { Real plt_strt = ParallelDescriptor::second(); ReadPlotFile(ckd,PlotFiles[n]); plt_time += (ParallelDescriptor::second()-plt_strt); if (n == 0) { ReadEdgeData(); BL_ASSERT(pedges.size() == Conc_mf[0].nComp()); BL_ASSERT(pedges.size() > 0 && edgedata.size() > 0); // // init_spec has been set ... // for (int i = 0; i < species.size(); i++) species[i] = init_spec; if (calc_lambda_max) MaxLambda(); if (build_prob_dist) BuildProbDist(); BuildLookupTable(); } for (int tid = 0; tid < nthreads; tid++) { int cnt = ParticlesPerThread; int beg = ParticlesPerNode * MyProc + cnt * tid; if (tid == nthreads - 1) { // // Last thread per node gets remaining per node particles. // cnt += ParticlesPerNode % nthreads; if (NProcs > 1 && MyProc == NProcs - 1) // // Last thread in last node gets all remaining particles. // cnt += n_particles % NProcs; } std::cout << "Thread: " << tid << ", node: " << MyProc << ", particles: [" << beg << ',' << beg+cnt << ")\n"; const Real tstrt = (n == 0 ? strt_time : TimeSteps[n-1]); const Real tstop = TimeSteps[n]; BoxLib::theWorkQueue().add(new task_advance(tid, beg, cnt, dt, tstrt, tstop, particles, species, rn[tid], eofs[tid], tofs[tid])); } BoxLib::theWorkQueue().wait(); // // Flush the output files after each interval. // This'll make it a tad nicer when tail'ing the output files. // for (int tid = 0; tid < nthreads; tid++) { if (!do_not_write_trajs) tofs[tid].flush(); if (!do_not_write_events) eofs[tid].flush(); } } Real run_stop = ParallelDescriptor::second() - run_strt; ParallelDescriptor::ReduceRealMax(run_stop, IOProc); if (ParallelDescriptor::IOProcessor()) { std::cout << "\n**Run time = " << run_stop << "\n**Avg Runtime/Particle: " << (run_stop-plt_time)/n_particles << std::endl; } BoxLib::Finalize(); } ccseapps-2.5/CCSEApps/pAmrDerive/IsoFromFlattened.cpp0000644000175000017500000007515211634153073023640 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ //BL_COPYRIGHT_NOTICE #include #include #include #include #include #include #include #include #include using std::cout; using std::endl; #ifndef WIN32 #include #endif #include "ParmParse.H" #include "ParallelDescriptor.H" #include "Utility.H" #include "FArrayBox.H" static Real isoVal_DEF = 1090.; static int isoComp_DEF = 3; typedef Array Point; typedef std::pair PPair; typedef std::map > PMap; typedef PMap::iterator PMapIt; static PMap vertCache; struct Triangle { Triangle() : p(3), mArea(-1) {} Real Area(); const PMapIt& operator[] (size_t n) const { return p[n]; } PMapIt& operator[] (size_t n) { return p[n]; } static int xComp,yComp,zComp; Array p; private: void my_area(); Real mArea; }; PMapIt VertexInterp(Real isoVal,int isoComp,const Point& p1,const Point& p2); Array Polygonise(const Array& cell,Real isolevel,int isoComp); static vector Tokenize (const std::string& instr, const std::string& separators); static std::string parseTitle(istream& is); static vector parseVarNames(istream& is); static std::string rootName(const std::string in); static void print_usage (int, char* argv[]) { std::cerr << "usage:\n"; std::cerr << argv[0] << " infile [options] \n\tOptions:\n"; std::cerr << "\t help=# ]\n"; std::cerr << "\t isoval=v [DEF->" << isoVal_DEF << "]\n"; std::cerr << "\t isoComp=n [DEF->" << isoComp_DEF<< "]\n"; exit(1); } void main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc < 2) print_usage(argc,argv); ParmParse pp; if (pp.contains("help")) print_usage(argc,argv); std::string infile; pp.get("infile",infile); std::ifstream ifs; std::istream* is = (infile=="-" ? (std::istream*)(&cin) : (std::istream*)(&ifs) ); if (infile!="-") { cerr << "Opening " << infile << endl; ifs.open(infile.c_str(),std::ios::in); if (ifs.fail()) cerr << "Unable to open file : " << infile << endl; } else { std::cerr << "Reading from stream" << std::endl; } const std::string title = parseTitle(*is); const vector names = parseVarNames(*is); const int nComp = names.size(); int nElts,MYLEN; char n; (*is) >> nElts; (*is) >> MYLEN; FArrayBox nodeFab; nodeFab.readFrom((*is)); Real* nodeData = nodeFab.dataPtr(); const int nNodes = nodeFab.box().length(0)/nComp; cerr << nNodes << " nodes read in with " << nComp << " states per node" << endl; Array connData(nElts*MYLEN,0); (*is).read(connData.dataPtr(),sizeof(int)*connData.size()); cerr << nElts << " elements read in with " << MYLEN << " nodes per element" << endl; if (infile!="-") { cerr << "Closing " << infile << endl; ifs.close(); } Real Area = 0; Real isoVal = isoVal_DEF; pp.query("isoVal",isoVal); int isoComp = isoComp_DEF; pp.query("isoComp",isoComp); Array cell(MYLEN); Array triangles; for (int i=0; i eltTris = Polygonise(cell,isoVal,isoComp); for (int j=0; j=0 && xComp=0 && yComp=0 && yComp=0 && isoComp Polygonise(const Array& cell,Real isoVal,int isoComp) { int i,ntriang; int cubeindex; BL_ASSERT(cell.size()==8); Array vertlist(12); Array triangles; // result int edgeTable[256]={ 0x0 , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c, 0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00, 0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c, 0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90, 0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c, 0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30, 0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac, 0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0, 0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c, 0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60, 0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc, 0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0, 0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c, 0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950, 0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc , 0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0, 0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc, 0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0, 0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c, 0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650, 0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc, 0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0, 0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c, 0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460, 0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac, 0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0, 0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c, 0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230, 0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c, 0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190, 0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c, 0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0 }; int triTable[256][16] = {{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1}, {3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1}, {3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1}, {3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1}, {9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1}, {9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1}, {2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1}, {8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1}, {9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1}, {4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1}, {3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1}, {1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1}, {4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1}, {4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1}, {5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1}, {2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1}, {9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1}, {0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1}, {2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1}, {10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1}, {5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1}, {5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1}, {9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1}, {0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1}, {1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1}, {10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1}, {8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1}, {2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1}, {7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1}, {2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1}, {11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1}, {5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1}, {11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1}, {11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1}, {1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1}, {9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1}, {5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1}, {2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1}, {5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1}, {6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1}, {3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1}, {6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1}, {5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1}, {1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1}, {10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1}, {6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1}, {8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1}, {7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1}, {3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1}, {5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1}, {0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1}, {9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1}, {8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1}, {5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1}, {0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1}, {6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1}, {10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1}, {10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1}, {8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1}, {1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1}, {0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1}, {10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1}, {3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1}, {6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1}, {9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1}, {8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1}, {3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1}, {6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1}, {0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1}, {10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1}, {10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1}, {2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1}, {7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1}, {7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1}, {2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1}, {1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1}, {11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1}, {8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1}, {0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1}, {7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1}, {10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1}, {2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1}, {6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1}, {7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1}, {2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1}, {1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1}, {10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1}, {10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1}, {0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1}, {7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1}, {6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1}, {8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1}, {9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1}, {6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1}, {4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1}, {10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1}, {8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1}, {0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1}, {1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1}, {8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1}, {10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1}, {4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1}, {10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1}, {5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1}, {11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1}, {9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1}, {6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1}, {7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1}, {3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1}, {7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1}, {3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1}, {6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1}, {9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1}, {1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1}, {4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1}, {7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1}, {6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1}, {3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1}, {0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1}, {6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1}, {0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1}, {11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1}, {6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1}, {5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1}, {9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1}, {1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1}, {1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1}, {10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1}, {0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1}, {5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1}, {10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1}, {11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1}, {9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1}, {7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1}, {2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1}, {8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1}, {9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1}, {9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1}, {1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1}, {9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1}, {9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1}, {5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1}, {0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1}, {10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1}, {2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1}, {0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1}, {0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1}, {9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1}, {5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1}, {3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1}, {5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1}, {8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1}, {0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1}, {9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1}, {1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1}, {3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1}, {4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1}, {9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1}, {11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1}, {11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1}, {2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1}, {9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1}, {3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1}, {1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1}, {4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1}, {3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1}, {0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1}, {9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1}, {1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}; /* Determine the index into the edge table which tells us which vertices are inside of the surface */ cubeindex = 0; if (cell[0][isoComp] < isoVal) cubeindex |= 1; if (cell[1][isoComp] < isoVal) cubeindex |= 2; if (cell[2][isoComp] < isoVal) cubeindex |= 4; if (cell[3][isoComp] < isoVal) cubeindex |= 8; if (cell[4][isoComp] < isoVal) cubeindex |= 16; if (cell[5][isoComp] < isoVal) cubeindex |= 32; if (cell[6][isoComp] < isoVal) cubeindex |= 64; if (cell[7][isoComp] < isoVal) cubeindex |= 128; /* Cube is entirely in/out of the surface */ if (edgeTable[cubeindex] == 0) return triangles; /* Find the vertices where the surface intersects the cube */ if (edgeTable[cubeindex] & 1) vertlist[0] = VertexInterp(isoVal,isoComp,cell[0],cell[1]); if (edgeTable[cubeindex] & 2) vertlist[1] = VertexInterp(isoVal,isoComp,cell[1],cell[2]); if (edgeTable[cubeindex] & 4) vertlist[2] = VertexInterp(isoVal,isoComp,cell[2],cell[3]); if (edgeTable[cubeindex] & 8) vertlist[3] = VertexInterp(isoVal,isoComp,cell[3],cell[0]); if (edgeTable[cubeindex] & 16) vertlist[4] = VertexInterp(isoVal,isoComp,cell[4],cell[5]); if (edgeTable[cubeindex] & 32) vertlist[5] = VertexInterp(isoVal,isoComp,cell[5],cell[6]); if (edgeTable[cubeindex] & 64) vertlist[6] = VertexInterp(isoVal,isoComp,cell[6],cell[7]); if (edgeTable[cubeindex] & 128) vertlist[7] = VertexInterp(isoVal,isoComp,cell[7],cell[4]); if (edgeTable[cubeindex] & 256) vertlist[8] = VertexInterp(isoVal,isoComp,cell[0],cell[4]); if (edgeTable[cubeindex] & 512) vertlist[9] = VertexInterp(isoVal,isoComp,cell[1],cell[5]); if (edgeTable[cubeindex] & 1024) vertlist[10] = VertexInterp(isoVal,isoComp,cell[2],cell[6]); if (edgeTable[cubeindex] & 2048) vertlist[11] = VertexInterp(isoVal,isoComp,cell[3],cell[7]); /* Create the triangles */ int nTriang = 0; for (int i=0;triTable[cubeindex][i]!=-1;i+=3) nTriang++; triangles.resize(nTriang); for (int j=0; j Tokenize (const std::string& instr, const std::string& separators) { vector ptr; // // Make copy of line that we can modify. // char* line = new char[instr.size()+1]; (void) strcpy(line, instr.c_str()); char* token = 0; if (!((token = strtok(line, separators.c_str())) == 0)) { ptr.push_back(token); while (!((token = strtok(0, separators.c_str())) == 0)) ptr.push_back(token); } vector tokens(ptr.size()); for (int i = 1; i < ptr.size(); i++) { char* p = ptr[i]; while (strchr(separators.c_str(), *(p-1)) != 0) *--p = 0; } for (int i = 0; i < ptr.size(); i++) tokens[i] = ptr[i]; delete line; return tokens; } static vector parseVarNames(istream& is) { char buffer[100]; int i=0; is.unsetf (ios::skipws); // Disable white-space skipping. istream_iterator s(is); while (*s != '\n') buffer[i++] = *s++; buffer[i] = '\0'; // Null terminate buffer. is.setf (ios::skipws); // Re-enable white-space skipping. return Tokenize(std::string(buffer),std::string(" ")); } static std::string parseTitle(istream& is) { char buffer[100]; int i=0; is.unsetf (ios::skipws); // Disable white-space skipping. istream_iterator s(is); while (*s != '\n') buffer[i++] = *s++; buffer[i] = '\0'; // Null terminate buffer. is.setf (ios::skipws); // Re-enable white-space skipping. return std::string(buffer); } static std::string rootName(const std::string inStr) { #ifdef WIN32 const std::string dirSep("\\"); #else const std::string dirSep("/"); #endif vector res = Tokenize(inStr,dirSep); res = Tokenize(res[res.size()-1],std::string(".")); return (res.size()>1 ? res[res.size()-2] : res[res.size()-1]); } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDerive_IntScale.cpp0000644000175000017500000001456511634153073024074 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrDerive_IntScale.cpp,v 1.1 2003/01/22 22:16:53 jbb Exp $ // #include #include #include #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" #include "ArrayLim.H" // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #if defined(BL_FORT_USE_UPPERCASE) # define TRANSV TRANSV #elif defined(BL_FORT_USE_LOWERCASE) # define TRANSV transv #elif defined(BL_FORT_USE_UNDERSCORE) # define TRANSV transv_ #endif extern "C" { void TRANSV(Real* v, ARLIM_P(vlo), ARLIM_P(vhi), const Real* dx, const Real* domnlo, Real* r, Real* t, Real* z, int* n, ARLIM_P(alo), ARLIM_P(ahi), const int* maxbins); }; static void PrintUsage (const char* progName) { std::cout << '\n'; std::cout << "Usage:" << '\n'; std::cout << progName << '\n'; std::cout << " infile = inputFileName" << '\n'; std::cout << " outfile = outputFileName" << '\n'; std::cout << " type = derivedTypeName" << '\n'; std::cout << " [-help]" << '\n'; std::cout << " [-verbose]" << '\n'; std::cout << " [fab.format = FormatType]" << '\n'; std::cout << " where FormatType=IEEE32(default), ASCII, 8BIT, or NATIVE" << '\n'; std::cout << '\n'; std::cout << "Available types:" << '\n'; for (int nder = 0; nder < NumDeriveFunc; ++nder) { std::cout << " " << DerivedQuants[nder].name << '\n'; } std::cout << '\n'; exit(1); } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc == 1) PrintUsage(argv[0]); ParmParse pp; if (pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Scan the arguments. // bool verbose = false; if (pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(true); } const int nfile = pp.countval("infiles"); if (nfile<=0) BoxLib::Abort("You must specify `infiles'"); std::vector iFile(nfile); pp.queryarr("infiles",iFile); DataServices::SetBatchMode(); FileType fileType(NEWPLT); const int nComp = BL_SPACEDIM; Array names(nComp); names[0] = "xvel"; names[1] = "yvel"; names[2] = "zvel"; DataServices* dataServices0 = new DataServices(iFile[0], fileType); AmrData& amrData0 = dataServices0->AmrDataRef(); const Box box = amrData0.ProbDomain()[0]; // Get a shifted domnlo vector to center domain Array domnlo(BL_SPACEDIM); for (int i=0; i Nbin(vbox,1); FArrayBox vData(box,BL_SPACEDIM); FArrayBox tmp(box,1); avVR.setVal(0); avVT.setVal(0); avVZ.setVal(0); for (int ifile=0; ifile #include #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif static void PrintUsage (const char* progName) { cout << '\n'; cout << "Usage:" << '\n'; cout << progName << '\n'; cout << " infile = inputFileName" << '\n'; cout << " outfile = outputFileName" << '\n'; cout << " [-help]" << '\n'; cout << " [-verbose]" << '\n'; cout << '\n'; exit(1); } int main (int argc, char* argv[]) { if(argc == 1) PrintUsage(argv[0]); // // Make sure to catch new failures. // set_new_handler(Utility::OutOfMemory); ParallelDescriptor::StartParallel(&argc, &argv); ParmParse pp(argc-1,argv+1); if(pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Set default info. // // Scan the arguments. // std::string iFileDir, iFile, oFile, oFileDir; bool verbose = false; if(pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(true); } pp.query("infile", iFile); if(iFile.isNull()) { BoxLib::Abort("You must specify `infile'"); } pp.query("outfile", oFile); if(oFile.isNull()) { BoxLib::Abort("You must specify `outfile'"); } int i; double dTime0, dTime1; Real rTime; DataServices::SetBatchMode(); FileType fileType(NEWPLT); int nProcs(ParallelDescriptor::NProcs()); dTime0 = Utility::second(); DataServices dataServices(iFile, fileType); if( ! dataServices.AmrDataOk()) { // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); } AmrData &amrData = dataServices.AmrDataRef(); const Array &derives = amrData.PlotVarNames(); int nComps(amrData.NComp()); int finestLevel = amrData.FinestLevel(); // // Make the result MultiFab's. // Array mfout(finestLevel + 1); for(int iLevel = 0; iLevel <= finestLevel; ++iLevel) { mfout[iLevel] = new MultiFab(amrData.boxArray(iLevel), nComps, 0); for(int iComp = 0; iComp < nComps; ++iComp) { mfout[iLevel]->copy(amrData.GetGrids(iLevel, iComp), 0, iComp, 1); } } dTime1 = Utility::second() - dTime0; rTime = (Real) dTime1; ParallelDescriptor::ReduceRealMax(rTime); if(ParallelDescriptor::IOProcessor()) { cout << "[" << nProcs << " procs]: Read pltfile time = " << rTime << endl; cout << endl; } // // write the new plot file // dTime0 = Utility::second(); if(ParallelDescriptor::IOProcessor()) { if(!Utility::UtilCreateDirectory(oFile,0755)) { Utility::CreateDirectoryFailed(oFile); } } // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string oFileHeader(oFile); oFileHeader += "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); ofstream os; os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.length()); if(verbose && ParallelDescriptor::IOProcessor()) { cout << "Opening file = " << oFileHeader << '\n'; } os.open(oFileHeader.c_str(), ios::out|ios::binary); if(os.fail()) { Utility::FileOpenFailed(oFileHeader); } // // Start writing plotfile. // os << amrData.PlotFileVersion() << '\n'; os << nComps << '\n'; for(int n = 0; n < nComps; n++) os << derives[n] << '\n'; os << BL_SPACEDIM << '\n'; os << amrData.Time() << '\n'; os << finestLevel << '\n'; for(i = 0; i < BL_SPACEDIM; i++) os << amrData.ProbLo()[i] << ' '; os << '\n'; for(i = 0; i < BL_SPACEDIM; i++) os << amrData.ProbHi()[i] << ' '; os << '\n'; for(i = 0; i < finestLevel; i++) os << amrData.RefRatio()[i] << ' '; os << '\n'; for(i = 0; i <= finestLevel; i++) os << amrData.ProbDomain()[i] << ' '; os << '\n'; for(i = 0; i <= finestLevel; i++) os << 0 << ' '; os << '\n'; for(i = 0; i <= finestLevel; i++) { for(int k = 0; k < BL_SPACEDIM; k++) os << amrData.DxLevel()[i][k] << ' '; os << '\n'; } os << amrData.CoordSys() << '\n'; os << "0\n"; // The bndry data width. // // Write out level by level. // for(int iLevel = 0; iLevel <= finestLevel; ++iLevel) { // // Write state data. // int nGrids = amrData.boxArray(iLevel).length(); char buf[64]; sprintf(buf, "Level_%d", iLevel); if(ParallelDescriptor::IOProcessor()) { os << iLevel << ' ' << nGrids << ' ' << amrData.Time() << '\n'; os << 0 << '\n'; for(i = 0; i < nGrids; ++i) { for(int n = 0; n < BL_SPACEDIM; n++) { os << amrData.GridLocLo()[iLevel][i][n] << ' ' << amrData.GridLocHi()[iLevel][i][n] << '\n'; } } // // Build the directory to hold the MultiFabs at this level. // std::string Level(oFile); Level += '/'; Level += buf; if( ! Utility::UtilCreateDirectory(Level, 0755)) { Utility::CreateDirectoryFailed(Level); } } // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); // // Now build the full relative pathname of the MultiFab. // static const std::string MultiFabBaseName("/MultiFab"); std::string PathName(oFile); PathName += '/'; PathName += buf; PathName += MultiFabBaseName; if(ParallelDescriptor::IOProcessor()) { // // The full name relative to the Header file. // std::string RelativePathName(buf); RelativePathName += '/'; RelativePathName += MultiFabBaseName; os << RelativePathName << '\n'; } VisMF::Write(*mfout[iLevel], PathName, VisMF::OneFilePerCPU); delete mfout[iLevel]; } os.close(); dTime1 = Utility::second() - dTime0; rTime = (Real) dTime1; ParallelDescriptor::ReduceRealMax(rTime); if(ParallelDescriptor::IOProcessor()) { cout << "[" << nProcs << " procs]: Write pltfile time = " << rTime << endl; cout << endl; } // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); } ccseapps-2.5/CCSEApps/pAmrDerive/mergeET.pl0000644000175000017500000000303211634153073021600 0ustar amckinstryamckinstry#!/usr/local/gnu/bin/perl # # Layout of chemistry events: N x y spec reac time # $Efile = "Events_0.0M_3_19415.seed=142"; # # Layout of trajectory events: # # N: # x1 y1 t1 # x2 y2 t2 # ... # $Tfile = "Traj_0.0M_3_19415.seed=142"; EVENT; TRAJ; print STDERR "Using Efile = $Efile\n"; print STDERR "Using Tfile = $Tfile\n"; die "Usage: mergeET N\n" unless $#ARGV >= 0; $part = $ARGV[0]; shift; print STDERR "Merging stuff for particle # $part ...\n"; @E_array = (); @T_array = (); open TRAJ, "<$Tfile" || die "Couldn't open() $Tfile"; while () { if (/^$part:$/o) { # # Throw out first trajectory; it's also in Event file. # ; until (($_ = ) =~ /^[0-9]+:$/) { push @T_array, $_; } break; } } close TRAJ; open EVENT, "<$Efile" || die "Couldn't open() $Efile"; while () { if (/^$part /o) { ($a,$b,$c,$d,$e,$f) = split(' ', $_); # # Don't save the final Event; it's also in Trajectory. # push @E_array, "$b $c $f $d\n" unless ($e == -1 && $f > 0); } } close EVENT; @merged = (); sub bythirdcolumn { ($a1,$a2,$a3) = split(' ', $a); ($b1,$b2,$b3) = split(' ', $b); $a3 <=> $b3; } @merged = sort bythirdcolumn @E_array, @T_array; $lastspec = 0; for ($i = 0; $i <= $#merged; $i++) { ($a,$b,$c,$d) = split(' ', $merged[$i]); if ($d =~ /[0-9]+/) { $lastspec = $d; } else { $merged[$i] = "$a $b $c $lastspec\n"; } } print @merged; ccseapps-2.5/CCSEApps/pAmrDerive/GNUmakefile0000644000175000017500000001573111634153073021776 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.39 2003/03/17 20:21:46 marc Exp $ # PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) # # Variables for the user to set ... # PRECISION = DOUBLE DEBUG = TRUE DEBUG = FALSE PROFILE = FALSE DIM = 2 DIM = 3 USE_THREADS=TRUE USE_THREADS=FALSE USE_MPI=TRUE USE_MPI=FALSE AIXLARGEMEM=TRUE AIXLARGEMEM=FALSE COMP = mpKCC COMP = KCC COMP = g++ USE_ARRAYVIEW = FALSE # See below (set TRUE if this derive has a corresponding Fort file) BL_HAS_FORT = TRUE # # By default we build AmrDerive. # # Easiest way to use this is to set it on the command line, say # # gmake EBASE=AmrDeriveIntegrate DEBUG=FALSE # #EBASE = AmrDeriveAvgPlots #EBASE = AmrDeriveMatLab #EBASE = AmrDeriveBinTrac #EBASE = AmrDerivePeriodicFab #EBASE = AmrDeriveTestFlush #EBASE = AmrDerive #EBASE = AmrDeriveDist #EBASE = AmrDeriveTBR #EBASE = AmrDerive #EBASE = AmrDeriveStoch #EBASE = AmrDeriveQuench #EBASE = AmrDeriveSumRho #EBASE = AmrDeriveTecplot #EBASE = AmrDerive_VtoRTZavg #EBASE = AmrDerive_Vfluct #EBASE = AmrDerive_IntScale #EBASE = AmrDeriveYAvg EBASE = AmrDeriveTurbfile #EBASE = AmrDerive2Chombo #EBASE = AmrDeriveIntegrate #EBASE = AmrDeriveYIntegrals PBOXLIB_HOME = .. ifeq ($(EBASE), AmrDerive2Chombo) XTRALIBS += -lhdf5 -lz endif ifeq ($(EBASE), AmrDeriveTecplot) LIBRARY_LOCATIONS += /usr/local/Tecplot/lib #LIBRARY_LOCATIONS += ${HOME}/Local/TEC90/lib/mesa XTRALIBS += -ltec #Joe Grcar (1/13/03): use only the following and comment out the others #XTRALIBS += /usr/tec92/lib/tecio.a endif include $(TOP)/mk/Make.defs ifeq ($(PROFILE), FALSE) ifeq ($(DEBUG), TRUE) USE_ARRAYVIEW = TRUE USE_ARRAYVIEW = FALSE endif endif HERE = . #ifeq ($(MACHINE), OSF1) #INCLUDE_LOCATIONS += /usr/include/X11 /usr/include/Xm /usr/include/X11/Xaw #endif # #ifeq ($(MACHINE), T3E) #ifeq ($(WHICHT3E), NERSC) #INCLUDE_LOCATIONS += /opt/ctl/cvt/3.1.0.0/include/X11 #INCLUDE_LOCATIONS += /opt/ctl/cvt/3.1.0.0/include/Xm #INCLUDE_LOCATIONS += /opt/ctl/cvt/3.1.0.0/include/X11/Xaw #LIBRARY_LOCATIONS += /opt/ctl/cvt/ctv/lib #endif #endif #DEFINES += -DBL_DERIVE_IAMR DEFINES += -DBL_DERIVE_HCHEM ###### arrayview USE_ARRAYVIEW = FALSE ifeq (USE_ARRAYVIEW, TRUE) DEFINES += -DBL_USE_ARRAYVIEW #ARRAYVIEWDIR = /usr/people/vince/Visualization/ArrayView ARRAYVIEWDIR = . INCLUDE_LOCATIONS += $(ARRAYVIEWDIR) #LIBRARY_LOCATIONS += $(ARRAYVIEWDIR) #LIBRARIES += -larrayview$(DIM)d.$(machineSuffix) endif BUILD_INPLACE := FALSE BUILD_INPLACE := TRUE #ifeq ($(MACHINE), OSF1) #LIBRARIES += -lXm -lXt -lX11 #endif # #ifeq ($(MACHINE), T3E) #ifeq ($(WHICHT3E), NERSC) #LIBRARIES += -lXm -lSM -lICE -lXt -lX11 #endif #endif CEXE_sources += $(EBASE).cpp ifeq ($(EBASE), AmrDeriveQuench) CHEMDIR = $(TOP)/HeatTransfer/ChemKinDriver endif include ./Make.package ifeq (${BL_HAS_FORT}, TRUE) FEXE_sources += ${EBASE}_F.F endif DEFINES += -DBL_PARALLEL_IO ifeq ($(COMP),KCC) ifeq ($(KCC_VERSION),3.3) CXXFLAGS += --diag_suppress 837 CXXOPTF += -Olimit 2400 #CXXFLAGS += -fprm n -fptm u endif endif ifeq ($(BUILD_INPLACE), TRUE) include $(TOP)/BoxLib/Make.package INCLUDE_LOCATIONS += $(HERE) INCLUDE_LOCATIONS += ../BoxLib # INCLUDE_LOCATIONS += ../amrlib INCLUDE_LOCATIONS += ../pAmrvis INCLUDE_LOCATIONS += ../bndrylib else INCLUDE_LOCATIONS += . .. $(TOP)/include $(TOP)/pAmrvis ../BoxLib LIBRARY_LOCATIONS += $(TOP)/lib/$(machineSuffix) LIBRARIES += -lbndry$(DIM)d # LIBRARIES += -lamr$(DIM)d LIBRARIES += -lbox$(DIM)d endif ifeq ($(USE_ARRAYVIEW),TRUE) DEFINES += -DBL_USE_ARRAYVIEW DEFINES += -DBL_ARRAYVIEW_TAGBOX endif ifeq ($(MACHINE),OSF1) # # Some additional stuff for our preferred development/debugging environment. # ifeq ($(PRECISION),DOUBLE) FFLAGS += -real_size 64 endif FDEBF += -C FDEBF += -warn argument_checking FDEBF += -warn declarations ifneq ($(FC), f90) FDEBF += -warn truncated_source FDEBF += -warn unused endif endif # # For Running 3rd Only # 3RD = 1 3RD = ifdef 3RD LDFLAGS += --link_command_prefix 3rd LDFLAGS += -non_shared -v endif ifeq ($(BUILD_INPLACE), TRUE) PATHDIRS = . $(TOP)/pAmrvis $(TOP)/amrlib $(TOP)/bndrylib $(TOP)/BoxLib else PATHDIRS = . $(TOP)/pAmrvis endif ifeq ($(EBASE), AmrDeriveQuench) INCLUDE_LOCATIONS += $(CHEMDIR) PATHDIRS += $(CHEMDIR) endif ifeq ($(EBASE), AmrDerive2Chombo) INCLUDE_LOCATIONS += ../../HDF/include cEXE_sources += chomboHDF5.c cEXE_headers += chomboHDF5.h FEXE_sources += AmrDerive2Chombo_F.F FILCC_$(DIM)D.F FEXE_headers += AmrDerive2Chombo_F.H LIBRARY_LOCATIONS += ../../HDF/lib INCLUDE_LOCATIONS += $(TOP)/amrlib include $(TOP)/bndrylib/Make.package endif # # Note: If you need to link to Tecplot libs, you will need to link # the Tecplot lib/include sutff to this location # ifeq ($(EBASE), AmrDeriveTecplot) INCLUDE_LOCATIONS += /usr/local/TEC90/include #INCLUDE_LOCATIONS += ${HOME}/Local/TEC90/include #Joe Grcar (1/13/03): use only the following and comment out the others #INCLUDE_LOCATIONS += /usr/tec92/include endif ifeq ($(BUILD_INPLACE), TRUE) vpath %.f $(PATHDIRS) vpath %.F $(PATHDIRS) vpath %.h $(PATHDIRS) vpath %.H $(PATHDIRS) vpath %.cpp $(PATHDIRS) else vpath %.f $(PATHDIRS) vpath %.F $(PATHDIRS) vpath %.h $(PATHDIRS) vpath %.H $(PATHDIRS) vpath %.cpp $(PATHDIRS) vpath %.a $(LIBRARY_LOCATIONS) endif all: $(executable) ifeq ($(MACHINE),T3E) # # We don't explicity set the path of the mpi directory on the T3E. # $(executable): $(filter-out -lmpi, $(LIBRARIES)) else $(executable): $(LIBRARIES) endif ifneq ($(BUILD_INPLACE), TRUE) # # Build and install all libraries needed in an appropriate order. # libs: cd $(TOP)/BoxLib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install cd $(TOP)/bndrylib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install cd $(TOP)/amrlib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install # # Cleanup libraries. # cleanlibs: cd $(TOP)/BoxLib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) clean cd $(TOP)/bndrylib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) clean cd $(TOP)/amrlib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) clean endif # # Create MS-IDE dsp file to build this project # DspOlevel = 1 DspFileRoot = $(EBASE)$(DIM)d ifeq ($(DEBUG), TRUE) DspFileRoot := $(join $(DspFileRoot),.DEBUG) DspOlevel := 0 endif dsp: $(DspFileRoot).dsp .dspDepends: $(FEXE_sources) $(FEXE_headers) $(fEXE_sources) $(CEXE_headers) $(CEXE_sources) $(INCLUDE_LOCATIONS) @echo $^ > .dspDepends $(DspFileRoot).dsp: .dspDepends @(echo Building DSP file = $(DspFileRoot).dsp;\ $(TOP)/scripts/dsp.mak -p $(DspFileRoot) -t $(TOP) -d $(DIM) -o $(DspFileRoot).dsp -O $(DspOlevel) -f $^) include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/pAmrDerive/sumspec.pl0000644000175000017500000000157111634153073021735 0ustar amckinstryamckinstry#!/usr/bin/perl # # Layout of events: N x y [z] spec reac time # sub numerically { $a <=> $b; } %SUM = (); $reacold=-10; $strttime=.001; $strttime=0; while (<>) { ($a,$b,$c,$d,$e,$f,$g) = split(' ', $_); # # The 2-D case. # $spec = $d; $reac = $e; $time = $f; if ($g ne "") { # # The 3-D case -- $g is not NULL. # $spec = $e; $reac = $f; $time = $g; } if ($reac == -1 && $time != $strttime) { if ($reac == $reacold) { # # -1 -> non-event. # $SUM{-1}++; } else { $SUM{$spec}++; } } $reacold=$reac; if (eof) { printf STDERR "Finished processing $ARGV ...\n" } } foreach $key (sort numerically keys %SUM) { print $key, ": ", $SUM{$key}, "\n"; } ccseapps-2.5/CCSEApps/pAmrDerive/inputs0000644000175000017500000000212311634153073021160 0ustar amckinstryamckinstrydx=.0000625 dy=.0000625 dt=.00001 dt_spec=-1 stop_time=1 res_file=ResTime_4.6M_3_14930 res_file=ResTime_0.0M_3_19415 plot_file=dogmeat traj_file=Traj_4.6M_3_14930 traj_file=Traj_0.0M_3_19415 event_file=Events_4.6M_3_14930 event_file=Events_0.0M_3_19415 edgedatafile=stochEdgeData.txt calc_lambda_max=0 do_not_write_events=0 do_not_write_trajs=0 do_not_write_resfile=0 restime_interval=250 res_spec=0 init_spec=6 init_spec=24 part_start=0 n_particles=0 seed=12345 workqueue.maxthreads=4 workqueue.maxthreads=0 init_y=.0000125 build_prob_dist=false conc_epsilon=1.0e-10 chem_limiter=0.1 # # Ammonia stuff # fab_a=plt_4.6M_3_14930_a.fab fab_b=plt_4.6M_3_14930_b.fab fab_c=plt_4.6M_3_14930_c.fab fab_d=plt_4.6M_3_14930_d.fab fab_u=plt_4.6M_3_14930_v.fab conc=plt_4.6M_3_14930_Conc.fab Rf=plt_4.6M_3_14930_Rf.fab Rr=plt_4.6M_3_14930_Rr.fab # # Ammonia free stuff # fab_a=plt_0.0M_3_19415_a.fab fab_b=plt_0.0M_3_19415_b.fab fab_c=plt_0.0M_3_19415_c.fab fab_d=plt_0.0M_3_19415_d.fab fab_u=plt_0.0M_3_19415_v.fab conc=plt_0.0M_3_19415_Conc.fab Rf=plt_0.0M_3_19415_Rf.fab Rr=plt_0.0M_3_19415_Rr.fab ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveVandV2.cpp0000644000175000017500000001347211634153073023327 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrDeriveVandV2.cpp,v 1.1 2003/01/23 21:25:10 marc Exp $ // #include #include #include using std::cout; using std::endl; #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" #include "ArrayLim.H" // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #if defined(BL_FORT_USE_UPPERCASE) # define TRANSV TRANSV # define ROOTMS ROOTMS #elif defined(BL_FORT_USE_LOWERCASE) # define TRANSV transv # define ROOTMS rootms #elif defined(BL_FORT_USE_UNDERSCORE) # define TRANSV transv_ # define ROOTMS rootms_ #endif extern "C" { void TRANSV(Real* v, ARLIM_P(vlo), ARLIM_P(vhi), const Real* dx, const Real* domnlo, Real* v1, ARLIM_P(v1lo), ARLIM_P(v1hi), Real* v2, ARLIM_P(v2lo), ARLIM_P(v2hi)); void ROOTMS(const Real* v1, Real* v2, ARLIM_P(vlo), ARLIM_P(vhi)); }; static void PrintUsage (const char* progName) { std::cout << '\n'; std::cout << "Usage:" << '\n'; std::cout << progName << '\n'; std::cout << " infiles=inputFileNames" << '\n'; std::cout << " [bsize=]" << '\n'; std::cout << " [-help]" << '\n'; std::cout << '\n'; exit(1); } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc == 1) PrintUsage(argv[0]); ParmParse pp; if (pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Scan the arguments. // bool verbose = false; if (pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(true); } const int nfile = pp.countval("infiles"); if (nfile<=0) BoxLib::Abort("You must specify `infiles'"); std::vector iFile(nfile); pp.queryarr("infiles",iFile); DataServices::SetBatchMode(); FileType fileType(NEWPLT); const int nComp = BL_SPACEDIM+2; Array names(nComp); names[0] = "xvel"; names[1] = "yvel"; names[2] = "zvel"; names[3] = "density"; names[4] = "tracer"; DataServices* dataServices0 = new DataServices(iFile[0], fileType); AmrData& amrData0 = dataServices0->AmrDataRef(); const Box box = amrData0.ProbDomain()[0]; // Get a shifted domnlo vector to center domain Array domnlo(BL_SPACEDIM); for (int i=0; i #include #ifdef BL_LANG_FORT # define FORT_DERLGDN fdlgdn3d # define FORT_DERDEN fdden3d # define FORT_DERTRAC fdtrac3d # define FORT_DERTMASK fdtmask3d # define FORT_DERSTATE fdstate3d # define FORT_DERXVEL fdxvel3d # define FORT_DERYVEL fdyvel3d # define FORT_DERZVEL fdzvel3d # define FORT_DERTENG fdeng3d # define FORT_DERIENG fdieng3d # define FORT_DERKENG fdkeng3d # define FORT_DERVORT fdvort3d # define FORT_DERCON fdcon3d # define FORT_SETGAMMA fdsetgam # define FORT_SETALPHA fdsetalpha # define FORT_SETQPOS fdsetqpos # define FORT_SUMMASS fdsummass # define FORT_SUMCONC fdsumconc # define FORT_SUMVORT fdsumvort # define FORT_DERDILI fddili3d # define FORT_BINTRAC bintrac # define FORT_DERMACH fdmach3d # define FORT_RANDMOVE randmove # define FORT_CHEMMOVE chemmove # define FORT_MAXLAMBDA maxlambda # define FORT_MAXDTLAMBDA maxdtlambda # define FORT_MAXDTDIFF maxdtdiff # define FORT_SELECTPOS selectpos # define FORT_PROBFAB probfab # define FORT_ACCUMPROB accumprob #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_DERLGDN FDLGDN3D # define FORT_DERDEN FDDEN3D # define FORT_DERTRAC FDTRAC3D # define FORT_DERTMASK FDTMASK3D # define FORT_DERSTATE FDSTATE3D # define FORT_DERXVEL FDXVEL3D # define FORT_DERYVEL FDYVEL3D # define FORT_DERZVEL FDZVEL3D # define FORT_DERTENG FDENG3D # define FORT_DERIENG FDIENG3D # define FORT_DERKENG FDKENG3D # define FORT_DERVORT FDVORT3D # define FORT_DERCON FDCON3D # define FORT_SETGAMMA FDSETGAM # define FORT_SETALPHA FDSETALPHA # define FORT_SETQPOS FDSETQPOS # define FORT_SUMMASS FDSUMMASS # define FORT_SUMCONC FDSUMCONC # define FORT_SUMVORT FDSUMVORT # define FORT_DERDILI FDDILI3D # define FORT_BINTRAC BINTRAC # define FORT_DERMACH FDMACH3D # define FORT_RANDMOVE RANDMOVE # define FORT_CHEMMOVE CHEMMOVE # define FORT_MAXLAMBDA MAXLAMBDA # define FORT_MAXDTLAMBDA MAXDTLAMBDA # define FORT_MAXDTDIFF MAXDTDIFF # define FORT_SELECTPOS SELECTPOS # define FORT_BUILDPROB BUILDPROB # define FORT_PROBFAB PROBFAB # define FORT_ACCUMPROB ACCUMPROB # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_DERLGDN fdlgdn3d # define FORT_DERDEN fdden3d # define FORT_DERTRAC fdtrac3d # define FORT_DERTMASK fdtmask3d # define FORT_DERSTATE fdstate3d # define FORT_DERXVEL fdxvel3d # define FORT_DERYVEL fdyvel3d # define FORT_DERZVEL fdzvel3d # define FORT_DERTENG fdeng3d # define FORT_DERIENG fdieng3d # define FORT_DERKENG fdkeng3d # define FORT_DERVORT fdvort3d # define FORT_DERCON fdcon3d # define FORT_SETGAMMA fdsetgam # define FORT_SETALPHA fdsetalpha # define FORT_SETQPOS fdsetqpos # define FORT_SUMMASS fdsummass # define FORT_SUMCONC fdsumconc # define FORT_SUMVORT fdsumvort # define FORT_DERDILI fddili3d # define FORT_BINTRAC bintrac # define FORT_DERMACH fdmach3d # define FORT_DERMACH fdmach3d # define FORT_RANDMOVE randmove # define FORT_CHEMMOVE chemmove # define FORT_MAXLAMBDA maxlambda # define FORT_MAXDTLAMBDA maxdtlambda # define FORT_MAXDTDIFF maxdtdiff # define FORT_SELECTPOS selectpos # define FORT_PROBFAB probfab # define FORT_ACCUMPROB accumprob # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_DERLGDN fdlgdn3d_ # define FORT_DERDEN fdden3d_ # define FORT_DERTRAC fdtrac3d_ # define FORT_DERTMASK fdtmask3d_ # define FORT_DERSTATE fdstate3d_ # define FORT_DERXVEL fdxvel3d_ # define FORT_DERYVEL fdyvel3d_ # define FORT_DERZVEL fdzvel3d_ # define FORT_DERTENG fdeng3d_ # define FORT_DERIENG fdieng3d_ # define FORT_DERKENG fdkeng3d_ # define FORT_DERVORT fdvort3d_ # define FORT_DERCON fdcon3d_ # define FORT_SETGAMMA fdsetgam_ # define FORT_SETALPHA fdsetalpha_ # define FORT_SETQPOS fdsetqpos_ # define FORT_SUMMASS fdsummass_ # define FORT_SUMCONC fdsumconc_ # define FORT_SUMVORT fdsumvort_ # define FORT_DERDILI fddili3d_ # define FORT_BINTRAC bintrac_ # define FORT_DERMACH fdmach3d_ # define FORT_DERMACH fdmach3d_ # define FORT_RANDMOVE randmove_ # define FORT_CHEMMOVE chemmove_ # define FORT_MAXLAMBDA maxlambda_ # define FORT_MAXDTLAMBDA maxdtlambda_ # define FORT_MAXDTDIFF maxdtdiff_ # define FORT_SELECTPOS selectpos_ # define FORT_PROBFAB probfab_ # define FORT_ACCUMPROB accumprob_ # endif // // Use ARLIM in the following. // extern "C" { void FORT_SETGAMMA( const Real *gam ); void FORT_SETALPHA( const Real *alp ); void FORT_SETQPOS( const int *qpos ); void FORT_DERLGDN(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERXVEL(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERYVEL(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERZVEL(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERIENG(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERCON(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2,const int &dloi3, const int &dhii1, const int &dhii2,const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERVORT(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2,const int &dloi3, const int &dhii1, const int &dhii2,const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERKENG(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2,const int &dloi3, const int &dhii1, const int &dhii2,const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERTENG(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2,const int &dloi3, const int &dhii1, const int &dhii2,const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERDILI(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2,const int &dloi3, const int &dhii1, const int &dhii2,const int &dhii3, const int *ovlo, const int *ovhi); void FORT_SUMMASS (const Real* dat, ARLIM_P(dlo), ARLIM_P(dhi), ARLIM_P(grid_lo), ARLIM_P(grid_hi), const Real* delta, Real* mass, Real* tmp); void FORT_SUMCONC (const Real* dat, ARLIM_P(dlo), ARLIM_P(dhi), ARLIM_P(grid_lo), ARLIM_P(grid_hi), const Real* delta, Real* mass, Real* tmp); void FORT_SUMVORT (const Real* dat, ARLIM_P(dlo), ARLIM_P(dhi), ARLIM_P(grid_lo), ARLIM_P(grid_hi), const Real* delta, Real* mass, Real* tmp); void FORT_BINTRAC (const Real* trac, ARLIM_P(trac_lo), ARLIM_P(trac_hi), const Real* rho, const int* lo, const int* hi, const Real* delta, Real* sum); void FORT_DERDEN (const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERTRAC(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERTMASK(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERSTATE(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); void FORT_DERMACH (const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); void FORT_RANDMOVE (const Real* A,ARLIM_P(A_lo),ARLIM_P(A_hi), const Real* B, const Real* C, const Real* D, const Real* U, const int* nspec, const Real* x, const Real* y, const int* spec, const Real* dx, const Real* dy, const Real* dt, const Real* dxinv, const Real* dyinv); void FORT_CHEMMOVE (const Real* RF,ARLIM_P(rf_lo),ARLIM_P(rf_hi), const Real* RR, const Real* CONC, const int* nspec, const int* nreac, const int* edges, const int* edgeslen, const int* pedges, const Real* x, const Real* y, const int* spec, const Real* dx, const Real* dy, const Real* dt, const int* rxn,const Real* dxinv, const Real* dyinv); void FORT_MAXLAMBDA (const Real* RF,ARLIM_P(rf_lo),ARLIM_P(rf_hi), const Real* RR, const Real* CONC, const int* nspec, const int* nreac, const int* edges, const int* edgeslen, const int* pedges); void FORT_MAXDTLAMBDA (const Real* RF,ARLIM_P(rf_lo),ARLIM_P(rf_hi), const Real* RR, const Real* CONC, const int* nspec, const int* nreac, const int* edges, const int* edgeslen, const int* pedges, const Real* x, const Real* y, const int* spec, const Real* dx, const Real* dy, const Real* dt, const Real* dxinv, const Real* dyinv); void FORT_MAXDTDIFF (const Real* C,ARLIM_P(C_lo),ARLIM_P(C_hi), const int* nspec, const Real* x, const Real* y, const int* spec, const Real* dx, const Real* dy, const Real* dt, const Real* dxinv, const Real* dyinv); void FORT_PROBFAB (const Real* rf, ARLIM_P(rf_lo), ARLIM_P(rf_hi), const Real* rr, const Real* prob, ARLIM_P(prob_lo), ARLIM_P(prob_hi), const int* nspec, const int* nreac, const int* ispec, const int* edges, const int* edgeslen, const int* pedges, const int* isrz, D_DECL(const Real* dx, const Real* dy, const Real* dz)); void FORT_ACCUMPROB (const Real* prob, ARLIM_P(prob_lo), ARLIM_P(prob_hi), const Real* totreact, Real* cumprob); void FORT_SELECTPOS (const Real* prob,ARLIM_P(prob_lo),ARLIM_P(prob_hi), const Real* rn, D_DECL(const Real* dx, const Real* dy, const Real* dz), D_DECL(const Real* x, const Real* y, const Real* z)); // // Typedef needed for defining a pointer to the FORTRAN functions // used in deriving other thermodynamic quantities from DATABOX // state variables. // typedef void (*DERIVE_FUNC) (const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *xlo, const Real *xhi, Real *dat, const int &dloi1, const int &dloi2, const int &dloi3, const int &dhii1, const int &dhii2, const int &dhii3, const int *ovlo, const int *ovhi); } // // Number of variables in the state including derived quantities. // #ifdef BL_DERIVE_IAMR #define NSTATECOMPS 5 #else #ifdef BL_DERIVE_HCHEM #define NSTATECOMPS 13 #else #define NSTATECOMPS 6 #endif #endif struct DeriveRecord { std::string name; // Name of quantity to derive from state data. DERIVE_FUNC func; // Pointer to function that computes this quantity. int derMap[NSTATECOMPS]; // Map of required variables for the // derived functions // 1 == needed, 0 == not needed }; // // The state quantities. // #if BL_SPACEDIM==3 #ifdef BL_DERIVE_IAMR // nstates = spacedim + 2 // x_velocity // y_velocity // z_velocity // density // tracer extern const struct DeriveRecord DerivedQuants[] = { // { "logden", FORT_DERLGDN, { 0, 0, 0, 1, 0 } }, // { "x_velocity", FORT_DERXVEL, { 1, 0, 0, 0, 0 } }, // { "y_velocity", FORT_DERYVEL, { 0, 1, 0, 0, 0 } }, // { "z_velocity", FORT_DERZVEL, { 0, 0, 1, 0, 0 } }, { "density", FORT_DERDEN, { 0, 0, 0, 1, 0 } }, { "tracer", FORT_DERTRAC, { 0, 0, 0, 0, 1 } } }; /* // these are for iamr: from the plotfile header: // NavierStokes-V1.1 // 5 // x_velocity // y_velocity // z_velocity // density // tracer extern const struct DeriveRecord DerivedQuants[] = { { "logden", FORT_DERLGDN, { 0, 0, 0, 1, 0 } }, { "x_velocity", FORT_DERXVEL, { 1, 0, 0, 0, 0 } }, { "y_velocity", FORT_DERYVEL, { 0, 1, 0, 0, 0 } }, { "z_velocity", FORT_DERZVEL, { 0, 0, 1, 0, 0 } }, //{ "teng", FORT_DERTENG, { 1, 0, 0, 0, 1 } }, //{ "eint", FORT_DERIENG, { 1, 1, 1, 1, 1 } }, //{ "kint", FORT_DERKENG, { 1, 1, 1, 1, 0 } }, //{ "vorticity", FORT_DERVORT, { 1, 1, 1, 1, 0 } }, //{ "concentration", FORT_DERCON, { 1, 0, 0, 0, 0 } }, //{ "dilitation", FORT_DERDILI, { 1, 1, 1, 1, 0 } }, { "density", FORT_DERDEN, { 0, 0, 0, 1, 0 } }, { "tracer", FORT_DERTRAC, { 0, 0, 0, 0, 1 } } }; */ #else #ifdef BL_DERIVE_HCHEM // density // xmom // ymom // zmom // eden // tracer // rho.Y(O2) // rho.Y(H2O) // rho.Y(CO2) // rho.Y(C2H2) // rho.Y(CO) // rho.Y(N2) // pressure extern const struct DeriveRecord DerivedQuants[] = { { "logden", FORT_DERLGDN, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { "x_velocity", FORT_DERXVEL, { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { "y_velocity", FORT_DERYVEL, { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { "z_velocity", FORT_DERZVEL, { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, //{ "teng", FORT_DERTENG, { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 } }, //{ "eint", FORT_DERIENG, { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 } }, //{ "kint", FORT_DERKENG, { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, //{ "vorticity", FORT_DERVORT, { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, //{ "concentration", FORT_DERCON, { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 } }, //{ "dilitation", FORT_DERDILI, { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { "density", FORT_DERDEN, { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, //{ "mach", FORT_DERMACH, { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 } }, { "state", FORT_DERSTATE, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { "tmask", FORT_DERTMASK, { 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0 } }, { "tracer", FORT_DERTRAC, { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 } } }; #else /* extern const struct DeriveRecord DerivedQuants[] = { { "logden", FORT_DERLGDN, { 1, 0, 0, 0, 0, 0 } }, { "x_velocity", FORT_DERXVEL, { 1, 1, 0, 0, 0, 0 } }, { "y_velocity", FORT_DERYVEL, { 1, 0, 1, 0, 0, 0 } }, { "z_velocity", FORT_DERZVEL, { 1, 0, 0, 1, 0, 0 } }, { "teng", FORT_DERTENG, { 1, 0, 0, 0, 1, 0 } }, { "eint", FORT_DERIENG, { 1, 1, 1, 1, 1, 0 } }, { "kint", FORT_DERKENG, { 1, 1, 1, 1, 0, 0 } }, { "vorticity", FORT_DERVORT, { 1, 1, 1, 1, 0, 0 } }, { "concentration", FORT_DERCON, { 1, 0, 0, 0, 0, 1 } }, { "dilitation", FORT_DERDILI, { 1, 1, 1, 1, 0, 0 } }, { "density", FORT_DERDEN, { 1, 0, 0, 0, 0, 0 } }, { "tracer", FORT_DERTRAC, { 0, 0, 0, 0, 0, 1 } } }; */ extern const struct DeriveRecord DerivedQuants[] = { { "logden", FORT_DERLGDN, { 1, 0, 0, 0, 0, 0 } }, { "x_velocity", FORT_DERXVEL, { 1, 1, 0, 0, 0, 0 } }, { "y_velocity", FORT_DERYVEL, { 1, 0, 1, 0, 0, 0 } }, { "z_velocity", FORT_DERZVEL, { 1, 0, 0, 1, 0, 0 } }, { "teng", FORT_DERTENG, { 1, 0, 0, 0, 1, 0 } }, { "eint", FORT_DERIENG, { 1, 1, 1, 1, 1, 0 } }, { "kint", FORT_DERKENG, { 1, 1, 1, 1, 0, 0 } }, { "vorticity", FORT_DERVORT, { 1, 1, 1, 1, 0, 0 } }, { "concentration", FORT_DERCON, { 1, 0, 0, 0, 0, 1 } }, { "dilitation", FORT_DERDILI, { 1, 1, 1, 1, 0, 0 } }, { "density", FORT_DERDEN, { 1, 0, 0, 0, 0, 0 } }, { "mach", FORT_DERMACH, { 1, 1, 1, 1, 1, 0 } }, { "tracer", FORT_DERTRAC, { 0, 0, 0, 0, 0, 1 } } }; #endif /* BL_DERIVE_HCHEM */ #endif /*BL_DERIVE_IAMR*/ static const int NumDeriveFunc = sizeof(DerivedQuants)/sizeof(DeriveRecord); #endif /*BL_SPACEDIM==3*/ #endif ccseapps-2.5/CCSEApps/pAmrDerive/xxmeth.fh0000644000175000017500000000313311634153073021551 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c ::: SCCS stuff "@(#)xxmeth.fh 1.1\t10/2/92" REAL_T gamma, difmag, small, smallr, ssx0, ssy0, sst0, alpha REAL_T curtime integer niter, iorder, qposition logical lnewton common /meth1/ gamma, alpha, difmag, small, smallr, niter, iorder, qposition common /meth2/ ssx0, ssy0, sst0, curtime, lnewton ccseapps-2.5/CCSEApps/pAmrDerive/mk2d.m0000644000175000017500000000240311634153073020727 0ustar amckinstryamckinstry % Erase all earlier variables from matlab. clear all; % Clear the plotting window. clf; % This is the (integer) time stamp on the .mat file. i = 50; % Change "density" to the appropriate variable fname = sprintf('plt%04d_density.mat',i); % Read in the number of grids at each level, the locations and sizes % of those grids, and the data on each grid. [dim ngrid loc siz dat] = binread(fname); % Number of levels nlev = size(ngrid); % The size of the graph will be the size of the first level 0 grid. % If there is more than one level 0 grid, this will need to be modified. xlo = loc{1}{1}(1); xhi = loc{1}{1}(2); ylo = loc{1}{1}(3); yhi = loc{1}{1}(4); axis([xlo xhi ylo yhi]); hold on; % Contour the data at each level and draw the grid boxes. for l=1:nlev num_grids = ngrid(l); for n=1:num_grids xlo = loc{l}{n}(1); xhi = loc{l}{n}(2); ylo = loc{l}{n}(3); yhi = loc{l}{n}(4); nx = siz{l}{n}(1); ny = siz{l}{n}(2); dx = (xhi-xlo)/nx; dy = (yhi-ylo)/ny; [x,y] = meshgrid(xlo+dx/2:dx:xhi-dx/2, ylo+dy/2:dy:yhi-dy/2); t = dat{l}{n}; xvec = [xlo xlo xhi xhi xlo]; yvec = [ylo yhi yhi ylo ylo]; if (l~=0)|(n~=0) fill(xvec,yvec,'w'); end plot(xvec,yvec,'k-'); contour(x,y,t); end end axis image; ccseapps-2.5/CCSEApps/pAmrDerive/stochEdgeData.txt0000644000175000017500000001317411634153073023163 0ustar amckinstryamckinstry25 76 0 1 3 1 1 1 3 1 2 1 1 1 3 1 4 1 4 1 1 1 5 -1 1 1 6 -1 1 1 8 -1 1 2 9 -1 1 1 14 -1 2 1 15 -1 3 1 16 -1 3 1 17 -1 3 1 18 -1 3 1 19 -1 3 1 21 -1 3 1 28 1 3 1 44 1 11 1 45 1 24 1 46 1 24 1 48 -1 1 1 55 -1 8 1 59 -1 8 1 60 1 12 1 61 1 12 1 62 1 24 1 66 -1 9 1 67 -1 9 1 68 1 24 1 71 -1 10 1 74 1 12 1 81 -1 11 1 85 1 3 1 91 -1 12 2 94 -1 12 1 95 1 1 1 109 -1 1 1 112 -1 3 1 114 -1 12 1 131 -1 18 1 132 -1 18 1 135 -1 15 1 136 -1 15 1 137 -1 15 1 140 1 12 1 141 1 24 1 142 -2 1 2 142 -2 15 2 144 -1 3 1 150 -1 20 1 151 -1 20 1 153 -1 20 1 161 -1 1 1 163 -1 9 1 166 1 3 1 168 -1 1 1 169 -1 3 1 172 1 13 1 173 1 23 1 174 -1 1 1 178 1 13 1 179 1 18 1 180 -1 1 1 184 1 13 1 186 -1 1 1 187 1 13 1 188 1 9 1 189 1 15 1 192 -1 12 1 193 1 14 1 194 1 9 1 196 -1 12 1 200 1 3 1 203 1 14 1 205 1 18 1 206 1 13 1 37 2 -1 0 1 4 -1 0 1 5 1 0 1 6 1 0 1 7 1 2 1 8 1 0 2 9 2 0 2 9 2 2 2 10 -1 2 1 11 -1 2 1 12 -1 2 1 13 -1 2 1 19 1 4 1 29 1 4 1 30 -1 4 1 31 -1 4 1 32 -1 4 1 47 1 12 1 48 1 0 1 50 -1 4 1 63 1 12 1 95 -1 0 1 109 1 0 1 110 1 12 1 111 1 24 1 113 -1 4 1 142 1 0 1 143 1 12 1 145 -1 4 1 161 1 0 1 165 1 4 1 167 1 4 1 168 1 0 1 174 1 0 1 180 1 0 1 186 1 0 1 207 1 18 1 7 7 -1 1 1 9 -1 1 1 10 1 1 1 11 1 1 1 12 1 1 1 13 1 1 1 14 1 0 1 29 0 -1 0 1 1 -1 0 1 15 1 0 1 16 1 0 1 17 1 0 1 18 1 0 1 19 1 0 1 20 1 12 2 21 1 0 1 22 -1 5 1 23 -1 5 1 25 -1 5 1 27 -1 5 1 28 -2 0 2 28 -2 5 2 29 -1 5 1 39 -1 7 1 49 -1 5 1 56 -1 8 1 58 -1 8 1 85 -1 0 1 94 -1 12 1 112 1 0 1 119 -1 16 1 124 -1 16 1 144 1 0 1 166 -1 0 1 169 1 0 1 200 -1 0 1 11 3 -1 0 1 19 -1 1 1 29 -1 1 1 30 1 1 1 31 1 1 1 32 1 1 1 50 1 1 1 113 1 1 1 145 1 1 1 165 -1 1 1 167 -1 1 1 11 22 1 3 1 23 1 3 1 24 1 7 1 25 1 3 1 26 1 7 1 27 1 3 1 28 1 3 1 29 1 3 1 42 -1 7 1 48 -1 7 1 49 1 3 1 12 21 -1 7 1 33 1 7 1 34 1 7 1 35 1 7 1 36 1 7 1 37 1 7 1 43 -1 7 1 49 -1 7 1 50 -1 7 1 75 -1 7 1 86 -1 7 1 125 -1 7 1 34 21 1 6 1 24 -1 5 1 26 -1 5 1 33 -1 6 1 34 -1 6 1 35 -1 6 1 36 -1 6 1 37 -1 6 1 38 1 8 1 39 1 3 1 40 1 8 1 41 1 8 1 42 1 5 1 43 1 6 1 44 1 11 1 45 1 24 1 46 1 24 1 47 1 12 1 48 1 5 1 49 1 6 1 50 1 6 1 51 1 10 2 52 1 10 1 53 1 24 1 71 -1 10 1 74 -1 10 1 75 1 6 1 76 -1 8 1 86 1 6 1 87 -1 8 1 103 -1 13 1 118 -1 16 1 125 1 6 1 126 -1 8 1 25 38 -1 7 1 40 -1 7 1 41 -1 7 1 52 1 10 1 54 1 9 1 55 1 0 1 56 1 3 1 57 1 9 1 58 1 3 1 59 1 0 1 60 1 12 1 61 1 12 1 62 1 24 1 63 1 12 1 64 1 24 2 65 1 24 1 76 1 7 1 81 -1 11 1 87 1 7 1 98 -1 13 1 117 -1 16 1 120 -1 16 1 126 1 7 1 134 -1 15 1 182 -1 24 1 22 53 1 24 1 54 -1 8 1 57 -1 8 1 65 1 24 1 66 1 0 1 67 1 0 1 68 1 24 1 105 -1 14 1 133 -1 15 1 146 1 24 1 152 -1 20 1 163 1 0 1 175 1 23 1 181 1 13 1 183 1 24 1 188 -1 0 1 190 1 14 1 191 -1 24 1 194 -1 0 1 195 -1 24 1 201 1 13 1 208 1 13 1 13 51 -1 7 1 52 -2 7 1 52 -2 8 1 69 1 11 1 70 1 11 1 71 2 7 1 71 2 0 1 72 1 11 1 73 1 11 1 74 2 7 1 74 2 12 1 75 1 11 1 76 1 11 1 20 44 -2 7 1 44 -2 0 1 69 -1 10 1 70 -1 10 1 72 -1 10 1 73 -1 10 1 75 -1 10 1 76 -1 10 1 77 1 24 1 78 1 24 1 79 1 24 1 80 1 12 1 81 2 0 1 81 2 8 1 82 1 24 1 83 1 24 1 84 1 24 1 85 1 24 1 86 1 24 1 87 1 24 1 34 20 -1 3 1 47 -2 7 1 47 -2 1 1 60 -2 0 1 60 -2 8 1 61 -2 0 1 61 -2 8 1 63 -2 1 1 63 -2 8 1 74 -2 0 1 74 -2 10 1 80 -1 11 1 88 1 24 1 89 1 24 1 90 1 24 1 91 1 0 1 92 1 24 1 93 1 24 1 94 2 3 1 94 2 0 1 95 1 24 1 110 -2 1 1 110 -2 14 1 114 2 0 1 114 2 20 1 140 -2 0 1 140 -2 15 1 143 -2 1 1 143 -2 15 1 162 1 24 1 192 2 0 1 192 2 13 1 196 2 0 1 196 2 14 1 34 96 -1 14 1 97 1 15 1 98 1 8 1 99 1 14 1 100 1 14 1 101 1 17 1 102 1 16 1 103 1 7 1 104 1 19 1 112 -1 14 1 113 -1 14 1 115 -1 14 1 130 -1 18 1 151 -1 20 1 152 -1 20 1 154 -1 21 1 160 -1 23 1 170 -1 14 1 172 -1 0 1 178 -1 0 1 181 -1 9 1 182 -1 24 1 184 -1 0 1 185 1 14 1 187 -1 0 1 191 -1 24 1 192 -1 12 1 197 -1 14 1 199 -1 14 1 201 -1 9 1 202 -1 15 1 204 -1 14 1 206 -1 0 1 208 -1 9 1 32 96 1 13 1 99 -1 13 1 100 -1 13 1 104 1 19 1 105 1 9 1 106 1 15 1 107 1 15 1 108 1 15 1 109 1 15 1 110 1 12 1 111 1 24 1 112 1 13 1 113 1 13 1 114 1 20 1 115 1 13 1 116 1 20 1 148 -1 19 1 149 -1 19 1 150 -1 20 1 158 -1 22 1 159 1 22 1 170 1 13 1 176 1 22 1 185 -1 13 1 190 -1 9 1 193 -1 0 1 195 -1 24 1 196 -1 12 1 197 1 13 1 199 1 13 1 203 -1 0 1 204 1 13 1 38 97 -1 13 1 106 -1 14 1 107 -1 14 1 108 -1 14 1 109 -1 14 1 115 -1 16 1 116 1 20 1 121 -1 16 1 122 -1 16 1 123 -1 16 1 125 -1 16 1 126 -1 16 1 127 -1 17 1 128 -1 17 1 129 -1 17 1 133 1 9 1 134 1 8 1 135 1 0 1 136 1 0 1 137 1 0 1 138 1 16 1 139 1 16 1 140 1 12 1 141 1 24 1 142 1 0 1 143 1 12 1 144 1 16 1 145 1 16 1 146 1 24 1 147 1 24 2 148 -1 19 1 153 -1 20 1 156 -1 21 1 164 1 16 1 171 1 16 1 189 -1 0 1 198 1 16 1 202 1 13 1 19 102 -1 13 1 115 1 15 1 117 1 8 1 118 1 7 1 119 1 3 1 120 1 8 1 121 1 15 1 122 1 15 1 123 1 15 1 124 1 3 1 125 1 15 1 126 1 15 1 138 -1 15 1 139 -1 15 1 144 -1 15 1 145 -1 15 1 164 -1 15 1 171 -1 15 1 198 -1 15 1 6 101 -1 13 1 127 1 15 1 128 1 15 1 129 1 15 1 149 -1 19 1 177 1 21 1 6 130 1 13 1 131 1 0 1 132 1 0 1 179 -1 0 1 205 -1 0 1 207 -1 1 1 6 104 -2 14 1 104 -2 13 1 148 2 14 1 148 2 15 1 149 2 14 1 149 2 17 1 12 114 -2 14 1 114 -2 12 1 116 -2 14 1 116 -2 15 1 150 2 14 1 150 2 0 1 151 2 0 1 151 2 13 1 152 2 13 1 152 2 9 1 153 2 15 1 153 2 0 1 5 154 1 13 1 155 1 22 1 156 1 15 1 157 1 22 1 177 -1 17 1 5 155 -1 21 1 157 -1 21 1 158 1 14 1 159 -1 14 1 176 -1 14 1 4 160 1 13 1 173 -1 0 1 175 -1 9 1 183 1 24 1 44 45 -2 7 1 45 -2 0 1 46 -2 7 1 46 -2 0 1 53 -2 7 1 53 -2 9 1 62 -2 0 1 62 -2 8 1 64 -1 8 1 65 -2 9 1 65 -2 8 1 68 -2 0 1 68 -2 9 1 77 -1 11 1 78 -1 11 1 79 -1 11 1 82 -1 11 1 83 -1 11 1 84 -1 11 1 85 -1 11 1 86 -1 11 1 87 -1 11 1 88 -1 12 1 89 -1 12 1 90 -1 12 1 92 -1 12 1 93 -1 12 1 95 -1 12 1 111 -2 1 1 111 -2 14 1 141 -2 0 1 141 -2 15 1 146 -2 9 1 146 -2 15 1 147 -1 15 1 162 -1 12 1 182 2 8 1 182 2 13 1 183 -2 9 1 183 -2 23 1 191 2 9 1 191 2 13 1 195 2 9 1 195 2 14 1 ccseapps-2.5/CCSEApps/pAmrDerive/amrvis.defaults0000644000175000017500000000052011634153073022744 0ustar amckinstryamckinstrypalette grayscale palette Palette initialderived density initialscale 1 numberformat %8.5e maxpixmapsize 10000 maxpixmapsize 20000000 reservesystemcolors 24 showboxes TRUE windowheight 650 windowwidth 700 filetype newplt ccseapps-2.5/CCSEApps/pAmrDerive/.3rd0000644000175000017500000000001311634153073020400 0ustar amckinstryamckinstryignore rus ccseapps-2.5/CCSEApps/pAmrDerive/Palette0000644000175000017500000000140011634153073021231 0ustar amckinstryamckinstry #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúöñíéäàÛ×ÓÎÊÅÁ½¸´¯«§¢ž™•‘Œˆƒ #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveBinTrac.cpp0000644000175000017500000001244111634153073023544 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrDeriveBinTrac.cpp,v 1.9 2001/08/01 21:51:06 lijewski Exp $ // #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" static void PrintUsage (char* progName) { cout << "\nUsage:\n" << progName << "\n\tinfile = inputFileName" << "\n\t[-help]" << "\n\n"; exit(1); } static Array BinTrac (AmrData& amrData) { Array sum(3,0); const int dcomp = 0; // Density component number. const int tcomp = 5; // Tracer component number. int finest_level = amrData.FinestLevel(); FArrayBox fab_d, fab_t; for (int iLevel = 0; iLevel <= finest_level; ++iLevel) { const Real* dx = amrData.DxLevel()[iLevel].dataPtr(); MultiFabIterator mfi_d(amrData.GetGrids(iLevel, dcomp)); MultiFabIterator mfi_t(amrData.GetGrids(iLevel, tcomp)); for ( ; mfi_d.isValid(); ++mfi_d, ++mfi_t) { // // Make copy of FABs so that we can change them. // fab_d.resize(mfi_d.fabbox(), 1); fab_t.resize(mfi_t.fabbox(), 1); fab_d.copy(mfi_d(), 0, 0, 1); fab_t.copy(mfi_t(), 0, 0, 1); if (iLevel < finest_level) { const BoxArray& f_box = amrData.boxArray(iLevel+1); for (int j = 0; j < f_box.length(); j++) { Box c_box = ::coarsen(f_box[j],amrData.RefRatio()[iLevel]); c_box &= mfi_d.validbox(); if (c_box.ok()) { fab_d.setVal(0.0, c_box, 0); fab_t.setVal(0.0, c_box, 0); } } } Real s[3]; const Real* dat_d = fab_d.dataPtr(); const int* dlo = fab_d.loVect(); const int* dhi = fab_d.hiVect(); const Real* dat_t = fab_t.dataPtr(); const int* lo = mfi_d.validbox().loVect(); const int* hi = mfi_d.validbox().hiVect(); FORT_BINTRAC(dat_t,ARLI(dlo),ARLIM(dhi),dat_d,lo,hi,dx,s); for (int i = 0; i < 3; i++) sum[i] += s[i]; } } ParallelDescriptor::ReduceRealSum(sum[0]); ParallelDescriptor::ReduceRealSum(sum[1]); ParallelDescriptor::ReduceRealSum(sum[2]); return sum; } int main (int argc, char* argv[]) { // // Make sure to catch new failures. // set_new_handler(Utility::OutOfMemory); if (argc == 1) PrintUsage(argv[0]); ParallelDescriptor::StartParallel(&argc, &argv); ParmParse pp(argc-1,argv+1); if (pp.contains("help")) PrintUsage(argv[0]); // FArrayBox::setFormat(FABio::FAB_IEEE_32); FArrayBox::setFormat(FABio::FAB_NATIVE); // // Set default info. // Real gam = 1.667; FORT_SETGAMMA(&gam); // // Scan the arguments. // std::string iFile; pp.query("infile", iFile); if (iFile.isNull()) BoxLib::Abort("You must specify `infile'"); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(iFile, fileType); if (!dataServices.AmrDataOk()) { // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); } AmrData& amrData = dataServices.AmrDataRef(); BL_ASSERT(amrData.NComp() == NSTATECOMPS); Array sum = BinTrac(amrData); if (ParallelDescriptor::IOProcessor()) { const Array& size = amrData.ProbSize(); cout << amrData.Time() << ',' << sum[0] << ',' << sum[1] << ',' << sum[2] << '\n'; } DataServices::Dispatch(DataServices::ExitRequest, NULL); } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveTurbfile_F.F0000644000175000017500000000361511634153073023651 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "ArrayLim.H" #define SDIM 3 subroutine WRITEVEL(u,DIMS(u),lo,hi,psize) implicit none integer DIMDEC(u) integer lo(SDIM), hi(SDIM) REAL_T u(DIMV(u),SDIM) REAL_T psize(SDIM) integer i,j,k,n open(3,file='Turb',form='formatted') rewind 3 write(3,*)hi(1)-lo(1)+1,hi(2)-lo(2)+1,hi(3)-lo(3)+1 write(3,*)psize(1),psize(2),psize(3) write(3,*)1,1,1 do n = 1,SDIM do k = lo(3),hi(3) do j = lo(2),hi(2) do i = lo(1),hi(1) write(3,*)u(i,j,k,n) enddo enddo enddo enddo close(3) end ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveIntegrate.cpp0000644000175000017500000002671611634153073024156 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrDeriveIntegrate.cpp,v 1.17 2002/03/28 01:34:18 vince Exp $ // // This is a version of AmrDerive.cpp that calculates integrals of // quantities and writes out scalars instead of plotfiles. // #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" static void PrintUsage (char* progName) { std::cout << "\nUsage:\n" << progName << "\n\tinfile = inputFileName" << "\n\t[-help]" << "\n\n"; exit(1); } static Real SumThisComp(AmrData &amrData, const int ncomp) { Real sum(0.0); int finest_level(amrData.FinestLevel()); FArrayBox fab; for(int iLevel(0); iLevel <= finest_level; ++iLevel) { const Real *dx = amrData.DxLevel()[iLevel].dataPtr(); MultiFab &adGrids = amrData.GetGrids(iLevel, ncomp); MFIter ntmfi(adGrids); for( ; ntmfi.isValid(); ++ntmfi) { // // Make copy of FAB so that we can change it. // fab.resize(ntmfi.fabbox(), 1); fab.copy(adGrids[ntmfi], 0, 0, 1); // src has only one component if(iLevel < finest_level) { const BoxArray& f_box = amrData.boxArray(iLevel+1); for(int j(0); j < f_box.size(); ++j) { Box c_box = BoxLib::coarsen(f_box[j],amrData.RefRatio()[iLevel]); c_box &= ntmfi.validbox(); if(c_box.ok()) { fab.setVal(0.0, c_box, 0); } } } Real s; const Real *dat = fab.dataPtr(); const int *dlo = fab.loVect(); const int *dhi = fab.hiVect(); const int *lo = ntmfi.validbox().loVect(); const int *hi = ntmfi.validbox().hiVect(); int nz = hi[1]-lo[1]+1; Array tmp(nz); FORT_SUMMASS(dat, ARLIM(dlo), ARLIM(dhi), ARLIM(lo), ARLIM(hi), dx, &s, tmp.dataPtr()); sum += s; } } ParallelDescriptor::ReduceRealSum(sum); amrData.FlushGrids(ncomp); return sum; } static Real SumConc (Array& mfout, AmrData& amrData) { Real sum = 0; // // The component number of concentration in the MultiFabs. // const int ncomp = 0; int finest_level = mfout.size() - 1; FArrayBox fab; for(int iLevel = 0; iLevel <= finest_level; ++iLevel) { const Real* dx = amrData.DxLevel()[iLevel].dataPtr(); //MultiFabIterator ntmfi(*mfout[iLevel]); MFIter ntmfi(*mfout[iLevel]); for( ; ntmfi.isValid(); ++ntmfi) { // // Make copy of FAB so that we can change it. // fab.resize(ntmfi.fabbox(), 1); //fab.copy(ntmfi(), ncomp, 0, 1); fab.copy((*mfout[iLevel])[ntmfi], ncomp, 0, 1); if(iLevel < finest_level) { const BoxArray& f_box = mfout[iLevel+1]->boxArray(); for(int j = 0; j < f_box.size(); j++) { Box c_box = BoxLib::coarsen(f_box[j],amrData.RefRatio()[iLevel]); c_box &= ntmfi.validbox(); if(c_box.ok()) fab.setVal(0.0, c_box, 0); } } Real s; const Real* dat = fab.dataPtr(); const int* dlo = fab.loVect(); const int* dhi = fab.hiVect(); const int* lo = ntmfi.validbox().loVect(); const int* hi = ntmfi.validbox().hiVect(); int nz = hi[1]-lo[1]+1; Array tmp(nz); FORT_SUMCONC(dat,ARLIM(dlo),ARLIM(dhi),ARLIM(lo),ARLIM(hi), dx,&s,tmp.dataPtr()); sum += s; } } ParallelDescriptor::ReduceRealSum(sum); return sum; } static Real SumVort (Array& mfout, AmrData& amrData) { Real sum = 0; // // The component number of vorticity in the MultiFabs. // const int ncomp = 1; int finest_level = mfout.size() - 1; FArrayBox fab; for(int iLevel = 0; iLevel <= finest_level; ++iLevel) { const Real* dx = amrData.DxLevel()[iLevel].dataPtr(); MFIter ntmfi(*mfout[iLevel]); for( ; ntmfi.isValid(); ++ntmfi) { // // Make copy of FAB so that we can change it. // fab.resize(ntmfi.fabbox(), 1); //fab.copy(ntmfi(), ncomp, 0, 1); fab.copy((*mfout[iLevel])[ntmfi], ncomp, 0, 1); if(iLevel < finest_level) { const BoxArray& f_box = mfout[iLevel+1]->boxArray(); for(int j = 0; j < f_box.size(); j++) { Box c_box = BoxLib::coarsen(f_box[j],amrData.RefRatio()[iLevel]); c_box &= ntmfi.validbox(); if(c_box.ok()) fab.setVal(0.0, c_box, 0); } } Real s; const Real* dat = fab.dataPtr(); const int* dlo = fab.loVect(); const int* dhi = fab.hiVect(); const int* lo = ntmfi.validbox().loVect(); const int* hi = ntmfi.validbox().hiVect(); int nz = hi[1]-lo[1]+1; Array tmp(nz); FORT_SUMVORT(dat,ARLIM(dlo),ARLIM(dhi),ARLIM(lo),ARLIM(hi), dx,&s,tmp.dataPtr()); sum += s; } } ParallelDescriptor::ReduceRealSum(sum); return sum; } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if(argc == 1) PrintUsage(argv[0]); int iLevel; ParallelDescriptor::StartParallel(&argc, &argv); ParmParse pp; if(pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Set default info. // Real gam = 1.667; FORT_SETGAMMA(&gam); // // Scan the arguments. // std::string iFile; pp.query("infile", iFile); if(iFile.empty()) { BoxLib::Abort("You must specify `infile'"); } const int ntype = 0; //Array derives(ntype); Array derives(1); derives[0] = "logden"; //derives[1] = "vorticity"; DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(iFile, fileType); if( ! dataServices.AmrDataOk()) { // This calls ParallelDescriptor::EndParallel() and exit() DataServices::Dispatch(DataServices::ExitRequest, NULL); } AmrData &amrData = dataServices.AmrDataRef(); BL_ASSERT(amrData.NComp() == NSTATECOMPS); int finestLevel = amrData.FinestLevel(); Array mfout(finestLevel + 1); FArrayBox srcFab; if(ntype > 0) { for(iLevel = 0; iLevel <= finestLevel; ++iLevel) { const BoxArray& ba = amrData.boxArray(iLevel); mfout[iLevel] = new MultiFab(ba, ntype, 0); MultiFab& mfo = *mfout[iLevel]; for(int nt = 0; nt < ntype; ++nt) { int whichDerived = -1; for(int nder = 0; nder < NumDeriveFunc; ++nder) { if(derives[nt] == DerivedQuants[nder].name) { whichDerived = nder; break; } } BL_ASSERT(whichDerived >= 0); Array mfin(amrData.NComp()); int validComp = -1; for(int iComp = 0; iComp < NSTATECOMPS; ++iComp) { if(DerivedQuants[whichDerived].derMap[iComp] == 1) { mfin[iComp] = &amrData.GetGrids(iLevel, iComp); validComp = iComp; } } BL_ASSERT(validComp >= 0); MFIter ntmfi(*mfin[validComp]); for( ; ntmfi.isValid(); ++ntmfi) { int ng = ntmfi.index(); srcFab.resize(ntmfi.validbox(), NSTATECOMPS); for(int iComp = 0; iComp < NSTATECOMPS; ++iComp) { if(DerivedQuants[whichDerived].derMap[iComp] == 1) { srcFab.copy((*mfin[iComp])[ng], 0, iComp, 1); } } const Real* srcptr = srcFab.dataPtr(); const int* losrc = srcFab.loVect(); const int* hisrc = srcFab.hiVect(); FArrayBox& destFab = mfo[ng]; Real* destptr = destFab.dataPtr(nt); const int* lodest = destFab.loVect(); const int* hidest = destFab.hiVect(); DerivedQuants[whichDerived].func(srcptr, losrc[0],losrc[1],losrc[2], hisrc[0],hisrc[1],hisrc[2], amrData.NComp(), amrData.GridLocLo()[iLevel][ng].dataPtr(), amrData.GridLocHi()[iLevel][ng].dataPtr(), destptr, lodest[0],lodest[1],lodest[2], hidest[0],hidest[1],hidest[2], lodest,hidest); } } } } // end if(ntype > 0) for(int iYSum(6); iYSum <= 11; ++iYSum) { // just do rho.Y(iYSum) const std::string sCompName = amrData.PlotVarNames()[iYSum]; Real sumComp = SumThisComp(amrData, iYSum); //Real sum_conc = SumConc(mfout,amrData); //Real sum_vort = SumVort(mfout,amrData); if(ParallelDescriptor::IOProcessor()) { const Array& size = amrData.ProbSize(); Real volume = D_TERM(size[0],*size[1],*size[2]); BL_ASSERT(volume > 0); std::cout << "TIME = " << amrData.Time() << " " << sCompName << " = " << sumComp //<< ',' //<< sum_conc //<< ',' //<< sum_vort/volume << '\n'; } } //DataServices::Dispatch(DataServices::ExitRequest, NULL); BoxLib::Finalize(); return 0; } ccseapps-2.5/CCSEApps/pAmrDerive/stochEdgeDataDRMnoAR.txt0000644000175000017500000000263111634153073024302 0ustar amckinstryamckinstry12 13 0 1 6 1 13 1 2 1 25 1 7 1 27 -1 2 1 34 1 7 1 38 1 6 1 39 1 2 1 40 1 9 1 41 1 2 1 42 -1 1 1 46 -1 1 1 49 -1 1 1 50 -1 1 1 13 1 1 6 1 26 1 7 1 28 -1 2 1 42 1 0 1 43 1 4 1 44 1 4 1 45 1 2 1 46 1 0 1 47 1 9 1 48 1 2 1 49 1 0 1 50 1 0 1 51 1 7 1 28 2 1 7 1 3 -1 3 1 8 -1 9 1 9 -1 10 1 13 -1 0 1 14 1 3 1 15 -1 3 1 20 -1 8 1 27 1 0 1 28 1 1 1 29 -1 3 1 35 1 3 1 36 1 8 1 39 -1 0 1 40 1 9 1 41 -2 3 2 41 -2 0 2 45 -1 1 1 47 1 9 1 48 -2 3 2 48 -2 1 2 52 1 8 1 53 1 7 1 54 1 11 2 55 1 10 2 56 1 3 1 57 1 3 1 58 1 3 1 10 3 1 2 1 14 -1 2 1 15 1 2 1 29 1 2 1 35 -1 2 1 41 1 2 1 48 1 2 1 56 -1 2 1 57 -1 2 1 58 -1 2 1 15 4 1 5 1 5 -1 6 1 11 1 5 1 17 -1 6 1 24 1 7 1 30 1 5 1 31 -1 6 1 37 1 5 1 43 -1 1 1 44 -1 1 1 51 -1 5 1 56 -1 6 1 59 -1 6 1 60 -1 6 1 61 -1 6 1 6 4 -1 4 1 6 -1 6 1 11 -1 4 1 30 -1 4 1 37 -1 4 1 51 1 4 1 18 0 -1 0 1 1 -1 1 1 5 1 4 1 6 1 5 1 7 -1 7 1 8 -1 9 1 12 -1 7 1 16 1 7 1 17 1 4 1 19 -1 7 1 31 1 4 1 32 -1 7 1 38 -1 0 1 56 1 4 1 57 -1 7 1 59 1 4 1 60 1 4 1 61 1 4 1 16 2 -1 2 1 7 1 6 1 9 -1 10 1 12 1 6 1 16 -1 6 1 18 1 8 1 19 1 6 1 24 -1 4 1 25 -1 0 1 26 -1 1 1 32 1 6 1 34 -1 0 1 51 -1 1 1 53 -1 2 1 57 1 6 1 62 -1 8 1 5 18 -1 7 1 20 1 2 1 36 -1 2 1 52 -1 2 1 62 1 7 1 8 8 2 6 1 8 2 2 1 21 1 10 1 40 -2 2 1 40 -2 0 1 47 -2 2 1 47 -2 1 1 63 -1 10 1 10 9 2 2 1 9 2 7 1 10 -1 11 1 21 -1 9 1 22 1 11 1 23 -1 11 1 33 -1 11 1 55 -1 2 1 58 -1 11 1 63 1 9 1 6 10 1 10 1 22 -1 10 1 23 1 10 1 33 1 10 1 54 -1 2 1 58 1 10 1 ccseapps-2.5/CCSEApps/pAmrDerive/AmrDerive_IntScale_F.F0000644000175000017500000000623411634153073023736 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "ArrayLim.H" #define SDIM 3 subroutine TRANSV(v,DIMS(v),dx,domnlo, & avVR,avVT,avVZ,Nbin,DIMS(av),maxbin) implicit none integer DIMDEC(v) integer DIMDEC(av) REAL_T v(DIMV(v),SDIM) REAL_T avVR(DIMV(av)) REAL_T avVT(DIMV(av)) REAL_T avVZ(DIMV(av)) integer Nbin(DIMV(av)) REAL_T dx(SDIM), domnlo(SDIM) integer i,j,k,n,bsize,maxbin,bin c REAL_T binVRSQ(0:maxbin),binVTSQ(0:maxbin),binVZSQ(0:maxbin) REAL_T x,y,vx,vy,vz,vr,vt,rat,r,st,ct,kk integer ishift , ishm,npts integer irlo,irhi integer jrlo,jrhi integer krlo,krhi REAL_T energy,scale,sum kk = ARG_L3(av) bsize = 5 ishm = 1.5/dx(1) krlo = 1.5/dx(3) krhi = 4.5/dx(3) irlo = 1.5/dx(1) irhi = 3.0/dx(1) npts = (krhi-krlo+1)*(irhi-irlo+1) jrhi = ARG_H2(v) jrlo = jrhi - 50 npts = npts *(jrhi-jrlo+1) scale = 0.d0 sum = 0.d0 #if 1 do j=jrlo,jrhi do k=krlo,krhi do i=irlo,irhi+ishm sum = sum+v(i,j,k,1) enddo enddo enddo sum = sum / ((krhi-krlo+1)*(irhi+ishm-irlo+1)*(jrhi-jrlo+1)) do j=ARG_L2(v), ARG_H2(v) do k=krlo,krhi do i=irlo,irhi+ishm v(i,j,k,1) = v(i,j,k,1) - sum enddo enddo enddo #endif do ishift = 0,ishm sum = 0.d0 do j=jrlo,jrhi do k=krlo,krhi do i=irlo,irhi sum = sum+v(i,j,k,1)*v(i+ishift,j,k,1) enddo enddo enddo sum = sum/npts if(ishift .eq.0)then energy = sum endif write(6,*)" level, shift",j,ishift,sum,sum/energy scale = scale + sum /energy enddo write(6,*)" scale",j,scale,scale*dx(1) end ccseapps-2.5/CCSEApps/pAmrDerive/AmrDerive_Vfluct.cpp0000644000175000017500000002000411634153073023616 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrDerive_Vfluct.cpp,v 1.2 2003/01/16 21:21:28 marc Exp $ // #include #include #include #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" #include "ArrayLim.H" // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #if defined(BL_FORT_USE_UPPERCASE) # define TRANSV TRANSV # define NORMV NORMV #elif defined(BL_FORT_USE_LOWERCASE) # define TRANSV transv # define NORMV normv #elif defined(BL_FORT_USE_UNDERSCORE) # define TRANSV transv_ # define NORMV normv_ #endif extern "C" { void TRANSV(Real* v, ARLIM_P(vlo), ARLIM_P(vhi), const Real* dx, const Real* domnlo, const Real* avVR, const Real* avVT, const Real* avVZ, Real* avC, int* Nbin, ARLIM_P(alo), ARLIM_P(ahi), const int* maxbin, const int* bsize, Real* rf, Real* tf, Real* zf, Real* cf); void NORMV(Real* rf, Real* tf, Real* zf, Real* cf, const int* Nbin, ARLIM_P(alo), ARLIM_P(ahi)); }; static void PrintUsage (const char* progName) { std::cout << '\n'; std::cout << "Usage:" << '\n'; std::cout << progName << '\n'; std::cout << " infiles = inputFileList" << '\n'; std::cout << " [help=<0,1>]" << '\n'; std::cout << " [bsize=]" << '\n'; std::cout << " [-verbose]" << '\n'; std::cout << '\n'; exit(1); } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc == 1) PrintUsage(argv[0]); ParmParse pp; if (pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Scan the arguments. // bool verbose = false; if (pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(true); } const int nfile = pp.countval("infiles"); if (nfile<=0) BoxLib::Abort("You must specify `infiles'"); std::vector iFile(nfile); pp.queryarr("infiles",iFile); int bsize=5; pp.query("bsize",bsize); DataServices::SetBatchMode(); FileType fileType(NEWPLT); const int nComp = BL_SPACEDIM + 2; Array names(nComp); names[0] = "xvel"; names[1] = "yvel"; names[2] = "zvel"; names[3] = "density"; names[4] = "tracer"; DataServices* dataServices0 = new DataServices(iFile[0], fileType); AmrData& amrData0 = dataServices0->AmrDataRef(); const Box box = amrData0.ProbDomain()[0]; // Get a shifted domnlo vector to center domain Array domnlo(BL_SPACEDIM); for (int i=0; i Nbin(vbox,1); flVR.setVal(0); flVT.setVal(0); flVZ.setVal(0); flC.setVal(0); for (int ifile=0; ifile (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERLGDN (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo, xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3, ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k REAL_T smallr data smallr /1.0e-6/ do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) dat(i,j,k) = log10(max(u(i,j,k,1),smallr)) end do end do end do end c c derive density: c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERDEN (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo, xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3, ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) dat(i,j,k) = u(i,j,k,1) end do end do end do end c c derive x velocity: c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERXVEL (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo, xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3, ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3 :dhii3) integer i,j,k do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) dat(i,j,k) = u(i,j,k,2)/u(i,j,k,1) end do end do end do end c c derive y velocity: c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERYVEL (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo, xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3, ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) dat(i,j,k) = u(i,j,k,3)/u(i,j,k,1) end do end do end do end c c derive z velocity: c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERZVEL (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo, xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3, ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) dat(i,j,k) = u(i,j,k,4)/u(i,j,k,1) end do end do end do end c c derive total energy = (rho*E)/rho: c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERTENG (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo,xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3,ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) dat(i,j,k) = u(i,j,k,5)/u(i,j,k,1) end do end do end do end c c derive total energy = (rho*(E-(u^2+v^2)/2)/rho: c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERIENG (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo, xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3, ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k REAL_T vx,vy,vz,eng do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) vx = u(i,j,k,2)/u(i,j,k,1) vy = u(i,j,k,3)/u(i,j,k,1) vz = u(i,j,k,4)/u(i,j,k,1) eng = u(i,j,k,5)/u(i,j,k,1) dat(i,j,k) = eng - (vx**2+vy**2+vz**2)*half end do end do end do end c c derive kenetic energy = rho(u**2 + v**2 + w**2)/2 c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERKENG (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo,xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3,ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k REAL_T eng do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) eng = u(i,j,k,2)**2 + u(i,j,k,3)**2 + u(i,j,k,4)**2 dat(i,j,k) = half*eng/u(i,j,k,1) end do end do end do end c c derive vorticity c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c c Uses one-sided derivatives at edges. c subroutine FORT_DERVORT (f,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo,xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3,ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T f(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) REAL_T uym,uyp,uy,uzm,uzp,uz REAL_T vxm,vxp,vx,vzm,vzp,vz REAL_T wxm,wxp,wx,wym,wyp,wy REAL_T uc,vc,wc REAL_T uy2m,uy2p,uz2m,uz2p REAL_T vx2m,vx2p,vz2m,vz2p REAL_T wx2m,wx2p,wy2m,wy2p REAL_T vorx,vory,vorz REAL_T ddx,ddy,ddz integer i,j,k ddx = half*float(uhii1-uloi1+1)/(xhi(1)-xlo(1)) ddy = half*float(uhii2-uloi2+1)/(xhi(2)-xlo(2)) ddz = half*float(uhii3-uloi3+1)/(xhi(3)-xlo(3)) do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) uc = f(i,j,k,2)/f(i,j,k,1) if (j.eq.ovlo(2).and.j+2.le.ovhi(2)) then uy2p = f(i,j+2,k,2)/f(i,j+2,k,1) uyp = f(i,j+1,k,2)/f(i,j+1,k,1) uy = ddy*(-uy2p+4*uyp-3*uc) else if (j.eq.ovlo(2)) then uyp = f(i,j+1,k,2)/f(i,j+1,k,1) uy = 2*ddy*(uyp-uc) else if (j.eq.ovhi(2).and.j-2.ge.ovlo(2)) then uy2m = f(i,j-2,k,2)/f(i,j-2,k,1) uym = f(i,j-1,k,2)/f(i,j-1,k,1) uy = ddy*(+uy2m-4*uym+3*uc) else if (j.eq.ovhi(2)) then uym = f(i,j-1,k,2)/f(i,j-1,k,1) uy = 2*ddy*(-uym+uc) else if (j.gt.ovlo(2).and.j.lt.ovhi(2) ) then uyp = f(i,j+1,k,2)/f(i,j+1,k,1) uym = f(i,j-1,k,2)/f(i,j-1,k,1) uy = ddy*(uyp-uym) else write(6,*) 'uy' stop end if if (k.eq.ovlo(3).and.k+2.le.ovhi(3)) then uz2p = f(i,j,k+2,2)/f(i,j,k+2,1) uzp = f(i,j,k+1,2)/f(i,j,k+1,1) uz = ddz*(-uz2p+4*uzp-3*uc) else if (k.eq.ovlo(3)) then uzp = f(i,j,k+1,2)/f(i,j,k+1,1) uz = 2*ddz*(uzp-uc) else if (k.eq.ovhi(3).and.k-2.ge.ovlo(3)) then uz2m = f(i,j,k-2,2)/f(i,j,k-2,1) uzm = f(i,j,k-1,2)/f(i,j,k-1,1) uz = ddz*(+uz2m-4*uzm+3*uc) else if (k.eq.ovhi(3)) then uzm = f(i,j,k-1,2)/f(i,j,k-1,1) uz = 2*ddz*(-uzm+uc) else if (k.gt.ovlo(3) .and. k.lt.ovhi(3)) then uzp = f(i,j,k+1,2)/f(i,j,k+1,1) uzm = f(i,j,k-1,2)/f(i,j,k-1,1) uz = ddz*(uzp-uzm) else write(6,*) 'uz' stop end if vc = f(i,j,k,3)/f(i,j,k,1) if (i.eq.ovlo(1).and.i+2.le.ovhi(1)) then vx2p = f(i+2,j,k,3)/f(i+2,j,k,1) vxp = f(i+1,j,k,3)/f(i+1,j,k,1) vx = ddx*(-vx2p+4*vxp-3*vc) else if (i.eq.ovlo(1)) then vxp = f(i+1,j,k,3)/f(i+1,j,k,1) vx = 2*ddx*(vxp-vc) else if (i.eq.ovhi(1).and.i-2.ge.ovlo(1)) then vx2m = f(i-2,j,k,3)/f(i-2,j,k,1) vxm = f(i-1,j,k,3)/f(i-1,j,k,1) vx = ddx*(+vx2m-4*vxm+3*vc) else if (i.eq.ovhi(1)) then vxm = f(i-1,j,k,3)/f(i-1,j,k,1) vx = 2*ddx*(-vxm+vc) else if (i.gt.ovlo(1).and.i.lt.ovhi(1)) then vxp = f(i+1,j,k,3)/f(i+1,j,k,1) vxm = f(i-1,j,k,3)/f(i-1,j,k,1) vx = ddx*(vxp-vxm) else write(6,*) 'vx' stop end if if (k.eq.ovlo(3).and.k+2.le.ovhi(3)) then vz2p = f(i,j,k+2,3)/f(i,j,k+2,1) vzp = f(i,j,k+1,3)/f(i,j,k+1,1) vz = ddz*(-vz2p+4*vzp-3*vc) else if (k.eq.ovlo(3)) then vzp = f(i,j,k+1,3)/f(i,j,k+1,1) vz = 2*ddz*(vzp-vc) else if (k.eq.ovhi(3).and.k-2.ge.ovlo(3)) then vz2m = f(i,j,k-2,3)/f(i,j,k-2,1) vzm = f(i,j,k-1,3)/f(i,j,k-1,1) vz = ddz*(+vz2m-4*vzm+3*vc) else if (k.eq.ovhi(3)) then vzm = f(i,j,k-1,3)/f(i,j,k-1,1) vz = 2*ddz*(-vzm+vc) else if (k.gt.ovlo(3).and.k.lt.ovhi(3)) then vzp = f(i,j,k+1,3)/f(i,j,k+1,1) vzm = f(i,j,k-1,3)/f(i,j,k-1,1) vz = ddz*(vzp-vzm) else write(6,*) 'vz' stop end if wc = f(i,j,k,4)/f(i,j,k,1) if (i.eq.ovlo(1).and.i+2.le.ovhi(1)) then wx2p = f(i+2,j,k,4)/f(i+2,j,k,1) wxp = f(i+1,j,k,4)/f(i+1,j,k,1) wx = ddx*(-wx2p+4*wxp-3*wc) else if (i.eq.ovlo(1)) then wxp = f(i+1,j,k,4)/f(i+1,j,k,1) wx = 2*ddx*(wxp-wc) else if (i.eq.ovhi(1).and.i-2.ge.ovlo(1)) then wx2m = f(i-2,j,k,4)/f(i-2,j,k,1) wxm = f(i-1,j,k,4)/f(i-1,j,k,1) wx = ddx*(+wx2m-4*wxm+3*wc) else if (i.eq.ovhi(1)) then wxm = f(i-1,j,k,4)/f(i-1,j,k,1) wx = 2*ddx*(-wxm+wc) else if (i.gt.ovlo(1).and.i.lt.ovhi(1)) then wxp = f(i+1,j,k,4)/f(i+1,j,k,1) wxm = f(i-1,j,k,4)/f(i-1,j,k,1) wx = ddx*(wxp-wxm) else write(6,*) 'wx' stop end if if (j.eq.ovlo(2).and.j+2.le.ovhi(2)) then wy2p = f(i,j+2,k,4)/f(i,j+2,k,1) wyp = f(i,j+1,k,4)/f(i,j+1,k,1) wy = ddy*(-wy2p+4*wyp-3*wc) else if (j.eq.ovlo(2)) then wyp = f(i,j+1,k,4)/f(i,j+1,k,1) wy = 2*ddy*(wyp-wc) else if (j.eq.ovhi(2).and.j-2.ge.ovlo(2)) then wy2m = f(i,j-2,k,4)/f(i,j-2,k,1) wym = f(i,j-1,k,4)/f(i,j-1,k,1) wy = ddy*(+wy2m-4*wym+3*wc) else if (j.eq.ovhi(2)) then wym = f(i,j-1,k,4)/f(i,j-1,k,1) wy = 2*ddy*(-wym+wc) else if (j.gt.ovlo(2).and.j.lt.ovhi(2)) then wyp = f(i,j+1,k,4)/f(i,j+1,k,1) wym = f(i,j-1,k,4)/f(i,j-1,k,1) wy = ddy*(wyp-wym) else write(6,*) 'wy' stop end if vorx = wy-vz vory = uz-wx vorz = vx-uy dat(i,j,k) = sqrt(vorx**2+vory**2+vorz**2) end do end do end do end c c derive concentration variable c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERCON (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo,xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3,ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) c dat(i,j,k) = u(i,j,k,nvar)/u(i,j,k,1) c JBB dat(i,j,k) = u(i,j,k,nvar) end do end do end do end c c SUMMASS c c MASS = sum{ vol(i,j)*rho(i,j) } c c Inputs / Outputs: c c rho => density field c rlo,rhi => index limits of rho aray c lo,hi => index limits of grid interior c delta => cell size c sum <= total mass c tmp => temp column array c subroutine FORT_SUMMASS (rho,DIMS(rho),DIMS(grid),delta,sum,tmp) integer DIMDEC(rho) integer DIMDEC(grid) REAL_T sum, delta(3) REAL_T rho(DIMV(rho)) REAL_T tmp(DIM2(grid)) integer i, j, k REAL_T dx, dy, dz, vol dx = delta(1) dy = delta(2) dz = delta(3) vol = dx*dy*dz do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = zero end do do k = ARG_L3(grid), ARG_H3(grid) do i = ARG_L1(grid), ARG_H1(grid) do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = tmp(j) + vol*rho(i,j,k) end do end do end do sum = zero do j = ARG_L2(grid), ARG_H2(grid) sum = sum + tmp(j) end do end c c SUMCONC c c CONC = sum{ vol(i,j,k)*conc(i,j,k)*(1-conc(i,j,k) } c c Inputs / Outputs: c c conc => concentration c rlo,rhi => index limits of rho aray c lo,hi => index limits of grid interior c delta => cell size c sum <= concentration sum c tmp => temp column array c subroutine FORT_SUMCONC (conc,DIMS(conc),DIMS(grid),delta,sum,tmp) integer DIMDEC(conc) integer DIMDEC(grid) REAL_T sum, delta(3) REAL_T conc(DIMV(conc)) REAL_T tmp(DIM2(grid)) integer i, j, k REAL_T dx, dy, dz, vol dx = delta(1) dy = delta(2) dz = delta(3) vol = dx*dy*dz do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = zero end do do k = ARG_L3(grid), ARG_H3(grid) do i = ARG_L1(grid), ARG_H1(grid) do j = ARG_L2(grid), ARG_H2(grid) c tmp(j) = tmp(j) + vol * conc(i,j,k) * (1-conc(i,j,k)) c JBB tmp(j) = tmp(j) + vol * conc(i,j,k) end do end do end do sum = zero do j = ARG_L2(grid), ARG_H2(grid) sum = sum + tmp(j) end do end c c SUMVORT c c VORT = sum{ vol(i,j,k)*vort(i,j,k)**2 } c c Inputs / Outputs: c c vort => vorticity c vlo,vhi => index limits of vorticity array c lo,hi => index limits of grid interior c delta => cell size c sum <= vorticity sum c tmp => temp column array c subroutine FORT_SUMVORT (vort,DIMS(vort),DIMS(grid),delta,sum,tmp) integer DIMDEC(vort) integer DIMDEC(grid) REAL_T sum, delta(3) REAL_T vort(DIMV(vort)) REAL_T tmp(DIM2(grid)) integer i, j, k REAL_T dx, dy, dz, vol dx = delta(1) dy = delta(2) dz = delta(3) vol = dx*dy*dz do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = zero end do do k = ARG_L3(grid), ARG_H3(grid) do i = ARG_L1(grid), ARG_H1(grid) do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = tmp(j) + vol*vort(i,j,k) * vort(i,j,k) end do end do end do sum = zero do j = ARG_L2(grid), ARG_H2(grid) sum = sum + tmp(j) end do end c c derive dilitation c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c c Uses one-sided derivatives at edges. c subroutine FORT_DERDILI (f,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo,xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3,ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T f(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) REAL_T ux2m,ux2p,uxm,uxp,ux REAL_T vy2m,vy2p,vym,vyp,vy REAL_T wz2m,wz2p,wzm,wzp,wz REAL_T uc,vc,wc REAL_T ddx,ddy,ddz integer i,j,k ddx = half*float(uhii1-uloi1+1)/(xhi(1)-xlo(1)) ddy = half*float(uhii2-uloi2+1)/(xhi(2)-xlo(2)) ddz = half*float(uhii3-uloi3+1)/(xhi(3)-xlo(3)) do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) uc = f(i,j,k,2)/f(i,j,k,1) if (i.eq.ovlo(1).and.i+2.le.ovhi(1)) then ux2p = f(i+2,j,k,2)/f(i+2,j,k,1) uxp = f(i+1,j,k,2)/f(i+1,j,k,1) ux = ddx*(-ux2p+4*uxp-3*uc) else if (i.eq.ovlo(1)) then uxp = f(i+1,j,k,2)/f(i+1,j,k,1) ux = 2*ddx*(uxp-uc) else if (i.eq.ovhi(1).and.i-2.ge.ovlo(1)) then ux2m = f(i-2,j,k,2)/f(i-2,j,k,1) uxm = f(i-1,j,k,2)/f(i-1,j,k,1) ux = ddx*(+ux2m-4*uxm+3*uc) else if (i.eq.ovhi(1)) then uxm = f(i-1,j,k,2)/f(i-1,j,k,1) ux = 2*ddx*(-uxm+uc) else if (i.gt.ovlo(1).and.i.lt.ovhi(1)) then uxp = f(i+1,j,k,2)/f(i+1,j,k,1) uxm = f(i-1,j,k,2)/f(i-1,j,k,1) ux = ddx*(uxp-uxm) else write(6,*) 'ux' stop end if vc = f(i,j,k,3)/f(i,j,k,1) if (j.eq.ovlo(2).and.j+2.le.ovhi(2)) then vy2p = f(i,j+2,k,3)/f(i,j+2,k,1) vyp = f(i,j+1,k,3)/f(i,j+1,k,1) vy = ddy*(-vy2p+4*vyp-3*vc) else if (j.eq.ovlo(2)) then vyp = f(i,j+1,k,3)/f(i,j+1,k,1) vy = 2*ddy*(vyp-vc) else if (j.eq.ovhi(2).and.j-2.ge.ovlo(2)) then vy2m = f(i,j-2,k,3)/f(i,j-2,k,1) vym = f(i,j-1,k,3)/f(i,j-1,k,1) vy = ddy*(+vy2m-4*vym+3*vc) else if (j.eq.ovhi(2)) then vym = f(i,j-1,k,3)/f(i,j-1,k,1) vy = 2*ddy*(-vym+vc) else if (j.gt.ovlo(2).and.j.lt.ovhi(2) ) then vyp = f(i,j+1,k,3)/f(i,j+1,k,1) vym = f(i,j-1,k,3)/f(i,j-1,k,1) vy = ddy*(vyp-vym) else write(6,*) 'vy' stop end if wc = f(i,j,k,4)/f(i,j,k,1) if (k.eq.ovlo(3).and.k+2.le.ovhi(3)) then wz2p = f(i,j,k+2,4)/f(i,j,k+2,1) wzp = f(i,j,k+1,4)/f(i,j,k+1,1) wz = ddz*(-wz2p+4*wzp-3*wc) else if (k.eq.ovlo(3)) then wzp = f(i,j,k+1,4)/f(i,j,k+1,1) wz = 2*ddz*(wzp-wc) else if (k.eq.ovhi(3).and.k-2.ge.ovlo(3)) then wz2m = f(i,j,k-2,4)/f(i,j,k-2,1) wzm = f(i,j,k-1,4)/f(i,j,k-1,1) wz = ddz*(+wz2m-4*wzm+3*wc) else if (k.eq.ovhi(3)) then wzm = f(i,j,k-1,4)/f(i,j,k-1,1) wz = 2*ddz*(-wzm+wc) else if (k.gt.ovlo(3) .and. k.lt.ovhi(3)) then wzp = f(i,j,k+1,4)/f(i,j,k+1,1) wzm = f(i,j,k-1,4)/f(i,j,k-1,1) wz = ddz*(wzp-wzm) else write(6,*) 'wz' stop end if dat(i,j,k) = ux + vy + wz end do end do end do end c c The following routine does NOT have the signature of a derived function. c c BINTRAC c c Bin the tracer for concentration in the following intervals: c c (0.25, 0.75), (0.1, 0.9) & (0.05, 0.95) c c Inputs / Outputs: c c trac => tracer (rho(i,j,k)*conc(i,j,k)) c rho => density c DIMS(c) => index limits of rho and trac arrays c lo,hi => index limits of grid interior c delta => cell size c sum <= concentration sum c subroutine FORT_BINTRAC (trac,DIMS(c),rho,lo,hi,delta,sum) integer DIMDEC(c) integer lo(3), hi(3) REAL_T sum(3), delta(3) REAL_T trac(DIMV(c)) REAL_T rho(DIMV(c)) integer i, j, k REAL_T vol,conc vol = delta(1)*delta(2)*delta(3) do i = 1, 3 sum(i) = zero end do do k = lo(3), hi(3) do i = lo(1), hi(1) do j = lo(2), hi(2) if (rho(i,j,k) .gt. 0) then conc = trac(i,j,k) / rho(i,j,k) if ((conc .gt. .25) .and. (conc .lt. .75)) then sum(1) = sum(1) + vol * trac(i,j,k) end if if ((conc .gt. .1) .and. (conc .lt. .9)) then sum(2) = sum(2) + vol * trac(i,j,k) end if if ((conc .gt. .05) .and. (conc .lt. .95)) then sum(3) = sum(3) + vol * trac(i,j,k) end if end if end do end do end do end c c derive tracer: c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c dat <=> (modify) array holding derived data c dlo,dhi => (const) index limits of dat array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERTRAC (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo, xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3, ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) dat(i,j,k) = u(i,j,k,TRACER_POSITION) end do end do end do end c subroutine FORT_DERTMASK (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo, xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3, ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) REAL_T ryco, ryco2 integer i,j,k #include "xxmeth.fh" c write(6,*) 'FORT_DERTMASK: using alpha = ', alpha do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) ryco2 = u(i,j,k,9) ryco = u(i,j,k,11) if (abs(ryco2).gt.alpha*abs(ryco)) then dat(i,j,k) = u(i,j,k,6) else dat(i,j,k) = 0.0 endif end do end do end do end c subroutine FORT_DERSTATE (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo, xhi,dat,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3, ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T dat(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k #include "xxmeth.fh" do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) dat(i,j,k) = u(i,j,k,qposition) end do end do end do end c c sqrt(u**2 + v**2 + w**2) c derive mach number = ------------------------ c sqrt(gamma * pres / rho) c c Inputs/Outputs c u => (const) state array c ulo,uhi => (const) index limits of u c nvar => (const) number of variables in state array c xlo => (const) physical location of lo end of u c xhi => (const) physical location of hi end of u c mach <=> (modify) array holding derived data c dlo,dhi => (const) index limits of mach array c ovlo,ovhi => (const) subregion where derivation is done c subroutine FORT_DERMACH (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,xlo,xhi,mach,dloi1,dloi2,dloi3,dhii1,dhii2,dhii3,ovlo,ovhi) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer dloi1,dloi2,dloi3 integer dhii1,dhii2,dhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T vx, vy, vz REAL_T xlo(3), xhi(3) REAL_T u(uloi1:uhii1, uloi2:uhii2, uloi3:uhii3, nvar) REAL_T mach(dloi1:dhii1, dloi2:dhii2, dloi3:dhii3) integer i,j,k REAL_T vvtmp, rho, c, eng, pres #include "xxmeth.fh" do k = ovlo(3),ovhi(3) do j = ovlo(2),ovhi(2) do i = ovlo(1),ovhi(1) rho = u(i,j,k,1) vx = u(i,j,k,2)/rho vy = u(i,j,k,3)/rho vz = u(i,j,k,4)/rho vvtmp = vx**2 + vy**2 + vz**2 eng = u(i,j,k,5) - half * rho * vvtmp pres = eng * (gamma - one) c = sqrt(gamma * pres / rho) mach(i,j,k) = sqrt(vvtmp) / c end do end do end do end subroutine FORT_SELECTPOS (prob,DIMS(c),rn,dx,dy,dz,x,y,z) implicit none integer DIMDEC(c) REAL_T prob(DIMV(c)) REAL_T dx,dy,dz,x,y,z,rn integer ix, iy, iz do iz = c_l3, c_h3-1 if (rn.le.prob(c_h1,c_h2,iz)) go to 100 enddo 100 continue do iy = c_l2, c_h2-1 if (rn.le.prob(c_h1,iy,iz)) go to 200 enddo 200 continue do ix = c_l1, c_h1-1 if (rn.le.prob(ix,iy,iz)) go to 300 enddo 300 continue x = (ix+half)*dx y = (iy+half)*dy z = (iz+half)*dz end subroutine FORT_PROBFAB (rf,DIMS(c),rr,prob,DIMS(p), & nspec,nreac,ispec, & edges,edgeslen,pedges,isrz,dx,dy,dz) implicit none integer DIMDEC(c), DIMDEC(p), nspec, nreac, ispec, isrz integer edgeslen, edges(0:edgeslen-1), pedges(0:nspec-1) REAL_T rf(DIMV(c),0:nreac-1) REAL_T rr(DIMV(c),0:nreac-1) REAL_T prob(DIMV(p)), dx, dy, dz integer ix, iy, iz, ie, nedges, rxnid, factor, nu REAL_T lambda, lmax if (ispec.lt.zero.or.ispec.gt.nspec-1) stop 'invalid ispec' nedges = edges(pedges(ispec)) do iz = p_l3, p_h3 do iy = p_l2, p_h2 do ix = p_l1, p_h1 lambda = 0 do ie = 0, nedges-1 rxnid = edges(pedges(ispec)+ie*4+1) factor = edges(pedges(ispec)+ie*4+2) nu = edges(pedges(ispec)+ie*4+4) if (factor.gt.zero) then lambda = nu*lambda + rf(ix,iy,iz,rxnid)/factor else lambda = nu*lambda - rr(ix,iy,iz,rxnid)/factor end if end do prob(ix,iy,iz) = lambda*dx*dy*dz end do end do enddo end subroutine FORT_ACCUMPROB (prob, DIMS(p), totreact, cumprob) implicit none integer DIMDEC(p) REAL_T prob(DIMV(p)), totreact, cumprob integer ix, iy, iz do iz = p_l3, p_h3 do iy = p_l2, p_h2 do ix = p_l1, p_h1 prob(ix,iy,iz) = cumprob+prob(ix,iy,iz)/totreact cumprob = prob(ix,iy,iz) enddo enddo enddo end ccseapps-2.5/CCSEApps/pAmrDerive/binread.m0000644000175000017500000000452011634153073021500 0ustar amckinstryamckinstryfunction [ dim, ngrid, loc, siz, dat] = binread(filename) % Read binary AMR data from a file % % dim = number of space dimensions (2 or 3) % ngrid = array of number of grids on each level (length=nlev) % % Other quantities are cell arrays of cell arrays: % loc{level}{jgrid} = [ xmin xmax ymin ymax ] ( or [ ... zmin zmax ] ) % siz{level}{jgrid} = [ nx ny ] ( or [ nx ny nz ] ) % dat{ivar}{level}{jgrid} = an array of size nx x ny, or nx x ny x nz % % We check that number of variables = 2. Hopefully variable #1 is phase % field and variable #2 is temperature, though we don't check that. if nargin<1 error('Usage: binread infile'); end [ fid, message ] = fopen( filename, 'r' ); if fid == -1 error(message) end % Read the number of spatial dimensions [ dim , count ] = fread(fid,1,'int32'); % Read the number of levels [ nlev , count ] = fread(fid,1,'int32'); % Read the array sizes [ ngrid, count ] = fread( fid, nlev, 'int32' ); if count~=nlev; error('Couldn''t read grid sizes'); end if any(ngrid<=0) error( [ 'Bad number of grids: ngrid = ' num2str(ngrid) ] ); end disp( [ 'Grids =' sprintf(' %d',ngrid) ] ); % Read the grid physical locations loc = cell(nlev,1); for l=1:nlev loc{l} = cell(ngrid(l),1); for j=1:ngrid(l) [ gridloc, count ] = fread( fid, 2*dim, 'double' ); if count~=2*dim; error( [ 'Couldn''t read grid loc at level ' num2str(l) ... ' grid ' num2str(j) ] ); end loc{l}{j} = gridloc; end end % Read the grid dimensions siz = cell(nlev,1); for l=1:nlev siz{l} = cell(ngrid(l),1); for j=1:ngrid(l) [ gridsiz, count ] = fread( fid, dim, 'int32' ); if count~=dim; error( [ 'Couldn''t read grid dims at level ' num2str(l) ... ' grid ' num2str(j) ] ); end siz{l}{j} = gridsiz; end end % Read the actual data nvar = 1; dat = cell(nvar,1); for ivar=1:nvar dat{ivar} = cell(nlev,1); for l=1:nlev dat{l} = cell(ngrid(l),1); for j=1:ngrid(l) ndat = prod(siz{l}{j}); [ griddat, count ] = fread(fid,ndat,'double'); if count ~= ndat error( [ 'Couldn''t read grid data at level ' num2str(l) ... ' grid ' num2str(j) ] ); end dat{l}{j} = reshape(griddat,siz{l}{j}'); end end end ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveIntScalLen_F.H0000644000175000017500000000751711634153073024100 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ /* ** $Id: AmrDeriveIntScalLen_F.H,v 1.4 2003/01/08 22:36:21 marc Exp $ */ #include #include #ifdef BL_LANG_FORT # define FORT_SCALLEN scallen3d # define FORT_TKE tke3d # define FORT_TI ti3d # define FORT_TAVG tavg3d # define FORT_GUS gusqrd #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_SCALLEN SCALLEN3D # define FORT_TKE TKE3D # define FORT_TI TI3D # define FORT_TAVG TAVG3D # define FORT_GUS GUSQRD # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_SCALLEN scallen3d # define FORT_TKE tke3d # define FORT_TI ti3d # define FORT_TAVG tavg3d # define FORT_GUS gusqrd # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_SCALLEN scallen3d_ # define FORT_TKE tke3d_ # define FORT_TI ti3d_ # define FORT_TAVG tavg3d_ # define FORT_GUS gusqrd_ # endif // // Use ARLIM in the following. // extern "C" { void FORT_SCALLEN(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *dx, const int *ovlo, const int *ovhi, Real* TSL_z, Real* corr, const int& corrSize, Real* ug, const int &uglo1, const int &uglo2, const int &uglo3, const int &ughi1, const int &ughi2, const int &ughi3); void FORT_TKE(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *dx, const int *ovlo, const int *ovhi, Real* TKE_z); void FORT_GUS(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *dx, const int *ovlo, const int *ovhi, Real* GUS_z); void FORT_TI(const Real *u, const int &uloi1, const int &uloi2, const int &uloi3, const int &uhii1, const int &uhii2, const int &uhii3, const int &nvar, const Real *dx, const int *ovlo, const int *ovhi, Real* TI_z); void FORT_TAVG(const Real *T, const int &Tloi1, const int &Tloi2, const int &Tloi3, const int &Thii1, const int &Thii2, const int &Thii3, const int &nvar, const Real *dx, const int *ovlo, const int *ovhi, Real* TAVG_z); } #endif ccseapps-2.5/CCSEApps/pAmrDerive/xtra_3D.F0000644000175000017500000000364411634153073021337 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "CONSTANTS.H" #include "ArrayLim.H" #include "BC_TYPES.H" #include "xtra_F.H" #define DIM 3 subroutine FORT_PUSHVTOG(lo, hi, dlo, dhi, U, DIMS(U), nc) implicit none integer nc integer lo(DIM), hi(DIM) integer dlo(DIM), dhi(DIM) integer DIMDEC(U) REAL_T U(DIMV(U),nc) integer i,j,k,n REAL_T xlo(DIM), dx(DIM) c c Make up something for these that gets what we want c do n=1,DIM dx(n) = one xlo(n) = one end do do n=1,nc call hoextraptocc(U(ARG_L1(U),ARG_L2(U),ARG_L3(U),n), $ DIMS(U),dlo,dhi,dx,xlo) end do end ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveIso.cpp0000644000175000017500000011561211634153073022760 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ //BL_COPYRIGHT_NOTICE #include #include #include #include #include #include #include #include using std::cout; using std::endl; #ifndef WIN32 #include #endif #ifdef DO_TEC #include "TECIO.h" #endif #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "FArrayBox.H" struct Point { Real x,y,z; bool operator == (const Point& rhs) const { return x==rhs.x && y==rhs.y && z==rhs.z;} bool operator < (const Point& rhs) const { if (z < rhs.z) { return true; } else if (z == rhs.z) { if (y < rhs.y) { return true; } else if (y == rhs.y) { if (x < rhs.x) { return true; } else return false; } } return false; } }; typedef struct { Point p[3]; } Triangle; typedef struct { Point p[8]; Real val[8]; } Cell; /* Linearly interpolate the position where an isosurface cuts an edge between two vertices, each with their own scalar value */ Point VertexInterp(Real isolevel,Point p1,Point p2,Real valp1,Real valp2) { Real mu; Point p; if (abs(isolevel-valp1) < 0.00001) return(p1); if (abs(isolevel-valp2) < 0.00001) return(p2); if (abs(valp1-valp2) < 0.00001) return(p1); mu = (isolevel - valp1) / (valp2 - valp1); p.x = p1.x + mu * (p2.x - p1.x); p.y = p1.y + mu * (p2.y - p1.y); p.z = p1.z + mu * (p2.z - p1.z); return(p); } /* Given a grid cell and an isolevel, calculate the triangular facets required to represent the isosurface through the cell. Return the number of triangular facets, the array "triangles" will be loaded up with the vertices at most 5 triangular facets. 0 will be returned if the grid cell is either totally above of totally below the isolevel. */ int Polygonise(Cell grid,Real isolevel,Triangle *triangles) { int i,ntriang; int cubeindex; Point vertlist[12]; int edgeTable[256]={ 0x0 , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c, 0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00, 0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c, 0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90, 0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c, 0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30, 0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac, 0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0, 0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c, 0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60, 0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc, 0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0, 0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c, 0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950, 0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc , 0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0, 0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc, 0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0, 0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c, 0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650, 0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc, 0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0, 0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c, 0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460, 0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac, 0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0, 0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c, 0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230, 0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c, 0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190, 0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c, 0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0 }; int triTable[256][16] = {{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1}, {3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1}, {3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1}, {3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1}, {9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1}, {9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1}, {2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1}, {8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1}, {9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1}, {4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1}, {3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1}, {1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1}, {4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1}, {4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1}, {5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1}, {2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1}, {9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1}, {0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1}, {2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1}, {10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1}, {5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1}, {5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1}, {9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1}, {0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1}, {1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1}, {10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1}, {8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1}, {2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1}, {7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1}, {2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1}, {11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1}, {5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1}, {11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1}, {11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1}, {1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1}, {9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1}, {5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1}, {2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1}, {5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1}, {6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1}, {3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1}, {6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1}, {5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1}, {1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1}, {10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1}, {6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1}, {8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1}, {7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1}, {3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1}, {5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1}, {0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1}, {9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1}, {8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1}, {5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1}, {0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1}, {6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1}, {10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1}, {10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1}, {8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1}, {1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1}, {0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1}, {10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1}, {3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1}, {6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1}, {9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1}, {8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1}, {3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1}, {6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1}, {0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1}, {10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1}, {10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1}, {2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1}, {7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1}, {7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1}, {2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1}, {1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1}, {11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1}, {8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1}, {0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1}, {7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1}, {10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1}, {2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1}, {6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1}, {7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1}, {2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1}, {1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1}, {10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1}, {10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1}, {0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1}, {7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1}, {6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1}, {8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1}, {9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1}, {6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1}, {4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1}, {10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1}, {8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1}, {0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1}, {1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1}, {8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1}, {10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1}, {4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1}, {10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1}, {5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1}, {11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1}, {9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1}, {6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1}, {7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1}, {3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1}, {7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1}, {9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1}, {3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1}, {6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1}, {9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1}, {1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1}, {4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1}, {7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1}, {6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1}, {3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1}, {0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1}, {6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1}, {0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1}, {11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1}, {6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1}, {5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1}, {9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1}, {1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1}, {1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1}, {10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1}, {0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1}, {5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1}, {10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1}, {11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1}, {9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1}, {7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1}, {2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1}, {8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1}, {9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1}, {9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1}, {1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1}, {9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1}, {9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1}, {5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1}, {0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1}, {10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1}, {2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1}, {0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1}, {0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1}, {9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1}, {5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1}, {3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1}, {5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1}, {8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1}, {0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1}, {9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1}, {0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1}, {1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1}, {3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1}, {4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1}, {9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1}, {11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1}, {11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1}, {2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1}, {9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1}, {3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1}, {1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1}, {4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1}, {4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1}, {0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1}, {3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1}, {3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1}, {0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1}, {9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1}, {1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}; /* Determine the index into the edge table which tells us which vertices are inside of the surface */ cubeindex = 0; if (grid.val[0] < isolevel) cubeindex |= 1; if (grid.val[1] < isolevel) cubeindex |= 2; if (grid.val[2] < isolevel) cubeindex |= 4; if (grid.val[3] < isolevel) cubeindex |= 8; if (grid.val[4] < isolevel) cubeindex |= 16; if (grid.val[5] < isolevel) cubeindex |= 32; if (grid.val[6] < isolevel) cubeindex |= 64; if (grid.val[7] < isolevel) cubeindex |= 128; /* Cube is entirely in/out of the surface */ if (edgeTable[cubeindex] == 0) return(0); /* Find the vertices where the surface intersects the cube */ if (edgeTable[cubeindex] & 1) vertlist[0] = VertexInterp(isolevel,grid.p[0],grid.p[1],grid.val[0],grid.val[1]); if (edgeTable[cubeindex] & 2) vertlist[1] = VertexInterp(isolevel,grid.p[1],grid.p[2],grid.val[1],grid.val[2]); if (edgeTable[cubeindex] & 4) vertlist[2] = VertexInterp(isolevel,grid.p[2],grid.p[3],grid.val[2],grid.val[3]); if (edgeTable[cubeindex] & 8) vertlist[3] = VertexInterp(isolevel,grid.p[3],grid.p[0],grid.val[3],grid.val[0]); if (edgeTable[cubeindex] & 16) vertlist[4] = VertexInterp(isolevel,grid.p[4],grid.p[5],grid.val[4],grid.val[5]); if (edgeTable[cubeindex] & 32) vertlist[5] = VertexInterp(isolevel,grid.p[5],grid.p[6],grid.val[5],grid.val[6]); if (edgeTable[cubeindex] & 64) vertlist[6] = VertexInterp(isolevel,grid.p[6],grid.p[7],grid.val[6],grid.val[7]); if (edgeTable[cubeindex] & 128) vertlist[7] = VertexInterp(isolevel,grid.p[7],grid.p[4],grid.val[7],grid.val[4]); if (edgeTable[cubeindex] & 256) vertlist[8] = VertexInterp(isolevel,grid.p[0],grid.p[4],grid.val[0],grid.val[4]); if (edgeTable[cubeindex] & 512) vertlist[9] = VertexInterp(isolevel,grid.p[1],grid.p[5],grid.val[1],grid.val[5]); if (edgeTable[cubeindex] & 1024) vertlist[10] = VertexInterp(isolevel,grid.p[2],grid.p[6],grid.val[2],grid.val[6]); if (edgeTable[cubeindex] & 2048) vertlist[11] = VertexInterp(isolevel,grid.p[3],grid.p[7],grid.val[3],grid.val[7]); /* Create the triangle */ ntriang = 0; for (i=0;triTable[cubeindex][i]!=-1;i+=3) { triangles[ntriang].p[0] = vertlist[triTable[cubeindex][i ]]; triangles[ntriang].p[1] = vertlist[triTable[cubeindex][i+1]]; triangles[ntriang].p[2] = vertlist[triTable[cubeindex][i+2]]; ntriang++; } return(ntriang); } struct Node { enum typeEnum{INIT=0, COVERED=1, VALID=2}; Node() : level(-1), iv(IntVect(D_DECL(-1,-1,-1))), type(Node::INIT) {} Node(const IntVect& idx, int lev, typeEnum typ = INIT) : level(lev), iv(idx), type(typ) {} inline bool operator< (const Node& rhs) const { if (level < rhs.level) return true; if ((level == rhs.level) && iv.lexLT(rhs.iv)) return true; return false; } inline bool operator!= (const Node& rhs) const { return ((*this) < rhs || rhs < (*this)); } IntVect iv; int level; typeEnum type; }; std::ostream& operator<< (std::ostream& os, const Node& node) { os << "Node: IntVect=" << node.iv << ", level=" << node.level << ", type="; if (node.type==Node::INIT) os << "INIT"; else if (node.type==Node::COVERED) os << "COVERED"; else os << "VALID"; if (os.fail()) BoxLib::Error("operator<<(ostream&,Node&) failed"); return os; } struct Element { #if (BL_SPACEDIM==2) #define MYLEN 4 Element(const Node& a, const Node& b, const Node& c, const Node& d) { n[0]=&a; n[1]=&b; n[2]=&c; n[3]=&d; } #else #define MYLEN 8 Element(const Node& a, const Node& b, const Node& c, const Node& d, const Node& e, const Node& f, const Node& g, const Node& h) { n[0]=&a; n[1]=&b; n[2]=&c; n[3]=&d; n[4]=&e; n[5]=&f; n[6]=&g; n[7]=&h; } #endif const Node* n[MYLEN]; inline bool operator< (const Element& rhs) const { for (int i=0; i0]\n"; std::cerr << "\t nComp=number of comps[DEF->all]\n"; std::cerr << "\t box=int list of LL+UR of subbox (lev-0 coords) [DEF->all]>\n"; exit(1); } void main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc < 2) print_usage(argc,argv); ParmParse pp; if (pp.contains("help")) print_usage(argc,argv); if (pp.contains("verbose")) AmrData::SetVerbose(true); std::string infile; pp.get("file",infile); #ifdef DO_TEC std::string outfile_DEF = infile+".plt"; #else std::string outfile_DEF = infile+".dat"; #endif std::string outfile(outfile_DEF); pp.query("out",outfile); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(infile, fileType); if (!dataServices.AmrDataOk()) DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); const Array& names = amrData.PlotVarNames(); Array comps; if (int nc = pp.countval("comps")) { comps.resize(nc); pp.getarr("comps",comps,0,nc); } else { int sComp = 0; pp.query("sComp",sComp); int nComp = amrData.NComp(); pp.query("nComp",nComp); BL_ASSERT(sComp+nComp <= amrData.NComp()); comps.resize(nComp); for (int i=0; i barr; pp.getarr("box",barr,0,nx); int d=BL_SPACEDIM; BL_ASSERT(barr.size()==2*d); subbox=Box(IntVect(D_DECL(barr[0],barr[1],barr[2])), IntVect(D_DECL(barr[d],barr[d+1],barr[d+2]))); } else { subbox = amrData.ProbDomain()[0]; } int Nlev = amrData.FinestLevel() + 1; Array gridArray(Nlev); Array subboxArray(Nlev); for (int lev=0; lev NodeFab; typedef FabArray MultiNodeFab; PArray nodes(Nlev,PArrayManage); cout << "Before nodes allocated" << endl; for (int lev=0; lev NodeMap; NodeMap nodeMap; for (int lev=0; lev nodeVect(nodeMap.size()); for (NodeMap::const_iterator it=nodeMap.begin(); it!=nodeMap.end(); ++it) nodeVect[(*it).second] = (*it).first; cout << "Final nodeVect built" << endl; nodeMap.clear(); elements.clear(); nodes.clear(); cout << "Temp nodes, elements cleared" << endl; PArray fileData(Nlev); for (int lev=0; lev dx = amrData.DxLevel()[node.level]; const IntVect& iv = node.iv; for (int dir=0; dir #include #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif static void PrintUsage (const char* progName) { std::cout << '\n'; std::cout << "Usage:" << '\n'; std::cout << progName << '\n'; std::cout << " infile = inputFileName" << '\n'; std::cout << " outfile = outputFileName" << '\n'; std::cout << " type = derivedTypeName" << '\n'; std::cout << " [-help]" << '\n'; std::cout << " [-verbose]" << '\n'; std::cout << " [fab.format = FormatType]" << '\n'; std::cout << " where FormatType=IEEE32(default), ASCII, 8BIT, or NATIVE" << '\n'; std::cout << '\n'; std::cout << "Available types:" << '\n'; for (int nder = 0; nder < NumDeriveFunc; ++nder) { std::cout << " " << DerivedQuants[nder].name << '\n'; } std::cout << '\n'; exit(1); } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc == 1) PrintUsage(argv[0]); // // Make sure to catch new failures. // //set_new_handler(Utility::OutOfMemory); //ParallelDescriptor::StartParallel(&argc, &argv); ParmParse pp; if (pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Set default info. // Real gam(1.667); FORT_SETGAMMA(&gam); Real alp(2.37); FORT_SETALPHA(&alp); // // Scan the arguments. // std::string iFileDir, iFile, oFile, oFileDir; bool verbose = false; if (pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(true); } pp.query("infile", iFile); if (iFile.empty()) BoxLib::Abort("You must specify `infile'"); pp.query("outfile", oFile); if (oFile.empty()) BoxLib::Abort("You must specify `outfile'"); int ntype = pp.countname("type"); if (ntype == 0) BoxLib::Abort("You must specify at least one `type'"); Array derives(ntype); int i; for (i = 0; i < ntype; ++i) { pp.getkth("type",i,derives[i]); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Derived quantities = " << derives[i] << '\n'; } DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(iFile, fileType); if (!dataServices.AmrDataOk()) { // // don't call DataServices::ExitRequest with DataServices::SetBatchMode() // //DataServices::Dispatch(DataServices::ExitRequest, NULL); ParallelDescriptor::EndParallel(); } AmrData& amrData = dataServices.AmrDataRef(); BL_ASSERT(amrData.NComp() == NSTATECOMPS); int finestLevel = amrData.FinestLevel(); // // Make the result MultiFab's. // Array mfout(finestLevel+1); FArrayBox srcFab; for (int iLevel = 0; iLevel <= finestLevel; ++iLevel) { const BoxArray& ba = amrData.boxArray(iLevel); mfout[iLevel] = new MultiFab(ba, ntype, 0); MultiFab& mfo = *mfout[iLevel]; for (int nt = 0; nt < ntype; ++nt) { int whichDerived = -1; bool foundDerived = false; for (int nder = 0; nder < NumDeriveFunc; ++nder) { if (derives[nt] == DerivedQuants[nder].name) { foundDerived = true; whichDerived = nder; break; } } if (!foundDerived) { std::cerr << "Invalid derived quantity: " << derives[nt] << std::endl; BoxLib::Abort(); } Array mfin(amrData.NComp()); int validComp = -1; for (int iComp = 0; iComp < NSTATECOMPS; ++iComp) { if (DerivedQuants[whichDerived].derMap[iComp] == 1) { mfin[iComp] = &amrData.GetGrids(iLevel, iComp); validComp = iComp; } } BL_ASSERT(validComp >= 0); for (MFIter ntmfi(*mfin[validComp]); ntmfi.isValid(); ++ntmfi) { int ng = ntmfi.index(); srcFab.resize (ntmfi.validbox(), NSTATECOMPS); for (int iComp = 0; iComp < NSTATECOMPS; ++iComp) { if (DerivedQuants[whichDerived].derMap[iComp] == 1) { srcFab.copy((*mfin[iComp])[ng], 0, iComp); } } const Real* srcptr = srcFab.dataPtr(); const int* losrc = srcFab.loVect(); const int* hisrc = srcFab.hiVect(); FArrayBox& destFab = mfo[ng]; Real* destptr = destFab.dataPtr(nt); const int* lodest = destFab.loVect(); const int* hidest = destFab.hiVect(); DerivedQuants[whichDerived].func(srcptr, losrc[0],losrc[1],losrc[2], hisrc[0],hisrc[1],hisrc[2], amrData.NComp(), amrData.GridLocLo()[iLevel][ng].dataPtr(), amrData.GridLocHi()[iLevel][ng].dataPtr(), destptr, lodest[0],lodest[1],lodest[2], hidest[0],hidest[1],hidest[2], lodest,hidest); } } } if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(oFile,0755)) BoxLib::CreateDirectoryFailed(oFile); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string oFileHeader(oFile); oFileHeader += "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream os; os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Opening file = " << oFileHeader << '\n'; os.open(oFileHeader.c_str(), std::ios::out|std::ios::binary); if (os.fail()) BoxLib::FileOpenFailed(oFileHeader); // // Start writing plotfile. // os << amrData.PlotFileVersion() << '\n'; int n_var = ntype; os << n_var << '\n'; for (int n = 0; n < ntype; n++) os << derives[n] << '\n'; os << BL_SPACEDIM << '\n'; os << amrData.Time() << '\n'; os << finestLevel << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << amrData.ProbLo()[i] << ' '; os << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << amrData.ProbHi()[i] << ' '; os << '\n'; for (i = 0; i < finestLevel; i++) os << amrData.RefRatio()[i] << ' '; os << '\n'; for (i = 0; i <= finestLevel; i++) os << amrData.ProbDomain()[i] << ' '; os << '\n'; for (i = 0; i <= finestLevel; i++) os << 0 << ' '; os << '\n'; for (i = 0; i <= finestLevel; i++) { for (int k = 0; k < BL_SPACEDIM; k++) os << amrData.DxLevel()[i][k] << ' '; os << '\n'; } os << amrData.CoordSys() << '\n'; os << "0\n"; // The bndry data width. // // Write out level by level. // for (int iLevel = 0; iLevel <= finestLevel; ++iLevel) { // // Write state data. // int nGrids = amrData.boxArray(iLevel).size(); char buf[64]; sprintf(buf, "Level_%d", iLevel); if (ParallelDescriptor::IOProcessor()) { os << iLevel << ' ' << nGrids << ' ' << amrData.Time() << '\n'; os << 0 << '\n'; for (i = 0; i < nGrids; ++i) { for (int n = 0; n < BL_SPACEDIM; n++) { os << amrData.GridLocLo()[iLevel][i][n] << ' ' << amrData.GridLocHi()[iLevel][i][n] << '\n'; } } // // Build the directory to hold the MultiFabs at this level. // std::string Level(oFile); Level += '/'; Level += buf; if (!BoxLib::UtilCreateDirectory(Level, 0755)) BoxLib::CreateDirectoryFailed(Level); } // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); // // Now build the full relative pathname of the MultiFab. // static const std::string MultiFabBaseName("/MultiFab"); std::string PathName(oFile); PathName += '/'; PathName += buf; PathName += MultiFabBaseName; if (ParallelDescriptor::IOProcessor()) { // // The full name relative to the Header file. // std::string RelativePathName(buf); RelativePathName += '/'; RelativePathName += MultiFabBaseName; os << RelativePathName << '\n'; } VisMF::Write(*mfout[iLevel], PathName, VisMF::OneFilePerCPU); delete mfout[iLevel]; } os.close(); // // don't call DataServices::ExitRequest with DataServices::SetBatchMode() // //DataServices::Dispatch(DataServices::ExitRequest, NULL); //ParallelDescriptor::EndParallel(); BoxLib::Finalize(); return 0; } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveTecplot.cpp0000644000175000017500000003472711634153073023647 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ //BL_COPYRIGHT_NOTICE #include #include #include #include #include #include #include #include using std::cout; using std::endl; #ifndef WIN32 #include #endif #include "TECIO.h" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "FArrayBox.H" struct Node { enum typeEnum{INIT=0, COVERED=1, VALID=2}; Node() : level(-1), iv(IntVect(D_DECL(-1,-1,-1))), type(Node::INIT) {} Node(const IntVect& idx, int lev, typeEnum typ = INIT) : level(lev), iv(idx), type(typ) {} inline bool operator< (const Node& rhs) const { if (level < rhs.level) return true; if ((level == rhs.level) && iv.lexLT(rhs.iv)) return true; return false; } inline bool operator!= (const Node& rhs) const { return ((*this) < rhs || rhs < (*this)); } IntVect iv; int level; typeEnum type; }; std::ostream& operator<< (std::ostream& os, const Node& node) { os << "Node: IntVect=" << node.iv << ", level=" << node.level << ", type="; if (node.type==Node::INIT) os << "INIT"; else if (node.type==Node::COVERED) os << "COVERED"; else os << "VALID"; if (os.fail()) BoxLib::Error("operator<<(ostream&,Node&) failed"); return os; } struct Element { #if (BL_SPACEDIM==2) #define MYLEN 4 Element(const Node& a, const Node& b, const Node& c, const Node& d) { n[0]=&a; n[1]=&b; n[2]=&c; n[3]=&d; } #else #define MYLEN 8 Element(const Node& a, const Node& b, const Node& c, const Node& d, const Node& e, const Node& f, const Node& g, const Node& h) { n[0]=&a; n[1]=&b; n[2]=&c; n[3]=&d; n[4]=&e; n[5]=&f; n[6]=&g; n[7]=&h; } #endif const Node* n[MYLEN]; inline bool operator< (const Element& rhs) const { for (int i=0; i0]\n"; std::cerr << "\t nComp=number of comps[DEF->all]\n"; std::cerr << "\t box=int list of LL+UR of subbox (lev-0 coords) [DEF->all]>\n"; exit(1); } void main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc < 2) print_usage(argc,argv); ParmParse pp; if (pp.contains("help")) print_usage(argc,argv); if (pp.contains("verbose")) AmrData::SetVerbose(true); std::string infile; pp.get("file",infile); std::string outfile(infile+".plt"); pp.query("out",outfile); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(infile, fileType); if (!dataServices.AmrDataOk()) // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); const Array& names = amrData.PlotVarNames(); Array comps; if (int nc = pp.countval("comps")) { comps.resize(nc); pp.getarr("comps",comps,0,nc); } else { int sComp = 0; pp.query("sComp",sComp); int nComp = amrData.NComp(); pp.query("nComp",nComp); BL_ASSERT(sComp+nComp <= amrData.NComp()); comps.resize(nComp); for (int i=0; i barr; pp.getarr("box",barr,0,nx); int d=BL_SPACEDIM; BL_ASSERT(barr.size()==2*d); subbox=Box(IntVect(D_DECL(barr[0],barr[1],barr[2])), IntVect(D_DECL(barr[d],barr[d+1],barr[d+2]))); } else { subbox = amrData.ProbDomain()[0]; } int Nlev = amrData.FinestLevel() + 1; Array gridArray(Nlev); Array subboxArray(Nlev); for (int lev=0; lev NodeFab; typedef FabArray MultiNodeFab; PArray nodes(Nlev,PArrayManage); cout << "Before nodes allocated" << endl; for (int lev=0; lev NodeMap; NodeMap nodeMap; for (int lev=0; lev nodeVect(nodeMap.size()); for (NodeMap::const_iterator it=nodeMap.begin(); it!=nodeMap.end(); ++it) nodeVect[(*it).second] = (*it).first; cout << "Final nodeVect built" << endl; nodeMap.clear(); elements.clear(); nodes.clear(); cout << "Temp nodes, elements cleared" << endl; PArray fileData(Nlev); for (int lev=0; lev dx = amrData.DxLevel()[node.level]; const IntVect& iv = node.iv; for (int dir=0; dir .dspDepends $(DspFileRoot).dsp: .dspDepends @(echo Building DSP file = $(DspFileRoot).dsp;\ $(TOP)/scripts/dsp.mak -p $(DspFileRoot) -t $(TOP) -d $(DIM) -o $(DspFileRoot).dsp -O $(DspOlevel) -f $^) include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/pAmrDerive/DERIVE_2D.F0000644000175000017500000002606411634153073021337 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: DERIVE_2D.F,v 1.20 2002/07/23 17:11:56 lijewski Exp $ c #include "CONSTANTS.H" #include "Derived.H" #define DIM 2 c c The following routine does NOT have the signature of a derived function. c c This routine assumes domain is of form: [(0,0),(xlen,ylen)] c subroutine FORT_RANDMOVE (a,DIMS(c),b,c,d,u,nspec,x,y,spec, & dx,dy,dt,dxinv,dyinv) implicit none integer DIMDEC(c), nspec, spec REAL_T x, y, dx, dy, dt, dxinv, dyinv REAL_T a(DIMV(c),0:nspec-1) REAL_T b(DIMV(c),0:nspec-1) REAL_T c(DIMV(c),0:nspec-1) REAL_T d(DIMV(c),0:nspec-1) REAL_T u(DIMV(c),2) integer i, ix, iy REAL_T rn if (spec.lt.zero.or.spec.ge.nspec) stop 'bad species ref (df)' ! ! First advect stuff ... ! ix = x * dxinv iy = y * dyinv if ((ix.ge.c_l1.and.ix.le.c_h1) .and. & (iy.ge.c_l2.and.iy.le.c_h2)) then x = x + u(ix,iy,1) * dt y = y + u(ix,iy,2) * dt if (x.lt.zero) x = -x end if ! ! Now do the stochastic diffusion ... ! ix = x * dxinv iy = y * dyinv if ((ix.ge.c_l1.and.ix.le.c_h1) .and. & (iy.ge.c_l2.and.iy.le.c_h2)) then call blutilrand(rn) if (rn.lt.a(ix,iy,spec)*dt) then x = x - dx else if (rn.lt.b(ix,iy,spec)*dt) then x = x + dx else if (rn.lt.c(ix,iy,spec)*dt) then y = y - dy else if (rn.lt.d(ix,iy,spec)*dt) then y = y + dy end if end if end subroutine FORT_MAXDTDIFF (d,DIMS(c),nspec,x,y,spec, & dx,dy,dt,dxinv,dyinv) implicit none integer DIMDEC(c), nspec, spec REAL_T x, y, dx, dy, dt, dxinv, dyinv REAL_T d(DIMV(c),0:nspec-1) integer i, j, ilo, ihi, jlo, jhi, ix, iy REAL_T rn, dmax if (spec.lt.zero.or.spec.ge.nspec) stop 'bad species ref (df)' ix = x * dxinv iy = y * dyinv dmax = 0 if ((ix.ge.c_l1.and.ix.le.c_h1) .and. & (iy.ge.c_l2.and.iy.le.c_h2)) then ilo = max(ix-2,c_l1) ihi = min(ix+2,c_h1) jlo = max(iy-2,c_l2) jhi = min(iy+2,c_h2) do i = ilo, ihi do j = jlo, jhi dmax = max(dmax,d(i,j,spec)) end do end do end if if (dmax.gt.zero) dt = min(dt,.1/dmax) end c c This routine assumes domain is of form: [(0,0),(xlen,ylen)] c c conc is really conc.invert(1) so we can multiply instead of divide ... c subroutine FORT_CHEMMOVE (rf,DIMS(c),rr,conc,nspec,nreac, & edges,edgeslen,pedges,x,y,spec, & dx,dy,dt,rxn,dxinv,dyinv) implicit none integer DIMDEC(c), nspec, nreac, spec, rxn integer edgeslen, edges(0:edgeslen-1), pedges(0:nspec-1) REAL_T x, y, dx, dy, dt, dxinv, dyinv REAL_T rf(DIMV(c),0:nreac-1) REAL_T rr(DIMV(c),0:nreac-1) REAL_T conc(DIMV(c),0:nspec-1) integer i, ix, iy, ie, nedges, rxnid, factor, tospec, nu REAL_T rn, lambda, netreact if (spec.lt.zero.or.spec.ge.nspec) stop 'bad species ref (ch)' ix = x * dxinv iy = y * dyinv if ((ix.ge.c_l1.and.ix.le.c_h1) .and. & (iy.ge.c_l2.and.iy.le.c_h2)) then call blutilrand(rn) if (pedges(spec).lt.zero) stop 'invalid reaction ref (ch)' lambda = 0 nedges = edges(pedges(spec)) if (nedges.le.zero) stop 'nedges must be positive (ch)' do ie = 0, nedges-1 rxnid = edges(pedges(spec)+ie*4+1) factor = edges(pedges(spec)+ie*4+2) tospec = edges(pedges(spec)+ie*4+3) nu = edges(pedges(spec)+ie*4+4) if (factor.gt.zero) then c netreact = max(rf(ix,iy,rxnid)-rr(ix,iy,rxnid),zero) netreact = rf(ix,iy,rxnid) lambda = nu*lambda+netreact*conc(ix,iy,spec)*dt/factor else c netreact = max(rr(ix,iy,rxnid)-rf(ix,iy,rxnid),zero) netreact = rr(ix,iy,rxnid) lambda = nu*lambda-netreact*conc(ix,iy,spec)*dt/factor end if if (rn.lt.lambda) then rxn = rxnid spec = tospec goto 100 end if end do end if 100 continue end subroutine FORT_MAXLAMBDA (rf,DIMS(c),rr,conc,nspec,nreac, & edges,edgeslen,pedges) implicit none integer DIMDEC(c), nspec, nreac integer edgeslen, edges(0:edgeslen-1), pedges(0:nspec-1) REAL_T rf(DIMV(c),0:nreac-1) REAL_T rr(DIMV(c),0:nreac-1) REAL_T conc(DIMV(c),0:nspec-1) integer i, ispec, ix, iy, ie, nedges, rxnid, factor, tospec, nu REAL_T rn, lambda, lmax, netreact do ispec = 0, nspec-1 lmax = 0 nedges = edges(pedges(ispec)) do ix = c_l1, c_h1 do iy = c_l2, c_h2 lambda = 0 do ie = 0, nedges-1 rxnid = edges(pedges(ispec)+ie*4+1) factor = edges(pedges(ispec)+ie*4+2) tospec = edges(pedges(ispec)+ie*4+3) nu = edges(pedges(ispec)+ie*4+4) if (factor.gt.zero) then c netreact = max(rf(ix,iy,rxnid)-rr(ix,iy,rxnid),zero) netreact = rf(ix,iy,rxnid) lambda = nu*lambda+netreact*conc(ix,iy,ispec)/factor else c netreact = max(rr(ix,iy,rxnid)-rf(ix,iy,rxnid),zero) netreact = rr(ix,iy,rxnid) lambda = nu*lambda-netreact*conc(ix,iy,ispec)/factor end if end do lmax = max(lmax,lambda) end do end do write(*,*) 'spec = ', ispec, 'lmax = ', lmax end do end subroutine FORT_MAXDTLAMBDA (rf,DIMS(c),rr,conc,nspec,nreac, & edges,edgeslen,pedges,x,y,spec, & dx,dy,dt,dxinv,dyinv) implicit none integer DIMDEC(c), nspec, nreac, spec integer edgeslen, edges(0:edgeslen-1), pedges(0:nspec-1) REAL_T x, y, dx, dy, dt, dxinv, dyinv REAL_T rf(DIMV(c),0:nreac-1) REAL_T rr(DIMV(c),0:nreac-1) REAL_T conc(DIMV(c),0:nspec-1) integer i, j, ix, iy, ie, nedges, rxnid, factor, tospec, nu integer ilo, ihi, jlo, jhi, ipos REAL_T lambda, lmax, netreact if (spec.lt.zero.or.spec.ge.nspec) stop 'bad species ref (ch)' ix = x * dxinv iy = y * dyinv lmax = 0 if (pedges(spec).lt.zero) stop 'invalid reaction ref (ch)' lambda = 0 nedges = edges(pedges(spec)) if (nedges.le.zero) stop 'nedges must be positive (ch)' do ie = 0, nedges-1 rxnid = edges(pedges(spec)+ie*4+1) factor = edges(pedges(spec)+ie*4+2) tospec = edges(pedges(spec)+ie*4+3) nu = edges(pedges(spec)+ie*4+4) if (factor.gt.zero) then c netreact = max(rf(ix,iy,rxnid)-rr(ix,iy,rxnid),zero) netreact = rf(ix,iy,rxnid) lambda = nu*lambda+netreact*conc(ix,iy,spec)/factor else c netreact = max(rr(ix,iy,rxnid)-rf(ix,iy,rxnid),zero) netreact = rr(ix,iy,rxnid) lambda = nu*lambda-netreact*conc(ix,iy,spec)/factor end if end do lmax = max(lmax,lambda) if (lmax.gt.zero) dt = min(dt,.1/lmax) end subroutine FORT_PROBFAB (rf,DIMS(c),rr,prob,DIMS(p), & nspec,nreac,ispec, & edges,edgeslen,pedges,isrz,dx,dy) implicit none integer DIMDEC(c), DIMDEC(p), nspec, nreac, ispec, isrz integer edgeslen, edges(0:edgeslen-1), pedges(0:nspec-1) REAL_T rf(DIMV(c),0:nreac-1) REAL_T rr(DIMV(c),0:nreac-1) REAL_T prob(DIMV(p)), dx, dy integer ix, iy, ie, nedges, rxnid, factor, nu REAL_T lambda, lmax, vol if (ispec.lt.zero.or.ispec.gt.nspec-1) stop 'invalid ispec' nedges = edges(pedges(ispec)) do iy = p_l2, p_h2 do ix = p_l1, p_h1 vol = dx*dy if (isrz.ne.0) vol = vol*half*Pi*dx*(2*p_l1+1) lambda = 0 do ie = 0, nedges-1 rxnid = edges(pedges(ispec)+ie*4+1) factor = edges(pedges(ispec)+ie*4+2) nu = edges(pedges(ispec)+ie*4+4) if (factor.gt.zero) then lambda = nu*lambda + rf(ix,iy,rxnid)/factor else lambda = nu*lambda - rr(ix,iy,rxnid)/factor end if end do prob(ix,iy) = lambda*vol end do end do end subroutine FORT_ACCUMPROB (prob, DIMS(p), totreact, cumprob) implicit none integer DIMDEC(p) REAL_T prob(DIMV(p)), totreact, cumprob integer ix, iy do iy = p_l2, p_h2 do ix = p_l1, p_h1 prob(ix,iy) = cumprob+prob(ix,iy)/totreact cumprob = prob(ix,iy) enddo enddo end subroutine FORT_SELECTPOS (prob,DIMS(c),rn,dx,dy,x,y) implicit none integer DIMDEC(c) REAL_T prob(DIMV(c)) REAL_T dx,dy,x,y,rn integer ix, iy do iy = c_l2, c_h2-1 if (rn.le.prob(c_h1,iy)) go to 100 enddo 100 continue do ix = c_l1, c_h1-1 if (rn.le.prob(ix,iy)) go to 200 enddo 200 continue x = (ix+half)*dx y = (iy+half)*dy end ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveStationData.cpp0000644000175000017500000001526411634153073024443 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // AmrDeriveStationData.cpp // #include #include #include #include #include using std::ios; using std::set_new_handler; #include #include "REAL.H" #include "Array.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" //#include "VisMF.H" #include "Derived.H" static void PrintUsage (const char* progName) { cout << '\n'; cout << "Usage:" << '\n'; cout << progName << '\n'; cout << " infile = inputFileName" << '\n'; cout << " outfile = outputFileName" << '\n'; cout << " [maxlev = maxleveltofill]" << '\n'; cout << " [-help]" << '\n'; cout << " [-verbose]" << '\n'; cout << '\n'; cout << "For example" << progName << " inputs.station infile=plt0000 outfile=stations.plt0000"; cout << '\n'; cout << '\n'; exit(1); } int main (int argc, char* argv[]) { if(argc == 1) PrintUsage(argv[0]); // // Make sure to catch new failures. // set_new_handler(Utility::OutOfMemory); ParallelDescriptor::StartParallel(&argc, &argv); //char *stationInFile = argv[1]; //ParmParse pp(argc-2,argv+2, stationInFile); ParmParse pp(argc-1,argv+1); if(pp.contains("help")) PrintUsage(argv[0]); //FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Scan the arguments. // aString iFile, oFile; bool verbose = false; if(pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(true); } pp.query("infile", iFile); cout << "iFile = " << iFile << endl; if(iFile.isNull()) { BoxLib::Abort("You must specify `infile'"); } pp.query("outfile", oFile); if(oFile.isNull()) { BoxLib::Abort("You must specify `outfile'"); } if(verbose) { pp.dumpTable(cout); } DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(iFile, fileType); if( ! dataServices.AmrDataOk()) { //DataServices::Dispatch(DataServices::ExitRequest, NULL); ParallelDescriptor::EndParallel(); } AmrData& amrData = dataServices.AmrDataRef(); // ---------------------- int nStationVars(0), nStationCoords(0); Array stationVars; // Names of StationData components. Array > stationCoords; // Array of stations [nvars][spacedim]. { // // ParmParse variables: // // StationData.vars -- Names of StateData components to output // StationData.coord -- BL_SPACEDIM array of Reals // StationData.coord -- the next one // // example: // // StationData.vars = pressure // StationData.coord = 0.343 0.05075 0.1014 // StationData.coord = 0.1 0.2 0.3 // ParmParse pp("StationData"); if(pp.contains("vars")) { nStationVars = pp.countval("vars"); BL_ASSERT(nStationVars > 0); stationVars.resize(nStationVars); for(int i(0); i < nStationVars; ++i) { pp.get("vars", stationVars[i], i); if(amrData.CanDerive(stationVars[i]) == false) { cerr << "Error: StationData.var `" << stationVars[i] << "' is not in the plot file.\n"; BoxLib::Abort(); } } } else { BoxLib::Abort("Error: must specify StationData.vars"); } if(pp.contains("coord")) { Array data(BL_SPACEDIM); nStationCoords = pp.countname("coord"); stationCoords.resize(nStationCoords); for(int k(0); k < nStationCoords; ++k) { stationCoords[k].resize(BL_SPACEDIM); pp.getktharr("coord", k, data, 0, BL_SPACEDIM); D_TERM(stationCoords[k][0] = data[0];, stationCoords[k][1] = data[1];, stationCoords[k][2] = data[2];); //BL_ASSERT(Geometry::ProbDomain().contains(data.dataPtr())); } } else { BoxLib::Abort("Error: must specify StationData.coords"); } } // ---------------------- int finestLevel = amrData.FinestLevel(); int finestFillLevel = finestLevel; if(pp.contains("maxlev")) { pp.query("maxlev", finestFillLevel); //finestFillLevel = max((int)0, (int)finestFillLevel); //finestFillLevel = min(finestLevel, finestFillLevel); cout << "*--* filling data to finestFillLevel = " << finestFillLevel << endl; } ofstream os; if(verbose && ParallelDescriptor::IOProcessor()) { cout << "Opening file = " << oFile << '\n'; } os.open(oFile.c_str(), ios::out | ios::binary | ios::app); if(os.fail()) { Utility::FileOpenFailed(oFile); } for(int iVar(0); iVar < nStationVars; ++iVar) { for(int iCoord(0); iCoord < nStationCoords; ++iCoord) { int ivLevel; IntVect ivLoc, ivFinestFillLev; amrData.IntVectFromLocation(finestFillLevel, stationCoords[iCoord], ivLoc, ivLevel, ivFinestFillLev); Box destBox(ivFinestFillLev, ivFinestFillLev); FArrayBox destFab(destBox, 1); amrData.FillVar(&destFab, destBox, finestFillLevel, stationVars[iVar], 0); //amrData.FillVar(&destFab, destBox, ivLevel, stationVars[iVar], 0); if(ParallelDescriptor::IOProcessor()) { cout << "ivFinestFillLev = " << ivFinestFillLev << endl; os << amrData.Time() << " " << destFab.dataPtr()[0] << endl; } } } os.close(); ParallelDescriptor::EndParallel(); } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveAvgPlots.cpp0000644000175000017500000002477011634153073023771 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrDeriveAvgPlots.cpp,v 1.13 2001/10/17 17:53:33 lijewski Exp $ // #include #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #if (BL_SPACEDIM == 3) #include "Derived.H" #endif #define VSHOWVAL(verbose, val) { if(verbose) { \ cout << #val << " = " << val << '\n'; } } void PrintUsage(char *progName); // ---------------------------------------------------------------------- int main(int argc, char *argv[]) { ParallelDescriptor::StartParallel(&argc, &argv); if(argc == 1) { PrintUsage(argv[0]); } int iPlot, iLevel, iComp; ParmParse pp(argc-1,argv+1); pp.dumpTable(cout); if(pp.contains("help")) { PrintUsage(argv[0]); } // // Make sure to catch new failures. // set_new_handler(Utility::OutOfMemory); FArrayBox::setFormat(FABio::FAB_IEEE_32); cout << endl; cout << "******* Using FABio::FAB_IEEE_32" << endl; cout << endl; // // Scan the arguments. // //int i; std::string iFileDir; std::string iFile; std::string oFile; std::string oFileDir; bool verbose(false); if(pp.contains("verbose") || (pp.contains("v"))) { verbose = true; AmrData::SetVerbose(true); } int nPlotFiles(pp.countval("infile")); if(nPlotFiles <= 0) { cerr << "Bad nPlotFiles: " << nPlotFiles << endl; cerr << "Exiting." << endl; DataServices::Dispatch(DataServices::ExitRequest, NULL); } VSHOWVAL(verbose, nPlotFiles); Array plotFileNames(nPlotFiles); for(iPlot = 0; iPlot < nPlotFiles; ++iPlot) { pp.get("infile", plotFileNames[iPlot], iPlot); VSHOWVAL(verbose, plotFileNames[iPlot]); } pp.get("outfile", oFile); VSHOWVAL(verbose, oFile); DataServices::SetBatchMode(); FileType fileType(NEWPLT); Array dataServicesPtrArray(nPlotFiles); Array amrDataPtrArray(nPlotFiles); for(iPlot = 0; iPlot < nPlotFiles; ++iPlot) { dataServicesPtrArray[iPlot] = new DataServices(plotFileNames[iPlot], fileType); if( ! dataServicesPtrArray[iPlot]->AmrDataOk()) { DataServices::Dispatch(DataServices::ExitRequest, NULL); // ^^^ this calls ParallelDescriptor::EndParallel() and exit() } amrDataPtrArray[iPlot] = &(dataServicesPtrArray[iPlot]->AmrDataRef()); } // check that all the plotfiles have the same structure int nComp(amrDataPtrArray[0]->NComp()); int finestLevel(amrDataPtrArray[0]->FinestLevel()); Array plotVarNames(amrDataPtrArray[0]->PlotVarNames()); Array boxArray(finestLevel + 1); for(iLevel = 0; iLevel <= finestLevel; ++iLevel) { boxArray[iLevel] = amrDataPtrArray[0]->boxArray(iLevel); } bool bPlotStructureMatches(true); for(iPlot = 0; iPlot < nPlotFiles; ++iPlot) { if(amrDataPtrArray[iPlot]->FinestLevel() != finestLevel) { bPlotStructureMatches = false; } if(amrDataPtrArray[iPlot]->NComp() != nComp) { bPlotStructureMatches = false; } for(iComp = 0; iComp < nComp; ++iComp) { if(amrDataPtrArray[iPlot]->PlotVarNames()[iComp] != plotVarNames[iComp]) { bPlotStructureMatches = false; } } for(iLevel = 0; iLevel <= finestLevel; ++iLevel) { if(amrDataPtrArray[iPlot]->boxArray(iLevel) != boxArray[iLevel]) { bPlotStructureMatches = false; } } } if( ! bPlotStructureMatches) { cerr << "Plot file structures do not match." << endl; cerr << "Exiting." << endl; DataServices::Dispatch(DataServices::ExitRequest, NULL); } // Make the result MultiFab's. Array mfout(finestLevel+1); Array mfin(nPlotFiles); // loop through the levels for(iLevel = 0; iLevel <= finestLevel; ++iLevel) { const BoxArray &ba = boxArray[iLevel]; int nGhost(0); mfout[iLevel] = new MultiFab(ba, nComp, nGhost); MultiFab &mfo = *mfout[iLevel]; mfo.setVal(0.0); // loop through the components for(int nc = 0; nc < nComp; ++nc) { for(iPlot = 0; iPlot < nPlotFiles; ++iPlot) { // cache the grids mfin[iPlot] = &(amrDataPtrArray[iPlot]->GetGrids(iLevel, nc)); } // loop through the fabs (within the multifab) at this level for(MultiFabIterator mfomfi(mfo); mfomfi.isValid(); ++mfomfi) { int iFab(mfomfi.index()); // Do the averaging for(iPlot = 0; iPlot < nPlotFiles; ++iPlot) { //mfo[iFab] += (*mfin[iPlot])[iFab]; mfo[iFab].plus((*mfin[iPlot])[iFab], 0, nc); // 0 is the srcComp } mfo[iFab].divide((Real) nPlotFiles, nc); } // end for(mfomfi...) } // end for(nc...) } // end for(iLevel...) // write the output plotfile if (ParallelDescriptor::IOProcessor()) if (!Utility::UtilCreateDirectory(oFile, 0755)) Utility::CreateDirectoryFailed(oFile); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string oFileHeader(oFile); oFileHeader += "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); ofstream os; os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.length()); int i; if(ParallelDescriptor::IOProcessor()) { if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "Opening file = " << oFileHeader << '\n'; } } os.open(oFileHeader.c_str(), ios::out|ios::binary); if(os.fail()) Utility::FileOpenFailed(oFileHeader); // // Start writing plotfile. // os << amrDataPtrArray[0]->PlotFileVersion() << '\n'; int n_var(nComp); os << n_var << '\n'; for(int n = 0; n < nComp; n++) os << plotVarNames[n] << '\n'; os << BL_SPACEDIM << '\n'; os << amrDataPtrArray[0]->Time() << '\n'; // use first plotfile time os << finestLevel << '\n'; for(i = 0; i < BL_SPACEDIM; i++) os << amrDataPtrArray[0]->ProbLo()[i] << ' '; os << '\n'; for(i = 0; i < BL_SPACEDIM; i++) os << amrDataPtrArray[0]->ProbHi()[i] << ' '; os << '\n'; for(i = 0; i < finestLevel; i++) os << amrDataPtrArray[0]->RefRatio()[i] << ' '; os << '\n'; for(i = 0; i <= finestLevel; i++) os << amrDataPtrArray[0]->ProbDomain()[i] << ' '; os << '\n'; for(i = 0; i <= finestLevel; i++) os << 0 << ' '; os << '\n'; for(i = 0; i <= finestLevel; i++) { for(int k = 0; k < BL_SPACEDIM; k++) os << amrDataPtrArray[0]->DxLevel()[i][k] << ' '; os << '\n'; } os << amrDataPtrArray[0]->CoordSys() << '\n'; os << "0\n"; // The bndry data width. } // end if(ioproc) // // Write out level by level. // for(iLevel = 0; iLevel <= finestLevel; ++iLevel) { // Write state data. int nGrids(amrDataPtrArray[0]->boxArray(iLevel).length()); char buf[64]; sprintf(buf, "Level_%d", iLevel); if(ParallelDescriptor::IOProcessor()) { os << iLevel << ' ' << nGrids << ' ' << amrDataPtrArray[0]->Time() << '\n'; os << 0 << '\n'; for(i = 0; i < nGrids; ++i) { for(int n = 0; n < BL_SPACEDIM; n++) { os << amrDataPtrArray[0]->GridLocLo()[iLevel][i][n] << ' ' << amrDataPtrArray[0]->GridLocHi()[iLevel][i][n] << '\n'; } } // // Build the directory to hold the MultiFabs at this level. // std::string Level(oFile); Level += '/'; Level += buf; if (!Utility::UtilCreateDirectory(Level, 0755)) Utility::CreateDirectoryFailed(Level); } // end if(ioproc) // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); // Now build the full relative pathname of the MultiFab. static const std::string MultiFabBaseName("/MultiFab"); std::string PathName(oFile); PathName += '/'; PathName += buf; PathName += MultiFabBaseName; if(ParallelDescriptor::IOProcessor()) { // The full name relative to the Header file. std::string RelativePathName(buf); RelativePathName += '/'; RelativePathName += MultiFabBaseName; os << RelativePathName << '\n'; } VisMF::Write(*mfout[iLevel], PathName, VisMF::OneFilePerCPU); delete mfout[iLevel]; } // end for(iLevel...) os.close(); DataServices::Dispatch(DataServices::ExitRequest, NULL); // ^^^ this calls ParallelDescriptor::EndParallel() and exit() } // ---------------------------------------------------------------------- void PrintUsage(char *progName) { cout << '\n'; cout << "Usage:" << '\n'; cout << progName << '\n'; cout << " outfile = outputFileName" << '\n'; cout << " infile = inputFileName(s)" << '\n'; cout << " [-help]" << '\n'; cout << " [-verbose]" << '\n'; cout << '\n'; cout << '\n'; exit(-1); } // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrDerive/AmrDerive_VtoRTZavg_F.F0000644000175000017500000000723411634153073024103 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "ArrayLim.H" #define SDIM 3 subroutine TRANSV(v,DIMS(v),dx,domnlo, & avVR,avVT,avVZ,avC,Nbin,DIMS(av),maxbin,bsize) implicit none integer DIMDEC(v) integer DIMDEC(av) REAL_T v(DIMV(v),SDIM+2) REAL_T avVR(DIMV(av)) REAL_T avVT(DIMV(av)) REAL_T avVZ(DIMV(av)) REAL_T avC(DIMV(av)) integer Nbin(DIMV(av)) REAL_T dx(SDIM), domnlo(SDIM) integer i,j,k,n,bsize,maxbin,bin REAL_T x,y,vx,vy,vz,vr,vt,rat,r,st,ct,kk kk = ARG_L3(av) do j=ARG_L2(v),ARG_H2(v) do n=0,maxbin Nbin(j,n,kk) = 0 avVR(j,n,kk) = 0.d0 avVT(j,n,kk) = 0.d0 avVZ(j,n,kk) = 0.d0 avC(j,n,kk) = 0.d0 enddo do k=ARG_L3(v),ARG_H3(v) y = (float(k)+0.5d0)*dx(3)+domnlo(3) do i=ARG_L1(v),ARG_H1(v) x = (float(i)+0.5d0)*dx(1)+domnlo(1) vx = v(i,j,k,1)*1.d-2 vy = v(i,j,k,3)*1.d-2 vz = v(i,j,k,2)*1.d-2 r = SQRT(x*x + y*y) if (r.le.2.5d0) then bin = INT(r/(bsize*dx(1))) if (r.lt.1.d-10) then print *,'PUKE! illdefined if r=0' call bl_abort(" ") else st = y / r ct = x / r vr = vx*ct + vy*st vt = vy*ct - vx*st endif else bin = -1 vr = 0.d0 vt = 0.d0 endif if (bin.gt.maxbin) call bl_abort('...maxbin not enough!') if (bin.ge.0) then avVR(j,bin,kk) = avVR(j,bin,kk) + vr avVT(j,bin,kk) = avVT(j,bin,kk) + vt avVZ(j,bin,kk) = avVZ(j,bin,kk) + vz avC(j,bin,kk) = avC(j,bin,kk) + v(i,j,k,5)/v(i,j,k,4) Nbin(j,bin,kk) = Nbin(j,bin,kk) + 1 endif enddo enddo do n=0,maxbin if (Nbin(j,n,kk).gt.0) then avVR(j,n,kk) = avVR(j,n,kk)/Nbin(j,n,kk) avVT(j,n,kk) = avVT(j,n,kk)/Nbin(j,n,kk) avVZ(j,n,kk) = avVZ(j,n,kk)/Nbin(j,n,kk) avC(j,n,kk) = avC(j,n,kk)/Nbin(j,n,kk) endif enddo enddo end ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveVandV2_F.F0000644000175000017500000000626611634153073023202 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "ArrayLim.H" #define SDIM 3 subroutine TRANSV(v,DIMS(v),dx,domnlo,v1,DIMS(v1),v2,DIMS(v2)) implicit none integer DIMDEC(v) integer DIMDEC(v1) integer DIMDEC(v2) REAL_T v(DIMV(v),*) REAL_T v1(DIMV(v),*) REAL_T v2(DIMV(v),*) REAL_T dx(SDIM), domnlo(SDIM) integer i,j,k REAL_T x,y,vx,vy,vz,vr,vt,r,st,ct do j=ARG_L2(v),ARG_H2(v) do k=ARG_L3(v),ARG_H3(v) y = (float(k)+0.5d0)*dx(3)+domnlo(3) do i=ARG_L1(v),ARG_H1(v) x = (float(i)+0.5d0)*dx(1)+domnlo(1) vx = v(i,j,k,1)*1.d-2 vy = v(i,j,k,3)*1.d-2 vz = v(i,j,k,2)*1.d-2 r = SQRT(x*x + y*y) if (r.le.2.5d0) then if (r.lt.1.d-10) then print *,'PUKE! illdefined if r=0' call bl_abort(" ") else st = y / r ct = x / r vr = vx*ct + vy*st vt = vy*ct - vx*st endif else vr = 0.d0 vt = 0.d0 vz = 0.d0 endif v1(i,j,k,1) = vr v1(i,j,k,2) = vt v1(i,j,k,3) = vz v2(i,j,k,1) = vr*vr v2(i,j,k,2) = vt*vt v2(i,j,k,3) = vz*vz enddo enddo enddo end subroutine ROOTMS(v1, v2, DIMS(v)) implicit none integer DIMDEC(v) REAL_T v1(DIMV(v),3) REAL_T v2(DIMV(v),3) integer i,j,k,n do k=ARG_L3(v),ARG_H3(v) do j=ARG_L2(v),ARG_H2(v) do i=ARG_L1(v),ARG_H1(v) do n=1,3 v2(i,j,k,n) = sqrt(abs(v2(i,j,k,n) - v1(i,j,k,n)**2)) enddo enddo enddo enddo end ccseapps-2.5/CCSEApps/pAmrDerive/chomboHDF5.h0000644000175000017500000002477411634153073021762 0ustar amckinstryamckinstry/* ** _______ __ ** / ___/ / ___ __ _ / / ___ ** / /__/ _ \/ _ \/ ' \/ _ \/ _ \ ** \___/_//_/\___/_/_/_/_.__/\___/ ** ** chomboHDF5.h ** ** This software is copyright (C) by the Lawrence Berkeley ** National Laboratory. Permission is granted to reproduce ** this software for non-commercial purposes provided that ** this notice is left intact. ** ** It is acknowledged that the U.S. Government has rights to ** this software under Contract DE-AC03-765F00098 between ** the U.S. Department of Energy and the University of ** California. ** ** This software is provided as a professional and academic ** contribution for joint exchange. Thus it is experimental, ** is provided ``as is'', with no warranties of any kind ** whatsoever, no support, no promise of updates, or printed ** documentation. By using this software, you acknowledge ** that the Lawrence Berkeley National Laboratory and ** Regents of the University of California shall have no ** liability with respect to the infringement of other ** copyrights by any part of this software. ** */ /* Serial programming interface */ #ifndef __CHOMBOHDF5_H_ #define __CHOMBOHDF5_H_ #include struct { int i; int j; }typedef intvect2d ; struct { int i; int j; int k; }typedef intvect3d ; struct { intvect2d lo; intvect2d hi; }typedef box2d ; struct{ intvect3d lo; intvect3d hi; } typedef box3d; union { box2d b2; box3d b3; } typedef box; int isEmpty(const box2d*); int numPnts2(const box2d*); int numPnts3(const box3d*); void refine2(box2d*, int refinement); void refine3(box3d*, int refinement); int cut(const box3d* box, int dir, int index); box2d* crossSection(const box3d* box, int dir, box2d* box2); static hid_t intvect2d_id, intvect3d_id, box2d_id, box3d_id ; void initializeHDF5datatypes(); /* gives values to *_id objects */ /* information pointed at by 'data' in these classes is assumed to be packed like a fortran data array: int c, i, j, sizei, sizej, index; float d; FloatArray2D arrayBox; . . sizei = arrayBox.hi.i-arrayBox.lo.i + 1; sizej = arrayBox.hi.j-arrayBox.lo.j + 1; for(c=0; cname, (char*)(at->data)); at = at->next; } */ struct { int numByType[ChTYPES]; Attribute* accessByType[ChTYPES]; int dim; ChPrecision precision; } typedef HDF5attributes; void freeHDF5attributes(HDF5attributes* attributes); void printAttributes(HDF5attributes* attributes); /* utility functions for appending attributes to an HDF5attributes struct attrib: HDF5atributes struct */ extern Attribute* ADD_tmp; extern Attribute* ADD_at; #define ADD_ATTRIBUTE(attrib, Ttype, ChType, Sname, value) \ ADD_tmp = attrib.accessByType[ChType] ; \ ADD_at = (Attribute*) malloc(sizeof(Attribute)); \ attrib.accessByType[ChType] = ADD_at; \ ADD_at->name = malloc(strlen(Sname)+1); \ sprintf(ADD_at->name, Sname); \ ADD_at->data = malloc(sizeof(Ttype)); \ ADD_at->attributeType = ChType; \ *((Ttype *)ADD_at->data) = value; \ ADD_at->next = ADD_tmp; \ attrib.numByType[ChType]++; \ #define ADD_CHAR_ATTRIBUTE(attrib, Sname, value) \ ADD_tmp = attrib.accessByType[CHAR] ; \ ADD_at = (Attribute*) malloc(sizeof(Attribute)); \ attrib.accessByType[CHAR] = ADD_at; \ ADD_at->name = malloc(strlen(Sname)); \ sprintf(ADD_at->name, Sname); \ ADD_at->data = malloc(strlen(value)); \ ADD_at->attributeType = CHAR; \ sprintf((char*)ADD_at->data, value); \ ADD_at->next = ADD_tmp; \ attrib.numByType[CHAR]++; \ /* next eight functions return 0 on success */ /* - users responsibility to make sure HDF5Handle is pointing at a valid group in an open file. - User must use freeHDF5attributes when finished. - User must pass in a pointer to a valid HDF5attributes struct.*/ int readHDF5attributes(HDF5attributes* attr, HDF5Handle handle); /* input: HDF5Handle users responsibility to cast *(boxes) to either box2d* or box3d* and free it */ int readBoxes(box** boxes, int* length, HDF5Handle handle); /* input: HDF5Handle, length, boxes users responsibility to cast *(arrayboxes) to one of {Float|Double}ArrayBox{2|3}D*, and to call freeDataArray and free(*arrayboxes) when finished returns negative on HDF5 error. */ int readData(FAB_CHOMBO** arrayboxes, box* boxes, int length, HDF5Handle handle); /* - users responsibility to make sure HDF5Handle is pointing at a valid group in an open file. - User must use freeHDF5attributes when finished. - User must pass in a pointer to a valid HDF5attributes struct. returns 0 on success -1 attribute creation problems */ int writeHDF5attributes(HDF5attributes* attr, HDF5Handle handle); int writeBoxes(box* boxes, int length, HDF5Handle handle); int writeFABBoxes(FAB_CHOMBO* FABArray, int length, HDF5Handle handle); int writeData(FAB_CHOMBO* FABArray, int ncomps, int length, HDF5Handle handle); /* Top level C functions, simplest interface */ /* everything is input. returns 0 on success. refinementRatios : refinement ratio at all levels (ith entry is refinement ratio between levels i and i + 1) returns -1: error opening file -2: error writing attributes to header -4: error writing boxes to data file -5: error writing FAB data to file -20: error closing file on exit */ int writeAMRHierarchy(const char* filename, int dim, ChPrecision precision, int numLevels, FAB_CHOMBO** levels, int* length, int numComps, char** compNames, box domain, int iteration, double dx, double dt, double time, int* refinementRatios); /* input : filename all pointers must point to a valid allocated object whose value will be filled in User is responsible for calling 'freeDataArray' on all the 'levels' data when finished with them and calling 'free' on all data members passed out of this routine. refinementRatios : refinement ratio at all levels (ith entry is refinement ratio between levels i and i + 1) returns 0 on success -1: unable to open file -2: Unable to read attributes from group "/" -3: Number of levels not found in HDF5 file -4: Number of components not found in HDF5 filen -5: num_levels <= 0 -6: num_components <= 0 -7: missing component name -8: error reading boxes -20: error closing file on exit; -100 + readData error: error reading data. */ int readExtentsAMRHierarchy(char *filename, /* which file to query */ double *minext, /* minimum extents for the dataset */ double *maxext, /* Maximum extents of the dataset */ int *ndims);/* optional: gets number of dimensions of the dataset. You can otherwise figure this out if minext[2]==maxext[2] */ int readAMRHierarchy(const char* filename, int* dim, ChPrecision* precision, int* num_levels, FAB_CHOMBO*** levels, int** length, int* numComps, char*** compNames, box* domain, int* iteration, double* dx, double* dt, double* time, int** refinementRatios); /* this function assumes that the caller has allocated memory space in output2Dlevels for the FAB_CHOMBO* per level, and the caller has allocated space for the output2Dlengths array. This function internally alloctes memory for the individual FAB_CHOMBO arrays. the caller is responsible for reclaiming this memory with a a call to: void freeDataArray(FAB_CHOMBO* FArrayBoxCArray, int length); followed by: free(FAB_CHOMBO*); returns 0 on a successfull slice. */ int sliceAMRHierarchy(ChPrecision precision, int numLevels, FAB_CHOMBO** input3Dlevels, int* input3Dlengths, int ncomp, double dx, int* refinementRatios, int coordinateNormal, double position, box domain3d, box* domain2d, FAB_CHOMBO** output2Dlevels, int* output2Dlengths ); #endif ccseapps-2.5/CCSEApps/pAmrDerive/inputs.td0000644000175000017500000000133011634153073021565 0ustar amckinstryamckinstrydt=.00001 dt_spec=-1 strt_time=0 stop_time=1 chem_infile=drm19_noAR.dat chem_outfile=drm19_noAR.out therm_infile=thermo12.dat tran_infile=transport12.dat trace_element=N trace_element=C initial_species=CH4 initial_species=N2 plot_files=plt19700 time_steps=0.3 traj_file=Traj_4.6M_3_14930 traj_file=Traj_0.0M_3_19415 event_file=Events_4.6M_3_14930 event_file=Events_0.0M_3_19415 edgedatafile=stochEdgeData.txt calc_lambda_max=0 do_not_write_events=0 do_not_write_trajs=0 write_intermediate_plotfiles=0 n_particles=0 seed=12345 workqueue.maxthreads=4 workqueue.maxthreads=0 init_x=.0000125 init_y=.0000125 init_z=.0000125 build_prob_dist=false conc_epsilon=1.0e-10 chem_limiter=0.1 geometry.is_periodic = 0 0 0 ccseapps-2.5/CCSEApps/pAmrDerive/stochEdgeData-C.txt0000644000175000017500000002203311634153073023335 0ustar amckinstryamckinstry42 74 0 1 1 1 1 1 1 1 2 1 1 1 3 1 1 1 10 -1 3 1 11 -1 3 1 12 -1 3 1 14 -1 3 1 15 -1 3 1 35 -1 3 1 37 -1 6 1 38 -1 6 1 41 -1 6 1 45 -1 6 1 46 -1 1 1 50 -1 27 1 57 -1 7 1 59 -1 7 1 60 -1 1 1 63 -1 25 1 66 -1 8 1 71 -1 1 1 76 -1 27 1 77 -1 9 1 78 -1 9 1 113 -1 3 1 134 -1 3 1 139 -1 17 1 145 -1 17 1 151 -1 18 1 154 -1 18 2 157 -1 19 2 165 -1 21 1 171 -1 21 1 179 1 30 1 183 -1 22 1 189 1 25 1 190 -1 25 1 195 -1 25 1 202 1 27 1 203 -1 27 1 204 -1 27 2 206 -1 27 1 207 -1 27 2 208 -1 27 2 209 -1 28 1 210 -1 28 2 211 -1 28 2 212 -1 28 2 215 -1 31 1 220 -1 31 1 222 -1 32 1 225 -1 1 1 227 -1 32 1 233 -1 33 1 234 -1 34 1 235 -1 34 1 236 -1 34 1 250 -1 33 1 251 -1 33 1 252 -1 33 1 256 -1 3 1 257 -1 33 1 259 -1 33 1 263 -1 33 1 264 -1 33 2 278 1 1 1 279 1 1 1 280 -1 1 1 283 -1 3 1 284 -1 3 1 312 -1 9 1 323 -1 27 1 326 -1 27 1 27 0 -1 0 1 1 -1 0 1 2 -1 0 1 3 -1 0 1 13 -1 3 1 42 -1 6 1 44 -1 6 1 46 1 0 1 60 1 0 1 71 1 0 1 186 -1 22 1 192 -1 25 1 196 -1 25 1 206 -1 27 1 225 1 0 1 228 -1 32 1 237 -1 34 1 241 -1 34 1 254 -1 33 1 258 -1 33 1 260 -1 33 1 278 -1 0 1 279 -1 0 1 280 1 0 1 285 -1 3 1 324 -1 27 1 325 -1 27 1 41 4 1 3 1 5 1 3 1 6 1 3 1 7 1 3 1 8 1 3 1 9 1 3 1 24 -1 5 1 32 -1 5 1 34 1 3 1 40 -1 6 1 43 -1 6 1 46 -1 6 1 58 -1 7 1 60 -1 7 1 70 -1 8 1 75 1 25 1 87 1 11 1 88 -1 11 1 89 -1 11 1 90 -1 11 1 91 -1 11 1 92 1 12 1 93 -1 12 1 94 -1 12 1 95 -1 12 1 96 -1 12 1 97 -1 12 1 107 -1 14 1 112 1 3 1 130 -1 16 1 133 1 3 1 148 -1 17 1 168 -1 21 1 171 -1 21 1 201 -1 24 1 249 -1 36 1 275 -1 40 1 281 1 3 1 282 1 3 1 286 -1 3 1 297 -1 6 1 47 4 -1 2 1 5 -1 2 1 6 -1 2 1 7 -1 2 1 8 -1 2 1 9 -1 2 1 10 1 0 1 11 1 0 1 12 1 0 1 13 1 1 1 14 1 0 1 15 1 0 1 34 -1 2 1 35 1 0 1 67 -1 8 1 69 -1 8 1 71 -1 8 1 112 -1 2 1 113 1 0 1 120 -1 15 1 130 -1 16 1 133 -1 2 1 134 1 0 1 148 -1 17 1 149 -1 17 2 158 -1 20 1 166 -1 21 1 168 -1 21 1 170 -1 21 1 173 -1 21 1 174 -1 21 1 175 1 29 1 184 -1 22 1 200 -1 24 2 201 -1 24 1 248 -1 36 1 253 -1 33 1 256 1 0 1 281 -1 2 1 282 -1 2 1 283 1 0 1 284 1 0 1 285 1 1 1 286 1 2 1 304 -1 8 1 306 -1 8 1 321 -1 18 1 19 16 -1 5 1 17 1 5 1 18 1 5 1 19 1 5 1 20 1 5 1 21 1 5 1 34 -1 5 1 35 -1 5 1 47 1 5 1 61 1 5 1 72 1 15 1 103 -1 5 1 114 -1 5 1 125 -1 5 1 135 -1 5 1 155 1 5 1 164 -1 5 1 287 1 5 1 288 1 5 1 59 16 1 4 1 17 -1 4 1 18 -1 4 1 19 -1 4 1 20 -1 4 1 21 -1 4 1 22 1 6 1 23 -1 7 1 24 1 2 1 25 1 6 1 26 -1 7 1 27 -1 12 1 28 -1 11 1 29 1 10 1 30 1 11 1 31 1 11 1 32 1 2 1 33 1 13 2 34 1 4 1 35 1 4 1 47 -2 4 2 47 -2 6 2 48 1 15 1 61 -2 4 2 61 -2 7 2 62 1 15 1 64 -1 7 1 73 1 16 1 79 1 17 1 103 1 4 1 106 -1 14 2 107 -1 14 1 114 1 4 1 120 -1 15 1 125 1 4 1 135 1 4 1 145 -1 17 1 155 -1 4 1 158 -1 20 1 164 1 4 1 165 -1 21 1 166 -1 21 1 172 1 29 1 183 -1 22 1 184 -1 22 1 186 -1 22 1 190 -1 25 1 196 -1 25 1 271 -1 39 1 273 -1 39 1 287 -1 4 1 288 -1 4 1 289 1 31 1 290 1 41 1 291 1 11 1 292 1 41 1 293 1 40 1 294 1 39 1 303 -1 7 1 36 22 -1 5 1 25 -1 5 1 36 1 8 1 37 1 0 1 38 1 0 1 39 1 8 1 40 1 2 1 41 1 0 1 42 1 1 1 43 1 2 1 44 1 1 1 45 1 0 1 46 1 2 1 47 1 5 1 48 1 15 1 49 1 17 2 50 1 16 1 51 -1 7 1 52 -1 7 1 53 -1 7 1 54 -1 7 1 55 -1 7 1 74 1 17 1 80 1 18 1 139 -1 17 1 173 1 15 1 189 1 25 1 192 -1 25 1 295 1 31 1 296 1 36 1 297 1 2 1 298 1 31 1 299 1 31 1 300 -1 41 1 302 -1 7 1 319 -1 16 1 20 23 1 5 1 26 1 5 1 51 1 6 1 52 1 6 1 53 1 6 1 54 1 6 1 55 1 6 1 56 1 8 1 57 1 0 1 58 1 2 1 59 1 0 1 60 1 2 1 61 1 5 1 62 1 15 1 63 1 15 1 64 1 5 1 203 -1 27 1 301 1 31 1 302 1 6 1 303 1 5 1 26 36 -1 6 1 39 -1 6 1 56 -1 7 1 65 1 9 1 66 1 0 1 67 1 3 1 68 1 9 1 69 1 3 1 70 1 2 1 71 1 3 1 72 1 15 1 73 1 16 1 74 1 17 1 75 1 25 1 76 1 17 1 151 -1 18 1 174 1 16 1 202 1 27 1 209 -1 28 1 304 1 3 1 305 1 31 1 306 1 3 1 307 1 33 1 308 1 32 1 309 1 31 1 310 1 31 1 10 65 -1 8 1 68 -1 8 1 77 1 0 1 78 1 0 1 79 1 17 1 80 1 18 1 311 1 32 1 312 1 0 1 313 1 32 1 314 1 32 1 7 29 -1 5 1 81 1 12 1 82 1 11 1 83 1 12 1 84 1 12 1 85 1 11 1 86 1 12 1 11 28 1 5 1 30 -1 5 1 31 -1 5 1 82 -1 10 1 85 -1 10 1 87 -1 2 1 88 1 2 1 89 1 2 1 90 1 2 1 91 1 2 1 291 -1 5 1 14 27 1 5 1 81 -1 10 1 83 -1 10 1 84 -1 10 1 86 -1 10 1 92 -1 2 1 93 1 2 1 94 1 2 1 95 1 2 1 96 1 2 1 97 1 2 1 170 -1 21 1 195 -1 25 1 276 1 40 1 14 33 -1 5 1 64 1 14 1 98 1 14 1 99 1 14 1 100 1 14 1 101 1 14 1 102 1 14 1 103 1 14 1 105 -1 14 1 112 -1 14 1 113 -1 14 1 115 -1 14 1 315 1 14 1 316 1 14 1 25 64 -1 13 1 98 -1 13 1 99 -1 13 1 100 -1 13 1 101 -1 13 1 102 -1 13 1 103 -1 13 1 104 -1 15 1 105 1 13 1 106 1 5 1 107 2 5 1 107 2 2 1 108 1 20 1 109 1 15 1 110 1 15 1 111 1 15 1 112 1 13 1 113 1 13 1 114 1 15 1 115 2 13 2 115 2 15 2 175 1 29 1 179 1 30 1 315 -1 13 1 316 -1 13 1 31 48 -2 5 1 48 -2 6 1 62 -2 5 1 62 -2 7 1 63 -2 7 1 63 -2 25 1 72 -2 8 1 72 -2 4 1 104 1 14 1 109 -1 14 1 110 -1 14 1 111 -1 14 1 114 -1 14 1 115 -1 14 1 116 -1 16 1 117 1 17 1 118 1 16 1 119 1 21 1 120 2 5 1 120 2 3 1 121 1 25 1 122 1 16 1 123 1 20 1 124 1 21 1 125 1 16 1 133 -1 16 1 134 -1 16 1 136 -1 16 1 173 -2 6 1 173 -2 21 1 317 1 16 1 27 50 -2 27 1 50 -2 6 1 73 -2 5 1 73 -2 8 1 116 1 15 1 118 -1 15 1 122 -1 15 1 125 -1 15 1 126 -1 17 1 127 1 17 1 128 1 25 1 129 1 17 1 130 2 3 1 130 2 2 1 131 1 21 1 132 1 17 1 133 1 15 1 134 1 15 1 135 1 17 1 136 2 15 2 136 2 17 2 174 -2 8 1 174 -2 21 1 317 -1 15 1 318 1 17 1 319 2 6 1 319 2 31 1 35 49 -1 6 1 74 -2 6 1 74 -2 8 1 76 -2 8 1 76 -2 27 1 79 -2 5 1 79 -2 9 1 117 -1 15 1 126 1 16 1 127 -1 16 1 129 -1 16 1 132 -1 16 1 135 -1 16 1 136 -1 16 1 137 1 18 1 138 -1 18 1 139 2 6 1 139 2 0 1 140 1 27 1 141 1 18 1 142 1 18 1 143 1 26 1 144 1 25 1 145 2 5 1 145 2 0 1 146 1 23 1 147 1 21 1 148 2 3 1 148 2 2 1 149 1 3 1 155 -1 18 1 208 -1 27 1 318 -1 16 1 320 2 27 1 320 2 31 1 15 80 -2 6 1 80 -2 9 1 137 -1 17 1 138 1 17 1 141 -1 17 1 142 -1 17 1 150 -1 19 1 151 2 0 1 151 2 8 1 152 1 27 1 153 1 19 1 154 1 0 1 155 1 17 1 321 2 3 1 321 2 32 1 4 150 1 18 1 153 -1 18 1 156 1 28 1 157 1 0 1 10 108 -1 14 1 123 -1 15 1 158 2 5 1 158 2 3 1 159 1 22 1 160 1 22 1 161 1 22 1 162 1 22 1 163 1 22 1 164 1 22 1 22 119 -1 15 1 124 -1 15 1 131 -1 16 1 147 -1 17 1 165 2 5 1 165 2 0 1 166 2 5 1 166 2 3 1 167 1 22 1 168 2 3 1 168 2 2 1 169 1 25 1 170 2 3 1 170 2 12 1 171 2 0 1 171 2 2 1 172 1 29 1 173 2 15 1 173 2 3 1 174 2 16 1 174 2 3 1 180 -1 23 1 16 159 -1 20 1 160 -1 20 1 161 -1 20 1 162 -1 20 1 163 -1 20 1 164 -1 20 1 167 -1 21 1 183 2 5 1 183 2 0 1 184 2 5 1 184 2 3 1 185 1 25 1 186 2 5 1 186 2 1 1 187 1 25 1 188 1 25 1 4 146 -1 17 1 180 1 21 1 181 1 24 1 182 1 24 1 5 181 -1 23 1 182 -1 23 1 200 1 3 1 201 2 3 1 201 2 2 1 25 63 2 0 1 63 2 15 1 75 -2 8 1 75 -2 2 1 121 -1 15 1 128 -1 16 1 144 -1 17 1 169 -1 21 1 185 -1 22 1 187 -1 22 1 188 -1 22 1 189 -2 0 1 189 -2 6 1 190 2 0 1 190 2 5 1 191 1 27 1 192 2 6 1 192 2 1 1 193 1 27 1 194 1 27 1 195 2 0 1 195 2 12 1 196 2 5 1 196 2 1 1 322 1 27 1 4 143 -1 17 1 197 1 27 1 198 1 27 1 199 1 27 1 34 50 2 0 1 50 2 16 1 76 2 0 1 76 2 17 1 140 -1 17 1 152 -1 18 1 191 -1 25 1 193 -1 25 1 194 -1 25 1 197 -1 26 1 198 -1 26 1 199 -1 26 1 202 -2 0 1 202 -2 8 1 203 2 0 1 203 2 7 1 204 1 0 1 205 1 28 1 206 2 0 1 206 2 1 1 207 1 0 1 208 2 0 2 208 2 17 2 320 -2 17 1 320 -2 33 1 322 -1 25 1 323 2 0 1 323 2 36 1 324 2 1 1 324 2 31 1 325 2 1 1 325 2 36 1 326 2 0 1 326 2 31 1 7 156 -1 19 1 205 -1 27 1 209 2 0 1 209 2 8 1 210 1 0 1 211 1 0 1 212 1 0 1 7 172 -2 21 1 172 -2 5 1 175 -2 14 1 175 -2 3 1 176 1 30 1 177 1 30 1 178 1 30 1 5 176 -1 29 1 177 -1 29 1 178 -1 29 1 179 -2 14 1 179 -2 0 1 34 213 -1 32 1 214 1 33 1 215 1 0 1 216 1 32 1 217 1 32 1 218 1 35 1 219 1 34 1 220 1 0 1 221 1 37 1 229 -1 32 1 230 -1 32 1 232 -1 32 1 247 -1 36 1 268 -1 38 1 269 -1 38 1 271 -1 39 1 277 -1 41 1 287 -1 32 1 289 -1 5 1 295 -1 6 1 298 -1 6 1 299 -1 6 1 301 -1 7 1 303 1 32 1 305 -1 8 1 309 -1 8 1 310 -1 8 1 315 -1 32 1 317 -1 32 1 319 -1 16 1 320 -1 17 1 322 -1 32 1 324 -1 27 1 326 -1 27 1 32 213 1 31 1 216 -1 31 1 217 -1 31 1 221 1 37 1 222 1 0 1 223 1 33 1 224 1 33 1 225 1 33 1 226 1 33 1 227 1 0 1 228 1 1 1 229 1 31 1 230 1 31 1 231 1 38 1 232 1 31 1 233 1 38 1 265 -1 37 1 266 -1 37 1 267 -1 38 1 275 -1 40 1 276 1 40 1 287 1 31 1 293 1 40 1 303 -1 31 1 308 -1 8 1 311 -1 9 1 313 -1 9 1 314 -1 9 1 315 1 31 1 317 1 31 1 321 -1 18 1 322 1 31 1 38 214 -1 31 1 223 -1 32 1 224 -1 32 1 225 -1 32 1 226 -1 32 1 232 -1 34 1 233 1 0 1 238 -1 34 1 239 -1 34 1 240 -1 34 1 242 -1 34 1 243 -1 34 1 244 -1 35 1 245 -1 35 1 246 -1 35 1 250 1 0 1 251 1 0 1 252 1 0 1 253 1 3 1 254 1 1 1 255 1 34 1 256 1 34 1 257 1 0 1 258 1 1 1 259 1 0 1 260 1 1 1 261 1 34 1 262 1 34 1 263 1 0 1 264 1 0 2 265 -1 37 1 270 -1 38 1 273 -1 39 1 281 1 34 1 288 1 34 1 307 -1 8 1 316 1 34 1 320 1 27 1 19 219 -1 31 1 232 1 33 1 234 1 0 1 235 1 0 1 236 1 0 1 237 1 1 1 238 1 33 1 239 1 33 1 240 1 33 1 241 1 1 1 242 1 33 1 243 1 33 1 255 -1 33 1 256 -1 33 1 261 -1 33 1 262 -1 33 1 281 -1 33 1 288 -1 33 1 316 -1 33 1 6 218 -1 31 1 244 1 33 1 245 1 33 1 246 1 33 1 266 -1 37 1 294 1 39 1 6 247 1 31 1 248 1 3 1 249 1 2 1 296 -1 6 1 323 -1 27 1 325 -1 27 1 6 221 -2 32 1 221 -2 31 1 265 2 32 1 265 2 33 1 266 2 32 1 266 2 35 1 6 231 -1 32 1 233 -1 32 1 267 1 32 1 268 1 31 1 269 1 31 1 270 1 33 1 8 271 2 31 1 271 2 5 1 272 1 40 1 273 2 5 1 273 2 33 1 274 1 40 1 294 -2 5 1 294 -2 35 1 8 272 -1 39 1 274 -1 39 1 275 2 32 1 275 2 2 1 276 -2 32 1 276 -2 12 1 293 -2 32 1 293 -2 5 1 4 277 1 31 1 290 -1 5 1 292 -1 5 1 300 1 6 1 ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveStoch.cpp0000644000175000017500000011321311634153073023301 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrDeriveStoch.cpp,v 1.70 2002/05/16 16:22:23 lijewski Exp $ // // This is the version that reads input from PlotFiles. // #include #include #include #include #include #include #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" #include "Tuple.H" #include "Profiler.H" #include "Thread.H" #include "WorkQueue.H" // // ParmParse'd arguments ... // static bool build_prob_dist = false; static bool calc_lambda_max = false; static bool do_not_write_trajs = false; static bool do_not_write_events = false; static bool do_not_write_resfile = false; static int seed = 12345; static int res_spec = 0; static int init_spec = 6; static int part_start = 0; static int n_particles = 0; static int restime_interval = 250; static Real init_y = .0000125; #if BL_SPACEDIM==3 static Real init_z = .0000125; #endif static Real dt = .00001; static Real dt_spec = -1; static Real stop_time = 0; static Real conc_epsilon = 1.0e-10; static Real chem_limiter = 0.1; static std::string ResFile; static std::string TrajFile; static std::string EventFile; static std::string EdgeDataFile; // // This is the name of the base PlotFile. // // We expect to find PlotFiles of the form: // // PlotFile_a // PlotFile_b // PlotFile_c // PlotFile_d // PlotFile_u // PlotFile_rf // PlotFile_rr // PlotFile_conc // static std::string PlotFile; // // Stuff we set from the AmrData object after reading PlotFile. // static int finest_level; static Array ref_ratio; static Array prob_lo; static Array prob_hi; static Array prob_domain; static Array< Array > dx; static Array< Array > dxinv; static PArray A_mf(PArrayManage); static PArray B_mf(PArrayManage); static PArray C_mf(PArrayManage); static PArray D_mf(PArrayManage); static PArray U_mf(PArrayManage); static PArray Rf_mf(PArrayManage); static PArray Rr_mf(PArrayManage); static PArray Conc_mf(PArrayManage); static PArray Prob_mf(PArrayManage); // // Other global data. // static Array pedges; static std::vector edgedata; static Array< Array > AccumProb; // // Particles on our trajectory ... // typedef Tuple PartPos; static void ScanArguments (ParmParse& pp) { pp.query("dt", dt); BL_ASSERT(dt != 0); pp.query("dt_spec", dt_spec); BL_ASSERT(dt_spec != 0); pp.query("stop_time", stop_time); BL_ASSERT(stop_time > 0); pp.query("seed", seed); pp.query("restime_interval", restime_interval); pp.query("edgedatafile", EdgeDataFile); if (EdgeDataFile.empty()) BoxLib::Abort("You must specify `edgedatafile'"); pp.query("event_file", EventFile); if (EventFile.empty()) BoxLib::Abort("You must specify `event_file'"); pp.query("res_file", ResFile); if (ResFile.empty()) BoxLib::Abort("You must specify `res_file'"); pp.query("traj_file", TrajFile); if (TrajFile.empty()) BoxLib::Abort("You must specify `traj_file'"); pp.query("plot_file", PlotFile); if (PlotFile.empty()) BoxLib::Abort("You must specify `plot_file'"); // // Append `.seed=N' to EventFile & TrajFile & ResFile. // char buf[12]; ResFile += ".seed="; TrajFile += ".seed="; EventFile += ".seed="; sprintf(buf, "%d", seed); ResFile += buf; TrajFile += buf; EventFile += buf; pp.query("calc_lambda_max", calc_lambda_max); pp.query("do_not_write_events", do_not_write_events); pp.query("do_not_write_trajs", do_not_write_trajs); pp.query("do_not_write_resfile", do_not_write_resfile); pp.query("conc_epsilon", conc_epsilon); pp.query("chem_limiter", chem_limiter); BL_ASSERT(conc_epsilon > 0); BL_ASSERT(chem_limiter > 0); pp.query("init_y", init_y); #if BL_SPACEDIM==3 pp.query("init_z", init_z); #endif pp.query("init_spec", init_spec); pp.query("res_spec", res_spec); pp.query("n_particles", n_particles); BL_ASSERT(n_particles > 0); pp.query("part_start", part_start); BL_ASSERT(part_start >= 0); pp.query("build_prob_dist", build_prob_dist); if (ParallelDescriptor::IOProcessor()) { std::cout << "dt = " << dt << '\n'; std::cout << "dt_spec = " << dt_spec << '\n'; std::cout << "stop_time = " << stop_time << '\n'; std::cout << "seed = " << seed << '\n'; std::cout << "restime_interval = " << restime_interval << '\n'; std::cout << "edgedatafile = " << EdgeDataFile << '\n'; std::cout << "res_file = " << ResFile << '\n'; std::cout << "plot_file = " << PlotFile << '\n'; std::cout << "traj_file = " << TrajFile << '\n'; std::cout << "event_file = " << EventFile << '\n'; if (calc_lambda_max) std::cout << "calc_lambda_max = true" << '\n'; if (do_not_write_events) std::cout << "do_not_write_events = true" << '\n'; if (do_not_write_trajs) std::cout << "do_not_write_trajs = true" << '\n'; if (do_not_write_resfile) std::cout << "do_not_write_resfile = true" << '\n'; std::cout << "Using conc_epsilon = " << conc_epsilon << '\n'; std::cout << "Using chem_limiter = " << chem_limiter << '\n'; std::cout << "init_y = " << init_y << '\n'; #if BL_SPACEDIM==3 std::cout << "init_z = " << init_z << '\n'; #endif std::cout << "init_spec = " << init_spec << '\n'; std::cout << "res_spec = " << res_spec << '\n'; std::cout << "n_particles = " << n_particles << '\n'; std::cout << "part_start = " << part_start << '\n'; std::cout << "build_prob_dist = " << build_prob_dist << '\n'; } } static void PrintUsage (char* progName) { if (ParallelDescriptor::IOProcessor()) std::cout << "Usage: " << progName << "inputfile" << '\n'; exit(1); } static Real FFF (Real s) { const Real R1 = .007; const Real R2 = .014; const Real A = (R2*R2-R1*R1)/(4*std::log(R1/R2)); const Real B = (R1*R1*log(R2)-R2*R2*log(R1))/(4*log(R1/R2)); Real result = 8 * A * std::log(s); s *= s; result += (s + 8*B -4*A); result *= s/16; return result; } static Real LookupTable[1001]; static void BuildLookupTable () { const Real R1 = .007; const Real R2 = .014; const Real Dx = .001*(R2-R1); const Real FFFR1 = FFF(R1); const Real FFFR2 = FFF(R2); for (int i = 0; i < 1001; i++) { Real s = R1+i*Dx; LookupTable[i] = (FFF(s)-FFFR1)/(FFFR2-FFFR1); } } static Real RandomXPos (BoxLib::mt19937& rand) { const Real Rn = rand.d1_value(); const Real Rf = .006; #if 0 // // Carbon stuff. // return Rf * sqrt(1-sqrt(1-Rn)); #else // // Nitrogen stuff. // const Real Ratio1 = 220.0/3380.0; const Real Ratio2 = 3160.0/3380.0; const Real R1 = .007; const Real R2 = .014; const Real Dx = .001*(R2-R1); if (Rn < Ratio1) { return Rf * sqrt(1-sqrt(1-Rn/Ratio1)); } else { Real x = (Rn-Ratio1)/Ratio2; int i = 0; for ( ; i < 1000; i++) if (x < LookupTable[i]) break; return R1+(i-1+(x-LookupTable[i-1])/(LookupTable[i]-LookupTable[i-1]))*Dx; } #endif } static void ReadEdgeData () { BL_ASSERT(!EdgeDataFile.empty()); if (ParallelDescriptor::IOProcessor()) std::cout << "Reading edgefile ... " << std::endl; std::ifstream ifs; ifs.open(EdgeDataFile.c_str(), std::ios::in); if (!ifs.good()) BoxLib::FileOpenFailed(EdgeDataFile); int N, cnt, tmp; ifs >> N; BL_ASSERT(N > 0); pedges.resize(N); if (ParallelDescriptor::IOProcessor()) std::cout << "N = " << N << '\n'; for (int i = 0; i < N; i++) { ifs >> cnt; BL_ASSERT(cnt > 0); pedges[i] = edgedata.size(); edgedata.push_back(cnt); for (int j = 0; j < 4*cnt; j++) { ifs >> tmp; edgedata.push_back(tmp); } } if (!ifs.good()) BoxLib::Abort("Failure reading EdgeData file"); if (ParallelDescriptor::IOProcessor()) { std::cout << "EdgeData on startup:\n"; for (int i = 0; i < pedges.size(); i++) { int cnt = edgedata[pedges[i]]; std::cout << cnt << ' '; for (int j = 1; j <= 4*cnt; j++) std::cout << edgedata[pedges[i]+j] << ' '; std::cout << '\n'; } } } static void GetMFsFromPlotFile (const std::string& file, PArray& pamf) { std::cout << "Opening PlotFile: " << file << std::endl; DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(file, fileType); if (!dataServices.AmrDataOk()) // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); static bool first = true; if (first) { first = false; // // Set some other globals ... // prob_lo = amrData.ProbLo(); prob_hi = amrData.ProbHi(); ref_ratio = amrData.RefRatio(); prob_domain = amrData.ProbDomain(); finest_level = amrData.FinestLevel(); dx.resize(finest_level+1); dxinv.resize(finest_level+1); for (int l = 0; l <= finest_level; l++) { dx[l] = amrData.DxLevel()[l]; dxinv[l] = amrData.DxLevel()[l]; for (int i = 0; i < BL_SPACEDIM; i++) dxinv[l][i] = 1.0/dx[l][i]; } } const int Nlev = amrData.FinestLevel() + 1; const int Ncomp = amrData.NComp(); pamf.resize(Nlev); for (int lev = 0; lev < Nlev; lev++) { pamf.set(lev,new MultiFab); std::cout << "Reading MultiFab data at lev=" << lev << " ... " << std::flush; std::string name = file; name += '/'; char buf[64]; sprintf(buf, "Level_%d", lev); name += buf; name += "/MultiFab"; VisMF::Read(pamf[lev],name); std::cout << "done" << std::endl; } } static void ReadPlotFiles () { const int N = 8; const char* suffix[N] = { "_a", "_b", "_c", "_d", "_u", "_rf", "_rr", "_conc" }; PArray* pamf[N] = { &A_mf, &B_mf, &C_mf, &D_mf, &U_mf, &Rf_mf, &Rr_mf, &Conc_mf }; std::string files[N]; for (int i = 0; i < N; i++) { files[i] = PlotFile + suffix[i]; } for (int i = 0; i < N; i++) { GetMFsFromPlotFile(files[i],*pamf[i]); } // // Some sanity checks ... // BL_ASSERT(A_mf.size() == B_mf.size()); BL_ASSERT(A_mf.size() == C_mf.size()); BL_ASSERT(A_mf.size() == D_mf.size()); BL_ASSERT(A_mf.size() == U_mf.size()); BL_ASSERT(A_mf.size() == Rf_mf.size()); BL_ASSERT(A_mf.size() == Rr_mf.size()); BL_ASSERT(A_mf.size() == Conc_mf.size()); BL_ASSERT(A_mf[0].boxArray() == B_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == C_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == D_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == U_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == Rf_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == Rr_mf[0].boxArray()); BL_ASSERT(A_mf[0].boxArray() == Conc_mf[0].boxArray()); // // Print out some stuff ... // if (ParallelDescriptor::IOProcessor()) { std::cout << "finest_level = " << finest_level << '\n'; for (int l = 0; l <= finest_level; l++) { std::cout << "dx[" << l << "]: "; for (int i = 0; i < BL_SPACEDIM; i++) std::cout << dx[l][i] << ' '; std::cout << '\n'; std::cout << "prob_domain[" << l << "]: " << prob_domain[l] << '\n'; } std::cout << "ref_ratio: "; for (int l = 0; l < finest_level; l++) std::cout << ref_ratio[l] << ' '; std::cout << '\n'; } } static void Twiddle_ABCD () { // // B = A + B; C = A + B + C; D = A + B + C + D // for (int l = 0; l <= finest_level; l++) { MultiFab& A = A_mf[l]; MultiFab& B = B_mf[l]; MultiFab& C = C_mf[l]; MultiFab& D = D_mf[l]; for (MFIter mfi(A); mfi.isValid(); ++mfi) { B[mfi] += A[mfi]; C[mfi] += B[mfi]; D[mfi] += C[mfi]; } } } static void TwiddleConcentration () { // // The concentration is already normalized. // We invert it so we can multiply by it instead of divide. // for (int lev = 0; lev < Conc_mf.size(); lev++) { for (MFIter mfi(Conc_mf[lev]); mfi.isValid(); ++mfi) { Conc_mf[lev][mfi].invert(1.0); } } // // We now set those cells covered by fine grid to zero. // This simplified some of our algorithms. // const int Ncomp = Conc_mf[0].nComp(); for (int l = 0; l <= finest_level; l++) { for (MFIter mfi(Conc_mf[l]); mfi.isValid(); ++mfi) { if (l < finest_level) { const BoxArray& f_ba = Conc_mf[l+1].boxArray(); for (int j = 0; j < f_ba.size(); j++) { Box c_box = BoxLib::coarsen(f_ba[j],ref_ratio[l]); if (c_box.intersects(Conc_mf[l][mfi].box())) { Box isect = c_box & Conc_mf[l][mfi].box(); Conc_mf[l][mfi].setVal(0,isect,0,Ncomp); } } } } } } static void WriteEvent (int part, Array& xpos, int spec, int reac, Real time, std::ostream& event_ofs) { BL_PROFILE("WriteEvent()"); if (do_not_write_events) return; event_ofs << part << ' '; for (int i = 0; i < BL_SPACEDIM; i++) { event_ofs << xpos[i] << ' '; } event_ofs << spec << ' ' << reac << ' ' << time << '\n'; if (!event_ofs.good()) BoxLib::Abort("Problem with the event output file"); } static void WriteResTime (const std::string& theResFile, const PArray& ResTime) { if (do_not_write_resfile) return; // // TODO -- implement this !!! // #if 0 std::ofstream res_ofs; res_ofs.open(theResFile.c_str(),std::ios::out|std::ios::trunc); if (!res_ofs.good()) BoxLib::FileOpenFailed(ResFile); ResTime.writeOn(res_ofs); #endif } static void WriteTrajectory (int particleNo, const std::vector& trajectory, std::ofstream& traj_ofs) { BL_PROFILE("WriteTrajectory()"); if (do_not_write_trajs) return; // // Only write out every N ... // const int N = 25; traj_ofs << particleNo << ":\n"; for (int i = 0; i < trajectory.size(); i++) { if (i % N == 0) { traj_ofs << trajectory[i][0] << ' ' << trajectory[i][1] << ' ' << trajectory[i][2] << '\n'; } } if (!traj_ofs.good()) BoxLib::Abort("Problem with the trajectory file"); } inline void UpdateTrajectory (const Array& x, Real t, std::vector& traj) { if (do_not_write_trajs) return; PartPos p; D_TERM(p[0] = x[0];, p[1] = x[1];, p[2] = x[2];) p[BL_SPACEDIM] = t; traj.push_back(p); } static void MaxLambda () { if (ParallelDescriptor::IOProcessor()) std::cout << "Calculating Max Lambda ..." << std::endl; const int nspec = pedges.size(); BL_ASSERT(nspec == Conc_mf[0].nComp()); BL_ASSERT(finest_level+1 == Conc_mf.size()); // // Now do the appropriate computation over levels using C_tmp. // // This relies on the Concentration being zero'd under fine grids. // for (int spec = 0; spec < nspec; spec++) { Real lmax = 0; const int start = pedges[spec]; const int nedge = edgedata[start]; for (int l = 0; l <= finest_level; l++) { const MultiFab& Rf = Rf_mf[l]; const MultiFab& Rr = Rr_mf[l]; const MultiFab& Conc = Conc_mf[l]; for (MFIter mfi(Conc); mfi.isValid(); ++mfi) { const Box& bx = Conc[mfi].box(); const FArrayBox& rf = Rf[mfi]; const FArrayBox& rr = Rr[mfi]; const FArrayBox& conc = Conc[mfi]; for (IntVect p = bx.smallEnd(); p <= bx.bigEnd(); bx.next(p)) { Real lambda = 0; for (int ie = 0; ie < nedge; ie++) { const int rxnid = edgedata[start+ie*4+1]; const int factor = edgedata[start+ie*4+2]; const int nu = edgedata[start+ie*4+4]; const Real X = nu*conc(p,spec)/factor; if (factor > 0) { lambda += X*rf(p,rxnid); } else { lambda -= X*rr(p,rxnid); } } lmax = std::max(lmax,lambda); } } } if (ParallelDescriptor::IOProcessor()) { std::cout << "spec = " << spec << ", lmax = " << lmax << std::endl; } } exit(0); } static void MaxDtLambda (int spec, Real& dt, int lev, int idx, const IntVect& iv) { BL_PROFILE("MaxDtLambda()"); Real lambda = 0; const int start = pedges[spec]; const int nedge = edgedata[start]; const FArrayBox& rf = Rf_mf[lev][idx]; const FArrayBox& rr = Rr_mf[lev][idx]; const FArrayBox& conc = Conc_mf[lev][idx]; for (int ie = 0; ie < nedge; ie++) { const int rxnid = edgedata[start+ie*4+1]; const int factor = edgedata[start+ie*4+2]; const int nu = edgedata[start+ie*4+4]; const Real X = nu*conc(iv,spec)/factor; if (factor > 0) { lambda += X*rf(iv,rxnid); } else { lambda -= X*rr(iv,rxnid); } } if (lambda > 0) dt = std::min(dt,chem_limiter/lambda); } static void Chemistry (int& spec, int& rxn, Real dt, int lev, int idx, const IntVect& iv, BoxLib::mt19937& rand) { BL_PROFILE("Chemistry()"); const Real rn = rand.d1_value(); Real lambda = 0; const int start = pedges[spec]; const int nedge = edgedata[start]; const FArrayBox& rf = Rf_mf[lev][idx]; const FArrayBox& rr = Rr_mf[lev][idx]; const FArrayBox& conc = Conc_mf[lev][idx]; for (int ie = 0; ie < nedge; ie++) { const int rxnid = edgedata[start+ie*4+1]; const int factor = edgedata[start+ie*4+2]; const int tospec = edgedata[start+ie*4+3]; const int nu = edgedata[start+ie*4+4]; const Real X = nu*conc(iv,spec)*dt/factor; if (factor > 0) { lambda += X*rf(iv,rxnid); } else { lambda -= X*rr(iv,rxnid); } if (rn < lambda) { rxn = rxnid; spec = tospec; break; } } } inline IntVect Index (const Array& x, int lev) { BL_PROFILE("Index()"); IntVect iv; const IntVect& lo = prob_domain[lev].smallEnd(); D_TERM(iv[0]=int((x[0]-lo[0])*dxinv[lev][0]);, iv[1]=int((x[1]-lo[1])*dxinv[lev][1]);, iv[2]=int((x[2]-lo[2])*dxinv[lev][2]);); iv += lo; return iv; } static void Where (const Array& x, int& lev, int& idx, IntVect& iv) { BL_PROFILE("Where()"); for (lev = finest_level; lev >= 0; lev--) { iv = Index(x,lev); const BoxArray& ba = A_mf[lev].boxArray(); for (idx = 0; idx < ba.size(); idx++) if (ba[idx].contains(iv)) return; } if (ParallelDescriptor::IOProcessor()) { std::cout << "Couldn't find position: ( "; for (int i = 0; i < BL_SPACEDIM; i++) std::cout << x[i] << ' '; std::cout << ')' << std::endl; } BoxLib::Abort("Where() failed"); } static void GetInitialPosition (int& spec, int rxn, Real t, std::vector& traj, int i, Array& x, IntVect& iv, int& lev, int& idx, std::ostream& event_ofs, BoxLib::mt19937& rand) { D_TERM(x[0]=(build_prob_dist?0:RandomXPos(rand));,x[1]=init_y;,x[2]=init_z;) if (build_prob_dist) { const Real rn = rand.d1_value(); // // Find level and index in Prob_mf containing appropriate probability. // int l, i; // // Find first AccumProb[lev][idx] combo >= rn ... // for (l = 0; l <= finest_level; l++) for (i = 0; i < AccumProb[l].size(); i++) if (rn <= AccumProb[l][i]) goto gotit; gotit: BL_ASSERT(l >= 0 && l <= finest_level); BL_ASSERT(i >= 0 && i < AccumProb[l].size()); const FArrayBox& Prob = Prob_mf[l][i]; const int* p_lo = Prob.box().loVect(); const int* p_hi = Prob.box().hiVect(); FORT_SELECTPOS(Prob.dataPtr(), ARLIM(p_lo), ARLIM(p_hi), &rn, D_DECL(&dx[l][0],&dx[l][1],&dx[l][2]), D_DECL(&x[0],&x[1],&x[2])); } UpdateTrajectory(x,t,traj); WriteEvent(i,x,spec,rxn,t,event_ofs); // // Now that we have x set lev, idx and iv ... // Where(x,lev,idx,iv); if (build_prob_dist) { Real dt_tmp = 1.0e20; MaxDtLambda(spec,dt_tmp,lev,idx,iv); dt_tmp *= 10; const int old_spec = spec; Chemistry(spec,rxn,dt_tmp,lev,idx,iv,rand); if (spec != old_spec) WriteEvent(i,x,spec,rxn,t,event_ofs); } } static void BuildProbDist () { Prob_mf.resize(finest_level+1); AccumProb.resize(finest_level+1); for (int l = 0; l <= finest_level; l++) { Prob_mf.set(l, new MultiFab(A_mf[l].boxArray(),1,0)); AccumProb[l].resize(Prob_mf[l].size(),0); Prob_mf[l].setVal(0); } const int elen = edgedata.size(); const int nspec = pedges.size(); const int nreac = Rf_mf[0].nComp(); for (int l = 0; l <= finest_level; l++) { for (MFIter mfi(Prob_mf[l]); mfi.isValid(); ++mfi) { const int* a_lo = Rf_mf[l][mfi].box().loVect(); const int* a_hi = Rf_mf[l][mfi].box().hiVect(); const int* p_lo = Prob_mf[l][mfi].box().loVect(); const int* p_hi = Prob_mf[l][mfi].box().hiVect(); FORT_PROBFAB(Rf_mf[l][mfi].dataPtr(), ARLIM(a_lo), ARLIM(a_hi), Rr_mf[l][mfi].dataPtr(), Prob_mf[l][mfi].dataPtr(), ARLIM(p_lo), ARLIM(p_hi), &nspec, &nreac, &init_spec, (int*)&edgedata[0], &elen, pedges.dataPtr(), D_DECL(&dx[l][0],&dx[l][1],&dx[l][2])); if (l < finest_level) { const BoxArray& f_ba = Prob_mf[l+1].boxArray(); for (int j = 0; j < f_ba.size(); j++) { Box c_box = BoxLib::coarsen(f_ba[j],ref_ratio[l]); if (c_box.intersects(Prob_mf[l][mfi].box())) { Box isect = c_box & Prob_mf[l][mfi].box(); Prob_mf[l][mfi].setVal(0,isect,0); } } } } } Real totreact = 0; for (int l = 0; l <= finest_level; l++) for (MFIter mfi(Prob_mf[l]); mfi.isValid(); ++mfi) totreact += Prob_mf[l][mfi].sum(0); Real cumprob = 0; for (int l = 0; l <= finest_level; l++) { for (MFIter mfi(Prob_mf[l]); mfi.isValid(); ++mfi) { const int* p_lo = Prob_mf[l][mfi].box().loVect(); const int* p_hi = Prob_mf[l][mfi].box().hiVect(); FORT_ACCUMPROB(Prob_mf[l][mfi].dataPtr(), ARLIM(p_lo), ARLIM(p_hi), &totreact, &cumprob); } } if (ParallelDescriptor::IOProcessor()) { std::cout << "cumulative probability: " << cumprob << std::endl; } totreact = 0; for (int l = 0; l <= finest_level; l++) { for (MFIter mfi(Prob_mf[l]); mfi.isValid(); ++mfi) { totreact += Prob_mf[l][mfi].sum(0); AccumProb[l][mfi.index()] = totreact; } } // // Force sum to 1 just to be safe !!! // AccumProb[finest_level][AccumProb[finest_level].size()-1] = 1; } static void MaxOverBox (int spec, int lev, const Box& bx, Real& dmax) { for (MFIter mfi(D_mf[lev]); mfi.isValid(); ++mfi) { const FArrayBox& D = D_mf[lev][mfi]; const Box isect = bx & D.box(); if (isect.ok()) { IntVect p = isect.smallEnd(); for ( ; p <= isect.bigEnd(); isect.next(p)) { dmax = std::max(dmax,D(p,spec)); } } } } static void MaxDtDiffusion (int spec, Real& dt, const IntVect& iv, int lev) { BL_PROFILE("MaxDtDiffusion()"); Box bx(D_DECL(iv,iv,iv)); Real dmax = 0; MaxOverBox(spec, lev, BoxLib::grow(bx,2), dmax); if (lev < finest_level) { MaxOverBox(spec, lev+1, BoxLib::grow(BoxLib::refine(bx,ref_ratio[lev]),2), dmax); } if (dmax > 0) dt = std::min(dt,0.1/dmax); } static void AdvanceParticles (int tid, int beg, int cnt, Real dt) { BL_PROFILE("AdvanceParticles()"); const int NoReac = -1; const Real dt_save = dt; // // Append node & thread id to file names ... // std::string theResFile = ResFile; std::string theTrajFile = TrajFile; std::string theEventFile = EventFile; char buf[12]; sprintf(buf, ".%02d.%02d", ParallelDescriptor::MyProc(), tid); theResFile += buf; theTrajFile += buf; theEventFile += buf; std::ofstream traj_ofs, event_ofs; if (!do_not_write_events) { event_ofs.open(theEventFile.c_str(),std::ios::out|std::ios::trunc); if (!event_ofs.good()) BoxLib::FileOpenFailed(EventFile); #ifndef __GNUC__ event_ofs << std::scientific; #endif } if (!do_not_write_trajs) { traj_ofs.open (theTrajFile.c_str(), std::ios::out|std::ios::trunc); if (!traj_ofs.good()) BoxLib::FileOpenFailed(TrajFile); #ifndef __GNUC__ traj_ofs << std::scientific; #endif } int lev; // What level in the AmrData hierarchy? int idx; // What index into BoxArray at that level? IntVect iv; // What cell position in that Box? IntVect iv_tmp; Real t; Array x(BL_SPACEDIM); std::vector traj; BoxLib::mt19937 rand(seed+beg); int counter = 0; PArray ResTime(PArrayManage); if (!do_not_write_resfile) { ResTime.resize(finest_level+1); for (int l = 0; l <= finest_level; l++) { ResTime.set(l, new MultiFab(A_mf[l].boxArray(),1,0)); ResTime[l].setVal(0); } } for (int i = beg; i < cnt+beg; i++) { int rxn = NoReac; int spec = init_spec; bool reacted = dt_spec < 0 ? true : false; bool calc_diff_dt = true; Real dt_diff_save = dt_save; // // We always begin from zero. // t = 0; // // This sets x, iv, lev and idx (among possibly others) ... // GetInitialPosition(spec,rxn,t,traj,i,x,iv,lev,idx,event_ofs,rand); while (t < stop_time) { dt = dt_diff_save; // // Get maximum dt for diffusion. // if (calc_diff_dt) { dt = dt_save; MaxDtDiffusion(spec,dt,iv,lev); dt_diff_save = dt; calc_diff_dt = false; } // // Advect x ... // D_TERM(x[0]+=U_mf[lev][idx](iv,0)*dt;, x[1]+=U_mf[lev][idx](iv,1)*dt;, x[2]+=U_mf[lev][idx](iv,2)*dt;); if (x[0] < 0) x[0] = -x[0]; iv_tmp = Index(x,lev); if (!(iv == iv_tmp)) { // // We're in a different cell. // if (!prob_domain[lev].contains(iv_tmp)) goto done; calc_diff_dt = true; const FArrayBox& c = Conc_mf[lev][idx]; if (c.box().contains(iv_tmp) && c(iv_tmp,0) > 0) { // // Recall that concentration is nonzero except under // fine grid. If we got here we must still be in the // same fab. That it to say, lev and idx are OK, just // set iv. // iv = iv_tmp; } else { Where(x,lev,idx,iv); } } // // Diffuse x ... // const Real rn = rand.d1_value(); if (rn < A_mf[lev][idx](iv,spec)*dt) { x[0] -= dx[lev][0]; } else if (rn < B_mf[lev][idx](iv,spec)*dt) { x[0] += dx[lev][0]; } else if (rn < C_mf[lev][idx](iv,spec)*dt) { x[1] -= dx[lev][1]; } else if (rn < D_mf[lev][idx](iv,spec)*dt) { x[1] += dx[lev][1]; } t += dt; iv_tmp = Index(x,lev); if (!(iv == iv_tmp)) { // // We're in a different cell. // if (!prob_domain[lev].contains(iv_tmp)) goto done; calc_diff_dt = true; const FArrayBox& c = Conc_mf[lev][idx]; if (c.box().contains(iv_tmp) && c(iv_tmp,0) > 0) { // // Recall that concentration is nonzero except under // fine grid. If we got here we must still be in the // same fab. That it to say, lev and idx are OK, just // set iv. // iv = iv_tmp; } else { Where(x,lev,idx,iv); } UpdateTrajectory(x,t,traj); } // // The particle does not move from here on down. // Real tchem = 0; Real dt_chem = dt; bool calc_chem_dt = true; do { if (calc_chem_dt) { dt_chem = dt; calc_chem_dt = false; MaxDtLambda(spec,dt_chem,lev,idx,iv); } dt_chem = std::min(dt_chem,dt-tchem); if (!reacted) dt_chem = dt_spec; const int old_spec = spec; if (spec == res_spec && !do_not_write_resfile) { ResTime[lev][idx](iv) += 0.9*dt_chem; } Chemistry(spec,rxn,dt_chem,lev,idx,iv,rand); if (spec == res_spec && !do_not_write_resfile) { ResTime[lev][idx](iv) += 0.1*dt_chem; } if (spec != old_spec) { reacted = calc_chem_dt = true; WriteEvent(i,x,spec,rxn,t,event_ofs); } tchem += dt_chem; } while (tchem < dt); } done: if (++counter % restime_interval == 0 || i == cnt+beg-1) { WriteResTime(theResFile,ResTime); } WriteEvent(i,x,spec,NoReac,t,event_ofs); UpdateTrajectory(x,t,traj); if (spec != init_spec) WriteTrajectory(i,traj,traj_ofs); traj.clear(); } } class task_advance : public WorkQueue::task { public: task_advance (int tid, int beg, int cnt, Real dt) : m_tid(tid), m_beg(beg), m_cnt(cnt), m_dt(dt) {} virtual void run (); private: int m_tid; int m_beg; int m_cnt; Real m_dt; }; void task_advance::run () { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::run()"); AdvanceParticles(m_tid,m_beg,m_cnt,dt); } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); const int NProcs = ParallelDescriptor::NProcs(); const int MyProc = ParallelDescriptor::MyProc(); const int IOProc = ParallelDescriptor::IOProcessorNumber(); if (argc < 2) PrintUsage(argv[0]); ParmParse pp; ScanArguments(pp); ReadPlotFiles(); TwiddleConcentration(); Twiddle_ABCD(); ReadEdgeData(); // // Don't measure the time to read plotfiles ... // const Real run_strt = ParallelDescriptor::second(); BL_ASSERT(pedges.size() > 0 && edgedata.size() > 0); BL_ASSERT(pedges.size() == Conc_mf[0].nComp()); if (calc_lambda_max) MaxLambda(); if (build_prob_dist) BuildProbDist(); BuildLookupTable(); int nthreads = BoxLib::theWorkQueue().max_threads(); if (nthreads == 0) nthreads = 1; const int ParticlesPerNode = n_particles / NProcs; const int ParticlesPerThread = ParticlesPerNode / nthreads; for (int tid = 0; tid < nthreads; tid++) { int cnt = ParticlesPerThread; int beg = part_start + ParticlesPerNode * MyProc + cnt * tid; if (tid == nthreads - 1) { // // Last thread per node gets remaining per node particles. // cnt += ParticlesPerNode % nthreads; if (NProcs > 1 && MyProc == NProcs - 1) // // Last thread in last node gets all remaining particles. // cnt += n_particles % NProcs; } std::cout << "Thread: " << tid << ", node: " << MyProc << ", particles: [" << beg << ',' << beg+cnt << ")\n"; BoxLib::theWorkQueue().add(new task_advance(tid,beg,cnt,dt)); } BoxLib::theWorkQueue().wait(); Real run_stop = ParallelDescriptor::second() - run_strt; ParallelDescriptor::ReduceRealMax(run_stop, IOProc); if (ParallelDescriptor::IOProcessor()) { std::cout << "\n**Run time = " << run_stop << "\n**Avg Runtime/Particle: " << run_stop/n_particles << std::endl; } BoxLib::Finalize(); } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveIntScalLen_3D.F0000644000175000017500000001605011634153073024147 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "ArrayLim.H" #include "AmrDeriveIntScalLen_F.H" subroutine FORT_SCALLEN (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,dx,ovlo,ovhi,TSL_z,corr,corrSize, $ ug,uglo1,uglo2,uglo3,ughi1,ughi2,ughi3) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer uglo1,uglo2,uglo3 integer ughi1,ughi2,ughi3 integer corrSize integer ovlo(3), ovhi(3) integer nvar REAL_T dx(3) REAL_T u(1:uhii1-uloi1+1, 1:uhii2-uloi2+1, 1:uhii3-uloi3+1, nvar) REAL_T ug(1:ughi1-uglo1+1, 1:ughi2-uglo2+1, 1:ughi3-uglo3+1) REAL_T TSL_z(1:uhii3-uloi3+1) REAL_T corr(0:corrSize-1) integer i,j,k,imax,jmax,kmax, ir, vComp REAL_T average, sum vComp = 1 imax = uhii1-uloi1+1 jmax = uhii2-uloi2+1 kmax = uhii3-uloi3+1 do i=1,imax do k=1,kmax do j=1,jmax ug(i, j,k) = u(i,j,k,vComp) ug(i+imax,j,k) = u(i,j,k,vComp) enddo enddo enddo average = 0.d0 do k=1,kmax do i=1,imax/2 ir = i-1 sum = zero do j=1,jmax do ibase=1,imax sum = sum + ug(ibase,j,k)*ug(ibase+ir,j,k) enddo enddo corr(ir) = sum enddo factor = corr(0) if (factor.ne.zero) then do ir = 0,imax/2-1 corr(ir) = corr(ir)/factor enddo endif sum = 0.d0 do ir=1,imax/2-1 sum = sum+half*(corr(ir)+corr(ir-1))*dx(vComp) enddo average = average + sum TSL_z(k) = sum c write(*,*)" integral scale at k = ",k, " is ", sum enddo end subroutine FORT_TKE (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,dx,ovlo,ovhi,TKE_z) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T dx(3) REAL_T u(1:uhii1-uloi1+1, 1:uhii2-uloi2+1, 1:uhii3-uloi3+1, nvar) REAL_T TKE_z(1:uhii3-uloi3+1) integer i,j,k,imax,jmax,kmax REAL_T average, sum, ave(3), tmp(3) imax = uhii1-uloi1+1 jmax = uhii2-uloi2+1 kmax = uhii3-uloi3+1 c Turb kinetic energy do k=1,kmax do n = 1,3 ave(n) = zero end do do j=1,jmax do i=1,imax do n = 1,3 ave(n) = ave(n) + u(i,j,k,n) end do end do end do do n = 1,3 ave(n) = ave(n)/(jmax*imax) tmp(n) = zero end do do j=1,jmax do i=1,imax do n = 1,3 tmp(n) = tmp(n) + (u(i,j,k,n) - ave(n))**2 end do end do end do TKE_z(k) = zero do n = 1,3 TKE_z(k) = TKE_z(k) + half*tmp(n)/(jmax*imax) end do end do end subroutine FORT_GUS (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,dx,ovlo,ovhi,GUS_z) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T dx(3) REAL_T u(1:uhii1-uloi1+1, 1:uhii2-uloi2+1, 1:uhii3-uloi3+1, nvar) REAL_T GUS_z(2:uhii3-uloi3) integer i,j,k,imax,jmax,kmax REAL_T ave(3), uprime(3) imax = uhii1-uloi1+1 jmax = uhii2-uloi2+1 kmax = uhii3-uloi3+1 c Grad(U) sqrd sum = 0.d0 DO k=2, kmax-1 sum = zero DO n=1,3 DO j=2, jmax-1 DO i=2, imax-1 vx = (u(i+1,j,k,n)-u(i-1,j,k,n))/(2.*dx(1)) vy = (u(i,j+1,k,n)-u(i,j-1,k,n))/(2.*dx(2)) vz = (u(i,j,k+1,n)-u(i,j,k-1,n))/(2.*dx(3)) sum =sum+vx*vx+vy*vy+vz*vz ENDDO ENDDO ENDDO GUS_z(k) = sum / dfloat((imax-2)*(jmax-2)*(kmax-2)) ENDDO end subroutine FORT_TI (u,uloi1,uloi2,uloi3,uhii1,uhii2,uhii3, $ nvar,dx,ovlo,ovhi,TIz) integer uloi1,uloi2,uloi3 integer uhii1,uhii2,uhii3 integer ovlo(3), ovhi(3) integer nvar REAL_T dx(3) REAL_T u(1:uhii1-uloi1+1, 1:uhii2-uloi2+1, 1:uhii3-uloi3+1, nvar) REAL_T TI_z(1:uhii3-uloi3+1) integer i,j,k,imax,jmax,kmax,vComp REAL_T average, sum vComp = 1 imax = uhii1-uloi1+1 jmax = uhii2-uloi2+1 kmax = uhii3-uloi3+1 c Turbulent intensity (of vComp component) do k=1,kmax average = zero do j=1,jmax do i=1,imax average= average + u(i,j,k,vComp) enddo enddo average = average/dfloat(imax*jmax) do j=1,jmax do i=1,imax sum = sum +(u(i,j,k,vComp)-average)**2 enddo enddo sum = dsqrt(sum/dfloat(imax*jmax)) TI_z(k) = sum c write(*,*) "turbulent intensity at ",k," = ",sum enddo end subroutine FORT_TAVG (T,Tloi1,Tloi2,Tloi3,Thii1,Thii2,Thii3, $ nvar,dx,ovlo,ovhi,TAVG_z) integer Tloi1,Tloi2,Tloi3 integer Thii1,Thii2,Thii3 integer ovlo(3), ovhi(3) integer nvar REAL_T dx(3) REAL_T T(1:Thii1-Tloi1+1, 1:Thii2-Tloi2+1, 1:Thii3-Tloi3+1, nvar) REAL_T TAVG_z(1:Thii3-Tloi3+1) integer i,j,k,imax,jmax,kmax REAL_T average, sum, avg imax = Thii1-Tloi1+1 jmax = Thii2-Tloi2+1 kmax = Thii3-Tloi3+1 c Average T do k=1,kmax TAVG_z(k) = zero do j=1,jmax do i=1,imax TAVG_z(k) = TAVG_z(k) + T(i,j,k,1) end do end do TAVG_z(k) = TAVG_z(k)/(jmax*imax) end do end ccseapps-2.5/CCSEApps/pAmrDerive/stochEdgeData-N.txt0000644000175000017500000001317411634153073023356 0ustar amckinstryamckinstry25 76 0 1 3 1 1 1 3 1 2 1 1 1 3 1 4 1 4 1 1 1 5 -1 1 1 6 -1 1 1 8 -1 1 2 9 -1 1 1 14 -1 2 1 15 -1 3 1 16 -1 3 1 17 -1 3 1 18 -1 3 1 19 -1 3 1 21 -1 3 1 28 1 3 1 44 1 11 1 45 1 24 1 46 1 24 1 48 -1 1 1 55 -1 8 1 59 -1 8 1 60 1 12 1 61 1 12 1 62 1 24 1 66 -1 9 1 67 -1 9 1 68 1 24 1 71 -1 10 1 74 1 12 1 81 -1 11 1 85 1 3 1 91 -1 12 2 94 -1 12 1 95 1 1 1 109 -1 1 1 112 -1 3 1 114 -1 12 1 131 -1 18 1 132 -1 18 1 135 -1 15 1 136 -1 15 1 137 -1 15 1 140 1 12 1 141 1 24 1 142 -2 1 2 142 -2 15 2 144 -1 3 1 150 -1 20 1 151 -1 20 1 153 -1 20 1 161 -1 1 1 163 -1 9 1 166 1 3 1 168 -1 1 1 169 -1 3 1 172 1 13 1 173 1 23 1 174 -1 1 1 178 1 13 1 179 1 18 1 180 -1 1 1 184 1 13 1 186 -1 1 1 187 1 13 1 188 1 9 1 189 1 15 1 192 -1 12 1 193 1 14 1 194 1 9 1 196 -1 12 1 200 1 3 1 203 1 14 1 205 1 18 1 206 1 13 1 37 2 -1 0 1 4 -1 0 1 5 1 0 1 6 1 0 1 7 1 2 1 8 1 0 2 9 2 0 2 9 2 2 2 10 -1 2 1 11 -1 2 1 12 -1 2 1 13 -1 2 1 19 1 4 1 29 1 4 1 30 -1 4 1 31 -1 4 1 32 -1 4 1 47 1 12 1 48 1 0 1 50 -1 4 1 63 1 12 1 95 -1 0 1 109 1 0 1 110 1 12 1 111 1 24 1 113 -1 4 1 142 1 0 1 143 1 12 1 145 -1 4 1 161 1 0 1 165 1 4 1 167 1 4 1 168 1 0 1 174 1 0 1 180 1 0 1 186 1 0 1 207 1 18 1 7 7 -1 1 1 9 -1 1 1 10 1 1 1 11 1 1 1 12 1 1 1 13 1 1 1 14 1 0 1 29 0 -1 0 1 1 -1 0 1 15 1 0 1 16 1 0 1 17 1 0 1 18 1 0 1 19 1 0 1 20 1 12 2 21 1 0 1 22 -1 5 1 23 -1 5 1 25 -1 5 1 27 -1 5 1 28 -2 0 2 28 -2 5 2 29 -1 5 1 39 -1 7 1 49 -1 5 1 56 -1 8 1 58 -1 8 1 85 -1 0 1 94 -1 12 1 112 1 0 1 119 -1 16 1 124 -1 16 1 144 1 0 1 166 -1 0 1 169 1 0 1 200 -1 0 1 11 3 -1 0 1 19 -1 1 1 29 -1 1 1 30 1 1 1 31 1 1 1 32 1 1 1 50 1 1 1 113 1 1 1 145 1 1 1 165 -1 1 1 167 -1 1 1 11 22 1 3 1 23 1 3 1 24 1 7 1 25 1 3 1 26 1 7 1 27 1 3 1 28 1 3 1 29 1 3 1 42 -1 7 1 48 -1 7 1 49 1 3 1 12 21 -1 7 1 33 1 7 1 34 1 7 1 35 1 7 1 36 1 7 1 37 1 7 1 43 -1 7 1 49 -1 7 1 50 -1 7 1 75 -1 7 1 86 -1 7 1 125 -1 7 1 34 21 1 6 1 24 -1 5 1 26 -1 5 1 33 -1 6 1 34 -1 6 1 35 -1 6 1 36 -1 6 1 37 -1 6 1 38 1 8 1 39 1 3 1 40 1 8 1 41 1 8 1 42 1 5 1 43 1 6 1 44 1 11 1 45 1 24 1 46 1 24 1 47 1 12 1 48 1 5 1 49 1 6 1 50 1 6 1 51 1 10 2 52 1 10 1 53 1 24 1 71 -1 10 1 74 -1 10 1 75 1 6 1 76 -1 8 1 86 1 6 1 87 -1 8 1 103 -1 13 1 118 -1 16 1 125 1 6 1 126 -1 8 1 25 38 -1 7 1 40 -1 7 1 41 -1 7 1 52 1 10 1 54 1 9 1 55 1 0 1 56 1 3 1 57 1 9 1 58 1 3 1 59 1 0 1 60 1 12 1 61 1 12 1 62 1 24 1 63 1 12 1 64 1 24 2 65 1 24 1 76 1 7 1 81 -1 11 1 87 1 7 1 98 -1 13 1 117 -1 16 1 120 -1 16 1 126 1 7 1 134 -1 15 1 182 -1 24 1 22 53 1 24 1 54 -1 8 1 57 -1 8 1 65 1 24 1 66 1 0 1 67 1 0 1 68 1 24 1 105 -1 14 1 133 -1 15 1 146 1 24 1 152 -1 20 1 163 1 0 1 175 1 23 1 181 1 13 1 183 1 24 1 188 -1 0 1 190 1 14 1 191 -1 24 1 194 -1 0 1 195 -1 24 1 201 1 13 1 208 1 13 1 13 51 -1 7 1 52 -2 7 1 52 -2 8 1 69 1 11 1 70 1 11 1 71 2 7 1 71 2 0 1 72 1 11 1 73 1 11 1 74 2 7 1 74 2 12 1 75 1 11 1 76 1 11 1 20 44 -2 7 1 44 -2 0 1 69 -1 10 1 70 -1 10 1 72 -1 10 1 73 -1 10 1 75 -1 10 1 76 -1 10 1 77 1 24 1 78 1 24 1 79 1 24 1 80 1 12 1 81 2 0 1 81 2 8 1 82 1 24 1 83 1 24 1 84 1 24 1 85 1 24 1 86 1 24 1 87 1 24 1 34 20 -1 3 1 47 -2 7 1 47 -2 1 1 60 -2 0 1 60 -2 8 1 61 -2 0 1 61 -2 8 1 63 -2 1 1 63 -2 8 1 74 -2 0 1 74 -2 10 1 80 -1 11 1 88 1 24 1 89 1 24 1 90 1 24 1 91 1 0 1 92 1 24 1 93 1 24 1 94 2 3 1 94 2 0 1 95 1 24 1 110 -2 1 1 110 -2 14 1 114 2 0 1 114 2 20 1 140 -2 0 1 140 -2 15 1 143 -2 1 1 143 -2 15 1 162 1 24 1 192 2 0 1 192 2 13 1 196 2 0 1 196 2 14 1 34 96 -1 14 1 97 1 15 1 98 1 8 1 99 1 14 1 100 1 14 1 101 1 17 1 102 1 16 1 103 1 7 1 104 1 19 1 112 -1 14 1 113 -1 14 1 115 -1 14 1 130 -1 18 1 151 -1 20 1 152 -1 20 1 154 -1 21 1 160 -1 23 1 170 -1 14 1 172 -1 0 1 178 -1 0 1 181 -1 9 1 182 -1 24 1 184 -1 0 1 185 1 14 1 187 -1 0 1 191 -1 24 1 192 -1 12 1 197 -1 14 1 199 -1 14 1 201 -1 9 1 202 -1 15 1 204 -1 14 1 206 -1 0 1 208 -1 9 1 32 96 1 13 1 99 -1 13 1 100 -1 13 1 104 1 19 1 105 1 9 1 106 1 15 1 107 1 15 1 108 1 15 1 109 1 15 1 110 1 12 1 111 1 24 1 112 1 13 1 113 1 13 1 114 1 20 1 115 1 13 1 116 1 20 1 148 -1 19 1 149 -1 19 1 150 -1 20 1 158 -1 22 1 159 1 22 1 170 1 13 1 176 1 22 1 185 -1 13 1 190 -1 9 1 193 -1 0 1 195 -1 24 1 196 -1 12 1 197 1 13 1 199 1 13 1 203 -1 0 1 204 1 13 1 38 97 -1 13 1 106 -1 14 1 107 -1 14 1 108 -1 14 1 109 -1 14 1 115 -1 16 1 116 1 20 1 121 -1 16 1 122 -1 16 1 123 -1 16 1 125 -1 16 1 126 -1 16 1 127 -1 17 1 128 -1 17 1 129 -1 17 1 133 1 9 1 134 1 8 1 135 1 0 1 136 1 0 1 137 1 0 1 138 1 16 1 139 1 16 1 140 1 12 1 141 1 24 1 142 1 0 1 143 1 12 1 144 1 16 1 145 1 16 1 146 1 24 1 147 1 24 2 148 -1 19 1 153 -1 20 1 156 -1 21 1 164 1 16 1 171 1 16 1 189 -1 0 1 198 1 16 1 202 1 13 1 19 102 -1 13 1 115 1 15 1 117 1 8 1 118 1 7 1 119 1 3 1 120 1 8 1 121 1 15 1 122 1 15 1 123 1 15 1 124 1 3 1 125 1 15 1 126 1 15 1 138 -1 15 1 139 -1 15 1 144 -1 15 1 145 -1 15 1 164 -1 15 1 171 -1 15 1 198 -1 15 1 6 101 -1 13 1 127 1 15 1 128 1 15 1 129 1 15 1 149 -1 19 1 177 1 21 1 6 130 1 13 1 131 1 0 1 132 1 0 1 179 -1 0 1 205 -1 0 1 207 -1 1 1 6 104 -2 14 1 104 -2 13 1 148 2 14 1 148 2 15 1 149 2 14 1 149 2 17 1 12 114 -2 14 1 114 -2 12 1 116 -2 14 1 116 -2 15 1 150 2 14 1 150 2 0 1 151 2 0 1 151 2 13 1 152 2 13 1 152 2 9 1 153 2 15 1 153 2 0 1 5 154 1 13 1 155 1 22 1 156 1 15 1 157 1 22 1 177 -1 17 1 5 155 -1 21 1 157 -1 21 1 158 1 14 1 159 -1 14 1 176 -1 14 1 4 160 1 13 1 173 -1 0 1 175 -1 9 1 183 1 24 1 44 45 -2 7 1 45 -2 0 1 46 -2 7 1 46 -2 0 1 53 -2 7 1 53 -2 9 1 62 -2 0 1 62 -2 8 1 64 -1 8 1 65 -2 9 1 65 -2 8 1 68 -2 0 1 68 -2 9 1 77 -1 11 1 78 -1 11 1 79 -1 11 1 82 -1 11 1 83 -1 11 1 84 -1 11 1 85 -1 11 1 86 -1 11 1 87 -1 11 1 88 -1 12 1 89 -1 12 1 90 -1 12 1 92 -1 12 1 93 -1 12 1 95 -1 12 1 111 -2 1 1 111 -2 14 1 141 -2 0 1 141 -2 15 1 146 -2 9 1 146 -2 15 1 147 -1 15 1 162 -1 12 1 182 2 8 1 182 2 13 1 183 -2 9 1 183 -2 23 1 191 2 9 1 191 2 13 1 195 2 9 1 195 2 14 1 ccseapps-2.5/CCSEApps/pAmrDerive/Docs/0000755000175000017500000000000011634153073020605 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/pAmrDerive/Docs/AmrDerive.tex0000644000175000017500000000023611634153073023206 0ustar amckinstryamckinstry\documentclass{article} \title{AmrDerive User's Guide} \author{Vince Beckner} \date{} \begin{document} \maketitle \include{AmrDeriveBody} \end{document} ccseapps-2.5/CCSEApps/pAmrDerive/Docs/AmrDeriveBody.tex0000644000175000017500000000357011634153073024030 0ustar amckinstryamckinstry\section{AmrDerive} \subsection{Overview} {\em AmrDerive} is a data extraction and analysis tool for Adaptive Mesh Refinement ({\bf AMR}) data sets. It creates plot files from other plot files, typically creating new data sets from state data. {\em AmrDerive} works for 2D and 3D data sets and can run in parallel on both SMP and distributed memory parallel machines using parallel {\em BoxLib} and parallel {\em DataServices}. {\em AmrDerive} requires the user to write code to perform specific derivation functions. The release version contains a framework for reading and writing plot files and accessing data in parallel, and examples are provided for the user to use and modify. \subsection{Using AmrDerive} [Not finished...] Using the {\bf -help} argument (or no arguments) will cause {\em amrderive} to print a usage message and exit. The usage is currently as follows for an execuatble compiled with AmrDerive.cpp. \begin{verbatim} AmrDerive3d.OSF1.KCC.ex outfile = outputFileName infile = inputFileName(s) type = derivedTypeName [-help] [-verbose] [fab.format = FormatType] where FormatType=IEEE32(default), ASCII, 8BIT, or NATIVE Available types: logden xvel yvel zvel teng eint kint vorticity concentration dilitation \end{verbatim} \subsubsection{Writing Derive Functions} [Not finished...] \subsection{Files and Directories} \begin{verbatim} AmrDerive.cpp AmrDeriveAvgPlots.cpp AmrDeriveBinTrac.cpp AmrDeriveIntegrate.cpp AmrDeriveMatLab.cpp AmrDerivePeriodicFab.cpp Derived.H DERIVE_3D.F \end{verbatim} \subsection{Examples} [Not finished...] AmrDerive3d.OSF1.KCC.MPI.ex infile=plt0010 outfile=plt0010.logden type=logden \subsection{FAQ} To expand file names on the command line, you must use a space after the equal sign. inputs=plt* (No match--does not expand plt*.) use: inputs= plt* (with space before plt*). ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveFlameArea.cpp0000644000175000017500000002472411634153073024046 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ //BL_COPYRIGHT_NOTICE #include #include #include using std::cout; using std::cerr; using std::endl; #include #include #include #include #include #include #include #ifndef WIN32 #include #endif #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "FArrayBox.H" #include "Utility.H" #include "ArrayLim.H" static void print_usage (int, char* argv[]) { cerr << "usage:\n"; cerr << argv[0] << " infile [options] \n\tOptions:\n"; exit(1); } class IVLess { public: bool operator () (const IntVect& lhs, const IntVect& rhs) const { return lhs.lexLT(rhs); } }; #if defined(BL_FORT_USE_UPPERCASE) # define PROCESS PROCESS # define BILIN BILIN # define HACKD HACKD #elif defined(BL_FORT_USE_LOWERCASE) # define PROCESS process # define BILIN bilin # define HACKD hackd #elif defined(BL_FORT_USE_UNDERSCORE) # define PROCESS process_ # define BILIN bilin_ # define HACKD hackd_ #endif extern "C" { void PROCESS(const int* lo, const int* hi, const int* dlo, int* tf, ARLIM_P(tf_lo), ARLIM_P(tf_hi), const Real* T, ARLIM_P(T_lo), ARLIM_P(T_hi), int* listi, int* listj, int* listk, int* length, const Real* delta, Real* area, const Real* sVal, const int* imeth); void BILIN(const Real* src, ARLIM_P(slo), ARLIM_P(shi), Real* dst, ARLIM_P(dlo), ARLIM_P(dhi), const int* r); void HACKD(Real* dat, ARLIM_P(dlo), ARLIM_P(dhi), const Real* dx, const Real* problo); }; void main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc < 2) print_usage(argc,argv); ParmParse pp; if (pp.contains("help")) print_usage(argc,argv); bool verbose = false; if (pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(verbose); } std::string infile; pp.get("infile",infile); int writeFlame=0; pp.query("writeFlame",writeFlame); int imeth=0; pp.query("imeth",imeth); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(infile, fileType); if (!dataServices.AmrDataOk()) // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); const int finestLevel = amrData.FinestLevel(); const int Nlev = finestLevel + 1; Array plotnames = amrData.PlotVarNames(); int idT = -1; for (int i=0; i fragCnt(Nlev,0); Array > levelIVset(Nlev); Array Area(Nlev,0.0); Real sVal=1090.; pp.query("sVal",sVal); Real areaCheck = 0.; //for (int lev=0; lev state(ba.size()); Array boxes(ba.size()); for (int i=0; ibox()); } amrData.FillVar(state,boxes,lev,"temp",ParallelDescriptor::IOProcessorNumber()); std::set& ivSet = levelIVset[lev]; if (verbose) cout << "...computing flame surface area at lev=" << lev << "..." << endl; const Array& dx = amrData.DxLevel()[lev]; const int jmid = int(0.5*(dBox.hiVect()[1]-dBox.loVect()[1]+1) - 1); const int jhi = jmid + int(yrange/dx[1]); const int jlo = jmid - int(yrange/dx[1]); const int klo = dBox.loVect()[2]; const int khi = dBox.loVect()[2] + int(zrange/dx[2]); IntVect ivlo = dBox.smallEnd(); ivlo[1] = jlo; ivlo[2] = klo; IntVect ivhi = dBox.bigEnd(); ivhi[1] = jhi; ivhi[2] = khi; Box subBox(ivlo,ivhi); if (verbose) cout << "...computing area over box = " << subBox << " using " << (imeth==0 ? "jbb's" : "jfg's" ) << " method" << endl; for (int i=0; i tf(BoxLib::grow(box,1),1); size_t bigLen = tf.box().numPts(); Array myListI(bigLen); Array myListJ(bigLen); Array myListK(bigLen); int myLen = 0; Real myArea = 0.0; //if (lev==0) HACKD(state[i]->dataPtr(), ARLIM(state[i]->loVect()),ARLIM(state[i]->hiVect()), dx.dataPtr(),amrData.ProbLo().dataPtr()); PROCESS(box.loVect(),box.hiVect(),dBox.loVect(), tf.dataPtr(), ARLIM(tf.loVect()),ARLIM(tf.hiVect()), state[i]->dataPtr(0), ARLIM(state[i]->loVect()),ARLIM(state[i]->hiVect()), myListI.dataPtr(), myListJ.dataPtr(), myListK.dataPtr(),&myLen,dx.dataPtr(),&myArea,&sVal,&imeth); Area[lev] += myArea; // Idiot check...better not have counted any of these before for (int n=0; nbox()).refine(r); FArrayBox fdat(fBox,1); const FArrayBox& cdat = *(state[i]); BILIN(cdat.dataPtr(),ARLIM(cdat.loVect()),ARLIM(cdat.hiVect()), fdat.dataPtr(),ARLIM(fdat.loVect()),ARLIM(fdat.hiVect()),&r); const Box rBox = Box(ba[i]).refine(r).grow(1); BaseFab tf(BoxLib::grow(rBox,1),1); size_t bigLen = tf.box().numPts(); Array myListI(bigLen); Array myListJ(bigLen); Array myListK(bigLen); int myLen = 0; Real myArea = 0.0; const Box fdBox = Box(dBox).refine(r); Array fdx(BL_SPACEDIM); for (int d=0; d::const_iterator it = ivSet.begin(); it != ivSet.end() ; ++it) { ba.set(cnt++,Box(*it,*it)); } std::string gFile("flameGrids"); if (verbose) std::cout << "Writing grids to " << gFile << std::endl; std::ofstream osf(gFile.c_str(),std::ios::out); osf << "1" << endl; ba.writeOn(osf); osf.close(); } if (verbose) cout << " ...................done" << endl; } cout << "Check area: " << areaCheck << endl; if (verbose) { for (int lev=0; lev #include #include Attribute* ADD_tmp; Attribute* ADD_at; static const char* TYPE_NAMES[ChTYPES] = {"INTEGER", "FLOAT", "DOUBLE", "CHAR", "INTVECT2D", "INTVECT3D", "BOX2D", "BOX3D" }; void initializeHDF5datatypes() { static int initialized = 1; if(initialized == 1){ initialized = 0; intvect2d_id = H5Tcreate (H5T_COMPOUND, sizeof(intvect2d)); H5Tinsert (intvect2d_id, "intvecti", HOFFSET(intvect2d, i), H5T_NATIVE_INT); H5Tinsert (intvect2d_id, "intvectj", HOFFSET(intvect2d, j), H5T_NATIVE_INT); intvect3d_id = H5Tcreate (H5T_COMPOUND, sizeof(intvect3d)); H5Tinsert (intvect3d_id, "intvecti", HOFFSET(intvect3d, i), H5T_NATIVE_INT); H5Tinsert (intvect3d_id, "intvectj", HOFFSET(intvect3d, j), H5T_NATIVE_INT); H5Tinsert (intvect3d_id, "intvectk", HOFFSET(intvect3d, k), H5T_NATIVE_INT); /* old composite-of-composite style boxes box2d_id = H5Tcreate (H5T_COMPOUND, sizeof(box)); H5Tinsert (box2d_id, "smallend", HOFFSET(box2d, lo), intvect2d_id); H5Tinsert (box2d_id, "bigend", HOFFSET(box2d, hi), intvect2d_id); box3d_id = H5Tcreate (H5T_COMPOUND, sizeof(box)); H5Tinsert (box3d_id, "smallend", HOFFSET(box3d, lo), intvect3d_id); H5Tinsert (box3d_id, "bigend", HOFFSET(box3d, hi), intvect3d_id); */ box2d_id = H5Tcreate (H5T_COMPOUND, sizeof(box)); H5Tinsert (box2d_id, "lo_i", HOFFSET(box2d, lo.i), H5T_NATIVE_INT); H5Tinsert (box2d_id, "lo_j", HOFFSET(box2d, lo.j), H5T_NATIVE_INT); H5Tinsert (box2d_id, "hi_i", HOFFSET(box2d, hi.i), H5T_NATIVE_INT); H5Tinsert (box2d_id, "hi_j", HOFFSET(box2d, hi.j), H5T_NATIVE_INT); box3d_id = H5Tcreate (H5T_COMPOUND, sizeof(box)); H5Tinsert (box3d_id, "lo_i", HOFFSET(box3d, lo.i), H5T_NATIVE_INT); H5Tinsert (box3d_id, "lo_j", HOFFSET(box3d, lo.j), H5T_NATIVE_INT); H5Tinsert (box3d_id, "lo_k", HOFFSET(box3d, lo.k), H5T_NATIVE_INT); H5Tinsert (box3d_id, "hi_i", HOFFSET(box3d, hi.i), H5T_NATIVE_INT); H5Tinsert (box3d_id, "hi_j", HOFFSET(box3d, hi.j), H5T_NATIVE_INT); H5Tinsert (box3d_id, "hi_k", HOFFSET(box3d, hi.k), H5T_NATIVE_INT); } } void printAttributes(HDF5attributes* attr) { Attribute* at; int i; for(i=0; iaccessByType[i]; while(at != NULL) { printf("%s attribute %s \n", TYPE_NAMES[i], at->name); at = at->next; } } } void initHDF5attributes(HDF5attributes* attr) { int i; for(i=0; iaccessByType[i] = NULL; attr->numByType[i] = 0; } } void freeDataArray(FAB_CHOMBO* ArrayBoxCArray, int length) { /* exploit the fact that I allocate the entire array and hand the pointer off to the first entry in the array */ if(length > 0) { free(ArrayBoxCArray->f2.data); } } int numPnts2(const box2d* box) { return (box->hi.i-box->lo.i+1)*(box->hi.j-box->lo.j+1); } int numPnts3(const box3d* box) { return (box->hi.i-box->lo.i+1)*(box->hi.j-box->lo.j+1)*(box->hi.k-box->lo.k+1); } int isEmpty(const box2d* box) { return (box->hi.i < box->lo.i)||(box->hi.j < box->lo.j); } void refine2(box2d* b2, int refinement) { b2->lo.i*=refinement; b2->lo.j*=refinement; b2->hi.i = (b2->hi.i + 1)*refinement - 1; b2->hi.j = (b2->hi.j + 1)*refinement - 1; } void refine3(box3d* b3, int refinement) { b3->lo.i*=refinement; b3->lo.j*=refinement; b3->lo.k*=refinement; b3->hi.i = (b3->hi.i + 1)*refinement - 1; b3->hi.j = (b3->hi.j + 1)*refinement - 1; b3->hi.k = (b3->hi.k + 1)*refinement - 1; } int Handleopen(HDF5Handle* handle, const char* filename, hid_t access) { herr_t ret = 0; hid_t attr, datatype, aid; float fl = 0; double dl = 0; if(access == H5F_ACC_RDONLY) { handle->file_ID = H5Fopen(filename, access, H5P_DEFAULT); if(handle->file_ID < 0) return -1; handle->group_ID = H5Gopen(handle->file_ID, "Chombo_global"); if(handle->group_ID < 0) return 1; /* printf("handle->file_ID=%i, handle->group_ID=%i",handle->file_ID, handle->group_ID); */ attr = H5Aopen_name(handle->group_ID, "SpaceDim"); ret = H5Aread(attr, H5T_NATIVE_INT, &(handle->dim)); ret = H5Aclose(attr); attr = H5Aopen_name(handle->group_ID, "testReal"); datatype = H5Aget_type(attr); if(H5Tget_precision(datatype) == H5Tget_precision(H5T_NATIVE_FLOAT)) handle->precision = Float; else handle->precision = Double; } else if(access == H5F_ACC_TRUNC) { handle->file_ID = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); handle->group_ID = H5Gcreate(handle->file_ID, "Chombo_global", 0); aid = H5Screate(H5S_SCALAR); attr = H5Acreate( handle->group_ID, "SpaceDim", H5T_NATIVE_INT, aid, H5P_DEFAULT); ret = H5Awrite(attr, H5T_NATIVE_INT, &(handle->dim)); H5Aclose(attr); if(handle->precision == Float) { attr = H5Acreate(handle->group_ID, "testReal", H5T_NATIVE_FLOAT, aid, H5P_DEFAULT); ret = H5Awrite(attr, H5T_NATIVE_FLOAT, &fl); } else { attr = H5Acreate(handle->group_ID, "testReal", H5T_NATIVE_DOUBLE, aid, H5P_DEFAULT); ret = H5Awrite(attr, H5T_NATIVE_DOUBLE, &dl); } } if(handle->group_ID > 0) H5Gclose(handle->group_ID); handle->group_ID = H5Gopen(handle->file_ID, "/"); return 0; } int HandlesetGroup(HDF5Handle* handle, const char* group) { H5Gclose(handle->group_ID); handle->group_ID = H5Gopen(handle->file_ID, group); if(handle->group_ID > 0) return 0; return -1; } int HandleCreateGroup(HDF5Handle* handle, const char* group) { H5Gclose(handle->group_ID); handle->group_ID = H5Gcreate(handle->file_ID, group, 0); if(handle->group_ID > 0) return 0; return -1; } int Handleclose(HDF5Handle handle) { H5Gclose(handle.group_ID); return H5Fclose(handle.file_ID); } void freeHDF5attributes(HDF5attributes* attributes) { int i; Attribute *next, *tmp; for(i=0; iaccessByType[i]; while(next != NULL) { tmp = next; next=tmp->next; free(tmp->data); free(tmp->name); free(tmp); } attributes->accessByType[i] = NULL; attributes->numByType[i] = 0; } } herr_t attributeScan(hid_t loc_id, const char *name, void *opdata) { herr_t ret = 0; HDF5attributes* data = opdata; hid_t attr, atype, aclass; size_t size = 0; Attribute* attribute, *head; size = strlen(name) + 1; attribute = malloc(sizeof(Attribute)); attribute->name = malloc(size); memcpy(attribute->name, name, size); attr = H5Aopen_name(loc_id, name); atype = H5Aget_type(attr); aclass = H5Tget_class(atype); switch(aclass){ case H5T_INTEGER : data->numByType[INTEGER]++; attribute->attributeType = INTEGER; attribute->data = malloc(sizeof(int)); ret = H5Aread(attr, H5T_NATIVE_INT, attribute->data); break; case H5T_FLOAT: if(data->precision == Float) { data->numByType[FLOAT]++; attribute->attributeType = FLOAT; attribute->data = malloc(sizeof(float)); ret = H5Aread(attr, H5T_NATIVE_FLOAT, attribute->data); } else { data->numByType[DOUBLE]++; attribute->attributeType = DOUBLE; attribute->data = malloc(sizeof(double)); ret = H5Aread(attr, H5T_NATIVE_DOUBLE, attribute->data); } break; case H5T_STRING: data->numByType[CHAR]++; size = H5Tget_size(atype); attribute->attributeType = CHAR; attribute->data = malloc(size+1); ret = H5Aread(attr, atype, attribute->data ); if(ret < 0) break; ((char *)(attribute->data))[size] = '\0'; break; case H5T_COMPOUND: if(strcmp(H5Tget_member_name(atype, 0), "lo_i") == 0) { if(data->dim == 2) { data->numByType[BOX2D]++; attribute->attributeType = BOX2D; attribute->data = malloc(sizeof(box)); ret = H5Aread(attr, box2d_id, attribute->data); } else if(data->dim == 3) { data->numByType[BOX3D]++; attribute->attributeType = BOX3D; attribute->data = malloc(sizeof(box)); ret = H5Aread(attr, box3d_id, attribute->data); } break; } else if(strcmp(H5Tget_member_name(atype, 0), "intvecti") == 0) { if(data->dim == 2) { data->numByType[INTVECT2D]++; attribute->attributeType = INTVECT2D; attribute->data = malloc(sizeof(intvect2d)); ret = H5Aread(attr, intvect2d_id, attribute->data); } else if(data->dim == 3) { data->numByType[INTVECT3D]++; attribute->attributeType = INTVECT3D; attribute->data = malloc(sizeof(intvect3d)); ret = H5Aread(attr, intvect3d_id, attribute->data); } break; } default: /* don't know what the hell this thing is */ free(attribute->name); free(attribute); return -1; } /* OK, lets tack this attribute to the right linked-list */ head = data->accessByType[attribute->attributeType]; data->accessByType[attribute->attributeType] = attribute; attribute->next = head; return ret; } int readHDF5attributes(HDF5attributes* attr, HDF5Handle handle) { int i; attr->dim = handle.dim; attr->precision = handle.precision; for(i=0; inumByType[i] = 0; attr->accessByType[i] = NULL; } return H5Aiterate(handle.group_ID, NULL, attributeScan, attr); } int readBoxes(box** boxes, int* length, HDF5Handle handle) { hid_t boxdataset, boxdataspace, memdataspace; hsize_t dims[1], maxdims[1]; herr_t error; boxdataset = H5Dopen(handle.group_ID, "boxes"); if(boxdataset < 0) return boxdataset; boxdataspace = H5Dget_space(boxdataset); if(boxdataspace < 0) return boxdataspace; H5Sget_simple_extent_dims(boxdataspace, dims, maxdims); memdataspace = H5Screate_simple(1, dims, NULL); *length = dims[0]; *boxes = malloc(dims[0]*sizeof(box)); if(handle.dim == 2) { error = H5Dread(boxdataset, box2d_id, memdataspace, boxdataspace, H5P_DEFAULT, *boxes); } else if (handle.dim == 3) { error = H5Dread(boxdataset, box3d_id, memdataspace, boxdataspace, H5P_DEFAULT, *boxes); } H5Dclose(boxdataset); H5Sclose(boxdataspace); H5Sclose(memdataspace); return 0; } int writeBoxes(box* boxes, int length, HDF5Handle handle) { herr_t ret; hssize_t offset[1]; hsize_t flatdims[1], count[1]; hid_t boxdataspace, boxdataset, memdataspace; int i; count[0] = 1; flatdims[0] = length; boxdataspace = H5Screate_simple(1, flatdims, NULL); memdataspace = H5Screate_simple(1, count, NULL); if(handle.dim == 2) { boxdataset = H5Dcreate(handle.group_ID, "boxes", box2d_id, boxdataspace, H5P_DEFAULT); if(boxdataset < 0) return boxdataset; for(i=0; idata = malloc(dims[0]*sizeof(float)); fa2d->box = (boxes[0]).b2; error = H5Dread(dataset, H5T_NATIVE_FLOAT, memdataspace, dataspace, H5P_DEFAULT, fa2d->data); for(i=1; idata = malloc(dims[0]*sizeof(double)); da2d->box = (boxes[0]).b2; error = H5Dread(dataset, H5T_NATIVE_DOUBLE, memdataspace, dataspace, H5P_DEFAULT, da2d->data); for(i=1; idata = malloc(dims[0]*sizeof(float)); fa3d->box = (boxes[0]).b3; error = H5Dread(dataset, H5T_NATIVE_FLOAT, memdataspace, dataspace, H5P_DEFAULT, fa3d->data); for(i=1; idata = malloc(dims[0]*sizeof(double)); da3d->box = (boxes[0]).b3; error = H5Dread(dataset, H5T_NATIVE_DOUBLE, memdataspace, dataspace, H5P_DEFAULT, da3d->data); for(i=1; iname, H5Ttype, \ aid, H5P_DEFAULT); \ if(attr < 0) \ { \ H5Adelete(handle.group_ID, at->name); \ attr = H5Acreate(handle.group_ID, at->name, H5Ttype, \ aid, H5P_DEFAULT); \ if(attr < 0) \ { \ return -1; \ } \ } \ H5Eset_auto(efunc, edata); \ ret = H5Awrite(attr, H5Ttype, at->data); \ if(ret < 0) return ret; \ H5Sclose(aid); \ H5Aclose(attr); \ at = (Attribute *)at->next; \ } \ atr = attrib->accessByType[INTEGER]; INSERT(int, atr, H5T_NATIVE_INT); atr = attrib->accessByType[FLOAT]; INSERT(float, atr, H5T_NATIVE_FLOAT); atr = attrib->accessByType[DOUBLE]; INSERT(double, atr, H5T_NATIVE_DOUBLE); atr = attrib->accessByType[INTVECT2D]; INSERT(intvect2d, atr, intvect2d_id); atr = attrib->accessByType[INTVECT3D]; INSERT(intvect3d, atr, intvect3d_id); atr = attrib->accessByType[BOX2D]; INSERT(box2d, atr, box2d_id); atr = attrib->accessByType[BOX3D]; INSERT(box3d, atr, box3d_id); /* string is different, of course */ at = attrib->accessByType[CHAR]; while(at != NULL) { aid = H5Screate(H5S_SCALAR); s_type = H5Tcopy(H5T_C_S1); H5Tset_size(s_type, strlen((char*)at->data)); /*extra requirement for strings*/ H5Eset_auto(NULL, NULL); attr = H5Acreate(handle.group_ID, at->name, s_type, aid, H5P_DEFAULT); if(attr < 0) { H5Adelete(handle.group_ID, at->name); attr = H5Acreate(handle.group_ID, at->name, s_type, aid, H5P_DEFAULT); if(attr < 0) { return -1; } } H5Eset_auto(efunc, edata); ret = H5Awrite(attr, s_type, at->data); if(ret < 0) return ret; H5Sclose(aid); H5Aclose(attr); H5Tclose(s_type); at = (Attribute *)at->next; } return 0; } void calcOffsets(hsize_t* offsets, FAB_CHOMBO* FABArray, int comps, int length, int dim, ChPrecision precision ) { int i; offsets[0] = 0; if(dim == 2) { if(precision == Float) { for(i=1; i<=length; ++i) { box2d* box = &(FABArray[i-1].f2.box); offsets[i] = offsets[i-1] + numPnts2(box)*comps; } } else { for(i=1; i<=length; ++i) { box2d* box = &(FABArray[i-1].d2.box); offsets[i] = offsets[i-1] + numPnts2(box)*comps; } } } else /* dim == 3 */ { if(precision == Float) { for(i=1; i<=length; ++i) { box3d* box = &(FABArray[i-1].f3.box); offsets[i] = offsets[i-1] + numPnts3(box)*comps; } } else { for(i=1; i<=length; ++i) { box3d* box = &(FABArray[i-1].d3.box); offsets[i] = offsets[i-1] + numPnts3(box)*comps; } } } } int writeData(FAB_CHOMBO* FABArray, int comps, int length, HDF5Handle handle) { hsize_t* FABoffsets; hsize_t flatdims[1]; herr_t err; hsize_t count[1]; hssize_t offset[1]; int i; hid_t attributeGroup, compattr, aid; hid_t dataspace, dataset, memdataspace, datatype; if(handle.precision == Float) datatype = H5T_NATIVE_FLOAT; else datatype = H5T_NATIVE_DOUBLE; FABoffsets = (hsize_t*)malloc((length+1)*sizeof(hsize_t)); calcOffsets(FABoffsets, FABArray, comps, length, handle.dim, handle.precision); attributeGroup = H5Gcreate(handle.group_ID, "data_attributes", 0); aid = H5Screate(H5S_SCALAR); compattr = H5Acreate(attributeGroup, "comps", H5T_NATIVE_INT, aid, H5P_DEFAULT); err = H5Awrite(compattr, H5T_NATIVE_INT, &comps); H5Gclose(attributeGroup); H5Sclose(aid); H5Aclose(compattr); flatdims[0] = FABoffsets[length]; dataspace = H5Screate_simple(1, flatdims, NULL); dataset = H5Dcreate(handle.group_ID, "data:datatype=0", datatype, dataspace, H5P_DEFAULT); for(i=0 ; inext) if (strcmp(at->name, "num_levels") == 0) num_levels = *((int*)(at->data)); freeHDF5attributes(&attr); length = (int*)malloc(sizeof(int) * num_levels); sprintf(tempo, "level_0"); HandlesetGroup(&handle, tempo); error = readHDF5attributes(&attr, handle); for(at=attr.accessByType[DOUBLE];at != NULL;at=(Attribute*)at->next) if (strcmp(at->name, "dx") == 0) dx = *((double*)(at->data)); for(at=attr.accessByType[FLOAT];at != NULL;at=(Attribute*)at->next) if (strcmp(at->name, "dx") == 0) dx = *((float*)(at->data)); /* Now we need to get the bbox for all grids on Lev 0 */ if(ndims == 2){ for(at=attr.accessByType[BOX2D];at != NULL;at=(Attribute*)at->next) if (strcmp(at->name, "prob_domain") == 0) domain.b2 = *((box2d*)(at->data)); /* Now copy into extents and multiply by dx. Set Z extents to 0 */ minext[0]=(double)(domain.b2.lo.i); minext[1]=(double)(domain.b2.lo.j); minext[2]=0.0; maxext[0]=(double)(domain.b2.hi.i)+1; maxext[1]=(double)(domain.b2.hi.j)+1; maxext[2]=0.0; } else { for(at=attr.accessByType[BOX3D];at != NULL;at=(Attribute*)at->next) if (strcmp(at->name, "prob_domain") == 0) domain.b3 = *((box3d*)(at->data)); /* so now lets copy this into the extents and multiply by dx */ minext[0]=(double)(domain.b3.lo.i); minext[1]=(double)(domain.b3.lo.j); minext[2]=(double)(domain.b3.lo.k); maxext[0]=(double)(domain.b3.hi.i)+1; maxext[1]=(double)(domain.b3.hi.j)+1; maxext[2]=(double)(domain.b3.hi.k)+1; } for(i=0;i<3;i++){ minext[i]*=dx; maxext[i]*=dx; } freeHDF5attributes(&attr); error = Handleclose(handle); if(error != 0) return -20; else return 0; } int readAMRHierarchy(const char* filename, int* dim, ChPrecision* precision, int* num_levels, FAB_CHOMBO*** levels, int** length, int* numComps, char*** compNames, box* domain, int* iteration, double* dx, double* dt, double* time, int** refinementRatios) { int error; int i; box* boxes; HDF5Handle handle; HDF5attributes attr; Attribute *at; char tempo[10]; int found_num_levels; initializeHDF5datatypes(); error = Handleopen(&handle, filename, H5F_ACC_RDONLY); if (error != 0) { return(-1); } *dim = handle.dim; *precision = handle.precision; error = readHDF5attributes(&attr, handle); if (error != 0) { return -2; } found_num_levels = 0; *iteration = -1; *numComps = -1; at = attr.accessByType[INTEGER]; while (at != NULL) { if (strcmp(at->name, "num_levels") == 0) { *num_levels = *((int*)(at->data)); found_num_levels = 1; } if (strcmp(at->name, "iteration") == 0) { *iteration = *((int*)(at->data)); } if (strcmp(at->name, "num_components") == 0) { *numComps = *((int*)(at->data)); } at = (Attribute *)at->next; } *time = -1; at = attr.accessByType[DOUBLE]; while (at != NULL) { if (strcmp(at->name, "time") == 0) { *time = *((double*)(at->data)); } at = (Attribute *)at->next; } at = attr.accessByType[FLOAT]; while (at != NULL) { if (strcmp(at->name, "time") == 0) { *time = *((float*)(at->data)); } at = (Attribute *)at->next; } if (found_num_levels == 0) { return -3; } if (*numComps == -1) { return -4; } if (*num_levels <= 0) { return -5; } if (*numComps <= 0) { return -6; } *levels = (FAB_CHOMBO**)malloc(*num_levels * sizeof(FAB_CHOMBO*)); *compNames = (char**)malloc(*numComps * sizeof(char*)); *length = (int*)malloc(sizeof(int) * *num_levels); *refinementRatios = (int*)malloc(sizeof(int) * *num_levels); for (i = 0; i < *numComps; i++) { (*compNames)[i] = NULL; } at = attr.accessByType[CHAR]; while (at != NULL) { if (strncmp(at->name, "component_", 10) == 0) { sscanf(at->name+10,"%d",&i); (*compNames)[i] = malloc(strlen((const char*)(at->data))+1); strcpy((*compNames)[i], (const char*)(at->data)); } at = (Attribute *)at->next; } for (i = 0; i < *numComps; i++) { if ( (*compNames)[i] == NULL) { return -7; } } freeHDF5attributes(&attr); for(i=0; i<*num_levels; ++i) { sprintf(tempo, "level_%i",i); HandlesetGroup(&handle, tempo); error = readHDF5attributes(&attr, handle); if(i == 0){ *dx = -1; *dt = -1; at = attr.accessByType[DOUBLE]; while (at != NULL) { if (strcmp(at->name, "dx") == 0) { *dx = *((double*)(at->data)); } if (strcmp(at->name, "dt") == 0) { *dt = *((double*)(at->data)); } at = (Attribute *)at->next; } at = attr.accessByType[FLOAT]; while (at != NULL) { if (strcmp(at->name, "dx") == 0) { *dx = *((float*)(at->data)); } if (strcmp(at->name, "dt") == 0) { *dt = *((float*)(at->data)); } at = (Attribute *)at->next; } if(handle.dim == 2) { at = attr.accessByType[BOX2D]; while (at != NULL) { if (strcmp(at->name, "prob_domain") == 0) { (*domain).b2 = *((box2d*)(at->data)); } at = (Attribute *)at->next; } } else { at = attr.accessByType[BOX3D]; while (at != NULL) { if (strcmp(at->name, "prob_domain") == 0) { (*domain).b3 = *((box3d*)(at->data)); } at = (Attribute *)at->next; } } } (*refinementRatios)[i] = -1; at = attr.accessByType[INTEGER]; while (at != NULL) { if (strcmp(at->name, "ref_ratio") == 0) { (*refinementRatios)[i] = *((int*)(at->data)); } at = (Attribute *)at->next; } error = readBoxes(&boxes, &((*length)[i]), handle); if(error != 0) { return -8; } error = readData(&((*levels)[i]), boxes, (*length)[i], handle); if(error != 0) { return -100+error; } free(boxes); freeHDF5attributes(&attr); } error = Handleclose(handle); if(error != 0) return -20; return 0; } int cut(const box3d* box, int dir, int index) { switch(dir){ case 0: return (box->lo.i <= index && index <= box->hi.i); case 1: return (box->lo.j <= index && index <= box->hi.j); case 2: return (box->lo.k <= index && index <= box->hi.k); } return (1 == 0); } box2d* crossSection(const box3d* box, int dir, box2d* box2) { switch(dir){ case 0: box2->lo.i = box->lo.j; box2->hi.i = box->hi.j; box2->lo.j = box->lo.k; box2->hi.j = box->hi.k; break; case 1: box2->lo.i = box->lo.i; box2->hi.i = box->hi.i; box2->lo.j = box->lo.k; box2->hi.j = box->hi.k; break; case 2: box2->lo.i = box->lo.i; box2->hi.i = box->hi.i; box2->lo.j = box->lo.j; box2->hi.j = box->hi.j; break; default: return 0; /* that should trip the code up */ } return box2; } void fillSlice(ChPrecision precision, FAB_CHOMBO* fab3d_gen, int ncomp, int dir, int plane, FAB_CHOMBO* fab2d_gen) { int c,i,j,k, newIndex, index; int size[3]; int num[3]; int start[3]; box3d* box3 = &(fab3d_gen->f3.box); float* f2 = fab2d_gen->f2.data; float* f3 = fab3d_gen->f3.data; double* d2 = fab2d_gen->d2.data; double* d3 = fab3d_gen->d3.data; size[2] = box3->hi.k - box3->lo.k +1; size[1] = box3->hi.j - box3->lo.j +1; size[0] = box3->hi.i - box3->lo.i +1; switch(dir){ case 0: start[0] = plane - box3->lo.i; start[1] = 0; start[2] = 0; num[0] = 1; num[1] = size[1]; num[2] = size[2]; break; case 1: start[0] = 0; start[1] = plane - box3->lo.j; start[2] = 0; num[0] = size[0]; num[1] = 1; num[2] = size[2]; break; case 2: start[0] = 0; start[1] = 0; start[2] = plane - box3->lo.k; num[0] = size[0]; num[1] = size[1]; num[2] = 1; break; } for(c=0; c ((&(domain3d.b3.hi.i))[coordinateNormal]+1)*dx) { for(l=0; lb2)); for(l=0; lf3.box), coordinateNormal, index)){ output2Dlengths[l]++; dataArraySize += numPnts2(crossSection(&(fab3d->f3.box), coordinateNormal, &tmp)); } } d/=refinementRatios[l]; output[l] = (FAB_CHOMBO*)malloc((output2Dlengths[l]+1)*sizeof(FAB_CHOMBO)); if(precision == Float) output[l][0].f2.data = (float*)malloc(ncomp*dataArraySize*sizeof(float)); else if (precision == Double) output[l][0].d2.data = (double*)malloc(ncomp*dataArraySize*sizeof(double)); } d=dx; for(l=0; lf3.box), coordinateNormal, index)){ numpoints = numPnts2(crossSection(&(fab3d->f3.box), coordinateNormal, &(fab2d->f2.box))); if(precision == Float) fab2d[1].f2.data = fab2d[0].f2.data + numpoints*ncomp; else if(precision == Double) fab2d[1].d2.data = fab2d[0].d2.data + numpoints*ncomp; fillSlice(precision, fab3d, ncomp, coordinateNormal, index, fab2d); fab2d++; } } d/=refinementRatios[l]; } return 0; } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveMatLab.cpp0000644000175000017500000002066011634153073023364 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrDeriveMatLab.cpp,v 1.13 2002/04/26 22:40:00 car Exp $ // // Write's `.mat' files for MatLab -- one per component. // #include #include #include #include #include #include #include #include #include #include #include #include #include #include // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif std::list plot_vars; static bool isPlotVar (const std::string& name) { for (std::list::const_iterator li = plot_vars.begin(); li != plot_vars.end(); ++li) { if (*li == name) return true; } return false; } static void PrintUsage (char* progName) { cout << "\nUsage:\n" << progName << "\n\tinfile = inputFileName" << "\n\tplot_vars = list of plot variables (none specified --> ALL)" << "\n\t[-help]" << "\n\n"; exit(1); } // // Special MatLab value specifying float or double. // #ifdef BL_USE_DOUBLE const int RealType = 0; #else const int RealType = 10; #endif // // Special MatLab value specifying byte order. // static int ByteOrder () { const int BigEndian = 1000; const int SmallEndian = 0; union { long Long; char Char[sizeof(long)]; } SwapTest; SwapTest.Long = 1; return SwapTest.Char[0] == 1 ? SmallEndian : BigEndian; } static void WriteFab (ostream& os, const FArrayBox& fab, const char* name) { int nx = fab.box().length(0); int ny = fab.box().length(1); int dim = BL_SPACEDIM; #if (BL_SPACEDIM == 2) for (int i = 0; i < nx; i++) for (int j = 0; j < ny; j++) { int index = j*nx + i; const Real * ptr = fab.dataPtr(); os.write((char*)(ptr+index),sizeof(Real)); } #elif (BL_SPACEDIM == 3) int nz = fab.box().length(2); os.write((char*)&nz,sizeof(int)); for (int k = 0; k < nz; k++) for (int i = 0; i < nx; i++) for (int j = 0; j < ny; j++) { int index = k*(nx*ny) + j*nx + i; const Real * ptr = fab.dataPtr(); os.write((char*)(ptr+index),sizeof(Real)); } #endif } static void WriteLoc (ostream& os, Real* lo, Real* hi) { Real buf[2*BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; i++) { buf[i] = lo[i]; buf[i+BL_SPACEDIM] = hi[i]; } for (int i = 0; i < 2*BL_SPACEDIM; i++) os.write((char*)&(buf[i]),sizeof(Real)); } static void Write (AmrData& amrData, const std::string& iFile_name, const std::list plot_vars) { int finest_level = amrData.FinestLevel(); VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); char buf[128]; for (int icomp = 0; icomp < amrData.NComp(); icomp++) { // // Write one component per file. // const std::string& CompName = amrData.PlotVarNames()[icomp]; if (isPlotVar(CompName)) { std::string file = iFile_name; file += '_'; file += CompName; file += ".mat"; std::ofstream os; os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); os.open(file.c_str(), ios::out|ios::binary); if (os.fail()) BoxLib::FileOpenFailed(file); int dim = BL_SPACEDIM; os.write((char*)&dim,sizeof(int)); int num_levels = finest_level+1; os.write((char*)&num_levels,sizeof(int)); // Write the number of grids at each level for (int iLevel = 0; iLevel <= finest_level; ++iLevel) { MultiFab& mf = amrData.GetGrids(iLevel,icomp); const BoxArray& ba = mf.boxArray(); int num_grids = ba.size(); os.write((char*)&num_grids,sizeof(int)); } // Write the (Real) physical locations of each grid at each level for (int iLevel = 0; iLevel <= finest_level; ++iLevel) { MultiFab& mf = amrData.GetGrids(iLevel,icomp); const BoxArray& ba = mf.boxArray(); int num_grids = ba.size(); for (int i = 0; i < num_grids; ++i) { for (int idim = 0; idim < BL_SPACEDIM; ++idim) { Real xlo = amrData.GridLocLo()[iLevel][i][idim]; Real xhi = amrData.GridLocHi()[iLevel][i][idim]; os.write((char*)&xlo,sizeof(Real)); os.write((char*)&xhi,sizeof(Real)); } } } // Write the (integer) dimensions of each grid at each level for (int iLevel = 0; iLevel <= finest_level; ++iLevel) { MultiFab& mf = amrData.GetGrids(iLevel,icomp); const BoxArray& ba = mf.boxArray(); int num_grids = ba.size(); for (int i = 0; i < num_grids; ++i) { for (int idim = 0; idim < BL_SPACEDIM; ++idim) { int n = ba[i].length()[idim]; os.write((char*)&n,sizeof(int)); } } } // Write the (Real) actual data of each grid at each level for (int iLevel = 0; iLevel <= finest_level; ++iLevel) { MultiFab& mf = amrData.GetGrids(iLevel,icomp); const BoxArray& ba = mf.boxArray(); int num_grids = ba.size(); for (int ig = 0; ig < num_grids; ++ig) { sprintf(buf, "%s_%d_%d", CompName.c_str(), iLevel, ig); WriteFab(os, mf[ig], buf); } } os.close(); if (os.fail()) BoxLib::FileOpenFailed(file); } } } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc == 1) PrintUsage(argv[0]); if (ParallelDescriptor::NProcs() > 1) BoxLib::Error("This is an inherently serial program"); ParmParse pp; if (pp.contains("help")) PrintUsage(argv[0]); // // MatLab expects native floating-point format. // FArrayBox::setFormat(FABio::FAB_NATIVE); // // Scan the arguments. // std::string iFile; pp.query("infile", iFile); if (iFile.empty()) BoxLib::Abort("You must specify `infile'"); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(iFile, fileType); if (!dataServices.AmrDataOk()) { // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); } AmrData& amrData = dataServices.AmrDataRef(); std::string plot_var; pp.query("plot_vars", plot_var); int npv = pp.countval("plot_vars"); if (npv == 0) { for (int i = 0; i < amrData.PlotVarNames().size(); i++) { plot_vars.push_back(amrData.PlotVarNames()[i]); } } else { for (int i = 0; i < npv; i++) { pp.get("plot_vars", plot_var, i); plot_vars.push_back(plot_var); } } Write(amrData, iFile, plot_vars); BoxLib::Finalize(); } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveIntScalLen.cpp0000644000175000017500000001607411634153073024224 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ //BL_COPYRIGHT_NOTICE #include #include #include #include #include #include #include #include #include #include #include #ifndef WIN32 #include #endif #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "FArrayBox.H" #include "Utility.H" #include "AmrDeriveIntScalLen_F.H" static void print_usage (int, char* argv[]) { std::cerr << "usage:\n"; std::cerr << argv[0] << " infile [options] \n\tOptions:\n"; exit(1); } static std::string fileID(const std::string& str) { const int len = str.size(); std::string result = str; int i = 1; while (isdigit(str[len-i])) result = str.substr(len-i++); return result; } void main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc < 2) print_usage(argc,argv); ParmParse pp; if (pp.contains("help")) print_usage(argc,argv); if (pp.contains("verbose")) AmrData::SetVerbose(true); std::string infile; pp.get("file",infile); std::cout << "Reading " << infile << "..."; DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(infile, fileType); std::cout << "done" << std::endl; if (!dataServices.AmrDataOk()) DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); int finestLevel = amrData.FinestLevel(); Box box(amrData.ProbDomain()[finestLevel]); int dir = 2; //Box piece = box.chop(dir,box.length()[dir]*3/4); Array plotnames = amrData.PlotVarNames(); FArrayBox vFab(box,BL_SPACEDIM); BoxArray ba(1); ba.set(0,box); MultiFab TMP(ba,1,0); const Array& dx = amrData.DxLevel()[finestLevel]; char tmpStr[10]; sprintf(tmpStr,"%-4.4g",amrData.Time()); std::string zoneID = fileID(infile) + " (t=" + tmpStr + ")"; #if 1 std::cout << "Loading v into fab..."; vFab.setVal(0.0); int idV = -1; for (int i=0; i corr(corrSize); Array TSL_z(box.length()[2]); FArrayBox ug(Box(box).growHi(0,box.length()[0]),1); cout << "gbox = " << ug.box() << endl; const int nComp = vFab.nComp(); FORT_SCALLEN(vFab.dataPtr(),ARLIM(vFab.loVect()),ARLIM(vFab.hiVect()), nComp, dx.dataPtr(), box.loVect(), box.hiVect(), TSL_z.dataPtr(), corr.dataPtr(), corr.size(), ug.dataPtr(),ARLIM(ug.loVect()),ARLIM(ug.hiVect())); Array TKE_z(box.length()[2]); FORT_TKE(vFab.dataPtr(),ARLIM(vFab.loVect()),ARLIM(vFab.hiVect()), nComp, dx.dataPtr(), box.loVect(), box.hiVect(), TKE_z.dataPtr()); Array TI_z(box.length()[2]); FORT_TI(vFab.dataPtr(),ARLIM(vFab.loVect()),ARLIM(vFab.hiVect()), nComp, dx.dataPtr(), box.loVect(), box.hiVect(), TI_z.dataPtr()); Array GradUSqrd_z(box.length()[2]-2); FORT_GUS(vFab.dataPtr(),ARLIM(vFab.loVect()),ARLIM(vFab.hiVect()), nComp, dx.dataPtr(), box.loVect(), box.hiVect(), GradUSqrd_z.dataPtr()); // Dump TSL data to Tecplot file std::ofstream tlsos(std::string(infile+std::string("_TSL.dat")).c_str()); tlsos << "VARIABLES = \"Z\", \"TSL\"" << std::endl; tlsos << "ZONE T=\""<< zoneID << "\" I=" << box.length()[2] << " F=POINT" << std::endl; for (int k=box.smallEnd()[2]; k<=box.bigEnd()[2]; ++k) tlsos << (k+0.5)*dx[2] << " " << TSL_z[k-box.smallEnd()[2]] << std::endl; tlsos.close(); // Dump TKE data to Tecplot file std::ofstream tkeos(std::string(infile+std::string("_TKE.dat")).c_str()); tkeos << "VARIABLES = \"Z\", \"TKE\"" << std::endl; tkeos << "ZONE T=\""<< zoneID << "\" I=" << box.length()[2] << " F=POINT" << std::endl; for (int k=box.smallEnd()[2]; k<=box.bigEnd()[2]; ++k) tkeos << (k+0.5)*dx[2] << " " << TKE_z[k-box.smallEnd()[2]] << std::endl; tkeos.close(); // Dump GUS data to Tecplot file std::ofstream gusos(std::string(infile+std::string("_GUS.dat")).c_str()); gusos << "VARIABLES = \"Z\", \"GUS\"" << std::endl; gusos << "ZONE T=\""<< zoneID << "\" I=" << GradUSqrd_z.size() << " F=POINT" << std::endl; for (int k=0; k<=GradUSqrd_z.size(); ++k) gusos << (k+1.5)*dx[2] << " " << GradUSqrd_z[k] << std::endl; gusos.close(); #else vFab.setVal(-1.0); int idT = -1; for (int i=0; i Tavg_z(box.length()[2]); FORT_TAVG(vFab.dataPtr(),ARLIM(vFab.loVect()),ARLIM(vFab.hiVect()), nComp, dx.dataPtr(), box.loVect(), box.hiVect(), Tavg_z.dataPtr()); // Dump TAVG data to Tecplot file std::ofstream tavgos(std::string(infile+std::string("_TAVG.dat")).c_str()); tavgos << "VARIABLES = \"Z\", \"TAVG\"" << std::endl; tavgos << "ZONE T=\""<< zoneID << "\" I=" << box.length()[2] << " F=POINT" << std::endl; for (int k=box.smallEnd()[2]; k<=box.bigEnd()[2]; ++k) tavgos << (k+0.5)*dx[2] << " " << Tavg_z[k-box.smallEnd()[2]] << std::endl; tavgos.close(); #endif BoxLib::Finalize(); } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveYAvg.cpp0000644000175000017500000001300211634153073023062 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrDeriveYAvg.cpp,v 1.3 2003/02/04 18:07:18 marc Exp $ // #include #include #include using std::cout; using std::endl; #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" #include "ArrayLim.H" // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #if defined(BL_FORT_USE_UPPERCASE) # define AVGPLANE AVGPLANE #elif defined(BL_FORT_USE_LOWERCASE) # define AVGPLANE avgplane #elif defined(BL_FORT_USE_UNDERSCORE) # define AVGPLANE avgplane_ #endif extern "C" { void AVGPLANE(Real* v, ARLIM_P(vlo), ARLIM_P(vhi), Real* a, ARLIM_P(alo), ARLIM_P(ahi), const int* jlo, const int* jhi); }; static void PrintUsage (const char* progName) { cout << '\n'; cout << "Usage:" << '\n'; cout << progName << '\n'; cout << " infiles = inputFileList" << '\n'; cout << " [help=<0,1>]" << '\n'; cout << " [bsize=]" << '\n'; cout << " [-verbose]" << '\n'; cout << '\n'; exit(1); } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc == 1) PrintUsage(argv[0]); ParmParse pp; if (pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Scan the arguments. // bool verbose = false; if (pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(true); } const int nfile = pp.countval("infiles"); if (nfile<=0) BoxLib::Abort("You must specify `infiles'"); std::vector infiles(nfile); pp.queryarr("infiles",infiles); int bsize=5; pp.query("bsize",bsize); Real yrange=.015; pp.query("yrange",yrange); DataServices::SetBatchMode(); FileType fileType(NEWPLT); const int nComp = 1; Array names(nComp); names[0] = "temp"; DataServices* dataServices0 = new DataServices(infiles[0], fileType); AmrData& amrData0 = dataServices0->AmrDataRef(); const int finestLevel = amrData0.FinestLevel(); const Array& dx = amrData0.DxLevel()[finestLevel]; const Box box = amrData0.ProbDomain()[finestLevel]; const int jmid = int(0.5*(box.hiVect()[1]-box.loVect()[1]+1) - 1); cout << "jmid:" << jmid << endl; const int jhi = jmid + int(yrange/dx[1]); const int jlo = jmid - int(yrange/dx[1]); IntVect ivlo = box.smallEnd(); ivlo[1] = jmid; IntVect ivhi = box.bigEnd(); ivhi[1] = jmid; Box avgBox(ivlo,ivhi); FArrayBox pData(box,nComp); FArrayBox avgData(avgBox,1); FArrayBox tmp(box,1); FArrayBox tmpAvg(avgBox,1); delete dataServices0; cout << "Averaging data over j indices: " << jlo << ", " << jhi << endl; avgData.setVal(0.0); for (int ifile=0; ifile $b; } %SUM = (); $N = 0; TRAJ; while (<>) { if (/^[0-9]+:$/) { substr($_,-2) = ""; $N = $_; } else { ($a,$b,$c) = split(' ', $_); if ($a <= $xhi && $ylo <= $b && $b <= $yhi) { $SUM{$N}++; } } } foreach $key (sort numerically keys %SUM) { print $key, "\n"; } ccseapps-2.5/CCSEApps/pAmrDerive/Pal80000644000175000017500000000200011634153073020434 0ustar amckinstryamckinstry  !"#$%&'()*++,-./0123456789:;<=>?@ABCDEFFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdfghijklmnopqrstuvw|‡Œ‘–› ¦«°µºÀÅÊÏÔÚÙ×ÖÖÖÖÕÕÕÕÕÔÔÔÔÔÓÓÓÓÓÏÌÉÆÃÀ¼¹¶³°­ª¦£ š—”Ї„}zwtqnkgda^[XUQNKHEB>;852/,(%"  $-6?HNT[agmsy†Œ’˜ž¤« !"$%'(*+-.0134679:<=?@BCEFHJKMNPQSTVWYZ\]_`bceghjkmnpqstvwy{|~‚„…‡ˆŠ‹’“•–˜™›œž ¡£¤¦§©ª¬®¯±²´µ·¸º¼½¿ÁÃÅÇÉËÍÏÑÓÕ×ÚÜÞàâåèåäääãããâââáááàààßßßßÛØÕÑÎËÇÄÁ½º·³°­©¦£Ÿœ™•’‹ˆ…~{wtqmjgc`]YVSOLIEB?;851.+'$!  "$&(*,./13579;=>@BDFHJLNOQSUWY[]^`bdfhjlmoqsuwy{|~€‚„†ˆŠŒ‘“•—™›œž ¢¤¦¨ª«­¯±³µ·¹º¼¾ÀÂÄÆÈÊËÍÏÑÓÕ×ÙÚÜÞàâäæèéëíïñóõ÷ùùùùúúúûûûüüüýýýþþþÿòæååääããââááààßßÞÞÝÝÝÙÖÓÏÌÉÅ¿¼¸µ²®«¨¤¡ž›—”‘Їƒ€}zvsplifb_\YUROKHEA>;841.*'$    ##%)*+++,,---..///0011122233444556667788899:::;;<<<===>>???@@AAABBCCCDDEEEFFFGGHHHIIJJJKKLLLMMNNNOOPPPQQQRRSSSTTUUUVVWWWXXYYYZZZ[[\\\]]^^^__```aabbbccdccseapps-2.5/CCSEApps/pAmrDerive/no-quenching.dat0000644000175000017500000000334211634153073023004 0ustar amckinstryamckinstry***************************************************************************************************************** * Quenching parameters for NO A (v = 0) state following harpoon model * * Ref.: * P. H. Paul, J. A. Gray, J. L. Durant Jr., and J. W. Thoman Jr., * "A Model for Temperature-Dependent Collisional Quenching of NO * A(sup)2 Sigma(sup)+," Appl. Phys. B B57, pp. 249-259, 1993. * * P. H. Paul, C. D. Carter, J. A. Gray, J. L. Durant Jr., * J. W. Thoman, and M. R. Furlanetto, "Correlations for the NO * A(sup)2 Sigma(sup)+ (v'=0) Electronic Quencing Cross-section," * Sandia Report SAND94-8237 UC-1423, Sandia National Laboratory, * Livermore, CA (January, 1995). * * File format: '*' starts a comment line. Values may be separated by one or multiple CR, TAB, or SPACE * This file to be read for LIF simulation. (c) Wolfgang G. Bessler 2001 ***************************************************************************************************************** * number of colliders 25 * follwing now are the name, class, and 5 coefficients of the colliders. * the name must be identical with the name given in the species file for proper identification! * class c0 c1 c2 c3 c4 N2 2 0 0.88 4.9 48.0 32.0 * best fit to exp. data O2 4 25.1 0 0 0 0 CO2 3 54.2 0.95 3.24 0.18 0 CO 2 5.9 5.3 7.0 22.1 14.0 H2O 3 28.2 3.39 0.15 2.95 0 CH4 1 0 0 0 0 0 C2H6 1 0 0 0 0 0 C3H8 1 0 0 0 0 0 C2H4 6 5.0 7.1 1.07 0.72 0 C2H2 6 28.0 0.81 13.1 14.85 0 NO 4 43.0 0 0 0 0 NO2 5 82.0 9.0 0.54 0 0 N2O 3 59.0 0.99 3.98 0.16 0 NH3 6 50.7 0.91 10.74 6.5 0 NH 4 58.0 0 0 0 0 H2 1 0 0 0 0 0 O 4 32.0 0 0 0 0 H 4 12.0 0 0 0 0 OH 4 82.0 0 0 0 0 CH 4 101.0 0 0 0 0 He 1 0 0 0 0 0 Ne 1 0 0 0 0 0 Ar 1 0 0 0 0 0 Kr 1 0 0 0 0 0 Xe 1 0 0 0 0 0 ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveSumRho.cpp0000644000175000017500000001167411634153073023446 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // This is a version of AmrDerive.cpp that calculates the sum of // densities for each z value. // #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" static void PrintUsage (char* progName) { cout << "\nUsage:\n" << progName << "\n\tinfile" << "\n\n"; exit(1); } int main (int argc, char* argv[]) { // // Make sure to catch new failures. // set_new_handler(BoxLib::OutOfMemory); if (argc == 1) PrintUsage(argv[0]); ParallelDescriptor::StartParallel(&argc, &argv); if(ParallelDescriptor::NProcs() > 1) { cerr << "Error: serial only right now." << endl; BoxLib::Abort(); } Real sumVal, firstVal, prevVal; FArrayBox::setFormat(FABio::FAB_IEEE_32); for(int iCDer(0); iCDer < 2; ++iCDer) { std::string currentDerived; if(iCDer == 0) { currentDerived = "density"; } else { currentDerived = "tracer"; } for(int iPlt(1); iPlt < argc; ++iPlt) { std::string iFile(argv[iPlt]); cout << "Summing " << currentDerived << " for " << iFile << endl; DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(iFile, fileType); if ( ! dataServices.AmrDataOk()) { // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); } AmrData &amrData = dataServices.AmrDataRef(); int finestFillLevel(0); // just do level zero Box bProbDomainZero(amrData.ProbDomain()[0]); BoxArray baZSlabs(bProbDomainZero.length(ZDIR)); for(int iSlab(0); iSlab < baZSlabs.size(); ++iSlab) { Box bTempSlab(bProbDomainZero); bTempSlab.setSmall(ZDIR, iSlab); bTempSlab.setBig(ZDIR, iSlab); baZSlabs.set(iSlab, bTempSlab); } MultiFab mfSumRho(baZSlabs, 1, 0); amrData.FillVar(mfSumRho, finestFillLevel, currentDerived); FArrayBox fabCheck(bProbDomainZero); amrData.FillVar(&fabCheck, fabCheck.box(), 0, currentDerived, 0); Array rSumRho(baZSlabs.size(), 0.0); Real dx(amrData.DxLevel()[finestFillLevel][XDIR]); Real dy(amrData.DxLevel()[finestFillLevel][YDIR]); for(int iSlab(0); iSlab < rSumRho.size(); ++iSlab) { rSumRho[iSlab] = mfSumRho[iSlab].sum(0) * dx * dy; } if (ParallelDescriptor::IOProcessor()) { Real sumCheck(0.0); std::string aSumFile(iFile); aSumFile += ".sum"; aSumFile += currentDerived; ofstream outfile(aSumFile.c_str()); outfile << endl << "# " << aSumFile << endl; for(int iSlab(rSumRho.size() - 1); iSlab >= 0; --iSlab) { outfile << (iSlab + 0.5) << " " << (rSumRho[iSlab] / 10.0) << endl; sumCheck += rSumRho[iSlab]; } sumVal = fabCheck.sum(0); if(iPlt == 1) { firstVal = sumVal; prevVal = sumVal; } outfile.precision(12); outfile << "# " << "sumCheck = " << sumCheck << endl; outfile << "# " << "fabCheck * dxdy = " << sumVal * dx * dy << endl; outfile << "# " << "fabCheck.sum = " << sumVal << endl; outfile << "# " << "fabCheck.delta0 = " << sumVal - firstVal << endl; outfile << "# " << "fabCheck.deltaP = " << sumVal - prevVal << endl << endl; prevVal = sumVal; outfile.close(); } } // end for(iPlt...) } // end for(iCDer...) DataServices::Dispatch(DataServices::ExitRequest, NULL); } ccseapps-2.5/CCSEApps/pAmrDerive/striptraj.pl0000644000175000017500000000070011634153073022271 0ustar amckinstryamckinstry#!/usr/local/gnu/bin/perl # # Layout of trajectory events: # # N: # x1 y1 t1 # x2 y2 t2 # ... # TRAJ; $basename = "traj."; while (<>) { if (/^[0-9]+:$/) { substr($_,-2) = ""; $file = $basename . $_; print "Opening ", $file, " ... \n"; open TRAJ, ">$file" || die "Couldn't open() $file"; } else { ($a,$b,$c) = split(' ', $_); print TRAJ $a, " ", $b, "\n"; } } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveTurbfile.cpp0000644000175000017500000000770211634153073024002 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ //BL_COPYRIGHT_NOTICE #include #include #include #include #include #include #include #include #include #include #include #ifndef WIN32 #include #endif #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "FArrayBox.H" #include "Utility.H" #include "ArrayLim.H" #if defined(BL_FORT_USE_UPPERCASE) # define WRITEVEL WRITEVEL #elif defined(BL_FORT_USE_LOWERCASE) # define WRITEVEL writevel #elif defined(BL_FORT_USE_UNDERSCORE) # define WRITEVEL writevel_ #endif extern "C" { void WRITEVEL(const Real* dat, ARLIM_P(lo),ARLIM_P(hi), const int* lo, const int* hi, const Real* probsize); }; static void print_usage (int, char* argv[]) { std::cerr << "usage:\n"; std::cerr << argv[0] << " infile=\n"; exit(1); } void main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc < 2) print_usage(argc,argv); ParmParse pp; if (pp.contains("help")) print_usage(argc,argv); if (pp.contains("verbose")) AmrData::SetVerbose(true); std::string infile; pp.get("infile",infile); std::cout << "Reading " << infile << "..."; DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(infile, fileType); std::cout << "done" << std::endl; if (!dataServices.AmrDataOk()) DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); int finestLevel = amrData.FinestLevel(); Box box(amrData.ProbDomain()[finestLevel]); Array plotnames = amrData.PlotVarNames(); FArrayBox vFab(box,BL_SPACEDIM); BoxArray ba(1); ba.set(0,box); MultiFab TMP(ba,1,0); const Array& dx = amrData.DxLevel()[finestLevel]; std::cout << "Loading v into fab..."; int idV = -1; for (int i=0; i .dspDepends $(DspFileRoot).dsp: .dspDepends @(echo Building DSP file = $(DspFileRoot).dsp;\ $(TOP)/scripts/dsp.mak -p $(DspFileRoot) -t $(TOP) -d $(DIM) -o $(DspFileRoot).dsp -O $(DspOlevel) -f $^) include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/pAmrDerive/vpramps.dat0000644000175000017500000000013611634153073022077 0ustar amckinstryamckinstry1 2 5 0 42 140 220 255 0.0 0.0 0.5 0.8 1.0 4 0 4 128 255 0.0 0.6 0.8 1.0 0.10 0.90 ccseapps-2.5/CCSEApps/pAmrDerive/xtra_F.H0000644000175000017500000000367011634153073021257 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ /* ** $Id: xtra_F.H,v 1.1 2002/05/24 20:48:10 lijewski Exp $ */ #include #include #ifdef BL_LANG_FORT # define FORT_PUSHVTOG pushvtog #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_PUSHVTOG PUSHVTOG # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_PUSHVTOG pushvtog # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_PUSHVTOG pushvtog_ # endif // // Use ARLIM in the following. // extern "C" { void FORT_PUSHVTOG(const int* lo, const int* hi, const int* dlo, const int* dhi, Real* U, ARLIM_P(Ulo), ARLIM_P(Uho), const int* nc); } #endif ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveCK.cpp0000644000175000017500000013714211634153073022525 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #include #ifndef WIN32 #include #endif #include "Tuple.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "FArrayBox.H" #include "Utility.H" #include "xtra_F.H" #include "ChemKinDriver.H" #include "Geometry.H" // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif static void print_usage (int, char* argv[]) { std::cerr << "usage:\n"; std::cerr << argv[0] << " file=pltfile\n"; exit(1); } class IVLess { public: bool operator () (const IntVect& lhs, const IntVect& rhs) const { return lhs.lexLT(rhs); } }; static void ClonePlotfile (AmrData& amrData, PArray& mfout, std::string& oFile, const Array& names) { // return; // // Sink up grow cells under valid region. // for (int i = 0; i < mfout.size(); i++) mfout[i].FillBoundary(); if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(oFile,0755)) BoxLib::CreateDirectoryFailed(oFile); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string oFileHeader(oFile); oFileHeader += "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream os; os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); os.open(oFileHeader.c_str(), std::ios::out|std::ios::binary); if (os.fail()) BoxLib::FileOpenFailed(oFileHeader); // // Start writing plotfile. // os << amrData.PlotFileVersion() << '\n'; int n_var = mfout[0].nComp(); os << n_var << '\n'; for (int n = 0; n < n_var; n++) os << names[n] << '\n'; os << BL_SPACEDIM << '\n'; os << amrData.Time() << '\n'; const int finestLevel = mfout.size() - 1; os << finestLevel << '\n'; for (int i = 0; i < BL_SPACEDIM; i++) os << amrData.ProbLo()[i] << ' '; os << '\n'; for (int i = 0; i < BL_SPACEDIM; i++) os << amrData.ProbHi()[i] << ' '; os << '\n'; for (int i = 0; i < finestLevel; i++) os << amrData.RefRatio()[i] << ' '; os << '\n'; for (int i = 0; i <= finestLevel; i++) os << amrData.ProbDomain()[i] << ' '; os << '\n'; for (int i = 0; i <= finestLevel; i++) os << 0 << ' '; os << '\n'; for (int i = 0; i <= finestLevel; i++) { for (int k = 0; k < BL_SPACEDIM; k++) os << amrData.DxLevel()[i][k] << ' '; os << '\n'; } os << amrData.CoordSys() << '\n'; os << "0\n"; // The bndry data width. // // Write out level by level. // for (int iLevel = 0; iLevel <= finestLevel; ++iLevel) { // // Write state data. // int nGrids = amrData.boxArray(iLevel).size(); char buf[64]; sprintf(buf, "Level_%d", iLevel); if (ParallelDescriptor::IOProcessor()) { os << iLevel << ' ' << nGrids << ' ' << amrData.Time() << '\n'; os << 0 << '\n'; for (int i = 0; i < nGrids; ++i) { for (int n = 0; n < BL_SPACEDIM; n++) { os << amrData.GridLocLo()[iLevel][i][n] << ' ' << amrData.GridLocHi()[iLevel][i][n] << '\n'; } } // // Build the directory to hold the MultiFabs at this level. // std::string Level(oFile); Level += '/'; Level += buf; if (!BoxLib::UtilCreateDirectory(Level, 0755)) BoxLib::CreateDirectoryFailed(Level); } // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); // // Now build the full relative pathname of the MultiFab. // static const std::string MultiFabBaseName("/MultiFab"); std::string PathName(oFile); PathName += '/'; PathName += buf; PathName += MultiFabBaseName; if (ParallelDescriptor::IOProcessor()) { // // The full name relative to the Header file. // std::string RelativePathName(buf); RelativePathName += MultiFabBaseName; os << RelativePathName << '\n'; } // // Write out ghost cells as is ... // VisMF::Write(mfout[iLevel], PathName, VisMF::OneFilePerCPU, false); } os.close(); } static vector Tokenize (const std::string& instr, const std::string& separators) { vector ptr; // // Make copy of line that we can modify. // char* line = new char[instr.size()+1]; (void) strcpy(line, instr.c_str()); char* token = 0; if (!((token = strtok(line, separators.c_str())) == 0)) { ptr.push_back(token); while (!((token = strtok(0, separators.c_str())) == 0)) ptr.push_back(token); } vector tokens(ptr.size()); for (int i = 1; i < ptr.size(); i++) { char* p = ptr[i]; while (strchr(separators.c_str(), *(p-1)) != 0) *--p = 0; } for (int i = 0; i < ptr.size(); i++) tokens[i] = ptr[i]; delete line; return tokens; } static std::string GetFileRoot(const std::string& infile) { vector tokens = Tokenize(infile,std::string("/")); return tokens[tokens.size()-1]; } static void Twiddle (PArray& conc) { std::cout << "Twiddling concentration ... " << std::endl; static Real epsilon = 1.0e-10; // static Real epsilon = 0; for (int ispec = 0; ispec < conc[0].nComp(); ispec++) { Real c_floor = 0; for (int lev = 0; lev < conc.size(); lev++) { for (MFIter mfi(conc[lev]); mfi.isValid(); ++mfi) { const Box& vb = mfi.validbox(); c_floor = std::max(c_floor,conc[lev][mfi].max(vb,ispec)*epsilon); } } if (ParallelDescriptor::IOProcessor()) { std::cout << "c_floor(" << ispec << "): " << c_floor << std::endl; } for (int lev = 0; lev < conc.size(); lev++) { for (MFIter mfi(conc[lev]); mfi.isValid(); ++mfi) { const long N = conc[lev][mfi].box().numPts(); Real* data = conc[lev][mfi].dataPtr(ispec); for (long i = 0; i < N; i++) { data[i] = std::max(data[i],c_floor); } } } } std::cout << "Done twiddling concentration. " << std::endl; } static void WriteTecPlotFile (AmrData& amrData, int Nspec, const Array& chemnames, const PArray& u, const PArray& mole, const PArray& dfd, const PArray& ydot, const PArray& temp, const PArray& Q, const PArray& dens) { const int Y = 0; const int FL = amrData.FinestLevel(); BL_ASSERT(FL == 1); BL_ASSERT(amrData.boxArray(FL).size() == 1); const Box& bx = amrData.boxArray(FL)[0]; const int N = bx.length(0); Array t(N,0); const Real DX = amrData.DxLevel()[FL][0]; for (int j = 3; j < N-1; j++) { const IntVect ivj(j,Y), ivjm1(j-1,Y); t[j] = t[j-1] + 2*DX/(u[FL][0](ivj,Y)+u[FL][0](ivjm1,Y)); } Array sum(Nspec,0); for (int j = 0; j < Nspec; j++) sum[j] = mole[FL][0](IntVect(2,Y),j); for (int j = 2; j < N-2; j++) { IntVect ivj(j,Y), ivjp1(j+1,Y); const Real divj = dens[FL][0](ivj); const Real divjp1 = dens[FL][0](ivjp1); for (int k = 0; k < Nspec; k++) { Real tl = (dfd[FL][0](ivj,k) /divj +ydot[FL][0](ivj,k)); Real tr = (dfd[FL][0](ivjp1,k)/divjp1+ydot[FL][0](ivjp1,k)); sum[k] += (t[j+1]-t[j])*(tl+tr)/2; } } std::cout << std::endl << std::endl; for (int i = 0; i < Nspec; i++) { const Real diff = mole[FL][0](IntVect(N-2,Y),i) - sum[i]; std::cout << "diff(" << chemnames[i] << "): " << diff << std::endl; } std::cout << std::endl << std::endl; // const int idx = 10; // index of CH4 // // Write out TecPlot header. // std::string ofile("output.tec"); std::cout << "Writing TecPlot output to " << ofile << std::endl; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream os; os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); os.open(ofile.c_str(), std::ios::out); if (os.fail()) BoxLib::FileOpenFailed(ofile); os << "VARIABLES=\"T\",\"Temp\",\"DTDt\",\"Q\",\"Lambda\""; for (int idx = 0; idx < Nspec; idx++) { char num[64]; sprintf(num, "%d", idx); os << ",\"Y" << num << "\"" << ",\"DYDT" << num << "\"" << ",\"Diff" << num << "\"" << ",\"React" << num << "\"" << ",\"Sum" << num << "\""; } os << std::endl; os << "ZONE I=" << (N-4) << " F=POINT" << std::endl; for (int j = 2; j < N-2; j++) { const IntVect ivj(j,Y), ivjp1(j+1,Y); const Real DTDt = (temp[FL][0](ivjp1)-temp[FL][0](ivj))/(t[j+1]-t[j]); os << t[j] << ' ' << temp[FL][0](ivjp1) << ' ' << DTDt << ' ' << Q[FL][0](ivjp1) << ' ' << dfd[FL][0](ivjp1,Nspec) << ' '; for (int idx = 0; idx < Nspec; idx++) { const Real divj = dens[FL][0](ivj); const Real divjp1 = dens[FL][0](ivjp1); Real a = (mole[FL][0](ivjp1,idx)-mole[FL][0](ivj,idx))/(t[j+1]-t[j]); Real b = .5*(dfd[FL][0](ivjp1,idx)/divjp1 + dfd[FL][0](ivj,idx)/divj); Real c = .5*(ydot[FL][0](ivjp1,idx) + ydot[FL][0](ivj,idx)); // Real d = .5*(mole[FL][0](ivjp1,idx) - mole[FL][0](ivj,idx)) * // (u[FL][0](ivjp1,0)+u[FL][0](ivj,0))/DX; os << mole[FL][0](ivjp1,idx) << ' ' << a << ' ' << b << ' ' << c << ' ' << (b+c) << ' '; } os << std::endl; } } // // Position in space. // typedef Tuple X; // // Holds the level info for an X. // struct Info { Info (int lev, int idx, const IntVect& iv) : m_lev(lev), m_idx(idx), m_iv(iv) {} int m_lev; int m_idx; IntVect m_iv; }; // // Stuff we set from the AmrData object for March(). // static int finest_level; static Array ref_ratio; static Array prob_lo; static Array prob_hi; static Array prob_domain; static Array boxArray; static Array< Array > dx; static Array< Array > dxinv; inline IntVect Index (const X& x, int lev) { IntVect iv; const IntVect& lo = prob_domain[lev].smallEnd(); D_TERM(iv[0]=int((x[0]-lo[0])*dxinv[lev][0]);, iv[1]=int((x[1]-lo[1])*dxinv[lev][1]);, iv[2]=int((x[2]-lo[2])*dxinv[lev][2]);); iv += lo; return iv; } static bool Where (const X& x, int& lev, int& idx, IntVect& iv) { for (lev = finest_level; lev >= 0; lev--) { iv = Index(x,lev); const BoxArray& ba = boxArray[lev]; for (idx = 0; idx < ba.size(); idx++) if (ba[idx].contains(iv)) return true; } return false; } static void DoIt (X& x, Real dt, std::vector& path, std::vector& info, const PArray& u) { std::cout << "Starting point: " << x[0] << ' ' << x[1] << std::endl; for (;;) { int lev, levS; // Our level in the amrData hierarchy. int idx, idxS; // The index into the BoxArray at that level. IntVect iv, ivS; // The IntVect into relevant FAB at that level. X xk = path.back(), xS; if (!Where(xk,lev,idx,iv)) { path.pop_back(); break; } info.push_back(Info(lev,idx,iv)); for (int i = 0; i < BL_SPACEDIM; i++) xS[i]=xk[i]+u[lev][idx](iv,i)*dt; if (!Where(xS,levS,idxS,ivS)) break; for (int i = 0; i < BL_SPACEDIM; i++) x[i]=xk[i]+0.5*(u[lev][idx](iv,i)+u[levS][idxS](ivS,i))*dt; path.push_back(x); } } static void WriteBilinearData (const X& pos, const std::vector& path, const std::vector& info, const PArray& y, const PArray& temp, const PArray& rho, Real dt) { std::cout << "path.size() = " << path.size() << std::endl; const int Nspec = y[0].nComp(); char buf[64]; sprintf(buf, "out.x=%g,y=%g.raw.bl", pos[0], pos[1]); std::ofstream ofs; std::cout << "Writing Bilinear data to \"" << buf << "\"" << std::endl; ofs.open(buf,std::ios::out|std::ios::trunc); if (ofs.fail()) BoxLib::FileOpenFailed(buf); ofs << "VARIABLES=\"T\",\"Temp\",\"Rho\",\"X\",\"Y\""; for (int idx = 0; idx < Nspec; idx++) { char num[64]; sprintf(num, "%d", idx); ofs << ",\"Y" << num << "\""; } ofs << std::endl; ofs << "ZONE I=" << path.size() << " F=POINT" << std::endl; for (int i = 0; i < path.size(); i++) { int lev = info[i].m_lev; int idx = info[i].m_idx; IntVect iv = info[i].m_iv; IntVect z00 = iv; Real xnorm = path[i][0]*dxinv[lev][0] - (iv[0]+.5); Real ynorm = path[i][1]*dxinv[lev][1] - (iv[1]+.5); if (path[i][0] >= (iv[0]+.5)*dx[lev][0]) { if (path[i][1] < (iv[1]+.5)*dx[lev][1]) { ynorm += 1; z00[1] -= 1; } } else { xnorm += 1; z00[0] -= 1; if (path[i][1] < (iv[1]+.5)*dx[lev][1]) { ynorm += 1; z00[1] -= 1; } } BL_ASSERT(xnorm >= 0 && xnorm <= 1); BL_ASSERT(ynorm >= 0 && ynorm <= 1); IntVect z01(z00[0], z00[1]+1); IntVect z10(z00[0]+1,z00[1]); IntVect z11(z00[0]+1,z00[1]+1); const FArrayBox& yfab = y[lev][idx]; const FArrayBox& rfab = rho[lev][idx]; const FArrayBox& tfab = temp[lev][idx]; const Real T = (1-xnorm)*(1-ynorm)*tfab(z00) + (1-xnorm)*ynorm*tfab(z01) + xnorm*(1-ynorm)*tfab(z10) + xnorm*ynorm*tfab(z11); const Real R = (1-xnorm)*(1-ynorm)*rfab(z00) + (1-xnorm)*ynorm*rfab(z01) + xnorm*(1-ynorm)*rfab(z10) + xnorm*ynorm*rfab(z11); ofs << (dt*i) << ' ' << T << ' ' << R << ' ' << path[i][0] << ' ' << path[i][1] << ' '; for (int j = 0; j < Nspec; j++) { const Real Y = (1-xnorm)*(1-ynorm)*yfab(z00,j) + (1-xnorm)*ynorm*yfab(z01,j) + xnorm*(1-ynorm)*yfab(z10,j) + xnorm*ynorm*yfab(z11,j); ofs << Y << ' '; } ofs << '\n'; } } static void WriteRawData (const X& pos, const std::vector& path, const std::vector& info, const PArray& y, const PArray& temp, const PArray& ydot, const PArray& dfd, Real dt) { std::cout << "path.size() = " << path.size() << std::endl; const int Nspec = y[0].nComp(); Array ybar(Nspec,0); Array ydotbar(Nspec,0); Array ydifbar(Nspec,0); char buf[64]; sprintf(buf, "out.x=%g,y=%g.raw.tec", pos[0], pos[1]); std::ofstream ofs; std::cout << "Writing TecPlot raw data to \"" << buf << "\"" << std::endl; ofs.open(buf,std::ios::out|std::ios::trunc); if (ofs.fail()) BoxLib::FileOpenFailed(buf); ofs << "VARIABLES=\"T\",\"Temp\",\"X\",\"Y\""; for (int idx = 0; idx < Nspec; idx++) { char num[64]; sprintf(num, "%d", idx); ofs << ",\"Y" << num << "\"" << ",\"Ybar" << num << "\"" << ",\"Ybar-Y" << num << "\""; } ofs << std::endl; ofs << "ZONE I=" << path.size() << " F=POINT" << std::endl; for (int i = 0; i < path.size(); i++) { int lev = info[i].m_lev, levm1; int idx = info[i].m_idx, idxm1; IntVect iv = info[i].m_iv, ivm1; if (i > 0) { levm1 = info[i-1].m_lev; idxm1 = info[i-1].m_idx; ivm1 = info[i-1].m_iv; } ofs << (dt*i) << ' ' << temp[lev][idx](iv) << ' ' << path[i][0] << ' ' << path[i][1] << ' '; for (int j = 0; j < Nspec; j++) { if (i == 0) { ybar[j] = y[lev][idx](iv,j); ydotbar[j] = 0; ydifbar[j] = 0; } else { ybar[j] += 0.5*dt*(ydot[lev][idx](iv,j) + ydot[levm1][idxm1](ivm1,j) + dfd[lev][idx](iv,j) + dfd[levm1][idxm1](ivm1,j)); ydotbar[j] += 0.5*dt*(ydot[lev][idx](iv,j) + ydot[levm1][idxm1](ivm1,j)); ydifbar[j] += 0.5*dt*(dfd[lev][idx](iv,j) + dfd[levm1][idxm1](ivm1,j)); } ofs << y[lev][idx](iv,j) << ' ' << ybar[j] << ' ' << (ybar[j]-y[lev][idx](iv,j)) << ' '; } ofs << '\n'; if (i == path.size()-1) { for (int j = 0; j < Nspec; j++) { std::cout << j << ' ' << y[lev][idx](iv,j) << ' ' << ybar[j] << ' ' << ydotbar[j] << ' ' << ydifbar[j] << std::endl; } } } } static void WriteProcData (const X& pos, const std::vector& path, const std::vector& info, const PArray& y, const PArray& temp, const PArray& ydot, const PArray& dfd, const PArray& q, Real dt) { std::cout << "path.size() = " << path.size() << std::endl; char buf[64]; sprintf(buf, "out.x=%g,y=%g.proc.tec", pos[0], pos[1]); std::ofstream ofs; std::cout << "Writing TecPlot processed data to \"" << buf << "\"" << std::endl; ofs.open(buf,std::ios::out|std::ios::trunc); if (ofs.fail()) BoxLib::FileOpenFailed(buf); ofs << "VARIABLES=\"T\",\"DT\",\"DQ\",\"DLambda\""; const int Nspec = y[0].nComp(); BL_ASSERT(dfd[0].nComp() == Nspec+1); for (int idx = 0; idx < Nspec; idx++) { char num[64]; sprintf(num, "%d", idx); ofs << ",\"DY" << num << "\"" << ",\"DYdot" << num << "\"" << ",\"Ddfd" << num << "\""; } ofs << '\n'; ofs << "ZONE I=" << (path.size()-1) << " F=POINT" << std::endl; for (int i = 1; i < path.size(); i++) { int lev = info[i].m_lev, levm1 = info[i-1].m_lev; int idx = info[i].m_idx, idxm1 = info[i-1].m_idx; IntVect iv = info[i].m_iv, ivm1 = info[i-1].m_iv; ofs << (dt*(2*i-1)/2) << ' ' << ((temp[lev][idx](iv)-temp[levm1][idxm1](ivm1))/dt) << ' ' << ((q[lev][idx](iv)+q[levm1][idxm1](ivm1))/2) << ' ' << ((dfd[lev][idx](iv,Nspec)+dfd[levm1][idxm1](ivm1,Nspec))/2) << ' '; for (int j = 0; j < Nspec; j++) { ofs << ((y[lev][idx](iv,j)-y[levm1][idxm1](ivm1,j))/dt) << ' ' << ((ydot[lev][idx](iv,j)+ydot[levm1][idxm1](ivm1,j))/2) << ' ' << ((dfd[lev][idx](iv,j)+dfd[levm1][idxm1](ivm1,j))/2) << ' '; } ofs << '\n'; } } static void March (AmrData& amrData, const std::vector& pos, const PArray& u, const PArray& y, const PArray& dfd, const PArray& ydot, const PArray& temp, const PArray& q, const PArray& rho) { // // Figure out largest timestep we can reliably use. // // const Real cfl = 1.0; const Real cfl = 0.5; Real dt = std::numeric_limits::max(); for (int i = 0; i <= finest_level; i++) for (int j = 0; j < BL_SPACEDIM; j++) dt = std::min(dt,cfl*dx[i][j]/u[i].max(j)); std::cout << "Marching using dt = " << dt << std::endl; for (int idx = 0; idx < pos.size(); idx++) { X x; std::vector path; std::vector info; D_TERM(x[0]=pos[idx][0];, x[1]=pos[idx][1];, x[2]=pos[idx][2];); path.push_back(x); DoIt(x,dt,path,info,u); BL_ASSERT(path.size() == info.size()); WriteBilinearData(pos[idx],path,info,y,temp,rho,dt); WriteRawData(pos[idx],path,info,y,temp,ydot,dfd,dt); WriteProcData(pos[idx],path,info,y,temp,ydot,dfd,q,dt); } } static void WriteMF (const MultiFab* mf, const char* file) { std::string FullPath = file; if (!FullPath.empty() && FullPath[FullPath.length()-1] != '/') FullPath += '/'; if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) BoxLib::CreateDirectoryFailed(FullPath); ParallelDescriptor::Barrier(); static const std::string MultiFabBaseName("MultiFab"); FullPath += MultiFabBaseName; VisMF::Write(*mf,FullPath,VisMF::OneFilePerCPU); } static void WriteOutAsMFs (const char* name, const PArray& y) { return; for (int l = 0; l < y.size(); l++) { const int NGrow = y[l].nGrow(); BoxList bl; for (int i = 0; i < y[l].boxArray().size(); i++) bl.push_back(BoxLib::grow(y[l].boxArray()[i],NGrow)); BoxArray nba(bl); MultiFab ynew(nba,y[l].nComp(),0); for (MFIter mfi(ynew); mfi.isValid(); ++mfi) ynew[mfi].copy(y[l][mfi],y[l][mfi].box()); char buf[64]; sprintf(buf, "%s.lev=%d.mfab", name, l); WriteMF(&ynew,buf); } } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); const int MyProc = ParallelDescriptor::MyProc(); if (argc < 2) print_usage(argc,argv); ParmParse pp; if (pp.contains("help")) print_usage(argc,argv); std::string infile; pp.get("file",infile); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(infile, fileType); if (!dataServices.AmrDataOk()) // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); int Nlev = amrData.FinestLevel() + 1; std::string chemInFile = "grimech30.dat"; std::string chemOutFile = "grimech30.out"; std::string thermInFile = "thermo30.dat"; std::string tranInFile = "transport30.dat"; // std::string chemInFile = "drm19_noAR.dat"; // std::string chemOutFile = "drm19_noAR.out"; // std::string thermInFile = "thermo12.dat"; // std::string tranInFile = "transport12.dat"; ChemKinDriver ckd(chemInFile,chemOutFile,thermInFile,tranInFile); const Array chemnames = ckd.speciesNames(); const Real Patm = 1.0; Array plotnames = amrData.PlotVarNames(); int idT = -1; int idX = -1; int idU = -1; int idR = -1; for (int i = 0; i < plotnames.size(); ++i) { if (plotnames[i] == "temp") idT = i; if (plotnames[i] == "X(" + chemnames[0] + ")" ) idX = i; if (plotnames[i] == "x_velocity") idU = i; if (plotnames[i] == "density") idR = i; } std::string trElt = "C"; // std::string trElt = "N"; vector trSp; vector trRxn; bool use_all_species = true; for (int i = 0; i < chemnames.size(); i++) if (use_all_species || ckd.numberOfElementXinSpeciesY(trElt,chemnames[i]) > 0) trSp.push_back(chemnames[i]); Array< std::pair > speccoef; for (int i = 0; i < ckd.numReactions(); i++) { if (use_all_species) { trRxn.push_back(i); } else { std::map net; speccoef = ckd.specCoeffsInReactions(i); for (int j = 0; j < speccoef.size(); j++) { const int co = speccoef[j].second; const std::string& sp = speccoef[j].first; if (std::count(trSp.begin(),trSp.end(),sp) > 0) { if (net.find(sp) == net.end()) { net[sp] = co; } else { net[sp] += co; if (net[sp] == 0) net.erase(sp); } } } if (!net.empty()) trRxn.push_back(i); } } const int Nspec = trSp.size(); const int Nreac = trRxn.size(); std::cout << "Nspec = " << Nspec << std::endl; std::cout << "Nreac = " << Nreac << std::endl; for (int i = 0; i < trSp.size(); i++) std::cout << i << ": " << chemnames[ckd.index(trSp[i])] << std::endl; PArray temp(Nlev,PArrayManage); PArray mole(Nlev,PArrayManage); PArray conc(Nlev,PArrayManage); PArray dens(Nlev,PArrayManage); Array rxnIDs(Nreac); for (int i = 0; i < Nreac; i++) rxnIDs[i] = trRxn[i]; FArrayBox tmpfab; for (int lev = 0; lev < Nlev; ++lev) { temp.set(lev,new MultiFab(amrData.boxArray(lev),1,1)); mole.set(lev,new MultiFab(amrData.boxArray(lev),ckd.numSpecies(),1)); dens.set(lev,new MultiFab(amrData.boxArray(lev),1,1)); std::cout << "Reading mole, temp & density data at lev=" << lev << " ... " << std::flush; temp[lev].copy(amrData.GetGrids(lev,idT),0,0,1); amrData.FlushGrids(idT); dens[lev].copy(amrData.GetGrids(lev,idR),0,0,1); amrData.FlushGrids(idR); for (int j = 0; j < ckd.numSpecies(); ++j) { mole[lev].copy(amrData.GetGrids(lev,idX+j),0,j,1); amrData.FlushGrids(idX+j); } for (MFIter mfi(mole[lev]); mfi.isValid(); ++mfi) { const Box& box = mfi.validbox(); int ncompM = mole[lev].nComp(); int ncompTnD = temp[lev].nComp(); FORT_PUSHVTOG(box.loVect(),box.hiVect(), box.loVect(), box.hiVect(), temp[lev][mfi].dataPtr(), ARLIM(temp[lev][mfi].loVect()), ARLIM(temp[lev][mfi].hiVect()),&ncompTnD); FORT_PUSHVTOG(box.loVect(),box.hiVect(), box.loVect(), box.hiVect(), dens[lev][mfi].dataPtr(), ARLIM(dens[lev][mfi].loVect()), ARLIM(dens[lev][mfi].hiVect()),&ncompTnD); FORT_PUSHVTOG(box.loVect(),box.hiVect(), box.loVect(), box.hiVect(), mole[lev][mfi].dataPtr(), ARLIM(mole[lev][mfi].loVect()), ARLIM(mole[lev][mfi].hiVect()),&ncompM); } temp[lev].FillBoundary(); dens[lev].FillBoundary(); mole[lev].FillBoundary(); #if 0 // // TODO -- ask Marc why this is needed? // const BoxArray& ba = amrData.boxArray(lev); std::vector< PArray > auxg(ba.size()); for (int i=0; i rf(Nlev,PArrayManage); PArray rr(Nlev,PArrayManage); for (int lev = 0; lev < Nlev; ++lev) { std::cout << "Building Rf & Rr lev=" << lev << " ... " << std::flush; rf.set(lev,new MultiFab(amrData.boxArray(lev),Nreac,0)); rr.set(lev,new MultiFab(amrData.boxArray(lev),Nreac,0)); for (MFIter mfi(mole[lev]); mfi.isValid(); ++mfi) { FArrayBox& f = rf[lev][mfi]; FArrayBox& r = rr[lev][mfi]; FArrayBox& t = temp[lev][mfi]; FArrayBox& x = mole[lev][mfi]; Box bx = t.box() & amrData.ProbDomain()[lev]; ckd.fwdRevReacRatesGivenXTP(f,r,rxnIDs,x,t,Patm,bx,0,0,0,0); ckd.moleFracToMassFrac(x,x,bx,0,0); ckd.normalizeMassFrac(x,x,"N2",bx,0,0); // // mole now contains mass fractions!!! // } std::cout << "done" << std::endl; } std::string nfile_conc(GetFileRoot(infile)+"_conc"); Array nnames_conc(Nspec); for (int j = 0; j < Nspec; ++j) nnames_conc[j] = "C(" + chemnames[ckd.index(trSp[j])] + ")"; std::cout << "Writing Concentration to " << nfile_conc << std::endl; ClonePlotfile(amrData,conc,nfile_conc,nnames_conc); std::string nfile_temp(GetFileRoot(infile)+"_temp"); Array nnames_temp(1); nnames_temp[0] = "temp"; std::cout << "Writing Temperature to " << nfile_temp << std::endl; ClonePlotfile(amrData,temp,nfile_temp,nnames_temp); std::string nfile_mass(GetFileRoot(infile)+"_mass"); Array nnames_mass(ckd.numSpecies()); for (int j = 0; j < nnames_mass.size(); ++j) nnames_mass[j] = "Y(" + chemnames[j] + ")"; std::cout << "Writing Mass Fractions to " << nfile_mass << std::endl; ClonePlotfile(amrData,mole,nfile_mass,nnames_mass); WriteOutAsMFs("mass",mole); WriteOutAsMFs("temp",temp); std::string nfile_rf(GetFileRoot(infile)+"_rf"); std::string nfile_rr(GetFileRoot(infile)+"_rr"); Array nnames_rf(Nreac); for (int j = 0; j < Nreac; ++j) nnames_rf[j] = ckd.reactionString(trRxn[j]); std::cout << "Writing Forward Rates to " << nfile_rf << std::endl; ClonePlotfile(amrData,rf,nfile_rf,nnames_rf); std::cout << "Writing Backward Rates to " << nfile_rr << std::endl; ClonePlotfile(amrData,rr,nfile_rr,nnames_rf); // // Free up some space; don't free up temp and mole or mass. // rf.clear(); rr.clear(); conc.clear(); // // Now do velocity ... // PArray u(Nlev,PArrayManage); for (int lev = 0; lev < Nlev; ++lev) { u.set(lev,new MultiFab(amrData.boxArray(lev),BL_SPACEDIM,0)); u[lev].setVal(0); std::cout << "Reading velocity data at lev=" << lev << " ... " << std::flush; for (int j = 0; j < BL_SPACEDIM; ++j) { u[lev].copy(amrData.GetGrids(lev,idU+j),0,j,1); amrData.FlushGrids(idU+j); } std::cout << "done" << std::endl; } const char* VelName[3] = { "x_velocity", "y_velocity", "z_velocity" }; std::string nfile_u(GetFileRoot(infile)+"_u"); Array nnames_u(BL_SPACEDIM); for (int j = 0; j < BL_SPACEDIM; ++j) nnames_u[j] = VelName[j]; std::cout << "Writing Velocity to " << nfile_u << std::endl; ClonePlotfile(amrData,u,nfile_u,nnames_u); // u.clear(); // // Now do a, b, c & d ... // PArray a(Nlev,PArrayManage); PArray b(Nlev,PArrayManage); PArray c(Nlev,PArrayManage); PArray d(Nlev,PArrayManage); FArrayBox rho, rhoDr, getR, cpmix; bool is_rz = amrData.CoordSys() == CoordSys::RZ; if (is_rz) std::cout << "is_rz: true" << std::endl; for (int lev = 0; lev < Nlev; ++lev) { // // One extra space for lambda stuff after mass fractions ... // a.set(lev,new MultiFab(amrData.boxArray(lev),Nspec+1,0)); b.set(lev,new MultiFab(amrData.boxArray(lev),Nspec+1,0)); c.set(lev,new MultiFab(amrData.boxArray(lev),Nspec+1,0)); d.set(lev,new MultiFab(amrData.boxArray(lev),Nspec+1,0)); std::cout << "Building A B C & D at lev=" << lev << " ... " << std::flush; // // We have temp and mass fractions over grow cells within ProbDomain. // for (MFIter mfi(mole[lev]); mfi.isValid(); ++mfi) { Box bx = mole[lev][mfi].box() & amrData.ProbDomain()[lev]; rho.resize(bx,1); rhoDr.resize(bx,ckd.numSpecies()+1); getR.resize(bx,1); cpmix.resize(bx,1); rho.copy(dens[lev][mfi]); ckd.getCpmixGivenTY(cpmix,temp[lev][mfi],mole[lev][mfi],bx,0,0,0); ckd.getMixAveragedRhoDiff(rhoDr,mole[lev][mfi],temp[lev][mfi],Patm,bx,0,0,0); // // Stuff thermal conductivity into last component. // ckd.getMixCond(rhoDr,mole[lev][mfi],temp[lev][mfi],bx,0,0,Nspec); IntVect se = bx.smallEnd(); IntVect be = bx.bigEnd(); const Real dx = amrData.DxLevel()[lev][0]; const Real dy = amrData.DxLevel()[lev][1]; if (is_rz) { // // Set rhoDr to rhodiff*r // const Real dr = amrData.DxLevel()[lev][0]; for (int i = se[0]; i <= be[0]; i++) { IntVect sbse = IntVect(i,se[1]); IntVect sbbe = IntVect(i,be[1]); getR.setVal((i+0.5)*dr,Box(sbse,sbbe),0,1); } for (int i = 0; i < ckd.numSpecies(); i++) rhoDr.mult(getR,0,i,1); // // Set rho to rho*r*dr*dr*2 // for (int i = se[0]; i <= be[0]; i++) { IntVect sbse = IntVect(i,se[1]); IntVect sbbe = IntVect(i,be[1]); getR.setVal((i+0.5)*dr*dr*dr*2,Box(sbse,sbbe),0,1); } rho.mult(getR); } tmpfab.resize(bx,1); for (int i = 0; i < Nspec+1; i++) { tmpfab.copy(rhoDr, i==Nspec?Nspec:ckd.index(trSp[i]), 0, 1); FArrayBox& afab = a[lev][mfi]; FArrayBox& bfab = b[lev][mfi]; FArrayBox& cfab = c[lev][mfi]; FArrayBox& dfab = d[lev][mfi]; afab.copy(tmpfab,0,i,1); tmpfab.shift(0,1); afab.plus(tmpfab,0,i,1); tmpfab.shift(0,-1); afab.divide(rho,0,i,1); bfab.copy(tmpfab,0,i,1); tmpfab.shift(0,-1); bfab.plus(tmpfab,0,i,1); tmpfab.shift(0,1); bfab.divide(rho,0,i,1); cfab.copy(tmpfab,0,i,1); tmpfab.shift(1,1); cfab.plus(tmpfab,0,i,1); tmpfab.shift(1,-1); cfab.divide(rho,0,i,1); dfab.copy(tmpfab,0,i,1); tmpfab.shift(1,-1); dfab.plus(tmpfab,0,i,1); tmpfab.shift(1,1); dfab.divide(rho,0,i,1); if (!is_rz) { afab.divide(dx*dx*2,i,1); bfab.divide(dx*dx*2,i,1); cfab.divide(dy*dy*2,i,1); dfab.divide(dy*dy*2,i,1); } if (i == Nspec) { afab.divide(cpmix,0,i,1); bfab.divide(cpmix,0,i,1); cfab.divide(cpmix,0,i,1); dfab.divide(cpmix,0,i,1); } } } amrData.FlushGrids(idR); const Box& domain = amrData.ProbDomain()[lev]; a[lev].setVal(0,domain & Box(domain).shift(0,-domain.length(0)+1),0,Nspec,0); b[lev].setVal(0,domain & Box(domain).shift(0, domain.length(0)-1),0,Nspec,0); c[lev].setVal(0,domain & Box(domain).shift(1,-domain.length(1)+1),0,Nspec,0); d[lev].setVal(0,domain & Box(domain).shift(1, domain.length(1)-1),0,Nspec,0); std::cout << "done" << std::endl; } std::string nfile_rho(GetFileRoot(infile)+"_rho"); Array nnames_rho(1); nnames_rho[0] = "rho"; std::cout << "Writing Rho to " << nfile_rho << std::endl; ClonePlotfile(amrData,dens,nfile_rho,nnames_rho); std::string nfile_a(GetFileRoot(infile)+"_a"); Array nnames_a(Nspec+1); for (int j = 0; j < Nspec; ++j) nnames_a[j] = "a_" + chemnames[ckd.index(trSp[j])]; nnames_a[Nspec] = "a_lambda"; std::cout << "Writing A to " << nfile_a << std::endl; ClonePlotfile(amrData,a,nfile_a,nnames_a); std::string nfile_b(GetFileRoot(infile)+"_b"); Array nnames_b(Nspec+1); for (int j = 0; j < Nspec; ++j) nnames_b[j] = "b_" + chemnames[ckd.index(trSp[j])]; nnames_b[Nspec] = "b_lambda"; std::cout << "Writing B to " << nfile_b << std::endl; ClonePlotfile(amrData,b,nfile_b,nnames_b); std::string nfile_c(GetFileRoot(infile)+"_c"); Array nnames_c(Nspec+1); for (int j = 0; j < Nspec; ++j) nnames_c[j] = "c_" + chemnames[ckd.index(trSp[j])]; nnames_c[Nspec] = "c_lambda"; std::cout << "Writing C to " << nfile_c << std::endl; ClonePlotfile(amrData,c,nfile_c,nnames_c); std::string nfile_d(GetFileRoot(infile)+"_d"); Array nnames_d(Nspec+1); for (int j = 0; j < Nspec; ++j) nnames_d[j] = "d_" + chemnames[ckd.index(trSp[j])]; nnames_d[Nspec] = "d_lambda"; std::cout << "Writing D to " << nfile_d << std::endl; ClonePlotfile(amrData,d,nfile_d,nnames_d); PArray Q(Nlev,PArrayManage); for (int lev = 0; lev < Nlev; ++lev) { std::cout << "Building HeatRelease at lev=" << lev << " ... " << std::flush; Q.set(lev,new MultiFab(amrData.boxArray(lev),1,0)); for (MFIter mfi(Q[lev]); mfi.isValid(); ++mfi) { Box bx = Q[lev][mfi].box() & amrData.ProbDomain()[lev]; cpmix.resize(bx,1); ckd.heatRelease(Q[lev][mfi],mole[lev][mfi],temp[lev][mfi],Patm,bx,0,0,0); ckd.getCpmixGivenTY(cpmix,temp[lev][mfi],mole[lev][mfi],bx,0,0,0); Q[lev][mfi].divide(cpmix,0,0,1); Q[lev][mfi].divide(dens[lev][mfi],0,0,1); } std::cout << "done" << std::endl; } std::string nfile_q(GetFileRoot(infile)+"_q"); Array nnames_q(1); nnames_q[0] = "Q"; std::cout << "Writing HeatRelease to " << nfile_q << std::endl; ClonePlotfile(amrData,Q,nfile_q,nnames_q); PArray ydot(Nlev,PArrayManage); PArray dfd(Nlev,PArrayManage); for (int lev = 0; lev < Nlev; ++lev) { std::cout << "Building Ydot at lev=" << lev << " ... " << std::flush; ydot.set(lev,new MultiFab(amrData.boxArray(lev),Nspec,0)); dfd.set(lev,new MultiFab(amrData.boxArray(lev),Nspec+1,0)); for (MFIter mfi(ydot[lev]); mfi.isValid(); ++mfi) { Box bx = temp[lev][mfi].box() & amrData.ProbDomain()[lev]; ckd.reactionRateY(ydot[lev][mfi],mole[lev][mfi],temp[lev][mfi],Patm,bx,0,0,0); } std::cout << "done" << std::endl; } std::string nfile_ydot(GetFileRoot(infile)+"_ydot"); Array nnames_ydot(Nspec); for (int j = 0; j < Nspec; ++j) nnames_ydot[j] = "ydot_" + chemnames[ckd.index(trSp[j])]; std::cout << "Writing Ydot to " << nfile_ydot << std::endl; ClonePlotfile(amrData,ydot,nfile_ydot,nnames_ydot); for (int lev = 0; lev < Nlev; ++lev) { std::cout << "Building DiffFluxDiv at lev=" << lev << " ... " << std::flush; FArrayBox tmp, massfrac; for (MFIter mfi(dfd[lev]); mfi.isValid(); ++mfi) { massfrac.resize(mole[lev][mfi].box(),mole[lev][mfi].nComp()+1); massfrac.copy(mole[lev][mfi],0,0,mole[lev][mfi].nComp()); // // Stuff temperature into last component. // massfrac.copy(temp[lev][mfi],0,mole[lev][mfi].nComp(),1); FArrayBox& y = massfrac; FArrayBox& r = dfd[lev][mfi]; BL_ASSERT(r.nComp() == y.nComp()); y.shift(0,-1); r.copy(y); y.shift(0,1); r.minus(y); r.mult(b[lev][mfi]); tmp.resize(r.box(),r.nComp()); tmp.copy(y); y.shift(0,1); tmp.minus(y); y.shift(0,-1); tmp.mult(a[lev][mfi]); r.minus(tmp); y.shift(1,-1); tmp.copy(y); y.shift(1,1); tmp.minus(y); tmp.mult(d[lev][mfi]); r.plus(tmp); tmp.copy(y); y.shift(1,1); tmp.minus(y); y.shift(1,-1); tmp.mult(c[lev][mfi]); r.minus(tmp); } std::cout << "done" << std::endl; } std::string nfile_dfd(GetFileRoot(infile)+"_dfd"); Array nnames_dfd(Nspec+1); for (int j = 0; j < Nspec; ++j) nnames_dfd[j] = "dfd_" + chemnames[ckd.index(trSp[j])]; nnames_dfd[Nspec] = "dfd_temp"; std::cout << "Writing DiffFluxDiv to " << nfile_dfd << std::endl; ClonePlotfile(amrData,dfd,nfile_dfd,nnames_dfd); a.clear(); b.clear(); c.clear(); d.clear(); // WriteTecPlotFile(amrData,Nspec,chemnames,u,mole,dfd,ydot,temp,Q,dens); // // Set some globals needed by March(). // prob_lo = amrData.ProbLo(); prob_hi = amrData.ProbHi(); ref_ratio = amrData.RefRatio(); prob_domain = amrData.ProbDomain(); finest_level = amrData.FinestLevel(); boxArray.resize(finest_level+1); dx.resize(finest_level+1); dxinv.resize(finest_level+1); for (int l = 0; l <= finest_level; l++) { boxArray[l] = amrData.boxArray(l); dx[l] = amrData.DxLevel()[l]; dxinv[l] = amrData.DxLevel()[l]; for (int i = 0; i < BL_SPACEDIM; i++) dxinv[l][i] = 1.0/dx[l][i]; } std::vector x(1); for (int i = 0; i < x.size(); i++) { x[i][0] = .0003 * (i+1); x[i][1] = .0001; } March(amrData,x,u,mole,dfd,ydot,temp,Q,dens); BoxLib::Finalize(); } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveFlameArea_F.F0000644000175000017500000004125011634153073023707 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "ArrayLim.H" #include "CONSTANTS.H" #define SDIM 3 subroutine HACKD(d,DIMS(d),dx,domnlo) implicit none integer DIMDEC(d) REAL_T d(DIMV(d)) REAL_T dx(SDIM), domnlo(SDIM) integer i,j,k REAL_T x,y,z,r do k=ARG_L3(d),ARG_H3(d) z = (float(k)+0.5d0)*dx(3) + domnlo(3) do j=ARG_L2(d),ARG_H2(d) y = (float(j)+0.5d0)*dx(2) + domnlo(2) do i=ARG_L1(d),ARG_H1(d) x = (float(i)+0.5d0)*dx(1) + domnlo(1) r = dsqrt(x**2 + y**2 + z**2) #if 0 if (r.gt.0.03) then d(i,j,k) = 5000.d0 else d(i,j,k) = 0.d0 cnt = cnt + 1 endif #elif 1 if (x.gt.-.059999) then d(i,j,k) = 5000.d0 else d(i,j,k) = 0.d0 endif #else r = dsqrt(x**2 + y**2 + (z-.06d0)**2) if (r.gt.0.015d0) then d(i,j,k) = 5000.d0 else d(i,j,k) = 0.d0 endif #endif enddo enddo enddo end subroutine BILIN(c,DIMS(c), f, DIMS(f),r) implicit none integer r integer DIMDEC(c) integer DIMDEC(f) REAL_T c(DIMV(c)) REAL_T f(DIMV(f)) integer i,j,k,ii,jj,kk REAL_T x,y,z do k=ARG_L3(c),ARG_H3(c) do j=ARG_L2(c),ARG_H2(c) do i=ARG_L1(c),ARG_H1(c) do ii=0,r-1 do jj=0,r-1 do kk=0,r-1 f(r*i+ii,r*j+jj,r*k+kk) = c(i,j,k) enddo enddo enddo enddo enddo enddo do k=ARG_L3(c),ARG_H3(c)-1 do j=ARG_L2(c),ARG_H2(c)-1 do i=ARG_L1(c),ARG_H1(c)-1 do ii=1,r do jj=1,r do kk=1,r x = (float(ii)-0.5d0)/(float(r)) y = (float(jj)-0.5d0)/(float(r)) z = (float(kk)-0.5d0)/(float(r)) f(r*i+ii,r*j+jj,r*k+kk) = & c(i,j,k)*(1.d0-x)*(1.d0-y)*(1.d0-z) + & c(i+1,j,k)*x*(1.d0-y)*(1.d0-z) + & c(i,j+1,k)*(1.d0-x)*y*(1.d0-z) + & c(i+1,j+1,k)*x*y*(1.d0-z) + & c(i,j,k+1)*(1.d0-x)*(1.d0-y)*z + & c(i+1,j,k+1)*x*(1.d0-y)*z + & c(i,j+1,k+1)*(1.d0-x)*y*z + & c(i+1,j+1,k+1)*x*y*z enddo enddo enddo enddo enddo enddo end subroutine PROCESS(lo, hi, domlo, tf, DIMS(tf), T, DIMS(T), & listi, listj, listk, listlen, delta, area, sVal, imeth) implicit none integer lo(SDIM), hi(SDIM), domlo(SDIM) integer DIMDEC(T) integer DIMDEC(tf) REAL_T T(DIMV(T)) integer tf(DIMV(tf)) integer listi(*) integer listj(*) integer listk(*) integer listlen REAL_T delta(SDIM) REAL_T area, sVal integer imeth integer i,j,k,n,klo,ierr REAL_T Tb(2,2,2),myArea logical isOne, isZero klo = MAX(lo(3) - 1,domlo(3)) do k=klo,hi(3) do j=lo(2)-1,hi(2) do i=lo(1)-1,hi(1) if (T(i,j,k).LE.sVal) then tf(i,j,k) = 0 else tf(i,j,k) = 1 end if end do end do end do listlen = 0 do k=klo,hi(3)-1 do j=lo(2)-1,hi(2)-1 do i=lo(1)-1,hi(1)-1 isOne = (tf(i+1,j,k).eq.1) & .or.(tf(i,j+1,k).eq.1) & .or.(tf(i,j,k+1).eq.1) isZero = (tf(i+1,j,k).eq.0) & .or.(tf(i,j+1,k).eq.0) & .or.(tf(i,j,k+1).eq.0) if ( ((tf(i,j,k).eq.0).and.isOne).or. & ((tf(i,j,k).eq.1).and.isZero)) then listlen = listlen + 1 listi(listlen) = i listj(listlen) = j listk(listlen) = k end if end do end do end do area = zero do n=1,listlen i = listi(n) j = listj(n) k = listk(n) Tb(1,1,1) = T( i, j, k) Tb(2,1,1) = T(i+1, j, k) Tb(1,2,1) = T( i,j+1, k) Tb(2,2,1) = T(i+1,j+1, k) Tb(1,1,2) = T( i, j,k+1) Tb(2,1,2) = T(i+1, j,k+1) Tb(1,2,2) = T( i,j+1,k+1) Tb(2,2,2) = T(i+1,j+1,k+1) if (imeth.eq.1) then ierr = 0 call jarea(Tb,sVal,delta,myArea,ierr) if (ierr.ne.0) then print *,'something bad happened' exit endif else call temparea(Tb,sVal,delta,myArea) endif area = area + myArea end do end subroutine jarea (c, c0, h, value, code) c input: c c c is the (2x2x2) array of corner values c c0 is the desired level set c h is the (3) array of grid spacings c c output: c value is the area (0 when an error occurs) c code is the integer output code (0 means no error) implicit none integer edges integer faces integer nodes parameter (edges = 12) parameter (faces = 6) parameter (nodes = 8) double precision c0 double precision c(2, 2, 2) double precision coordinate(nodes, 3) double precision ex double precision h(3) double precision point(edges, 3) double precision temp double precision v(nodes) double precision v1 double precision v2 double precision value double precision x0 double precision x1 double precision x2 double precision y0 double precision y1 double precision y2 double precision z0 double precision z1 double precision z2 integer code integer count integer currentedge integer currentface integer cutedges integer edge integer edge2corner(edges, 2) integer edge2face(edges, 2) integer edgelist(edges) integer face2edge(faces, 4) integer i integer j integer k integer n integer n1 integer n2 integer nextedge integer nextface integer p integer points integer start logical cut(edges) data ((edge2corner(i, j), j = 1, 2), i = 1, edges) / 1 5, 6, 2 5, 7, 3 8, 7, 4 6, 8, 5 2, 4, 6 3, 4, 7 1, 3, 8 1, 2, 9 2, 6, X 1, 5, 1 3, 7, 2 4, 8 / data ((edge2face(i, j), j = 1, 2), i = 1, edges) / 1 4, 6, 2 1, 4, 3 4, 5, 4 3, 4, 5 2, 3, 6 2, 5, 7 1, 2, 8 2, 6, 9 3, 6, X 1, 6, 1 1, 5, 2 3, 5 / data ((face2edge(i, j), j = 1, 4), i = 1, faces) / 1 2, 11, 7, 10, 2 7, 6, 5, 8, 3 4, 9, 5, 12, 4 1, 4, 3, 2, 5 3, 12, 6, 11, 6 1, 10, 8, 9 / c initialize output values code = 0 value = 0 c store node values and coordinates n = 0 do i = 1, 2 do j = 1, 2 do k = 1, 2 n = n + 1 v(n) = c(i, j, k) if (i .eq. 1) then coordinate(n, 1) = 0 else coordinate(n, 1) = h(1) endif if (j .eq. 1) then coordinate(n, 2) = 0 else coordinate(n, 2) = h(2) endif if (k .eq. 1) then coordinate(n, 3) = 0 else coordinate(n, 3) = h(3) endif enddo enddo enddo c mark the cut edges and find the cut points start = 0 do edge = 1, edges n1 = edge2corner(edge, 1) n2 = edge2corner(edge, 2) v1 = v(n1) v2 = v(n2) cut(edge) = & (v1 .lt. c0 .and. c0 .lt. v2) .or. & (v2 .lt. c0 .and. c0 .lt. v1) if (cut(edge)) then start = edge do p = 1, 3 point(edge, p) = & coordinate(n1, p) * abs ((v1 - c0) / (v1 - v2)) + & coordinate(n2, p) * abs ((c0 - v2) / (v1 - v2)) enddo endif enddo c exit if there are no cut edges if (start .eq. 0) go to 99999 c make a list of cut edges by traversing the faces cutedges = 1 edgelist(cutedges) = start currentedge = start currentface = edge2face(currentedge, 1) 1100 continue count = 0 nextedge = 0 do i = 1, 4 edge = face2edge(currentface, i) if (cut(edge) .and. .not. (edge .eq. currentedge)) then count = count + 1 nextedge = edge endif enddo if (count .ne. 1) then c some face has other than 0 or 2 cut edges code = 1 go to 99999 endif if (nextedge .ne. edgelist(1)) then if (currentface .eq. edge2face(nextedge, 1)) then currentface = edge2face(nextedge, 2) else currentface = edge2face(nextedge, 1) endif currentedge = nextedge cutedges = cutedges + 1 edgelist(cutedges) = currentedge go to 1100 endif count = 0 do edge = 1, edges if (cut(edge)) then count = count + 1 endif enddo if (count .ne. cutedges) then c the traverse omits some cut edges code = 2 go to 99999 endif c sum the triangular areas edge = edgelist(1) x0 = point(edge, 1) y0 = point(edge, 2) z0 = point(edge, 3) do i = 2, cutedges - 1 edge = edgelist(i) x1 = point(edge, 1) - x0 y1 = point(edge, 2) - y0 z1 = point(edge, 3) - z0 edge = edgelist(i + 1) x2 = point(edge, 1) - x0 y2 = point(edge, 2) - y0 z2 = point(edge, 3) - z0 temp = sqrt ( abs ( & x2**2*y1**2 - 2*x1*x2*y1*y2 + x1**2*y2**2 + & x2**2*z1**2 + y2**2*z1**2 - 2*x1*x2*z1*z2 - & 2*y1*y2*z1*z2 + x1**2*z2**2 + y1**2*z2**2)) / 2 value = value + temp enddo c exit 99999 continue end subroutine temparea(T,Tlev,delta,Area) REAL_T T(2,2,2),Tlev REAL_T delta(3),Area REAL_T axp,axm,ayp,aym,azp,azm REAL_T facearea,t11,t12,t21,t22,dx,dy,dz dx = delta(1) dy = delta(2) dz = delta(3) t11 = T(1,1,1) t21 = T(2,1,1) t12 = T(1,2,1) t22 = T(2,2,1) azm = facearea(t11,t21,t12,t22,dx,dy,Tlev) t11 = T(1,1,2) t21 = T(2,1,2) t12 = T(1,2,2) t22 = T(2,2,2) azp = facearea(t11,t21,t12,t22,dx,dy,Tlev) t11 = T(1,1,1) t21 = T(1,2,1) t12 = T(1,1,2) t22 = T(1,2,2) axm = facearea(t11,t21,t12,t22,dy,dz,Tlev) t11 = T(2,1,1) t21 = T(2,2,1) t12 = T(2,1,2) t22 = T(2,2,2) axp = facearea(t11,t21,t12,t22,dy,dz,Tlev) t11 = T(1,1,1) t21 = T(2,1,1) t12 = T(1,1,2) t22 = T(2,1,2) aym = facearea(t11,t21,t12,t22,dy,dz,Tlev) t11 = T(1,2,1) t21 = T(2,2,1) t12 = T(1,2,2) t22 = T(2,2,2) ayp = facearea(t11,t21,t12,t22,dy,dz,Tlev) Area = dsqrt((azp-azm)**2+ (ayp-aym)**2 + (axp-axm)**2) return end REAL_T function facearea(t11,t21,t12,t22, 1 dx,dy,Tlev) REAL_T t11,t12,t21,t22,dx,dy,Tlev REAL_T lengless,lengmore REAL_T edge1,edge2,edge3,edge4 if(t11.gt.Tlev)then if(t21.gt.Tlev)then if(t12.gt.Tlev)then if(t22.gt.Tlev)then facearea = dx*dy else edge1=lengless(t12,t22,Tlev,dx) edge2=lengless(t21,t22,Tlev,dy) facearea = dx*dy-edge1*edge2*half endif else if(t22.gt.Tlev)then edge1=lengless(t12,t22,Tlev,dx) edge2=lengless(t11,t12,Tlev,dy) facearea = dx*dy-edge1*edge2*half else edge1=lengmore(t21,t22,Tlev,dy) edge2=lengmore(t11,t12,Tlev,dy) facearea = dx*(edge1+edge2)*half endif endif else if(t12.gt.Tlev)then if(t22.gt.Tlev)then edge1=lengless(t11,t21,Tlev,dx) edge2=lengless(t21,t22,Tlev,dy) facearea = dx*dy-edge1*edge2*half else edge1=lengmore(t11,t21,Tlev,dx) edge2=lengmore(t12,t22,Tlev,dx) facearea = dy*half*(edge1+edge2) endif else if(t22.gt.Tlev)then edge1=lengmore(t11,t21,Tlev,dx) edge2=lengmore(t21,t22,Tlev,dy) edge3=lengmore(t12,t22,Tlev,dx) edge4=lengmore(t11,t12,Tlev,dy) facearea = half*(edge1*edge4+edge2*edge3) else edge1=lengmore(t11,t21,Tlev,dx) edge2=lengmore(t11,t12,Tlev,dy) facearea = half*edge1*edge2 endif endif endif else if(t21.gt.Tlev)then if(t12.gt.Tlev)then if(t22.gt.Tlev)then edge1=lengmore(t11,t21,Tlev,dx) edge2=lengmore(t11,t12,Tlev,dy) facearea = dx*dy-half*edge1*edge2 else edge1=lengmore(t11,t21,Tlev,dx) edge2=lengmore(t21,t22,Tlev,dy) edge3=lengmore(t12,t22,Tlev,dx) edge4=lengmore(t11,t12,Tlev,dy) facearea = dx*dy-half*(edge1*edge4+edge2*edge3) endif else if(t22.gt.Tlev)then edge1=lengmore(t11,t21,Tlev,dx) edge2=lengmore(t12,t22,Tlev,dx) facearea = dy*half*(edge1+edge2) else edge1=lengmore(t11,t21,Tlev,dx) edge2=lengmore(t21,t22,Tlev,dy) facearea = half*edge1*edge2 endif endif else if(t12.gt.Tlev)then if(t22.gt.Tlev)then edge1=lengmore(t21,t22,Tlev,dy) edge2=lengmore(t11,t12,Tlev,dy) facearea = dx*(edge1+edge2)*half else edge1=lengmore(t12,t22,Tlev,dx) edge2=lengmore(t11,t12,Tlev,dy) facearea = half*edge1*edge2 endif else if(t22.gt.Tlev)then edge1=lengmore(t12,t22,Tlev,dx) edge2=lengmore(t21,t22,Tlev,dy) facearea = half*edge1*edge2 else facearea = zero endif endif endif endif return end REAL_T function lengless(t1,t2,Tlev,dx) REAL_T t1,t2,Tlev,dx if(t1.lt.Tlev)then lengless = (TLev -t1)*dx/(t2-t1) else lengless = (TLev -t2)*dx/(t1-t2) endif return end REAL_T function lengmore(t1,t2,Tlev,dx) REAL_T t1,t2,Tlev,dx if(t1.lt.Tlev)then lengmore = dx -(TLev -t1)*dx/(t2-t1) else lengmore = dx - (TLev -t2)*dx/(t1-t2) endif return end ccseapps-2.5/CCSEApps/pAmrDerive/twocolumns.pl0000644000175000017500000000023211634153073022461 0ustar amckinstryamckinstry#!/usr/local/gnu/bin/perl -w # # Layout of events: N x y spec reac time # while (<>) { ($a,$b,$c) = split(' ', $_); print $a, " ", $b, "\n"; } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDerive_Vfluct_F.F0000644000175000017500000001024711634153073023476 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "ArrayLim.H" #define SDIM 3 subroutine TRANSV(v,DIMS(v),dx,domnlo, & avVR,avVT,avVZ,avC,Nbin,DIMS(av),maxbin,bsize, & flVR,flVT,flVZ,flC) implicit none integer DIMDEC(v) integer DIMDEC(av) REAL_T v(DIMV(v),SDIM+2) REAL_T avVR(DIMV(av)) REAL_T avVT(DIMV(av)) REAL_T avVZ(DIMV(av)) REAL_T avC(DIMV(av)) REAL_T flVR(DIMV(av)) REAL_T flVT(DIMV(av)) REAL_T flVZ(DIMV(av)) REAL_T flC(DIMV(av)) integer Nbin(DIMV(av)) REAL_T dx(SDIM), domnlo(SDIM) integer i,j,k,n,bsize,maxbin,bin REAL_T x,y,vx,vy,vz,vr,vt,r,st,ct,kk kk = ARG_L3(av) do j=ARG_L2(v),ARG_H2(v) do n=0,maxbin Nbin(j,n,kk) = 0 flVR(j,n,kk) = 0.d0 flVT(j,n,kk) = 0.d0 flVZ(j,n,kk) = 0.d0 flC(j,n,kk) = 0.d0 enddo do k=ARG_L3(v),ARG_H3(v) y = (float(k)+0.5d0)*dx(3)+domnlo(3) do i=ARG_L1(v),ARG_H1(v) x = (float(i)+0.5d0)*dx(1)+domnlo(1) vx = v(i,j,k,1)*1.d-2 vy = v(i,j,k,3)*1.d-2 vz = v(i,j,k,2)*1.d-2 r = SQRT(x*x + y*y) if (r.le.2.5d0) then bin = INT(r/(bsize*dx(1))) if (r.lt.1.d-10) then print *,'PUKE! illdefined if r=0' call bl_abort(" ") else st = y / r ct = x / r vr = vx*ct + vy*st vt = vy*ct - vx*st endif else bin = -1 vr = 0.d0 vt = 0.d0 endif if (bin.gt.maxbin) call bl_abort('...maxbin not enough!') if (bin.ge.0) then flVR(j,bin,kk) = flVR(j,bin,kk) + (vr - avVR(j,bin,kk))**2 flVT(j,bin,kk) = flVT(j,bin,kk) + (vt - avVT(j,bin,kk))**2 flVZ(j,bin,kk) = flVZ(j,bin,kk) + (vz - avVZ(j,bin,kk))**2 flC(j,bin,kk) = flC(j,bin,kk) & + (v(i,j,k,5)/v(i,j,k,4) - avC(j,bin,kk))**2 Nbin(j,bin,kk) = Nbin(j,bin,kk) + 1 endif enddo enddo enddo end subroutine NORMV(flVR,flVT,flVZ,flC,Nbin,DIMS(av)) integer DIMDEC(av) REAL_T flVR(DIMV(av)) REAL_T flVT(DIMV(av)) REAL_T flVZ(DIMV(av)) REAL_T flC(DIMV(av)) integer Nbin(DIMV(av)) kk = ARG_L3(av) do i=ARG_L1(av),ARG_H1(av) do n=ARG_L2(av),ARG_H2(av) flVR(i,n,kk) = SQRT(flVR(i,n,kk)/Nbin(i,n,kk)) flVT(i,n,kk) = SQRT(flVT(i,n,kk)/Nbin(i,n,kk)) flVZ(i,n,kk) = SQRT(flVZ(i,n,kk)/Nbin(i,n,kk)) flC(i,n,kk) = SQRT(flC(i,n,kk)/Nbin(i,n,kk)) enddo enddo end ccseapps-2.5/CCSEApps/pAmrDerive/rmEvents.pl0000644000175000017500000000120511634153073022053 0ustar amckinstryamckinstry#!/usr/bin/perl # # Layout of events: N x y spec reac time # $line=""; # # The species we with to remove from the Event log. # $spec=0; while (<>) { ($a,$b,$c,$d,$e,$f) = split(' ', $_); if ($e == -1) { if ($f == 0) { # # The beginning of a new Event trajectory. # $line = $_; } else { $line .= $_; if ($d != $spec) { print $line; } } } else { $line .= $_; } if (eof) { printf STDERR "Finished processing $ARGV ...\n" } } ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveSub.cpp0000644000175000017500000002654711634153073022767 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ //BL_COPYRIGHT_NOTICE #include #include #include #include #include #include using std::ios; using std::set_new_handler; #include #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif const bool verbose_DEF = false; static void PrintUsage (const char* progName) { cout << '\n'; cout << "Usage:" << '\n'; cout << progName << '\n'; cout << " infile=inFileName" << '\n'; cout << " [outfile=outFileName _section>]" << '\n'; cout << " [-sComp=N , unless comps used]" << '\n'; cout << " [-comps=\"N1 N2 N3...\"]" << '\n'; cout << " [-help]" << '\n'; cout << " [-verbose]" << '\n'; cout << '\n'; exit(1); } static vector Tokenize (const std::string& instr, const std::string& separators) { vector ptr; // // Make copy of line that we can modify. // char* line = new char[instr.size()+1]; (void) strcpy(line, instr.c_str()); char* token = 0; if (!((token = strtok(line, separators.c_str())) == 0)) { ptr.push_back(token); while (!((token = strtok(0, separators.c_str())) == 0)) ptr.push_back(token); } vector tokens(ptr.size()); for (int i = 1; i < ptr.size(); i++) { char* p = ptr[i]; while (strchr(separators.c_str(), *(p-1)) != 0) *--p = 0; } for (int i = 0; i < ptr.size(); i++) tokens[i] = ptr[i]; delete line; return tokens; } void WritePlotFile(const PArray& mfa, const Array& names, AmrData& amrdToMimic, const std::string& oFile, const Box& subbox, bool verbose); int main (int argc, char* argv[]) { if (argc == 1) PrintUsage(argv[0]); BoxLib::Initialize(argc,argv); ParmParse pp; if (pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Scan the arguments. // std::string infile; bool verbose = verbose_DEF; verbose = (pp.contains("verbose") ? true : false); if (verbose) AmrData::SetVerbose(true); pp.get("infile",infile); vector pieces = Tokenize(infile,std::string("/")); std::string outfile = pieces[pieces.size()-1] + std::string("_section"); pp.query("outfile",outfile); // Read in pltfile and get amrData ref DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(infile, fileType); if (!dataServices.AmrDataOk()) DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); Array comps; if (int nc = pp.countval("comps")) { comps.resize(nc); pp.getarr("comps",comps,0,nc); } else { int sComp = 0; pp.query("sComp",sComp); int nComp = amrData.NComp(); pp.query("nComp",nComp); BL_ASSERT(sComp+nComp < amrData.NComp()); comps.resize(nComp); for (int i=0; i inBox; if (int nx=pp.countval("box")) { pp.getarr("box",inBox,0,nx); int d=BL_SPACEDIM; BL_ASSERT(inBox.size()==2*d); subbox=Box(IntVect(D_DECL(inBox[0],inBox[1],inBox[2])), IntVect(D_DECL(inBox[d],inBox[d+1],inBox[d+2])), IndexType::TheCellType()); } Array subboxes(finestLevel+1,subbox); for (int iLevel = finestLevel-1; iLevel>=0; --iLevel) subboxes[iLevel] = BoxLib::coarsen(subboxes[iLevel+1],amrData.RefRatio()[iLevel]); for (int iLevel = 1; iLevel<=finestLevel; ++iLevel) subboxes[iLevel] = BoxLib::refine(subboxes[iLevel-1],amrData.RefRatio()[iLevel-1]); PArray data_sub(finestLevel+1); Array names(comps.size()); for (int iLevel = 0; iLevel <= finestLevel; ++iLevel) { // Build the BoxArray for the result BoxList bl; const BoxArray& ba_all = amrData.boxArray(iLevel); for (int i=0; i 0) { data_sub.set(iLevel, new MultiFab(ba_sub,comps.size(),0,Fab_allocate)); for (int i=0; i& mfa, const Array& names, AmrData& amrdToMimic, const std::string& oFile, const Box& subbox, bool verbose) { int ntype = names.size(); int finestLevel = amrdToMimic.FinestLevel(); if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(oFile,0755)) BoxLib::CreateDirectoryFailed(oFile); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string oFileHeader(oFile); oFileHeader += "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); ofstream os; os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); if (verbose && ParallelDescriptor::IOProcessor()) cout << "Opening file = " << oFileHeader << '\n'; #ifdef BL_USE_NEW_HFILES os.open(oFileHeader.c_str(), ios::out|ios::binary); #else os.open(oFileHeader.c_str(), ios::out); #endif if (os.fail()) BoxLib::FileOpenFailed(oFileHeader); // // Start writing plotfile. // os << amrdToMimic.PlotFileVersion() << '\n'; int n_var = ntype; os << n_var << '\n'; for (int n = 0; n < ntype; n++) os << names[n] << '\n'; os << BL_SPACEDIM << '\n'; os << amrdToMimic.Time() << '\n'; os << finestLevel << '\n'; int i; const int nLev = finestLevel + 1; Real ProbLo[BL_SPACEDIM], ProbHi[BL_SPACEDIM]; for (i = 0; i < BL_SPACEDIM; ++i) { ProbLo[i] = amrdToMimic.ProbLo()[i] + amrdToMimic.DxLevel()[0][i] * (subbox.loVect()[i] - amrdToMimic.ProbDomain()[0].loVect()[i]); ProbHi[i] = amrdToMimic.ProbHi()[i] - amrdToMimic.DxLevel()[0][i] * (amrdToMimic.ProbDomain()[0].hiVect()[i] - subbox.hiVect()[i]); } Array ProbDomain(nLev); for (i = 0; i < nLev; ++i) { if (i==0) { ProbDomain[i] = subbox; } else { ProbDomain[i] = BoxLib::refine(ProbDomain[i-1],amrdToMimic.RefRatio()[i-1]); } } for (i = 0; i < BL_SPACEDIM; i++) os << ProbLo[i] << ' '; os << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << ProbHi[i] << ' '; os << '\n'; for (i = 0; i < finestLevel; i++) os << amrdToMimic.RefRatio()[i] << ' '; os << '\n'; for (i = 0; i <= finestLevel; i++) os << ProbDomain[i] << ' '; os << '\n'; for (i = 0; i <= finestLevel; i++) os << 0 << ' '; os << '\n'; for (i = 0; i <= finestLevel; i++) { for (int k = 0; k < BL_SPACEDIM; k++) os << amrdToMimic.DxLevel()[i][k] << ' '; os << '\n'; } os << amrdToMimic.CoordSys() << '\n'; os << "0\n"; // The bndry data width. // // Write out level by level. // for (int iLevel = 0; iLevel <= finestLevel; ++iLevel) { // // Write state data. // BoxArray ba_sub = mfa[iLevel].boxArray(); int nGrids = ba_sub.size(); char buf[64]; sprintf(buf, "Level_%d", iLevel); if (ParallelDescriptor::IOProcessor()) { os << iLevel << ' ' << nGrids << ' ' << amrdToMimic.Time() << '\n'; os << 0 << '\n'; for (i = 0; i < nGrids; ++i) { for (int n = 0; n < BL_SPACEDIM; n++) { os << amrdToMimic.DxLevel()[iLevel][n]*ba_sub[i].smallEnd(n) << ' ' << amrdToMimic.DxLevel()[iLevel][n]*(ba_sub[i].bigEnd(n)+1) << '\n'; } } // // Build the directory to hold the MultiFabs at this level. // std::string Level(oFile); Level += '/'; Level += buf; if (!BoxLib::UtilCreateDirectory(Level, 0755)) BoxLib::CreateDirectoryFailed(Level); } // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); // // Now build the full relative pathname of the MultiFab. // static const std::string MultiFabBaseName("/MultiFab"); std::string PathName(oFile); PathName += '/'; PathName += buf; PathName += MultiFabBaseName; if (ParallelDescriptor::IOProcessor()) { // // The full name relative to the Header file. // std::string RelativePathName(buf); RelativePathName += '/'; RelativePathName += MultiFabBaseName; os << RelativePathName << '\n'; } VisMF::Write(mfa[iLevel], PathName, VisMF::OneFilePerCPU); } os.close(); } ccseapps-2.5/CCSEApps/pAmrDerive/xtra_2D.F0000644000175000017500000000357111634153073021335 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "CONSTANTS.H" #include "ArrayLim.H" #include "BC_TYPES.H" #include "xtra_F.H" #define DIM 2 subroutine FORT_PUSHVTOG(lo, hi, dlo, dhi, U, DIMS(U), nc) implicit none integer nc integer lo(DIM), hi(DIM) integer dlo(DIM), dhi(DIM) integer DIMDEC(U) REAL_T U(DIMV(U),nc) integer i,j,k,n REAL_T xlo(DIM), dx(DIM) c Make up something for these that gets what we want do n=1,DIM dx(n) = one xlo(n) = one end do do n=1,nc call hoextraptocc(U(ARG_L1(U),ARG_L2(U),n),DIMS(U),dlo,dhi,dx,xlo) end do end ccseapps-2.5/CCSEApps/pAmrDerive/AmrDeriveQuench.cpp0000644000175000017500000005357711634153073023464 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ //BL_COPYRIGHT_NOTICE #include #include #include #include #include #include #include #include #include #include #ifndef WIN32 #include #endif #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "FArrayBox.H" #include "Utility.H" #include "ChemKinDriver.H" static void print_usage (int, char* argv[]) { std::cerr << "usage:\n"; std::cerr << argv[0] << " infile [options] \n\tOptions:\n"; exit(1); } void clonePlotfile(AmrData& amrData, const PArray& mfout, std::string& oFile, const Array& names, bool verbose) { if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(oFile,0755)) BoxLib::CreateDirectoryFailed(oFile); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string oFileHeader(oFile); oFileHeader += "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream os; os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Opening file = " << oFileHeader << '\n'; os.open(oFileHeader.c_str(), std::ios::out|std::ios::binary); if (os.fail()) BoxLib::FileOpenFailed(oFileHeader); // // Start writing plotfile. // os << amrData.PlotFileVersion() << '\n'; int n_var = mfout[0].nComp(); os << n_var << '\n'; for (int n = 0; n < n_var; n++) os << names[n] << '\n'; os << BL_SPACEDIM << '\n'; os << amrData.Time() << '\n'; const int finestLevel = mfout.size() - 1; os << finestLevel << '\n'; for (int i = 0; i < BL_SPACEDIM; i++) os << amrData.ProbLo()[i] << ' '; os << '\n'; for (int i = 0; i < BL_SPACEDIM; i++) os << amrData.ProbHi()[i] << ' '; os << '\n'; for (int i = 0; i < finestLevel; i++) os << amrData.RefRatio()[i] << ' '; os << '\n'; for (int i = 0; i <= finestLevel; i++) os << amrData.ProbDomain()[i] << ' '; os << '\n'; for (int i = 0; i <= finestLevel; i++) os << 0 << ' '; os << '\n'; for (int i = 0; i <= finestLevel; i++) { for (int k = 0; k < BL_SPACEDIM; k++) os << amrData.DxLevel()[i][k] << ' '; os << '\n'; } os << amrData.CoordSys() << '\n'; os << "0\n"; // The bndry data width. // // Write out level by level. // for (int iLevel = 0; iLevel <= finestLevel; ++iLevel) { // // Write state data. // int nGrids = amrData.boxArray(iLevel).size(); char buf[64]; sprintf(buf, "Level_%d", iLevel); if (ParallelDescriptor::IOProcessor()) { os << iLevel << ' ' << nGrids << ' ' << amrData.Time() << '\n'; os << 0 << '\n'; for (int i = 0; i < nGrids; ++i) { for (int n = 0; n < BL_SPACEDIM; n++) { os << amrData.GridLocLo()[iLevel][i][n] << ' ' << amrData.GridLocHi()[iLevel][i][n] << '\n'; } } // // Build the directory to hold the MultiFabs at this level. // std::string Level(oFile); Level += '/'; Level += buf; if (!BoxLib::UtilCreateDirectory(Level, 0755)) BoxLib::CreateDirectoryFailed(Level); } // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); // // Now build the full relative pathname of the MultiFab. // static const std::string MultiFabBaseName("/MultiFab"); std::string PathName(oFile); PathName += '/'; PathName += buf; PathName += MultiFabBaseName; if (ParallelDescriptor::IOProcessor()) { // // The full name relative to the Header file. // std::string RelativePathName(buf); RelativePathName += '/'; RelativePathName += MultiFabBaseName; os << RelativePathName << '\n'; } VisMF::Write(mfout[iLevel], PathName, VisMF::OneFilePerCPU); } os.close(); } #define PI 3.141593 /* pi */ #define C 29979245800.0 /* Speed of Light in cm/s */ #define H 6.6260755e-34 /* Planck's constant in Js */ #define K 1.380662e-23 /* Boltzmann constant J/K */ /******************************************************************************** ** ** Definition of structures for all data transfer between functions. ** The following structures are used: ** ** BoundaryParams (bparm): pressure, temperature, name, molar mass and molefraction of up to 50 species. ** QuenchParams (qparm): name and quenching parameters according to harpoon model for up to 50 species. ** ** The molecule parameters (mass/molefraction and quenching) are interconnected between the two structures by their name. ** It is thus important to use the same name (implemented as string) within both structures! ** ********************************************************************************/ struct QuenchParams { int number; // number of quenching species for which parameters are in this structure char qname[50][10]; // name of up to 50 species int qclass[50]; // harpoon class float c0[50]; // harpoon coefficients float c1[50]; float c2[50]; float c3[50]; float c4[50]; }; struct BoundaryParams { float temp; // temperature float press; // pressure int snumber; // number of species. the 1st must be the molecule for which the simulation is performed! char sname[500][10]; // name of up to 50 species float smass[500]; // molecular mass [u] float smolefract[500]; // mole fraction (0...1) }; /******************************************************************************** ** ** void LoadQuenchParams(char *filename, struct QuenchParams *qparm) ** ** ** Load the quenching coefficients from the ASCII file "filename" and puts it into qparm. ** The necessary memory must already be assigned! ** ********************************************************************************/ void LoadQuenchParams(char *filename, QuenchParams& qparm) { FILE *fp; int i; void ReadInt(FILE*,int*); void ReadFloat(FILE*,float*); void ReadString(FILE*,char*); if((fp = fopen(filename,"r")) == NULL) { printf("File %s could not be opened!",filename); exit(-1); } ReadInt(fp,&qparm.number); for(i = 0; i < qparm.number; i++) { ReadString(fp,qparm.qname[i]); ReadInt(fp,&qparm.qclass[i]); ReadFloat(fp,&qparm.c0[i]); ReadFloat(fp,&qparm.c1[i]); ReadFloat(fp,&qparm.c2[i]); ReadFloat(fp,&qparm.c3[i]); ReadFloat(fp,&qparm.c4[i]); } fclose(fp); } /******************************************************************************** ** ** void ReadFloat(FILE *fp, float *value) ** void ReadString(FILE *fp, char *string) ** void ReadInt(FILE *fp, int *value) ** ** ** reads the next float value/next string/next integer value out of the ASCII file which is already opened to read ** with the file pointer fp. ** lines starting with "*" are considered as comments. ** lines containing a "*" are comments from that position on. ** values can be separated using one or multiple TAB or SPACE or CR ** ********************************************************************************/ void ReadFloat(FILE* fp, float *value) { int c; int pos; char line[100]; do { c = fgetc(fp); if(c == '*') { while((( c = fgetc(fp)) != '\n') && (c != EOF)) ; } if(c == EOF) { *value = 0.0; return; } } while(c == '\t' || c == '\n' || c == ' '); pos = 0; do line[pos++] = c; while((( c= fgetc(fp)) != '\t') && (c != '\n') && (c != EOF) && (c != '*') && (c != ' ')); line[pos] = 0; *value = (float) atof(line); } void ReadInt(FILE* fp, int *value) { int c; int pos; char line[100]; do { c = fgetc(fp); if(c == '*') { while((( c = fgetc(fp)) != '\n') && (c != EOF)) ; } if(c == EOF) { *value = 0; return; } } while(c == '\t' || c == '\n' || c == ' '); pos = 0; do line[pos++] = c; while((( c= fgetc(fp)) != '\t') && (c != '\n') && (c != EOF) && (c != '*') && (c != ' ')); line[pos] = 0; *value = (int) atof(line); } void ReadString(FILE* fp, char *string) { int c; int pos; do { c = fgetc(fp); if(c == '*') { while((( c = fgetc(fp)) != '\n') && (c != EOF)) ; } if(c == EOF) { string[0] = 0; return; } } while(c == '\t' || c == '\n' || c == ' '); pos = 0; do string[pos++] = c; while((( c= fgetc(fp)) != '\t') && (c != '\n') && (c != EOF) && (c != '*') && (c != ' ')); string[pos] = 0; } /******************************************************************************** ** ** Calculation of Gamma functions. ** ** from: Press, Teukolsky, Vetterling, Flannery, Numerical recipes in C, Cambridge University Press ** ********************************************************************************/ // Returns the value ln[greek-G(xx)]for xx > 0. float gammln(float xx) { //Internal arithmetic will be done in double precision, a nicety that you can omit if ve- gure //accuracy is good enough. double x,y,tmp,ser; static double cof[6]={76.18009172947146,-86.50532032941677, 24.01409824083091,-1.231739572450155, 0.1208650973866179e-2,-0.5395239384953e-5}; int j; y=x=xx; tmp=x+5.5; tmp -= (x+0.5)*log(tmp); ser=1.000000000190015; for (j=0;j<=5;j++) ser += cof[j]/++y; return -tmp+log(2.5066282746310005*ser/x); } // Returns the incomplete gamma function P(a; x). float gammp(float a, float x) { void gcf(float *gammcf, float a, float x, float *gln); void gser(float *gamser, float a, float x, float *gln); void nrerror(char error_text[]); float gamser,gammcf,gln; if (x < 0.0 || a <= 0.0) nrerror("Invalid arguments in routine gammp"); if (x < (a+1.0)) { // Use the series representation. gser(&gamser,a,x,&gln); return gamser; } else { // Use the continued fraction representation gcf(&gammcf,a,x,&gln); return 1.0-gammcf; // and take its complement. } } // Returns the incomplete gamma function greek-g(a; x).. P(a,x) = greek-g(a,x) / greek-G(a) // WGB 13.7.2001 float gammg(float a, float x) { void gcf(float *gammcf, float a, float x, float *gln); void gser(float *gamser, float a, float x, float *gln); void nrerror(char error_text[]); float gamser,gammcf,gln; if (x < 0.0 || a <= 0.0) nrerror("Invalid arguments in routine gammp"); if (x < (a+1.0)) { // Use the series representation. gser(&gamser,a,x,&gln); return gamser * exp(gln); } else { // Use the continued fraction representation gcf(&gammcf,a,x,&gln); return (1.0-gammcf) * exp(gln); // and take its complement. } } // Returns the incomplete gamma function Q(a; x) = 1 - P(a; x). float gammq(float a, float x) { void gcf(float *gammcf, float a, float x, float *gln); void gser(float *gamser, float a, float x, float *gln); void nrerror(char error_text[]); float gamser,gammcf,gln; if (x < 0.0 || a <= 0.0) nrerror("Invalid arguments in routine gammq"); if (x < (a+1.0)) { // Use the series representation gser(&gamser,a,x,&gln); return 1.0-gamser; // and take its complement. } else { // Use the continued fraction representation. gcf(&gammcf,a,x,&gln); return gammcf; } } #define ITMAX 100 /* Maximum allowed number of iterations. */ #define EPS 3.0e-7 /* Relative accuracy.*/ #define FPMIN 1.0e-30 /* Number near the smallest representable floating-point number.*/ // Returns the incomplete gamma function P(a; x) evaluated by its series representation as gamser. // Also returns ln greek-G(a) as gln. void gser(float *gamser, float a, float x, float *gln) { float gammln(float xx); void nrerror(char error_text[]); int n; float sum,del,ap; *gln=gammln(a); if (x <= 0.0) { if (x < 0.0) nrerror("x less than 0 in routine gser"); *gamser=0.0; return; } else { ap=a; del=sum=1.0/a; for (n=1;n<=ITMAX;n++) { ++ap; del *= x/ap; sum += del; if (fabs(del) < fabs(sum)*EPS) { *gamser=sum*exp(-x+a*log(x)-(*gln)); return; } } nrerror("a too large, ITMAX too small in routine gser"); return; } } // Returns the incomplete gamma function Q(a; x) evaluated by its continued fraction represen- // tation as gammcf. Also returns ln greek-G(a) as gln. void gcf(float *gammcf, float a, float x, float *gln) { float gammln(float xx); void nrerror(char error_text[]); int i; float an,b,c,d,del,h; *gln=gammln(a); b=x+1.0-a; // Set up for evaluating continued fraction by modi ed Lentz's method ( x 5.2) with b0 = 0. c=float(1.0/FPMIN); d=1.0/b; h=d; for (i=1;i<=ITMAX;i++) { // Iterate to convergence. an = -i*(i-a); b += 2.0; d=an*d+b; if (fabs(d) < FPMIN) d=float(FPMIN); c=b+an/c; if (fabs(c) < FPMIN) c=float(FPMIN); d=1.0/d; del=d*c; h *= del; if (fabs(del-1.0) < EPS) break; } if (i > ITMAX) nrerror("a too large, ITMAX too small in gcf"); *gammcf=exp(-x+a*log(x)-(*gln))*h; // Put factors in front. } void nrerror(char error_text[]) /* Numerical Recipes standard error handler */ { fprintf(stderr,"Numerical Recipes run-time error...\n"); fprintf(stderr,"%s\n",error_text); fprintf(stderr,"...now exiting to system...\n"); exit(1); } /******************************************************************************** ** ** double CalculateQuenchRate(struct QuenchParams *qparm, struct BoundaryParams *bparm) ** ** ** Gives back the total calculated quenching rate [1/s], based on the quenching parameters given in qparm ** and the boundary parameters given in bparm. ** ********************************************************************************/ double CalculateQuenchRate(QuenchParams& qparm, BoundaryParams& bparm, int idxQspec) { float gammg(float a, float x); // this gives back the incomplete gamma function. implemented from "numerical recipes". double qrate; double cross; double eta; int i,j; // calculation of effective cross section by summation over species: cross section x molefraction x mass dependence qrate = 0; for(i = 0; i < bparm.snumber; i++) // all molecules in system { if(bparm.smolefract[i] > 0.0) { // find molecule in quenching table by comparing name j = 0; while(strcmp(bparm.sname[i],qparm.qname[j]) && j < qparm.number) // strcmp() returns 0 if strings are identical j++; if(j >= qparm.number) {}//printf("No quenching data available for %s!\n",bparm.sname[i]); else { // calculate t-dependent quenching cross section according to harpoon model if(qparm.qclass[j] == 1) cross = 0.0; else if(qparm.qclass[j] == 2) cross = qparm.c0[j] + qparm.c1[j] * exp((-1.0) * qparm.c2[j] * 300.0/bparm.temp) + qparm.c3[j]*exp((-1.0) * qparm.c4[j] * 300.0/bparm.temp); else if(qparm.qclass[j] == 3) { eta = qparm.c2[j] *300.0/bparm.temp + qparm.c3[j]*300.0/bparm.temp*300.0/bparm.temp; cross = qparm.c0[j]*((1.0 + eta) * exp((-1.0)*eta) + qparm.c1[j]*pow(eta,1.0/3.0)*gammg(5.0/3.0,eta) ); } else if(qparm.qclass[j] == 4) cross = qparm.c0[j]; else if(qparm.qclass[j] == 5) cross = qparm.c0[j] + qparm.c1[j] * pow(300.0/bparm.temp, qparm.c2[j]); else if(qparm.qclass[j] == 6) { eta = qparm.c2[j] *300.0/bparm.temp + qparm.c3[j]*300.0/bparm.temp*300.0/bparm.temp; cross = qparm.c0[j]* ((1.0 + eta) * exp((-1.0)*eta) + qparm.c1[j]*pow(eta,1.0/3.0)*gammg(5.0/3.0,eta) ); } // printf("Quenching cross section for %s: %g\n",qparm.qname[j],cross); // add cross section to total quench rate qrate += bparm.smolefract[i] * sqrt(1 + bparm.smass[idxQspec]/bparm.smass[i]) * cross; } } } // qrate now contains the total effective quenching cross section in Angstrom^2. // To convert into 1/s, we need to multiply by p/kT * qrate *= bparm.press / (K * bparm.temp) * sqrt(8.0 * K * bparm.temp / (PI * bparm.smass[idxQspec])); // conversion of amu, bar and Angstrom to kg, Pa and m qrate *= 2.4539855e-2; return(qrate); } Real func_T(Real T) { // set 1 Real coeff[8] = { 1.82078E31, -1.83238E29, +6.19957E26, -7.31098E23, +4.46668E20, -1.52894E17, +2.78638E13, -2.1079E9 }; //set 2 //Real coeff[8] = { -3.49899E29, +2.69897E27, -7.47569E24, +9.21223E21, -5.17156E18, +1.47748E15, -2.07914E11, +1.11425E7 }; return (1/T) * (coeff[0] + coeff[1]*T + coeff[2]*pow(T,2) + coeff[3]*pow(T,3) + coeff[4]*pow(T,4) + coeff[5]*pow(T,5) + coeff[6]*pow(T,6) + coeff[7]*pow(T,7) ); } void main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc < 2) print_usage(argc,argv); ParmParse pp; if (pp.contains("help")) print_usage(argc,argv); if (pp.contains("verbose")) AmrData::SetVerbose(true); std::string infile; pp.get("file",infile); std::string Qspec = "NO"; pp.query("Qspec",Qspec); std::string excessspec = "N2"; pp.query("excessspec",excessspec); // the following two structures will contain all the necessary parameters for the quenching correction // (definition see at top of file). QuenchParams qparm; // info on quenching efficiency of different species (loaded from no-quenching.dat) BoundaryParams bparm; // info on boundary conditions such as temperature, pressure, and mole fractions // load quenching parameters LoadQuenchParams("no-quenching.dat",qparm); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(infile, fileType); if (!dataServices.AmrDataOk()) // // This calls ParallelDescriptor::EndParallel() and exit() // DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); int Nlev = amrData.FinestLevel() + 1; std::string chemInFile = "chemGlar.inp"; std::string chemOutFile = "chemGlar.out"; std::string thermInFile = "thermGlar.dat"; std::string tranInFile = "tranGlar.dat"; ChemKinDriver ckd(chemInFile,chemOutFile,thermInFile,tranInFile); const Array chemnames = ckd.speciesNames(); Array plotnames = amrData.PlotVarNames(); int idT = -1; int idX = -1; int idxQspec = -1; int idxXS = -1; for (int i=0; i mfout(Nlev); Array names(Nspec+2); for (int i=0; i vals(names.size()); bparm.press = 1.0; bparm.snumber = Nspec; const Array molecWeight = ckd.speciesMolecWt(); for (int i=0; i #include #include #include #include #include #include #include #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "Derived.H" #include "ArrayLim.H" // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #if defined(BL_FORT_USE_UPPERCASE) # define TRANSV TRANSV #elif defined(BL_FORT_USE_LOWERCASE) # define TRANSV transv #elif defined(BL_FORT_USE_UNDERSCORE) # define TRANSV transv_ #endif extern "C" { void TRANSV(Real* v, ARLIM_P(vlo), ARLIM_P(vhi), const Real* dx, const Real* domnlo, Real* r, Real* t, Real* z, Real* c, int* n, ARLIM_P(alo), ARLIM_P(ahi), const int* maxbins, const int* bsize); }; static void PrintUsage (const char* progName) { std::cout << '\n'; std::cout << "Usage:" << '\n'; std::cout << progName << '\n'; std::cout << " infiles=inputFileNames" << '\n'; std::cout << " [bsize=]" << '\n'; std::cout << " [-help]" << '\n'; std::cout << '\n'; exit(1); } int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc == 1) PrintUsage(argv[0]); ParmParse pp; if (pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Scan the arguments. // bool verbose = false; if (pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(true); } const int nfile = pp.countval("infiles"); if (nfile<=0) BoxLib::Abort("You must specify `infiles'"); std::vector iFile(nfile); pp.queryarr("infiles",iFile); int bsize=5; pp.query("bsize",bsize); DataServices::SetBatchMode(); FileType fileType(NEWPLT); const int nComp = BL_SPACEDIM+2; Array names(nComp); names[0] = "xvel"; names[1] = "yvel"; names[2] = "zvel"; names[3] = "density"; names[4] = "tracer"; DataServices* dataServices0 = new DataServices(iFile[0], fileType); AmrData& amrData0 = dataServices0->AmrDataRef(); const Box box = amrData0.ProbDomain()[0]; // Get a shifted domnlo vector to center domain Array domnlo(BL_SPACEDIM); for (int i=0; i Nbin(vbox,1); FArrayBox vData(box,nComp); FArrayBox tmp(box,1); avVR.setVal(0); avVT.setVal(0); avVZ.setVal(0); avC.setVal(0); for (int ifile=0; ifile #include #include #include #include #include #include #include using std::cout; using std::endl; #ifndef WIN32 #include #endif #ifdef USE_TEC_BIN_IO #include "TECIO.h" #endif #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "FArrayBox.H" struct Node { enum typeEnum{INIT=0, COVERED=1, VALID=2}; Node() : level(-1), iv(IntVect(D_DECL(-1,-1,-1))), type(Node::INIT) {} Node(const IntVect& idx, int lev, typeEnum typ = INIT) : level(lev), iv(idx), type(typ) {} inline bool operator< (const Node& rhs) const { if (level < rhs.level) return true; if ((level == rhs.level) && iv.lexLT(rhs.iv)) return true; return false; } inline bool operator!= (const Node& rhs) const { return ((*this) < rhs || rhs < (*this)); } IntVect iv; int level; typeEnum type; }; std::ostream& operator<< (std::ostream& os, const Node& node) { os << "Node: IntVect=" << node.iv << ", level=" << node.level << ", type="; if (node.type==Node::INIT) os << "INIT"; else if (node.type==Node::COVERED) os << "COVERED"; else os << "VALID"; if (os.fail()) BoxLib::Error("operator<<(ostream&,Node&) failed"); return os; } struct Element { #if (BL_SPACEDIM==2) #define MYLEN 4 Element(const Node& a, const Node& b, const Node& c, const Node& d) { n[0]=&a; n[1]=&b; n[2]=&c; n[3]=&d; } #else #define MYLEN 8 Element(const Node& a, const Node& b, const Node& c, const Node& d, const Node& e, const Node& f, const Node& g, const Node& h) { n[0]=&a; n[1]=&b; n[2]=&c; n[3]=&d; n[4]=&e; n[5]=&f; n[6]=&g; n[7]=&h; } #endif const Node* n[MYLEN]; inline bool operator< (const Element& rhs) const { for (int i=0; i0]\n"; std::cerr << "\t nComp=number of comps[DEF->all]\n"; std::cerr << "\t box=int list of LL+UR of subbox (lev-0 coords) [DEF->all]>\n"; exit(1); } class FABdata { public: FABdata(size_t i) {fab.resize(Box(IntVect::TheZeroVector(),IntVect(i,0,0)),1);} Real& operator[](size_t i) {return fab(IntVect(D_DECL(i,0,0)));} FArrayBox fab; }; void main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc < 2) print_usage(argc,argv); ParmParse pp; if (pp.contains("help")) print_usage(argc,argv); if (pp.contains("verbose")) AmrData::SetVerbose(true); std::string infile; pp.get("infile",infile); std::string outfile_DEF; std::string outType = "flt"; pp.query("outType",outType); if (outType=="flt") { outfile_DEF = infile+".flt"; } else if (outType=="tec") { #ifdef USE_TEC_BIN_IO outfile_DEF = infile+".plt"; #else outfile_DEF = infile+".dat"; #endif } else { print_usage(argc,argv); } std::string outfile(outfile_DEF); pp.query("outfile",outfile); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServices(infile, fileType); if (!dataServices.AmrDataOk()) DataServices::Dispatch(DataServices::ExitRequest, NULL); AmrData& amrData = dataServices.AmrDataRef(); const Array& names = amrData.PlotVarNames(); Array comps; if (int nc = pp.countval("comps")) { comps.resize(nc); pp.getarr("comps",comps,0,nc); } else { int sComp = 0; pp.query("sComp",sComp); int nComp = amrData.NComp(); pp.query("nComp",nComp); BL_ASSERT(sComp+nComp <= amrData.NComp()); comps.resize(nComp); for (int i=0; i barr; pp.getarr("box",barr,0,nx); int d=BL_SPACEDIM; BL_ASSERT(barr.size()==2*d); subbox=Box(IntVect(D_DECL(barr[0],barr[1],barr[2])), IntVect(D_DECL(barr[d],barr[d+1],barr[d+2]))); } else { subbox = amrData.ProbDomain()[0]; } int Nlev = amrData.FinestLevel() + 1; Array gridArray(Nlev); Array subboxArray(Nlev); for (int lev=0; lev NodeFab; typedef FabArray MultiNodeFab; PArray nodes(Nlev,PArrayManage); std::cerr << "Before nodes allocated" << endl; for (int lev=0; lev NodeMap; NodeMap nodeMap; for (int lev=0; lev connData(MYLEN*nElts); std::cerr << "After connData allocated " << elements.size() << " elements" << endl; for (EltSet::const_iterator it = elements.begin(); it!=elements.end(); ++it) for (int j=0; j nodeVect(nodeMap.size()); for (NodeMap::const_iterator it=nodeMap.begin(); it!=nodeMap.end(); ++it) nodeVect[(*it).second] = (*it).first; std::cerr << "Final nodeVect built" << endl; nodeMap.clear(); elements.clear(); nodes.clear(); std::cerr << "Temp nodes, elements cleared" << endl; PArray fileData(Nlev); for (int lev=0; lev dx = amrData.DxLevel()[node.level]; const IntVect& iv = node.iv; for (int dir=0; dir= 0; $spec = $ARGV[0]; shift; print STDERR "Searching for species $spec ...\n"; while (<>) { # # Layout of events: N x y spec reac time # ($a,$b,$c,$d,$e,$f) = split(' ', $_); if ($d == $spec && $e != -1) { print $b, " ", $c, "\n"; } } ccseapps-2.5/CCSEApps/pAmrvis/0000755000175000017500000000000011634153073017300 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/pAmrvis/DatasetClient.cpp0000644000175000017500000005330711634153073022540 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: DatasetClient.cpp,v 1.7 2002/02/19 20:39:41 vince Exp $ // // --------------------------------------------------------------- // DatasetClient.cpp // --------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include "DatasetClient.H" #include "Box.H" #include "FArrayBox.H" #include "MultiFab.H" #ifdef BL_ARRAYVIEW_TAGBOX #include "TagBox.H" #endif const int MAXBUFSIZE = 1024; const int PORTOFFSET = 5000; const char *defaultFormat = "%7.5e"; const char *defaultLabel = " "; // ------------------------------------------------------------------- bool CreateSocket(int &newsocket) { int sockfd; struct sockaddr_in serveraddr; char *serverhost = "localhost"; struct hostent *serverhostp; int GETUID_SERVER_PORT = getuid() + PORTOFFSET; // use to contact the server if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { // create socket perror("Bad client socket create"); return false; } //cout << "=== after opening socket." << endl; // set up the socket structures bzero((char *) &serveraddr, sizeof(struct sockaddr_in)); serveraddr.sin_family = AF_INET; if((serverhostp = gethostbyname(serverhost)) == (struct hostent *) NULL) { cerr << "gethostbyname on " << serverhost << " failed" << endl; return false; } u_long sAddr(serveraddr.sin_addr.s_addr); bcopy(serverhostp->h_addr, (char *) &sAddr, serverhostp->h_length); serveraddr.sin_port = htons(GETUID_SERVER_PORT); // connect to the server if(connect(sockfd, (sockaddr *)&serveraddr, sizeof(serveraddr)) < 0) { perror ("Bad client connect"); return false; } //cout << "=== connection successful." << endl; newsocket = sockfd; return true; } // ------------------------------------------------------------------- bool SendString(int sockfd, const char *sendstring) { int count; char ptrbuffer[MAXBUFSIZE]; if(send(sockfd, sendstring, strlen(sendstring), 0) < 0) { perror("Bad client sendstring send"); return false; } // wait for acknowledgment if((count = recv(sockfd, ptrbuffer, MAXBUFSIZE, 0)) < 0) { perror("Bad sendstring ack."); return false; } ptrbuffer[count] = '\0'; //cout << "<<< received sendstring ack: " << ptrbuffer << endl; return true; } // ------------------------------------------------------------------- bool SendRealArray(int sockfd, Real *data[], int nvar, // size nvar const int *lodim, const int *hidim) // size BL_SPACEDIM { int count; char buffer[MAXBUFSIZE]; char ptrbuffer[MAXBUFSIZE]; IntVect ivlo(lodim); IntVect ivhi(hidim); Box dataBox(ivlo, ivhi); // --------------------------------------------------- send the box //cout << ">>> sending box." << endl; ostrstream bufferstream(buffer, sizeof(buffer)); bufferstream << dataBox << ends; if(send(sockfd, buffer, strlen(buffer), 0) < 0) { perror("Bad client box send"); return false; } // wait for acknowledgment if((count = recv(sockfd, buffer, MAXBUFSIZE, 0)) < 0) { perror("Bad box ack."); return false; } buffer[count] = '\0'; //cout << "<<< received box ack: " << buffer << endl; // --------------------------------------------------- send nComp //cout << ">>> sending nComp." << endl; sprintf(buffer, "%d", nvar); if(send(sockfd, buffer, strlen(buffer), 0) < 0) { perror("Bad client nComp send"); return false; } // wait for acknowledgment if((count = recv(sockfd, buffer, MAXBUFSIZE, 0)) < 0) { perror("Bad nComp ack."); return false; } buffer[count] = '\0'; //cout << "<<< received nComp ack: " << buffer << endl; // --------------------------------------------------- send the data. //cout << ">>> sending data." << endl; long t_long = sizeof(Real) * dataBox.numPts(); BL_ASSERT(t_long < INT_MAX); int totalDataBytes = int(t_long); int totalBytesSent, dataBytesRemaining; int dataBufferSize; char *getDataHere, *dataComponentStartingAddress; for(int dataComponent = 0; dataComponent < nvar; dataComponent++) { //cout << "dataComponent = " << dataComponent << endl; totalBytesSent = 0; dataBytesRemaining = totalDataBytes; dataComponentStartingAddress = (char *) (data[dataComponent]); while(totalBytesSent < totalDataBytes) { // send a chunk of data getDataHere = dataComponentStartingAddress + totalBytesSent; dataBufferSize = dataBytesRemaining; if((count = write(sockfd, getDataHere, dataBufferSize)) < 0) { perror("Bad client data send"); return false; } //cout << " bytes sent = " << count << endl; totalBytesSent += count; dataBytesRemaining -= count; } // end while } // end for // --------------------------------------------------- send the pointer ostrstream ptrbufferstream(ptrbuffer, sizeof(ptrbuffer)); ptrbufferstream << data[0] << ends; if(send(sockfd, ptrbuffer, strlen(ptrbuffer), 0) < 0) { perror("Bad client data ptr send"); return false; } // wait for acknowledgment if((count = recv(sockfd, ptrbuffer, MAXBUFSIZE, 0)) < 0) { perror("Bad data ptr ack."); return false; } ptrbuffer[count] = '\0'; //cout << "<<< received data ptr ack: " << ptrbuffer << endl; // --------------------------------------------------- done sending data return true; } // end SendRealArray // ------------------------------------------------------------------- // pointer to fab interface // ------------------------------------------------------------------- // ------------------------------------------------------------------- bool ArrayView(FArrayBox *debugFab) { return(ArrayViewFab(debugFab)); } // ------------------------------------------------------------------- bool ArrayViewFab(FArrayBox *debugFab) { return( ArrayViewFabFormatLabel(debugFab, defaultFormat, "Fab") ); } // ------------------------------------------------------------------- bool ArrayViewFabFormatLabel(FArrayBox *debugFab, const char *format, const char *label) { bool returnValue; int nvar = debugFab->nComp(); if(nvar < 1) { cerr << "Error in ArrayView: fab nComp < 1: fab->nComp = " << nvar << endl; return false; } if( ! debugFab->box().ok()) { cerr << "Error in ArrayView: bad fab box = " << debugFab->box() << endl; return false; } Real **dataArray = new Real*[nvar]; for(int d = 0; d < nvar; d++) { // build the array of real pointers dataArray[d] = debugFab->dataPtr(d); // dont assume contiguous } returnValue = ArrayViewRealPtrArrayNVarDims(dataArray, nvar, debugFab->box().smallEnd().getVect(), debugFab->box().bigEnd().getVect(), format, label); delete [] dataArray; return returnValue; } // ------------------------------------------------------------------- // pointer to MultiFab interface // ------------------------------------------------------------------- // ------------------------------------------------------------------- bool ArrayViewMultiFab(MultiFab *debugMultiFab) { return (ArrayViewMultiFabFormatLabel(debugMultiFab, defaultFormat, "MultiFab")); } // ------------------------------------------------------------------- bool ArrayViewMultiFabElement(MultiFab *debugMultiFab, int element) { return( ArrayViewMultiFabElementFormatLabel(debugMultiFab, element, defaultFormat, "MultiFab element") ); } // ------------------------------------------------------------------- bool ArrayViewMultiFabElementFormatLabel(MultiFab *debugMultiFab, int element, const char *format, const char *label) { if( ! debugMultiFab->ok()) { cerr << "Error in ArrayViewMultiFabComp: MultiFab is not ok()." << endl; return false; } if(element < 0 || element >= debugMultiFab->length()) { cerr << "Error in ArrayViewMultiFabElement: element index is not" << endl; cerr << " within range of MultiFab.length()." << endl; cerr << " MultiFab.length() = " << debugMultiFab->length() << endl; cerr << " Requested element = " << element << endl; return false; } return ( ArrayViewFabFormatLabel(&((*debugMultiFab)[element]), format, label) ); } #ifdef BL_ARRAYVIEW_TAGBOX // ------------------------------------------------------------------- // pointer to TagBox interface // ------------------------------------------------------------------- // ------------------------------------------------------------------- bool ArrayViewTagBox(TagBox *debugTagBox) { bool returnValue; int nvar = debugTagBox->nComp(); if(nvar < 1) { cerr << "Error in ArrayView: fab nComp < 1: fab->nComp = " << nvar << endl; return false; } if( ! debugTagBox->box().ok()) { cerr << "Error in ArrayView: bad fab box = " << debugTagBox->box() << endl; return false; } // create a temp fab and put the TagBox values (ints) into it FArrayBox *debugFab = new FArrayBox(debugTagBox->box(), nvar); for(int nv = 0; nv < nvar; ++nv) { Real *debugFabPtr = debugFab->dataPtr(nv); int *debugTagBoxPtr = debugTagBox->dataPtr(nv); for(int i = 0; i < debugTagBox->box().numPts() ; ++i) { debugFabPtr[i] = (Real) debugTagBoxPtr[i]; } } Real **dataArray = new Real*[nvar]; for(int d = 0; d < nvar; d++) { // build the array of real pointers dataArray[d] = debugFab->dataPtr(d); // dont assume contiguous } returnValue = ArrayViewRealPtrArrayNVarDims(dataArray, nvar, debugFab->box().smallEnd().getVect(), debugFab->box().bigEnd().getVect(), "%3.0f", " TagBox "); delete [] dataArray; delete debugFab; return returnValue; } // ------------------------------------------------------------------- // pointer to TagBoxArray interface // ------------------------------------------------------------------- // ------------------------------------------------------------------- bool ArrayViewTagBoxArray(TagBoxArray *debugTagBoxArray) { bool returnValue; int nvar = debugTagBoxArray->nComp(); if(nvar < 1) { cerr << "Error in ArrayView: fab nComp < 1: fab->nComp = " << nvar << endl; return false; } if( ! debugTagBoxArray->ok()) { cerr << "Error in ArrayView: bad TagBoxArray." << endl; return false; } // create a temp fab and put the TagBoxArray values (ints) into it MultiFab *debugMultiFab = new MultiFab(debugTagBoxArray->boxArray(), nvar, debugTagBoxArray->nGrow()); for(int nfab = 0; nfab < debugTagBoxArray->length(); ++nfab) { FArrayBox &debugFab = (*debugMultiFab)[nfab]; TagBox &debugTagBox = (*debugTagBoxArray)[nfab]; for(int nv = 0; nv < nvar; ++nv) { Real *debugFabPtr = debugFab.dataPtr(nv); int *debugTagBoxPtr = debugTagBox.dataPtr(nv); for(int i = 0; i < debugTagBox.box().numPts() ; ++i) { debugFabPtr[i] = (Real) debugTagBoxPtr[i]; } } } returnValue = ArrayViewMultiFabFormatLabel(debugMultiFab, "%3.0f", " TagBoxArray "); delete debugMultiFab; return returnValue; } #endif // ------------------------------------------------------------------- // pointer to real interface // ------------------------------------------------------------------- // ------------------------------------------------------------------- bool ArrayViewReal(Real *data, const int *lodim, const int *hidim) { return ( ArrayViewRealFormatLabel(data, lodim, hidim, defaultFormat, "Real Array") ); } // ------------------------------------------------------------------- bool ArrayViewRealFormatLabel(Real *data, const int *lodim, const int *hidim, const char *format, const char *label) { return ( ArrayViewRealNVarFormatLabel(data, 1, lodim, hidim, format, label) ); } // ------------------------------------------------------------------- bool ArrayViewRealNVar(Real *data, int nvar, const int *lodim, const int *hidim) { return ( ArrayViewRealNVarFormatLabel(data, nvar, lodim, hidim, defaultFormat, "Real Array") ); } // ------------------------------------------------------------------- bool ArrayViewRealNVarFormatLabel(Real *data, int nvar, const int *lodim, const int *hidim, // size BL_SPACEDIM const char *format, const char *label) { bool returnValue; if(data == NULL) { cerr << "Error in ArrayView: data pointer == NULL" << endl; return false; } if(nvar < 1) { cerr << "Error in ArrayView: nComp < 1: nvar = " << nvar << endl; return false; } Real **dataArray = new Real*[nvar]; long npts = 1; for(int sd = 0; sd < BL_SPACEDIM; sd++) { npts *= (hidim[sd] - lodim[sd] + 1); } char *tempCharPtr; for(int d = 0; d < nvar; d++) { // build the array of real pointers tempCharPtr = ((char *) data); tempCharPtr += d * npts * sizeof(Real); dataArray[d] = (Real *) tempCharPtr; } returnValue = ArrayViewRealPtrArrayNVarDims(dataArray, nvar, lodim, hidim, format, label); delete [] dataArray; return returnValue; } #if (BL_SPACEDIM == 2) // ------------------------------------------------------------------- bool ArrayViewRealDims(Real *data, int xlo, int ylo, int xhi, int yhi) { return ( ArrayViewRealDimsFormatLabel(data, xlo, ylo, xhi, yhi, defaultFormat, "Real data") ); } // ------------------------------------------------------------------- bool ArrayViewRealDimsFormatLabel(Real *data, int xlo, int ylo, int xhi, int yhi, const char *format, const char *label) { return ( ArrayViewRealNVarDimsFormatLabel(data, 1, xlo, ylo, xhi, yhi, format, label) ); } // ------------------------------------------------------------------- bool ArrayViewRealNVarDims(Real *data, int nvar, int xlo, int ylo, int xhi, int yhi) { return ( ArrayViewRealNVarDimsFormatLabel(data, nvar, xlo, ylo, xhi, yhi, defaultFormat, "Real data") ); } // ------------------------------------------------------------------- bool ArrayViewRealNVarDimsFormatLabel(Real *data, int nvar, int xlo, int ylo, int xhi, int yhi, const char *format, const char *label) { int lodims[BL_SPACEDIM], hidims[BL_SPACEDIM]; if(data == NULL) { cerr << "Error in ArrayView: data pointer == NULL" << endl; return false; } if(nvar < 1) { cerr << "Error in ArrayView: nComp < 1: nvar = " << nvar << endl; return false; } if(xlo > xhi) { cerr << "Error in ArrayView: xlo > xhi: " << xlo << " > " << xhi << endl; return false; } if(ylo > yhi) { cerr << "Error in ArrayView: ylo > yhi: " << ylo << " > " << yhi << endl; return false; } lodims[0] = xlo; lodims[1] = ylo; hidims[0] = xhi; hidims[1] = yhi; return( ArrayViewRealNVarFormatLabel(data, nvar, lodims, hidims, format, label) ); } #else // ------------------------------------------------------------------- bool ArrayViewRealDims(Real *data, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi) { return ( ArrayViewRealDimsFormatLabel(data, xlo, ylo, zlo, xhi, yhi, zhi, defaultFormat, "Real data") ); } // ------------------------------------------------------------------- bool ArrayViewRealDimsFormatLabel(Real *data, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi, const char *format, const char *label) { return ( ArrayViewRealNVarDimsFormatLabel(data, 1, xlo, ylo, zlo, xhi, yhi, zhi, format, label) ); } // ------------------------------------------------------------------- bool ArrayViewRealNVarDims(Real *data, int nvar, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi) { return ( ArrayViewRealNVarDimsFormatLabel(data, nvar, xlo, ylo, zlo, xhi, yhi, zhi, defaultFormat, "Real data") ); } // ------------------------------------------------------------------- bool ArrayViewRealNVarDimsFormatLabel(Real *data, int nvar, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi, const char *format, const char *label) { int lodims[BL_SPACEDIM], hidims[BL_SPACEDIM]; if(data == NULL) { cerr << "Error in ArrayView: data pointer == NULL" << endl; return false; } if(nvar < 1) { cerr << "Error in ArrayView: nComp < 1: nvar = " << nvar << endl; return false; } if(xlo > xhi) { cerr << "Error in ArrayView: xlo > xhi: " << xlo << " > " << xhi << endl; return false; } if(ylo > yhi) { cerr << "Error in ArrayView: ylo > yhi: " << ylo << " > " << yhi << endl; return false; } if(zlo > zhi) { cerr << "Error in ArrayView: zlo > zhi: " << zlo << " > " << zhi << endl; return false; } lodims[0] = xlo; lodims[1] = ylo; lodims[2] = zlo; hidims[0] = xhi; hidims[1] = yhi; hidims[2] = zhi; return( ArrayViewRealNVarFormatLabel(data, nvar, lodims, hidims, format, label) ); } #endif // ------------------------------------------------------------------- bool ArrayViewRealPtrArrayNVarDims(Real *data[], int nvar, // size nvar const int *lodim, const int *hidim, // size BL_SPACEDIM const char *format, const char *label) { int sockfd; if( ! CreateSocket(sockfd)) { return false; } // --------------------------------------------------- send data label if( ! SendString(sockfd, label)) { return false; } // --------------------------------------------------- send format if( ! SendString(sockfd, format)) { return false; } // --------------------------------------------------- send isMultiFab if( ! SendString(sockfd, "false")) { // not a MultiFab return false; } // --------------------------------------------------- send nElements // dont send nElements // --------------------------------------------------- send the data return (SendRealArray(sockfd, data, nvar, lodim, hidim)); } // end of function // ------------------------------------------------------------------- bool ArrayViewMultiFabFormatLabel(MultiFab *multifab, const char *format, const char *label) { int sockfd; char buffer[MAXBUFSIZE]; if( ! CreateSocket(sockfd)) { return false; } // --------------------------------------------------- send data label if( ! SendString(sockfd, label)) { return false; } // --------------------------------------------------- send format if( ! SendString(sockfd, format)) { return false; } // --------------------------------------------------- send isMultiFab if( ! SendString(sockfd, "true")) { // this is a MultiFab return false; } // --------------------------------------------------- send nElements //cout << ">>> sending nElements." << endl; sprintf(buffer, "%d", multifab->length()); if( ! SendString(sockfd, buffer)) { return false; } // --------------------------------------------------- send the data for(int element = 0; element < multifab->length(); element++) { // construct dataArray for this element FArrayBox &fab = (*multifab)[element]; int nvar = fab.nComp(); Real **dataArray = new Real*[nvar]; for(int d = 0; d < nvar; d++) { // build the array of Real * dataArray[d] = fab.dataPtr(d); // dont assume contiguous } if( ! SendRealArray(sockfd, dataArray, nvar, (fab.box()).loVect(), (fab.box()).hiVect())) { return false; } delete [] dataArray; } return true; } // end of function // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Make.package0000644000175000017500000000244711634153073021501 0ustar amckinstryamckinstryCEXE_headers += AmrPicture.H AmrData.H AmrvisConstants.H \ DataServices.H Dataset.H \ GlobalUtilities.H GraphicsAttributes.H \ GridPicture.H MessageArea.H \ Palette.H PltApp.H Output.H Quaternion.H Point.H \ Trackball.H XYPlotDataList.H XYPlotDefaults.H \ XYPlotWin.H XYPlotParam.H PltAppState.H CEXE_sources += AmrPicture.cpp AmrData.cpp AmrVisTool.cpp \ DataServices.cpp Dataset.cpp \ GraphicsAttributes.cpp GridPicture.cpp \ MessageArea.cpp PltApp.cpp \ GlobalUtilities.cpp Palette.cpp PltAppOutput.cpp \ Output.cpp Quaternion.cpp Point.cpp Trackball.cpp \ XYPlotDataList.cpp XYPlotParam.cpp XYPlotWin.cpp \ PltAppState.cpp ifeq ($(DIM),3) ifeq ($(USE_VOLRENDER), TRUE) CEXE_headers += VolRender.H CEXE_sources += VolRender.cpp endif endif ifeq ($(DIM),3) ifeq ($(USE_PARALLELVOLRENDER), TRUE) CEXE_headers += PVolRender.H CEXE_sources += PVolRender.cpp cEXE_sources += matrix.c twopass.c shearwarp.c sw.c window.c endif endif ifeq ($(DIM),3) CEXE_sources += ProjectionPicture.cpp ViewTransform.cpp PltApp3D.cpp endif FEXE_sources += FABUTIL_$(DIM)D.F ifeq ($(USE_ARRAYVIEW),TRUE) CEXE_sources += DatasetClient.cpp endif ccseapps-2.5/CCSEApps/pAmrvis/Output.cpp0000644000175000017500000004361411634153073021314 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Output.cpp,v 1.31 2003/02/28 02:01:38 vince Exp $ // // --------------------------------------------------------------- // Output.cpp // --------------------------------------------------------------- #include #include #include #include "Output.H" #include #include #include #include #include #include #include #include using std::hex; using std::dec; using std::ofstream; using std::ostrstream; using std::cout; using std::cerr; using std::endl; using std::min; using std::max; IMAGE *iopen(const char *file, unsigned int type, unsigned int dim, unsigned int xsize, unsigned int ysize, unsigned int zsize); int putrow(IMAGE *image, unsigned short *buffer, unsigned int y, unsigned int z); void cvtshorts( unsigned short buffer[], long n); int img_write(IMAGE *image, const void *buffer, long count); int img_seek(IMAGE *image, unsigned int y, unsigned int z); int img_optseek(IMAGE *image, unsigned long offset); int iclose(IMAGE *image); void cvtlongs(long buffer[], long n); void cvtimage(long *buffer); // ------------------------------------------------------------------- void WriteNewPSFile(const char *filename, XImage *image, int imagesizehoriz, int imagesizevert, const Palette &palette, const AmrData &amrdata, const int minlev, const int maxlev, Array< Array > &gridBoxes) { clock_t time0 = clock(); unsigned char r, g, b; Array rgb(256); for(int ii(0); ii < rgb.size(); ++ii) { rgb[ii] = (Real) ii / 255.0; } char newfilename[BUFSIZ]; sprintf(newfilename, "%s.new.ps", filename); ofstream fout(newfilename); fout.precision(3); fout << "%!PS-Adobe-2.0" << '\n'; fout << "%%BoundingBox: 0 0 " << imagesizehoriz-1 << " " << imagesizevert-1 << '\n'; fout << "gsave" << '\n'; fout << "/d {moveto 1 0 rlineto 0 -1 rlineto -1 0 rlineto closepath fill} def\n"; fout << "/s {setrgbcolor newpath} def\n"; for(int ipal(palette.PaletteStart()); ipal <= palette.PaletteEnd(); ++ipal) { palette.unpixelate(ipal, r, g, b); fout << "/c" << ipal << " {" << rgb[(int) r] << " " << rgb[(int) g] << " " << rgb[(int) b] << " s} def\n"; } fout << "\n1 setlinewidth\n"; fout << "\n% box color defs\n"; for(int iblev(minlev); iblev <= maxlev; ++iblev) { if(iblev == minlev) { fout << "/boxcolor" << iblev << " {1.0 1.0 1.0} def % white\n"; } else { palette.unpixelate(palette.SafePaletteIndex(iblev), r, g, b); fout << "/boxcolor" << iblev << " {" << rgb[(int) r] << " " << rgb[(int) g] << " " << rgb[(int) b] << "} def\n"; } } fout << "\n"; // draw the pixels for(int j(0); j < imagesizevert; ++j) { int jflip(imagesizevert - (j + 1)); for(int i(0); i < imagesizehoriz; ++i) { fout << "c" << XGetPixel(image, i, j) << " " << i << " " << jflip << " d\n"; } } // draw the boxes fout << "\n\n% draw the boxes\n"; for(int ilev(minlev); ilev <= maxlev; ++ilev) { fout << "\n% boxes for level " << ilev << "\n"; fout << "boxcolor" << ilev << " setrgbcolor\n\n"; for(int i(0); i < gridBoxes[ilev].size(); ++i) { const GridBoxes gb = gridBoxes[ilev][i]; int yboxinv(imagesizevert - (gb.ybox + 1)); fout << gb.xbox << " " << yboxinv << " moveto\n"; fout << gb.wbox << " " << 0 << " rlineto\n"; fout << 0 << " " << -gb.hbox << " rlineto\n"; fout << -gb.wbox << " " << 0 << " rlineto\n"; fout << "closepath stroke\n\n"; } } fout << "grestore" << '\n'; fout << "showpage" << '\n'; fout.close(); cout << ">>>>>>> WriteNewPSFileTime = " << ((clock()-time0)/1000000.0) << endl; } // ------------------------------------------------------------------- void WritePSFile(const char *filename, XImage *image, int imagesizehoriz, int imagesizevert, const Palette &palette) { clock_t time0 = clock(); ofstream fout(filename); fout << "%!PS-Adobe-2.0" << '\n'; fout << "%%BoundingBox: 0 0 " << imagesizehoriz-1 << " " << imagesizevert-1 << '\n'; fout << "gsave" << '\n'; fout << "/picstr " << (imagesizehoriz * 3) << " string def" << '\n'; fout << imagesizehoriz << " " << imagesizevert << " scale" << '\n'; fout << imagesizehoriz << " " << imagesizevert << " 8" << '\n'; fout << "[" << imagesizehoriz << " 0 0 -" << imagesizevert << " 0 " << imagesizevert << "]" << '\n'; fout << "{ currentfile picstr readhexstring pop }" << '\n'; fout << "false 3" << '\n'; fout << "colorimage"; // no << '\n'; fout << hex; char *buf = new char[8 * imagesizehoriz + 1]; unsigned char r, g, b; int charindex; for(int j(0); j < imagesizevert; ++j) { charindex = 0; for(int i(0); i < imagesizehoriz; ++i) { //BL_ASSERT(charindex>8*imagesizehoriz+1); //FIXME palette.unpixelate(XGetPixel(image, i, j), r, g, b); if(i % 10 == 0) { sprintf(buf+charindex, "\n"); ++charindex; } //fout << setw(2) << setfill('0') << (color.red >> 8); //fout << setw(2) << setfill('0') << (color.green >> 8); //fout << setw(2) << setfill('0') << (color.blue >> 8) << ' '; sprintf(buf+charindex, "%02x%02x%02x ", r, g, b); charindex += 7; } fout << buf; } delete [] buf; fout << "grestore" << '\n'; fout << "showpage" << '\n'; fout.close(); cout << "> > > > WritePSFileTime = " << ((clock()-time0)/1000000.0) << endl; } // ------------------------------------------------------------------- void WritePSPaletteFile(const char *filename, XImage *image, int imagesizehoriz, int imagesizevert, const Array &palValueList, const string &palNumFormat, const Palette& palette) { ofstream fout(filename); fout << "%!PS-Adobe-2.0" << '\n'; fout << "%%BoundingBox: 0 0 " << imagesizehoriz-1 << " " << imagesizevert-1 << '\n'; fout << "gsave" << '\n'; fout << "/picstr " << (imagesizehoriz * 3) << " string def" << '\n'; fout << imagesizehoriz << " " << imagesizevert << " scale" << '\n'; fout << imagesizehoriz << " " << imagesizevert << " 8" << '\n'; fout << "[" << imagesizehoriz << " 0 0 -" << imagesizevert << " 0 " << imagesizevert << "]" << '\n'; fout << "{ currentfile picstr readhexstring pop }" << '\n'; fout << "false 3" << '\n'; fout << "colorimage"; // no << '\n'; fout << hex; char *buf = new char[8*imagesizehoriz+1]; for(int j(0); j < imagesizevert; ++j) { int charindex(0); for(int i(0); i < imagesizehoriz; ++i) { //FIXME unsigned long index = (unsigned long) XGetPixel(image, i, j); unsigned char r, g, b; palette.unpixelate(index, r, g, b); if(i % 10 == 0) { sprintf(buf+charindex, "\n"); charindex++; } sprintf(buf+charindex, "%02x%02x%02x ", r, g, b); charindex += 7; } fout << buf; } fout << dec; fout << "grestore" << '\n'; fout << "0 setgray" << '\n'; fout << "24 0" << '\n'; fout << "120 " << imagesizevert-1 << '\n'; fout << "rectfill" << '\n'; int paletteHeight(216); int topOfPalette(256); double pSpacing((double) paletteHeight / (double) (palValueList.size() - 1)); int palSpacing = int(ceil(pSpacing)) + 1; fout << "/Palatino-Roman findfont" << '\n' << "20 scalefont" << '\n' << "setfont\n1 setgray" << '\n'; for(int j(0); j < palValueList.size(); ++j) { fout << "40 " << topOfPalette - ( j * palSpacing) << " moveto" << '\n'; fout << "("; char dummyString[50];//should be big enough sprintf(dummyString, palNumFormat.c_str(), palValueList[j]); fout << dummyString << ") show" << '\n'; } fout << "showpage" << '\n'; fout.close(); } // ------------------------------------------------------------------- void WriteRGBFile(const char *filename, XImage *ximage, int imagesizehoriz, int imagesizevert, const Palette& palette) { unsigned short rbuf[8192]; unsigned short gbuf[8192]; unsigned short bbuf[8192]; int xsize, ysize; IMAGE *image; xsize = imagesizehoriz; ysize = imagesizevert; //image = iopen(filename, RLE(1), 3, xsize, ysize, 3); // no support for RLE. image = iopen(filename, VERBATIM(1), 3, xsize, ysize, 3); Pixel index; unsigned char r, g, b; for(int y(0); y < ysize; ++y) { /* fill rbuf, gbuf, and bbuf with pixel values */ for(int x(0); x < xsize; ++x) { index = XGetPixel(ximage,x,y); palette.unpixelate(index, r, g, b); rbuf[x] = r; gbuf[x] = g; bbuf[x] = b; } putrow(image,rbuf,ysize-1-y,0); /* red row */ putrow(image,gbuf,ysize-1-y,1); /* green row */ putrow(image,bbuf,ysize-1-y,2); /* blue row */ } iclose(image); } // ------------------------------------------------------------------- void WritePPMFile(const char *filename, XImage *ximage, int imagesizehoriz, int imagesizevert, const Palette &palette) { std::ofstream img(filename, std::ios::binary); if( ! img) { BoxLib::Error("failed to open image file for writing"); } int xsize(imagesizehoriz); int ysize(imagesizevert); unsigned char *ivdata = new unsigned char[3 * xsize * ysize]; Pixel index; unsigned char r,g,b; int cnt(0); for(int y(0); y < ysize; ++y) { for(int x(0); x < xsize; ++x) { index = XGetPixel(ximage, x, y); palette.unpixelate(index, r, g, b); ivdata[cnt++] = r; ivdata[cnt++] = g; ivdata[cnt++] = b; } } BL_ASSERT(cnt == 3*xsize*ysize); img << "P6" << endl << xsize << " " << ysize << endl << 255 << endl; img.write(reinterpret_cast(ivdata), xsize*ysize*3); if( ! img) { BoxLib::Error("failed to write on image file"); } delete [] ivdata; } #ifdef BL_Linux #define _IOWRT 0002 #define _IOERR 0040 #define _IORW 0400 #endif #ifdef BL_CYGWIN_NT #define _IOWRT 0002 #define _IOERR 0040 #define _IORW 0400 #endif // ------------------------------------------------------------- IMAGE *iopen(const char *file, unsigned int type, unsigned int dim, unsigned int xsize, unsigned int ysize, unsigned int zsize) { IMAGE *image; int fdesc(0); image = new IMAGE; fdesc = creat(file, 0666); if(fdesc < 0) { cerr << "iopen: can't open output file " << file << endl; return NULL; } image->imagic = IMAGIC; image->type = type; image->xsize = xsize; image->ysize = 1; image->zsize = 1; if(dim > 1) { image->ysize = ysize; } if(dim > 2) { image->zsize = zsize; } if(image->zsize == 1) { image->dim = 2; if(image->ysize == 1) { image->dim = 1; } } else { image->dim = 3; } image->min = 10000000; image->max = 0; strncpy(image->name,"no name",80); image->wastebytes = 0; image->dorev = 0; if(write(fdesc,image,sizeof(IMAGE)) != sizeof(IMAGE)) { cerr << "iopen: error on write of image header" << endl; return NULL; } image->flags = _IOWRT; image->cnt = 0; image->ptr = 0; image->base = 0; if( (image->tmpbuf = new unsigned short[IBUFSIZE(image->xsize)]) == 0 ) { cerr << "iopen: error on tmpbuf alloc " << image->xsize << endl; return NULL; } image->x = image->y = image->z = 0; image->file = fdesc; image->offset = 512L; // set up for img_optseek lseek(image->file, 512L, 0); return(image); } // end iopen //---------------------------------------------------------------- int putrow(IMAGE *image, unsigned short *buffer, unsigned int y, unsigned int z) { unsigned short *sptr; unsigned char *cptr; unsigned int x; unsigned long min, max; long cnt; if( ! (image->flags & (_IORW|_IOWRT)) ) { cerr << "Error 1 in putrow." << endl; return -1; } if(image->dim < 3) { z = 0; } if(image->dim < 2) { y = 0; } if(ISVERBATIM(image->type)) { switch(BPP(image->type)) { case 1: min = image->min; max = image->max; cptr = (unsigned char *)image->tmpbuf; sptr = buffer; for(x=image->xsize; x--;) { *cptr = *sptr++; if(*cptr > max) max = *cptr; if(*cptr < min) min = *cptr; ++cptr; } image->min = min; image->max = max; img_seek(image,y,z); cnt = image->xsize; if(img_write(image,(const void *)image->tmpbuf,cnt) != cnt) { cerr << "Error 2 in putrow." << endl; return -1; } else { return cnt; } // NOTREACHED case 2: cerr << "2 bytes per pixel not supported" << endl; return -1; default: cerr << "putrow: weird bpp" << endl; } } else if(ISRLE(image->type)) { cerr << "RLE not supported" << endl; } else { cerr << "putrow: weird image type" << endl; } return 0; } // ------------------------------------------------------------- int img_optseek(IMAGE *image, unsigned long offset) { if(image->offset != offset) { image->offset = offset; return lseek(image->file,offset,0); } return offset; } // ------------------------------------------------------------- int img_seek(IMAGE *image, unsigned int y, unsigned int z) { if(y >= image->ysize || z >= image->zsize) { cerr << "img_seek: row number out of range" << endl; return EOF; } image->x = 0; image->y = y; image->z = z; if(ISVERBATIM(image->type)) { switch(image->dim) { case 1: return img_optseek(image, 512L); case 2: return img_optseek(image,512L+(y*image->xsize)*BPP(image->type)); case 3: return img_optseek(image, 512L+(y*image->xsize+z*image->xsize*image->ysize)* BPP(image->type)); default: cerr << "img_seek: weird dim" << endl; break; } } else if(ISRLE(image->type)) { cerr << "RLE not supported" << endl; } else { cerr << "img_seek: weird image type" << endl; } return 0; } // ------------------------------------------------------------- int img_write(IMAGE *image, const void *buffer, long count) { long retval; retval = write(image->file,buffer,count); if(retval == count) { image->offset += count; } else { image->offset = 0; } return retval; } // ------------------------------------------------------------------- int iclose(IMAGE *image) { int ret; unsigned short *base; if((image->flags&_IOWRT) && (base=image->base)!=NULL && (image->ptr-base)>0) { if(putrow(image, base, image->y,image->z)!=image->xsize) { image->flags |= _IOERR; return(EOF); } } img_optseek(image, 0); if(image->flags & _IOWRT) { if(image->dorev) { cvtimage((long *) image); } if(img_write(image,(const void *)image,sizeof(IMAGE)) != sizeof(IMAGE)) { cerr << "iclose: error on write of image header" << endl; return EOF; } if(image->dorev) { cvtimage((long *) image); } } if(image->base) { delete image->base; image->base = 0; } if(image->tmpbuf) { delete [] image->tmpbuf; image->tmpbuf = 0; } ret = close(image->file); delete image; return ret; } // ------------------------------------------------------------------- void cvtlongs(long buffer[], long n) { short i; long nlongs = n>>2; unsigned long lwrd; for(i = 0; i < nlongs; ++i) { lwrd = buffer[i]; buffer[i] = ((lwrd>>24) | (lwrd>>8 & 0xff00) | (lwrd<<8 & 0xff0000) | (lwrd<<24) ); } } //---------------------------------------------------------------- void cvtshorts(unsigned short buffer[], long n) { short i; long nshorts = n>>1; unsigned short swrd; for(i = 0; i < nshorts; ++i) { swrd = *buffer; *buffer++ = (swrd>>8) | (swrd<<8); } } // ------------------------------------------------------------------- void cvtimage(long *buffer) { cvtshorts((unsigned short *) buffer, 12); cvtlongs(buffer+3, 12); cvtlongs(buffer+26, 4); } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Quaternion.H0000644000175000017500000001133211634153073021536 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Quaternion.H,v 1.7 2000/11/22 00:23:45 vince Exp $ // // --------------------------------------------------------------- // Quaternion.H // --------------------------------------------------------------- #ifndef _AMR_QUATERNION_H_ #define _AMR_QUATERNION_H_ #include "REAL.H" #include "Point.H" /*************************************************************************** A quaternion represents a rotation of a rigid body in Euclidean three-dimensional space. (These quaternions all are normalized so that the sum of the squares of the components is one.) If the rotation is counterclockwise by an angle alpha about axis n, then the corresponding quaternion is [ cos(alpha/2), sin(alpha/2) n ] Multiplication of normalized quaternions corresponds to composition of these rotations: q * r means do rotation r first, then q. The operator *= does right multiplication by the argument, so q *= r means q = q*r . This seems to be more natural for the usual applications where r is an increment which is successively applied to a position q. ***************************************************************************/ class AmrQuaternion { Real w, x, y, z; public: AmrQuaternion() { w=1.; x=y=z=0.; } // The identity rotation AmrQuaternion(Real W, Real X, Real Y, Real Z) { w=W; x=X; y=Y; z=Z; } AmrQuaternion(Real, Real, Real, Real, Real, Real); //returns a quaternion that rotates p1 to p2 AmrQuaternion(const AmrSpherePoint &p1, const AmrSpherePoint &p2); AmrQuaternion operator *(const AmrQuaternion &q) const;//right-mult by q AmrQuaternion operator /(const AmrQuaternion &q) const;//right-mult by q^-1 AmrQuaternion operator *=(const AmrQuaternion &q); //right-mult by q AmrQuaternion operator /=(const AmrQuaternion &q); //right-mult by q^-1 friend AmrQuaternion inverse(const AmrQuaternion &q);// inverse Real InfNorm() const; void tomatrix( Real m[4][4] ) const; Real QW() const { return w; } Real QX() const { return x; } Real QY() const { return y; } Real QZ() const { return z; } friend ostream& operator<<( ostream &s, const AmrQuaternion &q); }; inline AmrQuaternion AmrQuaternion::operator *(const AmrQuaternion &q) const { return AmrQuaternion( w*q.w - x*q.x - y*q.y - z*q.z, x*q.w + w*q.x + y*q.z - z*q.y, y*q.w + w*q.y + z*q.x - x*q.z, z*q.w + w*q.z + x*q.y - y*q.x ); } inline AmrQuaternion AmrQuaternion::operator /(const AmrQuaternion &q) const { return AmrQuaternion( w*q.w + x*q.x + y*q.y + z*q.z, x*q.w - w*q.x - y*q.z + z*q.y, y*q.w - w*q.y - z*q.x + x*q.z, z*q.w - w*q.z - x*q.y + y*q.x ); } inline AmrQuaternion AmrQuaternion::operator *=(const AmrQuaternion &q) { Real ww = w*q.w - x*q.x - y*q.y - z*q.z; Real xx = x*q.w + w*q.x + y*q.z - z*q.y; Real yy = y*q.w + w*q.y + z*q.x - x*q.z; Real zz = z*q.w + w*q.z + x*q.y - y*q.x; w=ww; x=xx; y=yy; z=zz; return *this; } inline AmrQuaternion AmrQuaternion::operator /=(const AmrQuaternion &q) { Real ww = w*q.w + x*q.x + y*q.y + z*q.z; Real xx = x*q.w - w*q.x - y*q.z + z*q.y; Real yy = y*q.w - w*q.y - z*q.x + x*q.z; Real zz = z*q.w - w*q.z - x*q.y + y*q.x; w=ww; x=xx; y=yy; z=zz; return *this; } inline AmrQuaternion inverse(const AmrQuaternion &q) { return AmrQuaternion( q.w, -q.x, -q.y, -q.z ); } inline ostream& operator << ( ostream &s, const AmrQuaternion &q) { return s << "AmrQuaternion( " << q.w << " , " << q.x << " , " << q.y << " , " << q.z << " )"; } #endif // ndef _AMR_QUATERNION_H_ ccseapps-2.5/CCSEApps/pAmrvis/ViewTransform.H0000644000175000017500000000716711634153073022232 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ViewTransform.H,v 1.14 2001/10/17 17:53:33 lijewski Exp $ // // --------------------------------------------------------------- // ViewTransform.H // --------------------------------------------------------------- #ifndef _VIEWTRANSFORM_H_ #define _VIEWTRANSFORM_H_ #include using std::iostream; #include "REAL.H" #include "Quaternion.H" typedef Real MatrixFour[4][4]; class ViewTransform { public: ViewTransform(); ~ViewTransform(); void MakeTransform(); // should be called after adjusting parameters void TransformPoint(Real x, Real y, Real z, Real &pX, Real &pY, Real &pZ); void Print() const; void GetRotationMat(MatrixFour m); void ViewRotationMat() const; void GetRenderRotationMat(MatrixFour m); void ViewRenderRotationMat() const; void SetAspect(Real apct) { vtAspect = apct; } AmrQuaternion GetRotation() { return rotation; } void SetRotation(AmrQuaternion quat) { rotation = quat; } AmrQuaternion GetRenderRotation() { return renderRotation; } void SetRenderRotation(AmrQuaternion quat) { renderRotation = quat; } void SetObjCenter(Real x, Real y, Real z) { objCenterX = x; objCenterY = y; objCenterZ = z; } void SetScreenPosition(int x, int y) { screenPositionX = x; screenPositionY = y; } void SetScale(Real s) { scale = s; } Real GetScale(void) { return scale; } void SetAdjustments(Real len, int width, int height); void MakeTranslation(int x1, int y1, int x2, int y2, Real bS); void ResetTranslation() { boxTransX = renTransX = boxTransY = renTransY = 0.0; } Real GetRenTransX() const { return boxTransX; } Real GetRenTransY() const { return boxTransY; } void SetRenTransX(Real newRenTransX) { renTransX = newRenTransX; } void SetRenTransY(Real newRenTransY) { renTransY = newRenTransY; } Real InfNorm(); AmrQuaternion Screen2Quat(int, int, int, int, Real); void SetAdjust(Real txA, Real tyA) { txAdjust = txA; tyAdjust = tyA; } private: Real scale, boxTransX, boxTransY, renTransX, renTransY; AmrQuaternion rotation, renderRotation; int screenPositionX, screenPositionY; Real objCenterX, objCenterY, objCenterZ; MatrixFour mRotation, mRenderRotation; Real txAdjust, tyAdjust; Real vtAspect; }; ostream& operator << (ostream &, const ViewTransform &); #endif ccseapps-2.5/CCSEApps/pAmrvis/GNUmakefile0000644000175000017500000001130611634153073021353 0ustar amckinstryamckinstryPRECISION = FLOAT PRECISION = DOUBLE PROFILE = TRUE PROFILE = FALSE # use mpKCC for the sp COMP = mpKCC COMP = KCC COMP = g++ FCOMP = Intel FCOMP = DEBUG = FALSE DEBUG = TRUE DIM = 2 DIM = 3 NAMESPACE = FALSE NAMESPACE = TRUE STRICTLY = FALSE STRICTLY = TRUE USE_ARRAYVIEW = TRUE USE_ARRAYVIEW = FALSE USE_MPI=TRUE USE_MPI=FALSE USE_VOLRENDER = FALSE USE_VOLRENDER = TRUE USE_PARALLELVOLRENDER = TRUE USE_PARALLELVOLRENDER = FALSE PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) include ../mk/Make.defs EBASE = amrvis HERE = . INCLUDE_LOCATIONS += $(HERE) #INCLUDE_LOCATIONS += ../pBoxLib_2 INCLUDE_LOCATIONS += ../BoxLib #INCLUDE_LOCATIONS += ../BoxLib/std DEFINES += -DBL_PARALLEL_IO ifeq ($(MACHINE),OSF1) ifeq ($(COMP),KCC) CXXFLAGS += --diag_suppress 837 endif endif ifeq ($(MACHINE),T3E) ifeq ($(COMP),KCC) CXXFLAGS += --diag_suppress 837 endif endif ifeq ($(MACHINE),AIX) ifeq ($(COMP),KCC) CXXFLAGS += --diag_suppress 837 endif endif ############################################### x includes and libraries ifeq ($(MACHINE), OSF1) LIBRARIES += -lXm -lXt -lX11 endif ifeq ($(MACHINE), Linux) INCLUDE_LOCATIONS += /usr/X11R6/include LIBRARY_LOCATIONS += /usr/X11R6/lib LIBRARIES += -lXm -lXp -lXt -lXext -lSM -lICE -lXpm -lX11 # Joe Grcar 1/9/03: per Vince, the following line is needed on battra # so I have left it here in commented-out form. # LIBRARIES += -LlibXm.so.2.1 endif ifeq ($(MACHINE), AIX) INCLUDE_LOCATIONS += /usr/include/X11 INCLUDE_LOCATIONS += /usr/include/Xm #INCLUDE_LOCATIONS += /usr/include/X11/Xaw LIBRARIES += -lXm -lXt -lX11 DEFINES += -D_ALL_SOURCE endif ifeq ($(MACHINE), T3E) ifeq ($(WHICHT3E), NERSC) INCLUDE_LOCATIONS += /opt/ctl/cvt/3.1.0.0/include/X11 INCLUDE_LOCATIONS += /opt/ctl/cvt/3.1.0.0/include/Xm INCLUDE_LOCATIONS += /opt/ctl/cvt/3.1.0.0/include INCLUDE_LOCATIONS += /opt/ctl/cvt/3.1.0.0/include/X11/Xaw LIBRARY_LOCATIONS += /opt/ctl/cvt/cvt/lib LIBRARIES += -lXm -lSM -lICE -lXt -lX11 endif ifeq ($(WHICHT3E), ARSC) INCLUDE_LOCATIONS += /opt/ctl/cvt/3.1.0.0/include/X11 INCLUDE_LOCATIONS += /opt/ctl/cvt/3.1.0.0/include/Xm INCLUDE_LOCATIONS += /opt/ctl/cvt/3.1.0.0/include/X11/Xaw LIBRARY_LOCATIONS += /opt/ctl/cvt/cvt/lib LIBRARIES += -lXm -lSM -lICE -lXt -lX11 endif endif ifeq ($(MACHINE), CYGWIN_NT) #INCLUDE_LOCATIONS += /cygdrive/c/usr/X11R6/include #LIBRARY_LOCATIONS += /cygdrive/c/usr/X11R6/lib INCLUDE_LOCATIONS += /usr/X11R6/include LIBRARY_LOCATIONS += /usr/X11R6/lib #CXXFLAGS += -fpermissive #CXXFLAGS += -x c++ # LDFLAGS += -noinhibit-exec LIBRARIES += -lXm -lXt -lSM -lICE -lXpm -lX11 endif ############################################### arrayview ifeq (USE_ARRAYVIEW, TRUE) DEFINES += -DBL_USE_ARRAYVIEW ARRAYVIEWDIR = . INCLUDE_LOCATIONS += $(ARRAYVIEWDIR) #LIBRARY_LOCATIONS += $(ARRAYVIEWDIR) #LIBRARIES += -larrayview$(DIM)d.$(machineSuffix) endif ############################################### volume rendering ifeq ($(DIM),3) ifeq ($(MACHINE), T3E) USE_VOLRENDER = FALSE endif ifeq ($(MACHINE), AIX) USE_VOLRENDER = FALSE endif ifeq ($(USE_VOLRENDER), TRUE) DEFINES += -DBL_VOLUMERENDER # VOLPACKDIR = ../../volpack/volpack_cpp # VOLPACKDIR = ../../volpack/volpack-1.0b3 #VOLPACKDIR = $(PBOXLIB_HOME)/volpack VOLPACKDIR = ../volpack #VOLPACKDIR = ../../volpack.test #VOLPACKDIR = ../../volpack INCLUDE_LOCATIONS += $(VOLPACKDIR) LIBRARY_LOCATIONS += $(VOLPACKDIR) LIBRARIES += -lvolpack #DEFINES += -DVOLUMEBOXES endif endif ############################################### parallel volume rendering ifeq ($(DIM),3) ifeq ($(USE_PARALLELVOLRENDER), TRUE) DEFINES += -DBL_PARALLELVOLUMERENDER endif endif ############################################### other defines #DEFINES += -DSCROLLBARERROR #DEFINES += -DFIXDENORMALS ############################################### float fix # if we are using float override FOPTF which sets -real_size 64 ifeq ($(PRECISION), FLOAT) ifeq ($(MACHINE), OSF1) FDEBF += -C FDEBF += -fpe2 #FDEBF += -fpe0 FOPTF = -fast -O5 -tune ev5 endif endif #FDEBF += -fpe1 #FOPTF = -fpe1 ############################################### 3rd analyzer #CXXDEBF = +K0 --link_command_prefix 3rd #LIBRARIES += -ldnet_stub #CFLAGS += -g #XTRALIBS += include $(HERE)/Make.package #include $(PBOXLIB_HOME)/pBoxLib_2/Make.package include $(PBOXLIB_HOME)/BoxLib/Make.package #vpath %.cpp $(HERE) ../pBoxLib_2 #vpath %.H $(HERE) ../pBoxLib_2 vpath %.cpp $(HERE) ../BoxLib vpath %.H $(HERE) ../BoxLib vpath %.F $(HERE) ../BoxLib vpath %.f $(HERE) ../BoxLib vpath %.a $(LIBRARY_LOCATIONS) all: $(executable) include ../mk/Make.rules ccseapps-2.5/CCSEApps/pAmrvis/Dataset.H0000644000175000017500000001075311634153073021004 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Dataset.H,v 1.30 2003/02/12 23:01:48 vince Exp $ // // --------------------------------------------------------------- // Dataset.H // --------------------------------------------------------------- #ifndef _DATASET_H_ #define _DATASET_H_ #include #undef index #include "Dataset.H" #include "GlobalUtilities.H" #include "GraphicsAttributes.H" #include "Box.H" #include "AmrvisConstants.H" const int MAXSTRINGWIDTH = 64; class PltApp; class PltAppState; class AmrPicture; class DataServices; class StringLoc; class Dataset { public: Dataset(const Box &alignedRegion, AmrPicture *apptr, PltApp *pltappptr, PltAppState *pltappstateptr, int hdir, int vdir, int sdir); ~Dataset(); void DatasetRender(const Box &alignedRegion, AmrPicture *apptr, PltApp *pltappptr, PltAppState *pltappstateptr, int hdir, int vdir, int sdir); void DrawIndices(); void DoRaise(); void DoExpose(int fromExpose); static void CBColorButton(Widget, XtPointer, XtPointer); static void CBQuitButton(Widget, XtPointer, XtPointer); static void CBPixInput(Widget, XtPointer, XtPointer); static void CBEndScrolling(Widget, XtPointer, XtPointer); static void CBScrolling(Widget, XtPointer, XtPointer); static void CBDoExposeDataset(Widget, XtPointer, XEvent *, Boolean *); void DoColorButton(); void DoQuitButton(); void DoPixInput(XmDrawingAreaCallbackStruct *); AmrPicture *GetAmrPicturePtr() { return amrPicturePtr; } private: Widget wDatasetTopLevel, wDatasetForm; Widget wDatasetTools, wScrollArea, wPixArea; Widget wFormat, wColorButton, wQuitButton, wLevels, wMinValue, wMaxValue; Arg args[MAXARGS]; Box *datasetRegion; unsigned int pixSizeX, pixSizeY; int dataItemWidth, dataItemHeight; int maxAllowableLevel, maxDrawnLevel, minDrawnLevel, stringOk; int noData, hDIR, vDIR, sDIR, numStrings, *myStringCount; char buffer[BUFSIZ], dataString[MAXSTRINGWIDTH]; StringLoc *dataStringArray, **myDataStringArray; bool bDataStringArrayAllocated; AmrPicture *amrPicturePtr; DataServices *dataServicesPtr; PltApp *pltAppPtr; PltAppState *pltAppStatePtr; GraphicsAttributes *gaPtr; int dragging, drags; int hStringOffset, vStringOffset; string hAxisString, vAxisString; int indexWidth, indexHeight; int hScrollBarPos, vScrollBarPos; int hIndexAreaHeight, hIndexAreaStart, hIndexAreaEnd; int vIndexAreaWidth, vIndexAreaStart, vIndexAreaEnd; int xh, yv; Dimension width, height; StringLoc **hIndexArray, **vIndexArray; bool datasetPoint; Atom WM_DELETE_WINDOW; Pixel blackIndex, whiteIndex; void DrawGrid(int startX, int startY, int finishX, int finishY, int gridspacingX, int gridspacingY, int foregroundIndex, int backgroundIndex); void DrawGrid(int startX, int startY, int finishX, int finishY, int refRatio, int foregroundIndex, int backgroundIndex); }; class StringLoc { public: StringLoc() { } ~StringLoc() { } char ds[MAXSTRINGWIDTH]; int xloc, yloc, color, olflag, dslen; }; #endif // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/VolRender.cpp0000644000175000017500000010426511634153073021714 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: VolRender.cpp,v 1.48 2003/02/12 23:02:23 vince Exp $ // // --------------------------------------------------------------- // VolRender.cpp // --------------------------------------------------------------- #include "VolRender.H" #include "DataServices.H" #include "GlobalUtilities.H" #include "ParallelDescriptor.H" #include #include using std::cerr; using std::cout; using std::endl; using std::max; using std::min; #include #include #include extern Real RadToDeg(Real angle); extern Real DegToRad(Real angle); #define CheckVP(vpret, n) \ if(vpret != VP_OK) { \ cerr << "VolPack error " << n << ": " \ << vpGetErrorString(vpGetError(vpc)) << endl; \ exit(-4); \ } // ------------------------------------------------------------------- VolRender::VolRender(const Array &drawdomain, int mindrawnlevel, int maxdrawnlevel, Palette *paletteptr, const string &asLightFileName) { bDrawAllBoxes = false; minDrawnLevel = mindrawnlevel; maxDataLevel = maxdrawnlevel; drawnDomain = drawdomain; vpDataValid = false; swfDataValid = false; swfDataAllocated = false; palettePtr = paletteptr; preClassify = true; // these are the defaults ambientMat = 0.28; diffuseMat = 0.35; specularMat = 0.39; shinyMat = 10.0; minRayOpacity = 0.05; maxRayOpacity = 0.95; Real ambient, diffuse, specular, shiny, minray, maxray; bool bFileOk = AVGlobals::ReadLightingFile(asLightFileName, ambient, diffuse, specular, shiny, minray, maxray); if(bFileOk) { if(0.0 > ambient || ambient > 1.0) { cerr << "Error: ambient value must be in the range (0.0, 1.0)." << endl; } else { ambientMat = ambient; } if(0.0 > diffuse || diffuse > 1.0) { cerr << "Error: diffuse value must be in the range (0.0, 1.0)." << endl; } else { diffuseMat = diffuse; } if(0.0 > specular || specular > 1.0) { cerr << "Error: specular value must be in the range (0.0, 1.0)." << endl; } else { specularMat = specular; } shinyMat = shiny; if(0.0 > minray || minray > 1.0) { cerr << "Error: minray value must be in the range (0.0, 1.0)." << endl; } else { minRayOpacity = minray; } if(0.0 > maxray || maxray > 1.0) { cerr << "Error: maxray value must be in the range (0.0, 1.0)." << endl; } else { maxRayOpacity = maxray; } } volData = NULL; voxelFields = 3; //voxel field variables: static RawVoxel* dummy_voxel; normalField = 0; normalOffset = vpFieldOffset(dummy_voxel, normal); normalSize = 2; // sizeof(short); on a t3e this will want to be 2 normalMax = VP_NORM_MAX; densityField = 1; densityOffset = vpFieldOffset(dummy_voxel, density); densitySize = sizeof(unsigned char); densityMax = 255; gradientField = 2; gradientOffset = vpFieldOffset(dummy_voxel, gradient); gradientSize = sizeof(unsigned char); gradientMax = 255; lightingModel = true; paletteSize = 256; if(ParallelDescriptor::IOProcessor()) { // must initialize vpc before calling ReadTransferFile vpc = vpCreateContext(); maxDenRampPts = densityMax + 1; maxShadeRampPts = normalMax + 1; density_ramp.resize(maxDenRampPts); shade_table.resize(maxShadeRampPts); value_shade_table.resize(paletteSize); maxGradRampPts = gradientMax + 1; gradient_ramp.resize(maxGradRampPts); SetProperties(); rows = drawnDomain[maxDataLevel].length(XDIR); cols = drawnDomain[maxDataLevel].length(YDIR); planes = drawnDomain[maxDataLevel].length(ZDIR); // --- describe the layout of the volume vpResult vpret = vpSetVolumeSize(vpc, rows, cols, planes); CheckVP(vpret, 1); } bVolRenderDefined = true; } // end VolRender() // ------------------------------------------------------------------- VolRender::~VolRender() { BL_ASSERT(bVolRenderDefined); if(ParallelDescriptor::IOProcessor()) { //cout << "_in VolRender::~VolRender(): volData = " << volData << endl; vpDestroyContext(vpc); //cout << "_after vpDestroyContext: volData = " << volData << endl; delete [] volData; //cout << "_after delete [] volData: volData = " << volData << endl; if(swfDataAllocated) { delete [] swfData; } } } // ------------------------------------------------------------------- bool VolRender::AllocateSWFData() { BL_ASSERT(bVolRenderDefined); // --- create the big array swfDataSize = drawnDomain[maxDataLevel].numPts(); cout << "swfData box size = " << drawnDomain[maxDataLevel] << " " << swfDataSize << endl; swfData = new unsigned char[swfDataSize]; if(swfData == NULL) { cerr << "Error in AmrPicture::ChangeDerived: could not allocate " << swfDataSize << " bytes for swfData." << endl; swfDataAllocated = false; } else { swfDataAllocated = true; } return swfDataAllocated; } // ------------------------------------------------------------------- void VolRender::MakeSWFData(DataServices *dataServicesPtr, Real rDataMin, Real rDataMax, const string &derivedName, int iPaletteStart, int iPaletteEnd, int iBlackIndex, int iWhiteIndex, int iColorSlots, const bool bdrawboxes) { BL_ASSERT(bVolRenderDefined); if(swfDataValid) { return; } bDrawAllBoxes = bdrawboxes; if( ! swfDataAllocated) { if(ParallelDescriptor::IOProcessor()) { swfDataAllocated = AllocateSWFData(); } else { swfDataAllocated = true; } } swfDataValid = true; clock_t time0 = clock(); int maxDrawnLevel(maxDataLevel); Box grefbox; Box swfDataBox(drawnDomain[maxDrawnLevel]); FArrayBox swfFabData; if(ParallelDescriptor::IOProcessor()) { swfFabData.resize(swfDataBox, 1); } DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) &swfFabData, (void *) &swfDataBox, maxDrawnLevel, (void *) &derivedName); if(ParallelDescriptor::IOProcessor()) { Real gmin(rDataMin); Real gmax(rDataMax); Real globalDiff = gmax - gmin; Real oneOverGDiff; if(globalDiff < FLT_MIN) { oneOverGDiff = 0.0; // so we dont divide by zero } else { oneOverGDiff = 1.0 / globalDiff; } int cSlotsAvail = iColorSlots - 1; cout << "Filling swfFabData..." << endl; // copy data into swfData and change to chars Real dat; char chardat; Real *dataPoint = swfFabData.dataPtr(); int sindexbase; int srows = swfDataBox.length(XDIR); int scols = swfDataBox.length(YDIR); //int splanes = swfDataBox.length(ZDIR); int scolssrowstmp = scols*srows; int sstartr = swfDataBox.smallEnd(XDIR); //int sstartc = swfDataBox.smallEnd(YDIR); int sstartp = swfDataBox.smallEnd(ZDIR); //int sendr = swfDataBox.bigEnd(XDIR); int sendc = swfDataBox.bigEnd(YDIR); //int sendp = swfDataBox.bigEnd(ZDIR); Box gbox(swfDataBox); Box goverlap(gbox & drawnDomain[maxDrawnLevel]); int gstartr = gbox.smallEnd(XDIR); int gstartc = gbox.smallEnd(YDIR); int gstartp = gbox.smallEnd(ZDIR); int gostartr = goverlap.smallEnd(XDIR) - gstartr; int gostartc = goverlap.smallEnd(YDIR) - gstartc; int gostartp = goverlap.smallEnd(ZDIR) - gstartp; int goendr = goverlap.bigEnd(XDIR) - gstartr; int goendc = goverlap.bigEnd(YDIR) - gstartc; int goendp = goverlap.bigEnd(ZDIR) - gstartp; int grows = gbox.length(XDIR); int gcols = gbox.length(YDIR); //int gplanes = gbox.length(ZDIR); int gcolsgrowstmp(gcols * grows); int gpgcgrtmp, gcgrowstmp; int gprev; for(int gp(gostartp); gp <= goendp; ++gp) { gpgcgrtmp = gp*gcolsgrowstmp; for(int gc(gostartc); gc <= goendc; ++gc) { gcgrowstmp = gpgcgrtmp + gc*grows; for(int gr(gostartr); gr <= goendr; ++gr) { //dat = dataPoint[(gp*gcols*grows)+(gc*grows)+gr]; // works dat = dataPoint[gcgrowstmp + gr]; dat = max(dat,gmin); // clip data if out of range dat = min(dat,gmax); chardat = (char) (((dat-gmin)*oneOverGDiff)*cSlotsAvail); chardat += (char) iPaletteStart; gprev = gostartp + goendp - gp; sindexbase = //(((gp+gstartp)-sstartp) * scolssrowstmp) + (((gprev+gstartp)-sstartp) * scolssrowstmp) + ((sendc-((gc+gstartc))) * srows) + // check this ((gr+gstartr)-sstartr); swfData[sindexbase] = chardat; } } } // end for(gp...) // ---------------- VolumeBoxes bool bDrawVolumeBoxes(AVGlobals::GetBoxColor() > -1); // need to limit // to palmaxindex if(bDrawVolumeBoxes) { int edger, edgec, edgep; int volumeBoxColor(AVGlobals::GetBoxColor()); int gr, gc, gp, sr, sc, sp, sindex; AmrData &amrData = dataServicesPtr->AmrDataRef(); if(bDrawAllBoxes) { for(int lev(minDrawnLevel); lev <= maxDrawnLevel; ++lev) { int crr(AVGlobals::CRRBetweenLevels(lev, maxDrawnLevel, amrData.RefRatio())); const BoxArray &gridBoxes = amrData.boxArray(lev); for(int iGrid(0); iGrid < gridBoxes.size(); ++iGrid) { gbox = gridBoxes[iGrid]; // grow high end by one to eliminate overlap //gbox.growHi(XDIR, 1); //gbox.growHi(YDIR, 1); //gbox.growHi(ZDIR, 1); // Box goverlap(gbox & drawnDomain[lev]); grefbox = goverlap; grefbox.refine(crr); int gprev; int gstartr(gbox.smallEnd(XDIR)); int gstartc(gbox.smallEnd(YDIR)); int gstartp(gbox.smallEnd(ZDIR)); int gostartr(goverlap.smallEnd(XDIR) - gstartr); int gostartc(goverlap.smallEnd(YDIR) - gstartc); int gostartp(goverlap.smallEnd(ZDIR) - gstartp); int goendr(goverlap.bigEnd(XDIR) - gstartr); int goendc(goverlap.bigEnd(YDIR) - gstartc); int goendp(goverlap.bigEnd(ZDIR) - gstartp); grows = gbox.length(XDIR); gcols = gbox.length(YDIR); if(crr != 1) { int gcolsgrowstmp(gcols * grows); int ddsez(drawnDomain[lev].smallEnd(ZDIR)); int ddbez(drawnDomain[lev].bigEnd(ZDIR)); for(gp = gostartp; gp <= goendp; ++gp) { gprev = ddsez + ddbez - (gp + gstartp); if(gp == gostartp || gp == goendp) { edgep = 1; } else { edgep = 0; } gpgcgrtmp = gp * gcolsgrowstmp; for(gc = gostartc; gc <= goendc; ++gc) { if(gc == gostartc || gc == goendc) { edgec = 1; } else { edgec = 0; } for(gr = gostartr; gr <= goendr; ++gr) { if(gr == gostartr || gr == goendr) { edger = 1; } else { edger = 0; } //sindexbase = (((gp + gstartp) * crr - sstartp) * scolssrowstmp) + sindexbase = (((gprev) * crr - sstartp) * scolssrowstmp) + ((sendc - ((gc + gstartc) * crr)) * srows) + ((gr + gstartr) * crr - sstartr); if((edger + edgec + edgep) > 1) { // (possibly) draw boxes into dataset int onEdger, onEdgec, onEdgep; for(sp = 0; sp < crr; ++sp) { if((gp==gostartp && sp==0) || (gp==goendp && sp == (crr-1))) { onEdgep = 1; } else { onEdgep = 0; } for(sc = 0; sc < crr; ++sc) { if((gc==gostartc && sc==0) || (gc==goendc && sc == (crr-1))) { onEdgec = 1; } else { onEdgec = 0; } for(sr = 0; sr < crr; ++sr) { if((gr==gostartr && sr==0) || (gr==goendr && sr == (crr-1))) { onEdger = 1; } else { onEdger = 0; } if((onEdger + onEdgec + onEdgep) > 1) { sindex = sindexbase + ((sp * scolssrowstmp) - (sc * srows) + sr); swfData[sindex] = volumeBoxColor; } } } } // end for(sp...) } } } } // end for(gp...) } else { // crr == 1 int ddsez(drawnDomain[lev].smallEnd(ZDIR)); int ddbez(drawnDomain[lev].bigEnd(ZDIR)); for(gp = gostartp; gp <= goendp; ++gp) { gprev = ddsez + ddbez - (gp + gstartp); if(gp == gostartp || gp == goendp) { edgep = 1; } else { edgep = 0; } for(gc = gostartc; gc <= goendc; ++gc) { if(gc == gostartc || gc == goendc) { edgec = 1; } else { edgec = 0; } for(gr = gostartr; gr <= goendr; ++gr) { if(gr == gostartr || gr == goendr) { edger = 1; } else { edger = 0; } if((edger + edgec + edgep) > 1) { sindexbase = //(((gp + gstartp) - sstartp) * scolssrowstmp) + ((gprev - sstartp) * scolssrowstmp) + ((sendc - ((gc + gstartc))) * srows) + ((gr + gstartr) - sstartr); swfData[sindexbase] = volumeBoxColor; } } } } // end for(gp...) } // end if(crr...) } // end for(iGrid...) } // end for(lev...) } else { // only draw the boundingbox int lev = minDrawnLevel; int crr(AVGlobals::CRRBetweenLevels(lev, maxDrawnLevel, amrData.RefRatio())); gbox = drawnDomain[lev]; Box goverlap(gbox & drawnDomain[lev]); grefbox = goverlap; grefbox.refine(crr); int gstartr(gbox.smallEnd(XDIR)); int gstartc(gbox.smallEnd(YDIR)); int gstartp(gbox.smallEnd(ZDIR)); int gostartr(goverlap.smallEnd(XDIR) - gstartr); int gostartc(goverlap.smallEnd(YDIR) - gstartc); int gostartp(goverlap.smallEnd(ZDIR) - gstartp); int goendr(goverlap.bigEnd(XDIR) - gstartr); int goendc(goverlap.bigEnd(YDIR) - gstartc); int goendp(goverlap.bigEnd(ZDIR) - gstartp); grows = gbox.length(XDIR); gcols = gbox.length(YDIR); if(crr != 1) { int gcolsgrowstmp(gcols * grows); for(gp = gostartp; gp <= goendp; ++gp) { if(gp == gostartp || gp == goendp) { edgep = 1; } else { edgep = 0; } gpgcgrtmp = gp * gcolsgrowstmp; for(gc = gostartc; gc <= goendc; ++gc) { if(gc == gostartc || gc == goendc) { edgec = 1; } else { edgec = 0; } for(gr = gostartr; gr <= goendr; ++gr) { if(gr == gostartr || gr == goendr) { edger = 1; } else { edger = 0; } sindexbase = (((gp + gstartp) * crr - sstartp) * scolssrowstmp) + ((sendc - ((gc + gstartc) * crr)) * srows) + ((gr + gstartr) * crr - sstartr); if((edger + edgec + edgep) > 1) { // (possibly) draw boxes into dataset int onEdger, onEdgec, onEdgep; for(sp = 0; sp < crr; ++sp) { if((gp==gostartp && sp==0) || (gp==goendp && sp == (crr-1))) { onEdgep = 1; } else { onEdgep = 0; } for(sc = 0; sc < crr; ++sc) { if((gc==gostartc && sc==0) || (gc==goendc && sc == (crr-1))) { onEdgec = 1; } else { onEdgec = 0; } for(sr = 0; sr < crr; ++sr) { if((gr==gostartr && sr==0) || (gr==goendr && sr == (crr-1))) { onEdger = 1; } else { onEdger = 0; } if((onEdger + onEdgec + onEdgep) > 1) { sindex = sindexbase + ((sp * scolssrowstmp) - (sc * srows) + sr); swfData[sindex] = volumeBoxColor; } } } } // end for(sp...) } } } } // end for(gp...) } else { // crr == 1 int gcolsgrowstmp(gcols * grows); for(gp = gostartp; gp <= goendp; ++gp) { if(gp == gostartp || gp == goendp) { edgep = 1; } else { edgep = 0; } gpgcgrtmp = gp * gcolsgrowstmp; for(gc = gostartc; gc <= goendc; ++gc) { if(gc == gostartc || gc == goendc) { edgec = 1; } else { edgec = 0; } for(gr = gostartr; gr <= goendr; ++gr) { if(gr == gostartr || gr == goendr) { edger = 1; } else { edger = 0; } if((edger + edgec + edgep) > 1) { sindexbase = (((gp + gstartp) - sstartp) * scolssrowstmp) + ((sendc - ((gc + gstartc))) * srows) + ((gr + gstartr) - sstartr); swfData[sindexbase] = volumeBoxColor; } } } } // end for(gp...) } // end if(crr...) } // end if(bDrawAllBoxes) } // end if(bDrawVolumeBoxes) } // end if(ParallelDescriptor::IOProcessor()) // fix up cartgrid body AmrData &amrData = dataServicesPtr->AmrDataRef(); const string vfracName = "vfrac"; if(amrData.CartGrid() && derivedName != vfracName) { // reuse swfFabData DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) &swfFabData, (void *) &swfDataBox, maxDrawnLevel, (void *) &vfracName); if(ParallelDescriptor::IOProcessor()) { char bodyColor = (char) palettePtr->BodyIndex(); Real *dataPoint = swfFabData.dataPtr(); Real vfeps = amrData.VfEps(maxDrawnLevel); int sindexbase; int srows = swfDataBox.length(XDIR); int scols = swfDataBox.length(YDIR); int scolssrowstmp = scols*srows; int sstartr = swfDataBox.smallEnd(XDIR); int sstartp = swfDataBox.smallEnd(ZDIR); int sendc = swfDataBox.bigEnd(YDIR); Box gbox(swfDataBox); Box goverlap(gbox & drawnDomain[maxDrawnLevel]); int gstartr = gbox.smallEnd(XDIR); int gstartc = gbox.smallEnd(YDIR); int gstartp = gbox.smallEnd(ZDIR); int gostartr = goverlap.smallEnd(XDIR) - gstartr; int gostartc = goverlap.smallEnd(YDIR) - gstartc; int gostartp = goverlap.smallEnd(ZDIR) - gstartp; int goendr = goverlap.bigEnd(XDIR) - gstartr; int goendc = goverlap.bigEnd(YDIR) - gstartc; int goendp = goverlap.bigEnd(ZDIR) - gstartp; int grows = gbox.length(XDIR); int gcols = gbox.length(YDIR); int gcolsgrowstmp(gcols * grows); int gpgcgrtmp, gcgrowstmp; int gprev; for(int gp(gostartp); gp <= goendp; ++gp) { gpgcgrtmp = gp*gcolsgrowstmp; for(int gc(gostartc); gc <= goendc; ++gc) { gcgrowstmp = gpgcgrtmp + gc*grows; for(int gr(gostartr); gr <= goendr; ++gr) { //dat = dataPoint[(gp*gcols*grows)+(gc*grows)+gr]; // works if(dataPoint[gcgrowstmp + gr] < vfeps) { // body gprev = gostartp + goendp - gp; sindexbase = (((gprev+gstartp)-sstartp) * scolssrowstmp) + ((sendc-((gc+gstartc))) * srows) + // check this ((gr+gstartr)-sstartr); swfData[sindexbase] = bodyColor; } } } } // end for(gp...) } // end if(ioproc) } if(ParallelDescriptor::IOProcessor()) { cout << endl; cout << "--------------- make swfData time = " << ((clock()-time0)/1000000.0) << endl; } } // end MakeSWFData(...) // ------------------------------------------------------------------- void VolRender::WriteSWFData(const string &filenamebase, bool SWFLight) { cout << "VolRender::WriteSWFData" << endl; BL_ASSERT(bVolRenderDefined); if(ParallelDescriptor::IOProcessor()) { cout << "vpClassify Scalars..." << endl; // --- classify clock_t time0 = clock(); vpResult vpret; bool PCtemp(preClassify); preClassify = true; //here set lighting or value model bool bLMtemp(lightingModel); lightingModel = SWFLight; MakeVPData(); preClassify = PCtemp; lightingModel = bLMtemp; cout << "----- make vp data time = " << ((clock() - time0)/1000000.0) << endl; string filename = "swf."; filename += filenamebase; filename += (SWFLight ? ".lt" : ".val" ); filename += ".vpdat"; cout << "----- storing classified volume into file: " << filename << endl; #ifndef S_IRUSR /* the T3E does not define this */ #define S_IRUSR 0000400 #endif #ifndef S_IWUSR /* the T3E does not define this */ #define S_IWUSR 0000200 #endif #ifndef S_IRGRP /* the T3E does not define this */ #define S_IRGRP 0000040 #endif int fp = open(filename.c_str(), O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP); vpret = vpStoreClassifiedVolume(vpc, fp); CheckVP(vpret, 4); close(fp); } } // ------------------------------------------------------------------- void VolRender::InvalidateSWFData() { swfDataValid = false; } // ------------------------------------------------------------------- void VolRender::InvalidateVPData() { vpDataValid = false; } // ------------------------------------------------------------------- void VolRender::SetLightingModel(bool lightOn) { if(lightingModel == lightOn) { return; } lightingModel = lightOn; if(lightingModel == true) { vpSetVoxelField(vpc, normalField, normalSize, normalOffset, maxShadeRampPts-1); } else { // value model vpSetVoxelField(vpc, normalField, normalSize, normalOffset, paletteSize-1); } } // ------------------------------------------------------------------- void VolRender::SetPreClassifyAlgorithm(bool pC) { preClassify = pC; } // ------------------------------------------------------------------- void VolRender::SetImage(unsigned char *image_data, int width, int height, int pixel_type) { vpSetImage(vpc, image_data, width, height, width, pixel_type); } // ------------------------------------------------------------------- void VolRender::MakePicture(Real mvmat[4][4], Real Length, int width, int height) { vpCurrentMatrix(vpc, VP_MODEL); vpIdentityMatrix(vpc); #ifdef BL_USE_FLOAT double dmvmat[4][4]; for(int i(0); i < 4; ++i) { for(int j(0); j < 4; ++j) { dmvmat[i][j] = (double) mvmat[i][j]; } } vpSetMatrix(vpc, dmvmat); #else vpSetMatrix(vpc, mvmat); #endif vpCurrentMatrix(vpc, VP_PROJECT); vpIdentityMatrix(vpc); vpLen = Length; if(width < height) { // undoes volpacks aspect ratio scaling vpWindow(vpc, VP_PARALLEL, -Length*vpAspect, Length*vpAspect, -Length, Length, -Length, Length); } else { vpWindow(vpc, VP_PARALLEL, -Length, Length, -Length*vpAspect, Length*vpAspect, -Length, Length); } vpResult vpret; if(lightingModel) { vpret = vpShadeTable(vpc); CheckVP(vpret, 12); } if(preClassify) { vpret = vpRenderClassifiedVolume(vpc); // --- render CheckVP(vpret, 11); } else { vpret = vpClassifyVolume(vpc); // - classify and then render CheckVP(vpret, 11.1); vpret = vpRenderRawVolume(vpc); CheckVP(vpret, 11.2); } } // ------------------------------------------------------------------- void VolRender::MakeVPData() { BL_ASSERT(bVolRenderDefined); if(ParallelDescriptor::IOProcessor()) { clock_t time0 = clock(); vpDataValid = true; cout << "vpClassifyScalars..." << endl; // --- classify vpSetd(vpc, VP_MIN_VOXEL_OPACITY, minRayOpacity); vpSetd(vpc, VP_MAX_RAY_OPACITY, maxRayOpacity); vpResult vpret; if(preClassify) { if(lightingModel) { vpret = vpClassifyScalars(vpc, swfData, swfDataSize, densityField, gradientField, normalField); CheckVP(vpret, 6); } else { // value model // the classification and loading of the value model delete [] volData; volData = new RawVoxel[swfDataSize]; // volpack will delete this int xStride(sizeof(RawVoxel)); int yStride(drawnDomain[maxDataLevel].length(XDIR) * sizeof(RawVoxel)); int zStride(drawnDomain[maxDataLevel].length(XDIR) * drawnDomain[maxDataLevel].length(YDIR) * sizeof(RawVoxel)); vpret = vpSetRawVoxels(vpc, volData, swfDataSize * sizeof(RawVoxel), xStride, yStride, zStride); CheckVP(vpret, 9.4); for(int vindex(0); vindex < swfDataSize; ++vindex) { volData[vindex].normal = swfData[vindex]; volData[vindex].density = swfData[vindex]; } vpret = vpClassifyVolume(vpc); CheckVP(vpret, 9.5); } } else { // load the volume data and precompute the minmax octree if(lightingModel) { delete [] volData; volData = new RawVoxel[swfDataSize]; int xStride(sizeof(RawVoxel)); int yStride(drawnDomain[maxDataLevel].length(XDIR) * sizeof(RawVoxel)); int zStride(drawnDomain[maxDataLevel].length(XDIR) * drawnDomain[maxDataLevel].length(YDIR) * sizeof(RawVoxel)); vpret = vpSetRawVoxels(vpc, volData, swfDataSize * sizeof(RawVoxel), xStride, yStride, zStride); CheckVP(vpret, 9.45); vpret = vpVolumeNormals(vpc, swfData, swfDataSize, densityField, gradientField, normalField); CheckVP(vpret, 6.1); } else { // value model delete [] volData; volData = new RawVoxel[swfDataSize]; int xStride(sizeof(RawVoxel)); int yStride(drawnDomain[maxDataLevel].length(XDIR) * sizeof(RawVoxel)); int zStride(drawnDomain[maxDataLevel].length(XDIR) * drawnDomain[maxDataLevel].length(YDIR) * sizeof(RawVoxel)); vpret = vpSetRawVoxels(vpc, volData, swfDataSize * sizeof(RawVoxel), xStride, yStride, zStride); CheckVP(vpret, 9.4); for(int vindex(0); vindex < swfDataSize; ++vindex) { volData[vindex].normal = swfData[vindex]; volData[vindex].density = swfData[vindex]; } } vpret = vpMinMaxOctreeThreshold(vpc, DENSITY_PARAM, OCTREE_DENSITY_THRESH); CheckVP(vpret, 9.41); if(classifyFields == 2) { vpret = vpMinMaxOctreeThreshold(vpc, GRADIENT_PARAM, OCTREE_GRADIENT_THRESH); CheckVP(vpret, 9.42); } vpret = vpCreateMinMaxOctree(vpc, 1, OCTREE_BASE_NODE_SIZE); CheckVP(vpret, 9.43); } // --- set the shading parameters if(lightingModel) { vpret = vpSetLookupShader(vpc, 1, 1, normalField, shade_table.dataPtr(), maxShadeRampPts * sizeof(float), 0, NULL, 0); CheckVP(vpret, 7); vpSetMaterial(vpc, VP_MATERIAL0, VP_AMBIENT, VP_BOTH_SIDES, ambientMat, ambientMat, ambientMat);//0.28, 0.28, 0.28); vpSetMaterial(vpc, VP_MATERIAL0, VP_DIFFUSE, VP_BOTH_SIDES, diffuseMat, diffuseMat, diffuseMat);//0.35, 0.35, 0.35); vpSetMaterial(vpc, VP_MATERIAL0, VP_SPECULAR, VP_BOTH_SIDES, specularMat, specularMat, specularMat);//0.39, 0.39, 0.39); vpSetMaterial(vpc, VP_MATERIAL0, VP_SHINYNESS, VP_BOTH_SIDES, shinyMat, 0.0, 0.0);//10.0, 0.0, 0.0); vpSetLight(vpc, VP_LIGHT0, VP_DIRECTION, 0.3, 0.3, 1.0); vpSetLight(vpc, VP_LIGHT0, VP_COLOR, 1.0, 1.0, 1.0); vpEnable(vpc, VP_LIGHT0, 1); vpSeti(vpc, VP_CONCAT_MODE, VP_CONCAT_LEFT); // --- compute shading lookup table vpret = vpShadeTable(vpc); CheckVP(vpret, 8); } else { // value model BL_ASSERT(palettePtr != NULL); for(int sn(0); sn < paletteSize; ++sn) { value_shade_table[sn] = (float) sn; } value_shade_table[0] = (float) AVGlobals::MaxPaletteIndex(); float maxf(0.0); float minf(1000000.0); for(int ijk(0); ijk < paletteSize; ++ijk) { maxf = max(maxf, value_shade_table[ijk]); minf = min(minf, value_shade_table[ijk]); } vpret = vpSetLookupShader(vpc, 1, 1, normalField, value_shade_table.dataPtr(), paletteSize * sizeof(float), 0, NULL, 0); CheckVP(vpret, 9); vpSetMaterial(vpc, VP_MATERIAL0, VP_AMBIENT, VP_BOTH_SIDES, ambientMat, ambientMat, ambientMat);//0.28, 0.28, 0.28); vpSetMaterial(vpc, VP_MATERIAL0, VP_DIFFUSE, VP_BOTH_SIDES, diffuseMat, diffuseMat, diffuseMat);//0.35, 0.35, 0.35); vpSetMaterial(vpc, VP_MATERIAL0, VP_SPECULAR, VP_BOTH_SIDES, specularMat, specularMat, specularMat);//0.39, 0.39, 0.39); vpSetMaterial(vpc, VP_MATERIAL0, VP_SHINYNESS, VP_BOTH_SIDES, shinyMat, 0.0, 0.0);//10.0, 0.0, 0.0); vpSetLight(vpc, VP_LIGHT0, VP_DIRECTION, 0.3, 0.3, 1.0); vpSetLight(vpc, VP_LIGHT0, VP_COLOR, 1.0, 1.0, 1.0); vpEnable(vpc, VP_LIGHT0, 1); vpSeti(vpc, VP_CONCAT_MODE, VP_CONCAT_LEFT); } cout << "----- make vp data time = " << ((clock()-time0)/1000000.0) << endl; } } // end MakeVPData() // ------------------------------------------------------------------- void VolRender::MakeDefaultTransProperties() { classifyFields = 2; shadeFields = 2; nDenRampPts = 2; densityRampX.resize(nDenRampPts); densityRampY.resize(nDenRampPts); nGradRampPts = 2; gradientRampX.resize(nGradRampPts); gradientRampY.resize(nGradRampPts); densityRampX[0] = 0; densityRampX[1] = 255; densityRampY[0] = 0.0; densityRampY[1] = 1.0; gradientRampX[0] = 0; gradientRampX[1] = 255; gradientRampY[0] = 0.0; gradientRampY[1] = 1.0; minRayOpacity = 0.05; maxRayOpacity = 0.95; } // ------------------------------------------------------------------- void VolRender::SetTransferProperties() { BL_ASSERT(palettePtr != NULL); density_ramp = palettePtr->GetTransferArray(); density_ramp[palettePtr->BodyIndex()] = 0.08; vpSetClassifierTable(vpc, DENSITY_PARAM, densityField, density_ramp.dataPtr(), density_ramp.size() * sizeof(float)); /* if(classifyFields == 2) { vpRamp(gradient_ramp.dataPtr(), sizeof(float), gradientRampX.size(), gradientRampX.dataPtr(), gradientRampY.dataPtr()); vpSetClassifierTable(vpc, GRADIENT_PARAM, gradientField, gradient_ramp.dataPtr(), gradient_ramp.size() * sizeof(float)); }*/ vpSetd(vpc, VP_MIN_VOXEL_OPACITY, minRayOpacity); vpSetd(vpc, VP_MAX_RAY_OPACITY, maxRayOpacity); } // ------------------------------------------------------------------- void VolRender::SetProperties() { // some init -- should be placed elsewhere // was previously read from vpramps.dat classifyFields = 1; shadeFields = 2; vpResult vpret = vpSetVoxelSize(vpc, BYTES_PER_VOXEL, voxelFields, shadeFields, classifyFields); CheckVP(vpret, 14); if(lightingModel) { vpSetVoxelField(vpc, normalField, normalSize, normalOffset, maxShadeRampPts-1); } else { // value model vpSetVoxelField(vpc, normalField, normalSize, normalOffset, paletteSize - 1); } vpSetVoxelField(vpc, densityField, densitySize, densityOffset, densityMax); vpSetVoxelField(vpc, gradientField, gradientSize, gradientOffset, gradientMax); SetTransferProperties(); } // ------------------------------------------------------------------- void VolRender::SetLighting(Real ambient, Real diffuse, Real specular, Real shiny, Real minRay, Real maxRay) { ambientMat = ambient; diffuseMat = diffuse; specularMat = specular; shinyMat = shiny; minRayOpacity = minRay; maxRayOpacity = maxRay; } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Palette.cpp0000644000175000017500000004544011634153073021411 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Palette.cpp,v 1.47 2003/03/14 20:24:19 vince Exp $ // // --------------------------------------------------------------- // Palette.cpp // --------------------------------------------------------------- #include "Palette.H" #include "GlobalUtilities.H" #include "GraphicsAttributes.H" #include #include #include #include using std::cout; using std::cerr; using std::endl; using std::min; using std::max; Colormap Palette::systemColmap; // ------------------------------------------------------------------- Palette::Palette(Widget &w, int datalistlength, int width, int totalwidth, int totalheight, int reservesystemcolors) { bReadPalette = true; totalColorSlots = AVGlobals::MaxPaletteIndex() + 1; sysccells.resize(totalColorSlots); transferArray.resize(totalColorSlots); ccells.resize(totalColorSlots); palPixmap = 0; pmin = 0.0; pmax = 1.0; defaultFormat = "%6.4f"; gaPtr = new GraphicsAttributes(w); totalPalWidth = totalwidth; palWidth = width; totalPalHeight = totalheight; dataList.resize(datalistlength); if(gaPtr->IsTrueColor()) { colmap = DefaultColormap(gaPtr->PDisplay(), gaPtr->PScreenNumber()); } else { colmap = XCreateColormap(gaPtr->PDisplay(), gaPtr->PRoot(), gaPtr->PVisual(), AllocAll); } systemColmap = DefaultColormap(gaPtr->PDisplay(), gaPtr->PScreenNumber()); for(int ii(0); ii < totalColorSlots; ++ii) { sysccells[ii].pixel = ii; } XQueryColors(gaPtr->PDisplay(), systemColmap, sysccells.dataPtr(), totalColorSlots); if(gaPtr->IsTrueColor()) { reserveSystemColors = 0; colorOffset = 0; colorSlots = 253; bodyIndex = 2; blackIndex = 1; whiteIndex = 0; paletteStart = 3; } else { reserveSystemColors = reservesystemcolors; colorOffset = reserveSystemColors; // start our allocated palette here colorSlots = totalColorSlots - reserveSystemColors - 3; bodyIndex = colorOffset + 2; blackIndex = colorOffset + 1; whiteIndex = colorOffset; paletteStart = colorOffset + 3; // skip 3 for black, white, and body // the data colors start here } //colorSlots += 1; //paletteStart -= 1; remapTable = new unsigned char[totalColorSlots]; // this is faster than Array float sizeRatio(((float) colorSlots) / ((float) totalColorSlots)); float mapLow(((float) paletteStart) + 0.5); //cout << "))))))))))))) totalColorSlots = " << totalColorSlots << endl; //cout << "))))))))))))) colorSlots = " << colorSlots << endl; //cout << "))))))))))))) sizeRatio = " << sizeRatio << endl; //cout << "))))))))))))) mapLow = " << mapLow << endl; for(int itab(0); itab < totalColorSlots; ++itab) { remapTable[itab] = (int) ((((float) itab) * sizeRatio) + mapLow); //cout << "))))))))))))) remapTable[" << itab << "] = " // << (unsigned int) remapTable[itab] << endl; } } // end constructor // ------------------------------------------------------------------- Palette::Palette(int datalistlength, int width, int totalwidth, int totalheight, int reservesystemcolors) { gaPtr = 0; bReadPalette = true; // bool visTrueColor = false; totalColorSlots = AVGlobals::MaxPaletteIndex() + 1; sysccells.resize(totalColorSlots); transferArray.resize(totalColorSlots); ccells.resize(totalColorSlots); palPixmap = 0; pmin = 0.0; pmax = 1.0; defaultFormat = "%6.4f"; totalPalWidth = totalwidth; palWidth = width; totalPalHeight = totalheight; dataList.resize(datalistlength); for(int ii(0); ii < totalColorSlots; ++ii) { sysccells[ii].pixel = ii; } reserveSystemColors = reservesystemcolors; colorOffset = reserveSystemColors; // start our allocated palette here colorSlots = totalColorSlots - reserveSystemColors - 3; bodyIndex = colorOffset + 2; blackIndex = colorOffset + 1; whiteIndex = colorOffset; paletteStart = colorOffset + 3; // skip 3 for black, white, and body // the data colors start here //colorSlots += 1; //paletteStart -= 1; remapTable = new unsigned char[totalColorSlots]; // this is faster than Array float sizeRatio(((float) colorSlots) / ((float) totalColorSlots)); float mapLow(((float) paletteStart) + 0.5); for(int itab(0); itab < totalColorSlots; ++itab) { remapTable[itab] = (int) ((((float) itab) * sizeRatio) + mapLow); } } // end constructor // ------------------------------------------------------------------- Palette::~Palette() { delete [] remapTable; delete gaPtr; } // ------------------------------------------------------------------- void Palette::ExposePalette() { //cout << " ]]]]]]]]]]]]]]]]]]] _in Palette::ExposePalette" << endl; XCopyArea(gaPtr->PDisplay(), palPixmap, palWindow, gaPtr->PGC(), 0, 0, totalPalWidth, totalPalHeight + 50, 0, 0); } // ------------------------------------------------------------------- void Palette::SetFormat(const string &newFormat) { defaultFormat = newFormat; } // ------------------------------------------------------------------- void Palette::SetReserveSystemColors(int reservesystemcolors) { reserveSystemColors = reservesystemcolors; Draw(pmin, pmax, defaultFormat); // use defaults } // ------------------------------------------------------------------- void Palette::Redraw() { //cout << " ]]]]]]]]]]]]]]]]]]] _in Palette::Redraw" << endl; Draw(pmin, pmax, defaultFormat); // use defaults } // ------------------------------------------------------------------- void Palette::Draw(Real palMin, Real palMax, const string &numberFormat) { int i, cy; XWindowAttributes winAttribs; pmin = palMin; pmax = palMax; defaultFormat = numberFormat; XClearWindow(gaPtr->PDisplay(), palWindow); if(palPixmap == 0) { palPixmap = XCreatePixmap(gaPtr->PDisplay(), palWindow, totalPalWidth, totalPalHeight + 50, gaPtr->PDepth()); } XGetWindowAttributes(gaPtr->PDisplay(), palWindow, &winAttribs); XSetForeground(gaPtr->PDisplay(), gaPtr->PGC(), BlackIndex()); // ERROR here for 24 bit color pc XFillRectangle(gaPtr->PDisplay(), palPixmap, gaPtr->PGC(), 0, 0, totalPalWidth, totalPalHeight + 50); # if (BL_SPACEDIM == 3) // show transfers in palette int transpnt, zerolinex(palWidth - 5); for(i = paletteStart; i < totalColorSlots; ++i) { cy = ((totalColorSlots - 1) - i) + 14; // draw transparency as black // FIXME: XSetForeground(gaPtr->PDisplay(), gaPtr->PGC(), ccells[blackIndex].pixel); transpnt = (int) (zerolinex * (1.0 - transferArray[i])); XDrawLine(gaPtr->PDisplay(), palPixmap, gaPtr->PGC(), 0, cy, transpnt, cy); // draw color part of line // FIXME: XSetForeground(gaPtr->PDisplay(), gaPtr->PGC(), ccells[i].pixel); XDrawLine(gaPtr->PDisplay(), palPixmap, gaPtr->PGC(), transpnt, cy, palWidth, cy); } // draw black line represening zero opacity // FIXME: XSetForeground(gaPtr->PDisplay(), gaPtr->PGC(), ccells[blackIndex].pixel); XDrawLine(gaPtr->PDisplay(), palPixmap, gaPtr->PGC(), zerolinex, 14, zerolinex, colorSlots + 14); #else for(i = paletteStart; i < totalColorSlots; ++i) { XSetForeground(gaPtr->PDisplay(), gaPtr->PGC(), ccells[i].pixel); cy = ((totalColorSlots - 1) - i) + 14; XDrawLine(gaPtr->PDisplay(), palPixmap, gaPtr->PGC(), 0, cy, palWidth, cy); } #endif char palString[64]; for(i = 0; i < dataList.size(); ++i) { XSetForeground(gaPtr->PDisplay(), gaPtr->PGC(), WhiteIndex()); dataList[i] = palMin + (dataList.size()-1-i) * (palMax - palMin)/(dataList.size() - 1); if(i == 0) { dataList[i] = palMax; // to avoid roundoff } sprintf(palString, numberFormat.c_str(), dataList[i]); XDrawString(gaPtr->PDisplay(), palPixmap, gaPtr->PGC(), palWidth + 4, (i * colorSlots / (dataList.size() - 1)) + 20, palString, strlen(palString)); } ExposePalette(); } // end Palette::Draw. // ------------------------------------------------------------------- void Palette::SetWindow(Window drawPaletteHere) { palWindow = drawPaletteHere; } // ------------------------------------------------------------------- void Palette::SetWindowPalette(const string &palName, Window newPalWindow, bool bRedraw) { //cout << " ]]]]]]]]]]]]]]]]]]] _in Palette::SetWindowPalette" << endl; ReadPalette(palName, bRedraw); XSetWindowColormap(gaPtr->PDisplay(), newPalWindow, colmap); } // ------------------------------------------------------------------- void Palette::ChangeWindowPalette(const string &palName, Window newPalWindow) { //cout << " ]]]]]]]]]]]]]]]]]]] _in Palette::ChangeWindowPalette" << endl; bReadPalette = true; ReadPalette(palName); } // ------------------------------------------------------------------- void Palette::ReadPalette(const string &palName, bool bRedraw) { //cout << " ]]]]]]]]]]]]]]]]]]] _in Palette::ReadPalette" << endl; BL_ASSERT(gaPtr != 0); ReadSeqPalette(palName, bRedraw); if(gaPtr->IsTrueColor()) { return; } XStoreColors(gaPtr->PDisplay(), colmap, ccells.dataPtr(), totalColorSlots); XStoreColors(gaPtr->PDisplay(), colmap, sysccells.dataPtr(), reserveSystemColors); } // ------------------------------------------------------------------- int Palette::ReadSeqPalette(const string &fileName, bool bRedraw) { //cout << " ]]]]]]]]]]]]]]]]]]] _in Palette::ReadSeqPalette" << endl; const int iSeqPalSize(256); // this must be 256 (size of sequential palettes). Array indexArray(iSeqPalSize); int i, fd; bool bTrueColor; unsigned long bprgb; if(gaPtr == 0) { bTrueColor = false; bprgb = 8; } else { bTrueColor = gaPtr->IsTrueColor(); bprgb = gaPtr->PBitsPerRGB(); } if(bReadPalette) { bReadPalette = false; rbuff.resize(iSeqPalSize); gbuff.resize(iSeqPalSize); bbuff.resize(iSeqPalSize); abuff.resize(iSeqPalSize); if((fd = open(fileName.c_str(), O_RDONLY, NULL)) < 0) { cout << "Can't open colormap file: " << fileName << endl; for(i = 0; i < totalColorSlots; ++i) { // make a default grayscale colormap. if(bTrueColor) { // FIXME: not 24 bit! ccells[i].pixel = (((rbuff[i] >> (8 - bprgb)) << 2 * bprgb) | ((gbuff[i] >> (8 - bprgb)) << bprgb) | ((bbuff[i] >> (8 - bprgb)) << 0) ); } else { ccells[i].pixel = i; } mcells[ccells[i].pixel] = ccells[i]; ccells[i].red = (unsigned short) i * 256; ccells[i].green = (unsigned short) i * 256; ccells[i].blue = (unsigned short) i * 256; ccells[i].flags = DoRed | DoGreen | DoBlue; } // set low value to black ccells[paletteStart].red = 0; ccells[paletteStart].green = 0; ccells[paletteStart].blue = 0; //ccells[bodyIndex].red = (unsigned short) 32000; ccells[bodyIndex].red = (unsigned short) 0; //ccells[bodyIndex].green = (unsigned short) 32000; ccells[bodyIndex].green = (unsigned short) 0; //ccells[bodyIndex].blue = (unsigned short) 32000; ccells[bodyIndex].blue = (unsigned short) 0; ccells[blackIndex].red = (unsigned short) 0; ccells[blackIndex].green = (unsigned short) 0; ccells[blackIndex].blue = (unsigned short) 0; ccells[whiteIndex].red = (unsigned short) 65535; ccells[whiteIndex].green = (unsigned short) 65535; ccells[whiteIndex].blue = (unsigned short) 65535; paletteType = ALPHA; transferArray.resize(iSeqPalSize); for(int j(0); j < iSeqPalSize; ++j) { indexArray[j] = j; //transferArray[j] = (float) j / (float) (iSeqPalSize - 1); rbuff[j] = j; gbuff[j] = j; bbuff[j] = j; abuff[j] = static_cast (100.0 * ((float) j / (float) (iSeqPalSize - 1))); } //rbuff[bodyIndex] = 127; //gbuff[bodyIndex] = 127; //bbuff[bodyIndex] = 127; rbuff[bodyIndex] = 0; gbuff[bodyIndex] = 0; bbuff[bodyIndex] = 0; rbuff[blackIndex] = 0; gbuff[blackIndex] = 0; bbuff[blackIndex] = 0; rbuff[whiteIndex] = 255; gbuff[whiteIndex] = 255; bbuff[whiteIndex] = 255; } else { if(read(fd, rbuff.dataPtr(), iSeqPalSize) != iSeqPalSize) { cout << "palette is not a seq colormap." << endl; return(0); } if(read(fd, gbuff.dataPtr(), iSeqPalSize) != iSeqPalSize) { cout << "file is not a seq colormap." << endl; return(0); } if(read(fd, bbuff.dataPtr(), iSeqPalSize) != iSeqPalSize) { cout << "palette is not a seq colormap." << endl; return(0); } if(read(fd, abuff.dataPtr(), iSeqPalSize) != iSeqPalSize) { if(BL_SPACEDIM == 3) { cout << "Palette does not have an alpha component: using the default." << endl; } paletteType = NON_ALPHA; } else { paletteType = ALPHA; } (void) close(fd); } } // end if(bReadPalette) //rbuff[bodyIndex] = 127; //gbuff[bodyIndex] = 127; //bbuff[bodyIndex] = 127; rbuff[bodyIndex] = 0; gbuff[bodyIndex] = 0; bbuff[bodyIndex] = 0; rbuff[blackIndex] = 0; gbuff[blackIndex] = 0; bbuff[blackIndex] = 0; rbuff[whiteIndex] = 255; gbuff[whiteIndex] = 255; bbuff[whiteIndex] = 255; if(AVGlobals::LowBlack()) { // set low value to black rbuff[paletteStart] = 0; gbuff[paletteStart] = 0; bbuff[paletteStart] = 0; } for(i = 0; i < totalColorSlots; ++i) { if(bTrueColor) { // FIXME: not 24 bit! ccells[i].pixel = (((rbuff[i] >> (8 - bprgb)) << 2 * bprgb) | ((gbuff[i] >> (8 - bprgb)) << bprgb) | ((bbuff[i] >> (8 - bprgb)) << 0)); } else { ccells[i].pixel = i; } mcells[ccells[i].pixel] = ccells[i]; ccells[i].red = (unsigned short) rbuff[i] * 256; ccells[i].green = (unsigned short) gbuff[i] * 256; ccells[i].blue = (unsigned short) bbuff[i] * 256; ccells[i].flags = DoRed | DoGreen | DoBlue; } // set Transfer function here NOTE: doesn't call transferArray.resize(iSeqPalSize); if(paletteType == NON_ALPHA) { for(int j(0); j < iSeqPalSize; ++j) { indexArray[j] = j; transferArray[j] = (float) j / (float) (iSeqPalSize-1); } } else if(paletteType == ALPHA) { for(int j(0); j < iSeqPalSize; ++j) { indexArray[j] = j; int tmp = (unsigned short) abuff[j]; transferArray[j] = (float) tmp / 100.0; } } if(bRedraw) { Redraw(); } return(1); } // end ReadSeqPalette() // ------------------------------------------------------------------- XImage *Palette::GetPictureXImage() { return (XGetImage(gaPtr->PDisplay(), palPixmap, 0, 0, totalPalWidth, totalPalHeight, AllPlanes, ZPixmap)); } // ------------------------------------------------------------------- Pixel Palette::BodyIndex() const { return bodyIndex; } // ------------------------------------------------------------------- Pixel Palette::BlackIndex() const { if(gaPtr->IsTrueColor()) { return BlackPixel(gaPtr->PDisplay(), gaPtr->PScreenNumber()); } else { return blackIndex; } } // ------------------------------------------------------------------- Pixel Palette::WhiteIndex() const { if(gaPtr->IsTrueColor()) { return WhitePixel(gaPtr->PDisplay(), gaPtr->PScreenNumber()); } else { return whiteIndex; } } // ------------------------------------------------------------------- unsigned int Palette::SafePaletteIndex(unsigned int atlevel) const { // return a number in [PaletteStart(), PaletteEnd()] unsigned int cslots((atlevel * ((colorSlots / 8) )) % colorSlots); cslots = colorSlots - cslots - 1; unsigned int indexRet(paletteStart + cslots); unsigned int pSt(PaletteStart()), pEnd(PaletteEnd()); indexRet = std::max(pSt, std::min(indexRet, pEnd)); return indexRet; } // ------------------------------------------------------------------- Pixel Palette::pixelate(int i) const { if(i < 0) { return BlackIndex(); } else if( i > (totalColorSlots - 1) ) { return WhiteIndex(); } else { return ccells[i].pixel; } } // ------------------------------------------------------------------- Pixel Palette::makePixel(unsigned char ind) const { if(gaPtr->IsTrueColor()) { assert( gaPtr->PBitsPerRGB() <= 8 ); Pixel r = rbuff[ind] >> (8 - gaPtr->PBitsPerRGB()); Pixel g = gbuff[ind] >> (8 - gaPtr->PBitsPerRGB()); Pixel b = bbuff[ind] >> (8 - gaPtr->PBitsPerRGB()); return(( r << gaPtr->PRedShift()) | (g << gaPtr->PGreenShift()) | (b << gaPtr->PBlueShift())); } else { return Pixel(ind); } } // ------------------------------------------------------------------- void Palette::unpixelate(Pixel index, unsigned char &r, unsigned char &g, unsigned char &b) const { if(gaPtr->IsTrueColor()) { map::const_iterator mi = mcells.find(index); if(mi != mcells.end()) { r = mi->second.red >> 8; g = mi->second.green >> 8; b = mi->second.blue >> 8; return; } cout << "bad index = " << index << endl; r = (index&gaPtr->PRedMask()) >> gaPtr->PRedShift(); g = (index&gaPtr->PGreenMask()) >> gaPtr->PGreenShift(); b = (index&gaPtr->PBlueMask()) >> gaPtr->PBlueShift(); } else { int vIndex = std::max(0, std::min(static_cast (index), (totalColorSlots - 1))); r = ccells[vIndex].red >> 8; g = ccells[vIndex].green >> 8; b = ccells[vIndex].blue >> 8; } } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/XYPlotDefaults.H0000644000175000017500000000532711634153073022307 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // XYPlotDefaults.H -- Default values for XY Plotter // #ifndef _XYPLOTDEFAULTS_H #define _XYPLOTDEFAULTS_H #define DEF_MARK_FLAG "off" #define DEF_LARGEMARK_FLAG "off" #define DEF_STYLEMARK_FLAG "off" #define DEF_TICK_FLAG "off" #define DEF_TICKAXIS_FLAG "off" #define DEF_BB_FLAG "off" #define DEF_PLOTLINE_FLAG "on" #define DEF_DISPHINTS_FLAG "on" #define DEF_LINE_WIDTH "0" #define DEF_GRID_WIDTH "0" #define DEF_DOT_WIDTH "8" #define DEF_XUNIT_TEXT_X "X" #define DEF_XUNIT_TEXT_Y "Y" #define DEF_XUNIT_TEXT_Z "Z" #define DEF_YUNIT_TEXT "Val" #define DEF_FMT_X "%.2f" #define DEF_FMT_Y "%.2f" #define DEF_GRID_STYLE "10" #define DEF_LABEL_FONT "helvetica-10" #define DEF_TITLE_FONT "helvetica-18" #define DEF_INIT_WIN_WIDTH "250" #define DEF_INIT_WIN_HEIGHT "275" #define DEF_INIT_WIN_OFFSET_X "0" #define DEF_INIT_WIN_OFFSET_Y "450" // Black and white defaults #define DEF_BW_BACKGROUND "white" #define DEF_BW_BORDER "black" #define DEF_BW_FOREGROUND "black" // Color defaults #define DEF_COL_BACKGROUND "#ccc" #define DEF_COL_BORDER "black" #define DEF_COL_FOREGROUND "black" #define DEF_COL_FIRSTSTYLE "1" #define DEF_GRID_COLOR "gray" #define DEF_TEXT_COLOR "white" #define DEF_INT "0" #define DEF_STR "" #define DEF_FONT "fixed" #define DEF_PIXEL "black" #define DEF_STYLE "1" #define DEF_BOOL "false" #define DEF_DBL "0.0" #define DEF_MAX_FONT 1024 #define DEF_MAX_NAMES 10 #endif ccseapps-2.5/CCSEApps/pAmrvis/Trackball.H0000644000175000017500000000376711634153073021325 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Trackball.H,v 1.5 2002/02/07 23:59:02 vince Exp $ // // --------------------------------------------------------------- // TrackBall.H // --------------------------------------------------------------- // --------------------------------------------------------------- // Pass the x and y coordinates of the last and current positions of // the mouse, scaled so they are from (-1.0 ... 1.0). // // The resulting rotation is returned as a quaternion rotation // --------------------------------------------------------------- extern AmrQuaternion trackball( Real p1x, Real p1y, Real p2x, Real p2y); // --------------------------------------------------------------- // --------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/FABUTIL_3D.F0000644000175000017500000007342211634153073021033 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c ::: SCCS stuff "@(#)FABUTIL_3D.F 3.1\t6/25/93" #define FORT_CINTERP cinterp3d #define FORT_PCINTERP pcinterp3d #define FORT_VCINTERP vcinterp3d #define FORT_CARTGRIDMINMAX cartgridminmax3d #include "REAL.H" #include "CONSTANTS.H" #define IX_PROJ(A,B) (A+B*iabs(A))/B-iabs(A) c ::: -------------------------------------------------------------- subroutine FORT_CARTGRIDMINMAX (data, dlo1, dlo2, dlo3, dhi1, dhi2, dhi3, $ vfracdata, vfeps, dmin, dmax) implicit none integer dlo1, dlo2, dlo3, dhi1, dhi2, dhi3 REAL_T data(dlo1:dhi1 ,dlo2:dhi2, dlo3:dhi3) REAL_T vfracdata(dlo1:dhi1 ,dlo2:dhi2, dlo3:dhi3) REAL_T vfeps, dmin, dmax integer i, j, k dmax = -bigreal dmin = bigreal do 410 k = dlo3, dhi3 do 420 j = dlo2, dhi2 do 430 i = dlo1, dhi1 if ( .not. (vfracdata(i,j,k).lt.vfeps)) then dmax = max(dmax,data(i,j,k)) dmin = min(dmin,data(i,j,k)) endif 430 continue 420 continue 410 continue return end c ::: -------------------------------------------------------------- subroutine FORT_CINTERP (fine,floi1,floi2,floi3,fhii1,fhii2,fhii3, $ fblo,fbhi,nvar,lratio, crse,clo,chi,cblo,cbhi,fslo,fshi, cslope, $ clen,fslope,fdat,flen,voff) integer floi1,floi2,floi3, fhii1,fhii2,fhii3 integer fblo(3), fbhi(3) integer cblo(3), cbhi(3) integer fslo(3), fshi(3) integer lratio, nvar, clen, flen, clo, chi REAL_T fine(floi1 :fhii1 ,floi2 :fhii2 ,floi3 :fhii3, nvar) REAL_T crse(clo:chi, nvar) REAL_T cslope(clo:chi, 3) REAL_T fslope(flen, 3) REAL_T fdat(flen) REAL_T voff(flen) c ::: NOTE: data must be sent in so that c ::: cslope(1,*) and crse(1,*) are associated with c ::: the same cell c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: cinterp: conservative interpolation from coarse grid to c ::: subregion of fine grid defined by (fblo,fbhi) c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: nvar => (const) number of variables in state vector c ::: lratio => (const) refinement ratio between levels c ::: c ::: crse => (const) coarse grid data widended by 1 zone c ::: and unrolled c ::: clo,chi => (const) one dimensional limits of crse grid c ::: cslo,cshi => (const) coarse grid index limits where c ::: slopes are to be defined. This is c ::: the projection of (fblo,fbhi) down c ::: to the coarse level c ::: fslo,fshi => (const) fine grid index limits where c ::: slopes are needed. This is the c ::: refinement of (cslo,cshi) and c ::: contains but may not be identical c ::: to (fblo,fbhi). c ::: cslope => (modify) temp array coarse grid slopes c ::: clen => (const) length of coarse gtid slopes c ::: fslope => (modify) temp array for fine grid slope c ::: flen => (const) length of fine grid slope array c ::: fdat => (const) temp array for fine grid data c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: local var integer n, fn integer i, ic, ioff integer j, jc, joff integer k, kc, koff integer ist, jst, kst REAL_T hafrat, volratio REAL_T cen, forw, back, slp REAL_T xoff, yoff, zoff integer ncbx, ncby, ncbz integer ncsx, ncsy, ncsz integer islo, jslo, kslo integer icc, istart, iend integer lenx, leny, lenz, maxlen hafrat = half*float(lratio-1) volratio = one/float(lratio) ncbx = cbhi(1)-cblo(1)+1 ncby = cbhi(2)-cblo(2)+1 ncbz = cbhi(3)-cblo(3)+1 ncsx = ncbx+2 ncsy = ncby+2 ncsz = ncbz+2 ist = 1 jst = ncsx kst = ncsx*ncsy islo = cblo(1)-1 jslo = cblo(2)-1 kslo = cblo(3)-1 lenx = fbhi(1)-fblo(1)+1 leny = fbhi(2)-fblo(2)+1 lenz = fbhi(3)-fblo(3)+1 maxlen = max(lenx,leny,lenz) if (maxlen .eq. lenx) then do 100 i = fblo(1), fbhi(1) fn = i-fslo(1)+1 ioff = mod(fn-1,lratio) voff(fn) = float(ioff)-hafrat 100 continue else if (maxlen .eq. leny) then do 110 j = fblo(2), fbhi(2) fn = j-fslo(2)+1 joff = mod(fn-1,lratio) voff(fn) = float(joff)-hafrat 110 continue else do 120 k = fblo(3), fbhi(3) fn = k-fslo(3)+1 koff = mod(fn-1,lratio) voff(fn) = float(koff)-hafrat 120 continue end if do 130 n = 1, nvar c ::: ::::: compute slopes in x direction do 140 i = 1, clen cen = half*(crse(i+ist,n)-crse(i-ist,n)) forw = crse(i+ist,n)-crse(i,n) back = crse(i,n)-crse(i-ist,n) slp = sign(one,cen)*min(abs(cen),abs(forw),abs(back)) cslope(i,1)=cvmgp(slp,zero,forw*back) 140 continue c ::: ::::: compute slopes in y direction do 150 i = 1, clen cen = half*(crse(i+jst,n)-crse(i-jst,n)) forw = crse(i+jst,n)-crse(i,n) back = crse(i,n)-crse(i-jst,n) slp = sign(one,cen)*min(abs(cen),abs(forw),abs(back)) cslope(i,2)=cvmgp(slp,zero,forw*back) 150 continue c ::: ::::: compute slopes in z direction do 160 i = 1, clen cen = half*(crse(i+kst,n)-crse(i-kst,n)) forw = crse(i+kst,n)-crse(i,n) back = crse(i,n)-crse(i-kst,n) slp = sign(one,cen)*min(abs(cen),abs(forw),abs(back)) cslope(i,3)=cvmgp(slp,zero,forw*back) 160 continue if (maxlen .eq. lenx) then do 170 kc = cblo(3), cbhi(3) do 180 jc = cblo(2), cbhi(2) c ::: ..,.......::::: strip out a fine grid slope vector do 190 ioff = 1, lratio icc = clo + ist + jst*(jc-jslo) + kst*(kc- $ kslo) istart = ioff iend = ioff + (ncbx-1)*lratio do 200 fn = istart, iend, lratio fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fslope(fn,3) = cslope(icc,3) fdat(fn) = crse(icc,n) icc = icc + ist 200 continue 190 continue do 210 koff = 0, lratio-1 k = lratio*kc + koff if (k .lt. fblo(3)) then goto 210 c --- next --- end if if (k .gt. fbhi(3)) then goto 211 c --- break --- end if zoff = float(koff)-hafrat do 220 joff = 0, lratio-1 j = lratio*jc + joff if (j .lt. fblo(2)) then goto 220 c --- next --- end if if (j .gt. fbhi(2)) then goto 221 c --- break --- end if yoff = float(joff)-hafrat do 230 i = fblo(1), fbhi(1) fn = i-fslo(1)+1 fine(i,j,k,n) = fdat(fn) + volratio* $ (voff(fn)*fslope(fn,1)+yoff*fslope(fn, $ 2)+ zoff*fslope(fn,3)) 230 continue 220 continue 221 continue 210 continue 211 continue 180 continue 170 continue else if (maxlen .eq. leny) then do 240 kc = cblo(3), cbhi(3) do 250 ic = cblo(1), cbhi(1) c ::: ..,.......::::: strip out a fine grid slope vector do 260 joff = 1, lratio icc = clo + ist*(ic-islo) + jst + kst*(kc- $ kslo) istart = joff iend = joff + (ncby-1)*lratio do 270 fn = istart, iend, lratio fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fslope(fn,3) = cslope(icc,3) fdat(fn) = crse(icc,n) icc = icc + jst 270 continue 260 continue do 280 koff = 0, lratio-1 k = lratio*kc + koff if (k .lt. fblo(3)) then goto 280 c --- next --- end if if (k .gt. fbhi(3)) then goto 281 c --- break --- end if zoff = float(koff)-hafrat do 290 ioff = 0, lratio-1 i = lratio*ic + ioff if (i .lt. fblo(1)) then goto 290 c --- next --- end if if (i .gt. fbhi(1)) then goto 291 c --- break --- end if xoff = float(ioff)-hafrat do 300 j = fblo(2), fbhi(2) fn = j-fslo(2)+1 fine(i,j,k,n) = fdat(fn) + volratio* $ (xoff*fslope(fn,1)+voff(fn)*fslope(fn, $ 2)+ zoff*fslope(fn,3)) 300 continue 290 continue 291 continue 280 continue 281 continue 250 continue 240 continue else do 310 jc = cblo(2), cbhi(2) do 320 ic = cblo(1), cbhi(1) c ::: ..,.......::::: strip out a fine grid slope vector do 330 koff = 1, lratio icc = clo + ist*(ic-islo) + jst*(jc-jslo) + $ kst istart = koff iend = koff + (ncbz-1)*lratio do 340 fn = istart, iend, lratio fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fslope(fn,3) = cslope(icc,3) fdat(fn) = crse(icc,n) icc = icc + kst 340 continue 330 continue do 350 joff = 0, lratio-1 j = lratio*jc + joff if (j .lt. fblo(2)) then goto 350 c --- next --- end if if (j .gt. fbhi(2)) then goto 351 c --- break --- end if yoff = float(joff)-hafrat do 360 ioff = 0, lratio-1 i = lratio*ic + ioff if (i .lt. fblo(1)) then goto 360 c --- next --- end if if (i .gt. fbhi(1)) then goto 361 c --- break --- end if xoff = float(ioff)-hafrat do 370 k = fblo(3), fbhi(3) fn = k-fslo(3)+1 fine(i,j,k,n) = fdat(fn) + volratio* $ (xoff*fslope(fn,1)+yoff*fslope(fn,2)+ $ voff(fn)*fslope(fn,3)) 370 continue 360 continue 361 continue 350 continue 351 continue 320 continue 310 continue end if 130 continue return end c ::: -------------------------------------------------------------- subroutine FORT_PCINTERP (fine,floi1,floi2,floi3,fhii1,fhii2,fhii3, $ fblo, fbhi,lrat,nvar, crse,cloi1,cloi2,cloi3,chii1,chii2,chii3, $ cblo, cbhi,temp,tloi,thii) integer floi1,floi2,floi3 integer fhii1,fhii2,fhii3 integer cloi1,cloi2,cloi3 integer chii1,chii2,chii3 integer fblo(3), fbhi(3) integer cblo(3), cbhi(3) integer lrat, nvar, tloi, thii REAL_T fine(floi1 :fhii1 ,floi2 :fhii2 ,floi3 :fhii3, nvar) REAL_T crse(cloi1 :chii1 ,cloi2 :chii2 ,cloi3 :chii3, nvar) REAL_T temp(tloi:thii + 1) c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: pcinterp: use piecewise constant interpolation to define c ::: values on the subregion of the fine FAB defined c ::: by (fblo,fbhi). c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fab to get interpolated values c ::: flo,fhi => (const) index limits of fine c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: crse => (const) fab holding coarse grid values c ::: clo,chi => (const) index limits of src c ::: cblo,cbhi => (const) subregion of coarse grid holding values c ::: temp => (modify) temporary space for vectorization c ::: tlo,thi => (const) index limits of temp space c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: local var integer i,j,k,ic,jc,kc,ioff,n integer ixproj,ii,ll ixproj(ii,ll) = (ii + ll*iabs(ii))/ll - iabs(ii) do 130 k = fblo(3), fbhi(3) kc = ixproj(k,lrat) do 140 j = fblo(2), fbhi(2) jc = ixproj(j,lrat) do 150 n = 1, nvar do 160 ioff = 0, lrat-1 do 170 ic = cblo(1),cbhi(1) i = lrat*ic + ioff temp(i) = crse(ic,jc,kc,n) 170 continue 160 continue do 180 i = fblo(1), fbhi(1) fine(i,j,k,n) = temp(i) 180 continue 150 continue 140 continue 130 continue return end c ::: -------------------------------------------------------------- subroutine FORT_VCINTERP (fine,floi1,floi2,floi3,fhii1,fhii2, $ fhii3,fbloi1,fbloi2,fbloi3, fbhii1,fbhii2,fbhii3,nvar,lratio, $ crse,clo,chi,cblo,cbhi, fslo,fshi,cvloi1,cvloi2,cvloi3,cvhii1, $ cvhii2,cvhii3, cslope,clen,fslope,fdat,flen,voff, cvc1,fvc1,cvc2, $ fvc2,cvc3,fvc3) integer floi1,floi2,floi3 integer fhii1,fhii2,fhii3 integer fbloi1,fbloi2,fbloi3 integer fbhii1,fbhii2,fbhii3 integer cvloi1,cvloi2,cvloi3 integer cvhii1,cvhii2,cvhii3 integer cblo(3), cbhi(3) integer fslo(3), fshi(3) integer lratio, nvar, clen, flen, clo, chi REAL_T fine(floi1 :fhii1 ,floi2 :fhii2 ,floi3 :fhii3, nvar) REAL_T crse(clo:chi, nvar) REAL_T cslope(clo:chi, 3) REAL_T fslope(flen, 3) REAL_T fdat(flen) REAL_T voff(flen) REAL_T cvc1(cvloi1 :cvhii1+1) REAL_T cvc2(cvloi2 :cvhii2+1) REAL_T cvc3(cvloi3 :cvhii3+1) REAL_T fvc1(fbloi1 :fbhii1+1) REAL_T fvc2(fbloi2 :fbhii2+1) REAL_T fvc3(fbloi3 :fbhii3+1) c ::: NOTE: data must be sent in so that c ::: cslope(1,*) and crse(1,*) are associated with c ::: the same cell c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: vcinterp: conservative interpolation in volume coordinates c ::: from coarse grid to c ::: subregion of fine grid defined by (fblo,fbhi) c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: nvar => (const) number of variables in state vector c ::: lratio => (const) refinement ratio between levels c ::: c ::: crse => (const) coarse grid data widended by 1 zone c ::: and unrolled c ::: clo,chi => (const) one dimensional limits of crse grid c ::: cslo,cshi => (const) coarse grid index limits where c ::: slopes are to be defined. This is c ::: the projection of (fblo,fbhi) down c ::: to the coarse level c ::: fslo,fshi => (const) fine grid index limits where c ::: slopes are needed. This is the c ::: refinement of (cslo,cshi) and c ::: contains but may not be identical c ::: to (fblo,fbhi). c ::: cslope => (modify) temp array coarse grid slopes c ::: clen => (const) length of coarse gtid slopes c ::: fslope => (modify) temp array for fine grid slope c ::: flen => (const) length of fine grid slope array c ::: fdat => (const) temp array for fine grid data c ::: cvlo,cvhi => (const) coarse grid index limits where c ::: volume coordinates are defined c ::: cvc1 => (const) coarse grid volume coords, x-dir c ::: cvc2 => (const) coarse grid volume coords, y_dir c ::: cvc3 => (const) coarse grid volume coords, z-dir c ::: fvc1 => (const) fine grid volume coords, x-dir c ::: fvc2 => (const) fine grid volume coords, y-dir c ::: fvc3 => (const) fine grid volume coords, z-dir c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: local var integer n, fn integer i, ic, ioff integer j, jc, joff integer k, kc, koff integer ist, jst, kst REAL_T cen, forw, back, slp REAL_T xoff, yoff, zoff REAL_T fcen, ccen integer ncbx, ncby, ncbz integer ncsx, ncsy, ncsz integer islo, jslo, kslo integer icc, istart, iend integer lenx, leny, lenz, maxlen ncbx = cbhi(1)-cblo(1)+1 ncby = cbhi(2)-cblo(2)+1 ncbz = cbhi(3)-cblo(3)+1 ncsx = ncbx+2 ncsy = ncby+2 ncsz = ncbz+2 ist = 1 jst = ncsx kst = ncsx*ncsy islo = cblo(1)-1 jslo = cblo(2)-1 kslo = cblo(3)-1 lenx = fbhii1-fbloi1+1 leny = fbhii2-fbloi2+1 lenz = fbhii3-fbloi3+1 maxlen = max(lenx,leny,lenz) if (maxlen .eq. lenx) then do 380 i = fbloi1, fbhii1 fn = i-fslo(1)+1 ic = IX_PROJ(i,lratio) fcen = half*(fvc1(i)+fvc1(i+1)) ccen = half*(cvc1(ic)+cvc1(ic+1)) voff(fn) = (fcen-ccen)/(cvc1(ic+1)-cvc1(ic)) 380 continue else if (maxlen .eq. leny) then do 390 j = fbloi2, fbhii2 fn = j-fslo(2)+1 jc = IX_PROJ(j,lratio) fcen = half*(fvc2(j)+fvc2(j+1)) ccen = half*(cvc2(jc)+cvc2(jc+1)) voff(fn) = (fcen-ccen)/(cvc2(jc+1)-cvc2(jc)) 390 continue else do 400 k = fbloi3, fbhii3 fn = k-fslo(3)+1 kc = IX_PROJ(k,lratio) fcen = half*(fvc3(k)+fvc3(k+1)) ccen = half*(cvc3(kc)+cvc3(kc+1)) voff(fn) = (fcen-ccen)/(cvc3(kc+1)-cvc3(kc)) 400 continue end if do 410 n = 1, nvar c ::: ::::: compute slopes in x direction do 420 i = 1, clen cen = half*(crse(i+ist,n)-crse(i-ist,n)) forw = crse(i+ist,n)-crse(i,n) back = crse(i,n)-crse(i-ist,n) slp = sign(one,cen)*min(abs(cen),abs(forw),abs(back)) cslope(i,1)=cvmgp(slp,zero,forw*back) 420 continue c ::: ::::: compute slopes in y direction do 430 i = 1, clen cen = half*(crse(i+jst,n)-crse(i-jst,n)) forw = crse(i+jst,n)-crse(i,n) back = crse(i,n)-crse(i-jst,n) slp = sign(one,cen)*min(abs(cen),abs(forw),abs(back)) cslope(i,2)=cvmgp(slp,zero,forw*back) 430 continue c ::: ::::: compute slopes in z direction do 440 i = 1, clen cen = half*(crse(i+kst,n)-crse(i-kst,n)) forw = crse(i+kst,n)-crse(i,n) back = crse(i,n)-crse(i-kst,n) slp = sign(one,cen)*min(abs(cen),abs(forw),abs(back)) cslope(i,3)=cvmgp(slp,zero,forw*back) 440 continue if (maxlen .eq. lenx) then do 450 kc = cblo(3), cbhi(3) do 460 jc = cblo(2), cbhi(2) c ::: ..,.......::::: strip out a fine grid slope vector do 470 ioff = 1, lratio icc = clo + ist + jst*(jc-jslo) + kst*(kc- $ kslo) istart = ioff iend = ioff + (ncbx-1)*lratio do 480 fn = istart, iend, lratio fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fslope(fn,3) = cslope(icc,3) fdat(fn) = crse(icc,n) icc = icc + ist 480 continue 470 continue do 490 koff = 0, lratio-1 k = lratio*kc + koff if (k .lt. fbloi3) then goto 490 c --- next --- end if if (k .gt. fbhii3) then goto 491 c --- break --- end if fcen = half*(fvc3(k)+fvc3(k+1)) ccen = half*(cvc3(kc)+cvc3(kc+1)) zoff = (fcen-ccen)/(cvc3(kc+1)-cvc3(kc)) do 500 joff = 0, lratio-1 j = lratio*jc + joff if (j .lt. fbloi2) then goto 500 c --- next --- end if if (j .gt. fbhii2) then goto 501 c --- break --- end if fcen = half*(fvc2(j)+fvc2(j+1)) ccen = half*(cvc2(jc)+cvc2(jc+1)) yoff = (fcen-ccen)/(cvc2(jc+1)-cvc2(jc)) do 510 i = fbloi1, fbhii1 fn = i-fslo(1)+1 fine(i,j,k,n) = fdat(fn) + voff(fn)* $ fslope(fn,1)+yoff*fslope(fn,2)+ zoff* $ fslope(fn,3) 510 continue 500 continue 501 continue 490 continue 491 continue 460 continue 450 continue else if (maxlen .eq. leny) then do 520 kc = cblo(3), cbhi(3) do 530 ic = cblo(1), cbhi(1) c ::: ..,.......::::: strip out a fine grid slope vector do 540 joff = 1, lratio icc = clo + ist*(ic-islo) + jst + kst*(kc- $ kslo) istart = joff iend = joff + (ncby-1)*lratio do 550 fn = istart, iend, lratio fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fslope(fn,3) = cslope(icc,3) fdat(fn) = crse(icc,n) icc = icc + jst 550 continue 540 continue do 560 koff = 0, lratio-1 k = lratio*kc + koff if (k .lt. fbloi3) then goto 560 c --- next --- end if if (k .gt. fbhii3) then goto 561 c --- break --- end if fcen = half*(fvc3(k)+fvc3(k+1)) ccen = half*(cvc3(kc)+cvc3(kc+1)) zoff = (fcen-ccen)/(cvc3(kc+1)-cvc3(kc)) do 570 ioff = 0, lratio-1 i = lratio*ic + ioff if (i .lt. fbloi1) then goto 570 c --- next --- end if if (i .gt. fbhii1) then goto 571 c --- break --- end if fcen = half*(fvc1(i)+fvc1(i+1)) ccen = half*(cvc1(ic)+cvc1(ic+1)) xoff = (fcen-ccen)/(cvc1(ic+1)-cvc1(ic)) do 580 j = fbloi2, fbhii2 fn = j-fslo(2)+1 fine(i,j,k,n) = fdat(fn) + xoff* $ fslope(fn,1)+voff(fn)*fslope(fn,2)+ $ zoff*fslope(fn,3) 580 continue 570 continue 571 continue 560 continue 561 continue 530 continue 520 continue else do 590 jc = cblo(2), cbhi(2) do 600 ic = cblo(1), cbhi(1) c ::: ..,.......::::: strip out a fine grid slope vector do 610 koff = 1, lratio icc = clo + ist*(ic-islo) + jst*(jc-jslo) + $ kst istart = koff iend = koff + (ncbz-1)*lratio do 620 fn = istart, iend, lratio fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fslope(fn,3) = cslope(icc,3) fdat(fn) = crse(icc,n) icc = icc + kst 620 continue 610 continue do 630 joff = 0, lratio-1 j = lratio*jc + joff if (j .lt. fbloi2) then goto 630 c --- next --- end if if (j .gt. fbhii2) then goto 631 c --- break --- end if fcen = half*(fvc2(j)+fvc2(j+1)) ccen = half*(cvc2(jc)+cvc2(jc+1)) yoff = (fcen-ccen)/(cvc2(jc+1)-cvc2(jc)) do 640 ioff = 0, lratio-1 i = lratio*ic + ioff if (i .lt. fbloi1) then goto 640 c --- next --- end if if (i .gt. fbhii1) then goto 641 c --- break --- end if fcen = half*(fvc1(i)+fvc1(i+1)) ccen = half*(cvc1(ic)+cvc1(ic+1)) xoff = (fcen-ccen)/(cvc1(ic+1)-cvc1(ic)) do 650 k = fbloi3, fbhii3 fn = k-fslo(3)+1 fine(i,j,k,n) = fdat(fn) + xoff* $ fslope(fn,1)+yoff*fslope(fn,2)+ $ voff(fn)*fslope(fn,3) 650 continue 640 continue 641 continue 630 continue 631 continue 600 continue 590 continue end if 410 continue return end ccseapps-2.5/CCSEApps/pAmrvis/ArrayView.H0000644000175000017500000000607011634153073021325 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ArrayView.H,v 1.3 2000/10/02 20:53:07 lijewski Exp $ // // --------------------------------------------------------------- // ArrayView.H // --------------------------------------------------------------- #ifndef _ARRAYVIEW_H_ #define _ARRAYVIEW_H_ #include "FArrayBox.H" #include "MultiFab.H" #ifdef BL_ARRAYVIEW_TAGBOX #include "TagBox.H" #endif #include "DatasetClient.H" // ------------------------------------------------------------- void NeverCalled() { ArrayView(NULL); ArrayViewFab(NULL); ArrayViewFabFormatLabel(NULL, "%7.5f", "FabLabel"); ArrayViewMultiFabElement(NULL, 0); ArrayViewMultiFabElementFormatLabel(NULL, 0, "%7.5f", "MultiFabLabel"); ArrayViewMultiFab(NULL); ArrayViewMultiFabFormatLabel(NULL, "%7.5f", "MultiFabLabel"); ArrayViewReal(NULL, NULL, NULL); ArrayViewRealFormatLabel(NULL, NULL, NULL, "%7.5f", "RealLabel"); ArrayViewRealNVar(NULL, 0, NULL, NULL); ArrayViewRealNVarFormatLabel(NULL, 0, NULL, NULL, "%7.5f", "RealLabel"); #if (BL_SPACEDIM == 2) ArrayViewRealDims(NULL, 0, 0, 1, 1); ArrayViewRealDimsFormatLabel(NULL, 0, 0, 1, 1, "%7.5f", "RealLabel"); ArrayViewRealNVarDims(NULL, 1, 0, 0, 1, 1); ArrayViewRealNVarDimsFormatLabel(NULL, 1, 0, 0, 1, 1, "%7.5f", "RealLabel"); #else ArrayViewRealDims(NULL, 0, 0, 0, 1, 1, 1); ArrayViewRealDimsFormatLabel(NULL, 0, 0, 0, 1, 1, 1, "%7.5f", "RealLabel"); ArrayViewRealNVarDims(NULL, 1, 0, 0, 0, 1, 1, 1); ArrayViewRealNVarDimsFormatLabel(NULL, 1, 0, 0, 0, 1, 1, 1, "%7.5f", "RealLabel"); #endif ArrayViewRealPtrArrayNVarDims(NULL, 1, NULL, NULL, "%7.5f", "RealLabel"); #ifdef BL_ARRAYVIEW_TAGBOX ArrayViewTagBox(NULL); ArrayViewTagBoxArray(NULL); #endif } // ------------------------------------------------------------- // ------------------------------------------------------------- #endif ccseapps-2.5/CCSEApps/pAmrvis/amrvis.defaults0000644000175000017500000000107711634153073022337 0ustar amckinstryamckinstrypalette Pal8.new palette Palette initialderived tracer initialderived temp initialscale 4 initialscale 1 numberformat %8.5f numberformat %8.5e numberformat %10.2e maxpixmapsize 100000 maxpixmapsize 20000000 maxpixmapsize 1000000 reservesystemcolors 38 reservesystemcolors 24 reservesystemcolors 34 showboxes FALSE showboxes TRUE windowheight 550 windowwidth 800 filetype newplt lowblack cliptoppalette ccseapps-2.5/CCSEApps/pAmrvis/DataServices.H0000644000175000017500000001255311634153073021774 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: DataServices.H,v 1.19 2003/03/12 07:40:56 vince Exp $ // // --------------------------------------------------------------- // DataServices.H // --------------------------------------------------------------- #ifndef _DATASERVICES_H_ #define _DATASERVICES_H_ #include "Array.H" #include "AmrData.H" #include #include using std::string; class XYPlotDataList; class DataServices { public: enum DSRequestType { InvalidRequestType = 0, ExitRequest, NewRequest, DeleteRequest, FillVarOneFab, FillVarArrayOfFabs, FillVarMultiFab, WriteFabOneVar, WriteFabAllVars, DumpSlicePlaneOneVar, DumpSlicePlaneAllVars, DumpSliceBoxOneVar, DumpSliceBoxAllVars, MinMaxRequest, PointValueRequest, #ifndef BL_NOLINEVALUES LineValuesRequest #endif }; DataServices(const string &filename, const FileType &filetype); ~DataServices(); static void SetBatchMode(); static void Dispatch(DSRequestType requestType, DataServices *ds, ...); static void SetFabOutSize(int iSize); private: // Dispatchable functions // FillVarOneFab bool FillVar(FArrayBox *destFab, const Box &destBox, int finestFillLevel, const string &varname, int procWithFab); // FillVarArrayOfFabs //bool FillVar(Array &destFabs, const Array &destBoxes, //int finestFillLevel, const string &varname, //int procWithFab); // FillVarMultiFab bool FillVar(MultiFab &destMultiFab, int finestFillLevel, const string &varname); // WriteFabOneVar: write a single variable to one fab bool WriteFab(const string &fabfilename, const Box ®ion, int lev, const string &varname); // WriteFabAllVars: write all vars in one fab bool WriteFab(const string &fabfilename, const Box ®ion, int lev); // DumpSlicePlaneOneVar bool DumpSlice(int slicedir, int slicenum, const string &varname); // DumpSlicePlaneAllVars bool DumpSlice(int slicedir, int slicenum); // DumpSliceBoxOneVar bool DumpSlice(const Box &slicebox, const string &varname); // DumpSliceBoxAllVars bool DumpSlice(const Box &slicebox); // MinMaxRequest bool MinMax(const Box &onBox, const string &derived, int level, Real &dataMin, Real &dataMax, bool &minMaxValid); // PointValueRequest void PointValue(int pointBoxArraySize, Box *pointBoxArray, const string ¤tDerived, int coarsestLevelToSearch, int finestLevelToSearch, int &intersectedLevel, Box &intersectedGrid, Real &dataPointValue, bool &bPointIsValid); #ifndef BL_NOLINEVALUES // LineValuesRequest void LineValues(int lineBoxArraySize, Box *lineBoxArray, int whichDir, const string ¤tDerived, int coarsestLevelToSearch, int finestLevelToSearch, XYPlotDataList *dataList, bool &lineIsValid); #endif public: // information functions const string &GetFileName() const { return fileName; } FileType GetFileType() const { return fileType; } bool CanDerive(const string &name) const; int NumDeriveFunc() const; void ListDeriveFunc(std::ostream &os) const; const Array &PlotVarNames() const { return amrData.PlotVarNames(); } AmrData &AmrDataRef() { return amrData; } bool AmrDataOk() { return bAmrDataOk; } void SetWriteToLevel(const int iwtlev) { iWriteToLevel = iwtlev; } // other functions int GetNumberOfUsers() const { return numberOfUsers; } void IncrementNumberOfUsers() { ++numberOfUsers; } void DecrementNumberOfUsers() { --numberOfUsers; } private: const string fileName; const FileType fileType; AmrData amrData; bool bAmrDataOk; int dsArrayIndex; int numberOfUsers; int iWriteToLevel; static Array dsArray; static int dsArrayIndexCounter; static int dsFabOutSize; static bool dsBatchMode; }; #endif ccseapps-2.5/CCSEApps/pAmrvis/DatasetClient.H0000644000175000017500000001270611634153073022143 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: DatasetClient.H,v 1.4 2000/10/02 20:53:08 lijewski Exp $ // // --------------------------------------------------------------- // DatasetClient.H // --------------------------------------------------------------- #ifndef _DATASETCLIENT_H_ #define _DATASETCLIENT_H_ #include "REAL.H" #include #include #ifdef BL_ARRAYVIEW_TAGBOX class TagBox; class TagBoxArray; #endif extern "C" { // ------------------------------------------------------------- // "format" is the printf format for numerical display ( ex: "%5.3f" ). // "label" is the first part of the window title ( ex: "myfabname" ). // "element" is a single element of a MultiFab (which is a fab). // "nvar" is the number of variables in a Real array. // "lodim" and "hidim" are array dimensions of size [BL_SPACEDIM] // ------------------------------------------------------------- // ------------------------------------------------------------- // pointer to fab interface bool ArrayView(FArrayBox *fab); bool ArrayViewFab(FArrayBox *fab); bool ArrayViewFabFormatLabel(FArrayBox *fab, const char *format, const char *label); // ------------------------------------------------------------- // pointer to MultiFab interface // view a single fab from the multifab bool ArrayViewMultiFabElement(MultiFab *multifab, int element); bool ArrayViewMultiFabElementFormatLabel(MultiFab *multifab, int element, const char *format, const char *label); // view the entire multifab bool ArrayViewMultiFab(MultiFab *multifab); bool ArrayViewMultiFabFormatLabel(MultiFab *multifab, const char *format, const char *label); // ------------------------------------------------------------- // pointer to real interface bool ArrayViewReal(Real *data, const int *lodim, const int *hidim); bool ArrayViewRealFormatLabel(Real *data, const int *lodim, const int *hidim, const char *format, const char *label); bool ArrayViewRealNVar(Real *data, int nvar, const int *lodim, const int *hidim); bool ArrayViewRealNVarFormatLabel(Real *data, int nvar, const int *lodim, const int *hidim, const char *format, const char *label); #if (BL_SPACEDIM == 2) bool ArrayViewRealDims(Real *data, int xlo, int ylo, int xhi, int yhi); bool ArrayViewRealDimsFormatLabel(Real *data, int xlo, int ylo, int xhi, int yhi, const char *format, const char *label); bool ArrayViewRealNVarDims(Real *data, int nvar, int xlo, int ylo, int xhi, int yhi); bool ArrayViewRealNVarDimsFormatLabel(Real *data, int nvar, int xlo, int ylo, int xhi, int yhi, const char *format, const char *label); #else bool ArrayViewRealDims(Real *data, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi); bool ArrayViewRealDimsFormatLabel(Real *data, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi, const char *format, const char *label); bool ArrayViewRealNVarDims(Real *data, int nvar, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi); bool ArrayViewRealNVarDimsFormatLabel(Real *data, int nvar, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi, const char *format, const char *label); #endif bool ArrayViewRealPtrArrayNVarDims(Real *data[], int nvar, // size nvar const int *lodim, const int *hidim, // size BL_SPACEDIM const char *format, const char *label); #ifdef BL_ARRAYVIEW_TAGBOX // ------------------------------------------------------------- // pointer to TagBox interface bool ArrayViewTagBox(TagBox *tagbox); // ------------------------------------------------------------- // pointer to TagBoxArray interface bool ArrayViewTagBoxArray(TagBoxArray *tagboxarray); #endif }; // ------------------------------------------------------------- // ------------------------------------------------------------- #endif ccseapps-2.5/CCSEApps/pAmrvis/ProjectionPicture.H0000644000175000017500000001311011634153073023055 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ProjectionPicture.H,v 1.22 2002/12/10 20:12:23 vince Exp $ // // --------------------------------------------------------------- // ProjectionPicture.H // --------------------------------------------------------------- #ifndef _PROJECTIONPICTURE_H_ #define _PROJECTIONPICTURE_H_ #include #undef index #include "AmrPicture.H" #include "ViewTransform.H" #include "Palette.H" #ifdef BL_VOLUMERENDER #include "VolRender.H" #endif class PltApp; // represents data points in physical space that connect lines to other points class RealPoint { public: RealPoint() { component[0] = component[1] = component[2] = 0.0; } Real component[3]; RealPoint(Real r1, Real r2, Real r3) { component[0] = r1; component[1] = r2; component[2] = r3; } }; // represents box points in screen space with color values class TransPoint { public: TransPoint() { x = y = 0; } int x, y; TransPoint( int n1, int n2) { x = n1; y = n2; } }; class RealBox { public: RealBox(); ~RealBox() { } RealBox(const Box &theBox); RealPoint vertices[8]; }; class TransBox { public: TransBox(); ~TransBox() { } void Draw(Display *display, Window window, GC gc); TransPoint vertices[8]; }; class RealSlice { public: RealSlice(); ~RealSlice() {} RealSlice(int count, int slice, const Box &worldBox); RealSlice(RealPoint p1, RealPoint p2, RealPoint p3, RealPoint p4); void ChangeSlice(int NewSlice); RealPoint edges[4]; int dirOfFreedom; // [0, 2] }; class TransSlice { public: TransSlice(); ~TransSlice() {} TransSlice(TransPoint p1, TransPoint p2, TransPoint p3, TransPoint p4); void Draw(Display *display, Window window, GC gc); TransPoint edges[4]; }; //----------------------------------------------------------------- class ProjectionPicture { public: ProjectionPicture(PltApp *, ViewTransform *, Palette *, Widget, int, int); ~ProjectionPicture(); #ifdef BL_VOLUMERENDER VolRender *GetVolRenderPtr() const { return volRender; } #endif void MakeBoxes(); void MakeSlices(); void MakePicture(); void DrawBoxesIntoDrawable(const Drawable &drawable, int iFromLevel, int iToLevel); void DrawBoxes(int iFromLevel, int iToLevel); XImage *DrawBoxesIntoPixmap(int iFromLevel, int iToLevel); void DrawPicture(); void LabelAxes(); void ToggleShowSubCut(); void SetSubCut(const Box &newbox); void SetDrawingAreaDimensions(int w, int h); // called when resized void SetDrawingArea(Widget drawhere) { drawingArea = drawhere; } XImage *GetPictureXImage() const { return PPXImage; } int ImageSizeH() const { return daWidth; } int ImageSizeV() const { return daHeight; } void ChangeSlice(int Dir, int newSlice); Real LongestBoxSide() const { return longestBoxSide; } private: enum { NVERTICIES = 8 }; Widget drawingArea; AmrPicture *amrPicturePtr; ViewTransform *viewTransformPtr; Array > boxReal; Array > boxTrans; Real longestBoxSide; RealBox realBoundingBox; TransBox transBoundingBox; RealBox realSubCutBox; TransBox transSubCutBox; RealSlice realSlice[3]; TransSlice transSlice[3]; Array boxPoints; Array boxColors; int subCutColor, sliceColor, daWidth, daHeight; bool showSubCut, pixCreated; int minDrawnLevel, maxDrawnLevel, maxDataLevel; Real xcenter, ycenter, zcenter; Pixmap pixMap; Palette *palettePtr; unsigned char *imageData, *volpackImageData; XImage *PPXImage; Array theDomain; char buffer[BUFSIZ]; PltApp *pltAppPtr; Real scale[3]; Real longestWindowLength, shortestWindowLength; int longestBoxSideDir; int nDenRampPts, nGradRampPts, nShadeRampPts; int maxDenRampPts, maxGradRampPts, maxShadeRampPts; unsigned char volumeBoxColor; #ifdef BL_VOLUMERENDER VolRender *volRender; #endif void MakeAuxiliaries(); void MakeBoundingBox(); void MakeSubCutBox(); void DrawAuxiliaries(const Drawable &drawable); void DrawSlices(const Drawable &drawable); void LoadSlices(const Box &surroundingBox); // converts a Box to eight BoxRealPoints at the specified level void AddBox(const Box &theBox, int index, int level); void TransformBoxPoints(int iLevel, int iBoxIndex); }; //-------------------------------------------------------------------- #endif ccseapps-2.5/CCSEApps/pAmrvis/ProjectionPicture.cpp0000644000175000017500000005442611634153073023467 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ProjectionPicture.cpp,v 1.51 2003/02/28 02:01:38 vince Exp $ // // --------------------------------------------------------------- // ProjectionPicture.cpp // --------------------------------------------------------------- #include #include "ProjectionPicture.H" #include "PltApp.H" #include "PltAppState.H" #include "DataServices.H" #include "Volume.H" #include #include using std::min; using std::max; using std::cout; using std::endl; using std::cout; using std::endl; using std::min; using std::max; // ------------------------------------------------------------------- ProjectionPicture::ProjectionPicture(PltApp *pltappptr, ViewTransform *vtptr, Palette *PalettePtr, Widget da, int w, int h) { int lev; pltAppPtr = pltappptr; amrPicturePtr = pltAppPtr->GetAmrPicturePtr(XY); minDrawnLevel = pltAppPtr->GetPltAppState()->MinDrawnLevel(); maxDrawnLevel = pltAppPtr->GetPltAppState()->MaxDrawnLevel(); drawingArea = da; viewTransformPtr = vtptr; daWidth = w; daHeight = h; palettePtr = PalettePtr; volumeBoxColor = (unsigned char) AVGlobals::GetBoxColor(); volumeBoxColor = max((unsigned char) palettePtr->PaletteStart(), min((unsigned char) AVGlobals::MaxPaletteIndex(), volumeBoxColor)); showSubCut = false; pixCreated = false; imageData = NULL; volpackImageData = 0; maxDataLevel = pltAppPtr->GetPltAppState()->MaxAllowableLevel(); theDomain = amrPicturePtr->GetSubDomain(); #ifdef BL_VOLUMERENDER volRender = new VolRender(theDomain, minDrawnLevel, maxDrawnLevel, palettePtr, pltAppPtr->GetLightingFileName()); #endif SetDrawingAreaDimensions(daWidth, daHeight); const AmrData &amrData = pltAppPtr->GetDataServicesPtr()->AmrDataRef(); boxReal.resize(maxDataLevel + 1); boxTrans.resize(maxDataLevel + 1); for(lev = minDrawnLevel; lev <= maxDataLevel; ++lev) { int nBoxes(amrData.NIntersectingGrids(lev, theDomain[lev])); boxReal[lev].resize(nBoxes); boxTrans[lev].resize(nBoxes); } subCutColor = 160; sliceColor = 100; boxColors.resize(maxDataLevel + 1); for(lev = minDrawnLevel; lev <= maxDataLevel; ++lev) { int iBoxIndex(0); if(lev == minDrawnLevel) { boxColors[lev] = pltAppPtr->GetPalettePtr()->WhiteIndex(); } else { boxColors[lev] = palettePtr->SafePaletteIndex(lev); } boxColors[lev] = max(0, min(AVGlobals::MaxPaletteIndex(), boxColors[lev])); for(int iBox(0); iBox < amrData.boxArray(lev).size(); ++iBox) { Box temp(amrData.boxArray(lev)[iBox]); if(temp.intersects(theDomain[lev])) { temp &= theDomain[lev]; AddBox(temp.refine(AVGlobals::CRRBetweenLevels(lev, maxDataLevel, amrData.RefRatio())), iBoxIndex, lev); ++iBoxIndex; } } } Box alignedBox(theDomain[minDrawnLevel]); alignedBox.refine(AVGlobals::CRRBetweenLevels(minDrawnLevel, maxDataLevel, amrData.RefRatio())); realBoundingBox = RealBox(alignedBox); LoadSlices(alignedBox); xcenter = (theDomain[maxDataLevel].bigEnd(XDIR) - theDomain[maxDataLevel].smallEnd(XDIR)) / 2 + theDomain[maxDataLevel].smallEnd(XDIR); ycenter = (theDomain[maxDataLevel].bigEnd(YDIR) - theDomain[maxDataLevel].smallEnd(YDIR)) / 2 + theDomain[maxDataLevel].smallEnd(YDIR); zcenter = (theDomain[maxDataLevel].bigEnd(ZDIR) - theDomain[maxDataLevel].smallEnd(ZDIR)) / 2 + theDomain[maxDataLevel].smallEnd(ZDIR); // center of 3D object viewTransformPtr->SetObjCenter(xcenter, ycenter, zcenter); viewTransformPtr->SetScreenPosition(daWidth/2, daHeight/2); } // end ProjectionPicture() // ------------------------------------------------------------------- ProjectionPicture::~ProjectionPicture() { delete [] imageData; delete [] volpackImageData; if(pixCreated) { XFreePixmap(XtDisplay(drawingArea), pixMap); } #ifdef BL_VOLUMERENDER delete volRender; #endif } // ------------------------------------------------------------------- void ProjectionPicture::AddBox(const Box &theBox, int index, int level) { boxReal[level][index] = RealBox(theBox); } // ------------------------------------------------------------------- void ProjectionPicture::TransformBoxPoints(int iLevel, int iBoxIndex) { Real px, py, pz; for(int i(0); i < NVERTICIES; ++i) { viewTransformPtr-> TransformPoint(boxReal[iLevel][iBoxIndex].vertices[i].component[0], boxReal[iLevel][iBoxIndex].vertices[i].component[1], boxReal[iLevel][iBoxIndex].vertices[i].component[2], px, py, pz); boxTrans[iLevel][iBoxIndex].vertices[i] = TransPoint((int)(px + 0.5), daHeight - (int)(py + 0.5)); } } // ------------------------------------------------------------------- void ProjectionPicture::MakeBoxes() { minDrawnLevel = pltAppPtr->GetPltAppState()->MinDrawnLevel(); maxDrawnLevel = pltAppPtr->GetPltAppState()->MaxDrawnLevel(); if(pltAppPtr->GetPltAppState()->GetShowingBoxes()) { for(int iLevel(minDrawnLevel); iLevel <= maxDrawnLevel; ++iLevel) { int nBoxes(boxTrans[iLevel].size()); for(int iBox(0); iBox < nBoxes; ++iBox) { TransformBoxPoints(iLevel, iBox); } } } MakeAuxiliaries(); // make subcut, boundingbox, slices } // ------------------------------------------------------------------- void ProjectionPicture::MakeAuxiliaries() { if(showSubCut) { MakeSubCutBox(); } MakeBoundingBox(); MakeSlices(); } // ------------------------------------------------------------------- void ProjectionPicture::MakeBoundingBox() { Real px, py, pz; for(int i(0); i < NVERTICIES; ++i) { viewTransformPtr-> TransformPoint(realBoundingBox.vertices[i].component[0], realBoundingBox.vertices[i].component[1], realBoundingBox.vertices[i].component[2], px, py, pz); transBoundingBox.vertices[i] = TransPoint((int)(px + 0.5), daHeight - (int)(py + 0.5)); } } // ------------------------------------------------------------------- void ProjectionPicture::MakeSubCutBox() { Real px, py, pz; minDrawnLevel = pltAppPtr->GetPltAppState()->MinDrawnLevel(); maxDrawnLevel = pltAppPtr->GetPltAppState()->MaxDrawnLevel(); for(int i(0); i < NVERTICIES; ++i) { viewTransformPtr-> TransformPoint(realSubCutBox.vertices[i].component[0], realSubCutBox.vertices[i].component[1], realSubCutBox.vertices[i].component[2], px, py, pz); transSubCutBox.vertices[i] = TransPoint((int) (px + 0.5), daHeight - (int) (py + 0.5)); } } // ------------------------------------------------------------------- void ProjectionPicture::MakeSlices() { Real px, py, pz; for(int j(0); j < 3 ; ++j) { for(int i(0); i < 4; ++i) { viewTransformPtr->TransformPoint(realSlice[j].edges[i].component[0], realSlice[j].edges[i].component[1], realSlice[j].edges[i].component[2], px, py, pz); transSlice[j].edges[i] = TransPoint((int) (px + 0.5), daHeight - (int) (py + 0.5)); } } } // ------------------------------------------------------------------- void ProjectionPicture::MakePicture() { #ifdef BL_VOLUMERENDER clock_t time0 = clock(); scale[XDIR] = viewTransformPtr->GetScale(); scale[YDIR] = viewTransformPtr->GetScale(); scale[ZDIR] = viewTransformPtr->GetScale(); Real mvmat[4][4]; Real tempLenRatio(longestWindowLength/(scale[longestBoxSideDir]*longestBoxSide)); Real tempLen(0.5 * tempLenRatio); viewTransformPtr->SetAdjustments(tempLen, daWidth, daHeight); viewTransformPtr->MakeTransform(); viewTransformPtr->GetRenderRotationMat(mvmat); volRender->MakePicture(mvmat, tempLen, daWidth, daHeight); // map imageData colors to colormap range Palette *palPtr = pltAppPtr->GetPalettePtr(); cout << "&&&&&&&&&&&&&&& colorslots palsize = " << palPtr->ColorSlots() << " " << palPtr->PaletteSize() << endl; if(palPtr->ColorSlots() != palPtr->PaletteSize()) { const unsigned char *remapTable = palPtr->RemapTable(); for(int idat(0); idat < daWidth * daHeight; ++idat) { volpackImageData[idat] = remapTable[(unsigned char) volpackImageData[idat]]; } } for(int j(0); j < daHeight; ++j ) { for(int i(0); i < daWidth; ++i ) { unsigned char imm1 = volpackImageData[i+j*daWidth]; XPutPixel(PPXImage, i, j, palPtr->makePixel(imm1)); // imageData[i+j*daWidth] = imm1; } } XPutImage(XtDisplay(drawingArea), pixMap, XtScreen(drawingArea)-> default_gc, PPXImage, 0, 0, 0, 0, daWidth, daHeight); cout << "----- make picture time = " << ((clock()-time0)/1000000.0) << endl; #endif } // end MakePicture() // ------------------------------------------------------------------- void ProjectionPicture::DrawBoxes(int iFromLevel, int iToLevel) { DrawBoxesIntoDrawable(XtWindow(drawingArea), iFromLevel, iToLevel); } // ------------------------------------------------------------------- void ProjectionPicture::DrawBoxesIntoDrawable(const Drawable &drawable, int iFromLevel, int iToLevel) { minDrawnLevel = pltAppPtr->GetPltAppState()->MinDrawnLevel(); maxDrawnLevel = pltAppPtr->GetPltAppState()->MaxDrawnLevel(); if(pltAppPtr->GetPltAppState()->GetShowingBoxes()) { for(int iLevel(iFromLevel); iLevel <= iToLevel; ++iLevel) { // FIXME: XSetForeground(XtDisplay(drawingArea), XtScreen(drawingArea)->default_gc, boxColors[iLevel]); int nBoxes(boxTrans[iLevel].size()); for(int iBox(0); iBox < nBoxes; ++iBox) { boxTrans[iLevel][iBox].Draw(XtDisplay(drawingArea), drawable, XtScreen(drawingArea)->default_gc); } } } DrawAuxiliaries(drawable); // FIXME: XSetForeground(XtDisplay(drawingArea), XtScreen(drawingArea)->default_gc, boxColors[minDrawnLevel]); //viewTransformPtr->ViewRotationMat(); } // ------------------------------------------------------------------- void ProjectionPicture::DrawAuxiliaries(const Drawable &drawable) { if(showSubCut) { // FIXME: XSetForeground(XtDisplay(drawingArea), XtScreen(drawingArea)->default_gc, subCutColor); transSubCutBox.Draw(XtDisplay(drawingArea),drawable, XtScreen(drawingArea)->default_gc); } //bounding box // FIXME: XSetForeground(XtDisplay(drawingArea), XtScreen(drawingArea)->default_gc, boxColors[minDrawnLevel]); transBoundingBox.Draw(XtDisplay(drawingArea), drawable, XtScreen(drawingArea)->default_gc); DrawSlices(drawable); } // ------------------------------------------------------------------- void ProjectionPicture::DrawSlices(const Drawable &drawable) { Palette* palPtr = pltAppPtr->GetPalettePtr(); XSetForeground(XtDisplay(drawingArea), XtScreen(drawingArea)->default_gc, palPtr->pixelate(sliceColor)); for(int k = 0; k < 3; ++k) { transSlice[k].Draw(XtDisplay(drawingArea), drawable, XtScreen(drawingArea)->default_gc); } } // ------------------------------------------------------------------- void ProjectionPicture::LoadSlices(const Box &surroundingBox) { for(int j = 0; j < 3 ; ++j) { int slice(pltAppPtr->GetAmrPicturePtr(j)->GetSlice()); realSlice[j] = RealSlice(j,slice,surroundingBox); } } // ------------------------------------------------------------------- void ProjectionPicture::ChangeSlice(int Dir, int newSlice) { for(int j(0); j < 3; ++j) { if(Dir == j) { realSlice[j].ChangeSlice(newSlice); } } } // ------------------------------------------------------------------- XImage *ProjectionPicture::DrawBoxesIntoPixmap(int iFromLevel, int iToLevel) { XSetForeground(XtDisplay(drawingArea), XtScreen(drawingArea)->default_gc, palettePtr->BlackIndex()); XFillRectangle(XtDisplay(drawingArea), pixMap, XtScreen(drawingArea)->default_gc, 0, 0, daWidth, daHeight); DrawBoxesIntoDrawable(pixMap, iFromLevel, iToLevel); return XGetImage(XtDisplay(drawingArea), pixMap, 0, 0, daWidth, daHeight, AllPlanes, ZPixmap); } // ------------------------------------------------------------------- void ProjectionPicture::DrawPicture() { XCopyArea(XtDisplay(drawingArea), pixMap, XtWindow(drawingArea), XtScreen(drawingArea)->default_gc, 0, 0, daWidth, daHeight, 0, 0); } // ------------------------------------------------------------------- void ProjectionPicture::LabelAxes() { const int xHere(1); // Where to label axes with X, Y, and Z const int yHere(3); const int zHere(4); minDrawnLevel = pltAppPtr->GetPltAppState()->MinDrawnLevel(); maxDrawnLevel = pltAppPtr->GetPltAppState()->MaxDrawnLevel(); XDrawString(XtDisplay(drawingArea), XtWindow(drawingArea), XtScreen(drawingArea)->default_gc, transBoundingBox.vertices[xHere].x, transBoundingBox.vertices[xHere].y, "X", 1); XDrawString(XtDisplay(drawingArea), XtWindow(drawingArea), XtScreen(drawingArea)->default_gc, transBoundingBox.vertices[yHere].x, transBoundingBox.vertices[yHere].y, "Y", 1); XDrawString(XtDisplay(drawingArea), XtWindow(drawingArea), XtScreen(drawingArea)->default_gc, transBoundingBox.vertices[zHere].x, transBoundingBox.vertices[zHere].y, "Z", 1); } // ------------------------------------------------------------------- void ProjectionPicture::ToggleShowSubCut() { showSubCut = (showSubCut ? false : true); } // ------------------------------------------------------------------- void ProjectionPicture::SetSubCut(const Box &newbox) { realSubCutBox = RealBox(newbox); MakeSubCutBox(); } // ------------------------------------------------------------------- void ProjectionPicture::SetDrawingAreaDimensions(int w, int h) { minDrawnLevel = pltAppPtr->GetPltAppState()->MinDrawnLevel(); maxDrawnLevel = pltAppPtr->GetPltAppState()->MaxDrawnLevel(); daWidth = w; daHeight = h; int widthpad = (1+(w-1)/(XBitmapPad(XtDisplay(drawingArea))/8))*XBitmapPad(XtDisplay(drawingArea))/8; if(imageData != NULL) { delete [] imageData; delete [] volpackImageData; } volpackImageData = new unsigned char[daWidth*daHeight]; imageData = static_cast (malloc(widthpad * daHeight * XBitmapPad(XtDisplay(drawingArea)) / 8)); if(imageData == NULL || volpackImageData == NULL ) { cout << " SetDrawingAreaDimensions::imageData : new failed" << endl; BoxLib::Abort("Exiting."); } viewTransformPtr->SetScreenPosition(daWidth / 2, daHeight / 2); PPXImage = XCreateImage(XtDisplay(drawingArea), XDefaultVisual(XtDisplay(drawingArea), DefaultScreen(XtDisplay(drawingArea))), DefaultDepthOfScreen(XtScreen(drawingArea)), ZPixmap, 0, (char *) imageData, widthpad, daHeight, XBitmapPad(XtDisplay(drawingArea)), widthpad * XBitmapPad(XtDisplay(drawingArea)) / 8); if(pixCreated) { XFreePixmap(XtDisplay(drawingArea), pixMap); } pixMap = XCreatePixmap(XtDisplay(drawingArea), XtWindow(drawingArea), daWidth, daHeight, DefaultDepthOfScreen(XtScreen(drawingArea))); pixCreated = true; #ifdef BL_VOLUMERENDER // --- set the image buffer volRender->SetImage( (unsigned char *) volpackImageData, daWidth, daHeight, VP_LUMINANCE); #endif longestWindowLength = (Real) max(daWidth, daHeight); shortestWindowLength = (Real) min(daWidth, daHeight); if(longestWindowLength == 0) { // this happens when x deletes this window #ifdef BL_VOLUMERENDER volRender->SetAspect(1.0); #endif viewTransformPtr->SetAspect(1.0); } else { #ifdef BL_VOLUMERENDER volRender->SetAspect(shortestWindowLength/longestWindowLength); #endif viewTransformPtr->SetAspect(shortestWindowLength/longestWindowLength); } Box alignedBox(theDomain[minDrawnLevel]); const AmrData &amrData = pltAppPtr->GetDataServicesPtr()->AmrDataRef(); alignedBox.refine(AVGlobals::CRRBetweenLevels(minDrawnLevel, maxDataLevel, amrData.RefRatio())); longestBoxSide = (Real) alignedBox.longside(longestBoxSideDir); } //-------------------------------------------------------------------- //----- BOX AND POINT STUFF------------------------------------------- //-------------------------------------------------------------------- //-------------------------------------------------------------------- RealBox::RealBox() { } //-------------------------------------------------------------------- RealBox::RealBox(const Box &theBox) { Real dimensions[6] = { theBox.smallEnd(XDIR), theBox.smallEnd(YDIR), theBox.smallEnd(ZDIR), theBox.bigEnd(XDIR)+1, theBox.bigEnd(YDIR)+1, theBox.bigEnd(ZDIR)+1 }; vertices[0] = RealPoint(dimensions[0], dimensions[1], dimensions[2]); vertices[1] = RealPoint(dimensions[3], dimensions[1], dimensions[2]); vertices[2] = RealPoint(dimensions[3], dimensions[4], dimensions[2]); vertices[3] = RealPoint(dimensions[0], dimensions[4], dimensions[2]); vertices[4] = RealPoint(dimensions[0], dimensions[1], dimensions[5]); vertices[5] = RealPoint(dimensions[3], dimensions[1], dimensions[5]); vertices[6] = RealPoint(dimensions[3], dimensions[4], dimensions[5]); vertices[7] = RealPoint(dimensions[0], dimensions[4], dimensions[5]); } //-------------------------------------------------------------------- TransBox::TransBox() { TransPoint zero(0,0); for(int i(0); i < 8 ; ++i) { vertices[i] = zero; } } //-------------------------------------------------------------------- void TransBox::Draw(Display *display, Window window, GC gc) { for(int j(0); j < 2; ++j) { for(int i(0); i < 3; ++i) { XDrawLine(display, window, gc, vertices[j*4+i].x, vertices[j*4+i].y, vertices[j*4+i+1].x, vertices[j*4+i+1].y); } XDrawLine(display, window, gc, vertices[j*4].x, vertices[j*4].y, vertices[j*4+3].x, vertices[j*4+3].y); } for(int k(0); k < 4; ++k) { XDrawLine(display, window, gc, vertices[k].x, vertices[k].y, vertices[k+4].x, vertices[k+4].y); } } //-------------------------------------------------------------------- RealSlice::RealSlice() { RealPoint zero(0.0, 0.0, 0.0); for(int i = 0; i < 4; ++i) { edges[i] = zero; } } //-------------------------------------------------------------------- RealSlice::RealSlice(RealPoint p1, RealPoint p2, RealPoint p3, RealPoint p4) { edges[0] = p1; edges[1] = p2; edges[2] = p3; edges[3] = p4; } //-------------------------------------------------------------------- RealSlice::RealSlice(int count, int slice, const Box &worldBox) { Real dimensions[6] = { worldBox.smallEnd(XDIR), worldBox.smallEnd(YDIR), worldBox.smallEnd(ZDIR), worldBox.bigEnd(XDIR)+1, worldBox.bigEnd(YDIR)+1, worldBox.bigEnd(ZDIR)+1 }; dirOfFreedom = count; if(dirOfFreedom == 0) { edges[0] = RealPoint(dimensions[0], dimensions[1], slice); edges[1] = RealPoint(dimensions[3], dimensions[1], slice); edges[2] = RealPoint(dimensions[3], dimensions[4], slice); edges[3] = RealPoint(dimensions[0], dimensions[4], slice); } if(dirOfFreedom == 1) { edges[0] = RealPoint(dimensions[0], slice, dimensions[2]); edges[1] = RealPoint(dimensions[3], slice, dimensions[2]); edges[2] = RealPoint(dimensions[3], slice, dimensions[5]); edges[3] = RealPoint(dimensions[0], slice, dimensions[5]); } if(dirOfFreedom == 2) { edges[0] = RealPoint(slice, dimensions[1], dimensions[2]); edges[1] = RealPoint(slice, dimensions[4], dimensions[2]); edges[2] = RealPoint(slice, dimensions[4], dimensions[5]); edges[3] = RealPoint(slice, dimensions[1], dimensions[5]); } } //-------------------------------------------------------------------- void RealSlice::ChangeSlice(int NewSlice) { for(int k(0); k < 4; ++k) { edges[k].component[2-dirOfFreedom] = NewSlice; } } //-------------------------------------------------------------------- TransSlice::TransSlice() { TransPoint zero(0,0); for(int i = 0; i < 4; ++i) { edges[i] = zero; } } //-------------------------------------------------------------------- TransSlice::TransSlice(TransPoint p1, TransPoint p2, TransPoint p3, TransPoint p4) { edges[0] = p1; edges[1] = p2; edges[2] = p3; edges[3] = p4; } //-------------------------------------------------------------------- void TransSlice::Draw(Display *display, Window window, GC gc) { for(int j = 0; j < 3; ++j) { XDrawLine(display, window, gc, edges[j].x, edges[j].y, edges[j+1].x,edges[j+1].y); } XDrawLine(display, window, gc, edges[0].x, edges[0].y, edges[3].x, edges[3].y); } //-------------------------------------------------------------------- //-------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Palette0000644000175000017500000000200011634153073020611 0ustar amckinstryamckinstry #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúöñíéäàÛ×ÓÎÊÅÁ½¸´¯«§¢ž™•‘Œˆƒ #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'#   !!""##$$%%&&''(())**++,,--..//02223334445566677888999::;;;<<<==>>>???@@@AABBBCCDDDEEEFFFGGHHHIIJJJKKKLLLMMNNNOOPPQQRRSTTUUVVWXXYYZZ[\\]]^^__`aabbcdccseapps-2.5/CCSEApps/pAmrvis/ListIterator.H0000644000175000017500000002753611634153073022053 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_LIST_H #define BL_LIST_H // // $Id: ListIterator.H,v 1.2 2001/11/16 01:48:08 vince Exp $ // #include #include #ifdef BL_NAMESPACE namespace BL_NAMESPACE { #endif template class ListLink; template class ListIterator; template class List; template class ListLink { private: friend class List; friend class ListIterator; ListLink (const T& _val, ListLink* _pre, ListLink* _suc) : val(_val), pre(_pre), suc(_suc) {} private: T val; ListLink* pre; ListLink* suc; }; template class ListIterator { public: explicit ListIterator (const List& aList); ListIterator (const ListIterator& rhs); void rewind (); const T& operator() () const; const T& operator* () const; operator void* (); bool operator! () const; const T& value () const; ListIterator& operator++ (); ListIterator& operator-- (); ListIterator operator-- (int); ListIterator operator++ (int); bool operator== (const ListIterator&) const; bool operator!= (const ListIterator&) const; protected: ListIterator (const List& _list, ListLink* _p); const List& list; ListLink* p; private: friend class List; ListIterator (); ListIterator& operator= (const ListIterator&); }; template class List { public: List (); List (const List& rhs); List& operator= (const List& rhs); ~List(); void prepend (const T& value); void append (const T& value); void add (const T& value); void join (const List& src); void catenate (List& src); void clear (); T& firstElement () const; T& lastElement () const; bool includes (const T& value) const; bool operator== (const List& rhs) const; bool operator!= (const List& rhs) const; bool isEmpty () const; bool isNotEmpty () const; int length () const; void removeFirst (); void removeLast (); const T& operator[] (const ListIterator& li) const; T& operator[] (const ListIterator& li); void remove (const T& value); void remove (const List& lst); void remove (ListIterator& lit); void replace (ListIterator& li, const T& val); void addAfter (ListIterator& lit, const T& val); void addBefore (ListIterator& lit, const T& val); ListIterator first () const; ListIterator last () const; protected: void remove (ListLink *ln); ListLink* addBefore (ListLink* ln, const T& val); ListLink* addAfter (ListLink* ln, const T& val); ListLink* head; ListLink* tail; friend class ListIterator; }; template inline ListIterator::ListIterator (const List& _list, ListLink* _p) : list(_list), p(_p) {} template inline ListIterator::ListIterator (const List& aList) : list(aList) { p = list.head; } template inline ListIterator::ListIterator (const ListIterator& li) : list(li.list), p(li.p) {} template inline void ListIterator::rewind () { p = list.head; } template inline const T& ListIterator::operator() () const { BL_ASSERT(p != 0); return p->val; } template inline const T& ListIterator::operator* () const { BL_ASSERT(p != 0); return p->val; } template inline ListIterator::operator void* () { return p != 0 ? this : 0; } template inline bool ListIterator::operator! () const { return p == 0 ? true : false; } template inline const T& ListIterator::value () const { BL_ASSERT(p != 0); return p->val; } template inline ListIterator& ListIterator::operator++ () { if (p) p = p->suc; return *this; } template inline ListIterator& ListIterator::operator-- () { if (p) p = p->pre; return *this; } template inline ListIterator ListIterator::operator++ (int) { const ListIterator li = *this; ++(*this); return li; } template inline ListIterator ListIterator::operator-- (int) { const ListIterator li = *this; --(*this); return li; } template inline bool ListIterator::operator== (const ListIterator& _li) const { return (&list == &_li.list && p == _li.p) ? true : false; } template inline bool ListIterator::operator!= (const ListIterator& _li) const { return ! ListIterator::operator==(_li); } template inline List::List () : head(0), tail(0) {} template inline List::~List () { clear(); } template inline void List::prepend (const T& value) { addBefore(head, value); } template inline void List::append (const T& value) { addAfter(tail, value); } template inline T& List::firstElement () const { BL_ASSERT(head != 0); return head->val; } template inline T& List::lastElement () const { BL_ASSERT(tail != 0); return tail->val; } template inline bool List::isEmpty () const { return head == 0 && tail == 0; } template inline bool List::isNotEmpty () const { return !isEmpty(); } template inline void List::removeFirst () { remove(head); } template inline void List::removeLast () { remove(tail); } template inline const T& List::operator[] (const ListIterator& li) const { BL_ASSERT(li.p != 0); return li.p->val; } template inline T& List::operator[] (const ListIterator& li) { BL_ASSERT(li.p != 0); return li.p->val; } template inline void List::replace (ListIterator& li, const T& _val) { BL_ASSERT(li.p != 0); li.p->val = _val; } template inline void List::addAfter (ListIterator& lit, const T& val) { addAfter(lit.p, val); } template inline void List::addBefore (ListIterator& lit, const T& val) { addBefore(lit.p, val); } template inline ListIterator List::first () const { return ListIterator(*this,head); } template inline ListIterator List::last () const { return ListIterator(*this,tail); } template List::List (const List& source) : head(0), tail(0) { if (source.isEmpty()) tail = head = 0; else for (ListIterator li(source); li; ++li) append(li()); } template void List::add (const T& value) { append(value); } template int List::length () const { int len = 0; for (ListIterator li(*this); li; ++li) len++; return len; } template List& List::operator= (const List& source) { if (!(this == &source)) { clear(); for (ListIterator li(source); li; ++li) append(li()); } return *this; } template ListLink * List::addBefore (ListLink* ln, const T& val) { BL_ASSERT(ln != 0 || head == 0); ListLink* newlink; if (ln == head) { head = newlink = new ListLink(val, 0, head); if (tail == 0) tail = head; else head->suc->pre = newlink; } else { newlink = new ListLink(val, ln->pre, ln); ln->pre->suc = newlink; ln->pre = newlink; } return newlink; } template ListLink* List::addAfter (ListLink* ln, const T& val) { BL_ASSERT(ln != 0 || tail == 0); ListLink* newlink; if (ln == tail) { tail = newlink = new ListLink(val,tail,0); if (head == 0) head = tail; else tail->pre->suc = newlink; } else { newlink = new ListLink(val, ln, ln->suc); ln->suc->pre = newlink; ln->suc = newlink; } return newlink; } template void List::join (const List& list2) { for (ListIterator li2(list2); li2; ++li2) append(li2()); } template void List::catenate (List& list2) { if (list2.isEmpty()) // // Do nothing. // ; else if (isEmpty()) { head = list2.head; tail = list2.tail; list2.head = 0; list2.tail = 0; } else { tail->suc = list2.head; list2.head->pre = tail; tail = list2.tail; list2.head = 0; list2.tail = 0; } } template void List::clear () { ListLink* next = 0; for (ListLink* p = head; p != 0; p = next) { next = p->suc; p->suc = 0; delete p; } tail = head = 0; } template bool List::includes (const T& v) const { bool rc = false; for (ListIterator li(*this); li && !rc; ++li) if (v == li()) rc = true; return rc; } template bool List::operator== (const List& rhs) const { if (length() == rhs.length()) { for (ListIterator li(*this), ri(rhs); li; ++li, ++ri) if (li() != ri()) return false; return true; } return false; } template bool List::operator!= (const List& rhs) const { return !operator==(rhs); } template void List::remove (ListIterator& li) { ListLink *np = li.p->suc; remove(li.p); li.p = np; } template void List::remove (const T& _v) { for (ListIterator litr(*this); litr; ++litr) if (litr() == _v) remove(litr); } template void List::remove (const List& _lv) { for (ListIterator litr(_lv); litr; ++litr) remove(litr()); } template void List::remove (ListLink* ln) { BL_ASSERT(head !=0 && tail != 0); if (head == ln && tail == ln) head = tail = 0; else if (head == ln) { BL_ASSERT(ln->pre == 0); head = ln->suc; head->pre = 0; } else if (tail == ln) { BL_ASSERT(ln->suc == 0); tail = ln->pre; tail->suc = 0; } else { BL_ASSERT(ln->suc != 0 && ln->pre != 0); ln->suc->pre = ln->pre; ln->pre->suc = ln->suc; } delete ln; ln = 0; } #ifdef BL_NAMESPACE } #ifndef BL_NO_USING_DIRECTIVE using namespace BL_NAMESPACE; #endif #endif #endif /*BL_LIST_H*/ ccseapps-2.5/CCSEApps/pAmrvis/Trackball.cpp0000644000175000017500000000443711634153073021713 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Trackball.cpp,v 1.7 2002/02/19 20:39:41 vince Exp $ // // --------------------------------------------------------------- // Trackball.cpp // --------------------------------------------------------------- #include "Quaternion.H" #include "Point.H" #include "REAL.H" // --------------------------------------------------------------- static Real tb_project(Real x, Real y) { Real r2(x * x + y * y); return 1.0 / ( 1.0 + 0.5 *( r2 + 0.75 * r2 ) ); } // --------------------------------------------------------------- // Compute a quaternion rotation for the given two points, // assumed to be in the interval -1 to 1 // --------------------------------------------------------------- AmrQuaternion trackball(Real p1x, Real p1y, Real p2x, Real p2y) { AmrSpherePoint s1(p1x, p1y, tb_project(p1x, p1y)); AmrSpherePoint s2(p2x, p2y, tb_project(p2x, p2y)); return AmrQuaternion(s2,s1); } // --------------------------------------------------------------- // --------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/AmrData.H0000644000175000017500000002027311634153073020726 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrData.H,v 1.23 2002/02/26 01:00:01 vince Exp $ // // --------------------------------------------------------------- // AmrData.H // --------------------------------------------------------------- #ifndef _AMRDATA_H_ #define _AMRDATA_H_ #include "AmrvisConstants.H" #include "Array.H" #include "MultiFab.H" #include "VisMF.H" #include #include #include #include using std::list; using std::string; using std::vector; using std::istream; using std::ostream; class Interpolater; class AmrData { protected: // List of grids at each level, level 0 being coarsest. Array > dataGrids; // [level][component] //Array > > dataGridsDefined; // [level][component][index] vector > > dataGridsDefined; // [level][component][index] // ^^^^^^^^^^^^^^^^^^^^^^^^ need to put these in a class which handles // setting defined/not defined Array > visMF; // [level][whichMultiFab] Array compIndexToVisMFMap; // [nComp] Array compIndexToVisMFComponentMap; // [nComp] int finestLevel; // most refined level available Array refRatio; // refinement ratio between level L and L+1 Array< Array > dxLevel; // [level][dim]; // grid spacing Array< Array< Array > > gridLocLo, gridLocHi; Array probDomain; Array maxDomain; // max problem domain size Array probSize, probLo, probHi; Real time; Array plotVars; Array vfEps, afEps; int nComp, nGrow; int nRegions; // number of boundary regions int boundaryWidth; // number of zones in the boundary regions int coordSys; Array< Array< FArrayBox *> > regions; // [lev][nReg] ptrs to bndry data BoxArray fabBoxArray; // used only for fileType == FAB string plotFileVersion; FileType fileType; bool bCartGrid; bool bTerrain; public: AmrData(); ~AmrData(); bool ReadData(const string &filename, FileType filetype); bool ReadNonPlotfileData(const string &filename, FileType filetype); const Array &PlotVarNames() const { return plotVars; } int FinestLevel() const { return finestLevel; } const Array &RefRatio() const { return refRatio; } const BoxArray &boxArray(int level) const { if(fileType == FAB || (fileType == MULTIFAB && level == 0)) { return fabBoxArray; } else { // use visMF[][0]: all boxArrays are // guaranteed to be the same for each MultiFab return visMF[level][0]->boxArray(); } } // limits of interior region of computational domain at each level const Array &ProbDomain() const { return probDomain; } // physical size of computational domain const Array &ProbSize() const { return probSize; } const Array &ProbLo() const { return probLo; } const Array &ProbHi() const { return probHi; } // return physical location of cell at index ix, level lev // cellLoc = location of cell center // loNodeLoc = location of node (vertex) on lower left hand corner // hiNodeLoc = location of node (vertex) on upper right hand corner void CellLoc(int lev, IntVect ix, Array &pos) const; void LoNodeLoc(int lev, IntVect ix, Array &pos) const; void HiNodeLoc(int lev, IntVect ix, Array &pos) const; // find the IntVect given a physical location // returns the intvect, the finest level it is contained on, // and the intvect at the given finest level void IntVectFromLocation(const int finestFillLevel, const Array &location, IntVect &ivLoc, int &ivLevel, IntVect &ivFinestFillLev); const Array< Array< Array > > &GridLocLo() const { return gridLocLo; } const Array< Array< Array > > &GridLocHi() const { return gridLocHi; } const Array< Array > &DxLevel() const { return dxLevel; } int NComp() const { return nComp; } int BoundaryWidth() const { return boundaryWidth; } int NGrow() const { return nGrow; } int CoordSys() const { return coordSys; } Real Time() const { return time; } const string &PlotFileVersion() { return plotFileVersion; } // fill a databox using conservative interpolation void FillVar(FArrayBox *destFab, const Box &destBox, int finestFillLevel, const string &varName, int procWithFabs); void FillVar(Array &destFabs, const Array &destBoxes, int finestFillLevel, const string &varName, int procWithFabs); void FillVar(MultiFab &destMultiFab, int finestFillLevel, const Array &varNames, const Array &destFillComps); void FillVar(MultiFab &destMultiFab, int finestFillLevel, const string &varname, int destcomp = 0); const string &GetFileName() const { return fileName; } void SetFileType(FileType type); FileType GetFileType() const { return fileType; } bool CartGrid() const { return bCartGrid; } Real VfEps(int level) const { return vfEps[level]; } void SetVfEps(Real *newvfeps, int finestlev); bool Terrain() const { return bTerrain; } void SetBoundaryWidth(int width) { boundaryWidth = width; } bool CanDerive(const string &name) const; int NumDeriveFunc() const; void ListDeriveFunc(ostream &os) const; int StateNumber(const string &statename) const; // return the finest level <= startLevel that fully contains box b // b is defined on startLevel int FinestContainingLevel(const Box &b, int startLevel) const; // return the finest level <= startLevel that intersects box b // b is defined on startLevel int FinestIntersectingLevel(const Box &b, int startLevel) const; // number of grids at level which intersect b int NIntersectingGrids(int level, const Box &b) const; MultiFab &GetGrids(int level, int componentIndex); MultiFab &GetGrids(int level, int componentIndex, const Box &onBox); void FlushGrids(int componentIndex); // calculate the min and max values of derived on onBox at level // return false if onBox did not intersect any grids bool MinMax(const Box &onBox, const string &derived, int level, Real &dataMin, Real &dataMax); static void SetVerbose(bool tf) { verbose = tf; } static void SetSkipPltLines(int spl) { skipPltLines = spl; } static void SetStaticBoundaryWidth(int bw) { sBoundaryWidth = bw; } private: string fileName; static FileType defaultFileType; static bool verbose; static int skipPltLines; static int sBoundaryWidth; // fill on interior by piecewise constant interpolation void FillInterior(FArrayBox &dest, int level, const Box &subbox); void Interp(FArrayBox &fine, FArrayBox &crse, const Box &fine_box, int lrat); void PcInterp(FArrayBox &fine, const FArrayBox &crse, const Box &subbox, int lrat); FArrayBox *ReadGrid(istream &is, int numVar); bool DefineFab(int level, int componentIndex, int fabIndex); }; #endif ccseapps-2.5/CCSEApps/pAmrvis/GlobalUtilities.H0000644000175000017500000000776611634153073022525 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: GlobalUtilities.H,v 1.20 2002/12/10 20:12:23 vince Exp $ // // --------------------------------------------------------------- // GlobalUtilities.H // --------------------------------------------------------------- #ifndef _GLOBALUTILITIES_H_ #define _GLOBALUTILITIES_H_ #include "AmrvisConstants.H" #include "Box.H" #include "Array.H" #include #include using std::list; using std::string; namespace AVGlobals { Box GetBoxFromCommandLine(); void SetMaxPictureSize(int size); int MaxPictureSize(); int MaxPaletteIndex(); void SetVerbose(); bool Verbose(); void ParseCommandLine(int, char **); void GetDefaults(const string &defaultsfilename); bool ReadLightingFile(const string &lightdefaultsfilename, Real &ambientDef, Real &diffuseDef, Real &specularDef, Real &shinyDef, Real &minRayOpacityDef, Real &maxRayOpacityDef); bool WriteLightingFile(const string &lightdefaultsfilename, const Real &ambientDef, const Real &diffuseDef, const Real &specularDef, const Real &shinyDef, const Real &minRayOpacityDef, const Real &maxRayOpacityDef); void SetAnimation(); bool IsAnimation(); void SetSGIrgbFile(); void ClearSGIrgbFile(); bool IsSGIrgbFile(); int GetFileCount(); int SleepTime(); const string &GetComlineFilename(int index); string StripSlashes(const string &inString); FileType GetDefaultFileType(); bool GivenBox(); bool GivenBoxSlice(); bool GivenFilename(); int GetFileCount(); bool MakeSWFData(); bool MakeSWFLight(); bool LowBlack(); bool UseSpecifiedMinMax(); void SetSpecifiedMinMax(Real specifiedmin, Real specifiedmax); void GetSpecifiedMinMax(Real &specifiedmin, Real &specifiedmax); int CRRBetweenLevels(int fromlevel, int tolevel, const Array &refratios); int DetermineMaxAllowableLevel(const Box &finebox, int finestlevel, int maxpoints, const Array &refratios); void SetBoundaryWidth(int width); int GetBoundaryWidth(); void SetSkipPltLines(int nlines); int GetSkipPltLines(); bool UseMaxLevel(); int GetMaxLevel(); void SetBoxColor(int boxcolor); int GetBoxColor(); void SetInitialDerived(const string &formatString); const string &GetInitialDerived(); const string &GetPaletteName(); const string &GetLightingFileName(); bool DumpSlices(); bool SliceAllVars(); Array< list > &GetDumpSlices(); int GetFabOutFormat(); // -------------------- cartGrid functions void SetShowBody(const bool btf); bool GetShowBody(); #define SHOWVAL(val) { cout << #val << " = " << val << endl; } // Jensens device #define VSHOWVAL(verbose, val) { if(verbose) { \ cout << #val << " = " << val << endl; } } } // end namespace AVGlobals #endif ccseapps-2.5/CCSEApps/pAmrvis/Dataset.cpp0000644000175000017500000012544511634153073021404 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Dataset.cpp,v 1.49 2003/03/05 20:57:26 vince Exp $ // // --------------------------------------------------------------- // Dataset.cpp // --------------------------------------------------------------- const int CHARACTERWIDTH = 13; const int CHARACTERHEIGHT = 22; const int MAXINDEXCHARS = 4; #include #include #include #include #include #include #include #include #include #include #include #include #undef index #include "Dataset.H" #include "PltApp.H" #include "PltAppState.H" #include "AmrPicture.H" #include "DataServices.H" #include #include #include using std::ostrstream; using std::ends; using std::cout; using std::cerr; using std::endl; using std::min; using std::max; // ------------------------------------------------------------------- Dataset::Dataset(const Box &alignedRegion, AmrPicture *apptr, PltApp *pltappptr, PltAppState *pltappstateptr, int hdir, int vdir, int sdir) { // alignedRegion is defined on the maxAllowableLevel int i; stringOk = true; datasetPoint = false; hDIR = hdir; vDIR = vdir; sDIR = sdir; pltAppPtr = pltappptr; pltAppStatePtr = pltappstateptr; amrPicturePtr = apptr; dataServicesPtr = pltAppPtr->GetDataServicesPtr(); maxAllowableLevel = pltAppStatePtr->MaxAllowableLevel(); hStringOffset = 12; vStringOffset = -4; whiteIndex = int(pltAppPtr->GetPalettePtr()->WhiteIndex()); blackIndex = int(pltAppPtr->GetPalettePtr()->BlackIndex()); indexWidth = MAXINDEXCHARS * CHARACTERWIDTH; indexHeight = CHARACTERHEIGHT + 7; hScrollBarPos = vScrollBarPos = 0; pixSizeX = 1; pixSizeY = 1; WM_DELETE_WINDOW = XmInternAtom(XtDisplay(pltAppPtr->WId()), "WM_DELETE_WINDOW", false); // ************************************************ Dataset Window char header[BUFSIZ]; ostrstream outstr(header, sizeof(header)); outstr << AVGlobals::StripSlashes(pltAppPtr->GetFileName()) << " " << pltAppStatePtr->CurrentDerived() << " " << alignedRegion << ends; wDatasetTopLevel = XtVaCreatePopupShell(header, topLevelShellWidgetClass, pltAppPtr->WId(), XmNwidth, 800, XmNheight, 500, NULL); XmAddWMProtocolCallback(wDatasetTopLevel, WM_DELETE_WINDOW, (XtCallbackProc) &Dataset::CBQuitButton, (XtPointer) this); gaPtr = new GraphicsAttributes(wDatasetTopLevel); if(gaPtr->PVisual() != XDefaultVisual(gaPtr->PDisplay(), gaPtr->PScreenNumber())) { XtVaSetValues(wDatasetTopLevel, XmNvisual, gaPtr->PVisual(), XmNdepth, gaPtr->PDepth(), NULL); } wDatasetForm = XtVaCreateManagedWidget("datasetform", xmFormWidgetClass, wDatasetTopLevel, NULL); wDatasetTools = XtVaCreateManagedWidget("datasettools", xmFormWidgetClass, wDatasetForm, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNheight, 50, NULL); // ************************************************ Color Button i=0; XtSetArg(args[i], XmNtopAttachment, XmATTACH_FORM); ++i; XtSetArg(args[i], XmNtopOffset, WOFFSET); ++i; XtSetArg(args[i], XmNleftAttachment, XmATTACH_FORM); ++i; XtSetArg(args[i], XmNleftOffset, WOFFSET); ++i; //XtSetArg(args[i], XmNheight, bHeight); ++i; wColorButton = XmCreateToggleButton(wDatasetTools, "Color", args, i); XtAddCallback(wColorButton, XmNvalueChangedCallback, (XtCallbackProc) &Dataset::CBColorButton, (XtPointer) this); XmToggleButtonSetState(wColorButton, true, false); Dimension bHeight; XtVaGetValues(wColorButton, XmNheight, &bHeight, NULL); // ************************************************ Close Button i=0; XtSetArg(args[i], XmNtopAttachment, XmATTACH_FORM); ++i; XtSetArg(args[i], XmNtopOffset, WOFFSET); ++i; XtSetArg(args[i], XmNrightAttachment, XmATTACH_FORM); ++i; XtSetArg(args[i], XmNrightOffset, 20); ++i; XtSetArg(args[i], XmNheight, bHeight); ++i; wQuitButton = XmCreatePushButton(wDatasetTools, "Close", args, i); XtAddCallback(wQuitButton, XmNactivateCallback, (XtCallbackProc) &Dataset::CBQuitButton, (XtPointer) this); // ************************************************ Max XmString sMax = XmStringCreateSimple(""); wMaxValue = XtVaCreateManagedWidget("maxValue", xmLabelWidgetClass, wDatasetTools, XmNlabelString, sMax, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET+8, XmNrightAttachment, XmATTACH_WIDGET, XmNrightWidget, wQuitButton, XmNrightOffset, WOFFSET+10, XmNheight, bHeight, NULL); XmStringFree(sMax); // ************************************************ Min XmString sMin = XmStringCreateSimple(""); wMinValue = XtVaCreateManagedWidget("minValue", xmLabelWidgetClass, wDatasetTools, XmNlabelString, sMin, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET+8, XmNrightAttachment, XmATTACH_WIDGET, XmNrightWidget, wMaxValue, XmNrightOffset, WOFFSET+6, XmNheight, bHeight, NULL); XmStringFree(sMin); // ************************************************ Levels XmString sLabel = XmStringCreateSimple(""); wLevels = XtVaCreateManagedWidget("levels", xmLabelWidgetClass, wDatasetTools, XmNlabelString, sLabel, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET+8, XmNrightAttachment, XmATTACH_WIDGET, XmNrightWidget, wMinValue, XmNrightOffset, WOFFSET+6, XmNheight, bHeight, NULL); XmStringFree(sLabel); // ************************************************ data area wScrollArea = XtVaCreateManagedWidget("scrollArea", xmScrolledWindowWidgetClass, wDatasetForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wDatasetTools, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNscrollingPolicy, XmAUTOMATIC, NULL); String trans = ": DrawingAreaInput() ManagerGadgetButtonMotion() \n\ : DrawingAreaInput() ManagerGadgetButtonMotion() \n\ : DrawingAreaInput() ManagerGadgetButtonMotion()"; wPixArea = XtVaCreateManagedWidget("pixArea", xmDrawingAreaWidgetClass, wScrollArea, XmNtranslations, XtParseTranslationTable(trans), XmNwidth, pixSizeX, XmNheight, pixSizeY, NULL); XtAddCallback(wPixArea, XmNinputCallback, (XtCallbackProc) &Dataset::CBPixInput, (XtPointer) this); XtVaSetValues(wScrollArea, XmNworkWindow, wPixArea, NULL); XtManageChild(wScrollArea); XtManageChild(wPixArea); XtManageChild(wColorButton); XtManageChild(wQuitButton); XtPopup(wDatasetTopLevel, XtGrabNone); XtAddEventHandler(wPixArea, ExposureMask, false, (XtEventHandler) &Dataset::CBDoExposeDataset, (XtPointer) this); Widget wHScrollBar, wVScrollBar; XtVaGetValues(wScrollArea, XmNhorizontalScrollBar, &wHScrollBar, XmNverticalScrollBar, &wVScrollBar, NULL); XtAddCallback(wHScrollBar, XmNdragCallback, (XtCallbackProc) &Dataset::CBScrolling, (XtPointer) this); XtAddCallback(wHScrollBar, XmNvalueChangedCallback, (XtCallbackProc) &Dataset::CBEndScrolling, (XtPointer) this); XtAddCallback(wVScrollBar, XmNdragCallback, (XtCallbackProc) &Dataset::CBScrolling, (XtPointer) this); XtAddCallback(wVScrollBar, XmNvalueChangedCallback, (XtCallbackProc) &Dataset::CBEndScrolling, (XtPointer) this); dragging = false; drags = 0; myDataStringArray = NULL; bDataStringArrayAllocated = false; DatasetRender(alignedRegion, amrPicturePtr, pltAppPtr, pltAppStatePtr, hdir, vdir, sdir); } // end Dataset::Dataset // ------------------------------------------------------------------- Dataset::~Dataset() { delete gaPtr; delete [] datasetRegion; delete [] dataStringArray; if(bDataStringArrayAllocated) { BL_ASSERT(maxAllowableLevel == pltAppStatePtr->MaxAllowableLevel()); for(int j = 0; j <= maxAllowableLevel; ++j) { delete [] myDataStringArray[j]; } delete [] myDataStringArray; } XtDestroyWidget(wDatasetTopLevel); } // ------------------------------------------------------------------- void Dataset::DatasetRender(const Box &alignedRegion, AmrPicture *apptr, PltApp *pltappptr, PltAppState *pltappstateptr, int hdir, int vdir, int sdir) { int lev, i, c, d, stringCount; Box temp, dataBox; Real *dataPoint; if(bDataStringArrayAllocated) { BL_ASSERT(maxAllowableLevel == pltAppStatePtr->MaxAllowableLevel()); for(int j(0); j <= maxAllowableLevel; ++j) { delete [] myDataStringArray[j]; } delete [] myDataStringArray; } pltAppPtr = pltappptr; pltAppStatePtr = pltappstateptr; maxDrawnLevel = pltAppStatePtr->MaxDrawnLevel(); minDrawnLevel = pltAppStatePtr->MinDrawnLevel(); hDIR = hdir; vDIR = vdir; sDIR = sdir; if(hDIR == 0) { hAxisString = "x"; } else if(hDIR == 1) { hAxisString = "y"; } else { hAxisString = "error"; } if(vDIR == 1) { vAxisString = "y"; } else if(vDIR == 2) { vAxisString = "z"; } else { vAxisString = "error"; } char fstring[BUFSIZ]; strcpy(fstring, pltAppStatePtr->GetFormatString().c_str()); if( ! stringOk) { return; } amrPicturePtr = apptr; dataServicesPtr = pltAppPtr->GetDataServicesPtr(); const AmrData &amrData = dataServicesPtr->AmrDataRef(); maxAllowableLevel = pltAppStatePtr->MaxAllowableLevel(); // set up datasetRegion //we shall waste some space to that datasetRegion[lev] corresponds to lev datasetRegion = new Box[maxAllowableLevel + 1]; datasetRegion[maxAllowableLevel] = alignedRegion; for(i = maxAllowableLevel - 1; i >= 0; --i) { datasetRegion[i] = datasetRegion[maxAllowableLevel]; datasetRegion[i].coarsen( AVGlobals::CRRBetweenLevels(i, maxAllowableLevel, amrData.RefRatio())); } // datasetRegion is now an array of Boxes that encloses the selected region Array dataFab(maxAllowableLevel + 1); for(i = 0; i <= maxAllowableLevel; ++i) { //dataFab[i]->resize(datasetRegion[i], 1); dataFab[i] = new FArrayBox(datasetRegion[i], 1); } Palette *palptr = pltAppPtr->GetPalettePtr(); int colorSlots(palptr->ColorSlots()); int paletteStart(palptr->PaletteStart()); int paletteEnd(palptr->PaletteEnd()); char header[BUFSIZ]; ostrstream outstr(header, sizeof(header)); outstr << AVGlobals::StripSlashes(pltAppPtr->GetFileName()) << " " << pltAppStatePtr->CurrentDerived() << " " << alignedRegion << ends; XtVaSetValues(wDatasetTopLevel, XmNtitle, header, NULL); // find largest data width and count # of data strings int largestWidth(0); stringCount = 0; myStringCount = new int[maxAllowableLevel + 1]; for(lev = 0; lev <= maxAllowableLevel; ++lev) { myStringCount[lev] = 0; DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) dataFab[lev], (void *) &(dataFab[lev]->box()), lev, (void *) &(pltAppStatePtr->CurrentDerived())); for(int iBox(0); iBox < amrData.boxArray(lev).size(); ++iBox) { temp = amrData.boxArray(lev)[iBox]; if(datasetRegion[lev].intersects(temp)) { int ddl; temp &= datasetRegion[lev]; dataBox = temp; FArrayBox dataFabTemp(dataBox, 1); dataFabTemp.copy(*(dataFab[lev])); dataPoint = dataFabTemp.dataPtr(); stringCount += dataBox.length(vDIR) * dataBox.length(hDIR); myStringCount[lev] += dataBox.length(vDIR) * dataBox.length(hDIR); for(d = 0; d < dataBox.length(vDIR); ++d) { ddl = d * dataBox.length(hDIR); for(c = 0; c < dataBox.length(hDIR); ++c) { sprintf(dataString, fstring, dataPoint[c+ddl]); largestWidth = max((int) strlen(dataString), largestWidth); } } } } } char levelInfo[15], maxInfo[20], minInfo[20], maxInfoV[25], minInfoV[25]; sprintf(levelInfo, "Level: %i", maxDrawnLevel); XmString sNewLevel = XmStringCreateSimple(levelInfo); XtVaSetValues(wLevels, XmNlabelString, sNewLevel, NULL); XmStringFree(sNewLevel); sprintf(minInfoV, fstring, dataFab[maxDrawnLevel]->min()); sprintf(minInfo, "Min:%s", minInfoV); XmString sNewMin = XmStringCreateSimple(minInfo); XtVaSetValues(wMinValue, XmNlabelString, sNewMin, NULL); XmStringFree(sNewMin); sprintf(maxInfoV, fstring, dataFab[maxDrawnLevel]->max()); sprintf(maxInfo, "Max:%s", maxInfoV); XmString sNewMax = XmStringCreateSimple(maxInfo); XtVaSetValues(wMaxValue, XmNlabelString, sNewMax, NULL); XmStringFree(sNewMax); if(AVGlobals::Verbose()) { cout << stringCount << " data points" << endl; } numStrings = stringCount; dataStringArray = new StringLoc[numStrings]; int ns; for(ns = 0; ns < numStrings; ns++) { dataStringArray[ns].olflag = maxDrawnLevel; } if(dataStringArray == NULL) { cout << "Error in Dataset::DatasetRender: out of memory" << endl; return; } myDataStringArray = new StringLoc * [maxAllowableLevel + 1]; int level; for(level = 0; level <= maxDrawnLevel; ++level) { myDataStringArray[level] = new StringLoc [myStringCount[level] ]; } for(level = maxDrawnLevel + 1; level <= maxAllowableLevel; ++level) { myDataStringArray[level] = NULL; } bDataStringArrayAllocated = true; // determine the length of the character labels for the indices Real vItemCount((Real) (datasetRegion[maxDrawnLevel].bigEnd(vDIR))); int vIndicesWidth((int) (ceil(log10(vItemCount+1)))); Real hItemCount((Real) (datasetRegion[maxDrawnLevel].bigEnd(hDIR))); int hIndicesWidth((int) (ceil(log10(hItemCount+1)))); largestWidth = max(largestWidth, hIndicesWidth); indexWidth = max(MAXINDEXCHARS, vIndicesWidth+1) * CHARACTERWIDTH; // determine size of data area dataItemWidth = largestWidth * CHARACTERWIDTH; pixSizeX = datasetRegion[maxDrawnLevel].length(hDIR) * dataItemWidth + ((maxDrawnLevel-minDrawnLevel+1)*indexWidth); pixSizeY = datasetRegion[maxDrawnLevel].length(vDIR) * CHARACTERHEIGHT + ((maxDrawnLevel-minDrawnLevel+1)*indexHeight); // create StringLoc array and define color scheme if(pixSizeX == 0 || pixSizeY == 0) { noData = true; sprintf (dataString, "No intersection."); pixSizeX = strlen(dataString) * CHARACTERWIDTH; pixSizeY = CHARACTERHEIGHT+5; XtVaSetValues(wPixArea, XmNwidth, pixSizeX, XmNheight, pixSizeY, NULL); } else { noData = false; XtVaSetValues(wPixArea, XmNwidth, pixSizeX, XmNheight, pixSizeY, NULL); stringCount = 0; int lastLevLow(0), lastLevHigh(0); int csm1(colorSlots - 1); Real datamin, datamax; pltAppStatePtr->GetMinMax(datamin, datamax); Real globalDiff(datamax - datamin); Real oneOverGlobalDiff; if(globalDiff < FLT_MIN) { oneOverGlobalDiff = 0.0; // so we dont divide by zero } else { oneOverGlobalDiff = 1.0 / globalDiff; } for(lev = minDrawnLevel; lev <= maxDrawnLevel; ++lev) { for(int iBox = 0; iBox < amrData.boxArray(lev).size(); ++iBox) { temp = amrData.boxArray(lev)[iBox]; if(datasetRegion[lev].intersects(temp)) { temp &= datasetRegion[lev]; dataBox = temp; temp.refine(AVGlobals::CRRBetweenLevels(lev, maxDrawnLevel, amrData.RefRatio())); temp.shift(hDIR, -datasetRegion[maxDrawnLevel].smallEnd(hDIR)); temp.shift(vDIR, -datasetRegion[maxDrawnLevel].smallEnd(vDIR)); FArrayBox dataFabTemp(dataBox, 1); dataFabTemp.copy(*(dataFab[lev])); dataPoint = dataFabTemp.dataPtr(); int ddl; int crr = AVGlobals::CRRBetweenLevels(lev, maxDrawnLevel, amrData.RefRatio()); Real amrmin(datamin), amrmax(datamax); for(d = 0; d < dataBox.length(vDIR); ++d) { ddl = d * dataBox.length(hDIR); for(c = 0; c < dataBox.length(hDIR); ++c) { sprintf(dataString, fstring, dataPoint[c+ddl]); if(dataPoint[c+ddl] > amrmax) { dataStringArray[stringCount].color = paletteEnd; // clip } else if(dataPoint[c+ddl] < amrmin) { dataStringArray[stringCount].color = paletteStart; // clip } else { dataStringArray[stringCount].color = (int) (((dataPoint[c+ddl] - datamin) * oneOverGlobalDiff) * csm1 ); dataStringArray[stringCount].color += paletteStart; } dataStringArray[stringCount].xloc = (temp.smallEnd(hDIR) + c * crr) * dataItemWidth + 5; dataStringArray[stringCount].yloc = pixSizeY-1 - (temp.smallEnd(vDIR) + d * crr) * CHARACTERHEIGHT - 4; for(i = lastLevLow; i < lastLevHigh; ++i) { // remove overlap if(dataStringArray[i].xloc == dataStringArray[stringCount].xloc && dataStringArray[i].yloc == dataStringArray[stringCount].yloc) { dataStringArray[i].olflag = lev - 1; // highest level at which visible } } strcpy(dataStringArray[stringCount].ds, dataString); dataStringArray[stringCount].dslen = strlen(dataString); ++stringCount; } // end for(c...) } // end for(d...) } // end if(datasetRegion[lev].intersects(temp)) } lastLevLow = lastLevHigh; lastLevHigh = stringCount; } } // end if(pixSizeX...) //now load into **StringLoc int sCount(0); for(lev = minDrawnLevel; lev <= maxDrawnLevel; ++lev) { for(stringCount = 0; stringCount < myStringCount[lev]; ++stringCount) { myDataStringArray[lev][stringCount] = dataStringArray[sCount]; ++sCount; } } XSetWindowColormap(gaPtr->PDisplay(), XtWindow(wDatasetTopLevel), pltAppPtr->GetPalettePtr()->GetColormap()); XSetWindowColormap(gaPtr->PDisplay(), XtWindow(wPixArea), pltAppPtr->GetPalettePtr()->GetColormap()); XSetForeground(XtDisplay(wPixArea), gaPtr->PGC(), blackIndex); Box tempBox = datasetRegion[maxDrawnLevel]; tempBox.shift(hDIR, -datasetRegion[maxDrawnLevel].smallEnd(hDIR)); tempBox.shift(vDIR, -datasetRegion[maxDrawnLevel].smallEnd(vDIR)); hIndexArray = new StringLoc *[maxDrawnLevel + 1]; vIndexArray = new StringLoc *[maxDrawnLevel + 1]; for(int j(0); j <= maxDrawnLevel; ++j) { hIndexArray[j] = NULL; vIndexArray[j] = NULL; } for(int level(minDrawnLevel); level <= maxDrawnLevel; ++level) { Box temp(datasetRegion[level]); temp.refine(AVGlobals::CRRBetweenLevels(level, maxDrawnLevel, amrData.RefRatio())); temp.shift(hDIR, -datasetRegion[maxDrawnLevel].smallEnd(hDIR)); temp.shift(vDIR, -datasetRegion[maxDrawnLevel].smallEnd(vDIR)); double dBoxSize((double) AVGlobals::CRRBetweenLevels(level, maxDrawnLevel, amrData.RefRatio())); int boxSize(((int) (ceil(dBoxSize)-dBoxSize >= 0.5 ? floor(dBoxSize): ceil(dBoxSize)))); int vStartPos((int) (fmod(double(datasetRegion[maxDrawnLevel].bigEnd(vDIR) + 1), double(boxSize)))); vStartPos = (vStartPos != 0 ? vStartPos - boxSize:vStartPos); // fill the box index arrays Box iABox(datasetRegion[level]); hIndexArray[level] = new StringLoc[iABox.length(hDIR)]; vIndexArray[level] = new StringLoc[iABox.length(vDIR)]; // horizontal for(d = 0; d < iABox.length(hDIR); ++d) { sprintf(dataString, "%d", d + iABox.smallEnd(hDIR)); hIndexArray[level][d].color = blackIndex; hIndexArray[level][d].xloc =(temp.smallEnd(hDIR)+d*boxSize)*dataItemWidth +hStringOffset; hIndexArray[level][d].yloc = 0; // find this dynamically when drawing strcpy(hIndexArray[level][d].ds, dataString); hIndexArray[level][d].dslen = strlen(dataString); hIndexArray[level][d].olflag = false; } // end for(d...) // vertical for(d = 0; d < iABox.length(vDIR); ++d) { sprintf(dataString, "%d", d + iABox.smallEnd(vDIR)); vIndexArray[level][d].color = blackIndex; vIndexArray[level][d].xloc = 0;// find this dynamically when drawing vIndexArray[level][d].yloc = ((vStartPos+boxSize*(datasetRegion[level].length(vDIR)-d)) * CHARACTERHEIGHT)+vStringOffset; strcpy(vIndexArray[level][d].ds, dataString); vIndexArray[level][d].dslen = strlen(dataString); vIndexArray[level][d].olflag = false; } // end for(d...) } //end for(int level = minDrawnLevel...) for(i = 0; i < dataFab.size(); ++i) { delete dataFab[i]; } } // end Dataset::DatasetRender // ------------------------------------------------------------------- void Dataset::DrawGrid(int startX, int startY, int finishX, int finishY, int gridspacingX, int gridspacingY, int foregroundIndex, int backgroundIndex) { int i; Display *display = XtDisplay(wPixArea); GC gc = gaPtr->PGC(); Window dataWindow = XtWindow(wPixArea); XSetBackground(display, gc, backgroundIndex); XSetForeground(display, gc, foregroundIndex); XDrawLine(display, dataWindow, gc, startX+1, startY, startX+1, finishY); for(i = startX; i <= finishX; i += gridspacingX) { XDrawLine(display, dataWindow, gc, i, startY, i, finishY); } XDrawLine(display, dataWindow, gc, finishX - 1, startY, finishX - 1, finishY); XDrawLine(display, dataWindow, gc, startX, startY + 1, finishX, startY + 1); for(i = startY; i <= finishY; i += gridspacingY) { XDrawLine(display, dataWindow, gc, startX, i, finishX, i); } XDrawLine(display, dataWindow, gc, startX, finishY - 1, finishX, finishY - 1); } // end DrawGrid(...) // ------------------------------------------------------------------- void Dataset::DrawGrid(int startX, int startY, int finishX, int finishY, int refRatio, int foregroundIndex, int backgroundIndex) { int i; Display *display = XtDisplay(wPixArea); GC gc = gaPtr->PGC(); Window dataWindow = XtWindow(wPixArea); XSetBackground(display, gc, backgroundIndex); XSetForeground(display, gc, foregroundIndex); XDrawLine(display, dataWindow, gc, startX+1, startY, startX+1, finishY); for(i = startX; i <= finishX; i += dataItemWidth * refRatio) { XDrawLine(display, dataWindow, gc, i, startY, i, finishY); } XDrawLine(display, dataWindow, gc, finishX - 1, startY, finishX - 1, finishY); XDrawLine(display, dataWindow, gc, startX, startY + 1, finishX, startY + 1); for(i = startY; i <= finishY; i += CHARACTERHEIGHT * refRatio) { XDrawLine(display, dataWindow, gc, startX, i, finishX, i); } XDrawLine(display, dataWindow, gc, startX, finishY - 1, finishX, finishY - 1); } // end DrawGrid(...) // ------------------------------------------------------------------- void Dataset::CBQuitButton(Widget, XtPointer client_data, XtPointer) { Dataset *obj = (Dataset*) client_data; obj->DoQuitButton(); } // ------------------------------------------------------------------- void Dataset::CBColorButton(Widget, XtPointer client_data, XtPointer) { Dataset *obj = (Dataset *) client_data; obj->DoColorButton(); } // ------------------------------------------------------------------- void Dataset::CBPixInput(Widget, XtPointer client_data, XtPointer call_data) { Dataset *obj = (Dataset *) client_data; obj->DoPixInput((XmDrawingAreaCallbackStruct *) call_data); } // ------------------------------------------------------------------- void Dataset::DoPixInput(XmDrawingAreaCallbackStruct *cbs) { int hplot(-1), vplot(-1); int hDir(-1), vDir(-1); # if (BL_SPACEDIM == 3) int depthDir(-1); # endif static int serverControlOK = 0; int xcell((int) (cbs->event->xbutton.x) / dataItemWidth); int ycell((int) (cbs->event->xbutton.y) / CHARACTERHEIGHT); Box pictureBox(amrPicturePtr->GetSubDomain()[maxDrawnLevel]); Box regionBox(datasetRegion[maxDrawnLevel]); if(cbs->event->xany.type == ButtonPress) { ++serverControlOK; } if(xcell >= 0 && xcell < pixSizeX/dataItemWidth && ycell >= 0 && ycell < pixSizeY/CHARACTERHEIGHT) { if(amrPicturePtr->GetMyView() == XY) { hDir = XDIR; vDir = YDIR; # if (BL_SPACEDIM == 3) depthDir = ZDIR; # endif } else if(amrPicturePtr->GetMyView() == XZ) { hDir = XDIR; vDir = ZDIR; # if (BL_SPACEDIM == 3) depthDir = YDIR; # endif } else if(amrPicturePtr->GetMyView() == YZ) { hDir = YDIR; vDir = ZDIR; # if (BL_SPACEDIM == 3) depthDir = XDIR; # endif } if(xcell > regionBox.bigEnd(hDir)-regionBox.smallEnd(hDir)) { xcell = regionBox.bigEnd(hDir)-regionBox.smallEnd(hDir); } if(ycell > regionBox.bigEnd(vDir)-regionBox.smallEnd(vDir)) { ycell = regionBox.bigEnd(vDir)-regionBox.smallEnd(vDir); } hplot = regionBox.smallEnd(hDir) + xcell; vplot = regionBox.smallEnd(vDir) + regionBox.length(vDir)-1 - ycell; const AmrData &amrData = dataServicesPtr->AmrDataRef(); int baseRatio = AVGlobals::CRRBetweenLevels(maxDrawnLevel, maxAllowableLevel, amrData.RefRatio()); int boxCoor[BL_SPACEDIM]; boxCoor[hDir] = hplot; boxCoor[vDir] = vplot; # if (BL_SPACEDIM == 3) boxCoor[depthDir] = pltAppPtr->GetAmrPicturePtr(YZ - depthDir)->GetSlice(); boxCoor[depthDir] /= baseRatio; //IntVect boxLocation(boxCoor[XDIR], boxCoor[YDIR], boxCoor[ZDIR]); # endif # if (BL_SPACEDIM == 2) //IntVect boxLocation(boxCoor[XDIR], boxCoor[YDIR]); # endif IntVect boxLocation(boxCoor); Box chosenBox(boxLocation, boxLocation); int finestCLevel(amrData.FinestContainingLevel(chosenBox, maxDrawnLevel)); finestCLevel = ( finestCLevel >= minDrawnLevel ? finestCLevel : minDrawnLevel ); int boxSize(AVGlobals::CRRBetweenLevels(finestCLevel, maxAllowableLevel, amrData.RefRatio())); int modBy(AVGlobals::CRRBetweenLevels(finestCLevel, maxDrawnLevel, amrData.RefRatio())); hplot -= pictureBox.smallEnd(hDir); hplot -= (int) fmod(double(hplot), double(modBy)); vplot -= pictureBox.smallEnd(vDir); vplot -= (int) fmod(double(vplot), double(modBy)); hplot *= baseRatio; vplot *= baseRatio; vplot += boxSize; if(datasetPoint == true) { amrPicturePtr->UnDrawDatasetPoint(); // box if already drawn } else { datasetPoint = true; // if we just started... } amrPicturePtr->DrawDatasetPoint(hplot, vplot, boxSize); } if(cbs->event->xany.type == ButtonRelease) { amrPicturePtr->UnDrawDatasetPoint(); --serverControlOK; datasetPoint = false; if(serverControlOK != 0) { cerr << "incorrect server control balance -- serverControlOK: " << serverControlOK <DoExposePicture();// redraw this once to // protect from incorrect bit manipulation (didn't grab the server) } } // end DoPixInput // ------------------------------------------------------------------- void Dataset::DoQuitButton() { pltAppPtr->QuitDataset(); //delete this; } // ------------------------------------------------------------------- void Dataset::DoColorButton() { DoExpose(false); } // ------------------------------------------------------------------- void Dataset::DoRaise() { XtPopup(wDatasetTopLevel, XtGrabNone); XMapRaised(XtDisplay(wDatasetTopLevel), XtWindow(wDatasetTopLevel)); } // ------------------------------------------------------------------- void Dataset::DoExpose(int fromExpose) { if(fromExpose && drags) { --drags; return; } dataServicesPtr = pltAppPtr->GetDataServicesPtr(); const AmrData &amrData = dataServicesPtr->AmrDataRef(); if(noData) { cout << "_in Dataset::DoExpose: noData" << endl; XSetBackground(XtDisplay(wPixArea), gaPtr->PGC(), blackIndex); XSetForeground(XtDisplay(wPixArea), gaPtr->PGC(), whiteIndex); XDrawString(XtDisplay(wPixArea), XtWindow(wPixArea), gaPtr->PGC(), 2, pixSizeY-5, dataString, strlen(dataString)); } else { unsigned int lev, stringCount; Box temp, dataBox; Widget hScrollBar, vScrollBar; Dimension wdth, hght; XtVaGetValues(wScrollArea, XmNhorizontalScrollBar, &hScrollBar, XmNverticalScrollBar, &vScrollBar, NULL); #ifndef SCROLLBARERROR int hSliderSize, hIncrement, hPageIncrement; int vSliderSize, vIncrement, vPageIncrement; XmScrollBarGetValues(hScrollBar, &hScrollBarPos, &hSliderSize, &hIncrement, &hPageIncrement); XmScrollBarGetValues(vScrollBar, &vScrollBarPos, &vSliderSize, &vIncrement, &vPageIncrement); #endif Dimension scrollAreaSpacing; XtVaGetValues(wScrollArea, XmNwidth, &width, XmNheight, &height, XmNspacing, &scrollAreaSpacing, NULL); xh = (int) hScrollBarPos - dataItemWidth; yv = (int) vScrollBarPos - dataItemWidth; int hScrollBarBuffer(32); int vScrollBarBuffer(32); if(pixSizeY == vSliderSize) { // the vertical scroll bar is not visible vScrollBarBuffer = scrollAreaSpacing; } if(pixSizeX == hSliderSize) { // the horizontal scroll bar is not visible hScrollBarBuffer = scrollAreaSpacing; } hIndexAreaHeight = indexHeight; hIndexAreaEnd = min((int) pixSizeY, vScrollBarPos + height - hScrollBarBuffer); hIndexAreaStart = hIndexAreaEnd + 1 - hIndexAreaHeight; vIndexAreaWidth = indexWidth; vIndexAreaEnd = min((int) pixSizeX, hScrollBarPos + width - vScrollBarBuffer); vIndexAreaStart = vIndexAreaEnd + 1 - vIndexAreaWidth; XtVaGetValues(wScrollArea, XmNwidth, &wdth, XmNheight, &hght, NULL); XClearWindow(gaPtr->PDisplay(), XtWindow(wPixArea)); int min_level(minDrawnLevel); int max_level(maxDrawnLevel); int level_diff(max_level - min_level); // draw grid structure for entire region for(lev = minDrawnLevel; lev <= maxDrawnLevel; ++lev) { for(int iBox = 0; iBox < amrData.boxArray(lev).size(); ++iBox) { temp = amrData.boxArray(lev)[iBox]; if(datasetRegion[lev].intersects(temp)) { temp &= datasetRegion[lev]; dataBox = temp; temp.refine(AVGlobals::CRRBetweenLevels(lev, maxDrawnLevel, amrData.RefRatio())); temp.shift(hDIR, -datasetRegion[maxDrawnLevel].smallEnd(hDIR)); temp.shift(vDIR, -datasetRegion[maxDrawnLevel].smallEnd(vDIR)); DrawGrid(temp.smallEnd(hDIR) * dataItemWidth, (pixSizeY-1 - (temp.bigEnd(vDIR)+1) * CHARACTERHEIGHT) -((level_diff+1)*hIndexAreaHeight), (temp.bigEnd(hDIR)+1) * dataItemWidth, (pixSizeY-1 - temp.smallEnd(vDIR) * CHARACTERHEIGHT) -((level_diff+1)*hIndexAreaHeight), AVGlobals::CRRBetweenLevels(lev, maxDrawnLevel, amrData.RefRatio()), whiteIndex, blackIndex); } } } if(dragging) { DrawIndices(); return; } int xloc, yloc; int xh((int) hScrollBarPos - dataItemWidth); int yv((int) vScrollBarPos - dataItemWidth); // draw data strings if(XmToggleButtonGetState(wColorButton)) { for(int lvl = minDrawnLevel; lvl <= maxDrawnLevel; ++lvl) { for(stringCount = 0; stringCount < myStringCount[lvl]; ++stringCount) { xloc = myDataStringArray[lvl][stringCount].xloc; yloc = myDataStringArray[lvl][stringCount].yloc - ((maxDrawnLevel-minDrawnLevel+1)*hIndexAreaHeight); #ifndef SCROLLBARERROR if(myDataStringArray[lvl][stringCount].olflag >= maxDrawnLevel && xloc > xh && yloc > yv && xloc < hScrollBarPos+wdth && yloc < vScrollBarPos+hght) #else if(myDataStringArray[lvl][stringCount].olflag >= maxDrawnLevel) #endif { // FIXME:?? XSetForeground(XtDisplay(wPixArea), gaPtr->PGC(), myDataStringArray[lvl][stringCount].color); XDrawString(XtDisplay(wPixArea), XtWindow(wPixArea), gaPtr->PGC(), xloc, yloc, myDataStringArray[lvl][stringCount].ds, myDataStringArray[lvl][stringCount].dslen); } } // end for } // end for } else { XSetForeground(XtDisplay(wPixArea), gaPtr->PGC(), whiteIndex); for(int lvl = minDrawnLevel; lvl<=maxDrawnLevel; lvl++) { for(stringCount=0; stringCount= maxDrawnLevel && xloc > xh && yloc > yv && xloc < hScrollBarPos+wdth && yloc < vScrollBarPos+hght) #else if(myDataStringArray[lvl][stringCount].olflag >= maxDrawnLevel) #endif { XDrawString(XtDisplay(wPixArea), XtWindow(wPixArea), gaPtr->PGC(), xloc, yloc, myDataStringArray[lvl][stringCount].ds, myDataStringArray[lvl][stringCount].dslen); } } } } DrawIndices(); } } // end DoExpose // ------------------------------------------------------------------- void Dataset::DrawIndices() { int xloc, yloc; unsigned int stringCount; GC gc = gaPtr->PGC(); Display *display = XtDisplay(wPixArea); Window dataWindow = XtWindow(wPixArea); int levelRange(maxDrawnLevel - minDrawnLevel); XSetForeground(display, gc, whiteIndex); for(int count = 0; count<= levelRange; ++count) { // horizontal XFillRectangle(display, dataWindow, gc, hScrollBarPos, hIndexAreaStart-(hIndexAreaHeight*count), min((unsigned int) width, pixSizeX), hIndexAreaHeight); // vertical XFillRectangle(display, dataWindow, gc, vIndexAreaStart-(vIndexAreaWidth*count), vScrollBarPos, vIndexAreaWidth, min((unsigned int) height, pixSizeY)); } const AmrData &amrData = dataServicesPtr->AmrDataRef(); for(int level = minDrawnLevel; level<= maxDrawnLevel; ++level) { Box temp(datasetRegion[level]); int count(level - minDrawnLevel); temp.refine(AVGlobals::CRRBetweenLevels(level, maxDrawnLevel, amrData.RefRatio())); temp.shift(hDIR, -datasetRegion[maxDrawnLevel].smallEnd(hDIR)); temp.shift(vDIR, -datasetRegion[maxDrawnLevel].smallEnd(vDIR)); double dBoxSize((double) AVGlobals::CRRBetweenLevels(level, maxDrawnLevel, amrData.RefRatio())); int boxSize((ceil(dBoxSize)-dBoxSize >= 0.5 ? (int) floor(dBoxSize): (int) ceil(dBoxSize))); // draw the horizontal box index grid -- on top of the white background. DrawGrid(temp.smallEnd(hDIR) * dataItemWidth, hIndexAreaStart-(count*hIndexAreaHeight)-1, vIndexAreaStart-(count*vIndexAreaWidth), hIndexAreaEnd-(count*hIndexAreaHeight), (boxSize)*dataItemWidth, hIndexAreaHeight, blackIndex, whiteIndex); // draw the vertical box index grid int vStart((int) (fmod(double(datasetRegion[maxDrawnLevel].bigEnd(vDIR) + 1), double(boxSize)))); vStart = (vStart != 0? vStart - boxSize:vStart); DrawGrid(vIndexAreaStart-(count*vIndexAreaWidth)-1, vStart*CHARACTERHEIGHT, vIndexAreaEnd-(count*vIndexAreaWidth), hIndexAreaStart-(count*hIndexAreaHeight), vIndexAreaWidth,boxSize*CHARACTERHEIGHT, blackIndex, whiteIndex); XSetForeground(display, gc, blackIndex); // draw the corner axis labels XDrawLine(display, dataWindow, gc, vIndexAreaStart, hIndexAreaStart, vIndexAreaEnd, hIndexAreaEnd - 1); // frame the corner box XDrawLine(display, dataWindow, gc, vIndexAreaStart, hIndexAreaEnd - 1, vIndexAreaEnd, hIndexAreaEnd - 1); XDrawLine(display, dataWindow, gc, vIndexAreaEnd - 1, hIndexAreaStart, vIndexAreaEnd - 1, hIndexAreaEnd); XDrawString(display, dataWindow, gc, vIndexAreaStart + hStringOffset, hIndexAreaEnd + vStringOffset, hAxisString.c_str(), hAxisString.length()); XDrawString(display, dataWindow, gc, vIndexAreaStart + (indexWidth/2) + hStringOffset, hIndexAreaEnd - (indexHeight/2) + vStringOffset, vAxisString.c_str(), vAxisString.length()); // draw the box indices // horizontal yloc = hIndexAreaEnd + vStringOffset-(count*hIndexAreaHeight); for(stringCount = 0; stringCount < datasetRegion[level].length(hDIR); ++stringCount) { xloc = hIndexArray[level][stringCount].xloc; if((xloc > xh) && (xloc < (vIndexAreaStart-(count*vIndexAreaWidth) - (indexWidth / 3)))) { XDrawString(display, dataWindow, gc, xloc, yloc, hIndexArray[level][stringCount].ds, hIndexArray[level][stringCount].dslen); } } // end for(...) // vertical xloc = vIndexAreaStart + hStringOffset-(count*vIndexAreaWidth); for(stringCount = 0; stringCount < datasetRegion[level].length(vDIR); ++stringCount) { yloc = vIndexArray[level][stringCount].yloc; if((yloc > yv) && (yloc < hIndexAreaStart-(count*hIndexAreaHeight))) { XDrawString(display, dataWindow, gc, xloc, yloc, vIndexArray[level][stringCount].ds, vIndexArray[level][stringCount].dslen); } } } //end for( int level . . . } // end DrawIndices // ------------------------------------------------------------------- void Dataset::CBDoExposeDataset(Widget, XtPointer client_data, XEvent *, Boolean *) { XEvent nextEvent; Dataset *dset = (Dataset *) client_data; while(XCheckTypedWindowEvent(dset->gaPtr->PDisplay(), XtWindow(dset->wPixArea), Expose, &nextEvent)) { if(dset->drags) { dset->drags--; } } dset->DoExpose(true); } // ------------------------------------------------------------------- void Dataset::CBScrolling(Widget, XtPointer client_data, XtPointer) { Dataset *dset = (Dataset *) client_data; dset->dragging = true; dset->drags++; dset->DoExpose(false); } // ------------------------------------------------------------------- void Dataset::CBEndScrolling(Widget, XtPointer client_data, XtPointer) { Dataset *dset = (Dataset *) client_data; dset->dragging = false; dset->DoExpose(false); } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/XYPlotParam.cpp0000644000175000017500000004331611634153073022173 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // ------------------------------------------------------------------- // XYPlotParam.cpp -- implementation of XYPlotParameters class // ------------------------------------------------------------------- #include #undef index #include "XYPlotParam.H" #include "Palette.H" #include "GraphicsAttributes.H" #include #include #define DEF(name, typ, def_name) \ if((def_str = XGetDefault(gaPtr->PDisplay(), title, (name)))) \ { Set_Parameter((name), (typ), def_str); } \ else { Set_Parameter((name), (typ), (def_name)); } #define STRDUP(xx) (strcpy(new char[strlen(xx)+1], (xx))) static char *defStyle[8] = { // Default Line styles "1", "10", "11110000", "010111", "1110", "1111111100000000", "11001111", "0011000111" }; static char *positive[] = {"on", "yes", "true", "1", "affirmative", NULL}; static char *negative[] = {"off", "no", "false", "0", "negative", NULL}; // ------------------------------------------------------------------- XYPlotParameters::XYPlotParameters(Palette *palPtr, GraphicsAttributes *gaptr, char *name) : param_palette(palPtr), gaPtr(gaptr) { title = new char[strlen(name) + 1]; strcpy(title, name); // Initialize hash table. param_table.num_entries = 0; param_table.max_density = ST_DEFAULT_MAX_DENSITY; param_table.grow_factor = ST_DEFAULT_GROW_FACTOR; param_table.reorder_flag = ST_DEFAULT_REORDER_FLAG; param_table.num_bins = (ST_DEFAULT_INIT_TABLE_SIZE <= 0) ? 1 : ST_DEFAULT_INIT_TABLE_SIZE; param_table.bins = new st_table_entry *[param_table.num_bins]; for(int idx(0); idx != param_table.num_bins; ++idx) { param_table.bins[idx] = NULL; } GetHardWiredDefaults(); ReadFromFile("~/.XYPlot.Defaults"); // First read "global" defaults ReadFromFile(".XYPlot.Defaults"); // Then read "local" defaults } // ------------------------------------------------------------------- void XYPlotParameters::ResetPalette(Palette *newPalPtr) { if(param_palette != newPalPtr) { param_palette = newPalPtr; param_full *entry; if((entry = st_lookup("GridColor")) != NULL && entry->real_form) { free_resource(entry->real_form); } if((entry = st_lookup("TextColor")) != NULL && entry->real_form) { free_resource(entry->real_form); } unsigned int colorindex = param_palette->ColorSlots() / 8; char colorstr[10]; char buf[20]; int ici; for(unsigned int idx(0); idx < 8; ++idx) { sprintf(buf, "%d.Color", idx); ici = (idx * colorindex) + param_palette->PaletteStart(); ici = std::min(ici, param_palette->PaletteEnd()); ici = std::max(ici, param_palette->PaletteStart() + 1); // for lowblack sprintf(colorstr, "%u", ici); Set_Parameter(buf, INT, colorstr); } } } // ------------------------------------------------------------------- XYPlotParameters::~XYPlotParameters(void) { st_table_entry *ptr, *next; // destroy table entries. for(int idx(0); idx < param_table.num_bins; ++idx) { ptr = param_table.bins[idx]; while(ptr != NULL) { next = ptr->next; param_full *entry = ptr->record; if(entry->real_form) { free_resource(entry->real_form); } if(entry->text_form) { delete [] entry->text_form; } delete entry; delete ptr; ptr = next; } } // clear table bins and the table itself. delete param_table.bins; delete [] title; } // ------------------------------------------------------------------- void XYPlotParameters::GetHardWiredDefaults(void) { char *def_str; char buf[1024]; DEF("Markers", BOOL, DEF_MARK_FLAG); DEF("LargeMarkers", BOOL, DEF_LARGEMARK_FLAG); DEF("StyleMarkers", BOOL, DEF_STYLEMARK_FLAG); DEF("Ticks", BOOL, DEF_TICK_FLAG); DEF("TickAxis", BOOL, DEF_TICKAXIS_FLAG); DEF("BoundBox", BOOL, DEF_BB_FLAG); DEF("PlotLines", BOOL, DEF_PLOTLINE_FLAG); DEF("DisplayHints", BOOL, DEF_DISPHINTS_FLAG); DEF("LineWidth", INT, DEF_LINE_WIDTH); DEF("GridWidth", INT, DEF_GRID_WIDTH); DEF("DotWidth", INT, DEF_DOT_WIDTH); DEF("XUnitTextX", STR, DEF_XUNIT_TEXT_X); DEF("XUnitTextY", STR, DEF_XUNIT_TEXT_Y); DEF("XUnitTextZ", STR, DEF_XUNIT_TEXT_Z); DEF("YUnitText", STR, DEF_YUNIT_TEXT); DEF("FormatX", STR, DEF_FMT_X); DEF("FormatY", STR, DEF_FMT_Y); DEF("GridColor", PIXEL, DEF_GRID_COLOR); DEF("TextColor", PIXEL, DEF_TEXT_COLOR); DEF("GridStyle", STYLE, DEF_GRID_STYLE); DEF("LabelFont", FONT, DEF_LABEL_FONT); DEF("TitleFont", FONT, DEF_TITLE_FONT); DEF("InitialWindowWidth", INT, DEF_INIT_WIN_WIDTH); DEF("InitialWindowHeight", INT, DEF_INIT_WIN_HEIGHT); DEF("InitialXWindowOffsetX", INT, DEF_INIT_WIN_OFFSET_X); DEF("InitialXWindowOffsetY", INT, DEF_INIT_WIN_OFFSET_Y); DEF("InitialYWindowOffsetX", INT, DEF_INIT_WIN_OFFSET_X); DEF("InitialYWindowOffsetY", INT, DEF_INIT_WIN_OFFSET_Y); DEF("InitialZWindowOffsetX", INT, DEF_INIT_WIN_OFFSET_X); DEF("InitialZWindowOffsetY", INT, DEF_INIT_WIN_OFFSET_Y); // Initalize attribute colors defaults unsigned int colorindex = param_palette->ColorSlots() / 8; char colorstr[10]; int ici; for(unsigned int idx(0); idx < 8; ++idx) { sprintf(buf, "%d.Style", idx); Set_Parameter(buf, STYLE, defStyle[idx]); sprintf(buf, "%d.Color", idx); ici = (idx * colorindex) + param_palette->PaletteStart(); ici = std::min(ici, param_palette->PaletteEnd()); ici = std::max(ici, param_palette->PaletteStart() + 1); // for lowblack sprintf(colorstr, "%u", ici); Set_Parameter(buf, INT, colorstr); } } // ------------------------------------------------------------------- void XYPlotParameters::Set_Parameter(char *name, param_types type, const char *val) { param_full *entry = st_lookup(name); if(entry) { if(entry->real_form) { free_resource(entry->real_form); } if(entry->text_form) { delete [] entry->text_form; } } else { entry = new param_full; st_insert(STRDUP(name), entry); } entry->real_form = NULL; entry->type = type; entry->text_form = new char[strlen(val) + 1]; strcpy(entry->text_form ,val); } // ------------------------------------------------------------------- int XYPlotParameters::Get_Parameter(char *name, params *val) { param_full *entry = st_lookup(name); if( ! entry) { fprintf(stderr, "Couldn't find parameter %s for %s.\n", name, title); return 0; } if( ! entry->real_form) { entry->real_form = resolve_entry(name, entry->type, entry->text_form); } *val = *(entry->real_form); return 1; } // ------------------------------------------------------------------- void XYPlotParameters::free_resource(params *val) { switch (val->type) { case INT: case STR: case BOOL: case PIXEL: case DBL: // No reclaiming necessary break; case FONT: XFreeFont(gaPtr->PDisplay(), val->fontv.value); break; case STYLE: delete val->stylev.dash_list; break; } delete val; } // ------------------------------------------------------------------- params * XYPlotParameters::resolve_entry(char *name, param_types type, char *form) { static char paramstr[] = "Parameter %s: can't translate `%s' into a %s (defaulting to `%s')\n"; params *result = new params; result->type = type; switch (type) { case INT: if(sscanf(form, "%d", &result->intv.value) != 1) { fprintf(stderr, paramstr, name, form, "integer", DEF_INT); result->intv.value = atoi(DEF_INT); } break; case STR: result->strv.value = form; break; case PIXEL: if( ! do_color(form, &result->pixv.value)) { fprintf(stderr, paramstr, name, form, "color", DEF_PIXEL); do_color(DEF_PIXEL, &result->pixv.value); } break; case FONT: if( ! do_font(form, &result->fontv.value)) { fprintf(stderr, paramstr, name, form, "font", DEF_FONT); do_font(DEF_FONT, &result->fontv.value); } break; case STYLE: if( ! do_style(form, &result->stylev)) { fprintf(stderr, paramstr, name, form, "line style", DEF_STYLE); do_style(DEF_STYLE, &result->stylev); } break; case BOOL: if( ! do_bool(form, &result->boolv.value)) { fprintf(stderr, paramstr, name, form, "boolean flag", DEF_BOOL); do_bool(DEF_BOOL, &result->boolv.value); } break; case DBL: if(sscanf(form, "%lf", &result->dblv.value) != 1) { fprintf(stderr, paramstr, name, form, "double", DEF_DBL); result->dblv.value = atof(DEF_DBL); } break; } return result; } // ------------------------------------------------------------------- int XYPlotParameters::do_color(char *name, XColor *color) { Colormap cmap = param_palette->GetColormap(); if( ! XParseColor(gaPtr->PDisplay(), DefaultColormap(gaPtr->PDisplay(), gaPtr->PScreenNumber()), name, color)) { return 0; } if(string_compare(name, "black") == 0) { color->pixel = BlackPixel(gaPtr->PDisplay(), gaPtr->PScreenNumber()); XQueryColor(gaPtr->PDisplay(), cmap, color); return 1; } if(string_compare(name, "white") == 0) { color->pixel = WhitePixel(gaPtr->PDisplay(), gaPtr->PScreenNumber()); XQueryColor(gaPtr->PDisplay(), cmap, color); return 1; } // Choose the closest color in the palette, based on Euclidian distance // of RGB values (does this create pastel colors??) double red(color->red), green(color->green), blue(color->blue); double best(DBL_MAX); unsigned long best_pix = WhitePixel(gaPtr->PDisplay(), gaPtr->PScreenNumber()); int end(param_palette->PaletteEnd()); for(int ii(param_palette->PaletteStart()); ii <= end; ++ii) { const XColor *newcolor = ¶m_palette->GetColorCells()[ii]; double dred(newcolor->red - red); double dgreen(newcolor->green - green); double dblue(newcolor->blue - blue); double temp((dred * dred) + (dgreen * dgreen) + (dblue * dblue)); if(temp < best) { best = temp; best_pix = newcolor->pixel; } } color->pixel = best_pix; XQueryColor(gaPtr->PDisplay(), cmap, color); return 1; } // ------------------------------------------------------------------- int XYPlotParameters::do_font(char *name, XFontStruct **font_info) { char name_copy[DEF_MAX_FONT], query_spec[DEF_MAX_FONT]; char *font_family, *font_size, **font_list; int font_size_value, font_count, i; // First attempt to interpret as font family/size strcpy(name_copy, name); if((font_size = index(name_copy, '-'))) { *font_size = '\0'; font_family = name_copy; ++font_size; font_size_value = atoi(font_size); if(font_size_value > 0) { // Still a little iffy -- what about weight and roman vs. other sprintf(query_spec, ISO_FONT, font_family, font_size_value * 10); font_list = XListFonts(gaPtr->PDisplay(), query_spec, DEF_MAX_NAMES, &font_count); // Load first one that you can for(i = 0; i < font_count; ++i) { if((*font_info = XLoadQueryFont(gaPtr->PDisplay(), font_list[i]))) { break; } } if(*font_info) { return 1; } } } // Assume normal font name *font_info = XLoadQueryFont(gaPtr->PDisplay(), name); if((*font_info = XLoadQueryFont(gaPtr->PDisplay(), name)) != NULL) { return 1; } return 0; } // ------------------------------------------------------------------- int XYPlotParameters::do_style(char *list, param_style *val) { char *i, *spot, last_char; int count; for(i = list; *i; ++i) { if((*i != '0') && (*i != '1')) { break; } } if( ! *i) { val->len = 0; last_char = '\0'; for(i = list; *i; ++i) { if(*i != last_char) { val->len += 1; last_char = *i; } } val->dash_list = new char[val->len+1]; last_char = *list; spot = val->dash_list; count = 0; for(i = list; *i; ++i) { if(*i != last_char) { *spot++ = (char) count; last_char = *i; count = 1; } else { ++count; } } *spot = (char) count; return 1; } else { return 0; } } // ------------------------------------------------------------------- int XYPlotParameters::do_bool(char *name, int *val) { char **term; for(term = positive; *term; ++term) { if(string_compare(name, *term) == 0) { *val = 1; return 1; } } for(term = negative; *term; ++term) { if(string_compare(name, *term) == 0) { *val = 0; return 1; } } return 0; } // ------------------------------------------------------------------- void XYPlotParameters::ReadFromFile(char *filename) { FILE *fs; if((fs = fopen(filename, "r")) != NULL) { char linebuffer[100], keybuffer[50], typebuffer[50], valbuffer[50]; param_types type; while(fgets(linebuffer, 100, fs)) { if(sscanf(linebuffer, "%s %s %s", keybuffer, typebuffer, valbuffer) != 3) { break; } if( ! strcmp(typebuffer, "BOOL")) type = BOOL; else if( ! strcmp(typebuffer, "STYLE")) type = STYLE; else if( ! strcmp(typebuffer, "INT")) type = INT; else if( ! strcmp(typebuffer, "STR")) type = STR; else if( ! strcmp(typebuffer, "PIXEL")) type = PIXEL; else if( ! strcmp(typebuffer, "FONT")) type = FONT; else if( ! strcmp(typebuffer, "DBL")) type = DBL; else break; Set_Parameter(keybuffer, type, valbuffer); } fclose(fs); } } // ------------------------------------------------------------------- void XYPlotParameters::WriteToFile(char *filename) { st_table_entry *ptr; FILE *fs; if((fs = fopen(filename, "w")) == NULL) { return; } for(int i(0); i < param_table.num_bins; ++i) { for(ptr = param_table.bins[i]; ptr; ptr = ptr->next) { param_full *val = ptr->record; fprintf(fs, "%s\t", ptr->key); if(strlen(ptr->key) < 10) { fprintf(fs, "\t"); } switch (val->type) { case INT: fprintf(fs, "INT"); break; case STR: fprintf(fs, "STR"); break; case PIXEL: fprintf(fs, "PIXEL"); break; case FONT: fprintf(fs, "FONT"); break; case STYLE: fprintf(fs, "STYLE"); break; case BOOL: fprintf(fs, "BOOL"); break; case DBL: fprintf(fs, "DBL"); break; } fprintf(fs, "\t%s\n", val->text_form); } } fclose(fs); } // // // replace this with a map vvvvvvvvvvvvvvvv // // // ------------------------------------------------------------------- param_full *XYPlotParameters::st_lookup(register char *key) { register st_table_entry *ptr; // find entry. ptr = param_table.bins[strihash(key)]; while(true) { if(ptr == NULL) { break; } if( ! string_compare(key, ptr->key)) { return ptr->record; } ptr = ptr->next; } return NULL; } // ------------------------------------------------------------------- int XYPlotParameters::st_insert(char *key, param_full *value) { int hash_val; st_table_entry *newentry; register st_table_entry *ptr, **last; hash_val = strihash(key); // find entry. last = ¶m_table.bins[hash_val]; ptr = *last; while(ptr && string_compare(key, ptr->key)) { last = &ptr->next; ptr = *last; } if(ptr && param_table.reorder_flag) { *last = ptr->next; ptr->next = param_table.bins[hash_val]; param_table.bins[hash_val] = ptr; } if(ptr == NULL) { // add directly. if(param_table.num_entries/param_table.num_bins >= param_table.max_density) { rehash(); hash_val = strihash(key); } newentry = new st_table_entry; newentry->key = key; newentry->record = value; newentry->next = param_table.bins[hash_val]; param_table.bins[hash_val] = newentry; param_table.num_entries++; return 0; } else { ptr->record = value; return 1; } } // ------------------------------------------------------------------- void XYPlotParameters::rehash(void) { st_table_entry *ptr, *next, **old_bins = param_table.bins; int i, hash_val, old_num_bins = param_table.num_bins; Real new_num_bins(param_table.grow_factor * old_num_bins); param_table.num_bins = (int) new_num_bins; if(param_table.num_bins % 2 == 0) { param_table.num_bins++; } param_table.bins = new st_table_entry *[param_table.num_bins]; for(i = 0; i != new_num_bins; ++i) { param_table.bins[i] = NULL; } for(i = 0; i < old_num_bins; ++i) { ptr = old_bins[i]; while(ptr) { next = ptr->next; hash_val = strihash(ptr->key); ptr->next = param_table.bins[hash_val]; param_table.bins[hash_val] = ptr; ptr = next; } } delete old_bins; } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/PltApp.H0000644000175000017500000003445511634153073020624 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: PltApp.H,v 1.62 2002/12/10 20:12:23 vince Exp $ // // --------------------------------------------------------------- // PltApp.H // --------------------------------------------------------------- #ifndef _PLTAPP_H_ #define _PLTAPP_H_ #include #include #undef index #include "AmrvisConstants.H" #include "Box.H" #include "Dataset.H" #include "GlobalUtilities.H" #include "Palette.H" #if (BL_SPACEDIM==3) # include "ViewTransform.H" class ProjectionPicture; #endif #include #include using std::vector; using std::string; class DataServices; class AmrPicture; class Dataset; class GraphicsAttributes; class PltAppState; class XYPlotParameters; class XYPlotWin; class XYPlotDataList; // plane sweep widget controls (WC) const int WCSTOP = 0; const int WCXNEG = 1; const int WCXPOS = 2; const int WCYNEG = 3; const int WCYPOS = 4; const int WCZNEG = 5; const int WCZPOS = 6; // file animation widget controls (WCA) const int WCATNEG = 7; const int WCASTOP = 8; const int WCATPOS = 9; const int WCARGB = 10; const int WCN = 11; // number of control widget const int NFRAMES = 19; const int OXY(0); const int OYZ(1); const int OXZ(2); class PltApp; typedef void (PltApp::*memberCB)(Widget, XtPointer, XtPointer); class PltApp { private: PltApp(); // not defined public: // created when opening a new file PltApp(XtAppContext, Widget, const string &filename, const Array &dataservicesptr, bool isAnim); // for subregion PltApp(XtAppContext app, Widget w, const Box ®ion, const IntVect &offset, //AmrPicture *parentPtr, PltApp *pltparent, const string &palfile, bool isAnim, const string &newderived, const string &file); ~PltApp(); static void SetDefaultPalette(const string &palString); static void SetDefaultLightingFile(const string &lightFileString); static void SetInitialDerived(const string &initialderived); static void SetInitialScale(int initScale); static int GetInitialScale(); static void SetInitialFormatString(const string &formatString); static void SetDefaultShowBoxes(int showBoxes); static int GetDefaultShowBoxes(); static void SetInitialWindowHeight(int initWindowHeight); static void SetInitialWindowWidth(int initWindowWidth); static void SetReserveSystemColors(int reservesystemcolors); Widget WId() { return wAmrVisTopLevel; } void SetNewFormatString(const string &newformatstring); AmrPicture *GetAmrPicturePtr(int plane) { return amrPicturePtrArray[plane]; } Palette *GetPalettePtr() { return pltPaletteptr; } string GetPaletteName() { return palFilename; } string GetLightingFileName() { return lightingFilename; } DataServices *GetDataServicesPtr() { return dataServicesPtr[currentFrame]; } Array &GetDataServicesPtrArray() { return dataServicesPtr; } int GetActiveView() const { return activeView; } XtAppContext GetAppContext() { return appContext; } Widget GetStopButtonWidget() { return wControls[WCSTOP]; } bool IsAnim() const { return animating2d; } bool Animating() const { return ((bool) animationIId); } int CurrentFrame() const { return currentFrame; } XImage *CurrentFrameXImage() { return frameBuffer[currentFrame]; } GraphicsAttributes *GetGAptr() const { return gaPtr; } PltAppState *GetPltAppState() const { return pltAppState; } const string &GetFileName(); bool PaletteDrawn(); bool PaletteCBQ() const { return paletteCBQ; } void SetPaletteCBQ() { paletteCBQ = true; } void ClearPaletteCBQ() { paletteCBQ = false; } Widget GetPalArea() const { return wPalArea; } void PaletteDrawn(bool trueOrFalse); XYPlotDataList *CreateLinePlot(int V, int sdir, int mal, int ixY, const string *derived); GC GetRbgc() const { return rbgc; } void QuitDataset(); void DoBackStep(int); void DoForwardStep(int); void DoExposeRef(Widget = None, XtPointer = NULL, XtPointer = NULL); #if (BL_SPACEDIM == 3) void DoExposeTransDA(Widget = None, XtPointer = NULL, XtPointer = NULL); ProjectionPicture *GetProjPicturePtr() const { return projPicturePtr; } Widget GetWTransDA() const { return wTransDA; } #endif void DetachXYPlotWin(int dir) { XYplotwin[dir] = NULL; } XYPlotParameters *GetXYPlotParameters() const { return XYplotparameters; } XYPlotWin *GetXYPlotWin(int dir) const { return XYplotwin[dir]; } private: Widget wTopLevel, wAmrVisTopLevel; Widget wScrollArea[NPLANES], wPlotPlane[NPLANES]; Array wRangeRadioButton; Widget wFileRangeCheckBox; Widget wUserMin, wUserMax; Widget wWhichFileLabel, wWhichFileScale, wWhichTimeLabel; Widget wControlForm; Widget wNumberContours; Widget wContoursTopLevel, wInfoTopLevel; Widget wSetRangeTopLevel, wNumberFormatTopLevel; Widget wFormat; Widget wLocArea, wPlotArea; Widget wControls[WCN]; Widget wCurrScale, wCurrLevel, wCurrDerived; Widget wPlotLabel, wContourLabel; Widget wPalArea; #if (BL_SPACEDIM == 3) Widget wTransDA, wRender, wLabelAxes, wDetach; Widget wOrientXY, wOrientYZ, wOrientXZ; Widget wLWTopLevel, wLWForm; Widget wAttach, wDetachTopLevel; #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) Widget wAutoDraw; Widget wLWambient, wLWdiffuse, wLWspecular, wLWshiny; Widget wLWminOpacity, wLWmaxOpacity; Widget wCurrentRenderMode, wCurrentClassify; #endif #endif XYPlotParameters *XYplotparameters; XYPlotWin *XYplotwin[BL_SPACEDIM]; XtAppContext appContext; Arg args[MAXARGS]; Palette *pltPaletteptr; AmrPicture *amrPicturePtrArray[NPLANES]; IntVect ivLowOffsetMAL; // at maxAllowableLevel MinMaxRangeType currentRangeType; bool animating2d, setRangeShowing, contoursShowing, infoShowing, bFormatShowing; bool bSetRangeRedraw; bool datasetShowing, paletteDrawn, writingRGB, interfaceReady; bool paletteCBQ; int servingButton; int currentFrame, animFrames, frameSpeed; int activeView; int startX, startY, endX, endY; int maxAllowableScale; bool bCartGridSmoothing; string contourNumString, fileName, palFilename, lightingFilename; char buffer[BUFSIZ]; Box trueRegion, selectionBox; Dataset *datasetPtr; GraphicsAttributes *gaPtr; Array dataServicesPtr; Array fileNames; Array frameBuffer; vector readyFrames; AnimDirection animDirection; XtIntervalId animationIId, multiclickIId; Real finestDx[BL_SPACEDIM], gridOffset[BL_SPACEDIM]; String trans; int startcutX[3], startcutY[3], finishcutX[3], finishcutY[3]; PltApp *pltParent; PltAppState *pltAppState; Display *display; GC xgc; bool bFileRangeButtonSet; void DoToggleFileRangeButton(Widget, XtPointer, XtPointer); // baggage for fast rubber banding GC rbgc; XEvent nextEvent; int rWidth, rHeight, rStartX, rStartY; Cursor cursor; static string defaultPaletteString, initialDerived, initialFormatString; static string defaultLightingFilename; static int initialScale, initialWindowHeight, initialWindowWidth; static int defaultShowBoxes, placementOffsetX, placementOffsetY; static int reserveSystemColors; #if (BL_SPACEDIM==3) int acc, labelAxes, transDetached; int daWidth, daHeight; ProjectionPicture *projPicturePtr; ViewTransform viewTrans; //#if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) bool lightingModel, showing3dRender, preClassify, lightingWindowExists; //#endif #endif void PltAppInit(bool bSubVolume = false); // called by constructors void DoDrawPointerLocation(Widget, XtPointer, XtPointer); void ChangeScale(Widget, XtPointer, XtPointer); void ChangeLevel(Widget, XtPointer, XtPointer); void ChangeDerived(Widget, XtPointer, XtPointer); void ChangeContour(Widget, XtPointer, XtPointer); void ChangePlane(Widget, XtPointer, XtPointer); void DrawAxes(Widget, int, int, int, char *, char *, int); void ResetAnimation(); void StopAnimation(); void Animate(AnimDirection direction); void ShowFrame(); void DirtyFrames(); void DoRubberBanding(Widget, XtPointer, XtPointer); void DoBoxesButton(Widget, XtPointer, XtPointer); void DoAnimBackStep(); void DoAnimForwardStep(); void DoAnimFileScale(Widget, XtPointer, XtPointer); void DoReadContourString(Widget, XmSelectionBoxCallbackStruct *unused, bool bRedrawAmrPicture = true); void DoUpdateFrame(Widget, XtPointer, XtPointer); void DoSpeedScale(Widget, XtPointer, XtPointer); void DoDatasetButton(Widget, XtPointer, XtPointer); void DoNumberFormatButton(Widget, XtPointer, XtPointer); void DoPaletteButton(Widget, XtPointer, XtPointer); void DoSetRangeButton(Widget, XtPointer, XtPointer); void DoContoursButton(Widget, XtPointer, XtPointer); void DoDoneNumberFormat(Widget, XtPointer, XtPointer); void DoCancelNumberFormat(Widget, XtPointer, XtPointer); void DoDoneSetRange(Widget, XtPointer, XtPointer); void DoCancelSetRange(Widget, XtPointer, XtPointer); void DoUserMin(Widget, XtPointer, XtPointer); void DoUserMax(Widget, XtPointer, XtPointer); void DoOpenPalFile(Widget, XtPointer, XtPointer); void DoSubregion(Widget, XtPointer, XtPointer); void DoInfoButton(Widget, XtPointer, XtPointer); void DoOutput(Widget, XtPointer, XtPointer); void DoCreatePSFile(Widget, XtPointer, XtPointer); void DoCreateRGBFile(Widget, XtPointer, XtPointer); void DoCreateFABFile(Widget, XtPointer, XtPointer); void DoCreateAnimRGBFile(); void DoOpenFileLightingWindow(Widget w, XtPointer, XtPointer call_data); void DoOpenLightingFile(Widget w, XtPointer, XtPointer call_data); void ToggleRange(Widget, XtPointer, XtPointer); void ReadContourString(Widget, XtPointer, XtPointer); void DestroyNumberFormatWindow(Widget, XtPointer, XtPointer); void DestroySetRangeWindow(Widget, XtPointer, XtPointer); void DestroyContoursWindow(Widget, XtPointer, XtPointer); void DestroyInfoWindow(Widget, XtPointer, XtPointer); void CloseInfoWindow(Widget, XtPointer, XtPointer); void CloseContoursWindow(Widget, XtPointer, XtPointer); void DoExposePalette(Widget, XtPointer, XtPointer); void PADoExposePicture(Widget, XtPointer, XtPointer); #if (BL_SPACEDIM==3) void DoOrient(Widget, XtPointer, XtPointer); void DoLabelAxes(Widget, XtPointer, XtPointer); void DoTransInput(Widget, XtPointer, XtPointer); void DoTransResize(Widget, XtPointer, XtPointer); void DoAttach(Widget, XtPointer, XtPointer); void DoDetach(Widget, XtPointer, XtPointer); #if defined(BL_VOLUMERENDER) void DoRender(Widget = None, XtPointer = NULL, XtPointer = NULL); void DoRenderModeMenu(Widget, XtPointer, XtPointer); void DoClassifyMenu(Widget, XtPointer, XtPointer); void DoAutoDraw(Widget, XtPointer, XtPointer); void DoCreateLightingWindow(Widget, XtPointer, XtPointer); void DoDoneLightingWindow(Widget, XtPointer, XtPointer); void DoApplyLightingWindow(Widget, XtPointer, XtPointer); void DoCancelLightingWindow(Widget, XtPointer, XtPointer); void DestroyLightingWindow(Widget, XtPointer, XtPointer); #endif void Clear(); #endif void FindAndSetMinMax(const MinMaxRangeType mmrangetype, const int framenumber, const string ¤tderived, const int derivednumber, const Array &onBox, const int coarselevel, const int finelevel, const bool resetIfSet); void AddStaticCallback(Widget w, String whichcb, memberCB whichf, void *d = NULL); void AddStaticEventHandler(Widget w, EventMask mask, memberCB cbf, void *d = NULL); XtIntervalId AddStaticTimeOut(int time, memberCB whichf, void *d = NULL); static void StaticCallback(Widget, XtPointer, XtPointer); static void StaticEvent(Widget w, XtPointer client_data, XEvent *event, char*); static void StaticTimeOut(XtPointer client_data, XtIntervalId *); class CBData { // callback data public: CBData(PltApp *p, XtPointer d, memberCB mcb) : instance(p), data(d), cbFunc(mcb) { } ~CBData() { } PltApp *instance; XtPointer data; memberCB cbFunc; }; Array cbdPtrs; // save these so we can delete them later }; // ------------------------------------------------------------------- class AVXGrab { public: AVXGrab(Display *display) : bIsGrabbed(true), cachedDisplay(display) { XGrabServer(display); } ~AVXGrab() { if(bIsGrabbed) { std::cout << "_______in ~AVXGrab: implicit ungrab." << std::endl; } XUngrabServer(cachedDisplay); bIsGrabbed = false; } void ExplicitUngrab() { if(bIsGrabbed == false) { std::cout << "_______in AVXGrab::ExplicitUngrab: server not grabbed." << std::endl; } XUngrabServer(cachedDisplay); bIsGrabbed = false; } private: AVXGrab(); // not implemented bool bIsGrabbed; Display *cachedDisplay; }; // ------------------------------------------------------------------- void SubregionPltApp(Widget toplevel, const Box ®ion, const IntVect &offset, PltApp *pltparent, const string &palfile, int isanim, const string &derived, const string &filename); void CBQuitPltApp(Widget, XtPointer, XtPointer); void PrintMessage(char *cpmsg); #endif ccseapps-2.5/CCSEApps/pAmrvis/GridPicture.cpp0000644000175000017500000001040611634153073022226 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // ------------------------------------------------------------------- // GridPicture.cpp // ------------------------------------------------------------------- #include "GridPicture.H" #include "GlobalUtilities.H" #include #include // ------------------------------------------------------------------- GridPicture::GridPicture() { } // ------------------------------------------------------------------- void GridPicture::GridPictureInit(int level, int rratio, int scale, int picSizeH, int picSizeV, const Box &overlapbox, const Box &boxWithData, int slicedir) { sliceDir = slicedir; refRatio = rratio; currentScale = scale; pictureSizeH = picSizeH; pictureSizeV = picSizeV; overlapBox = overlapbox; BL_ASSERT(overlapBox.sameSize(boxWithData)); imageBox = overlapBox; imageBox.refine(refRatio * currentScale); if(sliceDir == ZDIR) { dataSizeH = boxWithData.length(XDIR); dataSizeV = boxWithData.length(YDIR); } else if(sliceDir == YDIR) { dataSizeV = boxWithData.length(ZDIR); dataSizeH = boxWithData.length(XDIR); } else { dataSizeH = boxWithData.length(YDIR); dataSizeV = boxWithData.length(ZDIR); } imageSizeH = dataSizeH * refRatio * currentScale; imageSizeV = dataSizeV * refRatio * currentScale; } // end GridPictureInit // ------------------------------------------------------------------- GridPicture::~GridPicture() { } // ------------------------------------------------------------------- void GridPicture::ChangeScale(int newScale, int picSizeH, int picSizeV) { currentScale = newScale; imageBox = overlapBox; imageBox.refine(refRatio * currentScale); // use datasize instead of imageBox.length() for node centered boxes imageSizeH = dataSizeH * refRatio * currentScale; imageSizeV = dataSizeV * refRatio * currentScale; pictureSizeH = picSizeH; pictureSizeV = picSizeV; } // ------------------------------------------------------------------- int GridPicture::HPositionInPicture() { int endLoc; if(sliceDir == ZDIR) { endLoc = imageBox.smallEnd()[XDIR]; } else if(sliceDir == YDIR) { endLoc = imageBox.smallEnd()[XDIR]; } else { endLoc = imageBox.smallEnd()[YDIR]; } return (endLoc - ((int) imageSizeH % refRatio)); } // ------------------------------------------------------------------- int GridPicture::VPositionInPicture() { int endLoc, nodeAdjustment; if(sliceDir == ZDIR) { endLoc = imageBox.bigEnd()[YDIR]; nodeAdjustment = imageBox.type()[YDIR] * (currentScale - 1) * refRatio; } else if(sliceDir == YDIR) { endLoc = imageBox.bigEnd()[ZDIR]; nodeAdjustment = imageBox.type()[ZDIR] * (currentScale - 1) * refRatio; } else { endLoc = imageBox.bigEnd()[ZDIR]; nodeAdjustment = imageBox.type()[ZDIR] * (currentScale - 1) * refRatio; } return ((pictureSizeV-1) - endLoc - ((int) imageSizeV % refRatio) - nodeAdjustment); } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/MessageArea.H0000644000175000017500000000360311634153073021570 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MessageArea.H,v 1.9 2002/04/03 01:03:47 vince Exp $ // // --------------------------------------------------------------- // MessageArea.H // --------------------------------------------------------------- #ifndef _MESSAGEAREA_H #define _MESSAGEAREA_H #include #include #include "AmrvisConstants.H" class cMessageArea { private: Widget wTextOut; XmTextPosition currentTextPosition; char localBuffer[BUFSIZ]; public: cMessageArea(); cMessageArea(Widget printTextHere); ~cMessageArea(); void Init(Widget printTextHere); void PrintText(char *buffer); }; #endif ccseapps-2.5/CCSEApps/pAmrvis/PltAppState.H0000644000175000017500000001446611634153073021625 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // --------------------------------------------------------------- // PltAppState.H // --------------------------------------------------------------- // state observers: // pltapp // amrpicture // projectionpicture // dataset // palette // lightingwindow // xyplots // --------------------------------------------------------------- #ifndef _PLTAPPSTATE_H_ #define _PLTAPPSTATE_H_ #include "AmrvisConstants.H" #include "Array.H" #include "Box.H" #include using std::string; const int NOTSETYET(-42); static void Cnsy(int val) { BL_ASSERT(val != NOTSETYET); } class CMinMax { public: CMinMax(); ~CMinMax(); void SetMinMax(const Real rmin, const Real rmax); void GetMinMax(Real &rmin, Real &rmax); bool IsSet() const { return bMinMaxSet; } // no is_set checking on these Real Min() const { return rMin; } Real Max() const { return rMax; } private: Real rMin, rMax; bool bMinMaxSet; }; class AmrPicture; class PltAppState { private: PltAppState(); // disallow public: // created when opening a new file PltAppState(int numFrames, int numDerived); ~PltAppState(); PltAppState &operator=(const PltAppState &rhs); // ------------------------ scale int CurrentScale() const { Cnsy(currentScale); return currentScale; } void SetCurrentScale(int newScale) { currentScale = newScale; } int MaxScale() const { Cnsy(maxScale); return maxScale; } void SetMaxScale(int newMaxScale) { maxScale = newMaxScale; } // ------------------------ frame void SetCurrentFrame(int newFrame) { currentFrame = newFrame; } // ------------------------ derived void SetCurrentDerived(const string &newDerived, int cdnumber); const string &CurrentDerived() const { return currentDerived; } int CurrentDerivedNumber() const { Cnsy(currentDerivedNumber); return currentDerivedNumber; } // ------------------------ boxes bool GetShowingBoxes() const { return showBoxes; } void SetShowingBoxes(bool showing) { showBoxes = showing; } // ------------------------ number format string GetFormatString() const { return formatString; } void SetFormatString(const string &newformat) { formatString = newformat; } // ------------------------ contours void SetContourType(ContourType newContourType) { currentContourType = newContourType; } ContourType GetContourType() const { return currentContourType; } void SetNumContours(int ncontours) { nContours = ncontours; } int GetNumContours() const { Cnsy(nContours); return nContours; } // ------------------------ mins and maxes MinMaxRangeType GetMinMaxRangeType() const { return currentMinMaxType; } void SetMinMaxRangeType(MinMaxRangeType newmmrtype) { currentMinMaxType = newmmrtype; } void SetMinMax(const MinMaxRangeType mmrangetype, const int framenumber, const int derivednumber, const Real rmin, const Real rmax); void GetMinMax(const MinMaxRangeType mmrangetype, const int framenumber, const int derivednumber, Real &rmin, Real &rmax); // this one uses the current frame, derived, and range type void GetMinMax(Real &rmin, Real &rmax); bool IsSet(const MinMaxRangeType mmrangetype, const int framenumber, const int derivednumber); void PrintSetMap(); // ------------------------ levels void SetMinAllowableLevel(int newval) { minAllowableLevel = newval; } void SetMaxAllowableLevel(int newval) { maxAllowableLevel = newval; } void SetMinDrawnLevel(int newval) { minDrawnLevel = newval; } void SetMaxDrawnLevel(int newval) { maxDrawnLevel = newval; } void SetFinestLevel(int newval) { finestLevel = newval; } int MinAllowableLevel() const { Cnsy(minAllowableLevel); return minAllowableLevel; } int MaxAllowableLevel() const { Cnsy(maxAllowableLevel); return maxAllowableLevel; } int MinDrawnLevel() const { Cnsy(minDrawnLevel); return minDrawnLevel; } int MaxDrawnLevel() const { Cnsy(maxDrawnLevel); return maxDrawnLevel; } int FinestLevel() const { Cnsy(finestLevel); return finestLevel; } //GraphicsAttributes *GetGAptr() const { return gaPtr; } private: // state variables int currentScale; int maxScale; int currentFrame; string currentDerived; int currentDerivedNumber; bool showBoxes; ContourType currentContourType; int nContours; MinMaxRangeType currentMinMaxType; string formatString; // mins and maxes Array > > minMax; // minMax [frame] [derived] [RangeType] Array subDomains; int minDrawnLevel, maxDrawnLevel, minAllowableLevel, maxAllowableLevel; int finestLevel; //bool datasetShowing, paletteDrawn, writingRGB, interfaceReady; //int minDrawnLevel, maxDrawnLevel, minDataLevel, maxDataLevel; //int activeView; string contourNumString, fileName, palFilename; //Array fileNames, derivedStrings; //GraphicsAttributes *gaPtr; // observers //AmrPicture *amrPicturePtrArray[NPLANES]; //Palette *pltPaletteptr; //Dataset *datasetPtr; //Array dataServicesPtr; }; #endif ccseapps-2.5/CCSEApps/pAmrvis/XYPlotParam.H0000644000175000017500000001613311634153073021575 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // ------------------------------------------------------------------- // XYPlotParam.H -- Class definition for XYPlotParameters // ------------------------------------------------------------------- #ifndef _XYPLOT_PARAM_H #define _XYPLOT_PARAM_H #include #include #include #define ST_DEFAULT_MAX_DENSITY 5 #define ST_DEFAULT_INIT_TABLE_SIZE 11 #define ST_DEFAULT_GROW_FACTOR 2.0 #define ST_DEFAULT_REORDER_FLAG 0 #define ISO_FONT "*-*-%s-medium-r-normal-*-*-%d-*-*-*-*-iso8859-*" typedef enum param_types_defn { INT, STR, PIXEL, FONT, STYLE, BOOL, DBL } param_types; typedef struct params_int_defn { // INT param_types type; int value; } param_int; typedef struct params_str_defn { // STR param_types type; char *value; } param_str; typedef struct params_pix_defn { // PIXEL param_types type; XColor value; } param_pix; typedef struct params_font_defn { // FONT param_types type; XFontStruct *value; } param_font; typedef struct params_style_defn { // STYLE param_types type; int len; char *dash_list; } param_style; typedef struct params_bool_defn { // BOOL param_types type; int value; } param_bool; typedef struct params_dbl_defn { // DOUBLE param_types type; double value; } param_dbl; typedef union params_defn { param_types type; param_int intv; // INT param_str strv; // STR param_pix pixv; // PIXEL param_font fontv; // FONT param_style stylev; // STYLE param_bool boolv; // BOOL param_dbl dblv; // DBL } params; typedef struct param_full_defn { param_types type; char *text_form; params *real_form; } param_full; typedef struct st_table_entry_defn { char *key; param_full *record; struct st_table_entry_defn *next; } st_table_entry; typedef struct st_table_defn { int num_bins; int num_entries; int max_density; int reorder_flag; double grow_factor; st_table_entry **bins; } st_table; #include "XYPlotDefaults.H" #include "XYPlotWin.H" class GraphicsAttributes; class Palette; class XYPlotParameters { public: XYPlotParameters(Palette *palPtr, GraphicsAttributes *gaptr, char *name); ~XYPlotParameters(); // // Sets the parameter with the given name to have the type // _type_ and the text value _value_. This will be evaluated // to its full form the first time it is referenced using // Get_Parameter(). If it is already filled, the old value // will be reclaimed. // void Set_Parameter(char *name, param_types type, const char *val); // // This routine sets the value of an existing parameter to a new // value. The type of the parameter remains the same. Changes // in type should be done by using param_set() directly. // void Reset_Parameter(char *name, char *val); // // Retrieves a value from the parameter table. The value // is placed in val. If successful, the routine will // return 1. Otherwise, it will return 0. // int Get_Parameter(char *name, params *val); // // Writes the current settings out to a file. // void WriteToFile(char *filename); // // Reads in from a file. // void ReadFromFile(char *filename = NULL); // // Resets the palette and its dependent parameters. // void ResetPalette(Palette *newPalPtr); private: params param_temp; int param_ok; st_table param_table; Palette *param_palette; GraphicsAttributes *gaPtr; char *title; // // Reads in defaults defined by yours truly. // void GetHardWiredDefaults(void); // // Reclaims a resource based on its type // void free_resource(params *val); // // Allocates and returns an appropriate parameter structure // by translating form into its native type as given by type. // If it cant translate the given form, it will fall back onto // the default. // params *resolve_entry(char *name, param_types type, char *form); // // Translates name into a color and attempts to get the pixel // for the color using XAllocColor(). // int do_color(char *name, XColor *color); // // This routine translates a font name into a font structure. The // font name can be in two forms. The first form is -. // The family is a family name (like helvetica) and the size is // in points (like 12). If the font is not in this form, it // is assumed to be a regular X font name specification and // is looked up using the standard means. // int do_font(char *name, XFontStruct **font_info); // // Translates a string representation of a dash specification into // a form suitable for use in XSetDashes(). Assumes list // is a null terminated string of ones and zeros. // int do_style(char *list, param_style *val); // // Translates a string representation into a suitable binary value. // Can parse all kinds of interesting boolean type words. // int do_bool(char *name, int *val); // // Look up item in table -- return zero if not found // param_full * st_lookup(register char *key); // // Insert an item into the table - replacing if it already exists // int st_insert(char *key, param_full *value); // // Dumps a single parameter // void dump_it (char *key, char *value); // // Grows table // void rehash(void); int strihash(register char *xypstring) { register int val = 0; register int c; while ((c = *xypstring++) != '\0') { if(isupper(c)) { c = tolower(c); } val = val * 997 + c; } return ((val < 0) ? -val : val) % param_table.num_bins; } int string_compare(register char *s1, register char *s2) { register char c, d; while ((c = *s1) != '\0') { if(isupper(c)) { c = tolower(c); } d = *s2; if(isupper(d)) { d = tolower(d); } if(c != d) { return 1; } ++s1; ++s2; } if(*s2 != '\0') return 1; return 0; } }; #endif ccseapps-2.5/CCSEApps/pAmrvis/GraphicsAttributes.H0000644000175000017500000000660411634153073023226 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: GraphicsAttributes.H,v 1.18 2001/11/16 01:48:08 vince Exp $ // // --------------------------------------------------------------- // GraphicsAttributes.H // --------------------------------------------------------------- #ifndef _GRAPHICSATTRIBUTES_H #define _GRAPHICSATTRIBUTES_H #include "AmrvisConstants.H" #include using std::ostream; #include #include #undef index class GraphicsAttributes { friend ostream& operator<<(ostream &os, const GraphicsAttributes &ga); protected: Widget appTopLevel; Display *display; Screen *screen; Visual *visual; XVisualInfo visual_info; GC gc; Window root; int depth, screennumber, bytesPerPixel; int CalculateNBP(); unsigned long red_shift; unsigned long green_shift; unsigned long blue_shift; public: explicit GraphicsAttributes(Widget); Widget PTopLevel() const { return appTopLevel; } Display *PDisplay() const { return display; } Screen *PScreen() const { return screen; } Visual *PVisual() const { return visual; } GC PGC() const { return gc; } Window PRoot() const { return root; } int PDepth() const { return depth; } int PScreenNumber() const { return screennumber; } int PBytesPerPixel() const { return bytesPerPixel; } int PBitsPerRGB() const { return visual_info.bits_per_rgb; } bool IsTrueColor() const { return visual_info.c_class == TrueColor; } unsigned long PRedMask() const { return visual_info.red_mask; } unsigned long PGreenMask() const { return visual_info.green_mask; } unsigned long PBlueMask() const { return visual_info.blue_mask; } unsigned long PRedShift() const { return red_shift; } unsigned long PGreenShift() const { return green_shift; } unsigned long PBlueShift() const { return blue_shift; } int PBitmapPaddedWidth(int width) const; }; #endif // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/AmrPicture.cpp0000644000175000017500000024707511634153073022076 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrPicture.cpp,v 1.81 2003/02/28 02:01:37 vince Exp $ // // --------------------------------------------------------------- // AmrPicture.cpp // --------------------------------------------------------------- #include "AmrPicture.H" #include "PltApp.H" #include "PltAppState.H" #include "Palette.H" #include "DataServices.H" #include "ProjectionPicture.H" using std::cout; using std::cerr; using std::endl; using std::max; using std::min; #include #ifdef BL_USE_ARRAYVIEW #include "ArrayView.H" #endif bool DrawRaster(ContourType cType) { return (cType == RASTERONLY || cType == RASTERCONTOURS || cType == VECTORS); } bool DrawContours(ContourType cType) { return (cType == RASTERCONTOURS || cType == COLORCONTOURS || cType == BWCONTOURS); } static bool UsingFileRange(const MinMaxRangeType rt) { return(rt == FILEGLOBALMINMAX || rt == FILESUBREGIONMINMAX || rt == FILEUSERMINMAX); } // --------------------------------------------------------------------- AmrPicture::AmrPicture(GraphicsAttributes *gaptr, PltApp *pltappptr, PltAppState *pltappstateptr, DataServices *dataservicesptr, bool bcartgridsmoothing) : gaPtr(gaptr), pltAppPtr(pltappptr), pltAppStatePtr(pltappstateptr), dataServicesPtr(dataservicesptr), myView(XY), bCartGridSmoothing(bcartgridsmoothing), isSubDomain(false) { int i, ilev; const AmrData &amrData = dataServicesPtr->AmrDataRef(); int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); numberOfLevels = maxAllowableLevel + 1; maxLevelWithGrids = maxAllowableLevel; int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); subDomain.resize(numberOfLevels); for(ilev = 0; ilev <= maxAllowableLevel; ++ilev) { // set type subDomain[ilev].convert(amrData.ProbDomain()[0].type()); } subDomain[maxAllowableLevel].setSmall (amrData.ProbDomain()[maxAllowableLevel].smallEnd()); subDomain[maxAllowableLevel].setBig (amrData.ProbDomain()[maxAllowableLevel].bigEnd()); for(i = maxAllowableLevel - 1; i >= minDrawnLevel; --i) { subDomain[i] = subDomain[maxAllowableLevel]; subDomain[i].coarsen(AVGlobals::CRRBetweenLevels(i, maxAllowableLevel, amrData.RefRatio())); } dataSizeH.resize(numberOfLevels); dataSizeV.resize(numberOfLevels); dataSize.resize(numberOfLevels); for(ilev = 0; ilev <= maxAllowableLevel; ++ilev) { dataSizeH[ilev] = subDomain[ilev].length(XDIR); dataSizeV[ilev] = subDomain[ilev].length(YDIR); dataSize[ilev] = dataSizeH[ilev] * dataSizeV[ilev]; // for a picture (slice). } vLine = 0; hLine = subDomain[maxAllowableLevel].bigEnd(YDIR) * pltAppStatePtr->CurrentScale(); subcutY = hLine; subcut2ndY = hLine; #if (BL_SPACEDIM == 2) slice = 0; #else slice = subDomain[maxAllowableLevel].smallEnd(YZ-myView); #endif sliceBox.resize(numberOfLevels); for(ilev = minDrawnLevel; ilev <= maxAllowableLevel; ilev++) { // set type sliceBox[ilev].convert(subDomain[minDrawnLevel].type()); } sliceBox[maxAllowableLevel] = subDomain[maxAllowableLevel]; AmrPictureInit(); } // end AmrPicture constructor // --------------------------------------------------------------------- AmrPicture::AmrPicture(int view, GraphicsAttributes *gaptr, const Box ®ion, PltApp *parentPltAppPtr, PltApp *pltappptr, PltAppState *pltappstateptr, bool bcartgridsmoothing) : gaPtr(gaptr), pltAppPtr(pltappptr), pltAppStatePtr(pltappstateptr), myView(view), bCartGridSmoothing(bcartgridsmoothing), isSubDomain(true) { BL_ASSERT(pltappptr != NULL); int ilev; dataServicesPtr = pltAppPtr->GetDataServicesPtr(); const AmrData &amrData = dataServicesPtr->AmrDataRef(); int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); numberOfLevels = maxAllowableLevel + 1; maxLevelWithGrids = maxAllowableLevel; int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); subDomain.resize(numberOfLevels); Box sdBox(region); // region is at the finestLevel subDomain[maxAllowableLevel] = sdBox.coarsen(AVGlobals::CRRBetweenLevels(maxAllowableLevel, pltAppStatePtr->FinestLevel(), amrData.RefRatio())); for(ilev = maxAllowableLevel - 1; ilev >= minDrawnLevel; --ilev) { subDomain[ilev] = subDomain[maxAllowableLevel]; subDomain[ilev].coarsen(AVGlobals::CRRBetweenLevels(ilev, maxAllowableLevel, amrData.RefRatio())); } dataSizeH.resize(numberOfLevels); dataSizeV.resize(numberOfLevels); dataSize.resize(numberOfLevels); for(ilev = 0; ilev <= maxAllowableLevel; ++ilev) { if(myView==XZ) { dataSizeH[ilev] = subDomain[ilev].length(XDIR); dataSizeV[ilev] = subDomain[ilev].length(ZDIR); } else if(myView==YZ) { dataSizeH[ilev] = subDomain[ilev].length(YDIR); dataSizeV[ilev] = subDomain[ilev].length(ZDIR); } else { dataSizeH[ilev] = subDomain[ilev].length(XDIR); dataSizeV[ilev] = subDomain[ilev].length(YDIR); } dataSize[ilev] = dataSizeH[ilev] * dataSizeV[ilev]; } # if (BL_SPACEDIM == 3) if(myView==XY) { hLine = (subDomain[maxAllowableLevel].bigEnd(YDIR) - subDomain[maxAllowableLevel].smallEnd(YDIR)) * pltAppStatePtr->CurrentScale(); vLine = 0; } else if(myView==XZ) { hLine = (subDomain[maxAllowableLevel].bigEnd(ZDIR) - subDomain[maxAllowableLevel].smallEnd(ZDIR)) * pltAppStatePtr->CurrentScale(); vLine = 0; } else { hLine = (subDomain[maxAllowableLevel].bigEnd(ZDIR) - subDomain[maxAllowableLevel].smallEnd(ZDIR)) * pltAppStatePtr->CurrentScale(); vLine = 0; } if(parentPltAppPtr != NULL) { int tempSlice = parentPltAppPtr->GetAmrPicturePtr(myView)->GetSlice(); tempSlice *= AVGlobals::CRRBetweenLevels(parentPltAppPtr->GetPltAppState()-> MaxDrawnLevel(), pltAppStatePtr->MaxDrawnLevel(), amrData.RefRatio()); slice = max(min(tempSlice, subDomain[maxAllowableLevel].bigEnd(YZ-myView)), subDomain[maxAllowableLevel].smallEnd(YZ-myView)); } else { slice = subDomain[maxAllowableLevel].smallEnd(YZ-myView); } # else vLine = 0; hLine = 0; slice = 0; # endif subcutY = hLine; subcut2ndY = hLine; sliceBox.resize(maxAllowableLevel + 1); sliceBox[maxAllowableLevel] = subDomain[maxAllowableLevel]; AmrPictureInit(); } // end AmrPicture constructor // --------------------------------------------------------------------- void AmrPicture::AmrPictureInit() { int iLevel; int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); if(myView==XZ) { sliceBox[maxAllowableLevel].setSmall(YDIR, slice); sliceBox[maxAllowableLevel].setBig(YDIR, slice); } else if(myView==YZ) { sliceBox[maxAllowableLevel].setSmall(XDIR, slice); sliceBox[maxAllowableLevel].setBig(XDIR, slice); } else { // XY # if (BL_SPACEDIM == 3) sliceBox[maxAllowableLevel].setSmall(ZDIR, slice); sliceBox[maxAllowableLevel].setBig(ZDIR, slice); # endif } CoarsenSliceBox(); sliceFab.resize(numberOfLevels); for(iLevel = minDrawnLevel; iLevel <= maxAllowableLevel; ++iLevel) { sliceFab[iLevel] = new FArrayBox(sliceBox[iLevel], 1); } vfSliceFab.resize(numberOfLevels); // always resize this if(dataServicesPtr->AmrDataRef().CartGrid()) { for(iLevel = minDrawnLevel; iLevel <= maxAllowableLevel; ++iLevel) { vfSliceFab[iLevel] = new FArrayBox(sliceBox[iLevel], 1); } } xImageArray.resize(numberOfLevels); display = gaPtr->PDisplay(); xgc = gaPtr->PGC(); // use maxAllowableLevel because all imageSizes are the same // regardless of which level is showing // dont use imageBox.length() because of node centered boxes imageSizeH = pltAppStatePtr->CurrentScale() * dataSizeH[maxAllowableLevel]; imageSizeV = pltAppStatePtr->CurrentScale() * dataSizeV[maxAllowableLevel]; int widthpad = gaPtr->PBitmapPaddedWidth(imageSizeH); imageSize = imageSizeV * widthpad * gaPtr->PBytesPerPixel(); imageData.resize(numberOfLevels); scaledImageData.resize(numberOfLevels); for(iLevel = 0; iLevel < minDrawnLevel; ++iLevel) { imageData[iLevel] = NULL; scaledImageData[iLevel] = NULL; } for(iLevel = minDrawnLevel; iLevel <= maxAllowableLevel; ++iLevel) { imageData[iLevel] = new unsigned char[dataSize[iLevel]]; scaledImageData[iLevel] = (unsigned char *) malloc(imageSize); } pendingTimeOut = 0; frameSpeed = 300; hdspoint = 0; vdspoint = 0; dsBoxSize = 0; datasetPointShowing = false; datasetPointColor = 0; subCutShowing = false; subcutX = 0; subcut2ndX = 0; framesMade = false; if(myView == XZ) { hColor = AVGlobals::MaxPaletteIndex(); vColor = 65; } else if(myView == YZ) { hColor = AVGlobals::MaxPaletteIndex(); vColor = 220; } else { hColor = 220; vColor = 65; } pixMapCreated = false; SetSlice(myView, slice); } // end AmrPictureInit() // --------------------------------------------------------------------- void AmrPicture::SetHVLine(int scale) { int maxDrawnLevel(pltAppStatePtr->MaxDrawnLevel()); int first(0); for(int i(0); i <= YZ; ++i) { if(i == myView) { // do nothing } else { if(first == 0) { hLine = imageSizeV-1 - ((pltAppPtr->GetAmrPicturePtr(i)->GetSlice() - pltAppPtr->GetAmrPicturePtr(YZ - i)-> GetSubDomain()[maxDrawnLevel].smallEnd(YZ - i)) * scale); first = 1; } else { vLine = ( pltAppPtr->GetAmrPicturePtr(i)->GetSlice() - pltAppPtr->GetAmrPicturePtr(YZ - i)-> GetSubDomain()[maxDrawnLevel].smallEnd(YZ - i)) * scale; } } } } // --------------------------------------------------------------------- AmrPicture::~AmrPicture() { int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); if(framesMade) { for(int isl(0); isl < subDomain[maxAllowableLevel].length(sliceDir); ++isl) { XDestroyImage(frameBuffer[isl]); } } for(int iLevel(minDrawnLevel); iLevel <= maxAllowableLevel; ++iLevel) { delete [] imageData[iLevel]; free(scaledImageData[iLevel]); delete sliceFab[iLevel]; if(dataServicesPtr->AmrDataRef().CartGrid()) { delete vfSliceFab[iLevel]; } } if(pixMapCreated) { XFreePixmap(display, pixMap); } } // --------------------------------------------------------------------- void AmrPicture::SetSlice(int view, int here) { int lev; int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); sliceDir = YZ - view; const AmrData &amrData = dataServicesPtr->AmrDataRef(); BL_ASSERT(amrData.RefRatio().size() > 0); # if (BL_SPACEDIM == 3) slice = here; sliceBox[maxAllowableLevel].setSmall(sliceDir, slice); sliceBox[maxAllowableLevel].setBig(sliceDir, slice); CoarsenSliceBox(); for(lev = minDrawnLevel; lev <= maxAllowableLevel; ++lev) { if(sliceFab[lev]->box() != sliceBox[lev]) { if(sliceFab[lev]->box().numPts() != sliceBox[lev].numPts()) { delete [] imageData[lev]; cerr << endl; cerr << "Suspicious sliceBox in AmrPicture::SetSlice" << endl; cerr << "sliceFab[" << lev << "].box() = " << sliceFab[lev]->box() << endl; cerr << "sliceBox[" << lev << "] = " << sliceBox[lev] << endl; cerr << endl; imageData[lev] = new unsigned char[sliceBox[lev].numPts()]; } sliceFab[lev]->resize(sliceBox[lev], 1); if(dataServicesPtr->AmrDataRef().CartGrid()) { vfSliceFab[lev]->resize(sliceBox[lev], 1); } } } # endif for(lev = minDrawnLevel; lev < gpArray.size(); ++lev) { gpArray[lev].clear(); } gpArray.clear(); gpArray.resize(numberOfLevels); maxLevelWithGrids = maxAllowableLevel; Array nGrids(numberOfLevels); for(lev = minDrawnLevel; lev <= maxAllowableLevel; ++lev) { nGrids[lev] = amrData.NIntersectingGrids(lev, sliceBox[lev]); gpArray[lev].resize(nGrids[lev]); if(nGrids[lev] == 0 && maxLevelWithGrids == maxAllowableLevel) { maxLevelWithGrids = lev - 1; } } if(nGrids[minDrawnLevel] == 0) { cerr << "Error in AmrPicture::SetSlice: No Grids intersected." << endl; cerr << "slice = " << slice << endl; cerr << "sliceBox[maxallowlev] = " << sliceBox[maxAllowableLevel] << endl; cerr << "maxAllowableLevel maxLevelWithGrids = " << maxAllowableLevel << " " << maxLevelWithGrids << endl; cerr << "subDomain[maxallowlev] = " << subDomain[maxAllowableLevel] << endl; return; } int gridNumber; for(lev = minDrawnLevel; lev <= maxLevelWithGrids; ++lev) { gridNumber = 0; for(int iBox(0); iBox < amrData.boxArray(lev).size(); ++iBox) { Box temp(amrData.boxArray(lev)[iBox]); if(sliceBox[lev].intersects(temp)) { temp &= sliceBox[lev]; Box sliceDataBox(temp); temp.shift(XDIR, -subDomain[lev].smallEnd(XDIR)); temp.shift(YDIR, -subDomain[lev].smallEnd(YDIR)); #if (BL_SPACEDIM == 3) temp.shift(ZDIR, -subDomain[lev].smallEnd(ZDIR)); #endif gpArray[lev][gridNumber].GridPictureInit(lev, AVGlobals::CRRBetweenLevels(lev, maxAllowableLevel, amrData.RefRatio()), pltAppStatePtr->CurrentScale(), imageSizeH, imageSizeV, temp, sliceDataBox, sliceDir); ++gridNumber; } } } } // end SetSlice(...) // --------------------------------------------------------------------- void AmrPicture::APChangeContour(ContourType prevCType) { ContourType cType(pltAppStatePtr->GetContourType()); Real minUsing, maxUsing; pltAppStatePtr->GetMinMax(minUsing, maxUsing); int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); FArrayBox *vffp; Real vfeps(0.0); if(DrawRaster(cType) != DrawRaster(prevCType)) { // recreate the raster image AmrData &amrData = dataServicesPtr->AmrDataRef(); for(int iLevel(minDrawnLevel); iLevel <= maxAllowableLevel; ++iLevel) { if(dataServicesPtr->AmrDataRef().CartGrid()) { vfeps = dataServicesPtr->AmrDataRef().VfEps(iLevel); vffp = vfSliceFab[iLevel]; } else { vfeps = 0.0; vffp = NULL; } CreateImage(*(sliceFab[iLevel]), imageData[iLevel], dataSizeH[iLevel], dataSizeV[iLevel], minUsing, maxUsing, palPtr, vffp, vfeps); CreateScaledImage(&(xImageArray[iLevel]), pltAppStatePtr->CurrentScale() * AVGlobals::CRRBetweenLevels(iLevel, maxAllowableLevel, amrData.RefRatio()), imageData[iLevel], scaledImageData[iLevel], dataSizeH[iLevel], dataSizeV[iLevel], imageSizeH, imageSizeV); } if( ! pltAppPtr->PaletteDrawn()) { pltAppPtr->PaletteDrawn(true); palPtr->Draw(minUsing, maxUsing, pltAppStatePtr->GetFormatString()); } } int maxDrawnLevel(pltAppStatePtr->MaxDrawnLevel()); APDraw(minDrawnLevel, maxDrawnLevel); } // --------------------------------------------------------------------- void AmrPicture::DrawBoxes(Array< Array > &gp, Drawable &drawable) { short xbox, ybox; unsigned short wbox, hbox; bool bIsWindow(true); bool bIsPixmap(false); const AmrData &amrData = dataServicesPtr->AmrDataRef(); int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxDrawnLevel(pltAppStatePtr->MaxDrawnLevel()); if(pltAppStatePtr->GetShowingBoxes()) { for(int level(minDrawnLevel); level <= maxDrawnLevel; ++level) { if(level == minDrawnLevel) { XSetForeground(display, xgc, palPtr->WhiteIndex()); } else { XSetForeground(display, xgc, palPtr->pixelate(palPtr->SafePaletteIndex(level))); } if(amrData.Terrain()) { DrawTerrBoxes(level, bIsWindow, bIsPixmap); } else { for(int i(0); i < gp[level].size(); ++i) { xbox = gp[level][i].HPositionInPicture(); ybox = gp[level][i].VPositionInPicture(); wbox = gp[level][i].ImageSizeH(); hbox = gp[level][i].ImageSizeV(); XDrawRectangle(display, drawable, xgc, xbox, ybox, wbox, hbox); } } } } // draw bounding box //XSetForeground(display, xgc, palPtr->WhiteIndex()); //XDrawRectangle(display, drawable, xgc, 0, 0, imageSizeH-1, imageSizeV-1); } // --------------------------------------------------------------------- void AmrPicture::DrawTerrBoxes(int level, bool bIsWindow, bool bIsPixmap) { cerr << endl; cerr << "***** Error: should not be in AmrPicture::DrawTerrBoxes." << endl; cerr << "Continuing..." << endl; cerr << endl; /* int i, lev, ix; short xbox, ybox; unsigned short wbox, hbox; BL_ASSERT((bIsWindow ^ bIsPixmap) == true); const AmrData &amrData = dataServicesPtr->AmrDataRef(); int expansion(pltAppPtr->GetExpansion()); int hScale(pltAppStatePtr->CurrentScale() * expansion); if(finestLevel+1 != numberOfLevels) { for(lev = numberOfLevels-1; lev < finestLevel; lev++) { //IntVect ref_ratio = amrData.RefRatio(lev); hScale = hScale / amrData.RefRatio()[lev]; } } int vScale(hScale * pltAppPtr->GetZStretch()); const Array &dx = amrData.DxLevel()[finestLevel]; const Array &dx0 = amrData.DxLevel()[0]; // Note : this is based on DrawRTBoxes but hasnt been tested Real index_zhi = vScale * dx0[0] / (expansion * dx[0]) * (subDomain[0].bigEnd()[BL_SPACEDIM-1] + 1); for(i = 0; i < gpArray[level].length(); ++i) { xbox = gpArray[level][i].HPositionInPicture(); ybox = gpArray[level][i].VPositionInPicture(); wbox = gpArray[level][i].ImageSizeH(); hbox = gpArray[level][i].ImageSizeV(); if(level == 0) { if(bIsWindow) { XDrawRectangle(display, pictureWindow, xgc, xbox, ybox, wbox, hbox); } else if(bIsPixmap) { XDrawRectangle(display, pixMap, xgc, xbox, ybox, wbox, hbox); } } else { GridPlot *gridptr = gpArray[level][i].GetGridPtr(); DataBoxPlot *meshdb = gridptr->Mesh(); const Real *meshdat = meshdb->dataPtr(); const int *mlo = meshdb->loVect(); const int *mhi = meshdb->hiVect(); const int *mlen = meshdb->length(); #if (BL_SPACEDIM == 2) #define M_L(i,j) i-mlo[0]+mlen[0]*(j-mlo[1]) #elif (BL_SPACEDIM == 3) #define M_L(i,j,k) i-mlo[0]+mlen[0]*( (j-mlo[1]) + mlen[1]*(k-mlo[2]) ) #endif #if (BL_SPACEDIM == 2) Real xlo, xhi, ylo, yhi; // Draw left boundary ylo = index_zhi - vScale * meshdat[M_L(mlo[0], mlo[1])] / dx[0]; yhi = index_zhi - vScale * meshdat[M_L(mlo[0], mhi[1])] / dx[0]; xlo = hScale * mlo[0]; xhi = hScale * mlo[0]; if(bIsWindow) { XDrawLine(display, pictureWindow, xgc, xlo, ylo, xhi, yhi); } else if(bIsPixmap) { XDrawLine(display, pixMap, xgc, xlo, ylo, xhi, yhi); } // Draw right boundary ylo = index_zhi - vScale * meshdat[M_L(mhi[0], mlo[1])] / dx[0]; yhi = index_zhi - vScale * meshdat[M_L(mhi[0], mhi[1])] / dx[0]; xlo = hScale * mhi[0]; xhi = hScale * mhi[0]; if(bIsWindow) { XDrawLine(display, pictureWindow, xgc, xlo, ylo, xhi, yhi); } else if(bIsPixmap) { XDrawLine(display, pixMap, xgc, xlo, ylo, xhi, yhi); } // Draw bottom boundary for(ix = mlo[0]; ix < mhi[0]; ++ix) { ylo = index_zhi-vScale*meshdat[M_L(ix,mlo[1])] / dx[0]; yhi = index_zhi-vScale*meshdat[M_L(ix+1,mlo[1])] / dx[0]; xlo = hScale * ix; xhi = hScale * (ix + 1); if(bIsWindow) { XDrawLine(display, pictureWindow, xgc, xlo, ylo, xhi, yhi); } else if(bIsPixmap) { XDrawLine(display, pixMap, xgc, xlo, ylo, xhi, yhi); } } // Draw top boundary for(ix = mlo[0]; ix < mhi[0]; ++ix) { ylo = index_zhi - vScale * meshdat[M_L(ix, mhi[1])] / dx[0]; yhi = index_zhi - vScale * meshdat[M_L(ix + 1, mhi[1])] / dx[0]; xlo = hScale * ix; xhi = hScale * (ix + 1); if(bIsWindow) { XDrawLine(display, pictureWindow, xgc, xlo, ylo, xhi, yhi); } else if(bIsPixmap) { XDrawLine(display, pixMap, xgc, xlo, ylo, xhi, yhi); } } #endif } } */ } // --------------------------------------------------------------------- void AmrPicture::APDraw(int fromLevel, int toLevel) { if( ! pixMapCreated) { pixMap = XCreatePixmap(display, pictureWindow, imageSizeH, imageSizeV, gaPtr->PDepth()); pixMapCreated = true; } XPutImage(display, pixMap, xgc, xImageArray[toLevel], 0, 0, 0, 0, imageSizeH, imageSizeV); ContourType cType(pltAppStatePtr->GetContourType()); if(DrawContours(cType)) { DrawContour(sliceFab, display, pixMap, xgc); } else if(cType == VECTORS) { DrawVectorField(display, pixMap, xgc); } // //char *fontName = "12x24"; //XFontStruct *fontInfo; //fontInfo = XLoadQueryFont(display, fontName); //GC fontGC = XCreateGC(display, gaPtr->PRoot(), 0, NULL); //XSetFont(display, fontGC, fontInfo->fid); //XSetForeground(display, fontGC, palPtr->WhiteIndex()); //XDrawString(display, pixMap, //fontGC, //imageSizeH / 2, //imageSizeV / 2, //currentDerived.c_str(), currentDerived.length()); // if( ! pltAppPtr->Animating()) { // this should always be true DoExposePicture(); } } // end AmrPicture::Draw. // --------------------------------------------------------------------- void AmrPicture::ToggleShowSubCut() { subCutShowing = (subCutShowing ? false : true); DoExposePicture(); } // --------------------------------------------------------------------- void AmrPicture::SetRegion(int startX, int startY, int endX, int endY) { regionX = startX; regionY = startY; region2ndX = endX; region2ndY = endY; } // --------------------------------------------------------------------- void AmrPicture::SetSubCut(int startX, int startY, int endX, int endY) { if(startX != -1) { subcutX = startX; } if(startY != -1) { subcutY = startY; } if(endX != -1) { subcut2ndX = endX; } if(endY != -1) { subcut2ndY = endY; } } // --------------------------------------------------------------------- void AmrPicture::DoExposePicture() { if(pltAppPtr->Animating()) { XPutImage(display, pictureWindow, xgc, pltAppPtr->CurrentFrameXImage(), 0, 0, 0, 0, imageSizeH, imageSizeV); } else { if(pendingTimeOut == 0) { XCopyArea(display, pixMap, pictureWindow, xgc, 0, 0, imageSizeH, imageSizeV, 0, 0); DrawBoxes(gpArray, pictureWindow); if( ! subCutShowing) { // draw selected region XSetForeground(display, xgc, palPtr->pixelate(60)); XDrawLine(display, pictureWindow, xgc, regionX+1, regionY+1, region2ndX+1, regionY+1); XDrawLine(display, pictureWindow, xgc, regionX+1, regionY+1, regionX+1, region2ndY+1); XDrawLine(display, pictureWindow, xgc, regionX+1, region2ndY+1, region2ndX+1, region2ndY+1); XDrawLine(display, pictureWindow, xgc, region2ndX+1, regionY+1, region2ndX+1, region2ndY+1); XSetForeground(display, xgc, palPtr->pixelate(175)); XDrawLine(display, pictureWindow, xgc, regionX, regionY, region2ndX, regionY); XDrawLine(display, pictureWindow, xgc, regionX, regionY, regionX, region2ndY); XDrawLine(display, pictureWindow, xgc, regionX, region2ndY, region2ndX, region2ndY); XDrawLine(display, pictureWindow, xgc, region2ndX, regionY, region2ndX, region2ndY); } #if (BL_SPACEDIM == 3) // draw plane "cutting" lines XSetForeground(display, xgc, palPtr->pixelate(hColor)); XDrawLine(display, pictureWindow, xgc, 0, hLine, imageSizeH - 1, hLine); XSetForeground(display, xgc, palPtr->pixelate(vColor)); XDrawLine(display, pictureWindow, xgc, vLine, 0, vLine, imageSizeV - 1); XSetForeground(display, xgc, palPtr->pixelate(hColor-30)); XDrawLine(display, pictureWindow, xgc, 0, hLine+1, imageSizeH - 1, hLine+1); XSetForeground(display, xgc, palPtr->pixelate(vColor-30)); XDrawLine(display, pictureWindow, xgc, vLine+1, 0, vLine+1, imageSizeV - 1); if(subCutShowing) { // draw subvolume cutting border XSetForeground(display, xgc, palPtr->pixelate(90)); XDrawLine(display, pictureWindow, xgc, subcutX+1, subcutY+1, subcut2ndX+1, subcutY+1); XDrawLine(display, pictureWindow, xgc, subcutX+1, subcutY+1, subcutX+1, subcut2ndY+1); XDrawLine(display, pictureWindow, xgc, subcutX+1, subcut2ndY+1, subcut2ndX+1, subcut2ndY+1); XDrawLine(display, pictureWindow, xgc, subcut2ndX+1, subcutY+1, subcut2ndX+1, subcut2ndY+1); XSetForeground(display, xgc, palPtr->pixelate(155)); XDrawLine(display, pictureWindow, xgc, subcutX, subcutY, subcut2ndX, subcutY); XDrawLine(display, pictureWindow, xgc, subcutX, subcutY, subcutX, subcut2ndY); XDrawLine(display, pictureWindow, xgc, subcutX, subcut2ndY, subcut2ndX, subcut2ndY); XDrawLine(display, pictureWindow, xgc, subcut2ndX, subcutY, subcut2ndX, subcut2ndY); } #endif } } } // end DoExposePicture // --------------------------------------------------------------------- void AmrPicture::APChangeSlice(int here) { if(pendingTimeOut != 0) { DoStop(); } SetSlice(myView, here); APMakeImages(palPtr); } // --------------------------------------------------------------------- void AmrPicture::CreatePicture(Window drawPictureHere, Palette *palptr) { palPtr = palptr; pictureWindow = drawPictureHere; APMakeImages(palptr); } // --------------------------------------------------------------------- void AmrPicture::APMakeImages(Palette *palptr) { BL_ASSERT(palptr != NULL); palPtr = palptr; AmrData &amrData = dataServicesPtr->AmrDataRef(); if(UsingFileRange(pltAppStatePtr->GetMinMaxRangeType())) { pltAppPtr->PaletteDrawn(false); } int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); if(framesMade) { for(int i(0); i < subDomain[maxAllowableLevel].length(sliceDir); ++i) { XDestroyImage(frameBuffer[i]); } framesMade = false; } if(pendingTimeOut != 0) { DoStop(); } FArrayBox *vffp; Real vfeps(0.0); Real minUsing, maxUsing; pltAppStatePtr->GetMinMax(minUsing, maxUsing); VSHOWVAL(AVGlobals::Verbose(), minUsing) VSHOWVAL(AVGlobals::Verbose(), maxUsing) VSHOWVAL(AVGlobals::Verbose(), minDrawnLevel) VSHOWVAL(AVGlobals::Verbose(), maxAllowableLevel) const string currentDerived(pltAppStatePtr->CurrentDerived()); const string vfracDerived("vfrac"); for(int iLevel(minDrawnLevel); iLevel <= maxAllowableLevel; ++iLevel) { DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) (sliceFab[iLevel]), (void *) (&(sliceFab[iLevel]->box())), iLevel, (void *) ¤tDerived); if(amrData.CartGrid()) { BL_ASSERT(vfSliceFab[iLevel]->box() == sliceFab[iLevel]->box()); DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) (vfSliceFab[iLevel]), (void *) (&(vfSliceFab[iLevel]->box())), iLevel, (void *) &vfracDerived); vfeps = dataServicesPtr->AmrDataRef().VfEps(iLevel); vffp = vfSliceFab[iLevel]; } else { vfeps = 0.0; vffp = NULL; } CreateImage(*(sliceFab[iLevel]), imageData[iLevel], dataSizeH[iLevel], dataSizeV[iLevel], minUsing, maxUsing, palPtr, vffp, vfeps); CreateScaledImage(&(xImageArray[iLevel]), pltAppStatePtr->CurrentScale() * AVGlobals::CRRBetweenLevels(iLevel, maxAllowableLevel, amrData.RefRatio()), imageData[iLevel], scaledImageData[iLevel], dataSizeH[iLevel], dataSizeV[iLevel], imageSizeH, imageSizeV); } if( ! pltAppPtr->PaletteDrawn()) { pltAppPtr->PaletteDrawn(true); palptr->Draw(minUsing, maxUsing, pltAppStatePtr->GetFormatString()); } int maxDrawnLevel(pltAppStatePtr->MaxDrawnLevel()); APDraw(minDrawnLevel, maxDrawnLevel); } // end AP Make Images // ------------------------------------------------------------------- // convert Real to char in imagedata from fab void AmrPicture::CreateImage(const FArrayBox &fab, unsigned char *imagedata, int datasizeh, int datasizev, Real globalMin, Real globalMax, Palette *palptr, const FArrayBox *vfracFab, const Real vfeps) { int jdsh, jtmp1; int dIndex, iIndex; Real oneOverGDiff; if((globalMax - globalMin) < FLT_MIN) { oneOverGDiff = 0.0; } else { oneOverGDiff = 1.0 / (globalMax - globalMin); } const Real *dataPoint = fab.dataPtr(); bool bCartGrid(dataServicesPtr->AmrDataRef().CartGrid()); const Real *vfDataPoint = 0; if(bCartGrid) { BL_ASSERT(vfracFab != NULL); vfDataPoint = vfracFab->dataPtr(); } // flips the image in Vert dir: j => datasizev-j-1 if(DrawRaster(pltAppStatePtr->GetContourType())) { Real dPoint; int paletteStart(palptr->PaletteStart()); int paletteEnd(palptr->PaletteEnd()); int colorSlots(palptr->ColorSlots()); int csm1(colorSlots - 1); if(bCartGrid == false) { for(int j(0); j < datasizev; ++j) { jdsh = j * datasizeh; jtmp1 = (datasizev-j-1) * datasizeh; for(int i(0); i < datasizeh; ++i) { dIndex = i + jtmp1; dPoint = dataPoint[dIndex]; iIndex = i + jdsh; if(dPoint > globalMax) { // clip imagedata[iIndex] = paletteEnd; } else if(dPoint < globalMin) { // clip imagedata[iIndex] = paletteStart; } else { imagedata[iIndex] = (unsigned char) ((((dPoint - globalMin) * oneOverGDiff) * csm1) ); // ^^^^^^^^^^^^^^^^^^ Real data imagedata[iIndex] += paletteStart; } } } } else { // mask the body Pixel bodyColor(palptr->BlackIndex()); Real dVFPoint; for(int j(0); j < datasizev; ++j) { jdsh = j * datasizeh; jtmp1 = (datasizev-j-1) * datasizeh; for(int i(0); i < datasizeh; ++i) { dIndex = i + jtmp1; dPoint = dataPoint[dIndex]; dVFPoint = vfDataPoint[dIndex]; iIndex = i + jdsh; if(dPoint > globalMax) { // clip imagedata[iIndex] = paletteEnd; } else if(dPoint < globalMin) { // clip imagedata[iIndex] = paletteStart; } else { imagedata[iIndex] = (unsigned char) ((((dPoint - globalMin) * oneOverGDiff) * csm1) ); // ^^^^^^^^^^^^^^^^^^ Real data imagedata[iIndex] += paletteStart; } if(dVFPoint < vfeps) { // set to body color imagedata[iIndex] = bodyColor; } } } } } else { if(AVGlobals::LowBlack()) { Pixel blackIndex(palptr->BlackIndex()); for(int i(0); i < (datasizeh * datasizev); ++i) { imagedata[i] = blackIndex; } } else { Pixel whiteIndex(palptr->WhiteIndex()); for(int i(0); i < (datasizeh * datasizev); ++i) { imagedata[i] = whiteIndex; } } } } // end CreateImage(...) // --------------------------------------------------------------------- void AmrPicture::CreateScaledImage(XImage **ximage, int scale, unsigned char *imagedata, unsigned char *scaledimagedata, int datasizeh, int datasizev, int imagesizeh, int imagesizev) { int widthpad = gaPtr->PBitmapPaddedWidth(imagesizeh); *ximage = XCreateImage(display, gaPtr->PVisual(), gaPtr->PDepth(), ZPixmap, 0, (char *) scaledimagedata, widthpad, imagesizev, XBitmapPad(display), widthpad * gaPtr->PBytesPerPixel()); if( ! bCartGridSmoothing) { if(true) { for(int j(0); j < imagesizev; ++j) { int jtmp(datasizeh * (j/scale)); for(int i(0); i < widthpad; ++i) { int itmp(i / scale); unsigned char imm1(imagedata[ itmp + jtmp ]); XPutPixel(*ximage, i, j, palPtr->makePixel(imm1)); } } } else { (*ximage)->byte_order = MSBFirst; (*ximage)->bitmap_bit_order = MSBFirst; for(int j(0); j < imagesizev; ++j) { int jish(j * imagesizeh); int jtmp(datasizeh * (j/scale)); for(int i(0); i < imagesizeh; ++i) { scaledimagedata[i+jish] = imagedata [ (i/scale) + jtmp ]; } } } } else { // bCartGridSmoothing /* int i, j, ii, jj, rrcs, iis; int blackIndex, whiteIndex, bodyColor; int iMDL(pltAppStatePtr->MaxDrawnLevel()); AmrData &amrData = dataServicesPtr->AmrDataRef(); blackIndex = palPtr->BlackIndex(); whiteIndex = palPtr->WhiteIndex(); bodyColor = blackIndex; Real vfeps = amrData.VfEps(iMDL); Real *vfracPoint = vfracData->dataPtr(); Real vfp, omvfe = 1.0 - vfeps; int vidx, svidx; Real stencil[9]; int nBodyCells, nScaledImageCells; nScaledImageCells = rrcs*rrcs; Real sumH[3], sumV[3]; Real diffAvgV[3], diffAvgH[3], avgV, avgH; //Real minDAV, maxDAV, minDAH, maxDAH; Real normV, normH; int isum, jsum, nStartV, nEndV, nStartH, nEndH, tempSum; int nV, nH, stencilSize = 3; int nCalcBodyCells, fluidCell = 1, bodyCell = 0, markedCell = -1; Real cellDx = 1.0/((Real) rrcs), cellDy = 1.0/((Real) rrcs); Real yBody, slope; int iCurrent, jCurrent, jBody; int isIndex; Array imageStencil(nScaledImageCells); int dataSizeHMDL(dataSizeH[iMDL]), dataSizeVMDL(dataSizeV[iMDL]); for(j = 0; j < dataSizeVMDL; ++j) { for(i = 0; i < dataSizeHMDL; ++i) { vidx = i + (dataSizeVMDL-1-j)*dataSizeHMDL; // get volfrac for cell(i,j) vfp = vfracPoint[vidx]; if(vfp > vfeps && vfp < omvfe) { // a mixed cell for(iis = 0; iis < 9; iis++) { stencil[iis] = -2.0*vfeps; // flag value for boundary stencils } // fill the stencil with volume fractions svidx = (i-1) + (dataSizeVMDL-1-(j-1))*dataSizeHMDL; // up left if((i-1) >= 0 && (dataSizeVMDL-1-(j-1)) < dataSizeVMDL) { stencil[0] = vfracPoint[svidx]; } svidx = (i ) + (dataSizeVMDL-1-(j-1))*dataSizeHMDL; // up if((dataSizeVMDL-1-(j-1)) < dataSizeVMDL) { stencil[1] = vfracPoint[svidx]; } svidx = (i+1) + (dataSizeVMDL-1-(j-1))*dataSizeHMDL; // up right if((i+1) < dataSizeHMDL && (dataSizeVMDL-1-(j-1)) < dataSizeVMDL) { stencil[2] = vfracPoint[svidx]; } svidx = (i-1) + (dataSizeVMDL-1-(j ))*dataSizeHMDL; // left if((i-1) >= 0) { stencil[3] = vfracPoint[svidx]; } stencil[4] = vfp; // the center svidx = (i+1) + (dataSizeVMDL-1-(j ))*dataSizeHMDL; // right if((i+1) < dataSizeHMDL) { stencil[5] = vfracPoint[svidx]; } svidx = (i-1) + (dataSizeVMDL-1-(j+1))*dataSizeHMDL; // down left if((i-1) >= 0 && ((int)(dataSizeVMDL-1-(j+1))) >= 0) { stencil[6] = vfracPoint[svidx]; } svidx = (i ) + (dataSizeVMDL-1-(j+1))*dataSizeHMDL; // down if(((int)(dataSizeVMDL-1-(j+1))) >= 0) { stencil[7] = vfracPoint[svidx]; } svidx = (i+1) + (dataSizeVMDL-1-(j+1))*dataSizeHMDL; // down right if((i+1) < dataSizeHMDL && ((int)(dataSizeVMDL-1-(j+1))) >= 0) { stencil[8] = vfracPoint[svidx]; } #if (BL_SPACEDIM==2) // fix for straight lines near corners Real smallval = 0.0001; if(abs(stencil[4] - stencil[3]) < smallval && abs(stencil[4] - stencil[5]) > smallval) { stencil[2] = -2.0*vfeps; // flag value stencil[5] = -2.0*vfeps; // flag value stencil[8] = -2.0*vfeps; // flag value } if(abs(stencil[4] - stencil[5]) < smallval && abs(stencil[4] - stencil[3]) > smallval) { stencil[0] = -2.0*vfeps; // flag value stencil[3] = -2.0*vfeps; // flag value stencil[6] = -2.0*vfeps; // flag value } if(abs(stencil[4] - stencil[1]) < smallval && abs(stencil[4] - stencil[7]) > smallval) { stencil[6] = -2.0*vfeps; // flag value stencil[7] = -2.0*vfeps; // flag value stencil[8] = -2.0*vfeps; // flag value } if(abs(stencil[4] - stencil[7]) < smallval && abs(stencil[4] - stencil[1]) > smallval) { stencil[0] = -2.0*vfeps; // flag value stencil[1] = -2.0*vfeps; // flag value stencil[2] = -2.0*vfeps; // flag value } #endif nBodyCells = (int) ((1.0-vfp)*nScaledImageCells); // there should be this many body cells calculated nStartV = 0; nEndV = 2; nStartH = 0; nEndH = 2; if(stencil[0] < 0.0 && stencil[1] < 0.0 && stencil[2] < 0.0) { nStartH++; } if(stencil[0] < 0.0 && stencil[3] < 0.0 && stencil[6] < 0.0) { nStartV++; } if(stencil[2] < 0.0 && stencil[5] < 0.0 && stencil[8] < 0.0) { nEndV--; } if(stencil[6] < 0.0 && stencil[7] < 0.0 && stencil[8] < 0.0) { nEndH--; } nV = nEndV - nStartV + 1; nH = nEndH - nStartH + 1; for(jsum=nStartH; jsum<=nEndH; jsum++) { sumH[jsum] = 0; for(isum=nStartV; isum<=nEndV; isum++) { sumH[jsum] += stencil[isum + stencilSize*jsum]; } } for(isum=nStartV; isum<=nEndV; isum++) { sumV[isum] = 0; for(jsum=nStartH; jsum<=nEndH; jsum++) { sumV[isum] += stencil[isum + stencilSize*jsum]; } } tempSum = 0; for(isum=nStartV; isum<=nEndV; isum++) { tempSum += sumV[isum]; } avgV = tempSum / ((Real) nV); tempSum = 0; for(isum=nStartH; isum<=nEndH; isum++) { tempSum += sumH[isum]; } avgH = tempSum / ((Real) nH); for(isum=nStartV; isum<=nEndV; isum++) { diffAvgV[isum] = sumV[isum] - avgV; } for(isum=nStartH; isum<=nEndH; isum++) { diffAvgH[isum] = sumH[isum] - avgH; } //for(isum=nStartV; isum< nEndV; isum++) { //minDAV = min(diffAvgV[isum], diffAvgV[isum+1]); //maxDAV = max(diffAvgV[isum], diffAvgV[isum+1]); //} //for(isum=nStartH; isum<=nEndH; isum++) { //minDAH = min(diffAvgH[isum], diffAvgH[isum+1]); //maxDAH = max(diffAvgH[isum], diffAvgH[isum+1]); //} normH = ((diffAvgV[nEndV] - diffAvgV[nStartV]) * ((Real) nH)); // nH is correct here normV = -((diffAvgH[nEndH] - diffAvgH[nStartH]) * ((Real) nV)); // nV is correct here for(ii = 0; ii < rrcs * rrcs; ++ii) { imageStencil[ii] = fluidCell; } if(abs(normV) > 0.000001) { slope = normH/normV; // perpendicular to normal } else { slope = normH; // avoid divide by zero } if(normV > 0.0 && normH > 0.0) { // upper right quadrant iCurrent = 0; jCurrent = 0; nCalcBodyCells = 0; while(nCalcBodyCells < nBodyCells) { ++iCurrent; if(iCurrent > rrcs) { iCurrent = 1; ++jCurrent; } if(jCurrent > rrcs) { break; } for(ii = 0; ii < iCurrent; ++ii) { yBody = (slope * ((iCurrent-ii)*cellDx)) + (jCurrent*cellDy); jBody = min(rrcs-1, (int) (yBody/cellDy)); for(jj = 0; jj <= jBody; ++jj) { isIndex = ii + ((rrcs - (jj + 1)) * rrcs); imageStencil[isIndex] = bodyCell; // yflip } } // sum the body cells // do it this way to allow redundant setting of body cells nCalcBodyCells = 0; for(ii = 0; ii < rrcs * rrcs; ++ii) { if(imageStencil[ii] == bodyCell) { nCalcBodyCells++; } } } // end while(...) } else if(normV < 0.0 && normH < 0.0) { // lower left quadrant iCurrent = rrcs; jCurrent = rrcs; nCalcBodyCells = 0; while(nCalcBodyCells < nBodyCells) { --iCurrent; if(iCurrent < 0) { iCurrent = rrcs-1; --jCurrent; } if(jCurrent < 1) { break; } for(ii = rrcs; ii > iCurrent; --ii) { yBody = (slope * ((ii - iCurrent) * cellDx)) + ((rrcs - jCurrent) * cellDy); jBody = max(0, (int) (rrcs - (yBody / cellDy))); for(jj = jBody; jj < rrcs; ++jj) { isIndex = (ii - 1) + ((rrcs - (jj + 1)) * rrcs); imageStencil[isIndex] = bodyCell; // yflip } } // sum the body cells nCalcBodyCells = 0; for(ii = 0; ii < rrcs * rrcs; ++ii) { if(imageStencil[ii] == bodyCell) { ++nCalcBodyCells; } } } // end while(...) } else if(normV > 0.0 && normH < 0.0) { // upper left quadrant iCurrent = rrcs; jCurrent = 0; nCalcBodyCells = 0; while(nCalcBodyCells < nBodyCells) { --iCurrent; if(iCurrent < 0) { iCurrent = rrcs-1; ++jCurrent; } if(jCurrent > rrcs) { break; } for(ii=rrcs; ii>iCurrent; ii--) { yBody = (-slope * ((ii-iCurrent)*cellDx)) + (jCurrent*cellDy); jBody = min(rrcs-1, (int) (yBody/cellDy)); for(jj=0; jj<=jBody; jj++) { isIndex = (ii-1) + ((rrcs-(jj+1))*rrcs); imageStencil[isIndex] = bodyCell; // yflip } } // sum the body cells nCalcBodyCells = 0; for(ii = 0; ii < rrcs * rrcs; ++ii) { if(imageStencil[ii] == bodyCell) { nCalcBodyCells++; } } } // end while(...) } else if(normV < 0.0 && normH > 0.0) { // lower right quadrant iCurrent = 0; jCurrent = rrcs; nCalcBodyCells = 0; while(nCalcBodyCells < nBodyCells) { ++iCurrent; if(iCurrent > rrcs) { iCurrent = 1; --jCurrent; } if(jCurrent < 1) { break; } for(ii = 0; ii < iCurrent; ++ii) { yBody = (-slope * ((iCurrent - ii) * cellDx)) + ((rrcs - jCurrent) * cellDy); jBody = max(0, (int) (rrcs - (yBody / cellDy))); for(jj = jBody; jj < rrcs; ++jj) { isIndex = ii + ((rrcs - (jj + 1)) * rrcs); // yflip imageStencil[isIndex] = bodyCell; } } // sum the body cells nCalcBodyCells = 0; for(ii = 0; ii < rrcs * rrcs; ++ii) { if(imageStencil[ii] == bodyCell) { ++nCalcBodyCells; } } } // end while(...) } else if(abs(normV) < 0.000001) { // vertical face if(normH > 0.0) { // body is on the left edge of the cell for(jj = 0; jj < rrcs; ++jj) { for(ii = 0; ii < (nBodyCells / rrcs); ++ii) { isIndex = ii + ((rrcs-(jj+1))*rrcs); imageStencil[isIndex] = bodyCell; } } } else { // body is on the right edge of the cell for(jj = 0; jj < rrcs; ++jj) { for(ii = rrcs - (nBodyCells / rrcs); ii < rrcs; ++ii) { isIndex = ii + ((rrcs-(jj+1))*rrcs); imageStencil[isIndex] = bodyCell; } } } } else if(abs(normH) < 0.000001) { // horizontal face if(normV > 0.0) { // body is on the bottom edge of the cell for(jj = 0; jj < (nBodyCells / rrcs); ++jj) { for(ii = 0; ii < rrcs; ++ii) { isIndex = ii + ((rrcs - (jj + 1)) * rrcs); imageStencil[isIndex] = bodyCell; } } } else { // body is on the top edge of the cell for(jj = rrcs - (nBodyCells / rrcs); jj < rrcs; ++jj) { for(ii = 0; ii < rrcs; ++ii) { isIndex = ii + ((rrcs - (jj + 1)) * rrcs); imageStencil[isIndex] = bodyCell; } } } } else { for(ii = 0; ii < rrcs * rrcs; ++ii) { imageStencil[ii] = markedCell; } } // end long if block // set cells to correct color for(jj = 0; jj < rrcs; ++jj) { for(ii = 0; ii < rrcs; ++ii) { if(imageStencil[ii + (jj * rrcs)] == fluidCell) { // in fluid scaledImageData[((i * rrcs) + ii)+(((j * rrcs)+jj)*imageSizeH)] = imageData[i + j*dataSizeHMDL]; } else if(imageStencil[ii + (jj*rrcs)] == markedCell) { scaledimagedata[((i*rrcs)+ii)+(((j*rrcs)+jj)*imageSizeH)] = (unsigned char) whiteIndex; } else { // in body scaledimagedata[((i*rrcs)+ii)+(((j*rrcs)+jj)*imageSizeH)] = (unsigned char) bodyColor; } } // end for(ii...) } // end for(jj...) } else { // non mixed cell for(jj = 0; jj < rrcs; ++jj) { for(ii = 0; ii < rrcs; ++ii) { scaledImageData[((i*rrcs)+ii) + (((j*rrcs)+jj) * imageSizeH)] = imageData[i + j*dataSizeHMDL]; } } } } // end for(i...) } // end for(j...) */ } // end if(bCartGridSmoothing) } // end CreateScaledImage() // --------------------------------------------------------------------- void AmrPicture::APChangeScale(int newScale, int previousScale) { int iLevel; int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxDrawnLevel(pltAppStatePtr->MaxDrawnLevel()); int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); if(framesMade) { for(int i(0); i < subDomain[maxAllowableLevel].length(sliceDir); ++i) { XDestroyImage(frameBuffer[i]); } framesMade = false; } if(pendingTimeOut != 0) { DoStop(); } imageSizeH = newScale * dataSizeH[maxAllowableLevel]; imageSizeV = newScale * dataSizeV[maxAllowableLevel]; int widthpad = gaPtr->PBitmapPaddedWidth(imageSizeH); imageSize = widthpad * imageSizeV * gaPtr->PBytesPerPixel(); XClearWindow(display, pictureWindow); if(pixMapCreated) { XFreePixmap(display, pixMap); } pixMap = XCreatePixmap(display, pictureWindow, imageSizeH, imageSizeV, gaPtr->PDepth()); pixMapCreated = true; for(iLevel = minDrawnLevel; iLevel <= maxAllowableLevel; ++iLevel) { for(int grid(0); grid < gpArray[iLevel].size(); ++grid) { gpArray[iLevel][grid].ChangeScale(newScale, imageSizeH, imageSizeV); } } AmrData &amrData = dataServicesPtr->AmrDataRef(); for(iLevel = minDrawnLevel; iLevel <= maxAllowableLevel; ++iLevel) { free(scaledImageData[iLevel]); scaledImageData[iLevel] = (unsigned char *) malloc(imageSize); CreateScaledImage(&xImageArray[iLevel], newScale * AVGlobals::CRRBetweenLevels(iLevel, maxAllowableLevel, amrData.RefRatio()), imageData[iLevel], scaledImageData[iLevel], dataSizeH[iLevel], dataSizeV[iLevel], imageSizeH, imageSizeV); } hLine = ((hLine / previousScale) * newScale) + (newScale - 1); vLine = ((vLine / previousScale) * newScale) + (newScale - 1); APDraw(minDrawnLevel, maxDrawnLevel); } // --------------------------------------------------------------------- void AmrPicture::APChangeLevel() { int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); if(framesMade) { for(int i(0); i < subDomain[maxAllowableLevel].length(sliceDir); ++i) { XDestroyImage(frameBuffer[i]); } framesMade = false; } if(pendingTimeOut != 0) { DoStop(); } XClearWindow(display, pictureWindow); int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxDrawnLevel(pltAppStatePtr->MaxDrawnLevel()); APDraw(minDrawnLevel, maxDrawnLevel); } // --------------------------------------------------------------------- XImage *AmrPicture::GetPictureXImage(const bool bdrawboxesintoimage) { int xbox, ybox, wbox, hbox; XImage *ximage; int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxDrawnLevel(pltAppStatePtr->MaxDrawnLevel()); if(pltAppStatePtr->GetShowingBoxes() && bdrawboxesintoimage) { for(int level(minDrawnLevel); level <= maxDrawnLevel; ++level) { if(level == minDrawnLevel) { XSetForeground(display, xgc, palPtr->WhiteIndex()); } else { XSetForeground(display, xgc, palPtr->pixelate(palPtr->SafePaletteIndex(level))); } for(int i(0); i < gpArray[level].size(); ++i) { xbox = gpArray[level][i].HPositionInPicture(); ybox = gpArray[level][i].VPositionInPicture(); wbox = gpArray[level][i].ImageSizeH(); hbox = gpArray[level][i].ImageSizeV(); XDrawRectangle(display, pixMap, xgc, xbox, ybox, wbox, hbox); } } } /* XSetForeground(display, xgc, palPtr->pixelate(AVGlobals::MaxPaletteIndex())); XDrawRectangle(display, pixMap, xgc, 0, 0, imageSizeH-1, imageSizeV-1); */ ximage = XGetImage(display, pixMap, 0, 0, imageSizeH, imageSizeV, AllPlanes, ZPixmap); if(pixMapCreated) { XFreePixmap(display, pixMap); } pixMap = XCreatePixmap(display, pictureWindow, imageSizeH, imageSizeV, gaPtr->PDepth()); pixMapCreated = true; APDraw(minDrawnLevel, maxDrawnLevel); return ximage; } // --------------------------------------------------------------------- void AmrPicture::GetGridBoxes(Array< Array > &gb, const int minlev, const int maxlev) { gb.resize(maxlev + 1); // resize from zero for(int level(minlev); level <= maxlev; ++level) { gb[level].resize(gpArray[level].size()); for(int i(0); i < gpArray[level].size(); ++i) { gb[level][i].xbox = gpArray[level][i].HPositionInPicture(); gb[level][i].ybox = gpArray[level][i].VPositionInPicture(); gb[level][i].wbox = gpArray[level][i].ImageSizeH(); gb[level][i].hbox = gpArray[level][i].ImageSizeV(); } } } // --------------------------------------------------------------------- void AmrPicture::CoarsenSliceBox() { int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); for(int i(maxAllowableLevel - 1); i >= minDrawnLevel; --i) { sliceBox[i] = sliceBox[maxAllowableLevel]; sliceBox[i].coarsen(AVGlobals::CRRBetweenLevels(i, maxAllowableLevel, dataServicesPtr->AmrDataRef().RefRatio())); } } // --------------------------------------------------------------------- void AmrPicture::CreateFrames(AnimDirection direction) { char buffer[BUFSIZ]; bool cancelled(false); int islice, i, j, lev, gridNumber; Array intersectGrids; int maxLevelWithGridsHere; int posneg(1); if(direction == ANIMNEGDIR) { posneg = -1; } const AmrData &amrData = dataServicesPtr->AmrDataRef(); int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); sprintf(buffer, "Creating frames..."); PrintMessage(buffer); Array interBox(numberOfLevels); interBox[maxAllowableLevel] = subDomain[maxAllowableLevel]; int start = subDomain[maxAllowableLevel].smallEnd(sliceDir); int length = subDomain[maxAllowableLevel].length(sliceDir); if(framesMade) { for(int ii(0); ii < subDomain[maxAllowableLevel].length(sliceDir); ++ii) { XDestroyImage(frameBuffer[ii]); } } frameGrids.resize(length); frameBuffer.resize(length); int maxDrawnLevel(pltAppStatePtr->MaxDrawnLevel()); unsigned char *frameImageData = new unsigned char[dataSize[maxDrawnLevel]]; int iEnd(0); islice = -100000; // bogus init value for(i = 0; i < length; ++i) { islice = (((slice - start + (posneg * i)) + length) % length); // ^^^^^^^^ + length for negative values intersectGrids.resize(maxAllowableLevel + 1); interBox[maxAllowableLevel].setSmall(sliceDir, start+islice); interBox[maxAllowableLevel].setBig(sliceDir, start+islice); for(j = maxAllowableLevel - 1; j >= minDrawnLevel; --j) { interBox[j] = interBox[maxAllowableLevel]; interBox[j].coarsen(AVGlobals::CRRBetweenLevels(j, maxAllowableLevel, amrData.RefRatio())); } for(lev = minDrawnLevel; lev <= maxAllowableLevel; ++lev) { intersectGrids[lev] = amrData.NIntersectingGrids(lev, interBox[lev]); } maxLevelWithGridsHere = maxDrawnLevel; frameGrids[islice].resize(maxLevelWithGridsHere + 1); for(lev = minDrawnLevel; lev <= maxLevelWithGridsHere; ++lev) { frameGrids[islice][lev].resize(intersectGrids[lev]); } for(lev = minDrawnLevel; lev <= maxLevelWithGridsHere; ++lev) { gridNumber = 0; for(int iBox(0); iBox < amrData.boxArray(lev).size(); ++iBox) { Box temp(amrData.boxArray(lev)[iBox]); if(interBox[lev].intersects(temp)) { temp &= interBox[lev]; Box sliceDataBox(temp); temp.shift(XDIR, -subDomain[lev].smallEnd(XDIR)); temp.shift(YDIR, -subDomain[lev].smallEnd(YDIR)); temp.shift(ZDIR, -subDomain[lev].smallEnd(ZDIR)); frameGrids[islice][lev][gridNumber].GridPictureInit(lev, AVGlobals::CRRBetweenLevels(lev, maxAllowableLevel, amrData.RefRatio()), pltAppStatePtr->CurrentScale(), imageSizeH, imageSizeV, temp, sliceDataBox, sliceDir); ++gridNumber; } } } // end for(lev...) // get the data for this slice const string currentDerived(pltAppStatePtr->CurrentDerived()); FArrayBox imageFab(interBox[maxDrawnLevel], 1); DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) &imageFab, (void *) (&(imageFab.box())), maxDrawnLevel, (void *) ¤tDerived); Real minUsing, maxUsing; pltAppStatePtr->GetMinMax(minUsing, maxUsing); FArrayBox *vffp = NULL; Real vfeps(0.0); const string vfracDerived("vfrac"); if(amrData.CartGrid()) { vffp = new FArrayBox(interBox[maxDrawnLevel], 1); DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) (vffp), (void *) (&(vffp->box())), maxDrawnLevel, (void *) &vfracDerived); vfeps = dataServicesPtr->AmrDataRef().VfEps(maxDrawnLevel); } else { vfeps = 0.0; vffp = NULL; } CreateImage(imageFab, frameImageData, dataSizeH[maxDrawnLevel], dataSizeV[maxDrawnLevel], minUsing, maxUsing, palPtr, vffp, vfeps); // this cannot be deleted because it belongs to the XImage unsigned char *frameScaledImageData; frameScaledImageData = (unsigned char *)malloc(imageSize); CreateScaledImage(&(frameBuffer[islice]), pltAppStatePtr->CurrentScale() * AVGlobals::CRRBetweenLevels(maxDrawnLevel, maxAllowableLevel, amrData.RefRatio()), frameImageData, frameScaledImageData, dataSizeH[maxDrawnLevel], dataSizeV[maxDrawnLevel], imageSizeH, imageSizeV); ShowFrameImage(islice); #if (BL_SPACEDIM == 3) if( ! framesMade) { pltAppPtr->GetProjPicturePtr()->ChangeSlice(YZ-sliceDir, islice+start); pltAppPtr->GetProjPicturePtr()->MakeSlices(); XClearWindow(XtDisplay(pltAppPtr->GetWTransDA()), XtWindow(pltAppPtr->GetWTransDA())); pltAppPtr->DoExposeTransDA(); } XEvent event; if(XCheckMaskEvent(display, ButtonPressMask, &event)) { if(event.xany.window == XtWindow(pltAppPtr->GetStopButtonWidget())) { XPutBackEvent(display, &event); cancelled = true; iEnd = i; break; } } #endif } // end for(i=0; ...) delete [] frameImageData; if(cancelled) { for(int i(0); i <= iEnd; ++i) { int iDestroySlice((((slice - start + (posneg * i)) + length) % length)); XDestroyImage(frameBuffer[iDestroySlice]); } framesMade = false; sprintf(buffer, "Cancelled.\n"); PrintMessage(buffer); APChangeSlice(start+islice); AmrPicture *apXY = pltAppPtr->GetAmrPicturePtr(XY); AmrPicture *apXZ = pltAppPtr->GetAmrPicturePtr(XZ); AmrPicture *apYZ = pltAppPtr->GetAmrPicturePtr(YZ); if(sliceDir == XDIR) { apXY->SetVLine((slice - subDomain[maxAllowableLevel].smallEnd(XDIR)) * pltAppStatePtr->CurrentScale()); apXY->DoExposePicture(); apXZ->SetVLine((slice - subDomain[maxAllowableLevel].smallEnd(XDIR)) * pltAppStatePtr->CurrentScale()); apXZ->DoExposePicture(); } if(sliceDir == YDIR) { apXY->SetHLine(apXY->ImageSizeV()-1 - (slice - subDomain[maxAllowableLevel].smallEnd(YDIR)) * pltAppStatePtr->CurrentScale()); apXY->DoExposePicture(); apYZ->SetVLine((slice - subDomain[maxAllowableLevel].smallEnd(YDIR)) * pltAppStatePtr->CurrentScale()); apYZ->DoExposePicture(); } if(sliceDir == ZDIR) { apYZ->SetHLine(apYZ->ImageSizeV()-1 - (slice - subDomain[maxAllowableLevel].smallEnd(ZDIR)) * pltAppStatePtr->CurrentScale()); apYZ->DoExposePicture(); apXZ->SetHLine(apXZ->ImageSizeV()-1 - (slice - subDomain[maxAllowableLevel].smallEnd(ZDIR)) * pltAppStatePtr->CurrentScale()); apXZ->DoExposePicture(); } } else { framesMade = true; sprintf(buffer, "Done.\n"); PrintMessage(buffer); } DoExposePicture(); } // end CreateFrames // --------------------------------------------------------------------- void AmrPicture::DrawDatasetPoint(int hplot, int vplot, int size) { hdspoint = hplot; vdspoint = vplot; dsBoxSize = size; int hpoint = hdspoint * pltAppStatePtr->CurrentScale(); int vpoint = imageSizeV-1 - vdspoint * pltAppStatePtr->CurrentScale(); int side = dsBoxSize * pltAppStatePtr->CurrentScale(); XDrawRectangle(display, pictureWindow, pltAppPtr->GetRbgc(), hpoint, vpoint, side, side); } // --------------------------------------------------------------------- void AmrPicture::UnDrawDatasetPoint() { int hpoint = hdspoint * pltAppStatePtr->CurrentScale(); int vpoint = imageSizeV-1 - vdspoint * pltAppStatePtr->CurrentScale(); int side = dsBoxSize * pltAppStatePtr->CurrentScale(); XDrawRectangle(display, pictureWindow, pltAppPtr->GetRbgc(), hpoint, vpoint, side, side); } // --------------------------------------------------------------------- void AmrPicture::CBFrameTimeOut(XtPointer client_data, XtIntervalId *) { ((AmrPicture *) client_data)->DoFrameUpdate(); } // --------------------------------------------------------------------- void AmrPicture::CBContourSweep(XtPointer client_data, XtIntervalId *) { ((AmrPicture *) client_data)->DoContourSweep(); } // --------------------------------------------------------------------- void AmrPicture::DoFrameUpdate() { int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); if(sweepDirection == ANIMPOSDIR) { if(slice < subDomain[maxAllowableLevel].bigEnd(sliceDir)) { ++slice; } else { slice = subDomain[maxAllowableLevel].smallEnd(sliceDir); } } else { if(slice > subDomain[maxAllowableLevel].smallEnd(sliceDir)) { --slice; } else { slice = subDomain[maxAllowableLevel].bigEnd(sliceDir); } } BL_ASSERT(DrawContours(pltAppStatePtr->GetContourType()) == false); int iRelSlice(slice - subDomain[maxAllowableLevel].smallEnd(sliceDir)); ShowFrameImage(iRelSlice); XSync(display, false); pendingTimeOut = XtAppAddTimeOut(pltAppPtr->GetAppContext(), frameSpeed, (XtTimerCallbackProc) &AmrPicture::CBFrameTimeOut, (XtPointer) this); } // end DoFrameUpdate() // --------------------------------------------------------------------- void AmrPicture::DoContourSweep() { if(sweepDirection == ANIMPOSDIR) { pltAppPtr->DoForwardStep(myView); } else { pltAppPtr->DoBackStep(myView); } pendingTimeOut = XtAppAddTimeOut(pltAppPtr->GetAppContext(), frameSpeed, (XtTimerCallbackProc) &AmrPicture::CBContourSweep, (XtPointer) this); } // --------------------------------------------------------------------- void AmrPicture::DoStop() { if(pendingTimeOut != 0) { XtRemoveTimeOut(pendingTimeOut); pendingTimeOut = 0; APChangeSlice(slice); } } // --------------------------------------------------------------------- void AmrPicture::Sweep(AnimDirection direction) { if(pendingTimeOut != 0) { DoStop(); } if(DrawContours(pltAppStatePtr->GetContourType()) == true) { pendingTimeOut = XtAppAddTimeOut(pltAppPtr->GetAppContext(), frameSpeed, (XtTimerCallbackProc) &AmrPicture::CBContourSweep, (XtPointer) this); sweepDirection = direction; return; } if( ! framesMade) { CreateFrames(direction); } if(framesMade) { pendingTimeOut = XtAppAddTimeOut(pltAppPtr->GetAppContext(), frameSpeed, (XtTimerCallbackProc) &AmrPicture::CBFrameTimeOut, (XtPointer) this); sweepDirection = direction; } } // --------------------------------------------------------------------- void AmrPicture::DrawSlice(int iSlice) { XDrawLine(display, pictureWindow, pltAppPtr->GetRbgc(), 0, 30, imageSizeH, 30); } // --------------------------------------------------------------------- void AmrPicture::ShowFrameImage(int iSlice) { AmrPicture *apXY = pltAppPtr->GetAmrPicturePtr(XY); AmrPicture *apXZ = pltAppPtr->GetAmrPicturePtr(XZ); AmrPicture *apYZ = pltAppPtr->GetAmrPicturePtr(YZ); int iRelSlice(iSlice); XPutImage(display, pictureWindow, xgc, frameBuffer[iRelSlice], 0, 0, 0, 0, imageSizeH, imageSizeV); DrawBoxes(frameGrids[iRelSlice], pictureWindow); if(DrawContours(pltAppStatePtr->GetContourType()) == true) { DrawContour(sliceFab, display, pictureWindow, xgc); } // draw plane "cutting" lines XSetForeground(display, xgc, palPtr->pixelate(hColor)); XDrawLine(display, pictureWindow, xgc, 0, hLine, imageSizeH, hLine); XSetForeground(display, xgc, palPtr->pixelate(vColor)); XDrawLine(display, pictureWindow, xgc, vLine, 0, vLine, imageSizeV); XSetForeground(display, xgc, palPtr->pixelate(hColor-30)); XDrawLine(display, pictureWindow, xgc, 0, hLine+1, imageSizeH, hLine+1); XSetForeground(display, xgc, palPtr->pixelate(vColor-30)); XDrawLine(display, pictureWindow, xgc, vLine+1, 0, vLine+1, imageSizeV); if(sliceDir == XDIR) { apXY->SetVLine(iRelSlice * pltAppStatePtr->CurrentScale()); apXY->DoExposePicture(); apXZ->SetVLine(iRelSlice * pltAppStatePtr->CurrentScale()); apXZ->DoExposePicture(); } if(sliceDir == YDIR) { apXY->SetHLine(apXY->ImageSizeV() - 1 - iRelSlice * pltAppStatePtr->CurrentScale()); apXY->DoExposePicture(); apYZ->SetVLine(iRelSlice * pltAppStatePtr->CurrentScale()); apYZ->DoExposePicture(); } if(sliceDir == ZDIR) { apYZ->SetHLine(apYZ->ImageSizeV() - 1 - iRelSlice * pltAppStatePtr->CurrentScale()); apYZ->DoExposePicture(); apXZ->SetHLine(apXZ->ImageSizeV() - 1 - iRelSlice * pltAppStatePtr->CurrentScale()); apXZ->DoExposePicture(); } #if (BL_SPACEDIM == 3) if(framesMade) { for(int nP(0); nP < 3; ++nP) pltAppPtr->GetProjPicturePtr()-> ChangeSlice(nP, pltAppPtr->GetAmrPicturePtr(nP)->GetSlice()); pltAppPtr->GetProjPicturePtr()->MakeSlices(); XClearWindow(XtDisplay(pltAppPtr->GetWTransDA()), XtWindow(pltAppPtr->GetWTransDA())); pltAppPtr->DoExposeTransDA(); } #endif pltAppPtr->DoExposeRef(); } // end ShowFrameImage() // --------------------------------------------------------------------- void AmrPicture::DrawContour(Array passedSliceFab, Display *passed_display, Drawable &passedPixMap, const GC &passedGC) { //Real v_min(GetWhichMin()); //Real v_max(GetWhichMax()); Real v_min, v_max; pltAppStatePtr->GetMinMax(v_min, v_max); Real v_off; if(pltAppStatePtr->GetNumContours() != 0) { v_off = v_min + 0.5 * (v_max - v_min) / (Real) pltAppStatePtr->GetNumContours(); } else { v_off = 1.0; } int hDir, vDir; if(myView == XZ) { hDir = XDIR; vDir = ZDIR; } else if(myView == YZ) { hDir = YDIR; vDir = ZDIR; } else { hDir = XDIR; vDir = YDIR; } const AmrData &amrData = dataServicesPtr->AmrDataRef(); Array pos_low(BL_SPACEDIM); Array pos_high(BL_SPACEDIM); int minDrawnLevel(pltAppStatePtr->MinDrawnLevel()); int maxDrawnLevel(pltAppStatePtr->MaxDrawnLevel()); amrData.LoNodeLoc(maxDrawnLevel, passedSliceFab[maxDrawnLevel]->smallEnd(), pos_low); amrData.HiNodeLoc(maxDrawnLevel, passedSliceFab[maxDrawnLevel]->bigEnd(), pos_high); Real xlft(pos_low[hDir]); Real ybot(pos_low[vDir]); Real xrgt(pos_high[hDir]); Real ytop(pos_high[vDir]); for(int lev(minDrawnLevel); lev <= maxDrawnLevel; ++lev) { const bool *mask_array(NULL); bool mask_bool(false); BaseFab mask(passedSliceFab[lev]->box()); mask.setVal(false); if(lev != maxDrawnLevel) { int lratio(AVGlobals::CRRBetweenLevels(lev, lev + 1, amrData.RefRatio())); // construct mask array. must be size FAB. const BoxArray &nextFinest = amrData.boxArray(lev+1); for(int j(0); j < nextFinest.size(); ++j) { Box coarseBox(BoxLib::coarsen(nextFinest[j],lratio)); if(coarseBox.intersects(passedSliceFab[lev]->box())) { coarseBox &= passedSliceFab[lev]->box(); mask.setVal(true,coarseBox,0); } } } // get rid of the complement const BoxArray &levelBoxArray = amrData.boxArray(lev); BoxArray complement = BoxLib::complementIn(passedSliceFab[lev]->box(), levelBoxArray); for(int i(0); i < complement.size(); ++i) { mask.setVal(true, complement[i], 0); } mask_array = mask.dataPtr(); mask_bool = true; int paletteEnd(palPtr->PaletteEnd()); int paletteStart(palPtr->PaletteStart()); int csm1(palPtr->ColorSlots() - 1); Real oneOverGDiff; Real minUsing, maxUsing; pltAppStatePtr->GetMinMax(minUsing, maxUsing); if((maxUsing - minUsing) < FLT_MIN) { oneOverGDiff = 0.0; } else { oneOverGDiff = 1.0 / (maxUsing - minUsing); } int drawColor; if(AVGlobals::LowBlack()) { drawColor = palPtr->WhiteIndex(); } else { drawColor = palPtr->BlackIndex(); } for(int icont(0); icont < pltAppStatePtr->GetNumContours(); ++icont) { Real frac((Real) icont / pltAppStatePtr->GetNumContours()); Real value(v_off + frac * (v_max - v_min)); if(pltAppStatePtr->GetContourType() == COLORCONTOURS) { if(value > maxUsing) { // clip drawColor = paletteEnd; } else if(value < minUsing) { // clip drawColor = paletteStart; } else { drawColor = (int) ((((value - minUsing) * oneOverGDiff) * csm1) ); // ^^^^^^^^^^^^^^^^^ Real data drawColor += paletteStart; } } DrawContour(*(passedSliceFab[lev]), value, mask_bool, mask_array, passed_display, passedPixMap, passedGC, drawColor, passedSliceFab[lev]->box().length(hDir), passedSliceFab[lev]->box().length(vDir), xlft, ybot, xrgt, ytop); } } // loop over levels } // contour plotting // --------------------------------------------------------------------- bool AmrPicture::DrawContour(const FArrayBox &fab, Real value, bool has_mask, const bool *mask, Display *display, Drawable &dPixMap, const GC &gc, int FGColor, int xLength, int yLength, Real leftEdge, Real bottomEdge, Real rightEdge, Real topEdge) { // data = data to be contoured // value = value to contour // has_mask = true if mask array available // mask = array of mask values. will not contour in masked off cells // xLength = dimension of arrays in X direction // yLength = dimension of arrays in Y direction // leftEdge = position of left edge of grid in domain // rightEdge = position of right edge of grid in domain // bottomEdge = position of bottom edge of grid in domain // topEdge = position of top edge of grid in domain const Real *data = fab.dataPtr(); Real xDiff((rightEdge - leftEdge) / (xLength - 1)); Real yDiff((topEdge - bottomEdge) / (yLength - 1)); bool left, right, bottom, top; // does contour line intersect this side? Real xLeft(0.0), yLeft(0.0); // where contour line intersects left side Real xRight(0.0), yRight(0.0); // where contour line intersects right side Real xBottom(0.0), yBottom(0.0); // where contour line intersects bottom side Real xTop(0.0), yTop(0.0); // where contour line intersects top side bool bFailureStatus(false); for(int j(0); j < yLength - 1; ++j) { for(int i(0); i < xLength - 1; ++i) { if(has_mask) { if(mask[(i) + (j) * xLength] || mask[(i+1) + (j) * xLength] || mask[(i+1) + (j+1) * xLength] || mask[(i) + (j+1) * xLength]) { continue; } } Real left_bottom(data[(i) + (j) * xLength]); // left bottom value Real left_top(data[(i) + (j+1) * xLength]); // left top value Real right_bottom(data[(i+1) + (j) * xLength]); // right bottom value Real right_top(data[(i+1) + (j+1) * xLength]); // right top value xLeft = leftEdge + xDiff*(i); xRight = xLeft + xDiff; yBottom = bottomEdge + yDiff * j; yTop = yBottom + yDiff; left = Between(left_bottom,value,left_top); right = Between(right_bottom,value,right_top); bottom = Between(left_bottom,value,right_bottom); top = Between(left_top,value,right_top); // figure out where things intersect the cell if(left) { if(left_bottom != left_top) { yLeft = yBottom + yDiff * (value - left_bottom) / (left_top-left_bottom); } else { yLeft = yBottom; bFailureStatus = true; } } if(right) { if(right_bottom != right_top) { yRight = yBottom + yDiff*(value-right_bottom)/(right_top-right_bottom); } else { yRight = yBottom; bFailureStatus = true; } } if(bottom) { if(left_bottom != right_bottom) { xBottom = xLeft + xDiff*(value-left_bottom)/(right_bottom-left_bottom); } else { xBottom = xRight; bFailureStatus = true; } } if(top) { if(left_top != right_top) { xTop = xLeft + xDiff*(value-left_top)/(right_top-left_top); } else { xTop = xRight; bFailureStatus = true; } } XSetForeground(display, xgc, palPtr->pixelate(FGColor)); Real hReal2X((Real) imageSizeH / (rightEdge - leftEdge)); Real vReal2X((Real) imageSizeV / (topEdge - bottomEdge)); if(left) { xLeft -= leftEdge; yLeft -= bottomEdge; xLeft *= hReal2X; yLeft *= vReal2X; } if(right) { xRight -= leftEdge; yRight -= bottomEdge; xRight *= hReal2X; yRight *= vReal2X; } if(top) { xTop -= leftEdge; yTop -= bottomEdge; xTop *= hReal2X; yTop *= vReal2X; } if(bottom) { xBottom -= leftEdge; yBottom -= bottomEdge; xBottom *= hReal2X; yBottom *= vReal2X; } // finally, draw contour line if(left && right && bottom && top) { // intersects all sides, generate saddle point XDrawLine(display, dPixMap, gc, (int) xLeft, (int) (imageSizeV - yLeft), (int) xRight, (int) (imageSizeV - yRight)); XDrawLine(display, dPixMap, gc, (int) xTop, (int) (imageSizeV - yTop), (int) xBottom, (int) (imageSizeV - yBottom)); } else if(top && bottom) { // only intersects top and bottom sides XDrawLine(display, dPixMap, gc, (int) xTop, (int) (imageSizeV - yTop), (int) xBottom, (int) (imageSizeV - yBottom)); } else if(left) { if(right) { XDrawLine(display, dPixMap, gc, (int) xLeft, (int) (imageSizeV - yLeft), (int) xRight, (int) (imageSizeV - yRight)); } else if(top) { XDrawLine(display, dPixMap, gc, (int) xLeft, (int) (imageSizeV - yLeft), (int) xTop, (int) (imageSizeV-yTop)); } else { XDrawLine(display, dPixMap, gc, (int) xLeft, (int) (imageSizeV - yLeft), (int) xBottom, (int) (imageSizeV - yBottom)); } } else if(right) { if(top) { XDrawLine(display, dPixMap, gc, (int) xRight, (int) (imageSizeV - yRight), (int) xTop, (int) (imageSizeV - yTop)); } else { XDrawLine(display, dPixMap, gc, (int) xRight, (int) (imageSizeV - yRight), (int) xBottom, (int) (imageSizeV - yBottom)); } } } // end for(i...) } // end for(j...) return bFailureStatus; } // --------------------------------------------------------------------- VectorDerived AmrPicture::FindVectorDerived(Array &aVectorDeriveNames) { // figure out if we are using velocities, momentums, or if neither are available // first try velocities if(dataServicesPtr->CanDerive("x_velocity") && dataServicesPtr->CanDerive("y_velocity") #if (BL_SPACEDIM == 3) && dataServicesPtr->CanDerive("z_velocity") #endif ) { aVectorDeriveNames[0] = "x_velocity"; aVectorDeriveNames[1] = "y_velocity"; #if (BL_SPACEDIM == 3) aVectorDeriveNames[2] = "z_velocity"; #endif return enVelocity; } else if(dataServicesPtr->CanDerive("xvel") && dataServicesPtr->CanDerive("yvel") #if (BL_SPACEDIM == 3) && dataServicesPtr->CanDerive("zvel") #endif ) { aVectorDeriveNames[0] = "xvel"; aVectorDeriveNames[1] = "yvel"; #if (BL_SPACEDIM == 3) aVectorDeriveNames[2] = "zvel"; #endif return enVelocity; } else if(dataServicesPtr->CanDerive("x_vel") && dataServicesPtr->CanDerive("y_vel") #if (BL_SPACEDIM == 3) && dataServicesPtr->CanDerive("z_vel") #endif ) { aVectorDeriveNames[0] = "x_vel"; aVectorDeriveNames[1] = "y_vel"; #if (BL_SPACEDIM == 3) aVectorDeriveNames[2] = "z_vel"; #endif return enVelocity; } else if(dataServicesPtr->CanDerive("x_momentum") && dataServicesPtr->CanDerive("y_momentum") #if (BL_SPACEDIM == 3) && dataServicesPtr->CanDerive("z_momentum") #endif && dataServicesPtr->CanDerive("density") ) { aVectorDeriveNames[0] = "x_momentum"; aVectorDeriveNames[1] = "y_momentum"; #if (BL_SPACEDIM == 3) aVectorDeriveNames[2] = "z_momentum"; #endif return enMomentum; } else if(dataServicesPtr->CanDerive("xmom") && dataServicesPtr->CanDerive("ymom") #if (BL_SPACEDIM == 3) && dataServicesPtr->CanDerive("zmom") #endif && dataServicesPtr->CanDerive("density") ) { aVectorDeriveNames[0] = "xmom"; aVectorDeriveNames[1] = "ymom"; #if (BL_SPACEDIM == 3) aVectorDeriveNames[2] = "zmom"; #endif return enMomentum; } else if(dataServicesPtr->CanDerive("x_mom") && dataServicesPtr->CanDerive("y_mom") #if (BL_SPACEDIM == 3) && dataServicesPtr->CanDerive("z_mom") #endif && dataServicesPtr->CanDerive("density") ) { aVectorDeriveNames[0] = "x_mom"; aVectorDeriveNames[1] = "y_mom"; #if (BL_SPACEDIM == 3) aVectorDeriveNames[2] = "z_mom"; #endif return enMomentum; } else { return enNoneFound; } } // --------------------------------------------------------------------- void AmrPicture::DrawVectorField(Display *pDisplay, Drawable &pDrawable, const GC &pGC) { int hDir(-1), vDir(-1); if(myView == XY) { hDir = XDIR; vDir = YDIR; } else if(myView == XZ) { hDir = XDIR; vDir = ZDIR; } else if(myView == YZ) { hDir = YDIR; vDir = ZDIR; } else { BL_ASSERT(false); } const AmrData &amrData = dataServicesPtr->AmrDataRef(); int DVFscale(pltAppStatePtr->CurrentScale()); int maxDrawnLevel(pltAppStatePtr->MaxDrawnLevel()); int maxAllowableLevel(pltAppStatePtr->MaxAllowableLevel()); int DVFRatio(AVGlobals::CRRBetweenLevels(maxDrawnLevel, maxAllowableLevel, amrData.RefRatio())); // get velocity field Box DVFSliceBox(sliceFab[maxDrawnLevel]->box()); int maxLength(DVFSliceBox.longside()); FArrayBox density(DVFSliceBox); FArrayBox hVelocity(DVFSliceBox); FArrayBox vVelocity(DVFSliceBox); VectorDerived whichVectorDerived; Array choice(BL_SPACEDIM); whichVectorDerived = FindVectorDerived(choice); if(whichVectorDerived == enNoneFound) { cerr << "Could not find suitable quantities to create velocity vectors." << endl; return; } if(whichVectorDerived == enVelocity) { // fill the velocities string hVel(choice[hDir]); string vVel(choice[vDir]); DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) &hVelocity, (void *) (&(hVelocity.box())), maxDrawnLevel, (void *) &hVel); DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) &vVelocity, (void *) (&(vVelocity.box())), maxDrawnLevel, (void *) &vVel); } else { // using momentums BL_ASSERT(whichVectorDerived == enMomentum); // fill the density and momentum: string sDensity("density"); if( ! dataServicesPtr->CanDerive(sDensity)) { cerr << "Found momentums in the plot file but not density." << endl; return; } string hMom(choice[hDir]); string vMom(choice[vDir]); DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) &density, (void *) (&(density.box())), maxDrawnLevel, (void *) &sDensity); DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) &hVelocity, (void *) (&(hVelocity.box())), maxDrawnLevel, (void *) &hMom); DataServices::Dispatch(DataServices::FillVarOneFab, dataServicesPtr, (void *) &vVelocity, (void *) (&(vVelocity.box())), maxDrawnLevel, (void *) &vMom); // then divide to get velocity hVelocity /= density; vVelocity /= density; } // compute maximum speed Real smax(0.0); int npts(hVelocity.box().numPts()); const Real *hdat = hVelocity.dataPtr(); const Real *vdat = vVelocity.dataPtr(); for(int k(0); k < npts; ++k) { Real s(sqrt(hdat[k] * hdat[k] + vdat[k] * vdat[k])); smax = max(smax,s); } if(smax < 1.0e-8) { cout << "CONTOUR: zero velocity field" << endl; } else { DrawVectorField(pDisplay, pDrawable, pGC, hDir, vDir, maxLength, hdat, vdat, smax, DVFSliceBox, DVFscale*DVFRatio); } } // --------------------------------------------------------------------- void AmrPicture::DrawVectorField(Display *pDisplay, Drawable &pDrawable, const GC &pGC, int hDir, int vDir, int maxLength, const Real *hdat, const Real *vdat, const Real velocityMax, const Box &dvfSliceBox, int dvfFactor) { int maxpoints(pltAppStatePtr->GetNumContours()); // partition longest side BL_ASSERT(maxpoints > 0); Real sight_h(maxLength / maxpoints); int stride((int) sight_h); if(stride < 1) { stride = 1; } Real Amax(1.25 * sight_h); Real arrowLength(0.25); XSetForeground(pDisplay, pGC, palPtr->WhiteIndex()); int ilo(dvfSliceBox.smallEnd(hDir)); int leftEdge(ilo); int ihi(dvfSliceBox.bigEnd(hDir)); int nx(ihi - ilo + 1); int jlo(dvfSliceBox.smallEnd(vDir)); int bottomEdge(jlo); int jhi(dvfSliceBox.bigEnd(vDir)); Real xlft(ilo + 0.5); Real ybot(jlo + 0.5); Real x, y, x1, y1, x2, y2, a, b, p1, p2; //Real s; //Real eps(1.0e-3); int iX1, iY1, iX2, iY2; for(int jj(jlo); jj <= jhi; jj += stride) { y = ybot + (jj-jlo); for(int ii(ilo); ii <= ihi; ii += stride) { x = xlft + (ii-ilo); x1 = hdat[ii-ilo + nx * (jj-jlo)]; y1 = vdat[ii-ilo + nx * (jj-jlo)]; //s = sqrt(x1 * x1 + y1 * y1); //if(s < eps) { //cout << "**** s eps = " << s << " " << eps << endl; //continue; //} a = Amax * (x1 / velocityMax); b = Amax * (y1 / velocityMax); x2 = x + a; y2 = y + b; iX1 = (int) ((x - leftEdge) * dvfFactor); iY1 = (int) (imageSizeV - ((y - bottomEdge) * dvfFactor)); iX2 = (int) ((x2 - leftEdge) * dvfFactor); iY2 = (int) (imageSizeV - ((y2 - bottomEdge) * dvfFactor)); XDrawLine(pDisplay, pDrawable, pGC, iX1, iY1, iX2, iY2); // draw the arrow heads p1 = x2 - arrowLength * a; p2 = y2 - arrowLength * b; p1 = p1 - (arrowLength * 0.5) * b; p2 = p2 + (arrowLength * 0.5) * a; iX1 = iX2; iY1 = iY2; iX2 = (int) ((p1 - leftEdge) * dvfFactor); iY2 = (int) (imageSizeV - ((p2 - bottomEdge) * dvfFactor)); XDrawLine(pDisplay, pDrawable, pGC, iX1, iY1, iX2, iY2); } } } // --------------------------------------------------------------------- // --------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/GlobalUtilities.cpp0000644000175000017500000010164711634153073023111 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: GlobalUtilities.cpp,v 1.50 2002/12/10 20:12:23 vince Exp $ // // --------------------------------------------------------------- // GlobalUtilities.cpp // --------------------------------------------------------------- #include "GlobalUtilities.H" #include "FArrayBox.H" #include "FabConv.H" #include #include using std::ifstream; using std::ofstream; using std::cout; using std::cerr; using std::endl; using std::min; using std::max; #include "PltApp.H" #include "ParallelDescriptor.H" const int DEFAULTMAXPICTURESIZE = 600000; int boundaryWidth; int skipPltLines; int boxColor; int maxPictureSize; FileType fileType; bool animation; Array comlinefilename; string initialDerived; string initialFormat; string initialPalette; string initialLightingFile; int fileCount; int sleepTime; bool givenBox; bool givenBoxSlice; bool makeSWFData; bool makeSWFLight; bool lowBlack; bool dumpSlices; bool sliceAllVars; bool givenFilename; Box comlinebox; bool verbose; Array< std::list > dumpSliceList; bool specifiedMinMax; Real specifiedMin; Real specifiedMax; bool useMaxLevel; int maxLevel; int maxPaletteIndex; bool SGIrgbfile(true); int fabIOSize; bool bShowBody(true); char *FileTypeString[] = { "invalidtype", "fab", "multifab", "newplt" }; // ------------------------------------------------------------------- const string &AVGlobals::GetInitialDerived() { return initialDerived; } // ------------------------------------------------------------------- void AVGlobals::SetInitialDerived(const string &initialderived) { initialDerived = initialderived; } // ------------------------------------------------------------------- const string &AVGlobals::GetPaletteName() { return initialPalette; } // ------------------------------------------------------------------- const string &AVGlobals::GetLightingFileName() { return initialLightingFile; } // ------------------------------------------------------------------- void AddSlices(int dir, char *sliceset) { int rangeStart(-1), rangeEnd(-1), slice(-1); bool rangeSpecified(false); dumpSlices = true; for(int ipos(1); ipos <= strlen(sliceset); ++ipos) { // skip first char for neg if(sliceset[ipos] == '-') { // we have a range of values specified rangeSpecified = true; rangeStart = atoi(sliceset); rangeEnd = atoi(sliceset + ipos + 1); sliceset[ipos] = '\0'; break; } } list::iterator dsliter; if(rangeSpecified) { if(BL_SPACEDIM == 2 && dir == ZDIR) { slice = 0; dsliter = find(dumpSliceList[dir].begin(), dumpSliceList[dir].end(), slice); if(dsliter == dumpSliceList[dir].end()) { dumpSliceList[dir].push_back(slice); } } else { for(slice = rangeStart; slice <= rangeEnd; ++slice) { dsliter = find(dumpSliceList[dir].begin(),dumpSliceList[dir].end(),slice); if(dsliter == dumpSliceList[dir].end()) { dumpSliceList[dir].push_back(slice); } } } } else { slice = atoi(sliceset); if(BL_SPACEDIM == 2 && dir == ZDIR) { slice = 0; } dsliter = find(dumpSliceList[dir].begin(),dumpSliceList[dir].end(),slice); if(dsliter == dumpSliceList[dir].end()) { dumpSliceList[dir].push_back(slice); } } } // ------------------------------------------------------------------- bool AVGlobals::ReadLightingFile(const string &lightdefaultsFile, Real &ambientDef, Real &diffuseDef, Real &specularDef, Real &shinyDef, Real &minRayOpacityDef, Real &maxRayOpacityDef) { char defaultString[LINELENGTH], cRealIn[LINELENGTH]; // try to find the defaultsFile char buffer[BUFSIZ]; ifstream defs(lightdefaultsFile.c_str()); if(defs.fail()) { cout << "Cannot find lighting defaults file: " << lightdefaultsFile << endl; return false; } else { cout << "Reading lighting defaults from: " << lightdefaultsFile << endl; ws(defs); defs.getline(buffer, BUFSIZ, '\n'); while( ! defs.eof()) { sscanf(buffer,"%s", defaultString); if(defaultString[0] != '#') { // a comment starts with # if(strcmp(defaultString,"ambient") == 0) { sscanf(buffer, "%s%s", defaultString, cRealIn); ambientDef = atof(cRealIn); } else if(strcmp(defaultString, "diffuse") == 0) { sscanf(buffer, "%s%s", defaultString, cRealIn); diffuseDef = atof(cRealIn); } else if(strcmp(defaultString, "specular") == 0) { sscanf(buffer, "%s%s", defaultString, cRealIn); specularDef = atof(cRealIn); } else if(strcmp(defaultString, "shiny") == 0) { sscanf(buffer, "%s%s", defaultString, cRealIn); shinyDef = atof(cRealIn); } else if(strcmp(defaultString, "minRayOpacity") == 0) { sscanf(buffer, "%s%s", defaultString, cRealIn); minRayOpacityDef = atof(cRealIn); } else if(strcmp(defaultString, "maxRayOpacity") == 0) { sscanf(buffer, "%s%s", defaultString, cRealIn); maxRayOpacityDef = atof(cRealIn); } } defs.getline(buffer, BUFSIZ, '\n'); } } return true; } // ------------------------------------------------------------------- bool AVGlobals::WriteLightingFile(const string &lightdefaultsFile, const Real &ambientDef, const Real &diffuseDef, const Real &specularDef, const Real &shinyDef, const Real &minRayOpacityDef, const Real &maxRayOpacityDef) { // the format of this file is: //ambient 0.42 //diffuse 0.41 //specular 0.40 //shiny 12.0 //minRayOpacity 0.04 //maxRayOpacity 0.96 if(ParallelDescriptor::IOProcessor()) { ofstream defs(lightdefaultsFile.c_str()); if(defs.fail()) { cerr << "***** Error writing lighting file: filename = " << lightdefaultsFile << endl; return false; } else { defs << "ambient " << ambientDef << endl; defs << "diffuse " << diffuseDef << endl; defs << "specular " << specularDef << endl; defs << "shiny " << shinyDef << endl; defs << "minRayOpacity " << minRayOpacityDef << endl; defs << "maxRayOpacity " << maxRayOpacityDef << endl; defs.close(); } } return true; } // ------------------------------------------------------------------- void AVGlobals::GetDefaults(const string &defaultsFile) { char buffer[BUFSIZ]; char defaultString[LINELENGTH]; char tempString[LINELENGTH]; int tempInt; // standard defaults PltApp::SetDefaultPalette("Palette"); PltApp::SetDefaultLightingFile("amrvis.lighting"); initialPalette = "Palette"; PltApp::SetInitialDerived("density"); PltApp::SetInitialScale(1); PltApp::SetInitialFormatString("%7.5f"); PltApp::SetDefaultShowBoxes(true); PltApp::SetInitialWindowHeight(500); PltApp::SetInitialWindowWidth(850); PltApp::SetReserveSystemColors(24); maxPictureSize = DEFAULTMAXPICTURESIZE; boundaryWidth = 0; skipPltLines = 0; maxPaletteIndex = 255; // dont clip the top palette index (default) boxColor = -1; // invalid fileType = NEWPLT; // default fabIOSize = 0; lowBlack = false; bShowBody = true; // try to find the defaultsFile string fullDefaultsFile; fullDefaultsFile = "./" + defaultsFile; // try dot first ifstream defs; defs.open(fullDefaultsFile.c_str()); if(defs.fail()) { // try ~ (tilde) cout << "Cannot find amrvis defaults file: " << fullDefaultsFile << endl; fullDefaultsFile = getenv("HOME"); fullDefaultsFile += "/"; fullDefaultsFile += defaultsFile; defs.clear(); // must do this to clear the fail bit defs.open(fullDefaultsFile.c_str()); if(defs.fail()) { // try ~/. (hidden file) cout << "Cannot find amrvis defaults file: " << fullDefaultsFile << endl; fullDefaultsFile = getenv("HOME"); fullDefaultsFile += "/."; fullDefaultsFile += defaultsFile; defs.clear(); // must do this to clear the fail bit defs.open(fullDefaultsFile.c_str()); if(defs.fail()) { // punt cout << "Cannot find amrvis defaults file: " << fullDefaultsFile << endl; cout << "Using standard defaults." << endl; return; } } } if(ParallelDescriptor::IOProcessor()) { cout << "Reading defaults from: " << fullDefaultsFile << endl; } ws(defs); defs.getline(buffer, BUFSIZ, '\n'); while( ! defs.eof()) { sscanf(buffer,"%s", defaultString); if(defaultString[0] != '#') { // a comment starts with # if(strcmp(defaultString,"palette") == 0) { sscanf(buffer, "%s%s",defaultString, tempString); PltApp::SetDefaultPalette(tempString); initialPalette = tempString; } else if(strcmp(defaultString,"lightingfile") == 0) { sscanf(buffer, "%s%s",defaultString, tempString); PltApp::SetDefaultLightingFile(tempString); initialLightingFile = tempString; } else if(strcmp(defaultString, "initialderived") == 0) { sscanf(buffer, "%s%s", defaultString, tempString); PltApp::SetInitialDerived(tempString); initialDerived = tempString; } else if(strcmp(defaultString, "initialscale") == 0) { sscanf(buffer, "%s%d", defaultString, &tempInt); PltApp::SetInitialScale(tempInt); } else if(strcmp(defaultString, "numberformat") == 0) { sscanf(buffer, "%s%s", defaultString, tempString); PltApp::SetInitialFormatString(tempString); } else if(strcmp(defaultString, "windowheight") == 0) { sscanf(buffer, "%s%d", defaultString, &tempInt); PltApp::SetInitialWindowHeight(tempInt); } else if(strcmp(defaultString, "windowwidth") == 0) { sscanf(buffer, "%s%d", defaultString, &tempInt); PltApp::SetInitialWindowWidth(tempInt); } else if(strcmp(defaultString, "maxpixmapsize") == 0) { sscanf(buffer, "%s%d", defaultString, &tempInt); maxPictureSize = tempInt; } else if(strcmp(defaultString, "reservesystemcolors") == 0) { sscanf(buffer, "%s%d", defaultString, &tempInt); PltApp::SetReserveSystemColors(tempInt); } else if(strcmp(defaultString, "showboxes") == 0) { sscanf(buffer, "%s%s", defaultString, tempString); if(*tempString == 't' || *tempString == 'T') { PltApp::SetDefaultShowBoxes(true); } else { PltApp::SetDefaultShowBoxes(false); } } else if(strcmp(defaultString, "showbody") == 0) { sscanf(buffer, "%s%s", defaultString, tempString); if(*tempString == 'f' || *tempString == 'F') { bShowBody = false; } } else if(strcmp(defaultString, "ppm") == 0) { sscanf(buffer, "%s%s", defaultString, tempString); if(*tempString == 't' || *tempString == 'T') { AVGlobals::ClearSGIrgbFile(); } } else if(strcmp(defaultString, "boundarywidth") == 0) { sscanf(buffer, "%s%d", defaultString, &tempInt); boundaryWidth = tempInt; } else if(strcmp(defaultString, "maxlev") == 0) { sscanf(buffer, "%s%d", defaultString, &tempInt); maxLevel = tempInt; useMaxLevel = true; if(maxLevel < 0) { cerr << "Error in defaults file: invalid parameter for maxLevel: " << maxLevel << endl; maxLevel = -1; useMaxLevel = false; } } else if(strcmp(defaultString, "sleep") == 0) { sscanf(buffer, "%s%d", defaultString, &tempInt); sleepTime = tempInt; } else if(strcmp(defaultString, "skippltlines") == 0) { sscanf(buffer, "%s%d", defaultString, &tempInt); skipPltLines = tempInt; } else if(strcmp(defaultString, "boxcolor") == 0) { sscanf(buffer, "%s%d", defaultString, &tempInt); boxColor = tempInt; } else if(strcmp(defaultString, "filetype") == 0) { sscanf(buffer, "%s%s", defaultString, tempString); if(strcmp(tempString, "fab") == 0) { fileType = FAB; } else if(strcmp(tempString, "multifab") == 0) { fileType = MULTIFAB; } else if(strcmp(tempString, "newplt") == 0) { fileType = NEWPLT; } else { // error cerr << "Error in defaults file: invalid parameter for filetype: " << tempString << endl; } } else if(strcmp(defaultString, "cliptoppalette") == 0) { maxPaletteIndex = 254; // clip the top palette index } else if(strcmp(defaultString, "fixdenormals") == 0) { RealDescriptor::SetFixDenormals(); } else if(strcmp(defaultString, "lowblack") == 0) { lowBlack = true; } else { cout << "bad default argument: " << defaultString << endl; } } ws(defs); defs.getline(buffer, BUFSIZ, '\n'); } defs.close(); } // end GetDefaults // ------------------------------------------------------------------- void PrintUsage(char *exname) { cout << endl; cout << exname << " [-help]" << endl; cout << " [] [-v]" << endl; //cout << " [-bw n] " << endl; cout << " [-maxpixmapsize ]" << endl; cout << " [-xslice n] [-yslice n] [-zslice n] [-sliceallvars]" << endl; # if (BL_SPACEDIM == 2) cout << " [-boxslice xlo ylo xhi yhi]" << endl; cout << " [-a]" << endl; # else cout << " [-boxslice xlo ylo zlo xhi yhi zhi]" << endl; #endif cout << " [-fabiosize nbits]" << endl; cout << " [-maxlev n]" << endl; cout << " [-palette palname] [-initialderived dername]" << endl; cout << " [-lightingfile name]" << endl; cout << " [-initialscale n] [-showboxes tf] [-numberformat fmt]" << endl; cout << " [-lowblack] [-showbody tf]"<< endl; cout << " [-cliptoppalette]"<< endl; cout << " [-fixdenormals]"<< endl; cout << " [-ppm]" << endl; #if (BL_SPACEDIM == 3) #ifdef BL_VOLUMERENDER cout << " [-boxcolor n]" << endl; cout << " [-makeswf_light]" << endl; cout << " [-makeswf_value]" << endl; #endif cout << " [-useminmax min max]" << endl; #endif cout << " []" << endl; cout << endl; cout << " file type flags: -fab, -multifab, -newplt (-newplt is the default)" << endl; cout << " -v verbose." << endl; //cout << " -bw n specify maximum boundary width." << endl; cout << " -maxpixmapsize n specify maximum allowed picture size in pixels." << endl; //cout << " -b specify subdomain box (on finest level)." << endl; cout << " -skippltlines n skip n lines at head of the plt file." << endl; cout << " -boxcolor n set volumetric box color value [0,255]." << endl; cout << " -xslice n write a fab slice at x = n (n at the finest level)." << endl; cout << " -yslice n write a fab slice at y = n (n at the finest level)." << endl; cout << " -zslice n write a fab slice at z = n (n at the finest level)." << endl; cout << " -sliceallvars write all fab variables instead of just initialderived." << endl; cout << " -boxslice _box_ write a fab on the box (box at the finest level)." << endl; cout << " box format: lox loy loz hix hiy hiz." << endl; cout << " example: -boxslice 0 0 0 120 42 200." << endl; cout << " Note: slices are written in batch mode." << endl; #if(BL_SPACEDIM == 2) cout << " -a load files as an animation." << endl; #endif //cout << " -sleep n specify sleep time (for attaching parallel debuggers)." << endl; cout << " -fabiosize nbits write fabs with nbits (valid values are 8 and 32." << endl; cout << " the default is native (usually 64)." << endl; cout << " -maxlev n specify the maximum drawn level." << endl; cout << " -palette palname set the initial palette." << endl; cout << " -lightingfile name set the initial lighting parameter file." << endl; cout << " -initialderived dername set the initial derived to dername." << endl; cout << " -initialscale n set the initial scale to n." << endl; cout << " -showboxes tf show boxes (the value of tf is true or false)." << endl; cout << " -showbody tf show cartGrid body as body cells (def is true)." << endl; cout << " -numberformat fmt set the initial format to fmt (ex: %4.2f)." << endl; cout << " -lowblack sets the lowest color in the palette to black."< must be included if box is specified." << endl; cout << endl; exit(0); } // ------------------------------------------------------------------- void AVGlobals::ParseCommandLine(int argc, char *argv[]) { char clsx[10]; char clsy[10]; char clbx[10]; char clby[10]; #if (BL_SPACEDIM == 3) char clsz[10]; char clbz[10]; #endif givenFilename = false; givenBox = false; givenBoxSlice = false; makeSWFData = false; makeSWFLight = false; dumpSlices = false; sliceAllVars = false; verbose = false; fileCount = 0; maxLevel = -1; useMaxLevel = false; sleepTime = 0; animation = false; specifiedMinMax = false; specifiedMin = 0.0; specifiedMax = 1.0; comlinefilename.resize(argc); // slightly larger than eventual fileCount dumpSliceList.resize(3); // always use 3 (zslice in 2d is image plane) int i; for(i = 1; i <= argc - 1; ++i) { if(strcmp(argv[i], "-maxpixmapsize") == 0) { if(argc-1 atoi(clbx) || atoi(clsy) > atoi(clby)) { cout << "A sub-region box must be specified as:\n\t " << " \n" << endl; exit(0); } comlinebox.setSmall(XDIR, atoi(clsx)); comlinebox.setSmall(YDIR, atoi(clsy)); comlinebox.setBig(XDIR, atoi(clbx)); comlinebox.setBig(YDIR, atoi(clby)); # else if(atoi(clsx) > atoi(clbx) || atoi(clsy) > atoi(clby) || atoi(clsz) > atoi(clbz)) { cout << "A sub-region box must be specified as:\n\t " << " " << endl; exit(0); } comlinebox.setSmall(XDIR, atoi(clsx)); comlinebox.setSmall(YDIR, atoi(clsy)); comlinebox.setSmall(ZDIR, atoi(clsz)); comlinebox.setBig(XDIR, atoi(clbx)); comlinebox.setBig(YDIR, atoi(clby)); comlinebox.setBig(ZDIR, atoi(clbz)); # endif } if(fileType == INVALIDTYPE) { BoxLib::Abort("Error: invalid file type. Exiting."); } else { if(ParallelDescriptor::IOProcessor()) { if(verbose) { cout << ">>>>>>> Setting file type to " << FileTypeString[fileType] << "." << endl << endl; } } } } // end ParseCommandLine // ------------------------------------------------------------------- void AVGlobals::SetSGIrgbFile() { SGIrgbfile = true; } void AVGlobals::ClearSGIrgbFile() { SGIrgbfile = false; } bool AVGlobals::IsSGIrgbFile() { return SGIrgbfile; } void AVGlobals::SetAnimation() { animation = true; } bool AVGlobals::IsAnimation() { return animation; } Box AVGlobals::GetBoxFromCommandLine() { return comlinebox; } void AVGlobals::SetMaxPictureSize(int maxpicsize) { maxPictureSize = maxpicsize; } int AVGlobals::MaxPictureSize() { return maxPictureSize; } int AVGlobals::MaxPaletteIndex() { return maxPaletteIndex; } void AVGlobals::SetVerbose() { verbose = true; } bool AVGlobals::Verbose() { return verbose; } int AVGlobals::GetFileCount() { return fileCount; } int AVGlobals::SleepTime() { return sleepTime; } int AVGlobals::GetMaxLevel() { return maxLevel; } bool AVGlobals::UseMaxLevel() { return useMaxLevel; } const string &AVGlobals::GetComlineFilename(int i) { return comlinefilename[i]; } FileType AVGlobals::GetDefaultFileType() { return fileType; } bool AVGlobals::GivenBox() { return givenBox; } bool AVGlobals::GivenBoxSlice() { return givenBoxSlice; } bool AVGlobals::MakeSWFData() { return makeSWFData; } bool AVGlobals::MakeSWFLight() { return makeSWFLight; } bool AVGlobals::LowBlack() { return lowBlack; } bool AVGlobals::DumpSlices() { return dumpSlices; } bool AVGlobals::SliceAllVars() { return sliceAllVars; } bool AVGlobals::GivenFilename() { return givenFilename; } void AVGlobals::SetBoundaryWidth(int width) { boundaryWidth = width; } int AVGlobals::GetBoundaryWidth() { return boundaryWidth; } void AVGlobals::SetSkipPltLines(int nlines) { skipPltLines = nlines; } int AVGlobals::GetSkipPltLines() { return skipPltLines; } void AVGlobals::SetBoxColor(int boxcolor) { boxColor = boxcolor; } int AVGlobals::GetBoxColor() { return boxColor; } Array< list > &AVGlobals::GetDumpSlices() { return dumpSliceList; } int AVGlobals::GetFabOutFormat() { return fabIOSize; } bool AVGlobals::UseSpecifiedMinMax() { return specifiedMinMax; } void AVGlobals::SetSpecifiedMinMax(Real specifiedmin, Real specifiedmax) { specifiedMin = specifiedmin; specifiedMax = specifiedmax; } void AVGlobals::GetSpecifiedMinMax(Real &specifiedmin, Real &specifiedmax) { specifiedmin = specifiedMin; specifiedmax = specifiedMax; } // ------------------------------------------------------------------- int AVGlobals::CRRBetweenLevels(int fromlevel, int tolevel, const Array &refratios) { BL_ASSERT(fromlevel >= 0); BL_ASSERT(tolevel >= fromlevel); BL_ASSERT(tolevel <= refratios.size()); int level, rr = 1; for(level = fromlevel; level < tolevel; ++level) { rr *= refratios[level]; } return rr; } // ------------------------------------------------------------------- int AVGlobals::DetermineMaxAllowableLevel(const Box &finestbox, int finestlevel, int maxpoints, const Array &refratios) { BL_ASSERT(finestlevel >= 0); BL_ASSERT(maxpoints >= 0); BL_ASSERT(finestbox.ok()); Box levelDomain(finestbox); int maxallowablelevel(finestlevel); unsigned long boxpoints; while(maxallowablelevel > 0) { # if (BL_SPACEDIM == 2) boxpoints = levelDomain.length(XDIR) * levelDomain.length(YDIR); # else unsigned long tempLength; boxpoints = (unsigned long) levelDomain.length(XDIR) * (unsigned long) levelDomain.length(YDIR); tempLength = (unsigned long) levelDomain.length(YDIR) * (unsigned long) levelDomain.length(ZDIR); boxpoints = max(boxpoints, tempLength); tempLength = levelDomain.length(XDIR) * levelDomain.length(ZDIR); boxpoints = max(boxpoints, tempLength); # endif if(boxpoints > maxpoints) { // try next coarser level --maxallowablelevel; levelDomain = finestbox; levelDomain.coarsen (CRRBetweenLevels(maxallowablelevel, finestlevel, refratios)); } else { break; } } return(maxallowablelevel); } // ------------------------------------------------------------------- // this function strips slashes to try to find the true file name // so: /d/e/f/pltname/ would return pltname // ------------------------------------------------------------------- string AVGlobals::StripSlashes(const string &inString) { string sTemp; string::size_type startString, endString; endString = inString.find_last_not_of('/'); startString = inString.find_last_of('/', endString); if(startString == string::npos) { // no slashes found startString = 0; } else { // skip over the last one found ++startString; } sTemp = inString.substr(startString, (endString - startString + 1)); return sTemp; } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/FABUTIL_2D.F0000644000175000017500000002533411634153073021031 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c ::: SCCS stuff "@(#)FABUTIL_2D.F 3.1\t6/25/93" #define FORT_CINTERP cinterp2d #define FORT_PCINTERP pcinterp2d #include "REAL.H" #include "CONSTANTS.H" c ::: -------------------------------------------------------------- subroutine FORT_CINTERP (fine,floi1,floi2,fhii1,fhii2, fblo,fbhi, $ nvar,lratio, crse,clo,chi,cblo,cbhi,fslo,fshi, cslope,clen, $ fslope,fdat,flen,voff) integer floi1,floi2, fhii1,fhii2 integer fblo(2), fbhi(2) integer cblo(2), cbhi(2) integer fslo(2), fshi(2) integer lratio, nvar, clen, flen, clo, chi REAL_T fine(floi1 :fhii1 ,floi2 :fhii2, nvar) REAL_T crse(clo:chi, nvar) REAL_T cslope(clo:chi, 2) REAL_T fslope(flen, 2) REAL_T fdat(flen) REAL_T voff(flen) c ::: NOTE: data must be sent in so that c ::: cslope(1,*) and crse(1,*) are associated with c ::: the same cell c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: cinterp: conservative interpolation from coarse grid to c ::: subregion of fine grid defined by (fblo,fbhi) c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: nvar => (const) number of variables in state vector c ::: lratio => (const) refinement ratio between levels c ::: c ::: crse => (const) coarse grid data widended by 1 zone c ::: and unrolled c ::: clo,chi => (const) one dimensional limits of crse grid c ::: cslo,cshi => (const) coarse grid index limits where c ::: slopes are to be defined. This is c ::: the projection of (fblo,fbhi) down c ::: to the coarse level c ::: fslo,fshi => (const) fine grid index limits where c ::: slopes are needed. This is the c ::: refinement of (cslo,cshi) and c ::: contains but may not be identical c ::: to (fblo,fbhi). c ::: cslope => (modify) temp array coarse grid slopes c ::: clen => (const) length of coarse gtid slopes c ::: fslope => (modify) temp array for fine grid slope c ::: flen => (const) length of fine grid slope array c ::: fdat => (const) temp array for fine grid data c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: local var integer n, fn integer i, ic, ioff integer j, jc, joff integer ist, jst REAL_T hafrat, volratio REAL_T cen, forw, back, slp REAL_T xoff, yoff integer ncbx, ncby integer ncsx, ncsy integer islo, jslo integer icc, istart, iend integer lenx, leny, maxlen hafrat = half*float(lratio-1) volratio = one/float(lratio) ncbx = cbhi(1)-cblo(1)+1 ncby = cbhi(2)-cblo(2)+1 ncsx = ncbx+2 ncsy = ncby+2 ist = 1 jst = ncsx islo = cblo(1)-1 jslo = cblo(2)-1 lenx = fbhi(1)-fblo(1)+1 leny = fbhi(2)-fblo(2)+1 maxlen = max(lenx,leny) if (maxlen .eq. lenx) then do 100 i = fblo(1), fbhi(1) fn = i-fslo(1)+1 ioff = mod(fn-1,lratio) voff(fn) = float(ioff)-hafrat 100 continue else do 110 j = fblo(2), fbhi(2) fn = j-fslo(2)+1 joff = mod(fn-1,lratio) voff(fn) = float(joff)-hafrat 110 continue end if do 120 n = 1, nvar c ::: ::::: compute slopes in x direction do 130 i = 1, clen cen = half*(crse(i+ist,n)-crse(i-ist,n)) forw = crse(i+ist,n)-crse(i,n) back = crse(i,n)-crse(i-ist,n) slp = sign(one,cen)*min(abs(cen),abs(forw),abs(back)) cslope(i,1)=cvmgp(slp,zero,forw*back) 130 continue c ::: ::::: compute slopes in y direction do 140 i = 1, clen cen = half*(crse(i+jst,n)-crse(i-jst,n)) forw = crse(i+jst,n)-crse(i,n) back = crse(i,n)-crse(i-jst,n) slp = sign(one,cen)*min(abs(cen),abs(forw),abs(back)) cslope(i,2)=cvmgp(slp,zero,forw*back) 140 continue if (maxlen .eq. lenx) then do 150 jc = cblo(2), cbhi(2) c ::: ..,.......::::: strip out a fine grid slope vector do 160 ioff = 1, lratio icc = clo + ist + jst*(jc-jslo) istart = ioff iend = ioff + (ncbx-1)*lratio do 170 fn = istart, iend, lratio fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fdat(fn) = crse(icc,n) icc = icc + ist 170 continue 160 continue do 180 joff = 0, lratio-1 j = lratio*jc + joff if (j .lt. fblo(2)) then goto 180 c --- next --- end if if (j .gt. fbhi(2)) then goto 181 c --- break --- end if yoff = float(joff)-hafrat do 190 i = fblo(1), fbhi(1) fn = i-fslo(1)+1 fine(i,j,n) = fdat(fn) + volratio* (voff(fn)* $ fslope(fn,1)+yoff*fslope(fn,2)) 190 continue 180 continue 181 continue 150 continue else do 200 ic = cblo(1), cbhi(1) c ::: ..,.......::::: strip out a fine grid slope vector do 210 joff = 1, lratio icc = clo + ist*(ic-islo) + jst istart = joff iend = joff + (ncby-1)*lratio do 220 fn = istart, iend, lratio fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fdat(fn) = crse(icc,n) icc = icc + jst 220 continue 210 continue do 230 ioff = 0, lratio-1 i = lratio*ic + ioff if (i .lt. fblo(1)) then goto 230 c --- next --- end if if (i .gt. fbhi(1)) then goto 231 c --- break --- end if xoff = float(ioff)-hafrat do 240 j = fblo(2), fbhi(2) fn = j-fslo(2)+1 fine(i,j,n) = fdat(fn) + volratio* (xoff* $ fslope(fn,1)+voff(fn)*fslope(fn,2)) 240 continue 230 continue 231 continue 200 continue end if 120 continue return end c ::: -------------------------------------------------------------- subroutine FORT_PCINTERP (fine,floi1,floi2,fhii1,fhii2,fblo, fbhi,lrat, $ nvar, crse,cloi1,cloi2,chii1,chii2,cblo, cbhi,temp,tloi,thii) integer floi1,floi2 integer fhii1,fhii2 integer cloi1,cloi2 integer chii1,chii2 integer fblo(2), fbhi(2) integer cblo(2), cbhi(2) integer lrat, nvar, tloi, thii REAL_T fine(floi1 :fhii1 ,floi2 :fhii2, nvar) REAL_T crse(cloi1 :chii1 ,cloi2 :chii2, nvar) REAL_T temp(tloi:thii + 1) c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: pcinterp: use piecewise constant interpolation to define c ::: values on the subregion of the fine FAB defined c ::: by (fblo,fbhi). c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fab to get interpolated values c ::: flo,fhi => (const) index limits of fine c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: crse => (const) fab holding coarse grid values c ::: clo,chi => (const) index limits of src c ::: cblo,cbhi => (const) subregion of coarse grid holding values c ::: temp => (modify) temporary space for vectorization c ::: tlo,thi => (const) index limits of temp space c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: local var integer i,j,k,ic,jc,kc,ioff,n integer ixproj,ii,ll ixproj(ii,ll) = (ii + ll*iabs(ii))/ll - iabs(ii) do 120 j = fblo(2), fbhi(2) jc = ixproj(j,lrat) do 130 n = 1, nvar do 140 ioff = 0, lrat-1 do 150 ic = cblo(1),cbhi(1) i = lrat*ic + ioff temp(i) = crse(ic,jc,n) 150 continue 140 continue do 160 i = fblo(1), fbhi(1) fine(i,j,n) = temp(i) 160 continue 130 continue 120 continue return end subroutine cartgridminmax2d (data, lo1, lo2, hi1, hi2, $ vfracdata, vfeps, dmin, dmax) implicit none integer lo1, lo2, hi1, hi2 REAL_T data(lo1:hi1 ,lo2:hi2) REAL_T vfracdata(lo1:hi1 ,lo2:hi2) REAL_T vfeps, dmin, dmax integer i, j dmax = -bigreal dmin = bigreal do 420 j = lo2, hi2 do 430 i = lo1, hi1 c print *, "i j vfracdata(i,j) = ",i,j,vfracdata(i,j) if ( .not. (vfracdata(i,j).lt.vfeps)) then dmax = max(dmax,data(i,j)) dmin = min(dmin,data(i,j)) endif 430 continue 420 continue return end ccseapps-2.5/CCSEApps/pAmrvis/Docs/0000755000175000017500000000000011634153073020170 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/pAmrvis/Docs/Amrvis.tex0000644000175000017500000000025211634153073022152 0ustar amckinstryamckinstry\documentclass{article} \title{Amrvis 2.52 User's Guide} \author{Vince Beckner} \date{Oct. 23, 1998} \begin{document} \maketitle \include{AmrvisBody} \end{document} ccseapps-2.5/CCSEApps/pAmrvis/Docs/AmrvisBody.tex0000644000175000017500000006115411634153073023000 0ustar amckinstryamckinstry\section{Amrvis} \subsection{Overview} {\em Amrvis} is a visualization and data analysis tool for examining data files generated by the Adaptive Mesh Refinement ({\bf AMR}) code. The user can view color planar images of the data, {\bf AMR} grid regions, data values in a chosen format, subregions, animations, volumetric renderings, and output in postscript. {\em Amrvis} works for 2D and 3D data, requires no specialized graphics hardware, and can run in parallel on both SMP and distributed memory parallel machines. It also has batch capabilities for extracting arbitrary subregions (including rectangular regions, planes, lines, and points) from data files and preprocessing volume renderings. Batch capabilities also work in parallel. A separate tool, {\em AmrMovie}, can be used to view, animate, and output volume renderings. This tool can animate volume data (which has been preprocessed with {\em Amrvis}) at arbitrary orientations and through time. Another separate tool, {\em AmrDerive}, can be used to create additional plot files from existing plot files. The new plot files can consist of data from the original plot file and quantities derived from data in the original plot file. This creates a new plot file which can be viewed with {\em Amrvis}. \subsection{Using Amrvis} \subsubsection{Command Line Interface and Utility Files} From the command line, the user can start {\em amrvis} with or without data (or plot) files and can perform batch operations to extract data. The simplest usage is to type {\em amrvis} at the command line with no arguments. This will start the main window from which the user can open data files or quit the application. Using the {\bf -help} argument will cause {\em amrvis} to print a usage message and exit. The usage is currently \begin{verbatim} amrvis3d [] [-v] [-maxpixmapsize ] [-xslice n] [-yslice n] [-zslice n] [-sliceallvars] [-boxslice xlo ylo zlo xhi yhi zhi] [-fabiosize nbits] [-maxlev n] [-palette palname] [-initialderived dername] [-lightingfile name] [-initialscale n] [-showboxes tf] [-numberformat fmt] [-lowblack] [-cliptoppalette] [-fixdenormals] [-boxcolor n] [-makeswf_light] [-makeswf_value] [-useminmax min max] [] file type flags: -fab, -multifab, -newplt (-newplt is the default) -v verbose. -maxpixmapsize n specify maximum allowed picture size in pixels. -skippltlines n skip n lines at head of the plt file. -boxcolor n set volumetric box color value [0,255]. -xslice n write a fab slice at x = n (n at the finest level). -yslice n write a fab slice at y = n (n at the finest level). -zslice n write a fab slice at z = n (n at the finest level). -sliceallvars write all fab variables instead of just initialderived. -boxslice _box_ write a fab on the box (box at the finest level). box format: lox loy loz hix hiy hiz. example: -boxslice 0 0 0 120 42 200. Note: slices are written in batch mode. -fabiosize nbits write fabs with nbits (valid values are 8 and 32. the default is native (usually 64). -maxlev n specify the maximum drawn level. -palette palname set the initial palette. -lightingfile name set the initial lighting parameter file. -initialderived dername set the initial derived to dername. -initialscale n set the initial scale to n. -showboxes tf show boxes (the value of tf is true or false). -numberformat fmt set the initial format to fmt (ex: %4.2f). -lowblack sets the lowest color in the palette to black. -cliptoppalette do not use the top palette index (for exceed). -fixdenormals always fix denormals when reading fabs. -makeswf_light make volume rendering data using the current transfer function and write data to a file, using the lighting model. note: works in batch mode. -makeswf_value same as above, with value model rendering. -useminmax min max use min and max as the global min max values must be included if box is specified. \end{verbatim} File type flags are as defined as follows. Once a file type is specified, it cannot be changed for that {\em amrvis} process. For MultiFabs, the name can be specified with or without the "\_H" in the name. \begin{verbatim} -newplt The new directory based plotfile format (the default). -fab An FArrayBox. -multifab A MultiFab written with VisMF (multiple files). \end{verbatim} If the useminmax option is specified, the USERMINMAX range type is set and the min amd max values are set to the user specified values for the initialderived name (if set), or the first quantity in the plot file if no initial derived value is used or if the initial derived name is invalid. {\em Amrvis} looks for a default definition file named {\bf amrvis.defaults} and if it exists, uses its options as defaults. If the file does not exist, {\em amrvis} uses standard defaults. See the section {\bf Files and Directories} for a complete description of the default options. The search path for {\bf amrvis.defaults} is (in this order): \begin{verbatim} ./amrvis.defaults ~/amrvis.defaults ~/.amrvis.defaults \end{verbatim} \subsubsection{Interface Windows and Regions} \begin{description} \item[Main Window] This is the small window used to open data files or quit the main application. It also prints messages on which file is being read and values for clicked data points. There is only one of these windows per {\em amrvis} application. \item[Data View Window] This is the window used to view and interact with a data file or subregion of a data file. It contains the color image, the palette, and data manipulation controls. \item[Control Area] This is the area at the top of the Data View Window which contains controls for selecting current scale, current quantity, datasets, subregions, and output. \item[Data Image Area] This area shows the color image of the dataset. In 3D, this area is split into four sections--the three orthogonal planes and an isometric view. \item[Palette Area] This area shows the palette which maps data values to colors and shows the high and low data values that are currently mapped. \item[Dataset Window] This window shows data values and is invoked with the Dataset button on the currently selected subregion. Indicies are displayed for each available level. If the user clicks on a data point in the Dataset window, a box will be drawn around the corresponding data point in the Data Image Area (the color data image). \item[Animation Control Area] This area contains controls for animating through data files and through planes in 3D. It is in the lower right part of the Data View Window below the Palette Area. It also shows plane axes. The animation controls will only be visible in 3D or if the Data View Window is used for 2D animation. \item[Number Format Window] This window is used to set the format of displayed numbers and affects the palette, dataset, point values, and the range window. \item[Lights Window] This window allows the user to set the following lighting parameters. \begin{description} \item [ambient] Sets the ambient lighting value. \item [diffuse] Sets the diffuse lighting value. \item [specular] Sets the specular lighting value. \item [shiny] Sets the material shinyness. \item [minRayOpacity] Sets the minimum ray opacity cutoff. The minimum value for this parameter is 0.0. A good value is 0.05. \item [maxRayOpacity] Sets the maximum ray opacity cutoff. The maximum value for this parameter is 1.0. A good value is 0.95. \end{description} \end{description} \subsubsection{Interface Controls} \begin{description} \item[Scale Menu] This menu controls the current image scale. At scale 1, a datapoint at the finest displayed level is mapped to a pixel. The {\em maxpixmapsize} variable largely determines the maximum scale available in this menu. \item[Level Menu] This menu allows viewing data on coarser levels. The values shown are in the form {\em CurrentLevel/FinestPlotFileLevel}. Note that the range of values for {\em CurrentLevel} may be greater than zero on the low end and less than {\em FinestPlotFileLevel} on the high end indicating that the maximum picture size is limiting the image sizes and level range. See the section on {\bf Subregions} for more details. \item[Quantity Menu] This menu allows the user to select the current quantity and is built from information contained in the plot file. \item[Dataset Button] This button creates a Dataset Window for the currently selected region. {\em A region must be selected before pressing this button. If a region has not been selected, the dataset will not appear.} \item[Subregion Button] This button creates a new Data View Window for the data contained in the currently selected region. {\em A region must be selected before pressing this button. If a region has not been selected, the subregion will not appear.} \item[Palette Button] This button allows the user to select a new palette. \item[Boxes Button] This button toggles showing {\bf AMR} boxes. \item[Output Menu] This menu allows output of the current image(s) or data to one of several formats. \item[Contour Menu] This menu controls how data is displayed. Current options are {\em raster}, {\em raster \& contours}, {\em color contours}, {\em b/w contours}, and {\em velocity vectors}. \item[Number of Contour Lines] This edit box allows the user to set the number of contour lines or velocity vectors. \item[Information Button] This button displays a window with information about the plot file. \item[Close Button] This button destroys the Data View Window. \item[Set Range Button] This button allows the user to set the color mapping range of the data. \item [Isometric View Buttons] These control the view point and scaling of the isometric image in 3D (boxes or volumetric rendering). \begin{description} \item [0] Reset the viewing angle to the original view. \item [XYZ] Draw axis labels. \item [Draw] Draw the volume rendered image. This may entail creating internal data structures and could take several seconds to minutes for the first frame to draw. \item [Autodraw] Automatically render the image while rotating. As with {\bf Draw}, the first image takes longer. \item [Trans] Reread the transfer functions. \item [Lights] Allows the user to set the rendering lighting parameters. \item[Light/Value] This menu shows the volume rendering model currently in effect. \item[PC/OT] This menu affect how the volume rendering stores data internally (PreClassified/OctTree). PreClassified provides the fastest volume rendering. \item [Detach] Detach the isometric view into its own window. \item [Attach] Attach the isometric view. \end{description} \end{description} \subsubsection{Mouse Controls} \begin{description} \item [Left Button] Selecting from menus, clicking buttons and animation controls, drawing subregions in a view for datasets and subvolumes, spinning the image in the isometric view, translating the image in the isometric view (with the shift button pressed), and clicking a point for its data value. \item [Middle Button] Placing horizontal planar cutting lines in the orthogonal image views and rotating around the eye point in the isometric view. \item [Right Button] Placing vertical planar cutting lines in the orthogonal image views and zooming the isometric view (pull or push the mouse). \end{description} \subsubsection{Batch Functions} \begin{description} \item [Slices] The user can specify multiple slices and ranges on the command line. For example: {\em amrvis -newplt -xslice 7 -xslice 42 -yslice 19 -zslice 9 plt1010}. This will create four fab files of the form {\em pltnnnn.derived.slicename.slicenum.fab} where derived is {\em initialderived} from {\bf amrvis.defaults}. In this example, the first file will be (assuming pressure) {\bf plt1010.pressure.xslice.7.fab}. The user can also specify ranges with the syntax ``start-end'' For example: {\em -yslice 7-42} will create a fab file for each slice in the range [7,42]. Slices are specified on the finest level problem domain. The option {\em -sliceallvars} can be specified to write all fab variables instead of just the {\em initialderived}. The user can specify multiple plot files as usual: plt05* If a {\bf zslice} is specified in 2D, {\em amrvis} will use zslice = 0 (regardless of the slice number specified), which is the entire dataset for the current derived quantity. An {\bf xslice} or {\bf yslice} in 2D creates a strip one cell wide. Slices are supported for any type of data {\em amrvis} can read including fabs, which includes fabs created by slicing. This allows extraction of planes, lines, and points from a dataset. Fab slices have the same {\bf BL\_SPACEDIM} as the original dataset. A slice from a 3D dataset is a 3D fab one cell thick. Note: if a slice of a dataset is created then viewed with {\em amrvis -fab}, the picture may not look the same as the original because the dynamic range of the fab might be smaller than that of the entire data set. The {\bf Set Range} button can be used to set the same values in both images to get the same picture. This feature operates in batch mode. {\em amrvis} will write out all requested slices for all files then exit. \item [Making Volumetric Data Files] Use the {\bf -makeswf\_light} and {\bf -makeswf\_value} options to write a data file for fast volume rendering. This option uses the transfer function from the palette and either the value model or lighting model. The files are postprocessed with {\em AmrMovie}. \end{description} \subsection{Detailed Usage Notes} \begin{description} \item [Subregions] Subregions work functionally like the full region, and the main region can be closed while retaining the subregion. For deep files, the maximum level displayed is based on {\em maxpixmapsize} and a smaller subregion must be selected to view finer levels. A region must be selected before the {\bf Subregion} button is pressed. {\em Amrvis} reference counts plot file data, so subregions do not significantly increase maximum memory usage. See the section on demand driven I/O for more detail. \item [Datasets] The dataset will update its values when the derived quantity changes. The user can also select another region and click on dataset (with a dataset window already showing) and it will update that window. A region must be selected before the {\bf Dataset} button is pressed. Clicking with the left mouse button on a value in the dataset window will draw a box around the corresponding point in the color image view. \item [File Type] Once a file type is specified (-fab, -multifab, -newplt), it cannot be changed for that {\em amrvis} process. \item [Animations] During animations, pressing the {\bf O} button in the center of the animation controls will stop frame creation. {\em amrvis} will automatically calculate the data range over the file set or the range can be specified with the {\bf Set Range} button. In {\bf Set Range} for animations, the {\em File} option sets the minimum and maximum to the values for the current data file instead of the values over the entire set of data files. The arrows move single frames for single clicks and animate for double clicks. Animation works with all supported formats and with subregions. Animation across files within {\em amrvis} is supported in 2D only. For 2D animations, the {\bf rgb} button will write an rgb file for the current image and advance to the next frame (for single clicks) or animate through the frames and write an rgb file for each frame automatically (for double clicks) until the {\bf O} button is pressed. File names are generated automatically and are of the form {\em quantity.nnnn.rgb} where {\em quantity} is the current derived quantity and {\em nnnn} is the plot file number (0123 for plt0123). For animations across files in 3D, use {\em AmrMovie}. \item [Palettes] Palettes are in Non-interleaved Binary format and can be created with tools such as {\em icol} from {\bf AHPCRC} or {\em ximage} from {\bf NCSA}. The transfer function (which specifies transparency in the volumetric rendering) is included in the palette (they were formerly set in {\bf vpramps.dat}). The {\bf CCSE} version of {\em icol} must be used to create palettes with transfer functions. If the palette does not contain the transfer function values, a default will be used. \item [Number Format] The format for numbers (which is set in the {\bf Number Format} window) affects numbers in the dataset, the set range dialog box, and the palette. The format value can be any valid {\bf printf} string. Hit the {\bf return} key after editing the string to apply. \item [Partial colormap support] The {\em reservesystemcolors} keyword in {\bf amrvis.defaults} lets the user decide how many colors to reserve from the palette. Experiment with the terminal to determine a satisfying number, try 20 to start. This works by chopping off the lower parts of the palette and remapping the image to the new colormap. \item [Visual support] {\em amrvis} uses an eight bit Pseudocolor visual, regardless of the current default visual. \end{description} \subsection{Files and Directories} {\em Amrvis} looks for the file {\bf amrvis.defaults} to set default values. If this file does not exist, {\em amrvis} will use standard default values. The {\bf amrvis.defaults} file has the following structure and options (in general: {\em keyword value}). \begin{verbatim} palette Palette initialderived density initialscale 4 numberformat %7.5f maxpixmapsize 1000000 reservesystemcolors 20 showboxes TRUE windowheight 650 windowwidth 900 filetype fab filetype newplt cliptoppalette \end{verbatim} Invalid values are ignored. The {\em initialderived} specifies the quantity that is displayed first and must be spelled exactly as it appears in the data file or the value will default to the first derived quantity. {\em numberformat} affects the dataset and palette values and can be any valid {\bf printf} string. {\em windowheight} and {\em windowwidth} define the size of the {\bf Data View Window} with arguments in number of pixels. {\em showboxes} affects initial drawing of {\bf AMR} grid boxes. Valid values are {\bf TRUE} or {\bf FALSE}. {\em filetype} specifies the type of file (same values as the command line). {\em cliptoppalette} forces {\em amrvis} to not use the top palette entry (this option is for exceed users). For duplicate keywords, the last one in the file is used (for example, {\bf newplt} will be the {\em filetype} in the above file). Command line settings override settings in {\bf amrvis.defaults}. The search path for {\bf amrvis.defaults} is (in this order): \begin{verbatim} ./amrvis.defaults ~/amrvis.defaults ~/.amrvis.defaults \end{verbatim} {\em Amrvis} also looks for the file {\bf amrvis.lighting} in the current directory to set default lighting values for volume rendering. If this file does not exist, {\em amrvis} will use standard default values. The name of this file can be specified on the command line. An example file might look like the following. \begin{verbatim} ambient 0.42 diffuse 0.41 specular 0.40 shiny 12.0 minRayOpacity 0.04 maxRayOpacity 0.96 \end{verbatim} Note: For volume rendering, the {\em VolPack} library from Stanford University must be linked with {\em amrvis}. It currently can be obtained from \begin{verbatim} http://www-graphics.stanford.edu/software/volpack \end{verbatim} {\em Amrvis} has been tested with {\bf VolPack} version 1.0beta3 (the latest release). \subsection{Examples} Typical usage is as follows. Be sure to use the correct file type flag. \begin{verbatim} amrvis opens the main window with default file type (-newplt). amrvis -newplt opens the main window with file type set to -newplt. amrvis -newplt plt1560 opens plt1560 (which is a new plot file). amrvis -fab *.fab opens multiple fab files in separate windows. amrvis -a plt* opens an animation for plt* (2D only). \end{verbatim} \subsection{Technical Details} \subsubsection{Parallel Implementation} {\em amrvis} runs in parallel on both shared memory an distributed memory multiprocessor architectures using parallel BoxLib and the SPMD programming model. The interface runs on processor zero (the I/O processor) and parallel DataServices runs on all processors and handles data requests from the {\em amrvis} interface. \subsubsection{Demand Driven I/O} Data from a plot file is read from disk only when required to create an image in {\em amrvis}. The granularity for I/O is a single quantity of an FArrayBox within a MultiFab. Within {\em amrvis}, data on a grid for the current quantity is read from disk only if it intersect the current image plane within the current subvolume, is less than or equal to the maximum available level, and has not already been read (FABs are cached). \subsection{Efficiency Notes} \begin{itemize} \item For best performance of {\em amrvis} (and in general when accessing files), copy data files to local disk instead of relying on a slow network connection. \item In 3D, select a subregion to volume render so {\em amrvis} can render fewer points. \end{itemize} \subsection{FAQ} \begin{itemize} \item For data sets and subregions, a region must be selected (with the left mouse button) before clicking on {\bf Dataset} or {\bf Subregion.} \item If {\em amrvis} hangs trying to read a plot file, make sure the file type flag is set correctly for your plot files. \item Once you pick a file type (-fab, -multifab, -newplt), you cannot change it for that {\em amrvis} process. \item Plot files have a new directory based format. The old single file format is not supported. \item Names in the quantiy list (density, xmom, etc.) must be unique. \item If you change the user defined min or max values in the range window, you must also select the {\bf User} radio button before you press the {\bf Apply} button or the user range will not be set. \item {\em amrvis} takes background and lettering colors from the {\bf .Xdefaults} file. To modify these, add the following lines to {\bf .Xdefaults} \begin{verbatim} #ifdef COLOR amrvis*Background: black amrvis*Foreground: white #endif \end{verbatim} then type \begin{verbatim} xrdb ~/.Xdefaults \end{verbatim} to update the X database. This will turn the {\em amrvis} background to black and the lettering white (or whatever colors are chosen). \end{itemize} \subsection{Known Problems} \begin{itemize} \item The numbers in the Palette can go off the right edge of the window for long formats. \item There is a resource allocation issue to be aware of-- {\bf amrvis.defaults} defines {\em initialscale} and {\em maxpixmapsize}. {\em maxpixmapsize} defines the maximum number of bytes allowed to allocate on the xterm for a pixmap (where the color picture lives) and {\em amrvis} uses this to decide the finest level it can display. It finds displayLevel by: \( (probDomain(displayLevel).numPts() * {scale^{2}}) \leq maxpixmapsize \) The problem is this: if the pixmap size is below but close to the available server memory, the pixmap may be allocated properly but other {\bf X} allocations, such as server memory for a button or menu, may fail. This causes {\em amrvis} to die unpredictably with a core dump or an {\bf X} message about unavailable resources. So if this behavior happens, adjust {\em maxpixmapsize} and {\em initialscale} values to about half of the xterm's available memory. \item Animations for plot files with different finest levels of refinement do not work properly. \item If you specify the wrong plot file type, the behavior is undefined. Usually, {\em amrvis} will do one of three things: open the file with bad numbers (Reals interpreted with the wrong byte ordering), crash, or hang by trying to read the file forever. \item When the file range for animations is set and the user derives a different quantity, the global range value contains the value for the current file and not the set of files in the animation. \item A fatal error with a single plot file will cause the whole application to exit. \item There are several places where redundant exposure events cause poor performance. \item The selection box does not persist during animations. \item The colormap does not always install properly when using twm. \end{itemize} ccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/0000755000175000017500000000000011634153073022561 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/releasenotes.1.10000644000175000017500000000453111634153073025476 0ustar amckinstryamckinstryAmrvis version 1.1 release notes. The major changes for this release are better support for deep (many level) data sets and level menu functionality that comes closer to how I feel it should work. Other changes include consolidation of some defaults and command line settings and a few bug fixes. Details follow. In amrvis 1.0, subregions were restricted to a multiple of a coarse level cell. This became a problem in 3D because even a single coarse cell expanded to the finest level was very large for deep data sets. In amrvis 1.1, subregions are restricted to what I term the finestContainingLevel, which is the finest level that has grids which completely contain the subregion (the complement is null). The level menu for a subregion will show only levels in the range [finestContainingLevel, maxAllowableLevel]. The maxAllowableLevel is the maximum level which can be displayed based on the maxpixmap size. Volume rendering is done on maxAllowableLevel. FArrayBox output is done on the current displayed level (the value in the level menu). Animations work on the currenly displayed level. The dataset also works at maxAllowableLevel, where the smallest boxes containing data are at maxAllowableLevel. The file type (cgmf, sf, etc.) can now be set in amrvis.defaults with the keyword filetype (for example, filetype sf). Valid values are the same as the command line values without the dash (cgmf, cgsf, mf, sf, old2, iamr, cgiamr, boxdata, boxchar, fab). Byte ordering can be specified on the command line with one of the following: -sgi, -alpha, or -reverse2 (same values as in amrvis.defaults, but with dashes). Command line settings override amrvis.defaults settings. A more visible message is printed out by amrvis to show which byte ordering and filetype are used. I have versions of amrvis 1.1 on the C90 (a.nersc) and the J90 (k.nersc). See me if you need them. Also, I can compile special versions for HDF support, volume rendering using a value model instead of a lighting model, and volume rendering with grids in the flow. Bug fixes: The problem with a constant field in the dataset is fixed. The problem of the highest data value in the palette window sometimes not matching the highest data value in the dataset is fixed. This was a roundoff issue in the Palette display. The problem of occasional misaligned grids for 2d datasets is fixed. ccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/releasenotes.2.540000644000175000017500000000235111634153073025565 0ustar amckinstryamckinstry Amrvis version 2.54 release notes. --------------------------------------------------------------------------- -------------------------------------------------------------- New Features I added the ability to view multifabs (-multifab on the command line). MultiFabs must be written in the new multiple file format. I added the capability to use velocities in addition to momentums for drawing velocity vectors. The quantities must have names in one of the following forms in the plot file: x_velocity xvel x_vel x_momentum xmom x_mom density (must exist if using momentums) Amrvis confirms all quantities are available to calculate velocity vectors. If all quantities are not available, the "velocity vector" option will not appear on the display menu. If velocities and momentums are both available in the plot file, velocities will be used. --------------------------------------------------------------------------- ----------------------------------------------------------------- Bug Fixes I fixed a bug in the draw vector routine which showed up with small velocities. --------------------------------------------------------------------------- --------------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/releasenotes.1.20000644000175000017500000000040411634153073025472 0ustar amckinstryamckinstryAmrvis version 1.2 release notes. This is a minor addition update. Minor additions: The following are now available: -boxslice _box_ extract a subbox from a plot file (on the finest level) and create a fab. will work with sliceallvars ccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/releasenotes.1.1b0000644000175000017500000000161311634153073025636 0ustar amckinstryamckinstryAmrvis version 1.1b release notes. This is a minor bug fix and minor addition update. Bug fixes: The problem with smoothing Cartesian Grid bodies is fixed. The static behavior of the Smooth button is fixed. The file range crash for animations is fixed. Minor additions: The maximum possible scale is now set to 32. Most defaults that can be set in amrvis.defaults are now also settable at the command line. The following are now available: -palette palname set the initial palette. -initialderived dername set the initial derived to dername. -initialscale n set the initial scale to n. -showboxes tf show boxes (the value of tf is true or false). -numberformat fmt set the initial format to fmt (ex: %4.2f). -sliceallvars write all fab variables instead of just initialderived when slicing. ccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/releasenotes.2.510000644000175000017500000000171011634153073025560 0ustar amckinstryamckinstryAmrvis version 2.51 release notes. --------------------------------------------------------------------------- -------------------------------------------------------------- New Features This version adds a menu which allows the user to select raster (the familiar color image), raster with contour lines, color contours, black and white contours, and velocity vectors. An edit box has also been added to set the number of contour lines. An information button has been added which displays a window containing information about the plot file. A lighting button has been added which displays a window allowing the user to adjust lighting parameters for volume rendering. Transfer functions are now part of the palette (no more vpramps.dat). The CCSE version of icol must be used to create these new palettes. --------------------------------------------------------------------------- --------------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/releasenotes.2.50000644000175000017500000000767711634153073025521 0ustar amckinstryamckinstryAmrvis version 2.5 release notes. (This version number corresponds to BoxLib release 2.5). --------------------------------------------------------------------------- -------------------------------------------------------------- New Features This version can be run in parallel on both shared memory and distributed memory architectures. See the amrvis documentation for more detail. I/O of plot file data is implemented in parallel (if the machine's file system supports it). I/O of plot file data is demand driven. The granularity is a single quantity of a single FArrayBox within a MultiFab. Only the grids which are required are read. No flushing is currently done. Box indicies are shown in the Dataset (similar to ArrayView) and are hierarchical. The currently selected planes for each view are shown in the isometric grid view. For volume rendering, selection between the value model and the lighting model is now a runtime option accessible through an option menu. Translation of the isometric view (grids and the volume rendering) is now supported. Use the left mouse button while pressing the shift key. For 2D animations, there is a button ("rgb >") which will write an rgb file and advance to the next plotfile (for single clicks) and write rgb files for multiple plotfiles (for double clicks). It works like the advance forward (">") animation button and will stop animating and writing files when the stop ("O") button is clicked. There is now a separate program for deriving quantities from plotfiles. The program is named AmrDerive (see its documentation). There is also a separate program for converting old plot files to the new plot file format. The program is named PlotConvert (see its documentation). --------------------------------------------------------------------------- ------------------------------------------------------------- Major Changes Plot files now have a new directory based format to facilitate both parallel I/O and demand driven I/O. Old plot file formats (ex: cgmf, sf, etc.) are no longer supported. All plot files must be written in the new directory based format. Use PlotConvert to convert old plot files to the new format. Rotations in the isometric view (3D only) are implemented in a more intuitive frame of reference. The cursor which is shown in the data image area when the user clicks on a data value in the dataset window is now a box surrounding the data point. This feature is also optimized. The value model for volume rendering is optimized and has performance comparable to the lighting model. --------------------------------------------------------------------------- ------------------------------------------------------------- Minor Changes The boxes button is now implemented as a toggle button. The Dataset color button is now implemented as a toggle button. The ProjectionPicture "No Autodraw/Autodraw" button is now implemented as a toggle button. For postscript output of the palette, numbers are written as postscript text instead of bitmaps. Fab byte ordering is no longer a user settable parameter. New plot files and fabs know their byte ordering. --------------------------------------------------------------------------- ----------------------------- Features not in this version but coming soon. This version does not support the following plot file types: Cartesian grid (-cgmf -cgsf in old amrvis). Terrain. R Theta. --------------------------------------------------------------------------- ----------------------------------------------------------------- Bug Fixes Boxes in planar animations (3D) are now shown correctly. Quantity names with spaces (ex: X Velocity) are now supported. Visual support is correctly handled for displays using default visuals other than 8 bit Pseudocolor. --------------------------------------------------------------------------- --------------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/releasenotes.1.1a0000644000175000017500000000032311634153073025632 0ustar amckinstryamckinstryAmrvis version 1.1a release notes. This is a minor bug fix update. Bug fixes: The problem with picking a very small subregion for a deep dataset and the subregion showing only level zero values is fixed. ccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/releasenotes.2.530000644000175000017500000000065211634153073025566 0ustar amckinstryamckinstryAmrvis version 2.53 release notes. This is a quick bug fix release. --------------------------------------------------------------------------- ----------------------------------------------------------------- Bug Fixes I fixed the colormap problem for 24 bit displays. --------------------------------------------------------------------------- --------------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/releasenotes.2.520000644000175000017500000000452711634153073025572 0ustar amckinstryamckinstryAmrvis version 2.52 release notes. This is essentially a rerelease of 2.51--we went from KCC 3.3d to KCC 3.3e, which treats libraries differently from 3.3d. Since we deleted 3.3d, amrvis could not find its libraries and gave the following error: 11194:/usr/local/bin/amrvis3d: /sbin/loader: Fatal Error: cannot map libKCC-eh.so I also made a few changes. --------------------------------------------------------------------------- -------------------------------------------------------------- New Features This version adds a command line option to specify the format of fab output. This affects both the Output:Fab interactive function and the batch slicing functions. Valid values are 8 (which sets FABio::FAB_8BIT) and 32 (which sets FABio::FAB_IEEE_32). Native format is set if -fabiosize is not specified. -fabiosize nbits write fabs with nbits (valid values are 8 and 32. the default is native (usually 64). --------------------------------------------------------------------------- ------------------------------------------------------------- Minor Changes I deleted the -nprocs option. The number of processors is set by mpirun. For single processor runs on mothra and godzilla, mpirun is not required. --------------------------------------------------------------------------- ----------------------------------------------------------------- Bug Fixes I fixed a bug in contouring which only showed up when viewing fabs. --------------------------------------------------------------------------- ---------------------------------------------------------------- Known Bugs For amrvis2d -a, when making a subregion, the file scale goes back to the first plot file regardless of which file was displayed when the subretion was initiated. The subregioned image is the same one as the parent region (as it should be, so the file scale is incorrect). Just move the file scale to reestablish the connection. For amrvis2d -a, the info window shows info for the first file in the animation regardless of which one is displayed. Marc Day seems to be having a problem with the colormap not poping in on focus. It looks like the same problem that some users experienced with twm. --------------------------------------------------------------------------- --------------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Docs/ReleaseNotes/releasenotes.2.550000644000175000017500000000131011634153073025560 0ustar amckinstryamckinstry Amrvis version 2.55 release notes. --------------------------------------------------------------------------- -------------------------------------------------------------- New Features --------------------------------------------------------------------------- ----------------------------------------------------------------- Bug Fixes I fixed a bug that did not allow the "_H" to be in a multifab name specified on the command line. The user can specify the name with or without the "_H" on both the command line or within the Open File dialog box. --------------------------------------------------------------------------- --------------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/XYPlotWin.H0000644000175000017500000002106511634153073021272 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // --------------------------------------------------------------- // XYPlotWin.H // --------------------------------------------------------------- #ifndef _XYPLOTWIN_H_ #define _XYPLOTWIN_H_ #include #undef index #include using std::list; #include "AmrvisConstants.H" #include "XYPlotDataList.H" #include "XYPlotParam.H" #include "xgout.H" class PltApp; class GraphicsAttributes; class XYPlotParameters; #ifndef BUFSIZE #define BUFSIZE 1024 #endif #define LEFT_CODE 0x01 #define RIGHT_CODE 0x02 #define BOTTOM_CODE 0x04 #define TOP_CODE 0x08 #define BORDER_PADDING 5 #define AXIS_PADDING 5 #ifndef DBL_MAX #define DBL_MAX 1e300 #endif #define NUM_INIT_XSEGS 1000 #define PADDING 2 #define SPACE 10 #define TICKLENGTH 5 #define MAXLS 50 typedef struct attr_typ { char lineStyle[MAXLS]; int lineStyleLen; Pixel pixelValue; Pixmap markStyle; } AttrSet; class XYPlotWin; typedef void (XYPlotWin::*memberXYCB)(Widget, XtPointer, XtPointer); typedef struct legend_item_typ { XYPlotDataList *XYPLIlist; legend_item_typ *prev, *next; Widget wid, // For legend item drawingarea frame, // For drawingarea frame menu; // Popup menu for this item char drawQ; int style, color; Pixel pixel; #if (BL_SPACEDIM == 2) Array *anim_lists; Array *ready_list; #endif } XYPlotLegendItem; class XYPlotWin { public: XYPlotWin(char *title, XtAppContext app, Widget w, PltApp *parent, int type, int curr_frame = 0); ~XYPlotWin(); void AddDataList(XYPlotDataList *new_list, XYPlotLegendItem *insert_after = NULL); #if (BL_SPACEDIM == 2) void InitializeAnimation(int curr_frame, int num_frames); void UpdateFrame(int frame); void StopAnimation(void); #endif void PopUp(void) { XtPopup(wXYPlotTopLevel, XtGrabNone); } void SetPalette(void); private: XtAppContext appContext; Widget wTopLevel; PltApp *pltParent; char *pltTitle; XYPlotParameters *parameters; int whichType; Widget wXYPlotTopLevel; GraphicsAttributes *gaPtr; Display *disp; Visual *vis; Cursor cursor, zoomCursor; XFontStruct *labeltextFont, *titletextFont; GC titletextGC, labeltextGC, rbGC, segGC, dotGC; // Other important numbers. unsigned char zoomedInQ; XYPlotLegendItem *legendHead, *legendTail, *colorChangeItem; unsigned int numDrawnItems, numItems; unsigned char lineFormats[8]; unsigned int numXsegs; XSegment *Xsegs[2]; // parameters. unsigned char markQ, tickQ, axisQ, boundBoxQ; unsigned char plotLinesQ, saveDefaultQ, dispHintsQ; unsigned char animatingQ, tbool[7]; int lineW, gridW, dotW; char *XUnitText, *YUnitText, *formatX, *formatY; Pixel foregroundPix, backgroundPix, gridPix, textPix; param_style gridStyle; AttrSet AllAttrs[8]; xgOut devInfo; Widget wLegendMenu, wLegendButtons, wPlotWin; Widget wOptionsDialog, wExportFileDialog, wOptionsWidgets[13]; Window pWindow; Atom WM_DELETE_WINDOW; double dGridBase, dGridStep; double lloX, lloY; double hhiX, hhiY; // Global bounding box of window double loX, loY; double hiX, hiY; // Local bounding box of window double dUsrOrgX; double dUsrOrgY; // Origin of bounding box in user space double dUsrOppX; double dUsrOppY; // Other point of bounding box double dXUnitsPerPixel; // X Axis scale factor double dYUnitsPerPixel; // Y Axis scale factor int iXOrgX, iXOrgY; // Origin of bounding box on screen int iXOppX, iXOppY; // Other point defining bounding box int iXLocWinX, iXLocWinY, iCurrHint; #if (BL_SPACEDIM == 2) int numFrames; #endif int currFrame; void DoError(char *error_str) { fprintf(stderr, "%s\n", error_str); } void AddStaticCallback(Widget w, String cbtype, memberXYCB cbf, void *data = NULL); void AddStaticWMCallback(Widget w, Atom cbtype, memberXYCB cbf, void *data = NULL); void AddStaticEventHandler(Widget w, EventMask mask, memberXYCB cbf, void *data = NULL); static void StaticCallback(Widget, XtPointer, XtPointer); static void StaticEvent(Widget w, XtPointer client_data, XEvent *event, char*); void setBoundingBox (double lowX = 1.0, double lowY = 1.0, double highX = 0.0, double highY = 0.0); void updateBoundingBox(XYPlotDataList *list); void textX (Widget win, int x, int y, char *text, int just, int style); void segX(Widget win, int ns, XSegment *segs, int width, int style, int lappr, Pixel color); void dotX(Widget win, int x, int y, int style, int color); double initGrid(double low, double high, double step); double roundUp(double val); void writeValue(char *str, char *fmt, double val, int expv); void CalculateBox(void); void drawGridAndAxis(void); void clearData(void); void drawData(void); void drawHint(void); void CBdoInitializeListColorChange(Widget, XtPointer, XtPointer); void CBdoSetListColor(Widget, XtPointer, XtPointer); void CBdoExportFileDialog(Widget, XtPointer, XtPointer); void CBdoExportFile(Widget, XtPointer, XtPointer data); void CBdoASCIIDump(Widget, XtPointer, XtPointer data); void CBdoDrawPlot(Widget, XtPointer, XtPointer); void CBdoRedrawPlot(Widget, XtPointer, XtPointer); void CBdoDrawLegendItem(Widget, XtPointer data, XtPointer); void CBdoOptions(Widget, XtPointer, XtPointer); void CBdoOptionsToggleButton(Widget, XtPointer data, XtPointer); void CBdoOptionsOKButton(Widget, XtPointer data, XtPointer); void CBdoSelectDataList(Widget, XtPointer data, XtPointer); void CBdoClearData(Widget, XtPointer, XtPointer); void CBdoSelectAllData(Widget, XtPointer, XtPointer); void CBdoDeselectAllData(Widget, XtPointer, XtPointer); void CBdoRubberBanding(Widget, XtPointer, XtPointer); void CBdoSetListLevel(Widget w, XtPointer data, XtPointer); void CBdoCopyDataList(Widget, XtPointer data, XtPointer); void CBdoRemoveDataList(Widget, XtPointer data, XtPointer); void CBdoDrawLocation(Widget, XtPointer, XtPointer); class XYCBData { // callback data public: XYCBData(XYPlotWin *p, void *d, memberXYCB mcb) : instance(p), data(d), cbFunc(mcb) { } ~XYCBData() { } XYPlotWin *instance; void *data; memberXYCB cbFunc; }; Array xycbdPtrs; class XYMenuCBData { public: XYMenuCBData(XYPlotLegendItem *_item, int _which) : item(_item), which(_which) { } ~XYMenuCBData() { } XYPlotLegendItem *item; int which; }; Array xymenucbdPtrs; }; void CBcloseXYPlotWin(Widget, XtPointer, XtPointer); #endif ccseapps-2.5/CCSEApps/pAmrvis/PltAppState.cpp0000644000175000017500000001461011634153073022207 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // --------------------------------------------------------------- // PltAppState.cpp // --------------------------------------------------------------- #include "PltAppState.H" #include #include #include using std::ostrstream; using std::ends; using std::cout; using std::cerr; using std::endl; using std::min; using std::max; // ------------------------------------------------------------------- CMinMax::CMinMax() : rMin(AV_BIG_REAL), rMax(-AV_BIG_REAL), bMinMaxSet(false) { } // ------------------------------------------------------------------- CMinMax::~CMinMax() { } // ------------------------------------------------------------------- void CMinMax::SetMinMax(const Real rmin, const Real rmax) { BL_ASSERT(rmax >= rmin); rMin = rmin; rMax = rmax; bMinMaxSet = true; } // ------------------------------------------------------------------- void CMinMax::GetMinMax(Real &rmin, Real &rmax) { BL_ASSERT(bMinMaxSet); rmin = rMin; rmax = rMax; } // ------------------------------------------------------------------- // ------------------------------------------------------------------- PltAppState::PltAppState(int numFrames, int numDerived) : currentScale(NOTSETYET), maxScale(NOTSETYET), currentFrame(0), currentDerivedNumber(NOTSETYET), currentContourType(INVALIDCONTOURTYPE), nContours(NOTSETYET), currentMinMaxType(INVALIDMINMAX), minDrawnLevel(NOTSETYET), maxDrawnLevel(NOTSETYET), minAllowableLevel(NOTSETYET), maxAllowableLevel(NOTSETYET), finestLevel(NOTSETYET) { minMax.resize(numFrames); for(int nf(0); nf < numFrames; ++nf) { minMax[nf].resize(numDerived); for(int nd(0); nd < numDerived; ++nd) { minMax[nf][nd].resize(NUMBEROFMINMAX); } } } // ------------------------------------------------------------------- PltAppState::~PltAppState() { } // ------------------------------------------------------------------- PltAppState &PltAppState::operator=(const PltAppState &rhs) { if(this == &rhs) { return *this; } currentScale = rhs.currentScale; maxScale = rhs.maxScale; currentFrame = rhs.currentFrame; currentDerived = rhs.currentDerived; currentDerivedNumber = rhs.currentDerivedNumber; showBoxes = rhs.showBoxes; currentContourType = rhs.currentContourType; nContours = rhs.nContours; currentMinMaxType = rhs.currentMinMaxType; // mins and maxes //Array > > minMax; // minMax [frame] [derived] [RangeType] minMax = rhs.minMax; // minMax [frame] [derived] [RangeType] //Array subDomains; subDomains = rhs.subDomains; minDrawnLevel = rhs.minDrawnLevel; maxDrawnLevel = rhs.maxDrawnLevel; minAllowableLevel = rhs.minAllowableLevel; maxAllowableLevel = rhs.maxAllowableLevel; finestLevel = rhs.finestLevel; contourNumString = rhs.contourNumString; formatString = rhs.formatString; fileName = rhs.fileName; palFilename = rhs.palFilename; return *this; } // ------------------------------------------------------------------- void PltAppState::SetMinMax(const MinMaxRangeType mmrangetype, const int framenumber, const int derivednumber, const Real rmin, const Real rmax) { minMax[framenumber][derivednumber][mmrangetype].SetMinMax(rmin, rmax); } // ------------------------------------------------------------------- void PltAppState::GetMinMax(const MinMaxRangeType mmrangetype, const int framenumber, const int derivednumber, Real &rmin, Real &rmax) { minMax[framenumber][derivednumber][mmrangetype].GetMinMax(rmin, rmax); } // ------------------------------------------------------------------- void PltAppState::GetMinMax(Real &rmin, Real &rmax) { minMax[currentFrame][currentDerivedNumber][currentMinMaxType]. GetMinMax(rmin, rmax); } // ------------------------------------------------------------------- bool PltAppState::IsSet(const MinMaxRangeType mmrangetype, const int framenumber, const int derivednumber) { return (minMax[framenumber][derivednumber][mmrangetype].IsSet()); } // ------------------------------------------------------------------- void PltAppState::PrintSetMap() { cout << "PltAppState::PrintSetMap(): minMax[frame] [derived] [rangetype]" << endl; for(int iframe(0); iframe < minMax.size(); ++iframe) { for(int ider(0); ider < minMax[iframe].size(); ++ider) { for(int immrt(0); immrt < minMax[iframe][ider].size(); ++immrt) { cout << "minMax[" << iframe << "][" << ider << "][" << immrt << "] = "; if(minMax[iframe][ider][immrt].IsSet()) { cout << " set = "; } else { cout << " not set = "; } cout << minMax[iframe][ider][immrt].Min() << " " << minMax[iframe][ider][immrt].Max() << endl; } cout << endl; } cout << endl; } } // ------------------------------------------------------------------- void PltAppState::SetCurrentDerived(const string &newDerived, int cdnumber) { currentDerived = newDerived; currentDerivedNumber = cdnumber; } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Point.H0000644000175000017500000002261011634153073020503 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Point.H,v 1.7 2001/10/17 17:53:33 lijewski Exp $ // // --------------------------------------------------------------- // Point.H // --------------------------------------------------------------- #ifndef _AMR_POINT_H_ #define _AMR_POINT_H_ #include #include using std::ostream; #include "REAL.H" class AmrQuaternion; class AmrSpherePoint; //---------------------------------------------------------------------------- // CLASS AMRVECTOR // // An unnormalized AmrVector in three dimensions class AmrVector { Real x, y, z; public: AmrVector(); // all components set to zero AmrVector(Real X, Real Y, Real Z); // specified components AmrVector(const AmrSpherePoint &S); friend Real X(const AmrVector &v); // x-component friend Real Y(const AmrVector &v); // y-component friend Real Z(const AmrVector &v); // z-component AmrVector operator +(AmrVector v) const // Point addition { return AmrVector( x + v.x, y + v.y, z + v.z ); } AmrVector operator +=(AmrVector v) { x += v.x; y += v.y; z += v.z; return *this; } AmrVector operator -(AmrVector v) const // Point subtraction { return AmrVector( x - v.x, y - v.y, z - v.z ); } AmrVector operator -=(AmrVector v) { x -= v.x; y -= v.y; z -= v.z; return *this; } AmrVector operator +() const // Unary + (no-op) { return *this; } AmrVector operator -() const // Unary - (negation) { return AmrVector( -x, -y, -z ); } Real operator *(AmrVector v) const // Dot product { return x*v.x + y*v.y + z*v.z; } AmrVector operator %(AmrVector v) const // Cross product { return AmrVector( y*v.z-z*v.y, z*v.x-x*v.z, x*v.y - y*v.x ); } AmrVector operator *(Real r) const // Scalar multiplication { return AmrVector( x*r, y*r, z*r ); } AmrVector operator *=(Real r) { x *= r; y *= r; z *= r; return *this; } friend AmrVector operator *(Real, AmrVector); AmrVector operator /(Real r) const // Scalar division { return AmrVector( x/r, y/r, z/r ); } AmrVector operator /=(Real r) { x /= r; y /= r; z /= r; return *this; } AmrVector applyMatrix(Real m[4][4]); friend Real mag(const AmrVector &); // Length friend Real mag2(const AmrVector &); // Length squared (no sqrt) friend Real dist(const AmrVector &p,const AmrVector &q); friend Real dist2(const AmrVector &p,const AmrVector &q); // Triple product: positive if (p1,p2,p3) are right-handed coord system //friend Real triple( AmrVector v1, AmrVector v2, AmrVector v3 ); friend ostream& operator<<(ostream&s, const AmrVector &p); friend class AmrSpherePoint; }; //---------------------------------------------------------------------------- // CLASS AMRSPHEREPOINT // // A 3-D point, constrained to be on the surface of the unit sphere. // If x=y=z=0 it is the null point, does not exist class AmrSpherePoint { Real x, y, z; public: AmrSpherePoint(); // null point AmrSpherePoint(Real X, Real Y, Real Z); // specified components AmrSpherePoint(const AmrVector &v); // normalize it friend Real X(const AmrSpherePoint &v); // x-component friend Real Y(const AmrSpherePoint &v); // y-component friend Real Z(const AmrSpherePoint &v); // z-component friend int isnull(const AmrSpherePoint &v); AmrVector operator -(AmrSpherePoint v) const // Spoint subtraction { return AmrVector( x - v.x, y - v.y, z - v.z ); } AmrSpherePoint operator +() const // Unary + (no-op) { return *this; } AmrSpherePoint operator -() const // Unary - (negation) { return AmrSpherePoint( -x, -y, -z ); } Real operator *(const AmrSpherePoint &v) const // Dot product { return x*v.x + y*v.y + z*v.z; } AmrSpherePoint operator %(const AmrSpherePoint &v) const // Normalized cross product { return AmrSpherePoint( y*v.z-z*v.y, z*v.x-x*v.z, x*v.y - y*v.x ); } AmrSpherePoint applyMatrix(Real m[4][4]); AmrSpherePoint rotate( const AmrQuaternion &Q ); friend Real mag(const AmrSpherePoint &p); // 1 friend Real mag2(const AmrSpherePoint &p); friend Real dist(const AmrSpherePoint &p,const AmrSpherePoint &q); friend Real dist2(const AmrSpherePoint &p,const AmrSpherePoint &q); friend AmrSpherePoint midpt(const AmrSpherePoint &P, const AmrSpherePoint &Q); friend AmrSpherePoint midpt(const AmrSpherePoint &P, const AmrSpherePoint &Q, const AmrSpherePoint &R); /* // Intersection of two lines with poles p1, p2 AmrSpherePoint( const AmrSpherePoint &p1, const AmrSpherePoint &p2, int hand=0 ); // Intersection of line with segment p1-p2 AmrSpherePoint( const AmrSpherePoint &pole, const AmrSpherePoint &p1, const AmrSpherePoint &p2 ); // Intersection of line (pole=p) with circle (ctr,c,s) AmrSpherePoint( const AmrSpherePoint &p, const AmrSpherePoint &ctr, Real c, Real s, int hand=0 ); // Intersection of segment p1-p2 with segment p3-p4 AmrSpherePoint(const AmrSpherePoint &p1,const AmrSpherePoint &p2,const AmrSpherePoint &p3,const AmrSpherePoint &p4); // Intersection of segment p1-p2 with circle (ctr,c,s) AmrSpherePoint( const AmrSpherePoint &p1, const AmrSpherePoint &p2, const AmrSpherePoint &ctr, Real c, Real s, int hand=0 ); // Intersection of two circles AmrSpherePoint( const AmrSpherePoint &ctr1, Real c1, Real s1, const AmrSpherePoint &ctr2, Real c2, Real s2, int hand=0 ); // We trust the interpolation routines friend int seginterp( const AmrSpherePoint &p1, const AmrSpherePoint &p2, Real h, AmrSpherePoint p[]); friend int lininterp( const AmrSpherePoint &pole, Real h, AmrSpherePoint p[] ); friend int circinterp(const AmrSpherePoint &ctr, Real c, Real s, Real h, AmrSpherePoint p[]); */ friend class AmrVector; //void draw() const; //void draw(Real s ) const; friend ostream& operator<<(ostream&s, const AmrSpherePoint &p); }; //---------------------------------------------------------------------------- inline Real hypot2(Real x, Real y, Real z) { return x*x + y*y + z*z; } inline Real hypot(Real x, Real y, Real z) { return sqrt(hypot2(x,y,z)); } inline AmrVector::AmrVector() { x = y = z = 0.; } inline AmrSpherePoint::AmrSpherePoint() { x = y = z = 0.; } inline Real X(const AmrVector &v) { return v.x; } inline Real Y(const AmrVector &v) { return v.y; } inline Real Z(const AmrVector &v) { return v.z; } inline Real X(const AmrSpherePoint &P) { return P.x; } inline Real Y(const AmrSpherePoint &P) { return P.y; } inline Real Z(const AmrSpherePoint &P) { return P.z; } inline int isnull(const AmrSpherePoint &P) { return P.x==0. && P.y==0. && P.z==0.; } inline AmrVector operator *(Real r, AmrVector v) { return AmrVector( r*v.x, r*v.y, r*v.z );} inline Real mag(const AmrVector &v) { return hypot(v.x,v.y,v.z); } inline Real mag2(const AmrVector &v) { return hypot2(v.x,v.y,v.z); } inline Real mag(const AmrSpherePoint &v) { return 1.; } inline Real mag2(const AmrSpherePoint &v) { return 1.; } inline Real dist(const AmrVector &p, const AmrVector &q) { return hypot(p.x-q.x,p.y-q.y,p.z-q.z); } inline Real dist2(const AmrVector &p, const AmrVector &q) { return hypot2(p.x-q.x,p.y-q.y,p.z-q.z); } inline Real dist(const AmrSpherePoint &p, const AmrSpherePoint &q) { return hypot(p.x-q.x,p.y-q.y,p.z-q.z); } inline Real dist2(const AmrSpherePoint &p, const AmrSpherePoint &q) { return hypot2(p.x-q.x,p.y-q.y,p.z-q.z); } inline AmrVector midpt( const AmrVector &P, const AmrVector &Q, Real r=0.5 ) { return P + r*(Q-P); } inline AmrSpherePoint midpt( const AmrSpherePoint &P, const AmrSpherePoint &Q ) { return AmrSpherePoint( P.x+Q.x, P.y+Q.y, P.z+Q.z ); } inline AmrSpherePoint midpt( const AmrSpherePoint &P, const AmrSpherePoint &Q, const AmrSpherePoint &R ) { return AmrSpherePoint( P.x+Q.x+R.x, P.y+Q.y+R.y, P.z+Q.z+R.z ); } /*inline void AmrSpherePoint::draw() const { glNormal3f( x, y, z ); glVertex3f( scale*x, scale*y, scale*z ); } inline void AmrSpherePoint::draw(Real s ) const { glNormal3f( x, y, z ); s *= scale; glVertex3f( s*x, s*y, s*z ); } */ inline ostream& operator<<( ostream&s, const AmrVector &p ) { return s << "AmrVector(" << p.x << "," << p.y << "," << p.z << ")"; } inline ostream& operator<<( ostream&s, const AmrSpherePoint &p) { return s << "AmrSpherePoint( " << p.x << " , " << p.y << " , " << p.z << " )"; } #endif ccseapps-2.5/CCSEApps/pAmrvis/xgout.H0000644000175000017500000000553311634153073020565 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ /* * Output Device Information * * This file contains definitions for output device interfaces * to the graphing program xgraph. */ #ifndef _h_xgout #define _h_xgout /* Passed device option flags */ #define D_DOCU 0x01 /* Returned device capability flags */ #define D_COLOR 0x01 /* Text justifications */ #define T_CENTER 0 #define T_LEFT 1 #define T_UPPERLEFT 2 #define T_TOP 3 #define T_UPPERRIGHT 4 #define T_RIGHT 5 #define T_LOWERRIGHT 6 #define T_BOTTOM 7 #define T_LOWERLEFT 8 /* Text styles */ #define T_AXIS 0 #define T_TITLE 1 /* Line Styles */ #define L_AXIS 0 #define L_ZERO 1 #define L_VAR 2 /* Marker Styles */ #define P_PIXEL 0 #define P_DOT 1 #define P_MARK 2 /* Output device information returned by initialization routine */ typedef struct xg_out { int areaW, areaH; /* Width and height in pixels */ int bdrPad; /* Padding from border */ int axisPad; /* Extra space around axis labels */ int tickLen; /* Length of tick mark on axis */ int legendPad; /* Top of legend text to legend line */ int axisW; /* Width of big character of axis font */ int axisH; /* Height of big character of axis font */ int titleW; /* Width of big character of title font */ int titleH; /* Height of big character of title font */ int maxSegs; /* Maximum number of segments in group */ char *user_state; /* User supplied data */ } xgOut; #define ERRBUFSIZE 2048 #endif /* _h_xgout */ ccseapps-2.5/CCSEApps/pAmrvis/.cvsignore0000644000175000017500000000004111634153073021273 0ustar amckinstryamckinstrystate_0.n.*.ps state_0.n.*.rgb ccseapps-2.5/CCSEApps/pAmrvis/AmrData.cpp0000644000175000017500000017544311634153073021333 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrData.cpp,v 1.65 2003/03/12 07:40:56 vince Exp $ // // --------------------------------------------------------------- // AmrData.cpp // --------------------------------------------------------------- #include #include "AmrData.H" #include "ArrayLim.H" #include "BoxDomain.H" #include "VisMF.H" #include using std::string; using std::cout; using std::cerr; using std::endl; using std::min; using std::max; #if ! (defined(BL_Linux) || defined(BL_AIX) || defined(BL_IRIX64) || defined(WIN32) || defined(BL_CYGWIN_NT)) #define BL_ALWAYS_FIX_DENORMALS #endif #ifdef BL_ALWAYS_FIX_DENORMALS #include #if defined(BL_T3E) # include # if (BL_USE_FLOAT) # define DS_FP_CLASS fpclassify # else # define DS_FP_CLASS fpclassify # endif #else # if (BL_USE_FLOAT) # define DS_FP_CLASS fp_classf # else # define DS_FP_CLASS fp_class # endif #endif #endif #include #include #include using std::ios; using std::ifstream; // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #ifdef SHOWVAL #undef SHOWVAL #endif #define SHOWVAL(val) { cout << #val << " = " << val << endl; } #ifdef VSHOWVAL #undef VSHOWVAL #endif #define VSHOWVAL(verbose, val) { if(verbose) { \ cout << #val << " = " << val << endl; } } #if defined( BL_FORT_USE_UPPERCASE ) # if (BL_SPACEDIM == 2) # define FORT_CINTERP CINTERP2D # define FORT_PCINTERP PCINTERP2D # define FORT_CARTGRIDMINMAX CARTGRIDMINMAX2D # elif (BL_SPACEDIM == 3) # define FORT_CINTERP CINTERP3D # define FORT_PCINTERP PCINTERP3D # define FORT_CARTGRIDMINMAX CARTGRIDMINMAX3D # endif #elif defined( BL_FORT_USE_LOWERCASE ) # if (BL_SPACEDIM == 2) # define FORT_CINTERP cinterp2d # define FORT_PCINTERP pcinterp2d # define FORT_CARTGRIDMINMAX cartgridminmax2d # elif (BL_SPACEDIM == 3) # define FORT_CINTERP cinterp3d # define FORT_PCINTERP pcinterp3d # define FORT_CARTGRIDMINMAX cartgridminmax3d # endif #else # if (BL_SPACEDIM == 2) # define FORT_CINTERP cinterp2d_ # define FORT_PCINTERP pcinterp2d_ # define FORT_CARTGRIDMINMAX cartgridminmax2d_ # elif (BL_SPACEDIM == 3) # define FORT_CINTERP cinterp3d_ # define FORT_PCINTERP pcinterp3d_ # define FORT_CARTGRIDMINMAX cartgridminmax3d_ # endif #endif extern "C" { void FORT_CINTERP(Real *fine, ARLIM_P(flo), ARLIM_P(fhi), const int *fblo, const int *fbhi, const int &nvar, const int &lratio, const Real *crse, const int &clo, const int &chi, const int *cslo, const int *cshi, const int *fslo, const int *fshi, Real *cslope, const int &c_len, Real *fslope, Real *fdat, const int &f_len, Real *foff); void FORT_PCINTERP(Real *fine, ARLIM_P(flo), ARLIM_P(fhi), const int *fblo, const int *fbhi, const int &lrat, const int &nvar, const Real *crse, ARLIM_P(clo), ARLIM_P(chi), const int *cblo, const int *cbhi, Real *temp, const int &tlo, const int &thi); void FORT_CARTGRIDMINMAX (Real *data, ARLIM_P(dlo), ARLIM_P(dhi), const Real *vfrac, const Real &vfeps, Real &dmin, Real &dmax); } bool AmrData::verbose = false; int AmrData::skipPltLines = 0; int AmrData::sBoundaryWidth = 0; // --------------------------------------------------------------- AmrData::AmrData() { probSize.resize(BL_SPACEDIM, -1.0); probLo.resize(BL_SPACEDIM, 0.0); probHi.resize(BL_SPACEDIM, -1.0); plotVars.clear(); nRegions = 0; boundaryWidth = 0; } // --------------------------------------------------------------- AmrData::~AmrData() { for(int i(0); i < nRegions; ++i) { for(int lev(0); lev <= finestLevel; ++lev) { delete regions[lev][i]; } } for(int lev(0); lev <= finestLevel; ++lev) { for(int iComp(0); iComp < nComp; ++iComp) { delete dataGrids[lev][iComp]; } } } // --------------------------------------------------------------- namespace { void mytrim(char *str) { int i(std::strlen(str)); for(int n(i - 1); n >= 0; n--) { if( str[n] > ' ' ) { break; } str[n] = 0; } } } // --------------------------------------------------------------- bool AmrData::ReadData(const string &filename, FileType filetype) { fileType = filetype; bCartGrid = false; bTerrain = false; if(filetype == FAB || filetype == MULTIFAB) { return ReadNonPlotfileData(filename, filetype); } int i, j, k, width; fileName = filename; string File = filename; #ifdef BL_PARALLEL_IO File += '/'; File += "Header"; #endif /*BL_PARALLEL_IO*/ VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); ifstream isPltIn; isPltIn.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "AmrData::opening file = " << filename << endl; } } isPltIn.open(File.c_str(), ios::in); if(isPltIn.fail()) { if(ParallelDescriptor::IOProcessor()) { cerr << "Unable to open file: " << filename << endl; } return false; } char skipBuff[LINELENGTH]; for(i = 0; i < skipPltLines; ++i) { isPltIn.getline(skipBuff, LINELENGTH); if(ParallelDescriptor::IOProcessor()) { cout << "Skipped line in pltfile = " << skipBuff << endl; } } isPltIn >> plotFileVersion; if(strncmp(plotFileVersion.c_str(), "CartGrid", 8) == 0) { bCartGrid = true; } if(strncmp(plotFileVersion.c_str(), "Terrain", 7) == 0) { bTerrain = true; } if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "Plot file version: " << plotFileVersion << endl; if(bCartGrid) { cout << ":::: Found a CartGrid file type." << endl; } if(bTerrain) { cout << ":::: Found a Terrain file type." << endl; } } } // read list of variables isPltIn >> nComp; if(nComp < 1 || nComp > 1024) { // arbitrarily limit to 1024 if(ParallelDescriptor::IOProcessor()) { cerr << "Error in AmrData: bad nComp = " << nComp << endl; } return false; } if(ParallelDescriptor::IOProcessor()) { VSHOWVAL(verbose, nComp); } plotVars.resize(nComp); char plotVarName[LINELENGTH]; isPltIn.getline(plotVarName, LINELENGTH); // eat white space left by op<< for(i = 0; i < nComp; ++i) { isPltIn.getline(plotVarName, LINELENGTH); mytrim(plotVarName); plotVars[i] = plotVarName; if(ParallelDescriptor::IOProcessor()) { VSHOWVAL(verbose, plotVarName); } } int spacedim; isPltIn >> spacedim >> time >> finestLevel; if(ParallelDescriptor::IOProcessor()) { VSHOWVAL(verbose, spacedim); VSHOWVAL(verbose, time); VSHOWVAL(verbose, finestLevel); } if(spacedim != BL_SPACEDIM) { if(ParallelDescriptor::IOProcessor()) { cerr << endl << " ~~~~ Error: You are using " << BL_SPACEDIM << "D amrvis " << "to look at a " << spacedim << "D file." << endl << endl; } return false; } if(finestLevel < 0) { if(ParallelDescriptor::IOProcessor()) { cerr << "Error in AmrData: bad finestLevel = " << finestLevel << endl; } return false; } for(i = 0; i < BL_SPACEDIM; ++i) { isPltIn >> probLo[i]; if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "probLo[" << i << "] = " << probLo[i] << endl; } } } for(i = 0; i < BL_SPACEDIM; ++i) { isPltIn >> probHi[i]; if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "probHi[" << i << "] = " << probHi[i] << endl; } } } if(verbose) { if(ParallelDescriptor::IOProcessor()) { if(finestLevel > 0) { cout << "Resizing refRatio to size = " << finestLevel << endl; } } } if(finestLevel == 0) { refRatio.resize(1, 1); } else { refRatio.resize(finestLevel, -1); } while(isPltIn.get() != '\n'); bool bIVRefRatio(false); if(isPltIn.peek() == '(') { // it is an IntVect bIVRefRatio = true; } for(i = 0; i < finestLevel; ++i) { // try to guess if refRatio is an IntVect if(bIVRefRatio) { // it is an IntVect IntVect ivRefRatio; isPltIn >> ivRefRatio; if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "IntVect refRatio[" << i << "] = " << ivRefRatio << endl; } } refRatio[i] = ivRefRatio[0]; // non-uniform ref ratios not supported } else { isPltIn >> refRatio[i]; } if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "refRatio[" << i << "] = " << refRatio[i] << endl; } } } for(i = 0; i < finestLevel; ++i ) { if(refRatio[i] < 2 || refRatio[i] > 32 ) { if(ParallelDescriptor::IOProcessor()) { cerr << "Error in AmrData: bad refRatio at level " << i << " = " << refRatio[i] << endl; } return false; } } while(isPltIn.get() != '\n'); probDomain.resize(finestLevel + 1); maxDomain.resize(finestLevel + 1); for(i = 0; i <= finestLevel; ++i) { isPltIn >> probDomain[i]; if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "probDomain[" << i << "] = " << probDomain[i] << endl; } } if( ! probDomain[i].ok()) { if(ParallelDescriptor::IOProcessor()) { cerr << "Error in AmrData: bad probDomain[" << i << "] = " << probDomain[i] << endl; } return false; } } char lstepbuff[128]; while(isPltIn.get() != '\n') { ; // do nothing } isPltIn.getline(lstepbuff, 128); // ignore levelsteps--some files have // finestlevel of these, others have // finestlevel + 1 if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "Ignored levelSteps = " << lstepbuff << endl; } } dxLevel.resize(finestLevel + 1); for(i = 0; i <= finestLevel; ++i) { dxLevel[i].resize(BL_SPACEDIM); for(k = 0; k < BL_SPACEDIM; k++) { isPltIn >> dxLevel[i][k]; if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "dxLevel[" << i << "][" << k << "] = " << dxLevel[i][k] << endl; } } } } vfEps.resize(finestLevel + 1); // must resize these even if not cartGrid afEps.resize(finestLevel + 1); if(bCartGrid) { for(i = 0; i <= finestLevel; ++i) { isPltIn >> vfEps[i]; if(verbose) { cout << "vfEps[" << i << "] = " << vfEps[i] << endl; } } } for(i = 0; i < BL_SPACEDIM; ++i) { probSize[i] = probHi[i] - probLo[i]; if(probSize[i] <= 0.0 ) { if(ParallelDescriptor::IOProcessor()) { cerr << "Error in AmrData: bad probSize[" << i << "] = " << probSize[i] << endl; } return false; } } isPltIn >> coordSys; if(ParallelDescriptor::IOProcessor()) { VSHOWVAL(verbose, coordSys); } while(isPltIn.get() != '\n') { ; // do nothing } isPltIn >> width; // width of bndry regions if(ParallelDescriptor::IOProcessor()) { VSHOWVAL(verbose, width); } while(isPltIn.get() != '\n') { ; // do nothing } dataGrids.resize(finestLevel + 1); dataGridsDefined.resize(finestLevel + 1); int lev; boundaryWidth = max(width, sBoundaryWidth); bool bRestrictDomain(maxDomain[0].ok()); if(bRestrictDomain) { for(lev = 1; lev <= finestLevel; lev++) { maxDomain[lev] = BoxLib::refine(maxDomain[lev-1],refRatio[lev-1]); } } Array restrictDomain(finestLevel + 1); Array extendRestrictDomain(finestLevel + 1); regions.resize(finestLevel + 1); for(lev = 0; lev <= finestLevel; ++lev) { restrictDomain[lev] = probDomain[lev]; if(bRestrictDomain) { restrictDomain[lev] = maxDomain[lev]; } extendRestrictDomain[lev] = BoxLib::grow(restrictDomain[lev],boundaryWidth); BoxList bndry_boxes = BoxLib::boxDiff(extendRestrictDomain[lev], restrictDomain[lev]); nRegions = bndry_boxes.size(); BoxList::iterator bli = bndry_boxes.begin(); regions[lev].resize(nRegions); i = 0; while(bli != bndry_boxes.end()) { regions[lev][i] = new FArrayBox(*bli, nComp); if(verbose) { if(ParallelDescriptor::IOProcessor()) { cout << "BNDRY REGION " << i << " : " << *bli << endl; cout << " numPts = " << bli->numPts() << endl; } } ++i; ++bli; } } // if positive set up and read bndry databoxes if(width > 0) { if(ParallelDescriptor::IOProcessor()) { cerr << "Error in AmrData: Boundary width > 0 not supported: width = " << width << endl; } return false; } // end if(width...) // read all grids but only save those inside the restricted region visMF.resize(finestLevel + 1); compIndexToVisMFMap.resize(nComp); compIndexToVisMFComponentMap.resize(nComp); gridLocLo.resize(finestLevel + 1); gridLocHi.resize(finestLevel + 1); for(i = 0; i <= finestLevel; ++i) { int nGrids; Real gTime; int iLevelSteps; isPltIn >> lev >> nGrids >> gTime >> iLevelSteps; if(ParallelDescriptor::IOProcessor()) { VSHOWVAL(verbose, lev); VSHOWVAL(verbose, nGrids); VSHOWVAL(verbose, gTime); VSHOWVAL(verbose, iLevelSteps); } if(i != lev) { if(ParallelDescriptor::IOProcessor()) { cerr << "Level misrestart:mismatch on restart" << endl; cerr << "Error in AmrData: Level mismatch: read level " << lev << " while expecting level " << i << endl; } return false; } if(nGrids < 1) { if(ParallelDescriptor::IOProcessor()) { cerr << "Error in AmrData: bad nGrids = " << nGrids << endl; } return false; } gridLocLo[i].resize(nGrids); gridLocHi[i].resize(nGrids); for(int iloc = 0; iloc < nGrids; ++iloc) { gridLocLo[i][iloc].resize(BL_SPACEDIM); gridLocHi[i][iloc].resize(BL_SPACEDIM); for(int iDim = 0; iDim < BL_SPACEDIM; ++iDim) { isPltIn >> gridLocLo[i][iloc][iDim] >> gridLocHi[i][iloc][iDim]; if(ParallelDescriptor::IOProcessor()) { VSHOWVAL(verbose, gridLocLo[i][iloc][iDim]); VSHOWVAL(verbose, gridLocHi[i][iloc][iDim]); } } } // here we account for multiple multifabs in a plot file int currentIndexComp(0); int currentVisMF(0); dataGrids[i].resize(nComp); dataGridsDefined[i].resize(nComp); while(currentIndexComp < nComp) { string mfNameRelative; isPltIn >> mfNameRelative; string mfName(fileName); #ifdef BL_PARALLEL_IO mfName += '/'; mfName += mfNameRelative; VSHOWVAL(verbose, mfName); VSHOWVAL(verbose, mfNameRelative); #endif /* BL_PARALLEL_IO */ visMF[i].resize(currentVisMF + 1); // this preserves previous ones visMF[i][currentVisMF] = new VisMF(mfName); int iComp(currentIndexComp); nGrow = visMF[i][currentVisMF]->nGrow(); currentIndexComp += visMF[i][currentVisMF]->nComp(); int currentVisMFComponent(0); for( ; iComp < currentIndexComp; ++iComp) { // make single component multifabs // defer reading the MultiFab data dataGrids[i][iComp] = new MultiFab(visMF[i][currentVisMF]->boxArray(), 1, visMF[i][currentVisMF]->nGrow(), Fab_noallocate); dataGridsDefined[i][iComp].resize(visMF[i][currentVisMF]->size(), false); compIndexToVisMFMap[iComp] = currentVisMF; compIndexToVisMFComponentMap[iComp] = currentVisMFComponent; ++currentVisMFComponent; } ++currentVisMF; } // end while } // end for(i...finestLevel) // fill a set of temporary bndry regions surrounding the // restricted domain by extension from interior data // only use this data in bndry regions that did not // get better data from interior or input bndry regions for(lev = 0; lev <= finestLevel; ++lev) { Box inbox(restrictDomain[lev]); Box reg1(BoxLib::grow(restrictDomain[lev],boundaryWidth)); Box reg2(BoxLib::grow(probDomain[lev],width)); BoxList outside = BoxLib::boxDiff(reg1, reg2); if(outside.size() > 0) { // parts of the bndry have not been filled from the input // data, must extending from interior regions for(int idir(0); idir < BL_SPACEDIM; ++idir) { Box bx(BoxLib::adjCellLo(inbox,idir,boundaryWidth)); Box br(bx); for(k = 0; k < BL_SPACEDIM; ++k) { if(k != idir) { br.grow(k,boundaryWidth); } } br.shift(idir,1); FArrayBox tmpreg(br,nComp); Box reg_bx = tmpreg.box(); reg_bx &= inbox; FillInterior(tmpreg,lev,reg_bx); br.shift(idir,-1); FArrayBox tmpreg_lo(br,nComp); tmpreg_lo.copy(tmpreg,tmpreg.box(),0,tmpreg_lo.box(),0,nComp); // now fill out tmp region along idir direction Box b_lo(BoxLib::adjCellLo(inbox,idir,1)); for(k = 1; k < boundaryWidth; ++k) { Box btmp(b_lo); btmp.shift(idir, -k); tmpreg_lo.copy(tmpreg_lo,b_lo,0,btmp,0,nComp); } // now fill out temp bndry region Box b_src, b_dest; int n; for(k = 1; k < BL_SPACEDIM; ++k) { int kdir = (idir + k) % BL_SPACEDIM; b_dest = BoxLib::adjCellLo(bx, kdir, 1); b_src = b_dest; b_src = b_src.shift(kdir, 1); for(n = 1; n <= boundaryWidth; n++) { tmpreg_lo.copy(tmpreg_lo, b_src, 0, b_dest, 0, nComp); b_dest.shift(kdir, -1); } b_dest = BoxLib::adjCellHi(bx,kdir,1); b_src = b_dest; b_src.shift(kdir,-1); for(n = 1; n <= boundaryWidth; n++) { tmpreg_lo.copy(tmpreg_lo,b_src,0,b_dest,0,nComp); b_dest.shift(kdir,1); } bx.grow(kdir,boundaryWidth); } // now copy into real bndry regions for(j = 0; j < nRegions; ++j) { FArrayBox *p = regions[lev][j]; Box p_box = p->box(); BoxList::iterator bli = outside.begin(); while(bli != outside.end()) { Box ovlp(p_box); ovlp &= *bli; ovlp &= br; if(ovlp.ok()) { p->copy(tmpreg_lo, ovlp); } ++bli; } } // end for j // now work on the high side of the bndry region bx = BoxLib::adjCellHi(inbox,idir,boundaryWidth); br = bx; for(k = 0; k < BL_SPACEDIM; ++k) { if(k != idir) br.grow(k, boundaryWidth); } br.shift(idir,-1); FArrayBox tmpreg2(br,nComp); reg_bx = tmpreg2.box(); reg_bx &= inbox; FillInterior(tmpreg2,lev,reg_bx); br.shift(idir,1); FArrayBox tmpreg_hi(br,nComp); tmpreg_hi.copy(tmpreg2,tmpreg2.box(),0,tmpreg_hi.box(),0,nComp); // now fill out tmp region along idir direction Box b_hi(BoxLib::adjCellHi(inbox,idir,1)); for(k = 1; k < boundaryWidth; ++k) { Box btmp(b_hi); btmp.shift(idir,k); tmpreg_hi.copy(tmpreg_hi,b_hi,0,btmp,0,nComp); } // now fill out temp bndry region for(k = 1; k < BL_SPACEDIM; ++k) { int kdir = (idir + k) % BL_SPACEDIM; b_dest = BoxLib::adjCellLo(bx, kdir, 1); b_src = b_dest; b_src.shift(kdir, 1); for(n = 1; n <= boundaryWidth; ++n) { tmpreg_hi.copy(tmpreg_hi, b_src, 0, b_dest, 0, nComp); b_dest.shift(kdir,-1); } b_dest = BoxLib::adjCellHi(bx, kdir, 1); b_src = b_dest; b_src.shift(kdir, -1); for(n = 1; n <= boundaryWidth; ++n) { tmpreg_hi.copy(tmpreg_hi, b_src, 0, b_dest, 0, nComp); b_dest.shift(kdir, 1); } bx.grow(kdir, boundaryWidth); } // now copy into real bndry regions for(j = 0; j < nRegions; ++j) { FArrayBox *p = regions[lev][j]; Box p_box = p->box(); BoxList::iterator bli = outside.begin(); while(bli != outside.end()) { Box ovlp(p_box); ovlp &= *bli; ovlp &= br; if(ovlp.ok()) { p->copy(tmpreg_hi, ovlp); } ++bli; } } // end for j } // end for(idir...) } // end if(outside.size())... outside.clear(); } // end for(lev...) if(bRestrictDomain) { Array p_lo(BL_SPACEDIM), p_hi(BL_SPACEDIM); LoNodeLoc(0,maxDomain[0].smallEnd(),p_lo); HiNodeLoc(0,maxDomain[0].bigEnd(),p_hi); for(i = 0; i < BL_SPACEDIM; ++i) { probLo[i] = p_lo[i]; probHi[i] = p_hi[i]; probSize[i] = p_hi[i] - p_lo[i]; } for(lev = 0; lev <= finestLevel; ++lev) { probDomain[lev] = maxDomain[lev]; } } return true; } // end ReadData // --------------------------------------------------------------- bool AmrData::ReadNonPlotfileData(const string &filename, FileType filetype) { int i; if(verbose) { cout << "AmrPlot::opening file = " << filename << endl; } fileName = filename; #ifdef BL_USE_SETBUF VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); #endif time = 0; if(fileType == FAB) { finestLevel = 0; } else if(fileType == MULTIFAB) { finestLevel = 1; // level zero is filler } probDomain.resize(finestLevel + 1); maxDomain.resize(finestLevel + 1); dxLevel.resize(finestLevel + 1); refRatio.resize(finestLevel + 1); if(fileType == FAB) { refRatio[0] = 1; } else if(fileType == MULTIFAB) { refRatio[0] = 2; } for(int iLevel(0); iLevel <= finestLevel; ++iLevel) { dxLevel[iLevel].resize(BL_SPACEDIM); for(i = 0; i < BL_SPACEDIM; ++i) { probLo[i] = 0.0; probHi[i] = 1.0; // arbitrarily probSize[i] = probHi[i] - probLo[i]; dxLevel[iLevel][i] = 0.0; // temporarily } } dataGrids.resize(finestLevel + 1); dataGridsDefined.resize(finestLevel + 1); if(fileType == FAB) { ifstream is; is.open(filename.c_str(), ios::in); if(is.fail()) { cerr << "Unable to open plotfile: " << filename << endl; return false; } #ifdef BL_USE_SETBUF is.rdbuf()->setbuf(io_buffer.dataPtr(), io_buffer.size()); #endif FArrayBox *newfab = new FArrayBox; nComp = newfab->readFrom(is, 0); // read the first component Box fabbox(newfab->box()); fabBoxArray.resize(1); fabBoxArray.set(0, fabbox); dataGrids[0].resize(nComp); dataGridsDefined[0].resize(nComp); dataGridsDefined[0][0].resize(1); dataGrids[0][0] = new MultiFab; int nGrow(0); dataGrids[0][0]->define(fabBoxArray, 0, nGrow, Fab_noallocate); dataGrids[0][0]->setFab(0, newfab); dataGridsDefined[0][0][0] = true; // read subsequent components // need to optimize this for lazy i/o for(int iComp = 1; iComp < nComp; ++iComp) { dataGrids[0][iComp] = new MultiFab; dataGrids[0][iComp]->define(fabBoxArray, 0, nGrow, Fab_noallocate); newfab = new FArrayBox; is.seekg(0, ios::beg); newfab->readFrom(is, iComp); // read the iComp component dataGrids[0][iComp]->setFab(0, newfab); dataGridsDefined[0][iComp].resize(1); dataGridsDefined[0][iComp][0] = true; } char fabname[64]; // arbitrarily plotVars.resize(nComp); for(i = 0; i < nComp; ++i) { sprintf(fabname, "%s%d", "Fab_", i); plotVars[i] = fabname; } probDomain[0] = newfab->box(); for(i = 0; i < BL_SPACEDIM; ++i) { dxLevel[0][i] = 1.0 / probDomain[0].length(i); } is.close(); } else if(fileType == MULTIFAB) { VisMF tempVisMF(filename); nComp = tempVisMF.nComp(); probDomain[1] = tempVisMF.boxArray().minimalBox(); probDomain[0] = probDomain[1]; probDomain[0].coarsen(refRatio[0]); BoxArray mfBoxArray(tempVisMF.boxArray()); BoxArray levelZeroBoxArray; levelZeroBoxArray.resize(1); levelZeroBoxArray.set(0, probDomain[0]); dataGrids[0].resize(nComp, NULL); dataGrids[1].resize(nComp, NULL); dataGridsDefined[0].resize(nComp); dataGridsDefined[1].resize(nComp); fabBoxArray.resize(1); fabBoxArray.set(0, probDomain[0]); int nGrow(0); char fabname[64]; // arbitrarily plotVars.resize(nComp); for(int iComp(0); iComp < nComp; ++iComp) { sprintf(fabname, "%s%d", "MultiFab_", iComp); plotVars[iComp] = fabname; for(int iDim(0); iDim < BL_SPACEDIM; ++iDim) { dxLevel[0][iDim] = 1.0 / probDomain[0].length(iDim); dxLevel[1][iDim] = 1.0 / probDomain[1].length(iDim); } // set the level zero multifab dataGridsDefined[0][iComp].resize(1, false); dataGrids[0][iComp] = new MultiFab; dataGrids[0][iComp]->define(levelZeroBoxArray, 0, nGrow, Fab_noallocate); FArrayBox *newfab = new FArrayBox(probDomain[0], 1); Real levelZeroValue, zvMin, zvMax; zvMin = tempVisMF.min(0, iComp); // init with first value zvMax = tempVisMF.max(0, iComp); // init with first value for(int ic(0); ic < tempVisMF.size(); ++ic) { zvMin = min(zvMin, tempVisMF.min(ic, iComp)); zvMax = max(zvMax, tempVisMF.max(ic, iComp)); } levelZeroValue = zvMin - ((zvMax - zvMin) / 256.0); newfab->setVal(levelZeroValue); dataGrids[0][iComp]->setFab(0, newfab); dataGridsDefined[0][iComp][0] = true; } // end for(iComp...) // set the level one multifab // here we account for multiple multifabs in a plot file int currentIndexComp(0); int currentVisMF(0); visMF.resize(finestLevel + 1); compIndexToVisMFMap.resize(nComp); compIndexToVisMFComponentMap.resize(nComp); while(currentIndexComp < nComp) { visMF[1].resize(currentVisMF + 1); // this preserves previous ones visMF[1][currentVisMF] = new VisMF(filename); int iComp(currentIndexComp); nGrow = visMF[1][currentVisMF]->nGrow(); currentIndexComp += visMF[1][currentVisMF]->nComp(); for(int currentVisMFComponent(0); iComp < currentIndexComp; ++iComp) { // make single component multifabs for level one dataGrids[1][iComp] = new MultiFab(visMF[1][currentVisMF]->boxArray(), 1, visMF[1][currentVisMF]->nGrow(), Fab_noallocate); dataGridsDefined[1][iComp].resize(visMF[1][currentVisMF]->size(), false); compIndexToVisMFMap[iComp] = currentVisMF; compIndexToVisMFComponentMap[iComp] = currentVisMFComponent; ++currentVisMFComponent; } ++currentVisMF; } // end while } // end if(fileType...) return true; } // --------------------------------------------------------------- void AmrData::CellLoc(int lev, IntVect ix, Array &pos) const { BL_ASSERT(pos.size() == dxLevel[lev].size()); for(int i(0); i < BL_SPACEDIM; ++i) { pos[i] = probLo[i] + (dxLevel[lev][i])*(0.5 + Real(ix[i])); } } // --------------------------------------------------------------- void AmrData::LoNodeLoc(int lev, IntVect ix, Array &pos) const { BL_ASSERT(pos.size() == dxLevel[lev].size()); for(int i(0); i < BL_SPACEDIM; ++i) { pos[i] = probLo[i] + (dxLevel[lev][i])*Real(ix[i]); } } // --------------------------------------------------------------- void AmrData::HiNodeLoc(int lev, IntVect ix, Array &pos) const { BL_ASSERT(pos.size() == dxLevel[lev].size()); for(int i(0); i < BL_SPACEDIM; ++i) { pos[i] = probLo[i] + (dxLevel[lev][i])*Real(ix[i]+1); } } // --------------------------------------------------------------- void AmrData::IntVectFromLocation(const int finestFillLevel, const Array &location, IntVect &ivLoc, int &ivLevel, IntVect &ivFinestFillLev) { BL_ASSERT(location.size() == BL_SPACEDIM); BL_ASSERT(finestFillLevel <= finestLevel); int ffl(finestFillLevel); for(int i(0); i < BL_SPACEDIM; ++i) { int ival = probDomain[ffl].smallEnd()[i] + ((int) ( (location[i] - probLo[i]) / dxLevel[ffl][i] ) ); ivFinestFillLev.setVal(i, ival); } } // --------------------------------------------------------------- void AmrData::FillVar(FArrayBox *destFab, const Box &destBox, int finestFillLevel, const string &varname, int procWithFabs) { Array destFabs(1); Array destBoxes(1); destFabs[0] = destFab; destBoxes[0] = destBox; FillVar(destFabs, destBoxes, finestFillLevel, varname, procWithFabs); } // --------------------------------------------------------------- void AmrData::FillVar(MultiFab &destMultiFab, int finestFillLevel, const string &varname, int destcomp) { int numFillComps(1); Array varNames(numFillComps); Array destComps(numFillComps); varNames[0] = varname; destComps[0] = destcomp; FillVar(destMultiFab, finestFillLevel, varNames, destComps); } // --------------------------------------------------------------- void AmrData::FillVar(MultiFab &destMultiFab, int finestFillLevel, const Array &varNames, const Array &destFillComps) { // This function fills the destMultiFab which is defined on // the finestFillLevel. BL_ASSERT(finestFillLevel >= 0 && finestFillLevel <= finestLevel); BoxArray destBoxes(destMultiFab.boxArray()); for(int iIndex = 0; iIndex < destBoxes.size(); ++iIndex) { BL_ASSERT(probDomain[finestFillLevel].contains(destBoxes[iIndex])); } int myProc(ParallelDescriptor::MyProc()); int srcComp(0); // always 0 since AmrData uses single component MultiFabs int nFillComps(1); // always int currentLevel; Array cumulativeRefRatios(finestFillLevel + 1, -1); cumulativeRefRatios[finestFillLevel] = 1; for(currentLevel = finestFillLevel - 1; currentLevel >= 0; --currentLevel) { cumulativeRefRatios[currentLevel] = cumulativeRefRatios[currentLevel + 1] * refRatio[currentLevel]; } BL_ASSERT(varNames.size() == destFillComps.size()); int nFillVars(varNames.size()); for(int currentFillIndex(0); currentFillIndex < nFillVars; ++currentFillIndex) { int destComp(destFillComps[currentFillIndex]); int stateIndex(StateNumber(varNames[currentFillIndex])); // ensure the required grids are in memory for(currentLevel = 0; currentLevel <= finestFillLevel; ++currentLevel) { for(int iBox = 0; iBox < destBoxes.size(); ++iBox) { Box tempCoarseBox(destBoxes[iBox]); if(currentLevel != finestFillLevel) { tempCoarseBox.coarsen(cumulativeRefRatios[currentLevel]); } GetGrids(currentLevel, stateIndex, tempCoarseBox); } } MultiFabCopyDescriptor multiFabCopyDesc; Array stateDataMFId(finestFillLevel + 1); for(currentLevel = 0; currentLevel <= finestFillLevel; ++currentLevel) { stateDataMFId[currentLevel] = multiFabCopyDesc.RegisterFabArray(dataGrids[currentLevel][stateIndex]); } BoxArray localMFBoxes(destBoxes.size()); // These are the ones // we want to fillpatch. Array< Array< Array< Array > > > fillBoxId; Array< Array< Array< Array > > > fillBoxIdBAs; // [grid][level][fillablesubbox][oldnew] // oldnew not used here Array< Array< Array > > savedFineBox; // [grid][level][fillablesubbox] fillBoxId.resize(destBoxes.size()); fillBoxIdBAs.resize(destBoxes.size()); savedFineBox.resize(destBoxes.size()); for(int iBox(0); iBox < destBoxes.size(); ++iBox) { if(destMultiFab.DistributionMap()[iBox] == myProc) { localMFBoxes.set(iBox, destBoxes[iBox]); fillBoxId[iBox].resize(finestFillLevel + 1); fillBoxIdBAs[iBox].resize(finestFillLevel + 1); savedFineBox[iBox].resize(finestFillLevel + 1); } } IndexType boxType(destBoxes[0].ixType()); BoxList unfilledBoxesOnThisLevel(boxType); BoxList unfillableBoxesOnThisLevel(boxType); // Do this for all local fab boxes. for(int ibox(0); ibox < localMFBoxes.size(); ++ibox) { if(destMultiFab.DistributionMap()[ibox] != myProc) { continue; } unfilledBoxesOnThisLevel.clear(); BL_ASSERT(unfilledBoxesOnThisLevel.ixType() == boxType); BL_ASSERT(unfilledBoxesOnThisLevel.ixType() == localMFBoxes[ibox].ixType()); unfilledBoxesOnThisLevel.push_back(localMFBoxes[ibox]); // Find the boxes that can be filled on each level--these are all // defined at their level of refinement. bool needsFilling(true); for(currentLevel = finestFillLevel; currentLevel >= 0 && needsFilling; --currentLevel) { unfillableBoxesOnThisLevel.clear(); const Box ¤tPDomain = probDomain[currentLevel]; int ufbLength(unfilledBoxesOnThisLevel.size()); fillBoxId[ibox][currentLevel].resize(ufbLength); fillBoxIdBAs[ibox][currentLevel].resize(ufbLength); savedFineBox[ibox][currentLevel].resize(ufbLength); int currentBLI(0); for(BoxList::iterator bli = unfilledBoxesOnThisLevel.begin(); bli != unfilledBoxesOnThisLevel.end(); ++bli) { BL_ASSERT(bli->ok()); Box coarseDestBox(*bli); Box fineTruncDestBox(coarseDestBox & currentPDomain); if(fineTruncDestBox.ok()) { fineTruncDestBox.refine(cumulativeRefRatios[currentLevel]); Box tempCoarseBox; if(currentLevel == finestFillLevel) { tempCoarseBox = fineTruncDestBox; } else { tempCoarseBox = fineTruncDestBox; // check this vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv tempCoarseBox.coarsen(cumulativeRefRatios[currentLevel]); } savedFineBox[ibox][currentLevel][currentBLI] = fineTruncDestBox; BL_ASSERT(localMFBoxes[ibox].intersects(fineTruncDestBox)); BoxList tempUnfillableBoxes(boxType); fillBoxId[ibox][currentLevel][currentBLI].resize(1); fillBoxIdBAs[ibox][currentLevel][currentBLI].resize(1); fillBoxId[ibox][currentLevel][currentBLI][0] = multiFabCopyDesc.AddBox(stateDataMFId[currentLevel], tempCoarseBox, &tempUnfillableBoxes, srcComp, 0, 1); fillBoxIdBAs[ibox][currentLevel][currentBLI][0] = BoxArray(BoxLib::complementIn(tempCoarseBox, tempUnfillableBoxes)); unfillableBoxesOnThisLevel.join(tempUnfillableBoxes); ++currentBLI; } } unfilledBoxesOnThisLevel.clear(); unfilledBoxesOnThisLevel = unfillableBoxesOnThisLevel.intersect(currentPDomain); if(unfilledBoxesOnThisLevel.isEmpty()) { needsFilling = false; } else { Box coarseLocalMFBox(localMFBoxes[ibox]); coarseLocalMFBox.coarsen(cumulativeRefRatios[currentLevel]); unfilledBoxesOnThisLevel.intersect(coarseLocalMFBox); // check this vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv if(currentLevel != 0) { unfilledBoxesOnThisLevel.coarsen(refRatio[currentLevel - 1]); } if(currentLevel == 0) { BoxList unfilledInside = unfilledBoxesOnThisLevel.intersect(currentPDomain); if( ! unfilledInside.isEmpty()) { unfilledInside.intersect(coarseLocalMFBox); BL_ASSERT(unfilledInside.isEmpty()); } } } } } multiFabCopyDesc.CollectData(); for(int currentIndex = 0; currentIndex < destBoxes.size(); ++currentIndex) { if(destMultiFab.DistributionMap()[currentIndex] != myProc) { continue; } for(int currentLevel(0); currentLevel <= finestFillLevel; ++currentLevel) { for(int currentBox(0); currentBox < fillBoxId[currentIndex][currentLevel].size(); ++currentBox) { Box tempCoarseBox( fillBoxId[currentIndex][currentLevel][currentBox][0].box()); FArrayBox tempCoarseDestFab(tempCoarseBox, 1); tempCoarseDestFab.setVal(1.e30); multiFabCopyDesc.FillFab(stateDataMFId[currentLevel], fillBoxId[currentIndex][currentLevel][currentBox][0], tempCoarseDestFab); Box intersectDestBox(savedFineBox[currentIndex][currentLevel][currentBox]); intersectDestBox &= destMultiFab[currentIndex].box(); const BoxArray &filledBoxes = fillBoxIdBAs[currentIndex][currentLevel][currentBox][0]; BoxArray fboxes(filledBoxes); FArrayBox *copyFromThisFab; const BoxArray *copyFromTheseBoxes; FArrayBox tempCurrentFillPatchedFab; if(intersectDestBox.ok()) { if(currentLevel != finestFillLevel) { fboxes.refine(cumulativeRefRatios[currentLevel]); // Interpolate up to fine patch. tempCurrentFillPatchedFab.resize(intersectDestBox, nFillComps); tempCurrentFillPatchedFab.setVal(1.e30); BL_ASSERT(intersectDestBox.ok()); BL_ASSERT( tempCoarseDestFab.box().ok()); PcInterp(tempCurrentFillPatchedFab, tempCoarseDestFab, intersectDestBox, cumulativeRefRatios[currentLevel]); copyFromThisFab = &tempCurrentFillPatchedFab; copyFromTheseBoxes = &fboxes; } else { copyFromThisFab = &tempCoarseDestFab; copyFromTheseBoxes = &filledBoxes; } for(int iFillBox(0); iFillBox < copyFromTheseBoxes->size(); ++iFillBox) { Box srcdestBox((*copyFromTheseBoxes)[iFillBox]); srcdestBox &= destMultiFab[currentIndex].box(); srcdestBox &= intersectDestBox; if(srcdestBox.ok()) { destMultiFab[currentIndex].copy(*copyFromThisFab, srcdestBox, 0, srcdestBox, destComp, nFillComps); } } } } } // end for(currentLevel...) } // end for(currentIndex...) } // end for(currentFillIndex...) } // --------------------------------------------------------------- void AmrData::FillVar(Array &destFabs, const Array &destBoxes, int finestFillLevel, const string &varname, int procWithFabs) { // // This function fills dest only on procWithFabs. All other dest // pointers (on other processors) should be NULL. destBox // on all processors must be defined. // BL_ASSERT(finestFillLevel >= 0 && finestFillLevel <= finestLevel); for(int iIndex(0); iIndex < destBoxes.size(); ++iIndex) { BL_ASSERT(probDomain[finestFillLevel].contains(destBoxes[iIndex])); } int myproc(ParallelDescriptor::MyProc()); int stateIndex(StateNumber(varname)); int srcComp(0); int destComp(0); int numFillComps(1); int currentLevel; Array cumulativeRefRatios(finestFillLevel + 1, -1); cumulativeRefRatios[finestFillLevel] = 1; for(currentLevel = finestFillLevel - 1; currentLevel >= 0; --currentLevel) { cumulativeRefRatios[currentLevel] = cumulativeRefRatios[currentLevel + 1] * refRatio[currentLevel]; } // ensure the required grids are in memory for(currentLevel = 0; currentLevel <= finestFillLevel; ++currentLevel) { for(int iBox = 0; iBox < destBoxes.size(); ++iBox) { Box tempCoarseBox(destBoxes[iBox]); if(currentLevel != finestFillLevel) { tempCoarseBox.coarsen(cumulativeRefRatios[currentLevel]); } GetGrids(currentLevel, stateIndex, tempCoarseBox); } } MultiFabCopyDescriptor multiFabCopyDesc; Array stateDataMFId(finestFillLevel + 1); for(currentLevel = 0; currentLevel <= finestFillLevel; ++currentLevel) { stateDataMFId[currentLevel] = multiFabCopyDesc.RegisterFabArray(dataGrids[currentLevel][stateIndex]); } Array localMFBoxes; // These are the ones we want to fillpatch. Array< Array< Array< Array > > > fillBoxId; Array< Array< Array< Array > > > fillBoxIdBAs; // [grid][level][fillablesubbox][oldnew] // oldnew not used here Array< Array< Array > > savedFineBox; // [grid][level][fillablesubbox] if(myproc == procWithFabs) { localMFBoxes = destBoxes; fillBoxId.resize(destBoxes.size()); fillBoxIdBAs.resize(destBoxes.size()); savedFineBox.resize(destBoxes.size()); for(int iLocal = 0; iLocal < localMFBoxes.size(); ++iLocal) { fillBoxId[iLocal].resize(finestFillLevel + 1); fillBoxIdBAs[iLocal].resize(finestFillLevel + 1); savedFineBox[iLocal].resize(finestFillLevel + 1); } } IndexType boxType(destBoxes[0].ixType()); BoxList unfilledBoxesOnThisLevel(boxType); BoxList unfillableBoxesOnThisLevel(boxType); // Do this for all local fab boxes. for(int ibox(0); ibox < localMFBoxes.size(); ++ibox) { unfilledBoxesOnThisLevel.clear(); BL_ASSERT(unfilledBoxesOnThisLevel.ixType() == boxType); BL_ASSERT(unfilledBoxesOnThisLevel.ixType() == localMFBoxes[ibox].ixType()); unfilledBoxesOnThisLevel.push_back(localMFBoxes[ibox]); // Find the boxes that can be filled on each level--these are all // defined at their level of refinement. bool needsFilling(true); for(currentLevel = finestFillLevel; currentLevel >= 0 && needsFilling; --currentLevel) { unfillableBoxesOnThisLevel.clear(); const Box ¤tPDomain = probDomain[currentLevel]; int ufbLength = unfilledBoxesOnThisLevel.size(); fillBoxId[ibox][currentLevel].resize(ufbLength); fillBoxIdBAs[ibox][currentLevel].resize(ufbLength); savedFineBox[ibox][currentLevel].resize(ufbLength); int currentBLI(0); for(BoxList::iterator bli = unfilledBoxesOnThisLevel.begin(); bli != unfilledBoxesOnThisLevel.end(); ++bli) { BL_ASSERT(bli->ok()); Box coarseDestBox(*bli); Box fineTruncDestBox(coarseDestBox & currentPDomain); if(fineTruncDestBox.ok()) { fineTruncDestBox.refine(cumulativeRefRatios[currentLevel]); Box tempCoarseBox; if(currentLevel == finestFillLevel) { tempCoarseBox = fineTruncDestBox; } else { tempCoarseBox = fineTruncDestBox; // check this vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv tempCoarseBox.coarsen(cumulativeRefRatios[currentLevel]); } savedFineBox[ibox][currentLevel][currentBLI] = fineTruncDestBox; BL_ASSERT(localMFBoxes[ibox].intersects(fineTruncDestBox)); BoxList tempUnfillableBoxes(boxType); fillBoxId[ibox][currentLevel][currentBLI].resize(1); fillBoxIdBAs[ibox][currentLevel][currentBLI].resize(1); fillBoxId[ibox][currentLevel][currentBLI][0] = multiFabCopyDesc.AddBox(stateDataMFId[currentLevel], tempCoarseBox, &tempUnfillableBoxes, srcComp, destComp, numFillComps); fillBoxIdBAs[ibox][currentLevel][currentBLI][0] = BoxArray(BoxLib::complementIn(tempCoarseBox, tempUnfillableBoxes)); unfillableBoxesOnThisLevel.join(tempUnfillableBoxes); ++currentBLI; } } unfilledBoxesOnThisLevel.clear(); unfilledBoxesOnThisLevel = unfillableBoxesOnThisLevel.intersect(currentPDomain); if(unfilledBoxesOnThisLevel.isEmpty()) { needsFilling = false; } else { Box coarseLocalMFBox(localMFBoxes[ibox]); coarseLocalMFBox.coarsen(cumulativeRefRatios[currentLevel]); unfilledBoxesOnThisLevel.intersect(coarseLocalMFBox); // check this vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv if(currentLevel != 0) { unfilledBoxesOnThisLevel.coarsen(refRatio[currentLevel - 1]); } if(currentLevel == 0) { BoxList unfilledInside = unfilledBoxesOnThisLevel.intersect(currentPDomain); if( ! unfilledInside.isEmpty()) { unfilledInside.intersect(coarseLocalMFBox); BL_ASSERT(unfilledInside.isEmpty()); } } } } } multiFabCopyDesc.CollectData(); for(int currentIndex = 0; currentIndex < destBoxes.size(); ++currentIndex) { for(int currentLevel = 0; currentLevel <= finestFillLevel; ++currentLevel) { if(myproc != procWithFabs) { break; } for(int currentBox(0); currentBox < fillBoxId[currentIndex][currentLevel].size(); ++currentBox) { Box tempCoarseBox( fillBoxId[currentIndex][currentLevel][currentBox][0].box()); FArrayBox tempCoarseDestFab(tempCoarseBox, numFillComps); tempCoarseDestFab.setVal(1.e30); multiFabCopyDesc.FillFab(stateDataMFId[currentLevel], fillBoxId[currentIndex][currentLevel][currentBox][0], tempCoarseDestFab); Box intersectDestBox(savedFineBox[currentIndex][currentLevel][currentBox]); intersectDestBox &= destFabs[currentIndex]->box(); const BoxArray &filledBoxes = fillBoxIdBAs[currentIndex][currentLevel][currentBox][0]; BoxArray fboxes(filledBoxes); FArrayBox *copyFromThisFab; const BoxArray *copyFromTheseBoxes; FArrayBox tempCurrentFillPatchedFab; if(intersectDestBox.ok()) { if(currentLevel != finestFillLevel) { fboxes.refine(cumulativeRefRatios[currentLevel]); // Interpolate up to fine patch. tempCurrentFillPatchedFab.resize(intersectDestBox, numFillComps); tempCurrentFillPatchedFab.setVal(1.e30); BL_ASSERT(intersectDestBox.ok()); BL_ASSERT( tempCoarseDestFab.box().ok()); PcInterp(tempCurrentFillPatchedFab, tempCoarseDestFab, intersectDestBox, cumulativeRefRatios[currentLevel]); copyFromThisFab = &tempCurrentFillPatchedFab; copyFromTheseBoxes = &fboxes; } else { copyFromThisFab = &tempCoarseDestFab; copyFromTheseBoxes = &filledBoxes; } for(int iFillBox(0); iFillBox < copyFromTheseBoxes->size(); ++iFillBox) { Box srcdestBox((*copyFromTheseBoxes)[iFillBox]); srcdestBox &= destFabs[currentIndex]->box(); srcdestBox &= intersectDestBox; if(srcdestBox.ok()) { destFabs[currentIndex]->copy(*copyFromThisFab, srcdestBox, 0, srcdestBox, destComp, numFillComps); } } } } } // end for(currentLevel...) } // end for(currentIndex...) } // end FillVar for a fab on a single processor // --------------------------------------------------------------- void AmrData::FillInterior(FArrayBox &dest, int level, const Box &subbox) { BoxLib::Abort("Error: should not be in AmrData::FillInterior"); } // --------------------------------------------------------------- int AmrData::NumDeriveFunc() const { return (plotVars.size()); } // --------------------------------------------------------------- // return true if the given name is the name of a plot variable // that can be derived from what is known. // --------------------------------------------------------------- bool AmrData::CanDerive(const string &name) const { for(int i(0); i < plotVars.size(); ++i) { if(plotVars[i] == name) { return true; } } return false; } // --------------------------------------------------------------- // output the list of variables that can be derived // --------------------------------------------------------------- void AmrData::ListDeriveFunc(std::ostream &os) const { for(int i(0); i < plotVars.size(); ++i) { os << plotVars[i] << endl; } } // --------------------------------------------------------------- int AmrData::NIntersectingGrids(int level, const Box &b) const { BL_ASSERT(level >=0 && level <= finestLevel); BL_ASSERT(b.ok()); int nGrids(0); if(fileType == FAB || (fileType == MULTIFAB && level == 0)) { nGrids = 1; } else { const BoxArray &visMFBA = visMF[level][0]->boxArray(); for(int boxIndex = 0; boxIndex < visMFBA.size(); ++boxIndex) { if(b.intersects(visMFBA[boxIndex])) { ++nGrids; } } } return nGrids; } // --------------------------------------------------------------- int AmrData::FinestContainingLevel(const Box &b, int startLevel) const { BL_ASSERT(startLevel >= 0 && startLevel <= finestLevel); BL_ASSERT(b.ok()); if(fileType == FAB) { return 0; } else { Box levelBox(b); for(int level = startLevel; level > 0; --level) { const BoxArray &visMFBA = visMF[level][0]->boxArray(); if(visMFBA.contains(levelBox)) { return level; } levelBox.coarsen(refRatio[level - 1]); } } return 0; } // --------------------------------------------------------------- int AmrData::FinestIntersectingLevel(const Box &b, int startLevel) const { BL_ASSERT(startLevel >= 0 && startLevel <= finestLevel); BL_ASSERT(b.ok()); if(fileType == FAB) { return 0; } else { Box levelBox(b); for(int level(startLevel); level > 0; --level) { const BoxArray &visMFBA = visMF[level][0]->boxArray(); for(int iBox(0); iBox < visMFBA.size(); ++iBox) { if(visMFBA[iBox].intersects(levelBox)) { return level; } } levelBox.coarsen(refRatio[level - 1]); } } return 0; } // --------------------------------------------------------------- MultiFab &AmrData::GetGrids(int level, int componentIndex) { for(MFIter mfi(*dataGrids[level][componentIndex]); mfi.isValid(); ++mfi) { DefineFab(level, componentIndex, mfi.index()); } return *dataGrids[level][componentIndex]; } // --------------------------------------------------------------- MultiFab &AmrData::GetGrids(int level, int componentIndex, const Box &onBox) { if(fileType == FAB || (fileType == MULTIFAB && level == 0)) { // do nothing } else { int whichVisMF(compIndexToVisMFMap[componentIndex]); for(MFIter mfi(*dataGrids[level][componentIndex]); mfi.isValid(); ++mfi) { if(onBox.intersects(visMF[level][whichVisMF]->boxArray()[mfi.index()])) { DefineFab(level, componentIndex, mfi.index()); } } } return *dataGrids[level][componentIndex]; } // --------------------------------------------------------------- bool AmrData::DefineFab(int level, int componentIndex, int fabIndex) { if( ! dataGridsDefined[level][componentIndex][fabIndex]) { int whichVisMF(compIndexToVisMFMap[componentIndex]); int whichVisMFComponent(compIndexToVisMFComponentMap[componentIndex]); dataGrids[level][componentIndex]->setFab(fabIndex, visMF[level][whichVisMF]->readFAB(fabIndex, whichVisMFComponent)); dataGridsDefined[level][componentIndex][fabIndex] = true; } return true; } // --------------------------------------------------------------- void AmrData::FlushGrids(int componentIndex) { for(int lev = 0; lev <= finestLevel; ++lev) { dataGrids[lev][componentIndex]->clear(); for(MFIter mfi(*dataGrids[lev][componentIndex]); mfi.isValid(); ++mfi) { dataGridsDefined[lev][componentIndex][mfi.index()] = false; } } } // --------------------------------------------------------------- bool AmrData::MinMax(const Box &onBox, const string &derived, int level, Real &dataMin, Real &dataMax) { BL_ASSERT(level >= 0 && level <= finestLevel); BL_ASSERT(onBox.ok()); bool valid(false); // does onBox intersect any grids (are minmax valid) Real minVal, maxVal; dataMin = AV_BIG_REAL; dataMax = -AV_BIG_REAL; Box overlap; // our strategy here is to use the VisMF min and maxes if possible // first, test if onBox completely contains each multifab box // if so, use VisMF min and max // if not, test if VisMF min and max are within dataMin and dataMax // if so, use VisMF min and max int compIndex(StateNumber(derived)); if(fileType == FAB || (fileType == MULTIFAB && level == 0)) { for(MFIter gpli(*dataGrids[level][compIndex]); gpli.isValid(); ++gpli) { if(onBox.intersects(dataGrids[level][compIndex]->boxArray()[gpli.index()])) { valid = true; overlap = onBox; overlap &= gpli.validbox(); minVal = (*dataGrids[level][compIndex])[gpli].min(overlap, 0); maxVal = (*dataGrids[level][compIndex])[gpli].max(overlap, 0); dataMin = min(dataMin, minVal); dataMax = max(dataMax, maxVal); } } } else if(bCartGrid && (compIndex != StateNumber("vfrac"))) { for(MFIter gpli(*dataGrids[level][compIndex]); gpli.isValid(); ++gpli) { /* int whichVisMF(compIndexToVisMFMap[compIndex]); int whichVisMFComponent(compIndexToVisMFComponentMap[compIndex]); Real visMFMin(visMF[level][whichVisMF]->min(gpli.index(), whichVisMFComponent)); Real visMFMax(visMF[level][whichVisMF]->max(gpli.index(), whichVisMFComponent)); if(onBox.contains(gpli.validbox())) { dataMin = min(dataMin, visMFMin); dataMax = max(dataMax, visMFMax); valid = true; } else if(onBox.intersects(visMF[level][whichVisMF]-> boxArray()[gpli.index()])) { if(visMFMin < dataMin || visMFMax > dataMax) { // do it the hard way DefineFab(level, compIndex, gpli.index()); valid = true; overlap = onBox; overlap &= gpli.validbox(); minVal = (*dataGrids[level][compIndex])[gpli].min(overlap, 0); maxVal = (*dataGrids[level][compIndex])[gpli].max(overlap, 0); dataMin = min(dataMin, minVal); dataMax = max(dataMax, maxVal); } // end if(visMFMin...) } */ if(onBox.intersects(gpli.validbox())) { int vfIndex(StateNumber("vfrac")); DefineFab(level, compIndex, gpli.index()); DefineFab(level, vfIndex, gpli.index()); Real *ddat = (*dataGrids[level][compIndex])[gpli].dataPtr(); Real *vdat = (*dataGrids[level][vfIndex])[gpli].dataPtr(); const int *dlo = (*dataGrids[level][compIndex])[gpli].loVect(); const int *dhi = (*dataGrids[level][compIndex])[gpli].hiVect(); overlap = onBox; overlap &= gpli.validbox(); Real vfMaxVal = (*dataGrids[level][vfIndex])[gpli].max(overlap, 0); if(vfMaxVal >= vfEps[level]) { valid = true; FORT_CARTGRIDMINMAX(ddat, ARLIM(dlo), ARLIM(dhi), vdat, vfEps[level], minVal, maxVal); dataMin = min(dataMin, minVal); dataMax = max(dataMax, maxVal); } } } } else { for(MFIter gpli(*dataGrids[level][compIndex]); gpli.isValid(); ++gpli) { int whichVisMF(compIndexToVisMFMap[compIndex]); int whichVisMFComponent(compIndexToVisMFComponentMap[compIndex]); Real visMFMin(visMF[level][whichVisMF]->min(gpli.index(), whichVisMFComponent)); Real visMFMax(visMF[level][whichVisMF]->max(gpli.index(), whichVisMFComponent)); #ifdef BL_ALWAYS_FIX_DENORMALS # if defined(BL_T3E) int dsFpClassMin(DS_FP_CLASS(visMFMin)); if(dsFpClassMin == FP_SUBNORMAL) { visMFMin = 0.0; } int dsFpClassMax(DS_FP_CLASS(visMFMax)); if(dsFpClassMax == FP_SUBNORMAL) { visMFMax = 0.0; } # else int dsFpClassMin(DS_FP_CLASS(visMFMin)); if(dsFpClassMin == FP_POS_DENORM || dsFpClassMin == FP_NEG_DENORM) { visMFMin = 0.0; } int dsFpClassMax(DS_FP_CLASS(visMFMax)); if(dsFpClassMax == FP_POS_DENORM || dsFpClassMax == FP_NEG_DENORM) { visMFMax = 0.0; } # endif #endif if(onBox.contains(gpli.validbox())) { dataMin = min(dataMin, visMFMin); dataMax = max(dataMax, visMFMax); valid = true; } else if(onBox.intersects(visMF[level][whichVisMF]-> boxArray()[gpli.index()])) { if(visMFMin < dataMin || visMFMax > dataMax) { // do it the hard way DefineFab(level, compIndex, gpli.index()); valid = true; overlap = onBox; overlap &= gpli.validbox(); minVal = (*dataGrids[level][compIndex])[gpli].min(overlap, 0); maxVal = (*dataGrids[level][compIndex])[gpli].max(overlap, 0); dataMin = min(dataMin, minVal); dataMax = max(dataMax, maxVal); } // end if(visMFMin...) } } } ParallelDescriptor::ReduceRealMin(dataMin); ParallelDescriptor::ReduceRealMax(dataMax); return valid; } // end MinMax // --------------------------------------------------------------- int AmrData::StateNumber(const string &statename) const { for(int ivar = 0; ivar < plotVars.size(); ivar++) { if(statename == plotVars[ivar]) { return ivar; } } return(-1); } // --------------------------------------------------------------- void AmrData::Interp(FArrayBox &fine, FArrayBox &crse, const Box &fine_box, int lrat) { BL_ASSERT(fine.box().contains(fine_box)); Box crse_bx(BoxLib::coarsen(fine_box,lrat)); Box fslope_bx(BoxLib::refine(crse_bx,lrat)); Box cslope_bx(crse_bx); cslope_bx.grow(1); BL_ASSERT(crse.box() == cslope_bx); // alloc temp space for coarse grid slopes long cLen = cslope_bx.numPts(); Real *cslope = new Real[BL_SPACEDIM*cLen]; long loslp = cslope_bx.index(crse_bx.smallEnd()); long hislp = cslope_bx.index(crse_bx.bigEnd()); long cslope_vol = cslope_bx.numPts(); long clo = 1 - loslp; long chi = clo + cslope_vol - 1; cLen = hislp - loslp + 1; // alloc temp space for one strip of fine grid slopes int dir; int fLen = fslope_bx.longside(dir); Real *fdat = new Real[(BL_SPACEDIM+2)*fLen]; Real *foff = fdat + fLen; Real *fslope = foff + fLen; // alloc tmp space for slope calc and to allow for vectorization const int *fblo = fine_box.loVect(); const int *fbhi = fine_box.hiVect(); const int *cblo = crse_bx.loVect(); const int *cbhi = crse_bx.hiVect(); const int *fslo = fslope_bx.loVect(); const int *fshi = fslope_bx.hiVect(); FORT_CINTERP(fine.dataPtr(0),ARLIM(fine.loVect()),ARLIM(fine.hiVect()), fblo,fbhi,fine.nComp(),lrat, crse.dataPtr(0),clo,chi,cblo,cbhi,fslo,fshi, cslope,cLen,fslope,fdat,fLen,foff); delete [] fdat; delete [] cslope; } // --------------------------------------------------------------- void AmrData::PcInterp(FArrayBox &fine, const FArrayBox &crse, const Box &subbox, int lrat) { BL_ASSERT(fine.box().contains(subbox)); BL_ASSERT(fine.nComp() == crse.nComp()); Box cfine(crse.box()); cfine.refine(lrat); Box fine_ovlp(subbox); fine_ovlp &= cfine; if(fine_ovlp.ok()) { const int *fblo = fine_ovlp.smallEnd().getVect(); const int *fbhi = fine_ovlp.bigEnd().getVect(); Box crse_ovlp(fine_ovlp); crse_ovlp.coarsen(lrat); const int *cblo = crse_ovlp.smallEnd().getVect(); const int *cbhi = crse_ovlp.bigEnd().getVect(); Box fine_temp(crse_ovlp); fine_temp.refine(lrat); int tlo = fine_temp.smallEnd()[0]; int thi = fine_temp.bigEnd()[0]; Real *tempSpace = new Real[thi-tlo+1]; FORT_PCINTERP(fine.dataPtr(0),ARLIM(fine.loVect()),ARLIM(fine.hiVect()), fblo,fbhi, lrat,fine.nComp(), crse.dataPtr(),ARLIM(crse.loVect()),ARLIM(crse.hiVect()), cblo,cbhi, tempSpace,tlo,thi); delete [] tempSpace; } } // --------------------------------------------------------------- FArrayBox *AmrData::ReadGrid(std::istream &is, int numVar) { long i, gstep; Real time; static int gridCount(0); Box gbox; int glev; int gid(gridCount); ++gridCount; is >> gbox >> glev; VSHOWVAL(verbose, gbox) VSHOWVAL(verbose, glev) is >> gstep >> time; VSHOWVAL(verbose, gstep) VSHOWVAL(verbose, time) for(i = 0; i < BL_SPACEDIM; ++i) { Real xlo, xhi; is >> xlo >> xhi; // unused if(verbose) { cout << "xlo xhi [" << i << "] = " << xlo << " " << xhi << endl; } } while (is.get() != '\n') { ; // do nothing } FArrayBox *fabPtr = new FArrayBox(gbox, numVar); int whileTrap(0); int ivar(0); // optimize this for numVar == newdat.nComp() while(ivar < numVar) { //FArrayBox tempfab(is); FArrayBox tempfab; tempfab.readFrom(is); fabPtr->copy(tempfab, 0, ivar, tempfab.nComp()); ivar += tempfab.nComp(); if(++whileTrap > 256) { // an arbitrarily large number cerr << "Error in GridPlot: whileTrap caught loop." << endl; exit(-4); } } if(verbose) { cout << "Constructing Grid, lev = " << glev << " id = " << gid; cout << " box = " << gbox << endl; } return fabPtr; } // --------------------------------------------------------------- // --------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/WriteRGB.cpp0000644000175000017500000002704711634153073021443 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: WriteRGB.cpp,v 1.10 2001/10/17 17:53:33 lijewski Exp $ // // --------------------------------------------------------------- // WriteRGB.cpp // --------------------------------------------------------------- #include #define IMAGIC 0732 /* colormap of images */ #define CM_NORMAL 0 /* file contains rows of values which * are either RGB values (zsize == 3) * or greyramp values (zsize == 1) */ #define CM_DITHERED 1 #define CM_SCREEN 2 /* file contains data which is a screen * image; getrow returns buffer which * can be displayed directly with * writepixels */ #define CM_COLORMAP 3 /* a colormap file */ #define TYPEMASK 0xff00 #define BPPMASK 0x00ff #define ITYPE_VERBATIM 0x0000 #define ITYPE_RLE 0x0100 #define ISRLE(type) (((type) & 0xff00) == ITYPE_RLE) #define ISVERBATIM(type) (((type) & 0xff00) == ITYPE_VERBATIM) #define BPP(type) ((type) & BPPMASK) #define RLE(bpp) (ITYPE_RLE | (bpp)) #define VERBATIM(bpp) (ITYPE_VERBATIM | (bpp)) #define IBUFSIZE(pixels) ((pixels+(pixels>>6))<<2) #define RLE_NOP 0x00 #define ierror(p) (((p)->flags&_IOERR)!=0) #define ifileno(p) ((p)->file) #define getpix(p) (--(p)->cnt>=0 ? *(p)->ptr++ : ifilbuf(p)) #define putpix(p,x) (--(p)->cnt>=0 \ ? ((int)(*(p)->ptr++=(unsigned)(x))) \ : iflsbuf(p,(unsigned)(x))) typedef struct { unsigned short imagic; // stuff saved on disk unsigned short type; unsigned short dim; unsigned short xsize; unsigned short ysize; unsigned short zsize; unsigned long min; unsigned long max; unsigned long wastebytes; char name[80]; unsigned long colormap; long file; // stuff used in core only unsigned short flags; short dorev; short x; short y; short z; short cnt; unsigned short *ptr; unsigned short *base; unsigned short *tmpbuf; unsigned long offset; unsigned long rleend; // for rle images unsigned long *rowstart; // for rle images long *rowsize; // for rle images } IMAGE; IMAGE *iopen(); unsigned short *ibufalloc(); // ------------------------------------------------------------- IMAGE *iopen(char *file, char *mode, unsigned int type, unsigned int dim, unsigned int xsize, unsigned int ysize, unsigned int zsize) { return(imgopen(0, file, mode, type, dim, xsize, ysize, zsize)); } // ------------------------------------------------------------- IMAGE *imgopen(int f, char *file, char *mode, unsigned int type, unsigned int dim, unsigned int xsize, unsigned int ysize, unsigned int zsize) { IMAGE *image; int tablesize; int i, max; image = (IMAGE*)calloc(1,sizeof(IMAGE)); if(*mode=='w') { if(file) { f = creat(file, 0666); } if(f < 0) { cerr << "iopen: can't open output file " << file << endl; return NULL; } image->imagic = IMAGIC; image->type = type; image->xsize = xsize; image->ysize = 1; image->zsize = 1; if(dim>1) { image->ysize = ysize; } if(dim>2) { image->zsize = zsize; } if(image->zsize == 1) { image->dim = 2; if(image->ysize == 1) { image->dim = 1; } } else { image->dim = 3; } image->min = 10000000; image->max = 0; isetname(image,"no name"); image->wastebytes = 0; image->dorev = 0; if(write(f,image,sizeof(IMAGE)) != sizeof(IMAGE)) { cerr << "iopen: error on write of image header" << endl; return NULL; } } else { } image->flags = _IOREAD; if(ISRLE(image->type)) { tablesize = image->ysize*image->zsize*sizeof(long); image->rowstart = (unsigned long *)malloc(tablesize); image->rowsize = (long *)malloc(tablesize); if( image->rowstart == 0 || image->rowsize == 0 ) { cerr << "iopen: error on table alloc" << endl; return NULL; } image->rleend = 512L+2*tablesize; if(*mode=='w') { max = image->ysize*image->zsize; for(i = 0; i < max; ++i) { image->rowstart[i] = 0; image->rowsize[i] = -1; } } } image->cnt = 0; image->ptr = 0; image->base = 0; if( (image->tmpbuf = ibufalloc(image)) == 0 ) { cerr << "iopen: error on tmpbuf alloc " << image->xsize << endl; return NULL; } image->x = image->y = image->z = 0; image->file = f; image->offset = 512L; // set up for img_optseek lseek(image->file, 512L, 0); return(image); } //---------------------------------------------------------------- unsigned short *ibufalloc(IMAGE *image) { return (unsigned short *) malloc(IBUFSIZE(image->xsize)); } //---------------------------------------------------------------- cvtshorts( unsigned short buffer[], long n) { short i; long nshorts = n>>1; unsigned short swrd; for(i = 0; i < nshorts; ++i) { swrd = *buffer; *buffer++ = (swrd>>8) | (swrd<<8); } } //---------------------------------------------------------------- int putrow(IMAGE *image, unsigned short *buffer, unsigned int y, unsigned int z) { unsigned short *sptr; unsigned char *cptr; unsigned int x; unsigned long min, max; long cnt; if( ! (image->flags & (_IORW|_IOWRT)) ) { return -1; } if(image->dim < 3) { z = 0; } if(image->dim < 2) { y = 0; } if(ISVERBATIM(image->type)) { switch(BPP(image->type)) { case 1: min = image->min; max = image->max; cptr = (unsigned char *)image->tmpbuf; sptr = buffer; for(x=image->xsize; --x;) { *cptr = *sptr++; if(*cptr > max) { max = *cptr; } if(*cptr < min) { min = *cptr; } ++cptr; } image->min = min; image->max = max; img_seek(image,y,z); cnt = image->xsize; if(img_write(image,image->tmpbuf,cnt) != cnt) { return -1; } else { return cnt; } break; case 2: min = image->min; max = image->max; sptr = buffer; for(x=image->xsize; --x;) { if(*sptr > max) { max = *sptr; } if(*sptr < min) { min = *sptr; } ++sptr; } image->min = min; image->max = max; img_seek(image,y,z); cnt = image->xsize<<1; if(image->dorev) { cvtshorts(buffer,cnt); } if(img_write(image,buffer,cnt) != cnt) { if(image->dorev) { cvtshorts(buffer,cnt); } return -1; } else { if(image->dorev) { cvtshorts(buffer,cnt); } return image->xsize; } break; default: cerr << "putrow: weird bpp" << endl; } } else if(ISRLE(image->type)) { switch(BPP(image->type)) { case 1: min = image->min; max = image->max; sptr = buffer; for(x = image->xsize; --x;) { if(*sptr > max) { max = *sptr; } if(*sptr < min) { min = *sptr; } ++sptr; } image->min = min; image->max = max; cnt = img_rle_compact(buffer,2,image->tmpbuf,1,image->xsize); img_setrowsize(image,cnt,y,z); img_seek(image,y,z); if(img_write(image,image->tmpbuf,cnt) != cnt) { return -1; } else { return image->xsize; } break; case 2: min = image->min; max = image->max; sptr = buffer; for(x=image->xsize; --x;) { if(*sptr > max) { max = *sptr; } if(*sptr < min) { min = *sptr; } ++sptr; } image->min = min; image->max = max; cnt = img_rle_compact(buffer,2,image->tmpbuf,2,image->xsize); cnt <<= 1; img_setrowsize(image,cnt,y,z); img_seek(image,y,z); if(image->dorev) { cvtshorts(image->tmpbuf,cnt); } if(img_write(image,image->tmpbuf,cnt) != cnt) { if(image->dorev) cvtshorts(image->tmpbuf,cnt); return -1; } else { if(image->dorev) cvtshorts(image->tmpbuf,cnt); return image->xsize; } break; default: cerr << "putrow: weird bpp\n" << endl; } } else { cerr << "putrow: bad image type" << endl; } } // ------------------------------------------------------------- // ------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/DataServices.cpp0000644000175000017500000010164111634153073022364 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: DataServices.cpp,v 1.39 2003/03/12 07:40:56 vince Exp $ // // --------------------------------------------------------------- // DataServices.cpp // --------------------------------------------------------------- #include #include "AmrvisConstants.H" #include "DataServices.H" #include "ParallelDescriptor.H" #ifndef BL_NOLINEVALUES # include "XYPlotDataList.H" #endif #include #include #include using std::ios; using std::ofstream; using std::cout; using std::cerr; using std::endl; using std::min; using std::max; Array DataServices::dsArray; int DataServices::dsArrayIndexCounter = 0; int DataServices::dsFabOutSize = 0; bool DataServices::dsBatchMode = false; namespace ParallelDescriptor { template <> void Bcast (Box *b, size_t n, int root) { const int n3SDim(n * 3 * BL_SPACEDIM); Array tmp(n3SDim); int cnt(0); for(int j(0); j < n; ++j) { for(int i(0); i < BL_SPACEDIM; ++i) { tmp[cnt++] = b[j].smallEnd(i); } for(int i(0); i < BL_SPACEDIM; ++i) { tmp[cnt++] = b[j].bigEnd(i); } IntVect indx = b[j].type(); for(int i(0); i < BL_SPACEDIM; ++i) { tmp[cnt++] = indx[i]; } } BL_ASSERT(n3SDim == cnt); ParallelDescriptor::Bcast(&tmp[0], n3SDim, root); cnt = 0; for(int j(0); j < n; ++j) { IntVect sm(&tmp[cnt]); cnt += BL_SPACEDIM; IntVect bg(&tmp[cnt]); cnt += BL_SPACEDIM; IntVect id(&tmp[cnt]); cnt += BL_SPACEDIM; b[j] = Box(sm, bg, id); } } } // end namespace // --------------------------------------------------------------- DataServices::DataServices(const string &filename, const FileType &filetype) : fileName(filename), fileType(filetype), bAmrDataOk(false), iWriteToLevel(-1) { numberOfUsers = 0; // the user must do all incrementing and decrementing bAmrDataOk = amrData.ReadData(fileName, fileType); if(bAmrDataOk) { dsArrayIndex = DataServices::dsArrayIndexCounter; ++DataServices::dsArrayIndexCounter; DataServices::dsArray.resize(DataServices::dsArrayIndexCounter); DataServices::dsArray[dsArrayIndex] = this; } } // --------------------------------------------------------------- DataServices::~DataServices() { BL_ASSERT(numberOfUsers == 0); DataServices::dsArray[dsArrayIndex] = NULL; } // --------------------------------------------------------------- void DataServices::SetBatchMode() { dsBatchMode = true; } // --------------------------------------------------------------- void DataServices::SetFabOutSize(int iSize) { if(iSize == 8 || iSize == 32) { dsFabOutSize = iSize; } else { cerr << "Warning: DataServices::SetFabOutSize: size must be 8 or 32 only." << " Defaulting to native." << endl; dsFabOutSize = 0; } } // --------------------------------------------------------------- void DataServices::Dispatch(DSRequestType requestType, DataServices *ds, ...) { bool bContinueLooping(true); va_list ap; int whichDSIndex; int ioProcNumber(ParallelDescriptor::IOProcessorNumber()); while(bContinueLooping) { if(ParallelDescriptor::IOProcessor() || dsBatchMode) { bContinueLooping = false; } ParallelDescriptor::Barrier(); // procs 1 - N wait here { int tmp = requestType; ParallelDescriptor::Bcast(&tmp, 1, 0); requestType = static_cast(tmp); } // handle new request if(requestType == NewRequest) { // broadcast the fileName and fileType to procs 1 - N char *fileNameCharPtr; int fileNameLength, fileNameLengthPadded, checkArrayIndex; FileType newFileType; if(ParallelDescriptor::IOProcessor()) { fileNameLength = ds->fileName.length(); newFileType = ds->fileType; checkArrayIndex = ds->dsArrayIndex; } ParallelDescriptor::Bcast(&fileNameLength, 1, 0); { int tmp = newFileType; ParallelDescriptor::Bcast(&tmp, 1, 0); newFileType = static_cast(tmp); } ParallelDescriptor::Bcast(&checkArrayIndex, 1, 0); fileNameLengthPadded = fileNameLength + 1; // for the null fileNameLengthPadded += fileNameLengthPadded % 8; // for alignment on the t3e fileNameCharPtr = new char[fileNameLengthPadded]; if(ParallelDescriptor::IOProcessor()) { strcpy(fileNameCharPtr, ds->fileName.c_str()); } ParallelDescriptor::Bcast(fileNameCharPtr, fileNameLengthPadded,0); string newFileName(fileNameCharPtr); delete [] fileNameCharPtr; // make a new DataServices for procs 1 - N if( ! ParallelDescriptor::IOProcessor()) { ds = new DataServices(newFileName, newFileType); } // verify dsArrayIndex is correct BL_ASSERT(ds->dsArrayIndex == checkArrayIndex); continue; // go to the top of the while loop } // end NewRequest // handle exit request if(requestType == ExitRequest) { // cleanup memory for(int i(0); i < dsArray.size(); ++i) { if(DataServices::dsArray[i] != NULL) { BL_ASSERT(DataServices::dsArray[i]->numberOfUsers == 0); delete DataServices::dsArray[i]; } } ParallelDescriptor::EndParallel(); exit(0); } // end ExitRequest if(ParallelDescriptor::IOProcessor()) { va_start(ap, ds); whichDSIndex = ds->dsArrayIndex; } ParallelDescriptor::Bcast(&whichDSIndex, 1, 0); if( ! ParallelDescriptor::IOProcessor()) { ds = DataServices::dsArray[whichDSIndex]; } BL_ASSERT(ds != NULL); switch(requestType) { case DeleteRequest: { bool bDeleteDS(false); BL_ASSERT(DataServices::dsArray[whichDSIndex]->numberOfUsers >= 0); if(ParallelDescriptor::IOProcessor()) { bDeleteDS = (DataServices::dsArray[whichDSIndex]->numberOfUsers == 0); } { int tmp = bDeleteDS; ParallelDescriptor::Bcast(&tmp, 1, 0); bDeleteDS = tmp; } if(bDeleteDS) { delete DataServices::dsArray[whichDSIndex]; } } break; case FillVarOneFab: { FArrayBox *destFab = NULL; Box destBox; int fineFillLevel; string derivedTemp; char *derivedCharPtr; int derivedLength, derivedLengthPadded; if(ParallelDescriptor::IOProcessor()) { destFab = (FArrayBox *) va_arg(ap, void *); const Box *boxRef = (const Box *) va_arg(ap, void *); destBox = *boxRef; fineFillLevel = va_arg(ap, int); const string *derivedRef = (const string *) va_arg(ap, void *); derivedTemp = *derivedRef; derivedLength = derivedTemp.length(); } ParallelDescriptor::Bcast(&destBox, 1, 0); ParallelDescriptor::Bcast(&fineFillLevel, 1, 0); ParallelDescriptor::Bcast(&derivedLength, 1, 0); derivedLengthPadded = derivedLength + 1; derivedLengthPadded += derivedLengthPadded % 8; derivedCharPtr = new char[derivedLengthPadded]; if(ParallelDescriptor::IOProcessor()) { strcpy(derivedCharPtr, derivedTemp.c_str()); } ParallelDescriptor::Bcast(derivedCharPtr, derivedLengthPadded, 0); string derived(derivedCharPtr); delete [] derivedCharPtr; ds->FillVar(destFab, destBox, fineFillLevel, derived, ioProcNumber); } break; case FillVarArrayOfFabs: { BoxLib::Abort("FillVarArrayOfFabs not implemented yet."); } break; case FillVarMultiFab: { BoxLib::Abort("FillVarMultiFab not implemented yet."); } break; case WriteFabOneVar: { // interface: (requestType, dsPtr, fabFileName, box, maxLevel, derivedName) Box destBox; int fineFillLevel; string fabFileName; string derivedTemp; char *derivedCharPtr; int derivedLength, derivedLengthPadded; if(ParallelDescriptor::IOProcessor()) { const string *fabFileNameRef = (const string *) va_arg(ap, void *); fabFileName = *fabFileNameRef; const Box *boxRef = (const Box *) va_arg(ap, void *); destBox = *boxRef; fineFillLevel = va_arg(ap, int); const string *derivedRef = (const string *) va_arg(ap, void *); derivedTemp = *derivedRef; derivedLength = derivedTemp.length(); } ParallelDescriptor::Bcast(&destBox, 1, 0); ParallelDescriptor::Bcast(&fineFillLevel, 1, 0); ParallelDescriptor::Bcast(&derivedLength, 1, 0); derivedLengthPadded = derivedLength + 1; derivedLengthPadded += derivedLengthPadded % 8; derivedCharPtr = new char[derivedLengthPadded]; if(ParallelDescriptor::IOProcessor()) { strcpy(derivedCharPtr, derivedTemp.c_str()); } ParallelDescriptor::Bcast(derivedCharPtr, derivedLengthPadded, 0); string derived(derivedCharPtr); delete [] derivedCharPtr; ds->WriteFab(fabFileName, destBox, fineFillLevel, derived); } break; case WriteFabAllVars: { // interface: (requestType, dsPtr, fabFileName, box, maxLevel) Box destBox; int fineFillLevel; string fabFileName; if(ParallelDescriptor::IOProcessor()) { const string *fabFileNameRef = (const string *) va_arg(ap, void *); fabFileName = *fabFileNameRef; const Box *boxRef = (const Box *) va_arg(ap, void *); destBox = *boxRef; fineFillLevel = va_arg(ap, int); } ParallelDescriptor::Bcast(&destBox, 1, 0); ParallelDescriptor::Bcast(&fineFillLevel, 1, 0); ds->WriteFab(fabFileName, destBox, fineFillLevel); } break; case DumpSlicePlaneOneVar: { int slicedir; int slicenum; string derivedTemp; char *derivedCharPtr; int derivedLength, derivedLengthPadded; if(ParallelDescriptor::IOProcessor()) { slicedir = va_arg(ap, int); slicenum = va_arg(ap, int); const string *derivedRef = (const string *) va_arg(ap, void *); derivedTemp = *derivedRef; derivedLength = derivedTemp.length(); } ParallelDescriptor::Bcast(&slicedir, 1, 0); ParallelDescriptor::Bcast(&slicenum, 1, 0); ParallelDescriptor::Bcast(&derivedLength, 1, 0); derivedLengthPadded = derivedLength + 1; derivedLengthPadded += derivedLengthPadded % 8; derivedCharPtr = new char[derivedLengthPadded]; if(ParallelDescriptor::IOProcessor()) { strcpy(derivedCharPtr, derivedTemp.c_str()); } ParallelDescriptor::Bcast(derivedCharPtr, derivedLengthPadded, 0); string derived(derivedCharPtr); delete [] derivedCharPtr; ds->DumpSlice(slicedir, slicenum, derived); } break; case DumpSlicePlaneAllVars: { int slicedir; int slicenum; if(ParallelDescriptor::IOProcessor()) { slicedir = va_arg(ap, int); slicenum = va_arg(ap, int); } ParallelDescriptor::Bcast(&slicedir, 1, 0); ParallelDescriptor::Bcast(&slicenum, 1, 0); ds->DumpSlice(slicedir, slicenum); } break; case DumpSliceBoxOneVar: { Box box; string derivedTemp; char *derivedCharPtr; int derivedLength, derivedLengthPadded; if(ParallelDescriptor::IOProcessor()) { const Box *boxRef = (const Box *) va_arg(ap, void *); box = *boxRef; const string *derivedRef = (const string *) va_arg(ap, void *); derivedTemp = *derivedRef; derivedLength = derivedTemp.length(); } ParallelDescriptor::Bcast(&box, 1, 0); ParallelDescriptor::Bcast(&derivedLength, 1, 0); derivedLengthPadded = derivedLength + 1; derivedLengthPadded += derivedLengthPadded % 8; derivedCharPtr = new char[derivedLengthPadded]; if(ParallelDescriptor::IOProcessor()) { strcpy(derivedCharPtr, derivedTemp.c_str()); } ParallelDescriptor::Bcast(derivedCharPtr, derivedLengthPadded, 0); string derived(derivedCharPtr); delete [] derivedCharPtr; ds->DumpSlice(box, derived); } break; case DumpSliceBoxAllVars: { Box box; if(ParallelDescriptor::IOProcessor()) { const Box *boxRef = (const Box *) va_arg(ap, void *); box = *boxRef; } ParallelDescriptor::Bcast(&box, 1, 0); ds->DumpSlice(box); } break; case MinMaxRequest: { Box box; string derivedTemp; char *derivedCharPtr; int level; int derivedLength, derivedLengthPadded; Real dataMin, dataMax; bool minMaxValid; if(ParallelDescriptor::IOProcessor()) { const Box *boxRef = (const Box *) va_arg(ap, void *); const string *derivedRef = (const string *) va_arg(ap, void *); level = va_arg(ap, int); box = *boxRef; derivedTemp = *derivedRef; derivedLength = derivedTemp.length(); } ParallelDescriptor::Bcast(&box, 1, 0); ParallelDescriptor::Bcast(&derivedLength, 1, 0); ParallelDescriptor::Bcast(&level, 1, 0); derivedLengthPadded = derivedLength + 1; derivedLengthPadded += derivedLengthPadded % 8; derivedCharPtr = new char[derivedLengthPadded]; if(ParallelDescriptor::IOProcessor()) { strcpy(derivedCharPtr, derivedTemp.c_str()); } ParallelDescriptor::Bcast(derivedCharPtr, derivedLengthPadded, 0); string derived(derivedCharPtr); delete [] derivedCharPtr; ds->MinMax(box, derived, level, dataMin, dataMax, minMaxValid); // set the return values if(ParallelDescriptor::IOProcessor()) { Real *dataMinRef = va_arg(ap, Real *); Real *dataMaxRef = va_arg(ap, Real *); bool *minMaxValidRef = va_arg(ap, bool *); *dataMinRef = dataMin; *dataMaxRef = dataMax; *minMaxValidRef = minMaxValid; } } break; case PointValueRequest: { // interface: (requestType, dsPtr, // pointBoxArraySize, pointBoxArray *, // derivedName, // coarsestLevelToSearch, finestLevelToSearch, // intersectedLevel, /* return this value */ // intersectedBox, /* return this value */ // dataPointValue, /* return this value */ // bPointIsValid) /* return this value */ // need to broadcast pointBoxArraySize, pointBoxArray, derivedName, // coarsestLevelToSearch, and finestLevelToSearch int pointBoxArraySize; Box *pointBoxArrayPtr(NULL), *pointBoxArrayTempPtr(NULL); int coarsestLevelToSearch, finestLevelToSearch; string derivedTemp; char *derivedCharPtr(NULL); int derivedLength, derivedLengthPadded; if(ParallelDescriptor::IOProcessor()) { pointBoxArraySize = va_arg(ap, int); pointBoxArrayTempPtr = (Box *) va_arg(ap, void *); const string *derivedRef = (const string *) va_arg(ap, void *); derivedTemp = *derivedRef; derivedLength = derivedTemp.length(); coarsestLevelToSearch = va_arg(ap, int); finestLevelToSearch = va_arg(ap, int); } ParallelDescriptor::Bcast(&pointBoxArraySize, 1, 0); ParallelDescriptor::Bcast(&derivedLength, 1, 0); ParallelDescriptor::Bcast(&coarsestLevelToSearch, 1, 0); ParallelDescriptor::Bcast(&finestLevelToSearch, 1, 0); pointBoxArrayPtr = new Box[pointBoxArraySize]; derivedLengthPadded = derivedLength + 1; derivedLengthPadded += derivedLengthPadded % 8; derivedCharPtr = new char[derivedLengthPadded]; if(ParallelDescriptor::IOProcessor()) { strcpy(derivedCharPtr, derivedTemp.c_str()); for(int iBox = 0; iBox < pointBoxArraySize; ++iBox) { pointBoxArrayPtr[iBox] = pointBoxArrayTempPtr[iBox]; } } ParallelDescriptor::Bcast(derivedCharPtr, derivedLengthPadded, 0); ParallelDescriptor::Bcast(pointBoxArrayPtr, pointBoxArraySize, 0); string derived(derivedCharPtr); delete [] derivedCharPtr; // return values int intersectedLevel; Box intersectedBox; Real dataPointValue; bool bPointIsValid; ds->PointValue(pointBoxArraySize, pointBoxArrayPtr, derived, coarsestLevelToSearch, finestLevelToSearch, intersectedLevel, intersectedBox, dataPointValue, bPointIsValid); // set the return values if(ParallelDescriptor::IOProcessor()) { int *intersectedLevelRef = va_arg(ap, int *); Box *intersectedBoxRef = (Box *) va_arg(ap, void *); Real *dataPointValueRef = va_arg(ap, Real *); bool *bPointIsValidRef = va_arg(ap, bool *); *intersectedLevelRef = intersectedLevel; *intersectedBoxRef = intersectedBox; *dataPointValueRef = dataPointValue; *bPointIsValidRef = bPointIsValid; } // dont need to broadcast the return values--only the IOProcessor uses them delete [] pointBoxArrayPtr; } break; #ifndef BL_NOLINEVALUES case LineValuesRequest: { // interface: (requestType, dsPtr, // lineBoxArraySize, lineBoxArray *, // derivedName, // coarsestLevelToSearch, finestLevelToSearch, // dataList, /* modify this value */ // bLineIsValid) /* return this value */ // need to broadcast lineBoxArraySize, lineBoxArray, derivedName, // coarsestLevelToSearch, and finestLevelToSearch int lineBoxArraySize; Box *lineBoxArrayPtr(NULL), *lineBoxArrayTempPtr(NULL); int coarsestLevelToSearch(-1), finestLevelToSearch(-1), whichDir(-1); XYPlotDataList *dataList(NULL); string derivedTemp; char *derivedCharPtr; int derivedLength, derivedLengthPadded; if(ParallelDescriptor::IOProcessor()) { lineBoxArraySize = va_arg(ap, int); lineBoxArrayTempPtr = (Box *) va_arg(ap, void *); whichDir = va_arg(ap, int); const string *derivedRef = (const string *) va_arg(ap, void *); derivedTemp = *derivedRef; derivedLength = derivedTemp.length(); coarsestLevelToSearch = va_arg(ap, int); finestLevelToSearch = va_arg(ap, int); dataList = (XYPlotDataList *) va_arg(ap, void *); } ParallelDescriptor::Bcast(&lineBoxArraySize, 1, 0); ParallelDescriptor::Bcast(&derivedLength, 1, 0); ParallelDescriptor::Bcast(&coarsestLevelToSearch, 1, 0); ParallelDescriptor::Bcast(&finestLevelToSearch, 1, 0); lineBoxArrayPtr = new Box[lineBoxArraySize]; derivedLengthPadded = derivedLength + 1; derivedLengthPadded += derivedLengthPadded % 8; derivedCharPtr = new char[derivedLengthPadded]; if(ParallelDescriptor::IOProcessor()) { strcpy(derivedCharPtr, derivedTemp.c_str()); for(int iBox(0); iBox < lineBoxArraySize; ++iBox) { lineBoxArrayPtr[iBox] = lineBoxArrayTempPtr[iBox]; } } ParallelDescriptor::Bcast(derivedCharPtr, derivedLengthPadded, 0); ParallelDescriptor::Bcast(lineBoxArrayPtr, lineBoxArraySize, 0); string derived(derivedCharPtr); delete [] derivedCharPtr; // return values bool bLineIsValid; ds->LineValues(lineBoxArraySize, lineBoxArrayPtr, whichDir, derived, coarsestLevelToSearch, finestLevelToSearch, dataList, bLineIsValid); // set the return values if(ParallelDescriptor::IOProcessor()) { bool *bLineIsValidRef = va_arg(ap, bool *); *bLineIsValidRef = bLineIsValid; } // dont need to broadcast the return values--only the IOProcessor uses them delete [] lineBoxArrayPtr; } #endif } // end switch if(ParallelDescriptor::IOProcessor()) { va_end(ap); } } // end while(bContinueLooping) return; } // end Dispatch // --------------------------------------------------------------- bool DataServices::DumpSlice(int slicedir, int slicenum, const string &varname) { if( ! bAmrDataOk) { return false; } int iWTL(-2); if(iWriteToLevel == -1) { iWTL = amrData.FinestLevel(); } else { iWTL = iWriteToLevel; } string sliceFile = fileName; sliceFile += "."; sliceFile += varname; sliceFile += "."; if(slicedir == XDIR) { sliceFile += "xslice"; } else if(slicedir == YDIR) { sliceFile += "yslice"; } else if(slicedir == ZDIR) { sliceFile += "zslice"; } else { cerr << "bad slicedir = " << slicedir << endl; return false; } sliceFile += "."; char slicechar[64]; sprintf(slicechar, "%d.Level_%d", slicenum, iWTL); sliceFile += slicechar; sliceFile += ".fab"; cout << "sliceFile = " << sliceFile << endl; Box sliceBox(amrData.ProbDomain()[iWTL]); if(BL_SPACEDIM == 2 && slicedir == ZDIR) { // use probDomain for the sliceBox } else { // make the box one cell thick in the slice direction sliceBox.setSmall(slicedir, slicenum); sliceBox.setBig(slicedir, slicenum); } cout << "sliceBox = " << sliceBox << endl; cout << endl; if( ! amrData.ProbDomain()[iWTL].contains(sliceBox)) { cerr << "Error: sliceBox = " << sliceBox << " slicedir " << slicenum << " on Level " << iWTL << " not in probDomain: " << amrData.ProbDomain()[iWTL] << endl; return false; } WriteFab(sliceFile, sliceBox, iWTL, varname); return true; } // --------------------------------------------------------------- bool DataServices::DumpSlice(int slicedir, int slicenum) { // dump all vars if( ! bAmrDataOk) { return false; } int iWTL(-2); if(iWriteToLevel == -1) { iWTL = amrData.FinestLevel(); } else { iWTL = iWriteToLevel; } string sliceFile = fileName; sliceFile += "."; if(slicedir == XDIR) { sliceFile += "xslice"; } else if(slicedir == YDIR) { sliceFile += "yslice"; } else if(slicedir == ZDIR) { sliceFile += "zslice"; } else { cerr << "bad slicedir = " << slicedir << endl; return false; } sliceFile += "."; char slicechar[64]; sprintf(slicechar, "%d.Level_%d", slicenum, iWTL); sliceFile += slicechar; sliceFile += ".fab"; cout << "sliceFile = " << sliceFile << endl; Box sliceBox(amrData.ProbDomain()[iWTL]); if(BL_SPACEDIM == 2 && slicedir == ZDIR) { // use probDomain for the sliceBox } else { // make the box one cell thick in the slice direction sliceBox.setSmall(slicedir, slicenum); sliceBox.setBig(slicedir, slicenum); } cout << "sliceBox = " << sliceBox << endl; cout << endl; if( ! amrData.ProbDomain()[iWTL].contains(sliceBox)) { cerr << "Error: sliceBox = " << sliceBox << " slicedir " << slicenum << " on Level " << iWTL << " not in probDomain: " << amrData.ProbDomain()[iWTL] << endl; return false; } WriteFab(sliceFile, sliceBox, iWTL); return true; } // --------------------------------------------------------------- bool DataServices::DumpSlice(const Box &b, const string &varname) { if( ! bAmrDataOk) { return false; } int iWTL(-2); if(iWriteToLevel == -1) { iWTL = amrData.FinestLevel(); } else { iWTL = iWriteToLevel; } string sliceFile = fileName; sliceFile += "."; sliceFile += varname; sliceFile += "."; char slicechar[256]; # if (BL_SPACEDIM == 2) sprintf(slicechar, "%d_%d__%d_%d.Level_%d", b.smallEnd(XDIR), b.smallEnd(YDIR), b.bigEnd(XDIR), b.bigEnd(YDIR), iWTL); # else sprintf(slicechar, "%d_%d_%d__%d_%d_%d.Level_%d", b.smallEnd(XDIR), b.smallEnd(YDIR), b.smallEnd(ZDIR), b.bigEnd(XDIR), b.bigEnd(YDIR), b.bigEnd(ZDIR), iWTL); #endif sliceFile += slicechar; sliceFile += ".fab"; cout << "sliceFile = " << sliceFile << endl; cout << "sliceBox = " << b << endl; cout << endl; if( ! amrData.ProbDomain()[iWTL].contains(b)) { cerr << "Slice box not in probDomain: " << amrData.ProbDomain()[iWTL] << " on Level " << iWTL << endl; return false; } WriteFab(sliceFile, b, iWTL, varname); return true; } // --------------------------------------------------------------- bool DataServices::DumpSlice(const Box &b) { // dump all vars if( ! bAmrDataOk) { return false; } int iWTL(-2); if(iWriteToLevel == -1) { iWTL = amrData.FinestLevel(); } else { iWTL = iWriteToLevel; } string sliceFile = fileName; sliceFile += "."; char slicechar[256]; # if (BL_SPACEDIM == 2) sprintf(slicechar, "%d_%d__%d_%d.Level_%d", b.smallEnd(XDIR), b.smallEnd(YDIR), b.bigEnd(XDIR), b.bigEnd(YDIR), iWTL); # else sprintf(slicechar, "%d_%d_%d__%d_%d_%d.Level_%d", b.smallEnd(XDIR), b.smallEnd(YDIR), b.smallEnd(ZDIR), b.bigEnd(XDIR), b.bigEnd(YDIR), b.bigEnd(ZDIR), iWTL); #endif sliceFile += slicechar; sliceFile += ".fab"; cout << "sliceFile = " << sliceFile << endl; cout << "sliceBox = " << b << endl; cout << endl; if( ! amrData.ProbDomain()[iWTL].contains(b)) { cerr << "Slice box not in probDomain: " << amrData.ProbDomain()[iWTL] << " on Level " << iWTL << endl; return false; } WriteFab(sliceFile, b, iWTL); return true; } // --------------------------------------------------------------- bool DataServices::FillVar(FArrayBox *destFab, const Box &destBox, int finestFillLevel, const string &varname, int procWithFab) { if( ! bAmrDataOk) { return false; } amrData.FillVar(destFab, destBox, finestFillLevel, varname, procWithFab); return true; } // end FillVar // --------------------------------------------------------------- bool DataServices::FillVar(MultiFab &destMultiFab, int finestFillLevel, const string &varname) { if( ! bAmrDataOk) { return false; } amrData.FillVar(destMultiFab, finestFillLevel, varname); return true; } // end FillVar // --------------------------------------------------------------- // // // Change this to take an Array (or BoxArray?) and create // a MultiFab and pass the proc number for the multifabs disributionMapping // to create the FillVared fabs on separate processors // // bool DataServices::WriteFab(const string &fname, const Box ®ion, int lev, const string &varname) { if( ! bAmrDataOk) { return false; } FArrayBox data; if(ParallelDescriptor::IOProcessor()) { data.resize(region, 1); } Array destFabs(1); Array destBoxes(1); destFabs[0] = &data; destBoxes[0] = region; amrData.FillVar(destFabs, destBoxes, lev, varname, ParallelDescriptor::IOProcessorNumber()); if(ParallelDescriptor::IOProcessor()) { FABio::Format oldFabFormat = FArrayBox::getFormat(); if(dsFabOutSize == 8) { FArrayBox::setFormat(FABio::FAB_8BIT); } if(dsFabOutSize == 32) { FArrayBox::setFormat(FABio::FAB_IEEE_32); } ofstream os; os.open(fname.c_str(), ios::out); data.writeOn(os); os.close(); FArrayBox::setFormat(oldFabFormat); } return true; } // end WriteFab // --------------------------------------------------------------- // // // Change this to take an Array (or BoxArray?) and create // a MultiFab and pass the proc number for the multifabs disributionMapping // to create the FillVared fabs on separate processors // // bool DataServices::WriteFab(const string &fname, const Box ®ion, int lev) { if( ! bAmrDataOk) { return false; } // write all fab vars FArrayBox tempdata; FArrayBox data; if(ParallelDescriptor::IOProcessor()) { tempdata.resize(region, 1); data.resize(region, amrData.NComp()); } for(int ivar = 0; ivar < amrData.NComp(); ivar++) { //amrData.FillVar(tempdata, lev, amrData.PlotVarNames()[ivar]); Array destFabs(1); Array destBoxes(1); destFabs[0] = &tempdata; destBoxes[0] = region; amrData.FillVar(destFabs, destBoxes, lev, amrData.PlotVarNames()[ivar], ParallelDescriptor::IOProcessorNumber()); int srccomp(0); int destcomp(ivar); int ncomp(1); if(ParallelDescriptor::IOProcessor()) { data.copy(tempdata, srccomp, destcomp, ncomp); } } if(ParallelDescriptor::IOProcessor()) { FABio::Format oldFabFormat = FArrayBox::getFormat(); if(dsFabOutSize == 8) { FArrayBox::setFormat(FABio::FAB_8BIT); } if(dsFabOutSize == 32) { FArrayBox::setFormat(FABio::FAB_IEEE_32); } ofstream os; os.open(fname.c_str(), ios::out); data.writeOn(os); os.close(); FArrayBox::setFormat(oldFabFormat); } return true; } // end WriteFab // --------------------------------------------------------------- bool DataServices::CanDerive(const string &name) const { if( ! bAmrDataOk) { return false; } return amrData.CanDerive(name); } // --------------------------------------------------------------- // output the list of variables that can be derived void DataServices::ListDeriveFunc(std::ostream &os) const { if( ! bAmrDataOk) { return; } amrData.ListDeriveFunc(os); } // --------------------------------------------------------------- int DataServices::NumDeriveFunc() const { return amrData.NumDeriveFunc(); } // --------------------------------------------------------------- void DataServices::PointValue(int pointBoxArraySize, Box *pointBoxArray, const string ¤tDerived, int coarsestLevelToSearch, int finestLevelToSearch, int &intersectedLevel, Box &intersectedGrid, Real &dataPointValue, bool &bPointIsValid) { bPointIsValid = false; if( ! bAmrDataOk) { return; } intersectedLevel = amrData.FinestContainingLevel(pointBoxArray[finestLevelToSearch], finestLevelToSearch); if(intersectedLevel < coarsestLevelToSearch) { return; } Box destBox(pointBoxArray[intersectedLevel]); if(destBox.numPts() != 1) { cout << "Error in DS::PointValue:bad destBox: " << destBox << endl; } BL_ASSERT(destBox.numPts() == 1); const BoxArray &intersectedBA = amrData.boxArray(intersectedLevel); for(int iGrid = 0; iGrid < intersectedBA.size(); ++iGrid) { if(destBox.intersects(intersectedBA[iGrid])) { intersectedGrid = intersectedBA[iGrid]; break; } } FArrayBox *destFab = NULL; if(ParallelDescriptor::IOProcessor()) { destFab = new FArrayBox(destBox, 1); } amrData.FillVar(destFab, destBox, intersectedLevel, currentDerived, ParallelDescriptor::IOProcessorNumber()); if(ParallelDescriptor::IOProcessor()) { dataPointValue = (destFab->dataPtr())[0]; delete destFab; } bPointIsValid = true; } // end PointValue #ifndef BL_NOLINEVALUES // --------------------------------------------------------------- void DataServices::LineValues(int lineBoxArraySize, Box *lineBoxArray, int whichDir, const string ¤tDerived, int coarsestLevelToSearch, int finestLevelToSearch, XYPlotDataList *dataList, bool &bLineIsValid) { bLineIsValid = false; if( ! bAmrDataOk) { return; } for(int lev(coarsestLevelToSearch); lev <= finestLevelToSearch; ++lev) { const BoxArray &intersectedBA = amrData.boxArray(lev); int numGrids(intersectedBA.size()); for(int iGrid(0); iGrid != numGrids; ++iGrid) { if(lineBoxArray[lev].intersects(intersectedBA[iGrid])) { bLineIsValid = true; FArrayBox *destFab = NULL; if(ParallelDescriptor::IOProcessor()) { destFab = new FArrayBox(lineBoxArray[lev] & intersectedBA[iGrid], 1); } amrData.FillVar(destFab, destFab->box(), lev, currentDerived, ParallelDescriptor::IOProcessorNumber()); if(ParallelDescriptor::IOProcessor()) { dataList->AddFArrayBox(*destFab, whichDir, lev); delete destFab; } } } } } #endif // --------------------------------------------------------------- bool DataServices::MinMax(const Box &onBox, const string &derived, int level, Real &dataMin, Real &dataMax, bool &minMaxValid) { minMaxValid = amrData.MinMax(onBox, derived, level, dataMin, dataMax); return minMaxValid; } // end MinMax // --------------------------------------------------------------- // --------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/GridPicture.H0000644000175000017500000000434711634153073021642 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: GridPicture.H,v 1.8 2000/10/02 20:53:08 lijewski Exp $ // // --------------------------------------------------------------- // GridPicture.H // --------------------------------------------------------------- #ifndef _GRIDPICTURE_H #define _GRIDPICTURE_H #include "AmrvisConstants.H" #include "Box.H" class GridPicture { public: GridPicture(); ~GridPicture(); void GridPictureInit(int level, int rratio, int scale, int picSizeH, int picSizeV, const Box &overlapbox, const Box &boxWithData, int slicedir); void ChangeScale(int newScale, int picSizeH, int picSizeV); int HPositionInPicture(); int VPositionInPicture(); int ImageSizeH() const { return imageSizeH; } int ImageSizeV() const { return imageSizeV; } private: Box overlapBox; unsigned int dataSizeH, dataSizeV; unsigned int imageSizeH, imageSizeV; unsigned int pictureSizeH, pictureSizeV; int currentScale; int refRatio, sliceDir; Box imageBox; }; #endif ccseapps-2.5/CCSEApps/pAmrvis/ViewTransform.cpp0000644000175000017500000001516411634153073022621 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ViewTransform.cpp,v 1.23 2002/12/10 20:12:23 vince Exp $ // // --------------------------------------------------------------- // ViewTransform.cpp // --------------------------------------------------------------- #include "ViewTransform.H" #include "Trackball.H" #include #include using std::endl; using std::cout; // ------------------------------------------------------------------- ViewTransform::ViewTransform() { rotation = AmrQuaternion(); renderRotation = AmrQuaternion(); screenPositionX = 0; screenPositionY = 0; objCenterX = 0.0; objCenterY = 0.0; objCenterZ = 0.0; scale = 1.0; boxTransX = 0.0; boxTransY = 0.0; renTransX = 0.0; renTransY = 0.0; txAdjust = 1.0; tyAdjust = 1.0; MakeTransform(); } // ------------------------------------------------------------------- ViewTransform::~ViewTransform() { } //-------------------------------------------------------------------- AmrQuaternion ViewTransform::Screen2Quat(int startX, int startY, int endX, int endY, Real boxSize) { Real xWorldStart((Real)(startX - screenPositionX) / (screenPositionX * scale)); Real yWorldStart((Real)(startY - screenPositionY) / (screenPositionY * scale)); Real xWorldEnd((Real)(endX - screenPositionX) / (screenPositionX * scale)); Real yWorldEnd((Real)(endY - screenPositionY) / (screenPositionY * scale)); Real oobs(1.0 / boxSize); return trackball(xWorldStart * oobs, yWorldStart * oobs, xWorldEnd * oobs, yWorldEnd * oobs); } //-------------------------------------------------------------------- void ViewTransform::MakeTranslation(int start_X, int start_Y, int end_X, int end_Y, Real box_size) { // norm coord. onto [-1,1] by [-1,1] grid Real xWorldStart((Real)(start_X) / (screenPositionX)); Real yWorldStart((Real)(start_Y) / (screenPositionY)); Real xWorldEnd((Real)(end_X) / (screenPositionX)); Real yWorldEnd((Real)(end_Y) / (screenPositionY)); renTransX += (xWorldEnd - xWorldStart); renTransY += (yWorldEnd - yWorldStart); // that isn't right for the boxes boxTransX += (end_X - start_X); boxTransY += (start_Y - end_Y); } // ------------------------------------------------------------------- void ViewTransform::TransformPoint(Real x, Real y, Real z, Real &pX, Real &pY, Real &pZ) { //apply rotation to (x, y, z, 1); Real scaleVector[4] = {scale, scale, scale, 1.}; Real point[4] = {x - objCenterX, y - objCenterY, z - objCenterZ, 1}; Real newPoint[4]; for(int ii(0); ii < 2; ++ii) { int temp(0); for(int jj(0); jj < 4; ++jj) { temp += (int) (point[jj] * mRotation[ii][jj] * scaleVector[jj]); } newPoint[ii] = temp; } pX = newPoint[0] + screenPositionX; pY = newPoint[1] + screenPositionY; //pZ = newPoint[2]; } // ------------------------------------------------------------------- void ViewTransform::Print() const { cout << "ViewTransform::Print() does nothing now." << endl; } // ------------------------------------------------------------------- void ViewTransform::MakeTransform() { rotation.tomatrix(mRotation); mRotation[0][3] = boxTransX * 0.185; mRotation[1][3] = boxTransY * 0.185; renderRotation.tomatrix(mRenderRotation); mRenderRotation[0][3] = (renTransX) * txAdjust * 0.185; mRenderRotation[1][3] = (renTransY) * tyAdjust * 0.185; } // ------------------------------------------------------------------- void ViewTransform::SetAdjustments(Real len, int width, int height) { if(width < height) { txAdjust = len * vtAspect; tyAdjust = len; } else { txAdjust = len; tyAdjust = len * vtAspect; } } // ------------------------------------------------------------------- Real ViewTransform::InfNorm() { Real mat[4][4]; rotation.tomatrix(mat); // compute the L-inf matrix norm: Real sum(0.0); Real max(0.0); for(int i(0); i < 3; ++i) { sum = fabs(mat[i][0]) + fabs(mat[i][1]) + fabs(mat[i][2]); max = (sum > max ? sum : max); } return max; } // ------------------------------------------------------------------- void ViewTransform::GetRotationMat(MatrixFour m) { for(int i(0); i < 4; ++i) { for(int j(0); j < 4; ++j) { m[i][j] = mRotation[i][j]; } } } // ------------------------------------------------------------------- void ViewTransform::GetRenderRotationMat(MatrixFour m) { for(int i(0); i < 4; ++i) { for(int j(0); j < 4; ++j) { m[i][j] = mRenderRotation[i][j]; } } } // ------------------------------------------------------------------- void ViewTransform::ViewRotationMat() const { cout << "Rotation matrix:" << endl; for(int i(0); i < 4; ++i) { for(int j(0); j < 4; ++j) { cout << mRotation[i][j] << " "; } cout << endl; } } // ------------------------------------------------------------------- void ViewTransform::ViewRenderRotationMat() const { cout << "Render Rotation matrix:" << endl; for(int i(0); i < 4; ++i) { for(int j(0); j < 4; ++j) { cout << mRenderRotation[i][j] << " "; } cout << endl; } } // ------------------------------------------------------------------- ostream& operator << (ostream &o, const ViewTransform &v) { v.Print(); return o; } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/PltApp.cpp0000644000175000017500000044145311634153073021217 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: PltApp.cpp,v 1.117 2002/12/10 20:12:23 vince Exp $ // // --------------------------------------------------------------- // PltApp.cpp // --------------------------------------------------------------- #include "PltApp.H" #include "PltAppState.H" #include "AmrPicture.H" #include "DataServices.H" #include "GraphicsAttributes.H" #include "ProjectionPicture.H" #include "XYPlotWin.H" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(BL_PARALLELVOLUMERENDER) #include #endif #include #include using std::ostrstream; using std::ends; using std::cout; using std::cerr; using std::endl; using std::min; using std::max; using std::flush; // Hack for window manager calls #ifndef FALSE #define FALSE false #endif const int MAXSCALE(32); #define MARK fprintf(stderr, "Mark at file %s, line %d.\n", __FILE__, __LINE__) static bool UsingFileRange(const MinMaxRangeType rt) { return(rt == FILEGLOBALMINMAX || rt == FILESUBREGIONMINMAX || rt == FILEUSERMINMAX); } // ------------------------------------------------------------------- PltApp::~PltApp() { int np; #if (BL_SPACEDIM == 3) for(np = 0; np != NPLANES; ++np) { amrPicturePtrArray[np]->DoStop(); } #endif if(animating2d) { StopAnimation(); } for(np = 0; np != NPLANES; ++np) { delete amrPicturePtrArray[np]; } #if (BL_SPACEDIM == 3) delete projPicturePtr; #endif delete XYplotparameters; delete pltPaletteptr; delete gaPtr; delete pltAppState; if(datasetShowing) { delete datasetPtr; } XtDestroyWidget(wAmrVisTopLevel); // delete all the call back parameter structs for(int nSize(0); nSize < cbdPtrs.size(); ++nSize) { delete cbdPtrs[nSize]; } } // ------------------------------------------------------------------- PltApp::PltApp(XtAppContext app, Widget w, const string &filename, const Array &dataservicesptr, bool isAnim) : wTopLevel(w), appContext(app), currentRangeType(GLOBALMINMAX), animating2d(isAnim), paletteDrawn(false), currentFrame(0), bCartGridSmoothing(false), fileName(filename), dataServicesPtr(dataservicesptr) { #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) lightingWindowExists = false; #endif if( ! dataservicesptr[0]->AmrDataOk()) { return; } const AmrData &amrData = dataServicesPtr[currentFrame]->AmrDataRef(); bFileRangeButtonSet = false; int i; char header[BUFSIZ]; ostrstream headerout(header, BUFSIZ); if(animating2d) { animFrames = AVGlobals::GetFileCount(); BL_ASSERT(dataServicesPtr.size() == animFrames); fileNames.resize(animFrames); for(i = 0; i < animFrames; ++i) { fileNames[i] = AVGlobals::GetComlineFilename(i); } headerout << "2D Animation" << ends; } else { animFrames = 1; fileNames.resize(animFrames); fileNames[currentFrame] = fileName; // Single plot file, so the time is indicated in the title bar. headerout << AVGlobals::StripSlashes(fileName) << " T =" << amrData.Time() << ends; } pltAppState = new PltAppState(animFrames, amrData.NumDeriveFunc()); pltAppState->SetContourType(RASTERONLY); pltAppState->SetCurrentFrame(currentFrame); // Set the delete response to DO_NOTHING so that it can be app defined. wAmrVisTopLevel = XtVaCreatePopupShell(header, topLevelShellWidgetClass, wTopLevel, XmNwidth, initialWindowWidth, XmNheight, initialWindowHeight, XmNx, 100+placementOffsetX, XmNy, 200+placementOffsetY, XmNdeleteResponse, XmDO_NOTHING, NULL); gaPtr = new GraphicsAttributes(wAmrVisTopLevel); display = gaPtr->PDisplay(); xgc = gaPtr->PGC(); if(gaPtr->PVisual() != XDefaultVisual(display, gaPtr->PScreenNumber())) { XtVaSetValues(wAmrVisTopLevel, XmNvisual, gaPtr->PVisual(), XmNdepth, gaPtr->PDepth(), NULL); } if( ! dataServicesPtr[currentFrame]->CanDerive(PltApp::initialDerived)) { cerr << "Bad initial derived: cannot derive " << PltApp::initialDerived << endl; cerr << "defaulting to " << dataServicesPtr[currentFrame]->PlotVarNames()[0] << endl; SetInitialDerived(dataServicesPtr[currentFrame]->PlotVarNames()[0]); } pltAppState->SetCurrentDerived(PltApp::initialDerived, amrData.StateNumber(initialDerived)); pltAppState->SetShowingBoxes(GetDefaultShowBoxes()); int finestLevel(amrData.FinestLevel()); pltAppState->SetFinestLevel(finestLevel); int maxlev = AVGlobals::DetermineMaxAllowableLevel(amrData.ProbDomain()[finestLevel], finestLevel, AVGlobals::MaxPictureSize(), amrData.RefRatio()); int minAllowableLevel(0); pltAppState->SetMinAllowableLevel(minAllowableLevel); pltAppState->SetMaxAllowableLevel(maxlev); pltAppState->SetMinDrawnLevel(minAllowableLevel); pltAppState->SetMaxDrawnLevel(maxlev); Box maxDomain(amrData.ProbDomain()[maxlev]); unsigned long dataSize(maxDomain.length(XDIR) * maxDomain.length(YDIR)); if(AVGlobals::MaxPictureSize() == 0) { maxAllowableScale = 1; } else { maxAllowableScale = (int) sqrt((Real) (AVGlobals::MaxPictureSize() / dataSize)); } int currentScale(max(1, min(GetInitialScale(), maxAllowableScale))); pltAppState->SetCurrentScale(currentScale); pltAppState->SetMaxScale(maxAllowableScale); // --------------- pltAppState->SetMinMaxRangeType(GLOBALMINMAX); Real rGlobalMin, rGlobalMax; rGlobalMin = AV_BIG_REAL; rGlobalMax = -AV_BIG_REAL; int coarseLevel(0); int iCDerNum(pltAppState->CurrentDerivedNumber()); string asCDer(pltAppState->CurrentDerived()); int fineLevel(pltAppState->MaxAllowableLevel()); const Array &onBox(amrData.ProbDomain()); for(int iFrame(0); iFrame < animFrames; ++iFrame) { Real rFileMin, rFileMax; FindAndSetMinMax(FILEGLOBALMINMAX, iFrame, asCDer, iCDerNum, onBox, coarseLevel, fineLevel, false); // dont reset if set pltAppState->GetMinMax(FILEGLOBALMINMAX, iFrame, iCDerNum, rFileMin, rFileMax); rGlobalMin = min(rFileMin, rGlobalMin); rGlobalMax = max(rFileMax, rGlobalMax); // also set FILESUBREGIONMINMAXs and FILEUSERMINMAXs to the global values pltAppState->SetMinMax(FILESUBREGIONMINMAX, iFrame, pltAppState->CurrentDerivedNumber(), rFileMin, rFileMax); pltAppState->SetMinMax(FILEUSERMINMAX, iFrame, pltAppState->CurrentDerivedNumber(), rFileMin, rFileMax); } // end for(iFrame...) // now set global values for each file in the animation for(int iFrame(0); iFrame < animFrames; ++iFrame) { // set GLOBALMINMAXs pltAppState->SetMinMax(GLOBALMINMAX, iFrame, pltAppState->CurrentDerivedNumber(), rGlobalMin, rGlobalMax); // also set SUBREGIONMINMAXs and USERMINMAXs to the global values pltAppState->SetMinMax(SUBREGIONMINMAX, iFrame, pltAppState->CurrentDerivedNumber(), rGlobalMin, rGlobalMax); pltAppState->SetMinMax(USERMINMAX, iFrame, pltAppState->CurrentDerivedNumber(), rGlobalMin, rGlobalMax); } // end for(iFrame...) if(AVGlobals::UseSpecifiedMinMax()) { pltAppState->SetMinMaxRangeType(USERMINMAX); Real specifiedMin, specifiedMax; AVGlobals::GetSpecifiedMinMax(specifiedMin, specifiedMax); for(int iFrame(0); iFrame < animFrames; ++iFrame) { pltAppState->SetMinMax(USERMINMAX, iFrame, pltAppState->CurrentDerivedNumber(), specifiedMin, specifiedMax); pltAppState->SetMinMax(FILEUSERMINMAX, iFrame, pltAppState->CurrentDerivedNumber(), specifiedMin, specifiedMax); } } // --------------- amrPicturePtrArray[ZPLANE] = new AmrPicture(gaPtr, this, pltAppState, dataServicesPtr[currentFrame], bCartGridSmoothing); #if (BL_SPACEDIM == 3) amrPicturePtrArray[YPLANE] = new AmrPicture(YPLANE, gaPtr, amrData.ProbDomain()[finestLevel], NULL, this, pltAppState, bCartGridSmoothing); amrPicturePtrArray[XPLANE] = new AmrPicture(XPLANE, gaPtr, amrData.ProbDomain()[finestLevel], NULL, this, pltAppState, bCartGridSmoothing); #endif for(i = 0; i != BL_SPACEDIM; ++i) { ivLowOffsetMAL.setVal(i, amrData.ProbDomain()[maxlev].smallEnd(i)); } contourNumString = string("10"); pltAppState->SetNumContours(10); palFilename = PltApp::defaultPaletteString; lightingFilename = PltApp::defaultLightingFilename; PltAppInit(); } // ------------------------------------------------------------------- PltApp::PltApp(XtAppContext app, Widget w, const Box ®ion, const IntVect &offset, PltApp *pltParent, const string &palfile, bool isAnim, const string &newderived, const string &filename) : wTopLevel(w), appContext(app), animating2d(isAnim), paletteDrawn(false), currentFrame(pltParent->currentFrame), animFrames(pltParent->animFrames), fileName(filename), palFilename(palfile), lightingFilename(pltParent->lightingFilename), dataServicesPtr(pltParent->dataServicesPtr), fileNames(pltParent->fileNames) { const AmrData &amrData = dataServicesPtr[currentFrame]->AmrDataRef(); bFileRangeButtonSet = pltParent->bFileRangeButtonSet; pltAppState = new PltAppState(animFrames, amrData.NumDeriveFunc()); *pltAppState = *pltParent->GetPltAppState(); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) lightingWindowExists = false; #endif contourNumString = pltParent->contourNumString.c_str(); char header[BUFSIZ]; bCartGridSmoothing = pltParent->bCartGridSmoothing; int finestLevel(amrData.FinestLevel()); pltAppState->SetFinestLevel(finestLevel); int maxlev = AVGlobals::DetermineMaxAllowableLevel(region, finestLevel, AVGlobals::MaxPictureSize(), amrData.RefRatio()); int minAllowableLevel = amrData.FinestContainingLevel(region, finestLevel); pltAppState->SetMinAllowableLevel(minAllowableLevel); pltAppState->SetMaxAllowableLevel(maxlev); pltAppState->SetMinDrawnLevel(minAllowableLevel); pltAppState->SetMaxDrawnLevel(maxlev); Box maxDomain(region); if(maxlev < finestLevel) { maxDomain.coarsen(AVGlobals::CRRBetweenLevels(maxlev, finestLevel, amrData.RefRatio())); } unsigned long dataSize(maxDomain.length(XDIR) * maxDomain.length(YDIR)); if(AVGlobals::MaxPictureSize() / dataSize == 0) { maxAllowableScale = 1; } else { maxAllowableScale = (int) sqrt((Real) (AVGlobals::MaxPictureSize() / dataSize)); } int currentScale = min(maxAllowableScale, pltParent->GetPltAppState()->CurrentScale()); pltAppState->SetCurrentScale(currentScale); // --------------- Array onBox(pltAppState->MaxAllowableLevel() + 1); onBox[pltAppState->MaxAllowableLevel()] = maxDomain; for(int ilev(pltAppState->MaxAllowableLevel() - 1); ilev >= 0; --ilev) { Box tempbox(maxDomain); tempbox.coarsen(AVGlobals::CRRBetweenLevels(ilev, finestLevel, amrData.RefRatio())); onBox[ilev] = tempbox; } int iCDerNum(pltAppState->CurrentDerivedNumber()); const string asCDer(pltAppState->CurrentDerived()); int coarseLevel(0); int fineLevel(pltAppState->MaxAllowableLevel()); Real rSMin, rSMax; rSMin = AV_BIG_REAL; rSMax = -AV_BIG_REAL; for(int iFrame(0); iFrame < animFrames; ++iFrame) { // GLOBALMINMAX is already set to parent's values // USERMINMAX is already set to parent's values // FILEGLOBALMINMAX is already set to parent's values // FILEUSERMINMAX is already set to parent's values // these do not change for a subregion // set FILESUBREGIONMINMAX FindAndSetMinMax(FILESUBREGIONMINMAX, iFrame, asCDer, iCDerNum, onBox, coarseLevel, fineLevel, true); // reset if already set Real rTempMin, rTempMax; pltAppState->GetMinMax(FILESUBREGIONMINMAX, iFrame, iCDerNum, rTempMin, rTempMax); // collect file values rSMin = min(rSMin, rTempMin); rSMax = max(rSMax, rTempMax); } // now set each frame's SUBREGIONMINMAX to the overall subregion minmax for(int iFrame(0); iFrame < animFrames; ++iFrame) { pltAppState->SetMinMax(FILEUSERMINMAX, iFrame, iCDerNum, rSMin, rSMax); } // --------------- char timestr[64]; // If animating, do not indicate the time. if(animating2d) { timestr[0] = '\0'; } else { ostrstream timeOut(timestr, 64); timeOut << " T = " << amrData.Time() << ends; } ostrstream headerout(header, BUFSIZ); headerout << AVGlobals::StripSlashes(fileName) << timestr << " Subregion: " << maxDomain << " on level " << maxlev << ends; wAmrVisTopLevel = XtVaCreatePopupShell(header, topLevelShellWidgetClass, wTopLevel, XmNwidth, initialWindowWidth, XmNheight, initialWindowHeight, XmNx, 120+placementOffsetX, XmNy, 220+placementOffsetY, XmNdeleteResponse, XmDO_NOTHING, NULL); if(AVGlobals::Verbose()) { cout << "_in PltApp::PltApp: subregion" << endl; pltAppState->PrintSetMap(); cout << endl; } gaPtr = new GraphicsAttributes(wAmrVisTopLevel); display = gaPtr->PDisplay(); xgc = gaPtr->PGC(); if(gaPtr->PVisual() != XDefaultVisual(display, gaPtr->PScreenNumber())) { XtVaSetValues(wAmrVisTopLevel, XmNvisual, gaPtr->PVisual(), XmNdepth, 8, NULL); } for(int np(0); np < NPLANES; ++np) { amrPicturePtrArray[np] = new AmrPicture(np, gaPtr, region, pltParent, this, pltAppState, bCartGridSmoothing); } #if (BL_SPACEDIM == 3) for(int i(0); i < 3; ++i) { amrPicturePtrArray[i]->SetHVLine(pltAppState->CurrentScale()); } #endif ivLowOffsetMAL = offset; PltAppInit(true); } // ------------------------------------------------------------------- void PltApp::PltAppInit(bool bSubVolume) { int np; const AmrData &amrData = dataServicesPtr[currentFrame]->AmrDataRef(); int minAllowableLevel(pltAppState->MinAllowableLevel()); int maxAllowableLevel(pltAppState->MaxAllowableLevel()); wRangeRadioButton.resize(BNUMBEROFMINMAX); // User defined widget destroy callback -- will free all memory used to create // window. XmAddWMProtocolCallback(wAmrVisTopLevel, XmInternAtom(display,"WM_DELETE_WINDOW", false), (XtCallbackProc) CBQuitPltApp, (XtPointer) this); for(np = 0; np != BL_SPACEDIM; ++np) { XYplotwin[np] = NULL; // No 1D plot windows initially. // For speed (and clarity!) we store the values of the finest value of h of // each dimension, as well as the low value of the problem domain in simple // arrays. These are both in problem space. finestDx[np] = amrData.DxLevel()[maxAllowableLevel][np]; gridOffset[np] = amrData.ProbLo()[np]; } placementOffsetX += 20; placementOffsetY += 20; servingButton = 0; activeView = ZPLANE; int maxDrawnLevel(maxAllowableLevel); startX = 0; startY = 0; endX = 0; endY = 0; //currentFrame = 0; animationIId = 0; frameSpeed = 300; readyFrames.resize(animFrames, false); frameBuffer.resize(animFrames); selectionBox.convert(amrData.ProbDomain()[0].type()); selectionBox.setSmall(IntVect::TheZeroVector()); selectionBox.setBig(IntVect::TheZeroVector()); for(np = 0; np != NPLANES; ++np) { amrPicturePtrArray[np]->SetFrameSpeed(frameSpeed); amrPicturePtrArray[np]->SetRegion(startX, startY, endX, endY); } char tempFormat[32]; strcpy(tempFormat, PltApp::initialFormatString.c_str()); XmString sFormatString = XmStringCreateSimple(tempFormat); char *tempchar = new char[LINELENGTH]; XmStringGetLtoR(sFormatString, XmSTRING_DEFAULT_CHARSET, &tempchar); XmStringFree(sFormatString); pltAppState->SetFormatString(tempchar); delete [] tempchar; infoShowing = false; contoursShowing = false; setRangeShowing = false; bSetRangeRedraw = false; datasetShowing = false; bFormatShowing = false; writingRGB = false; int palListLength(PALLISTLENGTH); int palWidth(PALWIDTH); int totalPalWidth(TOTALPALWIDTH); int totalPalHeight(TOTALPALHEIGHT); pltPaletteptr = new Palette(wTopLevel, palListLength, palWidth, totalPalWidth, totalPalHeight, reserveSystemColors); // gc for gxxor rubber band line drawing rbgc = XCreateGC(display, gaPtr->PRoot(), 0, NULL); XSetFunction(display, rbgc, GXxor); cursor = XCreateFontCursor(display, XC_left_ptr); // No need to store these widgets in the class after this function is called. Widget wMainArea, wPalFrame, wPlotFrame, wPalForm; wMainArea = XtVaCreateManagedWidget("MainArea", xmFormWidgetClass, wAmrVisTopLevel, NULL); // ------------------------------- menu bar Widget wMenuBar, wMenuPulldown, wid, wCascade; char selectText[20], accelText[20], accel[20]; XmString label_str; XtSetArg(args[0], XmNtopAttachment, XmATTACH_FORM); XtSetArg(args[1], XmNleftAttachment, XmATTACH_FORM); XtSetArg(args[2], XmNrightAttachment, XmATTACH_FORM); wMenuBar = XmCreateMenuBar(wMainArea, "menubar", args, 3); // ------------------------------- file menu wMenuPulldown = XmCreatePulldownMenu(wMenuBar, "Filepulldown", NULL, 0); XtVaCreateManagedWidget("File", xmCascadeButtonWidgetClass, wMenuBar, XmNmnemonic, 'F', XmNsubMenuId, wMenuPulldown, NULL); // To look at a subregion of the plot label_str = XmStringCreateSimple("Ctrl+S"); wid = XtVaCreateManagedWidget((BL_SPACEDIM != 3) ? "Subregion..." : "Subvolume...", xmPushButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'S', XmNaccelerator, "CtrlS", XmNacceleratorText, label_str, NULL); XmStringFree(label_str); AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoSubregion); // To change the palette wid = XtVaCreateManagedWidget("Palette...", xmPushButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'P', NULL); AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoPaletteButton); // To output to various formats (.ps, .rgb, .fab) wCascade = XmCreatePulldownMenu(wMenuPulldown, "outputmenu", NULL, 0); XtVaCreateManagedWidget("Export", xmCascadeButtonWidgetClass, wMenuPulldown, XmNmnemonic, 'E', XmNsubMenuId, wCascade, NULL); wid = XtVaCreateManagedWidget("PS File...", xmPushButtonGadgetClass, wCascade, XmNmnemonic, 'P', NULL); AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoOutput, (XtPointer) 0); if ( AVGlobals::IsSGIrgbFile() ) { wid = XtVaCreateManagedWidget("RGB File...", xmPushButtonGadgetClass, wCascade, XmNmnemonic, 'R', NULL); } else { wid = XtVaCreateManagedWidget("PPM File...", xmPushButtonGadgetClass, wCascade, XmNmnemonic, 'M', NULL); } AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoOutput, (XtPointer) 1); wid = XtVaCreateManagedWidget("FAB File...", xmPushButtonGadgetClass, wCascade, XmNmnemonic, 'F', NULL); AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoOutput, (XtPointer) 2); // Close XtVaCreateManagedWidget(NULL, xmSeparatorGadgetClass, wMenuPulldown, NULL); label_str = XmStringCreateSimple("Ctrl+C"); wid = XtVaCreateManagedWidget("Close", xmPushButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'C', XmNaccelerator, "CtrlC", XmNacceleratorText, label_str, NULL); XmStringFree(label_str); XtAddCallback(wid, XmNactivateCallback, (XtCallbackProc) CBQuitPltApp, (XtPointer) this); // ------------------------------- view menu wMenuPulldown = XmCreatePulldownMenu(wMenuBar, "MenuPulldown", NULL, 0); XtVaCreateManagedWidget("View", xmCascadeButtonWidgetClass, wMenuBar, XmNmnemonic, 'V', XmNsubMenuId, wMenuPulldown, NULL); // To scale the raster / contour windows int maxallow(min(MAXSCALE, maxAllowableScale)); wCascade = XmCreatePulldownMenu(wMenuPulldown, "scalemenu", NULL, 0); XtVaCreateManagedWidget("Scale", xmCascadeButtonWidgetClass, wMenuPulldown, XmNmnemonic, 'S', XmNsubMenuId, wCascade, NULL); //for(unsigned long scale(1); scale <= maxallow; ++scale) { for(int scale(1); scale <= maxallow; ++scale) { sprintf(selectText, "%ix", scale); wid = XtVaCreateManagedWidget(selectText, xmToggleButtonGadgetClass, wCascade, XmNset, false, NULL); if(scale <= 10) { // scale values <= 10 are shortcutted by pressing the number 1-0 sprintf(accel, "%i", scale % 10); sprintf(accelText, "%i", scale % 10); label_str = XmStringCreateSimple(accelText); XtVaSetValues(wid, XmNmnemonic, scale + 'O', XmNaccelerator, accel, XmNacceleratorText, label_str, NULL); XmStringFree(label_str); } else if(scale <= 20) { // scale values <= 20 can be obtained by holding down ALT and pressing 1-0 sprintf(accel, "Alt%i", scale % 10); sprintf(accelText, "Alt+%i", scale % 10); label_str = XmStringCreateSimple(accelText); XtVaSetValues(wid, XmNaccelerator, accel, XmNacceleratorText, label_str, NULL); XmStringFree(label_str); } if(scale == pltAppState->CurrentScale()) { // Toggle buttons indicate which is the current scale XtVaSetValues(wid, XmNset, true, NULL); wCurrScale = wid; } AddStaticCallback(wid, XmNvalueChangedCallback, &PltApp::ChangeScale, (XtPointer) scale); } // Levels button, to view various levels of refinement //int numberOfLevels(amrPicturePtrArray[ZPLANE]->NumberOfLevels()-minAllowableLevel); wCascade = XmCreatePulldownMenu(wMenuPulldown, "levelmenu", NULL, 0); XtVaCreateManagedWidget("Level", xmCascadeButtonWidgetClass, wMenuPulldown, XmNmnemonic, 'L', XmNsubMenuId, wCascade, NULL); wCurrLevel = NULL; BL_ASSERT(minAllowableLevel <= maxDrawnLevel); for(int menuLevel(minAllowableLevel); menuLevel <= maxDrawnLevel; ++menuLevel) { sprintf(selectText, "%i/%i", menuLevel, amrData.FinestLevel()); wid = XtVaCreateManagedWidget(selectText, xmToggleButtonGadgetClass, wCascade, XmNset, false, NULL); if(menuLevel <= 10) { // Levels <= 10 are shortcutted by holding down the CTRL key and pressing 1-0 sprintf(accel, "Ctrl%i", menuLevel % 10); sprintf(accelText, "Ctrl+%i", menuLevel % 10); label_str = XmStringCreateSimple(accelText); XtVaSetValues(wid, XmNmnemonic, menuLevel + '0', XmNaccelerator, accel, XmNacceleratorText, label_str, NULL); XmStringFree(label_str); } if(menuLevel == maxDrawnLevel) { // Toggle button indicates current level in view XtVaSetValues(wid, XmNset, true, NULL); wCurrLevel = wid; } AddStaticCallback(wid, XmNvalueChangedCallback, &PltApp::ChangeLevel, (XtPointer)(menuLevel)); } Widget wTempDrawLevel = wid; // Button to create (or pop up) a dialog to set contour settings label_str = XmStringCreateSimple("C"); wid = XtVaCreateManagedWidget("Contours...", xmPushButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'C', // XmNaccelerator, "C", // XmNacceleratorText, label_str, NULL); XmStringFree(label_str); AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoContoursButton); // Button to create (or pop up) a dialog to set range label_str = XmStringCreateSimple("R"); wid = XtVaCreateManagedWidget("Range...", xmPushButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'R', // XmNaccelerator, "R", // XmNacceleratorText, label_str, NULL); XmStringFree(label_str); AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoSetRangeButton); // To create (or update and pop up) a dialog indicating the data values // of a selected region label_str = XmStringCreateSimple("D"); wid = XtVaCreateManagedWidget("Dataset...", xmPushButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'D', // XmNaccelerator, "D", // XmNacceleratorText, label_str, NULL); XmStringFree(label_str); AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoDatasetButton); // To change the number format string label_str = XmStringCreateSimple("F"); wid = XtVaCreateManagedWidget("Number Format...", xmPushButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'F', // XmNaccelerator, "F", // XmNacceleratorText, label_str, NULL); XmStringFree(label_str); AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoNumberFormatButton); XtVaCreateManagedWidget(NULL, xmSeparatorGadgetClass, wMenuPulldown, NULL); // Toggle viewing the boxes label_str = XmStringCreateSimple("b"); wid = XtVaCreateManagedWidget("Boxes", xmToggleButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'B', XmNset, pltAppState->GetShowingBoxes(), XmNaccelerator, "B", XmNacceleratorText, label_str, NULL); XmStringFree(label_str); AddStaticCallback(wid, XmNvalueChangedCallback, &PltApp::DoBoxesButton); // ------------------------------- derived menu int maxMenuItems(20); // arbitrarily int numberOfDerived(dataServicesPtr[currentFrame]->NumDeriveFunc()); const Array &derivedStrings = dataServicesPtr[currentFrame]->PlotVarNames(); wMenuPulldown = XmCreatePulldownMenu(wMenuBar, "DerivedPulldown", NULL, 0); XtVaSetValues(wMenuPulldown, XmNpacking, XmPACK_COLUMN, XmNnumColumns, numberOfDerived / maxMenuItems + ((numberOfDerived % maxMenuItems == 0) ? 0 : 1), NULL); XtVaCreateManagedWidget("Variable", xmCascadeButtonWidgetClass, wMenuBar, XmNmnemonic, 'a', XmNsubMenuId, wMenuPulldown, NULL); //unsigned long cderived(0); wCurrDerived = XtVaCreateManagedWidget(derivedStrings[0].c_str(), xmToggleButtonGadgetClass, wMenuPulldown, XmNset, true, NULL); AddStaticCallback(wCurrDerived, XmNvalueChangedCallback, &PltApp::ChangeDerived, (XtPointer) 0); for(unsigned long derived(1); derived < numberOfDerived; ++derived) { wid = XtVaCreateManagedWidget(derivedStrings[derived].c_str(), xmToggleButtonGadgetClass, wMenuPulldown, XmNset, false, NULL); if(derivedStrings[derived] == pltAppState->CurrentDerived()) { XtVaSetValues(wCurrDerived, XmNset, false, NULL); XtVaSetValues(wid, XmNset, true, NULL); wCurrDerived = wid; //cderived = derived; } AddStaticCallback(wid, XmNvalueChangedCallback, &PltApp::ChangeDerived, (XtPointer) derived); } #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) lightingModel = true; showing3dRender = false; preClassify = true; // RENDER MENU wMenuPulldown = XmCreatePulldownMenu(wMenuBar, "RenderPulldown", NULL, 0); XtVaCreateManagedWidget("Render", xmCascadeButtonWidgetClass, wMenuBar, XmNmnemonic, 'R', XmNsubMenuId, wMenuPulldown, NULL); wAutoDraw = XtVaCreateManagedWidget("Autodraw", xmToggleButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'A', XmNset, false, NULL); AddStaticCallback(wAutoDraw, XmNvalueChangedCallback, &PltApp::DoAutoDraw); wid = XtVaCreateManagedWidget("Lighting...", xmPushButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'L', NULL); AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoCreateLightingWindow); wCascade = XmCreatePulldownMenu(wMenuPulldown, "rendermodemenu", NULL, 0); XtVaCreateManagedWidget("Render Mode", xmCascadeButtonWidgetClass, wMenuPulldown, XmNmnemonic, 'M', XmNsubMenuId, wCascade, NULL); wid = XtVaCreateManagedWidget("Light", xmToggleButtonGadgetClass, wCascade, XmNset, true, NULL); AddStaticCallback(wid, XmNvalueChangedCallback, &PltApp::DoRenderModeMenu, (XtPointer) 0); wCurrentRenderMode = wid; wid = XtVaCreateManagedWidget("Value", xmToggleButtonGadgetClass, wCascade, XmNset, false, NULL); AddStaticCallback(wid, XmNvalueChangedCallback, &PltApp::DoRenderModeMenu, (XtPointer) 1); wCascade = XmCreatePulldownMenu(wMenuPulldown, "classifymenu", NULL, 0); XtVaCreateManagedWidget("Classify", xmCascadeButtonWidgetClass, wMenuPulldown, XmNmnemonic, 'C', XmNsubMenuId, wCascade, NULL); wid = XtVaCreateManagedWidget("PC", xmToggleButtonGadgetClass, wCascade, XmNset, true, NULL); AddStaticCallback(wid, XmNvalueChangedCallback, &PltApp::DoClassifyMenu, (XtPointer) 0); wCurrentClassify = wid; wid = XtVaCreateManagedWidget("OT", xmToggleButtonGadgetClass, wCascade, XmNset, false, NULL); AddStaticCallback(wid, XmNvalueChangedCallback, &PltApp::DoClassifyMenu, (XtPointer) 1); #endif // --------------------------------------------------------------- help menu wMenuPulldown = XmCreatePulldownMenu(wMenuBar, "MenuPulldown", NULL, 0); XtVaCreateManagedWidget("Help", xmCascadeButtonWidgetClass, wMenuBar, XmNmnemonic, 'H', XmNsubMenuId, wMenuPulldown, NULL); wid = XtVaCreateManagedWidget("Info...", xmPushButtonGadgetClass, wMenuPulldown, XmNmnemonic, 'I', NULL); AddStaticCallback(wid, XmNactivateCallback, &PltApp::DoInfoButton); XtManageChild(wMenuBar); // --------------------------------------------Palette frame and drawing area wPalFrame = XtVaCreateManagedWidget("paletteframe", xmFrameWidgetClass, wMainArea, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wMenuBar, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 1, XmNshadowType, XmSHADOW_ETCHED_IN, NULL); wPalForm = XtVaCreateManagedWidget("paletteform", xmFormWidgetClass, wPalFrame, NULL); wPalArea = XtVaCreateManagedWidget("palarea", xmDrawingAreaWidgetClass, wPalForm, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 30, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, // XmNx, 690, // XmNy, 0, XmNwidth, 150, XmNheight, 290, NULL); AddStaticEventHandler(wPalArea, ExposureMask, &PltApp::DoExposePalette); // Indicate the unit type of the palette (legend) area above it. strcpy(buffer, pltAppState->CurrentDerived().c_str()); label_str = XmStringCreateSimple(buffer); wPlotLabel = XtVaCreateManagedWidget("plotlabel", xmLabelWidgetClass, wPalForm, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, wPalArea, XmNleftOffset, 0, XmNrightOffset, 0, XmNbottomOffset, 0, XmNbackground, pltPaletteptr->BlackIndex(), XmNlabelString, label_str, NULL); XmStringFree(label_str); // ************************************** Controls frame and area Widget wControlsFrame; wControlsFrame = XtVaCreateManagedWidget("controlsframe", xmFrameWidgetClass, wMainArea, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 1, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wPalFrame, XmNshadowType, XmSHADOW_ETCHED_IN, //XmNbackground, 120, //XmNforeground, 220, NULL); unsigned long wc; int wcfWidth(150), wcfHeight(260); int centerX(wcfWidth / 2), centerY((wcfHeight / 2) - 16); int controlSize(16); int halfbutton(controlSize / 2); wControlForm = XtVaCreateManagedWidget("refArea", xmDrawingAreaWidgetClass, wControlsFrame, XmNwidth, wcfWidth, XmNheight, wcfHeight, XmNresizePolicy, XmRESIZE_NONE, NULL); AddStaticEventHandler(wControlForm, ExposureMask, &PltApp::DoExposeRef); #if (BL_SPACEDIM == 3) wControls[WCSTOP] = XtVaCreateManagedWidget("0", xmPushButtonWidgetClass, wControlForm, XmNx, centerX-halfbutton, XmNy, centerY-halfbutton, XmCMarginBottom, 2, NULL); XtManageChild(wControls[WCSTOP]); wControls[WCXNEG] = XtVaCreateManagedWidget("wcxneg", xmArrowButtonWidgetClass, wControlForm, XmNarrowDirection, XmARROW_LEFT, XmNx, centerX+halfbutton, XmNy, centerY-halfbutton, NULL); wControls[WCXPOS] = XtVaCreateManagedWidget("wcxpos", xmArrowButtonWidgetClass, wControlForm, XmNarrowDirection, XmARROW_RIGHT, XmNx, centerX+3*halfbutton, XmNy, centerY-halfbutton, NULL); wControls[WCYNEG] = XtVaCreateManagedWidget("wcyneg", xmArrowButtonWidgetClass, wControlForm, XmNarrowDirection, XmARROW_DOWN, XmNx, centerX-halfbutton, XmNy, centerY-3*halfbutton, NULL); wControls[WCYPOS] = XtVaCreateManagedWidget("wcypos", xmArrowButtonWidgetClass, wControlForm, XmNarrowDirection, XmARROW_UP, XmNx, centerX-halfbutton, XmNy, centerY-5*halfbutton, NULL); wControls[WCZNEG] = XtVaCreateManagedWidget("wczneg", xmArrowButtonWidgetClass, wControlForm, XmNarrowDirection, XmARROW_RIGHT, XmNx, centerX-3*halfbutton+1, XmNy, centerY+halfbutton-1, NULL); wControls[WCZPOS] = XtVaCreateManagedWidget("wczpos", xmArrowButtonWidgetClass, wControlForm, XmNarrowDirection, XmARROW_LEFT, XmNx, centerX-5*halfbutton+2, XmNy, centerY+3*halfbutton-2, NULL); for(wc = WCSTOP; wc <= WCZPOS; ++wc) { XtVaSetValues(wControls[wc], XmNwidth, controlSize, XmNheight, controlSize, XmNborderWidth, 0, XmNhighlightThickness, 0, NULL); AddStaticCallback(wControls[wc], XmNactivateCallback, &PltApp::ChangePlane, (XtPointer) wc); } #endif int adjustHeight2D = (BL_SPACEDIM == 2) ? centerY : 0; Dimension slw; if(animating2d) { wControls[WCASTOP] = XtVaCreateManagedWidget("0", xmPushButtonWidgetClass, wControlForm, XmNx, centerX-halfbutton, XmCMarginBottom, 2, NULL); //XtManageChild(wControls[WCASTOP]); wControls[WCATNEG] = XtVaCreateManagedWidget("wcatneg", xmArrowButtonWidgetClass, wControlForm, XmNarrowDirection, XmARROW_LEFT, XmNx, centerX-3*halfbutton, NULL); wControls[WCATPOS] = XtVaCreateManagedWidget("wcatpos", xmArrowButtonWidgetClass, wControlForm, XmNarrowDirection, XmARROW_RIGHT, XmNx, centerX+halfbutton, NULL); for(wc = WCATNEG; wc <= WCATPOS; ++wc) { XtVaSetValues(wControls[wc], XmNwidth, controlSize, XmNheight, controlSize, XmNborderWidth, 0, XmNhighlightThickness, 0, XmNy, wcfHeight-adjustHeight2D, NULL); AddStaticCallback(wControls[wc], XmNactivateCallback, &PltApp::ChangePlane, (XtPointer) wc); } if ( AVGlobals::IsSGIrgbFile() ) { wControls[WCARGB] = XtVaCreateManagedWidget("rgb >", xmPushButtonWidgetClass, wControlForm, XmCMarginBottom, 2, XmNwidth, 3*controlSize, XmNheight, controlSize, XmNborderWidth, 0, XmNhighlightThickness, 0, XmNx, centerX-3*halfbutton, XmNy, wcfHeight+3*halfbutton-adjustHeight2D, NULL); } else { wControls[WCARGB] = XtVaCreateManagedWidget("ppm >", xmPushButtonWidgetClass, wControlForm, XmCMarginBottom, 2, XmNwidth, 3*controlSize, XmNheight, controlSize, XmNborderWidth, 0, XmNhighlightThickness, 0, XmNx, centerX-3*halfbutton, XmNy, wcfHeight+3*halfbutton-adjustHeight2D, NULL); } AddStaticCallback(wControls[WCARGB], XmNactivateCallback, &PltApp::ChangePlane, (XtPointer) WCARGB); //XtManageChild(wControls[WCARGB]); wWhichFileScale = XtVaCreateManagedWidget("whichFileScale", xmScaleWidgetClass, wControlForm, XmNminimum, 0, XmNmaximum, animFrames-1, XmNvalue, currentFrame, XmNorientation, XmHORIZONTAL, XmNx, 0, XmNscaleWidth, wcfWidth * 2 / 3, XmNy, wcfHeight-7*halfbutton-adjustHeight2D, NULL); AddStaticCallback(wWhichFileScale, XmNvalueChangedCallback, &PltApp::DoAnimFileScale); Widget wAnimLabelFast = XtVaCreateManagedWidget("File", xmLabelWidgetClass, wControlForm, XmNy, wcfHeight-7*halfbutton-adjustHeight2D, NULL); XtVaGetValues(wAnimLabelFast, XmNwidth, &slw, NULL); XtVaSetValues(wAnimLabelFast, XmNx, wcfWidth-slw, NULL); char cTempFN[BUFSIZ]; strcpy(cTempFN, AVGlobals::StripSlashes(fileNames[currentFrame]).c_str()); XmString fileString = XmStringCreateSimple(cTempFN); wWhichFileLabel = XtVaCreateManagedWidget("whichFileLabel", xmLabelWidgetClass, wControlForm, XmNx, 0, XmNy, wcfHeight -4*halfbutton-3-adjustHeight2D, XmNlabelString, fileString, NULL); XmStringFree(fileString); // We add a which-time label to indicate the time of each plot file. char tempTimeName[LINELENGTH]; ostrstream tempTimeOut(tempTimeName, LINELENGTH); tempTimeOut << "T=" << amrData.Time() << ends; XmString timeString = XmStringCreateSimple(tempTimeName); wWhichTimeLabel = XtVaCreateManagedWidget("whichTimeLabel", xmLabelWidgetClass, wControlForm, XmNx, 0, XmNy, wcfHeight - 2*halfbutton-3-adjustHeight2D, XmNlabelString, timeString, NULL); XmStringFree(timeString); } // end if(animating2d) if(animating2d || BL_SPACEDIM == 3) { Widget wSpeedScale = XtVaCreateManagedWidget("speed", xmScaleWidgetClass, wControlForm, XmNminimum, 0, XmNmaximum, 599, XmNvalue, 600 - frameSpeed, XmNorientation, XmHORIZONTAL, XmNx, 0, XmNscaleWidth, wcfWidth * 2 / 3, XmNy, wcfHeight - 9 * halfbutton - adjustHeight2D, NULL); AddStaticCallback(wSpeedScale, XmNvalueChangedCallback, &PltApp::DoSpeedScale); //XtVaGetValues(wSpeedScale, XmNwidth, &slw, NULL); //XtVaSetValues(wSpeedScale, XmNx, (wcfWidth-slw) / 2, NULL); Widget wSpeedLabel = XtVaCreateManagedWidget("Speed", xmLabelWidgetClass, wControlForm, XmNy, wcfHeight - 9 * halfbutton - adjustHeight2D, NULL); XtVaGetValues(wSpeedLabel, XmNwidth, &slw, NULL); XtVaSetValues(wSpeedLabel, XmNx, wcfWidth-slw, NULL); } // ************************** Plot frame and area wPlotFrame = XtVaCreateManagedWidget("plotframe", xmFrameWidgetClass, wMainArea, XmNrightAttachment, XmATTACH_WIDGET, XmNrightWidget, wPalFrame, XmNleftAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wMenuBar, XmNshadowType, XmSHADOW_ETCHED_IN, XmNspacing, 0, XmNmarginHeight, 0, NULL); Widget wPicArea = XtVaCreateManagedWidget("picarea", xmFormWidgetClass, wPlotFrame, NULL); wLocArea = XtVaCreateManagedWidget("locarea",xmDrawingAreaWidgetClass, wPicArea, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNheight, 30, NULL); wPlotArea = XtVaCreateManagedWidget("plotarea", xmFormWidgetClass, wPicArea, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_WIDGET, XmNbottomWidget, wLocArea, NULL); wScrollArea[ZPLANE] = XtVaCreateManagedWidget("scrollAreaXY", xmScrolledWindowWidgetClass, wPlotArea, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 0, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 0, XmNscrollingPolicy, XmAUTOMATIC, NULL); trans = ": DrawingAreaInput() ManagerGadgetButtonMotion() \n\ : DrawingAreaInput() ManagerGadgetButtonMotion() \n\ : DrawingAreaInput() ManagerGadgetButtonMotion() \n\ : DrawingAreaInput() ManagerGadgetButtonMotion() \n\ : DrawingAreaInput() ManagerGadgetButtonMotion() \n\ : DrawingAreaInput() ManagerGadgetButtonMotion() \n\ : DrawingAreaInput() ManagerGadgetButtonMotion() \n\ : DrawingAreaInput() ManagerGadgetButtonMotion() \n\ : DrawingAreaInput() ManagerGadgetButtonMotion()"; wPlotPlane[ZPLANE] = XtVaCreateManagedWidget("plotArea", xmDrawingAreaWidgetClass, wScrollArea[ZPLANE], XmNtranslations, XtParseTranslationTable(trans), XmNwidth, amrPicturePtrArray[ZPLANE]->ImageSizeH() + 1, XmNheight, amrPicturePtrArray[ZPLANE]->ImageSizeV() + 1, NULL); XtVaSetValues(wScrollArea[ZPLANE], XmNworkWindow, wPlotPlane[ZPLANE], NULL); #if (BL_SPACEDIM == 2) XtVaSetValues(wScrollArea[ZPLANE], XmNbottomAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); #elif (BL_SPACEDIM == 3) XtVaSetValues(wAmrVisTopLevel, XmNwidth, 1100, XmNheight, 650, NULL); XtVaSetValues(wScrollArea[ZPLANE], XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, 50, // % XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 50, NULL); // ********************************************************* XZ wScrollArea[YPLANE] = XtVaCreateManagedWidget("scrollAreaXZ", xmScrolledWindowWidgetClass, wPlotArea, XmNrightAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wScrollArea[ZPLANE], XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 50, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 0, XmNscrollingPolicy, XmAUTOMATIC, NULL); wPlotPlane[YPLANE] = XtVaCreateManagedWidget("plotArea", xmDrawingAreaWidgetClass, wScrollArea[YPLANE], XmNtranslations, XtParseTranslationTable(trans), XmNwidth, amrPicturePtrArray[YPLANE]->ImageSizeH() + 1, XmNheight, amrPicturePtrArray[YPLANE]->ImageSizeV() + 1, NULL); XtVaSetValues(wScrollArea[YPLANE], XmNworkWindow, wPlotPlane[YPLANE], NULL); // ********************************************************* YZ wScrollArea[XPLANE] = XtVaCreateManagedWidget("scrollAreaYZ", xmScrolledWindowWidgetClass, wPlotArea, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, 50, // % XmNtopAttachment, XmATTACH_POSITION, XmNtopPosition, 50, // % XmNscrollingPolicy, XmAUTOMATIC, NULL); wPlotPlane[XPLANE] = XtVaCreateManagedWidget("plotArea", xmDrawingAreaWidgetClass, wScrollArea[XPLANE], XmNtranslations, XtParseTranslationTable(trans), XmNwidth, amrPicturePtrArray[XPLANE]->ImageSizeH() + 1, XmNheight, amrPicturePtrArray[XPLANE]->ImageSizeV() + 1, NULL); XtVaSetValues(wScrollArea[XPLANE], XmNworkWindow, wPlotPlane[XPLANE], NULL); // ****************************************** Transform Area & buttons wOrientXY = XtVaCreateManagedWidget("XY", xmPushButtonGadgetClass, wPlotArea, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wScrollArea[XPLANE], XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_POSITION, XmNtopPosition, 50, NULL); AddStaticCallback(wOrientXY, XmNactivateCallback, &PltApp::DoOrient, (XtPointer) OXY); XtManageChild(wOrientXY); wOrientYZ = XtVaCreateManagedWidget("YZ", xmPushButtonGadgetClass, wPlotArea, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wOrientXY, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_POSITION, XmNtopPosition, 50, NULL); AddStaticCallback(wOrientYZ, XmNactivateCallback, &PltApp::DoOrient, (XtPointer) OYZ); XtManageChild(wOrientYZ); wOrientXZ = XtVaCreateManagedWidget("XZ", xmPushButtonGadgetClass, wPlotArea, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wOrientYZ, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_POSITION, XmNtopPosition, 50, NULL); AddStaticCallback(wOrientXZ, XmNactivateCallback, &PltApp::DoOrient, (XtPointer) OXZ); XtManageChild(wOrientXZ); wLabelAxes = XtVaCreateManagedWidget("XYZ", xmPushButtonGadgetClass, wPlotArea, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wOrientXZ, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_POSITION, XmNtopPosition, 50, NULL); AddStaticCallback(wLabelAxes, XmNactivateCallback, &PltApp::DoLabelAxes); XtManageChild(wLabelAxes); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) wRender = XtVaCreateManagedWidget("Draw", xmPushButtonGadgetClass, wPlotArea, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wLabelAxes, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_POSITION, XmNtopPosition, 50, NULL); AddStaticCallback(wRender, XmNactivateCallback, &PltApp::DoRender); XtManageChild(wRender); #endif XmString sDetach = XmStringCreateSimple("Detach"); wDetach = XtVaCreateManagedWidget("detach", xmPushButtonGadgetClass, wPlotArea, XmNlabelString, sDetach, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, XmNtopAttachment, XmATTACH_POSITION, XmNtopPosition, 50, NULL); XmStringFree(sDetach); AddStaticCallback(wDetach, XmNactivateCallback, &PltApp::DoDetach); XtManageChild(wDetach); wTransDA = XtVaCreateManagedWidget("transDA", xmDrawingAreaWidgetClass, wPlotArea, XmNtranslations, XtParseTranslationTable(trans), XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wScrollArea[XPLANE], XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wOrientXY, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, NULL); #endif for(np = 0; np < NPLANES; ++np) { AddStaticCallback(wPlotPlane[np], XmNinputCallback, &PltApp::DoRubberBanding, (XtPointer) np); AddStaticEventHandler(wPlotPlane[np], ExposureMask, &PltApp::PADoExposePicture, (XtPointer) np); AddStaticEventHandler(wPlotPlane[np], PointerMotionMask | LeaveWindowMask, &PltApp::DoDrawPointerLocation, (XtPointer) np); } // ***************************************************************** XtManageChild(wPalArea); XtManageChild(wPlotArea); XtPopup(wAmrVisTopLevel, XtGrabNone); pltPaletteptr->SetWindow(XtWindow(wPalArea)); pltPaletteptr->SetWindowPalette(palFilename, XtWindow(wPalArea)); pltPaletteptr->SetWindowPalette(palFilename, XtWindow(wPlotArea)); pltPaletteptr->SetWindowPalette(palFilename, XtWindow(wAmrVisTopLevel)); for(np = 0; np != NPLANES; ++np) { pltPaletteptr->SetWindowPalette(palFilename, XtWindow(wPlotPlane[np])); } #if (BL_SPACEDIM == 3) pltPaletteptr->SetWindowPalette(palFilename, XtWindow(wTransDA)); Dimension width, height; XtVaGetValues(wTransDA, XmNwidth, &width, XmNheight, &height, NULL); daWidth = width; daHeight = height; projPicturePtr = new ProjectionPicture(this, &viewTrans, pltPaletteptr, wTransDA, daWidth, daHeight); AddStaticCallback(wTransDA, XmNinputCallback, &PltApp::DoTransInput); AddStaticCallback(wTransDA, XmNresizeCallback, &PltApp::DoTransResize); AddStaticEventHandler(wTransDA, ExposureMask, &PltApp::DoExposeTransDA); DoTransResize(wTransDA, NULL, NULL); #endif char plottertitle[50]; sprintf(plottertitle, "XYPlot%dd", BL_SPACEDIM); XYplotparameters = new XYPlotParameters(pltPaletteptr, gaPtr, plottertitle); for(np = 0; np < NPLANES; ++np) { amrPicturePtrArray[np]->CreatePicture(XtWindow(wPlotPlane[np]), pltPaletteptr); } #if (BL_SPACEDIM == 3) viewTrans.MakeTransform(); labelAxes = false; transDetached = false; for(np = 0; np < NPLANES; ++np) { startcutX[np] = 0; startcutY[np] = amrPicturePtrArray[np]->GetHLine(); finishcutX[np] = 0; finishcutY[np] = amrPicturePtrArray[np]->GetHLine(); amrPicturePtrArray[np]->ToggleShowSubCut(); } projPicturePtr->ToggleShowSubCut(); projPicturePtr->MakeBoxes(); #endif interfaceReady = true; cbdPtrs.reserve(512); // arbitrarily if(bSubVolume) { //ChangeLevel(wTempDrawLevel, (XtPointer)(pltAppState->MaxDrawnLevel()), NULL); XtVaSetValues(wTempDrawLevel, XmNset, true, NULL); ChangeLevel(wTempDrawLevel, (XtPointer)(pltAppState->MaxAllowableLevel()), NULL); } } // end PltAppInit() // ------------------------------------------------------------------- void PltApp::FindAndSetMinMax(const MinMaxRangeType mmrangetype, const int framenumber, const string ¤tderived, const int derivednumber, const Array &onBox, const int coarselevel, const int finelevel, const bool resetIfSet) { Real rMin, rMax, levMin, levMax; bool isSet(pltAppState->IsSet(mmrangetype, framenumber, derivednumber)); if(isSet == false || resetIfSet) { // find and set the mins and maxes rMin = AV_BIG_REAL; rMax = -AV_BIG_REAL; for(int lev(coarselevel); lev <= finelevel; ++lev) { bool minMaxValid(false); DataServices::Dispatch(DataServices::MinMaxRequest, dataServicesPtr[framenumber], (void *) &(onBox[lev]), (void *) &(currentderived), lev, &levMin, &levMax, &minMaxValid); if(minMaxValid) { rMin = min(rMin, levMin); rMax = max(rMax, levMax); } } pltAppState->SetMinMax(mmrangetype, framenumber, derivednumber, rMin, rMax); } } // ------------------------------------------------------------------- void PltApp::DoExposeRef(Widget, XtPointer, XtPointer) { int zPlanePosX(10), zPlanePosY(15); int whiteColor(pltPaletteptr->WhiteIndex()); int zpColor(whiteColor); char sX[LINELENGTH], sY[LINELENGTH], sZ[LINELENGTH]; XClearWindow(display, XtWindow(wControlForm)); strcpy(sX, "X"); strcpy(sY, "Y"); strcpy(sZ, "Z"); DrawAxes(wControlForm, zPlanePosX, zPlanePosY, 0, sX, sY, zpColor); #if (BL_SPACEDIM == 3) int axisLength(20); int ypColor(whiteColor), xpColor(whiteColor); int xyzAxisLength(50); int stringOffsetX(4), stringOffsetY(20); int yPlanePosX(80), yPlanePosY(15); int xPlanePosX(10); int xPlanePosY((int) (axisLength + zPlanePosY + 1.4 * stringOffsetY)); char temp[LINELENGTH]; Dimension width, height; XtVaGetValues(wControlForm, XmNwidth, &width, XmNheight, &height, NULL); int centerX((int) width / 2); int centerY((int) height / 2 - 16); DrawAxes(wControlForm, yPlanePosX, yPlanePosY, 0, sX, sZ, ypColor); DrawAxes(wControlForm, xPlanePosX, xPlanePosY, 0, sY, sZ, xpColor); sprintf(temp, "Z=%i", amrPicturePtrArray[ZPLANE]->GetSlice()); // (amrPicturePtrArray[YPLANE]-> // ImageSizeV()-1 - amrPicturePtrArray[YPLANE]->GetHLine())/ // currentScale + ivLowOffsetMAL[ZDIR]); XSetForeground(display, xgc, pltPaletteptr->pixelate(zpColor)); XDrawString(display, XtWindow(wControlForm), xgc, centerX-xyzAxisLength+12, centerY+xyzAxisLength+4, temp, strlen(temp)); sprintf(temp, "Y=%i", amrPicturePtrArray[YPLANE]->GetSlice()); //amrPicturePtrArray[XPLANE]->GetVLine()/ // currentScale + ivLowOffsetMAL[YDIR]); XSetForeground(display, xgc, pltPaletteptr->pixelate(ypColor)); XDrawString(display, XtWindow(wControlForm), xgc, centerX+stringOffsetX, centerY-xyzAxisLength+4, temp, strlen(temp)); sprintf(temp, "X=%i", amrPicturePtrArray[XPLANE]->GetSlice()); //amrPicturePtrArray[ZPLANE]->GetVLine()/ //currentScale + ivLowOffsetMAL[XDIR]); XSetForeground(display, xgc, pltPaletteptr->pixelate(xpColor)); XDrawString(display, XtWindow(wControlForm), xgc, centerX+4*stringOffsetX, centerY+stringOffsetY+2, temp, strlen(temp)); XSetForeground(XtDisplay(wControlForm), xgc, pltPaletteptr->pixelate(ypColor)); XDrawLine(display, XtWindow(wControlForm), xgc, centerX, centerY, centerX, centerY-xyzAxisLength); XDrawLine(display, XtWindow(wControlForm), xgc, centerX, centerY, centerX+xyzAxisLength, centerY); XDrawLine(display, XtWindow(wControlForm), xgc, centerX, centerY, (int) (centerX - 0.9 * xyzAxisLength), (int) (centerY + 0.9 * xyzAxisLength)); #endif } // ------------------------------------------------------------------- void PltApp::DrawAxes(Widget wArea, int xpos, int ypos, int /* orientation */ , char *hlabel, char *vlabel, int color) { int axisLength(20); char hLabel[LINELENGTH], vLabel[LINELENGTH]; strcpy(hLabel, hlabel); strcpy(vLabel, vlabel); XSetForeground(XtDisplay(wArea), xgc, pltPaletteptr->pixelate(color)); XDrawLine(XtDisplay(wArea), XtWindow(wArea), xgc, xpos+5, ypos, xpos+5, ypos+axisLength); XDrawLine(XtDisplay(wArea), XtWindow(wArea), xgc, xpos+5, ypos+axisLength, xpos+5+axisLength, ypos+axisLength); XDrawString(XtDisplay(wArea), XtWindow(wArea), xgc, xpos+5+axisLength, ypos+5+axisLength, hLabel, strlen(hLabel)); XDrawString(XtDisplay(wArea), XtWindow(wArea), xgc, xpos, ypos, vLabel, strlen(vLabel)); } // ------------------------------------------------------------------- void PltApp::ChangeScale(Widget w, XtPointer client_data, XtPointer) { if(w == wCurrScale) { XtVaSetValues(w, XmNset, true, NULL); return; } unsigned long newScale = (unsigned long) client_data; XtVaSetValues(wCurrScale, XmNset, false, NULL); wCurrScale = w; int previousScale(pltAppState->CurrentScale()); int currentScale(newScale); pltAppState->SetCurrentScale(currentScale); if(animating2d) { ResetAnimation(); DirtyFrames(); } for(int whichView(0); whichView < NPLANES; ++whichView) { if(whichView == activeView) { startX = (int) startX / previousScale * currentScale; startY = (int) startY / previousScale * currentScale; endX = (int) endX / previousScale * currentScale; endY = (int) endY / previousScale * currentScale; amrPicturePtrArray[activeView]->SetRegion(startX, startY, endX, endY); } startcutX[whichView] /= previousScale; startcutY[whichView] /= previousScale; finishcutX[whichView] /= previousScale; finishcutY[whichView] /= previousScale; startcutX[whichView] *= currentScale; startcutY[whichView] *= currentScale; finishcutX[whichView] *= currentScale; finishcutY[whichView] *= currentScale; amrPicturePtrArray[whichView]->SetSubCut(startcutX[whichView], startcutY[whichView], finishcutX[whichView], finishcutY[whichView]); amrPicturePtrArray[whichView]->APChangeScale(currentScale, previousScale); XtVaSetValues(wPlotPlane[whichView], XmNwidth, amrPicturePtrArray[whichView]->ImageSizeH() + 1, XmNheight, amrPicturePtrArray[whichView]->ImageSizeV() + 1, NULL); } DoExposeRef(); writingRGB = false; } // ------------------------------------------------------------------- void PltApp::ChangeLevel(Widget w, XtPointer client_data, XtPointer) { unsigned long newLevel = (unsigned long) client_data; int minDrawnLevel(pltAppState->MinAllowableLevel()); int maxDrawnLevel(newLevel); if(wCurrLevel != NULL) { XtVaSetValues(wCurrLevel, XmNset, false, NULL); } if(w == wCurrLevel) { XtVaSetValues(w, XmNset, true, NULL); //return; } wCurrLevel = w; if(animating2d) { ResetAnimation(); DirtyFrames(); } pltAppState->SetMinDrawnLevel(minDrawnLevel); pltAppState->SetMaxDrawnLevel(maxDrawnLevel); for(int whichView(0); whichView < NPLANES; ++whichView) { amrPicturePtrArray[whichView]->APChangeLevel(); #if (BL_SPACEDIM == 3) if(whichView == ZPLANE) { #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) if( ! XmToggleButtonGetState(wAutoDraw)) { projPicturePtr->MakeBoxes(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); DoExposeTransDA(); } #else projPicturePtr->MakeBoxes(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); DoExposeTransDA(); #endif } #endif } if(datasetShowing) { int hdir(-1), vdir(-1), sdir(-1); if(activeView==ZPLANE) { hdir = XDIR; vdir = YDIR; sdir = ZDIR; } if(activeView==YPLANE) { hdir = XDIR; vdir = ZDIR; sdir = YDIR; } if(activeView==XPLANE) { hdir = YDIR; vdir = ZDIR; sdir = XDIR; } datasetPtr->DatasetRender(trueRegion, amrPicturePtrArray[activeView], this, pltAppState, hdir, vdir, sdir); datasetPtr->DoExpose(false); } DoExposeRef(); } // ------------------------------------------------------------------- void PltApp::ChangeDerived(Widget w, XtPointer client_data, XtPointer) { if(w == wCurrDerived) { XtVaSetValues(w, XmNset, true, NULL); if(AVGlobals::Verbose()) { cout << "--------------------- unchanged derived." << endl; } return; } XtVaSetValues(wCurrDerived, XmNset, false, NULL); wCurrDerived = w; unsigned long derivedNumber = (unsigned long) client_data; pltAppState->SetCurrentDerived(dataServicesPtr[currentFrame]-> PlotVarNames()[derivedNumber], derivedNumber); int maxDrawnLevel = pltAppState->MaxDrawnLevel(); const AmrData &amrData = dataServicesPtr[currentFrame]->AmrDataRef(); // possibly set all six minmax types here const Array &onSubregionBox = amrPicturePtrArray[ZPLANE]->GetSubDomain(); const Array &onBox(amrData.ProbDomain()); int iCDerNum(pltAppState->CurrentDerivedNumber()); int coarseLevel(pltAppState->MinAllowableLevel()); int fineLevel(pltAppState->MaxAllowableLevel()); Real rGlobalMin, rGlobalMax; Real rSubregionMin, rSubregionMax; rGlobalMin = AV_BIG_REAL; rGlobalMax = -AV_BIG_REAL; rSubregionMin = AV_BIG_REAL; rSubregionMax = -AV_BIG_REAL; const string asCDer(pltAppState->CurrentDerived()); for(int iFrame(0); iFrame < animFrames; ++iFrame) { // set FILEGLOBALMINMAX dont reset if already set FindAndSetMinMax(FILEGLOBALMINMAX, iFrame, asCDer, iCDerNum, onBox, coarseLevel, fineLevel, false); // set FILESUBREGIONMINMAX dont reset if already set FindAndSetMinMax(FILESUBREGIONMINMAX, iFrame, asCDer, iCDerNum, onSubregionBox, coarseLevel, fineLevel, false); // collect file values Real rTempMin, rTempMax; pltAppState->GetMinMax(FILEGLOBALMINMAX, iFrame, iCDerNum, rTempMin, rTempMax); rGlobalMin = min(rGlobalMin, rTempMin); rGlobalMax = max(rGlobalMax, rTempMax); pltAppState->GetMinMax(FILESUBREGIONMINMAX, iFrame, iCDerNum, rTempMin, rTempMax); rSubregionMin = min(rSubregionMin, rTempMin); rSubregionMax = max(rSubregionMax, rTempMax); // set FILEUSERMINMAX dont reset if already set // this sets values to FILESUBREGIONMINMAX values if the user has not set them bool isSet(pltAppState->IsSet(FILEUSERMINMAX, iFrame, iCDerNum)); if( ! isSet) { pltAppState->SetMinMax(FILEUSERMINMAX, iFrame, iCDerNum, rTempMin, rTempMax); } } for(int iFrame(0); iFrame < animFrames; ++iFrame) { pltAppState->SetMinMax(GLOBALMINMAX, iFrame, iCDerNum, rGlobalMin, rGlobalMax); pltAppState->SetMinMax(SUBREGIONMINMAX, iFrame, iCDerNum, rSubregionMin, rSubregionMax); // set FILEUSERMINMAX dont reset if already set // this sets values to FILESUBREGIONMINMAX values if the user has not set them bool isSet(pltAppState->IsSet(USERMINMAX, iFrame, iCDerNum)); if( ! isSet) { pltAppState->SetMinMax(USERMINMAX, iFrame, iCDerNum, rSubregionMin, rSubregionMax); } } if(AVGlobals::Verbose()) { cout << "_in PltApp::ChangeDerived" << endl; pltAppState->PrintSetMap(); cout << endl; } #if (BL_SPACEDIM == 3) #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) projPicturePtr->GetVolRenderPtr()->InvalidateSWFData(); projPicturePtr->GetVolRenderPtr()->InvalidateVPData(); #endif Clear(); #endif writingRGB = false; paletteDrawn = false; if(animating2d) { ResetAnimation(); DirtyFrames(); if(UsingFileRange(currentRangeType)) { Real dataMin, dataMax; int coarseLevel(0); int fineLevel(maxDrawnLevel); for(int lev(coarseLevel); lev <= fineLevel; ++lev) { bool minMaxValid(false); DataServices::Dispatch(DataServices::MinMaxRequest, dataServicesPtr[currentFrame], (void *) &(amrData.ProbDomain()[lev]), (void *) &(pltAppState->CurrentDerived()), lev, &dataMin, &dataMax, &minMaxValid); if( ! minMaxValid) { continue; } } } else if(strcmp(pltAppState->CurrentDerived().c_str(),"vfrac") == 0) { } else { string outbuf("Finding global min & max values for "); outbuf += pltAppState->CurrentDerived(); outbuf += "...\n"; strcpy(buffer, outbuf.c_str()); PrintMessage(buffer); Real dataMin, dataMax; int coarseLevel(0); int fineLevel(maxDrawnLevel); for(int iFrame(0); iFrame < animFrames; ++iFrame) { for(int lev(coarseLevel); lev <= fineLevel; ++lev) { bool minMaxValid(false); DataServices::Dispatch(DataServices::MinMaxRequest, dataServicesPtr[iFrame], (void *) &(amrData.ProbDomain()[lev]), (void *) &(pltAppState->CurrentDerived()), lev, &dataMin, &dataMax, &minMaxValid); if( ! minMaxValid) { continue; } } } } } // end if(animating2d) strcpy(buffer, pltAppState->CurrentDerived().c_str()); XmString label_str = XmStringCreateSimple(buffer); XtVaSetValues(wPlotLabel, XmNlabelString, label_str, NULL); XmStringFree(label_str); for(int iv(0); iv < NPLANES; ++iv) { amrPicturePtrArray[iv]->APMakeImages(pltPaletteptr); } if(datasetShowing) { int hdir(-1), vdir(-1), sdir(-1); hdir = (activeView == XPLANE) ? YDIR : XDIR; vdir = (activeView == ZPLANE) ? YDIR : ZDIR; sdir = (activeView == YPLANE) ? YDIR : ((activeView == XYPLANE) ? XDIR : ZDIR); datasetPtr->DatasetRender(trueRegion, amrPicturePtrArray[activeView], this, pltAppState, hdir, vdir, sdir); datasetPtr->DoExpose(false); } } // end ChangeDerived(...) // ------------------------------------------------------------------- void PltApp::ChangeContour(Widget w, XtPointer input_data, XtPointer) { ContourType prevCType(pltAppState->GetContourType()); ContourType newCType = ContourType((unsigned long) input_data); if(newCType == prevCType) { return; } pltAppState->SetContourType(newCType); XtVaSetValues(wContourLabel, XmNsensitive, (newCType != RASTERONLY), NULL); XtVaSetValues(wNumberContours, XmNsensitive, (newCType != RASTERONLY), NULL); if(animating2d) { ResetAnimation(); DirtyFrames(); } for(int np(0); np < NPLANES; ++np) { amrPicturePtrArray[np]->APChangeContour(prevCType); } } // ------------------------------------------------------------------- void PltApp::ReadContourString(Widget w, XtPointer, XtPointer) { if(animating2d) { ResetAnimation(); DirtyFrames(); } char temp[64]; strcpy(temp, XmTextFieldGetString(w)); string tmpContourNumString(temp); // unexhaustive string check to prevent errors bool stringOk(true); //check to make sure the input is an integer, and its length < 3. if(tmpContourNumString.length() >= 3) { stringOk = false; cerr << "Bad contour number string, must be less than 100." << endl; } else { for(int i(0); i < tmpContourNumString.length(); ++i) { if( ! isdigit(tmpContourNumString[i])) { stringOk = false; } } } if(stringOk) { contourNumString = tmpContourNumString; pltAppState->SetNumContours(atoi(contourNumString.c_str())); for(int ii(0); ii < NPLANES; ++ii) { amrPicturePtrArray[ii]->APDraw(pltAppState->MinDrawnLevel(), pltAppState->MaxDrawnLevel()); } } XtVaSetValues(w, XmNvalue, contourNumString.c_str(), NULL); } // ------------------------------------------------------------------- void PltApp::ToggleRange(Widget w, XtPointer client_data, XtPointer call_data) { unsigned long r = (unsigned long) client_data; XmToggleButtonCallbackStruct *state = (XmToggleButtonCallbackStruct *) call_data; if(state->set == true) { currentRangeType = (MinMaxRangeType) r; if(bFileRangeButtonSet) { if(currentRangeType == GLOBALMINMAX) { currentRangeType = FILEGLOBALMINMAX; } else if(currentRangeType == SUBREGIONMINMAX) { currentRangeType = FILESUBREGIONMINMAX; } else if(currentRangeType == USERMINMAX) { currentRangeType = FILEUSERMINMAX; } } } } // ------------------------------------------------------------------- void PltApp::DoSubregion(Widget, XtPointer, XtPointer) { Box subregionBox; const AmrData &amrData = dataServicesPtr[currentFrame]->AmrDataRef(); int finestLevel(amrData.FinestLevel()); int maxAllowableLevel(pltAppState->MaxAllowableLevel()); int newMinAllowableLevel; // subregionBox is at the maxAllowableLevel #if (BL_SPACEDIM == 2) if(selectionBox.bigEnd(XDIR) == 0 || selectionBox.bigEnd(YDIR) == 0) { return; } subregionBox = selectionBox + ivLowOffsetMAL; #endif #if (BL_SPACEDIM == 3) int np; int currentScale(pltAppState->CurrentScale()); for(np = 0; np < NPLANES; ++np) { startcutX[np] /= currentScale; startcutY[np] /= currentScale; finishcutX[np] /= currentScale; finishcutY[np] /= currentScale; } subregionBox.setSmall(XDIR, min(startcutX[ZPLANE], finishcutX[ZPLANE])); subregionBox.setSmall(YDIR, min(startcutX[XPLANE], finishcutX[XPLANE])); subregionBox.setSmall(ZDIR, (amrPicturePtrArray[XPLANE]->ImageSizeV()-1)/ currentScale - max(startcutY[XPLANE], finishcutY[XPLANE])); subregionBox.setBig(XDIR, max(startcutX[ZPLANE], finishcutX[ZPLANE])); subregionBox.setBig(YDIR, max(startcutX[XPLANE], finishcutX[XPLANE])); subregionBox.setBig(ZDIR, (amrPicturePtrArray[XPLANE]->ImageSizeV()-1)/ currentScale - min(startcutY[XPLANE], finishcutY[XPLANE])); if(subregionBox.numPts() <= 4) { for(np = 0; np < NPLANES; ++np) { startcutX[np] *= currentScale; startcutY[np] *= currentScale; finishcutX[np] *= currentScale; finishcutY[np] *= currentScale; } return; } subregionBox += ivLowOffsetMAL; // shift to true data region #endif Box tempRefinedBox(subregionBox); tempRefinedBox.refine(AVGlobals::CRRBetweenLevels(maxAllowableLevel, finestLevel, amrData.RefRatio())); // this puts tempRefinedBox in terms of the finest level newMinAllowableLevel = pltAppState->MinAllowableLevel(); //newMinAllowableLevel = min(newMinAllowableLevel, maxAllowableLevel); // coarsen to the newMinAllowableLevel to align grids subregionBox.coarsen(AVGlobals::CRRBetweenLevels(newMinAllowableLevel, maxAllowableLevel, amrData.RefRatio())); Box subregionBoxMAL(subregionBox); // refine to the finestLevel subregionBox.refine(AVGlobals::CRRBetweenLevels(newMinAllowableLevel, finestLevel, amrData.RefRatio())); maxAllowableLevel = AVGlobals::DetermineMaxAllowableLevel(subregionBox, finestLevel, AVGlobals::MaxPictureSize(), amrData.RefRatio()); subregionBoxMAL.refine(AVGlobals::CRRBetweenLevels(newMinAllowableLevel, maxAllowableLevel, amrData.RefRatio())); IntVect ivOffset(subregionBoxMAL.smallEnd()); // get the old slices and check if they will be within the new subregion. // if not -- choose the limit // then pass the slices to the subregion constructor below... SubregionPltApp(wTopLevel, subregionBox, ivOffset, this, palFilename, animating2d, pltAppState->CurrentDerived(), fileName); #if (BL_SPACEDIM == 3) for(np = 0; np < NPLANES; ++np) { startcutX[np] *= currentScale; startcutY[np] *= currentScale; finishcutX[np] *= currentScale; finishcutY[np] *= currentScale; } #endif } // end DoSubregion // ------------------------------------------------------------------- void PltApp::DoDatasetButton(Widget, XtPointer, XtPointer) { if(selectionBox.bigEnd(XDIR) == 0 || selectionBox.bigEnd(YDIR) == 0) { return; } int hdir(-1), vdir(-1), sdir(-1); trueRegion = selectionBox; #if (BL_SPACEDIM == 3) trueRegion.setSmall(ZDIR, amrPicturePtrArray[ZPLANE]->GetSlice()); trueRegion.setBig(ZDIR, amrPicturePtrArray[ZPLANE]->GetSlice()); #endif hdir = (activeView == XPLANE) ? YDIR : XDIR; vdir = (activeView == ZPLANE) ? YDIR : ZDIR; switch (activeView) { case ZPLANE: // orient box to view and shift trueRegion.shift(XDIR, ivLowOffsetMAL[XDIR]); trueRegion.shift(YDIR, ivLowOffsetMAL[YDIR]); sdir = ZDIR; break; case YPLANE: trueRegion.setSmall(ZDIR, trueRegion.smallEnd(YDIR)); trueRegion.setBig(ZDIR, trueRegion.bigEnd(YDIR)); trueRegion.setSmall(YDIR, amrPicturePtrArray[YPLANE]->GetSlice()); trueRegion.setBig(YDIR, amrPicturePtrArray[YPLANE]->GetSlice()); trueRegion.shift(XDIR, ivLowOffsetMAL[XDIR]); trueRegion.shift(ZDIR, ivLowOffsetMAL[ZDIR]); sdir = YDIR; break; case XPLANE: trueRegion.setSmall(ZDIR, trueRegion.smallEnd(YDIR)); trueRegion.setBig(ZDIR, trueRegion.bigEnd(YDIR)); trueRegion.setSmall(YDIR, trueRegion.smallEnd(XDIR)); trueRegion.setBig(YDIR, trueRegion.bigEnd(XDIR)); trueRegion.setSmall(XDIR, amrPicturePtrArray[XPLANE]->GetSlice()); trueRegion.setBig(XDIR, amrPicturePtrArray[XPLANE]->GetSlice()); trueRegion.shift(YDIR, ivLowOffsetMAL[YDIR]); trueRegion.shift(ZDIR, ivLowOffsetMAL[ZDIR]); sdir = XDIR; } if(datasetShowing) { datasetPtr->DoRaise(); datasetPtr->DatasetRender(trueRegion, amrPicturePtrArray[activeView], this, pltAppState, hdir, vdir, sdir); datasetPtr->DoExpose(false); } else { datasetShowing = true; datasetPtr = new Dataset(trueRegion, amrPicturePtrArray[activeView], this, pltAppState, hdir, vdir, sdir); } } // end DoDatasetButton // ------------------------------------------------------------------- void PltApp::QuitDataset() { datasetShowing = false; delete datasetPtr; } // ------------------------------------------------------------------- void PltApp::DoPaletteButton(Widget, XtPointer, XtPointer) { static Widget wPalDialog; wPalDialog = XmCreateFileSelectionDialog(wAmrVisTopLevel, "Choose Palette", NULL, 0); AddStaticCallback(wPalDialog, XmNokCallback, &PltApp::DoOpenPalFile); XtAddCallback(wPalDialog, XmNcancelCallback, (XtCallbackProc) XtUnmanageChild, (XtPointer) this); XtManageChild(wPalDialog); XtPopup(XtParent(wPalDialog), XtGrabExclusive); } // ------------------------------------------------------------------- void PltApp::DestroyInfoWindow(Widget, XtPointer xp, XtPointer) { infoShowing = false; } // ------------------------------------------------------------------- void PltApp::CloseInfoWindow(Widget, XtPointer, XtPointer) { XtPopdown(wInfoTopLevel); infoShowing = false; } // ------------------------------------------------------------------- void PltApp::DoInfoButton(Widget, XtPointer, XtPointer) { if(infoShowing) { XtPopup(wInfoTopLevel, XtGrabNone); XMapRaised(XtDisplay(wInfoTopLevel), XtWindow(wInfoTopLevel)); return; } infoShowing = true; int xpos, ypos, width, height; XtVaGetValues(wAmrVisTopLevel, XmNx, &xpos, XmNy, &ypos, XmNwidth, &width, XmNheight, &height, NULL); wInfoTopLevel = XtVaCreatePopupShell("Info", topLevelShellWidgetClass, wAmrVisTopLevel, XmNwidth, 400, XmNheight, 300, XmNx, 50+xpos+width/2, XmNy, ypos-10, NULL); AddStaticCallback(wInfoTopLevel, XmNdestroyCallback, &PltApp::DestroyInfoWindow); //set visual in case the default isn't 256 pseudocolor if(gaPtr->PVisual() != XDefaultVisual(display, gaPtr->PScreenNumber())) { XtVaSetValues(wInfoTopLevel, XmNvisual, gaPtr->PVisual(), XmNdepth, 8, NULL); } Widget wInfoForm = XtVaCreateManagedWidget("infoform", xmFormWidgetClass, wInfoTopLevel, NULL); int i(0); XtSetArg(args[i], XmNlistSizePolicy, XmRESIZE_IF_POSSIBLE); ++i; Widget wInfoList = XmCreateScrolledList(wInfoForm, "infoscrolledlist", args, i); XtVaSetValues(XtParent(wInfoList), XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 80, NULL); AmrData &amrData = dataServicesPtr[currentFrame]->AmrDataRef(); int numEntries = 9+amrData.FinestLevel()+1; char **entries = new char *[numEntries]; for(int j(0); j < numEntries; ++j) { entries[j] = new char[BUFSIZ]; } i=0; char buf[BUFSIZ]; ostrstream prob(buf, BUFSIZ); prob.precision(15); strcpy(entries[i], fileNames[currentFrame].c_str()); ++i; strcpy(entries[i], amrData.PlotFileVersion().c_str()); ++i; prob << "time: "<< amrData.Time() << ends; strcpy(entries[i], buf); ++i; sprintf(entries[i], "levels: %d", amrData.FinestLevel()+1); ++i; sprintf(entries[i], "prob domain"); ++i; for(int k(0); k <= amrData.FinestLevel(); ++k, ++i) { ostrstream prob_domain(entries[i], BUFSIZ); prob_domain << " level " << k << ": " << amrData.ProbDomain()[k] << ends; } prob.seekp(0); prob << "refratios:"; for(int k(0); k < amrData.FinestLevel(); ++k) { prob << " " << amrData.RefRatio()[k]; } prob << ends; strcpy(entries[i], buf); ++i; prob.seekp(0); prob << "probsize:"; for(int k(0); k < BL_SPACEDIM; ++k) { prob << " " << amrData.ProbSize()[k]; } prob << ends; strcpy(entries[i], buf); ++i; prob.seekp(0); prob << "prob lo:"; for(int k(0); k < BL_SPACEDIM; ++k) { prob << " " << amrData.ProbLo()[k]; } prob << ends; strcpy(entries[i], buf); ++i; prob.seekp(0); prob << "prob hi:"; for(int k(0); k < BL_SPACEDIM; ++k) { prob<<" "<< amrData.ProbHi()[k]; } prob << ends; strcpy(entries[i], buf); ++i; XmStringTable str_list = (XmStringTable)XtMalloc(numEntries*sizeof(XmString *)); for(int j(0); j < numEntries; ++j) { str_list[j] = XmStringCreateSimple(entries[j]); } XtVaSetValues(wInfoList, XmNvisibleItemCount, numEntries, XmNitemCount, numEntries, XmNitems, str_list, NULL); for(int j(0); j < numEntries; ++j) { delete [] entries[j]; } delete [] entries; Widget wInfoCloseButton = XtVaCreateManagedWidget("Close", xmPushButtonGadgetClass, wInfoForm, XmNtopAttachment, XmATTACH_POSITION, XmNtopPosition, 85, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 95, XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, 75, XmNleftAttachment, XmATTACH_POSITION, XmNleftPosition, 25, NULL); AddStaticCallback(wInfoCloseButton, XmNactivateCallback, &PltApp::CloseInfoWindow); XtManageChild(wInfoList); XtManageChild(wInfoCloseButton); XtPopup(wInfoTopLevel, XtGrabNone); } // ------------------------------------------------------------------- void PltApp::DoContoursButton(Widget, XtPointer, XtPointer) { Position xpos, ypos; Dimension width, height; if(contoursShowing) { XtPopup(wContoursTopLevel, XtGrabNone); XMapRaised(XtDisplay(wContoursTopLevel), XtWindow(wContoursTopLevel)); return; } Widget wContoursForm, wCloseButton, wContourRadio, wid; XtVaGetValues(wAmrVisTopLevel, XmNx, &xpos, XmNy, &ypos, XmNwidth, &width, XmNheight, &height, NULL); wContoursTopLevel = XtVaCreatePopupShell("Set Contours", topLevelShellWidgetClass, wAmrVisTopLevel, XmNwidth, 170, XmNheight, 220, XmNx, xpos+width/2, XmNy, ypos+height/2, NULL); AddStaticCallback(wContoursTopLevel, XmNdestroyCallback, &PltApp::DestroyContoursWindow); //set visual in case the default isn't 256 pseudocolor if(gaPtr->PVisual() != XDefaultVisual(display, gaPtr->PScreenNumber())) { XtVaSetValues(wContoursTopLevel, XmNvisual, gaPtr->PVisual(), XmNdepth, 8,NULL); } wContoursForm = XtVaCreateManagedWidget("Contoursform", xmFormWidgetClass, wContoursTopLevel, NULL); wContourRadio = XmCreateRadioBox(wContoursForm, "contourtype", NULL, 0); XtVaSetValues(wContourRadio, XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); char *conItems[NCONTOPTIONS] = {"Raster", "Raster & Contours", "Color Contours", "B/W Contours", "Velocity Vectors"}; const AmrData &amrData = dataServicesPtr[currentFrame]->AmrDataRef(); int nItems = (amrData.NComp() < (BL_SPACEDIM + 1)) ? (NCONTOPTIONS - 1) : NCONTOPTIONS; for(int j(0); j < nItems; ++j) { wid = XtVaCreateManagedWidget(conItems[j], xmToggleButtonGadgetClass, wContourRadio, NULL); if(j == (int) pltAppState->GetContourType()) { XtVaSetValues(wid, XmNset, true, NULL); } AddStaticCallback(wid, XmNvalueChangedCallback, &PltApp::ChangeContour, (XtPointer) j); } XmString label_str = XmStringCreateSimple("Number of lines:"); wContourLabel = XtVaCreateManagedWidget("numcontours", xmLabelWidgetClass, wContoursForm, XmNlabelString, label_str, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wContourRadio, XmNtopOffset, WOFFSET, XmNsensitive, pltAppState->GetContourType() != RASTERONLY, NULL); XmStringFree(label_str); wNumberContours = XtVaCreateManagedWidget("contours", xmTextFieldWidgetClass, wContoursForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wContourRadio, XmNtopOffset, WOFFSET, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wContourLabel, XmNleftOffset, WOFFSET, XmNvalue, contourNumString.c_str(), XmNcolumns, 4, XmNsensitive, pltAppState->GetContourType() != RASTERONLY, NULL); AddStaticCallback(wNumberContours, XmNactivateCallback, &PltApp::ReadContourString); wCloseButton = XtVaCreateManagedWidget(" Close ", xmPushButtonGadgetClass, wContoursForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_POSITION, XmNleftPosition, 33, XmNrightAttachment, XmATTACH_POSITION, XmNrightPosition, 66, NULL); AddStaticCallback(wCloseButton, XmNactivateCallback, &PltApp::CloseContoursWindow); XtManageChild(wContourRadio); XtManageChild(wCloseButton); XtPopup(wContoursTopLevel, XtGrabNone); pltPaletteptr->SetWindowPalette(palFilename, XtWindow(wContoursTopLevel)); contoursShowing = true; } // ------------------------------------------------------------------- void PltApp::DestroyContoursWindow(Widget, XtPointer, XtPointer) { contoursShowing = false; } // ------------------------------------------------------------------- void PltApp::CloseContoursWindow(Widget, XtPointer, XtPointer) { XtPopdown(wContoursTopLevel); } // ------------------------------------------------------------------- void PltApp::DoToggleFileRangeButton(Widget w, XtPointer client_data, XtPointer call_data) { bFileRangeButtonSet = XmToggleButtonGetState(wFileRangeCheckBox); if(bFileRangeButtonSet) { if(currentRangeType == GLOBALMINMAX) { currentRangeType = FILEGLOBALMINMAX; } else if(currentRangeType == SUBREGIONMINMAX) { currentRangeType = FILESUBREGIONMINMAX; } else if(currentRangeType == USERMINMAX) { currentRangeType = FILEUSERMINMAX; } } else { if(currentRangeType == FILEGLOBALMINMAX) { currentRangeType = GLOBALMINMAX; } else if(currentRangeType == FILESUBREGIONMINMAX) { currentRangeType = SUBREGIONMINMAX; } else if(currentRangeType == FILEUSERMINMAX) { currentRangeType = USERMINMAX; } } } // ------------------------------------------------------------------- void PltApp::DoSetRangeButton(Widget, XtPointer, XtPointer) { Position xpos, ypos; Dimension width, height; if(setRangeShowing) { XtPopup(wSetRangeTopLevel, XtGrabNone); XMapRaised(XtDisplay(wSetRangeTopLevel), XtWindow(wSetRangeTopLevel)); return; } char range[LINELENGTH]; char saveRangeString[LINELENGTH]; char format[LINELENGTH]; char fMin[LINELENGTH]; char fMax[LINELENGTH]; strcpy(format, pltAppState->GetFormatString().c_str()); Widget wSetRangeForm, wDoneButton, wApplyButton, wCancelButton; Widget wSetRangeRadioBox, wRangeRC, wid; // do these here to set XmNwidth of wSetRangeTopLevel Real rtMin, rtMax; pltAppState->GetMinMax(GLOBALMINMAX, currentFrame, pltAppState->CurrentDerivedNumber(), rtMin, rtMax); sprintf(fMin, format, rtMin); sprintf(fMax, format, rtMax); sprintf(range, "Min: %s Max: %s", fMin, fMax); strcpy(saveRangeString, range); XtVaGetValues(wAmrVisTopLevel, XmNx, &xpos, XmNy, &ypos, XmNwidth, &width, XmNheight, &height, NULL); wSetRangeTopLevel = XtVaCreatePopupShell("Set Range", topLevelShellWidgetClass, wAmrVisTopLevel, XmNwidth, 250, XmNheight, 200, XmNx, xpos+width/2, XmNy, ypos, NULL); AddStaticCallback(wSetRangeTopLevel, XmNdestroyCallback, &PltApp::DestroySetRangeWindow); //set visual in case the default isn't 256 pseudocolor if(gaPtr->PVisual() != XDefaultVisual(display, gaPtr->PScreenNumber())) { XtVaSetValues(wSetRangeTopLevel, XmNvisual, gaPtr->PVisual(), XmNdepth, 8, NULL); } wSetRangeForm = XtVaCreateManagedWidget("setrangeform", xmFormWidgetClass, wSetRangeTopLevel, NULL); // make the buttons wDoneButton = XtVaCreateManagedWidget(" Ok ", xmPushButtonGadgetClass, wSetRangeForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); bool bKillSRWindow(true); AddStaticCallback(wDoneButton, XmNactivateCallback, &PltApp::DoDoneSetRange, (XtPointer) bKillSRWindow); wApplyButton = XtVaCreateManagedWidget(" Apply ", xmPushButtonGadgetClass, wSetRangeForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wDoneButton, XmNleftOffset, WOFFSET, NULL); bKillSRWindow = false; AddStaticCallback(wApplyButton, XmNactivateCallback, &PltApp::DoDoneSetRange, (XtPointer) bKillSRWindow); wCancelButton = XtVaCreateManagedWidget(" Cancel ", xmPushButtonGadgetClass, wSetRangeForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, NULL); AddStaticCallback(wCancelButton, XmNactivateCallback, &PltApp::DoCancelSetRange); // make the radio box wSetRangeRadioBox = XmCreateRadioBox(wSetRangeForm, "setrangeradiobox", NULL, 0); XtVaSetValues(wSetRangeRadioBox, XmNmarginHeight, 8, NULL); XtVaSetValues(wSetRangeRadioBox, XmNmarginWidth, 4, NULL); XtVaSetValues(wSetRangeRadioBox, XmNspacing, 14, NULL); wRangeRadioButton[BGLOBALMINMAX] = XtVaCreateManagedWidget("Global", xmToggleButtonWidgetClass, wSetRangeRadioBox, NULL); AddStaticCallback(wRangeRadioButton[BGLOBALMINMAX], XmNvalueChangedCallback, &PltApp::ToggleRange, (XtPointer) BGLOBALMINMAX); wRangeRadioButton[BSUBREGIONMINMAX] = XtVaCreateManagedWidget("Local", xmToggleButtonWidgetClass, wSetRangeRadioBox, NULL); AddStaticCallback(wRangeRadioButton[BSUBREGIONMINMAX], XmNvalueChangedCallback, &PltApp::ToggleRange, (XtPointer) BSUBREGIONMINMAX); wRangeRadioButton[BUSERMINMAX] = XtVaCreateManagedWidget("User", xmToggleButtonWidgetClass, wSetRangeRadioBox, NULL); AddStaticCallback(wRangeRadioButton[BUSERMINMAX], XmNvalueChangedCallback, &PltApp::ToggleRange, (XtPointer) BUSERMINMAX); if(animating2d) { int i(0); XtSetArg(args[i], XmNleftAttachment, XmATTACH_FORM); ++i; XtSetArg(args[i], XmNleftOffset, WOFFSET); ++i; XtSetArg(args[i], XmNtopAttachment, XmATTACH_WIDGET); ++i; XtSetArg(args[i], XmNtopWidget, wSetRangeRadioBox); ++i; XtSetArg(args[i], XmNtopOffset, WOFFSET); ++i; XtSetArg(args[i], XmNset, bFileRangeButtonSet); ++i; wFileRangeCheckBox = XmCreateToggleButton(wSetRangeForm, "File_Range", args, i); AddStaticCallback(wFileRangeCheckBox, XmNvalueChangedCallback, &PltApp::DoToggleFileRangeButton, NULL); } currentRangeType = pltAppState->GetMinMaxRangeType(); MinMaxRangeTypeForButtons mmButton(BINVALIDMINMAX); if(currentRangeType == GLOBALMINMAX || currentRangeType == FILEGLOBALMINMAX) { mmButton = BGLOBALMINMAX; } else if(currentRangeType == SUBREGIONMINMAX || currentRangeType == FILESUBREGIONMINMAX) { mmButton = BSUBREGIONMINMAX; } else if(currentRangeType == USERMINMAX || currentRangeType == FILEUSERMINMAX) { mmButton = BUSERMINMAX; } else { BoxLib::Abort("Bad button range type."); } XtVaSetValues(wRangeRadioButton[mmButton], XmNset, true, NULL); wRangeRC = XtVaCreateManagedWidget("rangeRC", xmRowColumnWidgetClass, wSetRangeForm, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 0, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wSetRangeRadioBox, XmNrightAttachment, XmATTACH_FORM, XmNpacking, XmPACK_COLUMN, XmNnumColumns, 3, XmNorientation, XmHORIZONTAL, NULL); // make the strings representing data min and maxes pltAppState->GetMinMax(GLOBALMINMAX, currentFrame, pltAppState->CurrentDerivedNumber(), rtMin, rtMax); sprintf(fMin, format, rtMin); sprintf(fMax, format, rtMax); sprintf(range, "Min: %s", fMin); XtVaCreateManagedWidget(range, xmLabelGadgetClass, wRangeRC, NULL); //XtVaSetValues(wid, XmNleftOffset, 20, NULL); sprintf(range, "Max: %s", fMax); XtVaCreateManagedWidget(range, xmLabelGadgetClass, wRangeRC, NULL); pltAppState->GetMinMax(SUBREGIONMINMAX, currentFrame, pltAppState->CurrentDerivedNumber(), rtMin, rtMax); sprintf(fMin, format, rtMin); sprintf(fMax, format, rtMax); sprintf(range, "Min: %s", fMin); XtVaCreateManagedWidget(range, xmLabelGadgetClass, wRangeRC, NULL); sprintf(range, "Max: %s", fMax); XtVaCreateManagedWidget(range, xmLabelGadgetClass, wRangeRC, NULL); pltAppState->GetMinMax(USERMINMAX, currentFrame, pltAppState->CurrentDerivedNumber(), rtMin, rtMax); wid = XtVaCreateManagedWidget("wid", xmRowColumnWidgetClass, wRangeRC, XmNorientation, XmHORIZONTAL, XmNleftOffset, 0, //XmNborderWidth, 0, NULL); XtVaCreateManagedWidget("Min:", xmLabelGadgetClass, wid, NULL); //XtVaSetValues(wid, XmNmarginWidth, 0, NULL); sprintf(range, format, rtMin); wUserMin = XtVaCreateManagedWidget("local range", xmTextFieldWidgetClass, wid, XmNvalue, range, XmNeditable, true, XmNcolumns, strlen(range)+2, NULL); AddStaticCallback(wUserMin, XmNactivateCallback, &PltApp::DoUserMin); wid = XtVaCreateManagedWidget("wid", xmRowColumnWidgetClass, wRangeRC, XmNorientation, XmHORIZONTAL, XmNleftOffset, 0, //XmNborderWidth, 0, NULL); XtVaCreateManagedWidget("Max:", xmLabelGadgetClass, wid, NULL); sprintf(range, format, rtMax); wUserMax = XtVaCreateManagedWidget("local range", xmTextFieldWidgetClass, wid, XmNvalue, range, XmNeditable, true, XmNcolumns, strlen(range)+2, NULL); AddStaticCallback(wUserMax, XmNactivateCallback, &PltApp::DoUserMax); XtManageChild(wSetRangeRadioBox); XtManageChild(wRangeRC); XtManageChild(wDoneButton); XtManageChild(wApplyButton); XtManageChild(wCancelButton); if(animating2d) { XtManageChild(wFileRangeCheckBox); } XtPopup(wSetRangeTopLevel, XtGrabNone); pltPaletteptr->SetWindowPalette(palFilename, XtWindow(wSetRangeTopLevel)); setRangeShowing = true; int isrw, iwidw, itotalwidth, maxwidth(600); XtVaGetValues(wSetRangeRadioBox, XmNwidth, &isrw, NULL); XtVaGetValues(wid, XmNwidth, &iwidw, NULL); //cout << "============ _here 00:" << endl; //cout << "iw.. = " << isrw + (2 * iwidw) + 10 << endl; //cout << "isrw = " << isrw << " iwidw = " << iwidw << endl; itotalwidth = min(isrw + (2 * iwidw) + 10, maxwidth); XtVaSetValues(wSetRangeTopLevel, XmNwidth, itotalwidth, NULL); } // ------------------------------------------------------------------- void PltApp::SetNewFormatString(const string &newformatstring) { pltAppState->SetFormatString(newformatstring); pltPaletteptr->SetFormat(newformatstring); pltPaletteptr->Redraw(); if(datasetShowing) { int hdir(-1), vdir(-1), sdir(-1); if(activeView == ZPLANE) { hdir = XDIR; vdir = YDIR; sdir = ZDIR; } if(activeView == YPLANE) { hdir = XDIR; vdir = ZDIR; sdir = YDIR; } if(activeView == XPLANE) { hdir = YDIR; vdir = ZDIR; sdir = XDIR; } datasetPtr->DatasetRender(trueRegion, amrPicturePtrArray[activeView], this, pltAppState, hdir, vdir, sdir); datasetPtr->DoExpose(false); } if(setRangeShowing) { bSetRangeRedraw = true; XtDestroyWidget(wSetRangeTopLevel); setRangeShowing = false; DoSetRangeButton(NULL, NULL, NULL); setRangeShowing = true; } } // ------------------------------------------------------------------- void PltApp::DoNumberFormatButton(Widget, XtPointer, XtPointer) { Position xpos, ypos; Dimension width, height; if(bFormatShowing) { XtPopup(wNumberFormatTopLevel, XtGrabNone); XMapRaised(XtDisplay(wNumberFormatTopLevel), XtWindow(wNumberFormatTopLevel)); return; } char format[LINELENGTH]; strcpy(format, pltAppState->GetFormatString().c_str()); Widget wNumberFormatForm, wDoneButton, wApplyButton, wCancelButton, wid; XtVaGetValues(wAmrVisTopLevel, XmNx, &xpos, XmNy, &ypos, XmNwidth, &width, XmNheight, &height, NULL); wNumberFormatTopLevel = XtVaCreatePopupShell("Number Format", topLevelShellWidgetClass, wAmrVisTopLevel, XmNwidth, 200, XmNheight, 100, XmNx, xpos+width/2, XmNy, ypos, NULL); AddStaticCallback(wNumberFormatTopLevel, XmNdestroyCallback, &PltApp::DestroyNumberFormatWindow); //set visual in case the default isn't 256 pseudocolor if(gaPtr->PVisual() != XDefaultVisual(display, gaPtr->PScreenNumber())) { XtVaSetValues(wNumberFormatTopLevel, XmNvisual, gaPtr->PVisual(), XmNdepth, 8, NULL); } wNumberFormatForm = XtVaCreateManagedWidget("setrangeform", xmFormWidgetClass, wNumberFormatTopLevel, NULL); // make the buttons wDoneButton = XtVaCreateManagedWidget(" Ok ", xmPushButtonGadgetClass, wNumberFormatForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); bool bKillNFWindow(true); AddStaticCallback(wDoneButton, XmNactivateCallback, &PltApp::DoDoneNumberFormat, (XtPointer) bKillNFWindow); wApplyButton = XtVaCreateManagedWidget(" Apply ", xmPushButtonGadgetClass, wNumberFormatForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wDoneButton, XmNleftOffset, WOFFSET, NULL); bKillNFWindow = false; AddStaticCallback(wApplyButton, XmNactivateCallback, &PltApp::DoDoneNumberFormat, (XtPointer) bKillNFWindow); wCancelButton = XtVaCreateManagedWidget(" Cancel ", xmPushButtonGadgetClass, wNumberFormatForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, NULL); AddStaticCallback(wCancelButton, XmNactivateCallback, &PltApp::DoCancelNumberFormat); wid = XtVaCreateManagedWidget("Format:", xmLabelGadgetClass, wNumberFormatForm, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); wFormat = XtVaCreateManagedWidget("format", xmTextFieldWidgetClass, wNumberFormatForm, XmNvalue, format, XmNeditable, true, XmNcolumns, strlen(format) + 4, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wid, XmNleftOffset, WOFFSET, NULL); AddStaticCallback(wFormat, XmNactivateCallback, &PltApp::DoDoneNumberFormat, (XtPointer) bKillNFWindow); XtManageChild(wDoneButton); XtManageChild(wApplyButton); XtManageChild(wCancelButton); XtPopup(wNumberFormatTopLevel, XtGrabNone); pltPaletteptr->SetWindowPalette(palFilename, XtWindow(wNumberFormatTopLevel)); bFormatShowing = true; } // ------------------------------------------------------------------- void PltApp::DoDoneNumberFormat(Widget, XtPointer client_data, XtPointer) { bool bKillNFWindow = (bool) client_data; paletteDrawn = false; string tempFormatString; char temp[64]; strcpy(temp, XmTextFieldGetString(wFormat)); if(temp[0] != '%') { tempFormatString = "%"; tempFormatString += temp; } else { tempFormatString = temp; } // unexhaustive string check to prevent errors bool stringOk(true); for(int i(0); i < tempFormatString.length(); ++i) { if(tempFormatString[i] == 's' || tempFormatString[i] == 'u' || tempFormatString[i] == 'p') { stringOk = false; } } if(stringOk) { SetNewFormatString(tempFormatString); } else { cerr << "Error in format string." << endl; } if(bKillNFWindow) { XtDestroyWidget(wNumberFormatTopLevel); } } // ------------------------------------------------------------------- void PltApp::DoCancelNumberFormat(Widget, XtPointer, XtPointer) { XtDestroyWidget(wNumberFormatTopLevel); } // ------------------------------------------------------------------- void PltApp::DestroyNumberFormatWindow(Widget, XtPointer, XtPointer) { bFormatShowing = false; } // ------------------------------------------------------------------- void PltApp::DoDoneSetRange(Widget, XtPointer client_data, XtPointer) { bool bKillSRWindow = (bool) client_data; paletteDrawn = false; int np; Real umin(atof(XmTextFieldGetString(wUserMin))); Real umax(atof(XmTextFieldGetString(wUserMax))); for(int iFrame(0); iFrame < animFrames; ++iFrame) { pltAppState->SetMinMax(USERMINMAX, iFrame, pltAppState->CurrentDerivedNumber(), umin, umax); } if(currentRangeType != pltAppState->GetMinMaxRangeType() || currentRangeType == USERMINMAX || currentRangeType == FILEUSERMINMAX) { pltAppState->SetMinMaxRangeType(currentRangeType); for(np = 0; np < NPLANES; ++np) { amrPicturePtrArray[np]->APMakeImages(pltPaletteptr); } #if (BL_SPACEDIM == 3) //Clear(); #endif if(animating2d) { ResetAnimation(); DirtyFrames(); ShowFrame(); } #if (BL_SPACEDIM == 3) #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) projPicturePtr->GetVolRenderPtr()->InvalidateSWFData(); projPicturePtr->GetVolRenderPtr()->InvalidateVPData(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); if(XmToggleButtonGetState(wAutoDraw) || showing3dRender) { DoRender(); } #endif #endif } if(bKillSRWindow) { XtDestroyWidget(wSetRangeTopLevel); } if(datasetShowing) { datasetPtr->DoRaise(); int hdir(-1), vdir(-1), sdir(-1); if(activeView==ZPLANE) { hdir = XDIR; vdir = YDIR; sdir = ZDIR; } if(activeView==YPLANE) { hdir = XDIR; vdir = ZDIR; sdir = YDIR; } if(activeView==XPLANE) { hdir = YDIR; vdir = ZDIR; sdir = XDIR; } datasetPtr->DatasetRender(trueRegion, amrPicturePtrArray[activeView], this, pltAppState, hdir, vdir, sdir); datasetPtr->DoExpose(false); } } // ------------------------------------------------------------------- void PltApp::DoCancelSetRange(Widget, XtPointer, XtPointer) { XtDestroyWidget(wSetRangeTopLevel); setRangeShowing = false; } // ------------------------------------------------------------------- void PltApp::DestroySetRangeWindow(Widget, XtPointer, XtPointer) { if(bSetRangeRedraw == false) { setRangeShowing = false; } bSetRangeRedraw = false; } // ------------------------------------------------------------------- void PltApp::DoUserMin(Widget, XtPointer, XtPointer) { if(currentRangeType == GLOBALMINMAX || currentRangeType == FILEGLOBALMINMAX) { XtVaSetValues(wRangeRadioButton[BGLOBALMINMAX], XmNset, false, NULL); } if(currentRangeType == SUBREGIONMINMAX || currentRangeType == FILESUBREGIONMINMAX) { XtVaSetValues(wRangeRadioButton[BSUBREGIONMINMAX], XmNset, false, NULL); } XtVaSetValues(wRangeRadioButton[BUSERMINMAX], XmNset, true, NULL); if(bFileRangeButtonSet) { currentRangeType = FILEUSERMINMAX; } else { currentRangeType = USERMINMAX; } bool bKillSRWindow(true); DoDoneSetRange(NULL, (XtPointer) bKillSRWindow, NULL); } // ------------------------------------------------------------------- void PltApp::DoUserMax(Widget, XtPointer, XtPointer) { if(currentRangeType == GLOBALMINMAX || currentRangeType == FILEGLOBALMINMAX) { XtVaSetValues(wRangeRadioButton[BGLOBALMINMAX], XmNset, false, NULL); } if(currentRangeType == SUBREGIONMINMAX || currentRangeType == FILESUBREGIONMINMAX) { XtVaSetValues(wRangeRadioButton[BSUBREGIONMINMAX], XmNset, false, NULL); } XtVaSetValues(wRangeRadioButton[BUSERMINMAX], XmNset, true, NULL); if(bFileRangeButtonSet) { currentRangeType = FILEUSERMINMAX; } else { currentRangeType = USERMINMAX; } bool bKillSRWindow(true); DoDoneSetRange(NULL, (XtPointer) bKillSRWindow, NULL); } // ------------------------------------------------------------------- void PltApp::DoBoxesButton(Widget, XtPointer, XtPointer) { if(animating2d) { ResetAnimation(); DirtyFrames(); } pltAppState->SetShowingBoxes( ! pltAppState->GetShowingBoxes()); for(int np(0); np < NPLANES; ++np) { amrPicturePtrArray[np]->DoExposePicture(); } #if (BL_SPACEDIM == 3) projPicturePtr->MakeBoxes(); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) if( ! XmToggleButtonGetState(wAutoDraw)) { XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); DoExposeTransDA(); } #else XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); DoExposeTransDA(); #endif #endif // draw a bounding box around the image /* int imageSizeX = amrPicturePtrArray[ZPLANE]->ImageSizeH(); int imageSizeY = amrPicturePtrArray[ZPLANE]->ImageSizeV(); XSetForeground(display, xgc, pltPaletteptr->WhiteIndex()); XDrawLine(display, XtWindow(wPlotPlane[ZPLANE]), xgc, 0, imageSizeY, imageSizeX, imageSizeY); XDrawLine(display, XtWindow(wPlotPlane[ZPLANE]), xgc, imageSizeX, 0, imageSizeX, imageSizeY); */ } // ------------------------------------------------------------------- void PltApp::DoOpenPalFile(Widget w, XtPointer, XtPointer call_data) { char *palfile; if( ! XmStringGetLtoR(((XmFileSelectionBoxCallbackStruct *) call_data)->value, XmSTRING_DEFAULT_CHARSET, &palfile)) { cerr << "PltApp::DoOpenPalFile : system error" << endl; return; } XtPopdown(XtParent(w)); pltPaletteptr->ChangeWindowPalette(palfile, XtWindow(wAmrVisTopLevel)); # ifdef BL_VOLUMERENDER projPicturePtr->GetVolRenderPtr()->SetTransferProperties(); projPicturePtr->GetVolRenderPtr()->InvalidateVPData(); showing3dRender = false; if(XmToggleButtonGetState(wAutoDraw)) { DoRender(wAutoDraw, NULL, NULL); } # endif palFilename = palfile; XtFree(palfile); XYplotparameters->ResetPalette(pltPaletteptr); for(int np(0); np != BL_SPACEDIM; ++np) { if(XYplotwin[np]) { XYplotwin[np]->SetPalette(); } } } // ------------------------------------------------------------------- XYPlotDataList *PltApp::CreateLinePlot(int V, int sdir, int mal, int ix, const string *derived) { const AmrData &amrData(dataServicesPtr[currentFrame]->AmrDataRef()); // Create an array of boxes corresponding to the intersected line. int tdir(-1), dir1(-1); #if (BL_SPACEDIM == 3) int dir2(-1); #endif switch (V) { case ZPLANE: tdir = (sdir == XDIR) ? YDIR : XDIR; dir1 = tdir; #if (BL_SPACEDIM == 3) dir2 = ZDIR; break; case YPLANE: if(sdir == XDIR) { tdir = ZDIR; dir1 = YDIR; dir2 = ZDIR; } else { tdir = XDIR; dir1 = XDIR; dir2 = YDIR; } break; case XPLANE: dir1 = XDIR; if(sdir == YDIR) { tdir = ZDIR; } else { tdir = YDIR; } dir1 = XDIR; dir2 = tdir; break; #endif } Array trueRegion(mal + 1); trueRegion[mal] = amrPicturePtrArray[V]->GetSliceBox(mal); trueRegion[mal].setSmall(tdir, ivLowOffsetMAL[tdir] + ix); trueRegion[mal].setBig(tdir, trueRegion[mal].smallEnd(tdir)); int lev; for(lev = mal - 1; lev >= 0; --lev) { trueRegion[lev] = trueRegion[mal]; trueRegion[lev].coarsen(AVGlobals::CRRBetweenLevels(lev, mal, amrData.RefRatio())); } // Create an array of titles corresponding to the intersected line. Array XdX(mal + 1); Array intersectStr(mal + 1); #if (BL_SPACEDIM == 3) char buffer[128]; sprintf(buffer, "%s%s %s%s", (dir1 == XDIR) ? "X=" : "Y=", pltAppState->GetFormatString().c_str(), (dir2 == YDIR) ? "Y=" : "Z=", pltAppState->GetFormatString().c_str()); #endif for(lev = 0; lev <= mal; ++lev) { XdX[lev] = amrData.DxLevel()[lev][sdir]; intersectStr[lev] = new char[128]; #if (BL_SPACEDIM == 2) sprintf(intersectStr[lev], ((dir1 == XDIR) ? "X=" : "Y=")); sprintf(intersectStr[lev]+2, pltAppState->GetFormatString().c_str(), gridOffset[dir1] + (0.5 + trueRegion[lev].smallEnd(dir1))*amrData.DxLevel()[lev][dir1]); #elif (BL_SPACEDIM == 3) sprintf(intersectStr[lev], buffer, amrData.DxLevel()[lev][dir1] * (0.5 + trueRegion[lev].smallEnd(dir1)) + gridOffset[dir1], amrData.DxLevel()[lev][dir2] * (0.5 + trueRegion[lev].smallEnd(dir2)) + gridOffset[dir2]); #endif } XYPlotDataList *newlist = new XYPlotDataList(*derived, mal, ix, amrData.RefRatio(), XdX, intersectStr, gridOffset[sdir]); bool lineOK; DataServices::Dispatch(DataServices::LineValuesRequest, dataServicesPtr[currentFrame], mal + 1, (void *) (trueRegion.dataPtr()), sdir, (void *) derived, pltAppState->MinAllowableLevel(), mal, (void *) newlist, &lineOK); if(lineOK) { return newlist; } delete newlist; return NULL; } // ------------------------------------------------------------------- void PltApp::DoRubberBanding(Widget, XtPointer client_data, XtPointer call_data) { XmDrawingAreaCallbackStruct *cbs = (XmDrawingAreaCallbackStruct *) call_data; if(cbs->event->xany.type != ButtonPress) { return; } int scale(pltAppState->CurrentScale()); int V((unsigned long) client_data); int imageHeight(amrPicturePtrArray[V]->ImageSizeV() - 1); int imageWidth(amrPicturePtrArray[V]->ImageSizeH() - 1); int oldX(max(0, min(imageWidth, cbs->event->xbutton.x))); int oldY(max(0, min(imageHeight, cbs->event->xbutton.y))); int mal(pltAppState->MaxAllowableLevel()); int minDrawnLevel(pltAppState->MinDrawnLevel()); int maxDrawnLevel(pltAppState->MaxDrawnLevel()); const AmrData &amrData(dataServicesPtr[currentFrame]->AmrDataRef()); int rootX, rootY; unsigned int inputMask; Window whichRoot, whichChild; #if (BL_SPACEDIM == 3) int x1, y1, z1, x2, y2, z2, rStartPlane; for(int np = 0; np != BL_SPACEDIM; ++np) { amrPicturePtrArray[np]->DoStop(); } #endif servingButton = cbs->event->xbutton.button; if(animating2d) { ResetAnimation(); } XSetForeground(display, rbgc, 120); XChangeActivePointerGrab(display, PointerMotionHintMask | ButtonMotionMask | ButtonReleaseMask | OwnerGrabButtonMask, cursor, CurrentTime); AVXGrab avxGrab(display); if(servingButton == 1) { int rectDrawn(false); int anchorX(oldX); int anchorY(oldY); int newX, newY; while(true) { XNextEvent(display, &nextEvent); switch(nextEvent.type) { case MotionNotify: if(rectDrawn) { // undraw the old rectangle(s) rWidth = abs(oldX-anchorX); rHeight = abs(oldY-anchorY); rStartX = (anchorX < oldX) ? anchorX : oldX; rStartY = (anchorY < oldY) ? anchorY : oldY; XDrawRectangle(display, amrPicturePtrArray[V]->PictureWindow(), rbgc, rStartX, rStartY, rWidth, rHeight); #if (BL_SPACEDIM == 3) // 3D sub domain selecting switch (V) { case ZPLANE: XDrawRectangle(display, amrPicturePtrArray[YPLANE]->PictureWindow(), rbgc, rStartX, startcutY[YPLANE], rWidth, abs(finishcutY[YPLANE]-startcutY[YPLANE])); rStartPlane = (anchorY < oldY) ? oldY : anchorY; XDrawRectangle(display, amrPicturePtrArray[XPLANE]->PictureWindow(), rbgc, imageHeight-rStartPlane, startcutY[XPLANE], rHeight, abs(finishcutY[XPLANE]-startcutY[XPLANE])); break; case YPLANE: XDrawRectangle(display, amrPicturePtrArray[ZPLANE]->PictureWindow(), rbgc, rStartX, startcutY[ZPLANE], rWidth, abs(finishcutY[ZPLANE]-startcutY[ZPLANE])); XDrawRectangle(display, amrPicturePtrArray[XPLANE]->PictureWindow(), rbgc, startcutX[XPLANE], rStartY, abs(finishcutX[XPLANE]-startcutX[XPLANE]), rHeight); break; default: // XPLANE rStartPlane = (anchorX < oldX) ? oldX : anchorX; XDrawRectangle(display, amrPicturePtrArray[ZPLANE]->PictureWindow(), rbgc, startcutX[ZPLANE], imageWidth-rStartPlane, abs(finishcutX[ZPLANE]-startcutX[ZPLANE]), rWidth); XDrawRectangle(display, amrPicturePtrArray[YPLANE]->PictureWindow(), rbgc, startcutX[YPLANE], rStartY, abs(finishcutX[YPLANE]-startcutX[YPLANE]), rHeight); } #endif } DoDrawPointerLocation(None, (XtPointer) V, &nextEvent); while(XCheckTypedEvent(display, MotionNotify, &nextEvent)) { ; // do nothing } XQueryPointer(display, amrPicturePtrArray[V]->PictureWindow(), &whichRoot, &whichChild, &rootX, &rootY, &newX, &newY, &inputMask); newX = max(0, min(imageWidth, newX)); newY = max(0, min(imageHeight, newY)); rWidth = abs(newX-anchorX); // draw the new rectangle rHeight = abs(newY-anchorY); rStartX = (anchorX < newX) ? anchorX : newX; rStartY = (anchorY < newY) ? anchorY : newY; XDrawRectangle(display, amrPicturePtrArray[V]->PictureWindow(), rbgc, rStartX, rStartY, rWidth, rHeight); rectDrawn = true; oldX = newX; oldY = newY; #if (BL_SPACEDIM == 3) // 3D sub domain selecting startcutX[V] = rStartX; startcutY[V] = rStartY; finishcutX[V] = rStartX + rWidth; finishcutY[V] = rStartY + rHeight; switch (V) { case ZPLANE: startcutX[YPLANE] = startcutX[V]; finishcutX[YPLANE] = finishcutX[V]; startcutX[XPLANE] = imageHeight - startcutY[V]; finishcutX[XPLANE] = imageHeight - finishcutY[V]; // draw in other planes XDrawRectangle(display, amrPicturePtrArray[YPLANE]->PictureWindow(), rbgc, rStartX, startcutY[YPLANE], rWidth, abs(finishcutY[YPLANE]-startcutY[YPLANE])); rStartPlane = (anchorY < newY) ? newY : anchorY; XDrawRectangle(display, amrPicturePtrArray[XPLANE]->PictureWindow(), rbgc, imageHeight-rStartPlane, startcutY[XPLANE], rHeight, abs(finishcutY[XPLANE]-startcutY[XPLANE])); break; case YPLANE: startcutX[ZPLANE] = startcutX[V]; finishcutX[ZPLANE] = finishcutX[V]; startcutY[XPLANE] = startcutY[V]; finishcutY[XPLANE] = finishcutY[V]; XDrawRectangle(display, amrPicturePtrArray[ZPLANE]->PictureWindow(), rbgc, rStartX, startcutY[ZPLANE], rWidth, abs(finishcutY[ZPLANE]-startcutY[ZPLANE])); XDrawRectangle(display, amrPicturePtrArray[XPLANE]->PictureWindow(), rbgc, startcutX[XPLANE], rStartY, abs(finishcutX[XPLANE]-startcutX[XPLANE]), rHeight); break; default: // XPLANE startcutY[YPLANE] = startcutY[V]; finishcutY[YPLANE] = finishcutY[V]; startcutY[ZPLANE] = imageWidth - startcutX[V]; finishcutY[ZPLANE] = imageWidth - finishcutX[V]; rStartPlane = (anchorX < newX) ? newX : anchorX; XDrawRectangle(display, amrPicturePtrArray[ZPLANE]->PictureWindow(), rbgc, startcutX[ZPLANE], imageWidth-rStartPlane, abs(finishcutX[ZPLANE]-startcutX[ZPLANE]), rWidth); XDrawRectangle(display, amrPicturePtrArray[YPLANE]->PictureWindow(), rbgc, startcutX[YPLANE], rStartY, abs(finishcutX[YPLANE]-startcutX[YPLANE]), rHeight); } #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) if( ! XmToggleButtonGetState(wAutoDraw)) #endif { x1 = startcutX[ZPLANE]/scale + ivLowOffsetMAL[XDIR]; y1 = startcutX[XPLANE]/scale + ivLowOffsetMAL[YDIR]; z1 = (amrPicturePtrArray[YPLANE]->ImageSizeV()-1 - startcutY[YPLANE])/scale + ivLowOffsetMAL[ZDIR]; x2 = finishcutX[ZPLANE]/scale + ivLowOffsetMAL[XDIR]; y2 = finishcutX[XPLANE]/scale + ivLowOffsetMAL[YDIR]; z2 = (amrPicturePtrArray[YPLANE]->ImageSizeV()-1 - finishcutY[YPLANE])/scale + ivLowOffsetMAL[ZDIR]; if(z2 > 65536) { // fix bad -z values z2 = amrPicturePtrArray[ZPLANE]->GetSubDomain()[mal].smallEnd(ZDIR); } IntVect ivmin(min(x1,x2), min(y1,y2), min(z1,z2)); IntVect ivmax(max(x1,x2), max(y1,y2), max(z1,z2)); Box xyz12(ivmin, ivmax); xyz12 &= amrPicturePtrArray[ZPLANE]->GetSubDomain()[mal]; projPicturePtr->SetSubCut(xyz12); //projPicturePtr->MakeBoxes(); XClearWindow(display, XtWindow(wTransDA)); DoExposeTransDA(); } #endif break; case ButtonRelease: { avxGrab.ExplicitUngrab(); startX = (max(0, min(imageWidth, anchorX))) / scale; startY = (max(0, min(imageHeight, anchorY))) / scale; endX = (max(0, min(imageWidth, nextEvent.xbutton.x))) / scale; endY = (max(0, min(imageHeight, nextEvent.xbutton.y))) / scale; // make "aligned" box with correct size, converted to AMR space. selectionBox.setSmall(XDIR, min(startX, endX)); selectionBox.setSmall(YDIR, ((imageHeight + 1) / scale) - max(startY, endY) - 1); selectionBox.setBig(XDIR, max(startX, endX)); selectionBox.setBig(YDIR, ((imageHeight + 1) / scale) - min(startY, endY) - 1); // selectionBox is now at the maxAllowableLevel because // it is defined on the pixmap ( / scale) if(anchorX == nextEvent.xbutton.x && anchorY == nextEvent.xbutton.y) { // data at click int y, intersectedLevel(-1); Box intersectedGrid; Array trueRegion(mal+1); int plane(amrPicturePtrArray[V]->GetSlice()); trueRegion[mal] = selectionBox; // convert to point box trueRegion[mal].setBig(XDIR, trueRegion[mal].smallEnd(XDIR)); trueRegion[mal].setBig(YDIR, trueRegion[mal].smallEnd(YDIR)); if(V == ZPLANE) { trueRegion[mal].shift(XDIR, ivLowOffsetMAL[XDIR]); trueRegion[mal].shift(YDIR, ivLowOffsetMAL[YDIR]); if(BL_SPACEDIM == 3) { trueRegion[mal].setSmall(ZDIR, plane); trueRegion[mal].setBig(ZDIR, plane); } } if(V == YPLANE) { trueRegion[mal].setSmall(ZDIR, trueRegion[mal].smallEnd(YDIR)); trueRegion[mal].setBig(ZDIR, trueRegion[mal].bigEnd(YDIR)); trueRegion[mal].setSmall(YDIR, plane); trueRegion[mal].setBig(YDIR, plane); trueRegion[mal].shift(XDIR, ivLowOffsetMAL[XDIR]); trueRegion[mal].shift(ZDIR, ivLowOffsetMAL[ZDIR]); } if(V == XPLANE) { trueRegion[mal].setSmall(ZDIR, trueRegion[mal].smallEnd(YDIR)); trueRegion[mal].setBig(ZDIR, trueRegion[mal].bigEnd(YDIR)); trueRegion[mal].setSmall(YDIR, trueRegion[mal].smallEnd(XDIR)); trueRegion[mal].setBig(YDIR, trueRegion[mal].bigEnd(XDIR)); trueRegion[mal].setSmall(XDIR, plane); trueRegion[mal].setBig(XDIR, plane); trueRegion[mal].shift(YDIR, ivLowOffsetMAL[YDIR]); trueRegion[mal].shift(ZDIR, ivLowOffsetMAL[ZDIR]); } for(y = mal - 1; y >= 0; --y) { trueRegion[y] = trueRegion[mal]; trueRegion[y].coarsen(AVGlobals::CRRBetweenLevels(y, mal, amrData.RefRatio())); trueRegion[y].setBig(XDIR, trueRegion[y].smallEnd(XDIR)); trueRegion[y].setBig(YDIR, trueRegion[y].smallEnd(YDIR)); } bool goodIntersect; Real dataValue; DataServices::Dispatch(DataServices::PointValueRequest, dataServicesPtr[currentFrame], trueRegion.size(), (void *) (trueRegion.dataPtr()), (void *) &pltAppState->CurrentDerived(), minDrawnLevel, maxDrawnLevel, &intersectedLevel, &intersectedGrid, &dataValue, &goodIntersect); char dataValueCharString[LINELENGTH]; sprintf(dataValueCharString, pltAppState->GetFormatString().c_str(), dataValue); string dataValueString(dataValueCharString); const string vfDerived("vfrac"); if(amrData.CartGrid() && pltAppState->CurrentDerived() != vfDerived) { DataServices::Dispatch(DataServices::PointValueRequest, dataServicesPtr[currentFrame], trueRegion.size(), (void *) (trueRegion.dataPtr()), (void *) &vfDerived, minDrawnLevel, maxDrawnLevel, &intersectedLevel, &intersectedGrid, &dataValue, &goodIntersect); Real vfeps(amrData.VfEps(intersectedLevel)); if(dataValue < vfeps) { dataValueString = "body"; } } ostrstream buffout(buffer, BUFSIZ); if(goodIntersect) { buffout << '\n'; buffout << "level = " << intersectedLevel << '\n'; buffout << "point = " << trueRegion[intersectedLevel].smallEnd() << '\n'; buffout << "grid = " << intersectedGrid << '\n'; buffout << "loc = ("; for(int idx = 0; idx != BL_SPACEDIM; ++idx) { if(idx != 0) { buffout << ", "; } buffout << gridOffset[idx] + (0.5 + trueRegion[intersectedLevel].smallEnd()[idx]) * amrData.DxLevel()[intersectedLevel][idx]; } buffout << ")\n"; buffout << "value = " << dataValueString << '\n'; } else buffout << "Bad point at mouse click" << '\n'; buffout << ends; // end the string PrintMessage(buffer); } else { // tell the amrpicture about the box activeView = V; if(startX < endX) { // box in scaled pixmap space startX = selectionBox.smallEnd(XDIR) * scale; endX = selectionBox.bigEnd(XDIR) * scale; } else { startX = selectionBox.bigEnd(XDIR) * scale; endX = selectionBox.smallEnd(XDIR) * scale; } if(startY < endY) { startY = imageHeight - selectionBox.bigEnd(YDIR) * scale; endY = imageHeight - selectionBox.smallEnd(YDIR) * scale; } else { startY = imageHeight - selectionBox.smallEnd(YDIR) * scale; endY = imageHeight - selectionBox.bigEnd(YDIR) * scale; } int nodeAdjustment = (scale - 1) * selectionBox.type()[YDIR]; startY -= nodeAdjustment; endY -= nodeAdjustment; amrPicturePtrArray[V]->SetRegion(startX, startY, endX, endY); #if (BL_SPACEDIM == 3) amrPicturePtrArray[V]->SetSubCut(startcutX[V], startcutY[V], finishcutX[V], finishcutY[V]); if(V == ZPLANE) { amrPicturePtrArray[YPLANE]->SetSubCut(startcutX[V], -1, finishcutX[V], -1); amrPicturePtrArray[XPLANE]->SetSubCut(imageHeight-startcutY[V],-1, imageHeight-finishcutY[V],-1); } if(V == YPLANE) { amrPicturePtrArray[ZPLANE]->SetSubCut(startcutX[V], -1, finishcutX[V], -1); amrPicturePtrArray[XPLANE]->SetSubCut(-1, startcutY[V], -1, finishcutY[V]); } if(V == XPLANE) { amrPicturePtrArray[ZPLANE]->SetSubCut(-1, imageWidth-startcutX[V], -1, imageWidth-finishcutX[V]); amrPicturePtrArray[YPLANE]->SetSubCut(-1, startcutY[V], -1, finishcutY[V]); } #endif for(int np(0); np < NPLANES; ++np) { amrPicturePtrArray[np]->DoExposePicture(); } } return; } break; case NoExpose: break; default: return; } // end switch } // end while(true) } if(servingButton == 2) { XDrawLine(display, amrPicturePtrArray[V]->PictureWindow(), rbgc, 0, oldY, imageWidth, oldY); #if (BL_SPACEDIM == 3) switch (V) { case ZPLANE: XDrawLine(display, amrPicturePtrArray[XPLANE]->PictureWindow(), rbgc, imageHeight-oldY, 0, imageHeight-oldY, amrPicturePtrArray[XPLANE]->ImageSizeV()); break; case YPLANE: XDrawLine(display, amrPicturePtrArray[XPLANE]->PictureWindow(), rbgc, 0, oldY, amrPicturePtrArray[XPLANE]->ImageSizeH(), oldY); break; default: // XPLANE XDrawLine(display, amrPicturePtrArray[YPLANE]->PictureWindow(), rbgc, 0, oldY, amrPicturePtrArray[YPLANE]->ImageSizeH(), oldY); } #endif int tempi; while(true) { XNextEvent(display, &nextEvent); switch(nextEvent.type) { case MotionNotify: XDrawLine(display, amrPicturePtrArray[V]->PictureWindow(), rbgc, 0, oldY, imageWidth, oldY); #if (BL_SPACEDIM == 3) // undraw in other planes if(V == ZPLANE) { XDrawLine(display, amrPicturePtrArray[XPLANE]->PictureWindow(), rbgc, imageHeight-oldY, 0, imageHeight-oldY, amrPicturePtrArray[XPLANE]->ImageSizeV()); } else if(V == YPLANE) { XDrawLine(display, amrPicturePtrArray[XPLANE]->PictureWindow(), rbgc, 0, oldY, amrPicturePtrArray[XPLANE]->ImageSizeH(), oldY); } else if(V == XPLANE) { XDrawLine(display, amrPicturePtrArray[YPLANE]->PictureWindow(), rbgc, 0, oldY, amrPicturePtrArray[YPLANE]->ImageSizeH(), oldY); } #endif DoDrawPointerLocation(None, (XtPointer) V, &nextEvent); while(XCheckTypedEvent(display, MotionNotify, &nextEvent)) { ; // do nothing } XQueryPointer(display, amrPicturePtrArray[V]->PictureWindow(), &whichRoot, &whichChild, &rootX, &rootY, &oldX, &oldY, &inputMask); // draw the new line XDrawLine(display, amrPicturePtrArray[V]->PictureWindow(), rbgc, 0, oldY, imageWidth, oldY); #if (BL_SPACEDIM == 3) switch (V) { case ZPLANE: XDrawLine(display, amrPicturePtrArray[XPLANE]->PictureWindow(), rbgc, imageHeight-oldY, 0, imageHeight-oldY, amrPicturePtrArray[XPLANE]->ImageSizeV()); break; case YPLANE: XDrawLine(display, amrPicturePtrArray[XPLANE]->PictureWindow(), rbgc, 0, oldY, amrPicturePtrArray[XPLANE]->ImageSizeH(), oldY); break; default: // XPLANE XDrawLine(display, amrPicturePtrArray[YPLANE]->PictureWindow(), rbgc, 0, oldY, amrPicturePtrArray[YPLANE]->ImageSizeH(), oldY); } #endif break; case ButtonRelease: avxGrab.ExplicitUngrab(); tempi = max(0, min(imageHeight, nextEvent.xbutton.y)); amrPicturePtrArray[V]->SetHLine(tempi); #if (BL_SPACEDIM == 3) if(V == ZPLANE) { amrPicturePtrArray[XPLANE]->SetVLine(amrPicturePtrArray[XPLANE]-> ImageSizeH()-1 - tempi); } if(V == YPLANE) { amrPicturePtrArray[XPLANE]->SetHLine(tempi); } if(V == XPLANE) { amrPicturePtrArray[YPLANE]->SetHLine(tempi); } if( ! ( (cbs->event->xbutton.state & ShiftMask) || (cbs->event->xbutton.state & ControlMask) ) ) { if(V == ZPLANE) { amrPicturePtrArray[YPLANE]-> APChangeSlice((imageHeight - tempi)/scale + ivLowOffsetMAL[YDIR]); } if(V == YPLANE) { amrPicturePtrArray[ZPLANE]-> APChangeSlice((imageHeight - tempi)/scale + ivLowOffsetMAL[ZDIR]); } if(V == XPLANE) { amrPicturePtrArray[ZPLANE]-> APChangeSlice((imageHeight - tempi)/scale + ivLowOffsetMAL[ZDIR]); } for(int np(0); np < NPLANES; ++np) { amrPicturePtrArray[np]->DoExposePicture(); projPicturePtr->ChangeSlice(np, amrPicturePtrArray[np]->GetSlice()); } projPicturePtr->MakeSlices(); XClearWindow(display, XtWindow(wTransDA)); DoExposeTransDA(); DoExposeRef(); return; } #endif for(int np(0); np != NPLANES; ++np) { amrPicturePtrArray[np]->DoExposePicture(); } if(oldY >= 0 && oldY <= imageHeight) { int sdir(-1); switch (V) { case ZPLANE: sdir = XDIR; break; case YPLANE: sdir = XDIR; break; case XPLANE: sdir = YDIR; break; } XYPlotDataList *newlist = CreateLinePlot(V, sdir, mal, (imageHeight + 1) / scale - 1 - oldY / scale, &pltAppState->CurrentDerived()); if(newlist) { newlist->SetLevel(maxDrawnLevel); if(XYplotwin[sdir] == NULL) { char cTempFN[BUFSIZ]; strcpy(cTempFN, AVGlobals::StripSlashes(fileNames[0]).c_str()); XYplotwin[sdir] = new XYPlotWin(cTempFN, appContext, wAmrVisTopLevel, this, sdir, currentFrame); } XYplotwin[sdir]->AddDataList(newlist); } } default: return; } // end switch } // end while(true) } if(servingButton == 3) { int tempi; XDrawLine(display, amrPicturePtrArray[V]->PictureWindow(), rbgc, oldX, 0, oldX, imageHeight); #if (BL_SPACEDIM == 3) if(V == ZPLANE) { XDrawLine(display, amrPicturePtrArray[YPLANE]->PictureWindow(), rbgc, oldX, 0, oldX, amrPicturePtrArray[YPLANE]->ImageSizeV()); } if(V == YPLANE) { XDrawLine(display, amrPicturePtrArray[ZPLANE]->PictureWindow(),rbgc, oldX, 0, oldX, amrPicturePtrArray[ZPLANE]->ImageSizeV()); } if(V == XPLANE) { XDrawLine(display, amrPicturePtrArray[ZPLANE]->PictureWindow(), rbgc, 0, imageWidth - oldX, amrPicturePtrArray[ZPLANE]->ImageSizeH(), imageWidth - oldX); } #endif while(true) { XNextEvent(display, &nextEvent); switch(nextEvent.type) { case MotionNotify: // undraw the old line XDrawLine(display, amrPicturePtrArray[V]->PictureWindow(), rbgc, oldX, 0, oldX, imageHeight); #if (BL_SPACEDIM == 3) // undraw in other planes if(V == ZPLANE) { XDrawLine(display, amrPicturePtrArray[YPLANE]->PictureWindow(), rbgc, oldX, 0, oldX, amrPicturePtrArray[YPLANE]->ImageSizeV()); } if(V == YPLANE) { XDrawLine(display, amrPicturePtrArray[ZPLANE]->PictureWindow(), rbgc, oldX, 0, oldX, amrPicturePtrArray[ZPLANE]->ImageSizeV()); } if(V == XPLANE) { XDrawLine(display, amrPicturePtrArray[ZPLANE]->PictureWindow(), rbgc, 0, imageWidth-oldX, amrPicturePtrArray[ZPLANE]->ImageSizeH(), imageWidth-oldX); } #endif DoDrawPointerLocation(None, (XtPointer) V, &nextEvent); while(XCheckTypedEvent(display, MotionNotify, &nextEvent)) { ; // do nothing } XQueryPointer(display, amrPicturePtrArray[V]->PictureWindow(), &whichRoot, &whichChild, &rootX, &rootY, &oldX, &oldY, &inputMask); // draw the new line XDrawLine(display, amrPicturePtrArray[V]->PictureWindow(), rbgc, oldX, 0, oldX, imageHeight); #if (BL_SPACEDIM == 3) if(V == ZPLANE) { XDrawLine(display, amrPicturePtrArray[YPLANE]->PictureWindow(), rbgc, oldX, 0, oldX, amrPicturePtrArray[YPLANE]->ImageSizeV()); } if(V == YPLANE) { XDrawLine(display, amrPicturePtrArray[ZPLANE]->PictureWindow(), rbgc, oldX, 0, oldX, amrPicturePtrArray[ZPLANE]->ImageSizeV()); } if(V == XPLANE) { XDrawLine(display, amrPicturePtrArray[ZPLANE]->PictureWindow(), rbgc, 0, imageWidth - oldX, amrPicturePtrArray[ZPLANE]->ImageSizeH(), imageWidth - oldX); } #endif break; case ButtonRelease: avxGrab.ExplicitUngrab(); tempi = max(0, min(imageWidth, nextEvent.xbutton.x)); amrPicturePtrArray[V]->SetVLine(tempi); #if (BL_SPACEDIM == 3) if(V == ZPLANE) { amrPicturePtrArray[YPLANE]->SetVLine(tempi); } if(V == YPLANE) { amrPicturePtrArray[ZPLANE]->SetVLine(tempi); } if(V == XPLANE) { amrPicturePtrArray[ZPLANE]->SetHLine(amrPicturePtrArray[ZPLANE]-> ImageSizeV()-1 - tempi); } if( ! ( (cbs->event->xbutton.state & ShiftMask) || (cbs->event->xbutton.state & ControlMask) ) ) { if(V == ZPLANE) { amrPicturePtrArray[XPLANE]-> APChangeSlice((tempi / scale) + ivLowOffsetMAL[XDIR]); } if(V == YPLANE) { amrPicturePtrArray[XPLANE]-> APChangeSlice((tempi / scale) + ivLowOffsetMAL[XDIR]); } if(V == XPLANE) { amrPicturePtrArray[YPLANE]-> APChangeSlice((tempi / scale) + ivLowOffsetMAL[YDIR]); } for(int np(0); np < NPLANES; ++np) { amrPicturePtrArray[np]->DoExposePicture(); projPicturePtr->ChangeSlice(np, amrPicturePtrArray[np]->GetSlice()); } projPicturePtr->MakeSlices(); XClearWindow(display, XtWindow(wTransDA)); DoExposeTransDA(); DoExposeRef(); return; } #endif for(int np(0); np != NPLANES; ++np) { amrPicturePtrArray[np]->DoExposePicture(); } if(oldX >= 0 && oldX <= imageWidth) { int sdir(-1); switch (V) { case ZPLANE: sdir = YDIR; break; case YPLANE: sdir = ZDIR; break; case XPLANE: sdir = ZDIR; break; } XYPlotDataList *newlist = CreateLinePlot(V, sdir, mal, oldX / scale, &pltAppState->CurrentDerived()); if(newlist) { newlist->SetLevel(maxDrawnLevel); if(XYplotwin[sdir] == NULL) { char cTempFN[BUFSIZ]; strcpy(cTempFN, AVGlobals::StripSlashes(fileNames[0]).c_str()); XYplotwin[sdir] = new XYPlotWin(cTempFN, appContext, wAmrVisTopLevel, this, sdir, currentFrame); } XYplotwin[sdir]->AddDataList(newlist); } } return; default: ; // do nothing break; } // end switch } // end while(true) } } // end DoRubberBanding // ------------------------------------------------------------------- void PltApp::DoExposePalette(Widget, XtPointer, XtPointer) { pltPaletteptr->ExposePalette(); } // ------------------------------------------------------------------- void PltApp::PADoExposePicture(Widget w, XtPointer client_data, XtPointer) { unsigned long np = (unsigned long) client_data; amrPicturePtrArray[np]->DoExposePicture(); // draw bounding box /* int isX = amrPicturePtrArray[np]->ImageSizeH(); int isY = amrPicturePtrArray[np]->ImageSizeV(); XSetForeground(display, xgc, pltPaletteptr->WhiteIndex()); XDrawLine(display, XtWindow(w), xgc, 0, isY, isX, isY); XDrawLine(display, XtWindow(w), xgc, isX, 0, isX, isY); */ } // ------------------------------------------------------------------- void PltApp::DoDrawPointerLocation(Widget, XtPointer data, XtPointer cbe) { XEvent *event = (XEvent *) cbe; unsigned long V = (unsigned long) data; if(event->type == LeaveNotify) { XClearWindow(display, XtWindow(wLocArea)); return; } Window whichRoot, whichChild; int rootX, rootY, newX, newY; unsigned int inputMask; int currentScale(pltAppState->CurrentScale()); XQueryPointer(display, XtWindow(wPlotPlane[V]), &whichRoot, &whichChild, &rootX, &rootY, &newX, &newY, &inputMask); int Yloci = ((amrPicturePtrArray[V]->ImageSizeV())/currentScale) - 1 - (newY / currentScale) + ivLowOffsetMAL[YDIR]; int Xloci = newX / currentScale + ivLowOffsetMAL[XDIR]; char locText[40]; #if (BL_SPACEDIM == 3) int Zloci = amrPicturePtrArray[V]->GetSlice(); double Xloc = gridOffset[XDIR]; double Yloc = gridOffset[YDIR]; double Zloc = gridOffset[ZDIR]; switch(V) { case ZPLANE: Xloc += (0.5 + Xloci) * finestDx[XDIR]; Yloc += (0.5 + Yloci) * finestDx[YDIR]; Zloc += (0.5 + Zloci) * finestDx[ZDIR]; break; case YPLANE: Xloc += (0.5 + Xloci) * finestDx[XDIR]; Yloc += (0.5 + Zloci) * finestDx[YDIR]; Zloc += (0.5 + Yloci) * finestDx[ZDIR]; break; case XPLANE: Xloc += (0.5 + Zloci) * finestDx[XDIR]; Yloc += (0.5 + Xloci) * finestDx[YDIR]; Zloc += (0.5 + Yloci) * finestDx[ZDIR]; } sprintf(locText, "(%.4E, %.4E, %.4E)", Xloc, Yloc, Zloc); #elif (BL_SPACEDIM == 2) double Xloc = gridOffset[XDIR] + (0.5 + Xloci) * finestDx[XDIR]; double Yloc = gridOffset[YDIR] + (0.5 + Yloci) * finestDx[YDIR]; sprintf(locText, "(%.4E, %.4E)", Xloc, Yloc); #endif XSetForeground(display, xgc, pltPaletteptr->WhiteIndex()); XClearWindow(display, XtWindow(wLocArea)); XDrawString(display, XtWindow(wLocArea), xgc, 10, 20, locText, strlen(locText)); } // ------------------------------------------------------------------- void PltApp::DoSpeedScale(Widget, XtPointer, XtPointer call_data) { XmScaleCallbackStruct *cbs = (XmScaleCallbackStruct *) call_data; frameSpeed = 600 - cbs->value; # if(BL_SPACEDIM == 3) for(int v = 0; v != 3; ++v) { amrPicturePtrArray[v]->SetFrameSpeed(600 - cbs->value); } # endif XSync(display, false); } // ------------------------------------------------------------------- void PltApp::DoBackStep(int plane) { int currentScale(pltAppState->CurrentScale()); int maLev(pltAppState->MaxAllowableLevel()); AmrPicture *appX = amrPicturePtrArray[XPLANE]; AmrPicture *appY = amrPicturePtrArray[YPLANE]; AmrPicture *appZ = amrPicturePtrArray[ZPLANE]; switch(plane) { case XPLANE: if(appX->GetSlice() > appX->GetSubDomain()[maLev].smallEnd(XDIR)) { appZ->SetVLine(appZ->GetVLine() - currentScale); appZ->DoExposePicture(); appY->SetVLine(appY->GetVLine() - currentScale); appY->DoExposePicture(); appX->APChangeSlice(appX->GetSlice() - 1); break; } appZ->SetVLine(appY->ImageSizeH() - 1); appZ->DoExposePicture(); appY->SetVLine(appY->ImageSizeH() - 1); appY->DoExposePicture(); appX-> APChangeSlice(appX->GetSubDomain()[maLev].bigEnd(XDIR)); break; case YPLANE: if(appY->GetSlice() > appY->GetSubDomain()[maLev].smallEnd(YDIR)) { appX->SetVLine(appX->GetVLine() - currentScale); appX->DoExposePicture(); appZ->SetHLine(appZ->GetHLine() + currentScale); appZ->DoExposePicture(); appY->APChangeSlice(appY->GetSlice() - 1); break; } appX->SetVLine(appX->ImageSizeH() - 1); appX->DoExposePicture(); appZ->SetHLine(0); appZ->DoExposePicture(); appY->APChangeSlice(appY->GetSubDomain()[maLev].bigEnd(YDIR)); break; case ZPLANE: if(appZ->GetSlice() > appZ->GetSubDomain()[maLev].smallEnd(ZDIR)) { appX->SetHLine(appX->GetHLine() + currentScale); appX->DoExposePicture(); appY->SetHLine(appY->GetHLine() + currentScale); appY->DoExposePicture(); appZ->APChangeSlice(appZ->GetSlice() - 1); break; } appX->SetHLine(0); appX->DoExposePicture(); appY->SetHLine(0); appY->DoExposePicture(); appZ->APChangeSlice(appZ->GetSubDomain()[maLev].bigEnd(ZDIR)); } #if (BL_SPACEDIM == 3) projPicturePtr->ChangeSlice(plane, amrPicturePtrArray[plane]->GetSlice()); projPicturePtr->MakeSlices(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); DoExposeTransDA(); #endif DoExposeRef(); } // ------------------------------------------------------------------- void PltApp::DoForwardStep(int plane) { int currentScale(pltAppState->CurrentScale()); int maLev(pltAppState->MaxAllowableLevel()); AmrPicture *appX = amrPicturePtrArray[XPLANE]; AmrPicture *appY = amrPicturePtrArray[YPLANE]; AmrPicture *appZ = amrPicturePtrArray[ZPLANE]; switch(plane) { case XPLANE: if(appX->GetSlice() < appX->GetSubDomain()[maLev].bigEnd(XDIR)) { appZ->SetVLine(appZ->GetVLine() + currentScale); appZ->DoExposePicture(); appY->SetVLine(appY->GetVLine() + currentScale); appY->DoExposePicture(); appX->APChangeSlice(appX->GetSlice() + 1); break; } appZ->SetVLine(0); appZ->DoExposePicture(); appY->SetVLine(0); appY->DoExposePicture(); appX->APChangeSlice(appX->GetSubDomain()[maLev].smallEnd(XDIR)); break; case YPLANE: if(appY->GetSlice() < appY->GetSubDomain()[maLev].bigEnd(YDIR)) { appX->SetVLine(appX->GetVLine() + currentScale); appX->DoExposePicture(); appZ->SetHLine(appZ->GetHLine() - currentScale); appZ->DoExposePicture(); appY->APChangeSlice(appY->GetSlice() + 1); break; } appX->SetVLine(0); appX->DoExposePicture(); appZ->SetHLine(appX->ImageSizeV() - 1); appZ->DoExposePicture(); appY->APChangeSlice(appY->GetSubDomain()[maLev].smallEnd(YDIR)); break; case ZPLANE: if(appZ->GetSlice() < appZ->GetSubDomain()[maLev].bigEnd(ZDIR)) { appX->SetHLine(appX->GetHLine() - currentScale); appX->DoExposePicture(); appY->SetHLine(appY->GetHLine() - currentScale); appY->DoExposePicture(); appZ->APChangeSlice(appZ->GetSlice() + 1); break; } appX->SetHLine(appX->ImageSizeV() - 1); appX->DoExposePicture(); appY->SetHLine(appY->ImageSizeV() - 1); appY->DoExposePicture(); appZ->APChangeSlice(appZ->GetSubDomain()[maLev].smallEnd(ZDIR)); } #if (BL_SPACEDIM == 3) projPicturePtr->ChangeSlice(plane, amrPicturePtrArray[plane]->GetSlice()); projPicturePtr->MakeSlices(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); DoExposeTransDA(); #endif DoExposeRef(); } // ------------------------------------------------------------------- void PltApp::ChangePlane(Widget, XtPointer data, XtPointer cbs) { unsigned long which = (unsigned long) data; #if (BL_SPACEDIM == 3) if(which == WCSTOP) { amrPicturePtrArray[XPLANE]->DoStop(); amrPicturePtrArray[YPLANE]->DoStop(); amrPicturePtrArray[ZPLANE]->DoStop(); return; } #endif if(which == WCASTOP) { writingRGB = false; StopAnimation(); return; } XmPushButtonCallbackStruct *cbstr = (XmPushButtonCallbackStruct *) cbs; if(cbstr->click_count > 1) { switch(which) { #if (BL_SPACEDIM == 3) case WCXNEG: amrPicturePtrArray[XPLANE]->Sweep(ANIMNEGDIR); return; case WCXPOS: amrPicturePtrArray[XPLANE]->Sweep(ANIMPOSDIR); return; case WCYNEG: amrPicturePtrArray[YPLANE]->Sweep(ANIMNEGDIR); return; case WCYPOS: amrPicturePtrArray[YPLANE]->Sweep(ANIMPOSDIR); return; case WCZNEG: amrPicturePtrArray[ZPLANE]->Sweep(ANIMNEGDIR); return; case WCZPOS: amrPicturePtrArray[ZPLANE]->Sweep(ANIMPOSDIR); return; #endif case WCATNEG: Animate(ANIMNEGDIR); return; case WCATPOS: Animate(ANIMPOSDIR); return; case WCARGB: writingRGB = true; Animate(ANIMPOSDIR); return; default: return; } } switch (which) { #if (BL_SPACEDIM == 3) case WCXNEG: DoBackStep(XPLANE); return; case WCXPOS: DoForwardStep(XPLANE); return; case WCYNEG: DoBackStep(YPLANE); return; case WCYPOS: DoForwardStep(YPLANE); return; case WCZNEG: DoBackStep(ZPLANE); return; case WCZPOS: DoForwardStep(ZPLANE); return; #endif case WCATNEG: DoAnimBackStep(); return; case WCATPOS: DoAnimForwardStep(); return; case WCARGB: writingRGB = true; DoAnimForwardStep(); return; } } // ------------------------------------------------------------------- void PltApp::DoAnimBackStep() { StopAnimation(); --currentFrame; if(currentFrame < 0) { currentFrame = animFrames - 1; } pltAppState->SetCurrentFrame(currentFrame); ShowFrame(); } // ------------------------------------------------------------------- void PltApp::DoAnimForwardStep() { StopAnimation(); if(writingRGB) { DoCreateAnimRGBFile(); writingRGB = false; } ++currentFrame; if(currentFrame == animFrames) { currentFrame = 0; } pltAppState->SetCurrentFrame(currentFrame); ShowFrame(); } // ------------------------------------------------------------------- void PltApp::DoAnimFileScale(Widget, XtPointer, XtPointer cbs) { StopAnimation(); currentFrame = ((XmScaleCallbackStruct *) cbs)->value; pltAppState->SetCurrentFrame(currentFrame); ShowFrame(); } // ------------------------------------------------------------------- void PltApp::ResetAnimation() { StopAnimation(); if( ! interfaceReady) { # if(BL_SPACEDIM == 2) int maLev(pltAppState->MaxAllowableLevel()); AmrPicture *Tempap = amrPicturePtrArray[ZPLANE]; XtRemoveEventHandler(wPlotPlane[ZPLANE], ExposureMask, false, (XtEventHandler) &PltApp::StaticEvent, (XtPointer) Tempap); Box fineDomain(amrPicturePtrArray[ZPLANE]->GetSubDomain()[maLev]); delete Tempap; const AmrData &amrData = dataServicesPtr[currentFrame]->AmrDataRef(); fineDomain.refine(AVGlobals::CRRBetweenLevels(maLev, amrData.FinestLevel(), amrData.RefRatio())); amrPicturePtrArray[ZPLANE] = new AmrPicture(ZPLANE, gaPtr, fineDomain, NULL, this, pltAppState, bCartGridSmoothing); amrPicturePtrArray[ZPLANE]->SetRegion(startX, startY, endX, endY); //pltAppState->SetMaxDrawnLevel(maxDrawnLevel); //SetNumContours(false); //XtRemoveEventHandler(wPlotPlane[ZPLANE], ExposureMask, false, //(XtEventHandler) &PltApp::StaticEvent, //(XtPointer) Tempap); //delete Tempap; amrPicturePtrArray[ZPLANE]->CreatePicture(XtWindow(wPlotPlane[ZPLANE]), pltPaletteptr); AddStaticEventHandler(wPlotPlane[ZPLANE], ExposureMask, &PltApp::PADoExposePicture, (XtPointer) ZPLANE); interfaceReady = true; # endif } } // ------------------------------------------------------------------- void PltApp::StopAnimation() { if(animationIId) { XtRemoveTimeOut(animationIId); animationIId = 0; } #if (BL_SPACEDIM == 2) for(int dim = 0; dim != 2; ++dim) { if(XYplotwin[dim]) { XYplotwin[dim]->StopAnimation(); } } #endif } // ------------------------------------------------------------------- void PltApp::Animate(AnimDirection direction) { StopAnimation(); animationIId = AddStaticTimeOut(frameSpeed, &PltApp::DoUpdateFrame); animDirection = direction; #if (BL_SPACEDIM == 2) for(int dim(0); dim != 2; ++dim) { if(XYplotwin[dim]) { XYplotwin[dim]->InitializeAnimation(currentFrame, animFrames); } } #endif } // ------------------------------------------------------------------- void PltApp::DirtyFrames() { paletteDrawn = false; for(int i(0); i < animFrames; ++i) { if(readyFrames[i] == true) { XDestroyImage(frameBuffer[i]); } readyFrames[i] = false; } } // ------------------------------------------------------------------- void PltApp::DoUpdateFrame(Widget, XtPointer, XtPointer) { if(animDirection == ANIMPOSDIR) { if(writingRGB) { DoCreateAnimRGBFile(); } ++currentFrame; if(currentFrame == animFrames) { currentFrame = 0; } } else { --currentFrame; if(currentFrame < 0) { currentFrame = animFrames - 1; } } pltAppState->SetCurrentFrame(currentFrame); ShowFrame(); XSync(display, false); animationIId = AddStaticTimeOut(frameSpeed, &PltApp::DoUpdateFrame); } // ------------------------------------------------------------------- void PltApp::ShowFrame() { interfaceReady = false; const AmrData &amrData = dataServicesPtr[currentFrame]->AmrDataRef(); if( ! readyFrames[currentFrame] || datasetShowing || UsingFileRange(currentRangeType)) { # if(BL_SPACEDIM == 2) AmrPicture *tempapSF = amrPicturePtrArray[ZPLANE]; Array domain = amrPicturePtrArray[ZPLANE]->GetSubDomain(); XtRemoveEventHandler(wPlotPlane[ZPLANE], ExposureMask, false, (XtEventHandler) &PltApp::StaticEvent, (XtPointer) tempapSF); delete tempapSF; Box fineDomain(domain[pltAppState->MaxAllowableLevel()]); fineDomain.refine(AVGlobals::CRRBetweenLevels(pltAppState->MaxAllowableLevel(), amrData.FinestLevel(), amrData.RefRatio())); amrPicturePtrArray[ZPLANE] = new AmrPicture(ZPLANE, gaPtr, fineDomain, NULL, this, pltAppState, bCartGridSmoothing); amrPicturePtrArray[ZPLANE]->SetRegion(startX, startY, endX, endY); amrPicturePtrArray[ZPLANE]->CreatePicture(XtWindow(wPlotPlane[ZPLANE]), pltPaletteptr); AddStaticEventHandler(wPlotPlane[ZPLANE], ExposureMask, &PltApp::PADoExposePicture, (XtPointer) ZPLANE); frameBuffer[currentFrame] = amrPicturePtrArray[ZPLANE]->GetPictureXImage(); # endif readyFrames[currentFrame] = true; paletteDrawn = ! UsingFileRange(currentRangeType); } XPutImage(display, XtWindow(wPlotPlane[ZPLANE]), xgc, frameBuffer[currentFrame], 0, 0, 0, 0, amrPicturePtrArray[ZPLANE]->ImageSizeH(), amrPicturePtrArray[ZPLANE]->ImageSizeV()); string fileName(fileNames[currentFrame]); char cTempFN[BUFSIZ]; strcpy(cTempFN, AVGlobals::StripSlashes(fileName).c_str()); XmString fileString = XmStringCreateSimple(cTempFN); XtVaSetValues(wWhichFileLabel, XmNlabelString, fileString, NULL); XmStringFree(fileString); char tempTimeName[BUFSIZ]; ostrstream tempTimeOut(tempTimeName, BUFSIZ); tempTimeOut << "T=" << amrData.Time() << ends; XmString timeString = XmStringCreateSimple(tempTimeName); XtVaSetValues(wWhichTimeLabel, XmNlabelString, timeString, NULL); XmStringFree(timeString); XmScaleSetValue(wWhichFileScale, currentFrame); if(datasetShowing) { int hdir(-1), vdir(-1), sdir(-1); if(activeView == ZPLANE) { hdir = XDIR; vdir = YDIR; sdir = ZDIR; } if(activeView == YPLANE) { hdir = XDIR; vdir = ZDIR; sdir = YDIR; } if(activeView == XPLANE) { hdir = YDIR; vdir = ZDIR; sdir = XDIR; } datasetPtr->DatasetRender(trueRegion, amrPicturePtrArray[activeView], this, pltAppState, hdir, vdir, sdir); datasetPtr->DoExpose(false); } #if (BL_SPACEDIM == 2) for(int dim(0); dim < 2; ++dim) { if(XYplotwin[dim]) { XYplotwin[dim]->UpdateFrame(currentFrame); } } #endif } // end ShowFrame // ------------------------------------------------------------------- void PltApp::AddStaticCallback(Widget w, String cbtype, memberCB cbf, void *d) { CBData *cbs = new CBData(this, d, cbf); // cbdPtrs.push_back(cbs) int nSize(cbdPtrs.size()); cbdPtrs.resize(nSize + 1); cbdPtrs[nSize] = cbs; XtAddCallback(w, cbtype, (XtCallbackProc ) &PltApp::StaticCallback, (XtPointer) cbs); } // ------------------------------------------------------------------- void PltApp::AddStaticEventHandler(Widget w, EventMask mask, memberCB cbf, void *d) { CBData *cbs = new CBData(this, d, cbf); // cbdPtrs.push_back(cbs) int nSize(cbdPtrs.size()); cbdPtrs.resize(nSize + 1); cbdPtrs[nSize] = cbs; XtAddEventHandler(w, mask, false, (XtEventHandler) &PltApp::StaticEvent, (XtPointer) cbs); } // ------------------------------------------------------------------- XtIntervalId PltApp::AddStaticTimeOut(int time, memberCB cbf, void *d) { CBData *cbs = new CBData(this, d, cbf); // cbdPtrs.push_back(cbs) int nSize(cbdPtrs.size()); cbdPtrs.resize(nSize + 1); cbdPtrs[nSize] = cbs; return XtAppAddTimeOut(appContext, time, (XtTimerCallbackProc) &PltApp::StaticTimeOut, (XtPointer) cbs); } // ------------------------------------------------------------------- void PltApp::StaticCallback(Widget w, XtPointer client_data, XtPointer call_data) { CBData *cbs = (CBData *) client_data; PltApp *obj = cbs->instance; (obj->*(cbs->cbFunc))(w, (XtPointer) cbs->data, call_data); } // ------------------------------------------------------------------- void PltApp::StaticEvent(Widget w, XtPointer client_data, XEvent *event, char*) { CBData *cbs = (CBData *) client_data; PltApp *obj = cbs->instance; (obj->*(cbs->cbFunc))(w, (XtPointer) cbs->data, (XtPointer) event); } // ------------------------------------------------------------------- void PltApp::StaticTimeOut(XtPointer client_data, XtIntervalId * call_data) { CBData *cbs = (CBData *) client_data; PltApp *obj = cbs->instance; (obj->*(cbs->cbFunc))(None, (XtPointer) cbs->data, (XtPointer) call_data); } // ------------------------------------------------------------------- int PltApp::initialScale; int PltApp::defaultShowBoxes; int PltApp::initialWindowHeight; int PltApp::initialWindowWidth; int PltApp::placementOffsetX = 0; int PltApp::placementOffsetY = 0; int PltApp::reserveSystemColors = 50; string PltApp::defaultPaletteString; string PltApp::defaultLightingFilename; string PltApp::initialDerived; string PltApp::initialFormatString; bool PltApp::PaletteDrawn() { return PltApp::paletteDrawn; } int PltApp::GetInitialScale() { return PltApp::initialScale; } int PltApp::GetDefaultShowBoxes() { return PltApp::defaultShowBoxes; } const string &PltApp::GetFileName() { return (fileNames[currentFrame]); } void PltApp::PaletteDrawn(bool tOrF) { paletteDrawn = tOrF; } void PltApp::SetDefaultPalette(const string &palString) { PltApp::defaultPaletteString = palString; } void PltApp::SetDefaultLightingFile(const string &lightFileString) { PltApp::defaultLightingFilename = lightFileString; } void PltApp::SetInitialDerived(const string &initialderived) { PltApp::initialDerived = initialderived; } void PltApp::SetInitialScale(int initScale) { PltApp::initialScale = initScale; } void PltApp::SetInitialFormatString(const string &formatstring) { PltApp::initialFormatString = formatstring; } void PltApp::SetDefaultShowBoxes(int showboxes) { PltApp::defaultShowBoxes = showboxes; } void PltApp::SetInitialWindowHeight(int initWindowHeight) { PltApp::initialWindowHeight = initWindowHeight; } void PltApp::SetInitialWindowWidth(int initWindowWidth) { PltApp::initialWindowWidth = initWindowWidth; } void PltApp::SetReserveSystemColors(int reservesystemcolors) { reservesystemcolors = max(0, min(128, reservesystemcolors)); // arbitrarily PltApp::reserveSystemColors = reservesystemcolors; } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/PltApp3D.cpp0000644000175000017500000010017111634153073021373 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: PltApp3D.cpp,v 1.55 2003/02/12 23:02:23 vince Exp $ // // --------------------------------------------------------------- // PltApp3D.cpp // --------------------------------------------------------------- #include "PltApp.H" #include "PltAppState.H" #include "ProjectionPicture.H" #include "Quaternion.H" #include #include #include #include #include #include #include #include #include #include #include const unsigned long openingLW(100); const unsigned long savingLW(101); const Real oo64(1.0 / 64.0); using std::max; using std::cout; using std::cerr; using std::endl; using std::max; #define MARK fprintf(stderr, "Mark: file %s, line %d.\n", __FILE__, __LINE__) // ------------------------------------------------------------------- void PltApp::DoExposeTransDA(Widget, XtPointer, XtPointer) { int minDrawnLevel(pltAppState->MinDrawnLevel()); int maxDrawnLevel(pltAppState->MaxDrawnLevel()); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) if(XmToggleButtonGetState(wAutoDraw)) { projPicturePtr->DrawPicture(); } else { projPicturePtr->DrawBoxes(minDrawnLevel, maxDrawnLevel); } if(labelAxes) { if(XmToggleButtonGetState(wAutoDraw)) { projPicturePtr->MakeBoxes(); } projPicturePtr->LabelAxes(); } #else projPicturePtr->DrawBoxes(minDrawnLevel, maxDrawnLevel); if(labelAxes) { projPicturePtr->LabelAxes(); } #endif } // ------------------------------------------------------------------- void PltApp::DoTransInput(Widget w, XtPointer, XtPointer call_data) { Real temp, scaledLBS(projPicturePtr->LongestBoxSide() * oo64); AmrQuaternion quatRotation, quatRotation2; AmrQuaternion newRotation, newRotation2; XmDrawingAreaCallbackStruct* cbs = (XmDrawingAreaCallbackStruct *) call_data; if(cbs->event->xany.type == ButtonPress) { servingButton = cbs->event->xbutton.button; startX = endX = cbs->event->xbutton.x; startY = endY = cbs->event->xbutton.y; acc = 0; } if(servingButton == 1) { endX = cbs->event->xbutton.x; endY = cbs->event->xbutton.y; if(cbs->event->xbutton.state & ShiftMask) { viewTrans.MakeTranslation(startX, startY, endX, endY, scaledLBS); } else { quatRotation = viewTrans.GetRotation(); quatRotation2 = viewTrans.GetRenderRotation(); newRotation = viewTrans.Screen2Quat(projPicturePtr->ImageSizeH()-startX, startY, projPicturePtr->ImageSizeH()-endX, endY, scaledLBS); newRotation2 = viewTrans.Screen2Quat(startX, startY, endX, endY, scaledLBS); // the last number scales the rotations correctly quatRotation = newRotation * quatRotation; viewTrans.SetRotation(quatRotation); quatRotation2 = newRotation2 * quatRotation2; viewTrans.SetRenderRotation(quatRotation2); } #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) if(XmToggleButtonGetState(wAutoDraw)) { DoRender(); } else { viewTrans.MakeTransform(); if(showing3dRender) { showing3dRender = false; } projPicturePtr->MakeBoxes(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); } #else viewTrans.MakeTransform(); projPicturePtr->MakeBoxes(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); #endif DoExposeTransDA(); ++acc; if(acc == 10) { startX = cbs->event->xbutton.x; startY = cbs->event->xbutton.y; acc = 0; } } if(servingButton == 2) { endX = cbs->event->xbutton.x; endY = cbs->event->xbutton.y; Real change((startY - endY) * 0.003); quatRotation = viewTrans.GetRotation(); quatRotation2 = viewTrans.GetRenderRotation(); // should replace the trigonometric equations... newRotation = AmrQuaternion(cos(-change), 0, 0, sin(-change)); newRotation2 = AmrQuaternion(cos(change), 0, 0, sin(change)); quatRotation = newRotation * quatRotation; viewTrans.SetRotation(quatRotation); quatRotation2 = newRotation2 * quatRotation2; viewTrans.SetRenderRotation(quatRotation2); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) if(XmToggleButtonGetState(wAutoDraw)) { DoRender(); } else { viewTrans.MakeTransform(); if(showing3dRender) { showing3dRender = false; } projPicturePtr->MakeBoxes(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); } #else viewTrans.MakeTransform(); projPicturePtr->MakeBoxes(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); #endif DoExposeTransDA(); ++acc; if(acc == 10) { startX = cbs->event->xbutton.x; startY = cbs->event->xbutton.y; acc = 0; } } if(servingButton == 3) { endX = cbs->event->xbutton.x; endY = cbs->event->xbutton.y; temp = viewTrans.GetScale() + (endY - startY) * 0.003; temp = std::max(temp, (Real) 0.1); viewTrans.SetScale(temp); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) if(XmToggleButtonGetState(wAutoDraw)) { DoRender(); } else { viewTrans.MakeTransform(); if(showing3dRender) { showing3dRender = false; } projPicturePtr->MakeBoxes(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); } #else viewTrans.MakeTransform(); projPicturePtr->MakeBoxes(); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); #endif DoExposeTransDA(); acc += 1; if(acc == 15) { startX = cbs->event->xbutton.x; startY = cbs->event->xbutton.y; acc = 0; } } if(cbs->event->xany.type == ButtonRelease) { startX = endX = 0; startY = endY = 0; acc = 0; } } // end DoTransInput(...) // ------------------------------------------------------------------- void PltApp::DoDetach(Widget, XtPointer, XtPointer) { Position xpos, ypos; Dimension wdth, hght; transDetached = true; XtUnmanageChild(wOrientXY); XtUnmanageChild(wOrientYZ); XtUnmanageChild(wOrientXZ); XtUnmanageChild(wLabelAxes); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) XtUnmanageChild(wRender); #endif XtUnmanageChild(wDetach); XtDestroyWidget(wTransDA); XtVaGetValues(wAmrVisTopLevel, XmNx, &xpos, XmNy, &ypos, XmNwidth, &wdth, XmNheight, &hght, NULL); string outbuf = "XYZ "; outbuf += AVGlobals::StripSlashes(fileName); strcpy(buffer, outbuf.c_str()); wDetachTopLevel = XtVaCreatePopupShell(buffer, topLevelShellWidgetClass, wAmrVisTopLevel, XmNwidth, 500, XmNheight, 500, XmNx, xpos+wdth/2, XmNy, ypos+hght/2, NULL); AddStaticCallback(wDetachTopLevel, XmNdestroyCallback, &PltApp::DoAttach); if(gaPtr->PVisual() != XDefaultVisual(display, gaPtr->PScreenNumber())) { XtVaSetValues(wDetachTopLevel, XmNvisual, gaPtr->PVisual(), XmNdepth, 8, NULL); } Widget wDetachForm, wAttach, wDLabelAxes; Widget wDOrientXY, wDOrientYZ, wDOrientXZ; wDetachForm = XtVaCreateManagedWidget("detachform", xmFormWidgetClass, wDetachTopLevel, NULL); wAttach = XtVaCreateManagedWidget("Attach", xmPushButtonWidgetClass, wDetachForm, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, NULL); AddStaticCallback(wAttach, XmNactivateCallback, &PltApp::DoAttach); XtManageChild(wAttach); wDOrientXY = XtVaCreateManagedWidget("XY", xmPushButtonWidgetClass, wDetachForm, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, NULL); AddStaticCallback(wDOrientXY, XmNactivateCallback, &PltApp::DoOrient, (XtPointer) OXY); XtManageChild(wDOrientXY); wDOrientYZ = XtVaCreateManagedWidget("YZ", xmPushButtonWidgetClass, wDetachForm, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wDOrientXY, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, NULL); AddStaticCallback(wDOrientYZ, XmNactivateCallback, &PltApp::DoOrient, (XtPointer) OYZ); XtManageChild(wDOrientYZ); wDOrientXZ = XtVaCreateManagedWidget("XZ", xmPushButtonWidgetClass, wDetachForm, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wDOrientYZ, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, NULL); AddStaticCallback(wDOrientXZ, XmNactivateCallback, &PltApp::DoOrient, (XtPointer) OXZ); XtManageChild(wDOrientXZ); wDLabelAxes = XtVaCreateManagedWidget("XYZ", xmPushButtonWidgetClass, wDetachForm, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wDOrientXZ, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, NULL); AddStaticCallback(wDLabelAxes, XmNactivateCallback, &PltApp::DoLabelAxes); XtManageChild(wDLabelAxes); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) Widget wDRender; wDRender = XtVaCreateManagedWidget("Draw", xmPushButtonWidgetClass, wDetachForm, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wDLabelAxes, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, NULL); AddStaticCallback(wDRender, XmNactivateCallback, &PltApp::DoRender); XtManageChild(wDRender); #endif wTransDA = XtVaCreateManagedWidget("detachDA", xmDrawingAreaWidgetClass, wDetachForm, XmNtranslations, XtParseTranslationTable(trans), XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wDOrientXY, XmNtopOffset, WOFFSET, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, NULL); projPicturePtr->SetDrawingArea(wTransDA); XtPopup(wDetachTopLevel, XtGrabNone); XSetWindowColormap(display, XtWindow(wDetachTopLevel), pltPaletteptr->GetColormap()); XSetWindowColormap(display, XtWindow(wTransDA), pltPaletteptr->GetColormap()); AddStaticCallback(wTransDA, XmNinputCallback, &PltApp::DoTransInput); AddStaticCallback(wTransDA, XmNresizeCallback, &PltApp::DoTransResize); AddStaticEventHandler(wTransDA, ExposureMask, &PltApp::DoExposeTransDA); DoTransResize(wTransDA, NULL, NULL); } // ------------------------------------------------------------------- void PltApp::DoAttach(Widget, XtPointer, XtPointer) { transDetached = false; XtDestroyWidget(wDetachTopLevel); XtManageChild(wOrientXY); XtManageChild(wOrientYZ); XtManageChild(wOrientXZ); XtManageChild(wLabelAxes); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) XtManageChild(wRender); #endif XtManageChild(wDetach); wTransDA = XtVaCreateManagedWidget("transDA", xmDrawingAreaWidgetClass, wPlotArea, XmNtranslations, XtParseTranslationTable(trans), XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wScrollArea[XPLANE], XmNleftOffset, WOFFSET, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wOrientXY, XmNtopOffset, WOFFSET, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, NULL); AddStaticCallback(wTransDA, XmNinputCallback, &PltApp::DoTransInput); AddStaticCallback(wTransDA, XmNresizeCallback, &PltApp::DoTransResize); AddStaticEventHandler(wTransDA, ExposureMask, &PltApp::DoExposeTransDA); projPicturePtr->SetDrawingArea(wTransDA); DoTransResize(wTransDA, NULL, NULL); } #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) // ------------------------------------------------------------------- void PltApp::DoApplyLightingWindow(Widget, XtPointer, XtPointer) { //read new input Real ambient = atof(XmTextFieldGetString(wLWambient)); Real diffuse = atof(XmTextFieldGetString(wLWdiffuse)); Real specular = atof(XmTextFieldGetString(wLWspecular)); Real shiny = atof(XmTextFieldGetString(wLWshiny)); Real minray = atof(XmTextFieldGetString(wLWminOpacity)); Real maxray = atof(XmTextFieldGetString(wLWmaxOpacity)); if(0.0 > ambient || ambient > 1.0) { cerr << "Error: ambient value must be in the range (0.0, 1.0)." << endl; } if(0.0 > diffuse || diffuse > 1.0) { cerr << "Error: diffuse value must be in the range (0.0, 1.0)." << endl; } if(0.0 > specular || specular > 1.0) { cerr << "Error: specular value must be in the range (0.0, 1.0)." << endl; } if(0.0 > minray || minray > 1.0) { cerr << "Error: minray value must be in the range (0.0, 1.0)." << endl; } if(0.0 > maxray || maxray > 1.0) { cerr << "Error: maxray value must be in the range (0.0, 1.0)." << endl; } if(0.0 > ambient || ambient > 1.0 || 0.0 > diffuse || diffuse > 1.0 || 0.0 > specular || specular > 1.0 || 0.0 > minray || minray > 1.0 || 0.0 > maxray || maxray > 1.0 ) { return; // rewrite old values } VolRender *volRenderPtr = projPicturePtr->GetVolRenderPtr(); if(ambient != volRenderPtr->GetAmbient() || diffuse != volRenderPtr->GetDiffuse() || specular != volRenderPtr->GetSpecular() || shiny != volRenderPtr->GetShiny() || minray != volRenderPtr->GetMinRayOpacity() || maxray != volRenderPtr->GetMaxRayOpacity()) { volRenderPtr->SetLighting(ambient, diffuse, specular, shiny, minray, maxray); // update render image if necessary projPicturePtr->GetVolRenderPtr()->InvalidateVPData(); if(XmToggleButtonGetState(wAutoDraw)) { DoRender(); } } } // ------------------------------------------------------------------- void PltApp::DoDoneLightingWindow(Widget w, XtPointer xp1, XtPointer xp2) { DoApplyLightingWindow(w, xp1, xp2); XtDestroyWidget(wLWTopLevel); } // ------------------------------------------------------------------- void PltApp::DestroyLightingWindow(Widget w, XtPointer xp, XtPointer) { lightingWindowExists = false; } // ------------------------------------------------------------------- void PltApp::DoCancelLightingWindow(Widget, XtPointer, XtPointer) { XtDestroyWidget(wLWTopLevel); } // ------------------------------------------------------------------- void PltApp::DoOpenFileLightingWindow(Widget w, XtPointer oos, XtPointer call_data) { static Widget wOpenLWDialog; wOpenLWDialog = XmCreateFileSelectionDialog(wAmrVisTopLevel, "Lighting File", NULL, 0); AddStaticCallback(wOpenLWDialog, XmNokCallback, &PltApp::DoOpenLightingFile, oos); XtAddCallback(wOpenLWDialog, XmNcancelCallback, (XtCallbackProc) XtUnmanageChild, (XtPointer) this); XtManageChild(wOpenLWDialog); XtPopup(XtParent(wOpenLWDialog), XtGrabExclusive); } // ------------------------------------------------------------------- void PltApp::DoOpenLightingFile(Widget w, XtPointer oos, XtPointer call_data) { unsigned long ioos((unsigned long) oos); bool bFileOk; Real ambient, diffuse, specular, shiny, minray, maxray; char *lightingfile; if( ! XmStringGetLtoR(((XmFileSelectionBoxCallbackStruct *) call_data)->value, XmSTRING_DEFAULT_CHARSET, &lightingfile)) { cerr << "PltApp::DoOpenLightingFile:: system error" << endl; return; } XtPopdown(XtParent(w)); string asLFile(lightingfile); ambient = atof(XmTextFieldGetString(wLWambient)); diffuse = atof(XmTextFieldGetString(wLWdiffuse)); specular = atof(XmTextFieldGetString(wLWspecular)); shiny = atof(XmTextFieldGetString(wLWshiny)); minray = atof(XmTextFieldGetString(wLWminOpacity)); maxray = atof(XmTextFieldGetString(wLWmaxOpacity)); if(ioos == openingLW) { cout << "_in DoOpenLightingFile: openingLW." << endl; bFileOk = AVGlobals::ReadLightingFile(asLFile, ambient, diffuse, specular, shiny, minray, maxray); if(bFileOk) { char cTempReal[32]; sprintf(cTempReal, "%3.2f", ambient); XmTextFieldSetString(wLWambient, cTempReal); sprintf(cTempReal, "%3.2f", diffuse); XmTextFieldSetString(wLWdiffuse, cTempReal); sprintf(cTempReal, "%3.2f", specular); XmTextFieldSetString(wLWspecular, cTempReal); sprintf(cTempReal, "%3.2f", shiny); XmTextFieldSetString(wLWshiny, cTempReal); sprintf(cTempReal, "%3.2f", minray); XmTextFieldSetString(wLWminOpacity, cTempReal); sprintf(cTempReal, "%3.2f", maxray); XmTextFieldSetString(wLWmaxOpacity, cTempReal); DoApplyLightingWindow(NULL, NULL, NULL); lightingFilename = AVGlobals::StripSlashes(asLFile); } } else { BL_ASSERT(ioos == savingLW); cout << "_in DoOpenLightingFile: savingLW." << endl; bFileOk = AVGlobals::WriteLightingFile(asLFile, ambient, diffuse, specular, shiny, minray, maxray); if(bFileOk) { lightingFilename = AVGlobals::StripSlashes(asLFile); } } XtFree(lightingfile); } // ------------------------------------------------------------------- void PltApp::DoCreateLightingWindow(Widget, XtPointer, XtPointer) { //Position xpos, ypos; if(lightingWindowExists) { XRaiseWindow(display, XtWindow(wLWTopLevel)); return; } Dimension wWidth(0), wHeight(0); Dimension ww, wh; lightingWindowExists = true; string LWtitlebar = "Lighting"; strcpy(buffer, LWtitlebar.c_str()); wLWTopLevel = XtVaCreatePopupShell(buffer, topLevelShellWidgetClass, wAmrVisTopLevel, XmNwidth, 100, XmNheight, 100, NULL); AddStaticCallback(wLWTopLevel, XmNdestroyCallback, &PltApp::DestroyLightingWindow); if(gaPtr->PVisual() != XDefaultVisual(display, gaPtr->PScreenNumber())) { XtVaSetValues(wLWTopLevel, XmNvisual, gaPtr->PVisual(), XmNdepth, 8, NULL); } wLWForm = XtVaCreateManagedWidget("detachform", xmFormWidgetClass, wLWTopLevel, NULL); // make the buttons Widget wLWDoneButton = XtVaCreateManagedWidget(" Ok ", xmPushButtonGadgetClass, wLWForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); AddStaticCallback(wLWDoneButton, XmNactivateCallback, &PltApp::DoDoneLightingWindow); Widget wLWApplyButton = XtVaCreateManagedWidget("Apply", xmPushButtonGadgetClass, wLWForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wLWDoneButton, NULL); AddStaticCallback(wLWApplyButton, XmNactivateCallback, &PltApp::DoApplyLightingWindow); Widget wLWOpenButton = XtVaCreateManagedWidget("Open...", xmPushButtonGadgetClass, wLWForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wLWApplyButton, NULL); AddStaticCallback(wLWOpenButton, XmNactivateCallback, &PltApp::DoOpenFileLightingWindow, (XtPointer) openingLW); Widget wLWSaveButton = XtVaCreateManagedWidget("Save...", xmPushButtonGadgetClass, wLWForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wLWOpenButton, NULL); AddStaticCallback(wLWSaveButton, XmNactivateCallback, &PltApp::DoOpenFileLightingWindow, (XtPointer) savingLW); Widget wLWCancelButton = XtVaCreateManagedWidget("Cancel", xmPushButtonGadgetClass, wLWForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, NULL); AddStaticCallback(wLWCancelButton, XmNactivateCallback, &PltApp::DoCancelLightingWindow); VolRender *volRenderPtr = projPicturePtr->GetVolRenderPtr(); //make the input forms Widget wTempLabel; wTempLabel = XtVaCreateManagedWidget("ambient: ", xmLabelGadgetClass, wLWForm, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 12, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); char cNbuff[64]; sprintf(cNbuff, "%3.2f", volRenderPtr->GetAmbient()); wLWambient = XtVaCreateManagedWidget("variable", xmTextFieldWidgetClass, wLWForm, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, WOFFSET, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 12, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, XmNvalue, cNbuff, XmNcolumns, 6, NULL); wTempLabel = XtVaCreateManagedWidget("diffuse: ", xmLabelGadgetClass, wLWForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wLWambient, XmNtopOffset, WOFFSET, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 25, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); sprintf(cNbuff, "%3.2f", volRenderPtr->GetDiffuse()); wLWdiffuse = XtVaCreateManagedWidget("variable", xmTextFieldWidgetClass, wLWForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wLWambient, XmNtopOffset, WOFFSET, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 25, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, XmNvalue, cNbuff, XmNcolumns, 6, NULL); wTempLabel = XtVaCreateManagedWidget("specular: ", xmLabelGadgetClass, wLWForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wLWdiffuse, XmNtopOffset, WOFFSET, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 37, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); sprintf(cNbuff, "%3.2f", volRenderPtr->GetSpecular()); wLWspecular = XtVaCreateManagedWidget("variable", xmTextFieldWidgetClass, wLWForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wLWdiffuse, XmNtopOffset, WOFFSET, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 37, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, XmNvalue, cNbuff, XmNcolumns, 6, NULL); wTempLabel = XtVaCreateManagedWidget("shiny: ", xmLabelGadgetClass, wLWForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wLWspecular, XmNtopOffset, WOFFSET, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 50, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); sprintf(cNbuff, "%3.2f", volRenderPtr->GetShiny()); wLWshiny = XtVaCreateManagedWidget("variable", xmTextFieldWidgetClass, wLWForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wLWspecular, XmNtopOffset, WOFFSET, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 50, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, XmNvalue, cNbuff, XmNcolumns, 6, NULL); wTempLabel = XtVaCreateManagedWidget("minRayOpacity: ", xmLabelGadgetClass, wLWForm, xmTextFieldWidgetClass, wLWForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopOffset, WOFFSET, XmNtopWidget, wLWshiny, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 62, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); sprintf(cNbuff, "%3.2f", volRenderPtr->GetMinRayOpacity()); wLWminOpacity = XtVaCreateManagedWidget("minray", xmTextFieldWidgetClass, wLWForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopOffset, WOFFSET, XmNtopWidget, wLWshiny, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 62, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, XmNvalue, cNbuff, XmNcolumns, 6, NULL); wTempLabel = XtVaCreateManagedWidget("maxRayOpacity: ", xmLabelGadgetClass, wLWForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopOffset, WOFFSET, XmNtopWidget, wLWminOpacity, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 75, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); sprintf(cNbuff, "%3.2f", volRenderPtr->GetMaxRayOpacity()); wLWmaxOpacity = XtVaCreateManagedWidget("variable", xmTextFieldWidgetClass, wLWForm, XmNtopAttachment, XmATTACH_WIDGET, XmNtopOffset, WOFFSET, XmNtopWidget, wLWminOpacity, XmNbottomAttachment, XmATTACH_POSITION, XmNbottomPosition, 75, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, WOFFSET, XmNvalue, cNbuff, XmNcolumns, 6, NULL); XtVaGetValues(wLWOpenButton, XmNwidth, &ww, XmNheight, &wh, NULL); wWidth = 5 * ww; wHeight = 12 * wh; XtVaSetValues(wLWTopLevel, XmNwidth, wWidth, XmNheight, wHeight, NULL); //XtManageChild(wLWCancelButton); //XtManageChild(wLWDoneButton); //XtManageChild(wLWApplyButton); XtPopup(wLWTopLevel, XtGrabNone); XSetWindowColormap(display, XtWindow(wLWTopLevel), pltPaletteptr->GetColormap()); } // ------------------------------------------------------------------- void PltApp::DoAutoDraw(Widget, XtPointer, XtPointer) { if(XmToggleButtonGetState(wAutoDraw)) { DoRender(); } else { if(showing3dRender) { showing3dRender = false; } projPicturePtr->MakeBoxes(); } XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); DoExposeTransDA(); } // ------------------------------------------------------------------- void PltApp::DoRenderModeMenu(Widget w, XtPointer item_no, XtPointer client_data) { if(wCurrentRenderMode == w) { XtVaSetValues(w, XmNset, true, NULL); return; } XtVaSetValues(wCurrentRenderMode, XmNset, false, NULL); wCurrentRenderMode = w; #if defined(BL_VOLUMERENDER) if(item_no == (XtPointer) 0) { lightingModel = true; } else if(item_no == (XtPointer) 1) { lightingModel = false; // use value model } projPicturePtr->GetVolRenderPtr()->SetLightingModel(lightingModel); projPicturePtr->GetVolRenderPtr()->InvalidateVPData(); if(XmToggleButtonGetState(wAutoDraw) || showing3dRender) { DoRender(); } #endif } // ------------------------------------------------------------------- void PltApp::DoClassifyMenu(Widget w, XtPointer item_no, XtPointer client_data) { if(wCurrentClassify == w) { XtVaSetValues(w, XmNset, true, NULL); return; } XtVaSetValues(wCurrentClassify, XmNset, false, NULL); wCurrentClassify = w; #if defined(BL_VOLUMERENDER) if(item_no == (XtPointer) 0) { preClassify = true; // Use Pre-Classified Mode } else if(item_no == (XtPointer) 1) { preClassify = false; // Use Octree Mode } projPicturePtr->GetVolRenderPtr()->SetPreClassifyAlgorithm(preClassify); projPicturePtr->GetVolRenderPtr()->InvalidateVPData(); if(XmToggleButtonGetState(wAutoDraw) || showing3dRender) { DoRender(); } #endif } // ------------------------------------------------------------------- void PltApp::DoRender(Widget, XtPointer, XtPointer) { showing3dRender = true; VolRender *volRender = projPicturePtr->GetVolRenderPtr(); if( ! volRender->SWFDataValid()) { int iPaletteStart = pltPaletteptr->PaletteStart(); int iPaletteEnd = pltPaletteptr->PaletteEnd(); int iBlackIndex = pltPaletteptr->BlackIndex(); int iWhiteIndex = pltPaletteptr->WhiteIndex(); int iColorSlots = pltPaletteptr->ColorSlots(); Real minUsing, maxUsing; pltAppState->GetMinMax(minUsing, maxUsing); volRender->MakeSWFData(dataServicesPtr[currentFrame], minUsing, maxUsing, pltAppState->CurrentDerived(), iPaletteStart, iPaletteEnd, iBlackIndex, iWhiteIndex, iColorSlots, pltAppState->GetShowingBoxes()); } if( ! volRender->VPDataValid()) { volRender->MakeVPData(); } projPicturePtr->MakePicture(); projPicturePtr->DrawPicture(); } #endif // ------------------------------------------------------------------- void PltApp::DoTransResize(Widget, XtPointer, XtPointer) { Dimension wdth, hght; XSetWindowColormap(display, XtWindow(wTransDA), pltPaletteptr->GetColormap()); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); XtVaGetValues(wTransDA, XmNwidth, &wdth, XmNheight, &hght, NULL); daWidth = wdth; daHeight = hght; projPicturePtr->SetDrawingAreaDimensions(daWidth, daHeight); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) if(XmToggleButtonGetState(wAutoDraw)) { DoRender(); } else { viewTrans.MakeTransform(); if(showing3dRender) { showing3dRender = false; } projPicturePtr->MakeBoxes(); } #else viewTrans.MakeTransform(); projPicturePtr->MakeBoxes(); #endif DoExposeTransDA(); } // ------------------------------------------------------------------- void PltApp::Clear() { XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) XmToggleButtonSetState(wAutoDraw, false, false); #endif // viewTrans.SetRotation(AmrQuaternion(1, 0, 0, 0)); // viewTrans.MakeTransform(); DoExposeTransDA(); } // ------------------------------------------------------------------- void PltApp::DoOrient(Widget w, XtPointer client_data, XtPointer) { Real rW(1.0), rX(0.0), rY(0.0), rZ(0.0); Real rW2(1.0), rX2(0.0), rY2(0.0), rZ2(0.0); int iOrientation((int) client_data); switch(iOrientation) { case OXY: rW = 1.0; rX = 0.0; rY = 0.0; rZ = 0.0; rW2 = 1.0; rX2 = 0.0; rY2 = 0.0; rZ2 = 0.0; break; case OYZ: rW = 0.5; rX = -0.5; rY = -0.5; rZ = -0.5; rW2 = 0.5; rX2 = -0.5; rY2 = 0.5; rZ2 = 0.5; break; case OXZ: rW = -0.5; rX = -0.5; rY = -0.5; rZ = -0.5; rW2 = -0.5; rX2 = -0.5; rY2 = 0.5; rZ2 = 0.5; break; } viewTrans.SetRotation(AmrQuaternion(rW, rX, rY, rZ)); viewTrans.SetRenderRotation(AmrQuaternion(rW2, rX2, rY2, rZ2)); viewTrans.ResetTranslation(); viewTrans.MakeTransform(); #if defined(BL_VOLUMERENDER) || defined(BL_PARALLELVOLUMERENDER) if(XmToggleButtonGetState(wAutoDraw)) { DoRender(); } else { if(showing3dRender) { showing3dRender = false; } projPicturePtr->MakeBoxes(); } #else projPicturePtr->MakeBoxes(); #endif XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); DoExposeTransDA(); } // ------------------------------------------------------------------- void PltApp::DoLabelAxes(Widget, XtPointer, XtPointer) { labelAxes = (labelAxes ? false : true); XClearWindow(XtDisplay(wTransDA), XtWindow(wTransDA)); DoExposeTransDA(); } ccseapps-2.5/CCSEApps/pAmrvis/Output.H0000644000175000017500000001012511634153073020710 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Output.H,v 1.14 2002/10/02 16:51:36 car Exp $ // // --------------------------------------------------------------- // Output.H // --------------------------------------------------------------- #ifndef _OUTPUT_H_ #define _OUTPUT_H_ #include #undef index #include "REAL.H" #include "Array.H" #include #include #include #include using std::string; // the following is support for writing rgb files. #define IMAGIC 0732 #define TYPEMASK 0xff00 #define BPPMASK 0x00ff #define ITYPE_VERBATIM 0x0000 #define ITYPE_RLE 0x0100 #define ISRLE(type) (((type) & 0xff00) == ITYPE_RLE) #define ISVERBATIM(type) (((type) & 0xff00) == ITYPE_VERBATIM) #define BPP(type) ((type) & BPPMASK) #define RLE(bpp) (ITYPE_RLE | (bpp)) #define VERBATIM(bpp) (ITYPE_VERBATIM | (bpp)) #define IBUFSIZE(pixels) ((pixels+(pixels>>6))<<2) typedef struct { unsigned short imagic; /* stuff saved on disk . . */ unsigned short type; unsigned short dim; unsigned short xsize; unsigned short ysize; unsigned short zsize; unsigned long min; unsigned long max; unsigned long wastebytes; char name[80]; unsigned long colormap; long file; /* stuff used in core only */ unsigned short flags; short dorev; short x; short y; short z; short cnt; unsigned short *ptr; unsigned short *base; unsigned short *tmpbuf; unsigned long offset; unsigned long rleend; /* for rle images */ unsigned long *rowstart; /* for rle images */ long *rowsize; /* for rle images */ } IMAGE; void WritePSFile(const char *filename, XImage *image, int imagesizehoriz, int imagesizevert, const Palette& palette); void WriteNewPSFile(const char *filename, XImage *image, int imagesizehoriz, int imagesizevert, const Palette &palette, const AmrData &amrdata, const int minlev, const int maxlev, Array< Array > &gridBoxes); void WritePSPaletteFile(const char *filename, XImage *image, int imagesizehoriz, int imagesizevert, const Array &palValuesList, const string &palNumFormat, const Palette& palette); void WriteRGBFile(const char *filename, XImage *image, int imagesizehoriz, int imagesizevert, const Palette& palette); void WritePPMFile(const char *filename, XImage *image, int imagesizehoriz, int imagesizevert, const Palette& palette); #endif ccseapps-2.5/CCSEApps/pAmrvis/AmrvisConstants.H0000644000175000017500000000627211634153073022556 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrvisConstants.H,v 1.19 2002/02/26 01:00:02 vince Exp $ // // --------------------------------------------------------------- // AmrvisConstants.H // --------------------------------------------------------------- #ifndef _AMRVISCONSTANTS_H #define _AMRVISCONSTANTS_H #include #include #include #ifndef BUFSIZ # define BUFSIZ 8192 #endif const int LINELENGTH = 160; const int MAXARGS = 50; #if (BL_SPACEDIM == 2) const int NPLANES = 1; #endif #if (BL_SPACEDIM == 3) const int NPLANES = 3; #endif const int XDIR = 0; const int YDIR = 1; const int ZDIR = 2; const int XY = 0; const int XZ = 1; const int YZ = 2; const int XYPLANE = 0; const int XZPLANE = 1; const int YZPLANE = 2; const int ZPLANE = 0; const int YPLANE = 1; const int XPLANE = 2; const int ISOVIEW = 3; const int PALETTEVIEW = 4; const int WOFFSET = 4; enum AnimDirection { ANIMPOSDIR = 0, ANIMNEGDIR }; // these are for PltApps wRangeRadioButton enum MinMaxRangeTypeForButtons { BGLOBALMINMAX = 0, BSUBREGIONMINMAX = 1, BUSERMINMAX = 2, BNUMBEROFMINMAX = 3, BINVALIDMINMAX }; enum MinMaxRangeType { GLOBALMINMAX = 0, SUBREGIONMINMAX = 1, USERMINMAX = 2, FILEGLOBALMINMAX = 3, FILESUBREGIONMINMAX = 4, FILEUSERMINMAX = 5, NUMBEROFMINMAX = 6, INVALIDMINMAX }; enum ContourType { RASTERONLY = 0, RASTERCONTOURS = 1, COLORCONTOURS = 2, BWCONTOURS = 3, VECTORS = 4, NCONTOPTIONS = 5, INVALIDCONTOURTYPE }; enum FileType { INVALIDTYPE = 0, FAB, MULTIFAB, NEWPLT, NUMDBPTYPES }; #ifdef BL_USE_FLOAT #define AV_BIG_REAL FLT_MAX #else # ifdef BL_USE_DOUBLE #define AV_BIG_REAL DBL_MAX # else # error Must define BL_USE_FLOAT or BL_USE_DOUBLE # endif #endif #endif // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Point.cpp0000644000175000017500000000635511634153073021106 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Point.cpp,v 1.9 2002/02/19 20:39:41 vince Exp $ // // --------------------------------------------------------------- // Point.cpp // --------------------------------------------------------------- #include #include "Point.H" Real scale = 1.0; // --------------------------------------------------------------- AmrVector::AmrVector(Real X, Real Y, Real Z) : x(X), y(Y), z(Z) { } // --------------------------------------------------------------- AmrVector::AmrVector(const AmrSpherePoint &S) : x(S.x), y(S.y), z(S.z) { } // --------------------------------------------------------------- AmrSpherePoint::AmrSpherePoint(Real X, Real Y, Real Z) { Real m(X * X + Y * Y + Z * Z); if(m == 0.0) { x = y = z = 0.0; return; } Real oneOverSqrtM(1.0 / sqrt(m)); x = X * oneOverSqrtM; y = Y * oneOverSqrtM; z = Z * oneOverSqrtM; } // --------------------------------------------------------------- AmrSpherePoint::AmrSpherePoint(const AmrVector &v) { Real m(v.x * v.x + v.y * v.y + v.z * v.z); if(m == 0.0) { x = y = z = 0.0; return; } Real oneOverSqrtM(1.0 / sqrt(m)); x = v.x * oneOverSqrtM; y = v.y * oneOverSqrtM; z = v.z * oneOverSqrtM; } // --------------------------------------------------------------- AmrVector AmrVector::applyMatrix(Real m[4][4]) { Real X(x * m[0][0] + m[1][0] * y + z * m[2][0]); Real Y(x * m[0][1] + m[1][1] * y + z * m[2][1]); Real Z(x * m[0][2] + m[1][2] * y + z * m[2][2]); return AmrVector(X, Y, Z); } // --------------------------------------------------------------- AmrSpherePoint AmrSpherePoint::applyMatrix(Real m[4][4]) { Real X(x * m[0][0] + m[1][0] * y + z * m[2][0]); Real Y(x * m[0][1] + m[1][1] * y + z * m[2][1]); Real Z(x * m[0][2] + m[1][2] * y + z * m[2][2]); return AmrSpherePoint(X, Y, Z); } // --------------------------------------------------------------- // --------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/VolRender.H0000644000175000017500000001223411634153073021313 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: VolRender.H,v 1.29 2002/12/10 20:12:23 vince Exp $ // // --------------------------------------------------------------- // VolRender.H // --------------------------------------------------------------- #ifndef _VOLRENDER_H_ #define _VOLRENDER_H_ #include #include using std::string; #include "Array.H" #include "REAL.H" #include "Box.H" #include "AmrvisConstants.H" #include "Volume.H" #include "Palette.H" #ifdef BL_VOLUMERENDER #include #endif class DataServices; class VolRender { private: VolRender(); public: VolRender(const Array &drawdomain, int mindrawnlevel, int maxdrawnlevel, Palette *, const string &asLightFileName); ~VolRender(); private: unsigned int nPoints, bPoints; int minDrawnLevel, maxDataLevel; Array drawnDomain; char buffer[BUFSIZ]; int nDenRampPts, nGradRampPts, nShadeRampPts; int maxDenRampPts, maxGradRampPts, maxShadeRampPts; bool bVolRenderDefined; Palette *palettePtr; int paletteSize; private: vpContext *vpc; Array density_ramp; // opacity as a function of density Array gradient_ramp; // opacity as a function of grad magnitude Array shade_table; // shading lookup table Array value_shade_table; //for the value model int rows, cols, planes; unsigned char *swfData; int swfDataSize; bool swfDataAllocated, vpDataValid, swfDataValid, vpCreated; int classifyFields, shadeFields; Array densityRampX, gradientRampX; Array densityRampY, gradientRampY; float minRayOpacity, maxRayOpacity; RawVoxel *volData; public: vpContext *GetVPContext() { return vpc; } void MakeVPData(); void MakeSWFData(DataServices *dataServicesPtr, Real rDataMin, Real rDataMax, const string &derivedName, int iPaletteStart, int iPaletteEnd, int iBlackIndex, int iWhiteIndex, int iColorSlots, const bool bdrawboxes); void MakePicture(Real mvmat[4][4], Real Length, int width, int height); void SetImage(unsigned char *image_data, int width, int height, int pixel_type); void WriteSWFData(const string &filenamebase, bool SWFLight); unsigned char *GetSWFData() { return swfData; } int GetSWFDataSize() const { return swfDataSize; } bool VPDataValid() const { return vpDataValid; } void InvalidateVPData(); bool SWFDataValid() const { return swfDataValid; } void InvalidateSWFData(); bool SWFDataAllocated() const { return swfDataAllocated; } const Array &DensityRampX() const { return densityRampX; } const Array &DensityRampY() const { return densityRampY; } void SetLightingModel(bool); bool GetLightingModel() const { return lightingModel; } void SetPreClassifyAlgorithm(bool); bool GetPreClassifyAlgorithm() const { return preClassify; } void SetAspect( Real newAspect) { vpAspect = newAspect; } void SetTransferProperties(); void SetLighting(Real ambient, Real diffuse, Real specular, Real shiny, Real minRay, Real maxRay); Real GetDiffuse() { return diffuseMat; } Real GetAmbient() { return ambientMat; } Real GetSpecular() { return specularMat; } Real GetShiny() { return shinyMat; } Real GetMinRayOpacity() { return minRayOpacity; } Real GetMaxRayOpacity() { return maxRayOpacity; } private: Real diffuseMat, shinyMat, specularMat, ambientMat; Real vpLen, vpAspect; bool lightingModel, preClassify; bool bDrawAllBoxes; int voxelFields; int normalField, normalOffset, normalSize, normalMax; int densityField, densityOffset, densitySize, densityMax; int gradientField, gradientOffset, gradientSize, gradientMax; bool AllocateSWFData(); void MakeDefaultTransProperties(); void SetProperties(); }; #endif ccseapps-2.5/CCSEApps/pAmrvis/XYPlotDataList.cpp0000644000175000017500000002355011634153073022636 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // ------------------------------------------------------------------- // XYPlotDataList.cpp // ------------------------------------------------------------------- #include "XYPlotDataList.H" #include #define STRDUP(xx) (strcpy(new char[strlen(xx)+1], (xx))) // ------------------------------------------------------------------- XYPlotDataList::XYPlotDataList(const string &_derived, int max_level, int _gridline, const Array &ratio_list, const Array &d_X, const Array &intersect_point, Real offset_x) : dataSets(max_level+1), upXi(max_level), ratios(ratio_list), dX(d_X), intersectPoint(intersect_point), lloY(max_level+1), hhiY(max_level+1), maxLevel(max_level), gridline(_gridline), offsetX(offset_x), derived(_derived) { //cout << "_here 000: max_level = " << max_level << endl; int idx; emptyQ = 1; updatedQ = 0; curLevel = 0; copied_from = NULL; idx = 0; while(true) { //cout << "_here 000.1: making a new dataSet: idx maxLevel = " // << idx << " " << maxLevel << endl; dataSets[idx] = new List< XYPlotDataListLink *>(); if(idx == maxLevel) { break; } upXi[idx] = new List(); ++idx; } } // ------------------------------------------------------------------- XYPlotDataList::XYPlotDataList(XYPlotDataList *src) : dataSets(src->dataSets), upXi(src->upXi), ratios(src->ratios), dX(src->dX), intersectPoint(src->intersectPoint), lloY(src->lloY), hhiY(src->hhiY), numPoints(src->numPoints), maxLevel(src->maxLevel), curLevel(src->curLevel), gridline(src->gridline), updatedQ(src->updatedQ), emptyQ(src->updatedQ), startX(src->startX), endX(src->endX), offsetX(src->offsetX), derived(src->derived) { //cout << "_here 001" << endl; if(src->copied_from) { copied_from = src->copied_from; } else { copied_from = src; } } // ------------------------------------------------------------------- XYPlotDataList::~XYPlotDataList() { if(copied_from == NULL) { int idx; for(idx = 0; idx <= maxLevel; ++idx) { for(ListIterator li(*dataSets[idx]); li; ++li) { delete (*li)->data; delete *li; } delete dataSets[idx]; delete intersectPoint[idx]; } for(idx = 0; idx != maxLevel; ++idx) { delete upXi[idx]; } } } // ------------------------------------------------------------------- void XYPlotDataList::AddFArrayBox(FArrayBox &fab, int which_dir, int level) { int length = fab.length()[which_dir]; int startXi = fab.smallEnd()[which_dir]; Real *data = new Real[length]; Real *FABdata = fab.dataPtr(); for(int ii(0); ii != length; ++ii) { data[ii] = FABdata[ii]; } addLink(new XYPlotDataListLink(data, startXi, length), level); } // ------------------------------------------------------------------- void XYPlotDataList::addLink(XYPlotDataListLink *linky, int level) { //cout << "_here 002: level = " << level << endl; BL_ASSERT(level <= maxLevel); emptyQ = 0; updatedQ = 0; linky->endXi = linky->startXi + linky->length; ListIterator curLevLI(*dataSets[level]); if(level == 0) { linky->down = NULL; while(true) { if( ! curLevLI) { dataSets[0]->append(linky); break; } if((*curLevLI)->startXi > linky->startXi) { dataSets[0]->addBefore(curLevLI, linky); break; } ++curLevLI; } //cout << "_here 002.1: returning" << endl; return; } int temp; // ASSUMPTION: DATA IS CELL CENTERED. If the box we are adding begins // more than halfway through the cell on the level below, then we will // consider the cell below to be "visible". temp = linky->startXi / ratios[level-1] + (((linky->startXi % ratios[level-1]) * 2 > ratios[level-1]) ? 1 : 0); // Insertion into sorted location. ListIterator XiLI(*upXi[level-1]); while(true) { // If we have reached the end of the list, append to the end. if( ! curLevLI) { dataSets[level]->append(linky); upXi[level-1]->append(temp); break; } // If the current box in the list begins after the box we are adding, // we have found the position in the list, so stop. if((*curLevLI)->startXi > linky->startXi) { dataSets[level]->addBefore(curLevLI, linky); upXi[level-1]->addBefore(XiLI, temp); break; } ++curLevLI; ++XiLI; } temp = linky->endXi / ratios[level-1]; linky->nDown = temp + (((linky->endXi % ratios[level-1]) * 2 > ratios[level-1]) ? 1 : 0); ListIterator preLevLI(*dataSets[level-1]); //cout << "_here 002.2" << endl; BL_ASSERT(preLevLI); XYPlotDataListLink *down = *preLevLI; while(down->endXi < temp && ++preLevLI) { down = *preLevLI; } linky->down = down; } // ------------------------------------------------------------------- void XYPlotDataList::UpdateStats(void) { // Find the number of points, and the extremes for each level. if(updatedQ) { return; } numPoints = 0; BL_ASSERT(dataSets[0]->firstElement()); { ListIterator li(*dataSets[0]); int startXi = (*li)->startXi; int endXi = (*li)->endXi; while(++li) { if((*li)->startXi < startXi) { startXi = (*li)->startXi; } if((*li)->endXi > endXi) { endXi = (*li)->endXi; } } startX = offsetX + dX[0] * startXi; endX = offsetX + dX[0] * endXi; } lloY[0] = DBL_MAX; hhiY[0] = -DBL_MAX; for(int idx(0); idx <= maxLevel; ++idx) { for(ListIterator li(*dataSets[idx]); li; ++li) { Real *ptr = (*li)->data; numPoints += (*li)->length; for(int idx2((*li)->length); idx2 != 0; --idx2) { if(*ptr < lloY[idx]) { lloY[idx] = *ptr; } if(*ptr > hhiY[idx]) { hhiY[idx] = *ptr; } ++ptr; } } if(idx != maxLevel) { lloY[idx+1] = lloY[idx]; hhiY[idx+1] = hhiY[idx]; } } updatedQ = 1; } // ------------------------------------------------------------------- XYPlotDataListIterator::XYPlotDataListIterator (XYPlotDataList *alist) : list(alist), XiLI(alist->curLevel), linkLI(alist->curLevel+1), maxLevel(alist->curLevel) { curLevel = 0; for(int idx = 0; idx <= maxLevel; ++idx) { linkLI[idx] = new ListIterator (*list->dataSets[idx]); } for(int idx = 0; idx != maxLevel; ++idx) { XiLI[idx] = new ListIterator (*list->upXi[idx]); } if( ! *linkLI[0]) { curLink = NULL; return; } curLink = **linkLI[0]; int temp; while(true) { curXi = curLink->startXi; nextXi = curLink->endXi; if(curLevel != maxLevel && *XiLI[curLevel] && ((temp = **XiLI[curLevel]) < nextXi)) { nextXi = temp; nextLink = **linkLI[curLevel+1]; ++(*XiLI[curLevel]); ++(*linkLI[curLevel+1]); } else { nextLink = NULL; break; } if(curXi < nextXi) { break; } ++curLevel; curLink = nextLink; } data = curLink->data; xval = (0.5 + curXi) * list->dX[curLevel] + list->offsetX; yval = *data; } // ------------------------------------------------------------------- XYPlotDataListIterator::~XYPlotDataListIterator(){ int idx; for(idx = 0; idx <= maxLevel; ++idx) { delete linkLI[idx]; } for(idx = 0; idx != maxLevel; ++idx) { delete XiLI[idx]; } } // ------------------------------------------------------------------- XYPlotDataListIterator &XYPlotDataListIterator::operator++() { if(++curXi < nextXi) { ++data; xval += list->dX[curLevel]; yval = *data; return *this; } int temp; do { if(nextLink) { curXi = nextLink->startXi; curLink = nextLink; ++curLevel; } else { if(curLevel != 0) { --curLevel; curXi = curLink->nDown; curLink = curLink->down; } else { while(curLink != **linkLI[0]) { ++(*linkLI[0]); } ++(*linkLI[0]); if( ! *linkLI[0]) { curLink = NULL; return *this; } curLink = **linkLI[0]; curXi = curLink->startXi; } } nextXi = curLink->endXi; if(curLevel != maxLevel && *XiLI[curLevel] && ((temp = **XiLI[curLevel]) < nextXi)) { nextXi = temp; nextLink = **linkLI[curLevel+1]; ++(*XiLI[curLevel]); ++(*linkLI[curLevel+1]); } else { nextLink = NULL; } } while(curXi >= nextXi); data = curLink->data + (curXi - curLink->startXi); xval = (0.5 + curXi) * list->dX[curLevel] + list->offsetX; yval = *data; return *this; } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/XYPlotDataList.H0000644000175000017500000001003511634153073022235 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // ------------------------------------------------------------------- // XYPlotDataList.H // ------------------------------------------------------------------- #ifndef XYPLOTDATALIST_H #define XYPLOTDATALIST_H #include #include #include #include #include #include #include using std::string; class XYPlotDataListLink { friend class XYPlotDataListIterator; friend class XYPlotDataList; public: XYPlotDataListLink(Real *d, int sX, int len) : data(d), length(len), startXi(sX) { BL_ASSERT(len != 0); }; protected: Real *data; int length, startXi, endXi; XYPlotDataListLink *down; int nDown; }; class XYPlotDataList { friend class XYPlotWin; friend class XYPlotDataListLink; friend class XYPlotDataListIterator; public: XYPlotDataList(const string &_derived, int max_level, int _gridline, const Array &ratio_list, const Array &d_x, const Array &intersect_point, Real start_x = 0.0); XYPlotDataList(XYPlotDataList *src); ~XYPlotDataList(); char IsEmpty(void) { return emptyQ; } void AddFArrayBox(FArrayBox &fab, int direction, int level); void UpdateStats(void); void SetLevel(int new_level) { curLevel = (new_level < maxLevel) ? new_level : maxLevel; } protected: Array *> dataSets; Array *> upXi; // Used for data set iteration [level] Array ratios; // Used for insertion of data sets beginning // in the middle of a single cell [level] Array dX; // dX in the proper direction [level] Array intersectPoint; // Intersected value (in problem space) // for labelling plots [level] Array lloY; // min Y [level] Array hhiY; // max Y [level] int numPoints, maxLevel, curLevel, gridline; char updatedQ, emptyQ; double startX, endX, offsetX; string derived; XYPlotDataList *copied_from; private: void addLink(XYPlotDataListLink *l, int level); }; class XYPlotDataListIterator { public: explicit XYPlotDataListIterator (XYPlotDataList *aList); ~XYPlotDataListIterator(); XYPlotDataListIterator& operator++ (); bool operator! () const { return (curLink == NULL) ? true : false; } operator void* () { return (curLink != NULL) ? this : NULL; } double xval, yval; private: XYPlotDataList *list; Array *> XiLI; Array *> linkLI; XYPlotDataListLink *curLink, *nextLink; int curXi, nextXi, curLevel, maxLevel; Real *data; }; #endif ccseapps-2.5/CCSEApps/pAmrvis/XYPlotWin.cpp0000644000175000017500000022262011634153073021665 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // --------------------------------------------------------------- // XYPlotWin.cpp // --------------------------------------------------------------- #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "XYPlotWin.H" #include "PltApp.H" #include "PltAppState.H" #include "GraphicsAttributes.H" #include #include using std::setw; using std::cout; using std::cerr; using std::endl; using std::min; using std::max; #define MARK (fprintf(stderr, "Mark at file %s, line %d.\n", __FILE__, __LINE__)) // Hack fix for compiler bug for window manager calls #ifndef FALSE #define FALSE false #endif // Bitmap data for various data mark styles static char markBits[8][8] = { {0x00, 0x00, 0x1c, 0x1c, 0x1c, 0x00, 0x00, 0x00}, {0x00, 0x3e, 0x22, 0x22, 0x22, 0x3e, 0x00, 0x00}, {0x00, 0x1c, 0x36, 0x22, 0x36, 0x1c, 0x00, 0x00}, {0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00, 0x00}, {0x00, 0x08, 0x14, 0x22, 0x14, 0x08, 0x00, 0x00}, {0x00, 0x1c, 0x14, 0x1c, 0x14, 0x1c, 0x00, 0x00}, {0x00, 0x1c, 0x2a, 0x36, 0x2a, 0x1c, 0x00, 0x00}, {0x00, 0x3e, 0x1c, 0x08, 0x1c, 0x3e, 0x00, 0x00}}; static param_style param_null_style = {STYLE, 0, (char *) 0}; #include #include using std::ostrstream; using std::ends; using std::endl; // Some macros for obtaining parameters. #define PM_INT(name) ((parameters->Get_Parameter(name, ¶m_temp)) ? \ param_temp.intv.value : (BL_ASSERT(0), (int) 0)) #define PM_STR(name) ((parameters->Get_Parameter(name, ¶m_temp)) ? \ param_temp.strv.value : (BL_ASSERT(0), (char *) 0)) #define PM_COLOR(name) ((parameters->Get_Parameter(name, ¶m_temp)) ? \ param_temp.pixv.value : (BL_ASSERT(0), param_null_color)) #define PM_PIXEL(name) ((parameters->Get_Parameter(name, ¶m_temp)) ? \ param_temp.pixv.value.pixel : (BL_ASSERT(0), (Pixel) 0)) #define PM_FONT(name) ((parameters->Get_Parameter(name, ¶m_temp)) ? \ param_temp.fontv.value : (BL_ASSERT(0), (XFontStruct *) 0)) #define PM_STYLE(name) ((parameters->Get_Parameter(name, ¶m_temp)) ? \ param_temp.stylev : (BL_ASSERT(0), param_null_style)) #define PM_BOOL(name) ((parameters->Get_Parameter(name, ¶m_temp)) ? \ param_temp.boolv.value : (BL_ASSERT(0), 0)) #define PM_DBL(name) ((parameters->Get_Parameter(name, ¶m_temp)) ? \ param_temp.dblv.value : (BL_ASSERT(0), 0.0)) // ------------------------------------------------------------------- XYPlotWin::~XYPlotWin() { if(pltParent->GetXYPlotWin(whichType) == this) { pltParent->DetachXYPlotWin(whichType); } CBdoClearData(None, NULL, NULL); if(wOptionsDialog != None) { XtDestroyWidget(wOptionsDialog); } if(wExportFileDialog != None) { XtDestroyWidget(wExportFileDialog); } XtDestroyWidget(wXYPlotTopLevel); delete gaPtr; delete [] Xsegs[0]; delete [] Xsegs[1]; delete [] XUnitText; delete [] YUnitText; delete [] formatY; delete [] formatX; delete [] pltTitle; // delete all the call back parameter structs int nSize; for(nSize = 0; nSize < xycbdPtrs.size(); ++nSize) { delete xycbdPtrs[nSize]; } for(nSize = 0; nSize < xymenucbdPtrs.size(); ++nSize) { delete xymenucbdPtrs[nSize]; } } // ------------------------------------------------------------------- XYPlotWin::XYPlotWin(char *title, XtAppContext app, Widget w, PltApp *parent, int type, int curr_frame) : appContext(app), wTopLevel(w), pltParent(parent), whichType(type), currFrame(curr_frame) { int idx; char buffer[BUFSIZE]; pltTitle = new char[strlen(title) + 1]; strcpy(pltTitle, title); params param_temp; // temporary parameter grabbing slot // Store some local stuff from the parent. parameters = pltParent->GetXYPlotParameters(); wExportFileDialog = None; wOptionsDialog = None; // Standard flags. zoomedInQ = 0; saveDefaultQ = 0; animatingQ = 0; #if (BL_SPACEDIM == 2) currFrame = 0; #endif // Create empty dataset list. legendHead = legendTail = NULL; numDrawnItems = 0; numItems = 0; setBoundingBox(); iCurrHint = 1; WM_DELETE_WINDOW = XmInternAtom(XtDisplay(wTopLevel), "WM_DELETE_WINDOW", false); // -------------------------------------------------------- main window int winOffsetX, winOffsetY; int winWidth = PM_INT("InitialWindowWidth"); int winHeight = PM_INT("InitialWindowHeight"); if(whichType == XDIR) { winOffsetX = PM_INT("InitialXWindowOffsetX"); winOffsetY = PM_INT("InitialXWindowOffsetY"); } else if(whichType == YDIR) { winOffsetX = PM_INT("InitialYWindowOffsetX"); winOffsetY = PM_INT("InitialYWindowOffsetY"); } else { winOffsetX = PM_INT("InitialZWindowOffsetX"); winOffsetY = PM_INT("InitialZWindowOffsetY"); } sprintf(buffer, "%s %c Value 1D plot", pltTitle, whichType + 'X'); wXYPlotTopLevel = XtVaCreatePopupShell(buffer, topLevelShellWidgetClass, wTopLevel, XmNscrollingPolicy, XmAUTOMATIC, XmNdeleteResponse, XmDO_NOTHING, XmNx, winOffsetX, XmNy, winOffsetY, NULL); XmAddWMProtocolCallback(wXYPlotTopLevel, WM_DELETE_WINDOW, (XtCallbackProc) CBcloseXYPlotWin, (XtPointer) this); Widget wControlArea, wScrollArea, wLegendArea, wExportButton, wOptionsButton, wCloseButton, wAllButton, wNoneButton, wClearButton; XmString label_str1, label_str2, label_str3; wControlArea = XtVaCreateManagedWidget("controlArea", xmFormWidgetClass, wXYPlotTopLevel, NULL); // -------------------------------------------------------- legend wLegendArea = XtVaCreateManagedWidget("legendarea", xmFormWidgetClass, wControlArea, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); wLegendMenu = XtVaCreateManagedWidget("legendmenu", xmFormWidgetClass, wLegendArea, XmNleftAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); label_str1 = XmStringCreateSimple("Export"); label_str2 = XmStringCreateSimple("Options"); label_str3 = XmStringCreateSimple("Close"); wExportButton = XtVaCreateManagedWidget("Export", xmPushButtonGadgetClass, wLegendMenu, XmNlabelString, label_str1, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 2, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 2, XmNwidth, 60, NULL); AddStaticCallback(wExportButton, XmNactivateCallback, &XYPlotWin::CBdoExportFileDialog, NULL); wOptionsButton = XtVaCreateManagedWidget("options", xmPushButtonGadgetClass, wLegendMenu, XmNlabelString, label_str2, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wExportButton, XmNleftOffset, 2, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 2, XmNwidth, 60, NULL); AddStaticCallback(wOptionsButton, XmNactivateCallback, &XYPlotWin::CBdoOptions, NULL); wCloseButton = XtVaCreateManagedWidget("close", xmPushButtonGadgetClass, wLegendMenu, XmNlabelString, label_str3, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wOptionsButton, XmNleftOffset, 2, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 2, XmNwidth, 60, NULL); XtAddCallback(wCloseButton, XmNactivateCallback, (XtCallbackProc) CBcloseXYPlotWin, (XtPointer) this); XmStringFree(label_str1); XmStringFree(label_str2); XmStringFree(label_str3); label_str1 = XmStringCreateSimple("All"); label_str2 = XmStringCreateSimple("None"); label_str3 = XmStringCreateSimple("Clear"); wAllButton = XtVaCreateManagedWidget("All", xmPushButtonGadgetClass, wLegendMenu, XmNlabelString, label_str1, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, 2, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wExportButton, XmNtopOffset, 2, XmNwidth, 60, NULL); AddStaticCallback(wAllButton, XmNactivateCallback, &XYPlotWin::CBdoSelectAllData, NULL); wNoneButton = XtVaCreateManagedWidget("None", xmPushButtonGadgetClass, wLegendMenu, XmNlabelString, label_str2, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wAllButton, XmNleftOffset, 2, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wOptionsButton, XmNtopOffset, 2, XmNwidth, 60, NULL); AddStaticCallback(wNoneButton, XmNactivateCallback, &XYPlotWin::CBdoDeselectAllData, NULL); wClearButton = XtVaCreateManagedWidget("Clear", xmPushButtonGadgetClass, wLegendMenu, XmNlabelString, label_str3, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wNoneButton, XmNleftOffset, 2, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wCloseButton, XmNtopOffset, 2, XmNwidth, 60, NULL); AddStaticCallback(wClearButton, XmNactivateCallback, &XYPlotWin::CBdoClearData, NULL); XmStringFree(label_str1); XmStringFree(label_str2); XmStringFree(label_str3); wScrollArea = XtVaCreateManagedWidget("scrollArea", xmScrolledWindowWidgetClass, wLegendArea, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_WIDGET, XmNtopWidget, wLegendMenu, XmNtopOffset, 2, XmNscrollingPolicy, XmAUTOMATIC, NULL); wLegendButtons = XtVaCreateManagedWidget("legendbuttons", xmFormWidgetClass, wScrollArea, NULL); XtVaSetValues(wScrollArea, XmNworkWindow, wLegendButtons, NULL); XtManageChild(wLegendMenu); XtManageChild(wLegendButtons); XtManageChild(wScrollArea); XtManageChild(wLegendArea); // PLOT wPlotWin = XtVaCreateManagedWidget("plotwin", xmDrawingAreaWidgetClass, wControlArea, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_WIDGET, XmNrightWidget, wLegendArea, XmNwidth, winWidth, XmNheight, winHeight, NULL); AddStaticCallback(wPlotWin, XmNexposeCallback, &XYPlotWin::CBdoDrawPlot, NULL); AddStaticCallback(wPlotWin, XmNresizeCallback, &XYPlotWin::CBdoRedrawPlot, NULL); AddStaticCallback(wPlotWin, XmNinputCallback, &XYPlotWin::CBdoRubberBanding, NULL); AddStaticEventHandler(wPlotWin, PointerMotionMask | LeaveWindowMask, &XYPlotWin::CBdoDrawLocation, NULL); XtManageChild(wPlotWin); XtManageChild(wControlArea); XtPopup(wXYPlotTopLevel, XtGrabNone); pWindow = XtWindow(wPlotWin); SetPalette(); gaPtr = new GraphicsAttributes(wXYPlotTopLevel); disp = gaPtr->PDisplay(); vis = gaPtr->PVisual(); if(vis != XDefaultVisual(disp, gaPtr->PScreenNumber())) { XtVaSetValues(wXYPlotTopLevel, XmNvisual, vis, XmNdepth, 8, NULL); } cursor = XCreateFontCursor(disp, XC_left_ptr); zoomCursor = XCreateFontCursor(disp, XC_sizing); XtVaGetValues(wPlotWin, XmNforeground, &foregroundPix, XmNbackground, &backgroundPix, NULL); gridPix = PM_PIXEL("GridColor"); textPix = PM_PIXEL("TextColor"); labeltextFont = PM_FONT("LabelFont"); titletextFont = PM_FONT("TitleFont"); // gc's for labels and titles, rubber banding, segments, and dots. XGCValues gcvals; gcvals.font = labeltextFont->fid; gcvals.foreground = textPix; labeltextGC = XCreateGC(disp, pWindow, GCFont | GCForeground, &gcvals); gcvals.font = titletextFont->fid; titletextGC = XCreateGC(disp, pWindow, GCFont | GCForeground, &gcvals); gcvals.function = GXxor; rbGC = XCreateGC(disp, gaPtr->PRoot(), GCFunction, &gcvals); segGC = XCreateGC(disp, gaPtr->PRoot(), 0, NULL); dotGC = XCreateGC(disp, gaPtr->PRoot(), 0, NULL); // Allocate space for XSegment's numXsegs = NUM_INIT_XSEGS; Xsegs[0] = new XSegment[numXsegs]; Xsegs[1] = new XSegment[numXsegs]; // Get parameters and attributes out of parameters database // and initialize bitmaps for line styles markQ = PM_BOOL("Markers"); tickQ = PM_BOOL("Ticks"); axisQ = PM_BOOL("TickAxis"); boundBoxQ = PM_BOOL("BoundBox"); plotLinesQ = PM_BOOL("PlotLines"); dispHintsQ = PM_BOOL("DisplayHints"); gridW = PM_INT("GridWidth"); lineW = PM_INT("LineWidth"); dotW = PM_INT("DotWidth"); char *str; if(whichType == XDIR) { str = PM_STR("XUnitTextX"); } else if(whichType == YDIR) { str = PM_STR("XUnitTextY"); } else { str = PM_STR("XUnitTextZ"); } XUnitText = new char[strlen(str) + 1]; strcpy(XUnitText, str); str = PM_STR("YUnitText"); YUnitText = new char[strlen(str) + 1]; strcpy(YUnitText, str); str = PM_STR("FormatX"); formatX = new char[strlen(str) + 1]; strcpy(formatX, str); str = PM_STR("FormatY"); formatY = new char[strlen(str) + 1]; strcpy(formatY, str); gridStyle = PM_STYLE("GridStyle"); for(idx = 0; idx < 8; ++idx) { sprintf(buffer, "%d.Style", idx); parameters->Get_Parameter(buffer, ¶m_temp); AllAttrs[idx].lineStyleLen = param_temp.stylev.len; strncpy(AllAttrs[idx].lineStyle, param_temp.stylev.dash_list, param_temp.stylev.len); AllAttrs[idx].markStyle = XCreateBitmapFromData(disp, pWindow, markBits[idx], 8, 8); } for(idx = 0; idx != 8; ++idx) { lineFormats[idx] = 0x0; } // Set up the device information structure. devInfo.maxSegs = numXsegs; devInfo.areaW = devInfo.areaH = 0; // Set later devInfo.bdrPad = BORDER_PADDING; devInfo.axisPad = AXIS_PADDING; devInfo.tickLen = TICKLENGTH; devInfo.axisW = XTextWidth(labeltextFont, "8", 1); devInfo.titleW = XTextWidth(titletextFont, "8", 1); devInfo.axisH = labeltextFont->max_bounds.ascent + labeltextFont->max_bounds.descent; devInfo.titleH = titletextFont->max_bounds.ascent + titletextFont->max_bounds.descent; xycbdPtrs.reserve(512); // arbitrarily xymenucbdPtrs.reserve(512); // arbitrarily } #if (BL_SPACEDIM == 2) // ------------------------------------------------------------------- void XYPlotWin::InitializeAnimation(int curr_frame, int num_frames) { if(animatingQ) { return; } animatingQ = true; currFrame = curr_frame; numFrames = num_frames; for(XYPlotLegendItem *ptr = legendHead; ptr; ptr = ptr->next) { if(ptr->XYPLIlist->copied_from != NULL) { XYPlotDataList *tempList = ptr->XYPLIlist; ptr->XYPLIlist = pltParent->CreateLinePlot(ZPLANE, whichType, ptr->XYPLIlist->maxLevel, ptr->XYPLIlist->gridline, &ptr->XYPLIlist->derived); delete tempList; } ptr->anim_lists = new Array(numFrames); ptr->ready_list = new Array(numFrames, 0); } pltParent->GetPltAppState()->GetMinMax((Real &) lloY, (Real &) hhiY); if( ! zoomedInQ) { setBoundingBox(); CBdoRedrawPlot(None, NULL, NULL); } } // ------------------------------------------------------------------- void XYPlotWin::UpdateFrame(int frame) { XYPlotDataList *tempList; int num_lists_changed(0); if( ! animatingQ && ! zoomedInQ) { lloY = DBL_MAX; hhiY = -DBL_MAX; } for(XYPlotLegendItem *ptr = legendHead; ptr; ptr = ptr->next) { if(ptr->drawQ) { ++num_lists_changed; } if(animatingQ) { (*ptr->anim_lists)[currFrame] = ptr->XYPLIlist; (*ptr->ready_list)[currFrame] = 1; if((*ptr->ready_list)[frame]) { ptr->XYPLIlist = (*ptr->anim_lists)[frame]; continue; } } else { tempList = ptr->XYPLIlist; } int level(ptr->XYPLIlist->curLevel); ptr->XYPLIlist = pltParent->CreateLinePlot(ZPLANE, whichType, ptr->XYPLIlist->maxLevel, ptr->XYPLIlist->gridline, &ptr->XYPLIlist->derived); ptr->XYPLIlist->SetLevel(level); ptr->XYPLIlist->UpdateStats(); if(ptr->XYPLIlist->numPoints > numXsegs) { numXsegs = ptr->XYPLIlist->numPoints + 5; delete [] Xsegs[0]; Xsegs[0] = new XSegment[numXsegs]; delete [] Xsegs[1]; Xsegs[1] = new XSegment[numXsegs]; } if( ! animatingQ) { delete tempList; if( ! zoomedInQ && ptr->drawQ) { updateBoundingBox(ptr->XYPLIlist); } } } currFrame = frame; if(num_lists_changed == 0) { return; } if(animatingQ) { clearData(); drawData(); } else { if( ! zoomedInQ) { setBoundingBox(); } CBdoRedrawPlot(None, NULL, NULL); } } // ------------------------------------------------------------------- void XYPlotWin::StopAnimation(void) { if(!animatingQ) return; animatingQ = false; for(XYPlotLegendItem *ptr = legendHead; ptr; ptr = ptr->next) { for(int ii = 0; ii != numFrames; ++ii) { if((*ptr->ready_list)[ii] && (*ptr->anim_lists)[ii] != ptr->XYPLIlist) { delete (*ptr->anim_lists)[ii]; } } delete ptr->ready_list; delete ptr->anim_lists; } lloY = DBL_MAX; hhiY = -DBL_MAX; for(XYPlotLegendItem *ptr = legendHead; ptr; ptr = ptr->next) { if(ptr->drawQ) { updateBoundingBox(ptr->XYPLIlist); } } if( ! zoomedInQ) { setBoundingBox(); CBdoRedrawPlot(None, NULL, NULL); } } #endif #define TRANX(xval) (((double) ((xval) - iXOrgX)) * dXUnitsPerPixel + dUsrOrgX) #define TRANY(yval) (dUsrOppY - (((double) ((yval) - iXOrgY)) * dYUnitsPerPixel)) #define SCREENX(userX) \ (((int) (((userX) - dUsrOrgX)/dXUnitsPerPixel + 0.5)) + iXOrgX) #define SCREENY(userY) \ (iXOppY - ((int) (((userY) - dUsrOrgY)/dYUnitsPerPixel + 0.5))) // ------------------------------------------------------------------- void XYPlotWin::setBoundingBox (double lowX, double lowY, double highX, double highY) { double pad; if(highX > lowX) { loX = lowX; hiX = highX; } else { if(numDrawnItems == 0) { loX = -1.0; loY = -1.0; hiX = 1.0; hiY = 1.0; lloX = DBL_MAX; lloY = DBL_MAX; hhiX = -DBL_MAX; hhiY = -DBL_MAX; return; } loX = lloX; hiX = hhiX; } if(highY > lowY) { loY = lowY; hiY = highY; } else { loY = lloY; hiY = hhiY; } // Increase the padding for aesthetics if(hiX - loX == 0.0) { pad = max(0.5, fabs(hiX / 2.0)); hiX += pad; loX -= pad; } if(hiY - loY == 0.0) { pad = max(0.5, fabs(hiY / 2.0)); hiY += pad; loY -= pad; } if( ! zoomedInQ) { // Add 10% padding to bounding box pad = (hiX - loX) * 0.05; loX -= pad; hiX += pad; pad = (hiY - loY) * 0.05; loY -= pad; hiY += pad; } } // ------------------------------------------------------------------- void XYPlotWin::CBdoRedrawPlot(Widget w, XtPointer, XtPointer) { XClearWindow(disp, pWindow); CBdoDrawPlot(None, NULL, NULL); } // ------------------------------------------------------------------- void XYPlotWin::CalculateBox() { XWindowAttributes win_attr; XGetWindowAttributes(disp, pWindow, &win_attr); devInfo.areaW = win_attr.width; devInfo.areaH = win_attr.height; // Figure out the transformation constants. Draw only if valid. // First, we figure out the origin in the X window. Above the space we // have the title and the Y axis unit label. To the left of the space we // have the Y axis grid labels. // Here we make an arbitrary label to find out how big an offset we need char buff[40]; sprintf(buff, formatY, -200.0); XCharStruct bb; int dir, ascent, descent; XTextExtents(labeltextFont, buff, strlen(buff), &dir, &ascent, &descent, &bb); iXOrgX = 2 * devInfo.bdrPad + bb.rbearing - bb.lbearing; if(dispHintsQ) { iXOrgY = devInfo.bdrPad + (5 * devInfo.axisH) / 2; } else { iXOrgY = devInfo.bdrPad + (3 * devInfo.axisH) / 2; } // Now we find the lower right corner. Below the space we have the X axis // grid labels. To the right of the space we have the X axis unit label // and the legend. We assume the worst case size for the unit label. iXOppX = devInfo.areaW - devInfo.bdrPad - devInfo.axisW; iXOppY = devInfo.areaH - devInfo.bdrPad - (2 * devInfo.axisH); iXLocWinX = devInfo.bdrPad + (30 * devInfo.axisW); iXLocWinY = devInfo.areaH - devInfo.bdrPad - devInfo.axisH; // Is the drawing area too small? if((iXOrgX >= iXOppX) || (iXOrgY >= iXOppY)) { return; } // We now have a bounding box for the drawing region. Figure out the units // per pixel using the data set bounding box. dXUnitsPerPixel = (hiX - loX) / ((double) (iXOppX - iXOrgX)); dYUnitsPerPixel = (hiY - loY) / ((double) (iXOppY - iXOrgY)); // Find origin in user coordinate space. We keep the center of the // original bounding box in the same place. double bbCenX = (loX + hiX) / 2.0; double bbCenY = (loY + hiY) / 2.0; double bbHalfWidth = ((double) (iXOppX - iXOrgX)) * 0.5 * dXUnitsPerPixel; double bbHalfHeight = ((double) (iXOppY - iXOrgY)) * 0.5 * dYUnitsPerPixel; dUsrOrgX = bbCenX - bbHalfWidth; dUsrOrgY = bbCenY - bbHalfHeight; dUsrOppX = bbCenX + bbHalfWidth; dUsrOppY = bbCenY + bbHalfHeight; } // ------------------------------------------------------------------- void XYPlotWin::CBdoDrawPlot(Widget, XtPointer, XtPointer) { CalculateBox(); // Everything is defined so we can now use the SCREENX and SCREENY // transformations. drawGridAndAxis(); drawData(); if(dispHintsQ) { drawHint(); } XFlush(disp); } // ------------------------------------------------------------------- void XYPlotWin::AddDataList(XYPlotDataList *new_list, XYPlotLegendItem *insert_after) { if(++numItems > 64) { // Too many data lists to assign unique color/style. Delete. PrintMessage("Too many lines in plotter!\n"); numItems = 64; delete new_list; return; } // Find a unique color and style. int i, j; char mask; for(i = 0; lineFormats[i] == 0xff; ++i) { ; // do nothing } for(j = 0, mask = 0x1; lineFormats[i] & mask; ++j, mask = mask << 1) { ; // do nothing } //j = 254; //cout << "_here 00: j = " << j << endl; //j = 4; XYPlotLegendItem *new_item = new XYPlotLegendItem; new_item->XYPLIlist = new_list; lineFormats[i] |= mask; new_item->style = i; new_item->color = j; new_item->pixel = AllAttrs[j].pixelValue; // Append this new list to our data set list. new_item->frame = XtVaCreateManagedWidget("frame", xmFrameWidgetClass, wLegendButtons, XmNshadowType, XmSHADOW_ETCHED_IN, XmNhighlightPixmap, NULL, XmNtopShadowColor, foregroundPix, XmNbottomShadowColor, foregroundPix, XmNtopAttachment, XmATTACH_WIDGET, XmNtopOffset, 0, NULL); new_item->wid = XtVaCreateManagedWidget("button", xmDrawingAreaWidgetClass, new_item->frame, XmNwidth, 155, XmNheight, ((BL_SPACEDIM == 3) ? (15 + 2 * devInfo.axisH) : (15 + devInfo.axisH)), NULL); pltParent->GetPalettePtr()->SetWindowPalette(pltParent->GetPaletteName(), XtWindow(new_item->wid)); Widget wid, levelmenu; char buffer[10]; new_item->menu = XmCreatePopupMenu(new_item->wid, "popup", NULL, 0); if(new_list->maxLevel != 0) { XmString label_str = XmStringCreateSimple("Level"); levelmenu = XmCreatePulldownMenu(new_item->menu, "pulldown", NULL, 0); XtVaCreateManagedWidget("Level", xmCascadeButtonGadgetClass, new_item->menu, XmNsubMenuId, levelmenu, XmNlabelString, label_str, XmNmnemonic, 'L', NULL); XmStringFree(label_str); for(int ii = 0; ii <= new_list->maxLevel; ++ii) { sprintf(buffer, "%d/%d", ii, new_list->maxLevel); wid = XtVaCreateManagedWidget(buffer, xmPushButtonGadgetClass, levelmenu, NULL); if(ii < 10) { XtVaSetValues(wid, XmNmnemonic, ii + '0', NULL); } XYMenuCBData *xymenucb = new XYMenuCBData(new_item, ii); // xymenucbdPtrs.push_back(xymenucb) int nSize(xymenucbdPtrs.size()); xymenucbdPtrs.resize(nSize + 1); xymenucbdPtrs[nSize] = xymenucb; AddStaticCallback(wid, XmNactivateCallback, &XYPlotWin::CBdoSetListLevel, xymenucb); } } wid = XtVaCreateManagedWidget("Copy", xmPushButtonGadgetClass, new_item->menu, XmNmnemonic, 'C', NULL); AddStaticCallback(wid, XmNactivateCallback, &XYPlotWin::CBdoCopyDataList, new_item); wid = XtVaCreateManagedWidget("Delete", xmPushButtonGadgetClass, new_item->menu, XmNmnemonic, 'D', NULL); AddStaticCallback(wid, XmNactivateCallback, &XYPlotWin::CBdoRemoveDataList, new_item); wid = XtVaCreateManagedWidget("Choose color", xmPushButtonGadgetClass, new_item->menu, XmNmnemonic, 'o', NULL); AddStaticCallback(wid, XmNactivateCallback, &XYPlotWin::CBdoInitializeListColorChange, new_item); if(insert_after == NULL) { new_item->drawQ = 1; // Default to draw. ++numDrawnItems; new_list->UpdateStats(); // Find extremes, number of points. updateBoundingBox(new_list); if( ! zoomedInQ) { setBoundingBox(); } if(new_list->numPoints > numXsegs) { numXsegs = new_list->numPoints + 5; delete [] Xsegs[0]; Xsegs[0] = new XSegment[numXsegs]; delete [] Xsegs[1]; Xsegs[1] = new XSegment[numXsegs]; } new_item->next = NULL; if((new_item->prev = legendTail) != NULL) { legendTail = legendTail->next = new_item; XtVaSetValues(new_item->frame, XmNtopWidget, new_item->prev->frame, NULL); } else { legendTail = legendHead = new_item; XtVaSetValues(new_item->frame, XmNtopWidget, wLegendMenu, NULL); } } else { new_item->drawQ = insert_after->drawQ; if(new_item->drawQ) { ++numDrawnItems; } else { XtVaSetValues(new_item->frame, XmNtopShadowColor, backgroundPix, XmNbottomShadowColor, backgroundPix, NULL); } new_item->prev = insert_after; XtVaSetValues(new_item->frame, XmNtopWidget, insert_after->frame, NULL); if((new_item->next = insert_after->next) != NULL) { new_item->next->prev = new_item; XtVaSetValues(new_item->next->frame, XmNtopWidget, new_item->frame, NULL); } else { legendTail = new_item; } insert_after->next = new_item; } AddStaticCallback(new_item->wid, XmNinputCallback, &XYPlotWin::CBdoSelectDataList, new_item); AddStaticCallback(new_item->wid, XmNexposeCallback, &XYPlotWin::CBdoDrawLegendItem, new_item); XtManageChild(new_item->frame); if(new_item->drawQ) { CBdoRedrawPlot(None, NULL, NULL); } } // ------------------------------------------------------------------- void XYPlotWin::updateBoundingBox(XYPlotDataList *xypdl) { if(xypdl->startX < lloX) { lloX = xypdl->startX; } if(xypdl->endX > hhiX) { hhiX = xypdl->endX; } if(xypdl->lloY[xypdl->curLevel] < lloY) { lloY = xypdl->lloY[xypdl->curLevel]; } if(xypdl->hhiY[xypdl->curLevel] > hhiY) { hhiY = xypdl->hhiY[xypdl->curLevel]; } } #define nlog10(x) (x == 0.0 ? 0.0 : log10(x) + 1e-15) // ------------------------------------------------------------------- double XYPlotWin::initGrid(double low, double high, double step) { // Hack fix for graphs of large constant graphs. Sometimes the // step is too small in comparison to the size of the grid itself, // and rounding error takes its toll. We "fix" this by multiplying // the step by an arbitrary number > 1 (1.2) when this happens. double gridHigh; while(true) { dGridStep = roundUp(step); gridHigh = (ceil(high / dGridStep) + 1.0) * dGridStep; if(gridHigh + dGridStep != gridHigh) { break; } if(step < DBL_EPSILON) { step = DBL_EPSILON; } step *= 1.2; } dGridBase = (floor(low / dGridStep) + 1.0) * dGridStep; return dGridBase; } // ------------------------------------------------------------------- double XYPlotWin::roundUp(double val) { int idx; int exponent((int) floor(nlog10(val))); if(exponent < 0) { for(idx = exponent; idx < 0; ++idx) { val *= 10.0; } } else { for(idx = 0; idx < exponent; ++idx) { val /= 10.0; } } if(val > 5.0) { val = 10.0; } else if(val > 2.0) { val = 5.0; } else if(val > 1.0) { val = 2.0; } else { val = 1.0; } if(exponent < 0) { for(idx = exponent; idx < 0; ++idx) { val /= 10.0; } } else { for(idx = 0; idx < exponent; ++idx) { val *= 10.0; } } return val; } // ------------------------------------------------------------------- void XYPlotWin::writeValue(char *str, char *fmt, double val, int expv) { int idx; if(expv < 0) { for(idx = expv; idx < 0; ++idx) { val *= 10.0; } } else { for(idx = expv; idx > 0; --idx) { val /= 10.0; } } if(strchr(fmt, 'd') || strchr(fmt, 'x')) { sprintf(str, fmt, (int) val); } else { sprintf(str, fmt, val); } } // ------------------------------------------------------------------- // Clipping algorithm from Neumann and Sproull by Cohen and Sutherland #define C_CODE(xval, yval, rtn) \ rtn = 0; \ if((xval) < dUsrOrgX) rtn = LEFT_CODE; \ else if((xval) > dUsrOppX) rtn = RIGHT_CODE; \ if((yval) < dUsrOrgY) rtn |= BOTTOM_CODE; \ else if((yval) > dUsrOppY) rtn |= TOP_CODE // ------------------------------------------------------------------- void XYPlotWin::drawGridAndAxis(void) { int expX, expY; // Engineering powers int Yspot, Xspot; char value[10], final[BUFSIZE + 10]; double dXIncr, dYIncr, dXStart, dYStart, dYIndex, dXIndex, dLarger; XSegment segs[2]; // Grid display powers are computed by taking the log of the largest // numbers and rounding down to the nearest multiple of 3. if(fabs(dUsrOrgX) > fabs(dUsrOppX)) { dLarger = fabs(dUsrOrgX); } else { dLarger = fabs(dUsrOppX); } expX = ((int) floor(nlog10(dLarger) / 3.0)) * 3; if(fabs(dUsrOrgY) > fabs(dUsrOppY)) { dLarger = fabs(dUsrOrgY); } else { dLarger = fabs(dUsrOppY); } expY = ((int) floor(nlog10(dLarger) / 3.0)) * 3; // With the powers computed, we can draw the axis labels. Xspot = devInfo.bdrPad + (2 * devInfo.axisW); Yspot = 2 * devInfo.bdrPad; if(expY != 0) { (void) sprintf(final, "%s x 10^%d", YUnitText, expY); textX(wPlotWin, Xspot, Yspot, final, T_LEFT, T_AXIS); } else { textX(wPlotWin, Xspot, Yspot, YUnitText, T_LEFT, T_AXIS); } Xspot = devInfo.areaW - devInfo.bdrPad; Yspot = devInfo.areaH - (2*devInfo.bdrPad); if(expX != 0) { (void) sprintf(final, "%s x 10^%d", XUnitText, expX); textX(wPlotWin, Xspot, Yspot, final, T_RIGHT, T_AXIS); } else { textX(wPlotWin, Xspot, Yspot, XUnitText, T_RIGHT, T_AXIS); } // First, the grid line labels dYIncr = (devInfo.axisPad + devInfo.axisH) * dYUnitsPerPixel; dYStart = initGrid(dUsrOrgY, dUsrOppY, dYIncr); int iLoopCheck(0); for(dYIndex = 0.0; dYIndex < (dUsrOppY - dYStart); dYIndex += dGridStep) { Yspot = SCREENY(dYIndex + dYStart); // Write the axis label writeValue(value, formatY, (dYIndex + dYStart), expY); textX(wPlotWin, iXOrgX - devInfo.bdrPad, Yspot, value, T_RIGHT, T_AXIS); ++iLoopCheck; if(iLoopCheck > ((int) ((dUsrOppY - dYStart)/dGridStep))) { break; } } dXIncr = (devInfo.axisPad + (devInfo.axisW * 7)) * dXUnitsPerPixel; dXStart = initGrid(dUsrOrgX, dUsrOppX, dXIncr); iLoopCheck = 0; for(dXIndex = 0.0; dXIndex < (dUsrOppX - dXStart); dXIndex += dGridStep) { Xspot = SCREENX(dXIndex + dXStart); // Write the axis label writeValue(value, formatX, (dXIndex + dXStart), expX); textX(wPlotWin, Xspot, devInfo.areaH-devInfo.bdrPad-devInfo.axisH, value, T_BOTTOM, T_AXIS); ++iLoopCheck; if(iLoopCheck > ((int) ((dUsrOppX - dXStart)/dGridStep))) { break; } } // Now, the grid lines or tick marks dYIncr = (devInfo.axisPad + devInfo.axisH) * dYUnitsPerPixel; dYStart = initGrid(dUsrOrgY, dUsrOppY, dYIncr); iLoopCheck = 0; for(dYIndex = 0.0; dYIndex < (dUsrOppY - dYStart); dYIndex += dGridStep) { Yspot = SCREENY(dYIndex + dYStart); // Draw the grid line or tick mark if(tickQ && ! (axisQ && dYIndex == 0.0)) { segs[0].x1 = iXOrgX; segs[0].x2 = iXOrgX + devInfo.tickLen; segs[1].x1 = iXOppX - devInfo.tickLen; segs[1].x2 = iXOppX; segs[0].y1 = segs[0].y2 = segs[1].y1 = segs[1].y2 = Yspot; segX(wPlotWin, 1, &(segs[1]), gridW, L_AXIS, 0, 0); } else { segs[0].x1 = iXOrgX; segs[0].x2 = iXOppX; segs[0].y1 = segs[0].y2 = Yspot; } segX(wPlotWin, 1, segs, gridW, L_AXIS, 0, 0); ++iLoopCheck; if(iLoopCheck > ((int) ((dUsrOppY - dYStart)/dGridStep))) { break; } } dXIncr = (devInfo.axisPad + (devInfo.axisW * 7)) * dXUnitsPerPixel; dXStart = initGrid(dUsrOrgX, dUsrOppX, dXIncr); iLoopCheck = 0; for(dXIndex = 0.0; dXIndex < (dUsrOppX - dXStart); dXIndex += dGridStep) { Xspot = SCREENX(dXIndex + dXStart); // Draw the grid line or tick marks if(tickQ && !(axisQ && dXIndex == 0.0)) { segs[0].x1 = segs[0].x2 = segs[1].x1 = segs[1].x2 = Xspot; segs[0].y1 = iXOrgY; segs[0].y2 = iXOrgY + devInfo.tickLen; segs[1].y1 = iXOppY - devInfo.tickLen; segs[1].y2 = iXOppY; } else { segs[0].x1 = segs[0].x2 = Xspot; segs[0].y1 = iXOrgY; segs[0].y2 = iXOppY; } segX(wPlotWin, 1, segs, gridW, L_AXIS, 0, 0); if(tickQ) { segX(wPlotWin, 1, &(segs[1]), gridW, L_AXIS, 0, 0); } ++iLoopCheck; if(iLoopCheck > ((int) ((dUsrOppX - dXStart)/dGridStep))) { break; } } if(boundBoxQ) { // draw bounding box XSegment bb[4]; bb[0].x1 = bb[0].x2 = bb[1].x1 = bb[3].x2 = iXOrgX; bb[0].y1 = bb[2].y2 = bb[3].y1 = bb[3].y2 = iXOrgY; bb[1].x2 = bb[2].x1 = bb[2].x2 = bb[3].x1 = iXOppX; bb[0].y2 = bb[1].y1 = bb[1].y2 = bb[2].y1 = iXOppY; segX(wPlotWin, 4, bb, gridW, L_AXIS, 0, 0); } } // ------------------------------------------------------------------- void XYPlotWin::clearData(void) { XClearArea(disp, pWindow, iXOrgX+1, iXOrgY+1, (iXOppX - iXOrgX - 2), (iXOppY - iXOrgY - 2), false); } // ------------------------------------------------------------------- void XYPlotWin::drawData(void){ double sx1, sy1, sx2, sy2, ssx1, ssx2, ssy1, ssy2, tx(0.0), ty(0.0); int code1, code2, cd, mark_inside; unsigned int X_idx; XSegment *ptr; int style; Pixel color; XFlush(disp); XYPlotLegendItem *item; for(item = legendHead; item != NULL ; item = item->next) { if( ! item->drawQ) { continue; } XYPlotDataListIterator li(item->XYPLIlist); if( ! li) { continue; } X_idx = 0; style = item->style; color = item->pixel; sx1 = li.xval; sy1 = li.yval; //cout << endl << "_here 1: about to draw segments." << endl; //cout << " maxSegs = " << devInfo.maxSegs << endl; while(++li) { sx2 = li.xval; sy2 = li.yval; ssx1 = sx1; ssx2 = sx2; ssy1 = sy1; ssy2 = sy2; //bool bDiag(X_idx >= 79 && X_idx <= 81); //bool bDiag(false); //bool bDiagLines(true); //if(bDiag) { //if(bDiagLines) { //cout << "[" << X_idx << "]: sx1 sx2 = " << sx1 << " " << sx2 << endl; //} // Put segment in (ssx1,ssy1) (ssx2,ssy2), clip to window boundary C_CODE(ssx1, ssy1, code1); C_CODE(ssx2, ssy2, code2); //if(bDiag) { cout << " code1 code2 = " << code1 << " " << code2 << endl; } mark_inside = (code1 == 0); //if(bDiag) { cout << " mark_inside = " << mark_inside << endl; } while(code1 || code2) { if(code1 & code2) { break; } cd = (code1 ? code1 : code2); if(cd & LEFT_CODE) { // Crosses left edge //if(bDiag) { cout << " _here 2.LEFT" << endl; } ty = ssy1 + (ssy2 - ssy1) * (dUsrOrgX - ssx1) / (ssx2 - ssx1); tx = dUsrOrgX; } else if(cd & RIGHT_CODE) { // Crosses right edge //if(bDiag) { cout << " _here 2.RIGHT" << endl; } ty = ssy1 + (ssy2 - ssy1) * (dUsrOppX - ssx1) / (ssx2 - ssx1); tx = dUsrOppX; } else if(cd & BOTTOM_CODE) { // Crosses bottom edge //if(bDiag) { cout << " _here 2.BOTTOM" << endl; } tx = ssx1 + (ssx2 - ssx1) * (dUsrOrgY - ssy1) / (ssy2 - ssy1); ty = dUsrOrgY; } else if(cd & TOP_CODE) { // Crosses top edge //if(bDiag) { cout << " _here 2.TOP" << endl; } tx = ssx1 + (ssx2 - ssx1) * (dUsrOppY - ssy1) / (ssy2 - ssy1); ty = dUsrOppY; } if(cd == code1) { //if(bDiag) { cout << " _here 2.code1" << endl; } ssx1 = tx; ssy1 = ty; C_CODE(ssx1, ssy1, code1); } else { //if(bDiag) { cout << " _here 2.code2" << endl; } ssx2 = tx; ssy2 = ty; C_CODE(ssx2, ssy2, code2); } } //if(bDiag) { cout << " code1 code2 = " << code1 << " " << code2 << endl; } if( ! code1 && ! code2) { // Add segment to list Xsegs[0][X_idx].x1 = Xsegs[1][X_idx].x1; Xsegs[0][X_idx].y1 = Xsegs[1][X_idx].y1; Xsegs[0][X_idx].x2 = Xsegs[1][X_idx].x2; Xsegs[0][X_idx].y2 = Xsegs[1][X_idx].y2; Xsegs[1][X_idx].x1 = SCREENX(ssx1); Xsegs[1][X_idx].y1 = SCREENY(ssy1); Xsegs[1][X_idx].x2 = SCREENX(ssx2); Xsegs[1][X_idx].y2 = SCREENY(ssy2); /* short xx1, xx2, yy1, yy2; xx1 = Xsegs[1][X_idx].x1; xx2 = Xsegs[1][X_idx].x2; yy1 = Xsegs[1][X_idx].y1; yy2 = Xsegs[1][X_idx].y2; if((Xsegs[0][X_idx].x1 + Xsegs[0][X_idx].y1 + Xsegs[0][X_idx].x2 + Xsegs[0][X_idx].y2) != 0) { if(xx1 > xx2) { cout << "[" << setw(3) << X_idx << "]" << ": x1 y1 x2 y2 = " << setw(3) << xx1 << " " << setw(3) << yy1 << " " << setw(3) << xx2 << " " << setw(3) << yy2 << endl; } } */ ++X_idx; } sx1 = sx2; sy1 = sy2; // Draw markers if requested and they are in drawing region if(markQ && mark_inside) { dotX(wPlotWin, Xsegs[1][X_idx - 1].x1, Xsegs[1][X_idx - 1].y1, style, color); } } // Handle last marker if(markQ) { C_CODE(sx1, sy1, mark_inside); if(mark_inside == 0) { dotX(wPlotWin, Xsegs[1][X_idx - 1].x1, Xsegs[1][X_idx - 1].y1, style, color); } } // Draw segments if(plotLinesQ && (X_idx > 0)) { ptr = Xsegs[1]; while(X_idx > devInfo.maxSegs) { segX(wPlotWin, devInfo.maxSegs, ptr, lineW, L_VAR, style, color); ptr += devInfo.maxSegs; X_idx -= devInfo.maxSegs; } //if(X_idx <= 91) { segX(wPlotWin, X_idx, ptr, lineW, L_VAR, style, color); //} } } } // ------------------------------------------------------------------- void XYPlotWin::textX (Widget win, int x, int y, char *text, int just, int style) { XCharStruct bb; int rx(0), ry(0), dir; int ascent, descent; XFontStruct *font; int len(strlen(text)); GC textGC; if(style == T_TITLE) { font = titletextFont; textGC = titletextGC; } else { font = labeltextFont; textGC = labeltextGC; } XTextExtents(font, text, len, &dir, &ascent, &descent, &bb); int width = bb.rbearing - bb.lbearing; int height = bb.ascent + bb.descent; switch(just) { case T_CENTER: rx = x - (width / 2); ry = y - (height / 2); break; case T_LEFT: rx = x; ry = y - (height / 2); break; case T_UPPERLEFT: rx = x; ry = y; break; case T_TOP: rx = x - (width / 2); ry = y; break; case T_UPPERRIGHT: rx = x - width; ry = y; break; case T_RIGHT: rx = x - width; ry = y - (height / 2); break; case T_LOWERRIGHT: rx = x - width; ry = y - height; break; case T_BOTTOM: rx = x - (width / 2); ry = y - height; break; case T_LOWERLEFT: rx = x; ry = y - height; break; } XDrawString(disp, XtWindow(win), textGC, rx, ry + bb.ascent, text, len); } // ------------------------------------------------------------------- #define SEGGC(l_fg, l_style, l_width) \ gcvals.foreground = l_fg; \ gcvals.line_style = l_style; \ gcvals.line_width = l_width; \ XChangeGC(disp,segGC,GCForeground|GCLineStyle|GCLineWidth, &gcvals); #define DASH(l_chars, l_len) XSetDashes(disp, segGC, 0, l_chars, l_len); // ------------------------------------------------------------------- void XYPlotWin::segX(Widget win, int ns, XSegment *segs, int width, int style, int lappr, Pixel color) { XGCValues gcvals; if(style == L_AXIS) { if(gridStyle.len < 2) { SEGGC(gridPix, LineSolid, gridW); } else { SEGGC(gridPix, LineOnOffDash, gridW); DASH(gridStyle.dash_list, gridStyle.len); } } else { // Color and line style vary if(lappr == 0) { SEGGC(color, LineSolid, width); } else if(lappr == 16) { SEGGC(backgroundPix, LineSolid, width); } else { SEGGC(color, LineOnOffDash, width); DASH(AllAttrs[lappr].lineStyle, AllAttrs[lappr].lineStyleLen); } } XDrawSegments(disp, XtWindow(win), segGC, segs, ns); } // ------------------------------------------------------------------- void XYPlotWin::dotX(Widget win, int x, int y, int style, int color) { XGCValues gcvals; gcvals.foreground = color; gcvals.clip_mask = AllAttrs[style].markStyle; gcvals.clip_x_origin = (int) (x - (dotW >> 1)); gcvals.clip_y_origin = (int) (y - (dotW >> 1)); XChangeGC(disp, dotGC, GCForeground | GCClipMask | GCClipXOrigin | GCClipYOrigin, &gcvals); XFillRectangle(disp, XtWindow(win), dotGC, (int) (x - (dotW >> 1)), (int) (y - (dotW >> 1)), dotW, dotW); } // ------------------------------------------------------------------- void XYPlotWin::CBdoClearData(Widget, XtPointer, XtPointer) { #if (BL_SPACEDIM == 2) if(animatingQ) { StopAnimation(); } #endif XYPlotLegendItem *next; for(XYPlotLegendItem *ptr = legendHead; ptr != NULL; ptr = next) { next = ptr->next; XtDestroyWidget(ptr->frame); delete ptr->XYPLIlist; delete ptr; } for(int idx = 0; idx != 8; ++idx) { lineFormats[idx] = 0x0; } legendHead = NULL; legendTail = NULL; colorChangeItem = NULL; numItems = 0; numDrawnItems = 0; zoomedInQ = 0; setBoundingBox(); CBdoRedrawPlot(None, NULL, NULL); } // ------------------------------------------------------------------- void XYPlotWin::CBdoExportFileDialog(Widget, XtPointer, XtPointer) { if(wExportFileDialog == None) { Widget wExportDumpFSBox = XmCreateFileSelectionDialog(wXYPlotTopLevel, "Choose a file to dump ASCII Data", NULL, 0); XtUnmanageChild(XmFileSelectionBoxGetChild(wExportDumpFSBox, XmDIALOG_HELP_BUTTON)); AddStaticCallback(wExportDumpFSBox, XmNokCallback, &XYPlotWin::CBdoExportFile, (XtPointer) 1); AddStaticCallback(wExportDumpFSBox, XmNcancelCallback, &XYPlotWin::CBdoExportFile, (XtPointer) 0); XtManageChild(wExportDumpFSBox); wExportFileDialog = XtParent(wExportDumpFSBox); } else { XtPopup(wExportFileDialog, XtGrabNone); } } // ------------------------------------------------------------------- void XYPlotWin::CBdoExportFile(Widget, XtPointer client_data, XtPointer data) { XmFileSelectionBoxCallbackStruct *cbs = (XmFileSelectionBoxCallbackStruct *) data; long which = (long) client_data; FILE *fs; if(which != 1) { XtPopdown(wExportFileDialog); return; } char *filename; if(animatingQ || ! XmStringGetLtoR(cbs->value, XmSTRING_DEFAULT_CHARSET, &filename) || ! (*filename)) { XmString label_str; Arg args[1]; label_str = XmStringCreateSimple((char *) (animatingQ ? "Cannot create export file while animating." : "Invalid file name.")); XtSetArg(args[0], XmNmessageString, label_str); Widget wid = XmCreateErrorDialog(wXYPlotTopLevel, "error", args, 1); XmStringFree(label_str); XtUnmanageChild(XmMessageBoxGetChild(wid, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild(XmMessageBoxGetChild(wid, XmDIALOG_HELP_BUTTON)); XtManageChild(wid); return; } if((fs = fopen(filename, "r")) != NULL) { fclose(fs); XmString label_str; Arg args[1]; label_str = XmStringCreateSimple("Overwrite existing file?"); XtSetArg(args[0], XmNmessageString, label_str); Widget wid = XmCreateWarningDialog(wXYPlotTopLevel, filename, args, 1); XmStringFree(label_str); XtUnmanageChild(XmMessageBoxGetChild(wid, XmDIALOG_HELP_BUTTON)); AddStaticCallback(wid, XmNokCallback, &XYPlotWin::CBdoASCIIDump, (XtPointer) filename); XtManageChild(wid); return; } CBdoASCIIDump(None, filename, NULL); } // ------------------------------------------------------------------- void XYPlotWin::CBdoASCIIDump(Widget, XtPointer client_data, XtPointer data) { char *filename = (char *) client_data; FILE *fs = fopen(filename, "w"); if(fs == NULL) { XmString label_str; Arg args[1]; label_str = XmStringCreateSimple("Access denied."); XtSetArg(args[0], XmNmessageString, label_str); Widget wid = XmCreateErrorDialog(wXYPlotTopLevel, filename, args, 1); XmStringFree(label_str); XtUnmanageChild(XmMessageBoxGetChild(wid, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild(XmMessageBoxGetChild(wid, XmDIALOG_HELP_BUTTON)); XtManageChild(wid); XtFree(filename); return; } XtFree(filename); fprintf(fs, "TitleText: %s\n", pltTitle); fprintf(fs, "YUnitText: %s\n", YUnitText); fprintf(fs, "XUnitText: %s\n", XUnitText); if( ! plotLinesQ) { fprintf(fs, "NoLines: true\n"); } if(boundBoxQ) { fprintf(fs, "BoundBox: on\n"); } if(tickQ) { fprintf(fs, "Ticks: on\n"); } if(markQ) { fprintf(fs, "Markers: on\n"); } if(axisQ) { fprintf(fs, "TickAxis: on\n"); } for(XYPlotLegendItem *item = legendHead; item; item = item->next) { if( ! item->drawQ) { continue; } XYPlotDataList *list = item->XYPLIlist; fprintf(fs, "\"%s %s Level %d/%d\n", list->derived.c_str(), list->intersectPoint[list->curLevel], list->curLevel, list->maxLevel); for(XYPlotDataListIterator li(list); li; ++li) { fprintf(fs, "%lf %lf\n", li.xval, li.yval); } fprintf(fs, "\n"); } fclose(fs); XtPopdown(wExportFileDialog); } // ------------------------------------------------------------------- void XYPlotWin::CBdoOptions(Widget, XtPointer, XtPointer) { if(wOptionsDialog == None) { // Build options dialog. char *firstColumnText[] = { "Data Markers", "Ticks (vs. grid)", "Axis Lines", "Bounding Box", "Plot Lines", "Display Hints" }; char *secondColumnText[] = { "Grid Line Width", "Plot Line Width", "X Unit Text", "Y Unit Text", "Grid Label Format X", "Grid Label Format Y" }; tbool[0] = markQ; tbool[1] = tickQ; tbool[2] = axisQ; tbool[3] = boundBoxQ; tbool[4] = plotLinesQ; tbool[5] = dispHintsQ; tbool[6] = saveDefaultQ; wOptionsDialog = XtVaCreatePopupShell("optionsdialog", xmDialogShellWidgetClass, wXYPlotTopLevel, XmNtitle, "Plot Options", XmNdeleteResponse, XmDO_NOTHING, NULL); AddStaticWMCallback(wOptionsDialog, WM_DELETE_WINDOW, &XYPlotWin::CBdoOptionsOKButton, (XtPointer) 0); Widget wOptionsForm = XtVaCreateManagedWidget("optionsform", xmFormWidgetClass, wOptionsDialog, XmNheight, 290, XmNwidth, 550, NULL); Widget wOptionsRC = XtVaCreateManagedWidget("optionsrc", xmRowColumnWidgetClass, wOptionsForm, XmNtopAttachment, XmATTACH_FORM, XmNtopOffset, 10, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNpacking, XmPACK_COLUMN, XmNnumColumns, 6, XmNorientation, XmHORIZONTAL, NULL); int ii; Widget wid; char buffer[20], *str = 0; for(ii = 0; ii < 6; ++ii) { switch(ii) { case 0: sprintf(buffer, "%d", gridW); str = buffer; break; case 1: sprintf(buffer, "%d", lineW); str = buffer; break; case 2: str = XUnitText; break; case 3: str = YUnitText; break; case 4: str = formatX; break; case 5: str = formatY; break; } wOptionsWidgets[ii] = wid = XtVaCreateManagedWidget(firstColumnText[ii], xmToggleButtonGadgetClass, wOptionsRC, XmNset, tbool[ii], NULL); AddStaticCallback(wid, XmNvalueChangedCallback, &XYPlotWin::CBdoOptionsToggleButton, (XtPointer) ii); XtVaCreateManagedWidget(secondColumnText[ii], xmLabelGadgetClass, wOptionsRC, NULL); wid = XtVaCreateManagedWidget(NULL, xmTextWidgetClass, wOptionsRC, XmNeditMode, XmSINGLE_LINE_EDIT, XmNvalue, str, NULL); wOptionsWidgets[7+ii] = wid; } XtManageChild(wOptionsRC); Widget wOkButton = XtVaCreateManagedWidget(" Ok ", xmPushButtonGadgetClass, wOptionsForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_FORM, XmNleftOffset, WOFFSET, NULL); AddStaticCallback(wOkButton, XmNactivateCallback, &XYPlotWin::CBdoOptionsOKButton, (XtPointer) 1); Widget wApplyButton = XtVaCreateManagedWidget(" Apply ", xmPushButtonGadgetClass, wOptionsForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wOkButton, XmNleftOffset, WOFFSET, NULL); //AddStaticCallback(wApplyButton, XmNactivateCallback, //&XYPlotWin::CBdoOptionsOKButton, (XtPointer) 0); Widget wCancelButton = XtVaCreateManagedWidget(" Cancel ", xmPushButtonGadgetClass, wOptionsForm, XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wApplyButton, XmNleftOffset, WOFFSET, NULL); AddStaticCallback(wCancelButton, XmNactivateCallback, &XYPlotWin::CBdoOptionsOKButton, (XtPointer) 0); wid = XtVaCreateManagedWidget("Save as Default", xmToggleButtonGadgetClass, wOptionsForm, XmNset, tbool[6], XmNbottomAttachment, XmATTACH_FORM, XmNbottomOffset, WOFFSET + 4, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, wCancelButton, XmNleftOffset, 2 * WOFFSET, NULL); wOptionsWidgets[6] = wid; AddStaticCallback(wid, XmNvalueChangedCallback, &XYPlotWin::CBdoOptionsToggleButton, (XtPointer) 6); XtManageChild(wOptionsForm); } XtPopup(wOptionsDialog, XtGrabNone); } // ------------------------------------------------------------------- void XYPlotWin::CBdoOptionsToggleButton(Widget, XtPointer data, XtPointer) { long which = (long) data; tbool[which] = 1 - tbool[which]; } // ------------------------------------------------------------------- void XYPlotWin::CBdoOptionsOKButton(Widget, XtPointer data, XtPointer) { long which = (long) data; if(which == 1) { markQ = tbool[0]; tickQ = tbool[1]; axisQ = tbool[2]; boundBoxQ = tbool[3]; plotLinesQ = tbool[4]; dispHintsQ = tbool[5]; saveDefaultQ = tbool[6]; parameters->Set_Parameter("Markers", BOOL, (markQ ? "on" : "off")); parameters->Set_Parameter("Ticks", BOOL, (tickQ ? "on" : "off")); parameters->Set_Parameter("TickAxis", BOOL, (axisQ ? "on" : "off")); parameters->Set_Parameter("BoundBox", BOOL, (boundBoxQ ? "on" : "off")); parameters->Set_Parameter("PlotLines", BOOL, (plotLinesQ ? "on" : "off")); parameters->Set_Parameter("DisplayHints", BOOL, (dispHintsQ ? "on" : "off")); char *input; int temp; input = XmTextGetString(wOptionsWidgets[7]); if(sscanf(input, "%d", &temp) != 0 && temp >= 0 && temp <= 10) { parameters->Set_Parameter("GridWidth", INT, input); gridW = temp; } XtFree(input); input = XmTextGetString(wOptionsWidgets[8]); if(sscanf(input, "%d", &temp) != 0 && temp >= 0 && temp <= 10) { parameters->Set_Parameter("LineWidth", INT, input); lineW = temp; } XtFree(input); delete [] XUnitText; delete [] YUnitText; delete [] formatX; delete [] formatY; input = XmTextGetString(wOptionsWidgets[9]); XUnitText = new char[strlen(input) + 1]; strcpy(XUnitText, input); XtFree(input); input = XmTextGetString(wOptionsWidgets[10]); YUnitText = new char[strlen(input) + 1]; strcpy(YUnitText, input); XtFree(input); input = XmTextGetString(wOptionsWidgets[11]); formatX = new char[strlen(input) + 1]; strcpy(formatX, input); XtFree(input); input = XmTextGetString(wOptionsWidgets[12]); formatY = new char[strlen(input) + 1]; strcpy(formatY, input); XtFree(input); if(whichType == XDIR) { parameters->Set_Parameter("XUnitTextX", STR, XUnitText); } else if(whichType == YDIR) { parameters->Set_Parameter("XUnitTextY", STR, XUnitText); } else { parameters->Set_Parameter("XUnitTextZ", STR, XUnitText); } parameters->Set_Parameter("YUnitText", STR, YUnitText); parameters->Set_Parameter("FormatX", STR, formatX); parameters->Set_Parameter("FormatY", STR, formatY); CBdoRedrawPlot(None, NULL, NULL); for(XYPlotLegendItem *ptr = legendHead; ptr; ptr = ptr->next) { XClearWindow(disp, XtWindow(ptr->wid)); CBdoDrawLegendItem(None, ptr, NULL); } if(saveDefaultQ) { int winX, winY; XtVaGetValues(wPlotWin, XmNwidth, &winX, XmNheight, &winY, NULL); char buf[20], buf2[20]; sprintf(buf, "%d", winX); parameters->Set_Parameter("InitialWindowWidth", INT, buf); sprintf(buf, "%d", winY); parameters->Set_Parameter("InitialWindowHeight", INT, buf); XtVaGetValues(wXYPlotTopLevel, XmNx, &winX, XmNy, &winY, NULL); sprintf(buf, "%d", winX); sprintf(buf2, "%d", winY); if(whichType == XDIR) { parameters->Set_Parameter("InitialXWindowOffsetX", INT, buf); parameters->Set_Parameter("InitialXWindowOffsetY", INT, buf2); } else if(whichType == YDIR){ parameters->Set_Parameter("InitialYWindowOffsetX", INT, buf); parameters->Set_Parameter("InitialYWindowOffsetY", INT, buf2); } else{ parameters->Set_Parameter("InitialZWindowOffsetX", INT, buf); parameters->Set_Parameter("InitialZWindowOffsetY", INT, buf2); } parameters->WriteToFile(".XYPlot.Defaults"); } } else { tbool[0] = markQ; tbool[1] = tickQ; tbool[2] = axisQ; tbool[3] = boundBoxQ; tbool[4] = plotLinesQ; tbool[5] = dispHintsQ; tbool[6] = saveDefaultQ; for(int ii(0); ii != 7; ++ii) { XmToggleButtonSetState(wOptionsWidgets[ii], tbool[ii], false); } XmTextSetString(wOptionsWidgets[8], XUnitText); XmTextSetString(wOptionsWidgets[9], YUnitText); XmTextSetString(wOptionsWidgets[10], formatX); XmTextSetString(wOptionsWidgets[11], formatY); } char buffer[20]; sprintf(buffer, "%d", gridW); XmTextSetString(wOptionsWidgets[7], buffer); sprintf(buffer, "%d", lineW); XmTextSetString(wOptionsWidgets[8], buffer); //XtPopdown(wOptionsDialog); XtDestroyWidget(wOptionsDialog); wOptionsDialog = None; } // ------------------------------------------------------------------- void XYPlotWin::CBdoSelectDataList(Widget, XtPointer data, XtPointer call_data) { XYPlotLegendItem *item = (XYPlotLegendItem *) data; XmDrawingAreaCallbackStruct *cbs = (XmDrawingAreaCallbackStruct *) call_data; if(cbs->event->xany.type == ButtonRelease && cbs->event->xbutton.button == 1) { if(item->drawQ) { item->drawQ = 0; --numDrawnItems; XtVaSetValues(item->frame, XmNtopShadowColor, backgroundPix, XmNbottomShadowColor, backgroundPix, NULL); if( ! animatingQ) { lloX = lloY = DBL_MAX; hhiX = hhiY = -DBL_MAX; for(XYPlotLegendItem *ptr = legendHead; ptr; ptr = ptr->next) { if(ptr->drawQ) { updateBoundingBox(ptr->XYPLIlist); } } } } else { item->drawQ = 1; ++numDrawnItems; XtVaSetValues(item->frame, XmNtopShadowColor, foregroundPix, XmNbottomShadowColor, foregroundPix, NULL); if( ! animatingQ) { updateBoundingBox(item->XYPLIlist); } } if( ! animatingQ) { if( ! zoomedInQ) { setBoundingBox(); } CBdoRedrawPlot(None, NULL, NULL); } return; } if(animatingQ) { return; } if(cbs->event->xany.type == ButtonPress && cbs->event->xbutton.button != 1) { XmMenuPosition(item->menu, &cbs->event->xbutton); XtManageChild(item->menu); return; } } // ------------------------------------------------------------------- void XYPlotWin::CBdoRemoveDataList(Widget, XtPointer client_data, XtPointer call_data) { if(animatingQ) { return; } XYPlotLegendItem *item = (XYPlotLegendItem *) client_data; XYPlotLegendItem *ptr; if(item == colorChangeItem) { colorChangeItem = NULL; } if((ptr = item->next) != NULL) { if((ptr->prev = item->prev) != NULL) { item->prev->next = ptr; XtVaSetValues(ptr->frame, XmNtopWidget, item->prev->frame, NULL); } else { legendHead = ptr; XtVaSetValues(ptr->frame, XmNtopWidget, wLegendMenu, NULL); } if(item->XYPLIlist->copied_from == NULL && ptr->XYPLIlist->copied_from == item->XYPLIlist) { ptr->XYPLIlist->copied_from = NULL; item->XYPLIlist->copied_from = ptr->XYPLIlist; for(XYPlotLegendItem *ptr2 = ptr->next; ptr2 && ptr2->XYPLIlist->copied_from == item->XYPLIlist; ptr2 = ptr2->next) { ptr2->XYPLIlist->copied_from = ptr->XYPLIlist; } } } else if((legendTail = item->prev) != NULL) { item->prev->next = NULL; } else { legendHead = NULL; } char mask = 0x1 << item->color; lineFormats[item->style] &= ~mask; --numItems; if(item->drawQ) { --numDrawnItems; lloX = lloY = DBL_MAX; hhiX = hhiY = -DBL_MAX; for(ptr = legendHead; ptr; ptr = ptr->next) { if(ptr->drawQ) { updateBoundingBox(ptr->XYPLIlist); } } if( ! zoomedInQ) { setBoundingBox(); } CBdoRedrawPlot(None, NULL, NULL); } XtDestroyWidget(item->frame); delete item->XYPLIlist; delete item; } // ------------------------------------------------------------------- void XYPlotWin::CBdoCopyDataList(Widget, XtPointer data, XtPointer) { if(animatingQ) { return; } XYPlotLegendItem *item = (XYPlotLegendItem *) data; AddDataList(new XYPlotDataList(item->XYPLIlist), item); } // ------------------------------------------------------------------- void XYPlotWin::CBdoSetListLevel(Widget, XtPointer data, XtPointer) { if(animatingQ) { return; } XYMenuCBData *cbd = (XYMenuCBData *) data; XYPlotLegendItem *item = cbd->item; item->XYPLIlist->SetLevel(cbd->which); XClearWindow(disp, XtWindow(item->wid)); CBdoDrawLegendItem(None, item, NULL); if(item->drawQ) { lloX = lloY = DBL_MAX; hhiX = hhiY = -DBL_MAX; for(item = legendHead; item; item = item->next) { if(item->drawQ) { updateBoundingBox(item->XYPLIlist); } } if( ! zoomedInQ) { setBoundingBox(); } CBdoRedrawPlot(None, NULL, NULL); } } // ------------------------------------------------------------------- void XYPlotWin::SetPalette(void) { Palette *pal = pltParent->GetPalettePtr(); pal->SetWindowPalette(pltParent->GetPaletteName(), XtWindow(wXYPlotTopLevel)); pal->SetWindowPalette(pltParent->GetPaletteName(), pWindow); char buffer[20]; params param_temp; // temporary parameter grabbing slot for(int idx(0); idx < 8; ++idx) { sprintf(buffer, "%d.Color", idx); int icTemp(PM_INT(buffer)); const Array &cCells = pal->GetColorCells(); icTemp = max(0, min(icTemp, cCells.size() - 1)); AllAttrs[idx].pixelValue = cCells[icTemp].pixel; } for(XYPlotLegendItem *item = legendHead; item; item = item->next) { pal->SetWindowPalette(pltParent->GetPaletteName(), XtWindow(item->wid)); } } // ------------------------------------------------------------------- void XYPlotWin::CBdoInitializeListColorChange(Widget, XtPointer data, XtPointer) { XYPlotLegendItem *item = (XYPlotLegendItem *) data; Widget wPalArea = pltParent->GetPalArea(); if(pltParent->PaletteCBQ()) { XtRemoveCallback(wPalArea, XmNinputCallback, (XtCallbackProc) XYPlotWin::StaticCallback, NULL); } pltParent->SetPaletteCBQ(); colorChangeItem = item; AddStaticCallback(wPalArea, XmNinputCallback, &XYPlotWin::CBdoSetListColor); XtPopup(pltParent->WId(), XtGrabNone); } // ------------------------------------------------------------------- void XYPlotWin::CBdoSetListColor(Widget, XtPointer, XtPointer call_data) { if(colorChangeItem && ! animatingQ) { XmDrawingAreaCallbackStruct *cbs = (XmDrawingAreaCallbackStruct *) call_data; if(cbs->event->xany.type == ButtonPress) { int totalColorSlots = pltParent->GetPalettePtr()->PaletteSize(); int cy = ((totalColorSlots - 1) - cbs->event->xbutton.y) + 14; if(cy >= 0 && cy <= (totalColorSlots - 1)) { colorChangeItem->pixel = AllAttrs[colorChangeItem->color].pixelValue = pltParent->GetPalettePtr()->GetColorCells()[cy].pixel; XtPopup(wXYPlotTopLevel, XtGrabNone); CBdoRedrawPlot(None, NULL, NULL); CBdoDrawLegendItem(None, (void *) colorChangeItem, NULL); } } } } // ------------------------------------------------------------------- void XYPlotWin::CBdoSelectAllData(Widget, XtPointer, XtPointer) { numDrawnItems = numItems; for(XYPlotLegendItem *ptr = legendHead; ptr; ptr = ptr->next) { if( ! ptr->drawQ) { ptr->drawQ = 1; XtVaSetValues(ptr->frame, XmNtopShadowColor, foregroundPix, XmNbottomShadowColor, foregroundPix, NULL); if( ! animatingQ) { updateBoundingBox(ptr->XYPLIlist); } } } if( ! animatingQ) { if( ! zoomedInQ) { setBoundingBox(); } } CBdoRedrawPlot(None, NULL, NULL); } // ------------------------------------------------------------------- void XYPlotWin::CBdoDeselectAllData(Widget, XtPointer, XtPointer) { numDrawnItems = 0; for(XYPlotLegendItem *ptr = legendHead; ptr; ptr = ptr->next) { if(ptr->drawQ) { ptr->drawQ = 0; XtVaSetValues(ptr->frame, XmNtopShadowColor, backgroundPix, XmNbottomShadowColor, backgroundPix, NULL); } } if( ! animatingQ) { lloX = lloY = DBL_MAX; hhiX = hhiY = -DBL_MAX; } CBdoRedrawPlot(None, NULL, NULL); } // ------------------------------------------------------------------- void XYPlotWin::drawHint(void) { if(devInfo.areaW < 50 * devInfo.axisW) { return; } XClearArea(disp, pWindow, 20 * devInfo.axisW, 0, 0, (5 * devInfo.axisH) / 2, false); switch(iCurrHint) { case 0: textX(wPlotWin, devInfo.areaW - 5, devInfo.bdrPad, "Left click to zoom in.", T_UPPERRIGHT, T_AXIS); if(zoomedInQ) { textX(wPlotWin, devInfo.areaW - 5, devInfo.bdrPad + devInfo.axisH, "Right click to zoom out.", T_UPPERRIGHT, T_AXIS); } break; case 1: textX(wPlotWin, devInfo.areaW - 5, devInfo.bdrPad, "Left click on legend items to toggle draw.", T_UPPERRIGHT, T_AXIS); textX(wPlotWin, devInfo.areaW - 5, devInfo.bdrPad + devInfo.axisH, "Right click to select options.", T_UPPERRIGHT, T_AXIS); break; } } // ------------------------------------------------------------------- void XYPlotWin::CBdoDrawLocation(Widget, XtPointer, XtPointer data) { if(devInfo.areaW < iXLocWinX + 15 * devInfo.axisW) { return; } XEvent *event = (XEvent *) data; if(event->type == LeaveNotify) { if(dispHintsQ) { iCurrHint = 1; drawHint(); } XClearArea(disp, pWindow, 0, iXLocWinY, iXLocWinX, 0, false); } else { if(dispHintsQ && iCurrHint != 0) { iCurrHint = 0; drawHint(); } Window whichRoot, whichChild; int rootX, rootY, newX, newY; unsigned int inputMask; XQueryPointer(disp, pWindow, &whichRoot, &whichChild, &rootX, &rootY, &newX, &newY, &inputMask); if(newX <= iXOppX && newX >= iXOrgX && newY <= iXOppY && newY >= iXOrgY) { char locText[40]; sprintf(locText, "(%.4E, %.4E)", TRANX(newX), TRANY(newY)); XClearArea(disp, pWindow, 0, iXLocWinY, iXLocWinX, 0, false); textX(wPlotWin, devInfo.bdrPad, devInfo.areaH - devInfo.bdrPad, locText, T_LOWERLEFT, T_AXIS); } else { XClearArea(disp, pWindow, 0, iXLocWinY, iXLocWinX, 0, false); } } } // ------------------------------------------------------------------- void XYPlotWin::CBdoRubberBanding(Widget, XtPointer, XtPointer call_data) { int rStartX, oldX, anchorX, newX, rWidth, rootX; int rStartY, oldY, anchorY, newY, rHeight, rootY; double lowX, lowY, highX, highY; XEvent nextEvent; int servingButton; bool rectDrawn; Window whichRoot, whichChild; char locText[30]; unsigned int inputMask; // find which view from the widget w XmDrawingAreaCallbackStruct *cbs = (XmDrawingAreaCallbackStruct *) call_data; // FIXME: XSetForeground(disp, rbGC, 120); if(cbs->event->xany.type == ButtonPress) { servingButton = cbs->event->xbutton.button; if(servingButton != 1) { if(zoomedInQ) { zoomedInQ = 0; setBoundingBox(); CBdoRedrawPlot(None, NULL, NULL); } return; } oldX = newX = anchorX = max(0, cbs->event->xbutton.x); oldY = newY = anchorY = max(0, cbs->event->xbutton.y); rectDrawn = false; // grab server and draw box(es) XChangeActivePointerGrab(disp, ButtonMotionMask | OwnerGrabButtonMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | PointerMotionHintMask, zoomCursor, CurrentTime); AVXGrab avxGrab(disp); lowX = TRANX(anchorX); lowY = TRANY(anchorY); if(devInfo.areaW >= 2 * iXLocWinX + 15 * devInfo.axisW) { sprintf(locText, "(%.4E, %.4E)", lowX, lowY); XClearArea(disp, pWindow, iXLocWinX, iXLocWinY, iXLocWinX, 0, false); textX(wPlotWin, iXLocWinX + devInfo.bdrPad, devInfo.areaH - devInfo.bdrPad, locText, T_LOWERLEFT, T_AXIS); } while(true) { if(devInfo.areaW >= iXLocWinX + 15 * devInfo.axisW) { sprintf(locText, "(%.4E, %.4E)", TRANX(newX), TRANX(newY)); XClearArea(disp, pWindow, 0, iXLocWinY, iXLocWinX, 0, false); textX(wPlotWin, devInfo.bdrPad, devInfo.areaH - devInfo.bdrPad, locText, T_LOWERLEFT, T_AXIS); } XNextEvent(disp, &nextEvent); switch(nextEvent.type) { case MotionNotify: if(rectDrawn) { // undraw the old rectangle(s) rWidth = abs(oldX-anchorX); rHeight = abs(oldY-anchorY); rStartX = (anchorX < oldX) ? anchorX : oldX; rStartY = (anchorY < oldY) ? anchorY : oldY; XDrawRectangle(disp, pWindow, rbGC, rStartX, rStartY, rWidth, rHeight); } // get rid of those pesky extra MotionNotify events while(XCheckTypedEvent(disp, MotionNotify, &nextEvent)) { ; // do nothing } XQueryPointer(disp, pWindow, &whichRoot, &whichChild, &rootX, &rootY, &newX, &newY, &inputMask); rWidth = abs(newX-anchorX); // draw the new rectangle rHeight = abs(newY-anchorY); rStartX = (anchorX < newX) ? anchorX : newX; rStartY = (anchorY < newY) ? anchorY : newY; XDrawRectangle(disp, pWindow, rbGC, rStartX, rStartY, rWidth, rHeight); rectDrawn = true; oldX = newX; oldY = newY; break; case ButtonRelease: avxGrab.ExplicitUngrab(); // giveitawaynow // undraw rectangle rWidth = abs(oldX-anchorX); rHeight = abs(oldY-anchorY); rStartX = (anchorX < oldX) ? anchorX : oldX; rStartY = (anchorY < oldY) ? anchorY : oldY; XDrawRectangle(disp, pWindow, rbGC, rStartX, rStartY, rWidth, rHeight); highX = TRANX(newX); highY = TRANY(newY); if((anchorX - newX != 0) && (anchorY - newY != 0)) { // Figure out relative bounding box if(lowX > highX) { double temp; temp = highX; highX = lowX; lowX = temp; } if(lowY > highY) { double temp; temp = highY; highY = lowY; lowY = temp; } zoomedInQ = 1; setBoundingBox(lowX, lowY, highX, highY); CBdoRedrawPlot(None, NULL, NULL); } else if((anchorX - newX == 0) && (anchorY - newY == 0)) { if(newX >= iXOrgX && newX <= iXOppX && newY >= iXOrgY && newY <= iXOppY) { highX = (loX + hiX) / 2 - highX; highY = (loY + hiY) / 2 - highY; loX -= highX; hiX -= highX; loY -= highY; hiY -= highY; zoomedInQ = 1; CBdoRedrawPlot(None, NULL, NULL); } } if(devInfo.areaW > iXLocWinX + 15 * devInfo.axisW) { if(devInfo.areaW > 2*iXLocWinX + 15 * devInfo.axisW) { XClearArea(disp, pWindow, 0, iXLocWinY, 2*iXLocWinX, 0, false); } else { XClearArea(disp, pWindow, 0, iXLocWinY, iXLocWinX, 0, false); } sprintf(locText, "(%.4E, %.4E)", TRANX(newX), TRANY(newY)); textX(wPlotWin, devInfo.bdrPad, devInfo.areaH - devInfo.bdrPad, locText, T_LOWERLEFT, T_AXIS); } return; default: ; // do nothing break; } // end switch } // end while(true) } } // end CBdoRubberBanding // ------------------------------------------------------------------- void XYPlotWin::CBdoDrawLegendItem(Widget, XtPointer data, XtPointer) { XYPlotLegendItem *item = (XYPlotLegendItem *) data; XYPlotDataList *dataList = item->XYPLIlist; XSegment legLine; char legendText[1024]; #if (BL_SPACEDIM == 3) sprintf(legendText, "%d/%d %s", dataList->curLevel, dataList->maxLevel, dataList->derived.c_str()); textX(item->wid, 5, 10, legendText, T_UPPERLEFT, T_AXIS); textX(item->wid, 5, 10 + devInfo.axisH, dataList->intersectPoint[dataList->curLevel], T_UPPERLEFT, T_AXIS); #else sprintf(legendText, "%d/%d %s %s", dataList->curLevel, dataList->maxLevel, dataList->derived.c_str(), dataList->intersectPoint[dataList->curLevel]); textX(item->wid, 5, 10, legendText, T_UPPERLEFT, T_AXIS); #endif legLine.x1 = 5; legLine.x2 = 85; legLine.y1 = legLine.y2 = 5; if(plotLinesQ) { segX(item->wid, 1, &legLine, lineW, L_VAR, item->style, item->pixel); } if(markQ) { dotX(item->wid, 45, 5, item->style, item->pixel); } } // ------------------------------------------------------------------- void XYPlotWin::AddStaticCallback(Widget w, String cbtype, memberXYCB cbf, void *data) { XYCBData *cbs = new XYCBData(this, data, cbf); // xycbdPtrs.push_back(cbs) int nSize(xycbdPtrs.size()); xycbdPtrs.resize(nSize + 1); xycbdPtrs[nSize] = cbs; XtAddCallback(w, cbtype, (XtCallbackProc) &XYPlotWin::StaticCallback, (XtPointer) cbs); } // ------------------------------------------------------------------- void XYPlotWin::AddStaticWMCallback(Widget w, Atom cbtype, memberXYCB cbf, void *data) { XYCBData *cbs = new XYCBData(this, data, cbf); // xycbdPtrs.push_back(cbs) int nSize(xycbdPtrs.size()); xycbdPtrs.resize(nSize + 1); xycbdPtrs[nSize] = cbs; XmAddWMProtocolCallback(w, cbtype, (XtCallbackProc) &XYPlotWin::StaticCallback, (XtPointer) cbs); } // ------------------------------------------------------------------- void XYPlotWin::AddStaticEventHandler(Widget w, EventMask mask, memberXYCB cbf, void *data) { XYCBData *cbs = new XYCBData(this, data, cbf); // xycbdPtrs.push_back(cbs) int nSize(xycbdPtrs.size()); xycbdPtrs.resize(nSize + 1); xycbdPtrs[nSize] = cbs; XtAddEventHandler(w, mask, false, (XtEventHandler) &XYPlotWin::StaticEvent, (XtPointer) cbs); } // ------------------------------------------------------------------- void XYPlotWin::StaticCallback(Widget w, XtPointer client_data, XtPointer call_data) { XYCBData *cbs = (XYCBData *) client_data; XYPlotWin *obj = cbs->instance; (obj->*(cbs->cbFunc))(w, (XtPointer) cbs->data, call_data); } // ------------------------------------------------------------------- void XYPlotWin::StaticEvent(Widget w, XtPointer client_data, XEvent *event, char *) { XYCBData *cbs = (XYCBData *) client_data; XYPlotWin *obj = cbs->instance; (obj->*(cbs->cbFunc))(w, (XtPointer) cbs->data, (XtPointer) event); } // ------------------------------------------------------------------- void CBcloseXYPlotWin(Widget w, XtPointer client_data, XtPointer) { XYPlotWin *win = (XYPlotWin *) client_data; delete win; } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Palette.H0000644000175000017500000001301211634153073021004 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Palette.H,v 1.29 2003/02/28 02:01:37 vince Exp $ // // --------------------------------------------------------------- // Palette.H // --------------------------------------------------------------- #ifndef _PALETTE_H #define _PALETTE_H #include #include using std::map; using std::string; #include "REAL.H" #include "Array.H" #include "Array.H" const int PALLISTLENGTH = 8; const int PALWIDTH = 24; const int TEXTCOLOR = 224; const int TOTALPALHEIGHT = 280; const int TOTALPALWIDTH = 150; #include class GraphicsAttributes; enum PaletteType { ALPHA, NON_ALPHA }; class Palette { protected: Array ccells; map mcells; Pixmap palPixmap; int totalPalWidth, palWidth, totalPalHeight; Array dataList; Window palWindow; Colormap colmap; int totalColorSlots, colorSlots; int reserveSystemColors, colorOffset, paletteStart; Pixel blackIndex, whiteIndex, bodyIndex; Real pmin, pmax; string defaultFormat; Array transferArray; unsigned char *remapTable; // for remapping to a smaller color index set GraphicsAttributes *gaPtr; Array sysccells; bool bReadPalette; static Colormap systemColmap; PaletteType paletteType; Array abuff; Array rbuff; Array gbuff; Array bbuff; public: Palette(Widget &w, int datalistlength, int width, int totalwidth, int totalheight, int reservesystemcolors); Palette(int datalistlength, int width, int totalwidth, int totalheight, int reservesystemcolors); ~Palette(); PaletteType GetPaletteType() { return paletteType; } Array GetTransferArray() { return transferArray; } int ReadSeqPalette(const string &fileName, bool bRedraw = true); void Draw(Real palMin, Real palMax, const string &numberFormat); void SetWindow(Window drawPaletteHere); void SetWindowPalette(const string &palName, Window newPalWindow, bool bRedraw = true); void ChangeWindowPalette(const string &palName, Window newPalWindow); void ExposePalette(); void Redraw(); void SetReserveSystemColors(int reservesystemcolors); void SetFormat(const string &newFormat); Colormap GetColormap() const { return colmap; } const Array &GetColorCells() const { return ccells; } const map &GetColorCellsMap() const { return mcells; } Pixel BlackIndex() const; Pixel WhiteIndex() const; Pixel BodyIndex() const; int ColorSlots() const { return colorSlots; } int PaletteStart() const { return paletteStart; } int PaletteEnd() const { return totalColorSlots - 1; } int PaletteSize() const { return totalColorSlots; } int PaletteWidth() const { return totalPalWidth; } int PaletteHeight() const { return totalPalHeight; } unsigned int SafePaletteIndex(unsigned int atlevel = 0) const; Real PaletteMin() const { return pmin; } Real PaletteMax() const { return pmax; } const Array &PaletteDataList() const { return dataList; } string PaletteNumberFormat() { return defaultFormat; } XImage *GetPictureXImage(); unsigned char *RemapTable() const { return remapTable; } const Array &theABuff() const { return abuff; } const Array &theRBuff() const { return rbuff; } const Array &theGBuff() const { return gbuff; } const Array &theBBuff() const { return bbuff; } unsigned char theABuff(int i) const { return abuff[i]; } unsigned char theRBuff(int i) const { return rbuff[i]; } unsigned char theGBuff(int i) const { return gbuff[i]; } unsigned char theBBuff(int i) const { return bbuff[i]; } Pixel pixelate(int i) const; void unpixelate(Pixel p, unsigned char &r, unsigned char &g, unsigned char& b) const; Pixel makePixel(unsigned char index) const; private: void ReadPalette(const string &palNam, bool bRedraw = true); Palette(Widget &w); }; #endif // --------------------------------------------------------------- // --------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/PltAppOutput.cpp0000644000175000017500000003015311634153073022427 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: PltAppOutput.cpp,v 1.33 2003/02/28 02:01:38 vince Exp $ // // --------------------------------------------------------------- // PltAppOutput.cpp // --------------------------------------------------------------- #include #include #include #include #include "PltApp.H" #include "PltAppState.H" #include "DataServices.H" #include "ProjectionPicture.H" #include "Output.H" using std::cout; using std::cerr; using std::endl; using std::min; using std::max; using std::strcpy; // ------------------------------------------------------------------- void PltApp::DoOutput(Widget w, XtPointer data, XtPointer) { int i; static Widget wGetFileName; XmString sMessage; sMessage = XmStringCreateSimple("Please enter a filename base:"); i=0; XtSetArg(args[i], XmNselectionLabelString, sMessage); ++i; XtSetArg(args[i], XmNautoUnmanage, false); ++i; XtSetArg(args[i], XmNkeyboardFocusPolicy, XmPOINTER); ++i; wGetFileName = XmCreatePromptDialog(wAmrVisTopLevel, "Save as", args, i); XmStringFree(sMessage); unsigned long which = (unsigned long) data; switch(which) { case 0: AddStaticCallback(wGetFileName, XmNokCallback,&PltApp::DoCreatePSFile); break; case 1: AddStaticCallback(wGetFileName, XmNokCallback,&PltApp::DoCreateRGBFile); break; case 2: AddStaticCallback(wGetFileName, XmNokCallback,&PltApp::DoCreateFABFile); break; default: cerr << "Error in PltApp::DoOutput: bad selection = " << data << endl; return; } XtAddCallback(wGetFileName, XmNcancelCallback, (XtCallbackProc)XtDestroyWidget, NULL); XtSetSensitive(XmSelectionBoxGetChild(wGetFileName, XmDIALOG_HELP_BUTTON), false); char tempstr[BUFSIZ], tempfilename[BUFSIZ]; if(animating2d) { strcpy(tempfilename, AVGlobals::StripSlashes(fileNames[currentFrame]).c_str()); } else { strcpy(tempfilename, AVGlobals::StripSlashes(fileNames[0]).c_str()); } sprintf(tempstr, "%s_%s", pltAppState->CurrentDerived().c_str(), tempfilename); XmTextSetString(XmSelectionBoxGetChild(wGetFileName, XmDIALOG_TEXT), tempstr); XtManageChild(wGetFileName); XtPopup(XtParent(wGetFileName), XtGrabNone); } // end DoOutput // ------------------------------------------------------------------- void PltApp::DoCreatePSFile(Widget w, XtPointer, XtPointer call_data) { XmSelectionBoxCallbackStruct *cbs = (XmSelectionBoxCallbackStruct *) call_data; char psfilename[BUFSIZ]; char *fileNameBase; int imageSizeX, imageSizeY; XImage *printImage; int minDrawnLevel(pltAppState->MinDrawnLevel()); int maxDrawnLevel(pltAppState->MaxDrawnLevel()); if(animating2d) { ResetAnimation(); } XmStringGetLtoR(cbs->value, XmSTRING_DEFAULT_CHARSET, &fileNameBase); // write the ZPLANE picture sprintf(psfilename, "%s_XY.ps", fileNameBase); printImage = amrPicturePtrArray[ZPLANE]->GetPictureXImage(); imageSizeX = amrPicturePtrArray[ZPLANE]->ImageSizeH(); imageSizeY = amrPicturePtrArray[ZPLANE]->ImageSizeV(); WritePSFile(psfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); #ifndef NDEBUG const AmrData &amrData = dataServicesPtr[currentFrame]->AmrDataRef(); sprintf(psfilename, "%s_XY_new.ps", fileNameBase); bool bDrawBoxesIntoImage(false); printImage = amrPicturePtrArray[ZPLANE]->GetPictureXImage(bDrawBoxesIntoImage); Array< Array > gridBoxes; amrPicturePtrArray[ZPLANE]->GetGridBoxes(gridBoxes, minDrawnLevel, maxDrawnLevel); WriteNewPSFile(psfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr, amrData, minDrawnLevel, maxDrawnLevel, gridBoxes); #endif #if (BL_SPACEDIM==3) // write the YPLANE picture sprintf(psfilename, "%s_XZ.ps", fileNameBase); printImage = amrPicturePtrArray[YPLANE]->GetPictureXImage(); imageSizeX = amrPicturePtrArray[YPLANE]->ImageSizeH(); imageSizeY = amrPicturePtrArray[YPLANE]->ImageSizeV(); WritePSFile(psfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); // write the XPLANE picture sprintf(psfilename, "%s_YZ.ps", fileNameBase); printImage = amrPicturePtrArray[XPLANE]->GetPictureXImage(); imageSizeX = amrPicturePtrArray[XPLANE]->ImageSizeH(); imageSizeY = amrPicturePtrArray[XPLANE]->ImageSizeV(); WritePSFile(psfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); // write the iso picture #ifdef BL_VOLUMERENDER if( ! (XmToggleButtonGetState(wAutoDraw) || showing3dRender ) ) { printImage = projPicturePtr->DrawBoxesIntoPixmap(minDrawnLevel, maxDrawnLevel); } else { printImage = projPicturePtr->GetPictureXImage(); } #else printImage = projPicturePtr->DrawBoxesIntoPixmap(minDrawnLevel, maxDrawnLevel); #endif sprintf(psfilename, "%s_XYZ.ps", fileNameBase); imageSizeX = projPicturePtr->ImageSizeH(); imageSizeY = projPicturePtr->ImageSizeV(); WritePSFile(psfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); # endif // write the palette sprintf(psfilename, "%s_pal.ps", fileNameBase); printImage = pltPaletteptr->GetPictureXImage(); imageSizeX = pltPaletteptr->PaletteWidth(); imageSizeY = pltPaletteptr->PaletteHeight(); const Array &pValueList = pltPaletteptr->PaletteDataList(); string pNumFormat(pltPaletteptr->PaletteNumberFormat()); WritePSPaletteFile(psfilename, printImage, imageSizeX, imageSizeY, pValueList, pNumFormat, *pltPaletteptr); XtFree(fileNameBase); XtDestroyWidget(w); } // end DoCreatePSFile // ------------------------------------------------------------------- void PltApp::DoCreateRGBFile(Widget w, XtPointer, XtPointer call_data) { XmSelectionBoxCallbackStruct *cbs = (XmSelectionBoxCallbackStruct *) call_data; char rgbfilename[BUFSIZ]; char *fileNameBase; int imageSizeX, imageSizeY; XImage *printImage; if(animating2d) { ResetAnimation(); } XmStringGetLtoR(cbs->value, XmSTRING_DEFAULT_CHARSET, &fileNameBase); // write the ZPLANE picture char suffix[4]; if ( AVGlobals::IsSGIrgbFile() ) { strcpy(suffix, "rgb"); } else { strcpy(suffix, "ppm"); } sprintf(rgbfilename, "%s_XY.%s", fileNameBase,suffix); printImage = amrPicturePtrArray[ZPLANE]->GetPictureXImage(); imageSizeX = amrPicturePtrArray[ZPLANE]->ImageSizeH(); imageSizeY = amrPicturePtrArray[ZPLANE]->ImageSizeV(); if ( AVGlobals::IsSGIrgbFile() ) { WriteRGBFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } else { WritePPMFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } #if (BL_SPACEDIM==3) // write the YPLANE picture sprintf(rgbfilename, "%s_XZ.%s", fileNameBase, suffix); printImage = amrPicturePtrArray[YPLANE]->GetPictureXImage(); imageSizeX = amrPicturePtrArray[YPLANE]->ImageSizeH(); imageSizeY = amrPicturePtrArray[YPLANE]->ImageSizeV(); if ( AVGlobals::IsSGIrgbFile() ) { WriteRGBFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } else { WritePPMFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } // write the XPLANE picture sprintf(rgbfilename, "%s_YZ.%s", fileNameBase, suffix); printImage = amrPicturePtrArray[XPLANE]->GetPictureXImage(); imageSizeX = amrPicturePtrArray[XPLANE]->ImageSizeH(); imageSizeY = amrPicturePtrArray[XPLANE]->ImageSizeV(); if ( AVGlobals::IsSGIrgbFile() ) { WriteRGBFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } else { WritePPMFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } // write the iso picture int minDrawnLevel(pltAppState->MinDrawnLevel()); int maxDrawnLevel(pltAppState->MaxDrawnLevel()); #ifdef BL_VOLUMERENDER if( ! (XmToggleButtonGetState(wAutoDraw) || showing3dRender )) { printImage = projPicturePtr->DrawBoxesIntoPixmap(minDrawnLevel, maxDrawnLevel); } else { printImage = projPicturePtr->GetPictureXImage(); } #else printImage = projPicturePtr->DrawBoxesIntoPixmap(minDrawnLevel, maxDrawnLevel); #endif sprintf(rgbfilename, "%s_XYZ.%s", fileNameBase, suffix); imageSizeX = projPicturePtr->ImageSizeH(); imageSizeY = projPicturePtr->ImageSizeV(); if ( AVGlobals::IsSGIrgbFile() ) { WriteRGBFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } else { WritePPMFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } # endif // write the palette sprintf(rgbfilename, "%s_pal.%s", fileNameBase, suffix); printImage = pltPaletteptr->GetPictureXImage(); imageSizeX = pltPaletteptr->PaletteWidth(); imageSizeY = pltPaletteptr->PaletteHeight(); if ( AVGlobals::IsSGIrgbFile() ) { WriteRGBFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } else { WritePPMFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } XtFree(fileNameBase); XtDestroyWidget(w); } // end DoCreateRGBFile // ------------------------------------------------------------------- void PltApp::DoCreateFABFile(Widget w, XtPointer, XtPointer call_data) { XmSelectionBoxCallbackStruct *cbs = (XmSelectionBoxCallbackStruct *) call_data; char fabfilename[BUFSIZ]; char *fileNameBase; XmStringGetLtoR(cbs->value, XmSTRING_DEFAULT_CHARSET, &fileNameBase); sprintf(fabfilename, "%s.fab", fileNameBase); string fabFileName(fabfilename); //int minDrawnLevel(pltAppState->MinDrawnLevel()); int maxDrawnLevel(pltAppState->MaxDrawnLevel()); string derivedQuantity(pltAppState->CurrentDerived()); Array bx = amrPicturePtrArray[0]->GetSubDomain(); DataServices::Dispatch(DataServices::WriteFabOneVar, dataServicesPtr[currentFrame], (void *) &fabFileName, (void *) &(bx[maxDrawnLevel]), maxDrawnLevel, (void *) &derivedQuantity); XtFree(fileNameBase); XtDestroyWidget(w); } // end DoCreateFABFile // ------------------------------------------------------------------- void PltApp::DoCreateAnimRGBFile() { char rgbfilename[BUFSIZ]; int imageSizeX, imageSizeY; XImage *printImage; ResetAnimation(); char suffix[4]; if ( AVGlobals::IsSGIrgbFile() ) { strcpy(suffix, "rgb"); } else { strcpy(suffix, "ppm"); } sprintf(rgbfilename, "%s_%s.%s", pltAppState->CurrentDerived().c_str(), AVGlobals::StripSlashes(fileNames[currentFrame]).c_str(), suffix); cout << "******* Creating file: " << rgbfilename << endl; // write the picture printImage = amrPicturePtrArray[ZPLANE]->GetPictureXImage(); imageSizeX = amrPicturePtrArray[ZPLANE]->ImageSizeH(); imageSizeY = amrPicturePtrArray[ZPLANE]->ImageSizeV(); if ( AVGlobals::IsSGIrgbFile() ) { WriteRGBFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } else { WritePPMFile(rgbfilename, printImage, imageSizeX, imageSizeY, *pltPaletteptr); } } // end DoCreateAnimRGBFile // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/Quaternion.cpp0000644000175000017500000001007711634153073022136 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Quaternion.cpp,v 1.12 2002/02/19 20:39:41 vince Exp $ // // --------------------------------------------------------------- // Quaternion.cpp // --------------------------------------------------------------- #include #include "Quaternion.H" // --------------------------------------------------------------- // These constructors reduce smoothly to the identity when the input // points are the same, but will generate Realing-point errors if // they are diametrically opposite and the rotation axis is ill-defined. // --------------------------------------------------------------- // --------------------------------------------------------------- AmrQuaternion::AmrQuaternion(const AmrSpherePoint &s1, const AmrSpherePoint &s2) { Real c(s1 * s2); // cosine of rotation angle Real xn(Y(s1) * Z(s2) - Z(s1) * Y(s2)); // unnormalized axis of rotation Real yn(Z(s1) * X(s2) - X(s1) * Z(s2)); Real zn(X(s1) * Y(s2) - Y(s1) * X(s2)); Real ch(sqrt(0.5 * (1.0 + c))); // cosine of half rotation angle Real chTemp(0.5 / ch); w = ch; x = xn * chTemp; y = yn * chTemp; z = zn * chTemp; } // --------------------------------------------------------------- // defines the quaternion that rotates (x1,y1,z1) to (x2,y2,z2) // --------------------------------------------------------------- AmrQuaternion::AmrQuaternion(Real x1,Real y1,Real z1,Real x2,Real y2,Real z2) { Real c(x1 * x2 + y1 * y2 + z1 * z2); // cosine of rotation angle Real xn(y1 * z2 - z1 * y2); // unnormalized axis of rotation Real yn(z1 * x2 - x1 * z2); Real zn(x1 * y2 - y1 * x2); Real ch(sqrt(0.5 * (1.0 + c))); // cosine of half rotation angle Real chTemp(0.5 / ch); w = ch; x = xn * chTemp; y = yn * chTemp; z = zn * chTemp; } // --------------------------------------------------------------- void AmrQuaternion::tomatrix( Real m[4][4] ) const { Real wx(w * x); Real wy(w * y); Real wz(w * z); Real xz(x * z); Real yz(y * z); Real xy(x * y); Real xx(x * x); Real yy(y * y); Real zz(z * z); m[0][0] = 1.-2.*(yy+zz); m[0][1] = 2.*(xy-wz); m[0][2] = 2.*(xz+wy); m[1][0] = 2.*(xy+wz); m[1][1]= 1.-2.*(zz+xx); m[1][2] = 2.*(yz-wx); m[2][0] = 2.*(xz-wy); m[2][1] = 2.*(yz+wx); m[2][2] = 1.-2.*(yy+xx); m[0][3] = m[1][3] = m[2][3] = 0.0; m[3][0] = m[3][1] = m[3][2] = 0.0; m[3][3] = 1.0; } // --------------------------------------------------------------- Real AmrQuaternion::InfNorm() const { Real mat[4][4]; this->tomatrix(mat); Real max(0.0); Real sum(0.0); for(int i = 0; i < 3; ++i) { sum = mat[i][0] + mat[i][1] + mat[i][2]; max = (sum > max ? sum : max ); } return max; } // --------------------------------------------------------------- // --------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/OpenSource.txt0000644000175000017500000002434711634153073022135 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: AmrVis Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/pAmrvis/AmrPicture.H0000644000175000017500000001666011634153073021475 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrPicture.H,v 1.44 2002/12/10 20:12:23 vince Exp $ // // --------------------------------------------------------------- // AmrPicture.H // --------------------------------------------------------------- #ifndef _AMRPICTURE_H #define _AMRPICTURE_H #include #include "REAL.H" #include "Box.H" #include "AmrvisConstants.H" #include "GlobalUtilities.H" #include "GridPicture.H" #include "Array.H" #include "FArrayBox.H" #include using std::string; #include #include class PltApp; class PltAppState; class DataServices; class GraphicsAttributes; class Palette; struct GridBoxes { int xbox, ybox, wbox, hbox; }; enum VectorDerived { enVelocity, enMomentum, enNoneFound }; class AmrPicture { public: AmrPicture(GraphicsAttributes *gaptr, PltApp *pltappptr, PltAppState *pltappstateptr, DataServices *dataservicesptr, bool bcartgridsmoothing); // construct an AmrPicture using data from filename // 3D: called by first XY view AmrPicture(int view, GraphicsAttributes *gaptr, const Box ®ion, //AmrPicture *parentPicturePtr, PltApp *parentPltAppPtr, PltApp *pltappptr, PltAppState *pltappstateptr, bool bcartgridsmoothing); // construct an AmrPicture using pointer to data & box ~AmrPicture(); void DoFrameUpdate(); void DoContourSweep(); void DoStop(); // removes TimeOutCallback, updates GridPictures void SetRegion(int, int, int, int); void CreatePicture(Window drawPictureHere, Palette *palptr); void APDraw(int fromLevel, int toLevel); void DrawSlice(int); void DoExposePicture(); void APMakeImages(Palette *palptr); void APChangeScale(int newScale, int previousScale); void APChangeLevel(); XImage *GetPictureXImage(const bool bdrawboxesintoimage = true); void APChangeSlice(int here); void SetSubCut(int, int, int, int); void ToggleShowSubCut(); void DrawDatasetPoint(int hplot, int vplot, int size); void UnDrawDatasetPoint(); void Sweep(AnimDirection direction); void SetHVLine(int scale); void SetHLine(int hl) { hLine = hl; } void SetVLine(int vl) { vLine = vl; } int GetHLine() const { return hLine; } int GetVLine() const { return vLine; } int GetSlice() const { return slice; } unsigned int ImageSizeH() const { return imageSizeH; } unsigned int ImageSizeV() const { return imageSizeV; } void SetDataServicesPtr(DataServices *tothis) { dataServicesPtr = tothis; } void SetHColor(int c) { hColor = c; } void SetVColor(int c) { vColor = c; } const Box &GetSliceBox(int level) const { return sliceBox[level]; } int GetMyView() const { return myView; } const Array &GetSubDomain() const { return subDomain; } void SetFrameSpeed(int toThis) { frameSpeed = toThis; } Window PictureWindow() { return pictureWindow; } void SetCartGridSmoothing(bool tf) { bCartGridSmoothing = tf; } void APChangeContour(ContourType prevCType); void GetGridBoxes(Array< Array > &gb, const int minlev, const int maxlev); private: Window pictureWindow; int numberOfLevels; Array dataSize, dataSizeH, dataSizeV; unsigned int imageSize, imageSizeH, imageSizeV; int hdspoint, vdspoint, dsBoxSize; int datasetPointShowing, datasetPointColor; Pixmap pixMap; Array< Array > gpArray; Array< Array< Array > > frameGrids; int regionX, regionY, region2ndX, region2ndY; int subCutShowing; int subcutX, subcutY, subcut2ndX, subcut2ndY; Array subDomain; Array sliceBox; Array frameBuffer; bool framesMade; int frameSpeed; AnimDirection sweepDirection; XtIntervalId pendingTimeOut; Palette *palPtr; Array sliceFab; Array vfSliceFab; Array imageData, scaledImageData; Array xImageArray; Array xImageCreated; GraphicsAttributes *gaPtr; PltApp *pltAppPtr; PltAppState *pltAppStatePtr; DataServices *dataServicesPtr; Display *display; GC xgc; int myView, hLine, vLine; int maxLevelWithGrids; int hColor, vColor, myColor, slice, sliceDir; bool bCartGridSmoothing; bool pixMapCreated, isSubDomain, findSubRange; // private functions void SetSlice(int view, int here); void CoarsenSliceBox(); void ShowFrameImage(int iSlice); void CreateFrames(AnimDirection direction); void AmrPictureInit(); void DrawBoxes(Array< Array > &gp, Drawable &drawable); void DrawTerrBoxes(int level, bool bIsWindow, bool bIsPixmap); void CreateImage(const FArrayBox &fab, unsigned char *imagedata, int datasizeh, int datasizev, Real globalMin, Real globalMax, Palette *palptr, const FArrayBox *vfracFab, const Real vfeps); void CreateScaledImage(XImage **ximage, int scale, unsigned char *imagedata, unsigned char *scaledimagedata, int datasizeh, int datasizev, int imagesizeh, int imagesizev); void DrawContour(Array slicefab, Display *display, Drawable &drawable, const GC &gc); bool DrawContour(const FArrayBox &fab, Real value, bool has_mask, const bool *mask, Display *display, Drawable &drawable, const GC &gc, int FGColor, int xLength, int yLength, Real leftEdge, Real bottomEdge, Real rightEdge, Real topEdge); inline bool Between(Real a, Real b, Real c) { return ( (a <= b) && (b <= c) || (a >= b) && (b >= c) ); } void DrawVectorField(Display *display, Drawable &drawable, const GC &gc); void DrawVectorField(Display *display, Drawable &drawable, const GC &gc, int hDir, int vDir, int maxLength, const Real *hdat, const Real *vdat, const Real velocityMax, const Box &dvfSliceBox, int dvfFactor); VectorDerived FindVectorDerived(Array &aVectorDeriveNames); static void CBFrameTimeOut(XtPointer, XtIntervalId *); static void CBContourSweep(XtPointer, XtIntervalId *); }; #endif ccseapps-2.5/CCSEApps/pAmrvis/Volume.H0000644000175000017500000000443311634153073020664 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Volume.H,v 1.16 2000/10/02 20:53:11 lijewski Exp $ // // --------------------------------------------------------------- // Volume.H // --------------------------------------------------------------- #ifndef _VOLUME_H_ #define _VOLUME_H_ #ifdef BL_VOLUMERENDER #include #else #define VP_NORM_MAX 7923 /* maximum value of a 13 bit normal */ #endif #define SWF_HEADER 62 /* bytes of header in file */ typedef struct { /* contents of a voxel */ short normal; /* encoded surface normal vector */ //the short is unused in the non-lighting model unsigned char density; /* original density */ unsigned char gradient; /* original gradient */ //gradient becomes the normal in the non-lighting model } RawVoxel; #define DENSITY_PARAM 0 /* classification parameters */ #define OCTREE_DENSITY_THRESH 4 #define GRADIENT_PARAM 1 #define OCTREE_GRADIENT_THRESH 4 #define OCTREE_BASE_NODE_SIZE 4 #define BYTES_PER_VOXEL sizeof(RawVoxel) // voxel size in bytes #endif ccseapps-2.5/CCSEApps/pAmrvis/GraphicsAttributes.cpp0000644000175000017500000001035011634153073023612 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: GraphicsAttributes.cpp,v 1.15 2001/10/17 17:53:33 lijewski Exp $ // // --------------------------------------------------------------- // GraphicsAttributes.cpp // --------------------------------------------------------------- #include #include using std::cerr; using std::endl; #include "GraphicsAttributes.H" #include #include #include #undef index // ------------------------------------------------------------------- unsigned long buildShift(unsigned long mask) { unsigned long shift(0); while( ! (mask & 1)) { mask >>= 1; ++shift; } return shift; } // ------------------------------------------------------------------- GraphicsAttributes::GraphicsAttributes(Widget topLevel) : appTopLevel(topLevel) { display = XtDisplay(topLevel); screen = XtScreen(topLevel); screennumber = DefaultScreen(display); int status = XMatchVisualInfo(display, DefaultScreen(display), 8, PseudoColor, &visual_info); if(status != 0) { visual = visual_info.visual; depth = 8; red_shift = blue_shift = green_shift = 0; } else { int status = XMatchVisualInfo(display, DefaultScreen(display), DefaultDepth(display, screennumber), TrueColor, &visual_info); if(status != 0) { visual = visual_info.visual; depth = DefaultDepth(display, screennumber); red_shift = buildShift(visual_info.red_mask); green_shift = buildShift(visual_info.green_mask); blue_shift = buildShift(visual_info.blue_mask); } else if( status == 0 ) { BoxLib::Abort("Error: bad XMatchVisualInfo: no PseudoColor Visual."); } } gc = screen->default_gc; root = RootWindow(display, DefaultScreen(display)); bytesPerPixel = CalculateNBP(); } // ------------------------------------------------------------------- int GraphicsAttributes::PBitmapPaddedWidth(int width) const { return (1+(width-1)/(BitmapPad(display)/8))*BitmapPad(display)/8; } // ------------------------------------------------------------------- // return number of bytes per pixel this display uses int GraphicsAttributes::CalculateNBP() { int planes = DisplayPlanes(display, DefaultScreen(display)); if(planes <= 8) { return(1); } if(planes <= 16) { return(2); } if(planes <= 32) { return(4); } return(1); } /* CalculateNBP() */ // ------------------------------------------------------------------- ostream& operator<<(ostream &os, const GraphicsAttributes &ga) { return os << "(" << "red_shift = " << ga.PRedShift() << ", " << "green_shift = " << ga.PGreenShift() << ", " << "blue_shift = " << ga.PBlueShift() << ", " << "red_mask = " << ga.PRedMask() << ", " << "green_mask = " << ga.PGreenMask() << ", " << "blue_mask = " << ga.PBlueMask() << ", " << "bits_per_rgb = " << ga.PBitsPerRGB() << ")"; } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/AmrVisTool.cpp0000644000175000017500000004633111634153073022052 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrVisTool.cpp,v 1.61 2002/12/10 20:12:23 vince Exp $ // // --------------------------------------------------------------- // AmrVisTool.cpp // --------------------------------------------------------------- #include // X/Motif headers #include #include #include #include // BoxLib has index member functions, Xos might define it (LessTif). #undef index #include "MessageArea.H" #include "GraphicsAttributes.H" #include "Palette.H" #include "PltApp.H" #include "GlobalUtilities.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #ifdef BL_VOLUMERENDER #include "VolRender.H" #endif #ifdef BL_USE_ARRAYVIEW #include "ArrayView.H" #endif using std::cout; using std::cerr; using std::endl; using std::min; using std::max; const int OPENITEM = 0; const int QUITITEM = 1; //const int SETITEM = 0; //const int HELPITEM = 0; void CreateMainWindow(int argc, char *argv[]); void BatchFunctions(); // CallBack functions void CBFileMenu(Widget, XtPointer, XtPointer); void CBOpenPltFile(Widget, XtPointer, XtPointer); XtAppContext app; Widget wTopLevel, wTextOut, wDialog; Widget wMainWindow, wMenuBar; Arg args[32]; cMessageArea messageText; char buffer[BUFSIZ]; XmString sDirectory = XmStringCreateSimple("none"); list pltAppList; //-------------------------------------------------------------- void PrintMessage(char *message) { sprintf(buffer, "%s", message); messageText.PrintText(buffer); } //-------------------------------------------------------------- int main(int argc, char *argv[]) { Box comlineBox; string comlineFileName; //BoxLib::Initialize(argc,argv); // here we trick boxlib int argcNoPP(1); BoxLib::Initialize(argcNoPP, argv); AVGlobals::GetDefaults("amrvis.defaults"); //GetLightingDefaults("amrvis.lighting"); AVGlobals::ParseCommandLine(argc, argv); if(AVGlobals::Verbose()) { AmrData::SetVerbose(true); } AmrData::SetSkipPltLines(AVGlobals::GetSkipPltLines()); AmrData::SetStaticBoundaryWidth(AVGlobals::GetBoundaryWidth()); if(AVGlobals::SleepTime() > 0) { sleep(AVGlobals::SleepTime()); } if(AVGlobals::GivenBox()) { comlineBox = AVGlobals::GetBoxFromCommandLine(); } if(AVGlobals::GetFabOutFormat() == 8) { DataServices::SetFabOutSize(8); } if(AVGlobals::GetFabOutFormat() == 32) { DataServices::SetFabOutSize(32); } bool bBatchMode(false); if(AVGlobals::MakeSWFData() || AVGlobals::DumpSlices() || AVGlobals::GivenBoxSlice()) { bBatchMode = true; } if(bBatchMode && AVGlobals::IsAnimation()) { BoxLib::Abort("Batch mode and animation mode are incompatible."); } if(AVGlobals::GivenBox()) { BoxLib::Abort("Command line subbox not supported yet."); } if(bBatchMode) { DataServices::SetBatchMode(); BatchFunctions(); //ParallelDescriptor::EndParallel(); BoxLib::Finalize(); } else { if(ParallelDescriptor::IOProcessor()) { CreateMainWindow(argc, argv); } if(AVGlobals::IsAnimation()) { BL_ASSERT(AVGlobals::GetFileCount() > 0); bool bAmrDataOk(true); FileType fileType = AVGlobals::GetDefaultFileType(); BL_ASSERT(fileType != INVALIDTYPE); Array dspArray(AVGlobals::GetFileCount()); for(int nPlots = 0; nPlots < AVGlobals::GetFileCount(); ++nPlots) { comlineFileName = AVGlobals::GetComlineFilename(nPlots); dspArray[nPlots] = new DataServices(comlineFileName, fileType); if(ParallelDescriptor::IOProcessor()) { dspArray[nPlots]->IncrementNumberOfUsers(); } if( ! dspArray[nPlots]->AmrDataOk()) { bAmrDataOk = false; } } if(ParallelDescriptor::IOProcessor()) { if(bAmrDataOk) { PltApp *temp = new PltApp(app, wTopLevel, AVGlobals::GetComlineFilename(0), dspArray, AVGlobals::IsAnimation()); if(temp == NULL) { cerr << "Error: could not make a new PltApp." << endl; for(int nPlots = 0; nPlots < AVGlobals::GetFileCount(); ++nPlots) { dspArray[nPlots]->DecrementNumberOfUsers(); } } else { pltAppList.push_back(temp); } } else { if(ParallelDescriptor::IOProcessor()) { for(int nPlots = 0; nPlots < AVGlobals::GetFileCount(); ++nPlots) { dspArray[nPlots]->DecrementNumberOfUsers(); } } } } } else { // loop through the command line list of plot files FileType fileType = AVGlobals::GetDefaultFileType(); BL_ASSERT(fileType != INVALIDTYPE); for(int nPlots(0); nPlots < AVGlobals::GetFileCount(); ++nPlots) { comlineFileName = AVGlobals::GetComlineFilename(nPlots); if(ParallelDescriptor::IOProcessor()) { cout << endl << "FileName = " << comlineFileName << endl; } Array dspArray(1); dspArray[0] = new DataServices(comlineFileName, fileType); if(ParallelDescriptor::IOProcessor()) { if(dspArray[0]->AmrDataOk()) { PltApp *temp = new PltApp(app, wTopLevel, comlineFileName, dspArray, AVGlobals::IsAnimation()); if(temp == NULL) { cerr << "Error: could not make a new PltApp." << endl; } else { pltAppList.push_back(temp); dspArray[0]->IncrementNumberOfUsers(); } } } } // end for(nPlots...) } // end if(AVGlobals::IsAnimation()) if(ParallelDescriptor::IOProcessor()) { XtAppMainLoop(app); } else { // all other processors wait for a request DataServices::Dispatch(DataServices::InvalidRequestType, NULL, NULL); } } // end if(bBatchMode) return 0; } // end main() // --------------------------------------------------------------- void CreateMainWindow(int argc, char *argv[]) { int i; string comlineFileName; String fallbacks[] = {"*fontList:variable=charset", NULL }; wTopLevel = XtVaAppInitialize(&app, "AmrVisTool", NULL, 0, (int *) &argc, argv, fallbacks, XmNx, 350, XmNy, 10, XmNwidth, 500, XmNheight, 150, NULL); GraphicsAttributes *theGAPtr = new GraphicsAttributes(wTopLevel); if(theGAPtr->PVisual() != XDefaultVisual(theGAPtr->PDisplay(), theGAPtr->PScreenNumber())) { Colormap colormap = XCreateColormap(theGAPtr->PDisplay(), RootWindow(theGAPtr->PDisplay(), theGAPtr->PScreenNumber()), theGAPtr->PVisual(), AllocNone); XtVaSetValues(wTopLevel, XmNvisual, theGAPtr->PVisual(), XmNdepth, 8, XmNcolormap, colormap, NULL); } wMainWindow = XtVaCreateManagedWidget ("mainWindow", xmFormWidgetClass, wTopLevel, XmNscrollBarDisplayPolicy, XmAS_NEEDED, XmNscrollingPolicy, XmAUTOMATIC, NULL); XmString sFile = XmStringCreateSimple("File"); XmString sOpen = XmStringCreateSimple("Open..."); XmString sQuit = XmStringCreateSimple("Quit"); wMenuBar = XmVaCreateSimpleMenuBar(wMainWindow, "menuBar", XmVaCASCADEBUTTON, sFile, 'F', XmNtopAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNheight, 30, NULL); XmString sCtrlQ = XmStringCreateSimple("Ctrl+Q"); XmString sCtrlO = XmStringCreateSimple("Ctrl+O"); XmVaCreateSimplePulldownMenu(wMenuBar, "fileMenu", 0, (XtCallbackProc) CBFileMenu, XmVaPUSHBUTTON, sOpen, 'O', "CtrlO", sCtrlO, //XmVaSEPARATOR, // the separator is buggy in old versions of motif XmVaPUSHBUTTON, sQuit, 'Q', "CtrlQ", sCtrlQ, NULL); XmStringFree(sFile); XmStringFree(sOpen); XmStringFree(sQuit); XmStringFree(sCtrlO); XmStringFree(sCtrlQ); XtManageChild(wMenuBar); i = 0; //XtSetArg(args[i], XmNrows, 20); ++i; //XtSetArg(args[i], XmNcolumns, 80); ++i; XtSetArg(args[i], XmNeditable, false); ++i; XtSetArg(args[i], XmNeditMode, XmMULTI_LINE_EDIT); ++i; XtSetArg(args[i], XmNwordWrap, true); ++i; XtSetArg(args[i], XmNscrollHorizontal, false); ++i; XtSetArg(args[i], XmNblinkRate, 0); ++i; XtSetArg(args[i], XmNautoShowCursorPosition, true); ++i; XtSetArg(args[i], XmNcursorPositionVisible, false); ++i; XtSetArg(args[i], XmNtopAttachment, XmATTACH_WIDGET); ++i; XtSetArg(args[i], XmNtopWidget, wMenuBar); ++i; XtSetArg(args[i], XmNleftAttachment, XmATTACH_FORM); ++i; XtSetArg(args[i], XmNrightAttachment, XmATTACH_FORM); ++i; XtSetArg(args[i], XmNbottomAttachment, XmATTACH_FORM); ++i; wTextOut = XmCreateScrolledText(wMainWindow, "textOut", args, i); XtManageChild(wTextOut); messageText.Init(wTextOut); //XmMainWindowSetAreas(wMainWindow, wMenuBar, NULL, NULL, NULL, wTextOut); XtRealizeWidget(wTopLevel); } // end CreateMainWindow() // --------------------------------------------------------------- void BatchFunctions() { string comlineFileName; // loop through the command line list of plot files for(int nPlots = 0; nPlots < AVGlobals::GetFileCount(); ++nPlots) { comlineFileName = AVGlobals::GetComlineFilename(nPlots); cout << "FileName = " << comlineFileName << endl; FileType fileType = AVGlobals::GetDefaultFileType(); BL_ASSERT(fileType != INVALIDTYPE); DataServices dataServices(comlineFileName, fileType); string derived(AVGlobals::GetInitialDerived()); if( ! dataServices.CanDerive(derived)) { if(ParallelDescriptor::IOProcessor()) { cerr << "Bad initial derived: cannot derive " << derived << endl; } derived = dataServices.PlotVarNames()[0]; if(ParallelDescriptor::IOProcessor()) { cerr << "Defaulting to " << derived << endl; } AVGlobals::SetInitialDerived(derived); } #if (BL_SPACEDIM == 3) #ifdef BL_VOLUMERENDER if(AVGlobals::MakeSWFData()) { AmrData &amrData = dataServices.AmrDataRef(); BL_ASSERT(dataServices.CanDerive(AVGlobals::GetInitialDerived())); int minDrawnLevel = 0; int maxDrawnLevel; if(AVGlobals::UseMaxLevel()) { maxDrawnLevel = max(0, min(AVGlobals::GetMaxLevel(), amrData.FinestLevel())); } else { maxDrawnLevel = amrData.FinestLevel(); } cout << "_in BatchFunctions: using max level = " << maxDrawnLevel << endl; Array drawDomain = amrData.ProbDomain(); int iPaletteStart(2); int iPaletteEnd(AVGlobals::MaxPaletteIndex()); int iBlackIndex(1); int iWhiteIndex(0); int iColorSlots(AVGlobals::MaxPaletteIndex() + 1 - iPaletteStart); Palette volPal(PALLISTLENGTH, PALWIDTH, TOTALPALWIDTH, TOTALPALHEIGHT, 0); cout << "_in BatchFunctions: palette name = " << AVGlobals::GetPaletteName() << endl; volPal.ReadSeqPalette(AVGlobals::GetPaletteName(), false); VolRender volRender(drawDomain, minDrawnLevel, maxDrawnLevel, &volPal, AVGlobals::GetLightingFileName()); Real dataMin, dataMax; if(AVGlobals::UseSpecifiedMinMax()) { AVGlobals::GetSpecifiedMinMax(dataMin, dataMax); } else { amrData.MinMax(drawDomain[maxDrawnLevel], AVGlobals::GetInitialDerived(), maxDrawnLevel, dataMin, dataMax); } volRender.MakeSWFData(&dataServices, dataMin, dataMax, AVGlobals::GetInitialDerived(), iPaletteStart, iPaletteEnd, iBlackIndex, iWhiteIndex, iColorSlots, PltApp::GetDefaultShowBoxes()); volRender.WriteSWFData(comlineFileName, AVGlobals::MakeSWFLight()); } #endif #endif if(AVGlobals::DumpSlices()) { if(AVGlobals::UseMaxLevel() == true) { dataServices.SetWriteToLevel(AVGlobals::GetMaxLevel()); } if(AVGlobals::SliceAllVars()) { for(int slicedir(0); slicedir < AVGlobals::GetDumpSlices().size(); ++slicedir) { for(list::iterator li = AVGlobals::GetDumpSlices()[slicedir].begin(); li != AVGlobals::GetDumpSlices()[slicedir].end(); ++li) { int slicenum = *li; DataServices::Dispatch(DataServices::DumpSlicePlaneAllVars, &dataServices, slicedir, slicenum); } } } else { for(int slicedir(0); slicedir < AVGlobals::GetDumpSlices().size(); ++slicedir) { for(list::iterator li = AVGlobals::GetDumpSlices()[slicedir].begin(); li != AVGlobals::GetDumpSlices()[slicedir].end(); ++li) { int slicenum = *li; DataServices::Dispatch(DataServices::DumpSlicePlaneOneVar, &dataServices, slicedir, slicenum, (void *) &derived); } } } } // end if(AVGlobals::DumpSlices()) if(AVGlobals::GivenBoxSlice()) { if(AVGlobals::UseMaxLevel() == true) { dataServices.SetWriteToLevel(AVGlobals::GetMaxLevel()); } Box comLineBox(AVGlobals::GetBoxFromCommandLine()); BL_ASSERT(comLineBox.ok()); if(AVGlobals::SliceAllVars()) { DataServices::Dispatch(DataServices::DumpSliceBoxAllVars, &dataServices, (void *) &comLineBox); } else { DataServices::Dispatch(DataServices::DumpSliceBoxOneVar, &dataServices, (void *) &comLineBox, (void *) &derived); } } // end if(AVGlobals::GivenBoxSlice()) } // end for(nPlots...) } // end BatchFunctions // --------------------------------------------------------------- void CBFileMenu(Widget, XtPointer client_data, XtPointer) { Arg args[MAXARGS]; int i = 0; unsigned long item = (unsigned long) client_data; if(item == QUITITEM) { for(list::iterator li = pltAppList.begin(); li != pltAppList.end(); ++li) { PltApp *obj = *li; Array dataServicesPtr = obj->GetDataServicesPtrArray(); for(int ids(0); ids < dataServicesPtr.size(); ++ids) { dataServicesPtr[ids]->DecrementNumberOfUsers(); } delete obj; } pltAppList.clear(); DataServices::Dispatch(DataServices::ExitRequest, NULL); } if(item == OPENITEM) { i = 0; FileType fileType(AVGlobals::GetDefaultFileType()); XmString sMask; if(fileType == FAB) { sMask = XmStringCreateSimple("*.fab"); } else if(fileType == MULTIFAB) { sMask = XmStringCreateSimple("*_H"); } else { sMask = XmStringCreateSimple("plt*"); } XmString sNone = XmStringCreateSimple("none"); if( ! XmStringCompare(sDirectory, sNone)) { XtSetArg (args[i], XmNdirectory, sDirectory); ++i; } XtSetArg (args[i], XmNpattern, sMask); ++i; XtSetArg (args[i], XmNfileTypeMask, XmFILE_ANY_TYPE); ++i; wDialog = XmCreateFileSelectionDialog(wTopLevel, "Open File", args, i); XtAddCallback(wDialog, XmNokCallback, (XtCallbackProc) CBOpenPltFile, NULL); XtAddCallback(wDialog, XmNcancelCallback, (XtCallbackProc) XtUnmanageChild, NULL); XmStringFree(sMask); XmStringFree(sNone); XtManageChild(wDialog); XtPopup(XtParent(wDialog), XtGrabExclusive); } } // --------------------------------------------------------------- void CBOpenPltFile(Widget w, XtPointer, XtPointer call_data) { char *filename(NULL); if( ! XmStringGetLtoR( ((XmFileSelectionBoxCallbackStruct*) call_data)->value, XmSTRING_DEFAULT_CHARSET, &filename)) { cerr << "CBOpenPltFile : system error" << endl; return; } FileType fileType(AVGlobals::GetDefaultFileType()); if(fileType == MULTIFAB) { // delete the _H from the filename if it is there const char *uH = "_H"; char *fm2 = filename + (strlen(filename) - 2); if(strcmp(uH, fm2) == 0) { filename[strlen(filename) - 2] = '\0'; } } char path[BUFSIZ]; strcpy(path, filename); int pathPos(strlen(path) - 1); while(pathPos > -1 && path[pathPos] != '/') { --pathPos; } path[pathPos + 1] = '\0'; sDirectory = XmStringCreateSimple(path); sprintf(buffer, "Selected file = %s\n", filename); messageText.PrintText(buffer); DataServices *dataServicesPtr = new DataServices(filename, AVGlobals::GetDefaultFileType()); DataServices::Dispatch(DataServices::NewRequest, dataServicesPtr, NULL); Array dspArray(1); dspArray[0] = dataServicesPtr; bool bIsAnim(false); PltApp *temp = new PltApp(app, wTopLevel, filename, dspArray, bIsAnim); if(temp == NULL) { cerr << "Error: could not make a new PltApp." << endl; } else { pltAppList.push_back(temp); dspArray[0]->IncrementNumberOfUsers(); } XtPopdown(XtParent(w)); } // --------------------------------------------------------------- void SubregionPltApp(Widget wTopLevel, const Box &trueRegion, const IntVect &offset, //AmrPicture *parentPicturePtr, PltApp *pltparent, const string &palfile, int isAnim, const string ¤tderived, const string &file) { PltApp *temp = new PltApp(app, wTopLevel, trueRegion, offset, pltparent, palfile, isAnim, currentderived, file); if(temp == NULL) { cerr << "Error in SubregionPltApp: could not make a new PltApp." << endl; } else { pltAppList.push_back(temp); Array dataServicesPtr = temp->GetDataServicesPtrArray(); for(int ids(0); ids < dataServicesPtr.size(); ++ids) { dataServicesPtr[ids]->IncrementNumberOfUsers(); } } } // --------------------------------------------------------------- void CBQuitPltApp(Widget ofPltApp, XtPointer client_data, XtPointer) { PltApp *obj = (PltApp *) client_data; pltAppList.remove(obj); Array &dataServicesPtr = obj->GetDataServicesPtrArray(); for(int ids(0); ids < dataServicesPtr.size(); ++ids) { dataServicesPtr[ids]->DecrementNumberOfUsers(); DataServices::Dispatch(DataServices::DeleteRequest, dataServicesPtr[ids], NULL); } delete obj; } // --------------------------------------------------------------- // --------------------------------------------------------------- ccseapps-2.5/CCSEApps/pAmrvis/MessageArea.cpp0000644000175000017500000000511611634153073022164 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MessageArea.cpp,v 1.5 2000/10/02 20:53:08 lijewski Exp $ // // --------------------------------------------------------------- // MessageArea.cpp // --------------------------------------------------------------- #include "MessageArea.H" // ------------------------------------------------------------------- cMessageArea::cMessageArea() { } // ------------------------------------------------------------------- cMessageArea::cMessageArea(Widget printTextHere) { wTextOut = printTextHere; currentTextPosition = 0; } // ------------------------------------------------------------------- void cMessageArea::Init(Widget printTextHere) { wTextOut = printTextHere; currentTextPosition = 0; } // ------------------------------------------------------------------- cMessageArea::~cMessageArea() { } // ------------------------------------------------------------------- void cMessageArea::PrintText(char *buffer) { strcpy(localBuffer, buffer); XmTextInsert(wTextOut, currentTextPosition, localBuffer); currentTextPosition += strlen(localBuffer); XtVaSetValues(wTextOut, XmNcursorPosition, currentTextPosition, NULL); XmTextShowPosition(wTextOut, currentTextPosition); } // ------------------------------------------------------------------- // ------------------------------------------------------------------- ccseapps-2.5/CCSEApps/pVarden/0000755000175000017500000000000011634153073017256 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/pVarden/Make.package0000644000175000017500000000143311634153073021451 0ustar amckinstryamckinstryCODE_C_SOURCES = \ main.cpp Grid.cpp \ hgproj.cpp \ multigrid.cpp diffuser.cpp \ macproj.cpp CODE_C_HEADERS = \ macproj.H hgproj.H Grid.H globals.H \ multigrid.H diffuser.H CODE_F_SOURCES = \ cmpdt_$(DIM)d.F \ hg_$(DIM)d.F \ laplac_$(DIM)d.F \ mac_$(DIM)d.F \ prob_$(DIM)d.F \ scalupd_$(DIM)d.F \ mkutrans_$(DIM)d.F \ mkdivu_$(DIM)d.F \ mkflux_$(DIM)d.F \ mkforce_$(DIM)d.F \ mkscalforce_$(DIM)d.F \ setscalbc_$(DIM)d.F \ setvelbc_$(DIM)d.F \ slopex_$(DIM)d.F \ slopey_$(DIM)d.F \ velupd_$(DIM)d.F \ visc_$(DIM)d.F ifeq ($(DIM),3) CODE_F_SOURCES += slopez_3d.F endif CODE_F_HEADERS = MACPROJ_F.H HGPROJ_F.H VISC_F.H GRID_F.H probdata.H CEXE_sources += $(CODE_C_SOURCES) FEXE_sources += $(CODE_F_SOURCES) CEXE_headers += $(CODE_C_HEADERS) FEXE_headers += $(CODE_F_HEADERS) ccseapps-2.5/CCSEApps/pVarden/probin10000644000175000017500000000010711634153073020551 0ustar amckinstryamckinstry $fortin prob_type = 1 velfact = 1.0 zero_dir = 3 $end ccseapps-2.5/CCSEApps/pVarden/laplac_3d.F0000644000175000017500000001272611634153073021217 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #if BL_USE_FLOAT #define twentyfive 25.e0 #define fifth 0.2 #else #define twentyfive 25.d0 #define fifth 0.2d0 #endif c ************************************************************************* c ** LAPLAC ** c ** Compute the viscous/diffusive terms for the momentum and scalar update c ** equations c ******************************************************************** subroutine laplac(u,lapu,areax,areay,areaz,vol,DIMS,dx,diff_coef,bc) implicit none integer DIMS REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T areax(lo_1 :hi_1+1,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T areay(lo_1 :hi_1 ,lo_2 :hi_2+1,lo_3 :hi_3 ) REAL_T areaz(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1) REAL_T vol(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T dx(3) REAL_T diff_coef integer bc(2,3) c Local variables REAL_T facx,facy,facz REAL_T ux_left,ux_left_wall REAL_T ux_rght,ux_rght_wall REAL_T uy_bot,uy_bot_wall REAL_T uy_top,uy_top_wall REAL_T uz_bot,uz_bot_wall REAL_T uz_top,uz_top_wall integer is, ie, js, je, ks, ke integer i,j,k is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 facx = one / (dx(1)*dx(1)) facy = one / (dx(2)*dx(2)) facz = one / (dx(3)*dx(3)) if (diff_coef .gt. zero) then do k = ks, ke do j = js, je do i = is, ie ux_left = (u(i,j,k) - u(i-1,j,k)) ux_left_wall = (-sixteen * u(is-1,j,k) + twenty * u(is,j,k) $ -five * u(is+1,j,k) + u(is+2,j,k) ) * fifth ux_left = cvmgt(ux_left_wall, ux_left, i .eq. is .and. $ (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) ) ux_left = areax(i,j,k) * ux_left / dx(1) ux_rght = (u(i+1,j,k) - u(i,j,k)) ux_rght_wall = -(-sixteen * u(ie+1,j,k) + twenty * u(ie,j,k) $ -five * u(ie-1,j,k) + u(ie-2,j,k) ) * fifth ux_rght = cvmgt(ux_rght_wall, ux_rght, i .eq. ie .and. $ (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) ) ux_rght = areax(i+1,j,k) * ux_rght / dx(1) uy_bot = (u(i,j,k) - u(i,j-1,k)) uy_bot_wall = (-sixteen * u(i,js-1,k) + twenty * u(i,js,k) $ -five * u(i,js+1,k) + u(i,js+2,k) ) * fifth uy_bot = cvmgt(uy_bot_wall, uy_bot, j .eq. js .and. $ (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) ) uy_bot = areay(i,j,k) * uy_bot / dx(2) uy_top = (u(i,j+1,k) - u(i,j,k)) uy_top_wall = -(-sixteen * u(i,je+1,k) + twenty * u(i,je,k) $ -five * u(i,je-1,k) + u(i,je-2,k) ) * fifth uy_top = cvmgt(uy_top_wall, uy_top, j .eq. je .and. $ (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) ) uy_top = areay(i,j+1,k) * uy_top / dx(2) uz_bot = (u(i,j,k) - u(i,j,k-1)) uz_bot_wall = (-sixteen * u(i,j,ks-1) + twenty * u(i,j,ks) $ -five * u(i,j,ks+1) + u(i,j,ks+2) ) * fifth uz_bot = cvmgt(uz_bot_wall, uz_bot, k .eq. ks .and. $ (BCZ_LO .eq. WALL .or. BCZ_LO .eq. INLET) ) uz_bot = areaz(i,j,k) * uz_bot / dx(3) uz_top = (u(i,j,k+1) - u(i,j,k)) uz_top_wall = -(-sixteen * u(i,j,ke+1) + twenty * u(i,j,ke) $ -five * u(i,j,ke-1) + u(i,j,ke-2) ) * fifth uz_top = cvmgt(uz_top_wall, uz_top, k .eq. ke .and. $ (BCZ_HI .eq. WALL .or. BCZ_HI .eq. INLET) ) uz_top = areaz(i,j,k+1) * uz_top / dx(3) lapu(i,j,k) = diff_coef * $ (ux_rght-ux_left+uy_top-uy_bot+uz_top-uz_bot) / vol(i,j,k) enddo enddo enddo else do k = ks, ke do j = js, je do i = is, ie lapu(i,j,k) = zero enddo enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/mkutrans_2d.F0000644000175000017500000001136611634153073021625 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKUTRANS ** c ** Construct the velocities to be used in defining transverse derivatives. c *************************************************************** subroutine FORT_MKUTRANS(utrans,vtrans,vel,velx,vely,force, $ dx,dt,DIMS,bc) implicit none integer DIMS REAL_T utrans(lo_1-1:hi_1+2,lo_2-1:hi_2+1) REAL_T vtrans(lo_1-1:hi_1+1,lo_2-1:hi_2+2) REAL_T vel(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) REAL_T velx(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T vely(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T dx(2) REAL_T dt integer bc(2,2) c Local variables REAL_T hx,hy,dth REAL_T ulft,urgt,vbot,vtop REAL_T eps integer i,j,is,js,ie,je logical test eps = 1.0e-8 is = lo_1 ie = hi_1 js = lo_2 je = hi_2 dth = half*dt hx = dx(1) hy = dx(2) c Create the x-velocity to be used for transverse derivatives. do j = js-1,je+1 do i = is,ie+1 urgt = vel(i ,j,1) - (half + dth*vel(i ,j,1)/hx) * velx(i ,j,1) c $ + dth * force(i ,j,1) ulft = vel(i-1,j,1) + (half - dth*vel(i-1,j,1)/hx) * velx(i-1,j,1) c $ + dth * force(i-1,j,1) urgt = cvmgt(vel(is-1,j,1),urgt,i.eq.is .and. BCX_LO .eq. INLET) urgt = cvmgt(vel(ie+1,j,1),urgt,i.eq.ie+1 .and. BCX_HI .eq. INLET) urgt = cvmgt(zero ,urgt,i.eq.is .and. BCX_LO .eq. WALL) urgt = cvmgt(zero ,urgt,i.eq.ie+1 .and. BCX_HI .eq. WALL) ulft = cvmgt(vel(is-1,j,1),ulft,i.eq.is .and. BCX_LO .eq. INLET) ulft = cvmgt(vel(ie+1,j,1),ulft,i.eq.ie+1 .and. BCX_HI .eq. INLET) ulft = cvmgt(zero ,ulft,i.eq.is .and. BCX_LO .eq. WALL) ulft = cvmgt(zero ,ulft,i.eq.ie+1 .and. BCX_HI .eq. WALL) utrans(i,j) = cvmgp(ulft,urgt,ulft+urgt) test = ( (ulft .le. zero .and. urgt .ge. zero) .or. $ (abs(ulft+urgt) .lt. eps) ) utrans(i,j) = cvmgt(zero,utrans(i,j),test) enddo enddo c Create the y-velocity to be used for transverse derivatives. do j = js,je+1 do i = is-1,ie+1 vtop = vel(i,j ,2) - (half + dth*vel(i,j ,2)/hy) * vely(i,j ,2) c $ + dth * force(i,j ,2) vbot = vel(i,j-1,2) + (half - dth*vel(i,j-1,2)/hy) * vely(i,j-1,2) c $ + dth * force(i,j-1,2) vtop = cvmgt(vel(i,js-1,2),vtop,j.eq.js .and. BCY_LO .eq. INLET) vtop = cvmgt(vel(i,je+1,2),vtop,j.eq.je+1 .and. BCY_HI .eq. INLET) vtop = cvmgt(zero ,vtop,j.eq.js .and. BCY_LO .eq. WALL) vtop = cvmgt(zero ,vtop,j.eq.je+1 .and. BCY_HI .eq. WALL) vbot = cvmgt(vel(i,js-1,2),vbot,j.eq.js .and. BCY_LO .eq. INLET) vbot = cvmgt(vel(i,je+1,2),vbot,j.eq.je+1 .and. BCY_HI .eq. INLET) vbot = cvmgt(zero ,vbot,j.eq.js .and. BCY_LO .eq. WALL) vbot = cvmgt(zero ,vbot,j.eq.je+1 .and. BCY_HI .eq. WALL) vtrans(i,j)=cvmgp(vbot,vtop,vbot+vtop) test = ( (vbot .le. zero .and. vtop .ge. zero) .or. $ (abs(vbot+vtop) .lt. eps)) vtrans(i,j) = cvmgt(zero,vtrans(i,j),test) enddo enddo return end ccseapps-2.5/CCSEApps/pVarden/inputs1.2d0000644000175000017500000002303011634153073021106 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 80 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 128 128 ############################################################################# # Maximum size of grid allowed. max_grid_size = 64 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin1 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030 (assuming plot_file_root is "plt"). # These plot files can be viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 0 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 1. 1. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/setvelbc_2d.F0000644000175000017500000001437211634153073021570 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** SETVELBC ** c ** Impose the physical boundary conditions on the velocity (u,v) c ************************************************************************* subroutine setvelbc(vel,DIMS,bc,irz,visc_coef,dx,time) implicit none integer DIMS REAL_T vel(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) integer bc(2,2) integer irz REAL_T visc_coef REAL_T dx(2) REAL_T time c Local variables integer is,ie,js,je,i,j integer ilo,ihi integer ng is = lo_1 ie = hi_1 js = lo_2 je = hi_2 c NOTE: IF BC == WALL, THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL c BOUNDARY, NOT IN THE GHOST CELL ilo = cvmgt(is-3,is,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) ihi = cvmgt(ie+3,ie,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) if (BCY_LO .eq. WALL) then do ng = 1,3 do i = ilo,ihi vel(i,js-ng,2) = zero enddo enddo do i = ilo,ihi vel(i,js-1,1) = (fifteen*vel(i,js ,1) - ten*vel(i,js+1,1) + $ three*vel(i,js+2,1)) / eight vel(i,js-2,1) = vel(i,js-1,1) vel(i,js-3,1) = vel(i,js-1,1) enddo if (visc_coef .gt. zero) then do ng = 1,3 do i = ilo,ihi vel(i,js-ng,1) = zero enddo enddo endif elseif (BCY_LO .eq. INLET) then call velinflow(vel(lo_1-3,lo_2-3,2),DIMS,time,dx,1,0) do ng = 1,3 do i = is-3,ie+3 vel(i,js-ng,1) = zero enddo enddo elseif (BCY_LO .eq. OUTLET) then do ng = 1,3 do i = ilo,ihi vel(i,js-ng,1) = vel(i,js,1) vel(i,js-ng,2) = vel(i,js,2) enddo enddo endif if (BCY_HI .eq. WALL) then do ng = 1,3 do i = ilo,ihi vel(i,je+ng,2) = zero enddo enddo do i = ilo,ihi vel(i,je+1,1) = (fifteen*vel(i,je ,1) - ten*vel(i,je-1,1) + $ three*vel(i,je-2,1)) / eight vel(i,je+2,1) = vel(i,je+1,1) vel(i,je+3,1) = vel(i,je+1,1) enddo if (visc_coef .gt. zero) then do ng = 1,3 do i = ilo,ihi vel(i,je+ng,1) = zero enddo enddo endif elseif (BCY_HI .eq. INLET) then call velinflow(vel(lo_1-3,lo_2-3,2),DIMS,time,dx,1,1) do ng = 1,3 do i = is-3,ie+3 vel(i,je+ng,1) = zero enddo enddo elseif (BCY_HI .eq. OUTLET) then do ng = 1,3 do i = ilo,ihi vel(i,je+ng,1) = vel(i,je,1) vel(i,je+ng,2) = vel(i,je,2) enddo enddo endif if (BCX_LO .eq. WALL) then do ng = 1,3 do j = js-3,je+3 vel(is-ng,j,1) = zero enddo enddo do j = js-3,je+3 vel(is-1,j,2) = (fifteen*vel(is ,j,2) - ten*vel(is+1,j,2) + $ three*vel(is+2,j,2)) / eight vel(is-2,j,2) = vel(is-1,j,2) vel(is-3,j,2) = vel(is-1,j,2) enddo if (visc_coef .gt. zero .and. irz .eq. 0) then do ng = 1,3 do j = js-3,je+3 vel(is-ng,j,2) = zero enddo enddo endif if (irz .eq. 1) then do ng = 1,3 do j = js-3,je+3 vel(is-ng,j,2) = vel(is+ng-1,j,2) enddo enddo endif elseif (BCX_LO .eq. INLET) then call velinflow(vel(lo_1-3,lo_2-3,1),DIMS,time,dx,0,0) do ng = 1,3 do j = js-3,je+3 vel(is-ng,j,2) = zero enddo enddo elseif (BCX_LO .eq. OUTLET) then do ng = 1,3 do j = js-3,je+3 vel(is-ng,j,1) = vel(is,j,1) vel(is-ng,j,2) = vel(is,j,2) enddo enddo endif if (BCX_HI .eq. WALL) then do ng = 1,3 do j = js-3,je+3 vel(ie+ng,j,1) = zero enddo enddo do j = js-3,je+3 vel(ie+1,j,2) = (fifteen*vel(ie ,j,2) - ten*vel(ie-1,j,2) + $ three*vel(ie-2,j,2)) / eight vel(ie+2,j,2) = vel(ie+1,j,2) vel(ie+3,j,2) = vel(ie+1,j,2) enddo if (visc_coef .gt. zero) then do ng = 1,3 do j = js-3,je+3 vel(ie+ng,j,2) = zero enddo enddo endif elseif (BCX_HI .eq. INLET) then call velinflow(vel(lo_1-3,lo_2-3,1),DIMS,time,dx,0,1) do ng = 1,3 do j = js-3,je+3 vel(ie+ng,j,2) = zero enddo enddo elseif (BCX_HI .eq. OUTLET) then do ng = 1,3 do j = js-3,je+3 vel(ie+ng,j,1) = vel(ie,j,1) vel(ie+ng,j,2) = vel(ie,j,2) enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/mkutrans_3d.F0000644000175000017500000001475411634153073021632 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKUTRANS ** c ** Construct the velocities to be used in defining transverse derivatives. c *************************************************************** subroutine FORT_MKUTRANS(utrans,vtrans,wtrans,vel,velx,vely,velz, $ force,dx,dt,DIMS,bc) implicit none integer DIMS REAL_T utrans(lo_1-1:hi_1+2,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T vtrans(lo_1-1:hi_1+1,lo_2-1:hi_2+2,lo_3-1:hi_3+1) REAL_T wtrans(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+2) REAL_T vel(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) REAL_T velx(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T vely(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T velz(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T dx(3) REAL_T dt integer bc(2,3) c Local variables REAL_T hx,hy,hz,dth REAL_T ulft,urgt REAL_T vbot,vtop REAL_T wbot,wtop REAL_T eps integer i,j,k,is,js,ks,ie,je,ke logical test eps = 1.0e-8 is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 dth = half*dt hx = dx(1) hy = dx(2) hz = dx(3) c Create the x-velocity to be used for transverse derivatives. do k = ks-1,ke+1 do j = js-1,je+1 do i = is,ie+1 urgt = vel(i,j,k ,1) - (half + dth*vel(i ,j,k,1)/hx) * velx(i ,j,k,1) c $ + dth * force(i ,j,k,1) ulft = vel(i-1,j,k,1) + (half - dth*vel(i-1,j,k,1)/hx) * velx(i-1,j,k,1) c $ + dth * force(i-1,j,k,1) urgt = cvmgt(vel(is-1,j,k,1),urgt,i.eq.is .and. BCX_LO .eq. INLET) urgt = cvmgt(vel(ie+1,j,k,1),urgt,i.eq.ie+1 .and. BCX_HI .eq. INLET) urgt = cvmgt(zero ,urgt,i.eq.is .and. BCX_LO .eq. WALL) urgt = cvmgt(zero ,urgt,i.eq.ie+1 .and. BCX_HI .eq. WALL) ulft = cvmgt(vel(is-1,j,k,1),ulft,i.eq.is .and. BCX_LO .eq. INLET) ulft = cvmgt(vel(ie+1,j,k,1),ulft,i.eq.ie+1 .and. BCX_HI .eq. INLET) ulft = cvmgt(zero ,ulft,i.eq.is .and. BCX_LO .eq. WALL) ulft = cvmgt(zero ,ulft,i.eq.ie+1 .and. BCX_HI .eq. WALL) utrans(i,j,k) = cvmgp(ulft,urgt,ulft+urgt) test=( (ulft .le. zero .and. urgt .ge. zero) .or. $ (abs(ulft+urgt) .lt. eps) ) utrans(i,j,k) = cvmgt(zero,utrans(i,j,k),test) enddo enddo enddo c Create the y-velocity to be used for transverse derivatives. do j = js,je+1 do k = ks-1,ke+1 do i = is-1,ie+1 vtop = vel(i,j ,k,2) - (half + dth*vel(i,j ,k,2)/hy) * vely(i,j ,k,2) c $ + dth * force(i,j ,k,2) vbot = vel(i,j-1,k,2) + (half - dth*vel(i,j-1,k,2)/hy) * vely(i,j-1,k,2) c $ + dth * force(i,j-1,k,2) vtop = cvmgt(vel(i,js-1,k,2),vtop,j.eq.js .and. BCY_LO .eq. INLET) vtop = cvmgt(vel(i,je+1,k,2),vtop,j.eq.je+1 .and. BCY_HI .eq. INLET) vtop = cvmgt(zero ,vtop,j.eq.js .and. BCY_LO .eq. WALL) vtop = cvmgt(zero ,vtop,j.eq.je+1 .and. BCY_HI .eq. WALL) vbot = cvmgt(vel(i,js-1,k,2),vbot,j.eq.js .and. BCY_LO .eq. INLET) vbot = cvmgt(vel(i,je+1,k,2),vbot,j.eq.je+1 .and. BCY_HI .eq. INLET) vbot = cvmgt(zero ,vbot,j.eq.js .and. BCY_LO .eq. WALL) vbot = cvmgt(zero ,vbot,j.eq.je+1 .and. BCY_HI .eq. WALL) vtrans(i,j,k)=cvmgp(vbot,vtop,vbot+vtop) test = ( (vbot .le. zero .and. vtop .ge. zero) .or. $ (abs(vbot+vtop) .lt. eps)) vtrans(i,j,k) = cvmgt(zero,vtrans(i,j,k),test) enddo enddo enddo c Create the z-velocity to be used for transverse derivatives. do k = ks,ke+1 do j = js-1,je+1 do i = is-1,ie+1 wtop = vel(i,j,k ,3) - (half + dth*vel(i,j,k ,3)/hz) * velz(i,j,k ,3) c $ + dth * force(i,j,k ,3) wbot = vel(i,j,k-1,3) + (half - dth*vel(i,j,k-1,3)/hz) * velz(i,j,k-1,3) c $ + dth * force(i,j,k-1,3) wtop = cvmgt(vel(i,j,ks-1,3),wtop,k.eq.ks .and. BCZ_LO .eq. INLET) wtop = cvmgt(vel(i,j,ke+1,3),wtop,k.eq.ke+1 .and. BCZ_HI .eq. INLET) wtop = cvmgt(zero ,wtop,k.eq.ks .and. BCZ_LO .eq. WALL) wtop = cvmgt(zero ,wtop,k.eq.ke+1 .and. BCZ_HI .eq. WALL) wbot = cvmgt(vel(i,j,ks-1,3),wbot,k.eq.ks .and. BCZ_LO .eq. INLET) wbot = cvmgt(vel(i,j,ke+1,3),wbot,k.eq.ke+1 .and. BCZ_HI .eq. INLET) wbot = cvmgt(zero ,wbot,k.eq.ks .and. BCZ_LO .eq. WALL) wbot = cvmgt(zero ,wbot,k.eq.ke+1 .and. BCZ_HI .eq. WALL) wtrans(i,j,k)=cvmgp(wbot,wtop,wbot+wtop) test = ( (wbot .le. zero .and. wtop .ge. zero) .or. $ (abs(wbot+wtop) .lt. eps)) wtrans(i,j,k) = cvmgt(zero,wtrans(i,j,k),test) enddo enddo enddo return end ccseapps-2.5/CCSEApps/pVarden/main.cpp0000644000175000017500000003765311634153073020724 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif // declare global variables here Real init_shrink = 1.0; Real gravity = 0.0; int domain_bc[2*BL_SPACEDIM]; Array< Array > bc; Box prob_domain; BoxArray grids; static const std::string CheckPointVersion = "CheckPointVersion_1.0"; typedef char* charString; #include #include using std::setprecision; #ifndef WIN32 using std::set_new_handler; #endif // functions called void print_usage(int,char**); void parse_command_line(int, char**, charString&, charString&); void writePlotFile(Grid*, Geometry&, int, Real, std::string&); void writePlotFile(Grid*, Geometry&, std::string&, std::ostream&, int, Real); void checkPoint(Grid*, Geometry, int, Real, Real, std::string&); std::string thePlotFileType(); // ################################################################### // ##### MAIN PROGRAM // ################################################################### main(int argc, char *argv[]) { BoxLib::Initialize(argc,argv); charString in_file = NULL; charString res_file = NULL; parse_command_line(argc,argv,in_file,res_file); ParmParse pp; int max_step; int max_grid_size; Real stop_time; Real cfl; int check_int; int plot_int; std::string check_file_root = "chk"; std::string plot_file_root = "plt"; pp.get("max_step",max_step); pp.get("stop_time",stop_time); pp.get("cfl",cfl); pp.query("init_shrink",init_shrink); pp.query("gravity",gravity); pp.get("check_int",check_int); pp.query("check_file_root",check_file_root); pp.get("plot_int",plot_int); pp.query("plot_file_root",plot_file_root); std::string probin_file; if (pp.contains("probin_file")) { pp.get("probin_file",probin_file); } Array n_cell(BL_SPACEDIM); pp.getarr("n_cell",n_cell,0,BL_SPACEDIM); #if (BL_SPACEDIM == 2) IntVect pd_lo(0,0); IntVect pd_hi(n_cell[0]-1,n_cell[1]-1); #elif (BL_SPACEDIM == 3) IntVect pd_lo(0,0,0); IntVect pd_hi(n_cell[0]-1,n_cell[1]-1,n_cell[2]-1); #endif prob_domain = Box(pd_lo,pd_hi); pp.query("max_grid_size",max_grid_size); BoxList grids_list; grids_list.push_back(prob_domain); grids_list.maxSize(max_grid_size); grids.define(grids_list); // This reads problem size and coordinate system information. Geometry::Setup(); Geometry geom; geom.define(prob_domain); pp.get("bcx_lo",domain_bc[0]); pp.get("bcx_hi",domain_bc[1]); pp.get("bcy_lo",domain_bc[2]); pp.get("bcy_hi",domain_bc[3]); if (domain_bc[0] == PERIODIC && domain_bc[0] != PERIODIC) { std::cout << "IF bcx_lo is periodic then bcx_hi must be periodic " << std::endl; exit(0); } if (domain_bc[1] == PERIODIC && domain_bc[0] != PERIODIC) { std::cout << "IF bcx_hi is periodic then bcx_lo must be periodic " << std::endl; exit(0); } if (domain_bc[2] == PERIODIC && domain_bc[3] != PERIODIC) { std::cout << "IF bcy_lo is periodic then bcy_hi must be periodic " << std::endl; exit(0); } if (domain_bc[3] == PERIODIC && domain_bc[2] != PERIODIC) { std::cout << "IF bcy_hi is periodic then bcy_lo must be periodic " << std::endl; exit(0); } #if (BL_SPACEDIM == 3) pp.get("bcz_lo",domain_bc[4]); pp.get("bcz_hi",domain_bc[5]); if (domain_bc[4] == PERIODIC && domain_bc[5] != PERIODIC) { std::cout << "IF bcz_lo is periodic then bcz_hi must be periodic " << std::endl; exit(0); } if (domain_bc[5] == PERIODIC && domain_bc[4] != PERIODIC) { std::cout << "IF bcz_hi is periodic then bcz_lo must be periodic " << std::endl; exit(0); } #endif bc.resize(grids.size()); for (int i = 0; i < grids.size(); i++) bc[i].resize(2*BL_SPACEDIM,INTERIOR); const int* domlo = prob_domain.loVect(); const int* domhi = prob_domain.hiVect(); for (int i = 0; i < grids.size(); i++) { const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); for (int n = 0; n < BL_SPACEDIM; n++) { if (lo[n] == domlo[n]) bc[i][2*n ] = domain_bc[2*n]; if (hi[n] == domhi[n]) bc[i][2*n+1] = domain_bc[2*n+1]; } } Grid* grid = new Grid(grids, geom, probin_file); Real time = 0.0; Real dt = 0.0; int nstep = 0; grid->init(nstep,time,dt); // First do the iterations to calculate an initial pressure if (nstep == 0) { dt = std::min(init_shrink * grid->estimateDt(dt,cfl), stop_time - time); grid->initialIter(time,dt); checkPoint(grid,geom,nstep,time,dt,check_file_root); } writePlotFile(grid,geom,nstep,time,plot_file_root); int last_checkpoint = nstep; int last_plotpoint = nstep; while (nstep < max_step && time <= stop_time - 1.e-10) { if (nstep > 0) dt = std::min(grid->estimateDt(dt,cfl), stop_time - time); nstep++; // do a timestep grid->advance(time, dt); time += dt; if (ParallelDescriptor::IOProcessor()) { std::cout << "STEP = " << nstep << " TIME = " << time; std::cout << " DT = " << dt << std::endl; std::cout << std::endl; } // checkpoint file? if (check_int > 0 && nstep%check_int == 0) { last_checkpoint = nstep; checkPoint(grid,geom,nstep,time,dt,check_file_root); }; if (plot_int > 0 && nstep%plot_int == 0) { last_plotpoint = nstep; writePlotFile(grid,geom,nstep,time,plot_file_root); }; }; // dump final checkpoint file if needed if (nstep != last_checkpoint) { checkPoint(grid,geom,nstep,time,dt,check_file_root); }; // dump final pltfile file if needed if (nstep != last_plotpoint) { writePlotFile(grid,geom,nstep,time,plot_file_root); }; // clean up memory usage delete grid; BoxLib::Finalize(); } // ################################################################### // ##### print_usage // ################################################################### void print_usage(int /* argc */, char *argv[]) { std::cerr << "usage:\n"; std::cerr << argv[0] << " infilename " << std::endl; std::cerr << "\n"; exit(1); } // ################################################################### // ##### parse_command_line // ################################################################### void parse_command_line(int argc, char *argv[], charString &in_file, charString &res_file) { // first input must be input file name if (argc < 2) print_usage(argc,argv); if (argv[1][0] == '-') { std::cerr << "first command line argument must be file name\n"; print_usage(argc,argv); }; in_file = argv[1]; } // ################################################################### // ##### writePlotFile // ################################################################### // ------------------------------------------------------------- void writePlotFile(Grid* grid, Geometry& geom, int nstep, Real time, std::string& plot_file_root) { std::string pltfile = plot_file_root; char buf[sizeof(int)+1]; sprintf(buf,"%04d",nstep); pltfile += buf; if (ParallelDescriptor::IOProcessor()) std::cout << "Writing plotfile: " << pltfile << std::endl; // create directory if (!(BoxLib::UtilCreateDirectory(pltfile,0755))) { BoxLib::CreateDirectoryFailed(pltfile); } std::string HeaderFileName = pltfile + "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream HeaderFile; HeaderFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); int old_prec; HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc); if (!HeaderFile.good()) BoxLib::FileOpenFailed(HeaderFileName); old_prec = HeaderFile.precision(15); static const std::string RunstatString("write_pltfile"); writePlotFile(grid,geom,pltfile,HeaderFile,nstep,time); HeaderFile.precision(old_prec); if (ParallelDescriptor::IOProcessor() && !HeaderFile.good()) BoxLib::Error("main::writePlotFile() failed"); } // ################################################################### // ##### writePlotFile // ################################################################### void writePlotFile(Grid* grid, Geometry& geom, std::string& dir, std::ostream& os, int nstep, Real time) { int numPlotComp; const Real* dx = geom.CellSize(); int i; int finest_level = 0; int n_state = grid->NumState(); int n_derive = grid->NumDerive(); numPlotComp = n_state + 1 + BL_SPACEDIM + n_derive; if (ParallelDescriptor::IOProcessor()) { // plotfile type os << thePlotFileType() << '\n'; // number of components os << numPlotComp << '\n'; // names os << "x_velocity" << '\n'; os << "y_velocity" << '\n'; #if (BL_SPACEDIM == 3) os << "z_velocity" << '\n'; #endif os << "density" << '\n'; os << "tracer" << '\n'; // IF YOU WISH TO ADD A NEW SCALAR VARIABLE, UNCOMMENT THIS LINE // os << "new_scalar" << '\n'; os << "pressure"<< '\n'; os << "px" << '\n'; os << "py" << '\n'; #if (BL_SPACEDIM == 3) os << "pz" << '\n'; #endif os << "vort" << '\n'; static const std::string MultiFabBaseName("/MultiFab"); // dimensions os << BL_SPACEDIM << '\n'; // current time os << time << '\n'; // finest_level os << finest_level << '\n'; // Problem domain in real coordinates for (i = 0; i < BL_SPACEDIM; i++) os << geom.ProbLo(i) << ' '; os << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << geom.ProbHi(i) << ' '; os << '\n'; // Refinement ratio os << '\n'; // Problem domain in index space os << geom.Domain() << ' '; os << '\n'; os << nstep << '\n'; for (int k = 0; k < BL_SPACEDIM; k++) os << dx[k] << ' '; os << '\n'; // Coordinate system os << (int) CoordSys::Coord() << '\n'; // Write bndry data os << "0\n"; } int thisLevel = 0; int numGridsOnLevel = grids.size(); int IAMRSteps = 0; // // Build the directory to hold the MultiFab at this level. // The name is relative to the directory containing the Header file. // static const std::string BaseName = "/Cell"; char buf[64]; sprintf(buf, "Level_%d",thisLevel); std::string Level = buf; // // Now for the full pathname of that directory. // std::string FullPath = dir; if (!FullPath.empty() && FullPath[FullPath.length()-1] != '/') FullPath += '/'; FullPath += Level; // // Only the I/O processor makes the directory if it doesnt already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) BoxLib::CreateDirectoryFailed(FullPath); // // Force other processors to wait until the directory is built. // ParallelDescriptor::Barrier(); if (ParallelDescriptor::IOProcessor()) { os << thisLevel << ' ' << numGridsOnLevel << ' ' << time << '\n'; os << IAMRSteps << '\n'; for (int i = 0; i < grids.size(); ++i) { for (int n = 0; n < BL_SPACEDIM; n++) { Real grid_lo = (grids[i].loVect()[n] ) * dx[n]; Real grid_hi = (grids[i].hiVect()[n]+1) * dx[n]; os << grid_lo << ' ' << grid_hi << '\n'; } } // // The full relative pathname of the MultiFabs at this level. // The name is relative to the Header file containing this name. // It's the name that gets written into the Header. // if (numPlotComp > 0) { std::string PathNameInHeader = Level; PathNameInHeader += BaseName; os << PathNameInHeader << '\n'; } } int nGrow = 0; MultiFab plotMF(grids,numPlotComp,nGrow); grid->writePlotFile(plotMF,time); // // Use the Full pathname when naming the MultiFab. // std::string TheFullPath = FullPath; TheFullPath += BaseName; VisMF::Write(plotMF,TheFullPath,VisMF::OneFilePerCPU); } std::string thePlotFileType() { static const std::string the_plot_file_type("HyperCLaw-V1.1"); return the_plot_file_type; } void checkPoint(Grid* grid, Geometry geom, int nstep, Real time, Real dt, std::string& check_file_root) { // // In checkpoint files always write out FABs in NATIVE format. // FABio::Format thePrevFormat = FArrayBox::getFormat(); FArrayBox::setFormat(FABio::FAB_NATIVE); Real dCheckPointTime0 = ParallelDescriptor::second(); std::string chkfile = check_file_root; const std::string ckfile = BoxLib::Concatenate(chkfile,nstep); // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(ckfile, 0755)) BoxLib::CreateDirectoryFailed(ckfile); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string HeaderFileName = ckfile + "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream HeaderFile; HeaderFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); int old_prec; if (ParallelDescriptor::IOProcessor()) { std::cout << "Writing checkpoint file at step " << nstep << std::endl; // // Only the IOProcessor() writes to the header file. // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc); if (!HeaderFile.good()) BoxLib::FileOpenFailed(HeaderFileName); old_prec = HeaderFile.precision(30); HeaderFile << CheckPointVersion << '\n' << BL_SPACEDIM << '\n' << time << '\n'; HeaderFile << geom << '\n'; HeaderFile << dt << ' ' << '\n'; HeaderFile << nstep << ' ' << '\n'; } grid->checkPoint(ckfile,HeaderFile); if (ParallelDescriptor::IOProcessor()) { HeaderFile.precision(old_prec); if (!HeaderFile.good()) BoxLib::Error("Amr::checkpoint() failed"); } // // Don't forget to reset FAB format. // FArrayBox::setFormat(thePrevFormat); const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real dCheckPointTime = ParallelDescriptor::second() - dCheckPointTime0; ParallelDescriptor::ReduceRealMax(dCheckPointTime,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "checkPoint() time = " << dCheckPointTime << " secs." << std::endl; } ccseapps-2.5/CCSEApps/pVarden/inputs3.2d0000644000175000017500000002325411634153073021120 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 1000000 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 128 128 ############################################################################# # Maximum size of grid allowed. max_grid_size = 64 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1.0 ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin3 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 10000 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030 (assuming plot_file_root is "plt"). # These plot files can be viewed using the visualization tool "amrvis2d." plot_int = 1000 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 0 ############################################################################# # Set to 1 if periodic in that direction geometry.is_periodic = 1 1 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 1 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 1 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 1 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 1 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 1. 1. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/VISC_F.H0000644000175000017500000000530211634153073020400 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_RESID residv # define FORT_GSRBV gsrbv # define FORT_GSRBV_RZ gsrbvrz #else #if defined(BL_FORT_USE_UNDERSCORE) # define FORT_RESID residv_ # define FORT_GSRBV gsrbv_ # define FORT_GSRBV_RZ gsrbvrz_ #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_RESID RESIDV # define FORT_GSRBV GSRBV # define FORT_GSRBV_RZ GSRBVRZ #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_RESID residv # define FORT_GSRBV gsrbv # define FORT_GSRBV_RZ gsrbvrz #endif #include extern "C" { void FORT_RESID(Real * resid, Real * phi, Real * source, Real * areax, Real * areay, #if (BL_SPACEDIM == 3) Real * areaz, #endif Real * alpha, ARLIM_P(lo), ARLIM_P(hi), const Real * dx, #if (BL_SPACEDIM == 2) const int* irz, #endif Real * norm, int * bc, int * level, int * idir, Real* mu, int * ng); void FORT_GSRBV(Real * phi, Real * source, Real * areax, Real * areay, #if (BL_SPACEDIM == 3) Real * areaz, #endif Real * alpha, ARLIM_P(lo), ARLIM_P(hi), const Real * dx, int * bc, int * level, int * idir, int * nngsrb, Real* mu, #if (BL_SPACEDIM == 2) const int* irz, #endif int *ng); }; #endif ccseapps-2.5/CCSEApps/pVarden/cmpdt_2d.F0000644000175000017500000000561311634153073021066 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** CMPDT ** c ** Compute the new time step c ******************************************************************** subroutine FORT_CMPDT(u,rho,gp,force,dx,dtold,dt,cflfac,DIMS) implicit none integer DIMS REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) REAL_T rho(lo_1-3:hi_1+3,lo_2-3:hi_2+3) REAL_T gp(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T dx(2) REAL_T dt, dtold REAL_T cflfac c Local variables REAL_T spdx,spdy REAL_T pforcex,pforcey REAL_T dtchange integer i, j REAL_T eps dtchange = 1.1d0 eps = 1.0e-8 spdx = zero spdy = zero pforcex = zero pforcey = zero do j = lo_2, hi_2 do i = lo_1, hi_1 spdx = max(spdx ,abs(u(i,j,1))/dx(1)) spdy = max(spdy ,abs(u(i,j,2))/dx(2)) pforcex = max(pforcex,abs(gp(i,j,1)/rho(i,j)-force(i,j,1))) pforcey = max(pforcey,abs(gp(i,j,2)/rho(i,j)-force(i,j,2))) enddo enddo if (spdx.lt.eps .and. spdy.lt.eps) then dt = min(dx(1),dx(2)) else dt = one / max(spdx,spdy) endif if (pforcex .gt. eps) then dt = min(dt,sqrt(two*dx(1)/pforcex)) endif if (pforcey .gt. eps) then dt = min(dt,sqrt(two*dx(2)/pforcey)) endif dt = dt * cflfac if (dtold .gt. zero) dt = min(dt,dtchange*dtold) return end ccseapps-2.5/CCSEApps/pVarden/velupd_3d.F0000644000175000017500000001024211634153073021251 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** VELUPD ** c ** Update the velocity components using convective differencing of fluxes c ** This field will then be projected to enforce the divergence constraint. c ************************************************************************* subroutine FORT_VELUPD(u,ustar,lapu,gradp,rhomid, $ uadv,vadv,wadv,uhalfx,uhalfy,uhalfz, $ force,dt,DIMS,dx) implicit none integer DIMS REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) REAL_T ustar(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T gradp(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T rhomid(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wadv(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T uhalfx(lo_1 :hi_1+1,lo_2 :hi_2 ,lo_3 :hi_3 ,3) REAL_T uhalfy(lo_1 :hi_1 ,lo_2 :hi_2+1,lo_3 :hi_3 ,3) REAL_T uhalfz(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1,3) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T dt REAL_T dx(3) c Local variables integer i, j, k REAL_T ubar, vbar, wbar REAL_T ugradu, ugradv, ugradw do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 ubar = half*(uadv(i,j,k) + uadv(i+1,j,k)) vbar = half*(vadv(i,j,k) + vadv(i,j+1,k)) wbar = half*(wadv(i,j,k) + wadv(i,j,k+1)) ugradu = ubar*(uhalfx(i+1,j,k,1) - uhalfx(i,j,k,1))/dx(1) + $ vbar*(uhalfy(i,j+1,k,1) - uhalfy(i,j,k,1))/dx(2) + $ wbar*(uhalfz(i,j,k+1,1) - uhalfz(i,j,k,1))/dx(3) ugradv = ubar*(uhalfx(i+1,j,k,2) - uhalfx(i,j,k,2))/dx(1) + $ vbar*(uhalfy(i,j+1,k,2) - uhalfy(i,j,k,2))/dx(2) + $ wbar*(uhalfz(i,j,k+1,2) - uhalfz(i,j,k,2))/dx(3) ugradw = ubar*(uhalfx(i+1,j,k,3) - uhalfx(i,j,k,3))/dx(1) + $ vbar*(uhalfy(i,j+1,k,3) - uhalfy(i,j,k,3))/dx(2) + $ wbar*(uhalfz(i,j,k+1,3) - uhalfz(i,j,k,3))/dx(3) ustar(i,j,k,1) = u(i,j,k,1) + dt * ( half*lapu(i,j,k,1)/rhomid(i,j,k) $ - gradp(i,j,k,1)/rhomid(i,j,k) - ugradu + force(i,j,k,1) ) ustar(i,j,k,2) = u(i,j,k,2) + dt * ( half*lapu(i,j,k,2)/rhomid(i,j,k) $ - gradp(i,j,k,2)/rhomid(i,j,k) - ugradv + force(i,j,k,2) ) ustar(i,j,k,3) = u(i,j,k,3) + dt * ( half*lapu(i,j,k,3)/rhomid(i,j,k) $ - gradp(i,j,k,3)/rhomid(i,j,k) - ugradw + force(i,j,k,3) ) enddo enddo enddo return end ccseapps-2.5/CCSEApps/pVarden/slopex_3d.F0000644000175000017500000001617311634153073021275 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** SLOPEX ** c ** Compute the slope of nvar components of s in the x-direction c ************************************************************************* subroutine FORT_SLOPEX(s,slx,dxscr,DIMS,nvar,bc,slope_order) implicit none integer DIMS integer nvar REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,nvar) REAL_T slx(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,nvar) REAL_T dxscr(lo_1-2:hi_1+2,4) integer bc(2,3) integer slope_order c Local variables integer is,js,ks,ie,je,ke integer i,j,k,iv integer cen,lim,flag,fromm REAL_T del,slim,sflag REAL_T dpls,dmin,ds parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 c HERE DOING 1ST ORDER if (slope_order .eq. 0) then do iv = 1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is-1,ie+1 slx(i,j,k,iv) = zero enddo enddo enddo enddo c HERE DOING 2ND ORDER else if (slope_order .eq. 2) then do iv=1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is-1,ie+1 del = half*(s(i+1,j,k,iv) - s(i-1,j,k,iv)) dpls = two*(s(i+1,j,k,iv) - s(i ,j,k,iv)) dmin = two*(s(i ,j,k,iv) - s(i-1,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(i,j,k,iv)= sflag*min(slim,abs(del)) enddo if (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) then slx(is-1,j,k,iv) = zero del = (s(is+1,j,k,iv)+three*s(is,j,k,iv)- $ four*s(is-1,j,k,iv) ) * third dpls = two*(s(is+1,j,k,iv) - s(is ,j,k,iv)) dmin = two*(s(is ,j,k,iv) - s(is-1,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(is,j,k,iv)= sflag*min(slim,abs(del)) elseif (BCX_LO .eq. OUTLET) then slx(is-1,j,k,iv)= zero endif if (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) then slx(ie+1,j,k,iv) = zero del = -(s(ie-1,j,k,iv)+three*s(ie,j,k,iv)- $ four*s(ie+1,j,k,iv)) * third dpls = two*(s(ie+1,j,k,iv) - s(ie ,j,k,iv)) dmin = two*(s(ie ,j,k,iv) - s(ie-1,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(ie,j,k,iv)= sflag*min(slim,abs(del)) elseif (BCX_HI .eq. OUTLET) then slx(ie+1,j,k,iv)= zero endif enddo enddo enddo else c HERE DOING 4TH ORDER do iv=1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is-2,ie+2 dxscr(i,cen) = half*(s(i+1,j,k,iv)-s(i-1,j,k,iv)) dmin = two*(s(i ,j,k,iv)-s(i-1,j,k,iv)) dpls = two*(s(i+1,j,k,iv)-s(i ,j,k,iv)) dxscr(i,lim)= min(abs(dmin),abs(dpls)) dxscr(i,lim) = cvmgp(dxscr(i,lim),zero,dpls*dmin) dxscr(i,flag) = sign(one,dxscr(i,cen)) dxscr(i,fromm)= dxscr(i,flag)*min(dxscr(i,lim), $ abs(dxscr(i,cen))) enddo do i = is-1,ie+1 ds = two * two3rd * dxscr(i,cen) - $ sixth * (dxscr(i+1,fromm) + dxscr(i-1,fromm)) slx(i,j,k,iv) = dxscr(i,flag)*min(abs(ds),dxscr(i,lim)) enddo if (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) then slx(is-1,j,k,iv) = zero del = -sixteen/fifteen*s(is-1,j,k,iv) + half*s(is,j,k,iv) + $ two3rd*s(is+1,j,k,iv) - tenth*s(is+2,j,k,iv) dmin = two*(s(is ,j,k,iv)-s(is-1,j,k,iv)) dpls = two*(s(is+1,j,k,iv)-s(is ,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(is,j,k,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at is+1 using the revised dxscr(is,fromm) dxscr(is,fromm) = slx(is,j,k,iv) ds = two * two3rd * dxscr(is+1,cen) - $ sixth * (dxscr(is+2,fromm) + dxscr(is,fromm)) slx(is+1,j,k,iv) = dxscr(is+1,flag)*min(abs(ds),dxscr(is+1,lim)) elseif (BCX_LO .eq. OUTLET) then slx(is-1,j,k,iv)= zero endif if (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) then slx(ie+1,j,k,iv) = zero del = -( -sixteen/fifteen*s(ie+1,j,k,iv) + half*s(ie,j,k,iv) + $ two3rd*s(ie-1,j,k,iv) - tenth*s(ie-2,j,k,iv) ) dmin = two*(s(ie ,j,k,iv)-s(ie-1,j,k,iv)) dpls = two*(s(ie+1,j,k,iv)-s(ie ,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(ie,j,k,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at ie-1 using the revised dxscr(ie,fromm) dxscr(ie,fromm) = slx(ie,j,k,iv) ds = two * two3rd * dxscr(ie-1,cen) - $ sixth * (dxscr(ie-2,fromm) + dxscr(ie,fromm)) slx(ie-1,j,k,iv) = dxscr(ie-1,flag)*min(abs(ds),dxscr(ie-1,lim)) elseif (BCX_HI .eq. OUTLET) then slx(ie+1,j,k,iv)= zero endif enddo enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/inputs5.2d0000644000175000017500000002302511634153073021116 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 10 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 64 32 ############################################################################# # Maximum size of grid allowed. max_grid_size = 32 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin5 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030 (assuming plot_file_root is "plt"). # These plot files can be viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 0 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 3 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 4 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 2. 1. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.0 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/hgproj.H0000644000175000017500000000760711634153073020672 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "multigrid.H" // //@Man: //@Memo: Nodal projection class for end-of-time-step nodal projection /*@ManDoc: This class handles the nodal projection of the new-time velocity. It computes RHS = D(V), and sends the RHS and coefficients sigma = 1/rho to the hgprojection_mg class, which solves the linear system using multigrid. */ class hg_projector { //@ManDoc: Problem domain broken down into grids. BoxArray grids; //@ManDoc: Geometry object. Geometry geom; //@ManDoc: area arrays. const MultiFab* area; //@ManDoc: Volume arrays. const MultiFab& vol; //@ManDoc: Tolerance to which DG(phi) = RHS should be solved Real tol; //@ManDoc: number of smoothing steps as you coarsen static int numSmoothCoarsen; //@ManDoc: number of smoothing steps as you refine static int numSmoothRefine; //@ManDoc: Number of ghost cells = max of numSmoothCoarsen/Refine static int ng; public: //@ManDoc: Constructor hg_projector(const BoxArray& Grids, const Geometry& Geom, MultiFab* area, MultiFab& volume); //@ManDoc: Destructor ~hg_projector(); //@ManDoc: Do the nodal projection void project(MultiFab * state, MultiFab * gradp, MultiFab * rho, MultiFab * divu_src, Real time, Real dt); //@ManDoc: Compute the pressure gradient at cell centers void gradient(MultiFab * gradp, MultiFab * pressure); }; //@ManDoc: The multigrid solver for the nodal projection class hgprojection_mg : public multigrid { //@Memo: Multigrid solver for nodal projection //@ManDoc: Coefficient array = 1 / rho MultiFab * sigma; //@ManDoc: Coefficient array built of sigmas and used only in 3-d. MultiFab * coeff; //@ManDoc: Next coarser multigrid level hgprojection_mg *Next; //@ManDoc: Scratch space for the conjugate gradient bottom solver MultiFab * cgwork; //@ManDoc: Compute the residual R = RHS - DG(phi) Real residual(); //@ManDoc: Relax on the residual equation, updating phi void step(int); //@ManDoc: Coarsen the residual to the next coarser multigrid level void Restrict(); //@ManDoc: Interpolate the solution from the next coarser multigrid level void interpolate(); public: //@ManDoc: Constructor hgprojection_mg(const BoxArray & Grids, const Geometry & Geom, MultiFab * Phi, MultiFab * Source, MultiFab * Residual, MultiFab * Sigma, #if (BL_SPACEDIM == 3) MultiFab * Coeff, #endif const Real* Dx); //@ManDoc: Destructor ~hgprojection_mg(); }; ccseapps-2.5/CCSEApps/pVarden/GNUmakefile0000644000175000017500000000232711634153073021334 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.4 2003/02/14 18:49:46 lijewski Exp $ # PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) PRECISION = DOUBLE PROFILE = FALSE COMP = g++ #FCOMP = Intel DEBUG = TRUE DEBUG = FALSE DIM = 2 USE_MPI = FALSE # # Base name of the executable. # EBASE = run # # Where libraries and include files will be installed. # include $(TOP)/mk/Make.defs ./Make.package include $(TOP)/BoxLib/Make.package $(TOP)/bndrylib/Make.package INCLUDE_LOCATIONS += . $(TOP)/bndrylib $(TOP)/BoxLib DEFINES += -DBL_USE_SETBUF # # ArrayView # ifeq (USE_ARRAYVIEW, TRUE) DEFINES += -DBL_USE_ARRAYVIEW INCLUDE_LOCATIONS += . LIBRARIES += -lX11 endif vpath %.H . $(TOP)/bndrylib $(TOP)/BoxLib vpath %.cpp . $(TOP)/bndrylib $(TOP)/BoxLib vpath %.F . $(TOP)/bndrylib $(TOP)/BoxLib vpath %.h . $(TOP)/bndrylib $(TOP)/BoxLib vpath %.f . $(TOP)/bndrylib $(TOP)/BoxLib all: $(executable) libs: cd $(PBOXLIB_HOME)/BoxLib; \ make PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) \ DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install cd $(PBOXLIB_HOME)/bndrylib; \ make PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) \ DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install include ../mk/Make.rules ccseapps-2.5/CCSEApps/pVarden/macproj.H0000644000175000017500000000717711634153073021036 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MACPROJ_H_ #define _MACPROJ_H_ #include "multigrid.H" // //@Man: //@Memo: Projection class for intermediate MAC projection /*@ManDoc: This class handles the MAC projection of the intermediate edge-based advection velocity. It computes RHS = D(V), and sends the RHS and coefficients sigma = 1/rho to the macprojection_mg class, which solves the linear system using multigrid. */ class mac_projector { //@ManDoc: Problem domain broken up into multiple grids. BoxArray grids; //@ManDoc: Geometry object. Geometry geom; //@ManDoc: Area arrays. const MultiFab* area; //@ManDoc: Volume arrays. const MultiFab& vol; //@ManDoc: Tolerance to which DG(phi) = RHS should be solved Real tol; //@ManDoc: Number of smoothing steps as you coarsen static int numSmoothCoarsen; //@ManDoc: Number of smoothing steps as you refine static int numSmoothRefine; //@ManDoc: Number of extra ghost cells. static int ng; public: //@ManDoc: Constructor mac_projector(const BoxArray& grids, const Geometry& geom, MultiFab* area, MultiFab& volume); //@ManDoc: Destructor ~mac_projector(); //@ManDoc: Do the MAC projection void project(MultiFab * uadv, MultiFab * vadv, #if (BL_SPACEDIM == 3) MultiFab * wadv, #endif MultiFab * state, MultiFab * divu_src); }; //@ManDoc: Multigrid solver for the intermediate MAC projection class macprojection_mg : public multigrid { //@Memo: Multigrid solver for MAC projection //@ManDoc: Coefficient array. MultiFab * sigma[BL_SPACEDIM]; //@ManDoc: Next coarser multigrid level macprojection_mg *Next; //@ManDoc: Scratch space for the conjugate gradient bottom solver. MultiFab *cgwork; //@ManDoc: Compute the residual R = RHS - DG(phi). Real residual(); //@ManDoc: Relax on the residual equation, updating phi. void step(int); //@ManDoc: Coarsen the residual to the next coarser multigrid level. void Restrict(); //@ManDoc: Interpolate the solution from the next coarser multigrid level. void interpolate(); public: macprojection_mg(const BoxArray& Grids, const Geometry& Geom, MultiFab* Phi, MultiFab* Source, MultiFab* Residual, MultiFab* Sigma[], const Real* Dx); ~macprojection_mg(); }; #endif ccseapps-2.5/CCSEApps/pVarden/slopey_2d.F0000644000175000017500000001566111634153073021276 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** SLOPEY ** c ** Compute the slope of nvar components of s in the y-direction c ************************************************************************* subroutine FORT_SLOPEY(s,sly,dyscr,DIMS,nvar,bc,slope_order) implicit none integer DIMS integer nvar integer bc(2,2) integer slope_order REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,nvar) REAL_T sly(lo_1-1:hi_1+1,lo_2-1:hi_2+1,nvar) REAL_T dyscr(lo_2-2:hi_2+2,4) integer cen,lim,flag,fromm parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ie,je,i,j,iv is = lo_1 js = lo_2 ie = hi_1 je = hi_2 c ::: HERE DOING 1ST ORDER if (slope_order .eq. 0) then do iv = 1,nvar do j = js-1,je+1 do i = is-1,ie+1 sly(i,j,iv) = zero enddo enddo enddo c ::: HERE DOING 2ND ORDER else if (slope_order .eq. 2) then do iv=1,nvar do j = js-1,je+1 do i = is-1,ie+1 del = half*(s(i,j+1,iv) - s(i,j-1,iv)) dpls = two *(s(i,j+1,iv) - s(i,j ,iv)) dmin = two *(s(i,j ,iv) - s(i,j-1,iv)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,j,iv)= sflag*min(slim,abs(del)) enddo enddo if (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) then do i = is-1,ie+1 sly(i,js-1,iv) = zero del = (s(i,js+1,iv)+three*s(i,js,iv)- $ four*s(i,js-1,iv)) * third dpls = two*(s(i,js+1,iv) - s(i,js ,iv)) dmin = two*(s(i,js ,iv) - s(i,js-1,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,js,iv)= sflag*min(slim,abs(del)) enddo else if (BCY_LO .eq. OUTLET) then do i = is-1, ie+1 sly(i,js-1,iv) = zero enddo endif if (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) then do i = is-1, ie+1 sly(i,je+1,iv) = zero del = -(s(i,je-1,iv)+three*s(i,je,iv)- $ four*s(i,je+1,iv)) * third dpls = two*(s(i,je+1,iv) - s(i,je ,iv)) dmin = two*(s(i,je ,iv) - s(i,je-1,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,je,iv)= sflag*min(slim,abs(del)) enddo else if (BCY_HI .eq. OUTLET) then do i = is-1, ie+1 sly(i,je+1,iv) = zero enddo endif enddo else c ::: HERE DOING 4TH ORDER do iv=1,nvar do i = is-1,ie+1 do j = js-2,je+2 dyscr(j,cen) = half*(s(i,j+1,iv)-s(i,j-1,iv)) dmin = two*(s(i,j ,iv)-s(i,j-1,iv)) dpls = two*(s(i,j+1,iv)-s(i,j ,iv)) dyscr(j,lim) = min(abs(dmin),abs(dpls)) dyscr(j,lim) = cvmgp(dyscr(j,lim),zero,dpls*dmin) dyscr(j,flag) = sign(one,dyscr(j,cen)) dyscr(j,fromm)= dyscr(j,flag)*min(dyscr(j,lim),abs(dyscr(j,cen))) enddo do j = js-1,je+1 ds = two * two3rd * dyscr(j,cen) - $ sixth * (dyscr(j+1,fromm) + dyscr(j-1,fromm)) sly(i,j,iv) = dyscr(j,flag)*min(abs(ds),dyscr(j,lim)) enddo if (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) then sly(i,js-1,iv) = zero del = -sixteen/fifteen*s(i,js-1,iv) + half*s(i,js ,iv) + $ two3rd*s(i,js+1,iv) - tenth*s(i,js+2,iv) dmin = two*(s(i,js ,iv)-s(i,js-1,iv)) dpls = two*(s(i,js+1,iv)-s(i,js ,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,js,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at js+1 using the revised dyscr(js,fromm) dyscr(js,fromm) = sly(i,js,iv) ds = two * two3rd * dyscr(js+1,cen) - $ sixth * (dyscr(js+2,fromm) + dyscr(js,fromm)) sly(i,js+1,iv) = dyscr(js+1,flag)*min(abs(ds),dyscr(js+1,lim)) elseif (BCY_LO .eq. OUTLET) then sly(i,js-1,iv) = zero endif if (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) then sly(i,je+1,iv) = zero del = -( -sixteen/fifteen*s(i,je+1,iv) + half*s(i,je ,iv) + $ two3rd*s(i,je-1,iv) - tenth*s(i,je-2,iv) ) dmin = two*(s(i,je ,iv)-s(i,je-1,iv)) dpls = two*(s(i,je+1,iv)-s(i,je ,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,je,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at js+1 using the revised dyscr(js,fromm) dyscr(je,fromm) = sly(i,je,iv) ds = two * two3rd * dyscr(je-1,cen) - $ sixth * (dyscr(je-2,fromm) + dyscr(je,fromm)) sly(i,je-1,iv) = dyscr(je-1,flag)*min(abs(ds),dyscr(je-1,lim)) elseif (BCY_HI .eq. OUTLET) then sly(i,je+1,iv) = zero endif enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/mkflux_2d.F0000644000175000017500000002631311634153073021265 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define N_STATE 4 #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKFLUX ** c ** If (velpred == 1), then predict normal edge velocities to be c ** MAC_projected and used for advection velocities c ** If (velpred == 0), then create the time-centered edge states to c ** be used in defining the velocity and scalar fluxes. c *************************************************************** subroutine FORT_MKFLUX(s,sedgex,sedgey,slopex,slopey, $ uadv,vadv,utrans,vtrans,force, $ s_l,s_r,s_b,s_t,DIMS, $ dx,dt,visc_coef,irz,bc,velpred, $ nstart,nend) implicit none integer DIMS integer nstart,nend REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,N_STATE) REAL_T sedgex(lo_1 :hi_1+1,lo_2 :hi_2 ,N_STATE) REAL_T sedgey(lo_1 :hi_1 ,lo_2 :hi_2+1,N_STATE) REAL_T slopex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,N_STATE) REAL_T slopey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,N_STATE) REAL_T uadv(lo_1 :hi_1+1,lo_2 :hi_2 ) REAL_T vadv(lo_1 :hi_1 ,lo_2 :hi_2+1) REAL_T utrans(lo_1-1:hi_1+2,lo_2-1:hi_2+1) REAL_T vtrans(lo_1-1:hi_1+1,lo_2-1:hi_2+2) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,nstart:nend) REAL_T s_l(lo_1-1:hi_1+2) REAL_T s_r(lo_1-1:hi_1+2) REAL_T s_b(lo_2-1:hi_2+2) REAL_T s_t(lo_2-1:hi_2+2) REAL_T dx(2) REAL_T dt REAL_T visc_coef integer irz integer bc(2,2) integer velpred c Local variables REAL_T ubardth, vbardth REAL_T hx, hy, dth REAL_T splus,sminus REAL_T savg,st REAL_T sptop,spbot,smtop,smbot,splft,sprgt,smlft,smrgt integer n logical test REAL_T eps integer i,j,is,js,ie,je integer ii eps = 1.0e-8 is = lo_1 ie = hi_1 js = lo_2 je = hi_2 dth = half*dt hx = dx(1) hy = dx(2) c c Loop for fluxes on x-edges. c do n = nstart,nend do j = js,je if (velpred .eq. 0 .or. n .eq. 1) then do i = is-1,ie+1 spbot = s(i,j ,n) + (half - dth*s(i,j ,2)/hy) * slopey(i,j ,n) c $ + dth * force(i, j,n) sptop = s(i,j+1,n) - (half + dth*s(i,j+1,2)/hy) * slopey(i,j+1,n) c $ + dth * force(i,j+1,n) sptop = cvmgt(s(i,je+1,n),sptop,j.eq.je .and. BCY_HI .eq. INLET) spbot = cvmgt(s(i,je+1,n),spbot,j.eq.je .and. BCY_HI .eq. INLET) if (j .eq. je .and. BCY_HI .eq. WALL) then if (n .eq. 2) then sptop = zero spbot = zero elseif (n .eq. 1) then sptop = cvmgt(zero,spbot,visc_coef .gt. zero) spbot = cvmgt(zero,spbot,visc_coef .gt. zero) else sptop = spbot endif endif splus = cvmgp(spbot,sptop,vtrans(i,j+1)) savg = half * (spbot + sptop) splus = cvmgt(splus, savg, abs(vtrans(i,j+1)) .gt. eps) smtop = s(i,j ,n) - (half + dth*s(i,j ,2)/hy) * slopey(i,j ,n) c $ + dth * force(i,j ,n) smbot = s(i,j-1,n) + (half - dth*s(i,j-1,2)/hy) * slopey(i,j-1,n) c $ + dth * force(i,j-1,n) smtop = cvmgt(s(i,js-1,n),smtop,j.eq.js .and. BCY_LO .eq. INLET) smbot = cvmgt(s(i,js-1,n),smbot,j.eq.js .and. BCY_LO .eq. INLET) if (j .eq. js .and. BCY_LO .eq. WALL) then if (n .eq. 2) then smtop = zero smbot = zero elseif (n .eq. 1) then smbot = cvmgt(zero,smtop,visc_coef .gt. zero) smtop = cvmgt(zero,smtop,visc_coef .gt. zero) else smbot = smtop endif endif sminus = cvmgp(smbot,smtop,vtrans(i,j)) savg = half * (smbot + smtop) sminus = cvmgt(sminus, savg, abs(vtrans(i,j)) .gt. eps) st = force(i,j,n) - $ half * (vtrans(i,j)+vtrans(i,j+1))*(splus - sminus) / hy ubardth = dth*s(i,j,1)/hx s_l(i+1)= s(i,j,n) + (half-ubardth)*slopex(i,j,n) + dth*st s_r(i )= s(i,j,n) - (half+ubardth)*slopex(i,j,n) + dth*st enddo if (velpred .eq. 1) then do i = is, ie+1 savg = half*(s_r(i) + s_l(i)) test = ( (s_l(i) .le. zero .and. $ s_r(i) .ge. zero) .or. $ (abs(s_l(i) + s_r(i)) .lt. eps) ) sedgex(i,j,n)=cvmgp(s_l(i),s_r(i),savg) sedgex(i,j,n)=cvmgt(savg,sedgex(i,j,n),test) enddo else do i = is, ie+1 sedgex(i,j,n)=cvmgp(s_l(i),s_r(i),uadv(i,j)) savg = half*(s_r(i) + s_l(i)) sedgex(i,j,n)=cvmgt(savg,sedgex(i,j,n),abs(uadv(i,j)) .lt. eps) enddo endif if (BCX_LO .eq. WALL) then if (n .eq. 1) then sedgex(is,j,n) = zero elseif (n .eq. 2) then sedgex(is,j,n) = cvmgt(zero,s_r(is),visc_coef.gt.0.0.and.irz.eq.0) else sedgex(is,j,n) = s_r(is) endif elseif (BCX_LO .eq. INLET) then sedgex(is,j,n) = s(is-1,j,n) elseif (BCX_LO .eq. OUTLET) then sedgex(is,j,n) = s_r(is) endif if (BCX_HI .eq. WALL) then if (n .eq. 1) then sedgex(ie+1,j,n) = zero else if (n .eq. 2) then sedgex(ie+1,j,n) = cvmgt(zero,s_l(ie+1),visc_coef .gt. 0.0) else sedgex(ie+1,j,n) = s_l(ie+1) endif elseif (BCX_HI .eq. INLET) then sedgex(ie+1,j,n) = s(ie+1,j,n) elseif (BCX_HI .eq. OUTLET) then sedgex(ie+1,j,n) = s_l(ie+1) endif if (velpred .eq. 1) then do i = is, ie+1 uadv(i,j) = sedgex(i,j,1) enddo endif endif enddo enddo c c Loop for fluxes on y-edges. c do n = nstart,nend do i = is, ie if (velpred .eq. 0 .or. n .eq. 2) then do j = js-1, je+1 splft = s(i,j ,n) + (half - dth*s(i ,j,1)/hx) * slopex(i ,j,n) c $ + dth * force(i ,j,n) sprgt = s(i+1,j,n) - (half + dth*s(i+1,j,1)/hx) * slopex(i+1,j,n) c $ + dth * force(i+1,j,n) sprgt = cvmgt(s(ie+1,j,n),sprgt,i.eq.ie .and. BCX_HI .eq. INLET) splft = cvmgt(s(ie+1,j,n),splft,i.eq.ie .and. BCX_HI .eq. INLET) if (i .eq. ie .and. BCX_HI .eq. WALL) then if (n .eq. 1) then splft = zero sprgt = zero elseif (n .eq. 2) then sprgt = cvmgt(zero,splft,visc_coef .gt. zero) splft = cvmgt(zero,splft,visc_coef .gt. zero) else sprgt = splft endif endif splus = cvmgp(splft,sprgt,utrans(i+1,j)) savg = half * (splft + sprgt) splus = cvmgt(splus, savg, abs(utrans(i+1,j)) .gt. eps) smrgt = s(i ,j,n) - (half + dth*s(i ,j,1)/hx) * slopex(i ,j,n) c $ + dth * force(i ,j,n) smlft = s(i-1,j,n) + (half - dth*s(i-1,j,1)/hx) * slopex(i-1,j,n) c $ + dth * force(i-1,j,n) smrgt = cvmgt(s(is-1,j,n),smrgt,i.eq.is .and. BCX_LO .eq. INLET) smlft = cvmgt(s(is-1,j,n),smlft,i.eq.is .and. BCX_LO .eq. INLET) if (i .eq. is .and. BCX_LO .eq. WALL) then if (n .eq. 1) then smlft = zero smrgt = zero elseif (n .eq. 2) then smlft = cvmgt(zero,smrgt,visc_coef.gt.zero.and.irz.eq.0) smrgt = cvmgt(zero,smrgt,visc_coef.gt.zero.and.irz.eq.0) else smlft = smrgt endif endif sminus = cvmgp(smlft,smrgt,utrans(i,j)) savg = half * (smlft + smrgt) sminus = cvmgt(sminus, savg, abs(utrans(i,j)) .gt. eps) st = force(i,j,n) - $ half * (utrans(i,j)+utrans(i+1,j))*(splus - sminus) / hx vbardth = dth*s(i,j,2)/hy s_b(j+1)= s(i,j,n) + (half-vbardth)*slopey(i,j,n) + dth*st s_t(j )= s(i,j,n) - (half+vbardth)*slopey(i,j,n) + dth*st enddo if (velpred .eq. 1) then do j = js, je+1 savg = half*(s_b(j) + s_t(j)) test = ( (s_b(j) .le. zero .and. $ s_t(j) .ge. zero) .or. $ (abs(s_b(j) + s_t(j)) .lt. eps) ) sedgey(i,j,n)=cvmgp(s_b(j),s_t(j),savg) sedgey(i,j,n)=cvmgt(savg,sedgey(i,j,n),test) enddo else do j = js, je+1 sedgey(i,j,n)=cvmgp(s_b(j),s_t(j),vadv(i,j)) savg = half*(s_b(j) + s_t(j)) sedgey(i,j,n)=cvmgt(savg,sedgey(i,j,n),abs(vadv(i,j)) .lt. eps) enddo endif if (BCY_LO .eq. WALL) then if (n .eq. 2) then sedgey(i,js,n) = zero else if (n .eq. 1) then sedgey(i,js,n) = cvmgt(zero,s_t(js),visc_coef .gt. 0.0) else sedgey(i,js,n) = s_t(js) endif elseif (BCY_LO .eq. INLET) then sedgey(i,js,n) = s(i,js-1,n) elseif (BCY_LO .eq. OUTLET) then sedgey(i,js,n) = s_t(js) endif if (BCY_HI .eq. WALL) then if (n .eq. 2) then sedgey(i,je+1,n) = zero else if (n .eq. 1) then sedgey(i,je+1,n) = cvmgt(zero,s_b(je+1),visc_coef .gt. 0.0) else sedgey(i,je+1,n) = s_b(je+1) endif elseif (BCY_HI .eq. INLET) then sedgey(i,je+1,n) = s(i,je+1,n) elseif (BCY_HI .eq. OUTLET) then sedgey(i,je+1,n) = s_b(je+1) endif if (velpred .eq. 1) then do j = js, je+1 vadv(i,j) = sedgey(i,j,2) enddo endif endif enddo enddo return end ccseapps-2.5/CCSEApps/pVarden/slopex_2d.F0000644000175000017500000001633411634153073021273 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** SLOPEX ** c ** Compute the slope of nvar components of s in the x-direction c ************************************************************************* subroutine FORT_SLOPEX(s,slx,dxscr,DIMS,first_comp,nvar,bc,irz,slope_order) implicit none integer DIMS integer nvar REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,nvar) REAL_T slx(lo_1-1:hi_1+1,lo_2-1:hi_2+1,nvar) REAL_T dxscr(lo_1-2:hi_1+2,4) integer bc(2,2) integer irz integer first_comp integer slope_order c Local variables integer is,js,ie,je integer i,j,iv integer cen,lim,flag,fromm REAL_T del,slim,sflag REAL_T dpls,dmin,ds parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) is = lo_1 js = lo_2 ie = hi_1 je = hi_2 c HERE DOING 1ST ORDER if (slope_order .eq. 0) then do iv = 1,nvar do j = js-1,je+1 do i = is-1,ie+1 slx(i,j,iv) = zero enddo enddo enddo c HERE DOING 2ND ORDER else if (slope_order .eq. 2) then do iv=1,nvar do j = js-1,je+1 do i = is-1,ie+1 del = half*(s(i+1,j,iv) - s(i-1,j,iv)) dpls = two*(s(i+1,j,iv) - s(i ,j,iv)) dmin = two*(s(i ,j,iv) - s(i-1,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(i,j,iv)= sflag*min(slim,abs(del)) enddo if (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) then slx(is-1,j,iv) = zero del = (s(is+1,j,iv)+three*s(is,j,iv)- $ four*s(is-1,j,iv) ) * third dpls = two*(s(is+1,j,iv) - s(is ,j,iv)) dmin = two*(s(is ,j,iv) - s(is-1,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(is,j,iv)= sflag*min(slim,abs(del)) elseif (BCX_LO .eq. OUTLET) then slx(is-1,j,iv) = zero endif if (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) then slx(ie+1,j,iv) = zero del = -(s(ie-1,j,iv)+three*s(ie,j,iv)- $ four*s(ie+1,j,iv) ) * third dpls = two*(s(ie ,j,iv) - s(ie-1,j,iv)) dmin = two*(s(ie+1,j,iv) - s(ie ,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(ie,j,iv)= sflag*min(slim,abs(del)) elseif (BCX_HI .eq. OUTLET) then slx(ie+1,j,iv) = zero endif enddo enddo else c HERE DOING 4TH ORDER do iv=1,nvar do j = js-1,je+1 do i = is-2,ie+2 dxscr(i,cen) = half*(s(i+1,j,iv)-s(i-1,j,iv)) dmin = two*(s(i ,j,iv)-s(i-1,j,iv)) dpls = two*(s(i+1,j,iv)-s(i ,j,iv)) dxscr(i,lim)= min(abs(dmin),abs(dpls)) dxscr(i,lim) = cvmgp(dxscr(i,lim),zero,dpls*dmin) dxscr(i,flag) = sign(one,dxscr(i,cen)) dxscr(i,fromm)= dxscr(i,flag)*min(dxscr(i,lim), $ abs(dxscr(i,cen))) enddo do i = is-1,ie+1 ds = two * two3rd * dxscr(i,cen) - $ sixth * (dxscr(i+1,fromm) + dxscr(i-1,fromm)) slx(i,j,iv) = dxscr(i,flag)*min(abs(ds),dxscr(i,lim)) enddo if (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) then slx(is-1,j,iv) = zero if (irz .eq. 0 .or. .not. $ (first_comp .eq. 0 .and. iv .eq. 1) ) then del = -sixteen/fifteen*s(is-1,j,iv) + half*s(is,j,iv) + $ two3rd*s(is+1,j,iv) - tenth*s(is+2,j,iv) dmin = two*(s(is ,j,iv)-s(is-1,j,iv)) dpls = two*(s(is+1,j,iv)-s(is ,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(is,j,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at is+1 using the revised dxscr(is,fromm) dxscr(is,fromm) = slx(is,j,iv) ds = two * two3rd * dxscr(is+1,cen) - $ sixth * (dxscr(is+2,fromm) + dxscr(is,fromm)) slx(is+1,j,iv) = dxscr(is+1,flag)*min(abs(ds),dxscr(is+1,lim)) endif elseif (BCX_LO .eq. OUTLET) then slx(is-1,j,iv) = zero endif if (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) then slx(ie+1,j,iv) = zero del = -( -sixteen/fifteen*s(ie+1,j,iv) + half*s(ie,j,iv) + $ two3rd*s(ie-1,j,iv) - tenth*s(ie-2,j,iv) ) dmin = two*(s(ie ,j,iv)-s(ie-1,j,iv)) dpls = two*(s(ie+1,j,iv)-s(ie ,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(ie,j,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at ie-1 using the revised dxscr(ie,fromm) dxscr(ie,fromm) = slx(ie,j,iv) ds = two * two3rd * dxscr(ie-1,cen) - $ sixth * (dxscr(ie-2,fromm) + dxscr(ie,fromm)) slx(ie-1,j,iv) = dxscr(ie-1,flag)*min(abs(ds),dxscr(ie-1,lim)) elseif (BCX_HI .eq. OUTLET) then slx(ie+1,j,iv) = zero endif enddo enddo if (irz .eq. 1 .and. first_comp .eq. 0 .and. nvar .ge. 2 .and. is .eq. 0) then do iv = 2,nvar do j = js,je slx(is-1,j,iv)=-slx(is,j,iv) enddo enddo endif endif return end ccseapps-2.5/CCSEApps/pVarden/Grid.cpp0000644000175000017500000016005311634153073020654 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #if (BL_SPACEDIM == 2) #define N_STATE 4 #elif (BL_SPACEDIM == 3) #define N_STATE 5 #endif int Grid::slope_order = 4; int Grid::init_iter = 2; Real Grid::fixed_dt = -1.0; int Grid::verbose = 0; int Grid::writeTurb = 0; // ************************************************************************ // ** constructor ** // ************************************************************************ Grid::Grid(BoxArray Grids, Geometry& Geom, std::string probin_file_read): grids(Grids), geom(Geom) { probin_file = probin_file_read; numscal = N_STATE - BL_SPACEDIM; parseInputs(); dx = geom.CellSize(); is_rz = CoordSys::IsRZ(); geom.GetVolume(vol,grids,1); for (int n = 0; n < BL_SPACEDIM; n++) geom.GetFaceArea(area[n],grids,n,0); vol.FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(vol,0,1,true); } // ************************************************************************ // ** parseInputs ** // ************************************************************************ void Grid::parseInputs() { ParmParse pp("grid"); is_conserv.resize(numscal); int in_inputs = pp.countval("is_conserv"); if (in_inputs != numscal) { if (ParallelDescriptor::IOProcessor()) std::cout << "WRONG NUMBER OF INPUTS FOR grid.is_conserv " << std::endl; exit(0); } pp.getarr("is_conserv",is_conserv,0,numscal); for (int i = 0; i < numscal; i++) { if (is_conserv[i] != 0 && is_conserv[i] != 1) { if (ParallelDescriptor::IOProcessor()) std::cout << "each value of is_conserv must be 0 or 1 " << std::endl; exit(0); } } visc_coef = 0.0; pp.query("visc_coef",visc_coef); diff_coef.resize(numscal); in_inputs = pp.countval("diff_coef"); if (in_inputs != numscal) { if (ParallelDescriptor::IOProcessor()) std::cout << "WRONG NUMBER OF INPUTS FOR grid.diff_coef " << std::endl; exit(0); } pp.getarr("diff_coef",diff_coef,0,numscal); if (diff_coef[0] > 0.0) { if (ParallelDescriptor::IOProcessor()) std::cout << "DENSITY SHOULD NOT DIFFUSE " << std::endl; exit(0); } pp.query("slope_order",slope_order); if (slope_order != 0 && slope_order != 2 && slope_order != 4) { if (ParallelDescriptor::IOProcessor()) std::cout << "slope_order must be 0 or 2 or 4" << std::endl; exit(0); } pp.query("init_iter",init_iter); pp.query("restart",restart_file); pp.query("fixed_dt",fixed_dt); pp.query("verbose",verbose); pp.query("writeTurb",writeTurb); } // ************************************************************************ // ** init ** // ************************************************************************ // decide whether to initialize from beginning or from restart void Grid::init(int& nstep, Real& time, Real& dt) { int probin_file_length = probin_file.length(); Array probin_file_name(probin_file_length); for (int i = 0; i < probin_file_length; i++) probin_file_name[i] = probin_file[i]; FORT_PROBINIT(probin_file_name.dataPtr(), &probin_file_length); init_data_structures(); if (restart_file != "") { restart(restart_file,nstep,time,dt); } else { initialInit(nstep,time,dt); } } // ************************************************************************ // ** init_data_structures // ************************************************************************ void Grid::init_data_structures() { int ngrow = 1; int ngrow_state = 3; state.define(grids,N_STATE,ngrow_state,Fab_allocate); staten.define(grids,N_STATE,ngrow_state,Fab_allocate); slopex.define(grids,N_STATE,ngrow,Fab_allocate); slopey.define(grids,N_STATE,ngrow,Fab_allocate); #if (BL_SPACEDIM == 3) slopez.define(grids,N_STATE,ngrow,Fab_allocate); #endif rhonph.define(grids, 1,ngrow,Fab_allocate); visc.define(grids, BL_SPACEDIM,ngrow,Fab_allocate); visc.setVal(0.0); diff.define(grids,numscal,ngrow,Fab_allocate); diff.setVal(0.0); BoxArray nodal_grids(grids); nodal_grids.surroundingNodes(); pressure.define(nodal_grids,1,0,Fab_allocate); pressure.setVal(0.0); gradp.define(grids,BL_SPACEDIM,ngrow,Fab_allocate); gradp.setVal(0.0); force.define(grids,BL_SPACEDIM,ngrow,Fab_allocate); force.setVal(0.0); scalforce.define(grids,numscal,ngrow,Fab_allocate); scalforce.setVal(0.0); // // These are the edge-based advection velocities and fluxes. // BoxArray edgex_grids(grids); edgex_grids.surroundingNodes(0); uadv.define(edgex_grids,1,0,Fab_allocate); edgex.define(edgex_grids,N_STATE,0,Fab_allocate); BoxArray edgey_grids(grids); edgey_grids.surroundingNodes(1); vadv.define(edgey_grids,1,0,Fab_allocate); edgey.define(edgey_grids,N_STATE,0,Fab_allocate); #if (BL_SPACEDIM == 3) BoxArray edgez_grids(grids); edgez_grids.surroundingNodes(2); wadv.define(edgez_grids,1,0,Fab_allocate); edgez.define(edgez_grids,N_STATE,0,Fab_allocate); #endif // // These are the edge velocities used to construct transverse derivatives. // utrans.define(edgex_grids,1,1,Fab_allocate); utrans.setVal(0.); vtrans.define(edgey_grids,1,1,Fab_allocate); vtrans.setVal(0.); #if (BL_SPACEDIM == 3) wtrans.define(edgez_grids,1,1,Fab_allocate); wtrans.setVal(0.); #endif proj = new hg_projector(grids,geom,area,vol); macproj = new mac_projector(grids,geom,area,vol); diffuse_op = new diffuser(grids,geom,area,vol); } // ************************************************************************ // ** initialInit ** // ************************************************************************ void Grid::initialInit(int& nstep, Real& time, Real& dt) { nstep = 0; time = 0.0; dt = 0.0; for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_INITDATA(state[mfi].dataPtr(),ARLIM(lo),ARLIM(hi), dx,&time,&numscal); } state.FillBoundary(Xvel,BL_SPACEDIM+numscal); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(state,Xvel,BL_SPACEDIM+numscal,true); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SETVELBC(state[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi),bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &visc_coef,dx,&time); const int* slo = state[mfi].loVect(); const int* shi = state[mfi].hiVect(); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state[mfi].dataPtr(Density+n),ARLIM(lo),ARLIM(hi), ARLIM(slo),ARLIM(shi), bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &n,dx,&time); } } MultiFab rhotemp(grids,1,1); rhotemp.setVal(1.0); BoxArray nodal_grids(grids); nodal_grids.surroundingNodes(); MultiFab divusrc(nodal_grids,1,0); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_MKDIVUNOD(divusrc[mfi].dataPtr(),state[mfi].dataPtr(Xvel), state[mfi].dataPtr(Density), &time,dx,ARLIM(lo),ARLIM(hi)); } proj->project(&state,&pressure,&rhotemp,&divusrc,time,dt); pressure.setVal(0.0); state.FillBoundary(Xvel,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(state,Xvel,BL_SPACEDIM,true); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SETVELBC(state[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi),bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &visc_coef,dx,&time); } staten.setVal(0.); staten.copy(state,0,0,N_STATE); } // ************************************************************************ // ** restart ** // ************************************************************************ void Grid::restart(std::string& filename, int& nstep, Real& time, Real& dt) { Real dRestartTime0 = ParallelDescriptor::second(); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Restarting calculation from file: " << filename << std::endl; // // Open the checkpoint header file for reading. // std::string File = filename; File += '/'; File += "Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ifstream is; is.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); is.open(File.c_str(), std::ios::in); if (!is.good()) BoxLib::FileOpenFailed(File); // Read the checkpoint version. std::string first_line; std::getline(is,first_line); // Read the number of space dimensions. int spdim; is >> spdim; BL_ASSERT(BL_SPACEDIM == spdim); // Read time, geom, dt, nstep is >> time; is >> geom; is >> dt; is >> nstep; // Read the state data. { std::string mf_name; is >> mf_name; std::string FullPathName = filename; if (!filename.empty() && filename[filename.length()-1] != '/') FullPathName += '/'; FullPathName += mf_name; MultiFab* new_data = new MultiFab; VisMF::Read(*new_data, FullPathName); MultiFab::Copy(state,*new_data,0,0,N_STATE,state.nGrow()); delete new_data; } // Read the pressure data. { std::string mf_name; is >> mf_name; std::string FullPathName = filename; if (!filename.empty() && filename[filename.length()-1] != '/') FullPathName += '/'; FullPathName += mf_name; MultiFab* new_data = new MultiFab; VisMF::Read(*new_data, FullPathName); MultiFab::Copy(pressure,*new_data,0,0,1,0); delete new_data; } state.FillBoundary(Xvel,BL_SPACEDIM+numscal); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(state,Xvel,N_STATE,true); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SETVELBC(state[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi),bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &visc_coef,dx,&time); const int* slo = state[mfi].loVect(); const int* shi = state[mfi].hiVect(); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state[mfi].dataPtr(Density+n),ARLIM(lo),ARLIM(hi), ARLIM(slo),ARLIM(shi), bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &n,dx,&time); } } // // Initialize local stats indicating this is a restart. // const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real dRestartTime1 = ParallelDescriptor::second(); Real dRestartTime = dRestartTime1 - dRestartTime0; ParallelDescriptor::ReduceRealMax(dRestartTime,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "Restart time = " << dRestartTime << " seconds." << std::endl; } // ************************************************************************ // ** destructor ** // ************************************************************************ Grid::~Grid() { delete proj; delete macproj; delete diffuse_op; } // ************************************************************************ // ** writeCheckPoint ** // ************************************************************************ void Grid::writeCheckPoint(int nstep, Real time, Real dt, std::string& check_file_root) { // construct file name std::string chkfile = check_file_root; char buf[sizeof(int)+1]; sprintf (buf,"%04d",nstep); chkfile += buf; const char* chkfile_sep_str ="/"; if (chkfile.length() == 0) { BoxLib::Error("invalid check_file_root"); } if (strchr(chkfile.c_str(), *chkfile_sep_str) == 0) { // No slashes in the path, so no need to create directory. } else { // Make copy of the directory pathname so we can write to it. char* path = new char[chkfile.length() + 1]; (void) strcpy(path, chkfile.c_str()); char* slash = strrchr(path, *chkfile_sep_str); int fileNameLength = strlen(slash); int entireNameLength = strlen(path); int dirNameLength = entireNameLength - fileNameLength; char* chkdir= new char[dirNameLength+1]; strncpy(chkdir,path,dirNameLength); chkdir[dirNameLength] = path[entireNameLength]; // create the directory if (!BoxLib::UtilCreateDirectory(chkdir,0755)){ BoxLib::CreateDirectoryFailed(chkdir); } delete [] chkdir; delete [] path; } // open stream std::ofstream os(chkfile.c_str(),std::ios::out); os.precision(15); os << nstep << '\n'; os << time << '\n'; os << dt << '\n'; os << geom << '\n'; for (MFIter statemfi(state); statemfi.isValid(); ++statemfi) { state[statemfi].writeOn(os); pressure[statemfi].writeOn(os); } } void Grid::printMaxMin() { Real umin = state.min(Xvel,0); Real umax = state.max(Xvel,0); if (ParallelDescriptor::IOProcessor()) std::cout << std::endl << "UMAX/UMIN " << umax << " " << umin << std::endl; Real vmin = state.min(Yvel,0); Real vmax = state.max(Yvel,0); if (ParallelDescriptor::IOProcessor()) std::cout << "VMAX/VMIN " << vmax << " " << vmin << std::endl; #if (BL_SPACEDIM == 3) Real wmin = state.min(Zvel,0); Real wmax = state.max(Zvel,0); if (ParallelDescriptor::IOProcessor()) std::cout << "WMAX/WMIN " << wmax << " " << wmin << std::endl; #endif Real rmin = state.min(Density,0); Real rmax = state.max(Density,0); if (ParallelDescriptor::IOProcessor()) std::cout << "RHOMAX/RHOMIN " << rmax << " " << rmin << std::endl; if (ParallelDescriptor::IOProcessor()) std::cout << std::endl; } // ************************************************************************ // ** initialIter ** // ************************************************************************ void Grid::initialIter(Real time, Real dt) { for (int iter = 0; iter < init_iter; iter++) { timeStep(time,dt); } } // ************************************************************************ // ** advance ** // ************************************************************************ void Grid::advance(Real time, Real dt) { timeStep(time,dt); state.copy(staten,0,0,N_STATE); staten.setVal(0.); } // ************************************************************************ // ** timeStep ** // ************************************************************************ void Grid::timeStep(Real time, Real dt) { state.FillBoundary(Xvel,BL_SPACEDIM+1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(state,Xvel,BL_SPACEDIM+1,true); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SETVELBC(state[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi),bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &visc_coef,dx,&time); } getSlopes(0,BL_SPACEDIM); getGradP(); getForce(time); getViscTerm(); printMaxMin(); #if BL_SPACEDIM==3 getKinetic(time); #endif makeAdvVels(time,dt); state.FillBoundary(Density,numscal); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(state,Density,numscal,true); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* slo = state[mfi].loVect(); const int* shi = state[mfi].hiVect(); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state[mfi].dataPtr(Density+n),ARLIM(lo),ARLIM(hi), ARLIM(slo),ARLIM(shi), bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &n,dx,&time); } } getSlopes(Density,numscal); updateScalars(time,dt); getRhoHalf(time,dt); updateVelocity(time,dt); } // ************************************************************************ // ** getSlopes ** // ************************************************************************ void Grid::getSlopes(int first_comp, int num_comp) { for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); int lenx = grids[i].length()[0]+4; Real *scratch = new Real[4*lenx]; #if (BL_SPACEDIM == 2) FORT_SLOPEX(state[mfi].dataPtr(first_comp), slopex[mfi].dataPtr(first_comp), scratch,ARLIM(lo),ARLIM(hi),&first_comp,&num_comp, bc[i].dataPtr(), &is_rz, &slope_order); #elif (BL_SPACEDIM == 3) FORT_SLOPEX(state[mfi].dataPtr(first_comp), slopex[mfi].dataPtr(first_comp), scratch,ARLIM(lo),ARLIM(hi),&num_comp, bc[i].dataPtr(), &slope_order); #endif delete scratch; } slopex.FillBoundary(first_comp,num_comp); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(slopex,first_comp,num_comp,true); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); int leny = grids[i].length()[1]+4; Real *scratch = new Real[4*leny]; FORT_SLOPEY(state[mfi].dataPtr(first_comp), slopey[mfi].dataPtr(first_comp), scratch,ARLIM(lo),ARLIM(hi),&num_comp, bc[i].dataPtr(), &slope_order); delete scratch; } slopey.FillBoundary(first_comp,num_comp); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(slopey,first_comp,num_comp,true); #if (BL_SPACEDIM == 3) for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); int lenz = grids[i].length()[2]+4; Real *scratch = new Real[4*lenz]; FORT_SLOPEZ(state[mfi].dataPtr(first_comp), slopez[mfi].dataPtr(first_comp), scratch,ARLIM(lo),ARLIM(hi),&num_comp, bc[i].dataPtr(),&slope_order); delete scratch; } slopez.FillBoundary(first_comp,num_comp); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(slopez,first_comp,num_comp,true); #endif } // ************************************************************************ // ** getViscTerm ** // ************************************************************************ void Grid::getViscTerm() { if (visc_coef > 0.) { for (int n = 0; n < BL_SPACEDIM; n++) { for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); #if (BL_SPACEDIM == 2) FORT_LAPLAC(state[mfi].dataPtr(n), visc[mfi].dataPtr(n), area[0][mfi].dataPtr(), area[1][mfi].dataPtr(), vol[mfi].dataPtr(), ARLIM(lo),ARLIM(hi), dx,&visc_coef,&is_rz,bc[i].dataPtr(),&n); #elif (BL_SPACEDIM == 3) FORT_LAPLAC(state[mfi].dataPtr(n), visc[mfi].dataPtr(n), area[0][mfi].dataPtr(), area[1][mfi].dataPtr(), area[2][mfi].dataPtr(), vol[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),dx,&visc_coef,bc[i].dataPtr()); #endif } } visc.FillBoundary(0,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(visc,0,BL_SPACEDIM,true); } } // ************************************************************************ // ** getDiffTerm ** // ************************************************************************ void Grid::getDiffTerm() { for (int n = 0; n < numscal; n++) { Real dc = diff_coef[n]; if (dc > 0.) { int icomp = Density + n; for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); #if (BL_SPACEDIM == 2) FORT_LAPLAC(state[mfi].dataPtr(icomp),diff[mfi].dataPtr(n), area[0][mfi].dataPtr(),area[1][mfi].dataPtr(), vol[mfi].dataPtr(), ARLIM(lo),ARLIM(hi), dx,&dc,&is_rz,bc[i].dataPtr(),&icomp); #elif (BL_SPACEDIM == 3) FORT_LAPLAC(state[mfi].dataPtr(icomp),diff[mfi].dataPtr(n), area[0][mfi].dataPtr(), area[1][mfi].dataPtr(), area[2][mfi].dataPtr(), vol[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),dx,&dc,bc[i].dataPtr()); #endif } } } diff.FillBoundary(0,numscal); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(diff,0,numscal,true); } // ************************************************************************ // ** getGradP ** // ************************************************************************ void Grid::getGradP() { proj->gradient(&gradp,&pressure); } // ************************************************************************ // compute kinetic energy // ************************************************************************ void Grid::getKinetic(Real current_time) { Real xmean = 0.; Real ymean = 0.; Real zmean = 0.; Real tix = 0.; Real tiy = 0.; Real tiz = 0.; for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const FArrayBox& fab = state[mfi]; FORT_KINE(fab.dataPtr(Xvel),ARLIM(fab.loVect()),ARLIM(fab.hiVect()), D_DECL(&xmean,&ymean,&zmean),D_DECL(&tix,&tiy,&tiz),lo,hi); } ParallelDescriptor::ReduceRealSum(xmean); ParallelDescriptor::ReduceRealSum(ymean); ParallelDescriptor::ReduceRealSum(tix); ParallelDescriptor::ReduceRealSum(tiy); #if BL_SPACEDIM==3 ParallelDescriptor::ReduceRealSum(zmean); ParallelDescriptor::ReduceRealSum(tiz); #endif Real factor = 1./float(grids.numPts()); Real kine = 0.5*(D_TERM(tix, + tiy, + tiz)); for (int i=0; iproject(&uadv,&vadv,&state,&divusrc); #elif (BL_SPACEDIM == 3) macproj->project(&uadv,&vadv,&wadv,&state,&divusrc); #endif } // ************************************************************************ // ** updateScalars ** // ************************************************************************ void Grid::updateScalars(Real time, Real dt) { if ((verbose==1) && ParallelDescriptor::IOProcessor()) std::cout << "Updating the scalars ... " << std::endl; Real newtime = time+dt; Real halftime = time+0.5*dt; bool is_inflow = false; for (int i = 0; i < grids.size(); i++) for (int n = 0; n < BL_SPACEDIM; n++) if (bc[i][2*n] == INLET || bc[i][2*n+1] == INLET) is_inflow = true; state.FillBoundary(Density,numscal); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(state,Density,numscal,true); if (is_inflow) { for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* slo = state[mfi].loVect(); const int* shi = state[mfi].hiVect(); for (int n = 0; n < numscal; n++) FORT_SETSCALBC(state[mfi].dataPtr(Density+n),ARLIM(lo),ARLIM(hi), ARLIM(slo),ARLIM(shi), bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &n,dx,&halftime); } } getDiffTerm(); getScalForce(time); MultiFab total_forces(grids,numscal,1,Fab_allocate); int velpred = 0; int nstart = Density+1; int nend = Density+numscal; for (MFIter mfi(state); mfi.isValid(); ++mfi) { total_forces[mfi].copy(scalforce[mfi],0,0,numscal); total_forces[mfi].plus(diff[mfi],0,0,numscal); int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); int lenx = grids[i].length()[0]+3; int leny = grids[i].length()[1]+3; Real *stlft = new Real[2*lenx]; Real *strgt = stlft + lenx; Real *stbot = new Real[2*leny]; Real *sttop = stbot + leny; #if (BL_SPACEDIM == 2) FORT_MKFLUX(state[mfi].dataPtr(), edgex[mfi].dataPtr(), edgey[mfi].dataPtr() , slopex[mfi].dataPtr(), slopey[mfi].dataPtr(), uadv[mfi].dataPtr(), vadv[mfi].dataPtr(), utrans[mfi].dataPtr(), vtrans[mfi].dataPtr(), total_forces[mfi].dataPtr(), stlft,strgt,stbot,sttop, ARLIM(lo),ARLIM(hi), dx,&dt,&visc_coef,&is_rz, bc[i].dataPtr(),&velpred,&nstart,&nend); #elif (BL_SPACEDIM == 3) int lenz = grids[i].length()[2]+3; Real *stdwn = new Real[2*lenz]; Real *stup = stdwn + lenz; FORT_MKFLUX(state[mfi].dataPtr(), edgex[mfi].dataPtr(), edgey[mfi].dataPtr() , edgez[mfi].dataPtr(), slopex[mfi].dataPtr(), slopey[mfi].dataPtr(), slopez[mfi].dataPtr(), uadv[mfi].dataPtr(), vadv[mfi].dataPtr(), wadv[mfi].dataPtr(), utrans[mfi].dataPtr(), vtrans[mfi].dataPtr(), wtrans[mfi].dataPtr(), total_forces[mfi].dataPtr(), stlft,strgt,stbot,sttop,stdwn,stup, ARLIM(lo),ARLIM(hi), dx,&dt,&visc_coef, bc[i].dataPtr(),&velpred,&nstart,&nend); delete stdwn; #endif delete stlft; delete stbot; } getScalForce(halftime); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SCALUPD(state[mfi].dataPtr(Density), staten[mfi].dataPtr(Density), edgex[mfi].dataPtr(Density), edgey[mfi].dataPtr(Density), #if (BL_SPACEDIM == 3) edgez[mfi].dataPtr(Density), #endif uadv[mfi].dataPtr(), vadv[mfi].dataPtr(), #if (BL_SPACEDIM == 3) wadv[mfi].dataPtr(), #endif diff[mfi].dataPtr(), scalforce[mfi].dataPtr(), area[0][mfi].dataPtr(), area[1][mfi].dataPtr(), #if (BL_SPACEDIM == 3) area[2][mfi].dataPtr(), #endif vol[mfi].dataPtr(), ARLIM(lo),ARLIM(hi), dx,&dt,is_conserv.dataPtr(),&numscal); } staten.FillBoundary(Density,numscal); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(staten,Density,numscal,true); for (MFIter mfi(staten); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* slo = staten[mfi].loVect(); const int* shi = staten[mfi].hiVect(); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(staten[mfi].dataPtr(Density+n),ARLIM(lo),ARLIM(hi), ARLIM(slo),ARLIM(shi), bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &n,dx,&newtime); } } for (int n = 0; n < numscal; n++) { if (diff_coef[n] > 0.0) { Real mu = .5*diff_coef[n]*dt; if ((verbose==1) && ParallelDescriptor::IOProcessor()) { if (n == 0) std::cout << "Diffusing the 1st scalar..." << std::endl; if (n == 1) std::cout << "Diffusing the 2nd scalar..." << std::endl; if (n == 2) std::cout << "Diffusing the 3rd scalar..." << std::endl; if (n > 2) std::cout << "Diffusing the " << n+1 <<"th scalar..." << std::endl; } diffuse_op->solveScal(&staten,mu,Density+n); } } staten.FillBoundary(Density,numscal); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(staten,Density,numscal,true); for (MFIter mfi(staten); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* slo = staten[mfi].loVect(); const int* shi = staten[mfi].hiVect(); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(staten[mfi].dataPtr(Density+n),ARLIM(lo),ARLIM(hi), ARLIM(slo),ARLIM(shi), bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &n,dx,&newtime); } } } // ************************************************************************ // ** getRhoHalf ** // ************************************************************************ void Grid::getRhoHalf(Real time, Real dt) { rhonph.copy(state,Density,0,1); for (MFIter mfi(rhonph); mfi.isValid(); ++mfi) { rhonph[mfi].plus(staten[mfi],grids[mfi.index()],Density,0,1); rhonph[mfi].mult(0.5,grids[mfi.index()]); } Real halftime = time + 0.5*dt; int n = 0; rhonph.FillBoundary(); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(rhonph,0,1,true); for (MFIter mfi(rhonph); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* slo = rhonph[mfi].loVect(); const int* shi = rhonph[mfi].hiVect(); FORT_SETSCALBC(rhonph[mfi].dataPtr(),ARLIM(lo),ARLIM(hi), ARLIM(slo),ARLIM(shi), bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &n,dx,&halftime); } } // ************************************************************************ // ** updateVelocity ** // ************************************************************************ void Grid::updateVelocity(Real time, Real dt) { if ((verbose==1) && ParallelDescriptor::IOProcessor()) std::cout << "Updating the velocity ... " << std::endl; MultiFab total_forces(grids,BL_SPACEDIM,1,Fab_allocate); int velpred = 0; int nstart = 1; int nend = BL_SPACEDIM; for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); int lenx = grids[i].length()[0]+3; int leny = grids[i].length()[1]+3; Real *stlft = new Real[2*lenx]; Real *strgt = stlft + lenx; Real *stbot = new Real[2*leny]; Real *sttop = stbot + leny; // Define the forcing term as F - Gp/rho + lapu/rho total_forces[mfi].copy(gradp[mfi],0,0,BL_SPACEDIM); total_forces[mfi].mult(-1.0); total_forces[mfi].plus(visc[mfi],0,0,BL_SPACEDIM); for (int n = 0; n < BL_SPACEDIM; n++) total_forces[mfi].divide(state[mfi],Density,n,1); total_forces[mfi].plus(force[mfi],0,0,BL_SPACEDIM); #if (BL_SPACEDIM == 2) FORT_MKFLUX(state[mfi].dataPtr(), edgex[mfi].dataPtr(), edgey[mfi].dataPtr(), slopex[mfi].dataPtr(), slopey[mfi].dataPtr(), uadv[mfi].dataPtr(), vadv[mfi].dataPtr(), utrans[mfi].dataPtr(), vtrans[mfi].dataPtr(), total_forces[mfi].dataPtr(), stlft,strgt,stbot,sttop, ARLIM(lo),ARLIM(hi), dx,&dt,&visc_coef, &is_rz,bc[i].dataPtr(),&velpred,&nstart,&nend); #elif (BL_SPACEDIM == 3) int lenz = grids[i].length()[2]+3; Real *stdwn = new Real[2*lenz]; Real *stup = stdwn + lenz; FORT_MKFLUX(state[mfi].dataPtr(), edgex[mfi].dataPtr(), edgey[mfi].dataPtr(), edgez[mfi].dataPtr(), slopex[mfi].dataPtr(), slopey[mfi].dataPtr(), slopez[mfi].dataPtr(), uadv[mfi].dataPtr(), vadv[mfi].dataPtr(), wadv[mfi].dataPtr(), utrans[mfi].dataPtr(), vtrans[mfi].dataPtr(), wtrans[mfi].dataPtr(), total_forces[mfi].dataPtr(), stlft,strgt,stbot,sttop, stdwn,stup, ARLIM(lo),ARLIM(hi), dx,&dt,&visc_coef, bc[i].dataPtr(),&velpred,&nstart,&nend); delete stdwn; #endif delete stlft; delete stbot; } Real halftime = time + 0.5*dt; getForce(halftime); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_VELUPD(state[mfi].dataPtr(Xvel), staten[mfi].dataPtr(Xvel), visc[mfi].dataPtr(),gradp[mfi].dataPtr(), rhonph[mfi].dataPtr(), uadv[mfi].dataPtr(),vadv[mfi].dataPtr(), #if (BL_SPACEDIM == 3) wadv[mfi].dataPtr(), #endif edgex[mfi].dataPtr(),edgey[mfi].dataPtr(), #if (BL_SPACEDIM == 3) edgez[mfi].dataPtr(), #endif force[mfi].dataPtr(),&dt,ARLIM(lo),ARLIM(hi),dx); } Real newtime = time+dt; staten.FillBoundary(Xvel,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(staten,Xvel,BL_SPACEDIM,true); for (MFIter mfi(staten); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SETVELBC(staten[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi),bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &visc_coef,dx,&newtime); } if (visc_coef > 0.0) { Real mu = .5*visc_coef*dt; diffuse_op->solveVel(&staten,&rhonph,mu); staten.FillBoundary(Xvel,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(staten,Xvel,BL_SPACEDIM,true); for (MFIter mfi(staten); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SETVELBC(staten[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi),bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &visc_coef,dx,&newtime); } } // Create the node-based source S for the divergence constraint Div(U) = S BoxArray nodal_grids(grids); nodal_grids.surroundingNodes(); MultiFab divusrc(nodal_grids,1,0); for (MFIter mfi(staten); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_MKDIVUNOD(divusrc[mfi].dataPtr(), staten[mfi].dataPtr(Xvel), staten[mfi].dataPtr(Density), &newtime,dx,ARLIM(lo),ARLIM(hi)); divusrc[mfi].mult(1./dt); staten[mfi].divide(dt,0,BL_SPACEDIM); } proj->project(&staten,&pressure,&rhonph,&divusrc,time,dt); staten.FillBoundary(Xvel,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(staten,Xvel,BL_SPACEDIM,true); for (MFIter mfi(staten); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); staten[mfi].mult(dt,0,BL_SPACEDIM); FORT_SETVELBC(staten[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi),bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &visc_coef,dx,&newtime); } } // ************************************************************************ // ** estimateDt ** // ************************************************************************ Real Grid::estimateDt(Real& dt, Real cfl) { getGradP(); Real cfl_temp = cfl; if (fixed_dt > 0) cfl_temp = 0.9; Real dt_old = dt; Real dt_local = 1.0e+20; dt = 1.0e+20; for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_CMPDT(state[mfi].dataPtr(Xvel), state[mfi].dataPtr(Density), gradp[mfi].dataPtr(Xvel), force[mfi].dataPtr(), dx,&dt_old,&dt_local,&cfl_temp, ARLIM(lo),ARLIM(hi)); dt = std::min(dt,dt_local); } ParallelDescriptor::ReduceRealMin(dt); if (fixed_dt > 0) { if (fixed_dt > dt && ParallelDescriptor::IOProcessor()) { std::cout << "WARNING: fixed_dt may be too big" << std::endl; std::cout << "fixed_dt = " << fixed_dt << " with CFL =0.9 computed_dt = " << dt << std::endl; } dt = fixed_dt; } if ((verbose==1) && ParallelDescriptor::IOProcessor()) std::cout << "Computing dt to be " << dt << std::endl; return dt; } // ************************************************************************ // ** DeriveFunc ** // ************************************************************************ // ------------ Define assoc between var name and derive func typedef void (*DeriveFunc) (Real* state, Real* derval, #if (BL_SPACEDIM == 2) const int& der_lo_1, const int& der_lo_2, const int& der_hi_1, const int& der_hi_2, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, #elif (BL_SPACEDIM == 3) const int& der_lo_1, const int& der_lo_2, const int& der_lo_3, const int& der_hi_1, const int& der_hi_2, const int& der_hi_3, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, #endif const Real* dx); // ************************************************************************ // ** DeriveRec ** // ************************************************************************ class DeriveRec { public: DeriveRec(std::string name, DeriveFunc f) : varname(name), func(f) {}; ~DeriveRec() {}; std::string varname; DeriveFunc func; }; DeriveRec vor_rec("vort", FORT_DERVORT); static DeriveRec deriveList[] = { vor_rec, }; int numDerive = sizeof(deriveList)/sizeof(DeriveRec); // ************************************************************************ // ** deriveData ** // ************************************************************************ void Grid::deriveData(MultiFab& derval, const std::string& name, Real time) { // is it a state variable int nGrow = 0; if (name == "x_velocity") { MultiFab::Copy(derval,state,Xvel,0,1,nGrow); return; } else if (name == "y_velocity") { MultiFab::Copy(derval,state,Yvel,0,1,nGrow); return; } else if (name == "density") { MultiFab::Copy(derval,state,Density,0,1,nGrow); return; } else if (name == "tracer") { MultiFab::Copy(derval,state,Tracer,0,1,nGrow); return; // IF YOU WISH TO ADD A NEW SCALAR VARIABLE, UNCOMMENT THESE LINES // } else if (name == "new_scalar") { // MultiFab::Copy(derval,state,NewScal,0,1,nGrow); // return; } else if (name == "pressure") { for (MFIter pmfi(pressure); pmfi.isValid(); ++pmfi) { const int i = pmfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_DERAVGP(pressure[pmfi].dataPtr(), derval[pmfi].dataPtr(), ARLIM(lo), ARLIM(hi)); } return; } else if (name == "px") { MultiFab::Copy(derval,gradp,Xvel,0,1,nGrow); return; } else if (name == "py") { MultiFab::Copy(derval,gradp,Yvel,0,1,nGrow); return; } // // If we got here, check list of known derived quantities. // for (int n = 0; n < numDerive; n++) { if (name == deriveList[n].varname) { state.FillBoundary(Xvel,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(state,Xvel,BL_SPACEDIM,true); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SET_CELL_VELBC(state[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi), bc[i].dataPtr(),&is_rz,&visc_coef,dx,&time); } for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* derlo = derval[mfi].loVect(); const int* derhi = derval[mfi].hiVect(); deriveList[n].func(state[mfi].dataPtr(Xvel),derval[mfi].dataPtr(), ARLIM(derlo),ARLIM(derhi), ARLIM(lo),ARLIM(hi),dx); } state.FillBoundary(Xvel,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(state,Xvel,BL_SPACEDIM,true); for (MFIter mfi(state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SETVELBC(state[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi), bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &visc_coef,dx,&time); } return; } } // if we got here, dont know how to derive this std::cerr << "Dont know how to derive " << name << std::endl; abort(); } // ************************************************************************ // ** writePlotFile ** // ************************************************************************ void Grid::writePlotFile(MultiFab& plotMF, Real time) { // Copy all of the data into the MultiFab. int nGrow = 0; int num_in_temp = std::max(BL_SPACEDIM,NumDerive()); MultiFab temp(grids,num_in_temp,0); int counter = 0; // Writing the state variables (velocity, density, tracer) MultiFab::Copy(plotMF,state,0,0,N_STATE,nGrow); counter += N_STATE; // Average the pressure from nodes to cell centers. for (MFIter pmfi(pressure); pmfi.isValid(); ++pmfi) { const int i = pmfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_DERAVGP(pressure[pmfi].dataPtr(), temp[pmfi].dataPtr(), ARLIM(lo), ARLIM(hi)); } MultiFab::Copy(plotMF,temp,0,counter,1,nGrow); counter++; // Writing the pressure gradient proj->gradient(&temp,&pressure); MultiFab::Copy(plotMF,temp,0,counter,BL_SPACEDIM,nGrow); counter += BL_SPACEDIM; ParallelDescriptor::Barrier(); state.FillBoundary(Xvel,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(state,Xvel,BL_SPACEDIM,true); // Writing the vorticity for (MFIter mfi(state); mfi.isValid(); ++mfi) { const int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SET_CELL_VELBC(state[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi),bc[i].dataPtr(), &is_rz,&visc_coef,dx,&time); } state.FillBoundary(Xvel,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(state,Xvel,BL_SPACEDIM,true); for (MFIter mfi(state); mfi.isValid(); ++mfi) { const int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); for(int n = 0; n < NumDerive(); n++) { deriveList[n].func(state[mfi].dataPtr(),temp[mfi].dataPtr(n), ARLIM(lo),ARLIM(hi),ARLIM(lo),ARLIM(hi),dx); } } MultiFab::Copy(plotMF,temp,0,counter,numDerive,nGrow); counter += numDerive; for (MFIter mfi(state); mfi.isValid(); ++mfi) { const int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SETVELBC(state[mfi].dataPtr(Xvel), ARLIM(lo),ARLIM(hi),bc[i].dataPtr(), #if (BL_SPACEDIM == 2) &is_rz, #endif &visc_coef,dx,&time); } } // ************************************************************************ // ** NumState ** // ************************************************************************ int Grid::NumState() { int n = N_STATE; return n; } // ************************************************************************ // ** NumDerive ** // ************************************************************************ int Grid::NumDerive() { int numDerive = sizeof(deriveList)/sizeof(DeriveRec); return numDerive; } void Grid::checkPoint (const std::string& dir, std::ostream& os, VisMF::How how) { int ndesc = NumState() + NumDerive(); // // Build directory to hold the MultiFabs in the StateData at this level. // The directory is relative the the directory containing the Header file. // char buf[64]; sprintf(buf, "Level_%d", 0); std::string Level = buf; // // Now for the full pathname of that directory. // std::string FullPath = dir; if (!FullPath.empty() && FullPath[FullPath.length()-1] != '/') { FullPath += '/'; } FullPath += Level; // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) BoxLib::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); // Output data contained in "staten." { std::string PathNameInHeader = Level; sprintf(buf, "/State"); PathNameInHeader += buf; std::string FullPathName = FullPath; FullPathName += buf; std::string mf_name_new = PathNameInHeader; if (ParallelDescriptor::IOProcessor()) os << mf_name_new << '\n'; std::string mf_fullpath_new = FullPathName; VisMF::Write(state,mf_fullpath_new,how); } // Output data contained in "pressure" { std::string PathNameInHeader = Level; sprintf(buf, "/Pressure"); PathNameInHeader += buf; std::string FullPathName = FullPath; FullPathName += buf; std::string mf_name_new = PathNameInHeader; if (ParallelDescriptor::IOProcessor()) os << mf_name_new << '\n'; std::string mf_fullpath_new = FullPathName; VisMF::Write(pressure,mf_fullpath_new,how); } } ccseapps-2.5/CCSEApps/pVarden/setscalbc_3d.F0000644000175000017500000001447211634153073021726 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #define SDIMS slo_1,slo_2,slo_3,shi_1,shi_2,shi_3 #if BL_USE_FLOAT #define threehalves 1.5e0 #else #define threehalves 1.5d0 #endif c ************************************************************************* c ** SETSCALBC ** c ** Impose the physical boundary conditions on scalars s c ************************************************************************* subroutine setscalbc(s,DIMS,SDIMS,bc,which_scal,dx,time) implicit none integer DIMS integer SDIMS integer which_scal integer bc(2,3) REAL_T dx(3) REAL_T time REAL_T s(slo_1:shi_1,slo_2:shi_2,slo_3:shi_3) c Local variables integer is,ie,js,je,ks,ke,i,j,k integer ilo,ihi,jlo,jhi integer ng,ngmax is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 ilo = cvmgt(slo_1,lo_1,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) ihi = cvmgt(shi_1,hi_1,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) jlo = cvmgt(slo_2,lo_2,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) jhi = cvmgt(shi_2,hi_2,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) ngmax = lo_1 - slo_1 c NOTE: IF BC == WALL, THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL c BOUNDARY, NOT IN THE GHOST CELL if (BCZ_LO .eq. WALL) then do ng = 1,ngmax do j = jlo,jhi do i = ilo,ihi c s(i,j,ks-1) = threehalves*s(i,j,ks) - half*s(i,j,ks+1) s(i,j,ks-ng) = s(i,j,ks) enddo enddo enddo elseif (BCZ_LO .eq. INLET) then call scalinflow(s,DIMS,SDIMS,time,dx,2,0,which_scal) elseif (BCZ_LO .eq. OUTLET) then do ng = 1,ngmax do j = jlo,jhi do i = ilo,ihi c s(i,j,ks-1) = threehalves*s(i,j,ks) - half*s(i,j,ks+1) s(i,j,ks-ng) = s(i,j,ks) enddo enddo enddo endif if (BCZ_HI .eq. WALL) then do ng = 1,ngmax do j = jlo,jhi do i = ilo,ihi c s(i,j,ke+1) = threehalves*s(i,j,ke) - half*s(i,j,ke-1) s(i,j,ke+ng) = s(i,j,ke) enddo enddo enddo elseif (BCZ_HI .eq. INLET) then call scalinflow(s,DIMS,SDIMS,time,dx,2,1,which_scal) elseif (BCZ_HI .eq. OUTLET) then do ng = 1,ngmax do j = jlo,jhi do i = ilo,ihi c s(i,j,ke+1) = threehalves*s(i,j,ke) - half*s(i,j,ke-1) s(i,j,ke+ng) = s(i,j,ke) enddo enddo enddo endif if (BCY_LO .eq. WALL) then do ng = 1,ngmax do k = slo_3,shi_3 do i = ilo,ihi c s(i,js-1,k) = threehalves*s(i,js,k) - half*s(i,js+1,k) s(i,js-ng,k) = s(i,js,k) enddo enddo enddo elseif (BCY_LO .eq. INLET) then call scalinflow(s,DIMS,SDIMS,time,dx,1,0,which_scal) elseif (BCY_LO .eq. OUTLET) then do ng = 1,ngmax do k = slo_3,shi_3 do i = ilo,ihi c s(i,js-1,k) = threehalves*s(i,js,k) - half*s(i,js+1,k) s(i,js-ng,k) = s(i,js,k) enddo enddo enddo endif if (BCY_HI .eq. WALL) then do ng = 1,ngmax do k = slo_3,shi_3 do i = ilo,ihi c s(i,je+1,k) = threehalves*s(i,je,k) - half*s(i,je-1,k) s(i,je+ng,k) = s(i,je,k) enddo enddo enddo elseif (BCY_HI .eq. INLET) then call scalinflow(s,DIMS,SDIMS,time,dx,1,1,which_scal) elseif (BCY_HI .eq. OUTLET) then do ng = 1,ngmax do k = slo_3,shi_3 do i = ilo,ihi c s(i,je+1,k) = threehalves*s(i,je,k) - half*s(i,je-1,k) s(i,je+ng,k) = s(i,je,k) enddo enddo enddo endif if (BCX_LO .eq. WALL) then do ng = 1,ngmax do k = slo_3,shi_3 do j = slo_2,shi_2 c s(is-1,j,k) = threehalves*s(is,j,k) - half*s(is+1,j,k) s(is-ng,j,k) = s(is,j,k) enddo enddo enddo elseif (BCX_LO .eq. INLET) then call scalinflow(s,DIMS,SDIMS,time,dx,0,0,which_scal) elseif (BCX_LO .eq. OUTLET) then do ng = 1,ngmax do k = slo_3,shi_3 do j = slo_2,shi_2 c s(is-1,j,k) = threehalves*s(is,j,k) - half*s(is+1,j,k) s(is-ng,j,k) = s(is,j,k) enddo enddo enddo endif if (BCX_HI .eq. WALL) then do ng = 1,ngmax do k = slo_3,shi_3 do j = slo_2,shi_2 c s(ie+1,j,k) = threehalves*s(ie,j,k) - half*s(ie-1,j,k) s(ie+ng,j,k) = s(ie,j,k) enddo enddo enddo elseif (BCX_HI .eq. INLET) then call scalinflow(s,DIMS,SDIMS,time,dx,0,1,which_scal) elseif (BCX_HI .eq. OUTLET) then do ng = 1,ngmax do k = slo_3,shi_3 do j = slo_2,shi_2 c s(ie+1,j,k) = threehalves*s(ie,j,k) - half*s(ie-1,j,k) s(ie+ng,j,k) = s(ie,j,k) enddo enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/mkforce_3d.F0000644000175000017500000000746511634153073021415 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKFORCE ** c ** Define the forcing terms in the momentum equation c *************************************************************** subroutine FORT_MKFORCE(force,u,rho,gravity,visc_coef,time,dx,DIMS) implicit none integer DIMS REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) REAL_T rho(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3) REAL_T gravity REAL_T time REAL_T dx(3) REAL_T visc_coef REAL_T x,y,z,a2,a3,a4,a5 c Local variables integer i,j,k a2 = dsqrt(2.d0) a3 = dsqrt(3.d0) a4 = dsqrt(4.d0) a5 = dsqrt(5.d0) do k = lo_3-1,hi_3+1 z = float(k)*dx(3) do j = lo_2-1,hi_2+1 y = float(j)*dx(2) do i = lo_1-1,hi_1+1 x = float(i)*dx(1) c force(i,j,k,1) = sin(x+.2d0)*cos(y+a3)+a2*sin(x+1.d0)*cos(z+a2) c force(i,j,k,2) = -cos(x+.2d0)*sin(y+a3)+a3*sin(y)*cos(z+a5) c force(i,j,k,3) = -a2*cos(x+1.d0)*sin(z+a2)-a3*cos(y)*sin(z+a5) force(i,j,k,1) = zero force(i,j,k,2) = zero force(i,j,k,3) = zero enddo enddo enddo return end #include "ArrayLim.H" subroutine FORT_KINE(u,DIMS(u),xmean,ymean,zmean,tix,tiy,tiz,lo,hi) implicit none integer DIMDEC(u) integer lo(3), hi(3) REAL_T u(DIMV(u),3) REAL_T xmean,ymean,zmean,tix,tiy,tiz integer i,j,k do k = lo(3),hi(3) do j = lo(2),hi(2) do i = lo(1),hi(1) xmean = xmean + u(i,j,k,1) ymean = ymean + u(i,j,k,2) zmean = zmean + u(i,j,k,3) tix = tix + u(i,j,k,1)**2 tiy = tiy + u(i,j,k,2)**2 tiz = tiz + u(i,j,k,3)**2 enddo enddo enddo end subroutine FORT_WRITEVEL(u,DIMS(u),lo,hi,psize) implicit none integer DIMDEC(u) integer lo(3), hi(3) REAL_T u(DIMV(u),3) REAL_T psize(3) integer i,j,k,n open(3,file='Turb',form='formatted') rewind 3 write(3,*)hi(1)-lo(1)+1,hi(2)-lo(2)+1,hi(3)-lo(3)+1 write(3,*)psize(1),psize(2),psize(3) write(3,*)1,1,1 do n = 1,3 do k = lo(3),hi(3) do j = lo(2),hi(2) do i = lo(1),hi(1) write(3,*)u(i,j,k,n) enddo enddo enddo enddo close(3) end ccseapps-2.5/CCSEApps/pVarden/README0000644000175000017500000003016311634153073020141 0ustar amckinstryamckinstry ########################################################################## INTRODUCTION ########################################################################## The code in this directory is a parallel version of the code in Parallel/varden2d and Parallel/varden3d, which implement a variable density projection method for the incompressible Navier-Stokes equations. The parallelization is based on domain decomposition of the single level problem domain; there are no additional levels of refinement. The granularity of the decomposition is determined by a max_grid_size parameter in the inputs files. We use Godunov upwind methodology for the advection terms, a Crank-Nicolson discretization of the viscous terms in the momentum equation, and an approximate node-based projection to enforce the divergence-free constraint on velocity. This algorithm is described in detail in several papers; here we refer you to the section of the recent paper, "A Conservative Adaptive Projection Method for the Variable Density Incompressible Navier-Stokes Equations" on the single grid projection algorithm, which can be found on the web site. See also the references cited therein. There are a number of differences between the implementation details of this version compared to the serial code. Make sure to use the inputs files in this directory as samples. Note also that this code builds on the ../bndrylib as well as the ../pBoxLib_2 directory. In addition, you will need to replace the Geometry.cpp file in the Parallel/bndrylib directory by the one included in this directory, since it has slightly more functionality than the one included in the original bndrylib release. There have been two changes to the algorithm: 1) The velocities used to compute transverse derivatives in the predictor are now defined exactly as described in the IAMR paper and implemented in the iamrlib directory, as opposed to a slightly different version before. 2) The form of the approximate projection has been modified, to be non-incremental in both pressure and velocity. This has been shown (see the paper by Almgren, Bell and Crutchfield) to be a more robust formulation. Both of these changes have also been implemented in the newly-revised varden2d and varden3d directories. The code in pVarden gives solutions identical to those given by the codes in these directories for the same test problems. In addition, 1) The run-time contouring capability has been removed from this parallel version. 2) The user may choose whether to use the 5-point or 9-point stencil in 2d for the nodal projection. This choice is made by defining NINEPT or FIVEPT at the beginning of hg_2d.F The nine-point stencil is considered to be more robust, and is the one previously used in the VarDen code. The 5-point stencil is useful for comparisons of the 2-d and 3-d codes, since the 3-d code uses the analogous 7-point stencil. ########################################################################## MAKING THE EXECUTABLE ########################################################################## To run this code, you must build the varden executable in this directory. You will also want to build the AmrVis executable in ../pAmrvis. Modify the GNUmakefile in this directory to set the following flags: DIM = 2 or 3 COMP = your compiler DEBUG = TRUE or FALSE PRECISION = DOUBLE or FLOAT USE_MPI = FALSE or TRUE PROFILE = FALSE To make the executable, simply type "make" in this directory. To make the AmrVis executable, move into the ../pAmrvis directory, modify the flags in the GNUmakefile there appropriately, and type "make" in that directory. The executable will look something like run2d.OSF1.KCC.ex . This is a two-dimensional executable built with the OSF1 operating system, the KCC compiler, and the DEBUG=FALSE flag set in the GNUmakefile. If DEBUG=TRUE, the executable will look like run2d.OSF1.KCC.DEBUG.ex . The DEBUG=TRUE option exercises certain debug options in the pBoxLib library, and turns on several Fortran debug options also, which may be helpful if you are trying to debug a new code. The DEBUG=FALSE version runs more quickly. ########################################################################## VIEWING THE DATA ########################################################################## In order to view the data from calculations using pVarden, you will need the pAmrvis executable. Plotfiles are generated by the pVarden code during runtime. The frequency of plot file generation is controlled in the inputs file by the parameter "plot_int." These files contain the velocity, scalars, pressure averaged onto cells, pressure gradient and vorticity at the time specified. You can add additional derived quantities to the plot files by modifying Grid::writePlotFile. After the plot file (plt0001, e.g.) has been created, it can be viewed by typing ../pAmrvis/amrvis2d*ex plt0001 or ../pAmrvis/amrvis3d*ex plt0001 (depending on whether you ran a 2d or 3d executable) Sample plot files from each of the sample problems are included here in the subdirectory PlotFiles. ########################################################################## RUNNING THE EXECUTABLE ########################################################################## To run the code you will need two different files in your directory : one read by main(), the other read by FORT_PROBINIT. The first is typically called "inputs", but this name is set on the command line. The name of the second is typically "probin", but this name is set in the inputs file which is read in. There are six test problems set up for you to run in 2d or five problems in 3d; you can later edit the prob_2d.F/prob_3d.F files and the inputs and probin files to create your own test problems. You can also modify the existing inputs and probin files to run these test problems at different resolution and with different parameters. ----------------------------------------------------------------------------- To run a 2d/3d constant-density inviscid spindown problem, type run2d.OSF1.KCC.ex inputs1.2d OR run3d.OSF1.KCC.ex inputs1.3d (This will read probin1) ----------------------------------------------------------------------------- To run a 2d/3d variable-density inviscid bubble drop problem, type run2d.OSF1.KCC.ex inputs2.2d OR run3d.OSF1.KCC.ex inputs2.3d (This will read probin2) ----------------------------------------------------------------------------- To run a 2d/3d constant-density doubly periodic shear layer problem, type run2d.OSF1.KCC.ex inputs3.2d OR run3d.OSF1.KCC.ex inputs3.3d (This will read probin3) ----------------------------------------------------------------------------- To run a 2d/3d viscous flow-in-a-channel problem, type run2d.OSF1.KCC.ex inputs4.2d OR run3d.OSF1.KCC.ex inputs4.3d (This will read probin4) ----------------------------------------------------------------------------- To run a Poiseuille viscous flow problem in x-y, type run2d.OSF1.KCC.ex inputs5.2d OR run3d.OSF1.KCC.ex inputs5.3d (This will read probin5) ----------------------------------------------------------------------------- In 2d only: to run a Poiseuille viscous flow problem in r-z, type run2d.OSF1.KCC.ex inputs6.2d (This will read probin6) ########################################################################## 3d equivalents of problems 1-4 are defined in prob_3d.F, and can be run using the same inputs files. ########################################################################## To set up a different problem using the variables as given : x-velocity (u), y-velocity (v), density (rho), tracer (1) Determine which problem-specific constant parameters you would like to be able to change at run-time. Put these into probin (using the format there) and edit probdata.H to incorporate them appropriately - make sure to add them both to the declaration statement as well as the common block. (2) Edit FORT_INITDATA and/or the routines it calls in prob.F to set up your initial data. You must initialize all the state variables - u, v, rho, and the tracer. (3) If you would like the velocity field to satisfy div(u) = S rather than div(u) = 0, you must set S on cell centers and on nodes by editing mkdivucc.F and mkdivunod.F . The current default is S = 0. (4) If you would like to have a forcing term in your scalar equation, define it in mkscalforce.F IN INPUTS: (5) Set boundary conditions using the boundary condition flags bcx_lo,bcx_hi,bcy_lo and bcy_hi. See the comments there for a description of the flags. If you are using inflow boundary conditions, you must edit "setvelinflow" and "setscalinflow" in prob.F appropriately to supply the correct inflow boundary conditions. (6) If this is a viscous problem, set visc_coef to be the dynamic viscosity (assumed constant). (7) If you would like your scalar to diffuse, set the diff_coef array appropriately. (8) If you have gravity in your problem then set the gravity value according to your physical units. The default in mkforce.F is that gravity acts in the y-direction; you can of course change this. (9) Set max_step and stop_time to determine how long your calculation will run. If you want to be governed by max_step, set stop_time to a very large number. If you want to be governed by stop_time, set max_step to be a very large integer. (10)Set check_int and plot_int to govern your graphics output and restart capability. (11)Set grid.n_cell to be the size (in index space) of your problem, e.g. for a 16x32 calculation you would set grid.n_cell = 16 32 (12)Set grid.prob_lo and grid.prob_hi to be the physical coordinates of the low and high ends of your domain. E.g. if your calculation is in a 1x2 box starting at the origin, then set grid.prob_lo = 0. 0. grid.prob_hi = 1. 2. ########################################################################## IF YOU NEED TO, MODIFY THE FOLLOWING IN INPUTS. OTHERWISE, LEAVE AT THEIR DEFAULT VALUES. (14) Set the cfl number to be any number from 0 to 1 (in order to keep the calculation stable). Suggested value for a relatively stable problem is 0.9; if your problem is unstable at this value then you must reduce it accordingly. (15) If the problem starts with a small velocity but large acceleration, it is suggested that you set init_shrink to be smaller than 1, e.g. 0.1. If not, leave init_shrink = 1. (16) Decide how you want to advect your scalars, using conservative or convective differences. Set grid.is_conserv appropriately. (17) Leave slope_order = 4 and init_iter = 2 unless you have reasons to change them. (18) On a double precision workstation or a CRAY, leave the tolerances hg.tol and mac.tol at 1.e-12 unless you have reason to change them. For a single precision machine you will need to raise these values. (19) Leave the multigrid flags as is unless you like to see the convergence of the multigrid solves. ########################################################################## If you want to advect n additional quantities as tracers in addition to density, you must follow these steps: (1) Define N_STATE in Grid.cpp to be 4 + n. The current version of the code is set up to have only one scalar ("tracer") in addition to the density, hence N_STATE is set to 4. (2) Modify "Grid::deriveData(...) appropriately, mimicing the format which is there. Note that you are allowed to choose the name of the variable in deriveData - make sure that you then add the variable to the list of contour variables in the inputs file, using the same name. (3) Modify "Grid::writePlotFile(...) appropriately, uncomment the line which is commented there using the name "new_scalar" - replace new_scalar by the name you used in (2) above. (4) Initialize the new variable appropriately in FORT_INITDATA in prob.F . (5) Modify mkscalforce.F appropriately if there is a forcing term for the new scalar. ccseapps-2.5/CCSEApps/pVarden/inputs4.2d0000644000175000017500000002275411634153073021125 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 20 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 32 16 ############################################################################# # Maximum size of grid allowed. max_grid_size = 16 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin4 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 0 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 3 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 4 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 2. 1. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/inputs2.3d0000644000175000017500000002466511634153073021127 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 240 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 16 16 32 ############################################################################# # Maximum size of grid allowed. max_grid_size = 64 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin2_3d ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 0.1 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = -9.8 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 0 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ############################################################################# # Boundary conditions in the low z-direction. # If bcz_lo = 1, the domain is periodic in the z-direction. # If bcz_lo = 2, the domain has a solid (reflecting) walls in the low z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_lo = 3, the domain has inflow at low z. # If bcz_lo = 4, the domain has outflow at low z. bcz_lo = 2 ############################################################################# # Boundary conditions in the high z-direction. # If bcz_hi = 1, the domain is periodic in the z-direction. # If bcz_hi = 2, the domain has a solid (reflecting) wall in the high z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_hi = 3, the domain has inflow at high z. # If bcz_hi = 4, the domain has outflow at high z. bcz_hi = 2 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 1. 1. 2. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.0 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/BCTypes.H0000644000175000017500000000371111634153073020702 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BC_TYPES_H_ #define _BC_TYPES_H_ #ifdef BL_LANG_FORT #if (BL_SPACEDIM == 2) #define BCX_LO bc(1,1) #define BCX_HI bc(2,1) #define BCY_LO bc(1,2) #define BCY_HI bc(2,2) #elif (BL_SPACEDIM == 3) #define BCX_LO bc(1,1) #define BCX_HI bc(2,1) #define BCY_LO bc(1,2) #define BCY_HI bc(2,2) #define BCZ_LO bc(1,3) #define BCZ_HI bc(2,3) #endif #define UNDEFINED -3 #define INTERIOR -2 #define PERIODIC 1 #define WALL 2 #define INLET 3 #define OUTLET 4 #else /// type of boundary enum BndryTypes { /// undefined UNDEFINED = -3, /// interior INTERIOR = -2, /// periodic PERIODIC = 1, /// wall WALL, /// inlet INLET, /// outlet OUTLET }; #endif #endif ccseapps-2.5/CCSEApps/pVarden/MACPROJ_F.H0000644000175000017500000001755611634153073020745 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_INITSIGMA initsigma # define FORT_COARSIGMA coarsigma # define FORT_RHSMAC rhsmac # define FORT_RESIDUAL resmac # define FORT_RELAX relaxmac # define FORT_RESTRICT coarsres # define FORT_INTERPOLATE interp # define FORT_PROJUMAC projumac # define FORT_SOLVEMAC solvemac # define FORT_MKSUMMAC mksummac #else #if defined(BL_FORT_USE_UNDERSCORE) # define FORT_INITSIGMA initsigma_ # define FORT_COARSIGMA coarsigma_ # define FORT_RHSMAC rhsmac_ # define FORT_RESIDUAL resmac_ # define FORT_RELAX relaxmac_ # define FORT_RESTRICT coarsres_ # define FORT_INTERPOLATE interp_ # define FORT_PROJUMAC projumac_ # define FORT_SOLVEMAC solvemac_ # define FORT_MKSUMMAC mksummac_ #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_INITSIGMA INITSIGMA # define FORT_COARSIGMA COARSIGMA # define FORT_RHSMAC RHSMAC # define FORT_RESIDUAL RESMAC # define FORT_RELAX RELAXMAC # define FORT_RESTRICT COARSRES # define FORT_INTERPOLATE INTERP # define FORT_PROJUMAC PROJUMAC # define FORT_SOLVEMAC SOLVEMAC # define FORT_MKSUMMAC MKSUMMAC #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_INITSIGMA initsigma # define FORT_COARSIGMA coarsigma # define FORT_RHSMAC rhsmac # define FORT_RESIDUAL resmac # define FORT_RELAX relaxmac # define FORT_RESTRICT coarsres # define FORT_INTERPOLATE interp # define FORT_PROJUMAC projumac # define FORT_SOLVEMAC solvemac # define FORT_MKSUMMAC mksummac #endif #include extern "C" { #if (BL_SPACEDIM == 2) void FORT_INITSIGMA(Real * sigmax, Real * sigmay, Real * rho, const Real * areax, const Real * areay, ARLIM_P(lo), ARLIM_P(hi), int * bc, int * ng); void FORT_RHSMAC(Real * uhalfx, Real * uhalfy, Real * divu_src, Real * rhs, const Real * areax, const Real * areay, const Real * vol, ARLIM_P(lo), ARLIM_P(hi), Real * rhsnorm, int * ng); void FORT_RESIDUAL(Real * resid, Real * phi, Real * f, Real * sigmax, Real * sigmay, ARLIM_P(lo), ARLIM_P(hi), const Real * dx, Real * rnorm, int * bc, int * ng); void FORT_COARSIGMA(Real * sigmax , Real * sigmay, Real * sigmaxc, Real * sigmayc, ARLIM_P(lo ), ARLIM_P(hi ), ARLIM_P(loc), ARLIM_P(hic), int * ng); void FORT_RESTRICT(Real * res , Real * crse_res, ARLIM_P(lo ), ARLIM_P(hi ), ARLIM_P(loc), ARLIM_P(hic), int * nextra); void FORT_INTERPOLATE(Real * phi, Real * deltac, ARLIM_P(lo ), ARLIM_P(hi ), ARLIM_P(loc), ARLIM_P(hic), int * ng); void FORT_RELAX(Real * phi, Real * f, Real * sigmax, Real * sigmay, ARLIM_P(lo ), ARLIM_P(hi ), const Real * dx, int * bc, int * nnrelax, int * ng); void FORT_PROJUMAC(Real * uhalfx, Real * uhalfy, Real * sigmax, Real * sigmay, Real * phi, const Real * areax, const Real * areay, const Real * dx, ARLIM_P(lo ), ARLIM_P(hi ), int * bc, const int * is_rz, int * ng); void FORT_SOLVEMAC(Real * dest, Real * dest0, Real *source, Real * sigmax, Real * sigmay, Real * sum, Real * r, Real * w, Real * z, Real * work, ARLIM_P(lo ), ARLIM_P(hi ), const Real * dx, int * bc, Real * norm, Real * prob_norm, int * ng); void FORT_MKSUMMAC(Real * sum, Real * sigmax, Real * sigmay, ARLIM_P(lo ), ARLIM_P(hi ), const Real * dx, int * ng); #elif (BL_SPACEDIM == 3) void FORT_INITSIGMA(Real * sigmax, Real * sigmay, Real * sigmaz, Real * rho, const Real * areax, const Real * areay, const Real * areaz, ARLIM_P(lo), ARLIM_P(hi), int * bc, int * ng); void FORT_RHSMAC(Real * uhalfx, Real * uhalfy, Real * uhalfz, Real * divu_src, Real * rhs, const Real * areax, const Real * areay, const Real * areaz, const Real * vol, ARLIM_P(lo), ARLIM_P(hi), Real * rhsnorm, int * ng); void FORT_RESIDUAL(Real * resid, Real * phi, Real * f, Real * sigmax, Real * sigmay, Real * sigmaz, ARLIM_P(lo), ARLIM_P(hi), const Real * dx, Real * rnorm, int * bc, int * ng); void FORT_COARSIGMA(Real * sigmax , Real * sigmay , Real * sigmaz, Real * sigmaxc, Real * sigmayc, Real * sigmazc, ARLIM_P(lo ), ARLIM_P(hi ), ARLIM_P(loc), ARLIM_P(hic), int * ng); void FORT_RESTRICT(Real * res , Real * crse_res, ARLIM_P(lo ), ARLIM_P(hi ), ARLIM_P(loc), ARLIM_P(hic), int * nextra); void FORT_INTERPOLATE(Real * phi, Real * deltac, ARLIM_P(lo ), ARLIM_P(hi ), ARLIM_P(loc), ARLIM_P(hic), int * ng); void FORT_RELAX(Real * phi, Real * f, Real * sigmax, Real * sigmay, Real * sigmaz, ARLIM_P(lo ), ARLIM_P(hi ), const Real * dx, int * bc, int * nnrelax, int * ng); void FORT_PROJUMAC(Real * uhalfx, Real * uhalfy, Real * uhalfz, Real * sigmax, Real * sigmay, Real * sigmaz, Real * phi, const Real * areax, const Real * areay, const Real * areaz, const Real * dx, ARLIM_P(lo ), ARLIM_P(hi ), int * bc, int * ng); void FORT_SOLVEMAC(Real * dest, Real * dest0, Real *source, Real * sigmax, Real * sigmay, Real * sigmaz, Real * sum, Real * r, Real * w, Real * z, Real * work, ARLIM_P(lo ), ARLIM_P(hi ), const Real * dx, int * bc, Real * norm, Real * prob_norm, int * ng); void FORT_MKSUMMAC(Real * sum, Real * sigmax, Real * sigmay, Real * sigmaz, ARLIM_P(lo), ARLIM_P(hi), const Real * dx, int * ng); #endif }; #endif ccseapps-2.5/CCSEApps/pVarden/mkflux_3d.F0000644000175000017500000005771311634153073021276 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define N_STATE 5 #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKFLUX ** c ** Create the time-centered edge states for the velocity components c *************************************************************** subroutine FORT_MKFLUX(s,sedgex,sedgey,sedgez, $ slopex,slopey,slopez,uadv,vadv,wadv, $ utrans,vtrans,wtrans,force, $ s_l,s_r,s_b,s_t,s_d,s_u,DIMS, $ dx,dt,visc_coef,bc,velpred,nstart,nend) implicit none integer DIMS integer nstart,nend REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,N_STATE) REAL_T sedgex(lo_1 :hi_1+1,lo_2 :hi_2 ,lo_3 :hi_3 ,N_STATE) REAL_T sedgey(lo_1 :hi_1 ,lo_2 :hi_2+1,lo_3 :hi_3 ,N_STATE) REAL_T sedgez(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1,N_STATE) REAL_T slopex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,N_STATE) REAL_T slopey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,N_STATE) REAL_T slopez(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,N_STATE) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wadv(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T utrans(lo_1-1:hi_1+2,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T vtrans(lo_1-1:hi_1+1,lo_2-1:hi_2+2,lo_3-1:hi_3+1) REAL_T wtrans(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+2) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,nstart:nend) REAL_T s_l(lo_1-1:hi_1+2) REAL_T s_r(lo_1-1:hi_1+2) REAL_T s_b(lo_2-1:hi_2+2) REAL_T s_t(lo_2-1:hi_2+2) REAL_T s_d(lo_3-1:hi_3+2) REAL_T s_u(lo_3-1:hi_3+2) REAL_T dx(3) REAL_T dt REAL_T visc_coef integer bc(2,3) integer velpred c Local variables REAL_T ubardth, vbardth, wbardth REAL_T hx, hy, hz, dth REAL_T splus,sminus,st,str,savg REAL_T sptop,spbot,smtop,smbot,splft,sprgt,smlft,smrgt logical test REAL_T eps integer i,j,k,is,js,ks,ie,je,ke,n eps = 1.0e-8 is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 dth = half*dt hx = dx(1) hy = dx(2) hz = dx(3) c ::: loop for x fluxes do n = nstart,nend if (velpred .eq. 0 .or. n .eq. 1) then do k = ks,ke do j = js,je do i = is-1,ie+1 c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Y-DIRECTION c ****************************************************************** spbot = s(i,j ,k,n) + (half - dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,n) c $ + dth * force(i, j,k,n) sptop = s(i,j+1,k,n) - (half + dth*s(i,j+1,k,2)/hy)*slopey(i,j+1,k,n) c $ + dth * force(i,j+1,k,n) sptop = cvmgt(s(i,je+1,k,n),sptop,j.eq.je .and. BCY_HI .eq. INLET) spbot = cvmgt(s(i,je+1,k,n),spbot,j.eq.je .and. BCY_HI .eq. INLET) if (j .eq. je .and. BCY_HI .eq. WALL) then if (n .eq. 2) then sptop = zero spbot = zero else if (n .eq. 1 .or. n .eq. 3) then sptop = cvmgt(zero,spbot,visc_coef .gt. zero) spbot = cvmgt(zero,spbot,visc_coef .gt. zero) else sptop = spbot endif endif splus = cvmgp(spbot,sptop,vtrans(i,j+1,k)) savg = half * (spbot + sptop) splus = cvmgt(splus, savg, abs(vtrans(i,j+1,k)) .gt. eps) smtop = s(i,j ,k,n) - (half + dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,n) c $ + dth * force(i,j ,k,n) smbot = s(i,j-1,k,n) + (half - dth*s(i,j-1,k,2)/hy)*slopey(i,j-1,k,n) c $ + dth * force(i,j-1,k,n) smtop = cvmgt(s(i,js-1,k,n),smtop,j.eq.js .and. BCY_LO .eq. INLET) smbot = cvmgt(s(i,js-1,k,n),smbot,j.eq.js .and. BCY_LO .eq. INLET) if (j .eq. js .and. BCY_LO .eq. WALL) then if (n .eq. 2) then smtop = zero smbot = zero else if (n .eq. 1 .or. n .eq. 3) then smtop = cvmgt(zero,smtop,visc_coef .gt. zero) smbot = cvmgt(zero,smtop,visc_coef .gt. zero) else smbot = smtop endif endif sminus = cvmgp(smbot,smtop,vtrans(i,j,k)) savg = half * (smbot + smtop) sminus = cvmgt(sminus, savg, abs(vtrans(i,j,k)) .gt. eps) str = half * (vtrans(i,j,k)+vtrans(i,j+1,k))*(splus - sminus) / hy c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Z-DIRECTION c ****************************************************************** spbot = s(i,j,k ,n) + (half - dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,n) c $ + dth * force(i,j,k ,n) sptop = s(i,j,k+1,n) - (half + dth*s(i,j,k+1,3)/hz)*slopez(i,j,k+1,n) c $ + dth * force(i,j,k+1,n) sptop = cvmgt(s(i,j,ke+1,n),sptop,k.eq.ke .and. BCZ_HI .eq. INLET) spbot = cvmgt(s(i,j,ke+1,n),spbot,k.eq.ke .and. BCZ_HI .eq. INLET) if (k .eq. ke .and. BCZ_HI .eq. WALL) then if (n .eq. 3) then sptop = zero spbot = zero else if (n .eq. 1 .or. n .eq. 2) then sptop = cvmgt(zero,spbot,visc_coef .gt. zero) spbot = cvmgt(zero,spbot,visc_coef .gt. zero) else sptop = spbot endif endif splus = cvmgp(spbot,sptop,wtrans(i,j,k+1)) savg = half * (spbot + sptop) splus = cvmgt(splus, savg, abs(wtrans(i,j,k+1)) .gt. eps) smtop = s(i,j,k ,n) - (half + dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,n) c $ + dth * force(i,j,k ,n) smbot = s(i,j,k-1,n) + (half - dth*s(i,j,k-1,3)/hz)*slopez(i,j,k-1,n) c $ + dth * force(i,j,k-1,n) smtop = cvmgt(s(i,j,ks-1,n),smtop,k.eq.ks .and. BCZ_LO .eq. INLET) smbot = cvmgt(s(i,j,ks-1,n),smbot,k.eq.ks .and. BCZ_LO .eq. INLET) if (k .eq. ks .and. BCZ_LO .eq. WALL) then if (n .eq. 3) then smtop = zero smbot = zero else if (n .eq. 1 .or. n .eq. 2) then smtop = cvmgt(zero,smtop,visc_coef .gt. zero) smbot = cvmgt(zero,smtop,visc_coef .gt. zero) else smbot = smtop endif endif sminus = cvmgp(smbot,smtop,wtrans(i,j,k)) savg = half * (smbot + smtop) sminus = cvmgt(sminus, savg, abs(wtrans(i,j,k)) .gt. eps) str = str + half * (wtrans(i,j,k)+wtrans(i,j,k+1))* $ (splus - sminus) / hz c ****************************************************************** c MAKE LEFT AND RIGHT STATES c ****************************************************************** st = force(i,j,k,n) - str ubardth = dth*s(i,j,k,1)/hx s_l(i+1)= s(i,j,k,n) + (half-ubardth)*slopex(i,j,k,n) + dth*st s_r(i )= s(i,j,k,n) - (half+ubardth)*slopex(i,j,k,n) + dth*st enddo if (velpred .eq. 1) then do i = is, ie+1 savg = half*(s_r(i) + s_l(i)) test = ( (s_l(i) .le. zero .and. $ s_r(i) .ge. zero) .or. $ (abs(s_l(i) + s_r(i)) .lt. eps) ) sedgex(i,j,k,n)=cvmgp(s_l(i),s_r(i),savg) sedgex(i,j,k,n)=cvmgt(savg,sedgex(i,j,k,n),test) enddo else do i = is, ie+1 sedgex(i,j,k,n)=cvmgp(s_l(i),s_r(i),uadv(i,j,k)) savg = half*(s_r(i) + s_l(i)) sedgex(i,j,k,n)=cvmgt(savg,sedgex(i,j,k,n),abs(uadv(i,j,k)) .lt. eps) enddo endif if (BCX_LO .eq. WALL) then if (n .eq. 1) then sedgex(is,j,k,n) = zero else if (n .eq. 2 .or. n .eq. 3) then sedgex(is,j,k,n) = cvmgt(zero,s_r(is),visc_coef .gt. 0.0) else sedgex(is,j,k,n) = s_r(is) endif elseif (BCX_LO .eq. INLET) then sedgex(is,j,k,n) = s(is-1,j,k,n) elseif (BCX_LO .eq. OUTLET) then sedgex(is,j,k,n) = s_r(is) endif if (BCX_HI .eq. WALL) then if (n .eq. 1) then sedgex(ie+1,j,k,n) = zero else if (n .eq. 2 .or. n .eq. 3) then sedgex(ie+1,j,k,n) = cvmgt(zero,s_l(ie+1),visc_coef .gt. 0.0) else sedgex(ie+1,j,k,n) = s_l(ie+1) endif elseif (BCX_HI .eq. INLET) then sedgex(ie+1,j,k,n) = s(ie+1,j,k,n) elseif (BCX_HI .eq. OUTLET) then sedgex(ie+1,j,k,n) = s_l(ie+1) endif if (velpred .eq. 1) then do i = is, ie+1 uadv(i,j,k) = sedgex(i,j,k,1) enddo endif enddo enddo endif enddo c ****************************************************************** c ****************************************************************** c ****************************************************************** c ::: loop for y fluxes do n = nstart,nend if (velpred .eq. 0 .or. n .eq. 2) then do k = ks, ke do i = is, ie do j = js-1, je+1 c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN X-DIRECTION c ****************************************************************** splft = s(i ,j,k,n) + (half - dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,n) c $ + dth * force(i ,j,k,n) sprgt = s(i+1,j,k,n) - (half + dth*s(i+1,j,k,1)/hx)*slopex(i+1,j,k,n) c $ + dth * force(i+1,j,k,n) sprgt = cvmgt(s(ie+1,j,k,n),sprgt,i.eq.ie .and. BCX_HI .eq. INLET) splft = cvmgt(s(ie+1,j,k,n),splft,i.eq.ie .and. BCX_HI .eq. INLET) if (i .eq. ie .and. BCX_HI .eq. WALL) then if (n .eq. 1) then sprgt = zero splft = zero else if (n .eq. 2 .or. n .eq. 3) then sprgt = cvmgt(zero,splft,visc_coef .gt. zero) splft = cvmgt(zero,splft,visc_coef .gt. zero) else sprgt = splft endif endif splus = cvmgp(splft,sprgt,utrans(i+1,j,k)) savg = half * (splft + sprgt) splus = cvmgt(splus, savg, abs(utrans(i+1,j,k)) .gt. eps) smrgt = s(i ,j,k,n) - (half + dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,n) c $ + dth * force(i ,j,k,n) smlft = s(i-1,j,k,n) + (half - dth*s(i-1,j,k,1)/hx)*slopex(i-1,j,k,n) c $ + dth * force(i-1,j,k,n) smrgt = cvmgt(s(is-1,j,k,n),smrgt,i.eq.is .and. BCX_LO .eq. INLET) smlft = cvmgt(s(is-1,j,k,n),smlft,i.eq.is .and. BCX_LO .eq. INLET) if (i .eq. is .and. BCX_LO .eq. WALL) then if (n .eq. 1) then smrgt = zero smlft = zero else if (n .eq. 2 .or. n .eq. 3) then smrgt = cvmgt(zero,smrgt,visc_coef .gt. zero) smlft = cvmgt(zero,smrgt,visc_coef .gt. zero) else smlft = smrgt endif endif sminus = cvmgp(smlft,smrgt,utrans(i,j,k)) savg = half * (smlft + smrgt) sminus = cvmgt(sminus, savg, abs(utrans(i,j,k)) .gt. eps) str = half * (utrans(i,j,k)+utrans(i+1,j,k))*(splus - sminus) / hx c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Z-DIRECTION c ****************************************************************** spbot = s(i,j,k ,n) + (half - dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,n) c $ + dth * force(i,j,k ,n) sptop = s(i,j,k+1,n) - (half + dth*s(i,j,k+1,3)/hz)*slopez(i,j,k+1,n) c $ + dth * force(i,j,k+1,n) sptop = cvmgt(s(i,j,ke+1,n),sptop,k.eq.ke .and. BCZ_HI .eq. INLET) spbot = cvmgt(s(i,j,ke+1,n),spbot,k.eq.ke .and. BCZ_HI .eq. INLET) if (k .eq. ke .and. BCZ_HI .eq. WALL) then if (n .eq. 3) then sptop = zero spbot = zero else if (n .eq. 1 .or. n .eq. 2) then sptop = cvmgt(zero,spbot,visc_coef .gt. zero) spbot = cvmgt(zero,spbot,visc_coef .gt. zero) else sptop = spbot endif endif splus = cvmgp(spbot,sptop,wtrans(i,j,k+1)) savg = half * (spbot + sptop) splus = cvmgt(splus, savg, abs(wtrans(i,j,k+1)) .gt. eps) smtop = s(i,j,k ,n) - (half + dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,n) c $ + dth * force(i,j,k ,n) smbot = s(i,j,k-1,n) + (half - dth*s(i,j,k-1,3)/hz)*slopez(i,j,k-1,n) c $ + dth * force(i,j,k-1,n) smtop = cvmgt(s(i,j,ks-1,n),smtop,k.eq.ke .and. BCZ_LO .eq. INLET) smbot = cvmgt(s(i,j,ks-1,n),smbot,k.eq.ke .and. BCZ_LO .eq. INLET) if (k .eq. ks .and. BCZ_LO .eq. WALL) then if (n .eq. 3) then smtop = zero smbot = zero else if (n .eq. 1 .or. n .eq. 2) then smbot = cvmgt(zero,smtop,visc_coef .gt. zero) smtop = cvmgt(zero,smtop,visc_coef .gt. zero) else smbot = smtop endif endif sminus = cvmgp(smbot,smtop,wtrans(i,j,k)) savg = half * (smbot + smtop) sminus = cvmgt(sminus, savg, abs(wtrans(i,j,k)) .gt. eps) str = str + half * (wtrans(i,j,k)+wtrans(i,j,k+1))*(splus - sminus) / hz c ****************************************************************** c MAKE TOP AND BOTTOM STATES c ****************************************************************** st = force(i,j,k,n) - str vbardth = dth*s(i,j,k,2)/hy s_b(j+1)= s(i,j,k,n) + (half-vbardth)*slopey(i,j,k,n) + dth*st s_t(j )= s(i,j,k,n) - (half+vbardth)*slopey(i,j,k,n) + dth*st enddo if (velpred .eq. 1) then do j = js, je+1 savg = half*(s_t(j) + s_b(j)) test = ( (s_b(j) .le. zero .and. $ s_t(j) .ge. zero) .or. $ (abs(s_b(j) + s_t(j)) .lt. eps) ) sedgey(i,j,k,n)=cvmgp(s_b(j),s_t(j),savg) sedgey(i,j,k,n)=cvmgt(savg,sedgey(i,j,k,n),test) enddo else do j = js, je+1 sedgey(i,j,k,n)=cvmgp(s_b(j),s_t(j),vadv(i,j,k)) savg = half*(s_t(j) + s_b(j)) sedgey(i,j,k,n)=cvmgt(savg,sedgey(i,j,k,n),abs(vadv(i,j,k)) .lt. eps) enddo endif if (BCY_LO .eq. WALL) then if (n .eq. 2) then sedgey(i,js,k,n) = zero else if (n .eq. 1 .or. n .eq. 3) then sedgey(i,js,k,n) = cvmgt(zero,s_t(js),visc_coef .gt. 0.0) else sedgey(i,js,k,n) = s_t(js) endif elseif (BCY_LO .eq. INLET) then sedgey(i,js,k,n) = s(i,js-1,k,n) elseif (BCY_LO .eq. OUTLET) then sedgey(i,js,k,n) = s_t(js) endif if (BCY_HI .eq. WALL) then if (n .eq. 2) then sedgey(i,je+1,k,n) = zero else if (n .eq. 1 .or. n .eq. 3) then sedgey(i,je+1,k,n) = cvmgt(zero,s_b(je+1),visc_coef .gt. 0.0) else sedgey(i,je+1,k,n) = s_b(je+1) endif elseif (BCY_HI .eq. INLET) then sedgey(i,je+1,k,n) = s(i,je+1,k,n) elseif (BCY_HI .eq. OUTLET) then sedgey(i,je+1,k,n) = s_b(je+1) endif if (velpred .eq. 1) then do j = js, je+1 vadv(i,j,k) = sedgey(i,j,k,2) enddo endif enddo enddo endif enddo c ****************************************************************** c ****************************************************************** c ****************************************************************** c ::: loop for z fluxes do n = nstart,nend if (velpred .eq. 0 .or. n .eq. 3) then do j = js, je do i = is, ie do k = ks-1, ke+1 c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN X-DIRECTION c ****************************************************************** splft = s(i ,j,k,n) + (half - dth*s(i ,j,k,1)/hx) * slopex(i ,j,k,n) c $ + dth * force(i ,j,k,n) sprgt = s(i+1,j,k,n) - (half + dth*s(i+1,j,k,1)/hx) * slopex(i+1,j,k,n) c $ + dth * force(i+1,j,k,n) sprgt = cvmgt(s(ie+1,j,k,n),sprgt,i.eq.ie .and. BCX_HI .eq. INLET) splft = cvmgt(s(ie+1,j,k,n),splft,i.eq.ie .and. BCX_HI .eq. INLET) if (i .eq. ie .and. BCX_HI .eq. WALL) then if (n .eq. 1) then sprgt = zero splft = zero else if (n .eq. 2 .or. n .eq. 3) then sprgt = cvmgt(zero,splft,visc_coef .gt. zero) splft = cvmgt(zero,splft,visc_coef .gt. zero) else sprgt = splft endif endif splus = cvmgp(splft,sprgt,utrans(i+1,j,k)) savg = half * (splft + sprgt) splus = cvmgt(splus, savg, abs(utrans(i+1,j,k)) .gt. eps) smrgt = s(i ,j,k,n) - (half + dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,n) c $ + dth * force(i ,j,k,n) smlft = s(i-1,j,k,n) + (half - dth*s(i-1,j,k,1)/hx)*slopex(i-1,j,k,n) c $ + dth * force(i-1,j,k,n) smrgt = cvmgt(s(is-1,j,k,n),smrgt,i.eq.is .and. BCX_LO .eq. INLET) smlft = cvmgt(s(is-1,j,k,n),smlft,i.eq.is .and. BCX_LO .eq. INLET) if (i .eq. is .and. BCX_LO .eq. WALL) then if (n .eq. 1) then smrgt = zero smlft = zero else if (n .eq. 2 .or. n .eq. 3) then smrgt = cvmgt(zero,smrgt,visc_coef .gt. zero) smlft = cvmgt(zero,smrgt,visc_coef .gt. zero) else smlft = smrgt endif endif sminus = cvmgp(smlft,smrgt,utrans(i,j,k)) savg = half * (smlft + smrgt) sminus = cvmgt(sminus, savg, abs(utrans(i,j,k)) .gt. eps) str = half * (utrans(i,j,k)+utrans(i+1,j,k))*(splus - sminus) / hx c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Y-DIRECTION c ****************************************************************** spbot = s(i,j ,k,n) + (half - dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,n) c $ + dth * force(i, j,k,n) sptop = s(i,j+1,k,n) - (half + dth*s(i,j+1,k,2)/hy)*slopey(i,j+1,k,n) c $ + dth * force(i,j+1,k,n) sptop = cvmgt(s(i,je+1,k,n),sptop,j.eq.je .and. BCY_HI .eq. INLET) spbot = cvmgt(s(i,je+1,k,n),spbot,j.eq.je .and. BCY_HI .eq. INLET) if (j .eq. je .and. BCY_HI .eq. WALL) then if (n .eq. 2) then sptop = zero spbot = zero else if (n .eq. 1 .or. n .eq. 3) then sptop = cvmgt(zero,spbot,visc_coef .gt. zero) spbot = cvmgt(zero,spbot,visc_coef .gt. zero) else sptop = spbot endif endif splus = cvmgp(spbot,sptop,vtrans(i,j+1,k)) savg = half * (spbot + sptop) splus = cvmgt(splus, savg, abs(vtrans(i,j+1,k)) .gt. eps) smtop = s(i,j ,k,n) - (half + dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,n) c $ + dth * force(i,j ,k,n) smbot = s(i,j-1,k,n) + (half - dth*s(i,j-1,k,2)/hy)*slopey(i,j-1,k,n) c $ + dth * force(i,j-1,k,n) smtop = cvmgt(s(i,js-1,k,n),smtop,j.eq.js .and. BCY_LO .eq. INLET) smbot = cvmgt(s(i,js-1,k,n),smbot,j.eq.js .and. BCY_LO .eq. INLET) if (j .eq. js .and. BCY_LO .eq. WALL) then if (n .eq. 2) then smtop = zero smbot = zero else if (n .eq. 1 .or. n .eq. 3) then smtop = cvmgt(zero,smtop,visc_coef .gt. zero) smbot = cvmgt(zero,smtop,visc_coef .gt. zero) else smbot = smtop endif endif sminus = cvmgp(smbot,smtop,vtrans(i,j,k)) savg = half * (smbot + smtop) sminus = cvmgt(sminus, savg, abs(vtrans(i,j,k)) .gt. eps) str = str + half * (vtrans(i,j,k)+vtrans(i,j+1,k))*(splus - sminus) / hy c ****************************************************************** c MAKE DOWN AND UP STATES c ****************************************************************** st = force(i,j,k,n) - str wbardth = dth*s(i,j,k,3)/hz s_d(k+1)= s(i,j,k,n) + (half-wbardth)*slopez(i,j,k,n) + dth*st s_u(k )= s(i,j,k,n) - (half+wbardth)*slopez(i,j,k,n) + dth*st enddo if (velpred .eq. 1) then do k = ks, ke+1 savg = half*(s_d(k) + s_u(k)) test = ( (s_d(k) .le. zero .and. $ s_u(k) .ge. zero) .or. $ (abs(s_d(k) + s_u(k)) .lt. eps) ) sedgez(i,j,k,n)=cvmgp(s_d(k),s_u(k),savg) sedgez(i,j,k,n)=cvmgt(savg,sedgez(i,j,k,n),test) enddo else do k = ks, ke+1 sedgez(i,j,k,n)=cvmgp(s_d(k),s_u(k),wadv(i,j,k)) savg = half*(s_d(k) + s_u(k)) sedgez(i,j,k,n)=cvmgt(savg,sedgez(i,j,k,n),abs(wadv(i,j,k)) .lt. eps) enddo endif if (BCZ_LO .eq. WALL) then if (n .eq. 3) then sedgez(i,j,ks,n) = zero else if (n .eq. 1 .or. n .eq. 2) then sedgez(i,j,ks,n) = cvmgt(zero,s_u(ks),visc_coef .gt. 0.0) else sedgez(i,j,ks,n) = s_u(ks) endif elseif (BCZ_LO .eq. INLET) then sedgez(i,j,ks,n) = s(i,j,ks-1,n) elseif (BCZ_LO .eq. OUTLET) then sedgez(i,j,ks,n) = s_u(ks) endif if (BCZ_HI .eq. WALL) then if (n .eq. 3) then sedgez(i,j,ke+1,n) = zero else if (n .eq. 1 .or. n .eq. 2) then sedgez(i,j,ke+1,n) = cvmgt(zero,s_d(ke+1),visc_coef .gt. 0.0) else sedgez(i,j,ke+1,n) = s_d(ke+1) endif elseif (BCZ_HI .eq. INLET) then sedgez(i,j,ke+1,n) = s(i,j,ke+1,n) elseif (BCZ_HI .eq. OUTLET) then sedgez(i,j,ke+1,n) = s_d(ke+1) endif if (velpred .eq. 1) then do k = ks, ke+1 wadv(i,j,k) = sedgez(i,j,k,3) enddo endif enddo enddo endif enddo return end ccseapps-2.5/CCSEApps/pVarden/diffuser.H0000644000175000017500000000743711634153073021211 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "multigrid.H" // //@Man: //@Memo: Class for diffusive/viscous solves //@Doc: Class to handle Crank-Nicholson diffusive/viscous solves class diffuser { //@ManDoc: Problem domain in index space, broken up into multiple boxes BoxArray grids; //@ManDoc: Geometry object. Geometry geom; //@ManDoc: Area array. MultiFab* area; //@ManDoc: Volume array. MultiFab& vol; //@ManDoc: Tolerance for multigrid iterative solve Real tol; //@ManDoc: Number of smoothing steps as you coarsen static int numSmoothCoarsen; //@ManDoc: Number of smoothing steps as you refine static int numSmoothRefine; //@ManDoc: Number of extra ghost cells. static int ng; public: //@ManDoc: Constructor diffuser(const BoxArray& grids, const Geometry& geom, MultiFab* area, MultiFab& vol); //@ManDoc: Destructor ~diffuser(); //@ManDoc: Solve for the new-time velocity void solveVel(MultiFab * staten, MultiFab * rho, Real mu); //@ManDoc: Solve for the new-time scalar field void solveScal(MultiFab * staten, Real mu, int n); //@ManDoc: Put the equations into residual-correction form. Real rescorr(MultiFab * phi, MultiFab * source, MultiFab * resid, MultiFab* local_area[], MultiFab* alpha, int idir, Real mu); }; //@ManDoc: Multigrid solver for the Crank-Nicholson discretization class diffuser_mg : public multigrid { //@Memo: Multigrid solver for diffusive/viscous solves. //@ManDoc: Multigrid level int level; //@ManDoc: Which component of velocity is being solved for int idir; //@ManDoc: Diffusion coefficient. Real mu; //@ManDoc: Area arrays. MultiFab* area[BL_SPACEDIM]; //@ManDoc: Alpha = rho * volume. MultiFab * alpha; //@ManDoc: Pointer to the next coarsest multigrid level diffuser_mg *Next; //@ManDoc: Compute the residual R = RHS - DG(phi) Real residual(); //@ManDoc: Relax on the residual equation, updating phi void step(int); //@ManDoc: Coarsen the residual to the next coarser multigrid level void Restrict(); //@ManDoc: Interpolate the solution from the next coarser multigrid level void interpolate(); public: //@ManDoc: Constructor diffuser_mg(const BoxArray & Grids, const Geometry& Geom, MultiFab* Phi, MultiFab* Source, MultiFab* Resid, MultiFab* Area[], MultiFab* Alpha, const Real* Dx, int Level, int Idir, Real Mu); //@ManDoc: Destructor ~diffuser_mg(); }; ccseapps-2.5/CCSEApps/pVarden/inputs2.2d0000644000175000017500000002300011634153073021104 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 240 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 64 128 ############################################################################# # Maximum size of grid allowed. max_grid_size = 64 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin2_2d ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 0.1 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = -9.8 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 0 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 1. 2. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.0 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/multigrid.H0000644000175000017500000000664711634153073021404 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MG_ #define _MG_ #include #include // //@Man: //@Memo: Multigrid class /*@Doc: This multigrid class provides the framework for doing the different multigrid solves. It provides virtual versions of the worker functions necessary for implementation of a solver: residual, step (relax or solve), restrict, and interpolate. It also allows for several types of multigrid cycles : V-cycles, W-Cycles, or FMV-cycles (Full Multigrid V-cycles) */ class multigrid { // This friend declaration compensates for a compiler bug. friend class diffuser_mg; friend class macprojection_mg; friend class hgprojection_mg; protected: BoxArray grids; Geometry geom; MultiFab* phi; MultiFab* source; MultiFab* resid; MultiFab* area[BL_SPACEDIM]; const Real* dx; multigrid *next; //@ManDoc: Is this the first instantiation of multigrid? static int first_mg; //@ManDoc: If true, print additional run-time diagnostics static int debug; //@ManDoc: Used to set degrees of verbosity (can be 0,1 or 2) static int verbose; //@ManDoc: Problem norm to be used to define convergence. static Real prob_norm; //@ManDoc: Compute the residual R = RHS - DG(phi) virtual Real residual() = 0; //@ManDoc: Relax on the residual equation, updating phi virtual void step(int) = 0; //@ManDoc: Coarsen the residual to the next coarser multigrid level virtual void Restrict() = 0; //@ManDoc: Interpolate the solution from the next coarser multigrid level virtual void interpolate() = 0; public: //@ManDoc: Constructor multigrid(const BoxArray& Grids, Geometry geom, MultiFab* Phi, MultiFab* Source, MultiFab* Resid); multigrid(const BoxArray& Grids, Geometry geom, MultiFab* Phi, MultiFab* Source, MultiFab* Resid, MultiFab* Area[]); //@ManDoc: Solve the linear equation by whichever means void solve(Real tol, Real prob_norm, int nngsrb, int i2=2); //@ManDoc: Perform a single V-Cycle Real vcycle(Real tol, int nngsrb, int i2=2); }; #endif ccseapps-2.5/CCSEApps/pVarden/mac_3d.F0000644000175000017500000006557611634153073020536 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "MACPROJ_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #define CDIMS loc_1,loc_2,loc_3,hic_1,hic_2,hic_3 c ************************************************************************* c ** INITSIGMA ** c ** Define the 1/rho coefficients at the top level of the multigrid c ************************************************************************* subroutine FORT_INITSIGMA(sigmax,sigmay,sigmaz,rho, $ areax,areay,areaz,DIMS,bc,ng) implicit none integer DIMS integer ng REAL_T sigmax(lo_1 -ng+1:hi_1 +ng ,lo_2 -ng+1:hi_2 +ng-1, $ lo_3 -ng+1:hi_3 +ng-1) REAL_T sigmay(lo_1 -ng+1:hi_1 +ng-1,lo_2 -ng+1:hi_2 +ng , $ lo_3 -ng+1:hi_3 +ng-1) REAL_T sigmaz(lo_1 -ng+1:hi_1 +ng-1,lo_2 -ng+1:hi_2 +ng-1, $ lo_3 -ng+1:hi_3 +ng ) REAL_T rho(lo_1-3:hi_1+3,lo_2-3:hi_2+3, lo_3-3:hi_3+3) REAL_T areax(lo_1 :hi_1+1,lo_2 :hi_2 , lo_3 :hi_3 ) REAL_T areay(lo_1 :hi_1 ,lo_2 :hi_2+1, lo_3 :hi_3 ) REAL_T areaz(lo_1 :hi_1 ,lo_2 :hi_2 , lo_3 :hi_3+1) integer bc(2,3) c Local variables integer i,j,k REAL_T minsig,maxsig do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1+1 sigmax(i,j,k) = two * areax(i,j,k) / (rho(i,j,k) + rho(i-1,j,k)) enddo if (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) then sigmax(lo_1,j,k) = areax(lo_1,j,k) / rho(lo_1-1,j,k) else if (BCX_LO .eq. OUTLET) then sigmax(lo_1,j,k) = areax(lo_1,j,k) / rho(lo_1,j,k) endif if (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) then sigmax(hi_1+1,j,k) = areax(hi_1+1,j,k) / rho(hi_1+1,j,k) else if (BCX_HI .eq. OUTLET) then sigmax(hi_1+1,j,k) = areax(hi_1+1,j,k) / rho(hi_1,j,k) endif enddo enddo do k = lo_3,hi_3 do i = lo_1,hi_1 do j = lo_2,hi_2+1 sigmay(i,j,k) = two * areay(i,j,k) / (rho(i,j,k) + rho(i,j-1,k)) enddo if (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) then sigmay(i,lo_2,k) = areay(i,lo_2,k) / rho(i,lo_2-1,k) else if (BCY_LO .eq. OUTLET) then sigmay(i,lo_2,k) = areay(i,lo_2,k) / rho(i,lo_2 ,k) endif if (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) then sigmay(i,hi_2+1,k) = areay(i,hi_2,k) / rho(i,hi_2+1,k) else if (BCY_HI .eq. OUTLET) then sigmay(i,hi_2+1,k) = areay(i,hi_2,k) / rho(i,hi_2 ,k) endif enddo enddo do j = lo_2,hi_2 do i = lo_1,hi_1 do k = lo_3,hi_3+1 sigmaz(i,j,k) = two * areaz(i,j,k) / (rho(i,j,k) + rho(i,j,k-1)) enddo if (BCZ_LO .eq. WALL .or. BCZ_LO .eq. INLET) then sigmaz(i,j,lo_3) = areaz(i,j,lo_3) / rho(i,j,lo_3-1) else if (BCZ_LO .eq. OUTLET) then sigmaz(i,j,lo_3) = areaz(i,j,lo_3) / rho(i,j,lo_3) endif if (BCZ_HI .eq. WALL .or. BCZ_HI .eq. INLET) then sigmaz(i,j,hi_3+1) = areaz(i,j,hi_3) / rho(i,j,hi_3+1) else if (BCZ_HI .eq. OUTLET) then sigmaz(i,j,hi_3+1) = areaz(i,j,hi_3) / rho(i,j,hi_3) endif enddo enddo return end c ************************************************************************* c ** PROJUMAC ** c ** Update the edge-based velocities c ************************************************************************* subroutine FORT_PROJUMAC(uadv,vadv,wadv,sigmax,sigmay,sigmaz,phi, $ areax,areay,areaz,dx,DIMS,bc,ng) implicit none integer DIMS integer ng REAL_T uadv(lo_1 :hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vadv(lo_1 :hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wadv(lo_1 :hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T sigmax(lo_1 -ng+1:hi_1 +ng ,lo_2 -ng+1:hi_2 +ng-1, $ lo_3 -ng+1:hi_3 +ng-1) REAL_T sigmay(lo_1 -ng+1:hi_1 +ng-1,lo_2 -ng+1:hi_2 +ng , $ lo_3 -ng+1:hi_3 +ng-1) REAL_T sigmaz(lo_1 -ng+1:hi_1 +ng-1,lo_2 -ng+1:hi_2 +ng-1, $ lo_3 -ng+1:hi_3 +ng ) REAL_T phi(lo_1-ng:hi_1+ng,lo_2-ng:hi_2+ng,lo_3-ng:hi_3+ng) REAL_T areax(lo_1 :hi_1+1,lo_2 :hi_2 , lo_3 :hi_3 ) REAL_T areay(lo_1 :hi_1 ,lo_2 :hi_2+1, lo_3 :hi_3 ) REAL_T areaz(lo_1 :hi_1 ,lo_2 :hi_2 , lo_3 :hi_3+1) REAL_T dx(3) integer bc(2,3) c Local variables integer i,j,k call setbc(phi,DIMS,bc,ng) do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1+1 uadv(i,j,k) = uadv(i,j,k) - sigmax(i,j,k) / areax(i,j,k) * $ (phi(i,j,k)-phi(i-1,j,k))/dx(1) enddo enddo enddo do k = lo_3,hi_3 do j = lo_2,hi_2+1 do i = lo_1,hi_1 vadv(i,j,k) = vadv(i,j,k) - sigmay(i,j,k) / areay(i,j,k) * $ (phi(i,j,k)-phi(i,j-1,k))/dx(2) enddo enddo enddo do k = lo_3,hi_3+1 do j = lo_2,hi_2 do i = lo_1,hi_1 wadv(i,j,k) = wadv(i,j,k) - sigmaz(i,j,k) / areaz(i,j,k) * $ (phi(i,j,k)-phi(i,j,k-1))/dx(3) enddo enddo enddo return end c ************************************************************************* c ** RESIDUAL ** c ** Compute the residual R = f - D( sig G(phi) ) c ************************************************************************* subroutine FORT_RESIDUAL(resid,phi,f,sigmax,sigmay,sigmaz,DIMS, $ dx,resnorm,bc,ng) implicit none integer DIMS integer ng REAL_T resid(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng-1) REAL_T phi(lo_1-ng :hi_1+ng ,lo_2-ng :hi_2+ng ,lo_3-ng :hi_3+ng ) REAL_T f(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng-1) REAL_T sigmax(lo_1 -ng+1:hi_1 +ng ,lo_2 -ng+1:hi_2 +ng-1, $ lo_3 -ng+1:hi_3 +ng-1) REAL_T sigmay(lo_1 -ng+1:hi_1 +ng-1,lo_2 -ng+1:hi_2 +ng , $ lo_3 -ng+1:hi_3 +ng-1) REAL_T sigmaz(lo_1 -ng+1:hi_1 +ng-1,lo_2 -ng+1:hi_2 +ng-1, $ lo_3 -ng+1:hi_3 +ng ) REAL_T dx(3) REAL_T resnorm integer bc(2,3) c Local variables REAL_T hxinv, hyinv, hzinv REAL_T rfac, corr integer i,j,k hxinv = one/dx(1) hyinv = one/dx(2) hzinv = one/dx(3) resnorm = zero call setbc(phi,DIMS,bc,ng) do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 rfac = ( sigmax(i+1,j,k) + sigmax(i,j,k))*hxinv + $ ( sigmay(i,j+1,k) + sigmay(i,j,k))*hyinv + $ ( sigmaz(i,j,k+1) + sigmaz(i,j,k))*hzinv corr = $ ( sigmax(i+1,j,k)*phi(i+1,j,k) + sigmax(i,j,k)*phi(i-1,j,k))*hxinv $ +( sigmay(i,j+1,k)*phi(i,j+1,k) + sigmay(i,j,k)*phi(i,j-1,k))*hyinv $ +( sigmaz(i,j,k+1)*phi(i,j,k+1) + sigmaz(i,j,k)*phi(i,j,k-1))*hzinv resid(i,j,k) = f(i,j,k) - (corr - rfac*phi(i,j,k)) resnorm = max(abs(resid(i,j,k)), resnorm) enddo enddo enddo return end c ************************************************************************* c ** RELAX ** c ** Jacobi relaxation c ************************************************************************* subroutine FORT_RELAX(phi,f,sigmax,sigmay,sigmaz,DIMS,dx,bc,nnrelax,ng) implicit none integer DIMS integer ng REAL_T phi(lo_1-ng :hi_1+ng ,lo_2-ng :hi_2+ng ,lo_3-ng :hi_3+ng ) REAL_T f(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng-1) REAL_T sigmax(lo_1 -ng+1:hi_1 +ng ,lo_2 -ng+1:hi_2 +ng-1, $ lo_3 -ng+1:hi_3 +ng-1) REAL_T sigmay(lo_1 -ng+1:hi_1 +ng-1,lo_2 -ng+1:hi_2 +ng , $ lo_3 -ng+1:hi_3 +ng-1) REAL_T sigmaz(lo_1 -ng+1:hi_1 +ng-1,lo_2 -ng+1:hi_2 +ng-1, $ lo_3 -ng+1:hi_3 +ng ) REAL_T dx(3) integer bc(2,3) integer nnrelax c Local variables REAL_T rfac, corr integer i, j, k integer iter, iinc integer extra_xlo,extra_xhi integer extra_ylo,extra_yhi integer extra_zlo,extra_zhi if (ng .lt. 2*nnrelax) then print *,'NOT ENOUGH GHOST CELLS FOR RELAX ' print *,'NG ',ng print *,'NNRELAX ',nnrelax stop endif call setbc(phi,DIMS,bc,ng) do iter = 1, 2*nnrelax extra_xlo = cvmgt(ng-iter,0,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) extra_xhi = cvmgt(ng-iter,0,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) extra_ylo = cvmgt(ng-iter,0,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) extra_yhi = cvmgt(ng-iter,0,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) extra_zlo = cvmgt(ng-iter,0,BCZ_LO .eq. INTERIOR .or. BCZ_LO .eq. PERIODIC) extra_zhi = cvmgt(ng-iter,0,BCZ_HI .eq. INTERIOR .or. BCZ_HI .eq. PERIODIC) do k = lo_3-extra_zlo,hi_3+extra_zhi do j = lo_2-extra_ylo,hi_2+extra_yhi iinc = mod(j+k+iter+1+extra_xlo+2*ng,2) do i = lo_1-extra_xlo+iinc,hi_1+extra_xhi,2 rfac = (sigmax(i+1,j,k) + sigmax(i,j,k))/dx(1) $ +(sigmay(i,j+1,k) + sigmay(i,j,k))/dx(2) $ +(sigmaz(i,j,k+1) + sigmaz(i,j,k))/dx(3) corr = $ ( sigmax(i+1,j,k)*phi(i+1,j,k) + sigmax(i,j,k)*phi(i-1,j,k))/dx(1) $ +( sigmay(i,j+1,k)*phi(i,j+1,k) + sigmay(i,j,k)*phi(i,j-1,k))/dx(2) $ +( sigmaz(i,j,k+1)*phi(i,j,k+1) + sigmaz(i,j,k)*phi(i,j,k-1))/dx(3) phi(i,j,k) = (corr - f(i,j,k))/rfac enddo enddo enddo call setbc(phi,DIMS,bc,ng) enddo return end c ************************************************************************* c ** BC ** c ** Impose boundary conditions c ************************************************************************* subroutine setbc(phi,DIMS,bc,ng) implicit none integer DIMS integer ng REAL_T phi(lo_1-ng:hi_1+ng,lo_2-ng:hi_2+ng,lo_3-ng:hi_3+ng) integer bc(2,3) c Local variables integer i, j, k, is, ie, js, je, ks, ke integer ilo,ihi,jlo,jhi,klo,khi is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 ilo = cvmgt(lo_1-ng,lo_1,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) ihi = cvmgt(hi_1+ng,hi_1,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) jlo = cvmgt(lo_2-ng,lo_2,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) jhi = cvmgt(hi_2+ng,hi_2,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) klo = cvmgt(lo_3-ng,lo_3,BCZ_LO .eq. INTERIOR .or. BCZ_LO .eq. PERIODIC) khi = cvmgt(hi_3+ng,hi_3,BCZ_HI .eq. INTERIOR .or. BCZ_HI .eq. PERIODIC) if (BCZ_LO .eq. OUTLET) then do j = jlo,jhi do i = ilo,ihi phi(i,j,ks-1) = -phi(i,j,ks) enddo enddo elseif (BCZ_LO .eq. WALL .or. BCZ_LO .eq. INLET) then do j = jlo,jhi do i = ilo,ihi phi(i,j,ks-1) = phi(i,j,ks) enddo enddo endif if (BCZ_HI .eq. OUTLET) then do j = jlo,jhi do i = ilo,ihi phi(i,j,ke+1) = -phi(i,j,ke) enddo enddo elseif (BCZ_HI .eq. WALL .or. BCZ_HI .eq. INLET) then do j = jlo,jhi do i = ilo,ihi phi(i,j,ke+1) = phi(i,j,ke) enddo enddo endif if (BCY_LO .eq. OUTLET) then do k = klo,khi do i = ilo,ihi phi(i,js-1,k) = -phi(i,js,k) enddo enddo elseif (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) then do k = klo,khi do i = ilo,ihi phi(i,js-1,k) = phi(i,js,k) enddo enddo endif if (BCY_HI .eq. OUTLET) then do k = klo,khi do i = ilo,ihi phi(i,je+1,k) = -phi(i,je,k) enddo enddo elseif (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) then do k = klo,khi do i = ilo,ihi phi(i,je+1,k) = -phi(i,je,k) phi(i,je+1,k) = phi(i,je,k) enddo enddo endif if (BCX_LO .eq. OUTLET) then do k = klo,khi do j = jlo,jhi phi(is-1,j,k) = -phi(is,j,k) enddo enddo elseif (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) then do k = klo,khi do j = jlo,jhi phi(is-1,j,k) = phi(is,j,k) enddo enddo endif if (BCX_HI .eq. OUTLET) then do k = klo,khi do j = jlo,jhi phi(ie+1,j,k) = -phi(ie,j,k) enddo enddo elseif (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) then do k = klo,khi do j = jlo,jhi phi(ie+1,j,k) = phi(ie,j,k) enddo enddo endif return end c ************************************************************************* c ** RHSMAC ** c ** Compute the right-hand-side D(U) for the MAC projection c ************************************************************************* subroutine FORT_RHSMAC(uadv,vadv,wadv,divu_src,rhs, $ areax,areay,areaz,vol,DIMS,rhsnorm,ng) implicit none integer DIMS integer ng REAL_T uadv(lo_1 :hi_1+1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T vadv(lo_1 :hi_1 ,lo_2 :hi_2+1 ,lo_3 :hi_3 ) REAL_T wadv(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1) REAL_T divu_src(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T rhs(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng-1) REAL_T areax(lo_1 :hi_1+1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T areay(lo_1 :hi_1 ,lo_2 :hi_2+1 ,lo_3 :hi_3 ) REAL_T areaz(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1) REAL_T vol(lo_1-1 :hi_1+1 ,lo_2-1:hi_2+1 ,lo_3-1 :hi_3+1) REAL_T rhsnorm c Local variables integer i,j,k rhsnorm = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 rhs(i,j,k) = areax(i+1,j,k)*uadv(i+1,j,k) - areax(i,j,k)*uadv(i,j,k) $ +areay(i,j+1,k)*vadv(i,j+1,k) - areay(i,j,k)*vadv(i,j,k) $ +areaz(i,j,k+1)*wadv(i,j,k+1) - areaz(i,j,k)*wadv(i,j,k) rhs(i,j,k) = rhs(i,j,k) - vol(i,j,k)*divu_src(i,j,k) rhsnorm = max(rhsnorm,abs(rhs(i,j,k))) enddo enddo enddo return end c ************************************************************************* c ** COARSIGMA ** c ** Coarsen the edge-based sigma coefficients c ************************************************************************* subroutine FORT_COARSIGMA(sigmax,sigmay,sigmaz, $ sigmaxc,sigmayc,sigmazc,DIMS,CDIMS,ng) implicit none integer DIMS integer CDIMS integer ng REAL_T sigmax(lo_1 -ng+1:hi_1 +ng ,lo_2 -ng+1:hi_2 +ng-1, $ lo_3 -ng+1:hi_3 +ng-1) REAL_T sigmay(lo_1 -ng+1:hi_1 +ng-1,lo_2 -ng+1:hi_2 +ng , $ lo_3 -ng+1:hi_3 +ng-1) REAL_T sigmaz(lo_1 -ng+1:hi_1 +ng-1,lo_2 -ng+1:hi_2 +ng-1, $ lo_3 -ng+1:hi_3 +ng ) REAL_T sigmaxc(loc_1-ng+1:hic_1+ng ,loc_2-ng+1:hic_2+ng-1, $ loc_3-ng+1:hic_3+ng-1) REAL_T sigmayc(loc_1-ng+1:hic_1+ng-1,loc_2-ng+1:hic_2+ng , $ loc_3-ng+1:hic_3+ng-1) REAL_T sigmazc(loc_1-ng+1:hic_1+ng-1,loc_2-ng+1:hic_2+ng-1, $ loc_3-ng+1:hic_3+ng ) c Local variables integer i,j,k do k = lo_3,hi_3 ,2 do j = lo_2,hi_2 ,2 do i = lo_1,hi_1+1,2 sigmaxc(i/2,j/2,k/2) = (sigmax(i,j,k ) + sigmax(i,j+1,k ) + $ sigmax(i,j,k+1) + sigmax(i,j+1,k+1) ) * eighth enddo enddo enddo do k = lo_3,hi_3 ,2 do j = lo_2,hi_2+1,2 do i = lo_1,hi_1 ,2 sigmayc(i/2,j/2,k/2) = (sigmay(i,j,k ) + sigmay(i+1,j,k ) + $ sigmay(i,j,k+1) + sigmay(i+1,j,k+1) ) * eighth enddo enddo enddo do k = lo_3,hi_3+1,2 do j = lo_2,hi_2 ,2 do i = lo_1,hi_1 ,2 sigmazc(i/2,j/2,k/2) = (sigmaz(i,j ,k) + sigmaz(i+1,j ,k) + $ sigmaz(i,j+1,k) + sigmaz(i+1,j+1,k) ) * eighth enddo enddo enddo return end c ************************************************************************* c ** RESTRICT ** c ** Conservatively average the residual c ************************************************************************* subroutine FORT_RESTRICT(res,resc,DIMS,CDIMS,nex) implicit none integer DIMS integer CDIMS integer nex REAL_T res(lo_1 -nex:hi_1 +nex,lo_2 -nex:hi_2 +nex,lo_3 -nex:hi_3 +nex) REAL_T resc(loc_1-nex:hic_1+nex,loc_2-nex:hic_2+nex,loc_3-nex:hic_3+nex) c Local variables integer i,j,k do k = lo_3,hi_3,2 do j = lo_2,hi_2,2 do i = lo_1,hi_1,2 resc(i/2,j/2,k/2) = (res(i ,j,k ) + res(i ,j+1,k ) + $ res(i+1,j,k ) + res(i+1,j+1,k ) + $ res(i ,j,k+1) + res(i ,j+1,k+1) + $ res(i+1,j,k+1) + res(i+1,j+1,k+1) ) * eighth enddo enddo enddo return end c ************************************************************************* c ** INTERPOLATE ** c ** Piecewise constant interpolation c ************************************************************************* subroutine FORT_INTERPOLATE(phi,deltac,DIMS,CDIMS,ng) implicit none integer DIMS integer CDIMS integer ng REAL_T phi(lo_1 -ng:hi_1 +ng,lo_2 -ng:hi_2 +ng,lo_3 -ng:hi_3 +ng) REAL_T deltac(loc_1-ng:hic_1+ng,loc_2-ng:hic_2+ng,loc_3-ng:hic_3+ng) c Local variables integer i,j,k do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 phi(i,j,k) = phi(i,j,k) + deltac(i/2,j/2,k/2) enddo enddo enddo return end c ************************************************************************* c ** SOLVEMAC ** c ** Conjugate gradient bottom-solver c ************************************************************************* subroutine FORT_SOLVEMAC(dest, dest0, source, sigmax, sigmay, sigmaz, $ sum, r, w, z, work, DIMS, dx, bc, norm, $ prob_norm, ng) implicit none integer DIMS integer ng REAL_T dest(lo_1-ng:hi_1+ng,lo_2-ng:hi_2+ng,lo_3-ng:hi_3+ng) REAL_T dest0(lo_1-1 :hi_1+1 ,lo_2-1 :hi_2+1 ,lo_3-1 :hi_3+1) REAL_T source(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng-1) REAL_T sigmax(lo_1-ng+1:hi_1 +ng ,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3 +ng-1) REAL_T sigmay(lo_1-ng+1:hi_1 +ng-1,lo_2-ng+1:hi_2+ng ,lo_3-ng+1:hi_3 +ng-1) REAL_T sigmaz(lo_1-ng+1:hi_1 +ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3 +ng ) REAL_T sum(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T r(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T z(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T work(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T dx(3) integer bc(2,3) REAL_T norm REAL_T prob_norm c Local variables integer i,j,k integer iter REAL_T alpha, beta, rho, rhol REAL_T local_norm REAL_T tol,tolfac tolfac = 1.0d-3 call macperiodic(dest,DIMS,bc,ng) call setbc(dest,DIMS,bc,ng) do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 dest0(i,j,k) = dest(i,j,k) dest(i,j,k) = zero enddo enddo enddo 10 do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 w(i,j,k) = $ ( sigmax(i+1,j,k)*dest0(i+1,j,k) + $ sigmax(i ,j,k)*dest0(i-1,j,k) )/dx(1) $ +( sigmay(i,j+1,k)*dest0(i,j+1,k) + $ sigmay(i,j ,k)*dest0(i,j-1,k) )/dx(2) $ +( sigmaz(i,j,k+1)*dest0(i,j,k+1) + $ sigmaz(i,j,k )*dest0(i,j,k-1) )/dx(3) $ -( (sigmax(i+1,j,k) + sigmax(i,j,k))/dx(1) + $ (sigmay(i,j+1,k) + sigmay(i,j,k))/dx(2) + $ (sigmaz(i,j,k+1) + sigmaz(i,j,k))/dx(3) )*dest0(i,j,k) enddo enddo enddo do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 r(i,j,k) = source(i,j,k) - w(i,j,k) enddo enddo enddo rho = zero local_norm = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 z(i,j,k) = r(i,j,k) / sum(i,j,k) rho = rho + z(i,j,k) * r(i,j,k) local_norm = max(local_norm,abs(r(i,j,k))) enddo enddo enddo norm = local_norm tol = Max(tolfac*local_norm,1.0d-15*prob_norm) if (norm .le. tol) return do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 work(i,j,k) = zero dest(i,j,k) = z(i,j,k) enddo enddo enddo iter = 0 c write(6,1000) iter, norm/prob_norm 100 call macperiodic(dest,DIMS,bc,ng) call setbc(dest,DIMS,bc,ng) do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 w(i,j,k) = $ ( sigmax(i+1,j,k)*dest(i+1,j,k) + $ sigmax(i ,j,k)*dest(i-1,j,k) )/dx(1) $ +( sigmay(i,j+1,k)*dest(i,j+1,k) + $ sigmay(i,j ,k)*dest(i,j-1,k) )/dx(2) $ +( sigmaz(i,j,k+1)*dest(i,j,k+1) + $ sigmaz(i,j,k )*dest(i,j,k-1) )/dx(3) - $ ( (sigmax(i+1,j,k) + sigmax(i,j,k))/dx(1) + $ (sigmay(i,j+1,k) + sigmay(i,j,k))/dx(2) + $ (sigmaz(i,j,k+1) + sigmaz(i,j,k))/dx(3) )*dest(i,j,k) enddo enddo enddo alpha = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 alpha = alpha + dest(i,j,k)*w(i,j,k) enddo enddo enddo alpha = rho / alpha rhol = rho rho = zero norm = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 work(i,j,k) = work(i,j,k) + alpha * dest(i,j,k) r(i,j,k) = r(i,j,k) - alpha * w(i,j,k) z(i,j,k) = r(i,j,k) / sum(i,j,k) rho = rho + z(i,j,k) * r(i,j,k) norm = max(norm,abs(r(i,j,k))) enddo enddo enddo iter = iter+1 c write(6,1000) iter, norm/prob_norm if (norm .le. tol) then do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 dest(i,j,k) = work(i,j,k) + dest0(i,j,k) enddo enddo enddo call setbc(dest,DIMS,bc,ng) else if (iter .ge. 100 .or. norm .ge. 100.d0 * local_norm) then tolfac = 10.d0 * tolfac iter = 1 do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 dest(i,j,k) = zero enddo enddo enddo goto 10 else beta = rho / rhol do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 dest(i,j,k) = z(i,j,k) + beta * dest(i,j,k) enddo enddo enddo goto 100 endif c call flush(6) 1000 format('Res/Res0 in solve: ',i4,2x,e12.5) c call flush(6) return end c ************************************************************************* c ** MKSUMMAC ** c ** Pre-compute the sum of coefficients for the conjugate gradient solver c ************************************************************************* subroutine FORT_MKSUMMAC(sum,sigmax,sigmay,sigmaz,DIMS,dx,ng) implicit none integer DIMS integer ng REAL_T sum(lo_1-1 :hi_1+1 ,lo_2-1 :hi_2+1 , $ lo_3-1 :hi_3+1 ) REAL_T sigmax(lo_1-ng+1:hi_1+ng ,lo_2-ng+1:hi_2+ng-1, $ lo_3-ng+1:hi_3+ng-1) REAL_T sigmay(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng , $ lo_3-ng+1:hi_3+ng-1) REAL_T sigmaz(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1, $ lo_3-ng+1:hi_3+ng ) REAL_T dx(3) c Local variables integer i,j,k do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 sum(i,j,k) = (sigmax(i+1,j,k) + sigmax(i,j,k))/dx(1) + $ (sigmay(i,j+1,k) + sigmay(i,j,k))/dx(2) + $ (sigmaz(i,j,k+1) + sigmaz(i,j,k))/dx(3) sum(i,j,k) = -sixth*sum(i,j,k) enddo enddo enddo return end c ************************************************************************* c ** MACPERIODIC ** c Impose periodic boundary conditions on the single grid data in the c conjugate gradient bottom solver. c ************************************************************************* subroutine macperiodic(dest,DIMS,bc,ng) implicit none integer DIMS integer ng REAL_T dest(lo_1-ng:hi_1+ng,lo_2-ng:hi_2+ng,lo_3-ng:hi_3+ng) integer bc(2,3) integer i,j,k if (BCX_LO .eq. PERIODIC .and. BCX_HI .eq. PERIODIC) then do k = lo_3,hi_3 do j = lo_2,hi_2 dest(lo_1-1,j,k) = dest(hi_1,j,k) dest(hi_1+1,j,k) = dest(lo_1,j,k) enddo enddo endif if (BCY_LO .eq. PERIODIC .and. BCY_HI .eq. PERIODIC) then do k = lo_3,hi_3 do i = lo_1,hi_1 dest(i,lo_2-1,k) = dest(i,hi_2,k) dest(i,hi_2+1,k) = dest(i,lo_2,k) enddo enddo endif if (BCZ_LO .eq. PERIODIC .and. BCZ_HI .eq. PERIODIC) then do j = lo_2,hi_2 do i = lo_1,hi_1 dest(i,j,lo_3-1) = dest(i,j,hi_3) dest(i,j,hi_3+1) = dest(i,j,lo_3) enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/probin2_3d0000644000175000017500000000015411634153073021142 0ustar amckinstryamckinstry $fortin prob_type = 2 xblob = 0.5 yblob = 0.5 zblob = 1.5 radblob = 0.2 denblob = 10. $end ccseapps-2.5/CCSEApps/pVarden/probin60000644000175000017500000000024611634153073020562 0ustar amckinstryamckinstry $fortin prob_type = 6 in_xvel = 0.0 in_yvel = 0.0 in_density = 1.0 in_tracer = 0.0 xblob = 0.5 yblob = 0.5 radblob = 0.2 denblob = 1. $end ccseapps-2.5/CCSEApps/pVarden/names.H0000644000175000017500000000265311634153073020500 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #if (BL_SPACEDIM == 2) enum StateNames { Xvel=0, Yvel, Density, Tracer}; #elif (BL_SPACEDIM == 3) enum StateNames { Xvel=0, Yvel, Zvel, Density, Tracer}; #endif ccseapps-2.5/CCSEApps/pVarden/prob_2d.F0000644000175000017500000004657311634153073020733 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 #define SDIMS slo_1,slo_2,shi_1,shi_2 c ************************************************************************* c ** PROBINIT ** c ** Read in the problem-dependent parameters for the FORTRAN common blocks c ************************************************************************* subroutine FORT_PROBINIT (name,namlen) integer namlen integer name(namlen) integer untin, i #include "probdata.H" namelist /fortin/ prob_type, zero_dir, $ in_xvel, in_yvel, in_zvel, in_density, in_tracer, $ xblob, yblob, zblob, radblob, denblob, velfact c Build `probin' filename -- the name of file containing fortin namelist. c integer maxlen parameter (maxlen=256) character probin*(maxlen) do i = 1, namlen probin(i:i) = char(name(i)) end do untin = 9 if (namlen .eq. 0) then open(untin,file='probin',form='formatted',status='old') else open(untin,file=probin(1:namlen),form='formatted',status='old') end if read(untin,fortin) close(unit=untin) end c ************************************************************************* c ** INITDATA ** c ** Call the appropriate subroutine to initialize the data c ************************************************************************* subroutine FORT_INITDATA(state,DIMS,dx,time,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,numscal+BL_SPACEDIM) REAL_T dx(2) REAL_T time print *,' ' if (prob_type .eq. 1) then call initspin(state,dx,DIMS,numscal) else if (prob_type .eq. 2) then call initbubble(state,dx,DIMS,numscal) else if (prob_type .eq. 3) then call initshear(state,dx,DIMS,numscal) else if (prob_type .eq. 4) then call initchannel(state,dx,DIMS,numscal) else if (prob_type .eq. 5) then call initxypoiseuille(state,dx,DIMS,numscal) else if (prob_type .eq. 6) then call initrzpoiseuille(state,dx,DIMS,numscal) else print *,'DONT KNOW THIS PROBLEM TYPE: ',prob_type stop endif return end c ************************************************************************* c ** INITSPIN ** c ** Initialize the constant density flow-in-a-box problem c ************************************************************************* subroutine initspin(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,numscal+BL_SPACEDIM) REAL_T dx(2) c Local variables REAL_T x, y REAL_T spx, spy, cpx, cpy integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) spx = sin(Pi*x) cpx = cos(Pi*x) spy = sin(Pi*y) cpy = cos(Pi*y) state(i,j,1) = velfact*two*spy*cpy*spx**2 state(i,j,2) = -velfact*two*spx*cpx*spy**2 state(i,j,3) = one enddo enddo do n = 2, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) - 0.5d0 y = dx(2)*(float(j) + half) - 0.5d0 state(i,j,2+n) = sqrt(x*x+y*y) enddo enddo enddo return end c ************************************************************************* c ** INITBUBBLE ** c ** Initialize the bubble-drop in a box problem c ************************************************************************* subroutine initbubble(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,numscal+BL_SPACEDIM) REAL_T dx(2) c Local variables REAL_T x, y, r integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,1) = zero state(i,j,2) = zero x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2) state(i,j,3) = one+(denblob-one)*(half+half*tanh(100.d0*(radblob-r))) c state(i,j,3) = cvmgt(denblob,one,r .lt. radblob) enddo enddo do n = 2, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,2+n) = zero enddo enddo enddo return end c ************************************************************************* c ** INITSHEAR ** c ** Initialize a constant density doubly-periodic shear problem c ************************************************************************* subroutine initshear(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,numscal+BL_SPACEDIM) REAL_T dx(2) c Local variables REAL_T x, y integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) state(i,j,1) = tanh(30.d0*(fourth - abs(y-half))) state(i,j,2) = 0.05d0 * sin(two*Pi*x) state(i,j,3) = one enddo enddo do n = 2, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) - 0.5d0 y = dx(2)*(float(j) + half) - 0.5d0 state(i,j,2+n) = sqrt(x*x+y*y) enddo enddo enddo return end c ************************************************************************* c ** INITCHANNEL ** c ** Initialize the channel inflow problem c ************************************************************************* subroutine initchannel(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,numscal+BL_SPACEDIM) REAL_T dx(2) c Local variables REAL_T x, y, r integer i, j, n if (numscal .lt. 2) then print *,"CHANNEL FLOW NEEDS MORE SCALARS" stop endif do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2) c state(i,j,1) = in_xvel c state(i,j,2) = in_yvel state(i,j,1) = zero state(i,j,2) = zero state(i,j,3) = cvmgt(denblob,in_density,r .lt. radblob) state(i,j,4) = cvmgt(one ,in_tracer ,r .lt. radblob) enddo enddo do n = 3, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,2+n) = zero enddo enddo enddo return end c ************************************************************************* c ** INITXYPOISEUILLE ** c ** Initialize the Poiseuille (viscous flow in an x-y pipe) problem c ************************************************************************* subroutine initxypoiseuille(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,numscal+BL_SPACEDIM) REAL_T dx(2) c Local variables REAL_T x, y, r integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2) state(i,j,1) = zero state(i,j,2) = one-(x-one)*(x-one) state(i,j,3) = one enddo enddo if (numscal .ge. 2) then do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2) state(i,j,4) = cvmgt(one ,in_tracer ,r .lt. radblob) enddo enddo endif do n = 3, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,2+n) = zero enddo enddo enddo return end c ************************************************************************* c ** INITRZPOISEUILLE ** c ** Initialize the Poiseuille (viscous flow in an r-z pipe) problem c ************************************************************************* subroutine initrzpoiseuille(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,numscal+BL_SPACEDIM) REAL_T dx(2) c Local variables REAL_T x, y, r integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) state(i,j,1) = zero state(i,j,2) = one-x*x state(i,j,3) = one enddo enddo if (numscal .ge. 2) then do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2) state(i,j,4) = cvmgt(one ,in_tracer ,r .lt. radblob) enddo enddo endif do n = 3, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,2+n) = zero enddo enddo enddo return end c ************************************************************************* c ** DERVORT ** c ** Derive a cell-centered vorticity c ************************************************************************* subroutine FORT_DERVORT(state,derval,derlo_1,derlo_2,derhi_1,derhi_2, $ DIMS,dx) implicit none integer derlo_1, derlo_2 integer derhi_1, derhi_2 integer DIMS REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) REAL_T derval(derlo_1:derhi_1,derlo_2:derhi_2) REAL_T dx(2) c Local variables integer i, j do j = lo_2, hi_2 do i = lo_1, hi_1 derval(i,j) = fourth*(state(i+1,j+1,2)+state(i+1,j-1,2)- $ state(i-1,j+1,2)-state(i-1,j-1,2)) / dx(1) - $ fourth*(state(i+1,j+1,1)+state(i-1,j+1,1)- $ state(i+1,j-1,1)-state(i-1,j-1,1)) / dx(2) enddo enddo return end c ************************************************************************* c ** DERAVGP ** c ** Average nodal pressure onto cell centers for plotting purposes c ************************************************************************* subroutine FORT_DERAVGP(pressure,dat,DIMS) implicit none integer DIMS REAL_T pressure(lo_1:hi_1+1,lo_2:hi_2+1) REAL_T dat(lo_1:hi_1 ,lo_2:hi_2 ) c Local variables integer i, j do j = lo_2, hi_2 do i = lo_1, hi_1 dat(i,j) = (pressure(i,j ) + pressure(i+1,j ) + $ pressure(i,j+1) + pressure(i+1,j+1) ) * fourth enddo enddo return end c ************************************************************************* c ** FORT_SET_CELL_VELBC ** c ** set velocity bc for computation of derived variables c ************************************************************************* subroutine FORT_SET_CELL_VELBC(u,DIMS,bc,irz,visc_coef,dx,time) implicit none #include "probdata.H" integer DIMS REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) integer bc(2,2) integer irz REAL_T visc_coef REAL_T dx(2) REAL_T time c Local variables integer i, j, is, ie, js, je REAL_T x is = lo_1 ie = hi_1 js = lo_2 je = hi_2 if (BCY_LO .eq. OUTLET) then do i = is-1,ie+1 u(i,js-1,2) = u(i,js,2) u(i,js-1,1) = u(i,js,1) enddo elseif (BCY_LO .eq. INLET) then if (prob_type .eq. 5) then do i = is-1,ie+1 x = (float(i)+half)*dx(1) u(i,js-1,2) = one - (x-one)*(x-one) u(i,js-1,1) = -u(i,js,1) enddo else if (prob_type .eq. 6) then do i = is-1,ie+1 x = (float(i)+half)*dx(1) u(i,js-1,2) = one - x*x u(i,js-1,1) = -u(i,js,1) enddo else do i = is-1,ie+1 u(i,js-1,2) = two* in_yvel - u(i,js,2) u(i,js-1,1) = -u(i,js,1) enddo endif elseif (BCY_LO .eq. WALL) then do i = is-1,ie+1 u(i,js-1,2) = -u(i,js,2) u(i,js-1,1) = three*u(i,js,1) - three*u(i,js+1,1)+u(i,js+2,1) enddo if (visc_coef .gt. zero) then do i = is-1,ie+1 u(i,js-1,2) = -u(i,js,2) u(i,js-1,1) = -u(i,js,1) enddo endif endif if (BCY_HI .eq. OUTLET) then do i = is-1,ie+1 u(i,je+1,2) = u(i,je,2) u(i,je+1,1) = u(i,je,1) enddo elseif (BCY_HI .eq. INLET) then do i = is-1,ie+1 u(i,je+1,2) = two*in_yvel - u(i,je,2) u(i,je+1,1) = - u(i,je,1) enddo elseif (BCY_HI .eq. WALL) then do i = is-1,ie+1 u(i,je+1,2) = -u(i,je,2) u(i,je+1,1) = three*u(i,je,1) - three*u(i,je-1,1)+u(i,je-2,1) enddo if (visc_coef .gt. zero) then do i = is-1,ie+1 u(i,je+1,1) = -u(i,je,1) enddo endif endif if (BCX_LO .eq. OUTLET) then do j = js-1,je+1 u(is-1,j,1) = u(is,j,1) u(is-1,j,2) = u(is,j,2) enddo elseif (BCX_LO .eq. INLET) then do j = js-1,je+1 u(is-1,j,1) = two*in_xvel - u(is,j,1) u(is-1,j,2) = - u(is,j,2) enddo elseif (BCX_LO .eq. WALL) then do j = js-1,je+1 u(is-1,j,1) = -u(is,j,1) u(is-1,j,2) = three*u(is,j,2)-three*u(is+1,j,2)+u(is+2,j,2) enddo if (irz .eq. 0 .and. visc_coef .gt. zero) then do j = js-1,je+1 u(is-1,j,2) = -u(is,j,2) enddo endif endif if (BCX_HI .eq. OUTLET) then do j = js-1,je+1 u(ie+1,j,1) = u(ie,j,1) u(ie+1,j,2) = u(ie,j,2) enddo elseif (BCX_HI .eq. INLET) then do j = js-1,je+1 u(ie+1,j,1) = two *in_xvel - u(ie,j,1) u(ie+1,j,2) = - u(ie,j,2) enddo elseif (BCX_HI .eq. WALL) then do j = js-1,je+1 u(ie+1,j,1) = - u(ie,j,1) u(ie+1,j,2) = three*u(ie,j,2)-three*u(ie-1,j,2)+u(ie-2,j,2) enddo if (visc_coef .gt. zero) then do j = js-1,je+1 u(ie+1,j,2) = - u(ie,j,2) enddo endif endif return end c ************************************************************************* c ** VELINFLOW ** c ** Impose the inflow boundary conditions on velocity c ************************************************************************* subroutine velinflow(u,DIMS,time,dx,idir,is_hi) implicit none #include "probdata.H" integer DIMS REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3) REAL_T time REAL_T dx(2) integer idir integer is_hi c Local variables integer i,j REAL_T x if (idir .eq. 0) then if (is_hi .eq. 0) then do j = lo_2-3,hi_2+3 u(lo_1-1,j) = in_xvel u(lo_1-2,j) = in_xvel u(lo_1-3,j) = in_xvel enddo else do j = lo_2-3,hi_2+3 u(hi_1+1,j) = in_xvel u(hi_1+2,j) = in_xvel u(hi_1+3,j) = in_xvel enddo endif elseif (idir .eq. 1) then if (is_hi .eq. 0) then if (prob_type .eq. 5) then do i = lo_1-3,hi_1+3 x = (float(i)+half)*dx(1) u(i,lo_2-1) = one-(x-one)*(x-one) u(i,lo_2-2) = one-(x-one)*(x-one) u(i,lo_2-3) = one-(x-one)*(x-one) enddo elseif (prob_type .eq. 6) then do i = lo_1-3,hi_1+3 x = (float(i)+half)*dx(1) u(i,lo_2-1) = one-x*x u(i,lo_2-2) = one-x*x u(i,lo_2-3) = one-x*x enddo else do i = lo_1-3,hi_1+3 u(i,lo_2-1) = in_yvel u(i,lo_2-2) = in_yvel u(i,lo_2-3) = in_yvel enddo endif else do i = lo_1-3,hi_1+3 u(i,hi_2+1) = in_yvel u(i,lo_2-2) = in_yvel u(i,lo_2-3) = in_yvel enddo endif else print *,'bogus idir in velinflow ',idir stop endif return end c ************************************************************************* c ** SCALINFLOW ** c ** Impose the inflow boundary conditions on scalars c ************************************************************************* subroutine scalinflow(s,DIMS,SDIMS,time,dx,idir,is_hi,which_scal) implicit none #include "probdata.H" integer DIMS integer SDIMS REAL_T s(slo_1:shi_1,slo_2:shi_2) REAL_T time REAL_T dx(2) integer idir integer is_hi integer which_scal c Local variables integer i,j integer ng,ngmax REAL_T inflow_val ngmax = lo_1-slo_1 if (which_scal .eq. 0) then inflow_val = in_density elseif (which_scal .eq. 1) then inflow_val = in_tracer else print *,"STOP IN SCALINFLOW " print *," -- DONT HAVE VALUE FOR THIS VARIABLE " stop endif if (idir .eq. 0) then if (is_hi .eq. 0) then do ng=1,ngmax do j = slo_2,shi_2 s(lo_1-ng,j) = inflow_val enddo enddo else do ng=1,ngmax do j = slo_2,shi_2 s(hi_1+ng,j) = inflow_val enddo enddo endif elseif (idir .eq. 1) then if (is_hi .eq. 0) then do ng=1,ngmax do i = slo_1,shi_1 s(i,lo_2-ng) = inflow_val enddo enddo else do ng=1,ngmax do i = slo_1,shi_1 s(i,hi_2+ng) = inflow_val enddo enddo endif else print *,'bogus idir in scalinflow ',idir stop endif return end ccseapps-2.5/CCSEApps/pVarden/visc_3d.F0000644000175000017500000003407011634153073020723 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "VISC_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #define CDIMS loc_1,loc_2,loc_3,hic_1,hic_2,hic_3 #if BL_USE_FLOAT #define twentyfive 25.e0 #define fifth 0.2 #else #define twentyfive 25.d0 #define fifth 0.2d0 #endif c ************************************************************************* c ** RESID ** c ** Compute the residual c ************************************************************************* subroutine FORT_RESID(res,u,f,areax,areay,areaz,alpha, $ DIMS,dx,resnorm,bc,level,idir,mu,ng) implicit none integer DIMS integer ng REAL_T res(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng-1) REAL_T u(lo_1-ng :hi_1+ng ,lo_2-ng :hi_2+ng ,lo_3-ng :hi_3+ng ) REAL_T f(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng-1) REAL_T areax(lo_1-ng+1:hi_1+ng ,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng-1) REAL_T areay(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng ,lo_3-ng+1:hi_3+ng-1) REAL_T areaz(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng ) REAL_T alpha(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng ) REAL_T dx(3) REAL_T mu REAL_T resnorm integer bc(2,3) integer level integer idir c Local variables REAL_T rlu REAL_T ux_left,ux_left_wall REAL_T ux_rght,ux_rght_wall REAL_T uy_bot,uy_bot_wall REAL_T uy_top,uy_top_wall REAL_T uz_dwn,uz_dwn_wall REAL_T uz_up ,uz_up_wall integer is,ie,js,je,ks,ke integer i,j,k is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 call gsrbvbc(u,DIMS,bc,ng) resnorm = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 ux_left = (u(i,j,k) - u(i-1,j,k)) ux_left_wall = (-sixteen * u(is-1,j,k) + twenty * u(is,j,k) $ -five * u(is+1,j,k) + u(is+2,j,k) ) * fifth ux_left = cvmgt(ux_left_wall, ux_left, i .eq. is .and. $ (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) ) ux_left = areax(i,j,k) * ux_left / dx(1) ux_rght = (u(i+1,j,k) - u(i,j,k)) ux_rght_wall = -(-sixteen * u(ie+1,j,k) + twenty * u(ie,j,k) $ -five * u(ie-1,j,k) + u(ie-2,j,k) ) * fifth ux_rght = cvmgt(ux_rght_wall, ux_rght, i .eq. ie .and. $ (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) ) ux_rght = areax(i+1,j,k) * ux_rght / dx(1) uy_bot = (u(i,j,k) - u(i,j-1,k)) uy_bot_wall = (-sixteen * u(i,js-1,k) + twenty * u(i,js,k) $ -five * u(i,js+1,k) + u(i,js+2,k) ) * fifth uy_bot = cvmgt(uy_bot_wall, uy_bot, j .eq. js .and. $ (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) ) uy_bot = areay(i,j,k) * uy_bot / dx(2) uy_top = (u(i,j+1,k) - u(i,j,k)) uy_top_wall = -(-sixteen * u(i,je+1,k) + twenty * u(i,je,k) $ -five * u(i,je-1,k) + u(i,je-2,k) ) * fifth uy_top = cvmgt(uy_top_wall, uy_top, j .eq. je .and. $ (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) ) uy_top = areay(i,j+1,k) * uy_top / dx(2) uz_dwn = (u(i,j,k) - u(i,j,k-1)) uz_dwn_wall = (-sixteen * u(i,j,ks-1) + twenty * u(i,j,ks) $ -five * u(i,j,ks+1) + u(i,j,ks+2) ) * fifth uz_dwn = cvmgt(uz_dwn_wall, uz_dwn, k .eq. ks .and. $ (BCZ_LO .eq. WALL .or. BCZ_LO .eq. INLET) ) uz_dwn = areaz(i,j,k) * uz_dwn / dx(3) uz_up = (u(i,j,k+1) - u(i,j,k)) uz_up_wall = -(-sixteen * u(i,j,ke+1) + twenty * u(i,j,ke) $ -five * u(i,j,ke-1) + u(i,j,ke-2) ) * fifth uz_up = cvmgt(uz_up_wall, uz_up, k .eq. ke .and. $ (BCZ_HI .eq. WALL .or. BCZ_HI .eq. INLET) ) uz_up = areaz(i,j,k+1) * uz_up / dx(3) rlu = alpha(i,j,k)*u(i,j,k) - mu*((ux_rght - ux_left)+ $ (uy_top - uy_bot )+ $ (uz_up - uz_dwn ) ) res(i,j,k) = f(i,j,k) - rlu resnorm = max(resnorm,abs(res(i,j,k))) enddo enddo enddo return end c ************************************************************************* c ** GSRBV ** c ** Gauss-Seidel red-black relaxation c ************************************************************************* subroutine FORT_GSRBV(u,f,areax,areay,areaz,alpha, $ DIMS,dx,bc,level,idir,nngsrb,mu,ng) implicit none integer DIMS integer ng REAL_T u(lo_1-ng :hi_1+ng ,lo_2-ng :hi_2+ng ,lo_3-ng :hi_3+ng ) REAL_T f(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng-1) REAL_T areax(lo_1-ng+1:hi_1+ng ,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng-1) REAL_T areay(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng ,lo_3-ng+1:hi_3+ng-1) REAL_T areaz(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng ) REAL_T alpha(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1,lo_3-ng+1:hi_3+ng ) REAL_T dx(3) REAL_T mu integer bc(2,3) integer level,idir integer nngsrb c Local variables REAL_T rlam,rlu REAL_T facx,facy,facz REAL_T hxsqinv, hysqinv, hzsqinv REAL_T ux_left,ux_left_wall REAL_T ux_rght,ux_rght_wall REAL_T uy_bot,uy_bot_wall REAL_T uy_top,uy_top_wall REAL_T uz_dwn,uz_dwn_wall REAL_T uz_up,uz_up_wall REAL_T facx_left, facx_rght REAL_T facy_bot, facy_top REAL_T facz_dwn, facz_up integer i,j,k,iter integer is,ie,js,je,ks,ke integer extra_xlo,extra_xhi integer extra_ylo,extra_yhi integer extra_zlo,extra_zhi integer iinc logical ltest is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 call gsrbvbc(u,DIMS,bc,ng) do iter = 1, 2*nngsrb extra_xlo = cvmgt(ng-iter,0,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) extra_xhi = cvmgt(ng-iter,0,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) extra_ylo = cvmgt(ng-iter,0,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) extra_yhi = cvmgt(ng-iter,0,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) extra_zlo = cvmgt(ng-iter,0,BCZ_LO .eq. INTERIOR .or. BCZ_LO .eq. PERIODIC) extra_zhi = cvmgt(ng-iter,0,BCZ_HI .eq. INTERIOR .or. BCZ_HI .eq. PERIODIC) do k = lo_3-extra_zlo,hi_3+extra_zhi do j = lo_2-extra_ylo,hi_2+extra_yhi iinc = mod(j+k+iter+1+extra_xlo+2*ng,2) do i = lo_1-extra_xlo+iinc,hi_1+extra_xhi,2 ux_left = (u(i,j,k) - u(i-1,j,k)) ux_left_wall = (-sixteen * u(is-1,j,k) + twenty * u(is,j,k) $ -five * u(is+1,j,k) + u(is+2,j,k) ) * fifth ltest = (i .eq. is .and. level .eq. 0 .and. $ (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) ) ux_left = cvmgt(ux_left_wall,ux_left,ltest) facx_left = cvmgt(four ,one ,ltest) ux_left = areax(i,j,k) * ux_left / dx(1) facx_left = areax(i,j,k) * facx_left / dx(1) ux_rght = (u(i+1,j,k) - u(i,j,k)) ux_rght_wall = -(-sixteen * u(ie+1,j,k) + twenty * u(ie,j,k) $ -five * u(ie-1,j,k) + u(ie-2,j,k) ) * fifth ltest = (i .eq. ie .and. level .eq. 0 .and. $ (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) ) ux_rght = cvmgt(ux_rght_wall,ux_rght,ltest) facx_rght = cvmgt(four ,one ,ltest) ux_rght = areax(i+1,j,k) * ux_rght / dx(1) facx_rght = areax(i+1,j,k) * facx_rght / dx(1) uy_bot = (u(i,j,k) - u(i,j-1,k)) uy_bot_wall = (-sixteen * u(i,js-1,k) + twenty * u(i,js,k) $ -five * u(i,js+1,k) + u(i,js+2,k) ) * fifth ltest = (j .eq. js .and. level .eq. 0 .and. $ (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) ) uy_bot = cvmgt(uy_bot_wall,uy_bot,ltest) facy_bot = cvmgt(four ,one ,ltest) uy_bot = areay(i,j,k) * uy_bot / dx(2) facy_bot = areay(i,j,k) * facy_bot / dx(2) uy_top = (u(i,j+1,k) - u(i,j,k)) uy_top_wall = -(-sixteen * u(i,je+1,k) + twenty * u(i,je,k) $ -five * u(i,je-1,k) + u(i,je-2,k) ) * fifth ltest = (j .eq. je .and. level .eq. 0 .and. $ (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) ) uy_top = cvmgt(uy_top_wall,uy_top,ltest) facy_top = cvmgt(four ,one ,ltest) uy_top = areay(i,j+1,k) * uy_top / dx(2) facy_top = areay(i,j+1,k) * facy_top / dx(2) uz_dwn = (u(i,j,k) - u(i,j,k-1)) uz_dwn_wall = (-sixteen * u(i,j,ks-1) + twenty * u(i,j,ks) $ -five * u(i,j,ks+1) + u(i,j,ks+2) ) * fifth ltest = (k .eq. ks .and. level .eq. 0 .and. $ (BCZ_LO .eq. WALL .or. BCZ_LO .eq. INLET) ) uz_dwn = cvmgt(uz_dwn_wall,uz_dwn,ltest) facz_dwn = cvmgt(four ,one ,ltest) uz_dwn = areaz(i,j,k) * uz_dwn / dx(3) facz_dwn = areaz(i,j,k) * facz_dwn / dx(3) uz_up = (u(i,j,k+1) - u(i,j,k)) uz_up _wall = -(-sixteen * u(i,j,ke+1) + twenty * u(i,j,ke) $ -five * u(i,j,ke-1) + u(i,j,ke-2) ) * fifth ltest = (k .eq. ke .and. level .eq. 0 .and. $ (BCZ_HI .eq. WALL .or. BCZ_HI .eq. INLET) ) uz_up = cvmgt(uz_up_wall ,uz_up ,ltest) facz_up = cvmgt(four ,one ,ltest) uz_up = areaz(i,j,k+1) * uz_up / dx(3) facz_up = areaz(i,j,k+1) * facz_up / dx(3) rlu = alpha(i,j,k)*u(i,j,k) - mu*((ux_rght - ux_left)+ $ (uy_top - uy_bot )+ $ (uz_up - uz_dwn )) rlam = alpha(i,j,k) + mu*(facx_left+facx_rght+facy_bot+facy_top+ $ facz_dwn+facz_up) rlam = one/rlam u(i,j,k) = u(i,j,k) - rlam*(rlu - f(i,j,k)) enddo enddo enddo call gsrbvbc(u,DIMS,bc,ng) enddo return end c ************************************************************************* c ** GSRBVBC ** c ** Impose phyical boundary conditions c ************************************************************************* subroutine gsrbvbc(u,DIMS,bc,ng) implicit none integer DIMS integer ng REAL_T u(lo_1-ng:hi_1+ng,lo_2-ng:hi_2+ng,lo_3-ng:hi_3+ng) integer bc(2,3) c Local variables integer i,j,k,is,ie,js,je,ks,ke integer ilo,ihi,jlo,jhi,klo,khi is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 ilo = cvmgt(lo_1-ng,lo_1,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) ihi = cvmgt(hi_1+ng,hi_1,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) jlo = cvmgt(lo_2-ng,lo_2,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) jhi = cvmgt(hi_2+ng,hi_2,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) klo = cvmgt(lo_3-ng,lo_3,BCZ_LO .eq. INTERIOR .or. BCZ_LO .eq. PERIODIC) khi = cvmgt(hi_3+ng,hi_3,BCZ_HI .eq. INTERIOR .or. BCZ_HI .eq. PERIODIC) c c The only boundary conditions we need to enforce are OUTLET, c since all the others are zero (now that we've put the equations c into residual-correction form). c if (BCZ_LO .eq. OUTLET) then do j = jlo,jhi do i = ilo,ihi u(i,j,ks-1) = u(i,j,ks) enddo enddo endif if (BCZ_HI .eq. OUTLET) then do j = jlo,jhi do i = ilo,ihi u(i,j,ke+1) = u(i,j,ke) enddo enddo endif if (BCY_LO .eq. OUTLET) then do k = klo,khi do i = ilo,ihi u(i,js-1,k) = u(i,js,k) enddo enddo endif if (BCY_HI .eq. OUTLET) then do k = klo,khi do i = ilo,ihi u(i,je+1,k) = u(i,je,k) enddo enddo endif if (BCX_LO .eq. OUTLET) then do k = klo,khi do j = jlo,jhi u(is-1,j,k) = u(is,j,k) enddo enddo endif if (BCX_HI .eq. OUTLET) then do k = klo,khi do j = jlo,jhi u(ie+1,j,k) = u(ie,j,k) enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/scalupd_2d.F0000644000175000017500000000675311634153073021420 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** SCALUPD ** c ** Update the scalars using conservative or convective differencing of fluxes c ************************************************************************* subroutine scalupd(s,sn,sedgex,sedgey,uadv,vadv, $ diff,force,areax,areay,vol,DIMS, $ dx,dt,is_conserv,numscal) implicit none integer DIMS integer numscal REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,numscal) REAL_T sn(lo_1-3:hi_1+3,lo_2-3:hi_2+3,numscal) REAL_T sedgex(lo_1 :hi_1+1,lo_2 :hi_2 ,numscal) REAL_T sedgey(lo_1 :hi_1 ,lo_2 :hi_2+1,numscal) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T diff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T areax(lo_1 :hi_1+1,lo_2 :hi_2 ) REAL_T areay(lo_1 :hi_1 ,lo_2 :hi_2+1) REAL_T vol(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T dx(2) REAL_T dt integer is_conserv(numscal) c Local variables REAL_T divsu REAL_T uconv REAL_T vconv integer i,j,n do n = 1, numscal if (is_conserv(n) .eq. 1) then do j = lo_2,hi_2 do i = lo_1,hi_1 divsu = ( sedgex(i+1,j,n)*uadv(i+1,j)*areax(i+1,j) - $ sedgex(i ,j,n)*uadv(i ,j)*areax(i ,j) $ + sedgey(i,j+1,n)*vadv(i,j+1)*areay(i,j+1) - $ sedgey(i,j ,n)*vadv(i,j )*areay(i,j ) ) / vol(i,j) sn(i,j,n) = s(i,j,n) - dt*divsu + half*dt*diff(i,j,n)+dt*force(i,j,n) enddo enddo else do j = lo_2,hi_2 do i = lo_1,hi_1 uconv = half * (uadv(i+1,j) + uadv(i,j)) vconv = half * (vadv(i,j+1) + vadv(i,j)) divsu = uconv * (sedgex(i+1,j,n) - sedgex(i,j,n)) / dx(1) + $ vconv * (sedgey(i,j+1,n) - sedgey(i,j,n)) / dx(2) sn(i,j,n) = s(i,j,n) - dt*divsu + half*dt*diff(i,j,n) + dt*force(i,j,n) enddo enddo endif enddo return end ccseapps-2.5/CCSEApps/pVarden/inputs5.3d0000644000175000017500000002514311634153073021122 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 10 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 64 32 32 ############################################################################# # Maximum size of grid allowed. max_grid_size = 16 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin5 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030 (assuming plot_file_root is "plt"). # These plot files can be viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 0 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 1 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 1 ############################################################################# # Boundary conditions in the low z-direction. # If bcz_lo = 1, the domain is periodic in the z-direction. # If bcz_lo = 2, the domain has a solid (reflecting) walls in the low z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_lo = 3, the domain has inflow at low z. # If bcz_lo = 4, the domain has outflow at low z. bcz_lo = 3 ############################################################################# # Boundary conditions in the high z-direction. # If bcz_hi = 1, the domain is periodic in the z-direction. # If bcz_hi = 2, the domain has a solid (reflecting) wall in the high z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_hi = 3, the domain has inflow at high z. # If bcz_hi = 4, the domain has outflow at high z. bcz_hi = 4 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 2. 1. 1. ############################################################################# # Set to 1 if periodic in that direction geometry.is_periodic = 0 1 0 ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.0 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/inputs3.3d0000644000175000017500000002514211634153073021117 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 1000000 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 16 16 16 ############################################################################# # Maximum size of grid allowed. max_grid_size = 64 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1.0 ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin3 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 10000 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030 (assuming plot_file_root is "plt"). # These plot files can be viewed using the visualization tool "amrvis2d." plot_int = 1000 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 0 ############################################################################# # Set to 1 if periodic in that direction geometry.is_periodic = 1 1 1 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 1 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 1 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 1 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 1 ############################################################################# # Boundary conditions in the low z-direction. # If bcz_lo = 1, the domain is periodic in the z-direction. # If bcz_lo = 2, the domain has a solid (reflecting) walls in the low z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_lo = 3, the domain has inflow at low z. # If bcz_lo = 4, the domain has outflow at low z. bcz_lo = 1 ############################################################################# # Boundary conditions in the high z-direction. # If bcz_hi = 1, the domain is periodic in the z-direction. # If bcz_hi = 2, the domain has a solid (reflecting) wall in the high z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_hi = 3, the domain has inflow at high z. # If bcz_hi = 4, the domain has outflow at high z. bcz_hi = 1 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 1. 1. 1. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/Grid.H0000644000175000017500000001450111634153073020255 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GRID_H_ #define _GRID_H_ #include #include #include #include #include #include #include #include #include // //@Man: //@Doc: This class is called from main and handles all the work //@Memo: Handles all the time-stepping class Grid { protected: //@ManDoc: BoxArray which covers the domain BoxArray grids; //@ManDoc: Geometry object Geometry geom; //@ManDoc: Mesh spacing array. const Real* dx; //@ManDoc: Is the coordinate system r-z? int is_rz; //@ManDoc: Pointer to a nodal projection operator hg_projector* proj; //@ManDoc: Pointer to a MAC projection operator mac_projector* macproj; //@ManDoc: Pointer to a solver for the Crank-Nicholson diffusive/viscous update diffuser* diffuse_op; //@ManDoc: Order of the slope calculation (1st, 2nd, or 4th) static int slope_order; //@ManDoc: How many initial iterations to do static int init_iter; //@ManDoc:: fixed time step static Real fixed_dt; //@ManDoc: File name of the checkpoint file to read from std::string restart_file; //@ManDoc: Read and parse the inputs file void parseInputs(); //@ManDoc: Restart calculation from checkpoint file void restart(std::string& filename, int& nstep, Real& time, Real& dt); std::string probin_file; MultiFab state; MultiFab staten; MultiFab slopex; MultiFab slopey; #if (BL_SPACEDIM == 3) MultiFab slopez; #endif MultiFab rhonph; MultiFab pressure; MultiFab gradp; MultiFab force; MultiFab scalforce; MultiFab visc; MultiFab diff; MultiFab edgex; MultiFab edgey; #if (BL_SPACEDIM == 3) MultiFab edgez; #endif MultiFab uadv; MultiFab vadv; #if (BL_SPACEDIM == 3) MultiFab wadv; #endif MultiFab utrans; MultiFab vtrans; #if (BL_SPACEDIM == 3) MultiFab wtrans; #endif MultiFab area[BL_SPACEDIM]; MultiFab vol; static int verbose; static int writeTurb; /*@ManDoc: Array holds flags as to whether scalars should be conservatively or convectively updated */ Array is_conserv; /*@ManDoc: Array holds diffusive coefficients for scalars */ Array diff_coef; //@ManDoc: Coefficient of dynamic viscosity Real visc_coef; //@ManDoc: Number of scalars, defined as N_STATE - NDIM int numscal; protected: //@ManDoc: Allocate and initialize state variables void initialInit(int& nstep, Real& time, Real& dt); //@ManDoc: Do all the work to advance state void timeStep(Real time, Real dt); //@ManDoc: Print out the max and min of the current state. void printMaxMin(); //@ManDoc: Calculate the slopes of all state variables void getSlopes(int first_comp, int num_comp); //@ManDoc: Calculate the viscous term for momentum equation void getViscTerm(); //@ManDoc: Calculate the diffusive term for scalar update equation void getDiffTerm(); //@ManDoc: Calculate the pressure gradient void getGradP(); //@ManDoc: Define the forcing terms in the momentum equation void getForce(Real current_time); //@ManDoc: Compute the kinetic energy void getKinetic(Real current_time); //@ManDoc: Define the forcing terms in the scalar equations void getScalForce(Real current_time); //@ManDoc: Create the edge-based half-time advection velocities void makeAdvVels(Real dt, Real time); //@ManDoc: Update the scalar quantities void updateScalars(Real dt, Real time); //@ManDoc: Update velocity void updateVelocity(Real dt, Real time); //@ManDoc: Calculate the half-time density = avg of rho and rhon void getRhoHalf(Real time, Real dt); public: //@ManDoc: Constructor Grid(BoxArray Grids, Geometry& geom, std::string probin_file); //@ManDoc: Destructor ~Grid(); //@ManDoc: Calculate dt for the next time step Real estimateDt(Real & dt, Real cfl); //@ManDoc: Decide whether to init with initialInit or restart void init(int& nstep, Real& time, Real& dt); //@ManDoc: Set up the data structures. void init_data_structures(); //@ManDoc: Perform the initial iterations to calculate an initial pressure void initialIter(Real time, Real dt); //@ManDoc: Call timeStep and swap staten with state. void advance(Real time, Real dt); //@ManDoc: Write a checkpoint file to be used for restart void writeCheckPoint(int nstep, Real time, Real dt, std::string& check_file_root); //@ManDoc: Worker function to write a checkPoint file void checkPoint(const std::string& dir, std::ostream& os, VisMF::How how = VisMF::OneFilePerCPU); //@ManDoc: Worker function to write a plotfile void writePlotFile(MultiFab& plotMF, Real time); //@ManDoc: Derive the necesary quantity for the plot files void deriveData(MultiFab& data, const std::string& varname, Real time); //@ManDoc: Return the number of state variables int NumState(); //@ManDoc: Return the number of derived variables int NumDerive(); }; #endif ccseapps-2.5/CCSEApps/pVarden/visc_2d.F0000644000175000017500000002605111634153073020722 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "VISC_F.H" #include "BCTypes.H" #if BL_USE_FLOAT #define twentyfive 25.e0 #else #define twentyfive 25.d0 #endif #define DIMS lo_1,lo_2,hi_1,hi_2 #define CDIMS loc_1,loc_2,hic_1,hic_2 c ************************************************************************* c ** RESID ** c ** Compute the residual. c ************************************************************************* subroutine FORT_RESID(res,u,f,areax,areay,alpha,DIMS, $ dx,irz,resnorm,bc,level,idir,mu,ng) implicit none integer DIMS integer ng REAL_T res(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1) REAL_T u(lo_1-ng :hi_1+ng ,lo_2-ng :hi_2+ng ) REAL_T f(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1) REAL_T areax(lo_1-ng+1:hi_1+ng ,lo_2-ng+1:hi_2+ng-1) REAL_T areay(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng ) REAL_T alpha(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1) REAL_T dx(2) REAL_T resnorm integer irz integer bc(2,2) integer level integer idir REAL_T mu c Local variables REAL_T rlu REAL_T r, vol integer i,j integer is,ie,js,je REAL_T ux_left,ux_left_wall REAL_T ux_rght,ux_rght_wall REAL_T uy_bot ,uy_bot_wall REAL_T uy_top ,uy_top_wall is = lo_1 ie = hi_1 js = lo_2 je = hi_2 call gsrbvbc(u,DIMS,bc,irz,idir,ng) resnorm = zero do j = js, je do i = is, ie ux_left = (u(i,j) - u(i-1,j)) ux_left_wall = (-sixteen * u(is-1,j) + twenty * u(is,j) $ -five * u(is+1,j) + u(is+2,j) ) * fifth ux_left = cvmgt(ux_left_wall, ux_left, i .eq. is .and. $ (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) .and. $ (irz .eq. 0 .or. (irz .eq. 1 .and. idir .eq. 0) ) ) ux_left = areax(i,j) * ux_left / dx(1) ux_rght = (u(i+1,j) - u(i,j)) ux_rght_wall = -(-sixteen * u(ie+1,j) + twenty * u(ie,j) $ -five * u(ie-1,j) + u(ie-2,j) ) * fifth ux_rght = cvmgt(ux_rght_wall, ux_rght, i .eq. ie .and. $ (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) ) ux_rght = areax(i+1,j) * ux_rght / dx(1) uy_bot = (u(i,j) - u(i,j-1)) uy_bot_wall = (-sixteen * u(i,js-1) + twenty * u(i,js) $ -five * u(i,js+1) + u(i,js+2) ) * fifth uy_bot = cvmgt(uy_bot_wall, uy_bot, j .eq. js .and. $ (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) ) uy_bot = areay(i,j) * uy_bot / dx(2) uy_top = (u(i,j+1) - u(i,j)) uy_top_wall = -(-sixteen * u(i,je+1) + twenty * u(i,je) $ -five * u(i,je-1) + u(i,je-2) ) * fifth uy_top = cvmgt(uy_top_wall, uy_top, j .eq. je .and. $ (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) ) uy_top = areay(i,j+1) * uy_top / dx(2) rlu = alpha(i,j)*u(i,j) - mu*((ux_rght - ux_left)+ $ (uy_top - uy_bot ) ) res(i,j) = f(i,j) - rlu enddo enddo if (irz .eq. 1 .and. idir .eq. 0) then do j = js,je do i = is,ie r = (i+half)*dx(1) vol = r * dx(1) * dx(2) res(i,j) = res(i,j) - mu*vol*u(i,j)/(r*r) enddo enddo endif do j = js,je do i = is,ie resnorm = max(resnorm,abs(res(i,j))) enddo enddo return end c ************************************************************************* c ** GSRBV ** c ** Gauss-Seidel red-black relaxation c ************************************************************************* subroutine FORT_GSRBV(u,f,areax,areay,alpha,DIMS,dx,bc,level, $ idir,nngsrb,mu,irz,ng) implicit none integer DIMS integer ng REAL_T u(lo_1-ng :hi_1+ng ,lo_2-ng :hi_2+ng ) REAL_T f(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1) REAL_T areax(lo_1-ng+1:hi_1+ng ,lo_2-ng+1:hi_2+ng-1) REAL_T areay(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng ) REAL_T alpha(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1) REAL_T dx(2) integer bc(2,2) integer level integer idir integer nngsrb integer irz REAL_T mu c Local variables REAL_T rlam,rlu integer i,j,iter,iinc integer is,ie,js,je integer extra_xlo,extra_xhi,extra_ylo,extra_yhi REAL_T ux_left,ux_left_wall REAL_T ux_rght,ux_rght_wall REAL_T uy_bot ,uy_bot_wall REAL_T uy_top ,uy_top_wall REAL_T facx_left,facx_rght REAL_T facy_bot ,facy_top REAL_T r, vol logical ltest is = lo_1 ie = hi_1 js = lo_2 je = hi_2 call gsrbvbc(u,DIMS,bc,0,idir,ng) do iter = 1, 2*nngsrb extra_xlo = cvmgt(ng-iter,0,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) extra_xhi = cvmgt(ng-iter,0,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) extra_ylo = cvmgt(ng-iter,0,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) extra_yhi = cvmgt(ng-iter,0,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) do j = lo_2-extra_ylo,hi_2+extra_yhi iinc = mod(j+iter+1+extra_xlo,2) do i = lo_1-extra_xlo+iinc,hi_1+extra_xhi,2 ux_left = (u(i,j) - u(i-1,j)) ux_left_wall = (-sixteen * u(is-1,j) + twenty * u(is,j) $ -five * u(is+1,j) + u(is+2,j) ) * fifth ltest = (i .eq. is .and. level .eq. 0 .and. $ (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) .and. $ (irz .eq. 0 .or. (irz .eq. 1 .and. idir .eq. 0) ) ) ux_left = cvmgt(ux_left_wall,ux_left,ltest) facx_left = cvmgt(four ,one ,ltest) ux_left = areax(i,j) * ux_left / dx(1) facx_left = areax(i,j) * facx_left / dx(1) ux_rght = (u(i+1,j) - u(i,j)) ux_rght_wall = -(-sixteen * u(ie+1,j) + twenty * u(ie,j) $ -five * u(ie-1,j) + u(ie-2,j) ) * fifth ltest = (i .eq. ie .and. level .eq. 0 .and. $ (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) ) ux_rght = cvmgt(ux_rght_wall,ux_rght,ltest) facx_rght = cvmgt(four ,one ,ltest) ux_rght = areax(i+1,j) * ux_rght / dx(1) facx_rght = areax(i+1,j) * facx_rght / dx(1) uy_bot = (u(i,j) - u(i,j-1)) uy_bot_wall = (-sixteen * u(i,js-1) + twenty * u(i,js) $ -five * u(i,js+1) + u(i,js+2) ) * fifth ltest = (j .eq. js .and. level .eq. 0 .and. $ (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) ) uy_bot = cvmgt(uy_bot_wall,uy_bot,ltest) facy_bot = cvmgt(four ,one ,ltest) uy_bot = areay(i,j) * uy_bot / dx(2) facy_bot = areay(i,j) * facy_bot / dx(2) uy_top = (u(i,j+1) - u(i,j)) uy_top_wall = -(-sixteen * u(i,je+1) + twenty * u(i,je) $ -five * u(i,je-1) + u(i,je-2) ) * fifth ltest = (j .eq. je .and. level .eq. 0 .and. $ (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) ) uy_top = cvmgt(uy_top_wall,uy_top,ltest) facy_top = cvmgt(four ,one ,ltest) uy_top = areay(i,j+1) * uy_top / dx(2) facy_top = areay(i,j+1) * facy_top / dx(2) rlu = alpha(i,j)*u(i,j) - mu*((ux_rght - ux_left)+ $ (uy_top - uy_bot )) if (irz .eq. 1 .and. idir .eq. 0) then r = (float(i)+half)*dx(1) vol = r * dx(1) * dx(2) rlu = rlu + mu * vol * u(i,j) / (r*r) endif rlam = alpha(i,j) + mu*(facx_left+facx_rght+facy_bot+facy_top) rlam = one/rlam u(i,j) = u(i,j) - rlam*(rlu - f(i,j)) enddo enddo call gsrbvbc(u,DIMS,bc,0,idir,ng) enddo return end c ************************************************************************* c ** GSRBVBC ** c ** Impose phyical boundary conditions c ************************************************************************* subroutine gsrbvbc(u,DIMS,bc,irz,idir,ng) implicit none integer DIMS integer ng REAL_T u(lo_1-ng:hi_1+ng,lo_2-ng:hi_2+ng) integer bc(2,2) integer irz integer idir c Local variables integer i,j,is,ie,js,je integer ilo,ihi,jlo,jhi is = lo_1 js = lo_2 ie = hi_1 je = hi_2 ilo = cvmgt(lo_1-ng,lo_1,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) ihi = cvmgt(hi_1+ng,hi_1,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) jlo = cvmgt(lo_2-ng,lo_2,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) jhi = cvmgt(hi_2+ng,hi_2,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) c c The only boundary conditions we need to enforce are OUTLET, c and the r=0 wall, since all the others are zero c (now that we've put the equations into residual-correction form). c if (BCY_LO .eq. OUTLET) then do i = ilo,ihi u(i,js-1) = u(i,js) enddo endif if (BCY_HI .eq. OUTLET) then do i = ilo,ihi u(i,je+1) = u(i,je) enddo endif if ((BCX_LO .eq. OUTLET) .or. $ (BCX_LO .eq. WALL .and. idir .ne. 0 .and. irz .eq. 1) ) then do j = jlo,jhi u(is-1,j) = u(is,j) enddo endif if (BCX_HI .eq. OUTLET) then do j = jlo,jhi u(ie+1,j) = u(ie,j) enddo endif return end ccseapps-2.5/CCSEApps/pVarden/cmpdt_3d.F0000644000175000017500000000645611634153073021075 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** CMPDT ** c ** Compute the new time step c ******************************************************************** subroutine FORT_CMPDT(u,rho,gp,force,dx,dtold,dt,cflfac,DIMS) implicit none integer DIMS REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) REAL_T rho(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3) REAL_T gp(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T dx(3) REAL_T dt,dtold REAL_T cflfac c Local variables REAL_T spdx,spdy,spdz REAL_T pforcex,pforcey,pforcez REAL_T dtchange integer i, j, k REAL eps dtchange = 1.1d0 eps = 1.0e-8 spdx = zero spdy = zero spdz = zero pforcex = zero pforcey = zero pforcez = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 spdx = max(spdx ,abs(u(i,j,k,1))/dx(1)) spdy = max(spdy ,abs(u(i,j,k,2))/dx(2)) spdz = max(spdz ,abs(u(i,j,k,3))/dx(3)) pforcex = max(pforcex,abs(gp(i,j,k,1)/rho(i,j,k)-force(i,j,k,1))) pforcey = max(pforcey,abs(gp(i,j,k,2)/rho(i,j,k)-force(i,j,k,2))) pforcez = max(pforcez,abs(gp(i,j,k,3)/rho(i,j,k)-force(i,j,k,3))) enddo enddo enddo if (spdx.lt.eps .and. spdy.lt.eps .and. spdz.lt.eps) then dt = min(dx(1),dx(2),dx(3)) else dt = one / max(spdx,spdy,spdz) endif if (pforcex .gt. eps) then dt = min(dt,sqrt(two*dx(1)/pforcex)) endif if (pforcey .gt. eps) then dt = min(dt,sqrt(two*dx(2)/pforcey)) endif if (pforcez .gt. eps) then dt = min(dt,sqrt(two*dx(3)/pforcez)) endif dt = dt * cflfac if (dtold .gt. zero) dt = min(dt,dtchange*dtold) return end ccseapps-2.5/CCSEApps/pVarden/probdata.H0000644000175000017500000000314211634153073021163 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ integer prob_type, zero_dir REAL_T in_xvel, in_yvel, in_zvel, in_density, in_tracer REAL_T xblob, yblob, zblob, radblob, denblob, velfact common /probdt0/ prob_type, zero_dir common /probdt1/ in_xvel, in_yvel, in_zvel, in_density, in_tracer common /probdt2/ xblob, yblob, zblob, radblob, denblob, velfact ccseapps-2.5/CCSEApps/pVarden/HGPROJ_F.H0000644000175000017500000001273611634153073020636 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_RHSHG rhshg # define FORT_ADJUSTRHS adjustrhs # define FORT_RESIDUAL reshg # define FORT_RELAX relax # define FORT_GRADHG gradhg # define FORT_COARSIG coarsigb # define FORT_RESTRICT coarsresb # define FORT_INTERP interphg # define FORT_PROJUHG projuhg # define FORT_PROJHGD projhgd # define FORT_SOLVEHG solvehg # define FORT_MAKESUM makesum # define FORT_MKCOEFF mkcoeff #else #if defined(BL_FORT_USE_UNDERSCORE) # define FORT_RHSHG rhshg_ # define FORT_ADJUSTRHS adjustrhs_ # define FORT_RESIDUAL reshg_ # define FORT_RELAX relax_ # define FORT_GRADHG gradhg_ # define FORT_COARSIG coarsigb_ # define FORT_RESTRICT coarsresb_ # define FORT_INTERP interphg_ # define FORT_PROJUHG projuhg_ # define FORT_PROJHGD projhgd_ # define FORT_SOLVEHG solvehg_ # define FORT_MAKESUM makesum_ # define FORT_MKCOEFF mkcoeff_ #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_RHSHG RHSHG # define FORT_ADJUSTRHS ADJUSTRHS # define FORT_RESIDUAL RESHG # define FORT_RELAX RELAX # define FORT_GRADHG GRADHG # define FORT_COARSIG COARSIGB # define FORT_RESTRICT COARSRESB # define FORT_INTERP INTERPHG # define FORT_PROJUHG PROJUHG # define FORT_PROJHGD PROJHGD # define FORT_SOLVEHG SOLVEHG # define FORT_MAKESUM MAKESUM # define FORT_MKCOEFF MKCOEFF #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_RHSHG rhshg # define FORT_ADJUSTRHS adjustrhs # define FORT_RESIDUAL reshg # define FORT_RELAX relax # define FORT_GRADHG gradhg # define FORT_COARSIG coarsigb # define FORT_RESTRICT coarsresb # define FORT_INTERP interphg # define FORT_PROJUHG projuhg # define FORT_PROJHGD projhgd # define FORT_SOLVEHG solvehg # define FORT_MAKESUM makesum # define FORT_MKCOEFF mkcoeff #endif #include extern "C" { void FORT_RHSHG(Real* source, Real* state, Real* divu_src, const Real* volume, ARLIM_P(lo), ARLIM_P(hi), const Real* dx, int* bc, Real* rhsnorm, int* ng, int* is_singular, Real* ss, Real* sf); void FORT_ADJUSTRHS(Real* source, ARLIM_P(lo), ARLIM_P(hi), int* bc, int* ng, Real* sum_src); void FORT_GRADHG(Real* gradp, ARLIM_P(glo), ARLIM_P(ghi), Real* pressure, ARLIM_P(plo), ARLIM_P(phi), ARLIM_P( lo), ARLIM_P( hi), const Real* dx); void FORT_RESIDUAL(Real* resid, Real* phi, Real* source, Real* sigma, Real* dgphi, ARLIM_P(lo), ARLIM_P(hi), const Real* dx, Real * rnorm, int * bc, int* ng); void FORT_RELAX(Real* phi, Real* source, Real* sigma, Real* dgphi, ARLIM_P(lo), ARLIM_P(hi), const Real* dx, int* bc, int* nngsrb, int* ng); void FORT_RESTRICT(Real* resid, Real* resid_crse, ARLIM_P(lo), ARLIM_P(hi), ARLIM_P(loc), ARLIM_P(hic), int* bc, int* ng); void FORT_COARSIG(Real* sigma, Real* sigmac, ARLIM_P(lo), ARLIM_P(hi), ARLIM_P(loc), ARLIM_P(hic), int* ng); void FORT_INTERP(Real* temp, Real* phi_crse, ARLIM_P(lo ), ARLIM_P(hi ), ARLIM_P(loc), ARLIM_P(hic), int* ng); void FORT_PROJUHG(Real* state, Real* pressure, Real* phi, Real* gradphi, Real* rho, ARLIM_P(lo), ARLIM_P(hi), int* ng); void FORT_SOLVEHG(Real* dest, Real* dest0, Real* source, Real* sigma, Real* sum, Real* r, Real* w, Real* z, Real* work, ARLIM_P(lo), ARLIM_P(hi), const Real* dx, int* bc, int* maxiter, Real* norm, Real* norm0, int* ng); #if (BL_SPACEDIM == 3) void FORT_MAKESUM(Real*, Real*, ARLIM_P(lo), ARLIM_P(hi), const Real* dx, int* bc, int* ng); void FORT_MKCOEFF(Real* coeff, Real* sigma, ARLIM_P(lo),ARLIM_P(hi), int* ng); #endif }; #endif ccseapps-2.5/CCSEApps/pVarden/velupd_2d.F0000644000175000017500000000631111634153073021252 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** VELUPD ** c ** Update the velocity components using convective differencing of fluxes c ** This field will then be projected to enforce the divergence constraint. c ************************************************************************* subroutine FORT_VELUPD(u,ustar,lapu,gradp,rhomid,uadv,vadv, $ uhalfx,uhalfy,force,dt,DIMS,dx) implicit none integer DIMS REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) REAL_T ustar(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T gradp(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T rhomid(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T uhalfx(lo_1 :hi_1+1,lo_2 :hi_2 ,2) REAL_T uhalfy(lo_1 :hi_1 ,lo_2 :hi_2+1,2) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T dt REAL_T dx(2) c Local variables integer i, j REAL_T ubar, vbar REAL_T ugradu, ugradv do j = lo_2,hi_2 do i = lo_1,hi_1 ubar = half*(uadv(i,j) + uadv(i+1,j)) vbar = half*(vadv(i,j) + vadv(i,j+1)) ugradu = ubar*(uhalfx(i+1,j,1) - uhalfx(i,j,1))/dx(1) + $ vbar*(uhalfy(i,j+1,1) - uhalfy(i,j,1))/dx(2) ugradv = ubar*(uhalfx(i+1,j,2) - uhalfx(i,j,2))/dx(1) + $ vbar*(uhalfy(i,j+1,2) - uhalfy(i,j,2))/dx(2) ustar(i,j,1) = u(i,j,1) + dt * ( half*lapu(i,j,1)/rhomid(i,j) $ - gradp(i,j,1)/rhomid(i,j) - ugradu + force(i,j,1) ) ustar(i,j,2) = u(i,j,2) + dt * ( half*lapu(i,j,2)/rhomid(i,j) $ - gradp(i,j,2)/rhomid(i,j) - ugradv + force(i,j,2) ) enddo enddo return end ccseapps-2.5/CCSEApps/pVarden/diffuser.cpp0000644000175000017500000005640011634153073021576 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #include #include #include int diffuser::numSmoothCoarsen = 2; int diffuser::numSmoothRefine = 2; int diffuser::ng = 4; // ************************************************************************ // ** constructor ** // ************************************************************************ diffuser::diffuser(const BoxArray& Grids, const Geometry& Geom, MultiFab* Area, MultiFab& Vol) : grids(Grids), geom(Geom), area(Area), vol(Vol) { ParmParse pp("diff"); pp.get("tol",tol); pp.query("numSmoothCoarsen",numSmoothCoarsen); pp.query("numSmoothRefine",numSmoothRefine); ng = 2*std::max(numSmoothCoarsen,numSmoothRefine); } // ************************************************************************ // ** destructor ** // ************************************************************************ diffuser::~diffuser() { } // ************************************************************************ // ** solveVel ** // ************************************************************************ void diffuser::solveVel(MultiFab * staten, MultiFab * rhonph, Real mu) { diffuser_mg *solver; const Real* dx = geom.CellSize(); MultiFab* source = new MultiFab(grids,1,ng-1); MultiFab* resid = new MultiFab(grids,1,ng-1); MultiFab* alpha = new MultiFab(grids,1,ng-1); MultiFab* phi = new MultiFab(grids,1,ng); // // Create the alpha array = rho * volume. // int nGrow = 1; MultiFab::Copy(*alpha,*rhonph,0,0,1,nGrow); for (MFIter mfi(*alpha); mfi.isValid(); ++mfi) { (*alpha)[mfi].mult(vol[mfi],0,0,1); } alpha->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*alpha,0,1,true); // // Construct the local area array (with additional ghost cells). // MultiFab* local_area[BL_SPACEDIM]; for (int dir = 0; dir < BL_SPACEDIM; dir++) { BoxArray edge_grids(grids); edge_grids.surroundingNodes(dir); local_area[dir] = new MultiFab(edge_grids,1,ng-1); MultiFab::Copy(*local_area[dir],area[dir],0,0,1,0); local_area[dir]->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*local_area[dir],0,1,true); } for (int n = 0; n < BL_SPACEDIM; n++) { // // Fill the external ghost cells of the phi array with time (n+1) data // at inflow faces before multiplying staten by volume. // MultiFab::Copy(*phi,*staten,n,0,1,1); Box zero_box(BoxLib::grow(grids.minimalBox(),1)); for (int idir = 0; idir < BL_SPACEDIM; idir++) { if (domain_bc[2*idir] == INLET) zero_box.growLo(idir,-1); if (domain_bc[2*idir+1] == INLET) zero_box.growHi(idir,-1); } phi->setVal(0.0,zero_box,0,1,1); phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); // // Multiply the RHS by rho and volume. // for (MFIter mfi(*staten); mfi.isValid(); ++mfi) { (*staten)[mfi].mult((*rhonph)[mfi],0,n,1); (*staten)[mfi].mult(vol[mfi],0,n,1); } staten->FillBoundary(n,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*staten,n,1,true); // // // Compute the norm of the RHS after volume-weighting. // Real rhsnorm = -1.e20; for (MFIter mfi(*staten); mfi.isValid(); ++mfi) { Real norm = (*staten)[mfi].norm(mfi.validbox(),0,n,1); rhsnorm = std::max(rhsnorm,norm); } ParallelDescriptor::ReduceRealMax(rhsnorm); // // Fill "source" by putting the problem into residual-correction form. // First copy staten into source to be sent into the residual routine. // MultiFab::Copy(*source,*staten,n,0,1,0); Real resnorm = rescorr(phi,source,source,local_area,alpha,n,mu); source->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*source,0,1,true); // // Reset the solution array. // phi->setVal(0.); if (ParallelDescriptor::IOProcessor()) { std::cout << "Volume-weighted RHS Norm is " << rhsnorm << std::endl; std::cout << "Volume-weighted Initial Residual is " << resnorm << std::endl; } if (resnorm > rhsnorm*tol) { solver = new diffuser_mg(grids,geom,phi,source,resid,local_area,alpha,dx,0,n,mu); solver->solve(tol*rhsnorm,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; MultiFab::Copy(*staten,*phi,0,n,1,0); } } delete source; delete resid; delete phi; delete alpha; for (int n = 0; n < BL_SPACEDIM; n++) delete local_area[n]; } // ************************************************************************ // ** solveScal ** // ************************************************************************ void diffuser::solveScal(MultiFab* staten, Real mu, int n) { diffuser_mg *solver; const Real* dx = geom.CellSize(); MultiFab* source = new MultiFab(grids,1,ng-1); MultiFab* resid = new MultiFab(grids,1,ng-1); MultiFab* alpha = new MultiFab(grids,1,ng-1); MultiFab* phi = new MultiFab(grids,1,ng); // // Create the alpha array = volume. // MultiFab::Copy(*alpha,vol,0,0,1,1); alpha->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*alpha,0,1,true); // // Multiply the RHS by volume before we solve. // for (MFIter mfi(*staten); mfi.isValid(); ++mfi) { (*staten)[mfi].mult(vol[mfi],vol[mfi].box(),0,n,1); } staten->FillBoundary(n,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*staten,n,1,true); MultiFab* local_area[BL_SPACEDIM]; for (int dir = 0; dir < BL_SPACEDIM; dir++) { BoxArray edge_grids(grids); edge_grids.surroundingNodes(dir); local_area[dir] = new MultiFab(edge_grids,1,ng-1); MultiFab::Copy(*local_area[dir],area[dir],0,0,1,0); local_area[dir]->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*local_area[dir],0,1,true); } // // Fill the external ghost cells of the phi array with time (n+1) data. // int nGrow = 1; MultiFab::Copy(*phi,*staten,n,0,1,nGrow); Box zero_box(BoxLib::grow(grids.minimalBox(),1)); for (int idir = 0; idir < BL_SPACEDIM; idir++) { if (domain_bc[2*idir] == INLET) zero_box.growLo(idir,-1); if (domain_bc[2*idir+1] == INLET) zero_box.growHi(idir,-1); } phi->setVal(0.0,zero_box,0,1,1); phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); // // Compute the norm of the RHS after volume-weighting. // Real rhsnorm = -1.e20; for (MFIter mfi(*staten); mfi.isValid(); ++mfi) { Real norm = (*staten)[mfi].norm(mfi.validbox(),0,n,1); rhsnorm = std::max(rhsnorm,norm); } ParallelDescriptor::ReduceRealMax(rhsnorm); // // Fill "source" by putting the problem into residual-correction form. // First copy staten into source to be sent into the residual routine. // MultiFab::Copy(*source,*staten,n,0,1,nGrow); Real resnorm = rescorr(phi,source,source,local_area,alpha,n,mu); source->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*source,0,1,true); // // Reset the solution array. // phi->setVal(0.); if (ParallelDescriptor::IOProcessor()) { std::cout << "Diffusive Volume-Weighted RHS Norm is " << rhsnorm << std::endl; std::cout << "Diffusive Volume-Weighted Initial Residual is " << resnorm << std::endl; } if (resnorm > rhsnorm*tol) { solver = new diffuser_mg(grids,geom,phi,source,resid,local_area,alpha,dx,0,n,mu); solver->solve(tol*rhsnorm,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; int nGrow = 0; MultiFab::Copy(*staten,*phi,0,n,1,nGrow); } delete source; delete resid; delete phi; delete alpha; for (int n = 0; n < BL_SPACEDIM; n++) delete local_area[n]; } // ************************************************************************ // ** Put into residual-correction form. ** // ************************************************************************ Real diffuser::rescorr(MultiFab* phi, MultiFab* source, MultiFab* resid, MultiFab* area[], MultiFab* alpha, int idir, Real mu) { int level = 0; int ng = phi->nGrow(); const Real* dx = geom.CellSize(); Real norm = -1.e20; Real rnorm = -1.e20; const int is_rz = CoordSys::IsRZ(); for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_RESID((*resid)[mfi].dataPtr(),(*phi)[mfi].dataPtr(), (*source)[mfi].dataPtr(), (*area[0])[mfi].dataPtr(),(*area[1])[mfi].dataPtr(), #if (BL_SPACEDIM == 3) (*area[2])[mfi].dataPtr(), #endif (*alpha)[mfi].dataPtr(),ARLIM(lo),ARLIM(hi),dx, #if (BL_SPACEDIM == 2) &is_rz, #endif &norm,bc[i].dataPtr(),&level,&idir,&mu,&ng); rnorm = std::max(rnorm,norm); } ParallelDescriptor::ReduceRealMax(rnorm); return rnorm; } // ************************************************************************ // ** constructor ** // ************************************************************************ diffuser_mg::diffuser_mg(const BoxArray & Grids, const Geometry& Geom, MultiFab * Phi, MultiFab * Source, MultiFab * Resid, MultiFab* Area[], MultiFab* Alpha, const Real* Dx, int Level, int Idir, Real Mu) : multigrid(Grids, Geom, Phi, Source, Resid) { alpha = Alpha; level = Level; idir = Idir; mu = Mu; for (int n = 0; n < BL_SPACEDIM; n++) area[n] = Area[n]; // Check whether we can coarsen all the grids separately int len = grids[0].length()[0]; for (int i = 0; i < grids.size(); i++) for (int n = 0; n < BL_SPACEDIM; n++) len = std::min(len,grids[i].length()[n]); bool is_odd = false; for (int i = 0; i < grids.size(); i++) for (int n = 0; n < BL_SPACEDIM; n++) if ( (grids[i].length()[n]&1) != 0 ) is_odd = true; Box prob_domain(grids.minimalBox()); // Check whether we can coarsen the domain as a whole int domain_len = prob_domain.length()[0]; for (int n = 1; n < BL_SPACEDIM; n++) domain_len = std::min(domain_len,prob_domain.length()[n]); bool domain_is_odd = false; for (int n = 0; n < BL_SPACEDIM; n++) if ( (prob_domain.length()[n]&1) != 0 ) domain_is_odd = true; if ( domain_len < 8 || domain_is_odd) { Next = NULL; } else { BoxArray newgrids; if (len < 8 || is_odd) { BoxList pd; pd.push_back(prob_domain); newgrids.define(pd); } else { newgrids.define(grids); } int ng = phi->nGrow(); newgrids.coarsen(2); MultiFab* newphi = new MultiFab(newgrids,1,ng); newphi->setVal(0.0); Real newdx[BL_SPACEDIM]; for (int n = 0; n < BL_SPACEDIM; n++) newdx[n] = 2.0*dx[n]; Geometry newgeom; newgeom.define(BoxLib::coarsen(geom.Domain(),2)); MultiFab* newsource = new MultiFab(newgrids,1,ng-1); MultiFab* newresid = new MultiFab(newgrids,1,ng-1); MultiFab* newalpha = new MultiFab(newgrids,1,ng-1); MultiFab* newarea[BL_SPACEDIM]; for (int n = 0; n < BL_SPACEDIM; n++) { BoxArray new_edge_grids(newgrids); new_edge_grids.surroundingNodes(n); newarea[n] = new MultiFab(new_edge_grids,1,ng-1); } if (grids.size() == newgrids.size()) { // // In this case, the BoxArray newgrids is a coarsened version of grids. // for (MFIter axmfi(*area[0]); axmfi.isValid(); ++axmfi) { int i = axmfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* newlo = newgrids[i].loVect(); const int* newhi = newgrids[i].hiVect(); #if (BL_SPACEDIM == 2) FORT_COARSIGMA((*area[0])[axmfi].dataPtr(),(*area[1])[axmfi].dataPtr(), (*newarea[0])[axmfi].dataPtr(),(*newarea[1])[axmfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&ng); #elif (BL_SPACEDIM == 3) FORT_COARSIGMA((*area[0])[axmfi].dataPtr(),(*area[1])[axmfi].dataPtr(),(*area[2])[axmfi].dataPtr(), (*newarea[0])[axmfi].dataPtr(),(*newarea[1])[axmfi].dataPtr(), (*newarea[2])[axmfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&ng); #endif } for (int n = 0; n < BL_SPACEDIM; n++) { newarea[n]->FillBoundary(0,1); if (newgeom.isAnyPeriodic()) newgeom.FillPeriodicBoundary(*newarea[n],0,1,true); } } else { // // In this case, we are going from more than one grid to one grid // (the size of the domain) in the BoxArray newgrids. // BL_ASSERT(newgrids.size() == 1); BoxList pd; pd.push_back(prob_domain); BoxArray grids_mf(pd); MultiFab* area_mf[BL_SPACEDIM]; for (int n = 0; n < BL_SPACEDIM; n++) { BoxArray edge_grids(grids_mf); edge_grids.surroundingNodes(n); area_mf[n] = new MultiFab(edge_grids,1,ng-1); area_mf[n]->copy(*area[n],0,0,1); } for (MFIter axmfi(*area_mf[0]); axmfi.isValid(); ++axmfi) { int i = axmfi.index(); const int* lo = grids_mf[i].loVect(); const int* hi = grids_mf[i].hiVect(); const int* newlo = newgrids[i].loVect(); const int* newhi = newgrids[i].hiVect(); #if (BL_SPACEDIM == 2) FORT_COARSIGMA((*area_mf[0])[axmfi].dataPtr(),(*area_mf[1])[axmfi].dataPtr(), (*newarea[0])[axmfi].dataPtr(), (*newarea[1])[axmfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&ng); #elif (BL_SPACEDIM == 3) FORT_COARSIGMA((*area_mf[0])[axmfi].dataPtr(),(*area_mf[1])[axmfi].dataPtr(),(*area_mf[2])[axmfi].dataPtr(), (*newarea[0])[axmfi].dataPtr(), (*newarea[1])[axmfi].dataPtr(), (*newarea[2])[axmfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&ng); #endif } for (int n = 0; n < BL_SPACEDIM; n++) { if (newgeom.isAnyPeriodic()) newgeom.FillPeriodicBoundary(*newarea[n],0,1,true); } } int nex = resid->nGrow(); if (newgrids.size() > 1) { for (MFIter alphamfi(*alpha); alphamfi.isValid(); ++alphamfi) { int i = alphamfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* newlo = newgrids[i].loVect(); const int* newhi = newgrids[i].hiVect(); FORT_RESTRICT((*alpha)[alphamfi].dataPtr(), (*newalpha)[alphamfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&nex); } } else { BoxList pd; Box prob_domain(grids.minimalBox()); pd.push_back(prob_domain); BoxArray grids_mf(pd); MultiFab alpha_mf(grids_mf,1,alpha->nGrow()); alpha_mf.copy(*alpha,0,0,1); for (MFIter alphamfi(alpha_mf); alphamfi.isValid(); ++alphamfi) { int i = alphamfi.index(); const int* lo = grids_mf[i].loVect(); const int* hi = grids_mf[i].hiVect(); const int* newlo = newgrids[i].loVect(); const int* newhi = newgrids[i].hiVect(); FORT_RESTRICT(alpha_mf[alphamfi].dataPtr(), (*newalpha)[alphamfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&nex); } } newalpha->FillBoundary(0,1); if (newgeom.isAnyPeriodic()) newgeom.FillPeriodicBoundary(*newalpha,0,1,true); Next = new diffuser_mg(newgrids, newgeom, newphi, newsource, newresid, newarea, newalpha, newdx, level-1,idir,mu); } next = Next; } // ************************************************************************ // ** destructor ** // ************************************************************************ diffuser_mg::~diffuser_mg() { if (Next != NULL) { delete Next->phi; delete Next->source; delete Next->resid; for (int n = 0; n < BL_SPACEDIM; n++) delete Next->area[n]; delete Next->alpha; delete Next; } } // ************************************************************************ // ** residual ** // ************************************************************************ Real diffuser_mg::residual() { Real norm = -1.e20; Real rnorm = -1.e20; const int is_rz = CoordSys::IsRZ(); int ng = phi->nGrow(); for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); int* bcptr = bc[i].dataPtr(); if (grids.size() == 1) bcptr = domain_bc; FORT_RESID((*resid)[mfi].dataPtr(), (*phi)[mfi].dataPtr(),(*source)[mfi].dataPtr(), (*area[0])[mfi].dataPtr(),(*area[1])[mfi].dataPtr(), #if (BL_SPACEDIM == 3) (*area[2])[mfi].dataPtr(), #endif (*alpha)[mfi].dataPtr(),ARLIM(lo),ARLIM(hi),dx, #if (BL_SPACEDIM == 2) &is_rz, #endif &norm,bcptr,&level,&idir,&mu,&ng); rnorm = std::max(rnorm,norm); } ParallelDescriptor::ReduceRealMax(rnorm); resid->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*resid,0,1,true); return rnorm; } // ************************************************************************ // ** step ** // ************************************************************************ void diffuser_mg::step(int nngsrb) { int ng = phi->nGrow(); const int is_rz = CoordSys::IsRZ(); for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); if (grids.size() > 1) { FORT_GSRBV((*phi)[mfi].dataPtr() ,(*source)[mfi].dataPtr(), (*area[0])[mfi].dataPtr(),(*area[1])[mfi].dataPtr(), #if (BL_SPACEDIM == 3) (*area[2])[mfi].dataPtr(), #endif (*alpha)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi), dx,bc[i].dataPtr(),&level,&idir,&nngsrb,&mu, #if (BL_SPACEDIM == 2) &is_rz, #endif &ng); } else { FORT_GSRBV((*phi)[mfi].dataPtr() ,(*source)[mfi].dataPtr(), (*area[0])[mfi].dataPtr(),(*area[1])[mfi].dataPtr(), #if (BL_SPACEDIM == 3) (*area[2])[mfi].dataPtr(), #endif (*alpha)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi), dx,domain_bc,&level,&idir,&nngsrb,&mu, #if (BL_SPACEDIM == 2) &is_rz, #endif &ng); } } phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); } // ************************************************************************ // ** Restrict ** // ************************************************************************ void diffuser_mg::Restrict() { int nex = resid->nGrow(); if (grids.size() == next->grids.size()) { for (MFIter mfi(*resid); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_RESTRICT((*resid)[mfi].dataPtr(), (*next->source)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic),&nex); } next->source->FillBoundary(0,1); } else { BoxList pd; Box prob_domain(grids.minimalBox()); pd.push_back(prob_domain); BoxArray grids_mf(pd); MultiFab res_mf(grids_mf,1,resid->nGrow()); res_mf.copy(*resid,0,0,1); for (MFIter mfi(res_mf); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids_mf[i].loVect(); const int* hi = grids_mf[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_RESTRICT(res_mf[mfi].dataPtr(), (*next->source)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic),&nex); } } if (next->geom.isAnyPeriodic()) next->geom.FillPeriodicBoundary(*next->source,0,1,true); } // ************************************************************************ // ** interpolate ** // ************************************************************************ void diffuser_mg::interpolate() { int ng = phi->nGrow(); if (next->grids.size() > 1) { for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_INTERPOLATE((*phi)[mfi].dataPtr(), (*next->phi)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic),&ng); } } else { BoxList pd; Box prob_domain(grids.minimalBox()); pd.push_back(prob_domain); BoxArray grids_mf(pd); MultiFab phi_interp(grids_mf,1,phi->nGrow()); phi_interp.copy(*phi,0,0,1); for (MFIter mfi(phi_interp); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids_mf[i].loVect(); const int* hi = grids_mf[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_INTERPOLATE(phi_interp[mfi].dataPtr(), (*next->phi)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic),&ng); } phi->copy(phi_interp,0,0,1); } phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); } ccseapps-2.5/CCSEApps/pVarden/setvelbc_3d.F0000644000175000017500000002711011634153073021563 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** SETVELBC ** c ** Impose the physical boundary conditions on the velocity (u,v) c ************************************************************************* subroutine setvelbc(vel,DIMS,bc,visc_coef,dx,time) implicit none integer DIMS REAL_T vel(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) integer bc(2,3) REAL_T visc_coef REAL_T dx(3) REAL_T time c Local variables integer is,ie,js,je,ks,ke,i,j,k integer ilo,ihi,jlo,jhi integer ng is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 ilo = cvmgt(lo_1-3,lo_1,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) ihi = cvmgt(hi_1+3,hi_1,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) jlo = cvmgt(lo_2-3,lo_2,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) jhi = cvmgt(hi_2+3,hi_2,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) c NOTE: IF BC == WALL, THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL c BOUNDARY, NOT IN THE GHOST CELL if (BCZ_LO .eq. WALL) then do ng = 1,3 do j = js-3,je+3 do i = is-3,ie+3 vel(i,j,ks-ng,3) = zero enddo enddo enddo do j = jlo,jhi do i = ilo,ihi vel(i,j,ks-1,1) = (fifteen*vel(i,j,ks ,1) - ten*vel(i,j,ks+1,1) + $ three*vel(i,j,ks+2,1)) / eight vel(i,j,ks-1,2) = (fifteen*vel(i,j,ks ,2) - ten*vel(i,j,ks+1,2) + $ three*vel(i,j,ks+2,2)) / eight vel(i,j,ks-2,1) = vel(i,j,ks-1,1) vel(i,j,ks-3,1) = vel(i,j,ks-1,1) vel(i,j,ks-2,2) = vel(i,j,ks-1,2) vel(i,j,ks-3,2) = vel(i,j,ks-1,2) enddo enddo if (visc_coef .gt. zero) then do ng = 1,3 do j = js-3,je+3 do i = is-3,ie+3 vel(i,j,ks-ng,1) = zero vel(i,j,ks-ng,2) = zero enddo enddo enddo endif elseif (BCZ_LO .eq. INLET) then call velinflow(vel(lo_1-3,lo_2-3,lo_3-3,3),DIMS,time,dx,2,0) do ng = 1,3 do j = js-3,je+3 do i = is-3,ie+3 vel(i,j,ks-ng,1) = zero vel(i,j,ks-ng,2) = zero enddo enddo enddo elseif (BCZ_LO .eq. OUTLET) then do ng = 1,3 do j = js-3,je+3 do i = is-3,ie+3 vel(i,j,ks-ng,1) = vel(i,j,ks,1) vel(i,j,ks-ng,2) = vel(i,j,ks,2) vel(i,j,ks-ng,3) = vel(i,j,ks,3) enddo enddo enddo endif if (BCZ_HI .eq. WALL) then do ng = 1,3 do j = js-3,je+3 do i = is-3,ie+3 vel(i,j,ke+ng,3) = zero enddo enddo enddo do j = jlo,jhi do i = ilo,ihi vel(i,j,ke+1,1) = (fifteen*vel(i,j,ke ,1) - ten*vel(i,j,ke-1,1) + $ three*vel(i,j,ke-2,1)) / eight vel(i,j,ke+1,2) = (fifteen*vel(i,j,ke ,2) - ten*vel(i,j,ke-1,2) + $ three*vel(i,j,ke-2,2)) / eight vel(i,j,ke+2,1) = vel(i,j,ke+1,1) vel(i,j,ke+3,1) = vel(i,j,ke+1,1) vel(i,j,ke+2,2) = vel(i,j,ke+1,2) vel(i,j,ke+3,2) = vel(i,j,ke+1,2) enddo enddo if (visc_coef .gt. zero) then do ng = 1,3 do j = js-3,je+3 do i = is-3,ie+3 vel(i,j,ke+ng,1) = zero vel(i,j,ke+ng,2) = zero enddo enddo enddo endif elseif (BCZ_HI .eq. INLET) then call velinflow(vel(lo_1-3,lo_2-3,lo_3-3,3),DIMS,time,dx,2,1) do ng = 1,3 do j = js-3,je+3 do i = is-3,ie+3 vel(i,j,ke+ng,1) = zero vel(i,j,ke+ng,2) = zero enddo enddo enddo elseif (BCZ_HI .eq. OUTLET) then do ng = 1,3 do j = js-3,je+3 do i = is-3,ie+3 vel(i,j,ke+ng,1) = vel(i,j,ke,1) vel(i,j,ke+ng,2) = vel(i,j,ke,2) vel(i,j,ke+ng,3) = vel(i,j,ke,3) enddo enddo enddo endif if (BCY_LO .eq. WALL) then do ng = 1,3 do k = ks-3,ke+3 do i = is-3,ie+3 vel(i,js-ng,k,2) = zero enddo enddo enddo do k = ks-3,ke+3 do i = ilo,ihi vel(i,js-1,k,1) = (fifteen*vel(i,js ,k,1) - ten*vel(i,js+1,k,1) + $ three*vel(i,js+2,k,1)) / eight vel(i,js-1,k,3) = (fifteen*vel(i,js ,k,3) - ten*vel(i,js+1,k,3) + $ three*vel(i,js+2,k,3)) / eight vel(i,js-2,k,1) = vel(i,js-1,k,1) vel(i,js-3,k,1) = vel(i,js-1,k,1) vel(i,js-2,k,3) = vel(i,js-1,k,3) vel(i,js-3,k,3) = vel(i,js-1,k,3) enddo enddo if (visc_coef .gt. zero) then do ng = 1,3 do k = ks-3,ke+3 do i = is-3,ie+3 vel(i,js-ng,k,1) = zero vel(i,js-ng,k,3) = zero enddo enddo enddo endif elseif (BCY_LO .eq. INLET) then call velinflow(vel(lo_1-3,lo_2-3,lo_3-3,2),DIMS,time,dx,1,0) do ng = 1,3 do k = ks-3,ke+3 do i = is-3,ie+3 vel(i,js-ng,k,1) = zero vel(i,js-ng,k,3) = zero enddo enddo enddo elseif (BCY_LO .eq. OUTLET) then do ng = 1,3 do k = ks-3,ke+3 do i = is-3,ie+3 vel(i,js-ng,k,1) = vel(i,js,k,1) vel(i,js-ng,k,2) = vel(i,js,k,2) vel(i,js-ng,k,3) = vel(i,js,k,3) enddo enddo enddo else endif if (BCY_HI .eq. WALL) then do ng = 1,3 do k = ks-3,ke+3 do i = is-3,ie+3 vel(i,je+ng,k,2) = zero enddo enddo enddo do k = ks-3,ke+3 do i = ilo,ihi vel(i,je+1,k,1) = (fifteen*vel(i,je ,k,1) - ten*vel(i,je-1,k,1) + $ three*vel(i,je-2,k,1)) / eight vel(i,je+1,k,3) = (fifteen*vel(i,je ,k,3) - ten*vel(i,je-1,k,3) + $ three*vel(i,je-2,k,3)) / eight vel(i,je+2,k,1) = vel(i,je+1,k,1) vel(i,je+3,k,1) = vel(i,je+1,k,1) vel(i,je+2,k,3) = vel(i,je+1,k,3) vel(i,je+3,k,3) = vel(i,je+1,k,3) enddo enddo if (visc_coef .gt. zero) then do ng = 1,3 do k = ks-3,ke+3 do i = is-3,ie+3 vel(i,je+ng,k,1) = zero vel(i,je+ng,k,3) = zero enddo enddo enddo endif elseif (BCY_HI .eq. INLET) then call velinflow(vel(lo_1-3,lo_2-3,lo_3-3,2),DIMS,time,dx,1,1) do ng = 1,3 do k = ks-3,ke+3 do i = is-3,ie+3 vel(i,je+ng,k,1) = zero vel(i,je+ng,k,3) = zero enddo enddo enddo elseif (BCY_HI .eq. OUTLET) then do ng = 1,3 do k = ks-3,ke+3 do i = is-3,ie+3 vel(i,je+ng,k,1) = vel(i,je,k,1) vel(i,je+ng,k,2) = vel(i,je,k,2) vel(i,je+ng,k,3) = vel(i,je,k,3) enddo enddo enddo endif if (BCX_LO .eq. WALL) then do ng = 1,3 do k = ks-3,ke+3 do j = js-3,je+3 vel(is-ng,j,k,1) = zero enddo enddo enddo do k = ks-3,ke+3 do j = js-3,je+3 vel(is-1,j,k,2) = (fifteen*vel(is ,j,k,2) - ten*vel(is+1,j,k,2) + $ three*vel(is+2,j,k,2)) / eight vel(is-1,j,k,3) = (fifteen*vel(is ,j,k,3) - ten*vel(is+1,j,k,3) + $ three*vel(is+2,j,k,3)) / eight vel(is-2,j,k,2) = vel(is-1,j,k,2) vel(is-3,j,k,2) = vel(is-1,j,k,2) vel(is-2,j,k,3) = vel(is-1,j,k,3) vel(is-3,j,k,3) = vel(is-1,j,k,3) enddo enddo if (visc_coef .gt. zero) then do ng = 1,3 do k = ks-3,ke+3 do j = js-3,je+3 vel(is-ng,j,k,2) = zero vel(is-ng,j,k,3) = zero enddo enddo enddo endif elseif (BCX_LO .eq. INLET) then call velinflow(vel(lo_1-3,lo_2-3,lo_3-3,1),DIMS,time,dx,0,0) do ng = 1,3 do k = ks-3,ke+3 do j = js-3,je+3 vel(is-ng,j,k,2) = zero vel(is-ng,j,k,3) = zero enddo enddo enddo elseif (BCX_LO .eq. OUTLET) then do ng = 1,3 do k = ks-3,ke+3 do j = js-3,je+3 vel(is-ng,j,k,1) = vel(is,j,k,1) vel(is-ng,j,k,2) = vel(is,j,k,2) vel(is-ng,j,k,3) = vel(is,j,k,3) enddo enddo enddo endif if (BCX_HI .eq. WALL) then do ng = 1,3 do k = ks-3,ke+3 do j = js-3,je+3 vel(ie+ng,j,k,1) = zero enddo enddo enddo do k = ks-3,ke+3 do j = js-3,je+3 vel(ie+1,j,k,2) = (fifteen*vel(ie ,j,k,2) - ten*vel(ie-1,j,k,2) + $ three*vel(ie-2,j,k,2)) / eight vel(ie+1,j,k,3) = (fifteen*vel(ie ,j,k,3) - ten*vel(ie-1,j,k,3) + $ three*vel(ie-2,j,k,3)) / eight vel(ie+2,j,k,2) = vel(ie+1,j,k,2) vel(ie+3,j,k,2) = vel(ie+1,j,k,2) vel(ie+2,j,k,3) = vel(ie+1,j,k,3) vel(ie+3,j,k,3) = vel(ie+1,j,k,3) enddo enddo if (visc_coef .gt. zero) then do ng = 1,3 do k = ks-3,ke+3 do j = js-3,je+3 vel(ie+ng,j,k,2) = zero vel(ie+ng,j,k,3) = zero enddo enddo enddo endif elseif (BCX_HI .eq. INLET) then call velinflow(vel(lo_1-3,lo_2-3,lo_3-3,1),DIMS,time,dx,0,1) do ng = 1,3 do k = ks-3,ke+3 do j = js-3,je+3 vel(ie+ng,j,k,2) = zero vel(ie+ng,j,k,3) = zero enddo enddo enddo elseif (BCX_HI .eq. OUTLET) then do ng = 1,3 do k = ks-3,ke+3 do j = js-3,je+3 vel(ie+ng,j,k,1) = vel(ie,j,k,1) vel(ie+ng,j,k,2) = vel(ie,j,k,2) vel(ie+ng,j,k,3) = vel(ie,j,k,3) enddo enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/mac_2d.F0000644000175000017500000005137611634153073020526 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "MACPROJ_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 #define CDIMS loc_1,loc_2,hic_1,hic_2 c ************************************************************************* c ** INITSIGMA ** c ** Define the 1/rho coefficients at the top level of the multigrid c ************************************************************************* subroutine FORT_INITSIGMA(sigmax,sigmay,rho,areax,areay,DIMS,bc,ng) implicit none integer DIMS integer ng REAL_T sigmax(lo_1-ng+1:hi_1+ng ,lo_2-ng+1:hi_2+ng-1) REAL_T sigmay(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng ) REAL_T rho(lo_1-3 :hi_1+3 ,lo_2-3 :hi_2+3) REAL_T areax(lo_1 :hi_1+1 ,lo_2 :hi_2 ) REAL_T areay(lo_1 :hi_1 ,lo_2 :hi_2+1) integer bc(2,2) c Local variables integer i,j do j = lo_2,hi_2 do i = lo_1,hi_1+1 sigmax(i,j) = two*areax(i,j)/(rho(i,j) + rho(i-1,j)) enddo if (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) then sigmax(lo_1,j) = areax(lo_1,j) / rho(lo_1-1,j) else if (BCX_LO .eq. OUTLET) then sigmax(lo_1,j) = areax(lo_1,j) / rho(lo_1,j) endif if (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) then sigmax(hi_1+1,j) = areax(hi_1+1,j) / rho(hi_1+1,j) else if (BCX_HI .eq. OUTLET) then sigmax(hi_1+1,j) = areax(hi_1+1,j) / rho(hi_1,j) endif enddo do i = lo_1,hi_1 do j = lo_2,hi_2+1 sigmay(i,j) = two * areay(i,j) / $ (rho(i,j) + rho(i,j-1)) enddo if (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) then sigmay(i,lo_2) = areay(i,lo_2) / rho(i,lo_2-1) else if (BCY_LO .eq. OUTLET) then sigmay(i,lo_2) = areay(i,lo_2) / rho(i,lo_2) endif if (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) then sigmay(i,hi_2+1) = areay(i,hi_2+1) / rho(i,hi_2+1) else if (BCY_HI .eq. OUTLET) then sigmay(i,hi_2+1) = areay(i,hi_2+1) / rho(i,hi_2) endif enddo return end c ************************************************************************* c ** PROJUMAC ** c ** Update the edge-based velocities c ************************************************************************* subroutine FORT_PROJUMAC(uadv,vadv,sigmax,sigmay,phi, $ areax,areay,dx,DIMS,bc,is_rz,ng) implicit none integer DIMS integer ng REAL_T uadv(lo_1 :hi_1+1,lo_2 :hi_2 ) REAL_T vadv(lo_1 :hi_1 ,lo_2 :hi_2+1) REAL_T sigmax(lo_1-ng+1:hi_1 +ng,lo_2-ng+1:hi_2-1+ng) REAL_T sigmay(lo_1-ng+1:hi_1-1+ng,lo_2-ng+1:hi_2 +ng) REAL_T phi(lo_1-ng:hi_1 +ng,lo_2-ng:hi_2 +ng) REAL_T areax(lo_1 :hi_1+1,lo_2 :hi_2 ) REAL_T areay(lo_1 :hi_1 ,lo_2 :hi_2+1) REAL_T dx(2) integer is_rz integer bc(2,2) c Local variables integer i,j integer istart call setbc(phi,DIMS,bc,ng) istart = cvmgt(lo_1+1,lo_1,is_rz .eq. 1 .and. lo_1 .eq. 0) do j = lo_2,hi_2 do i = istart,hi_1+1 uadv(i,j) = uadv(i,j) - sigmax(i,j) / areax(i,j) * $ (phi(i,j)-phi(i-1,j))/dx(1) enddo enddo do j = lo_2,hi_2+1 do i = lo_1,hi_1 vadv(i,j) = vadv(i,j) - sigmay(i,j) / areay(i,j) * $ (phi(i,j)-phi(i,j-1))/dx(2) enddo enddo return end c ************************************************************************* c ** RESIDUAL ** c ** Compute the residual R = f - D( sig G(phi) ) c ************************************************************************* subroutine FORT_RESIDUAL(resid,phi,f,sigmax,sigmay,DIMS,dx,resnorm,bc,ng) implicit none integer DIMS integer ng REAL_T resid(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1) REAL_T phi(lo_1-ng :hi_1+ng ,lo_2-ng :hi_2+ng ) REAL_T f(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1) REAL_T sigmax(lo_1-ng+1:hi_1 +ng,lo_2-ng+1:hi_2-1+ng) REAL_T sigmay(lo_1-ng+1:hi_1-1+ng,lo_2-ng+1:hi_2 +ng) REAL_T dx(2) REAL_T resnorm integer bc(2,2) c Local variables REAL_T hxinv, hyinv REAL_T rfac, corr integer i,j hxinv = one/dx(1) hyinv = one/dx(2) resnorm = zero call setbc(phi,DIMS,bc,ng) do j = lo_2,hi_2 do i = lo_1,hi_1 rfac = ((sigmax(i+1,j) + sigmax(i,j))*hxinv + $ (sigmay(i,j+1) + sigmay(i,j))*hyinv ) corr = $ ( sigmax(i+1,j)*phi(i+1,j) + sigmax(i,j)*phi(i-1,j))*hxinv + $ ( sigmay(i,j+1)*phi(i,j+1) + sigmay(i,j)*phi(i,j-1))*hyinv resid(i,j) = f(i,j) - (corr - rfac*phi(i,j)) resnorm = max(resnorm, abs(resid(i,j))) enddo enddo return end c ************************************************************************* c ** RELAX ** c ** Gauss-Seidel or line solve relaxation (depending on hy/hx) c ************************************************************************* subroutine FORT_RELAX(phi,f,sigmax,sigmay, $ DIMS,dx,bc,nnrelax,ng) implicit none integer DIMS integer ng REAL_T phi(lo_1-ng :hi_1+ng ,lo_2-ng :hi_2+ng ) REAL_T f(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1) REAL_T sigmax(lo_1-ng+1:hi_1 +ng,lo_2-ng+1:hi_2-1+ng) REAL_T sigmay(lo_1-ng+1:hi_1-1+ng,lo_2-ng+1:hi_2 +ng) REAL_T dx(2) integer bc(2,2) integer nnrelax c Local variables REAL_T rfac, corr integer i, j, iinc integer iter integer extra_xlo, extra_ylo integer extra_xhi, extra_yhi if (ng .lt. 2*nnrelax) then print *,'NOT ENOUGH GHOST CELLS FOR RELAX ' print *,'NG ',ng print *,'NNRELAX ',nnrelax stop endif call setbc(phi,DIMS,bc,ng) do iter = 1, 2*nnrelax extra_xlo = cvmgt(ng-iter,0,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) extra_xhi = cvmgt(ng-iter,0,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) extra_ylo = cvmgt(ng-iter,0,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) extra_yhi = cvmgt(ng-iter,0,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) do j = lo_2-extra_ylo,hi_2+extra_yhi iinc = mod(j+iter+1+extra_xlo+2*ng,2) do i = lo_1-extra_xlo+iinc,hi_1+extra_xhi,2 rfac = ( (sigmax(i+1,j) + sigmax(i,j))/dx(1) + $ (sigmay(i,j+1) + sigmay(i,j))/dx(2) ) corr = $ ( sigmax(i+1,j)*phi(i+1,j) + sigmax(i,j)*phi(i-1,j))/dx(1) + $ ( sigmay(i,j+1)*phi(i,j+1) + sigmay(i,j)*phi(i,j-1))/dx(2) rfac = one / rfac phi(i,j) = (corr - f(i,j)) * rfac enddo enddo call setbc(phi,DIMS,bc,ng) enddo return end c ************************************************************************* c ** BC ** c ** Impose boundary conditions c ************************************************************************* subroutine setbc(phi,DIMS,bc,ng) implicit none integer DIMS integer ng REAL_T phi(lo_1-ng:hi_1+ng,lo_2-ng:hi_2+ng) integer bc(2,2) c Local variables integer i, j, is, ie, js, je is = lo_1 ie = hi_1 js = lo_2 je = hi_2 if (BCY_LO .eq. OUTLET) then do i = is-ng,ie+ng phi(i,js-1) = -phi(i,js) enddo elseif (BCY_LO .eq. INLET .or. BCY_LO .eq. WALL) then do i = is-ng,ie+ng phi(i,js-1) = phi(i,js) enddo endif if (BCY_HI .eq. OUTLET) then do i = is-ng,ie+ng phi(i,je+1) = -phi(i,je) enddo elseif (BCY_HI .eq. INLET .or. BCY_HI .eq. WALL) then do i = is-ng,ie+ng phi(i,je+1) = phi(i,je) enddo endif if (BCX_LO .eq. OUTLET) then do j = js-ng,je+ng phi(is-1,j) = -phi(is,j) enddo elseif (BCX_LO .eq. INLET .or. BCX_LO .eq. WALL) then do j = js-ng,je+ng phi(is-1,j) = phi(is,j) enddo endif if (BCX_HI .eq. OUTLET) then do j = js-ng,je+ng phi(ie+1,j) = -phi(ie,j) enddo elseif (BCX_HI .eq. INLET .or. BCX_HI .eq. WALL) then do j = js-ng,je+ng phi(ie+1,j) = phi(ie,j) enddo endif return end c ************************************************************************* c ** RHSMAC ** c ** Compute the right-hand-side D(U) for the MAC projection c ************************************************************************* subroutine FORT_RHSMAC(uadv,vadv,divu_src,rhs, $ areax,areay,vol,DIMS,rhsnorm,ng) implicit none integer DIMS integer ng REAL_T uadv(lo_1 :hi_1+1 ,lo_2 :hi_2 ) REAL_T vadv(lo_1 :hi_1 ,lo_2 :hi_2+1 ) REAL_T divu_src(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T rhs(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1) REAL_T areax(lo_1 :hi_1+1 ,lo_2 :hi_2 ) REAL_T areay(lo_1 :hi_1 ,lo_2 :hi_2+1 ) REAL_T vol(lo_1-1 :hi_1+1 ,lo_2-1 :hi_2+1 ) REAL_T rhsnorm c Local variables integer i,j rhsnorm = zero do j = lo_2,hi_2 do i = lo_1,hi_1 rhs(i,j) = areax(i+1,j)*uadv(i+1,j) - areax(i,j)*uadv(i,j) + $ areay(i,j+1)*vadv(i,j+1) - areay(i,j)*vadv(i,j) rhs(i,j) = rhs(i,j) - vol(i,j)*divu_src(i,j) rhsnorm = max(rhsnorm,abs(rhs(i,j))) enddo enddo return end c ************************************************************************* c ** COARSIGMA ** c ** Coarsen the edge-based sigma coefficients c ************************************************************************* subroutine FORT_COARSIGMA(sigmax,sigmay,sigmaxc,sigmayc,DIMS,CDIMS,ng) implicit none integer DIMS integer CDIMS integer ng REAL_T sigmax(lo_1 -ng+1:hi_1 +ng,lo_2 -ng+1:hi_2 -1+ng) REAL_T sigmay(lo_1 -ng+1:hi_1 -1+ng,lo_2 -ng+1:hi_2 +ng) REAL_T sigmaxc(loc_1-ng+1:hic_1 +ng,loc_2-ng+1:hic_2-1+ng) REAL_T sigmayc(loc_1-ng+1:hic_1-1+ng,loc_2-ng+1:hic_2 +ng) c Local variables integer i,j do j = lo_2,hi_2,2 do i = lo_1,hi_1+1,2 sigmaxc(i/2,j/2) = (sigmax(i,j) + sigmax(i,j+1)) * fourth enddo enddo do j = lo_2,hi_2+1,2 do i = lo_1,hi_1,2 sigmayc(i/2,j/2) = (sigmay(i,j) + sigmay(i+1,j)) * fourth enddo enddo return end c ************************************************************************* c ** RESTRICT ** c ** Conservatively average the residual c ************************************************************************* subroutine FORT_RESTRICT(res,resc,DIMS,CDIMS,nextra) implicit none integer DIMS integer CDIMS integer nextra REAL_T res(lo_1 -nextra:hi_1 +nextra,lo_2 -nextra:hi_2 +nextra) REAL_T resc(loc_1-nextra:hic_1+nextra,loc_2-nextra:hic_2+nextra) c Local variables integer i,j do j = lo_2,hi_2,2 do i = lo_1,hi_1,2 resc(i/2,j/2) = (res(i ,j) + res(i ,j+1) + $ res(i+1,j) + res(i+1,j+1) ) * fourth enddo enddo return end c ************************************************************************* c ** INTERPOLATE ** c ** Piecewise constant interpolation c ************************************************************************* subroutine FORT_INTERPOLATE(phi,deltac,DIMS,CDIMS,ng) implicit none integer DIMS integer CDIMS integer ng REAL_T phi(lo_1 -ng:hi_1 +ng,lo_2 -ng:hi_2 +ng) REAL_T deltac(loc_1-ng:hic_1+ng,loc_2-ng:hic_2+ng) c Local variables integer i,j do j = lo_2,hi_2 do i = lo_1,hi_1 phi(i,j) = phi(i,j) + deltac(i/2,j/2) enddo enddo return end c ************************************************************************* c ** SOLVEMAC ** c ** Conjugate gradient bottom-solver c ************************************************************************* subroutine FORT_SOLVEMAC(dest, dest0, source, sigmax, sigmay, sum, $ r, w, z, work, DIMS, dx, bc, norm, prob_norm, ng) implicit none integer DIMS integer ng REAL_T dest(lo_1-ng:hi_1+ng,lo_2-ng:hi_2+ng) REAL_T dest0(lo_1-1 :hi_1+ 1,lo_2-1 :hi_2+1) REAL_T source(lo_1-ng+1:hi_1+ng-1,lo_2-ng+1:hi_2+ng-1) REAL_T sigmax(lo_1-ng+1:hi_1 +ng,lo_2-ng+1:hi_2-1+ng) REAL_T sigmay(lo_1-ng+1:hi_1-1+ng,lo_2-ng+1:hi_2 +ng) REAL_T sum(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T r(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T z(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T work(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T dx(2) integer bc(2,2) REAL_T norm REAL_T prob_norm c Local variables integer i,j,iter,is,ie,js,je REAL_T alpha, beta, rho, rhol REAL_T tol,tolfac REAL_T local_norm REAL_T sum_src logical is_singular tolfac = 1.0d-3 is = lo_1 js = lo_2 ie = hi_1 je = hi_2 call macperiodic(dest,DIMS,bc,ng) call setbc(dest,DIMS,bc,ng) do j = js-1,je+1 do i = is-1,ie+1 dest0(i,j) = dest(i,j) dest(i,j) = zero enddo enddo is_singular = (BCX_LO .ne. OUTLET .and. BCX_HI .ne. OUTLET .and. $ BCY_LO .ne. OUTLET .and. BCY_HI .ne. OUTLET) sum_src = zero if (is_singular) then do j = js, je do i = is, ie sum_src = sum_src + source(i,j) enddo enddo sum_src = sum_src / float((je-js+1)*(ie-is+1)) do j = js, je do i = is, ie source(i,j) = source(i,j) - sum_src enddo enddo endif 10 do j = js,je do i = is,ie w(i,j) = $ ( sigmax(i+1,j)*dest0(i+1,j) + $ sigmax(i ,j)*dest0(i-1,j) )/dx(1) $ +( sigmay(i,j+1)*dest0(i,j+1) + $ sigmay(i,j )*dest0(i,j-1) )/dx(2) $ -((sigmax(i+1,j) + sigmax(i,j))/dx(1) $ +(sigmay(i,j+1) + sigmay(i,j))/dx(2) ) * dest0(i,j) enddo enddo do j = js, je do i = is, ie r(i,j) = source(i,j) - w(i,j) enddo enddo rho = zero norm = zero local_norm = zero do j = js, je do i = is, ie z(i,j) = r(i,j) rho = rho + z(i,j) * r(i,j) local_norm = max(local_norm,abs(r(i,j))) norm = max(norm ,abs(r(i,j))) enddo enddo tol = Max(tolfac*local_norm,1.0d-15*prob_norm) if (norm .le. tol) then if (tolfac .gt. 1.0d-3) then do j = js-1,je+1 do i = is-1,ie+1 dest(i,j) = zero enddo enddo endif return endif do j = js, je do i = is, ie work(i,j) = zero dest(i,j) = z(i,j) enddo enddo iter = 0 c write(6,1000) iter, norm/prob_norm 100 call macperiodic(dest,DIMS,bc,ng) call setbc(dest,DIMS,bc,ng) do j = js,je do i = is,ie w(i,j) = $ ( sigmax(i+1,j)*dest(i+1,j) + $ sigmax(i ,j)*dest(i-1,j) )/dx(1) $ +( sigmay(i,j+1)*dest(i,j+1) + $ sigmay(i,j )*dest(i,j-1) )/dx(2) $ -((sigmax(i+1,j) + sigmax(i,j))/dx(1) + $ (sigmay(i,j+1) + sigmay(i,j))/dx(2) ) * dest(i,j) enddo enddo alpha = zero do j = js, je do i = is, ie alpha = alpha + dest(i,j)*w(i,j) enddo enddo alpha = rho / alpha rhol = rho rho = zero norm = zero do j = js, je do i = is, ie work(i,j) = work(i,j) + alpha * dest(i,j) r(i,j) = r(i,j) - alpha * w(i,j) z(i,j) = r(i,j) rho = rho + z(i,j) * r(i,j) norm = max(norm,abs(r(i,j))) enddo enddo iter = iter+1 c write(6,1000) iter, norm/prob_norm if (norm .le. tol) then do j = js, je do i = is, ie dest(i,j) = work(i,j) + dest0(i,j) enddo enddo call setbc(dest,DIMS,bc,ng) else if (iter .ge. 100 .or. norm .ge. 100.d0 * local_norm) then tolfac = 10.d0 * tolfac iter = 1 do j = js, je do i = is, ie dest(i,j) = work(i,j) + dest0(i,j) enddo enddo goto 10 else beta = rho / rhol do j = js, je do i = is, ie dest(i,j) = z(i,j) + beta * dest(i,j) enddo enddo goto 100 endif c call flush(6) 1000 format('Res/Res0 in solve: ',i4,2x,e12.5) c call flush(6) return end c ************************************************************************* c ** MKSUMMAC ** c ** Pre-compute the sum of coefficients for the conjugate gradient solver c ************************************************************************* subroutine FORT_MKSUMMAC(sum,sigmax,sigmay,DIMS,dx,ng) implicit none integer DIMS integer ng REAL_T sum(lo_1-1 :hi_1+1 ,lo_2-1 :hi_2+1 ) REAL_T sigmax(lo_1-ng+1:hi_1 +ng,lo_2-ng+1:hi_2-1+ng) REAL_T sigmay(lo_1-ng+1:hi_1-1+ng,lo_2-ng+1:hi_2 +ng) REAL_T dx(2) c Local variables integer i,j do j = lo_2,hi_2 do i = lo_1,hi_1 sum(i,j) = ( (sigmax(i+1,j) + sigmax(i,j))/dx(1) $ +(sigmay(i,j+1) + sigmay(i,j))/dx(2) ) sum(i,j) = -fourth*sum(i,j) enddo enddo return end c ************************************************************************* c ** TRIDIAG ** c ** Do a tridiagonal solve c ************************************************************************* subroutine tridiag(a,b,c,r,u,n) integer n integer nmax REAL_T a(n) REAL_T b(n) REAL_T c(n) REAL_T r(n) REAL_T u(n) parameter (nmax = 4098) integer j REAL_T bet REAL_T gam(nmax) if (b(1) .eq. 0) print *,'CANT HAVE B(1) = ZERO' bet = b(1) u(1) = r(1)/bet do j = 2,n gam(j) = c(j-1)/bet bet = b(j) - a(j)*gam(j) if (bet .eq. 0) then print *,'TRIDIAG FAILED ' stop endif u(j) = (r(j)-a(j)*u(j-1))/bet enddo do j = n-1,1,-1 u(j) = u(j) - gam(j+1)*u(j+1) enddo return end c ************************************************************************* c ** MACPERIODIC ** c Impose periodic boundary conditions on the single grid data in the c conjugate gradient bottom solver. c ************************************************************************* subroutine macperiodic(dest,DIMS,bc,ng) implicit none integer DIMS integer ng REAL_T dest(lo_1-ng:hi_1+ng,lo_2-ng:hi_2+ng) integer bc(2,2) integer i,j if (BCX_LO .eq. PERIODIC .and. BCX_HI .eq. PERIODIC) then do j = lo_2,hi_2 dest(lo_1-1,j) = dest(hi_1,j) dest(hi_1+1,j) = dest(lo_1,j) enddo endif if (BCY_LO .eq. PERIODIC .and. BCY_HI .eq. PERIODIC) then do i = lo_1,hi_1 dest(i,lo_2-1) = dest(i,hi_2) dest(i,hi_2+1) = dest(i,lo_2) enddo endif return end ccseapps-2.5/CCSEApps/pVarden/probin50000644000175000017500000000030411634153073020554 0ustar amckinstryamckinstry $fortin prob_type = 5 in_xvel = 0.0 in_yvel = 0.0 in_zvel = 0.0 in_density = 1.0 in_tracer = 0.0 xblob = 0.5 yblob = 0.5 zblob = 0.5 radblob = 0.2 denblob = 1. $end ccseapps-2.5/CCSEApps/pVarden/hg_2d.F0000644000175000017500000007726511634153073020371 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "HGPROJ_F.H" #include "BCTypes.H" #if BL_USE_FLOAT #define sixteenth .0625e0 #else #define sixteenth .0625d0 #endif #define DIMS lo_1,lo_2,hi_1,hi_2 #define CDIMS loc_1,loc_2,hic_1,hic_2 #define GDIMS g_lo_1,g_lo_2,g_hi_1,g_hi_2 #define PDIMS p_lo_1,p_lo_2,p_hi_1,p_hi_2 #define NINEPT c ************************************************************************* c ** GRADHG ** c ** Compute the cell-centered gradient of the nodal pressure field c ************************************************************************* subroutine FORT_GRADHG(gphi,GDIMS,phi,PDIMS,DIMS,dx) implicit none integer DIMS integer p_lo_1, p_lo_2 integer p_hi_1, p_hi_2 integer g_lo_1, g_lo_2 integer g_hi_1, g_hi_2 REAL_T gphi(g_lo_1:g_hi_1,g_lo_2:g_hi_2,2) REAL_T phi(p_lo_1:p_hi_1,p_lo_2:p_hi_2 ) REAL_T dx(2) c Local variables integer i, j do j = lo_2,hi_2 do i = lo_1,hi_1 gphi(i,j,1) = half*(phi(i+1,j) + phi(i+1,j+1) - $ phi(i ,j) - phi(i ,j+1) ) /dx(1) gphi(i,j,2) = half*(phi(i,j+1) + phi(i+1,j+1) - $ phi(i,j ) - phi(i+1,j ) ) /dx(2) enddo enddo return end c ************************************************************************* c ** RHSHG ** c ** Compute the right-hand-side D(V) for the projection c ************************************************************************* subroutine FORT_RHSHG(du,u,divu_src,vol,DIMS,dx,bc,norm,ng,is_singular, $ sum_src,sum_fac) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer ng REAL_T du(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) REAL_T divu_src(lo_1 :hi_1+1,lo_2 :hi_2+1) REAL_T vol(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T dx(2) REAL_T sum_src,sum_fac integer is_singular integer bc(2,2) c Local variables REAL_T fac,norm REAL_T factor REAL_T vavg REAL_T hx,hy integer i, j integer istart,iend integer jstart,jend hx = dx(1) hy = dx(2) norm = zero istart = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) if (BCX_LO .eq. WALL) then do j = lo_2-1,hi_2+1 u(lo_1-1,j,1) = zero u(lo_1-1,j,2) = zero enddo endif if (BCX_HI .eq. WALL) then do j = lo_2-1,hi_2+1 u(hi_1+1,j,1) = zero u(hi_1+1,j,2) = zero enddo endif if (BCY_LO .eq. WALL) then do i = lo_1-1,hi_1+1 u(i,lo_2-1,1) = zero u(i,lo_2-1,2) = zero enddo endif if (BCY_HI .eq. WALL) then do i = lo_1-1,hi_1+1 u(i,hi_2+1,1) = zero u(i,hi_2+1,2) = zero enddo endif do j = jstart,jend do i = istart,iend du(i,j) = ( vol(i ,j)*u(i ,j,1) + vol(i ,j-1)*u(i ,j-1,1) $ -vol(i-1,j)*u(i-1,j,1) - vol(i-1,j-1)*u(i-1,j-1,1)) / (two*hx) + $ ( vol(i ,j)*u(i ,j,2) - vol(i ,j-1)*u(i ,j-1,2) $ +vol(i-1,j)*u(i-1,j,2) - vol(i-1,j-1)*u(i-1,j-1,2)) / (two*hy) fac = one fac = cvmgt(two*fac,fac,i.eq.lo_1 .and. $ (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) ) fac = cvmgt(two*fac,fac,i.eq.hi_1+1 .and. $ (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) ) fac = cvmgt(two*fac,fac,j.eq.lo_2 .and. $ (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) ) fac = cvmgt(two*fac,fac,j.eq.hi_2+1 .and. $ (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) ) du(i,j) = fac * du(i,j) vavg = fourth * (vol(i,j) + vol(i-1,j) + vol(i,j-1) + vol(i-1,j-1)) du(i,j) = du(i,j) - vavg * divu_src(i,j) enddo enddo if (is_singular .eq. 1) then sum_src = zero sum_fac = zero do j = jstart, jend do i = istart, iend factor = one factor = cvmgt(half*factor,factor,i.eq.lo_1 .or. i.eq.hi_1+1) factor = cvmgt(half*factor,factor,j.eq.lo_2 .or. j.eq.hi_2+1) sum_src = sum_src + factor * du(i,j) sum_fac = sum_fac + factor enddo enddo endif do j = jstart,jend do i = istart,iend norm = max(norm, abs(du(i,j))) enddo enddo return end c ************************************************************************* c ** ADJUSTRHS ** c ** Adjust the RHS so it sums to zero if the problem has no outflow boundaries. c ************************************************************************* subroutine FORT_ADJUSTRHS(du,DIMS,bc,ng,sum_src) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer bc(2,2) integer ng REAL_T du(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T sum_src c Local variables integer i, j integer istart,iend,jstart,jend istart = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) do j = jstart,jend do i = istart,iend du(i,j) = du(i,j) - sum_src enddo enddo return end c ************************************************************************* c ** PROJUHG ** c ** Define the updated pressure and vector field c ************************************************************************* subroutine FORT_PROJUHG(u,pressure,phi,gradphi,rhonph,DIMS,ng) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer ng REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) REAL_T pressure(lo_1 :hi_1+1,lo_2 :hi_2+1) REAL_T phi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T gradphi(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T rhonph(lo_1-1:hi_1+1,lo_2-1:hi_2+1) c Local variables integer i, j do j = lo_2,hi_2 do i = lo_1,hi_1 u(i,j,1) = u(i,j,1) - gradphi(i,j,1)/rhonph(i,j) u(i,j,2) = u(i,j,2) - gradphi(i,j,2)/rhonph(i,j) enddo enddo do j = lo_2,hi_2+1 do i = lo_1,hi_1+1 c pressure(i,j) = pressure(i,j) + phi(i,j) pressure(i,j) = phi(i,j) enddo enddo return end c ************************************************************************* c ** RESIDUAL ** c ** Compute the residual R = f - D(sigma G(phi)) c ************************************************************************* subroutine FORT_RESIDUAL(resid,phi,source,sigma,dgphi, $ DIMS,dx,resnorm,bc,ng) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer ng REAL_T resid(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T phi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T source(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T sigma(lo_1-ng:hi_1 +ng,lo_2-ng:hi_2+ ng) REAL_T dgphi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T dx(2) REAL_T resnorm integer bc(2,2) c Local variables integer i,j integer istart,iend integer jstart,jend resnorm = zero istart = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) call makedgphi(phi,dgphi,sigma,DIMS,dx,bc,ng,istart,jstart,iend,jend) do j = jstart,jend do i = istart,iend resid(i,j) = source(i,j) - dgphi(i,j) enddo enddo do j = jstart,jend do i = istart,iend resnorm = max(resnorm,abs(resid(i,j))) enddo enddo return end #ifdef NINEPT c ************************************************************************* c ** RELAX ** c ** Gauss-Seidel relaxation c ************************************************************************* subroutine FORT_RELAX(phi,source,sigma,dgphi,DIMS,dx,bc,nnrelax,ng) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer ng REAL_T phi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T source(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T sigma(lo_1-ng:hi_1 +ng,lo_2-ng:hi_2 +ng) REAL_T dgphi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T dx(2) integer bc(2,2) integer nnrelax c Local variables REAL_T hxsqinv,hysqinv REAL_T rfac REAL_T mult integer i,j integer extra_xlo integer extra_xhi integer extra_ylo integer extra_yhi integer iter,iinc integer istart,iend integer jstart,jend hxsqinv = one/(dx(1)*dx(1)) hysqinv = one/(dx(2)*dx(2)) istart = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) if (nnrelax .gt. ng) then print *,'DONT HAVE ENOUGH BUFFER CELLS IN HG:RELAX ' print *,'NG = ',ng print *,'NRELAX = ',nnrelax stop endif c do iter = 1, 2*nnrelax do iter = 1, nnrelax extra_xlo = cvmgt(ng-iter,0,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) extra_xhi = cvmgt(ng-iter,0,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) extra_ylo = cvmgt(ng-iter,0,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) extra_yhi = cvmgt(ng-iter,0,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) call makedgphi(phi,dgphi,sigma,DIMS,dx,bc,ng, $ istart-extra_xlo,jstart-extra_ylo, $ iend +extra_xhi,jend +extra_yhi) do j = jstart-extra_ylo,jend+extra_yhi do i = istart-extra_xlo,iend+extra_xhi c do j = jstart-extra_ylo,jend+extra_yhi c iinc = mod(j+iter+1+extra_xlo+2*ng,2) c do i = istart-extra_xlo+iinc,iend+extra_xhi,2 #if 0 dgphi(i,j) = sixth * (hxsqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) - phi(i,j-1) + two * phi(i-1,j)) + $ sigma(i-1,j ) * (phi(i-1,j+1) - phi(i,j+1) + two * phi(i-1,j)) + $ sigma(i ,j-1) * (phi(i+1,j-1) - phi(i,j-1) + two * phi(i+1,j)) + $ sigma(i ,j ) * (phi(i+1,j+1) - phi(i,j+1) + two * phi(i+1,j)) - $ two*(sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) * phi(i,j)) + $ hysqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) - phi(i-1,j) + two * phi(i,j-1)) + $ sigma(i-1,j ) * (phi(i-1,j+1) - phi(i-1,j) + two * phi(i,j+1)) + $ sigma(i ,j-1) * (phi(i+1,j-1) - phi(i+1,j) + two * phi(i,j-1)) + $ sigma(i ,j ) * (phi(i+1,j+1) - phi(i+1,j) + two * phi(i,j+1)) - $ two*(sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) * phi(i,j))) #endif mult = one mult = cvmgt(two*mult,mult, $ i.eq.lo_1 .and. (BCX_LO.eq.WALL.or.BCX_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.lo_2 .and. (BCY_LO.eq.WALL.or.BCY_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ i.eq.hi_1+1 .and. (BCX_HI.eq.WALL.or.BCX_HI.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.hi_2+1 .and. (BCY_HI.eq.WALL.or.BCY_HI.eq.INLET)) c dgphi(i,j) = mult * dgphi(i,j) rfac = mult * (hxsqinv + hysqinv) * $ (sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) rfac = three/rfac phi(i,j) = phi(i,j) + rfac*(dgphi(i,j) - source(i,j)) enddo enddo enddo return end #endif #ifdef FIVEPT c ************************************************************************* c ** RELAX ** c ** Gauss-Seidel relaxation c ************************************************************************* subroutine FORT_RELAX(phi,source,sigma,dgphi,DIMS,dx,bc,nnrelax,ng) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer ng REAL_T phi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T source(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T sigma(lo_1-ng:hi_1 +ng,lo_2-ng:hi_2 +ng) REAL_T dgphi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T dx(2) integer bc(2,2) integer nnrelax c Local variables REAL_T hxsqinv,hysqinv REAL_T rfac, mult integer i,j integer extra_xlo integer extra_xhi integer extra_ylo integer extra_yhi integer iter integer istart,iend integer jstart,jend integer iinc hxsqinv = one/(dx(1)*dx(1)) hysqinv = one/(dx(2)*dx(2)) istart = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) do iter = 1, 2*nnrelax extra_xlo = cvmgt(ng-iter,0,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) extra_xhi = cvmgt(ng-iter,0,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) extra_ylo = cvmgt(ng-iter,0,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) extra_yhi = cvmgt(ng-iter,0,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) do j = jstart-extra_ylo,jend+extra_yhi iinc = mod(j+iter+1+extra_xlo+2*ng,2) do i = istart-extra_xlo+iinc,iend+extra_xhi,2 dgphi(i,j) = hysqinv * ( $ half*(sigma(i,j )+sigma(i-1,j )) * (phi(i,j+1)-phi(i,j)) + $ half*(sigma(i,j-1)+sigma(i-1,j-1)) * (phi(i,j-1)-phi(i,j)) ) + hxsqinv * ( $ half*(sigma(i,j )+sigma(i ,j-1)) * (phi(i+1,j)-phi(i,j)) + $ half*(sigma(i-1,j)+sigma(i-1,j-1)) * (phi(i-1,j)-phi(i,j)) ) mult = one mult = cvmgt(two*mult,mult, $ i.eq.lo_1 .and. (BCX_LO.eq.WALL.or.BCX_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.lo_2 .and. (BCY_LO.eq.WALL.or.BCY_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ i.eq.hi_1+1 .and. (BCX_HI.eq.WALL.or.BCX_HI.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.hi_2+1 .and. (BCY_HI.eq.WALL.or.BCY_HI.eq.INLET)) dgphi(i,j) = mult*dgphi(i,j) rfac = mult * half * ( $ hysqinv * ( $ (sigma(i,j )+sigma(i-1,j )) $ (sigma(i,j-1)+sigma(i-1,j-1)) ) + hxsqinv * ( $ (sigma(i,j )+sigma(i ,j-1)) $ (sigma(i-1,j)+sigma(i-1,j-1)) ) ) rfac = one/rfac phi(i,j) = phi(i,j) + rfac*(dgphi(i,j) - source(i,j)) enddo enddo enddo return end #endif c ************************************************************************* c ** COARSIG ** c ** Coarsening of the sig coefficients c ************************************************************************* subroutine FORT_COARSIG(sigma,sigmac,DIMS,CDIMS,ng) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer loc_1, loc_2 integer hic_1, hic_2 integer ng REAL_T sigma(lo_1 -ng:hi_1 +ng,lo_2 -ng:hi_2 +ng) REAL_T sigmac(loc_1-ng:hic_1+ng,loc_2-ng:hic_2+ng) c Local variables integer i ,j do j = lo_2,hi_2,2 do i = lo_1,hi_1,2 sigmac(i/2,j/2) = (sigma(i ,j) + sigma(i ,j+1)+ $ sigma(i+1,j) + sigma(i+1,j+1)) * fourth enddo enddo return end c ************************************************************************* c ** RESTRICT ** c ** Conservative restriction of the residual c ************************************************************************* subroutine FORT_RESTRICT(res,resc,DIMS,CDIMS,bc,ng) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer loc_1, loc_2 integer hic_1, hic_2 integer ng REAL_T res(lo_1 -ng:hi_1 +1+ng,lo_2 -ng:hi_2 +1+ng) REAL_T resc(loc_1-ng:hic_1+1+ng,loc_2-ng:hic_2+1+ng) integer bc(2,2) c Local variables integer i,j,ii,jj integer istart,iend integer jstart,jend istart = cvmgt((lo_1 )/2+1,(lo_1 )/2,BCX_LO .eq. OUTLET) iend = cvmgt((hi_1+1)/2-1,(hi_1+1)/2,BCX_HI .eq. OUTLET) jstart = cvmgt((lo_2 )/2+1,(lo_2 )/2,BCY_LO .eq. OUTLET) jend = cvmgt((hi_2+1)/2-1,(hi_2+1)/2,BCY_HI .eq. OUTLET) do j = jstart,jend do i = istart,iend ii = 2*i jj = 2*j resc(i,j) = fourth*res(ii ,jj) + $ eighth*(res(ii+1,jj ) + res(ii-1,jj ) + $ res(ii ,jj+1) + res(ii ,jj-1) ) + $ sixteenth*(res(ii+1,jj+1) + res(ii+1,jj-1) + $ res(ii-1,jj+1) + res(ii-1,jj-1) ) enddo enddo if ((BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) .and. lo_1 .eq. 2*loc_1) then i = loc_1 ii = 2*i do j = jstart,jend jj = 2*j resc(i,j) = fourth*(res(ii,jj ) + res(ii+1,jj )) + $ eighth*(res(ii,jj-1) + res(ii+1,jj-1)+ $ res(ii,jj+1) + res(ii+1,jj+1) ) enddo endif if ((BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) .and. lo_2 .eq. 2*loc_2) then j = loc_2 jj = 2*j do i = istart,iend ii = 2*i resc(i,j) = fourth*(res(ii ,jj) + res(ii ,jj+1)) + $ eighth*(res(ii+1,jj) + res(ii+1,jj+1)+ $ res(ii-1,jj) + res(ii-1,jj+1) ) enddo endif if ((BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) .and. hi_1 .eq. 2*hic_1+1) then i = hic_1+1 ii = 2*i do j = jstart,jend jj = 2*j resc(i,j) = fourth*(res(ii,jj ) + res(ii-1,jj )) + $ eighth*(res(ii,jj-1) + res(ii-1,jj-1)+ $ res(ii,jj+1) + res(ii-1,jj+1) ) enddo endif if ((BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) .and. hi_2 .eq. 2*hic_2+1) then j = hic_2+1 jj = 2*j do i = istart,iend ii = 2*i resc(i,j) = fourth*(res(ii ,jj) + res(ii ,jj-1)) + $ eighth*(res(ii+1,jj) + res(ii+1,jj-1)+ $ res(ii-1,jj) + res(ii-1,jj-1) ) enddo endif if ( (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) .and. $ (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) .and. $ (lo_1 .eq. 2*loc_1 .and. lo_2 .eq. 2*loc_2) ) then i = loc_1 j = loc_2 ii = 2*i jj = 2*j resc(i,j) = fourth*(res(ii,jj ) + res(ii+1,jj ) + $ res(ii,jj+1) + res(ii+1,jj+1) ) endif if ( (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) .and. $ (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) .and. $ (hi_1 .eq. 2*hic_1+1 .and. hi_2 .eq. 2*hic_2+1) ) then i = hic_1+1 j = hic_2+1 ii = 2*i jj = 2*j resc(i,j) = fourth*(res(ii,jj ) + res(ii-1,jj ) + $ res(ii,jj-1) + res(ii-1,jj-1) ) endif if ( (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) .and. $ (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) .and. $ (lo_1 .eq. 2*loc_1 .and. hi_2 .eq. 2*hic_2+1) ) then i = loc_1 j = hic_2+1 ii = 2*i jj = 2*j resc(i,j) = fourth*(res(ii,jj ) + res(ii+1,jj ) + $ res(ii,jj-1) + res(ii+1,jj-1) ) endif if ( (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) .and. $ (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) .and. $ (hi_1 .eq. 2*hic_1+1 .and. lo_2 .eq. 2*loc_2) ) then i = hic_1+1 j = loc_2 ii = 2*i jj = 2*j resc(i,j) = fourth*(res(ii,jj ) + res(ii-1,jj ) + $ res(ii,jj+1) + res(ii-1,jj+1) ) endif return end c ************************************************************************* c ** INTERP ** c ** Simple bilinear interpolation c ************************************************************************* subroutine FORT_INTERP(phi,deltac,DIMS,CDIMS,ng) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer loc_1, loc_2 integer hic_1, hic_2 integer ng REAL_T phi(lo_1 -ng:hi_1 +1+ng,lo_2 -ng:hi_2 +1+ng) REAL_T deltac(loc_1-ng:hic_1+1+ng,loc_2-ng:hic_2+1+ng) c Local variables integer i,j do j = lo_2,hi_2+1,2 do i = lo_1,hi_1+1,2 phi(i,j) = phi(i,j) + deltac(i/2,j/2) enddo enddo do j = lo_2+1,hi_2 ,2 do i = lo_1 ,hi_1+1,2 phi(i,j) = phi(i,j) + half*(deltac(i/2,j/2)+deltac(i/2,j/2+1)) enddo enddo do j = lo_2 ,hi_2+1,2 do i = lo_1+1,hi_1 ,2 phi(i,j) = phi(i,j) + half*(deltac(i/2,j/2)+deltac(i/2+1,j/2)) enddo enddo do j = lo_2+1,hi_2,2 do i = lo_1+1,hi_1,2 phi(i,j) = phi(i,j) + fourth*(deltac(i/2,j/2 )+deltac(i/2+1,j/2 ) $ +deltac(i/2,j/2+1)+deltac(i/2+1,j/2+1)) enddo enddo return end c ************************************************************************* c ** MAKEDGPHI ** c ** Compute D(sig G(phi)) c ************************************************************************* subroutine makedgphi(phi,dgphi,sigma,DIMS,dx,bc,ng,rlo_1,rlo_2,rhi_1,rhi_2) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer rlo_1,rlo_2 integer rhi_1, rhi_2 integer ng REAL_T phi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T dgphi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T sigma(lo_1-ng:hi_1 +ng,lo_2-ng:hi_2 +ng) REAL_T dx(2) integer bc(2,2) c Local variables REAL_T hxsqinv REAL_T hysqinv REAL_T mult integer istart,iend integer jstart,jend integer i,j integer ii,jj hxsqinv = one/(dx(1)*dx(1)) hysqinv = one/(dx(2)*dx(2)) istart = cvmgt(lo_1+1,rlo_1,BCX_LO .eq. OUTLET) jstart = cvmgt(lo_2+1,rlo_2,BCY_LO .eq. OUTLET) iend = cvmgt(hi_1 ,rhi_1,BCX_HI .eq. OUTLET) jend = cvmgt(hi_2 ,rhi_2,BCY_HI .eq. OUTLET) do j = jstart,jend do i = istart,iend #ifdef NINEPT dgphi(i,j) = sixth * (hxsqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) - phi(i,j-1) + two * phi(i-1,j)) + $ sigma(i-1,j ) * (phi(i-1,j+1) - phi(i,j+1) + two * phi(i-1,j)) + $ sigma(i ,j-1) * (phi(i+1,j-1) - phi(i,j-1) + two * phi(i+1,j)) + $ sigma(i ,j ) * (phi(i+1,j+1) - phi(i,j+1) + two * phi(i+1,j)) - $ two*(sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) * phi(i,j)) + $ hysqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) - phi(i-1,j) + two * phi(i,j-1)) + $ sigma(i-1,j ) * (phi(i-1,j+1) - phi(i-1,j) + two * phi(i,j+1)) + $ sigma(i ,j-1) * (phi(i+1,j-1) - phi(i+1,j) + two * phi(i,j-1)) + $ sigma(i ,j ) * (phi(i+1,j+1) - phi(i+1,j) + two * phi(i,j+1)) - $ two*(sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) * phi(i,j))) #endif #ifdef FIVEPT dgphi(i,j) = hysqinv * ( $ half*(sigma(i,j )+sigma(i-1,j )) * (phi(i,j+1)-phi(i,j)) + $ half*(sigma(i,j-1)+sigma(i-1,j-1)) * (phi(i,j-1)-phi(i,j)) ) + hxsqinv * ( $ half*(sigma(i,j )+sigma(i ,j-1)) * (phi(i+1,j)-phi(i,j)) + $ half*(sigma(i-1,j)+sigma(i-1,j-1)) * (phi(i-1,j)-phi(i,j)) ) #endif mult = one mult = cvmgt(two*mult,mult, $ i.eq.lo_1 .and. (BCX_LO.eq.WALL.or.BCX_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.lo_2 .and. (BCY_LO.eq.WALL.or.BCY_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ i.eq.hi_1+1 .and. (BCX_HI.eq.WALL.or.BCX_HI.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.hi_2+1 .and. (BCY_HI.eq.WALL.or.BCY_HI.eq.INLET)) dgphi(i,j) = mult*dgphi(i,j) enddo enddo return end c ************************************************************************* c ** SOLVEHG ** c ************************************************************************* subroutine FORT_SOLVEHG(dest,dest0,source,sigma,sum,r,w,z,work, $ DIMS,dx,bc,maxiter,norm,prob_norm,ng) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer ng REAL_T dest(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T dest0(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T source(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T sigma(lo_1-ng:hi_1 +ng,lo_2-ng:hi_2 +ng) REAL_T sum(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T r(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T w(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T z(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T work(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) REAL_T dx(2) integer bc(2,2) integer maxiter REAL_T norm REAL_T prob_norm c Local variables REAL_T factor REAL_T alpha REAL_T beta REAL_T rho REAL_T rhol REAL_T tol, tolfac logical testx logical testy integer i,j,iter integer istart,iend integer jstart,jend REAL_T local_norm tolfac = 1.0d-3 istart = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) call setperiodic(dest,DIMS,bc,ng) do j = lo_2-1,hi_2+2 do i = lo_1-1,hi_1+2 dest0(i,j) = dest(i,j) dest(i,j) = zero enddo enddo 10 call makedgphi(dest0,w,sigma,DIMS,dx,bc,ng,istart,jstart,iend,jend) rho = zero norm = zero do j = jstart, jend do i = istart, iend r(i,j) = source(i,j) - w(i,j) enddo enddo local_norm = zero do j = jstart, jend do i = istart, iend factor = one testx = (i .eq. lo_1 .or. i .eq. hi_1+1) testy = (j .eq. lo_2 .or. j .eq. hi_2+1) factor = cvmgt(factor*half,factor,testx) factor = cvmgt(factor*half,factor,testy) local_norm = max(local_norm, abs(r(i,j))) z(i,j) = r(i,j) rho = rho + z(i,j) * r(i,j) * factor norm = max(norm,abs(r(i,j))) enddo enddo tol = Max(tolfac*local_norm,1.0d-15*prob_norm) if (norm .le. tol) return do j = jstart, jend do i = istart, iend work(i,j) = zero dest(i,j) = z(i,j) enddo enddo iter = 0 c write(6,1000) iter, norm/prob_norm 100 call setperiodic(dest,DIMS,bc,ng) call makedgphi(dest,w,sigma,DIMS,dx,bc,ng,istart,jstart,iend,jend) alpha = zero do j = jstart, jend do i = istart, iend factor = one testx = (i .eq. lo_1 .or. i .eq. hi_1+1) testy = (j .eq. lo_2 .or. j .eq. hi_2+1) factor = cvmgt(factor*half,factor,testx) factor = cvmgt(factor*half,factor,testy) alpha = alpha + dest(i,j)*w(i,j) * factor enddo enddo alpha = rho / alpha rhol = rho rho = zero norm = zero do j = jstart, jend do i = istart, iend factor = one testx = (i .eq. lo_1 .or. i .eq. hi_1+1) testy = (j .eq. lo_2 .or. j .eq. hi_2+1) factor = cvmgt(factor*half,factor,testx) factor = cvmgt(factor*half,factor,testy) work(i,j) = work(i,j) + alpha * dest(i,j) r(i,j) = r(i,j) - alpha * w(i,j) z(i,j) = r(i,j) rho = rho + z(i,j) * r(i,j) * factor norm = max(norm,abs(r(i,j))) enddo enddo iter = iter+1 c write(6,1000) iter, norm/prob_norm if (norm .le. tol) then do j = jstart, jend do i = istart, iend dest(i,j) = work(i,j) + dest0(i,j) enddo enddo else if (iter .ge. maxiter .or. norm .ge. 100.d0*local_norm) then tolfac = 10.d0 * tolfac iter = 1 do j = jstart, jend do i = istart, iend dest(i,j) = zero enddo enddo goto 10 else beta = rho / rhol do j = jstart, jend do i = istart, iend dest(i,j) = z(i,j) + beta * dest(i,j) enddo enddo goto 100 endif 1000 format('Res/Res0 in solve : ',i4,2x,e12.5) c call flush(6) return end c ************************************************************************* c ** SETPERIODIC ** c Impose periodic boundary conditions on the single grid data in the c conjugate gradient bottom solver. c ************************************************************************* subroutine setperiodic(dest,DIMS,bc,ng) implicit none integer DIMS integer ng REAL_T dest(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng) integer bc(2,2) integer i,j if (BCX_LO .eq. PERIODIC .and. BCX_HI .eq. PERIODIC) then do j = lo_2,hi_2+1 dest(hi_1+2,j) = dest(lo_1+1,j) dest(lo_1-1,j) = dest(hi_1 ,j) enddo endif if (BCY_LO .eq. PERIODIC .and. BCY_HI .eq. PERIODIC) then do i = lo_1,hi_1+1 dest(i,hi_2+2) = dest(i,lo_2+1) dest(i,lo_2-1) = dest(i,hi_2 ) enddo endif if (BCX_LO .eq. PERIODIC .and. BCY_LO .eq. PERIODIC) then dest(lo_1-1,lo_2-1) = dest(hi_1 ,hi_2 ) dest(lo_1-1,hi_2+2) = dest(hi_1 ,lo_2+1) dest(hi_1+2,lo_2-1) = dest(lo_1+1,hi_2 ) dest(hi_1+2,hi_2+2) = dest(lo_1+1,lo_2+1) endif return end ccseapps-2.5/CCSEApps/pVarden/probin2_2d0000644000175000017500000000013611634153073021141 0ustar amckinstryamckinstry $fortin prob_type = 2 xblob = 0.5 yblob = 1.5 radblob = 0.2 denblob = 10. $end ccseapps-2.5/CCSEApps/pVarden/mkscalforce_2d.F0000644000175000017500000000405211634153073022244 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKFORCE ** c ** Define the forcing terms in the momentum equation c *************************************************************** subroutine FORT_MKSCALFORCE(force,s,time,dx,DIMS,numscal) implicit none integer DIMS integer numscal REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,numscal) REAL_T time REAL_T dx(2) c Local variables integer i,j,n do n = 1,numscal do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 force(i,j,n) = zero enddo enddo enddo return end ccseapps-2.5/CCSEApps/pVarden/slopez_3d.F0000644000175000017500000001666711634153073021307 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** SLOPEZ ** c ** Compute the slope of nvar components of s in the z-direction c ************************************************************************* subroutine FORT_SLOPEZ(s,slz,dzscr,DIMS,nvar,bc,slope_order) implicit none integer DIMS integer nvar integer bc(2,3) integer slope_order REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,nvar) REAL_T slz(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,nvar) REAL_T dzscr(lo_3-2:hi_3+2,4) integer cen,lim,flag,fromm parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ks,ie,je,ke,i,j,k,iv is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 c ::: HERE DOING 1ST ORDER if (slope_order .eq. 0) then do iv = 1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is-1,ie+1 slz(i,j,k,iv) = zero enddo enddo enddo enddo c ::: HERE DOING 2ND ORDER else if (slope_order .eq. 2) then do iv = 1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is-1,ie+1 del = half*(s(i,j,k+1,iv) - s(i,j,k-1,iv)) dpls = two *(s(i,j,k+1,iv) - s(i,j,k ,iv)) dmin = two *(s(i,j,k ,iv) - s(i,j,k-1,iv)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,k,iv)= sflag*min(slim,abs(del)) enddo enddo enddo if (BCZ_LO .eq. WALL .or. BCZ_LO .eq. INLET) then do j = js-1,je+1 do i = is-1,ie+1 slz(i,j,ks-1,iv) = zero del = (s(i,j,ks+1,iv)+three*s(i,j,ks,iv)- $ four*s(i,j,ks-1,iv)) * third dpls = two*(s(i,j,ks+1,iv) - s(i,j,ks ,iv)) dmin = two*(s(i,j,ks ,iv) - s(i,j,ks-1,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,ks,iv)= sflag*min(slim,abs(del)) enddo enddo elseif (BCZ_LO .eq. OUTLET) then do j = js-1,je+1 do i = is-1, ie+1 slz(i,j,ks-1,iv) = zero enddo enddo endif if (BCZ_HI .eq. WALL .or. BCZ_HI .eq. INLET) then do j = js-1,je+1 do i = is-1, ie+1 slz(i,j,ke+1,iv) = zero del = -(s(i,j,ke-1,iv)+three*s(i,j,ke,iv)- $ four*s(i,j,ke+1,iv)) * third dpls = two*(s(i,j,ke+1,iv) - s(i,j,ke ,iv)) dmin = two*(s(i,j,ke ,iv) - s(i,j,ke-1,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,ke,iv)= sflag*min(slim,abs(del)) enddo enddo elseif (BCZ_HI .eq. OUTLET) then do j = js-1,je+1 do i = is-1, ie+1 slz(i,j,ke+1,iv) = zero enddo enddo endif enddo else c ::: HERE DOING 4TH ORDER do iv=1,nvar do j = js-1,je+1 do i = is-1,ie+1 do k = ks-2,ke+2 dzscr(k,cen) = half*(s(i,j,k+1,iv)-s(i,j,k-1,iv)) dmin = two*(s(i,j,k ,iv)-s(i,j,k-1,iv)) dpls = two*(s(i,j,k+1,iv)-s(i,j,k ,iv)) dzscr(k,lim) = min(abs(dmin),abs(dpls)) dzscr(k,lim) = cvmgp(dzscr(k,lim),zero,dpls*dmin) dzscr(k,flag) = sign(one,dzscr(k,cen)) dzscr(k,fromm)= dzscr(k,flag)*min(dzscr(k,lim),abs(dzscr(k,cen))) enddo do k = ks-1,ke+1 ds = two * two3rd * dzscr(k,cen) - $ sixth * (dzscr(k+1,fromm) + dzscr(k-1,fromm)) slz(i,j,k,iv) = dzscr(k,flag)*min(abs(ds),dzscr(k,lim)) enddo if (BCZ_LO .eq. WALL .or. BCZ_LO .eq. INLET) then slz(i,j,ks-1,iv) = zero del = -sixteen/fifteen*s(i,j,ks-1,iv) + half*s(i,j,ks ,iv) + $ two3rd*s(i,j,ks+1,iv) - tenth*s(i,j,ks+2,iv) dmin = two*(s(i,j,ks ,iv)-s(i,j,ks-1,iv)) dpls = two*(s(i,j,ks+1,iv)-s(i,j,ks ,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,ks,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at ks+1 using the revised dzscr(ks,fromm) dzscr(ks,fromm) = slz(i,j,ks,iv) ds = two * two3rd * dzscr(ks+1,cen) - $ sixth * (dzscr(ks+2,fromm) + dzscr(ks,fromm)) slz(i,j,ks+1,iv) = dzscr(ks+1,flag)*min(abs(ds),dzscr(ks+1,lim)) elseif (BCZ_LO .eq. OUTLET) then slz(i,j,ks-1,iv) = zero endif if (BCZ_HI .eq. WALL .or. BCZ_HI .eq. INLET) then slz(i,j,ke+1,iv) = zero del = -( -sixteen/fifteen*s(i,j,ke+1,iv) + half*s(i,j,ke ,iv) $ + two3rd*s(i,j,ke-1,iv) - tenth*s(i,j,ke-2,iv) ) dmin = two*(s(i,j,ke ,iv)-s(i,j,ke-1,iv)) dpls = two*(s(i,j,ke+1,iv)-s(i,j,ke ,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,ke,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at ke-1 using the revised dzscr(ke,fromm) dzscr(ke,fromm) = slz(i,j,ke,iv) ds = two * two3rd * dzscr(ke-1,cen) - $ sixth * (dzscr(ke-2,fromm) + dzscr(ke,fromm)) slz(i,j,ke-1,iv) = dzscr(ke-1,flag)*min(abs(ds),dzscr(ke-1,lim)) elseif (BCZ_HI .eq. OUTLET) then slz(i,j,ke+1,iv) = zero endif enddo enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/inputs4.3d0000644000175000017500000002507211634153073021122 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 20 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 32 16 16 ############################################################################# # Maximum size of grid allowed. max_grid_size = 16 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin4 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 0 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 3 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 4 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ############################################################################# # Boundary conditions in the low z-direction. # If bcz_lo = 1, the domain is periodic in the z-direction. # If bcz_lo = 2, the domain has a solid (reflecting) walls in the low z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_lo = 3, the domain has inflow at low z. # If bcz_lo = 4, the domain has outflow at low z. bcz_lo = 1 ############################################################################# # Boundary conditions in the high z-direction. # If bcz_hi = 1, the domain is periodic in the z-direction. # If bcz_hi = 2, the domain has a solid (reflecting) wall in the high z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_hi = 3, the domain has inflow at high z. # If bcz_hi = 4, the domain has outflow at high z. bcz_hi = 1 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 2. 1. 1. ############################################################################# # Set to 1 if periodic in that direction geometry.is_periodic = 0 0 1 ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/laplac_2d.F0000644000175000017500000001075211634153073021213 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #if BL_USE_FLOAT #define twentyfive 25.e0 #else #define twentyfive 25.d0 #endif #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** LAPLAC ** c ** Compute the diffusive/viscous terms c ******************************************************************** subroutine laplac(u,lapu,areax,areay,vol,DIMS,dx, $ diff_coef,irz,bc,n) implicit none integer DIMS REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T areax(lo_1 :hi_1+1,lo_2 :hi_2 ) REAL_T areay(lo_1 :hi_1 ,lo_2 :hi_2+1) REAL_T vol(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T dx(2) REAL_T diff_coef integer bc(2,2) integer irz integer n c Local variables REAL_T ux_left, ux_left_wall REAL_T ux_rght, ux_rght_wall REAL_T uy_bot, uy_bot_wall REAL_T uy_top, uy_top_wall REAL_T r integer is, ie, js, je integer i,j is = lo_1 ie = hi_1 js = lo_2 je = hi_2 if (diff_coef .gt. zero) then do j = js, je do i = is, ie ux_left = (u(i,j) - u(i-1,j)) ux_left_wall = (-sixteen * u(is-1,j) + twenty * u(is,j) $ -five * u(is+1,j) + u(is+2,j) ) * fifth ux_left = cvmgt(ux_left_wall, ux_left, i .eq. is .and. $ (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) .and. $ (irz .eq. 0 .or. (irz .eq. 1 .and. n .eq. 0)) ) ux_left = areax(i,j) * ux_left / dx(1) ux_rght = (u(i+1,j) - u(i,j)) ux_rght_wall = -(-sixteen * u(ie+1,j) + twenty * u(ie,j) $ -five * u(ie-1,j) + u(ie-2,j) ) * fifth ux_rght = cvmgt(ux_rght_wall, ux_rght, i .eq. ie .and. $ (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) ) ux_rght = areax(i+1,j) * ux_rght / dx(1) uy_bot = (u(i,j) - u(i,j-1)) uy_bot_wall = (-sixteen * u(i,js-1) + twenty * u(i,js) $ -five * u(i,js+1) + u(i,js+2) ) * fifth uy_bot = cvmgt(uy_bot_wall, uy_bot, j .eq. js .and. $ (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) ) uy_bot = areay(i,j) * uy_bot / dx(2) uy_top = (u(i,j+1) - u(i,j)) uy_top_wall = -(-sixteen * u(i,je+1) + twenty * u(i,je) $ -five * u(i,je-1) + u(i,je-2) ) * fifth uy_top = cvmgt(uy_top_wall, uy_top, j .eq. je .and. $ (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) ) uy_top = areay(i,j+1) * uy_top / dx(2) lapu(i,j) = diff_coef * (ux_rght-ux_left+uy_top-uy_bot) / vol(i,j) enddo enddo if (n .eq. 0 .and. irz. eq. 1) then do j = js, je do i = is, ie r = (i+half)*dx(1) lapu(i,j) = lapu(i,j) - diff_coef*u(i,j)/(r*r) enddo enddo endif else do j = js, je do i = is, ie lapu(i,j) = zero enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/mkdivu_2d.F0000644000175000017500000000532411634153073021255 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKDIVUCC ** c ** Define the RHS of the cell-centered divergence constraint c *************************************************************** subroutine FORT_MKDIVUCC(divu_src,u,rho,time,dx,DIMS) implicit none integer DIMS REAL_T divu_src(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) REAL_T rho(lo_1-3:hi_1+3,lo_2-3:hi_2+3) REAL_T time REAL_T dx(2) c Local variables integer i,j do j = lo_2,hi_2 do i = lo_1,hi_1 divu_src(i,j) = zero enddo enddo return end c ************************************************************************* c ** MKDIVUNOD ** c ** Define the RHS of the node-centered divergence constraint c *************************************************************** subroutine FORT_MKDIVUNOD(divu_src,u,rho,time,dx,DIMS) implicit none integer DIMS REAL_T divu_src(lo_1 :hi_1+1,lo_2 :hi_2+1) REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) REAL_T rho(lo_1-3:hi_1+3,lo_2-3:hi_2+3) REAL_T time REAL_T dx(2) c Local variables integer i,j do j = lo_2,hi_2+1 do i = lo_1,hi_1+1 divu_src(i,j) = zero enddo enddo return end ccseapps-2.5/CCSEApps/pVarden/inputs1.3d0000644000175000017500000002514411634153073021117 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 80 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 16 16 16 ############################################################################# # Maximum size of grid allowed. max_grid_size = 64 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin1 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030 (assuming plot_file_root is "plt"). # These plot files can be viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 0 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ############################################################################# # Boundary conditions in the low z-direction. # If bcz_lo = 1, the domain is periodic in the z-direction. # If bcz_lo = 2, the domain has a solid (reflecting) walls in the low z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_lo = 3, the domain has inflow at low z. # If bcz_lo = 4, the domain has outflow at low z. bcz_lo = 1 ############################################################################# # Boundary conditions in the high z-direction. # If bcz_hi = 1, the domain is periodic in the z-direction. # If bcz_hi = 2, the domain has a solid (reflecting) wall in the high z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_hi = 3, the domain has inflow at high z. # If bcz_hi = 4, the domain has outflow at high z. bcz_hi = 1 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 1. 1. 1. ############################################################################# # Set to 1 if periodic in that direction geometry.is_periodic = 0 0 1 ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/prob_3d.F0000644000175000017500000007710011634153073020722 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #define SDIMS slo_1,slo_2,slo_3,shi_1,shi_2,shi_3 c ************************************************************************* c ** PROBINIT ** c ** Read in the problem-dependent parameters for the FORTRAN common blocks c ************************************************************************* subroutine FORT_PROBINIT (name,namlen) integer namlen integer name(namlen) integer untin, i #include "probdata.H" namelist /fortin/ prob_type, zero_dir, $ in_xvel, in_yvel, in_zvel, in_density, in_tracer, $ xblob, yblob, zblob, radblob, denblob, velfact c Build `probin' filename -- the name of file containing fortin namelist. c integer maxlen parameter (maxlen=256) character probin*(maxlen) do i = 1, namlen probin(i:i) = char(name(i)) end do untin = 9 if (namlen .eq. 0) then open(untin,file='probin',form='formatted',status='old') else open(untin,file=probin(1:namlen),form='formatted',status='old') end if read(untin,fortin) close(unit=untin) end c ************************************************************************* c ** INITDATA ** c ** Call the appropriate subroutine to initialize the data c ************************************************************************* subroutine FORT_INITDATA(state,DIMS,dx,time,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal+BL_SPACEDIM) REAL_T dx(3) REAL_T time if (prob_type .eq. 1) then call initspin(state,dx,DIMS,numscal) else if (prob_type .eq. 2) then call initbubble(state,dx,DIMS,numscal) else if (prob_type .eq. 3) then call initshear(state,dx,DIMS,numscal) else if (prob_type .eq. 4) then call initchannel(state,dx,DIMS,numscal) else if (prob_type .eq. 5) then call initpoiseuille(state,dx,DIMS,numscal) else if (prob_type .eq. 6) then c call initfile(state,dx,DIMS,numscal) call initplate(state,dx,DIMS,numscal) else print *,'DONT KNOW THIS PROBLEM TYPE: ',prob_type stop endif return end c ************************************************************************* c ** INITSPIN ** c ** Initialize the constant density flow-in-a-box problem c ************************************************************************* subroutine initspin(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal+BL_SPACEDIM) REAL_T dx(3) c Local variables REAL_T x, y, z REAL_T spx, spy, spz, cpx, cpy, cpz integer i, j, k, n do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) z = dx(3)*(float(k) + half) spx = sin(0.5d0*x) cpx = cos(0.5d0*x) spy = sin(0.5d0*y) cpy = cos(0.5d0*y) spz = sin(0.5d0*z) cpz = cos(0.5d0*z) if (zero_dir .eq. 3) then state(i,j,k,1) = velfact*two*spy*cpy*spx**2 state(i,j,k,2) = -velfact*two*spx*cpx*spy**2 state(i,j,k,3) = zero else if (zero_dir .eq. 2) then state(i,j,k,3) = velfact*two*spx*cpx*spz**2 state(i,j,k,1) = -velfact*two*spz*cpz*spx**2 state(i,j,k,2) = zero else if (zero_dir .eq. 1) then state(i,j,k,2) = velfact*two*spz*cpz*spy**2 state(i,j,k,3) = -velfact*two*spy*cpy*spz**2 state(i,j,k,1) = zero endif state(i,j,k,4) = one enddo enddo enddo do n = 2, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,k,3+n) = zero enddo enddo enddo enddo return end c ************************************************************************* c ** INITBUBBLE ** c ** Initialize the bubble-drop in a box problem c ************************************************************************* subroutine initbubble(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal+BL_SPACEDIM) REAL_T dx(3) c Local variables REAL_T x, y, z, r integer i, j, k, n do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,k,1) = zero state(i,j,k,2) = zero state(i,j,k,3) = zero x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) z = dx(3)*(float(k) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2 + (z-zblob)**2) state(i,j,k,4) = one+(denblob-one)*(half+half*tanh(100.d0*(radblob-r))) c state(i,j,k,4) = cvmgt(denblob,one,r .lt. radblob) enddo enddo enddo do n = 2, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,k,3+n) = zero enddo enddo enddo enddo return end c ************************************************************************* c ** INITSHEAR ** c ** Initialize a constant density doubly-periodic shear problem c ************************************************************************* subroutine initshear(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal+BL_SPACEDIM) REAL_T dx(3) c Local variables REAL_T x, y, z integer i, j, k, n do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) z = dx(3)*(float(k) + half) if (zero_dir .eq. 3) then state(i,j,k,1) = tanh(30.d0*(fourth - abs(y-half))) state(i,j,k,2) = 0.05d0 * sin(two*Pi*x) state(i,j,k,3) = zero else if (zero_dir .eq. 2) then state(i,j,k,3) = tanh(30.d0*(fourth - abs(x-half))) state(i,j,k,1) = 0.05d0 * sin(two*Pi*z) state(i,j,k,2) = zero else if (zero_dir .eq. 1) then state(i,j,k,2) = tanh(30.d0*(fourth - abs(z-half))) state(i,j,k,3) = 0.05d0 * sin(two*Pi*y) state(i,j,k,1) = zero endif state(i,j,k,4) = one enddo enddo enddo do n = 2, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,k,3+n) = zero enddo enddo enddo enddo return end c ************************************************************************* c ** INITCHANNEL ** c ** Initialize the channel inflow problem c ************************************************************************* subroutine initchannel(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal+BL_SPACEDIM) REAL_T dx(3) c Local variables REAL_T x, y, z, r integer i, j, k, n do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 c state(i,j,k,1) = in_xvel c state(i,j,k,2) = in_yvel c state(i,j,k,3) = in_zvel state(i,j,k,1) = zero state(i,j,k,2) = zero state(i,j,k,3) = zero enddo enddo enddo do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) z = dx(3)*(float(k) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2 + (z-zblob)**2) state(i,j,k,4) = cvmgt(denblob,in_density,r .lt. radblob) if (numscal .ge. 2) $ state(i,j,k,5) = cvmgt(one ,in_tracer ,r .lt. radblob) enddo enddo enddo do n = 3, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,k,3+n) = zero enddo enddo enddo enddo return end c ************************************************************************* c ** INITPOISEUILLE ** c ** Initialize the Poiseuille flow problem. c ************************************************************************* subroutine initpoiseuille(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal+BL_SPACEDIM) REAL_T dx(3) c Local variables REAL_T x, y, z, r integer i, j, k, n do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) z = dx(3)*(float(k) + half) state(i,j,k,1) = zero state(i,j,k,2) = zero state(i,j,k,3) = one - (x-one)*(x-one) c state(i,j,k,1) = one - (y-one)*(y-one) c state(i,j,k,2) = zero c state(i,j,k,3) = zero c state(i,j,k,1) = zero c state(i,j,k,2) = one - (z-one)*(z-one) c state(i,j,k,3) = zero enddo enddo enddo do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) z = dx(3)*(float(k) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2 + (z-zblob)**2) state(i,j,k,4) = cvmgt(denblob,in_density,r .lt. radblob) if (numscal .ge. 2) $ state(i,j,k,5) = cvmgt(one ,in_tracer ,r .lt. radblob) enddo enddo enddo do n = 3, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,k,3+n) = zero enddo enddo enddo enddo return end c ************************************************************************* c ** INITFILE ** c ** Initialize the constant density flow-in-a-box problem c ************************************************************************* subroutine initfile(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal+BL_SPACEDIM) REAL_T dx(3) c Local variables REAL_T x, y, z REAL_T spx, spy, spz, cpx, cpy, cpz integer i, j, k, n integer ifile,jfile,kfile,ibc,jbc,kbc,id,jd REAL_T scalex,scaley,scalez REAL_T scratch(131,131) open(2,file='InitTurb',form='unformatted') rewind 2 read(2)ifile,jfile,kfile read(2)scalex,scaley,scalez read(2)ibc,jbc,kbc write(*,*) " how did i get here" write(*,*)ifile,jfile,kfile write(*,*)scalex,scaley,scalez write(*,*)ibc,jbc,kbc write(*,*) lo_1,lo_2,lo_3 write(*,*) hi_1,hi_2,hi_3 do n = 1,3 read(2)((scratch(id,jd),id=1,ifile),jd=1,jfile) do k = lo_3,hi_3 read(2)((scratch(id,jd),id=1,ifile),jd=1,jfile) do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,k,n) = scratch(i+1,j+1) enddo enddo enddo read(2)((scratch(id,jd),id=1,ifile),jd=1,jfile) read(2)((scratch(id,jd),id=1,ifile),jd=1,jfile) enddo do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,k,4) = one enddo enddo enddo do n = 2, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,k,3+n) = zero enddo enddo enddo enddo close(2) return end subroutine initplate(state,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal+BL_SPACEDIM) REAL_T dx(3) c Local variables REAL_T x, y, z REAL_T spx, spy, spz, cpx, cpy, cpz REAL_T holesp,holerad,root3,xloc,yloc,xcen,ycen REAL_T scale,mean integer icell,jcell,npts integer i, j, k, n holesp = .0048d0 holerad = .0016d0 root3 = sqrt(3.d0) mean = Pi*holerad**2/(0.5d0*root3*holesp**2) scale = 3.0 / mean do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(dfloat(i) + 0.5d0) y = dx(2)*(dfloat(j) + 0.5d0) z = dx(3)*(dfloat(k) + 0.5d0) if(y.ge.0.d0)then jcell = int(y / (half*root3*holesp)) else jcell = -1-int(-y/(half*root3*holesp)) endif yloc = y-dfloat(jcell)*half*root3*holesp x = x-y/root3 if(x.ge.0.d0)then icell = int(x / (holesp)) else icell = -1-int(-x/(holesp)) endif xloc = x - holesp * dfloat(icell) + yloc/root3 xcen =.75d0*holesp ycen =(root3*.25d0)*holesp if(((xloc-xcen)**2 + (yloc-ycen)**2).le. holerad**2)then state(i,j,k,3) = scale*(1.d0 - mean) else state(i,j,k,3) = scale*(0.d0 - mean) endif c state(i,j,k,1) = .10d0*sin(2.d0*Pi*y/.05)* c & sin(2.d0*Pi*3.d0*z/.05) c state(i,j,k,2) = .10d0*sin(2.d0*Pi*2.d0*x/.05)* c & sin(2.d0*Pi*4.d0*z/.05) state(i,j,k,1) = .03d0*sin(2.d0*Pi*10*y/.05)* & sin(2.d0*Pi*7.d0*z/.05) & + .07d0*sin(2.d0*Pi*7*(y-.0012)/.05)* & sin(2.d0*Pi*9.d0*(z-.314)/.05) state(i,j,k,2) = .04d0*sin(2.d0*Pi*11.d0*x/.05)* & sin(2.d0*Pi*13.d0*z/.05) & + .06d0*sin(2.d0*Pi*8*(x-.1)/.05)* & sin(2.d0*Pi*13.d0*(z-.378)/.05) state(i,j,k,4) = one enddo enddo enddo do n = 2, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 state(i,j,k,3+n) = zero enddo enddo enddo enddo end c ************************************************************************* c ** DERVORT ** c ** Derive a cell-centered vorticity c ************************************************************************* subroutine FORT_DERVORT(state,derval,derlo_1,derlo_2,derlo_3, $ derhi_1,derhi_2,derhi_3,DIMS,dx) implicit none integer DIMS integer derlo_1,derlo_2,derlo_3 integer derhi_1,derhi_2,derhi_3 REAL_T state(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) REAL_T derval(derlo_1:derhi_1,derlo_2:derhi_2,derlo_3:derhi_3) REAL_T dx(3) c Local variables integer i, j, k REAL_T derx, dery, derz do k = lo_3, hi_3 do j = lo_2, hi_2 do i = lo_1, hi_1 derx = eighth*(state(i+1,j+1,k-1,3)+state(i-1,j+1,k-1,3) $ +state(i+1,j+1,k+1,3)+state(i-1,j+1,k+1,3) $ -state(i+1,j-1,k-1,3)-state(i-1,j-1,k-1,3) $ -state(i+1,j-1,k+1,3)-state(i-1,j-1,k+1,3)) / dx(2) - $ eighth*(state(i+1,j+1,k+1,2)+state(i-1,j+1,k+1,2) $ +state(i+1,j-1,k+1,2)+state(i-1,j-1,k+1,2) $ -state(i+1,j+1,k-1,2)-state(i-1,j+1,k-1,2) $ -state(i+1,j-1,k-1,2)-state(i-1,j-1,k-1,2)) / dx(3) dery = eighth*(state(i+1,j+1,k-1,3)+state(i+1,j-1,k-1,3) $ +state(i+1,j+1,k+1,3)+state(i+1,j-1,k+1,3) $ -state(i-1,j+1,k-1,3)-state(i-1,j-1,k-1,3) $ -state(i-1,j+1,k+1,3)-state(i-1,j-1,k+1,3)) / dx(1) - $ eighth*(state(i+1,j+1,k+1,1)+state(i-1,j+1,k+1,1) $ +state(i+1,j-1,k+1,1)+state(i-1,j-1,k+1,1) $ -state(i+1,j+1,k-1,1)-state(i-1,j+1,k-1,1) $ -state(i+1,j-1,k-1,1)-state(i-1,j-1,k-1,1)) / dx(3) derz = eighth*(state(i+1,j+1,k-1,2)+state(i+1,j-1,k-1,2) $ +state(i+1,j+1,k+1,2)+state(i+1,j-1,k+1,2) $ -state(i-1,j+1,k-1,2)-state(i-1,j-1,k-1,2) $ -state(i-1,j+1,k+1,2)-state(i-1,j-1,k+1,2)) / dx(1) - $ eighth*(state(i+1,j+1,k-1,1)+state(i-1,j+1,k-1,1) $ +state(i+1,j+1,k+1,1)+state(i-1,j+1,k+1,1) $ -state(i+1,j-1,k-1,1)-state(i-1,j-1,k-1,1) $ -state(i+1,j-1,k+1,1)-state(i-1,j-1,k+1,1)) / dx(2) derval(i,j,k) = sqrt(derx**2 + dery**2 + derz**2) enddo enddo enddo return end c ************************************************************************* c ** DERAVGP ** c ** Average nodal pressure onto cell centers for plotting purposes c ************************************************************************* subroutine FORT_DERAVGP(pressure,dat,DIMS) implicit none integer DIMS REAL_T pressure(lo_1:hi_1+1,lo_2:hi_2+1,lo_3:hi_3+1) REAL_T dat(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3) c Local variables integer i, j, k do k = lo_3, hi_3 do j = lo_2, hi_2 do i = lo_1, hi_1 dat(i,j,k) = (pressure(i,j ,k ) + pressure(i+1,j ,k ) + $ pressure(i,j+1,k ) + pressure(i+1,j+1,k ) + $ pressure(i,j ,k+1) + pressure(i+1,j ,k+1) + $ pressure(i,j+1,k+1) + pressure(i+1,j+1,k+1) ) * eighth enddo enddo enddo return end c ************************************************************************* c ** FORT_SET_CELL_VELBC ** c ** set velocity bc for computation of derived variables c ************************************************************************* subroutine FORT_SET_CELL_VELBC(u,DIMS,bc,irz,visc_coef,dx,time) implicit none #include "probdata.H" integer DIMS REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) integer bc(2,3) integer irz REAL_T visc_coef REAL_T dx(2) REAL_T time c Local variables integer i, j, k, is, ie, js, je, ks, ke REAL_T x is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 if (BCZ_LO .eq. OUTLET) then do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ks-1,3) = u(i,j,ks,3) u(i,j,ks-1,2) = u(i,j,ks,2) u(i,j,ks-1,1) = u(i,j,ks,1) enddo enddo elseif (BCZ_LO .eq. INLET) then if (prob_type .eq. 5) then do j = js-1,je+1 do i = is-1,ie+1 x = (float(i)+half)*dx(1) u(i,j,ks-1,3) = one - (x-one)*(x-one) u(i,j,ks-1,2) = -u(i,j,ks,2) u(i,j,ks-1,1) = -u(i,j,ks,1) enddo enddo else do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ks-1,3) = two* in_zvel - u(i,j,ks,3) u(i,j,ks-1,2) = -u(i,j,ks,2) u(i,j,ks-1,1) = -u(i,j,ks,1) enddo enddo endif elseif (BCZ_LO .eq. WALL) then do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ks-1,3) = -u(i,j,ks,3) u(i,j,ks-1,2) = three*u(i,j,ks,2) - three*u(i,j,ks+1,2)+u(i,j,ks+2,2) u(i,j,ks-1,1) = three*u(i,j,ks,1) - three*u(i,j,ks+1,1)+u(i,j,ks+2,1) enddo enddo if (visc_coef .gt. zero) then do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ks-1,1) = -u(i,j,ks,1) u(i,j,ks-1,2) = -u(i,j,ks,2) enddo enddo endif endif if (BCZ_HI .eq. OUTLET) then do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ke+1,3) = u(i,j,ke,3) u(i,j,ke+1,2) = u(i,j,ke,2) u(i,j,ke+1,1) = u(i,j,ke,1) enddo enddo elseif (BCZ_HI .eq. INLET) then do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ke+1,3) = two*in_zvel - u(i,j,ke,3) u(i,j,ke+1,2) = - u(i,j,ke,2) u(i,j,ke+1,1) = - u(i,j,ke,1) enddo enddo elseif (BCZ_HI .eq. WALL) then do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ke+1,3) = -u(i,j,ke,3) u(i,j,ke+1,2) = three*u(i,j,ke,2) - three*u(i,j,ke-1,2)+u(i,j,ke-2,2) u(i,j,ke+1,1) = three*u(i,j,ke,1) - three*u(i,j,ke-1,1)+u(i,j,ke-2,1) enddo enddo if (visc_coef .gt. zero) then do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ke+1,2) = -u(i,j,ke,2) u(i,j,ke+1,1) = -u(i,j,ke,1) enddo enddo endif endif if (BCY_LO .eq. OUTLET) then do k = ks-1,ke+1 do i = is-1,ie+1 u(i,js-1,k,3) = u(i,js,k,3) u(i,js-1,k,2) = u(i,js,k,2) u(i,js-1,k,1) = u(i,js,k,1) enddo enddo elseif (BCY_LO .eq. INLET) then do k = ks-1,ke+1 do i = is-1,ie+1 u(i,js-1,k,2) = two* in_yvel - u(i,js,k,2) u(i,js-1,k,3) = -u(i,js,k,3) u(i,js-1,k,1) = -u(i,js,k,1) enddo enddo elseif (BCY_LO .eq. WALL) then do k = ks-1,ke+1 do i = is-1,ie+1 u(i,js-1,k,2) = -u(i,js,k,2) u(i,js-1,k,1) = three*u(i,js,k,1) - three*u(i,js+1,k,1)+u(i,js+2,k,1) u(i,js-1,k,3) = three*u(i,js,k,3) - three*u(i,js+1,k,3)+u(i,js+2,k,3) enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do i = is-1,ie+1 u(i,js-1,k,1) = -u(i,js,k,1) u(i,js-1,k,3) = -u(i,js,k,3) enddo enddo endif endif if (BCY_HI .eq. OUTLET) then do k = ks-1,ke+1 do i = is-1,ie+1 u(i,je+1,k,3) = u(i,je,k,3) u(i,je+1,k,2) = u(i,je,k,2) u(i,je+1,k,1) = u(i,je,k,1) enddo enddo elseif (BCY_HI .eq. INLET) then do k = ks-1,ke+1 do i = is-1,ie+1 u(i,je+1,k,2) = two*in_yvel - u(i,je,k,2) u(i,je+1,k,3) = - u(i,je,k,3) u(i,je+1,k,1) = - u(i,je,k,1) enddo enddo elseif (BCY_HI .eq. WALL) then do k = ks-1,ke+1 do i = is-1,ie+1 u(i,je+1,k,2) = -u(i,je,k,2) u(i,je+1,k,3) = three*u(i,je,k,3) - three*u(i,je-1,k,3)+u(i,je-2,k,3) u(i,je+1,k,1) = three*u(i,je,k,1) - three*u(i,je-1,k,1)+u(i,je-2,k,1) enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do i = is-1,ie+1 u(i,je+1,k,3) = -u(i,je,k,3) u(i,je+1,k,1) = -u(i,je,k,1) enddo enddo endif endif if (BCX_LO .eq. OUTLET) then do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k,1) = u(is,j,k,1) u(is-1,j,k,2) = u(is,j,k,2) u(is-1,j,k,3) = u(is,j,k,3) enddo enddo elseif (BCX_LO .eq. INLET) then do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k,1) = two*in_xvel - u(is,j,k,1) u(is-1,j,k,2) = - u(is,j,k,2) u(is-1,j,k,3) = - u(is,j,k,3) enddo enddo elseif (BCX_LO .eq. WALL) then do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k,1) = -u(is,j,k,1) u(is-1,j,k,2) = three*u(is,j,k,2)-three*u(is+1,j,k,2)+u(is+2,j,k,2) u(is-1,j,k,3) = three*u(is,j,k,3)-three*u(is+1,j,k,3)+u(is+2,j,k,3) enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k,2) = -u(is,j,k,2) u(is-1,j,k,3) = -u(is,j,k,3) enddo enddo endif endif if (BCX_HI .eq. OUTLET) then do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k,1) = u(ie,j,k,1) u(ie+1,j,k,2) = u(ie,j,k,2) u(ie+1,j,k,3) = u(ie,j,k,3) enddo enddo elseif (BCX_HI .eq. INLET) then do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k,1) = two *in_xvel - u(ie,j,k,1) u(ie+1,j,k,2) = - u(ie,j,k,2) u(ie+1,j,k,3) = - u(ie,j,k,3) enddo enddo elseif (BCX_HI .eq. WALL) then do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k,1) = - u(ie,j,k,1) u(ie+1,j,k,2) = three*u(ie,j,k,2)-three*u(ie-1,j,k,2)+u(ie-2,j,k,2) u(ie+1,j,k,3) = three*u(ie,j,k,3)-three*u(ie-1,j,k,3)+u(ie-2,j,k,3) enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k,2) = - u(ie,j,k,2) u(ie+1,j,k,3) = - u(ie,j,k,3) enddo enddo endif endif return end c ************************************************************************* c ** VELINFLOW ** c ** Impose the inflow boundary conditions on velocity c ************************************************************************* subroutine velinflow(u,DIMS,time,dx,idir,is_hi) implicit none #include "probdata.H" integer DIMS REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3) REAL_T time REAL_T dx(3) integer idir,is_hi c Local variables integer i,j,k REAL_T x,y,z if (idir .eq. 0) then if (is_hi .eq. 0) then if (prob_type .eq. 5) then do k = lo_3-3,hi_3+3 do j = lo_2-3,hi_2+3 y = (float(j)+half)*dx(2) u(lo_1-1,j,k) = one - (y-one)*(y-one) u(lo_1-2,j,k) = one - (y-one)*(y-one) u(lo_1-3,j,k) = one - (y-one)*(y-one) enddo enddo else do k = lo_3-3,hi_3+3 do j = lo_2-3,hi_2+3 u(lo_1-1,j,k) = in_xvel u(lo_1-2,j,k) = in_xvel u(lo_1-3,j,k) = in_xvel enddo enddo endif else do k = lo_3-3,hi_3+3 do j = lo_2-3,hi_2+3 u(hi_1+1,j,k) = in_xvel u(hi_1+2,j,k) = in_xvel u(hi_1+3,j,k) = in_xvel enddo enddo endif elseif (idir .eq. 1) then if (is_hi .eq. 0) then if (prob_type .eq. 5) then do k = lo_3-3,hi_3+3 do i = lo_1-3,hi_1+3 z = (float(k)+half)*dx(3) u(i,lo_2-1,k) = one - (z-one)*(z-one) u(i,lo_2-2,k) = one - (z-one)*(z-one) u(i,lo_2-3,k) = one - (z-one)*(z-one) enddo enddo else do k = lo_3-3,hi_3+3 do i = lo_1-3,hi_1+3 u(i,lo_2-1,k) = in_yvel u(i,lo_2-2,k) = in_yvel u(i,lo_2-3,k) = in_yvel enddo enddo endif else do k = lo_3-3,hi_3+3 do i = lo_1-3,hi_1+3 u(i,hi_2+1,k) = in_yvel u(i,hi_2+2,k) = in_yvel u(i,hi_2+3,k) = in_yvel enddo enddo endif elseif (idir .eq. 2) then if (is_hi .eq. 0) then if (prob_type .eq. 5) then do j = lo_2-3,hi_2+3 do i = lo_1-3,hi_1+3 x = (float(i)+half)*dx(1) u(i,j,lo_3-1) = one - (x-one)*(x-one) u(i,j,lo_3-2) = one - (x-one)*(x-one) u(i,j,lo_3-3) = one - (x-one)*(x-one) enddo enddo else do j = lo_2-3,hi_2+3 do i = lo_1-3,hi_1+3 u(i,j,lo_3-1) = in_zvel u(i,j,lo_3-2) = in_zvel u(i,j,lo_3-3) = in_zvel enddo enddo endif else do j = lo_2-3,hi_2+3 do i = lo_1-3,hi_1+3 u(i,j,hi_3+1) = in_zvel u(i,j,hi_3+2) = in_zvel u(i,j,hi_3+3) = in_zvel enddo enddo endif else print *,'bogus idir in velinflow ',idir stop endif return end c ************************************************************************* c ** SCALINFLOW ** c ** Impose the inflow boundary conditions on scalars c ************************************************************************* subroutine scalinflow(s,DIMS,SDIMS,time,dx,idir,is_hi,which_scal) implicit none #include "probdata.H" integer DIMS integer SDIMS REAL_T s(slo_1:shi_1,slo_2:shi_2,slo_3:shi_3) REAL_T time REAL_T dx(3) integer idir, is_hi integer which_scal c Local variables integer i,j,k integer ng,ngmax REAL_T inflow_val ngmax = lo_1-slo_1 if (which_scal .eq. 0) then inflow_val = in_density elseif (which_scal .eq. 1) then inflow_val = in_tracer else print *,"STOP IN SCALINFLOW " print *," -- DONT HAVE VALUE FOR THIS VARIABLE " stop endif if (idir .eq. 0) then if (is_hi .eq. 0) then do ng = 1,ngmax do k = slo_3,shi_3 do j = slo_2,shi_2 s(lo_1-ng,j,k) = inflow_val enddo enddo enddo else do ng = 1,ngmax do k = slo_3,shi_3 do j = slo_2,shi_2 s(hi_1+ng,j,k) = inflow_val enddo enddo enddo endif elseif (idir .eq. 1) then if (is_hi .eq. 0) then do ng = 1,ngmax do k = slo_3,shi_3 do i = slo_1,shi_1 s(i,lo_2-ng,k) = inflow_val enddo enddo enddo else do ng = 1,ngmax do k = slo_3,shi_3 do i = slo_1,shi_1 s(i,hi_2+ng,k) = inflow_val enddo enddo enddo endif elseif (idir .eq. 2) then if (is_hi .eq. 0) then do ng = 1,ngmax do j = slo_2,shi_2 do i = slo_1,shi_1 s(i,j,lo_3-ng) = inflow_val enddo enddo enddo else do ng = 1,ngmax do j = slo_2,shi_2 do i = slo_1,shi_1 s(i,j,hi_3+ng) = inflow_val enddo enddo enddo endif else print *,'bogus idir in scalinflow ',idir stop endif return end ccseapps-2.5/CCSEApps/pVarden/GRID_F.H0000644000175000017500000003063311634153073020366 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_INITDATA initdata # define FORT_PROBINIT probinit # define FORT_SET_CELL_VELBC setcellvelbc # define FORT_DERVORT dervort # define FORT_DERAVGP deravgp # define FORT_DERIVE derive # define FORT_CMPDT cmpdt # define FORT_SLOPEX fslopex # define FORT_SLOPEY fslopey # define FORT_SLOPEZ fslopez # define FORT_LAPLAC laplac # define FORT_MKFORCE mkforce # define FORT_KINE kine # define FORT_WRITEVEL writevel # define FORT_MKSCALFORCE mkscalforce # define FORT_MKDIVUCC mkdivucc # define FORT_MKDIVUNOD mkdivunod # define FORT_MKUTRANS mkutrans # define FORT_MKFLUX mkflux # define FORT_SCALUPD scalupd # define FORT_VELUPD velupd # define FORT_SETVELBC setvelbc # define FORT_SETSCALBC setscalbc #else #if defined(BL_FORT_USE_UNDERSCORE) # define FORT_INITDATA initdata_ # define FORT_PROBINIT probinit_ # define FORT_SET_CELL_VELBC setcellvelbc_ # define FORT_DERVORT dervort_ # define FORT_DERAVGP deravgp_ # define FORT_DERIVE derive_ # define FORT_CMPDT cmpdt_ # define FORT_SLOPEX fslopex_ # define FORT_SLOPEY fslopey_ # define FORT_SLOPEZ fslopez_ # define FORT_LAPLAC laplac_ # define FORT_MKFORCE mkforce_ # define FORT_KINE kine_ # define FORT_WRITEVEL writevel_ # define FORT_MKSCALFORCE mkscalforce_ # define FORT_MKDIVUCC mkdivucc_ # define FORT_MKDIVUNOD mkdivunod_ # define FORT_MKUTRANS mkutrans_ # define FORT_MKFLUX mkflux_ # define FORT_SCALUPD scalupd_ # define FORT_VELUPD velupd_ # define FORT_SETVELBC setvelbc_ # define FORT_SETSCALBC setscalbc_ #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_INITDATA INITDATA # define FORT_PROBINIT PROBINIT # define FORT_SET_CELL_VELBC SETCELLVELBC # define FORT_DERVORT DERVORT # define FORT_DERAVGP DERAVGP # define FORT_DERIVE DERIVE # define FORT_CMPDT CMPDT # define FORT_SLOPEX FSLOPEX # define FORT_SLOPEY FSLOPEY # define FORT_SLOPEZ FSLOPEZ # define FORT_LAPLAC LAPLAC # define FORT_MKFORCE MKFORCE # define FORT_KINE KINE # define FORT_WRITEVEL WRITEVEL # define FORT_MKSCALFORCE MKSCALFORCE # define FORT_MKDIVUCC MKDIVUCC # define FORT_MKDIVUNOD MKDIVUNOD # define FORT_MKUTRANS MKUTRANS # define FORT_MKFLUX MKFLUX # define FORT_SCALUPD SCALUPD # define FORT_VELUPD VELUPD # define FORT_SETVELBC SETVELBC # define FORT_SETSCALBC SETSCALBC #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_INITDATA initdata # define FORT_PROBINIT probinit # define FORT_SET_CELL_VELBC setcellvelbc # define FORT_DERVORT dervort # define FORT_DERAVGP deravgp # define FORT_DERIVE derive # define FORT_CMPDT cmpdt # define FORT_SLOPEX fslopex # define FORT_SLOPEY fslopey # define FORT_SLOPEZ fslopez # define FORT_LAPLAC laplac # define FORT_MKFORCE mkforce # define FORT_KINE kine # define FORT_WRITEVEL writevel # define FORT_MKSCALFORCE mkscalforce # define FORT_MKDIVUCC mkdivucc # define FORT_MKDIVUNOD mkdivunod # define FORT_MKUTRANS mkutrans # define FORT_MKFLUX mkflux # define FORT_SCALUPD scalupd # define FORT_VELUPD velupd # define FORT_SETVELBC setvelbc # define FORT_SETSCALBC setscalbc #endif #include extern "C" { void FORT_INITDATA(Real * state, ARLIM_P(lo), ARLIM_P(hi), const Real * dx, Real * time, int * numscal); void FORT_PROBINIT (const int* name, const int* namelen); void FORT_DERVORT(Real* state, Real * derval, ARLIM_P(derlo), ARLIM_P(derhi), ARLIM_P(lo), ARLIM_P(hi), const Real* dx); void FORT_SET_CELL_VELBC(Real* u, ARLIM_P(lo), ARLIM_P(hi), int * bc, int * irz, Real * visc_coef, const Real * dx, Real * time); void FORT_DERAVGP(Real* pressure, Real * dat, ARLIM_P(lo), ARLIM_P(hi)); void FORT_CMPDT(Real * u, Real * rho, Real * gp, Real * force, const Real* dx, Real * dtold, Real * dt, Real * cfl, ARLIM_P(lo), ARLIM_P(hi)); #if (BL_SPACEDIM == 2) void FORT_SLOPEX(Real * s, Real * slx, Real * dfromx, ARLIM_P(lo), ARLIM_P(hi), int * first_comp, int * nvar, int * bc, int * irz, int * slope_order); void FORT_SLOPEY(Real * s, Real * sly, Real * dfromy, ARLIM_P(lo), ARLIM_P(hi), int * nvar, int * bc, int * slope_order); #elif (BL_SPACEDIM == 3) void FORT_SLOPEX(Real * s, Real * slx, Real * dfromx, ARLIM_P(lo), ARLIM_P(hi), int * nvar, int * bc, int * slope_order); void FORT_SLOPEY(Real * s, Real * sly, Real * dfromy, ARLIM_P(lo), ARLIM_P(hi), int * nvar, int * bc, int * slope_order); void FORT_SLOPEZ(Real * s, Real * slz, Real * dfromz, ARLIM_P(lo), ARLIM_P(hi), int * nvar, int * bc, int * slope_order); #endif #if (BL_SPACEDIM == 2) void FORT_LAPLAC(Real * u, Real * lapu, Real * areax, Real * areay, Real * volume, ARLIM_P(lo), ARLIM_P(hi), const Real* dx, Real * visc_coef, int * irz, int * bc, int * idir); #elif (BL_SPACEDIM == 3) void FORT_LAPLAC(Real * u, Real * lapu, Real * areax, Real * areay, Real * areaz, Real * volume, ARLIM_P(lo), ARLIM_P(hi), const Real* dx, Real * visc_coef, int * bc); #endif void FORT_MKFORCE(Real * force, Real * u, Real * rho, Real * gravity, Real * visc_coef, Real * time, const Real * dx, ARLIM_P(lo), ARLIM_P(hi)); void FORT_KINE( const Real* s, ARLIM_P(slo), ARLIM_P(shi), D_DECL(Real* xmean, Real* ymean, Real* zmean), D_DECL(Real* tix, Real* tiy, Real* tiz), const int* lo, const int* hi); void FORT_WRITEVEL(const Real* dat, ARLIM_P(lo),ARLIM_P(hi), const int* lo, const int* hi, const Real* probsize); void FORT_MKSCALFORCE(Real * force, Real * s, Real * time, const Real * dx, ARLIM_P(lo), ARLIM_P(hi), int* numscal); void FORT_MKDIVUCC(Real * divu_src, Real * u, Real * rho, Real * time, const Real * dx, ARLIM_P(lo), ARLIM_P(hi)); void FORT_MKDIVUNOD(Real * divu_src, Real * u, Real * rho, Real * time, const Real * dx, ARLIM_P(lo), ARLIM_P(hi)); #if (BL_SPACEDIM == 2) void FORT_MKUTRANS(Real * utrans, Real * vtrans, Real * vel, Real * velx, Real * vely, Real * force, const Real * dx, Real & dt, ARLIM_P(lo), ARLIM_P(hi), int * bc); void FORT_SCALUPD(Real * s, Real * sn, Real * sedgex, Real * sedgey, Real * uhalfx, Real * uhalfy, Real * diff_term, Real * scalforce, Real * areax, Real * areay, Real * vol, ARLIM_P(lo), ARLIM_P(hi), const Real * dx,Real * dt, int * is_conserv, int * numscal); void FORT_MKFLUX(Real * s, Real * sedgex, Real * sedgey, Real * slopex, Real * slopey, Real * uhalfx, Real * uhalfy, Real * utrans, Real * vtrans, Real * force, Real * s_l, Real * s_r, Real * s_b, Real * s_t, ARLIM_P(lo), ARLIM_P(hi), const Real * dx, Real * dt, Real * visc_coef, int * irz, int * bc, int * velpred, int * nstart, int * nend); void FORT_VELUPD(Real * u, Real * ustar, Real * lapu, Real * gradp, Real * rhohalf, Real * uadv, Real * vadv, Real * uhalfx, Real * uhalfy, Real * force, Real * dt, ARLIM_P(lo), ARLIM_P(hi), const Real* dx); void FORT_SETVELBC(Real* vel, ARLIM_P(lo), ARLIM_P(hi), int * bc, int * irz, Real * visc_coef, const Real * dx, Real * time); void FORT_SETSCALBC(Real * scal, ARLIM_P(lo), ARLIM_P(hi), ARLIM_P(slo), ARLIM_P(shi), int * bc, int * irz, int * which_scal, const Real * dx, Real * time); #elif (BL_SPACEDIM == 3) void FORT_MKUTRANS(Real * utrans, Real * vtrans, Real * wtrans, Real * vel, Real * velx, Real * vely, Real * velz, Real * force, const Real * dx, Real & dt, ARLIM_P(lo), ARLIM_P(hi), int * bc); void FORT_SCALUPD(Real * s, Real * sn, Real * sedgex, Real * sedgey, Real * sedgez, Real * uhalfx, Real * uhalfy, Real * uhalfz, Real * diff_term, Real * scalforce, Real * areax, Real * areay, Real * areaz, Real * vol, ARLIM_P(lo), ARLIM_P(hi), const Real * dx, Real * dt, int * is_conserv, int * numscal); void FORT_MKFLUX(Real * s, Real * sedgex, Real * sedgey, Real * sedgez, Real * slopex, Real * slopey, Real * slopez, Real * uhalfx, Real * uhalfy, Real * uhalfz, Real * utrans, Real * vtrans, Real * wtrans, Real * force, Real * s_l, Real * s_r, Real * s_b, Real * s_t, Real * s_d, Real * s_u, ARLIM_P(lo), ARLIM_P(hi), const Real * dx, Real * dt, Real * visc_coef, int * bc, int * velpred, int * nstart, int * nend); void FORT_VELUPD(Real * u, Real * ustar, Real * lapu, Real * gradp, Real * rhohalf, Real * uadv, Real * vadv, Real * wadv, Real * uhalfx, Real * uhalfy, Real * uhalfz, Real * force, Real * dt, ARLIM_P(lo), ARLIM_P(hi), const Real* dx); void FORT_SETVELBC(Real* vel, ARLIM_P(lo), ARLIM_P(hi), int * bc, Real * visc_coef, const Real * dx, Real * time); void FORT_SETSCALBC(Real * scal, ARLIM_P(lo), ARLIM_P(hi), ARLIM_P(slo), ARLIM_P(shi), int * bc, int * which_scal, const Real * dx, Real * time); #endif }; #endif ccseapps-2.5/CCSEApps/pVarden/inputs6.2d0000644000175000017500000002302511634153073021117 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 10 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. n_cell = 32 32 ############################################################################# # Maximum size of grid allowed. max_grid_size = 32 ############################################################################# # # Verbosity in Grid.cpp # grid.verbose = 1 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin6 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030 (assuming plot_file_root is "plt"). # These plot files can be viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ############################################################################# # if coord_sys = 0 then use Cartesian(x-y) geometry # If coord_sys = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if coord_sys = 1 then # you must set bcx_lo = 2. geometry.coord_sys = 1 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 3 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 4 ############################################################################# # The physical coordinates of the low end of the domain. geometry.prob_lo = 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. geometry.prob_hi = 1. 1. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.0 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/pVarden/setscalbc_2d.F0000644000175000017500000001555711634153073021732 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #if BL_USE_FLOAT #define threehalves 1.5e0 #else #define threehalves 1.5d0 #endif #define DIMS lo_1,lo_2,hi_1,hi_2 #define SDIMS slo_1,slo_2,shi_1,shi_2 c ************************************************************************* c ** SETSCALBC ** c ** Impose the physical boundary conditions on scalars s c ************************************************************************* subroutine setscalbc(s,DIMS,SDIMS,bc,irz,which_scal,dx,time) implicit none integer DIMS integer SDIMS integer which_scal integer bc(2,2) integer irz REAL_T dx(2) REAL_T time REAL_T s(slo_1:shi_1,slo_2:shi_2) c Local variables integer is,ie,js,je,i,j integer ilo,ihi integer ng,ngmax is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ilo = cvmgt(slo_1,lo_1,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) ihi = cvmgt(shi_1,hi_1,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) ngmax = lo_1-slo_1 c NOTE: IF BC == WALL, THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL c BOUNDARY, NOT IN THE GHOST CELL if (BCY_LO .eq. WALL) then do ng = 1,ngmax do i = ilo,ihi c s(i,js-1 ) = threehalves*s(i,js) - half*s(i,js+1) s(i,js-ng) = s(i,js) enddo enddo elseif (BCY_LO .eq. INLET) then call scalinflow(s,DIMS,SDIMS,time,dx,1,0,which_scal) if (ngmax .gt. 1) then do ng = 2,ngmax do i = slo_1,shi_1 s(i,js-ng) = s(i,js-1) enddo enddo endif elseif (BCY_LO .eq. OUTLET) then do ng = 1,ngmax do i = ilo,ihi c s(i,js-1) = threehalves*s(i,js) - half*s(i,js+1) s(i,js-ng) = s(i,js) enddo enddo endif if (BCY_HI .eq. WALL) then do ng = 1,ngmax do i = ilo,ihi c s(i,je+1 ) = threehalves*s(i,je) - half*s(i,je-1) s(i,je+ng) = s(i,je) enddo enddo elseif (BCY_HI .eq. INLET) then call scalinflow(s,DIMS,SDIMS,time,dx,1,1,which_scal) if (ngmax .gt. 1) then do ng = 2,ngmax do i = slo_1,shi_1 s(i,je+ng) = s(i,je+1) enddo enddo endif elseif (BCY_HI .eq. OUTLET) then do ng = 1,ngmax do i = ilo,ihi c s(i,je+1) = threehalves*s(i,je) - half*s(i,je-1) s(i,je+ng) = s(i,je) enddo enddo endif if (BCX_LO .eq. WALL) then if (irz .eq. 1) then do ng = 1,ngmax do j = js-ngmax,je+ngmax s(is-ng,j) = s(is+ng-1,j) enddo enddo else do ng = 1,ngmax do j = js-ngmax,je+ngmax c s(is-1,j) = threehalves*s(is,j) - half*s(is+1,j) s(is-ng,j) = s(is,j) enddo enddo endif elseif (BCX_LO .eq. INLET) then call scalinflow(s,DIMS,SDIMS,time,dx,0,0,which_scal) if (ngmax .gt. 2) then do ng = 2,ngmax do j = js-ngmax,je+ngmax s(is-ng,j) = s(is-1,j) enddo enddo endif elseif (BCX_LO .eq. OUTLET) then do ng = 1,ngmax do j = js-ngmax,je+ngmax c s(is-1,j) = threehalves*s(is,j) - half*s(is+1,j) s(is-ng,j) = s(is,j) enddo enddo endif if (BCX_HI .eq. WALL) then do ng = 1,ngmax do j = js-ngmax,je+ngmax c s(ie+1,j) = threehalves*s(ie,j) - half*s(ie-1,j) s(ie+ng,j) = s(ie,j) enddo enddo elseif (BCX_HI .eq. INLET) then call scalinflow(s,DIMS,SDIMS,time,dx,0,1,which_scal) if (ngmax .gt. 2) then do ng = 2,ngmax do j = js-ngmax,je+ngmax s(ie+ng,j) = s(ie+1,j) enddo enddo endif elseif (BCX_HI .eq. OUTLET) then do ng = 1,ngmax do j = js-ngmax,je+ngmax c s(ie+1,j) = threehalves*s(ie,j) - half*s(ie-1,j) s(ie+ng,j) = s(ie,j) enddo enddo endif c We return to these to get the corner regions which are c part INTERIOR and part WALL / OUTFLOW if (BCY_LO .eq. WALL) then do ng = 1,ngmax do i = is-ngmax,is-1 c s(i,js-1 ) = threehalves*s(i,js) - half*s(i,js+1) s(i,js-ng) = s(i,js) enddo do i = ie+1,ie+ngmax c s(i,js-1 ) = threehalves*s(i,js) - half*s(i,js+1) s(i,js-ng) = s(i,js) enddo enddo elseif (BCY_LO .eq. OUTLET) then do ng = 1,ngmax do i = is-ngmax,is-1 c s(i,js-1) = threehalves*s(i,js) - half*s(i,js+1) s(i,js-ng) = s(i,js) enddo do i = ie+1,ie+ngmax c s(i,js-1) = threehalves*s(i,js) - half*s(i,js+1) s(i,js-ng) = s(i,js) enddo enddo endif if (BCY_HI .eq. WALL) then do ng = 1,ngmax do i = is-ngmax,is-1 c s(i,je+1 ) = threehalves*s(i,je) - half*s(i,je-1) s(i,je+ng) = s(i,je) enddo do i = ie+1,ie+ngmax c s(i,je+1 ) = threehalves*s(i,je) - half*s(i,je-1) s(i,je+ng) = s(i,je) enddo enddo elseif (BCY_HI .eq. OUTLET) then do ng = 1,ngmax do i = is-ngmax,is-1 c s(i,je+1) = threehalves*s(i,je) - half*s(i,je-1) s(i,je+ng) = s(i,je) enddo do i = ie+1,ie+ngmax c s(i,je+1) = threehalves*s(i,je) - half*s(i,je-1) s(i,je+ng) = s(i,je) enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/slopey_3d.F0000644000175000017500000001636211634153073021276 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** SLOPEY ** c ** Compute the slope of nvar components of s in the y-direction c ************************************************************************* subroutine FORT_SLOPEY(s,sly,dyscr,DIMS,nvar,bc,slope_order) implicit none integer DIMS integer nvar integer bc(2,3) integer slope_order REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,nvar) REAL_T sly(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,nvar) REAL_T dyscr(lo_2-2:hi_2+2,4) integer cen,lim,flag,fromm parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ks,ie,je,ke,i,j,k,iv is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 c ::: HERE DOING 1ST ORDER if (slope_order .eq. 0) then do iv = 1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is-1,ie+1 sly(i,j,k,iv) = zero enddo enddo enddo enddo c ::: HERE DOING 2ND ORDER else if (slope_order .eq. 2) then do iv=1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is-1,ie+1 del = half*(s(i,j+1,k,iv) - s(i,j-1,k,iv)) dpls = two *(s(i,j+1,k,iv) - s(i,j ,k,iv)) dmin = two *(s(i,j ,k,iv) - s(i,j-1,k,iv)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,j,k,iv)= sflag*min(slim,abs(del)) enddo enddo if (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) then do i = is-1,ie+1 sly(i,js-1,k,iv) = zero del = (s(i,js+1,k,iv)+three*s(i,js,k,iv)- $ four*s(i,js-1,k,iv)) * third dpls = two*(s(i,js+1,k,iv) - s(i,js ,k,iv)) dmin = two*(s(i,js ,k,iv) - s(i,js-1,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,js,k,iv)= sflag*min(slim,abs(del)) enddo elseif (BCY_LO .eq. OUTLET) then do i = is-1,ie+1 sly(i,js-1,k,iv)= zero enddo endif if (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) then do i = is-1, ie+1 sly(i,je+1,k,iv) = zero del = -(s(i,je-1,k,iv)+three*s(i,je,k,iv)- $ four*s(i,je+1,k,iv)) * third dpls = two*(s(i,je+1,k,iv) - s(i,je ,k,iv)) dmin = two*(s(i,je ,k,iv) - s(i,je-1,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,je,k,iv)= sflag*min(slim,abs(del)) enddo elseif (BCY_HI .eq. OUTLET) then do i = is-1,ie+1 sly(i,je+1,k,iv)= zero enddo endif enddo enddo else c ::: HERE DOING 4TH ORDER do iv=1,nvar do k = ks-1,ke+1 do i = is-1,ie+1 do j = js-2,je+2 dyscr(j,cen) = half*(s(i,j+1,k,iv)-s(i,j-1,k,iv)) dmin = two*(s(i,j ,k,iv)-s(i,j-1,k,iv)) dpls = two*(s(i,j+1,k,iv)-s(i,j ,k,iv)) dyscr(j,lim) = min(abs(dmin),abs(dpls)) dyscr(j,lim) = cvmgp(dyscr(j,lim),zero,dpls*dmin) dyscr(j,flag) = sign(one,dyscr(j,cen)) dyscr(j,fromm)= dyscr(j,flag)*min(dyscr(j,lim),abs(dyscr(j,cen))) enddo do j = js-1,je+1 ds = two * two3rd * dyscr(j,cen) - $ sixth * (dyscr(j+1,fromm) + dyscr(j-1,fromm)) sly(i,j,k,iv) = dyscr(j,flag)*min(abs(ds),dyscr(j,lim)) enddo if (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) then sly(i,js-1,k,iv) = zero del = -sixteen/fifteen*s(i,js-1,k,iv) + half*s(i,js ,k,iv) + $ two3rd*s(i,js+1,k,iv) - tenth*s(i,js+2,k,iv) dmin = two*(s(i,js ,k,iv)-s(i,js-1,k,iv)) dpls = two*(s(i,js+1,k,iv)-s(i,js ,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,js,k,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at js+1 using the revised dyscr(js,fromm) dyscr(js,fromm) = sly(i,js,k,iv) ds = two * two3rd * dyscr(js+1,cen) - $ sixth * (dyscr(js+2,fromm) + dyscr(js,fromm)) sly(i,js+1,k,iv) = dyscr(js+1,flag)*min(abs(ds),dyscr(js+1,lim)) elseif (BCY_LO .eq. OUTLET) then sly(i,js-1,k,iv) = zero endif if (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) then sly(i,je+1,k,iv) = zero del = -( -sixteen/fifteen*s(i,je+1,k,iv) + half*s(i,je ,k,iv) $ + two3rd*s(i,je-1,k,iv) - tenth*s(i,je-2,k,iv) ) dmin = two*(s(i,je ,k,iv)-s(i,je-1,k,iv)) dpls = two*(s(i,je+1,k,iv)-s(i,je ,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,je,k,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at js+1 using the revised dyscr(js,fromm) dyscr(je,fromm) = sly(i,je,k,iv) ds = two * two3rd * dyscr(je-1,cen) - $ sixth * (dyscr(je-2,fromm) + dyscr(je,fromm)) sly(i,je-1,k,iv) = dyscr(je-1,flag)*min(abs(ds),dyscr(je-1,lim)) elseif (BCY_HI .eq. OUTLET) then sly(i,je+1,k,iv) = zero endif enddo enddo enddo endif return end ccseapps-2.5/CCSEApps/pVarden/probin40000644000175000017500000000032311634153073020554 0ustar amckinstryamckinstry $fortin prob_type = 4 zero_dir = 3 in_xvel = 1.0 in_yvel = 0.0 in_zvel = 0.0 in_density = 1.0 in_tracer = 0.0 xblob = 0.5 yblob = 0.5 zblob = 0.5 radblob = 0.2 denblob = 10. $end ccseapps-2.5/CCSEApps/pVarden/hg_3d.F0000644000175000017500000011574211634153073020363 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "HGPROJ_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #define CDIMS loc_1,loc_2,loc_3,hic_1,hic_2,hic_3 #define GDIMS g_lo_1,g_lo_2,g_lo_3,g_hi_1,g_hi_2,g_hi_3 #define PDIMS p_lo_1,p_lo_2,p_lo_3,p_hi_1,p_hi_2,p_hi_3 #if BL_USE_FLOAT #define sixteenth .0625e0 #else #define sixteenth .0625d0 #endif c ************************************************************************* c ** MKCOEFF ** c ** Define the coefficients along the axis as averages of sig. c ************************************************************************* subroutine FORT_MKCOEFF(coeff,sig,DIMS,ng) implicit none integer DIMS integer ng REAL_T sig(lo_1-ng:hi_1 +ng,lo_2-ng:hi_2 +ng,lo_3-ng:hi_3 +ng) REAL_T coeff(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng,3) c Local variables integer i,j,k do k = lo_3 ,hi_3+1 do j = lo_2 ,hi_2+1 do i = lo_1-1,hi_1+1 coeff(i,j,k,1) = ( sig(i,j,k ) + sig(i,j-1,k ) + $ sig(i,j,k-1) + sig(i,j-1,k-1) ) * fourth coeff(i,j,k,1) = coeff(i,j,k,1) enddo enddo enddo do k = lo_3 ,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1 ,hi_1+1 coeff(i,j,k,2) = ( sig(i,j,k ) + sig(i-1,j,k ) + $ sig(i,j,k-1) + sig(i-1,j,k-1) ) * fourth coeff(i,j,k,2) = coeff(i,j,k,2) enddo enddo enddo do k = lo_3-1,hi_3+1 do j = lo_2 ,hi_2+1 do i = lo_1 ,hi_1+1 coeff(i,j,k,3) = ( sig(i ,j,k) + sig(i ,j-1,k) + $ sig(i-1,j,k) + sig(i-1,j-1,k) ) * fourth coeff(i,j,k,3) = coeff(i,j,k,3) enddo enddo enddo return end c ************************************************************************* c ** GRADHG ** c ** Compute the cell-centered gradient of the nodal pressure field c ************************************************************************* subroutine FORT_GRADHG(gphi,GDIMS,phi,PDIMS,DIMS,dx) implicit none integer DIMS integer g_lo_1, g_lo_2, g_lo_3 integer g_hi_1, g_hi_2, g_hi_3 integer p_lo_1, p_lo_2, p_lo_3 integer p_hi_1, p_hi_2, p_hi_3 REAL_T gphi(g_lo_1:g_hi_1,g_lo_2:g_hi_2,g_lo_3:g_hi_3,3) REAL_T phi(p_lo_1:p_hi_1,p_lo_2:p_hi_2,p_lo_3:p_hi_3) REAL_T dx(3) c Local variables integer i, j, k,n do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 gphi(i,j,k,1) = fourth*(phi(i+1,j,k ) + phi(i+1,j+1,k ) + $ phi(i+1,j,k+1) + phi(i+1,j+1,k+1) - $ phi(i ,j,k ) - phi(i ,j+1,k ) - $ phi(i ,j,k+1) - phi(i ,j+1,k+1) ) /dx(1) gphi(i,j,k,2) = fourth*(phi(i,j+1,k ) + phi(i+1,j+1,k ) + $ phi(i,j+1,k+1) + phi(i+1,j+1,k+1) - $ phi(i,j ,k ) - phi(i+1,j ,k ) - $ phi(i,j ,k+1) - phi(i+1,j ,k+1) ) /dx(2) gphi(i,j,k,3) = fourth*(phi(i,j ,k+1) + phi(i+1,j ,k+1) + $ phi(i,j+1,k+1) + phi(i+1,j+1,k+1) - $ phi(i,j ,k ) - phi(i+1,j ,k ) - $ phi(i,j+1,k ) - phi(i+1,j+1,k ) ) /dx(3) enddo enddo enddo return end c ************************************************************************* c ** RHSHG ** c ** Compute the right-hand-side D(V) for the projection c ************************************************************************* subroutine FORT_RHSHG(du,u,divu_src,vol,DIMS,dx,bc,norm,ng, $ is_singular,sum_src,sum_fac) implicit none integer DIMS integer ng REAL_T du(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) REAL_T divu_src(lo_1 :hi_1+1,lo_2 :hi_2+1,lo_3 :hi_3+1) REAL_T vol(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T dx(3) REAL_T sum_src, sum_fac integer is_singular integer bc(2,3) c Local variables REAL_T fac,facx,facy,facz,norm REAL_T factor REAL_T vavg integer i, j, k, n integer is,ie,js,je,ks,ke integer istrt,iend integer jstrt,jend integer kstrt,kend is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 istrt = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) if (BCX_LO .eq. WALL) then do n = 1,3 do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k,n) = zero enddo enddo enddo endif if (BCX_HI .eq. WALL) then do n = 1,3 do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k,n) = zero enddo enddo enddo endif if (BCY_LO .eq. WALL) then do n = 1,3 do k = ks-1,ke+1 do i = is-1,ie+1 u(i,js-1,k,n) = zero enddo enddo enddo endif if (BCY_HI .eq. WALL) then do n = 1,3 do k = ks-1,ke+1 do i = is-1,ie+1 u(i,je+1,k,n) = zero enddo enddo enddo endif if (BCZ_LO .eq. WALL) then do n = 1,3 do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ks-1,n) = zero enddo enddo enddo endif if (BCZ_HI .eq. WALL) then do n = 1,3 do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ke+1,n) = zero enddo enddo enddo endif facx = fourth / dx(1) facy = fourth / dx(2) facz = fourth / dx(3) do k = kstrt,kend do j = jstrt,jend do i = istrt,iend du(i,j,k) = ((vol(i ,j-1,k )*u(i ,j-1,k ,1) + $ vol(i ,j ,k )*u(i ,j ,k ,1) + $ vol(i ,j-1,k-1)*u(i ,j-1,k-1,1) + $ vol(i ,j ,k-1)*u(i ,j ,k-1,1)) - $ (vol(i-1,j-1,k )*u(i-1,j-1,k ,1) + $ vol(i-1,j ,k )*u(i-1,j ,k ,1) + $ vol(i-1,j-1,k-1)*u(i-1,j-1,k-1,1) + $ vol(i-1,j ,k-1)*u(i-1,j ,k-1,1)) ) * facx $ + ((vol(i-1,j ,k )*u(i-1,j ,k ,2) + $ vol(i ,j ,k )*u(i ,j ,k ,2) + $ vol(i-1,j ,k-1)*u(i-1,j ,k-1,2) + $ vol(i ,j ,k-1)*u(i ,j ,k-1,2)) - $ (vol(i-1,j-1,k )*u(i-1,j-1,k ,2) + $ vol(i ,j-1,k )*u(i ,j-1,k ,2) + $ vol(i-1,j-1,k-1)*u(i-1,j-1,k-1,2) + $ vol(i ,j-1,k-1)*u(i ,j-1,k-1,2)) ) * facy $ + ((vol(i-1,j ,k )*u(i-1,j ,k ,3) + $ vol(i ,j ,k )*u(i ,j ,k ,3) + $ vol(i-1,j-1,k )*u(i-1,j-1,k ,3) + $ vol(i ,j-1,k )*u(i ,j-1,k ,3)) - $ (vol(i-1,j ,k-1)*u(i-1,j ,k-1,3) + $ vol(i ,j ,k-1)*u(i ,j ,k-1,3) + $ vol(i-1,j-1,k-1)*u(i-1,j-1,k-1,3) + $ vol(i ,j-1,k-1)*u(i ,j-1,k-1,3)) ) * facz vavg = $ (vol(i,j,k ) + vol(i-1,j,k ) + vol(i,j-1,k ) + vol(i-1,j-1,k ) $ +vol(i,j,k-1) + vol(i-1,j,k-1) + vol(i,j-1,k-1) + vol(i-1,j-1,k-1)) du(i,j,k) = du(i,j,k) - vavg * divu_src(i,j,k) fac = one fac = cvmgt(two*fac,fac,(i .eq. is ) .and. $ (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) ) fac = cvmgt(two*fac,fac,(i .eq. ie+1) .and. $ (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) ) fac = cvmgt(two*fac,fac,(j .eq. js ) .and. $ (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) ) fac = cvmgt(two*fac,fac,(j .eq. je+1) .and. $ (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) ) fac = cvmgt(two*fac,fac,(k .eq. ks ) .and. $ (BCZ_LO .eq. WALL .or. BCZ_LO .eq. INLET) ) fac = cvmgt(two*fac,fac,(k .eq. ke+1) .and. $ (BCZ_HI .eq. WALL .or. BCZ_HI .eq. INLET) ) du(i,j,k) = du(i,j,k) * fac if (i .eq. 5 .and. j .eq. 1 .and. k .eq. 0) then print *,'DU ',du(i,j,k) print *,'VAVG ',vavg print *,'FAC ',fac endif enddo enddo enddo if (is_singular .eq. 1) then sum_src = zero sum_fac = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend factor = one factor = cvmgt(half*factor,factor,i.eq.is .or. i.eq.ie+1) factor = cvmgt(half*factor,factor,j.eq.js .or. j.eq.je+1) factor = cvmgt(half*factor,factor,k.eq.ks .or. k.eq.ke+1) sum_src = sum_src + factor * du(i,j,k) sum_fac = sum_fac + factor enddo enddo enddo endif norm = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend norm = max(norm, abs(du(i,j,k))) enddo enddo enddo return end c ************************************************************************* c ** ADJUSTRHS ** c ** Adjust the RHS so it sums to zero if the problem has no outflow boundaries. c ************************************************************************* subroutine FORT_ADJUSTRHS(du,DIMS,bc,ng,sum_src) implicit none integer DIMS integer bc(2,3) integer ng REAL_T du(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T sum_src c Local variables integer i, j, k integer istart,iend,jstart,jend,kstart,kend istart = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstart = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) do k = kstart,kend do j = jstart,jend do i = istart,iend du(i,j,k) = du(i,j,k) - sum_src enddo enddo enddo return end c ************************************************************************* c ** PROJUHG ** c ** Define the updated pressure and vector field c ************************************************************************* subroutine FORT_PROJUHG(u,pressure,phi,gradphi,rhonph,DIMS,ng) implicit none integer DIMS integer ng REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) REAL_T pressure(lo_1 :hi_1+1,lo_2 :hi_2+1,lo_3 :hi_3+1) REAL_T phi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T gradphi(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T rhonph(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) c Local variables integer i, j, k do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 u(i,j,k,1) = u(i,j,k,1) - gradphi(i,j,k,1)/rhonph(i,j,k) u(i,j,k,2) = u(i,j,k,2) - gradphi(i,j,k,2)/rhonph(i,j,k) u(i,j,k,3) = u(i,j,k,3) - gradphi(i,j,k,3)/rhonph(i,j,k) enddo enddo enddo print *,'UMAX ',u(7,7,7,1) do k = lo_3,hi_3+1 do j = lo_2,hi_2+1 do i = lo_1,hi_1+1 c pressure(i,j,k) = pressure(i,j,k) + phi(i,j,k) pressure(i,j,k) = phi(i,j,k) enddo enddo enddo return end c ************************************************************************* c ** RESIDUAL ** c ** Compute the residual R = f - D(sig G(phi)) c ************************************************************************* subroutine FORT_RESIDUAL(residual,phi,source,coeff,dgphi, $ DIMS,dx,resnorm,bc,ng) implicit none integer DIMS integer ng REAL_T residual(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T phi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T source(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T coeff(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng,3) REAL_T dgphi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T dx(3) REAL_T resnorm integer bc(2,3) c Local variables integer i,j,k integer istrt,jstrt,kstrt integer iend,jend,kend resnorm = zero istrt = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) call makedgphi(phi,dgphi,coeff,DIMS,dx,bc,ng,istrt,jstrt,kstrt,iend,jend,kend) do k = kstrt,kend do j = jstrt,jend do i = istrt,iend residual(i,j,k) = source(i,j,k) - dgphi(i,j,k) enddo enddo enddo do k = kstrt,kend do j = jstrt,jend do i = istrt,iend resnorm = max(resnorm,abs(residual(i,j,k))) enddo enddo enddo return end c ************************************************************************* c ** RELAX ** c ** Gauss-Seidel relaxation c ************************************************************************* subroutine FORT_RELAX(phi,source,coeff,dgphi,DIMS,dx,bc,nnrelax,ng) implicit none integer DIMS integer ng REAL_T phi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T source(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T coeff(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng,3) REAL_T dgphi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T dx(3) integer bc(2,3) integer nnrelax c Local variables REAL_T facx, facy, facz REAL_T rfac, mult integer i,j,k integer iter, ioff, iinc integer is,ie,js,je,ks,ke integer istrt, jstrt, kstrt integer iend, jend, kend integer extra_xlo,extra_xhi integer extra_ylo,extra_yhi integer extra_zlo,extra_zhi is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 facx = one/(dx(1)*dx(1)) facy = one/(dx(2)*dx(2)) facz = one/(dx(3)*dx(3)) istrt = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) if (2*nnrelax .gt. ng) then print *,'DONT HAVE ENOUGH BUFFER CELLS IN HG:RELAX ' print *,'NG = ',ng print *,'NRELAX = ',nnrelax stop endif do iter = 1, 2*nnrelax extra_xlo = cvmgt(ng-iter,0,BCX_LO .eq. INTERIOR .or. BCX_LO .eq. PERIODIC) extra_ylo = cvmgt(ng-iter,0,BCY_LO .eq. INTERIOR .or. BCY_LO .eq. PERIODIC) extra_zlo = cvmgt(ng-iter,0,BCZ_LO .eq. INTERIOR .or. BCZ_LO .eq. PERIODIC) extra_xhi = cvmgt(ng-iter,0,BCX_HI .eq. INTERIOR .or. BCX_HI .eq. PERIODIC) extra_yhi = cvmgt(ng-iter,0,BCY_HI .eq. INTERIOR .or. BCY_HI .eq. PERIODIC) extra_zhi = cvmgt(ng-iter,0,BCZ_HI .eq. INTERIOR .or. BCZ_HI .eq. PERIODIC) do k = kstrt-extra_zlo,kend+extra_zhi do j = jstrt-extra_ylo,jend+extra_yhi iinc = mod(j+k+iter+1+extra_xlo+2*ng,2) do i = istrt-extra_xlo+iinc,iend+extra_xhi,2 dgphi(i,j,k) = $ (coeff(i ,j,k,1) * (phi(i+1,j,k) - phi(i,j,k)) + $ coeff(i-1,j,k,1) * (phi(i-1,j,k) - phi(i,j,k)) ) * facx + $ (coeff(i,j ,k,2) * (phi(i,j+1,k) - phi(i,j,k)) + $ coeff(i,j-1,k,2) * (phi(i,j-1,k) - phi(i,j,k)) ) * facy + $ (coeff(i,j,k ,3) * (phi(i,j,k+1) - phi(i,j,k)) + $ coeff(i,j,k-1,3) * (phi(i,j,k-1) - phi(i,j,k)) ) * facz rfac = (coeff(i,j,k,1) + coeff(i-1,j,k,1)) * facx + $ (coeff(i,j,k,2) + coeff(i,j-1,k,2)) * facy + $ (coeff(i,j,k,3) + coeff(i,j,k-1,3)) * facz mult = one mult = cvmgt(two*mult,mult, $ i.eq.is .and. (BCX_LO.eq.WALL.or.BCX_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.js .and. (BCY_LO.eq.WALL.or.BCY_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ k.eq.ks .and. (BCZ_LO.eq.WALL.or.BCZ_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ i.eq.ie+1 .and. (BCX_HI.eq.WALL.or.BCX_HI.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.je+1 .and. (BCY_HI.eq.WALL.or.BCY_HI.eq.INLET)) mult = cvmgt(two*mult,mult, $ k.eq.ke+1 .and. (BCZ_HI.eq.WALL.or.BCZ_HI.eq.INLET)) dgphi(i,j,k) = mult*dgphi(i,j,k) rfac = mult * rfac rfac = one/rfac phi(i,j,k) = phi(i,j,k) + rfac*(dgphi(i,j,k) - source(i,j,k)) enddo enddo enddo enddo return end c ************************************************************************* c ** COARSIG ** c ** Coarsening of the sig coefficients c ************************************************************************* subroutine FORT_COARSIG(sig,sigc,DIMS,CDIMS,ng) implicit none integer DIMS integer CDIMS integer ng REAL_T sig(lo_1 -ng:hi_1 +ng,lo_2 -ng:hi_2 +ng,lo_3 -ng:hi_3 +ng) REAL_T sigc(loc_1-ng:hic_1+ng,loc_2-ng:hic_2+ng,loc_3-ng:hic_3+ng) c Local variables integer i ,j, k do k = lo_3,hi_3,2 do j = lo_2,hi_2,2 do i = lo_1,hi_1,2 sigc(i/2,j/2,k/2) = ( sig(i ,j,k ) + sig(i ,j+1,k )+ $ sig(i+1,j,k ) + sig(i+1,j+1,k )+ $ sig(i ,j,k+1) + sig(i ,j+1,k+1)+ $ sig(i+1,j,k+1) + sig(i+1,j+1,k+1) ) * eighth enddo enddo enddo return end c ************************************************************************* c ** RESTRICT ** c ** Conservative restriction of the residual c ************************************************************************* subroutine FORT_RESTRICT(res,resc,DIMS,CDIMS,bc,ng) implicit none integer DIMS integer CDIMS integer ng REAL_T res(lo_1 -ng:hi_1 +1+ng,lo_2 -ng:hi_2 +1+ng,lo_3 -ng:hi_3 +1+ng) REAL_T resc(loc_1-ng:hic_1+1+ng,loc_2-ng:hic_2+1+ng,loc_3-ng:hic_3+1+ng) integer bc(2,3) c Local variables integer i,j,k,ii,jj,kk integer istrt,jstrt,kstrt integer iend,jend,kend REAL_T cen, faces, sides, corners istrt = cvmgt((lo_1 )/2+1,(lo_1 )/2,BCX_LO .eq. OUTLET) iend = cvmgt((hi_1+1)/2-1,(hi_1+1)/2,BCX_HI .eq. OUTLET) jstrt = cvmgt((lo_2 )/2+1,(lo_2 )/2,BCY_LO .eq. OUTLET) jend = cvmgt((hi_2+1)/2-1,(hi_2+1)/2,BCY_HI .eq. OUTLET) kstrt = cvmgt((lo_3 )/2+1,(lo_3 )/2,BCZ_LO .eq. OUTLET) kend = cvmgt((hi_3+1)/2-1,(hi_3+1)/2,BCZ_HI .eq. OUTLET) if (BCX_LO .eq. WALL .or. BCX_LO .eq. INLET) then do k = lo_3-1,hi_3+2 do j = lo_2-1,hi_2+2 res(lo_1-1,j,k) = res(lo_1+1,j,k) enddo enddo endif if (BCX_HI .eq. WALL .or. BCX_HI .eq. INLET) then do k = lo_3-1,hi_3+2 do j = lo_2-1,hi_2+2 res(hi_1+2,j,k) = res(hi_1 ,j,k) enddo enddo endif if (BCY_LO .eq. WALL .or. BCY_LO .eq. INLET) then do k = lo_3-1,hi_3+2 do i = lo_1-1,hi_1+2 res(i,lo_2-1,k) = res(i,lo_2+1,k) enddo enddo endif if (BCY_HI .eq. WALL .or. BCY_HI .eq. INLET) then do k = lo_3-1,hi_3+2 do i = lo_1-1,hi_1+2 res(i,hi_2+2,k) = res(i,hi_2 ,k) enddo enddo endif if (BCZ_LO .eq. WALL .or. BCZ_LO .eq. INLET) then do j = lo_2-1,hi_2+2 do i = lo_1-1,hi_1+2 res(i,j,lo_3-1) = res(i,j,lo_3+1) enddo enddo endif if (BCZ_HI .eq. WALL .or. BCZ_HI .eq. INLET) then do j = lo_2-1,hi_2+2 do i = lo_1-1,hi_1+2 res(i,j,hi_3+2) = res(i,j,hi_3 ) enddo enddo endif do k = kstrt,kend do j = jstrt,jend do i = istrt,iend ii = 2*i jj = 2*j kk = 2*k cen = res(ii,jj,kk) faces = res(ii+1,jj,kk) + res(ii-1,jj,kk) + $ res(ii,jj+1,kk) + res(ii,jj-1,kk) + $ res(ii,jj,kk+1) + res(ii,jj,kk-1) sides = res(ii+1,jj+1,kk) + res(ii-1,jj+1,kk) + $ res(ii+1,jj-1,kk) + res(ii-1,jj-1,kk) + $ res(ii+1,jj,kk+1) + res(ii-1,jj,kk+1) + $ res(ii+1,jj,kk-1) + res(ii-1,jj,kk-1) + $ res(ii,jj+1,kk+1) + res(ii,jj-1,kk+1) + $ res(ii,jj+1,kk-1) + res(ii,jj-1,kk-1) corners = res(ii+1,jj+1,kk+1) + res(ii-1,jj+1,kk+1) + $ res(ii+1,jj-1,kk+1) + res(ii-1,jj-1,kk+1) + $ res(ii+1,jj+1,kk-1) + res(ii-1,jj+1,kk-1) + $ res(ii+1,jj-1,kk-1) + res(ii-1,jj-1,kk-1) resc(i,j,k) = eighth * (cen + half * faces + $ fourth * sides + $ eighth * corners) enddo enddo enddo return end c ************************************************************************* c ** INTERP ** c ** Simple bilinear interpolation c ************************************************************************* subroutine FORT_INTERP(phi,deltac,DIMS,CDIMS,ng) implicit none integer DIMS integer CDIMS integer ng REAL_T phi(lo_1 -ng:hi_1 +1+ng,lo_2 -ng:hi_2 +1+ng,lo_3 -ng:hi_3 +1+ng) REAL_T deltac(loc_1-ng:hic_1+1+ng,loc_2-ng:hic_2+1+ng,loc_3-ng:hic_3+1+ng) c Local variables integer i,j,k do k = lo_3,hi_3+1,2 do j = lo_2,hi_2+1,2 do i = lo_1,hi_1+1,2 phi(i,j,k) = phi(i,j,k) + deltac(i/2,j/2,k/2) enddo enddo enddo do k = lo_3+1,hi_3 ,2 do j = lo_2 ,hi_2+1,2 do i = lo_1 ,hi_1+1,2 phi(i,j,k) = phi(i,j,k) + half*(deltac(i/2,j/2,k/2)+deltac(i/2,j/2,k/2+1)) enddo enddo enddo do k = lo_3 ,hi_3+1,2 do j = lo_2+1,hi_2 ,2 do i = lo_1 ,hi_1+1,2 phi(i,j,k) = phi(i,j,k) + half*(deltac(i/2,j/2,k/2)+deltac(i/2,j/2+1,k/2)) enddo enddo enddo do k = lo_3 ,hi_3+1,2 do j = lo_2 ,hi_2+1,2 do i = lo_1+1,hi_1 ,2 phi(i,j,k) = phi(i,j,k) + half*(deltac(i/2,j/2,k/2)+deltac(i/2+1,j/2,k/2)) enddo enddo enddo do k = lo_3 ,hi_3+1,2 do j = lo_2+1,hi_2,2 do i = lo_1+1,hi_1,2 phi(i,j,k) = phi(i,j,k) + $ fourth*(deltac(i/2,j/2 ,k/2)+deltac(i/2+1,j/2 ,k/2) $ +deltac(i/2,j/2+1,k/2)+deltac(i/2+1,j/2+1,k/2)) enddo enddo enddo do k = lo_3+1,hi_3 ,2 do j = lo_2 ,hi_2+1,2 do i = lo_1+1,hi_1 ,2 phi(i,j,k) = phi(i,j,k) + $ fourth*(deltac(i/2,j/2,k/2 )+deltac(i/2+1,j/2,k/2 ) $ +deltac(i/2,j/2,k/2+1)+deltac(i/2+1,j/2,k/2+1)) enddo enddo enddo do k = lo_3+1,hi_3 ,2 do j = lo_2+1,hi_2 ,2 do i = lo_1 ,hi_1+1,2 phi(i,j,k) = phi(i,j,k) + $ fourth*(deltac(i/2,j/2,k/2 )+deltac(i/2,j/2+1,k/2 ) $ +deltac(i/2,j/2,k/2+1)+deltac(i/2,j/2+1,k/2+1)) enddo enddo enddo do k = lo_3+1,hi_3,2 do j = lo_2+1,hi_2,2 do i = lo_1+1,hi_1,2 phi(i,j,k) = phi(i,j,k) + $ eighth*(deltac(i/2 ,j/2,k/2 )+deltac(i/2 ,j/2+1,k/2 ) $ +deltac(i/2 ,j/2,k/2+1)+deltac(i/2 ,j/2+1,k/2+1) $ +deltac(i/2+1,j/2,k/2 )+deltac(i/2+1,j/2+1,k/2 ) $ +deltac(i/2+1,j/2,k/2+1)+deltac(i/2+1,j/2+1,k/2+1)) enddo enddo enddo return end c ************************************************************************* c ** MAKEDGPHI ** c ** Compute D(sig G(phi)) c ************************************************************************* subroutine makedgphi(phi,dgphi,coeff,DIMS,dx,bc,ng,rlo_1,rlo_2,rlo_3, $ rhi_1,rhi_2,rhi_3) implicit none integer DIMS integer ng integer rlo_1,rlo_2,rlo_3 integer rhi_1,rhi_2,rhi_3 REAL_T phi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T dgphi(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T coeff(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng,3) REAL_T dx(3) integer bc(2,3) c Local variables REAL_T facx, facy, facz REAL_T mult integer istart,iend integer jstart,jend integer kstart,kend integer i,j,k facx = one / (dx(1)*dx(1)) facy = one / (dx(2)*dx(2)) facz = one / (dx(3)*dx(3)) istart = cvmgt(lo_1+1,rlo_1,BCX_LO .eq. OUTLET) jstart = cvmgt(lo_2+1,rlo_2,BCY_LO .eq. OUTLET) kstart = cvmgt(lo_3+1,rlo_3,BCZ_LO .eq. OUTLET) iend = cvmgt(hi_1 ,rhi_1,BCX_HI .eq. OUTLET) jend = cvmgt(hi_2 ,rhi_2,BCY_HI .eq. OUTLET) kend = cvmgt(hi_3 ,rhi_3,BCZ_HI .eq. OUTLET) do k = kstart,kend do j = jstart,jend do i = istart,iend dgphi(i,j,k) = $ (coeff(i ,j,k,1) * (phi(i+1,j,k) - phi(i,j,k)) + $ coeff(i-1,j,k,1) * (phi(i-1,j,k) - phi(i,j,k)) ) * facx + $ (coeff(i,j ,k,2) * (phi(i,j+1,k) - phi(i,j,k)) + $ coeff(i,j-1,k,2) * (phi(i,j-1,k) - phi(i,j,k)) ) * facy + $ (coeff(i,j,k ,3) * (phi(i,j,k+1) - phi(i,j,k)) + $ coeff(i,j,k-1,3) * (phi(i,j,k-1) - phi(i,j,k)) ) * facz mult = one mult = cvmgt(two*mult,mult, $ i.eq.lo_1 .and. (BCX_LO.eq.WALL.or.BCX_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.lo_2 .and. (BCY_LO.eq.WALL.or.BCY_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ k.eq.lo_3 .and. (BCZ_LO.eq.WALL.or.BCZ_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ i.eq.hi_1+1 .and. (BCX_HI.eq.WALL.or.BCX_HI.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.hi_2+1 .and. (BCY_HI.eq.WALL.or.BCY_HI.eq.INLET)) mult = cvmgt(two*mult,mult, $ k.eq.hi_3+1 .and. (BCZ_HI.eq.WALL.or.BCZ_HI.eq.INLET)) dgphi(i,j,k) = mult*dgphi(i,j,k) enddo enddo enddo return end c ************************************************************************* c ** SOLVEHG ** c ************************************************************************* subroutine FORT_SOLVEHG(dest,dest0,source,coeff,sum,r,w,z,work, $ DIMS,dx,bc, $ maxiter,norm,prob_norm,ng) implicit none integer DIMS integer ng REAL_T dest(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T dest0(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T source(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T coeff(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng,3) REAL_T sum(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T r(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T w(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T z(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T work(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T dx(3) integer bc(2,3) integer maxiter REAL_T norm REAL_T prob_norm REAL_T sum0 c Local variables REAL_T factor REAL_T alpha REAL_T beta REAL_T rho REAL_T rhol REAL_T local_norm REAL_T tol, tolfac integer i,j,k integer iter integer istrt,iend integer jstrt,jend integer kstrt,kend tolfac = 1.0d-3 istrt = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) call setperiodic(dest,DIMS,bc,ng) do k = lo_3-1,hi_3+2 do j = lo_2-1,hi_2+2 do i = lo_1-1,hi_1+2 dest0(i,j,k) = dest(i,j,k) dest(i,j,k) = zero enddo enddo enddo 10 call makedgphi(dest0,w,coeff,DIMS,dx,bc,ng,istrt,jstrt,kstrt,iend,jend,kend) rho = zero norm = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend r(i,j,k) = source(i,j,k) - w(i,j,k) enddo enddo enddo local_norm = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend factor = one factor = cvmgt(half*factor,factor,i.eq.lo_1 .or. i.eq.hi_1+1) factor = cvmgt(half*factor,factor,j.eq.lo_2 .or. j.eq.hi_2+1) factor = cvmgt(half*factor,factor,k.eq.lo_3 .or. k.eq.hi_3+1) local_norm = max(local_norm, abs(r(i,j,k))) z(i,j,k) = r(i,j,k) / sum(i,j,k) rho = rho + z(i,j,k) * r(i,j,k) * factor norm = max(norm,abs(r(i,j,k))) enddo enddo enddo tol = Max(tolfac*local_norm,1.0d-15*prob_norm) if (norm .le. tol) return do k = kstrt, kend do j = jstrt, jend do i = istrt, iend work(i,j,k) = zero dest(i,j,k) = z(i,j,k) enddo enddo enddo iter = 1 c write(6,1000) iter, norm/prob_norm 100 call setperiodic(dest,DIMS,bc,ng) call makedgphi(dest,w,coeff,DIMS,dx,bc,ng,istrt,jstrt,kstrt,iend,jend,kend) alpha = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend factor = one factor = cvmgt(half*factor,factor,i.eq.lo_1 .or. i.eq.hi_1+1) factor = cvmgt(half*factor,factor,j.eq.lo_2 .or. j.eq.hi_2+1) factor = cvmgt(half*factor,factor,k.eq.lo_3 .or. k.eq.hi_3+1) alpha = alpha + dest(i,j,k)*w(i,j,k) * factor enddo enddo enddo alpha = rho / alpha rhol = rho rho = zero norm = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend factor = one factor = cvmgt(half*factor,factor,i.eq.lo_1 .or. i.eq.hi_1+1) factor = cvmgt(half*factor,factor,j.eq.lo_2 .or. j.eq.hi_2+1) factor = cvmgt(half*factor,factor,k.eq.lo_3 .or. k.eq.hi_3+1) work(i,j,k) = work(i,j,k) + alpha * dest(i,j,k) r(i,j,k) = r(i,j,k) - alpha * w(i,j,k) z(i,j,k) = r(i,j,k) / sum(i,j,k) rho = rho + z(i,j,k) * r(i,j,k) * factor norm = max(norm,abs(r(i,j,k))) enddo enddo enddo iter = iter+1 c write(6,1000) iter, norm/prob_norm if (norm .le. tol) then do k = kstrt, kend do j = jstrt, jend do i = istrt, iend dest(i,j,k) = work(i,j,k) + dest0(i,j,k) enddo enddo enddo else if (iter .ge. maxiter .or. norm .ge. 100.d0*local_norm) then tolfac = 10.d0 * tolfac iter = 1 do k = kstrt, kend do j = jstrt, jend do i = istrt, iend dest(i,j,k) = zero enddo enddo enddo goto 10 else beta = rho / rhol do k = kstrt, kend do j = jstrt, jend do i = istrt, iend dest(i,j,k) = z(i,j,k) + beta * dest(i,j,k) enddo enddo enddo goto 100 endif 1000 format('Res/Res0 in solve: ',i4,2x,e12.5) c call flush(6) return end c ************************************************************************* c ** MAKESUM ** c ************************************************************************* subroutine FORT_MAKESUM(sum,coeff,DIMS,dx,bc,ng) implicit none integer DIMS integer ng REAL_T sum(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) REAL_T coeff(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng,3) REAL_T dx(3) integer bc(2,3) c Local variables integer i, j, k integer is, ie, js, je, ks, ke integer istrt,iend integer jstrt,jend integer kstrt,kend REAL_T facx, facy, facz REAL_T mult facx = one/(dx(1)*dx(1)) facy = one/(dx(2)*dx(2)) facz = one/(dx(3)*dx(3)) is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 istrt = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) do k = kstrt, kend do j = jstrt, jend do i = istrt, iend sum(i,j,k) = - ( $ (coeff(i,j,k,1) + coeff(i-1,j,k,1)) * facx + $ (coeff(i,j,k,2) + coeff(i,j-1,k,2)) * facy + $ (coeff(i,j,k,3) + coeff(i,j,k-1,3)) * facz ) mult = one mult = cvmgt(two*mult,mult, $ i.eq.is .and. (BCX_LO.eq.WALL.or.BCX_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.js .and. (BCY_LO.eq.WALL.or.BCY_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ k.eq.ks .and. (BCZ_LO.eq.WALL.or.BCZ_LO.eq.INLET)) mult = cvmgt(two*mult,mult, $ i.eq.ie+1 .and. (BCX_HI.eq.WALL.or.BCX_HI.eq.INLET)) mult = cvmgt(two*mult,mult, $ j.eq.je+1 .and. (BCY_HI.eq.WALL.or.BCY_HI.eq.INLET)) mult = cvmgt(two*mult,mult, $ k.eq.ke+1 .and. (BCZ_HI.eq.WALL.or.BCZ_HI.eq.INLET)) sum(i,j,k) = mult * sum(i,j,k) enddo enddo enddo return end c ************************************************************************* c ** SETPERIODIC ** c Impose periodic boundary conditions on the single grid data in the c conjugate gradient bottom solver. c ************************************************************************* subroutine setperiodic(dest,DIMS,bc,ng) implicit none integer DIMS integer ng REAL_T dest(lo_1-ng:hi_1+1+ng,lo_2-ng:hi_2+1+ng,lo_3-ng:hi_3+1+ng) integer bc(2,3) integer i,j,k if (BCX_LO .eq. PERIODIC .and. BCX_HI .eq. PERIODIC) then do k = lo_3,hi_3+1 do j = lo_2,hi_2+1 dest(hi_1+2,j,k) = dest(lo_1+1,j,k) dest(lo_1-1,j,k) = dest(hi_1 ,j,k) enddo enddo endif if (BCY_LO .eq. PERIODIC .and. BCY_HI .eq. PERIODIC) then do k = lo_3,hi_3+1 do i = lo_1,hi_1+1 dest(i,hi_2+2,k) = dest(i,lo_2+1,k) dest(i,lo_2-1,k) = dest(i,hi_2 ,k) enddo enddo endif if (BCZ_LO .eq. PERIODIC .and. BCZ_HI .eq. PERIODIC) then do j = lo_2,hi_2+1 do i = lo_1,hi_1+1 dest(i,j,hi_3+2) = dest(i,j,lo_3+1) dest(i,j,lo_3-1) = dest(i,j,hi_3 ) enddo enddo endif if (BCX_LO .eq. PERIODIC .and. BCX_HI .eq. PERIODIC .and. $ BCY_LO .eq. PERIODIC .and. BCY_HI .eq. PERIODIC) then do k = lo_3,hi_3+1 dest(lo_1-1,lo_2-1,k) = dest(hi_1,hi_2,k) dest(lo_1-1,hi_2+2,k) = dest(hi_1,lo_2+1,k) dest(hi_1+2,lo_2-1,k) = dest(lo_1+1,hi_2,k) dest(hi_1+2,hi_2+2,k) = dest(lo_1+1,lo_2+1,k) enddo endif if (BCX_LO .eq. PERIODIC .and. BCX_HI .eq. PERIODIC .and. $ BCZ_LO .eq. PERIODIC .and. BCZ_HI .eq. PERIODIC) then do j = lo_2,hi_2+1 dest(lo_1-1,j,lo_3-1) = dest(hi_1,j,hi_3) dest(lo_1-1,j,hi_3+2) = dest(hi_1,j,lo_3+1) dest(hi_1+2,j,lo_3-1) = dest(lo_1+1,j,hi_3) dest(hi_1+2,j,hi_3+2) = dest(lo_1+1,j,lo_3+1) enddo endif if (BCY_LO .eq. PERIODIC .and. BCY_HI .eq. PERIODIC .and. $ BCZ_LO .eq. PERIODIC .and. BCZ_HI .eq. PERIODIC) then do i = lo_1,hi_1+1 dest(i,lo_2-1,lo_3-1) = dest(i,hi_2,hi_3) dest(i,lo_2-1,hi_3+2) = dest(i,hi_2,lo_3+1) dest(i,hi_2+2,lo_3-1) = dest(i,lo_2+1,hi_3) dest(i,hi_2+2,hi_3+2) = dest(i,lo_2+1,lo_3+1) enddo endif if (BCX_LO .eq. PERIODIC .and. BCX_HI .eq. PERIODIC .and. & BCY_LO .eq. PERIODIC .and. BCY_HI .eq. PERIODIC .and. & BCZ_LO .eq. PERIODIC .and. BCZ_HI .eq. PERIODIC) then dest(lo_1-1,lo_1-1,lo_3-1) = dest(hi_1 ,hi_2 ,hi_3) dest(hi_1+2,lo_1-1,lo_3-1) = dest(lo_1+1,hi_2 ,hi_3) dest(lo_1-1,hi_2+2,lo_3-1) = dest(hi_1 ,lo_1+1,hi_3) dest(hi_1+2,hi_2+2,lo_3-1) = dest(lo_1+1,lo_1+1,hi_3) dest(lo_1-1,lo_1-1,hi_3+2) = dest(hi_1 ,hi_2 ,lo_3+1) dest(hi_1+2,lo_1-1,hi_3+2) = dest(lo_1+1,hi_2 ,lo_3+1) dest(lo_1-1,hi_2+2,hi_3+2) = dest(hi_1 ,lo_1+1,lo_3+1) dest(hi_1+2,hi_2+2,hi_3+2) = dest(lo_1+1,lo_1+1,lo_3+1) endif return end ccseapps-2.5/CCSEApps/pVarden/macproj.cpp0000644000175000017500000004464611634153073021433 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #include #include int mac_projector::numSmoothCoarsen = 2; int mac_projector::numSmoothRefine = 2; int mac_projector::ng = 4; // ************************************************************************ // ** constructor ** // ************************************************************************ mac_projector::mac_projector(const BoxArray& Grids, const Geometry& Geom, MultiFab* Area, MultiFab& Vol): grids(Grids), geom(Geom), area(Area), vol(Vol) { ParmParse pp("mac"); pp.get("tol",tol); pp.query("numSmoothCoarsen",numSmoothCoarsen); pp.query("numSmoothRefine",numSmoothRefine); ng = 2*std::max(numSmoothCoarsen,numSmoothRefine); } // ************************************************************************ // ** destructor ** // ************************************************************************ mac_projector::~mac_projector() { } // ************************************************************************ // ** project ** // ************************************************************************ void mac_projector::project(MultiFab * uadv, MultiFab * vadv, #if (BL_SPACEDIM == 3) MultiFab * wadv, #endif MultiFab * state, MultiFab * divu_src) { const Real* dx = geom.CellSize(); MultiFab* source = new MultiFab(grids,1,ng-1); MultiFab* resid = new MultiFab(grids,1,ng-1); MultiFab* phi = new MultiFab(grids,1,ng); phi->setVal(0.0); MultiFab* sigma[BL_SPACEDIM]; for (int n = 0; n < BL_SPACEDIM; n++) { BoxArray edge_grids(grids); edge_grids.surroundingNodes(n); sigma[n] = new MultiFab(edge_grids,1,ng-1); sigma[n]->setVal(0.); } Real rhsnorm = -1.e20; Real norm; for (MFIter mfi(*state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_INITSIGMA((*sigma[0])[mfi].dataPtr(),(*sigma[1])[mfi].dataPtr(), #if (BL_SPACEDIM == 3) (*sigma[2])[mfi].dataPtr(), #endif (*state)[mfi].dataPtr(Density), area[0][mfi].dataPtr(),area[1][mfi].dataPtr(), #if (BL_SPACEDIM == 3) area[2][mfi].dataPtr(), #endif ARLIM(lo),ARLIM(hi),bc[i].dataPtr(),&ng); // NOTE: The advection velocities are multiplied by area in this routine. FORT_RHSMAC((*uadv)[mfi].dataPtr(),(*vadv)[mfi].dataPtr(), #if (BL_SPACEDIM == 3) (*wadv)[mfi].dataPtr(), #endif (*divu_src)[mfi].dataPtr(),(*source)[mfi].dataPtr(), area[0][mfi].dataPtr(),area[1][mfi].dataPtr(), #if (BL_SPACEDIM == 3) area[2][mfi].dataPtr(), #endif vol[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),&norm,&ng); rhsnorm = std::max(rhsnorm, norm); } ParallelDescriptor::ReduceRealMax(rhsnorm); source->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*source,0,1,true); for (int n = 0; n < BL_SPACEDIM; n++) { sigma[n]->FillBoundary(0,1); geom.FillPeriodicBoundary(*sigma[n],0,1,true); } if (ParallelDescriptor::IOProcessor()) std::cout << std::endl << "MAC Source norm: " << rhsnorm << std::endl; if (rhsnorm > 1.e-16) { Real goal = tol*rhsnorm; macprojection_mg *solver = new macprojection_mg(grids,geom,phi,source,resid,sigma,dx); solver->solve(goal,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); const int is_rz = CoordSys::IsRZ(); for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); // NOTE: The advection velocities are divided by area in this routine. #if (BL_SPACEDIM == 2) FORT_PROJUMAC((*uadv)[mfi].dataPtr(), (*vadv)[mfi].dataPtr(), (*sigma[0])[mfi].dataPtr(),(*sigma[1])[mfi].dataPtr(), (*phi)[mfi].dataPtr(), area[0][mfi].dataPtr(),area[1][mfi].dataPtr(), dx,ARLIM(lo), ARLIM(hi),bc[i].dataPtr(),&is_rz,&ng); #elif (BL_SPACEDIM == 3) FORT_PROJUMAC((*uadv)[mfi].dataPtr(), (*vadv)[mfi].dataPtr(), (*wadv)[mfi].dataPtr(), (*sigma[0])[mfi].dataPtr(),(*sigma[1])[mfi].dataPtr(), (*sigma[2])[mfi].dataPtr(), (*phi)[mfi].dataPtr(), area[0][mfi].dataPtr(),area[1][mfi].dataPtr(),area[2][mfi].dataPtr(), dx,ARLIM(lo), ARLIM(hi),bc[i].dataPtr(),&ng); #endif } } delete phi; delete source; delete resid; for (int n = 0; n < BL_SPACEDIM; n++) delete sigma[n]; } // ************************************************************************ // ** constructor ** // ************************************************************************ macprojection_mg::macprojection_mg(const BoxArray& Grids, const Geometry& Geom, MultiFab* Phi, MultiFab* Source, MultiFab* Resid, MultiFab* Sigma[], const Real* Dx) : multigrid(Grids, Geom, Phi, Source, Resid) { for (int n = 0; n < BL_SPACEDIM; n++) sigma[n] = Sigma[n]; // Check whether we can coarsen all the grids separately int len = grids[0].length()[0]; for (int i = 0; i < grids.size(); i++) for (int n = 0; n < BL_SPACEDIM; n++) len = std::min(len,grids[i].length()[n]); bool is_odd = false; for (int i = 0; i < grids.size(); i++) for (int n = 0; n < BL_SPACEDIM; n++) if ( (grids[i].length()[n]&1) != 0 ) is_odd = true; Box prob_domain(grids.minimalBox()); // Check whether we can coarsen the domain as a whole int domain_len = prob_domain.length()[0]; for (int n = 1; n < BL_SPACEDIM; n++) domain_len = std::min(domain_len,prob_domain.length()[n]); bool domain_is_odd = false; for (int n = 0; n < BL_SPACEDIM; n++) if ( (prob_domain.length()[n]&1) != 0 ) domain_is_odd = true; // If any grid has an odd number of cells, or has reached its minimum // length in either direction, then we can not coarsen the grids // as such any further. If the domain as a whole can still be coarsened, // then we proceed with the domain as one grid. If not, then we // use a conjugate gradient bottom solver on a single grid. int ng = phi->nGrow(); if (domain_len < 4 || domain_is_odd) { Next = NULL; BL_ASSERT(grids.size() == 1); cgwork = new MultiFab(grids,5,1); for (MFIter mfi(*cgwork); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_MKSUMMAC((*cgwork)[mfi].dataPtr(), (*sigma[0])[mfi].dataPtr(), (*sigma[1])[mfi].dataPtr(), #if (BL_SPACEDIM == 3) (*sigma[2])[mfi].dataPtr(), #endif ARLIM(lo), ARLIM(hi),dx,&ng); } } else { cgwork = NULL; BoxArray newgrids; if (len < 8 || is_odd) { BoxList pd; pd.push_back(prob_domain); newgrids.define(pd); } else { newgrids.define(grids); } newgrids.coarsen(2); MultiFab* newphi = new MultiFab(newgrids,1,ng); newphi->setVal(0.0); Real newdx[BL_SPACEDIM]; for (int n = 0; n < BL_SPACEDIM; n++) newdx[n] = 2.0*dx[n]; Geometry newgeom; newgeom.define(BoxLib::coarsen(geom.Domain(),2)); MultiFab* newsigma[BL_SPACEDIM]; for (int n = 0; n < BL_SPACEDIM; n++) { BoxArray new_edge_grids(newgrids); new_edge_grids.surroundingNodes(n); newsigma[n] = new MultiFab(new_edge_grids,1,ng-1); } if (grids.size() == newgrids.size()) { // // In this case, the BoxArray newgrids is a coarsened version of grids. // for (MFIter sxmfi(*sigma[0]); sxmfi.isValid(); ++sxmfi) { int i = sxmfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* newlo = newgrids[i].loVect(); const int* newhi = newgrids[i].hiVect(); #if (BL_SPACEDIM == 2) FORT_COARSIGMA((*sigma[0])[sxmfi].dataPtr(),(*sigma[1])[sxmfi].dataPtr(), (*newsigma[0])[sxmfi].dataPtr(),(*newsigma[1])[sxmfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&ng); #elif (BL_SPACEDIM == 3) FORT_COARSIGMA((*sigma[0])[sxmfi].dataPtr(),(*sigma[1])[sxmfi].dataPtr(),(*sigma[2])[sxmfi].dataPtr(), (*newsigma[0])[sxmfi].dataPtr(),(*newsigma[1])[sxmfi].dataPtr(), (*newsigma[2])[sxmfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&ng); #endif } for (int n = 0; n < BL_SPACEDIM; n++) { newsigma[n]->FillBoundary(0,1); newgeom.FillPeriodicBoundary(*newsigma[n],0,1,true); } } else { // // In this case, there is only one grid (the size of the domain) // in the BoxArray newgrids. // BL_ASSERT(newgrids.size() == 1); BoxList pd; pd.push_back(prob_domain); BoxArray grids_mf(pd); MultiFab* sigma_mf[BL_SPACEDIM]; for (int n = 0; n < BL_SPACEDIM; n++) { BoxArray edge_grids(grids_mf); edge_grids.surroundingNodes(n); sigma_mf[n] = new MultiFab(edge_grids,1,ng-1); sigma_mf[n]->copy(*sigma[n],0,0,1); } for (MFIter sxmfi(*sigma_mf[0]); sxmfi.isValid(); ++sxmfi) { int i = sxmfi.index(); const int* lo = grids_mf[i].loVect(); const int* hi = grids_mf[i].hiVect(); const int* newlo = newgrids[i].loVect(); const int* newhi = newgrids[i].hiVect(); #if (BL_SPACEDIM == 2) FORT_COARSIGMA((*sigma_mf[0])[sxmfi].dataPtr(),(*sigma_mf[1])[sxmfi].dataPtr(), (*newsigma[0])[sxmfi].dataPtr(), (*newsigma[1])[sxmfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&ng); #elif (BL_SPACEDIM == 3) FORT_COARSIGMA((*sigma_mf[0])[sxmfi].dataPtr(),(*sigma_mf[1])[sxmfi].dataPtr(),(*sigma_mf[2])[sxmfi].dataPtr(), (*newsigma[0])[sxmfi].dataPtr(), (*newsigma[1])[sxmfi].dataPtr(), (*newsigma[2])[sxmfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&ng); #endif } for (int n = 0; n < BL_SPACEDIM; n++) delete sigma_mf[n]; for (int n = 0; n < BL_SPACEDIM; n++) newgeom.FillPeriodicBoundary(*newsigma[n],0,1,true); } Next = new macprojection_mg(newgrids, newgeom, newphi, new MultiFab(newgrids,1,ng-1), new MultiFab(newgrids,1,ng-1), newsigma, newdx); } next = Next; } // ************************************************************************ // ** destructor ** // ************************************************************************ macprojection_mg::~macprojection_mg() { if (Next != NULL) { delete Next->phi; delete Next->source; delete Next->resid; for (int n = 0; n < BL_SPACEDIM; n++) delete Next->sigma[n]; delete Next; } delete cgwork; } // ************************************************************************ // ** residual ** // ************************************************************************ Real macprojection_mg::residual() { Real norm = -1.e20; Real rnorm = -1.e20; int ng = phi->nGrow(); for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); int* bcptr = bc[i].dataPtr(); if (grids.size() == 1) bcptr = domain_bc; FORT_RESIDUAL((*resid)[mfi].dataPtr(),(*phi)[mfi].dataPtr(),(*source)[mfi].dataPtr(), (*sigma[0])[mfi].dataPtr(),(*sigma[1])[mfi].dataPtr(), #if (BL_SPACEDIM == 3) (*sigma[2])[mfi].dataPtr(), #endif ARLIM(lo),ARLIM(hi),dx,&norm,bcptr,&ng); rnorm = std::max(rnorm,norm); } resid->FillBoundary(0,1); ParallelDescriptor::ReduceRealMax(rnorm); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*resid,0,1,true); return rnorm; } // ************************************************************************ // ** step ** // ************************************************************************ void macprojection_mg::step(int nngsrb) { Real rnorm = 1.e10; int ng = phi->nGrow(); if (cgwork != NULL) { BL_ASSERT(grids.size() == 1); MultiFab dest0(grids,1,1); for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_SOLVEMAC((*phi)[mfi].dataPtr(), dest0[mfi].dataPtr(), (*source)[mfi].dataPtr(), (*sigma[0])[mfi].dataPtr(), (*sigma[1])[mfi].dataPtr(), #if (BL_SPACEDIM == 3) (*sigma[2])[mfi].dataPtr(), #endif (*cgwork)[mfi].dataPtr(0), (*cgwork)[mfi].dataPtr(1), (*cgwork)[mfi].dataPtr(2), (*cgwork)[mfi].dataPtr(3), (*cgwork)[mfi].dataPtr(4), ARLIM(lo),ARLIM(hi),dx,domain_bc,&rnorm,&prob_norm,&ng); } } else { for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); int* bcptr = bc[i].dataPtr(); if (grids.size() == 1) bcptr = domain_bc; FORT_RELAX((*phi)[mfi].dataPtr(),(*source)[mfi].dataPtr(), (*sigma[0])[mfi].dataPtr(),(*sigma[1])[mfi].dataPtr(), #if (BL_SPACEDIM == 3) (*sigma[2])[mfi].dataPtr(), #endif ARLIM(lo),ARLIM(hi),dx,bcptr,&nngsrb,&ng); } } // // Note that we choose to impose bc's after each time we modify phi, // as opposed to before each time we use it. // phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); } // ************************************************************************ // ** Restrict ** // ************************************************************************ void macprojection_mg::Restrict() { int nextra = resid->nGrow(); if (grids.size() == next->grids.size()) { for (MFIter mfi(*resid); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_RESTRICT((*resid)[mfi].dataPtr(), (*next->source)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic),&nextra); } } else { BoxList pd; Box prob_domain(grids.minimalBox()); pd.push_back(prob_domain); BoxArray grids_mf(pd); MultiFab res_mf(grids_mf,1,resid->nGrow()); res_mf.copy(*resid,0,0,1); for (MFIter mfi(res_mf); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids_mf[i].loVect(); const int* hi = grids_mf[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_RESTRICT(res_mf[mfi].dataPtr(), (*next->source)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic),&nextra); } } next->source->FillBoundary(0,1); if (next->geom.isAnyPeriodic()) next->geom.FillPeriodicBoundary(*next->source,0,1,true); } // ************************************************************************ // ** interpolate ** // ************************************************************************ void macprojection_mg::interpolate() { int ng = phi->nGrow(); if (grids.size() == next->grids.size()) { for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_INTERPOLATE((*phi)[mfi].dataPtr(), (*next->phi)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic),&ng); } } else { BoxList pd; Box prob_domain(grids.minimalBox()); pd.push_back(prob_domain); BoxArray grids_mf(pd); MultiFab phi_interp(grids_mf,1,phi->nGrow()); phi_interp.copy(*phi,0,0,1); for (MFIter mfi(phi_interp); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids_mf[i].loVect(); const int* hi = grids_mf[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_INTERPOLATE(phi_interp[mfi].dataPtr(), (*next->phi)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic),&ng); } phi->copy(phi_interp,0,0,1); } phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); } ccseapps-2.5/CCSEApps/pVarden/hgproj.cpp0000644000175000017500000004707311634153073021266 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #include #include #include int hg_projector::numSmoothCoarsen = 2; int hg_projector::numSmoothRefine = 2; int hg_projector::ng = 4; // ************************************************************************ // ** constructor ** // ************************************************************************ hg_projector::hg_projector(const BoxArray& Grids, const Geometry& Geom, MultiFab* Area, MultiFab& Vol) : grids(Grids), geom(Geom), area(Area), vol(Vol) { ParmParse pp("hg"); pp.get("tol",tol); pp.query("numSmoothCoarsen",numSmoothCoarsen); pp.query("numSmoothRefine",numSmoothRefine); ng = 2*std::max(numSmoothCoarsen,numSmoothRefine); } // ************************************************************************ // ** destructor ** // ************************************************************************ hg_projector::~hg_projector() { } // ************************************************************************ // ** project ** // ************************************************************************ void hg_projector::project(MultiFab * state, MultiFab * pressure, MultiFab * rho, MultiFab * divu_src, Real time, Real dt) { const Real* dx = geom.CellSize(); BoxArray nodal_grids(grids); nodal_grids.surroundingNodes(); MultiFab *sigma = new MultiFab(grids,1,ng); sigma->setVal(0.); #if (BL_SPACEDIM == 3) MultiFab *coeff = new MultiFab(nodal_grids,3,ng); coeff->setVal(0.); #endif MultiFab *phi = new MultiFab(nodal_grids,1,ng); MultiFab *source = new MultiFab(nodal_grids,1,ng); MultiFab *resid = new MultiFab(nodal_grids,1,ng); phi->setVal(0.0); source->setVal(0.); resid->setVal(0.); MultiFab::Copy(*sigma,vol,0,0,1,0); for (MFIter mfi(*sigma); mfi.isValid(); ++mfi) { int i = mfi.index(); (*sigma)[mfi].divide((*rho)[mfi],grids[i],0,0,1); } sigma->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*sigma,0,1,true); Real rhsnorm = -1.e20; Real norm = -1.e20; MultiFab gradp(grids,BL_SPACEDIM,1); gradient(&gradp,pressure); for (MFIter mfi(*state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); for (int n = 0; n < BL_SPACEDIM; n++) { gradp[mfi].divide((*rho)[mfi],grids[i],0,n,1); (*state)[mfi].plus(gradp[mfi],grids[i],n,n,1); } } state->FillBoundary(0,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*state,0,BL_SPACEDIM,true); int is_singular = 1; for (int n = 0; n < 2*BL_SPACEDIM; n++) if (domain_bc[n] == OUTLET) is_singular = 0; Real sum_src = 0.0; Real sum_fac = 0.0; for (MFIter mfi(*state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); Real ss = 0.; Real sf = 0.; FORT_RHSHG((*source)[mfi].dataPtr(),(*state)[mfi].dataPtr(), (*divu_src)[mfi].dataPtr(),vol[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),dx,bc[i].dataPtr(),&norm,&ng, &is_singular,&ss,&sf); sum_src += ss; sum_fac += sf; rhsnorm = std::max(rhsnorm,norm); } ParallelDescriptor::ReduceRealSum(sum_src); ParallelDescriptor::ReduceRealSum(sum_fac); ParallelDescriptor::ReduceRealMax(rhsnorm); if (is_singular == 1) { sum_src /= sum_fac; if (ParallelDescriptor::IOProcessor()) std::cout << "Singular adjustment for nodal projection is " << sum_src << std::endl; for (MFIter mfi(*source); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_ADJUSTRHS((*source)[mfi].dataPtr(),ARLIM(lo),ARLIM(hi), bc[i].dataPtr(), &ng,&sum_src); } } source->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*source,0,1,true); if (ParallelDescriptor::IOProcessor()) std::cout << "HG Source norm: " << rhsnorm << std::endl; if (rhsnorm > 1.e-16) { phi->setVal(0.0); Real goal = tol*rhsnorm; hgprojection_mg *solver = new hgprojection_mg(grids,geom,phi,source,resid,sigma, #if (BL_SPACEDIM == 3) coeff, #endif dx); solver->solve(goal,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; MultiFab gradphi(grids,BL_SPACEDIM,1); gradient(&gradphi,phi); for (MFIter mfi(*state); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_PROJUHG((*state)[mfi].dataPtr(), (*pressure)[mfi].dataPtr(), (*phi)[mfi].dataPtr(), gradphi[mfi].dataPtr(), (*rho)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),&ng); } } delete sigma; delete phi; delete source; delete resid; #if (BL_SPACEDIM == 3) delete coeff; #endif } // ************************************************************************ // ** gradient ** // ************************************************************************ void hg_projector::gradient(MultiFab * gradp, MultiFab * pressure) { const Real* dx = geom.CellSize(); for (MFIter pmfi(*pressure); pmfi.isValid(); ++pmfi) { int i = pmfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* p_lo = (*pressure)[pmfi].loVect(); const int* p_hi = (*pressure)[pmfi].hiVect(); const int* g_lo = (*gradp)[pmfi].loVect(); const int* g_hi = (*gradp)[pmfi].hiVect(); FORT_GRADHG((*gradp)[pmfi].dataPtr(),ARLIM(g_lo),ARLIM(g_hi), (*pressure)[pmfi].dataPtr(),ARLIM(p_lo),ARLIM(p_hi), ARLIM(lo),ARLIM(hi),dx); } if (gradp->nGrow() > 0) { gradp->FillBoundary(0,BL_SPACEDIM); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*gradp,0,BL_SPACEDIM,true); } } // ************************************************************************ // ** constructor ** // ************************************************************************ hgprojection_mg::hgprojection_mg(const BoxArray& Grids, const Geometry& Geom, MultiFab* Phi, MultiFab* Source, MultiFab* Resid, MultiFab* Sigma, #if (BL_SPACEDIM == 3) MultiFab* Coeff, #endif const Real* Dx) : multigrid(Grids, Geom, Phi, Source, Resid) { int i,n; int ng = Phi->nGrow(); sigma = Sigma; #if (BL_SPACEDIM == 3) coeff = Coeff; for (MFIter mfi(*coeff); mfi.isValid(); ++mfi) { i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_MKCOEFF((*coeff)[mfi].dataPtr(), (*sigma)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),&ng); } coeff->FillBoundary(0,3); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*coeff,0,3,true); #endif // If any grid has an odd number of cells, or has reached its minimum // length in either direction, then we can not coarsen the grids // as such any further. If the domain as a whole can still be coarsened, // then we proceed with the domain as one grid. If not, then we // use a conjugate gradient bottom solver on a single grid. // Check whether we can coarsen all the grids separately int len = grids[0].length()[0]; for (i = 0; i < grids.size(); i++) for (n = 0; n < BL_SPACEDIM; n++) len = std::min(len,grids[i].length()[n]); bool is_odd = false; for (i = 0; i < grids.size(); i++) for (n = 0; n < BL_SPACEDIM; n++) if ( (grids[i].length()[n]&1) != 0 ) is_odd = true; Box prob_domain(grids.minimalBox()); // Check whether we can coarsen the domain as a whole int domain_len = prob_domain.length()[0]; for (n = 1; n < BL_SPACEDIM; n++) domain_len = std::min(domain_len,prob_domain.length()[n]); bool domain_is_odd = false; for (n = 0; n < BL_SPACEDIM; n++) if ( (prob_domain.length()[n]&1) != 0 ) domain_is_odd = true; if (domain_is_odd || domain_len < 4) { Next = NULL; BoxList pd; Box prob_domain(grids.minimalBox()); pd.push_back(prob_domain); BoxArray grids_mf(pd); BoxArray nodal_grids_mf(grids_mf); nodal_grids_mf.surroundingNodes(); int ng = phi->nGrow(); cgwork = new MultiFab(nodal_grids_mf,5,ng); cgwork->setVal(0.); #if (BL_SPACEDIM == 3) for (MFIter mfi(*cgwork); mfi.isValid(); ++mfi) { i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); FORT_MAKESUM((*cgwork)[mfi].dataPtr(0), (*coeff)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),dx,domain_bc,&ng); } #endif } else { cgwork = NULL; BoxArray newgrids; if (len < 8 || is_odd) { BoxList pd; pd.push_back(prob_domain); newgrids.define(pd); } else { newgrids.define(grids); } newgrids.coarsen(2); Geometry newgeom; newgeom.define(BoxLib::coarsen(geom.Domain(),2)); BoxArray new_nodal_grids(newgrids); new_nodal_grids.surroundingNodes(); MultiFab* newsigma = new MultiFab(newgrids,1,ng); newsigma->setVal(0.); #if (BL_SPACEDIM == 3) MultiFab* newcoeff = new MultiFab(new_nodal_grids,3,ng); newcoeff->setVal(0.); #endif MultiFab* newphi = new MultiFab(new_nodal_grids,1,ng); MultiFab* newsource = new MultiFab(new_nodal_grids,1,ng); MultiFab* newresid = new MultiFab(new_nodal_grids,1,ng); newphi->setVal(0.0); newresid->setVal(0.); newsource->setVal(0.); if (grids.size() == newgrids.size()) { for (MFIter sigmfi(*sigma); sigmfi.isValid(); ++sigmfi) { i = sigmfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int* newlo = newgrids[i].loVect(); const int* newhi = newgrids[i].hiVect(); FORT_COARSIG((*sigma)[sigmfi].dataPtr(), (*newsigma)[sigmfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&ng); } newsigma->FillBoundary(0,1); } else { BoxList pd; pd.push_back(prob_domain); BoxArray grids_mf(pd); MultiFab sigma_mf(grids_mf,1,sigma->nGrow()); sigma_mf.copy(*sigma,0,0,1); for (MFIter sigmfi(sigma_mf); sigmfi.isValid(); ++sigmfi) { i = sigmfi.index(); const int* lo = grids_mf[i].loVect(); const int* hi = grids_mf[i].hiVect(); const int* newlo = newgrids[i].loVect(); const int* newhi = newgrids[i].hiVect(); FORT_COARSIG(sigma_mf[sigmfi].dataPtr(), (*newsigma)[sigmfi].dataPtr(), ARLIM(lo), ARLIM(hi), ARLIM(newlo), ARLIM(newhi),&ng); } } if (newgeom.isAnyPeriodic()) newgeom.FillPeriodicBoundary(*newsigma,0,1,true); Real newdx[BL_SPACEDIM]; for (n = 0; n < BL_SPACEDIM; n++) newdx[n]= 2.0*dx[n]; Next = new hgprojection_mg(newgrids, newgeom, newphi, newsource, newresid, newsigma, #if (BL_SPACEDIM == 3) newcoeff, #endif newdx); } next = Next; } // ************************************************************************ // ** destructor ** // ************************************************************************ hgprojection_mg::~hgprojection_mg() { if (Next != NULL) { delete Next->phi; delete Next->source; delete Next->resid; delete Next->sigma; #if (BL_SPACEDIM ==3 ) delete Next->coeff; #endif delete Next; } delete cgwork; } // ************************************************************************ // ** residual ** // ************************************************************************ Real hgprojection_mg::residual() { Real norm = -1.e20; Real rnorm = -1.e20; phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); int ng = phi->nGrow(); MultiFab dgphi(phi->boxArray(),1,ng); for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); #if (BL_SPACEDIM == 2) FArrayBox& fab = (*sigma)[mfi]; #elif (BL_SPACEDIM == 3) FArrayBox& fab = (*coeff)[mfi]; #endif int * bcptr = bc[i].dataPtr(); if (grids.size() == 1) bcptr = domain_bc; FORT_RESIDUAL((*resid)[mfi].dataPtr(),(*phi)[mfi].dataPtr(), (*source)[mfi].dataPtr(),fab.dataPtr(),dgphi[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),dx,&norm,bcptr,&ng); rnorm = std::max(rnorm,norm); } resid->FillBoundary(0,1); ParallelDescriptor::ReduceRealMax(rnorm); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*resid,0,1,true); return rnorm; } // ************************************************************************ // ** step ** // ************************************************************************ void hgprojection_mg::step(int nngsrb) { int maxiter = 100; int ng = phi->nGrow(); phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); if (cgwork != NULL) { BL_ASSERT(grids.size() == 1); Real resnorm = 0.0; MultiFab dest0(phi->boxArray(),1,ng); for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); #if (BL_SPACEDIM == 2) FArrayBox& fab = (*sigma)[mfi]; #elif (BL_SPACEDIM == 3) FArrayBox& fab = (*coeff)[mfi]; #endif FORT_SOLVEHG((*phi)[mfi].dataPtr(), dest0[mfi].dataPtr(), (*source)[mfi].dataPtr(), fab.dataPtr(), (*cgwork)[mfi].dataPtr(0), (*cgwork)[mfi].dataPtr(1), (*cgwork)[mfi].dataPtr(2), (*cgwork)[mfi].dataPtr(3), (*cgwork)[mfi].dataPtr(4), ARLIM(lo), ARLIM(hi), dx, domain_bc, &maxiter, &resnorm, &prob_norm, &ng); } } else { MultiFab temp(phi->boxArray(),1,ng); for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); #if (BL_SPACEDIM == 2) FArrayBox& fab = (*sigma)[mfi]; #elif (BL_SPACEDIM == 3) FArrayBox& fab = (*coeff)[mfi]; #endif int * bcptr = bc[i].dataPtr(); if (grids.size() == 1) bcptr = domain_bc; FORT_RELAX((*phi)[mfi].dataPtr(),(*source)[mfi].dataPtr(), fab.dataPtr(),temp[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),dx,bcptr,&nngsrb,&ng); } } phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); } // ************************************************************************ // ** Restrict ** // ************************************************************************ void hgprojection_mg::Restrict() { int ng = phi->nGrow(); if (grids.size() == next->grids.size()) { for (MFIter mfi(*resid); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); int * bcptr = bc[i].dataPtr(); if (grids.size() == 1) bcptr = domain_bc; FORT_RESTRICT((*resid)[mfi].dataPtr(), (*next->source)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic), bcptr, &ng); } next->source->FillBoundary(0,1); } else { BoxList pd; Box prob_domain(grids.minimalBox()); pd.push_back(prob_domain); BoxArray grids_mf(pd); BoxArray nodal_grids_mf(grids_mf); nodal_grids_mf.surroundingNodes(); MultiFab res_mf(nodal_grids_mf,1,resid->nGrow()); res_mf.setVal(0.); res_mf.copy(*resid,0,0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(res_mf,0,1,true); for (MFIter mfi(res_mf); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids_mf[i].loVect(); const int* hi = grids_mf[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_RESTRICT(res_mf[mfi].dataPtr(), (*next->source)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic), domain_bc, &ng); } } if (next->geom.isAnyPeriodic()) next->geom.FillPeriodicBoundary(*next->source,0,1,true); } // ************************************************************************ // ** interpolate ** // ************************************************************************ void hgprojection_mg::interpolate() { int ng = phi->nGrow(); if (grids.size() == next->grids.size()) { for (MFIter mfi(*phi); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_INTERP((*phi)[mfi].dataPtr(), (*next->phi)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic),&ng); } } else { BoxList pd; Box prob_domain(grids.minimalBox()); pd.push_back(prob_domain); BoxArray grids_mf(pd); BoxArray nodal_grids_mf(grids_mf); nodal_grids_mf.surroundingNodes(); MultiFab phi_interp(nodal_grids_mf,1,phi->nGrow()); phi_interp.copy(*phi,0,0,1); for (MFIter mfi(phi_interp); mfi.isValid(); ++mfi) { int i = mfi.index(); const int* lo = grids_mf[i].loVect(); const int* hi = grids_mf[i].hiVect(); const int * loc = next->grids[i].loVect(); const int * hic = next->grids[i].hiVect(); FORT_INTERP(phi_interp[mfi].dataPtr(), (*next->phi)[mfi].dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(loc),ARLIM(hic),&ng); } phi->copy(phi_interp,0,0,1); } phi->FillBoundary(0,1); if (geom.isAnyPeriodic()) geom.FillPeriodicBoundary(*phi,0,1,true); } ccseapps-2.5/CCSEApps/pVarden/multigrid.cpp0000644000175000017500000001211711634153073021764 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include int multigrid::debug = 0; int multigrid::verbose = 1; int multigrid::first_mg = 1; Real multigrid::prob_norm = 0.0; // ************************************************************************ // ** constructor ** // ************************************************************************ multigrid::multigrid(const BoxArray& Grids, Geometry Geom, MultiFab* Phi, MultiFab* Source, MultiFab* Resid) : grids(Grids), geom(Geom) { if (first_mg) { first_mg = 0; ParmParse pp("multigrid"); pp.query("debug",debug); pp.query("verbose",verbose); } // Set pointers to grids. phi = Phi; source = Source; resid = Resid; dx = geom.CellSize(); next = NULL; } // ************************************************************************ // ** constructor ** // ************************************************************************ multigrid::multigrid(const BoxArray& Grids, Geometry Geom, MultiFab* Phi, MultiFab* Source, MultiFab* Resid, MultiFab* Area[]) : grids(Grids), geom(Geom) { if (first_mg) { first_mg = 0; ParmParse pp("multigrid"); pp.query("debug",debug); pp.query("verbose",verbose); } // Set pointers to grids. phi = Phi; source = Source; resid = Resid; dx = geom.CellSize(); for (int n = 0; n < BL_SPACEDIM; n++) area[n] = Area[n]; next = NULL; } // ************************************************************************ // ** solve ** // ************************************************************************ void multigrid::solve(Real tol, Real Prob_norm, int nngsrb, int i2) { prob_norm = Prob_norm; int i = 1; Real rlast = residual(); Real res = rlast; if (rlast > tol) { while ((res = vcycle(tol,nngsrb,i2)) > tol) { i++; if ((verbose == 2 || debug != 0) && ParallelDescriptor::IOProcessor()) std::cout << "Res/Res0: " << res/prob_norm << " after " << i-1 << " iterations " << std::endl; } } if ((verbose >= 1 || debug != 0) && ParallelDescriptor::IOProcessor()) { std::cout << "Res/Res0: " << res/prob_norm << " after " << i << " iterations " << std::endl; std::cout << " " << std::endl; } } // ************************************************************************ // ** vcycle ** // ************************************************************************ Real multigrid::vcycle(Real tol, int nngsrb, int i2) { Box prob_domain(grids.minimalBox()); Real rnorm = residual(); if (debug && ParallelDescriptor::IOProcessor()) { std::cout << "Res/Res0 " << rnorm/prob_norm << " for " << prob_domain.length() << std::endl; } step(nngsrb); rnorm = residual(); if (debug && ParallelDescriptor::IOProcessor()) { std::cout << "Res/Res0 " << rnorm/prob_norm << " for " << prob_domain.length() << std::endl; } if (next != NULL) { Restrict(); next->phi->setVal(0.0); int downiter = nngsrb; int upiter = i2; next->vcycle(tol,downiter,upiter); interpolate(); if (debug) { rnorm = residual(); if (ParallelDescriptor::IOProcessor()) std::cout << "Res/Res0 " << rnorm/prob_norm << " for " << prob_domain.length() << std::endl; } step(i2); if (debug) { rnorm = residual(); if (ParallelDescriptor::IOProcessor()) std::cout << "Res/Res0 " << rnorm/prob_norm << " for " << prob_domain.length() << std::endl; } } return rnorm; } ccseapps-2.5/CCSEApps/pVarden/scalupd_3d.F0000644000175000017500000001040311634153073021404 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** SCALUPD ** c ** Update the scalars using conservative or convective differencing of fluxes c ************************************************************************* subroutine scalupd(s,sn,sedgex,sedgey,sedgez,uadv,vadv,wadv,diff,force, $ areax,areay,areaz,vol,DIMS,dx,dt,is_conserv,numscal) implicit none integer DIMS integer numscal REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal) REAL_T sn(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal) REAL_T sedgex(lo_1 :hi_1+1,lo_2 :hi_2 ,lo_3 :hi_3 ,numscal) REAL_T sedgey(lo_1 :hi_1 ,lo_2 :hi_2+1,lo_3 :hi_3 ,numscal) REAL_T sedgez(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1,numscal) REAL_T uadv(lo_1 :hi_1+1,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T vadv(lo_1 :hi_1 ,lo_2 :hi_2+1,lo_3 :hi_3 ) REAL_T wadv(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1) REAL_T diff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T areax(lo_1 :hi_1+1,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T areay(lo_1 :hi_1 ,lo_2 :hi_2+1,lo_3 :hi_3 ) REAL_T areaz(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1) REAL_T vol(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T dx(3) REAL_T dt integer is_conserv(numscal) c Local variables REAL_T divsu REAL_T uconv REAL_T vconv REAL_T wconv integer i,j,k,n do n = 1, numscal if (is_conserv(n) .eq. 1) then do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 divsu = ( sedgex(i+1,j,k,n)*uadv(i+1,j,k)*areax(i+1,j,k) - $ sedgex(i ,j,k,n)*uadv(i ,j,k)*areax(i ,j,k) + $ sedgey(i,j+1,k,n)*vadv(i,j+1,k)*areay(i,j+1,k) - $ sedgey(i,j ,k,n)*vadv(i,j ,k)*areay(i,j ,k) + $ sedgez(i,j,k+1,n)*wadv(i,j,k+1)*areaz(i,j,k+1) - $ sedgez(i,j,k ,n)*wadv(i,j,k )*areaz(i,j,k ) ) / vol(i,j,k) sn(i,j,k,n) = s(i,j,k,n) - dt*divsu + half*dt*diff(i,j,k,n)+dt*force(i,j,k,n) enddo enddo enddo else do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 uconv = half * (uadv(i+1,j,k) + uadv(i,j,k)) vconv = half * (vadv(i,j+1,k) + vadv(i,j,k)) wconv = half * (wadv(i,j,k+1) + wadv(i,j,k)) divsu = uconv * (sedgex(i+1,j,k,n) - sedgex(i,j,k,n)) / dx(1) + $ vconv * (sedgey(i,j+1,k,n) - sedgey(i,j,k,n)) / dx(2) + $ wconv * (sedgez(i,j,k+1,n) - sedgez(i,j,k,n)) / dx(3) sn(i,j,k,n) = s(i,j,k,n) - dt*divsu + half*dt*diff(i,j,k,n) + dt*force(i,j,k,n) enddo enddo enddo endif enddo return end ccseapps-2.5/CCSEApps/pVarden/mkdivu_3d.F0000644000175000017500000000560011634153073021253 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKDIVUCC ** c ** Define the RHS of the cell-centered divergence constraint c *************************************************************** subroutine FORT_MKDIVUCC(divu_src,u,rho,time,dx,DIMS) implicit none integer DIMS REAL_T divu_src(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) REAL_T rho(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3) REAL_T time REAL_T dx(3) c Local variables integer i,j,k do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 divu_src(i,j,k) = zero enddo enddo enddo return end c ************************************************************************* c ** MKDIVUNOD ** c ** Define the RHS of the node-centered divergence constraint c *************************************************************** subroutine FORT_MKDIVUNOD(divu_src,u,rho,time,dx,DIMS) implicit none integer DIMS REAL_T divu_src(lo_1 :hi_1+1,lo_2 :hi_2+1,lo_3 :hi_3+1) REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,3) REAL_T rho(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3) REAL_T time REAL_T dx(3) c Local variables integer i,j,k do k = lo_3,hi_3+1 do j = lo_2,hi_2+1 do i = lo_1,hi_1+1 divu_src(i,j,k) = zero enddo enddo enddo return end ccseapps-2.5/CCSEApps/pVarden/OpenSource.txt0000644000175000017500000002434711634153073022113 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: VarDen Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/pVarden/mkforce_2d.F0000644000175000017500000000611611634153073021404 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKFORCE ** c ** Define the forcing terms in the momentum equation c *************************************************************** subroutine FORT_MKFORCE(force,u,rho,gravity,visc_coef,time,dx,DIMS) implicit none integer DIMS REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T u(lo_1-3:hi_1+3,lo_2-3:hi_2+3,2) REAL_T rho(lo_1-3:hi_1+3,lo_2-3:hi_2+3) REAL_T gravity REAL_T time REAL_T dx(2) REAL_T visc_coef c Local variables integer i,j do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 force(i,j,1) = zero force(i,j,2) = gravity enddo enddo return end #include "ArrayLim.H" subroutine FORT_KINE(u,DIMS(u),xmean,ymean,tix,tiy,lo,hi) implicit none integer DIMDEC(u) integer lo(2), hi(2) REAL_T u(DIMV(u),2) REAL_T xmean,ymean,tix,tiy integer i,j do j = lo(2),hi(2) do i = lo(1),hi(1) xmean = xmean + u(i,j,1) ymean = ymean + u(i,j,2) tix = tix + u(i,j,1)**2 tiy = tiy + u(i,j,2)**2 enddo enddo end subroutine FORT_WRITEVEL(u,DIMS(u),lo,hi,psize) implicit none integer DIMDEC(u) integer lo(2), hi(2) REAL_T u(DIMV(u),2) REAL_T psize(2) integer i,j,n open(3,file='Turb',form='formatted') rewind 3 write(3,*)hi(1)-lo(1)+1,hi(2)-lo(2)+1,1 write(3,*)psize(1),psize(2),1.d0 write(3,*)1,1,1 do n = 1,3 do j = lo(2),hi(2) do i = lo(1),hi(1) write(3,*)u(i,j,n) enddo enddo enddo close(3) end ccseapps-2.5/CCSEApps/pVarden/mkscalforce_3d.F0000644000175000017500000000417311634153073022251 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKFORCE ** c ** Define the forcing terms in the momentum equation c *************************************************************** subroutine FORT_MKSCALFORCE(force,s,time,dx,DIMS,numscal) implicit none integer DIMS integer numscal REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3,lo_3-3:hi_3+3,numscal) REAL_T time REAL_T dx(3) c Local variables integer i,j,k,n do n = 1,numscal do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 force(i,j,k,n) = zero enddo enddo enddo enddo return end ccseapps-2.5/CCSEApps/pVarden/probin30000644000175000017500000000006211634153073020553 0ustar amckinstryamckinstry $fortin prob_type = 3 zero_dir = 3 $end ccseapps-2.5/CCSEApps/pVarden/globals.H0000644000175000017500000000263211634153073021015 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GLOBALS_H_ #define _GLOBALS_H_ extern Real gravity; extern int domain_bc[2*BL_SPACEDIM]; extern Array< Array > bc; #endif ccseapps-2.5/CCSEApps/varden2d/0000755000175000017500000000000011634153073017364 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/varden2d/setscalbc.F0000644000175000017500000001206411634153073021441 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #if BL_USE_FLOAT #define threehalves 1.5e0 #else #define threehalves 1.5d0 #endif #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** SETSCALBC ** c ** Impose the physical boundary conditions on scalars s c ************************************************************************* subroutine setscalbc(s,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi, $ irz,which_scal,dx,time) implicit none integer DIMS integer which_scal integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer irz REAL_T dx(2) REAL_T time REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1) c Local variables integer is,ie,js,je,i,j is = lo_1 ie = hi_1 js = lo_2 je = hi_2 if (bcy_lo .eq. PERIODIC) then do i = is,ie s(i,js-1)=s(i,je) enddo elseif (bcy_lo .eq. WALL) then c NOTE: THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL BOUNDARY, c NOT IN THE GHOST CELL do i = is,ie c s(i,js-1) = threehalves*s(i,js) - half*s(i,js+1) s(i,js-1) = s(i,js) enddo elseif (bcy_lo .eq. INLET) then call scalinflow(s,DIMS,time,dx(1),1,0,which_scal) elseif (bcy_lo .eq. OUTLET) then do i = is,ie c s(i,js-1) = threehalves*s(i,js) - half*s(i,js+1) s(i,js-1) = s(i,js) enddo endif if (bcy_hi .eq. PERIODIC) then do i = is,ie s(i,je+1)=s(i,js) enddo elseif (bcy_hi .eq. WALL) then c NOTE: THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL BOUNDARY, c NOT IN THE GHOST CELL do i = is,ie c s(i,je+1) = threehalves*s(i,je) - half*s(i,je-1) s(i,je+1) = s(i,je) enddo elseif (bcy_hi .eq. INLET) then call scalinflow(s,DIMS,time,dx(1),1,1,which_scal) elseif (bcy_hi .eq. OUTLET) then do i = is,ie c s(i,je+1) = threehalves*s(i,je) - half*s(i,je-1) s(i,je+1) = s(i,je) enddo endif if (bcx_lo .eq. PERIODIC) then do j = js-1,je+1 s(is-1,j) = s(ie,j) enddo elseif (bcx_lo .eq. WALL) then c NOTE: THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL BOUNDARY, c NOT IN THE GHOST CELL if (irz .eq. 1) then do j = js-1,je+1 s(is-1,j) = s(is,j) enddo else do j = js-1,je+1 c s(is-1,j) = threehalves*s(is,j) - half*s(is+1,j) s(is-1,j) = s(is,j) enddo endif elseif (bcx_lo .eq. INLET) then call scalinflow(s,DIMS,time,dx(2),0,0,which_scal) elseif (bcx_lo .eq. OUTLET) then do j = js-1,je+1 c s(is-1,j) = threehalves*s(is,j) - half*s(is+1,j) s(is-1,j) = s(is,j) enddo endif if (bcx_hi .eq. PERIODIC) then do j = js-1,je+1 s(ie+1,j) = s(is,j) enddo elseif (bcx_hi .eq. WALL) then c NOTE: THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL BOUNDARY, c NOT IN THE GHOST CELL if (irz .eq. 1) then do j = js-1,je+1 c s(ie+1,j) = threehalves*s(ie,j) - half*s(ie-1,j) s(ie+1,j) = s(ie,j) enddo else do j = js-1,je+1 c s(ie+1,j) = threehalves*s(ie,j) - half*s(ie-1,j) s(ie+1,j) = s(ie,j) enddo endif elseif (bcx_hi .eq. INLET) then call scalinflow(s,DIMS,time,dx(2),0,1,which_scal) elseif (bcx_hi .eq. OUTLET) then do j = js-1,je+1 c s(ie+1,j) = threehalves*s(ie,j) - half*s(ie-1,j) s(ie+1,j) = s(ie,j) enddo endif return end ccseapps-2.5/CCSEApps/varden2d/Make.package0000644000175000017500000000123411634153073021556 0ustar amckinstryamckinstryCODE_C_SOURCES = \ macproj.cpp hgproj.cpp main.cpp Grid.cpp \ multigrid.cpp diffuser.cpp Contour.cpp ContFrame.cpp CODE_C_HEADERS = \ macproj.H hgproj.H Grid.H globals.H \ multigrid.H diffuser.H Contour.H ContFrame.H CODE_F_SOURCES = \ cmpdt.F laplac.F setscalbc.F \ mac.F prob.F slopex.F slopey.F \ visc.F scalupd.F velupd.F mkdivunod.F \ hg.F setvelbc.F xinit.F mkdivucc.F \ mkadvvel.F mkvelflux.F mkscaflux.F mkforce.F \ mkscalforce.F CODE_F_HEADERS = MACPROJ_F.H HGPROJ_F.H VISC_F.H GRID_F.H probdata.H CEXE_sources += $(CODE_C_SOURCES) FEXE_sources += $(CODE_F_SOURCES) CEXE_headers += $(CODE_C_HEADERS) FEXE_headers += $(CODE_F_HEADERS) ccseapps-2.5/CCSEApps/varden2d/probin10000644000175000017500000000006611634153073020663 0ustar amckinstryamckinstry $fortin prob_type = 1 velfact = 1.0 $end ccseapps-2.5/CCSEApps/varden2d/main.cpp0000644000175000017500000001550011634153073021015 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #include #include #ifdef HAS_WINDOWS #include "Contour.H" #endif // declare global variables here Real init_shrink = 1.0; Real gravity = 0.0; int bcx_lo; int bcx_hi; int bcy_lo; int bcy_hi; int irz; const int * lo; const int * hi; Real * x; Real * xhalf; typedef char* charString; // functions called void print_usage(int,char**); void parse_command_line(int, char**, charString&, charString&); void writePlotFile(Grid *, int, Real, std::string&); // ################################################################### // ##### MAIN PROGRAM // ################################################################### main(int argc, char *argv[]) { BoxLib::Initialize(argc,argv); charString in_file = NULL; charString res_file = NULL; parse_command_line(argc,argv,in_file,res_file); ParmParse pp; int max_step; Real stop_time; Real cfl; int check_int; int plot_int; std::string check_file_root = "chk"; std::string plot_file_root = "plt"; pp.get("max_step",max_step); pp.get("stop_time",stop_time); pp.get("cfl",cfl); pp.query("init_shrink",init_shrink); pp.query("gravity",gravity); pp.get("check_int",check_int); pp.query("check_file_root",check_file_root); pp.get("plot_int",plot_int); pp.query("plot_file_root",plot_file_root); std::string probin_file; if (pp.contains("probin_file")) { pp.get("probin_file",probin_file); } pp.get("bcx_lo",bcx_lo); pp.get("bcx_hi",bcx_hi); pp.get("bcy_lo",bcy_lo); pp.get("bcy_hi",bcy_hi); pp.get("irz",irz); if (irz && bcx_lo != WALL) { std::cout << "Must have bcx = 2 for r-z geometry " << std::endl; exit(0); } if (bcx_lo == PERIODIC && bcx_hi != PERIODIC) { std::cout << "IF bcx_lo is periodic then bcx_hi must be periodic " << std::endl; exit(0); } if (bcx_hi == PERIODIC && bcx_lo != PERIODIC) { std::cout << "IF bcx_hi is periodic then bcx_lo must be periodic " << std::endl; exit(0); } if (bcy_lo == PERIODIC && bcy_hi != PERIODIC) { std::cout << "IF bcy_lo is periodic then bcy_hi must be periodic " << std::endl; exit(0); } if (bcy_hi == PERIODIC && bcy_lo != PERIODIC) { std::cout << "IF bcy_hi is periodic then bcy_lo must be periodic " << std::endl; exit(0); } #ifdef HAS_WINDOWS Contour contour; #endif Grid* grid = new Grid(probin_file); Real time = 0.0; Real dt = 0.0; int nstep = 0; grid->init(nstep,time,dt); // First do the iterations to calculate an initial pressure if (nstep == 0) { dt = std::min(init_shrink * grid->estimateDt(dt,cfl), stop_time - time); grid->initialIter(time,dt); grid->writeCheckPoint(nstep,time,dt,check_file_root); } writePlotFile(grid,nstep,time,plot_file_root); #ifdef HAS_WINDOWS // draw initial data contour.drawCont(*grid,nstep,time); #endif int last_checkpoint = nstep; int last_plotpoint = nstep; while (nstep < max_step && time <= stop_time - 1.e-10) { if (nstep > 0) dt = std::min(grid->estimateDt(dt,cfl), stop_time - time); nstep++; // do a timestep grid->advance(time, dt); time += dt; std::cout << "STEP = " << nstep << " TIME = " << time; std::cout << " DT = " << dt << std::endl; #ifdef HAS_WINDOWS // draw contour graphics on the fly contour.drawCont(*grid,nstep,time); #endif // checkpoint file? if (check_int > 0 && nstep%check_int == 0) { last_checkpoint = nstep; grid->writeCheckPoint(nstep,time,dt,check_file_root); }; if (plot_int > 0 && nstep%plot_int == 0) { last_plotpoint = nstep; writePlotFile(grid,nstep,time,plot_file_root); }; }; // dump final checkpoint file if needed if (nstep != last_checkpoint) { grid->writeCheckPoint(nstep,time,dt,check_file_root); }; // dump final pltfile file if needed if (nstep != last_plotpoint) { writePlotFile(grid,nstep,time,plot_file_root); }; // clean up memory usage delete grid; #ifdef HAS_WINDOWS if (contour.doingContour()) { std::cout << "Enter to end program" << std::endl; while (std::cin.get() != '\n'); // contour.clear(); } #endif BoxLib::Finalize(); } // ################################################################### // ##### print_usage // ################################################################### void print_usage(int /* argc */, char *argv[]) { std::cerr << "usage:\n"; std::cerr << argv[0] << " infilename " << std::endl; std::cerr << "\n"; exit(1); } // ################################################################### // ##### parse_command_line // ################################################################### void parse_command_line(int argc, char *argv[], charString &in_file, charString &res_file) { // first input must be input file name if (argc < 2) print_usage(argc,argv); if (argv[1][0] == '-') { std::cerr << "first command line argument must be file name\n"; print_usage(argc,argv); }; in_file = argv[1]; } // ################################################################### // ##### writePlotFile // ################################################################### void writePlotFile(Grid* grid, int nstep, Real time, std::string& plot_file_root) { grid->writePlotFile(nstep,time, plot_file_root); } ccseapps-2.5/CCSEApps/varden2d/VISC_F.H0000644000175000017500000001240711634153073020512 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_XINIT xinit # define FORT_INITSIGV initsigv # define FORT_COARSIGV coarsesigv # define FORT_RESID resv # define FORT_RHSNORM frhsnorm # define FORT_GSRBV gsrbv # define FORT_RESTRICT coarsev # define FORT_INTERPOLATE interpv #else #if defined(BL_FORT_USE_UNDERSCORE) # define FORT_XINIT xinit_ # define FORT_INITSIGV initsigv_ # define FORT_COARSIGV coarsesigv_ # define FORT_RESID resv_ # define FORT_RHSNORM frhsnorm_ # define FORT_GSRBV gsrbv_ # define FORT_RESTRICT coarsev_ # define FORT_INTERPOLATE interpv_ #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_XINIT XINIT # define FORT_INITSIGV INITSIGV # define FORT_COARSIGV COARSESIGV # define FORT_RESID RESV # define FORT_RHSNORM FRHSNORM # define FORT_GSRBV GSRBV # define FORT_RESTRICT COARSEV # define FORT_INTERPOLATE INTERPV #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_XINIT xinit # define FORT_INITSIGV initsigv # define FORT_COARSIGV coarsesigv # define FORT_RESID resv # define FORT_RHSNORM frhsnorm # define FORT_GSRBV gsrbv # define FORT_RESTRICT coarsev # define FORT_INTERPOLATE interpv #endif extern "C" { void FORT_XINIT(Real * x, Real * xhalf, Real * hx, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, int * irz); void FORT_RHSNORM(Real * staten, Real * source, const int & lo_mg_1, const int & lo_mg_2, const int & hi_mg_1, const int & hi_mg_2, Real * rhsnorm, Real * uinx_lo, Real * uinx_hi, Real * uiny_lo, Real * uiny_hi); void FORT_INITSIGV(Real * sigma , Real * rho, Real * mu, const int & lo_mg_1, const int & lo_mg_2, const int & hi_mg_1, const int & hi_mg_2, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); void FORT_RESID(Real * resid, Real * phi, Real * source, Real * sigma, Real * uinx_lo, Real * uinx_hi, Real * uiny_lo, Real * uiny_hi, Real * x_mg, Real * xhalf_mg, const int & lo_mg_1, const int & lo_mg_2, const int & hi_mg_1, const int & hi_mg_2, Real * hx, Real * hy, Real * rnorm, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * level, int * irz, int * idir); void FORT_COARSIGV(Real * sigma, Real * sigma_crse, const int & lo_mg_1, const int & lo_mg_2, const int & hi_mg_1, const int & hi_mg_2, const int & loc_mg_1, const int & loc_mg_2, const int & hic_mg_1, const int & hic_mg_2, Real * x_mg); void FORT_GSRBV(Real * phi, Real * source, Real * sigma, Real * uinx_lo, Real * uinx_hi, Real * uiny_lo, Real * uiny_hi, Real * x_mg, Real * xhalf_mg, const int & lo_mg_1, const int & lo_mg_2, const int & hi_mg_1, const int & hi_mg_2, Real * hx, Real * hy, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * level, int * irz, int * idir, int * nngsrb); void FORT_RESTRICT(Real * res, Real * resc, const int & lo_mg_1, const int & lo_mg_2, const int & hi_mg_1, const int & hi_mg_2, const int & loc_mg_1, const int & loc_mg_2, const int & hic_mg_1, const int & hic_mg_2, Real * x_mg); void FORT_INTERPOLATE(Real * phi, Real * deltac, const int & lo_mg_1, const int & lo_mg_2, const int & hi_mg_1, const int & hi_mg_2, const int & loc_mg_1, const int & loc_mg_2, const int & hic_mg_1, const int & hic_mg_2); }; #endif ccseapps-2.5/CCSEApps/varden2d/mkdivunod.F0000644000175000017500000000412511634153073021475 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKDIVUNOD ** c ** Define the RHS of the node-centered divergence constraint c *************************************************************** subroutine FORT_MKDIVUNOD(divu_src,u,v,rho,time,dx,DIMS) implicit none integer DIMS REAL_T divu_src(lo_1 :hi_1+1,lo_2 :hi_2+1) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T time REAL_T dx(2) c Local variables integer i,j do j = lo_2,hi_2+1 do i = lo_1,hi_1+1 divu_src(i,j) = zero enddo enddo return end ccseapps-2.5/CCSEApps/varden2d/hgproj.H0000644000175000017500000000710611634153073020772 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "multigrid.H" // //@Man: //@Memo: Nodal projection class for end-of-time-step nodal projection /*@ManDoc: This class handles the nodal projection of the new-time velocity. It computes RHS = D(V), and sends the RHS and coefficients sigma = 1/rho to the hgprojection_mg class, which solves the linear system using multigrid. */ class hg_projector { //@ManDoc: Problem domain in index space Box domain; //@ManDoc: Mesh spacing in x-direction Real hx; //@ManDoc: Mesh spacing in y-direction Real hy; //@ManDoc: Pressure update FArrayBox *phi; //@ManDoc: Tolerance to which DG(phi) = RHS should be solved Real tol; //@ManDoc: number of smoothing steps as you coarsen static int numSmoothCoarsen; //@ManDoc: number of smoothing steps as you refine static int numSmoothRefine; public: //@ManDoc: Constructor hg_projector(const Box& Domain, Real * dx); //@ManDoc: Destructor ~hg_projector(); //@ManDoc: Do the nodal projection void project(FArrayBox * state, FArrayBox * gradp, FArrayBox * rhonph, FArrayBox * divu_src, Real time, Real dt); //@ManDoc: Compute the pressure gradient at cell centers void gradient(FArrayBox & gradp, FArrayBox & pressure); }; //@ManDoc: The multigrid solver for the nodal projection class hgprojection_mg : public multigrid { //@Memo: Multigrid solver for nodal projection //@ManDoc: Coefficient array = 1 / rho FArrayBox * sigma; //@ManDoc: Next coarser multigrid level hgprojection_mg *Next; //@ManDoc: Scratch space for the conjugate gradient bottom solver FArrayBox * cgwork; //@ManDoc: Compute the residual R = RHS - DG(phi) Real residual(); //@ManDoc: Relax on the residual equation, updating phi void step(int); //@ManDoc: Coarsen the residual to the next coarser multigrid level void Restrict(); //@ManDoc: Interpolate the solution from the next coarser multigrid level void interpolate(); public: //@ManDoc: Constructor hgprojection_mg(const Box & Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Residual, FArrayBox * Sigma, Real Hx, Real Hy); //@ManDoc: Destructor ~hgprojection_mg(); }; ccseapps-2.5/CCSEApps/varden2d/GNUmakefile0000644000175000017500000000313511634153073021440 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.12 2002/10/28 18:18:34 almgren Exp $ # PRECISION = DOUBLE PROFILE = FALSE COMP = g++ DEBUG = TRUE DIM = 2 USE_MPI = FALSE USE_GRAPHTOOL = TRUE USE_ARRAYVIEW = FALSE # # Base name of the executable. # EBASE = run PBOXLIB_HOME = .. GRAPHTOOL_HOME = ./graphtool # # Where libraries and include files will be installed. # include ../mk/Make.defs ./Make.package include ../BoxLib/Make.package INCLUDE_LOCATIONS += . ../BoxLib ifeq ($(USE_GRAPHTOOL),TRUE) include ./graphtool/Make.package DEFINES += -DHAS_WINDOWS INCLUDE_LOCATIONS += $(GRAPHTOOL_HOME) INCLUDE_LOCATIONS += /usr/X11R6/include LIBRARY_LOCATIONS += /usr/X11R6/lib LIBRARIES += -lX11 endif # # ArrayView # ifeq (USE_ARRAYVIEW, TRUE) DEFINES += -DBL_USE_ARRAYVIEW INCLUDE_LOCATIONS += . LIBRARIES += -lX11 endif ifeq ($(MACHINE), OSF1) # # Some additional stuff for our preferred development/debugging environment. # ifeq ($(PRECISION), DOUBLE) FFLAGS += -real_size 64 endif FDEBF += -C FDEBF += -warn argument_checking FDEBF += -warn declarations ifneq ($(FC), f90) FDEBF += -warn truncated_source FDEBF += -warn unused endif endif ifeq ($(USE_GRAPHTOOL),TRUE) vpath %.cpp . ../BoxLib ./graphtool else vpath %.cpp . ../BoxLib endif vpath %.F . vpath %.f . ../BoxLib all: $(executable) libs: cd $(PBOXLIB_HOME)/BoxLib; \ make PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) \ DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install cd $(GRAPHTOOL_HOME); \ make PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) \ DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install include ../mk/Make.rules ccseapps-2.5/CCSEApps/varden2d/macproj.H0000644000175000017500000000713511634153073021136 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "multigrid.H" // //@Man: //@Memo: Projection class for intermediate MAC projection /*@ManDoc: This class handles the MAC projection of the intermediate edge-based advection velocity. It computes RHS = D(V), and sends the RHS and coefficients sigma = 1/rho to the macprojection_mg class, which solves the linear system using multigrid. */ class mac_projector { //@ManDoc: Un-buffered grid box Box domain; //@ManDoc: Mesh spacing in x-direction Real hx; //@ManDoc: Mesh spacing in y-direction Real hy; //@ManDoc: Tolerance to which DG(phi) = RHS should be solved Real tol; //@ManDoc: number of smoothing steps as you coarsen static int numSmoothCoarsen; //@ManDoc: number of smoothing steps as you refine static int numSmoothRefine; public: //@ManDoc: Constructor mac_projector(const Box& Domain, Real * dx); //@ManDoc: Destructor ~mac_projector(); //@ManDoc: Do the MAC projection void project(Real * uadv, Real * vadv, Real * rho, FArrayBox& divu_src); }; //@ManDoc: Multigrid solver for the intermediate MAC projection class macprojection_mg : public multigrid { //@Memo: Multigrid solver for MAC projection //@ManDoc: One-dimensional radius array at cell centers Real * x_mg; //@ManDoc: One-dimensional radius array at nodes Real * xhalf_mg; //@ManDoc: Coefficient array on x-edges FArrayBox * sigmax; //@ManDoc: Coefficient array on y-edges FArrayBox * sigmay; //@ManDoc: Next coarser multigrid level macprojection_mg *Next; //@ManDoc: Scratch space for the conjugate gradient bottom solver FArrayBox *cgwork; //@ManDoc: Compute the residual R = RHS - DG(phi) Real residual(); //@ManDoc: Relax on the residual equation, updating phi void step(int); //@ManDoc: Coarsen the residual to the next coarser multigrid level void Restrict(); //@ManDoc: Interpolate the solution from the next coarser multigrid level void interpolate(); public: macprojection_mg(const Box& Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Residual, FArrayBox * Sigmax, FArrayBox * Sigmay, Real * X, Real * XHALF, Real Hx, Real Hy); ~macprojection_mg(); }; ccseapps-2.5/CCSEApps/varden2d/prob.F0000644000175000017500000004757011634153073020452 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** PROBINIT ** c ** Read in the problem-dependent parameters for the FORTRAN common blocks c ************************************************************************* subroutine FORT_PROBINIT (name,namlen) integer namlen integer name(namlen) integer untin, i #include "probdata.H" namelist /fortin/ prob_type, $ in_xvel, in_yvel, in_density, in_tracer, $ xblob, yblob, radblob, denblob, velfact c Build `probin' filename -- the name of file containing fortin namelist. c integer maxlen parameter (maxlen=256) character probin*(maxlen) if (namlen .gt. maxlen) then write(6,*) 'probin file name too long' stop end if do i = 1, namlen probin(i:i) = char(name(i)) end do untin = 9 if (namlen .eq. 0) then open(untin,file='probin',form='formatted',status='old') else open(untin,file=probin(1:namlen),form='formatted',status='old') end if write(6,*) ' ' write(6,*) 'READING PROBIN_FILE ',probin(1:namlen) write(6,*) ' ' c call flush(6) read(untin,fortin) close(unit=untin) end c ************************************************************************* c ** INITDATA ** c ** Call the appropriate subroutine to initialize the data c ************************************************************************* subroutine FORT_INITDATA(u,v,scal,DIMS,dx,time,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T dx(2) REAL_T time print *,' ' if (prob_type .eq. 1) then call initspin(u,v,scal,dx,DIMS,numscal) else if (prob_type .eq. 2) then call initbubble(u,v,scal,dx,DIMS,numscal) else if (prob_type .eq. 3) then call initshear(u,v,scal,dx,DIMS,numscal) else if (prob_type .eq. 4) then call initchannel(u,v,scal,dx,DIMS,numscal) else if (prob_type .eq. 5) then call initxypoiseuille(u,v,scal,dx,DIMS,numscal) else if (prob_type .eq. 6) then call initrzpoiseuille(u,v,scal,dx,DIMS,numscal) else print *,'DONT KNOW THIS PROBLEM TYPE: ',prob_type stop endif return end c ************************************************************************* c ** INITSPIN ** c ** Initialize the constant density flow-in-a-box problem c ************************************************************************* subroutine initspin(u,v,scal,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T dx(2) c Local variables REAL_T x, y REAL_T spx, spy, cpx, cpy integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) spx = sin(Pi*x) cpx = cos(Pi*x) spy = sin(Pi*y) cpy = cos(Pi*y) u(i,j) = velfact*two*spy*cpy*spx**2 v(i,j) = -velfact*two*spx*cpx*spy**2 scal(i,j,1) = one enddo enddo do n = 2, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 scal(i,j,n) = zero enddo enddo enddo return end c ************************************************************************* c ** INITBUBBLE ** c ** Initialize the bubble-drop in a box problem c ************************************************************************* subroutine initbubble(u,v,scal,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T dx(2) c Local variables REAL_T x, y, r integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 u(i,j) = zero v(i,j) = zero x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2) scal(i,j,1) = one+(denblob-one)*(half+half*tanh(100.d0*(radblob-r))) c scal(i,j,1) = cvmgt(denblob,one,r .lt. radblob) enddo enddo do n = 2, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 scal(i,j,n) = zero enddo enddo enddo return end c ************************************************************************* c ** INITSHEAR ** c ** Initialize a constant density doubly-periodic shear problem c ************************************************************************* subroutine initshear(u,v,scal,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T dx(2) c Local variables REAL_T x, y integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) u(i,j) = tanh(30.d0*(fourth - abs(y-half))) v(i,j) = 0.05d0 * sin(two*Pi*x) scal(i,j,1) = one enddo enddo do n = 2, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) - 0.5d0 y = dx(2)*(float(j) + half) - 0.5d0 scal(i,j,n) = sqrt(x*x+y*y) c scal(i,j,n) = zero enddo enddo enddo return end c ************************************************************************* c ** INITCHANNEL ** c ** Initialize the channel inflow problem c ************************************************************************* subroutine initchannel(u,v,scal,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T dx(2) c Local variables REAL_T x, y, r integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2) u(i,j) = in_xvel v(i,j) = in_yvel scal(i,j,1) = cvmgt(denblob,in_density,r .lt. radblob) enddo enddo if (numscal .ge. 2) then do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2) scal(i,j,2) = cvmgt(one ,in_tracer ,r .lt. radblob) enddo enddo endif do n = 3, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 scal(i,j,n) = zero enddo enddo enddo return end c ************************************************************************* c ** INITXYPOISEUILLE ** c ** Initialize the Poiseuille (viscous flow in an x-y pipe) problem c ************************************************************************* subroutine initxypoiseuille(u,v,scal,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T dx(2) c Local variables REAL_T x, y, r integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) u(i,j) = zero v(i,j) = (one-(x-one)*(x-one)) scal(i,j,1) = one enddo enddo if (numscal .ge. 2) then do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2) scal(i,j,2) = cvmgt(one ,in_tracer ,r .lt. radblob) enddo enddo endif do n = 3, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 scal(i,j,n) = zero enddo enddo enddo return end c ************************************************************************* c ** INITRZPOISEUILLE ** c ** Initialize the Poiseuille (viscous flow in a circular pipe) problem c ************************************************************************* subroutine initrzpoiseuille(u,v,scal,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T dx(2) c Local variables REAL_T x, y, r integer i, j, n do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) u(i,j) = zero v(i,j) = (one-x*x) scal(i,j,1) = one enddo enddo if (numscal .ge. 2) then do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i) + half) y = dx(2)*(float(j) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2) scal(i,j,2) = cvmgt(one ,in_tracer ,r .lt. radblob) enddo enddo endif do n = 3, numscal do j = lo_2,hi_2 do i = lo_1,hi_1 scal(i,j,n) = zero enddo enddo enddo return end c ************************************************************************* c ** DERVORT ** c ** Derive a cell-centered vorticity c ************************************************************************* subroutine FORT_DERVORT(state,derval,derlo_1,derlo_2,derhi_1,derhi_2, $ DIMS,dx) implicit none integer derlo_1, derlo_2 integer derhi_1, derhi_2 integer DIMS REAL_T state(lo_1-1:hi_1+1,lo_2-1:hi_2+1,4) REAL_T derval(derlo_1:derhi_1,derlo_2:derhi_2) REAL_T dx(2) c Local variables integer i, j do j = lo_2, hi_2 do i = lo_1, hi_1 derval(i,j) = fourth*(state(i+1,j+1,2)+state(i+1,j-1,2)- $ state(i-1,j+1,2)-state(i-1,j-1,2)) / dx(1) - $ fourth*(state(i+1,j+1,1)+state(i-1,j+1,1)- $ state(i+1,j-1,1)-state(i-1,j-1,1)) / dx(2) enddo enddo return end c ************************************************************************* c ** DERAVGP ** c ** Average nodal pressure onto cell centers for plotting purposes c ************************************************************************* subroutine FORT_DERAVGP(pressure,dat,DIMS) implicit none integer DIMS REAL_T pressure(lo_1:hi_1+1,lo_2:hi_2+1) REAL_T dat(lo_1:hi_1 ,lo_2:hi_2 ) c Local variables integer i, j do j = lo_2, hi_2 do i = lo_1, hi_1 dat(i,j) = (pressure(i,j ) + pressure(i+1,j ) + $ pressure(i,j+1) + pressure(i+1,j+1) ) * fourth enddo enddo return end c ************************************************************************* c ** FORT_SET_CELL_VELBC ** c ** set velocity bc for computation of derived variables c ************************************************************************* subroutine FORT_SET_CELL_VELBC(u,v,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi, & irz,visc_coef,dx,time) implicit none #include "probdata.H" integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer irz REAL_T visc_coef REAL_T dx(2) REAL_T time c Local variables integer i, j, is, ie, js, je REAL_T x is = lo_1 ie = hi_1 js = lo_2 je = hi_2 if (bcy_lo .eq. OUTLET) then do i = is,ie v(i,js-1) = v(i,js) u(i,js-1) = u(i,js) enddo elseif (bcy_lo .eq. INLET) then if (prob_type .eq. 5) then do i = is-1,ie+1 x = (float(i)+half)*dx(1) u(i,js-1) = -u(i,js) v(i,js-1) = (one-(x-one)*(x-one)) enddo elseif (prob_type .eq. 6) then do i = is-1,ie+1 x = (float(i)+half)*dx(1) u(i,js-1) = -u(i,js) v(i,js-1) = (one-x*x) enddo else do i = is-1,ie+1 v(i,js-1) = two* in_yvel - v(i,js) u(i,js-1) = -u(i,js) enddo endif elseif (bcy_lo .eq. WALL) then do i = is-1,ie+1 v(i,js-1) = -v(i,js) u(i,js-1) = three*u(i,js) - three*u(i,js+1)+u(i,js+2) enddo if (visc_coef .gt. zero) then do i = is-1,ie+1 u(i,js-1) = -u(i,js) enddo endif elseif (bcy_lo .eq. PERIODIC) then do i = is,ie u(i,js-1) = u(i,je) v(i,js-1) = v(i,je) enddo endif if (bcy_hi .eq. OUTLET) then do i = is,ie v(i,je+1) = v(i,je) u(i,je+1) = u(i,je) enddo elseif (bcy_hi .eq. INLET) then do i = is-1,ie+1 v(i,je+1) = two*in_yvel - v(i,je) u(i,je+1) = - u(i,je) enddo elseif (bcy_hi .eq. WALL) then do i = is-1,ie+1 v(i,je+1) = -v(i,je) u(i,je+1) = three*u(i,je) - three*u(i,je-1)+u(i,je-2) enddo if (visc_coef .gt. zero) then do i = is-1,ie+1 u(i,je+1) = -u(i,je) enddo endif elseif (bcy_hi .eq. PERIODIC) then do i = is,ie u(i,je+1) = u(i,js) v(i,je+1) = v(i,js) enddo endif if (bcx_lo .eq. OUTLET) then do j = js-1,je+1 u(is-1,j) = u(is,j) v(is-1,j) = v(is,j) enddo elseif (bcx_lo .eq. INLET) then do j = js-1,je+1 u(is-1,j) = two*in_xvel - u(is,j) v(is-1,j) = - v(is,j) enddo elseif (bcx_lo .eq. WALL) then do j = js-1,je+1 u(is-1,j) = -u(is,j) v(is-1,j) = three*v(is,j)-three*v(is+1,j)+v(is+2,j) enddo if (visc_coef .gt. zero .and. irz. eq. 0) then do j = js-1,je+1 v(is-1,j) = -v(is,j) enddo endif elseif (bcx_lo .eq. PERIODIC) then do j = js-1,je+1 u(is-1,j) = u(ie,j) v(is-1,j) = v(ie,j) enddo endif if (bcx_hi .eq. OUTLET) then do j = js-1,je+1 u(ie+1,j) = u(ie,j) v(ie+1,j) = v(ie,j) enddo elseif (bcx_hi .eq. INLET) then do j = js-1,je+1 u(ie+1,j) = two *in_xvel - u(ie,j) v(ie+1,j) = - v(ie,j) enddo elseif (bcx_hi .eq. WALL) then do j = js-1,je+1 u(ie+1,j) = - u(ie,j) v(ie+1,j) = three*v(ie,j)-three*v(ie-1,j)+v(ie-2,j) enddo if (visc_coef .gt. zero) then do j = js-1,je+1 v(ie+1,j) = - v(ie,j) enddo endif elseif (bcx_hi .eq. PERIODIC) then do j = js-1,je+1 u(ie+1,j) = u(is,j) v(ie+1,j) = v(is,j) enddo endif return end c ************************************************************************* c ** VELINFLOW ** c ** Impose the inflow boundary conditions on velocity c ************************************************************************* subroutine velinflow(u,DIMS,time,dy,idir,is_hi) implicit none #include "probdata.H" integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T time REAL_T dy integer idir integer is_hi c Local variables integer i,j REAL_T x if (idir .eq. 0) then if (is_hi .eq. 0) then do j = lo_2-1,hi_2+1 u(lo_1-1,j) = in_xvel enddo else do j = lo_2-1,hi_2+1 u(hi_1+1,j) = in_xvel enddo endif elseif (idir .eq. 1) then if (is_hi .eq. 0) then if (prob_type .eq. 5) then do i = lo_1-1,hi_1+1 x = (float(i)+half)*dy u(i,lo_2-1) = (one-(x-one)*(x-one)) enddo elseif (prob_type .eq. 6) then do i = lo_1-1,hi_1+1 x = (float(i)+half)*dy u(i,lo_2-1) = (one-x*x) enddo else do i = lo_1-1,hi_1+1 u(i,lo_2-1) = in_yvel enddo endif else do i = lo_1-1,hi_1+1 u(i,hi_2+1) = in_yvel enddo endif else print *,'bogus idir in velinflow ',idir stop endif return end c ************************************************************************* c ** SCALINFLOW ** c ** Impose the inflow boundary conditions on scalars c ************************************************************************* subroutine scalinflow(s,DIMS,time,dy,idir,is_hi,which_scal) implicit none #include "probdata.H" integer DIMS REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T time REAL_T dy integer idir integer is_hi integer which_scal c Local variables integer i,j REAL_T inflow_val if (which_scal .eq. 0) then inflow_val = in_density elseif (which_scal .eq. 1) then inflow_val = in_tracer else print *,"STOP IN SCALINFLOW " print *," -- DONT HAVE VALUE FOR THIS VARIABLE " stop endif if (idir .eq. 0) then if (is_hi .eq. 0) then do j = lo_2-1,hi_2+1 s(lo_1-1,j) = inflow_val enddo else do j = lo_2-1,hi_2+1 s(hi_1+1,j) = inflow_val enddo endif elseif (idir .eq. 1) then if (is_hi .eq. 0) then do i = lo_1-1,hi_1+1 s(i,lo_2-1) = inflow_val enddo else do i = lo_1-1,hi_1+1 s(i,hi_2+1) = inflow_val enddo endif else print *,'bogus idir in scalinflow ',idir stop endif return end ccseapps-2.5/CCSEApps/varden2d/Grid.cpp0000644000175000017500000007460311634153073020767 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #define N_STATE 4 #define NDIM 2 #define ARLIM(x) x[0],x[1] int Grid::slope_order = 4; int Grid::init_iter = 2; Real Grid::fixed_dt = -1.0; // ************************************************************************ // ** constructor ** // ************************************************************************ Grid::Grid(std::string probin_file_read) { probin_file = probin_file_read; numscal = N_STATE - NDIM; parseInputs(); lo = prob_domain.smallEnd().getVect(); hi = prob_domain.bigEnd().getVect(); x = new Real[prob_domain.length()[0]+2]; xhalf = new Real[prob_domain.length()[0]+2]; FORT_XINIT(x,xhalf,&hx,ARLIM(lo),ARLIM(hi),&irz); } // ************************************************************************ // ** parseInputs ** // ************************************************************************ void Grid::parseInputs() { ParmParse pp("grid"); Array n_cell(NDIM); pp.getarr("n_cell",n_cell,0,NDIM); IntVect pd_lo(0,0); IntVect pd_hi(n_cell[0]-1,n_cell[1]-1); prob_domain = Box(pd_lo,pd_hi); Array real_lo(NDIM); pp.getarr("prob_lo",real_lo,0,2); Array real_hi(NDIM); pp.getarr("prob_hi",real_hi,0,2); prob_lo[0] = real_lo[0]; prob_lo[1] = real_lo[1]; prob_hi[0] = real_hi[0]; prob_hi[1] = real_hi[1]; prob_size[0] = real_hi[0] - real_lo[0]; prob_size[1] = real_hi[1] - real_lo[1]; dx[0] = prob_size[0]/ (Real) n_cell[0] ; dx[1] = prob_size[1]/ (Real) n_cell[1] ; hx = dx[0]; hy = dx[1]; is_conserv.resize(numscal); int in_inputs = pp.countval("is_conserv"); if (in_inputs != numscal) { std::cout << "WRONG NUMBER OF INPUTS FOR grid.is_conserv " << std::endl; exit(0); } pp.getarr("is_conserv",is_conserv,0,numscal); for (int i = 0; i < numscal; i++) { if (is_conserv[i] != 0 && is_conserv[i] != 1) { std::cout << "each value of is_conserv must be 0 or 1 " << std::endl; exit(0); } } visc_coef = 0.0; pp.query("visc_coef",visc_coef); diff_coef.resize(numscal); in_inputs = pp.countval("diff_coef"); if (in_inputs != numscal) { std::cout << "WRONG NUMBER OF INPUTS FOR grid.diff_coef " << std::endl; exit(0); } pp.getarr("diff_coef",diff_coef,0,numscal); if (diff_coef[0] > 0.0) { std::cout << "DENSITY SHOULD NOT DIFFUSE " << std::endl; exit(0); } pp.query("slope_order",slope_order); if (slope_order != 0 && slope_order != 2 && slope_order != 4) { std::cout << "slope_order must be 0 or 2 or 4" << std::endl; exit(0); } pp.query("init_iter",init_iter); pp.query("restart",restart_file); pp.query("fixed_dt",fixed_dt); } // ************************************************************************ // ** init ** // ************************************************************************ // decide whether to initialize from beginning or from restart void Grid::init(int& nstep, Real& time, Real& dt) { int probin_file_length = probin_file.length(); Array probin_file_name(probin_file_length); for (int i = 0; i < probin_file_length; i++) probin_file_name[i] = probin_file[i]; FORT_PROBINIT(probin_file_name.dataPtr(), &probin_file_length); if (restart_file != "") { restart(restart_file,nstep,time,dt); } else { initialInit(nstep,time,dt); } } // ************************************************************************ // ** initialInit ** // ************************************************************************ void Grid::initialInit(int& nstep, Real& time, Real& dt) { nstep = 0; time = 0.0; dt = 0.0; Box sz(BoxLib::grow(prob_domain,1)); // alloc space for state variables state.resize(sz,N_STATE); staten.resize(sz,N_STATE); slopex.resize(sz,N_STATE); slopey.resize(sz,N_STATE); rhonph.resize(sz,1); visc.resize(sz,NDIM); visc.setVal(0.0); diff.resize(sz,numscal); diff.setVal(0.0); Box p_size(BoxLib::surroundingNodes(prob_domain)); pressure.resize(p_size,1); pressure.setVal(0.0); gradp.resize(sz,NDIM); gradp.setVal(0.0); force.resize(sz,NDIM); force.setVal(0.0); scalforce.resize(sz,numscal); scalforce.setVal(0.0); edgex.resize(sz,N_STATE); edgey.resize(sz,N_STATE); buildLinks(); proj = new hg_projector(prob_domain,dx); macproj = new mac_projector(prob_domain,dx); diffuse_op = new diffuser(prob_domain,dx); FORT_INITDATA(u,v,state.dataPtr(Density),ARLIM(lo),ARLIM(hi), dx,&time,&numscal); FORT_SETVELBC(u,v,ARLIM(lo),ARLIM(hi),&bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi, &irz,&visc_coef,dx,&time); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&irz,&n,dx,&time); } FArrayBox * rhotemp = new FArrayBox(sz,1); rhotemp->setVal(1.); FArrayBox divusrc; divusrc.resize(p_size,1); FORT_MKDIVUNOD(divusrc.dataPtr(),u,v,rho,&time,dx,ARLIM(lo),ARLIM(hi)); proj->project(&state,&pressure,rhotemp,&divusrc,time,dt); delete rhotemp; pressure.setVal(0.0); FORT_SETVELBC(u,v,ARLIM(lo),ARLIM(hi),&bcx_lo,&bcx_hi, &bcy_lo,&bcy_hi,&irz,&visc_coef,dx,&time); } // ************************************************************************ // ** restart ** // ************************************************************************ void Grid::restart(std::string& filename, int& nstep, Real& time, Real& dt) { std::ifstream is(filename.c_str(),std::ios::in); is >> nstep; is >> time; is >> dt; is >> prob_domain; is >> irz; is >> bcx_lo; is >> bcx_hi; is >> bcy_lo; is >> bcy_hi; Box sz(BoxLib::grow(prob_domain,1)); // alloc space for state variables state.resize(sz,N_STATE); staten.resize(sz,N_STATE); slopex.resize(sz,N_STATE); slopey.resize(sz,N_STATE); rhonph.resize(sz,1); gradp.resize(sz,NDIM); force.resize(sz,NDIM); force.setVal(0.0); scalforce.resize(sz,numscal); scalforce.setVal(0.0); visc.resize(sz,NDIM); visc.setVal(0.0); diff.resize(sz,numscal); diff.setVal(0.0); edgex.resize(sz,N_STATE); edgey.resize(sz,N_STATE); Box p_size(BoxLib::surroundingNodes(prob_domain)); pressure.resize(p_size,1); state.readFrom(is); pressure.readFrom(is); buildLinks(); FORT_SETVELBC(u,v,ARLIM(lo),ARLIM(hi),&bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi, &irz,&visc_coef,dx,&time); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&irz,&n,dx,&time); } proj = new hg_projector(prob_domain,dx); macproj = new mac_projector(prob_domain,dx); diffuse_op = new diffuser(prob_domain,dx); } // ************************************************************************ // ** buildLinks ** // ************************************************************************ void Grid::buildLinks() { // build links to components of old-time state variables u = state.dataPtr(0); v = state.dataPtr(1); rho = state.dataPtr(NDIM); // build links to components of new-time state variables un = staten.dataPtr(0); vn = staten.dataPtr(1); rhon = staten.dataPtr(NDIM); rhohalf = rhonph.dataPtr(); // build links to pressure gradient px = gradp.dataPtr(); py = gradp.dataPtr(1); hx = dx[0]; hy = dx[1]; uadv = new Real[(prob_domain.length()[0]+1)* prob_domain.length()[1] ]; vadv = new Real[ prob_domain.length()[0] *(prob_domain.length()[1]+1)]; utrans = new Real[(prob_domain.length()[0]+1)* prob_domain.length()[1] ]; vtrans = new Real[ prob_domain.length()[0] *(prob_domain.length()[1]+1)]; } // ************************************************************************ // ** destructor ** // ************************************************************************ Grid::~Grid() { delete x; delete xhalf; delete proj; delete macproj; delete diffuse_op; delete uadv; delete vadv; delete utrans; delete vtrans; } // ************************************************************************ // ** writeCheckPoint ** // ************************************************************************ void Grid::writeCheckPoint(int nstep, Real time, Real dt, std::string& check_file_root) { // construct file name std::string chkfile = check_file_root; char buf[sizeof(int)+1]; sprintf (buf,"%04d",nstep); chkfile += buf; const char* chkfile_sep_str ="/"; if (chkfile.length() == 0) { BoxLib::Error("invalid check_file_root"); } if (strchr(chkfile.c_str(), *chkfile_sep_str) == 0) { // No slashes in the path, so no need to create directory. } else { // Make copy of the directory pathname so we can write to it. char* path = new char[chkfile.length() + 1]; (void) strcpy(path, chkfile.c_str()); char* slash = strrchr(path, *chkfile_sep_str); int fileNameLength = strlen(slash); int entireNameLength = strlen(path); int dirNameLength = entireNameLength - fileNameLength; char* chkdir= new char[dirNameLength+1]; strncpy(chkdir,path,dirNameLength); chkdir[dirNameLength] = path[entireNameLength]; // create the directory if (!BoxLib::UtilCreateDirectory(chkdir,0755)){ BoxLib::CreateDirectoryFailed(chkdir); } delete [] chkdir; delete [] path; } // open stream std::ofstream os(chkfile.c_str(),std::ios::out); os.precision(15); os << nstep << '\n'; os << time << '\n'; os << dt << '\n'; os << prob_domain << '\n'; os << irz << '\n'; os << bcx_lo << '\n'; os << bcx_hi << '\n'; os << bcy_lo << '\n'; os << bcy_hi << '\n'; state.writeOn(os); pressure.writeOn(os); } // ************************************************************************ // ** initialIter ** // ************************************************************************ void Grid::initialIter(Real time, Real dt) { for (int iter = 0; iter < init_iter; iter++) { timeStep(time,dt); } } // ************************************************************************ // ** advance ** // ************************************************************************ void Grid::advance(Real time, Real dt) { timeStep(time,dt); state.copy(staten,0,0,N_STATE); staten.setVal(0.); } // ************************************************************************ // ** timeStep ** // ************************************************************************ void Grid::timeStep(Real time, Real dt) { FORT_SETVELBC(u,v,ARLIM(lo),ARLIM(hi),&bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi, &irz,&visc_coef,dx,&time); getSlopes(0,NDIM); getGradP(); getForce(time); getViscTerm(); makeAdvVels(time,dt); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&irz,&n,dx,&time); } getSlopes(Density,N_STATE-NDIM); updateScalars(time,dt); getRhoHalf(time,dt); updateVelocity(time,dt); } // ************************************************************************ // ** getSlopes ** // ************************************************************************ void Grid::getSlopes(int first_comp, int num_comp) { int numx = prob_domain.length()[0]+2; Real *dfromx = new Real[4*numx]; FORT_SLOPEX(state.dataPtr(first_comp),slopex.dataPtr(first_comp), dfromx,ARLIM(lo),ARLIM(hi),&first_comp,&num_comp, &bcx_lo,&bcx_hi,&irz,&slope_order); delete dfromx; int numy = prob_domain.length()[1]+2; Real *dfromy = new Real[4*numy]; FORT_SLOPEY(state.dataPtr(first_comp),slopey.dataPtr(first_comp), dfromy,ARLIM(lo),ARLIM(hi),&num_comp,&bcy_lo, &bcy_hi,&slope_order); delete dfromy; } // ************************************************************************ // ** getViscTerm ** // ************************************************************************ void Grid::getViscTerm() { if (visc_coef > 0.) { for (int n = 0; n < NDIM; n++) { FORT_LAPLAC(state.dataPtr(n),visc.dataPtr(n), x,xhalf,ARLIM(lo),ARLIM(hi),dx,&visc_coef,&irz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&n); } } } // ************************************************************************ // ** getDiffTerm ** // ************************************************************************ void Grid::getDiffTerm() { for (int n = 0; n < numscal; n++) { Real dc = diff_coef[n]; if (dc > 0.) { int icomp = Density + n; FORT_LAPLAC(state.dataPtr(icomp),diff.dataPtr(n), x,xhalf,ARLIM(lo),ARLIM(hi),dx,&dc,&irz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&icomp); } } } // ************************************************************************ // ** getGradP ** // ************************************************************************ void Grid::getGradP() { proj->gradient(gradp,pressure); } // ************************************************************************ // ** getForce ** // ************************************************************************ void Grid::getForce(Real current_time) { FORT_MKFORCE(force.dataPtr(),u,v,rho, &gravity,&visc_coef,¤t_time,dx,ARLIM(lo),ARLIM(hi)); } // ************************************************************************ // ** getScalForce ** // ************************************************************************ void Grid::getScalForce(Real current_time) { FORT_MKSCALFORCE(scalforce.dataPtr(),state.dataPtr(Density), ¤t_time,dx,ARLIM(lo),ARLIM(hi),&numscal); } // ************************************************************************ // ** makeAdvVel ** // ************************************************************************ void Grid::makeAdvVels(Real time, Real dt) { Real halftime = time + .5*dt; // Reset the bcs if inflow profile (for the case of time-dep inflow) if (bcx_lo == INLET || bcx_hi == INLET || bcy_lo == INLET || bcy_hi == INLET) { FORT_SETVELBC(u,v,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi, &irz,&visc_coef,dx,&halftime); } int numx = prob_domain.length()[0]+2; int numy = prob_domain.length()[1]+2; Real *stlft = new Real[2*numx]; Real *strgt = stlft + numx; Real *stbot = new Real[2*numy]; Real *sttop = stbot + numy; Real * ux = slopex.dataPtr(Xvel); Real * vx = slopex.dataPtr(Yvel); Real * uy = slopey.dataPtr(Xvel); Real * vy = slopey.dataPtr(Yvel); // This extrapolates u to the x-edges and v to the y-edges only. FORT_MKADVVEL(u,ux,uy,v,vx,vy,rho,force.dataPtr(),px,py, visc.dataPtr(),dx,dt,ARLIM(lo),ARLIM(hi), stlft,strgt,sttop,stbot, uadv,vadv,utrans,vtrans, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&visc_coef,&irz); delete stlft; delete stbot; // Create the cell-based source S for the divergence constraint Div(U) = S FArrayBox divusrc; divusrc.resize(prob_domain,1); FORT_MKDIVUCC(divusrc.dataPtr(),u,v,rho,&halftime,dx,ARLIM(lo),ARLIM(hi)); // This enforces the div(U) = S condition on the edge-based half-time // normal velocities macproj->project(uadv,vadv,rho,divusrc); } // ************************************************************************ // ** updateScalars ** // ************************************************************************ void Grid::updateScalars(Real time, Real dt) { Real newtime = time+dt; int numx = prob_domain.length()[0]+1; int numy = prob_domain.length()[1]+1; Real *stleft = new Real[2*numx]; Real *stright = stleft + numx; Real *stbot = new Real[2*numy]; Real *sttop = stbot + numy; if (bcx_lo == INLET || bcx_hi == INLET || bcy_lo == INLET || bcy_hi == INLET) { Real halftime = time + .5*dt; for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&irz,&n,dx,&halftime); } } getDiffTerm(); getScalForce(time); FORT_MKSCAFLUX(state.dataPtr(Density) , edgex.dataPtr(Density) , edgey.dataPtr(Density), slopex.dataPtr(Density), slopey.dataPtr(Density), uadv, vadv, utrans, vtrans, u, diff.dataPtr(), scalforce.dataPtr(), stleft,stright,stbot,sttop, ARLIM(lo),ARLIM(hi),dx,&dt, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&numscal); Real halftime = time + 0.5*dt; getScalForce(halftime); FORT_SCALUPD(state.dataPtr(Density), staten.dataPtr(Density), edgex.dataPtr(Density), edgey.dataPtr(Density), uadv, vadv, diff.dataPtr(), scalforce.dataPtr(), x,xhalf,ARLIM(lo),ARLIM(hi), dx,&dt,is_conserv.dataPtr(),&numscal); delete stleft; delete stbot; for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(staten.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&irz,&n,dx,&newtime); if (diff_coef[n] > 0.0) { FArrayBox temp(BoxLib::grow(prob_domain,1),1); temp.setVal(0.); Real mu = .5*diff_coef[n]*dt; diffuse_op->solveScal(&staten,&temp,mu,Density+n); staten.copy(temp,0,Density+n,1); FORT_SETSCALBC(staten.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&irz,&n,dx,&newtime); } } } // ************************************************************************ // ** getRhoHalf ** // ************************************************************************ void Grid::getRhoHalf(Real time, Real dt) { int src_comp = Density; int dest_comp = 0; rhonph.copy(state ,src_comp,dest_comp,1); rhonph.plus(staten,src_comp,dest_comp,1); rhonph.mult(0.5); if (bcx_lo == INLET || bcx_hi == INLET || bcy_lo == INLET || bcy_hi == INLET) { Real halftime = time + 0.5*dt; int n = 0; FORT_SETSCALBC(rhohalf,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&irz,&n,dx,&halftime); } } // ************************************************************************ // ** updateVelocity ** // ************************************************************************ void Grid::updateVelocity(Real time, Real dt) { int numx = prob_domain.length()[0]+1; int numy = prob_domain.length()[1]+1; Real *stlft = new Real[4*numx]; Real *strgt = stlft + 2*numx; Real *stbot = new Real[4*numy]; Real *sttop = stbot + 2*numy; FORT_MKVELFLUX(state.dataPtr() , edgex.dataPtr() , edgey.dataPtr(), slopex.dataPtr(), slopey.dataPtr(), uadv, vadv,utrans,vtrans, rho,px,py,visc.dataPtr(), stlft,strgt,stbot,sttop, ARLIM(lo),ARLIM(hi),dx,&dt, force.dataPtr(),&visc_coef,&irz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi); delete stlft; delete stbot; Real halftime = time + 0.5*dt; getForce(halftime); FORT_VELUPD(u,v,un,vn,visc.dataPtr(),gradp.dataPtr(),rhohalf, uadv,vadv,edgex.dataPtr(),edgey.dataPtr(), force.dataPtr(),&dt,ARLIM(lo),ARLIM(hi),dx); Real newtime = time+dt; FORT_SETVELBC(un,vn,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&irz,&visc_coef,dx,&newtime); if (visc_coef > 0.0) { Real mu = .5*visc_coef*dt; for (int n = 0; n < NDIM; n++) { FArrayBox temp(BoxLib::grow(prob_domain,1),1); temp.setVal(0.); diffuse_op->solveVel(&staten,&temp,rhohalf,mu,n); staten.copy(temp,0,n,1); } FORT_SETVELBC(un,vn,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&irz,&visc_coef,dx,&newtime); } // Create the node-based source S/dt for the divergence constraint Div(U/dt) = S/dt FArrayBox divusrc, divutmp; Box p_size(BoxLib::surroundingNodes(prob_domain)); divusrc.resize(p_size,1); divutmp.resize(p_size,1); FORT_MKDIVUNOD(divusrc.dataPtr(),un,vn,rhon,&newtime,dx,ARLIM(lo),ARLIM(hi)); divusrc.mult(1./dt); staten.divide(dt,0,NDIM); proj->project(&staten,&pressure,&rhonph,&divusrc,time,dt); staten.mult(dt,0,NDIM); FORT_SETVELBC(un,vn,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&irz,&visc_coef,dx,&newtime); } // ************************************************************************ // ** estimateDt ** // ************************************************************************ Real Grid::estimateDt(Real & dt, Real cfl) { getGradP(); Real cfl_temp = cfl; if (fixed_dt > 0) cfl_temp = 0.9; FORT_CMPDT(u,v,rho,px,py,force.dataPtr(),dx,&dt,&cfl_temp, ARLIM(lo),ARLIM(hi)); if (fixed_dt > 0) { if (fixed_dt > dt) { std::cout << "WARNING: fixed_dt may be too big" << std::endl; std::cout << "fixed_dt = " << fixed_dt << " with CFL =0.9 computed_dt = " << dt << std::endl; } dt = fixed_dt; } std::cout << "Computing dt to be " << dt << std::endl; return dt; } // ************************************************************************ // ** DeriveFunc ** // ************************************************************************ // ------------ Define assoc between var name and derive func typedef void (*DeriveFunc) (Real* state, Real* derval, const int& der_lo_1, const int& der_lo_2, const int& der_hi_1, const int& der_hi_2, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, const Real* dx); // ************************************************************************ // ** DeriveRec ** // ************************************************************************ class DeriveRec { public: DeriveRec(std::string name, DeriveFunc f) : varname(name), func(f) {}; ~DeriveRec() {}; std::string varname; DeriveFunc func; }; DeriveRec vor_rec("vort", FORT_DERVORT); static DeriveRec deriveList[] = { vor_rec, }; int numDerive = sizeof(deriveList)/sizeof(DeriveRec); // ************************************************************************ // ** deriveData ** // ************************************************************************ void Grid::deriveData(FArrayBox& derval, const std::string& name, Real time) { // is it a state variable if (name == "x_velocity") { derval.copy(state,prob_domain,0,prob_domain,0,1); return; } else if (name == "y_velocity") { derval.copy(state,prob_domain,1,prob_domain,0,1); return; } else if (name == "density") { derval.copy(state,prob_domain,2,prob_domain,0,1); return; } else if (name == "tracer") { derval.copy(state,prob_domain,3,prob_domain,0,1); return; // IF YOU WISH TO ADD A NEW SCALAR VARIABLE, UNCOMMENT THESE LINES // } else if (name == "new_scalar") { // derval.copy(state,prob_domain,4,prob_domain,0,1); // return; } else if (name == "pressure") { FORT_DERAVGP(pressure.dataPtr(), derval.dataPtr(), ARLIM(lo), ARLIM(hi)); return; } else if (name == "px") { derval.copy(gradp,prob_domain,0,prob_domain,0,1); return; } else if (name == "py") { derval.copy(gradp,prob_domain,1,prob_domain,0,1); return; } const int* derlo = derval.loVect(); const int* derhi = derval.hiVect(); // if we got here, check list of known derived quantities for (int i = 0; i < numDerive; i++) { if (name == deriveList[i].varname) { FORT_SET_CELL_VELBC(u,v,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi, &irz,&visc_coef,dx,&time); deriveList[i].func(state.dataPtr(),derval.dataPtr(), ARLIM(derlo),ARLIM(derhi), ARLIM(lo),ARLIM(hi),dx); FORT_SETVELBC(u,v,ARLIM(lo),ARLIM(hi),&bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi, &irz,&visc_coef,dx,&time); return; } } // if we got here, dont know how to derive this std::cerr << "Dont know how to derive " << name << std::endl; abort(); } // ************************************************************************ // ** writePlotFile ** // ************************************************************************ // ------------------------------------------------------------- void Grid::writePlotFile(int nstep, Real time, std::string& plot_file_root) { std::string pltfile = plot_file_root; char buf[sizeof(int)+1]; sprintf(buf,"%04d",nstep); pltfile += buf; std::cout << "writing plotfile: " << pltfile << std::endl; // create directory if (!(BoxLib::UtilCreateDirectory(pltfile,0755))) { BoxLib::CreateDirectoryFailed(pltfile); } std::string HeaderFileName = pltfile + "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream HeaderFile; HeaderFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); int old_prec; HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc); if (!HeaderFile.good()) BoxLib::FileOpenFailed(HeaderFileName); old_prec = HeaderFile.precision(15); static const std::string RunstatString("write_pltfile"); int finest_level = 0; for (int k = 0; k <= finest_level; k++) { writePlotFile(pltfile, HeaderFile,nstep,time); } HeaderFile.precision(old_prec); if (!HeaderFile.good()) BoxLib::Error("Amr::writePlotFile() failed"); } std::string Grid::thePlotFileType() { // Increment this whenever the writePlotFile() format changes. // static const std::string the_plot_file_type("HyperCLaw-V1.1"); return the_plot_file_type; } void Grid::writePlotFile(std::string& dir, std::ostream& os, int nstep, Real time) { int i, n; int finest_level = 0; // plotfile type os << thePlotFileType() << '\n'; // number of components int numPlotComp = N_STATE + 1 + NDIM + numDerive; os << numPlotComp << '\n'; // names os << "x_velocity" << '\n'; os << "y_velocity" << '\n'; os << "density" << '\n'; os << "tracer" << '\n'; // IF YOU WISH TO ADD A NEW SCALAR VARIABLE, UNCOMMENT THIS LINE // os << "new_scalar" << '\n'; os << "pressure"<< '\n'; os << "px" << '\n'; os << "py" << '\n'; os << "vort" << '\n'; static const std::string MultiFabBaseName("/MultiFab"); // dimensions os << NDIM << '\n'; // current time os << time << '\n'; // finest_level os << finest_level << '\n'; // problem_domain for (i = 0; i < NDIM; i++) os << prob_lo[i] << ' '; os << '\n'; for (i = 0; i < NDIM; i++) os << prob_hi[i] << ' '; os << '\n'; os << '\n'; // domain os << prob_domain << ' '; os << '\n'; os << nstep << '\n'; for (int k = 0; k < NDIM; k++) { os << dx[k] << ' '; } os << '\n'; os << irz << '\n'; // write bndry data os << "0\n"; int thisLevel = 0; int numGridsOnLevel = 1; int IAMRSteps = 0; char buf[64]; sprintf(buf, "Level_%d",thisLevel); std::string Level = buf; std::string FullPath = dir; if (!FullPath.empty() && FullPath[FullPath.length()-1] != '/') FullPath += '/'; FullPath += Level; if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) BoxLib::CreateDirectoryFailed(FullPath); // now write state data os << thisLevel << ' ' << numGridsOnLevel << ' ' << time << '\n'; os << IAMRSteps << '\n'; for (n = 0; n < NDIM; n++) { os << prob_lo[n] << ' ' << prob_hi[n] << '\n'; } std::string PathNameInHeader = Level; PathNameInHeader += MultiFabBaseName; os << PathNameInHeader << '\n'; FullPath += MultiFabBaseName; // copy all of the data into the multifab. BoxArray bs(1); bs.set(0,prob_domain); FArrayBox temp(prob_domain,1); FArrayBox dat(prob_domain,numPlotComp); MultiFab mf(bs,numPlotComp,0,Fab_allocate); int counter = 0; // write state data: u, v, rho, scalars dat.copy(state,0,0,N_STATE); counter += N_STATE; // Writing the pressure FORT_DERAVGP(pressure.dataPtr(), temp.dataPtr(), ARLIM(lo), ARLIM(hi)); dat.copy(temp,0,counter,1); counter++; // Writing the pressure gradient proj->gradient(gradp,pressure); dat.copy(gradp,0,counter,NDIM); counter += NDIM; // Writing the vorticity temp.resize(prob_domain,1); FORT_SET_CELL_VELBC(u,v,ARLIM(lo),ARLIM(hi),&bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi, &irz,&visc_coef,dx,&time); for(i = 0; i < numDerive; i++) { temp.setVal(0.0); deriveList[i].func(state.dataPtr(),temp.dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(lo),ARLIM(hi),dx); dat.copy(temp,0,counter,1); counter++; } FORT_SETVELBC(u,v,ARLIM(lo),ARLIM(hi),&bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi, &irz,&visc_coef,dx,&time); mf[0].copy(dat); VisMF::Write(mf,FullPath,VisMF::OneFilePerCPU); } ccseapps-2.5/CCSEApps/varden2d/setvelbc.F0000644000175000017500000001302711634153073021305 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** SETVELBC ** c ** Impose the physical boundary conditions on the velocity (u,v) c ************************************************************************* subroutine setvelbc(u,v,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,irz, $ visc_coef,dx,time) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer irz REAL_T visc_coef REAL_T dx(2) REAL_T time c Local variables integer is,ie,js,je,i,j is = lo_1 ie = hi_1 js = lo_2 je = hi_2 if (bcy_lo .eq. PERIODIC) then do i = is,ie u(i,js-1) = u(i,je) v(i,js-1) = v(i,je) enddo elseif (bcy_lo .eq. WALL) then c ::: REMEMBER - THESE VALUES NOW LIVE ON CELL EDGES do i = is,ie v(i,js-1) = zero u(i,js-1) = (fifteen*u(i,js ) - ten*u(i,js+1) + $ three*u(i,js+2)) / eight enddo if (visc_coef .gt. zero) then do i = is,ie u(i,js-1) = zero enddo endif elseif (bcy_lo .eq. INLET) then call velinflow(v,DIMS,time,dx(1),1,0) do i = is-1,ie+1 u(i,js-1) = zero enddo elseif (bcy_lo .eq. OUTLET) then do i = is-1,ie+1 u(i,js-1) = u(i,js) v(i,js-1) = v(i,js) enddo endif if (bcy_hi .eq. PERIODIC) then do i = is,ie u(i,je+1) = u(i,js) v(i,je+1) = v(i,js) enddo elseif (bcy_hi .eq. WALL) then c ::: REMEMBER - THESE VALUES NOW LIVE ON CELL EDGES do i = is,ie v(i,je+1) = zero u(i,je+1) = (fifteen*u(i,je ) - ten*u(i,je-1) + $ three*u(i,je-2)) / eight enddo if (visc_coef .gt. zero) then do i = is,ie u(i,je+1) = zero enddo endif elseif (bcy_hi .eq. INLET) then call velinflow(v,DIMS,time,dx(1),1,1) do i = is-1,ie+1 u(i,je+1) = zero enddo elseif (bcy_hi .eq. OUTLET) then do i = is-1,ie+1 u(i,je+1) = u(i,je) v(i,je+1) = v(i,je) enddo endif if (bcx_lo .eq. PERIODIC) then do j = js-1,je+1 u(is-1,j) = u(ie,j) v(is-1,j) = v(ie,j) enddo elseif (bcx_lo .eq. WALL) then c ::: REMEMBER - THESE VALUES NOW LIVE ON CELL EDGES do j = js-1,je+1 u(is-1,j) = zero v(is-1,j) = (fifteen*v(is ,j) - ten*v(is+1,j) + $ three*v(is+2,j)) / eight enddo if (irz .eq. 0 .and. visc_coef .gt. zero) then do j = js-1,je+1 v(is-1,j) = zero enddo endif if (irz .eq. 1) then do j = js-1,je+1 v(is-1,j) = v(is,j) enddo endif elseif (bcx_lo .eq. INLET) then call velinflow(u,DIMS,time,dx(2),0,0) do j = js-1,je+1 v(is-1,j) = zero enddo elseif (bcx_lo .eq. OUTLET) then do j = js-1,je+1 u(is-1,j) = u(is,j) v(is-1,j) = v(is,j) enddo endif if (bcx_hi .eq. PERIODIC) then do j = js-1,je+1 u(ie+1,j) = u(is,j) v(ie+1,j) = v(is,j) enddo elseif (bcx_hi .eq. WALL) then c ::: REMEMBER - THESE VALUES NOW LIVE ON CELL EDGES do j = js-1,je+1 u(ie+1,j) = zero v(ie+1,j) = (fifteen*v(ie ,j) - ten*v(ie-1,j) + $ three*v(ie-2,j)) / eight enddo if (visc_coef .gt. zero) then do j = js-1,je+1 v(ie+1,j) = zero enddo endif elseif (bcx_hi .eq. INLET) then call velinflow(u,DIMS,time,dx(2),0,1) do j = js-1,je+1 v(ie+1,j) = zero enddo elseif (bcx_hi .eq. OUTLET) then do j = js-1,je+1 u(ie+1,j) = u(ie,j) v(ie+1,j) = v(ie,j) enddo endif return end ccseapps-2.5/CCSEApps/varden2d/README0000644000175000017500000002436511634153073020256 0ustar amckinstryamckinstry ########################################################################## INTRODUCTION ########################################################################## This code implements a single-grid variable density projection method for the incompressible Navier-Stokes equations. Here we use Godunov upwind methodology for the advection terms, a Crank-Nicholson discretization of the viscous terms in the momentum equation, and an approximate node-based projection to enforce the divergence-free constraint on velocity. This algorithm is described in detail in several papers; here we refer you to the section of the recent paper, "A Conservative Adaptive Projection Method for the Variable Density Incompressible Navier-Stokes Equations" on the single grid projection algorithm, which can be found on the web site. See also the references cited therein. ########################################################################## MAKING THE EXECUTABLE ########################################################################## To run this code, you must build the varden executable in this directory. You will also want to build the AmrVis executable in ../pAmrvis. Modify the GNUmakefile in this directory to set the following flags: DIM = 2 COMP = your compiler DEBUG = TRUE or FALSE PRECISION = DOUBLE or FLOAT USE_MPI = FALSE PROFILE = FALSE If you want run-time contouring capability then make sure that USE_GRAPHTOOL is set to TRUE. If you don't, then leave that flag at FALSE. Now type "make." This should build the executable in this directory. If you have problems at this point, please contact Ann Almgren at ASAlmgren@lbl.gov The executable will look something like run2d.OSF1.KCC.ex . This is a two-dimensional executable built with the OSF1 operating system, the KCC compiler, and the DEBUG=FALSE flag set in the GNUmakefile. If DEBUG=TRUE, the executable will look like run2d.OSF1.KCC.DEBUG.ex . The DEBUG=TRUE option exercises certain debug options in the pBoxLib library, and turns on several Fortran debug options also, which may be helpful if you are trying to debug a new code. The DEBUG=FALSE version runs more quickly. Now, to build the AmrVis executable, type "make" in the pAmrvis directory. ########################################################################## VIEWING THE DATA ########################################################################## There are two ways to look at the data which this code generates. The first is contour plots - displayed at runtime on the screen (requiring X windows) and/or as postscript files if you have compiled with the USE_GRAPHTOOL flag set to TRUE. See the documentation at the end of the inputs file to control the contour plotting. The second is plot files (plt0001, e.g., after one time step), which are generated by the VarDen code during runtime. The frequency of plot file generation is controlled in the inputs file by the parameter "plot_int." These files contain the velocity, scalars, pressure averaged onto cells, pressure gradient and vorticiy at the time specified. You can add additional derived quantities to the plot files by modifying Grid::writePlotFile. To view these plot files you will need to make the 2D executable in the ../pAmrvis directory. After the plot file (plt0001, e.g.) has been created, it can be viewed by typing ../pAmrvis/amrvis2d*ex plt0001 Sample plot files from each of the sample problems are included here in the subdirectory PlotFiles. ########################################################################## RUNNING THE EXECUTABLE ########################################################################## To run the code you will need two different files in your directory : one read by main(), the other read by FORT_PROBINIT. The first is typically called "inputs", but this name is set on the command line. The name of the second is typically "probin", but this name is set in the inputs file which is read in. There are six test problems set up for you to run; you can later edit the prob.F file and the inputs and probin files to create your own test problems. You can also modify the inputs and probin files to run these test problems at different resolution and with different parameters. ----------------------------------------------------------------------------- To run a constant-density inviscid spindown problem, type run2d.OSF1.KCC.ex inputs1 (This will read probin1) ----------------------------------------------------------------------------- To run a variable-density inviscid bubble drop problem, type run2d.OSF1.KCC.ex inputs2 (This will read probin2) ----------------------------------------------------------------------------- To run a constant-density doubly periodic shear layer problem, type run2d.OSF1.KCC.ex inputs3 (This will read probin3) ----------------------------------------------------------------------------- To run a viscous flow-in-a-channel problem, type run2d.OSF1.KCC.ex inputs4 (This will read probin4) ----------------------------------------------------------------------------- To run a Poiseuille viscous flow problem in x-y, type run2d.OSF1.KCC.ex inputs5.2d (This will read probin5) ----------------------------------------------------------------------------- To run a Poiseuille viscous flow problem in r-z, type run2d.OSF1.KCC.ex inputs6 (This will read probin6) ########################################################################## To set up a different problem using the variables as given : x-velocity (u), y-velocity (v), density (rho), tracer (1) Determine which problem-specific constant parameters you would like to be able to change at run-time. Put these into probin (using the format there) and edit probdata.H to incorporate them appropriately - make sure to add them both to the declaration statement as well as the common block. (2) Edit FORT_INITDATA and/or the routines it calls in prob.F to set up your initial data. You must initialize all the state variables - u, v, rho, and the tracer. (3) If you would like the velocity field to satisfy div(u) = S rather than div(u) = 0, you must set S on cell centers and on nodes by editing mkdivucc.F and mkdivunod.F . The current default is S = 0. (4) If you would like to have a forcing term in your scalar equation, define it in mkscalforce.F IN INPUTS: (5) Set boundary conditions using the boundary condition flags bcx_lo,bcx_hi,bcy_lo and bcy_hi. See the comments there for a description of the flags. If you are using inflow boundary conditions, you must edit "setvelinflow" and "setscalinflow" in prob.F appropriately to supply the correct inflow boundary conditions. (6) If this is a viscous problem, set visc_coef to be the dynamic viscosity (assumed constant). (7) If you would like your scalar to diffuse, set the diff_coef array appropriately. (8) If you have gravity in your problem then set the gravity value according to your physical units. The default in mkforce.F is that gravity acts in the y-direction; you can of course change this. (9) Set max_step and stop_time to determine how long your calculation will run. If you want to be governed by max_step, set stop_time to a very large number. If you want to be governed by stop_time, set max_step to be a very large integer. (10)Set check_int and plot_int to govern your graphics output and restart capability. (11)Set grid.n_cell to be the size (in index space) of your problem, e.g. for a 16x32 calculation you would set grid.n_cell = 16 32 (12)Set grid.prob_lo and grid.prob_hi to be the physical coordinates of the low and high ends of your domain. E.g. if your calculation is in a 1x2 box starting at the origin, then set grid.prob_lo = 0. 0. grid.prob_hi = 1. 2. (13)Set the contour intervals to be positive numbers if you want to see run-time contour plots of the variables. You can also have these generate postscript files at runtime, or both. ########################################################################## IF YOU NEED TO, MODIFY THE FOLLOWING IN INPUTS. OTHERWISE, LEAVE AT THEIR DEFAULT VALUES. (14) Set the cfl number to be any number from 0 to 1 (in order to keep the calculation stable). Suggested value for a relatively stable problem is 0.9; if your problem is unstable at this value then you must reduce it accordingly. (15) If the problem starts with a small velocity but large acceleration, it is suggested that you set init_shrink to be smaller than 1, e.g. 0.1. If not, leave init_shrink = 1. (16) Decide how you want to advect your scalars, using conservative or convective differences. Set grid.is_conserv appropriately. (17) Leave slope_order = 4 and init_iter = 2 unless you have reasons to change them. (18) On a double precision workstation or a CRAY, leave the tolerances hg.tol and mac.tol at 1.e-12 unless you have reason to change them. For a single precision machine you will need to raise these values. (19) Leave the multigrid flags as is unless you like to see the convergence of the multigrid solves. ########################################################################## If you want to advect n additional quantities as tracers in addition to density, you must follow these steps: (1) Define N_STATE in Grid.cpp to be 4 + n. The current version of the code is set up to have only one scalar ("tracer") in addition to the density, hence N_STATE is set to 4. (2) Modify "Grid::deriveData(...) appropriately, mimicing the format which is there. Note that you are allowed to choose the name of the variable in deriveData - make sure that you then add the variable to the list of contour variables in the inputs file, using the same name. (3) Modify "Grid::writePlotFile(...) appropriately, uncomment the line which is commented there using the name "new_scalar" - replace new_scalar by the name you used in (2) above. (4) Initialize the new variable appropriately in FORT_INITDATA in prob.F . (5) Modify mkscalforce.F appropriately if there is a forcing term for the new scalar. ccseapps-2.5/CCSEApps/varden2d/BCTypes.H0000644000175000017500000000316611634153073021014 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BC_TYPES_H_ #define _BC_TYPES_H_ #ifdef BL_LANG_FORT #define UNDEFINED -3 #define PERIODIC 1 #define WALL 2 #define INLET 3 #define OUTLET 4 #else /// type of boundary enum BndryTypes { /// undefined UNDEFINED = -3, /// periodic PERIODIC = 1, /// wall WALL, /// inlet INLET, /// outlet OUTLET }; #endif #endif ccseapps-2.5/CCSEApps/varden2d/hg.F0000644000175000017500000012116311634153073020075 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "HGPROJ_F.H" #include "BCTypes.H" #if BL_USE_FLOAT #define sixteenth .0625e0 #else #define sixteenth .0625d0 #endif #define DIMS lo_1,lo_2,hi_1,hi_2 #define CDIMS loc_1,loc_2,hic_1,hic_2 #define GDIMS g_lo_1,g_lo_2,g_hi_1,g_hi_2 #define PDIMS p_lo_1,p_lo_2,p_hi_1,p_hi_2 c ************************************************************************* c ** INITSIG ** c ** Define the 1/rho coefficients at the top level of the multigrid c ************************************************************************* subroutine FORT_INITSIG(sigma,rho,r,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer DIMS REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T r(lo_1-1:hi_1+1) integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables integer i,j do j = lo_2,hi_2 do i = lo_1,hi_1 sigma(i,j) = r(i) / rho(i,j) enddo enddo if (bcx_lo .eq. PERIODIC) then do j = lo_2-1,hi_2+1 sigma(lo_1-1,j) = sigma(hi_1,j) sigma(hi_1+1,j) = sigma(lo_1,j) enddo endif if (bcy_lo .eq. PERIODIC) then do i = lo_1-1,hi_1+1 sigma(i,lo_2-1) = sigma(i,hi_2) sigma(i,hi_2+1) = sigma(i,lo_2) enddo endif return end c ************************************************************************* c ** GRADHG ** c ** Compute the cell-centered gradient of the nodal pressure field c ************************************************************************* subroutine FORT_GRADHG(gphi,GDIMS,phi,PDIMS,DIMS,hx,hy, & bcx_lo, bcx_hi, bcy_lo, bcy_hi) implicit none integer DIMS integer p_lo_1, p_lo_2 integer p_hi_1, p_hi_2 integer g_lo_1, g_lo_2 integer g_hi_1, g_hi_2 REAL_T gphi(g_lo_1:g_hi_1,g_lo_2:g_hi_2,2) REAL_T phi(p_lo_1:p_hi_1,p_lo_2:p_hi_2 ) REAL_T hx REAL_T hy integer bcx_lo, bcx_hi, bcy_lo, bcy_hi c Local variables integer i, j do j = lo_2,hi_2 do i = lo_1,hi_1 gphi(i,j,1) = half*(phi(i+1,j) + phi(i+1,j+1) - $ phi(i ,j) - phi(i ,j+1) ) /hx gphi(i,j,2) = half*(phi(i,j+1) + phi(i+1,j+1) - $ phi(i,j ) - phi(i+1,j ) ) /hy enddo enddo if (g_lo_1 .le. lo_1-1 .and. g_hi_1 .ge. hi_1+1) then if (bcx_lo .eq. PERIODIC) then do j = lo_2,hi_2 gphi(lo_1-1,j,1) = gphi(hi_1,j,1) gphi(lo_1-1,j,2) = gphi(hi_1,j,2) enddo endif if (bcx_hi .eq. PERIODIC) then do j = lo_2,hi_2 gphi(hi_1+1,j,1) = gphi(lo_1,j,1) gphi(hi_1+1,j,2) = gphi(lo_1,j,2) enddo endif endif if (g_lo_2 .le. lo_2-1 .and. g_hi_2 .ge. hi_2+1) then if (bcy_lo .eq. PERIODIC) then do i = lo_1,hi_1 gphi(i,lo_2-1,1) = gphi(i,hi_2,1) gphi(i,lo_2-1,2) = gphi(i,hi_2,2) enddo endif if (bcy_hi .eq. PERIODIC) then do i = lo_1,hi_1 gphi(i,hi_2+1,1) = gphi(i,lo_2,1) gphi(i,hi_2+1,2) = gphi(i,lo_2,2) enddo endif endif if (g_lo_1 .le. lo_1-1 .and. g_hi_1 .ge. hi_1+1 .and. $ g_lo_2 .le. lo_2-1 .and. g_hi_2 .ge. hi_2+1 .and. $ (bcx_lo .eq. PERIODIC .and. bcy_lo .eq. PERIODIC) ) then gphi(lo_1-1,lo_2-1,1) = gphi(hi_1,hi_2,1) gphi(lo_1-1,lo_2-1,2) = gphi(hi_1,hi_2,2) gphi(hi_1+1,lo_2-1,1) = gphi(lo_1,hi_2,1) gphi(hi_1+1,lo_2-1,2) = gphi(lo_1,hi_2,2) gphi(lo_1-1,hi_2+1,1) = gphi(hi_1,lo_2,1) gphi(lo_1-1,hi_2+1,2) = gphi(hi_1,lo_2,2) gphi(hi_1+1,hi_2+1,1) = gphi(lo_1,lo_2,1) gphi(hi_1+1,hi_2+1,2) = gphi(lo_1,lo_2,2) endif return end c ************************************************************************* c ** RHSHG ** c ** Compute the right-hand-side D(V) for the projection c ************************************************************************* subroutine FORT_RHSHG(du,u,divu_src,r,DIMS,hx,hy, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,norm,time,dt) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T du(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T divu_src(lo_1 :hi_1+1,lo_2 :hi_2+1) REAL_T r(lo_1-1:hi_1+1) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T hx REAL_T hy REAL_T time REAL_T dt integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables REAL_T fac,norm REAL_T rnode REAL_T factor REAL_T sum_src, sum_fac integer i, j, n integer is,ie,js,je integer istart,iend integer jstart,jend logical is_singular is = lo_1 ie = hi_1 js = lo_2 je = hi_2 norm = zero istart = cvmgt(lo_1+1,lo_1 ,bcx_lo .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,bcx_hi .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,bcy_lo .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,bcy_hi .eq. OUTLET) if (bcx_lo .eq. PERIODIC) then do n = 1,2 do j = js-1,je+1 u(is-1,j,n) = u(ie,j,n) u(ie+1,j,n) = u(is,j,n) enddo enddo endif if (bcy_lo .eq. PERIODIC) then do n = 1,2 do i = is-1,ie+1 u(i,js-1,n) = u(i,je,n) u(i,je+1,n) = u(i,js,n) enddo enddo endif is_singular = .true. if (bcx_lo .eq. OUTLET .or. bcy_lo .eq. OUTLET .or. $ bcx_hi .eq. OUTLET .or. bcy_hi .eq. OUTLET) is_singular = .false. fac = one/twelve*(one/(hx*hx) + one/(hy*hy)) do j = jstart,jend do i = istart,iend du(i,j) = (r(i )*(u(i ,j-1,1) + u(i ,j,1)) - $ r(i-1)*(u(i-1,j-1,1) + u(i-1,j,1))) / (two*hx) + $ ((r(i-1)* u(i-1,j ,2) + r(i)*u(i,j ,2)) - $ (r(i-1)* u(i-1,j-1,2) + r(i)*u(i,j-1,2))) / (two*hy) enddo enddo if (bcx_lo .eq. WALL) then i = is do j = jstart,jend du(i,j) = r(i)*( (u(i,j-1,1) + u(i,j ,1))/ (two*hx) $ +(u(i,j ,2) - u(i,j-1,2))/ (two*hy) ) enddo endif if (bcx_hi .eq. WALL) then i = ie+1 do j = jstart,jend du(i,j) = r(i-1)*(-(u(i-1,j-1,1) + u(i-1,j,1))/ (two*hx) $ +(u(i-1,j,2) - u(i-1,j-1,2))/ (two*hy) ) enddo endif if (bcy_lo .eq. WALL) then j = js do i = is,iend du(i,j) = ( (r(i )*u(i ,j,1) - r(i-1)*u(i-1,j,1))/ (two*hx) $ +(r(i-1)*u(i-1,j,2) + r(i )*u(i ,j,2))/ (two*hy) ) enddo endif if (bcy_hi .eq. WALL) then j = je+1 do i = is,iend du(i,j) = ( (r(i )*u(i ,j-1,1) - r(i-1)*u(i-1,j-1,1))/ (two*hx) $ -(r(i-1)*u(i-1,j-1,2) + r(i )*u(i ,j-1,2))/ (two*hy) ) enddo endif if (bcx_lo .eq. WALL .and. bcy_lo .eq. WALL) then i = is j = js du(i,j) = r(i)*(u(i,j,1)/(two*hx) + u(i,j,2)/(two*hy)) endif if (bcx_hi .eq. WALL .and. bcy_lo .eq. WALL) then i = ie+1 j = js du(i,j) = r(i-1)*(-u(i-1,j,1)/(two*hx) + u(i-1,j,2)/(two*hy)) endif if (bcx_lo .eq. WALL .and. bcy_hi .eq. WALL) then i = is j = je+1 du(i,j) = r(i)*(u(i,j-1,1)/(two*hx) - u(i,j-1,2)/(two*hy)) endif if (bcx_hi .eq. WALL .and. bcy_hi .eq. WALL) then i = ie+1 j = je+1 du(i,j) = -r(i-1)*(u(i-1,j-1,1)/(two*hx) + u(i-1,j-1,2)/(two*hy)) endif if (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) then do j = jstart,jend du(is,j) = two*du(is,j) enddo endif if (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) then do j = jstart,jend du(ie+1,j) = two*du(ie+1,j) enddo endif if (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) then do i = istart,iend du(i,js) = two*du(i,js) enddo endif if (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) then do i = istart,iend du(i,je+1) = two*du(i,je+1) enddo endif do j = jstart,jend do i = istart,iend rnode = half * (r(i) + r(i-1)) du(i,j) = du(i,j) - rnode * divu_src(i,j) enddo enddo if (is_singular) then sum_src = zero sum_fac = zero do j = jstart, jend do i = istart, iend factor = one factor = cvmgt(half*factor,factor,i.eq.lo_1 .or. i.eq.hi_1+1) factor = cvmgt(half*factor,factor,j.eq.lo_2 .or. j.eq.hi_2+1) sum_src = sum_src + factor * du(i,j) sum_fac = sum_fac + factor enddo enddo sum_src = sum_src / sum_fac c write(6,999) sum_src do j = jstart, jend do i = istart, iend du(i,j) = du(i,j) - sum_src enddo enddo endif do j = jstart,jend do i = istart,iend norm = max(norm, abs(du(i,j))) enddo enddo 999 format('Singular adjustment is ',e12.5) return end c ************************************************************************* c ** PROJUHG ** c ** Define the updated pressure and vector field c ************************************************************************* subroutine FORT_PROJUHG(u,pressure,phi,gradphi,rhonph,DIMS) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T pressure(lo_1 :hi_1+1,lo_2 :hi_2+1) REAL_T phi(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T gradphi(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T rhonph(lo_1-1:hi_1+1,lo_2-1:hi_2+1) c Local variables integer i, j do j = lo_2,hi_2 do i = lo_1,hi_1 u(i,j,1) = u(i,j,1) - gradphi(i,j,1)/rhonph(i,j) u(i,j,2) = u(i,j,2) - gradphi(i,j,2)/rhonph(i,j) enddo enddo do j = lo_2,hi_2+1 do i = lo_1,hi_1+1 pressure(i,j) = phi(i,j) enddo enddo return end c ************************************************************************* c ** RESIDUAL ** c ** Compute the residual R = f - D(sigma G(phi)) c ************************************************************************* subroutine FORT_RESIDUAL(residual,phi,source,sigma,dgphi, $ DIMS,hx,hy,resnorm,bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T residual(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T phi(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T source(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T dgphi(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T hx REAL_T hy REAL_T resnorm integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables integer i,j integer istart,iend integer jstart,jend resnorm = zero istart = cvmgt(lo_1+1,lo_1 ,bcx_lo .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,bcx_hi .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,bcy_lo .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,bcy_hi .eq. OUTLET) call makedgphi(phi,dgphi,sigma,DIMS,hx,hy,bcx_lo,bcx_hi,bcy_lo,bcy_hi) do j = jstart,jend do i = istart,iend residual(i,j) = source(i,j) - dgphi(i,j) enddo enddo do j = jstart,jend do i = istart,iend resnorm = max(resnorm,abs(residual(i,j))) enddo enddo return end c ************************************************************************* c ** RELAX ** c ** Gauss-Seidel relaxation c ************************************************************************* subroutine FORT_RELAX(phi,source,sigma,dgphi,DIMS,hx,hy, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,nnrelax) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T phi(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T source(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T dgphi(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T hx REAL_T hy integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi integer nnrelax c Local variables REAL_T hxsqinv,hysqinv REAL_T rfac integer i,j integer iter integer is,ie,js,je integer istart,iend integer jstart,jend c Additional temporaries for the line solve REAL_T a_ls(0:4096) REAL_T b_ls(0:4096) REAL_T c_ls(0:4096) REAL_T r_ls(0:4096) REAL_T u_ls(0:4096) integer do_line integer ilen,jlen is = lo_1 ie = hi_1 js = lo_2 je = hi_2 hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) istart = cvmgt(lo_1+1,lo_1 ,bcx_lo .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,bcx_hi .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,bcy_lo .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,bcy_hi .eq. OUTLET) if (hy. gt. 1.5*hx) then do_line = 1 ilen = iend - istart + 1 if (ilen .gt. 4096) then print *,'TOO BIG FOR LINE SOLVE IN GSRB: ilen = ',ilen stop endif elseif (hx .gt. 1.5*hy) then do_line = 2 jlen = jend - jstart + 1 if (jlen .gt. 4096) then print *,'TOO BIG FOR LINE SOLVE IN GSRB: jlen = ',jlen stop endif else do_line = 0 endif do iter = 1, nnrelax if (bcx_lo .eq. PERIODIC) then do j = js-1,je+2 phi(ie+1,j) = phi(is ,j) phi(ie+2,j) = phi(is+1,j) phi(is-1,j) = phi(ie ,j) enddo endif if (bcy_lo .eq. PERIODIC) then do i = is-1,ie+2 phi(i,je+1) = phi(i,js ) phi(i,je+2) = phi(i,js+1) phi(i,js-1) = phi(i,je ) enddo endif call makedgphi(phi,dgphi,sigma,DIMS,hx,hy,bcx_lo,bcx_hi,bcy_lo,bcy_hi) if (do_line .eq. 0) then do j = jstart,jend do i = istart,iend #if 0 dgphi(i,j) = sixth * ( $ hxsqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) - phi(i,j-1) + $ two * phi(i-1,j)) + $ sigma(i-1,j ) * (phi(i-1,j+1) - phi(i,j+1) + $ two * phi(i-1,j)) + $ sigma(i ,j-1) * (phi(i+1,j-1) - phi(i,j-1) + $ two * phi(i+1,j)) + $ sigma(i ,j ) * (phi(i+1,j+1) - phi(i,j+1) + $ two * phi(i+1,j)) - $ two*(sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) * phi(i,j)) + $ hysqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) - phi(i-1,j) + $ two * phi(i ,j-1)) + $ sigma(i-1,j ) * (phi(i-1,j+1) - phi(i-1,j) + $ two * phi(i ,j+1)) + $ sigma(i ,j-1) * (phi(i+1,j-1) - phi(i+1,j) + $ two * phi(i ,j-1)) + $ sigma(i ,j ) * (phi(i+1,j+1) - phi(i+1,j) + $ two * phi(i,j+1)) - $ two*(sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) * phi(i,j)) ) #endif rfac = (hxsqinv + hysqinv) * $ (sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) if ( (i .eq. is .or. i .eq. ie+1) .and. bcx_lo .ne. PERIODIC) then c dgphi(i,j) = two*dgphi(i,j) rfac = two*rfac endif if ( (j .eq. js .or. j .eq. je+1) .and. bcy_lo .ne. PERIODIC) then c dgphi(i,j) = two*dgphi(i,j) rfac = two*rfac endif rfac = three/rfac phi(i,j) = phi(i,j) + rfac*(dgphi(i,j) - source(i,j)) enddo enddo else if (do_line .eq. 1) then do j = jstart,jend do i = istart,iend a_ls(i-istart) = third * hxsqinv * $ (sigma(i-1,j-1) + sigma(i-1,j)) $ - sixth * hysqinv * $ (sigma(i-1,j-1) + sigma(i-1,j)) c_ls(i-istart) = third * hxsqinv * $ (sigma(i,j-1) + sigma(i,j)) $ - sixth * hysqinv * $ (sigma(i,j-1) + sigma(i,j)) b_ls(i-istart) = -third * (hxsqinv + hysqinv) * $ (sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) dgphi(i,j) = sixth * ( $ hxsqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) - phi(i,j-1) ) + $ sigma(i-1,j ) * (phi(i-1,j+1) - phi(i,j+1) ) + $ sigma(i ,j-1) * (phi(i+1,j-1) - phi(i,j-1) ) + $ sigma(i ,j ) * (phi(i+1,j+1) - phi(i,j+1) ) ) + $ hysqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) + $ two * phi(i ,j-1)) + $ sigma(i-1,j ) * (phi(i-1,j+1) + $ two * phi(i ,j+1)) + $ sigma(i ,j-1) * (phi(i+1,j-1) + $ two * phi(i ,j-1)) + $ sigma(i ,j ) * (phi(i+1,j+1) + $ two * phi(i,j+1)) ) ) if ( (i .eq. is .and. (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET)) .or. $ (i .eq. ie+1 .and. (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET)) ) then dgphi(i,j) = two*dgphi(i,j) a_ls(i-istart) = two*a_ls(i-istart) b_ls(i-istart) = two*b_ls(i-istart) c_ls(i-istart) = two*c_ls(i-istart) endif if ( (j .eq. js .and. (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET)) .or. $ (j .eq. je+1 .and. (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET)) ) then dgphi(i,j) = two*dgphi(i,j) a_ls(i-istart) = two*a_ls(i-istart) b_ls(i-istart) = two*b_ls(i-istart) c_ls(i-istart) = two*c_ls(i-istart) endif r_ls(i-istart) = source(i,j) - dgphi(i,j) enddo call tridiag(a_ls,b_ls,c_ls,r_ls,u_ls,ilen) do i = istart,iend phi(i,j) = u_ls(i-istart) enddo enddo else if (do_line .eq. 2) then do i = istart,iend do j = jstart,jend a_ls(j-jstart) = sixth * hxsqinv * ( $ -sigma(i-1,j-1) - sigma(i,j-1) ) $ + third * hysqinv * ( $ sigma(i-1,j-1) + sigma(i,j-1) ) c_ls(j-jstart) = sixth * hxsqinv * ( $ -sigma(i-1,j) - sigma(i,j) ) $ + third * hysqinv * ( $ sigma(i-1,j) + sigma(i,j) ) b_ls(j-jstart) = -third * (hxsqinv + hysqinv) * $ (sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) dgphi(i,j) = sixth * ( $ hxsqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) + $ two * phi(i-1,j)) + $ sigma(i-1,j ) * (phi(i-1,j+1) + $ two * phi(i-1,j)) + $ sigma(i ,j-1) * (phi(i+1,j-1) + $ two * phi(i+1,j)) + $ sigma(i ,j ) * (phi(i+1,j+1) + $ two * phi(i+1,j)) ) + $ hysqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) - phi(i-1,j) ) + $ sigma(i-1,j ) * (phi(i-1,j+1) - phi(i-1,j) ) + $ sigma(i ,j-1) * (phi(i+1,j-1) - phi(i+1,j) ) + $ sigma(i ,j ) * (phi(i+1,j+1) - phi(i+1,j) ) ) ) if ( (i .eq. is .and. (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET)) .or. $ (i .eq. ie+1 .and. (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET)) ) then dgphi(i,j) = two*dgphi(i,j) a_ls(j-jstart) = two*a_ls(j-jstart) b_ls(j-jstart) = two*b_ls(j-jstart) c_ls(j-jstart) = two*c_ls(j-jstart) endif if ( (j .eq. js .and. (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET)) .or. $ (j .eq. je+1 .and. (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET)) ) then dgphi(i,j) = two*dgphi(i,j) a_ls(j-jstart) = two*a_ls(j-jstart) b_ls(j-jstart) = two*b_ls(j-jstart) c_ls(j-jstart) = two*c_ls(j-jstart) endif r_ls(j-jstart) = source(i,j) - dgphi(i,j) enddo call tridiag(a_ls,b_ls,c_ls,r_ls,u_ls,jlen) do j = js,jend phi(i,j) = u_ls(j-jstart) enddo enddo endif enddo if (bcx_lo .eq. PERIODIC) then do j = js-1,je+2 phi(ie+1,j) = phi(is ,j) phi(ie+2,j) = phi(is+1,j) phi(is-1,j) = phi(ie ,j) enddo endif if (bcy_lo .eq. PERIODIC) then do i = is-1,ie+2 phi(i,je+1) = phi(i,js ) phi(i,je+2) = phi(i,js+1) phi(i,js-1) = phi(i,je ) enddo endif return end c ************************************************************************* c ** COARSIG ** c ** Coarsening of the sig coefficients c ************************************************************************* subroutine FORT_COARSIG(sigma,sigmac,DIMS,CDIMS, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer loc_1, loc_2 integer hic_1, hic_2 REAL_T sigma(lo_1 -1:hi_1 +1,lo_2 -1:hi_2 +1) REAL_T sigmac(loc_1-1:hic_1+1,loc_2-1:hic_2+1) integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables integer i ,j integer i2,j2 do j = loc_2,hic_2 do i = loc_1,hic_1 i2 = 2*(i-loc_1)+lo_1 j2 = 2*(j-loc_2)+lo_2 sigmac(i,j) = (sigma(i2 ,j2) + sigma(i2 ,j2+1)+ $ sigma(i2+1,j2) + sigma(i2+1,j2+1))*fourth enddo enddo if (bcx_lo .eq. PERIODIC) then do j = loc_2-1,hic_2+1 sigmac(loc_1-1,j) = sigmac(hic_1,j) sigmac(hic_1+1,j) = sigmac(loc_1,j) enddo endif if (bcy_lo .eq. PERIODIC) then do i = loc_1-1,hic_1+1 sigmac(i,loc_2-1) = sigmac(i,hic_2) sigmac(i,hic_2+1) = sigmac(i,loc_2) enddo endif return end c ************************************************************************* c ** RESTRICT ** c ** Conservative restriction of the residual c ************************************************************************* subroutine FORT_RESTRICT(res,resc,DIMS,CDIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer loc_1, loc_2 integer hic_1, hic_2 REAL_T res(lo_1 -1:hi_1 +2,lo_2 -1:hi_2 +2) REAL_T resc(loc_1-1:hic_1+2,loc_2-1:hic_2+2) integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables integer i,j,ii,jj integer istart,iend integer jstart,jend istart = cvmgt(loc_1+1,loc_1 ,bcx_lo .eq. OUTLET) iend = cvmgt(hic_1 ,hic_1+1,bcx_hi .eq. OUTLET) jstart = cvmgt(loc_2+1,loc_2 ,bcy_lo .eq. OUTLET) jend = cvmgt(hic_2 ,hic_2+1,bcy_hi .eq. OUTLET) if (bcx_lo .eq. PERIODIC) then do j = lo_2-1,hi_2+2 res(hi_1+1,j) = res(lo_1 ,j) res(hi_1+2,j) = res(lo_1+1,j) res(lo_1-1,j) = res(hi_1 ,j) enddo endif if (bcy_lo.eq. PERIODIC) then do i = lo_1-1,hi_1+2 res(i,hi_2+1) = res(i,lo_2 ) res(i,hi_2+2) = res(i,lo_2+1) res(i,lo_2-1) = res(i,hi_2 ) enddo endif do j = jstart,jend do i = istart,iend ii = 2*(i-loc_1)+lo_1 jj = 2*(j-loc_2)+lo_2 resc(i,j) = fourth*res(ii ,jj) + $ eighth*(res(ii+1,jj ) + res(ii-1,jj ) + $ res(ii ,jj+1) + res(ii ,jj-1) ) + $ sixteenth*(res(ii+1,jj+1) + res(ii+1,jj-1) + $ res(ii-1,jj+1) + res(ii-1,jj-1) ) enddo enddo if (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) then i = loc_1 ii = 2*(i-loc_1)+lo_1 do j = jstart,jend jj = 2*(j-loc_2)+lo_2 resc(i,j) = fourth*(res(ii,jj ) + res(ii+1,jj )) + $ eighth*(res(ii,jj-1) + res(ii+1,jj-1)+ $ res(ii,jj+1) + res(ii+1,jj+1) ) enddo endif if (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) then j = loc_2 jj = 2*(j-loc_2)+lo_2 do i = istart,iend ii = 2*(i-loc_1)+lo_1 resc(i,j) = fourth*(res(ii ,jj) + res(ii ,jj+1)) + $ eighth*(res(ii+1,jj) + res(ii+1,jj+1)+ $ res(ii-1,jj) + res(ii-1,jj+1) ) enddo endif if (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) then i = hic_1+1 ii = 2*(i-loc_1)+lo_1 do j = jstart,jend jj = 2*(j-loc_2)+lo_2 resc(i,j) = fourth*(res(ii,jj ) + res(ii-1,jj )) + $ eighth*(res(ii,jj-1) + res(ii-1,jj-1)+ $ res(ii,jj+1) + res(ii-1,jj+1) ) enddo endif if (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) then j = hic_2+1 jj = 2*(j-loc_2)+lo_2 do i = istart,iend ii = 2*(i-loc_1)+lo_1 resc(i,j) = fourth*(res(ii ,jj) + res(ii ,jj-1)) + $ eighth*(res(ii+1,jj) + res(ii+1,jj-1)+ $ res(ii-1,jj) + res(ii-1,jj-1) ) enddo endif if ( (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) .and. $ (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) ) then i = loc_1 j = loc_2 ii = 2*(i-loc_1)+lo_1 jj = 2*(j-loc_2)+lo_2 resc(i,j) = fourth*(res(ii,jj ) + res(ii+1,jj ) + $ res(ii,jj+1) + res(ii+1,jj+1) ) endif if ( (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) .and. $ (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) ) then i = hic_1+1 j = hic_2+1 ii = 2*(i-loc_1)+lo_1 jj = 2*(j-loc_2)+lo_2 resc(i,j) = fourth*(res(ii,jj ) + res(ii-1,jj ) + $ res(ii,jj-1) + res(ii-1,jj-1) ) endif if ( (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) .and. $ (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) ) then i = loc_1 j = hic_2+1 ii = 2*(i-loc_1)+lo_1 jj = 2*(j-loc_2)+lo_2 resc(i,j) = fourth*(res(ii,jj ) + res(ii+1,jj ) + $ res(ii,jj-1) + res(ii+1,jj-1) ) endif if ( (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) .and. $ (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) ) then i = hic_1+1 j = loc_2 ii = 2*(i-loc_1)+lo_1 jj = 2*(j-loc_2)+lo_2 resc(i,j) = fourth*(res(ii,jj ) + res(ii-1,jj ) + $ res(ii,jj+1) + res(ii-1,jj+1) ) endif return end c ************************************************************************* c ** INTERP ** c ** Simple bilinear interpolation c ************************************************************************* subroutine FORT_INTERP(phi,deltac,DIMS,CDIMS) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer loc_1, loc_2 integer hic_1, hic_2 REAL_T phi(lo_1 -1:hi_1 +2,lo_2 -1:hi_2 +2) REAL_T deltac(loc_1-1:hic_1+2,loc_2-1:hic_2+2) c Local variables integer i,j,ii,jj integer is,ie,js,je,isc,iec,jsc,jec is = lo_1 js = lo_2 ie = hi_1 je = hi_2 isc = loc_1 jsc = loc_2 iec = hic_1 jec = hic_2 do j = jsc, jec+1 do i = isc, iec+1 ii = 2*(i-isc)+is jj = 2*(j-jsc)+js phi(ii,jj) = deltac(i,j) enddo enddo do j = jsc, jec do i = isc, iec+1 ii = 2*(i-isc)+is jj = 2*(j-jsc)+js phi(ii,jj+1) = half*(deltac(i,j) + deltac(i,j+1)) enddo enddo do j = jsc, jec+1 do i = isc, iec ii = 2*(i-isc)+is jj = 2*(j-jsc)+js phi(ii+1,jj) = half*(deltac(i,j) + deltac(i+1,j)) enddo enddo do j = jsc, jec do i = isc, iec ii = 2*(i-isc)+is jj = 2*(j-jsc)+js phi(ii+1,jj+1) = fourth*(deltac(i,j ) + deltac(i+1,j ) + $ deltac(i,j+1) + deltac(i+1,j+1) ) enddo enddo return end c ************************************************************************* c ** MAKEDGPHI ** c ** Compute D(sig G(phi)) c ************************************************************************* subroutine makedgphi(phi,dgphi,sigma,DIMS,hx,hy, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T phi(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T dgphi(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T hx REAL_T hy integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables REAL_T hxsqinv REAL_T hysqinv integer is,ie,js,je integer i,j is = lo_1 js = lo_2 ie = hi_1 je = hi_2 hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) if (bcx_lo .eq. PERIODIC) then do j = js,je+1 phi(ie+2,j) = phi(is+1,j) phi(is-1,j) = phi(ie ,j) enddo endif if (bcy_lo .eq. PERIODIC) then do i = is,ie+1 phi(i,je+2) = phi(i,js+1) phi(i,js-1) = phi(i,je ) enddo endif if (bcx_lo .eq. PERIODIC .and. bcy_lo .eq. PERIODIC) then phi(is-1,js-1) = phi(ie ,je ) phi(is-1,je+2) = phi(ie ,js+1) phi(ie+2,js-1) = phi(is+1,je ) phi(ie+2,je+2) = phi(is+1,js+1) endif do j = js,je+1 do i = is,ie+1 dgphi(i,j) = sixth * (hxsqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) - phi(i,j-1) + two * phi(i-1,j)) + $ sigma(i-1,j ) * (phi(i-1,j+1) - phi(i,j+1) + two * phi(i-1,j)) + $ sigma(i ,j-1) * (phi(i+1,j-1) - phi(i,j-1) + two * phi(i+1,j)) + $ sigma(i ,j ) * (phi(i+1,j+1) - phi(i,j+1) + two * phi(i+1,j)) - $ two*(sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) * phi(i,j)) + $ hysqinv * $ (sigma(i-1,j-1) * (phi(i-1,j-1) - phi(i-1,j) + two * phi(i,j-1)) + $ sigma(i-1,j ) * (phi(i-1,j+1) - phi(i-1,j) + two * phi(i,j+1)) + $ sigma(i ,j-1) * (phi(i+1,j-1) - phi(i+1,j) + two * phi(i,j-1)) + $ sigma(i ,j ) * (phi(i+1,j+1) - phi(i+1,j) + two * phi(i,j+1)) - $ two*(sigma(i-1,j-1) + sigma(i-1,j) + $ sigma(i ,j-1) + sigma(i ,j)) * phi(i,j))) enddo enddo if (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) then do j = js,je+1 dgphi(is ,j) = two * dgphi(is ,j) enddo else if (bcx_lo .eq. OUTLET) then do j = js,je+1 dgphi(is ,j) = zero enddo endif if (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) then do j = js,je+1 dgphi(ie+1,j) = two * dgphi(ie+1,j) enddo else if (bcx_hi .eq. OUTLET) then do j = js,je+1 dgphi(ie+1,j) = zero enddo endif if (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) then do i = is,ie+1 dgphi(i,js ) = two * dgphi(i,js ) enddo else if (bcy_lo .eq. OUTLET) then do i = is,ie+1 dgphi(i,js ) = zero enddo endif if (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) then do i = is,ie+1 dgphi(i,je+1) = two * dgphi(i,je+1) enddo else if (bcy_hi .eq. OUTLET) then do i = is,ie+1 dgphi(i,je+1) = zero enddo endif return end c ************************************************************************* c ** SOLVEHG ** c ************************************************************************* subroutine FORT_SOLVEHG(dest,dest0,source,sigma,sum,r,w,z,work, $ DIMS,hx,hy,bcx_lo,bcx_hi,bcy_lo,bcy_hi, $ maxiter,norm,prob_norm) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T dest(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T dest0(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T source(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T sum(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T r(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T w(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T z(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T work(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T hx REAL_T hy integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi integer maxiter REAL_T norm REAL_T prob_norm c Local variables REAL_T factor REAL_T alpha REAL_T beta REAL_T rho REAL_T rhol REAL_T tol,tolfac REAL_T local_norm logical testx logical testy integer i,j,iter integer istart,iend integer jstart,jend tolfac = 1.0d-3 istart = cvmgt(lo_1+1,lo_1 ,bcx_lo .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,bcx_hi .eq. OUTLET) jstart = cvmgt(lo_2+1,lo_2 ,bcy_lo .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,bcy_hi .eq. OUTLET) do j = lo_2-1,hi_2+2 do i = lo_1-1,hi_1+2 dest0(i,j) = dest(i,j) dest(i,j) = zero enddo enddo 10 call makedgphi(dest0,w,sigma,DIMS,hx,hy,bcx_lo,bcx_hi,bcy_lo,bcy_hi) rho = zero norm = zero do j = jstart, jend do i = istart, iend r(i,j) = source(i,j) - w(i,j) enddo enddo local_norm = zero do j = jstart, jend do i = istart, iend factor = one testx = (i .eq. lo_1 .or. i .eq. hi_1+1) testy = (j .eq. lo_2 .or. j .eq. hi_2+1) factor = cvmgt(factor*half,factor,testx) factor = cvmgt(factor*half,factor,testy) local_norm = max(local_norm, abs(r(i,j))) z(i,j) = r(i,j) rho = rho + z(i,j) * r(i,j) * factor norm = max(norm,abs(r(i,j))) enddo enddo tol = Max(tolfac*local_norm,1.0d-15*prob_norm) if (norm .le. tol) return do j = jstart, jend do i = istart, iend work(i,j) = zero dest(i,j) = z(i,j) enddo enddo iter = 0 c write(6,1000) iter, norm/prob_norm 100 continue call makedgphi(dest,w,sigma,DIMS,hx,hy,bcx_lo,bcx_hi,bcy_lo,bcy_hi) alpha = zero do j = jstart, jend do i = istart, iend factor = one testx = (i .eq. lo_1 .or. i .eq. hi_1+1) testy = (j .eq. lo_2 .or. j .eq. hi_2+1) factor = cvmgt(factor*half,factor,testx) factor = cvmgt(factor*half,factor,testy) alpha = alpha + dest(i,j)*w(i,j) * factor enddo enddo alpha = rho / alpha rhol = rho rho = zero norm = zero do j = jstart, jend do i = istart, iend factor = one testx = (i .eq. lo_1 .or. i .eq. hi_1+1) testy = (j .eq. lo_2 .or. j .eq. hi_2+1) factor = cvmgt(factor*half,factor,testx) factor = cvmgt(factor*half,factor,testy) work(i,j) = work(i,j) + alpha * dest(i,j) r(i,j) = r(i,j) - alpha * w(i,j) z(i,j) = r(i,j) rho = rho + z(i,j) * r(i,j) * factor norm = max(norm,abs(r(i,j))) enddo enddo iter = iter+1 c write(6,1000) iter, norm/prob_norm if (norm .le. tol) then do j = jstart, jend do i = istart, iend dest(i,j) = work(i,j) + dest0(i,j) enddo enddo else if (iter .ge. maxiter .or. norm .ge. 100.d0*local_norm) then tolfac = 10.d0 * tolfac iter = 1 do j = jstart, jend do i = istart, iend dest(i,j) = zero enddo enddo goto 10 else beta = rho / rhol do j = jstart, jend do i = istart, iend dest(i,j) = z(i,j) + beta * dest(i,j) enddo enddo goto 100 endif 1000 format('Res/Res0 in solve : ',i4,2x,e12.5) c call flush(6) return end c ************************************************************************* c ** MAKESUM ** c ************************************************************************* subroutine FORT_MAKESUM(sigma,sum,DIMS,hx,hy, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T sum(lo_1-1:hi_1+2,lo_2-1:hi_2+2) REAL_T hx REAL_T hy integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables integer i, j integer is, ie, js, je integer istart,iend integer jstart,jend REAL_T hxsqinv, hysqinv hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) is = lo_1 js = lo_2 ie = hi_1 je = hi_2 if (bcx_lo .eq. OUTLET) then istart = lo_1+1 else istart = lo_1 endif if (bcx_hi .eq. OUTLET) then iend = hi_1 else iend = hi_1+1 endif if (bcy_lo .eq. OUTLET) then jstart = lo_2+1 else jstart = lo_2 endif if (bcy_hi .eq. OUTLET) then jend = hi_2 else jend = hi_2+1 endif do j = jstart, jend do i = istart, iend sum(i,j) = third * (hxsqinv * $ (sigma(i-1,j-1) + sigma(i-1,j) + sigma(i,j-1) + sigma(i,j)) + $ hysqinv * $ (sigma(i-1,j-1) + sigma(i-1,j) + sigma(i ,j-1) + sigma(i,j))) sum(i,j) = -fourth*sum(i,j) enddo enddo if (bcx_lo .eq. WALL) then do j = jstart, jend sum(is ,j) = two * sum(is ,j) enddo endif if (bcx_hi .eq. WALL) then do j = jstart, jend sum(ie+1,j) = two * sum(ie+1,j) enddo endif if (bcy_lo .eq. WALL) then do i = istart, iend sum(i,js ) = two * sum(i,js ) enddo endif if (bcy_hi .eq. WALL) then do i = istart, iend sum(i,je+1) = two * sum(i,je+1) enddo endif return end ccseapps-2.5/CCSEApps/varden2d/MACPROJ_F.H0000644000175000017500000001561211634153073021042 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_XINIT xinit # define FORT_INITSIGMA initsigma # define FORT_COARSIGMA coarsigma # define FORT_RHSMAC rhsmac # define FORT_GRADMAC gradmac # define FORT_RESIDUAL resmac # define FORT_GSRB gsrbmac # define FORT_RESTRICT coarsres # define FORT_INTERPOLATE interp # define FORT_PROJUMAC projumac # define FORT_SOLVEMAC solvemac # define FORT_MKSUMMAC mksummac #else #if defined(BL_FORT_USE_UNDERSCORE) # define FORT_XINIT xinit_ # define FORT_INITSIGMA initsigma_ # define FORT_COARSIGMA coarsigma_ # define FORT_RHSMAC rhsmac_ # define FORT_GRADMAC gradmac_ # define FORT_RESIDUAL resmac_ # define FORT_GSRB gsrbmac_ # define FORT_RESTRICT coarsres_ # define FORT_INTERPOLATE interp_ # define FORT_PROJUMAC projumac_ # define FORT_SOLVEMAC solvemac_ # define FORT_MKSUMMAC mksummac_ #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_XINIT XINIT # define FORT_INITSIGMA INITSIGMA # define FORT_COARSIGMA COARSIGMA # define FORT_RHSMAC RHSMAC # define FORT_RESIDUAL RESMAC # define FORT_GSRB GSRBMAC # define FORT_GRADMAC GRADMAC # define FORT_RESTRICT COARSRES # define FORT_INTERPOLATE INTERP # define FORT_PROJUMAC PROJUMAC # define FORT_SOLVEMAC SOLVEMAC # define FORT_MKSUMMAC MKSUMMAC #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_XINIT xinit # define FORT_INITSIGMA initsigma # define FORT_COARSIGMA coarsigma # define FORT_RHSMAC rhsmac # define FORT_RESIDUAL resmac # define FORT_GSRB gsrbmac # define FORT_GRADMAC gradmac # define FORT_RESTRICT coarsres # define FORT_INTERPOLATE interp # define FORT_PROJUMAC projumac # define FORT_SOLVEMAC solvemac # define FORT_MKSUMMAC mksummac #endif extern "C" { void FORT_XINIT(Real * x, Real * xhalf, Real * hx, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, int * irz); void FORT_INITSIGMA(Real * sigmax, Real * sigmay, Real * rho, Real * x, Real * xhalf, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); void FORT_RHSMAC(Real * uhalfx, Real * uhalfy, Real * divu_src, Real * rhs, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, Real * r, Real * rhalf, Real * rhsnorm); void FORT_GRADMAC(Real * gradpx, Real * gradpy, Real * phi, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); void FORT_RESIDUAL(Real * resid, Real * phi, Real * f, Real * sigmax, Real * sigmay, Real * x, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, Real * rnorm, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); void FORT_COARSIGMA(Real * sigmax , Real * sigmay, Real * sigmaxc, Real * sigmayc, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, const int & loc_1, const int & loc_2, const int & hic_1, const int & hic_2); void FORT_GSRB(Real * phi, Real * f, Real * sigmax, Real * sigmay, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * nngsrb); void FORT_RESTRICT(Real * res, Real * resc, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, const int & loc_1, const int & loc_2, const int & hic_1, const int & hic_2); void FORT_INTERPOLATE(Real * phi, Real * deltac, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, const int & loc_1, const int & loc_2, const int & hic_1, const int & hic_2); void FORT_PROJUMAC(Real * uhalfx, Real * uhalfy, Real * gradpx, Real * gradpy, Real * rho, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2); void FORT_SOLVEMAC(Real * dest, Real * dest0, Real *source, Real * sigmax, Real * sigmay, Real * sum, Real * r, Real * w, Real * z, Real * work, Real * x, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, Real * norm, Real * prob_norm); void FORT_MKSUMMAC(Real * sigmax, Real * sigmay, Real * sum, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); }; #endif ccseapps-2.5/CCSEApps/varden2d/amrvis.defaults0000644000175000017500000000036411634153073022421 0ustar amckinstryamckinstrypalette Palette initialderived vort initialscale 1 numberformat %8.6f maxpixmapsize 1000000 reservesystemcolors 35 showboxes TRUE windowheight 650 windowwidth 1100 ccseapps-2.5/CCSEApps/varden2d/slopey.F0000644000175000017500000001731011634153073021010 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** SLOPEY ** c ** Compute the slope of nvar components of s in the y-direction c ************************************************************************* subroutine FORT_SLOPEY(s,sly,dyscr,DIMS,nvar,bcy_lo,bcy_hi,slope_order) implicit none integer DIMS integer nvar integer bcy_lo,bcy_hi integer slope_order REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,nvar) REAL_T sly(lo_1-1:hi_1+1,lo_2-1:hi_2+1,nvar) REAL_T dyscr(lo_2-1:hi_2+1,4) integer cen,lim,flag,fromm parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ie,je,i,j,iv is = lo_1 js = lo_2 ie = hi_1 je = hi_2 c ::: HERE DOING 1ST ORDER if (slope_order .eq. 0) then do iv = 1,nvar do j = js-1,je+1 do i = is-1,ie+1 sly(i,j,iv) = zero enddo enddo enddo c ::: HERE DOING 2ND ORDER else if (slope_order .eq. 2) then do iv=1,nvar do j = js,je do i = is-1,ie+1 del = half*(s(i,j+1,iv) - s(i,j-1,iv)) dpls = two *(s(i,j+1,iv) - s(i,j ,iv)) dmin = two *(s(i,j ,iv) - s(i,j-1,iv)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,j,iv)= sflag*min(slim,abs(del)) enddo enddo if (bcy_lo .eq. PERIODIC) then do i = is,ie sly(i,js-1,iv) = sly(i,je,iv) enddo elseif (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) then do i = is-1,ie+1 sly(i,js-1,iv) = zero del = (s(i,js+1,iv)+three*s(i,js,iv)- $ four*s(i,js-1,iv)) * third dpls = two*(s(i,js+1,iv) - s(i,js ,iv)) dmin = two*(s(i,js ,iv) - s(i,js-1,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,js,iv)= sflag*min(slim,abs(del)) enddo else if (bcy_lo .eq. OUTLET) then do i = is-1, ie+1 sly(i,js-1,iv) = zero enddo endif if (bcy_hi .eq. PERIODIC) then do i = is,ie sly(i,je+1,iv) = sly(i,js,iv) enddo elseif (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) then do i = is-1, ie+1 sly(i,je+1,iv) = zero del = -(s(i,je-1,iv)+three*s(i,je,iv)- $ four*s(i,je+1,iv)) * third dpls = two*(s(i,je+1,iv) - s(i,je ,iv)) dmin = two*(s(i,je ,iv) - s(i,je-1,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,je,iv)= sflag*min(slim,abs(del)) enddo else if (bcy_hi .eq. OUTLET) then do i = is-1, ie+1 sly(i,je+1,iv) = zero enddo endif enddo else c ::: HERE DOING 4TH ORDER do iv=1,nvar do i = is-1,ie+1 do j = js,je dyscr(j,cen) = half*(s(i,j+1,iv)-s(i,j-1,iv)) dmin = two*(s(i,j ,iv)-s(i,j-1,iv)) dpls = two*(s(i,j+1,iv)-s(i,j ,iv)) dyscr(j,lim) = min(abs(dmin),abs(dpls)) dyscr(j,lim) = cvmgp(dyscr(j,lim),zero,dpls*dmin) dyscr(j,flag) = sign(one,dyscr(j,cen)) dyscr(j,fromm)= dyscr(j,flag)*min(dyscr(j,lim),abs(dyscr(j,cen))) enddo if (bcy_lo .eq. PERIODIC) then dyscr(js-1,fromm) = dyscr(je,fromm) else dyscr(js-1,fromm) = dyscr(js,fromm) endif if (bcy_hi .eq. PERIODIC) then dyscr(je+1,fromm) = dyscr(js,fromm) else dyscr(je+1,fromm) = dyscr(je,fromm) endif do j = js,je ds = two * two3rd * dyscr(j,cen) - $ sixth * (dyscr(j+1,fromm) + dyscr(j-1,fromm)) sly(i,j,iv) = dyscr(j,flag)*min(abs(ds),dyscr(j,lim)) enddo if (bcy_lo .eq. PERIODIC) then sly(i,js-1,iv) = sly(i,je,iv) elseif (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) then sly(i,js-1,iv) = zero del = -sixteen/fifteen*s(i,js-1,iv) + half*s(i,js ,iv) + $ two3rd*s(i,js+1,iv) - tenth*s(i,js+2,iv) dmin = two*(s(i,js ,iv)-s(i,js-1,iv)) dpls = two*(s(i,js+1,iv)-s(i,js ,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,js,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at js+1 using the revised dyscr(js,fromm) dyscr(js,fromm) = sly(i,js,iv) ds = two * two3rd * dyscr(js+1,cen) - $ sixth * (dyscr(js+2,fromm) + dyscr(js,fromm)) sly(i,js+1,iv) = dyscr(js+1,flag)*min(abs(ds),dyscr(js+1,lim)) elseif (bcy_lo .eq. OUTLET) then sly(i,js-1,iv) = zero endif if (bcy_hi .eq. PERIODIC) then sly(i,je+1,iv) = sly(i,js,iv) elseif (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) then sly(i,je+1,iv) = zero del = -( -sixteen/fifteen*s(i,je+1,iv) + half*s(i,je ,iv) + $ two3rd*s(i,je-1,iv) - tenth*s(i,je-2,iv) ) dmin = two*(s(i,je ,iv)-s(i,je-1,iv)) dpls = two*(s(i,je+1,iv)-s(i,je ,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,je,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at js+1 using the revised dyscr(js,fromm) dyscr(je,fromm) = sly(i,je,iv) ds = two * two3rd * dyscr(je-1,cen) - $ sixth * (dyscr(je-2,fromm) + dyscr(je,fromm)) sly(i,je-1,iv) = dyscr(je-1,flag)*min(abs(ds),dyscr(je-1,lim)) elseif (bcy_hi .eq. OUTLET) then sly(i,je+1,iv) = zero endif enddo enddo endif return end ccseapps-2.5/CCSEApps/varden2d/inputs60000644000175000017500000002253111634153073020722 0ustar amckinstryamckinstry##############################################################################3 # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 10 ##############################################################################3 # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ##############################################################################3 # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin6 ##############################################################################3 # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ##############################################################################3 # Root part of checkpoint file name check_file_root = chk ##############################################################################3 # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ##############################################################################3 # Root part of plotfile name. plot_file_root = plt ##############################################################################3 # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ##############################################################################3 # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ##############################################################################3 # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ##############################################################################3 # if irz = 0 then use Cartesian(x-y) geometry # If irz = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if irz = 1 then # you must set bcx_lo = 2. irz = 1 ##############################################################################3 # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ##############################################################################3 # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ##############################################################################3 # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 3 ##############################################################################3 # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 4 ##############################################################################3 # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. grid.n_cell = 32 32 ##############################################################################3 # The physical coordinates of the low end of the domain. # This is read by the Grid class. grid.prob_lo = 0. 0. ##############################################################################3 # The physical coordinates of the high end of the domain. # This is read by the Grid class. grid.prob_hi = 1. 1. ##############################################################################3 # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ##############################################################################3 # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.0 ##############################################################################3 # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ##############################################################################3 # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ##############################################################################3 # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ##############################################################################3 # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ##############################################################################3 # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ##############################################################################3 # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/varden2d/xinit.F0000644000175000017500000000437311634153073020635 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** XINIT ** c ** Create the one-dimensional radius arrays for r-z geometry. c ************************************************************************* subroutine xinit(x,xhalf,hx,DIMS,irz) integer DIMS REAL_T x(lo_1-1:hi_1+1) REAL_T xhalf(lo_1 :hi_1+2) REAL_T hx integer irz c Local variables integer i if (irz .eq. 0) then do i = lo_1-1,hi_1+1 x(i) = one enddo do i = lo_1,hi_1+2 xhalf(i) = one enddo elseif (irz .eq. 1) then do i = lo_1,hi_1+1 x(i) = ((i-lo_1) + half)*hx xhalf(i) = (i-lo_1) *hx enddo xhalf(hi_1+2) = (hi_1-lo_1+2)*hx x(lo_1-1) = x(lo_1) else print *,' bogus irz in xinit ',irz stop endif return end ccseapps-2.5/CCSEApps/varden2d/Palette0000644000175000017500000000140011634153073020700 0ustar amckinstryamckinstry #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúöñíéäàÛ×ÓÎÊÅÁ½¸´¯«§¢ž™•‘Œˆƒ #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ccseapps-2.5/CCSEApps/varden2d/diffuser.H0000644000175000017500000001002311634153073021300 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // //@Man: //@Memo: Class for diffusive/viscous solves //@Doc: Class to handle Crank-Nicholson diffusive/viscous solves class diffuser { //@ManDoc: Problem domain in index space Box domain; //@ManDoc: Mesh spacing in x-direction Real hx; //@ManDoc: Mesh spacing in y-direction Real hy; //@ManDoc: Tolerance for multigrid iterative solve Real tol; //@ManDoc: number of smoothing steps as you coarsen static int numSmoothCoarsen; //@ManDoc: number of smoothing steps as you refine static int numSmoothRefine; public: //@ManDoc: Constructor diffuser(const Box& Domain, Real * dx); //@ManDoc: Destructor ~diffuser(); //@ManDoc: Solve for the new-time velocity void solveVel(FArrayBox * staten, FArrayBox * temp, Real * rho, Real mu, int n); //@ManDoc: Solve for the new-time scalar field void solveScal(FArrayBox * staten, FArrayBox * temp, Real mu, int n); }; //@ManDoc: Multigrid solver for the Crank-Nicholson discretization class diffuser_mg : public multigrid { //@Memo: Multigrid solver for diffusive/viscous solves. //@ManDoc: Multigrid level int level; //@ManDoc: Which component of velocity is being solved for int idir; //@ManDoc: Dynamic viscosity coefficient Real mu; //@ManDoc: One-dimensional radius array at cell centers Real *x_mg; //@ManDoc: One-dimensional radius array at nodes Real *xhalf_mg; //@ManDoc: Inflow values along the low x-edge Real *uinx_lo; //@ManDoc: Inflow values along the high x-edge Real *uinx_hi; //@ManDoc: Inflow values along the low y-edge Real *uiny_lo; //@ManDoc: Inflow values along the high y-edge Real *uiny_hi; //@ManDoc: Coefficients 1/rho FArrayBox *sigma; //@ManDoc: Pointer to the next coarsest multigrid level diffuser_mg *Next; //@ManDoc: Scratch space for the conjugate gradient bottom solver FArrayBox *cgwork; //@ManDoc: Compute the residual R = RHS - DG(phi) Real residual(); //@ManDoc: Relax on the residual equation, updating phi void step(int); //@ManDoc: Coarsen the residual to the next coarser multigrid level void Restrict(); //@ManDoc: Interpolate the solution from the next coarser multigrid level void interpolate(); public: //@ManDoc: Constructor diffuser_mg(const Box & Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Resid, FArrayBox * Sigma, Real * X, Real * Xhalf, Real * Uinx_lo, Real * Uinx_hi, Real * Uiny_lo, Real * Uiny_hi, Real Hx, Real Hy, int Level, int Idir); //@ManDoc: Destructor ~diffuser_mg(); }; ccseapps-2.5/CCSEApps/varden2d/multigrid.H0000644000175000017500000000703711634153073021504 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MG_ #define _MG_ // //@Man: //@Memo: Multigrid class /*@Doc: This multigrid class provides the framework for doing the different multigrid solves. It provides virtual versions of the worker functions necessary for implementation of a solver: residual, step (relax or solve), restrict, and interpolate. It also allows for several types of multigrid cycles : V-cycles, W-Cycles, or FMV-cycles (Full Multigrid V-cycles) */ class multigrid { // This friend declaration compensates for a compiler bug. friend class diffuser_mg; friend class macprojection_mg; friend class hgprojection_mg; protected: Box domain; FArrayBox * phi; FArrayBox * source; FArrayBox * resid; Real hx; Real hy; multigrid *next; //@ManDoc: Is this the first instantiation of multigrid? static int first_mg; //@ManDoc: If true, print additional run-time diagnostics static int debug; //@ManDoc: Used to set degrees of verbosity (can be 0,1 or 2) static int verbose; //@ManDoc: Problem norm to be used to define convergence. static Real prob_norm; //@ManDoc: Compute the residual R = RHS - DG(phi) virtual Real residual() = 0; //@ManDoc: Relax on the residual equation, updating phi virtual void step(int) = 0; //@ManDoc: Coarsen the residual to the next coarser multigrid level virtual void Restrict() = 0; //@ManDoc: Interpolate the solution from the next coarser multigrid level virtual void interpolate() = 0; //@ManDoc: Coordinates of the low side of the domain const int * lo_mg; //@ManDoc: Coordinates of the high side of the domain const int * hi_mg; public: //@ManDoc: Constructor multigrid(const Box & Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Resid, Real Hx, Real Hy); //@ManDoc: Solve the linear equation by whichever means void solve(Real tol, Real prob_norm, int nngsrb, int i2=2); //@ManDoc: Perform a Full Multigrid V-Cycle (FMV) Real fmv(Real tol, int nngsrb, int i2=2); //@ManDoc: Perform a single V-Cycle Real vcycle(Real tol, int nngsrb, int i2=2); //@ManDoc: Perform a single W-Cycle Real wcycle(int nngsrb, int i2=2); }; #endif ccseapps-2.5/CCSEApps/varden2d/laplac.F0000644000175000017500000001210211634153073020723 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #if BL_USE_FLOAT #define twentyfive 25.e0 #define fifth 0.2 #else #define twentyfive 25.d0 #define fifth 0.2d0 #endif #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** LAPLAC ** c ** Compute the diffusive/viscous terms c ******************************************************************** subroutine laplac(u,lapu,r,rhalf,DIMS,dx, $ diff_coef,irz,bcx_lo,bcx_hi,bcy_lo,bcy_hi,n) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T r(lo_1-1:hi_1+1) REAL_T rhalf(lo_1:hi_1+2) REAL_T dx(2) REAL_T diff_coef integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi integer irz integer n c Local variables REAL_T hxsqinv, hysqinv REAL_T ux_left,ux_left_wall REAL_T ux_rght,ux_rght_wall REAL_T uy_bot,uy_bot_wall REAL_T uy_top,uy_top_wall integer is, ie, js, je integer i,j is = lo_1 ie = hi_1 js = lo_2 je = hi_2 hxsqinv = one/(dx(1)*dx(1)) hysqinv = one/(dx(2)*dx(2)) if (diff_coef .gt. zero) then do j = js, je do i = is, ie ux_left = (u(i,j) - u(i-1,j)) ux_left_wall = (-sixteen * u(is-1,j) + twenty * u(is,j) $ -five * u(is+1,j) + u(is+2,j) ) * fifth ux_left = cvmgt(ux_left_wall, ux_left, i .eq. is .and. $ (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) .and. $ (irz .eq. 0 .or. (irz .eq. 1 .and. n .eq. 0)) ) ux_left = rhalf(i) * ux_left * hxsqinv ux_rght = (u(i+1,j) - u(i,j)) ux_rght_wall = -(-sixteen * u(ie+1,j) + twenty * u(ie,j) $ -five * u(ie-1,j) + u(ie-2,j) ) * fifth ux_rght = cvmgt(ux_rght_wall, ux_rght, i .eq. ie .and. $ (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) ) ux_rght = rhalf(i+1) * ux_rght * hxsqinv uy_bot = (u(i,j) - u(i,j-1)) uy_bot_wall = (-sixteen * u(i,js-1) + twenty * u(i,js) $ -five * u(i,js+1) + u(i,js+2) ) * fifth uy_bot = cvmgt(uy_bot_wall, uy_bot, j .eq. js .and. $ (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) ) uy_bot = r(i) * uy_bot * hysqinv uy_top = (u(i,j+1) - u(i,j)) uy_top_wall = -(-sixteen * u(i,je+1) + twenty * u(i,je) $ -five * u(i,je-1) + u(i,je-2) ) * fifth uy_top = cvmgt(uy_top_wall, uy_top, j .eq. je .and. $ (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) ) uy_top = r(i) * uy_top * hysqinv lapu(i,j) = diff_coef * (ux_rght-ux_left+uy_top-uy_bot) / r(i) enddo enddo if (irz .eq. 1 .and. n .eq. 0) then do j = js, je do i = is, ie lapu(i,j) = lapu(i,j) - diff_coef*u(i,j)/(r(i)*r(i)) enddo enddo endif else do j = js, je do i = is, ie lapu(i,j) = zero enddo enddo endif if (bcx_lo .eq. PERIODIC) then do j = js,je lapu(is-1,j) = lapu(ie,j) lapu(ie+1,j) = lapu(is,j) enddo endif if (bcy_lo .eq. PERIODIC) then do i = is,ie lapu(i,js-1) = lapu(i,je) lapu(i,je+1) = lapu(i,js) enddo endif if (bcx_lo .eq. PERIODIC .and. bcy_lo .eq. PERIODIC) then lapu(is-1,js-1) = lapu(ie,je) lapu(is-1,je+1) = lapu(ie,js) lapu(ie+1,js-1) = lapu(is,je) lapu(ie+1,je+1) = lapu(is,js) endif return end ccseapps-2.5/CCSEApps/varden2d/probin60000644000175000017500000000024411634153073020666 0ustar amckinstryamckinstry $fortin prob_type = 6 in_xvel = 0.0 in_yvel = 0.0 in_density = 1.0 in_tracer = 0.0 xblob = 0.5 yblob = 0.5 radblob = 0.2 denblob = 1. $end ccseapps-2.5/CCSEApps/varden2d/mkvelflux.F0000644000175000017500000003265011634153073021516 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKVELFLUX ** c ** Create the time-centered edge states for the velocity components c *************************************************************** subroutine FORT_MKVELFLUX(s,sedgex,sedgey,slopex,slopey,uadv,vadv, $ utrans,vtrans,rho,px,py,lapu, $ s_l,s_r,s_b,s_t,DIMS, $ dx,dt,force,visc_coef,irz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer DIMS REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T sedgex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T sedgey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T slopex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T slopey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T utrans(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T vtrans(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T px(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T py(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T s_l(lo_1:hi_1+1,2) REAL_T s_r(lo_1:hi_1+1,2) REAL_T s_b(lo_2:hi_2+1,2) REAL_T s_t(lo_2:hi_2+1,2) REAL_T dx(2) REAL_T dt integer irz REAL_T visc_coef integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables REAL_T ubardth, vbardth REAL_T hx, hy, dth REAL_T uplus,uminus,vplus,vminus,ut,vt REAL_T utr,vtr,savg,uavg,vavg REAL_T uptop,upbot,umtop,umbot,uplft,uprgt,umlft,umrgt REAL_T vptop,vpbot,vmtop,vmbot,vplft,vprgt,vmlft,vmrgt REAL_T eps logical ltm0,ltp0 integer i,j,is,js,ie,je,n eps = 1.0e-8 is = lo_1 ie = hi_1 js = lo_2 je = hi_2 dth = half*dt hx = dx(1) hy = dx(2) do j = js,je do i = is,ie vpbot = s(i,j ,2) + (half - dth*s(i,j ,2)/hy) * slopey(i,j, 2) c $ + dth * lapu(i,j ,2) / rho(i,j) vptop = s(i,j+1,2) - (half + dth*s(i,j+1,2)/hy) * slopey(i,j+1,2) c $ + dth * lapu(i,j+1,2) / rho(i,j+1) upbot = s(i,j ,1) + (half - dth*s(i,j ,2)/hy) * slopey(i,j ,1) c $ + dth * lapu(i, j,1) / rho(i,j) uptop = s(i,j+1,1) - (half + dth*s(i,j+1,2)/hy) * slopey(i,j+1,1) c $ + dth * lapu(i,j+1,1) / rho(i,j+1) ltp0 = (j .eq. je .and. bcy_hi .eq. INLET) vptop = cvmgt(s(i,je+1,2),vptop,ltp0) vpbot = cvmgt(s(i,je+1,2),vpbot,ltp0) uptop = cvmgt(s(i,je+1,1),uptop,ltp0) upbot = cvmgt(s(i,je+1,1),upbot,ltp0) ltp0 = (j .eq. je .and. bcy_hi .eq. WALL) vptop = cvmgt(zero,vptop,ltp0) vpbot = cvmgt(zero,vpbot,ltp0) uptop = cvmgt(upbot,uptop,ltp0) ltp0 = (j .eq. je .and. bcy_hi .eq. WALL .and. visc_coef .gt. zero) uptop = cvmgt(zero,uptop,ltp0) upbot = cvmgt(zero,upbot,ltp0) uplus = cvmgp(upbot,uptop,vtrans(i,j+1)) uavg = half * (upbot + uptop) uplus = cvmgt(uplus, uavg, abs(vtrans(i,j+1)) .gt. eps) vplus = cvmgp(vpbot,vptop,vtrans(i,j+1)) vavg = half * (vpbot + vptop) vplus = cvmgt(vplus, vavg, abs(vtrans(i,j+1)) .gt. eps) vmtop = s(i,j ,2) - (half + dth*s(i,j ,2)/hy) * slopey(i,j ,2) c $ + dth * lapu(i,j ,2) / rho(i,j) vmbot = s(i,j-1,2) + (half - dth*s(i,j-1,2)/hy) * slopey(i,j-1,2) c $ + dth * lapu(i,j-1,2) / rho(i,j-1) umtop = s(i,j ,1) - (half + dth*s(i,j ,2)/hy) * slopey(i,j ,1) c $ + dth * lapu(i,j ,1) / rho(i,j) umbot = s(i,j-1,1) + (half - dth*s(i,j-1,2)/hy) * slopey(i,j-1,1) c $ + dth * lapu(i,j-1,1) / rho(i,j-1) ltm0 = (j .eq. js .and. bcy_lo .eq. INLET) vmtop = cvmgt(s(i,js-1,2),vmtop,ltm0) vmbot = cvmgt(s(i,js-1,2),vmbot,ltm0) umtop = cvmgt(s(i,js-1,1),umtop,ltm0) umbot = cvmgt(s(i,js-1,1),umbot,ltm0) ltm0 = (j .eq. js .and. bcy_lo .eq. WALL) vmtop = cvmgt(zero ,vmtop,ltm0) vmbot = cvmgt(zero ,vmbot,ltm0) umbot = cvmgt(umtop,umbot,ltm0) ltm0 = (j .eq. js .and. bcy_lo .eq. WALL .and. visc_coef .gt. zero) umtop = cvmgt(zero,umtop,ltm0) umbot = cvmgt(zero,umbot,ltm0) uminus = cvmgp(umbot,umtop,vtrans(i,j)) uavg = half * (umbot + umtop) uminus = cvmgt(uminus, uavg, abs(vtrans(i,j)) .gt. eps) vminus = cvmgp(vmbot,vmtop,vtrans(i,j)) vavg = half * (vmbot + vmtop) vminus = cvmgt(vminus, vavg, abs(vtrans(i,j)) .gt. eps) utr = half * (vtrans(i,j)+vtrans(i,j+1))*(uplus - uminus) / hy vtr = half * (vtrans(i,j)+vtrans(i,j+1))*(vplus - vminus) / hy ut = (lapu(i,j,1)-px(i,j))/rho(i,j) - utr + force(i,j,1) vt = (lapu(i,j,2)-py(i,j))/rho(i,j) - vtr + force(i,j,2) ubardth = dth*s(i,j,1)/hx s_l(i+1,1)= s(i,j,1) + (half-ubardth)*slopex(i,j,1) + dth*ut s_l(i+1,2)= s(i,j,2) + (half-ubardth)*slopex(i,j,2) + dth*vt s_r(i ,1)= s(i,j,1) - (half+ubardth)*slopex(i,j,1) + dth*ut s_r(i ,2)= s(i,j,2) - (half+ubardth)*slopex(i,j,2) + dth*vt enddo if (bcx_lo .eq. PERIODIC) then s_l(is ,1) = s_l(ie+1,1) s_l(is ,2) = s_l(ie+1,2) elseif (bcx_lo .eq. WALL) then s_l(is ,1) = zero s_r(is ,1) = zero s_l(is ,2) = s_r(is ,2) elseif (bcx_lo .eq. INLET) then s_l(is ,1) = s(is-1,j,1) s_l(is ,2) = s(is-1,j,2) elseif (bcx_lo .eq. OUTLET) then s_l(is ,1) = s_r(is ,1) s_l(is ,2) = s_r(is ,2) endif if (bcx_hi .eq. PERIODIC) then s_r(ie+1,1) = s_r(is ,1) s_r(ie+1,2) = s_r(is ,2) elseif (bcx_hi .eq. WALL) then s_l(ie+1,1) = zero s_r(ie+1,1) = zero s_r(ie+1,2) = s_l(ie+1,2) elseif (bcx_hi .eq. INLET) then s_r(ie+1,1) = s(ie+1,j,1) s_r(ie+1,2) = s(ie+1,j,2) elseif (bcx_hi .eq. OUTLET) then s_r(ie+1,1) = s_l(ie+1,1) s_r(ie+1,2) = s_l(ie+1,2) endif do n = 1,2 do i = is, ie+1 sedgex(i,j,n)=cvmgp(s_l(i,n),s_r(i,n),uadv(i,j)) savg = half*(s_r(i,n) + s_l(i,n)) sedgex(i,j,n)=cvmgt(savg,sedgex(i,j,n),abs(uadv(i,j)) .lt. eps) enddo enddo if (bcx_lo .eq. WALL) then sedgex(is ,j,1) = zero endif if (bcx_hi .eq. WALL) then sedgex(ie+1,j,1) = zero endif if (bcx_lo .eq. WALL .and. visc_coef .gt. 0.0 .and. irz .eq. 0) then sedgex(is ,j,2) = zero endif if (bcx_hi .eq. WALL .and. visc_coef .gt. 0.0) then sedgex(ie+1,j,2) = zero endif enddo c ::: loop for y fluxes do i = is, ie do j = js, je vplft = s(i ,j,2) + (half - dth*s(i ,j,1)/hx) * slopex(i ,j,2) c $ + dth * lapu(i ,j,2) / rho(i ,j) vprgt = s(i+1,j,2) - (half + dth*s(i+1,j,1)/hx) * slopex(i+1,j,2) c $ + dth * lapu(i+1,j,2) / rho(i+1,j) uplft = s(i,j ,1 ) + (half - dth*s(i ,j,1)/hx) * slopex(i ,j,1) c $ + dth * lapu(i ,j,1) / rho(i ,j) uprgt = s(i+1,j,1) - (half + dth*s(i+1,j,1)/hx) * slopex(i+1,j,1) c $ + dth * lapu(i+1,j,1) / rho(i+1,j) ltp0 = (i .eq. ie .and. bcx_hi .eq. INLET) uprgt = cvmgt(s(ie+1,j,1),uprgt,ltp0) uplft = cvmgt(s(ie+1,j,1),uplft,ltp0) vprgt = cvmgt(s(ie+1,j,2),vprgt,ltp0) vplft = cvmgt(s(ie+1,j,2),vplft,ltp0) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL) uprgt = cvmgt(zero,uprgt,ltp0) uplft = cvmgt(zero,uplft,ltp0) vprgt = cvmgt(vplft,vprgt,ltp0) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL .and. visc_coef .gt. zero) vprgt = cvmgt(zero,vprgt,ltp0) vplft = cvmgt(zero,vplft,ltp0) uplus = cvmgp(uplft,uprgt,utrans(i+1,j)) uavg = half * (uplft + uprgt) uplus = cvmgt(uplus, uavg, abs(utrans(i+1,j)) .gt. eps) vplus = cvmgp(vplft,vprgt,utrans(i+1,j)) vavg = half * (vplft + vprgt) vplus = cvmgt(vplus, vavg, abs(utrans(i+1,j)) .gt. eps) vmrgt = s(i ,j,2) - (half + dth*s(i ,j,1)/hx) * slopex(i ,j,2) c $ + dth * lapu(i ,j,2) / rho(i ,j) vmlft = s(i-1,j,2) + (half - dth*s(i-1,j,1)/hx) * slopex(i-1,j,2) c $ + dth * lapu(i-1,j,2) / rho(i-1,j) umrgt = s(i ,j,1) - (half + dth*s(i ,j,1)/hx) * slopex(i ,j,1) c $ + dth * lapu(i ,j,1) / rho(i ,j) umlft = s(i-1,j,1) + (half - dth*s(i-1,j,1)/hx) * slopex(i-1,j,1) c $ + dth * lapu(i-1,j,1) / rho(i-1,j) ltm0 = (i .eq. is .and. bcx_lo .eq. INLET) umrgt = cvmgt(s(is-1,j,1),umrgt,ltm0) umlft = cvmgt(s(is-1,j,1),umlft,ltm0) vmrgt = cvmgt(s(is-1,j,2),vmrgt,ltm0) vmlft = cvmgt(s(is-1,j,2),vmlft,ltm0) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL) umrgt = cvmgt(zero ,umrgt,ltm0) umlft = cvmgt(zero ,umlft,ltm0) vmlft = cvmgt(vmrgt,vmlft,ltm0) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL .and. $ visc_coef .gt. zero .and. irz .eq. 0) vmrgt = cvmgt(zero,vmrgt,ltm0) vmlft = cvmgt(zero,vmlft,ltm0) uminus = cvmgp(umlft,umrgt,utrans(i,j)) uavg = half * (umlft + umrgt) uminus = cvmgt(uminus, uavg, abs(utrans(i,j)) .gt. eps) vminus = cvmgp(vmlft,vmrgt,utrans(i,j)) vavg = half * (vmlft + vmrgt) vminus = cvmgt(vminus, vavg, abs(utrans(i,j)) .gt. eps) utr = half * (utrans(i,j)+utrans(i+1,j))*(uplus - uminus) / hx vtr = half * (utrans(i,j)+utrans(i+1,j))*(vplus - vminus) / hx ut = (lapu(i,j,1)-px(i,j))/rho(i,j) - utr + force(i,j,1) vt = (lapu(i,j,2)-py(i,j))/rho(i,j) - vtr + force(i,j,2) vbardth = dth*s(i,j,2)/hy s_b(j+1,1)= s(i,j,1) + (half-vbardth)*slopey(i,j,1) + dth*ut s_t(j ,1)= s(i,j,1) - (half+vbardth)*slopey(i,j,1) + dth*ut s_b(j+1,2)= s(i,j,2) + (half-vbardth)*slopey(i,j,2) + dth*vt s_t(j ,2)= s(i,j,2) - (half+vbardth)*slopey(i,j,2) + dth*vt enddo if (bcy_lo .eq. PERIODIC) then s_b(js ,1) = s_b(je+1,1) s_b(js ,2) = s_b(je+1,2) elseif (bcy_lo .eq. WALL) then s_b(js ,1) = s_t(js ,1) s_b(js ,2) = zero s_t(js ,2) = zero elseif (bcy_lo .eq. INLET) then s_b(js ,1) = s(i,js-1,1) s_b(js ,2) = s(i,js-1,2) elseif (bcy_lo .eq. OUTLET) then s_b(js ,1) = s_t(js ,1) s_b(js ,2) = s_t(js ,2) endif if (bcy_hi .eq. PERIODIC) then s_t(je+1,1) = s_t(js ,1) s_t(je+1,2) = s_t(js ,2) elseif (bcy_hi .eq. WALL) then s_t(je+1,1) = s_b(je+1,1) s_b(je+1,2) = zero s_t(je+1,2) = zero elseif (bcy_hi .eq. INLET) then s_t(je+1,1) = s(i,je+1,1) s_t(je+1,2) = s(i,je+1,2) elseif (bcy_hi .eq. OUTLET) then s_t(je+1,1) = s_b(je+1,1) s_t(je+1,2) = s_b(je+1,2) endif do n = 1,2 do j = js, je+1 sedgey(i,j,n)=cvmgp(s_b(j,n),s_t(j,n),vadv(i,j)) savg = half*(s_b(j,n) + s_t(j,n)) sedgey(i,j,n)=cvmgt(savg,sedgey(i,j,n),abs(vadv(i,j)) .lt. eps) enddo enddo if ((visc_coef .gt. zero) .and. (bcy_lo .eq. WALL)) then sedgey(i,js ,1) = zero sedgey(i,js ,2) = zero endif if ((visc_coef .gt. zero) .and. (bcy_hi .eq. WALL)) then sedgey(i,je+1,1) = zero sedgey(i,je+1,2) = zero endif enddo return end ccseapps-2.5/CCSEApps/varden2d/ContFrame.H0000644000175000017500000000471411634153073021361 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _ContFrame_H_ #define _ContFrame_H_ #ifdef HAS_WINDOWS #include #include // //@Man: //@Doc: Handles a single contour frame, and has the interface to GraphTool //@Memo: Handles a single contour frame class ContFrame { public: friend class Contour; friend std::ostream& operator << (std::ostream &os, Contour &cont); //@ManDoc: Constructor ContFrame(std::string nm, std::string varname, int dev, int freq, int ncont, int sz=400); //@ManDoc: Destructor ~ContFrame(); private: //@ManDoc: Root name of the PostScript file for this variable std::string name; //@ManDoc: Which device (Screen display, PostScript file, or both) GTDevice device; //@ManDoc: Name of the variable to be contoured std::string variable; //@ManDoc: Frequency of plotting int interval; //@ManDoc: Number of contour lines per plot int num_cont; //@ManDoc: Number of pixels in the window int size; //@ManDoc: If true, draw the grids also int draw_mesh; //@ManDoc: Next frame in list ContFrame *next; //@ManDoc: The window to be drawn in GraphTool *win; }; #endif #endif ccseapps-2.5/CCSEApps/varden2d/mkadvvel.F0000644000175000017500000003134511634153073021312 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKADVVEL ** c ** Predict normal edge velocities to be MAC-projected and used c ** for advection velocities c *************************************************************** subroutine FORT_MKADVVEL(u,ux,uy,v,vx,vy,rho,force,px,py,lapu, $ dx,dt,DIMS,stleft,strght,sttop,stbot,uadv,vadv, $ utrans,vtrans,bcx_lo,bcx_hi,bcy_lo,bcy_hi, $ visc_coef,irz) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T ux(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T uy(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T vx(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T vy(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T px(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T py(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T stleft(lo_1-1:hi_1+1) REAL_T strght(lo_1-1:hi_1+1) REAL_T stbot(lo_2-1:hi_2+1) REAL_T sttop(lo_2-1:hi_2+1) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T utrans(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T vtrans(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T dx(2) REAL_T dt integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi REAL_T visc_coef integer irz c Local variables REAL_T ubardth, vbardth REAL_T hx, hy,dth REAL_T uplus,uminus,vplus,vminus,ut,vt REAL_T utr,vtr,savg REAL_T uptop,upbot,umtop,umbot REAL_T vplft,vprgt,vmlft,vmrgt REAL_T vtop,vbot,ulft,urgt REAL_T flgp,flgm REAL_T eps REAL_T umax,umin,vmax,vmin,rhomax,rhomin logical ltp,ltm,ltx,lty,ltm0,ltp0 integer i,j,is,js,ie,je eps = 1.0e-8 is = lo_1 ie = hi_1 js = lo_2 je = hi_2 dth = half*dt hx = dx(1) hy = dx(2) umax = -1.e30 vmax = -1.e30 rhomax = -1.e30 umin = 1.e30 vmin = 1.e30 rhomin = 1.e30 do j = lo_2, hi_2 do i = lo_1, hi_1 umax = max(u(i,j),umax) umin = min(u(i,j),umin) vmax = max(v(i,j),vmax) vmin = min(v(i,j),vmin) rhomax = max(rho(i,j),rhomax) rhomin = min(rho(i,j),rhomin) enddo enddo write(6,1000) umax,umin write(6,1001) vmax,vmin write(6,1002) rhomax,rhomin 1000 format(' U MAX/MIN IN VELPRED ',e21.14,2x,e21.14) 1001 format(' V MAX/MIN IN VELPRED ',e21.14,2x,e21.14) 1002 format('RHO MAX/MIN IN VELPRED ',e21.14,2x,e21.14) c call flush(6) c Create the y-velocity to be used for transverse derivatives. do j = js,je+1 do i = is,ie vtop = v(i,j ) - (half + dth*v(i,j)/hy) * vy(i,j) c $ + dth * lapu(i,j ,2) / rho(i,j ) vbot = v(i,j-1) + (half - dth*v(i,j-1)/hy) * vy(i,j-1) c $ + dth * lapu(i,j-1,2) / rho(i,j-1) vtop = cvmgt(v(i,js-1),vtop,j.eq.js .and. bcy_lo .eq. INLET) vtop = cvmgt(v(i,je+1),vtop,j.eq.je+1 .and. bcy_hi .eq. INLET) vtop = cvmgt(zero ,vtop,j.eq.js .and. bcy_lo .eq. WALL) vtop = cvmgt(zero ,vtop,j.eq.je+1 .and. bcy_hi .eq. WALL) vbot = cvmgt(v(i,js-1),vbot,j.eq.js .and. bcy_lo .eq. INLET) vbot = cvmgt(v(i,je+1),vbot,j.eq.je+1 .and. bcy_hI .eq. INLET) vbot = cvmgt(zero ,vbot,j.eq.js .and. bcy_lo .eq. WALL) vbot = cvmgt(zero ,vbot,j.eq.je+1 .and. bcy_hi .eq. WALL) vtrans(i,j)=cvmgp(vbot,vtop,vbot+vtop) ltm = ( (vbot .le. zero .and. vtop .ge. zero) .or. $ (abs(vbot+vtop) .lt. eps)) vtrans(i,j) = cvmgt(zero,vtrans(i,j),ltm) enddo enddo c Create the x-velocity to be used for transverse derivatives. do j = js,je do i = is,ie+1 urgt = u(i,j ) - (half + dth*u(i,j)/hx) * ux(i,j) c $ + dth * lapu(i ,j,1) / rho(i ,j) ulft = u(i-1,j) + (half - dth*u(i-1,j)/hx) * ux(i-1,j) c $ + dth * lapu(i-1,j,1) / rho(i-1,j) urgt = cvmgt(u(is-1,j),urgt,i.eq.is .and. bcx_lo .eq. INLET) urgt = cvmgt(u(ie+1,j),urgt,i.eq.ie+1 .and. bcx_hi .eq. INLET) urgt = cvmgt(zero ,urgt,i.eq.is .and. bcx_lo .eq. WALL) urgt = cvmgt(zero ,urgt,i.eq.ie+1 .and. bcx_hi .eq. WALL) ulft = cvmgt(u(is-1,j),ulft,i.eq.is .and. bcx_lo .eq. INLET) ulft = cvmgt(u(ie+1,j),ulft,i.eq.ie+1 .and. bcx_hi .eq. INLET) ulft = cvmgt(zero ,ulft,i.eq.is .and. bcx_lo .eq. WALL) ulft = cvmgt(zero ,ulft,i.eq.ie+1 .and. bcx_hi .eq. WALL) utrans(i,j) = cvmgp(ulft,urgt,ulft+urgt) ltm=( (ulft .le. zero .and. urgt .ge. zero) .or. $ (abs(ulft+urgt) .lt. eps) ) utrans(i,j) = cvmgt(zero,utrans(i,j),ltm) enddo enddo c ::: loop for x fluxes do j = js,je do i = is,ie upbot = u(i,j ) + (half - dth*v(i,j )/hy) * uy(i,j ) c $ + dth * lapu(i,j ,1) / rho(i,j ) uptop = u(i,j+1) - (half + dth*v(i,j+1)/hy) * uy(i,j+1) c $ + dth * lapu(i,j+1,1) / rho(i,j+1) uptop = cvmgt(u(i,je+1),uptop,j.eq.je .and. bcy_hi.eq.INLET) upbot = cvmgt(u(i,je+1),upbot,j.eq.je .and. bcy_hi.eq.INLET) uptop = cvmgt(upbot,uptop,j.eq.je .and. bcy_hi.eq.WALL) ltp0 = (j .eq. je .and. bcy_hi .eq. WALL .and. visc_coef .gt. zero) uptop = cvmgt(zero,uptop,ltp0) upbot = cvmgt(zero,upbot,ltp0) flgp=cvmgt(zero,one,abs(vtrans(i,j+1)).lt.eps) uplus = cvmgp(upbot,uptop,vtrans(i,j+1)) uplus = flgp * uplus + (one - flgp)*half*(uptop+upbot) umtop = u(i,j ) - (half + dth*v(i,j)/hy) * uy(i,j) c $ + dth * lapu(i,j ,1) / rho(i,j ) umbot = u(i,j-1) + (half - dth*v(i,j-1)/hy) * uy(i,j-1) c $ + dth * lapu(i,j-1,1) / rho(i,j-1) umtop = cvmgt(u(i,js-1),umtop,j.eq.js .and. bcy_lo.eq.INLET) umbot = cvmgt(u(i,js-1),umbot,j.eq.js .and. bcy_lo.eq.INLET) umbot = cvmgt(umtop,umbot,j.eq.js .and. bcy_lo.eq.WALL) ltm0 = (j .eq. js .and. bcy_lo .eq. WALL .and. visc_coef .gt. zero) umtop = cvmgt(zero,umtop,ltm0) umbot = cvmgt(zero,umbot,ltm0) flgm=cvmgt(zero,one,abs(vtrans(i,j)).lt.eps) uminus = cvmgp(umbot,umtop,vtrans(i,j)) uminus = flgm * uminus + (one - flgm)*half*(umtop+umbot) utr = half * (vtrans(i,j)+vtrans(i,j+1))*(uplus - uminus) / hy ut = (lapu(i,j,1)-px(i,j))/rho(i,j) - utr + force(i,j,1) ubardth = dth*u(i,j)/hx stleft(i )= u(i,j) + (half-ubardth)*ux(i,j) + dth*ut strght(i-1)= u(i,j) - (half+ubardth)*ux(i,j) + dth*ut enddo if (bcx_lo .eq. PERIODIC) then stleft(is-1) = stleft(ie ) elseif (bcx_lo .eq. WALL) then stleft(is-1) = zero strght(is-1) = zero elseif (bcx_lo .eq. INLET) then stleft(is-1) = u(is-1,j) strght(is-1) = u(is-1,j) elseif (bcx_lo .eq. OUTLET) then stleft(is-1) = strght(is-1) endif if (bcx_hi .eq. PERIODIC) then strght(ie ) = strght(is-1) elseif (bcx_hi .eq. WALL) then stleft(ie ) = zero strght(ie ) = zero elseif (bcx_hi .eq. INLET) then stleft(ie) = u(ie+1,j) strght(ie) = u(ie+1,j) elseif (bcx_hi .eq. OUTLET) then strght(ie ) = stleft(ie) endif do i = is-1, ie savg = half*(strght(i) + stleft(i)) ltx = ( (stleft(i) .le. zero .and. $ strght(i) .ge. zero) .or. $ (abs(stleft(i) + strght(i)) .lt. eps) ) uadv(i+1,j)=cvmgp(stleft(i),strght(i),savg) uadv(i+1,j)=cvmgt(savg,uadv(i+1,j),ltx) enddo if (bcx_lo .eq. WALL) then uadv(is ,j) = zero endif if (bcx_hi .eq. WALL) then uadv(ie+1,j) = zero endif enddo c ::: loop for y fluxes do i = is, ie do j = js, je vplft = v(i,j ) + (half - dth*u(i,j)/hx) * vx(i,j) c $ + dth * lapu(i ,j,2) / rho(i ,j) vprgt = v(i+1,j) - (half + dth*u(i+1,j)/hx) * vx(i+1,j) c $ + dth * lapu(i+1,j,2) / rho(i+1,j) vprgt = cvmgt(v(ie+1,j),vprgt,i.eq.ie .and. bcx_hi.eq.INLET) vplft = cvmgt(v(ie+1,j),vplft,i.eq.ie .and. bcx_hi.eq.INLET) vprgt = cvmgt(vplft,vprgt,i.eq.ie .and. bcx_hi.eq.WALL) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL .and. visc_coef .gt. zero) vprgt = cvmgt(zero,vprgt,ltp0) vplft = cvmgt(zero,vplft,ltp0) flgp=cvmgt(zero,one,abs(utrans(i+1,j)).lt.eps) vplus = cvmgp(vplft,vprgt,utrans(i+1,j)) vplus = flgp * vplus + (one - flgp)*half*(vprgt+vplft) vmrgt = v(i,j ) - (half + dth*u(i,j)/hx) * vx(i,j) c $ + dth * lapu(i ,j,2) / rho(i ,j) vmlft = v(i-1,j) + (half - dth*u(i-1,j)/hx) * vx(i-1,j) c $ + dth * lapu(i-1,j,2) / rho(i-1,j) vmrgt = cvmgt(v(is-1,j),vmrgt,i.eq.is .and. bcx_lo.eq.INLET) vmlft = cvmgt(v(is-1,j),vmlft,i.eq.is .and. bcx_lo.eq.INLET) vmlft = cvmgt(vmrgt,vmlft,i.eq.is .and. bcx_lo.eq.WALL) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL .and. visc_coef .gt. zero $ .and. irz .eq. 0) vmrgt = cvmgt(zero,vmrgt,ltm0) vmlft = cvmgt(zero,vmlft,ltm0) flgm=cvmgt(zero,one,abs(utrans(i,j)).lt.eps) vminus = cvmgp(vmlft,vmrgt,utrans(i,j)) vminus = flgm * vminus + (one - flgm)*half*(vmrgt+vmlft) vtr = half * (utrans(i,j)+utrans(i+1,j))*(vplus - vminus) / hx vt = (lapu(i,j,2)-py(i,j))/rho(i,j) - vtr + force(i,j,2) vbardth = dth*v(i,j)/hy stbot(j )= v(i,j) + (half-vbardth)*vy(i,j) + dth*vt sttop(j-1)= v(i,j) - (half+vbardth)*vy(i,j) + dth*vt enddo if (bcy_lo .eq. PERIODIC) then stbot(js-1) = stbot(je ) elseif (bcy_lo .eq. WALL) then stbot(js-1) = zero sttop(js-1) = zero elseif (bcy_lo .eq. INLET) then stbot(js-1) = v(i,js-1) sttop(js-1) = v(i,js-1) elseif (bcy_lo .eq. OUTLET) then stbot(js-1) = sttop(js-1) endif if (bcy_hi .eq. PERIODIC) then sttop(je ) = sttop(js-1) elseif (bcy_hi .eq. WALL) then stbot(je ) = zero sttop(je ) = zero elseif (bcy_hi .eq. INLET) then stbot(je ) = v(i,je+1) sttop(je ) = v(i,je+1) elseif (bcy_hi .eq. OUTLET) then sttop(je ) = stbot(je) endif do j = js-1, je savg = half*(stbot(j)+sttop(j)) lty = ( (stbot(j) .le. zero .and. sttop(j) .ge. zero) .or. $ (abs(stbot(j) + sttop(j)) .lt. eps) ) vadv(i,j+1)=cvmgp(stbot(j),sttop(j),savg) vadv(i,j+1)=cvmgt(savg,vadv(i,j+1),lty) enddo if (bcy_lo .eq. WALL) then vadv(i,js ) = zero endif if (bcy_hi .eq. WALL) then vadv(i,je+1) = zero endif enddo return end ccseapps-2.5/CCSEApps/varden2d/probin20000644000175000017500000000013611634153073020662 0ustar amckinstryamckinstry $fortin prob_type = 2 xblob = 0.5 yblob = 1.5 radblob = 0.2 denblob = 10. $end ccseapps-2.5/CCSEApps/varden2d/mkdivucc.F0000644000175000017500000000411711634153073021303 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKDIVUCC ** c ** Define the RHS of the cell-centered divergence constraint c *************************************************************** subroutine FORT_MKDIVUCC(divu_src,u,v,rho,time,dx,DIMS) implicit none integer DIMS REAL_T divu_src(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T time REAL_T dx(2) c Local variables integer i,j do j = lo_2,hi_2 do i = lo_1,hi_1 divu_src(i,j) = zero enddo enddo return end ccseapps-2.5/CCSEApps/varden2d/Grid.H0000644000175000017500000001576311634153073020376 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GRID_H_ #define _GRID_H_ #include #include #include #include #include #include enum StateNames { Xvel=0, Yvel, Density, Tracer}; // //@Man: //@Doc: This class is called from main and handles all the work //@Memo: Handles all the time-stepping class Grid { protected: //@ManDoc: Pointer to a nodal projection operator hg_projector* proj; //@ManDoc: Pointer to a MAC projection operator mac_projector* macproj; //@ManDoc: Pointer to a solver for the Crank-Nicholson diffusive/viscous update diffuser* diffuse_op; //@ManDoc: Pointer to the old-time x-velocity Real* u; //@ManDoc: Pointer to the old-time y-velocity Real* v; //@ManDoc: Pointer to the old-time density Real* rho; //@ManDoc: Pointer to the old-time x-velocity Real* un; //@ManDoc: Pointer to the new-time y-velocity Real* vn; //@ManDoc: Pointer to the new-time density Real* rhon; //@ManDoc: Pointer to the density at time (n+1/2) Real* rhohalf; //@ManDoc: Pointer to the x-component of pressure gradient Real* px; //@ManDoc: Pointer to the y-component of pressure gradient Real* py; //@ManDoc: Pointer to the normal advection velocity on x-faces Real *uadv; //@ManDoc: Pointer to the normal advection velocity on y-faces Real *vadv; //@ManDoc: Pointer to the x-velocity used for transverse derivatives. Real *utrans; //@ManDoc: Pointer to the y-velocity used for transverse derivatives. Real *vtrans; //@ManDoc: Order of the slope calculation (1st, 2nd, or 4th) static int slope_order; //@ManDoc: How many initial iterations to do static int init_iter; //@ManDoc:: fixed time step static Real fixed_dt; //@ManDoc: Mesh spacing in the x-direction Real hx; //@ManDoc: Mesh spacing in the y-direction Real hy; //@ManDoc: File name of the checkpoint file to read from std::string restart_file; //@ManDoc: Read and parse the inputs file void parseInputs(); //@ManDoc: Build aliases to state variable components void buildLinks(); //@ManDoc: Restart calculation from checkpoint file void restart(std::string& filename, int& nstep, Real& time, Real& dt); Box prob_domain; Real prob_size[BL_SPACEDIM]; Real prob_lo[BL_SPACEDIM]; Real prob_hi[BL_SPACEDIM]; Real dx[BL_SPACEDIM]; std::string probin_file; FArrayBox state; FArrayBox staten; FArrayBox slopex; FArrayBox slopey; FArrayBox rhonph; FArrayBox pressure; FArrayBox gradp; FArrayBox force; FArrayBox scalforce; FArrayBox divu_src; FArrayBox visc; FArrayBox diff; FArrayBox edgex; FArrayBox edgey; /*@ManDoc: Array holds flags as to whether scalars should be conservatively or convectively updated */ Array is_conserv; /*@ManDoc: Array holds diffusive coefficients for scalars */ Array diff_coef; //@ManDoc: Coefficient of dynamic viscosity Real visc_coef; //@ManDoc: Number of scalars, defined as N_STATE - NDIM int numscal; protected: //@ManDoc: Allocate and initialize state variables void initialInit(int& nstep, Real& time, Real& dt); //@ManDoc: Do all the work to advance state void timeStep(Real time, Real dt); //@ManDoc: Calculate the slopes of all state variables void getSlopes(int first_comp, int num_comp); //@ManDoc: Calculate the viscous term for momentum equation void getViscTerm(); //@ManDoc: Calculate the diffusive term for scalar update equation void getDiffTerm(); //@ManDoc: Calculate the pressure gradient void getGradP(); //@ManDoc: Define the forcing terms in the momentum equation void getForce(Real current_time); //@ManDoc: Define the forcing terms in the scalar equations void getScalForce(Real current_time); //@ManDoc: Create the edge-based half-time advection velocities void makeAdvVels(Real dt, Real time); //@ManDoc: Update the scalar quantities void updateScalars(Real dt, Real time); //@ManDoc: Update velocity void updateVelocity(Real dt, Real time); //@ManDoc: Calculate the half-time density = avg of rho and rhon void getRhoHalf(Real time, Real dt); public: //@ManDoc: Constructor Grid(std::string probin_file); //@ManDoc: Destructor ~Grid(); //@ManDoc: Calculate dt for the next time step Real estimateDt(Real & dt, Real cfl); //@ManDoc: Decide whether to init with initialInit or restart void init(int& nstep, Real& time, Real& dt); //@ManDoc: Perform the initial iterations to calculate an initial pressure void initialIter(Real time, Real dt); //@ManDoc: Call timeStep and swap staten with state. void advance(Real time, Real dt); //@ManDoc: Write a checkpoint file to be used for restart void writeCheckPoint(int nstep, Real time, Real dt, std::string& check_file_root); //@ManDoc: Write a pltfile to be used for viewing data void writePlotFile(int nstep, Real time, std::string& plot_file_root); //@ManDoc: Worker function to write a plotfile void writePlotFile(std::string& dir, std::ostream& HeaderFile, int nstep, Real time); //@ManDoc: Keep track of which style plotfiles you are using std::string thePlotFileType(); //@ManDoc: Derive the necesary quantity for the contour plots and plt files void deriveData(FArrayBox& data, const std::string& varname, Real time); //@ManDoc: Return the cell size const Real* cellSize() const { return dx; } //@ManDoc: Return the problem size const Real* probSize() const { return prob_size; } //@ManDoc: Return the problem domain const Box& probDomain() { return prob_domain; } }; #endif ccseapps-2.5/CCSEApps/varden2d/ContFrame.cpp0000644000175000017500000000423611634153073021753 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #ifdef HAS_WINDOWS // ************************************************************************ // ** constructor ** // ************************************************************************ ContFrame::ContFrame(std::string nm, std::string varname, int dev, int freq, int ncont, int sz) { name = nm; variable = varname; interval = freq; num_cont = ncont; size = sz; next = NULL; win = NULL; if (dev == 1) { device = xWinDevice; } else if (dev == 2) { device = psDevice; } else if (dev == 3) { device = xWinDevice | psDevice; } else { device = noDevice; }; } // ************************************************************************ // ** destructor ** // ************************************************************************ ContFrame::~ContFrame() { delete win; } #endif ccseapps-2.5/CCSEApps/varden2d/inputs10000644000175000017500000002506211634153073020717 0ustar amckinstryamckinstry##############################################################################3 # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 80 ##############################################################################3 # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. grid.n_cell = 128 128 ##############################################################################3 # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ##############################################################################3 # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin1 ##############################################################################3 # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ##############################################################################3 # Root part of checkpoint file name check_file_root = chk ##############################################################################3 # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030 (assuming plot_file_root is "plt"). # These plot files can be viewed using the visualization tool "amrvis2d." plot_int = 10 ##############################################################################3 # Root part of plotfile name. plot_file_root = plt ##############################################################################3 # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ##############################################################################3 # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ##############################################################################3 # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ##############################################################################3 # if irz = 0 then use Cartesian(x-y) geometry # If irz = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if irz = 1 then # you must set bcx_lo = 2. irz = 0 ##############################################################################3 # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ##############################################################################3 # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ##############################################################################3 # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ##############################################################################3 # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ##############################################################################3 # The physical coordinates of the low end of the domain. # This is read by the Grid class. grid.prob_lo = 0. 0. ##############################################################################3 # The physical coordinates of the high end of the domain. # This is read by the Grid class. grid.prob_hi = 1. 1. ##############################################################################3 # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.0 ##############################################################################3 # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ##############################################################################3 # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ##############################################################################3 # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ##############################################################################3 # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ##############################################################################3 # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ##############################################################################3 # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ##############################################################################3 # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ##############################################################################3 # These variables control interactive contour plotting on UNIX systems. # post_file = name of postscript file (will be appended with ".ps") # device = 1 => XWINDOW, 2 = POSTSCRIPT, 3 = both # variable = name of variable (must match name in Grid.C) # interval = intervals between plots (-1 = off) # num_cont = number of contour lines per plot # win_size = number of pixels in maximum window direction # # post_file device variable interval num_cont win_size # --------- ------ -------- -------- -------- ---------- contour.plot = xvel 1 x_vel -1 20 400 contour.plot = yvel 1 y_vel -1 20 400 contour.plot = density 1 density -1 20 400 contour.plot = tracer 1 tracer -1 20 400 contour.plot = vort 1 vort 5 20 400 contour.plot = press 1 pressure -1 20 400 contour.plot = px 1 px -1 20 400 contour.plot = py 1 py -1 20 400 ccseapps-2.5/CCSEApps/varden2d/probdata.H0000644000175000017500000000305611634153073021275 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ integer prob_type REAL_T in_xvel, in_yvel, in_density, in_tracer REAL_T xblob, yblob, radblob, denblob, velfact common /probdt0/ prob_type common /probdt1/ in_xvel, in_yvel, in_density, in_tracer common /probdt2/ xblob, yblob, radblob, denblob, velfact ccseapps-2.5/CCSEApps/varden2d/HGPROJ_F.H0000644000175000017500000001610311634153073020734 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_XINIT xinit # define FORT_RHSHG rhshg # define FORT_RESIDUAL reshg # define FORT_RELAX relax # define FORT_GRADHG gradhg # define FORT_INITSIG initsigb # define FORT_COARSIG coarsigb # define FORT_RESTRICT coarsresb # define FORT_INTERP interphg # define FORT_PROJUHG projuhg # define FORT_PROJHGD projhgd # define FORT_SOLVEHG solvehg # define FORT_MAKESUM makesum #else #if defined(BL_FORT_USE_UNDERSCORE) # define FORT_XINIT xinit_ # define FORT_RHSHG rhshg_ # define FORT_RESIDUAL reshg_ # define FORT_RELAX relax_ # define FORT_GRADHG gradhg_ # define FORT_INITSIG initsigb_ # define FORT_COARSIG coarsigb_ # define FORT_RESTRICT coarsresb_ # define FORT_INTERP interphg_ # define FORT_PROJUHG projuhg_ # define FORT_PROJHGD projhgd_ # define FORT_SOLVEHG solvehg_ # define FORT_MAKESUM makesum_ #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_XINIT XINIT # define FORT_RHSHG RHSHG # define FORT_RESIDUAL RESHG # define FORT_RELAX RELAX # define FORT_GRADHG GRADHG # define FORT_INITSIG INITSIGB # define FORT_COARSIG COARSIGB # define FORT_RESTRICT COARSRESB # define FORT_INTERP INTERPHG # define FORT_PROJUHG PROJUHG # define FORT_PROJHGD PROJHGD # define FORT_SOLVEHG SOLVEHG # define FORT_MAKESUM MAKESUM #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_XINIT xinit # define FORT_RHSHG rhshg # define FORT_RESIDUAL reshg # define FORT_RELAX relax # define FORT_GRADHG gradhg # define FORT_INITSIG initsigb # define FORT_COARSIG coarsigb # define FORT_RESTRICT coarsresb # define FORT_INTERP interphg # define FORT_PROJUHG projuhg # define FORT_PROJHGD projhgd # define FORT_SOLVEHG solvehg # define FORT_MAKESUM makesum #endif extern "C" { void FORT_XINIT(Real * x, Real * xhalf, Real * hx, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, int * irz); void FORT_INITSIG(Real * sigma, Real * rho , Real * x, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); void FORT_RHSHG(Real * source, Real * state, Real * divu_src, Real * x, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, Real * rhsnorm, Real * time, Real * dt); void FORT_GRADHG(Real * gradp, const int & glo_1, const int & glo_2, const int & ghi_1, const int & ghi_2, Real * pressure, const int & plo_1, const int & plo_2, const int & phi_1, const int & phi_2, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); void FORT_RESIDUAL(Real * resid, Real * phi, Real * source, Real * sigma, Real * dgphi, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, Real * rnorm, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); void FORT_RELAX(Real * phi, Real * source, Real * sigma, Real * dgphi, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * nngsrb); void FORT_RESTRICT(Real * resid, Real * resid_crse, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, const int & loc_1, const int & loc_2, const int & hic_1, const int & hic_2, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); void FORT_COARSIG(Real * sigma, Real * sigmac, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, const int & loc_1, const int & loc_2, const int & hic_1, const int & hic_2, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); void FORT_INTERP(Real * temp, Real * phi_crse, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, const int & loc_1, const int & loc_2, const int & hic_1, const int & hic_2); void FORT_PROJUHG(Real * state, Real * pressure, Real * phi, Real * gradphi, Real * rho, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2); void FORT_SOLVEHG(Real * dest, Real * dest0, Real * source, Real * sigma, Real * sum, Real * r, Real * w, Real * z, Real * work, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * maxiter, Real * norm, Real * norm0); void FORT_MAKESUM(Real *, Real *, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, Real * hx, Real * hy, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); }; #endif ccseapps-2.5/CCSEApps/varden2d/Contour.cpp0000644000175000017500000001331511634153073021524 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #ifdef HAS_WINDOWS // ************************************************************************ // ** constructor ** // ************************************************************************ Contour::Contour(){ first = NULL; ParmParse pp("contour"); int n = pp.countname("plot"); for (int k = 0; k < n; k++) { int freq = -1; pp.getkth("plot",k,freq,3); if (freq > 0) { std::string fname, varname; int dev, nc, sz; pp.getkth("plot",k,fname,0); pp.getkth("plot",k,dev,1); pp.getkth("plot",k,varname,2); pp.getkth("plot",k,nc,4); pp.getkth("plot",k,sz,5); ContFrame *cf= new ContFrame(fname,varname,dev,freq,nc,sz); cf->next = first; first = cf; } } } // ************************************************************************ // ** destructor ** // ************************************************************************ Contour::~Contour() { clear(); } // ************************************************************************ // ** clear ** // ************************************************************************ void Contour::clear() { ContFrame *cont = first; while (cont != NULL) { ContFrame *c = cont; cont = cont->next; c->next = NULL; delete c; }; } // ************************************************************************ // ** << ** // ************************************************************************ std::ostream& operator << (std::ostream &os, Contour &cont) { ContFrame *c; for (c=cont.first; c!=NULL; c=c->next) { os << "contplot " << c->name << " " << c->device << " " << c->variable << " " << c->interval << " " << c->num_cont << " " << std::endl; }; return os; } // ************************************************************************ // ** drawCont ** // ************************************************************************ void Contour::drawCont(Grid &grid, int nstep, Real time) { // loop through frames, creating and writing images ContFrame *r; for (r = first; r != NULL; r = r->next) { if ((r->interval > 0) && (nstep%(r->interval) == 0)) { // Added by ASA and EGP to create new PS files each time step. char filename[80]; const char* rootname = (r->name).c_str(); sprintf(filename,"%s%04d",rootname,nstep); const Real* dx = grid.cellSize(); const Real* prob_size = grid.probSize(); // if window not created yet, create it if (r->win == NULL) { double xborder = dx[0]; double yborder = dx[1]; double xmax = prob_size[0]+xborder; double ymax = prob_size[1]+yborder; r->win = new GraphTool(-xborder,-yborder,xmax,ymax, filename,r->size,r->device); }; // clear page before drawing r->win->newPage(); // derive data and compute min and max Box bx(grid.probDomain()); const IntVect len = bx.length(); FArrayBox data(bx,1); grid.deriveData(data,r->variable,time); double v_min = data.min(0); double v_max = data.max(0); // check for constant field if ( (v_max-v_min) < 0.0001) { std::cout << r->variable << " is a constant with value " << v_min << " ... will not plot" << std::endl; } else { std::cout << r->variable << " has min = " << v_min << " max = " << v_max << std::endl; double d_val = (v_max-v_min)/double(r->num_cont); double xborder = dx[0]; double yborder = dx[1]; double xmax = prob_size[0]+xborder; double ymax = prob_size[1]+yborder; Real xtop = prob_size[0]; Real ytop = prob_size[1]; if (r->device == psDevice) { xtop = 0.5*prob_size[0]; ytop = 0.5*prob_size[1]; } if (r->device == psDevice) { r->win->drawBox(-.5*xborder,-.5*yborder,.5*xmax,.5*ymax); } else { r->win->drawBox(-xborder,-yborder,xmax,ymax); } // draw contour plot const int* mask_array = NULL; for (int i = 0; i < r->num_cont; i++) { double value = v_min + d_val*(0.5 + double(i)); r->win->contour(data.dataPtr(),value,false,mask_array, len[0],len[1],len[0],len[1], 0.0,0.0,xtop,ytop); } } if (r->device == psDevice) { delete r->win; r->win = NULL; } } } } bool Contour::doingContour() { bool is_doing_contour = false; ContFrame *r; for (r = first; r != NULL; r = r->next) { if (r->interval > 0) { is_doing_contour = true; } } return is_doing_contour; } #endif ccseapps-2.5/CCSEApps/varden2d/diffuser.cpp0000644000175000017500000002404311634153073021702 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #define ARLIM(x) x[0],x[1] int diffuser::numSmoothCoarsen = 2; int diffuser::numSmoothRefine = 2; // ************************************************************************ // ** constructor ** // ************************************************************************ diffuser::diffuser(const Box& Domain, Real * dx) : domain(Domain) { ParmParse pp("diff"); pp.get("tol",tol); pp.query("numSmoothCoarsen",numSmoothCoarsen); pp.query("numSmoothRefine",numSmoothRefine); hx = dx[0]; hy = dx[1]; } // ************************************************************************ // ** destructor ** // ************************************************************************ diffuser::~diffuser() { } // ************************************************************************ // ** solveVel ** // ************************************************************************ void diffuser::solveVel(FArrayBox * staten, FArrayBox * temp, Real * rho, Real mu, int n) { const int * lo = domain.smallEnd().getVect(); const int * hi = domain.bigEnd().getVect(); Real rhsnorm; diffuser_mg *solver; FArrayBox *source = new FArrayBox(domain,1); FArrayBox *sigma = new FArrayBox(BoxLib::grow(domain,1),1); FArrayBox *resid = new FArrayBox(domain,1); FORT_INITSIGV(sigma->dataPtr(),rho,&mu,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi); Real * uinx_lo = new Real[domain.length()[1]+2]; Real * uinx_hi = new Real[domain.length()[1]+2]; Real * uiny_lo = new Real[domain.length()[0]+2]; Real * uiny_hi = new Real[domain.length()[0]+2]; FORT_RHSNORM(staten->dataPtr(n),source->dataPtr(), ARLIM(lo),ARLIM(hi),&rhsnorm,uinx_lo,uinx_hi,uiny_lo,uiny_hi); std::cout << "Viscous RHS is " << rhsnorm << std::endl; rhsnorm = (rhsnorm > 1.0) ? rhsnorm : 1.0; solver = new diffuser_mg(domain,temp,source,resid,sigma,x,xhalf, uinx_lo,uinx_hi,uiny_lo,uiny_hi,hx,hy,0,n); solver->solve(tol*rhsnorm,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; delete source; delete resid; delete sigma; delete uinx_lo; delete uinx_hi; delete uiny_lo; delete uiny_hi; } // ************************************************************************ // ** solveScal ** // ************************************************************************ void diffuser::solveScal(FArrayBox * staten, FArrayBox * temp, Real mu, int n) { const int * lo = domain.smallEnd().getVect(); const int * hi = domain.bigEnd().getVect(); Real rhsnorm; diffuser_mg *solver; FArrayBox *source = new FArrayBox(domain,1); FArrayBox *sigma = new FArrayBox(BoxLib::grow(domain,1),1); FArrayBox *resid = new FArrayBox(domain,1); sigma->setVal(mu); Real * uinx_lo = new Real[domain.length()[1]+2]; Real * uinx_hi = new Real[domain.length()[1]+2]; Real * uiny_lo = new Real[domain.length()[0]+2]; Real * uiny_hi = new Real[domain.length()[0]+2]; FORT_RHSNORM(staten->dataPtr(n),source->dataPtr(), ARLIM(lo),ARLIM(hi),&rhsnorm, uinx_lo,uinx_hi,uiny_lo,uiny_hi); std::cout << "Diffusive RHS is " << rhsnorm << std::endl; rhsnorm = (rhsnorm > 1.0) ? rhsnorm : 1.0; solver = new diffuser_mg(domain,temp,source,resid,sigma,x,xhalf, uinx_lo,uinx_hi,uiny_lo,uiny_hi,hx,hy,0,n); solver->solve(tol*rhsnorm,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; delete source; delete resid; delete sigma; delete uinx_lo; delete uiny_lo; delete uinx_hi; delete uiny_hi; } // ************************************************************************ // ** constructor ** // ************************************************************************ diffuser_mg::diffuser_mg(const Box & Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Resid, FArrayBox * Sigma, Real * X, Real * Xhalf, Real * Uinx_lo, Real * Uinx_hi, Real * Uiny_lo, Real * Uiny_hi, Real Hx, Real Hy, int Level, int Idir) : multigrid(Domain, Phi, Source, Resid, Hx, Hy) { x_mg = X; xhalf_mg = Xhalf; uinx_lo = Uinx_lo; uinx_hi = Uinx_hi; uiny_lo = Uiny_lo; uiny_hi = Uiny_hi; sigma = Sigma; level = Level; idir = Idir; // create next (coarser) level and set overrelaxation parameter const IntVect& len = domain.length(); if ( (len[0]&1) != 0 || (len[1]&1) != 0) { cgwork = new FArrayBox(domain,3); Next = NULL; } else if (len[0] < 8 || len[1] < 8 ) { cgwork = new FArrayBox(domain,3); Next = NULL; } else { cgwork = NULL; Box newdomain = BoxLib::coarsen(domain,2); FArrayBox* newphi = new FArrayBox(BoxLib::grow(newdomain,1),1); newphi->setVal(0.0); const int * loc_mg = newdomain.smallEnd().getVect(); const int * hic_mg = newdomain.bigEnd().getVect(); Real newhx = 2.0*hx; Real newhy = 2.0*hy; Real* newx = new Real[newdomain.length()[0]+2]; Real* newxhalf = new Real[newdomain.length()[0]+2]; FORT_XINIT(newx, newxhalf, &newhx, ARLIM(loc_mg), ARLIM(hic_mg), &irz); FArrayBox* newsource = new FArrayBox(newdomain,1); FArrayBox* newresid = new FArrayBox(newdomain,1); FArrayBox* newsigma = new FArrayBox(BoxLib::grow(newdomain,1),1); FORT_COARSIGV(sigma->dataPtr(),newsigma->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),ARLIM(loc_mg),ARLIM(hic_mg),x); Real * newuinx_lo = new Real[newdomain.length()[1]+2]; Real * newuinx_hi = new Real[newdomain.length()[1]+2]; Real * newuiny_lo = new Real[newdomain.length()[0]+2]; Real * newuiny_hi = new Real[newdomain.length()[0]+2]; Next = new diffuser_mg(newdomain, newphi, newsource, newresid, newsigma, newx, newxhalf, newuinx_lo, newuinx_hi, newuiny_lo, newuiny_hi, newhx, newhy, level-1,idir); } next = Next; } // ************************************************************************ // ** destructor ** // ************************************************************************ diffuser_mg::~diffuser_mg() { if (Next != NULL) { delete Next->phi; delete Next->source; delete Next->resid; delete Next->x_mg; delete Next->xhalf_mg; delete Next->uinx_lo; delete Next->uinx_hi; delete Next->uiny_lo; delete Next->uiny_hi; delete Next->sigma; delete Next; } delete cgwork; } // ************************************************************************ // ** residual ** // ************************************************************************ Real diffuser_mg::residual() { Real rnorm; FORT_RESID(resid->dataPtr(),phi->dataPtr(),source->dataPtr(), sigma->dataPtr(),uinx_lo,uinx_hi,uiny_lo,uiny_hi, x_mg, xhalf_mg, ARLIM(lo_mg),ARLIM(hi_mg),&hx,&hy, &rnorm,&bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&level,&irz,&idir); return rnorm; } // ************************************************************************ // ** step ** // ************************************************************************ void diffuser_mg::step(int nngsrb) { FORT_GSRBV(phi->dataPtr(),source->dataPtr(), sigma->dataPtr(), uinx_lo,uinx_hi,uiny_lo,uiny_hi,x_mg,xhalf_mg, ARLIM(lo_mg),ARLIM(hi_mg),&hx,&hy, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&level,&irz,&idir,&nngsrb); } // ************************************************************************ // ** Restrict ** // ************************************************************************ void diffuser_mg::Restrict() { const int * loc_mg = next->domain.smallEnd().getVect(); const int * hic_mg = next->domain.bigEnd().getVect(); FORT_RESTRICT(resid->dataPtr(), next->source->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg), ARLIM(loc_mg),ARLIM(hic_mg),x_mg); } // ************************************************************************ // ** interpolate ** // ************************************************************************ void diffuser_mg::interpolate() { const int * loc_mg = next->domain.smallEnd().getVect(); const int * hic_mg = next->domain.bigEnd().getVect(); FORT_INTERPOLATE(phi->dataPtr(), next->phi->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg), ARLIM(loc_mg),ARLIM(hic_mg)); } ccseapps-2.5/CCSEApps/varden2d/mkscalforce.F0000644000175000017500000000405211634153073021765 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKFORCE ** c ** Define the forcing terms in the momentum equation c *************************************************************** subroutine FORT_MKSCALFORCE(force,s,time,dx,DIMS,numscal) implicit none integer DIMS integer numscal REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T time REAL_T dx(2) c Local variables integer i,j,n do n = 1,numscal do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 force(i,j,n) = zero enddo enddo enddo return end ccseapps-2.5/CCSEApps/varden2d/probin50000644000175000017500000000024411634153073020665 0ustar amckinstryamckinstry $fortin prob_type = 5 in_xvel = 0.0 in_yvel = 0.0 in_density = 1.0 in_tracer = 0.0 xblob = 0.5 yblob = 0.5 radblob = 0.2 denblob = 1. $end ccseapps-2.5/CCSEApps/varden2d/Contour.H0000644000175000017500000000423311634153073021130 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _Contour_H_ #define _Contour_H_ #include #include #include #include #include #ifdef HAS_WINDOWS // //@Man: /*@Doc: This class generates run-time on-screen contour plots and/or postscript contour plots, as determined by the inputs flag. It is called from main(). */ //@Memo: Governs the drawing of contours. class Contour { //@ManDoc: Output operator friend std::ostream& operator << (std::ostream &os, Contour &cont); public: //@ManDoc: Constructor Contour(); //@ManDoc: Destructor ~Contour(); //@ManDoc: Manually clear Contour space void clear(); //@ManDoc: Draw the contour plot void drawCont(Grid &grid, int nstep, Real time); //@ManDoc: Is it doing contour plots? bool doingContour(); private: //@ManDoc: The top of the list of contour plots to be drawn. ContFrame *first; }; #endif #endif ccseapps-2.5/CCSEApps/varden2d/scalupd.F0000644000175000017500000000660011634153073021130 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** SCALUPD ** c ** Update the scalars using conservative or convective differencing of fluxes c ************************************************************************* subroutine scalupd(s,sn,sedgex,sedgey,uadv,vadv, $ diff,force,r,rhalf,DIMS, $ dx,dt,is_conserv,numscal) implicit none integer DIMS integer numscal REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T sn(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T sedgex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T sedgey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T diff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numscal) REAL_T r(lo_1-1:hi_1+1) REAL_T rhalf(lo_1:hi_1+2) REAL_T dx(2) REAL_T dt integer is_conserv(numscal) c Local variables REAL_T divsu REAL_T uconv REAL_T vconv integer i,j,n do n = 1, numscal if (is_conserv(n) .eq. 1) then do j = lo_2,hi_2 do i = lo_1,hi_1 divsu = ( sedgex(i+1,j,n)*uadv(i+1,j)*rhalf(i+1) - $ sedgex(i ,j,n)*uadv(i ,j)*rhalf(i ) )/(r(i)*dx(1)) $ + ( sedgey(i,j+1,n)*vadv(i,j+1) - $ sedgey(i,j ,n)*vadv(i,j ) )/dx(2) sn(i,j,n) = s(i,j,n) - dt*divsu + half*dt*diff(i,j,n)+dt*force(i,j,n) enddo enddo else do j = lo_2,hi_2 do i = lo_1,hi_1 uconv = half * (uadv(i+1,j) + uadv(i,j)) vconv = half * (vadv(i,j+1) + vadv(i,j)) divsu = uconv * (sedgex(i+1,j,n) - sedgex(i,j,n)) / dx(1) + $ vconv * (sedgey(i,j+1,n) - sedgey(i,j,n)) / dx(2) sn(i,j,n) = s(i,j,n) - dt*divsu + half*dt*diff(i,j,n) + dt*force(i,j,n) enddo enddo endif enddo return end ccseapps-2.5/CCSEApps/varden2d/inputs50000644000175000017500000002253211634153073020722 0ustar amckinstryamckinstry##############################################################################3 # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 10 ##############################################################################3 # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ##############################################################################3 # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin5 ##############################################################################3 # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ##############################################################################3 # Root part of checkpoint file name check_file_root = chk ##############################################################################3 # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ##############################################################################3 # Root part of plotfile name. plot_file_root = plt ##############################################################################3 # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ##############################################################################3 # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ##############################################################################3 # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ##############################################################################3 # if irz = 0 then use Cartesian(x-y) geometry # If irz = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if irz = 1 then # you must set bcx_lo = 2. irz = 0 ##############################################################################3 # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ##############################################################################3 # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ##############################################################################3 # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 3 ##############################################################################3 # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 4 ##############################################################################3 # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. grid.n_cell = 32 16 ##############################################################################3 # The physical coordinates of the low end of the domain. # This is read by the Grid class. grid.prob_lo = -1. 0. ##############################################################################3 # The physical coordinates of the high end of the domain. # This is read by the Grid class. grid.prob_hi = 1. 1. ##############################################################################3 # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ##############################################################################3 # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.0 ##############################################################################3 # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ##############################################################################3 # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ##############################################################################3 # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ##############################################################################3 # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ##############################################################################3 # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ##############################################################################3 # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ccseapps-2.5/CCSEApps/varden2d/GRID_F.H0000644000175000017500000002644411634153073020501 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_INITDATA initdata # define FORT_PROBINIT probinit # define FORT_SET_CELL_VELBC setcellvelbc # define FORT_DERVORT dervort # define FORT_DERAVGP deravgp # define FORT_XINIT xinit # define FORT_DERIVE derive # define FORT_CMPDT cmpdt # define FORT_SLOPEX fslopex # define FORT_SLOPEY fslopey # define FORT_LAPLAC laplac # define FORT_MKFORCE mkforce # define FORT_MKSCALFORCE mkscalforce # define FORT_MKDIVUCC mkdivucc # define FORT_MKDIVUNOD mkdivunod # define FORT_MKADVVEL mkadvvel # define FORT_MKVELFLUX mkvelflux # define FORT_MKSCAFLUX mkscaflux # define FORT_SCALUPD scalupd # define FORT_VELUPD velupd # define FORT_SETVELBC setvelbc # define FORT_SETSCALBC setscalbc #else #if defined(BL_FORT_USE_UNDERSCORE) # define FORT_INITDATA initdata_ # define FORT_PROBINIT probinit_ # define FORT_SET_CELL_VELBC setcellvelbc_ # define FORT_DERVORT dervort_ # define FORT_DERAVGP deravgp_ # define FORT_XINIT xinit_ # define FORT_DERIVE derive_ # define FORT_CMPDT cmpdt_ # define FORT_SLOPEX fslopex_ # define FORT_SLOPEY fslopey_ # define FORT_LAPLAC laplac_ # define FORT_MKFORCE mkforce_ # define FORT_MKSCALFORCE mkscalforce_ # define FORT_MKDIVUCC mkdivucc_ # define FORT_MKDIVUNOD mkdivunod_ # define FORT_MKADVVEL mkadvvel_ # define FORT_MKVELFLUX mkvelflux_ # define FORT_MKSCAFLUX mkscaflux_ # define FORT_SCALUPD scalupd_ # define FORT_VELUPD velupd_ # define FORT_SETVELBC setvelbc_ # define FORT_SETSCALBC setscalbc_ #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_INITDATA INITDATA # define FORT_PROBINIT PROBINIT # define FORT_SET_CELL_VELBC SETCELLVELBC # define FORT_DERVORT DERVORT # define FORT_DERAVGP DERAVGP # define FORT_XINIT XINIT # define FORT_DERIVE DERIVE # define FORT_CMPDT CMPDT # define FORT_SLOPEX FSLOPEX # define FORT_SLOPEY FSLOPEY # define FORT_LAPLAC LAPLAC # define FORT_MKFORCE MKFORCE # define FORT_MKSCALFORCE MKSCALFORCE # define FORT_MKDIVUCC MKDIVUCC # define FORT_MKDIVUNOD MKDIVUNOD # define FORT_MKADVVEL MKADVVEL # define FORT_MKVELFLUX MKVELFLUX # define FORT_MKSCAFLUX MKSCAFLUX # define FORT_SCALUPD SCALUPD # define FORT_VELUPD VELUPD # define FORT_SETVELBC SETVELBC # define FORT_SETSCALBC SETSCALBC #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_INITDATA initdata # define FORT_PROBINIT probinit # define FORT_SET_CELL_VELBC setcellvelbc # define FORT_DERVORT dervort # define FORT_DERAVGP deravgp # define FORT_XINIT xinit # define FORT_DERIVE derive # define FORT_CMPDT cmpdt # define FORT_SLOPEX fslopex # define FORT_SLOPEY fslopey # define FORT_LAPLAC laplac # define FORT_MKFORCE mkforce # define FORT_MKSCALFORCE mkscalforce # define FORT_MKDIVUCC mkdivucc # define FORT_MKDIVUNOD mkdivunod # define FORT_MKADVVEL mkadvvel # define FORT_MKVELFLUX mkvelflux # define FORT_MKSCAFLUX mkscaflux # define FORT_SCALUPD scalupd # define FORT_VELUPD velupd # define FORT_SETVELBC setvelbc # define FORT_SETSCALBC setscalbc #endif extern "C" { void FORT_INITDATA(Real * u, Real * v, Real * scalars, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, const Real * dx, Real * time, int * numscal); void FORT_PROBINIT (const int* name, const int* namelen); void FORT_DERVORT(Real* state, Real * derval, const int& derlo_1, const int& derlo_2, const int& derhi_1, const int& derhi_2, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, const Real* dx); void FORT_SET_CELL_VELBC(Real* u, Real* v, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * irz, Real * visc_coef, Real * dx, Real * time); void FORT_DERAVGP(Real* pressure, Real * dat, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2); void FORT_CMPDT(Real * u, Real * v, Real * rho, Real * px, Real * py, Real * force, Real* dx, Real * dt, Real * cfl, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2); void FORT_SLOPEX(Real * s, Real * slx, Real * dfromx, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, int * first_comp, int * nvar, int * bcx_lo, int * bcx_hi, int * irz, int * slope_order); void FORT_SLOPEY(Real * s, Real * sly, Real * dfromy, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, int * nvar, int * bcy_lo, int * bcy_hi, int * slope_order); void FORT_LAPLAC(Real * u, Real * lapu, Real * x, Real * xhalf, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, Real * dx, Real * visc_coef, int * irz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * idir); void FORT_MKFORCE(Real * force, Real * u, Real * v, Real * rho, Real * gravity, Real * visc_coef, Real * time, const Real * dx, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2); void FORT_MKSCALFORCE(Real * force, Real * s, Real * time, const Real * dx, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, int * numscal); void FORT_MKDIVUCC(Real * divu_src, Real * u, Real * v, Real * rho, Real * time, const Real * dx, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2); void FORT_MKDIVUNOD(Real * divu_src, Real * u, Real * v, Real * rho, Real * time, const Real * dx, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2); void FORT_MKADVVEL(Real * u, Real * ux, Real * uy, Real * v, Real * vx, Real * vy, Real * rho, Real * force, Real * px, Real * py, Real * lapu, Real * dx, Real & dt, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, Real * stlft, Real * strgt, Real * sttop, Real * stbot, Real * uadv, Real * vadv, Real * utrans, Real * vtrans, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, Real * visc_coef, int * irz); void FORT_SCALUPD(Real * s, Real * sn, Real * sedgex, Real * sedgey, Real * uhalfx, Real * uhalfy, Real * diff_term, Real * scalforce, Real * r, Real * rhalf, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, Real * dx,Real * dt, int * is_conserv, int * numscal); void FORT_MKVELFLUX(Real * s, Real * sedgex, Real * sedgey, Real * slopex, Real * slopey, Real * uadv, Real * vadv, Real * utrans, Real * vtrans, Real * rho, Real * px, Real * py, Real * lapu, Real * s_l, Real * s_r, Real * s_b, Real * s_t, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, Real * dx, Real * dt, Real * force, Real * visc_coef, int * irz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi); void FORT_MKSCAFLUX(Real * s, Real * sedgex, Real * sedgey, Real * slopex, Real * slopey, Real * uadv, Real * vadv, Real * utrans, Real * vtrans, Real * u, Real * diff_term, Real * scalforce, Real * s_l, Real * s_r, Real * s_b, Real * s_t, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, Real * dx,Real * dt, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * numqty); void FORT_VELUPD(Real * u, Real * v, Real * ustar, Real * vstar, Real * lapu, Real * gradp, Real * rhohalf, Real * uadv, Real * vadv, Real * uhalfx, Real * uhalfy, Real * force, Real * dt, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, Real * dx); void FORT_SETVELBC(Real* u, Real* v, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * irz, Real * visc_coef, Real * dx, Real * time); void FORT_SETSCALBC(Real * scal, const int& lo_1, const int& lo_2, const int& hi_1, const int& hi_2, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * irz, int * which_scal, Real * dx, Real * time); void FORT_XINIT(Real * x, Real * xhalf, Real * hx, const int & lo_1, const int & lo_2, const int & hi_1, const int & hi_2, int * irz); }; #endif ccseapps-2.5/CCSEApps/varden2d/probin40000644000175000017500000000024511634153073020665 0ustar amckinstryamckinstry $fortin prob_type = 4 in_xvel = 1.0 in_yvel = 0.0 in_density = 1.0 in_tracer = 0.0 xblob = 0.5 yblob = 0.5 radblob = 0.2 denblob = 10. $end ccseapps-2.5/CCSEApps/varden2d/mkscaflux.F0000644000175000017500000001452611634153073021500 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKSCAFLUX ** c ** Create the time-centered edge states for scalars c *************************************************************** subroutine FORT_MKSCAFLUX(s,sedgex,sedgey,slopex,slopey, $ uadv,vadv,utrans,vtrans, $ u,diff,force,s_l,s_r,s_b,s_t,DIMS, $ dx,dt,bcx_lo,bcx_hi,bcy_lo,bcy_hi,numqty) implicit none integer DIMS integer numqty REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numqty) REAL_T sedgex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numqty) REAL_T sedgey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numqty) REAL_T slopex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numqty) REAL_T slopey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numqty) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T utrans(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T vtrans(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T diff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numqty) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,numqty) REAL_T s_l(lo_1:hi_1+1) REAL_T s_r(lo_1:hi_1+1) REAL_T s_b(lo_2:hi_2+1) REAL_T s_t(lo_2:hi_2+1) REAL_T dx(2) REAL_T dt integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables REAL_T savg REAL_T sUp1 REAL_T sUp2 REAL_T hx REAL_T hy integer i,j,n, is, ie, js, je REAL_T eps eps = 1.0e-8 hx = dx(1) hy = dx(2) is = lo_1 ie = hi_1 js = lo_2 je = hi_2 c ::: First do s^(n+1/2) on the (i+1/2) boundaries. do n = 1, numqty do j = js,je do i = is,ie sUp1 = cvmgp( s(i,j,n) , s(i,j+1,n), vtrans(i,j+1)) savg = half * (s(i,j,n) + s(i,j+1,n)) sUp1 = cvmgt(sUp1, savg, abs(vtrans(i,j+1)) .gt. eps) sUp2 = cvmgp( s(i,j-1,n) , s(i,j,n), vtrans(i,j )) savg = half * (s(i,j-1,n) + s(i,j,n)) sUp2 = cvmgt(sUp2, savg, abs(vtrans(i,j)) .gt. eps) s_l(i+1) = s(i,j,n) + $ half*(one - u(i,j,1)*dt/hx)*slopex(i,j,n) - $ half*dt*u(i,j,2)*(sUp1 - sUp2)/hy + $ half*dt*(diff(i,j,n) + force(i,j,n)) s_r(i ) = s(i,j,n) - $ half*(one + u(i,j,1)*dt/hx)*slopex(i,j,n) - $ half*dt*u(i,j,2)*(sUp1 - sUp2)/hy + $ half*dt*(diff(i,j,n)+force(i,j,n)) enddo if (bcx_lo .eq. PERIODIC) then s_l(is ) = s_l(ie+1) elseif (bcx_lo .eq. WALL) then s_l(is ) = s_r(is ) elseif (bcx_lo .eq. INLET ) then s_l(is ) = s(is-1,j,n) elseif (bcx_lo .eq. OUTLET ) then s_l(is ) = s_r(is ) endif if (bcx_hi .eq. PERIODIC) then s_r(ie+1) = s_r(is ) elseif (bcx_hi .eq. WALL) then s_r(ie+1) = s_l(ie+1) elseif (bcx_hi .eq. INLET ) then s_r(ie+1) = s(ie+1,j,n) elseif (bcx_hi .eq. OUTLET ) then s_r(ie+1) = s_l(ie+1) endif do i = is,ie+1 sedgex(i,j,n)= cvmgp(s_l(i),s_r(i),uadv(i,j)) savg = half*(s_l(i) + s_r(i)) sedgex(i,j,n) = cvmgp(savg,sedgex(i,j,n),eps-abs(uadv(i,j))) enddo enddo c ::: Now do s^(n+1/2) on the (j+1/2) boundaries. do i = is,ie do j = js,je sUp1 = cvmgp( s(i,j,n) , s(i+1,j,n),utrans(i+1,j)) savg = half * (s(i,j,n) + s(i+1,j,n)) sUp1 = cvmgt(sUp1, savg, abs(utrans(i+1,j)) .gt. eps) sUp2 = cvmgp( s(i-1,j,n) , s(i,j,n),utrans(i ,j)) savg = half * (s(i-1,j,n) + s(i,j,n)) sUp2 = cvmgt(sUp2, savg, abs(utrans(i,j)) .gt. eps) s_b(j+1) = s(i,j,n) + $ half*(one - u(i,j,2)*dt/hy)*slopey(i,j,n) - $ half*dt*u(i,j,1)*(sUp1 - sUp2)/hx + $ half*dt*(diff(i,j,n)+force(i,j,n)) s_t(j ) = s(i,j,n) - $ half*(one + u(i,j,2)*dt/hy)*slopey(i,j,n) - $ half*dt*u(i,j,1)*(sUp1 - sUp2)/hx + $ half*dt*(diff(i,j,n)+force(i,j,n)) enddo if (bcy_lo .eq. PERIODIC) then s_b(js ) = s_b(je+1) elseif (bcy_lo .eq. WALL ) then s_b(js ) = s_t(js ) elseif (bcy_lo .eq. INLET ) then s_b(js ) = s(i,js-1,n) elseif (bcy_lo .eq. OUTLET ) then s_b(js ) = s_t(js ) endif if (bcy_hi .eq. PERIODIC) then s_t(je+1) = s_t(js ) elseif (bcy_hi .eq. WALL ) then s_t(je+1) = s_b(je+1) elseif (bcy_hi .eq. INLET ) then s_t(je+1) = s(i,je+1,n) elseif (bcy_hi .eq. OUTLET ) then s_t(je+1) = s_b(je+1) endif do j = js, je+1 sedgey(i,j,n) = cvmgp(s_b(j),s_t(j),vadv(i,j)) savg = half*(s_b(j) + s_t(j)) sedgey(i,j,n) = cvmgp(savg,sedgey(i,j,n),eps-abs(vadv(i,j))) enddo enddo enddo return end ccseapps-2.5/CCSEApps/varden2d/inputs30000644000175000017500000002505311634153073020721 0ustar amckinstryamckinstry##############################################################################3 # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 1000000 ##############################################################################3 # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1.0 ##############################################################################3 # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin3 ##############################################################################3 # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 10000 ##############################################################################3 # Root part of checkpoint file name check_file_root = chk ##############################################################################3 # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030 (assuming plot_file_root is "plt"). # These plot files can be viewed using the visualization tool "amrvis2d." plot_int = 1000 ##############################################################################3 # Root part of plotfile name. plot_file_root = plt ##############################################################################3 # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ##############################################################################3 # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ##############################################################################3 # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ##############################################################################3 # if irz = 0 then use Cartesian(x-y) geometry # If irz = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if irz = 1 then # you must set bcx_lo = 2. irz = 0 ##############################################################################3 # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 1 ##############################################################################3 # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 1 ##############################################################################3 # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 1 ##############################################################################3 # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 1 ##############################################################################3 # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. grid.n_cell = 128 128 ##############################################################################3 # The physical coordinates of the low end of the domain. # This is read by the Grid class. grid.prob_lo = 0. 0. ##############################################################################3 # The physical coordinates of the high end of the domain. # This is read by the Grid class. grid.prob_hi = 1. 1. ##############################################################################3 # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ##############################################################################3 # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ##############################################################################3 # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ##############################################################################3 # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ##############################################################################3 # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ##############################################################################3 # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ##############################################################################3 # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ##############################################################################3 # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ##############################################################################3 # These variables control interactive contour plotting on UNIX systems. # post_file = name of postscript file (will be appended with ".ps") # device = 1 => XWINDOW, 2 = POSTSCRIPT, 3 = both # variable = name of variable (must match name in Grid.C) # interval = intervals between plots (-1 = off) # num_cont = number of contour lines per plot # win_size = number of pixels in maximum window direction # # post_file device variable interval num_cont win_size # --------- ------ -------- -------- -------- ---------- contour.plot = xvel 1 x_vel -1 20 400 contour.plot = yvel 1 y_vel -1 20 400 contour.plot = density 1 density -1 20 400 contour.plot = tracer 1 tracer -1 20 400 contour.plot = vort 1 vort 5 20 400 contour.plot = press 1 pressure -1 20 400 contour.plot = px 1 px -1 20 400 contour.plot = py 1 py -1 20 400 ccseapps-2.5/CCSEApps/varden2d/cmpdt.F0000644000175000017500000000575711634153073020620 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** CMPDT ** c ** Compute the new time step c ******************************************************************** subroutine FORT_CMPDT(u,v,rho,px,py,force,dx,dt,cflfac,DIMS) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T px(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T py(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T dx(2) REAL_T dt REAL_T cflfac c Local variables REAL_T spdx,spdy,dtold REAL_T pforcex,pforcey REAL_T dtchange integer i, j REAL_T eps dtchange = 1.1d0 eps = 1.0e-8 dtold = dt spdx = zero spdy = zero pforcex = zero pforcey = zero do j = lo_2, hi_2 do i = lo_1, hi_1 spdx = max(spdx ,abs(u(i,j))/dx(1)) spdy = max(spdy ,abs(v(i,j))/dx(2)) pforcex = max(pforcex,abs(px(i,j)/rho(i,j)-force(i,j,1))) pforcey = max(pforcey,abs(py(i,j)/rho(i,j)-force(i,j,2))) enddo enddo if (spdx.lt.eps .and. spdy.lt.eps) then dt = min(dx(1),dx(2)) else dt = one / max(spdx,spdy) endif if (pforcex .gt. eps) then dt = min(dt,sqrt(two*dx(1)/pforcex)) endif if (pforcey .gt. eps) then dt = min(dt,sqrt(two*dx(2)/pforcey)) endif dt = dt * cflfac if (dtold .gt. zero) dt = min(dt,dtchange*dtold) return end ccseapps-2.5/CCSEApps/varden2d/macproj.cpp0000644000175000017500000002315011634153073021524 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #define ARLIM(x) x[0],x[1] int mac_projector::numSmoothCoarsen = 2; int mac_projector::numSmoothRefine = 2; // ************************************************************************ // ** constructor ** // ************************************************************************ mac_projector::mac_projector(const Box& Domain, Real * dx) : domain(Domain) { ParmParse pp("mac"); pp.get("tol",tol); pp.query("numSmoothCoarsen",numSmoothCoarsen); pp.query("numSmoothRefine",numSmoothRefine); hx = dx[0]; hy = dx[1]; } // ************************************************************************ // ** destructor ** // ************************************************************************ mac_projector::~mac_projector() { } // ************************************************************************ // ** project ** // ************************************************************************ void mac_projector::project(Real * uadv, Real * vadv, Real *rho, FArrayBox& divu_src) { FArrayBox *phi = new FArrayBox(BoxLib::grow(domain,1),1); phi->setVal(0.0); FArrayBox *source = new FArrayBox(domain,1); FArrayBox *resid = new FArrayBox(domain,1); Box xedges(domain); int idir = 0; int ngrow = 1; xedges.growHi(idir,ngrow); FArrayBox *sigmax = new FArrayBox(xedges,1); Box yedges(domain); idir = 1; ngrow = 1; yedges.growHi(idir,ngrow); FArrayBox *sigmay = new FArrayBox(yedges,1); FORT_INITSIGMA(sigmax->dataPtr(),sigmay->dataPtr(),rho, x,xhalf,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi); Real rhsnorm; FORT_RHSMAC(uadv,vadv,divu_src.dataPtr(),source->dataPtr(), ARLIM(lo),ARLIM(hi),&hx,&hy,x,xhalf,&rhsnorm); std::cout << std::endl << "MAC Source norm: " << rhsnorm << std::endl; if (rhsnorm > tol) { Real goal = tol*rhsnorm; macprojection_mg *solver = new macprojection_mg(domain,phi,source,resid,sigmax,sigmay, x,xhalf,hx,hy); solver->solve(goal,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; Real * gradpx = new Real[(domain.length()[0]+1)* domain.length()[1] ]; Real * gradpy = new Real[ domain.length()[0] * (domain.length()[1]+1)]; FORT_GRADMAC(gradpx,gradpy,phi->dataPtr(),ARLIM(lo),ARLIM(hi), &hx,&hy,&bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi); FORT_PROJUMAC(uadv, vadv, gradpx, gradpy, rho, ARLIM(lo), ARLIM(hi)); delete gradpx; delete gradpy; } delete phi; delete source; delete resid; delete sigmax; delete sigmay; } // ************************************************************************ // ** constructor ** // ************************************************************************ macprojection_mg::macprojection_mg(const Box& Domain, FArrayBox *Phi, FArrayBox *Source, FArrayBox *Resid, FArrayBox *Sigmax, FArrayBox *Sigmay, Real * X, Real * XHALF, Real Hx, Real Hy) : multigrid(Domain, Phi, Source, Resid, Hx, Hy) { x_mg = X; xhalf_mg = XHALF; sigmax = Sigmax; sigmay = Sigmay; // create next (coarser) level const IntVect& len = domain.length(); // If the grid has an odd number of cells, or has reached its minimum // length in either direction, then we can not coarsen any further. // If this is a pure multigrid cycle, use a conjugate gradient bottom // solver; if this is a multigrid preconditioner for a conjugate gradient // solve, then just relax many times at the bottom. if ( (len[0]&1) != 0 || (len[1]&1) != 0 || len[0] < 4 || len[1] < 4) { Next = NULL; cgwork = new FArrayBox(domain,4); FORT_MKSUMMAC(sigmax->dataPtr(), sigmay->dataPtr(), cgwork->dataPtr(0), ARLIM(lo_mg), ARLIM(hi_mg), &hx, &hy, &bcx_lo,&bcx_hi,&bcy_lo, &bcy_hi); } else { cgwork = NULL; Box newdomain = BoxLib::coarsen(domain,2); FArrayBox* newphi = new FArrayBox(BoxLib::grow(newdomain,1),1); newphi->setVal(0.0); Real* newx = new Real[newdomain.length()[0]+2]; Real* newxhalf = new Real[newdomain.length()[0]+2]; Real newhx = 2.0*hx; Real newhy = 2.0*hy; FORT_XINIT(newx, newxhalf, &newhx, ARLIM(newdomain.smallEnd().getVect()), ARLIM(newdomain.bigEnd().getVect()), &irz); FArrayBox* newresid = new FArrayBox(BoxLib::grow(newdomain,1),1); FArrayBox* newsigmax = new FArrayBox(BoxLib::grow(newdomain,1),1); FArrayBox* newsigmay = new FArrayBox(BoxLib::grow(newdomain,1),1); const int* dom_lo = domain.smallEnd().getVect(); const int* dom_hi = domain.bigEnd().getVect(); const int* new_lo = newdomain.smallEnd().getVect(); const int* new_hi = newdomain.bigEnd().getVect(); FORT_COARSIGMA(sigmax->dataPtr(),sigmay->dataPtr(), newsigmax->dataPtr(),newsigmay->dataPtr(), ARLIM(dom_lo), ARLIM(dom_hi), ARLIM(new_lo), ARLIM(new_hi)); Next = new macprojection_mg(newdomain, newphi, new FArrayBox(newdomain,1), newresid, newsigmax, newsigmay, newx, newxhalf, newhx, newhy); } next = Next; } // ************************************************************************ // ** destructor ** // ************************************************************************ macprojection_mg::~macprojection_mg() { if (Next != NULL) { delete Next->phi; delete Next->x_mg; delete Next->xhalf_mg; delete Next->source; delete Next->resid; delete Next->sigmax; delete Next->sigmay; delete Next; } delete cgwork; } // ************************************************************************ // ** residual ** // ************************************************************************ Real macprojection_mg::residual() { Real rnorm; FORT_RESIDUAL(resid->dataPtr(),phi->dataPtr(),source->dataPtr(), sigmax->dataPtr(),sigmay->dataPtr(),x_mg, ARLIM(lo_mg),ARLIM(hi_mg), &hx,&hy,&rnorm,&bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi); return rnorm; } // ************************************************************************ // ** step ** // ************************************************************************ void macprojection_mg::step(int nngsrb) { Real rnorm = 1.e10; if (cgwork != NULL) { FArrayBox * dest0 = new FArrayBox(BoxLib::grow(domain,1),1); FORT_SOLVEMAC(phi->dataPtr(), dest0->dataPtr(), source->dataPtr(), sigmax->dataPtr(), sigmay->dataPtr(), cgwork->dataPtr(0), cgwork->dataPtr(1), cgwork->dataPtr(2), cgwork->dataPtr(3), resid->dataPtr(), x_mg, ARLIM(lo_mg), ARLIM(hi_mg), &hx, &hy, &bcx_lo, &bcx_hi, &bcy_lo, &bcy_hi, &rnorm, &prob_norm); delete dest0; } else { FORT_GSRB(phi->dataPtr(),source->dataPtr(), sigmax->dataPtr(),sigmay->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),&hx,&hy, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&nngsrb); } } // ************************************************************************ // ** Restrict ** // ************************************************************************ void macprojection_mg::Restrict() { const int * loc = next->domain.smallEnd().getVect(); const int * hic = next->domain.bigEnd().getVect(); FORT_RESTRICT(resid->dataPtr(), next->source->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),ARLIM(loc),ARLIM(hic)); } // ************************************************************************ // ** interpolate ** // ************************************************************************ void macprojection_mg::interpolate() { const int * loc = next->domain.smallEnd().getVect(); const int * hic = next->domain.bigEnd().getVect(); FORT_INTERPOLATE(phi->dataPtr(), next->phi->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),ARLIM(loc),ARLIM(hic)); } ccseapps-2.5/CCSEApps/varden2d/hgproj.cpp0000644000175000017500000002321511634153073021364 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #define ARLIM(x) x[0],x[1] int hg_projector::numSmoothCoarsen = 2; int hg_projector::numSmoothRefine = 2; // ************************************************************************ // ** constructor ** // ************************************************************************ hg_projector::hg_projector(const Box& Domain, Real * dx) : domain(Domain) { ParmParse pp("hg"); pp.get("tol",tol); pp.query("numSmoothCoarsen",numSmoothCoarsen); pp.query("numSmoothRefine",numSmoothRefine); hx = dx[0]; hy = dx[1]; phi = new FArrayBox(BoxLib::surroundingNodes(BoxLib::grow(domain,1)),1); phi->setVal(0.0); } // ************************************************************************ // ** destructor ** // ************************************************************************ hg_projector::~hg_projector() { delete phi; } // ************************************************************************ // ** project ** // ************************************************************************ void hg_projector::project(FArrayBox * state, FArrayBox * pressure, FArrayBox * rho, FArrayBox * divu_src, Real time, Real dt) { Box sz(BoxLib::grow(domain,1)); Box p_size(BoxLib::surroundingNodes(sz)); FArrayBox *sigma = new FArrayBox(sz,1); FArrayBox *source = new FArrayBox(p_size,1); FArrayBox *resid = new FArrayBox(p_size,1); sigma->setVal(0.); source->setVal(0.); resid->setVal(0.); FORT_INITSIG(sigma->dataPtr(),rho->dataPtr(),x,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi); Real rhsnorm; FArrayBox gradp(sz,2); gradient(gradp,*pressure); for (int n = 0; n < 2; n++) { gradp.divide(*rho,domain,0,n,1); state->plus(gradp,domain,n,n,1); } FORT_RHSHG(source->dataPtr(),state->dataPtr(),divu_src->dataPtr(),x, ARLIM(lo),ARLIM(hi),&hx,&hy, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&rhsnorm, &time,&dt); std::cout << std::endl << "HG Source norm: " << rhsnorm << std::endl; if (rhsnorm > tol) { phi->setVal(0.0); Real goal = tol*rhsnorm; hgprojection_mg *solver = new hgprojection_mg(domain,phi,source,resid,sigma,hx,hy); solver->solve(goal,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; FArrayBox gradphi; gradphi.resize(sz,2); gradient(gradphi,*phi); FORT_PROJUHG(state->dataPtr(), pressure->dataPtr(), phi->dataPtr(), gradphi.dataPtr(),rho->dataPtr(),ARLIM(lo),ARLIM(hi)); } delete sigma; delete source; delete resid; } // ************************************************************************ // ** gradient ** // ************************************************************************ void hg_projector::gradient(FArrayBox & gradp, FArrayBox & pressure) { const int* p_lo = pressure.loVect(); const int* p_hi = pressure.hiVect(); const int* g_lo = gradp.loVect(); const int* g_hi = gradp.hiVect(); FORT_GRADHG(gradp.dataPtr(),ARLIM(g_lo),ARLIM(g_hi), pressure.dataPtr(),ARLIM(p_lo),ARLIM(p_hi), ARLIM(lo),ARLIM(hi),&hx,&hy, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi); } // ************************************************************************ // ** constructor ** // ************************************************************************ hgprojection_mg::hgprojection_mg(const Box& Domain, FArrayBox *Phi, FArrayBox *Source, FArrayBox *Resid, FArrayBox *Sigma, Real Hx, Real Hy) : multigrid(Domain, Phi, Source, Resid, Hx, Hy) { sigma = Sigma; const IntVect& len = domain.length(); // If the grid has an odd number of cells, or has reached its minimum // length in either direction, then we can not coarsen any further. // If this is a pure multigrid cycle, use a conjugate gradient bottom // solver; if this is a multigrid preconditioner for a conjugate gradient // solve, then just relax many times at the bottom. if ( (len[0]&1) != 0 || (len[1]&1) != 0 || len[0] < 4 || len[1] < 4) { Next = NULL; cgwork = new FArrayBox(BoxLib::surroundingNodes(BoxLib::grow(domain,1)),4); FORT_MAKESUM(sigma->dataPtr(), cgwork->dataPtr(0), ARLIM(lo_mg),ARLIM(hi_mg),&hx,&hy,&bcx_lo,&bcx_hi, &bcy_lo,&bcy_hi); } else { cgwork = NULL; Box newdomain = BoxLib::coarsen(domain,2); Box newp_size = BoxLib::surroundingNodes(BoxLib::grow(newdomain,1)); FArrayBox* newphi = new FArrayBox(newp_size,1); newphi->setVal(0.0); FArrayBox* newsigma = new FArrayBox(BoxLib::grow(newdomain,1),1); FArrayBox* newresid = new FArrayBox(newp_size,1); newsigma->setVal(0.); newresid->setVal(0.); FORT_COARSIG(sigma->dataPtr(),newsigma->dataPtr(), ARLIM(lo_mg), ARLIM(hi_mg), ARLIM(newdomain.smallEnd().getVect()), ARLIM(newdomain.bigEnd().getVect()), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi); Real newhx = 2.0*hx; Real newhy = 2.0*hy; Next = new hgprojection_mg(newdomain, newphi, new FArrayBox(newp_size,1), newresid, newsigma, newhx, newhy); } next = Next; } // ************************************************************************ // ** destructor ** // ************************************************************************ hgprojection_mg::~hgprojection_mg() { if (Next != NULL) { delete Next->phi; delete Next->source; delete Next->resid; delete Next->sigma; delete Next; } delete cgwork; } // ************************************************************************ // ** residual ** // ************************************************************************ Real hgprojection_mg::residual() { Real rnorm; FArrayBox * dgphi = new FArrayBox(BoxLib::surroundingNodes(BoxLib::grow(domain,1)),1); FORT_RESIDUAL(resid->dataPtr(),phi->dataPtr(),source->dataPtr(), sigma->dataPtr(),dgphi->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),&hx,&hy,&rnorm, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi); delete dgphi; return rnorm; } // ************************************************************************ // ** step ** // ************************************************************************ void hgprojection_mg::step(int nngsrb) { int maxiter = 100; FArrayBox * temp = new FArrayBox(BoxLib::surroundingNodes(BoxLib::grow(domain,1)),1); if (cgwork != NULL) { temp->copy(*phi); phi->setVal(0.); Real resnorm = 0.0; FORT_SOLVEHG(phi->dataPtr(), temp->dataPtr(), source->dataPtr(), sigma->dataPtr(), cgwork->dataPtr(0), cgwork->dataPtr(1), cgwork->dataPtr(2), cgwork->dataPtr(3), resid->dataPtr(), ARLIM(lo_mg), ARLIM(hi_mg), &hx, &hy, &bcx_lo, &bcx_hi, &bcy_lo, &bcy_hi, &maxiter, &resnorm, &prob_norm); } else { FORT_RELAX(phi->dataPtr(),source->dataPtr(),sigma->dataPtr(), temp->dataPtr(),ARLIM(lo_mg),ARLIM(hi_mg), &hx,&hy,&bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&nngsrb); } delete temp; } // ************************************************************************ // ** Restrict ** // ************************************************************************ void hgprojection_mg::Restrict() { FORT_RESTRICT(resid->dataPtr(), next->source->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg), ARLIM(next->domain.smallEnd().getVect()), ARLIM(next->domain.bigEnd().getVect()), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi); } // ************************************************************************ // ** interpolate ** // ************************************************************************ void hgprojection_mg::interpolate() { FArrayBox * temp = new FArrayBox(BoxLib::surroundingNodes(BoxLib::grow(domain,1)),1); temp->setVal(0.); FORT_INTERP(temp->dataPtr(), next->phi->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg), ARLIM(next->domain.smallEnd().getVect()), ARLIM(next->domain.bigEnd().getVect())); phi->plus(*temp,0,0,1); delete temp; } ccseapps-2.5/CCSEApps/varden2d/velupd.F0000644000175000017500000000650711634153073021002 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** VELUPD ** c ** Update the velocity components using convective differencing of fluxes c ** This field will then be projected to enforce the divergence constraint. c ************************************************************************* subroutine FORT_VELUPD(u,v,ustar,vstar,lapu,gradp,rhomid, $ uadv,vadv,uhalfx,uhalfy, $ force,dt,DIMS,dx) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T ustar(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T vstar(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T gradp(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T rhomid(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T uhalfx(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T uhalfy(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T dt REAL_T dx(2) c Local variables integer i, j REAL_T ubar, vbar REAL_T ugradu, ugradv do j = lo_2,hi_2 do i = lo_1,hi_1 ubar = half*(uadv(i,j) + uadv(i+1,j)) vbar = half*(vadv(i,j) + vadv(i,j+1)) ugradu = ubar*(uhalfx(i+1,j,1) - uhalfx(i,j,1))/dx(1) + $ vbar*(uhalfy(i,j+1,1) - uhalfy(i,j,1))/dx(2) ugradv = ubar*(uhalfx(i+1,j,2) - uhalfx(i,j,2))/dx(1) + $ vbar*(uhalfy(i,j+1,2) - uhalfy(i,j,2))/dx(2) ustar(i,j) = u(i,j) + dt * ( half*lapu(i,j,1)/rhomid(i,j) $ - gradp(i,j,1)/rhomid(i,j) - ugradu + force(i,j,1) ) vstar(i,j) = v(i,j) + dt * ( half*lapu(i,j,2)/rhomid(i,j) $ - gradp(i,j,2)/rhomid(i,j) - ugradv + force(i,j,2) ) enddo enddo return end ccseapps-2.5/CCSEApps/varden2d/multigrid.cpp0000644000175000017500000001247311634153073022077 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #define ARLIM(x) x[0],x[1] int multigrid::debug = 0; int multigrid::verbose = 1; int multigrid::first_mg = 1; Real multigrid::prob_norm = 0.; // ************************************************************************ // ** constructor ** // ************************************************************************ multigrid::multigrid(const Box & Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Resid, Real HX, Real HY) : domain(Domain) { if (first_mg) { first_mg = 0; ParmParse pp("multigrid"); pp.query("debug",debug); pp.query("verbose",verbose); } // set pointers to grids phi = Phi; source = Source; resid = Resid; lo_mg = domain.smallEnd().getVect(); hi_mg = domain.bigEnd().getVect(); // set mesh size hx = HX; hy = HY; // coarser levels may be added by constructors for derived classes next = NULL; } // ************************************************************************ // ** solve ** // ************************************************************************ void multigrid::solve(Real tol, Real Prob_norm, int nngsrb, int i2) { prob_norm = Prob_norm; int i = 1; Real rlast = residual(); Real res = rlast; if (rlast > tol) { while ((res = vcycle(tol,nngsrb,i2)) > tol) { i++; if (verbose == 2 || debug != 0) std::cout << "Res/Res0: " << res/prob_norm << " after " << i-1 << " iterations " << std::endl; } } if (verbose >= 1 || debug != 0) { std::cout << "Res/Res0: " << res/prob_norm << " after " << i << " iterations " << std::endl; std::cout << " " << std::endl; } } // ************************************************************************ // ** vcycle ** // ************************************************************************ Real multigrid::vcycle(Real tol, int nngsrb, int i2) { Real rnorm = residual(); if (debug) { std::cout << "Res/Res0 " << rnorm/prob_norm << " for " << domain.length() << std::endl; } step(nngsrb); rnorm = residual(); if (debug) { std::cout << "Res/Res0 " << rnorm/prob_norm << " for " << domain.length() << std::endl; } if (next != NULL) { Restrict(); next->phi->setVal(0.0); int downiter = nngsrb; int upiter = i2; next->vcycle(tol,downiter,upiter); interpolate(); if (debug) { rnorm = residual(); std::cout << "Res/Res0 " << rnorm/prob_norm << " for " << domain.length() << std::endl; } step(i2); if (debug) { rnorm = residual(); std::cout << "Res/Res0 " << rnorm/prob_norm << " for " << domain.length() << std::endl; } } return rnorm; } // ************************************************************************ // ** fmv ** // ************************************************************************ Real multigrid::fmv(Real tol, int nngsrb, int i2) { step(nngsrb); if (next != NULL) { residual(); Restrict(); next->phi->setVal(0.0); Real nexttol = .25*tol; int downiter = nngsrb; int upiter = i2; next->fmv(nexttol,downiter,upiter); interpolate(); } return vcycle(tol,nngsrb,i2); } // ************************************************************************ // ** wcycle ** // ************************************************************************ Real multigrid::wcycle(int nngsrb, int i2) { Real rnorm; step(nngsrb); rnorm = residual(); if (next != NULL) { Restrict(); next->phi->setVal(0.0); int downiter = nngsrb; int upiter = i2; next->wcycle(downiter,upiter); next->wcycle(downiter,upiter); interpolate(); step(i2); rnorm = residual(); } return rnorm; } ccseapps-2.5/CCSEApps/varden2d/visc.F0000644000175000017500000005254411634153073020451 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "VISC_F.H" #include "BCTypes.H" #if BL_USE_FLOAT #define twentyfive 25.e0 #else #define twentyfive 25.d0 #endif #define DIMS lo_1,lo_2,hi_1,hi_2 #define CDIMS loc_1,loc_2,hic_1,hic_2 c ************************************************************************* c ** INITSIG ** c ** Define the 1/rho coefficients at the top level of the multigrid c ************************************************************************* subroutine FORT_INITSIGV(sigma,rho,rmu,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer DIMS REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T rmu integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi c Local variables integer i,j do j = lo_2,hi_2 do i = lo_1,hi_1 sigma(i,j) = rmu/rho(i,j) enddo enddo if (bcx_lo .eq. PERIODIC) then do j = lo_2,hi_2 sigma(lo_1-1,j) = sigma(hi_1,j) enddo else if (bcx_lo .eq. WALL) then do j = lo_2,hi_2 sigma(lo_1-1,j) = sigma(lo_1,j) enddo else if (bcx_lo .eq. INLET) then do j = lo_2,hi_2 sigma(lo_1-1,j) = rmu / rho(lo_1-1,j) enddo else if (bcx_lo .eq. OUTLET) then do j = lo_2,hi_2 sigma(lo_1-1,j) = sigma(lo_1,j) enddo endif if (bcx_hi .eq. PERIODIC) then do j = lo_2,hi_2 sigma(hi_1+1,j) = sigma(lo_1,j) enddo else if (bcx_hi .eq. WALL) then do j = lo_2,hi_2 sigma(hi_1+1,j) = sigma(hi_1,j) enddo else if (bcx_hi .eq. INLET) then do j = lo_2,hi_2 sigma(hi_1+1,j) = rmu / rho(hi_1+1,j) enddo else if (bcx_hi .eq. OUTLET) then do j = lo_2,hi_2 sigma(hi_1+1,j) = sigma(hi_1,j) enddo endif if (bcy_lo .eq. PERIODIC) then do i = lo_1,hi_1 sigma(i,lo_2-1) = sigma(i,hi_2) enddo else if (bcy_lo .eq. WALL) then do i = lo_1,hi_1 sigma(i,lo_2-1) = sigma(i,lo_2) enddo else if (bcy_lo .eq. INLET) then do i = lo_1,hi_1 sigma(i,lo_2-1) = rmu / rho(i,lo_2-1) enddo else if (bcy_lo .eq. OUTLET) then do i = lo_1,hi_1 sigma(i,lo_2-1) = sigma(i,lo_2) enddo endif if (bcy_hi .eq. PERIODIC) then do i = lo_1,hi_1 sigma(i,hi_2+1) = sigma(i,lo_2) enddo else if (bcy_hi .eq. WALL) then do i = lo_1,hi_1 sigma(i,hi_2+1) = sigma(i,hi_2) enddo else if (bcy_hi .eq. INLET) then do i = lo_1,hi_1 sigma(i,hi_2+1) = rmu / rho(i,hi_2+1) enddo else if (bcy_hi .eq. OUTLET) then do i = lo_1,hi_1 sigma(i,hi_2+1) = sigma(i,hi_2) enddo endif return end c ************************************************************************* c ** RHSNORM ** c ** Take the norm of the right-hand-side and fill the inflow registers c ************************************************************************* subroutine FORT_RHSNORM(rhs,source,DIMS,rnorm, $ uinx_lo,uinx_hi,uiny_lo,uiny_hi) implicit none integer DIMS REAL_T rhs(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T source(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T uinx_lo(lo_2-1:hi_2+1) REAL_T uinx_hi(lo_2-1:hi_2+1) REAL_T uiny_lo(lo_1-1:hi_1+1) REAL_T uiny_hi(lo_1-1:hi_1+1) REAL_T rnorm c Local variables integer i,j rnorm = zero do j = lo_2,hi_2 do i = lo_1,hi_1 rnorm = max(rnorm,abs(rhs(i,j))) source(i,j) = rhs(i,j) enddo enddo do j = lo_2-1,hi_2+1 uinx_lo(j) = rhs(lo_1-1,j) uinx_hi(j) = rhs(hi_1+1,j) enddo do i = lo_1-1,hi_1+1 uiny_lo(i) = rhs(i,lo_2-1) uiny_hi(i) = rhs(i,hi_2+1) enddo return end c ************************************************************************* c ** RESID_XY ** c ** Compute the residual in Cartesian (x-y) geometry c ************************************************************************* subroutine FORT_RESID(res,u,f,sigma, $ uinx_lo,uinx_hi,uiny_lo,uiny_hi,r,rhalf, $ DIMS,hx,hy, $ resnorm,bcx_lo,bcx_hi,bcy_lo,bcy_hi,level,irz,idir) implicit none integer DIMS REAL_T res(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T f(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T uinx_lo(lo_2-1:hi_2+1) REAL_T uinx_hi(lo_2-1:hi_2+1) REAL_T uiny_lo(lo_1-1:hi_1+1) REAL_T uiny_hi(lo_1-1:hi_1+1) REAL_T r(lo_1-1:hi_1+1) REAL_T rhalf(lo_1 :hi_1+2) REAL_T hx REAL_T hy REAL_T resnorm integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer level integer irz integer idir c Local variables REAL_T ux_left,ux_left_wall REAL_T ux_rght,ux_rght_wall REAL_T uy_bot , uy_bot_wall REAL_T uy_top , uy_top_wall REAL_T hxsqinv, hysqinv logical ltest integer is,ie,js,je integer i,j is = lo_1 ie = hi_1 js = lo_2 je = hi_2 hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) if (level .eq. 0) then call gsrbvbc(u,uinx_lo,uinx_hi,uiny_lo,uiny_hi, $ DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,irz,idir) endif do j = lo_2,hi_2 do i = lo_1,hi_1 ux_left = (u(i,j) - u(i-1,j)) ux_left_wall = (-sixteen * u(is-1,j) + twenty * u(is,j) $ -five * u(is+1,j) + u(is+2,j) ) * fifth ltest = ( i .eq. is .and. level .eq. 0 .and. $ (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) .and. $ (irz .eq. 0 .or. (irz .eq. 1 .and. idir .eq. 0)) ) ux_left = cvmgt(ux_left_wall, ux_left,ltest) ux_left = rhalf(i) * ux_left * hxsqinv ux_rght = (u(i+1,j) - u(i,j)) ux_rght_wall = ( sixteen * u(ie+1,j) - twenty * u(ie,j) $ +five * u(ie-1,j) - u(ie-2,j) ) * fifth ltest = ( i .eq. ie .and. level .eq. 0 .and. $ (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) ) ux_rght = cvmgt(ux_rght_wall,ux_rght,ltest) ux_rght = rhalf(i+1) * ux_rght * hxsqinv uy_bot = (u(i,j) - u(i,j-1)) uy_bot_wall = (-sixteen * u(i,js-1) + twenty * u(i,js) $ -five * u(i,js+1) + u(i,js+2) ) * fifth ltest = ( j .eq. js .and. level .eq. 0 .and. $ (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) ) uy_bot = cvmgt(uy_bot_wall,uy_bot,ltest) uy_bot = r(i) * uy_bot * hysqinv uy_top = (u(i,j+1) - u(i,j)) uy_top_wall = (sixteen * u(i,je+1) - twenty * u(i,je) $ +five * u(i,je-1) - u(i,je-2) ) * fifth ltest = ( j .eq. je .and. level .eq. 0 .and. $ (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) ) uy_top = cvmgt(uy_top_wall,uy_top,ltest) uy_top = r(i) * uy_top * hysqinv res(i,j) = f(i,j) - ( $ u(i,j) - sigma(i,j) * (ux_rght-ux_left+uy_top-uy_bot) / r(i) ) enddo enddo if (irz .eq. 1 .and. idir .eq. 0) then do j = js,je do i = is,ie res(i,j) = res(i,j) - sigma(i,j)*u(i,j)/(r(i)*r(i)) enddo enddo endif resnorm = zero do j = lo_2,hi_2 do i = lo_1,hi_1 resnorm = max(resnorm,abs(res(i,j))) enddo enddo return end c ************************************************************************* c ** GSRBV ** c ** Gauss-Seidel red-black relaxation c ************************************************************************* subroutine FORT_GSRBV(u,f,sigma,uinx_lo,uinx_hi,uiny_lo,uiny_hi, $ r,rhalf,DIMS,hx,hy, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,level,irz,idir,nngsrb) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T f(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T uinx_lo(lo_2-1:hi_2+1) REAL_T uinx_hi(lo_2-1:hi_2+1) REAL_T uiny_lo(lo_1-1:hi_1+1) REAL_T uiny_hi(lo_1-1:hi_1+1) REAL_T r(lo_1-1:hi_1+1) REAL_T rhalf(lo_1 :hi_1+2) REAL_T hx REAL_T hy integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer level integer irz integer idir integer nngsrb c Local variables REAL_T ux_left,ux_left_wall,facx_left REAL_T ux_rght,ux_rght_wall,facx_rght REAL_T uy_bot , uy_bot_wall,facy_bot REAL_T uy_top , uy_top_wall,facy_top REAL_T rlam, rlu REAL_T hxsqinv, hysqinv integer i,j,iter,ioff,iinc integer is,ie,js,je logical ltest is = lo_1 ie = hi_1 js = lo_2 je = hi_2 hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) if (level .eq. 0) then call gsrbvbc(u,uinx_lo,uinx_hi,uiny_lo,uiny_hi, $ DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,irz,idir) else if (bcx_lo .eq. PERIODIC) then do j = js-1,je+1 u(is-1,j) = u(ie,j) enddo elseif (bcx_lo .eq. OUTLET) then do j = js-1,je+1 u(is-1,j) = u(is,j) enddo endif if (bcx_hi .eq. PERIODIC) then do j = js-1,je+1 u(ie+1,j) = u(is,j) enddo elseif (bcx_hi .eq. OUTLET) then do j = js-1,je+1 u(ie+1,j) = u(ie,j) enddo endif if (bcy_lo .eq. PERIODIC) then do i = is,ie u(i,js-1) = u(i,je) enddo elseif (bcy_lo .eq. OUTLET) then do i = is-1,ie+1 u(i,js-1) = u(i,js) enddo endif if (bcy_hi .eq. PERIODIC) then do i = is,ie u(i,je+1) = u(i,js) enddo elseif (bcy_hi .eq. OUTLET) then do i = is-1,ie+1 u(i,je+1) = u(i,je) enddo endif endif do iter = 1, nngsrb do ioff = 0,1 do j = js,je iinc = mod(j+ioff,2) do i = is+iinc,ie,2 ux_left = (u(i,j) - u(i-1,j)) ux_left_wall = (-sixteen * u(is-1,j) + twenty * u(is,j) $ -five * u(is+1,j) + u(is+2,j) ) * fifth ltest = ( i .eq. is .and. level .eq. 0 .and. $ (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) .and. $ (irz .eq. 0 .or. (irz .eq. 1 .and. idir .eq. 0)) ) ux_left = cvmgt(ux_left_wall, ux_left,ltest) facx_left = cvmgt(four ,one ,ltest) ux_left = rhalf(i) * ux_left * hxsqinv facx_left = rhalf(i) * facx_left * hxsqinv ux_rght = (u(i+1,j) - u(i,j)) ux_rght_wall = ( sixteen * u(ie+1,j) - twenty * u(ie,j) $ +five * u(ie-1,j) - u(ie-2,j) ) * fifth ltest = ( i .eq. ie .and. level .eq. 0 .and. $ (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) ) ux_rght = cvmgt(ux_rght_wall,ux_rght,ltest) facx_rght = cvmgt(four ,one ,ltest) ux_rght = rhalf(i+1) * ux_rght * hxsqinv facx_rght = rhalf(i+1) * facx_rght * hxsqinv uy_bot = (u(i,j) - u(i,j-1)) uy_bot_wall = (-sixteen * u(i,js-1) + twenty * u(i,js) $ -five * u(i,js+1) + u(i,js+2) ) * fifth ltest = ( j .eq. js .and. level .eq. 0 .and. $ (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) ) uy_bot = cvmgt(uy_bot_wall,uy_bot,ltest) facy_bot = cvmgt(four ,one ,ltest) uy_bot = r(i) * uy_bot * hysqinv facy_bot = r(i) * facy_bot * hysqinv uy_top = (u(i,j+1) - u(i,j)) uy_top_wall = (sixteen * u(i,je+1) - twenty * u(i,je) $ +five * u(i,je-1) - u(i,je-2) ) * fifth ltest = ( j .eq. je .and. level .eq. 0 .and. $ (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) ) uy_top = cvmgt(uy_top_wall,uy_top,ltest) facy_top = cvmgt(four ,one ,ltest) uy_top = r(i) * uy_top * hysqinv facy_top = r(i) * facy_top * hysqinv rlu = u(i,j) - sigma(i,j) * (ux_rght-ux_left+uy_top-uy_bot) / r(i) if (irz .eq. 1 .and. idir .eq. 0) $ rlu = rlu + sigma(i,j) * u(i,j) / (r(i)*r(i)) rlam = one + sigma(i,j)*(facx_left+facx_rght+facy_bot+facy_top) rlam = one/rlam u(i,j) = u(i,j) - rlam*(rlu - f(i,j)) enddo enddo if (level .eq. 0) then call gsrbvbc(u,uinx_lo,uinx_hi,uiny_lo,uiny_hi, $ DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,irz,idir) else if (bcx_lo .eq. PERIODIC) then do j = js-1,je+1 u(is-1,j) = u(ie,j) enddo elseif ( bcx_lo .eq. OUTLET .or. $ (bcx_lo .eq. WALL .and. idir .ne. 0 .and. irz .eq. 1) ) then do j = lo_2-1,hi_2+1 u(is-1,j) = u(is,j) enddo endif if (bcx_hi .eq. PERIODIC) then do j = js-1,je+1 u(ie+1,j) = u(is,j) enddo elseif (bcx_hi .eq. OUTLET) then do j = lo_2-1,hi_2+1 u(ie+1,j) = u(ie,j) enddo endif if (bcy_lo .eq. PERIODIC) then do i = is,ie u(i,js-1) = u(i,je) enddo elseif (bcy_lo .eq. OUTLET) then do i = lo_1-1,hi_1+1 u(i,js-1) = u(i,js) enddo endif if (bcy_hi .eq. PERIODIC) then do i = is,ie u(i,je+1) = u(i,js) enddo elseif (bcy_hi .eq. OUTLET) then do i = lo_1-1,hi_1+1 u(i,je+1) = u(i,je) enddo endif endif enddo enddo return end c ************************************************************************* c ** GSRBVBC ** c ** Impose phyical boundary conditions c ************************************************************************* subroutine gsrbvbc(u,uinx_lo,uinx_hi,uiny_lo,uiny_hi, $ DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,irz,idir) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T uinx_lo(lo_2-1:hi_2+1) REAL_T uinx_hi(lo_2-1:hi_2+1) REAL_T uiny_lo(lo_1-1:hi_1+1) REAL_T uiny_hi(lo_1-1:hi_1+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer irz integer idir c Local variables integer i,j,is,ie,js,je is = lo_1 js = lo_2 ie = hi_1 je = hi_2 c NOTE: WHEN BC = WALL or INLET, THE STENCILS ASSUME THE GHOST CELL VALUES c APPLY AT THE EDGE, NOT AT THE CELL OUTSIDE!!! if (bcy_lo .eq. OUTLET) then do i = is,ie u(i,js-1) = u(i,js) enddo elseif (bcy_lo .eq. INLET) then do i = is-1,ie+1 u(i,js-1) = uiny_lo(i) enddo elseif (bcy_lo .eq. WALL) then do i = is,ie u(i,js-1) = zero enddo elseif (bcy_lo .eq. PERIODIC) then do i = is,ie u(i,js-1) = u(i,je) enddo endif if (bcy_hi .eq. OUTLET) then do i = is-1,ie+1 u(i,je+1) = u(i,je) enddo elseif (bcy_hi .eq. INLET) then do i = is-1,ie+1 u(i,je+1) = uiny_hi(i) enddo elseif (bcy_hi .eq. WALL) then do i = is,ie u(i,je+1) = zero enddo elseif (bcy_hi .eq. PERIODIC) then do i = is,ie u(i,je+1) = u(i,js) enddo endif if (bcx_lo .eq. OUTLET) then do j = js-1,je+1 u(is-1,j) = u(is,j) enddo elseif (bcx_lo .eq. INLET) then do j = js-1,je+1 u(is-1,j) = uinx_lo(j) enddo elseif (bcx_lo .eq. WALL) then if (idir .eq. 0) then do j = js-1,je+1 u(is-1,j) = zero enddo else do j = js-1,je+1 u(is-1,j) = cvmgt(zero,u(is,j),irz .eq. 0) enddo endif elseif (bcx_lo .eq. PERIODIC) then do j = js-1,je+1 u(is-1,j) = u(ie,j) enddo endif if (bcx_hi .eq. OUTLET) then do j = js-1,je+1 u(ie+1,j) = u(ie,j) enddo elseif (bcx_hi .eq. INLET) then do j = js-1,je+1 u(ie+1,j) = uinx_hi(j) enddo elseif (bcx_hi .eq. WALL) then do j = js-1,je+1 u(ie+1,j) = zero enddo elseif (bcx_hi .eq. PERIODIC) then do j = js-1,je+1 u(ie+1,j) = u(is,j) enddo endif return end c ************************************************************************* c ** RESTRICT ** c ** Conservative restriction of the residual c ************************************************************************* subroutine FORT_RESTRICT(res,resc,DIMS,CDIMS,r) implicit none integer DIMS integer CDIMS REAL_T res(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T resc(loc_1:hic_1,loc_2:hic_2) REAL_T r(lo_1-1:hi_1+1) c Local variables REAL_T vtot integer i,j integer twoi,twoj do j = loc_2,hic_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+ lo_1 twoj = 2*(j-loc_2)+ lo_2 vtot = (r(twoi) + r(twoi+1))*two resc(i,j) = (res(twoi ,twoj) + res(twoi ,twoj+1))*r(twoi) + $ (res(twoi+1,twoj) + res(twoi+1,twoj+1))*r(twoi+1) resc(i,j) = resc(i,j)/vtot enddo enddo return end c ************************************************************************* c ** COARSIGV ** c ** Coarsening of the coefficients c ************************************************************************* subroutine FORT_COARSIGV(sigma,sigmac,DIMS,CDIMS,r) implicit none integer DIMS integer CDIMS REAL_T sigma(lo_1 -1:hi_1 +1,lo_2 -1:hi_2+1 ) REAL_T sigmac(loc_1-1:hic_1+1,loc_2-1:hic_2+1) REAL_T r(lo_1-1:hi_1+1) c Local variables REAL_T vtot integer i,j,twoi,twoj do j = loc_2,hic_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+ lo_1 twoj = 2*(j-loc_2)+ lo_2 vtot = (r(twoi) + r(twoi+1))*two sigmac(i,j) = (sigma(twoi ,twoj) + sigma(twoi ,twoj+1))*r(twoi) $ +(sigma(twoi+1,twoj) + sigma(twoi+1,twoj+1))*r(twoi+1) sigmac(i,j) = sigmac(i,j)/vtot enddo enddo return end c ************************************************************************* c ** INTERPOLATE ** c ** Piecewise-constant interpolation c ************************************************************************* subroutine FORT_INTERPOLATE(u,deltac,DIMS,CDIMS) implicit none integer DIMS integer CDIMS REAL_T u(lo_1 -1:hi_1 +1,lo_2 -1:hi_2 +1) REAL_T deltac(loc_1-1:hic_1+1,loc_2-1:hic_2+1) c Local variables integer i,j,twoi,twoj do j = loc_2,hic_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+lo_1 twoj = 2*(j-loc_2)+lo_2 u(twoi ,twoj ) = u(twoi ,twoj ) + deltac(i,j) u(twoi+1,twoj ) = u(twoi+1,twoj ) + deltac(i,j) u(twoi ,twoj+1) = u(twoi ,twoj+1) + deltac(i,j) u(twoi+1,twoj+1) = u(twoi+1,twoj+1) + deltac(i,j) enddo enddo return end ccseapps-2.5/CCSEApps/varden2d/inputs20000644000175000017500000002502211634153073020714 0ustar amckinstryamckinstry##############################################################################3 # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 240 ##############################################################################3 # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ##############################################################################3 # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin2 ##############################################################################3 # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ##############################################################################3 # Root part of checkpoint file name check_file_root = chk ##############################################################################3 # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ##############################################################################3 # Root part of plotfile name. plot_file_root = plt ##############################################################################3 # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ##############################################################################3 # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 0.1 ##############################################################################3 # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = -9.8 ##############################################################################3 # if irz = 0 then use Cartesian(x-y) geometry # If irz = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if irz = 1 then # you must set bcx_lo = 2. irz = 0 ##############################################################################3 # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ##############################################################################3 # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ##############################################################################3 # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ##############################################################################3 # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ##############################################################################3 # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. grid.n_cell = 64 128 ##############################################################################3 # The physical coordinates of the low end of the domain. # This is read by the Grid class. grid.prob_lo = 0. 0. ##############################################################################3 # The physical coordinates of the high end of the domain. # This is read by the Grid class. grid.prob_hi = 1. 2. ##############################################################################3 # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.0 ##############################################################################3 # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ##############################################################################3 # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ##############################################################################3 # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ##############################################################################3 # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ##############################################################################3 # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ##############################################################################3 # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ##############################################################################3 # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ##############################################################################3 # These variables control interactive contour plotting on UNIX systems. # post_file = name of postscript file (will be appended with ".ps") # device = 1 => XWINDOW, 2 = POSTSCRIPT, 3 = both # variable = name of variable (must match name in Grid.C) # interval = intervals between plots (-1 = off) # num_cont = number of contour lines per plot # win_size = number of pixels in maximum window direction # # post_file device variable interval num_cont win_size # --------- ------ -------- -------- -------- ---------- contour.plot = xvel 1 x_vel -1 20 400 contour.plot = yvel 1 y_vel -1 20 400 contour.plot = density 1 density 5 20 400 contour.plot = tracer 1 tracer -1 20 400 contour.plot = vort 1 vort -1 20 400 contour.plot = press 1 pressure -1 20 400 contour.plot = px 1 px -1 20 400 contour.plot = py 1 py -1 20 400 ccseapps-2.5/CCSEApps/varden2d/slopex.F0000644000175000017500000002050211634153073021004 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** SLOPEX ** c ** Compute the slope of nvar components of s in the x-direction c ************************************************************************* subroutine FORT_SLOPEX(s,slx,dxscr,DIMS,first_comp,nvar, $ bcx_lo,bcx_hi,irz,slope_order) implicit none integer DIMS integer nvar REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,nvar) REAL_T slx(lo_1-1:hi_1+1,lo_2-1:hi_2+1,nvar) REAL_T dxscr(lo_1-1:hi_1+1,4) integer bcx_lo,bcx_hi integer irz integer first_comp integer slope_order c Local variables integer is,js,ie,je integer i,j,iv integer cen,lim,flag,fromm REAL_T del,slim,sflag REAL_T dpls,dmin,ds parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) is = lo_1 js = lo_2 ie = hi_1 je = hi_2 if (irz .eq. 1 .and. lo_1 .ne. 0) then print *,'NEED LO(1) = 0 WHEN IRZ = 1' stop endif c HERE DOING 1ST ORDER if (slope_order .eq. 0) then do iv = 1,nvar do j = js-1,je+1 do i = is-1,ie+1 slx(i,j,iv) = zero enddo enddo enddo c HERE DOING 2ND ORDER else if (slope_order .eq. 2) then do iv=1,nvar do j = js-1,je+1 do i = is,ie del = half*(s(i+1,j,iv) - s(i-1,j,iv)) dpls = two*(s(i+1,j,iv) - s(i ,j,iv)) dmin = two*(s(i ,j,iv) - s(i-1,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(i,j,iv)= sflag*min(slim,abs(del)) enddo if (bcx_lo .eq. PERIODIC) then slx(is-1,j,iv) = slx(ie,j,iv) elseif (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) then slx(is-1,j,iv) = zero del = (s(is+1,j,iv)+three*s(is,j,iv)- $ four*s(is-1,j,iv) ) * third dpls = two*(s(is+1,j,iv) - s(is ,j,iv)) dmin = two*(s(is ,j,iv) - s(is-1,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(is,j,iv)= sflag*min(slim,abs(del)) elseif (bcx_lo .eq. OUTLET) then slx(is-1,j,iv) = zero endif if (bcx_hi .eq. PERIODIC) then slx(ie+1,j,iv) = slx(is,j,iv) elseif (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) then slx(ie+1,j,iv) = zero del = -(s(ie-1,j,iv)+three*s(ie,j,iv)- $ four*s(ie+1,j,iv) ) * third dpls = two*(s(ie ,j,iv) - s(ie-1,j,iv)) dmin = two*(s(ie+1,j,iv) - s(ie ,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(ie,j,iv)= sflag*min(slim,abs(del)) elseif (bcx_hi .eq. OUTLET) then slx(ie+1,j,iv) = zero endif enddo enddo else c HERE DOING 4TH ORDER do iv=1,nvar do j = js-1,je+1 if (irz .eq. 1 .and. $ first_comp .eq. 0 .and. iv .eq. 1) then s(-1,j,1) = -s(0,j,1) endif do i = is,ie dxscr(i,cen) = half*(s(i+1,j,iv)-s(i-1,j,iv)) dmin = two*(s(i ,j,iv)-s(i-1,j,iv)) dpls = two*(s(i+1,j,iv)-s(i ,j,iv)) dxscr(i,lim)= min(abs(dmin),abs(dpls)) dxscr(i,lim) = cvmgp(dxscr(i,lim),zero,dpls*dmin) dxscr(i,flag) = sign(one,dxscr(i,cen)) dxscr(i,fromm)= dxscr(i,flag)*min(dxscr(i,lim), $ abs(dxscr(i,cen))) enddo if (bcx_lo .eq. PERIODIC) then dxscr(is-1,fromm) = dxscr(ie,fromm) else dxscr(is-1,fromm) = dxscr(is,fromm) endif if (bcx_hi .eq. PERIODIC) then dxscr(ie+1,fromm) = dxscr(is,fromm) else dxscr(ie+1,fromm) = dxscr(ie,fromm) endif do i = is,ie ds = two * two3rd * dxscr(i,cen) - $ sixth * (dxscr(i+1,fromm) + dxscr(i-1,fromm)) slx(i,j,iv) = dxscr(i,flag)*min(abs(ds),dxscr(i,lim)) enddo if (irz .eq. 1 .and. $ first_comp .eq. 0 .and. iv .eq. 1) then s(-1,j,1) = zero endif if (bcx_lo .eq. PERIODIC) then slx(is-1,j,iv)=slx(ie,j,iv) elseif (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) then slx(is-1,j,iv) = zero if (irz .eq. 0 .or. .not. $ (first_comp .eq. 0 .and. iv .eq. 1) ) then del = -sixteen/fifteen*s(is-1,j,iv) + half*s(is,j,iv) + $ two3rd*s(is+1,j,iv) - tenth*s(is+2,j,iv) dmin = two*(s(is ,j,iv)-s(is-1,j,iv)) dpls = two*(s(is+1,j,iv)-s(is ,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(is,j,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at is+1 using the revised dxscr(is,fromm) dxscr(is,fromm) = slx(is,j,iv) ds = two * two3rd * dxscr(is+1,cen) - $ sixth * (dxscr(is+2,fromm) + dxscr(is,fromm)) slx(is+1,j,iv) = dxscr(is+1,flag)*min(abs(ds),dxscr(is+1,lim)) endif elseif (bcx_lo .eq. OUTLET) then slx(is-1,j,iv) = zero endif if (bcx_hi .eq. PERIODIC) then slx(ie+1,j,iv)=slx(is,j,iv) elseif (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) then slx(ie+1,j,iv) = zero del = -( -sixteen/fifteen*s(ie+1,j,iv) + half*s(ie,j,iv) + $ two3rd*s(ie-1,j,iv) - tenth*s(ie-2,j,iv) ) dmin = two*(s(ie ,j,iv)-s(ie-1,j,iv)) dpls = two*(s(ie+1,j,iv)-s(ie ,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(ie,j,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at ie-1 using the revised dxscr(ie,fromm) dxscr(ie,fromm) = slx(ie,j,iv) ds = two * two3rd * dxscr(ie-1,cen) - $ sixth * (dxscr(ie-2,fromm) + dxscr(ie,fromm)) slx(ie-1,j,iv) = dxscr(ie-1,flag)*min(abs(ds),dxscr(ie-1,lim)) elseif (bcx_hi .eq. OUTLET) then slx(ie+1,j,iv) = zero endif enddo enddo if (irz .eq. 1 .and. $ first_comp .eq. 0 .and. nvar .ge. 2) then do iv = 2,nvar do j = js,je slx(is-1,j,iv)=-slx(is,j,iv) enddo enddo endif endif return end ccseapps-2.5/CCSEApps/varden2d/inputs40000644000175000017500000002501311634153073020716 0ustar amckinstryamckinstry##############################################################################3 # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 20 ##############################################################################3 # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ##############################################################################3 # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin4 ##############################################################################3 # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ##############################################################################3 # Root part of checkpoint file name check_file_root = chk ##############################################################################3 # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ##############################################################################3 # Root part of plotfile name. plot_file_root = plt ##############################################################################3 # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ##############################################################################3 # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ##############################################################################3 # The acceleration of gravity, assumed to be in the second of the two # coordinate directions (y for x-y, z for r-z). The negative sign indicates # that the force acts in the negative y- (or z-) direction. gravity = 0.0 ##############################################################################3 # if irz = 0 then use Cartesian(x-y) geometry # If irz = 1 then use axisymmetric (r-z) geometry. This enforces a # reflecting boundary condition at r=0. In addition, if irz = 1 then # you must set bcx_lo = 2. irz = 0 ##############################################################################3 # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 3 ##############################################################################3 # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 4 ##############################################################################3 # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ##############################################################################3 # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ##############################################################################3 # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. grid.n_cell = 32 16 ##############################################################################3 # The physical coordinates of the low end of the domain. # This is read by the Grid class. grid.prob_lo = 0. 0. ##############################################################################3 # The physical coordinates of the high end of the domain. # This is read by the Grid class. grid.prob_hi = 2. 1. ##############################################################################3 # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. grid.visc_coef = 0.001 ##############################################################################3 # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ##############################################################################3 # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ##############################################################################3 # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ##############################################################################3 # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ##############################################################################3 # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ##############################################################################3 # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ##############################################################################3 # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ##############################################################################3 # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ##############################################################################3 # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ##############################################################################3 # These variables control interactive contour plotting on UNIX systems. # post_file = name of postscript file (will be appended with ".ps") # device = 1 => XWINDOW, 2 = POSTSCRIPT, 3 = both # variable = name of variable (must match name in Grid.C) # interval = intervals between plots (-1 = off) # num_cont = number of contour lines per plot # win_size = number of pixels in maximum window direction # # post_file device variable interval num_cont win_size # --------- ------ -------- -------- -------- ---------- contour.plot = xvel 1 x_vel -1 20 400 contour.plot = yvel 1 y_vel -1 20 400 contour.plot = density 1 density 2 20 400 contour.plot = tracer 1 tracer -1 20 400 contour.plot = vort 1 vort -1 20 400 contour.plot = press 1 pressure -1 20 400 contour.plot = px 1 px -1 20 400 contour.plot = py 1 py -1 20 400 ccseapps-2.5/CCSEApps/varden2d/OpenSource.txt0000644000175000017500000002434711634153073022221 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: VarDen Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/varden2d/probin30000644000175000017500000000004211634153073020657 0ustar amckinstryamckinstry $fortin prob_type = 3 $end ccseapps-2.5/CCSEApps/varden2d/globals.H0000644000175000017500000000303011634153073021114 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GLOBALS_H_ #define _GLOBALS_H_ extern Real gravity; extern int bcx_lo; extern int bcx_hi; extern int bcy_lo; extern int bcy_hi; extern int irz; extern const int * lo; extern const int * hi; extern Real * x; extern Real * xhalf; #endif ccseapps-2.5/CCSEApps/varden2d/mkforce.F0000644000175000017500000000423511634153073021125 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,hi_1,hi_2 c ************************************************************************* c ** MKFORCE ** c ** Define the forcing terms in the momentum equation c *************************************************************** subroutine FORT_MKFORCE(force,u,v,rho,gravity,visc_coef,time,dx,DIMS) implicit none integer DIMS REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,2) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T gravity REAL_T time REAL_T dx(2) REAL_T visc_coef c Local variables integer i,j do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 force(i,j,1) = zero force(i,j,2) = gravity enddo enddo return end ccseapps-2.5/CCSEApps/varden2d/mac.F0000644000175000017500000006430511634153073020243 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "MACPROJ_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,hi_1,hi_2 #define CDIMS loc_1,loc_2,hic_1,hic_2 c ************************************************************************* c ** INITSIGMA ** c ** Define the 1/rho coefficients at the top level of the multigrid c ************************************************************************* subroutine FORT_INITSIGMA(sigmax,sigmay,rho,r,rhalf,DIMS, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer DIMS REAL_T sigmax(lo_1 :hi_1+1,lo_2 :hi_2 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T r(lo_1-1:hi_1+1) REAL_T rhalf(lo_1:hi_1+2) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi c Local variables integer i,j do j = lo_2,hi_2 do i = lo_1+1,hi_1 sigmax(i,j) = two * rhalf(i) / $ (rho(i,j) + rho(i-1,j)) enddo if (bcx_lo .eq. PERIODIC) then sigmax(lo_1,j) = two * rhalf(lo_1) / $ (rho(lo_1,j) + rho(hi_1,j)) else if (bcx_lo .eq. WALL) then sigmax(lo_1,j) = rhalf(lo_1) / rho(lo_1,j) else if (bcx_lo .eq. INLET) then sigmax(lo_1,j) = rhalf(lo_1) / rho(lo_1-1,j) else if (bcx_lo .eq. OUTLET) then sigmax(lo_1,j) = rhalf(lo_1) / rho(lo_1,j) endif if (bcx_hi .eq. PERIODIC) then sigmax(hi_1+1,j) = sigmax(lo_1,j) else if (bcx_hi .eq. WALL) then sigmax(hi_1+1,j) = rhalf(hi_1+1) / rho(hi_1,j) else if (bcx_hi .eq. INLET) then sigmax(hi_1+1,j) = rhalf(hi_1+1) / rho(hi_1+1,j) else if (bcx_hi .eq. OUTLET) then sigmax(hi_1+1,j) = rhalf(hi_1+1) / rho(hi_1,j) endif enddo do i = lo_1,hi_1 do j = lo_2+1,hi_2 sigmay(i,j) = two * r(i) / $ (rho(i,j) + rho(i,j-1)) enddo if (bcy_lo .eq. PERIODIC) then sigmay(i,lo_2) = two * r(i) / $ (rho(i,lo_2) + rho(i,hi_2)) else if (bcy_lo .eq. WALL) then sigmay(i,lo_2) = r(i) / rho(i,lo_2) else if (bcy_lo .eq. INLET) then sigmay(i,lo_2) = r(i) / rho(i,lo_2-1) else if (bcy_lo .eq. OUTLET) then sigmay(i,lo_2) = r(i) / rho(i,lo_2) endif if (bcy_hi .eq. PERIODIC) then sigmay(i,hi_2+1) = sigmay(i,lo_2) else if (bcy_hi .eq. WALL) then sigmay(i,hi_2+1) = r(i) / rho(i,hi_2) else if (bcy_hi .eq. INLET) then sigmay(i,hi_2+1) = r(i) / rho(i,hi_2+1) else if (bcy_hi .eq. OUTLET) then sigmay(i,hi_2+1) = r(i) / rho(i,hi_2) endif enddo return end c ************************************************************************* c ** GRADMAC ** c ** Compute the gradient of phi c ************************************************************************* subroutine FORT_GRADMAC(gradpx,gradpy,phi,DIMS,hx,hy,bcx_lo,bcx_hi, $ bcy_lo,bcy_hi) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T phi(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T gradpx(lo_1:hi_1+1,lo_2:hi_2 ) REAL_T gradpy(lo_1:hi_1 ,lo_2:hi_2+1) REAL_T hx REAL_T hy integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables integer i, is, ie, j, js, je is = lo_1 ie = hi_1 js = lo_2 je = hi_2 call bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) do j = js,je do i = is,ie+1 gradpx(i,j) = (phi(i,j) - phi(i-1,j))/hx enddo if (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) then gradpx(is ,j) = zero endif if (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) then gradpx(ie+1,j) = zero endif enddo do i = is,ie do j = js,je+1 gradpy(i,j) = (phi(i,j) - phi(i,j-1))/hy enddo if (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) then gradpy(i,js ) = zero endif if (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) then gradpy(i,je+1) = zero endif enddo return end c ************************************************************************* c ** PROJUMAC ** c ** Update the edge-based velocities c ************************************************************************* subroutine FORT_PROJUMAC(uadv,vadv,gradpx,gradpy,rho,DIMS) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T uadv(lo_1 :hi_1+1,lo_2:hi_2 ) REAL_T vadv(lo_1 :hi_1 ,lo_2:hi_2+1) REAL_T gradpx(lo_1 :hi_1+1,lo_2:hi_2 ) REAL_T gradpy(lo_1 :hi_1 ,lo_2:hi_2+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1) c Local variables REAL_T rhx,rhy integer i,j do j = lo_2,hi_2 do i = lo_1,hi_1+1 rhx = two / (rho(i,j) + rho(i-1,j)) uadv(i,j) = uadv(i,j) - gradpx(i,j) * rhx enddo enddo do j = lo_2,hi_2+1 do i = lo_1,hi_1 rhy = two / (rho(i,j) + rho(i,j-1)) vadv(i,j) = vadv(i,j) - gradpy(i,j) * rhy enddo enddo return end c ************************************************************************* c ** RESIDUAL ** c ** Compute the residual R = f - D( sig G(phi) ) c ************************************************************************* subroutine FORT_RESIDUAL(resid,phi,f,sigmax,sigmay,r,DIMS, $ hx,hy,resnorm,bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T resid(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T phi(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T f(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T sigmax(lo_1 :hi_1+1,lo_2 :hi_2 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2+1) REAL_T r(lo_1-1:hi_1+1) REAL_T hx REAL_T hy REAL_T resnorm integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables REAL_T hxsqinv, hysqinv REAL_T rfac, corr integer i,j hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) resnorm = zero call bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) do j = lo_2,hi_2 do i = lo_1,hi_1 rfac = ( sigmax(i+1,j) + sigmax(i,j))*hxsqinv + $ ( sigmay(i,j+1) + sigmay(i,j))*hysqinv corr = $ ( sigmax(i+1,j)*phi(i+1,j) + sigmax(i,j)*phi(i-1,j))*hxsqinv + $ ( sigmay(i,j+1)*phi(i,j+1) + sigmay(i,j)*phi(i,j-1))*hysqinv resid(i,j) = f(i,j) - (corr - rfac*phi(i,j)) resnorm = max(abs(resid(i,j))/r(i), resnorm) enddo enddo return end c ************************************************************************* c ** GSRB ** c ** Gauss-Seidel red-black or line solve relaxation (depending on hy/hx) c ************************************************************************* subroutine FORT_GSRB(phi,f,sigmax,sigmay,DIMS,hx,hy, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,nngsrb) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T phi(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T f(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T sigmax(lo_1 :hi_1+1,lo_2 :hi_2 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2+1) REAL_T hx REAL_T hy integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi integer nngsrb c Local variables REAL_T hxsq, hysq, rfac, corr integer i, j, ioff, iinc integer iter c Additional temporaries for the line solve REAL_T a_ls(0:4096) REAL_T b_ls(0:4096) REAL_T c_ls(0:4096) REAL_T r_ls(0:4096) REAL_T u_ls(0:4096) REAL_T cf0, cf1, cf2, cf3 REAL_T delta integer do_line integer ilen,jlen if (hy. gt. 1.5*hx) then do_line = 1 ilen = hi_1-lo_1+1 if (ilen .gt. 4096) then print *,'TOO BIG FOR LINE SOLVE IN GSRB: ilen = ',ilen stop endif else if (hx .gt. 1.5*hy) then do_line = 2 jlen = hi_2-lo_2+1 if (jlen .gt. 4096) then print *,'TOO BIG FOR LINE SOLVE IN GSRB: jlen = ',jlen stop endif else do_line = 0 endif hxsq = hx*hx hysq = hy*hy call bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) do iter = 1, nngsrb c Standard Gauss-Seidel relaxation with red-black ordering if (do_line .eq. 0) then do ioff = 0,1 do j = lo_2,hi_2 iinc = mod(j+ioff,2) do i = lo_1+iinc,hi_1,2 rfac = (sigmax(i+1,j) + sigmax(i,j))/hxsq + $ (sigmay(i,j+1) + sigmay(i,j))/hysq corr = $ ( sigmax(i+1,j)*phi(i+1,j) + sigmax(i,j)*phi(i-1,j))/hxsq + $ ( sigmay(i,j+1)*phi(i,j+1) + sigmay(i,j)*phi(i,j-1))/hysq phi(i,j) = (corr - f(i,j))/rfac enddo enddo call bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) enddo c Line solve in the horizontal direction elseif (do_line .eq. 1) then do ioff = 0,1 do j = lo_2+ioff,hi_2,2 cf1 = cvmgt(one, zero, (j .eq. lo_2) .and. $ (bcy_lo .eq. WALL .or. bcy_lo.eq. INLET)) cf1 = cvmgt(-one, cf1, (j .eq. lo_2) .and. bcy_lo .eq. OUTLET) cf3 = cvmgt(one, zero, (j .eq. hi_2) .and. $ (bcy_hi .eq. WALL .or. bcy_hi.eq. INLET)) cf3 = cvmgt(-one, cf3, (j .eq. hi_2) .and. bcy_hi .eq. OUTLET) do i = lo_1,hi_1 a_ls(i-lo_1) = sigmax(i,j) / hxsq cf0 = cvmgt(one, zero, (i .eq. lo_1) .and. $ (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET)) cf0 = cvmgt(-one, cf0, (i .eq. lo_1) .and. bcx_lo .eq. OUTLET) cf2 = cvmgt(one, zero, (i .eq. hi_1) .and. $ (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET)) cf2 = cvmgt(-one, cf2, (i .eq. hi_1) .and. bcx_hi .eq. OUTLET) delta = (sigmax(i,j)*cf0 + sigmax(i+1,j)*cf2) / hxsq $ + (sigmay(i,j)*cf1 + sigmay(i,j+1)*cf3) / hysq b_ls(i-lo_1) = -(sigmax(i+1,j) + sigmax(i,j)) / hxsq $ -(sigmay(i,j+1) + sigmay(i,j)) / hysq c_ls(i-lo_1) = sigmax(i+1,j) / hxsq r_ls(i-lo_1) = f(i,j) - $ (sigmay(i,j)*phi(i,j-1) + sigmay(i,j+1)*phi(i,j+1)) / hysq enddo call tridiag(a_ls,b_ls,c_ls,r_ls,u_ls,ilen) do i = lo_1,hi_1 phi(i,j) = u_ls(i-lo_1) enddo enddo call bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) enddo c Line solve in the vertical direction elseif (do_line .eq. 2) then do ioff = 0,1 do i = lo_1+ioff,hi_1,2 cf0 = cvmgt(one, zero, (i .eq. lo_1) .and. $ (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET)) cf0 = cvmgt(-one, cf0, (i .eq. lo_1) .and. bcx_lo .eq. OUTLET) cf2 = cvmgt(one, zero, (i .eq. hi_1) .and. $ (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET)) cf2 = cvmgt(-one, cf2, (i .eq. hi_1) .and. bcx_hi .eq. OUTLET) do j = lo_2,hi_2 a_ls(j-lo_2) = sigmay(i,j) / hysq cf1 = cvmgt(one, zero, (j .eq. lo_2) .and. $ (bcy_lo .eq. WALL .or. bcy_lo.eq. INLET)) cf1 = cvmgt(-one, cf1, (j .eq. lo_2) .and. bcy_lo .eq. OUTLET) cf3 = cvmgt(one, zero, (j .eq. hi_2) .and. $ (bcy_hi .eq. WALL .or. bcy_hi.eq. INLET)) cf3 = cvmgt(-one, cf3, (j .eq. hi_2) .and. bcy_hi .eq. OUTLET) delta = (sigmax(i,j)*cf0 + sigmax(i+1,j)*cf2) / hxsq $ + (sigmay(i,j)*cf1 + sigmay(i,j+1)*cf3) / hysq b_ls(j-lo_2) = -(sigmax(i+1,j) + sigmax(i,j)) / hxsq $ -(sigmay(i,j+1) + sigmay(i,j)) / hysq + delta c_ls(j-lo_2) = sigmay(i,j+1) / hysq r_ls(j-lo_2) = f(i,j) - $ (sigmax(i,j)*phi(i-1,j) + sigmax(i+1,j)*phi(i+1,j)) / hxsq enddo call tridiag(a_ls,b_ls,c_ls,r_ls,u_ls,jlen) do j = lo_2,hi_2 phi(i,j) = u_ls(j-lo_2) enddo enddo call bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) enddo endif enddo return end c ************************************************************************* c ** BC ** c ** Impose boundary conditions c ************************************************************************* subroutine bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T phi(lo_1-1:hi_1+1,lo_2-1:hi_2+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi c Local variables integer i, j, is, ie, js, je is = lo_1 ie = hi_1 js = lo_2 je = hi_2 if (bcy_lo .eq. OUTLET) then do i = is,ie phi(i,js-1) = -phi(i,js) enddo elseif (bcy_lo .eq. INLET .or. bcy_lo .eq. WALL) then do i = is-1,ie+1 phi(i,js-1) = phi(i,js) enddo elseif (bcy_lo .eq. PERIODIC) then do i = is,ie phi(i,js-1) = phi(i,je) enddo endif if (bcy_hi .eq. OUTLET) then do i = is,ie phi(i,je+1) = -phi(i,je) enddo elseif (bcy_hi .eq. INLET .or. bcy_hi .eq. WALL) then do i = is-1,ie+1 phi(i,je+1) = phi(i,je) enddo elseif (bcy_hi .eq. PERIODIC) then do i = is,ie phi(i,je+1) = phi(i,js) enddo endif if (bcx_lo .eq. OUTLET) then do j = js,je phi(is-1,j) = -phi(is,j) enddo elseif (bcx_lo .eq. INLET .or. bcx_lo .eq. WALL) then do j = js-1,je+1 phi(is-1,j) = phi(is,j) enddo elseif (bcx_lo .eq. PERIODIC) then do j = js,je phi(is-1,j) = phi(ie,j) enddo endif if (bcx_hi .eq. OUTLET) then do j = js,je phi(ie+1,j) = -phi(ie,j) enddo elseif (bcx_hi .eq. INLET .or. bcx_hi .eq. WALL) then do j = js-1,je+1 phi(ie+1,j) = phi(ie,j) enddo elseif (bcx_hi .eq. PERIODIC) then do j = js,je phi(ie+1,j) = phi(is,j) enddo endif return end c ************************************************************************* c ** RHSMAC ** c ** Compute the right-hand-side D(U) for the MAC projection c ************************************************************************* subroutine FORT_RHSMAC(uadv,vadv,divu_src,rhs, $ DIMS,hx,hy,r,rhalf,rhsnorm) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T uadv(lo_1 :hi_1+1,lo_2:hi_2 ) REAL_T vadv(lo_1 :hi_1 ,lo_2:hi_2+1) REAL_T divu_src(lo_1 :hi_1 ,lo_2:hi_2) REAL_T rhs(lo_1 :hi_1 ,lo_2:hi_2) REAL_T r(lo_1-1:hi_1+1) REAL_T rhalf(lo_1:hi_1+2) REAL_T hx REAL_T hy REAL_T rhsnorm c Local variables integer i,j rhsnorm = zero do j = lo_2,hi_2 do i = lo_1,hi_1 rhs(i,j) = (rhalf(i+1)*uadv(i+1,j) - $ rhalf(i )*uadv(i ,j))/hx + $ r(i )*(vadv(i,j+1) - vadv(i,j))/hy rhs(i,j) = rhs(i,j) - r(i)*divu_src(i,j) rhsnorm = max(rhsnorm,abs(rhs(i,j))/r(i)) enddo enddo return end c ************************************************************************* c ** COARSIGMA ** c ** Coarsen the edge-based sigma coefficients c ************************************************************************* subroutine FORT_COARSIGMA(sigmax,sigmay,sigmaxc,sigmayc,DIMS,CDIMS) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer loc_1, loc_2 integer hic_1, hic_2 REAL_T sigmax(lo_1 :hi_1 +1,lo_2 :hi_2 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2 +1) REAL_T sigmaxc(loc_1:hic_1+1,loc_2:hic_2 ) REAL_T sigmayc(loc_1:hic_1 ,loc_2:hic_2+1) c Local variables integer i,j,twoi,twoj do j = loc_2,hic_2 do i = loc_1,hic_1+1 twoi = 2*(i-loc_1)+lo_1 twoj = 2*(j-loc_2)+lo_2 sigmaxc(i,j) = half*(sigmax(twoi,twoj) + sigmax(twoi,twoj+1)) enddo enddo do j = loc_2,hic_2+1 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+lo_1 twoj = 2*(j-loc_2)+lo_2 sigmayc(i,j) = half*(sigmay(twoi,twoj) + sigmay(twoi+1,twoj)) enddo enddo return end c ************************************************************************* c ** RESTRICT ** c ** Conservatively average the residual c ************************************************************************* subroutine FORT_RESTRICT(res,resc,DIMS,CDIMS) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer loc_1, loc_2 integer hic_1, hic_2 REAL_T res(lo_1 :hi_1 ,lo_2 :hi_2) REAL_T resc(loc_1:hic_1,loc_2:hic_2) c Local variables integer i,j,twoi,twoj c ::: NOTE: dont need factor of r here for volume-weighting because c ::: what were calling the residual is really already r*residual do j = loc_2,hic_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+lo_1 twoj = 2*(j-loc_2)+lo_2 resc(i,j) = ((res(twoi ,twoj) + res(twoi ,twoj+1)) + $ (res(twoi+1,twoj) + res(twoi+1,twoj+1)))*fourth enddo enddo return end c ************************************************************************* c ** INTERPOLATE ** c ** Piecewise constant interpolation c ************************************************************************* subroutine FORT_INTERPOLATE(phi,deltac,DIMS,CDIMS) implicit none integer lo_1, lo_2 integer hi_1, hi_2 integer loc_1, loc_2 integer hic_1, hic_2 REAL_T phi(lo_1 -1:hi_1 +1,lo_2 -1:hi_2 +1) REAL_T deltac(loc_1-1:hic_1+1,loc_2-1:hic_2+1) c Local variables integer i,j,twoi,twoj do j = loc_2, hic_2 do i = loc_1, hic_1 twoi = 2*(i-loc_1)+lo_1 twoj = 2*(j-loc_2)+lo_2 phi(twoi ,twoj ) = phi(twoi ,twoj ) + deltac(i,j) phi(twoi+1,twoj ) = phi(twoi+1,twoj ) + deltac(i,j) phi(twoi ,twoj+1) = phi(twoi ,twoj+1) + deltac(i,j) phi(twoi+1,twoj+1) = phi(twoi+1,twoj+1) + deltac(i,j) enddo enddo return end c ************************************************************************* c ** SOLVEMAC ** c ** Conjugate gradient bottom-solver c ************************************************************************* subroutine FORT_SOLVEMAC(dest, dest0, source, sigmax, sigmay, sum, $ r, w, z, work, x, DIMS, hx, hy, $ bcx_lo, bcx_hi, bcy_lo, bcy_hi, norm, prob_norm) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T dest(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T dest0(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T source(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T sigmax(lo_1 :hi_1+1,lo_2 :hi_2 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2+1) REAL_T sum(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T r(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T w(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T z(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T work(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T x(lo_1-1:hi_1+1) REAL_T hx REAL_T hy integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi REAL_T norm REAL_T prob_norm c Local variables integer i,j,iter,is,ie,js,je REAL_T alpha, beta, rho, rhol REAL_T tol,tolfac REAL_T local_norm REAL_T hxsqinv REAL_T hysqinv tolfac = 1.0d-3 hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) is = lo_1 js = lo_2 ie = hi_1 je = hi_2 call bc(dest,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) do j = js-1,je+1 do i = is-1,ie+1 dest0(i,j) = dest(i,j) dest(i,j) = zero enddo enddo 10 do j = js,je do i = is,ie w(i,j) = $ ( sigmax(i+1,j)*dest0(i+1,j) + $ sigmax(i ,j)*dest0(i-1,j) )*hxsqinv + $ ( sigmay(i,j+1)*dest0(i,j+1) + $ sigmay(i,j )*dest0(i,j-1) )*hysqinv - $ ( (sigmax(i+1,j) + sigmax(i,j))*hxsqinv + $ (sigmay(i,j+1) + sigmay(i,j))*hysqinv )*dest0(i,j) enddo enddo rho = zero norm = zero do j = js, je do i = is, ie r(i,j) = source(i,j) - w(i,j) enddo enddo local_norm = zero do j = js, je do i = is, ie z(i,j) = r(i,j) rho = rho + z(i,j) * r(i,j) local_norm = max(local_norm,abs(r(i,j))) norm = max(norm ,abs(r(i,j)/x(i))) enddo enddo tol = Max(tolfac*local_norm,1.0d-15*prob_norm) if (norm .le. tol) return do j = js, je do i = is, ie work(i,j) = zero dest(i,j) = z(i,j) enddo enddo iter = 0 c write(6,1000) iter, norm/prob_norm 100 call bc(dest,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) do j = js,je do i = is,ie w(i,j) = $ ( sigmax(i+1,j)*dest(i+1,j) + $ sigmax(i,j)*dest(i-1,j) )*hxsqinv + $ ( sigmay(i,j+1)*dest(i,j+1) + $ sigmay(i,j)*dest(i,j-1) )*hysqinv - $ ( (sigmax(i+1,j) + sigmax(i,j))*hxsqinv + $ (sigmay(i,j+1) + sigmay(i,j))*hysqinv )*dest(i,j) enddo enddo alpha = zero do j = js, je do i = is, ie alpha = alpha + dest(i,j)*w(i,j) enddo enddo alpha = rho / alpha rhol = rho rho = zero norm = zero do j = js, je do i = is, ie work(i,j) = work(i,j) + alpha * dest(i,j) r(i,j) = r(i,j) - alpha * w(i,j) z(i,j) = r(i,j) rho = rho + z(i,j) * r(i,j) norm = max(norm,abs(r(i,j)/x(i))) enddo enddo iter = iter+1 c write(6,1000) iter, norm/prob_norm if (norm .le. tol) then do j = js, je do i = is, ie dest(i,j) = work(i,j) + dest0(i,j) enddo enddo call bc(dest,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi) else if (iter .ge. 100 .or. norm .ge. 100.d0*local_norm) then tolfac = 10.d0 * tolfac iter = 1 do j = js, je do i = is, ie dest(i,j) = zero enddo enddo goto 10 else beta = rho / rhol do j = js, je do i = is, ie dest(i,j) = z(i,j) + beta * dest(i,j) enddo enddo goto 100 endif c call flush(6) 1000 format('Res/Res0 in solve: ',i4,2x,e12.5) c call flush(6) return end c ************************************************************************* c ** MKSUMMAC ** c ** Pre-compute the sum of coefficients for the conjugate gradient solver c ************************************************************************* subroutine FORT_MKSUMMAC(sigmax,sigmay,sum,DIMS,hx,hy, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi) implicit none integer lo_1, lo_2 integer hi_1, hi_2 REAL_T sigmax(lo_1 :hi_1+1,lo_2 :hi_2 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2+1) REAL_T sum(lo_1 :hi_1 ,lo_2 :hi_2 ) REAL_T hx REAL_T hy integer bcx_lo, bcx_hi integer bcy_lo, bcy_hi c Local variables REAL_T hxsqinv REAL_T hysqinv integer i,j hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) do j = lo_2,hi_2 do i = lo_1,hi_1 sum(i,j) = (sigmax(i+1,j) + sigmax(i,j))*hxsqinv + $ (sigmay(i,j+1) + sigmay(i,j))*hysqinv sum(i,j) = -fourth*sum(i,j) enddo enddo return end c ************************************************************************* c ** TRIDIAG ** c ** Do a tridiagonal solve c ************************************************************************* subroutine tridiag(a,b,c,r,u,n) integer n integer nmax REAL_T a(n) REAL_T b(n) REAL_T c(n) REAL_T r(n) REAL_T u(n) parameter (nmax = 4098) integer j REAL_T bet REAL_T gam(nmax) if (b(1) .eq. 0) print *,'CANT HAVE B(1) = ZERO' bet = b(1) u(1) = r(1)/bet do j = 2,n gam(j) = c(j-1)/bet bet = b(j) - a(j)*gam(j) if (bet .eq. 0) then print *,'TRIDIAG FAILED ' stop endif u(j) = (r(j)-a(j)*u(j-1))/bet enddo do j = n-1,1,-1 u(j) = u(j) - gam(j+1)*u(j+1) enddo return end ccseapps-2.5/CCSEApps/varden2d/graphtool/0000755000175000017500000000000011634153073021363 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/varden2d/graphtool/Make.package0000644000175000017500000000051611634153073023557 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.4 1998/11/05 20:52:59 propp Exp $ # GRAPHTOOL_BASE=EXE ifeq ($(LBASE),graphtool) GRAPHTOOL_BASE=LIB endif C$(GRAPHTOOL_BASE)_sources += GraphTool.cpp IFrame.cpp PSfile.cpp \ XWindow.cpp C$(GRAPHTOOL_BASE)_headers += GraphTool.H IFrame.H PSfile.H XWindow.H C$(GRAPHTOOL_BASE)_headers += XWinExterns.H ccseapps-2.5/CCSEApps/varden2d/graphtool/GNUmakefile0000644000175000017500000000501211634153073023433 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.11 1999/05/24 18:11:46 car Exp $ # PRECISION = DOUBLE PROFILE = FALSE DEBUG = FALSE DIM = 2 COMP = KCC #COMP=g++ USE_MPI = FALSE # # The base name of the library we're building. # LBASE = graphtool # # Where libraries and include files will be installed. # PBOXLIB_HOME = ../.. include ../../mk/Make.defs ./Make.package INCLUDE_LOCATIONS += . ../../pBoxLib_2 INSTALL_ROOT = . ifeq ($(KCC_VERSION),3.3) CXXFLAGS += --one_instantiation_per_object endif ifeq ($(COMP),KCC) ifeq ($(KCC_VERSION),3.3) CXXFLAGS+= --diag_suppress 837 endif endif all: $(optionsLib) # # `install' does NOT try to build and install the HTML stuff. # doc++ isn't widely distributed enough to assume that. # For now you must invoke `install_html' separately. # install: all include ../../mk/Make.rules # # Temp stuff for doing html docs. # _docHeaders := $(sort $(wildcard *.H)) _htmlDir := html _installDir = $(instHtmlDir)/boxlib # # This unconditionally installs stuff from ./html into _installDir. # install_html: html -if [ ! -d $(_installDir) ]; then \ mkdir -p $(_installDir); \ chmod 755 $(_installDir); \ fi -cd $(_installDir); $(RM) * if [ -d $(_htmlDir) ]; then \ cd $(_htmlDir); \ for f in *; do \ $(INSTALL_DATA) $$f $(_installDir); \ done; \ fi # # This will make the HTML files in the directory html provided # any of the relevant .H files have changed more recently than the # directory itself. # html: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ $(RM) -r $(_htmlDir); \ mkdir -p $(_htmlDir); \ doc++ -f -j -B Banner.html -d $(_htmlDir) $(_docHeaders); \ fi BoxLib.tex: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ doc++ -f -t -j -o BoxLib.tex -ep docxx_squish $(_docHeaders); \ sed '/[\]usepackage[{]docxx[}]/d' < BoxLib.tex > .junk; \ mv .junk BoxLib.tex; \ fi BoxLib.dvi: BoxLib.tex latex BoxLib.tex; latex BoxLib.tex BoxLib.ps: BoxLib.dvi dvips BoxLib.dvi -o BoxLib.ps # # Install the PostScript file into ./ps # install_ps: BoxLib.ps -if [ ! -d $(INSTALL_ROOT)/ps ]; then \ mkdir -p $(INSTALL_ROOT)/ps; \ chmod 755 $(INSTALL_ROOT)/ps; \ fi $(INSTALL_DATA) BoxLib.ps $(INSTALL_ROOT)/ps ccseapps-2.5/CCSEApps/varden2d/graphtool/IFrame.H0000644000175000017500000000351311634153073022641 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _IFRAME_H_ #define _IFRAME_H_ "@(#)IFrame.H 1.2\t10/5/92" #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) #include "Box.H" // describes linear transformation between integer coords and real coords // in 2d. useful for IGraphTool class IFrame { private: int ilo,ihi,jlo,jhi; double xlo,xhi,ylo,yhi; double delx,dely; public: IFrame(){} IFrame(const Box&,double xmin,double xmax, double ymin, double ymax); ~IFrame(){} IntVect toIV( const double* coord) const; double toX(const IntVect) const; double toY(const IntVect) const; }; #endif #endif ccseapps-2.5/CCSEApps/varden2d/graphtool/GraphTool.cpp0000644000175000017500000006407611634153073024003 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include "GraphTool.H" #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& GraphTool::setFrame(const IFrame &fr) { frame = fr; return *this; } #endif GTDevice GraphTool::getDevice() const { return dev; } #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) IFrame GraphTool::getFrame() const { return frame; } #endif #ifdef _COMPLEX_IS_OK_ GraphTool& GraphTool::movePen(const complex &z) { return movePen(real(z),imag(z)); } #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& GraphTool::movePen(const IntVect &v) { return movePen(frame.toX(v),frame.toY(v)); } #endif #ifdef _COMPLEX_IS_OK_ GraphTool& GraphTool::drawLine(const complex &z) { return drawLine(real(z),imag(z)); } #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& GraphTool::drawLine(const IntVect &v) { return drawLine(frame.toX(v),frame.toY(v)); } #endif #ifdef _COMPLEX_IS_OK_ GraphTool& GraphTool::drawBox(const complex &zlo, const complex &zhi) { return drawBox(real(zlo),imag(zlo),real(zhi),imag(zhi)); } #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& GraphTool::drawBox(const Box &b) { double x1 = frame.toX(b.smallEnd()); double x2 = frame.toX(b.bigEnd()); double y1 = frame.toY(b.smallEnd()); double y2 = frame.toY(b.bigEnd()); return drawBox(x1,y1,x2,y2); } #endif #ifdef _COMPLEX_IS_OK_ GraphTool& GraphTool::putString(const complex &z, const char *str) { return putString(real(z),imag(z),str); } #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& GraphTool::putString(const IntVect &v, const char *str) { return putString(frame.toX(v),frame.toY(v),str); } #endif #define XTOINT(x) int( width* ((x-xlo)/(xhi-xlo)) ) #define YTOINT(y) int( height*((y-ylo)/(yhi-ylo)) ) #define PS_XSCALE(x) ((x)-xlo)/(xhi-xlo) #define PS_YSCALE(y) ((y)-ylo)/(yhi-ylo) // private function to init a GraphTool void GraphTool::initGT(int wid, int high, double x1, double y1, double x2, double y2, const char *str, GTDevice device) { name = new char[strlen(str) + 1]; strcpy(name,str); dev = device; if ( (x1 >= x2) || (y1 >= y2) ) { std::cerr << "GraphTool: invalid domain" << std::endl; abort(); }; xcL = xlo = x1; ycL = ylo = y1; xcU = xhi = x2; ycU = yhi = y2; x0 = xlo; y0 = ylo; was_out = 0; width = wid; height = high; #if (BL_SPACEDIM == 2) IntVect v_lo(0,0); IntVect v_hi(wid-1,high-1); #elif (BL_SPACEDIM == 3) IntVect v_lo(0,0,0); IntVect v_hi(wid-1,high-1,0); #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) Box bx(v_lo,v_hi); IFrame fr(bx,xlo,xhi,ylo,yhi); frame = fr; #endif win = NULL; ps = NULL; if ((dev&xWinDevice) == xWinDevice) { win = new XWindow(width,height,str); }; if ((dev&psDevice) == psDevice) { ps = new PSfile(width,height,str); }; } #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool::GraphTool(const Box &bx, const char *str, int wid, int high, GTDevice device) { const int* lo_d = bx.smallEnd().getVect(); const int* hi_d = bx.bigEnd().getVect(); double x1 = (double) lo_d[0]; double x2 = (double) hi_d[0]; double y1 = (double) lo_d[1]; double y2 = (double) hi_d[1]; initGT(wid,high,x1,y1,x2,y2,str,device); } #endif GraphTool::GraphTool(double x1, double y1, double x2, double y2, const char *str, int maxwinsize, GTDevice device) { double maxlen = std::max(x2-x1,y2-y1); int wid = int( maxwinsize*(x2-x1)/maxlen ); int high = int( maxwinsize*(y2-y1)/maxlen ); initGT(wid,high,x1,y1,x2,y2,str,device); } GraphTool::GraphTool(double x1, double y1, double x2, double y2, const char *str, int wid, int high, GTDevice device) { initGT(wid,high,x1,y1,x2,y2,str,device); } GraphTool::GraphTool(const double *lo_pt, const double *hi_pt, const char *str, int wid, int high, GTDevice device) { initGT(wid,high,lo_pt[0],lo_pt[1],hi_pt[0],hi_pt[1],str,device); } #ifdef _COMPLEX_IS_OK_ GraphTool::GraphTool(const complex &zlo, const complex &zhi, const char *str, int wid, int high, GTDevice device) { initGT(wid,high,real(zlo),imag(zlo),real(zhi),imag(zhi),str,device); } #endif GraphTool::GraphTool(const double *lo_pt, const double *hi_pt, const char *str, int maxwinsize, GTDevice device) { double x1 = lo_pt[0]; double x2 = hi_pt[0]; double y1 = lo_pt[1]; double y2 = hi_pt[1]; double maxlen = std::max(x2-x1,y2-y1); int wid = int( maxwinsize*(x2-x1)/maxlen ); int high = int( maxwinsize*(y2-y1)/maxlen ); initGT(wid,high,x1,y1,x2,y2,str,device); } #ifdef _COMPLEX_IS_OK_ GraphTool::GraphTool(const complex &zlo, const complex &zhi, const char *str, int maxwinsize, GTDevice device) { double x1 = real(zlo); double x2 = real(zhi); double y1 = imag(zlo); double y2 = imag(zhi); double maxlen = Max(x2-x1,y2-y1); int wid = int( maxwinsize*(x2-x1)/maxlen ); int high = int( maxwinsize*(y2-y1)/maxlen ); initGT(wid,high,x1,y1,x2,y2,str,device); } #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool::GraphTool(const Box &bx, const char *str, int maxwinsize, GTDevice device) { const int* lo_d = bx.smallEnd().getVect(); const int* hi_d = bx.bigEnd().getVect(); double x1 = (double) lo_d[0]; double x2 = (double) hi_d[0]; double y1 = (double) lo_d[1]; double y2 = (double) hi_d[1]; double maxlen = std::max(x2-x1,y2-y1); int wid = int( maxwinsize*(x2-x1)/maxlen ); int high = int( maxwinsize*(y2-y1)/maxlen ); initGT(wid,high,x1,y1,x2,y2,str,device); IFrame dummy(bx,x1,x2,y1,y2); frame = dummy; } #endif GraphTool::~GraphTool() { delete name; delete win; delete ps; } GraphTool& GraphTool::rmDevice(GTDevice device) { if (dev & device) dev ^= device; return *this; } GraphTool& GraphTool::setDevice(GTDevice device) { dev = device; if ( ((dev&xWinDevice) == xWinDevice) && (win == NULL) ) { win = new XWindow(width,height,name); }; if ( ((dev&psDevice) == psDevice) && (ps == NULL) ) { ps = new PSfile(width,height,name); }; return *this; } GraphTool& GraphTool::addDevice(GTDevice device) { dev |= device; if ( ((dev&xWinDevice) == xWinDevice) && (win == NULL) ) { win = new XWindow(width,height,name); }; if ( ((dev&psDevice) == psDevice) && (ps == NULL) ) { ps = new PSfile(width,height,name); }; return *this; } GraphTool& GraphTool::newPage() { if ((dev&xWinDevice) == xWinDevice) { win->newPage(); }; if ((dev&psDevice) == psDevice) { ps->newPage(); }; return *this; } GraphTool& GraphTool::movePen(double x, double y) { int out = ( (xxcU) || (yycU) ); x0 = x; y0 = y; was_out = out; if (!out) { if ((dev&xWinDevice) == xWinDevice) { int xi = XTOINT(x); int yi = YTOINT(y); win->movePen(xi,yi); }; if ((dev&psDevice) == psDevice) { ps->movePen(PS_XSCALE(x),PS_YSCALE(y)); }; }; return *this; } #ifdef _COMPLEX_IS_OK_ GraphTool& GraphTool::setClipRegion(const complex &zlo, const complex &zhi) { return setClipRegion(real(zlo),imag(zlo),real(zhi),imag(zhi)); } #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& GraphTool::setClipRegion(const Box &b) { double x1 = frame.toX(b.smallEnd()); double x2 = frame.toX(b.bigEnd()); double y1 = frame.toY(b.smallEnd()); double y2 = frame.toY(b.bigEnd()); return setClipRegion(x1,y1,x2,y2); } #endif GraphTool& GraphTool::drawLine(double x, double y, int lev) { int out = ( (xxcU) || (yycU) ); if ( (!out) && (!was_out) ) { // old point and new point are in clip region if ((dev&xWinDevice) == xWinDevice) { int xi = XTOINT(x); int yi = YTOINT(y); win->drawLine(xi,yi); }; if ((dev&psDevice) == psDevice) { ps->drawLine(PS_XSCALE(x),PS_YSCALE(y), lev); }; } else if ((!was_out) && out) { // old point was in range, new point out of range // find exit point and only draw to there double c = clipRatio(x0,y0,x,y); double xc = x0 + c*(x-x0); double yc = y0 + c*(y-y0); if ((dev&xWinDevice) == xWinDevice) { int xi = XTOINT(xc); int yi = YTOINT(yc); win->drawLine(xi,yi); }; if ((dev&psDevice) == psDevice) { ps->drawLine(PS_XSCALE(xc),PS_YSCALE(yc), lev); }; } else if (was_out && (!out)) { // old point was out of range, new point is in range // find entry point and only draw from there double c = clipRatio(x,y,x0,y0); double xc = x + c*(x0-x); double yc = y + c*(y0-y); if ((dev&xWinDevice) == xWinDevice) { int xi = XTOINT(xc); int yi = YTOINT(yc); win->movePen(xi,yi); xi = XTOINT(x); yi = YTOINT(y); win->drawLine(xi,yi); }; if ((dev&psDevice) == psDevice) { ps->movePen(PS_XSCALE(xc),PS_YSCALE(yc)); ps->drawLine(PS_XSCALE(x),PS_YSCALE(y), lev); }; } else { // both points outside range, does line intersect // box at all? if so, draw on intersection }; x0 = x; y0 = y; was_out = out; return *this; } GraphTool& GraphTool::drawBox(double x1, double y1, double x2, double y2, int lev) { movePen(x1,y1); drawLine(x2,y1,lev); drawLine(x2,y2,lev); drawLine(x1,y2,lev); drawLine(x1,y1,lev); return *this; } GraphTool& GraphTool::setClipRegion(double x1, double y1, double x2, double y2) { if ( (x1 >= x2) || (y1 >= y2) ) { std::cout << "Invalid Clip region, ignoring..." << std::endl; } else { xcL = x1; xcU = x2; ycL = y1; ycU = y2; }; return *this; } GraphTool& GraphTool::setLineWidth(int lw) { if ((dev&xWinDevice) == xWinDevice) { win->setLineWidth(lw); }; if ((dev&psDevice) == psDevice) { ps->setLineWidth(lw); }; return *this; } GraphTool& GraphTool::setFont(char *font_name) { if ((dev&xWinDevice) == xWinDevice) { win->setFont(font_name); }; if ((dev&psDevice) == psDevice) { }; return *this; } GraphTool& GraphTool::putString(double x, double y, const char *str) { if ((dev&xWinDevice) == xWinDevice) { int xi = XTOINT(x); int yi = YTOINT(y); win->putString(xi,yi,str); }; if ((dev&psDevice) == psDevice) { }; return *this; } GraphTool& GraphTool::setfgColor(const char* color) { if ((dev&xWinDevice) == xWinDevice) { win->setfgColor(color); }; if ((dev&psDevice) == psDevice) { }; return *this; } GraphTool& GraphTool::setbgColor(const char* color) { if ((dev&xWinDevice) == xWinDevice) { win->setbgColor(color); }; if ((dev&psDevice) == psDevice) { }; return *this; } GraphTool& GraphTool::setfgColor(int color) { if ((dev&xWinDevice) == xWinDevice) { win->setfgColor(color); }; if ((dev&psDevice) == psDevice) { }; return *this; } GraphTool& GraphTool::setbgColor(int color) { if ((dev&xWinDevice) == xWinDevice) { win->setbgColor(color); }; if ((dev&psDevice) == psDevice) { }; return *this; } GraphTool& GraphTool::defineCmap(unsigned short *red, unsigned short *green, unsigned short *blue, int num) { if ((dev&xWinDevice) == xWinDevice) { win->defineCmap(red, green, blue, num); }; if ((dev&psDevice) == psDevice) { }; return *this; } #ifdef _COMPLEX_IS_OK_ int GraphTool::getMouse(complex &z) const { double x,y; int but = getMouse(x,y); complex c(x,y); z = c; return but; } #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) int GraphTool::getMouse(IntVect &v) const { double x[2]; int but = getMouse(x[0],x[1]); v = frame.toIV(x); return but; } #endif int GraphTool::getMouse(double &x, double &y) const { int button = -1; if ((dev&xWinDevice) == xWinDevice) { int i,j; button = win->getMouse(i,j); x = xlo + (xhi-xlo)*( double(i)/double(width) ); y = ylo + (yhi-ylo)*( double(j)/double(height) ); }; return button; } // contour plotting int GraphTool::contour(const double *data, double value, int has_mask, const int *mask, int nx, int /* ny */, int mx, int my, double xlft, double ybot, double xrgt, double ytop) { // data = of data to be contoured // value = value to contour // has_mask = true if mask array available // mask = array of mask values. will not contour in masked off cells // nx = dimension of arrays in X direction // ny = dimension of arrays in Y direction // mx = number of cells in X direction to plot // my = number of cells in Y direction to plot // xlft = position of left edge of grid in domain // xrgt = position of right edge of grid in domain // ybot = position of bottom edge of grid in domain // ytop = position of top edge of grid in domain #define VAL(i,j) data[(i)+(j)*nx] #define MSK(i,j) mask[(i)+(j)*nx] #define BTWN(a,b,c) ( ((a<=b)&&(b<=c)) || ((a>=b)&&(b>=c)) ) // double dx = (xrgt-xlft)/(nx-1); // double dy = (ytop-ybot)/(ny-1); double dx = (xrgt-xlft)/(mx-1); double dy = (ytop-ybot)/(my-1); bool lft, rgt, bot, top; // does contour line intersect this side? double xl, yl; // where contour line intersects lft side double xr, yr; // where contour line intersects rgt side double xb, yb; // where contour line intersects bot side double xt, yt; // where contour line intersects top side bool failure_status = false; for (int j = 0; j < my-1; j++) for (int i = 0; i < mx-1; i++) { if (has_mask) { int m = MSK(i,j)+MSK(i+1,j)+MSK(i+1,j+1)+MSK(i,j+1); if (m > 0) continue; }; double lb = VAL(i,j); // left bottom value double lt = VAL(i,j+1); // left top value double rb = VAL(i+1,j); // right bottom value double rt = VAL(i+1,j+1); // right top value xl = xlft + dx*(i); xr = xl + dx; yb = ybot + dy*(j); yt = yb + dy; // figure out where things intersect the cell if (lft = BTWN(lb,value,lt)) { if (lb != lt) { yl = yb + dy*(value-lb)/(lt-lb); } else { yl = yb; failure_status = true; }; }; if (rgt = BTWN(rb,value,rt)) { if (rb != rt) { yr = yb + dy*(value-rb)/(rt-rb); } else { yr = yb; failure_status = true; }; }; if (bot = BTWN(lb,value,rb)) { if (lb != rb) { xb = xl + dx*(value-lb)/(rb-lb); } else { xb = xr; failure_status = true; }; }; if (top = BTWN(lt,value,rt)) { if (lt != rt) { xt = xl + dx*(value-lt)/(rt-lt); } else { xt = xr; failure_status = true; }; }; // finally, draw contour line if (lft && rgt && bot && top) { // intersects all sides, generate saddle point movePen(xl,yl); drawLine(xr,yr); movePen(xt,yt); drawLine(xb,yb); } else if (top && bot) { // only intersects top and bottom sides movePen(xt,yt); drawLine(xb,yb); } else if (lft) { movePen(xl,yl); if (rgt) { drawLine(xr,yr); } else if (top) { drawLine(xt,yt); } else { drawLine(xb,yb); }; } else if (rgt) { movePen(xr,yr); if (top) { drawLine(xt,yt); } else { drawLine(xb,yb); }; }; }; // for I,J return failure_status; #undef VAL #undef MSK #undef BTWN } #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) // contour plotting int GraphTool::contour(const double *data, double value, int has_mask, const int *mask, const Box &dims, const Box &subrange, double xlft, double ybot, double xrgt, double ytop) { // same as above except for: // dims = dimension of arrays (ilo,ihi,jlo,jhi) // subrange = subrange of array to plot (irlo,irhi,jrlo,jrhi) const int *lo_n = dims.smallEnd().getVect(); const int *hi_n = dims.bigEnd().getVect(); const int ilo = lo_n[0]; const int ihi = hi_n[0]; const int jlo = lo_n[1]; const int jhi = hi_n[1]; const int nx = ihi - ilo + 1; const int ny = jhi - jlo + 1; const int *lo_r = subrange.smallEnd().getVect(); const int *hi_r = subrange.bigEnd().getVect(); const int irlo = lo_r[0]; const int irhi = hi_r[0]; const int jrlo = lo_r[1]; const int jrhi = hi_r[1]; const int mx = irhi - irlo + 1; const int my = jrhi - jrlo + 1; const double *dstart = data + (irlo-ilo) + nx*(jrlo-jlo); const int *mstart = mask + (irlo-ilo) + nx*(jrlo-jlo); return contour(dstart,value,has_mask,mstart,nx,ny,mx,my, xlft,ybot,xrgt,ytop); } #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) int GraphTool::contour(const double* data, double value, int has_mask, const int *mask, const Box &dims, const Box &subrange, const Box &position) { const int *lo_n = dims.smallEnd().getVect(); const int *hi_n = dims.bigEnd().getVect(); const int ilo = lo_n[0]; const int ihi = hi_n[0]; const int jlo = lo_n[1]; const int jhi = hi_n[1]; const int nx = ihi - ilo + 1; const int ny = jhi - jlo + 1; const int *lo_r = subrange.smallEnd().getVect(); const int *hi_r = subrange.bigEnd().getVect(); const int irlo = lo_r[0]; const int irhi = hi_r[0]; const int jrlo = lo_r[1]; const int jrhi = hi_r[1]; const int mx = irhi - irlo + 1; const int my = jrhi - jrlo + 1; double xlft = frame.toX(position.smallEnd()); double xrgt = frame.toX(position.bigEnd()); double ybot = frame.toY(position.smallEnd()); double ytop = frame.toY(position.bigEnd()); const double *dstart = data + (irlo-ilo) + nx*(jrlo-jlo); const int *mstart = mask + (irlo-ilo) + nx*(jrlo-jlo); return contour(dstart,value,has_mask,mstart,nx,ny,mx,my, xlft,ybot,xrgt,ytop); } #endif // contour plotting. SINGLE PRECISION int GraphTool::contour(const float *data, double value, int has_mask, const int *mask, int nx, int ny, int mx, int my, double xlft, double ybot, double xrgt, double ytop) { // data = of data to be contoured // value = value to contour // has_mask = true if mask array available // mask = array of mask values. will not contour in masked off cells // nx = dimension of arrays in X direction // ny = dimension of arrays in Y direction // mx = number of cells in X direction to plot // my = number of cells in Y direction to plot // xlft = position of left edge of grid in domain // xrgt = position of right edge of grid in domain // ybot = position of bottom edge of grid in domain // ytop = position of top edge of grid in domain #define VAL(i,j) data[(i)+(j)*nx] #define MSK(i,j) mask[(i)+(j)*nx] #define BTWN(a,b,c) ( ((a<=b)&&(b<=c)) || ((a>=b)&&(b>=c)) ) double dx = (xrgt-xlft)/(nx-1); double dy = (ytop-ybot)/(ny-1); bool lft, rgt, bot, top; // does contour line intersect this side? double xl, yl; // where contour line intersects lft side double xr, yr; // where contour line intersects rgt side double xb, yb; // where contour line intersects bot side double xt, yt; // where contour line intersects top side bool failure_status = false; for (int j = 0; j < my-1; j++) for (int i = 0; i < mx-1; i++) { if (has_mask) { int m = MSK(i,j)+MSK(i+1,j)+MSK(i+1,j+1)+MSK(i,j+1); if (m > 0) continue; }; double lb = VAL(i,j); // left bottom value double lt = VAL(i,j+1); // left top value double rb = VAL(i+1,j); // right bottom value double rt = VAL(i+1,j+1); // right top value xl = xlft + dx*(i); xr = xl + dx; yb = ybot + dy*(j); yt = yb + dy; // figure out where things intersect the cell if (lft = BTWN(lb,value,lt)) { if (lb != lt) { yl = yb + dy*(value-lb)/(lt-lb); } else { yl = yb; failure_status = true; }; }; if (rgt = BTWN(rb,value,rt)) { if (rb != rt) { yr = yb + dy*(value-rb)/(rt-rb); } else { yr = yb; failure_status = true; }; }; if (bot = BTWN(lb,value,rb)) { if (lb != rb) { xb = xl + dx*(value-lb)/(rb-lb); } else { xb = xr; failure_status = true; }; }; if (top = BTWN(lt,value,rt)) { if (lt != rt) { xt = xl + dx*(value-lt)/(rt-lt); } else { xt = xr; failure_status = true; }; }; // finally, draw contour line if (lft && rgt && bot && top) { // intersects all sides, generate saddle point movePen(xl,yl); drawLine(xr,yr); movePen(xt,yt); drawLine(xb,yb); } else if (top && bot) { // only intersects top and bottom sides movePen(xt,yt); drawLine(xb,yb); } else if (lft) { movePen(xl,yl); if (rgt) { drawLine(xr,yr); } else if (top) { drawLine(xt,yt); } else { drawLine(xb,yb); }; } else if (rgt) { movePen(xr,yr); if (top) { drawLine(xt,yt); } else { drawLine(xb,yb); }; }; }; // for I,J return failure_status; #undef VAL #undef MSK #undef BTWN } #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) // contour plotting int GraphTool::contour(const float *data, double value, int has_mask, const int *mask, const Box &dims, const Box &subrange, double xlft, double ybot, double xrgt, double ytop) { // same as above except for: // dims = dimension of arrays (ilo,ihi,jlo,jhi) // subrange = subrange of array to plot (irlo,irhi,jrlo,jrhi) const int *lo_n = dims.smallEnd().getVect(); const int *hi_n = dims.bigEnd().getVect(); const int ilo = lo_n[0]; const int ihi = hi_n[0]; const int jlo = lo_n[1]; const int jhi = hi_n[1]; const int nx = ihi - ilo + 1; const int ny = jhi - jlo + 1; const int *lo_r = subrange.smallEnd().getVect(); const int *hi_r = subrange.bigEnd().getVect(); const int irlo = lo_r[0]; const int irhi = hi_r[0]; const int jrlo = lo_r[1]; const int jrhi = hi_r[1]; const int mx = irhi - irlo + 1; const int my = jrhi - jrlo + 1; const float *dstart = data + (irlo-ilo) + nx*(jrlo-jlo); const int *mstart = mask + (irlo-ilo) + nx*(jrlo-jlo); return contour(dstart,value,has_mask,mstart,nx,ny,mx,my, xlft,ybot,xrgt,ytop); } #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) int GraphTool::contour(const float* data, double value, int has_mask, const int *mask, const Box &dims, const Box &subrange, const Box &position) { const int *lo_n = dims.smallEnd().getVect(); const int *hi_n = dims.bigEnd().getVect(); const int ilo = lo_n[0]; const int ihi = hi_n[0]; const int jlo = lo_n[1]; const int jhi = hi_n[1]; const int nx = ihi - ilo + 1; const int ny = jhi - jlo + 1; const int *lo_r = subrange.smallEnd().getVect(); const int *hi_r = subrange.bigEnd().getVect(); const int irlo = lo_r[0]; const int irhi = hi_r[0]; const int jrlo = lo_r[1]; const int jrhi = hi_r[1]; const int mx = irhi - irlo + 1; const int my = jrhi - jrlo + 1; double xlft = frame.toX(position.smallEnd()); double xrgt = frame.toX(position.bigEnd()); double ybot = frame.toY(position.smallEnd()); double ytop = frame.toY(position.bigEnd()); const float *dstart = data + (irlo-ilo) + nx*(jrlo-jlo); const int *mstart = mask + (irlo-ilo) + nx*(jrlo-jlo); return contour(dstart,value,has_mask,mstart,nx,ny,mx,my, xlft,ybot,xrgt,ytop); } #endif // Private function: Determines fraction of distance from // (x1,y1) to (x2,y2) at which boundary is intersected double GraphTool::clipRatio(double x1, double y1, double x2, double y2) { double r = 1.0; if (x2xcU) r = std::min(r,(xcU-x1)/(x2-x1)); if (y2>ycU) r = std::min(r,(ycU-y1)/(y2-y1)); return 0.9999*r; } #undef XTOINT #undef YTOINT #undef PS_XSCALE #undef PS_YSCALE ccseapps-2.5/CCSEApps/varden2d/graphtool/XWindow.H0000644000175000017500000000614111634153073023075 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _XWindow_H_ #define _XWindow_H_ "@(#)XWindow.H 1.2\t10/5/92" #include "XWinExterns.H" const long maxIntensity = 65535; class XWindow { public: XWindow(int,int,const char*,int iscale = 1); ~XWindow(); void newPage(); // clear screen void movePen(int x, int y); // move current location void drawLine(int x, int y); // draw line from current location to this point // set current location to this point void drawBox(int x1, int y1, int x2, int y2); // draw the given rectangle int getMouse(int&, int&); // return the button number and position of mouse void setLineWidth(int lw); // change the linewidth void setFont(char*); // change the current font void putString(int x, int y, const char *str); // write a character string at the given location void setfgColor(const char*); // set the foreground color to the named color void setbgColor(const char*); // set the background color to the named color void setfgColor(int); // set the foreground color to this color table entry void setbgColor(int); // set the background color to this color table entry void defineCmap(unsigned short *red, unsigned short *green, unsigned short *blue, int num); // add these colors to the current color map void flush(); // flus the XWindow buffer private: Window win; Display *display; GC gc; XFontStruct *the_font; int screen; int width, height, scale; char *name; int x0, y0; int nplanes; Colormap cmap; unsigned long *cmap_colors; int num_cmap_colors; }; #endif ccseapps-2.5/CCSEApps/varden2d/graphtool/PSfile.cpp0000644000175000017500000001015611634153073023254 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include "PSfile.H" void PSfile::flush() {file << std::endl; } // this is a width of a linewidth=1 line in points static const double WIDTH = 0.24; // this is the X dimension of units of WIDTH points static const int FACTOR = 3196; // these margins place the entire image within the printable // region for the laser writer. static const int XMARGIN = 52; static const int YMARGIN = 76; #define DRAWPATH if (npts>0) {file << "S\n";}; npts = 0; PSfile::PSfile(int wid, int high, const char *name) { // create postscript file filename = new char[strlen(name) + 5]; strcpy(filename,name); strcat(filename,".ps"); file.open(filename,std::ios::out); if (!file) { std::cerr << "cant open postscript file: " << filename << std::endl; abort(); }; // init scaling factors double dmax = double( std::max(wid,high) ); double xlen = double(wid)/dmax; double ylen = double(high)/dmax; xfactor = int( xlen * FACTOR ); yfactor = int( ylen * FACTOR ); xcur = ycur = 0; npts = 0; // write out header file << "%!PS\n"; file << "% " << wid << " " << high << '\n'; file << WIDTH << ' ' << WIDTH << " scale\n"; file << "-90 rotate\n"; file << -FACTOR-XMARGIN << ' ' << YMARGIN << " translate\n"; file << "1 setlinecap\n"; file << "1 setlinejoin\n"; file << "/M {moveto} def\n"; file << "/L {lineto} def\n"; file << "/S {stroke} def\n"; file << std::endl; } PSfile::~PSfile() { DRAWPATH; file << "showpage\n"; file << std::endl; file.close(); delete filename; } void PSfile::newPage() { DRAWPATH; file << "copypage\n"; file << "erasepage\n"; } void PSfile::movePen(double x, double y) { DRAWPATH; xcur = int( x*xfactor ); ycur = int( y*yfactor ); npts++; } void PSfile::drawLine(double x, double y, int lev) { if (npts == 1) { file << xcur << ' ' << ycur << " M\n"; }; xcur = int( x*xfactor ); ycur = int( y*yfactor ); if (npts > 0) { file << xcur << ' ' << ycur << " L\n"; if(lev == 0) { file << "[]" << " 0 setdash " << "\n"; } else { // file << "[" << 9*(4-lev) << "]" << " 0 setdash " << "\n"; if(lev == 1) { file << "[" << 2*(3-lev) << " " << 5*(3-lev) << "]" << " 0 setdash " << "\n"; } else { if(lev == 2) { file << "[" << 1*(3-lev) << " " << 5*(3-lev) << "]" << " 0 setdash " << "\n"; } else { std::cout << " drawLine only handles 2 levels of refinement... " << " You lose... " << "\n"; exit(0); } } } } else { file << xcur << ' ' << ycur << " M\n"; }; npts++; } void PSfile::setLineWidth(int lw) { if (npts > 0) { DRAWPATH; npts = 1; }; file << lw << " setlinewidth\n"; } #undef DRAWPATH ccseapps-2.5/CCSEApps/varden2d/graphtool/IFrame.cpp0000644000175000017500000000434411634153073023237 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) #include "IFrame.H" #include IFrame::IFrame(const Box& box, double xmin,double xmax, double ymin, double ymax) : xlo(xmin),xhi(xmax),ylo(ymin),yhi(ymax) { ilo = box.smallEnd()[0]; jlo = box.smallEnd()[1]; ihi = box.bigEnd()[0]; jhi = box.bigEnd()[1]; if( (ihi-ilo)*(jhi-jlo) == 0 ) BoxLib::Error("IFrame():zero width frame"); delx = (xmax-xmin)/(ihi-ilo); dely = (ymax-ymin)/(jhi-jlo); } IntVect IFrame::toIV( const double* coord ) const { double x,y; int i,j; x = (coord[0]-xlo)/delx; if( x > 0 ) i = int(x+0.5)+ilo; else i = int(x-0.5)+ilo; y = (coord[1]-ylo)/dely; if( y > 0 ) j = int(y+0.5)+jlo; else j = int(y-0.5)+jlo; #if (BL_SPACEDIM==2) return IntVect(i,j); #elif (BL_SPACEDIM == 3) int k=0; return IntVect(i,j,k); #endif } double IFrame::toX(const IntVect p ) const { return xlo+(p[0]-ilo)*delx; } double IFrame::toY(const IntVect p ) const { return ylo+(p[1]-jlo)*dely; } #endif ccseapps-2.5/CCSEApps/varden2d/graphtool/XWinExterns.H0000644000175000017500000000267511634153073023744 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _XWinExterns_H_ #define _XWinExterns_H_ "@(#)XWinExterns.H 1.1\t10/1/92" extern "C" { #include #include //#include } #endif ccseapps-2.5/CCSEApps/varden2d/graphtool/XWindow.cpp0000644000175000017500000002116011634153073023466 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include "XWindow.H" static char default_font[] = "8x13"; // draw a character string void XWindow::putString(int x, int y, const char *str) { int yy = height-y*scale-1; XDrawString(display, win, gc, x*scale, yy, str, strlen(str)); XFlush( display ); } // clear window void XWindow::newPage() { XClearWindow( display, win ); XFlush( display ); } void XWindow::movePen(int x, int y) { x0 = x*scale; y0 = height - y*scale - 1; } void XWindow::drawLine(int x, int y) { x *= scale; y = height - y*scale - 1; XDrawLine( display, win, gc, x0, y0, x, y ); XFlush( display ); x0 = x; y0 = y; } void XWindow::setLineWidth(int lw) { XSetLineAttributes( display, gc, (lw+1)/2, LineSolid, CapRound, JoinRound ); } void XWindow::flush() { XFlush( display ); } // create a window XWindow::XWindow(int iwidth, int iheight, const char* str, int iscale) { scale = iscale; width = iwidth*scale; height = iheight*scale; name = new char[strlen(str) + 1]; strcpy(name,str); cmap_colors = NULL; screen = 0; x0 = 0; y0 = 0; /* connect to X server */ if ( (display=XOpenDisplay(NULL)) == NULL ) { cerr << "Graphics Display: cannot connect to X server " << XDisplayName(NULL) << "\n"; abort(); } /* create opaque window with backing store */ win = XCreateSimpleWindow(display, RootWindow(display,screen), 100, 100, width, height, 4, BlackPixel(display,screen), WhitePixel(display,screen) ); /* initialize size hint property for window manager */ XSizeHints size_hints; size_hints.flags = PSize | PMaxSize | PMinSize; size_hints.width = (width+1); size_hints.height = (height+1); size_hints.max_width = size_hints.min_width = (width+1); size_hints.max_height = size_hints.min_height = (height+1); /* set properties for window manager (always before mapping) */ XSetStandardProperties( display, win, name, name, None, NULL, 0, &size_hints ); /* set window manager hints */ XWMHints wm_hints; wm_hints.initial_state = NormalState; wm_hints.input = False; wm_hints.flags = StateHint | InputHint; XSetWMHints(display, win, &wm_hints); /* set the class hints */ XClassHint class_hints; class_hints.res_name = name; class_hints.res_class = name; XSetClassHint(display, win, &class_hints); /* specify default font */ if ((the_font = XLoadQueryFont(display,default_font)) == NULL) { cerr << "Cannot open font: " << default_font << "\n"; abort(); }; /* create default graphics context */ XGCValues gcvalues; gcvalues.font = the_font->fid; gc = XCreateGC( display, win, GCFont, &gcvalues ); /* specify black foreground since default may be white on white */ XSetForeground( display, gc, BlackPixel(display,screen) ); /* set line attributes */ XSetLineAttributes( display, gc, 1, LineSolid, CapRound, JoinRound ); /* create a colormap */ nplanes = DisplayPlanes(display,screen); if (nplanes > 2) { cmap = DefaultColormap(display,screen); XSetWindowColormap(display,win,cmap); }; /* psuedocolor display */ /* select event types wanted */ // XSelectInput( display, win, 0L ); XSelectInput( display, win, ExposureMask | StructureNotifyMask ); /* display window */ XMapWindow( display, win ); // start an event loop that runs until the window has received its // initial exposure events. while(1) { XEvent report; XNextEvent(display, &report); switch(report.type) { case Expose: if (report.xexpose.count != 0) break; goto op_end; default: break; } } op_end:XSelectInput( display, win, 0L ); /* some displays allow backing store, others don't */ if (DoesBackingStore(DefaultScreenOfDisplay(display))) { XSetWindowAttributes setwinattr; setwinattr.backing_store = Always; XChangeWindowAttributes(display, win, CWBackingStore, &setwinattr); } } // remove a window XWindow::~XWindow() { // how to free colors? XFreeFont(display, the_font); XFreeGC( display, gc ); XCloseDisplay( display ); delete name; name = NULL; delete cmap_colors; width = height = -1; } // set font void XWindow::setFont(char *font) { XGCValues gcvalues; if ((the_font = XLoadQueryFont(display,font)) == NULL) { cerr << "Cannot open font: " << font << "\n"; abort(); }; gcvalues.font = the_font->fid; XChangeGC( display, gc, GCFont, &gcvalues ); } void XWindow::drawBox(int x1, int y1, int x2, int y2) { x1 *= scale; x2 *= scale; y1 = height - y1*scale - 1; y2 = height - y2*scale - 1; XDrawRectangle(display,win,gc,x1,y1,x2-x1,y2-y1); XFlush( display ); x0 = x1; y0 = y1; } void XWindow::setfgColor(const char *colorname) { // if monotone display, NoOp. if (nplanes <= 2) return; XColor color, exact; if (!XAllocNamedColor(display,cmap,colorname,&color,&exact)) { cerr << "cant alloc colortable cell for color = " << colorname << endl; }; color.flags = DoRed | DoGreen | DoBlue; XSetForeground( display, gc, color.pixel ); } void XWindow::setbgColor(const char *colorname) { // if monotone display, NoOp. if (nplanes <= 2) return; XColor color, exact; if (!XAllocNamedColor(display,cmap,colorname,&color,&exact)) { cerr << "cant alloc colortable cell for color = " << colorname << endl; }; XSetWindowBackground( display, win, color.pixel ); XClearWindow(display, win); } void XWindow::setfgColor(int col) { // if monotone display, NoOp. if (nplanes <= 2) return; if ( (col < 0) || (col >= num_cmap_colors) ) { cout << "color out of range: " << col << endl; return; }; XSetForeground( display, gc, cmap_colors[col]); } void XWindow::setbgColor(int col) { // if monotone display, NoOp. if (nplanes <= 2) return; if ( (col < 0) || (col >= num_cmap_colors) ) { cout << "color out of range: " << col << endl; return; }; XSetWindowBackground( display, win, cmap_colors[col]); XClearWindow(display, win); } void XWindow::defineCmap(unsigned short *red, unsigned short *green, unsigned short *blue, int num) { // if monotone display, do nothing if (nplanes <= 2) return; XColor *cols = new XColor[num]; cmap_colors = new unsigned long[num]; if (!XAllocColorCells(display,cmap,True,NULL,0,cmap_colors,num)) { cerr << "could not alloc " << num <<" colors in colortable" << endl; abort(); }; num_cmap_colors = num; for (int i = 0; i < num; i++) { cols[i].red = red[i]; cols[i].blue = blue[i]; cols[i].green = green[i]; cols[i].flags = DoRed | DoGreen | DoBlue; cols[i].pixel = cmap_colors[i]; }; XStoreColors(display,cmap,cols,num); delete cols; } int XWindow::getMouse(int &x, int &y) { XEvent report; int ib; /* flush event queue */ while ( XCheckMaskEvent( display, ~0L, &report ) ); /* select button press events */ XSelectInput( display, win, ButtonPressMask ); /* loop until a button press event is detected */ ib = 0; while (ib == 0) { XNextEvent( display, &report ); if (report.type == ButtonPress) { ib = report.xbutton.button; x = report.xbutton.x; y = report.xbutton.y; }; }; x /= scale; y = height - y - 1; y /= scale; /* deselect button press events */ XSelectInput( display, win, 0L ); return ib; } ccseapps-2.5/CCSEApps/varden2d/graphtool/GraphTool.H0000644000175000017500000003433011634153073023376 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GraphTool_H_ #define _GraphTool_H_ "@(#)GraphTool.H 1.3\t1/8/93" #include #ifdef _COMPLEX_IS_OK_ #include #endif #include #include #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) #include #include #include #endif typedef unsigned short GTDevice; const GTDevice noDevice = 0; const GTDevice xWinDevice = 1; const GTDevice psDevice = 2; // This class is a C++ version of Louis Howell's GraphTools library. // It has the ability to do simple line drawing graphics, including // contour plotting. // The devices supported are X-windows and postscript files and // an object of this class can have either one or both active at the // same time. // Many of the operations, such as querring the mouse and setting color // and fonts are not implemented for the postscript device and // become no-ops. // The user can change the currently active devices at any time // through a variety of member functions and all subsequent // graphics operations will only be directed to those devices. // One sets the active devices by ORing together any combination // of the above constants (noDevice, XWinDevice, psDevice). class GraphTool { public: GraphTool(double x1, double y1, double x2, double y2, const char *str, int wid, int high, GTDevice device = xWinDevice); // create a graphtool: // (x1,y1) X (x2,y2) physical coordinates of window // str window/postscript file name // (wid,high) width and height (in pixels) of the window // device selected devices GraphTool(const double *lo_pt, const double *hi_pt, const char *str, int wid, int high, GTDevice device = xWinDevice); // create a graphtool: // lo_pt, hi_pt arrays specifying physical coordinates of window // str window/postscript file name // (wid,high) width and height (in pixels) of the window // device selected devices #ifdef _COMPLEX_IS_OK_ GraphTool(const complex &zlo, const complex &zhi, const char *str, int wid, int high, GTDevice device = xWinDevice); // create a graphtool: // zlo, zhi physical coords specified in complex form // str window/postscript file name // (wid,high) width and height (in pixels) of the window // device selected devices #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool(const Box &bx, const char *str, int wid, int high, GTDevice device = xWinDevice); // create a graphtool: // bx physical coordinates specified via box // str window/postscript file name // (wid,high) width and height (in pixels) of the window // device selected devices #endif GraphTool(double x1, double y1, double x2, double y2, const char *str, int maxwinsize = 600, GTDevice device = xWinDevice); // greate a graphtool with correct aspec ratio and // maximum length having maxwinsize pixels. GraphTool(const double *lo_pt, const double *hi_pt, const char *str, int maxwinsize = 600, GTDevice device = xWinDevice); // greate a graphtool with correct aspec ratio and // maximum length having maxwinsize pixels. #ifdef _COMPLEX_IS_OK_ GraphTool(const complex &zlo, const complex &zhi, const char *str, int maxwinsize = 600, GTDevice device = xWinDevice); // greate a graphtool with correct aspec ratio and // maximum length having maxwinsize pixels. #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool(const Box &bx, const char *str, int maxwinsize = 600, GTDevice device = xWinDevice); // greate a graphtool with correct aspec ratio and // maximum length having maxwinsize pixels. #endif ~GraphTool(); // destructor GraphTool& setDevice(GTDevice device); // set these as the active devices #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& setFrame(const IFrame &fr); // set the current int to double mapping #endif GTDevice getDevice() const; // returns currently active devices #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) IFrame getFrame() const; // returns currently active int to double mapping #endif GraphTool& addDevice(GTDevice device); // add these devices to the currently active devices GraphTool& rmDevice(GTDevice device); // remove these devices from the currently active devices GraphTool& newPage(); // clear XWindow if active // start new page of PostScript file if active GraphTool& movePen(double x, double y); // move to given location without drawing line #ifdef _COMPLEX_IS_OK_ GraphTool& movePen(const complex &z); // move to given location without drawing line #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& movePen(const IntVect &v); // move to given location without drawing line #endif GraphTool& drawLine(double x, double y, int lev = 0); // draw line from current location to this location #ifdef _COMPLEX_IS_OK_ GraphTool& drawLine(const complex &z); // draw line from current location to this location #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& drawLine(const IntVect &v); // draw line from current location to this location #endif GraphTool& drawBox(double xlo, double ylo, double xhi, double yhi, int lev=0); // draw a rectangle with the given diagional locations #ifdef _COMPLEX_IS_OK_ GraphTool& drawBox(const complex &zlo, const complex &zhi); // draw a rectangle with the given diagional locations #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& drawBox(const Box &bx); // draw a rectangle with the given diagional locations #endif GraphTool& setClipRegion(double xlo, double ylo, double xhi, double yhi); // set the clipping region so that nothing is drawn outside // this this box. #ifdef _COMPLEX_IS_OK_ GraphTool& setClipRegion(const complex &zlo, const complex &zhi); // set the clipping region so that nothing is drawn outside // this this box. #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& setClipRegion(const Box &bx); // set the clipping region so that nothing is drawn outside // this this box. #endif GraphTool& setLineWidth(int lw); // change the width of the lines drawn. GraphTool& setFont(char *); // change the font to the given XWindow font. // NoOp for PostScript device. GraphTool& putString(double x, double y, const char *str); // output the given string at the given location // NoOp for PostScript device. #ifdef _COMPLEX_IS_OK_ GraphTool& putString(const complex &z, const char *str); // output the given string at the given location // NoOp for PostScript device. #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) GraphTool& putString(const IntVect &v, const char *str); // output the given string at the given location // NoOp for PostScript device. #endif GraphTool& setfgColor(const char *colorname); // change the XWindow foreground color to the named color. // NoOp for PostScript device. GraphTool& setbgColor(const char *colorname); // change the XWindow background color to the named color. // NOTE: will also blank the screen! // NoOp for PostScript device. GraphTool& defineCmap( unsigned short *red, unsigned short *green, unsigned short *blue, int num); // NoOp for PostScript device. GraphTool& setfgColor(int colorTableEntry); // change the XWindow foreground color to that specified // by the colorTableEntry. // NoOp for PostScript device. GraphTool& setbgColor(int colorTableEntry); // change the XWindow background color to that specified // by the colorTableEntry. // NOTE: will also blank the screen! // NoOp for PostScript device. int getMouse(double &x, double &y) const; // query the mouse and return the number of the button // pushed and the (x,y) coordinates (in physical coordinates) // of where the button was pressed. // NoOp for PostScript device. #ifdef _COMPLEX_IS_OK_ int getMouse(complex &z) const; // query the mouse and return the number of the button // pushed and the complex coordinate (in physical coordinates) // of where the button was pressed. // NoOp for PostScript device. #endif #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) int getMouse(IntVect &v) const; // query the mouse and return the number of the button // pushed and the position (mapped double to IntVect) // of where the button was pressed. // NoOp for PostScript device. #endif int contour(const double *data, double value, int has_mask, const int *mask, int nx, int ny, int mx, int my, double xlft, double ybot, double xrgt, double ytop); // draw contour line of value given data array // returns true if success, false if problems. // data = of data to be contoured // value = value to contour // has_mask = true if mask array available // mask = array of mask values. will not contour in masked off cells // dims = specifies dimension of data // subrange = specifies subregion of data to be drawn // xlft = position of left edge of grid in domain // ybot = position of bottom edge of grid in domain // xrgt = position of right edge of grid in domain // ytop = position of top edge of grid in domain #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) int contour(const double* data, double value, int has_mask, const int *mask, const Box &dims, const Box &subrange, double xlft, double ybot, double xrgt, double ytop); // same as above except that: // dims = dimension of arrays (ilo,ihi,jlo,jhi) // subrange = subrange of array to plot (irlo,irhi,jrlo,jrhi) int contour(const double* data, double value, int has_mask, const int *mask, const Box &dims, const Box &subrange, const Box &position); // same as above except that: // position = specifies position via current map #endif int contour(const float *data, double value, int has_mask, const int *mask, int nx, int ny, int mx, int my, double xlft, double ybot, double xrgt, double ytop); // draw contour line of value given data array. SINGLE PRECISION // returns true if success, false if problems. // data = of data to be contoured // value = value to contour // has_mask = true if mask array available // mask = array of mask values. will not contour in masked off cells // dims = specifies dimension of data // subrange = specifies subregion of data to be drawn // xlft = position of left edge of grid in domain // ybot = position of bottom edge of grid in domain // xrgt = position of right edge of grid in domain // ytop = position of top edge of grid in domain #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) int contour(const float* data, double value, int has_mask, const int *mask, const Box &dims, const Box &subrange, double xlft, double ybot, double xrgt, double ytop); // same as above except that: // dims = dimension of arrays (ilo,ihi,jlo,jhi) // subrange = subrange of array to plot (irlo,irhi,jrlo,jrhi) int contour(const float* data, double value, int has_mask, const int *mask, const Box &dims, const Box &subrange, const Box &position); // same as above except that: // position = specifies position via current map #endif protected: int width, height; // width and height of window double xlo,ylo,xhi,yhi; // physical domain double x0, y0; // current position double xcL,xcU,ycL,ycU; // clipping coordinates int was_out; // was last point out of range? GTDevice dev; // encoding of active devices char *name; // name of window/file XWindow *win; // pointer to XWindow object PSfile *ps; // pointer to postscript object #if (BL_SPACEDIM == 2 || BL_SPACEDIM == 3) IFrame frame; // current int to double mapping #endif double clipRatio(double,double,double,double); void initGT(int,int,double,double,double,double, const char*,GTDevice); }; #endif ccseapps-2.5/CCSEApps/varden2d/graphtool/.cvsignore0000644000175000017500000000001411634153073023356 0ustar amckinstryamckinstrylib include ccseapps-2.5/CCSEApps/varden2d/graphtool/PSfile.H0000644000175000017500000000347411634153073022666 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _PSfile_H_ #define _PSfile_H_ "@(#)PSfile.H 1.2\t10/5/92" #include #include class PSfile { public: PSfile(int wid, int high, const char *name); ~PSfile(); void newPage(); void movePen(double x, double y); void drawLine(double x, double y, int lev=0); void setLineWidth(int lw); void flush(); private: int npts; int xfactor; int yfactor; int xcur; int ycur; std::ofstream file; char *filename; }; #endif ccseapps-2.5/CCSEApps/mk/0000755000175000017500000000000011634153073016266 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/mk/Make.defs0000644000175000017500000003135611634153073020016 0ustar amckinstryamckinstry# # Make.defs $Id: Make.defs,v 1.64 2003/03/14 23:44:57 marc Exp $ # # # Establish some defaults, assuming that they are not already set by the # Makefile that includes this file. # # # To destinguish between YMP or C90 ... # # Don't make the distinction for now, just use CRAY # UNAMEM := $(shell uname -m) UNAMEN := $(shell uname -n) ifeq ($(findstring CRAY, $(UNAMEM)), CRAY) ifeq ($(findstring Y-MP, $(UNAMEM)), Y-MP) MACHINE := CRAY endif ifeq ($(findstring C90, $(UNAMEM)), C90) MACHINE := CRAY endif ifeq ($(findstring J90, $(UNAMEM)), J90) MACHINE := CRAY endif ifeq ($(findstring T3E, $(UNAMEM)), T3E) MACHINE := T3E ifeq ($(findstring mcurie, $(UNAMEN)), mcurie) WHICHT3E := NERSC endif # currently both nersc t3es have the same home path names ifeq ($(findstring pierre, $(UNAMEN)), pierre) WHICHT3E := NERSC endif ifeq ($(findstring seymour, $(UNAMEN)), seymour) WHICHT3E := NAVO endif ifeq ($(findstring yukon, $(UNAMEN)), yukon) WHICHT3E := ARSC endif endif endif UNAMES := $(shell uname -s) ifeq ($(findstring CYGWIN_NT, $(UNAMES)), CYGWIN_NT) MACHINE := CYGWIN_NT endif ifndef MACHINE MACHINE := $(shell uname) endif # # We'd also like to distinguish between SunOS and Solaris. # UNAMER := $(shell uname -r) ifeq ($(MACHINE), SunOS) ifeq ($(shell awk 'BEGIN {print "$(UNAMER)"; print "5.0"}' /dev/null | \ sort | head -1), 5.0) MACHINE := Solaris endif endif # # Set special flag for escher.nersc.gov # ifeq ($(MACHINE), IRIX64) WHICHIRIX64 := GENERICSGI ifeq ($(findstring escher, $(UNAMEN)), escher) WHICHIRIX64 := ESCHER endif ifeq ($(findstring mahler, $(UNAMEN)), mahler) WHICHIRIX64 := MAHLER endif endif # # Set special flag for the Linux cluster (n2001.lbl.gov) # ifeq ($(MACHINE), Linux) WHICHLINUX := GENERICLINUX ifeq ($(findstring n2001, $(UNAMEN)), n2001) WHICHLINUX := PCCLUSTER endif ifeq ($(findstring xfe1, $(UNAMEN)), xfe1) WHICHLINUX := ALPHACLUSTER endif endif ifeq ($(MACHINE), HP-UX) # # `-' is not a valid character in a preprocessing token. # That is to say, -DBL_HP-UX is not, strictly speaking, valid. # MACHINE := HPUX endif ifndef PRECISION PRECISION = DOUBLE endif ifndef DEBUG DEBUG = TRUE endif ifndef PROFILE PROFILE = FALSE endif ifndef DIM DIM = 2 endif ifndef COMP COMP = CC endif ifndef FCOMP FCOMP = f77 endif ifndef USE_THREADS USE_THREADS = FALSE endif ifndef USE_MPI USE_MPI = FALSE endif ifndef STRICTLY STRICTLY = FALSE endif # # Set some reasonable defaults. # CXX = CC FC = f77 CC = cc # # Defaults for BoxLib style programs. # ARCH = IEEE FORTLINK = UNDERSCORE FORTPREP = perl $(PBOXLIB_HOME)/scripts/strip72 -c MKDEP = perl $(PBOXLIB_HOME)/scripts/mkdep INSTALL = sh $(PBOXLIB_HOME)/scripts/install-sh -c # # SunOS ranlib has a problem if the library is installed 444 :-( # ifeq ($(MACHINE), SunOS) INSTALL_DATA = $(INSTALL) -m 0644 else INSTALL_DATA = $(INSTALL) -m 0444 endif # # We assume that INSTALL_ROOT is either set on the command line, # set in the environment, or set by a controlling GNUmakefile. # It is where the stuff is to be installed. For the guthamr stuff # proper, we set this to GUTHAMR_HOME. If this isn't set, # we set it to where guthamr was installed. # ifndef INSTALL_ROOT INSTALL_ROOT = $(GUTHAMR_HOME) endif ifndef INSTALL_PREFIX INSTALL_PREFIX = $(INSTALL_ROOT) endif RANLIB = true EXE_OUTPUT_OPTION = -o $(objEXETempDir)/$*.o LIB_OUTPUT_OPTION = -o $(objTempDir)/$*.o FORT_EXE_OUTPUT_OPTION = -o $(objEXETempDir)/$*.o FORT_LIB_OUTPUT_OPTION = -o $(objTempDir)/$*.o # # Generic setup for using g++ ... # ifeq ($(COMP),g++) CXXPRFF := -p CXXOPTF += -O CXXDEBF += -g CXXOPTF += -g FULLWARN := -Wall FULLWARN += -Wno-sign-compare CXX := g++ -ftemplate-depth-25 __gcc_version := $(shell $(CXX) -dumpversion | head -1 | sed -e 's;.* *;;') __gcc_major_version := $(shell $(CXX) -dumpversion | head -1 | sed -e 's;.* *;;' | sed -e 's;\..*;;') __gcc_minor_version := $(shell $(CXX) -dumpversion | head -1 | sed -e 's;.* *;;' | sed -e 's;[^.]*\.;;' | sed -e 's;\..*;;') DEFINES += -DBL_GCC_VERSION='$(__gcc_version)' DEFINES += -DBL_GCC_MAJOR_VERSION=$(__gcc_major_version) DEFINES += -DBL_GCC_MINOR_VERSION=$(__gcc_minor_version) ifneq ($(__gcc_major_version),3) GNU_STD_INCL = $(PBOXLIB_HOME)/BoxLib/std endif endif ifeq ($(FCOMP),g77) FC := g77 FOPTF += -O fOPTF += -O FDEBF += -g fDEBF += -g endif ifeq ($(COMP),Intel) CXX := icc CXXOPTF += -g CXXOPTF += -O2 # CXXOPTF += -axK CXXDEBF += -g __icc_version := $(shell $(CXX) -V 2>&1 1>/dev/null | grep Version) ifeq ($(findstring Version 5.0.1, $(__icc_version)), Version 5.0.1) ICC_VERSION := 5.0.1 ICC_MAJOR_VERSION := 5 ICC_MINOR_VERSION := 0 else ifeq ($(findstring Version 6.0, $(__icc_version)), Version 6.0) ICC_VERSION := 6.0 ICC_MAJOR_VERSION := 6 ICC_MINOR_VERSION := 0 else ifeq ($(findstring Version 7.0, $(__icc_version)), Version 7.0) ICC_VERSION := 7.0 ICC_MAJOR_VERSION := 7 ICC_MINOR_VERSION := 0 endif endif endif DEFINES += -DBL_ICC_VERSION=$(ICC_VERSION) DEFINES += -DBL_ICC_MAJOR_VERSION=$(ICC_MAJOR_VERSION) DEFINES += -DBL_ICC_MINOR_VERSION=$(ICC_MINOR_VERSION) endif ifeq ($(FCOMP),Intel) FC := ifc fC := $(FC) FDEBF += -g fDEBF += -g FOPTF += -g fOPTF += -g FOPTF += -O2 # FOPTF += -axK fOPTF += -O2 # fOPTF += -axK fDEBF += -w fOPTF += -w ifneq ($(DIM),3) FDEBF += -CB -CU -CA fDEBF += -CB -CU -CA endif __ifc_version := $(shell $(FC) -V 2>&1 1>/dev/null | grep Version) override XTRALIBS += -lintrins -lIEPCF90 -lF90 -limf -lcprts -lcxa -lirc ifeq ($(findstring Version 5.0.1, $(__ifc_version)), Version 5.0.1) IFC_VERSION := 5.0.1 IFC_MAJOR_VERSION := 5 IFC_MINOR_VERSION := 0 LIBRARY_LOCATIONS += $(IA32ROOT)/lib override XTRALIBS += $(IA32ROOT)/lib/icrt.link else ifeq ($(findstring Version 6.0, $(__ifc_version)), Version 6.0) IFC_VERSION := 6.0 IFC_MAJOR_VERSION := 6 IFC_MINOR_VERSION := 0 LIBRARY_LOCATIONS += /opt/intel/compiler60/ia32/lib else ifeq ($(findstring Version 7.0, $(__ifc_version)), Version 7.0) IFC_VERSION := 7.0 IFC_MAJOR_VERSION := 7 IFC_MINOR_VERSION := 0 LIBRARY_LOCATIONS += /opt/intel/compiler70/ia32/lib endif endif endif ifeq ($(USE_THREADS),TRUE) override XTRALIBS += -lpthread endif endif # # Generic setup for using cfront ... # ifeq ($(COMP),CFRONT) CLOSELIB := TRUE ptRepDir = $(objTempDir)/ptrepository CXXLIBFLAGS += -ptr$(ptRepDir) endif # # We can do library closure with KCC 3.x. # ifeq ($(findstring KCC, $(COMP)),KCC) __kcc_version := $(shell \ echo 'int i;' > _X.cpp; \ KCC -c -v _X.cpp 2>&1 1>/dev/null | fgrep 'KAI C' | head -1; \ /bin/rm -f _X.cpp _X.o) #DEFINES += -D__kcc_version='$(__kcc_version)' # # init null values (for brainerd) # KCC_VERSION:=0.0 KCC_MAJOR_VERSION:=0 KCC_MINOR_VERSION:=0 ifeq ($(findstring KAI C++ 3.1, $(__kcc_version)), KAI C++ 3.1) KCC_VERSION:=3.1 KCC_MAJOR_VERSION:=3 KCC_MINOR_VERSION:=1 CLOSELIB := TRUE endif ifeq ($(findstring KAI C++ 3.2, $(__kcc_version)), KAI C++ 3.2) KCC_VERSION:=3.2 KCC_MINOR_VERSION:=2 CLOSELIB := TRUE endif ifeq ($(findstring KAI C++ 3.3, $(__kcc_version)), KAI C++ 3.3) KCC_VERSION:=3.3 KCC_MAJOR_VERSION:=3 KCC_MINOR_VERSION:=3 CLOSELIB := TRUE CXXLIBFLAGS = --one_per endif ifeq ($(findstring KAI C++ 3.4, $(__kcc_version)), KAI C++ 3.4) KCC_VERSION:=3.4 KCC_MAJOR_VERSION:=3 KCC_MINOR_VERSION:=4 CLOSELIB := TRUE CXXLIBFLAGS = --one_per endif ifeq ($(findstring C++ 3.9, $(__kcc_version)), C++ 3.9) KCC_VERSION:=3.9 KCC_MINOR_VERSION:=9 KCC_MAJOR_VERSION:=3 CLOSELIB:=TRUE CXXLIBFLAGS = --one_per endif ifeq ($(findstring KAI C++ 4.0, $(__kcc_version)), KAI C++ 4.0) KCC_VERSION:=4.0 KCC_MINOR_VERSION:=0 KCC_MAJOR_VERSION=4 CLOSELIB := TRUE CXXLIBFLAGS = --one_per endif ifeq ($(findstring C++ 4.0, $(__kcc_version)), C++ 4.0) KCC_VERSION:=4.0 KCC_MINOR_VERSION:=0 KCC_MAJOR_VERSION:=4 CLOSELIB:=TRUE CXXLIBFLAGS = --one_per endif DEFINES += -DBL_KCC_VERSION=$(KCC_VERSION) DEFINES += -DBL_KCC_MAJOR_VERSION=$(KCC_MAJOR_VERSION) DEFINES += -DBL_KCC_MINOR_VERSION=$(KCC_MINOR_VERSION) endif # Fortran Suffix FCOMPSuffix := .$(FCOMP) include $(PBOXLIB_HOME)/mk/Make.$(MACHINE) ifeq ($(DEBUG),TRUE) FFLAGS += $(FDEBF) fFLAGS += $(fDEBF) CXXFLAGS += $(CXXDEBF) CFLAGS += $(CDEBF) DebugSuffix := .DEBUG else FFLAGS += $(FOPTF) fFLAGS += $(fOPTF) CXXFLAGS += $(CXXOPTF) CFLAGS += $(COPTF) CPPFLAGS += -DNDEBUG DebugSuffix := endif ifeq ($(GPROF),TRUE) FFLAGS += -pg CXXFLAGS += -pg fFLAGS += -pg CFLAGS += -pg endif ifeq ($(PROFILE),TRUE) CPPFLAGS += -DBL_PROFILING ProfSuffix := .PROF else ProfSuffix := endif ifeq ($(USE_MPI),TRUE) MPISuffix := .MPI CPPFLAGS += -DBL_USE_MPI include $(PBOXLIB_HOME)/mk/Make.mpi else MPISuffix := endif ifeq ($(USE_THREADS),TRUE) DEFINES += -DBL_THREADS ifeq ($(COMP),KCC) CXXFLAGS+=--thread_safe endif ifeq ($(COMP),mpKCC) CXXFLAGS+=--thread_safe endif ifeq ($(COMP),g++) CPPFLAGS+=-pthread endif ThreadsSuffix := .TS else ThreadsSuffix := endif ifeq ($(STRICTLY),TRUE) ifeq ($(COMP),KCC) CXXFLAGS += --strict CPPFLAGS += -D__KAI_STRICT CXXFLAGS += --display_error_number CXXFLAGS += --diag_suppress 450 endif ifeq ($(COMP),g++) CXXFLAGS += $(FULLWARN) endif endif ifeq ($(PRECISION),FLOAT) ifeq ($(MACHINE),CRAY) PrecisionSuffix := else PrecisionSuffix := .$(PRECISION) endif else PrecisionSuffix := endif CPlusPlusSourceFiles = C89SourceFiles = F77SourceFiles = F90SourceFiles = f77SourceFiles = objForLibs = $(CLIB_sources:%.cpp=%.o) \ $(FLIB_sources:%.F=%.o) \ $(F90LIB_sources:%.F90=%.o) \ $(cLIB_sources:%.c=%.o) \ $(fLIB_sources:%.f=%.o) \ $(f90LIB_sources:%.f90=%.o) \ objStandalone = $(CEXE_sources:%.cpp=%.o) \ $(FEXE_sources:%.F=%.o) \ $(F90EXE_sources:%.F90=%.o) \ $(cEXE_sources:%.c=%.o) \ $(fEXE_sources:%.f=%.o) \ $(f90EXE_sources:%.f90=%.o) \ objForExecs = $(addprefix $(objEXETempDir)/, $(objStandalone)) instSources = $(CLIB_headers) $(FLIB_headers) $(cLIB_headers) $(T_sources) $(T_headers) $(fLIB_headers) $(f90LIB_headers) INCLUDE_LOCATIONS += . $(XTRAINCLOC) $(XINCL) $(GNU_STD_INCL) LIBRARY_LOCATIONS += . $(XTRALIBLOC) $(XLIBL) DEFINES += -DBL_SPACEDIM=$(DIM) \ -DBL_FORT_USE_$(FORTLINK) \ -DBL_$(MACHINE) \ $(XTRADEFS) ifeq ($(PRECISION),FLOAT) DEFINES += -DBL_USE_FLOAT endif ifeq ($(ARCH),CRAY) DEFINES += -DBL_ARCH_CRAY endif includes = $(addprefix -I, $(INCLUDE_LOCATIONS)) fincludes = $(includes) CPPFLAGS += $(DEFINES) $(includes) libraries = $(LIBRARIES) $(BL_MPI_LIBS) $(XTRALIBS) LDFLAGS += $(addprefix -L, $(LIBRARY_LOCATIONS)) machineSuffix = $(MACHINE).$(COMP)$(FCOMPSuffix)$(PrecisionSuffix)$(DebugSuffix)$(ProfSuffix)$(MPISuffix)$(ThreadsSuffix) optionsSuffix = $(DIM)d.$(machineSuffix) optionsLib = $(addprefix lib, \ $(addsuffix $(optionsSuffix).a, $(LBASE))) instIncludeDir = $(INSTALL_PREFIX)/include instLibDir = $(INSTALL_PREFIX)/lib/$(machineSuffix) instBinDir = $(INSTALL_PREFIX)/bin/$(machineSuffix) instScriptDir = $(INSTALL_PREFIX)/bin instHtmlDir = $(INSTALL_PREFIX)/html instInfoDir = $(INSTALL_PREFIX)/info instMkDir = $(INSTALL_PREFIX)/mk executable = $(addsuffix $(optionsSuffix).ex, $(EBASE)) depTempDir = d/$(optionsSuffix) depEXETempDir = d/$(optionsSuffix).EXE objTempDir = o/$(optionsSuffix) objEXETempDir = o/$(optionsSuffix).EXE f77TempDir = f/$(optionsSuffix) instLib = $(instLibDir)/lib$(LBASE)$(DIM)d.a # # For source code mainipulation # CSRCALL = $(CEXE_sources) $(CEXE_headers) \ $(CLIB_sources) $(CLIB_headers) $(T_sources) $(T_headers) FSRCALL = $(FEXE_sources) $(FEXE_headers) $(FLIB_sources) \ $(FLIB_headers) F90SRCALL = $(F90EXE_sources) $(F90EXE_headers) $(F90LIB_sources) \ $(F90LIB_headers) cSRCALL = $(cEXE_sources) $(cEXE_headers) $(cLIB_sources) \ $(cLIB_headers) fSRCALL = $(fEXE_sources) $(fEXE_headers) $(fLIB_sources) \ $(fLIB_headers) f90SRCALL = $(f90EXE_sources) $(f90EXE_headers) $(f90LIB_sources) \ $(f90LIB_headers) allSources = $(CSRCALL) $(FSRCALL) $(F90SRCALL) $(cSRCALL) $(fSRCALL) $(f90SRCALL) ifndef CLOSELIB CLOSELIB := FALSE endif ifdef WARNINGS CXX += $(FULLWARN) endif ccseapps-2.5/CCSEApps/mk/Make.rules0000644000175000017500000002202511634153073020220 0ustar amckinstryamckinstry# # $Id: Make.rules,v 1.24 2002/08/05 15:41:22 car Exp $ # $(addprefix $(instIncludeDir)/, $(instSources)): $(instIncludeDir)/% : % @if [ ! -d $(instIncludeDir) ]; then mkdir -p $(instIncludeDir); fi $(INSTALL_DATA) $< $@ $(instLib) : $(optionsLib) @if [ ! -d $(instLibDir) ]; then mkdir -p $(instLibDir); fi $(INSTALL_DATA) $< $@ $(RANLIB) $@ install: $(instLib) $(addprefix $(instIncludeDir)/, $(instSources)) clean:: $(RM) $(optionsLib) $(objTempDir)/*.o $(f77TempDir)/*.f $(objEXETempDir)/*.o ifeq ($(CLOSELIB),TRUE) $(RM) *.o *.ii $(ptRepDir)/*.o $(RM) -r $(optionsLib) $(objTempDir)/KCC_files $(objTempDir)/ti_files endif $(RM) $(EBASE)$(optionsSuffix).ex *.pure # # Rule for building libraries. # $(optionsLib): $(optionsLib)( $(objForLibs) ) ifeq ($(CLOSELIB),TRUE) ifeq ($(COMP), CFRONT) # # With cfront we only close boxlib. # ifeq ($(LBASE),box) $(RM) -r ./tmp mkdir ./tmp -cp -p $(addprefix $(objTempDir)/, $(objForLibs)) $(LibsToCloseAgainst) ./tmp -$(CXX) -ptv -pts $(CXXLIBFLAGS) -DBL_SPACEDIM=$(DIM) $(CPPFLAGS) $(CXXFLAGS) ./tmp/*.o n=1; for i in $(ptRepDir)/*.o; do cp $$i ./tmp/$${n}.o; n=`expr $$n + 1`; done $(RM) $(optionsLib) ar crv $(optionsLib) ./tmp/*.o $(RM) -r ./tmp endif endif ifeq ($(SUNPRO),TRUE) # # With sunpro we only close boxlib. # ifeq ($(LBASE),box) $(RM) -r ./tmp mkdir ./tmp -cp -p $(addprefix $(objTempDir)/, $(objForLibs)) $(LibsToCloseAgainst) ./tmp n=1; for i in $(ptRepDir)/Templates.DB/*.o; do cp $$i ./tmp/$${n}.o; n=`expr $$n + 1`; done $(RM) $(optionsLib) ar crv $(optionsLib) ./tmp/*.o $(RM) -r ./tmp endif endif # # On KCC we close all libraries. # ifeq ($(COMP), KCC) $(CXX) $(CXXLIBFLAGS) $(CXXFLAGS) $(CPPFLAGS) -o $(optionsLib) $(addprefix $(objTempDir)/, $(objForLibs)) $(LibsToCloseAgainst) endif endif $(RANLIB) $@ realclean: clean $(RM) lib*.a TAGS tags $(RM) -r d o f ii_files *~ $(RM) *.ex *.ii *.o mon.out gmon.out $(RM) work.pc work.pcl tags: $(allSources) ctags $^ TAGS: $(allSources) etags $^ .PHONY: all clean install TAGS realclean tags # # Rules for building executable. # $(executable): $(objForExecs) $(PRELINK) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) \ -o $@ $(objForExecs) $(libraries) # # Rule for building a purified executable. # ifdef PURIFY %.pure: % $(PURIFY) $(PURIFYFLAGS) $^ endif # # Rules for libraries. # $(optionsLib)(%.o): %.cpp @if [ ! -d $(objTempDir) ]; then mkdir -p $(objTempDir); fi $(CXX) $(CXXLIBFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c $< $(LIB_OUTPUT_OPTION) $(AR) r $@ $(objTempDir)/$*.o $(optionsLib)(%.o): %.c @if [ ! -d $(objTempDir) ]; then mkdir -p $(objTempDir); fi $(CC) $(CLIBFLAGS) $(CFLAGS) $(CPPFLAGS) -DBL_LANG_C -c $< $(LIB_OUTPUT_OPTION) $(AR) r $@ $(objTempDir)/$*.o $(optionsLib)(%.o): %.F @if [ ! -d $(f77TempDir) ]; then mkdir -p $(f77TempDir); fi @if [ ! -d $(objTempDir) ]; then mkdir -p $(objTempDir); fi $(FORT_CPP) $(CPPFLAGS) -DBL_LANG_FORT $< | $(FORTPREP) > $(f77TempDir)/$*.f $(FC) $(FLIBFLAGS) $(FFLAGS) $(fincludes) -c $(f77TempDir)/$*.f $(FORT_LIB_OUTPUT_OPTION) $(AR) r $@ $(objTempDir)/$*.o $(optionsLib)(%.o): %.F90 @if [ ! -d $(f77TempDir) ]; then mkdir -p $(f77TempDir); fi @if [ ! -d $(objTempDir) ]; then mkdir -p $(objTempDir); fi $(FORT_CPP) $(CPPFLAGS) -DBL_LANG_FORT $< | $(FORTPREP) > $(f77TempDir)/$*.f90 $(FC) $(FLIBFLAGS) $(FFLAGS) $(fincludes) -c $(f77TempDir)/$*.f90 $(FORT_LIB_OUTPUT_OPTION) $(AR) r $@ $(objTempDir)/$*.o $(optionsLib)(%.o): %.f90 @if [ ! -d $(objTempDir) ]; then mkdir -p $(objTempDir); fi $(fC) $(fLIBFLAGS) $(fFLAGS) $(fincludes) -c $< $(FORT_LIB_OUTPUT_OPTION) $(AR) r $@ $(objTempDir)/$*.o $(optionsLib)(%.o): %.f @if [ ! -d $(objTempDir) ]; then mkdir -p $(objTempDir); fi $(fC) $(fLIBFLAGS) $(fFLAGS) $(fincludes) -c $< $(FORT_LIB_OUTPUT_OPTION) $(AR) r $@ $(objTempDir)/$*.o # # Rules for objects. # $(objEXETempDir)/%.o: %.cpp @if [ ! -d $(objEXETempDir) ]; then mkdir -p $(objEXETempDir); fi $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(CXXEXEFLAGS) $< $(EXE_OUTPUT_OPTION) $(objEXETempDir)/%.o: %.c @if [ ! -d $(objEXETempDir) ]; then mkdir -p $(objEXETempDir); fi $(CC) $(CFLAGS) $(CPPFLAGS) -c $(CEXEFLAGS) -DBL_LANG_C $< $(EXE_OUTPUT_OPTION) $(objEXETempDir)/%.o: %.F90 @if [ ! -d $(objEXETempDir) ]; then mkdir -p $(objEXETempDir); fi @if [ ! -d $(f77TempDir) ]; then mkdir -p $(f77TempDir); fi $(FORT_CPP) -DBL_LANG_FORT $(CPPFLAGS) $< | $(FORTPREP) > $(f77TempDir)/$*.f90 $(FC) $(FFLAGS) $(fincludes) -c $(FEXEFLAGS) $(f77TempDir)/$*.f90 $(FORT_EXE_OUTPUT_OPTION) $(objEXETempDir)/%.o: %.F @if [ ! -d $(objEXETempDir) ]; then mkdir -p $(objEXETempDir); fi @if [ ! -d $(f77TempDir) ]; then mkdir -p $(f77TempDir); fi $(FORT_CPP) -DBL_LANG_FORT $(CPPFLAGS) $< | $(FORTPREP) > $(f77TempDir)/$*.f $(FC) $(FFLAGS) $(fincludes) -c $(FEXEFLAGS) $(f77TempDir)/$*.f $(FORT_EXE_OUTPUT_OPTION) $(objEXETempDir)/%.o: %.f90 @if [ ! -d $(objEXETempDir) ]; then mkdir -p $(objEXETempDir); fi $(fC) $(fFLAGS) $(fincludes) -c $(fEXEFLAGS) $< $(FORT_EXE_OUTPUT_OPTION) $(objEXETempDir)/%.o: %.f @if [ ! -d $(objEXETempDir) ]; then mkdir -p $(objEXETempDir); fi $(fC) $(fFLAGS) $(fincludes) -c $(fEXEFLAGS) $< $(FORT_EXE_OUTPUT_OPTION) # # Rules for dependencies in libraries. # $(depTempDir)/%.d: %.cpp @echo Depending $< ... @if [ ! -d $(depTempDir) ]; then mkdir -p $(depTempDir); fi @$(SHELL) -ec '$(MKDEP) $(includes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(optionsLib)(&) $@,'\'' > $@' $(depTempDir)/%.d: %.c @echo Depending $< ... @if [ ! -d $(depTempDir) ]; then mkdir -p $(depTempDir); fi @$(SHELL) -ec '$(MKDEP) $(includes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(optionsLib)(&) $@,'\'' > $@' $(depTempDir)/%.d: %.F90 @echo Depending $< ... @if [ ! -d $(depTempDir) ]; then mkdir -p $(depTempDir); fi @$(SHELL) -ec '$(MKDEP) -fortran $(fincludes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(optionsLib)(&) $@,'\'' > $@' $(depTempDir)/%.d: %.F @echo Depending $< ... @if [ ! -d $(depTempDir) ]; then mkdir -p $(depTempDir); fi @$(SHELL) -ec '$(MKDEP) -fortran $(fincludes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(optionsLib)(&) $@,'\'' > $@' $(depTempDir)/%.d: %.f90 @echo Depending $< ... @if [ ! -d $(depTempDir) ]; then mkdir -p $(depTempDir); fi @$(SHELL) -ec '$(MKDEP) -fortran $(fincludes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(optionsLib)(&) $@,'\'' > $@' $(depTempDir)/%.d: %.f @echo Depending $< ... @if [ ! -d $(depTempDir) ]; then mkdir -p $(depTempDir); fi @$(SHELL) -ec '$(MKDEP) -fortran $(fincludes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(optionsLib)(&) $@,'\'' > $@' # # Rules for dependencies in bare object files. # $(depEXETempDir)/%.d: %.cpp @echo Depending $< ... @if [ ! -d $(depEXETempDir) ]; then mkdir -p $(depEXETempDir); fi @$(SHELL) -ec '$(MKDEP) $(includes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(objEXETempDir)/& $@,'\'' > $@' $(depEXETempDir)/%.d: %.c @echo Depending $< ... @if [ ! -d $(depEXETempDir) ]; then mkdir -p $(depEXETempDir); fi @$(SHELL) -ec '$(MKDEP) $(includes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(objEXETempDir)/& $@,'\'' > $@' $(depEXETempDir)/%.d: %.F90 @echo Depending $< ... @if [ ! -d $(depEXETempDir) ]; then mkdir -p $(depEXETempDir); fi @$(SHELL) -ec '$(MKDEP) -fortran $(fincludes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(objEXETempDir)/& $@,'\'' > $@' $(depEXETempDir)/%.d: %.F @echo Depending $< ... @if [ ! -d $(depEXETempDir) ]; then mkdir -p $(depEXETempDir); fi @$(SHELL) -ec '$(MKDEP) -fortran $(fincludes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(objEXETempDir)/& $@,'\'' > $@' $(depEXETempDir)/%.d: %.f90 @echo Depending $< ... @if [ ! -d $(depEXETempDir) ]; then mkdir -p $(depEXETempDir); fi @$(SHELL) -ec '$(MKDEP) -fortran $(fincludes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(objEXETempDir)/& $@,'\'' > $@' $(depEXETempDir)/%.d: %.f @echo Depending $< ... @if [ ! -d $(depEXETempDir) ]; then mkdir -p $(depEXETempDir); fi @$(SHELL) -ec '$(MKDEP) -fortran $(fincludes) $< | \ sed -e '\''s,^[^:]*\/,,'\'' | \ sed -e '\''s,$*.o,$(objEXETempDir)/& $@,'\'' > $@' # # Now load/build the dependency files. # ifdef CLIB_sources -include $(CLIB_sources:%.cpp=$(depTempDir)/%.d) endif ifdef FLIB_sources -include $(FLIB_sources:%.F=$(depTempDir)/%.d) endif ifdef F90LIB_sources -include $(F90LIB_sources:%.F90=$(depTempDir)/%.d) endif ifdef fLIB_sources -include $(fLIB_sources:%.f=$(depTempDir)/%.d) endif ifdef f90LIB_sources -include $(f90LIB_sources:%.f90=$(depTempDir)/%.d) endif ifdef cLIB_sources -include $(cLIB_sources:%.c=$(depTempDir)/%.d) endif # ifdef CEXE_sources -include $(CEXE_sources:%.cpp=$(depEXETempDir)/%.d) endif ifdef FEXE_sources -include $(FEXE_sources:%.F=$(depEXETempDir)/%.d) endif ifdef F90EXE_sources -include $(F90EXE_sources:%.F90=$(depEXETempDir)/%.d) endif ifdef fEXE_sources -include $(fEXE_sources:%.f=$(depEXETempDir)/%.d) endif ifdef f90EXE_sources -include $(f90EXE_sources:%.f90=$(depEXETempDir)/%.d) endif ifdef cEXE_sources -include $(cEXE_sources:%.c=$(depEXETempDir)/%.d) endif ccseapps-2.5/CCSEApps/mk/Make.T3E0000644000175000017500000000266711634153073017473 0ustar amckinstryamckinstry FORT_CPP = cpp ifeq ($(COMP),CC) CXX := CC -h instantiate=local -h new_for_init CXXOPTF += -O2 CXXDEBF += -g # # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library. # override XTRADEFS += -DBL_USE_SETBUF -DBL_SETBUF_SIGNED_CHAR override XTRADEFS += -DBL_COALESCE_FABS -DBL_OLD_STL endif ifeq ($(COMP),KCC) CXX := KCC --no_exceptions CXXOPTF += +K3 --backend '-h nomessage=191:1135:7212,aggress,inline1,pipeline2,scalar2' CXXDEBF += +K0 # # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library. # override XTRADEFS += -DBL_COALESCE_FABS endif ifeq ($(PROFILE), TRUE) # # The following are for apprentice # apprentice is broken on the T3E -- vince # #CXXPRFF += -happrentice #XTRALIBS += -lapp #FPRFF += -eA # # The following is for pat # ifeq ($(COMP),CC) XTRALIBS += -lpat pat.cld endif ifeq ($(COMP),KCC) XTRALIBS += --backend -lpat --backend pat.cld endif endif FC = f90 -M 1110 FOPTF += -O,aggress,pipeline2,vector3,split0 -apad FDEBF += -g fC = $(FC) -N 80 fOPTF += -O,aggress,pipeline2,vector3,split0 -apad fDEBF += -g COPTF += -O2 CDEBF += -g CPRFF += ifeq ($(COMP),CC) EXE_OUTPUT_OPTION = ; mv $*.o $(objEXETempDir)/$*.o LIB_OUTPUT_OPTION = ; mv $*.o $(objTempDir)/$*.o endif FORT_EXE_OUTPUT_OPTION = ; mv $*.o $(objEXETempDir)/$*.o FORT_LIB_OUTPUT_OPTION = ; mv $*.o $(objTempDir)/$*.o FORTLINK = UPPERCASE FORTPREP = sed '/^!/d' | perl $(PBOXLIB_HOME)/scripts/strip72 -c ccseapps-2.5/CCSEApps/mk/Make.Linux0000644000175000017500000000441311634153073020166 0ustar amckinstryamckinstry# Make for Linux ifeq ($(COMP),KCC) CXX = KCC CXXOPTF += -O1 +K1 CXXDEBF += +K0 FULLWARN := --strict_warnings else ifeq ($(COMP),PGI) CXX = pgCC CXXOPTF += CXXDEBF += -g else endif endif FORT_CPP := gcc -E -traditional ifeq ($(FCOMP),Lahey) FC := lf95 --ml cdecl fC := $(FC) # FDEBF += -H aesu # FOPTF += -K fast # fDEBF += -H aesu # fOPTF += -K fast LIBRARY_LOCATIONS += /usr/local/lf9561/lib override XTRALIBS += -lfj9f6 -lfj9i6 -lfj9e6 else ifeq ($(FCOMP),Absoft) FC := f90 -B108 -YEXT_NAMES=LCS fC := $(FC) LIBRARY_LOCATIONS += /usr/absoft/lib override XTRALIBS += -lfio -lf77math #override FORTLINK := LOWERCASE else ifeq ($(FCOMP),PGI) FC := pgf90 fC := $(FC) FOPTF += -fast fOPTF += -fast FDEBF += -g fDEBF += -g LIBRARY_LOCATIONS += /usr/pgi/linux86/lib override XTRALIBS += -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgc else ifeq ($(FCOMP),Intel) # mostly in Make.defs FDEBF += $(INTEL_EXTRA_DEBUG_FLAGS) FOPTF += $(INTEL_EXTRA_OPT_FLAGS) fDEBF += $(INTEL_EXTRA_DEBUG_FLAGS) fOPTF += $(INTEL_EXTRA_OPT_FLAGS) else ifeq ($(FCOMP),f77) FC := g77 -fno-second-underscore fC := $(FC) # default g77/f77 version FOPTF += -O fOPTF += -O FDEBF += -g fDEBF += -g #DEFINES += -DBL_FORT_USE_UNDERSCORE #override XTRALIBS += -lf2c # LIBRARY_LOCATIONS += /usr/lib/gcc-lib/i386-redhat-linux/2.96 override XTRALIBS += -lg2c FDEBF += -ffortran-bounds-check FDEBF += -Wimplicit fDEBF += -Wimplicit fDEBF += -ffortran-bounds-check endif endif endif endif endif CXXPRFF += -pg FPRF += -pg override XTRALIBS += -lm ifeq ($(WHICHLINUX), PCCLUSTER) LIBRARY_LOCATIONS += /usr/local/pkg/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.1 # this should be made into a link to the current version ^^^^^^ endif ifeq ($(WHICHLINUX), ALPHACLUSTER) FC := fort -assume nounderscore # FC := fort fC := $(FC) override FORTLINK := LOWERCASE #FOPTF += -O5 -fast -transform_loops -speculate all -automatic FOPTF = -O5 -fast FOPTF = -O2 fOPTF = -O5 -fast fOPTF = -O2 LIBRARY_LOCATIONS += /usr/local/pkg/gcc-2.95.1-generic/lib/gcc-lib/alpha-redhat-linux/2.95.1 # this should be made into a link to the current version ^^^^^^ LIBRARIES += -lfor endif ccseapps-2.5/CCSEApps/mk/Make.mpi0000644000175000017500000000405611634153073017657 0ustar amckinstryamckinstryifeq ($(MACHINE), OSF1) #MPI_HOME:=/usr/local/mpi MPI_HOME:=/usr/opt/mpi #BL_MPI_LIBS += -lmpich BL_MPI_LIBS += -lmpi -lpmpi LIBRARY_LOCATIONS += $(MPI_HOME)/lib INCLUDE_LOCATIONS += $(MPI_HOME)/include endif #ifeq ($(MACHINE), OSF1) # MPI_HOME:=/usr/local/mpi # BL_MPI_LIBS += -lmpich # LIBRARY_LOCATIONS += $(MPI_HOME)/lib # INCLUDE_LOCATIONS += $(MPI_HOME)/include #endif ifeq ($(MACHINE), AIX) MPI_HOME:=/usr/lpp/ppe.poe BL_MPI_LIBS += -lmpi LIBRARY_LOCATIONS += $(MPI_HOME)/lib INCLUDE_LOCATIONS += $(MPI_HOME)/include endif ifeq ($(MACHINE), IRIX64) BL_MPI_LIBS += -lmpi endif ifeq ($(MACHINE), Linux) ifdef aaWHICHLINUX ifeq ($(WHICHLINUX), PCCLUSTER) MPI_HOME=/usr/local/pkg/mpich LIBRARY_LOCATIONS += $(MPI_HOME)/lib/LINUX/ch_p4 INCLUDE_LOCATIONS += $(MPI_HOME)/lib/LINUX/ch_p4 endif ifeq ($(WHICHLINUX), ALPHACLUSTER) MPI_HOME=/usr/local/pkg/mpich LIBRARY_LOCATIONS += $(MPI_HOME)/build/LINUX/ch_p4/lib INCLUDE_LOCATIONS += $(MPI_HOME)/build/LINUX/ch_p4/include endif ifndef MPI_HOME MPI_HOME=/usr/local/mpich endif BL_MPI_LIBS += -lmpich ifeq ($(WHICHLINUX), GENERICLINUX) LIBRARY_LOCATIONS += $(MPI_HOME)/build/LINUX/ch_p4/lib endif else ifdef LAMHOME BL_MPI_LIBS += -lmpi -ltstdio -ltrillium -largs -lt LIBRARY_LOCATIONS += $(LAMHOME)/lib INCLUDE_LOCATIONS += $(LAMHOME)/include endif ifdef MPI_HOME BL_MPI_LIBS += -lmpich LIBRARY_LOCATIONS += $(MPI_HOME)/build/LINUX/ch_p4/lib INCLUDE_LOCATIONS += $(MPI_HOME)/include endif ifdef MPICHHOME mpicharch := $(shell $(MPICHHOME)/bin/tarch) mpichdevice := $(shell $(MPICHHOME)/bin/tdevice) BL_MPI_LIBS += -lmpich # 1.2.0 locations INCLUDE_LOCATIONS += $(MPICHHOME)/include LIBRARY_LOCATIONS += $(MPICHHOME)/lib # not needed in 1.2.0 # INCLUDE_LOCATIONS += $(MPICHHOME)/build/$(mpicharch)/$(mpichdevice)/include # LIBRARY_LOCATIONS += $(MPICHHOME)/build/$(mpicharch)/$(mpichdevice)/lib endif endif endif ccseapps-2.5/CCSEApps/mk/Make.OSF10000644000175000017500000000454511634153073017605 0ustar amckinstryamckinstry# # $Id: Make.OSF1,v 1.27 2002/05/23 18:21:10 vince Exp $ # # # Version 5.1 will NOT compile BoxLib. # SHELL := /bin/ksh UNAMER := $(shell uname -r) UNAMEN := $(shell uname -n) ifeq ($(MACHINE), OSF1) ifeq ($(findstring opal, $(UNAMEN)), opal) WHICHOSFMACH := opal endif endif # # We'd also like to distinguish between OSF1 versions 3 and 4 # ifeq ($(MACHINE), OSF1) ifeq ($(findstring V3, $(UNAMER)), V3) WHICHOSF1 := V3 endif ifeq ($(findstring V4, $(UNAMER)), V4) WHICHOSF1 := V4 endif endif ifeq ($(COMP),cxx) CXX := cxx FULLWARN := +pp -fullwarn CXXOPTF += -O3 -arch host -Olimit 2400 -no_exceptions CPPFLAGS += -D__USE_STD_IOSTREAM CXXDEBF += -g CXXPRFF := -p ifeq ($(WHICHOSF1),V3) override XTRALIBS += -lfor -lUfor -lFutil -lots -lm -lm_4sqrt else override XTRALIBS += -lfor -lUfor -lFutil -lots -lm endif # # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library. # override XTRADEFS += endif ifeq ($(COMP),KCC) CXX := KCC ifneq ($(CLOSELIB), TRUE) CXXLIBFLAGS := -tused -tlocal endif CXXPRFF := -p FULLWARN := --strict_warnings CXXOPTF += -O3 +K3 -g3 -arch host -Olimit 2400 --no_exceptions CXXDEBF += +K0 ifeq ($(WHICHOSF1),V3) override XTRALIBS += -lfor -lUfor -lFutil -lots -lm -lm_4sqrt else override XTRALIBS += -lfor -lUfor -lFutil -lots -lm endif ifeq ($(WHICHOSFMACH),opal) CXXFLAGS += -ieee endif # # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library. # override XTRADEFS += endif ifeq ($(COMP),g++) ifeq ($(WHICHOSF1),V3) override XTRALIBS += -lfor -lUfor -lFutil -lots -lm -lm_4sqrt else override XTRALIBS += -lfor -lUfor -lFutil -lots -lm endif # # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library. # override XTRADEFS += endif FC = f90 fC = $(FC) ifeq ($(PRECISION),FLOAT) FOPTF += -fast -O FDEBF += -g -u fOPTF += -fast -O fDEBF += -g else FOPTF += -fast -O -fpconstant FDEBF += -g -u -fpconstant fOPTF += -fast -O -fpconstant fDEBF += -g -fpconstant endif ifeq ($(USE_THREADS),TRUE) FOPTF += -automatic -reentrancy threaded FDEBF += -automatic -reentrancy threaded fOPTF += -automatic -reentrancy threaded fDEBF += -automatic -reentrancy threaded endif FFLAGS += -fpe3 fFLAGS += -fpe3 FPRFF += FORT_CPP = /usr/bin/cpp PURIFY = ccseapps-2.5/CCSEApps/mk/Make.AIX0000644000175000017500000000275511634153073017517 0ustar amckinstryamckinstry FORT_CPP = /usr/ccs/lib/cpp ifeq ($(COMP),xlC) CXX := xlC CXXOPTF += -O2 -qrtti=all -qsuppress=1500-029 -qmaxmem=-1 CXXDEBF += -g -qrtti=all endif ifeq ($(COMP),mpCC) CXX := mpCC CXXOPTF += -O2 -qrtti=all -qsuppress=1500-029 -qmaxmem=-1 CXXDEBF += -g -qrtti=all endif ifeq ($(COMP),KCC) CXX := KCC CXXOPTF += +K1 --no_exceptions --backend '-qmaxmem=-1' CXXDEBF += +K0 --no_exceptions endif ifeq ($(COMP),mpKCC) CXX := mpKCC CXXOPTF += +K1 --no_exceptions --backend '-qmaxmem=-1' CXXDEBF += +K0 --no_exceptions endif FC = xlf fC = $(FC) ifeq ($(PRECISION),FLOAT) FOPTF += -O2 -qarch=auto -qtune=auto -qmaxmem=-1 FDEBF += -g fOPTF += -O2 -qarch=auto -qtune=auto -qmaxmem=-1 fDEBF += -g else FOPTF += -O2 -qdpc -qarch=auto -qtune=auto -qmaxmem=-1 FDEBF += -qdpc -g fOPTF += -O2 -qdpc -qarch=auto -qtune=auto -qmaxmem=-1 fDEBF += -qdpc -g endif ifeq ($(AIXLARGEMEM),TRUE) CXXOPTF += -q64 CXXDEBF += -q64 FOPTF += -q64 FDEBF += -q64 fOPTF += -q64 fDEBF += -q64 LDFLAGS += -bmaxdata:0x1000000000 else LDFLAGS += -bmaxdata:0x80000000 endif ifeq ($(USE_THREADS),TRUE) FOPTF += -qnosave -qthreaded fOPTF += -qnosave -qthreaded FDEBF += -qnosave -qthreaded fDEBF += -qnosave -qthreaded CXXOPTF += -qthreaded CXXDEBF += -qthreaded endif COPTF += -O3 CDEBF += -g CPRFF += XTRALIBS += -lm -lxlf90 FORTLINK := LOWERCASE FORT_EXE_OUTPUT_OPTION = ; mv $*.o $(objEXETempDir)/$*.o FORT_LIB_OUTPUT_OPTION = ; mv $*.o $(objTempDir)/$*.o ccseapps-2.5/CCSEApps/mk/Make.CRAY0000644000175000017500000000165511634153073017632 0ustar amckinstryamckinstry FORT_CPP = cpp ifeq ($(COMP),CC) CXX := CC -h instantiate=local CXXOPTF += -O2 -h new_for_init CXXDEBF += -g -h new_for_init # # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library. # override XTRADEFS += -DBL_USE_SETBUF -DBL_SETBUF_SIGNED_CHAR override XTRADEFS += -DBL_COALESCE_FABS -DBL_OLD_STL endif ifeq ($(COMP),KCC) CXX := KCC CXXOPTF += +K2 CXXDEBF += +K0 # # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library. # override XTRADEFS += -DBL_SETBUF_SIGNED_CHAR -DBL_COALESCE_FABS endif FC = f90 -N 72 -e I FOPTF += -O,aggress,vector3 FDEBF += -g fC = $(FC) fOPTF += -O,aggress,vector3 fDEBF += -g COPTF += -O2 CDEBF += -g CPRFF += EXE_OUTPUT_OPTION = ; mv $*.o $(objEXETempDir)/$*.o LIB_OUTPUT_OPTION = ; mv $*.o $(objTempDir)/$*.o FORT_EXE_OUTPUT_OPTION = ; mv $*.o $(objEXETempDir)/$*.o FORT_LIB_OUTPUT_OPTION = ; mv $*.o $(objTempDir)/$*.o FORTLINK = UPPERCASE ccseapps-2.5/CCSEApps/mk/Make.CYGWIN_NT0000644000175000017500000000174311634153073020473 0ustar amckinstryamckinstry# Make for CYGWIN_NT ifeq ($(COMP),KCC) CXX = KCC # CXXOPTF += -O3 +K3 # CXXOPTF += -O2 +K2 CXXOPTF += -O1 +K1 CXXDEBF += +K0 FULLWARN := --strict_warnings endif FORT_CPP := gcc -E -traditional FC := g77 -fno-second-underscore fC := $(FC) ifeq ($(FCOMP),Fujitsu) FC := frt fC := $(FC) FDEBF += -H aesu FOPTF += -K fast fDEBF += -H aesu fOPTF += -K fast LIBRARY_LOCATIONS += /usr/FFC/lib override XTRALIBS += -lfj9f6 -lfj9i6 -lfj9e6 else ifeq ($(FCOMP),Absoft) #FC := f77 -f -B108 FC := f90 -B108 -YEXT_NAMES=LCS fC := $(FC) LIBRARY_LOCATIONS += /usr/absoft/lib override XTRALIBS += -lfio -lf77math #override FORTLINK := LOWERCASE else FOPTF += -O fOPTF += -O #DEFINES += -DBL_FORT_USE_UNDERSCORE #override XTRALIBS += -lf2c override XTRALIBS += -lg2c endif endif CXXPRFF += -pg FPRF += -pg override XTRALIBS += -lm FDEBF += -g fDEBF += -g #LIBRARY_LOCATIONS += /usr/local/pkg/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.1 ccseapps-2.5/CCSEApps/mk/Make.FreeBSD0000644000175000017500000000074411634153073020304 0ustar amckinstryamckinstry# Make for Linux FORT_CPP := gcc -E -traditional FC := f77 -fno-second-underscore fC := $(FC) # default g77 version FOPTF += -O fOPTF += -O FDEBF += -g fDEBF += -g #DEFINES += -DBL_FORT_USE_UNDERSCORE #override XTRALIBS += -lf2c # LIBRARY_LOCATIONS += /usr/lib/gcc-lib/i386-redhat-linux/2.96 override XTRALIBS += -lg2c FDEBF += -ffortran-bounds-check # FDEBF += -Wimplicit fDEBF += -ffortran-bounds-check CXXPRFF += -pg FPRF += -pg override XTRALIBS += -lm ccseapps-2.5/CCSEApps/mk/Make.IRIX640000644000175000017500000000270411634153073020015 0ustar amckinstryamckinstryFORT_CPP = /usr/lib/acpp ifeq ($(WHICHIRIX64), ESCHER) XTRALIBS += /usr/lib64/libfortran.so endif ifeq ($(WHICHIRIX64), MAHLER) XTRALIBS += /usr/lib32/libfortran.so endif ifeq ($(COMP),CC) CXX := CC -ptused -LANG:ansi-for-init-scope=ON CXXOPTF += -O2 -OPT:Olimit=4800 CXXDEBF += -g # # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library. # XTRALIBS += -lftn -lm -lXm -lXt -lX11 -lm ifeq ($(WHICHIRIX64), ERC2000) XTRAINCLOC += /usr/include/X11 /usr/lib/Xm else XTRAINCLOC += /usr/include/X11 /usr/include/Xm endif override XTRADEFS += -DBL_USE_SETBUF -DBL_OLD_STL endif ifeq ($(COMP),KCC) CXX := KCC CXXOPTF += +K2 CXXDEBF += +K0 FORT_CPP = KCC -E # # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library. # endif ifeq ($(WHICHIRIX64), ESCHER) FC = f90 -64 fC = $(FC) FOPTF += -O2 -OPT:Olimit=4800 fOPTF += -O2 -OPT:Olimit=4800 else ifeq ($(WHICHIRIX64), MAHLER) FC = f90 -r8 -IPA fC = $(FC) FOPTF += -Ofast=ip30 -OPT:Olimit=4800 fOPTF += -Ofast=ip30 -OPT:Olimit=4800 else FC = f77 -64 fC = $(FC) FOPTF += -g3 -Ofast=ip27 fOPTF += -g3 -Ofast=ip27 endif endif FDEBF += -g fDEBF += -g COPTF += -O CDEBF += -g CPRFF += OUTPUT_OPTION = ; mv $*.o $(objTempDir)/$*.o FORTPREP = perl $(PBOXLIB_HOME)/scripts/strip72 -c FORT_OUTPUT_OPTION = ; mv $*.o $(objTempDir)/$*.o ifeq ($(WHICHIRIX64), MAHLER) LDFLAGS += -IPA endif ccseapps-2.5/CCSEApps/bndrylib/0000755000175000017500000000000011634153073017464 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/bndrylib/Banner.html0000644000175000017500000000056711634153073021567 0ustar amckinstryamckinstry

Problems with this Web page should be sent to webmaster@mothra.lbl.gov

Bugs in the software should be sent to guthamr-bugs@mothra.lbl.gov

(C)opyright by Lawrence Berkeley National Laboratory ccseapps-2.5/CCSEApps/bndrylib/Make.package0000644000175000017500000000073011634153073021656 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.1 1998/10/28 17:49:32 lijewski Exp $ # BNDRYLIB_BASE=EXE ifeq ($(LBASE),bndry) BNDRYLIB_BASE=LIB endif C$(BNDRYLIB_BASE)_sources += FabSet.cpp BndryRegister.cpp \ Geometry.cpp CoordSys.cpp RealBox.cpp C$(BNDRYLIB_BASE)_headers += FabSet.H BndryRegister.H \ Geometry.H CoordSys.H RealBox.H F$(BNDRYLIB_BASE)_headers += COORDSYS_F.H F$(BNDRYLIB_BASE)_sources += COORDSYS_$(DIM)D.F ccseapps-2.5/CCSEApps/bndrylib/BndryRegister.cpp0000644000175000017500000001671011634153073022760 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BndryRegister.cpp,v 1.15 2002/08/21 20:12:40 car Exp $ // #include #include #include const Real BL_SAFE_BOGUS = -666.e200; BndryRegister::BndryRegister () {} BndryRegister::~BndryRegister () {} BndryRegister::BndryRegister (const BoxArray& grids, int in_rad, int out_rad, int extent_rad, int ncomp) : grids(grids) { BL_ASSERT(ncomp > 0); BL_ASSERT(grids[0].cellCentered()); for (OrientationIter face; face; ++face) { define(face(),IndexType::TheCellType(),in_rad,out_rad,extent_rad,ncomp); } } void BndryRegister::init (const BndryRegister& src) { grids.define(src.grids); for (int i = 0; i < 2*BL_SPACEDIM; i++) { bndry[i].define(src.bndry[i].boxArray(), src.bndry[i].nComp()); for (FabSetIter mfi(src.bndry[i]); mfi.isValid(); ++mfi) { bndry[i][mfi.index()].copy(src.bndry[i][mfi]); } } } BndryRegister::BndryRegister (const BndryRegister& src) { init(src); } const BoxArray& BndryRegister::boxes () const { return grids; } int BndryRegister::size () const { return grids.size(); } const FabSet& BndryRegister::operator[] (const Orientation& _face) const { return bndry[_face]; } FabSet& BndryRegister::operator[] (const Orientation& _face) { return bndry[_face]; } BndryRegister& BndryRegister::operator= (const BndryRegister& src) { if (grids.size() > 0) { grids.clear(); for (int i = 0; i < 2*BL_SPACEDIM; i++) bndry[i].clear(); } init(src); return *this; } void BndryRegister::define (const Orientation& _face, const IndexType& _typ, int _in_rad, int _out_rad, int _extent_rad, int _ncomp) { BL_ASSERT(grids.size() > 0); FabSet& fabs = bndry[_face]; BL_ASSERT(fabs.size() == 0); const int coord_dir = _face.coordDir(); const int lo_side = _face.isLow(); // // Build the BoxArray on which to define the FabSet on this face. // BoxArray fsBA(grids.size()); for (int idx = 0; idx < grids.size(); ++idx) { Box b; // // First construct proper box for direction normal to face. // if (_out_rad > 0) { if (_typ.ixType(coord_dir) == IndexType::CELL) b = BoxLib::adjCell(grids[idx], _face, _out_rad); else b = BoxLib::bdryNode(grids[idx], _face, _out_rad); if (_in_rad > 0) b.grow(_face.flip(), _in_rad); } else { if (_in_rad > 0) { if (_typ.ixType(coord_dir) == IndexType::CELL) b = BoxLib::adjCell(grids[idx], _face, _in_rad); else b = BoxLib::bdryNode(grids[idx], _face, _in_rad); b.shift(coord_dir, lo_side ? _in_rad : -_in_rad); } else BoxLib::Error("BndryRegister::define(): strange values for in_rad, out_rad"); } // // Now alter box in all other index directions. // for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (dir == coord_dir) continue; if (_typ.ixType(dir) == IndexType::NODE) b.surroundingNodes(dir); if (_extent_rad > 0) b.grow(dir,_extent_rad); } BL_ASSERT(b.ok()); fsBA.set(idx,b); } BL_ASSERT(fsBA.ok()); fabs.define(fsBA,_ncomp); // // Go ahead and assign values to the boundary register fabs // since in some places APPLYBC (specifically in the tensor // operator) the boundary registers are used for a few calculations // before the masks are tested to see if you need them. // fabs.setVal(BL_SAFE_BOGUS); } void BndryRegister::setBoxes (const BoxArray& _grids) { BL_ASSERT(grids.size() == 0); BL_ASSERT(_grids.size() > 0); BL_ASSERT(_grids[0].cellCentered()); grids.define(_grids); // // Check that bndry regions are not allocated. // for (int k = 0; k < 2*BL_SPACEDIM; k++) BL_ASSERT(bndry[k].size() == 0); } void BndryRegister::setVal (Real v) { for (OrientationIter face; face; ++face) { bndry[face()].setVal(v); } } BndryRegister& BndryRegister::linComb (Real a, const MultiFab& mfa, int a_comp, Real b, const MultiFab& mfb, int b_comp, int dest_comp, int num_comp, int n_ghost) { for (OrientationIter face; face; ++face) { bndry[face()].linComb(a, mfa, a_comp, b, mfb, b_comp, dest_comp, num_comp, n_ghost); } return *this; } BndryRegister& BndryRegister::copyFrom (const MultiFab& src, int nghost, int src_comp, int dest_comp, int num_comp) { for (OrientationIter face; face; ++face) { bndry[face()].copyFrom(src,nghost,src_comp,dest_comp,num_comp); } return *this; } BndryRegister& BndryRegister::plusFrom (const MultiFab& src, int nghost, int src_comp, int dest_comp, int num_comp) { for (OrientationIter face; face; ++face) { bndry[face()].plusFrom(src,nghost,src_comp,dest_comp,num_comp); } return *this; } ccseapps-2.5/CCSEApps/bndrylib/Geometry.H0000644000175000017500000001542411634153073021376 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GEOMETRY_H_ #define _GEOMETRY_H_ // // $Id: Geometry.H,v 1.41 2002/12/03 18:35:38 lijewski Exp $ // #include #include #include #include #include #include struct FPB; // //@Man: //@Memo: Rectangular problem domain geometry. /*@Doc: This class describes problem domain and coordinate system for RECTANGULAR problem domains. Since the problem domain is RECTANGULAR, periodicity is meaningful. */ class Geometry : public CoordSys { public: // //@ManDoc: The default constructor. // Geometry (); // //@ManDoc: Constructor taking the rectangular domain. // //explicit Geometry (const Box& dom); Geometry (const Box& dom, const RealBox* rb = 0, int coord = -1); // //@ManDoc: The copy constructor. // Geometry (const Geometry& g); // //@ManDoc: The destructor. // ~Geometry(); // //@ManDoc: Read static values from ParmParse database. // static void Setup (const RealBox* rb = 0, int coord = -1); // //@ManDoc: Set the rectangular domain after using default constructor. // void define (const Box& dom, const RealBox* rb = 0, int coord = -1); // //@ManDoc: Returns the problem domain. // static const RealBox& ProbDomain (); // //@ManDoc: Sets the problem domain. // static void ProbDomain (const RealBox& rb); // //@ManDoc: Returns the lo end of the problem domain in each dimension. // static const Real* ProbLo (); // //@ManDoc: Returns the hi end of the problem domain in each dimension. // static const Real* ProbHi (); // //@ManDoc: Returns the lo end of the problem domain in specified direction. // static Real ProbLo (int dir); // //@ManDoc: Returns the hi end of the problem domain in specified direction. // static Real ProbHi (int dir); // //@ManDoc: Returns length of problem domain in each dimension. // static const Real* ProbLength (); // //@ManDoc: Returns length of problem domain in specified dimension. // static Real ProbLength (int dir); // //@ManDoc: Returns our rectangular domain. // const Box& Domain () const; // //@ManDoc: Sets our rectangular domain. // void Domain (const Box& bx); // //@ManDoc: Define a multifab of areas and volumes with given grow factor. // void GetVolume (MultiFab& vol, const BoxArray& grds, int grow) const; /*@ManDoc: Compute d(log(A))/dr at cell centers in given region and stuff the results into the passed MultiFab. */ void GetDLogA (MultiFab& dloga, const BoxArray& grds, int dir, int grow) const; /*@ManDoc: Compute area of cell faces in given region and stuff stuff the results into the passed MultiFab. */ void GetFaceArea (MultiFab& area, const BoxArray& grds, int dir, int grow) const; // //@ManDoc: Is the domain periodic in the specified direction? // static bool isPeriodic (int dir); // //@ManDoc: Is domain periodic in any direction? // static bool isAnyPeriodic (); // //@ManDoc: What's period in specified direction? // int period (int dir) const; /*@ManDoc: Compute Array of shifts which will translate src so that it will intersect target with non-zero intersection. the array will be resized internally, so anything previously there will be gone DO NOT return non-periodic shifts, even if the box's do intersect without shifting. The logic is that you will only do this as a special case if there is some periodicity. */ void periodicShift (const Box& target, const Box& src, Array& out) const; // //@ManDoc: Fill ghost cells of all components with periodic data. // void FillPeriodicBoundary (MultiFab& mf, bool do_corners = false) const; // //@ManDoc: Fill ghost cells of selected components with periodic data. // void FillPeriodicBoundary (MultiFab& mf, int src_comp, int num_comp, bool do_corners = false) const; // //@ManDoc: Flush the cache of PIRM information. // static void FlushPIRMCache (); // //@ManDoc: The size of the PIRM cache. // static int PIRMCacheSize (); protected: // // Helper functions. // void read_params (); // // Helper functions for FillPeriodicBoundary(). // FPB& getFPB (MultiFab& mf, const FPB& fpb, int scomp, int ncomp) const; FPB& buildFPB (MultiFab& mf, const FPB& fpb) const; // // Static data. // static int spherical_origin_fix; static bool is_periodic[BL_SPACEDIM]; // 0 means not periodic static RealBox prob_domain; // // Non-static data. // Box domain; }; // //@ManDoc: Nice ASCII output. // std::ostream& operator<< (std::ostream&, const Geometry&); // //@ManDoc: Nice ASCII input. // std::istream& operator>> (std::istream&, Geometry&); #endif /*_GEOMETRY_H_*/ ccseapps-2.5/CCSEApps/bndrylib/RealBox.H0000644000175000017500000001031711634153073021133 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _RealBox_H_ #define _RealBox_H_ // // $Id: RealBox.H,v 1.11 2001/08/01 21:50:50 lijewski Exp $ // #include #include #include #include // //@Man: //@Memo: A Real Box /*@Doc: A Box with real dimensions. A RealBox is OK iff volume > 0. */ class RealBox { public: // //@ManDoc: The default constructor. Builds invalid RealBox. // RealBox (); // //@ManDoc: Construct region given diagonal points. // RealBox (const Real* lo, const Real* hi); /*@ManDoc: Construct region given index box, cell spacing and physical location of index (0,0,0). */ RealBox (const Box& bx, const Real* dx, const Real* base); // //@ManDoc: Explicit dimension specific constructors. // RealBox (D_DECL(Real x0, Real y0, Real z0), D_DECL(Real x1, Real y1, Real z1)); // //@ManDoc: Set epsilon used by contains() function when comparing floating point numbers. // static void setEpsilon (Real epsilon); // //@ManDoc: Returns epsilon. // static Real epsilon (); // //@ManDoc: Returns lo side. // const Real* lo () const; // //@ManDoc: Returns hide side. // const Real* hi () const; // //@ManDoc: Returns length in each direction. // const Real* length () const; // //@ManDoc: Returns length in specified direction. // Real lo (int dir) const; // //@ManDoc: Returns hi side in specified direction. // Real hi (int dir) const; // //@ManDoc: Returns length in specified direction. // Real length (int dir) const; // //@ManDoc: Sets lo side. // void setLo (const Real* lo); // //@ManDoc: Sets lo side. // void setLo (const Array& lo); // //@ManDoc: Sets lo side in specified direction. // void setLo (int dir, Real lo); // //@ManDoc: Sets hi side. // void setHi (const Real* hi); // //@ManDoc: Sets hi side. // void setHi (const Array& hi); // //@ManDoc: Sets hi side in specified direction. // void setHi (int dir, Real hi); // //@ManDoc: Is the RealBox OK; i.e. does it have positive volume? // bool ok () const; // //@ManDoc: Is the specified point contained in the RealBox? // bool contains (const Real* point) const; // //@ManDoc: Is the specified RealBox contained in this RealBox? // bool contains (const RealBox& bx) const; protected: // // Helper function. // void computeBoxLen (); // // The data. // Real xlo[BL_SPACEDIM]; Real xhi[BL_SPACEDIM]; Real len[BL_SPACEDIM]; // // Static data. // static Real eps; }; // //@ManDoc: Nice ASCII output. // std::ostream& operator<< (std::ostream&, const RealBox&); // //@ManDoc: Nice ASCII input. // std::istream& operator>> (std::istream&, RealBox&); #endif /*_RealBox_H_*/ ccseapps-2.5/CCSEApps/bndrylib/GNUmakefile0000644000175000017500000000405211634153073021537 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.8 1999/05/24 18:11:44 car Exp $ # PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) PRECISION = DOUBLE DEBUG = TRUE DIM = 3 COMP = KCC USE_MPI = TRUE # # The base name of the library we're building. # LBASE = bndry # # Where libraries and include files will be installed. # INSTALL_ROOT = $(TOP) include $(TOP)/mk/Make.defs ./Make.package INCLUDE_LOCATIONS += $(TOP)/include ifeq ($(KCC_VERSION),3.3) CXXFLAGS += --one_instantiation_per_object endif # # Libraries to close against. # ifeq ($(COMP), KCC) LibsToCloseAgainst := $(TOP)/lib/$(machineSuffix)/libbox$(DIM)d.a endif all: $(optionsLib) # # `install' does NOT try to build and install the HTML stuff. # doc++ isn't widely distributed enough to assume that. # For now you must invoke `install_html' separately. # install: all include $(TOP)/mk/Make.rules # # Temp stuff for doing html docs. # _docHeaders := $(sort $(wildcard *.H)) _htmlDir := html # # This will make the HTML files in the directory html provided # any of the relevant .H files have changed more recently than the # directory itself. # html: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ $(RM) -r $(_htmlDir); \ mkdir -p $(_htmlDir); \ doc++ -f -j -B Banner.html -d $(_htmlDir) $(_docHeaders); \ fi BndryLib.tex: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ doc++ -f -t -j -o BndryLib.tex -ep docxx_squish $(_docHeaders); \ sed '/[\]usepackage[{]docxx[}]/d' < BndryLib.tex > .junk; \ mv .junk BndryLib.tex; \ fi BndryLib.dvi: BndryLib.tex latex BndryLib.tex; latex BndryLib.tex BndryLib.ps: BndryLib.dvi dvips BndryLib.dvi -o BndryLib.ps # # Install the PostScript file into $(INSTALL_ROOT)/ps # install_ps: BndryLib.ps -if [ ! -d $(INSTALL_ROOT)/ps ]; then \ mkdir -p $(INSTALL_ROOT)/ps; \ chmod 755 $(INSTALL_ROOT)/ps; \ fi $(INSTALL_DATA) BndryLib.ps $(INSTALL_ROOT)/ps ccseapps-2.5/CCSEApps/bndrylib/FabSet.cpp0000644000175000017500000003474511634153073021351 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: FabSet.cpp,v 1.43 2002/12/11 17:05:25 lijewski Exp $ // #include #include #include #include FabSetIter::FabSetIter (const FabSet& fabset) : MFIter(fabset) {} FabSetIter::~FabSetIter () {} FabSetCopyDescriptor::FabSetCopyDescriptor () : MultiFabCopyDescriptor() {} FabSetCopyDescriptor::~FabSetCopyDescriptor () {} FabSetId FabSetCopyDescriptor::RegisterFabSet (FabSet* fabset) { return RegisterMultiFab(fabset); } FabSet::FabSet () {} FabSet::~FabSet () {} FabSet::FabSet (const BoxArray& grids, int ncomp) : MultiFab(grids,ncomp,0,Fab_allocate) {} void FabSet::define (const BoxArray& grids, int ncomp) { MultiFab* tmp = this; tmp->define(grids, ncomp, 0, Fab_allocate); } const FabSet& FabSet::copyTo (FArrayBox& dest) const { copy(dest); return *this; } const FabSet& FabSet::copyTo (FArrayBox& dest, int src_comp, int dest_comp, int num_comp) const { copy(dest,src_comp,dest_comp,num_comp); return *this; } const FabSet& FabSet::copyTo (FArrayBox& dest, const Box& subbox, int src_comp, int dest_comp, int num_comp) const { copy(dest,subbox,src_comp,dest_comp,num_comp); return *this; } void FabSet::copyTo (MultiFab& dest) const { dest.copy(*this); } FabSet& FabSet::copyFrom (const FabSet& src) { copy(src); return *this; } FabSet& FabSet::copyFrom (const FabSet& src, int src_comp, int dest_comp, int num_comp) { copy(src,src_comp,dest_comp,num_comp); return *this; } // // The following are different from MultiFab only in the return value // FabSet& FabSet::plus (Real v, int comp, int num_comp) { MultiFab* tmp = this; tmp->plus(v, comp, num_comp); return *this; } FabSet& FabSet::plus (Real v, const Box& subreg, int comp, int num_comp) { MultiFab* tmp = this; tmp->plus(v, subreg, comp, num_comp); return *this; } FabSet& FabSet::mult (Real v, int comp, int num_comp) { MultiFab* tmp = this; tmp->mult(v, comp, num_comp); return *this; } FabSet& FabSet::mult (Real v, const Box& subreg, int comp, int num_comp) { MultiFab* tmp = this; tmp->mult(v, subreg, comp, num_comp); return *this; } FabSet& FabSet::copyFrom (const FArrayBox& src) { for (FabSetIter fsi(*this); fsi.isValid(); ++fsi) { get(fsi).copy(src); } return *this; } FabSet& FabSet::copyFrom (const FArrayBox& src, int src_comp, int dest_comp, int num_comp) { for (FabSetIter fsi(*this); fsi.isValid(); ++fsi) { get(fsi).copy(src,src_comp,dest_comp,num_comp); } return *this; } FabSet& FabSet::copyFrom (const FArrayBox& src, const Box& subbox, int src_comp, int dest_comp, int num_comp) { BL_ASSERT(src.box().contains(subbox)); for (FabSetIter fsi(*this); fsi.isValid(); ++fsi) { Box dbox = get(fsi).box() & subbox; if (dbox.ok()) { get(fsi).copy(src,dbox,src_comp,dbox,dest_comp,num_comp); } } return *this; } // // Used in caching CollectData() stuff for copyFrom() and plusFrom(). // struct FSRec { FSRec (); FSRec (const BoxArray& src, const BoxArray& dst, int ngrow); FSRec (const FSRec& rhs); ~FSRec (); bool operator== (const FSRec& rhs) const; bool operator!= (const FSRec& rhs) const; std::vector m_box; std::vector m_mfidx; std::vector m_fsidx; Array m_snds; CommDataCache m_commdata; BoxArray m_src; BoxArray m_dst; int m_ngrow; }; FSRec::FSRec () : m_ngrow(-1) {} FSRec::FSRec (const BoxArray& src, const BoxArray& dst, int ngrow) : m_src(src), m_dst(dst), m_ngrow(ngrow) { BL_ASSERT(ngrow >= 0); } FSRec::FSRec (const FSRec& rhs) : m_box(rhs.m_box), m_mfidx(rhs.m_mfidx), m_fsidx(rhs.m_fsidx), m_snds(rhs.m_snds), m_commdata(rhs.m_commdata), m_src(rhs.m_src), m_dst(rhs.m_dst), m_ngrow(rhs.m_ngrow) {} FSRec::~FSRec () {} bool FSRec::operator== (const FSRec& rhs) const { return m_ngrow == rhs.m_ngrow && m_src == rhs.m_src && m_dst == rhs.m_dst; } bool FSRec::operator!= (const FSRec& rhs) const { return !operator==(rhs); } // // A useful typedef. // typedef std::list FSRecList; // // Cache of FSRec info. // static FSRecList TheCache; void FabSet::FlushCache () { TheCache.clear(); } static FSRec& TheFSRec (const MultiFab& src, const FabSet& dst, int ngrow, int scomp, int ncomp) { BL_ASSERT(ngrow >= 0); BL_ASSERT(scomp >= 0); BL_ASSERT(ncomp > 0); const FSRec rec(src.boxArray(),dst.boxArray(),ngrow); for (FSRecList::iterator it = TheCache.begin(); it != TheCache.end(); ++it) { if (*it == rec) { // // Adjust the ncomp & scomp in CommData. // Array& cd = (*it).m_commdata.theCommData(); for (int i = 0; i < cd.size(); i++) { cd[i].nComp(ncomp); cd[i].srcComp(scomp); } return *it; } } TheCache.push_front(rec); // // Calculate and cache intersection info. // for (FabSetIter fsi(dst); fsi.isValid(); ++fsi) { for (int i = 0; i < src.size(); i++) { Box ovlp = dst[fsi].box() & BoxLib::grow(src.boxArray()[i],ngrow); if (ovlp.ok()) { TheCache.front().m_box.push_back(ovlp); // // Maintain parallel array of indices into MultiFab. // TheCache.front().m_mfidx.push_back(i); // // Maintain parallel array of indices into FabSet. // TheCache.front().m_fsidx.push_back(fsi.index()); } } } return TheCache.front(); } void FabSet::DoIt (const MultiFab& src, int ngrow, int scomp, int dcomp, int ncomp, How how) { BL_ASSERT((dcomp+ncomp) <= nComp()); BL_ASSERT((scomp+ncomp) <= src.nComp()); BL_ASSERT(how == FabSet::COPYFROM || how == FabSet::PLUSFROM); FArrayBox tmp; FabSetCopyDescriptor fscd; std::vector fbids; const int MyProc = ParallelDescriptor::MyProc(); FSRec& fsrec = TheFSRec(src,*this,ngrow,scomp,ncomp); MultiFabId mfid = fscd.RegisterFabArray(const_cast(&src)); BL_ASSERT(fsrec.m_box.size() == fsrec.m_mfidx.size()); BL_ASSERT(fsrec.m_box.size() == fsrec.m_fsidx.size()); for (int i = 0; i < fsrec.m_box.size(); i++) { fbids.push_back(fscd.AddBox(mfid, fsrec.m_box[i], 0, fsrec.m_mfidx[i], scomp, how == COPYFROM ? dcomp : 0, ncomp, false)); BL_ASSERT(fbids.back().box() == fsrec.m_box[i]); // // Also save the index of our FAB needing filling. // fbids.back().FabIndex(fsrec.m_fsidx[i]); } fscd.CollectData(&fsrec.m_snds, &fsrec.m_commdata); for (int i = 0; i < fbids.size(); i++) { BL_ASSERT(DistributionMap()[fbids[i].FabIndex()] == MyProc); if (how == COPYFROM) { fscd.FillFab(mfid,fbids[i],(*this)[fbids[i].FabIndex()]); } else { tmp.resize(fbids[i].box(), ncomp); fscd.FillFab(mfid, fbids[i], tmp); (*this)[fbids[i].FabIndex()].plus(tmp,tmp.box(),0,dcomp,ncomp); } } } FabSet& FabSet::copyFrom (const MultiFab& src, int ngrow, int scomp, int dcomp, int ncomp) { DoIt(src,ngrow,scomp,dcomp,ncomp,FabSet::COPYFROM); return *this; } FabSet& FabSet::plusFrom (const MultiFab& src, int ngrow, int scomp, int dcomp, int ncomp) { DoIt(src,ngrow,scomp,dcomp,ncomp,FabSet::PLUSFROM); return *this; } // // Linear combination this := a*this + b*src // Note: corresponding fabsets must be commensurate. // FabSet& FabSet::linComb (Real a, Real b, const FabSet& src, int scomp, int dcomp, int ncomp) { BL_ASSERT(size() == src.size()); for (FabSetIter fsi(*this); fsi.isValid(); ++fsi) { BL_ASSERT(get(fsi).box() == src[fsi].box()); // // WARNING: same fab used as src and dest here. // get(fsi).linComb(get(fsi), get(fsi).box(), dcomp, src[fsi], src[fsi].box(), scomp, a, b, get(fsi).box(), dcomp, ncomp); } return *this; } FabSet& FabSet::linComb (Real a, const MultiFab& mfa, int a_comp, Real b, const MultiFab& mfb, int b_comp, int dcomp, int ncomp, int ngrow) { BL_ASSERT(ngrow <= mfa.nGrow()); BL_ASSERT(ngrow <= mfb.nGrow()); const BoxArray& bxa = mfa.boxArray(); const BoxArray& bxb = mfb.boxArray(); BL_ASSERT(bxa == bxb); MultiFabCopyDescriptor mfcd; MultiFabId mfid_mfa = mfcd.RegisterFabArray(const_cast(&mfa)); MultiFabId mfid_mfb = mfcd.RegisterFabArray(const_cast(&mfb)); std::vector fbids_mfa, fbids_mfb; for (FabSetIter fsi(*this); fsi.isValid(); ++fsi) { for (int grd = 0; grd < bxa.size(); grd++) { Box ovlp = get(fsi).box() & BoxLib::grow(bxa[grd],ngrow); if (ovlp.ok()) { fbids_mfa.push_back(mfcd.AddBox(mfid_mfa, ovlp, 0, grd, a_comp, 0, ncomp, false)); BL_ASSERT(fbids_mfa.back().box() == ovlp); // // Also save the index of the FAB in the FabSet. // fbids_mfa.back().FabIndex(fsi.index()); fbids_mfb.push_back(mfcd.AddBox(mfid_mfb, ovlp, 0, grd, b_comp, 0, ncomp, false)); BL_ASSERT(fbids_mfb.back().box() == ovlp); } } } mfcd.CollectData(); FArrayBox a_fab, b_fab; const int MyProc = ParallelDescriptor::MyProc(); BL_ASSERT(fbids_mfa.size() == fbids_mfb.size()); for (int i = 0; i < fbids_mfa.size(); i++) { a_fab.resize(fbids_mfa[i].box(), ncomp); b_fab.resize(fbids_mfb[i].box(), ncomp); mfcd.FillFab(mfid_mfa, fbids_mfa[i], a_fab); mfcd.FillFab(mfid_mfb, fbids_mfb[i], b_fab); BL_ASSERT(DistributionMap()[fbids_mfa[i].FabIndex()] == MyProc); (*this)[fbids_mfa[i].FabIndex()].linComb(a_fab, fbids_mfa[i].box(), 0, b_fab, fbids_mfa[i].box(), 0, a, b, fbids_mfa[i].box(), dcomp, ncomp); } return *this; } ccseapps-2.5/CCSEApps/bndrylib/COORDSYS_F.H0000644000175000017500000000575411634153073021322 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _COORDSYS_F_H_ #define _COORDSYS_F_H_ /* ** $Id: COORDSYS_F.H,v 1.9 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_SETVOL setvol # define FORT_SETVOLPT setvolpt # define FORT_SETAREA setarea # define FORT_SETDLOGA setdloga #else # ifdef BL_FORT_USE_UPPERCASE # define FORT_SETVOL SETVOL # define FORT_SETVOLPT SETVOLPT # define FORT_SETAREA SETAREA # define FORT_SETDLOGA SETDLOGA # else # ifdef BL_FORT_USE_LOWERCASE # define FORT_SETVOL setvol # define FORT_SETVOLPT setvolpt # define FORT_SETAREA setarea # define FORT_SETDLOGA setdloga # else # define FORT_SETVOL setvol_ # define FORT_SETVOLPT setvolpt_ # define FORT_SETAREA setarea_ # define FORT_SETDLOGA setdloga_ # endif # endif #include "ArrayLim.H" extern "C" { void FORT_SETVOL (Real* vol, ARLIM_P(vlo), ARLIM_P(vhi), const Real* offset, const Real* dx, const int* coord); void FORT_SETVOLPT (Real* vol, ARLIM_P(vollo), ARLIM_P(volhi), Real* rolo, ARLIM_P(rolo), ARLIM_P(rohi), Real* rilo, ARLIM_P(rilo), ARLIM_P(rihi), const Real* dx, const int* coord); void FORT_SETDLOGA (Real* vol, ARLIM_P(vlo), ARLIM_P(vhi), const Real* offset, const Real* dx, const int* dir, const int* coord); void FORT_SETAREA (Real* area, ARLIM_P(alo), ARLIM_P(ahi), const Real* offset, const Real* dx, const int* dir, const int* coord); } #endif #endif /*_COORDSYS_F_H_*/ ccseapps-2.5/CCSEApps/bndrylib/COORDSYS_3D.F0000644000175000017500000001222511634153073021370 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: COORDSYS_3D.F,v 1.8 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "COORDSYS_F.H" #include "ArrayLim.H" #define SDIM 3 c :: ---------------------------------------------------------- c :: SETVOL c :: Compute the volume of each cell c :: c :: INPUTS / OUTPUTS: c :: vol <= volume array c :: vlo,vhi => index limits of vol array c :: offset => shift to origin of computational domain c :: dx => cell size c :: coord => coordinate flag (0 = cartesian, 1 = RZ) c :: ---------------------------------------------------------- c :: subroutine FORT_SETVOL(vol,DIMS(vol),offset,dx,coord) integer DIMDEC(vol) integer coord REAL_T dx(SDIM), offset(SDIM) REAL_T vol(DIMV(vol)) integer i, j, k REAL_T ri, ro, v if (coord .eq. 0) then c c ::::: cartesian c v = dx(1)*dx(2)*dx(3) do k = ARG_L3(vol), ARG_H3(vol) do j = ARG_L2(vol), ARG_H2(vol) do i = ARG_L1(vol), ARG_H1(vol) vol(i,j,k) = v end do end do end do else write(6,*) "FORT_SETVOLUME not define for coord = ",coord call bl_abort(" ") end if end c :: ---------------------------------------------------------- c :: SETAREA c :: Compute the area of given cell face c :: c :: INPUTS / OUTPUTS: c :: area <= area array c :: alo,ahi => index limits of area array c :: offset => shift to origin of computational domain c :: dx => cell size c :: coord => coordinate flag (0 =cartesian, 1 = RZ) c :: ---------------------------------------------------------- c :: subroutine FORT_SETAREA(area,DIMS(area),offset,dx,dir,coord) integer DIMDEC(area) integer coord, dir REAL_T dx(SDIM), offset(SDIM) REAL_T area(DIMV(area)) integer i, j, k REAL_T fa if (coord .eq. 0) then if (dir .eq. 0) then fa = dx(2)*dx(3) else if (dir .eq. 1) then fa = dx(1)*dx(3) else if (dir .eq. 2) then fa = dx(1)*dx(2) else write(6,*) "FORT_SETAREA: invalid dir = ",dir call bl_abort(" ") end if do k = ARG_L3(area), ARG_H3(area) do j = ARG_L2(area), ARG_H2(area) do i = ARG_L1(area), ARG_H1(area) area(i,j,k) = fa end do end do end do else write(6,*) "FORT_SETAREA not define for coord = ",coord call bl_abort(" ") end if end c :: SETDLOGA c :: Compute d(log(A))/dr in each cell c :: c :: INPUTS / OUTPUTS: c :: dloga <= dloga array c :: dlo,dhi => index limits of dloga array c :: offset => shift to origin of computational domain c :: dx => cell size c :: coord => coordinate flag (0 = cartesian, 1 = RZ) c :: ---------------------------------------------------------- c :: subroutine FORT_SETDLOGA(dloga,DIMS(dloga),offset,dx,dir,coord) integer DIMDEC(dloga) integer coord REAL_T dx(SDIM), offset(SDIM) REAL_T dloga(DIMV(dloga)) integer dir integer i, j, k REAL_T ri, ro, dlga, po, pi if (coord .eq. 0) then c c ::::: cartesian c do k = ARG_L3(dloga), ARG_H3(dloga) do j = ARG_L2(dloga), ARG_H2(dloga) do i = ARG_L1(dloga), ARG_H1(dloga) dloga(i,j,k) = zero end do end do enddo else write(6,*)' non-cartesian not allowed in 3D yet' call bl_abort(" ") endif return end ccseapps-2.5/CCSEApps/bndrylib/FabSet.H0000644000175000017500000002400111634153073020736 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _FABSET_H_ #define _FABSET_H_ // // $Id: FabSet.H,v 1.19 2001/08/01 21:50:50 lijewski Exp $ // #include //@Man: /*@Memo: A FabSet is a group of FArrayBox's. The grouping is designed specifically to represent regions along the boundary of Box's, and are used to implement boundary conditions to discretized partial differential equations. */ /*@Doc: A FabSet is an array of pointers to FABs. The standard FAB operators, however, have been modified to be more useful for maintaining boundary conditions for partial differential equations discretized on boxes. Under normal circumstances, a FAB will be created for each face of a box. For a group of boxes, a FabSet will be the group of FABs at a particular orientation (ie. the lo-i side of each grid in a list). Since a FabSet FAB will likely be used to bound a grid box, FArrayBox::resize() operations are disallowed. Also, to preserve flexibility in applicable boundary scenarios, intersecting FABs in the FabSet are not guaranteed to contain identical data--thus copy operations from a FabSet to any FAB-like structure may be order-dependent. FabSets are used primarily as a data storage mechanism, and are manipulated by more sophisticated control classes. */ class FabSet : private MultiFab { public: // //@ManDoc: The default constructor -- you must later call define(). // FabSet (); // //@ManDoc: Construct a FabSet of specified number of components on // the grids. // FabSet (const BoxArray& grids, int ncomp); // //@ManDoc: The destructor. // virtual ~FabSet (); // //@ManDoc: Define a FabSet constructed via default constructor. // void define (const BoxArray& grids, int ncomp); // //@ManDoc: Returns number of variables associated with each point. // MultiFab::nComp; // //@ManDoc: Returns a constant reference to the BoxArray. // MultiFab::boxArray; // //@ManDoc: Returns a constant reference to the Kth Box in the BoxArray. // MultiFab::box; MultiFab::fabbox; // //@ManDoc: Promote all setVal() member functions back to public. // MultiFab::setVal; // //@ManDoc: Copy from this FabSet to the destination FAB. // const FabSet& copyTo (FArrayBox& dest) const; // //@ManDoc: Copy specified components of this FabSet to the components of the destination FAB // const FabSet& copyTo (FArrayBox& dest, int src_comp, int dest_comp, int num_comp) const; // //@ManDoc: Copy specified components of this FabSet to the components of the destination FAB over the subregion // const FabSet& copyTo (FArrayBox& dest, const Box& subbox, int src_comp, int dest_comp, int num_comp) const; // //@ManDoc: Copy from the FAB to this FabSet. // FabSet& copyFrom (const FArrayBox& src); // //@ManDoc: Copy from the specified components of a source FAB to the components to this destination FabSet // FabSet& copyFrom (const FArrayBox& src, int src_comp, int dest_comp, int num_comp); // //@ManDoc: Copy from the specified components of a source FAB to the destination components of this FabSet over the subregion // FabSet& copyFrom (const FArrayBox& src, const Box& subbox, int src_comp, int dest_comp, int num_comp); // //@ManDoc: Copy from the source MultiFab to this destination FabSet. // FabSet& copyFrom (const MultiFab& src, int nghost, int src_comp, int dest_comp, int num_comp); // //@ManDoc: Copy from the FabSet to this FabSet. // FabSet& copyFrom (const FabSet& src); // //@ManDoc: Copy from the specified components of a source FabSet to the components to this destination FabSet // FabSet& copyFrom (const FabSet& src, int src_comp, int dest_comp, int num_comp); // //@ManDoc: Copy to the MultiFab from this FabSet. // void copyTo (MultiFab& dest) const; // //@ManDoc: Componentwise multiply each datum in this FabSet for specified components. // FabSet& mult (Real v, int comp, int num_comp); // //@ManDoc: Componentwise multiply each datum in this FabSet for specified components in the subregion. // FabSet& mult (Real v, const Box& subreg, int comp, int num_comp); // //@ManDoc: Componentwise add scalar to each datum in this FabSet for specified components. // FabSet& plus (Real v, int comp, int num_comp); // //@ManDoc: Componentwise add scalar to each datum in this FabSet for specified components in the subregion. // FabSet& plus (Real v, const Box& subreg, int comp, int num_comp); // //@ManDoc: Add each datum in MultiFab to each in this FabSet for specified components in the subregion, including ghost cells specified. // FabSet& plusFrom (const MultiFab& src, int nghost, int src_comp, int dest_comp, int num_comp); // //@ManDoc: Linear combination: this := a*this + b*src (FabSets must be commensurate). // FabSet& linComb (Real a, Real b, const FabSet& src, int src_comp, int dest_comp, int num_comp); // //@ManDoc: Linear combination: this := a*mfa + b*mfb on intersection with valid region. // FabSet& linComb (Real a, const MultiFab& mfa, int a_comp, Real b, const MultiFab& mfb, int b_comp, int dest_comp, int num_comp, int n_ghost=0); friend class FabSetIter; friend class FabSetCopyDescriptor; // //@ManDoc: Promote operator[] back to public. // MultiFab::operator[]; MultiFab::get; // //@ManDoc: Promote clear() back to public. // MultiFab::clear; // //@ManDoc: Promote DistributionMap() back to public. // MultiFab::DistributionMap; // //@ManDoc: Promote size() back to public. // MultiFab::size; // //@ManDoc: True if there is a FAB at specified index. // bool defined (int i) const { return fabparray.defined(i); } // //@ManDoc: Flush cached stuff between regriddings. // static void FlushCache (); protected: // // copyFrom(MultiFab) and plusFrom(MultiFab) use common function. // enum How { COPYFROM, PLUSFROM }; void DoIt (const MultiFab& src, int ngrow, int scomp, int dcomp, int ncomp, How how); }; // //@Man: //@Memo: An iterator over the FABs in a FabSet. /*@Doc: This class encapsulates an iterator over the FABs in a FabSet such that each CPU in a Single Program Multiple Data (SPMD) parallel program accesses only those FABs in the FabSet that are actually owned by that CPU. */ class FabSetIter : public MFIter { public: // //@ManDoc: The constructor. // FabSetIter (const FabSet& fabset); // //@ManDoc: The destructor. // ~FabSetIter (); }; typedef FabArrayId FabSetId; class FabSetCopyDescriptor : public MultiFabCopyDescriptor { public: FabSetCopyDescriptor (); ~FabSetCopyDescriptor (); FabSetId RegisterFabSet (FabSet* fabset); private: // // These are disallowed. // FabSetCopyDescriptor (const FabSetCopyDescriptor& rhs); FabSetCopyDescriptor& operator= (const FabSetCopyDescriptor& rhs); }; #endif /*_FABSET_H_*/ ccseapps-2.5/CCSEApps/bndrylib/.cvsignore0000644000175000017500000000021011634153073021455 0ustar amckinstryamckinstry*.for Debug Debug3D Release Release3D *.ncb *.opt *.plg grdlog ti_files chk[0-9][0-9][0-9][0-9] plt[0-9][0-9][0-9][0-9] *.pixie *.Addrs ccseapps-2.5/CCSEApps/bndrylib/Geometry.cpp0000644000175000017500000004043511634153073021771 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Geometry.cpp,v 1.63 2002/12/11 17:05:25 lijewski Exp $ // #include #include #include #include #include #include // // The definition of static data members. // int Geometry::spherical_origin_fix = 0; RealBox Geometry::prob_domain; bool Geometry::is_periodic[BL_SPACEDIM]; // // Src/dest box pairs to copy for periodic. // struct PIRec { PIRec () : mfid(-1), srcId(-1) {} PIRec (int _mfid, int _srcId, const Box& _srcBox, const Box& _dstBox) : mfid(_mfid), srcId(_srcId), srcBox(_srcBox), dstBox(_dstBox) {} int mfid; int srcId; Box srcBox; Box dstBox; FillBoxId fbid; }; // // A handy typedef. // typedef std::vector PIRMMap; // // Used in caching PIRMMaps && CommData. // struct FPB { FPB (); FPB (const BoxArray& ba, const Box& domain, int ngrow, bool do_corners); FPB (const FPB& rhs); ~FPB (); bool operator== (const FPB& rhs) const; bool operator!= (const FPB& rhs) const; Array m_cache; // Snds cached for CollectData(). CommDataCache m_commdata; // Yet another cache for CollectData(). PIRMMap m_pirm; BoxArray m_ba; Box m_domain; int m_ngrow; bool m_do_corners; }; // // A useful typedef. // typedef std::list FPBList; // // A cache of FPBs. // static FPBList m_FPBCache; std::ostream& operator<< (std::ostream& os, const Geometry& g) { os << (CoordSys&) g << g.ProbDomain() << g.Domain(); return os; } std::istream& operator>> (std::istream& is, Geometry& g) { Box bx; RealBox rb; is >> (CoordSys&) g >> rb >> bx; g.Domain(bx); Geometry::ProbDomain(rb); return is; } std::ostream& operator<< (std::ostream& os, const PIRec& pir) { os << "mfi: " << pir.mfid << " from (Box " << pir.srcId << ") " << pir.srcBox << " to " << pir.dstBox; return os; } std::ostream& operator<< (std::ostream& os, const PIRMMap& pirm) { for (int i = 0; i < pirm.size(); i++) os << pirm[i] << '\n'; return os; } FPB::FPB () : m_ngrow(-1), m_do_corners(false) {} FPB::FPB (const BoxArray& ba, const Box& domain, int ngrow, bool do_corners) : m_ba(ba), m_domain(domain), m_ngrow(ngrow), m_do_corners(do_corners) { BL_ASSERT(ngrow >= 0); BL_ASSERT(domain.ok()); } FPB::FPB (const FPB& rhs) : m_cache(rhs.m_cache), m_commdata(rhs.m_commdata), m_pirm(rhs.m_pirm), m_ba(rhs.m_ba), m_domain(rhs.m_domain), m_ngrow(rhs.m_ngrow), m_do_corners(rhs.m_do_corners) {} FPB::~FPB () {} bool FPB::operator== (const FPB& rhs) const { return m_ngrow == rhs.m_ngrow && m_do_corners == rhs.m_do_corners && m_domain == rhs.m_domain && m_ba == rhs.m_ba; } bool FPB::operator!= (const FPB& rhs) const { return !operator==(rhs); } const RealBox& Geometry::ProbDomain () { return prob_domain; } void Geometry::ProbDomain (const RealBox& rb) { prob_domain = rb; } const Box& Geometry::Domain () const { return domain; } void Geometry::Domain (const Box& bx) { domain = bx; } bool Geometry::isPeriodic (int dir) { return is_periodic[dir] != 0; } bool Geometry::isAnyPeriodic () { return isPeriodic(0) #if BL_SPACEDIM>1 || isPeriodic(1) #endif #if BL_SPACEDIM>2 || isPeriodic(2) #endif ; } int Geometry::period (int dir) const { BL_ASSERT(is_periodic[dir]); return domain.length(dir); } const Real* Geometry::ProbLo () { return prob_domain.lo(); } const Real* Geometry::ProbHi () { return prob_domain.hi(); } Real Geometry::ProbLo (int dir) { return prob_domain.lo(dir); } Real Geometry::ProbHi (int dir) { return prob_domain.hi(dir); } const Real* Geometry::ProbLength () { return prob_domain.length(); } Real Geometry::ProbLength (int dir) { return prob_domain.length(dir); } void Geometry::FillPeriodicBoundary (MultiFab& mf, bool do_corners) const { FillPeriodicBoundary(mf,0,mf.nComp(),do_corners); } FPB& Geometry::getFPB (MultiFab& mf, const FPB& fpb, int scomp, int ncomp) const { BL_ASSERT(isAnyPeriodic()); // // Have we already made one with appropriate characteristics? // // Search from the front to the back ... // for (FPBList::iterator it = m_FPBCache.begin(); it != m_FPBCache.end(); ++it) { if (*it == fpb) { // // Adjust the ncomp & scomp in CommData. // Array& cd = (*it).m_commdata.theCommData(); for (int i = 0; i < cd.size(); i++) { cd[i].nComp(ncomp); cd[i].srcComp(scomp); } return *it; } } return buildFPB(mf,fpb); } int Geometry::PIRMCacheSize () { return m_FPBCache.size(); } void Geometry::FlushPIRMCache () { m_FPBCache.clear(); } FPB& Geometry::buildFPB (MultiFab& mf, const FPB& fpb) const { BL_ASSERT(isAnyPeriodic()); m_FPBCache.push_front(fpb); PIRMMap& pirm = m_FPBCache.front().m_pirm; Array pshifts(27); for (MFIter mfi(mf); mfi.isValid(); ++mfi) { Box dest = mf[mfi].box(); BL_ASSERT(dest == BoxLib::grow(mfi.validbox(), mf.nGrow())); bool DoIt; Box TheDomain; if (dest.ixType().cellCentered()) { TheDomain = Domain(); DoIt = !Domain().contains(dest); } else if (dest.ixType().nodeCentered()) { TheDomain = BoxLib::surroundingNodes(Domain()); DoIt = !BoxLib::grow(TheDomain,-1).contains(dest); } else { TheDomain = Domain(); for (int n = 0; n < BL_SPACEDIM; n++) if (dest.ixType()[n] == IndexType::NODE) TheDomain.surroundingNodes(n); DoIt = !TheDomain.contains(dest); } if (DoIt) { const BoxArray& grids = mf.boxArray(); for (int j = 0; j < grids.size(); j++) { Box src = grids[j] & TheDomain; if (fpb.m_do_corners) { for (int i = 0; i < BL_SPACEDIM; i++) { if (!isPeriodic(i)) { if (src.smallEnd(i) == Domain().smallEnd(i)) src.growLo(i,mf.nGrow()); if (src.bigEnd(i) == Domain().bigEnd(i)) src.growHi(i,mf.nGrow()); } } } periodicShift(dest, src, pshifts); for (int i = 0; i < pshifts.size(); i++) { Box shftbox = src + pshifts[i]; Box src_box = dest & shftbox; Box dst_box = src_box - pshifts[i]; pirm.push_back(PIRec(mfi.index(),j,dst_box,src_box)); } } } } return m_FPBCache.front(); } void Geometry::FillPeriodicBoundary (MultiFab& mf, int scomp, int ncomp, bool corners) const { if (!isAnyPeriodic()) return; MultiFabCopyDescriptor mfcd; FPB TheFPB(mf.boxArray(),Domain(),mf.nGrow(),corners); const MultiFabId mfid = mfcd.RegisterMultiFab(&mf); FPB& fpb = getFPB(mf,TheFPB,scomp,ncomp); PIRMMap& pirm = fpb.m_pirm; // // Add boxes we need to collect. // for (int i = 0; i < pirm.size(); i++) { pirm[i].fbid = mfcd.AddBox(mfid, pirm[i].srcBox, 0, pirm[i].srcId, scomp, scomp, ncomp, !corners); } mfcd.CollectData(&fpb.m_cache,&fpb.m_commdata); for (int i = 0; i < pirm.size(); i++) { BL_ASSERT(pirm[i].fbid.box() == pirm[i].srcBox); BL_ASSERT(pirm[i].srcBox.sameSize(pirm[i].dstBox)); BL_ASSERT(mf.DistributionMap()[pirm[i].mfid] == ParallelDescriptor::MyProc()); mfcd.FillFab(mfid, pirm[i].fbid, mf[pirm[i].mfid], pirm[i].dstBox); } } Geometry::Geometry () {} Geometry::Geometry (const Box& dom, const RealBox* rb, int coord) { define(dom,rb,coord); } Geometry::Geometry (const Geometry& g) { ok = g.ok; domain = g.domain; D_TERM(dx[0]=g.dx[0];,dx[1]=g.dx[1];,dx[2]=g.dx[2];) } Geometry::~Geometry() {} void Geometry::define (const Box& dom, const RealBox* rb, int coord) { if (c_sys == undef) Setup(rb,coord); domain = dom; ok = true; for (int k = 0; k < BL_SPACEDIM; k++) { dx[k] = prob_domain.length(k)/(Real(domain.length(k))); } if (spherical_origin_fix == 1) { if (c_sys == SPHERICAL && prob_domain.lo(0) == 0 && BL_SPACEDIM > 1) { prob_domain.setLo(0,2*dx[0]); for (int k = 0; k < BL_SPACEDIM; k++) { dx[k] = prob_domain.length(k)/(Real(domain.length(k))); } } } } void Geometry::Setup (const RealBox* rb, int coord) { ParmParse pp("geometry"); // The default behavior is as before. If rb and coord come // in with default values, we require that user set them through pp. // If not, use those coming in, and possibly override them w/pp Array prob_lo(BL_SPACEDIM); Array prob_hi(BL_SPACEDIM); if (rb == 0 && coord==-1) { pp.get("coord_sys",coord); SetCoord( (CoordType) coord ); pp.getarr("prob_lo",prob_lo,0,BL_SPACEDIM); BL_ASSERT(prob_lo.size() == BL_SPACEDIM); pp.getarr("prob_hi",prob_hi,0,BL_SPACEDIM); BL_ASSERT(prob_lo.size() == BL_SPACEDIM); prob_domain.setLo(prob_lo); prob_domain.setHi(prob_hi); } else { BL_ASSERT(rb != 0 && coord != -1); pp.query("coord_sys",coord); SetCoord( (CoordType) coord ); prob_domain.setLo(rb->lo()); prob_domain.setHi(rb->hi()); if (pp.countval("prob_lo")>0) { pp.queryarr("prob_lo",prob_lo,0,BL_SPACEDIM); BL_ASSERT(prob_lo.size() == BL_SPACEDIM); prob_domain.setLo(prob_lo); } if (pp.countval("prob_hi")>0) { pp.queryarr("prob_hi",prob_hi,0,BL_SPACEDIM); BL_ASSERT(prob_hi.size() == BL_SPACEDIM); prob_domain.setHi(prob_hi); } } spherical_origin_fix = 0; pp.query("spherical_origin_fix",spherical_origin_fix); // // Now get periodicity info. // D_EXPR(is_periodic[0]=0, is_periodic[1]=0, is_periodic[2]=0); Array is_per(BL_SPACEDIM); pp.queryarr("is_periodic",is_per,0,BL_SPACEDIM); for (int n = 0; n < BL_SPACEDIM; n++) is_periodic[n] = is_per[n]; } void Geometry::GetVolume (MultiFab& vol, const BoxArray& grds, int ngrow) const { vol.define(grds,1,ngrow,Fab_noallocate); for (MFIter mfi(vol); mfi.isValid(); ++mfi) { Box gbx = BoxLib::grow(grds[mfi.index()],ngrow); vol.setFab(mfi.index(),CoordSys::GetVolume(gbx)); } } #if (BL_SPACEDIM == 2) void Geometry::GetDLogA (MultiFab& dloga, const BoxArray& grds, int dir, int ngrow) const { dloga.define(grds,1,ngrow,Fab_noallocate); for (MFIter mfi(dloga); mfi.isValid(); ++mfi) { Box gbx = BoxLib::grow(grds[mfi.index()],ngrow); dloga.setFab(mfi.index(),CoordSys::GetDLogA(gbx,dir)); } } #endif void Geometry::GetFaceArea (MultiFab& area, const BoxArray& grds, int dir, int ngrow) const { BoxArray edge_boxes(grds); edge_boxes.surroundingNodes(dir); area.define(edge_boxes,1,ngrow,Fab_noallocate); for (MFIter mfi(area); mfi.isValid(); ++mfi) { Box gbx = BoxLib::grow(grds[mfi.index()],ngrow); area.setFab(mfi.index(),CoordSys::GetFaceArea(gbx,dir)); } } void Geometry::periodicShift (const Box& target, const Box& src, Array& out) const { Box locsrc(src); out.resize(0); int nist,njst,nkst; int niend,njend,nkend; nist = njst = nkst = 0; niend = njend = nkend = 0; D_TERM( nist , =njst , =nkst ) = -1; D_TERM( niend , =njend , =nkend ) = +1; int ri,rj,rk; for (ri = nist; ri <= niend; ri++) { if (ri != 0 && !is_periodic[0]) continue; if (ri != 0 && is_periodic[0]) locsrc.shift(0,ri*domain.length(0)); for (rj = njst; rj <= njend; rj++) { if (rj != 0 && !is_periodic[1]) continue; if (rj != 0 && is_periodic[1]) locsrc.shift(1,rj*domain.length(1)); for (rk = nkst; rk <= nkend; rk++) { if (rk!=0 #if (BL_SPACEDIM == 3) && !is_periodic[2] #endif ) { continue; } if (rk!=0 #if (BL_SPACEDIM == 3) && is_periodic[2] #endif ) { locsrc.shift(2,rk*domain.length(2)); } if (ri == 0 && rj == 0 && rk == 0) continue; // // If losrc intersects target, then add to "out". // if (target.intersects(locsrc)) { IntVect sh; D_TERM(sh.setVal(0,ri*domain.length(0));, sh.setVal(1,rj*domain.length(1));, sh.setVal(2,rk*domain.length(2));) out.resize(out.size()+1); out[out.size()-1] = sh; } if (rk != 0 #if (BL_SPACEDIM == 3) && is_periodic[2] #endif ) { locsrc.shift(2,-rk*domain.length(2)); } } if (rj != 0 && is_periodic[1]) locsrc.shift(1,-rj*domain.length(1)); } if (ri != 0 && is_periodic[0]) locsrc.shift(0,-ri*domain.length(0)); } } ccseapps-2.5/CCSEApps/bndrylib/CoordSys.H0000644000175000017500000002111611634153073021343 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _COORDSYS_H_ #define _COORDSYS_H_ // // $Id: CoordSys.H,v 1.11 2001/08/15 19:23:55 lijewski Exp $ // #include #include #include class FArrayBox; // //@Man: //@Memo: Coordinate System /*@Doc: Routines for mapping between physical coordinate system and index space. */ class CoordSys { public: enum CoordType { undef = -1, cartesian = 0, RZ = 1, SPHERICAL = 2 }; // //@ManDoc: Nice ASCII output. // friend std::ostream& operator<< (std::ostream&, const CoordSys& ); // //@ManDoc: Nice ASCII input. // friend std::istream& operator>> (std::istream&, CoordSys& ); // //@ManDoc: Default constructor to undefined state. // CoordSys (); // //@ManDoc: Construct, specify a cell size, and low end of index range. // CoordSys (const Real* cell_dx); // //@ManDoc: The destructor. // ~CoordSys (); // //@ManDoc: Initialize after construction. // void define (const Real* cell_dx); // //@ManDoc: Set the CoordType. // static void SetCoord (CoordType coord); // //@ManDoc: Returns the CoordType. // static CoordType Coord (); // //@ManDoc: Is CoordType == SPHERICAL? // static bool IsSPHERICAL (); // //@ManDoc: Is CoordType == RZ? // static bool IsRZ (); // //@ManDoc: Is CoordType == cartesion? // static bool IsCartesian (); // //@ManDoc: Sets the offset for each coordinate direction. // static void SetOffset (const Real* x_lo); // //@ManDoc: Returns the offset. // static const Real* Offset (); // //@ManDoc: Returns the offset for the specified coordinate direction. // static Real Offset (int dir); // //@ManDoc: Returns the cellsize for each coordinate direction. // const Real* CellSize () const; // //@ManDoc: Returns the cellsize for the specified coordinate direction. // Real CellSize (int dir) const; // //@ManDoc: Returns location of cell center in specified direction. // Real CellCenter (int point, int dir) const; // //@ManDoc: Return location of cell center. // void CellCenter (const IntVect& point, Array& loc) const; // //@ManDoc: Return location of cell center. // void CellCenter (const IntVect& point, Real* loc) const; // //@ManDoc: Returns location of lo edge in specified direction. // Real LoEdge (int point, int dir) const; // //@ManDoc: Equivalent to LoEdge(point[dir], dir). // Real LoEdge (const IntVect& point, int dir) const; // //@ManDoc: Returns location of hi edge in specified direction. // Real HiEdge (int point, int dir) const; // //@ManDoc: Equivalent to HiEdge(point[dir], dir). // Real HiEdge (const IntVect& point, int dir) const; // //@ManDoc: Sets location of lo face into `loc'. // void LoFace (const IntVect& point, int dir, Array& loc) const; // //@ManDoc: Sets location of lo face into `loc'. // void LoFace (const IntVect& point, int dir, Real* loc) const; // //@ManDoc: Sets location of hi face into `loc'. // void HiFace (const IntVect& point, int dir, Array& loc) const; // //@ManDoc: Sets location of hi face into `loc'. // void HiFace (const IntVect& point, int dir, Real* loc) const; // //@ManDoc: Return location of lower left hand corner. // void LoNode (const IntVect& point, Array& loc) const; // //@ManDoc: Return location of lower left hand corner. // void LoNode (const IntVect& point, Real* loc) const; // //@ManDoc: Return location of upper right hand corner. // void HiNode (const IntVect& point, Array& loc) const; // //@ManDoc: Return location of upper right hand corner. // void HiNode (const IntVect& point, Real* loc) const; /*@ManDoc: Returns cell centered index of cell containing point. This may return undesired results if point is on a cell boundary. */ IntVect CellIndex (const Real* point) const; /*@ManDoc: Returns node centered index of lower left hand corner of cell containing this point. */ IntVect LowerIndex (const Real* point) const; /*@ManDoc: Returns node centered index of upper right hand corner of cell containing this point. */ IntVect UpperIndex (const Real* point) const; /*@ManDoc: Compute cell volumes in given region and place them into resize()d input FAB. */ void GetVolume (FArrayBox& vol, const Box& region) const; /*@ManDoc: Compute cell volumes in given region and place them into new()d FAB. It is the user's respoinsibility to delete the returned FAB. */ FArrayBox* GetVolume (const Box& region) const; /*@ManDoc: Compute d(log(A))/dr at cell centers in given region and return the results in the resize()d input FAB. */ void GetDLogA (FArrayBox& dloga, const Box& region, int dir) const; /*@ManDoc: Compute d(log(A))/dr at cell centers in given region and return the results in a new()d FAB. It is the user's responsibility to delete the returned FAB. */ FArrayBox* GetDLogA (const Box& region, int dir) const; // //@ManDoc: Return the volume of the specified cell. // Real Volume (const IntVect& point) const; // //@ManDoc: Return the volume of the specified cell. // Real Volume (const Real xlo[BL_SPACEDIM], const Real xhi[BL_SPACEDIM]) const; /*@ManDoc: Compute area of cell faces in given region and given index direction and return the result in resize()d input FAB. */ void GetFaceArea (FArrayBox& area, const Box& region, int dir) const; /*@ManDoc: Compute area of cell faces in given region and given index direction and return the result in new()d FAB. It is the user's responsibility to delete the FAB. */ FArrayBox* GetFaceArea (const Box& region, int dir) const; // //@ManDoc: Returns lo face area of given cell in direction dir. // Real AreaLo (const IntVect& point, int dir) const; // //@ManDoc: Returns hi face area of given cell in direction dir. // Real AreaHi (const IntVect& point, int dir) const; /*@ManDoc: Return array of physical locations of cell edges in the resize()d input array. */ void GetEdgeLoc (Array& loc, const Box& region, int dir) const; /*@ManDoc: Return array of physical locations of cell centers in the resize()d input array. */ void GetCellLoc (Array& loc, const Box& region, int dir) const; /*@ManDoc: Return array of volume coordinates at cell edges for region in given direction. */ void GetEdgeVolCoord (Array& loc, const Box& region, int dir) const; /*@ManDoc: Return array of volume coordinates at cell centers for region in given direction. */ void GetCellVolCoord (Array& loc, const Box& region, int dir) const; protected: // // Static data. // static CoordType c_sys; static Real offset[BL_SPACEDIM]; // // Non-static data. // Real dx[BL_SPACEDIM]; bool ok; }; #endif /*_COORDSYS_H_*/ ccseapps-2.5/CCSEApps/bndrylib/BndryRegister.H0000644000175000017500000001365311634153073022370 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BNDRYREGISTER_H_ #define _BNDRYREGISTER_H_ // // $Id: BndryRegister.H,v 1.10 2001/08/01 21:50:47 lijewski Exp $ // #include #include class Orientation; //@Man: /*@Memo: A BndryRegister organizes FabSets bounding each grid in a BoxArray. A FabSet is maintained for each boundary orientation, as well as the BoxArray domain of definition. */ /*@Doc: A BndryRegister object contains a list of FabSets bounding the grids in a BoxArray. The FabSet FABs are at the same refinement level as the grids they bound, and are accessed and modified via a variety of member functions. Non-default instantiation allocates a set of FABs, grown into and out of the bounding surfaces of each box in the BoxArray. The width of the layer (in/out), as well as the "extent" of a bounding FABs (the number of nodes beyond the box boundaries, parallel to the grid surface) are determined by constructor argument. All boxes and FABs in this context are assumed to be cell-centered. A small number of linear mathematical operations are provided for BndryRegisters, as well as overloaded [] operators for access based on grid boundary orientation. The BoxArray domain of definition is accessible, but not resettable, */ class BndryRegister { public: // //@ManDoc: The default constructor. // BndryRegister (); // //@ManDoc: The constructor, given number of cells in/out, extent and number of components (assumes cell-centered boxes, and allocates cell-centered FABs) // BndryRegister (const BoxArray& grids, int in_rad, int out_rad, int extent_rad, int ncomp); // //@ManDoc: The copy constructor. // BndryRegister (const BndryRegister& src); // //@ManDoc: The copy assignment operator. // BndryRegister& operator= (const BndryRegister& src); // //@ManDoc: The destructor. // virtual ~BndryRegister(); // //@ManDoc: Get box domain (as an array of boxes). // const BoxArray& boxes () const; // //@ManDoc: Return the number of grids in this domain. // int size () const; // //@ManDoc: Return const set of FABs bounding the domain grid boxes on a given orientation // const FabSet& operator[] (const Orientation& face) const; // //@ManDoc: Return set of FABs bounding the domain grid boxes on a given orientation // FabSet& operator[] (const Orientation& face); // //@ManDoc: Set all boundary FABs to given value. // void setVal (Real v); // //@ManDoc: Fill the boundary FABs on intersection with given MultiFab. // BndryRegister& copyFrom (const MultiFab& src, int nghost, int src_comp, int dest_comp, int num_comp); // //@ManDoc: Increment the boundary FABs on intersect with given MultiFab. // BndryRegister& plusFrom (const MultiFab& src, int nghost, int src_comp, int dest_comp, int num_comp); // //@ManDoc: Linear combination: this := a*mfa + b*mfb on intersection of MultiFabs with the boundary FABs // BndryRegister& linComb (Real a, const MultiFab& mfa, int a_comp, Real b, const MultiFab& mfb, int b_comp, int dest_comp, int num_comp, int n_ghost = 0); // //@ManDoc: Set box domain, if not set previously. // void setBoxes (const BoxArray& grids); // //@ManDoc: Build FABs along given face. // void define (const Orientation& face, const IndexType& typ, int in_rad, int out_rad, int extent_rad, int ncomp); protected: // // Used by the copy constructor and assignment operator. // void init (const BndryRegister& src); // // The data. // FabSet bndry[2*BL_SPACEDIM]; BoxArray grids; }; #endif /*_BNDRYREGISTER_H_*/ ccseapps-2.5/CCSEApps/bndrylib/RealBox.cpp0000644000175000017500000001210211634153073021520 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: RealBox.cpp,v 1.10 2001/08/02 16:04:11 car Exp $ // #include #include #include // // The definition of lone static data member. // Real RealBox::eps = 1.0e-6; RealBox::RealBox (const Box& bx, const Real* dx, const Real* base) { const int* lo = bx.loVect(); const int* hi = bx.hiVect(); for (int i = 0; i < BL_SPACEDIM; i++) { xlo[i] = base[i] + dx[i]*lo[i]; int shft = (bx.type(i) == IndexType::CELL ? 1 : 0); xhi[i] = base[i] + dx[i]*(hi[i]+ shft); } computeBoxLen(); } void RealBox::setEpsilon (Real epsilon) { eps = epsilon; } Real RealBox::epsilon () { return eps; } const Real* RealBox::lo () const { return xlo; } const Real* RealBox::hi () const { return xhi; } const Real* RealBox::length () const { return len; } Real RealBox::lo (int dir) const { return xlo[dir]; } Real RealBox::hi (int dir) const { return xhi[dir]; } Real RealBox::length (int dir) const { return len[dir]; } void RealBox::computeBoxLen () { D_EXPR(len[0] = xhi[0]-xlo[0], len[1] = xhi[1]-xlo[1], len[2] = xhi[2]-xlo[2]); } RealBox::RealBox () { D_TERM(xlo[0] , = xlo[1] , = xlo[2] ) = 0.; D_TERM(xhi[0] , = xhi[1] , = xhi[2] ) = -1.; computeBoxLen(); } RealBox::RealBox (const Real* lo, const Real* hi) { D_EXPR(xlo[0] = lo[0] , xlo[1] = lo[1] , xlo[2] = lo[2]); D_EXPR(xhi[0] = hi[0] , xhi[1] = hi[1] , xhi[2] = hi[2]); computeBoxLen() ; } RealBox::RealBox (D_DECL(Real x0, Real y0, Real z0), D_DECL(Real x1, Real y1, Real z1)) { D_EXPR(xlo[0] = x0 , xlo[1] = y0 , xlo[2] = z0); D_EXPR(xhi[0] = x1 , xhi[1] = y1 , xhi[2] = z1); computeBoxLen() ; } void RealBox::setLo (const Real* lo) { D_EXPR(xlo[0] = lo[0], xlo[1] = lo[1], xlo[2] = lo[2]); computeBoxLen(); } void RealBox::setLo (const Array &lo) { D_EXPR(xlo[0] = lo[0], xlo[1] = lo[1], xlo[2] = lo[2]); computeBoxLen(); } void RealBox::setHi (const Real* hi) { D_EXPR(xhi[0] = hi[0], xhi[1] = hi[1], xhi[2] = hi[2]); computeBoxLen(); } void RealBox::setHi (const Array& hi) { D_EXPR(xhi[0] = hi[0], xhi[1] = hi[1], xhi[2] = hi[2]); computeBoxLen(); } void RealBox::setLo (int indx, Real lo) { BL_ASSERT(indx >= 0 && indx < BL_SPACEDIM); xlo[indx] = lo; computeBoxLen(); } void RealBox::setHi (int indx, Real hi) { BL_ASSERT(indx >= 0 && indx < BL_SPACEDIM); xhi[indx] = hi; computeBoxLen(); } bool RealBox::contains (const RealBox& rb) const { return contains(rb.xlo) && contains(rb.xhi); } bool RealBox::ok () const { return (len[0] > eps) #if (BL_SPACEDIM > 1) && (len[1] > eps) #endif #if (BL_SPACEDIM > 2) && (len[2] > eps) #endif ; } bool RealBox::contains (const Real* point) const { return D_TERM((xlo[0]-eps < point[0]) && (point[0] < xhi[0]+eps), && (xlo[1]-eps < point[1]) && (point[1] < xhi[1]+eps), && (xlo[2]-eps < point[2]) && (point[2] < xhi[2]+eps)); } std::ostream& operator << (std::ostream &os, const RealBox& b) { os << "(RealBox "; for (int i = 0; i < BL_SPACEDIM; i++) os << b.lo(i) << ' ' << b.hi(i) << ' '; os << ')'; return os; } // // Copied from // #define BL_IGNORE_MAX 100000 std::istream& operator >> (std::istream &is, RealBox& b) { is.ignore(BL_IGNORE_MAX,'('); std::string s; is >> s; if (s != "RealBox") { std::cerr << "unexpected token in RealBox: " << s << '\n'; BoxLib::Abort(); } Real lo[BL_SPACEDIM]; Real hi[BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; i++) is >> lo[i] >> hi[i]; is.ignore(BL_IGNORE_MAX, ')'); b = RealBox(lo,hi); return is; } ccseapps-2.5/CCSEApps/bndrylib/CoordSys.cpp0000644000175000017500000003434411634153073021745 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: CoordSys.cpp,v 1.16 2001/08/15 19:23:55 lijewski Exp $ // #include #include #include #include #include #if (BL_SPACEDIM==2) #if defined(BL_AIX) || defined(WIN32) #define M_PI 3.14159265358979323846264338327950288 #endif const double RZFACTOR = 2*M_PI; #endif // // A handy macro. // #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); // // The definition of static data members. // CoordSys::CoordType CoordSys::c_sys = CoordSys::undef; Real CoordSys::offset[BL_SPACEDIM]; CoordSys::~CoordSys () {} CoordSys::CoordType CoordSys::Coord () { return c_sys; } const Real* CoordSys::Offset () { return offset; } Real CoordSys::Offset (int dir) { return offset[dir]; } const Real* CoordSys::CellSize () const { BL_ASSERT(ok); return dx; } Real CoordSys::CellSize (int dir) const { BL_ASSERT(ok); return dx[dir]; } void CoordSys::SetCoord (CoordType coord) { c_sys = coord; } void CoordSys::SetOffset (const Real* x_lo) { for (int k = 0; k < BL_SPACEDIM; k++) { offset[k] = x_lo[k]; } } bool CoordSys::IsSPHERICAL () { BL_ASSERT(c_sys != undef); #if (BL_SPACEDIM <= 2) return (c_sys == SPHERICAL); #endif #if (BL_SPACEDIM == 3) return false; #endif } bool CoordSys::IsRZ () { BL_ASSERT(c_sys != undef); #if (BL_SPACEDIM == 2) return (c_sys == RZ); #endif #if (BL_SPACEDIM == 3) return false; #endif } bool CoordSys::IsCartesian () { BL_ASSERT(c_sys != undef); return (c_sys == cartesian); } CoordSys::CoordSys () { ok = false; } void CoordSys::define (const Real* cell_dx) { BL_ASSERT(c_sys != undef); ok = true; for (int k = 0; k < BL_SPACEDIM; k++) { dx[k] = cell_dx[k]; } } CoordSys::CoordSys (const Real* cell_dx) { define(cell_dx); } void CoordSys::CellCenter (const IntVect& point, Real* loc) const { BL_ASSERT(ok); BL_ASSERT(loc != 0); for (int k = 0; k < BL_SPACEDIM; k++) { loc[k] = offset[k] + dx[k]*(0.5+ (Real)point[k]); } } void CoordSys::CellCenter (const IntVect& point, Array& loc) const { BL_ASSERT(ok); loc.resize(BL_SPACEDIM); CellCenter(point, loc.dataPtr()); } Real CoordSys::CellCenter (int point, int dir) const { BL_ASSERT(ok); return offset[dir] + dx[dir]*(0.5+ (Real)point); } Real CoordSys::LoEdge (int point, int dir) const { BL_ASSERT(ok); return offset[dir] + dx[dir]*point; } Real CoordSys::LoEdge (const IntVect& point, int dir) const { BL_ASSERT(ok); return offset[dir] + dx[dir]*point[dir]; } Real CoordSys::HiEdge (int point, int dir) const { BL_ASSERT(ok); return offset[dir] + dx[dir]*(point + 1); } Real CoordSys::HiEdge (const IntVect& point, int dir) const { BL_ASSERT(ok); return offset[dir] + dx[dir]*(point[dir] + 1); } void CoordSys::LoFace (const IntVect& point, int dir, Real* loc) const { BL_ASSERT(ok); BL_ASSERT(loc != 0); for (int k = 0; k < BL_SPACEDIM; k++) { Real off = (k == dir) ? 0.0 : 0.5; loc[k] = offset[k] + dx[k]*(off + (Real)point[k]); } } void CoordSys::LoFace (const IntVect& point, int dir, Array& loc) const { loc.resize(BL_SPACEDIM); LoFace(point,dir, loc.dataPtr()); } void CoordSys::HiFace (const IntVect& point, int dir, Real* loc) const { BL_ASSERT(ok); BL_ASSERT(loc != 0); for (int k = 0; k < BL_SPACEDIM; k++) { Real off = (k == dir) ? 1.0 : 0.5; loc[k] = offset[k] + dx[k]*(off + (Real)point[k]); } } void CoordSys::HiFace (const IntVect& point, int dir, Array& loc) const { loc.resize(BL_SPACEDIM); HiFace(point,dir, loc.dataPtr()); } void CoordSys::LoNode (const IntVect& point, Real* loc) const { BL_ASSERT(ok); BL_ASSERT(loc != 0); for (int k = 0; k < BL_SPACEDIM; k++) { loc[k] = offset[k] + dx[k]*point[k]; } } void CoordSys::LoNode (const IntVect& point, Array& loc) const { loc.resize(BL_SPACEDIM); LoNode(point, loc.dataPtr()); } void CoordSys::HiNode (const IntVect& point, Real* loc) const { BL_ASSERT(ok); BL_ASSERT(loc != 0); for (int k = 0; k < BL_SPACEDIM; k++) { loc[k] = offset[k] + dx[k]*(point[k] + 1); } } void CoordSys::HiNode (const IntVect& point, Array& loc) const { loc.resize(BL_SPACEDIM); HiNode(point, loc.dataPtr()); } IntVect CoordSys::CellIndex (const Real* point) const { BL_ASSERT(ok); BL_ASSERT(point != 0); IntVect ix; for (int k = 0; k < BL_SPACEDIM; k++) { ix[k] = (int) ((point[k]-offset[k])/dx[k]); } return ix; } IntVect CoordSys::LowerIndex (const Real* point) const { BL_ASSERT(ok); BL_ASSERT(point != 0); IntVect ix; for (int k = 0; k < BL_SPACEDIM; k++) { ix[k] = (int) ((point[k]-offset[k])/dx[k]); } return ix; } IntVect CoordSys::UpperIndex(const Real* point) const { BL_ASSERT(ok); BL_ASSERT(point != 0); IntVect ix; for (int k = 0; k < BL_SPACEDIM; k++) { ix[k] = (int) ((point[k]-offset[k])/dx[k]); } return ix; } FArrayBox* CoordSys::GetVolume (const Box& region) const { FArrayBox* vol = new FArrayBox(); GetVolume(*vol,region); return vol; } void CoordSys::GetVolume (FArrayBox& vol, const Box& region) const { BL_ASSERT(ok); BL_ASSERT(region.cellCentered()); vol.resize(region,1); DEF_LIMITS(vol,vol_dat,vlo,vhi); int coord = (int) c_sys; FORT_SETVOL(vol_dat,ARLIM(vlo),ARLIM(vhi),offset,dx,&coord); } void CoordSys::GetDLogA (FArrayBox& dloga, const Box& region, int dir) const { BL_ASSERT(ok); BL_ASSERT(region.cellCentered()); dloga.resize(region,1); DEF_LIMITS(dloga,dloga_dat,dlo,dhi); int coord = (int) c_sys; FORT_SETDLOGA(dloga_dat,ARLIM(dlo),ARLIM(dhi),offset,dx,&dir,&coord); } FArrayBox* CoordSys::GetDLogA (const Box& region, int dir) const { FArrayBox* dloga = new FArrayBox(); GetDLogA(*dloga,region,dir); return dloga; } FArrayBox* CoordSys::GetFaceArea (const Box& region, int dir) const { FArrayBox* area = new FArrayBox(); GetFaceArea(*area,region,dir); return area; } void CoordSys::GetFaceArea (FArrayBox& area, const Box& region, int dir) const { BL_ASSERT(ok); BL_ASSERT(region.cellCentered()); Box reg(region); reg.surroundingNodes(dir); area.resize(reg,1); DEF_LIMITS(area,area_dat,lo,hi) int coord = (int) c_sys; FORT_SETAREA(area_dat,ARLIM(lo),ARLIM(hi),offset,dx,&dir,&coord); } void CoordSys::GetEdgeLoc (Array& loc, const Box& region, int dir) const { BL_ASSERT(ok); BL_ASSERT(region.cellCentered()); const int* lo = region.loVect(); const int* hi = region.hiVect(); int len = hi[dir] - lo[dir] + 2; Real off = offset[dir] + dx[dir]*lo[dir]; loc.resize(len); for (int i = 0; i < len; i++) { loc[i] = off + dx[dir]*i; } } void CoordSys::GetCellLoc (Array& loc, const Box& region, int dir) const { BL_ASSERT(ok); BL_ASSERT(region.cellCentered()); const int* lo = region.loVect(); const int* hi = region.hiVect(); int len = hi[dir] - lo[dir] + 1; Real off = offset[dir] + dx[dir]*(0.5 + (Real)lo[dir]); loc.resize(len); for (int i = 0; i < len; i++) { loc[i] = off + dx[dir]*i; } } void CoordSys::GetEdgeVolCoord (Array& vc, const Box& region, int dir) const { // // In cartesian and Z direction of RZ volume coordinates // are idential to physical distance from axis. // GetEdgeLoc(vc,region,dir); // // In R direction of RZ, vol coord = (r^2)/2 // #if (BL_SPACEDIM == 2) if (dir == 0 && c_sys == RZ) { int len = vc.size(); for (int i = 0; i < len; i++) { Real r = vc[i]; vc[i] = 0.5*r*r; } } else { if(dir == 0 && c_sys == SPHERICAL) { int len = vc.size(); int i; for (i = 0; i < len; i++) { Real r = vc[i]; vc[i] = 0.3*r*r*r; } } } #endif } void CoordSys::GetCellVolCoord (Array& vc, const Box& region, int dir) const { // // In cartesian and Z direction of RZ volume coordinates // are idential to physical distance from axis. // GetCellLoc(vc,region,dir); // // In R direction of RZ, vol coord = (r^2)/2. // #if (BL_SPACEDIM == 2) if (dir == 0 && c_sys == RZ) { int len = vc.size(); for (int i = 0; i < len; i++) { Real r = vc[i]; vc[i] = 0.5*r*r; } } else { if(dir == 0 && c_sys == SPHERICAL) { int len = vc.size(); int i; for (i = 0; i < len; i++) { Real r = vc[i]; vc[i] = 0.3*r*r*r; } } } #endif } std::ostream& operator<< (std::ostream& os, const CoordSys& c) { os << '(' << (int) c.Coord() << ' '; os << D_TERM( '(' << c.Offset(0) , << ',' << c.Offset(1) , << ',' << c.Offset(2)) << ')'; os << D_TERM( '(' << c.CellSize(0) , << ',' << c.CellSize(1) , << ',' << c.CellSize(2)) << ')'; os << ' ' << int(c.ok) << ")\n"; return os; } // // Copied from // #define BL_IGNORE_MAX 100000 std::istream& operator>> (std::istream& is, CoordSys& c) { int coord; is.ignore(BL_IGNORE_MAX, '(') >> coord; c.c_sys = (CoordSys::CoordType) coord; D_EXPR(is.ignore(BL_IGNORE_MAX, '(') >> c.offset[0], is.ignore(BL_IGNORE_MAX, ',') >> c.offset[1], is.ignore(BL_IGNORE_MAX, ',') >> c.offset[2]); is.ignore(BL_IGNORE_MAX, ')'); D_EXPR(is.ignore(BL_IGNORE_MAX, '(') >> c.dx[0], is.ignore(BL_IGNORE_MAX, ',') >> c.dx[1], is.ignore(BL_IGNORE_MAX, ',') >> c.dx[2]); is.ignore(BL_IGNORE_MAX, ')'); int tmp; is >> tmp; c.ok = tmp?true:false; is.ignore(BL_IGNORE_MAX, '\n'); return is; } Real CoordSys::Volume (const IntVect& point) const { Real xhi[BL_SPACEDIM]; Real xlo[BL_SPACEDIM]; HiNode(point,xhi); LoNode(point,xlo); return Volume(xlo,xhi); } Real CoordSys::Volume (const Real xlo[BL_SPACEDIM], const Real xhi[BL_SPACEDIM]) const { switch (c_sys) { case cartesian: return D_TERM((xhi[0]-xlo[0]), *(xhi[1]-xlo[1]), *(xhi[2]-xlo[2])); #if (BL_SPACEDIM==2) case RZ: return (0.5*RZFACTOR)*(xhi[1]-xlo[1])*(xhi[0]*xhi[0]-xlo[0]*xlo[0]); #endif default: BL_ASSERT(0); } return 0; } Real CoordSys::AreaLo (const IntVect& point, int dir) const { #if (BL_SPACEDIM==2) Real xlo[BL_SPACEDIM]; switch (c_sys) { case cartesian: switch (dir) { case 0: return dx[1]; case 1: return dx[0]; } case RZ: LoNode(point,xlo); switch (dir) { case 0: return RZFACTOR*dx[1]*xlo[0]; case 1: return ((xlo[0]+dx[0])*(xlo[0]+dx[0])-xlo[0]*xlo[0])*(0.5*RZFACTOR); } default: BL_ASSERT(0); } #endif #if (BL_SPACEDIM==3) switch (dir) { case 0: return dx[1]*dx[2]; case 1: return dx[0]*dx[2]; case 2: return dx[1]*dx[0]; } #endif return 0; } Real CoordSys::AreaHi (const IntVect& point, int dir) const { #if (BL_SPACEDIM==2) Real xhi[BL_SPACEDIM]; switch (c_sys) { case cartesian: switch (dir) { case 0: return dx[1]; case 1: return dx[0]; } case RZ: HiNode(point,xhi); switch (dir) { case 0: return RZFACTOR*dx[1]*xhi[0]; case 1: return (xhi[0]*xhi[0]-(xhi[0]-dx[0])*(xhi[0]-dx[0]))*(RZFACTOR*0.5); } default: BL_ASSERT(0); } #endif #if (BL_SPACEDIM==3) switch (dir) { case 0: return dx[1]*dx[2]; case 1: return dx[0]*dx[2]; case 2: return dx[1]*dx[0]; } #endif return 0; } ccseapps-2.5/CCSEApps/bndrylib/COORDSYS_1D.F0000644000175000017500000001654611634153073021400 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #undef BL_LANG_CC #define BL_LANG_FORT #include "REAL.H" #include "CONSTANTS.H" #include "COORDSYS_F.H" #include "DIMS.H" #define SDIM 1 c :: ---------------------------------------------------------- c :: SETVOL c :: Compute the volume of each cell c :: c :: INPUTS / OUTPUTS: c :: vol <= volume array c :: vlo,vhi => index limits of vol array c :: offset => shift to origin of computational domain c :: dx => cell size c :: coord => coordinate flag (0 = cartesian, 1 = RZ, 2 = spherical) c :: ---------------------------------------------------------- c :: subroutine FORT_SETVOL(vol,DIMS(vol),offset,dx,coord) integer DIMDEC(vol) integer coord REAL_T dx(SDIM), offset(SDIM) REAL_T vol(DIMV(vol)) integer i, j REAL_T ri, ro, v REAL_T RZFACTOR parameter (RZFACTOR = 2.d0*3.14159265358979323846d0) if (coord .eq. 0) then c ::::: cartesian v = dx(1) do i = ARG_L1(vol), ARG_H1(vol) vol(i) = v enddo else if(coord .eq. 1) then c ::: 1D cylindrical do i = ARG_L1(vol), ARG_H1(vol) ri = offset(1) + dx(1)*i ro = ri + dx(1) v = half*(RZFACTOR)*(ro**2 - ri**2) vol(i) = abs(v) enddo else if(coord .eq. 2) then c ::::: 1D spherical do i = ARG_L1(vol), ARG_H1(vol) ri = offset(1) + dx(1)*i ro = ri + dx(1) v = (two3rd*RZFACTOR)*(ro**3 - ri**3) vol(i) = abs(v) enddo else call bl_abort('bogus value of coord... bndrylib::SETVOL') endif endif endif return end subroutine FORT_SETVOLPT(vol, volloi1, volhii1, $ ro, roloi1, rohii1, ri, riloi1, rihii1, dx, coord) integer volloi1, volhii1 integer roloi1, rohii1, riloi1, rihii1 integer coord REAL_T dx(SDIM) REAL_T vol(volloi1:volhii1) REAL_T ro(roloi1:rohii1) REAL_T ri(riloi1:rihii1) integer i,j REAL_T RZFACTOR parameter (RZFACTOR = 2.d0*3.14159265358979323846d0) c c note that dx is usually unity. dx not unity is used by the nfluid c slic reconstruction c if(coord .eq. 0) then do i = roloi1, rohii1 vol(i) = (ro(i)-ri(i)) enddo else if(coord .eq. 1) then do i = roloi1, rohii1 vol(i) = half*RZFACTOR*(ro(i)**2 - ri(i)**2) vol(i) = abs(vol(i)) enddo else if (coord .eq. 2) then do i = roloi1, rohii1 vol(i) = two3rd*RZFACTOR*(ro(i)**3-ri(i)**3) vol(i) = abs(vol(i)) enddo else call bl_abort('bogus value of coord ... bndrylib::SETVOLPT') endif endif endif return end c :: ---------------------------------------------------------- c :: SETDLOGA c :: Compute d(log(A))/dr in each cell c :: c :: INPUTS / OUTPUTS: c :: dloga <= dloga array c :: dlo,dhi => index limits of dloga array c :: offset => shift to origin of computational domain c :: dx => cell size c :: coord => coordinate flag (0 = cartesian, 1 = RZ) c :: ---------------------------------------------------------- c :: subroutine FORT_SETDLOGA(dloga,DIMS(dloga),offset,dx,dir,coord) integer DIMDEC(dloga) integer coord REAL_T dx(SDIM), offset(SDIM) REAL_T dloga(DIMV(dloga)) integer dir integer i, j REAL_T ri, ro, dlga if (coord .eq. 0) then c ::::: cartesian do i = ARG_L1(dloga), ARG_H1(dloga) dloga(i) = zero enddo else c ::: 1D cylindrical if(coord .eq. 1) then do i = ARG_L1(dloga), ARG_H1(dloga) ri = offset(1) + dx(1)*i ri = abs(ri) ro = ri + dx(1) ro = abs(ro) dlga = two/(ro+ri) dloga(i) = dlga enddo else if( coord .eq. 2 ) then c ::::: 1d spherical do i = ARG_L1(dloga), ARG_H1(dloga) ri = offset(1) + dx(1)*i ri = abs(ri) ro = ri + dx(1) ro = abs(ro) dlga = four/(ro+ri) dloga(i) = dlga enddo else call abort('setdloga: illegal coordinate system') endif endif endif return end c :: ---------------------------------------------------------- c :: SETAREA c :: Compute the area of given cell face c :: c :: INPUTS / OUTPUTS: c :: area <= area array c :: alo,ahi => index limits of area array c :: offset => shift to origin of computational domain c :: dx => cell size c :: coord => coordinate flag (0 =cartesian, 1 = RZ, 2 = spherical) c :: ---------------------------------------------------------- c :: subroutine FORT_SETAREA(area,DIMS(area),offset,dx,dir,coord) integer DIMDEC(area) integer coord, dir REAL_T dx(SDIM), offset(SDIM) REAL_T area(DIMV(area)) integer i, j REAL_T ri, ro, a REAL_T RZFACTOR parameter (RZFACTOR = 2.d0*3.14159265358979323846d0) if (coord .eq. 0) then c ::::: cartesian do i = ARG_L1(area), ARG_H1(area) area(i) = one enddo else c ::::: 1d spherical if(coord .eq. 1) then do i = ARG_L1(area), ARG_H1(area) ri = offset(1) + dx(1)*i a = RZFACTOR*ri area(i) = abs(a) enddo else if( coord .eq. 2) then do i = ARG_L1(area), ARG_H1(area) ri = offset(1) + dx(1)*i a = two*RZFACTOR*ri*ri area(i) = abs(a) enddo else call bl_abort('bogus value for coord... SETAREA') endif endif endif return end ccseapps-2.5/CCSEApps/bndrylib/OpenSource.txt0000644000175000017500000002435111634153073022314 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: BndryLib Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/bndrylib/COORDSYS_2D.F0000644000175000017500000002351311634153073021371 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: COORDSYS_2D.F,v 1.10 2002/12/30 22:09:45 almgren Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "COORDSYS_F.H" #include "ArrayLim.H" #define SDIM 2 c :: ---------------------------------------------------------- c :: SETVOL c :: Compute the volume of each cell c :: c :: INPUTS / OUTPUTS: c :: vol <= volume array c :: vlo,vhi => index limits of vol array c :: offset => shift to origin of computational domain c :: dx => cell size c :: coord => coordinate flag (0 = cartesian, 1 = RZ, 2 = RTHETA) c :: ---------------------------------------------------------- c :: subroutine FORT_SETVOL(vol,DIMS(vol),offset,dx,coord) integer DIMDEC(vol) integer coord REAL_T dx(SDIM), offset(SDIM) REAL_T vol(DIMV(vol)) integer i, j REAL_T ri, ro, pi, po, v REAL_T RZFACTOR parameter (RZFACTOR = 2.d0*3.14159265358979323846d0) if (coord .eq. 0) then c c ::::: cartesian c v = dx(1)*dx(2) do j = ARG_L2(vol), ARG_H2(vol) do i = ARG_L1(vol), ARG_H1(vol) vol(i,j) = v end do end do elseif(coord .eq. 1) then c c ::::: R-Z c do i = ARG_L1(vol), ARG_H1(vol) ri = offset(1) + dx(1)*i ro = ri + dx(1) v = (half*RZFACTOR)*dx(2)*dx(1)*(ro + ri) do j = ARG_L2(vol), ARG_H2(vol) vol(i,j) = abs(v) end do end do elseif(coord .eq. 2) then c c ::::: R-THETA c do i = ARG_L1(vol), ARG_H1(vol) ri = offset(1) + dx(1)*i ro = ri + dx(1) do j = ARG_L2(vol), ARG_H2(vol) pi = offset(2) + dx(2)*j po = pi + dx(2) v = RZFACTOR*(ro**3 - ri**3)*(cos(pi)-cos(po))/three vol(i,j) = abs(v) enddo enddo end if end c======================================================== c======================================================== subroutine FORT_SETVOLPT(vol, $ ro, ri, po, pi, dx, coord) integer coord REAL_T dx(SDIM) REAL_T vol REAL_T ro, po, pi REAL_T ri REAL_T RZFACTOR parameter (RZFACTOR = 2*Pi) if(coord .eq. 0) then vol = (ro-ri)*dx(2) elseif(coord .eq. 1) then vol = half*RZFACTOR*dx(2)*(ro**2 - ri**2) vol = abs(vol) elseif(coord .eq. 2) then vol = RZFACTOR*(ro**3-ri**3)*(cos(pi)-cos(po))/three else call bl_abort('bogus value of coord ... bndrylib::SETVOLPT') endif return end c :: ---------------------------------------------------------- c :: SETDLOGA c :: Compute d(log(A))/dr in each cell c :: c :: INPUTS / OUTPUTS: c :: dloga <= dloga array c :: dlo,dhi => index limits of dloga array c :: offset => shift to origin of computational domain c :: dx => cell size c :: coord => coordinate flag (0 = cartesian, 1 = RZ) c :: ---------------------------------------------------------- c :: subroutine FORT_SETDLOGA(dloga,DIMS(dloga),offset,dx,dir,coord) integer DIMDEC(dloga) integer coord REAL_T dx(SDIM), offset(SDIM) REAL_T dloga(DIMV(dloga)) integer dir integer i, j REAL_T ri, ro, dlga, po, pi if (coord .eq. 0) then c c ::::: cartesian c do j = ARG_L2(dloga), ARG_H2(dloga) do i = ARG_L1(dloga), ARG_H1(dloga) dloga(i,j) = zero end do end do else if( coord .eq. 1 ) then c c ::::: R-Z c if( dir .eq. 0 ) then do i = ARG_L1(dloga), ARG_H1(dloga) ri = offset(1) + dx(1)*i ro = ri + dx(1) dlga = two/(ro+ri) do j = ARG_L2(dloga), ARG_H2(dloga) dloga(i,j) = dlga end do end do else if( dir .eq. 1 ) then do i = ARG_L1(dloga), ARG_H1(dloga) ri = offset(1) + dx(1)*i ro = ri + dx(1) dlga = two/(ro+ri) do j = ARG_L2(dloga), ARG_H2(dloga) dloga(i,j) = zero end do end do else call bl_abort('setdloga: illegal direction') end if else if( coord .eq. 2) then if(dir .eq. 0) then do i = ARG_L1(dloga), ARG_H1(dloga) ri = offset(1) + dx(1)*i ri = ri ro = ri + dx(1) ro = ro dlga = four/(ro+ri) do j = ARG_L2(dloga), ARG_H2(dloga) dloga(i,j) = dlga enddo enddo elseif(dir .eq. 1) then do i = ARG_L1(dloga), ARG_H1(dloga) ri = offset(1) + dx(1)*i ri = ri ro = ri + dx(1) ro = ro dlga = two/(ro+ri) do j = ARG_L2(dloga), ARG_H2(dloga) pi = offset(2) + dx(2)*j po = pi + dx(2) dloga(i,j) = dlga/tan(half*(pi+po)) enddo enddo else call bl_abort('setdloga: illegal coordinate system') endif end if end c :: ---------------------------------------------------------- c :: SETAREA c :: Compute the area of given cell face c :: c :: INPUTS / OUTPUTS: c :: area <= area array c :: alo,ahi => index limits of area array c :: offset => shift to origin of computational domain c :: dx => cell size c :: coord => coordinate flag (0 =cartesian, 1 = RZ) c :: ---------------------------------------------------------- c :: subroutine FORT_SETAREA(area,DIMS(area),offset,dx,dir,coord) integer DIMDEC(area) integer coord, dir REAL_T dx(SDIM), offset(SDIM) REAL_T area(DIMV(area)) integer i, j REAL_T ri, ro, a, pi, po REAL_T RZFACTOR parameter (RZFACTOR = 2.d0*3.14159265358979323846d0) if (coord .eq. 0) then c c ::::: cartesian c if (dir .eq. 0) then do j = ARG_L2(area), ARG_H2(area) do i = ARG_L1(area), ARG_H1(area) area(i,j) = dx(2) end do end do else do j = ARG_L2(area), ARG_H2(area) do i = ARG_L1(area), ARG_H1(area) area(i,j) = dx(1) end do end do end if elseif(coord .eq. 1) then c c ::::: R-Z c if (dir .eq. 0) then do i = ARG_L1(area), ARG_H1(area) ri = offset(1) + dx(1)*i a = RZFACTOR*ri*dx(2) do j = ARG_L2(area), ARG_H2(area) area(i,j) = abs(a) end do end do else do i = ARG_L1(area), ARG_H1(area) ri = offset(1) + dx(1)*i ro = ri + dx(1) a = dx(1)*(half*RZFACTOR)*(ri + ro) do j = ARG_L2(area), ARG_H2(area) area(i,j) = abs(a) end do end do end if elseif(coord .eq. 2) then if (dir .eq. 0) then do i = ARG_L1(area), ARG_H1(area) ri = offset(1) + dx(1)*i do j = ARG_L2(area), ARG_H2(area) pi = offset(2) + dx(2)*j po = pi + dx(2) a = RZFACTOR*ri*ri*(cos(pi)-cos(po)) area(i,j) = abs(a) enddo enddo elseif(dir .eq. 1) then do i = ARG_L1(area), ARG_H1(area) ri = offset(1) + dx(1)*i ro = ri + dx(1) do j = ARG_L2(area), ARG_H2(area) pi = offset(2) + dx(2)*j a = RZFACTOR*sin(pi)*(ro**2 - ri**2)/two area(i,j) = abs(a) enddo enddo else write(6,*)' bogus dir ', dir call bl_abort(" ") endif end if end ccseapps-2.5/CCSEApps/hgproj/0000755000175000017500000000000011634153073017150 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/hgproj/Make.package0000644000175000017500000000147211634153073021346 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.19 2002/09/03 16:42:40 car Exp $ # HGPROJ_BASE=EXE ifeq ($(LBASE),proj) HGPROJ_BASE=LIB endif C$(HGPROJ_BASE)_sources += \ interface.cpp boundary.cpp interpolator.cpp \ restrictor.cpp fill_patch.cpp amr_multi.cpp \ hg_multi1.cpp hg_multi2.cpp hg_multi3.cpp \ hg_projector.cpp hgparallel.cpp C$(HGPROJ_BASE)_headers += \ interface.H boundary.H interpolator.H \ restrictor.H fill_patch.H amr_multi.H \ hg_multi.H \ hg_projector.H hgparallel.H C$(HGPROJ_BASE)_headers += amr_defs.H f$(HGPROJ_BASE)_sources += amr_real$(DIM)d.f hg_proj$(DIM)d.f hg_avg$(DIM)d.f f$(HGPROJ_BASE)_sources += hg_multi$(DIM)d.f f$(HGPROJ_BASE)_sources += hg_multi$(DIM)d_terrain.f f$(HGPROJ_BASE)_sources += hg_multi$(DIM)d_full.f ccseapps-2.5/CCSEApps/hgproj/boundary.H0000644000175000017500000001565111634153073021114 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BOUNDARY_H_ #define _BOUNDARY_H_ #include "interface.H" #include "RegType.H" // // This is the base class for all amr_boundaries. The default function dir // should always be acceptable. The default box and check_against_boundary // functions are appropriate for wall-type boundaries. The default // boundary_mesh function is appropriate for all boundary types I've // created so far, since it is little more than a front end for the // internal work routine check_against_boundary. // // // The domain (2nd Box) arguments to dir and box should be cell-based // regardless of the type of the region. // class amr_boundary { public: virtual ~amr_boundary () = 0; int dir (const Box&, const Box&) const; void boundary_mesh (BoxArray& exterior_mesh, int*& grid_ref, const BoxArray& interior_mesh, const Box& domain) const; virtual void fill (FArrayBox&, const Box&, const FArrayBox&, const Box&) const = 0; virtual void sync_borders (MultiFab&, const level_interface&) const = 0; virtual void fill_borders (MultiFab& r, const level_interface& lev_interface, int w) const = 0; // This is the same as the fill_borders routine except that it // doesn't fill outside periodic boundaries virtual void fill_sync_reg_borders (MultiFab& r, const level_interface& lev_interface, int w) const = 0; virtual void duplicate (std::list&, const Box&) const = 0; virtual bool singular () const = 0; virtual Box anImage (const Box& region, const Box& srcbox, const Box& domain) const = 0; protected: virtual Box box_ (const Box&, const Box&, int) const = 0; virtual void fill_ (FArrayBox&, const Box&, const FArrayBox&, const Box&, const Box&, int) const = 0; virtual void check_against_boundary_ (BoxList& bl, std::list& il, const Box& b, int ib, const Box& d, int dim1) const = 0; }; // // This is the base class for physical boundary conditions of the // types used in the AMR code. Members return appropriate // amr_boundary objects for various flow variables. The defaults // are all error_boundary, so this class should only be used as // a base for derivation. // class amr_fluid_boundary { public: amr_fluid_boundary (); virtual ~amr_fluid_boundary (); virtual const amr_boundary* velocity (int i) const; virtual const amr_boundary* scalar() const; virtual const amr_boundary* pressure() const; virtual const amr_boundary* terrain_sigma() const; protected: amr_boundary *v[BL_SPACEDIM]; amr_boundary *s; amr_boundary *p; amr_boundary *ts; }; // // This is the object returned by the inviscid_fluid_boundary class. // It chooses among periodic, reflection and negation boundary behavior // based on the boundary types accessed through the pointer and the // flow direction flowdim. // flowdim = -1 indicates an advected scalar // flowdim = -2 indicates a pressure // flowdim = -3 indicates a streamfunction // flowdim = -4 indicates the terrain sigma (all components) // class inviscid_fluid_boundary; class mixed_boundary : public amr_boundary { public: mixed_boundary (inviscid_fluid_boundary* Ptr, int idim) ; virtual void fill (FArrayBox&, const Box&, const FArrayBox&, const Box&) const; virtual void sync_borders (MultiFab&, const level_interface&) const; virtual void fill_borders (MultiFab& r, const level_interface& lev_interface, int w) const; // This is the same as the fill_borders routine except that it // doesn't fill outside periodic boundaries virtual void fill_sync_reg_borders (MultiFab& r, const level_interface& lev_interface, int w) const; virtual void duplicate (std::list& bl, const Box& domain) const; virtual bool singular () const; virtual Box anImage (const Box& region, const Box& srcbox, const Box& domain) const; protected: virtual Box box_ (const Box&, const Box&, int) const; virtual void fill_ (FArrayBox&, const Box&, const FArrayBox&, const Box&, const Box&, int) const; virtual void check_against_boundary_ (BoxList& bl, std::list& il, const Box& b, int ib, const Box& d, int dim1) const; // // The data. // const inviscid_fluid_boundary* ptr; const int flowdim; }; // This is a simple boundary condition with slip walls. // Takes an array of RegType specifiers, one for each side of // the domain. Currently only periodic and refWall type // boundaries are supported. class inviscid_fluid_boundary : public amr_fluid_boundary { friend class mixed_boundary; public: explicit inviscid_fluid_boundary(const RegType Bc[BL_SPACEDIM][2]); virtual ~inviscid_fluid_boundary(); RegType getLoBC(int idim) const; RegType getHiBC(int idim) const; protected: RegType bc[BL_SPACEDIM][2]; }; #endif /*_BOUNDARY_H_*/ ccseapps-2.5/CCSEApps/hgproj/files.2d0000644000175000017500000000145111634153073020502 0ustar amckinstryamckinstry THESE WORK FOR ALL REFWALL OR PERIODIC IN X gr0 gr0a gr0b gr1 gr.11 gr.15 gr.16 gr.19 gr.19l3 gr.19s2 gr.19s2.4 gr.19s4 gr.19s4.1 gr1rick2 gr1mike.thin gr2 gr2.0 gr2.1 gr.292.11 gr.292.25 gr2a2 gr2a4 gr2ann.l0 gr2ann.l1 gr2ann.l2 gr2ann.p1 gr2ann.p2 gr2ann.p3 gr2ann.p4 gr2ann.p5 gr2ann.p6 gr2b gr2c gr2cross gr2d gr2d2 gr2d4 gr2dave gr2e gr2f gr2g gr2h gr2.inf gr2mike gr2mike1 gr2mike2 gr2mike3 gr2r1 gr2r2 gr2r3 gr3a gr3ann gr3ann2 gr3b gr3c gr3mike.3 gr3rick gr4 gr.7 gr.8 gr.8a gr.ann.1 gr.sstanley.1 THESE HAVE GRIDS INCOMPATIBLE WITH PERIODIC IN X gr2ann WORKS FOR REFWALL, NOT VALID GRIDS FOR PERIODIC gr3mike WORKS FOR REFWALL, NOT VALID GRIDS FOR PERIODIC gr3.rz WORKS FOR REFWALL, NOT VALID GRIDS FOR PERIODIC gr4level WORKS FOR REFWALL, NOT VALID GRIDS FOR PERIODIC IN X ccseapps-2.5/CCSEApps/hgproj/amr_defs.H0000644000175000017500000000531611634153073021046 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _AMR_DEFS_H_ #define _AMR_DEFS_H_ #include #include #define intRS D_DECL(const int&, const int&, const int&) #define intS intRS, intRS #define RealPS D_DECL(Real*, Real*, Real*) #define CRealPS D_DECL(const Real*, const Real*, const Real*) #if (BL_SPACEDIM == 1) #define DIMLIST(a) a.smallEnd(0), a.bigEnd(0) #elif (BL_SPACEDIM == 2) #define DIMLIST(a) a.smallEnd(0), a.bigEnd(0), a.smallEnd(1), a.bigEnd(1) #elif (BL_SPACEDIM == 3) #define DIMLIST(a) a.smallEnd(0), a.bigEnd(0), a.smallEnd(1), a.bigEnd(1), a.smallEnd(2), a.bigEnd(2) #endif #include "hgparallel.H" extern bool HG_is_debugging; // // Index type helper functions: // inline IntVect type (const FArrayBox& f) { return f.box().type(); } inline IndexType::CellIndex type (const FArrayBox& f, int idir) { return f.box().type(idir); } inline IntVect type (const FabArray& r) { BL_ASSERT(r.size() > 0 && r.boxArray().ok()); return r.box(0).type(); } inline IndexType::CellIndex type (const FabArray& r, int idir) { BL_ASSERT(r.size() > 0 && r.boxArray().ok()); return r.box(0).type(idir); } #ifdef HG_DEBUG void hg_debug_norm_2 (const MultiFab& d, const char* str1, const char* str2); #include extern std::ofstream debug_out; #define HG_DEBUG_OUT(s) debug_out << s #define HG_TEST_NORM(d, s) hg_debug_norm_2(d, s, #d) #else #define HG_DEBUG_OUT(s) #define HG_TEST_NORM(d, s) #endif #endif /*_AMR_DEFS_H_*/ ccseapps-2.5/CCSEApps/hgproj/hg_multi2d_full.f0000644000175000017500000005445211634153073022411 0ustar amckinstryamckinstryc----------------------------------------------------------------------- subroutine hgfres_full( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & fdst, fdstl0, fdsth0, fdstl1, fdsth1, & cdst, cdstl0, cdsth0, cdstl1, cdsth1, & sigmaf, sfl0, sfh0, sfl1, sfh1, & sigmac, scl0, sch0, scl1, sch1, & regl0, regh0, regl1, regh1, & hx, hy, ir, jr, idim, idir, idd1) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer fdstl0, fdsth0, fdstl1, fdsth1 integer cdstl0, cdsth0, cdstl1, cdsth1 integer sfl0, sfh0, sfl1, sfh1 integer scl0, sch0, scl1, sch1 integer regl0, regh0, regl1, regh1 double precision hx, hy double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1) double precision sigmaf(sfl0:sfh0,sfl1:sfh1, 2) double precision sigmac(scl0:sch0,scl1:sch1, 2) integer ir, jr, idim, idir double precision fac0, fac1, tmp integer i, j, is, js, m, n integer idd1 if (idim .eq. 0) then i = regl0 if (idir .eq. 1) then is = i - 1 else is = i end if fac0 = 1.d0 / 6.d0 do j = regl1, regh1 res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * & (sigmac(is,j-1,1) * & (cdst(i-idir,j-1) - cdst(i,j-1) + & 2.d0 * (cdst(i-idir,j) - cdst(i,j))) + & sigmac(is,j,1) * & (cdst(i-idir,j+1) - cdst(i,j+1) + & 2.d0 * (cdst(i-idir,j) - cdst(i,j))) + & sigmac(is,j-1,2) * & (cdst(i-idir,j-1) - cdst(i-idir,j) + & 2.d0 * (cdst(i,j-1) - cdst(i,j))) + & sigmac(is,j,2) * & (cdst(i-idir,j+1) - cdst(i-idir,j) + & 2.d0 * (cdst(i,j+1) - cdst(i,j))) & ) end do fac0 = fac0 / jr i = i * ir if (idir .eq. 1) then is = i else is = i - 1 end if do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5d0 * fac1 do j = jr*regl1, jr*regh1, jr tmp = & sigmaf(is,j-n-1,1) * & (fdst(i+idir,j-n-1) - fdst(i,j-n-1) + & 2.d0 * (fdst(i+idir,j-n) - fdst(i,j-n))) + & sigmaf(is,j-n,1) * & (fdst(i+idir,j-n+1) - fdst(i,j-n+1) + & 2.d0 * (fdst(i+idir,j-n) - fdst(i,j-n))) + & sigmaf(is,j+n-1,1) * & (fdst(i+idir,j+n-1) - fdst(i,j+n-1) + & 2.d0 * (fdst(i+idir,j+n) - fdst(i,j+n))) + & sigmaf(is,j+n,1) * & (fdst(i+idir,j+n+1) - fdst(i,j+n+1) + & 2.d0 * (fdst(i+idir,j+n) - fdst(i,j+n))) res(i,j) = res(i,j) - fac1 * (tmp + & sigmaf(is,j-n-1,2) * & (fdst(i+idir,j-n-1) - fdst(i+idir,j-n) + & 2.d0 * (fdst(i,j-n-1) - fdst(i,j-n))) + & sigmaf(is,j-n,2) * & (fdst(i+idir,j-n+1) - fdst(i+idir,j-n) + & 2.d0 * (fdst(i,j-n+1) - fdst(i,j-n))) + & sigmaf(is,j+n-1,2) * & (fdst(i+idir,j+n-1) - fdst(i+idir,j+n) + & 2.d0 * (fdst(i,j+n-1) - fdst(i,j+n))) + & sigmaf(is,j+n,2) * & (fdst(i+idir,j+n+1) - fdst(i+idir,j+n) + & 2.d0 * (fdst(i,j+n+1) - fdst(i,j+n))) & ) end do end do else j = regl1 if (idir .eq. 1) then js = j - 1 else js = j end if fac0 = 1.d0 / 6.d0 do i = regl0, regh0 res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * & (sigmac(i-1,js,1) * & (cdst(i-1,j-idir) - cdst(i,j-idir) + & 2.d0 * (cdst(i-1,j) - cdst(i,j))) + & sigmac(i,js,1) * & (cdst(i+1,j-idir) - cdst(i,j-idir) + & 2.d0 * (cdst(i+1,j) - cdst(i,j))) + & sigmac(i-1,js,2) * & (cdst(i-1,j-idir) - cdst(i-1,j) + & 2.d0 * (cdst(i,j-idir) - cdst(i,j))) + & sigmac(i,js,2) * & (cdst(i+1,j-idir) - cdst(i+1,j) + & 2.d0 * (cdst(i,j-idir) - cdst(i,j))) & ) end do fac0 = fac0 / ir j = j * jr if (idir .eq. 1) then js = j else js = j - 1 end if do m = 0, ir-1 fac1 = (ir-m) * fac0 if (m .eq. 0) fac1 = 0.5d0 * fac1 do i = ir*regl0, ir*regh0, ir tmp = & sigmaf(i-m-1,js,1) * & (fdst(i-m-1,j+idir) - fdst(i-m,j+idir) + & 2.d0 * (fdst(i-m-1,j) - fdst(i-m,j))) + & sigmaf(i-m,js,1) * & (fdst(i-m+1,j+idir) - fdst(i-m,j+idir) + & 2.d0 * (fdst(i-m+1,j) - fdst(i-m,j))) + & sigmaf(i+m-1,js,1) * & (fdst(i+m-1,j+idir) - fdst(i+m,j+idir) + & 2.d0 * (fdst(i+m-1,j) - fdst(i+m,j))) + & sigmaf(i+m,js,1) * & (fdst(i+m+1,j+idir) - fdst(i+m,j+idir) + & 2.d0 * (fdst(i+m+1,j) - fdst(i+m,j))) res(i,j) = res(i,j) - fac1 * (tmp + & sigmaf(i-m-1,js,2) * & (fdst(i-m-1,j+idir) - fdst(i-m-1,j) + & 2.d0 * (fdst(i-m,j+idir) - fdst(i-m,j))) + & sigmaf(i-m,js,2) * & (fdst(i-m+1,j+idir) - fdst(i-m+1,j) + & 2.d0 * (fdst(i-m,j+idir) - fdst(i-m,j))) + & sigmaf(i+m-1,js,2) * & (fdst(i+m-1,j+idir) - fdst(i+m-1,j) + & 2.d0 * (fdst(i+m,j+idir) - fdst(i+m,j))) + & sigmaf(i+m,js,2) * & (fdst(i+m+1,j+idir) - fdst(i+m+1,j) + & 2.d0 * (fdst(i+m,j+idir) - fdst(i+m,j))) & ) end do end do end if end c----------------------------------------------------------------------- subroutine hgcres_full( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & fdst, fdstl0, fdsth0, fdstl1, fdsth1, & cdst, cdstl0, cdsth0, cdstl1, cdsth1, & sigmaf, sfl0, sfh0, sfl1, sfh1, & sigmac, scl0, sch0, scl1, sch1, & regl0, regh0, regl1, regh1, & hx, hy, ir, jr, ga, idd) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer fdstl0, fdsth0, fdstl1, fdsth1 integer cdstl0, cdsth0, cdstl1, cdsth1 integer sfl0, sfh0, sfl1, sfh1 integer scl0, sch0, scl1, sch1 integer regl0, regh0, regl1, regh1 double precision hx, hy double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1) double precision sigmaf(sfl0:sfh0,sfl1:sfh1, 2) double precision sigmac(scl0:sch0,scl1:sch1, 2) integer ir, jr, ga(0:1,0:1), idd double precision sum, fac, fac1 integer ic, jc, if, jf, ii, ji, idir, jdir, m, n ic = regl0 jc = regl1 if = ic * ir jf = jc * jr sum = 0.d0 c quadrants do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) .eq. 1) then sum = sum & + sigmaf(if+ii-1,jf+ji-1,1) * & (fdst(if+idir,jf+jdir) - fdst(if,jf+jdir) & + 2.d0 * (fdst(if+idir,jf) - fdst(if,jf))) & + sigmaf(if+ii-1,jf+ji-1,2) * & (fdst(if+idir,jf+jdir) - fdst(if+idir,jf) & + 2.d0 * (fdst(if,jf+jdir) - fdst(if,jf))) else sum = sum & + sigmac(ic+ii-1,jc+ji-1,1) * & (cdst(ic+idir,jc+jdir) - cdst(ic,jc+jdir) & + 2.d0 * (cdst(ic+idir,jc) - cdst(ic,jc))) & + sigmac(ic+ii-1,jc+ji-1,2) * & (cdst(ic+idir,jc+jdir) - cdst(ic+idir,jc) & + 2.d0 * (cdst(ic,jc+jdir) - cdst(ic,jc))) end if end do end do c edges do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) - ga(ii,1-ji) .eq. 1) then fac1 = 1.d0 / ir do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( & + sigmaf(if+m-1,jf+ji-1,1) * & (fdst(if+m-1,jf+jdir) - fdst(if+m,jf+jdir) & + 2.d0 * (fdst(if+m-1,jf) - fdst(if+m,jf))) & + sigmaf(if+m-1,jf+ji-1,2) * & (fdst(if+m-1,jf+jdir) - fdst(if+m-1,jf) & + 2.d0 * (fdst(if+m,jf+jdir) - fdst(if+m,jf))) & + sigmaf(if+m,jf+ji-1,1) * & (fdst(if+m+1,jf+jdir) - fdst(if+m,jf+jdir) & + 2.d0 * (fdst(if+m+1,jf) - fdst(if+m,jf))) & + sigmaf(if+m,jf+ji-1,2) * & (fdst(if+m+1,jf+jdir) - fdst(if+m+1,jf) & + 2.d0 * (fdst(if+m,jf+jdir) - fdst(if+m,jf))) & ) end do end if if (ga(ii,ji) - ga(1-ii,ji) .eq. 1) then fac1 = 1.d0 / jr do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * ( & + sigmaf(if+ii-1,jf+n-1,1) * & (fdst(if+idir,jf+n-1) - fdst(if,jf+n-1) & + 2.d0 * (fdst(if+idir,jf+n) - fdst(if,jf+n))) & + sigmaf(if+ii-1,jf+n-1,2) * & (fdst(if+idir,jf+n-1) - fdst(if+idir,jf+n) & + 2.d0 * (fdst(if,jf+n-1) - fdst(if,jf+n))) & + sigmaf(if+ii-1,jf+n,1) * & (fdst(if+idir,jf+n+1) - fdst(if,jf+n+1) & + 2.d0 * (fdst(if+idir,jf+n) - fdst(if,jf+n))) & + sigmaf(if+ii-1,jf+n,2) * & (fdst(if+idir,jf+n+1) - fdst(if+idir,jf+n) & + 2.d0 * (fdst(if,jf+n+1) - fdst(if,jf+n))) & ) end do end if end do end do c weighting res(if,jf) = src(if,jf) - sum / 6.d0 end c nine-point terrain stencils c----------------------------------------------------------------------- subroutine hgcen_full(cen, cenl0, cenh0, cenl1, cenh1, & sig, sbl0, sbh0, sbl1, sbh1, & regl0, regh0, regl1, regh1) integer cenl0, cenh0, cenl1, cenh1 integer sbl0, sbh0, sbl1, sbh1 integer regl0, regh0, regl1, regh1 double precision cen(cenl0:cenh0,cenl1:cenh1) double precision sig(sbl0:sbh0,sbl1:sbh1, 2) double precision tmp integer i, j do j = regl1, regh1 do i = regl0, regh0 tmp = (sig(i-1,j-1,1) + sig(i-1,j,1) & + sig(i ,j-1,1) + sig(i ,j,1) & + sig(i-1,j-1,2) + sig(i-1,j,2) & + sig(i ,j-1,2) + sig(i ,j,2)) if ( tmp .eq. 0.0 ) then cen(i,j) = 0.0D0 else cen(i,j) = 3.0D0 / tmp end if end do end do c$$$ write(unit = 10, fmt = *) 'cen - hgcen_full' c$$$ write(unit = 10, fmt = *) cen c$$$ write(unit = 10, fmt = *) 'sig' c$$$ write(unit = 10, fmt = *) sig end c----------------------------------------------------------------------- subroutine hgrlx_full( & cor, corl0, corh0, corl1, corh1, & res, resl0, resh0, resl1, resh1, & sig, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1) integer corl0, corh0, corl1, corh1 integer resl0, resh0, resl1, resh1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 double precision cor(corl0:corh0,corl1:corh1) double precision res(resl0:resh0,resl1:resh1) double precision sig(sfl0:sfh0,sfl1:sfh1, 2) double precision cen(cenl0:cenh0,cenl1:cenh1) double precision fac double precision AVG integer i, j AVG()= fac * ( & + sig(i-1,j-1,1) * & (cor(i-1,j-1) - cor(i,j-1) + 2.d0 * cor(i-1,j)) & + sig(i-1,j ,1) * & (cor(i-1,j+1) - cor(i,j+1) + 2.d0 * cor(i-1,j)) & + sig(i ,j-1,1) * & (cor(i+1,j-1) - cor(i,j-1) + 2.d0 * cor(i+1,j)) & + sig(i ,j ,1) * & (cor(i+1,j+1) - cor(i,j+1) + 2.d0 * cor(i+1,j)) & + sig(i-1,j-1,2) * & (cor(i-1,j-1) - cor(i-1,j) + 2.d0 * cor(i,j-1)) & + sig(i-1,j ,2) * & (cor(i-1,j+1) - cor(i-1,j) + 2.d0 * cor(i,j+1)) & + sig(i ,j-1,2) * & (cor(i+1,j-1) - cor(i+1,j) + 2.d0 * cor(i,j-1)) & + sig(i ,j ,2) * & (cor(i+1,j+1) - cor(i+1,j) + 2.d0 * cor(i,j+1)) & ) fac = 1.d0 / 6.d0 do j = regl1, regh1 cdir$ ivdep do i = regl0, regh0 cor(i,j) = (AVG() - res(i,j)) * cen(i,j) end do end do c$$$ write(unit = 10, fmt = *) 'cor' c$$$ write(unit = 10, fmt = *) cor c$$$ write(unit = 10, fmt = *) 'sig' c$$$ write(unit = 10, fmt = *) sig c$$$ write(unit = 10, fmt = *) 'res' c$$$ write(unit = 10, fmt = *) res c$$$ write(unit = 10, fmt = *) 'cen' c$$$ write(unit = 10, fmt = *) cen c$$$ stop end c----------------------------------------------------------------------- subroutine hgres_full( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & dest, destl0, desth0, destl1, desth1, & sig, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer destl0, desth0, destl1, desth1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision dest(destl0:desth0,destl1:desth1) double precision sig(sfl0:sfh0,sfl1:sfh1, 2) double precision cen(cenl0:cenh0,cenl1:cenh1) double precision fac, tmp integer i, j fac = 1.d0 / 6.d0 do j = regl1, regh1 do i = regl0, regh0 tmp = & (sig(i-1,j-1,1) * & (dest(i-1,j-1) - dest(i,j-1) + & 2.d0 * (dest(i-1,j) - dest(i,j))) + & sig(i-1,j,1) * & (dest(i-1,j+1) - dest(i,j+1) + & 2.d0 * (dest(i-1,j) - dest(i,j))) + & sig(i,j-1,1) * & (dest(i+1,j-1) - dest(i,j-1) + & 2.d0 * (dest(i+1,j) - dest(i,j))) + & sig(i,j,1) * & (dest(i+1,j+1) - dest(i,j+1) + & 2.d0 * (dest(i+1,j) - dest(i,j)))) res(i,j) = src(i,j) - fac * (tmp + & (sig(i-1,j-1,2) * & (dest(i-1,j-1) - dest(i-1,j) + & 2.d0 * (dest(i,j-1) - dest(i,j))) + & sig(i-1,j,2) * & (dest(i-1,j+1) - dest(i-1,j) + & 2.d0 * (dest(i,j+1) - dest(i,j))) + & sig(i,j-1,2) * & (dest(i+1,j-1) - dest(i+1,j) + & 2.d0 * (dest(i,j-1) - dest(i,j))) + & sig(i,j,2) * & (dest(i+1,j+1) - dest(i+1,j) + & 2.d0 * (dest(i,j+1) - dest(i,j))))) end do end do end c----------------------------------------------------------------------- subroutine hgrlnf_full( & cor, corl0, corh0, corl1, corh1, & res, resl0, resh0, resl1, resh1, & wrk, wrkl0, wrkh0, wrkl1, wrkh1, & sig, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1, & doml0, domh0, doml1, domh1, & lsd, ipass) integer corl0, corh0, corl1, corh1 integer resl0, resh0, resl1, resh1 integer wrkl0, wrkh0, wrkl1, wrkh1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 integer doml0, domh0, doml1, domh1 double precision cor(corl0:corh0,corl1:corh1) double precision res(resl0:resh0,resl1:resh1) double precision wrk(wrkl0:wrkh0,wrkl1:wrkh1) double precision sig(sfl0:sfh0,sfl1:sfh1, 2) double precision cen(cenl0:cenh0,cenl1:cenh1) integer lsd, ipass double precision fac, betm, aj double precision RHSL0,RHSL1 integer i, j, ioff RHSL0() = (res(i,j) - fac * ( & sig(i-1,j-1,1) * & (cor(i-1,j-1) - cor(i,j-1)) + & sig(i-1,j,1) * & (cor(i-1,j+1) - cor(i,j+1)) + & sig(i,j-1,1) * & (cor(i+1,j-1) - cor(i,j-1)) + & sig(i,j,1) * & (cor(i+1,j+1) - cor(i,j+1)) + & sig(i-1,j-1,2) * & (cor(i-1,j-1) + 2.d0 * cor(i,j-1)) + & sig(i-1,j,2) * & (cor(i-1,j+1) + 2.d0 * cor(i,j+1)) + & sig(i,j-1,2) * & (cor(i+1,j-1) + 2.d0 * cor(i,j-1)) + & sig(i,j,2) * & (cor(i+1,j+1) + 2.d0 * cor(i,j+1)))) RHSL1() = (res(i,j) - fac * ( & sig(i-1,j-1,1) * & (cor(i-1,j-1) + 2.d0 * cor(i-1,j)) + & sig(i-1,j,1) * & (cor(i-1,j+1) + 2.d0 * cor(i-1,j)) + & sig(i,j-1,1) * & (cor(i+1,j-1) + 2.d0 * cor(i+1,j)) + & sig(i,j,1) * & (cor(i+1,j+1) + 2.d0 * cor(i+1,j)) + & sig(i-1,j-1,2) * & (cor(i-1,j-1) - cor(i-1,j)) + & sig(i-1,j,2) * & (cor(i-1,j+1) - cor(i-1,j)) + & sig(i,j-1,2) * & (cor(i+1,j-1) - cor(i+1,j)) + & sig(i,j,2) * & (cor(i+1,j+1) - cor(i+1,j)))) fac = 1.d0 / 6.d0 if (lsd .eq. 0) then if (mod(regl1,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if i = regl0 do j = regl1 + ioff, regh1, 2 aj = fac * & (2.d0 * (sig(i,j-1,1) + sig(i,j,1)) - & (sig(i,j-1,2) + sig(i,j,2))) if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: wrk(i,j) = 0.d0 else if (regl0 .eq. doml0) then c neumann bdy: betm = -cen(i,j) cor(i,j) = RHSL0() * betm wrk(i,j) = 2.d0 * aj * betm end if wrk(i+1,j) = aj end do c forward solve loop: do i = regl0 + 1, regh0 - 1 do j = regl1 + ioff, regh1, 2 aj = wrk(i,j) if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) end if cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm aj = fac * & (2.d0 * (sig(i,j-1,1) + sig(i,j,1)) - & (sig(i,j-1,2) + sig(i,j,2))) wrk(i+1,j) = aj wrk(i,j) = aj * betm end do end do i = regh0 do j = regl1 + ioff, regh1, 2 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: else if (regh0 .eq. domh0) then c neumann bdy: aj = 2.d0 * wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm else if (i .gt. regl0) then c interface to grid at same level: aj = wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm aj = fac * & (2.d0 * (sig(i,j-1,1) + sig(i,j,1)) - & (sig(i,j-1,2) + sig(i,j,2))) wrk(i,j) = aj * betm end if end do else if (mod(regl0,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if j = regl1 do i = regl0 + ioff, regh0, 2 aj = fac * & (2.d0 * (sig(i-1,j,2) + sig(i,j,2)) - & (sig(i-1,j,1) + sig(i,j,1))) if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: wrk(i,j) = 0.d0 else if (regl1 .eq. doml1) then c neumann bdy: betm = -cen(i,j) cor(i,j) = RHSL1() * betm wrk(i,j) = 2.d0 * aj * betm end if wrk(i,j+1) = aj end do c forward solve loop: do j = regl1 + 1, regh1 - 1 do i = regl0 + ioff, regh0, 2 aj = wrk(i,j) if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) end if cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = fac * & (2.d0 * (sig(i-1,j,2) + sig(i,j,2)) - & (sig(i-1,j,1) + sig(i,j,1))) wrk(i,j+1) = aj wrk(i,j) = aj * betm end do end do j = regh1 do i = regl0 + ioff, regh0, 2 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: else if (regh1 .eq. domh1) then c neumann bdy: aj = 2.d0 * wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm else if (j .gt. regl1) then c interface to grid at same level: aj = wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = fac * & (2.d0 * (sig(i-1,j,2) + sig(i,j,2)) - & (sig(i-1,j,1) + sig(i,j,1))) wrk(i,j) = aj * betm end if end do end if end ccseapps-2.5/CCSEApps/hgproj/amr_multi.cpp0000644000175000017500000004755611634153073021666 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include "amr_multi.H" #include //#if BL_SPACEDIM==2 //int amr_multigrid::c_sys = 0; // default is Cartesian, 1 is RZ //#endif #ifdef HG_DEBUG static Real mfnorm_0 (const MultiFab& mf) { Real r = 0; for (MFIter cmfi(mf); cmfi.isValid(); ++cmfi) { Real s = mf[cmfi].norm(mf[cmfi].box(), 0, 0, mf[cmfi].nComp()); r = (r > s) ? r : s; } ParallelDescriptor::ReduceRealMax(r); return r; } static Real mfnorm_2 (const MultiFab& mf) { Real r = 0; for (MFIter cmfi(mf); cmfi.isValid(); ++cmfi) { Real s = mf[cmfi].norm(mf[cmfi].box(), 2, 0, mf[cmfi].nComp()); r += s*s; } ParallelDescriptor::ReduceRealSum(r); return std::sqrt(r); } static Real mfnorm_0_valid (const MultiFab& mf) { Real r = 0; for (MFIter cmfi(mf); cmfi.isValid(); ++cmfi) { Real s = mf[cmfi].norm(cmfi.validbox(), 0, 0, mf[cmfi].nComp()); r = (r > s) ? r : s; } ParallelDescriptor::ReduceRealMax(r); return r; } static Real mfnorm_2_valid (const MultiFab& mf) { Real r = 0; for (MFIter cmfi(mf); cmfi.isValid(); ++cmfi) { Real s = mf[cmfi].norm(cmfi.validbox(), 2, 0, mf[cmfi].nComp()); r += s*s; } ParallelDescriptor::ReduceRealSum(r); return std::sqrt(r); } static const char* mf_centeredness (const MultiFab& m) { if (type(m) == IntVect::TheCellVector()) return "C"; if (type(m) == IntVect::TheNodeVector()) return "N"; return "?"; } void hg_debug_norm_2 (const MultiFab& d, const char* str1, const char* str2) { double dz[4] = { mfnorm_2(d), mfnorm_2_valid(d), mfnorm_0(d), mfnorm_0_valid(d)}; debug_out << str1; if (ParallelDescriptor::IOProcessor()) { debug_out << " : Norm[" << d.size() << "," << mf_centeredness(d) << "," << d.nComp() << "," << d.nGrow() << "]( " << str2 << " ) = (" << dz[0] << "/" << dz[1] << ", " << dz[2] << "/" << dz[3] << " )"; } debug_out << std::endl; } #endif // // Norm helper function: // static Real mfnorm (const MultiFab& mf) { Real r = 0; BL_ASSERT(mf.nComp() == 1); for (MFIter cmfi(mf); cmfi.isValid(); ++cmfi) { Real s = mf[cmfi].norm(0); r = (r > s) ? r : s; } ParallelDescriptor::ReduceRealMax(r); return r; } amr_multigrid::CoordSys amr_multigrid::setCoordSys (CoordSys c_sys_) { CoordSys o_c_sys = c_sys; c_sys = c_sys_; return o_c_sys; } amr_multigrid::CoordSys amr_multigrid::getCoordSys () const { return c_sys; } int amr_multigrid::get_amr_level (int mglev) const { int result = -1; for (int i = lev_min; i <= lev_max; i++) { if (ml_index[i] == mglev) { result = i; break; } } return result; } amr_multigrid::amr_multigrid (const Array& Mesh, const Array& Gen_ratio, int Lev_min_min, int Lev_min_max, int Lev_max_max, const amr_boundary* Boundary, int Pcode) : ml_mesh(Mesh), gen_ratio(Gen_ratio), lev_min_min(Lev_min_min), lev_min_max(Lev_min_max), lev_max_max(Lev_max_max), mg_boundary(Boundary), pcode(Pcode), integrate(0), c_sys(cartesian) {} void amr_multigrid::mesh_read (Array& m, Array& r, Array& d, std::istream& is) { int ilev; is >> ilev; m.resize(ilev); r.resize(ilev-1); d.resize(ilev); for (int ilev = 0; ilev < m.size(); ilev++) { Box b; int igrid; is >> b >> igrid; if (is.fail()) { BoxLib::Abort("amr_multigrid::mesh_read(): failed to read box"); } d.set(ilev, b); if (ilev > 0) { r.set(ilev-1, d[ilev].length() / d[ilev-1].length()); } m[ilev].resize(igrid); for (int igrid = 0; igrid < m[ilev].size(); igrid++) { is >> b; if (is.fail()) { BoxLib::Abort("amr_multigrid::mesh_read(): failed to read box"); } m[ilev].set(igrid, b); } } } void amr_multigrid::mesh_write (const Array& m, const Array& d, std::ostream& os) { os << m.size() << std::endl; for (int ilev = 0; ilev < m.size(); ilev++) { os << " " << d[ilev] << " " << m[ilev].size() << std::endl; for (int igrid = 0; igrid < m[ilev].size(); igrid++) { os << '\t' << m[ilev][igrid] << std::endl; } } } void amr_multigrid::mesh_write (const Array& m, const Array& r, Box fd, std::ostream& os) { for (int ilev = m.size() - 2; ilev >= 0; ilev--) { fd.coarsen(r[ilev]); } os << m.size() << std::endl; for (int ilev = 0; ilev < m.size(); ilev++) { os << " " << fd << " " << m[ilev].size() << std::endl; for (int igrid = 0; igrid < m[ilev].size(); igrid++) { os << '\t' << m[ilev][igrid] << std::endl; } if (ilev <= m.size() - 2) { fd.refine(r[ilev]); } } } amr_multigrid::~amr_multigrid () { // // Note: lev_min is a class member. // for (lev_min = lev_min_min; lev_min <= lev_min_max; lev_min++) { delete [] interface_array[lev_min - lev_min_min]; } delete [] interface_array; } void amr_multigrid::build_mesh (const Box& fdomain) { mg_domain_array.resize(lev_min_max + 1); mg_mesh_array.resize(lev_min_max + 1); interface_array = new level_interface*[lev_min_max - lev_min_min + 1]; if (pcode >= 2 && ParallelDescriptor::IOProcessor()) { mesh_write(ml_mesh, gen_ratio, fdomain, std::cout); } lev_max = lev_max_max; for (lev_min = lev_min_min; lev_min <= lev_min_max; lev_min++) { // // first, build mg_mesh // int nlev = build_down(ml_mesh[lev_max], fdomain, lev_max, IntVect::TheUnitVector(), 0); #ifndef NDEBUG for (int i = 0; i < mg_mesh.size(); i++) BL_ASSERT(mg_mesh[i].ok()); #endif if (pcode >= 2 && ParallelDescriptor::IOProcessor()) { mesh_write(mg_mesh, mg_domain, std::cout); } mg_domain_array.set(lev_min, mg_domain); mg_mesh_array.set(lev_min, mg_mesh); // // Initialize lev_interface. // int ldiff, mglev_common = mg_mesh.size(); if (lev_min > lev_min_min) { ldiff = mg_mesh_array[lev_min - 1].size() - mg_mesh.size(); // // ml_index here is still the index for the previous mg_mesh: // mglev_common = ml_index[lev_min] - ldiff; /* Before IntVect refinement ratios we used mglev_common = ml_index[lev_min - 1] + 1 - ldiff; This can no longer be counted on to work since in a (4,1) case the intermediate levels no longer match. */ mglev_common = (mglev_common > 0) ? mglev_common : 0; } // // ml_index now becomes the index for the current mg_mesh, // will be used below and on the next loop: build_index(); const int imgl = mg_mesh.size(); lev_interface = new level_interface[imgl]; for (int mglev = mg_mesh.size() - 1, lev = lev_max + 1; mglev >= 0; mglev--) { if (lev > lev_min && mglev == ml_index[lev - 1]) { lev--; } if (mglev >= mglev_common) { lev_interface[mglev].copy( interface_array[lev_min - 1 - lev_min_min][mglev+ldiff]); } else { if (mglev == ml_index[lev]) { lev_interface[mglev].alloc( mg_mesh[mglev], mg_domain[mglev], mg_boundary); } else { IntVect rat = mg_domain[mglev+1].length() / mg_domain[mglev].length(); lev_interface[mglev].alloc_coarsened( mg_mesh[mglev], mg_boundary, lev_interface[mglev + 1], rat); } } } interface_array[lev_min - lev_min_min] = lev_interface; } } void amr_multigrid::build_index () { ml_index.resize(lev_max + 1); for (int i = 0, lev = lev_min; lev <= lev_max; i++) { if (mg_mesh[i] == ml_mesh[lev]) { ml_index[lev] = i; lev++; } } } int amr_multigrid::build_down (const BoxArray& l_mesh, const Box& l_domain, int flev, IntVect rat, int nlev) { if (l_mesh.size() == 0) { mg_mesh.resize(nlev); mg_domain.resize(nlev); nlev = 0; } else { nlev++; BoxArray c_mesh = l_mesh; Box c_domain = l_domain; make_coarser_level(c_mesh, c_domain, flev, rat); nlev = build_down(c_mesh, c_domain, flev, rat, nlev); mg_mesh.set(nlev, l_mesh); mg_domain.set(nlev, l_domain); nlev++; } return nlev; } void amr_multigrid::make_coarser_level (BoxArray& mesh, Box& domain, int& flev, IntVect& rat) { if ( flev > lev_min ) { if ((rat * 2) >= gen_ratio[flev-1]) { mesh = ml_mesh[flev-1]; domain.coarsen(gen_ratio[flev-1] / rat); flev--; rat = IntVect::TheUnitVector(); } else { IntVect trat = rat; rat *= 2; rat.min(gen_ratio[flev-1]); trat = (rat / trat); mesh.coarsen(trat); domain.coarsen(trat); } } else if ( can_coarsen(mesh, domain) ) { rat *= 2; mesh.coarsen(2); domain.coarsen(2); } else { mesh.clear(); } } void amr_multigrid::alloc_amr_multi (PArray& Dest, PArray& Source, PArray& Coarse_source, int Lev_min, int Lev_max) { lev_min = Lev_min; lev_max = Lev_max; BL_ASSERT(lev_min <= lev_max); BL_ASSERT(lev_min >= lev_min_min && lev_min <= lev_min_max && lev_max <= lev_max_max); BL_ASSERT(type(Source[lev_min]) == type(Dest[lev_min])); #ifndef NDEBUG for (int i = lev_min; i <= lev_max; i++) BL_ASSERT(Source[i].boxArray() == Dest[i].boxArray()); #endif // // old version checked that these matched ml_mesh, but that's // harder to do with pure BoxLib. //if (source.mesh() != ml_mesh || dest.mesh() != ml_mesh) // error("alloc---meshes no match"); // dest.resize(lev_max + 1); source.resize(lev_max + 1); coarse_source.resize(lev_max + 1); for (int i = lev_min; i <= lev_max; i++) { dest.set(i, &Dest[i]); source.set(i, &Source[i]); if (i < Coarse_source.size() && Coarse_source.defined(i)) { coarse_source.set(i, &Coarse_source[i]); } } mg_domain = mg_domain_array[lev_min]; mg_mesh = mg_mesh_array[lev_min]; lev_interface = interface_array[lev_min - lev_min_min]; build_index(); mglev_max = ml_index[lev_max]; resid.resize(mglev_max + 1); corr.resize(mglev_max + 1); work.resize(mglev_max + 1); save.resize(lev_max + 1); for (int i = 0; i <= mglev_max; i++) { BoxArray mesh = mg_mesh[i]; mesh.convert(IndexType(type(source[lev_min]))); resid.set(i, new MultiFab(mesh, 1, source[lev_min].nGrow())); corr.set(i, new MultiFab(mesh, 1, dest[lev_min].nGrow())); if (type(dest[lev_min]) == IntVect::TheCellVector()) { work.set(i, new MultiFab(mesh, 1, 0)); } else { work.set(i, new MultiFab(mesh, 1, 1)); } resid[i].setVal(0.0); // // to clear border cells, which will be assigned into corr: // if (work[i].nGrow() > 0) { work[i].setVal(0.0); } } for (int i = lev_min + 1; i <= lev_max - 1; i++) { save.set(i, new MultiFab(dest[i].boxArray(), 1, 0)); } } void amr_multigrid::clear_amr_multi () { for (int i = 0; i <= mglev_max; i++) { if (resid.defined(i)) delete resid.remove(i); if (corr.defined(i)) delete corr.remove(i); if (work.defined(i)) delete work.remove(i); } for (int i = lev_min; i <= lev_max; i++) { if (save.defined(i)) delete save.remove(i); dest.clear(i); source.clear(i); coarse_source.clear(i); } mg_mesh.clear(); } void amr_multigrid::solve (Real reltol, Real abstol, int i1, int i2) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::solve()"); if (lev_max > lev_min) sync_interfaces(); Real norm = 0.0; for (int lev = lev_min; lev <= lev_max; lev++) { const Real lev_norm = mfnorm(source[lev]); norm = (lev_norm > norm) ? lev_norm : norm; } if (coarse_source.size()) { for (int lev = lev_min; lev < lev_max; lev++) { if (coarse_source.defined(lev)) { const Real crse_lev_norm = mfnorm(coarse_source[lev]); norm = (crse_lev_norm > norm) ? crse_lev_norm : norm; } } } if (pcode >= 1 && ParallelDescriptor::IOProcessor()) { std::cout << "HG: Source norm is " << norm << std::endl; } Real err = ml_cycle(lev_max, mglev_max, i1, i2, abstol, 0.0); if (pcode >= 2 && ParallelDescriptor::IOProcessor()) { std::cout << "HG: Err from ml_cycle is " << err << std::endl; } norm = (err > norm) ? err : norm; Real tol = reltol * norm; tol = (tol > abstol) ? tol : abstol; int it = 0; while (err > tol) { err = ml_cycle(lev_max, mglev_max, i1, i2, tol, 0.0); if ( pcode >= 2 && ParallelDescriptor::IOProcessor()) { std::cout << "HG: Err from " << it + 1 << "th ml_cycle is " << err << std::endl; } if (++it > HG::multigrid_maxiter) { BoxLib::Error( "amr_multigrid::solve:" "multigrid iteration failed" ); } } if (pcode >= 1 && ParallelDescriptor::IOProcessor()) { std::cout << "HG: " << it << " cycles required" << std::endl; } // //This final restriction not needed unless you want coarse and fine //potentials to match up for use by the calling program. Coarse //and fine values of dest already match at interfaces, and coarse //values under the fine grids have no effect on subsequent calls to //this solver. //for (lev = lev_max; lev > lev_min; lev--) { // dest[lev].restrict_level(dest[lev-1]); //} } Real amr_multigrid::ml_cycle (int lev, int mglev, int i1, int i2, Real tol, Real res_norm_fine) { HG_DEBUG_OUT( "ml_cycle: lev = " << lev << ", mglev = " << mglev << std::endl ); MultiFab& dtmp = dest[lev]; MultiFab& ctmp = corr[mglev]; // // If level lev+1 exists, resid should be up to date there. // Includes restriction from next finer level. // Real res_norm = ml_residual(mglev, lev); if (pcode >= 2 && ParallelDescriptor::IOProcessor()) { std::cout << "HG: Residual at level " << lev << " is " << res_norm << std::endl; } res_norm = (res_norm_fine > res_norm) ? res_norm_fine : res_norm; // // resid now correct on this level---relax. // ctmp.setVal(0.0); // ctmp.setBndry(0.0); // is necessary? if (lev > lev_min || res_norm > tol) { mg_cycle(mglev, (lev == lev_min) ? i1 : 0, i2); dtmp.plus(ctmp, 0, 1, 0); } if (lev > lev_min) { HG_TEST_NORM( source[lev], "ml_cycle"); HG_TEST_NORM( resid[mglev], "ml_cycle"); HG_TEST_NORM( work[mglev], "ml_cycle"); MultiFab& stmp = source[lev]; MultiFab& rtmp = resid[mglev]; MultiFab& wtmp = work[mglev]; if (lev < lev_max) { save[lev].copy(ctmp); level_residual(wtmp, rtmp, ctmp, mglev, false, 0); rtmp.copy(wtmp); } else { level_residual(rtmp, stmp, dtmp, mglev, false, 0); } interface_residual(mglev, lev); const int mgc = ml_index[lev-1]; res_norm = ml_cycle(lev-1, mgc, i1, i2, tol, res_norm); // // This assignment is only done to clear the borders of work, // so that garbage will not make it into corr and dest. In // some experiments this garbage grew exponentially, creating // an overflow danger even though the legitimate parts of the // calculation were not affected: // wtmp.setVal(0.0); // wtmp.setBndry(0.0); // Is necessary? HG_DEBUG_OUT("ml_cycle: lev > lev_min\n"); mg_interpolate_level(mglev, mgc); ctmp.copy(wtmp); dtmp.plus(ctmp, 0, 1, 0); if (lev < lev_max) { save[lev].plus(ctmp, 0, 1, 0); level_residual(wtmp, rtmp, ctmp, mglev, false, 0); rtmp.copy(wtmp); } else { level_residual(rtmp, stmp, dtmp, mglev, false, 0); } ctmp.setVal(0.0); mg_cycle(mglev, 0, i2); dtmp.plus(ctmp, 0, 1, 0); if (lev < lev_max) { ctmp.plus(save[lev], 0, 1, 0); } HG_TEST_NORM( source[lev], "ml_cycle a"); HG_TEST_NORM( resid[mglev], "ml_cycle a"); HG_TEST_NORM( work[mglev], "ml_cycle a"); } return res_norm; } Real amr_multigrid::ml_residual (int mglev, int lev) { HG_TEST_NORM( resid[mglev], "ml_residual 1"); if (lev > lev_min) { // // This call is necessary to clear garbage values on outside edges that // will not be touched by level_residual, even with the clear flag set. // The restriction routine is responsible for only passing correct // values down from the fine level. Garbage values in dead cells are // a problem because the norm routine sees them. // resid[mglev].setVal(0.0); } // // Clear flag set here because we want to compute a norm, and to // kill a feedback loop by which garbage in the border of dest // could grow exponentially. // level_residual(resid[mglev], source[lev], dest[lev], mglev, true, 0); if (lev < lev_max) { const int mgf = ml_index[lev+1]; work[mgf].copy(resid[mgf]); HG_TEST_NORM( work[mgf], "ml_residual 3"); mg_restrict_level(mglev, mgf); if (coarse_source.size() && coarse_source.defined(lev)) { resid[mglev].plus(coarse_source[lev], 0, 1, 0); } } HG_TEST_NORM( resid[mglev], "ml_residual 2"); return mfnorm(resid[mglev]); } void amr_multigrid::mg_cycle (int mglev, int i1, int i2) { if (mglev == 0) { cgsolve(mglev); } else if (get_amr_level(mglev - 1) == -1) { MultiFab& ctmp = corr[mglev]; MultiFab& wtmp = work[mglev]; relax(mglev, i1, true); HG_TEST_NORM(wtmp, "mg_cycle a"); if (pcode >= 4 ) { wtmp.setVal(0.0); level_residual(wtmp, resid[mglev], ctmp, mglev, true, 0); double nm = mfnorm(wtmp); if ( ParallelDescriptor::IOProcessor() ) { std::cout << "HG: Residual at multigrid level " << mglev << " is " << nm << std::endl; } } else { level_residual(wtmp, resid[mglev], ctmp, mglev, false, 0); } HG_TEST_NORM(wtmp, "mg_cycle a1"); mg_restrict_level(mglev-1, mglev); corr[mglev-1].setVal(0.0); mg_cycle(mglev-1, i1, i2); //wtmp.assign(0.0); mg_interpolate_level(mglev, mglev-1); // // Pitfall? If corr and work both have borders, crud there will // now be put into corr. This does not appear to be a problem, // but if it is it can be avoided by clearing work before // interpolating. // ctmp.plus(wtmp, 0, 1, 0); } relax(mglev, i2, false); // ::exit(0); } ccseapps-2.5/CCSEApps/hgproj/GNUmakefile0000644000175000017500000000535411634153073021231 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.51 2002/09/04 15:29:53 car Exp $ # PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) PRECISION = DOUBLE DEBUG = FALSE DEBUG = TRUE PROFILE = TRUE PROFILE = FALSE DIM = 3 DIM = 2 COMP = cxx COMP = KCC COMP = g++ FCOMP = g77 USE_MPI = TRUE USE_MPI = FALSE NAMESPACE = TRUE NAMESPACE = FALSE # # To build the executable: EBASE=proj LBASE= # EBASE = EBASE = proj ifneq ($(EBASE),proj) override EBASE = override LBASE = proj endif # # Where libraries and include files will be installed. # INSTALL_ROOT = $(PBOXLIB_HOME) include $(TOP)/mk/Make.defs include ./Make.package #CPPFLAGS += -DBL_NOT_USING_NAMESPACE ifeq ($(LBASE),proj) ifeq ($(KCC_VERSION),3.3) CXXFLAGS += --one_instantiation_per_object endif INCLUDE_LOCATIONS += $(TOP)/include ifeq ($(COMP),KCC) LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libbox$(DIM)d.a endif all: $(optionsLib) endif ifeq ($(EBASE),proj) include $(TOP)/bndrylib/Make.package include $(TOP)/BoxLib/Make.package INCLUDE_LOCATIONS += $(TOP)/bndrylib INCLUDE_LOCATIONS += $(TOP)/BoxLib ifeq ($(DEBUG),TRUE) # CPPFLAGS += -DHG_DEBUG # override XTRALIBS += -lefence endif ifeq ($(COMP),KCC) CXXFLAGS += --strict CXXFLAGS += --display_error_number CPPFLAGS += -D__KAI_STRICT CXXFLAGS += --diag_suppress 450 endif ifeq ($(COMP),g++) # CXXFLAGS += -Wall endif ifeq ($(DEBUG),TRUE) FFLAGS += -ffortran-bounds-check endif LIBRARIES += LIBRARY_LOCATIONS += CEXE_sources += proj.cpp vpath %.cpp . $(TOP)/BoxLib $(TOP)/bndrylib vpath %.H . $(TOP)/BoxLib $(TOP)/bndrylib vpath %.F . $(TOP)/BoxLib $(TOP)/bndrylib vpath %.f . $(TOP)/BoxLib $(TOP)/bndrylib all: $(executable) endif #LDFLAGS += -v #CXXFLAGS += -pg -g # # For 3rd ... # #3RD = 0 ifdef 3RD CXXFLAGS += --link_command_prefix 3rd LIBRARIES += -ldnet_stub FDEBF += -automatic endif ifeq ($(MACHINE),T3E) # # Turn off warning about double precision constants. # FOPTF += -M 1110 FDEBF += -M 1110 endif ifeq ($(MACHINE),OSF1) # # Warn about unused variables. # FDEBF += -u endif # # Lower optimization level for this big file # o/3d.OSF1.KCC/hg_multi3d_terrain.o: hg_multi3d_terrain.f @if [ ! -d $(objTempDir) ]; then mkdir -p $(objTempDir); fi @if [ ! -d $(f77TempDir) ]; then mkdir -p $(f77TempDir); fi $(CPP) -DBL_LANG_FORT $(CPPFLAGS) $< | $(FORTPREP) > f/3d.OSF1.KCC/hg_multi3d_terrain.f $(COMPILE.f) $(FEXEFLAGS) -O f/3d.OSF1.KCC/hg_multi3d_terrain.f $(FORT_OUTPUT_OPTION) libs: cd $(TOP)/BoxLib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install clean:: $(RM) gu*_* $(RM) fgu*_* $(RM) core include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/hgproj/inputs0000644000175000017500000000061411634153073020416 0ustar amckinstryamckinstrypcode=4 nrep=1 tol=2.0e-10 geometry.coord_sys=0 geometry.prob_lo=0 0 0 geometry.prob_hi=1 1 1 # # Can be cross, terrain or full. # stencil=cross # # Here's where you can set the boundary conditions. # # Can be periodic, refWall, inflow or outflow. # # bcall sets them all the the specified type. # #bcall=refWall bc00=inflow bc01=outflow bc10=periodic bc11=periodic #bc20=periodic #bc21=periodic ccseapps-2.5/CCSEApps/hgproj/tests/0000755000175000017500000000000011634153073020312 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/hgproj/tests/gr2ann.l00000644000175000017500000000032511634153073021736 0ustar amckinstryamckinstry2 ((0,0) (31,31) (0,0)) 4 ((0,0) (15,15) (0,0)) ((16,0) (31,15) (0,0)) ((0,16) (15,31) (0,0)) ((16,16) (31,31) (0,0)) ((0,0) (63,63) (0,0)) 1 ((20,0) (35,15) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt5s40000644000175000017500000000055111634153073021204 0ustar amckinstryamckinstry2 ((0,0,0) (15,15,15) (0,0,0)) 1 ((0,0,0) (15,15,15) (0,0,0)) ((0,0,0) (63,63,63) (0,0,0)) 8 ((0,16,16) (15,31,47) (0,0,0)) ((0,32,16) (15,47,63) (0,0,0)) ((0,16,48) (15,31,63) (0,0,0)) ((16,0,16) (31,47,31) (0,0,0)) ((16,16,32) (31,31,47) (0,0,0)) ((16,32,32) (31,63,47) (0,0,0)) ((16,16,48) (31,47,63) (0,0,0)) ((32,32,0) (47,47,63) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.ann.10000644000175000017500000000050711634153073021561 0ustar amckinstryamckinstry3 ((0,0) (15,15) (0,0)) 4 ((0,0) (7,7) (0,0)) ((8,0) (15,7) (0,0)) ((0,8) (7,15) (0,0)) ((8,8) (15,15) (0,0)) ((0,0) (31,31) (0,0)) 2 ((8,8) (15,15) (0,0)) ((16,8) (23,15) (0,0)) ((0,0) (63,63) (0,0)) 2 ((24,24) (31,27) (0,0)) ((32,24) (39,27) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtclearlarge0000644000175000017500000004057111634153073022700 0ustar amckinstryamckinstry1 ((0,0,0) (256,256,512) (0,0,0)) 478 ((112,136,120) (127,151,151) (0,0,0)) ((192,208,112) (207,223,119) (0,0,0)) ((192,152,152) (199,159,175) (0,0,0)) ((192,152,56) (207,167,63) (0,0,0)) ((160,136,120) (191,159,151) (0,0,0)) ((112,184,120) (127,207,143) (0,0,0)) ((112,136,152) (119,167,167) (0,0,0)) ((240,152,80) (247,159,87) (0,0,0)) ((224,208,80) (231,215,87) (0,0,0)) ((200,152,152) (215,159,167) (0,0,0)) ((192,152,104) (207,175,119) (0,0,0)) ((192,200,56) (207,207,71) (0,0,0)) ((208,152,96) (231,159,103) (0,0,0)) ((224,176,56) (231,191,63) (0,0,0)) ((160,160,120) (191,183,151) (0,0,0)) ((112,208,128) (127,231,143) (0,0,0)) ((136,136,152) (159,167,183) (0,0,0)) ((120,136,152) (135,151,175) (0,0,0)) ((232,200,72) (239,215,87) (0,0,0)) ((232,168,56) (247,191,63) (0,0,0)) ((224,224,80) (231,239,103) (0,0,0)) ((224,208,112) (231,223,119) (0,0,0)) ((224,200,72) (231,207,87) (0,0,0)) ((224,168,88) (231,191,103) (0,0,0)) ((120,152,152) (135,167,167) (0,0,0)) ((216,224,112) (231,239,119) (0,0,0)) ((0,0,0) (31,23,31) (0,0,0)) ((0,136,0) (31,159,23) (0,0,0)) ((32,136,0) (63,159,23) (0,0,0)) ((0,136,88) (31,159,119) (0,0,0)) ((192,136,0) (207,151,15) (0,0,0)) ((32,136,120) (63,159,151) (0,0,0)) ((232,136,0) (255,159,23) (0,0,0)) ((192,208,0) (207,223,15) (0,0,0)) ((192,152,0) (207,175,23) (0,0,0)) ((64,136,120) (79,159,135) (0,0,0)) ((0,240,104) (31,255,119) (0,0,0)) ((0,248,88) (15,255,103) (0,0,0)) ((232,136,56) (255,151,87) (0,0,0)) ((232,224,56) (255,255,87) (0,0,0)) ((232,152,88) (255,175,119) (0,0,0)) ((192,208,120) (207,223,151) (0,0,0)) ((160,184,120) (191,207,143) (0,0,0)) ((112,232,120) (127,255,135) (0,0,0)) ((248,152,80) (255,167,87) (0,0,0)) ((216,240,80) (231,255,95) (0,0,0)) ((248,184,56) (255,199,71) (0,0,0)) ((128,136,120) (159,151,151) (0,0,0)) ((112,152,120) (127,183,151) (0,0,0)) ((192,168,56) (207,191,63) (0,0,0)) ((160,136,152) (191,159,183) (0,0,0)) ((128,184,120) (159,207,143) (0,0,0)) ((112,184,144) (127,207,175) (0,0,0)) ((208,152,104) (231,175,119) (0,0,0)) ((192,176,104) (207,207,119) (0,0,0)) ((192,152,120) (207,175,151) (0,0,0)) ((128,208,128) (159,231,143) (0,0,0)) ((112,208,144) (127,231,175) (0,0,0)) ((224,0,0) (255,23,31) (0,0,0)) ((192,0,0) (223,23,31) (0,0,0)) ((160,0,0) (191,23,31) (0,0,0)) ((128,0,0) (159,23,31) (0,0,0)) ((96,0,0) (127,23,31) (0,0,0)) ((64,0,0) (95,23,31) (0,0,0)) ((32,0,0) (63,23,31) (0,0,0)) ((0,104,0) (31,135,31) (0,0,0)) ((0,72,0) (31,103,31) (0,0,0)) ((0,48,0) (31,71,31) (0,0,0)) ((0,24,0) (31,47,31) (0,0,0)) ((0,0,160) (31,23,191) (0,0,0)) ((0,0,128) (31,23,159) (0,0,0)) ((0,0,96) (31,23,127) (0,0,0)) ((0,0,64) (31,23,95) (0,0,0)) ((0,0,32) (31,23,63) (0,0,0)) ((0,224,0) (31,255,23) (0,0,0)) ((0,192,0) (31,223,23) (0,0,0)) ((0,160,0) (31,191,23) (0,0,0)) ((0,136,56) (31,159,87) (0,0,0)) ((0,136,24) (31,159,55) (0,0,0)) ((160,136,0) (191,159,23) (0,0,0)) ((128,136,0) (159,159,23) (0,0,0)) ((96,136,0) (127,159,23) (0,0,0)) ((64,136,0) (95,159,23) (0,0,0)) ((32,224,0) (63,255,23) (0,0,0)) ((32,192,0) (63,223,23) (0,0,0)) ((32,160,0) (63,191,23) (0,0,0)) ((32,136,88) (63,159,119) (0,0,0)) ((32,136,56) (63,159,87) (0,0,0)) ((32,136,24) (63,159,55) (0,0,0)) ((0,208,88) (31,239,119) (0,0,0)) ((0,184,88) (31,207,119) (0,0,0)) ((0,160,88) (31,183,119) (0,0,0)) ((0,136,120) (31,159,151) (0,0,0)) ((208,136,0) (231,151,15) (0,0,0)) ((192,136,144) (207,151,175) (0,0,0)) ((192,136,112) (207,151,143) (0,0,0)) ((192,136,80) (207,151,111) (0,0,0)) ((192,136,48) (207,151,79) (0,0,0)) ((192,136,16) (207,151,47) (0,0,0)) ((32,224,120) (63,255,151) (0,0,0)) ((32,192,120) (63,223,151) (0,0,0)) ((32,160,120) (63,191,151) (0,0,0)) ((232,224,0) (255,255,23) (0,0,0)) ((232,192,0) (255,223,23) (0,0,0)) ((232,160,0) (255,191,23) (0,0,0)) ((232,136,24) (255,159,55) (0,0,0)) ((208,208,0) (231,223,15) (0,0,0)) ((192,224,0) (207,255,15) (0,0,0)) ((192,208,48) (207,223,79) (0,0,0)) ((192,208,16) (207,223,47) (0,0,0)) ((208,152,0) (231,175,23) (0,0,0)) ((192,176,0) (207,207,23) (0,0,0)) ((192,152,24) (207,175,55) (0,0,0)) ((80,136,120) (111,159,135) (0,0,0)) ((64,224,120) (79,255,135) (0,0,0)) ((64,192,120) (79,223,135) (0,0,0)) ((64,160,120) (79,191,135) (0,0,0)) ((64,136,136) (79,159,167) (0,0,0)) ((0,240,120) (31,255,151) (0,0,0)) ((232,136,120) (255,151,151) (0,0,0)) ((232,136,88) (255,151,119) (0,0,0)) ((232,224,120) (255,255,151) (0,0,0)) ((232,224,88) (255,255,119) (0,0,0)) ((232,200,88) (255,223,119) (0,0,0)) ((232,176,88) (255,199,119) (0,0,0)) ((232,152,120) (255,175,151) (0,0,0)) ((208,208,120) (231,223,151) (0,0,0)) ((192,224,120) (207,255,151) (0,0,0)) ((160,232,120) (191,255,143) (0,0,0)) ((160,208,120) (191,231,143) (0,0,0)) ((160,184,144) (191,207,175) (0,0,0)) ((128,232,120) (159,255,135) (0,0,0)) ((112,232,136) (127,255,167) (0,0,0)) ((216,240,96) (231,255,119) (0,0,0)) ((248,200,56) (255,223,71) (0,0,0)) ((128,152,120) (159,183,151) (0,0,0)) ((128,184,144) (159,207,175) (0,0,0)) ((208,176,104) (231,207,119) (0,0,0)) ((208,152,120) (231,175,151) (0,0,0)) ((192,176,120) (207,207,151) (0,0,0)) ((128,208,144) (159,231,175) (0,0,0)) ((224,104,0) (255,135,31) (0,0,0)) ((224,72,0) (255,103,31) (0,0,0)) ((224,48,0) (255,71,31) (0,0,0)) ((224,24,0) (255,47,31) (0,0,0)) ((224,0,160) (255,23,191) (0,0,0)) ((224,0,128) (255,23,159) (0,0,0)) ((224,0,96) (255,23,127) (0,0,0)) ((224,0,64) (255,23,95) (0,0,0)) ((224,0,32) (255,23,63) (0,0,0)) ((192,104,0) (223,135,31) (0,0,0)) ((192,72,0) (223,103,31) (0,0,0)) ((192,48,0) (223,71,31) (0,0,0)) ((192,24,0) (223,47,31) (0,0,0)) ((192,0,160) (223,23,191) (0,0,0)) ((192,0,128) (223,23,159) (0,0,0)) ((192,0,96) (223,23,127) (0,0,0)) ((192,0,64) (223,23,95) (0,0,0)) ((192,0,32) (223,23,63) (0,0,0)) ((160,104,0) (191,135,31) (0,0,0)) ((160,72,0) (191,103,31) (0,0,0)) ((160,48,0) (191,71,31) (0,0,0)) ((160,24,0) (191,47,31) (0,0,0)) ((160,0,160) (191,23,191) (0,0,0)) ((160,0,128) (191,23,159) (0,0,0)) ((160,0,96) (191,23,127) (0,0,0)) ((160,0,64) (191,23,95) (0,0,0)) ((160,0,32) (191,23,63) (0,0,0)) ((128,104,0) (159,135,31) (0,0,0)) ((128,72,0) (159,103,31) (0,0,0)) ((128,48,0) (159,71,31) (0,0,0)) ((128,24,0) (159,47,31) (0,0,0)) ((128,0,160) (159,23,191) (0,0,0)) ((128,0,128) (159,23,159) (0,0,0)) ((128,0,96) (159,23,127) (0,0,0)) ((128,0,64) (159,23,95) (0,0,0)) ((128,0,32) (159,23,63) (0,0,0)) ((96,104,0) (127,135,31) (0,0,0)) ((96,72,0) (127,103,31) (0,0,0)) ((96,48,0) (127,71,31) (0,0,0)) ((96,24,0) (127,47,31) (0,0,0)) ((96,0,160) (127,23,191) (0,0,0)) ((96,0,128) (127,23,159) (0,0,0)) ((96,0,96) (127,23,127) (0,0,0)) ((96,0,64) (127,23,95) (0,0,0)) ((96,0,32) (127,23,63) (0,0,0)) ((64,104,0) (95,135,31) (0,0,0)) ((64,72,0) (95,103,31) (0,0,0)) ((64,48,0) (95,71,31) (0,0,0)) ((64,24,0) (95,47,31) (0,0,0)) ((64,0,160) (95,23,191) (0,0,0)) ((64,0,128) (95,23,159) (0,0,0)) ((64,0,96) (95,23,127) (0,0,0)) ((64,0,64) (95,23,95) (0,0,0)) ((64,0,32) (95,23,63) (0,0,0)) ((32,104,0) (63,135,31) (0,0,0)) ((32,72,0) (63,103,31) (0,0,0)) ((32,48,0) (63,71,31) (0,0,0)) ((32,24,0) (63,47,31) (0,0,0)) ((32,0,160) (63,23,191) (0,0,0)) ((32,0,128) (63,23,159) (0,0,0)) ((32,0,96) (63,23,127) (0,0,0)) ((32,0,64) (63,23,95) (0,0,0)) ((32,0,32) (63,23,63) (0,0,0)) ((0,104,160) (31,135,191) (0,0,0)) ((0,104,128) (31,135,159) (0,0,0)) ((0,104,96) (31,135,127) (0,0,0)) ((0,104,64) (31,135,95) (0,0,0)) ((0,104,32) (31,135,63) (0,0,0)) ((0,72,160) (31,103,191) (0,0,0)) ((0,72,128) (31,103,159) (0,0,0)) ((0,72,96) (31,103,127) (0,0,0)) ((0,72,64) (31,103,95) (0,0,0)) ((0,72,32) (31,103,63) (0,0,0)) ((0,48,160) (31,71,191) (0,0,0)) ((0,48,128) (31,71,159) (0,0,0)) ((0,48,96) (31,71,127) (0,0,0)) ((0,48,64) (31,71,95) (0,0,0)) ((0,48,32) (31,71,63) (0,0,0)) ((0,24,160) (31,47,191) (0,0,0)) ((0,24,128) (31,47,159) (0,0,0)) ((0,24,96) (31,47,127) (0,0,0)) ((0,24,64) (31,47,95) (0,0,0)) ((0,24,32) (31,47,63) (0,0,0)) ((0,224,56) (31,255,87) (0,0,0)) ((0,224,24) (31,255,55) (0,0,0)) ((0,192,56) (31,223,87) (0,0,0)) ((0,192,24) (31,223,55) (0,0,0)) ((0,160,56) (31,191,87) (0,0,0)) ((0,160,24) (31,191,55) (0,0,0)) ((160,224,0) (191,255,23) (0,0,0)) ((160,192,0) (191,223,23) (0,0,0)) ((160,160,0) (191,191,23) (0,0,0)) ((160,136,88) (191,159,119) (0,0,0)) ((160,136,56) (191,159,87) (0,0,0)) ((160,136,24) (191,159,55) (0,0,0)) ((128,224,0) (159,255,23) (0,0,0)) ((128,192,0) (159,223,23) (0,0,0)) ((128,160,0) (159,191,23) (0,0,0)) ((128,136,88) (159,159,119) (0,0,0)) ((128,136,56) (159,159,87) (0,0,0)) ((128,136,24) (159,159,55) (0,0,0)) ((96,224,0) (127,255,23) (0,0,0)) ((96,192,0) (127,223,23) (0,0,0)) ((96,160,0) (127,191,23) (0,0,0)) ((96,136,88) (127,159,119) (0,0,0)) ((96,136,56) (127,159,87) (0,0,0)) ((96,136,24) (127,159,55) (0,0,0)) ((64,224,0) (95,255,23) (0,0,0)) ((64,192,0) (95,223,23) (0,0,0)) ((64,160,0) (95,191,23) (0,0,0)) ((64,136,88) (95,159,119) (0,0,0)) ((64,136,56) (95,159,87) (0,0,0)) ((64,136,24) (95,159,55) (0,0,0)) ((32,224,88) (63,255,119) (0,0,0)) ((32,224,56) (63,255,87) (0,0,0)) ((32,224,24) (63,255,55) (0,0,0)) ((32,192,88) (63,223,119) (0,0,0)) ((32,192,56) (63,223,87) (0,0,0)) ((32,192,24) (63,223,55) (0,0,0)) ((32,160,88) (63,191,119) (0,0,0)) ((32,160,56) (63,191,87) (0,0,0)) ((32,160,24) (63,191,55) (0,0,0)) ((0,208,120) (31,239,151) (0,0,0)) ((0,184,120) (31,207,151) (0,0,0)) ((0,160,120) (31,183,151) (0,0,0)) ((208,136,144) (231,151,175) (0,0,0)) ((208,136,112) (231,151,143) (0,0,0)) ((208,136,80) (231,151,111) (0,0,0)) ((208,136,48) (231,151,79) (0,0,0)) ((208,136,16) (231,151,47) (0,0,0)) ((232,224,24) (255,255,55) (0,0,0)) ((232,192,24) (255,223,55) (0,0,0)) ((232,160,24) (255,191,55) (0,0,0)) ((208,224,0) (231,255,15) (0,0,0)) ((208,208,48) (231,223,79) (0,0,0)) ((208,208,16) (231,223,47) (0,0,0)) ((192,224,48) (207,255,79) (0,0,0)) ((192,224,16) (207,255,47) (0,0,0)) ((208,176,0) (231,207,23) (0,0,0)) ((208,152,24) (231,175,55) (0,0,0)) ((192,176,24) (207,207,55) (0,0,0)) ((80,224,120) (111,255,135) (0,0,0)) ((80,192,120) (111,223,135) (0,0,0)) ((80,160,120) (111,191,135) (0,0,0)) ((80,136,136) (111,159,167) (0,0,0)) ((64,224,136) (79,255,167) (0,0,0)) ((64,192,136) (79,223,167) (0,0,0)) ((64,160,136) (79,191,167) (0,0,0)) ((232,200,120) (255,223,151) (0,0,0)) ((232,176,120) (255,199,151) (0,0,0)) ((208,224,120) (231,255,151) (0,0,0)) ((160,232,144) (191,255,175) (0,0,0)) ((160,208,144) (191,231,175) (0,0,0)) ((128,232,136) (159,255,167) (0,0,0)) ((208,176,120) (231,207,151) (0,0,0)) ((224,104,160) (255,135,191) (0,0,0)) ((224,104,128) (255,135,159) (0,0,0)) ((224,104,96) (255,135,127) (0,0,0)) ((224,104,64) (255,135,95) (0,0,0)) ((224,104,32) (255,135,63) (0,0,0)) ((224,72,160) (255,103,191) (0,0,0)) ((224,72,128) (255,103,159) (0,0,0)) ((224,72,96) (255,103,127) (0,0,0)) ((224,72,64) (255,103,95) (0,0,0)) ((224,72,32) (255,103,63) (0,0,0)) ((224,48,160) (255,71,191) (0,0,0)) ((224,48,128) (255,71,159) (0,0,0)) ((224,48,96) (255,71,127) (0,0,0)) ((224,48,64) (255,71,95) (0,0,0)) ((224,48,32) (255,71,63) (0,0,0)) ((224,24,160) (255,47,191) (0,0,0)) ((224,24,128) (255,47,159) (0,0,0)) ((224,24,96) (255,47,127) (0,0,0)) ((224,24,64) (255,47,95) (0,0,0)) ((224,24,32) (255,47,63) (0,0,0)) ((192,104,160) (223,135,191) (0,0,0)) ((192,104,128) (223,135,159) (0,0,0)) ((192,104,96) (223,135,127) (0,0,0)) ((192,104,64) (223,135,95) (0,0,0)) ((192,104,32) (223,135,63) (0,0,0)) ((192,72,160) (223,103,191) (0,0,0)) ((192,72,128) (223,103,159) (0,0,0)) ((192,72,96) (223,103,127) (0,0,0)) ((192,72,64) (223,103,95) (0,0,0)) ((192,72,32) (223,103,63) (0,0,0)) ((192,48,160) (223,71,191) (0,0,0)) ((192,48,128) (223,71,159) (0,0,0)) ((192,48,96) (223,71,127) (0,0,0)) ((192,48,64) (223,71,95) (0,0,0)) ((192,48,32) (223,71,63) (0,0,0)) ((192,24,160) (223,47,191) (0,0,0)) ((192,24,128) (223,47,159) (0,0,0)) ((192,24,96) (223,47,127) (0,0,0)) ((192,24,64) (223,47,95) (0,0,0)) ((192,24,32) (223,47,63) (0,0,0)) ((160,104,160) (191,135,191) (0,0,0)) ((160,104,128) (191,135,159) (0,0,0)) ((160,104,96) (191,135,127) (0,0,0)) ((160,104,64) (191,135,95) (0,0,0)) ((160,104,32) (191,135,63) (0,0,0)) ((160,72,160) (191,103,191) (0,0,0)) ((160,72,128) (191,103,159) (0,0,0)) ((160,72,96) (191,103,127) (0,0,0)) ((160,72,64) (191,103,95) (0,0,0)) ((160,72,32) (191,103,63) (0,0,0)) ((160,48,160) (191,71,191) (0,0,0)) ((160,48,128) (191,71,159) (0,0,0)) ((160,48,96) (191,71,127) (0,0,0)) ((160,48,64) (191,71,95) (0,0,0)) ((160,48,32) (191,71,63) (0,0,0)) ((160,24,160) (191,47,191) (0,0,0)) ((160,24,128) (191,47,159) (0,0,0)) ((160,24,96) (191,47,127) (0,0,0)) ((160,24,64) (191,47,95) (0,0,0)) ((160,24,32) (191,47,63) (0,0,0)) ((128,104,160) (159,135,191) (0,0,0)) ((128,104,128) (159,135,159) (0,0,0)) ((128,104,96) (159,135,127) (0,0,0)) ((128,104,64) (159,135,95) (0,0,0)) ((128,104,32) (159,135,63) (0,0,0)) ((128,72,160) (159,103,191) (0,0,0)) ((128,72,128) (159,103,159) (0,0,0)) ((128,72,96) (159,103,127) (0,0,0)) ((128,72,64) (159,103,95) (0,0,0)) ((128,72,32) (159,103,63) (0,0,0)) ((128,48,160) (159,71,191) (0,0,0)) ((128,48,128) (159,71,159) (0,0,0)) ((128,48,96) (159,71,127) (0,0,0)) ((128,48,64) (159,71,95) (0,0,0)) ((128,48,32) (159,71,63) (0,0,0)) ((128,24,160) (159,47,191) (0,0,0)) ((128,24,128) (159,47,159) (0,0,0)) ((128,24,96) (159,47,127) (0,0,0)) ((128,24,64) (159,47,95) (0,0,0)) ((128,24,32) (159,47,63) (0,0,0)) ((96,104,160) (127,135,191) (0,0,0)) ((96,104,128) (127,135,159) (0,0,0)) ((96,104,96) (127,135,127) (0,0,0)) ((96,104,64) (127,135,95) (0,0,0)) ((96,104,32) (127,135,63) (0,0,0)) ((96,72,160) (127,103,191) (0,0,0)) ((96,72,128) (127,103,159) (0,0,0)) ((96,72,96) (127,103,127) (0,0,0)) ((96,72,64) (127,103,95) (0,0,0)) ((96,72,32) (127,103,63) (0,0,0)) ((96,48,160) (127,71,191) (0,0,0)) ((96,48,128) (127,71,159) (0,0,0)) ((96,48,96) (127,71,127) (0,0,0)) ((96,48,64) (127,71,95) (0,0,0)) ((96,48,32) (127,71,63) (0,0,0)) ((96,24,160) (127,47,191) (0,0,0)) ((96,24,128) (127,47,159) (0,0,0)) ((96,24,96) (127,47,127) (0,0,0)) ((96,24,64) (127,47,95) (0,0,0)) ((96,24,32) (127,47,63) (0,0,0)) ((64,104,160) (95,135,191) (0,0,0)) ((64,104,128) (95,135,159) (0,0,0)) ((64,104,96) (95,135,127) (0,0,0)) ((64,104,64) (95,135,95) (0,0,0)) ((64,104,32) (95,135,63) (0,0,0)) ((64,72,160) (95,103,191) (0,0,0)) ((64,72,128) (95,103,159) (0,0,0)) ((64,72,96) (95,103,127) (0,0,0)) ((64,72,64) (95,103,95) (0,0,0)) ((64,72,32) (95,103,63) (0,0,0)) ((64,48,160) (95,71,191) (0,0,0)) ((64,48,128) (95,71,159) (0,0,0)) ((64,48,96) (95,71,127) (0,0,0)) ((64,48,64) (95,71,95) (0,0,0)) ((64,48,32) (95,71,63) (0,0,0)) ((64,24,160) (95,47,191) (0,0,0)) ((64,24,128) (95,47,159) (0,0,0)) ((64,24,96) (95,47,127) (0,0,0)) ((64,24,64) (95,47,95) (0,0,0)) ((64,24,32) (95,47,63) (0,0,0)) ((32,104,160) (63,135,191) (0,0,0)) ((32,104,128) (63,135,159) (0,0,0)) ((32,104,96) (63,135,127) (0,0,0)) ((32,104,64) (63,135,95) (0,0,0)) ((32,104,32) (63,135,63) (0,0,0)) ((32,72,160) (63,103,191) (0,0,0)) ((32,72,128) (63,103,159) (0,0,0)) ((32,72,96) (63,103,127) (0,0,0)) ((32,72,64) (63,103,95) (0,0,0)) ((32,72,32) (63,103,63) (0,0,0)) ((32,48,160) (63,71,191) (0,0,0)) ((32,48,128) (63,71,159) (0,0,0)) ((32,48,96) (63,71,127) (0,0,0)) ((32,48,64) (63,71,95) (0,0,0)) ((32,48,32) (63,71,63) (0,0,0)) ((32,24,160) (63,47,191) (0,0,0)) ((32,24,128) (63,47,159) (0,0,0)) ((32,24,96) (63,47,127) (0,0,0)) ((32,24,64) (63,47,95) (0,0,0)) ((32,24,32) (63,47,63) (0,0,0)) ((160,224,88) (191,255,119) (0,0,0)) ((160,224,56) (191,255,87) (0,0,0)) ((160,224,24) (191,255,55) (0,0,0)) ((160,192,88) (191,223,119) (0,0,0)) ((160,192,56) (191,223,87) (0,0,0)) ((160,192,24) (191,223,55) (0,0,0)) ((160,160,88) (191,191,119) (0,0,0)) ((160,160,56) (191,191,87) (0,0,0)) ((160,160,24) (191,191,55) (0,0,0)) ((128,224,88) (159,255,119) (0,0,0)) ((128,224,56) (159,255,87) (0,0,0)) ((128,224,24) (159,255,55) (0,0,0)) ((128,192,88) (159,223,119) (0,0,0)) ((128,192,56) (159,223,87) (0,0,0)) ((128,192,24) (159,223,55) (0,0,0)) ((128,160,88) (159,191,119) (0,0,0)) ((128,160,56) (159,191,87) (0,0,0)) ((128,160,24) (159,191,55) (0,0,0)) ((96,224,88) (127,255,119) (0,0,0)) ((96,224,56) (127,255,87) (0,0,0)) ((96,224,24) (127,255,55) (0,0,0)) ((96,192,88) (127,223,119) (0,0,0)) ((96,192,56) (127,223,87) (0,0,0)) ((96,192,24) (127,223,55) (0,0,0)) ((96,160,88) (127,191,119) (0,0,0)) ((96,160,56) (127,191,87) (0,0,0)) ((96,160,24) (127,191,55) (0,0,0)) ((64,224,88) (95,255,119) (0,0,0)) ((64,224,56) (95,255,87) (0,0,0)) ((64,224,24) (95,255,55) (0,0,0)) ((64,192,88) (95,223,119) (0,0,0)) ((64,192,56) (95,223,87) (0,0,0)) ((64,192,24) (95,223,55) (0,0,0)) ((64,160,88) (95,191,119) (0,0,0)) ((64,160,56) (95,191,87) (0,0,0)) ((64,160,24) (95,191,55) (0,0,0)) ((208,224,48) (231,255,79) (0,0,0)) ((208,224,16) (231,255,47) (0,0,0)) ((208,176,24) (231,207,55) (0,0,0)) ((80,224,136) (111,255,167) (0,0,0)) ((80,192,136) (111,223,167) (0,0,0)) ((80,160,136) (111,191,167) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.19s4.10000644000175000017500000000140111634153073021477 0ustar amckinstryamckinstry2 ((0,0) (127,255) (0,0)) 1 ((0,0) (127,255) (0,0)) ((0,0) (511,255) (0,0)) 19 ((0,72) (135,119) (0,0)) ((288,80) (399,119) (0,0)) ((160,48) (215,71) (0,0)) ((0,136) (135,183) (0,0)) ((400,72) (511,119) (0,0)) ((152,72) (231,103) (0,0)) ((280,144) (351,167) (0,0)) ((496,128) (511,143) (0,0)) ((280,120) (383,143) (0,0)) ((152,104) (191,207) (0,0)) ((352,144) (511,183) (0,0)) ((456,120) (487,143) (0,0)) ((384,120) (391,127) (0,0)) ((192,152) (231,175) (0,0)) ((400,128) (431,143) (0,0)) ((384,136) (399,143) (0,0)) ((192,176) (207,207) (0,0)) ((432,136) (455,143) (0,0)) ((208,176) (231,191) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtbig30000644000175000017500000000531211634153073021415 0ustar amckinstryamckinstry2 ((0,0,0) (63,63,63) (0,0,0)) 1 ((0,0,0) (23,23,47) (0,0,0)) ((0,0,0) (255,255,255) (0,0,0)) 65 ((0,0,16) (31,31,31) (0,0,0)) ((0,0,160) (31,23,183) (0,0,0)) ((0,56,72) (23,87,103) (0,0,0)) ((32,0,24) (55,15,39) (0,0,0)) ((0,32,24) (31,55,47) (0,0,0)) ((0,0,32) (15,15,39) (0,0,0)) ((40,8,144) (47,15,151) (0,0,0)) ((0,48,136) (31,79,151) (0,0,0)) ((56,0,72) (87,31,103) (0,0,0)) ((48,24,72) (55,31,79) (0,0,0)) ((32,16,24) (55,31,47) (0,0,0)) ((0,56,40) (31,79,71) (0,0,0)) ((0,40,48) (15,55,63) (0,0,0)) ((16,0,32) (31,15,47) (0,0,0)) ((0,16,32) (15,31,47) (0,0,0)) ((32,32,136) (47,47,151) (0,0,0)) ((48,0,136) (79,31,151) (0,0,0)) ((32,0,152) (47,31,183) (0,0,0)) ((32,24,144) (39,31,151) (0,0,0)) ((0,24,152) (31,47,183) (0,0,0)) ((8,40,144) (23,47,151) (0,0,0)) ((56,32,72) (79,63,103) (0,0,0)) ((24,48,72) (55,79,103) (0,0,0)) ((48,40,88) (55,47,111) (0,0,0)) ((40,32,72) (55,47,87) (0,0,0)) ((56,0,40) (79,31,71) (0,0,0)) ((32,16,48) (55,39,71) (0,0,0)) ((32,32,32) (39,55,47) (0,0,0)) ((16,32,48) (31,39,55) (0,0,0)) ((16,16,32) (31,31,55) (0,0,0)) ((48,32,136) (55,47,167) (0,0,0)) ((32,48,136) (47,55,167) (0,0,0)) ((48,0,152) (55,31,175) (0,0,0)) ((40,16,136) (47,31,151) (0,0,0)) ((0,48,152) (31,55,175) (0,0,0)) ((24,32,136) (31,47,151) (0,0,0)) ((56,32,104) (63,63,135) (0,0,0)) ((32,40,128) (39,47,135) (0,0,0)) ((56,32,48) (71,39,71) (0,0,0)) ((40,32,32) (47,47,47) (0,0,0)) ((16,40,48) (31,55,71) (0,0,0)) ((56,32,136) (71,39,159) (0,0,0)) ((48,48,136) (55,63,151) (0,0,0)) ((32,56,136) (47,71,143) (0,0,0)) ((56,0,152) (71,15,167) (0,0,0)) ((0,56,152) (23,71,167) (0,0,0)) ((64,32,104) (79,55,135) (0,0,0)) ((48,24,128) (55,31,135) (0,0,0)) ((56,40,56) (63,55,71) (0,0,0)) ((48,32,40) (55,39,47) (0,0,0)) ((56,40,136) (63,55,151) (0,0,0)) ((32,56,144) (39,71,159) (0,0,0)) ((56,16,152) (63,31,167) (0,0,0)) ((24,56,152) (31,63,159) (0,0,0)) ((40,32,112) (55,47,135) (0,0,0)) ((64,40,64) (71,47,71) (0,0,0)) ((64,40,136) (71,47,143) (0,0,0)) ((40,56,144) (47,63,151) (0,0,0)) ((64,16,152) (71,23,159) (0,0,0)) ((0,56,104) (23,87,135) (0,0,0)) ((32,0,40) (55,15,63) (0,0,0)) ((56,0,104) (87,31,135) (0,0,0)) ((32,32,152) (47,47,175) (0,0,0)) ((24,48,104) (55,79,135) (0,0,0)) ((32,40,48) (55,71,71) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2ann.p40000644000175000017500000000035311634153073021747 0ustar amckinstryamckinstry3 ((0,0) (15,31) (0,0)) 1 ((0,0) (15,31) (0,0)) ((0,0) (63,127) (0,0)) 2 ((0,0) (31,63) (0,0)) ((48,0) (63,63) (0,0)) ((0,0) (255,511) (0,0)) 3 ((48,16) (79,63) (0,0)) ((0,128) (79,175) (0,0)) ((0,16) (47,127) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr3ann20000644000175000017500000000016711634153073021513 0ustar amckinstryamckinstry2 ((0,0) (15,15) (0,0)) 1 ((0,0) (15,15) (0,0)) ((0,0) (31,31) (0,0)) 1 ((0,12) (27,19) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt0160000644000175000017500000000010311634153073021070 0ustar amckinstryamckinstry1 ((0,0,0) (15,15,15) (0,0,0)) 1 ((0,0,0) (15,15,15) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2cross0000644000175000017500000000032311634153073021777 0ustar amckinstryamckinstry3 ((0,0) (15,31) (0,0)) 1 ((0,0) (15,31) (0,0)) ((0,0) (63,127) (0,0)) 1 ((0,0) (63,63) (0,0)) ((0,0) (255,511) (0,0)) 3 ((0,16) (31,63) (0,0)) ((0,128) (79,175) (0,0)) ((32,16) (79,127) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt.sstanley_2.640000644000175000017500000000027611634153073023166 0ustar amckinstryamckinstry2 ((0,0,0) (55,55,15) (0,0,0)) 1 ((0,0,0) (55,55,15) (0,0,0)) ((0,0,0) (223,223,63) (0,0,0)) 2 ((96,0,0) (127,31,31) (0,0,0)) ((96,0,32) (127,31,63) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt5s20000644000175000017500000000055111634153073021202 0ustar amckinstryamckinstry2 ((0,0,0) (31,31,31) (0,0,0)) 1 ((0,0,0) (31,31,31) (0,0,0)) ((0,0,0) (63,63,63) (0,0,0)) 8 ((0,16,16) (15,31,47) (0,0,0)) ((0,32,16) (15,47,63) (0,0,0)) ((0,16,48) (15,31,63) (0,0,0)) ((16,0,16) (31,47,31) (0,0,0)) ((16,16,32) (31,31,47) (0,0,0)) ((16,32,32) (31,63,47) (0,0,0)) ((16,16,48) (31,47,63) (0,0,0)) ((32,32,0) (47,47,63) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt12.20000644000175000017500000000317511634153073021160 0ustar amckinstryamckinstry2 ((0,0,0) (71,71,71) (0,0,0)) 12 ((0 ,0 ,0 ) (15,15,23) (0,0,0)) ((16,0 ,0 ) (39,15,23) (0,0,0)) ((0 ,16,0 ) (15,39,23) (0,0,0)) ((16,16,0 ) (39,39,23) (0,0,0)) ((0 ,0 ,24) (15,15,47) (0,0,0)) ((16,0 ,24) (39,15,47) (0,0,0)) ((0 ,16,24) (15,39,47) (0,0,0)) ((16,16,24) (39,39,47) (0,0,0)) ((0 ,0 ,48) (15,15,71) (0,0,0)) ((0 ,16,48) (15,39,71) (0,0,0)) ((16,0 ,48) (39,15,71) (0,0,0)) ((16,16,48) (39,39,71) (0,0,0)) ((0,0,0) (143,143,143) (0,0,0)) 28 ((0,0,24) (23,23,39) (0,0,0)) ((16,16,64) (23,23,71) (0,0,0)) ((24,0,32) (39,23,63) (0,0,0)) ((0,24,32) (7,55,63) (0,0,0)) ((24,0,64) (55,23,87) (0,0,0)) ((0,24,64) (23,55,87) (0,0,0)) ((0,0,88) (23,23,119) (0,0,0)) ((8,16,80) (15,23,87) (0,0,0)) ((40,0,40) (47,7,47) (0,0,0)) ((8,24,32) (23,47,63) (0,0,0)) ((24,0,88) (47,15,119) (0,0,0)) ((24,24,40) (31,47,55) (0,0,0)) ((0,24,88) (7,47,119) (0,0,0)) ((16,8,72) (23,23,87) (0,0,0)) ((32,24,40) (39,31,47) (0,0,0)) ((40,8,40) (47,23,63) (0,0,0)) ((40,0,48) (55,7,63) (0,0,0)) ((24,16,88) (31,39,111) (0,0,0)) ((32,24,64) (47,39,87) (0,0,0)) ((8,24,88) (23,31,119) (0,0,0)) ((32,24,48) (39,39,63) (0,0,0)) ((32,16,88) (47,23,95) (0,0,0)) ((8,32,88) (23,47,111) (0,0,0)) ((40,24,56) (47,31,63) (0,0,0)) ((32,24,88) (39,39,103) (0,0,0)) ((32,16,96) (39,23,111) (0,0,0)) ((0,0,40) (23,23,63) (0,0,0)) ((24,24,56) (31,47,87) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr4level0000644000175000017500000000041611634153073021762 0ustar amckinstryamckinstry4 ((0,0) (31,31) (0,0)) 1 ((0,0) (31,31) (0,0)) ((0,0) (63,63) (0,0)) 1 ((0,0) (47,63) (0,0)) ((0,0) (127,127) (0,0)) 2 ((0,0) (23,79) (0,0)) ((0,80) (71,127) (0,0)) ((0,0) (255,255) (0,0)) 1 ((0,0) (23,47) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr40000644000175000017500000000023211634153073020726 0ustar amckinstryamckinstry1 ((0,0) (63,63) (0,0)) 4 ((0,0) (31,31) (0,0)) ((0,32) (31,63) (0,0)) ((32,0) (63,31) (0,0)) ((32,32) (63,63) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.19s2.40000644000175000017500000000137711634153073021514 0ustar amckinstryamckinstry2 ((0,0) (255,63) (0,0)) 1 ((0,0) (255,63) (0,0)) ((0,0) (511,255) (0,0)) 19 ((0,72) (135,119) (0,0)) ((288,80) (399,119) (0,0)) ((160,48) (215,71) (0,0)) ((0,136) (135,183) (0,0)) ((400,72) (511,119) (0,0)) ((152,72) (231,103) (0,0)) ((280,144) (351,167) (0,0)) ((496,128) (511,143) (0,0)) ((280,120) (383,143) (0,0)) ((152,104) (191,207) (0,0)) ((352,144) (511,183) (0,0)) ((456,120) (487,143) (0,0)) ((384,120) (391,127) (0,0)) ((192,152) (231,175) (0,0)) ((400,128) (431,143) (0,0)) ((384,136) (399,143) (0,0)) ((192,176) (207,207) (0,0)) ((432,136) (455,143) (0,0)) ((208,176) (231,191) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.sstanley.10000644000175000017500000000140211634153073022642 0ustar amckinstryamckinstry2 ((0,0) (23,11) (0,0)) 1 ((0,0) (23,11) (0,0)) ((0,0) (95,47) (0,0)) 2 ((4,12) (47,35) (0,0)) ((48,12) (95,35) (0,0)) 5 ((0,0) (5,2) (0,0)) 1 ((0,0) (5,2) (0,0)) ((0,0) (11,5) (0,0)) 1 ((0,0) (11,5) (0,0)) ((0,0) (23,11) (0,0)) 1 ((0,0) (23,11) (0,0)) ((0,0) (47,23) (0,0)) 2 ((2,6) (23,17) (0,0)) ((24,6) (47,17) (0,0)) ((0,0) (95,47) (0,0)) 2 ((4,12) (47,35) (0,0)) ((48,12) (95,35) (0,0)) 3 ((0,0) (23,11) (0,0)) 2 ((1,3) (11,8) (0,0)) ((12,3) (23,8) (0,0)) ((0,0) (47,23) (0,0)) 2 ((2,6) (23,17) (0,0)) ((24,6) (47,17) (0,0)) ((0,0) (95,47) (0,0)) 2 ((4,12) (47,35) (0,0)) ((48,12) (95,35) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr3rick0000644000175000017500000000046511634153073021606 0ustar amckinstryamckinstry3 ((0,0) (3,119) (0,0)) 1 ((0,0) (3,119) (0,0)) ((0,0) (7,239) (0,0)) 2 ((0,0) (7,117) (0,0)) ((0,118) (7,237) (0,0)) ((0,0) (15,479) (0,0)) 4 ((0,0) (15,111) (0,0)) ((0,336) (15,463) (0,0)) ((0,224) (15,335) (0,0)) ((0,112) (15,223) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt2t10000644000175000017500000000020611634153073021174 0ustar amckinstryamckinstry2 ((0,0,0) (3,3,3) (0,0,0)) 1 ((0,0,0) (3,3,3) (0,0,0)) ((0,0,0) (7,7,7) (0,0,0)) 1 ((0,2,2) (7,5,7) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2ann0000644000175000017500000000032311634153073021422 0ustar amckinstryamckinstry3 ((0,0) (15,31) (0,0)) 1 ((0,0) (15,31) (0,0)) ((0,0) (63,127) (0,0)) 1 ((0,0) (31,63) (0,0)) ((0,0) (255,511) (0,0)) 3 ((0,16) (31,63) (0,0)) ((0,128) (79,175) (0,0)) ((32,16) (79,127) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt.sstanley_2.320000644000175000017500000000046111634153073023155 0ustar amckinstryamckinstry2 ((0,0,0) (55,55,15) (0,0,0)) 4 ((0,0,0) (23,23,15) (0,0,0)) ((24,0,0) (55,23,15) (0,0,0)) ((0,24,0) (23,55,15) (0,0,0)) ((24,24,0) (55,55,15) (0,0,0)) ((0,0,0) (223,223,63) (0,0,0)) 2 ((96,0,0) (127,31,31) (0,0,0)) ((96,0,32) (127,31,63) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt7a0000644000175000017500000000021311634153073021073 0ustar amckinstryamckinstry2 ((0,0,0) (7,7,7) (0,0,0)) 1 ((0,0,0) (7,7,7) (0,0,0)) ((0,0,0) (15,15,15) (0,0,0)) 1 ((0,0,0) (7,15,15) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2.inf0000644000175000017500000000016611634153073021505 0ustar amckinstryamckinstry2 ((0,0) (15,15) (0,0)) 1 ((0,0) (15,15) (0,0)) ((0,0) (63,63) (0,0)) 1 ((0,0) (31,31) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt3ann0000644000175000017500000000021311634153073021423 0ustar amckinstryamckinstry2 ((0,0,0) (31,15,15) (0,0,0)) 1 ((0,0,0) (31,15,15) (0,0,0)) ((0,0,0) (63,31,31) (0,0,0)) 1 ((0,0,8) (63,31,27) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt.320000644000175000017500000000011211634153073021064 0ustar amckinstryamckinstry1 ((0,0,0) (31,31,31) (0,0,0)) 1 ((0,0,0) (31,31,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2ann.l10000644000175000017500000000032611634153073021740 0ustar amckinstryamckinstry2 ((0,0) (31,31) (0,0)) 4 ((0,0) (15,15) (0,0)) ((16,0) (31,15) (0,0)) ((0,16) (15,31) (0,0)) ((16,16) (31,31) (0,0)) ((0,0) (63,63) (0,0)) 1 ((20,10) (35,25) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt7aa0000644000175000017500000000021411634153073021235 0ustar amckinstryamckinstry2 ((0,0,0) (7,7,7) (0,0,0)) 1 ((0,0,0) (7,7,7) (0,0,0)) ((0,0,0) (15,15,15) (0,0,0)) 1 ((8,0,0) (15,15,15) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt2t40000644000175000017500000000045011634153073021200 0ustar amckinstryamckinstry2 ((0,0,0) (15,15,15) (0,0,0)) 1 ((0,0,0) (15,15,15) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 5 ((0,8,8) (7,15,23) (0,0,0)) ((0,8,24) (7,15,31) (0,0,0)) ((8,0,8) (15,23,15) (0,0,0)) ((8,8,16) (15,15,23) (0,0,0)) ((8,16,16) (15,31,23) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt4s2a0000644000175000017500000000060611634153073021343 0ustar amckinstryamckinstry2 ((0,0,0) (15,15,15) (0,0,0)) 2 ((0,0,0) (15,15,7) (0,0,0)) ((0,0,8) (15,15,15) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 8 ((0,8,8) (7,15,23) (0,0,0)) ((0,16,8) (7,23,31) (0,0,0)) ((0,8,24) (7,15,31) (0,0,0)) ((8,0,8) (15,23,15) (0,0,0)) ((8,8,16) (15,15,23) (0,0,0)) ((8,16,16) (15,31,23) (0,0,0)) ((8,8,24) (15,23,31) (0,0,0)) ((16,16,0) (23,23,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt120000644000175000017500000000333611634153073021017 0ustar amckinstryamckinstry3 ((0,0,0) (31,31,63) (0,0,0)) 2 ((0,0,0) (31,31,31) (0,0,0)) ((0,0,32) (31,31,63) (0,0,0)) ((0,0,0) (127,127,255) (0,0,0)) 12 ((0,0,0) (15,15,23) (0,0,0)) ((16,0,0) (39,15,23) (0,0,0)) ((0,16,0) (15,39,23) (0,0,0)) ((0,0,48) (15,15,71) (0,0,0)) ((0,0,24) (15,15,47) (0,0,0)) ((16,16,0) (39,39,23) (0,0,0)) ((16,0,48) (39,15,71) (0,0,0)) ((16,0,24) (39,15,47) (0,0,0)) ((0,16,48) (15,39,71) (0,0,0)) ((0,16,24) (15,39,47) (0,0,0)) ((16,16,48) (39,39,71) (0,0,0)) ((16,16,24) (39,39,47) (0,0,0)) ((0,0,0) (255,255,511) (0,0,0)) 28 ((0,0,24) (23,23,39) (0,0,0)) ((16,16,64) (23,23,71) (0,0,0)) ((24,0,32) (39,23,63) (0,0,0)) ((0,24,32) (7,55,63) (0,0,0)) ((24,0,64) (55,23,87) (0,0,0)) ((0,24,64) (23,55,87) (0,0,0)) ((0,0,88) (23,23,119) (0,0,0)) ((8,16,80) (15,23,87) (0,0,0)) ((40,0,40) (47,7,47) (0,0,0)) ((8,24,32) (23,47,63) (0,0,0)) ((24,0,88) (47,15,119) (0,0,0)) ((24,24,40) (31,47,55) (0,0,0)) ((0,24,88) (7,47,119) (0,0,0)) ((16,8,72) (23,23,87) (0,0,0)) ((32,24,40) (39,31,47) (0,0,0)) ((40,8,40) (47,23,63) (0,0,0)) ((40,0,48) (55,7,63) (0,0,0)) ((24,16,88) (31,39,111) (0,0,0)) ((32,24,64) (47,39,87) (0,0,0)) ((8,24,88) (23,31,119) (0,0,0)) ((32,24,48) (39,39,63) (0,0,0)) ((32,16,88) (47,23,95) (0,0,0)) ((8,32,88) (23,47,111) (0,0,0)) ((40,24,56) (47,31,63) (0,0,0)) ((32,24,88) (39,39,103) (0,0,0)) ((32,16,96) (39,23,111) (0,0,0)) ((0,0,40) (23,23,63) (0,0,0)) ((24,24,56) (31,47,87) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr3b0000644000175000017500000000015411634153073021072 0ustar amckinstryamckinstry2 ((0,0) (31,31) (0,0)) 1 ((0,0) (31,31) (0,0)) ((0,0) (127,127) (0,0)) 1 ((0,0) (127,63) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2ann.l20000644000175000017500000000032511634153073021740 0ustar amckinstryamckinstry2 ((0,0) (31,31) (0,0)) 4 ((0,0) (15,15) (0,0)) ((16,0) (31,15) (0,0)) ((0,16) (15,31) (0,0)) ((16,16) (31,31) (0,0)) ((0,0) (63,63) (0,0)) 1 ((10,0) (25,15) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtgrav20000644000175000017500000000062311634153073021612 0ustar amckinstryamckinstry2 ((0,0,0) (11,11,11) (0,0,0)) 1 ((0,0,0) (11,11,11) (0,0,0)) ((0,0,0) (23,23,23) (0,0,0)) 8 ((4,4,4) (23,19,19) (0,0,0)) ((2,6,8) (3,7,15) (0,0,0)) ((2,14,14) (3,17,17) (0,0,0)) ((0,8,12) (3,13,17) (0,0,0)) ((2,14,6) (3,15,7) (0,0,0)) ((0,8,6) (3,13,11) (0,0,0)) ((0,14,8) (3,17,13) (0,0,0)) ((0,14,14) (1,15,15) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt8c0000644000175000017500000000021411634153073021077 0ustar amckinstryamckinstry2 ((0,0,0) (7,7,7) (0,0,0)) 1 ((0,0,0) (7,7,7) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 1 ((0,0,0) (31,31,15) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2ann.p30000644000175000017500000000032711634153073021747 0ustar amckinstryamckinstry3 ((0,0) (15,31) (0,0)) 1 ((0,0) (15,31) (0,0)) ((0,0) (63,127) (0,0)) 1 ((0,0) (31,63) (0,0)) ((0,0) (255,511) (0,0)) 3 ((32,16) (63,63) (0,0)) ((32,128) (111,175) (0,0)) ((64,16) (111,127) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.190000644000175000017500000000130311634153073021072 0ustar amckinstryamckinstry1 ((0,0) (511,255) (0,0)) 19 ((0,72) (135,119) (0,0)) ((288,80) (399,119) (0,0)) ((160,48) (215,71) (0,0)) ((0,136) (135,183) (0,0)) ((400,72) (511,119) (0,0)) ((152,72) (231,103) (0,0)) ((280,144) (351,167) (0,0)) ((496,128) (511,143) (0,0)) ((280,120) (383,143) (0,0)) ((152,104) (191,207) (0,0)) ((352,144) (511,183) (0,0)) ((456,120) (487,143) (0,0)) ((384,120) (391,127) (0,0)) ((192,152) (231,175) (0,0)) ((400,128) (431,143) (0,0)) ((384,136) (399,143) (0,0)) ((192,176) (207,207) (0,0)) ((432,136) (455,143) (0,0)) ((208,176) (231,191) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtclearsmall0000644000175000017500000000055211634153073022711 0ustar amckinstryamckinstry3 ((0,0,0) (63,63,63) (0,0,0)) 1 ((0,0,0) (63,63,63) (0,0,0)) ((0,0,0) (255,255,255) (0,0,0)) 1 ((96,96,24) (191,191,63) (0,0,0)) ((0,0,0) (511,511,511) (0,0,0)) 5 ((248,200,56) (255,223,71) (0,0,0)) ((232,224,56) (255,255,87) (0,0,0)) ((232,224,88) (255,255,119) (0,0,0)) ((232,200,88) (255,223,119) (0,0,0)) ((232,200,72) (239,215,87) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr1mike.thin0000644000175000017500000000027311634153073022537 0ustar amckinstryamckinstry1 ((0,0) (159,319) (0,0)) 5 ((0,0) (23,41) (0,0)) ((24,0) (87,9) (0,0)) ((24,10) (57,17) (0,0)) ((74,10) (97,11) (0,0)) ((88,0) (159,9) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2r10000644000175000017500000000015211634153073021170 0ustar amckinstryamckinstry2 ((0,0) (15,15) (0,0)) 1 ((0,0) (15,15) (0,0)) ((0,0) (63,63) (0,0)) 1 ((16,20) (47,51) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.19l30000644000175000017500000000147611634153073021344 0ustar amckinstryamckinstry3 ((0,0) (127,63) (0,0)) 1 ((0,0) (127,63) (0,0)) ((0,0) (255,127) (0,0)) 1 ((0,20) (255,111) (0,0)) ((0,0) (511,255) (0,0)) 19 ((0,72) (135,119) (0,0)) ((288,80) (399,119) (0,0)) ((160,48) (215,71) (0,0)) ((0,136) (135,183) (0,0)) ((400,72) (511,119) (0,0)) ((152,72) (231,103) (0,0)) ((280,144) (351,167) (0,0)) ((496,128) (511,143) (0,0)) ((280,120) (383,143) (0,0)) ((152,104) (191,207) (0,0)) ((352,144) (511,183) (0,0)) ((456,120) (487,143) (0,0)) ((384,120) (391,127) (0,0)) ((192,152) (231,175) (0,0)) ((400,128) (431,143) (0,0)) ((384,136) (399,143) (0,0)) ((192,176) (207,207) (0,0)) ((432,136) (455,143) (0,0)) ((208,176) (231,191) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt8a0000644000175000017500000000021411634153073021075 0ustar amckinstryamckinstry2 ((0,0,0) (7,7,7) (0,0,0)) 1 ((0,0,0) (7,7,7) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 1 ((0,0,0) (15,31,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2mike20000644000175000017500000000016711634153073021663 0ustar amckinstryamckinstry2 ((0,0) (31,31) (0,0)) 1 ((0,0) (31,31) (0,0)) ((0,0) (63,63) (0,0)) 1 ((0,16) (31,47) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt.sas0000644000175000017500000001216011634153073021434 0ustar amckinstryamckinstry2 ((0,0,0) (71,119,47) (0,0,0)) 24 ((0,0,0) (23,23,15) (0,0,0)) ((48,0,0) (71,23,15) (0,0,0)) ((24,0,0) (47,23,15) (0,0,0)) ((0,88,0) (23,119,15) (0,0,0)) ((0,56,0) (23,87,15) (0,0,0)) ((0,24,0) (23,55,15) (0,0,0)) ((0,0,16) (23,23,47) (0,0,0)) ((48,88,0) (71,119,15) (0,0,0)) ((48,56,0) (71,87,15) (0,0,0)) ((48,24,0) (71,55,15) (0,0,0)) ((48,0,16) (71,23,47) (0,0,0)) ((24,88,0) (47,119,15) (0,0,0)) ((24,56,0) (47,87,15) (0,0,0)) ((24,24,0) (47,55,15) (0,0,0)) ((24,0,16) (47,23,47) (0,0,0)) ((0,88,16) (23,119,47) (0,0,0)) ((0,56,16) (23,87,47) (0,0,0)) ((0,24,16) (23,55,47) (0,0,0)) ((48,88,16) (71,119,47) (0,0,0)) ((48,56,16) (71,87,47) (0,0,0)) ((48,24,16) (71,55,47) (0,0,0)) ((24,88,16) (47,119,47) (0,0,0)) ((24,56,16) (47,87,47) (0,0,0)) ((24,24,16) (47,55,47) (0,0,0)) ((0,0,0) (287,479,191) (0,0,0)) 1 ((0,216,160) (15,247,191) (0,0,0)) 2 ((0,0,0) (71,119,47) (0,0,0)) 24 ((0,0,0) (23,23,15) (0,0,0)) ((48,0,0) (71,23,15) (0,0,0)) ((24,0,0) (47,23,15) (0,0,0)) ((0,88,0) (23,119,15) (0,0,0)) ((0,56,0) (23,87,15) (0,0,0)) ((0,24,0) (23,55,15) (0,0,0)) ((0,0,16) (23,23,47) (0,0,0)) ((48,88,0) (71,119,15) (0,0,0)) ((48,56,0) (71,87,15) (0,0,0)) ((48,24,0) (71,55,15) (0,0,0)) ((48,0,16) (71,23,47) (0,0,0)) ((24,88,0) (47,119,15) (0,0,0)) ((24,56,0) (47,87,15) (0,0,0)) ((24,24,0) (47,55,15) (0,0,0)) ((24,0,16) (47,23,47) (0,0,0)) ((0,88,16) (23,119,47) (0,0,0)) ((0,56,16) (23,87,47) (0,0,0)) ((0,24,16) (23,55,47) (0,0,0)) ((48,88,16) (71,119,47) (0,0,0)) ((48,56,16) (71,87,47) (0,0,0)) ((48,24,16) (71,55,47) (0,0,0)) ((24,88,16) (47,119,47) (0,0,0)) ((24,56,16) (47,87,47) (0,0,0)) ((24,24,16) (47,55,47) (0,0,0)) ((0,0,0) (287,479,191) (0,0,0)) 1 ((0,216,160) (15,247,191) (0,0,0)) 6 ((0,0,0) (8,14,5) (0,0,0)) 24 ((0,0,0) (2,2,1) (0,0,0)) ((6,0,0) (8,2,1) (0,0,0)) ((3,0,0) (5,2,1) (0,0,0)) ((0,11,0) (2,14,1) (0,0,0)) ((0,7,0) (2,10,1) (0,0,0)) ((0,3,0) (2,6,1) (0,0,0)) ((0,0,2) (2,2,5) (0,0,0)) ((6,11,0) (8,14,1) (0,0,0)) ((6,7,0) (8,10,1) (0,0,0)) ((6,3,0) (8,6,1) (0,0,0)) ((6,0,2) (8,2,5) (0,0,0)) ((3,11,0) (5,14,1) (0,0,0)) ((3,7,0) (5,10,1) (0,0,0)) ((3,3,0) (5,6,1) (0,0,0)) ((3,0,2) (5,2,5) (0,0,0)) ((0,11,2) (2,14,5) (0,0,0)) ((0,7,2) (2,10,5) (0,0,0)) ((0,3,2) (2,6,5) (0,0,0)) ((6,11,2) (8,14,5) (0,0,0)) ((6,7,2) (8,10,5) (0,0,0)) ((6,3,2) (8,6,5) (0,0,0)) ((3,11,2) (5,14,5) (0,0,0)) ((3,7,2) (5,10,5) (0,0,0)) ((3,3,2) (5,6,5) (0,0,0)) ((0,0,0) (17,29,11) (0,0,0)) 24 ((0,0,0) (5,5,3) (0,0,0)) ((12,0,0) (17,5,3) (0,0,0)) ((6,0,0) (11,5,3) (0,0,0)) ((0,22,0) (5,29,3) (0,0,0)) ((0,14,0) (5,21,3) (0,0,0)) ((0,6,0) (5,13,3) (0,0,0)) ((0,0,4) (5,5,11) (0,0,0)) ((12,22,0) (17,29,3) (0,0,0)) ((12,14,0) (17,21,3) (0,0,0)) ((12,6,0) (17,13,3) (0,0,0)) ((12,0,4) (17,5,11) (0,0,0)) ((6,22,0) (11,29,3) (0,0,0)) ((6,14,0) (11,21,3) (0,0,0)) ((6,6,0) (11,13,3) (0,0,0)) ((6,0,4) (11,5,11) (0,0,0)) ((0,22,4) (5,29,11) (0,0,0)) ((0,14,4) (5,21,11) (0,0,0)) ((0,6,4) (5,13,11) (0,0,0)) ((12,22,4) (17,29,11) (0,0,0)) ((12,14,4) (17,21,11) (0,0,0)) ((12,6,4) (17,13,11) (0,0,0)) ((6,22,4) (11,29,11) (0,0,0)) ((6,14,4) (11,21,11) (0,0,0)) ((6,6,4) (11,13,11) (0,0,0)) ((0,0,0) (35,59,23) (0,0,0)) 24 ((0,0,0) (11,11,7) (0,0,0)) ((24,0,0) (35,11,7) (0,0,0)) ((12,0,0) (23,11,7) (0,0,0)) ((0,44,0) (11,59,7) (0,0,0)) ((0,28,0) (11,43,7) (0,0,0)) ((0,12,0) (11,27,7) (0,0,0)) ((0,0,8) (11,11,23) (0,0,0)) ((24,44,0) (35,59,7) (0,0,0)) ((24,28,0) (35,43,7) (0,0,0)) ((24,12,0) (35,27,7) (0,0,0)) ((24,0,8) (35,11,23) (0,0,0)) ((12,44,0) (23,59,7) (0,0,0)) ((12,28,0) (23,43,7) (0,0,0)) ((12,12,0) (23,27,7) (0,0,0)) ((12,0,8) (23,11,23) (0,0,0)) ((0,44,8) (11,59,23) (0,0,0)) ((0,28,8) (11,43,23) (0,0,0)) ((0,12,8) (11,27,23) (0,0,0)) ((24,44,8) (35,59,23) (0,0,0)) ((24,28,8) (35,43,23) (0,0,0)) ((24,12,8) (35,27,23) (0,0,0)) ((12,44,8) (23,59,23) (0,0,0)) ((12,28,8) (23,43,23) (0,0,0)) ((12,12,8) (23,27,23) (0,0,0)) ((0,0,0) (71,119,47) (0,0,0)) 24 ((0,0,0) (23,23,15) (0,0,0)) ((48,0,0) (71,23,15) (0,0,0)) ((24,0,0) (47,23,15) (0,0,0)) ((0,88,0) (23,119,15) (0,0,0)) ((0,56,0) (23,87,15) (0,0,0)) ((0,24,0) (23,55,15) (0,0,0)) ((0,0,16) (23,23,47) (0,0,0)) ((48,88,0) (71,119,15) (0,0,0)) ((48,56,0) (71,87,15) (0,0,0)) ((48,24,0) (71,55,15) (0,0,0)) ((48,0,16) (71,23,47) (0,0,0)) ((24,88,0) (47,119,15) (0,0,0)) ((24,56,0) (47,87,15) (0,0,0)) ((24,24,0) (47,55,15) (0,0,0)) ((24,0,16) (47,23,47) (0,0,0)) ((0,88,16) (23,119,47) (0,0,0)) ((0,56,16) (23,87,47) (0,0,0)) ((0,24,16) (23,55,47) (0,0,0)) ((48,88,16) (71,119,47) (0,0,0)) ((48,56,16) (71,87,47) (0,0,0)) ((48,24,16) (71,55,47) (0,0,0)) ((24,88,16) (47,119,47) (0,0,0)) ((24,56,16) (47,87,47) (0,0,0)) ((24,24,16) (47,55,47) (0,0,0)) ((0,0,0) (143,239,95) (0,0,0)) 1 ((0,108,80) (7,123,95) (0,0,0)) ((0,0,0) (287,479,191) (0,0,0)) 1 ((0,216,160) (15,247,191) (0,0,0)) 4 ((0,0,0) (35,59,23) (0,0,0)) 1 ((0,27,20) (1,30,23) (0,0,0)) ((0,0,0) (71,119,47) (0,0,0)) 1 ((0,54,40) (3,61,47) (0,0,0)) ((0,0,0) (143,239,95) (0,0,0)) 1 ((0,108,80) (7,123,95) (0,0,0)) ((0,0,0) (287,479,191) (0,0,0)) 1 ((0,216,160) (15,247,191) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtbig0000644000175000017500000000554211634153073021337 0ustar amckinstryamckinstry3 ((0,0,0) (31,31,63) (0,0,0)) 2 ((0,0,0) (31,31,31) (0,0,0)) ((0,0,32) (31,31,63) (0,0,0)) ((0,0,0) (127,127,255) (0,0,0)) 2 ((0,0,0) (23,23,15) (0,0,0)) ((0,0,16) (23,23,47) (0,0,0)) ((0,0,0) (511,511,1023) (0,0,0)) 65 ((0,0,16) (31,31,31) (0,0,0)) ((0,0,160) (31,23,183) (0,0,0)) ((0,56,72) (23,87,103) (0,0,0)) ((32,0,24) (55,15,39) (0,0,0)) ((0,32,24) (31,55,47) (0,0,0)) ((0,0,32) (15,15,39) (0,0,0)) ((40,8,144) (47,15,151) (0,0,0)) ((0,48,136) (31,79,151) (0,0,0)) ((56,0,72) (87,31,103) (0,0,0)) ((48,24,72) (55,31,79) (0,0,0)) ((32,16,24) (55,31,47) (0,0,0)) ((0,56,40) (31,79,71) (0,0,0)) ((0,40,48) (15,55,63) (0,0,0)) ((16,0,32) (31,15,47) (0,0,0)) ((0,16,32) (15,31,47) (0,0,0)) ((32,32,136) (47,47,151) (0,0,0)) ((48,0,136) (79,31,151) (0,0,0)) ((32,0,152) (47,31,183) (0,0,0)) ((32,24,144) (39,31,151) (0,0,0)) ((0,24,152) (31,47,183) (0,0,0)) ((8,40,144) (23,47,151) (0,0,0)) ((56,32,72) (79,63,103) (0,0,0)) ((24,48,72) (55,79,103) (0,0,0)) ((48,40,88) (55,47,111) (0,0,0)) ((40,32,72) (55,47,87) (0,0,0)) ((56,0,40) (79,31,71) (0,0,0)) ((32,16,48) (55,39,71) (0,0,0)) ((32,32,32) (39,55,47) (0,0,0)) ((16,32,48) (31,39,55) (0,0,0)) ((16,16,32) (31,31,55) (0,0,0)) ((48,32,136) (55,47,167) (0,0,0)) ((32,48,136) (47,55,167) (0,0,0)) ((48,0,152) (55,31,175) (0,0,0)) ((40,16,136) (47,31,151) (0,0,0)) ((0,48,152) (31,55,175) (0,0,0)) ((24,32,136) (31,47,151) (0,0,0)) ((56,32,104) (63,63,135) (0,0,0)) ((32,40,128) (39,47,135) (0,0,0)) ((56,32,48) (71,39,71) (0,0,0)) ((40,32,32) (47,47,47) (0,0,0)) ((16,40,48) (31,55,71) (0,0,0)) ((56,32,136) (71,39,159) (0,0,0)) ((48,48,136) (55,63,151) (0,0,0)) ((32,56,136) (47,71,143) (0,0,0)) ((56,0,152) (71,15,167) (0,0,0)) ((0,56,152) (23,71,167) (0,0,0)) ((64,32,104) (79,55,135) (0,0,0)) ((48,24,128) (55,31,135) (0,0,0)) ((56,40,56) (63,55,71) (0,0,0)) ((48,32,40) (55,39,47) (0,0,0)) ((56,40,136) (63,55,151) (0,0,0)) ((32,56,144) (39,71,159) (0,0,0)) ((56,16,152) (63,31,167) (0,0,0)) ((24,56,152) (31,63,159) (0,0,0)) ((40,32,112) (55,47,135) (0,0,0)) ((64,40,64) (71,47,71) (0,0,0)) ((64,40,136) (71,47,143) (0,0,0)) ((40,56,144) (47,63,151) (0,0,0)) ((64,16,152) (71,23,159) (0,0,0)) ((0,56,104) (23,87,135) (0,0,0)) ((32,0,40) (55,15,63) (0,0,0)) ((56,0,104) (87,31,135) (0,0,0)) ((32,32,152) (47,47,175) (0,0,0)) ((24,48,104) (55,79,135) (0,0,0)) ((32,40,48) (55,71,71) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr1rick20000644000175000017500000000010011634153073021650 0ustar amckinstryamckinstry1 ((0,0) (199,759) (0,0)) 1 ((0,0) (199,759) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtbig20000644000175000017500000000034111634153073021411 0ustar amckinstryamckinstry2 ((0,0,0) (31,31,63) (0,0,0)) 2 ((0,0,0) (31,31,31) (0,0,0)) ((0,0,32) (31,31,63) (0,0,0)) ((0,0,0) (127,127,255) (0,0,0)) 2 ((0,0,0) (23,23,15) (0,0,0)) ((0,0,16) (23,23,47) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr3c0000644000175000017500000000007111634153073021071 0ustar amckinstryamckinstry1 ((0,0) (127,127) (0,0)) 1 ((0,0) (127,127) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2mike30000644000175000017500000000017111634153073021657 0ustar amckinstryamckinstry2 ((0,0) (63,63) (0,0)) 1 ((0,0) (63,63) (0,0)) ((0,0) (127,127) (0,0)) 1 ((0,32) (63,95) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt80000644000175000017500000000021411634153073020734 0ustar amckinstryamckinstry2 ((0,0,0) (7,7,7) (0,0,0)) 1 ((0,0,0) (7,7,7) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 1 ((0,0,0) (31,31,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr3mike0000644000175000017500000000057411634153073021604 0ustar amckinstryamckinstry3 ((0,0) (63,63) (0,0)) 1 ((0,0) (63,63) (0,0)) ((0,0) (127,127) (0,0)) 2 ((0,52) (43,83) (0,0)) ((0,84) (43,123) (0,0)) ((0,0) (511,511) (0,0)) 8 ((0,416) (27,467) (0,0)) ((28,232) (83,279) (0,0)) ((84,232) (143,283) (0,0)) ((28,392) (83,447) (0,0)) ((28,336) (83,391) (0,0)) ((28,280) (83,335) (0,0)) ((84,336) (143,387) (0,0)) ((84,284) (143,335) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt6s40000644000175000017500000000056111634153073021206 0ustar amckinstryamckinstry2 ((0,0,0) (31,31,31) (0,0,0)) 1 ((0,0,0) (31,31,31) (0,0,0)) ((0,0,0) (127,127,127) (0,0,0)) 8 ((0,32,32) (31,63,95) (0,0,0)) ((0,64,32) (31,95,127) (0,0,0)) ((0,32,96) (31,63,127) (0,0,0)) ((32,0,32) (63,95,63) (0,0,0)) ((32,32,64) (63,63,95) (0,0,0)) ((32,64,64) (63,127,95) (0,0,0)) ((32,32,96) (63,95,127) (0,0,0)) ((64,64,0) (95,95,127) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt.scott.10000644000175000017500000001354211634153073022146 0ustar amckinstryamckinstry2 ((0,0,0) (95,95,63) (0,0,0)) 18 ((0,0,0) (31,31,31) (0,0,0)) ((64,0,0) (95,31,31) (0,0,0)) ((32,0,0) (63,31,31) (0,0,0)) ((0,64,0) (31,95,31) (0,0,0)) ((0,32,0) (31,63,31) (0,0,0)) ((0,0,32) (31,31,63) (0,0,0)) ((64,64,0) (95,95,31) (0,0,0)) ((64,32,0) (95,63,31) (0,0,0)) ((64,0,32) (95,31,63) (0,0,0)) ((32,64,0) (63,95,31) (0,0,0)) ((32,32,0) (63,63,31) (0,0,0)) ((32,0,32) (63,31,63) (0,0,0)) ((0,64,32) (31,95,63) (0,0,0)) ((0,32,32) (31,63,63) (0,0,0)) ((64,64,32) (95,95,63) (0,0,0)) ((64,32,32) (95,63,63) (0,0,0)) ((32,64,32) (63,95,63) (0,0,0)) ((32,32,32) (63,63,63) (0,0,0)) ((0,0,0) (383,383,255) (0,0,0)) 6 ((0,168,0) (23,191,31) (0,0,0)) ((0,168,224) (23,191,255) (0,0,0)) ((352,168,0) (383,183,15) (0,0,0)) ((352,160,224) (383,183,255) (0,0,0)) ((0,192,0) (23,223,31) (0,0,0)) ((0,192,224) (23,223,255) (0,0,0)) 2 ((0,0,0) (95,95,63) (0,0,0)) 18 ((0,0,0) (31,31,31) (0,0,0)) ((64,0,0) (95,31,31) (0,0,0)) ((32,0,0) (63,31,31) (0,0,0)) ((0,64,0) (31,95,31) (0,0,0)) ((0,32,0) (31,63,31) (0,0,0)) ((0,0,32) (31,31,63) (0,0,0)) ((64,64,0) (95,95,31) (0,0,0)) ((64,32,0) (95,63,31) (0,0,0)) ((64,0,32) (95,31,63) (0,0,0)) ((32,64,0) (63,95,31) (0,0,0)) ((32,32,0) (63,63,31) (0,0,0)) ((32,0,32) (63,31,63) (0,0,0)) ((0,64,32) (31,95,63) (0,0,0)) ((0,32,32) (31,63,63) (0,0,0)) ((64,64,32) (95,95,63) (0,0,0)) ((64,32,32) (95,63,63) (0,0,0)) ((32,64,32) (63,95,63) (0,0,0)) ((32,32,32) (63,63,63) (0,0,0)) ((0,0,0) (383,383,255) (0,0,0)) 6 ((0,168,0) (23,191,31) (0,0,0)) ((0,168,224) (23,191,255) (0,0,0)) ((352,168,0) (383,183,15) (0,0,0)) ((352,160,224) (383,183,255) (0,0,0)) ((0,192,0) (23,223,31) (0,0,0)) ((0,192,224) (23,223,255) (0,0,0)) 7 ((0,0,0) (5,5,3) (0,0,0)) 18 ((0,0,0) (1,1,1) (0,0,0)) ((4,0,0) (5,1,1) (0,0,0)) ((2,0,0) (3,1,1) (0,0,0)) ((0,4,0) (1,5,1) (0,0,0)) ((0,2,0) (1,3,1) (0,0,0)) ((0,0,2) (1,1,3) (0,0,0)) ((4,4,0) (5,5,1) (0,0,0)) ((4,2,0) (5,3,1) (0,0,0)) ((4,0,2) (5,1,3) (0,0,0)) ((2,4,0) (3,5,1) (0,0,0)) ((2,2,0) (3,3,1) (0,0,0)) ((2,0,2) (3,1,3) (0,0,0)) ((0,4,2) (1,5,3) (0,0,0)) ((0,2,2) (1,3,3) (0,0,0)) ((4,4,2) (5,5,3) (0,0,0)) ((4,2,2) (5,3,3) (0,0,0)) ((2,4,2) (3,5,3) (0,0,0)) ((2,2,2) (3,3,3) (0,0,0)) ((0,0,0) (11,11,7) (0,0,0)) 18 ((0,0,0) (3,3,3) (0,0,0)) ((8,0,0) (11,3,3) (0,0,0)) ((4,0,0) (7,3,3) (0,0,0)) ((0,8,0) (3,11,3) (0,0,0)) ((0,4,0) (3,7,3) (0,0,0)) ((0,0,4) (3,3,7) (0,0,0)) ((8,8,0) (11,11,3) (0,0,0)) ((8,4,0) (11,7,3) (0,0,0)) ((8,0,4) (11,3,7) (0,0,0)) ((4,8,0) (7,11,3) (0,0,0)) ((4,4,0) (7,7,3) (0,0,0)) ((4,0,4) (7,3,7) (0,0,0)) ((0,8,4) (3,11,7) (0,0,0)) ((0,4,4) (3,7,7) (0,0,0)) ((8,8,4) (11,11,7) (0,0,0)) ((8,4,4) (11,7,7) (0,0,0)) ((4,8,4) (7,11,7) (0,0,0)) ((4,4,4) (7,7,7) (0,0,0)) ((0,0,0) (23,23,15) (0,0,0)) 18 ((0,0,0) (7,7,7) (0,0,0)) ((16,0,0) (23,7,7) (0,0,0)) ((8,0,0) (15,7,7) (0,0,0)) ((0,16,0) (7,23,7) (0,0,0)) ((0,8,0) (7,15,7) (0,0,0)) ((0,0,8) (7,7,15) (0,0,0)) ((16,16,0) (23,23,7) (0,0,0)) ((16,8,0) (23,15,7) (0,0,0)) ((16,0,8) (23,7,15) (0,0,0)) ((8,16,0) (15,23,7) (0,0,0)) ((8,8,0) (15,15,7) (0,0,0)) ((8,0,8) (15,7,15) (0,0,0)) ((0,16,8) (7,23,15) (0,0,0)) ((0,8,8) (7,15,15) (0,0,0)) ((16,16,8) (23,23,15) (0,0,0)) ((16,8,8) (23,15,15) (0,0,0)) ((8,16,8) (15,23,15) (0,0,0)) ((8,8,8) (15,15,15) (0,0,0)) ((0,0,0) (47,47,31) (0,0,0)) 18 ((0,0,0) (15,15,15) (0,0,0)) ((32,0,0) (47,15,15) (0,0,0)) ((16,0,0) (31,15,15) (0,0,0)) ((0,32,0) (15,47,15) (0,0,0)) ((0,16,0) (15,31,15) (0,0,0)) ((0,0,16) (15,15,31) (0,0,0)) ((32,32,0) (47,47,15) (0,0,0)) ((32,16,0) (47,31,15) (0,0,0)) ((32,0,16) (47,15,31) (0,0,0)) ((16,32,0) (31,47,15) (0,0,0)) ((16,16,0) (31,31,15) (0,0,0)) ((16,0,16) (31,15,31) (0,0,0)) ((0,32,16) (15,47,31) (0,0,0)) ((0,16,16) (15,31,31) (0,0,0)) ((32,32,16) (47,47,31) (0,0,0)) ((32,16,16) (47,31,31) (0,0,0)) ((16,32,16) (31,47,31) (0,0,0)) ((16,16,16) (31,31,31) (0,0,0)) ((0,0,0) (95,95,63) (0,0,0)) 18 ((0,0,0) (31,31,31) (0,0,0)) ((64,0,0) (95,31,31) (0,0,0)) ((32,0,0) (63,31,31) (0,0,0)) ((0,64,0) (31,95,31) (0,0,0)) ((0,32,0) (31,63,31) (0,0,0)) ((0,0,32) (31,31,63) (0,0,0)) ((64,64,0) (95,95,31) (0,0,0)) ((64,32,0) (95,63,31) (0,0,0)) ((64,0,32) (95,31,63) (0,0,0)) ((32,64,0) (63,95,31) (0,0,0)) ((32,32,0) (63,63,31) (0,0,0)) ((32,0,32) (63,31,63) (0,0,0)) ((0,64,32) (31,95,63) (0,0,0)) ((0,32,32) (31,63,63) (0,0,0)) ((64,64,32) (95,95,63) (0,0,0)) ((64,32,32) (95,63,63) (0,0,0)) ((32,64,32) (63,95,63) (0,0,0)) ((32,32,32) (63,63,63) (0,0,0)) ((0,0,0) (191,191,127) (0,0,0)) 6 ((0,84,0) (11,95,15) (0,0,0)) ((0,84,112) (11,95,127) (0,0,0)) ((176,84,0) (191,91,7) (0,0,0)) ((176,80,112) (191,91,127) (0,0,0)) ((0,96,0) (11,111,15) (0,0,0)) ((0,96,112) (11,111,127) (0,0,0)) ((0,0,0) (383,383,255) (0,0,0)) 6 ((0,168,0) (23,191,31) (0,0,0)) ((0,168,224) (23,191,255) (0,0,0)) ((352,168,0) (383,183,15) (0,0,0)) ((352,160,224) (383,183,255) (0,0,0)) ((0,192,0) (23,223,31) (0,0,0)) ((0,192,224) (23,223,255) (0,0,0)) 4 ((0,0,0) (47,47,31) (0,0,0)) 6 ((0,21,0) (2,23,3) (0,0,0)) ((0,21,28) (2,23,31) (0,0,0)) ((44,21,0) (47,22,1) (0,0,0)) ((44,20,28) (47,22,31) (0,0,0)) ((0,24,0) (2,27,3) (0,0,0)) ((0,24,28) (2,27,31) (0,0,0)) ((0,0,0) (95,95,63) (0,0,0)) 6 ((0,42,0) (5,47,7) (0,0,0)) ((0,42,56) (5,47,63) (0,0,0)) ((88,42,0) (95,45,3) (0,0,0)) ((88,40,56) (95,45,63) (0,0,0)) ((0,48,0) (5,55,7) (0,0,0)) ((0,48,56) (5,55,63) (0,0,0)) ((0,0,0) (191,191,127) (0,0,0)) 6 ((0,84,0) (11,95,15) (0,0,0)) ((0,84,112) (11,95,127) (0,0,0)) ((176,84,0) (191,91,7) (0,0,0)) ((176,80,112) (191,91,127) (0,0,0)) ((0,96,0) (11,111,15) (0,0,0)) ((0,96,112) (11,111,127) (0,0,0)) ((0,0,0) (383,383,255) (0,0,0)) 6 ((0,168,0) (23,191,31) (0,0,0)) ((0,168,224) (23,191,255) (0,0,0)) ((352,168,0) (383,183,15) (0,0,0)) ((352,160,224) (383,183,255) (0,0,0)) ((0,192,0) (23,223,31) (0,0,0)) ((0,192,224) (23,223,255) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt10000644000175000017500000000010311634153073020722 0ustar amckinstryamckinstry1 ((0,0,0) (31,15,15) (0,0,0)) 1 ((0,0,0) (31,15,15) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt8ms20000644000175000017500000000063211634153073021362 0ustar amckinstryamckinstry2 ((0,0,0) (15,15,31) (0,0,0)) 1 ((0,0,0) (15,15,31) (0,0,0)) ((0,0,0) (31,31,63) (0,0,0)) 8 ((8,8,4) (11,23,7) (0,0,0)) ((4,12,8) (7,19,15) (0,0,0)) ((12,8,0) (19,23,7) (0,0,0)) ((20,8,4) (23,23,7) (0,0,0)) ((8,4,8) (19,27,19) (0,0,0)) ((20,8,8) (27,23,11) (0,0,0)) ((20,8,12) (23,23,19) (0,0,0)) ((24,12,12) (27,19,15) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt40000644000175000017500000000043211634153073020732 0ustar amckinstryamckinstry1 ((0,0,0) (31,31,31) (0,0,0)) 8 ((0,8,8) (7,15,23) (0,0,0)) ((0,16,8) (7,23,31) (0,0,0)) ((0,8,24) (7,15,31) (0,0,0)) ((8,0,8) (15,23,15) (0,0,0)) ((8,8,16) (15,15,23) (0,0,0)) ((8,16,16) (15,31,23) (0,0,0)) ((8,8,24) (15,23,31) (0,0,0)) ((16,16,0) (23,23,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr0a0000644000175000017500000000006111634153073021063 0ustar amckinstryamckinstry1 ((0,0) (7,7) (0,0)) 1 ((0,0) (7,7) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2mike10000644000175000017500000000016611634153073021661 0ustar amckinstryamckinstry2 ((0,0) (15,15) (0,0)) 1 ((0,0) (15,15) (0,0)) ((0,0) (31,31) (0,0)) 1 ((0,8) (15,23) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2ann.p20000644000175000017500000000035711634153073021751 0ustar amckinstryamckinstry3 ((0,0) (15,31) (0,0)) 1 ((0,0) (15,31) (0,0)) ((0,0) (63,127) (0,0)) 2 ((0,0) (31,63) (0,0)) ((48,0) (63,63) (0,0)) ((0,0) (255,511) (0,0)) 3 ((32,16) (63,63) (0,0)) ((32,128) (111,175) (0,0)) ((64,16) (111,127) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt20000644000175000017500000000025211634153073020730 0ustar amckinstryamckinstry2 ((0,0,0) (31,15,15) (0,0,0)) 1 ((0,0,0) (31,15,15) (0,0,0)) ((0,0,0) (127,63,63) (0,0,0)) 2 ((16,20,20) (47,51,51) (0,0,0)) ((80,16,16) (111,47,47) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2ann.p60000644000175000017500000000022411634153073021746 0ustar amckinstryamckinstry2 ((0,0) (15,15) (0,0)) 1 ((0,0) (15,15) (0,0)) ((0,0) (31,31) (0,0)) 2 ((0,8) (5,23) (0,0)) ((18,8) (31,23) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt4s2.4.40000644000175000017500000000053611634153073021510 0ustar amckinstryamckinstry2 ((0,0,0) (15,7,7) (0,0,0)) 1 ((0,0,0) (15,7,7) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 8 ((0,8,8) (7,15,23) (0,0,0)) ((0,16,8) (7,23,31) (0,0,0)) ((0,8,24) (7,15,31) (0,0,0)) ((8,0,8) (15,23,15) (0,0,0)) ((8,8,16) (15,15,23) (0,0,0)) ((8,16,16) (15,31,23) (0,0,0)) ((8,8,24) (15,23,31) (0,0,0)) ((16,16,0) (23,23,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2ann.p10000644000175000017500000000035311634153073021744 0ustar amckinstryamckinstry3 ((0,0) (15,31) (0,0)) 1 ((0,0) (15,31) (0,0)) ((0,0) (63,127) (0,0)) 2 ((0,0) (31,63) (0,0)) ((48,0) (63,63) (0,0)) ((0,0) (255,511) (0,0)) 3 ((0,16) (31,63) (0,0)) ((0,128) (79,175) (0,0)) ((32,16) (79,127) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt.bill10000644000175000017500000000415111634153073021652 0ustar amckinstryamckinstry1 ((0,0,0) (127,127,127) (0,0,0)) 64 ((0,0,0) (31,31,31) (0,0,0)) ((32,0,0) (63,31,31) (0,0,0)) ((64,0,0) (95,31,31) (0,0,0)) ((96,0,0) (127,31,31) (0,0,0)) ((0,32,0) (31,63,31) (0,0,0)) ((32,32,0) (63,63,31) (0,0,0)) ((64,32,0) (95,63,31) (0,0,0)) ((96,32,0) (127,63,31) (0,0,0)) ((0,64,0) (31,95,31) (0,0,0)) ((32,64,0) (63,95,31) (0,0,0)) ((64,64,0) (95,95,31) (0,0,0)) ((96,64,0) (127,95,31) (0,0,0)) ((0,96,0) (31,127,31) (0,0,0)) ((32,96,0) (63,127,31) (0,0,0)) ((64,96,0) (95,127,31) (0,0,0)) ((96,96,0) (127,127,31) (0,0,0)) ((0,0,32) (31,31,63) (0,0,0)) ((32,0,32) (63,31,63) (0,0,0)) ((64,0,32) (95,31,63) (0,0,0)) ((96,0,32) (127,31,63) (0,0,0)) ((0,32,32) (31,63,63) (0,0,0)) ((32,32,32) (63,63,63) (0,0,0)) ((64,32,32) (95,63,63) (0,0,0)) ((96,32,32) (127,63,63) (0,0,0)) ((0,64,32) (31,95,63) (0,0,0)) ((32,64,32) (63,95,63) (0,0,0)) ((64,64,32) (95,95,63) (0,0,0)) ((96,64,32) (127,95,63) (0,0,0)) ((0,96,32) (31,127,63) (0,0,0)) ((32,96,32) (63,127,63) (0,0,0)) ((64,96,32) (95,127,63) (0,0,0)) ((96,96,32) (127,127,63) (0,0,0)) ((0,0,64) (31,31,95) (0,0,0)) ((32,0,64) (63,31,95) (0,0,0)) ((64,0,64) (95,31,95) (0,0,0)) ((96,0,64) (127,31,95) (0,0,0)) ((0,32,64) (31,63,95) (0,0,0)) ((32,32,64) (63,63,95) (0,0,0)) ((64,32,64) (95,63,95) (0,0,0)) ((96,32,64) (127,63,95) (0,0,0)) ((0,64,64) (31,95,95) (0,0,0)) ((32,64,64) (63,95,95) (0,0,0)) ((64,64,64) (95,95,95) (0,0,0)) ((96,64,64) (127,95,95) (0,0,0)) ((0,96,64) (31,127,95) (0,0,0)) ((32,96,64) (63,127,95) (0,0,0)) ((64,96,64) (95,127,95) (0,0,0)) ((96,96,64) (127,127,95) (0,0,0)) ((0,0,96) (31,31,127) (0,0,0)) ((32,0,96) (63,31,127) (0,0,0)) ((64,0,96) (95,31,127) (0,0,0)) ((96,0,96) (127,31,127) (0,0,0)) ((0,32,96) (31,63,127) (0,0,0)) ((32,32,96) (63,63,127) (0,0,0)) ((64,32,96) (95,63,127) (0,0,0)) ((96,32,96) (127,63,127) (0,0,0)) ((0,64,96) (31,95,127) (0,0,0)) ((32,64,96) (63,95,127) (0,0,0)) ((64,64,96) (95,95,127) (0,0,0)) ((96,64,96) (127,95,127) (0,0,0)) ((0,96,96) (31,127,127) (0,0,0)) ((32,96,96) (63,127,127) (0,0,0)) ((64,96,96) (95,127,127) (0,0,0)) ((96,96,96) (127,127,127) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.292.250000644000175000017500000000161711634153073021412 0ustar amckinstryamckinstry1 ((0,0) (511,255) (0,0)) 25 ((0,80) (63,119) (0,0)) ((320,96) (351,119) (0,0)) ((232,48) (279,119) (0,0)) ((64,72) (151,119) (0,0)) ((0,136) (63,175) (0,0)) ((376,40) (415,71) (0,0)) ((232,136) (279,215) (0,0)) ((176,48) (223,63) (0,0)) ((64,136) (151,183) (0,0)) ((472,40) (511,79) (0,0)) ((416,24) (471,111) (0,0)) ((368,72) (415,223) (0,0)) ((160,112) (199,143) (0,0)) ((152,64) (223,111) (0,0)) ((416,136) (495,175) (0,0)) ((472,80) (479,111) (0,0)) ((152,144) (183,167) (0,0)) ((416,176) (471,223) (0,0)) ((184,144) (223,207) (0,0)) ((152,168) (159,175) (0,0)) ((472,176) (479,183) (0,0)) ((168,168) (183,183) (0,0)) ((488,176) (511,215) (0,0)) ((480,184) (487,207) (0,0)) ((176,184) (183,199) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2a20000644000175000017500000000020511634153073021147 0ustar amckinstryamckinstry2 ((0,0) (63,31) (0,0)) 1 ((0,0) (63,31) (0,0)) ((0,0) (127,63) (0,0)) 2 ((16,16) (47,47) (0,0)) ((80,16) (111,47) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.70000644000175000017500000000042211634153073021010 0ustar amckinstryamckinstry1 ((0,0) (511,255) (0,0)) 7 ((0,136) (255,175) (0,0)) ((232,80) (511,119) (0,0)) ((0,88) (199,119) (0,0)) ((200,80) (231,95) (0,0)) ((200,96) (215,119) (0,0)) ((216,96) (231,111) (0,0)) ((256,136) (511,175) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2mike0000644000175000017500000000037411634153073021601 0ustar amckinstryamckinstry2 ((0,0) (63,63) (0,0)) 1 ((0,0) (63,63) (0,0)) ((0,0) (127,127) (0,0)) 5 ((4,74) (23,111) (0,0)) ((24,76) (31,113) (0,0)) ((32,80) (35,81) (0,0)) ((32,82) (95,115) (0,0)) ((54,56) (95,81) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtjbb20000644000175000017500000000135011634153073021406 0ustar amckinstryamckinstry3 ((0,0,0) (39,7,23) (0,0,0)) 1 ((0,0,0) (39,7,23) (0,0,0)) ((0,0,0) (159,31,95) (0,0,0)) 2 ((0,0,20) (31,31,75) (0,0,0)) ((32,0,20) (95,31,75) (0,0,0)) ((0,0,0) (639,127,383) (0,0,0)) 12 ((0,0,180) (55,63,203) (0,0,0)) ((296,0,180) (355,63,203) (0,0,0)) ((236,0,180) (295,63,203) (0,0,0)) ((176,0,180) (235,63,203) (0,0,0)) ((116,0,180) (175,63,203) (0,0,0)) ((56,0,180) (115,63,203) (0,0,0)) ((0,64,180) (55,127,203) (0,0,0)) ((296,64,180) (355,127,203) (0,0,0)) ((236,64,180) (295,127,203) (0,0,0)) ((176,64,180) (235,127,203) (0,0,0)) ((116,64,180) (175,127,203) (0,0,0)) ((56,64,180) (115,127,203) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt8b0000644000175000017500000000021411634153073021076 0ustar amckinstryamckinstry2 ((0,0,0) (7,7,7) (0,0,0)) 1 ((0,0,0) (7,7,7) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 1 ((0,0,0) (31,15,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt.sstanley_30000644000175000017500000001216011634153073022732 0ustar amckinstryamckinstry2 ((0,0,0) (71,119,47) (0,0,0)) 24 ((0,0,0) (23,23,15) (0,0,0)) ((48,0,0) (71,23,15) (0,0,0)) ((24,0,0) (47,23,15) (0,0,0)) ((0,88,0) (23,119,15) (0,0,0)) ((0,56,0) (23,87,15) (0,0,0)) ((0,24,0) (23,55,15) (0,0,0)) ((0,0,16) (23,23,47) (0,0,0)) ((48,88,0) (71,119,15) (0,0,0)) ((48,56,0) (71,87,15) (0,0,0)) ((48,24,0) (71,55,15) (0,0,0)) ((48,0,16) (71,23,47) (0,0,0)) ((24,88,0) (47,119,15) (0,0,0)) ((24,56,0) (47,87,15) (0,0,0)) ((24,24,0) (47,55,15) (0,0,0)) ((24,0,16) (47,23,47) (0,0,0)) ((0,88,16) (23,119,47) (0,0,0)) ((0,56,16) (23,87,47) (0,0,0)) ((0,24,16) (23,55,47) (0,0,0)) ((48,88,16) (71,119,47) (0,0,0)) ((48,56,16) (71,87,47) (0,0,0)) ((48,24,16) (71,55,47) (0,0,0)) ((24,88,16) (47,119,47) (0,0,0)) ((24,56,16) (47,87,47) (0,0,0)) ((24,24,16) (47,55,47) (0,0,0)) ((0,0,0) (287,479,191) (0,0,0)) 1 ((0,216,160) (15,247,191) (0,0,0)) 2 ((0,0,0) (71,119,47) (0,0,0)) 24 ((0,0,0) (23,23,15) (0,0,0)) ((48,0,0) (71,23,15) (0,0,0)) ((24,0,0) (47,23,15) (0,0,0)) ((0,88,0) (23,119,15) (0,0,0)) ((0,56,0) (23,87,15) (0,0,0)) ((0,24,0) (23,55,15) (0,0,0)) ((0,0,16) (23,23,47) (0,0,0)) ((48,88,0) (71,119,15) (0,0,0)) ((48,56,0) (71,87,15) (0,0,0)) ((48,24,0) (71,55,15) (0,0,0)) ((48,0,16) (71,23,47) (0,0,0)) ((24,88,0) (47,119,15) (0,0,0)) ((24,56,0) (47,87,15) (0,0,0)) ((24,24,0) (47,55,15) (0,0,0)) ((24,0,16) (47,23,47) (0,0,0)) ((0,88,16) (23,119,47) (0,0,0)) ((0,56,16) (23,87,47) (0,0,0)) ((0,24,16) (23,55,47) (0,0,0)) ((48,88,16) (71,119,47) (0,0,0)) ((48,56,16) (71,87,47) (0,0,0)) ((48,24,16) (71,55,47) (0,0,0)) ((24,88,16) (47,119,47) (0,0,0)) ((24,56,16) (47,87,47) (0,0,0)) ((24,24,16) (47,55,47) (0,0,0)) ((0,0,0) (287,479,191) (0,0,0)) 1 ((0,216,160) (15,247,191) (0,0,0)) 6 ((0,0,0) (8,14,5) (0,0,0)) 24 ((0,0,0) (2,2,1) (0,0,0)) ((6,0,0) (8,2,1) (0,0,0)) ((3,0,0) (5,2,1) (0,0,0)) ((0,11,0) (2,14,1) (0,0,0)) ((0,7,0) (2,10,1) (0,0,0)) ((0,3,0) (2,6,1) (0,0,0)) ((0,0,2) (2,2,5) (0,0,0)) ((6,11,0) (8,14,1) (0,0,0)) ((6,7,0) (8,10,1) (0,0,0)) ((6,3,0) (8,6,1) (0,0,0)) ((6,0,2) (8,2,5) (0,0,0)) ((3,11,0) (5,14,1) (0,0,0)) ((3,7,0) (5,10,1) (0,0,0)) ((3,3,0) (5,6,1) (0,0,0)) ((3,0,2) (5,2,5) (0,0,0)) ((0,11,2) (2,14,5) (0,0,0)) ((0,7,2) (2,10,5) (0,0,0)) ((0,3,2) (2,6,5) (0,0,0)) ((6,11,2) (8,14,5) (0,0,0)) ((6,7,2) (8,10,5) (0,0,0)) ((6,3,2) (8,6,5) (0,0,0)) ((3,11,2) (5,14,5) (0,0,0)) ((3,7,2) (5,10,5) (0,0,0)) ((3,3,2) (5,6,5) (0,0,0)) ((0,0,0) (17,29,11) (0,0,0)) 24 ((0,0,0) (5,5,3) (0,0,0)) ((12,0,0) (17,5,3) (0,0,0)) ((6,0,0) (11,5,3) (0,0,0)) ((0,22,0) (5,29,3) (0,0,0)) ((0,14,0) (5,21,3) (0,0,0)) ((0,6,0) (5,13,3) (0,0,0)) ((0,0,4) (5,5,11) (0,0,0)) ((12,22,0) (17,29,3) (0,0,0)) ((12,14,0) (17,21,3) (0,0,0)) ((12,6,0) (17,13,3) (0,0,0)) ((12,0,4) (17,5,11) (0,0,0)) ((6,22,0) (11,29,3) (0,0,0)) ((6,14,0) (11,21,3) (0,0,0)) ((6,6,0) (11,13,3) (0,0,0)) ((6,0,4) (11,5,11) (0,0,0)) ((0,22,4) (5,29,11) (0,0,0)) ((0,14,4) (5,21,11) (0,0,0)) ((0,6,4) (5,13,11) (0,0,0)) ((12,22,4) (17,29,11) (0,0,0)) ((12,14,4) (17,21,11) (0,0,0)) ((12,6,4) (17,13,11) (0,0,0)) ((6,22,4) (11,29,11) (0,0,0)) ((6,14,4) (11,21,11) (0,0,0)) ((6,6,4) (11,13,11) (0,0,0)) ((0,0,0) (35,59,23) (0,0,0)) 24 ((0,0,0) (11,11,7) (0,0,0)) ((24,0,0) (35,11,7) (0,0,0)) ((12,0,0) (23,11,7) (0,0,0)) ((0,44,0) (11,59,7) (0,0,0)) ((0,28,0) (11,43,7) (0,0,0)) ((0,12,0) (11,27,7) (0,0,0)) ((0,0,8) (11,11,23) (0,0,0)) ((24,44,0) (35,59,7) (0,0,0)) ((24,28,0) (35,43,7) (0,0,0)) ((24,12,0) (35,27,7) (0,0,0)) ((24,0,8) (35,11,23) (0,0,0)) ((12,44,0) (23,59,7) (0,0,0)) ((12,28,0) (23,43,7) (0,0,0)) ((12,12,0) (23,27,7) (0,0,0)) ((12,0,8) (23,11,23) (0,0,0)) ((0,44,8) (11,59,23) (0,0,0)) ((0,28,8) (11,43,23) (0,0,0)) ((0,12,8) (11,27,23) (0,0,0)) ((24,44,8) (35,59,23) (0,0,0)) ((24,28,8) (35,43,23) (0,0,0)) ((24,12,8) (35,27,23) (0,0,0)) ((12,44,8) (23,59,23) (0,0,0)) ((12,28,8) (23,43,23) (0,0,0)) ((12,12,8) (23,27,23) (0,0,0)) ((0,0,0) (71,119,47) (0,0,0)) 24 ((0,0,0) (23,23,15) (0,0,0)) ((48,0,0) (71,23,15) (0,0,0)) ((24,0,0) (47,23,15) (0,0,0)) ((0,88,0) (23,119,15) (0,0,0)) ((0,56,0) (23,87,15) (0,0,0)) ((0,24,0) (23,55,15) (0,0,0)) ((0,0,16) (23,23,47) (0,0,0)) ((48,88,0) (71,119,15) (0,0,0)) ((48,56,0) (71,87,15) (0,0,0)) ((48,24,0) (71,55,15) (0,0,0)) ((48,0,16) (71,23,47) (0,0,0)) ((24,88,0) (47,119,15) (0,0,0)) ((24,56,0) (47,87,15) (0,0,0)) ((24,24,0) (47,55,15) (0,0,0)) ((24,0,16) (47,23,47) (0,0,0)) ((0,88,16) (23,119,47) (0,0,0)) ((0,56,16) (23,87,47) (0,0,0)) ((0,24,16) (23,55,47) (0,0,0)) ((48,88,16) (71,119,47) (0,0,0)) ((48,56,16) (71,87,47) (0,0,0)) ((48,24,16) (71,55,47) (0,0,0)) ((24,88,16) (47,119,47) (0,0,0)) ((24,56,16) (47,87,47) (0,0,0)) ((24,24,16) (47,55,47) (0,0,0)) ((0,0,0) (143,239,95) (0,0,0)) 1 ((0,108,80) (7,123,95) (0,0,0)) ((0,0,0) (287,479,191) (0,0,0)) 1 ((0,216,160) (15,247,191) (0,0,0)) 4 ((0,0,0) (35,59,23) (0,0,0)) 1 ((0,27,20) (1,30,23) (0,0,0)) ((0,0,0) (71,119,47) (0,0,0)) 1 ((0,54,40) (3,61,47) (0,0,0)) ((0,0,0) (143,239,95) (0,0,0)) 1 ((0,108,80) (7,123,95) (0,0,0)) ((0,0,0) (287,479,191) (0,0,0)) 1 ((0,216,160) (15,247,191) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2a40000644000175000017500000000020511634153073021151 0ustar amckinstryamckinstry2 ((0,0) (31,15) (0,0)) 1 ((0,0) (31,15) (0,0)) ((0,0) (127,63) (0,0)) 2 ((16,16) (47,47) (0,0)) ((80,16) (111,47) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtrick0000644000175000017500000000175511634153073021530 0ustar amckinstryamckinstry3 ((0,0,0) (3,3,15) (0,0,0)) 1 ((0,0,0) (3,3,15) (0,0,0)) ((0,0,0) (15,15,63) (0,0,0)) 2 ((0,0,0) (15,15,15) (0,0,0)) ((0,0,16) (15,15,39) (0,0,0)) ((0,0,0) (63,63,255) (0,0,0)) 20 ((0,0,0) (31,31,23) (0,0,0)) ((32,0,0) (63,31,23) (0,0,0)) ((0,32,0) (31,63,23) (0,0,0)) ((0,0,104) (31,31,135) (0,0,0)) ((0,0,72) (31,31,103) (0,0,0)) ((0,0,48) (31,31,71) (0,0,0)) ((0,0,24) (31,31,47) (0,0,0)) ((32,32,0) (63,63,23) (0,0,0)) ((32,0,104) (63,31,135) (0,0,0)) ((32,0,72) (63,31,103) (0,0,0)) ((32,0,48) (63,31,71) (0,0,0)) ((32,0,24) (63,31,47) (0,0,0)) ((0,32,104) (31,63,135) (0,0,0)) ((0,32,72) (31,63,103) (0,0,0)) ((0,32,48) (31,63,71) (0,0,0)) ((0,32,24) (31,63,47) (0,0,0)) ((32,32,104) (63,63,135) (0,0,0)) ((32,32,72) (63,63,103) (0,0,0)) ((32,32,48) (63,63,71) (0,0,0)) ((32,32,24) (63,63,47) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt30000644000175000017500000000020211634153073020724 0ustar amckinstryamckinstry1 ((0,0,0) (31,31,31) (0,0,0)) 3 ((0,8,8) (7,15,23) (0,0,0)) ((8,8,16) (15,23,31) (0,0,0)) ((16,16,24) (23,31,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt6s0000644000175000017500000000056111634153073021122 0ustar amckinstryamckinstry2 ((0,0,0) (31,31,31) (0,0,0)) 1 ((0,0,0) (31,31,31) (0,0,0)) ((0,0,0) (127,127,127) (0,0,0)) 8 ((0,32,32) (31,63,95) (0,0,0)) ((0,64,32) (31,95,127) (0,0,0)) ((0,32,96) (31,63,127) (0,0,0)) ((32,0,32) (63,95,63) (0,0,0)) ((32,32,64) (63,63,95) (0,0,0)) ((32,64,64) (63,127,95) (0,0,0)) ((32,32,96) (63,95,127) (0,0,0)) ((64,64,0) (95,95,127) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2ann.p50000644000175000017500000000022511634153073021746 0ustar amckinstryamckinstry2 ((0,0) (15,15) (0,0)) 1 ((0,0) (15,15) (0,0)) ((0,0) (31,31) (0,0)) 2 ((0,10) (5,21) (0,0)) ((18,8) (31,23) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtbig40000644000175000017500000000536011634153073021421 0ustar amckinstryamckinstry2 ((0,0,0) (63,63,63) (0,0,0)) 2 ((0,0,0) (23,23,15) (0,0,0)) ((0,0,16) (23,23,47) (0,0,0)) ((0,0,0) (255,255,255) (0,0,0)) 65 ((0,0,16) (31,31,31) (0,0,0)) ((0,0,160) (31,23,183) (0,0,0)) ((0,56,72) (23,87,103) (0,0,0)) ((32,0,24) (55,15,39) (0,0,0)) ((0,32,24) (31,55,47) (0,0,0)) ((0,0,32) (15,15,39) (0,0,0)) ((40,8,144) (47,15,151) (0,0,0)) ((0,48,136) (31,79,151) (0,0,0)) ((56,0,72) (87,31,103) (0,0,0)) ((48,24,72) (55,31,79) (0,0,0)) ((32,16,24) (55,31,47) (0,0,0)) ((0,56,40) (31,79,71) (0,0,0)) ((0,40,48) (15,55,63) (0,0,0)) ((16,0,32) (31,15,47) (0,0,0)) ((0,16,32) (15,31,47) (0,0,0)) ((32,32,136) (47,47,151) (0,0,0)) ((48,0,136) (79,31,151) (0,0,0)) ((32,0,152) (47,31,183) (0,0,0)) ((32,24,144) (39,31,151) (0,0,0)) ((0,24,152) (31,47,183) (0,0,0)) ((8,40,144) (23,47,151) (0,0,0)) ((56,32,72) (79,63,103) (0,0,0)) ((24,48,72) (55,79,103) (0,0,0)) ((48,40,88) (55,47,111) (0,0,0)) ((40,32,72) (55,47,87) (0,0,0)) ((56,0,40) (79,31,71) (0,0,0)) ((32,16,48) (55,39,71) (0,0,0)) ((32,32,32) (39,55,47) (0,0,0)) ((16,32,48) (31,39,55) (0,0,0)) ((16,16,32) (31,31,55) (0,0,0)) ((48,32,136) (55,47,167) (0,0,0)) ((32,48,136) (47,55,167) (0,0,0)) ((48,0,152) (55,31,175) (0,0,0)) ((40,16,136) (47,31,151) (0,0,0)) ((0,48,152) (31,55,175) (0,0,0)) ((24,32,136) (31,47,151) (0,0,0)) ((56,32,104) (63,63,135) (0,0,0)) ((32,40,128) (39,47,135) (0,0,0)) ((56,32,48) (71,39,71) (0,0,0)) ((40,32,32) (47,47,47) (0,0,0)) ((16,40,48) (31,55,71) (0,0,0)) ((56,32,136) (71,39,159) (0,0,0)) ((48,48,136) (55,63,151) (0,0,0)) ((32,56,136) (47,71,143) (0,0,0)) ((56,0,152) (71,15,167) (0,0,0)) ((0,56,152) (23,71,167) (0,0,0)) ((64,32,104) (79,55,135) (0,0,0)) ((48,24,128) (55,31,135) (0,0,0)) ((56,40,56) (63,55,71) (0,0,0)) ((48,32,40) (55,39,47) (0,0,0)) ((56,40,136) (63,55,151) (0,0,0)) ((32,56,144) (39,71,159) (0,0,0)) ((56,16,152) (63,31,167) (0,0,0)) ((24,56,152) (31,63,159) (0,0,0)) ((40,32,112) (55,47,135) (0,0,0)) ((64,40,64) (71,47,71) (0,0,0)) ((64,40,136) (71,47,143) (0,0,0)) ((40,56,144) (47,63,151) (0,0,0)) ((64,16,152) (71,23,159) (0,0,0)) ((0,56,104) (23,87,135) (0,0,0)) ((32,0,40) (55,15,63) (0,0,0)) ((56,0,104) (87,31,135) (0,0,0)) ((32,32,152) (47,47,175) (0,0,0)) ((24,48,104) (55,79,135) (0,0,0)) ((32,40,48) (55,71,71) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.19s20000644000175000017500000000140111634153073021336 0ustar amckinstryamckinstry2 ((0,0) (255,127) (0,0)) 1 ((0,0) (255,127) (0,0)) ((0,0) (511,255) (0,0)) 19 ((0,72) (135,119) (0,0)) ((288,80) (399,119) (0,0)) ((160,48) (215,71) (0,0)) ((0,136) (135,183) (0,0)) ((400,72) (511,119) (0,0)) ((152,72) (231,103) (0,0)) ((280,144) (351,167) (0,0)) ((496,128) (511,143) (0,0)) ((280,120) (383,143) (0,0)) ((152,104) (191,207) (0,0)) ((352,144) (511,183) (0,0)) ((456,120) (487,143) (0,0)) ((384,120) (391,127) (0,0)) ((192,152) (231,175) (0,0)) ((400,128) (431,143) (0,0)) ((384,136) (399,143) (0,0)) ((192,176) (207,207) (0,0)) ((432,136) (455,143) (0,0)) ((208,176) (231,191) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt4s40000644000175000017500000000053411634153073021204 0ustar amckinstryamckinstry2 ((0,0,0) (7,7,7) (0,0,0)) 1 ((0,0,0) (7,7,7) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 8 ((0,8,8) (7,15,23) (0,0,0)) ((0,16,8) (7,23,31) (0,0,0)) ((0,8,24) (7,15,31) (0,0,0)) ((8,0,8) (15,23,15) (0,0,0)) ((8,8,16) (15,15,23) (0,0,0)) ((8,16,16) (15,31,23) (0,0,0)) ((8,8,24) (15,23,31) (0,0,0)) ((16,16,0) (23,23,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtjbb0000644000175000017500000000027311634153073021327 0ustar amckinstryamckinstry2 ((0,0,0) (31,15,15) (0,0,0)) 1 ((0,0,0) (31,15,15) (0,0,0)) ((0,0,0) (127,63,63) (0,0,0)) 2 ((0,0,16) (39,63,47) (0,0,0)) ((40,0,16) (83,63,47) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2h0000644000175000017500000000015211634153073021075 0ustar amckinstryamckinstry2 ((0,0) (63,63) (0,0)) 1 ((0,0) (63,63) (0,0)) ((0,0) (127,127) (0,0)) 1 ((0,0) (31,31) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr10000644000175000017500000000006511634153073020727 0ustar amckinstryamckinstry1 ((0,0) (63,31) (0,0)) 1 ((0,0) (63,31) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2.10000644000175000017500000000015011634153073021062 0ustar amckinstryamckinstry2 ((0,0) (15,15) (0,0)) 1 ((0,0) (15,15) (0,0)) ((0,0) (63,63) (0,0)) 1 ((0,0) (63,31) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr3a0000644000175000017500000000015411634153073021071 0ustar amckinstryamckinstry2 ((0,0) (31,31) (0,0)) 1 ((0,0) (31,31) (0,0)) ((0,0) (127,127) (0,0)) 1 ((0,0) (63,127) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtpfail0000644000175000017500000000033711634153073021666 0ustar amckinstryamckinstry2 ((0,0,0) (15,15,15) (0,0,0)) 1 ((0,0,0) (15,15,15) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 3 ((20,8,28) (27,23,31) (0,0,0)) ((24,8,0) (27,23,7) (0,0,0)) ((20,12,0) (23,19,3) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr3mike.30000644000175000017500000000036411634153073021742 0ustar amckinstryamckinstry3 ((0,0) (63,63) (0,0)) 1 ((0,0) (63,63) (0,0)) ((0,0) (127,127) (0,0)) 2 ((0,52) (43,83) (0,0)) ((0,84) (43,123) (0,0)) ((0,0) (511,511) (0,0)) 3 ((28,392) (83,447) (0,0)) ((28,336) (83,391) (0,0)) ((84,336) (143,387) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt4s20000644000175000017500000000054211634153073021201 0ustar amckinstryamckinstry2 ((0,0,0) (15,15,15) (0,0,0)) 1 ((0,0,0) (15,15,15) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 8 ((0,8,8) (7,15,23) (0,0,0)) ((0,16,8) (7,23,31) (0,0,0)) ((0,8,24) (7,15,31) (0,0,0)) ((8,0,8) (15,23,15) (0,0,0)) ((8,8,16) (15,15,23) (0,0,0)) ((8,16,16) (15,31,23) (0,0,0)) ((8,8,24) (15,23,31) (0,0,0)) ((16,16,0) (23,23,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt0100000644000175000017500000000007511634153073021072 0ustar amckinstryamckinstry1 ((0,0,0) (9,9,9) (0,0,0)) 1 ((0,0,0) (9,9,9) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2r30000644000175000017500000000015611634153073021176 0ustar amckinstryamckinstry2 ((0,0) (63,63) (0,0)) 1 ((0,0) (63,63) (0,0)) ((0,0) (255,255) (0,0)) 1 ((64,80) (191,207) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt0120000644000175000017500000000010311634153073021064 0ustar amckinstryamckinstry1 ((0,0,0) (11,11,11) (0,0,0)) 1 ((0,0,0) (11,11,11) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.8a0000644000175000017500000000045611634153073021161 0ustar amckinstryamckinstry1 ((0,0) (511,255) (0,0)) 8 ((40,80) (55,87) (0,0)) ((80,72) (111,119) (0,0)) ((0,88) (79,119) (0,0)) ((56,72) (79,87) (0,0)) ((152,80) (511,119) (0,0)) ((112,80) (151,135) (0,0)) ((0,136) (255,175) (0,0)) ((256,136) (511,175) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2r20000644000175000017500000000015511634153073021174 0ustar amckinstryamckinstry2 ((0,0) (31,31) (0,0)) 1 ((0,0) (31,31) (0,0)) ((0,0) (127,127) (0,0)) 1 ((32,40) (95,103) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt60000644000175000017500000000046011634153073020735 0ustar amckinstryamckinstry1 ((0,0,0) (127,127,127) (0,0,0)) 8 ((0,32,32) (31,63,95) (0,0,0)) ((0,64,32) (31,95,127) (0,0,0)) ((0,32,96) (31,63,127) (0,0,0)) ((32,0,32) (63,95,63) (0,0,0)) ((32,32,64) (63,63,95) (0,0,0)) ((32,64,64) (63,127,95) (0,0,0)) ((32,32,96) (63,95,127) (0,0,0)) ((64,64,0) (95,95,127) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtgrav40000644000175000017500000000063411634153073021616 0ustar amckinstryamckinstry2 ((0,0,0) (11,11,11) (0,0,0)) 1 ((0,0,0) (11,11,11) (0,0,0)) ((0,0,0) (47,47,47) (0,0,0)) 8 ((8,8,8) (47,39,39) (0,0,0)) ((4,12,16) (7,15,31) (0,0,0)) ((4,28,28) (7,35,35) (0,0,0)) ((0,16,24) (7,27,35) (0,0,0)) ((4,28,12) (7,31,15) (0,0,0)) ((0,16,12) (7,27,23) (0,0,0)) ((0,28,16) (7,35,27) (0,0,0)) ((0,28,28) (3,31,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2c0000644000175000017500000000023611634153073021073 0ustar amckinstryamckinstry2 ((0,0) (31,15) (0,0)) 1 ((0,0) (31,15) (0,0)) ((0,0) (127,63) (0,0)) 3 ((16,20) (47,51) (0,0)) ((48,20) (79,51) (0,0)) ((80,16) (111,47) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.160000644000175000017500000000111611634153073021071 0ustar amckinstryamckinstry1 ((0,0) (511,255) (0,0)) 16 ((232,56) (319,111) (0,0)) ((0,136) (119,159) (0,0)) ((0,80) (119,119) (0,0)) ((120,56) (191,95) (0,0)) ((248,112) (295,199) (0,0)) ((416,24) (439,63) (0,0)) ((320,24) (415,111) (0,0)) ((128,136) (191,207) (0,0)) ((0,160) (31,167) (0,0)) ((120,96) (167,135) (0,0)) ((296,144) (439,231) (0,0)) ((416,64) (511,111) (0,0)) ((464,40) (511,63) (0,0)) ((440,152) (511,215) (0,0)) ((32,160) (127,175) (0,0)) ((120,176) (127,191) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2dave0000644000175000017500000000017111634153073021566 0ustar amckinstryamckinstry2 ((0,0) (63,71) (0,0)) 1 ((0,0) (63,71) (0,0)) ((0,0) (127,143) (0,0)) 1 ((0,0) (127,63) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt4s4.4.20000644000175000017500000000053611634153073021510 0ustar amckinstryamckinstry2 ((0,0,0) (7,7,15) (0,0,0)) 1 ((0,0,0) (7,7,15) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 8 ((0,8,8) (7,15,23) (0,0,0)) ((0,16,8) (7,23,31) (0,0,0)) ((0,8,24) (7,15,31) (0,0,0)) ((8,0,8) (15,23,15) (0,0,0)) ((8,8,16) (15,15,23) (0,0,0)) ((8,16,16) (15,31,23) (0,0,0)) ((8,8,24) (15,23,31) (0,0,0)) ((16,16,0) (23,23,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr0b0000644000175000017500000000010611634153073021064 0ustar amckinstryamckinstry1 ((0,0) (7,7) (0,0)) 2 ((0,0) (3,7) (0,0)) ((4,0) (7,7) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.110000644000175000017500000000062511634153073021070 0ustar amckinstryamckinstry1 ((0,0) (511,255) (0,0)) 11 ((0,80) (47,119) (0,0)) ((0,136) (47,175) (0,0)) ((48,80) (63,87) (0,0)) ((48,136) (159,183) (0,0)) ((48,88) (279,127) (0,0)) ((144,80) (175,87) (0,0)) ((64,72) (95,87) (0,0)) ((280,136) (511,167) (0,0)) ((160,136) (279,175) (0,0)) ((96,80) (127,87) (0,0)) ((280,88) (511,127) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2d20000644000175000017500000000024211634153073021153 0ustar amckinstryamckinstry2 ((0,0) (63,31) (0,0)) 1 ((0,0) (63,31) (0,0)) ((0,0) (255,127) (0,0)) 3 ((32,40) (95,103) (0,0)) ((96,24) (159,39) (0,0)) ((160,32) (223,95) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt4s4.2.40000644000175000017500000000053611634153073021510 0ustar amckinstryamckinstry2 ((0,0,0) (7,15,7) (0,0,0)) 1 ((0,0,0) (7,15,7) (0,0,0)) ((0,0,0) (31,31,31) (0,0,0)) 8 ((0,8,8) (7,15,23) (0,0,0)) ((0,16,8) (7,23,31) (0,0,0)) ((0,8,24) (7,15,31) (0,0,0)) ((8,0,8) (15,23,15) (0,0,0)) ((8,8,16) (15,15,23) (0,0,0)) ((8,16,16) (15,31,23) (0,0,0)) ((8,8,24) (15,23,31) (0,0,0)) ((16,16,0) (23,23,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr3ann0000644000175000017500000000025511634153073021427 0ustar amckinstryamckinstry3 ((0,0) (7,7) (0,0)) 1 ((0,0) (7,7) (0,0)) ((0,0) (15,15) (0,0)) 1 ((0,4) (15,11) (0,0)) ((0,0) (31,31) (0,0)) 1 ((0,12) (27,19) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr00000644000175000017500000000006511634153073020726 0ustar amckinstryamckinstry1 ((0,0) (63,63) (0,0)) 1 ((0,0) (63,63) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt.jbb.10000644000175000017500000000051611634153073021544 0ustar amckinstryamckinstry2 ((0,0,0) (63,31,31) (0,0,0)) 2 ((0,0,0) (31,31,31) (0,0,0)) ((32,0,0) (63,31,31) (0,0,0)) ((0,0,0) (255,127,127) (0,0,0)) 1 ((0,24,0) (23,47,15) (0,0,0)) ((0,24,96) (23,47,127) (0,0,0)) ((240,24,0) (255,43,7) (0,0,0)) ((240,16,96) (255,43,127) (0,0,0)) ((0,24,0) (23,43,15) (0,0,0)) ((0,24,104) (23,43,127) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt050000644000175000017500000000007511634153073021016 0ustar amckinstryamckinstry1 ((0,0,0) (4,4,4) (0,0,0)) 1 ((0,0,0) (4,4,4) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2f0000644000175000017500000000020411634153073021071 0ustar amckinstryamckinstry2 ((0,0) (31,15) (0,0)) 1 ((0,0) (31,15) (0,0)) ((0,0) (127,63) (0,0)) 2 ((16,20) (47,51) (0,0)) ((48,20) (79,51) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt2t30000644000175000017500000000031211634153073021174 0ustar amckinstryamckinstry2 ((0,0,0) (3,3,3) (0,0,0)) 1 ((0,0,0) (3,3,3) (0,0,0)) ((0,0,0) (7,7,7) (0,0,0)) 3 ((0,2,2) (1,3,5) (0,0,0)) ((0,4,2) (1,5,7) (0,0,0)) ((4,4,0) (5,5,7) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2g0000644000175000017500000000023511634153073021076 0ustar amckinstryamckinstry2 ((0,0) (31,15) (0,0)) 1 ((0,0) (31,15) (0,0)) ((0,0) (127,63) (0,0)) 3 ((16,20) (47,51) (0,0)) ((48,8) (79,15) (0,0)) ((80,16) (111,47) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr20000644000175000017500000000020511634153073020724 0ustar amckinstryamckinstry2 ((0,0) (31,15) (0,0)) 1 ((0,0) (31,15) (0,0)) ((0,0) (127,63) (0,0)) 2 ((16,20) (47,51) (0,0)) ((80,16) (111,47) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2e0000644000175000017500000000020411634153073021070 0ustar amckinstryamckinstry2 ((0,0) (31,15) (0,0)) 1 ((0,0) (31,15) (0,0)) ((0,0) (127,63) (0,0)) 2 ((0,20) (47,51) (0,0)) ((80,16) (111,47) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt12.30000644000175000017500000000230111634153073021147 0ustar amckinstryamckinstry2 ((0,0,0) (63,63,71) (0,0,0)) 1 ((0,0,0) (39,39,71) (0,0,0)) ((0,0,0) (127,127,143) (0,0,0)) 28 ((0,0,24) (23,23,39) (0,0,0)) ((16,16,64) (23,23,71) (0,0,0)) ((24,0,32) (39,23,63) (0,0,0)) ((0,24,32) (7,55,63) (0,0,0)) ((24,0,64) (55,23,87) (0,0,0)) ((0,24,64) (23,55,87) (0,0,0)) ((0,0,88) (23,23,119) (0,0,0)) ((8,16,80) (15,23,87) (0,0,0)) ((40,0,40) (47,7,47) (0,0,0)) ((8,24,32) (23,47,63) (0,0,0)) ((24,0,88) (47,15,119) (0,0,0)) ((24,24,40) (31,47,55) (0,0,0)) ((0,24,88) (7,47,119) (0,0,0)) ((16,8,72) (23,23,87) (0,0,0)) ((32,24,40) (39,31,47) (0,0,0)) ((40,8,40) (47,23,63) (0,0,0)) ((40,0,48) (55,7,63) (0,0,0)) ((24,16,88) (31,39,111) (0,0,0)) ((32,24,64) (47,39,87) (0,0,0)) ((8,24,88) (23,31,119) (0,0,0)) ((32,24,48) (39,39,63) (0,0,0)) ((32,16,88) (47,23,95) (0,0,0)) ((8,32,88) (23,47,111) (0,0,0)) ((40,24,56) (47,31,63) (0,0,0)) ((32,24,88) (39,39,103) (0,0,0)) ((32,16,96) (39,23,111) (0,0,0)) ((0,0,40) (23,23,63) (0,0,0)) ((24,24,56) (31,47,87) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.19s40000644000175000017500000000137711634153073021354 0ustar amckinstryamckinstry2 ((0,0) (127,63) (0,0)) 1 ((0,0) (127,63) (0,0)) ((0,0) (511,255) (0,0)) 19 ((0,72) (135,119) (0,0)) ((288,80) (399,119) (0,0)) ((160,48) (215,71) (0,0)) ((0,136) (135,183) (0,0)) ((400,72) (511,119) (0,0)) ((152,72) (231,103) (0,0)) ((280,144) (351,167) (0,0)) ((496,128) (511,143) (0,0)) ((280,120) (383,143) (0,0)) ((152,104) (191,207) (0,0)) ((352,144) (511,183) (0,0)) ((456,120) (487,143) (0,0)) ((384,120) (391,127) (0,0)) ((192,152) (231,175) (0,0)) ((400,128) (431,143) (0,0)) ((384,136) (399,143) (0,0)) ((192,176) (207,207) (0,0)) ((432,136) (455,143) (0,0)) ((208,176) (231,191) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr3.rz0000644000175000017500000000042711634153073021365 0ustar amckinstryamckinstry3 ((0,0) (63,63) (0,0)) 1 ((0,0) (63,63) (0,0)) ((0,0) (255,255) (0,0)) 2 ((0,0) (23,39) (0,0)) ((24,0) (87,15) (0,0)) ((0,0) (1023,1023) (0,0)) 3 ((0,0) (71,119) (0,0)) ((72,0) (199,15) (0,0)) ((200,0) (327,15) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt6s20000644000175000017500000000056111634153073021204 0ustar amckinstryamckinstry2 ((0,0,0) (63,63,63) (0,0,0)) 1 ((0,0,0) (63,63,63) (0,0,0)) ((0,0,0) (127,127,127) (0,0,0)) 8 ((0,32,32) (31,63,95) (0,0,0)) ((0,64,32) (31,95,127) (0,0,0)) ((0,32,96) (31,63,127) (0,0,0)) ((32,0,32) (63,95,63) (0,0,0)) ((32,32,64) (63,63,95) (0,0,0)) ((32,64,64) (63,127,95) (0,0,0)) ((32,32,96) (63,95,127) (0,0,0)) ((64,64,0) (95,95,127) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt50000644000175000017500000000045011634153073020733 0ustar amckinstryamckinstry1 ((0,0,0) (63,63,63) (0,0,0)) 8 ((0,16,16) (15,31,47) (0,0,0)) ((0,32,16) (15,47,63) (0,0,0)) ((0,16,48) (15,31,63) (0,0,0)) ((16,0,16) (31,47,31) (0,0,0)) ((16,16,32) (31,31,47) (0,0,0)) ((16,32,32) (31,63,47) (0,0,0)) ((16,16,48) (31,47,63) (0,0,0)) ((32,32,0) (47,47,63) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt00000644000175000017500000000010311634153073020721 0ustar amckinstryamckinstry1 ((0,0,0) (31,31,31) (0,0,0)) 1 ((0,0,0) (31,31,31) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2.00000644000175000017500000000015011634153073021061 0ustar amckinstryamckinstry2 ((0,0) (15,15) (0,0)) 1 ((0,0) (15,15) (0,0)) ((0,0) (63,63) (0,0)) 1 ((0,0) (31,63) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt.inputs.3d.spin.grids0000644000175000017500000000327711634153073024565 0ustar amckinstryamckinstry 3 ((0,0,0) (15,7,7) (0,0,0)) 1 ((0,0,0) (15,7,7) (0,0,0)) ((0,0,0) (63,31,31) (0,0,0)) 1 ((16,0,0) (47,31,31) (0,0,0)) ((0,0,0) (255,127,127) (0,0,0)) 37 ((96,40,40) (99,43,43) (0,0,0)) ((92,44,28) (115,67,51) (0,0,0)) ((92,28,44) (115,43,67) (0,0,0)) ((104,32,36) (107,43,43) (0,0,0)) ((100,36,36) (103,43,43) (0,0,0)) ((140,36,36) (147,43,43) (0,0,0)) ((144,36,80) (151,43,83) (0,0,0)) ((148,36,44) (151,43,51) (0,0,0)) ((148,40,40) (151,43,43) (0,0,0)) ((108,32,40) (139,35,43) (0,0,0)) ((144,36,84) (147,43,91) (0,0,0)) ((144,32,44) (147,43,59) (0,0,0)) ((152,40,48) (155,43,51) (0,0,0)) ((108,36,32) (139,43,43) (0,0,0)) ((148,40,84) (151,43,87) (0,0,0)) ((148,36,52) (155,43,79) (0,0,0)) ((140,44,28) (163,67,51) (0,0,0)) ((116,44,28) (139,67,51) (0,0,0)) ((92,68,28) (115,99,51) (0,0,0)) ((92,44,76) (115,67,99) (0,0,0)) ((92,44,52) (115,67,75) (0,0,0)) ((116,28,44) (143,43,67) (0,0,0)) ((92,28,68) (115,43,95) (0,0,0)) ((144,32,60) (147,43,79) (0,0,0)) ((140,68,28) (163,99,51) (0,0,0)) ((140,44,76) (163,67,99) (0,0,0)) ((140,44,52) (163,67,75) (0,0,0)) ((116,68,28) (139,99,51) (0,0,0)) ((116,44,76) (139,67,99) (0,0,0)) ((116,44,52) (139,67,75) (0,0,0)) ((92,68,76) (115,99,99) (0,0,0)) ((92,68,52) (115,99,75) (0,0,0)) ((116,28,68) (143,43,95) (0,0,0)) ((140,68,76) (163,99,99) (0,0,0)) ((140,68,52) (163,99,75) (0,0,0)) ((116,68,76) (139,99,99) (0,0,0)) ((116,68,52) (139,99,75) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gt3ann20000644000175000017500000000325611634153073021517 0ustar amckinstryamckinstry3 ((0,0,0) (39,7,23) (0,0,0)) 1 ((0,0,0) (39,7,23) (0,0,0)) ((0,0,0) (159,31,95) (0,0,0)) 2 ((0,0,20) (47,31,75) (0,0,0)) ((48,0,20) (99,31,75) (0,0,0)) ((0,0,0) (639,127,383) (0,0,0)) 34 ((148,80,160) (199,111,191) (0,0,0)) ((96,52,160) (127,79,191) (0,0,0)) ((0,0,172) (31,31,207) (0,0,0)) ((0,80,168) (47,127,211) (0,0,0)) ((320,0,176) (355,31,211) (0,0,0)) ((96,0,168) (139,51,211) (0,0,0)) ((320,80,176) (355,127,207) (0,0,0)) ((284,0,168) (319,51,231) (0,0,0)) ((140,0,156) (171,51,215) (0,0,0)) ((284,80,168) (319,127,231) (0,0,0)) ((256,80,176) (283,127,231) (0,0,0)) ((148,112,156) (199,127,187) (0,0,0)) ((236,0,160) (283,51,191) (0,0,0)) ((200,80,160) (255,111,191) (0,0,0)) ((148,80,192) (199,111,227) (0,0,0)) ((256,52,160) (319,79,191) (0,0,0)) ((192,52,160) (255,79,191) (0,0,0)) ((128,52,160) (191,79,191) (0,0,0)) ((96,52,192) (127,79,227) (0,0,0)) ((32,0,172) (95,31,207) (0,0,0)) ((0,32,172) (31,79,207) (0,0,0)) ((96,80,168) (147,127,211) (0,0,0)) ((48,80,168) (95,127,211) (0,0,0)) ((320,32,176) (355,79,211) (0,0,0)) ((172,0,156) (235,51,215) (0,0,0)) ((200,112,156) (255,127,187) (0,0,0)) ((148,112,188) (199,127,227) (0,0,0)) ((236,0,192) (283,51,231) (0,0,0)) ((200,80,192) (255,111,227) (0,0,0)) ((256,52,192) (319,79,227) (0,0,0)) ((192,52,192) (255,79,227) (0,0,0)) ((128,52,192) (191,79,227) (0,0,0)) ((32,32,172) (95,79,207) (0,0,0)) ((200,112,188) (255,127,227) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr3rick20000644000175000017500000000022611634153073021663 0ustar amckinstryamckinstry2 ((0,0) (3,119) (0,0)) 1 ((0,0) (3,119) (0,0)) ((0,0) (7,239) (0,0)) 2 ((0,0) (7,117) (0,0)) ((0,118) (7,237) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.292.110000644000175000017500000000064211634153073021402 0ustar amckinstryamckinstry1 ((0,0) (511,255) (0,0)) 11 ((0,72) (167,119) (0,0)) ((320,96) (351,119) (0,0)) ((232,40) (279,215) (0,0)) ((0,136) (223,175) (0,0)) ((168,48) (223,135) (0,0)) ((376,24) (511,111) (0,0)) ((72,176) (95,183) (0,0)) ((368,112) (415,223) (0,0)) ((168,176) (223,207) (0,0)) ((416,128) (495,175) (0,0)) ((416,176) (511,223) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2d40000644000175000017500000000024711634153073021162 0ustar amckinstryamckinstry2 ((0,0) (127,63) (0,0)) 1 ((0,0) (127,63) (0,0)) ((0,0) (511,255) (0,0)) 3 ((64,80) (191,207) (0,0)) ((192,48) (319,79) (0,0)) ((320,64) (447,191) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gtbig50000644000175000017500000000547011634153073021424 0ustar amckinstryamckinstry3 ((0,0,0) (15,15,15) (0,0,0)) 1 ((0,0,0) (15,15,15) (0,0,0)) ((0,0,0) (63,63,63) (0,0,0)) 2 ((0,0,0) (23,23,15) (0,0,0)) ((0,0,16) (23,23,47) (0,0,0)) ((0,0,0) (255,255,255) (0,0,0)) 65 ((0,0,16) (31,31,31) (0,0,0)) ((0,0,160) (31,23,183) (0,0,0)) ((0,56,72) (23,87,103) (0,0,0)) ((32,0,24) (55,15,39) (0,0,0)) ((0,32,24) (31,55,47) (0,0,0)) ((0,0,32) (15,15,39) (0,0,0)) ((40,8,144) (47,15,151) (0,0,0)) ((0,48,136) (31,79,151) (0,0,0)) ((56,0,72) (87,31,103) (0,0,0)) ((48,24,72) (55,31,79) (0,0,0)) ((32,16,24) (55,31,47) (0,0,0)) ((0,56,40) (31,79,71) (0,0,0)) ((0,40,48) (15,55,63) (0,0,0)) ((16,0,32) (31,15,47) (0,0,0)) ((0,16,32) (15,31,47) (0,0,0)) ((32,32,136) (47,47,151) (0,0,0)) ((48,0,136) (79,31,151) (0,0,0)) ((32,0,152) (47,31,183) (0,0,0)) ((32,24,144) (39,31,151) (0,0,0)) ((0,24,152) (31,47,183) (0,0,0)) ((8,40,144) (23,47,151) (0,0,0)) ((56,32,72) (79,63,103) (0,0,0)) ((24,48,72) (55,79,103) (0,0,0)) ((48,40,88) (55,47,111) (0,0,0)) ((40,32,72) (55,47,87) (0,0,0)) ((56,0,40) (79,31,71) (0,0,0)) ((32,16,48) (55,39,71) (0,0,0)) ((32,32,32) (39,55,47) (0,0,0)) ((16,32,48) (31,39,55) (0,0,0)) ((16,16,32) (31,31,55) (0,0,0)) ((48,32,136) (55,47,167) (0,0,0)) ((32,48,136) (47,55,167) (0,0,0)) ((48,0,152) (55,31,175) (0,0,0)) ((40,16,136) (47,31,151) (0,0,0)) ((0,48,152) (31,55,175) (0,0,0)) ((24,32,136) (31,47,151) (0,0,0)) ((56,32,104) (63,63,135) (0,0,0)) ((32,40,128) (39,47,135) (0,0,0)) ((56,32,48) (71,39,71) (0,0,0)) ((40,32,32) (47,47,47) (0,0,0)) ((16,40,48) (31,55,71) (0,0,0)) ((56,32,136) (71,39,159) (0,0,0)) ((48,48,136) (55,63,151) (0,0,0)) ((32,56,136) (47,71,143) (0,0,0)) ((56,0,152) (71,15,167) (0,0,0)) ((0,56,152) (23,71,167) (0,0,0)) ((64,32,104) (79,55,135) (0,0,0)) ((48,24,128) (55,31,135) (0,0,0)) ((56,40,56) (63,55,71) (0,0,0)) ((48,32,40) (55,39,47) (0,0,0)) ((56,40,136) (63,55,151) (0,0,0)) ((32,56,144) (39,71,159) (0,0,0)) ((56,16,152) (63,31,167) (0,0,0)) ((24,56,152) (31,63,159) (0,0,0)) ((40,32,112) (55,47,135) (0,0,0)) ((64,40,64) (71,47,71) (0,0,0)) ((64,40,136) (71,47,143) (0,0,0)) ((40,56,144) (47,63,151) (0,0,0)) ((64,16,152) (71,23,159) (0,0,0)) ((0,56,104) (23,87,135) (0,0,0)) ((32,0,40) (55,15,63) (0,0,0)) ((56,0,104) (87,31,135) (0,0,0)) ((32,32,152) (47,47,175) (0,0,0)) ((24,48,104) (55,79,135) (0,0,0)) ((32,40,48) (55,71,71) (0,0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2b0000644000175000017500000000020511634153073021066 0ustar amckinstryamckinstry2 ((0,0) (31,15) (0,0)) 1 ((0,0) (31,15) (0,0)) ((0,0) (127,63) (0,0)) 2 ((16,20) (47,51) (0,0)) ((80,16) (111,47) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr2d0000644000175000017500000000023611634153073021074 0ustar amckinstryamckinstry2 ((0,0) (31,15) (0,0)) 1 ((0,0) (31,15) (0,0)) ((0,0) (127,63) (0,0)) 3 ((16,20) (47,51) (0,0)) ((48,12) (79,19) (0,0)) ((80,16) (111,47) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.150000644000175000017500000000104511634153073021071 0ustar amckinstryamckinstry1 ((0,0) (511,255) (0,0)) 15 ((0,80) (55,119) (0,0)) ((56,80) (71,87) (0,0)) ((0,136) (55,175) (0,0)) ((144,80) (175,167) (0,0)) ((56,136) (143,183) (0,0)) ((96,80) (135,87) (0,0)) ((72,72) (95,87) (0,0)) ((176,80) (511,119) (0,0)) ((56,88) (119,119) (0,0)) ((176,128) (191,175) (0,0)) ((120,88) (143,103) (0,0)) ((192,136) (511,175) (0,0)) ((120,104) (127,119) (0,0)) ((128,104) (143,111) (0,0)) ((136,112) (143,127) (0,0)) ccseapps-2.5/CCSEApps/hgproj/tests/gr.80000644000175000017500000000046511634153073021020 0ustar amckinstryamckinstry1 ((0,0) (511,255) (0,0)) 8 ((0,80) (71,119) (0,0)) ((144,80) (511,119) (0,0)) ((0,136) (71,175) (0,0)) ((72,72) (143,119) (0,0)) ((144,120) (175,167) (0,0)) ((72,136) (143,183) (0,0)) ((176,128) (215,175) (0,0)) ((216,136) (511,167) (0,0)) ccseapps-2.5/CCSEApps/hgproj/restrictor.cpp0000644000175000017500000005330611634153073022063 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "restrictor.H" #include "fill_patch.H" #include #if defined( BL_FORT_USE_UNDERSCORE ) #define FORT_FACRST1 acrst1_ #define FORT_FANRST1 anrst1_ #define FORT_FANRST2 anrst2_ #define FORT_FANFR2 anfr2_ #define FORT_FANER2 aner2_ #define FORT_FANCR2 ancr2_ #define FORT_FANOR2 anor2_ #define FORT_FANIR2 anir2_ #define FORT_FANDR2 andr2_ #elif defined( BL_FORT_USE_UPPERCASE ) #define FORT_FACRST1 ACRST1 #define FORT_FANRST1 ANRST1 #define FORT_FANRST2 ANRST2 #define FORT_FANFR2 ANFR2 #define FORT_FANER2 ANER2 #define FORT_FANCR2 ANCR2 #define FORT_FANOR2 ANOR2 #define FORT_FANIR2 ANIR2 #define FORT_FANDR2 ANDR2 #elif defined( BL_FORT_USE_LOWERCASE ) #define FORT_FACRST1 acrst1 #define FORT_FANRST1 anrst1 #define FORT_FANRST2 anrst2 #define FORT_FANFR2 anfr2 #define FORT_FANER2 aner2 #define FORT_FANCR2 ancr2 #define FORT_FANOR2 anor2 #define FORT_FANIR2 anir2 #define FORT_FANDR2 andr2 #else #error "none of BL_FORT_USE_{UNDERSCORE,UPPERCASE,LOWERCASE} defined" #endif extern "C" { void FORT_FACRST1(Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); void FORT_FANRST1(Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); // // Used in the parallel loops, most of these routines have bogus elements // in their calling sequences. // void FORT_FANRST2(Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); void FORT_FANFR2 (Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); void FORT_FANER2 (Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); void FORT_FANCR2 (Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); #if BL_SPACEDIM == 2 void FORT_FANOR2 (Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); void FORT_FANIR2 (Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); void FORT_FANDR2 (Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); #endif } class task_fab_get : public task_fab { public: task_fab_get (task_list& tl_, const MultiFab& d_, int dgrid_, const Box& bx, const MultiFab& s_, int sgrid_); private: // // The data. // task::task_proxy tf; const MultiFab& s; const int sgrid; const Box bx; }; task_fab_get::task_fab_get (task_list& tl_, const MultiFab& d_, int dgrid_, const Box& bx_, const MultiFab& s_, int sgrid_) : task_fab(tl_, d_, dgrid_, bx_, s_.nComp()), s(s_), sgrid(sgrid_), bx(bx_), tf(0) { depend_on(tf = m_task_list.add_task(new task_copy_local(m_task_list, target, target_proc_id(), bx, s, sgrid))); } extern "C" { typedef void (*RESTFUN)(Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); } struct task_restriction_fill : public task { task_restriction_fill (const RESTFUN ref_, task_list& tl_, MultiFab& m_, int ind_, const Box& cbox_, task_fab* tf_, const IntVect& rat_, int integrate_, int i1_ = 0, int i2_ = 0); task_restriction_fill (const RESTFUN ref_, task_list& tl_, MultiFab& m_, int ind_, const Box& cbox_, task_fab* tf_, const IntVect& rat_, int integrate_, const Array& i1_); task_restriction_fill (const RESTFUN ref_, task_list& tl_, MultiFab& m_, int ind_, const Box& cbox_, task_fab* tf_, const IntVect& rat_, int integrate_, const IntVect& i1_, const Array& i2_); virtual bool ready (); private: // // The data. // const RESTFUN ref; task_proxy tf; MultiFab& m; int ind; const Box cbox; const IntVect rat; const int integrate; Array arg1; Array arg2; }; task_restriction_fill::task_restriction_fill (const RESTFUN ref_, task_list& tl_, MultiFab& m_, int ind_, const Box& cbox_, task_fab* tf_, const IntVect& rat_, int integrate_, int i1_, int i2_) : task(tl_), ref(ref_), m(m_), ind(ind_), cbox(cbox_), rat(rat_), integrate(integrate_), arg1(1), arg2(1) { depend_on(tf = m_task_list.add_task(tf_)); arg1[0] = i1_; arg2[0] = i2_; } task_restriction_fill::task_restriction_fill (const RESTFUN ref_, task_list& tl_, MultiFab& m_, int ind_, const Box& cbox_, task_fab* tf_, const IntVect& rat_, int integrate_, const Array& i1_) : task(tl_), ref(ref_), m(m_), ind(ind_), cbox(cbox_), rat(rat_), integrate(integrate_), arg1(i1_), arg2(1) { depend_on(tf = m_task_list.add_task(tf_)); arg2[0] = 0; } task_restriction_fill::task_restriction_fill (const RESTFUN ref_, task_list& tl_, MultiFab& m_, int ind_, const Box& cbox_, task_fab* tf_, const IntVect& rat_, int integrate_, const IntVect& i1_, const Array& i2_) : task(tl_), ref(ref_), m(m_), ind(ind_), cbox(cbox_), rat(rat_), integrate(integrate_), arg1(i1_.getVect(), BL_SPACEDIM), arg2(i2_) { depend_on(tf = m_task_list.add_task(tf_)); } bool task_restriction_fill::ready () { if (is_local(m, ind)) { BL_ASSERT(!tf.null()); BL_ASSERT(tf->ready()); task_fab* tff = dynamic_cast(tf.get()); BL_ASSERT(tff != 0); const Box& fb = tff->fab().box(); const Box& pb = m[ind].box(); (*ref)(m[ind].dataPtr(), DIMLIST(pb), DIMLIST(cbox), tff->fab().dataPtr(), DIMLIST(fb), D_DECL(rat[0], rat[1], rat[2]), m.nComp(), &integrate, arg1.dataPtr(), arg2.dataPtr()); } return true; } amr_restrictor::~amr_restrictor () {} Box amr_restrictor::box (const Box& fb, const IntVect& rat) const { Box retbox(fb); return retbox.coarsen(rat); } Box amr_restrictor::rebox (const Box& cb, const IntVect& rat) const { Box retbox(cb); return retbox.refine(rat); } void amr_restrictor::fill_interface (MultiFab&, MultiFab&, const level_interface&, const amr_boundary*, const IntVect&) const { BoxLib::Abort("I don't think I should ever get here"); } void cell_average_restrictor::fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const { BL_ASSERT(patch.box().cellCentered()); BL_ASSERT(patch.nComp() == 1); FORT_FACRST1(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), fgr.dataPtr(), DIMLIST(fgr.box()), D_DECL(rat[0], rat[1], rat[2]), patch.nComp(), &integrate, 0, 0); } void terrain_velocity_restrictor::fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const { BL_ASSERT(patch.box().cellCentered()); BL_ASSERT(patch.nComp() == 1); const int integ = 1; FORT_FACRST1(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), fgr.dataPtr(), DIMLIST(fgr.box()), D_DECL(rat[0], rat[1], rat[2]), 1, &integ, 0, 0); Real fac = 1.0 / rat[integrate]; patch.mult(fac, region); } void injection_restrictor::fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const { BL_ASSERT(patch.box().type() == IntVect::TheNodeVector()); BL_ASSERT(patch.nComp() == fgr.nComp()); FORT_FANRST1(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), fgr.dataPtr(), DIMLIST(fgr.box()), D_DECL(rat[0], rat[1], rat[2]), patch.nComp(), 0, 0, 0); } void default_restrictor::fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const { BL_ASSERT(patch.box().cellCentered() || patch.box().type() == IntVect::TheNodeVector()); BL_ASSERT(patch.nComp() == fgr.nComp()); if (patch.box().cellCentered()) { cell_average_restrictor(0).fill(patch, region, fgr, rat); } else if (patch.box().type() == IntVect::TheNodeVector()) { injection_restrictor().fill(patch, region, fgr, rat); } } bilinear_restrictor::bilinear_restrictor (int i, bool hg_dense) : integrate(i), m_hg_dense(hg_dense) { BL_ASSERT(i == 0 || i == 1); } Box bilinear_restrictor::box (const Box& fb, const IntVect& rat) const { Box retbox(fb); return retbox.coarsen(rat).grow(-1); } Box bilinear_restrictor::rebox (const Box& cb, const IntVect& rat) const { Box retbox(cb); return retbox.refine(rat).grow(rat-1); } void bilinear_restrictor::fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const { BL_ASSERT(patch.box().type() == IntVect::TheNodeVector()); BL_ASSERT(patch.nComp() == fgr.nComp()); FORT_FANRST2(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), fgr.dataPtr(), DIMLIST(fgr.box()), D_DECL(rat[0], rat[1], rat[2]), patch.nComp(), &integrate, 0, 0); } void bilinear_restrictor::fill_interface (MultiFab& dest, MultiFab& fine, const level_interface& lev_interface, const amr_boundary* bdy, const IntVect& rat) const { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::fill_interface()"); BL_ASSERT(type(dest) == IntVect::TheNodeVector()); BL_ASSERT(dest.nComp() == fine.nComp()); int ratmax = rat[0]; for (int i = 1; i < BL_SPACEDIM; ++i) ratmax = (rat[i] > ratmax) ? rat[i] : ratmax; if (fine.nGrow() >= ratmax - 1) fill_borders(fine, lev_interface, bdy, ratmax - 1, m_hg_dense); const BoxArray& dest_ba = dest.boxArray(); const BoxArray& fine_ba = fine.boxArray(); for (int jgrid = 0; jgrid < dest.size(); jgrid++) { const Box& region = dest_ba[jgrid]; // // Interface restriction is sufficiently rare and specialized that // we will let the restrictor handle it---at least for now. // const Box regplus = BoxLib::grow(region, 1); task_list tl; for (int iface = 0; iface < lev_interface.nboxes(level_interface::FACEDIM); iface++) { if (lev_interface.flag(level_interface::FACEDIM, iface)) continue; Box cbox = lev_interface.node_box(level_interface::FACEDIM, iface); const IntVect t = lev_interface.box(level_interface::FACEDIM, iface).type(); const unsigned int geo = lev_interface.geo(level_interface::FACEDIM, iface); cbox.coarsen(rat); if (region.intersects(cbox)) { // // This extends fine face by one coarse cell past coarse face: // cbox &= regplus; int idim = lev_interface.fdim(iface); cbox.grow(t - 1); Box fb = rebox(cbox, rat); if (geo == level_interface::ALL) { // // Fine grid on both sides. // if (fine.nGrow() >= ratmax - 1) { int igrid = lev_interface.grid( level_interface::FACEDIM, iface, 0); if (igrid < 0) igrid = lev_interface.grid( level_interface::FACEDIM, iface, 1); task_fab* tfab = new task_fab_get(tl, dest, jgrid, fb, fine, igrid); tl.add_task( new task_restriction_fill( &FORT_FANRST2, tl, dest, jgrid, cbox, tfab, rat, integrate)); } else { task_fab* tfab = new task_fill_patch( tl, dest, jgrid, fb, fine, lev_interface, bdy, level_interface::FACEDIM, iface); tl.add_task( new task_restriction_fill( &FORT_FANRST2, tl, dest, jgrid, cbox, tfab, rat, integrate)); } } else { // // Fine grid on just one side. // const int idir = (geo & level_interface::LOW) ? -1 : 1; const int igrid = (idir < 0) ? lev_interface.grid( level_interface::FACEDIM, iface, 0) : lev_interface.grid( level_interface::FACEDIM, iface, 1) ; if (igrid >= 0) { // // Usual case, a fine grid extends all along the face. // task_fab* tfab = new task_fab_get(tl, dest, jgrid, fb, fine, igrid); tl.add_task( new task_restriction_fill( &FORT_FANFR2, tl, dest, jgrid, cbox, tfab, rat, integrate, idim, idir)); } else { // // A virtual fine grid is on the other side of the boundary. // if (geo & level_interface::LOW) fb.growHi(idim, 1 - rat[idim]); else fb.growLo(idim, 1 - rat[idim]); task_fab* tfab = new task_fill_patch( tl, dest, jgrid, fb, fine, lev_interface, bdy, level_interface::FACEDIM, iface); tl.add_task( new task_restriction_fill( &FORT_FANFR2, tl, dest, jgrid, cbox, tfab, rat, integrate, idim, idir)); } } } } tl.execute("bilinear_restrictor::fill_interface(1)"); #if (BL_SPACEDIM == 3) for (int iedge = 0; iedge < lev_interface.nboxes(1); iedge++) { if (lev_interface.flag(1, iedge)) continue; Box cbox = lev_interface.node_box(1, iedge); const IntVect t = lev_interface.box(1, iedge).type(); cbox.coarsen(rat); if (region.intersects(cbox)) { // // This extends fine edge by one coarse cell past coarse face: // cbox &= regplus; cbox.grow(t - 1); const Box fb = rebox(cbox, rat); const unsigned int geo = lev_interface.geo(1, iedge); if (geo == level_interface::ALL && fine.nGrow() >= ratmax - 1) { int igrid = lev_interface.grid(1, iedge, 0); for (int itmp = 1; igrid < 0; itmp++) igrid = lev_interface.grid(1, iedge, itmp); task_fab* tfab = new task_fab_get(tl, dest, jgrid, fb, fine, igrid); tl.add_task( new task_restriction_fill( &FORT_FANRST2, tl, dest, jgrid, cbox, tfab, rat, integrate)); } else { task_fab* tfab = new task_fill_patch( tl, dest, jgrid, fb, fine, lev_interface, bdy, 1, iedge); if (geo == level_interface::ALL) { // // Fine grid on all sides. // tl.add_task( new task_restriction_fill( &FORT_FANRST2, tl, dest, jgrid, cbox, tfab, rat, integrate)); } else { Array ga = lev_interface.geo_array(1, iedge); tl.add_task( new task_restriction_fill( &FORT_FANER2, tl, dest, jgrid, cbox, tfab, rat, integrate, t, ga)); } } } } tl.execute("bilinear_restrictor::fill_interface(2)"); #endif for (int icor = 0; icor < lev_interface.nboxes(0); icor++) { if (lev_interface.flag(0, icor)) continue; Box cbox = lev_interface.box(0, icor); cbox.coarsen(rat); if (region.intersects(cbox)) { const Box fb = rebox(cbox, rat); const unsigned int geo = lev_interface.geo(0, icor); if (geo == level_interface::ALL && fine.nGrow() >= ratmax - 1) { int igrid = lev_interface.grid(0, icor, 0); for (int itmp = 1; igrid < 0; itmp++) igrid = lev_interface.grid(0, icor, itmp); task_fab* tfab = new task_fab_get(tl, dest, jgrid, fb, fine, igrid); tl.add_task( new task_restriction_fill( &FORT_FANRST2, tl, dest, jgrid, cbox, tfab, rat, integrate)); } else { task_fab* tfab = new task_fill_patch(tl, dest, jgrid, fb, fine, lev_interface, bdy, 0, icor); if (geo == level_interface::ALL) { // // Fine grid on all sides. // tl.add_task( new task_restriction_fill( &FORT_FANRST2, tl, dest, jgrid, cbox, tfab, rat, integrate)); } else { Array ga = lev_interface.geo_array(0, icor); tl.add_task( new task_restriction_fill( &FORT_FANCR2, tl, dest, jgrid, cbox, tfab, rat, integrate, ga)); } } } } tl.execute("bilinear_restrictor::fill_interface(3)"); } } ccseapps-2.5/CCSEApps/hgproj/hg_multi1.cpp0000644000175000017500000011266311634153073021556 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "hg_multi.H" #include #if defined( BL_FORT_USE_UNDERSCORE ) #define FORT_HGSRST hgsrst_ #define FORT_HGSCON hgscon_ #define FORT_HGCEN hgcen_ #define FORT_HGCEN_TERRAIN hgcen_terrain_ #define FORT_HGCEN_FULL hgcen_full_ #define FORT_HGINTS hgints_ #define FORT_HGINTS_DENSE hgints_dense_ #define FORT_FACRST1 acrst1_ #define FORT_FANRST2 anrst2_ #elif defined( BL_FORT_USE_UPPERCASE ) #define FORT_HGSRST HGSRST #define FORT_HGSCON HGSCON #define FORT_HGCEN HGCEN #define FORT_HGCEN_TERRAIN HGCEN_TERRAIN #define FORT_HGCEN_FULL HGCEN_FULL #define FORT_HGINTS HGINTS #define FORT_HGINTS_DENSE HGINTS_DENSE #define FORT_FACRST1 ACRST1 #define FORT_FANRST2 ANRST2 #elif defined( BL_FORT_USE_LOWERCASE ) #define FORT_HGSRST hgsrst #define FORT_HGSCON hgscon #define FORT_HGCEN hgcen #define FORT_HGCEN_TERRAIN hgcen_terrain #define FORT_HGCEN_FULL hgcen_full #define FORT_HGINTS hgints #define FORT_HGINTS_DENSE hgints_dense #define FORT_FACRST1 acrst1 #define FORT_FANRST2 anrst2 #else #error "none of BL_FORT_USE_{UNDERSCORE,UPPERCASE,LOWERCASE} defined" #endif extern "C" { void FORT_FACRST1 (Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); void FORT_FANRST2 (Real*, intS, intS, const Real*, intS, intRS, const int&, const int*, const int*, const int*); void FORT_HGSRST (RealPS, intS, intS, CRealPS, intS, intRS); void FORT_HGINTS (Real*, intS, intS, Real*, intS, const Real*, intS, intS, intRS); void FORT_HGINTS_DENSE (Real*, intS, intS, CRealPS, intS, const Real*, intS, intS, intRS); void FORT_HGCEN (Real*, intS, Real*, intS, intS, const int*); void FORT_HGCEN_FULL (Real*, intS, Real*, intS, intS); void FORT_HGCEN_TERRAIN (Real*, intS, Real*, intS, intS); void FORT_HGSCON (Real*, intS, RealPS, intS, intS, CRealPS); } class task_interpolate_patch : public task { public: task_interpolate_patch (task_list& tl_, MultiFab& dmf_, int dgrid_, const Box& dbx_, const MultiFab& smf_, const IntVect& rat_, const amr_interpolator* interp_, const level_interface& lev_interface_); virtual bool ready (); virtual ~task_interpolate_patch (); private: task::task_proxy tf; MultiFab& dmf; const int dgrid; const Box dbx; const MultiFab& smf; const IntVect rat; const amr_interpolator* interp; const level_interface& lev_interface; }; task_interpolate_patch::task_interpolate_patch (task_list& tl_, MultiFab& dmf_, int dgrid_, const Box& dbx_, const MultiFab& smf_, const IntVect& rat_, const amr_interpolator* interp_, const level_interface& lev_interface_) : task(tl_), dmf(dmf_), dgrid(dgrid_), dbx(dbx_), smf(smf_), rat(rat_), interp(interp_), lev_interface(lev_interface_), tf(0) { BL_ASSERT(dbx.sameType(dmf.box(dgrid))); tf = m_task_list.add_task(new task_fill_patch(m_task_list, dmf, dgrid, interp->box(dbx, rat), smf, lev_interface, 0, -1, -1)); depend_on(tf); } bool task_interpolate_patch::ready () { if (is_local(dmf, dgrid)) { BL_ASSERT(is_started()); BL_ASSERT(!tf.null()); task_fab* tff = dynamic_cast(tf.get()); BL_ASSERT(tff != 0); interp->fill(dmf[dgrid], dbx, tff->fab(), tff->fab().box(), rat); } return true; } task_interpolate_patch::~task_interpolate_patch () { delete interp; } class holy_grail_interpolator_dense : public bilinear_interpolator { public: holy_grail_interpolator_dense(Real* Sigptr[BL_SPACEDIM], const Box& Sigbox) : sigbox(Sigbox) { D_TERM(sigptr[0] = Sigptr[0];, sigptr[1] = Sigptr[1];, sigptr[2] = Sigptr[2];); } virtual void fill (FArrayBox& patch, const Box& region, const FArrayBox& cgr, const Box& cb, const IntVect& rat) const; protected: Real* sigptr[BL_SPACEDIM]; const Box sigbox; }; class holy_grail_interpolator : public bilinear_interpolator { public: holy_grail_interpolator(Real *Sigptr, const Box& Sigbox) : sigptr(Sigptr), sigbox(Sigbox) {} virtual void fill (FArrayBox& patch, const Box& region, const FArrayBox& cgr, const Box& cb, const IntVect& rat) const; protected: Real* sigptr; const Box sigbox; }; class holy_grail_sigma_restrictor : public cell_average_restrictor { public: explicit holy_grail_sigma_restrictor(holy_grail_amr_multigrid::stencil m_hg_stencil_) : cell_average_restrictor(0), m_hg_stencil(m_hg_stencil_) {} virtual void fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const; private: holy_grail_amr_multigrid::stencil m_hg_stencil; }; void holy_grail_amr_multigrid::set_line_solve_dimension (int dim) { if (dim != -1) { BoxLib::Abort( "holy_grail_amr_multigrid::holy_grail_amr_multigrid():" "LineSolves not supported in parallel" ); } line_solve_dim = dim; } void holy_grail_amr_multigrid::set_smoother_mode (int mode) { smoother_mode = mode; } bool holy_grail_amr_multigrid::is_dense (stencil sval) { return sval == terrain || sval == full; } holy_grail_amr_multigrid::holy_grail_amr_multigrid(const Array& Mesh, const Array& Gen_ratio, const Box& fdomain, int Lev_min_min, int Lev_min_max, int Lev_max_max, const amr_fluid_boundary& Boundary, stencil stencil_, int Pcode) : amr_multigrid(Mesh, Gen_ratio, Lev_min_min, Lev_min_max, Lev_max_max, Boundary.pressure(), Pcode), boundary(Boundary), smoother_mode(2), line_solve_dim(-1), m_stencil(stencil_) { build_mesh(fdomain); } void holy_grail_amr_multigrid::alloc_hg_multi (PArray& Dest, PArray& Source, PArray& Coarse_source, PArray& Sigma, Real H[], int Lev_min, int Lev_max, int for_fill_sync_reg) { BL_ASSERT(Dest.size() > Lev_max); BL_ASSERT(Dest[Lev_min].nGrow() == 1); if (Source.size()) { source_owned = false; amr_multigrid::alloc_amr_multi(Dest, Source, Coarse_source, Lev_min, Lev_max); } else { source_owned = true; PArray Src; Src.resize(Lev_max + 1); for (int lev = Lev_min; lev <= Lev_max; lev++) { const BoxArray& mesh = Dest[lev].boxArray(); Src.set(lev, new MultiFab(mesh, 1, Dest[Lev_min].nGrow())); Src[lev].setVal(0.0); } amr_multigrid::alloc_amr_multi(Dest, Src, Coarse_source, Lev_min, Lev_max); } h = new Real[mglev_max + 1][BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; i++) { h[mglev_max][i] = H[i]; for (int mglev = mglev_max - 1; mglev >= 0; mglev--) { int rat = mg_domain[mglev+1].length(i) / mg_domain[mglev].length(i); h[mglev][i] = rat * h[mglev+1][i]; } } build_sigma(Sigma, for_fill_sync_reg); if (for_fill_sync_reg > 0) return; alloc_sync_caches(); int ib = dest[lev_min].nGrow(); const BoxArray& mesh0 = corr[0].boxArray(); cgwork.resize(8); cgwork.set(0, new MultiFab(mesh0, 1, ib)); cgwork.set(1, new MultiFab(mesh0, 1, ib)); cgwork.set(2, new MultiFab(mesh0, 1, ib)); cgwork.set(3, &corr[0]); cgwork.set(4, &work[0]); cgwork.set(5, &cen[0]); cgwork.set(6, new MultiFab(mesh0, 1, ib)); cgwork[6].setVal(0.0); cgwork.set(7, new MultiFab(mesh0, 1, ib)); BL_ASSERT(cgwork[3].nGrow() == ib && cgwork[4].nGrow() == ib && cgwork[5].nGrow() == ib); for (MFIter g_mfi(cgwork[7]); g_mfi.isValid(); ++g_mfi) { FArrayBox& gtmp = cgwork[7][g_mfi]; const Box& valid = g_mfi.validbox(); gtmp.setVal(0.0); gtmp.setVal(1.0, valid, 0); Box b = BoxLib::bdryLo(valid, 1); gtmp.setVal(0.5, b, 0); b = BoxLib::bdryHi(valid, 1); gtmp.setVal(0.5, b, 0); b = BoxLib::bdryLo(valid, 0); gtmp.setVal(0.5, b, 0); gtmp.setVal(0.25, BoxLib::bdryLo(b, 1), 0); gtmp.setVal(0.25, BoxLib::bdryHi(b, 1), 0); b = BoxLib::bdryHi(valid, 0); gtmp.setVal(0.5, b, 0); gtmp.setVal(0.25, BoxLib::bdryLo(b, 1), 0); gtmp.setVal(0.25, BoxLib::bdryHi(b, 1), 0); #if (BL_SPACEDIM == 3) b = BoxLib::bdryLo(valid, 2); gtmp.setVal(0.5, b, 0); gtmp.setVal(0.25, BoxLib::bdryLo(b, 0), 0); gtmp.setVal(0.25, BoxLib::bdryHi(b, 0), 0); Box bb = BoxLib::bdryLo(b, 1); gtmp.setVal(0.25, bb, 0); gtmp.setVal(0.125, BoxLib::bdryLo(bb, 0), 0); gtmp.setVal(0.125, BoxLib::bdryHi(bb, 0), 0); bb = BoxLib::bdryHi(b, 1); gtmp.setVal(0.25, bb, 0); gtmp.setVal(0.125, BoxLib::bdryLo(bb, 0), 0); gtmp.setVal(0.125, BoxLib::bdryHi(bb, 0), 0); b = BoxLib::bdryHi(valid, 2); gtmp.setVal(0.5, b, 0); gtmp.setVal(0.25, BoxLib::bdryLo(b, 0), 0); gtmp.setVal(0.25, BoxLib::bdryHi(b, 0), 0); bb = BoxLib::bdryLo(b, 1); gtmp.setVal(0.25, bb, 0); gtmp.setVal(0.125, BoxLib::bdryLo(bb, 0), 0); gtmp.setVal(0.125, BoxLib::bdryHi(bb, 0), 0); bb = BoxLib::bdryHi(b, 1); gtmp.setVal(0.25, bb, 0); gtmp.setVal(0.125, BoxLib::bdryLo(bb, 0), 0); gtmp.setVal(0.125, BoxLib::bdryHi(bb, 0), 0); #endif } singular = false; if (mg_boundary->singular()) { long sng = 0; for (int i = 0; i < mg_mesh[0].size(); i++) { sng += mg_mesh[0][i].numPts(); } singular = (sng == mg_domain[0].numPts()); } // if (m_stencil == terrain) // FIXME if ( is_dense(m_stencil) ) integrate = 1; } void holy_grail_sigma_restrictor::fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const { BL_ASSERT(patch.box().cellCentered()); BL_ASSERT(rat[0] == 2 && rat[1] == 2 || rat[0] == 2 && rat[1] == 1 || rat[0] == 1 && rat[1] == 2); if (m_hg_stencil == holy_grail_amr_multigrid::terrain) { FORT_HGSRST( D_DECL(patch.dataPtr(0), patch.dataPtr(1), patch.dataPtr(2)), DIMLIST(patch.box()), DIMLIST(region), D_DECL( fgr.dataPtr(0), fgr.dataPtr(1), fgr.dataPtr(2)), DIMLIST(fgr.box()), D_DECL(rat[0], rat[1], rat[2])); const int integ = 0; FORT_FACRST1(patch.dataPtr(BL_SPACEDIM), DIMLIST(patch.box()), DIMLIST(region), fgr.dataPtr(BL_SPACEDIM), DIMLIST(fgr.box()), D_DECL(rat[0], rat[1], rat[2]), 1, &integ, 0, 0); #if (BL_SPACEDIM == 2) patch.mult(Real(rat[1]) / rat[0], region, 0, 1); patch.mult(Real(rat[0]) / rat[1], region, 1, 1); // component 2 remains unchanged #else FORT_FACRST1(patch.dataPtr(BL_SPACEDIM+1), DIMLIST(patch.box()), DIMLIST(region), fgr.dataPtr(BL_SPACEDIM+1), DIMLIST(fgr.box()), D_DECL(rat[0], rat[1], rat[2]), 1, &integ, 0, 0); patch.mult(Real(rat[1] * rat[2]) / rat[0], region, 0, 1); patch.mult(Real(rat[0] * rat[2]) / rat[1], region, 1, 1); patch.mult(Real(rat[0] * rat[1]) / rat[2], region, 2, 1); patch.mult(Real(rat[1]), region, 3, 1); patch.mult(Real(rat[0]), region, 4, 1); #endif } else if (m_hg_stencil == holy_grail_amr_multigrid::full) { FORT_HGSRST( D_DECL(patch.dataPtr(0), patch.dataPtr(1), patch.dataPtr(2)), DIMLIST(patch.box()), DIMLIST(region), D_DECL( fgr.dataPtr(0), fgr.dataPtr(1), fgr.dataPtr(2)), DIMLIST(fgr.box()), D_DECL(rat[0], rat[1], rat[2])); #if (BL_SPACEDIM == 2) patch.mult(Real(rat[1]) / rat[0], region, 0, 1); patch.mult(Real(rat[0]) / rat[1], region, 1, 1); #else patch.mult(Real(rat[1] * rat[2]) / rat[0], region, 0, 1); patch.mult(Real(rat[0] * rat[2]) / rat[1], region, 1, 1); patch.mult(Real(rat[0] * rat[1]) / rat[2], region, 2, 1); #endif } else { if (fgr.nComp() == 1) { FORT_HGSRST( D_DECL(patch.dataPtr(0), patch.dataPtr(1), patch.dataPtr(2)), DIMLIST(patch.box()), DIMLIST(region), D_DECL(fgr.dataPtr(), fgr.dataPtr(), fgr.dataPtr()), DIMLIST(fgr.box()), D_DECL(rat[0], rat[1], rat[2])); } else { FORT_HGSRST( D_DECL(patch.dataPtr(0), patch.dataPtr(1), patch.dataPtr(2)), DIMLIST(patch.box()), DIMLIST(region), D_DECL(fgr.dataPtr(0), fgr.dataPtr(1), fgr.dataPtr(2)), DIMLIST(fgr.box()), D_DECL(rat[0], rat[1], rat[2])); } } } void holy_grail_amr_multigrid::build_sigma (PArray& Sigma, int for_fill_sync_reg) { if (m_stencil == terrain || m_stencil == full ) { // // For terrain stencils we have as many sigma arrays passed as // arguments and used at the lev_interface as we build for internal // multigrid purposes. This simplifies handling as we do not // need to maintain separate arrays for different purposes. // const int ncomp = m_stencil == terrain ? 2 * BL_SPACEDIM - 1 : BL_SPACEDIM; sigma.resize(mglev_max+1); for (int mglev = 0; mglev <= mglev_max; mglev++) { if (for_fill_sync_reg == 0 || mglev == mglev_max) { sigma.set(mglev, new MultiFab(mg_mesh[mglev], ncomp, 1)); sigma[mglev].setVal(1.0e50); int lev; if ((lev = get_amr_level(mglev)) >= 0) { if ( Sigma[lev].nComp() != 1 && Sigma[lev].nComp() != ncomp) { BoxLib::Error("Sigma has wrong number of components"); } for (MFIter s_mfi(Sigma[lev]); s_mfi.isValid(); ++s_mfi) { Box copyon(s_mfi.validbox()); if (for_fill_sync_reg != 0) copyon.grow(1); if (Sigma[lev].nComp() == 1) { for (int i = 0; i < ncomp; ++i) { sigma[mglev][s_mfi].copy(Sigma[lev][s_mfi], copyon, 0, copyon, i, 1); } } else if (Sigma[lev].nComp() == ncomp) sigma[mglev][s_mfi].copy(Sigma[lev][s_mfi], copyon, 0, copyon, 0, ncomp); } } } } if (for_fill_sync_reg == 0) { for (int mglev = mglev_max; mglev > 0; mglev--) { IntVect rat = mg_domain[mglev].length() / mg_domain[mglev-1].length(); restrict_level( sigma[mglev-1], sigma[mglev], rat, holy_grail_sigma_restrictor(m_stencil), default_level_interface, 0); } for (int mglev = 0; mglev <= mglev_max; mglev++) { // FIXME, not terrain sigma? fill_borders(sigma[mglev], lev_interface[mglev], boundary.terrain_sigma(), -1, is_dense(m_stencil)); HG_TEST_NORM( sigma[mglev], "build_sigma bb"); } } else if (for_fill_sync_reg == 1) { // FIXME, not terrain sigma? boundary.terrain_sigma()-> fill_sync_reg_borders(sigma[mglev_max], lev_interface[mglev_max],-1); } } else { // // Intended functionality: sigma_split exists only at coarser levels, // since only after coarsening sigma is different in different directions. // sigma exists at all levels, and is intended for use on fine grids // and at lev_interface points, where all components are the same. To // save storage it is aliased to the first component of sigma_split // on all but the finest level. // // sigma_split replaced by sigma_nd in more recent version, used // only as a local variable here // PArray sigma_split; if (for_fill_sync_reg == 0) { sigma_split.resize(mglev_max); for (int mglev = 0; mglev < mglev_max; mglev++) { sigma_split.set(mglev, new MultiFab(mg_mesh[mglev], BL_SPACEDIM, 1)); } } sigma.resize(mglev_max + 1); sigma.set(mglev_max, new MultiFab(mg_mesh[mglev_max], 1, 1)); // // Level project: // Any value can fill values in the border cells that fill_borders // will not touch---those touching coarser grids. The values in these // cells will only be seen by the interpolation, and the quantity // being interpolated will always be zero at these edges, but we // should insure that no NaN's or other garbage is there that could // cause a floating point fault. // // Sync project: // Ghost values will be seen by multilevel interpolation, so put // a huge value in ghost cells so that coarse-fine lev_interface // interpolation will linear, as finite element derivation requires. // if (for_fill_sync_reg == 0) { for (int mglev = 0; mglev < mglev_max; mglev++) { MultiFab& target = sigma_split[mglev]; target.setVal(1.0e50); int lev; if ((lev = get_amr_level(mglev)) >= 0) { MultiFab& s_comp = Sigma[lev]; for (int i = 0; i < BL_SPACEDIM; i++) { for (MFIter s_mfi(s_comp); s_mfi.isValid(); ++s_mfi) { target[s_mfi].copy(s_comp[s_mfi], s_mfi.validbox(), 0, target.boxArray()[s_mfi.index()], i, 1); } } } } } sigma[mglev_max].setVal(1.0e50); HG_TEST_NORM(sigma[mglev_max], "build_sigma aa1"); HG_TEST_NORM(Sigma[ lev_max], "build_sigma aa10"); for (MFIter S_mfi(Sigma[lev_max]); S_mfi.isValid(); ++S_mfi) { if (for_fill_sync_reg == 0) { sigma[mglev_max][S_mfi].copy( Sigma[lev_max][S_mfi], mg_mesh[mglev_max][S_mfi.index()], 0, mg_mesh[mglev_max][S_mfi.index()], 0, 1); } else { sigma[mglev_max][S_mfi].copy( Sigma[lev_max][S_mfi], BoxLib::grow(mg_mesh[mglev_max][S_mfi.index()], 1), 0, BoxLib::grow(mg_mesh[mglev_max][S_mfi.index()], 1), 0, 1); } } HG_TEST_NORM(sigma[mglev_max], "build_sigma aa2"); if (for_fill_sync_reg == 0) { if (mglev_max > 0) { IntVect rat = mg_domain[mglev_max].length() / mg_domain[mglev_max-1].length(); restrict_level( sigma_split[mglev_max-1], sigma[mglev_max], rat, holy_grail_sigma_restrictor(m_stencil), default_level_interface, 0); } fill_borders(sigma[mglev_max], lev_interface[mglev_max], boundary.scalar(), -1, is_dense(m_stencil)); for (int mglev = mglev_max - 1; mglev > 0; mglev--) { IntVect rat = mg_domain[mglev].length() / mg_domain[mglev-1].length(); restrict_level( sigma_split[mglev-1], sigma_split[mglev], rat, holy_grail_sigma_restrictor(m_stencil), default_level_interface, 0); } for (int mglev = 0; mglev < mglev_max; mglev++) { HG_TEST_NORM(sigma_split[mglev], "build_sigma 0"); fill_borders(sigma_split[mglev], lev_interface[mglev], boundary.scalar(), -1, is_dense(m_stencil)); HG_TEST_NORM(sigma_split[mglev], "build_sigma"); } } else if (for_fill_sync_reg == 1) { boundary.scalar()->fill_sync_reg_borders(sigma[mglev_max], lev_interface[mglev_max], -1); } for (int i = 0; i < BL_SPACEDIM; i++) { sigma_nd[i].resize(mglev_max + 1); } if (for_fill_sync_reg == 0) { for (int mglev = 0; mglev < mglev_max; mglev++) { MultiFab& s = sigma_split[mglev]; for (int i = 0; i < BL_SPACEDIM; i++) { sigma_nd[i].set(mglev, new MultiFab(mg_mesh[mglev], 1, 1)); MultiFab& d = sigma_nd[i][mglev]; for (MFIter s_mfi(s); s_mfi.isValid(); ++s_mfi) { d[s_mfi].copy(s[s_mfi], i, 0); } } delete sigma_split.remove(mglev); sigma.set(mglev, &sigma_nd[0][mglev]); } } for (int i = 0; i < BL_SPACEDIM; i++) { sigma_nd[i].set(mglev_max, &sigma[mglev_max]); } if (m_stencil == cross) { sigma_node.resize(mglev_max + 1); for (int mglev = 0; mglev <= mglev_max; mglev++) { if (for_fill_sync_reg == 0 || mglev == mglev_max) { BoxArray mesh = mg_mesh[mglev]; mesh.convert(IndexType(IntVect::TheNodeVector())); sigma_node.set(mglev, new MultiFab(mesh, BL_SPACEDIM, 1)); sigma_node[mglev].setVal(1.0e50); } } for (int mglev = 0; mglev <= mglev_max; mglev++) { for ( int i = 0; i < BL_SPACEDIM; ++i ) { HG_TEST_NORM(sigma_nd[i][mglev], "build_sigma pre hgscon"); } if (for_fill_sync_reg == 0 || mglev == mglev_max) { const Real hxyz[BL_SPACEDIM] = { D_DECL(h[mglev][0], h[mglev][1], h[mglev][2]) }; for (MFIter s_mfi(sigma[mglev]); s_mfi.isValid(); ++s_mfi) { const Box& scbox = sigma[mglev][s_mfi].box(); const Box& snbox = sigma_node[mglev][s_mfi].box(); Box reg = (for_fill_sync_reg > 0) ? BoxLib::surroundingNodes(mg_mesh[mglev][s_mfi.index()]) : Box(lev_interface[mglev].part_fine(s_mfi.index())); FORT_HGSCON( sigma_node[mglev][s_mfi].dataPtr(), DIMLIST(snbox), D_DECL(sigma_nd[0][mglev][s_mfi].dataPtr(), sigma_nd[1][mglev][s_mfi].dataPtr(), sigma_nd[2][mglev][s_mfi].dataPtr()), DIMLIST(scbox), DIMLIST(reg), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2])); } if (mglev < mglev_max) { sigma_nd[0].remove(mglev); for (int i = 1; i < BL_SPACEDIM; i++) { delete sigma_nd[i].remove(mglev); } } else { for (int i = 0; i < BL_SPACEDIM; i++) { sigma_nd[i].remove(mglev); } } } HG_TEST_NORM(sigma_node[mglev], "build_sigma hgscon"); } } } cen.resize(mglev_max + 1); for (int mglev = 0; mglev <= mglev_max; mglev++) { if (for_fill_sync_reg == 0 || mglev == mglev_max) { cen.set(mglev, new MultiFab(corr[mglev].boxArray(), 1, dest[lev_min].nGrow())); MultiFab& ctmp = cen[mglev]; ctmp.setVal(0.0); if ( m_stencil == terrain || m_stencil == full) { for (MFIter c_mfi(ctmp); c_mfi.isValid(); ++c_mfi) { const Box& cenbox = ctmp[c_mfi].box(); const Box& reg = lev_interface[mglev].part_fine(c_mfi.index()); const Box& sigbox = sigma[mglev][c_mfi].box(); if ( m_stencil == terrain ) { FORT_HGCEN_TERRAIN(ctmp[c_mfi].dataPtr(), DIMLIST(cenbox), sigma[mglev][c_mfi].dataPtr(), DIMLIST(sigbox), DIMLIST(reg)); } else { FORT_HGCEN_FULL(ctmp[c_mfi].dataPtr(), DIMLIST(cenbox), sigma[mglev][c_mfi].dataPtr(), DIMLIST(sigbox), DIMLIST(reg)); } } } else { HG_TEST_NORM(sigma_node[mglev], "buildsigma"); for (MFIter c_mfi(cen[mglev]); c_mfi.isValid(); ++c_mfi) { const Box& cenbox = cen[mglev][c_mfi].box(); const Box& reg = lev_interface[mglev].part_fine(c_mfi.index()); const Box& sigbox = sigma_node[mglev][c_mfi].box(); const int isRZ = getCoordSys(); FORT_HGCEN(cen[mglev][c_mfi].dataPtr(), DIMLIST(cenbox), sigma_node[mglev][c_mfi].dataPtr(), DIMLIST(sigbox), DIMLIST(reg), &isRZ); } } HG_TEST_NORM(ctmp, "buildsigma"); clear_part_interface(ctmp, lev_interface[mglev]); } } if (m_stencil == cross) { mask.resize(mglev_max + 1); if (for_fill_sync_reg == 0) { for (int mglev = 0; mglev <= mglev_max; mglev++) { mask.set(mglev, new MultiFab(corr[mglev].boxArray(), 1, dest[lev_min].nGrow())); mask[mglev].setVal(0.0); for (MFIter m_mfi(mask[mglev]); m_mfi.isValid(); ++m_mfi) { mask[mglev][m_mfi].setVal(1.0,lev_interface[mglev].part_fine(m_mfi.index()), 0); } HG_TEST_NORM(mask[mglev], "buildsigma 2"); clear_part_interface(mask[mglev], lev_interface[mglev]); } } else { mask.set(mglev_max, new MultiFab(corr[mglev_max].boxArray(), 1, dest[lev_min].nGrow())); mask[mglev_max].setVal(0.0); for (MFIter m_mfi(mask[mglev_max]); m_mfi.isValid(); ++m_mfi) { Box subbox(m_mfi.validbox()); mask[mglev_max][m_mfi].setVal(1.0, subbox, 0); } } } } void holy_grail_amr_multigrid::clear_hg_multi () { line_order.clear(); line_after.clear(); delete_sync_caches(); delete cgwork.remove(0); delete cgwork.remove(1); delete cgwork.remove(2); cgwork.remove(3); cgwork.remove(4); cgwork.remove(5); delete cgwork.remove(6); delete cgwork.remove(7); if (m_stencil == terrain || m_stencil == full ) { for (int mglev = 0; mglev <= mglev_max; mglev++) { delete sigma.remove(mglev); } } else { for (int mglev = 0; mglev <= mglev_max; mglev++) { delete sigma.remove(mglev); if (sigma_node.size() && sigma_node.defined(mglev)) { delete sigma_node.remove(mglev); } } } for (int mglev = 0; mglev <= mglev_max; mglev++) { delete cen.remove(mglev); if (mask.size() && mask.defined(mglev)) { delete mask.remove(mglev); } } delete [] h; if (source_owned) { for (int lev = lev_min; lev <= lev_max; lev++) { if (source.defined(lev)) { delete source.remove(lev); } } } amr_multigrid::clear_amr_multi(); } void holy_grail_amr_multigrid::sync_resid_clear () { line_order.clear(); line_after.clear(); delete sigma.remove(mglev_max); delete cen.remove(mglev_max); if (m_stencil == cross ) { delete sigma_node.remove(mglev_max); delete mask.remove(mglev_max); } delete [] h; if ( source_owned ) { for (int lev = lev_min; lev <= lev_max; lev++) { if (source.defined(lev)) { delete source.remove(lev); } } } amr_multigrid::clear_amr_multi(); } bool holy_grail_amr_multigrid::can_coarsen (const BoxArray& mesh, const Box& domain) const { int retval = 1; for (int i = 0; i < BL_SPACEDIM; i++) { retval &= ((domain.smallEnd(i)&1) == 0); retval &= ((domain.bigEnd(i)&1) == 1); retval &= (domain.length(i) >= 4); for (int igrid = 0; igrid < mesh.size(); igrid++) { retval &= ( (mesh[igrid].smallEnd(i)&1) == 0 && (mesh[igrid].bigEnd(i)&1) == 1 && (mesh[igrid].length(i) >= 4) ); } } return retval != 0; } void holy_grail_amr_multigrid::sync_interfaces () { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::sync_interfaces()"); for (int lev = lev_min+1; lev <= lev_max; lev++) { int mglev = ml_index[lev]; int mgc = ml_index[lev-1]; IntVect rat = mg_domain[mglev].length() / mg_domain[mgc].length(); MultiFab& target = dest[lev]; task_list tl; for (int iface = 0; iface < lev_interface[mglev].nboxes(level_interface::FACEDIM); iface++) { // // Find a fine grid touching this face. // int igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 0); if (igrid < 0) igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 1); const unsigned int geo = lev_interface[mglev].geo(level_interface::FACEDIM, iface); // // Reject fine-fine interfaces and those without an interior fine grid // const Box& nbox = lev_interface[mglev].node_box(level_interface::FACEDIM, iface); if ( geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(level_interface::FACEDIM, iface) ) continue; tl.add_task( new task_interpolate_patch(tl, target, igrid, nbox, dest[lev-1], rat, new bilinear_interpolator(), lev_interface[mgc])); } tl.execute("holy_grail_amr_multigrid::sync_interfaces"); } } void holy_grail_amr_multigrid::sync_periodic_interfaces () { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::sync_periodic_interfaces()"); for (int lev = lev_min+1; lev <= lev_max; lev++) { int mglev = ml_index[lev]; int mgc = ml_index[lev-1]; IntVect rat = mg_domain[mglev].length() / mg_domain[mgc].length(); Box idomain = mg_domain[mglev]; idomain.convert(type(dest[lev])).grow(-1); MultiFab& target = dest[lev]; task_list tl; for (int iface = 0; iface < lev_interface[mglev].nboxes(level_interface::FACEDIM); iface++) { // // Find a fine grid touching this face. // int igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 0); if (igrid < 0) igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 1); const unsigned int geo = lev_interface[mglev].geo(level_interface::FACEDIM, iface); // // Use only exterior coarse-fine faces with an interior fine grid. // const Box& nbox = lev_interface[mglev].node_box(level_interface::FACEDIM, iface); if ( geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(level_interface::FACEDIM, iface) ) continue; if (idomain.intersects(nbox)) continue; tl.add_task( new task_interpolate_patch(tl, target, igrid, nbox, dest[lev-1], rat, new bilinear_interpolator(), lev_interface[mgc])); } tl.execute("holy_grail_amr_multigrid::sync_periodic_interfaces"); } } void holy_grail_amr_multigrid::mg_restrict_level (int lto, int lfrom) { IntVect rat = mg_domain[lfrom].length() / mg_domain[lto].length(); HG_TEST_NORM( resid[lto], "mg_restrict_level: resid in" ); HG_TEST_NORM( work[lfrom], "mg_restrict_level: work in" ); if (get_amr_level(lto) >= 0) { restrict_level( resid[lto], work[lfrom], rat, bilinear_restrictor((integrate==0)?0:1, is_dense(m_stencil)), lev_interface[lfrom], mg_boundary); } else { mg_restrict(lto, lfrom); } HG_TEST_NORM( resid[lto], "mg_restrict_level: resid out" ); HG_TEST_NORM( work[lfrom], "mg_restrict_level: work out" ); } void holy_grail_amr_multigrid::mg_restrict (int lto, int lfrom) { HG_TEST_NORM( work[lfrom], "mg_restrict 1"); HG_TEST_NORM( resid[lto], "mg_restrict 11"); fill_borders(work[lfrom], lev_interface[lfrom], mg_boundary, -1, is_dense(m_stencil)); const IntVect rat = mg_domain[lfrom].length() / mg_domain[lto].length(); for (MFIter w_mfi(work[lfrom]); w_mfi.isValid(); ++w_mfi) { const Box& fbox = work[lfrom][w_mfi].box(); const Box& cbox = resid[lto][w_mfi].box(); const Box& creg = lev_interface[lto].part_fine(w_mfi.index()); FORT_FANRST2(resid[lto][w_mfi].dataPtr(), DIMLIST(cbox), DIMLIST(creg), work[lfrom][w_mfi].dataPtr(), DIMLIST(fbox), D_DECL(rat[0], rat[1], rat[2]), 1, &integrate, 0, 0); } clear_part_interface(resid[lto], lev_interface[lto]); HG_TEST_NORM( resid[lto], "mg_restrict 21"); } void holy_grail_interpolator_dense::fill (FArrayBox& patch, const Box& region, const FArrayBox& cgr, const Box& cb, const IntVect& rat) const { FORT_HGINTS_DENSE( patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), D_DECL(sigptr[0], sigptr[1], sigptr[2]), DIMLIST(sigbox), cgr.dataPtr(), DIMLIST(cgr.box()), DIMLIST(cb), D_DECL(rat[0], rat[1], rat[2])); } void holy_grail_interpolator::fill (FArrayBox& patch, const Box& region, const FArrayBox& cgr, const Box& cb, const IntVect& rat) const { FORT_HGINTS( patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), sigptr, DIMLIST(sigbox), cgr.dataPtr(), DIMLIST(cgr.box()), DIMLIST(cb), D_DECL(rat[0], rat[1], rat[2])); } void holy_grail_amr_multigrid::mg_interpolate_level (int lto, int lfrom) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::mg_interpolate_level()"); if (get_amr_level(lfrom) >= 0) { // // general version---attempt to use special stencils for multilevel. // const int ltmp = lfrom + 1; MultiFab& target = work[ltmp]; const IntVect rat = mg_domain[ltmp].length() / mg_domain[lfrom].length(); HG_TEST_NORM( corr[lfrom], "mg_interpolate_level"); task_list tl; for (int igrid = 0; igrid < target.size(); igrid++) { amr_interpolator* hgi; if ( is_dense(m_stencil) ) { Real* sigptr[BL_SPACEDIM] = { D_DECL(0, 0, 0) }; if ( is_local(sigma[ltmp], igrid) ) { for (int i = 0; i < BL_SPACEDIM; i++) { sigptr[i] = sigma[ltmp][igrid].dataPtr(i); } } const Box sigbox = BoxLib::grow(sigma[ltmp].box(igrid), sigma[ltmp].nGrow()); BL_ASSERT( is_remote(sigma[ltmp], igrid) || sigbox == sigma[ltmp][igrid].box()); hgi = new holy_grail_interpolator_dense(sigptr, sigbox); } else { Real* sigptr = 0; if ( is_local(sigma_node[ltmp], igrid ) ) { sigptr = sigma_node[ltmp][igrid].dataPtr(); } const Box sigbox = BoxLib::grow(sigma_node[ltmp].box(igrid), sigma_node[ltmp].nGrow()); BL_ASSERT( is_remote(sigma_node[ltmp], igrid) || sigbox == sigma_node[ltmp][igrid].box()); // const Box& sigbox = sigma_node[ltmp][igrid].box(); hgi = new holy_grail_interpolator(sigptr, sigbox); } tl.add_task( new task_interpolate_patch(tl, target, igrid, target.box(igrid), corr[lfrom], rat, hgi, lev_interface[lfrom])); } tl.execute("holy_grail_amr_multigrid::mg_interpolate_level"); HG_TEST_NORM( target, "mg_interpolate_level a"); if (lto > ltmp) { corr[ltmp].copy(target); mg_interpolate_level(lto, ltmp); } } else { // // Multigrid interpolation, grids known to match up // special stencil needed for multigrid convergence. // const IntVect rat = mg_domain[lto].length() / mg_domain[lfrom].length(); for (MFIter w_mfi(work[lto]); w_mfi.isValid(); ++w_mfi) { const Box& fbox = work[lto][w_mfi].box(); const Box& freg = w_mfi.validbox(); const Box& cbox = corr[lfrom][w_mfi].box(); const Box& creg = corr[lfrom].boxArray()[w_mfi.index()]; if ( m_stencil == terrain || m_stencil == full ) { const Box& sigbox = sigma[lto][w_mfi].box(); FORT_HGINTS_DENSE( work[lto][w_mfi].dataPtr(), DIMLIST(fbox), DIMLIST(freg), D_DECL(sigma[lto][w_mfi].dataPtr(0), sigma[lto][w_mfi].dataPtr(1), sigma[lto][w_mfi].dataPtr(2)), DIMLIST(sigbox), corr[lfrom][w_mfi].dataPtr(), DIMLIST(cbox), DIMLIST(creg), D_DECL(rat[0], rat[1], rat[2])); } else { const Box& sigbox = sigma_node[lto][w_mfi].box(); FORT_HGINTS( work[lto][w_mfi].dataPtr(), DIMLIST(fbox), DIMLIST(freg), sigma_node[lto][w_mfi].dataPtr(), DIMLIST(sigbox), corr[lfrom][w_mfi].dataPtr(), DIMLIST(cbox), DIMLIST(creg), D_DECL(rat[0], rat[1], rat[2])); } } HG_TEST_NORM( work[lto], "mg_interpolate_level"); } } ccseapps-2.5/CCSEApps/hgproj/interpolator.cpp0000644000175000017500000000703511634153073022403 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "interpolator.H" #if defined( BL_FORT_USE_UNDERSCORE ) #define FORT_FACINT2 acint2_ #define FORT_FANINT2 anint2_ #elif defined( BL_FORT_USE_UPPERCASE ) #define FORT_FACINT2 ACINT2 #define FORT_FANINT2 ANINT2 #elif defined( BL_FORT_USE_LOWERCASE ) #define FORT_FACINT2 acint2 #define FORT_FANINT2 anint2 #else #error "none of BL_FORT_USE_{UNDERSCORE,UPPERCASE,LOWERCASE} defined" #endif extern "C" { void FORT_FACINT2(Real*, intS, intS, const Real*, intS, intS, intRS, const int&); void FORT_FANINT2(Real*, intS, intS, const Real*, intS, intS, intRS, const int&); } amr_interpolator::~amr_interpolator () {} Box bilinear_interpolator::box (const Box& region, const IntVect& rat) const { if (region.cellCentered()) { return BoxLib::grow(BoxLib::coarsen(region, rat), 1); } else if (region.type() == IntVect::TheNodeVector()) { return BoxLib::coarsen(region, rat); } else { BoxLib::Abort( "bilinear_interpolator::box():" "Interpolation only defined for pure CELL- or NODE-based data" ); /*NOTREACHED*/ return Box(); } } void bilinear_interpolator::fill (FArrayBox& patch, const Box& region, const FArrayBox& cgr, const Box& cb, const IntVect& rat) const { if (patch.box().cellCentered()) { FORT_FACINT2( patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), cgr.dataPtr(), DIMLIST(cgr.box()), DIMLIST(cb), D_DECL(rat[0], rat[1], rat[2]), patch.nComp()); } else if (patch.box().type() == IntVect::TheNodeVector()) { Box eregion = BoxLib::refine(cb, rat); if (eregion == region) { FORT_FANINT2( patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), cgr.dataPtr(), DIMLIST(cgr.box()), DIMLIST(cb), D_DECL(rat[0], rat[1], rat[2]), patch.nComp()); } else { FArrayBox epatch(eregion, patch.nComp()); FORT_FANINT2( epatch.dataPtr(), DIMLIST(epatch.box()), DIMLIST(eregion), cgr.dataPtr(), DIMLIST(cgr.box()), DIMLIST(cb), D_DECL(rat[0], rat[1], rat[2]), patch.nComp()); patch.copy(epatch, region); } } else { BoxLib::Abort( "bilinear_interpolator::fill():" "Interpolation only defined for pure CELL- or NODE-based data" ); } } ccseapps-2.5/CCSEApps/hgproj/hg_multi2d.f0000644000175000017500000031114211634153073021357 0ustar amckinstryamckinstryc variable density versions: c Note---assumes fdst linearly interpolated from cdst along edge subroutine hgfres( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & fdst, fdstl0, fdsth0, fdstl1, fdsth1, & cdst, cdstl0, cdsth0, cdstl1, cdsth1, & sigmaf, sfl0, sfh0, sfl1, sfh1, & sigmac, scl0, sch0, scl1, sch1, & regl0, regh0, regl1, regh1, & hx, hy, ir, jr, idim, idir, irz) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer fdstl0, fdsth0, fdstl1, fdsth1 integer cdstl0, cdsth0, cdstl1, cdsth1 integer sfl0, sfh0, sfl1, sfh1 integer scl0, sch0, scl1, sch1 integer regl0, regh0, regl1, regh1 double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1) double precision sigmaf(sfl0:sfh0,sfl1:sfh1) double precision sigmac(scl0:sch0,scl1:sch1) double precision hx, hy integer irz integer ir, jr, idim, idir double precision hxm2, hym2, fac0, fac1, tmp integer i, is, j, js, m, n if (irz .eq. 1 .and. regl0 .le. 0 .and. regh0 .ge. 0) then print *,'I DONT THINK WE SHOULD BE IN HGFRES AT I=0 ' stop endif if (idim .eq. 0) then i = regl0 if (idir .eq. 1) then is = i - 1 else is = i end if fac0 = ir / (ir + 1.d0) hxm2 = 1.d0 / (ir * ir * hx * hx) hym2 = 1.d0 / (jr * jr * hy * hy) do j = regl1, regh1 res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * & (hxm2 * & ((sigmac(is,j-1) + sigmac(is,j)) * & (cdst(i-idir,j) - cdst(i,j))) + & hym2 * & (sigmac(is,j-1) * & (cdst(i,j-1) - cdst(i,j)) + & sigmac(is,j) * & (cdst(i,j+1) - cdst(i,j)))) end do fac0 = fac0 / (ir * jr * jr) hxm2 = ir * ir * hxm2 hym2 = jr * jr * hym2 i = i * ir if (idir .eq. 1) then is = i else is = i - 1 end if do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5d0 * fac1 do j = jr*regl1, jr*regh1, jr tmp = hxm2 * & ((sigmaf(is,j-n-1) + sigmaf(is,j-n)) * & (fdst(i+idir,j-n) - fdst(i,j-n)) + & (sigmaf(is,j+n-1) + sigmaf(is,j+n)) * & (fdst(i+idir,j+n) - fdst(i,j+n))) res(i,j) = res(i,j) - fac1 * (tmp + hym2 * & (sigmaf(is,j-n-1) * & (fdst(i,j-n-1) - fdst(i,j-n)) + & sigmaf(is,j-n) * & (fdst(i,j-n+1) - fdst(i,j-n)) + & sigmaf(is,j+n-1) * & (fdst(i,j+n-1) - fdst(i,j+n)) + & sigmaf(is,j+n) * & (fdst(i,j+n+1) - fdst(i,j+n)))) end do end do else j = regl1 if (idir .eq. 1) then js = j - 1 else js = j end if fac0 = jr / (jr + 1.d0) hxm2 = 1.d0 / (ir * ir * hx * hx) hym2 = 1.d0 / (jr * jr * hy * hy) do i = regl0, regh0 res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * & (hxm2 * & (sigmac(i-1,js) * & (cdst(i-1,j) - cdst(i,j)) + & sigmac(i,js) * & (cdst(i+1,j) - cdst(i,j))) + & hym2 * & ((sigmac(i-1,js) + sigmac(i,js)) * & (cdst(i,j-idir) - cdst(i,j)))) end do c This correction is *only* for the cross stencil if (irz .eq. 1 .and. regl0 .le. 0 .and. regh0 .ge. 0) then i = 0 res(i*ir,j*jr) = res(i*ir,j*jr) + fac0 * & hym2 * 0.5d0 * & ((sigmac(i-1,js) + sigmac(i,js)) * & (cdst(i,j-idir) - cdst(i,j))) endif fac0 = fac0 / (ir * ir * jr) hxm2 = ir * ir * hxm2 hym2 = jr * jr * hym2 j = j * jr if (idir .eq. 1) then js = j else js = j - 1 end if do m = 0, ir-1 fac1 = (ir-m) * fac0 if (m .eq. 0) fac1 = 0.5d0 * fac1 do i = ir*regl0, ir*regh0, ir tmp = hxm2 * & (sigmaf(i-m-1,js) * & (fdst(i-m-1,j) - fdst(i-m,j)) + & sigmaf(i-m,js) * & (fdst(i-m+1,j) - fdst(i-m,j)) + & sigmaf(i+m-1,js) * & (fdst(i+m-1,j) - fdst(i+m,j)) + & sigmaf(i+m,js) * & (fdst(i+m+1,j) - fdst(i+m,j))) res(i,j) = res(i,j) - fac1 * (tmp + hym2 * & ((sigmaf(i-m-1,js) + sigmaf(i-m,js)) * & (fdst(i-m,j+idir) - fdst(i-m,j)) + & (sigmaf(i+m-1,js) + sigmaf(i+m,js)) * & (fdst(i+m,j+idir) - fdst(i+m,j)))) end do if (irz .eq. 1 .and. m .eq. 0 .and. & regl0 .le. 0 .and. regh0 .ge. 0) then i = 0 res(i,j) = res(i,j) + fac1 * hym2 * 0.5d0 * & ((sigmaf(i-m-1,js) + sigmaf(i-m,js)) * & (fdst(i-m,j+idir) - fdst(i-m,j)) + & (sigmaf(i+m-1,js) + sigmaf(i+m,js)) * & (fdst(i+m,j+idir) - fdst(i+m,j))) endif end do end if end c Note---assumes fdst linearly interpolated from cdst along edges subroutine hgcres( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & fdst, fdstl0, fdsth0, fdstl1, fdsth1, & cdst, cdstl0, cdsth0, cdstl1, cdsth1, & sigmaf, sfl0, sfh0, sfl1, sfh1, & sigmac, scl0, sch0, scl1, sch1, & regl0, regh0, regl1, regh1, & hx, hy, ir, jr, ga, irz) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer fdstl0, fdsth0, fdstl1, fdsth1 integer cdstl0, cdsth0, cdstl1, cdsth1 integer sfl0, sfh0, sfl1, sfh1 integer scl0, sch0, scl1, sch1 integer regl0, regh0, regl1, regh1 double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1) double precision sigmaf(sfl0:sfh0,sfl1:sfh1) double precision sigmac(scl0:sch0,scl1:sch1) double precision hx, hy integer ir, jr, ga(0:1,0:1), irz double precision hxm2, hym2, hxm2c, hym2c, sum, center, & ffac, cfac, fac, fac1 integer ic, jc, if, jf, ii, ji, idir, jdir, m, n hxm2c = 1.d0 / (ir * ir * hx * hx) hym2c = 1.d0 / (jr * jr * hy * hy) hxm2 = ir * ir * hxm2c hym2 = jr * jr * hym2c ic = regl0 jc = regl1 if = ic * ir jf = jc * jr sum = 0.d0 center = 0.d0 c quadrants ffac = 0.5d0 cfac = 0.5d0 * ir * jr do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) .eq. 1) then center = center + ffac sum = sum + sigmaf(if+ii-1,jf+ji-1) * & (hxm2 * (fdst(if+idir,jf) - fdst(if,jf)) + & hym2 * (fdst(if,jf+jdir) - fdst(if,jf))) if (irz .eq. 1 .and. ic .eq. 0) then sum = sum - sigmaf(if+ii-1,jf+ji-1) * 0.5d0 * & (hym2 * (fdst(if,jf+jdir) - fdst(if,jf))) endif else center = center + cfac sum = sum + ir * jr * sigmac(ic+ii-1,jc+ji-1) * & (hxm2c * (cdst(ic+idir,jc) - cdst(ic,jc)) + & hym2c * (cdst(ic,jc+jdir) - cdst(ic,jc))) if (irz .eq. 1 .and. ic .eq. 0) then sum = sum - ir * jr * sigmac(ic+ii-1,jc+ji-1) * 0.5d0 * & (hym2c * (cdst(ic,jc+jdir) - cdst(ic,jc))) endif end if end do end do c edges do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) - ga(ii,1-ji) .eq. 1) then fac1 = 1.d0 / ir ffac = 0.5d0 * (ir-1) center = center + ffac do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * & (hxm2 * (sigmaf(if+m-1,jf+ji-1) * & (fdst(if+m-1,jf) - fdst(if+m,jf)) + & sigmaf(if+m,jf+ji-1) * & (fdst(if+m+1,jf) - fdst(if+m,jf))) + & hym2 * & (sigmaf(if+m-1,jf+ji-1) + sigmaf(if+m,jf+ji-1)) * & (fdst(if+m,jf+jdir) - fdst(if+m,jf))) end do end if if (ga(ii,ji) - ga(1-ii,ji) .eq. 1) then fac1 = 1.d0 / jr ffac = 0.5d0 * (jr-1) center = center + ffac do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * & (hxm2 * & (sigmaf(if+ii-1,jf+n-1) + sigmaf(if+ii-1,jf+n)) * & (fdst(if+idir,jf+n) - fdst(if,jf+n)) + & hym2 * (sigmaf(if+ii-1,jf+n-1) * & (fdst(if,jf+n-1) - fdst(if,jf+n)) + & sigmaf(if+ii-1,jf+n) * & (fdst(if,jf+n+1) - fdst(if,jf+n)))) end do end if end do end do c weighting res(if,jf) = src(if,jf) - sum / center end c----------------------------------------------------------------------- subroutine hgcen( & cen, cenl0,cenh0,cenl1,cenh1, & signd, snl0,snh0,snl1,snh1, & regl0,regh0,regl1,regh1,irz) integer cenl0,cenh0,cenl1,cenh1 integer snl0,snh0,snl1,snh1 integer regl0,regh0,regl1,regh1 double precision cen(cenl0:cenh0,cenl1:cenh1) double precision signd(snl0:snh0,snl1:snh1, 2) double precision tmp integer irz integer i, j, k do j = regl1, regh1 do i = regl0, regh0 tmp = (signd(i-1,j,1) + signd(i,j,1) & + signd(i,j-1,2) + signd(i,j,2)) if ( tmp .eq. 0.0D0 ) then cen(i,j) = 0.0D0 else cen(i,j) = 1.0D0 / tmp end if end do if (irz .eq. 1 .and. regl0 .eq. 0) then i = 0 tmp = (signd(i-1,j,1) + signd(i,j,1) & + 0.5d0*(signd(i,j-1,2) + signd(i,j,2))) if ( tmp .eq. 0.0D0 ) then cen(i,j) = 0.0D0 else cen(i,j) = 1.0D0 / tmp end if end if end do end c five-point variable stencils c----------------------------------------------------------------------- subroutine hgrlxaaaa( & cor, corl0, corh0, corl1, corh1, & res, resl0, resh0, resl1, resh1, & sigx, sigy, & sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1, & hx, hy, irz, imax) integer corl0, corh0, corl1, corh1 integer resl0, resh0, resl1, resh1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 double precision cor(corl0:corh0,corl1:corh1) double precision res(resl0:resh0,resl1:resh1) double precision sigx(sfl0:sfh0,sfl1:sfh1) double precision sigy(sfl0:sfh0,sfl1:sfh1) double precision cen(cenl0:cenh0,cenl1:cenh1) double precision hx, hy integer irz, imax double precision hxm2, hym2 integer i, j, ipass, ipar double precision AVG AVG() = 0.5d0 * (hxm2 * & ((sigx(i-1,j-1) + sigx(i-1,j)) * cor(i-1,j) + & (sigx(i,j-1) + sigx(i,j)) * cor(i+1,j)) + & hym2 * & ((sigy(i-1,j-1) + sigy(i,j-1)) * cor(i,j-1) + & (sigy(i-1,j) + sigy(i,j)) * cor(i,j+1))) hxm2 = 1.d0 / (hx*hx) hym2 = 1.d0 / (hy*hy) if (regh1 - regl1 .gt. regh0 - regl0) then do ipass = 1, 0, -1 ipar = ipass do i = regl0, regh0 ipar = 1 - ipar cdir$ ivdep do j = regl1 + ipar, regh1, 2 cor(i,j) = (AVG() - res(i,j)) * cen(i,j) if (irz .eq. 1 .and. i .eq. 0) then cor(i,j) = ( & 0.5d0 * hxm2 * & ((sigx(i-1,j-1) + sigx(i-1,j)) * cor(i-1,j) + & (sigx(i ,j-1) + sigx(i ,j)) * cor(i+1,j)) + & 0.25d0 * hym2 * & ((sigy(i-1,j-1) + sigy(i,j-1)) * cor(i,j-1) + & (sigy(i-1,j ) + sigy(i,j )) * cor(i,j+1)) & - res(i,j)) * cen(i,j) endif end do end do end do else do ipass = 1, 0, -1 ipar = ipass do j = regl1, regh1 ipar = 1 - ipar cdir$ ivdep do i = regl0 + ipar, regh0, 2 cor(i,j) = (AVG() - res(i,j)) * cen(i,j) if (irz .eq. 1 .and. i .eq. 0) then cor(i,j) = ( & 0.5d0 * hxm2 * & ((sigx(i-1,j-1) + sigx(i-1,j)) * cor(i-1,j) + & (sigx(i,j-1) + sigx(i,j)) * cor(i+1,j)) + & 0.25d0 * hym2 * & ((sigy(i-1,j-1) + sigy(i,j-1)) * cor(i,j-1) + & (sigy(i-1,j ) + sigy(i,j )) * cor(i,j+1)) & - res(i,j)) * cen(i,j) endif end do end do end do end if end c----------------------------------------------------------------------- subroutine hgresaaaa( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & dest, destl0, desth0, destl1, desth1, & sigx, sigy, sfl0, sfh0, sfl1, sfh1, & regl0, regh0, regl1, regh1, & hx, hy, irz) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer destl0, desth0, destl1, desth1 integer sfl0, sfh0, sfl1, sfh1 integer regl0, regh0, regl1, regh1 double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision dest(destl0:desth0,destl1:desth1) double precision sigx(sfl0:sfh0,sfl1:sfh1) double precision sigy(sfl0:sfh0,sfl1:sfh1) double precision hx, hy integer irz double precision hxm2, hym2 integer i, j hxm2 = 1.d0 / (hx*hx) hym2 = 1.d0 / (hy*hy) do j = regl1, regh1 do i = regl0, regh0 res(i,j) = src(i,j) - 0.5d0 * (hxm2 * & ((sigx(i-1,j-1) + sigx(i-1,j)) * & (dest(i-1,j) - dest(i,j)) + & (sigx(i,j-1) + sigx(i,j)) * & (dest(i+1,j) - dest(i,j))) + & hym2 * & ((sigy(i-1,j-1) + sigy(i,j-1)) * & (dest(i,j-1) - dest(i,j)) + & (sigy(i-1,j) + sigy(i,j)) * & (dest(i,j+1) - dest(i,j)))) end do end do if (irz .eq. 1 .and. regl0 .le. 0 .and. regh0 .ge. 0) then i = 0 do j = regl1, regh1 res(i,j) = res(i,j) + .25d0 * hym2 * & ((sigy(i-1,j-1) + sigy(i,j-1)) * & (dest(i,j-1) - dest(i,j)) + & (sigy(i-1,j) + sigy(i,j)) * & (dest(i,j+1) - dest(i,j))) end do endif end c----------------------------------------------------------------------- subroutine hgrlxl( & cor, corl0, corh0, corl1, corh1, & res, resl0, resh0, resl1, resh1, & sigx, sigy, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1, & doml0, domh0, doml1, domh1, & hx, hy, irz, imax, lsd) integer corl0, corh0, corl1, corh1 integer resl0, resh0, resl1, resh1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 integer doml0, domh0, doml1, domh1 double precision cor(corl0:corh0,corl1:corh1) double precision res(resl0:resh0,resl1:resh1) double precision sigx(sfl0:sfh0,sfl1:sfh1) double precision sigy(sfl0:sfh0,sfl1:sfh1) double precision cen(cenl0:cenh0,cenl1:cenh1) double precision hx, hy double precision wrk(256) integer irz, imax, lsd double precision hxm2, hym2, betm, aj double precision RHSL0 double precision RHSL1 integer i, j, jw, ipass c RHSL0()=(res(i,j) - 0.5d0 * hym2 * c & ((sigy(i-1,j-1) + sigy(i,j-1)) * cor(i,j-1) + c & (sigy(i-1,j) + sigy(i,j)) * cor(i,j+1))) RHSL1()=(res(i,j) - 0.5d0 * hxm2 * & ((sigx(i-1,j-1) + sigx(i-1,j)) * cor(i-1,j) + & (sigx(i,j-1) + sigx(i,j)) * cor(i+1,j))) hxm2 = 1.d0 / (hx*hx) hym2 = 1.d0 / (hy*hy) if (lsd .eq. 1) then do ipass = 0, 1 do i = regl0 + ipass, regh0, 2 j = regl1 betm = -cen(i,j) if (betm .eq. 0.d0) then c dirichlet bdy: cor(i,j) = 0.d0 aj = 0.d0 wrk(1) = 0.d0 else if (regl1 .eq. doml1) then c neumann bdy: cor(i,j) = RHSL1()* betm aj = 0.5d0 * hym2 * (sigy(i-1,j) + sigy(i,j)) if (irz .eq. 1 .and. i .eq. 0) aj = 0.5d0 * aj wrk(1) = 2.d0 * aj * betm else c interface to grid at same level: aj = 0.5d0 * hym2 * (sigy(i-1,j-1) + sigy(i,j-1)) if (irz .eq. 1 .and. i .eq. 0) aj = 0.5d0 * aj cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = 0.5d0 * hym2 * (sigy(i-1,j) + sigy(i,j)) if (irz .eq. 1 .and. i .eq. 0) aj = 0.5d0 * aj wrk(1) = aj * betm end if c forward solve loop: do j = regl1 + 1, regh1 - 1 jw = j - regl1 if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(jw)) end if cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = 0.5d0 * hym2 * (sigy(i-1,j) + sigy(i,j)) if (irz .eq. 1 .and. i .eq. 0) aj = 0.5d0 * aj wrk(jw + 1) = aj * betm end do j = regh1 jw = j - regl1 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: cor(i,j) = 0.d0 else if (regh1 .eq. domh1) then c neumann bdy: aj = 2.d0 * aj betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(jw)) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm else if (jw .gt. 0) then c interface to grid at same level: betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(jw)) cor(i,j) = RHSL1() - aj * cor(i,j-1) aj = 0.5d0 * hym2 * (sigy(i-1,j) + sigy(i,j)) if (irz .eq. 1 .and. i .eq. 0) aj = 0.5d0 * aj cor(i,j) = (cor(i,j) - aj * cor(i,j+1)) * betm end if c back substitution loop: do j = regh1 - 1, regl1, -1 jw = j - regl1 cor(i,j) = cor(i,j) - wrk(jw + 1) * cor(i,j+1) end do end do end do else STOP "Line solve implemented in Dimension 1" end if end c----------------------------------------------------------------------- subroutine hgrlnf( & cor, corl0, corh0, corl1, corh1, & res, resl0, resh0, resl1, resh1, & wrk, wrkl0, wrkh0, wrkl1, wrkh1, & sigx, sigy, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1, & doml0, domh0, doml1, domh1, & hx, hy, irz, imax, lsd, ipass) integer corl0, corh0, corl1, corh1 integer resl0, resh0, resl1, resh1 integer wrkl0, wrkh0, wrkl1, wrkh1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 integer doml0, domh0, doml1, domh1 double precision cor(corl0:corh0,corl1:corh1) double precision res(resl0:resh0,resl1:resh1) double precision wrk(wrkl0:wrkh0,wrkl1:wrkh1) double precision sigx(sfl0:sfh0,sfl1:sfh1) double precision sigy(sfl0:sfh0,sfl1:sfh1) double precision cen(cenl0:cenh0,cenl1:cenh1) double precision hx, hy integer irz, imax, lsd, ipass double precision hxm2, hym2, betm, aj double precision RHSL0, RHSL1 integer i, j, ioff RHSL0()=(res(i,j) - 0.5d0 * hym2 * & ((sigy(i-1,j-1) + sigy(i,j-1)) * cor(i,j-1) + & (sigy(i-1,j) + sigy(i,j)) * cor(i,j+1))) RHSL1()=(res(i,j) - 0.5d0 * hxm2 * & ((sigx(i-1,j-1) + sigx(i-1,j)) * cor(i-1,j) + & (sigx(i,j-1) + sigx(i,j)) * cor(i+1,j))) hxm2 = 1.d0 / (hx*hx) hym2 = 1.d0 / (hy*hy) if (lsd .eq. 0) then if (mod(regl1,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if i = regl0 do j = regl1 + ioff, regh1, 2 aj = 0.5d0 * hxm2 * (sigx(i,j-1) + sigx(i,j)) if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: wrk(i,j) = 0.d0 else if (regl0 .eq. doml0) then c neumann bdy: betm = -cen(i,j) cor(i,j) = RHSL0() * betm wrk(i,j) = 2.d0 * aj * betm end if wrk(i+1,j) = aj end do c forward solve loop: do i = regl0 + 1, regh0 - 1 do j = regl1 + ioff, regh1, 2 aj = wrk(i,j) if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) end if cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm aj = 0.5d0 * hxm2 * (sigx(i,j-1) + sigx(i,j)) wrk(i+1,j) = aj wrk(i,j) = aj * betm end do end do i = regh0 do j = regl1 + ioff, regh1, 2 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: else if (regh0 .eq. domh0) then c neumann bdy: aj = 2.d0 * wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm else if (i .gt. regl0) then c interface to grid at same level: aj = wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm aj = 0.5d0 * hxm2 * (sigx(i,j-1) + sigx(i,j)) wrk(i,j) = aj * betm end if end do else if (mod(regl0,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if j = regl1 do i = regl0 + ioff, regh0, 2 aj = 0.5d0 * hym2 * (sigy(i-1,j) + sigy(i,j)) if (irz .eq. 1 .and. i .eq. 0) aj = 0.5d0 * aj if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: wrk(i,j) = 0.d0 else if (regl1 .eq. doml1) then c neumann bdy: betm = -cen(i,j) cor(i,j) = RHSL1() * betm wrk(i,j) = 2.d0 * aj * betm end if wrk(i,j+1) = aj end do c forward solve loop: do j = regl1 + 1, regh1 - 1 do i = regl0 + ioff, regh0, 2 aj = wrk(i,j) if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) end if cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = 0.5d0 * hym2 * (sigy(i-1,j) + sigy(i,j)) if (irz .eq. 1 .and. i .eq. 0) aj = 0.5d0 * aj wrk(i,j+1) = aj wrk(i,j) = aj * betm end do end do j = regh1 do i = regl0 + ioff, regh0, 2 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: else if (regh1 .eq. domh1) then c neumann bdy: aj = 2.d0 * wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm else if (j .gt. regl1) then c interface to grid at same level: aj = wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = 0.5d0 * hym2 * (sigy(i-1,j) + sigy(i,j)) if (irz .eq. 1 .and. i .eq. 0) aj = 0.5d0 * aj wrk(i,j) = aj * betm end if end do end if end c----------------------------------------------------------------------- subroutine hgrlx_full_old( & cor, corl0, corh0, corl1, corh1, & res, resl0, resh0, resl1, resh1, & sigx, sigy, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1, & hx, hy, irz, imax) integer corl0, corh0, corl1, corh1 integer resl0, resh0, resl1, resh1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 double precision cor(corl0:corh0,corl1:corh1) double precision res(resl0:resh0,resl1:resh1) double precision sigx(sfl0:sfh0,sfl1:sfh1) double precision sigy(sfl0:sfh0,sfl1:sfh1) double precision cen(cenl0:cenh0,cenl1:cenh1) double precision hx, hy integer irz, imax double precision hxm2, hym2, fac, facrz, r0, r1 integer i, j double precision AVG, AVGRZ AVG() = fac * (hxm2 * & (sigx(i-1,j-1) * & (cor(i-1,j-1) - cor(i,j-1) + 2.d0 * cor(i-1,j)) + & sigx(i-1,j) * & (cor(i-1,j+1) - cor(i,j+1) + 2.d0 * cor(i-1,j)) + & sigx(i,j-1) * & (cor(i+1,j-1) - cor(i,j-1) + 2.d0 * cor(i+1,j)) + & sigx(i,j) * & (cor(i+1,j+1) - cor(i,j+1) + 2.d0 * cor(i+1,j))) + & hym2 * & (sigy(i-1,j-1) * & (cor(i-1,j-1) - cor(i-1,j) + 2.d0 * cor(i,j-1)) + & sigy(i-1,j) * & (cor(i-1,j+1) - cor(i-1,j) + 2.d0 * cor(i,j+1)) + & sigy(i,j-1) * & (cor(i+1,j-1) - cor(i+1,j) + 2.d0 * cor(i,j-1)) + & sigy(i,j) * & (cor(i+1,j+1) - cor(i+1,j) + 2.d0 * cor(i,j+1)))) AVGRZ() = AVG() + facrz * & ((sigy(i-1,j-1) / r0 - sigy(i,j-1) / r1) * cor(i,j-1) + & (sigy(i-1,j) / r0 - sigy(i,j) / r1) * cor(i,j+1)) hxm2 = 1.d0 / (hx*hx) hym2 = 1.d0 / (hy*hy) fac = 1.d0 / 6.d0 if (irz .eq. 0) then do j = regl1, regh1 cdir$ ivdep do i = regl0, regh0 cor(i,j) = (AVG() - res(i,j)) * cen(i,j) end do end do else facrz = hx * hym2 / 12.d0 do j = regl1, regh1 cdir$ ivdep do i = regl0, regh0 r1 = (i + 0.5d0) * hx r0 = r1 - hx if (i .eq. imax) then r1 = -r0 end if cor(i,j) = (AVGRZ() - res(i,j)) * cen(i,j) end do end do end if end c----------------------------------------------------------------------- subroutine hgrlxl_full_old( & cor, corl0, corh0, corl1, corh1, & res, resl0, resh0, resl1, resh1, & sigx, sigy, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1, & doml0, domh0, doml1, domh1, & hx, hy, irz, imax, lsd) integer corl0, corh0, corl1, corh1 integer resl0, resh0, resl1, resh1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 integer doml0, domh0, doml1, domh1 double precision cor(corl0:corh0,corl1:corh1) double precision res(resl0:resh0,resl1:resh1) double precision sigx(sfl0:sfh0,sfl1:sfh1) double precision sigy(sfl0:sfh0,sfl1:sfh1) double precision cen(cenl0:cenh0,cenl1:cenh1) double precision hx, hy double precision wrk(256) integer irz, imax, lsd double precision hxm2, hym2, fac, facrz, r0, r1, betm, aj integer i, j, jw, ipass c double precision RHSL0 double precision RHSL1 c double precision RHSRZL0, RHSRZL1 double precision AVG, AVGRZ c RHSL0() = (res(i,j) - fac * (hxm2 * c & (sigx(i-1,j-1) * c & (cor(i-1,j-1) - cor(i,j-1)) + c & sigx(i-1,j) * c & (cor(i-1,j+1) - cor(i,j+1)) + c & sigx(i,j-1) * c & (cor(i+1,j-1) - cor(i,j-1)) + c & sigx(i,j) * c & (cor(i+1,j+1) - cor(i,j+1))) + c & hym2 * c & (sigy(i-1,j-1) * c & (cor(i-1,j-1) + 2.d0 * cor(i,j-1)) + c & sigy(i-1,j) * c & (cor(i-1,j+1) + 2.d0 * cor(i,j+1)) + c & sigy(i,j-1) * c & (cor(i+1,j-1) + 2.d0 * cor(i,j-1)) + c & sigy(i,j) * c & (cor(i+1,j+1) + 2.d0 * cor(i,j+1))))) RHSL1() = (res(i,j) - fac * (hxm2 * & (sigx(i-1,j-1) * & (cor(i-1,j-1) + 2.d0 * cor(i-1,j)) + & sigx(i-1,j) * & (cor(i-1,j+1) + 2.d0 * cor(i-1,j)) + & sigx(i,j-1) * & (cor(i+1,j-1) + 2.d0 * cor(i+1,j)) + & sigx(i,j) * & (cor(i+1,j+1) + 2.d0 * cor(i+1,j))) + & hym2 * & (sigy(i-1,j-1) * & (cor(i-1,j-1) - cor(i-1,j)) + & sigy(i-1,j) * & (cor(i-1,j+1) - cor(i-1,j)) + & sigy(i,j-1) * & (cor(i+1,j-1) - cor(i+1,j)) + & sigy(i,j) * & (cor(i+1,j+1) - cor(i+1,j))))) c RHSRZL0() = (RHSL0() - facrz * c & ((sigy(i-1,j-1) / r0 - sigy(i,j-1) / r1) * cor(i,j-1) + c & (sigy(i-1,j) / r0 - sigy(i,j) / r1) * cor(i,j+1))) c c RHSRZL1()= RHSL1() AVG() = fac * (hxm2 * & (sigx(i-1,j-1) * & (cor(i-1,j-1) - cor(i,j-1) + 2.d0 * cor(i-1,j)) + & sigx(i-1,j) * & (cor(i-1,j+1) - cor(i,j+1) + 2.d0 * cor(i-1,j)) + & sigx(i,j-1) * & (cor(i+1,j-1) - cor(i,j-1) + 2.d0 * cor(i+1,j)) + & sigx(i,j) * & (cor(i+1,j+1) - cor(i,j+1) + 2.d0 * cor(i+1,j))) + & hym2 * & (sigy(i-1,j-1) * & (cor(i-1,j-1) - cor(i-1,j) + 2.d0 * cor(i,j-1)) + & sigy(i-1,j) * & (cor(i-1,j+1) - cor(i-1,j) + 2.d0 * cor(i,j+1)) + & sigy(i,j-1) * & (cor(i+1,j-1) - cor(i+1,j) + 2.d0 * cor(i,j-1)) + & sigy(i,j) * & (cor(i+1,j+1) - cor(i+1,j) + 2.d0 * cor(i,j+1)))) AVGRZ() = AVG() + facrz * & ((sigy(i-1,j-1) / r0 - sigy(i,j-1) / r1) * cor(i,j-1) + & (sigy(i-1,j) / r0 - sigy(i,j) / r1) * cor(i,j+1)) hxm2 = 1.d0 / (hx*hx) hym2 = 1.d0 / (hy*hy) fac = 1.d0 / 6.d0 if (irz .eq. 0) then if (lsd .eq. 1) then do ipass = 0, 1 do i = regl0 + ipass, regh0, 2 j = regl1 betm = -cen(i,j) if (betm .eq. 0.d0) then c dirichlet bdy: cor(i,j) = 0.d0 wrk(1) = 0.d0 else if (regl1 .eq. doml1) then c neumann bdy: cor(i,j) = RHSL1() * betm aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j) + sigy(i,j)) - & hxm2 * (sigx(i-1,j) + sigx(i,j))) wrk(1) = 2.d0 * aj * betm else c interface to grid at same level: aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j-1) + sigy(i,j-1)) - & hxm2 * (sigx(i-1,j-1) + sigx(i,j-1))) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j) + sigy(i,j)) - & hxm2 * (sigx(i-1,j) + sigx(i,j))) wrk(1) = aj * betm end if c forward solve loop: do j = regl1 + 1, regh1 - 1 jw = j - regl1 if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(jw)) end if cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j) + sigy(i,j)) - & hxm2 * (sigx(i-1,j) + sigx(i,j))) wrk(jw + 1) = aj * betm end do j = regh1 jw = j - regl1 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: cor(i,j) = 0.d0 else if (regh1 .eq. domh1) then c neumann bdy: aj = 2.d0 * aj betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(jw)) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm else if (jw .gt. 0) then c interface to grid at same level: betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(jw)) cor(i,j) = RHSL1() - aj * cor(i,j-1) aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j) + sigy(i,j)) - & hxm2 * (sigx(i-1,j) + sigx(i,j))) cor(i,j) = (cor(i,j) - aj * cor(i,j+1)) * betm end if c back substitution loop: do j = regh1 - 1, regl1, -1 jw = j - regl1 cor(i,j) = cor(i,j) - wrk(jw + 1) * cor(i,j+1) end do c update neumann bdys: if (regl1 .eq. doml1) then cor(i,regl1-1) = cor(i,regl1+1) end if if (regh1 .eq. domh1) then cor(i,regh1+1) = cor(i,regh1-1) end if end do end do else print *, "Line solve not implemented in dimension", lsd stop end if else STOP "Line solve not implemented for rz: Using Gauss-Seidel & instead." facrz = hx * hym2 / 12.d0 if (regh1 - regl1 .gt. regh0 - regl0) then do i = regl0, regh0 r1 = (i + 0.5d0) * hx r0 = r1 - hx if (i .eq. imax) then r1 = -r0 end if cdir$ ivdep do j = regl1, regh1 cor(i,j) = (AVGRZ() - res(i,j)) * cen(i,j) end do end do else do j = regl1, regh1 cdir$ ivdep do i = regl0, regh0 r1 = (i + 0.5d0) * hx r0 = r1 - hx if (i .eq. imax) then r1 = -r0 end if cor(i,j) = (AVGRZ() - res(i,j)) * cen(i,j) end do end do end if end if end c----------------------------------------------------------------------- subroutine hgrlnf_full_old( & cor, corl0, corh0, corl1, corh1, & res, resl0, resh0, resl1, resh1, & wrk, wrkl0, wrkh0, wrkl1, wrkh1, & sigx, sigy, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1, & doml0, domh0, doml1, domh1, & hx, hy, irz, imax, lsd, ipass) integer corl0, corh0, corl1, corh1 integer resl0, resh0, resl1, resh1 integer wrkl0, wrkh0, wrkl1, wrkh1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 integer doml0, domh0, doml1, domh1 double precision cor(corl0:corh0,corl1:corh1) double precision res(resl0:resh0,resl1:resh1) double precision wrk(wrkl0:wrkh0,wrkl1:wrkh1) double precision sigx(sfl0:sfh0,sfl1:sfh1) double precision sigy(sfl0:sfh0,sfl1:sfh1) double precision cen(cenl0:cenh0,cenl1:cenh1) double precision hx, hy integer irz, imax, lsd, ipass double precision hxm2, hym2, fac, facrz, r0, r1, betm, aj integer i, j, ioff double precision RHSL0, RHSL1, RHSRZL0, RHSRZL1 c double precision AVG c double precision AVGRZ RHSL0() = (res(i,j) - fac * (hxm2 * & (sigx(i-1,j-1) * & (cor(i-1,j-1) - cor(i,j-1)) + & sigx(i-1,j) * & (cor(i-1,j+1) - cor(i,j+1)) + & sigx(i,j-1) * & (cor(i+1,j-1) - cor(i,j-1)) + & sigx(i,j) * & (cor(i+1,j+1) - cor(i,j+1))) + & hym2 * & (sigy(i-1,j-1) * & (cor(i-1,j-1) + 2.d0 * cor(i,j-1)) + & sigy(i-1,j) * & (cor(i-1,j+1) + 2.d0 * cor(i,j+1)) + & sigy(i,j-1) * & (cor(i+1,j-1) + 2.d0 * cor(i,j-1)) + & sigy(i,j) * & (cor(i+1,j+1) + 2.d0 * cor(i,j+1))))) RHSL1() = (res(i,j) - fac * (hxm2 * & (sigx(i-1,j-1) * & (cor(i-1,j-1) + 2.d0 * cor(i-1,j)) + & sigx(i-1,j) * & (cor(i-1,j+1) + 2.d0 * cor(i-1,j)) + & sigx(i,j-1) * & (cor(i+1,j-1) + 2.d0 * cor(i+1,j)) + & sigx(i,j) * & (cor(i+1,j+1) + 2.d0 * cor(i+1,j))) + & hym2 * & (sigy(i-1,j-1) * & (cor(i-1,j-1) - cor(i-1,j)) + & sigy(i-1,j) * & (cor(i-1,j+1) - cor(i-1,j)) + & sigy(i,j-1) * & (cor(i+1,j-1) - cor(i+1,j)) + & sigy(i,j) * & (cor(i+1,j+1) - cor(i+1,j))))) RHSRZL0() = (RHSL0() - facrz * & ((sigy(i-1,j-1) / r0 - sigy(i,j-1) / r1) * cor(i,j-1) + & (sigy(i-1,j) / r0 - sigy(i,j) / r1) * cor(i,j+1))) RHSRZL1()= RHSL1() c AVG() = fac * (hxm2 * c & (sigx(i-1,j-1) * c & (cor(i-1,j-1) - cor(i,j-1) + 2.d0 * cor(i-1,j)) + c & sigx(i-1,j) * c & (cor(i-1,j+1) - cor(i,j+1) + 2.d0 * cor(i-1,j)) + c & sigx(i,j-1) * c & (cor(i+1,j-1) - cor(i,j-1) + 2.d0 * cor(i+1,j)) + c & sigx(i,j) * c & (cor(i+1,j+1) - cor(i,j+1) + 2.d0 * cor(i+1,j))) + c & hym2 * c & (sigy(i-1,j-1) * c & (cor(i-1,j-1) - cor(i-1,j) + 2.d0 * cor(i,j-1)) + c & sigy(i-1,j) * c & (cor(i-1,j+1) - cor(i-1,j) + 2.d0 * cor(i,j+1)) + c & sigy(i,j-1) * c & (cor(i+1,j-1) - cor(i+1,j) + 2.d0 * cor(i,j-1)) + c & sigy(i,j) * c & (cor(i+1,j+1) - cor(i+1,j) + 2.d0 * cor(i,j+1)))) c AVGRZ() = AVG() + facrz * c & ((sigy(i-1,j-1) / r0 - sigy(i,j-1) / r1) * cor(i,j-1) + c & (sigy(i-1,j) / r0 - sigy(i,j) / r1) * cor(i,j+1)) hxm2 = 1.d0 / (hx*hx) hym2 = 1.d0 / (hy*hy) fac = 1.d0 / 6.d0 if (irz .eq. 0) then if (lsd .eq. 0) then if (mod(regl1,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if i = regl0 do j = regl1 + ioff, regh1, 2 aj = fac * & (hxm2 * 2.d0 * (sigx(i,j-1) + sigx(i,j)) - & hym2 * (sigy(i,j-1) + sigy(i,j))) if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: wrk(i,j) = 0.d0 else if (regl0 .eq. doml0) then c neumann bdy: betm = -cen(i,j) cor(i,j) = RHSL0() * betm wrk(i,j) = 2.d0 * aj * betm end if wrk(i+1,j) = aj end do c forward solve loop: do i = regl0 + 1, regh0 - 1 do j = regl1 + ioff, regh1, 2 aj = wrk(i,j) if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) end if cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm aj = fac * & (hxm2 * 2.d0 * (sigx(i,j-1) + sigx(i,j)) - & hym2 * (sigy(i,j-1) + sigy(i,j))) wrk(i+1,j) = aj wrk(i,j) = aj * betm end do end do i = regh0 do j = regl1 + ioff, regh1, 2 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: else if (regh0 .eq. domh0) then c neumann bdy: aj = 2.d0 * wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm else if (i .gt. regl0) then c interface to grid at same level: aj = wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm aj = fac * & (hxm2 * 2.d0 * (sigx(i,j-1) + sigx(i,j)) - & hym2 * (sigy(i,j-1) + sigy(i,j))) wrk(i,j) = aj * betm end if end do else if (mod(regl0,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if j = regl1 do i = regl0 + ioff, regh0, 2 aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j) + sigy(i,j)) - & hxm2 * (sigx(i-1,j) + sigx(i,j))) if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: wrk(i,j) = 0.d0 else if (regl1 .eq. doml1) then c neumann bdy: betm = -cen(i,j) cor(i,j) = RHSL1() * betm wrk(i,j) = 2.d0 * aj * betm end if wrk(i,j+1) = aj end do c forward solve loop: do j = regl1 + 1, regh1 - 1 do i = regl0 + ioff, regh0, 2 aj = wrk(i,j) if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) end if cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j) + sigy(i,j)) - & hxm2 * (sigx(i-1,j) + sigx(i,j))) wrk(i,j+1) = aj wrk(i,j) = aj * betm end do end do j = regh1 do i = regl0 + ioff, regh0, 2 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: else if (regh1 .eq. domh1) then c neumann bdy: aj = 2.d0 * wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm else if (j .gt. regl1) then c interface to grid at same level: aj = wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j) + sigy(i,j)) - & hxm2 * (sigx(i-1,j) + sigx(i,j))) wrk(i,j) = aj * betm end if end do end if else facrz = hx * hym2 / 12.d0 if (lsd .eq. 0) then if (mod(regl1,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if i = regl0 r1 = (i + 0.5d0) * hx r0 = r1 - hx do j = regl1 + ioff, regh1, 2 aj = fac * & (hxm2 * 2.d0 * (sigx(i,j-1) + sigx(i,j)) - & hym2 * (sigy(i,j-1) + sigy(i,j))) if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: wrk(i,j) = 0.d0 else if (regl0 .eq. doml0) then c neumann bdy: betm = -cen(i,j) cor(i,j) = RHSRZL0() * betm wrk(i,j) = 2.d0 * aj * betm end if wrk(i+1,j) = aj end do c forward solve loop: do i = regl0 + 1, regh0 - 1 r1 = (i + 0.5d0) * hx r0 = r1 - hx do j = regl1 + ioff, regh1, 2 aj = wrk(i,j) if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) end if cor(i,j) = (RHSRZL0() - aj * cor(i-1,j)) * betm aj = fac * & (hxm2 * 2.d0 * (sigx(i,j-1) + sigx(i,j)) - & hym2 * (sigy(i,j-1) + sigy(i,j))) wrk(i+1,j) = aj wrk(i,j) = aj * betm end do end do i = regh0 r1 = (i + 0.5d0) * hx r0 = r1 - hx if (i .eq. imax) then r1 = -r0 end if do j = regl1 + ioff, regh1, 2 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: else if (regh0 .eq. domh0) then c neumann bdy: aj = 2.d0 * wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) cor(i,j) = (RHSRZL0() - aj * cor(i-1,j)) * betm else if (i .gt. regl0) then c interface to grid at same level: aj = wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) cor(i,j) = (RHSRZL0() - aj * cor(i-1,j)) * betm aj = fac * & (hxm2 * 2.d0 * (sigx(i,j-1) + sigx(i,j)) - & hym2 * (sigy(i,j-1) + sigy(i,j))) wrk(i,j) = aj * betm end if end do else if (mod(regl0,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if j = regl1 do i = regl0 + ioff, regh0, 2 r1 = (i + 0.5d0) * hx r0 = r1 - hx if (i .eq. imax) then r1 = -r0 end if aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j) + sigy(i,j)) - & hxm2 * (sigx(i-1,j) + sigx(i,j))) + & facrz * (sigy(i-1,j) / r0 - sigy(i,j) / r1) if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: wrk(i,j) = 0.d0 else if (regl1 .eq. doml1) then c neumann bdy: betm = -cen(i,j) cor(i,j) = RHSRZL1() * betm wrk(i,j) = 2.d0 * aj * betm end if wrk(i,j+1) = aj end do c forward solve loop: do j = regl1 + 1, regh1 - 1 do i = regl0 + ioff, regh0, 2 r1 = (i + 0.5d0) * hx r0 = r1 - hx if (i .eq. imax) then r1 = -r0 end if aj = wrk(i,j) if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) end if cor(i,j) = (RHSRZL1() - aj * cor(i,j-1)) * betm aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j) + sigy(i,j)) - & hxm2 * (sigx(i-1,j) + sigx(i,j))) + & facrz * (sigy(i-1,j) / r0 - sigy(i,j) / r1) wrk(i,j+1) = aj wrk(i,j) = aj * betm end do end do j = regh1 do i = regl0 + ioff, regh0, 2 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: else if (regh1 .eq. domh1) then c neumann bdy: aj = 2.d0 * wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) cor(i,j) = (RHSRZL1() - aj * cor(i,j-1)) * betm else if (j .gt. regl1) then c interface to grid at same level: r1 = (i + 0.5d0) * hx r0 = r1 - hx if (i .eq. imax) then r1 = -r0 end if aj = wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) cor(i,j) = (RHSRZL1() - aj * cor(i,j-1)) * betm aj = fac * & (hym2 * 2.d0 * (sigy(i-1,j) + sigy(i,j)) - & hxm2 * (sigx(i-1,j) + sigx(i,j))) + & facrz * (sigy(i-1,j) / r0 - sigy(i,j) / r1) wrk(i,j) = aj * betm end if end do end if end if end c----------------------------------------------------------------------- subroutine hgres_full_old( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & dest, destl0, desth0, destl1, desth1, & sigx, sigy, sfl0, sfh0, sfl1, sfh1, & regl0, regh0, regl1, regh1, & hx, hy, irz, imax) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer destl0, desth0, destl1, desth1 integer sfl0, sfh0, sfl1, sfh1 integer regl0, regh0, regl1, regh1 double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision dest(destl0:desth0,destl1:desth1) double precision sigx(sfl0:sfh0,sfl1:sfh1) double precision sigy(sfl0:sfh0,sfl1:sfh1) double precision hx, hy integer irz, imax double precision hxm2, hym2, fac, r0, r1, tmp integer i, j hxm2 = 1.d0 / (hx*hx) hym2 = 1.d0 / (hy*hy) fac = 1.d0 / 6.d0 do j = regl1, regh1 do i = regl0, regh0 tmp = hxm2 * & (sigx(i-1,j-1) * & (dest(i-1,j-1) - dest(i,j-1) + & 2.d0 * (dest(i-1,j) - dest(i,j))) + & sigx(i-1,j) * & (dest(i-1,j+1) - dest(i,j+1) + & 2.d0 * (dest(i-1,j) - dest(i,j))) + & sigx(i,j-1) * & (dest(i+1,j-1) - dest(i,j-1) + & 2.d0 * (dest(i+1,j) - dest(i,j))) + & sigx(i,j) * & (dest(i+1,j+1) - dest(i,j+1) + & 2.d0 * (dest(i+1,j) - dest(i,j)))) res(i,j) = src(i,j) - fac * (tmp + hym2 * & (sigy(i-1,j-1) * & (dest(i-1,j-1) - dest(i-1,j) + & 2.d0 * (dest(i,j-1) - dest(i,j))) + & sigy(i-1,j) * & (dest(i-1,j+1) - dest(i-1,j) + & 2.d0 * (dest(i,j+1) - dest(i,j))) + & sigy(i,j-1) * & (dest(i+1,j-1) - dest(i+1,j) + & 2.d0 * (dest(i,j-1) - dest(i,j))) + & sigy(i,j) * & (dest(i+1,j+1) - dest(i+1,j) + & 2.d0 * (dest(i,j+1) - dest(i,j))))) end do end do if (irz .eq. 1) then fac = hx * hym2 / 12.d0 do i = regl0, regh0 r1 = (i + 0.5d0) * hx r0 = r1 - hx if (i .eq. imax) then r1 = -r0 end if do j = regl1, regh1 res(i,j) = res(i,j) - fac * & ((sigy(i-1,j-1) * (dest(i,j-1) - dest(i,j)) + & sigy(i-1,j) * (dest(i,j+1) - dest(i,j))) / r0 - & (sigy(i,j-1) * (dest(i,j-1) - dest(i,j)) + & sigy(i,j) * (dest(i,j+1) - dest(i,j))) / r1) end do end do end if end c----------------------------------------------------------------------- subroutine hgrlnb( & cor, corl0, corh0, corl1, corh1, & wrk, wrkl0, wrkh0, wrkl1, wrkh1, & regl0, regh0, regl1, regh1, & lsd, ipass) integer corl0, corh0, corl1, corh1 integer wrkl0, wrkh0, wrkl1, wrkh1 integer regl0, regh0, regl1, regh1 double precision cor(corl0:corh0,corl1:corh1) double precision wrk(wrkl0:wrkh0,wrkl1:wrkh1) integer lsd, ipass integer i, j, ioff if (lsd .eq. 0) then if (mod(regl1,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if c back substitution loop: do i = regh0 - 1, regl0, -1 do j = regl1 + ioff, regh1, 2 cor(i,j) = cor(i,j) - wrk(i,j) * cor(i+1,j) end do end do else if (mod(regl0,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if c back substitution loop: do j = regh1 - 1, regl1, -1 do i = regl0 + ioff, regh0, 2 cor(i,j) = cor(i,j) - wrk(i,j) * cor(i,j+1) end do end do end if end c Unrolled indexing in these 3 routines uses the fact that each array c has a border of width 1 c----------------------------------------------------------------------- c Works for NODE-based data. subroutine hgip( & v0, v1, mask, & regl0, regh0, regl1, regh1, & sum) integer regl0, regh0, regl1, regh1 double precision v0(*) double precision v1(*) double precision mask(*) double precision sum integer i, idiff c do 10 i = 1, (regh0 - regl0 + 1) * (regh1 - regl1 + 1) idiff = regh0 - regl0 + 1 do i = idiff + 2, idiff * (regh1 - regl1) - 1 sum = sum + mask(i) * v0(i) * v1(i) end do end c----------------------------------------------------------------------- subroutine hgcg1( & r, p, z, x, w, c, mask, & regl0, regh0, regl1, regh1, & alpha, rho) integer regl0, regh0, regl1, regh1 double precision r(*) double precision p(*) double precision z(*) double precision x(*) double precision w(*) double precision c(*) double precision mask(*) double precision alpha, rho integer i, idiff c do 10 i = 1, (regh0 - regl0 + 1) * (regh1 - regl1 + 1) idiff = regh0 - regl0 + 1 do i = idiff + 2, idiff * (regh1 - regl1) - 1 r(i) = r(i) - alpha * w(i) x(i) = x(i) + alpha * p(i) z(i) = r(i) * c(i) rho = rho + mask(i) * z(i) * r(i) end do end c----------------------------------------------------------------------- subroutine hgcg2(p, z, & regl0, regh0, regl1, regh1, & alpha) integer regl0, regh0, regl1, regh1 double precision p(*) double precision z(*) double precision alpha integer i, idiff c do 10 i = 1, (regh0 - regl0 + 1) * (regh1 - regl1 + 1) idiff = regh0 - regl0 + 1 do i = idiff + 2, idiff * (regh1 - regl1) - 1 p(i) = alpha * p(i) + z(i) end do end c----------------------------------------------------------------------- subroutine hgresu( & res, resl0,resh0,resl1,resh1, & src, dest, signd, mask, & regl0,regh0,regl1,regh1, & irz) integer resl0,resh0,resl1,resh1 integer regl0,regh0,regl1,regh1 double precision res(*) double precision src(*) double precision dest(*) double precision signd(*) double precision mask(*) integer irz integer istart, iend integer i, jdiff, ly integer ilocal, jlocal jdiff = resh0 - resl0 + 1 ly = (resh1 - resl1 + 1) * jdiff istart = (regl1 - resl1) * jdiff + (regl0 - resl0) iend = (regh1 - resl1) * jdiff + (regh0 - resl0) do i = istart+1, iend+1 jlocal = i / jdiff + resl1 ilocal = resl0 + (i-jlocal*jdiff-resl1) res(i) = mask(i) * (src(i) - & (signd(i-1) * (dest(i-1) - dest(i)) + & signd(i) * (dest(i+1) - dest(i)) + & signd(i+ly-jdiff) * (dest(i-jdiff) - dest(i)) + & signd(i+ly) * (dest(i+jdiff) - dest(i)))) end do if (irz .eq. 1 .and. regl0 .eq. 0) then do i = (regl1 - resl1) * jdiff + (regl0 - resl0) + 1, & (regh1 - resl1) * jdiff + (regh0 - resl0) + 1, jdiff res(i) = mask(i) * (src(i) - & (signd(i-1) * (dest(i-1) - dest(i)) + & signd(i) * (dest(i+1) - dest(i)) + & signd(i+ly-jdiff) * (dest(i-jdiff) - dest(i)) * 0.5d0 + & signd(i+ly) * (dest(i+jdiff) - dest(i)) * 0.5d0 )) end do endif end c----------------------------------------------------------------------- subroutine hgresur( & res, resl0,resh0,resl1,resh1, & src, dest, signd, & regl0,regh0,regl1,regh1, & irz) integer resl0,resh0,resl1,resh1 integer regl0,regh0,regl1,regh1 double precision res(resl0:resh0, resl1:resh1) double precision src(resl0:resh0, resl1:resh1) double precision dest(resl0:resh0, resl1:resh1) double precision signd(resl0:resh0, resl1:resh1,2) integer irz integer istart, iend integer i, j, jdiff, ly integer ilocal, jlocal jdiff = resh0 - resl0 + 1 ly = (resh1 - resl1 + 1) * jdiff istart = (regl1 - resl1) * jdiff + (regl0 - resl0) iend = (regh1 - resl1) * jdiff + (regh0 - resl0) do j = regl1, regh1 do i = regl0, regh0 res(i,j) = (src(i,j) - ( & + signd(i-1,j,1)*(dest(i-1,j)-dest(i,j)) & + signd(i,j,1) *(dest(i+1,j)-dest(i,j)) & + signd(i,j-1,2)*(dest(i,j-1)-dest(i,j)) & + signd(i,j,2) *(dest(i,j+1)-dest(i,j)) & ) & ) end do end do if (irz .eq. 1 .and. regl0 .eq. 0) then do j = regl1, regh1 do i = regl0, regh0 res(i,j) = (src(i,j) - & (signd(i-1,j,1) * (dest(i-1,j) - dest(i,j)) + & signd(i,j,1) * (dest(i+1,j) - dest(i,j)) + & signd(i,j-1,2) * (dest(i,j-1) - dest(i,j)) * 0.5d0 + & signd(i,j,2) * (dest(i,j+1) - dest(i,j)) * 0.5d0 )) end do end do endif end c----------------------------------------------------------------------- subroutine hgscon( & signd, snl0,snh0,snl1,snh1, & sigx, sigy, & scl0,sch0,scl1,sch1, & regl0,regh0,regl1,regh1, & hx, hy) integer snl0,snh0,snl1,snh1 integer scl0,sch0,scl1,sch1 integer regl0,regh0,regl1,regh1 double precision signd(snl0:snh0,snl1:snh1, 2) double precision sigx(scl0:sch0,scl1:sch1) double precision sigy(scl0:sch0,scl1:sch1) double precision hx, hy double precision facx, facy integer i, j facx = 0.5D0 / (hx*hx) facy = 0.5D0 / (hy*hy) do j = regl1, regh1 do i = regl0-1, regh0 signd(i,j,1) = facx * & (sigx(i,j) + sigx(i,j-1)) end do end do do j = regl1-1, regh1 do i = regl0, regh0 signd(i,j,2) = facy * & (sigy(i-1,j) + sigy(i,j)) end do end do end c----------------------------------------------------------------------- c sig here contains three different directions all stored on "nodes" subroutine hgrlxu( & cor, res, sig, cen, & resl0,resh0,resl1,resh1, & mask, & regl0,regh0,regl1,regh1,irz) integer resl0,resh0,resl1,resh1 integer regl0,regh0,regl1,regh1 double precision cor(*) double precision res(*) double precision sig(*) double precision cen(*) double precision mask(*) double precision AVG double precision AVGREDGE integer irz integer istart, iend integer i, jdiff, ly AVG() = (sig(i-1) * cor(i-1) + & sig(i) * cor(i+1) + & sig(i+ly-jdiff) * cor(i-jdiff) + & sig(i+ly) * cor(i+jdiff)) AVGREDGE() = (sig(i-1) * cor(i-1) + & sig(i) * cor(i+1) + & sig(i+ly-jdiff) * cor(i-jdiff) * 0.5d0 + & sig(i+ly) * cor(i+jdiff) * 0.5d0 ) jdiff = resh0 - resl0 + 1 ly = (resh1 - resl1 + 1) * jdiff istart = (regl1 - resl1) * jdiff + (regl0 - resl0) iend = (regh1 - resl1) * jdiff + (regh0 - resl0) cdir$ ivdep if (irz .eq. 0 .or. regl0 .gt. 0) then do i = istart + 1, iend + 1, 2 cor(i) = cor(i) & + mask(i) * ((AVG() - res(i)) * cen(i) - cor(i)) end do cdir$ ivdep do i = istart + 2, iend + 1, 2 cor(i) = cor(i) & + mask(i) * ((AVG() - res(i)) * cen(i) - cor(i)) end do else c Now irz = 1 and regl0 = 0, so we are touching the r=0 edge do i = istart + 1, iend + 1, 2 if (mod(i-istart-1,jdiff) .eq. 0) then cor(i) = cor(i) & + mask(i) * ((AVGREDGE() - res(i)) * cen(i) - cor(i)) else cor(i) = cor(i) & + mask(i) * ((AVG() - res(i)) * cen(i) - cor(i)) endif end do cdir$ ivdep do i = istart + 2, iend + 1, 2 if (mod(i-istart-1,jdiff) .eq. 0) then cor(i) = cor(i) & + mask(i) * ((AVGREDGE() - res(i)) * cen(i) - cor(i)) else cor(i) = cor(i) & + mask(i) * ((AVG() - res(i)) * cen(i) - cor(i)) endif end do endif end c----------------------------------------------------------------------- c sig here contains three different directions all stored on "nodes" subroutine hgrlxur( & cor, res, sig, cen, & resl0,resh0,resl1,resh1, & regl0,regh0,regl1,regh1,irz) integer resl0,resh0,resl1,resh1 integer regl0,regh0,regl1,regh1 double precision cor(resl0:resh0,resl1:resh1) double precision res(resl0:resh0,resl1:resh1) double precision sig(resl0:resh0,resl1:resh1,2) double precision cen(resl0:resh0,resl1:resh1) double precision AVG double precision AVGREDGE integer irz integer istart, iend integer i, j, jdiff, ly, ipar AVGREDGE() = (sig(i-1,j,1) * cor(i-1,j) + & sig(i,j,1) * cor(i+1,j) + & sig(i,j-1,2) * cor(i,j-1) * 0.5d0 + & sig(i,j,2) * cor(i,j+1) * 0.5d0 ) AVG() = (sig(i-1,j,1) * cor(i-1,j) + & sig(i,j,1) * cor(i+1,j) + & sig(i,j-1,2) * cor(i,j-1) + & sig(i,j,2) * cor(i,j+1)) jdiff = resh0 - resl0 + 1 ly = (resh1 - resl1 + 1) * jdiff istart = (regl1 - resl1) * jdiff + (regl0 - resl0) iend = (regh1 - resl1) * jdiff + (regh0 - resl0) if (irz .eq. 0 .or. regl0 .gt. 0) then ipar = 1 do j = regl1, regh1 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 cor(i,j) = (AVG()-res(i,j))*cen(i,j) end do end do ipar = 0 do j = regl1, regh1 ipar = 1 - ipar do i = regl0+ipar, regh0, 2 cor(i,j) = (AVG()-res(i,j))*cen(i,j) end do end do else c Now irz = 1 and regl0 = 0, so we are touching the r=0 edge ipar = 1 do j = regl1, regh1 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 if (i .eq. 0) then cor(i,j) = (AVGREDGE() - res(i,j)) * cen(i,j) else cor(i,j) = (AVG() - res(i,j)) * cen(i,j) endif end do end do cdir$ ivdep ipar = 0 do j = regl1, regh1 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 if ( i .eq. 0) then cor(i,j) = (AVGREDGE() - res(i,j)) * cen(i,j) else cor(i,j) = (AVG() - res(i,j)) * cen(i,j) endif end do end do endif end c 9-point stencil versions: c 9-point variable density stencils: c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along edge subroutine hgfres_full_old( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & fdst, fdstl0, fdsth0, fdstl1, fdsth1, & cdst, cdstl0, cdsth0, cdstl1, cdsth1, & sigmaf, sfl0, sfh0, sfl1, sfh1, & sigmac, scl0, sch0, scl1, sch1, & regl0, regh0, regl1, regh1, & hx, hy, ir, jr, idim, idir, irz, imax) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer fdstl0, fdsth0, fdstl1, fdsth1 integer cdstl0, cdsth0, cdstl1, cdsth1 integer sfl0, sfh0, sfl1, sfh1 integer scl0, sch0, scl1, sch1 integer regl0, regh0, regl1, regh1 double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1) double precision sigmaf(sfl0:sfh0,sfl1:sfh1) double precision sigmac(scl0:sch0,scl1:sch1) double precision hx, hy integer ir, jr, idim, idir, irz, imax double precision hxm2, hym2, fac0, fac1, r, rfac, & rfac0, rfac1, tmp double precision rfac0m, rfac1m, rfac0p, rfac1p integer i, j, is, js, m, n if (idim .eq. 0) then i = regl0 if (idir .eq. 1) then is = i - 1 else is = i end if fac0 = ir / (3.d0 * (ir + 1.d0)) hxm2 = 1.d0 / (ir * ir * hx * hx) hym2 = 1.d0 / (jr * jr * hy * hy) do j = regl1, regh1 res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * & (hxm2 * & (sigmac(is,j-1) * & (cdst(i-idir,j-1) - cdst(i,j-1) + & 2.d0 * (cdst(i-idir,j) - cdst(i,j))) + & sigmac(is,j) * & (cdst(i-idir,j+1) - cdst(i,j+1) + & 2.d0 * (cdst(i-idir,j) - cdst(i,j)))) + & hym2 * & (sigmac(is,j-1) * & (cdst(i-idir,j-1) - cdst(i-idir,j) + & 2.d0 * (cdst(i,j-1) - cdst(i,j))) + & sigmac(is,j) * & (cdst(i-idir,j+1) - cdst(i-idir,j) + & 2.d0 * (cdst(i,j+1) - cdst(i,j))))) end do if (irz .eq. 1) then r = (is + 0.5d0) * (hx * ir) rfac = idir * ir * hx * hym2 / (2.d0 * r) do j = regl1, regh1 res(i*ir,j*jr) = res(i*ir,j*jr) - fac0 * & (rfac * (sigmac(is,j-1) * (cdst(i,j-1) - cdst(i,j)) + & sigmac(is,j) * (cdst(i,j+1) - cdst(i,j)))) end do end if fac0 = fac0 / (ir * jr * jr) hxm2 = ir * ir * hxm2 hym2 = jr * jr * hym2 i = i * ir if (idir .eq. 1) then is = i else is = i - 1 end if if (irz .eq. 1) then r = (is + 0.5d0) * hx rfac = idir * hx * hym2 / (2.d0 * r) end if do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5d0 * fac1 do j = jr*regl1, jr*regh1, jr tmp = hxm2 * & (sigmaf(is,j-n-1) * & (fdst(i+idir,j-n-1) - fdst(i,j-n-1) + & 2.d0 * (fdst(i+idir,j-n) - fdst(i,j-n))) + & sigmaf(is,j-n) * & (fdst(i+idir,j-n+1) - fdst(i,j-n+1) + & 2.d0 * (fdst(i+idir,j-n) - fdst(i,j-n))) + & sigmaf(is,j+n-1) * & (fdst(i+idir,j+n-1) - fdst(i,j+n-1) + & 2.d0 * (fdst(i+idir,j+n) - fdst(i,j+n))) + & sigmaf(is,j+n) * & (fdst(i+idir,j+n+1) - fdst(i,j+n+1) + & 2.d0 * (fdst(i+idir,j+n) - fdst(i,j+n)))) res(i,j) = res(i,j) - fac1 * (tmp + hym2 * & (sigmaf(is,j-n-1) * & (fdst(i+idir,j-n-1) - fdst(i+idir,j-n) + & 2.d0 * (fdst(i,j-n-1) - fdst(i,j-n))) + & sigmaf(is,j-n) * & (fdst(i+idir,j-n+1) - fdst(i+idir,j-n) + & 2.d0 * (fdst(i,j-n+1) - fdst(i,j-n))) + & sigmaf(is,j+n-1) * & (fdst(i+idir,j+n-1) - fdst(i+idir,j+n) + & 2.d0 * (fdst(i,j+n-1) - fdst(i,j+n))) + & sigmaf(is,j+n) * & (fdst(i+idir,j+n+1) - fdst(i+idir,j+n) + & 2.d0 * (fdst(i,j+n+1) - fdst(i,j+n))))) end do if (irz .eq. 1) then do j = jr*regl1, jr*regh1, jr res(i,j) = res(i,j) + fac1 * & (rfac * (sigmaf(is,j-n-1) * (fdst(i,j-n-1) - fdst(i,j-n)) + & sigmaf(is,j-n) * (fdst(i,j-n+1) - fdst(i,j-n)) + & sigmaf(is,j+n-1) * (fdst(i,j+n-1) - fdst(i,j+n)) + & sigmaf(is,j+n) * (fdst(i,j+n+1) - fdst(i,j+n)))) end do end if end do else j = regl1 if (idir .eq. 1) then js = j - 1 else js = j end if fac0 = jr / (3.d0 * (jr + 1.d0)) hxm2 = 1.d0 / (ir * ir * hx * hx) hym2 = 1.d0 / (jr * jr * hy * hy) do i = regl0, regh0 res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * & (hxm2 * & (sigmac(i-1,js) * & (cdst(i-1,j-idir) - cdst(i,j-idir) + & 2.d0 * (cdst(i-1,j) - cdst(i,j))) + & sigmac(i,js) * & (cdst(i+1,j-idir) - cdst(i,j-idir) + & 2.d0 * (cdst(i+1,j) - cdst(i,j)))) + & hym2 * & (sigmac(i-1,js) * & (cdst(i-1,j-idir) - cdst(i-1,j) + & 2.d0 * (cdst(i,j-idir) - cdst(i,j))) + & sigmac(i,js) * & (cdst(i+1,j-idir) - cdst(i+1,j) + & 2.d0 * (cdst(i,j-idir) - cdst(i,j))))) end do if (irz .eq. 1 .and. regh0 .lt. imax) then do i = regl0, regh0 r = (i + 0.5d0) * (hx * ir) rfac0 = ir * hx * hym2 / (2.d0 * (r - hx * ir)) rfac1 = ir * hx * hym2 / (2.d0 * r) res(i*ir,j*jr) = res(i*ir,j*jr) - fac0 * & (rfac0 * sigmac(i-1,js) - rfac1 * sigmac(i,js)) * & (cdst(i,j-idir) - cdst(i,j)) end do else if (irz .eq. 1) then c This should only occur with a corner at the outer boundary: i = regh0 r = (i - 0.5d0) * (hx * ir) rfac0 = ir * hx * hym2 / (2.d0 * r) rfac1 = -rfac0 res(i*ir,j*jr) = res(i*ir,j*jr) - fac0 * & (rfac0 * sigmac(i-1,js) - rfac1 * sigmac(i,js)) * & (cdst(i,j-idir) - cdst(i,j)) end if fac0 = fac0 / (ir * ir * jr) hxm2 = ir * ir * hxm2 hym2 = jr * jr * hym2 j = j * jr if (idir .eq. 1) then js = j else js = j - 1 end if do m = 0, ir-1 fac1 = (ir-m) * fac0 if (m .eq. 0) fac1 = 0.5d0 * fac1 do i = ir*regl0, ir*regh0, ir tmp = hxm2 * & (sigmaf(i-m-1,js) * & (fdst(i-m-1,j+idir) - fdst(i-m,j+idir) + & 2.d0 * (fdst(i-m-1,j) - fdst(i-m,j))) + & sigmaf(i-m,js) * & (fdst(i-m+1,j+idir) - fdst(i-m,j+idir) + & 2.d0 * (fdst(i-m+1,j) - fdst(i-m,j))) + & sigmaf(i+m-1,js) * & (fdst(i+m-1,j+idir) - fdst(i+m,j+idir) + & 2.d0 * (fdst(i+m-1,j) - fdst(i+m,j))) + & sigmaf(i+m,js) * & (fdst(i+m+1,j+idir) - fdst(i+m,j+idir) + & 2.d0 * (fdst(i+m+1,j) - fdst(i+m,j)))) res(i,j) = res(i,j) - fac1 * (tmp + hym2 * & (sigmaf(i-m-1,js) * & (fdst(i-m-1,j+idir) - fdst(i-m-1,j) + & 2.d0 * (fdst(i-m,j+idir) - fdst(i-m,j))) + & sigmaf(i-m,js) * & (fdst(i-m+1,j+idir) - fdst(i-m+1,j) + & 2.d0 * (fdst(i-m,j+idir) - fdst(i-m,j))) + & sigmaf(i+m-1,js) * & (fdst(i+m-1,j+idir) - fdst(i+m-1,j) + & 2.d0 * (fdst(i+m,j+idir) - fdst(i+m,j))) + & sigmaf(i+m,js) * & (fdst(i+m+1,j+idir) - fdst(i+m+1,j) + & 2.d0 * (fdst(i+m,j+idir) - fdst(i+m,j))))) end do if (irz .eq. 1 .and. regh0 .lt. imax) then do i = ir*regl0, ir*regh0, ir r = (i + 0.5d0) * hx rfac0m = hx * hym2 / (2.d0 * (r - (m + 1) * hx)) rfac1m = hx * hym2 / (2.d0 * (r - m * hx)) rfac0p = hx * hym2 / (2.d0 * (r + (m - 1) * hx)) rfac1p = hx * hym2 / (2.d0 * (r + m * hx)) res(i,j) = res(i,j) - fac1 * & ((rfac0m * sigmaf(i-m-1,js) - rfac1m * sigmaf(i-m,js)) * & (fdst(i-m,j+idir) - fdst(i-m,j)) + & (rfac0p * sigmaf(i+m-1,js) - rfac1p * sigmaf(i+m,js)) * & (fdst(i+m,j+idir) - fdst(i+m,j))) end do else if (irz .eq. 1) then c This should only occur with a corner at the outer boundary: i = ir * regh0 r = (i + 0.5d0) * hx rfac0m = hx * hym2 / (2.d0 * (r - (m + 1) * hx)) if (m .eq. 0) then rfac1m = -rfac0m else rfac1m = hx * hym2 / (2.d0 * (r - m * hx)) end if rfac0p = -rfac1m rfac1p = -rfac0m res(i,j) = res(i,j) - fac1 * & ((rfac0m * sigmaf(i-m-1,js) - rfac1m * sigmaf(i-m,js)) * & (fdst(i-m,j+idir) - fdst(i-m,j)) + & (rfac0p * sigmaf(i+m-1,js) - rfac1p * sigmaf(i+m,js)) * & (fdst(i+m,j+idir) - fdst(i+m,j))) end if end do end if end c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along edge subroutine hgores_full_old( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & fdst, fdstl0, fdsth0, fdstl1, fdsth1, & cdst, cdstl0, cdsth0, cdstl1, cdsth1, & sigmaf, sfl0, sfh0, sfl1, sfh1, & sigmac, scl0, sch0, scl1, sch1, & regl0, regh0, regl1, regh1, & hx, hy, ir, jr, idir, jdir, irz, idd) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer fdstl0, fdsth0, fdstl1, fdsth1 integer cdstl0, cdsth0, cdstl1, cdsth1 integer sfl0, sfh0, sfl1, sfh1 integer scl0, sch0, scl1, sch1 integer regl0, regh0, regl1, regh1 double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1) double precision sigmaf(sfl0:sfh0,sfl1:sfh1) double precision sigmac(scl0:sch0,scl1:sch1) double precision hx, hy integer ir, jr, idir, jdir, irz, idd double precision hxm2, hym2, fac0, fac1, r, rfac, & rfac0, rfac1, tmp double precision rfac0p, rfac1p integer i, j, is, js, m, n i = regl0 j = regl1 if (idir .eq. 1) then is = i - 1 else is = i end if if (jdir .eq. 1) then js = j - 1 else js = j end if hxm2 = 1.d0 / (ir * ir * hx * hx) hym2 = 1.d0 / (jr * jr * hy * hy) fac0 = (ir * jr) / (4.5d0*ir*jr + 1.5d0*ir + 1.5d0*jr - 1.5d0) res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * & (hxm2 * (sigmac(is,js+jdir) * & (cdst(i-idir,j+jdir) - cdst(i,j+jdir) + & 2.d0 * (cdst(i-idir,j) - cdst(i,j))) + & sigmac(is,js) * & (cdst(i-idir,j-jdir) - cdst(i,j-jdir) + & 2.d0 * (cdst(i-idir,j) - cdst(i,j))) + & sigmac(is+idir,js) * & (cdst(i+idir,j-jdir) - cdst(i,j-jdir) + & 2.d0 * (cdst(i+idir,j) - cdst(i,j)))) + & hym2 * (sigmac(is,js+jdir) * & (cdst(i-idir,j+jdir) - cdst(i-idir,j) + & 2.d0 * (cdst(i,j+jdir) - cdst(i,j))) + & sigmac(is,js) * & (cdst(i-idir,j-jdir) - cdst(i-idir,j) + & 2.d0 * (cdst(i,j-jdir) - cdst(i,j))) + & sigmac(is+idir,js) * & (cdst(i+idir,j-jdir) - cdst(i+idir,j) + & 2.d0 * (cdst(i,j-jdir) - cdst(i,j))))) if (irz .eq. 1) then r = (is + 0.5d0) * (hx * ir) rfac0 = ir * hx * hym2 / (2.d0 * (r + idir * hx * ir)) rfac1 = ir * hx * hym2 / (2.d0 * r) res(i*ir,j*jr) = res(i*ir,j*jr) + idir * fac0 * & ((rfac0 * sigmac(is+idir,js) - rfac1 * sigmac(is,js)) * & (cdst(i,j-jdir) - cdst(i,j)) - & rfac1 * sigmac(is,js+jdir) * (cdst(i,j+jdir) - cdst(i,j))) end if fac0 = fac0 / (ir * jr) hxm2 = ir * ir * hxm2 hym2 = jr * jr * hym2 i = i * ir j = j * jr if (idir .eq. 1) then is = i else is = i - 1 end if if (jdir .eq. 1) then js = j else js = j - 1 end if res(i,j) = res(i,j) - fac0 * sigmaf(is,js) * & (hxm2 * (fdst(i+idir,j+jdir) - fdst(i,j+jdir) + & 2.d0 * (fdst(i+idir,j) - fdst(i,j))) + & hym2 * (fdst(i+idir,j+jdir) - fdst(i+idir,j) + & 2.d0 * (fdst(i,j+jdir) - fdst(i,j)))) if (irz .eq. 1) then r = (is + 0.5d0) * hx rfac = hx * hym2 / (2.d0 * r) res(i,j) = res(i,j) + idir * fac0 * & rfac * sigmaf(is,js) * (fdst(i,j+jdir) - fdst(i,j)) end if fac0 = fac0 / ir do m = idir, idir*(ir-1), idir fac1 = (ir-abs(m)) * fac0 tmp = hxm2 * & (sigmaf(i+m-1,js) * & (fdst(i+m-1,j+jdir) - fdst(i+m,j+jdir) + & 2.d0 * (fdst(i+m-1,j) - fdst(i+m,j))) + & sigmaf(i+m,js) * & (fdst(i+m+1,j+jdir) - fdst(i+m,j+jdir) + & 2.d0 * (fdst(i+m+1,j) - fdst(i+m,j)))) res(i,j) = res(i,j) - fac1 * (tmp + hym2 * & (sigmaf(i+m-1,js) * & (fdst(i+m-1,j+jdir) - fdst(i+m-1,j) + & 2.d0 * (fdst(i+m,j+jdir) - fdst(i+m,j))) + & sigmaf(i+m,js) * & (fdst(i+m+1,j+jdir) - fdst(i+m+1,j) + & 2.d0 * (fdst(i+m,j+jdir) - fdst(i+m,j))))) if (irz .eq. 1) then r = (i + m + 0.5d0) * hx rfac0p = hx * hym2 / (2.d0 * (r - hx)) rfac1p = hx * hym2 / (2.d0 * r) res(i,j) = res(i,j) - fac1 * & (rfac0p * sigmaf(i+m-1,js) - rfac1p * sigmaf(i+m,js)) * & (fdst(i+m,j+jdir) - fdst(i+m,j)) end if end do fac0 = ir * fac0 / jr do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 tmp = hxm2 * & (sigmaf(is,j+n-1) * & (fdst(i+idir,j+n-1) - fdst(i,j+n-1) + & 2.d0 * (fdst(i+idir,j+n) - fdst(i,j+n))) + & sigmaf(is,j+n) * & (fdst(i+idir,j+n+1) - fdst(i,j+n+1) + & 2.d0 * (fdst(i+idir,j+n) - fdst(i,j+n)))) res(i,j) = res(i,j) - fac1 * (tmp + hym2 * & (sigmaf(is,j+n-1) * & (fdst(i+idir,j+n-1) - fdst(i+idir,j+n) + & 2.d0 * (fdst(i,j+n-1) - fdst(i,j+n))) + & sigmaf(is,j+n) * & (fdst(i+idir,j+n+1) - fdst(i+idir,j+n) + & 2.d0 * (fdst(i,j+n+1) - fdst(i,j+n))))) if (irz .eq. 1) then r = (is + 0.5d0) * hx rfac1 = -idir * hx * hym2 / (2.d0 * r) res(i,j) = res(i,j) - fac1 * & rfac1 *(sigmaf(is,j+n-1) * (fdst(i,j+n-1) - fdst(i,j+n)) + & sigmaf(is,j+n) * (fdst(i,j+n+1) - fdst(i,j+n))) end if end do end c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along edge subroutine hgires_full_old( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & fdst, fdstl0, fdsth0, fdstl1, fdsth1, & cdst, cdstl0, cdsth0, cdstl1, cdsth1, & sigmaf, sfl0, sfh0, sfl1, sfh1, & sigmac, scl0, sch0, scl1, sch1, & regl0, regh0, regl1, regh1, & hx, hy, ir, jr, idir, jdir, irz, idd) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer fdstl0, fdsth0, fdstl1, fdsth1 integer cdstl0, cdsth0, cdstl1, cdsth1 integer sfl0, sfh0, sfl1, sfh1 integer scl0, sch0, scl1, sch1 integer regl0, regh0, regl1, regh1 double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1) double precision sigmaf(sfl0:sfh0,sfl1:sfh1) double precision sigmac(scl0:sch0,scl1:sch1) double precision hx, hy integer ir, jr, idir, jdir, irz, idd double precision hxm2, hym2, fac0, fac1, r, rfac, & rfac0, rfac1, tmp double precision rfac0m, rfac1m integer i, j, is, js, m, n i = regl0 j = regl1 if (idir .eq. 1) then is = i - 1 else is = i end if if (jdir .eq. 1) then js = j - 1 else js = j end if hxm2 = 1.d0 / (ir * ir * hx * hx) hym2 = 1.d0 / (jr * jr * hy * hy) fac0 = (ir * jr) / (1.5d0*ir*jr + 1.5d0*ir + 1.5d0*jr + 1.5d0) res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * sigmac(is,js) * & (hxm2 * (cdst(i-idir,j-jdir) - cdst(i,j-jdir) + & 2.d0 * (cdst(i-idir,j) - cdst(i,j))) + & hym2 * (cdst(i-idir,j-jdir) - cdst(i-idir,j) + & 2.d0 * (cdst(i,j-jdir) - cdst(i,j)))) if (irz .eq. 1) then r = (is + 0.5d0) * (hx * ir) rfac = ir * hx * hym2 / (2.d0 * r) res(i*ir,j*jr) = res(i*ir,j*jr) - idir * fac0 * & rfac * sigmac(is,js) * (cdst(i,j-jdir) - cdst(i,j)) end if fac0 = fac0 / (ir * jr) hxm2 = ir * ir * hxm2 hym2 = jr * jr * hym2 i = i * ir j = j * jr if (idir .eq. 1) then is = i else is = i - 1 end if if (jdir .eq. 1) then js = j else js = j - 1 end if res(i,j) = res(i,j) - fac0 * & (hxm2 * (sigmaf(is,js-jdir) * & (fdst(i+idir,j-jdir) - fdst(i,j-jdir) + & 2.d0 * (fdst(i+idir,j) - fdst(i,j))) + & sigmaf(is,js) * & (fdst(i+idir,j+jdir) - fdst(i,j+jdir) + & 2.d0 * (fdst(i+idir,j) - fdst(i,j))) + & sigmaf(is-idir,js) * & (fdst(i-idir,j+jdir) - fdst(i,j+jdir) + & 2.d0 * (fdst(i-idir,j) - fdst(i,j)))) + & hym2 * (sigmaf(is,js-jdir) * & (fdst(i+idir,j-jdir) - fdst(i+idir,j) + & 2.d0 * (fdst(i,j-jdir) - fdst(i,j))) + & sigmaf(is,js) * & (fdst(i+idir,j+jdir) - fdst(i+idir,j) + & 2.d0 * (fdst(i,j+jdir) - fdst(i,j))) + & sigmaf(is-idir,js) * & (fdst(i-idir,j+jdir) - fdst(i-idir,j) + & 2.d0 * (fdst(i,j+jdir) - fdst(i,j))))) if (irz .eq. 1) then r = (is + 0.5d0) * hx rfac0 = hx * hym2 / (2.d0 * (r - idir * hx)) rfac1 = hx * hym2 / (2.d0 * r) res(i,j) = res(i,j) - idir * fac0 * & ((rfac0 * sigmaf(is-idir,js) - rfac1 * sigmaf(is,js)) * & (fdst(i,j+jdir) - fdst(i,j)) - & rfac1 * sigmaf(is,js-jdir) * (fdst(i,j-jdir) - fdst(i,j))) end if fac0 = fac0 / ir do m = idir, idir*(ir-1), idir fac1 = (ir-abs(m)) * fac0 tmp = hxm2 * & (sigmaf(i-m-1,js) * & (fdst(i-m-1,j+jdir) - fdst(i-m,j+jdir) + & 2.d0 * (fdst(i-m-1,j) - fdst(i-m,j))) + & sigmaf(i-m,js) * & (fdst(i-m+1,j+jdir) - fdst(i-m,j+jdir) + & 2.d0 * (fdst(i-m+1,j) - fdst(i-m,j)))) res(i,j) = res(i,j) - fac1 * (tmp + hym2 * & (sigmaf(i-m-1,js) * & (fdst(i-m-1,j+jdir) - fdst(i-m-1,j) + & 2.d0 * (fdst(i-m,j+jdir) - fdst(i-m,j))) + & sigmaf(i-m,js) * & (fdst(i-m+1,j+jdir) - fdst(i-m+1,j) + & 2.d0 * (fdst(i-m,j+jdir) - fdst(i-m,j))))) if (irz .eq. 1) then r = (i - m + 0.5d0) * hx rfac0m = hx * hym2 / (2.d0 * (r - hx)) rfac1m = hx * hym2 / (2.d0 * r) res(i,j) = res(i,j) - fac1 * & (rfac0m * sigmaf(i-m-1,js) - rfac1m * sigmaf(i-m,js)) * & (fdst(i-m,j+jdir) - fdst(i-m,j)) end if end do fac0 = ir * fac0 / jr do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 tmp = hxm2 * & (sigmaf(is,j-n-1) * & (fdst(i+idir,j-n-1) - fdst(i,j-n-1) + & 2.d0 * (fdst(i+idir,j-n) - fdst(i,j-n))) + & sigmaf(is,j-n) * & (fdst(i+idir,j-n+1) - fdst(i,j-n+1) + & 2.d0 * (fdst(i+idir,j-n) - fdst(i,j-n)))) res(i,j) = res(i,j) - fac1 * (tmp + hym2 * & (sigmaf(is,j-n-1) * & (fdst(i+idir,j-n-1) - fdst(i+idir,j-n) + & 2.d0 * (fdst(i,j-n-1) - fdst(i,j-n))) + & sigmaf(is,j-n) * & (fdst(i+idir,j-n+1) - fdst(i+idir,j-n) + & 2.d0 * (fdst(i,j-n+1) - fdst(i,j-n))))) if (irz .eq. 1) then r = (is + 0.5d0) * hx rfac1 = -idir * hx * hym2 / (2.d0 * r) res(i,j) = res(i,j) - fac1 * & rfac1 *(sigmaf(is,j-n-1) * (fdst(i,j-n-1) - fdst(i,j-n)) + & sigmaf(is,j-n) * (fdst(i,j-n+1) - fdst(i,j-n))) end if end do end c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along edge subroutine hgdres_full_old( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & fdst, fdstl0, fdsth0, fdstl1, fdsth1, & cdst, cdstl0, cdsth0, cdstl1, cdsth1, & sigmaf, sfl0, sfh0, sfl1, sfh1, & sigmac, scl0, sch0, scl1, sch1, & regl0, regh0, regl1, regh1, & hx, hy, ir, jr, jdir, idd, irz, idd1) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer fdstl0, fdsth0, fdstl1, fdsth1 integer cdstl0, cdsth0, cdstl1, cdsth1 integer sfl0, sfh0, sfl1, sfh1 integer scl0, sch0, scl1, sch1 integer regl0, regh0, regl1, regh1 double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1) double precision sigmaf(sfl0:sfh0,sfl1:sfh1) double precision sigmac(scl0:sch0,scl1:sch1) double precision hx, hy integer ir, jr, jdir, irz, idd, idd1 double precision hxm2, hym2, fac0, fac1, r, rfac0, rfac1, tmp double precision rfac0m, rfac1m, rfac0p, rfac1p integer i, j, js, m, n i = regl0 j = regl1 if (jdir .eq. 1) then js = j else js = j - 1 end if hxm2 = 1.d0 / (ir * ir * hx * hx) hym2 = 1.d0 / (jr * jr * hy * hy) fac0 = (ir * jr) / (3.d0*ir*jr + 3.d0*ir + 3.d0*jr - 3.d0) res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * & (hxm2 * (sigmac(i,js-jdir) * & (cdst(i+1,j-jdir) - cdst(i,j-jdir) + & 2.d0 * (cdst(i+1,j) - cdst(i,j))) + & sigmac(i-1,js) * & (cdst(i-1,j+jdir) - cdst(i,j+jdir) + & 2.d0 * (cdst(i-1,j) - cdst(i,j)))) + & hym2 * (sigmac(i,js-jdir) * & (cdst(i+1,j-jdir) - cdst(i+1,j) + & 2.d0 * (cdst(i,j-jdir) - cdst(i,j))) + & sigmac(i-1,js) * & (cdst(i-1,j+jdir) - cdst(i-1,j) + & 2.d0 * (cdst(i,j+jdir) - cdst(i,j))))) if (irz .eq. 1) then r = (i + 0.5d0) * (hx * ir) rfac0 = ir * hx * hym2 / (2.d0 * (r - hx * ir)) rfac1 = ir * hx * hym2 / (2.d0 * r) res(i*ir,j*jr) = res(i*ir,j*jr) - fac0 * & (rfac0 * sigmac(i-1,js) * (cdst(i,j+jdir) - cdst(i,j)) - & rfac1 * sigmac(i,js-jdir) * (cdst(i,j-jdir) - cdst(i,j))) end if fac0 = fac0 / (ir * jr) hxm2 = ir * ir * hxm2 hym2 = jr * jr * hym2 i = i * ir j = j * jr if (jdir .eq. 1) then js = j else js = j - 1 end if res(i,j) = res(i,j) - fac0 * & (hxm2 * (sigmaf(i,js) * & (fdst(i+1,j+jdir) - fdst(i,j+jdir) + & 2.d0 * (fdst(i+1,j) - fdst(i,j))) + & sigmaf(i-1,js-jdir) * & (fdst(i-1,j-jdir) - fdst(i,j-jdir) + & 2.d0 * (fdst(i-1,j) - fdst(i,j)))) + & hym2 * (sigmaf(i,js) * & (fdst(i+1,j+jdir) - fdst(i+1,j) + & 2.d0 * (fdst(i,j+jdir) - fdst(i,j))) + & sigmaf(i-1,js-jdir) * & (fdst(i-1,j-jdir) - fdst(i-1,j) + & 2.d0 * (fdst(i,j-jdir) - fdst(i,j))))) if (irz .eq. 1) then r = (i + 0.5d0) * hx rfac0 = hx * hym2 / (2.d0 * (r - hx)) rfac1 = hx * hym2 / (2.d0 * r) res(i,j) = res(i,j) - fac0 * & (rfac0 * sigmaf(i-1,js-jdir) * (fdst(i,j-jdir) - fdst(i,j)) - & rfac1 * sigmaf(i,js) * (fdst(i,j+jdir) - fdst(i,j))) end if fac0 = fac0 / ir do m = 1, ir-1 fac1 = (ir-m) * fac0 tmp = hxm2 * & (sigmaf(i+m-1,js) * & (fdst(i+m-1,j+jdir) - fdst(i+m,j+jdir) + & 2.d0 * (fdst(i+m-1,j) - fdst(i+m,j))) + & sigmaf(i+m,js) * & (fdst(i+m+1,j+jdir) - fdst(i+m,j+jdir) + & 2.d0 * (fdst(i+m+1,j) - fdst(i+m,j))) + & sigmaf(i-m-1,js-jdir) * & (fdst(i-m-1,j-jdir) - fdst(i-m,j-jdir) + & 2.d0 * (fdst(i-m-1,j) - fdst(i-m,j))) + & sigmaf(i-m,js-jdir) * & (fdst(i-m+1,j-jdir) - fdst(i-m,j-jdir) + & 2.d0 * (fdst(i-m+1,j) - fdst(i-m,j)))) res(i,j) = res(i,j) - fac1 * (tmp + hym2 * & (sigmaf(i+m-1,js) * & (fdst(i+m-1,j+jdir) - fdst(i+m-1,j) + & 2.d0 * (fdst(i+m,j+jdir) - fdst(i+m,j))) + & sigmaf(i+m,js) * & (fdst(i+m+1,j+jdir) - fdst(i+m+1,j) + & 2.d0 * (fdst(i+m,j+jdir) - fdst(i+m,j))) + & sigmaf(i-m-1,js-jdir) * & (fdst(i-m-1,j-jdir) - fdst(i-m-1,j) + & 2.d0 * (fdst(i-m,j-jdir) - fdst(i-m,j))) + & sigmaf(i-m,js-jdir) * & (fdst(i-m+1,j-jdir) - fdst(i-m+1,j) + & 2.d0 * (fdst(i-m,j-jdir) - fdst(i-m,j))))) if (irz .eq. 1) then r = (i - m + 0.5d0) * hx rfac0m = hx * hym2 / (2.d0 * (r - hx)) rfac1m = hx * hym2 / (2.d0 * r) r = (i + m + 0.5d0) * hx rfac0p = hx * hym2 / (2.d0 * (r - hx)) rfac1p = hx * hym2 / (2.d0 * r) res(i,j) = res(i,j) - fac1 * & ((rfac0m * sigmaf(i-m-1,js-jdir) & - rfac1m * sigmaf(i-m,js-jdir)) * & (fdst(i-m,j-jdir) - fdst(i-m,j)) + & (rfac0p * sigmaf(i+m-1,js) - rfac1p * sigmaf(i+m,js)) * & (fdst(i+m,j+jdir) - fdst(i+m,j))) end if end do fac0 = ir * fac0 / jr do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 tmp = hxm2 * & (sigmaf(i,j+n-1) * & (fdst(i+1,j+n-1) - fdst(i,j+n-1) + & 2.d0 * (fdst(i+1,j+n) - fdst(i,j+n))) + & sigmaf(i,j+n) * & (fdst(i+1,j+n+1) - fdst(i,j+n+1) + & 2.d0 * (fdst(i+1,j+n) - fdst(i,j+n))) + & sigmaf(i-1,j-n-1) * & (fdst(i-1,j-n-1) - fdst(i,j-n-1) + & 2.d0 * (fdst(i-1,j-n) - fdst(i,j-n))) + & sigmaf(i-1,j-n) * & (fdst(i-1,j-n+1) - fdst(i,j-n+1) + & 2.d0 * (fdst(i-1,j-n) - fdst(i,j-n)))) res(i,j) = res(i,j) - fac1 * (tmp + hym2 * & (sigmaf(i,j+n-1) * & (fdst(i+1,j+n-1) - fdst(i+1,j+n) + & 2.d0 * (fdst(i,j+n-1) - fdst(i,j+n))) + & sigmaf(i,j+n) * & (fdst(i+1,j+n+1) - fdst(i+1,j+n) + & 2.d0 * (fdst(i,j+n+1) - fdst(i,j+n))) + & sigmaf(i-1,j-n-1) * & (fdst(i-1,j-n-1) - fdst(i-1,j-n) + & 2.d0 * (fdst(i,j-n-1) - fdst(i,j-n))) + & sigmaf(i-1,j-n) * & (fdst(i-1,j-n+1) - fdst(i-1,j-n) + & 2.d0 * (fdst(i,j-n+1) - fdst(i,j-n))))) if (irz .eq. 1) then r = (i + 0.5d0) * hx rfac0 = hx * hym2 / (2.d0 * (r - hx)) rfac1 = hx * hym2 / (2.d0 * r) res(i,j) = res(i,j) - fac1 * & (rfac0 * (sigmaf(i-1,j-n-1) * & (fdst(i,j-n-1) - fdst(i,j-n)) + & sigmaf(i-1,j-n) * & (fdst(i,j-n+1) - fdst(i,j-n))) - & rfac1 * (sigmaf(i,j+n-1) * (fdst(i,j+n-1) - fdst(i,j+n)) + & sigmaf(i,j+n) * (fdst(i,j+n+1) - fdst(i,j+n)))) end if end do end c----------------------------------------------------------------------- c NODE-based data, factor of 2 only. subroutine hgints_dense( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & sigx, sigy, & sbl0, sbh0, sbl1, sbh1, & src, srcl0, srch0, srcl1, srch1, & bbl0, bbh0, bbl1, bbh1, & ir, jr) integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer sbl0, sbh0, sbl1, sbh1 integer srcl0, srch0, srcl1, srch1 integer bbl0, bbh0, bbl1, bbh1 integer ir, jr double precision dest(destl0:desth0,destl1:desth1) double precision sigx(sbl0:sbh0,sbl1:sbh1) double precision sigy(sbl0:sbh0,sbl1:sbh1) double precision src(srcl0:srch0,srcl1:srch1) integer i, j, ic, jc do jc = bbl1, bbh1 do ic = bbl0, bbh0 dest(ir*ic,jr*jc) = src(ic,jc) end do end do if (ir .eq. 2) then do jc = bbl1, bbh1 do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc dest(i+1,j) = & ((sigx(i,j-1)+sigx(i,j)) * src(ic,jc) + & (sigx(i+1,j-1)+sigx(i+1,j)) * src(ic+1,jc)) / & (sigx(i,j-1)+sigx(i,j)+ & sigx(i+1,j-1)+sigx(i+1,j)) end do end do end if if (jr .eq. 2) then do jc = bbl1, bbh1-1 do ic = bbl0, bbh0 i = ir * ic j = jr * jc dest(i,j+1) = & ((sigy(i-1,j)+sigy(i,j)) * src(ic,jc) + & (sigy(i-1,j+1)+sigy(i,j+1)) * src(ic,jc+1)) / & (sigy(i-1,j)+sigy(i,j)+ & sigy(i-1,j+1)+sigy(i,j+1)) end do end do end if if (ir .eq. 2 .and. jr .eq. 2) then do jc = bbl1, bbh1-1 cdir$ ivdep do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc dest(i+1,j+1) = ((sigx(i,j) + sigx(i,j+1)) * & dest(i,j+1) + & (sigx(i+1,j) + sigx(i+1,j+1)) * & dest(i+2,j+1) + & (sigy(i,j) + sigy(i+1,j)) * & dest(i+1,j) + & (sigy(i,j+1) + sigy(i+1,j+1)) * & dest(i+1,j+2)) / & (sigx(i,j) + sigx(i,j+1) + & sigx(i+1,j) + sigx(i+1,j+1) + & sigy(i,j) + sigy(i+1,j) + & sigy(i,j+1) + sigy(i+1,j+1)) end do end do end if end c----------------------------------------------------------------------- c NODE-based data, factor of 2 only. subroutine hgints( & dest, destl0,desth0,destl1,desth1, & regl0,regh0,regl1,regh1, & signd, snl0,snh0,snl1,snh1, & src, srcl0,srch0,srcl1,srch1, & bbl0,bbh0,bbl1,bbh1, & ir, jr) integer destl0,desth0,destl1,desth1 integer regl0,regh0,regl1,regh1 integer snl0,snh0,snl1,snh1 integer srcl0,srch0,srcl1,srch1 integer bbl0,bbh0,bbl1,bbh1 integer ir, jr double precision dest(destl0:desth0,destl1:desth1) double precision signd(snl0:snh0,snl1:snh1, 2) double precision src(srcl0:srch0,srcl1:srch1) integer i, j, ic, jc do jc = bbl1, bbh1 do ic = bbl0, bbh0 dest(ir*ic,jr*jc) = src(ic,jc) end do end do if (ir .eq. 2) then do jc = bbl1, bbh1 do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc dest(i+1,j) = (signd(i,j,1) * src(ic,jc) + & signd(i+1,j,1) * src(ic+1,jc)) / & (signd(i,j,1) + signd(i+1,j,1)) end do end do end if if (jr .eq. 2) then do jc = bbl1, bbh1-1 do ic = bbl0, bbh0 i = ir * ic j = jr * jc dest(i,j+1) = (signd(i,j,2) * src(ic,jc) + & signd(i,j+1,2) * src(ic,jc+1)) / & (signd(i,j,2) + signd(i,j+1,2)) end do end do end if if (ir .eq. 2 .and. jr .eq. 2) then do jc = bbl1, bbh1-1 cdir$ ivdep do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc dest(i+1,j+1) = (signd(i,j+1,1) * dest(i,j+1) + & signd(i+1,j+1,1) * dest(i+2,j+1) + & signd(i+1,j,2) * dest(i+1,j) + & signd(i+1,j+1,2) * dest(i+1,j+2)) / & (signd(i,j+1,1) + signd(i+1,j+1,1) + & signd(i+1,j,2) + signd(i+1,j+1,2)) end do end do end if end c----------------------------------------------------------------------- c NODE-based data, factor of 2 only. subroutine hgints_old( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & signd, sbl0, sbh0, sbl1, sbh1, & src, srcl0, srch0, srcl1, srch1, & bbl0, bbh0, bbl1, bbh1, & ir, jr) integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer sbl0, sbh0, sbl1, sbh1 integer srcl0, srch0, srcl1, srch1 integer bbl0, bbh0, bbl1, bbh1 integer ir, jr double precision dest(destl0:desth0,destl1:desth1) double precision signd(sbl0:sbh0,sbl1:sbh1, 2) double precision src(srcl0:srch0,srcl1:srch1) stop 'no code for hgints (sigma node) in 2D' end c----------------------------------------------------------------------- c CELL-based data only. subroutine hgsrst( & destx, desty, & destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & srcx, srcy, & srcl0, srch0, srcl1, srch1, & ir, jr) integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer ir, jr double precision destx(destl0:desth0,destl1:desth1) double precision desty(destl0:desth0,destl1:desth1) double precision srcx(srcl0:srch0,srcl1:srch1) double precision srcy(srcl0:srch0,srcl1:srch1) integer i, j, i2, j2 if (ir .eq. 2 .and. jr .eq. 2) then do j = regl1, regh1 do i = regl0, regh0 i2 = 2 * i j2 = 2 * j destx(i,j) = 1.d0 / & (1.d0 / (srcx(i2,j2) + srcx(i2,j2+1)) + & 1.d0 / (srcx(i2+1,j2) + srcx(i2+1,j2+1))) desty(i,j) = 1.d0 / & (1.d0 / (srcy(i2,j2) + srcy(i2+1,j2)) + & 1.d0 / (srcy(i2,j2+1) + srcy(i2+1,j2+1))) end do end do else if (ir .eq. 2) then do j = regl1, regh1 do i = regl0, regh0 i2 = 2 * i destx(i,j) = 2.d0 / & (1.d0 / srcx(i2,j) + 1.d0 / srcx(i2+1,j)) desty(i,j) = 0.5d0 * (srcy(i2,j) + srcy(i2+1,j)) end do end do else do j = regl1, regh1 do i = regl0, regh0 j2 = 2 * j destx(i,j) = 0.5d0 * (srcx(i,j2) + srcx(i,j2+1)) desty(i,j) = 2.d0 / & (1.d0 / srcy(i,j2) + 1.d0 / srcy(i,j2+1)) end do end do end if end ccseapps-2.5/CCSEApps/hgproj/hg_multi2.cpp0000644000175000017500000007115311634153073021555 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "hg_multi.H" #include #if defined( BL_FORT_USE_UNDERSCORE ) #define FORT_HGFRES hgfres_ #define FORT_HGFRES_TERRAIN hgfres_terrain_ #define FORT_HGFRES_FULL hgfres_full_ #define FORT_HGERES hgeres_ #define FORT_HGERES_TERRAIN hgeres_terrain_ #define FORT_HGERES_FULL hgeres_full_ #define FORT_HGCRES hgcres_ #define FORT_HGCRES_TERRAIN hgcres_terrain_ #define FORT_HGCRES_FULL hgcres_full_ #elif defined( BL_FORT_USE_UPPERCASE ) #define FORT_HGFRES HGFRES #define FORT_HGFRES_TERRAIN HGFRES_TERRAIN #define FORT_HGFRES_FULL HGFRES_FULL #define FORT_HGERES HGERES #define FORT_HGERES_TERRAIN HGERES_TERRAIN #define FORT_HGERES_FULL HGERES_FULL #define FORT_HGCRES HGCRES #define FORT_HGCRES_TERRAIN HGCRES_TERRAIN #define FORT_HGCRES_FULL HGCRES_FULL #elif defined( BL_FORT_USE_LOWERCASE ) #define FORT_HGFRES hgfres #define FORT_HGFRES_TERRAIN hgfres_terrain #define FORT_HGFRES_FULL hgfres_full #define FORT_HGERES hgeres #define FORT_HGERES_TERRAIN hgeres_terrain #define FORT_HGERES_FULL hgeres_full #define FORT_HGCRES hgcres #define FORT_HGCRES_TERRAIN hgcres_terrain #define FORT_HGCRES_FULL hgcres_full #else #error "none of BL_FORT_USE_{UNDERSCORE,UPPERCASE,LOWERCASE} defined" #endif extern "C" { #if (BL_SPACEDIM == 1) #error not relevant #endif void FORT_HGFRES (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*, const int*); void FORT_HGFRES_FULL (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*, const int*); void FORT_HGFRES_TERRAIN(Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*, const int*); void FORT_HGCRES (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGCRES_FULL (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGCRES_TERRAIN(Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGERES (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGERES_FULL (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGERES_TERRAIN(Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*); } extern "C" { typedef void (*F_FRES) (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*, const int*); typedef void (*F_CRES) (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*); typedef void (*F_ERES) (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, CRealPS, intRS, const int*, const int*); } class task_fres : public task_fec_base { public: task_fres (F_FRES f_, task_list& tl_, MultiFab& r_, const MultiFab& s_, const MultiFab& d_, const MultiFab& sg_, int igrid_, task_fab* c_, task_fab* sc_, const Box& creg_, const Real h_[BL_SPACEDIM], const IntVect& rat_, int idim_, int idir_, int isrz); virtual bool ready (); private: void doit (); F_FRES f; const MultiFab& s; const MultiFab& d; const MultiFab& sg; const Box creg; Real h[BL_SPACEDIM]; const IntVect rat; const int idim; const int idir; const int isrz; }; task_fres::task_fres (F_FRES f_, task_list& tl_, MultiFab& r_, const MultiFab& s_, const MultiFab& d_, const MultiFab& sg_, int igrid_, task_fab* c_, task_fab* sc_, const Box& creg_, const Real h_[BL_SPACEDIM], const IntVect& rat_, int idim_, int idir_, int isrz_) : task_fec_base(tl_, r_, igrid_), f(f_), s(s_), d(d_), sg(sg_), creg(creg_), rat(rat_), idim(idim_), idir(idir_), isrz(isrz_) { push_back(c_); push_back(sc_); D_TERM(h[0] = h_[0];, h[1] = h_[1];, h[2] = h_[2];); if (is_local_target() && dependencies.empty()) doit(); } bool task_fres::ready () { BL_ASSERT(!m_finished); if (is_local_target()) doit(); return true; } void task_fres::doit () { BL_ASSERT(!m_finished); BL_ASSERT(is_local_target()); BL_ASSERT(dependencies.empty()); m_finished = true; const int igrid = grid_number(); FArrayBox& r_fab = target_fab(); const Box& r_fab_box = r_fab.box(); const FArrayBox& s_fab = s[igrid]; const Box& s_fab_box = s_fab.box(); const FArrayBox& d_fab = d[igrid]; const Box& d_fab_box = d_fab.box(); const FArrayBox& c_fab = task_fab_result(0); const Box& c_fab_box = c_fab.box(); const FArrayBox& sg_fab = sg[igrid]; const Box& sg_fab_box = sg_fab.box(); const FArrayBox& sc_fab = task_fab_result(1); const Box& sc_fab_box = sc_fab.box(); (*f)(r_fab.dataPtr(), DIMLIST(r_fab_box), s_fab.dataPtr(), DIMLIST(s_fab_box), d_fab.dataPtr(), DIMLIST(d_fab_box), c_fab.dataPtr(), DIMLIST(c_fab_box), sg_fab.dataPtr(), DIMLIST(sg_fab_box), sc_fab.dataPtr(), DIMLIST(sc_fab_box), DIMLIST(creg), D_DECL(&h[0], &h[1], &h[2]), D_DECL(rat[0], rat[1], rat[2]), &idim, &idir, &isrz); } class task_eres : public task_fec_base { public: task_eres (F_ERES f_, task_list& tl_, MultiFab& r_, const MultiFab& s_, int igrid_, task_fab* ff_, task_fab* cc_, task_fab* sigmaf_, task_fab* sigmac_, const Box& creg_, const Real h_[BL_SPACEDIM], const IntVect& rat_, const Array& ga_, const IntVect& t_); virtual bool ready (); private: void doit (); const F_ERES f; const MultiFab& s; const Box creg; Real h[BL_SPACEDIM]; const IntVect rat; Array ga; Array t; }; task_eres::task_eres (F_ERES f_, task_list& tl_, MultiFab& r_, const MultiFab& s_, int igrid_, task_fab* ff_, task_fab* cc_, task_fab* sigmaf_, task_fab* sigmac_, const Box& creg_, const Real h_[BL_SPACEDIM], const IntVect& rat_, const Array& ga_, const IntVect& t_) : task_fec_base(tl_, r_, igrid_), f(f_), s(s_), creg(creg_), rat(rat_), ga(ga_), t(BL_SPACEDIM) { push_back(ff_); push_back(cc_); push_back(sigmaf_); push_back(sigmac_); D_TERM(h[0] = h_[0];, h[1] = h_[1];, h[2] = h_[2];); D_TERM(t[0] = t_[0];, t[1] = t_[1];, t[2] = t_[2];); if (is_local_target() && dependencies.empty()) doit(); } bool task_eres::ready () { BL_ASSERT(!m_finished); if (is_local_target()) doit(); return true; } void task_eres::doit () { BL_ASSERT(!m_finished); BL_ASSERT(is_local_target()); BL_ASSERT(dependencies.empty()); m_finished = true; const int igrid = grid_number(); FArrayBox& r_fab = target_fab(); const Box& r_fab_box = r_fab.box(); const FArrayBox& s_fab = s[igrid]; const Box& s_fab_box = s_fab.box(); const FArrayBox& ff_fab = task_fab_result(0); const Box& ff_fab_box = ff_fab.box(); const FArrayBox& cc_fab = task_fab_result(1); const Box& cc_fab_box = cc_fab.box(); const FArrayBox& sigmaf_fab = task_fab_result(2); const Box& sigmaf_fab_box = sigmaf_fab.box(); const FArrayBox& sigmac_fab = task_fab_result(3); const Box& sigmac_fab_box = sigmac_fab.box(); (*f)(r_fab.dataPtr(), DIMLIST(r_fab_box), s_fab.dataPtr(), DIMLIST(s_fab_box), ff_fab.dataPtr(), DIMLIST(ff_fab_box), cc_fab.dataPtr(), DIMLIST(cc_fab_box), sigmaf_fab.dataPtr(), DIMLIST(sigmaf_fab_box), sigmac_fab.dataPtr(), DIMLIST(sigmac_fab_box), DIMLIST(creg), D_DECL(&h[0], &h[1], &h[2]), D_DECL(rat[0], rat[1], rat[2]), ga.dataPtr(), t.dataPtr()); } class task_cres : public task_fec_base { public: task_cres (F_CRES f_, task_list& tl_, MultiFab& r_, const MultiFab& s_, int igrid_, task_fab* ff_, task_fab* cc_, task_fab* sigmaf_, task_fab* sigmac_, const Box& creg_, const Real h_[BL_SPACEDIM], const IntVect& rat_, const Array& ga_, const int isrz_); virtual bool ready (); private: void doit (); F_CRES f; const MultiFab& s; const Box creg; Real h[BL_SPACEDIM]; const IntVect rat; Array ga; const int isrz; }; task_cres::task_cres (F_CRES f_, task_list& tl_, MultiFab& r_, const MultiFab& s_, int igrid_, task_fab* ff_, task_fab* cc_, task_fab* sigmaf_, task_fab* sigmac_, const Box& creg_, const Real h_[BL_SPACEDIM], const IntVect& rat_, const Array& ga_, const int isrz_) : task_fec_base(tl_, r_, igrid_), f(f_), s(s_), creg(creg_), rat(rat_), ga(ga_), isrz(isrz_) { push_back(ff_); push_back(cc_); push_back(sigmaf_); push_back(sigmac_); D_TERM(h[0] = h_[0];, h[1] = h_[1];, h[2] = h_[2];); if (is_local_target() && dependencies.empty()) doit(); } bool task_cres::ready () { BL_ASSERT(!m_finished); if (is_local_target()) doit(); return true; } void task_cres::doit () { BL_ASSERT(!m_finished); BL_ASSERT(is_local_target()); BL_ASSERT(dependencies.empty()); m_finished = true; const int igrid = grid_number(); FArrayBox& r_fab = target_fab(); const Box& r_fab_box = r_fab.box(); const FArrayBox& s_fab = s[igrid]; const Box& s_fab_box = s_fab.box(); const FArrayBox& ff_fab = task_fab_result(0); const Box& ff_fab_box = ff_fab.box(); const FArrayBox& cc_fab = task_fab_result(1); const Box& cc_fab_box = cc_fab.box(); const FArrayBox& sigmaf_fab = task_fab_result(2); const Box& sigmaf_fab_box = sigmaf_fab.box(); const FArrayBox& sigmac_fab = task_fab_result(3); const Box& sigmac_fab_box = sigmac_fab.box(); (*f)(r_fab.dataPtr(), DIMLIST(r_fab_box), s_fab.dataPtr(), DIMLIST(s_fab_box), ff_fab.dataPtr(), DIMLIST(ff_fab_box), cc_fab.dataPtr(), DIMLIST(cc_fab_box), sigmaf_fab.dataPtr(), DIMLIST(sigmaf_fab_box), sigmac_fab.dataPtr(), DIMLIST(sigmac_fab_box), DIMLIST(creg), D_DECL(&h[0], &h[1], &h[2]), D_DECL(rat[0], rat[1], rat[2]), ga.dataPtr(), &isrz); } void holy_grail_amr_multigrid::alloc_sync_caches () { if (lev_min < lev_max) { fres_fbox .resize(lev_max+1); fres_cbox .resize(lev_max+1); fres_creg .resize(lev_max+1); fres_sfbox .resize(lev_max+1); fres_scbox .resize(lev_max+1); #if (BL_SPACEDIM == 3) eres_fbox .resize(lev_max+1); eres_cbox .resize(lev_max+1); eres_creg .resize(lev_max+1); eres_sfbox .resize(lev_max+1); eres_scbox .resize(lev_max+1); #endif cres_fbox .resize(lev_max+1); cres_cbox .resize(lev_max+1); cres_creg .resize(lev_max+1); cres_sfbox .resize(lev_max+1); cres_scbox .resize(lev_max+1); } // This loop kill gcc 2.95.2 under some situations. for (int lev(lev_min + 1); lev <= lev_max; ++lev) { fres_sfbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(level_interface::FACEDIM)); fres_scbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(level_interface::FACEDIM)); fres_fbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(level_interface::FACEDIM)); fres_cbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(level_interface::FACEDIM)); fres_creg[lev] .resize(lev_interface[ml_index[lev]].nboxes(level_interface::FACEDIM)); #if (BL_SPACEDIM == 3) eres_sfbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(1)); eres_scbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(1)); eres_fbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(1)); eres_cbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(1)); eres_creg[lev] .resize(lev_interface[ml_index[lev]].nboxes(1)); #endif cres_sfbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(0)); cres_scbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(0)); cres_fbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(0)); cres_cbox[lev] .resize(lev_interface[ml_index[lev]].nboxes(0)); cres_creg[lev] .resize(lev_interface[ml_index[lev]].nboxes(0)); build_sync_cache(ml_index[lev], lev); } } void holy_grail_amr_multigrid::delete_sync_caches () { for (int lev = lev_min + 1; lev <= lev_max; ++lev) { fres_fbox[lev].clear(); fres_cbox[lev].clear(); fres_creg[lev].clear(); fres_sfbox[lev].clear(); fres_scbox[lev].clear(); #if (BL_SPACEDIM == 3) eres_fbox[lev].clear(); eres_cbox[lev].clear(); eres_creg[lev].clear(); eres_sfbox[lev].clear(); eres_scbox[lev].clear(); #endif cres_fbox[lev].clear(); cres_cbox[lev].clear(); cres_creg[lev].clear(); cres_sfbox[lev].clear(); cres_scbox[lev].clear(); } if (lev_min < lev_max) { fres_fbox.clear(); fres_cbox.clear(); fres_creg.clear(); fres_sfbox.clear(); fres_scbox.clear(); #if (BL_SPACEDIM == 3) eres_fbox.clear(); eres_cbox.clear(); eres_creg.clear(); eres_sfbox.clear(); eres_scbox.clear(); #endif cres_fbox.clear(); cres_cbox.clear(); cres_creg.clear(); cres_sfbox.clear(); cres_scbox.clear(); } } void holy_grail_amr_multigrid::build_sync_cache (int mglev, int lev) { const IntVect& rat = gen_ratio[lev-1]; const int mglevc = ml_index[lev-1]; for (int iface = 0; iface < lev_interface[mglev].nboxes(level_interface::FACEDIM); iface++) { // // Find a fine grid touching this face. // int igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 0); if (igrid < 0) igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 1); const unsigned int geo = lev_interface[mglev].geo(level_interface::FACEDIM, iface); // // Reject fine-fine interfaces and those without an interior fine grid // if ( geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(level_interface::FACEDIM, iface) ) { continue; } // // Fine grid on just one side. // const int idim = lev_interface[mglev].fdim(iface); const int idir = (geo & level_interface::LOW) ? -1 : 1; Box& fbox = fres_fbox[lev][iface]; Box& cbox = fres_cbox[lev][iface]; Box& creg = fres_creg[lev][iface]; fbox = dest[lev].box(igrid); fbox.grow(dest[lev].nGrow()); BL_ASSERT(is_remote(dest[lev], igrid) || fbox == dest[lev][igrid].box()); // fbox = dest[lev][igrid].box(); cbox = lev_interface[mglev].node_box(level_interface::FACEDIM, iface); cbox.coarsen(rat); if (idir > 0) cbox.growLo(idim, 1); else cbox.growHi(idim, 1); Box& sigmafbox = fres_sfbox[lev][iface]; Box& sigmacbox = fres_scbox[lev][iface]; sigmafbox = sigma[mglev].box(igrid); sigmafbox.grow(sigma[mglev].nGrow()); BL_ASSERT( is_remote(sigma[mglev], igrid) || sigmafbox == sigma[mglev][igrid].box()); // sigmafbox = sigma[mglev][igrid].box(); sigmacbox = cbox; sigmacbox.convert(IntVect::TheCellVector()); const IntVect t = lev_interface[mglev].box(level_interface::FACEDIM, iface).type(); creg = lev_interface[mglev].node_box(level_interface::FACEDIM, iface); creg.coarsen(rat).grow(t - 1); } #if (BL_SPACEDIM == 3) for (int iedge = 0; iedge < lev_interface[mglev].nboxes(1); iedge++) { // // Find a fine grid touching this edge. // int igrid; for (int i = 0; i < lev_interface[mglev].ngrids(1); i++) { igrid = lev_interface[mglev].grid(1, iedge, i); if (igrid >= 0) break; } const unsigned int geo = lev_interface[mglev].geo(1, iedge); // // Reject fine-fine interfaces and those without an interior fine grid // if ( geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(1, iedge) ) { continue; } Box& fbox = eres_fbox[lev][iedge]; Box& cbox = eres_cbox[lev][iedge]; Box& creg = eres_creg[lev][iedge]; const IntVect t = lev_interface[mglev].box(1, iedge).type(); cbox = lev_interface[mglev].node_box(1, iedge); cbox.coarsen(rat).grow(t); fbox = BoxLib::refine(cbox, rat); Box& sigmafbox = eres_sfbox[lev][iedge]; Box& sigmacbox = eres_scbox[lev][iedge]; sigmafbox = fbox; sigmafbox.convert(IntVect::TheCellVector()); sigmacbox = cbox; sigmacbox.convert(IntVect::TheCellVector()); creg = lev_interface[mglev].node_box(1, iedge); creg.coarsen(rat).grow(t - 1); } #endif for (int icor = 0; icor < lev_interface[mglev].nboxes(0); icor++) { // // Find a fine grid touching this corner. // int igrid; for (int i = 0; i < lev_interface[mglev].ngrids(0); i++) { igrid = lev_interface[mglev].grid(0, icor, i); if (igrid >= 0) break; } const unsigned int geo = lev_interface[mglev].geo(0, icor); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(0, icor) ) { continue; } Box& fbox = cres_fbox[lev][icor]; Box& cbox = cres_cbox[lev][icor]; Box& creg = cres_creg[lev][icor]; cbox = lev_interface[mglev].box(0, icor); fbox = lev_interface[mglev].box(0, icor); cbox.coarsen(rat).grow(1); fbox.grow(rat); Box& sigmafbox = cres_sfbox[lev][icor]; Box& sigmacbox = cres_scbox[lev][icor]; sigmafbox = fbox; sigmafbox.convert(IntVect::TheCellVector()); sigmacbox = cbox; sigmacbox.convert(IntVect::TheCellVector()); creg = lev_interface[mglev].box(0, icor); creg.coarsen(rat); } } void holy_grail_amr_multigrid::interface_residual (int mglev, int lev) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::interface_residual()"); // FIXME boundary not terrain sigma? const amr_boundary* bndry = (m_stencil==terrain) ? boundary.terrain_sigma() : boundary.scalar(); const IntVect& rat = gen_ratio[lev-1]; const int mglevc = ml_index[lev-1]; HG_TEST_NORM( resid[mglev], "interface_residual"); task_list tl; for (int iface = 0; iface < lev_interface[mglev].nboxes(level_interface::FACEDIM); iface++) { // // Find a fine grid touching this face. // int igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 0); if (igrid < 0) igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 1); const unsigned int geo = lev_interface[mglev].geo(level_interface::FACEDIM, iface); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(level_interface::FACEDIM, iface) ) continue; // // Fine grid on just one side. // const int idim = lev_interface[mglev].fdim(iface); const int idir = (geo & level_interface::LOW) ? -1 : 1; const Box& cbox = fres_cbox[lev][iface]; const Box& sigmacbox = fres_scbox[lev][iface]; task_fab* sigmac = new task_fill_patch(tl, resid[mglev], igrid, sigmacbox, sigma[mglevc], lev_interface[mglevc], bndry, -1, -1); task_fab* cdst = new task_fill_patch(tl, resid[mglev], igrid, cbox, dest[lev-1], lev_interface[mglevc], boundary.pressure(), -1, -1); const Box& creg = fres_creg[lev][iface]; if (m_stencil==terrain) { tl.add_task( new task_fres(&FORT_HGFRES_TERRAIN, tl, resid[mglev], source[lev], dest[lev], sigma[mglev], igrid, cdst, sigmac, creg, h[mglev], rat, idim, idir, 0)); } else if (m_stencil == full) { tl.add_task( new task_fres(&FORT_HGFRES_FULL, tl, resid[mglev], source[lev], dest[lev], sigma[mglev], igrid, cdst, sigmac, creg, h[mglev], rat, idim, idir, 0)); } else { const int isRZ = getCoordSys(); tl.add_task( new task_fres(&FORT_HGFRES, tl, resid[mglev], source[lev], dest[lev], sigma[mglev], igrid, cdst, sigmac, creg, h[mglev], rat, idim, idir, isRZ)); } } tl.execute("holy_grail_amr_multigrid::interface_residual(1)"); HG_TEST_NORM( resid[mglev], "interface_residual a"); #if (BL_SPACEDIM == 3) for (int iedge = 0; iedge < lev_interface[mglev].nboxes(1); iedge++) { // // Find a fine grid touching this edge. // int igrid; for (int i = 0; i < lev_interface[mglev].ngrids(1); i++) { igrid = lev_interface[mglev].grid(1, iedge, i); if (igrid >= 0) break; } const unsigned int geo = lev_interface[mglev].geo(1, iedge); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo != level_interface::ALL && igrid >= 0 && !lev_interface[mglev].flag(1, iedge) ) { const Box& fbox = eres_fbox[lev][iedge]; const Box& cbox = eres_cbox[lev][iedge]; const Box& sigmafbox = eres_sfbox[lev][iedge]; const Box& sigmacbox = eres_scbox[lev][iedge]; task_fab* sigmaf = new task_fill_patch(tl, resid[mglev], igrid, sigmafbox, sigma[mglev], lev_interface[mglev], bndry, 1, iedge); task_fab* sigmac = new task_fill_patch(tl, resid[mglev], igrid, sigmacbox, sigma[mglevc], lev_interface[mglevc], bndry, -1, -1); const Box& creg = eres_creg[lev][iedge]; const IntVect t = lev_interface[mglev].box(1, iedge).type(); task_fab* fdst = new task_fill_patch(tl, resid[mglev], igrid, fbox, dest[lev], lev_interface[mglev], boundary.pressure(), 1, iedge); task_fab* cdst = new task_fill_patch(tl, resid[mglev], igrid, cbox, dest[lev-1], lev_interface[mglevc], boundary.pressure(), -1, -1); Array ga = lev_interface[mglev].geo_array(1, iedge); task::task_proxy tp; if (m_stencil==terrain) { tp = tl.add_task( new task_eres(&FORT_HGERES_TERRAIN, tl, resid[mglev], source[lev], igrid, fdst, cdst, sigmaf, sigmac, creg, h[mglev], rat, ga, t)); } else if ( m_stencil == full ) { tp = tl.add_task( new task_eres(&FORT_HGERES_FULL, tl, resid[mglev], source[lev], igrid, fdst, cdst, sigmaf, sigmac, creg, h[mglev], rat, ga, t)); } else { tp = tl.add_task( new task_eres(&FORT_HGERES, tl, resid[mglev], source[lev], igrid, fdst, cdst, sigmaf, sigmac, creg, h[mglev], rat, ga, t)); } // // Fill in the grids on the other sides, if any. // const Box& freg = lev_interface[mglev].node_box(1, iedge); for (int i = 1; i < lev_interface[mglev].ngrids(1); i++) { const int jgrid = lev_interface[mglev].grid(1, iedge, i); if (jgrid >= 0 && jgrid != igrid) { tl.add_task( new task_copy(tl, resid[mglev], jgrid, resid[mglev], igrid, freg, tp)); } } } } tl.execute("holy_grail_amr_multigrid::interface_residual(2)"); HG_TEST_NORM( resid[mglev], "interface_residual b"); #endif for (int icor = 0; icor < lev_interface[mglev].nboxes(0); icor++) { // // Find a fine grid touching this corner. // int igrid; for (int i = 0; i < lev_interface[mglev].ngrids(0); i++) { igrid = lev_interface[mglev].grid(0, icor, i); if (igrid >= 0) break; } const unsigned int geo = lev_interface[mglev].geo(0, icor); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo != level_interface::ALL && igrid >= 0 && !lev_interface[mglev].flag(0, icor) ) { const Box& fbox = cres_fbox[lev][icor]; const Box& cbox = cres_cbox[lev][icor]; const Box& sigmafbox = cres_sfbox[lev][icor]; const Box& sigmacbox = cres_scbox[lev][icor]; task_fab* sigmaf = new task_fill_patch(tl, resid[mglev], igrid, sigmafbox, sigma[mglev], lev_interface[mglev], bndry, 0, icor); task_fab* sigmac = new task_fill_patch(tl, resid[mglev], igrid, sigmacbox, sigma[mglevc], lev_interface[mglevc], bndry, -1, -1); const Box& creg = cres_creg[lev][icor]; task_fab* fdst = new task_fill_patch(tl, resid[mglev], igrid, fbox, dest[lev], lev_interface[mglev], boundary.pressure(), 0, icor); task_fab* cdst = new task_fill_patch(tl, resid[mglev], igrid, cbox, dest[lev-1], lev_interface[mglevc], boundary.pressure(), -1, -1); Array ga = lev_interface[mglev].geo_array(0, icor); task::task_proxy tp; if (m_stencil==terrain) { tp = tl.add_task( new task_cres(&FORT_HGCRES_TERRAIN, tl, resid[mglev], source[lev], igrid, fdst, cdst, sigmaf, sigmac, creg, h[mglev], rat, ga, 0)); } else if (m_stencil == full) { tp = tl.add_task( new task_cres(&FORT_HGCRES_FULL, tl, resid[mglev], source[lev], igrid, fdst, cdst, sigmaf, sigmac, creg, h[mglev], rat, ga, 0)); } else { const int isrz = getCoordSys(); tp = tl.add_task( new task_cres(&FORT_HGCRES, tl, resid[mglev], source[lev], igrid, fdst, cdst, sigmaf, sigmac, creg, h[mglev], rat, ga, isrz)); } // // Fill in the grids on the other sides, if any. // const Box& freg = lev_interface[mglev].box(0, icor); for (int i = 1; i < lev_interface[mglev].ngrids(0); i++) { const int jgrid = lev_interface[mglev].grid(0, icor, i); if (jgrid >= 0 && jgrid != igrid) { tl.add_task(new task_copy(tl, resid[mglev], jgrid, resid[mglev], igrid, freg, tp)); } } } } tl.execute("holy_grail_amr_multigrid::interface_residual(3)"); HG_TEST_NORM( resid[mglev], "interface_residual c"); HG_TEST_NORM( resid[mglev], "interface_residual end"); } ccseapps-2.5/CCSEApps/hgproj/hg_multi3.cpp0000644000175000017500000006066011634153073021557 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "hg_multi.H" #include #if defined( BL_FORT_USE_UNDERSCORE ) #define FORT_HGRES hgres_ #define FORT_HGRES_TERRAIN hgres_terrain_ #define FORT_HGRES_FULL hgres_full_ #define FORT_HGRESU hgresu_ #define FORT_HGRESUR hgresur_ #define FORT_HGRLX hgrlx_ #define FORT_HGRLX_TERRAIN hgrlx_terrain_ #define FORT_HGRLX_FULL hgrlx_full_ #define FORT_HGRLXU hgrlxu_ #define FORT_HGRLXUR hgrlxur_ #define FORT_HGRLXL hgrlxl_ #define FORT_HGRLXL_FULL hgrlxl_full_ #define FORT_HGRLNF hgrlnf_ #define FORT_HGRLNF_TERRAIN hgrlnf_terrain_ #define FORT_HGRLNF_FULL hgrlnf_full_ #define FORT_HGRLNB hgrlnb_ #define FORT_HGCG hgcg_ #define FORT_HGCG1 hgcg1_ #define FORT_HGCG2 hgcg2_ #define FORT_HGIP hgip_ #elif defined( BL_FORT_USE_UPPERCASE ) #define FORT_HGRES HGRES #define FORT_HGRES_TERRAIN HGRES_TERRAIN #define FORT_HGRES_FULL HGRES_FULL #define FORT_HGRESU HGRESU #define FORT_HGRESUR HGRESUR #define FORT_HGRLX HGRLX #define FORT_HGRLX_TERRAIN HGRLX_TERRAIN #define FORT_HGRLX_FULL HGRLX_FULL #define FORT_HGRLXU HGRLXU #define FORT_HGRLXUR HGRLXUR #define FORT_HGRLXL HGRLXL #define FORT_HGRLXL_FULL HGRLXL_FULL #define FORT_HGRLNF HGRLNF #define FORT_HGRLNF_TERRAIN HGRLNF_TERRAIN #define FORT_HGRLNF_FULL HGRLNF_FULL #define FORT_HGRLNB HGRLNB #define FORT_HGCG HGCG #define FORT_HGCG1 HGCG1 #define FORT_HGCG2 HGCG2 #define FORT_HGIP HGIP #elif defined( BL_FORT_USE_LOWERCASE ) #define FORT_HGRES hgres #define FORT_HGRES_TERRAIN hgres_terrain #define FORT_HGRES_FULL hgres_full #define FORT_HGRESU hgresu #define FORT_HGRESUR hgresur #define FORT_HGRLX hgrlx #define FORT_HGRLX_TERRAIN hgrlx_terrain #define FORT_HGRLX_FULL hgrlx_full #define FORT_HGRLXU hgrlxu #define FORT_HGRLXUR hgrlxur #define FORT_HGRLXL hgrlxl #define FORT_HGRLXL_FULL hgrlxl_full #define FORT_HGRLNF hgrlnf #define FORT_HGRLNF_TERRAIN hgrlnf_terrain #define FORT_HGRLNF_FULL hgrlnf_full #define FORT_HGRLNB hgrlnb #define FORT_HGCG hgcg #define FORT_HGCG1 hgcg1 #define FORT_HGCG2 hgcg2 #define FORT_HGIP hgip #else #error "none of BL_FORT_USE_{UNDERSCORE,UPPERCASE,LOWERCASE} defined" #endif extern "C" { #if (BL_SPACEDIM == 1) #error not relevant #endif void FORT_HGRES_TERRAIN (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS); void FORT_HGRLX_TERRAIN (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS); void FORT_HGRLNF_TERRAIN(Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, intS, const int*, const int*); #if (BL_SPACEDIM==3) void FORT_HGRES_FULL (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS); void FORT_HGRESU (Real*, intS, const Real*, const Real*, const Real*, const Real*, intS, const int*); void FORT_HGRESUR (Real*, intS, const Real*, const Real*, const Real*, intS, const int*); void FORT_HGRLX (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS); void FORT_HGRLX_FULL (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS); void FORT_HGRLXU (Real*, const Real*, const Real*, const Real*, intS, const Real*, intS, const int*); void FORT_HGRLXUR (Real*, const Real*, const Real*, const Real*, intS, intS, const int*); void FORT_HGRLXL (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, intS, const int*); void FORT_HGRLNF (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, intS, const int*, const int*); void FORT_HGRLNF_FULL (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS, intS, const int*, const int*); #else void FORT_HGRES (Real*, intS, const Real*, intS, const Real*, intS, CRealPS, intS, intS, CRealPS, const int* ); void FORT_HGRES_FULL (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS); void FORT_HGRESU (Real*, intS, const Real*, const Real*, const Real*, const Real*, intS, const int*); void FORT_HGRESUR (Real*, intS, const Real*, const Real*, const Real*, intS, const int*); void FORT_HGRLX (Real*, intS, const Real*, intS, CRealPS, intS, const Real*, intS, intS, CRealPS, const int*, const int*); void FORT_HGRLX_FULL (Real*, intS, const Real*, intS, const Real*, intS, const Real*, intS, intS); void FORT_HGRLXU (Real*, const Real*, const Real*, const Real*, intS, const Real*, intS, const int*); void FORT_HGRLXUR (Real*, const Real*, const Real*, const Real*, intS, intS, const int*); void FORT_HGRLXL (Real*, intS, const Real*, intS, CRealPS, intS, Real*, intS, intS, intS, CRealPS, const int*, const int*, const int*); void FORT_HGRLXL_FULL (Real*, intS, const Real*, intS, CRealPS, intS, Real*, intS, intS, intS, CRealPS, const int*, const int*, const int*); void FORT_HGRLNF (Real*, intS, const Real*, intS, const Real*, intS, CRealPS, intS, Real*, intS, intS, intS, CRealPS, const int*, const int*, const int*, const int*); void FORT_HGRLNF_FULL (Real*, intS, const Real*, intS, const Real*, intS, CRealPS, intS, Real*, intS, intS, intS, CRealPS, const int*, const int*, const int*, const int*); #endif void FORT_HGRLNB (Real*, intS, Real*, intS, intS, const int*, const int*); void FORT_HGCG1 (Real*, const Real*, Real*, Real*, const Real*, const Real*, const Real*, intS, const Real&, Real&); void FORT_HGCG2 (Real*, const Real*, intS, const Real&); void FORT_HGIP (const Real*, const Real*, const Real*, intS, Real&); } void holy_grail_amr_multigrid::level_residual (MultiFab& r, MultiFab& s, MultiFab& d, int mglev, bool iclear, int for_fill_sync_reg) { BL_ASSERT(mglev >= 0); BL_ASSERT(r.boxArray() == s.boxArray()); BL_ASSERT(r.boxArray() == d.boxArray()); HG_TEST_NORM(d, "level_residual a"); fill_borders(d, lev_interface[mglev], mg_boundary, -1, is_dense(m_stencil)); HG_TEST_NORM(d, "level_residual a1"); HG_TEST_NORM(s, "level_residual"); HG_TEST_NORM(r, "level_residual"); if ( m_stencil == terrain || m_stencil == full ) { HG_TEST_NORM(sigma[mglev], "level_residual"); for (MFIter r_mfi(r); r_mfi.isValid(); ++r_mfi) { const Box& rbox = r[r_mfi].box(); const Box& sbox = s[r_mfi].box(); const Box& dbox = d[r_mfi].box(); const Box& cenbox = cen[mglev][r_mfi].box(); const Box& sigbox = sigma[mglev][r_mfi].box(); Box freg = (for_fill_sync_reg > 0) ? BoxLib::surroundingNodes(mg_mesh[mglev][r_mfi.index()]) : Box(lev_interface[mglev].part_fine(r_mfi.index())); if ( m_stencil == terrain ) { FORT_HGRES_TERRAIN(r[r_mfi].dataPtr(), DIMLIST(rbox), s[r_mfi].dataPtr(), DIMLIST(sbox), d[r_mfi].dataPtr(), DIMLIST(dbox), sigma[mglev][r_mfi].dataPtr(), DIMLIST(sigbox), cen[mglev][r_mfi].dataPtr(), DIMLIST(cenbox), DIMLIST(freg)); } else if ( m_stencil == full ) { FORT_HGRES_FULL(r[r_mfi].dataPtr(), DIMLIST(rbox), s[r_mfi].dataPtr(), DIMLIST(sbox), d[r_mfi].dataPtr(), DIMLIST(dbox), sigma[mglev][r_mfi].dataPtr(), DIMLIST(sigbox), cen[mglev][r_mfi].dataPtr(), DIMLIST(cenbox), DIMLIST(freg)); } } if (iclear) { clear_part_interface(r, lev_interface[mglev]); } } else if (m_stencil == cross) { const int isRZ = getCoordSys(); HG_TEST_NORM(sigma_node[mglev], "level_residual"); HG_TEST_NORM(mask[mglev], "level_residual"); for (MFIter r_mfi(r); r_mfi.isValid(); ++r_mfi) { const Box& rbox = r[r_mfi].box(); Box freg = (for_fill_sync_reg > 0) ? BoxLib::surroundingNodes(mg_mesh[mglev][r_mfi.index()]) : Box(lev_interface[mglev].part_fine(r_mfi.index())); #if 1 FORT_HGRESU(r[r_mfi].dataPtr(), DIMLIST(rbox), s[r_mfi].dataPtr(), d[r_mfi].dataPtr(), sigma_node[mglev][r_mfi].dataPtr(), mask[mglev][r_mfi].dataPtr(), DIMLIST(freg), &isRZ); #else FORT_HGRESUR(r[r_mfi].dataPtr(), DIMLIST(rbox), s[r_mfi].dataPtr(), d[r_mfi].dataPtr(), sigma_node[mglev][r_mfi].dataPtr(), DIMLIST(freg), &isRZ); #endif } } HG_TEST_NORM(r, "level_residual: out"); } void holy_grail_amr_multigrid::relax (int mglev, int i1, bool is_zero) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::relax()"); Box tdom = mg_domain[mglev]; tdom.convert(IntVect::TheNodeVector()); HG_TEST_NORM(corr[mglev], "relax corr a"); HG_TEST_NORM(resid[mglev], "relax resid a"); HG_TEST_NORM(cen[mglev], "relax cen a"); HG_TEST_NORM(sigma[mglev], "relax sigma a"); HG_DEBUG_OUT( "relax: i1 = " << i1 << "is_zero = " << is_zero << std::endl ); for (int icount = 0; icount < i1; icount++) { HG_DEBUG_OUT( "icount = " << icount << std::endl ); if (smoother_mode == 0 || smoother_mode == 1 || line_solve_dim == -1) { if (is_zero == false) fill_borders(corr[mglev], lev_interface[mglev], mg_boundary, -1, is_dense(m_stencil)); else is_zero = false; HG_TEST_NORM(corr[mglev], "relax corr b"); for (MFIter r_mfi(resid[mglev]); r_mfi.isValid(); ++r_mfi) { const Box& sbox = resid[mglev][r_mfi].box(); const Box& freg = lev_interface[mglev].part_fine(r_mfi.index()); if (line_solve_dim == -1) { // // Gauss-Seidel section: // if (m_stencil == terrain || m_stencil == full ) { const Box& fbox = corr[mglev][r_mfi].box(); const Box& cenbox = cen[mglev][r_mfi].box(); const Box& sigbox = sigma[mglev][r_mfi].box(); if ( m_stencil == terrain ) { FORT_HGRLX_TERRAIN( corr[mglev][r_mfi].dataPtr(), DIMLIST(fbox), resid[mglev][r_mfi].dataPtr(), DIMLIST(sbox), sigma[mglev][r_mfi].dataPtr(), DIMLIST(sigbox), cen[mglev][r_mfi].dataPtr(), DIMLIST(cenbox), DIMLIST(freg)); } else { FORT_HGRLX_FULL( corr[mglev][r_mfi].dataPtr(), DIMLIST(fbox), resid[mglev][r_mfi].dataPtr(), DIMLIST(sbox), sigma[mglev][r_mfi].dataPtr(), DIMLIST(sigbox), cen[mglev][r_mfi].dataPtr(), DIMLIST(cenbox), DIMLIST(freg)); } } else if (m_stencil == cross) { const int isRZ = getCoordSys(); #if 1 FORT_HGRLXU(corr[mglev][r_mfi].dataPtr(), resid[mglev][r_mfi].dataPtr(), sigma_node[mglev][r_mfi].dataPtr(), cen[mglev][r_mfi].dataPtr(), DIMLIST(sbox), mask[mglev][r_mfi].dataPtr(), DIMLIST(freg), &isRZ); #else FORT_HGRLXUR(corr[mglev][r_mfi].dataPtr(), resid[mglev][r_mfi].dataPtr(), sigma_node[mglev][r_mfi].dataPtr(), cen[mglev][r_mfi].dataPtr(), DIMLIST(sbox), DIMLIST(freg), &isRZ); #endif } } else { BoxLib::Abort( "holy_grail_amr_multigrid::relax():" "line solves not implemented" ); // // Grid-by-grid line solve section: // #if HG_CAN_DO_LINE_SOLVES if(m_stencil == terrain || m_stencil == full ) { BoxLib::Abort( "holy_grail_amr_multigrid::relax():" "Terrain line solves not implemented" ); } const Box& fbox = corr[mglev][r_mfi].box(); const Box& cenbox = cen[mglev][r_mfi].box(); if (m_stencil == cross) { #if BL_SPACEDIM==2 const Real hxyz[BL_SPACEDIM] = { D_DECL(h[mglev][0], h[mglev][1], h[mglev][2]) }; const Box& sigbox = sigma_nd[0][mglev][r_mfi].box(); const int isRZ = getCoordSys(); const int imax = mg_domain[mglev].bigEnd(0) + 1; FORT_HGRLXL( corr[mglev][r_mfi].dataPtr(), DIMLIST(fbox), resid[mglev][r_mfi].dataPtr(), DIMLIST(sbox), D_DECL(sigma_nd[0][mglev][r_mfi].dataPtr(), sigma_nd[1][mglev][r_mfi].dataPtr(), sigma_nd[2][mglev][r_mfi].dataPtr()), DIMLIST(sigbox), cen[mglev][r_mfi].dataPtr(), DIMLIST(cenbox), DIMLIST(freg), DIMLIST(tdom), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2]), &isRZ, &imax, &line_solve_dim); #else const Box& sigbox = sigma_node[mglev][r_mfi].box(); FORT_HGRLXL( corr[mglev][r_mfi].dataPtr(), DIMLIST(fbox), resid[mglev][r_mfi].dataPtr(), DIMLIST(sbox), sigma_node[mglev][r_mfi].dataPtr(), DIMLIST(sigbox), cen[mglev][r_mfi].dataPtr(), DIMLIST(cenbox), DIMLIST(freg), DIMLIST(tdom), &line_solve_dim); #endif } else { #if BL_SPACEDIM!=3 const Real hxyz[BL_SPACEDIM] = { D_DECL(h[mglev][0], h[mglev][1], h[mglev][2]) }; const Box& sigbox = sigma_nd[0][mglev][r_mfi].box(); const int isRZ = getCoordSys(); const int imax = mg_domain[mglev].bigEnd(0) + 1; #if (BL_SPACEDIM==2) FORT_HGRLXL_FULL( corr[mglev][r_mfi].dataPtr(), DIMLIST(fbox), resid[mglev][r_mfi].dataPtr(), DIMLIST(sbox), D_DECL(sigma_nd[0][mglev][r_mfi].dataPtr(), sigma_nd[1][mglev][r_mfi].dataPtr(), sigma_nd[2][mglev][r_mfi].dataPtr()), DIMLIST(sigbox), cen[mglev][r_mfi].dataPtr(), DIMLIST(cenbox), DIMLIST(freg), DIMLIST(tdom), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2]), &isRZ, &imax, &line_solve_dim); #else FORT_HGRLXL( corr[mglev][r_mfi].dataPtr(), DIMLIST(fbox), resid[mglev][r_mfi].dataPtr(), DIMLIST(sbox), D_DECL(sigma_nd[0][mglev][r_mfi].dataPtr(), sigma_nd[1][mglev][r_mfi].dataPtr(), sigma_nd[2][mglev][r_mfi].dataPtr()), DIMLIST(sigbox), cen[mglev][r_mfi].dataPtr(), DIMLIST(cenbox), DIMLIST(freg), DIMLIST(tdom), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2])); #endif #endif } #endif /* HG_CAN_DO_LINE_SOLVES */ } } HG_TEST_NORM(corr[mglev], "relax corr b1"); sync_borders(corr[mglev], lev_interface[mglev], mg_boundary); HG_TEST_NORM(corr[mglev], "relax corr b2"); } else { BoxLib::Abort( "holy_grail_amr_multigrid::relax():" "Line Solves aren't parallelized" ); #ifdef HG_CAN_DO_LINE_SOLVES // // Full-level line solve section: // if (line_order.length() == 0) { build_line_order(line_solve_dim); } int lev = lev_min; while (ml_index[lev] < mglev) { lev++; } for (int ipass = 0; ipass <= 1; ipass++) { if (is_zero == false) fill_borders(corr[mglev], lev_interface[mglev], mg_boundary, -1, is_dense(m_stencil)); else is_zero = false; // // Forward solve: // task_list tl; for (int i = 0; i < mg_mesh[mglev].length(); i++) { // // Do grids in order along line_solve_dim: // int igrid = line_order[lev][i]; const Box& fbox = corr[mglev][igrid].box(); const Box& sbox = resid[mglev][igrid].box(); const Box& wbox = work[mglev][igrid].box(); const Box& cenbox = cen[mglev][igrid].box(); const Box& freg = corr[mglev].box(igrid); if (m_stencil == terrain || m_stencil == full ) { const Box& sigbox = sigma[mglev][igrid].box(); if ( m_stencil == terrain ) { FORT_HGRLNF_TERRAIN( corr[mglev][igrid].dataPtr(), DIMLIST(fbox), resid[mglev][igrid].dataPtr(), DIMLIST(sbox), work[mglev][igrid].dataPtr(), DIMLIST(wbox), sigma[mglev][igrid].dataPtr(), DIMLIST(sigbox), cen[mglev][igrid].dataPtr(), DIMLIST(cenbox), DIMLIST(freg), DIMLIST(tdom), &line_solve_dim, &ipass); } else if ( m_stencil == full ) { FORT_HGRLNF_FULL( corr[mglev][igrid].dataPtr(), DIMLIST(fbox), resid[mglev][igrid].dataPtr(), DIMLIST(sbox), work[mglev][igrid].dataPtr(), DIMLIST(wbox), sigma[mglev][igrid].dataPtr(), DIMLIST(sigbox), cen[mglev][igrid].dataPtr(), DIMLIST(cenbox), DIMLIST(freg), DIMLIST(tdom), &line_solve_dim, &ipass); } } else if (m_stencil == cross) { #if BL_SPACEDIM == 2 const Real hxyz[BL_SPACEDIM] = { D_DECL(h[mglev][0], h[mglev][1], h[mglev][2]) }; const int isRZ = getCoordSys(); const int imax = mg_domain[mglev].bigEnd(0) + 1; const Box& sigbox = sigma_nd[0][mglev][igrid].box(); FORT_HGRLNF( corr[mglev][igrid].dataPtr(), DIMLIST(fbox), resid[mglev][igrid].dataPtr(), DIMLIST(sbox), work[mglev][igrid].dataPtr(), DIMLIST(wbox), D_DECL( sigma_nd[0][mglev][igrid].dataPtr(), sigma_nd[1][mglev][igrid].dataPtr(), sigma_nd[2][mglev][igrid].dataPtr()), DIMLIST(sigbox), cen[mglev][igrid].dataPtr(), DIMLIST(cenbox), DIMLIST(freg), DIMLIST(tdom), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2]), &isRZ, &imax, &line_solve_dim, &ipass); #else const Box& sigbox = sigma_node[mglev][igrid].box(); FORT_HGRLNF_TERRAIN( corr[mglev][igrid].dataPtr(), DIMLIST(fbox), resid[mglev][igrid].dataPtr(), DIMLIST(sbox), work[mglev][igrid].dataPtr(), DIMLIST(wbox), sigma_node[mglev][igrid].dataPtr(), DIMLIST(sigbox), cen[mglev][igrid].dataPtr(), DIMLIST(cenbox), DIMLIST(freg), DIMLIST(tdom), &line_solve_dim, &ipass); #endif } // // Copy work arrays to following grids: // for (ListIterator j(line_after[lev][igrid]); j; j++) { const int jgrid = j(); const Box b = (freg & corr[mglev].box(jgrid)); tl.add_task( new task_copy_link(corr[mglev], jgrid, igrid, b, 0)); tl.add_task( new task_copy_link(work[mglev], jgrid, igrid, b, 0)); } } tl.execute("holy_grail_amr_multigrid::relax(1)"); // // Back substitution: // for (int i = mg_mesh[mglev].length() - 1; i >= 0; i--) { // // Do grids in reverse order along line_solve_dim: // const int igrid = line_order[lev][i]; const Box& freg = corr[mglev].box(igrid); // // Copy solution array from following grids: // for (ListIterator j(line_after[lev][igrid]); j; j++) { const int jgrid = j(); const Box b = (freg & corr[mglev].box(jgrid)); tl.add_task( new task_copy_link(corr[mglev], igrid, jgrid, b, 0)); } const Box& fbox = corr[mglev][igrid].box(); const Box& wbox = work[mglev][igrid].box(); FORT_HGRLNB( corr[mglev][igrid].dataPtr(), DIMLIST(fbox), work[mglev][igrid].dataPtr(), DIMLIST(wbox), DIMLIST(freg), &line_solve_dim, &ipass); } tl.execute("holy_grail_amr_multigrid::relax(2)"); } #endif /* HG_CAN_DO_LINE_SOLVES */ } } HG_TEST_NORM(corr[mglev], "relax a1"); } void holy_grail_amr_multigrid::build_line_order (int lsd) { line_order.resize(lev_max + 1); line_after.resize(lev_max + 1); for (int lev = lev_min; lev <= lev_max; lev++) { int mglev = ml_index[lev], ngrids = mg_mesh[mglev].size(); line_order[lev].resize(ngrids); line_after[lev].resize(ngrids); for (int igrid = 0; igrid < ngrids; igrid++) { line_order[lev].set(igrid, igrid); // // bubble sort, replace with something faster if necessary: // for (int i = igrid; i > 0; i--) { if (ml_mesh[lev][line_order[lev][i]].smallEnd(lsd) < ml_mesh[lev][line_order[lev][i-1]].smallEnd(lsd)) { int tmp = line_order[lev][i-1]; line_order[lev][i-1] = line_order[lev][i]; line_order[lev][i] = tmp; } else { break; } } for (int i = 0; i < ngrids; i++) { if (BoxLib::bdryLo(ml_mesh[lev][i], lsd).intersects(BoxLib::bdryHi(ml_mesh[lev][igrid], lsd))) { line_after[lev][igrid].push_back(i); } } } } } void holy_grail_amr_multigrid::cgsolve (int mglev) { BL_ASSERT(mglev == 0); MultiFab& r = cgwork[0]; MultiFab& p = cgwork[1]; MultiFab& z = cgwork[2]; MultiFab& x = cgwork[3]; MultiFab& w = cgwork[4]; MultiFab& c = cgwork[5]; MultiFab& zero_array = cgwork[6]; MultiFab& ipmask = cgwork[7]; // // x (corr[0]) should be all 0.0 at this point // for (MFIter r_mfi(r); r_mfi.isValid(); ++r_mfi) { r[r_mfi].copy(resid[mglev][r_mfi]); r[r_mfi].negate(); } if (singular) { // // Singular systems are very sensitive to solvability // w.setVal(1.0); Real aa = inner_product(r, w) / mg_domain[mglev].volume(); r.plus(-aa, 0); } Real rho = 0.0; for (MFIter r_mfi(r); r_mfi.isValid(); ++r_mfi) { z[r_mfi].copy(r[r_mfi]); z[r_mfi].mult(c[r_mfi]); const Box& reg = p[r_mfi].box(); FORT_HGIP(z[r_mfi].dataPtr(), r[r_mfi].dataPtr(), ipmask[r_mfi].dataPtr(), DIMLIST(reg), rho); p[r_mfi].copy(z[r_mfi]); } ParallelDescriptor::ReduceRealSum(rho); if ( pcode >= 3 && ParallelDescriptor::IOProcessor() ) { std::cout << "HG: cgsolve rho = " << rho << std::endl; } const Real tol = HG::cgsolve_tolfact * rho; int i = 0; while (tol > 0.0) { if ( ++i > HG::cgsolve_maxiter && ParallelDescriptor::IOProcessor() ) { BoxLib::Error( "cgsolve:" "Conjugate-gradient iteration failed to converge" ); } Real rho_old = rho; // // safe to set the clear flag to 0 here---bogus values make it // into r but are cleared from z by the mask in c // level_residual(w, zero_array, p, 0, false, 0); Real alpha = 0.0; for (MFIter p_mfi(p); p_mfi.isValid(); ++p_mfi) { const Box& reg = p[p_mfi].box(); FORT_HGIP(p[p_mfi].dataPtr(), w[p_mfi].dataPtr(), ipmask[p_mfi].dataPtr(), DIMLIST(reg), alpha); } ParallelDescriptor::ReduceRealSum(alpha); alpha = rho / alpha; rho = 0.0; for (MFIter r_mfi(r); r_mfi.isValid(); ++r_mfi) { const Box& reg = p[r_mfi].box(); FORT_HGCG1(r[r_mfi].dataPtr(), p[r_mfi].dataPtr(), z[r_mfi].dataPtr(), x[r_mfi].dataPtr(), w[r_mfi].dataPtr(), c[r_mfi].dataPtr(), ipmask[r_mfi].dataPtr(), DIMLIST(reg), alpha, rho); } ParallelDescriptor::ReduceRealSum(rho); if (pcode >= 3 && ParallelDescriptor::IOProcessor()) { std::cout << "HG: cgsolve iter(" << i << ") rho=" << rho << std::endl; } if (rho <= tol) break; alpha = rho / rho_old; for (MFIter p_mfi(p); p_mfi.isValid(); ++p_mfi) { const Box& reg = p[p_mfi].box(); FORT_HGCG2(p[p_mfi].dataPtr(),z[p_mfi].dataPtr(),DIMLIST(reg),alpha); } } if (pcode >= 2 && ParallelDescriptor::IOProcessor()) { std::cout << "HG: " << i << " iterations required for conjugate-gradient" << std::endl; } } ccseapps-2.5/CCSEApps/hgproj/RegType.H0000644000175000017500000000342411634153073020643 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _RegType_H_ #define _RegType_H_ enum RegType { interior, exterior, periodic, refWall, inflow, outflow, REG_TYPE_SIZE }; inline RegType RegTypeSet(const std::string& ass) { if ( ass == "interior" ) return interior ; if ( ass == "exterior" ) return exterior ; if ( ass == "periodic" ) return periodic ; if ( ass == "refWall" ) return refWall ; if ( ass == "inflow" ) return inflow ; if ( ass == "outflow" ) return outflow ; return REG_TYPE_SIZE; } #endif /*_RegType_H_*/ ccseapps-2.5/CCSEApps/hgproj/interface.H0000644000175000017500000001476711634153073021240 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _INTERFACE_H_ #define _INTERFACE_H_ #include "amr_defs.H" class amr_boundary; class level_interface { public: #if (BL_SPACEDIM == 2) enum { ALL = 0xF, LOW = 0x01 }; #else enum { ALL = 0xFF, LOW = 0x01 }; #endif enum { FACEDIM = BL_SPACEDIM-1 }; level_interface() ; ~level_interface (); // // A pseudo constructor. // void alloc (const BoxArray& Im, const Box& Domain, const amr_boundary* Bdy); // // Two pseudo copy operators/constructors. // void copy (const level_interface& src); void alloc_coarsened (const BoxArray& Im, const amr_boundary* Bdy, const level_interface& src, const IntVect& rat); bool ok () const; const Box& domain () const; const BoxArray& interior_mesh () const; const BoxArray& exterior_mesh () const; int exterior_ref (int igrid) const; int direct_exterior_ref (int igrid) const; const Box& part_fine (int i) const; Array geo_array (int idim, int i) const; int grid (int idim, int i, int j) const; int fdim (int i) const; int nboxes (int idim) const; const Box& box (int idim, int i) const; const Box& node_box (int idim, int i) const; unsigned int geo (int idim, int i) const; int aux (int idim, int i) const; bool flag (int idim, int i) const; static int ngrids (int idim); private: #if (BL_SPACEDIM == 2) enum { N_FACE_GRIDS = 2, N_CORNER_GRIDS = 4 }; #elif (BL_SPACEDIM == 3) enum { N_FACE_GRIDS = 2, N_EDGE_GRIDS = 4, N_CORNER_GRIDS = 8 }; #endif int status; // tells if some arrays are shared Box dom; // BoxArray doesn't know domain BoxArray im; // interior BoxArray BoxArray em; // exterior BoxArray int* grid_ref; // one for each exterior box Box* pf; // expanded NODE boxes for interior grids int nbx[BL_SPACEDIM]; // numbers of interface boxes Box* bx[BL_SPACEDIM]; // array of interface boxes unsigned int* ge[BL_SPACEDIM]; // geometries of interface boxes int* ax[BL_SPACEDIM]; // if >= 0, gives the number of the // grid which must be cleared of bogus data along this edge, corner, // or face after computing on the part_fine section of that grid bool* flg[BL_SPACEDIM]; // flags dirichlet bdys int* fdm; // which is flat dim for this face Box* nodebx[BL_SPACEDIM]; // node-based versions of interface boxes int (*fgr)[N_FACE_GRIDS]; // grid neighbor data for faces #if BL_SPACEDIM==3 int (*egr)[N_EDGE_GRIDS]; // grid neighbor data for edges #endif int (*cgr)[N_CORNER_GRIDS]; // grid neighbor data for corners void add (std::list& bl, Box b, int startgrid); void xfer (const std::list& bl, int idim); private: // // Not defined. // level_interface (const level_interface&); void operator= (const level_interface&); }; extern const level_interface default_level_interface; inline level_interface::level_interface() : status(-1) {} inline bool level_interface::ok () const { return (status >= 0); } inline const Box& level_interface::domain () const { return dom; } inline const BoxArray& level_interface::interior_mesh () const { return im; } inline const BoxArray& level_interface::exterior_mesh () const { return em; } inline int level_interface::exterior_ref (int igrid) const { BL_ASSERT(igrid < -1); return grid_ref[-2-igrid]; } inline int level_interface::direct_exterior_ref (int igrid) const { BL_ASSERT(igrid > -1); return grid_ref[ igrid]; } inline const Box& level_interface::part_fine (int i) const { return pf[i]; } inline int level_interface::grid (int idim, int i, int j) const { BL_ASSERT(idim >= 0 && idim <= FACEDIM); BL_ASSERT(j >= 0 && i >= 0); int ret; switch(idim) { case FACEDIM: BL_ASSERT(j < N_FACE_GRIDS && i < nboxes(FACEDIM)); ret = fgr[i][j]; break; #if BL_SPACEDIM == 3 case 1 : BL_ASSERT(j < N_EDGE_GRIDS && i < nboxes(1)); ret = egr[i][j]; break; #endif case 0 : BL_ASSERT(j < N_CORNER_GRIDS && i < nboxes(0)); ret = cgr[i][j]; break; } return ret; } inline int level_interface::ngrids(int idim) { BL_ASSERT(idim >= 0 && idim <= FACEDIM); int ret; switch(idim) { case FACEDIM: ret = N_FACE_GRIDS; break; #if BL_SPACEDIM == 3 case 1: ret = N_EDGE_GRIDS; break; #endif case 0: ret = N_CORNER_GRIDS; break; } return ret; } inline int level_interface::fdim (int i) const { return fdm[i]; } inline int level_interface::nboxes (int idim) const { return nbx[idim]; } inline const Box& level_interface::box (int idim, int i) const { return bx[idim][i]; } inline const Box& level_interface::node_box (int idim, int i) const { return nodebx[idim][i]; } inline unsigned int level_interface::geo (int idim, int i) const { return ge[idim][i]; } inline int level_interface::aux (int idim, int i) const { return ax[idim][i]; } inline bool level_interface::flag (int idim, int i) const { return flg[idim][i]; } #endif /*_INTERFACE_H_*/ ccseapps-2.5/CCSEApps/hgproj/proj.cpp0000644000175000017500000005062711634153073020640 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "hg_projector.H" #include #include #include #include #include #include #include #include #include #ifndef WIN32 #include #endif // bool HG_is_debugging = false; void projtest(const Array& m, Array& ratio, Array& domain); void driver(const char* filename); int pcode = 4; int nrep = 1; Real tol = 2.e-10; int coordsys = 0; RegType bcall = refWall; RegType bc00; RegType bc10; RegType bc20; RegType bc01; RegType bc11; RegType bc21; holy_grail_amr_multigrid::stencil hg_stencil = holy_grail_amr_multigrid::cross; int main(int argc, char **argv) { BoxLib::Initialize(argc,argv); ParmParse pp; HG_is_debugging = true; HG_is_debugging = false; HG::MPI_init(); #ifndef WIN32 int slp = 0; pp.query("sleep", slp); if ( slp > 0 ) { std::cout << "going to sleep for " << slp << " seconds, debug pid = " << ::getpid() << std::endl; ::sleep(slp); } #endif std::string ass; if ( pp.query("bcall", ass) ) bcall = RegTypeSet(ass); bc00 = bc10 = bc20 = bc01 = bc11 = bc21 = bcall; if ( pp.query("bc00", ass) ) bc00 = RegTypeSet(ass); if ( pp.query("bc10", ass) ) bc10 = RegTypeSet(ass); if ( pp.query("bc20", ass) ) bc20 = RegTypeSet(ass); if ( pp.query("bc01", ass) ) bc01 = RegTypeSet(ass); if ( pp.query("bc11", ass) ) bc11 = RegTypeSet(ass); if ( pp.query("bc21", ass) ) bc21 = RegTypeSet(ass); pp.query("nrep", nrep); pp.query("pcode", pcode); pp.query("tol", tol); pp.query("coordsys", coordsys); std::string stencil; pp.query("stencil", stencil); if ( stencil == "cross" ) { hg_stencil = holy_grail_amr_multigrid::cross; } else if ( stencil == "terrain" ) { hg_stencil = holy_grail_amr_multigrid::terrain; } else if ( stencil == "full" ) { hg_stencil = holy_grail_amr_multigrid::full; } else { BoxLib::Error("stencil must be cross, terrain, or full"); } if ( ParallelDescriptor::IOProcessor() ) { std::cout << "nrep = " << nrep << std::endl; std::cout << "pcode = " << pcode << std::endl; std::cout << "tol = " << tol << std::endl; } std::cout << std::setprecision(15); int num = pp.countname("file"); for ( int k = 0; k < num; k++) { std::string filename; pp.getkth("file", k, filename, 0); if ( ParallelDescriptor::IOProcessor() ) { std::cout << "file " << k << " is " << filename << std::endl; } driver(filename.c_str()); } if (CArena* arena = dynamic_cast(BoxLib::The_Arena())) { // // A barrier to make sure our output follows that of RunStats. // ParallelDescriptor::Barrier(); // // We're using a CArena -- output some FAB memory stats. // // This'll output total # of bytes of heap space in the Arena. // // It's actually the high water mark of heap space required by FABs. // char buf[256]; sprintf(buf, "CPU(%d): Heap Space (bytes) used by Coalescing FAB Arena: %ld", ParallelDescriptor::MyProc(), arena->heap_space_used()); std::cout << buf << std::endl; } HG::MPI_finish(); BoxLib::Finalize(); return 0; } void driver(const char *filename) { Array m; Array ratio; Array domain; std::fstream grid; grid.open(filename, std::ios::in); if ( grid.fail() ) { BoxLib::Warning("Failed to open grid file"); return; } amr_multigrid::mesh_read(m, ratio, domain, grid); grid.close(); projtest(m, ratio, domain); } void init(PArray u[], PArray& p, const Array& m, const Array& ratio) { #if (BL_SPACEDIM == 2) for (int ilev = 0; ilev < m.size(); ilev++) { u[0][ilev].setVal(0.0); u[1][ilev].setVal(0.0); } if (m.size() == 1) { for (MFIter u_mfi(u[0][0]); u_mfi.isValid(); ++u_mfi) { u[0][0][u_mfi](m[0][u_mfi.index()].smallEnd() + IntVect(2,2)) = 3.0; } } else if (m.size() == 2) { for (MFIter u_mfi(u[0][1]); u_mfi.isValid(); ++u_mfi) { u[0][1][u_mfi](m[1][u_mfi.index()].smallEnd() + IntVect(2,2)) = 3.0; } if (hg_stencil != holy_grail_amr_multigrid::terrain) { if ( is_local(u[0][0], 0) ) u[0][0][0](IntVect(2,2)) = 3.0; } else { if ( is_local(u[0][0], 0) ) u[0][0][0](IntVect(2,2)) = 3.0; } } else if (m.size() == 3) { for (MFIter u_mfi(u[0][1]); u_mfi.isValid(); ++u_mfi) { u[0][2][u_mfi](m[2][u_mfi.index()].smallEnd() + IntVect(2,2)) = 3.0; } } else { for (int ilev = 0; ilev < m.size(); ilev++) { for ( MFIter u_mfi(u[0][ilev]); u_mfi.isValid(); ++u_mfi) { u[0][ilev][u_mfi].setVal(0.0, m[ilev][u_mfi.index()], 0); u[1][ilev][u_mfi].setVal(0.0, m[ilev][u_mfi.index()], 0); } } if ( is_local(u[0][2], 0) ) { u[0][m.size()-1][0](m[m.size()-1][0].smallEnd() + IntVect(2,2)) = 3.0; } // for gr2ann } for (int ilev = 0; ilev < p.size(); ilev++) { p[ilev].setVal(0.0); } #else for (int ilev = 0; ilev < m.size(); ilev++) { u[0][ilev].setVal(0.0); u[1][ilev].setVal(0.0); u[2][ilev].setVal(0.0); } if (m.size() == 1) { //int ioff = m[0].domain().length(0) / 8; int ioff = 2; for (MFIter u_mfi(u[0][0]); u_mfi.isValid(); ++u_mfi) { u[0][0][u_mfi](m[0][u_mfi.index()].smallEnd() + IntVect(ioff,ioff,ioff)) = 3.0; } } else if (m.size() == 2) { int ioff = 2; for (MFIter u_mfi(u[0][1]); u_mfi.isValid(); ++u_mfi) { u[0][1][u_mfi](m[1][u_mfi.index()].smallEnd() + IntVect(ioff,ioff,ioff)) = 3.0; } if ( is_local(u[0][0], 0) ) u[0][0][0](IntVect(1,1,1)) = 3.0; } else if (m.size() == 3) { int ioff = 2; for ( MFIter u_mfi(u[0][2]); u_mfi.isValid(); ++u_mfi) { u[0][2][u_mfi](m[2][u_mfi.index()].smallEnd() + IntVect(ioff,ioff,ioff)) = 3.0; } } for (int ilev = 0; ilev < m.size(); ilev++) { p[ilev].setVal(0.0); } #endif } #if (BL_SPACEDIM == 2) void hb93_test1(PArray u[], const Array& m, const Array& d) { for (int ilev = 0 ; ilev < m.size() ; ilev++) { double h = 1.0 / d[ilev].length(0); double pi = 3.14159265358979323846; for ( MFIter u_mfi(u[0][ilev]); u_mfi.isValid(); ++u_mfi) { int igrid = u_mfi.index(); for (int i = m[ilev][igrid].smallEnd(0); i <= m[ilev][igrid].bigEnd(0); i++) { for (int j = m[ilev][igrid].smallEnd(1); j <= m[ilev][igrid].bigEnd(1); j++) { double x = (i + 0.5) * h; double y = (j + 0.5) * h; u[0][ilev][u_mfi](IntVect(i,j)) = -0.5*(1.0-cos(2*pi*x))*sin(2*pi*y); u[1][ilev][u_mfi](IntVect(i,j)) = 0.5*(1.0-cos(2*pi*y))*sin(2*pi*x); } } } } } void linear_test(PArray u[], const Array& m, const Array& d) { for (int ilev = 0 ; ilev < m.size() ; ilev++) { double h = 1.0 / d[ilev].length(0); for ( MFIter u_mfi(u[0][ilev]); u_mfi.isValid(); ++u_mfi) { int igrid = u_mfi.index(); for (int i = m[ilev][igrid].smallEnd(0); i <= m[ilev][igrid].bigEnd(0); i++) { for (int j = m[ilev][igrid].smallEnd(1); j <= m[ilev][igrid].bigEnd(1); j++) { double x = (i + 0.5) * h; // double y = (j + 0.5) * h; u[0][ilev][u_mfi](IntVect(i,j)) = 0.0; u[1][ilev][u_mfi](IntVect(i,j)) = x; } } } } } void rz_adj(PArray u[], PArray& rhs, PArray& rhoinv, const Array& m, const Array& d) { for (int ilev = 0 ; ilev < m.size() ; ilev++) { double h = 1.0 / d[ilev].length(0); // double pi = 3.14159265358979323846; for ( MFIter u_mfi(u[1][ilev]); u_mfi.isValid(); ++u_mfi) { int igrid = u_mfi.index(); for (int i = m[ilev][igrid].smallEnd(0); i <= m[ilev][igrid].bigEnd(0); i++) { for (int j = m[ilev][igrid].smallEnd(1) - 1; j <= m[ilev][igrid].bigEnd(1); j++) { double x = (i + 0.5) * h; u[1][ilev][u_mfi](IntVect(i,j)) *= x; if (j >= m[ilev][igrid].smallEnd(1)) rhoinv[ilev][igrid](IntVect(i,j)) *= x; } } } } } #endif void projtest(const Array& m, Array& ratio, Array& domain) { // Note: For terrain and full problems, h is ignored. Geometry crse_geom(domain[0]); Real h[BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; i++) { h[i] = 1; } RegType bc[BL_SPACEDIM][2]; bc[0][0] = bc00; bc[1][0] = bc10; bc[0][1] = bc01; bc[1][1] = bc11; #if BL_SPACEDIM==3 bc[2][0] = bc20; bc[2][1] = bc21; #endif // bc[1][0] = refWall; // bc[1][1] = refWall; // bc[0][0] = refWall; // bc[0][1] = refWall; // bc[2][0] = periodic; // bc[2][1] = periodic; // bc[1][0] = inflow; // bc[1][1] = outflow; PArray u[BL_SPACEDIM]; PArray p, rhoinv, rhs; for (int i = 0; i < BL_SPACEDIM; i++) { u[i].resize(m.size()); } p.resize(m.size()); rhoinv.resize(m.size()); rhs.resize(m.size()); for (int ilev = 0; ilev < m.size(); ilev++) { const BoxArray& cmesh = m[ilev]; BoxArray nmesh = cmesh; nmesh.convert(IndexType(IntVect::TheNodeVector())); for (int i = 0; i < BL_SPACEDIM; i++) { u[i].set(ilev, new MultiFab(cmesh, 1, 1)); } p.set(ilev, new MultiFab(nmesh, 1, 1)); if (hg_stencil == holy_grail_amr_multigrid::terrain) { rhoinv.set(ilev, new MultiFab(cmesh, 2*BL_SPACEDIM-1, 0)); rhoinv[ilev].setVal(1.0); if ( true ) { rhoinv[ilev].setVal(0.0, BL_SPACEDIM, BL_SPACEDIM-1); } else { #if (BL_SPACEDIM == 2) rhoinv[ilev].setVal(0.2, 2, 1); #else rhoinv[ilev].setVal(0.2, 3, 1); rhoinv[ilev].setVal(0.5, 4, 1); #endif } } else if ( hg_stencil == holy_grail_amr_multigrid::full ) { rhoinv.set(ilev, new MultiFab(cmesh, BL_SPACEDIM, 0)); rhoinv[ilev].setVal(1.0); } else { rhoinv.set(ilev, new MultiFab(cmesh, 1, 0)); rhoinv[ilev].setVal(1.0); } rhs.set(ilev, new MultiFab(nmesh, 1, 1)); //rhs.set(ilev, new MultiFab(cmesh, 1, 1)); rhs[ilev].setVal(0.0); } if (hg_stencil == holy_grail_amr_multigrid::terrain) { // Adjust sigmas using refinement ratio information. // Assume spacing on level 0 already incorporated into values assigned above. // (h is ignored.) IntVect rat = IntVect::TheUnitVector(); for (int ilev = 1; ilev < m.size(); ilev++) { rat *= ratio[ilev-1]; #if (BL_SPACEDIM == 2) rhoinv[ilev].mult(Real(rat[0]) / rat[1], 0, 1); rhoinv[ilev].mult(Real(rat[1]) / rat[0], 1, 1); // component 2 remains unchanged #else rhoinv[ilev].mult(Real(rat[0]) / (rat[1] * rat[2]), 0, 1); rhoinv[ilev].mult(Real(rat[1]) / (rat[0] * rat[2]), 1, 1); rhoinv[ilev].mult(Real(rat[2]) / (rat[0] * rat[1]), 2, 1); rhoinv[ilev].mult(1.0 /rat[1] , 3, 1); rhoinv[ilev].mult(1.0 /rat[0] , 4, 1); #endif } } else if (hg_stencil == holy_grail_amr_multigrid::full) { // Adjust sigmas using refinement ratio information. // Assume spacing on level 0 already incorporated into values assigned above. // (h is ignored.) IntVect rat = IntVect::TheUnitVector(); for (int ilev = 1; ilev < m.size(); ilev++) { rat *= ratio[ilev-1]; #if (BL_SPACEDIM == 2) rhoinv[ilev].mult(Real(rat[0]) / rat[1], 0, 1); rhoinv[ilev].mult(Real(rat[1]) / rat[0], 1, 1); // component 2 remains unchanged #else rhoinv[ilev].mult(Real(rat[0]) / (rat[1] * rat[2]), 0, 1); rhoinv[ilev].mult(Real(rat[1]) / (rat[0] * rat[2]), 1, 1); rhoinv[ilev].mult(Real(rat[2]) / (rat[0] * rat[1]), 2, 1); #endif } } init(u, p, m, ratio); for(int ilev = 0; ilev < m.size(); ilev++) { HG_TEST_NORM( rhoinv[ilev], "proj"); HG_TEST_NORM(p[ilev], "proj"); for ( int i = 0; i < BL_SPACEDIM; ++i) { HG_TEST_NORM( u[i][ilev], "proj"); } } #if (BL_SPACEDIM == 2) //hb93_test1(u, m); //linear_test(u, m, domain); //rhs[1][0](IntVect(16,51)) = 100.0; //rhs[1][0](IntVect(16,50)) = 100.0; //rhs[0][0](IntVect(24,32)) = 100.0; //rhs[1][0](IntVect(30,40)) = -100.0; //rhs[0][0](IntVect(4,13)) = 100.0; //rhs[0][0](IntVect(20,90)) = 100.0; #else //rhs[1][0](IntVect(16,20,40)) = 100.0; //rhs[1][0](IntVect(16,20,21)) = 100.0; #endif /* u[0].assign(0.0); u[1].assign(-980.0); //Box bb(0,27,63,36); Box bb(27,0,36,63); //Box bb(26,0,37,63); for (ilev = 0; ilev < m.size(); ilev++) { for (int igrid = 0; igrid < m[ilev].size(); igrid++) { rhoinv[ilev][igrid].assign(100.0, (bb & m[ilev][igrid])); } } */ /* #if (BL_SPACEDIM == 2) //Box bb(6,6,11,11); Box bb(0,0,5,5); //Box bb(0,0,6,7); #else Box bb(IntVect(0,0,0),IntVect(8,8,8)); #endif for (ilev = 0; ilev < m.size(); ilev++) { Box b = refine(bb, m[ilev].sig()/16); for (int igrid = 0; igrid < m[ilev].size(); igrid++) { rhoinv[ilev][igrid].assign(1000.0, (b & m[ilev][igrid])); //rhoinv[ilev][igrid].assign(1.0, (b & m[ilev][igrid])); } } */ /* Box bb(0,1,1,4); for (ilev = 0; ilev < m.size(); ilev++) { Box b = refine(bb, m[ilev].sig()/8); for (int igrid = 0; igrid < m[ilev].size(); igrid++) { rhoinv[ilev][igrid].assign(1000.0, (b & m[ilev][igrid])); } } */ /* Layer //Box bb(0,1,1,4); Box bb(0,0,63,4); for (ilev = 0; ilev < m.size(); ilev++) { Box b = refine(bb, m[ilev].sig()/32); for (int igrid = 0; igrid < m[ilev].size(); igrid++) { rhoinv[ilev][igrid].assign(0.00001, (b & m[ilev][igrid])); } } */ /* Drop Box bbb(16,6,19,9); for (ilev = 0; ilev < m.size(); ilev++) { Box b = refine(bbb, m[ilev].sig()/32); for (int igrid = 0; igrid < m[ilev].size(); igrid++) { rhoinv[ilev][igrid].assign(0.00001, (b & m[ilev][igrid])); } } */ int sum = 0; if ( ParallelDescriptor::IOProcessor() ) { std::cout << "Cells by level: "; for (int ilev = 0; ilev < m.size(); ilev++) { int lsum = 0; for (int i = 0; i < m[ilev].size(); i++) { lsum += m[ilev][i].numPts(); } std::cout << " " << lsum; sum += lsum; } std::cout << "\nTotal cells: " << sum << std::endl; } double t0, t1, t2; #ifdef UNICOS //int pcode = 1, nrep = 8; // int pcode = 1, nrep = 1; // Real tol = 1.e-6; //Real tol = 2.e-10; #else // int pcode = 4, nrep = 1; //Real tol = 1.e-14; //int pcode = 1, nrep = 3; //Real tol = 1.e-6; // for vd tests in May, and most code validation tests: // Real tol = 2.e-10; //Real tol = 5.e-9; #endif t0 = BoxLib::second(); inviscid_fluid_boundary afb(bc); holy_grail_amr_projector proj(m, ratio, domain[m.size() - 1], 0, m.size() - 1, m.size() - 1, afb, hg_stencil, pcode); #if BL_SPACEDIM == 2 if ( coordsys == amr_multigrid::rz && hg_stencil == holy_grail_amr_multigrid::cross) { rz_adj(u, rhs, rhoinv, m, domain); proj.setCoordSys(amr_multigrid::rz); } #endif //proj.smoother_mode = 1; //proj.line_solve_dim = BL_SPACEDIM - 1; //proj.line_solve_dim = -1; if (m.size() == 1) { t1 = BoxLib::second(); proj.project(u, p, null_amr_real, rhoinv, 0, 0, crse_geom, h, tol); for (int i = 1; i < nrep; i++) { init(u, p, m, ratio); proj.project(u, p, null_amr_real, rhoinv, 0, 0, crse_geom, h, tol); } t2 = BoxLib::second(); for(int i = 0; i < BL_SPACEDIM; ++i ) { HG_TEST_NORM( u[i][0], "proj"); } if ( ParallelDescriptor::IOProcessor() ) { std::cout << "Init time was " << t1 - t0 << std::endl; std::cout << "Proj time was " << t2 - t1 << std::endl; std::cout << "Speed was " << double(t2 - t1) / (nrep * sum) << std::endl; } if ( false ) { std::cout << std::setprecision(16); for(int i = 0; i < BL_SPACEDIM; ++i) { std::cout << "uvm"[i] << "min = " << u[i][0].min(0) << ", " << "uvw"[i] << "max = " << u[i][0].max(0) << std::endl; } std::cout << std::setprecision(6); } } else if (m.size() == 2) { double t00, t01, t10, t11, t20, t21; #if 1 init(u, p, m, ratio); t00 = BoxLib::second(); proj.project(u, p, null_amr_real, rhoinv, 0, 0, crse_geom, h, tol, 1, 1); t01 = BoxLib::second(); #endif for (int i = 0; i < p.size(); i++) { p[i].setVal(0.0); } init(u, p, m, ratio); t10 = BoxLib::second(); proj.project(u, p, null_amr_real, rhoinv, 0, 0, crse_geom, h, tol, 0, 1); for (int i = 1; i < nrep; i++) { init(u, p, m, ratio); proj.project(u, p, null_amr_real, rhoinv, 0, 0, crse_geom, h, tol, 0, 1); } t11 = BoxLib::second(); for(int i = 0; i < BL_SPACEDIM; ++i ) { HG_TEST_NORM( u[i][0], "proj"); } if ( ParallelDescriptor::IOProcessor() ) { std::cout << "Level proj time is " << t01 - t00 << std::endl; std::cout << "Sync proj time is " << t11 - t10 << std::endl; } /* for (i = m[1][0].smallEnd(1); i <= m[1][0].bigEnd(1)+1; i++) { std::cout << p[1][0](IntVect(0, i)) << std::endl; } proj.project(u, p, null_amr_real, rhoinv, h, tol, 1, 1); for (i = m[1][0].smallEnd(1); i <= m[1][0].bigEnd(1)+1; i++) { std::cout << p[1][0](IntVect(0, i)) << std::endl; } */ } else if (m.size() == 3) { double t00, t01, t10, t11, t20, t21; init(u, p, m, ratio); t00 = BoxLib::second(); proj.project(u, p, null_amr_real, rhoinv, 0, 0, crse_geom, h, tol, 2, 2); t01 = BoxLib::second(); for (int i = 0; i < p.size(); i++) { p[i].setVal(0.0); } init(u, p, m, ratio); t10 = BoxLib::second(); proj.project(u, p, null_amr_real, rhoinv, 0, 0, crse_geom, h, tol, 1, 2); t11 = BoxLib::second(); for (int i = 0; i < p.size(); i++) { p[i].setVal(0.0); } init(u, p, m, ratio); t20 = BoxLib::second(); proj.project(u, p, null_amr_real, rhoinv, 0, 0, crse_geom, h, tol, 0, 2); t21 = BoxLib::second(); for(int i = 0; i < BL_SPACEDIM; ++i ) { HG_TEST_NORM( u[i][0], "proj"); } if ( ParallelDescriptor::IOProcessor() ) { std::cout << "First time is " << t01 - t00 << std::endl; std::cout << "Second time is " << t11 - t10 << std::endl; std::cout << "Third time is " << t21 - t20 << std::endl; std::cout << "Total time (counting inits) was " << t21 - t00 << std::endl; } } else { proj.make_it_so(); proj.manual_project(u, p, null_amr_real, rhs, rhoinv, 0, 0, crse_geom, true, h, tol, 0, 3); t1 = BoxLib::second(); for(int i = 0; i < BL_SPACEDIM; ++i ) { HG_TEST_NORM( u[i][0], "proj"); } std::cout << "First time is " << t1 - t0 << std::endl; } /* if (m.size() < 3) { for (i = 0; i < p.size(); i++) p[i].setVal(0.0); holy_grail_amr_projector proj(m, 0, m.size() - 1, afb, pcode); proj.project(u, p, null_amr_real, rhoinv, h, 1.e-14); t2 = BoxLib::second(); std::cout << "Second time is " << t2 - t1 << std::endl; std::cout << "Total time was " << t2 - t0 << std::endl; } */ for (int ilev = 0; ilev < m.size(); ilev++) { for (int i = 0; i < BL_SPACEDIM; i++) { delete u[i].remove(ilev); } delete rhoinv.remove(ilev); delete p.remove(ilev); delete rhs.remove(ilev); } } ccseapps-2.5/CCSEApps/hgproj/amr_multi.H0000644000175000017500000001472711634153073021265 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _AMR_MULTI_H_ #define _AMR_MULTI_H_ #include "fill_patch.H" class amr_multigrid { public: amr_multigrid (const Array& Mesh, const Array& Gen_ratio, int Lev_min_min, int Lev_min_max, int Lev_max_max, const amr_boundary* Boundary, int Pcode) ; virtual ~amr_multigrid (); #if BL_SPACEDIM==2 enum CoordSys { cartesian = 0, rz = 1 }; #else enum CoordSys { cartesian = 0 }; #endif CoordSys setCoordSys (CoordSys c_sys_); CoordSys getCoordSys () const; static void mesh_read (Array& m, Array& r, Array& d, std::istream& is); static void mesh_write (const Array& m, const Array& d, std::ostream& os); static void mesh_write (const Array& m, const Array& r, Box fd, std::ostream& os); void solve (Real reltol, Real abstol, int i1, int i2); virtual void mg_interpolate_level (int lto, int lfrom) = 0; virtual void mg_restrict_level (int lto, int lfrom) = 0; virtual void level_residual (MultiFab& r, MultiFab& s, MultiFab& d, int mglev, bool iclear, int for_sync_resid) = 0; virtual void interface_residual (int mglev, int mgc) = 0; virtual void relax (int mglev, int i1, bool is_zero) = 0; virtual void cgsolve (int mglev) = 0; protected: Real ml_cycle (int lev, int mglev, int i1, int i2, Real tol, Real res_norm_fine); void mg_cycle (int mglev, int i1, int i2); Real ml_residual (int mglev, int lev); void build_index (); int get_amr_level (int mglev) const ; // // All of these have built-in defaults except can_coarsen(). // void build_mesh (const Box& fdomain); int build_down (const BoxArray& l_mesh, const Box& l_domain, int flev, IntVect rat, int nlev); void make_coarser_level (BoxArray& mesh, Box& domain, int& flev, IntVect& rat); // // Before using the multigrid, a derived class must call build_mesh() // followed by alloc(), or their equivalents. The intended use is // that build_mesh() be called by the derived class constructor, while // alloc(), which actually creates large data objects, and clear(), // which deletes them, be called when the solver is actually being used. // These are made non-virtual so that a derived class can define a more // complicated lev_interface. // void alloc_amr_multi (PArray& Dest, PArray& Source, PArray& Coarse_source, int Lev_min, int Lev_max); void clear_amr_multi (); virtual void sync_interfaces () = 0; virtual bool can_coarsen (const BoxArray& mesh, const Box& domain) const = 0; // // The data. // const int lev_min_min; const int lev_min_max; const int lev_max_max; int lev_min; int lev_max; int mglev_max; Array gen_ratio; // assoc with ml_mesh Array ml_index; // assoc with ml_mesh Array mg_domain; // assoc with mg_mesh Array ml_mesh; Array mg_mesh; Array< Array > mg_domain_array; Array< Array > mg_mesh_array; const amr_boundary* mg_boundary; level_interface* lev_interface; PArray source; // on active levels of ml_mesh PArray dest; PArray resid; // on mg_mesh PArray corr; PArray work; PArray save; // on middle levels of ml_mesh PArray coarse_source; // on ml_mesh, if it exists CoordSys c_sys; int pcode; int integrate; private: level_interface** interface_array; }; #endif /*_AMR_MULTI_H_*/ ccseapps-2.5/CCSEApps/hgproj/machinefile.mpi0000644000175000017500000000001111634153073022113 0ustar amckinstryamckinstrygodzilla ccseapps-2.5/CCSEApps/hgproj/hg_multi.H0000644000175000017500000001115711634153073021076 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _HG_MULTI_H_ #define _HG_MULTI_H_ #include "amr_multi.H" class holy_grail_amr_multigrid : public amr_multigrid { public: enum stencil { terrain = 0, full = 1, cross = 2 }; static bool is_dense(stencil sval); holy_grail_amr_multigrid(const Array& Mesh, const Array& Gen_ratio, const Box& fdomain, int Lev_min_min, int Lev_min_max, int Lev_max_max, const amr_fluid_boundary& Boundary, stencil stencil_, int Pcode); void set_line_solve_dimension(int dim); void set_smoother_mode(int mode); protected: void alloc_hg_multi(PArray& Dest, PArray& Source, PArray& Coarse_source, PArray& Sigma, Real H[], int Lev_min, int Lev_max, int for_fill_sync_reg); void sync_resid_clear(); void clear_hg_multi(); void build_line_order(int lsd); void build_sigma(PArray& Sigma, int for_fill_sync_reg); void build_sigma_for_fill_sync_reg(PArray& Sigma, int for_fill_sync_reg); void alloc_sync_caches(); void delete_sync_caches(); void build_sync_cache(int mglev, int lev); // all these inherited in some form from amr_multigrid virtual bool can_coarsen(const BoxArray& mesh, const Box& domain) const; virtual void sync_interfaces(); // special case for periodic cleanup at the end: void sync_periodic_interfaces(); virtual void mg_interpolate_level(int lto, int lfrom); virtual void mg_restrict_level(int lto, int lfrom); virtual void interface_residual(int mglev, int lev); virtual void level_residual(MultiFab& r, MultiFab& s, MultiFab& d, int mglev, bool iclear, int for_fill_sync_reg); virtual void relax(int mglev, int i1, bool is_zero); virtual void cgsolve(int mglev); void mg_restrict(int lto, int lfrom); private: holy_grail_amr_multigrid(const holy_grail_amr_multigrid&); void operator=(const holy_grail_amr_multigrid&); protected: // these are mutually exclusive, should be a switch. // full stencil not implemented in 3D. stencil m_stencil; int smoother_mode; int line_solve_dim; const amr_fluid_boundary& boundary; PArray sigma; PArray sigma_nd[BL_SPACEDIM]; PArray sigma_node; PArray cen; Real (*h)[BL_SPACEDIM]; PArray mask; // lives on mg_mesh PArray cgwork; // all 8 components live on coarsest level bool singular; bool source_owned; // sync caches: Array< Array > fres_fbox; Array< Array > fres_cbox; Array< Array > fres_sfbox; Array< Array > fres_scbox; Array< Array > fres_creg; #if (BL_SPACEDIM == 3) Array< Array > eres_fbox; Array< Array > eres_cbox; Array< Array > eres_sfbox; Array< Array > eres_scbox; Array< Array > eres_creg; #endif Array< Array > cres_fbox; Array< Array > cres_cbox; Array< Array > cres_sfbox; Array< Array > cres_scbox; Array< Array > cres_creg; // // Orderings for full-level line solves: // Array< Array > line_order; Array< Array< std::list > > line_after; }; #endif /*_HG_MULTI_H_*/ ccseapps-2.5/CCSEApps/hgproj/fill_patch.cpp0000644000175000017500000007446511634153073022001 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "fill_patch.H" #include #if defined( BL_FORT_USE_UNDERSCORE ) #define FORT_FIPRODC iprodc_ #define FORT_FIPRODN iprodn_ #elif defined( BL_FORT_USE_UPPERCASE ) #define FORT_FIPRODC IPRODC #define FORT_FIPRODN IPRODN #elif defined( BL_FORT_USE_LOWERCASE ) #define FORT_FIPRODC iprodc #define FORT_FIPRODN iprodn #else #error "none of BL_FORT_USE_{UNDERSCORE,UPPERCASE,LOWERCASE} defined" #endif extern "C" { void FORT_FIPRODC(const Real*, intS, const Real*, intS, intS, Real*); void FORT_FIPRODN(const Real*, intS, const Real*, intS, intS, Real*); } Real inner_product (const MultiFab& r, const MultiFab& s) { BL_ASSERT(r.ok() && s.ok()); BL_ASSERT(r.nComp() == 1); BL_ASSERT(s.nComp() == 1); BL_ASSERT(type(r) == type(s)); Real sum = 0.0; if (type(r) == IntVect::TheCellVector()) { for (MFIter rcmfi(r); rcmfi.isValid(); ++rcmfi) { const Box& rbox = r[rcmfi].box(); const Box& sbox = s[rcmfi].box(); const Box& reg = rcmfi.validbox(); FORT_FIPRODC(r[rcmfi].dataPtr(), DIMLIST(rbox), s[rcmfi].dataPtr(), DIMLIST(sbox), DIMLIST(reg), &sum); } } else if (type(r) == IntVect::TheNodeVector()) { for (MFIter rcmfi(r); rcmfi.isValid(); ++rcmfi) { const Box& rbox = r[rcmfi].box(); const Box& sbox = s[rcmfi].box(); const Box& reg = rcmfi.validbox(); FORT_FIPRODN(r[rcmfi].dataPtr(), DIMLIST(rbox), s[rcmfi].dataPtr(), DIMLIST(sbox), DIMLIST(reg), &sum); } } else { BoxLib::Abort( "inner_product():" "only supported for CELL- or NODE-based data" ); } ParallelDescriptor::ReduceRealSum(sum); return sum; } task_fill_patch::task_fill_patch (task_list& tl_, const MultiFab& t_, int tt_, const Box& region_, const MultiFab& r_, const level_interface& lev_interface_, const amr_boundary* bdy_, int idim_, int index_) : task_fab(tl_, t_, tt_, region_, r_.nComp()), r(r_), lev_interface(lev_interface_), bdy(bdy_), idim(idim_), index(index_) { fill_patch(); } task_fill_patch::~task_fill_patch () {} bool task_fill_patch::fill_patch_blindly () { const BoxArray& r_ba = r.boxArray(); for (int igrid = 0; igrid < r.size(); igrid++) { if (is_local(r, igrid)) { BL_ASSERT(BoxLib::grow(r[igrid].box(), -r.nGrow()) == r_ba[igrid]); } if (r_ba[igrid].contains(region)) { depend_on(m_task_list.add_task(new task_copy_local(m_task_list, target, target_proc_id(), region, r, igrid))); return true; } } for (int igrid = 0; igrid < r.size(); igrid++) { if (is_local(r, igrid)) { BL_ASSERT(BoxLib::grow(r[igrid].box(), -r.nGrow()) == r_ba[igrid]); } if (r_ba[igrid].intersects(region)) { Box tb = r_ba[igrid] & region; depend_on(m_task_list.add_task(new task_copy_local(m_task_list, target, target_proc_id(), tb, r, igrid))); } } return false; } bool task_fill_patch::fill_exterior_patch_blindly () { const BoxArray& em = lev_interface.exterior_mesh(); for (int igrid = 0; igrid < em.size(); igrid++) { const int jgrid = lev_interface.direct_exterior_ref(igrid); if (jgrid >= 0) { Box tb = em[igrid]; tb.convert(type(r)); if (tb.contains(region)) { depend_on(m_task_list.add_task(new task_bdy_fill(m_task_list, bdy, target, target_proc_id(), region, r, jgrid, lev_interface.domain()))); return true; } if (tb.intersects(region)) { tb &= region; depend_on(m_task_list.add_task(new task_bdy_fill(m_task_list, bdy, target, target_proc_id(), tb, r, jgrid, lev_interface.domain()))); } } } return false; } void task_fill_patch::fill_patch () { if (!region.ok()) return; if (target != 0) { BL_ASSERT(target->box() == region); BL_ASSERT(target->nComp() == r.nComp()); BL_ASSERT(type(*target) == type(r)); } BL_ASSERT(lev_interface.ok()); BL_ASSERT(idim >= -1 && idim < BL_SPACEDIM); Box tdomain = lev_interface.domain(); tdomain.convert(region.type()); BL_ASSERT(target == 0 || type(*target) == region.type()); Box idomain = BoxLib::grow(tdomain, IntVect::TheZeroVector() - type(r)); if (idim == -1) { if (idomain.contains(region) || bdy == 0) { fill_patch_blindly(); } else if (!tdomain.intersects(region)) { fill_exterior_patch_blindly(); } else if (idomain.intersects(region) && !fill_patch_blindly()) { fill_exterior_patch_blindly(); } else if (!fill_exterior_patch_blindly()) { fill_patch_blindly(); } } else { const BoxArray& r_ba = r.boxArray(); Array gridnum(lev_interface.ngrids(idim)+1); gridnum[0] = -1; for (int i = 0; i < lev_interface.ngrids(idim); i++) { int igrid = lev_interface.grid(idim, index, i); if (igrid != -1) { for (int j = 0; gridnum[j] != igrid; j++) { if (gridnum[j] == -1) { gridnum[j] = igrid; gridnum[j+1] = -1; if (igrid >= 0) { Box tb = r_ba[igrid] & region; depend_on(m_task_list.add_task( new task_copy_local(m_task_list, target, target_proc_id(), tb, r, igrid))); } else { igrid = -2 - igrid; Box tb = lev_interface.exterior_mesh()[igrid]; tb.convert(type(r)); tb &= region; depend_on(m_task_list.add_task( new task_bdy_fill( m_task_list, bdy, target, target_proc_id(), tb, r, lev_interface.direct_exterior_ref(igrid), lev_interface.domain()))); } break; } } } } } } static void sync_internal_borders (MultiFab& r, const level_interface& lev_interface) { BL_PROFILE("sync_internal_borders()"); BL_ASSERT(type(r) == IntVect::TheNodeVector()); task_list tl; for (int iface = 0; iface < lev_interface.nboxes(level_interface::FACEDIM); iface++) { const int igrid = lev_interface.grid(level_interface::FACEDIM, iface, 0); const int jgrid = lev_interface.grid(level_interface::FACEDIM, iface, 1); // // Only do interior faces with fine grid on both sides. // if (igrid < 0 || jgrid < 0 || lev_interface.geo(level_interface::FACEDIM, iface) != level_interface::ALL) break; tl.add_task(new task_copy(tl, r, jgrid, r, igrid, lev_interface.node_box(level_interface::FACEDIM, iface))); } #if (BL_SPACEDIM == 2) for (int icor = 0; icor < lev_interface.nboxes(0); icor++) { const int igrid = lev_interface.grid(0, icor, 0); const int jgrid = lev_interface.grid(0, icor, 3); // // Only do interior corners with fine grid on all sides. // if (igrid < 0 || jgrid < 0 || lev_interface.geo(0, icor) != level_interface::ALL) break; if (jgrid == lev_interface.grid(0, icor, 1)) tl.add_task(new task_copy(tl, r, jgrid, r, igrid, lev_interface.box(0, icor))); } #else for (int iedge = 0; iedge < lev_interface.nboxes(1); iedge++) { const int igrid = lev_interface.grid(1, iedge, 0); const int jgrid = lev_interface.grid(1, iedge, 3); // // Only do interior edges with fine grid on all sides. // if (igrid < 0 || jgrid < 0 || lev_interface.geo(1, iedge) != level_interface::ALL) break; if (jgrid == lev_interface.grid(1, iedge, 1)) tl.add_task(new task_copy(tl, r, jgrid, r, igrid, lev_interface.node_box(1, iedge))); } for (int icor = 0; icor < lev_interface.nboxes(0); icor++) { int igrid = lev_interface.grid(0, icor, 0); int jgrid = lev_interface.grid(0, icor, 7); // // Only do interior corners with fine grid on all sides. // if (igrid < 0 || jgrid < 0 || lev_interface.geo(0, icor) != level_interface::ALL) break; if (lev_interface.grid(0, icor, 3) == lev_interface.grid(0, icor, 1)) { if (jgrid != lev_interface.grid(0, icor, 3)) { tl.add_task(new task_copy(tl, r, jgrid, r, igrid, lev_interface.box(0, icor))); jgrid = lev_interface.grid(0, icor, 5); if (jgrid != lev_interface.grid(0, icor, 7)) tl.add_task(new task_copy(tl, r, jgrid, r, igrid, lev_interface.box(0, icor))); } } else if (lev_interface.grid(0, icor, 5) == lev_interface.grid(0, icor, 1)) { if (jgrid != lev_interface.grid(0, icor, 5)) { tl.add_task(new task_copy(tl, r, jgrid, r, igrid, lev_interface.box(0, icor))); jgrid = lev_interface.grid(0, icor, 3); if (jgrid != lev_interface.grid(0, icor, 7)) { tl.add_task(new task_copy(tl, r, jgrid, r, igrid, lev_interface.box(0, icor))); if (jgrid == lev_interface.grid(0, icor, 2)) { jgrid = lev_interface.grid(0, icor, 6); if (jgrid != lev_interface.grid(0, icor, 7)) tl.add_task( new task_copy(tl, r, jgrid, r, igrid, lev_interface.box(0, icor))); } } } } } #endif tl.execute("sync_internal_borders"); } void sync_borders (MultiFab& r, const level_interface& lev_interface, const amr_boundary* bdy) { sync_internal_borders(r, lev_interface); BL_ASSERT(bdy != 0); bdy->sync_borders(r, lev_interface); } #if BL_SPACEDIM == 3 // // Local function used only by fill_internal_borders: // inline void node_dirs (int dir[2], const IntVect& typ) { if (typ[0] == IndexType::NODE) { dir[0] = 0; dir[1] = (typ[1] == IndexType::NODE) ? 1 : 2; } else { dir[0] = 1; dir[1] = 2; } } #endif // // The sequencing used in fill_internal_borders, fcpy2 and set_border_cache // (narrow x, medium y, wide z) is necessary to avoid overwrite problems // like those seen in the sync routines. Boundary copies are all wide // regardless of direction and come after interior copies---overwrite // difficulties are avoided since grids can't bridge a boundary. // Modifications are necessary in 3D to deal with lack of diagonal // communication across edges at the coarse-fine lev_interface. These // modifications take the form of narrowing certain copies to avoid // overwriting good values with bad ones. // static void fill_internal_borders (MultiFab& r, const level_interface& lev_interface, int w, bool hg_dense) { BL_PROFILE("fill_internal_borders()"); BL_ASSERT(type(r) == IntVect::TheCellVector() || type(r) == IntVect::TheNodeVector() ); w = (w < 0 || w > r.nGrow()) ? r.nGrow() : w; BL_ASSERT(w == 1 || w == 0); task_list tl; if (type(r) == IntVect::TheNodeVector()) { #if (BL_SPACEDIM == 3) if(hg_dense) { // // Attempt to deal with corner-coupling problem with 27-point stencils // for (int iedge = 0; iedge < lev_interface.nboxes(1); iedge++) { if (lev_interface.geo(1, iedge) == level_interface::ALL) continue; int igrid = lev_interface.grid(1, iedge, 0); int jgrid = lev_interface.grid(1, iedge, 3); if (igrid >= 0 && jgrid >= 0) { int kgrid = lev_interface.grid(1, iedge, 1); if (kgrid == -1) kgrid = lev_interface.grid(1, iedge, 2); if (kgrid != -1 && kgrid != igrid && kgrid != jgrid) { int dir[2]; node_dirs(dir, lev_interface.box(1, iedge).type()); if (kgrid == lev_interface.grid(1, iedge, 1)) { Box b = lev_interface.node_box(1, iedge); tl.add_task(new task_copy(tl, r, jgrid, r, igrid, b.shift(dir[0], -1))); b = lev_interface.node_box(1, iedge); tl.add_task(new task_copy(tl, r, igrid, r, jgrid, b.shift(dir[1], 1))); } else { Box b = lev_interface.node_box(1, iedge); tl.add_task(new task_copy(tl, r, jgrid, r, igrid, b.shift(dir[1], -1))); b = lev_interface.node_box(1, iedge); tl.add_task(new task_copy(tl, r, igrid, r, jgrid, b.shift(dir[0], 1))); } } } igrid = lev_interface.grid(1, iedge, 1); jgrid = lev_interface.grid(1, iedge, 2); if (igrid >= 0 && jgrid >= 0) { int kgrid = lev_interface.grid(1, iedge, 0); if (kgrid == -1) kgrid = lev_interface.grid(1, iedge, 3); if (kgrid != -1 && kgrid != igrid && kgrid != jgrid) { int dir[2]; node_dirs(dir, lev_interface.box(1, iedge).type()); if (kgrid == lev_interface.grid(1, iedge, 0)) { Box b = lev_interface.node_box(1, iedge); tl.add_task(new task_copy(tl, r, jgrid, r, igrid, b.shift(dir[0], 1))); b = lev_interface.node_box(1, iedge); tl.add_task(new task_copy(tl, r, igrid, r, jgrid, b.shift(dir[1], 1))); } else { Box b = lev_interface.node_box(1, iedge); tl.add_task(new task_copy(tl, r, jgrid, r, igrid, b.shift(dir[1], -1))); b = lev_interface.node_box(1, iedge); tl.add_task(new task_copy(tl, r, igrid, r, jgrid, b.shift(dir[0], -1))); } } } } } #endif const BoxArray& r_ba = r.boxArray(); for (int iface = 0; iface < lev_interface.nboxes(level_interface::FACEDIM); iface++) { const int igrid = lev_interface.grid(level_interface::FACEDIM, iface, 0); const int jgrid = lev_interface.grid(level_interface::FACEDIM, iface, 1); if (igrid < 0 || jgrid < 0 || lev_interface.geo(level_interface::FACEDIM, iface) != level_interface::ALL) break; const Box& b = lev_interface.node_box(level_interface::FACEDIM, iface); // tl.add_task(new task_copy_2(r, igrid, r, jgrid, b, w)); const int idim = lev_interface.fdim(iface); Box bj = lev_interface.node_box(level_interface::FACEDIM, iface); Box bi = lev_interface.node_box(level_interface::FACEDIM, iface); for (int i = 0; i < idim; i++) { if (r_ba[jgrid].smallEnd(i) == bj.smallEnd(i)) bj.growLo(i, w); if (r_ba[jgrid].bigEnd(i) == bj.bigEnd(i)) bj.growHi(i, w); if (r_ba[igrid].smallEnd(i) == bi.smallEnd(i)) bi.growLo(i, w); if (r_ba[igrid].bigEnd(i) == bi.bigEnd(i)) bi.growHi(i, w); } bj.shift(idim, -1).growLo(idim, w-1); bi.shift(idim, 1).growHi(idim, w-1); #if 1 tl.add_task(new task_copy(tl, r, jgrid, r, igrid, bj)); tl.add_task(new task_copy(tl, r, igrid, r, jgrid, bi)); #else tl.add_task(new task_copy(tl, r, jgrid, r, igrid, w_shift(b, r_ba[jgrid], r.nGrow(), -w))); tl.add_task(new task_copy(tl, r, igrid, r, jgrid, w_shift(b, r_ba[igrid], r.nGrow(), w))); #endif } } else if (type(r) == IntVect::TheCellVector()) { const BoxArray& r_ba = r.boxArray(); for (int iface = 0; iface < lev_interface.nboxes(level_interface::FACEDIM); iface++) { const int igrid = lev_interface.grid(level_interface::FACEDIM, iface, 0); const int jgrid = lev_interface.grid(level_interface::FACEDIM, iface, 1); if (igrid < 0 || jgrid < 0 || lev_interface.geo(level_interface::FACEDIM, iface) != level_interface::ALL) break; const int idim = lev_interface.fdim(iface); #if (BL_SPACEDIM == 2) Box b = lev_interface.box(level_interface::FACEDIM, iface); if (idim == 1) b.grow(0, w); b.growLo(idim, w).convert(IntVect::TheCellVector()); tl.add_task(new task_copy(tl, r, jgrid, r, igrid, b)); tl.add_task( new task_copy(tl, r, igrid, r, jgrid, b.shift(idim, w))); #else Box bj = lev_interface.box(level_interface::FACEDIM, iface); Box bi = lev_interface.box(level_interface::FACEDIM, iface); for (int i = 0; i < idim; i++) { if (r_ba[jgrid].smallEnd(i) == bj.smallEnd(i)) bj.growLo(i, w); if (r_ba[jgrid].bigEnd(i) == bj.bigEnd(i)) bj.growHi(i, w); if (r_ba[igrid].smallEnd(i) == bi.smallEnd(i)) bi.growLo(i, w); if (r_ba[igrid].bigEnd(i) == bi.bigEnd(i)) bi.growHi(i, w); } bj.growLo(idim, w).convert(IntVect::TheCellVector()); bi.growHi(idim, w).convert(IntVect::TheCellVector()); tl.add_task(new task_copy(tl, r, jgrid, r, igrid, bj)); tl.add_task(new task_copy(tl, r, igrid, r, jgrid, bi)); #endif } } tl.execute("fill_internal_borders"); } void fill_borders (MultiFab& r, const level_interface& lev_interface, const amr_boundary* bdy, int w, bool hg_dense) { HG_TEST_NORM(r, "fill_borders 0"); fill_internal_borders(r, lev_interface, w, hg_dense); HG_TEST_NORM(r, "fill_borders 1"); BL_ASSERT(bdy != 0); bdy->fill_borders(r, lev_interface, w); HG_TEST_NORM(r, "fill_borders 2"); } void clear_part_interface (MultiFab& r, const level_interface& lev_interface) { BL_ASSERT(r.nComp() == 1); BL_ASSERT(type(r) == IntVect::TheNodeVector()); for (int i = 0; i < BL_SPACEDIM; i++) { for (int ibox = 0; ibox < lev_interface.nboxes(i); ibox++) { // // coarse-fine face contained in part_fine grid, or orphan edge/corner // const int igrid = lev_interface.aux(i, ibox); if (igrid < 0 || is_remote(r, igrid)) continue; BL_ASSERT(is_local(r, igrid)); r[igrid].setVal(0.0, lev_interface.node_box(i, ibox), 0); } } HG_TEST_NORM( r, "clear_part_interface"); } class task_restric_fill : public task { public: task_restric_fill (task_list& tl_, const amr_restrictor& restric, MultiFab& dest, int dgrid, const MultiFab& r, int rgrid, const Box& box, const IntVect& rat); virtual ~task_restric_fill (); virtual bool ready (); virtual void hint () const; virtual bool startup (long& sndcnt, long& rcvcnt); virtual bool need_to_communicate (int& with) const; private: // // The data. // MPI_Request m_request; const amr_restrictor& m_restric; FArrayBox* m_tmp; MultiFab& m_d; const MultiFab& m_r; const int m_dgrid; const int m_rgrid; const Box m_box; const IntVect m_rat; bool m_local; }; task_restric_fill::task_restric_fill (task_list& tl_, const amr_restrictor& restric, MultiFab& dest, int dgrid, const MultiFab& r, int rgrid, const Box& box, const IntVect& rat) : task(tl_), m_restric(restric), m_d(dest), m_r(r), m_dgrid(dgrid), m_rgrid(rgrid), m_tmp(0), m_box(box), m_rat(rat), m_local(false) { if (is_local(m_d, m_dgrid) && is_local(m_r, m_rgrid)) { m_local = true; m_restric.fill(m_d[m_dgrid], m_box, m_r[m_rgrid], m_rat); m_finished = true; } else if (!is_local(m_d, m_dgrid) && !is_local(m_r, m_rgrid)) { m_finished = true; } } task_restric_fill::~task_restric_fill () { delete m_tmp; } bool task_restric_fill::need_to_communicate (int& with) const { bool result = false; if (!m_local) { if (is_local(m_d, m_dgrid)) { with = processor_number(m_r, m_rgrid); result = true; } else if (is_local(m_r, m_rgrid)) { with = processor_number(m_d, m_dgrid); result = true; } } return result; } bool task_restric_fill::startup (long& sndcnt, long& rcvcnt) { m_started = true; bool result = true; if (!m_local) { if (is_local(m_d, m_dgrid)) { m_tmp = new FArrayBox(m_box, m_d.nComp()); rcvcnt = m_tmp->box().numPts()*m_tmp->nComp(); m_request = ParallelDescriptor::Arecv(m_tmp->dataPtr(), rcvcnt, processor_number(m_r,m_rgrid), m_sno, HG::mpi_comm).req(); rcvcnt *= sizeof(double); BL_ASSERT(m_request != MPI_REQUEST_NULL); } else if (is_local(m_r, m_rgrid)) { m_tmp = new FArrayBox(m_box, m_d.nComp()); m_restric.fill(*m_tmp, m_box, m_r[m_rgrid], m_rat); sndcnt = m_tmp->box().numPts()*m_tmp->nComp(); m_request = ParallelDescriptor::Asend(m_tmp->dataPtr(), sndcnt, processor_number(m_d, m_dgrid), m_sno, HG::mpi_comm).req(); sndcnt *= sizeof(double); BL_ASSERT(m_request != MPI_REQUEST_NULL); } else { result = false; } } return result; } bool task_restric_fill::ready () { BL_ASSERT(is_started()); if (m_local) return true; int flag; MPI_Status status; ParallelDescriptor::Test(m_request, flag, status); if (flag) { if (is_local(m_d, m_dgrid)) { m_d[m_dgrid].copy(*m_tmp); } return true; } return false; } void task_restric_fill::hint () const { task::_hint(); if (is_local(m_r, m_rgrid) && is_local(m_d, m_dgrid)) { HG_DEBUG_OUT( "L" ); } else if (is_local(m_r, m_rgrid)) { HG_DEBUG_OUT( "S" ); } else if (is_local(m_d, m_dgrid)) { HG_DEBUG_OUT( "R" ); } else { HG_DEBUG_OUT( "?" ); } HG_DEBUG_OUT( ' ' << m_box << ' ' << m_dgrid << ' '; ); HG_DEBUG_OUT( ")" << std::endl ); } void restrict_level (MultiFab& dest, MultiFab& r, const IntVect& rat) { restrict_level(dest, r, rat, default_restrictor(), default_level_interface, 0); } void restrict_level (MultiFab& dest, MultiFab& r, const IntVect& rat, const amr_restrictor& restric, const level_interface& lev_interface, const amr_boundary* bdy) { BL_PROFILE("restrict_level()"); BL_ASSERT(type(dest) == type(r)); HG_TEST_NORM( dest, "restrict_level a"); HG_TEST_NORM( r, "restrict_level r"); const BoxArray& r_ba = r.boxArray(); const BoxArray& dest_ba = dest.boxArray(); task_list tl; for (int jgrid = 0; jgrid < dest.size(); jgrid++) { const Box& region = dest_ba[jgrid]; for (int igrid = 0; igrid < r.size(); igrid++) { Box cbox = restric.box(r_ba[igrid], rat); if (region.intersects(cbox)) { cbox &= region; tl.add_task(new task_restric_fill(tl, restric, dest, jgrid, r, igrid, cbox, rat)); } } } tl.execute("restrict_level"); HG_TEST_NORM( dest, "restrict_level a1"); HG_TEST_NORM( r, "restrict_level r1"); if (lev_interface.ok()) { restric.fill_interface( dest, r, lev_interface, bdy, rat); } HG_TEST_NORM( dest, "restrict_level a2"); HG_TEST_NORM( r, "restrict_level r2"); } ccseapps-2.5/CCSEApps/hgproj/amr_real2d.f0000644000175000017500000006651611634153073021345 0ustar amckinstryamckinstryc----------------------------------------------------------------------- c Works for CELL-based data. subroutine iprodc( & v0, v0l0, v0h0, v0l1, v0h1, & v1, v1l0, v1h0, v1l1, v1h1, & regl0, regh0, regl1, regh1, & sum) integer v0l0, v0h0, v0l1, v0h1 integer v1l0, v1h0, v1l1, v1h1 integer regl0, regh0, regl1, regh1 double precision v0(v0l0:v0h0,v0l1:v0h1) double precision v1(v1l0:v1h0,v1l1:v1h1) double precision sum integer i, j do j = regl1, regh1 do i = regl0, regh0 sum = sum + v0(i,j) * v1(i,j) end do end do end c----------------------------------------------------------------------- c Works for NODE-based data. subroutine iprodn( & v0, v0l0, v0h0, v0l1, v0h1, & v1, v1l0, v1h0, v1l1, v1h1, & regl0, regh0, regl1, regh1, & sum) integer v0l0, v0h0, v0l1, v0h1 integer v1l0, v1h0, v1l1, v1h1 integer regl0, regh0, regl1, regh1 double precision v0(v0l0:v0h0,v0l1:v0h1) double precision v1(v1l0:v1h0,v1l1:v1h1) double precision sum, sum0 integer i, j sum0 = 0.5d0 * (v0(regl0,regl1) * v1(regl0,regl1) + & v0(regl0,regh1) * v1(regl0,regh1) + & v0(regh0,regl1) * v1(regh0,regl1) + & v0(regh0,regh1) * v1(regh0,regh1)) do i = regl0 + 1, regh0 - 1 sum0 = sum0 + (v0(i,regl1) * v1(i,regl1) + & v0(i,regh1) * v1(i,regh1)) end do do j = regl1 + 1, regh1 - 1 sum0 = sum0 + (v0(regl0,j) * v1(regl0,j) + & v0(regh0,j) * v1(regh0,j)) end do sum = sum + 0.5d0 * sum0 do j = regl1 + 1, regh1 - 1 do i = regl0 + 1, regh0 - 1 sum = sum + v0(i,j) * v1(i,j) end do end do end c----------------------------------------------------------------------- c Works for CELL- or NODE-based data. subroutine bref( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & bbl0, bbh0, bbl1, bbh1, & idir, ncomp) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer bbl0, bbh0, bbl1, bbh1 integer idir double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) integer i, j, nc do nc = 1, ncomp if (idir .eq. 0) then do i = regl0, regh0 do j = regl1, regh1 dest(i,j,nc) = src(bbh0-(i-regl0),j,nc) end do end do else do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = src(i,bbh1-(j-regl1),nc) end do end do end if end do end c----------------------------------------------------------------------- c Works for CELL- or NODE-based data. subroutine brefm( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & bbl0, bbh0, bbl1, bbh1, ra, ncomp) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer bbl0, bbh0, bbl1, bbh1 integer ra(0:1) double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) integer i, j, nc do nc = 1, ncomp if (ra(0) .eq. 0 .and. ra(1) .eq. 0) then do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = src(bbl0+(i-regl0),bbl1+(j-regl1),nc) end do end do else if (ra(0) .eq. 0 .and. ra(1) .eq. 1) then do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = src(bbl0+(i-regl0),bbh1-(j-regl1),nc) end do end do else if (ra(0) .eq. 1 .and. ra(1) .eq. 0) then do i = regl0, regh0 do j = regl1, regh1 dest(i,j,nc) = src(bbh0-(i-regl0),bbl1+(j-regl1),nc) end do end do else do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = src(bbh0-(i-regl0),bbh1-(j-regl1),nc) end do end do end if end do end c----------------------------------------------------------------------- c Works for CELL- or NODE-based data. subroutine bneg( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & bbl0, bbh0, bbl1, bbh1, idir, ncomp) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer bbl0, bbh0, bbl1, bbh1 integer idir double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) integer i, j, nc do nc = 1, ncomp if (idir .eq. 0) then do i = regl0, regh0 do j = regl1, regh1 dest(i,j,nc) = -src(bbh0-(i-regl0),j,nc) end do end do else do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = -src(i,bbh1-(j-regl1),nc) end do end do end if end do end c----------------------------------------------------------------------- c Works for CELL- or NODE-based data. subroutine bnegm( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & bbl0, bbh0, bbl1, bbh1, ra, ncomp) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer bbl0, bbh0, bbl1, bbh1 integer ra(0:1) double precision dest(destl0:desth0,destl1:desth1, ncomp) double precision src(srcl0:srch0,srcl1:srch1, ncomp) integer i, j, nc do nc = 1, ncomp if (ra(0) .eq. 0 .and. ra(1) .eq. 0) then do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = -src(bbl0+(i-regl0),bbl1+(j-regl1),nc) end do end do else if (ra(0) .eq. 0 .and. ra(1) .eq. 1) then do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = -src(bbl0+(i-regl0),bbh1-(j-regl1),nc) end do end do else if (ra(0) .eq. 1 .and. ra(1) .eq. 0) then do i = regl0, regh0 do j = regl1, regh1 dest(i,j,nc) = -src(bbh0-(i-regl0),bbl1+(j-regl1),nc) end do end do else do i = regl0, regh0 do j = regl1, regh1 dest(i,j,nc) = -src(bbh0-(i-regl0),bbh1-(j-regl1),nc) end do end do end if end do end c----------------------------------------------------------------------- c Works for CELL-based velocity data. c This routine assumes that the inflow face velocity data has not yet c been altered. Running fill_borders should call this routine on every c inflow face, so that binfil can be run for subsequent fills subroutine binflo( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & bbl0, bbh0, bbl1, bbh1, & idir, ncomp) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer bbl0, bbh0, bbl1, bbh1 integer idir double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) integer i, j,nc do nc = 1, ncomp if (idir .eq. 0) then if (regl0 .lt. bbh0) then do i = regl0, regh0 do j = regl1, regh1 dest(i,j,nc) = 2.d0 * dest(regh0,j,nc) & - src(bbh0-(i-regl0),j,nc) end do end do else do i = regh0, regl0, -1 do j = regl1, regh1 dest(i,j,nc) = 2.d0 * dest(regl0,j,nc) & - src(bbh0-(i-regl0),j,nc) end do end do end if else if (regl1 .lt. bbh1) then do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = 2.d0 * dest(i,regh1,nc) & - src(i,bbh1-(j-regl1),nc) end do end do else do j = regh1, regl1, -1 do i = regl0, regh0 dest(i,j,nc) = 2.d0 * dest(i,regl1,nc) & - src(i,bbh1-(j-regl1),nc) end do end do end if end if end do end c----------------------------------------------------------------------- c Works for CELL-based velocity data. c This routine is called when the inflow face velocity data has already c been altered by a call to fill_borders. The box bb must have been c extended to one cell past the boundary by the boundary::box routine. subroutine binfil( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & bbl0, bbh0, bbl1, bbh1, & idir, ncomp) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer bbl0, bbh0, bbl1, bbh1 integer idir double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) integer i, j, nc do nc = 1, ncomp if (idir .eq. 0) then if (regl0 .lt. bbh0) then do i = regl0, regh0 do j = regl1, regh1 dest(i,j,nc) = src(bbl0,j,nc) + src(bbl0+1,j,nc) - & src(bbh0-(i-regl0),j,nc) end do end do else do i = regh0, regl0, -1 do j = regl1, regh1 dest(i,j,nc) = src(bbh0-1,j,nc) + src(bbh0,j,nc) - & src(bbl0+(regh0-i),j,nc) end do end do end if else if (regl1 .lt. bbh1) then do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = src(i,bbl1,nc) + src(i,bbl1+1,nc) - & src(i,bbh1-(j-regl1),nc) end do end do else do j = regh1, regl1, -1 do i = regl0, regh0 dest(i,j,nc) = src(i,bbh1-1,nc) + src(i,bbh1,nc) - & src(i,bbl1+(regh1-j),nc) end do end do end if end if end do end c----------------------------------------------------------------------- c Interpolation... c----------------------------------------------------------------------- c CELL-based data only. subroutine acint2( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & bbl0, bbh0, bbl1, bbh1, & ir, jr, ncomp, integ, i1, i2) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer bbl0, bbh0, bbl1, bbh1 integer ir, jr integer i1, i2, integ double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) double precision xoff, yoff, sx, sy integer i, j, ic, jc, nc do nc = 1, ncomp do j = regl1, regh1 jc = j/jr yoff = (mod(j,jr) + 0.5D0) / jr - 0.5D0 do i = regl0, regh0 ic = i/ir xoff = (mod(i,ir) + 0.5D0) / ir - 0.5D0 sy = 0.5D0 * (src(ic,jc+1,nc) - src(ic,jc-1,nc)) sx = 0.5D0 * (src(ic+1,jc,nc) - src(ic-1,jc,nc)) dest(i,j,nc) = src(ic,jc,nc) + xoff * sx + yoff * sy end do end do end do end c----------------------------------------------------------------------- c NODE-based data only. subroutine anint2( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & bbl0, bbh0, bbl1, bbh1, & ir, jr, ncomp, i1, i2, integ) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer bbl0, bbh0, bbl1, bbh1 integer ir, jr,nc integer i1, i2, integ double precision dest(destl0:desth0,destl1:desth1, ncomp) double precision src(srcl0:srch0,srcl1:srch1, ncomp) double precision p, q integer ic, jc, j, m do nc = 1, ncomp do jc = bbl1, bbh1 do ic = bbl0, bbh0 dest(ir*ic,jr*jc,nc) = src(ic,jc,nc) end do end do do m = 1, jr-1 q = dble(m)/jr p = 1.0d0 - q do jc = bbl1, bbh1-1 do ic = bbl0, bbh0 dest(ir*ic,jr*jc+m,nc) = p * src(ic,jc,nc) + & q * src(ic,jc+1,nc) end do end do end do do m = 1, ir-1 q = dble(m)/ir p = 1.0d0 - q do ic = bbl0, bbh0-1 cdir$ ivdep do j = regl1, regh1 dest(ir*ic+m,j,nc) = p * dest(ir*ic,j,nc) + & q * dest(ir*(ic+1),j,nc) end do end do end do end do end c----------------------------------------------------------------------- c Restrictions.... c----------------------------------------------------------------------- c CELL-based data only. subroutine acrst1( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & ir, jr, ncomp, integ, i1, i2) integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer ir, jr, ncomp, integ integer i1, i2 double precision dest(destl0:desth0,destl1:desth1, ncomp) double precision src(srcl0:srch0,srcl1:srch1, ncomp) double precision fac integer i, j, m, n, nc do nc = 1, ncomp do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = 0.d0 end do end do do n = 0, jr-1 do m = 0, ir-1 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = dest(i,j,nc) + src(i*ir+m,j*jr+n,nc) end do end do end do end do if (integ .eq. 0) then fac = 1.d0 / (ir*jr) do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = dest(i,j,nc) * fac end do end do end if end do end c----------------------------------------------------------------------- c NODE-based data only. subroutine anrst1( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & ir, jr, ncomp, integ, i1, i2) integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer ir, jr, ncomp integer i1, i2, integ double precision dest(destl0:desth0,destl1:desth1, ncomp) double precision src(srcl0:srch0,srcl1:srch1, ncomp) integer i, j,nc do nc = 1, ncomp do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = src(i*ir,j*jr,nc) end do end do end do end c----------------------------------------------------------------------- c NODE-based data only. c Fills coarse region defined by reg, which must be smaller than c fine region by at least one coarse cell on all sides. subroutine anrst2( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & ir, jr, ncomp, integ, i1, i2) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer ir, jr, integ, i1, i2 double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) double precision fac0, fac1, fac integer i, j, m, n, nc do nc = 1, ncomp do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = 0.d0 end do end do fac0 = 1.d0 / (ir*ir * jr*jr) do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5d0 * fac1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5d0 * fac do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = dest(i,j,nc) + & fac * (src(i*ir-m,j*jr-n,nc)+ & src(i*ir-m,j*jr+n,nc)+ & src(i*ir+m,j*jr-n,nc)+ & src(i*ir+m,j*jr+n,nc)) end do end do end do end do if (integ .eq. 1) then fac = ir * jr do j = regl1, regh1 do i = regl0, regh0 dest(i,j,nc) = fac * dest(i,j,nc) end do end do end if end do end c----------------------------------------------------------------------- c NODE-based data only. c Fills coarse region defined by reg. subroutine anfr2( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & ir, jr, ncomp, integ, idim, idir) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer ir, jr, idim, idir, integ double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) double precision fac0, fac1, fac integer i, j, m, n, nc do nc = 1, ncomp if (idim .eq. 0) then if (integ .eq. 0) then fac = (0.5d0 + 0.5d0 / ir) fac0 = 1.d0 / (ir*ir * jr*jr) else fac = 1.d0 fac0 = 1.d0 / (ir * jr) end if i = regl0 do j = regl1, regh1 dest(i,j,nc) = fac * src(i*ir,j*jr,nc) end do do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5d0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do j = regl1, regh1 dest(i,j,nc) = dest(i,j,nc) + & fac * (src(i*ir+m,j*jr-n,nc)+ & src(i*ir+m,j*jr+n,nc)) end do end do end do else if (integ .eq. 0) then fac = (0.5d0 + 0.5d0 / jr) fac0 = 1.d0 / (ir*ir * jr*jr) else fac = 1.d0 fac0 = 1.d0 / (ir * jr) end if j = regl1 do i = regl0, regh0 dest(i,j,nc) = fac * src(i*ir,j*jr,nc) end do do n = idir, idir*(jr-1), idir fac1 = (jr-abs(n)) * fac0 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5d0 * fac do i = regl0, regh0 dest(i,j,nc) = dest(i,j,nc) & + fac * (src(i*ir-m,j*jr+n,nc) & +src(i*ir+m,j*jr+n,nc)) end do end do end do end if end do end c----------------------------------------------------------------------- c NODE-based data only. c Fills coarse point defined by reg. subroutine anor2( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & ir, jr, ncomp, integ, idir0, idir1) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer ir, jr, idir0, idir1, integ double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) double precision fac0, fac1, fac integer i, j, m, n, nc do nc = 1, ncomp if (integ .eq. 0) then fac = (0.75d0 + 0.25d0/ir + 0.25d0/jr - 0.25d0/(ir*jr)) fac0 = 1.d0 / (ir*ir * jr*jr) else fac = 1.d0 fac0 = 1.d0 / (ir * jr) end if i = regl0 j = regl1 dest(i,j,nc) = fac * src(i*ir,j*jr,nc) do n = idir1, idir1*(jr-1), idir1 fac1 = (jr-abs(n)) * fac0 do m = idir0, idir0*(ir-1), idir0 fac = (ir-abs(m)) * fac1 dest(i,j,nc) = dest(i,j,nc) + fac * src(i*ir+m,j*jr+n,nc) end do end do end do end c----------------------------------------------------------------------- c NODE-based data only. c Fills coarse point defined by reg. subroutine anir2( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & ir, jr, ncomp, integ, idir0, idir1) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer ir, jr, idir0, idir1, integ double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) double precision fac0, fac1, fac integer i, j, m, n, nc do nc = 1, ncomp if (integ .eq. 0) then fac = (0.25d0 + 0.25d0/ir + 0.25d0/jr + 0.25d0/(ir*jr)) fac0 = 1.d0/(ir*ir * jr*jr) else fac = 1.d0 fac0 = 1.d0/(ir*jr) end if i = regl0 j = regl1 dest(i,j,nc) = fac * src(i*ir,j*jr,nc) do m = idir0, idir0*(ir-1), idir0 fac1 = (ir-abs(m)) * fac0 fac = jr * fac1 dest(i,j,nc) = dest(i,j,nc) + fac * src(i*ir+m,j*jr,nc) end do do n = idir1, idir1*(jr-1), idir1 fac1 = (jr-abs(n)) * fac0 fac = ir * fac1 dest(i,j,nc) = dest(i,j,nc) + fac * src(i*ir,j*jr+n,nc) do m = idir0, idir0*(ir-1), idir0 fac = (ir-abs(m)) * fac1 dest(i,j,nc) = dest(i,j,nc) + fac * & (src(i*ir+m,j*jr+n,nc) + & src(i*ir-m,j*jr+n,nc) + & src(i*ir+m,j*jr-n,nc)) end do end do end do end c----------------------------------------------------------------------- c NODE-based data only. c Fills coarse point defined by reg. subroutine andr2( & dest, destl0, desth0, destl1, desth1, & regl0, regh0, regl1, regh1, & src, srcl0, srch0, srcl1, srch1, & ir, jr, ncomp, integ, idir1, i2) integer ncomp integer destl0, desth0, destl1, desth1 integer regl0, regh0, regl1, regh1 integer srcl0, srch0, srcl1, srch1 integer ir, jr, idir1, integ double precision dest(destl0:desth0,destl1:desth1,ncomp) double precision src(srcl0:srch0,srcl1:srch1,ncomp) double precision fac0, fac1, fac integer i, j, m, n, nc, i2 do nc = 1, ncomp if (integ .eq. 0) then fac = (0.5d0 + 0.5d0 / ir + 0.5d0 / jr - 0.5d0 / (ir*jr)) fac0 = 1.d0 / (ir*ir * jr*jr) else fac = 1.d0 fac0 = 1.d0 / (ir * jr) end if i = regl0 j = regl1 dest(i,j,nc) = fac * src(i*ir,j*jr,nc) do n = idir1, idir1*(jr-1), idir1 fac1 = (jr-abs(n)) * fac0 do m = 1, ir-1 fac = (ir-m) * fac1 dest(i,j,nc) = dest(i,j,nc) + fac * & (src(i*ir+m,j*jr+n,nc) + & src(i*ir-m,j*jr-n,nc)) end do end do end do end c----------------------------------------------------------------------- c NODE-based data only. c Fills coarse region defined by reg. c Handles any corner geometry except all-coarse. subroutine ancr2( & dest, destl0,desth0,destl1,desth1, & regl0,regh0,regl1,regh1, & src, srcl0,srch0,srcl1,srch1, & ir, jr, ncomp, integ, ga, i2) integer ncomp integer destl0,desth0,destl1,desth1 integer regl0,regh0,regl1,regh1 integer srcl0,srch0,srcl1,srch1 integer ir, jr, ga(0:1,0:1), integ double precision dest(destl0:desth0,destl1:desth1, & ncomp) double precision src(srcl0:srch0,srcl1:srch1, ncomp) double precision cube, center, cfac, fac0, fac1, fac integer i, j, ii, ji, idir, jdir, m, n, nc, i2 i = regl0 j = regl1 do nc = 1, ncomp dest(i,j,nc) = 0.0D0 cube = ir * jr if (integ .eq. 0) then center = 1.0D0 / cube fac0 = 1.0D0 / (cube**2) cfac = 0.25D0 * cube * fac0 * (ir-1) * (jr-1) else center = 1.0D0 fac0 = 1.0D0 / cube end if c octants do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) .eq. 1) then do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 dest(i,j,nc) = dest(i,j,nc) + & fac * src(i*ir+m,j*jr+n,nc) end do end do else if (integ .eq. 0) then center = center + cfac end if end do end do c faces fac1 = jr * fac0 cfac = 0.50D0 * cube * fac0 * (ir-1) do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0) + ga(ii,1) .eq. 2) then do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 dest(i,j,nc) = dest(i,j,nc) + & fac * src(i*ir+m,j*jr,nc) end do else if (integ .eq. 0) then center = center + cfac end if end do fac1 = ir * fac0 cfac = 0.50D0 * cube * fac0 * (jr-1) do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji) + ga(1,ji) .eq. 2) then do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 dest(i,j,nc) = dest(i,j,nc) + & fac * src(i*ir,j*jr+n,nc) end do else if (integ .eq. 0) then center = center + cfac end if end do c center dest(i,j,nc) = dest(i,j,nc) + & center * src(i*ir,j*jr,nc) end do end ccseapps-2.5/CCSEApps/hgproj/hg_proj2d.f0000644000175000017500000007461611634153073021213 0ustar amckinstryamckinstryc----------------------------------------------------------------------- subroutine hggrad_dense( & gpx, gpy, & gpl0, gph0, gpl1, gph1, & dest, destl0, desth0, destl1, desth1, & fregl0, fregh0, fregl1, fregh1, & hx, hy, idummy) integer gpl0, gph0, gpl1, gph1 integer destl0, desth0, destl1, desth1 integer fregl0, fregh0, fregl1, fregh1 double precision hx, hy double precision gpx(gpl0:gph0,gpl1:gph1) double precision gpy(gpl0:gph0,gpl1:gph1) double precision dest(destl0:desth0,destl1:desth1) integer idummy integer i, j do j = fregl1, fregh1 do i = fregl0, fregh0 gpx(i,j) = 0.5d0 * (dest(i+1,j) + dest(i+1,j+1) - & dest(i ,j) - dest(i ,j+1)) gpy(i,j) = 0.5d0 * (dest(i,j+1) + dest(i+1,j+1) - & dest(i,j ) - dest(i+1,j )) end do end do end c----------------------------------------------------------------------- subroutine hgdiv_dense( & src, srcl0, srch0, srcl1, srch1, & uf, vf, & fl0, fh0, fl1, fh1, & fregl0, fregh0, fregl1, fregh1, & hx, hy, idummy, jdummy) integer srcl0, srch0, srcl1, srch1 integer fl0, fh0, fl1, fh1 integer fregl0, fregh0, fregl1, fregh1 double precision hx, hy double precision src(srcl0:srch0,srcl1:srch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) double precision fac integer idummy, jdummy integer i, j fac = 0.5d0 do j = fregl1, fregh1 do i = fregl0, fregh0 src(i,j) = fac * & (uf(i,j-1) - uf(i-1,j-1) + & uf(i,j ) - uf(i-1,j) + & vf(i-1,j) - vf(i-1,j-1) + & vf(i ,j) - vf(i,j-1)) end do end do end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgfdiv_dense( & src, srcl0, srch0, srcl1, srch1, & uc, vc, & cl0, ch0, cl1, ch1, & uf, vf, & fl0, fh0, fl1, fh1, & cregl0, cregh0, cregl1, cregh1, & hx, hy, ir, jr, idim, idir, idd1, idd2) integer srcl0, srch0, srcl1, srch1 integer cl0, ch0, cl1, ch1 integer fl0, fh0, fl1, fh1 integer cregl0, cregh0, cregl1, cregh1 double precision hx, hy double precision src(srcl0:srch0,srcl1:srch1) double precision uc(cl0:ch0,cl1:ch1) double precision vc(cl0:ch0,cl1:ch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) integer ir, jr, idim, idir double precision fac0, fac1 integer i, j, iuf, juf, iuc, juc, m, n integer idd1, idd2 if (idim .eq. 0) then i = cregl0 if (idir .eq. 1) then iuc = i - 1 iuf = i * ir else iuc = i iuf = i * ir - 1 end if fac0 = 0.5d0 do j = cregl1, cregh1 src(i*ir,j*jr) = fac0 * & ((vc(iuc,j) - vc(iuc,j-1)) - & idir * (uc(iuc,j) + uc(iuc,j-1))) end do fac0 = fac0 / jr i = i * ir do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5d0 * fac1 do j = jr*cregl1, jr*cregh1, jr src(i,j) = src(i,j) + fac1 * & (idir * (uf(iuf,j-n) + uf(iuf,j-n-1) + & uf(iuf,j+n) + uf(iuf,j+n-1)) + & (vf(iuf,j-n) - vf(iuf,j-n-1) + & vf(iuf,j+n) - vf(iuf,j+n-1))) end do end do else j = cregl1 if (idir .eq. 1) then juc = j - 1 juf = j * jr else juc = j juf = j * jr - 1 end if fac0 = 0.5d0 do i = cregl0, cregh0 src(i*ir,j*jr) = fac0 * & ((uc(i,juc) - uc(i-1,juc)) - & idir * (vc(i,juc) + vc(i-1,juc))) end do fac0 = fac0 / ir j = j * jr do m = 0, ir-1 fac1 = (ir-m) * fac0 if (m .eq. 0) fac1 = 0.5d0 * fac1 do i = ir*cregl0, ir*cregh0, ir src(i,j) = src(i,j) + fac1 * & ((uf(i-m,juf) - uf(i-m-1,juf) + & uf(i+m,juf) - uf(i+m-1,juf)) + & idir * (vf(i-m,juf) + vf(i-m-1,juf) + & vf(i+m,juf) + vf(i+m-1,juf))) end do end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgcdiv_dense( & src, srcl0, srch0, srcl1, srch1, & uc, vc, & cl0, ch0, cl1, ch1, & uf, vf, & fl0, fh0, fl1, fh1, & cregl0, cregh0, cregl1, cregh1, & hx, hy, ir, jr, ga, idd) integer srcl0, srch0, srcl1, srch1 integer cl0, ch0, cl1, ch1 integer fl0, fh0, fl1, fh1 integer cregl0, cregh0, cregl1, cregh1 integer idd double precision hx, hy double precision src(srcl0:srch0,srcl1:srch1) double precision uc(cl0:ch0,cl1:ch1) double precision vc(cl0:ch0,cl1:ch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) integer ir, jr, ga(0:1,0:1) double precision sum, fac, fac1 integer ic, jc, if, jf, ii, ji, idir, jdir, m, n ic = cregl0 jc = cregl1 if = ic * ir jf = jc * jr sum = 0.d0 c quadrants do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) .eq. 1) then sum = sum + idir * uf(if+ii-1,jf+ji-1) & + jdir * vf(if+ii-1,jf+ji-1) else sum = sum + idir * uc(ic+ii-1,jc+ji-1) & + jdir * vc(ic+ii-1,jc+ji-1) end if end do end do c edges do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) - ga(ii,1-ji) .eq. 1) then fac1 = 1.d0 / ir do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( (uf(if+m, jf+ji-1) - & uf(if+m-1,jf+ji-1)) + & jdir * (vf(if+m, jf+ji-1) + & vf(if+m-1,jf+ji-1))) end do end if if (ga(ii,ji) - ga(1-ii,ji) .eq. 1) then fac1 = 1.d0 / jr do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * (idir * (uf(if+ii-1,jf+n) + & uf(if+ii-1,jf+n-1)) + & (vf(if+ii-1,jf+n) - & vf(if+ii-1,jf+n-1))) end do end if end do end do c weighting src(if,jf) = 0.5d0 * sum end c----------------------------------------------------------------------- subroutine hggrad( & gpx, gpy, gpl0, & gph0, gpl1, gph1, & dest, destl0, desth0, destl1, desth1, & fregl0, fregh0, fregl1, fregh1, & hx, hy, & irz) integer gpl0, gph0, gpl1, gph1 integer destl0, desth0, destl1, desth1 integer fregl0, fregh0, fregl1, fregh1 double precision gpx(gpl0:gph0,gpl1:gph1) double precision gpy(gpl0:gph0,gpl1:gph1) double precision dest(destl0:desth0,destl1:desth1) double precision hx, hy integer irz double precision hxm1h, hym1h, fac, r integer i, j hxm1h = 0.5d0 / hx hym1h = 0.5d0 / hy do j = fregl1, fregh1 do i = fregl0, fregh0 gpx(i,j) = hxm1h * (dest(i+1,j) + dest(i+1,j+1) - & dest(i,j) - dest(i,j+1)) gpy(i,j) = hym1h * (dest(i,j+1) + dest(i+1,j+1) - & dest(i,j) - dest(i+1,j)) end do end do end c----------------------------------------------------------------------- subroutine hgdiv( & src, srcl0, srch0, srcl1, srch1, & uf, vf, & fl0, fh0, fl1, fh1, & fregl0, fregh0, fregl1, fregh1, & hx, hy, & irz, imax) integer srcl0, srch0, srcl1, srch1 integer fl0, fh0, fl1, fh1 integer fregl0, fregh0, fregl1, fregh1 double precision src(srcl0:srch0,srcl1:srch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) double precision hx, hy integer irz, imax double precision hxm1, hym1, fac, r1, r0m, r1m integer i, j hxm1 = 1.d0 / hx hym1 = 1.d0 / hy fac = 0.5d0 do j = fregl1, fregh1 do i = fregl0, fregh0 src(i,j) = fac * & (hxm1 * (uf(i,j-1) - uf(i-1,j-1) + & uf(i,j) - uf(i-1,j)) + & hym1 * (vf(i-1,j) - vf(i-1,j-1) + & vf(i,j) - vf(i,j-1))) end do end do c This correction is *only* for the cross stencil if (irz .eq. 1 .and. fregl0 .le. 0 .and. fregh0 .ge. 0) then i = 0 do j = fregl1, fregh1 src(i,j) = src(i,j) - fac * hym1 * 0.5d0 * & (vf(i-1,j) - vf(i-1,j-1) + & vf(i,j) - vf(i ,j-1)) end do endif end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgfdiv( & src, srcl0, srch0, srcl1, srch1, & uc, vc, & cl0, ch0, cl1, ch1, & uf, vf, & fl0, fh0, fl1, fh1, & cregl0, cregh0, cregl1, cregh1, & hx, hy, ir, jr, idim, idir, irz, imax) integer srcl0, srch0, srcl1, srch1 integer cl0, ch0, cl1, ch1 integer fl0, fh0, fl1, fh1 integer cregl0, cregh0, cregl1, cregh1 double precision src(srcl0:srch0,srcl1:srch1) double precision uc(cl0:ch0,cl1:ch1) double precision vc(cl0:ch0,cl1:ch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) double precision hx, hy integer ir, jr, idim, idir, irz, imax double precision hxm1, hym1, fac0, fac1, r, rfac, rfac0, rfac1 double precision rfac0m, rfac1m, rfac0p, rfac1p integer i, j, iuf, juf, iuc, juc, m, n if (idim .eq. 0) then i = cregl0 if (idir .eq. 1) then iuc = i - 1 iuf = i * ir else iuc = i iuf = i * ir - 1 end if fac0 = ir / (ir + 1.d0) hxm1 = 1.d0 / (ir * hx) hym1 = 1.d0 / (jr * hy) do j = cregl1, cregh1 src(i*ir,j*jr) = fac0 * & (hym1 * (vc(iuc,j) - vc(iuc,j-1)) - & hxm1 * idir * (uc(iuc,j) + uc(iuc,j-1))) end do fac0 = fac0 / (ir * jr * jr) hxm1 = ir * hxm1 hym1 = jr * hym1 i = i * ir do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5d0 * fac1 do j = jr*cregl1, jr*cregh1, jr src(i,j) = src(i,j) + fac1 * & (hxm1 * idir * (uf(iuf,j-n) + uf(iuf,j-n-1) + & uf(iuf,j+n) + uf(iuf,j+n-1)) + & hym1 * (vf(iuf,j-n) - vf(iuf,j-n-1) + & vf(iuf,j+n) - vf(iuf,j+n-1))) end do end do else j = cregl1 if (idir .eq. 1) then juc = j - 1 juf = j * jr else juc = j juf = j * jr - 1 end if fac0 = jr / (jr + 1.d0) hxm1 = 1.d0 / (ir * hx) hym1 = 1.d0 / (jr * hy) do i = cregl0, cregh0 src(i*ir,j*jr) = fac0 * & (hxm1 * (uc(i,juc) - uc(i-1,juc)) - & hym1 * idir * (vc(i,juc) + vc(i-1,juc))) end do if (irz .eq. 1 .and. cregl0 .le. 0 .and. cregh0 .ge. 0) then i = 0 src(i*ir,j*jr) = fac0 * & (hxm1 * (uc(i,juc) - uc(i-1,juc)) - & hym1 * idir * (vc(i,juc) + vc(i-1,juc))*0.5d0 ) endif fac0 = fac0 / (ir * ir * jr) hxm1 = ir * hxm1 hym1 = jr * hym1 j = j * jr do m = 0, ir-1 fac1 = (ir-m) * fac0 if (m .eq. 0) fac1 = 0.5d0 * fac1 do i = ir*cregl0, ir*cregh0, ir src(i,j) = src(i,j) + fac1 * & (hxm1 * (uf(i-m,juf) - uf(i-m-1,juf) + & uf(i+m,juf) - uf(i+m-1,juf)) + & hym1 * idir * (vf(i-m,juf) + vf(i-m-1,juf) + & vf(i+m,juf) + vf(i+m-1,juf))) end do if (irz .eq. 1 .and. m .eq. 0 .and. & ir*cregl0 .le. 0 .and. ir*cregh0 .ge. 0) then i = 0 src(i,j) = src(i,j) - fac1 * 0.5d0 * & hym1 * idir * (vf(i-m,juf) + vf(i-m-1,juf) + & vf(i+m,juf) + vf(i+m-1,juf)) endif end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgcdiv( & src, srcl0,srch0,srcl1,srch1, & uc, vc, & cl0,ch0,cl1,ch1, & uf, vf, & fl0,fh0,fl1,fh1, & cregl0,cregh0,cregl1,cregh1, & hx, hy, ir, jr, ga, irz) integer srcl0,srch0,srcl1,srch1 integer cl0,ch0,cl1,ch1 integer fl0,fh0,fl1,fh1 integer cregl0,cregh0,cregl1,cregh1 double precision src(srcl0:srch0,srcl1:srch1) double precision uc(cl0:ch0,cl1:ch1) double precision vc(cl0:ch0,cl1:ch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) double precision hx, hy, hz integer ir, jr, kr, ga(0:1,0:1), irz double precision r3, hxm1, hym1, hxm1c, hym1c double precision sum, center, cfac, ffac, fac0, fac1, fac integer ic, jc, if, jf, iuc, iuf, juc, juf integer ii, ji, idir, jdir, l, m, n r3 = ir * jr hxm1c = 1.0D0 / (ir * hx) hym1c = 1.0D0 / (jr * hy) hxm1 = ir * hxm1c hym1 = jr * hym1c ic = cregl0 jc = cregl1 if = ic * ir jf = jc * jr sum = 0.0D0 center = 0.0D0 c octants fac = 1.0D0 ffac = 0.5D0 cfac = 0.5D0 * r3 do ji = 0, 1 jdir = 2 * ji - 1 juf = jf + ji - 1 juc = jc + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) .eq. 1) then iuf = if + ii - 1 center = center + ffac if (irz .eq. 1 .and. ic .eq. 0) then sum = sum + fac * & (hxm1 * idir * uf(iuf,juf) + & hym1 * jdir * vf(iuf,juf) * 0.5d0) else sum = sum + fac * & (hxm1 * idir * uf(iuf,juf) + & hym1 * jdir * vf(iuf,juf)) endif else iuc = ic + ii - 1 center = center + cfac if (irz .eq. 1 .and. ic .eq. 0) then sum = sum + r3 * & (hxm1c * idir * uc(iuc,juc) + & hym1c * jdir * vc(iuc,juc) * 0.5d0) else sum = sum + r3 * & (hxm1c * idir * uc(iuc,juc) + & hym1c * jdir * vc(iuc,juc)) endif end if end do end do c edges do ji = 0, 1 jdir = 2 * ji - 1 juf = jf + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 iuf = if + ii - 1 if (ga(ii,ji) - ga(ii,1-ji) .eq. 1) then fac1 = 1.0D0 / ir ffac = 0.5D0 * (ir-1) center = center + ffac do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * (hxm1 * & (uf(if+m,juf) - uf(if+m-1,juf)) + & hym1 * jdir * & (vf(if+m,juf) + vf(if+m-1,juf))) end do end if if (ga(ii,ji) - ga(1-ii,ji) .eq. 1) then fac1 = 1.0D0 / jr ffac = 0.5D0 * (jr-1) center = center + ffac do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * (hxm1 * idir * & (uf(iuf,jf+n) + uf(iuf,jf+n-1)) + & hym1 * & (vf(iuf,jf+n) - vf(iuf,jf+n-1))) end do end if end do end do c weighting src(if,jf) = sum / center end c----------------------------------------------------------------------- subroutine hgvort_dense( & src, srcl0, srch0, srcl1, srch1, & uf, vf, & fl0, fh0, fl1, fh1, & fregl0, fregh0, fregl1, fregh1, & hx, hy, idummy, jdummy) integer srcl0, srch0, srcl1, srch1 integer fl0, fh0, fl1, fh1 integer fregl0, fregh0, fregl1, fregh1 double precision hx, hy double precision src(srcl0:srch0,srcl1:srch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) double precision fac integer idummy, jdummy integer i, j fac = 0.5d0 do j = fregl1, fregh1 do i = fregl0, fregh0 src(i,j) = fac * ( & (vf(i,j-1) - vf(i-1,j-1) + & vf(i,j ) - vf(i-1,j )) - & (uf(i-1,j) - uf(i-1,j-1) + & uf(i ,j) - uf(i ,j-1)) ) end do end do end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgfvort_dense( & src, srcl0, srch0, srcl1, srch1, & uc, vc, & cl0, ch0, cl1, ch1, & uf, vf, & fl0, fh0, fl1, fh1, & cregl0, cregh0, cregl1, cregh1, & hx, hy, ir, jr, idim, idir, idd1, idd2) integer srcl0, srch0, srcl1, srch1 integer cl0, ch0, cl1, ch1 integer fl0, fh0, fl1, fh1 integer cregl0, cregh0, cregl1, cregh1 double precision hx, hy double precision src(srcl0:srch0,srcl1:srch1) double precision uc(cl0:ch0,cl1:ch1) double precision vc(cl0:ch0,cl1:ch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) integer ir, jr, idim, idir double precision fac0, fac1 integer i, j, iuf, juf, iuc, juc, m, n integer idd1, idd2 if (idim .eq. 0) then i = cregl0 if (idir .eq. 1) then iuc = i - 1 iuf = i * ir else iuc = i iuf = i * ir - 1 end if fac0 = 0.5d0 do j = cregl1, cregh1 src(i*ir,j*jr) = fac0 * & (-(uc(iuc,j) - uc(iuc,j-1)) - & idir * (vc(iuc,j) + vc(iuc,j-1))) end do fac0 = fac0 / jr i = i * ir do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5d0 * fac1 do j = jr*cregl1, jr*cregh1, jr src(i,j) = src(i,j) + fac1 * & (idir * (vf(iuf,j-n) + vf(iuf,j-n-1) + & vf(iuf,j+n) + vf(iuf,j+n-1)) - & (uf(iuf,j-n) - uf(iuf,j-n-1) + & uf(iuf,j+n) - uf(iuf,j+n-1))) end do end do else j = cregl1 if (idir .eq. 1) then juc = j - 1 juf = j * jr else juc = j juf = j * jr - 1 end if fac0 = 0.5d0 do i = cregl0, cregh0 src(i*ir,j*jr) = fac0 * & ((vc(i,juc) - vc(i-1,juc)) + & idir * (uc(i,juc) + uc(i-1,juc))) end do fac0 = fac0 / ir j = j * jr do m = 0, ir-1 fac1 = (ir-m) * fac0 if (m .eq. 0) fac1 = 0.5d0 * fac1 do i = ir*cregl0, ir*cregh0, ir src(i,j) = src(i,j) + fac1 * & ((vf(i-m,juf) - vf(i-m-1,juf) + & vf(i+m,juf) - vf(i+m-1,juf)) - & idir * (uf(i-m,juf) + uf(i-m-1,juf) + & uf(i+m,juf) + uf(i+m-1,juf))) end do end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgcvort_dense( & src, srcl0, srch0, srcl1, srch1, & uc, vc, & cl0, ch0, cl1, ch1, & uf, vf, & fl0, fh0, fl1, fh1, & cregl0, cregh0, cregl1, cregh1, & hx, hy, ir, jr, ga, idd) integer srcl0, srch0, srcl1, srch1 integer cl0, ch0, cl1, ch1 integer fl0, fh0, fl1, fh1 integer cregl0, cregh0, cregl1, cregh1 integer idd double precision hx, hy double precision src(srcl0:srch0,srcl1:srch1) double precision uc(cl0:ch0,cl1:ch1) double precision vc(cl0:ch0,cl1:ch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) integer ir, jr, ga(0:1,0:1) double precision sum, fac, fac1 integer ic, jc, if, jf, ii, ji, idir, jdir, m, n ic = cregl0 jc = cregl1 if = ic * ir jf = jc * jr sum = 0.d0 c quadrants do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) .eq. 1) then sum = sum + idir * vf(if+ii-1,jf+ji-1) & - jdir * uf(if+ii-1,jf+ji-1) else sum = sum + idir * vc(ic+ii-1,jc+ji-1) & - jdir * uc(ic+ii-1,jc+ji-1) end if end do end do c edges do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) - ga(ii,1-ji) .eq. 1) then fac1 = 1.d0 / ir do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( (vf(if+m, jf+ji-1) - & vf(if+m-1,jf+ji-1)) - & jdir * (uf(if+m, jf+ji-1) + & uf(if+m-1,jf+ji-1))) end do end if if (ga(ii,ji) - ga(1-ii,ji) .eq. 1) then fac1 = 1.d0 / jr do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * (idir * (vf(if+ii-1,jf+n) + & vf(if+ii-1,jf+n-1)) - & (uf(if+ii-1,jf+n) - & uf(if+ii-1,jf+n-1))) end do end if end do end do c weighting src(if,jf) = 0.5d0 * sum end c----------------------------------------------------------------------- subroutine hgvort( & src, srcl0, srch0, srcl1, srch1, & uf, vf, & fl0, fh0, fl1, fh1, & fregl0, fregh0, fregl1, fregh1, & hx, hy, & irz, imax) integer srcl0, srch0, srcl1, srch1 integer fl0, fh0, fl1, fh1 integer fregl0, fregh0, fregl1, fregh1 double precision src(srcl0:srch0,srcl1:srch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) double precision hx, hy integer irz, imax double precision hxm1, hym1, fac, r1, r0m, r1m integer i, j hxm1 = 1.d0 / hx hym1 = -1.d0 / hy fac = 0.5d0 if (irz .eq. 1) then print *,'NOT SET UP TO DO VORTICITY IN R-Z: HGVORT' stop endif do j = fregl1, fregh1 do i = fregl0, fregh0 src(i,j) = fac * & (hxm1 * (vf(i,j-1) - vf(i-1,j-1) + & vf(i,j) - vf(i-1,j)) + & hym1 * (uf(i-1,j) - uf(i-1,j-1) + & uf(i,j) - uf(i,j-1))) end do end do end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgfvort( & src, srcl0, srch0, srcl1, srch1, & uc, vc, & cl0, ch0, cl1, ch1, & uf, vf, & fl0, fh0, fl1, fh1, & cregl0, cregh0, cregl1, cregh1, & hx, hy, ir, jr, idim, idir, irz, imax) integer srcl0, srch0, srcl1, srch1 integer cl0, ch0, cl1, ch1 integer fl0, fh0, fl1, fh1 integer cregl0, cregh0, cregl1, cregh1 double precision src(srcl0:srch0,srcl1:srch1) double precision uc(cl0:ch0,cl1:ch1) double precision vc(cl0:ch0,cl1:ch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) double precision hx, hy integer ir, jr, idim, idir, irz, imax double precision hxm1, hym1, fac0, fac1, r, rfac, rfac0, rfac1 double precision rfac0m, rfac1m, rfac0p, rfac1p integer i, j, iuf, juf, iuc, juc, m, n if (irz .eq. 1) then print *,'NOT SET UP TO DO VORTICITY IN R-Z: HGFVORT' stop endif if (idim .eq. 0) then i = cregl0 if (idir .eq. 1) then iuc = i - 1 iuf = i * ir else iuc = i iuf = i * ir - 1 end if fac0 = ir / (ir + 1.d0) hxm1 = 1.d0 / (ir * hx) hym1 = -1.d0 / (jr * hy) do j = cregl1, cregh1 src(i*ir,j*jr) = fac0 * & (hym1 * (uc(iuc,j) - uc(iuc,j-1)) - & hxm1 * idir * (vc(iuc,j) + vc(iuc,j-1))) end do fac0 = fac0 / (ir * jr * jr) hxm1 = ir * hxm1 hym1 = jr * hym1 i = i * ir do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5d0 * fac1 do j = jr*cregl1, jr*cregh1, jr src(i,j) = src(i,j) + fac1 * & (hxm1 * idir * (vf(iuf,j-n) + vf(iuf,j-n-1) + & vf(iuf,j+n) + vf(iuf,j+n-1)) + & hym1 * (uf(iuf,j-n) - uf(iuf,j-n-1) + & uf(iuf,j+n) - uf(iuf,j+n-1))) end do end do else j = cregl1 if (idir .eq. 1) then juc = j - 1 juf = j * jr else juc = j juf = j * jr - 1 end if fac0 = jr / (jr + 1.d0) hxm1 = 1.d0 / (ir * hx) hym1 = -1.d0 / (jr * hy) do i = cregl0, cregh0 src(i*ir,j*jr) = fac0 * & (hxm1 * (vc(i,juc) - vc(i-1,juc)) - & hym1 * idir * (uc(i,juc) + uc(i-1,juc))) end do fac0 = fac0 / (ir * ir * jr) hxm1 = ir * hxm1 hym1 = jr * hym1 j = j * jr do m = 0, ir-1 fac1 = (ir-m) * fac0 if (m .eq. 0) fac1 = 0.5d0 * fac1 do i = ir*cregl0, ir*cregh0, ir src(i,j) = src(i,j) + fac1 * & (hxm1 * (vf(i-m,juf) - vf(i-m-1,juf) + & vf(i+m,juf) - vf(i+m-1,juf)) + & hym1 * idir * (uf(i-m,juf) + uf(i-m-1,juf) + & uf(i+m,juf) + uf(i+m-1,juf))) end do end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgcvort( & src, srcl0,srch0,srcl1,srch1, & uc, vc, & cl0,ch0,cl1,ch1, & uf, vf, & fl0,fh0,fl1,fh1, & cregl0,cregh0,cregl1,cregh1, & hx, hy, ir, jr, ga, irz) integer srcl0,srch0,srcl1,srch1 integer cl0,ch0,cl1,ch1 integer fl0,fh0,fl1,fh1 integer cregl0,cregh0,cregl1,cregh1 double precision src(srcl0:srch0,srcl1:srch1) double precision uc(cl0:ch0,cl1:ch1) double precision vc(cl0:ch0,cl1:ch1) double precision uf(fl0:fh0,fl1:fh1) double precision vf(fl0:fh0,fl1:fh1) double precision hx, hy, hz integer ir, jr, kr, ga(0:1,0:1), irz double precision r3, hxm1, hym1, hxm1c, hym1c double precision sum, center, cfac, ffac, fac0, fac1, fac integer ic, jc, if, jf, iuc, iuf, juc, juf integer ii, ji, idir, jdir, l, m, n if (irz .eq. 1) then print *,'NOT SET UP TO DO VORTICITY IN R-Z: HGCVORT' stop endif r3 = ir * jr hxm1c = 1.0D0 / (ir * hx) hym1c = 1.0D0 / (jr * hy) hxm1 = ir * hxm1c hym1 = -jr * hym1c ic = cregl0 jc = cregl1 if = ic * ir jf = jc * jr sum = 0.0D0 center = 0.0D0 c octants fac = 1.0D0 ffac = 0.5D0 cfac = 0.5D0 * r3 do ji = 0, 1 jdir = 2 * ji - 1 juf = jf + ji - 1 juc = jc + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) .eq. 1) then iuf = if + ii - 1 center = center + ffac sum = sum + fac * & (hxm1 * idir * vf(iuf,juf) + & hym1 * jdir * uf(iuf,juf)) else iuc = ic + ii - 1 center = center + cfac sum = sum + r3 * & (hxm1c * idir * vc(iuc,juc) + & hym1c * jdir * uc(iuc,juc)) end if end do end do c edges do ji = 0, 1 jdir = 2 * ji - 1 juf = jf + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 iuf = if + ii - 1 if (ga(ii,ji) - ga(ii,1-ji) .eq. 1) then fac1 = 1.0D0 / ir ffac = 0.5D0 * (ir-1) center = center + ffac do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * (hxm1 * & (vf(if+m,juf) - vf(if+m-1,juf)) + & hym1 * jdir * & (uf(if+m,juf) + uf(if+m-1,juf))) end do end if if (ga(ii,ji) - ga(1-ii,ji) .eq. 1) then fac1 = 1.0D0 / jr ffac = 0.5D0 * (jr-1) center = center + ffac do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * (hxm1 * idir * & (vf(iuf,jf+n) + vf(iuf,jf+n-1)) + & hym1 * & (uf(iuf,jf+n) - uf(iuf,jf+n-1))) end do end if end do end do c weighting src(if,jf) = sum / center end ccseapps-2.5/CCSEApps/hgproj/restrictor.H0000644000175000017500000001006611634153073021464 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _RESTRICTOR_H_ #define _RESTRICTOR_H_ #include "interface.H" #include "boundary.H" // // This is the base class for all amr_restrictors. The basic functions // box and fill work in the interiors of patches: Give box the fine // grid dimensions and it will tell you what coarse patch you can fill // from it; fill then does the work. The interface routine is for // restrictors like node-based full-weighting that do special stuff // at the edges of grids. // class amr_restrictor { public: virtual ~amr_restrictor () = 0; virtual Box box (const Box&, const IntVect&) const; virtual Box rebox (const Box&, const IntVect&) const; virtual void fill (FArrayBox&, const Box&, const FArrayBox&, const IntVect&) const = 0; virtual void fill_interface (MultiFab&, MultiFab&, const level_interface&, const amr_boundary*, const IntVect&) const; }; class cell_average_restrictor : public amr_restrictor { public: explicit cell_average_restrictor (int i) ; virtual void fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const; protected: int integrate; }; inline cell_average_restrictor::cell_average_restrictor (int i) : integrate(i) { } class terrain_velocity_restrictor : public cell_average_restrictor { public: explicit terrain_velocity_restrictor (int i) ; virtual void fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const; }; inline terrain_velocity_restrictor::terrain_velocity_restrictor (int i) : cell_average_restrictor(i) { BL_ASSERT(i >= 0 && i < BL_SPACEDIM); } class injection_restrictor : public amr_restrictor { public: virtual void fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const; }; class default_restrictor : public amr_restrictor { public: virtual void fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const; }; // // Vanilla bilinear (full-weighting) restrictor class. // Restricts fine-fine interfaces, even those at the boundary. // Does nothing at coarse-fine interfaces. // class bilinear_restrictor : public amr_restrictor { public: bilinear_restrictor (int i, bool hg_terrain); virtual Box box (const Box& fb, const IntVect& rat) const; virtual Box rebox (const Box& cb, const IntVect& rat) const; virtual void fill (FArrayBox& patch, const Box& region, const FArrayBox& fgr, const IntVect& rat) const; virtual void fill_interface (MultiFab&, MultiFab&, const level_interface&, const amr_boundary*, const IntVect&) const; protected: int integrate; bool m_hg_dense; }; #endif /*_RESTRICTOR_H_*/ ccseapps-2.5/CCSEApps/hgproj/interface.cpp0000644000175000017500000005005511634153073021621 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include "interface.H" #include "boundary.H" const level_interface default_level_interface; inline void ins (std::list& bl, const Box& b) { if (std::find(bl.begin(),bl.end(),b) == bl.end()) bl.push_back(b); } level_interface::~level_interface() { if (!ok()) return; if (status & 1) { // // Owns boxes. // delete [] pf; for (int i = 0; i < BL_SPACEDIM; i++) { delete [] bx[i]; if (i > 0) delete [] nodebx[i]; } } if (status & 2) { // // Owns flag arrays. // delete [] grid_ref; delete [] fdm; for (int i = 0; i < BL_SPACEDIM; i++) { delete [] ge[i]; delete [] ax[i]; delete [] flg[i]; } delete [] fgr; #if (BL_SPACEDIM == 3) delete [] egr; #endif delete [] cgr; } } void level_interface::copy (const level_interface& src) { if (ok()) BoxLib::Error( "level_interface::copy" "this object already allocated" ); status = 0; dom = src.dom; im = src.im; em = src.em; grid_ref = src.grid_ref; fdm = src.fdm; for (int i = 0; i < BL_SPACEDIM; i++) { nbx[i] = src.nbx[i]; ge[i] = src.ge[i]; ax[i] = src.ax[i]; flg[i] = src.flg[i]; } fgr = src.fgr; #if BL_SPACEDIM==3 egr = src.egr; #endif cgr = src.cgr; pf = src.pf; for (int i = 0; i < BL_SPACEDIM; i++) { bx[i] = src.bx[i]; nodebx[i] = src.nodebx[i]; } } void level_interface::alloc_coarsened (const BoxArray& Im, const amr_boundary* /*bdy*/, const level_interface& src, const IntVect& rat) { if (ok()) BoxLib::Error( "level_interface::alloc_coarsened" "this object already allocated" ); status = 1; dom = BoxLib::coarsen(src.dom, rat); im = Im; grid_ref = src.grid_ref; fdm = src.fdm; for (int i = 0; i < BL_SPACEDIM; i++) { nbx[i] = src.nbx[i]; ge[i] = src.ge[i]; ax[i] = src.ax[i]; flg[i] = src.flg[i]; } fgr = src.fgr; #if BL_SPACEDIM == 3 egr = src.egr; #endif cgr = src.cgr; for (int i = 0; i < BL_SPACEDIM; i++) { bx[i] = new Box[nbx[i]]; for (int igrid = 0; igrid < nbx[i]; igrid++) { bx[i][igrid] = BoxLib::coarsen(src.bx[i][igrid], rat); } } nodebx[0] = bx[0]; for (int i = 1; i < BL_SPACEDIM; i++) { nodebx[i] = new Box[nbx[i]]; for (int igrid = 0; igrid < nbx[i]; igrid++) { nodebx[i][igrid] = BoxLib::coarsen(src.nodebx[i][igrid], rat); } } pf = new Box[im.size()]; for (int igrid = 0; igrid < im.size(); igrid++) { pf[igrid] = im[igrid]; pf[igrid].convert(IntVect::TheNodeVector()).grow(-1); } int idim = FACEDIM; for (int iface = 0; iface < nbx[idim]; iface++) { if ( ge[idim][iface] == ALL && !flg[idim][iface] ) { int igrid; if ((igrid = fgr[iface][0]) >= 0) { if (!pf[igrid].intersects(nodebx[idim][iface])) pf[igrid].growHi(fdm[iface], 1); } if ((igrid = fgr[iface][1]) >= 0) { if (!pf[igrid].intersects(nodebx[idim][iface])) pf[igrid].growLo(fdm[iface], 1); } } } } void level_interface::alloc (const BoxArray& Im, const Box& Domain, const amr_boundary* bdy) { if (ok()) BoxLib::Error( "level_interface::alloc" "this object already allocated" ); status = 3; dom = Domain; im = Im; BL_ASSERT( bdy != 0 ); bdy->boundary_mesh(em, grid_ref, im, dom); // // Add edges in 2D or faces in 3D: // std::list bl; for (int igrid = 0; igrid < im.size(); igrid++) { for (int i = 0; i < BL_SPACEDIM; i++) { IntVect t = IntVect::TheCellVector(); t[i] = IndexType::NODE; Box lo = BoxLib::bdryLo(im[igrid],i).convert(t); Box hi = BoxLib::bdryHi(im[igrid],i).convert(t); add(bl,lo,0); add(bl,hi,0); } } bdy->duplicate(bl, dom); xfer(bl, FACEDIM); bl.clear(); #if (BL_SPACEDIM == 3) // // Add edges in 3D: // for (int iface = 0; iface < nbx[2]; iface++) { for (int i = 0; i < BL_SPACEDIM; i++) { IntVect t = bx[2][iface].type(); if (t[i] == IndexType::NODE) continue; else t[i] = IndexType::NODE; Box lo = BoxLib::bdryLo(bx[2][iface], i).convert(t); Box hi = BoxLib::bdryHi(bx[2][iface], i).convert(t); add(bl, lo, 0); add(bl, hi, 0); } } bdy->duplicate(bl, dom); xfer(bl, 1); bl.clear(); #endif // // Add corners: // for (int iedge = 0; iedge < nbx[1]; iedge++) { const IntVect t = bx[1][iedge].type(); for (int i = 0; i < BL_SPACEDIM; i++) { if (t[i] == IndexType::NODE) continue; ins(bl, BoxLib::bdryLo(bx[1][iedge], i)); ins(bl, BoxLib::bdryHi(bx[1][iedge], i)); } } bdy->duplicate(bl, dom); xfer(bl, 0); bl.clear(); // // Initialize face direction array. // fdm = new int[nbx[FACEDIM]]; for (int iface = 0; iface < nbx[FACEDIM]; iface++) { const IntVect t = bx[FACEDIM][iface].type(); fdm[iface] = -1; for (int i = 0; i < BL_SPACEDIM; i++) { if (t[i] == IndexType::NODE) { // // One and only one face will be designated as a the direction. // BL_ASSERT(fdm[iface] == -1); fdm[iface] = i; } } BL_ASSERT(fdm[iface] >= 0 && fdm[iface] < BL_SPACEDIM); } // // Initialize face grid array. // int idim = FACEDIM; fgr = new int[nbx[idim]][N_FACE_GRIDS]; for (int iface = 0; iface < nbx[idim]; iface++) { Box b = bx[idim][iface]; int id = fdm[iface]; b.growLo(id, 1).convert(IntVect::TheCellVector()); int imask = 1; flg[idim][iface] = false; for (int i = 0; i < N_FACE_GRIDS; i++) { fgr[iface][i] = -1; if ( ge[idim][iface] & imask ) { if (dom.contains(b)) { for (int igrid = 0; igrid < im.size(); igrid++) { if (im[igrid].contains(b)) { fgr[iface][i] = igrid; break; } } } else { for (int igrid = 0; igrid < em.size(); igrid++) { if (em[igrid].contains(b)) { fgr[iface][i] = -2 - igrid; if (grid_ref[igrid] == -2) flg[idim][iface] = true; break; } } } } b.shift(id, 1); imask <<= (1 << id); } } #if (BL_SPACEDIM == 2) // egr = fgr; #else // // Initialize edge grid array. // idim = 1; egr = new int[nbx[idim]][N_EDGE_GRIDS]; for (int iedge = 0; iedge < nbx[idim]; iedge++) { Box b = bx[idim][iedge]; const IntVect t = b.type(); int id = 0; if (t[id] == IndexType::CELL) id++; int jd = id + 1; if (t[jd] == IndexType::CELL) jd++; b.growLo(id, 1).growLo(jd, 1).convert(IntVect::TheCellVector()); int imask = 1; flg[idim][iedge] = false; for (int i = 0; i < N_EDGE_GRIDS; i++) { egr[iedge][i] = -1; if ( ge[idim][iedge] & imask ) { if (dom.contains(b)) { for (int igrid = 0; igrid < im.size(); igrid++) { if (im[igrid].contains(b)) { egr[iedge][i] = igrid; break; } } } else { for (int igrid = 0; igrid < em.size(); igrid++) { if (em[igrid].contains(b)) { egr[iedge][i] = -2 - igrid; if (grid_ref[igrid] == -2) flg[idim][iedge] = true; break; } } } } if ((i & 1) == 1) { b.shift(id, -1).shift(jd, 1); imask <<= ((1 << jd) - (1 << id)); } else { b.shift(id, 1); imask <<= (1 << id); } } } #endif // // Initialize corner grid array. // idim = 0; cgr = new int[nbx[idim]][N_CORNER_GRIDS]; for (int icor = 0; icor < nbx[idim]; icor++) { Box b = bx[idim][icor]; #if (BL_SPACEDIM == 3) b.growLo(2, 1); #endif b.growLo(0, 1).growLo(1, 1).convert(IntVect::TheCellVector()); int imask = 1; flg[idim][icor] = false; for (int i = 0; i < N_CORNER_GRIDS; i++) { cgr[icor][i] = -1; if ( ge[idim][icor] & imask ) { if (dom.contains(b)) { for (int igrid = 0; igrid < im.size(); igrid++) { if (im[igrid].contains(b)) { cgr[icor][i] = igrid; break; } } } else { for (int igrid = 0; igrid < em.size(); igrid++) { if (em[igrid].contains(b)) { cgr[icor][i] = -2 - igrid; if (grid_ref[igrid] == -2) flg[idim][icor] = true; break; } } } } #if (BL_SPACEDIM == 3) if ((i & 3) == 3) b.shift(0, -1).shift(1, -1).shift(2, 1); else #endif if ((i & 1) == 1) b.shift(0, -1).shift(1, 1); else b.shift(0, 1); imask <<= 1; } } nodebx[0] = bx[0]; for (int i = 1; i < BL_SPACEDIM; i++) { nodebx[i] = new Box[nbx[i]]; for (int iface = 0; iface < nbx[i]; iface++) { nodebx[i][iface] = bx[i][iface]; nodebx[i][iface].convert(IntVect::TheNodeVector()); } } pf = new Box[im.size()]; for (int igrid = 0; igrid < im.size(); igrid++) { //pf[igrid] = im.boxn(igrid); //pf[igrid].grow(-1); pf[igrid] = im[igrid]; pf[igrid].convert(IntVect::TheNodeVector()).grow(-1); } idim = FACEDIM; for (int iface = 0; iface < nbx[idim]; iface++) { if ( ge[idim][iface] == ALL && !flg[idim][iface] ) { int igrid; if ((igrid = fgr[iface][0]) >= 0) { if (!pf[igrid].intersects(nodebx[idim][iface])) pf[igrid].growHi(fdm[iface], 1); } if ((igrid = fgr[iface][1]) >= 0) { if (!pf[igrid].intersects(nodebx[idim][iface])) pf[igrid].growLo(fdm[iface], 1); } } } ax[idim] = new int[nbx[idim]]; for (int iface = 0; iface < nbx[idim]; iface++) { ax[idim][iface] = -1; if ( ge[idim][iface] != ALL ) { for (int i = 0; i < 2; i++) { int igrid; if ((igrid = fgr[iface][i]) >= 0) { if (pf[igrid].intersects(nodebx[idim][iface])) { ax[idim][iface] = igrid; } } } } } #if (BL_SPACEDIM == 3) ax[1] = new int[nbx[1]]; for (int iedge = 0; iedge < nbx[1]; iedge++) { ax[1][iedge] = -1; if ( ge[1][iedge] != ALL ) { for (int i = 0; i < N_EDGE_GRIDS && ax[1][iedge] == -1; i++) { int igrid; if ((igrid = egr[iedge][i]) >= 0) { if (pf[igrid].intersects(nodebx[1][iedge])) { ax[1][iedge] = igrid; IntVect iv(1,1,1); IndexType ityp(IndexType(iv)); int first = -1; for (int iface = 0; iface < nbx[2] && first==-1; iface++) { if (ax[2][iface] == igrid) first = iface; } if (first != -1) { BoxList face_list(nodebx[2][first]); for (int iface = 0; iface < nbx[2]; iface++) if (ax[2][iface] == igrid && iface != first) face_list.push_back(nodebx[2][iface]); BoxArray face_array(face_list); if (face_array.contains(nodebx[1][iedge])) ax[1][iedge] = -1; } } } } } } #endif ax[0] = new int[nbx[0]]; for (int icor = 0; icor < nbx[0]; icor++) { ax[0][icor] = -1; if ( ge[0][icor] != ALL ) { for (int i = 0; i < N_CORNER_GRIDS && ax[0][icor] == -1; i++) { int igrid; if ((igrid = cgr[icor][i]) >= 0) { if (pf[igrid].intersects(nodebx[0][icor])) { ax[0][icor] = igrid; #if (BL_SPACEDIM == 3) for (int iface = 0; iface < nbx[2]; iface++) { if (ax[2][iface] == igrid) { if (nodebx[2][iface].contains(nodebx[0][icor])) ax[0][icor] = -1; } } #endif for (int iedge = 0; iedge < nbx[1]; iedge++) { if (ax[1][iedge] == igrid) { if (nodebx[1][iedge].contains(nodebx[0][icor])) ax[0][icor] = -1; } } } } } } } } void level_interface::add (std::list& bl, Box b, int startgrid) { const IntVect t = b.type(); for (int igrid = startgrid; igrid < im.size() + em.size(); igrid++) { Box ibox; if (igrid < im.size()) ibox = im[igrid]; else ibox = em[igrid-im.size()]; ibox.convert(t); if (ibox.intersects(b) && !ibox.contains(b)) { for (int i = 0; i < BL_SPACEDIM; i++) { if (t[i] == IndexType::CELL) { if (ibox.smallEnd(i) > b.smallEnd(i)) { Box c = b.chop(i, ibox.smallEnd(i)); add(bl, b, igrid + 1); add(bl, c, igrid); return; } if (ibox.bigEnd(i) < b.bigEnd(i)) { Box c = b.chop(i, ibox.bigEnd(i) + 1); add(bl, b, igrid); add(bl, c, igrid + 1); return; } } } BoxLib::Abort("level_interface::add(): Can't happen."); } } ins(bl, b); } void level_interface::xfer (const std::list& bl, int idim) { nbx[idim] = bl.size(); bx[idim] = new Box[nbx[idim]]; ge[idim] = new unsigned int[nbx[idim]]; flg[idim] = new bool[nbx[idim]]; std::list::const_iterator bn = bl.begin(); for (int i = 0; bn != bl.end(); ++bn, ++i) { bx[idim][i] = *bn; const Box btmp = BoxLib::grow(*bn,bn->type()).convert(IntVect::TheCellVector()); IntVect tmp = btmp.smallEnd(); if (dom.contains(btmp)) { ge[idim][i] = im.contains(tmp); #if (BL_SPACEDIM == 2) tmp += IntVect(1, 0); ge[idim][i] |= im.contains(tmp) << 1; tmp += IntVect(-1, 1); ge[idim][i] |= im.contains(tmp) << 2; tmp += IntVect(1, 0); ge[idim][i] |= im.contains(tmp) << 3; #else tmp += IntVect(1, 0, 0); ge[idim][i] |= im.contains(tmp) << 1; tmp += IntVect(-1, 1, 0); ge[idim][i] |= im.contains(tmp) << 2; tmp += IntVect(1, 0, 0); ge[idim][i] |= im.contains(tmp) << 3; tmp += IntVect(-1, -1, 1); ge[idim][i] |= im.contains(tmp) << 4; tmp += IntVect(1, 0, 0); ge[idim][i] |= im.contains(tmp) << 5; tmp += IntVect(-1, 1, 0); ge[idim][i] |= im.contains(tmp) << 6; tmp += IntVect(1, 0, 0); ge[idim][i] |= im.contains(tmp) << 7; #endif } else { bool is_in = dom.contains(tmp); ge[idim][i] = ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)); #if (BL_SPACEDIM == 2) tmp += IntVect(1, 0); is_in = dom.contains(tmp); ge[idim][i] |= ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)) << 1; tmp += IntVect(-1, 1); is_in = dom.contains(tmp); ge[idim][i] |= ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)) << 2; tmp += IntVect(1, 0); is_in = dom.contains(tmp); ge[idim][i] |= ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)) << 3; #else tmp += IntVect(1, 0, 0); is_in = dom.contains(tmp); ge[idim][i] |= ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)) << 1; tmp += IntVect(-1, 1, 0); is_in = dom.contains(tmp); ge[idim][i] |= ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)) << 2; tmp += IntVect(1, 0, 0); is_in = dom.contains(tmp); ge[idim][i] |= ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)) << 3; tmp += IntVect(-1, -1, 1); is_in = dom.contains(tmp); ge[idim][i] |= ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)) << 4; tmp += IntVect(1, 0, 0); is_in = dom.contains(tmp); ge[idim][i] |= ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)) << 5; tmp += IntVect(-1, 1, 0); is_in = dom.contains(tmp); ge[idim][i] |= ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)) << 6; tmp += IntVect(1, 0, 0); is_in = dom.contains(tmp); ge[idim][i] |= ( is_in && im.contains(tmp) || !is_in && em.contains(tmp)) << 7; #endif } } // // Sort fine-fine boxes to beginning of list. // int j = nbx[idim]; for (int i = 0; i < j; i++) { if (ge[idim][i] != ALL) { while (--j > i) { if (ge[idim][j] == ALL) { Box btmp = bx[idim][j]; bx[idim][j] = bx[idim][i]; bx[idim][i] = btmp; ge[idim][j] = ge[idim][i]; ge[idim][i] = ALL; break; } } } } Box idomain = dom; idomain.convert(IntVect::TheNodeVector()).grow(-1); j = -1; while (++j < nbx[idim] && ge[idim][j] == ALL) /* nothing*/; const int nff = j; // // Sort interior fine-fine boxes to beginning of list. // if (idim == 0) { for (int i = 0; i < j; i++) { if (!bx[idim][i].intersects(idomain)) { while (--j > i) { Box btmp = bx[idim][j]; if (btmp.intersects(idomain)) { bx[idim][j] = bx[idim][i]; bx[idim][i] = btmp; break; } } } } } else { for (int i = 0; i < j; i++) { Box btmp = bx[idim][i]; btmp.convert(IntVect::TheNodeVector()); if (!btmp.intersects(idomain)) { while (--j > i) { Box btmp = bx[idim][j]; btmp.convert(IntVect::TheNodeVector()); if (btmp.intersects(idomain)) { Box btmp = bx[idim][j]; bx[idim][j] = bx[idim][i]; bx[idim][i] = btmp; break; } } } } } if (idim == FACEDIM) { j = -1; while (++j < nff) { Box btmp = bx[idim][j]; btmp.convert(IntVect::TheNodeVector()); if (!btmp.intersects(idomain)) break; } const int nin = j; // // Sort interior faces according to orientation, x first. // for (int i = 0; i < j; i++) { if (bx[idim][i].type(0) == IndexType::CELL) { while (--j > i) { if (bx[idim][j].type(0) == IndexType::NODE) { Box btmp = bx[idim][j]; bx[idim][j] = bx[idim][i]; bx[idim][i] = btmp; break; } } } } #if (BL_SPACEDIM == 3) j = nin; for (int i = 0; i < j; i++) { if (bx[idim][i].type(0) == IndexType::CELL) { if (bx[idim][i].type(1) == IndexType::CELL) { while (--j > i) { if (bx[idim][j].type(1) == IndexType::NODE) { Box btmp = bx[idim][j]; bx[idim][j] = bx[idim][i]; bx[idim][i] = btmp; break; } } } } } #endif // // Sort exterior faces according to orientation, x first. // j = nff; for (int i = nin; i < j; i++) { if (bx[idim][i].type(0) == IndexType::CELL) { while (--j > i) { if (bx[idim][j].type(0) == IndexType::NODE) { Box btmp = bx[idim][j]; bx[idim][j] = bx[idim][i]; bx[idim][i] = btmp; break; } } } } #if (BL_SPACEDIM == 3) j = nff; for (int i = nin; i < j; i++) { if (bx[idim][i].type(0) == IndexType::CELL) { if (bx[idim][i].type(1) == IndexType::CELL) { while (--j > i) { if (bx[idim][j].type(1) == IndexType::NODE) { Box btmp = bx[idim][j]; bx[idim][j] = bx[idim][i]; bx[idim][i] = btmp; break; } } } } } #endif } } Array level_interface::geo_array (int idim, int i) const { Array ga(N_CORNER_GRIDS); unsigned int gtmp = geo(idim, i); for (int k = 0; k < N_CORNER_GRIDS; k++) { ga[k] = (gtmp & 1); gtmp >>= 1; } return ga; } ccseapps-2.5/CCSEApps/hgproj/files.3d0000644000175000017500000000707711634153073020515 0ustar amckinstryamckinstryUSING INPUTS FILE: pcode=2 nrep=1 tol=2.0e-10 geometry.coord_sys=0 geometry.prob_lo=0 0 0 geometry.prob_hi=1 1 1 # # Can be cross, terrain or full. # stencil=cross # # Boundary conditions # bc00=periodic bc01=periodic #bc10=periodic #bc11=periodic #bc20=periodic #bc21=periodic ALL OF THESE WORK WITH THE CODE AS OF 3/12/02: gt0 OK for 0 gt010 OK for 0 gt012 OK for 0 gt016 OK for 0 gt05 OK for 0 gt1 OK for 0 gt3 OK for 0 gt.32 OK for 0 gt4 OK for 0 gt5 OK for 0 gt6 OK for 0 gt.bill1 OK for 0 gt2 OK for 1 and OK for 0-1 gt2t1 OK for 1 and OK for 0-1 gt2t4 OK for 1 and OK for 0-1 gt3ann OK for 1 and OK for 0-1 gt4s2 OK for 1 and OK for 0-1 gt4s2.4.4 OK for 1 and OK for 0-1 gt4s2a OK for 1 and OK for 0-1 gt4s4 OK for 1 and OK for 0-1 gt4s4.2.4 OK for 1 and OK for 0-1 gt4s4.4.2 OK for 1 and OK for 0-1 gt5s2 OK for 1 and OK for 0-1 gt5s4 OK for 1 and OK for 0-1 gt6s OK for 1 and OK for 0-1 gt6s2 OK for 1 and OK for 0-1 gt6s4 OK for 1 and OK for 0-1 gt7a OK for 1 and OK for 0-1 gt7aa OK for 1 and OK for 0-1 gt8 OK for 1 and OK for 0-1 gt8a OK for 1 and OK for 0-1 gt8b OK for 1 and OK for 0-1 gt8c OK for 1 and OK for 0-1 gt8ms2 OK for 1 and OK for 0-1 gtbig2 OK for 1 and OK for 0-1 gtgrav2 OK for 1 and OK for 0-1 gtgrav4 OK for 1 and OK for 0-1 gtjbb OK for 1 and OK for 0-1 gtpfail OK for 1 and OK for 0-1 gt.jbb.1 OK for 1 and OK for 0-1 gt.sas OK for 1 and OK for 0-1 gt.scott.1 OK for 1 and OK for 0-1 gt.sstanley_2.32 OK for 1 and OK for 0-1 gt.sstanley_2.64 OK for 1 and OK for 0-1 gt.sstanley_3 OK for 1 and OK for 0-1 gtclearsmall OK for 2, OK for 1-2, OK for 0-1-2 gtrick OK for 2, OK for 1-2, OK for 0-1-2 gt12 OK for 1 and 0-1 *** GRIDS NOT VALID FOR PERIODIC IN EITHER X OR Y *** *** WORKS FOR REFWALL *** gt12.2 OK for 1 and 0-1 *** GRIDS NOT VALID FOR PERIODIC IN X *** *** WORKS FOR REFWALL OR PERIODIC IN Y *** gt12.3 OK for 1 and 0-1 *** GRIDS NOT VALID FOR PERIODIC IN EITHER X OR Y *** *** WORKS FOR REFWALL *** gtbig OK for 2,1-2,0-1-2 *** GRIDS NOT VALID FOR PERIODIC IN EITHER X OR Y *** *** WORKS FOR REFWALL *** gtbig3 OK for 2,1-2,0-1-2 *** GRIDS NOT VALID FOR PERIODIC IN EITHER X OR Y *** *** WORKS FOR REFWALL *** gtbig4 OK for 2,1-2,0-1-2 *** GRIDS NOT VALID FOR PERIODIC IN EITHER X OR Y *** *** WORKS FOR REFWALL *** gtbig5 OK for 2,1-2,0-1-2 *** GRIDS NOT VALID FOR PERIODIC IN EITHER X OR Y *** *** WORKS FOR REFWALL *** gt3ann2 OK for 2 and 1-2 and 0-1-2 *** GRIDS NOT VALID FOR PERIODIC IN X *** *** WORKS FOR REFWALL OR PERIODIC IN Y *** gtjbb2 OK for 2 and 1-2 and 0-1-2 *** GRIDS NOT VALID FOR PERIODIC IN X *** *** WORKS FOR REFWALL OR PERIODIC IN Y *** ccseapps-2.5/CCSEApps/hgproj/hgproj.pg0000644000175000017500000000001011634153073020760 0ustar amckinstryamckinstrylocal 0 ccseapps-2.5/CCSEApps/hgproj/hgparallel.H0000644000175000017500000003103111634153073021372 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _HGPARALLEL_H_ #define _HGPARALLEL_H_ #include #include #include #include inline int processor_number (const MultiFab& r, int igrid) { return r.DistributionMap()[igrid]; } inline bool is_remote (const MultiFab& r, int igrid) { return ParallelDescriptor::MyProc() != processor_number(r, igrid); } inline bool is_local (const MultiFab& r, int igrid) { return ParallelDescriptor::MyProc() == processor_number(r, igrid); } struct HG { static void MPI_init (); static void MPI_finish (); static MPI_Comm mpi_comm; static int max_live_tasks; static int multigrid_maxiter; static int cgsolve_maxiter; static double cgsolve_tolfact; static int pverbose; private: static bool initialized; }; class task_list; class task { public: class task_proxy { public: explicit task_proxy (task* t_ = 0); task_proxy (const task_proxy& r); ~task_proxy (); task_proxy& operator= (const task_proxy& r); task* operator-> () const; task* operator* () const; task* get () const; void set_finished (); bool is_finished () const; bool null () const; private: // // The data. // task* m_t; }; typedef unsigned int sequence_number; explicit task (task_list& task_list_); virtual ~task (); virtual bool ready (); virtual bool startup (long& sdncnt, long& rcvcnt); bool is_started () const ; virtual bool depends_on_q (const task* t1) const; bool is_finished () const; virtual bool need_to_communicate (int& with) const; void depend_on (const task_proxy& t1); bool depend_ready (); virtual void hint () const; void print_dependencies (std::ostream& os) const; sequence_number get_sequence_number () const; void set_sequence_number (sequence_number sno); protected: friend class task_proxy; void _do_depend (); void _hint () const; // // The data. // task_list& m_task_list; std::list dependencies; sequence_number m_sno; unsigned int m_cnt; bool m_finished; bool m_started; private: // // Not defined. // task (const task&); task& operator= (const task&); }; inline task::task_proxy::task_proxy (task* t_) { m_t = t_; } inline task::task_proxy::task_proxy (const task_proxy& r) { if ((m_t = r.m_t)) m_t->m_cnt++; } inline task::task_proxy::~task_proxy () { if (m_t && --m_t->m_cnt == 0) delete m_t; } inline task::task_proxy& task::task_proxy::operator= (const task_proxy& r) { if (this != &r) { if (m_t && --m_t->m_cnt == 0) delete m_t; if ((m_t = r.m_t)) m_t->m_cnt++; } return *this; } inline task* task::task_proxy::operator-> () const { BL_ASSERT(!null()); return m_t; } inline task* task::task_proxy::operator* () const { BL_ASSERT(!null()); return m_t; } inline task* task::task_proxy::get () const { BL_ASSERT(!null()); return m_t; } inline void task::task_proxy::set_finished () { BL_ASSERT(!null()); m_t->m_finished = true; } inline bool task::task_proxy::is_finished () const { BL_ASSERT(!null()); return m_t->m_finished; } inline bool task::task_proxy::null () const { return m_t == 0; } inline bool task::is_started () const { return m_started; } inline bool task::is_finished () const { return m_finished; } inline task::sequence_number task::get_sequence_number () const { return m_sno; } inline void task::set_sequence_number (task::sequence_number sno) { m_sno = sno; } class task_list { public: task_list (); ~task_list (); task::task_proxy add_task (task* t); // // Executes once through the task list, return true if any elements left. // void execute (const char* msg); std::list::const_iterator begin () const; std::list::iterator begin (); std::list::const_iterator end () const; std::list::iterator end (); bool empty () const; int size () const; task::sequence_number get_then_advance (int proc); void print_dependencies (std::ostream& os) const; private: // // The data. // std::list tasks; Array seq_no; bool verbose; // // Some class-wide static data. // static bool def_verbose; }; inline std::list::const_iterator task_list::begin () const { return tasks.begin(); } inline std::list::iterator task_list::begin () { return tasks.begin(); } inline std::list::const_iterator task_list::end () const { return tasks.end(); } inline std::list::iterator task_list::end () { return tasks.end(); } inline bool task_list::empty () const { return tasks.empty(); } inline int task_list::size () const { return tasks.size(); } inline task::sequence_number task_list::get_then_advance (int proc) { task::sequence_number sno = seq_no[proc]; seq_no[proc] = sno + 1; return sno; } class task_copy_base : public task { public: task_copy_base(task_list& tl_, MultiFab& dmf_, int dgrid_, const Box& db_, const MultiFab& smf_, int sgrid_, const Box& sb_); virtual ~task_copy_base(); virtual bool depends_on_q (const task* t) const; virtual bool startup (long&,long&); virtual bool need_to_communicate (int& with) const; virtual void hint () const; protected: MPI_Request m_request; FArrayBox* m_tmp; MultiFab& m_dmf; const int m_dgrid; const Box m_dbx; const MultiFab& m_smf; const int m_sgrid; const Box m_sbx; bool m_local; }; class task_copy : public task_copy_base { public: task_copy (task_list& tl_, MultiFab& mf, int dgrid, const MultiFab& smf, int sgrid, const Box& bx); task_copy (task_list& tl_, MultiFab& mf, int dgrid, const Box& db, const MultiFab& smf, int sgrid, const Box& sb); task_copy (task_list& tl_, MultiFab& mf, int dgrid, const MultiFab& smf, int sgrid, const Box& bx, const task_proxy& tp); virtual bool ready (); private: // // Common function called by constructors. // void init (); }; class task_local_base : public task { public: task_local_base (task_list& tl_, FArrayBox* fab_, int target_proc_id, const Box& bx, const Box& region, const MultiFab& mf_, int grid_); virtual ~task_local_base (); virtual bool startup (long&, long&); virtual bool depends_on_q (const task* t1) const; virtual bool need_to_communicate (int& with) const; virtual void hint () const; protected: MPI_Request m_request; FArrayBox* m_tmp; FArrayBox* m_fab; const MultiFab& m_smf; Box m_bx; Box m_region; const int m_sgrid; const int m_target_proc_id; bool m_local; }; class task_copy_local : public task_local_base { public: task_copy_local (task_list& tl_, FArrayBox* fab_, int target_proc_id, const Box& bx, const MultiFab& mf_, int grid_); virtual bool ready (); }; // // A forward declaration. // class amr_boundary; class task_bdy_fill : public task_local_base { public: task_bdy_fill (task_list& tl_, const amr_boundary* bdy_, FArrayBox* fab_, int target_proc_id, const Box& region_, const MultiFab& smf_, int grid_, const Box& domain_); virtual bool ready (); protected: const Box& m_domain; const amr_boundary* m_bdy; }; class task_fab : public task { public: task_fab (task_list& tl_, const MultiFab& t_, int tt_, const Box& region_, int ncomp_); virtual ~task_fab (); const FArrayBox& fab (); protected: int target_proc_id () const; // // The data. // FArrayBox* target; const Box region; const int ncomp; int m_target_proc_id; }; inline const FArrayBox& task_fab::fab () { BL_ASSERT(target != 0); return *target; } inline int task_fab::target_proc_id () const { return m_target_proc_id; } class level_interface; class amr_boundary; class task_fill_patch : public task_fab { public: task_fill_patch (task_list& tl_, const MultiFab& t_, int tt_, const Box& region_, const MultiFab& r_, const level_interface& lev_interface_, const amr_boundary* bdy_, int idim_ /* = -1*/, int index_ /*= -1*/); virtual ~task_fill_patch (); private: bool fill_patch_blindly (); bool fill_exterior_patch_blindly (); void fill_patch (); const MultiFab& r; const level_interface& lev_interface; const amr_boundary* bdy; const int idim; const int index; }; class task_fec_base : public task { public: task_fec_base (task_list& tl_, MultiFab& s_, int igrid_); virtual ~task_fec_base (); protected: void push_back (task_fab* tf); bool is_local_target () const; FArrayBox& target_fab (); int grid_number () const; const FArrayBox& task_fab_result (int n); // // The data. // std::vector tfvect; MultiFab& s; const int igrid; }; inline bool task_fec_base::is_local_target () const { return is_local(s, igrid); } inline FArrayBox& task_fec_base::target_fab () { BL_ASSERT(is_local_target()); return s[igrid]; } inline int task_fec_base::grid_number () const { return igrid; } inline const FArrayBox& task_fec_base::task_fab_result (int n) { BL_ASSERT(is_local_target()); BL_ASSERT(n >= 0 && n < tfvect.size()); task_fab* tf = dynamic_cast(tfvect[n].get()); BL_ASSERT(tf != 0); return tf->fab(); } #endif /*_HGPARALLEL_H_*/ ccseapps-2.5/CCSEApps/hgproj/.cvsignore0000644000175000017500000000030011634153073021141 0ustar amckinstryamckinstry*.for Debug Debug3D Release Release3D lib hglib___ *.ncb *.opt *.plg *.3log grdlog ti_files chk[0-9][0-9][0-9][0-9] plt[0-9][0-9][0-9][0-9] gu[1-9]* fgu[0-9]* guf *.pixie *.Addrs *.Counts PI* ccseapps-2.5/CCSEApps/hgproj/amr_real3d.f0000644000175000017500000014553311634153073021343 0ustar amckinstryamckinstryc----------------------------------------------------------------------- c Works for CELL-based data. subroutine iprodc( & v0, v0l0,v0h0,v0l1,v0h1,v0l2,v0h2, & v1, v1l0,v1h0,v1l1,v1h1,v1l2,v1h2, & regl0,regh0,regl1,regh1,regl2,regh2, & sum) integer v0l0,v0h0,v0l1,v0h1,v0l2,v0h2 integer v1l0,v1h0,v1l1,v1h1,v1l2,v1h2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision v0(v0l0:v0h0,v0l1:v0h1,v0l2:v0h2) double precision v1(v1l0:v1h0,v1l1:v1h1,v1l2:v1h2) double precision sum integer i, j, k do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 sum = sum + v0(i,j,k) * v1(i,j,k) end do end do end do end c----------------------------------------------------------------------- c Works for CELL- or NODE-based data. subroutine iprodn( & v0, v0l0,v0h0,v0l1,v0h1,v0l2,v0h2, & v1, v1l0,v1h0,v1l1,v1h1,v1l2,v1h2, & regl0,regh0,regl1,regh1,regl2,regh2, & sum) integer v0l0,v0h0,v0l1,v0h1,v0l2,v0h2 integer v1l0,v1h0,v1l1,v1h1,v1l2,v1h2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision v0(v0l0:v0h0,v0l1:v0h1,v0l2:v0h2) double precision v1(v1l0:v1h0,v1l1:v1h1,v1l2:v1h2) double precision sum integer i, j, k sum = sum + 0.1250D0 * & (v0(regl0,regl1,regl2) * v1(regl0,regl1,regl2) + & v0(regl0,regl1,regh2) * v1(regl0,regl1,regh2) + & v0(regl0,regh1,regl2) * v1(regl0,regh1,regl2) + & v0(regl0,regh1,regh2) * v1(regl0,regh1,regh2) + & v0(regh0,regl1,regl2) * v1(regh0,regl1,regl2) + & v0(regh0,regl1,regh2) * v1(regh0,regl1,regh2) + & v0(regh0,regh1,regl2) * v1(regh0,regh1,regl2) + & v0(regh0,regh1,regh2) * v1(regh0,regh1,regh2)) do i = regl0 + 1, regh0 - 1 sum = sum + 0.25D0 * & (v0(i,regl1,regl2) * v1(i,regl1,regl2) + & v0(i,regl1,regh2) * v1(i,regl1,regh2) + & v0(i,regh1,regl2) * v1(i,regh1,regl2) + & v0(i,regh1,regh2) * v1(i,regh1,regh2)) end do do j = regl1 + 1, regh1 - 1 sum = sum + 0.25D0 * & (v0(regl0,j,regl2) * v1(regl0,j,regl2) + & v0(regl0,j,regh2) * v1(regl0,j,regh2) + & v0(regh0,j,regl2) * v1(regh0,j,regl2) + & v0(regh0,j,regh2) * v1(regh0,j,regh2)) end do do k = regl2 + 1, regh2 - 1 sum = sum + 0.25D0 * & (v0(regl0,regl1,k) * v1(regl0,regl1,k) + & v0(regl0,regh1,k) * v1(regl0,regh1,k) + & v0(regh0,regl1,k) * v1(regh0,regl1,k) + & v0(regh0,regh1,k) * v1(regh0,regh1,k)) end do do j = regl1 + 1, regh1 - 1 do i = regl0 + 1, regh0 - 1 sum = sum + 0.5D0 * & (v0(i,j,regl2) * v1(i,j,regl2) + & v0(i,j,regh2) * v1(i,j,regh2)) end do end do do k = regl2 + 1, regh2 - 1 do i = regl0 + 1, regh0 - 1 sum = sum + 0.5D0 * & (v0(i,regl1,k) * v1(i,regl1,k) + & v0(i,regh1,k) * v1(i,regh1,k)) end do end do do k = regl2 + 1, regh2 - 1 do j = regl1 + 1, regh1 - 1 sum = sum + 0.5D0 * & (v0(regl0,j,k) * v1(regl0,j,k) + & v0(regh0,j,k) * v1(regh0,j,k)) end do end do do k = regl2 + 1, regh2 - 1 do j = regl1 + 1, regh1 - 1 do i = regl0 + 1, regh0 - 1 sum = sum + v0(i,j,k) * v1(i,j,k) end do end do end do end c----------------------------------------------------------------------- c These routines implement boundary conditions c----------------------------------------------------------------------- c Works for CELL- or NODE-based data. subroutine bref( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & bbl0,bbh0,bbl1,bbh1,bbl2,bbh2, & idir, ncomp) integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer bbl0,bbh0,bbl1,bbh1,bbl2,bbh2 integer idir, ncomp double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) integer i, j, k, nc do nc = 1, ncomp if (idir .eq. 0) then do i = regl0, regh0 do k = regl2, regh2 do j = regl1, regh1 dest(i,j,k,nc) = src(bbh0-(i-regl0),j,k,nc) end do end do end do else if (idir .eq. 1) then do j = regl1, regh1 do k = regl2, regh2 do i = regl0, regh0 dest(i,j,k,nc) = src(i,bbh1-(j-regl1),k, nc) end do end do end do else do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = src(i,j,bbh2-(k-regl2),nc) end do end do end do end if end do end c----------------------------------------------------------------------- c Works for CELL- or NODE-based data. subroutine brefm( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & bbl0,bbh0,bbl1,bbh1,bbl2,bbh2, & ra, ncomp) integer ncomp integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer bbl0,bbh0,bbl1,bbh1,bbl2,bbh2 integer ra(0:2) double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) integer i, j, k, nc do nc = 1, ncomp if (ra(0) .eq. 0 .and. ra(1) .eq. 0 .and. ra(2) .eq. 0) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = src(bbl0+(i-regl0), & bbl1+(j-regl1), bbl2+(k-regl2),nc) end do end do end do else if (ra(0) .eq. 0 .and. ra(1) .eq. 0 .and. ra(2) .eq. 1) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = src(bbl0+(i-regl0), & bbl1+(j-regl1), bbh2-(k-regl2),nc) end do end do end do else if (ra(0) .eq. 0 .and. ra(1) .eq. 1 .and. ra(2) .eq. 0) then do j = regl1, regh1 do k = regl2, regh2 do i = regl0, regh0 dest(i,j,k,nc) = src(bbl0+(i-regl0), & bbh1-(j-regl1), bbl2+(k-regl2),nc) end do end do end do else if (ra(0) .eq. 0 .and. ra(1) .eq. 1 .and. ra(2) .eq. 1) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = src(bbl0+(i-regl0), & bbh1-(j-regl1), bbh2-(k-regl2),nc) end do end do end do else if (ra(0) .eq. 1 .and. ra(1) .eq. 0 .and. ra(2) .eq. 0) then do i = regl0, regh0 do k = regl2, regh2 do j = regl1, regh1 dest(i,j,k,nc) = src(bbh0-(i-regl0), & bbl1+(j-regl1), bbl2+(k-regl2),nc) end do end do end do else if (ra(0) .eq. 1 .and. ra(1) .eq. 0 .and. ra(2) .eq. 1) then do k = regl2, regh2 do i = regl0, regh0 do j = regl1, regh1 dest(i,j,k,nc) = src(bbh0-(i-regl0), & bbl1+(j-regl1), bbh2-(k-regl2),nc) end do end do end do else if (ra(0) .eq. 1 .and. ra(1) .eq. 1 .and. ra(2) .eq. 0) then do j = regl1, regh1 do i = regl0, regh0 do k = regl2, regh2 dest(i,j,k,nc) = src(bbh0-(i-regl0), & bbh1-(j-regl1), bbl2+(k-regl2),nc) end do end do end do else do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = src(bbh0-(i-regl0), & bbh1-(j-regl1), bbh2-(k-regl2),nc) end do end do end do end if end do end c----------------------------------------------------------------------- c Works for CELL- or NODE-based data. subroutine bneg( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & bbl0,bbh0,bbl1,bbh1,bbl2,bbh2, & idir, ncomp) integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer bbl0,bbh0,bbl1,bbh1,bbl2,bbh2 integer idir,ncomp double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) integer i, j, k, nc do nc = 1, ncomp if (idir .eq. 0) then do i = regl0, regh0 do k = regl2, regh2 do j = regl1, regh1 dest(i,j,k,nc) = -src(bbh0-(i-regl0),j,k,nc) end do end do end do else if (idir .eq. 1) then do j = regl1, regh1 do k = regl2, regh2 do i = regl0, regh0 dest(i,j,k,nc) = -src(i,bbh1-(j-regl1),k,nc) end do end do end do else do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = -src(i,j,bbh2-(k-regl2),nc) end do end do end do end if end do end c----------------------------------------------------------------------- c Works for CELL- or NODE-based data. subroutine bnegm( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & bbl0,bbh0,bbl1,bbh1,bbl2,bbh2, & ra, ncomp) integer ncomp integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer bbl0,bbh0,bbl1,bbh1,bbl2,bbh2 integer ra(0:2) double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) integer i, j, k, nc do nc = 1, ncomp if (ra(0) .eq. 0 .and. ra(1) .eq. 0 .and. ra(2) .eq. 0) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = -src(bbl0+(i-regl0), & bbl1+(j-regl1), bbl2+(k-regl2),nc) end do end do end do else if (ra(0) .eq. 0 .and. ra(1) .eq. 0 .and. ra(2) .eq. 1) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = -src(bbl0+(i-regl0), & bbl1+(j-regl1), bbh2-(k-regl2),nc) end do end do end do else if (ra(0) .eq. 0 .and. ra(1) .eq. 1 .and. ra(2) .eq. 0) then do j = regl1, regh1 do k = regl2, regh2 do i = regl0, regh0 dest(i,j,k,nc) = -src(bbl0+(i-regl0), & bbh1-(j-regl1), bbl2+(k-regl2),nc) end do end do end do else if (ra(0) .eq. 0 .and. ra(1) .eq. 1 .and. ra(2) .eq. 1) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = -src(bbl0+(i-regl0), & bbh1-(j-regl1), bbh2-(k-regl2),nc) end do end do end do else if (ra(0) .eq. 1 .and. ra(1) .eq. 0 .and. ra(2) .eq. 0) then do i = regl0, regh0 do k = regl2, regh2 do j = regl1, regh1 dest(i,j,k,nc) = -src(bbh0-(i-regl0), & bbl1+(j-regl1), bbl2+(k-regl2),nc) end do end do end do else if (ra(0) .eq. 1 .and. ra(1) .eq. 0 .and. ra(2) .eq. 1) then do k = regl2, regh2 do i = regl0, regh0 do j = regl1, regh1 dest(i,j,k,nc) = -src(bbh0-(i-regl0), & bbl1+(j-regl1), bbh2-(k-regl2),nc) end do end do end do else if (ra(0) .eq. 1 .and. ra(1) .eq. 1 .and. ra(2) .eq. 0) then do j = regl1, regh1 do i = regl0, regh0 do k = regl2, regh2 dest(i,j,k,nc) = -src(bbh0-(i-regl0), & bbh1-(j-regl1), bbl2+(k-regl2),nc) end do end do end do else do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = -src(bbh0-(i-regl0), & bbh1-(j-regl1), bbh2-(k-regl2),nc) end do end do end do end if end do end c----------------------------------------------------------------------- c Works for CELL-based velocity data. c This routine assumes that the inflow face velocity data has not yet c been altered. Running fill_borders should call this routine on every c inflow face, so that binfil can be run for subsequent fills subroutine binflo( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & bbl0,bbh0,bbl1,bbh1,bbl2,bbh2, & idir, ncomp) integer ncomp integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer bbl0,bbh0,bbl1,bbh1,bbl2,bbh2 integer idir double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) integer i, j, k, nc c do nc = 1, ncomp if (idir .eq. 0) then if (regl0 .lt. bbh0) then do i = regl0, regh0 do k = regl2, regh2 do j = regl1, regh1 dest(i,j,k,nc) = 2.0D0 * dest(regh0,j,k,nc) - & src(bbh0-(i-regl0),j,k,nc) end do end do end do else do i = regh0, regl0, -1 do k = regl2, regh2 do j = regl1, regh1 dest(i,j,k,nc) = 2.0D0 * dest(regh0,j,k, nc) - & src(bbh0-(i-regl0),j,k, nc) end do end do end do end if else if (idir .eq. 1) then if (regl1 .lt. bbh1) then do j = regl1, regh1 do k = regl2, regh2 do i = regl0, regh0 dest(i,j,k,nc) = 2.0D0 * dest(i,regh1,k,nc) - & src(i,bbh1-(j-regl1),k,nc) end do end do end do else do j = regh1, regl1, -1 do k = regl2, regh2 do i = regl0, regh0 dest(i,j,k,nc) = 2.0D0 * dest(i,regh1,k,nc) - & src(i,bbh1-(j-regl1),k,nc) end do end do end do end if else if (regl2 .lt. bbh2) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = 2.0D0 * dest(i,j,regh2,nc) - & src(i,j,bbh2-(k-regl2),nc) end do end do end do else do k = regh2, regl2, -1 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = 2.0D0 * dest(i,j,regh2,nc) - & src(i,j,bbh2-(k-regl2),nc) end do end do end do end if end if end do end c----------------------------------------------------------------------- c Works for CELL-based velocity data. c This routine is called when the inflow face velocity data has already c been altered by a call to fill_borders. subroutine binfil( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & bbl0,bbh0,bbl1,bbh1,bbl2,bbh2, & idir, ncomp) integer ncomp integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer bbl0,bbh0,bbl1,bbh1,bbl2,bbh2 integer idir double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) integer i, j, k, nc c do nc = 1, ncomp if (idir .eq. 0) then if (regl0 .lt. bbh0) then do i = regl0, regh0 do k = regl2, regh2 do j = regl1, regh1 dest(i,j,k,nc) = src(bbl0,j,k,nc) & + src(bbl0+1,j,k,nc) - & src(bbh0-(i-regl0),j,k,nc) end do end do end do else do i = regh0, regl0, -1 do k = regl2, regh2 do j = regl1, regh1 dest(i,j,k,nc) = src(bbh0-1,j,k,nc) & + src(bbh0,j,k,nc) - & src(bbl0+(regh0-i),j,k,nc) end do end do end do end if else if (idir .eq. 1) then if (regl1 .lt. bbh1) then do j = regl1, regh1 do k = regl2, regh2 do i = regl0, regh0 dest(i,j,k,nc) = src(i,bbl1,k,nc) & + src(i,bbl1+1,k,nc) - & src(i,bbh1-(j-regl1),k,nc) end do end do end do else do j = regh1, regl1, -1 do k = regl2, regh2 do i = regl0, regh0 dest(i,j,k,nc) = src(i,bbh1-1,k,nc) & + src(i,bbh1,k,nc) - & src(i,bbl1+(regh1-j),k,nc) end do end do end do end if else if (regl2 .lt. bbh2) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = src(i,j,bbl2,nc) & + src(i,j,bbl2+1,nc) - & src(i,j,bbh2-(k-regl2),nc) end do end do end do else do k = regh2, regl2, -1 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = src(i,j,bbh2-1,nc) & + src(i,j,bbh2,nc) - & src(i,j,bbl2+(regh2-k),nc) end do end do end do end if end if end do end c----------------------------------------------------------------------- c Interpolation routines c----------------------------------------------------------------------- c CELL-based data only. subroutine acint2( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & bbl0,bbh0,bbl1,bbh1,bbl2,bbh2, & ir, jr, kr, ncomp) integer ncomp integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer bbl0,bbh0,bbl1,bbh1,bbl2,bbh2 integer ir, jr, kr double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) double precision xoff, yoff, zoff, sx, sy, sz integer ic, jc, kc, i, j, k, nc do nc = 1, ncomp do k = regl2, regh2 kc = k/kr zoff = (mod(k,kr) + 0.5D0) / kr - 0.5D0 do j = regl1, regh1 jc = j/jr yoff = (mod(j,jr) + 0.5D0) / jr - 0.5D0 do i = regl0, regh0 ic = i/ir xoff = (mod(i,ir) + 0.5D0) / ir - 0.5D0 sz = 0.5D0 * (src(ic,jc,kc+1,nc) - src(ic,jc,kc-1,nc)) sy = 0.5D0 * (src(ic,jc+1,kc,nc) - src(ic,jc-1,kc,nc)) sx = 0.5D0 * (src(ic+1,jc,kc,nc) - src(ic-1,jc,kc,nc)) dest(i,j,k,nc) = src(ic,jc,kc,nc) & + xoff*sx + yoff*sy + zoff*sz end do end do end do end do end c----------------------------------------------------------------------- c NODE-based data only. subroutine anint2( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & bbl0,bbh0,bbl1,bbh1,bbl2,bbh2, & ir, jr, kr, ncomp) integer ncomp integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer bbl0,bbh0,bbl1,bbh1,bbl2,bbh2 integer ir, jr, kr double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) double precision p, q integer ic, jc, kc, j, k, m, nc do nc = 1, ncomp do kc = bbl2, bbh2 do jc = bbl1, bbh1 do ic = bbl0, bbh0 dest(ir*ic,jr*jc,kr*kc, nc) = src(ic,jc,kc, nc) end do end do end do do m = 1, kr-1 q = dble(m)/kr p = 1.0D0 - q do kc = bbl2, bbh2-1 do jc = bbl1, bbh1 do ic = bbl0, bbh0 dest(ir*ic,jr*jc,kr*kc+m,nc) = & p * src(ic,jc,kc,nc) + q * src(ic,jc,kc+1,nc) end do end do end do end do do m = 1, jr-1 q = dble(m)/jr p = 1.0D0 - q do jc = bbl1, bbh1-1 do ic = bbl0, bbh0 cdir$ ivdep do k = regl2, regh2 dest(ir*ic,jr*jc+m,k,nc) = & p * dest(ir*ic,jr*jc,k,nc) + & q * dest(ir*ic,jr*(jc+1),k,nc) end do end do end do end do do m = 1, ir-1 q = dble(m)/ir p = 1.0D0 - q do ic = bbl0, bbh0-1 do k = regl2, regh2 cdir$ ivdep do j = regl1, regh1 dest(ir*ic+m,j,k,nc) = & p * dest(ir*ic,j,k,nc) + & q * dest(ir*(ic+1),j,k,nc) end do end do end do end do end do end c----------------------------------------------------------------------- c Restrictions c----------------------------------------------------------------------- c CELL-based data only. subroutine acrst1( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & ir, jr, kr, ncomp, integ, i1, i2) integer ncomp integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer ir, jr, kr, integ, i1, i2 double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) double precision fac integer i, j, k, l, m, n,nc do nc = 1, ncomp do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = 0.0D0 end do end do end do do l = 0, kr-1 do n = 0, jr-1 do m = 0, ir-1 do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = dest(i,j,k,nc) + & src(i*ir+m, j*jr+n, k*kr+l,nc) end do end do end do end do end do end do if (integ .eq. 0) then fac = 1.0D0 / (ir*jr*kr) do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = dest(i,j,k,nc) * fac end do end do end do end if end do end c----------------------------------------------------------------------- c NODE-based data only. subroutine anrst1( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & ir, jr, kr, ncomp, integ, i1, i2) integer ncomp, integ integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer ir, jr, kr integer nc double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) integer i, j, k, i1, i2 do nc = 1, ncomp do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = src(i*ir, j*jr, k*kr, nc) end do end do end do end do end c----------------------------------------------------------------------- c NODE-based data only. subroutine anrst2( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & ir, jr, kr, ncomp, integ, i1, i2) integer ncomp integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer ir, jr, kr, integ, i1, i2 double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) double precision fac0, fac1, fac2, fac integer i, j, k, l, m, n, nc do nc = 1, ncomp do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = 0.0D0 end do end do end do fac0 = 1.0D0 / (ir*ir * jr*jr * kr*kr) do l = 0, kr-1 fac2 = (kr-l) * fac0 if (l .eq. 0) fac2 = 0.5D0 * fac2 do n = 0, jr-1 fac1 = (jr-n) * fac2 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir-m,j*jr-n,k*kr-l,nc)+ & src(i*ir-m,j*jr-n,k*kr+l,nc)+ & src(i*ir-m,j*jr+n,k*kr-l,nc)+ & src(i*ir-m,j*jr+n,k*kr+l,nc)+ & src(i*ir+m,j*jr-n,k*kr-l,nc)+ & src(i*ir+m,j*jr-n,k*kr+l,nc)+ & src(i*ir+m,j*jr+n,k*kr-l,nc)+ & src(i*ir+m,j*jr+n,k*kr+l,nc)) end do end do end do end do end do end do if (integ .eq. 1) then fac = ir * jr * kr do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = fac * dest(i,j,k,nc) end do end do end do end if end do if ( .FALSE. ) then print *, 'anrst2' print *, destl0, desth0, destl1, desth1, destl2, desth2 print *, regl0, regh0, regl1, regh1, regl2, regh2 print *, srcl0, srch0, srcl1, srch1, srcl2, srch2 print *, ir, jr, kr, integ print *, dest end if end c----------------------------------------------------------------------- c NODE-based data only. c Fills coarse region defined by reg. c Handles coarse-fine face, with orientation determined by idim and idir subroutine anfr2( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & ir, jr, kr, ncomp, integ, idim, idir) integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer ir, jr, kr, idim, idir, integ integer ncomp double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) double precision fac0, fac1, fac2, fac integer i, j, k, l, m, n, nc if (idim .eq. 0) then if (integ .eq. 0) then fac = (0.5D0 + 0.5D0 / ir) fac0 = 1.0D0 / (ir*ir * jr*jr * kr*kr) else fac = 1.0D0 fac0 = 1.0D0 / (ir * jr * kr) end if i = regl0 do nc = 1, ncomp do k = regl2, regh2 do j = regl1, regh1 dest(i,j,k,nc) = fac * src(i*ir,j*jr,k*kr,nc) end do end do end do do nc = 1, ncomp do l = 0, kr-1 fac2 = (kr-l) * fac0 if (l .eq. 0) fac2 = 0.5D0 * fac2 do n = 0, jr-1 fac1 = (jr-n) * fac2 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do k = regl2, regh2 do j = regl1, regh1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir+m,j*jr-n,k*kr-l,nc) + & src(i*ir+m,j*jr-n,k*kr+l,nc) + & src(i*ir+m,j*jr+n,k*kr-l,nc) + & src(i*ir+m,j*jr+n,k*kr+l,nc)) end do end do end do end do end do end do else if (idim .eq. 1) then if (integ .eq. 0) then fac = (0.5D0 + 0.5D0 / jr) fac0 = 1.0D0 / (ir*ir * jr*jr * kr*kr) else fac = 1.0D0 fac0 = 1.0D0 / (ir * jr * kr) end if j = regl1 do nc = 1, ncomp do k = regl2, regh2 do i = regl0, regh0 dest(i,j,k,nc) = fac * src(i*ir,j*jr,k*kr,nc) end do end do end do fac0 = 1.0D0 / (ir*ir * jr*jr * kr*kr) do nc = 1, ncomp do l = 0, kr-1 fac2 = (kr-l) * fac0 if (l .eq. 0) fac2 = 0.5D0 * fac2 do n = idir, idir*(jr-1), idir fac1 = (jr-abs(n)) * fac2 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do k = regl2, regh2 do i = regl0, regh0 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir-m,j*jr+n,k*kr-l,nc) + & src(i*ir-m,j*jr+n,k*kr+l,nc) + & src(i*ir+m,j*jr+n,k*kr-l,nc) + & src(i*ir+m,j*jr+n,k*kr+l,nc)) end do end do end do end do end do end do else if (integ .eq. 0) then fac = (0.5D0 + 0.5D0 / kr) fac0 = 1.0D0 / (ir*ir * jr*jr * kr*kr) else fac = 1.0D0 fac0 = 1.0D0 / (ir * jr * kr) end if k = regl2 do nc = 1, ncomp do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = fac * src(i*ir,j*jr,k*kr,nc) end do end do end do fac0 = 1.0D0 / (ir*ir * jr*jr * kr*kr) do nc = 1, ncomp do l = idir, idir*(kr-1), idir fac2 = (kr-abs(l)) * fac0 do n = 0, jr-1 fac1 = (jr-n) * fac2 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do j = regl1, regh1 do i = regl0, regh0 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir-m,j*jr-n,k*kr+l,nc) + & src(i*ir-m,j*jr+n,k*kr+l,nc) + & src(i*ir+m,j*jr-n,k*kr+l,nc) + & src(i*ir+m,j*jr+n,k*kr+l,nc)) end do end do end do end do end do end do end if end c----------------------------------------------------------------------- c NODE-based data only. c Fills coarse region defined by reg. c Handles any edge geometry except all-coarse or all-fine. subroutine aner2( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & ir, jr, kr, ncomp, integ, ivect, ga) integer ncomp integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer ir, jr, kr, ivect(0:2), ga(0:1,0:1,0:1), integ double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2,ncomp) double precision cube, center, cfac, fac0, fac1, fac2, fac integer i, j, k, ii, ji, ki, idir, jdir, kdir, l, m, n, nc cube = ir * jr * kr if (ivect(0) .eq. 0) then j = regl1 k = regl2 do nc = 1, ncomp do i = regl0, regh0 dest(i,j,k,nc) = 0.0D0 end do c center gets center plus two edges if (integ .eq. 0) then center = ir / cube fac0 = 1.0D0 / (cube**2) cfac = 0.25D0 * cube * fac0 * ir * (jr-1) * (kr-1) else center = 1.0D0 fac0 = 1.0D0 / cube end if c quadrants c each quadrant is two octants and a face do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) .eq. 1) then do l = kdir, kdir*(kr-1), kdir fac2 = (kr-abs(l)) * fac0 do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac2 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do i = regl0, regh0 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir-m,j*jr+n,k*kr+l,nc) + & src(i*ir+m,j*jr+n,k*kr+l,nc)) end do end do end do end do else if (integ .eq. 0) then center = center + cfac end if end do end do c faces c each face is two faces and an edge fac2 = kr * fac0 cfac = 0.5D0 * cube * fac0 * ir * (jr-1) do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,0) + ga(0,ji,1) .eq. 2) then do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac2 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do i = regl0, regh0 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir-m,j*jr+n,k*kr,nc) + & src(i*ir+m,j*jr+n,k*kr,nc)) end do end do end do else if (integ .eq. 0) then center = center + cfac end if end do fac2 = jr * fac0 cfac = 0.5D0 * cube * fac0 * ir * (kr-1) do ki = 0, 1 kdir = 2 * ki - 1 if (ga(0,0,ki) + ga(0,1,ki) .eq. 2) then do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac2 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do i = regl0, regh0 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir-m,j*jr,k*kr+l,nc) + & src(i*ir+m,j*jr,k*kr+l,nc)) end do end do end do else if (integ .eq. 0) then center = center + cfac end if end do c center do i = regl0, regh0 dest(i,j,k,nc) = dest(i,j,k,nc) + & center * src(i*ir,j*jr,k*kr,nc) end do end do else if (ivect(1) .eq. 0) then i = regl0 k = regl2 do nc = 1, ncomp do j = regl1, regh1 dest(i,j,k,nc) = 0.0D0 end do c center gets center plus two edges if (integ .eq. 0) then center = jr / cube fac0 = 1.0D0 / (cube**2) cfac = 0.25D0 * cube * fac0 * jr * (ir-1) * (kr-1) else center = 1.0D0 fac0 = 1.0D0 / cube end if c quadrants c each quadrant is two octants and a face do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) .eq. 1) then do l = kdir, kdir*(kr-1), kdir fac2 = (kr-abs(l)) * fac0 do n = 0, jr-1 fac1 = (jr-n) * fac2 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do j = regl1, regh1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir+m,j*jr-n,k*kr+l,nc) + & src(i*ir+m,j*jr+n,k*kr+l,nc)) end do end do end do end do else if (integ .eq. 0) then center = center + cfac end if end do end do c faces c each face is two faces and an edge fac2 = kr * fac0 cfac = 0.5D0 * cube * fac0 * jr * (ir-1) do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,0) + ga(ii,0,1) .eq. 2) then do n = 0, jr-1 fac1 = (jr-n) * fac2 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do j = regl1, regh1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir+m,j*jr-n,k*kr,nc) + & src(i*ir+m,j*jr+n,k*kr,nc)) end do end do end do else if (integ .eq. 0) then center = center + cfac end if end do fac2 = ir * fac0 cfac = 0.5D0 * cube * fac0 * jr * (kr-1) do ki = 0, 1 kdir = 2 * ki - 1 if (ga(0,0,ki) + ga(1,0,ki) .eq. 2) then do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac2 do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do j = regl1, regh1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir,j*jr-n,k*kr+l,nc) + & src(i*ir,j*jr+n,k*kr+l,nc)) end do end do end do else if (integ .eq. 0) then center = center + cfac end if end do c center do j = regl1, regh1 dest(i,j,k,nc) = dest(i,j,k,nc) + & center * src(i*ir,j*jr,k*kr,nc) end do end do else i = regl0 j = regl1 do nc = 1, ncomp do k = regl2, regh2 dest(i,j,k,nc) = 0.0D0 end do c center gets center plus two edges if (integ .eq. 0) then center = kr / cube fac0 = 1.0D0 / (cube**2) cfac = 0.25D0 * cube * fac0 * kr * (ir-1) * (jr-1) else center = 1.0D0 fac0 = 1.0D0 / cube end if c quadrants c each quadrant is two octants and a face do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) .eq. 1) then do l = 0, kr-1 fac2 = (kr-l) * fac0 if (l .eq. 0) fac2 = 0.5D0 * fac2 do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac2 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do k = regl2, regh2 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir+m,j*jr+n,k*kr-l,nc) + & src(i*ir+m,j*jr+n,k*kr+l,nc)) end do end do end do end do else if (integ .eq. 0) then center = center + cfac end if end do end do c faces c each face is two faces and an edge fac2 = jr * fac0 cfac = 0.5D0 * cube * fac0 * kr * (ir-1) do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,0) + ga(ii,1,0) .eq. 2) then do l = 0, kr-1 fac1 = (kr-l) * fac2 if (l .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do k = regl2, regh2 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir+m,j*jr,k*kr-l,nc) + & src(i*ir+m,j*jr,k*kr+l,nc)) end do end do end do else if (integ .eq. 0) then center = center + cfac end if end do fac2 = ir * fac0 cfac = 0.5D0 * cube * fac0 * kr * (jr-1) do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,0) + ga(1,ji,0) .eq. 2) then do l = 0, kr-1 fac1 = (kr-l) * fac2 if (l .eq. 0) fac1 = 0.5D0 * fac1 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 do k = regl2, regh2 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * (src(i*ir,j*jr+n,k*kr-l,nc) + & src(i*ir,j*jr+n,k*kr+l,nc)) end do end do end do else if (integ .eq. 0) then center = center + cfac end if end do c center do k = regl2, regh2 dest(i,j,k,nc) = dest(i,j,k,nc) + & center * src(i*ir,j*jr,k*kr,nc) end do end do end if end c----------------------------------------------------------------------- c NODE-based data only. c Fills coarse region defined by reg. c Handles any corner geometry except all-coarse. subroutine ancr2( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & ir, jr, kr, ncomp, integ, ga, i2) integer ncomp integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer ir, jr, kr, ga(0:1,0:1,0:1), integ double precision dest(destl0:desth0,destl1:desth1,destl2:desth2, & ncomp) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2, ncomp) double precision cube, center, cfac, fac0, fac1, fac2, fac integer i, j, k, ii, ji, ki, idir, jdir, kdir, l, m, n,nc, i2 i = regl0 j = regl1 k = regl2 do nc = 1, ncomp dest(i,j,k,nc) = 0.0D0 cube = ir * jr * kr if (integ .eq. 0) then center = 1.0D0 / cube fac0 = 1.0D0 / (cube**2) cfac = 0.1250D0 * cube * fac0 * (ir-1) * (jr-1) * (kr-1) else center = 1.0D0 fac0 = 1.0D0 / cube end if c octants do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) .eq. 1) then do l = kdir, kdir*(kr-1), kdir fac2 = (kr-abs(l)) * fac0 do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac2 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * src(i*ir+m,j*jr+n,k*kr+l,nc) end do end do end do else if (integ .eq. 0) then center = center + cfac end if end do end do end do c faces fac2 = kr * fac0 cfac = 0.25D0 * cube * fac0 * (ir-1) * (jr-1) do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) + ga(ii,ji,1) .eq. 2) then do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac2 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * src(i*ir+m,j*jr+n,k*kr,nc) end do end do else if (integ .eq. 0) then center = center + cfac end if end do end do fac2 = jr * fac0 cfac = 0.25D0 * cube * fac0 * (ir-1) * (kr-1) do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) + ga(ii,1,ki) .eq. 2) then do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac2 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * src(i*ir+m,j*jr,k*kr+l,nc) end do end do else if (integ .eq. 0) then center = center + cfac end if end do end do fac2 = ir * fac0 cfac = 0.25D0 * cube * fac0 * (jr-1) * (kr-1) do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) + ga(1,ji,ki) .eq. 2) then do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac2 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * src(i*ir,j*jr+n,k*kr+l,nc) end do end do else if (integ .eq. 0) then center = center + cfac end if end do end do c edges fac1 = jr * kr * fac0 cfac = 0.5D0 * cube * fac0 * (ir-1) do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,0) + ga(ii,0,1) + & ga(ii,1,0) + ga(ii,1,1) .eq. 4) then do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * src(i*ir+m,j*jr,k*kr,nc) end do else if (integ .eq. 0) then center = center + cfac end if end do fac1 = ir * kr * fac0 cfac = 0.5D0 * cube * fac0 * (jr-1) do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,0) + ga(0,ji,1) + & ga(1,ji,0) + ga(1,ji,1) .eq. 4) then do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * src(i*ir,j*jr+n,k*kr,nc) end do else if (integ .eq. 0) then center = center + cfac end if end do fac1 = ir * jr * fac0 cfac = 0.5D0 * cube * fac0 * (kr-1) do ki = 0, 1 kdir = 2 * ki - 1 if (ga(0,0,ki) + ga(0,1,ki) + & ga(1,0,ki) + ga(1,1,ki) .eq. 4) then do l = kdir, kdir*(kr-1), kdir fac = (kr-abs(l)) * fac1 dest(i,j,k,nc) = dest(i,j,k,nc) + & fac * src(i*ir,j*jr,k*kr+l,nc) end do else if (integ .eq. 0) then center = center + cfac end if end do c center dest(i,j,k,nc) = dest(i,j,k,nc) + & center * src(i*ir,j*jr,k*kr,nc) end do end ccseapps-2.5/CCSEApps/hgproj/interpolator.H0000644000175000017500000000435011634153073022005 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _INTERPOLATOR_H_ #define _INTERPOLATOR_H_ #include "amr_defs.H" // // This is the base class for all amr_interpolators. Currently these // are self-contained, i.e., they don't need to talk to boundary conditions // or interface objects or whatever. Tell box what fine area you want // filled, and it will tell you how much coarse data it needs. Just // fill the requested patch with coarse data and call fill. How you // get the coarse data is your problem. // class amr_interpolator { public: virtual ~amr_interpolator () = 0; virtual Box box (const Box&, const IntVect&) const = 0; virtual void fill (FArrayBox&, const Box&, const FArrayBox&, const Box&, const IntVect&) const = 0; }; class bilinear_interpolator : public amr_interpolator { public: virtual Box box (const Box&, const IntVect&) const; virtual void fill (FArrayBox&, const Box&, const FArrayBox&, const Box&, const IntVect&) const; }; #endif /*_INTERPOLATOR_H_*/ ccseapps-2.5/CCSEApps/hgproj/boundary.cpp0000644000175000017500000012254011634153073021503 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include "boundary.H" #if defined( BL_FORT_USE_UNDERSCORE ) #define FORT_FBREF bref_ #define FORT_FBREFM brefm_ #define FORT_FBNEG bneg_ #define FORT_FBNEGM bnegm_ #define FORT_FBINFLO binflo_ #define FORT_FBINFIL binfil_ #elif defined( BL_FORT_USE_UPPERCASE ) #define FORT_FBREF BREF #define FORT_FBREFM BREFM #define FORT_FBNEG BNEG #define FORT_FBNEGM BNEGM #define FORT_FBINFLO BINFLO #define FORT_FBINFIL BINFIL #elif defined( BL_FORT_USE_LOWERCASE ) #define FORT_FBREF bref #define FORT_FBREFM brefm #define FORT_FBNEG bneg #define FORT_FBNEGM bnegm #define FORT_FBINFLO binflo #define FORT_FBINFIL binfil #else #error "none of BL_FORT_USE_{UNDERSCORE,UPPERCASE,LOWERCASE} defined" #endif extern "C" { void FORT_FBREF (Real*, intS, intS, const Real*, intS, intS, const int*, const int&); void FORT_FBREFM (Real*, intS, intS, const Real*, intS, intS, const int*, const int&); void FORT_FBNEG (Real*, intS, intS, const Real*, intS, intS, const int*, const int&); void FORT_FBNEGM (Real*, intS, intS, const Real*, intS, intS, const int*, const int&); void FORT_FBINFLO(Real*, intS, intS, const Real*, intS, intS, const int*, const int&); void FORT_FBINFIL(Real*, intS, intS, const Real*, intS, intS, const int*, const int&); } amr_boundary::~amr_boundary () {} int amr_boundary::dir (const Box& region, const Box& domain) const { for (int i = 0; i < BL_SPACEDIM; ++i) { if (region.bigEnd(i) < domain.smallEnd(i)) return -(i+1); if (region.smallEnd(i) > domain.bigEnd(i)) return +(i+1); } for (int i = 0; i < BL_SPACEDIM; ++i) { if (region.bigEnd(i) == domain.smallEnd(i)) return -(i+1); if (region.smallEnd(i) == domain.bigEnd(i)) return +(i+1); } BL_ASSERT("amr_boundary::dir---boundary box not outside domain." == 0); return 0; } void amr_boundary::boundary_mesh (BoxArray& exterior_mesh, int*& grid_ref, const BoxArray& interior_mesh, const Box& domain) const { BoxList bl; std::list il; const Box& d = domain; for (int igrid = 0; igrid < interior_mesh.size(); igrid++) { check_against_boundary_(bl, il, interior_mesh[igrid], igrid, d, 0); } exterior_mesh.define(bl); bl.clear(); BL_ASSERT(il.size() == exterior_mesh.size()); grid_ref = new int[exterior_mesh.size()]; std::list::iterator in = il.begin(); for (int igrid = 0; in != il.end(); ++in, ++igrid) { grid_ref[igrid] = *in; } il.clear(); } // mixed_boundary::mixed_boundary (inviscid_fluid_boundary* Ptr, int idim) : ptr(Ptr), flowdim(idim) { } Box mixed_boundary::box_ (const Box& image, const Box& domain, int idir) const { HG_DEBUG_OUT("BOX_:" << "image(" << image << ") " << "domain(" << domain << ") " << "idir(" << idir << ") "); const int idim = abs(idir) - 1; const RegType t = ptr->bc[idim][idir > 0]; Box retbox(image); BL_ASSERT(idir != 0); if (t == refWall || t == outflow || t == inflow) { // // All these cases use a reflected box. // if (idir < 0) { if (image.type(idim) == IndexType::CELL) { retbox.shift( idim, (2 * domain.smallEnd(idim) - 1 - image.bigEnd(idim) - image.smallEnd(idim))); if ( t == inflow && idim == flowdim ) { retbox.setSmall(idim, domain.smallEnd(idim) - 1); } } else { retbox.shift( idim, (2 * domain.smallEnd(idim) - image.bigEnd(idim) - image.smallEnd(idim))); if ( t == inflow && idim == flowdim ) { retbox.setSmall(idim, domain.smallEnd(idim)); } } } else if (idir > 0) { if (image.type(idim) == IndexType::CELL) { retbox.shift( idim, (2 * domain.bigEnd(idim) + 1 - image.bigEnd(idim) - image.smallEnd(idim))); } else { retbox.shift( idim, (2 * domain.bigEnd(idim) + 2 - image.bigEnd(idim) - image.smallEnd(idim))); } if ( t == inflow && idim == flowdim ) { retbox.setBig(idim, domain.bigEnd(idim) + 1); } } } else if (t == periodic) { if (idir < 0) { retbox.shift(idim, domain.length(idim)); } else if (idir > 0) { retbox.shift(idim, -domain.length(idim)); } } else { BoxLib::Error( "mixed_boundary::box---boundary type not supported"); } HG_DEBUG_OUT("==>retbox(" << retbox << ")" << std::endl); return retbox; } Box mixed_boundary::anImage (const Box& region, const Box& srcbox, const Box& domain) const { HG_DEBUG_OUT("anImage:" << "region(" << region << ") " << "srcbox(" << srcbox << ") " << "domain(" << domain << ") "); Box tdomain = domain; tdomain.convert(srcbox.type()); Box idomain = BoxLib::grow(tdomain, IntVect::TheZeroVector()-srcbox.type()); Box image = region; for (int idim = 0; idim < BL_SPACEDIM; idim++) { if (region.bigEnd(idim) < idomain.smallEnd(idim)) { const RegType t = ptr->bc[idim][0]; if ( t == inflow && idim == flowdim ) { } else if (t == refWall || t == inflow || t == outflow) { image.shift( idim, (tdomain.smallEnd(idim) + idomain.smallEnd(idim) - 1 - region.bigEnd(idim) - region.smallEnd(idim))); } else if (t == periodic) { image.shift(idim, domain.length(idim)); } } else if (region.smallEnd(idim) > idomain.bigEnd(idim)) { const RegType t = ptr->bc[idim][1]; if ( t == inflow && idim == flowdim ) { } else if (t == refWall || t == inflow || t == outflow) { image.shift( idim, (tdomain.bigEnd(idim) + idomain.bigEnd(idim) + 1 - region.bigEnd(idim) - region.smallEnd(idim))); } else if (t == periodic) { image.shift(idim, -domain.length(idim)); } } } BL_ASSERT(image.type() == srcbox.type()); HG_DEBUG_OUT("==>image(" << image << ")" << std::endl); return image; } // // Reflects on all outflow cases (which aren't called anyway). // On velocity inflow, uses box function which extends interior // box just past edge of domain. // void mixed_boundary::fill (FArrayBox& patch, const Box& region, const FArrayBox& src, const Box& domain) const { HG_DEBUG_OUT("FILL: " << "patch.box(" << patch.box() << ") " << "region(" << region << ") " << "src.box(" << src.box() << ") " << "domain(" << domain << ") " << std::endl); Box tdomain = domain; tdomain.convert(type(src)); Box idomain = BoxLib::grow(tdomain, IntVect::TheZeroVector()-type(src)); Box img = anImage(region, src.box(), domain); int idir = 0; int refarray[BL_SPACEDIM] = {0}; bool negflag = true; bool negarray[BL_SPACEDIM-1]; for (int i = 0; i < BL_SPACEDIM - 1; i++) { negarray[i] = true; } for (int idim = 0; idim < BL_SPACEDIM; idim++) { if (region.bigEnd(idim) < idomain.smallEnd(idim)) { const RegType t = ptr->bc[idim][0]; if (t == inflow && idim == flowdim) { idir = -1 - idim; } else if (t == refWall || t == inflow || t == outflow) { refarray[idim] = 1; if (flowdim == -3 || t == refWall && idim == flowdim) { negflag = !negflag; } if (flowdim == -4) { if (idim < BL_SPACEDIM - 1) { negarray[idim] = !negarray[idim]; } else { for (int i = 0; i < BL_SPACEDIM - 1; i++) { negarray[i] = !negarray[i]; } } } } } else if (region.smallEnd(idim) > idomain.bigEnd(idim)) { const RegType t = ptr->bc[idim][1]; if (t == inflow && idim == flowdim) { idir = 1 + idim; } if (t == refWall || t == inflow || t == outflow) { refarray[idim] = 1; if (flowdim == -3 || t == refWall && idim == flowdim) { negflag = !negflag; } if (flowdim == -4) { if (idim < BL_SPACEDIM - 1) { negarray[idim] = !negarray[idim]; } else { for (int i = 0; i < BL_SPACEDIM - 1; i++) { negarray[i] = !negarray[i]; } } } } } } HG_DEBUG_OUT("idir = " << idir << " flowdim = " << flowdim << " reg = " << region << " img = " << img << " src.box = " << src.box() << std::endl ); if (idir != 0) { // // Normal-component inflow section, assume patch.nComp() == 1 // Box bb = box_(img, domain, idir); if (img == region) { // // Only bdy involved, can fill directly from interior // HG_DEBUG_OUT("IMG==REGION" << img << region << std::endl); fill_(patch, region, src, bb, domain, idir); } else { // // Multiple bdys, fill intermediate patch. // FArrayBox gb(img); fill_(gb, img, src, bb, domain, idir); HG_DEBUG_OUT("IMG!=REGION negflag" << negflag << img << region << std::endl); if (negflag) { FORT_FBREFM(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), gb.dataPtr(), DIMLIST(img), DIMLIST(img), refarray, 1); } else { FORT_FBNEGM(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), gb.dataPtr(), DIMLIST(img), DIMLIST(img), refarray, 1); } } } else if (flowdim == -4) { for (int i = 0; i < BL_SPACEDIM; i++) { FORT_FBREFM(patch.dataPtr(i), DIMLIST(patch.box()), DIMLIST(region), src.dataPtr(i), DIMLIST(src.box()), DIMLIST(img), refarray, 1); } for (int idim = 0; idim < BL_SPACEDIM - 1; idim++) { const int i = idim + BL_SPACEDIM; if (negarray[idim]) { FORT_FBREFM(patch.dataPtr(i), DIMLIST(patch.box()), DIMLIST(region), src.dataPtr(i), DIMLIST(src.box()), DIMLIST(img), refarray, 1); } else { FORT_FBNEGM(patch.dataPtr(i), DIMLIST(patch.box()), DIMLIST(region), src.dataPtr(i), DIMLIST(src.box()), DIMLIST(img), refarray, 1); } } } else { // // All cases other than normal-component inflow. // if (src.box().contains(img)) // FIXME!!! { if (negflag) { HG_DEBUG_OUT("GOT HERE negflag\n"); FORT_FBREFM(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), src.dataPtr(), DIMLIST(src.box()), DIMLIST(img), refarray, patch.nComp()); } else { HG_DEBUG_OUT("GOT HERE not negflag\n"); FORT_FBNEGM(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), src.dataPtr(), DIMLIST(src.box()), DIMLIST(img), refarray, patch.nComp()); } } } } void mixed_boundary::fill_ (FArrayBox& patch, const Box& region, const FArrayBox& bgr, const Box& bb, const Box& domain, int idir) const { const int idim = abs(idir) - 1; const RegType t = ptr->bc[idim][idir > 0]; if (flowdim == -4 && (t == refWall || t == inflow)) { // // Terrain sigma. // BoxLib::Abort( "mixed_boundary::fill(): terrain undefined" ); } else if (t == refWall) { if (idim == flowdim || flowdim == -3) { FORT_FBNEG(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), bgr.dataPtr(), DIMLIST(bgr.box()), DIMLIST(bb), &idim, patch.nComp()); } else { FORT_FBREF(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), bgr.dataPtr(), DIMLIST(bgr.box()), DIMLIST(bb), &idim, patch.nComp()); } } else if (t == periodic) { patch.copy(bgr, bb, 0, region, 0, patch.nComp()); } else if (t == inflow) { if (flowdim == -2) { FORT_FBREF(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), bgr.dataPtr(), DIMLIST(bgr.box()), DIMLIST(bb), &idim, patch.nComp()); } else if (flowdim == -1) { // // Inflow density---just reflect interior for now // FORT_FBREF(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), bgr.dataPtr(), DIMLIST(bgr.box()), DIMLIST(bb), &idim, patch.nComp()); } else if (flowdim == -3) { FORT_FBNEG(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), bgr.dataPtr(), DIMLIST(bgr.box()), DIMLIST(bb), &idim, patch.nComp()); } else if (idim == flowdim) { // // For this to work, fill_borders must already have been called // to initialize values in the first ghost cell outside the domain. // HG_DEBUG_OUT("fill:" << "patch.box(" << patch.box() << ") " << "region(" << region << ") " << "bgr.box(" << bgr.box() << ") " << "bb(" << bb << ") " << std::endl); FORT_FBINFIL(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), bgr.dataPtr(), DIMLIST(bgr.box()), DIMLIST(bb), &idim, 1); } else if (flowdim >= 0) { // // Transverse velocity components. // FORT_FBREF(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), bgr.dataPtr(), DIMLIST(bgr.box()), DIMLIST(bb), &idim, patch.nComp()); } } else if (t == outflow) { // // Do nothing if NODE-based, reflect if CELL-based. // if (type(patch, idim) == IndexType::CELL) { FORT_FBREF(patch.dataPtr(), DIMLIST(patch.box()), DIMLIST(region), bgr.dataPtr(), DIMLIST(bgr.box()), DIMLIST(bb), &idim, patch.nComp()); } } else { BoxLib::Abort( "mixed_boundary::fill(): boundary type not supported" ); } } void mixed_boundary::sync_borders (MultiFab& r, const level_interface& lev_interface) const { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::sync_borders()"); BL_ASSERT(type(r) == IntVect::TheNodeVector()); task_list tl; // we are looping over only the fine-fine faces for (int iface = 0; iface < lev_interface.nboxes(level_interface::FACEDIM); iface++) { if (lev_interface.geo(level_interface::FACEDIM, iface) != level_interface::ALL) break; int igrid = lev_interface.grid(level_interface::FACEDIM, iface, 0); if (igrid < 0) { const int idim = lev_interface.fdim(iface); if (ptr->bc[idim][0] == periodic) { const int jgrid = lev_interface.grid(level_interface::FACEDIM, iface, 1); igrid = lev_interface.exterior_ref(igrid); const Box& b = lev_interface.node_box(level_interface::FACEDIM, iface); Box bb = b; bb.shift(idim, lev_interface.domain().length(idim)); tl.add_task(new task_copy(tl, r, jgrid, b, r, igrid, bb)); } } } tl.execute("mixed_boundary::sync_borders"); } extern "C" { typedef void (*F_B)(Real*, intS, intS, const Real*, intS, intS, const int*, const int&); } class task_fill_bord : public task_copy_base { public: task_fill_bord (F_B f_, task_list& tl_, MultiFab& mf_, int dgrid_, const Box& b_, const Box& bb_, int idim_, int jjj_, int nstart_); virtual bool ready (); private: void doit (); const F_B f; const int idim; const int jjj; const int nstart; }; task_fill_bord::task_fill_bord (F_B f_, task_list& tl_, MultiFab& mf_, int dgrid_, const Box& b_, const Box& bb_, int idim_, int jjj_, int nstart_) : task_copy_base(tl_, mf_, dgrid_, b_, mf_, dgrid_, bb_), f(f_), idim(idim_), jjj(jjj_), nstart(nstart_) { BL_ASSERT(m_tmp == 0); BL_ASSERT(&m_dmf == &m_smf); BL_ASSERT(m_dgrid == m_sgrid); if (is_local(m_dmf, m_dgrid) || is_local(m_smf, m_sgrid)) { _do_depend(); if (is_local(m_dmf, m_dgrid) && is_local(m_smf, m_sgrid)) { m_local = true; if (dependencies.empty()) { doit(); m_finished = true; } } } else { m_finished = true; } } bool task_fill_bord::ready () { BL_ASSERT(m_tmp == 0); BL_ASSERT(is_started()); BL_ASSERT(m_local); BL_ASSERT(!m_finished); doit(); return true; } void task_fill_bord::doit () { BL_ASSERT(m_tmp == 0); BL_ASSERT(m_dgrid == m_sgrid); BL_ASSERT(&m_smf == &m_dmf); BL_ASSERT(m_local); BL_ASSERT(!m_finished); BL_ASSERT(is_local(m_dmf, m_dgrid)); FArrayBox& fab = m_dmf[m_dgrid]; const Box& fab_box = fab.box(); (*f)(fab.dataPtr(nstart), DIMLIST(fab_box), DIMLIST(m_dbx), fab.dataPtr(nstart), DIMLIST(fab_box), DIMLIST(m_sbx), &idim, jjj); } void mixed_boundary::fill_borders (MultiFab& r, const level_interface& lev_interface, int w) const { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::fill_borders()"); w = (w < 0 || w > r.nGrow()) ? r.nGrow() : w; BL_ASSERT(w == 1 || w == 0); const Box& domain = lev_interface.domain(); task_list tl; // // We are looping over only the fine-fine faces. // for (int iface = 0; iface < lev_interface.nboxes(level_interface::FACEDIM); iface++) { if (lev_interface.geo(level_interface::FACEDIM, iface) != level_interface::ALL) break; const int igrid = lev_interface.grid(level_interface::FACEDIM, iface, 0); const int jgrid = lev_interface.grid(level_interface::FACEDIM, iface, 1); if (igrid < 0 || jgrid < 0) { Box b = lev_interface.box(level_interface::FACEDIM, iface); const int idim = lev_interface.fdim(iface); const int a = (type(r, idim) == IndexType::NODE); // // Need to do on x borders too in case y border is an interior face // if (igrid < 0) { for (int i = 0; i < BL_SPACEDIM; i++) { if (i != idim) { if (lev_interface.interior_mesh()[jgrid].smallEnd(i) == b.smallEnd(i)) { b.growLo(i, w); } if (lev_interface.interior_mesh()[jgrid].bigEnd(i) == b.bigEnd(i)) { b.growHi(i, w); } } } b.shift(idim, -a).growLo(idim, w-a).convert(type(r)); const RegType t = ptr->bc[idim][0]; Box bb = b; if (flowdim == -4 && (t == refWall || t == inflow)) { // // Terrain sigma // bb.shift( idim, 2 * domain.smallEnd(idim) - 1 + a - b.bigEnd(idim) - b.smallEnd(idim)); const Box& rbox = r.fabbox(jgrid); for (int i = 0; i < r.nComp(); i++) { if ((i == idim + BL_SPACEDIM) || (i >= BL_SPACEDIM && idim == BL_SPACEDIM - 1)) { tl.add_task( new task_fill_bord(FORT_FBNEG, tl, r, jgrid, b, bb, idim, 1, i)); } else { tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, jgrid, b, bb, idim, 1, i)); } } } else if (t == refWall) { bb.shift( idim, (2 * domain.smallEnd(idim) - 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(jgrid); if (idim == flowdim || flowdim == -3) { tl.add_task( new task_fill_bord(FORT_FBNEG, tl, r, jgrid, b, bb, idim, r.nComp(), 0)); } else { tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, jgrid, b, bb, idim, r.nComp(), 0)); } } else if (t == periodic) { const int isrc = lev_interface.exterior_ref(igrid); bb.shift(idim, domain.length(idim)); tl.add_task(new task_copy(tl, r, jgrid, b, r, isrc, bb)); } else if (t == inflow) { bb.shift( idim, (2 * domain.smallEnd(idim) - 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(jgrid); if (flowdim == -2) { tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, jgrid, b, bb, idim, r.nComp(), 0)); } else if (flowdim == -1) { // // Inflow density---just reflect interior for now // tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, jgrid, b, bb, idim, r.nComp(), 0)); } else if (flowdim == -3) { tl.add_task( new task_fill_bord(FORT_FBNEG, tl, r, jgrid, b, bb, idim, 1, 0)); } else if (idim == flowdim) { // // For this to work, fill_borders must be called // exactly once for each level of this variable. // tl.add_task( new task_fill_bord(FORT_FBINFLO, tl, r, jgrid, b, bb, idim, 1, 0)); } else if (flowdim >= 0) { // // Transverse velocity components. // tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, jgrid, b, bb, idim, 1, 0)); } } else if (t == outflow) { // // Do nothing if NODE-based, reflect if CELL-based. // if (type(r, idim) == IndexType::CELL) { bb.shift( idim, (2 * domain.smallEnd(idim) - 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(jgrid); tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, jgrid, b, bb, idim, r.nComp(), 0)); } } } else if (jgrid < 0) { for (int i = 0; i < BL_SPACEDIM; i++) { if (i != idim) { if (lev_interface.interior_mesh()[igrid].smallEnd(i) == b.smallEnd(i)) { b.growLo(i, w); } if (lev_interface.interior_mesh()[igrid].bigEnd(i) == b.bigEnd(i)) { b.growHi(i, w); } } } b.shift(idim, a).growHi(idim, w-a).convert(type(r)); const RegType t = ptr->bc[idim][1]; Box bb = b; if (flowdim == -4 && (t == refWall || t == inflow)) { // // Terrain sigma // bb.shift( idim, (2 * domain.bigEnd(idim) + 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(igrid); for (int i = 0; i < r.nComp(); i++) { if ((i == idim + BL_SPACEDIM) || (i >= BL_SPACEDIM && idim == BL_SPACEDIM - 1)) { tl.add_task( new task_fill_bord(FORT_FBNEG, tl, r, igrid, b, bb, idim, 1, i)); } else { tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, igrid, b, bb, idim, 1, i)); } } } else if (t == refWall) { bb.shift( idim, (2 * domain.bigEnd(idim) + 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(igrid); if (idim == flowdim || flowdim == -3) { tl.add_task( new task_fill_bord(FORT_FBNEG, tl, r, igrid, b, bb, idim, r.nComp(), 0)); } else { tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, igrid, b, bb, idim, r.nComp(), 0)); } } else if (t == periodic) { const int isrc = lev_interface.exterior_ref(jgrid); bb.shift(idim, -domain.length(idim)); tl.add_task(new task_copy(tl, r, igrid, b, r, isrc, bb)); } else if (t == inflow) { bb.shift( idim, (2 * domain.bigEnd(idim) + 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(igrid); if (flowdim == -2) { tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, igrid, b, bb, idim, 1, 0)); } else if (flowdim == -1) { // // Inflow density---just reflect interior for now // tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, igrid, b, bb, idim, r.nComp(), 0)); } else if (flowdim == -3) { tl.add_task( new task_fill_bord(FORT_FBNEG, tl, r, igrid, b, bb, idim, r.nComp(), 0)); } else if (idim == flowdim) { // // For this to work, fill_borders must be called // exactly once for each level of this variable. // tl.add_task( new task_fill_bord(FORT_FBINFLO, tl, r, igrid, b, bb, idim, 1, 0)); } else if (flowdim >= 0) { // // Transverse velocity components. // tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, igrid, b, bb, idim, 1, 0)); } } else if (t == outflow) { // // Do nothing if NODE-based, reflect if CELL-based. // if (type(r, idim) == IndexType::CELL) { bb.shift( idim, (2 * domain.bigEnd(idim) + 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(igrid); tl.add_task( new task_fill_bord(FORT_FBREF, tl, r, igrid, b, bb, idim, r.nComp(), 0)); } } } } } tl.execute("mixed_boundary::fill_borders"); } void mixed_boundary::fill_sync_reg_borders (MultiFab& r, const level_interface& lev_interface, int w) const { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::fill_sync_reg_borders()"); // This is the same as the fill_borders routine except that it // doesn't fill outside periodic boundaries w = (w < 0 || w > r.nGrow()) ? r.nGrow() : w; BL_ASSERT(w == 1 || w == 0); const Box& domain = lev_interface.domain(); task_list tl; // // We are looping over only the fine-fine faces. // for (int iface = 0; iface < lev_interface.nboxes(level_interface::FACEDIM); iface++) { if (lev_interface.geo(level_interface::FACEDIM, iface) != level_interface::ALL) break; Box c = lev_interface.box(level_interface::FACEDIM, iface); const int igrid = lev_interface.grid(level_interface::FACEDIM, iface, 0); const int jgrid = lev_interface.grid(level_interface::FACEDIM, iface, 1); if (igrid < 0 || jgrid < 0) { Box b = lev_interface.box(level_interface::FACEDIM, iface); const int idim = lev_interface.fdim(iface); const int a = (type(r,idim) == IndexType::NODE); // // Need to do on x borders too in case y border is an interior face // for (int i = 0; i < BL_SPACEDIM; i++) { if (i != idim) { if (domain.smallEnd(i) == b.smallEnd(i)) b.growLo(i, w); if (domain.bigEnd(i) == b.bigEnd(i) ) b.growHi(i, w); } } if (igrid < 0) { b.shift(idim, -a).growLo(idim, w-a).convert(type(r)); const RegType t = ptr->bc[idim][0]; Box bb = b; if (flowdim == -4 && (t == refWall || t == inflow)) { // // Terrain sigma // if (is_remote(r, jgrid)) continue; bb.shift( idim, 2 * domain.smallEnd(idim) - 1 + a - b.bigEnd(idim) - b.smallEnd(idim)); const Box& rbox = r.fabbox(jgrid); for (int i = 0; i < r.nComp(); i++) { if ((i == idim + BL_SPACEDIM) || (i >= BL_SPACEDIM && idim == BL_SPACEDIM - 1)) { FORT_FBNEG(r[jgrid].dataPtr(i), DIMLIST(rbox), DIMLIST(b), r[jgrid].dataPtr(i), DIMLIST(rbox), DIMLIST(bb), &idim, 1); } else { FORT_FBREF(r[jgrid].dataPtr(i), DIMLIST(rbox), DIMLIST(b), r[jgrid].dataPtr(i), DIMLIST(rbox), DIMLIST(bb), &idim, 1); } } } else if (t == refWall) { if ( is_remote(r, jgrid) ) continue; bb.shift( idim, (2 * domain.smallEnd(idim) - 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(jgrid); if (idim == flowdim || flowdim == -3) { FORT_FBNEG(r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, r.nComp()); } else { FORT_FBREF(r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, r.nComp()); } } else if (t == periodic) { #if 0 int isrc = lev_interface.exterior_ref(igrid); bb.shift(idim, domain.length(idim)); tl.add_task(new task_copy(tl, r, jgrid, b, r, isrc, bb)); #endif } else if (t == inflow) { if ( is_remote(r, jgrid) ) continue; bb.shift( idim, (2 * domain.smallEnd(idim) - 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(jgrid); if (flowdim == -2) { FORT_FBREF(r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, r.nComp()); } else if (flowdim == -1) { // // Inflow density---just reflect interior for now // FORT_FBREF(r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, r.nComp()); } else if (flowdim == -3) { FORT_FBNEG(r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, 1); } else if (idim == flowdim) { // // For this to work, fill_borders must be called // exactly once for each level of this variable. // FORT_FBINFLO(r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, 1); } else if (flowdim >= 0) { // // Transverse velocity components. // FORT_FBREF(r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, 1); } } else if (t == outflow) { // // Do nothing if NODE-based, reflect if CELL-based. // if (is_remote(r, jgrid)) continue; if (type(r,idim) == IndexType::CELL) { bb.shift( idim, (2 * domain.smallEnd(idim) - 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(jgrid); FORT_FBREF(r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[jgrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, r.nComp()); } } } else if (jgrid < 0) { b.shift(idim, a).growHi(idim, w-a).convert(type(r)); const RegType t = ptr->bc[idim][1]; Box bb = b; if (flowdim == -4 && (t == refWall || t == inflow)) { if (is_remote(r, igrid)) continue; // // Terrain sigma // bb.shift( idim, (2 * domain.bigEnd(idim) + 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(igrid); for (int i = 0; i < r.nComp(); i++) { if ((i == idim + BL_SPACEDIM) || (i >= BL_SPACEDIM && idim == BL_SPACEDIM - 1)) { FORT_FBNEG(r[igrid].dataPtr(i), DIMLIST(rbox), DIMLIST(b), r[igrid].dataPtr(i), DIMLIST(rbox), DIMLIST(bb), &idim, 1); } else { FORT_FBREF(r[igrid].dataPtr(i), DIMLIST(rbox), DIMLIST(b), r[igrid].dataPtr(i), DIMLIST(rbox), DIMLIST(bb), &idim, 1); } } } else if (t == refWall) { if (is_remote(r, igrid)) continue; bb.shift( idim, (2 * domain.bigEnd(idim) + 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(igrid); if (idim == flowdim || flowdim == -3) { FORT_FBNEG(r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, r.nComp()); } else { FORT_FBREF(r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, r.nComp()); } } else if (t == periodic) { #if 0 int isrc = lev_interface.exterior_ref(jgrid); bb.shift(idim, -domain.length(idim)); tl.add_task(new task_copy(tl, r, igrid, b, r, isrc, bb)); #endif } else if (t == inflow) { if (is_remote(r, igrid)) continue; bb.shift( idim, (2 * domain.bigEnd(idim) + 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(igrid); if (flowdim == -2) { FORT_FBREF(r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, 1); } else if (flowdim == -1) { // // Inflow density---just reflect interior for now // FORT_FBREF(r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, r.nComp()); } else if (flowdim == -3) { FORT_FBNEG(r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, r.nComp()); } else if (idim == flowdim) { // // For this to work, fill_borders must be called exactly // once for each level of this variable. // FORT_FBINFLO(r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, 1); } else if (flowdim >= 0) { // // Transverse velocity components. // FORT_FBREF(r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, 1); } } else if (t == outflow) { if (is_remote(r, igrid)) continue; // // Do nothing if NODE-based, reflect if CELL-based. // if (type(r,idim) == IndexType::CELL) { bb.shift( idim, (2 * domain.bigEnd(idim) + 1 + a - b.bigEnd(idim) - b.smallEnd(idim))); const Box& rbox = r.fabbox(igrid); FORT_FBREF(r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(b), r[igrid].dataPtr(), DIMLIST(rbox), DIMLIST(bb), &idim, r.nComp()); } } } } } tl.execute("mixed_boundary::fill_sync_reg_borders"); } void mixed_boundary::check_against_boundary_ (BoxList& bl, std::list& il, const Box& b, int ib, const Box& d, int dim1) const { for (int i = dim1; i < BL_SPACEDIM; i++) { if (b.smallEnd(i) == d.smallEnd(i)) { if (ptr->bc[i][0] == refWall || ptr->bc[i][0] == inflow) { Box bn = b; bn.shift(i, -b.length(i)); bl.push_back(bn); il.push_back(ib); check_against_boundary_(bl, il, bn, ib, d, i+1); } else if (ptr->bc[i][0] == periodic) { Box bn = b; bn.shift(i, d.length(i)); bl.push_back(bn); il.push_back(ib); check_against_boundary_(bl, il, bn, ib, d, i+1); } else if (ptr->bc[i][0] == outflow) { Box bn = b; bn.shift(i, -b.length(i)); bl.push_back(bn); il.push_back(-2); check_against_boundary_(bl, il, bn, -1, d, i+1); } else { BoxLib::Abort( "mixed_boundary::check_against_boundary():" "Boundary type not supported" ); } } if (b.bigEnd(i) == d.bigEnd(i)) { if (ptr->bc[i][1] == refWall || ptr->bc[i][1] == inflow) { Box bn = b; bn.shift(i, b.length(i)); bl.push_back(bn); il.push_back(ib); check_against_boundary_(bl, il, bn, ib, d, i+1); } else if (ptr->bc[i][1] == periodic) { Box bn = b; bn.shift(i, -d.length(i)); bl.push_back(bn); il.push_back(ib); check_against_boundary_(bl, il, bn, ib, d, i+1); } else if (ptr->bc[i][1] == outflow) { Box bn = b; bn.shift(i, b.length(i)); bl.push_back(bn); il.push_back(-2); check_against_boundary_(bl, il, bn, -1, d, i+1); } else { BoxLib::Abort( "mixed_boundary::check_against_boundary():" "Boundary type not supported" ); } } } } void mixed_boundary::duplicate (std::list& bl, const Box& domain) const { for (int i = 0; i < BL_SPACEDIM; i++) { if (ptr->bc[i][0] == periodic) { for (std::list::reverse_iterator bn = bl.rbegin(); bn != bl.rend(); ++bn) { if (bn->type(i) == IndexType::NODE) { if (bn->smallEnd(i) == domain.smallEnd(i)) { Box btmp = *bn; btmp.shift(i, domain.length(i)); if (std::find(bl.begin(),bl.end(),btmp) == bl.end()) { bl.push_back(btmp); } } else if (bn->bigEnd(i) - 1 == domain.bigEnd(i)) { Box btmp = *bn; btmp.shift(i, -domain.length(i)); if (std::find(bl.begin(),bl.end(),btmp) == bl.end()) { bl.push_back(btmp); } } } } } } } bool mixed_boundary::singular () const { BL_ASSERT(flowdim == -2); for (int idim = 0; idim < BL_SPACEDIM; idim++) { if (ptr->bc[idim][0] == outflow || ptr->bc[idim][1] == outflow) { return false; } } return true; } amr_fluid_boundary::amr_fluid_boundary () { for (int i = 0; i < BL_SPACEDIM; i++) { v[i] = 0; } s = 0; p = 0; ts = 0; } amr_fluid_boundary::~amr_fluid_boundary () {} const amr_boundary* amr_fluid_boundary::velocity (int i) const { return v[i]; } const amr_boundary* amr_fluid_boundary::scalar () const { return s; } const amr_boundary* amr_fluid_boundary::pressure () const { return p; } const amr_boundary* amr_fluid_boundary::terrain_sigma () const { return ts; } inviscid_fluid_boundary::inviscid_fluid_boundary (const RegType Bc[BL_SPACEDIM][2]) { for (int i = 0; i < BL_SPACEDIM; i++) { bc[i][0] = Bc[i][0]; bc[i][1] = Bc[i][1]; if ((bc[i][0] == periodic || bc[i][1] == periodic) && bc[i][1] != bc[i][0]) { BoxLib::Abort( "inviscid_fluid_boundary::inviscid_fluid_boundary():" "periodic bc's don't match" ); } v[i] = new mixed_boundary(this, i); } s = new mixed_boundary(this, -1); p = new mixed_boundary(this, -2); ts = new mixed_boundary(this, -4); } inviscid_fluid_boundary::~inviscid_fluid_boundary () { for (int i = 0; i < BL_SPACEDIM; i++) { delete v[i]; } delete s; delete p; delete ts; } RegType inviscid_fluid_boundary::getLoBC(int idim) const { return bc[idim][0]; } RegType inviscid_fluid_boundary::getHiBC(int idim) const { return bc[idim][1]; } ccseapps-2.5/CCSEApps/hgproj/fill_patch.H0000644000175000017500000000641711634153073021376 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _FILL_PATCH_H_ #define _FILL_PATCH_H_ #include "interface.H" #include "boundary.H" #include "interpolator.H" #include "restrictor.H" //void internal_copy(MultiFab& r, int destgrid, int srcgrid, const Box& b); Real inner_product (const MultiFab& r, const MultiFab& s); // returns grid number if patch is contained in a single grid, -1 otherwise. // int find_patch(const Box& region, const MultiFab& r); // Fills all ghost cells that can be obtained from other grids or // from the boundary conditions. If w is between 0 and border(), // inclusive, it will be used as the width of the regions to be // filled---otherwise, the full width will be used. void sync_borders (MultiFab& r, const level_interface& lev_interface, const amr_boundary* bdy); void fill_borders (MultiFab& r, const level_interface& lev_interface, const amr_boundary* bdy, int w, bool hg_dense); void clear_part_interface (MultiFab& r, const level_interface& lev_interface); void interpolate_patch (MultiFab& dmf, int dgrid, const Box& region, const MultiFab& r, const IntVect& rat, const amr_interpolator& interp, const level_interface& lev_interface); void restrict_level (MultiFab& dest, MultiFab& r, const IntVect& rat, const amr_restrictor& restric, const level_interface& lev_interface, const amr_boundary* bdy); void restrict_level (MultiFab& dest, MultiFab& r, const IntVect& rat); #endif /*_FILL_PATCH_H_*/ ccseapps-2.5/CCSEApps/hgproj/hg_multi3d_terrain.f0000644000175000017500000032442711634153073023116 0ustar amckinstryamckinstryc twenty-seven point terrain version: c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along face subroutine hgfres_terrain( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & fdst, fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2, & cdst, cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2, & sigmaf, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & sigmac, scl0,sch0,scl1,sch1,scl2,sch2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz, ir, jr, kr, idim, idir) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2 integer cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer scl0,sch0,scl1,sch1,scl2,sch2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision hx, hy, hz double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1,fdstl2:fdsth2) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1,cdstl2:cdsth2) double precision sigmaf(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2, 5) double precision sigmac(scl0:sch0,scl1:sch1,scl2:sch2, 5) integer ir, jr, kr, idim, idir double precision fac00, fac0, fac1, fac2, tmp, cen integer i, j, k, is, js, ks, l, m, n integer ii, jj, kk, i1, j1, k1 double precision MXXC, MYYC, MZZC, MXZC, MYZC double precision MXXF, MYYF, MZZF, MXZF, MYZF MXXC(ii,jj,kk) = (4.0D0 * cdst(ii,j,k) + & 2.0D0 * (cdst(ii,jj,k) - cdst(i,jj,k) + & cdst(ii,j,kk) - cdst(i,j,kk)) + & (cdst(ii,jj,kk) - cdst(i,jj,kk))) MYYC(ii,jj,kk) = (4.0D0 * cdst(i,jj,k) + & 2.0D0 * (cdst(ii,jj,k) - cdst(ii,j,k) + & cdst(i,jj,kk) - cdst(i,j,kk)) + & (cdst(ii,jj,kk) - cdst(ii,j,kk))) MZZC(ii,jj,kk) = (4.0D0 * cdst(i,j,kk) + & 2.0D0 * (cdst(ii,j,kk) - cdst(ii,j,k) + & cdst(i,jj,kk) - cdst(i,jj,k)) + & (cdst(ii,jj,kk) - cdst(ii,jj,k))) MXZC(ii,jj,kk) = (6.0D0 * cdst(ii,j,kk) + & 3.0D0 * (cdst(ii,jj,kk) - cdst(i,jj,k))) MYZC(ii,jj,kk) = (6.0D0 * cdst(i,jj,kk) + & 3.0D0 * (cdst(ii,jj,kk) - cdst(ii,j,k))) MXXF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(ii,j1,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(i1,jj,k1) + & fdst(ii,j1,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(i1,jj,kk))) MYYF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,jj,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(ii,j1,kk))) MZZF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,j1,kk) + & 2.0D0 * (fdst(ii,j1,kk) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,jj,k1)) + & (fdst(ii,jj,kk) - fdst(ii,jj,k1))) MXZF(i1,j1,k1,ii,jj,kk) = (6.0D0 * fdst(ii,j1,kk) + & 3.0D0 * (fdst(ii,jj,kk) - fdst(i1,jj,k1))) MYZF(i1,j1,k1,ii,jj,kk) = (6.0D0 * fdst(i1,jj,kk) + & 3.0D0 * (fdst(ii,jj,kk) - fdst(ii,j1,k1))) fac00 = 1.0D0 / 36 if (idim .eq. 0) then i = regl0 if (idir .eq. 1) then is = i - 1 else is = i end if do k = regl2, regh2 do j = regl1, regh1 tmp = sigmac(is ,j-1,k-1,1) * MXXC(i-idir,j-1,k-1) & +sigmac(is ,j-1,k ,1) * MXXC(i-idir,j-1,k+1) & +sigmac(is ,j ,k-1,1) * MXXC(i-idir,j+1,k-1) & +sigmac(is ,j ,k ,1) * MXXC(i-idir,j+1,k+1) tmp = tmp & +sigmac(is ,j-1,k-1,2) * MYYC(i-idir,j-1,k-1) & +sigmac(is ,j-1,k ,2) * MYYC(i-idir,j-1,k+1) & +sigmac(is ,j ,k-1,2) * MYYC(i-idir,j+1,k-1) & +sigmac(is ,j ,k ,2) * MYYC(i-idir,j+1,k+1) tmp = tmp & +sigmac(is ,j-1,k-1,3) * MZZC(i-idir,j-1,k-1) & +sigmac(is ,j-1,k ,3) * MZZC(i-idir,j-1,k+1) & +sigmac(is ,j ,k-1,3) * MZZC(i-idir,j+1,k-1) & +sigmac(is ,j ,k ,3) * MZZC(i-idir,j+1,k+1) tmp = tmp + idir * ( & -sigmac(is ,j-1,k-1,4) * MXZC(i-idir,j-1,k-1) & +sigmac(is ,j-1,k ,4) * MXZC(i-idir,j-1,k+1) & -sigmac(is ,j ,k-1,4) * MXZC(i-idir,j+1,k-1) & +sigmac(is ,j ,k ,4) * MXZC(i-idir,j+1,k+1) ) tmp = tmp & -sigmac(is ,j-1,k-1,5) * MYZC(i-idir,j-1,k-1) & +sigmac(is ,j-1,k ,5) * MYZC(i-idir,j-1,k+1) & +sigmac(is ,j ,k-1,5) * MYZC(i-idir,j+1,k-1) & -sigmac(is ,j ,k ,5) * MYZC(i-idir,j+1,k+1) cen = & 4.0D0 * ( sigmac(is,j-1,k-1,1) + sigmac(is,j-1,k,1) & +sigmac(is,j ,k-1,1) + sigmac(is,j ,k,1) & +sigmac(is,j-1,k-1,2) + sigmac(is,j-1,k,2) & +sigmac(is,j ,k-1,2) + sigmac(is,j ,k,2) & +sigmac(is,j-1,k-1,3) + sigmac(is,j-1,k,3) & +sigmac(is,j ,k-1,3) + sigmac(is,j ,k,3)) & + idir * 6.0D0 * (-sigmac(is,j-1,k-1,4) + sigmac(is,j-1,k,4) & -sigmac(is,j ,k-1,4) + sigmac(is,j ,k,4)) & + 6.0D0 * ( sigmac(is,j-1,k ,5) - sigmac(is,j-1,k-1,5) & +sigmac(is,j ,k-1,5) - sigmac(is,j ,k,5)) res(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) - fac00 * (tmp - cen * cdst(i,j,k)) end do end do fac0 = fac00 / (jr * kr) i = i * ir if (idir .eq. 1) then is = i else is = i - 1 end if do l = -(kr-1), kr-1 fac2 = (kr-abs(l)) * fac0 do n = -(jr-1), jr-1 fac1 = (jr-abs(n)) * fac2 do k = kr*regl2, kr*regh2, kr do j = jr*regl1, jr*regh1, jr tmp = sigmaf(is,j+n-1,k+l-1,1) & * MXXF(i,j+n,k+l,i+idir,j+n-1,k+l-1) & +sigmaf(is,j+n-1,k+l ,1) & * MXXF(i,j+n,k+l,i+idir,j+n-1,k+l+1) & +sigmaf(is,j+n ,k+l-1,1) & * MXXF(i,j+n,k+l,i+idir,j+n+1,k+l-1) & +sigmaf(is,j+n ,k+l ,1) & * MXXF(i,j+n,k+l,i+idir,j+n+1,k+l+1) tmp = tmp & +sigmaf(is,j+n-1,k+l-1,2) & * MYYF(i,j+n,k+l,i+idir,j+n-1,k+l-1) & +sigmaf(is,j+n-1,k+l ,2) & * MYYF(i,j+n,k+l,i+idir,j+n-1,k+l+1) & +sigmaf(is,j+n ,k+l-1,2) & * MYYF(i,j+n,k+l,i+idir,j+n+1,k+l-1) & +sigmaf(is,j+n ,k+l ,2) & * MYYF(i,j+n,k+l,i+idir,j+n+1,k+l+1) tmp = tmp & +sigmaf(is,j+n-1,k+l-1,3) & * MZZF(i,j+n,k+l,i+idir,j+n-1,k+l-1) & +sigmaf(is,j+n-1,k+l ,3) & * MZZF(i,j+n,k+l,i+idir,j+n-1,k+l+1) & +sigmaf(is,j+n ,k+l-1,3) & * MZZF(i,j+n,k+l,i+idir,j+n+1,k+l-1) & +sigmaf(is,j+n ,k+l ,3) & * MZZF(i,j+n,k+l,i+idir,j+n+1,k+l+1) tmp = tmp + idir * ( & sigmaf(is,j+n-1,k+l-1,4) & * MXZF(i,j+n,k+l,i+idir,j+n-1,k+l-1) & -sigmaf(is,j+n-1,k+l ,4) & * MXZF(i,j+n,k+l,i+idir,j+n-1,k+l+1) & +sigmaf(is,j+n ,k+l-1,4) & * MXZF(i,j+n,k+l,i+idir,j+n+1,k+l-1) & -sigmaf(is,j+n ,k+l ,4) & * MXZF(i,j+n,k+l,i+idir,j+n+1,k+l+1)) tmp = tmp & -sigmaf(is,j+n-1,k+l-1,5) & * MYZF(i,j+n,k+l,i+idir,j+n-1,k+l-1) & +sigmaf(is,j+n-1,k+l ,5) & * MYZF(i,j+n,k+l,i+idir,j+n-1,k+l+1) & +sigmaf(is,j+n ,k+l-1,5) & * MYZF(i,j+n,k+l,i+idir,j+n+1,k+l-1) & -sigmaf(is,j+n ,k+l ,5) & * MYZF(i,j+n,k+l,i+idir,j+n+1,k+l+1) cen = & 4.0D0 *(sigmaf(is,j+n-1,k+l-1,1) + sigmaf(is,j+n-1,k+l ,1) & +sigmaf(is,j+n ,k+l-1,1) + sigmaf(is,j+n ,k+l ,1) & +sigmaf(is,j+n-1,k+l-1,2) + sigmaf(is,j+n-1,k+l ,2) & +sigmaf(is,j+n ,k+l-1,2) + sigmaf(is,j+n ,k+l ,2) & +sigmaf(is,j+n-1,k+l-1,3) + sigmaf(is,j+n-1,k+l ,3) & +sigmaf(is,j+n ,k+l-1,3) + sigmaf(is,j+n ,k+l ,3)) & + idir * & 6.0D0 *(-sigmaf(is,j+n-1,k+l ,4) + sigmaf(is,j+n-1,k+l-1,4) & -sigmaf(is,j+n ,k+l ,4) + sigmaf(is,j+n ,k+l-1,4)) & + 6.0D0 *( sigmaf(is,j+n-1,k+l ,5) - sigmaf(is,j+n-1,k+l-1,5) & +sigmaf(is,j+n ,k+l-1,5) - sigmaf(is,j+n ,k+l ,5)) res(i,j,k) = res(i,j,k) & - fac1 * (tmp - cen * fdst(i,j+n,k+l)) end do end do end do end do else if (idim .eq. 1) then j = regl1 if (idir .eq. 1) then js = j - 1 else js = j end if do k = regl2, regh2 do i = regl0, regh0 tmp = sigmac(i-1,js,k-1,1) * MXXC(i-1,j-idir,k-1) & +sigmac(i-1,js,k ,1) * MXXC(i-1,j-idir,k+1) & +sigmac(i ,js,k-1,1) * MXXC(i+1,j-idir,k-1) & +sigmac(i ,js,k ,1) * MXXC(i+1,j-idir,k+1) tmp = tmp & +sigmac(i-1,js,k-1,2) * MYYC(i-1,j-idir,k-1) & +sigmac(i-1,js,k ,2) * MYYC(i-1,j-idir,k+1) & +sigmac(i ,js,k-1,2) * MYYC(i+1,j-idir,k-1) & +sigmac(i ,js,k ,2) * MYYC(i+1,j-idir,k+1) tmp = tmp & +sigmac(i-1,js,k-1,3) * MZZC(i-1,j-idir,k-1) & +sigmac(i-1,js,k ,3) * MZZC(i-1,j-idir,k+1) & +sigmac(i ,js,k-1,3) * MZZC(i+1,j-idir,k-1) & +sigmac(i ,js,k ,3) * MZZC(i+1,j-idir,k+1) tmp = tmp & -sigmac(i-1,js,k-1,4) * MXZC(i-1,j-idir,k-1) & +sigmac(i-1,js,k ,4) * MXZC(i-1,j-idir,k+1) & +sigmac(i ,js,k-1,4) * MXZC(i+1,j-idir,k-1) & -sigmac(i ,js,k ,4) * MXZC(i+1,j-idir,k+1) tmp = tmp + idir * ( & -sigmac(i-1,js,k-1,5) * MYZC(i-1,j-idir,k-1) & +sigmac(i-1,js,k ,5) * MYZC(i-1,j-idir,k+1) & -sigmac(i ,js,k-1,5) * MYZC(i+1,j-idir,k-1) & +sigmac(i ,js,k ,5) * MYZC(i+1,j-idir,k+1) ) cen = & 4.0D0 * (sigmac(i-1,js,k-1,1) + sigmac(i-1,js,k,1) & +sigmac(i ,js,k-1,1) + sigmac(i ,js,k,1) & +sigmac(i-1,js,k-1,2) + sigmac(i-1,js,k,2) & +sigmac(i ,js,k-1,2) + sigmac(i ,js,k,2) & +sigmac(i-1,js,k-1,3) + sigmac(i-1,js,k,3) & +sigmac(i ,js,k-1,3) + sigmac(i ,js,k,3)) & + 6.0D0 * (sigmac(i-1,js,k ,4) - sigmac(i-1,js,k-1,4) & +sigmac(i ,js,k-1,4) - sigmac(i ,js,k ,4)) & + idir * 6.0D0 * (-sigmac(i-1,js,k-1,5) + sigmac(i-1,js,k,5) & -sigmac(i ,js,k-1,5) + sigmac(i ,js,k,5)) res(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) - fac00 * (tmp - cen * cdst(i,j,k)) end do end do fac0 = fac00 / (ir * kr) j = j * jr if (idir .eq. 1) then js = j else js = j - 1 end if do l = -(kr-1), kr-1 fac2 = (kr-abs(l)) * fac0 do m = -(ir-1), ir-1 fac1 = (ir-abs(m)) * fac2 do k = kr*regl2, kr*regh2, kr do i = ir*regl0, ir*regh0, ir tmp = sigmaf(i+m-1,js,k+l-1,1) & * MXXF(i+m,j,k+l,i+m-1,j+idir,k+l-1) & +sigmaf(i+m-1,js,k+l ,1) & * MXXF(i+m,j,k+l,i+m-1,j+idir,k+l+1) & +sigmaf(i+m ,js,k+l-1,1) & * MXXF(i+m,j,k+l,i+m+1,j+idir,k+l-1) & +sigmaf(i+m ,js,k+l ,1) & * MXXF(i+m,j,k+l,i+m+1,j+idir,k+l+1) tmp = tmp & +sigmaf(i+m-1,js,k+l-1,2) & * MYYF(i+m,j,k+l,i+m-1,j+idir,k+l-1) & +sigmaf(i+m-1,js,k+l ,2) & * MYYF(i+m,j,k+l,i+m-1,j+idir,k+l+1) & +sigmaf(i+m ,js,k+l-1,2) & * MYYF(i+m,j,k+l,i+m+1,j+idir,k+l-1) & +sigmaf(i+m ,js,k+l ,2) & * MYYF(i+m,j,k+l,i+m+1,j+idir,k+l+1) tmp = tmp & +sigmaf(i+m-1,js,k+l-1,3) & * MZZF(i+m,j,k+l,i+m-1,j+idir,k+l-1) & +sigmaf(i+m-1,js,k+l ,3) & * MZZF(i+m,j,k+l,i+m-1,j+idir,k+l+1) & +sigmaf(i+m ,js,k+l-1,3) & * MZZF(i+m,j,k+l,i+m+1,j+idir,k+l-1) & +sigmaf(i+m ,js,k+l ,3) & * MZZF(i+m,j,k+l,i+m+1,j+idir,k+l+1) tmp = tmp & -sigmaf(i+m-1,js,k+l-1,4) & * MXZF(i+m,j,k+l,i+m-1,j+idir,k+l-1) & +sigmaf(i+m-1,js,k+l ,4) & * MXZF(i+m,j,k+l,i+m-1,j+idir,k+l+1) & +sigmaf(i+m ,js,k+l-1,4) & * MXZF(i+m,j,k+l,i+m+1,j+idir,k+l-1) & -sigmaf(i+m ,js,k+l ,4) & * MXZF(i+m,j,k+l,i+m+1,j+idir,k+l+1) tmp = tmp + idir * ( & sigmaf(i+m-1,js,k+l-1,5) & * MYZF(i+m,j,k+l,i+m-1,j+idir,k+l-1) & -sigmaf(i+m-1,js,k+l ,5) & * MYZF(i+m,j,k+l,i+m-1,j+idir,k+l+1) & +sigmaf(i+m ,js,k+l-1,5) & * MYZF(i+m,j,k+l,i+m+1,j+idir,k+l-1) & -sigmaf(i+m ,js,k+l ,5) & * MYZF(i+m,j,k+l,i+m+1,j+idir,k+l+1)) cen = & 4.0D0 * (sigmaf(i+m-1,js,k+l-1,1) + sigmaf(i+m-1,js,k+l ,1) & +sigmaf(i+m ,js,k+l-1,1) + sigmaf(i+m ,js,k+l ,1) & +sigmaf(i+m-1,js,k+l-1,2) + sigmaf(i+m-1,js,k+l ,2) & +sigmaf(i+m ,js,k+l-1,2) + sigmaf(i+m ,js,k+l ,2) & +sigmaf(i+m-1,js,k+l-1,3) + sigmaf(i+m-1,js,k+l ,3) & +sigmaf(i+m ,js,k+l-1,3) + sigmaf(i+m ,js,k+l ,3)) & +6.0D0 * (sigmaf(i+m-1,js,k+l ,4) - sigmaf(i+m-1,js,k+l-1,4) & +sigmaf(i+m ,js,k+l-1,4) - sigmaf(i+m ,js,k+l ,4)) & + idir * & 6.0D0 * (-sigmaf(i+m-1,js,k+l ,5) + sigmaf(i+m-1,js,k+l-1,5) & -sigmaf(i+m ,js,k+l ,5) + sigmaf(i+m ,js,k+l-1,5)) res(i,j,k) = res(i,j,k) - fac1 * (tmp - cen * fdst(i+m,j,k+l)) end do end do end do end do else k = regl2 if (idir .eq. 1) then ks = k - 1 else ks = k end if do j = regl1, regh1 do i = regl0, regh0 tmp = sigmac(i-1,j-1,ks,1) * MXXC(i-1,j-1,k-idir) & +sigmac(i-1,j ,ks,1) * MXXC(i-1,j+1,k-idir) & +sigmac(i ,j-1,ks,1) * MXXC(i+1,j-1,k-idir) & +sigmac(i ,j ,ks,1) * MXXC(i+1,j+1,k-idir) tmp = tmp & +sigmac(i-1,j-1,ks,2) * MYYC(i-1,j-1,k-idir) & +sigmac(i-1,j ,ks,2) * MYYC(i-1,j+1,k-idir) & +sigmac(i ,j-1,ks,2) * MYYC(i+1,j-1,k-idir) & +sigmac(i ,j ,ks,2) * MYYC(i+1,j+1,k-idir) tmp = tmp & +sigmac(i-1,j-1,ks,3) * MZZC(i-1,j-1,k-idir) & +sigmac(i-1,j ,ks,3) * MZZC(i-1,j+1,k-idir) & +sigmac(i ,j-1,ks,3) * MZZC(i+1,j-1,k-idir) & +sigmac(i ,j ,ks,3) * MZZC(i+1,j+1,k-idir) tmp = tmp + idir * ( & -sigmac(i-1,j-1,ks,4) * MXZC(i-1,j-1,k-idir) & -sigmac(i-1,j ,ks,4) * MXZC(i-1,j+1,k-idir) & +sigmac(i ,j-1,ks,4) * MXZC(i+1,j-1,k-idir) & +sigmac(i ,j ,ks,4) * MXZC(i+1,j+1,k-idir) ) tmp = tmp + idir * ( & -sigmac(i-1,j-1,ks,5) * MYZC(i-1,j-1,k-idir) & +sigmac(i-1,j ,ks,5) * MYZC(i-1,j+1,k-idir) & -sigmac(i ,j-1,ks,5) * MYZC(i+1,j-1,k-idir) & +sigmac(i ,j ,ks,5) * MYZC(i+1,j+1,k-idir) ) cen = & 4.0D0 * ( sigmac(i-1,j-1,ks,1) & +sigmac(i-1,j ,ks,1) & +sigmac(i ,j-1,ks,1) & +sigmac(i ,j ,ks,1) & +sigmac(i-1,j-1,ks,2) & +sigmac(i-1,j ,ks,2) & +sigmac(i ,j-1,ks,2) & +sigmac(i ,j ,ks,2) & +sigmac(i-1,j-1,ks,3) & +sigmac(i-1,j ,ks,3) & +sigmac(i ,j-1,ks,3) & +sigmac(i ,j ,ks,3)) & + idir * 6.0D0 * (-sigmac(i-1,j-1,ks,4) & -sigmac(i-1,j ,ks,4) & +sigmac(i ,j-1,ks,4) & +sigmac(i ,j ,ks,4) ) & + idir * 6.0D0 * (-sigmac(i-1,j-1,ks,5) & +sigmac(i-1,j,ks,5) & -sigmac(i ,j-1,ks,5) & +sigmac(i ,j,ks,5)) res(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) - fac00 * (tmp - cen * cdst(i,j,k)) end do end do fac0 = fac00 / (ir * jr) k = k * kr if (idir .eq. 1) then ks = k else ks = k - 1 end if do n = -(jr-1), jr-1 fac2 = (jr-abs(n)) * fac0 do m = -(ir-1), ir-1 fac1 = (ir-abs(m)) * fac2 do j = jr*regl1, jr*regh1, jr do i = ir*regl0, ir*regh0, ir tmp = sigmaf(i+m-1,j+n-1,ks,1) & * MXXF(i+m,j+n,k,i+m-1,j+n-1,k+idir) & +sigmaf(i+m-1,j+n ,ks,1) & * MXXF(i+m,j+n,k,i+m-1,j+n+1,k+idir) & +sigmaf(i+m ,j+n-1,ks,1) & * MXXF(i+m,j+n,k,i+m+1,j+n-1,k+idir) & +sigmaf(i+m ,j+n ,ks,1) & * MXXF(i+m,j+n,k,i+m+1,j+n+1,k+idir) tmp = tmp & +sigmaf(i+m-1,j+n-1,ks,2) & * MYYF(i+m,j+n,k,i+m-1,j+n-1,k+idir) & +sigmaf(i+m-1,j+n ,ks,2) & * MYYF(i+m,j+n,k,i+m-1,j+n+1,k+idir) & +sigmaf(i+m ,j+n-1,ks,2) & * MYYF(i+m,j+n,k,i+m+1,j+n-1,k+idir) & +sigmaf(i+m ,j+n ,ks,2) & * MYYF(i+m,j+n,k,i+m+1,j+n+1,k+idir) tmp = tmp & +sigmaf(i+m-1,j+n-1,ks,3) & * MZZF(i+m,j+n,k,i+m-1,j+n-1,k+idir) & +sigmaf(i+m-1,j+n ,ks,3) & * MZZF(i+m,j+n,k,i+m-1,j+n+1,k+idir) & +sigmaf(i+m ,j+n-1,ks,3) & * MZZF(i+m,j+n,k,i+m+1,j+n-1,k+idir) & +sigmaf(i+m ,j+n ,ks,3) & * MZZF(i+m,j+n,k,i+m+1,j+n+1,k+idir) tmp = tmp + idir * ( & sigmaf(i+m-1,j+n-1,ks,4) & * MXZF(i+m,j+n,k,i+m-1,j+n-1,k+idir) & +sigmaf(i+m-1,j+n ,ks,4) & * MXZF(i+m,j+n,k,i+m-1,j+n+1,k+idir) & -sigmaf(i+m ,j+n-1,ks,4) & * MXZF(i+m,j+n,k,i+m+1,j+n-1,k+idir) & -sigmaf(i+m ,j+n ,ks,4) & * MXZF(i+m,j+n,k,i+m+1,j+n+1,k+idir)) tmp = tmp + idir * ( & sigmaf(i+m-1,j+n-1,ks,5) & * MYZF(i+m,j+n,k,i+m-1,j+n-1,k+idir) & -sigmaf(i+m-1,j+n ,ks,5) & * MYZF(i+m,j+n,k,i+m-1,j+n+1,k+idir) & +sigmaf(i+m ,j+n-1,ks,5) & * MYZF(i+m,j+n,k,i+m+1,j+n-1,k+idir) & -sigmaf(i+m ,j+n ,ks,5) & * MYZF(i+m,j+n,k,i+m+1,j+n+1,k+idir)) cen = & 4.0D0 * (sigmaf(i+m-1,j+n-1,ks,1) & +sigmaf(i+m-1,j+n ,ks,1) & +sigmaf(i+m ,j+n-1,ks,1) & +sigmaf(i+m ,j+n ,ks,1) & +sigmaf(i+m-1,j+n-1,ks,2) & +sigmaf(i+m-1,j+n ,ks,2) & +sigmaf(i+m ,j+n-1,ks,2) & +sigmaf(i+m ,j+n ,ks,2) & +sigmaf(i+m-1,j+n-1,ks,3) & +sigmaf(i+m-1,j+n ,ks,3) & +sigmaf(i+m ,j+n-1,ks,3) & +sigmaf(i+m ,j+n ,ks,3)) & + idir * & 6.0D0 * (sigmaf(i+m-1,j+n-1,ks,4) & +sigmaf(i+m-1,j+n ,ks,4) & -sigmaf(i+m ,j+n-1,ks,4) & -sigmaf(i+m ,j+n ,ks,4)) & + idir * & 6.0D0 * (sigmaf(i+m-1,j+n-1,ks,5) & -sigmaf(i+m-1,j+n ,ks,5) & +sigmaf(i+m ,j+n-1,ks,5) & -sigmaf(i+m ,j+n ,ks,5)) res(i,j,k) = res(i,j,k) - fac1 * (tmp - cen * fdst(i+m,j+n,k)) end do end do end do end do end if end c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along face subroutine hgeres_terrain( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & fdst, fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2, & cdst, cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2, & sigmaf, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & sigmac, scl0,sch0,scl1,sch1,scl2,sch2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz, ir, jr, kr, ga, ivect) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2 integer cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer scl0,sch0,scl1,sch1,scl2,sch2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision hx, hy, hz double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1,fdstl2:fdsth2) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1,cdstl2:cdsth2) double precision sigmaf(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2,5) double precision sigmac(scl0:sch0,scl1:sch1,scl2:sch2,5) integer ir, jr, kr, ivect(0:2), ga(0:1,0:1,0:1) double precision fac00, fac0, fac1, fac, tmp, cen integer ic, jc, kc, if, jf, kf, ji, ki, idir, jdir, kdir integer l, m, n integer i1, j1, k1, ii, jj, kk double precision MXXC, MYYC, MZZC, MXZC, MYZC double precision MXXF, MYYF, MZZF, MXZF, MYZF MXXC(ii,jj,kk) = (4.0D0 * cdst(ii,jc,kc) + & 2.0D0 * (cdst(ii,jj,kc) - cdst(ic,jj,kc) + & cdst(ii,jc,kk) - cdst(ic,jc,kk)) + & (cdst(ii,jj,kk) - cdst(ic,jj,kk))) MYYC(ii,jj,kk) = (4.0D0 * cdst(ic,jj,kc) + & 2.0D0 * (cdst(ii,jj,kc) - cdst(ii,jc,kc) + & cdst(ic,jj,kk) - cdst(ic,jc,kk)) + & (cdst(ii,jj,kk) - cdst(ii,jc,kk))) MZZC(ii,jj,kk) = (4.0D0 * cdst(ic,jc,kk) + & 2.0D0 * (cdst(ii,jc,kk) - cdst(ii,jc,kc) + & cdst(ic,jj,kk) - cdst(ic,jj,kc)) + & (cdst(ii,jj,kk) - cdst(ii,jj,kc))) MXZC(ii,jj,kk) = (6.0D0 * cdst(ii,jc,kk) + & 3.0D0 * (cdst(ii,jj,kk) - cdst(ic,jj,kc))) MYZC(ii,jj,kk) = (6.0D0 * cdst(ic,jj,kk) + & 3.0D0 * (cdst(ii,jj,kk) - cdst(ii,jc,kc))) MXXF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(ii,j1,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(i1,jj,k1) + & fdst(ii,j1,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(i1,jj,kk))) MYYF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,jj,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(ii,j1,kk))) MZZF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,j1,kk) + & 2.0D0 * (fdst(ii,j1,kk) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,jj,k1)) + & (fdst(ii,jj,kk) - fdst(ii,jj,k1))) MXZF(i1,j1,k1,ii,jj,kk) = (6.0D0 * fdst(ii,j1,kk) + & 3.0D0 * (fdst(ii,jj,kk) - fdst(i1,jj,k1))) MYZF(i1,j1,k1,ii,jj,kk) = (6.0D0 * fdst(i1,jj,kk) + & 3.0D0 * (fdst(ii,jj,kk) - fdst(ii,j1,k1))) ic = regl0 jc = regl1 kc = regl2 if = ic * ir jf = jc * jr kf = kc * kr fac00 = 1.0D0 / 36 if (ivect(0) .eq. 0) then do if = ir*regl0, ir*regh0, ir res(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac0 = 1.0D0 / ir do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) .eq. 1) then do m = -(ir-1), ir-1 fac = (ir-abs(m)) * fac0 do if = ir*regl0, ir*regh0, ir tmp = sigmaf(if+m-1,jf+ji-1,kf+ki-1,1) * & MXXF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,1) * & MXXF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,2) * & MYYF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,2) * & MYYF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,3) * & MZZF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,3) * & MZZF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) tmp = tmp + kdir * ( & sigmaf(if+m-1,jf+ji-1,kf+ki-1,4) * & MXZF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & -sigmaf(if+m ,jf+ji-1,kf+ki-1,4) * & MXZF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) ) tmp = tmp + jdir * kdir * ( & -sigmaf(if+m-1,jf+ji-1,kf+ki-1,5) * & MYZF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & -sigmaf(if+m ,jf+ji-1,kf+ki-1,5) * & MYZF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) ) cen = & 4.0D0 * ( sigmaf(if+m-1,jf+ji-1,kf+ki-1,1) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,1) & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,2) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,2) & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,3) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,3)) & + 6.0D0 * ( sigmaf(if+m-1,jf+ji-1,kf+ki-1,4) & -sigmaf(if+m ,jf+ji-1,kf+ki-1,4)) * kdir & + 6.0D0 * (-sigmaf(if+m-1,jf+ji-1,kf+ki-1,5) & -sigmaf(if+m ,jf+ji-1,kf+ki-1,5)) * jdir * kdir tmp = tmp - cen * fdst(if+m,jf,kf) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do else do ic = regl0, regh0 if = ic * ir tmp = sigmac(ic-1,jc+ji-1,kc+ki-1,1) * & MXXC(ic-1,jc+jdir,kc+kdir) & +sigmac(ic ,jc+ji-1,kc+ki-1,1) * & MXXC(ic+1,jc+jdir,kc+kdir) tmp = tmp & +sigmac(ic-1,jc+ji-1,kc+ki-1,2) * & MYYC(ic-1,jc+jdir,kc+kdir) & +sigmac(ic ,jc+ji-1,kc+ki-1,2) * & MYYC(ic+1,jc+jdir,kc+kdir) tmp = tmp & +sigmac(ic-1,jc+ji-1,kc+ki-1,3) * & MZZC(ic-1,jc+jdir,kc+kdir) & +sigmac(ic ,jc+ji-1,kc+ki-1,3) * & MZZC(ic+1,jc+jdir,kc+kdir) tmp = tmp + kdir * ( & sigmac(ic-1,jc+ji-1,kc+ki-1,4) * & MXZC(ic-1,jc+jdir,kc+kdir) & -sigmac(ic ,jc+ji-1,kc+ki-1,4) * & MXZC(ic+1,jc+jdir,kc+kdir) ) tmp = tmp + jdir * kdir * ( & -sigmac(ic-1,jc+ji-1,kc+ki-1,5) * & MYZC(ic-1,jc+jdir,kc+kdir) & -sigmac(ic ,jc+ji-1,kc+ki-1,5) * & MYZC(ic+1,jc+jdir,kc+kdir) ) cen = & 4.0D0 * ( sigmac(ic-1,jc+ji-1,kc+ki-1,1) & +sigmac(ic ,jc+ji-1,kc+ki-1,1) & +sigmac(ic-1,jc+ji-1,kc+ki-1,2) & +sigmac(ic ,jc+ji-1,kc+ki-1,2) & +sigmac(ic-1,jc+ji-1,kc+ki-1,3) & +sigmac(ic ,jc+ji-1,kc+ki-1,3)) & + 6.0D0 * ( sigmac(ic-1,jc+ji-1,kc+ki-1,4) & -sigmac(ic ,jc+ji-1,kc+ki-1,4)) * kdir & + 6.0D0 * (-sigmac(ic-1,jc+ji-1,kc+ki-1,5) & -sigmac(ic ,jc+ji-1,kc+ki-1,5)) * jdir * kdir tmp = tmp - cen * cdst(ic,jc,kc) res(if,jf,kf) = res(if,jf,kf) + tmp end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) - ga(0,ji,1-ki) .eq. 1) then fac0 = 1.0D0 / (ir * jr) do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 do m = -(ir-1), ir-1 fac = (ir-abs(m)) * fac1 do if = ir*regl0, ir*regh0, ir tmp = sigmaf(if+m-1,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) tmp = tmp + kdir * ( & +sigmaf(if+m-1,jf+n-1,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & -sigmaf(if+m ,jf+n-1,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & -sigmaf(if+m ,jf+n ,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) ) tmp = tmp + kdir * ( & +sigmaf(if+m-1,jf+n-1,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & -sigmaf(if+m-1,jf+n ,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & -sigmaf(if+m ,jf+n ,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) ) cen = & 4.0D0 * (sigmaf(if+m-1,jf+n-1,kf+ki-1,1) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) & +sigmaf(if+m ,jf+n ,kf+ki-1,3)) & + 6.0D0 * (sigmaf(if+m-1,jf+n-1,kf+ki-1,4) & +sigmaf(if+m-1,jf+n ,kf+ki-1,4) & -sigmaf(if+m ,jf+n-1,kf+ki-1,4) & -sigmaf(if+m ,jf+n ,kf+ki-1,4)) * kdir & + 6.0D0 * (sigmaf(if+m-1,jf+n-1,kf+ki-1,5) & -sigmaf(if+m-1,jf+n ,kf+ki-1,5) & +sigmaf(if+m ,jf+n-1,kf+ki-1,5) & -sigmaf(if+m ,jf+n ,kf+ki-1,5)) * kdir tmp = tmp - cen * fdst(if+m,jf+n,kf) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if if (ga(0,ji,ki) - ga(0,1-ji,ki) .eq. 1) then fac0 = 1.0D0 / (ir * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do m = -(ir-1), ir-1 fac = (ir-abs(m)) * fac1 do if = ir*regl0, ir*regh0, ir tmp = sigmaf(if+m-1,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) tmp = tmp + ( & -sigmaf(if+m-1,jf+ji-1,kf+l-1,4) * & MXZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,4) * & MXZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,4) * & MXZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & -sigmaf(if+m ,jf+ji-1,kf+l ,4) * & MXZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) tmp = tmp + jdir * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,5) * & MYZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & -sigmaf(if+m-1,jf+ji-1,kf+l ,5) * & MYZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,5) * & MYZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & -sigmaf(if+m ,jf+ji-1,kf+l ,5) * & MYZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) cen = & 4.0D0 * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,1) & +sigmaf(if+m ,jf+ji-1,kf+l ,1) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) & +sigmaf(if+m-1,jf+ji-1,kf+l ,2) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) & +sigmaf(if+m ,jf+ji-1,kf+l ,2) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) & +sigmaf(if+m-1,jf+ji-1,kf+l ,3) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) & +sigmaf(if+m ,jf+ji-1,kf+l ,3)) & + 6.0D0 * (sigmaf(if+m-1,jf+ji-1,kf+l ,4) & -sigmaf(if+m-1,jf+ji-1,kf+l-1,4) & +sigmaf(if+m ,jf+ji-1,kf+l-1,4) & -sigmaf(if+m ,jf+ji-1,kf+l ,4)) & + 6.0D0 * (sigmaf(if+m-1,jf+ji-1,kf+l-1,5) & -sigmaf(if+m-1,jf+ji-1,kf+l ,5) & +sigmaf(if+m ,jf+ji-1,kf+l-1,5) & -sigmaf(if+m ,jf+ji-1,kf+l ,5)) * jdir tmp = tmp - cen * fdst(if+m,jf,kf+l) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if end do end do c weighting do if = ir*regl0, ir*regh0, ir res(if,jf,kf) = src(if,jf,kf) - res(if,jf,kf) * fac00 end do else if (ivect(1) .eq. 0) then do jf = jr*regl1, jr*regh1, jr res(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac0 = 1.0D0 / jr do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) .eq. 1) then do n = -(jr-1), jr-1 fac = (jr-abs(n)) * fac0 do jf = jr*regl1, jr*regh1, jr tmp = sigmaf(if+ii-1,jf+n-1,kf+ki-1,1) * & MXXF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,1) * & MXXF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,2) * & MYYF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,2) * & MYYF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,3) * & MZZF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,3) * & MZZF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) tmp = tmp + idir * kdir * ( & -sigmaf(if+ii-1,jf+n-1,kf+ki-1,4) * & MXZF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & -sigmaf(if+ii-1,jf+n ,kf+ki-1,4) * & MXZF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) ) tmp = tmp + kdir * ( & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,5) * & MYZF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & -sigmaf(if+ii-1,jf+n ,kf+ki-1,5) * & MYZF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) ) cen = & 4.0D0 * ( sigmaf(if+ii-1,jf+n-1,kf+ki-1,1) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,1) & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,2) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,2) & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,3) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,3)) & + 6.0D0 * (-sigmaf(if+ii-1,jf+n-1,kf+ki-1,4) & -sigmaf(if+ii-1,jf+n ,kf+ki-1,4)) * idir * kdir & + 6.0D0 * ( sigmaf(if+ii-1,jf+n-1,kf+ki-1,5) & -sigmaf(if+ii-1,jf+n ,kf+ki-1,5)) * kdir tmp = tmp - cen * fdst(if,jf+n,kf) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do else do jc = regl1, regh1 jf = jc * jr tmp = sigmac(ic+ii-1,jc-1,kc+ki-1,1) * & MXXC(ic+idir,jc-1,kc+kdir) & +sigmac(ic+ii-1,jc ,kc+ki-1,1) * & MXXC(ic+idir,jc+1,kc+kdir) tmp = tmp & +sigmac(ic+ii-1,jc-1,kc+ki-1,2) * & MYYC(ic+idir,jc-1,kc+kdir) & +sigmac(ic+ii-1,jc ,kc+ki-1,2) * & MYYC(ic+idir,jc+1,kc+kdir) tmp = tmp & +sigmac(ic+ii-1,jc-1,kc+ki-1,3) * & MZZC(ic+idir,jc-1,kc+kdir) & +sigmac(ic+ii-1,jc ,kc+ki-1,3) * & MZZC(ic+idir,jc+1,kc+kdir) tmp = tmp + idir * kdir * ( & -sigmac(ic+ii-1,jc-1,kc+ki-1,4) * & MXZC(ic+idir,jc-1,kc+kdir) & -sigmac(ic+ii-1,jc ,kc+ki-1,4) * & MXZC(ic+idir,jc+1,kc+kdir) ) tmp = tmp + kdir * ( & +sigmac(ic+ii-1,jc-1,kc+ki-1,5) * & MYZC(ic+idir,jc-1,kc+kdir) & -sigmac(ic+ii-1,jc ,kc+ki-1,5) * & MYZC(ic+idir,jc+1,kc+kdir) ) cen = & 4.0D0 * ( & +sigmac(ic+ii-1,jc-1,kc+ki-1,1) & +sigmac(ic+ii-1,jc ,kc+ki-1,1) & +sigmac(ic+ii-1,jc-1,kc+ki-1,2) & +sigmac(ic+ii-1,jc ,kc+ki-1,2) & +sigmac(ic+ii-1,jc-1,kc+ki-1,3) & +sigmac(ic+ii-1,jc ,kc+ki-1,3)) & + 6.0D0 * (-sigmac(ic+ii-1,jc-1,kc+ki-1,4) & -sigmac(ic+ii-1,jc ,kc+ki-1,4)) * idir * kdir & + 6.0D0 * ( sigmac(ic+ii-1,jc-1,kc+ki-1,5) & -sigmac(ic+ii-1,jc ,kc+ki-1,5)) * kdir tmp = tmp - cen * cdst(ic,jc,kc) res(if,jf,kf) = res(if,jf,kf) + tmp end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) - ga(ii,0,1-ki) .eq. 1) then fac0 = 1.0D0 / (ir * jr) do n = -(jr-1), jr-1 fac1 = (jr-abs(n)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do jf = jr*regl1, jr*regh1, jr tmp = sigmaf(if+m-1,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) tmp = tmp + kdir * ( & sigmaf(if+m-1,jf+n-1,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & -sigmaf(if+m ,jf+n-1,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & -sigmaf(if+m ,jf+n ,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) ) tmp = tmp + kdir * ( & sigmaf(if+m-1,jf+n-1,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & -sigmaf(if+m-1,jf+n ,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & -sigmaf(if+m ,jf+n ,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) ) cen = & 4.0D0 * (sigmaf(if+m-1,jf+n-1,kf+ki-1,1) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) & +sigmaf(if+m ,jf+n ,kf+ki-1,3)) & + 6.0D0 * (sigmaf(if+m-1,jf+n-1,kf+ki-1,4) & +sigmaf(if+m-1,jf+n ,kf+ki-1,4) & -sigmaf(if+m ,jf+n-1,kf+ki-1,4) & -sigmaf(if+m ,jf+n ,kf+ki-1,4)) * kdir & + 6.0D0 * (sigmaf(if+m-1,jf+n-1,kf+ki-1,5) & -sigmaf(if+m-1,jf+n ,kf+ki-1,5) & +sigmaf(if+m ,jf+n-1,kf+ki-1,5) & -sigmaf(if+m ,jf+n ,kf+ki-1,5)) * kdir tmp = tmp - cen * fdst(if+m,jf+n,kf) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if if (ga(ii,0,ki) - ga(1-ii,0,ki) .eq. 1) then fac0 = 1.0D0 / (jr * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do n = -(jr-1), jr-1 fac = (jr-abs(n)) * fac1 do jf = jr*regl1, jr*regh1, jr tmp = sigmaf(if+ii-1,jf+n-1,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) tmp = tmp + idir * ( & +sigmaf(if+ii-1,jf+n-1,kf+l-1,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & -sigmaf(if+ii-1,jf+n-1,kf+l ,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & -sigmaf(if+ii-1,jf+n ,kf+l ,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) tmp = tmp + ( & -sigmaf(if+ii-1,jf+n-1,kf+l-1,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & -sigmaf(if+ii-1,jf+n ,kf+l ,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) cen = & 4.0D0 * (sigmaf(if+ii-1,jf+n-1,kf+l-1,1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) & +sigmaf(if+ii-1,jf+n ,kf+l ,1) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) & +sigmaf(if+ii-1,jf+n-1,kf+l ,2) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) & +sigmaf(if+ii-1,jf+n ,kf+l ,2) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) & +sigmaf(if+ii-1,jf+n-1,kf+l ,3) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) & +sigmaf(if+ii-1,jf+n ,kf+l ,3)) & + 6.0D0 * (sigmaf(if+ii-1,jf+n-1,kf+l-1,4) & -sigmaf(if+ii-1,jf+n-1,kf+l ,4) & +sigmaf(if+ii-1,jf+n ,kf+l-1,4) & -sigmaf(if+ii-1,jf+n ,kf+l ,4)) * idir & + 6.0D0 * (sigmaf(if+ii-1,jf+n-1,kf+l ,5) & -sigmaf(if+ii-1,jf+n-1,kf+l-1,5) & +sigmaf(if+ii-1,jf+n ,kf+l-1,5) & -sigmaf(if+ii-1,jf+n ,kf+l ,5)) tmp = tmp - cen * fdst(if,jf+n,kf+l) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if end do end do c weighting do jf = jr*regl1, jr*regh1, jr res(if,jf,kf) = src(if,jf,kf) - res(if,jf,kf) * fac00 end do else do kf = kr*regl2, kr*regh2, kr res(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac0 = 1.0D0 / kr do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) .eq. 1) then do l = -(kr-1), kr-1 fac = (kr-abs(l)) * fac0 do kf = kr*regl2, kr*regh2, kr tmp = sigmaf(if+ii-1,jf+ji-1,kf+l-1,1) * & MXXF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,1) * & MXXF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,2) * & MYYF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,2) * & MYYF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,3) * & MZZF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,3) * & MZZF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) tmp = tmp + idir * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,4) * & MXZF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & -sigmaf(if+ii-1,jf+ji-1,kf+l ,4) * & MXZF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) ) tmp = tmp + jdir * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,5) * & MYZF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & -sigmaf(if+ii-1,jf+ji-1,kf+l ,5) * & MYZF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) ) cen = & 4.0D0 * (sigmaf(if+ii-1,jf+ji-1,kf+l-1,1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,1) & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,2) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,2) & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,3) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,3)) & + 6.0D0 * (sigmaf(if+ii-1,jf+ji-1,kf+l-1,4) & -sigmaf(if+ii-1,jf+ji-1,kf+l ,4)) * idir & + 6.0D0 * (sigmaf(if+ii-1,jf+ji-1,kf+l-1,5) & -sigmaf(if+ii-1,jf+ji-1,kf+l ,5)) * jdir tmp = tmp - cen * fdst(if,jf,kf+l) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do else do kc = regl2, regh2 kf = kc * kr tmp = sigmac(ic+ii-1,jc+ji-1,kc-1,1) * & MXXC(ic+idir,jc+jdir,kc-1) & +sigmac(ic+ii-1,jc+ji-1,kc ,1) * & MXXC(ic+idir,jc+jdir,kc+1) tmp = tmp & +sigmac(ic+ii-1,jc+ji-1,kc-1,2) * & MYYC(ic+idir,jc+jdir,kc-1) & +sigmac(ic+ii-1,jc+ji-1,kc ,2) * & MYYC(ic+idir,jc+jdir,kc+1) tmp = tmp & +sigmac(ic+ii-1,jc+ji-1,kc-1,3) * & MZZC(ic+idir,jc+jdir,kc-1) & +sigmac(ic+ii-1,jc+ji-1,kc ,3) * & MZZC(ic+idir,jc+jdir,kc+1) tmp = tmp + idir * ( & +sigmac(ic+ii-1,jc+ji-1,kc-1,4) * & MXZC(ic+idir,jc+jdir,kc-1) & -sigmac(ic+ii-1,jc+ji-1,kc ,4) * & MXZC(ic+idir,jc+jdir,kc+1) ) tmp = tmp + jdir * ( & +sigmac(ic+ii-1,jc+ji-1,kc-1,5) * & MYZC(ic+idir,jc+jdir,kc-1) & -sigmac(ic+ii-1,jc+ji-1,kc ,5) * & MYZC(ic+idir,jc+jdir,kc+1) ) cen = & 4.0D0 * (sigmac(ic+ii-1,jc+ji-1,kc-1,1) & +sigmac(ic+ii-1,jc+ji-1,kc ,1) & +sigmac(ic+ii-1,jc+ji-1,kc-1,2) & +sigmac(ic+ii-1,jc+ji-1,kc ,2) & +sigmac(ic+ii-1,jc+ji-1,kc-1,3) & +sigmac(ic+ii-1,jc+ji-1,kc ,3) ) & + 6.0D0 * (sigmac(ic+ii-1,jc+ji-1,kc-1,4) & -sigmac(ic+ii-1,jc+ji-1,kc ,4) ) * idir & + 6.0D0 * (sigmac(ic+ii-1,jc+ji-1,kc-1,5) & -sigmac(ic+ii-1,jc+ji-1,kc ,5) ) * jdir tmp = tmp - cen * cdst(ic,jc,kc) res(if,jf,kf) = res(if,jf,kf) + tmp end do end if end do end do c faces c each face is two faces and two sides of an edge do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) - ga(ii,1-ji,0) .eq. 1) then fac0 = 1.0D0 / (ir * kr) do l = -(kr-1), kr-1 fac1 = (kr-abs(l)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do kf = kr*regl2, kr*regh2, kr tmp = sigmaf(if+m-1,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) tmp = tmp + ( & -sigmaf(if+m-1,jf+ji-1,kf+l-1,4) * & MXZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,4) * & MXZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,4) * & MXZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & -sigmaf(if+m ,jf+ji-1,kf+l ,4) * & MXZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) tmp = tmp + jdir * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,5) * & MYZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & -sigmaf(if+m-1,jf+ji-1,kf+l ,5) * & MYZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,5) * & MYZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & -sigmaf(if+m ,jf+ji-1,kf+l ,5) * & MYZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) cen = & 4.0D0 * (sigmaf(if+m-1,jf+ji-1,kf+l-1,1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,1) & +sigmaf(if+m ,jf+ji-1,kf+l ,1) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) & +sigmaf(if+m-1,jf+ji-1,kf+l ,2) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) & +sigmaf(if+m ,jf+ji-1,kf+l ,2) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) & +sigmaf(if+m-1,jf+ji-1,kf+l ,3) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) & +sigmaf(if+m ,jf+ji-1,kf+l ,3)) & + 6.0D0 * (sigmaf(if+m-1,jf+ji-1,kf+l ,4) & -sigmaf(if+m-1,jf+ji-1,kf+l-1,4) & +sigmaf(if+m ,jf+ji-1,kf+l-1,4) & -sigmaf(if+m ,jf+ji-1,kf+l ,4)) & + 6.0D0 * (sigmaf(if+m-1,jf+ji-1,kf+l-1,5) & -sigmaf(if+m-1,jf+ji-1,kf+l ,5) & +sigmaf(if+m ,jf+ji-1,kf+l-1,5) & -sigmaf(if+m ,jf+ji-1,kf+l ,5)) * jdir tmp = tmp - cen * fdst(if+m,jf,kf+l) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if if (ga(ii,ji,0) - ga(1-ii,ji,0) .eq. 1) then fac0 = 1.0D0 / (jr * kr) do l = -(kr-1), kr-1 fac1 = (kr-abs(l)) * fac0 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 do kf = kr*regl2, kr*regh2, kr tmp = sigmaf(if+ii-1,jf+n-1,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) tmp = tmp + idir * ( & +sigmaf(if+ii-1,jf+n-1,kf+l-1,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & -sigmaf(if+ii-1,jf+n-1,kf+l ,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & -sigmaf(if+ii-1,jf+n ,kf+l ,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) tmp = tmp + ( & -sigmaf(if+ii-1,jf+n-1,kf+l-1,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & -sigmaf(if+ii-1,jf+n ,kf+l ,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) cen = & 4.0D0 * (sigmaf(if+ii-1,jf+n-1,kf+l-1,1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) & +sigmaf(if+ii-1,jf+n ,kf+l ,1) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) & +sigmaf(if+ii-1,jf+n-1,kf+l ,2) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) & +sigmaf(if+ii-1,jf+n ,kf+l ,2) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) & +sigmaf(if+ii-1,jf+n-1,kf+l ,3) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) & +sigmaf(if+ii-1,jf+n ,kf+l ,3)) & + 6.0D0 * (sigmaf(if+ii-1,jf+n-1,kf+l-1,4) & -sigmaf(if+ii-1,jf+n-1,kf+l ,4) & +sigmaf(if+ii-1,jf+n ,kf+l-1,4) & -sigmaf(if+ii-1,jf+n ,kf+l ,4)) * idir & + 6.0D0 * (sigmaf(if+ii-1,jf+n-1,kf+l ,5) & -sigmaf(if+ii-1,jf+n-1,kf+l-1,5) & +sigmaf(if+ii-1,jf+n ,kf+l-1,5) & -sigmaf(if+ii-1,jf+n ,kf+l ,5)) tmp = tmp - cen * fdst(if,jf+n,kf+l) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if end do end do c weighting do kf = kr*regl2, kr*regh2, kr res(if,jf,kf) = src(if,jf,kf) - res(if,jf,kf) * fac00 end do end if end c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along face subroutine hgcres_terrain( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & fdst, fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2, & cdst, cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2, & sigmaf, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & sigmac, scl0,sch0,scl1,sch1,scl2,sch2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz, ir, jr, kr, ga, idd) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2 integer cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer scl0,sch0,scl1,sch1,scl2,sch2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision hx, hy, hz double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1,fdstl2:fdsth2) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1,cdstl2:cdsth2) double precision sigmaf(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2,5) double precision sigmac(scl0:sch0,scl1:sch1,scl2:sch2,5) integer ir, jr, kr, ga(0:1,0:1,0:1), idd double precision cen, sum, fac00, fac1, fac2, fac integer ic, jc, kc, if, jf, kf, ji, ki, idir, jdir, kdir integer l, m, n integer ii, jj, kk, i1, j1, k1 double precision MXXC, MYYC, MZZC, MXZC, MYZC double precision MXXF, MYYF, MZZF, MXZF, MYZF MXXC(ii,jj,kk) = (4.0D0 * cdst(ii,jc,kc) + & 2.0D0 * (cdst(ii,jj,kc) - cdst(ic,jj,kc) + & cdst(ii,jc,kk) - cdst(ic,jc,kk)) + & (cdst(ii,jj,kk) - cdst(ic,jj,kk))) MYYC(ii,jj,kk) = (4.0D0 * cdst(ic,jj,kc) + & 2.0D0 * (cdst(ii,jj,kc) - cdst(ii,jc,kc) + & cdst(ic,jj,kk) - cdst(ic,jc,kk)) + & (cdst(ii,jj,kk) - cdst(ii,jc,kk))) MZZC(ii,jj,kk) = (4.0D0 * cdst(ic,jc,kk) + & 2.0D0 * (cdst(ii,jc,kk) - cdst(ii,jc,kc) + & cdst(ic,jj,kk) - cdst(ic,jj,kc)) + & (cdst(ii,jj,kk) - cdst(ii,jj,kc))) MXZC(ii,jj,kk) = (6.0D0 * cdst(ii,jc,kk) + & 3.0D0 * (cdst(ii,jj,kk) - cdst(ic,jj,kc))) MYZC(ii,jj,kk) = (6.0D0 * cdst(ic,jj,kk) + & 3.0D0 * (cdst(ii,jj,kk) - cdst(ii,jc,kc))) MXXF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(ii,j1,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(i1,jj,k1) + & fdst(ii,j1,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(i1,jj,kk))) MYYF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,jj,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(ii,j1,kk))) MZZF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,j1,kk) + & 2.0D0 * (fdst(ii,j1,kk) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,jj,k1)) + & (fdst(ii,jj,kk) - fdst(ii,jj,k1))) MXZF(i1,j1,k1,ii,jj,kk) = (6.0D0 * fdst(ii,j1,kk) + & 3.0D0 * (fdst(ii,jj,kk) - fdst(i1,jj,k1))) MYZF(i1,j1,k1,ii,jj,kk) = (6.0D0 * fdst(i1,jj,kk) + & 3.0D0 * (fdst(ii,jj,kk) - fdst(ii,j1,k1))) ic = regl0 jc = regl1 kc = regl2 if = ic * ir jf = jc * jr kf = kc * kr sum = 0.0D0 fac00 = 1.0D0 / 36 c octants do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) .eq. 1) then sum = sum & +sigmaf(if+ii-1,jf+ji-1,kf+ki-1,1) * & MXXF(if,jf,kf,if+idir,jf+jdir,kf+kdir) & +sigmaf(if+ii-1,jf+ji-1,kf+ki-1,2) * & MYYF(if,jf,kf,if+idir,jf+jdir,kf+kdir) & +sigmaf(if+ii-1,jf+ji-1,kf+ki-1,3) * & MZZF(if,jf,kf,if+idir,jf+jdir,kf+kdir) & -sigmaf(if+ii-1,jf+ji-1,kf+ki-1,4) * & MXZF(if,jf,kf,if+idir,jf+jdir,kf+kdir) * idir * kdir & -sigmaf(if+ii-1,jf+ji-1,kf+ki-1,5) * & MYZF(if,jf,kf,if+idir,jf+jdir,kf+kdir) * jdir * kdir cen = & 4.0D0 * ( sigmaf(if+ii-1,jf+ji-1,kf+ki-1,1) & +sigmaf(if+ii-1,jf+ji-1,kf+ki-1,2) & +sigmaf(if+ii-1,jf+ji-1,kf+ki-1,3)) & + 6.0D0 * (-sigmaf(if+ii-1,jf+ji-1,kf+ki-1,4)) * idir * kdir & + 6.0D0 * (-sigmaf(if+ii-1,jf+ji-1,kf+ki-1,5)) * jdir * kdir sum = sum - cen * fdst(if,jf,kf) else sum = sum & +sigmac(ic+ii-1,jc+ji-1,kc+ki-1,1) * & MXXC(ic+idir,jc+jdir,kc+kdir) & +sigmac(ic+ii-1,jc+ji-1,kc+ki-1,2) * & MYYC(ic+idir,jc+jdir,kc+kdir) & +sigmac(ic+ii-1,jc+ji-1,kc+ki-1,3) * & MZZC(ic+idir,jc+jdir,kc+kdir) & -sigmac(ic+ii-1,jc+ji-1,kc+ki-1,4) * & MXZC(ic+idir,jc+jdir,kc+kdir) * idir * kdir & -sigmac(ic+ii-1,jc+ji-1,kc+ki-1,5) * & MYZC(ic+idir,jc+jdir,kc+kdir) * jdir * kdir cen = & 4.0D0 * ( sigmac(ic+ii-1,jc+ji-1,kc+ki-1,1) & +sigmac(ic+ii-1,jc+ji-1,kc+ki-1,2) & +sigmac(ic+ii-1,jc+ji-1,kc+ki-1,3)) & + 6.0D0 * (-sigmac(ic+ii-1,jc+ji-1,kc+ki-1,4)) * idir * kdir & + 6.0D0 * (-sigmac(ic+ii-1,jc+ji-1,kc+ki-1,5)) * jdir * kdir sum = sum - cen * cdst(ic,jc,kc) end if end do end do end do c faces do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) - ga(ii,ji,1-ki) .eq. 1) then fac2 = 1.0D0 / (ir * jr) do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac2 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( & +sigmaf(if+m-1,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir)) sum = sum + fac * ( & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir)) sum = sum + fac * ( & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir)) sum = sum + fac * kdir * ( & +sigmaf(if+m-1,jf+n-1,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & -sigmaf(if+m ,jf+n-1,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & -sigmaf(if+m ,jf+n ,kf+ki-1,4) * & MXZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir)) sum = sum + fac * kdir * ( & +sigmaf(if+m-1,jf+n-1,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & -sigmaf(if+m-1,jf+n ,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & -sigmaf(if+m ,jf+n ,kf+ki-1,5) * & MYZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir)) cen = & 4.0D0 * ( sigmaf(if+m-1,jf+n-1,kf+ki-1,1) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) & +sigmaf(if+m ,jf+n ,kf+ki-1,3)) & + 6.0D0 * ( sigmaf(if+m-1,jf+n-1,kf+ki-1,4) & +sigmaf(if+m-1,jf+n ,kf+ki-1,4) & -sigmaf(if+m ,jf+n-1,kf+ki-1,4) & -sigmaf(if+m ,jf+n ,kf+ki-1,4)) * kdir & + 6.0D0 * ( sigmaf(if+m-1,jf+n-1,kf+ki-1,5) & -sigmaf(if+m-1,jf+n ,kf+ki-1,5) & +sigmaf(if+m ,jf+n-1,kf+ki-1,5) & -sigmaf(if+m ,jf+n ,kf+ki-1,5)) * kdir sum = sum - fac * cen * fdst(if+m,jf+n,kf) end do end do end if if (ga(ii,ji,ki) - ga(ii,1-ji,ki) .eq. 1) then fac2 = 1.0D0 / (ir * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac2 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) sum = sum + fac * ( & -sigmaf(if+m-1,jf+ji-1,kf+l-1,4) * & MXZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,4) * & MXZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,4) * & MXZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & -sigmaf(if+m ,jf+ji-1,kf+l ,4) * & MXZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) sum = sum + fac * jdir * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,5) * & MYZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & -sigmaf(if+m-1,jf+ji-1,kf+l ,5) * & MYZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,5) * & MYZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & -sigmaf(if+m ,jf+ji-1,kf+l ,5) * & MYZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) cen = & 4.0D0 * ( & + sigmaf(if+m-1,jf+ji-1,kf+l-1,1) & + sigmaf(if+m-1,jf+ji-1,kf+l,1) & + sigmaf(if+m ,jf+ji-1,kf+l-1,1) & + sigmaf(if+m ,jf+ji-1,kf+l,1) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) & + sigmaf(if+m-1,jf+ji-1,kf+l,2) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) & + sigmaf(if+m ,jf+ji-1,kf+l,2) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) & + sigmaf(if+m-1,jf+ji-1,kf+l,3) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) & + sigmaf(if+m ,jf+ji-1,kf+l,3)) & +6.0D0 * ( & sigmaf(if+m-1,jf+ji-1,kf+l ,4) & - sigmaf(if+m-1,jf+ji-1,kf+l-1,4) & +sigmaf(if+m ,jf+ji-1,kf+l-1,4) & - sigmaf(if+m ,jf+ji-1,kf+l,4)) & +6.0D0 * jdir * ( & sigmaf(if+m-1,jf+ji-1,kf+l-1,5) & - sigmaf(if+m-1,jf+ji-1,kf+l,5) & +sigmaf(if+m ,jf+ji-1,kf+l-1,5) & - sigmaf(if+m ,jf+ji-1,kf+l,5)) sum = sum - fac * cen * fdst(if+m,jf,kf+l) end do end do end if if (ga(ii,ji,ki) - ga(1-ii,ji,ki) .eq. 1) then fac2 = 1.0D0 / (jr * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac2 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) sum = sum + fac * idir * ( & +sigmaf(if+ii-1,jf+n-1,kf+l-1,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & -sigmaf(if+ii-1,jf+n-1,kf+l ,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & -sigmaf(if+ii-1,jf+n ,kf+l ,4) * & MXZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) sum = sum + fac * ( & -sigmaf(if+ii-1,jf+n-1,kf+l-1,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & -sigmaf(if+ii-1,jf+n ,kf+l ,5) * & MYZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) cen = & 4.0D0 * ( & sigmaf(if+ii-1,jf+n-1,kf+l-1,1) & + sigmaf(if+ii-1,jf+n-1,kf+l ,1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) & + sigmaf(if+ii-1,jf+n ,kf+l ,1) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) & + sigmaf(if+ii-1,jf+n-1,kf+l ,2) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) & + sigmaf(if+ii-1,jf+n ,kf+l ,2) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) & + sigmaf(if+ii-1,jf+n-1,kf+l ,3) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) & + sigmaf(if+ii-1,jf+n ,kf+l ,3)) & + 6.0D0 * idir * ( & sigmaf(if+ii-1,jf+n-1,kf+l-1,4) & - sigmaf(if+ii-1,jf+n-1,kf+l ,4) & +sigmaf(if+ii-1,jf+n ,kf+l-1,4) & - sigmaf(if+ii-1,jf+n ,kf+l ,4)) & + 6.0D0 * ( & sigmaf(if+ii-1,jf+n-1,kf+l ,5) & - sigmaf(if+ii-1,jf+n-1,kf+l-1,5) & +sigmaf(if+ii-1,jf+n ,kf+l-1,5) & - sigmaf(if+ii-1,jf+n ,kf+l ,5)) sum = sum - fac * cen * fdst(if,jf+n,kf+l) end do end do end if end do end do end do c edges do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(ii,1-ji,ki), ga(ii,1-ji,1-ki)) & .eq. 1) then fac1 = 1.0D0 / ir do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,1) * & MXXF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,1) * & MXXF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) ) sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,2) * & MYYF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,2) * & MYYF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) ) sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,3) * & MZZF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,3) * & MZZF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) ) sum = sum + fac * kdir * ( & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,4) * & MXZF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & -sigmaf(if+m ,jf+ji-1,kf+ki-1,4) * & MXZF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) ) sum = sum + fac * jdir * kdir * ( & -sigmaf(if+m-1,jf+ji-1,kf+ki-1,5) * & MYZF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & -sigmaf(if+m ,jf+ji-1,kf+ki-1,5) * & MYZF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) ) cen = & 4.0D0 * ( sigmaf(if+m-1,jf+ji-1,kf+ki-1,1) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,1) & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,2) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,2) & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,3) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,3)) & + 6.0D0 * ( sigmaf(if+m-1,jf+ji-1,kf+ki-1,4) & -sigmaf(if+m ,jf+ji-1,kf+ki-1,4)) * kdir & + 6.0D0 * (-sigmaf(if+m-1,jf+ji-1,kf+ki-1,5) & -sigmaf(if+m ,jf+ji-1,kf+ki-1,5)) * jdir * kdir sum = sum - fac * cen * fdst(if+m,jf,kf) end do end if if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(1-ii,ji,ki), ga(1-ii,ji,1-ki)) & .eq. 1) then fac1 = 1.0D0 / jr do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,1) * & MXXF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,1) * & MXXF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,2) * & MYYF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,2) * & MYYF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,3) * & MZZF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,3) * & MZZF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) ) sum = sum + fac * idir * kdir * ( & -sigmaf(if+ii-1,jf+n-1,kf+ki-1,4) * & MXZF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & -sigmaf(if+ii-1,jf+n ,kf+ki-1,4) * & MXZF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) ) sum = sum + fac * kdir * ( & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,5) * & MYZF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & -sigmaf(if+ii-1,jf+n ,kf+ki-1,5) * & MYZF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) ) cen = & 4.0D0 * ( sigmaf(if+ii-1,jf+n-1,kf+ki-1,1) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,1) & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,2) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,2) & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,3) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,3)) & + 6.0D0 * (-sigmaf(if+ii-1,jf+n-1,kf+ki-1,4) & -sigmaf(if+ii-1,jf+n ,kf+ki-1,4)) * idir * kdir & + 6.0D0 * ( sigmaf(if+ii-1,jf+n-1,kf+ki-1,5) & -sigmaf(if+ii-1,jf+n ,kf+ki-1,5)) * kdir sum = sum - fac * cen * fdst(if,jf+n,kf) end do end if if (ga(ii,ji,ki) - & min(ga(ii,1-ji,ki), ga(1-ii,ji,ki), ga(1-ii,1-ji,ki)) & .eq. 1) then fac1 = 1.0D0 / kr do l = kdir, kdir*(kr-1), kdir fac = (kr-abs(l)) * fac1 sum = sum + fac * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,1) * & MXXF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,1) * & MXXF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,2) * & MYYF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,2) * & MYYF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,3) * & MZZF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,3) * & MZZF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) ) sum = sum + fac * idir * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,4) * & MXZF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & -sigmaf(if+ii-1,jf+ji-1,kf+l ,4) * & MXZF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) ) sum = sum + fac * jdir * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,5) * & MYZF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & -sigmaf(if+ii-1,jf+ji-1,kf+l ,5) * & MYZF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) ) cen = & 4.0D0 * (sigmaf(if+ii-1,jf+ji-1,kf+l-1,1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,1) & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,2) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,2) & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,3) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,3)) & + 6.0D0 * (sigmaf(if+ii-1,jf+ji-1,kf+l-1,4) & -sigmaf(if+ii-1,jf+ji-1,kf+l ,4)) * idir & + 6.0D0 * (sigmaf(if+ii-1,jf+ji-1,kf+l-1,5) & -sigmaf(if+ii-1,jf+ji-1,kf+l ,5)) * jdir sum = sum - fac * cen * fdst(if,jf,kf+l) end do end if end do end do end do c weighting res(if,jf,kf) = src(if,jf,kf) - sum * fac00 end c twenty-seven-point terrain stencils c----------------------------------------------------------------------- subroutine hgcen_terrain( & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & sig, sbl0,sbh0,sbl1,sbh1,sbl2,sbh2, & regl0,regh0,regl1,regh1,regl2,regh2) integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer sbl0,sbh0,sbl1,sbh1,sbl2,sbh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) double precision sig(sbl0:sbh0,sbl1:sbh1,sbl2:sbh2, 5) double precision tmp integer i, j, k do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 tmp = (4.0D0 * (sig(i-1,j-1,k-1,1) + sig(i-1,j-1,k,1) + & sig(i-1,j,k-1,1) + sig(i-1,j,k,1) + & sig(i,j-1,k-1,1) + sig(i,j-1,k,1) + & sig(i,j,k-1,1) + sig(i,j,k,1) + & sig(i-1,j-1,k-1,2) + sig(i-1,j-1,k,2) + & sig(i-1,j,k-1,2) + sig(i-1,j,k,2) + & sig(i,j-1,k-1,2) + sig(i,j-1,k,2) + & sig(i,j,k-1,2) + sig(i,j,k,2) + & sig(i-1,j-1,k-1,3) + sig(i-1,j-1,k,3) + & sig(i-1,j,k-1,3) + sig(i-1,j,k,3) + & sig(i,j-1,k-1,3) + sig(i,j-1,k,3) + & sig(i,j,k-1,3) + sig(i,j,k,3)) + & 6.0D0 * (sig(i-1,j-1,k,4) - sig(i-1,j-1,k-1,4) + & sig(i-1,j,k,4) - sig(i-1,j,k-1,4) + & sig(i,j-1,k-1,4) - sig(i,j-1,k,4) + & sig(i,j,k-1,4) - sig(i,j,k,4) + & sig(i-1,j-1,k,5) - sig(i-1,j-1,k-1,5) + & sig(i-1,j,k-1,5) - sig(i-1,j,k,5) + & sig(i,j-1,k,5) - sig(i,j-1,k-1,5) + & sig(i,j,k-1,5) - sig(i,j,k,5))) if ( tmp .eq. 0.0 ) then cen(i,j,k) = 0.0D0 else cen(i,j,k) = 36.0D0 / tmp end if end do end do end do end c----------------------------------------------------------------------- subroutine hgrlx_terrain( & cor, corl0,corh0,corl1,corh1,corl2,corh2, & res, resl0,resh0,resl1,resh1,resl2,resh2, & sig, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & regl0,regh0,regl1,regh1,regl2,regh2) integer corl0,corh0,corl1,corh1,corl2,corh2 integer resl0,resh0,resl1,resh1,resl2,resh2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision cor(corl0:corh0,corl1:corh1,corl2:corh2) double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision sig(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2, 5) double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) double precision fac, tmp integer i, j, k integer ii, jj, kk double precision MXX, MYY, MZZ, MXZ, MYZ MXX(ii,jj,kk) = (4.0D0 * cor(ii,j,k) + & 2.0D0 * (cor(ii,jj,k) - cor(i,jj,k) + & cor(ii,j,kk) - cor(i,j,kk)) + & (cor(ii,jj,kk) - cor(i,jj,kk))) MYY(ii,jj,kk) = (4.0D0 * cor(i,jj,k) + & 2.0D0 * (cor(ii,jj,k) - cor(ii,j,k) + & cor(i,jj,kk) - cor(i,j,kk)) + & (cor(ii,jj,kk) - cor(ii,j,kk))) MZZ(ii,jj,kk) = (4.0D0 * cor(i,j,kk) + & 2.0D0 * (cor(ii,j,kk) - cor(ii,j,k) + & cor(i,jj,kk) - cor(i,jj,k)) + & (cor(ii,jj,kk) - cor(ii,jj,k))) MXZ(ii,jj,kk) = (6.0D0 * cor(ii,j,kk) + & 3.0D0 * (cor(ii,jj,kk) - cor(i,jj,k))) MYZ(ii,jj,kk) = (6.0D0 * cor(i,jj,kk) + & 3.0D0 * (cor(ii,jj,kk) - cor(ii,j,k))) fac = 1.0D0 / 36 do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 cdir$ ivdep tmp = sig(i-1,j-1,k-1,1) * MXX(i-1,j-1,k-1) + & sig(i-1,j-1,k ,1) * MXX(i-1,j-1,k+1) + & sig(i-1,j ,k-1,1) * MXX(i-1,j+1,k-1) + & sig(i-1,j ,k ,1) * MXX(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,1) * MXX(i+1,j-1,k-1) + & sig(i ,j-1,k ,1) * MXX(i+1,j-1,k+1) + & sig(i ,j ,k-1,1) * MXX(i+1,j+1,k-1) + & sig(i ,j ,k ,1) * MXX(i+1,j+1,k+1) tmp = tmp + & sig(i-1,j-1,k-1,2) * MYY(i-1,j-1,k-1) + & sig(i-1,j-1,k ,2) * MYY(i-1,j-1,k+1) + & sig(i-1,j ,k-1,2) * MYY(i-1,j+1,k-1) + & sig(i-1,j ,k ,2) * MYY(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,2) * MYY(i+1,j-1,k-1) + & sig(i ,j-1,k ,2) * MYY(i+1,j-1,k+1) + & sig(i ,j ,k-1,2) * MYY(i+1,j+1,k-1) + & sig(i ,j ,k ,2) * MYY(i+1,j+1,k+1) tmp = tmp + & sig(i-1,j-1,k-1,3) * MZZ(i-1,j-1,k-1) + & sig(i-1,j-1,k ,3) * MZZ(i-1,j-1,k+1) + & sig(i-1,j ,k-1,3) * MZZ(i-1,j+1,k-1) + & sig(i-1,j ,k ,3) * MZZ(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,3) * MZZ(i+1,j-1,k-1) + & sig(i ,j-1,k ,3) * MZZ(i+1,j-1,k+1) + & sig(i ,j ,k-1,3) * MZZ(i+1,j+1,k-1) + & sig(i ,j ,k ,3) * MZZ(i+1,j+1,k+1) tmp = tmp - & sig(i-1,j-1,k-1,4) * MXZ(i-1,j-1,k-1) + & sig(i-1,j-1,k ,4) * MXZ(i-1,j-1,k+1) - & sig(i-1,j ,k-1,4) * MXZ(i-1,j+1,k-1) + & sig(i-1,j ,k ,4) * MXZ(i-1,j+1,k+1) + & sig(i ,j-1,k-1,4) * MXZ(i+1,j-1,k-1) - & sig(i ,j-1,k ,4) * MXZ(i+1,j-1,k+1) + & sig(i ,j ,k-1,4) * MXZ(i+1,j+1,k-1) - & sig(i ,j ,k ,4) * MXZ(i+1,j+1,k+1) tmp = tmp - & sig(i-1,j-1,k-1,5) * MYZ(i-1,j-1,k-1) + & sig(i-1,j-1,k ,5) * MYZ(i-1,j-1,k+1) + & sig(i-1,j ,k-1,5) * MYZ(i-1,j+1,k-1) - & sig(i-1,j ,k ,5) * MYZ(i-1,j+1,k+1) - & sig(i ,j-1,k-1,5) * MYZ(i+1,j-1,k-1) + & sig(i ,j-1,k ,5) * MYZ(i+1,j-1,k+1) + & sig(i ,j ,k-1,5) * MYZ(i+1,j+1,k-1) - & sig(i ,j ,k ,5) * MYZ(i+1,j+1,k+1) cor(i,j,k) = (fac * tmp - res(i,j,k)) * cen(i,j,k) end do end do end do end c cor substituted for dest to use same macro: c----------------------------------------------------------------------- subroutine hgres_terrain( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & cor, destl0,desth0,destl1,desth1,destl2,desth2, & sig, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & regl0,regh0,regl1,regh1,regl2,regh2) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer destl0,desth0,destl1,desth1,destl2,desth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision cor(destl0:desth0,destl1:desth1,destl2:desth2) double precision sig(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2, 5) double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) double precision fac, tmp integer i, j, k integer ii, jj, kk double precision MXX, MYY, MZZ, MXZ, MYZ MXX(ii,jj,kk) = (4.0D0 * cor(ii,j,k) + & 2.0D0 * (cor(ii,jj,k) - cor(i,jj,k) + & cor(ii,j,kk) - cor(i,j,kk)) + & (cor(ii,jj,kk) - cor(i,jj,kk))) MYY(ii,jj,kk) = (4.0D0 * cor(i,jj,k) + & 2.0D0 * (cor(ii,jj,k) - cor(ii,j,k) + & cor(i,jj,kk) - cor(i,j,kk)) + & (cor(ii,jj,kk) - cor(ii,j,kk))) MZZ(ii,jj,kk) = (4.0D0 * cor(i,j,kk) + & 2.0D0 * (cor(ii,j,kk) - cor(ii,j,k) + & cor(i,jj,kk) - cor(i,jj,k)) + & (cor(ii,jj,kk) - cor(ii,jj,k))) MXZ(ii,jj,kk) = (6.0D0 * cor(ii,j,kk) + & 3.0D0 * (cor(ii,jj,kk) - cor(i,jj,k))) MYZ(ii,jj,kk) = (6.0D0 * cor(i,jj,kk) + & 3.0D0 * (cor(ii,jj,kk) - cor(ii,j,k))) fac = 1.0D0 / 36 do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 tmp = sig(i-1,j-1,k-1,1) * MXX(i-1,j-1,k-1) + & sig(i-1,j-1,k ,1) * MXX(i-1,j-1,k+1) + & sig(i-1,j ,k-1,1) * MXX(i-1,j+1,k-1) + & sig(i-1,j ,k ,1) * MXX(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,1) * MXX(i+1,j-1,k-1) + & sig(i ,j-1,k ,1) * MXX(i+1,j-1,k+1) + & sig(i ,j ,k-1,1) * MXX(i+1,j+1,k-1) + & sig(i ,j ,k ,1) * MXX(i+1,j+1,k+1) tmp = tmp + & sig(i-1,j-1,k-1,2) * MYY(i-1,j-1,k-1) + & sig(i-1,j-1,k ,2) * MYY(i-1,j-1,k+1) + & sig(i-1,j ,k-1,2) * MYY(i-1,j+1,k-1) + & sig(i-1,j ,k ,2) * MYY(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,2) * MYY(i+1,j-1,k-1) + & sig(i ,j-1,k ,2) * MYY(i+1,j-1,k+1) + & sig(i ,j ,k-1,2) * MYY(i+1,j+1,k-1) + & sig(i ,j ,k ,2) * MYY(i+1,j+1,k+1) tmp = tmp + & sig(i-1,j-1,k-1,3) * MZZ(i-1,j-1,k-1) + & sig(i-1,j-1,k ,3) * MZZ(i-1,j-1,k+1) + & sig(i-1,j ,k-1,3) * MZZ(i-1,j+1,k-1) + & sig(i-1,j ,k ,3) * MZZ(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,3) * MZZ(i+1,j-1,k-1) + & sig(i ,j-1,k ,3) * MZZ(i+1,j-1,k+1) + & sig(i ,j ,k-1,3) * MZZ(i+1,j+1,k-1) + & sig(i ,j ,k ,3) * MZZ(i+1,j+1,k+1) tmp = tmp - & sig(i-1,j-1,k-1,4) * MXZ(i-1,j-1,k-1) + & sig(i-1,j-1,k ,4) * MXZ(i-1,j-1,k+1) - & sig(i-1,j ,k-1,4) * MXZ(i-1,j+1,k-1) + & sig(i-1,j ,k ,4) * MXZ(i-1,j+1,k+1) + & sig(i ,j-1,k-1,4) * MXZ(i+1,j-1,k-1) - & sig(i ,j-1,k ,4) * MXZ(i+1,j-1,k+1) + & sig(i ,j ,k-1,4) * MXZ(i+1,j+1,k-1) - & sig(i ,j ,k ,4) * MXZ(i+1,j+1,k+1) tmp = tmp - & sig(i-1,j-1,k-1,5) * MYZ(i-1,j-1,k-1) + & sig(i-1,j-1,k ,5) * MYZ(i-1,j-1,k+1) + & sig(i-1,j ,k-1,5) * MYZ(i-1,j+1,k-1) - & sig(i-1,j ,k ,5) * MYZ(i-1,j+1,k+1) - & sig(i ,j-1,k-1,5) * MYZ(i+1,j-1,k-1) + & sig(i ,j-1,k ,5) * MYZ(i+1,j-1,k+1) + & sig(i ,j ,k-1,5) * MYZ(i+1,j+1,k-1) - & sig(i ,j ,k ,5) * MYZ(i+1,j+1,k+1) c c NOTE: The logic below to allow for cen=0, matches a set of logic in c hgcen where cen is calculated as cen=C/(sum of sigmas). If the c sum of the sigmas is zero, then cen is set to zero. So, the c logic here allows for the case of zero sigmas by eliminating the c if (cen(i,j,k) .ne. 0.0D0) then res(i,j,k) = src(i,j,k) & - fac * tmp + cor(i,j,k) / cen(i,j,k) else res(i,j,k) = src(i,j,k) - fac * tmp end if end do end do end do end c----------------------------------------------------------------------- subroutine hgrlnf_terrain( & cor, corl0,corh0,corl1,corh1,corl2,corh2, & res, resl0,resh0,resl1,resh1,resl2,resh2, & wrk, wrkl0,wrkh0,wrkl1,wrkh1,wrkl2,wrkh2, & signd, snl0,snh0,snl1,snh1,snl2,snh2, & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & regl0,regh0,regl1,regh1,regl2,regh2, & doml0,domh0,doml1,domh1,doml2,domh2, & lsd, ipass) integer corl0,corh0,corl1,corh1,corl2,corh2 integer resl0,resh0,resl1,resh1,resl2,resh2 integer wrkl0,wrkh0,wrkl1,wrkh1,wrkl2,wrkh2 integer snl0,snh0,snl1,snh1,snl2,snh2 integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer doml0,domh0,doml1,domh1,doml2,domh2 double precision cor(corl0:corh0,corl1:corh1,corl2:corh2) double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision wrk(wrkl0:wrkh0,wrkl1:wrkh1,wrkl2:wrkh2) double precision signd(snl0:snh0,snl1:snh1,snl2:snh2, 3) double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) integer lsd, ipass stop 'hgrlnf_terrain: no code' end ccseapps-2.5/CCSEApps/hgproj/hgparallel.cpp0000644000175000017500000005467711634153073022012 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #ifdef HG_DEBUG #include #include #include #include #include #include #endif bool HG_is_debugging = false; MPI_Comm HG::mpi_comm = MPI_COMM_WORLD; int HG::max_live_tasks = 100; int HG::multigrid_maxiter = 100; int HG::cgsolve_maxiter = 250; int HG::pverbose = 0; bool HG::initialized = false; double HG::cgsolve_tolfact = 1.0e-3; #ifdef HG_DEBUG std::ofstream debug_out; #endif void HG::MPI_init () { if (!initialized) { ParmParse pp("HG"); pp.query("cgsolve_maxiter", cgsolve_maxiter); pp.query("debugging", HG_is_debugging); pp.query("multigrid_maxiter", multigrid_maxiter); pp.query("cgsolve_tolfact", cgsolve_tolfact); pp.query("max_live_tasks", max_live_tasks); pp.query("pverbose", pverbose); if (ParallelDescriptor::IOProcessor()) { std::cout << "HG.cgsolve_maxiter = " << cgsolve_maxiter << '\n'; std::cout << "HG.multigrid_maxiter = " << multigrid_maxiter << '\n'; std::cout << "HG.cgsolve_tolfact = " << cgsolve_tolfact << '\n'; std::cout << "HG.max_live_tasks = " << max_live_tasks << '\n'; std::cout << "HG.pverbose = " << pverbose << '\n'; } initialized = true; ParallelDescriptor::Comm_dup(MPI_COMM_WORLD, mpi_comm); #ifdef HG_DEBUG std::ostringstream fname; fname << "gu" << ParallelDescriptor::NProcs() << "_" << ParallelDescriptor::MyProc() << std::ends; debug_out.open(fname.str().c_str(), std::ios::trunc); if ( debug_out.fail() ) BoxLib::Error( "Failed to open debug file" ); debug_out << std::setprecision(15); #endif } } void HG::MPI_finish () { #ifdef HG_DEBUG debug_out.close(); #endif } // task task::task (task_list& tl_) : m_task_list(tl_), m_sno(1), m_cnt(1), m_finished(false), m_started(false) { BL_ASSERT(m_sno > 0); } task::~task () { BL_ASSERT(m_sno > 0); } bool task::startup (long&, long&) { return m_started = true; } bool task::need_to_communicate (int& /*with*/) const { return false; } void task::print_dependencies (std::ostream& os) const { os << "Task " << get_sequence_number() << " depends on ( "; for (std::list::const_iterator lit = dependencies.begin(); lit != dependencies.end(); ++lit) { if (!(*lit).is_finished()) { os << (*lit)->get_sequence_number() << " "; } } os << ") "; } bool task::depend_ready () { std::list::iterator lit = dependencies.begin(); while (lit != dependencies.end()) { if ((*lit).is_finished()) { dependencies.erase(lit++); } else { ++lit; } } return dependencies.empty(); } void task::_hint () const { #ifdef HG_DEBUG BL_ASSERT(m_sno > 0); HG_DEBUG_OUT("(" << typeid(*this).name() << ' ' << m_sno << ' ' << m_started << ' '); print_dependencies(debug_out); #endif } void task::hint () const { task::_hint(); HG_DEBUG_OUT(")" << std::endl); } bool task::depends_on_q (const task* t1) const { return false; } void task::depend_on (const task_proxy& t1) { if (!t1.null()) dependencies.push_back(t1); } bool task::ready () { BL_ASSERT(is_started()); return true; } void task::_do_depend () { if (ParallelDescriptor::NProcs() == 1) // // In this case just doing tasks in order will be OK. // return; for (std::list::const_iterator cit = m_task_list.begin(); cit != m_task_list.end(); ++cit) { BL_ASSERT(!(*cit).null()); if (depends_on_q(**cit)) dependencies.push_back(*cit); } } // task_list task_list::task_list () : seq_no(ParallelDescriptor::NProcs(), 1), verbose(HG::pverbose != 0) {} task_list::~task_list () {} task::task_proxy task_list::add_task (task* t) { BL_ASSERT(t != 0); if (t->is_finished()) { delete t; return task::task_proxy(0); } else { tasks.push_back(task::task_proxy(t)); return tasks.back(); } } void task_list::print_dependencies (std::ostream& os) const { os << "Task list ( " << '\n'; for (std::list::const_iterator tli = tasks.begin(); tli != tasks.end(); ++tli) { (*tli)->print_dependencies(os); os << '\n'; } os << ')' << std::endl; } void task_list::execute (const char* msg) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::execute()"); if (HG_is_debugging) ParallelDescriptor::Barrier(HG::mpi_comm); // // Assign message tag IDs ... // std::list::iterator tli = tasks.begin(); for ( ; tli != tasks.end(); ++tli) { int with = -1; if ((*tli)->need_to_communicate(with)) { (*tli)->set_sequence_number(get_then_advance(with)); } } if (verbose) { #ifdef HG_DEBUG HG_DEBUG_OUT("Processing List "); HG_DEBUG_OUT(HG::mpi_comm); HG_DEBUG_OUT(" with " << tasks.size() << " elements " << std::endl); print_dependencies(debug_out); #endif } int live_tasks = 0; long total_snd = 0, total_rcv = 0, maxpacket = 0; restart: while (!tasks.empty()) { std::list::iterator tli = tasks.begin(); while (tli != tasks.end()) { task::task_proxy t = *tli; BL_ASSERT(!t.null()); if (verbose) t->hint(); if (t->depend_ready()) { if (!t->is_started()) { if (live_tasks > HG::max_live_tasks) goto restart; long sndcnt = 0, rcvcnt = 0; if (!t->startup(sndcnt, rcvcnt)) { t.set_finished(); tasks.erase(tli++); continue; } total_snd += sndcnt; total_rcv += rcvcnt; maxpacket = std::max(maxpacket,std::max(sndcnt,rcvcnt)); live_tasks++; } if (t->ready()) { t.set_finished(); live_tasks--; tasks.erase(tli++); continue; } } ++tli; } } BL_ASSERT(live_tasks == 0); for (int i = 0; i < ParallelDescriptor::NProcs(); i++) seq_no[i] = 1; #ifdef HG_DEBUG if (verbose && maxpacket > 0) { char buf[512]; sprintf(buf, "CPU(%d) %s: Sent: %ld Rcvd: %ld MaxPkt: %ld", ParallelDescriptor::MyProc(), msg, total_snd, total_rcv, maxpacket); std::cout << buf << std::endl; } #endif } inline bool mfeq (const MultiFab& a, const MultiFab& b) { return &a == &b; } // task_copy_base: task_copy_base::task_copy_base(task_list& tl_, MultiFab& dmf_, int dgrid_, const Box& db_, const MultiFab& smf_, int sgrid_, const Box& sb_) : task(tl_), m_request(MPI_REQUEST_NULL), m_tmp(0), m_dmf(dmf_), m_dgrid(dgrid_), m_dbx(db_), m_smf(smf_), m_sgrid(sgrid_), m_sbx(sb_), m_local(false) {} task_copy_base::~task_copy_base () { delete m_tmp; } bool task_copy_base::depends_on_q (const task* t1) const { if (!mfeq(m_dmf, m_smf)) return false; if (const task_copy_base* t1tc = dynamic_cast(t1)) { if (m_sgrid == t1tc->m_dgrid && m_sbx.intersects(t1tc->m_dbx)) return true; if (m_dgrid == t1tc->m_dgrid && m_dbx.intersects(t1tc->m_dbx)) return true; if (m_sgrid == t1tc->m_sgrid && m_sbx.intersects(t1tc->m_sbx)) return true; if (m_dgrid == t1tc->m_sgrid && m_dbx.intersects(t1tc->m_sbx)) return true; } return false; } bool task_copy_base::need_to_communicate (int& with) const { bool result = false; if (!m_local) { if (is_local(m_dmf, m_dgrid)) { with = processor_number(m_smf, m_sgrid); result = true; } else if (is_local(m_smf, m_sgrid)) { with = processor_number(m_dmf, m_dgrid); result = true; } } return result; } bool task_copy_base::startup (long& sndcnt, long& rcvcnt) { m_started = true; bool result = true; if (!m_local) { if (is_local(m_dmf, m_dgrid)) { m_tmp = new FArrayBox(m_sbx, m_smf.nComp()); rcvcnt = m_tmp->box().numPts()*m_tmp->nComp(); m_request = ParallelDescriptor::Arecv(m_tmp->dataPtr(), rcvcnt, processor_number(m_smf,m_sgrid), m_sno, HG::mpi_comm).req(); rcvcnt *= sizeof(double); BL_ASSERT(m_request != MPI_REQUEST_NULL); } else if (is_local(m_smf, m_sgrid)) { m_tmp = new FArrayBox(m_sbx, m_smf.nComp()); m_tmp->copy(m_smf[m_sgrid], m_sbx); sndcnt = m_tmp->box().numPts()*m_tmp->nComp(); m_request = ParallelDescriptor::Asend(m_tmp->dataPtr(), sndcnt, processor_number(m_dmf,m_dgrid), m_sno, HG::mpi_comm).req(); sndcnt *= sizeof(double); BL_ASSERT(m_request != MPI_REQUEST_NULL); } else { result = false; } } return result; } void task_copy_base::hint () const { task::_hint(); if (is_local(m_smf, m_sgrid) && is_local(m_dmf, m_dgrid)) { HG_DEBUG_OUT("L"); } else if (is_local(m_smf, m_sgrid)) { HG_DEBUG_OUT("S"); } else if (is_local(m_dmf, m_dgrid)) { HG_DEBUG_OUT("R"); } else { HG_DEBUG_OUT("?"); } HG_DEBUG_OUT('(' << m_dgrid << "," << m_sgrid << ')' << m_dbx << ' ' << m_sbx << ' ' ); HG_DEBUG_OUT(")" << std::endl); } // task_copy task_copy::task_copy (task_list& tl_, MultiFab& mf, int dgrid, const MultiFab& smf, int sgrid, const Box& bx) : task_copy_base(tl_, mf, dgrid, bx, smf, sgrid, bx) { init(); } task_copy::task_copy (task_list& tl_, MultiFab& mf, int dgrid, const Box& db, const MultiFab& smf, int sgrid, const Box& sb) : task_copy_base(tl_, mf, dgrid, db, smf, sgrid, sb) { init(); } task_copy::task_copy (task_list& tl_, MultiFab& mf, int dgrid, const MultiFab& smf, int sgrid, const Box& bx, const task_proxy& tp) : task_copy_base(tl_, mf, dgrid, bx, smf, sgrid, bx) { depend_on(tp); init(); } void task_copy::init () { if (is_local(m_dmf, m_dgrid) || is_local(m_smf, m_sgrid)) { _do_depend(); if (is_local(m_dmf, m_dgrid) && is_local(m_smf, m_sgrid)) { m_local = true; if (dependencies.empty()) { m_dmf[m_dgrid].copy(m_smf[m_sgrid], m_sbx, 0, m_dbx, 0, m_dmf.nComp()); m_finished = true; } } } else { m_finished = true; } } bool task_copy::ready () { BL_ASSERT(is_started()); if (m_local) { BL_ASSERT(!m_finished); m_dmf[m_dgrid].copy(m_smf[m_sgrid],m_sbx,0,m_dbx,0,m_dmf.nComp()); return true; } int flag; MPI_Status status; BL_ASSERT(m_request != MPI_REQUEST_NULL); ParallelDescriptor::Test(m_request, flag, status); if (flag) { BL_ASSERT(m_request == MPI_REQUEST_NULL); if (is_local(m_dmf, m_dgrid)) { #if defined(BL_USE_MPI) && !defined(NDEBUG) int count,res; BL_ASSERT(status.MPI_SOURCE == processor_number(m_smf, m_sgrid)); BL_ASSERT(status.MPI_TAG == m_sno); if ((res = MPI_Get_count(&status, MPI_DOUBLE, &count)) != 0) ParallelDescriptor::Abort(res); BL_ASSERT(count == m_tmp->box().numPts()*m_tmp->nComp()); #endif m_dmf[m_dgrid].copy(*m_tmp,m_tmp->box(),0,m_dbx,0,m_smf.nComp()); } return true; } return false; } // task_local_base task_local_base::task_local_base (task_list& tl_, FArrayBox* fab_, int target_proc_id, const Box& bx, const Box& region, const MultiFab& smf_, int grid) : task(tl_), m_request(MPI_REQUEST_NULL), m_tmp(0), m_fab(fab_), m_smf(smf_), m_bx(bx), m_region(region), m_sgrid(grid), m_target_proc_id(target_proc_id), m_local(false) {} task_local_base::~task_local_base () { delete m_tmp; } bool task_local_base::need_to_communicate (int& with) const { bool result = false; if (!m_local) { if (m_fab != 0) { with = processor_number(m_smf, m_sgrid); result = true; } else if (is_local(m_smf, m_sgrid)) { with = m_target_proc_id; result = true; } } return result; } bool task_local_base::startup (long& sndcnt, long& rcvcnt) { m_started = true; bool result = true; if (!m_local) { if (m_fab != 0) { m_tmp = new FArrayBox(m_bx, m_smf.nComp()); rcvcnt = m_tmp->box().numPts()*m_tmp->nComp(); m_request = ParallelDescriptor::Arecv(m_tmp->dataPtr(), rcvcnt, processor_number(m_smf,m_sgrid), m_sno, HG::mpi_comm).req(); rcvcnt *= sizeof(double); BL_ASSERT(m_request != MPI_REQUEST_NULL); } else if (is_local(m_smf, m_sgrid)) { m_tmp = new FArrayBox(m_bx, m_smf.nComp()); m_tmp->copy(m_smf[m_sgrid], m_bx); sndcnt = m_tmp->box().numPts()*m_tmp->nComp(); m_request = ParallelDescriptor::Asend(m_tmp->dataPtr(), sndcnt, m_target_proc_id, m_sno, HG::mpi_comm).req(); sndcnt *= sizeof(double); BL_ASSERT(m_request != MPI_REQUEST_NULL); } else { result = false; } } return result; } bool task_local_base::depends_on_q (const task* t1) const { if (const task_local_base* t1tc = dynamic_cast(t1)) { if (!(m_fab == t1tc->m_fab)) return false; if (!mfeq(m_smf, t1tc->m_smf)) return false; if (m_region.intersects(t1tc->m_region)) return true; if (m_sgrid != t1tc->m_sgrid && m_bx.intersects(t1tc->m_bx)) return true; } return false; } void task_local_base::hint () const { task::_hint(); if (m_fab !=0 && is_local(m_smf, m_sgrid)) HG_DEBUG_OUT("L"); else if (m_fab != 0) HG_DEBUG_OUT("R"); else if (is_local(m_smf, m_sgrid)) HG_DEBUG_OUT("S"); else HG_DEBUG_OUT("?"); HG_DEBUG_OUT(m_bx << ' ' << m_sgrid << ' '); HG_DEBUG_OUT(")" << std::endl); } task_copy_local::task_copy_local (task_list& tl_, FArrayBox* fab_, int target_proc_id, const Box& bx, const MultiFab& smf_, int grid) : task_local_base(tl_,fab_,target_proc_id,bx,bx,smf_,grid) { if (m_fab != 0 || is_local(m_smf, m_sgrid)) { _do_depend(); if (m_fab != 0 && is_local(m_smf, m_sgrid)) { m_local = true; if (dependencies.empty()) { m_fab->copy(m_smf[m_sgrid], m_bx); m_finished = true; } } } else { m_finished = true; } } bool task_copy_local::ready () { BL_ASSERT(is_started()); if (m_local) { BL_ASSERT(!m_finished); m_fab->copy(m_smf[m_sgrid], m_bx); return true; } int flag; MPI_Status status; BL_ASSERT(m_request != MPI_REQUEST_NULL); ParallelDescriptor::Test(m_request, flag, status); if (flag) { BL_ASSERT(m_request == MPI_REQUEST_NULL); if (m_fab) { #if defined(BL_USE_MPI) && !defined(NDEBUG) int count,res; BL_ASSERT(status.MPI_SOURCE == processor_number(m_smf, m_sgrid)); BL_ASSERT(status.MPI_TAG == m_sno); if ((res = MPI_Get_count(&status, MPI_DOUBLE, &count)) != 0) ParallelDescriptor::Abort(res); BL_ASSERT(count == m_tmp->box().numPts()*m_tmp->nComp()); #endif m_fab->copy(*m_tmp, m_bx); } return true; } return false; } task_bdy_fill::task_bdy_fill (task_list& tl_, const amr_boundary* bdy_, FArrayBox* fab_, int target_proc_id, const Box& region_, const MultiFab& src_, int grid_, const Box& domain_) : task_local_base(tl_,fab_,target_proc_id,Box(),region_,src_,grid_), m_domain(domain_), m_bdy(bdy_) { BL_ASSERT(m_bdy != 0); Box tmpb = m_bdy->anImage(m_region,m_smf.boxArray()[m_sgrid],m_domain); m_bx = tmpb; // // This is a GROSS hack FIXME: the growth should probably be set // by the refinement between the coarse/fine domains. // m_bx = BoxLib::grow(tmpb, 4); if (m_fab != 0 || is_local(m_smf, m_sgrid)) { _do_depend(); if (m_fab != 0 && is_local(m_smf, m_sgrid)) { m_local = true; if (dependencies.empty()) { m_bdy->fill(*m_fab, m_region, m_smf[m_sgrid], m_domain); m_finished = true; } } } else { m_finished = true; } } bool task_bdy_fill::ready () { BL_ASSERT(is_started()); if (m_local) { BL_ASSERT(!m_finished); m_bdy->fill(*m_fab, m_region, m_smf[m_sgrid], m_domain); return true; } int flag; MPI_Status status; BL_ASSERT(m_request != MPI_REQUEST_NULL); ParallelDescriptor::Test(m_request, flag, status); if (flag) { BL_ASSERT(m_request == MPI_REQUEST_NULL); if (m_fab) { #if defined(BL_USE_MPI) && !defined(NDEBUG) int count,res; BL_ASSERT(status.MPI_SOURCE == processor_number(m_smf, m_sgrid)); BL_ASSERT(status.MPI_TAG == m_sno); if ((res = MPI_Get_count(&status, MPI_DOUBLE, &count)) != 0) ParallelDescriptor::Abort(res); BL_ASSERT(count == m_tmp->box().numPts()*m_tmp->nComp()); #endif m_bdy->fill(*m_fab, m_region, *m_tmp, m_domain); } return true; } return false; } task_fab::task_fab (task_list& tl_, const MultiFab& t_, int tt_, const Box& region_, int ncomp_) : task(tl_), target(0), region(region_), ncomp(ncomp_), m_target_proc_id(processor_number(t_, tt_)) { BL_ASSERT(m_sno > 0); if (is_local(t_, tt_)) { target = new FArrayBox(region, ncomp); } else { m_finished = true; } } task_fab::~task_fab () { delete target; } task_fec_base::task_fec_base (task_list& tl_, MultiFab& s_, int igrid_) : task(tl_), s(s_), igrid(igrid_) { if (!is_local_target()) m_finished = true; } task_fec_base::~task_fec_base () {} void task_fec_base::push_back (task_fab* tf) { task_proxy tp = m_task_list.add_task(tf); if (!tp.null()) { tfvect.push_back(tp); dependencies.push_back(tp); } } ccseapps-2.5/CCSEApps/hgproj/hg_projector.H0000644000175000017500000002612111634153073021750 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _HG_PROJECTOR_H_ #define _HG_PROJECTOR_H_ #include "hg_multi.H" #include extern PArray null_amr_real; class holy_grail_amr_projector : public holy_grail_amr_multigrid { public: // // No, I'm not pulling your leg. Lev_min and Lev_max, supplied with // project, tell the range of levels over which to project. The // arguments to the constructor give the permissible range for Lev_min // and Lev_max. Lev_min can be anything from Lev_min_min to Lev_min_max; // Lev_max can then be anything from Lev_min to Lev_max_max. // holy_grail_amr_projector (const Array& Mesh, const Array& Gen_ratio, const Box& fdomain, int Lev_min_min, int Lev_min_max, int Lev_max_max, const amr_fluid_boundary& Boundary, stencil stencil_, int Pcode); const Array& mesh () const; // // All of the following projection calls take a vector field u and // a scalar field p. On return p will contain the computed potential // which satisfies Poisson's equation. The field contained in p on // entry to these routines will be used as an initial guess for the // iterative scheme. Also on return u, if it exists, will be updated // to u - Gp. // // For project, the right hand side will be Du. // For sync_project, the right hand side will be Du computed at the // coarse-fine interface, and 0 everywhere in the grid interiors. // For manual_project, the right hand side is a separate input field, // and u can be passed in 0(NULL) if you don't care about the update. // If use_u is false (0), the right hand side will be used without // modification. If it is true (1), Du will be added to the rhs provided. // Let start_norm = max[norm(div u), norm(first residual)]. // Project will attempt to reduce the Holy Grail residual to // less than max[tol * start_norm, scale]. At least one multilevel // cycle will be executed down to lev_min. The last cycle will omit // any actions on or below lev_min. // H is an array of SPACEDIM Reals containing the fine mesh spacing // in each dimension. "fine" means lev_max. If a positive value is // not supplied for lev_min, lev_min_max will be used. If // a positive value is not supplied for lev_max, lev_min will be used. // Ghost cells: All version require exactly 1 row of ghost cells on p. // project and sync_project, which compute a divergence, require // exactly 1 row of ghost cells on u (manual_project does not have // this requirement). Sigma does not require ghost cells. The only // case where user-supplied information in the ghost cells is actually // used is the normal velocity at an inflow boundary---in all other // cases the projection will fill in ghost cells according to its // own requirements. // void project (PArray* u, PArray& p, PArray& Coarse_source, MultiFab* Sync_resid_crse, MultiFab* Sync_resid_fine, const Geometry& crse_geom, Real H[], Real tol, int Lev_min = -1, int Lev_max = -1, Real scale = 0.0) ; void project (PArray* u, PArray& p, PArray& Coarse_source, PArray& Sigma, MultiFab* Sync_resid_crse, MultiFab* Sync_resid_fine, const Geometry& crse_geom, Real H[], Real tol, int Lev_min = -1, int Lev_max = -1, Real scale = 0.0); void pressure_project (PArray& p, PArray& Sigma, const Geometry& crse_geom, Real H[], Real tol, int Lev_min = -1, int Lev_max = -1, Real scale = 0.0); #ifdef HG_USE_SYNC_PROJECT void sync_project (PArray* u, PArray& p, PArray& Coarse_source, Real H[], Real tol, int Lev_min = -1, int Lev_max = -1, Real scale = 0.0) ; void sync_project (PArray* u, PArray& p, PArray& Coarse_source, PArray& Sigma, Real H[], Real tol, int Lev_min = -1, int Lev_max = -1, Real scale = 0.0); #endif // // This is the do-it-yourself version: The right hand side for the // elliptic solve is specified in rhs. The resulting potential will // be returned in p, and its gradient will be subtracted from u // if u is non-null. // // If rhs is node-based it will simply be used as the right hand side. // No solvability modifications will be made. // // If rhs is cell-based it will be conservatively averaged onto nodes // to use as the right hand side. rhs must be passed in with a one // cell wide border. At inflow boundaries border values should // be set to correct inflow condition. Other border values passed // in may be meaningless, but should not be NaNs. // // This routine will modify the borders of the cell-based rhs. Also, // if the problem being solved is singular, rhs will be adjusted so // that it integrates to 0 to maximum precision. // void manual_project (PArray* u, PArray& p, PArray& rhs, PArray& Coarse_source, MultiFab* Sync_resid_crse, MultiFab* Sync_resid_fine, const Geometry& crse_geom, bool use_u, Real H[], Real tol, int Lev_min = -1, int Lev_max = -1, Real scale = 0.0) ; void manual_project (PArray* u, PArray& p, PArray& rhs, PArray& Coarse_source, PArray& Sigma, MultiFab* Sync_resid_crse, MultiFab* Sync_resid_fine, const Geometry& crse_geom, bool use_u, Real H[], Real tol, int Lev_min = -1, int Lev_max = -1, Real scale = 0.0); void stream_func_project(PArray* u, PArray& p, PArray& Sigma, Real H[], Real tol, int Lev_min = -1, int Lev_max = -1, Real scale = 0.0); void make_it_so (); protected: void fill_sync_reg (PArray* u_local, PArray& p, PArray& rhs_local, PArray& Sigma_local, MultiFab* Sync_resid, const Geometry& crse_geom, Real H[], int Lev_min, bool is_coarse); void right_hand_side (PArray* u, PArray& S, int for_fill_sync_reg); void right_hand_side_for_stream_func (PArray* u); #ifdef HG_USE_SYNC_PROJECT void sync_right_hand_side (PArray* u); #endif void interface_average (PArray& S, int lev); void interface_divergence (PArray* u, int lev); void interface_vorticity (PArray* u, int lev); void form_solution_vector (PArray* u, const PArray& sigma_in); void sparse_node_source_adjustment (PArray& sparse_source); void grid_divergence (PArray* u, PArray& s, int for_fill_sync_reg); void grid_vorticity (PArray* u, PArray& s); void grid_average (PArray& S, PArray& src, int for_sync_reg); private: // // The data. // bool make_sparse_node_source_solvable; }; #endif /*_HG_PROJECTOR_H_*/ ccseapps-2.5/CCSEApps/hgproj/hg_proj3d.f0000644000175000017500000023077211634153073021211 0ustar amckinstryamckinstryc----------------------------------------------------------------------- subroutine hggrad_dense( & gpx, gpy, gpz, & gpl0,gph0,gpl1,gph1,gpl2,gph2, & dest, destl0,desth0,destl1,desth1,destl2,desth2, & fregl0,fregh0,fregl1,fregh1,fregl2,fregh2, & hx, hy, hz, idummy) integer gpl0,gph0,gpl1,gph1,gpl2,gph2 integer destl0,desth0,destl1,desth1,destl2,desth2 integer fregl0,fregh0,fregl1,fregh1,fregl2,fregh2 double precision hx, hy, hz double precision gpx(gpl0:gph0,gpl1:gph1,gpl2:gph2) double precision gpy(gpl0:gph0,gpl1:gph1,gpl2:gph2) double precision gpz(gpl0:gph0,gpl1:gph1,gpl2:gph2) double precision dest(destl0:desth0,destl1:desth1,destl2:desth2) integer idummy integer i, j, k do k = fregl2, fregh2 do j = fregl1, fregh1 do i = fregl0, fregh0 gpx(i,j,k) = 0.25d0 * & (dest(i+1,j,k ) + dest(i+1,j+1,k ) + & dest(i+1,j,k+1) + dest(i+1,j+1,k+1) - & dest(i ,j,k ) - dest(i ,j+1,k ) - & dest(i ,j,k+1) - dest(i ,j+1,k+1)) gpy(i,j,k) = 0.25d0 * & (dest(i,j+1,k ) + dest(i+1,j+1,k ) + & dest(i,j+1,k+1) + dest(i+1,j+1,k+1) - & dest(i,j ,k ) - dest(i+1,j ,k ) - & dest(i,j ,k+1) - dest(i+1,j ,k+1)) gpz(i,j,k) = 0.25d0 * & (dest(i,j ,k+1) + dest(i+1,j ,k+1) + & dest(i,j+1,k+1) + dest(i+1,j+1,k+1) - & dest(i,j ,k ) - dest(i+1,j ,k ) - & dest(i,j+1,k ) - dest(i+1,j+1,k )) end do end do end do end c----------------------------------------------------------------------- subroutine hgdiv_dense( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & uf, vf, wf, & fl0,fh0,fl1,fh1,fl2,fh2, & fregl0,fregh0,fregl1,fregh1,fregl2,fregh2, & hx, hy, hz, idummy, jdummy) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer fregl0,fregh0,fregl1,fregh1,fregl2,fregh2 double precision hx, hy, hz double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision uf(fl0:fh0,fl1:fh1,fl2:fh2) double precision vf(fl0:fh0,fl1:fh1,fl2:fh2) double precision wf(fl0:fh0,fl1:fh1,fl2:fh2) double precision fac integer idummy, jdummy integer i, j, k fac = 0.25d0 do k = fregl2, fregh2 do j = fregl1, fregh1 do i = fregl0, fregh0 src(i,j,k) = fac * & (uf(i ,j-1,k-1) - uf(i-1,j-1,k-1) + & uf(i ,j-1,k ) - uf(i-1,j-1,k ) + & uf(i ,j ,k-1) - uf(i-1,j ,k-1) + & uf(i ,j ,k ) - uf(i-1,j ,k ) + & vf(i-1,j ,k-1) - vf(i-1,j-1,k-1) + & vf(i-1,j ,k ) - vf(i-1,j-1,k ) + & vf(i ,j ,k-1) - vf(i ,j-1,k-1) + & vf(i ,j ,k ) - vf(i ,j-1,k ) + & wf(i-1,j-1,k ) - wf(i-1,j-1,k-1) + & wf(i-1,j ,k ) - wf(i-1,j ,k-1) + & wf(i ,j-1,k ) - wf(i ,j-1,k-1) + & wf(i ,j ,k ) - wf(i ,j ,k-1)) end do end do end do end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgfdiv_dense( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & uc, vc, wc, & cl0,ch0,cl1,ch1,cl2,ch2, & uf, vf, wf, & fl0,fh0,fl1,fh1,fl2,fh2, & cregl0,cregh0,cregl1,cregh1,cregl2,cregh2, & hx, hy, hz, ir, jr, kr, idim, idir, idd1, idd2) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer cl0,ch0,cl1,ch1,cl2,ch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer cregl0,cregh0,cregl1,cregh1,cregl2,cregh2 double precision hx, hy, hz double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision uc(cl0:ch0,cl1:ch1,cl2:ch2) double precision vc(cl0:ch0,cl1:ch1,cl2:ch2) double precision wc(cl0:ch0,cl1:ch1,cl2:ch2) double precision uf(fl0:fh0,fl1:fh1,fl2:fh2) double precision vf(fl0:fh0,fl1:fh1,fl2:fh2) double precision wf(fl0:fh0,fl1:fh1,fl2:fh2) integer ir, jr, kr, idim, idir double precision fac0, fac1, fac, tmp integer i, j, k, iuc, iuf, juc, juf, kuc, kuf, l, m, n integer idd1, idd2 if (idim .eq. 0) then i = cregl0 if (idir .eq. 1) then iuc = i - 1 iuf = i * ir else iuc = i iuf = i * ir - 1 end if fac0 = 0.25d0 do k = cregl2, cregh2 do j = cregl1, cregh1 src(i*ir,j*jr,k*kr) = fac0 * & ((vc(iuc,j,k) - vc(iuc,j-1,k) + & vc(iuc,j,k-1) - vc(iuc,j-1,k-1)) + & (wc(iuc,j,k) - wc(iuc,j,k-1) + & wc(iuc,j-1,k) - wc(iuc,j-1,k-1)) - & idir * (uc(iuc,j,k) + uc(iuc,j,k-1) + & uc(iuc,j-1,k) + uc(iuc,j-1,k-1))) end do end do fac0 = fac0 / (jr * kr) i = i * ir do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do k = kr*cregl2, kr*cregh2, kr do j = jr*cregl1, jr*cregh1, jr tmp = idir * & (uf(iuf,j-n ,k-l) + uf(iuf,j-n ,k-l-1) + & uf(iuf,j-n-1,k-l) + uf(iuf,j-n-1,k-l-1) + & uf(iuf,j-n ,k+l) + uf(iuf,j-n ,k+l-1) + & uf(iuf,j-n-1,k+l) + uf(iuf,j-n-1,k+l-1) + & uf(iuf,j+n ,k-l) + uf(iuf,j+n ,k-l-1) + & uf(iuf,j+n-1,k-l) + uf(iuf,j+n-1,k-l-1) + & uf(iuf,j+n ,k+l) + uf(iuf,j+n ,k+l-1) + & uf(iuf,j+n-1,k+l) + uf(iuf,j+n-1,k+l-1)) tmp = tmp + & (vf(iuf,j-n,k-l ) - vf(iuf,j-n-1,k-l ) + & vf(iuf,j-n,k-l-1) - vf(iuf,j-n-1,k-l-1) + & vf(iuf,j-n,k+l ) - vf(iuf,j-n-1,k+l ) + & vf(iuf,j-n,k+l-1) - vf(iuf,j-n-1,k+l-1) + & vf(iuf,j+n,k-l ) - vf(iuf,j+n-1,k-l ) + & vf(iuf,j+n,k-l-1) - vf(iuf,j+n-1,k-l-1) + & vf(iuf,j+n,k+l ) - vf(iuf,j+n-1,k+l ) + & vf(iuf,j+n,k+l-1) - vf(iuf,j+n-1,k+l-1)) src(i,j,k) = src(i,j,k) + fac * (tmp + & (wf(iuf,j-n ,k-l) - wf(iuf,j-n ,k-l-1) + & wf(iuf,j-n-1,k-l) - wf(iuf,j-n-1,k-l-1) + & wf(iuf,j-n ,k+l) - wf(iuf,j-n ,k+l-1) + & wf(iuf,j-n-1,k+l) - wf(iuf,j-n-1,k+l-1) + & wf(iuf,j+n ,k-l) - wf(iuf,j+n ,k-l-1) + & wf(iuf,j+n-1,k-l) - wf(iuf,j+n-1,k-l-1) + & wf(iuf,j+n ,k+l) - wf(iuf,j+n ,k+l-1) + & wf(iuf,j+n-1,k+l) - wf(iuf,j+n-1,k+l-1))) end do end do end do end do else if (idim .eq. 1) then j = cregl1 if (idir .eq. 1) then juc = j - 1 juf = j * jr else juc = j juf = j * jr - 1 end if fac0 = 0.25d0 do k = cregl2, cregh2 do i = cregl0, cregh0 src(i*ir,j*jr,k*kr) = fac0 * & ((uc(i,juc,k) - uc(i-1,juc,k) + & uc(i,juc,k-1) - uc(i-1,juc,k-1)) - & idir * (vc(i,juc,k) + vc(i,juc,k-1) + & vc(i-1,juc,k) + vc(i-1,juc,k-1)) + & (wc(i,juc,k) - wc(i,juc,k-1) + & wc(i-1,juc,k) - wc(i-1,juc,k-1))) end do end do fac0 = fac0 / (ir * kr) j = j * jr do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do k = kr*cregl2, kr*cregh2, kr do i = ir*cregl0, ir*cregh0, ir tmp = & (uf(i-m,juf,k-l ) - uf(i-m-1,juf,k-l) + & uf(i-m,juf,k-l-1) - uf(i-m-1,juf,k-l-1) + & uf(i-m,juf,k+l ) - uf(i-m-1,juf,k+l) + & uf(i-m,juf,k+l-1) - uf(i-m-1,juf,k+l-1) + & uf(i+m,juf,k-l ) - uf(i+m-1,juf,k-l) + & uf(i+m,juf,k-l-1) - uf(i+m-1,juf,k-l-1) + & uf(i+m,juf,k+l ) - uf(i+m-1,juf,k+l) + & uf(i+m,juf,k+l-1) - uf(i+m-1,juf,k+l-1)) tmp = tmp + idir * & (vf(i-m ,juf,k-l) + vf(i-m ,juf,k-l-1) + & vf(i-m-1,juf,k-l) + vf(i-m-1,juf,k-l-1) + & vf(i-m ,juf,k+l) + vf(i-m ,juf,k+l-1) + & vf(i-m-1,juf,k+l) + vf(i-m-1,juf,k+l-1) + & vf(i+m ,juf,k-l) + vf(i+m ,juf,k-l-1) + & vf(i+m-1,juf,k-l) + vf(i+m-1,juf,k-l-1) + & vf(i+m ,juf,k+l) + vf(i+m ,juf,k+l-1) + & vf(i+m-1,juf,k+l) + vf(i+m-1,juf,k+l-1)) src(i,j,k) = src(i,j,k) + fac * (tmp + & (wf(i-m ,juf,k-l) - wf(i-m ,juf,k-l-1) + & wf(i-m-1,juf,k-l) - wf(i-m-1,juf,k-l-1) + & wf(i-m ,juf,k+l) - wf(i-m ,juf,k+l-1) + & wf(i-m-1,juf,k+l) - wf(i-m-1,juf,k+l-1) + & wf(i+m ,juf,k-l) - wf(i+m ,juf,k-l-1) + & wf(i+m-1,juf,k-l) - wf(i+m-1,juf,k-l-1) + & wf(i+m ,juf,k+l) - wf(i+m ,juf,k+l-1) + & wf(i+m-1,juf,k+l) - wf(i+m-1,juf,k+l-1))) end do end do end do end do else k = cregl2 if (idir .eq. 1) then kuc = k - 1 kuf = k * kr else kuc = k kuf = k * kr - 1 end if fac0 = 0.25d0 do j = cregl1, cregh1 do i = cregl0, cregh0 src(i*ir,j*jr,k*kr) = fac0 * & ((uc(i,j,kuc) - uc(i-1,j,kuc) + & uc(i,j-1,kuc) - uc(i-1,j-1,kuc)) + & (vc(i,j,kuc) - vc(i,j-1,kuc) + & vc(i-1,j,kuc) - vc(i-1,j-1,kuc)) - & idir * (wc(i,j,kuc) + wc(i,j-1,kuc) + & wc(i-1,j,kuc) + wc(i-1,j-1,kuc))) end do end do fac0 = fac0 / (ir * jr) k = k * kr do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do j = jr*cregl1, jr*cregh1, jr do i = ir*cregl0, ir*cregh0, ir tmp = & (uf(i-m,j-n ,kuf) - uf(i-m-1,j-n ,kuf) + & uf(i-m,j-n-1,kuf) - uf(i-m-1,j-n-1,kuf) + & uf(i-m,j+n ,kuf) - uf(i-m-1,j+n ,kuf) + & uf(i-m,j+n-1,kuf) - uf(i-m-1,j+n-1,kuf) + & uf(i+m,j-n ,kuf) - uf(i+m-1,j-n ,kuf) + & uf(i+m,j-n-1,kuf) - uf(i+m-1,j-n-1,kuf) + & uf(i+m,j+n ,kuf) - uf(i+m-1,j+n ,kuf) + & uf(i+m,j+n-1,kuf) - uf(i+m-1,j+n-1,kuf)) tmp = tmp + & (vf(i-m ,j-n,kuf) - vf(i-m ,j-n-1,kuf) + & vf(i-m-1,j-n,kuf) - vf(i-m-1,j-n-1,kuf) + & vf(i-m ,j+n,kuf) - vf(i-m ,j+n-1,kuf) + & vf(i-m-1,j+n,kuf) - vf(i-m-1,j+n-1,kuf) + & vf(i+m ,j-n,kuf) - vf(i+m ,j-n-1,kuf) + & vf(i+m-1,j-n,kuf) - vf(i+m-1,j-n-1,kuf) + & vf(i+m ,j+n,kuf) - vf(i+m ,j+n-1,kuf) + & vf(i+m-1,j+n,kuf) - vf(i+m-1,j+n-1,kuf)) src(i,j,k) = src(i,j,k) + fac * (tmp + idir * & (wf(i-m ,j-n,kuf) + wf(i-m ,j-n-1,kuf) + & wf(i-m-1,j-n,kuf) + wf(i-m-1,j-n-1,kuf) + & wf(i-m ,j+n,kuf) + wf(i-m ,j+n-1,kuf) + & wf(i-m-1,j+n,kuf) + wf(i-m-1,j+n-1,kuf) + & wf(i+m ,j-n,kuf) + wf(i+m ,j-n-1,kuf) + & wf(i+m-1,j-n,kuf) + wf(i+m-1,j-n-1,kuf) + & wf(i+m ,j+n,kuf) + wf(i+m ,j+n-1,kuf) + & wf(i+m-1,j+n,kuf) + wf(i+m-1,j+n-1,kuf))) end do end do end do end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgediv_dense( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & uc, vc, wc, & cl0,ch0,cl1,ch1,cl2,ch2, & uf, vf, wf, & fl0,fh0,fl1,fh1,fl2,fh2, & cregl0,cregh0,cregl1,cregh1,cregl2,cregh2, & hx, hy, hz, ir, jr, kr, ga, ivect) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer cl0,ch0,cl1,ch1,cl2,ch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer cregl0,cregh0,cregl1,cregh1,cregl2,cregh2 double precision hx, hy, hz double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision uc(cl0:ch0,cl1:ch1,cl2:ch2) double precision vc(cl0:ch0,cl1:ch1,cl2:ch2) double precision wc(cl0:ch0,cl1:ch1,cl2:ch2) double precision uf(fl0:fh0,fl1:fh1,fl2:fh2) double precision vf(fl0:fh0,fl1:fh1,fl2:fh2) double precision wf(fl0:fh0,fl1:fh1,fl2:fh2) integer ir, jr, kr, ivect(0:2), ga(0:1,0:1,0:1) double precision fac0, fac1, fac integer ic, jc, kc, if, jf, kf, iuc, iuf, juc, juf, kuc, kuf integer ii, ji, ki, idir, jdir, kdir, l, m, n ic = cregl0 jc = cregl1 kc = cregl2 if = ic * ir jf = jc * jr kf = kc * kr if (ivect(0) .eq. 0) then do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac1 = 1.0D0 / ir do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) .eq. 1) then kuf = kf + ki - 1 juf = jf + ji - 1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = src(if,jf,kf) + fac * & ( & (uf(if-m,juf,kuf) - uf(if-m-1,juf,kuf) + & uf(if+m,juf,kuf) - uf(if+m-1,juf,kuf)) + & jdir * & (vf(if-m,juf,kuf) + vf(if-m-1,juf,kuf) + & vf(if+m,juf,kuf) + vf(if+m-1,juf,kuf)) + & kdir * & (wf(if-m,juf,kuf) + wf(if-m-1,juf,kuf) + & wf(if+m,juf,kuf) + wf(if+m-1,juf,kuf))) end do end do else kuc = kc + ki - 1 juc = jc + ji - 1 do ic = cregl0, cregh0 if = ic * ir src(if,jf,kf) = src(if,jf,kf) + & ( (uc(ic,juc,kuc) - uc(ic-1,juc,kuc)) + & jdir * (vc(ic,juc,kuc) + vc(ic-1,juc,kuc)) + & kdir * (wc(ic,juc,kuc) + wc(ic-1,juc,kuc))) end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) - ga(0,ji,1-ki) .eq. 1) then kuf = kf + ki - 1 fac0 = 1.0D0 / (ir * jr) do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = src(if,jf,kf) + fac * & ( & (uf(if-m ,jf+n ,kuf) - uf(if-m-1,jf+n ,kuf) + & uf(if-m ,jf+n-1,kuf) - uf(if-m-1,jf+n-1,kuf) + & uf(if+m ,jf+n ,kuf) - uf(if+m-1,jf+n ,kuf) + & uf(if+m ,jf+n-1,kuf) - uf(if+m-1,jf+n-1,kuf)) + c & (vf(if-m ,jf+n ,kuf) - vf(if-m ,jf+n-1,kuf) + & vf(if-m-1,jf+n ,kuf) - vf(if-m-1,jf+n-1,kuf) + & vf(if+m ,jf+n ,kuf) - vf(if+m ,jf+n-1,kuf) + & vf(if+m-1,jf+n ,kuf) - vf(if+m-1,jf+n-1,kuf)) + & kdir * & (wf(if-m ,jf+n,kuf) + wf(if-m ,jf+n-1,kuf) + & wf(if-m-1,jf+n,kuf) + wf(if-m-1,jf+n-1,kuf) + & wf(if+m ,jf+n,kuf) + wf(if+m ,jf+n-1,kuf) + & wf(if+m-1,jf+n,kuf) + wf(if+m-1,jf+n-1,kuf))) end do end do end do end if if (ga(0,ji,ki) - ga(0,1-ji,ki) .eq. 1) then juf = jf + ji - 1 fac0 = 1.0D0 / (ir * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = src(if,jf,kf) + fac * & ( & (uf(if-m,juf,kf+l ) - uf(if-m-1,juf,kf+l ) + & uf(if-m,juf,kf+l-1) - uf(if-m-1,juf,kf+l-1) + & uf(if+m,juf,kf+l ) - uf(if+m-1,juf,kf+l ) + & uf(if+m,juf,kf+l-1) - uf(if+m-1,juf,kf+l-1)) + & jdir * & (vf(if-m ,juf,kf+l) + vf(if-m ,juf,kf+l-1) + & vf(if-m-1,juf,kf+l) + vf(if-m-1,juf,kf+l-1) + & vf(if+m ,juf,kf+l) + vf(if+m ,juf,kf+l-1) + & vf(if+m-1,juf,kf+l) + vf(if+m-1,juf,kf+l-1)) + c & (wf(if-m ,juf,kf+l) - wf(if-m ,juf,kf+l-1) + & wf(if-m-1,juf,kf+l) - wf(if-m-1,juf,kf+l-1) + & wf(if+m ,juf,kf+l) - wf(if+m ,juf,kf+l-1) + & wf(if+m-1,juf,kf+l) - wf(if+m-1,juf,kf+l-1))) end do end do end do end if end do end do c weighting do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = 0.25d0 * src(if,jf,kf) end do else if (ivect(1) .eq. 0) then do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac1 = 1.0D0 / jr do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) .eq. 1) then kuf = kf + ki - 1 iuf = if + ii - 1 do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = src(if,jf,kf) + fac * & (idir * & (uf(iuf,jf-n,kuf) + uf(iuf,jf-n-1,kuf) + & uf(iuf,jf+n,kuf) + uf(iuf,jf+n-1,kuf)) + c & (vf(iuf,jf-n,kuf) - vf(iuf,jf-n-1,kuf) + & vf(iuf,jf+n,kuf) - vf(iuf,jf+n-1,kuf)) + & kdir * & (wf(iuf,jf-n,kuf) + wf(iuf,jf-n-1,kuf) + & wf(iuf,jf+n,kuf) + wf(iuf,jf+n-1,kuf))) end do end do else kuc = kc + ki - 1 iuc = ic + ii - 1 do jc = cregl1, cregh1 jf = jc * jr src(if,jf,kf) = src(if,jf,kf) + & (idir * (uc(iuc,jc,kuc) + uc(iuc,jc-1,kuc)) + & (vc(iuc,jc,kuc) - vc(iuc,jc-1,kuc)) + & kdir * (wc(iuc,jc,kuc) + wc(iuc,jc-1,kuc))) end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) - ga(ii,0,1-ki) .eq. 1) then kuf = kf + ki - 1 fac0 = 1.0D0 / (ir * jr) do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = src(if,jf,kf) + fac * & ( & (uf(if+m ,jf-n ,kuf) - uf(if+m-1,jf-n ,kuf) + & uf(if+m ,jf-n-1,kuf) - uf(if+m-1,jf-n-1,kuf) + & uf(if+m ,jf+n ,kuf) - uf(if+m-1,jf+n ,kuf) + & uf(if+m ,jf+n-1,kuf) - uf(if+m-1,jf+n-1,kuf)) + & (vf(if+m ,jf-n ,kuf) - vf(if+m ,jf-n-1,kuf) + & vf(if+m-1,jf-n ,kuf) - vf(if+m-1,jf-n-1,kuf) + & vf(if+m ,jf+n ,kuf) - vf(if+m ,jf+n-1,kuf) + & vf(if+m-1,jf+n ,kuf) - vf(if+m-1,jf+n-1,kuf)) + & kdir * & (wf(if+m ,jf-n,kuf) + wf(if+m ,jf-n-1,kuf) + & wf(if+m-1,jf-n,kuf) + wf(if+m-1,jf-n-1,kuf) + & wf(if+m ,jf+n,kuf) + wf(if+m ,jf+n-1,kuf) + & wf(if+m-1,jf+n,kuf) + wf(if+m-1,jf+n-1,kuf))) end do end do end do end if if (ga(ii,0,ki) - ga(1-ii,0,ki) .eq. 1) then iuf = if + ii - 1 fac0 = 1.0D0 / (jr * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = src(if,jf,kf) + fac * & (idir * & (uf(iuf,jf-n ,kf+l ) + uf(iuf,jf-n-1,kf+l ) + & uf(iuf,jf-n ,kf+l-1) + uf(iuf,jf-n-1,kf+l-1) + & uf(iuf,jf+n ,kf+l ) + uf(iuf,jf+n-1,kf+l ) + & uf(iuf,jf+n ,kf+l-1) + uf(iuf,jf+n-1,kf+l-1)) + & (vf(iuf,jf-n ,kf+l ) - vf(iuf,jf-n-1,kf+l ) + & vf(iuf,jf-n ,kf+l-1) - vf(iuf,jf-n-1,kf+l-1) + & vf(iuf,jf+n ,kf+l ) - vf(iuf,jf+n-1,kf+l ) + & vf(iuf,jf+n ,kf+l-1) - vf(iuf,jf+n-1,kf+l-1)) + & (wf(iuf,jf-n ,kf+l ) - wf(iuf,jf-n ,kf+l-1) + & wf(iuf,jf-n-1,kf+l ) - wf(iuf,jf-n-1,kf+l-1) + & wf(iuf,jf+n ,kf+l ) - wf(iuf,jf+n ,kf+l-1) + & wf(iuf,jf+n-1,kf+l ) - wf(iuf,jf+n-1,kf+l-1))) end do end do end do end if end do end do c weighting do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = 0.25d0 * src(if,jf,kf) end do else do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac1 = 1.0D0 / kr do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) .eq. 1) then juf = jf + ji - 1 iuf = if + ii - 1 do l = 0, kr-1 fac = (kr-l) * fac1 if (l .eq. 0) fac = 0.5D0 * fac do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = src(if,jf,kf) + fac * & (idir * & (uf(iuf,juf,kf-l) + uf(iuf,juf,kf-l-1) + & uf(iuf,juf,kf+l) + uf(iuf,juf,kf+l-1)) + & jdir * & (vf(iuf,juf,kf-l) + vf(iuf,juf,kf-l-1) + & vf(iuf,juf,kf+l) + vf(iuf,juf,kf+l-1)) + c & (wf(iuf,juf,kf-l) - wf(iuf,juf,kf-l-1) + & wf(iuf,juf,kf+l) - wf(iuf,juf,kf+l-1))) end do end do else juc = jc + ji - 1 iuc = ic + ii - 1 do kc = cregl2, cregh2 kf = kc * kr src(if,jf,kf) = src(if,jf,kf) + & (idir * (uc(iuc,juc,kc) + uc(iuc,juc,kc-1)) + & jdir * (vc(iuc,juc,kc) + vc(iuc,juc,kc-1)) + & (wc(iuc,juc,kc) - wc(iuc,juc,kc-1))) end do end if end do end do c faces c each face is two faces and two sides of an edge do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) - ga(ii,1-ji,0) .eq. 1) then juf = jf + ji - 1 fac0 = 1.0D0 / (ir * kr) do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = src(if,jf,kf) + fac * & ( & (uf(if+m,juf,kf-l ) - uf(if+m-1,juf,kf-l) + & uf(if+m,juf,kf-l-1) - uf(if+m-1,juf,kf-l-1) + & uf(if+m,juf,kf+l ) - uf(if+m-1,juf,kf+l) + & uf(if+m,juf,kf+l-1) - uf(if+m-1,juf,kf+l-1)) + & jdir * & (vf(if+m ,juf,kf-l) + vf(if+m ,juf,kf-l-1) + & vf(if+m-1,juf,kf-l) + vf(if+m-1,juf,kf-l-1) + & vf(if+m ,juf,kf+l) + vf(if+m ,juf,kf+l-1) + & vf(if+m-1,juf,kf+l) + vf(if+m-1,juf,kf+l-1)) + c & (wf(if+m ,juf,kf-l) - wf(if+m ,juf,kf-l-1) + & wf(if+m-1,juf,kf-l) - wf(if+m-1,juf,kf-l-1) + & wf(if+m ,juf,kf+l) - wf(if+m ,juf,kf+l-1) + & wf(if+m-1,juf,kf+l) - wf(if+m-1,juf,kf+l-1))) end do end do end do end if if (ga(ii,ji,0) - ga(1-ii,ji,0) .eq. 1) then iuf = if + ii - 1 fac0 = 1.0D0 / (jr * kr) do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = src(if,jf,kf) + fac * & (idir * & (uf(iuf,jf+n,kf-l ) + uf(iuf,jf+n-1,kf-l ) + & uf(iuf,jf+n,kf-l-1) + uf(iuf,jf+n-1,kf-l-1) + & uf(iuf,jf+n,kf+l ) + uf(iuf,jf+n-1,kf+l ) + & uf(iuf,jf+n,kf+l-1) + uf(iuf,jf+n-1,kf+l-1)) + c & (vf(iuf,jf+n,kf-l ) - vf(iuf,jf+n-1,kf-l ) + & vf(iuf,jf+n,kf-l-1) - vf(iuf,jf+n-1,kf-l-1) + & vf(iuf,jf+n,kf+l ) - vf(iuf,jf+n-1,kf+l ) + & vf(iuf,jf+n,kf+l-1) - vf(iuf,jf+n-1,kf+l-1)) + c & (wf(iuf,jf+n,kf-l ) - wf(iuf,jf+n ,kf-l-1) + & wf(iuf,jf+n-1,kf-l) - wf(iuf,jf+n-1,kf-l-1) + & wf(iuf,jf+n,kf+l ) - wf(iuf,jf+n ,kf+l-1) + & wf(iuf,jf+n-1,kf+l) - wf(iuf,jf+n-1,kf+l-1))) end do end do end do end if end do end do c weighting do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = 0.25d0 * src(if,jf,kf) end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgcdiv_dense( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & uc, vc, wc, & cl0,ch0,cl1,ch1,cl2,ch2, & uf, vf, wf, & fl0,fh0,fl1,fh1,fl2,fh2, & cregl0,cregh0,cregl1,cregh1,cregl2,cregh2, & hx, hy, hz, ir, jr, kr, ga, ijnk) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer cl0,ch0,cl1,ch1,cl2,ch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer cregl0,cregh0,cregl1,cregh1,cregl2,cregh2 double precision hx, hy, hz double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision uc(cl0:ch0,cl1:ch1,cl2:ch2) double precision vc(cl0:ch0,cl1:ch1,cl2:ch2) double precision wc(cl0:ch0,cl1:ch1,cl2:ch2) double precision uf(fl0:fh0,fl1:fh1,fl2:fh2) double precision vf(fl0:fh0,fl1:fh1,fl2:fh2) double precision wf(fl0:fh0,fl1:fh1,fl2:fh2) integer ir, jr, kr, ga(0:1,0:1,0:1), ijnk(0:2) double precision sum, fac0, fac1, fac integer ic, jc, kc, if, jf, kf, iuc, iuf, juc, juf, kuc, kuf integer ii, ji, ki, idir, jdir, kdir, l, m, n ic = cregl0 jc = cregl1 kc = cregl2 if = ic * ir jf = jc * jr kf = kc * kr sum = 0.0D0 c octants do ki = 0, 1 kdir = 2 * ki - 1 kuf = kf + ki - 1 kuc = kc + ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 juf = jf + ji - 1 juc = jc + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) .eq. 1) then iuf = if + ii - 1 sum = sum + & (idir * uf(iuf,juf,kuf) + & jdir * vf(iuf,juf,kuf) + & kdir * wf(iuf,juf,kuf)) else iuc = ic + ii - 1 sum = sum + & (idir * uc(iuc,juc,kuc) + & jdir * vc(iuc,juc,kuc) + & kdir * wc(iuc,juc,kuc)) end if end do end do end do c faces do ki = 0, 1 kdir = 2 * ki - 1 kuf = kf + ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 juf = jf + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 iuf = if + ii - 1 if (ga(ii,ji,ki) - ga(ii,ji,1-ki) .eq. 1) then fac0 = 1.0D0 / (ir * jr) do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( & (uf(if+m,jf+n ,kuf) - uf(if+m-1,jf+n ,kuf) + & uf(if+m,jf+n-1,kuf) - uf(if+m-1,jf+n-1,kuf)) + c & (vf(if+m ,jf+n,kuf) - vf(if+m ,jf+n-1,kuf) + & vf(if+m-1,jf+n,kuf) - vf(if+m-1,jf+n-1,kuf)) + & kdir * & (wf(if+m ,jf+n,kuf) + wf(if+m ,jf+n-1,kuf) + & wf(if+m-1,jf+n,kuf) + wf(if+m-1,jf+n-1,kuf))) end do end do end if if (ga(ii,ji,ki) - ga(ii,1-ji,ki) .eq. 1) then fac0 = 1.0D0 / (ir * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( & (uf(if+m ,juf,kf+l ) - uf(if+m-1,juf,kf+l ) + & uf(if+m ,juf,kf+l-1) - uf(if+m-1,juf,kf+l-1)) + & jdir * & (vf(if+m ,juf,kf+l ) + vf(if+m ,juf,kf+l-1) + & vf(if+m-1,juf,kf+l ) + vf(if+m-1,juf,kf+l-1)) + c & (wf(if+m ,juf,kf+l ) - wf(if+m ,juf,kf+l-1) + & wf(if+m-1,juf,kf+l ) - wf(if+m-1,juf,kf+l-1))) end do end do end if if (ga(ii,ji,ki) - ga(1-ii,ji,ki) .eq. 1) then fac0 = 1.0D0 / (jr * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * (idir * & (uf(iuf,jf+n ,kf+l ) + uf(iuf,jf+n ,kf+l-1) + & uf(iuf,jf+n-1,kf+l ) + uf(iuf,jf+n-1,kf+l-1)) + c & (vf(iuf,jf+n ,kf+l ) - vf(iuf,jf+n-1,kf+l ) + & vf(iuf,jf+n ,kf+l-1) - vf(iuf,jf+n-1,kf+l-1)) + c & (wf(iuf,jf+n ,kf+l ) - wf(iuf,jf+n ,kf+l-1) + & wf(iuf,jf+n-1,kf+l ) - wf(iuf,jf+n-1,kf+l-1))) end do end do end if end do end do end do c edges do ki = 0, 1 kdir = 2 * ki - 1 kuf = kf + ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 juf = jf + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 iuf = if + ii - 1 if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(ii,1-ji,ki), ga(ii,1-ji,1-ki)) & .eq. 1) then fac1 = 1.0D0 / ir do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( & (uf(if+m,juf,kuf) - uf(if+m-1,juf,kuf)) + & jdir * & (vf(if+m,juf,kuf) + vf(if+m-1,juf,kuf)) + & kdir * & (wf(if+m,juf,kuf) + wf(if+m-1,juf,kuf))) end do end if if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(1-ii,ji,ki), ga(1-ii,ji,1-ki)) & .eq. 1) then fac1 = 1.0D0 / jr do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * (idir * & (uf(iuf,jf+n,kuf) + uf(iuf,jf+n-1,kuf)) + c & (vf(iuf,jf+n,kuf) - vf(iuf,jf+n-1,kuf)) + & kdir * & (wf(iuf,jf+n,kuf) + wf(iuf,jf+n-1,kuf))) end do end if if (ga(ii,ji,ki) - & min(ga(ii,1-ji,ki), ga(1-ii,ji,ki), ga(1-ii,1-ji,ki)) & .eq. 1) then fac1 = 1.0D0 / kr do l = kdir, kdir*(kr-1), kdir fac = (kr-abs(l)) * fac1 sum = sum + fac * (idir * & (uf(iuf,juf,kf+l) + uf(iuf,juf,kf+l-1)) + & jdir * & (vf(iuf,juf,kf+l) + vf(iuf,juf,kf+l-1)) + c & (wf(iuf,juf,kf+l) - wf(iuf,juf,kf+l-1))) end do end if end do end do end do c weighting src(if,jf,kf) = 0.25d0 * sum end c----------------------------------------------------------------------- subroutine hggrad( & gpx, gpy, gpz, & gpl0,gph0,gpl1,gph1,gpl2,gph2, & dest, destl0,desth0,destl1,desth1,destl2,desth2, & fregl0,fregh0,fregl1,fregh1,fregl2,fregh2, & hx, hy, hz, idummy) integer gpl0,gph0,gpl1,gph1,gpl2,gph2 integer destl0,desth0,destl1,desth1,destl2,desth2 integer fregl0,fregh0,fregl1,fregh1,fregl2,fregh2 double precision gpx(gpl0:gph0,gpl1:gph1,gpl2:gph2) double precision gpy(gpl0:gph0,gpl1:gph1,gpl2:gph2) double precision gpz(gpl0:gph0,gpl1:gph1,gpl2:gph2) double precision dest(destl0:desth0,destl1:desth1,destl2:desth2) double precision hx, hy, hz double precision hxm1h, hym1h, hzm1h integer i, j, k integer idummy hxm1h = 0.25d0 / hx hym1h = 0.25d0 / hy hzm1h = 0.25d0 / hz do k = fregl2, fregh2 do j = fregl1, fregh1 do i = fregl0, fregh0 gpx(i,j,k) = hxm1h * (dest(i+1,j,k) + dest(i+1,j+1,k) + & dest(i+1,j,k+1) + dest(i+1,j+1,k+1) - & dest(i,j,k) - dest(i,j+1,k) - & dest(i,j,k+1) - dest(i,j+1,k+1)) gpy(i,j,k) = hym1h * (dest(i,j+1,k) + dest(i+1,j+1,k) + & dest(i,j+1,k+1) + dest(i+1,j+1,k+1) - & dest(i,j,k) - dest(i+1,j,k) - & dest(i,j,k+1) - dest(i+1,j,k+1)) gpz(i,j,k) = hzm1h * (dest(i,j,k+1) + dest(i+1,j,k+1) + & dest(i,j+1,k+1) + dest(i+1,j+1,k+1) - & dest(i,j,k) - dest(i+1,j,k) - & dest(i,j+1,k) - dest(i+1,j+1,k)) end do end do end do end c----------------------------------------------------------------------- subroutine hgdiv( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & uf, vf, wf, & fl0,fh0,fl1,fh1,fl2,fh2, & fregl0,fregh0,fregl1,fregh1,fregl2,fregh2, & hx, hy, hz, idummy, jdummy) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer fregl0,fregh0,fregl1,fregh1,fregl2,fregh2 double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision uf(fl0:fh0,fl1:fh1,fl2:fh2) double precision vf(fl0:fh0,fl1:fh1,fl2:fh2) double precision wf(fl0:fh0,fl1:fh1,fl2:fh2) double precision hx, hy, hz double precision hxm1, hym1, hzm1, fac integer idummy, jdummy integer i, j, k hxm1 = 1.0D0 / hx hym1 = 1.0D0 / hy hzm1 = 1.0D0 / hz fac = 0.25d0 do k = fregl2, fregh2 do j = fregl1, fregh1 do i = fregl0, fregh0 src(i,j,k) = fac * & (hxm1 * (uf(i ,j-1,k-1) - uf(i-1,j-1,k-1) + & uf(i ,j-1,k ) - uf(i-1,j-1,k) + & uf(i ,j ,k-1) - uf(i-1,j ,k-1) + & uf(i ,j ,k ) - uf(i-1,j ,k )) + & hym1 * (vf(i-1,j ,k-1) - vf(i-1,j-1,k-1) + & vf(i-1,j ,k ) - vf(i-1,j-1,k ) + & vf(i ,j ,k-1) - vf(i ,j-1,k-1) + & vf(i ,j ,k ) - vf(i ,j-1,k )) + & hzm1 * (wf(i-1,j-1,k ) - wf(i-1,j-1,k-1) + & wf(i-1,j ,k ) - wf(i-1,j ,k-1) + & wf(i ,j-1,k ) - wf(i ,j-1,k-1) + & wf(i ,j ,k ) - wf(i ,j ,k-1))) end do end do end do end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgfdiv( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & uc, vc, wc, & cl0,ch0,cl1,ch1,cl2,ch2, & uf, vf, wf, & fl0,fh0,fl1,fh1,fl2,fh2, & cregl0,cregh0,cregl1,cregh1,cregl2,cregh2, & hx, hy, hz, ir, jr, kr, idim, idir, i1, i2) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer cl0,ch0,cl1,ch1,cl2,ch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer cregl0,cregh0,cregl1,cregh1,cregl2,cregh2 double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision uc(cl0:ch0,cl1:ch1,cl2:ch2) double precision vc(cl0:ch0,cl1:ch1,cl2:ch2) double precision wc(cl0:ch0,cl1:ch1,cl2:ch2) double precision uf(fl0:fh0,fl1:fh1,fl2:fh2) double precision vf(fl0:fh0,fl1:fh1,fl2:fh2) double precision wf(fl0:fh0,fl1:fh1,fl2:fh2) double precision hx, hy, hz integer ir, jr, kr, idim, idir, i1, i2 double precision hxm1, hym1, hzm1, fac0, fac1, fac, tmp integer i, j, k, iuc, iuf, juc, juf, kuc, kuf, l, m, n if (idim .eq. 0) then i = cregl0 if (idir .eq. 1) then iuc = i - 1 iuf = i * ir else iuc = i iuf = i * ir - 1 end if fac0 = 0.5D0 * ir / (ir + 1.0D0) hxm1 = 1.0D0 / (ir * hx) hym1 = 1.0D0 / (jr * hy) hzm1 = 1.0D0 / (kr * hz) do k = cregl2, cregh2 do j = cregl1, cregh1 src(i*ir,j*jr,k*kr) = fac0 * & (hym1 * (vc(iuc,j ,k ) - vc(iuc,j-1,k ) + & vc(iuc,j ,k-1) - vc(iuc,j-1,k-1)) + & hzm1 * (wc(iuc,j ,k ) - wc(iuc,j ,k-1) + & wc(iuc,j-1,k ) - wc(iuc,j-1,k-1)) - & hxm1 * idir * (uc(iuc,j ,k) + uc(iuc,j ,k-1) + & uc(iuc,j-1,k) + uc(iuc,j-1,k-1))) end do end do fac0 = fac0 / (ir * jr * kr * jr * kr) hxm1 = ir * hxm1 hym1 = jr * hym1 hzm1 = kr * hzm1 i = i * ir do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do k = kr*cregl2, kr*cregh2, kr do j = jr*cregl1, jr*cregh1, jr tmp = hxm1 * idir * & (uf(iuf,j-n ,k-l) + uf(iuf,j-n ,k-l-1) + & uf(iuf,j-n-1,k-l) + uf(iuf,j-n-1,k-l-1) + & uf(iuf,j-n ,k+l) + uf(iuf,j-n ,k+l-1) + & uf(iuf,j-n-1,k+l) + uf(iuf,j-n-1,k+l-1) + & uf(iuf,j+n ,k-l) + uf(iuf,j+n ,k-l-1) + & uf(iuf,j+n-1,k-l) + uf(iuf,j+n-1,k-l-1) + & uf(iuf,j+n ,k+l) + uf(iuf,j+n ,k+l-1) + & uf(iuf,j+n-1,k+l) + uf(iuf,j+n-1,k+l-1)) tmp = tmp + hym1 * & (vf(iuf,j-n,k-l ) - vf(iuf,j-n-1,k-l ) + & vf(iuf,j-n,k-l-1) - vf(iuf,j-n-1,k-l-1) + & vf(iuf,j-n,k+l ) - vf(iuf,j-n-1,k+l ) + & vf(iuf,j-n,k+l-1) - vf(iuf,j-n-1,k+l-1) + & vf(iuf,j+n,k-l ) - vf(iuf,j+n-1,k-l ) + & vf(iuf,j+n,k-l-1) - vf(iuf,j+n-1,k-l-1) + & vf(iuf,j+n,k+l ) - vf(iuf,j+n-1,k+l ) + & vf(iuf,j+n,k+l-1) - vf(iuf,j+n-1,k+l-1)) src(i,j,k) = src(i,j,k) + fac * (tmp + hzm1 * & (wf(iuf,j-n,k-l ) - wf(iuf,j-n ,k-l-1) + & wf(iuf,j-n-1,k-l) - wf(iuf,j-n-1,k-l-1) + & wf(iuf,j-n,k+l ) - wf(iuf,j-n ,k+l-1) + & wf(iuf,j-n-1,k+l) - wf(iuf,j-n-1,k+l-1) + & wf(iuf,j+n,k-l ) - wf(iuf,j+n ,k-l-1) + & wf(iuf,j+n-1,k-l) - wf(iuf,j+n-1,k-l-1) + & wf(iuf,j+n,k+l ) - wf(iuf,j+n ,k+l-1) + & wf(iuf,j+n-1,k+l) - wf(iuf,j+n-1,k+l-1))) end do end do end do end do else if (idim .eq. 1) then j = cregl1 if (idir .eq. 1) then juc = j - 1 juf = j * jr else juc = j juf = j * jr - 1 end if fac0 = 0.5D0 * jr / (jr + 1.0D0) hxm1 = 1.0D0 / (ir * hx) hym1 = 1.0D0 / (jr * hy) hzm1 = 1.0D0 / (kr * hz) do k = cregl2, cregh2 do i = cregl0, cregh0 src(i*ir,j*jr,k*kr) = fac0 * & (hxm1 * (uc(i,juc,k ) - uc(i-1,juc,k ) + & uc(i,juc,k-1) - uc(i-1,juc,k-1)) - & hym1 * idir * (vc(i ,juc,k) + vc(i ,juc,k-1) + & vc(i-1,juc,k) + vc(i-1,juc,k-1)) + & hzm1 * (wc(i ,juc,k) - wc(i ,juc,k-1) + & wc(i-1,juc,k) - wc(i-1,juc,k-1))) end do end do fac0 = fac0 / (ir * jr * kr * ir * kr) hxm1 = ir * hxm1 hym1 = jr * hym1 hzm1 = kr * hzm1 j = j * jr do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do k = kr*cregl2, kr*cregh2, kr do i = ir*cregl0, ir*cregh0, ir tmp = hxm1 * & (uf(i-m,juf,k-l ) - uf(i-m-1,juf,k-l ) + & uf(i-m,juf,k-l-1) - uf(i-m-1,juf,k-l-1) + & uf(i-m,juf,k+l ) - uf(i-m-1,juf,k+l ) + & uf(i-m,juf,k+l-1) - uf(i-m-1,juf,k+l-1) + & uf(i+m,juf,k-l ) - uf(i+m-1,juf,k-l ) + & uf(i+m,juf,k-l-1) - uf(i+m-1,juf,k-l-1) + & uf(i+m,juf,k+l ) - uf(i+m-1,juf,k+l ) + & uf(i+m,juf,k+l-1) - uf(i+m-1,juf,k+l-1)) tmp = tmp + hym1 * idir * & (vf(i-m ,juf,k-l) + vf(i-m ,juf,k-l-1) + & vf(i-m-1,juf,k-l) + vf(i-m-1,juf,k-l-1) + & vf(i-m ,juf,k+l) + vf(i-m ,juf,k+l-1) + & vf(i-m-1,juf,k+l) + vf(i-m-1,juf,k+l-1) + & vf(i+m ,juf,k-l) + vf(i+m ,juf,k-l-1) + & vf(i+m-1,juf,k-l) + vf(i+m-1,juf,k-l-1) + & vf(i+m ,juf,k+l) + vf(i+m ,juf,k+l-1) + & vf(i+m-1,juf,k+l) + vf(i+m-1,juf,k+l-1)) src(i,j,k) = src(i,j,k) + fac * (tmp + hzm1 * & (wf(i-m ,juf,k-l) - wf(i-m ,juf,k-l-1) + & wf(i-m-1,juf,k-l) - wf(i-m-1,juf,k-l-1) + & wf(i-m ,juf,k+l) - wf(i-m ,juf,k+l-1) + & wf(i-m-1,juf,k+l) - wf(i-m-1,juf,k+l-1) + & wf(i+m ,juf,k-l) - wf(i+m ,juf,k-l-1) + & wf(i+m-1,juf,k-l) - wf(i+m-1,juf,k-l-1) + & wf(i+m ,juf,k+l) - wf(i+m ,juf,k+l-1) + & wf(i+m-1,juf,k+l) - wf(i+m-1,juf,k+l-1))) end do end do end do end do else k = cregl2 if (idir .eq. 1) then kuc = k - 1 kuf = k * kr else kuc = k kuf = k * kr - 1 end if fac0 = 0.5D0 * kr / (kr + 1.0D0) hxm1 = 1.0D0 / (ir * hx) hym1 = 1.0D0 / (jr * hy) hzm1 = 1.0D0 / (kr * hz) do j = cregl1, cregh1 do i = cregl0, cregh0 src(i*ir,j*jr,k*kr) = fac0 * & (hxm1 * (uc(i ,j ,kuc) - uc(i-1,j ,kuc) + & uc(i ,j-1,kuc) - uc(i-1,j-1,kuc)) + & hym1 * (vc(i ,j ,kuc) - vc(i ,j-1,kuc) + & vc(i-1,j ,kuc) - vc(i-1,j-1,kuc)) - & hzm1 * idir * (wc(i ,j,kuc) + wc(i ,j-1,kuc) + & wc(i-1,j,kuc) + wc(i-1,j-1,kuc))) end do end do fac0 = fac0 / (ir * jr * kr * ir * jr) hxm1 = ir * hxm1 hym1 = jr * hym1 hzm1 = kr * hzm1 k = k * kr do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do j = jr*cregl1, jr*cregh1, jr do i = ir*cregl0, ir*cregh0, ir tmp = hxm1 * & (uf(i-m,j-n ,kuf) - uf(i-m-1,j-n ,kuf) + & uf(i-m,j-n-1,kuf) - uf(i-m-1,j-n-1,kuf) + & uf(i-m,j+n ,kuf) - uf(i-m-1,j+n ,kuf) + & uf(i-m,j+n-1,kuf) - uf(i-m-1,j+n-1,kuf) + & uf(i+m,j-n ,kuf) - uf(i+m-1,j-n ,kuf) + & uf(i+m,j-n-1,kuf) - uf(i+m-1,j-n-1,kuf) + & uf(i+m,j+n ,kuf) - uf(i+m-1,j+n ,kuf) + & uf(i+m,j+n-1,kuf) - uf(i+m-1,j+n-1,kuf)) tmp = tmp + hym1 * & (vf(i-m ,j-n,kuf) - vf(i-m ,j-n-1,kuf) + & vf(i-m-1,j-n,kuf) - vf(i-m-1,j-n-1,kuf) + & vf(i-m ,j+n,kuf) - vf(i-m ,j+n-1,kuf) + & vf(i-m-1,j+n,kuf) - vf(i-m-1,j+n-1,kuf) + & vf(i+m ,j-n,kuf) - vf(i+m ,j-n-1,kuf) + & vf(i+m-1,j-n,kuf) - vf(i+m-1,j-n-1,kuf) + & vf(i+m ,j+n,kuf) - vf(i+m ,j+n-1,kuf) + & vf(i+m-1,j+n,kuf) - vf(i+m-1,j+n-1,kuf)) src(i,j,k) = src(i,j,k) + fac * (tmp + hzm1 * idir * & (wf(i-m ,j-n,kuf) + wf(i-m ,j-n-1,kuf) + & wf(i-m-1,j-n,kuf) + wf(i-m-1,j-n-1,kuf) + & wf(i-m ,j+n,kuf) + wf(i-m ,j+n-1,kuf) + & wf(i-m-1,j+n,kuf) + wf(i-m-1,j+n-1,kuf) + & wf(i+m ,j-n,kuf) + wf(i+m ,j-n-1,kuf) + & wf(i+m-1,j-n,kuf) + wf(i+m-1,j-n-1,kuf) + & wf(i+m ,j+n,kuf) + wf(i+m ,j+n-1,kuf) + & wf(i+m-1,j+n,kuf) + wf(i+m-1,j+n-1,kuf))) end do end do end do end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgediv( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & uc, vc, wc, & cl0,ch0,cl1,ch1,cl2,ch2, & uf, vf, wf, & fl0,fh0,fl1,fh1,fl2,fh2, & cregl0,cregh0,cregl1,cregh1,cregl2,cregh2, & hx, hy, hz, ir, jr, kr, ga, ivect) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer cl0,ch0,cl1,ch1,cl2,ch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer cregl0,cregh0,cregl1,cregh1,cregl2,cregh2 double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision uc(cl0:ch0,cl1:ch1,cl2:ch2) double precision vc(cl0:ch0,cl1:ch1,cl2:ch2) double precision wc(cl0:ch0,cl1:ch1,cl2:ch2) double precision uf(fl0:fh0,fl1:fh1,fl2:fh2) double precision vf(fl0:fh0,fl1:fh1,fl2:fh2) double precision wf(fl0:fh0,fl1:fh1,fl2:fh2) double precision hx, hy, hz integer ir, jr, kr, ivect(0:2), ga(0:1,0:1,0:1) double precision r3, hxm1, hym1, hzm1, hxm1c, hym1c, hzm1c double precision center, cfac, ffac, fac0, fac1, fac integer ic, jc, kc, if, jf, kf, iuc, iuf, juc, juf, kuc, kuf integer ii, ji, ki, idir, jdir, kdir, l, m, n r3 = ir * jr * kr hxm1c = 1.0D0 / (ir * hx) hym1c = 1.0D0 / (jr * hy) hzm1c = 1.0D0 / (kr * hz) hxm1 = ir * hxm1c hym1 = jr * hym1c hzm1 = kr * hzm1c ic = cregl0 jc = cregl1 kc = cregl2 if = ic * ir jf = jc * jr kf = kc * kr center = 0.0D0 if (ivect(0) .eq. 0) then do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac1 = 1.0D0 / ir ffac = ir cfac = r3 do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) .eq. 1) then kuf = kf + ki - 1 juf = jf + ji - 1 center = center + ffac do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = src(if,jf,kf) + fac * & (hxm1 * & (uf(if-m,juf,kuf) - uf(if-m-1,juf,kuf) + & uf(if+m,juf,kuf) - uf(if+m-1,juf,kuf)) + & hym1 * jdir * & (vf(if-m,juf,kuf) + vf(if-m-1,juf,kuf) + & vf(if+m,juf,kuf) + vf(if+m-1,juf,kuf)) + & hzm1 * kdir * & (wf(if-m,juf,kuf) + wf(if-m-1,juf,kuf) + & wf(if+m,juf,kuf) + wf(if+m-1,juf,kuf))) end do end do else kuc = kc + ki - 1 juc = jc + ji - 1 center = center + cfac do ic = cregl0, cregh0 if = ic * ir src(if,jf,kf) = src(if,jf,kf) + r3 * & (hxm1c * (uc(ic,juc,kuc) - uc(ic-1,juc,kuc)) + & hym1c * jdir * (vc(ic,juc,kuc) + vc(ic-1,juc,kuc)) + & hzm1c * kdir * (wc(ic,juc,kuc) + wc(ic-1,juc,kuc))) end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) - ga(0,ji,1-ki) .eq. 1) then kuf = kf + ki - 1 fac0 = 1.0D0 / (ir * jr) ffac = ir * (jr - 1) center = center + ffac do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = src(if,jf,kf) + fac * & (hxm1 * & (uf(if-m,jf+n,kuf) - uf(if-m-1,jf+n,kuf) + & uf(if-m,jf+n-1,kuf) - uf(if-m-1,jf+n-1,kuf) + & uf(if+m,jf+n,kuf) - uf(if+m-1,jf+n,kuf) + & uf(if+m,jf+n-1,kuf) - uf(if+m-1,jf+n-1,kuf)) + & hym1 * & (vf(if-m,jf+n,kuf) - vf(if-m,jf+n-1,kuf) + & vf(if-m-1,jf+n,kuf) - vf(if-m-1,jf+n-1,kuf) + & vf(if+m,jf+n,kuf) - vf(if+m,jf+n-1,kuf) + & vf(if+m-1,jf+n,kuf) - vf(if+m-1,jf+n-1,kuf)) + & hzm1 * kdir * & (wf(if-m,jf+n,kuf) + wf(if-m,jf+n-1,kuf) + & wf(if-m-1,jf+n,kuf) + wf(if-m-1,jf+n-1,kuf) + & wf(if+m,jf+n,kuf) + wf(if+m,jf+n-1,kuf) + & wf(if+m-1,jf+n,kuf) + wf(if+m-1,jf+n-1,kuf))) end do end do end do end if if (ga(0,ji,ki) - ga(0,1-ji,ki) .eq. 1) then juf = jf + ji - 1 fac0 = 1.0D0 / (ir * kr) ffac = ir * (kr - 1) center = center + ffac do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = src(if,jf,kf) + fac * & (hxm1 * & (uf(if-m,juf,kf+l) - uf(if-m-1,juf,kf+l) + & uf(if-m,juf,kf+l-1) - uf(if-m-1,juf,kf+l-1) + & uf(if+m,juf,kf+l) - uf(if+m-1,juf,kf+l) + & uf(if+m,juf,kf+l-1) - uf(if+m-1,juf,kf+l-1)) + & hym1 * jdir * & (vf(if-m,juf,kf+l) + vf(if-m,juf,kf+l-1) + & vf(if-m-1,juf,kf+l) + vf(if-m-1,juf,kf+l-1) + & vf(if+m,juf,kf+l) + vf(if+m,juf,kf+l-1) + & vf(if+m-1,juf,kf+l) + vf(if+m-1,juf,kf+l-1)) + & hzm1 * & (wf(if-m,juf,kf+l) - wf(if-m,juf,kf+l-1) + & wf(if-m-1,juf,kf+l) - wf(if-m-1,juf,kf+l-1) + & wf(if+m,juf,kf+l) - wf(if+m,juf,kf+l-1) + & wf(if+m-1,juf,kf+l) - wf(if+m-1,juf,kf+l-1))) end do end do end do end if end do end do c weighting do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = src(if,jf,kf) / center end do else if (ivect(1) .eq. 0) then do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac1 = 1.0D0 / jr ffac = jr cfac = r3 do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) .eq. 1) then kuf = kf + ki - 1 iuf = if + ii - 1 center = center + ffac do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = src(if,jf,kf) + fac * & (hxm1 * idir * & (uf(iuf,jf-n,kuf) + uf(iuf,jf-n-1,kuf) + & uf(iuf,jf+n,kuf) + uf(iuf,jf+n-1,kuf)) + & hym1 * & (vf(iuf,jf-n,kuf) - vf(iuf,jf-n-1,kuf) + & vf(iuf,jf+n,kuf) - vf(iuf,jf+n-1,kuf)) + & hzm1 * kdir * & (wf(iuf,jf-n,kuf) + wf(iuf,jf-n-1,kuf) + & wf(iuf,jf+n,kuf) + wf(iuf,jf+n-1,kuf))) end do end do else kuc = kc + ki - 1 iuc = ic + ii - 1 center = center + cfac do jc = cregl1, cregh1 jf = jc * jr src(if,jf,kf) = src(if,jf,kf) + r3 * & (hxm1c * idir * (uc(iuc,jc,kuc) + uc(iuc,jc-1,kuc)) + & hym1c * (vc(iuc,jc,kuc) - vc(iuc,jc-1,kuc)) + & hzm1c * kdir * (wc(iuc,jc,kuc) + wc(iuc,jc-1,kuc))) end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) - ga(ii,0,1-ki) .eq. 1) then kuf = kf + ki - 1 fac0 = 1.0D0 / (ir * jr) ffac = jr * (ir - 1) center = center + ffac do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = src(if,jf,kf) + fac * & (hxm1 * & (uf(if+m,jf-n,kuf) - uf(if+m-1,jf-n,kuf) + & uf(if+m,jf-n-1,kuf) - uf(if+m-1,jf-n-1,kuf) + & uf(if+m,jf+n,kuf) - uf(if+m-1,jf+n,kuf) + & uf(if+m,jf+n-1,kuf) - uf(if+m-1,jf+n-1,kuf)) + & hym1 * & (vf(if+m,jf-n,kuf) - vf(if+m,jf-n-1,kuf) + & vf(if+m-1,jf-n,kuf) - vf(if+m-1,jf-n-1,kuf) + & vf(if+m,jf+n,kuf) - vf(if+m,jf+n-1,kuf) + & vf(if+m-1,jf+n,kuf) - vf(if+m-1,jf+n-1,kuf)) + & hzm1 * kdir * & (wf(if+m,jf-n,kuf) + wf(if+m,jf-n-1,kuf) + & wf(if+m-1,jf-n,kuf) + wf(if+m-1,jf-n-1,kuf) + & wf(if+m,jf+n,kuf) + wf(if+m,jf+n-1,kuf) + & wf(if+m-1,jf+n,kuf) + wf(if+m-1,jf+n-1,kuf))) end do end do end do end if if (ga(ii,0,ki) - ga(1-ii,0,ki) .eq. 1) then iuf = if + ii - 1 fac0 = 1.0D0 / (jr * kr) ffac = jr * (kr - 1) center = center + ffac do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = src(if,jf,kf) + fac * & (hxm1 * idir * & (uf(iuf,jf-n,kf+l) + uf(iuf,jf-n-1,kf+l) + & uf(iuf,jf-n,kf+l-1) + uf(iuf,jf-n-1,kf+l-1) + & uf(iuf,jf+n,kf+l) + uf(iuf,jf+n-1,kf+l) + & uf(iuf,jf+n,kf+l-1) + uf(iuf,jf+n-1,kf+l-1)) + & hym1 * & (vf(iuf,jf-n,kf+l) - vf(iuf,jf-n-1,kf+l) + & vf(iuf,jf-n,kf+l-1) - vf(iuf,jf-n-1,kf+l-1) + & vf(iuf,jf+n,kf+l) - vf(iuf,jf+n-1,kf+l) + & vf(iuf,jf+n,kf+l-1) - vf(iuf,jf+n-1,kf+l-1)) + & hzm1 * & (wf(iuf,jf-n,kf+l) - wf(iuf,jf-n,kf+l-1) + & wf(iuf,jf-n-1,kf+l) - wf(iuf,jf-n-1,kf+l-1) + & wf(iuf,jf+n,kf+l) - wf(iuf,jf+n,kf+l-1) + & wf(iuf,jf+n-1,kf+l) - wf(iuf,jf+n-1,kf+l-1))) end do end do end do end if end do end do c weighting do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = src(if,jf,kf) / center end do else do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac1 = 1.0D0 / kr ffac = kr cfac = r3 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) .eq. 1) then juf = jf + ji - 1 iuf = if + ii - 1 center = center + ffac do l = 0, kr-1 fac = (kr-l) * fac1 if (l .eq. 0) fac = 0.5D0 * fac do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = src(if,jf,kf) + fac * & (hxm1 * idir * & (uf(iuf,juf,kf-l) + uf(iuf,juf,kf-l-1) + & uf(iuf,juf,kf+l) + uf(iuf,juf,kf+l-1)) + & hym1 * jdir * & (vf(iuf,juf,kf-l) + vf(iuf,juf,kf-l-1) + & vf(iuf,juf,kf+l) + vf(iuf,juf,kf+l-1)) + & hzm1 * & (wf(iuf,juf,kf-l) - wf(iuf,juf,kf-l-1) + & wf(iuf,juf,kf+l) - wf(iuf,juf,kf+l-1))) end do end do else juc = jc + ji - 1 iuc = ic + ii - 1 center = center + cfac do kc = cregl2, cregh2 kf = kc * kr src(if,jf,kf) = src(if,jf,kf) + r3 * & (hxm1c * idir * (uc(iuc,juc,kc) + uc(iuc,juc,kc-1)) + & hym1c * jdir * (vc(iuc,juc,kc) + vc(iuc,juc,kc-1)) + & hzm1c * (wc(iuc,juc,kc) - wc(iuc,juc,kc-1))) end do end if end do end do c faces c each face is two faces and two sides of an edge do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) - ga(ii,1-ji,0) .eq. 1) then juf = jf + ji - 1 fac0 = 1.0D0 / (ir * kr) ffac = kr * (ir - 1) center = center + ffac do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = src(if,jf,kf) + fac * & (hxm1 * & (uf(if+m,juf,kf-l) - uf(if+m-1,juf,kf-l) + & uf(if+m,juf,kf-l-1) - uf(if+m-1,juf,kf-l-1) + & uf(if+m,juf,kf+l) - uf(if+m-1,juf,kf+l) + & uf(if+m,juf,kf+l-1) - uf(if+m-1,juf,kf+l-1)) + & hym1 * jdir * & (vf(if+m,juf,kf-l) + vf(if+m,juf,kf-l-1) + & vf(if+m-1,juf,kf-l) + vf(if+m-1,juf,kf-l-1) + & vf(if+m,juf,kf+l) + vf(if+m,juf,kf+l-1) + & vf(if+m-1,juf,kf+l) + vf(if+m-1,juf,kf+l-1)) + & hzm1 * & (wf(if+m,juf,kf-l) - wf(if+m,juf,kf-l-1) + & wf(if+m-1,juf,kf-l) - wf(if+m-1,juf,kf-l-1) + & wf(if+m,juf,kf+l) - wf(if+m,juf,kf+l-1) + & wf(if+m-1,juf,kf+l) - wf(if+m-1,juf,kf+l-1))) end do end do end do end if if (ga(ii,ji,0) - ga(1-ii,ji,0) .eq. 1) then iuf = if + ii - 1 fac0 = 1.0D0 / (jr * kr) ffac = kr * (jr - 1) center = center + ffac do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = src(if,jf,kf) + fac * & (hxm1 * idir * & (uf(iuf,jf+n,kf-l) + uf(iuf,jf+n-1,kf-l) + & uf(iuf,jf+n,kf-l-1) + uf(iuf,jf+n-1,kf-l-1) + & uf(iuf,jf+n,kf+l) + uf(iuf,jf+n-1,kf+l) + & uf(iuf,jf+n,kf+l-1) + uf(iuf,jf+n-1,kf+l-1)) + & hym1 * & (vf(iuf,jf+n,kf-l) - vf(iuf,jf+n-1,kf-l) + & vf(iuf,jf+n,kf-l-1) - vf(iuf,jf+n-1,kf-l-1) + & vf(iuf,jf+n,kf+l) - vf(iuf,jf+n-1,kf+l) + & vf(iuf,jf+n,kf+l-1) - vf(iuf,jf+n-1,kf+l-1)) + & hzm1 * & (wf(iuf,jf+n,kf-l) - wf(iuf,jf+n,kf-l-1) + & wf(iuf,jf+n-1,kf-l) - wf(iuf,jf+n-1,kf-l-1) + & wf(iuf,jf+n,kf+l) - wf(iuf,jf+n,kf+l-1) + & wf(iuf,jf+n-1,kf+l) - wf(iuf,jf+n-1,kf+l-1))) end do end do end do end if end do end do c weighting do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = src(if,jf,kf) / center end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgcdiv( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & uc, vc, wc, & cl0,ch0,cl1,ch1,cl2,ch2, & uf, vf, wf, & fl0,fh0,fl1,fh1,fl2,fh2, & cregl0,cregh0,cregl1,cregh1,cregl2,cregh2, & hx, hy, hz, ir, jr, kr, ga, ijnk) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer cl0,ch0,cl1,ch1,cl2,ch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer cregl0,cregh0,cregl1,cregh1,cregl2,cregh2 double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision uc(cl0:ch0,cl1:ch1,cl2:ch2) double precision vc(cl0:ch0,cl1:ch1,cl2:ch2) double precision wc(cl0:ch0,cl1:ch1,cl2:ch2) double precision uf(fl0:fh0,fl1:fh1,fl2:fh2) double precision vf(fl0:fh0,fl1:fh1,fl2:fh2) double precision wf(fl0:fh0,fl1:fh1,fl2:fh2) double precision hx, hy, hz integer ir, jr, kr, ga(0:1,0:1,0:1),ijnk(3) double precision r3, hxm1, hym1, hzm1, hxm1c, hym1c, hzm1c double precision sum, center, cfac, ffac, fac0, fac1, fac integer ic, jc, kc, if, jf, kf, iuc, iuf, juc, juf, kuc, kuf integer ii, ji, ki, idir, jdir, kdir, l, m, n r3 = ir * jr * kr hxm1c = 1.0D0 / (ir * hx) hym1c = 1.0D0 / (jr * hy) hzm1c = 1.0D0 / (kr * hz) hxm1 = ir * hxm1c hym1 = jr * hym1c hzm1 = kr * hzm1c ic = cregl0 jc = cregl1 kc = cregl2 if = ic * ir jf = jc * jr kf = kc * kr sum = 0.0D0 center = 0.0D0 c octants fac = 1.0D0 ffac = 0.5D0 cfac = 0.5D0 * r3 do ki = 0, 1 kdir = 2 * ki - 1 kuf = kf + ki - 1 kuc = kc + ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 juf = jf + ji - 1 juc = jc + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) .eq. 1) then iuf = if + ii - 1 center = center + ffac sum = sum + fac * & (hxm1 * idir * uf(iuf,juf,kuf) + & hym1 * jdir * vf(iuf,juf,kuf) + & hzm1 * kdir * wf(iuf,juf,kuf)) else iuc = ic + ii - 1 center = center + cfac sum = sum + r3 * & (hxm1c * idir * uc(iuc,juc,kuc) + & hym1c * jdir * vc(iuc,juc,kuc) + & hzm1c * kdir * wc(iuc,juc,kuc)) end if end do end do end do c faces do ki = 0, 1 kdir = 2 * ki - 1 kuf = kf + ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 juf = jf + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 iuf = if + ii - 1 if (ga(ii,ji,ki) - ga(ii,ji,1-ki) .eq. 1) then fac0 = 1.0D0 / (ir * jr) ffac = 0.5D0 * (ir-1) * (jr-1) center = center + ffac do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * (hxm1 * & (uf(if+m,jf+n,kuf) - uf(if+m-1,jf+n,kuf) + & uf(if+m,jf+n-1,kuf) - uf(if+m-1,jf+n-1,kuf)) + & hym1 * & (vf(if+m,jf+n,kuf) - vf(if+m,jf+n-1,kuf) + & vf(if+m-1,jf+n,kuf) - vf(if+m-1,jf+n-1,kuf)) + & hzm1 * kdir * & (wf(if+m,jf+n,kuf) + wf(if+m,jf+n-1,kuf) + & wf(if+m-1,jf+n,kuf) + wf(if+m-1,jf+n-1,kuf))) end do end do end if if (ga(ii,ji,ki) - ga(ii,1-ji,ki) .eq. 1) then fac0 = 1.0D0 / (ir * kr) ffac = 0.5D0 * (ir-1) * (kr-1) center = center + ffac do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * (hxm1 * & (uf(if+m,juf,kf+l) - uf(if+m-1,juf,kf+l) + & uf(if+m,juf,kf+l-1) - uf(if+m-1,juf,kf+l-1)) + & hym1 * jdir * & (vf(if+m,juf,kf+l) + vf(if+m,juf,kf+l-1) + & vf(if+m-1,juf,kf+l) + vf(if+m-1,juf,kf+l-1)) + & hzm1 * & (wf(if+m,juf,kf+l) - wf(if+m,juf,kf+l-1) + & wf(if+m-1,juf,kf+l) - wf(if+m-1,juf,kf+l-1))) end do end do end if if (ga(ii,ji,ki) - ga(1-ii,ji,ki) .eq. 1) then fac0 = 1.0D0 / (jr * kr) ffac = 0.5D0 * (jr-1) * (kr-1) center = center + ffac do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * (hxm1 * idir * & (uf(iuf,jf+n,kf+l) + uf(iuf,jf+n,kf+l-1) + & uf(iuf,jf+n-1,kf+l) + uf(iuf,jf+n-1,kf+l-1)) + & hym1 * & (vf(iuf,jf+n,kf+l) - vf(iuf,jf+n-1,kf+l) + & vf(iuf,jf+n,kf+l-1) - vf(iuf,jf+n-1,kf+l-1)) + & hzm1 * & (wf(iuf,jf+n,kf+l) - wf(iuf,jf+n,kf+l-1) + & wf(iuf,jf+n-1,kf+l) - wf(iuf,jf+n-1,kf+l-1))) end do end do end if end do end do end do c edges do ki = 0, 1 kdir = 2 * ki - 1 kuf = kf + ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 juf = jf + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 iuf = if + ii - 1 if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(ii,1-ji,ki), ga(ii,1-ji,1-ki)) & .eq. 1) then fac1 = 1.0D0 / ir ffac = 0.5D0 * (ir-1) center = center + ffac do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * (hxm1 * & (uf(if+m,juf,kuf) - uf(if+m-1,juf,kuf)) + & hym1 * jdir * & (vf(if+m,juf,kuf) + vf(if+m-1,juf,kuf)) + & hzm1 * kdir * & (wf(if+m,juf,kuf) + wf(if+m-1,juf,kuf))) end do end if if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(1-ii,ji,ki), ga(1-ii,ji,1-ki)) & .eq. 1) then fac1 = 1.0D0 / jr ffac = 0.5D0 * (jr-1) center = center + ffac do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * (hxm1 * idir * & (uf(iuf,jf+n,kuf) + uf(iuf,jf+n-1,kuf)) + & hym1 * & (vf(iuf,jf+n,kuf) - vf(iuf,jf+n-1,kuf)) + & hzm1 * kdir * & (wf(iuf,jf+n,kuf) + wf(iuf,jf+n-1,kuf))) end do end if if (ga(ii,ji,ki) - & min(ga(ii,1-ji,ki), ga(1-ii,ji,ki), ga(1-ii,1-ji,ki)) & .eq. 1) then fac1 = 1.0D0 / kr ffac = 0.5D0 * (kr-1) center = center + ffac do l = kdir, kdir*(kr-1), kdir fac = (kr-abs(l)) * fac1 sum = sum + fac * (hxm1 * idir * & (uf(iuf,juf,kf+l) + uf(iuf,juf,kf+l-1)) + & hym1 * jdir * & (vf(iuf,juf,kf+l) + vf(iuf,juf,kf+l-1)) + & hzm1 * & (wf(iuf,juf,kf+l) - wf(iuf,juf,kf+l-1))) end do end if end do end do end do c weighting src(if,jf,kf) = sum / center end ccseapps-2.5/CCSEApps/hgproj/hg_projector.cpp0000644000175000017500000023030611634153073022345 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include "hg_projector.H" #if defined( BL_FORT_USE_UNDERSCORE ) #define FORT_HGDIV hgdiv_ #define FORT_HGDIV_DENSE hgdiv_dense_ #define FORT_HGFDIV hgfdiv_ #define FORT_HGFDIV_DENSE hgfdiv_dense_ #define FORT_HGEDIV hgediv_ #define FORT_HGEDIV_DENSE hgediv_dense_ #define FORT_HGCDIV hgcdiv_ #define FORT_HGCDIV_DENSE hgcdiv_dense_ #define FORT_HGVORT hgvort_ #define FORT_HGVORT_DENSE hgvort_dense_ #define FORT_HGFVORT hgfvort_ #define FORT_HGFVORT_DENSE hgfvort_dense_ #define FORT_HGEVORT hgevort_ #define FORT_HGEVORT_DENSE hgevort_dense_ #define FORT_HGCVORT hgcvort_ #define FORT_HGCVORT_DENSE hgcvort_dense_ #define FORT_HGGRAD hggrad_ #define FORT_HGGRAD_DENSE hggrad_dense_ #define FORT_HGAVG hgavg_ #define FORT_HGFAVG hgfavg_ #define FORT_HGEAVG hgeavg_ #define FORT_HGCAVG hgcavg_ #elif defined( BL_FORT_USE_UPPERCASE ) #define FORT_HGDIV HGDIV #define FORT_HGDIV_DENSE HGDIV_DENSE #define FORT_HGFDIV HGFDIV #define FORT_HGFDIV_DENSE HGFDIV_DENSE #define FORT_HGEDIV HGEDIV #define FORT_HGEDIV_DENSE HGEDIV_DENSE #define FORT_HGCDIV HGCDIV #define FORT_HGCDIV_DENSE HGCDIV_DENSE #define FORT_HGVORT HGVORT #define FORT_HGVORT_DENSE HGVORT_DENSE #define FORT_HGFVORT HGFVORT #define FORT_HGFVORT_DENSE HGFVORT_DENSE #define FORT_HGEVORT HGEVORT #define FORT_HGEVORT_DENSE HGEVORT_DENSE #define FORT_HGCVORT HGCVORT #define FORT_HGCVORT_DENSE HGCVORT_DENSE #define FORT_HGGRAD HGGRAD #define FORT_HGGRAD_DENSE HGGRAD_DENSE #define FORT_HGAVG HGAVG #define FORT_HGFAVG HGFAVG #define FORT_HGEAVG HGEAVG #define FORT_HGCAVG HGCAVG #elif defined( BL_FORT_USE_LOWERCASE ) #define FORT_HGDIV hgdiv #define FORT_HGDIV_DENSE hgdiv_dense #define FORT_HGFDIV hgfdiv #define FORT_HGFDIV_DENSE hgfdiv_dense #define FORT_HGEDIV hgediv #define FORT_HGEDIV_DENSE hgediv_dense #define FORT_HGCDIV hgcdiv #define FORT_HGCDIV_DENSE hgcdiv_dense #define FORT_HGVORT hgdiv #define FORT_HGVORT_DENSE hgdiv_dense #define FORT_HGFVORT hgfdiv #define FORT_HGFVORT_DENSE hgfdiv_dense #define FORT_HGEVORT hgediv #define FORT_HGEVORT_DENSE hgediv_dense #define FORT_HGCVORT hgcdiv #define FORT_HGCVORT_DENSE hgcdiv_dense #define FORT_HGGRAD hggrad #define FORT_HGGRAD_DENSE hggrad_dense #define FORT_HGAVG hgavg #define FORT_HGFAVG hgfavg #define FORT_HGEAVG hgeavg #define FORT_HGCAVG hgcavg #else #error "none of BL_FORT_USE_{UNDERSCORE,UPPERCASE,LOWERCASE} defined" #endif extern "C" { #if (BL_SPACEDIM == 1) #error not relevant #endif void FORT_HGGRAD_DENSE (RealPS, intS, const Real*, intS, intS, CRealPS, const int*); void FORT_HGGRAD (RealPS, intS, const Real*, intS, intS, CRealPS, const int*); void FORT_HGDIV (Real*, intS, CRealPS, intS, intS, CRealPS, const int*, const int*); void FORT_HGDIV_DENSE (Real*, intS, CRealPS, intS, intS, CRealPS, const int*, const int*); void FORT_HGFDIV (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*, const int*, const int*); void FORT_HGFDIV_DENSE (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*, const int*, const int*); void FORT_HGEDIV (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGEDIV_DENSE (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGCDIV (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGCDIV_DENSE (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*); #if (BL_SPACEDIM == 2) void FORT_HGVORT (Real*, intS, CRealPS, intS, intS, CRealPS, const int*, const int*); void FORT_HGVORT_DENSE (Real*, intS, CRealPS, intS, intS, CRealPS, const int*, const int*); void FORT_HGFVORT (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*, const int*, const int*); void FORT_HGFVORT_DENSE (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*, const int*, const int*); void FORT_HGEVORT (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGEVORT_DENSE (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGCVORT (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGCVORT_DENSE (Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*); void FORT_HGAVG (Real*, intS, const Real*, intS, intS, const Real*, const int*, const int*, const int*); void FORT_HGFAVG (Real*, intS, const Real*, intS, const Real*, intS, intS, intRS, const int*, const int*, const Real*, const int*, const int*, const int*); void FORT_HGCAVG (Real*, intS, const Real*, intS, const Real*, intS, intS, intRS, const int*, const int*, const Real*, const int*, const int*, const int*); #elif (BL_SPACEDIM == 3) void FORT_HGAVG (Real*, intS, const Real*, intS, intS); void FORT_HGFAVG (Real*, intS, const Real*, intS, const Real*, intS, intS, intRS, const int*, const int*); void FORT_HGEAVG (Real*, intS, const Real*, intS, const Real*, intS, intS, intRS, const int*, const int*); void FORT_HGCAVG (Real*, intS, const Real*, intS, const Real*, intS, intS, intRS, const int*, const int*); #endif } extern "C" { #if BL_SPACEDIM==2 typedef void (*FECAVG)(Real*, intS, const Real*, intS, const Real*, intS, intS, intRS, const int*, const int*, const Real*, const int*, const int*, const int*); #else typedef void (*FECAVG)(Real*, intS, const Real*, intS, const Real*, intS, intS, intRS, const int*, const int*); #endif } class task_fecavg : public task_fec_base { public: task_fecavg (FECAVG f_, task_list& tl_, MultiFab& s_, const MultiFab& S_, int igrid_, task_fab* tf_, const Box& creg_, const IntVect& rat_, int idim_, int idir_ #if BL_SPACEDIM == 2 , Real hx_, int isRZ_, int imax_, int idense_ #endif ); virtual bool ready (); private: void doit (); FECAVG f; const MultiFab& S; const Box creg; const IntVect rat; const int idim; const int idir; #if BL_SPACEDIM == 2 const Real hx; const int isRZ; const int imax; const int idense; #endif }; task_fecavg::task_fecavg (FECAVG f_, task_list& tl_, MultiFab& s_, const MultiFab& S_, int igrid_, task_fab* tf_, const Box& creg_, const IntVect& rat_, int idim_, int idir_ #if BL_SPACEDIM == 2 , Real hx_, int isRZ_, int imax_, int idense_ #endif ) : task_fec_base(tl_, s_, igrid_), f(f_), S(S_), creg(creg_), rat(rat_), idim(idim_), idir(idir_) #if BL_SPACEDIM == 2 , hx(hx_), isRZ(isRZ_), imax(imax_), idense(idense_) #endif { push_back(tf_); if (is_local_target() && dependencies.empty()) doit(); } bool task_fecavg::ready () { BL_ASSERT(!m_finished); if (is_local_target()) doit(); return true; } void task_fecavg::doit () { BL_ASSERT(!m_finished); BL_ASSERT(is_local_target()); BL_ASSERT(dependencies.empty()); m_finished = true; const int igrid = grid_number(); FArrayBox& sfab = target_fab(); const Box& sfab_box = sfab.box(); const FArrayBox& cfab = task_fab_result(0); const Box& cfab_box = cfab.box(); const FArrayBox& Sfab = S[igrid]; const Box& Sfab_box = Sfab.box(); (*f)(sfab.dataPtr(), DIMLIST(sfab_box), cfab.dataPtr(), DIMLIST(cfab_box), Sfab.dataPtr(), DIMLIST(Sfab_box), DIMLIST(creg), D_DECL(rat[0], rat[1], rat[2]), &idim, &idir #if BL_SPACEDIM == 2 , &hx, &isRZ, &imax, &idense #endif ); } class task_fecavg_2 : public task_fec_base { public: task_fecavg_2 (FECAVG f_, task_list& tl_, MultiFab& s_, int igrid_, task_fab* Sfp_, task_fab* Scp_, const Box& creg_, const IntVect& rat_, const Array& ga_, const IntVect& t_ #if BL_SPACEDIM==2 , Real hx_, int isRZ_, int imax_, int idense_ #endif ); virtual bool ready (); private: void doit (); FECAVG f; const Box creg; const IntVect rat; const IntVect t; const Array ga; #if BL_SPACEDIM == 2 const Real hx; const int isRZ; const int imax; const int idense; #endif }; task_fecavg_2::task_fecavg_2 (FECAVG f_, task_list& tl_, MultiFab& s_, int igrid_, task_fab* Sfp_, task_fab* Scp_, const Box& creg_, const IntVect& rat_, const Array& ga_, const IntVect& t_ #if BL_SPACEDIM==2 , Real hx_, int isRZ_, int imax_, int idense_ #endif ) : task_fec_base(tl_, s_, igrid_), f(f_), creg(creg_), rat(rat_), t(t_), ga(ga_) #if BL_SPACEDIM == 2 , hx(hx_), isRZ(isRZ_), imax(imax_) , idense(idense_) #endif { push_back(Sfp_); push_back(Scp_); if (is_local_target() && dependencies.empty()) doit(); } bool task_fecavg_2::ready () { BL_ASSERT(!m_finished); if (is_local_target()) doit(); return true; } void task_fecavg_2::doit () { BL_ASSERT(!m_finished); BL_ASSERT(is_local_target()); BL_ASSERT(dependencies.empty()); m_finished = true; const int igrid = grid_number(); FArrayBox& sfab = target_fab(); const Box& sfab_box = sfab.box(); const FArrayBox& Sf_fab = task_fab_result(0); const Box& Sf_fab_box = Sf_fab.box(); const FArrayBox& Sc_fab = task_fab_result(1); const Box& Sc_fab_box = Sc_fab.box(); (*f)(sfab.dataPtr(), DIMLIST(sfab_box), Sc_fab.dataPtr(), DIMLIST(Sc_fab_box), Sf_fab.dataPtr(), DIMLIST(Sf_fab_box), DIMLIST(creg), D_DECL( rat[0], rat[1], rat[2]), ga.dataPtr(), t.getVect() #if BL_SPACEDIM == 2 , &hx, &isRZ, &imax, &idense #endif ); } extern "C" { typedef void (*F_FDIV)(Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*, const int*, const int *); } class task_fdiv : public task_fec_base { public: task_fdiv (F_FDIV f_, task_list& tl_, MultiFab& s_, MultiFab* upt_[], int igrid_, task_fab* ucp_[], const Box& creg_, const Real* h_, const IntVect& rat_, int idim_, int idir_ , int isRZ_, int imax_ ); virtual ~task_fdiv (); virtual bool ready (); private: void doit (); const F_FDIV f; MultiFab* upt[BL_SPACEDIM]; const Box creg; Real h[BL_SPACEDIM]; const IntVect rat; const int idim; const int idir; const int isRZ; const int imax; }; task_fdiv::task_fdiv (F_FDIV f_, task_list& tl_, MultiFab& s_, MultiFab* upt_[], int igrid_, task_fab* ucp_[], const Box& creg_, const Real* h_, const IntVect& rat_, int idim_, int idir_, int isRZ_, int imax_ ) : task_fec_base(tl_, s_, igrid_), f(f_), creg(creg_), rat(rat_), idim(idim_), idir(idir_), isRZ(isRZ_), imax(imax_) { for (int i = 0; i < BL_SPACEDIM; ++i) { upt[i] = upt_[i]; push_back(ucp_[i]); h[i] = h_[i]; } if (is_local_target() && dependencies.empty()) doit(); } bool task_fdiv::ready () { BL_ASSERT(!m_finished); if (is_local_target()) doit(); return true; } void task_fdiv::doit () { BL_ASSERT(!m_finished); BL_ASSERT(is_local_target()); BL_ASSERT(dependencies.empty()); m_finished = true; const int igrid = grid_number(); FArrayBox& s = target_fab(); const Box& s_box = target_fab().box(); const Real* up[BL_SPACEDIM] = { D_DECL(upt[0]->operator[](igrid).dataPtr(), upt[1]->operator[](igrid).dataPtr(), upt[2]->operator[](igrid).dataPtr() ) }; const Box& up_box = upt[0]->operator[](igrid).box(); const Real* uc[BL_SPACEDIM] = { D_DECL(task_fab_result(0).dataPtr(), task_fab_result(1).dataPtr(), task_fab_result(2).dataPtr() ) }; const Box& uc_box = task_fab_result(0).box(); (*f)(s.dataPtr(), DIMLIST(s_box), D_DECL( uc[0], uc[1], uc[2]), DIMLIST(uc_box), D_DECL(up[0], up[1], up[2]), DIMLIST(up_box), DIMLIST(creg), D_DECL(&h[0], &h[1], &h[2]), D_DECL(rat[0], rat[1], rat[2]), &idim, &idir, &isRZ, &imax); } task_fdiv::~task_fdiv () {} extern "C" { typedef void (*EDIV)(Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*); } class task_ediv : public task_fec_base { public: task_ediv (EDIV f_, task_list& tl_, MultiFab& s_, int igrid_, task_fab* ufp_[], task_fab* ucp_[], const Box& creg_, const Real* h_, const IntVect& rat_, const Array& ga_, const IntVect& t_ = IntVect()); virtual bool ready (); private: void doit (); EDIV f; const Box creg; Real h[BL_SPACEDIM]; const IntVect rat; const Array ga; const IntVect t; }; task_ediv::task_ediv (EDIV f_, task_list& tl_, MultiFab& s_, int igrid_, task_fab* ufp_[], task_fab* ucp_[], const Box& creg_, const Real* h_, const IntVect& rat_, const Array& ga_, const IntVect& t_) : task_fec_base(tl_, s_, igrid_), f(f_), creg(creg_), rat(rat_), ga(ga_), t(t_) { for (int i = 0; i < BL_SPACEDIM; ++i) { push_back(ucp_[i]); } for (int i = 0; i < BL_SPACEDIM; ++i) { push_back(ufp_[i]); h[i] = h_[i]; } if (is_local_target() && dependencies.empty()) doit(); } bool task_ediv::ready () { BL_ASSERT(!m_finished); if (is_local_target()) doit(); return true; } void task_ediv::doit () { BL_ASSERT(!m_finished); BL_ASSERT(is_local_target()); BL_ASSERT(dependencies.empty()); m_finished = true; const int igrid = grid_number(); FArrayBox& s = target_fab(); const Box& s_box = target_fab().box(); const Real* uf[BL_SPACEDIM] = { D_DECL( task_fab_result(BL_SPACEDIM).dataPtr(), task_fab_result(BL_SPACEDIM+1).dataPtr(), task_fab_result(BL_SPACEDIM+2).dataPtr() ) }; const Box& uf_box = task_fab_result(BL_SPACEDIM).box(); const Real* uc[BL_SPACEDIM] = { D_DECL( task_fab_result(0).dataPtr(), task_fab_result(1).dataPtr(), task_fab_result(2).dataPtr() ) }; const Box& uc_box = task_fab_result(0).box(); (*f)(s.dataPtr(), DIMLIST(s_box), D_DECL( uc[0], uc[1], uc[2]), DIMLIST(uc_box), D_DECL(uf[0], uf[1], uf[2]), DIMLIST(uf_box), DIMLIST(creg), D_DECL(&h[0], &h[1], &h[2]), D_DECL(rat[0], rat[1], rat[2]), ga.dataPtr(), t.getVect()); } extern "C" { typedef void (*CDIV)(Real*, intS, CRealPS, intS, CRealPS, intS, intS, CRealPS, intRS, const int*, const int*); } class task_cdiv : public task_fec_base { public: task_cdiv (CDIV f_, task_list& tl_, MultiFab& s_, int igrid_, task_fab* ufp_[], task_fab* ucp_[], const Box& creg_, const Real* h_, const IntVect& rat_, const Array& ga_, int isrz_); virtual bool ready (); private: void doit (); CDIV f; const Box creg; Real h[BL_SPACEDIM]; const IntVect rat; const Array ga; int isrz; }; task_cdiv::task_cdiv (CDIV f_, task_list& tl_, MultiFab& s_, int igrid_, task_fab* ufp_[], task_fab* ucp_[], const Box& creg_, const Real* h_, const IntVect& rat_, const Array& ga_, int isrz_) : task_fec_base(tl_, s_, igrid_), f(f_), creg(creg_), rat(rat_), ga(ga_), isrz(isrz_) { for (int i = 0; i < BL_SPACEDIM; ++i) { push_back(ucp_[i]); } for (int i = 0; i < BL_SPACEDIM; ++i) { push_back(ufp_[i]); h[i] = h_[i]; } if (is_local_target() && dependencies.empty()) doit(); } bool task_cdiv::ready () { BL_ASSERT(!m_finished); if (is_local_target()) doit(); return true; } void task_cdiv::doit () { BL_ASSERT(!m_finished); BL_ASSERT(is_local_target()); BL_ASSERT(dependencies.empty()); m_finished = true; const int igrid = grid_number(); FArrayBox& s = target_fab(); const Box& s_box = target_fab().box(); const Real* uf[BL_SPACEDIM] = { D_DECL( task_fab_result(BL_SPACEDIM).dataPtr(), task_fab_result(BL_SPACEDIM+1).dataPtr(), task_fab_result(BL_SPACEDIM+2).dataPtr() ) }; const Box& uf_box = task_fab_result(BL_SPACEDIM).box(); const Real* uc[BL_SPACEDIM] = { D_DECL( task_fab_result(0).dataPtr(), task_fab_result(1).dataPtr(), task_fab_result(2).dataPtr() ) }; const Box& uc_box = task_fab_result(0).box(); (*f)(s.dataPtr(), DIMLIST(s_box), D_DECL(uc[0], uc[1], uc[2]), DIMLIST(uc_box), D_DECL(uf[0], uf[1], uf[2]), DIMLIST(uf_box), DIMLIST(creg), D_DECL(&h[0], &h[1], &h[2]), D_DECL(rat[0], rat[1], rat[2]), ga.dataPtr(), &isrz); } PArray null_amr_real; holy_grail_amr_projector::holy_grail_amr_projector (const Array& Mesh, const Array& Gen_ratio, const Box& fdomain, int Lev_min_min, int Lev_min_max, int Lev_max_max, const amr_fluid_boundary& Boundary, stencil stencil_, int Pcode) : holy_grail_amr_multigrid(Mesh, Gen_ratio, fdomain, Lev_min_min, Lev_min_max, Lev_max_max, Boundary, stencil_, Pcode), make_sparse_node_source_solvable(false) {} const Array& holy_grail_amr_projector::mesh () const { return ml_mesh; } void holy_grail_amr_projector::make_it_so () { make_sparse_node_source_solvable = true; } void holy_grail_amr_projector::project (PArray* u, PArray& p, PArray& Coarse_source, MultiFab* Sync_resid_crse, MultiFab* Sync_resid_fine, const Geometry& crse_geom, Real H[], Real tol, int Lev_min, int Lev_max, Real scale) { project(u, p, Coarse_source, null_amr_real, Sync_resid_crse, Sync_resid_fine, crse_geom, H, tol, Lev_min, Lev_max, scale); } void holy_grail_amr_projector::project (PArray* u, PArray& p, PArray& Coarse_source, PArray& Sigma, MultiFab* Sync_resid_crse, MultiFab* Sync_resid_fine, const Geometry& crse_geom, Real H[], Real tol, int Lev_min, int Lev_max, Real scale) { Box crse_domain(crse_geom.Domain()); PArray rhs_local_crse(Lev_max+1, PArrayManage); PArray rhs_local_fine(Lev_max+1, PArrayManage); if (Lev_min < 0) Lev_min = lev_min_max; if (Lev_max < 0) Lev_max = Lev_min; BL_ASSERT(Sigma.size() > 0); if (u) { BL_ASSERT(u[ 0 ][Lev_min].nGrow() == 1); BL_ASSERT(u[ 1 ][Lev_min].nGrow() == 1); BL_ASSERT(u[BL_SPACEDIM-1][Lev_min].nGrow() == 1); } PArray u_local_crse[BL_SPACEDIM]; PArray u_local_fine[BL_SPACEDIM]; PArray Sigma_local(Lev_max+1, PArrayManage); const inviscid_fluid_boundary* ifbc = dynamic_cast(&boundary); BL_ASSERT(ifbc != 0); if (Sync_resid_crse != 0) { int level = Lev_min; for (int n = 0; n < BL_SPACEDIM; n++) { u_local_crse[n].resize(Lev_max+1, PArrayManage); u_local_crse[n].set(level, new MultiFab(u[n][level].boxArray(), 1, 1)); u_local_crse[n][level].setVal(0.); for (MFIter u_crse_mfi(u_local_crse[n][level]); u_crse_mfi.isValid(); ++u_crse_mfi) { Box copybox(u_crse_mfi.validbox()); if (copybox.smallEnd()[n] == crse_domain.smallEnd()[n] && ifbc->getLoBC(n) == inflow) { copybox.growLo(n, 1); } if (copybox.bigEnd()[n] == crse_domain.bigEnd()[n] && ifbc->getHiBC(n) == inflow) { copybox.growHi(n, 1); } u_local_crse[n][level][u_crse_mfi].copy(u[n][level][u_crse_mfi], copybox, 0, copybox, 0, 1); } } } if (Sync_resid_fine != 0) { int level = Lev_min; for (int n = 0; n < BL_SPACEDIM; n++) { u_local_fine[n].resize(Lev_max+1, PArrayManage); u_local_fine[n].set(level, new MultiFab(u[n][level].boxArray(), 1, 1)); u_local_fine[n][level].setVal(0.); for (MFIter u_fine_mfi(u_local_fine[n][level]); u_fine_mfi.isValid(); ++u_fine_mfi) { Box copybox(u_fine_mfi.validbox()); if (copybox.smallEnd()[n] == crse_domain.smallEnd()[n] && ifbc->getLoBC(n) == inflow) { copybox.growLo(n, 1); } if (copybox.bigEnd()[n] == crse_domain.bigEnd()[n] && ifbc->getHiBC(n) == inflow) { copybox.growHi(n, 1); } u_local_fine[n][level][u_fine_mfi].copy(u[n][level][u_fine_mfi], copybox, 0, copybox, 0, 1); } } } if (Sync_resid_crse != 0 || Sync_resid_fine != 0) { int level = Lev_min; Sigma_local.set(level, new MultiFab(Sigma[level].boxArray(), 1, 1)); Sigma_local[level].setVal(0.); for (MFIter s_mfi(Sigma_local[level]); s_mfi.isValid(); ++s_mfi) { Sigma_local[level][s_mfi].copy(Sigma[level][s_mfi], s_mfi.validbox(), 0, s_mfi.validbox(), 0, 1); } } alloc_hg_multi(p, null_amr_real, Coarse_source, Sigma, H, Lev_min, Lev_max, 0); right_hand_side(u, null_amr_real, 0); if ( singular && Coarse_source.size() && make_sparse_node_source_solvable ) { sparse_node_source_adjustment(coarse_source); } solve(tol, scale, 2, 2); form_solution_vector(u, Sigma); clear_hg_multi(); Real h[BL_SPACEDIM]; if (Sync_resid_crse != 0 || Sync_resid_fine != 0) { for (int i = 0; i < BL_SPACEDIM; i++) { h[i] = H[i]; if (Lev_max > Lev_min) { BL_ASSERT(Lev_max == Lev_min+1); const int mglev_crse = ml_index[Lev_min]; const int mglev_fine = ml_index[Lev_max]; int rat = mg_domain[mglev_fine].length(i) / mg_domain[mglev_crse].length(i); h[i] *= rat; } } } // // Note: it is important that fine be called before crse, because the // crse routine will zero out part of the arrays // if (Sync_resid_fine != 0) { fill_sync_reg(u_local_fine, p, rhs_local_fine, Sigma_local, Sync_resid_fine, crse_geom, h, Lev_min, false); } if (Sync_resid_crse != 0) { fill_sync_reg(u_local_crse, p, rhs_local_crse, Sigma_local, Sync_resid_crse, crse_geom, h, Lev_min, true); } } void holy_grail_amr_projector::pressure_project (PArray& p, PArray& Sigma, const Geometry& crse_geom, Real H[], Real tol, int Lev_min, int Lev_max, Real scale) { Box crse_domain(crse_geom.Domain()); PArray rhs_local_crse(Lev_max+1, PArrayManage); PArray rhs_local_fine(Lev_max+1, PArrayManage); if (Lev_min < 0) Lev_min = lev_min_max; if (Lev_max < 0) Lev_max = Lev_min; BL_ASSERT(Sigma.size() > 0); const inviscid_fluid_boundary* ifbc = dynamic_cast(&boundary); BL_ASSERT(ifbc != 0); alloc_hg_multi(p, null_amr_real, null_amr_real, Sigma, H, Lev_min, Lev_max, 0); solve(tol, scale, 2, 2); clear_hg_multi(); } void holy_grail_amr_projector::fill_sync_reg (PArray* u_local, PArray& p, PArray& rhs_local, PArray& Sigma_local, MultiFab* Sync_resid, const Geometry& crse_geom, Real H[], int Lev_min, bool is_coarse) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::fill_sync_reg()"); int for_fill_sync_reg; if ( is_coarse ) { for_fill_sync_reg = 1; } else { for_fill_sync_reg = 2; } if ( is_coarse ) { const int mglev_crse = ml_index[Lev_min]; const Box domain = mg_domain[mglev_crse]; BoxArray fine_grids(mesh()[Lev_min+1]); for (MFIter mfi(Sigma_local[Lev_min]); mfi.isValid(); ++mfi) { for (int fine = 0; fine < fine_grids.size(); fine++) { Box coarsened_grid( BoxLib::coarsen(fine_grids[fine], gen_ratio[Lev_min])); if (coarsened_grid.intersects(mfi.validbox())) { Box subbox = mfi.validbox() & coarsened_grid; Sigma_local[Lev_min][mfi].setVal(0, subbox, 0, 1); } } } if (rhs_local.defined(Lev_min)) { for (MFIter mfi(rhs_local[Lev_min]); mfi.isValid(); ++mfi) { for (int fine = 0; fine < fine_grids.size(); fine++) { Box coarsened_grid( BoxLib::coarsen(fine_grids[fine], gen_ratio[Lev_min])); if (coarsened_grid.intersects(mfi.validbox())) { Box subbox = mfi.validbox() & coarsened_grid; for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (subbox.smallEnd()[dir] == domain.smallEnd()[dir]) { subbox.growLo(dir, 1); } if (subbox.bigEnd()[dir] == domain.bigEnd()[dir]) { subbox.growHi(dir, 1); } } rhs_local[Lev_min][mfi].setVal(0, subbox, 0, 1); } } } } for (int n = 0; n < BL_SPACEDIM; n++) { for (MFIter mfi(u_local[n][Lev_min]); mfi.isValid(); ++mfi) { for (int fine = 0; fine < fine_grids.size(); fine++) { Box coarsened_grid( BoxLib::coarsen(fine_grids[fine], gen_ratio[Lev_min])); if (coarsened_grid.intersects(mfi.validbox())) { Box subbox = mfi.validbox() & coarsened_grid; for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (subbox.smallEnd()[dir] == domain.smallEnd()[dir]) { subbox.growLo(dir, 1); } if (subbox.bigEnd()[dir] == domain.bigEnd()[dir]) { subbox.growHi(dir, 1); } } u_local[n][Lev_min][mfi].setVal(0, subbox, 0, 1); } } } } } // NOTE: We used to do periodic fills here in order to fill ghost cells // outside periodic boundaries. Instead, we now do copying of // Sync_resid_crse across periodic boundaries in the // SyncRegiser::CrseInit routine. alloc_hg_multi(p, null_amr_real, null_amr_real, Sigma_local, H, Lev_min, Lev_min, for_fill_sync_reg); if (rhs_local.defined(Lev_min)) { if (type(rhs_local[Lev_min]) == IntVect::TheNodeVector()) { right_hand_side(u_local, null_amr_real, for_fill_sync_reg); source[Lev_min].plus(rhs_local[Lev_min], 0, 1, 0); } else { right_hand_side(u_local, rhs_local, for_fill_sync_reg); } } else { right_hand_side(u_local, null_amr_real, for_fill_sync_reg); } const int mglev = ml_index[Lev_min]; resid[mglev].setVal(0.0); level_residual(resid[mglev], source[Lev_min], dest[Lev_min], mglev, false, 1); const int nghost = 0; Sync_resid->setVal(0.); MultiFab::Copy(*Sync_resid, resid[mglev], 0, 0, 1, nghost); sync_resid_clear(); } #ifdef HG_USE_SYNC_PROJECT void holy_grail_amr_projector::sync_project (PArray* u, PArray& p, PArray& Coarse_source, Real H[], Real tol, int Lev_min = -1, int Lev_max = -1, Real scale = 0.0) { sync_project(u, p, Coarse_source, null_amr_real, H, tol, Lev_min, Lev_max, scale); } void holy_grail_amr_projector::sync_project (PArray* u, PArray& p, PArray& Coarse_source, PArray& Sigma, Real H[], Real tol, int Lev_min, int Lev_max, Real scale) { if (Lev_min < 0) Lev_min = lev_min_max; if (Lev_max < 0) Lev_max = Lev_min; BL_ASSERT(Sigma.size() > 0); BL_ASSERT(u[ 0 ][Lev_min].nGrow() == 1); BL_ASSERT(u[ 1 ][Lev_min].nGrow() == 1); BL_ASSERT(u[BL_SPACEDIM-1][Lev_min].nGrow() == 1); alloc_hg_multi(p, null_amr_real, Coarse_source, Sigma, H, Lev_min, Lev_max, 0); sync_right_hand_side(u); if ( singular && Coarse_source.ready() && make_sparse_node_source_solvable ) { sparse_node_source_adjustment(coarse_source); } solve(tol, scale, 2, 2); form_solution_vector(u, Sigma); clear(); } #endif void holy_grail_amr_projector::manual_project (PArray* u, PArray& p, PArray& rhs, PArray& Coarse_source, MultiFab* Sync_resid_crse, MultiFab* Sync_resid_fine, const Geometry& crse_geom, bool use_u, Real H[], Real tol, int Lev_min, int Lev_max, Real scale) { manual_project(u, p, rhs, Coarse_source, null_amr_real, Sync_resid_crse, Sync_resid_fine, crse_geom, use_u, H, tol, Lev_min, Lev_max, scale); } void holy_grail_amr_projector::manual_project (PArray* u, PArray& p, PArray& rhs, PArray& Coarse_source, PArray& Sigma, MultiFab* Sync_resid_crse, MultiFab* Sync_resid_fine, const Geometry& crse_geom, bool use_u, Real H[], Real tol, int Lev_min, int Lev_max, Real scale) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::manual_project()"); Box crse_domain(crse_geom.Domain()); if (Lev_min < 0) Lev_min = lev_min_max; if (Lev_max < 0) Lev_max = Lev_min; BL_ASSERT(Sigma.size() > 0); PArray u_local_crse[BL_SPACEDIM]; PArray u_local_fine[BL_SPACEDIM]; PArray rhs_local_crse(Lev_max+1, PArrayManage); PArray rhs_local_fine(Lev_max+1, PArrayManage); PArray Sigma_local(Lev_max+1, PArrayManage); const inviscid_fluid_boundary* ifbc = dynamic_cast(&boundary); BL_ASSERT(ifbc != 0); if (Sync_resid_crse != 0) { int level = Lev_min; if (use_u) { for (int n = 0; n < BL_SPACEDIM; n++) { u_local_crse[n].resize(Lev_max+1, PArrayManage); u_local_crse[n].set(level, new MultiFab(u[n][level].boxArray(), 1, 1)); u_local_crse[n][level].setVal(0.); for (MFIter u_crse_mfi(u_local_crse[n][level]); u_crse_mfi.isValid(); ++u_crse_mfi) { Box copybox(u_crse_mfi.validbox()); if (copybox.smallEnd()[n] == crse_domain.smallEnd()[n] && ifbc->getLoBC(n) == inflow) { copybox.growLo(n, 1); } if (copybox.bigEnd()[n] == crse_domain.bigEnd()[n] && ifbc->getHiBC(n) == inflow) { copybox.growHi(n, 1); } u_local_crse[n][level][u_crse_mfi].copy(u[n][level][u_crse_mfi], copybox, 0, copybox, 0, 1); } } } } if (Sync_resid_fine != 0) { int level = Lev_min; if (use_u) for (int n = 0; n < BL_SPACEDIM; n++) { u_local_fine[n].resize(Lev_max+1, PArrayManage); u_local_fine[n].set(level, new MultiFab(u[n][level].boxArray(), 1, 1)); u_local_fine[n][level].setVal(0.); for (MFIter u_fine_mfi(u_local_fine[n][level]); u_fine_mfi.isValid(); ++u_fine_mfi) { Box copybox(u_fine_mfi.validbox()); if (copybox.smallEnd()[n] == crse_domain.smallEnd()[n] && ifbc->getLoBC(n) == inflow) { copybox.growLo(n, 1); } if (copybox.bigEnd()[n] == crse_domain.bigEnd()[n] && ifbc->getHiBC(n) == inflow) { copybox.growHi(n, 1); } u_local_fine[n][level][u_fine_mfi].copy(u[n][level][u_fine_mfi], copybox, 0, copybox, 0, 1); } } } if (Sync_resid_crse != 0 || Sync_resid_fine != 0) { int level = Lev_min; Sigma_local.set(level, new MultiFab(Sigma[level].boxArray(), 1, 1)); Sigma_local[level].setVal(0.); for (MFIter s_mfi(Sigma_local[level]); s_mfi.isValid(); ++s_mfi) { Sigma_local[level][s_mfi].copy(Sigma[level][s_mfi], s_mfi.validbox(), 0, s_mfi.validbox(), 0, 1); } } if (use_u) { BL_ASSERT(u[ 0 ][Lev_min].nGrow() == 1); BL_ASSERT(u[ 1 ][Lev_min].nGrow() == 1); BL_ASSERT(u[BL_SPACEDIM-1][Lev_min].nGrow() == 1); alloc_hg_multi(p, null_amr_real, Coarse_source, Sigma, H, Lev_min, Lev_max, 0); if (rhs.size() > 0) { if (type(rhs[Lev_min]) == IntVect::TheNodeVector()) { right_hand_side(u, null_amr_real, 0); for (int lev = Lev_min; lev <= Lev_max; lev++) { source[lev].plus(rhs[lev], 0, 1, 0); } if (singular && make_sparse_node_source_solvable) { // // Note: You don't want to do this if rhs is not sparse! // sparse_node_source_adjustment(rhs); } } else { BL_ASSERT(rhs[Lev_min].nGrow() == 1); right_hand_side(u, rhs, 0); } } else { right_hand_side(u, null_amr_real, 0); } } else { BL_ASSERT(rhs.size() > 0); BL_ASSERT(rhs[Lev_min].nGrow() == 1); if (type(rhs[Lev_min]) == IntVect::TheNodeVector()) { alloc_hg_multi(p, rhs, Coarse_source, Sigma, H, Lev_min, Lev_max, 0); if (singular && make_sparse_node_source_solvable) { // // Note: You don't want to do this if rhs is not sparse! // sparse_node_source_adjustment(rhs); } } else { alloc_hg_multi(p, null_amr_real, Coarse_source, Sigma, H, Lev_min, Lev_max, 0); // // Source is set to 0 at this point. // right_hand_side(0, rhs, 0); } } if (singular && Coarse_source.size() && make_sparse_node_source_solvable) { sparse_node_source_adjustment(coarse_source); } // We copy rhs *after* the adjustment has been done for singularity if ( Sync_resid_crse != 0 && rhs.size() > 0) { int level = Lev_min; rhs_local_crse.set(level, new MultiFab(rhs[level].boxArray(), 1, 1)); rhs_local_crse[level].setVal(0.); for (MFIter rhs_crse_mfi(rhs_local_crse[level]); rhs_crse_mfi.isValid(); ++rhs_crse_mfi) { Box copybox(rhs_crse_mfi.validbox()); rhs_local_crse[level][rhs_crse_mfi].copy(rhs[level][rhs_crse_mfi], copybox, 0, copybox, 0, 1); } } // We copy rhs *after* the adjustment has been done for singularity if ( Sync_resid_fine != 0 && rhs.size() > 0) { int level = Lev_min; rhs_local_fine.set(level, new MultiFab(rhs[level].boxArray(), 1, 1)); rhs_local_fine[level].setVal(0.); for (MFIter rhs_fine_mfi(rhs_local_fine[level]); rhs_fine_mfi.isValid(); ++rhs_fine_mfi) { Box copybox(rhs_fine_mfi.validbox()); rhs_local_fine[level][rhs_fine_mfi].copy(rhs[level][rhs_fine_mfi], copybox,0,copybox,0,1); } } solve(tol, scale, 2, 2); form_solution_vector(u, Sigma); clear_hg_multi(); Real h[BL_SPACEDIM]; if (Sync_resid_crse != 0 || Sync_resid_fine != 0) { BL_ASSERT(use_u); for (int i = 0; i < BL_SPACEDIM; i++) { h[i] = H[i]; if (Lev_max > Lev_min) { BL_ASSERT(Lev_max == Lev_min+1); const int mglev_crse = ml_index[Lev_min]; const int mglev_fine = ml_index[Lev_max]; int rat = mg_domain[mglev_fine].length(i) / mg_domain[mglev_crse].length(i); h[i] *= rat; } } } // // It is important that fine be called before crse, because the // crse routine will zero out part of the arrays. // if (Sync_resid_fine != 0) { fill_sync_reg(u_local_fine, p, rhs_local_fine, Sigma_local, Sync_resid_fine, crse_geom, h, Lev_min, false); } if (Sync_resid_crse != 0) { fill_sync_reg(u_local_crse, p, rhs_local_crse, Sigma_local, Sync_resid_crse, crse_geom, h, Lev_min, true); } } void holy_grail_amr_projector::sparse_node_source_adjustment (PArray& sparse_source) { // // This routine takes advantage of the sparse structure of // the sync source to avoid costly restriction operations. It // is necessary to use the inner_product routine, which weights // boundary nodes, since the coarse-fine lev_interface can touch // the boundary. Otherwise a call to sum would suffice. // // Note that the correction is applied to source, not to // sparse_source, since the sparse structure of the latter // may need to be preserved. // BL_ASSERT(singular); BL_ASSERT(make_sparse_node_source_solvable); Real adjust = 0.0; for (int lev = lev_max; lev >= lev_min; lev--) { if (sparse_source.defined(lev)) { int mglev = ml_index[lev]; corr[mglev].setVal(1.0); adjust += inner_product(sparse_source[lev], corr[mglev]); } if (lev > lev_min && adjust != 0.0) { for (int i = 0; i < BL_SPACEDIM; i++) { adjust /= gen_ratio[lev-1][i]; } } } if (adjust != 0.0) { adjust /= mg_domain[ml_index[lev_min]].numPts(); if (pcode >= 2 && ParallelDescriptor::IOProcessor()) { std::cout << "HG: Sparse-source solvability adjustment: " << adjust << std::endl; } for (int lev = lev_min; lev <= lev_max; lev++) { source[lev].plus(-adjust, 0); } } } // // This is a combination routine which combines sources from a divergence // and from a cell-based right hand side S in the proper sequence. The // key feature is that both "grid" routines must be called before starting // the lev_interface calculation, since they trash some lev_interface points. // void holy_grail_amr_projector::right_hand_side (PArray* u, PArray& S, int for_fill_sync_reg) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::right_hand_side()"); if (u) { grid_divergence(u, source, for_fill_sync_reg); } if (S.size() > 0) { grid_average(S, source, for_fill_sync_reg); } if (for_fill_sync_reg == 0) { for (int lev = lev_min; lev <= lev_max; lev++) { const int mglev = ml_index[lev]; clear_part_interface(source[lev], lev_interface[mglev]); if (lev > lev_min) { if (u) { interface_divergence(u, lev); } if (S.size() > 0) { interface_average(S, lev); } } } } } void holy_grail_amr_projector::right_hand_side_for_stream_func (PArray* u) { grid_vorticity(u,source); for (int lev = lev_min; lev <= lev_max; lev++) { const int mglev = ml_index[lev]; clear_part_interface(source[lev], lev_interface[mglev]); if (lev > lev_min) interface_vorticity(u, lev); } } // // Averages cell-based S onto node-based source conservatively // across the composite mesh. S must be passed in with a one // cell wide border. At inflow boundaries border values should // be set to correct inflow condition. Other border values passed // in may be meaningless, but should not be NaNs. // // This routine will modify the borders of S. Also, if the problem // being solved is singular, S will be adjusted so that it integrates // to 0 to maximum precision. (It is assumed that any additional // contribution to the right hand side will also integrate to 0.) // // This is an incomplete routine---interface_average must also be called. // void holy_grail_amr_projector::grid_average (PArray& S, PArray& src, int for_fill_sync_reg) { BL_ASSERT(S[lev_min].nGrow() == 1); if (singular && for_fill_sync_reg == 0) { Real adjust = 0.0; for (int lev = lev_max; lev > lev_min; lev--) { restrict_level(S[lev-1], S[lev], gen_ratio[lev-1], default_restrictor(), default_level_interface, 0); } for (MFIter S_mfi(S[lev_min]); S_mfi.isValid(); ++S_mfi) { adjust += S[lev_min][S_mfi].sum(S_mfi.validbox(), 0); } ParallelDescriptor::ReduceRealSum(adjust); adjust /= mg_domain[ml_index[lev_min]].numPts(); if (pcode >= 2 && ParallelDescriptor::IOProcessor()) { std::cout << "HG: Cell-source solvability adjustment: " << adjust << std::endl; } for (int lev = lev_min; lev <= lev_max; lev++) { S[lev].plus(-adjust, 0); } } for (int lev = lev_min; lev <= lev_max; lev++) { const int mglev = ml_index[lev]; if (for_fill_sync_reg == 0) { fill_borders(S[lev], lev_interface[mglev], boundary.scalar(), -1, is_dense(m_stencil)); } else if (for_fill_sync_reg == 1) { // This is the same as a fill_borders call except that it // doesn't fill periodic boundaries boundary.scalar()->fill_sync_reg_borders(S[lev], lev_interface[mglev],-1); } for (MFIter s_mfi(src[lev]); s_mfi.isValid(); ++s_mfi) { const Box& sbox = src[lev][s_mfi].box(); const Box& fbox = S[lev][s_mfi].box(); Box freg = (for_fill_sync_reg > 0) ? BoxLib::surroundingNodes(ml_mesh[lev][s_mfi.index()]) : Box(lev_interface[mglev].part_fine(s_mfi.index())); Real* sptr = src[lev][s_mfi].dataPtr(); const Real* csptr = S[lev][s_mfi].dataPtr(); #if (BL_SPACEDIM == 2) const int isRZ = getCoordSys(); const int imax = mg_domain[mglev].bigEnd(0) + 1; const int IDENSE = (is_dense(m_stencil)? 1 : 0 ); const Real hx = h[mglev][0]; FORT_HGAVG(sptr, DIMLIST(sbox), csptr, DIMLIST(fbox), DIMLIST(freg), &hx, &isRZ, &imax, &IDENSE); #else FORT_HGAVG(sptr, DIMLIST(sbox), csptr, DIMLIST(fbox), DIMLIST(freg)); #endif } } } // // This is an incomplete routine---interface_divergence must also be called. // void holy_grail_amr_projector::grid_divergence (PArray* u, PArray& s, int for_fill_sync_reg) { for (int lev = lev_min; lev <= lev_max; lev++) { const int mglev = ml_index[lev]; const Real hxyz[BL_SPACEDIM] = { D_DECL(h[mglev][0], h[mglev][1], h[mglev][2]) }; for (int i = 0; i < BL_SPACEDIM; i++) { if (for_fill_sync_reg == 0) { fill_borders(u[i][lev], lev_interface[mglev], boundary.velocity(i), -1, is_dense(m_stencil)); } else if (for_fill_sync_reg == 1) { // This is the same as a fill_borders call except that it // doesn't fill periodic boundaries boundary.velocity(i)->fill_sync_reg_borders(u[i][lev], lev_interface[mglev],-1); } HG_TEST_NORM( u[i][lev], "grid_divergence"); } for (MFIter s_mfi(s[lev]); s_mfi.isValid(); ++s_mfi) { const Box& sbox = s[lev][s_mfi].box(); const Box& fbox = u[0][lev][s_mfi].box(); Box freg = (for_fill_sync_reg > 0) ? BoxLib::surroundingNodes(ml_mesh[lev][s_mfi.index()]) : Box(lev_interface[mglev].part_fine(s_mfi.index())); Real* sptr = s[lev][s_mfi].dataPtr(); Real* u0ptr = u[0][lev][s_mfi].dataPtr(); Real* u1ptr = u[1][lev][s_mfi].dataPtr(); #if (BL_SPACEDIM == 3) Real* u2ptr = u[2][lev][s_mfi].dataPtr(); #endif if ( is_dense(m_stencil) ) { FORT_HGDIV_DENSE( sptr, DIMLIST(sbox), D_DECL(u0ptr, u1ptr, u2ptr), DIMLIST(fbox), DIMLIST(freg), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2]), 0, 0); } else { const int isRZ = getCoordSys(); const int imax = mg_domain[mglev].bigEnd(0) + 1; FORT_HGDIV( sptr, DIMLIST(sbox), D_DECL(u0ptr, u1ptr, u2ptr), DIMLIST(fbox), DIMLIST(freg), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2]), &isRZ, &imax); } } HG_TEST_NORM( s[lev], "grid_divergence"); } } void holy_grail_amr_projector::grid_vorticity (PArray* u, PArray& s) { #if (BL_SPACEDIM == 2) for (int lev = lev_min; lev <= lev_max; lev++) { const int mglev = ml_index[lev]; const Real hxyz[BL_SPACEDIM] = { D_DECL(h[mglev][0], h[mglev][1], h[mglev][2]) }; for (int i = 0; i < BL_SPACEDIM; i++) { fill_borders(u[i][lev], lev_interface[mglev], boundary.velocity(i), -1, is_dense(m_stencil)); HG_TEST_NORM( u[i][lev], "grid_vorticity"); } for (MFIter s_mfi(s[lev]); s_mfi.isValid(); ++s_mfi) { const Box& sbox = s[lev][s_mfi].box(); const Box& fbox = u[0][lev][s_mfi].box(); Box freg = Box(lev_interface[mglev].part_fine(s_mfi.index())); Real* sptr = s[lev][s_mfi].dataPtr(); Real* u0ptr = u[0][lev][s_mfi].dataPtr(); Real* u1ptr = u[1][lev][s_mfi].dataPtr(); #if (BL_SPACEDIM == 3) Real* u2ptr = u[2][lev][s_mfi].dataPtr(); #endif if ( is_dense(m_stencil) ) { FORT_HGVORT_DENSE( sptr, DIMLIST(sbox), D_DECL(u0ptr, u1ptr, u2ptr), DIMLIST(fbox), DIMLIST(freg), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2]), 0, 0); } else { const int isRZ = getCoordSys(); const int imax = mg_domain[mglev].bigEnd(0) + 1; FORT_HGVORT( sptr, DIMLIST(sbox), D_DECL(u0ptr, u1ptr, u2ptr), DIMLIST(fbox), DIMLIST(freg), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2]), &isRZ, &imax); } } HG_TEST_NORM( s[lev], "grid_vorticity"); } #endif } #ifdef HG_USE_SYNC_PROJECT // // Obsolete: // void holy_grail_amr_projector::sync_right_hand_side (PArray* u) { for (int lev = lev_min; lev <= lev_max; lev++) { source[lev].setVal(0.0); } const int mglev0 = ml_index[lev_min]; interface_divergence(u, lev_min+1); if (singular) { const int mglev1 = ml_index[lev_min+1]; restrict_level(source[lev_min], source[lev_min+1], gen_ratio[lev_min], bilinear_restrictor(0, is_dense(m_stencil)), lev_interface[mglev1], mg_boundary); work[mglev0].setVal(1.0); Real adjustment = inner_product(source[lev_min], work[mglev0]) / mg_domain[ml_index[lev_min]].volume(); if (pcode >= 2 && ParallelDescriptor::IOProcessor()) { cout << "HG: Solvability adjustment is " << adjustment << endl; } for (int lev = lev_min; lev <= lev_max; lev++) { source[lev].plus(-adjustment, 0); } } } #endif void holy_grail_amr_projector::interface_average (PArray& S, int lev) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::interface_average()"); const int mglev = ml_index[lev]; const int mgc = ml_index[lev-1]; const IntVect& rat = gen_ratio[lev-1]; task_list tl; for (int iface = 0; iface < lev_interface[mglev].nboxes(level_interface::FACEDIM); iface++) { // // Find a fine grid touching this face. // int igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 0); if (igrid < 0) igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 1); const unsigned int geo = lev_interface[mglev].geo(level_interface::FACEDIM, iface); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(level_interface::FACEDIM, iface) ) { continue; } // // Fine grid on just one side. // const int idim = lev_interface[mglev].fdim(iface); const int idir = (geo & level_interface::LOW) ? -1 : 1; Box cbox = lev_interface[mglev].box(level_interface::FACEDIM, iface); const IntVect t = cbox.type(); if (idir > 0) { cbox.growLo(idim, rat[idim]); } else { cbox.growHi(idim, rat[idim]); } cbox.convert(IntVect::TheCellVector()).coarsen(rat); task_fab* Scp = new task_fill_patch(tl, source[lev], igrid, cbox, S[lev-1], lev_interface[mgc], boundary.scalar(), -1, -1); Box creg = lev_interface[mglev].node_box(level_interface::FACEDIM, iface); creg.coarsen(rat).grow(t - 1); #if (BL_SPACEDIM == 2) const int isRZ = getCoordSys(); const int imax = mg_domain[mglev].bigEnd(0) + 1; const int IDENSE = (is_dense(m_stencil)? 1 : 0 ); const Real hx = h[mglev][0]; tl.add_task(new task_fecavg(&FORT_HGFAVG, tl, source[lev], S[lev], igrid, Scp, creg, rat, idim, idir, hx, isRZ, imax, IDENSE)); #else tl.add_task(new task_fecavg(&FORT_HGFAVG, tl, source[lev], S[lev], igrid, Scp, creg, rat, idim, idir)); #endif } tl.execute("holy_grail_amr_projector::interface_average(1)"); #if (BL_SPACEDIM == 3) for (int iedge = 0; iedge < lev_interface[mglev].nboxes(1); iedge++) { // // Find a fine grid touching this edge. // int igrid; for (int i = 0; i < lev_interface[mglev].ngrids(1); i++) { igrid = lev_interface[mglev].grid(1, iedge, i); if (igrid >= 0) break; } const unsigned int geo = lev_interface[mglev].geo(1, iedge); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(1, iedge) ) continue; // // Fine grid on just one side. // Box cbox = lev_interface[mglev].box(1, iedge); const IntVect t = cbox.type(); cbox.coarsen(rat).grow(t).convert(IntVect::TheCellVector()); Box fbox = cbox; fbox.refine(rat); task_fab* Scp = new task_fill_patch(tl, source[lev], igrid, cbox, S[lev-1], lev_interface[mgc], boundary.scalar(), -1, -1); task_fab* Sfp = new task_fill_patch(tl, source[lev], igrid, fbox, S[lev], lev_interface[mglev], boundary.scalar(), 1, iedge); Box creg = lev_interface[mglev].node_box(1, iedge); creg.coarsen(rat).grow(t - 1); Array ga = lev_interface[mglev].geo_array(1, iedge); task::task_proxy tp = tl.add_task( new task_fecavg_2(&FORT_HGEAVG, tl, source[lev], igrid, Sfp, Scp, creg, rat, ga, t)); // // Fill in the grids on the other sides, if any. // const Box& freg = lev_interface[mglev].node_box(1, iedge); for (int i = 1; i < lev_interface[mglev].ngrids(1); i++) { const int jgrid = lev_interface[mglev].grid(1, iedge, i); if (jgrid >= 0 && jgrid != igrid) { tl.add_task( new task_copy(tl, source[lev], jgrid, source[lev], igrid, freg, tp)); } } } tl.execute("holy_grail_amr_projector::interface_average(2)"); #endif for (int icor = 0; icor < lev_interface[mglev].nboxes(0); icor++) { // // Find a fine grid touching this corner. // int igrid; for (int i = 0; i < lev_interface[mglev].ngrids(0); i++) { igrid = lev_interface[mglev].grid(0, icor, i); if (igrid >= 0) break; } const unsigned int geo = lev_interface[mglev].geo(0, icor); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(0, icor) ) { continue; } // // Fine grid on just one side. // Box cbox = lev_interface[mglev].box(0, icor); cbox.coarsen(rat).grow(1).convert(IntVect::TheCellVector()); Box fbox = cbox; fbox.refine(rat); task_fab* Scp = new task_fill_patch(tl, source[lev], igrid, cbox, S[lev-1], lev_interface[mgc], boundary.scalar(), -1, -1); task_fab* Sfp = new task_fill_patch(tl, source[lev], igrid, fbox, S[lev], lev_interface[mglev], boundary.scalar(), 0, icor); Box creg = lev_interface[mglev].box(0, icor); creg.coarsen(rat); Array ga = lev_interface[mglev].geo_array(0, icor); #if (BL_SPACEDIM == 2) const int isRZ = getCoordSys(); const int imax = mg_domain[mglev].bigEnd(0) + 1; const int IDENSE = (is_dense(m_stencil)? 1 : 0 ); const Real hx = h[mglev][0]; task::task_proxy tp = tl.add_task( new task_fecavg_2(&FORT_HGCAVG, tl, source[lev], igrid, Sfp, Scp, creg, rat, ga, IntVect(), hx, isRZ, imax, IDENSE)); #else task::task_proxy tp = tl.add_task( new task_fecavg_2(&FORT_HGCAVG, tl, source[lev], igrid, Sfp, Scp, creg, rat, ga, IntVect())); #endif // // Fill in the grids on the other sides, if any. // const Box& freg = lev_interface[mglev].box(0, icor); for (int i = 1; i < lev_interface[mglev].ngrids(0); i++) { const int jgrid = lev_interface[mglev].grid(0, icor, i); if (jgrid >= 0 && jgrid != igrid) { tl.add_task( new task_copy(tl, source[lev], jgrid, source[lev], igrid, freg, tp)); } } } tl.execute("holy_grail_amr_projector::interface_average(3)"); } void holy_grail_amr_projector::interface_divergence (PArray* u, int lev) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::interface_divergence()"); const int mglev = ml_index[lev]; const int mgc = ml_index[lev-1]; const IntVect& rat = gen_ratio[lev-1]; task_list tl; HG_TEST_NORM(source[lev], "interface_divergence,b"); for (int iface = 0; iface < lev_interface[mglev].nboxes(level_interface::FACEDIM); iface++) { // // Find a fine grid touching this face. // int igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 0); if (igrid < 0) igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 1); const unsigned int geo = lev_interface[mglev].geo(level_interface::FACEDIM, iface); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(level_interface::FACEDIM, iface) ) { continue; } // // Fine grid on just one side. // const int idim = lev_interface[mglev].fdim(iface); const int idir = (geo & level_interface::LOW) ? -1 : 1; Box cbox = lev_interface[mglev].box(level_interface::FACEDIM, iface); const IntVect t = cbox.type(); if (idir > 0) { cbox.growLo(idim, rat[idim]); } else { cbox.growHi(idim, rat[idim]); } cbox.convert(IntVect::TheCellVector()).coarsen(rat); task_fab* ucp[BL_SPACEDIM]; MultiFab* upt[BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; ++i) { ucp[i] = new task_fill_patch(tl, source[lev], igrid, cbox, u[i][lev-1], lev_interface[mgc], boundary.velocity(i), -1, -1); upt[i] = &u[i][lev]; } Box creg = lev_interface[mglev].node_box(level_interface::FACEDIM, iface); creg.coarsen(rat).grow(t - 1); if ( is_dense(m_stencil)) { tl.add_task( new task_fdiv(&FORT_HGFDIV_DENSE, tl, source[lev], upt, igrid, ucp, creg, h[mglev], rat, idim, idir, 0, 0)); } else { const int isRZ = getCoordSys(); const int imax = mg_domain[mglev].bigEnd(0) + 1; tl.add_task( new task_fdiv(&FORT_HGFDIV, tl, source[lev], upt, igrid, ucp, creg, h[mglev], rat, idim, idir, isRZ, imax)); } } tl.execute("holy_grail_amr_projector::interface_divergence(1)"); HG_TEST_NORM(source[lev], "interface_divergence,a"); #if (BL_SPACEDIM == 3) for (int iedge = 0; iedge < lev_interface[mglev].nboxes(1); iedge++) { // // Find a fine grid touching this edge. // int igrid; for (int i = 0; i < lev_interface[mglev].ngrids(1); i++) { igrid = lev_interface[mglev].grid(1, iedge, i); if (igrid >= 0) break; } const unsigned int geo = lev_interface[mglev].geo(1, iedge); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(1, iedge) ) { continue; } // // Fine grid on just one side. // Box cbox = lev_interface[mglev].box(1, iedge); const IntVect t = cbox.type(); cbox.coarsen(rat).grow(t).convert(IntVect::TheCellVector()); Box fbox = cbox; fbox.refine(rat); task_fab* ucp[BL_SPACEDIM]; task_fab* ufp[BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; ++i) { ucp[i] = new task_fill_patch(tl, source[lev], igrid, cbox, u[i][lev-1], lev_interface[mgc], boundary.velocity(i), -1, -1); ufp[i] = new task_fill_patch(tl, source[lev], igrid, fbox, u[i][lev], lev_interface[mglev], boundary.velocity(i), 1, iedge); } Box creg = lev_interface[mglev].node_box(1, iedge); creg.coarsen(rat).grow(t - 1); Array ga = lev_interface[mglev].geo_array(1, iedge); task::task_proxy tp; if ( is_dense(m_stencil) ) { tp = tl.add_task( new task_ediv(&FORT_HGEDIV_DENSE, tl, source[lev], igrid, ufp, ucp, creg, h[mglev], rat, ga, t)); } else { tp = tl.add_task( new task_ediv(&FORT_HGEDIV, tl, source[lev], igrid, ufp, ucp, creg, h[mglev], rat, ga, t)); } // // Fill in the grids on the other sides, if any. // const Box& freg = lev_interface[mglev].node_box(1, iedge); for (int i = 1; i < lev_interface[mglev].ngrids(1); i++) { const int jgrid = lev_interface[mglev].grid(1, iedge, i); if (jgrid >= 0 && jgrid != igrid) { tl.add_task( new task_copy(tl, source[lev], jgrid, source[lev], igrid, freg, tp)); } } } tl.execute("holy_grail_amr_projector::interface_divergence(2)"); HG_TEST_NORM(source[lev], "interface_divergence,a1"); #endif for (int icor = 0; icor < lev_interface[mglev].nboxes(0); icor++) { // // Find a fine grid touching this corner. // int igrid; for (int i = 0; i < lev_interface[mglev].ngrids(0); i++) { igrid = lev_interface[mglev].grid(0, icor, i); if (igrid >= 0) break; } const unsigned int geo = lev_interface[mglev].geo(0, icor); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(0, icor) ) { continue; } // // Fine grid on just one side. // Box cbox = lev_interface[mglev].box(0, icor); cbox.coarsen(rat).grow(1).convert(IntVect::TheCellVector()); Box fbox = cbox; fbox.refine(rat); task_fab* ucp[BL_SPACEDIM]; task_fab* ufp[BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; ++i) { ucp[i] = new task_fill_patch(tl, source[lev], igrid, cbox, u[i][lev-1], lev_interface[mgc], boundary.velocity(i), -1, -1); ufp[i] = new task_fill_patch(tl, source[lev], igrid, fbox, u[i][lev], lev_interface[mglev], boundary.velocity(i), 0, icor); } Box creg = lev_interface[mglev].box(0, icor); creg.coarsen(rat); Array ga = lev_interface[mglev].geo_array(0, icor); task::task_proxy tp; if ( is_dense(m_stencil) ) { tp = tl.add_task( new task_cdiv(&FORT_HGCDIV_DENSE, tl, source[lev], igrid, ufp, ucp, creg, h[mglev], rat, ga, 0)); } else { const int isRZ = getCoordSys(); tp = tl.add_task( new task_cdiv(&FORT_HGCDIV, tl, source[lev], igrid, ufp, ucp, creg, h[mglev], rat, ga, isRZ)); } // // Fill in the grids on the other sides, if any. // const Box& freg = lev_interface[mglev].box(0, icor); for (int i = 1; i < lev_interface[mglev].ngrids(0); i++) { const int jgrid = lev_interface[mglev].grid(0, icor, i); if (jgrid >= 0 && jgrid != igrid) { tl.add_task( new task_copy(tl, source[lev], jgrid, source[lev], igrid, freg, tp)); } } } tl.execute("holy_grail_amr_projector::interface_divergence(3)"); HG_TEST_NORM(source[lev], "interface_divergence,a2"); // BoxLib::Abort(); } void holy_grail_amr_projector::interface_vorticity (PArray* u, int lev) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::interface_vorticity()"); #if (BL_SPACEDIM == 2) const int mglev = ml_index[lev]; const int mgc = ml_index[lev-1]; const IntVect& rat = gen_ratio[lev-1]; task_list tl; HG_TEST_NORM(source[lev], "interface_vorticity,b"); for (int iface = 0; iface < lev_interface[mglev].nboxes(level_interface::FACEDIM); iface++) { // // Find a fine grid touching this face. // int igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 0); if (igrid < 0) igrid = lev_interface[mglev].grid(level_interface::FACEDIM, iface, 1); const unsigned int geo = lev_interface[mglev].geo(level_interface::FACEDIM, iface); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(level_interface::FACEDIM, iface) ) { continue; } // // Fine grid on just one side. // const int idim = lev_interface[mglev].fdim(iface); const int idir = (geo & level_interface::LOW) ? -1 : 1; Box cbox = lev_interface[mglev].box(level_interface::FACEDIM, iface); const IntVect t = cbox.type(); if (idir > 0) { cbox.growLo(idim, rat[idim]); } else { cbox.growHi(idim, rat[idim]); } cbox.convert(IntVect::TheCellVector()).coarsen(rat); task_fab* ucp[BL_SPACEDIM]; MultiFab* upt[BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; ++i) { ucp[i] = new task_fill_patch(tl, source[lev], igrid, cbox, u[i][lev-1], lev_interface[mgc], boundary.velocity(i), -1, -1); upt[i] = &u[i][lev]; } Box creg = lev_interface[mglev].node_box(level_interface::FACEDIM, iface); creg.coarsen(rat).grow(t - 1); if ( is_dense(m_stencil)) { tl.add_task( new task_fdiv(&FORT_HGFVORT_DENSE, tl, source[lev], upt, igrid, ucp, creg, h[mglev], rat, idim, idir, 0, 0)); } else { const int isRZ = getCoordSys(); const int imax = mg_domain[mglev].bigEnd(0) + 1; tl.add_task( new task_fdiv(&FORT_HGFVORT, tl, source[lev], upt, igrid, ucp, creg, h[mglev], rat, idim, idir, isRZ, imax)); } } tl.execute("holy_grail_amr_projector::interface_vorticity(1)"); HG_TEST_NORM(source[lev], "interface_vorticity,a"); #if (BL_SPACEDIM == 3) for (int iedge = 0; iedge < lev_interface[mglev].nboxes(1); iedge++) { // // Find a fine grid touching this edge. // int igrid; for (int i = 0; i < lev_interface[mglev].ngrids(1); i++) { igrid = lev_interface[mglev].grid(1, iedge, i); if (igrid >= 0) break; } const unsigned int geo = lev_interface[mglev].geo(1, iedge); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(1, iedge) ) { continue; } // // Fine grid on just one side. // Box cbox = lev_interface[mglev].box(1, iedge); const IntVect t = cbox.type(); cbox.coarsen(rat).grow(t).convert(IntVect::TheCellVector()); Box fbox = cbox; fbox.refine(rat); task_fab* ucp[BL_SPACEDIM]; task_fab* ufp[BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; ++i) { ucp[i] = new task_fill_patch(tl, source[lev], igrid, cbox, u[i][lev-1], lev_interface[mgc], boundary.velocity(i), -1, -1); ufp[i] = new task_fill_patch(tl, source[lev], igrid, fbox, u[i][lev], lev_interface[mglev], boundary.velocity(i), 1, iedge); } Box creg = lev_interface[mglev].node_box(1, iedge); creg.coarsen(rat).grow(t - 1); Array ga = lev_interface[mglev].geo_array(1, iedge); task::task_proxy tp; if ( is_dense(m_stencil) ) { tp = tl.add_task( new task_ediv(&FORT_HGEVORT_DENSE, tl, source[lev], igrid, ufp, ucp, creg, h[mglev], rat, ga, t)); } else { tp = tl.add_task( new task_ediv(&FORT_HGEVORT, tl, source[lev], igrid, ufp, ucp, creg, h[mglev], rat, ga, t)); } // // Fill in the grids on the other sides, if any. // const Box& freg = lev_interface[mglev].node_box(1, iedge); for (int i = 1; i < lev_interface[mglev].ngrids(1); i++) { const int jgrid = lev_interface[mglev].grid(1, iedge, i); if (jgrid >= 0 && jgrid != igrid) { tl.add_task( new task_copy(tl, source[lev], jgrid, source[lev], igrid, freg, tp)); } } } tl.execute("holy_grail_amr_projector::interface_vorticity(2)"); HG_TEST_NORM(source[lev], "interface_vorticity,a1"); #endif for (int icor = 0; icor < lev_interface[mglev].nboxes(0); icor++) { // // Find a fine grid touching this corner. // int igrid; for (int i = 0; i < lev_interface[mglev].ngrids(0); i++) { igrid = lev_interface[mglev].grid(0, icor, i); if (igrid >= 0) break; } const unsigned int geo = lev_interface[mglev].geo(0, icor); // // Reject fine-fine interfaces and those without an interior fine grid // if (geo == level_interface::ALL || igrid < 0 || lev_interface[mglev].flag(0, icor) ) { continue; } // // Fine grid on just one side. // Box cbox = lev_interface[mglev].box(0, icor); cbox.coarsen(rat).grow(1).convert(IntVect::TheCellVector()); Box fbox = cbox; fbox.refine(rat); task_fab* ucp[BL_SPACEDIM]; task_fab* ufp[BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; ++i) { ucp[i] = new task_fill_patch(tl, source[lev], igrid, cbox, u[i][lev-1], lev_interface[mgc], boundary.velocity(i), -1, -1); ufp[i] = new task_fill_patch(tl, source[lev], igrid, fbox, u[i][lev], lev_interface[mglev], boundary.velocity(i), 0, icor); } Box creg = lev_interface[mglev].box(0, icor); creg.coarsen(rat); Array ga = lev_interface[mglev].geo_array(0, icor); task::task_proxy tp; if ( is_dense(m_stencil) ) { tp = tl.add_task( new task_cdiv(&FORT_HGCVORT_DENSE, tl, source[lev], igrid, ufp, ucp, creg, h[mglev], rat, ga, 0)); } else { const int isRZ = getCoordSys(); tp = tl.add_task( new task_cdiv(&FORT_HGCVORT, tl, source[lev], igrid, ufp, ucp, creg, h[mglev], rat, ga, isRZ)); } // // Fill in the grids on the other sides, if any. // const Box& freg = lev_interface[mglev].box(0, icor); for (int i = 1; i < lev_interface[mglev].ngrids(0); i++) { const int jgrid = lev_interface[mglev].grid(0, icor, i); if (jgrid >= 0 && jgrid != igrid) { tl.add_task( new task_copy(tl, source[lev], jgrid, source[lev], igrid, freg, tp)); } } } tl.execute("holy_grail_amr_projector::interface_vorticity(3)"); #endif } void holy_grail_amr_projector::form_solution_vector (PArray* u, const PArray& sigma_in) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::form_solution_vector()"); BL_ASSERT(u != 0); if (u) { for (int lev = lev_min; lev <= lev_max; lev++) { int mglev = ml_index[lev]; Real hxyz[BL_SPACEDIM] = { D_DECL( h[mglev][0], h[mglev][1], h[mglev][2] ) }; FArrayBox gp[BL_SPACEDIM]; for (MFIter d_mfi(dest[lev]); d_mfi.isValid(); ++d_mfi) { const Box& gbox = ml_mesh[lev][d_mfi.index()]; const Box& dbox = dest[lev][d_mfi].box(); for (int i = 0; i < BL_SPACEDIM; i++) { gp[i].resize(gbox); } if ( is_dense(m_stencil) ) { FORT_HGGRAD_DENSE( D_DECL( gp[0].dataPtr(), gp[1].dataPtr(), gp[2].dataPtr()), DIMLIST(gbox), dest[lev][d_mfi].dataPtr(), DIMLIST(dbox), DIMLIST(gbox), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2]), 0); } else { const int isRZ = getCoordSys(); FORT_HGGRAD( D_DECL( gp[0].dataPtr(), gp[1].dataPtr(), gp[2].dataPtr()), DIMLIST(gbox), dest[lev][d_mfi].dataPtr(), DIMLIST(dbox), DIMLIST(gbox), D_DECL(&hxyz[0], &hxyz[1], &hxyz[2]), &isRZ); } if (m_stencil != terrain) { for (int i = 0; i < BL_SPACEDIM; i++) { gp[i].mult(sigma_in[lev][d_mfi]); u[i][lev][d_mfi].minus(gp[i]); } } else { FArrayBox cross(gbox); for (int i = 0; i < BL_SPACEDIM; i++) { cross.copy(gp[i]); cross.mult(sigma_in[lev][d_mfi], i, 0, 1); u[i][lev][d_mfi].minus(cross); } for (int i = 0; i < BL_SPACEDIM - 1; i++) { cross.copy(gp[BL_SPACEDIM-1]); cross.mult(sigma_in[lev][d_mfi], BL_SPACEDIM+i, 0, 1); u[i][lev][d_mfi].plus(cross); cross.copy(gp[i]); cross.mult(sigma_in[lev][d_mfi], BL_SPACEDIM+i, 0, 1); u[BL_SPACEDIM-1][lev][d_mfi].plus(cross); } } } } sync_periodic_interfaces(); for (int lev = lev_max; lev > lev_min; lev--) { const IntVect& rat = gen_ratio[lev-1]; restrict_level(dest[lev-1], dest[lev], rat, injection_restrictor(), default_level_interface, 0); for (int i = 0; i < BL_SPACEDIM; i++) { if (m_stencil != terrain) { restrict_level(u[i][lev-1], u[i][lev], rat, default_restrictor(), default_level_interface, 0); } else { restrict_level(u[i][lev-1], u[i][lev], rat, terrain_velocity_restrictor(i), default_level_interface, 0); } } } } else { sync_periodic_interfaces(); for (int lev = lev_max; lev > lev_min; lev--) { restrict_level(dest[lev-1], dest[lev], gen_ratio[lev-1], injection_restrictor(), default_level_interface, 0); } } } void holy_grail_amr_projector::stream_func_project (PArray* u, PArray& p, PArray& Sigma, Real H[], Real tol, int Lev_min, int Lev_max, Real scale) { if (Lev_min < 0) Lev_min = lev_min_max; if (Lev_max < 0) Lev_max = Lev_min; BL_ASSERT(Sigma.size() > 0); BL_ASSERT(u[ 0 ][Lev_min].nGrow() == 1); BL_ASSERT(u[ 1 ][Lev_min].nGrow() == 1); BL_ASSERT(u[BL_SPACEDIM-1][Lev_min].nGrow() == 1); alloc_hg_multi(p, null_amr_real, null_amr_real, Sigma, H, Lev_min, Lev_max, 0); right_hand_side_for_stream_func(u); solve(tol, scale, 2, 2); clear_hg_multi(); } ccseapps-2.5/CCSEApps/hgproj/hg_multi3d.f0000644000175000017500000034252311634153073021367 0ustar amckinstryamckinstryc----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along face subroutine hgfres( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & fdst, fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2, & cdst, cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2, & sigmaf, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & sigmac, scl0,sch0,scl1,sch1,scl2,sch2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz, ir, jr, kr, idim, idir,idd) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2 integer cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer scl0,sch0,scl1,sch1,scl2,sch2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1,fdstl2:fdsth2) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1,cdstl2:cdsth2) double precision sigmaf(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2) double precision sigmac(scl0:sch0,scl1:sch1,scl2:sch2) double precision hx, hy, hz integer ir, jr, kr, idim, idir integer idd double precision hxm2, hym2, hzm2, fac0, fac1, fac2, tmp integer i, j, k, is, js, ks, l, m, n if (idim .eq. 0) then i = regl0 if (idir .eq. 1) then is = i - 1 else is = i end if fac0 = 0.5D0 * ir / (ir + 1.0D0) hxm2 = 1.0D0 / (ir * ir * hx * hx) hym2 = 1.0D0 / (jr * jr * hy * hy) hzm2 = 1.0D0 / (kr * kr * hz * hz) do k = regl2, regh2 do j = regl1, regh1 res(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) - fac0 * & (hxm2 * & ((sigmac(is,j-1,k-1) + sigmac(is,j-1,k) + & sigmac(is,j,k-1) + sigmac(is,j,k)) * & (cdst(i-idir,j,k) - cdst(i,j,k))) + & hym2 * & ((sigmac(is,j-1,k-1) + sigmac(is,j-1,k)) * & (cdst(i,j-1,k) - cdst(i,j,k)) + & (sigmac(is,j,k-1) + sigmac(is,j,k)) * & (cdst(i,j+1,k) - cdst(i,j,k))) + & hzm2 * & ((sigmac(is,j-1,k-1) + sigmac(is,j,k-1)) * & (cdst(i,j,k-1) - cdst(i,j,k)) + & (sigmac(is,j-1,k) + sigmac(is,j,k)) * & (cdst(i,j,k+1) - cdst(i,j,k)))) end do end do fac0 = fac0 / (ir * jr * kr * jr * kr) hxm2 = ir * ir * hxm2 hym2 = jr * jr * hym2 hzm2 = kr * kr * hzm2 i = i * ir if (idir .eq. 1) then is = i else is = i - 1 end if do l = 0, kr-1 fac2 = (kr-l) * fac0 if (l .eq. 0) fac2 = 0.5D0 * fac2 do n = 0, jr-1 fac1 = (jr-n) * fac2 if (n .eq. 0) fac1 = 0.5D0 * fac1 do k = kr*regl2, kr*regh2, kr do j = jr*regl1, jr*regh1, jr tmp = hxm2 * & ((sigmaf(is,j-n-1,k-l-1) + sigmaf(is,j-n-1,k-l) + & sigmaf(is,j-n,k-l-1) + sigmaf(is,j-n,k-l)) * & (fdst(i+idir,j-n,k-l) - fdst(i,j-n,k-l)) + & (sigmaf(is,j-n-1,k+l-1) + sigmaf(is,j-n-1,k+l) + & sigmaf(is,j-n,k+l-1) + sigmaf(is,j-n,k+l)) * & (fdst(i+idir,j-n,k+l) - fdst(i,j-n,k+l)) + & (sigmaf(is,j+n-1,k-l-1) + sigmaf(is,j+n-1,k-l) + & sigmaf(is,j+n,k-l-1) + sigmaf(is,j+n,k-l)) * & (fdst(i+idir,j+n,k-l) - fdst(i,j+n,k-l)) + & (sigmaf(is,j+n-1,k+l-1) + sigmaf(is,j+n-1,k+l) + & sigmaf(is,j+n,k+l-1) + sigmaf(is,j+n,k+l)) * & (fdst(i+idir,j+n,k+l) - fdst(i,j+n,k+l))) tmp = tmp + hym2 * & ((sigmaf(is,j-n-1,k-l-1) + sigmaf(is,j-n-1,k-l)) * & (fdst(i,j-n-1,k-l) - fdst(i,j-n,k-l)) + & (sigmaf(is,j-n,k-l-1) + sigmaf(is,j-n,k-l)) * & (fdst(i,j-n+1,k-l) - fdst(i,j-n,k-l)) + & (sigmaf(is,j-n-1,k+l-1) + sigmaf(is,j-n-1,k+l)) * & (fdst(i,j-n-1,k+l) - fdst(i,j-n,k+l)) + & (sigmaf(is,j-n,k+l-1) + sigmaf(is,j-n,k+l)) * & (fdst(i,j-n+1,k+l) - fdst(i,j-n,k+l)) + & (sigmaf(is,j+n-1,k-l-1) + sigmaf(is,j+n-1,k-l)) * & (fdst(i,j+n-1,k-l) - fdst(i,j+n,k-l)) + & (sigmaf(is,j+n,k-l-1) + sigmaf(is,j+n,k-l)) * & (fdst(i,j+n+1,k-l) - fdst(i,j+n,k-l)) + & (sigmaf(is,j+n-1,k+l-1) + sigmaf(is,j+n-1,k+l)) * & (fdst(i,j+n-1,k+l) - fdst(i,j+n,k+l)) + & (sigmaf(is,j+n,k+l-1) + sigmaf(is,j+n,k+l)) * & (fdst(i,j+n+1,k+l) - fdst(i,j+n,k+l))) res(i,j,k) = res(i,j,k) - fac1 * (tmp + hzm2 * & ((sigmaf(is,j-n-1,k-l-1) + sigmaf(is,j-n,k-l-1)) * & (fdst(i,j-n,k-l-1) - fdst(i,j-n,k-l)) + & (sigmaf(is,j-n-1,k-l) + sigmaf(is,j-n,k-l)) * & (fdst(i,j-n,k-l+1) - fdst(i,j-n,k-l)) + & (sigmaf(is,j-n-1,k+l-1) + sigmaf(is,j-n,k+l-1)) * & (fdst(i,j-n,k+l-1) - fdst(i,j-n,k+l)) + & (sigmaf(is,j-n-1,k+l) + sigmaf(is,j-n,k+l)) * & (fdst(i,j-n,k+l+1) - fdst(i,j-n,k+l)) + & (sigmaf(is,j+n-1,k-l-1) + sigmaf(is,j+n,k-l-1)) * & (fdst(i,j+n,k-l-1) - fdst(i,j+n,k-l)) + & (sigmaf(is,j+n-1,k-l) + sigmaf(is,j+n,k-l)) * & (fdst(i,j+n,k-l+1) - fdst(i,j+n,k-l)) + & (sigmaf(is,j+n-1,k+l-1) + sigmaf(is,j+n,k+l-1)) * & (fdst(i,j+n,k+l-1) - fdst(i,j+n,k+l)) + & (sigmaf(is,j+n-1,k+l) + sigmaf(is,j+n,k+l)) * & (fdst(i,j+n,k+l+1) - fdst(i,j+n,k+l)))) end do end do end do end do else if (idim .eq. 1) then j = regl1 if (idir .eq. 1) then js = j - 1 else js = j end if fac0 = 0.5D0 * jr / (jr + 1.0D0) hxm2 = 1.0D0 / (ir * ir * hx * hx) hym2 = 1.0D0 / (jr * jr * hy * hy) hzm2 = 1.0D0 / (kr * kr * hz * hz) do k = regl2, regh2 do i = regl0, regh0 res(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) - fac0 * & (hxm2 * & ((sigmac(i-1,js,k-1) + sigmac(i-1,js,k)) * & (cdst(i-1,j,k) - cdst(i,j,k)) + & (sigmac(i,js,k-1) + sigmac(i,js,k)) * & (cdst(i+1,j,k) - cdst(i,j,k))) + & hym2 * & ((sigmac(i-1,js,k-1) + sigmac(i-1,js,k) + & sigmac(i,js,k-1) + sigmac(i,js,k)) * & (cdst(i,j-idir,k) - cdst(i,j,k))) + & hzm2 * & ((sigmac(i-1,js,k-1) + sigmac(i,js,k-1)) * & (cdst(i,j,k-1) - cdst(i,j,k)) + & (sigmac(i-1,js,k) + sigmac(i,js,k)) * & (cdst(i,j,k+1) - cdst(i,j,k)))) end do end do fac0 = fac0 / (ir * jr * kr * ir * kr) hxm2 = ir * ir * hxm2 hym2 = jr * jr * hym2 hzm2 = kr * kr * hzm2 j = j * jr if (idir .eq. 1) then js = j else js = j - 1 end if do l = 0, kr-1 fac2 = (kr-l) * fac0 if (l .eq. 0) fac2 = 0.5D0 * fac2 do m = 0, ir-1 fac1 = (ir-m) * fac2 if (m .eq. 0) fac1 = 0.5D0 * fac1 do k = kr*regl2, kr*regh2, kr do i = ir*regl0, ir*regh0, ir tmp = hxm2 * & ((sigmaf(i-m-1,js,k-l-1) + sigmaf(i-m-1,js,k-l)) * & (fdst(i-m-1,j,k-l) - fdst(i-m,j,k-l)) + & (sigmaf(i-m,js,k-l-1) + sigmaf(i-m,js,k-l)) * & (fdst(i-m+1,j,k-l) - fdst(i-m,j,k-l)) + & (sigmaf(i-m-1,js,k+l-1) + sigmaf(i-m-1,js,k+l)) * & (fdst(i-m-1,j,k+l) - fdst(i-m,j,k+l)) + & (sigmaf(i-m,js,k+l-1) + sigmaf(i-m,js,k+l)) * & (fdst(i-m+1,j,k+l) - fdst(i-m,j,k+l)) + & (sigmaf(i+m-1,js,k-l-1) + sigmaf(i+m-1,js,k-l)) * & (fdst(i+m-1,j,k-l) - fdst(i+m,j,k-l)) + & (sigmaf(i+m,js,k-l-1) + sigmaf(i+m,js,k-l)) * & (fdst(i+m+1,j,k-l) - fdst(i+m,j,k-l)) + & (sigmaf(i+m-1,js,k+l-1) + sigmaf(i+m-1,js,k+l)) * & (fdst(i+m-1,j,k+l) - fdst(i+m,j,k+l)) + & (sigmaf(i+m,js,k+l-1) + sigmaf(i+m,js,k+l)) * & (fdst(i+m+1,j,k+l) - fdst(i+m,j,k+l))) tmp = tmp + hym2 * & ((sigmaf(i-m-1,js,k-l-1) + sigmaf(i-m-1,js,k-l) + & sigmaf(i-m,js,k-l-1) + sigmaf(i-m,js,k-l)) * & (fdst(i-m,j+idir,k-l) - fdst(i-m,j,k-l)) + & (sigmaf(i-m-1,js,k+l-1) + sigmaf(i-m-1,js,k+l) + & sigmaf(i-m,js,k+l-1) + sigmaf(i-m,js,k+l)) * & (fdst(i-m,j+idir,k+l) - fdst(i-m,j,k+l)) + & (sigmaf(i+m-1,js,k-l-1) + sigmaf(i+m-1,js,k-l) + & sigmaf(i+m,js,k-l-1) + sigmaf(i+m,js,k-l)) * & (fdst(i+m,j+idir,k-l) - fdst(i+m,j,k-l)) + & (sigmaf(i+m-1,js,k+l-1) + sigmaf(i+m-1,js,k+l) + & sigmaf(i+m,js,k+l-1) + sigmaf(i+m,js,k+l)) * & (fdst(i+m,j+idir,k+l) - fdst(i+m,j,k+l))) res(i,j,k) = res(i,j,k) - fac1 * (tmp + hzm2 * & ((sigmaf(i-m-1,js,k-l-1) + sigmaf(i-m,js,k-l-1)) * & (fdst(i-m,j,k-l-1) - fdst(i-m,j,k-l)) + & (sigmaf(i-m-1,js,k-l) + sigmaf(i-m,js,k-l)) * & (fdst(i-m,j,k-l+1) - fdst(i-m,j,k-l)) + & (sigmaf(i-m-1,js,k+l-1) + sigmaf(i-m,js,k+l-1)) * & (fdst(i-m,j,k+l-1) - fdst(i-m,j,k+l)) + & (sigmaf(i-m-1,js,k+l) + sigmaf(i-m,js,k+l)) * & (fdst(i-m,j,k+l+1) - fdst(i-m,j,k+l)) + & (sigmaf(i+m-1,js,k-l-1) + sigmaf(i+m,js,k-l-1)) * & (fdst(i+m,j,k-l-1) - fdst(i+m,j,k-l)) + & (sigmaf(i+m-1,js,k-l) + sigmaf(i+m,js,k-l)) * & (fdst(i+m,j,k-l+1) - fdst(i+m,j,k-l)) + & (sigmaf(i+m-1,js,k+l-1) + sigmaf(i+m,js,k+l-1)) * & (fdst(i+m,j,k+l-1) - fdst(i+m,j,k+l)) + & (sigmaf(i+m-1,js,k+l) + sigmaf(i+m,js,k+l)) * & (fdst(i+m,j,k+l+1) - fdst(i+m,j,k+l)))) end do end do end do end do else k = regl2 if (idir .eq. 1) then ks = k - 1 else ks = k end if fac0 = 0.5D0 * kr / (kr + 1.0D0) hxm2 = 1.0D0 / (ir * ir * hx * hx) hym2 = 1.0D0 / (jr * jr * hy * hy) hzm2 = 1.0D0 / (kr * kr * hz * hz) do j = regl1, regh1 do i = regl0, regh0 res(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) - fac0 * & (hxm2 * & ((sigmac(i-1,j-1,ks) + sigmac(i-1,j,ks)) * & (cdst(i-1,j,k) - cdst(i,j,k)) + & (sigmac(i,j-1,ks) + sigmac(i,j,ks)) * & (cdst(i+1,j,k) - cdst(i,j,k))) + & hym2 * & ((sigmac(i-1,j-1,ks) + sigmac(i,j-1,ks)) * & (cdst(i,j-1,k) - cdst(i,j,k)) + & (sigmac(i-1,j,ks) + sigmac(i,j,ks)) * & (cdst(i,j+1,k) - cdst(i,j,k))) + & hzm2 * & ((sigmac(i-1,j-1,ks) + sigmac(i-1,j,ks) + & sigmac(i,j-1,ks) + sigmac(i,j,ks)) * & (cdst(i,j,k-idir) - cdst(i,j,k)))) end do end do fac0 = fac0 / (ir * jr * kr * ir * jr) hxm2 = ir * ir * hxm2 hym2 = jr * jr * hym2 hzm2 = kr * kr * hzm2 k = k * kr if (idir .eq. 1) then ks = k else ks = k - 1 end if do n = 0, jr-1 fac2 = (jr-n) * fac0 if (n .eq. 0) fac2 = 0.5D0 * fac2 do m = 0, ir-1 fac1 = (ir-m) * fac2 if (m .eq. 0) fac1 = 0.5D0 * fac1 do j = jr*regl1, jr*regh1, jr do i = ir*regl0, ir*regh0, ir tmp = hxm2 * & ((sigmaf(i-m-1,j-n-1,ks) + sigmaf(i-m-1,j-n,ks)) * & (fdst(i-m-1,j-n,k) - fdst(i-m,j-n,k)) + & (sigmaf(i-m,j-n-1,ks) + sigmaf(i-m,j-n,ks)) * & (fdst(i-m+1,j-n,k) - fdst(i-m,j-n,k)) + & (sigmaf(i-m-1,j+n-1,ks) + sigmaf(i-m-1,j+n,ks)) * & (fdst(i-m-1,j+n,k) - fdst(i-m,j+n,k)) + & (sigmaf(i-m,j+n-1,ks) + sigmaf(i-m,j+n,ks)) * & (fdst(i-m+1,j+n,k) - fdst(i-m,j+n,k)) + & (sigmaf(i+m-1,j-n-1,ks) + sigmaf(i+m-1,j-n,ks)) * & (fdst(i+m-1,j-n,k) - fdst(i+m,j-n,k)) + & (sigmaf(i+m,j-n-1,ks) + sigmaf(i+m,j-n,ks)) * & (fdst(i+m+1,j-n,k) - fdst(i+m,j-n,k)) + & (sigmaf(i+m-1,j+n-1,ks) + sigmaf(i+m-1,j+n,ks)) * & (fdst(i+m-1,j+n,k) - fdst(i+m,j+n,k)) + & (sigmaf(i+m,j+n-1,ks) + sigmaf(i+m,j+n,ks)) * & (fdst(i+m+1,j+n,k) - fdst(i+m,j+n,k))) tmp = tmp + hym2 * & ((sigmaf(i-m-1,j-n-1,ks) + sigmaf(i-m,j-n-1,ks)) * & (fdst(i-m,j-n-1,k) - fdst(i-m,j-n,k)) + & (sigmaf(i-m-1,j-n,ks) + sigmaf(i-m,j-n,ks)) * & (fdst(i-m,j-n+1,k) - fdst(i-m,j-n,k)) + & (sigmaf(i-m-1,j+n-1,ks) + sigmaf(i-m,j+n-1,ks)) * & (fdst(i-m,j+n-1,k) - fdst(i-m,j+n,k)) + & (sigmaf(i-m-1,j+n,ks) + sigmaf(i-m,j+n,ks)) * & (fdst(i-m,j+n+1,k) - fdst(i-m,j+n,k)) + & (sigmaf(i+m-1,j-n-1,ks) + sigmaf(i+m,j-n-1,ks)) * & (fdst(i+m,j-n-1,k) - fdst(i+m,j-n,k)) + & (sigmaf(i+m-1,j-n,ks) + sigmaf(i+m,j-n,ks)) * & (fdst(i+m,j-n+1,k) - fdst(i+m,j-n,k)) + & (sigmaf(i+m-1,j+n-1,ks) + sigmaf(i+m,j+n-1,ks)) * & (fdst(i+m,j+n-1,k) - fdst(i+m,j+n,k)) + & (sigmaf(i+m-1,j+n,ks) + sigmaf(i+m,j+n,ks)) * & (fdst(i+m,j+n+1,k) - fdst(i+m,j+n,k))) res(i,j,k) = res(i,j,k) - fac1 * (tmp + hzm2 * & ((sigmaf(i-m-1,j-n-1,ks) + sigmaf(i-m-1,j-n,ks) + & sigmaf(i-m,j-n-1,ks) + sigmaf(i-m,j-n,ks)) * & (fdst(i-m,j-n,k+idir) - fdst(i-m,j-n,k)) + & (sigmaf(i-m-1,j+n-1,ks) + sigmaf(i-m-1,j+n,ks) + & sigmaf(i-m,j+n-1,ks) + sigmaf(i-m,j+n,ks)) * & (fdst(i-m,j+n,k+idir) - fdst(i-m,j+n,k)) + & (sigmaf(i+m-1,j-n-1,ks) + sigmaf(i+m-1,j-n,ks) + & sigmaf(i+m,j-n-1,ks) + sigmaf(i+m,j-n,ks)) * & (fdst(i+m,j-n,k+idir) - fdst(i+m,j-n,k)) + & (sigmaf(i+m-1,j+n-1,ks) + sigmaf(i+m-1,j+n,ks) + & sigmaf(i+m,j+n-1,ks) + sigmaf(i+m,j+n,ks)) * & (fdst(i+m,j+n,k+idir) - fdst(i+m,j+n,k)))) end do end do end do end do end if end c end of variable density stencils c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along face subroutine hgeres( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & fdst, fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2, & cdst, cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2, & sigmaf, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & sigmac, scl0,sch0,scl1,sch1,scl2,sch2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz, ir, jr, kr, ga, ivect) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2 integer cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer scl0,sch0,scl1,sch1,scl2,sch2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1,fdstl2:fdsth2) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1,cdstl2:cdsth2) double precision sigmaf(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2) double precision sigmac(scl0:sch0,scl1:sch1,scl2:sch2) double precision hx, hy, hz integer ir, jr, kr, ivect(0:2), ga(0:1,0:1,0:1) double precision r3, hxm2, hym2, hzm2, hxm2c, hym2c, hzm2c double precision center, cfac, ffac, fac0, fac1, fac, tmp integer ic, jc, kc, if, jf, kf, ii, ji, ki, idir, jdir, kdir integer l, m, n r3 = ir * jr * kr hxm2c = 1.0D0 / (ir * ir * hx * hx) hym2c = 1.0D0 / (jr * jr * hy * hy) hzm2c = 1.0D0 / (kr * kr * hz * hz) hxm2 = ir * ir * hxm2c hym2 = jr * jr * hym2c hzm2 = kr * kr * hzm2c ic = regl0 jc = regl1 kc = regl2 if = ic * ir jf = jc * jr kf = kc * kr center = 0.0D0 if (ivect(0) .eq. 0) then do if = ir*regl0, ir*regh0, ir res(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac0 = 1.0D0 / ir ffac = ir cfac = r3 do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) .eq. 1) then center = center + ffac do m = 0, ir-1 fac = (ir-m) * fac0 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*regl0, ir*regh0, ir tmp = hxm2 * & (sigmaf(if-m-1,jf+ji-1,kf+ki-1) * & (fdst(if-m-1,jf,kf) - fdst(if-m,jf,kf)) + & sigmaf(if-m,jf+ji-1,kf+ki-1) * & (fdst(if-m+1,jf,kf) - fdst(if-m,jf,kf)) + & sigmaf(if+m-1,jf+ji-1,kf+ki-1) * & (fdst(if+m-1,jf,kf) - fdst(if+m,jf,kf)) + & sigmaf(if+m,jf+ji-1,kf+ki-1) * & (fdst(if+m+1,jf,kf) - fdst(if+m,jf,kf))) tmp = tmp + hym2 * & ((sigmaf(if-m-1,jf+ji-1,kf+ki-1) + & sigmaf(if-m,jf+ji-1,kf+ki-1)) * & (fdst(if-m,jf+jdir,kf) - fdst(if-m,jf,kf)) + & (sigmaf(if+m-1,jf+ji-1,kf+ki-1) + & sigmaf(if+m,jf+ji-1,kf+ki-1)) * & (fdst(if+m,jf+jdir,kf) - fdst(if+m,jf,kf))) res(if,jf,kf) = res(if,jf,kf) + fac * (tmp + hzm2 * & ((sigmaf(if-m-1,jf+ji-1,kf+ki-1) + & sigmaf(if-m,jf+ji-1,kf+ki-1)) * & (fdst(if-m,jf,kf+kdir) - fdst(if-m,jf,kf)) + & (sigmaf(if+m-1,jf+ji-1,kf+ki-1) + & sigmaf(if+m,jf+ji-1,kf+ki-1)) * & (fdst(if+m,jf,kf+kdir) - fdst(if+m,jf,kf)))) end do end do else center = center + cfac do ic = regl0, regh0 if = ic * ir res(if,jf,kf) = res(if,jf,kf) + r3 * & (sigmac(ic-1,jc+ji-1,kc+ki-1) * & (hxm2c * (cdst(ic-1,jc,kc) - cdst(ic,jc,kc)) + & hym2c * (cdst(ic,jc+jdir,kc) - cdst(ic,jc,kc)) + & hzm2c * (cdst(ic,jc,kc+kdir) - cdst(ic,jc,kc))) + & sigmac(ic,jc+ji-1,kc+ki-1) * & (hxm2c * (cdst(ic+1,jc,kc) - cdst(ic,jc,kc)) + & hym2c * (cdst(ic,jc+jdir,kc) - cdst(ic,jc,kc)) + & hzm2c * (cdst(ic,jc,kc+kdir) - cdst(ic,jc,kc)))) end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) - ga(0,ji,1-ki) .eq. 1) then fac0 = 1.0D0 / (ir * jr) ffac = ir * (jr - 1) center = center + ffac do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*regl0, ir*regh0, ir tmp = hxm2 * & ((sigmaf(if-m-1,jf+n-1,kf+ki-1) & + sigmaf(if-m-1,jf+n,kf+ki-1)) * & (fdst(if-m-1,jf+n,kf) - fdst(if-m,jf+n,kf)) + & (sigmaf(if-m,jf+n-1,kf+ki-1) & + sigmaf(if-m,jf+n,kf+ki-1)) * & (fdst(if-m+1,jf+n,kf) - fdst(if-m,jf+n,kf)) + & (sigmaf(if+m-1,jf+n-1,kf+ki-1) & + sigmaf(if+m-1,jf+n,kf+ki-1)) * & (fdst(if+m-1,jf+n,kf) - fdst(if+m,jf+n,kf)) + & (sigmaf(if+m,jf+n-1,kf+ki-1) & + sigmaf(if+m,jf+n,kf+ki-1)) * & (fdst(if+m+1,jf+n,kf) - fdst(if+m,jf+n,kf))) tmp = tmp + hym2 * & ((sigmaf(if-m-1,jf+n-1,kf+ki-1) & + sigmaf(if-m,jf+n-1,kf+ki-1)) * & (fdst(if-m,jf+n-1,kf) - fdst(if-m,jf+n,kf)) + & (sigmaf(if-m-1,jf+n,kf+ki-1) & + sigmaf(if-m,jf+n,kf+ki-1)) * & (fdst(if-m,jf+n+1,kf) - fdst(if-m,jf+n,kf)) + & (sigmaf(if+m-1,jf+n-1,kf+ki-1) & + sigmaf(if+m,jf+n-1,kf+ki-1)) * & (fdst(if+m,jf+n-1,kf) - fdst(if+m,jf+n,kf)) + & (sigmaf(if+m-1,jf+n,kf+ki-1) & + sigmaf(if+m,jf+n,kf+ki-1)) * & (fdst(if+m,jf+n+1,kf) - fdst(if+m,jf+n,kf))) res(if,jf,kf) = res(if,jf,kf) & + fac * (tmp + hzm2 * & ((sigmaf(if-m-1,jf+n-1,kf+ki-1) & + sigmaf(if-m-1,jf+n,kf+ki-1) + & sigmaf(if-m,jf+n-1,kf+ki-1) & + sigmaf(if-m,jf+n,kf+ki-1)) * & (fdst(if-m,jf+n,kf+kdir) - fdst(if-m,jf+n,kf)) + & (sigmaf(if+m-1,jf+n-1,kf+ki-1) & + sigmaf(if+m-1,jf+n,kf+ki-1) + & sigmaf(if+m,jf+n-1,kf+ki-1) & + sigmaf(if+m,jf+n,kf+ki-1)) * & (fdst(if+m,jf+n,kf+kdir) - fdst(if+m,jf+n,kf)))) end do end do end do end if if (ga(0,ji,ki) - ga(0,1-ji,ki) .eq. 1) then fac0 = 1.0D0 / (ir * kr) ffac = ir * (kr - 1) center = center + ffac do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*regl0, ir*regh0, ir tmp = hxm2 * & ((sigmaf(if-m-1,jf+ji-1,kf+l-1) & + sigmaf(if-m-1,jf+ji-1,kf+l)) * & (fdst(if-m-1,jf,kf+l) - fdst(if-m,jf,kf+l)) + & (sigmaf(if-m,jf+ji-1,kf+l-1) & + sigmaf(if-m,jf+ji-1,kf+l)) * & (fdst(if-m+1,jf,kf+l) - fdst(if-m,jf,kf+l)) + & (sigmaf(if+m-1,jf+ji-1,kf+l-1) & + sigmaf(if+m-1,jf+ji-1,kf+l)) * & (fdst(if+m-1,jf,kf+l) - fdst(if+m,jf,kf+l)) + & (sigmaf(if+m,jf+ji-1,kf+l-1) & + sigmaf(if+m,jf+ji-1,kf+l)) * & (fdst(if+m+1,jf,kf+l) - fdst(if+m,jf,kf+l))) tmp = tmp + hym2 * & ((sigmaf(if-m-1,jf+ji-1,kf+l-1) & + sigmaf(if-m-1,jf+ji-1,kf+l) + & sigmaf(if-m,jf+ji-1,kf+l-1) & + sigmaf(if-m,jf+ji-1,kf+l)) * & (fdst(if-m,jf+jdir,kf+l) - fdst(if-m,jf,kf+l)) + & (sigmaf(if+m-1,jf+ji-1,kf+l-1) & + sigmaf(if+m-1,jf+ji-1,kf+l) + & sigmaf(if+m,jf+ji-1,kf+l-1) & + sigmaf(if+m,jf+ji-1,kf+l)) * & (fdst(if+m,jf+jdir,kf+l) - fdst(if+m,jf,kf+l))) res(if,jf,kf) = res(if,jf,kf) & + fac * (tmp + hzm2 * & ((sigmaf(if-m-1,jf+ji-1,kf+l-1) & + sigmaf(if-m,jf+ji-1,kf+l-1)) * & (fdst(if-m,jf,kf+l-1) - fdst(if-m,jf,kf+l)) + & (sigmaf(if-m-1,jf+ji-1,kf+l) & + sigmaf(if-m,jf+ji-1,kf+l)) * & (fdst(if-m,jf,kf+l+1) - fdst(if-m,jf,kf+l)) + & (sigmaf(if+m-1,jf+ji-1,kf+l-1) & + sigmaf(if+m,jf+ji-1,kf+l-1)) * & (fdst(if+m,jf,kf+l-1) - fdst(if+m,jf,kf+l)) + & (sigmaf(if+m-1,jf+ji-1,kf+l) & + sigmaf(if+m,jf+ji-1,kf+l)) * & (fdst(if+m,jf,kf+l+1) - fdst(if+m,jf,kf+l)))) end do end do end do end if end do end do c weighting do if = ir*regl0, ir*regh0, ir res(if,jf,kf) = src(if,jf,kf) - res(if,jf,kf) / center end do else if (ivect(1) .eq. 0) then do jf = jr*regl1, jr*regh1, jr res(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac0 = 1.0D0 / jr ffac = jr cfac = r3 do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) .eq. 1) then center = center + ffac do n = 0, jr-1 fac = (jr-n) * fac0 if (n .eq. 0) fac = 0.5D0 * fac do jf = jr*regl1, jr*regh1, jr tmp = hxm2 * & ((sigmaf(if+ii-1,jf-n-1,kf+ki-1) + & sigmaf(if+ii-1,jf-n,kf+ki-1)) * & (fdst(if+idir,jf-n,kf) - fdst(if,jf-n,kf)) + & (sigmaf(if+ii-1,jf+n-1,kf+ki-1) + & sigmaf(if+ii-1,jf+n,kf+ki-1)) * & (fdst(if+idir,jf+n,kf) - fdst(if,jf+n,kf))) tmp = tmp + hym2 * & (sigmaf(if+ii-1,jf-n-1,kf+ki-1) * & (fdst(if,jf-n-1,kf) - fdst(if,jf-n,kf)) + & sigmaf(if+ii-1,jf-n,kf+ki-1) * & (fdst(if,jf-n+1,kf) - fdst(if,jf-n,kf)) + & sigmaf(if+ii-1,jf+n-1,kf+ki-1) * & (fdst(if,jf+n-1,kf) - fdst(if,jf+n,kf)) + & sigmaf(if+ii-1,jf+n,kf+ki-1) * & (fdst(if,jf+n+1,kf) - fdst(if,jf+n,kf))) res(if,jf,kf) = res(if,jf,kf) + fac * (tmp + hzm2 * & ((sigmaf(if+ii-1,jf-n-1,kf+ki-1) + & sigmaf(if+ii-1,jf-n,kf+ki-1)) * & (fdst(if,jf-n,kf+kdir) - fdst(if,jf-n,kf)) + & (sigmaf(if+ii-1,jf+n-1,kf+ki-1) + & sigmaf(if+ii-1,jf+n,kf+ki-1)) * & (fdst(if,jf+n,kf+kdir) - fdst(if,jf+n,kf)))) end do end do else center = center + cfac do jc = regl1, regh1 jf = jc * jr res(if,jf,kf) = res(if,jf,kf) + r3 * & (sigmac(ic+ii-1,jc-1,kc+ki-1) * & (hxm2c * (cdst(ic+idir,jc,kc) - cdst(ic,jc,kc)) + & hym2c * (cdst(ic,jc-1,kc) - cdst(ic,jc,kc)) + & hzm2c * (cdst(ic,jc,kc+kdir) - cdst(ic,jc,kc))) + & sigmac(ic+ii-1,jc,kc+ki-1) * & (hxm2c * (cdst(ic+idir,jc,kc) - cdst(ic,jc,kc)) + & hym2c * (cdst(ic,jc+1,kc) - cdst(ic,jc,kc)) + & hzm2c * (cdst(ic,jc,kc+kdir) - cdst(ic,jc,kc)))) end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) - ga(ii,0,1-ki) .eq. 1) then fac0 = 1.0D0 / (ir * jr) ffac = jr * (ir - 1) center = center + ffac do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do jf = jr*regl1, jr*regh1, jr tmp = hxm2 * & ((sigmaf(if+m-1,jf-n-1,kf+ki-1) & + sigmaf(if+m-1,jf-n,kf+ki-1)) * & (fdst(if+m-1,jf-n,kf) - fdst(if+m,jf-n,kf)) + & (sigmaf(if+m,jf-n-1,kf+ki-1) & + sigmaf(if+m,jf-n,kf+ki-1)) * & (fdst(if+m+1,jf-n,kf) - fdst(if+m,jf-n,kf)) + & (sigmaf(if+m-1,jf+n-1,kf+ki-1) & + sigmaf(if+m-1,jf+n,kf+ki-1)) * & (fdst(if+m-1,jf+n,kf) - fdst(if+m,jf+n,kf)) + & (sigmaf(if+m,jf+n-1,kf+ki-1) & + sigmaf(if+m,jf+n,kf+ki-1)) * & (fdst(if+m+1,jf+n,kf) - fdst(if+m,jf+n,kf))) tmp = tmp + hym2 * & ((sigmaf(if+m-1,jf-n-1,kf+ki-1) & + sigmaf(if+m,jf-n-1,kf+ki-1)) * & (fdst(if+m,jf-n-1,kf) - fdst(if+m,jf-n,kf)) + & (sigmaf(if+m-1,jf-n,kf+ki-1) & + sigmaf(if+m,jf-n,kf+ki-1)) * & (fdst(if+m,jf-n+1,kf) - fdst(if+m,jf-n,kf)) + & (sigmaf(if+m-1,jf+n-1,kf+ki-1) & + sigmaf(if+m,jf+n-1,kf+ki-1)) * & (fdst(if+m,jf+n-1,kf) - fdst(if+m,jf+n,kf)) + & (sigmaf(if+m-1,jf+n,kf+ki-1) & + sigmaf(if+m,jf+n,kf+ki-1)) * & (fdst(if+m,jf+n+1,kf) - fdst(if+m,jf+n,kf))) res(if,jf,kf) = res(if,jf,kf) & + fac * (tmp + hzm2 * & ((sigmaf(if+m-1,jf-n-1,kf+ki-1) & + sigmaf(if+m-1,jf-n,kf+ki-1) + & sigmaf(if+m,jf-n-1,kf+ki-1) & + sigmaf(if+m,jf-n,kf+ki-1)) * & (fdst(if+m,jf-n,kf+kdir) - fdst(if+m,jf-n,kf)) + & (sigmaf(if+m-1,jf+n-1,kf+ki-1) & + sigmaf(if+m-1,jf+n,kf+ki-1) + & sigmaf(if+m,jf+n-1,kf+ki-1) & + sigmaf(if+m,jf+n,kf+ki-1)) * & (fdst(if+m,jf+n,kf+kdir) - fdst(if+m,jf+n,kf)))) end do end do end do end if if (ga(ii,0,ki) - ga(1-ii,0,ki) .eq. 1) then fac0 = 1.0D0 / (jr * kr) ffac = jr * (kr - 1) center = center + ffac do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do jf = jr*regl1, jr*regh1, jr tmp = hxm2 * & ((sigmaf(if+ii-1,jf-n-1,kf+l-1) & + sigmaf(if+ii-1,jf-n-1,kf+l) + & sigmaf(if+ii-1,jf-n,kf+l-1) & + sigmaf(if+ii-1,jf-n,kf+l)) * & (fdst(if+idir,jf-n,kf+l) - fdst(if,jf-n,kf+l)) + & (sigmaf(if+ii-1,jf+n-1,kf+l-1) & + sigmaf(if+ii-1,jf+n-1,kf+l) + & sigmaf(if+ii-1,jf+n,kf+l-1) & + sigmaf(if+ii-1,jf+n,kf+l)) * & (fdst(if+idir,jf+n,kf+l) - fdst(if,jf+n,kf+l))) tmp = tmp + hym2 * & ((sigmaf(if+ii-1,jf-n-1,kf+l-1) & + sigmaf(if+ii-1,jf-n-1,kf+l)) * & (fdst(if,jf-n-1,kf+l) - fdst(if,jf-n,kf+l)) + & (sigmaf(if+ii-1,jf-n,kf+l-1) & + sigmaf(if+ii-1,jf-n,kf+l)) * & (fdst(if,jf-n+1,kf+l) - fdst(if,jf-n,kf+l)) + & (sigmaf(if+ii-1,jf+n-1,kf+l-1) & + sigmaf(if+ii-1,jf+n-1,kf+l)) * & (fdst(if,jf+n-1,kf+l) - fdst(if,jf+n,kf+l)) + & (sigmaf(if+ii-1,jf+n,kf+l-1) & + sigmaf(if+ii-1,jf+n,kf+l)) * & (fdst(if,jf+n+1,kf+l) - fdst(if,jf+n,kf+l))) res(if,jf,kf) = res(if,jf,kf) & + fac * (tmp + hzm2 * & ((sigmaf(if+ii-1,jf-n-1,kf+l-1) & + sigmaf(if+ii-1,jf-n,kf+l-1)) * & (fdst(if,jf-n,kf+l-1) - fdst(if,jf-n,kf+l)) + & (sigmaf(if+ii-1,jf-n-1,kf+l) & + sigmaf(if+ii-1,jf-n,kf+l)) * & (fdst(if,jf-n,kf+l+1) - fdst(if,jf-n,kf+l)) + & (sigmaf(if+ii-1,jf+n-1,kf+l-1) & + sigmaf(if+ii-1,jf+n,kf+l-1)) * & (fdst(if,jf+n,kf+l-1) - fdst(if,jf+n,kf+l)) + & (sigmaf(if+ii-1,jf+n-1,kf+l) & + sigmaf(if+ii-1,jf+n,kf+l)) * & (fdst(if,jf+n,kf+l+1) - fdst(if,jf+n,kf+l)))) end do end do end do end if end do end do c weighting do jf = jr*regl1, jr*regh1, jr res(if,jf,kf) = src(if,jf,kf) - res(if,jf,kf) / center end do else do kf = kr*regl2, kr*regh2, kr res(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac0 = 1.0D0 / kr ffac = kr cfac = r3 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) .eq. 1) then center = center + ffac do l = 0, kr-1 fac = (kr-l) * fac0 if (l .eq. 0) fac = 0.5D0 * fac do kf = kr*regl2, kr*regh2, kr tmp = hxm2 * & ((sigmaf(if+ii-1,jf+ji-1,kf-l-1) + & sigmaf(if+ii-1,jf+ji-1,kf-l)) * & (fdst(if+idir,jf,kf-l) - fdst(if,jf,kf-l)) + & (sigmaf(if+ii-1,jf+ji-1,kf+l-1) + & sigmaf(if+ii-1,jf+ji-1,kf+l)) * & (fdst(if+idir,jf,kf+l) - fdst(if,jf,kf+l))) tmp = tmp + hym2 * & ((sigmaf(if+ii-1,jf+ji-1,kf-l-1) + & sigmaf(if+ii-1,jf+ji-1,kf-l)) * & (fdst(if,jf+jdir,kf-l) - fdst(if,jf,kf-l)) + & (sigmaf(if+ii-1,jf+ji-1,kf+l-1) + & sigmaf(if+ii-1,jf+ji-1,kf+l)) * & (fdst(if,jf+jdir,kf+l) - fdst(if,jf,kf+l))) res(if,jf,kf) = res(if,jf,kf) + fac * (tmp + hzm2 * & (sigmaf(if+ii-1,jf+ji-1,kf-l-1) * & (fdst(if,jf,kf-l-1) - fdst(if,jf,kf-l)) + & sigmaf(if+ii-1,jf+ji-1,kf-l) * & (fdst(if,jf,kf-l+1) - fdst(if,jf,kf-l)) + & sigmaf(if+ii-1,jf+ji-1,kf+l-1) * & (fdst(if,jf,kf+l-1) - fdst(if,jf,kf+l)) + & sigmaf(if+ii-1,jf+ji-1,kf+l) * & (fdst(if,jf,kf+l+1) - fdst(if,jf,kf+l)))) end do end do else center = center + cfac do kc = regl2, regh2 kf = kc * kr res(if,jf,kf) = res(if,jf,kf) + r3 * & (sigmac(ic+ii-1,jc+ji-1,kc-1) * & (hxm2c * (cdst(ic+idir,jc,kc) - cdst(ic,jc,kc)) + & hym2c * (cdst(ic,jc+jdir,kc) - cdst(ic,jc,kc)) + & hzm2c * (cdst(ic,jc,kc-1) - cdst(ic,jc,kc))) + & sigmac(ic+ii-1,jc+ji-1,kc) * & (hxm2c * (cdst(ic+idir,jc,kc) - cdst(ic,jc,kc)) + & hym2c * (cdst(ic,jc+jdir,kc) - cdst(ic,jc,kc)) + & hzm2c * (cdst(ic,jc,kc+1) - cdst(ic,jc,kc)))) end do end if end do end do c faces c each face is two faces and two sides of an edge do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) - ga(ii,1-ji,0) .eq. 1) then fac0 = 1.0D0 / (ir * kr) ffac = kr * (ir - 1) center = center + ffac do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do kf = kr*regl2, kr*regh2, kr tmp = hxm2 * & ((sigmaf(if+m-1,jf+ji-1,kf-l-1) & + sigmaf(if+m-1,jf+ji-1,kf-l)) * & (fdst(if+m-1,jf,kf-l) - fdst(if+m,jf,kf-l)) + & (sigmaf(if+m,jf+ji-1,kf-l-1) & + sigmaf(if+m,jf+ji-1,kf-l)) * & (fdst(if+m+1,jf,kf-l) - fdst(if+m,jf,kf-l)) + & (sigmaf(if+m-1,jf+ji-1,kf+l-1) & + sigmaf(if+m-1,jf+ji-1,kf+l)) * & (fdst(if+m-1,jf,kf+l) - fdst(if+m,jf,kf+l)) + & (sigmaf(if+m,jf+ji-1,kf+l-1) & + sigmaf(if+m,jf+ji-1,kf+l)) * & (fdst(if+m+1,jf,kf+l) - fdst(if+m,jf,kf+l))) tmp = tmp + hym2 * & ((sigmaf(if+m-1,jf+ji-1,kf-l-1) & + sigmaf(if+m-1,jf+ji-1,kf-l) + & sigmaf(if+m,jf+ji-1,kf-l-1) & + sigmaf(if+m,jf+ji-1,kf-l)) * & (fdst(if+m,jf+jdir,kf-l) - fdst(if+m,jf,kf-l)) + & (sigmaf(if+m-1,jf+ji-1,kf+l-1) & + sigmaf(if+m-1,jf+ji-1,kf+l) + & sigmaf(if+m,jf+ji-1,kf+l-1) & + sigmaf(if+m,jf+ji-1,kf+l)) * & (fdst(if+m,jf+jdir,kf+l) - fdst(if+m,jf,kf+l))) res(if,jf,kf) = res(if,jf,kf) & + fac * (tmp + hzm2 * & ((sigmaf(if+m-1,jf+ji-1,kf-l-1) & + sigmaf(if+m,jf+ji-1,kf-l-1)) * & (fdst(if+m,jf,kf-l-1) - fdst(if+m,jf,kf-l)) + & (sigmaf(if+m-1,jf+ji-1,kf-l) & + sigmaf(if+m,jf+ji-1,kf-l)) * & (fdst(if+m,jf,kf-l+1) - fdst(if+m,jf,kf-l)) + & (sigmaf(if+m-1,jf+ji-1,kf+l-1) & + sigmaf(if+m,jf+ji-1,kf+l-1)) * & (fdst(if+m,jf,kf+l-1) - fdst(if+m,jf,kf+l)) + & (sigmaf(if+m-1,jf+ji-1,kf+l) & + sigmaf(if+m,jf+ji-1,kf+l)) * & (fdst(if+m,jf,kf+l+1) - fdst(if+m,jf,kf+l)))) end do end do end do end if if (ga(ii,ji,0) - ga(1-ii,ji,0) .eq. 1) then fac0 = 1.0D0 / (jr * kr) ffac = kr * (jr - 1) center = center + ffac do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 do kf = kr*regl2, kr*regh2, kr tmp = hxm2 * & ((sigmaf(if+ii-1,jf+n-1,kf-l-1) & + sigmaf(if+ii-1,jf+n-1,kf-l) + & sigmaf(if+ii-1,jf+n,kf-l-1) & + sigmaf(if+ii-1,jf+n,kf-l)) * & (fdst(if+idir,jf+n,kf-l) - fdst(if,jf+n,kf-l)) + & (sigmaf(if+ii-1,jf+n-1,kf+l-1) & + sigmaf(if+ii-1,jf+n-1,kf+l) + & sigmaf(if+ii-1,jf+n,kf+l-1) & + sigmaf(if+ii-1,jf+n,kf+l)) * & (fdst(if+idir,jf+n,kf+l) - fdst(if,jf+n,kf+l))) tmp = tmp + hym2 * & ((sigmaf(if+ii-1,jf+n-1,kf-l-1) & + sigmaf(if+ii-1,jf+n-1,kf-l)) * & (fdst(if,jf+n-1,kf-l) - fdst(if,jf+n,kf-l)) + & (sigmaf(if+ii-1,jf+n,kf-l-1) & + sigmaf(if+ii-1,jf+n,kf-l)) * & (fdst(if,jf+n+1,kf-l) - fdst(if,jf+n,kf-l)) + & (sigmaf(if+ii-1,jf+n-1,kf+l-1) & + sigmaf(if+ii-1,jf+n-1,kf+l)) * & (fdst(if,jf+n-1,kf+l) - fdst(if,jf+n,kf+l)) + & (sigmaf(if+ii-1,jf+n,kf+l-1) & + sigmaf(if+ii-1,jf+n,kf+l)) * & (fdst(if,jf+n+1,kf+l) - fdst(if,jf+n,kf+l))) res(if,jf,kf) = res(if,jf,kf) & + fac * (tmp + hzm2 * & ((sigmaf(if+ii-1,jf+n-1,kf-l-1) & + sigmaf(if+ii-1,jf+n,kf-l-1)) * & (fdst(if,jf+n,kf-l-1) - fdst(if,jf+n,kf-l)) + & (sigmaf(if+ii-1,jf+n-1,kf-l) & + sigmaf(if+ii-1,jf+n,kf-l)) * & (fdst(if,jf+n,kf-l+1) - fdst(if,jf+n,kf-l)) + & (sigmaf(if+ii-1,jf+n-1,kf+l-1) & + sigmaf(if+ii-1,jf+n,kf+l-1)) * & (fdst(if,jf+n,kf+l-1) - fdst(if,jf+n,kf+l)) + & (sigmaf(if+ii-1,jf+n-1,kf+l) & + sigmaf(if+ii-1,jf+n,kf+l)) * & (fdst(if,jf+n,kf+l+1) - fdst(if,jf+n,kf+l)))) end do end do end do end if end do end do c weighting do kf = kr*regl2, kr*regh2, kr res(if,jf,kf) = src(if,jf,kf) - res(if,jf,kf) / center end do end if end c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along face subroutine hgcres( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & fdst, fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2, & cdst, cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2, & sigmaf, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & sigmac, scl0,sch0,scl1,sch1,scl2,sch2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz, ir, jr, kr, ga, idd) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2 integer cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer scl0,sch0,scl1,sch1,scl2,sch2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1,fdstl2:fdsth2) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1,cdstl2:cdsth2) double precision sigmaf(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2) double precision sigmac(scl0:sch0,scl1:sch1,scl2:sch2) double precision hx, hy, hz integer ir, jr, kr, ga(0:1,0:1,0:1), idd double precision r3, hxm2, hym2, hzm2, hxm2c, hym2c, hzm2c double precision sum, center, cfac, ffac, fac1, fac2, fac integer ic, jc, kc, if, jf, kf, ii, ji, ki, idir, jdir, kdir integer l, m, n r3 = ir * jr * kr hxm2c = 1.0D0 / (ir * ir * hx * hx) hym2c = 1.0D0 / (jr * jr * hy * hy) hzm2c = 1.0D0 / (kr * kr * hz * hz) hxm2 = ir * ir * hxm2c hym2 = jr * jr * hym2c hzm2 = kr * kr * hzm2c ic = regl0 jc = regl1 kc = regl2 if = ic * ir jf = jc * jr kf = kc * kr sum = 0.0D0 center = 0.0D0 c octants fac = 1.0D0 ffac = 0.5D0 cfac = 0.5D0 * r3 do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) .eq. 1) then center = center + ffac sum = sum + fac * sigmaf(if+ii-1,jf+ji-1,kf+ki-1) * & (hxm2 * (fdst(if+idir,jf,kf) - fdst(if,jf,kf)) + & hym2 * (fdst(if,jf+jdir,kf) - fdst(if,jf,kf)) + & hzm2 * (fdst(if,jf,kf+kdir) - fdst(if,jf,kf))) else center = center + cfac sum = sum + r3 * sigmac(ic+ii-1,jc+ji-1,kc+ki-1) * & (hxm2c * (cdst(ic+idir,jc,kc) - cdst(ic,jc,kc)) + & hym2c * (cdst(ic,jc+jdir,kc) - cdst(ic,jc,kc)) + & hzm2c * (cdst(ic,jc,kc+kdir) - cdst(ic,jc,kc))) end if end do end do end do c faces do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) - ga(ii,ji,1-ki) .eq. 1) then fac2 = 1.0D0 / (ir * jr) ffac = 0.5D0 * (ir-1) * (jr-1) center = center + ffac do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac2 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * & (hxm2 * & ((sigmaf(if+m-1,jf+n-1,kf+ki-1) & + sigmaf(if+m-1,jf+n,kf+ki-1)) * & (fdst(if+m-1,jf+n,kf) - fdst(if+m,jf+n,kf)) + & (sigmaf(if+m,jf+n-1,kf+ki-1) & + sigmaf(if+m,jf+n,kf+ki-1)) * & (fdst(if+m+1,jf+n,kf) - fdst(if+m,jf+n,kf))) + & hym2 * & ((sigmaf(if+m-1,jf+n-1,kf+ki-1) & + sigmaf(if+m,jf+n-1,kf+ki-1)) * & (fdst(if+m,jf+n-1,kf) - fdst(if+m,jf+n,kf)) + & (sigmaf(if+m-1,jf+n,kf+ki-1) & + sigmaf(if+m,jf+n,kf+ki-1)) * & (fdst(if+m,jf+n+1,kf) - fdst(if+m,jf+n,kf))) + & hzm2 * & ((sigmaf(if+m-1,jf+n-1,kf+ki-1) & + sigmaf(if+m-1,jf+n,kf+ki-1) + & sigmaf(if+m,jf+n-1,kf+ki-1) & + sigmaf(if+m,jf+n,kf+ki-1)) * & (fdst(if+m,jf+n,kf+kdir) - fdst(if+m,jf+n,kf)))) end do end do end if if (ga(ii,ji,ki) - ga(ii,1-ji,ki) .eq. 1) then fac2 = 1.0D0 / (ir * kr) ffac = 0.5D0 * (ir-1) * (kr-1) center = center + ffac do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac2 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * & (hxm2 * & ((sigmaf(if+m-1,jf+ji-1,kf+l-1) & + sigmaf(if+m-1,jf+ji-1,kf+l)) * & (fdst(if+m-1,jf,kf+l) - fdst(if+m,jf,kf+l)) + & (sigmaf(if+m,jf+ji-1,kf+l-1) & + sigmaf(if+m,jf+ji-1,kf+l)) * & (fdst(if+m+1,jf,kf+l) - fdst(if+m,jf,kf+l))) + & hym2 * & ((sigmaf(if+m-1,jf+ji-1,kf+l-1) & + sigmaf(if+m-1,jf+ji-1,kf+l) + & sigmaf(if+m,jf+ji-1,kf+l-1) & + sigmaf(if+m,jf+ji-1,kf+l)) * & (fdst(if+m,jf+jdir,kf+l) - fdst(if+m,jf,kf+l))) + & hzm2 * & ((sigmaf(if+m-1,jf+ji-1,kf+l-1) & + sigmaf(if+m,jf+ji-1,kf+l-1)) * & (fdst(if+m,jf,kf+l-1) - fdst(if+m,jf,kf+l)) + & (sigmaf(if+m-1,jf+ji-1,kf+l) & + sigmaf(if+m,jf+ji-1,kf+l)) * & (fdst(if+m,jf,kf+l+1) - fdst(if+m,jf,kf+l)))) end do end do end if if (ga(ii,ji,ki) - ga(1-ii,ji,ki) .eq. 1) then fac2 = 1.0D0 / (jr * kr) ffac = 0.5D0 * (jr-1) * (kr-1) center = center + ffac do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac2 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * & (hxm2 * & ((sigmaf(if+ii-1,jf+n-1,kf+l-1) & + sigmaf(if+ii-1,jf+n-1,kf+l) + & sigmaf(if+ii-1,jf+n,kf+l-1) & + sigmaf(if+ii-1,jf+n,kf+l)) * & (fdst(if+idir,jf+n,kf+l) - fdst(if,jf+n,kf+l))) + & hym2 * & ((sigmaf(if+ii-1,jf+n-1,kf+l-1) & + sigmaf(if+ii-1,jf+n-1,kf+l)) * & (fdst(if,jf+n-1,kf+l) - fdst(if,jf+n,kf+l)) + & (sigmaf(if+ii-1,jf+n,kf+l-1) & + sigmaf(if+ii-1,jf+n,kf+l)) * & (fdst(if,jf+n+1,kf+l) - fdst(if,jf+n,kf+l))) + & hzm2 * & ((sigmaf(if+ii-1,jf+n-1,kf+l-1) & + sigmaf(if+ii-1,jf+n,kf+l-1)) * & (fdst(if,jf+n,kf+l-1) - fdst(if,jf+n,kf+l)) + & (sigmaf(if+ii-1,jf+n-1,kf+l) & + sigmaf(if+ii-1,jf+n,kf+l)) * & (fdst(if,jf+n,kf+l+1) - fdst(if,jf+n,kf+l)))) end do end do end if end do end do end do c edges do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(ii,1-ji,ki), ga(ii,1-ji,1-ki)) & .eq. 1) then fac1 = 1.0D0 / ir ffac = 0.5D0 * (ir-1) center = center + ffac do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * & (hxm2 * & (sigmaf(if+m-1,jf+ji-1,kf+ki-1) * & (fdst(if+m-1,jf,kf) - fdst(if+m,jf,kf)) + & sigmaf(if+m,jf+ji-1,kf+ki-1) * & (fdst(if+m+1,jf,kf) - fdst(if+m,jf,kf))) + & hym2 * & (sigmaf(if+m-1,jf+ji-1,kf+ki-1) & + sigmaf(if+m,jf+ji-1,kf+ki-1)) * & (fdst(if+m,jf+jdir,kf) - fdst(if+m,jf,kf)) + & hzm2 * & (sigmaf(if+m-1,jf+ji-1,kf+ki-1) & + sigmaf(if+m,jf+ji-1,kf+ki-1)) * & (fdst(if+m,jf,kf+kdir) - fdst(if+m,jf,kf))) end do end if if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(1-ii,ji,ki), ga(1-ii,ji,1-ki)) & .eq. 1) then fac1 = 1.0D0 / jr ffac = 0.5D0 * (jr-1) center = center + ffac do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * & (hxm2 * & (sigmaf(if+ii-1,jf+n-1,kf+ki-1) & + sigmaf(if+ii-1,jf+n,kf+ki-1)) * & (fdst(if+idir,jf+n,kf) - fdst(if,jf+n,kf)) + & hym2 * & (sigmaf(if+ii-1,jf+n-1,kf+ki-1) * & (fdst(if,jf+n-1,kf) - fdst(if,jf+n,kf)) + & sigmaf(if+ii-1,jf+n,kf+ki-1) * & (fdst(if,jf+n+1,kf) - fdst(if,jf+n,kf))) + & hzm2 * & (sigmaf(if+ii-1,jf+n-1,kf+ki-1) & + sigmaf(if+ii-1,jf+n,kf+ki-1)) * & (fdst(if,jf+n,kf+kdir) - fdst(if,jf+n,kf))) end do end if if (ga(ii,ji,ki) - & min(ga(ii,1-ji,ki), ga(1-ii,ji,ki), ga(1-ii,1-ji,ki)) & .eq. 1) then fac1 = 1.0D0 / kr ffac = 0.5D0 * (kr-1) center = center + ffac do l = kdir, kdir*(kr-1), kdir fac = (kr-abs(l)) * fac1 sum = sum + fac * & (hxm2 * & (sigmaf(if+ii-1,jf+ji-1,kf+l-1) & + sigmaf(if+ii-1,jf+ji-1,kf+l)) * & (fdst(if+idir,jf,kf+l) - fdst(if,jf,kf+l)) + & hym2 * & (sigmaf(if+ii-1,jf+ji-1,kf+l-1) & + sigmaf(if+ii-1,jf+ji-1,kf+l)) * & (fdst(if,jf+jdir,kf+l) - fdst(if,jf,kf+l)) + & hzm2 * & (sigmaf(if+ii-1,jf+ji-1,kf+l-1) * & (fdst(if,jf,kf+l-1) - fdst(if,jf,kf+l)) + & sigmaf(if+ii-1,jf+ji-1,kf+l) * & (fdst(if,jf,kf+l+1) - fdst(if,jf,kf+l)))) end do end if end do end do end do c weighting res(if,jf,kf) = src(if,jf,kf) - sum / center end c----------------------------------------------------------------------- c NODE-based data, factor of 2 only. subroutine hgints_dense( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & sigx, sigy, sigz, & sbl0,sbh0,sbl1,sbh1,sbl2,sbh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & bbl0,bbh0,bbl1,bbh1,bbl2,bbh2, & ir, jr, kr) integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer sbl0,sbh0,sbl1,sbh1,sbl2,sbh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer bbl0,bbh0,bbl1,bbh1,bbl2,bbh2 integer ir, jr, kr double precision dest(destl0:desth0,destl1:desth1,destl2:desth2) double precision sigx(sbl0:sbh0,sbl1:sbh1,sbl2:sbh2) double precision sigy(sbl0:sbh0,sbl1:sbh1,sbl2:sbh2) double precision sigz(sbl0:sbh0,sbl1:sbh1,sbl2:sbh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) integer i, j, k, ic, jc, kc do kc = bbl2, bbh2 do jc = bbl1, bbh1 do ic = bbl0, bbh0 dest(ir*ic,jr*jc,kr*kc) = src(ic,jc,kc) end do end do end do if (ir .eq. 2) then do kc = bbl2, bbh2 do jc = bbl1, bbh1 do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc k = kr * kc dest(i+1,j,k) = ((sigx(i,j-1,k-1) + sigx(i,j-1,k) + & sigx(i,j,k-1) + sigx(i,j,k)) * & src(ic,jc,kc) + & (sigx(i+1,j-1,k-1) + sigx(i+1,j-1,k) + & sigx(i+1,j,k-1) + sigx(i+1,j,k)) * & src(ic+1,jc,kc)) / & (sigx(i,j-1,k-1) + sigx(i,j-1,k) + & sigx(i,j,k-1) + sigx(i,j,k) + & sigx(i+1,j-1,k-1) + sigx(i+1,j-1,k) + & sigx(i+1,j,k-1) + sigx(i+1,j,k)) end do end do end do end if if (jr .eq. 2) then do kc = bbl2, bbh2 do jc = bbl1, bbh1-1 do ic = bbl0, bbh0 i = ir * ic j = jr * jc k = kr * kc dest(i,j+1,k) = ((sigy(i-1,j,k-1) + sigy(i-1,j,k) + & sigy(i,j,k-1) + sigy(i,j,k)) * & src(ic,jc,kc) + & (sigy(i-1,j+1,k-1) + sigy(i-1,j+1,k) + & sigy(i,j+1,k-1) + sigy(i,j+1,k)) * & src(ic,jc+1,kc)) / & (sigy(i-1,j,k-1) + sigy(i-1,j,k) + & sigy(i,j,k-1) + sigy(i,j,k) + & sigy(i-1,j+1,k-1) + sigy(i-1,j+1,k) + & sigy(i,j+1,k-1) + sigy(i,j+1,k)) end do end do end do end if if (kr .eq. 2) then do kc = bbl2, bbh2-1 do jc = bbl1, bbh1 do ic = bbl0, bbh0 i = ir * ic j = jr * jc k = kr * kc dest(i,j,k+1) = ((sigz(i-1,j-1,k) + sigz(i-1,j,k) + & sigz(i,j-1,k) + sigz(i,j,k)) * & src(ic,jc,kc) + & (sigz(i-1,j-1,k+1) + sigz(i-1,j,k+1) + & sigz(i,j-1,k+1) + sigz(i,j,k+1)) * & src(ic,jc,kc+1)) / & (sigz(i-1,j-1,k) + sigz(i-1,j,k) + & sigz(i,j-1,k) + sigz(i,j,k) + & sigz(i-1,j-1,k+1) + sigz(i-1,j,k+1) + & sigz(i,j-1,k+1) + sigz(i,j,k+1)) end do end do end do end if if (ir .eq. 2 .and. jr .eq. 2) then do kc = bbl2, bbh2 do jc = bbl1, bbh1-1 cdir$ ivdep do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc k = kr * kc dest(i+1,j+1,k) = ((sigx(i,j,k-1) + sigx(i,j,k) + & sigx(i,j+1,k-1) + sigx(i,j+1,k)) * & dest(i,j+1,k) + & (sigx(i+1,j,k-1) + sigx(i+1,j,k) + & sigx(i+1,j+1,k-1) + sigx(i+1,j+1,k)) * & dest(i+2,j+1,k) + & (sigy(i,j,k-1) + sigy(i,j,k) + & sigy(i+1,j,k-1) + sigy(i+1,j,k)) * & dest(i+1,j,k) + & (sigy(i,j+1,k-1) + sigy(i,j+1,k) + & sigy(i+1,j+1,k-1) + sigy(i+1,j+1,k)) * & dest(i+1,j+2,k)) / & (sigx(i,j,k-1) + sigx(i,j,k) + & sigx(i,j+1,k-1) + sigx(i,j+1,k) + & sigx(i+1,j,k-1) + sigx(i+1,j,k) + & sigx(i+1,j+1,k-1) + sigx(i+1,j+1,k) + & sigy(i,j,k-1) + sigy(i,j,k) + & sigy(i+1,j,k-1) + sigy(i+1,j,k) + & sigy(i,j+1,k-1) + sigy(i,j+1,k) + & sigy(i+1,j+1,k-1) + sigy(i+1,j+1,k)) end do end do end do end if if (ir .eq. 2 .and. kr .eq. 2) then do kc = bbl2, bbh2-1 do jc = bbl1, bbh1 cdir$ ivdep do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc k = kr * kc dest(i+1,j,k+1) = ((sigx(i,j-1,k) + sigx(i,j-1,k+1) + & sigx(i,j,k) + sigx(i,j,k+1)) * & dest(i,j,k+1) + & (sigx(i+1,j-1,k) + sigx(i+1,j-1,k+1) + & sigx(i+1,j,k) + sigx(i+1,j,k+1)) * & dest(i+2,j,k+1) + & (sigz(i,j-1,k) + sigz(i,j,k) + & sigz(i+1,j-1,k) + sigz(i+1,j,k)) * & dest(i+1,j,k) + & (sigz(i,j-1,k+1) + sigz(i,j,k+1) + & sigz(i+1,j-1,k+1) + sigz(i+1,j,k+1)) * & dest(i+1,j,k+2)) / & (sigx(i,j-1,k) + sigx(i,j-1,k+1) + & sigx(i,j,k) + sigx(i,j,k+1) + & sigx(i+1,j-1,k) + sigx(i+1,j-1,k+1) + & sigx(i+1,j,k) + sigx(i+1,j,k+1) + & sigz(i,j-1,k) + sigz(i,j,k) + & sigz(i+1,j-1,k) + sigz(i+1,j,k) + & sigz(i,j-1,k+1) + sigz(i,j,k+1) + & sigz(i+1,j-1,k+1) + sigz(i+1,j,k+1)) end do end do end do end if if (jr .eq. 2 .and. kr .eq. 2) then do kc = bbl2, bbh2-1 do jc = bbl1, bbh1-1 cdir$ ivdep do ic = bbl0, bbh0 i = ir * ic j = jr * jc k = kr * kc dest(i,j+1,k+1) = ((sigy(i-1,j,k) + sigy(i-1,j,k+1) + & sigy(i,j,k) + sigy(i,j,k+1)) * & dest(i,j,k+1) + & (sigy(i-1,j+1,k) + sigy(i-1,j+1,k+1) + & sigy(i,j+1,k) + sigy(i,j+1,k+1)) * & dest(i,j+2,k+1) + & (sigz(i-1,j,k) + sigz(i-1,j+1,k) + & sigz(i,j,k) + sigz(i,j+1,k)) * & dest(i,j+1,k) + & (sigz(i-1,j,k+1) + sigz(i-1,j+1,k+1) + & sigz(i,j,k+1) + sigz(i,j+1,k+1)) * & dest(i,j+1,k+2)) / & (sigy(i-1,j,k) + sigy(i-1,j,k+1) + & sigy(i,j,k) + sigy(i,j,k+1) + & sigy(i-1,j+1,k) + sigy(i-1,j+1,k+1) + & sigy(i,j+1,k) + sigy(i,j+1,k+1) + & sigz(i-1,j,k) + sigz(i-1,j+1,k) + & sigz(i,j,k) + sigz(i,j+1,k) + & sigz(i-1,j,k+1) + sigz(i-1,j+1,k+1) + & sigz(i,j,k+1) + sigz(i,j+1,k+1)) end do end do end do end if if (ir .eq. 2 .and. jr .eq. 2 .and. kr .eq. 2) then do kc = bbl2, bbh2-1 do jc = bbl1, bbh1-1 cdir$ ivdep do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc k = kr * kc dest(i+1,j+1,k+1) = ((sigx(i,j,k) + sigx(i,j,k+1) + & sigx(i,j+1,k) + sigx(i,j+1,k+1)) * & dest(i,j+1,k+1) + & (sigx(i+1,j,k) + sigx(i+1,j,k+1) + & sigx(i+1,j+1,k) + sigx(i+1,j+1,k+1)) * & dest(i+2,j+1,k+1) + & (sigy(i,j,k) + sigy(i,j,k+1) + & sigy(i+1,j,k) + sigy(i+1,j,k+1)) * & dest(i+1,j,k+1) + & (sigy(i,j+1,k) + sigy(i,j+1,k+1) + & sigy(i+1,j+1,k) + sigy(i+1,j+1,k+1)) * & dest(i+1,j+2,k+1) + & (sigz(i,j,k) + sigz(i,j+1,k) + & sigz(i+1,j,k) + sigz(i+1,j+1,k)) * & dest(i+1,j+1,k) + & (sigz(i,j,k+1) + sigz(i,j+1,k+1) + & sigz(i+1,j,k+1) + sigz(i+1,j+1,k+1)) * & dest(i+1,j+1,k+2)) dest(i+1,j+1,k+1) = dest(i+1,j+1,k+1) / & (sigx(i,j,k) + sigx(i,j,k+1) + & sigx(i,j+1,k) + sigx(i,j+1,k+1) + & sigx(i+1,j,k) + sigx(i+1,j,k+1) + & sigx(i+1,j+1,k) + sigx(i+1,j+1,k+1) + & sigy(i,j,k) + sigy(i,j,k+1) + & sigy(i+1,j,k) + sigy(i+1,j,k+1) + & sigy(i,j+1,k) + sigy(i,j+1,k+1) + & sigy(i+1,j+1,k) + sigy(i+1,j+1,k+1) + & sigz(i,j,k) + sigz(i,j+1,k) + & sigz(i+1,j,k) + sigz(i+1,j+1,k) + & sigz(i,j,k+1) + sigz(i,j+1,k+1) + & sigz(i+1,j,k+1) + sigz(i+1,j+1,k+1)) end do end do end do end if end c----------------------------------------------------------------------- c NODE-based data, factor of 2 only. subroutine hgints( & dest, destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & signd, snl0,snh0,snl1,snh1,snl2,snh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & bbl0,bbh0,bbl1,bbh1,bbl2,bbh2, & ir, jr, kr) integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer snl0,snh0,snl1,snh1,snl2,snh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer bbl0,bbh0,bbl1,bbh1,bbl2,bbh2 integer ir, jr, kr double precision dest(destl0:desth0,destl1:desth1,destl2:desth2) double precision signd(snl0:snh0,snl1:snh1,snl2:snh2, 3) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) integer i, j, k, ic, jc, kc do kc = bbl2, bbh2 do jc = bbl1, bbh1 do ic = bbl0, bbh0 dest(ir*ic,jr*jc,kr*kc) = src(ic,jc,kc) end do end do end do if (ir .eq. 2) then do kc = bbl2, bbh2 do jc = bbl1, bbh1 do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc k = kr * kc dest(i+1,j,k) = (signd(i,j,k,1) * src(ic,jc,kc) + & signd(i+1,j,k,1) * src(ic+1,jc,kc)) / & (signd(i,j,k,1) + signd(i+1,j,k,1)) end do end do end do end if if (jr .eq. 2) then do kc = bbl2, bbh2 do jc = bbl1, bbh1-1 do ic = bbl0, bbh0 i = ir * ic j = jr * jc k = kr * kc dest(i,j+1,k) = (signd(i,j,k,2) * src(ic,jc,kc) + & signd(i,j+1,k,2) * src(ic,jc+1,kc)) / & (signd(i,j,k,2) + signd(i,j+1,k,2)) end do end do end do end if if (kr .eq. 2) then do kc = bbl2, bbh2-1 do jc = bbl1, bbh1 do ic = bbl0, bbh0 i = ir * ic j = jr * jc k = kr * kc dest(i,j,k+1) = (signd(i,j,k,3) * src(ic,jc,kc) + & signd(i,j,k+1,3) * src(ic,jc,kc+1)) / & (signd(i,j,k,3) + signd(i,j,k+1,3)) end do end do end do end if if (ir .eq. 2 .and. jr .eq. 2) then do kc = bbl2, bbh2 do jc = bbl1, bbh1-1 cdir$ ivdep do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc k = kr * kc dest(i+1,j+1,k) = (signd(i,j+1,k,1) * dest(i,j+1,k) + & signd(i+1,j+1,k,1) * dest(i+2,j+1,k) + & signd(i+1,j,k,2) * dest(i+1,j,k) + & signd(i+1,j+1,k,2) * dest(i+1,j+2,k)) / & (signd(i,j+1,k,1) + signd(i+1,j+1,k,1) + & signd(i+1,j,k,2) + signd(i+1,j+1,k,2)) end do end do end do end if if (ir .eq. 2 .and. kr .eq. 2) then do kc = bbl2, bbh2-1 do jc = bbl1, bbh1 cdir$ ivdep do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc k = kr * kc dest(i+1,j,k+1) = (signd(i,j,k+1,1) * dest(i,j,k+1) + & signd(i+1,j,k+1,1) * dest(i+2,j,k+1) + & signd(i+1,j,k,3) * dest(i+1,j,k) + & signd(i+1,j,k+1,3) * dest(i+1,j,k+2)) / & (signd(i,j,k+1,1) + signd(i+1,j,k+1,1) + & signd(i+1,j,k,3) + signd(i+1,j,k+1,3)) end do end do end do end if if (jr .eq. 2 .and. kr .eq. 2) then do kc = bbl2, bbh2-1 do jc = bbl1, bbh1-1 cdir$ ivdep do ic = bbl0, bbh0 i = ir * ic j = jr * jc k = kr * kc dest(i,j+1,k+1) = (signd(i,j,k+1,2) * dest(i,j,k+1) + & signd(i,j+1,k+1,2) * dest(i,j+2,k+1) + & signd(i,j+1,k,3) * dest(i,j+1,k) + & signd(i,j+1,k+1,3) * dest(i,j+1,k+2)) / & (signd(i,j,k+1,2) + signd(i,j+1,k+1,2) + & signd(i,j+1,k,3) + signd(i,j+1,k+1,3)) end do end do end do end if if (ir .eq. 2 .and. jr .eq. 2 .and. kr .eq. 2) then do kc = bbl2, bbh2-1 do jc = bbl1, bbh1-1 cdir$ ivdep do ic = bbl0, bbh0-1 i = ir * ic j = jr * jc k = kr * kc dest(i+1,j+1,k+1) = & (signd(i,j+1,k+1,1) * dest(i,j+1,k+1) + & signd(i+1,j+1,k+1,1) * dest(i+2,j+1,k+1) + & signd(i+1,j,k+1,2) * dest(i+1,j,k+1) + & signd(i+1,j+1,k+1,2) * dest(i+1,j+2,k+1) + & signd(i+1,j+1,k,3) * dest(i+1,j+1,k) + & signd(i+1,j+1,k+1,3) * dest(i+1,j+1,k+2)) / & (signd(i,j+1,k+1,1) + signd(i+1,j+1,k+1,1) + & signd(i+1,j,k+1,2) + signd(i+1,j+1,k+1,2) + & signd(i+1,j+1,k,3) + signd(i+1,j+1,k+1,3)) end do end do end do end if end c----------------------------------------------------------------------- c CELL-based data only. subroutine hgsrst( & destx, desty, destz, & destl0,desth0,destl1,desth1,destl2,desth2, & regl0,regh0,regl1,regh1,regl2,regh2, & srcx, srcy, srcz, & srcl0,srch0,srcl1,srch1,srcl2,srch2, & ir, jr, kr) integer destl0,desth0,destl1,desth1,destl2,desth2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer ir, jr, kr double precision destx(destl0:desth0,destl1:desth1,destl2:desth2) double precision desty(destl0:desth0,destl1:desth1,destl2:desth2) double precision destz(destl0:desth0,destl1:desth1,destl2:desth2) double precision srcx(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision srcy(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision srcz(srcl0:srch0,srcl1:srch1,srcl2:srch2) integer i, j, k, i2, j2, k2 if (ir .ne. 2 .and. jr .ne. 2 .and. kr .ne. 2) then stop "this can't happen" endif if (ir .eq. 2 .and. jr .eq. 2 .and. kr .eq. 2) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 i2 = 2 * i j2 = 2 * j k2 = 2 * k destx(i,j,k) = 0.5D0 / (1.0D0 / (srcx(i2,j2,k2) + & srcx(i2,j2,k2+1) + & srcx(i2,j2+1,k2) + & srcx(i2,j2+1,k2+1)) + & 1.0D0 / (srcx(i2+1,j2,k2) + & srcx(i2+1,j2,k2+1) + & srcx(i2+1,j2+1,k2) + & srcx(i2+1,j2+1,k2+1))) desty(i,j,k) = 0.5D0 / (1.0D0 / (srcy(i2,j2,k2) + & srcy(i2,j2,k2+1) + & srcy(i2+1,j2,k2) + & srcy(i2+1,j2,k2+1)) + & 1.0D0 / (srcy(i2,j2+1,k2) + & srcy(i2,j2+1,k2+1) + & srcy(i2+1,j2+1,k2) + & srcy(i2+1,j2+1,k2+1))) destz(i,j,k) = 0.5D0 / (1.0D0 / (srcz(i2,j2,k2) + & srcz(i2,j2+1,k2) + & srcz(i2+1,j2,k2) + & srcz(i2+1,j2+1,k2)) + & 1.0D0 / (srcz(i2,j2,k2+1) + & srcz(i2,j2+1,k2+1) + & srcz(i2+1,j2,k2+1) + & srcz(i2+1,j2+1,k2+1))) end do end do end do else if (ir .eq. 2 .and. jr .eq. 2) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 i2 = 2 * i j2 = 2 * j destx(i,j,k) = 1.0D0 / (1.0D0 / (srcx(i2,j2,k) + & srcx(i2,j2+1,k)) + & 1.0D0 / (srcx(i2+1,j2,k) + & srcx(i2+1,j2+1,k))) desty(i,j,k) = 1.0D0 / (1.0D0 / (srcy(i2,j2,k) + & srcy(i2+1,j2,k)) + & 1.0D0 / (srcy(i2,j2+1,k) + & srcy(i2+1,j2+1,k))) destz(i,j,k) = 0.25D0 * (srcz(i2,j2,k) + & srcz(i2,j2+1,k) + & srcz(i2+1,j2,k) + & srcz(i2+1,j2+1,k)) end do end do end do else if (ir .eq. 2 .and. kr .eq. 2) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 i2 = 2 * i k2 = 2 * k destx(i,j,k) = 1.0D0 / (1.0D0 / (srcx(i2,j,k2) + & srcx(i2,j,k2+1)) + & 1.0D0 / (srcx(i2+1,j,k2) + & srcx(i2+1,j,k2+1))) desty(i,j,k) = 0.25D0 * (srcy(i2,j,k2) + & srcy(i2,j,k2+1) + & srcy(i2+1,j,k2) + & srcy(i2+1,j,k2+1)) destz(i,j,k) = 1.0D0 / (1.0D0 / (srcz(i2,j,k2) + & srcz(i2+1,j,k2)) + & 1.0D0 / (srcz(i2,j,k2+1) + & srcz(i2+1,j,k2+1))) end do end do end do else if (jr .eq. 2 .and. kr .eq. 2) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 j2 = 2 * j k2 = 2 * k destx(i,j,k) = 0.25D0 * (srcx(i,j2,k2) + & srcx(i,j2,k2+1) + & srcx(i,j2+1,k2) + & srcx(i,j2+1,k2+1)) desty(i,j,k) = 1.0D0 / (1.0D0 / (srcy(i,j2,k2) + & srcy(i,j2,k2+1)) + & 1.0D0 / (srcy(i,j2+1,k2) + & srcy(i,j2+1,k2+1))) destz(i,j,k) = 1.0D0 / (1.0D0 / (srcz(i,j2,k2) + & srcz(i,j2+1,k2)) + & 1.0D0 / (srcz(i,j2,k2+1) + & srcz(i,j2+1,k2+1))) end do end do end do else if (ir .eq. 2) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 i2 = 2 * i destx(i,j,k) = 2.0D0 / (1.0D0 / srcx(i2,j,k) + & 1.0D0 / srcx(i2+1,j,k)) desty(i,j,k) = 0.5D0 * (srcy(i2,j,k) + & srcy(i2+1,j,k)) destz(i,j,k) = 0.5D0 * (srcz(i2,j,k) + & srcz(i2+1,j,k)) end do end do end do else if (jr .eq. 2) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 j2 = 2 * j destx(i,j,k) = 0.5D0 * (srcx(i,j2,k) + & srcx(i,j2+1,k)) desty(i,j,k) = 2.0D0 / (1.0D0 / srcy(i,j2,k) + & 1.0D0 / srcy(i,j2+1,k)) destz(i,j,k) = 0.5D0 * (srcz(i,j2,k) + & srcz(i,j2+1,k)) end do end do end do else if (kr .eq. 2) then do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 k2 = 2 * k destx(i,j,k) = 0.5D0 * (srcx(i,j,k2) + & srcx(i,j,k2+1)) desty(i,j,k) = 0.5D0 * (srcy(i,j,k2) + & srcy(i,j,k2+1)) destz(i,j,k) = 2.0D0 / (1.0D0 / srcz(i,j,k2) + & 1.0D0 / srcz(i,j,k2+1)) end do end do end do end if end c seven-point variable stencils c----------------------------------------------------------------------- subroutine hgcen( & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & signd, snl0,snh0,snl1,snh1,snl2,snh2, & regl0,regh0,regl1,regh1,regl2,regh2,idd) integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer snl0,snh0,snl1,snh1,snl2,snh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) double precision signd(snl0:snh0,snl1:snh1,snl2:snh2, 3) double precision tmp integer i, j, k integer idd do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 tmp = (signd(i-1,j,k,1) + signd(i,j,k,1) & + signd(i,j-1,k,2) + signd(i,j,k,2) & + signd(i,j,k-1,3) + signd(i,j,k,3)) if ( tmp .eq. 0.0D0 ) then cen(i,j,k) = 0.0D0 else cen(i,j,k) = 1.0D0 / tmp end if end do end do end do end c----------------------------------------------------------------------- c sig here contains three different directions all stored on "nodes" subroutine hgrlxu( & cor, res, sig, cen, & resl0,resh0,resl1,resh1,resl2,resh2, & mask, & regl0,regh0,regl1,regh1,regl2,regh2,idd) integer resl0,resh0,resl1,resh1,resl2,resh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision cor(*) double precision res(*) double precision sig(*) double precision cen(*) double precision mask(*) double precision AVG integer i, jdiff, kdiff, ly, lz integer idd AVG() = (sig(i-1) * cor(i-1) + & sig(i) * cor(i+1) + & sig(i+ly-jdiff) * cor(i-jdiff) + & sig(i+ly) * cor(i+jdiff) + & sig(i+lz-kdiff) * cor(i-kdiff) + & sig(i+lz) * cor(i+kdiff)) jdiff = resh0 - resl0 + 1 kdiff = (resh1 - resl1 + 1) * jdiff ly = (resh2 - resl2 + 1) * kdiff lz = 2 * ly cdir$ ivdep do i = (regl2 - resl2) * kdiff + (regl1 - resl1) * jdiff + & (regl0 - resl0) + 1, & (regh2 - resl2) * kdiff + (regh1 - resl1) * jdiff + & (regh0 - resl0) + 1, 2 cor(i) = cor(i) & + mask(i) * ((AVG() - res(i)) * cen(i) - cor(i)) end do cdir$ ivdep do i = (regl2 - resl2) * kdiff + (regl1 - resl1) * jdiff + & (regl0 - resl0) + 2, & (regh2 - resl2) * kdiff + (regh1 - resl1) * jdiff + & (regh0 - resl0) + 1, 2 cor(i) = cor(i) & + mask(i) * ((AVG() - res(i)) * cen(i) - cor(i)) end do end c----------------------------------------------------------------------- c sig here contains three different directions all stored on "nodes" subroutine hgrlxur( & cor, res, signd, cen, & resl0,resh0,resl1,resh1,resl2,resh2, & regl0,regh0,regl1,regh1,regl2,regh2,idd) integer resl0,resh0,resl1,resh1,resl2,resh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision cor(resl0:resh0,resl1:resh1,resl2:resh2) double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision signd(resl0:resh0,resl1:resh1,resl2:resh2,3) double precision cen(resl0:resh0,resl1:resh1,resl2:resh2) double precision AVG integer i, j, k, ipar0, ipass, jdiff, kdiff, ly, lz integer idd, ipar AVG() = (signd(i-1,j,k,1) * cor(i-1,j,k) + & signd(i,j,k,1) * cor(i+1,j,k) + & signd(i,j-1,k,2) * cor(i,j-1,k) + & signd(i,j,k,2) * cor(i,j+1,k) + & signd(i,j,k-1,3) * cor(i,j,k-1) + & signd(i,j,k,3) * cor(i,j,k+1)) do ipass = 0, 1 ipar0 = ipass do k = regl2, regh2 ipar0 = 1 - ipar0 ipar = ipar0 do j = regl1, regh1 ipar = 1 - ipar cdir$ ivdep do i = regl0 + ipar, regh0, 2 cor(i,j,k) = (AVG() - res(i,j,k)) * cen(i,j,k) end do end do end do end do end c----------------------------------------------------------------------- subroutine hgrlx( & cor, corl0,corh0,corl1,corh1,corl2,corh2, & res, resl0,resh0,resl1,resh1,resl2,resh2, & signd, snl0,snh0,snl1,snh1,snl2,snh2, & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & regl0,regh0,regl1,regh1,regl2,regh2) integer corl0,corh0,corl1,corh1,corl2,corh2 integer resl0,resh0,resl1,resh1,resl2,resh2 integer snl0,snh0,snl1,snh1,snl2,snh2 integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision cor(corl0:corh0,corl1:corh1,corl2:corh2) double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision signd(snl0:snh0,snl1:snh1,snl2:snh2, 3) double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) integer i, j, k, ipar0, ipar, ipass double precision AVG AVG() = (signd(i-1,j,k,1) * cor(i-1,j,k) + & signd(i,j,k,1) * cor(i+1,j,k) + & signd(i,j-1,k,2) * cor(i,j-1,k) + & signd(i,j,k,2) * cor(i,j+1,k) + & signd(i,j,k-1,3) * cor(i,j,k-1) + & signd(i,j,k,3) * cor(i,j,k+1)) do ipass = 0, 1 ipar0 = ipass do k = regl2, regh2 ipar0 = 1 - ipar0 ipar = ipar0 do j = regl1, regh1 ipar = 1 - ipar cdir$ ivdep do i = regl0 + ipar, regh0, 2 cor(i,j,k) = (AVG() - res(i,j,k)) * cen(i,j,k) end do end do end do end do end c----------------------------------------------------------------------- subroutine hgrlxl( & cor, corl0,corh0,corl1,corh1,corl2,corh2, & res, resl0,resh0,resl1,resh1,resl2,resh2, & signd, snl0,snh0,snl1,snh1,snl2,snh2, & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & regl0,regh0,regl1,regh1,regl2,regh2, & doml0,domh0,doml1,domh1,doml2,domh2, & lsd) integer corl0,corh0,corl1,corh1,corl2,corh2 integer resl0,resh0,resl1,resh1,resl2,resh2 integer snl0,snh0,snl1,snh1,snl2,snh2 integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer doml0,domh0,doml1,domh1,doml2,domh2 double precision cor(corl0:corh0,corl1:corh1,corl2:corh2) double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision signd(snl0:snh0,snl1:snh1,snl2:snh2, 3) double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) double precision wrk(256) integer lsd double precision betm, aj double precision RHSL2 integer i, j, k, kw, ipass, ipar RHSL2() = (res(i,j,k) - (signd(i-1,j,k,1) * cor(i-1,j,k) + & signd(i,j,k,1) * cor(i+1,j,k) + & signd(i,j-1,k,2) * cor(i,j-1,k) + & signd(i,j,k,2) * cor(i,j+1,k))) if (lsd .ne. 2) then print *, "Line solve not implemented in dimension", lsd stop end if do ipass = 1, 0, -1 ipar = ipass do i = regl0, regh0 ipar = 1 - ipar do j = regl1 + ipar, regh1, 2 k = regl2 betm = -cen(i,j,k) if (betm .eq. 0.0D0) then c dirichlet bdy: cor(i,j,k) = 0.0D0 wrk(1) = 0.0D0 else if (regl2 .eq. doml2) then c neumann bdy: cor(i,j,k) = RHSL2() * betm aj = signd(i,j,k,3) wrk(1) = 2.0D0 * aj * betm else c interface to grid at same level: aj = signd(i,j,k-1,3) cor(i,j,k) = (RHSL2() - aj * cor(i,j,k-1)) * betm aj = signd(i,j,k,3) wrk(1) = aj * betm end if c forward solve loop: do k = regl2 + 1, regh2 - 1 kw = k - regl2 if (cen(i,j,k) .eq. 0.0D0) then betm = 0.0D0 else betm = 1.0D0 / (-1.0D0 / cen(i,j,k) - aj * wrk(kw)) end if cor(i,j,k) = (RHSL2() - aj * cor(i,j,k-1)) * betm aj = signd(i,j,k,3) wrk(kw + 1) = aj * betm end do k = regh2 kw = k - regl2 if (cen(i,j,k) .eq. 0.0D0) then c dirichlet bdy: cor(i,j,k) = 0.0D0 else if (regh2 .eq. domh2) then c neumann bdy: aj = 2.0D0 * aj betm = 1.0D0 / (-1.0D0 / cen(i,j,k) - aj * wrk(kw)) cor(i,j,k) = (RHSL2() - aj * cor(i,j,k-1)) * betm else if (kw .gt. 0) then c interface to grid at same level: betm = 1.0D0 / (-1.0D0 / cen(i,j,k) - aj * wrk(kw)) cor(i,j,k) = RHSL2() - aj * cor(i,j,k-1) aj = signd(i,j,k,3) cor(i,j,k) = (cor(i,j,k) - aj * cor(i,j,k+1)) * betm end if c back substitution loop: do k = regh2 - 1, regl2, -1 kw = k - regl2 cor(i,j,k) = cor(i,j,k) - wrk(kw + 1) * cor(i,j,k+1) end do end do end do end do end c----------------------------------------------------------------------- subroutine hgrlnf( & cor, corl0,corh0,corl1,corh1,corl2,corh2, & res, resl0,resh0,resl1,resh1,resl2,resh2, & wrk, wrkl0,wrkh0,wrkl1,wrkh1,wrkl2,wrkh2, & signd, snl0,snh0,snl1,snh1,snl2,snh2, & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & regl0, regh0,regl1,regh1,regl2,regh2, & doml0, domh0,doml1,domh1,doml2,domh2, & lsd, ipass) integer corl0,corh0,corl1,corh1,corl2,corh2 integer resl0,resh0,resl1,resh1,resl2,resh2 integer wrkl0,wrkh0,wrkl1,wrkh1,wrkl2,wrkh2 integer snl0,snh0,snl1,snh1,snl2,snh2 integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer doml0,domh0,doml1,domh1,doml2,domh2 double precision cor(corl0:corh0,corl1:corh1,corl2:corh2) double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision wrk(wrkl0:wrkh0,wrkl1:wrkh1,wrkl2:wrkh2) double precision signd(snl0:snh0,snl1:snh1,snl2:snh2, 3) double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) integer lsd, ipass double precision betm, aj double precision rhsl0, rhsl1, rhsl2 integer i, j, k, ioff, ipar RHSL0() = (res(i,j,k) - (signd(i,j-1,k,2) * cor(i,j-1,k) + & signd(i,j,k,2) * cor(i,j+1,k) + & signd(i,j,k-1,3) * cor(i,j,k-1) + & signd(i,j,k,3) * cor(i,j,k+1))) RHSL1() = (res(i,j,k) - (signd(i-1,j,k,1) * cor(i-1,j,k) + & signd(i,j,k,1) * cor(i+1,j,k) + & signd(i,j,k-1,3) * cor(i,j,k-1) + & signd(i,j,k,3) * cor(i,j,k+1))) RHSL2() = (res(i,j,k) - (signd(i-1,j,k,1) * cor(i-1,j,k) + & signd(i,j,k,1) * cor(i+1,j,k) + & signd(i,j-1,k,2) * cor(i,j-1,k) + & signd(i,j,k,2) * cor(i,j+1,k))) if (lsd .eq. 0) then if (mod(regl1 + regl2, 2) .eq. 0) then ioff = 1 - ipass else ioff = ipass end if i = regl0 ipar = ioff do k = regl2, regh2 ipar = 1 - ipar do j = regl1 + ipar, regh1, 2 if (cen(i,j,k) .eq. 0.0D0) then c dirichlet bdy: wrk(i,j,k) = 0.0D0 else if (regl0 .eq. doml0) then c neumann bdy: betm = -cen(i,j,k) cor(i,j,k) = RHSL0() * betm aj = signd(i,j,k,1) wrk(i,j,k) = 2.0D0 * aj * betm end if end do end do c forward solve loop: do i = regl0 + 1, regh0 - 1 ipar = ioff do k = regl2, regh2 ipar = 1 - ipar do j = regl1 + ipar, regh1, 2 aj = signd(i-1,j,k,1) if (cen(i,j,k) .eq. 0.0D0) then betm = 0.0D0 else betm = 1.0D0 & / (-1.0D0 / cen(i,j,k) - aj * wrk(i-1,j,k)) end if cor(i,j,k) = (RHSL0() - aj * cor(i-1,j,k)) * betm aj = signd(i,j,k,1) wrk(i,j,k) = aj * betm end do end do end do i = regh0 ipar = ioff do k = regl2, regh2 ipar = 1 - ipar do j = regl1 + ipar, regh1, 2 if (cen(i,j,k) .eq. 0.0D0) then c dirichlet bdy: else if (regh0 .eq. domh0) then c neumann bdy: aj = 2.0D0 * signd(i-1,j,k,1) betm = 1.0D0 / (-1.0D0 / cen(i,j,k) - aj * wrk(i-1,j,k)) cor(i,j,k) = (RHSL0() - aj * cor(i-1,j,k)) * betm else if (i .gt. regl0) then c interface to grid at same level: aj = signd(i-1,j,k,1) betm = 1.0D0 / (-1.0D0 / cen(i,j,k) - aj * wrk(i-1,j,k)) cor(i,j,k) = (RHSL0() - aj * cor(i-1,j,k)) * betm aj = signd(i,j,k,1) wrk(i,j,k) = aj * betm end if end do end do else if (lsd .eq. 1) then if (mod(regl0 + regl2, 2) .eq. 0) then ioff = 1 - ipass else ioff = ipass end if j = regl1 ipar = ioff do k = regl2, regh2 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 if (cen(i,j,k) .eq. 0.0D0) then c dirichlet bdy: wrk(i,j,k) = 0.0D0 else if (regl1 .eq. doml1) then c neumann bdy: betm = -cen(i,j,k) cor(i,j,k) = RHSL1() * betm aj = signd(i,j,k,2) wrk(i,j,k) = 2.0D0 * aj * betm end if end do end do c forward solve loop: do j = regl1 + 1, regh1 - 1 ipar = ioff do k = regl2, regh2 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 aj = signd(i,j-1,k,2) if (cen(i,j,k) .eq. 0.0D0) then betm = 0.0D0 else betm = 1.0D0 & / (-1.0D0 / cen(i,j,k) - aj * wrk(i,j-1,k)) end if cor(i,j,k) = (RHSL1() - aj * cor(i,j-1,k)) * betm aj = signd(i,j,k,2) wrk(i,j,k) = aj * betm end do end do end do j = regh1 ipar = ioff do k = regl2, regh2 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 if (cen(i,j,k) .eq. 0.0D0) then c dirichlet bdy: else if (regh1 .eq. domh1) then c neumann bdy: aj = 2.0D0 * signd(i,j-1,k,2) betm = 1.0D0 / (-1.0D0 / cen(i,j,k) - aj * wrk(i,j-1,k)) cor(i,j,k) = (RHSL1() - aj * cor(i,j-1,k)) * betm else if (j .gt. regl1) then c interface to grid at same level: aj = signd(i,j-1,k,2) betm = 1.0D0 / (-1.0D0 / cen(i,j,k) - aj * wrk(i,j-1,k)) cor(i,j,k) = (RHSL1() - aj * cor(i,j-1,k)) * betm aj = signd(i,j,k,2) wrk(i,j,k) = aj * betm end if end do end do else if (mod(regl0 + regl1, 2) .eq. 0) then ioff = 1 - ipass else ioff = ipass end if k = regl2 ipar = ioff do j = regl1, regh1 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 if (cen(i,j,k) .eq. 0.0D0) then c dirichlet bdy: wrk(i,j,k) = 0.0D0 else if (regl2 .eq. doml2) then c neumann bdy: betm = -cen(i,j,k) cor(i,j,k) = RHSL2() * betm aj = signd(i,j,k,3) wrk(i,j,k) = 2.0D0 * aj * betm end if end do end do c forward solve loop: do k = regl2 + 1, regh2 - 1 ipar = ioff do j = regl1, regh1 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 aj = signd(i,j,k-1,3) if (cen(i,j,k) .eq. 0.0D0) then betm = 0.0D0 else betm = 1.0D0 & / (-1.0D0 / cen(i,j,k) - aj * wrk(i,j,k-1)) end if cor(i,j,k) = (RHSL2() - aj * cor(i,j,k-1)) * betm aj = signd(i,j,k,3) wrk(i,j,k) = aj * betm end do end do end do k = regh2 ipar = ioff do j = regl1, regh1 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 if (cen(i,j,k) .eq. 0.0D0) then c dirichlet bdy: else if (regh2 .eq. domh2) then c neumann bdy: aj = 2.0D0 * signd(i,j,k-1,3) betm = 1.0D0 / (-1.0D0 / cen(i,j,k) - aj * wrk(i,j,k-1)) cor(i,j,k) = (RHSL2() - aj * cor(i,j,k-1)) * betm else if (k .gt. regl2) then c interface to grid at same level: aj = signd(i,j,k-1,3) betm = 1.0D0 / (-1.0D0 / cen(i,j,k) - aj * wrk(i,j,k-1)) cor(i,j,k) = (RHSL2() - aj * cor(i,j,k-1)) * betm aj = signd(i,j,k,3) wrk(i,j,k) = aj * betm end if end do end do end if end c----------------------------------------------------------------------- subroutine hgres( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & dest, destl0,desth0,destl1,desth1,destl2,desth2, & signd, snl0,snh0,snl1,snh1,snl2,snh2, & regl0,regh0,regl1,regh1,regl2,regh2) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer destl0,desth0,destl1,desth1,destl2,desth2 integer snl0,snh0,snl1,snh1,snl2,snh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision dest(destl0:desth0,destl1:desth1,destl2:desth2) double precision signd(snl0:snh0,snl1:snh1,snl2:snh2, 3) integer i, j, k do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 res(i,j,k) = src(i,j,k) - & (signd(i-1,j,k,1) * (dest(i-1,j,k) - dest(i,j,k)) + & signd(i,j,k,1) * (dest(i+1,j,k) - dest(i,j,k)) + & signd(i,j-1,k,2) * (dest(i,j-1,k) - dest(i,j,k)) + & signd(i,j,k,2) * (dest(i,j+1,k) - dest(i,j,k)) + & signd(i,j,k-1,3) * (dest(i,j,k-1) - dest(i,j,k)) + & signd(i,j,k,3) * (dest(i,j,k+1) - dest(i,j,k))) end do end do end do end c----------------------------------------------------------------------- subroutine hgresu( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, dest, signd, mask, & regl0,regh0,regl1,regh1,regl2,regh2, & idd) integer resl0,resh0,resl1,resh1,resl2,resh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision res(*) double precision src(*) double precision dest(*) double precision signd(*) double precision mask(*) integer i, jdiff, kdiff, ly, lz integer idd jdiff = resh0 - resl0 + 1 kdiff = (resh1 - resl1 + 1) * jdiff ly = (resh2 - resl2 + 1) * kdiff lz = 2 * ly do i = (regl2 - resl2) * kdiff + (regl1 - resl1) * jdiff + & (regl0 - resl0) + 1, & (regh2 - resl2) * kdiff + (regh1 - resl1) * jdiff + & (regh0 - resl0) + 1 res(i) = mask(i) * (src(i) - & (signd(i-1) * (dest(i-1) - dest(i)) + & signd(i) * (dest(i+1) - dest(i)) + & signd(i+ly-jdiff) * (dest(i-jdiff) - dest(i)) + & signd(i+ly) * (dest(i+jdiff) - dest(i)) + & signd(i+lz-kdiff) * (dest(i-kdiff) - dest(i)) + & signd(i+lz) * (dest(i+kdiff) - dest(i)))) end do end c----------------------------------------------------------------------- subroutine hgresur( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, dest, signd, & regl0,regh0,regl1,regh1,regl2,regh2, & idd) integer resl0,resh0,resl1,resh1,resl2,resh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(resl0:resh0,resl1:resh1,resl2:resh2) double precision dest(resl0:resh0,resl1:resh1,resl2:resh2) double precision signd(resl0:resh0,resl1:resh1,resl2:resh2,3) integer i, j, k, jdiff, kdiff, ly, lz integer idd do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 res(i,j,k) = src(i,j,k) - & (signd(i-1,j,k,1) * (dest(i-1,j,k) - dest(i,j,k)) + & signd(i,j,k,1) * (dest(i+1,j,k) - dest(i,j,k)) + & signd(i,j-1,k,2) * (dest(i,j-1,k) - dest(i,j,k)) + & signd(i,j,k,2) * (dest(i,j+1,k) - dest(i,j,k)) + & signd(i,j,k-1,3) * (dest(i,j,k-1) - dest(i,j,k)) + & signd(i,j,k,3) * (dest(i,j,k+1) - dest(i,j,k))) end do end do end do end c----------------------------------------------------------------------- subroutine hgscon( & signd, snl0,snh0,snl1,snh1,snl2,snh2, & sigx, sigy, sigz, & scl0,sch0,scl1,sch1,scl2,sch2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz) integer snl0,snh0,snl1,snh1,snl2,snh2 integer scl0,sch0,scl1,sch1,scl2,sch2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision signd(snl0:snh0,snl1:snh1,snl2:snh2, 3) double precision sigx(scl0:sch0,scl1:sch1,scl2:sch2) double precision sigy(scl0:sch0,scl1:sch1,scl2:sch2) double precision sigz(scl0:sch0,scl1:sch1,scl2:sch2) double precision hx, hy, hz double precision facx, facy, facz integer i, j, k facx = 0.25D0 / (hx*hx) facy = 0.25D0 / (hy*hy) facz = 0.25D0 / (hz*hz) do k = regl2, regh2 do j = regl1, regh1 do i = regl0-1, regh0 signd(i,j,k,1) = facx * & (sigx(i,j-1,k-1) + sigx(i,j-1,k) + & sigx(i,j,k-1) + sigx(i,j,k)) end do end do end do do k = regl2, regh2 do j = regl1-1, regh1 do i = regl0, regh0 signd(i,j,k,2) = facy * & (sigy(i-1,j,k-1) + sigy(i-1,j,k) + & sigy(i,j,k-1) + sigy(i,j,k)) end do end do end do do k = regl2-1, regh2 do j = regl1, regh1 do i = regl0, regh0 signd(i,j,k,3) = facz * & (sigz(i-1,j-1,k) + sigz(i-1,j,k) + & sigz(i,j-1,k) + sigz(i,j,k)) end do end do end do end c----------------------------------------------------------------------- subroutine hgrlx_no_sigma( & cor, corl0,corh0,corl1,corh1,corl2,corh2, & res, resl0,resh0,resl1,resh1,resl2,resh2, & sigx, sigy, sigz, & sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz) integer corl0,corh0,corl1,corh1,corl2,corh2 integer resl0,resh0,resl1,resh1,resl2,resh2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision cor(corl0:corh0,corl1:corh1,corl2:corh2) double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision sigx(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2) double precision sigy(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2) double precision sigz(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2) double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) double precision hx, hy, hz, hxm2, hym2, hzm2 double precision AVG integer i, j, k, ipass, ipar, ipar0 AVG() = 0.25D0 * (hxm2 * & ((sigx(i-1,j-1,k-1) + sigx(i-1,j-1,k) + & sigx(i-1,j,k-1) + sigx(i-1,j,k)) * cor(i-1,j,k) + & (sigx(i,j-1,k-1) + sigx(i,j-1,k) + & sigx(i,j,k-1) + sigx(i,j,k)) * cor(i+1,j,k)) + & hym2 * & ((sigy(i-1,j-1,k-1) + sigy(i-1,j-1,k) + & sigy(i,j-1,k-1) + sigy(i,j-1,k)) * cor(i,j-1,k) + & (sigy(i-1,j,k-1) + sigy(i-1,j,k) + & sigy(i,j,k-1) + sigy(i,j,k)) * cor(i,j+1,k)) + & hzm2 * & ((sigz(i-1,j-1,k-1) + sigz(i-1,j,k-1) + & sigz(i,j-1,k-1) + sigz(i,j,k-1)) * cor(i,j,k-1) + & (sigz(i-1,j-1,k) + sigz(i-1,j,k) + & sigz(i,j-1,k) + sigz(i,j,k)) * cor(i,j,k+1))) hxm2 = 1.0D0 / (hx*hx) hym2 = 1.0D0 / (hy*hy) hzm2 = 1.0D0 / (hz*hz) do ipass = 0, 1 ipar0 = ipass do k = regl2, regh2 ipar0 = 1 - ipar0 ipar = ipar0 do j = regl1, regh1 ipar = 1 - ipar cdir$ ivdep do i = regl0 + ipar, regh0, 2 cor(i,j,k) = (AVG() - res(i,j,k)) * cen(i,j,k) end do end do end do end do end c----------------------------------------------------------------------- subroutine hgres_no_sigma( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & dest, destl0,desth0,destl1,desth1,destl2,desth2, & sigx, sigy, sigz, & sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer destl0,desth0,destl1,desth1,destl2,desth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision dest(destl0:desth0,destl1:desth1,destl2:desth2) double precision sigx(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2) double precision sigy(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2) double precision sigz(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2) double precision hx, hy, hz, hxm2, hym2, hzm2 integer i, j, k hxm2 = 1.0D0 / (hx*hx) hym2 = 1.0D0 / (hy*hy) hzm2 = 1.0D0 / (hz*hz) do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 res(i,j,k) = src(i,j,k) - 0.25D0 * (hxm2 * & ((sigx(i-1,j-1,k-1) + sigx(i-1,j-1,k) + & sigx(i-1,j,k-1) + sigx(i-1,j,k)) * & (dest(i-1,j,k) - dest(i,j,k)) + & (sigx(i,j-1,k-1) + sigx(i,j-1,k) + & sigx(i,j,k-1) + sigx(i,j,k)) * & (dest(i+1,j,k) - dest(i,j,k))) + hym2 * & ((sigy(i-1,j-1,k-1) + sigy(i-1,j-1,k) + & sigy(i,j-1,k-1) + sigy(i,j-1,k)) * & (dest(i,j-1,k) - dest(i,j,k)) + & (sigy(i-1,j,k-1) + sigy(i-1,j,k) + & sigy(i,j,k-1) + sigy(i,j,k)) * & (dest(i,j+1,k) - dest(i,j,k))) + hzm2 * & ((sigz(i-1,j-1,k-1) + sigz(i-1,j,k-1) + & sigz(i,j-1,k-1) + sigz(i,j,k-1)) * & (dest(i,j,k-1) - dest(i,j,k)) + & (sigz(i-1,j-1,k) + sigz(i-1,j,k) + & sigz(i,j-1,k) + sigz(i,j,k)) * & (dest(i,j,k+1) - dest(i,j,k))) ) end do end do end do end c----------------------------------------------------------------------- subroutine hgrlnb( & cor, corl0,corh0,corl1,corh1,corl2,corh2, & wrk, wrkl0,wrkh0,wrkl1,wrkh1,wrkl2,wrkh2, & regl0,regh0,regl1,regh1,regl2,regh2, & lsd, ipass) integer corl0,corh0,corl1,corh1,corl2,corh2 integer wrkl0,wrkh0,wrkl1,wrkh1,wrkl2,wrkh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision cor(corl0:corh0,corl1:corh1,corl2:corh2) double precision wrk(wrkl0:wrkh0,wrkl1:wrkh1,wrkl2:wrkh2) integer lsd, ipass integer ioff, ipar, i, j, k if (lsd .eq. 0) then if (mod(regl1 + regl2, 2) .eq. 0) then ioff = 1 - ipass else ioff = ipass end if c back substitution loop: do i = regh0 - 1, regl0, -1 ipar = ioff do k = regl2, regh2 ipar = 1 - ipar do j = regl1 + ipar, regh1, 2 cor(i,j,k) = cor(i,j,k) - wrk(i,j,k) * cor(i+1,j,k) end do end do end do else if (lsd .eq. 1) then if (mod(regl0 + regl2, 2) .eq. 0) then ioff = 1 - ipass else ioff = ipass end if c back substitution loop: do j = regh1 - 1, regl1, -1 ipar = ioff do k = regl2, regh2 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 cor(i,j,k) = cor(i,j,k) - wrk(i,j,k) * cor(i,j+1,k) end do end do end do else if (mod(regl0 + regl1, 2) .eq. 0) then ioff = 1 - ipass else ioff = ipass end if c back substitution loop: do k = regh2 - 1, regl2, -1 ipar = ioff do j = regl1, regh1 ipar = 1 - ipar do i = regl0 + ipar, regh0, 2 cor(i,j,k) = cor(i,j,k) - wrk(i,j,k) * cor(i,j,k+1) end do end do end do end if end c Unrolled indexing in these 3 routines uses the fact that each array c has a border of width 1 c----------------------------------------------------------------------- c Works for NODE-based data. subroutine hgip( & v0, v1, mask, & regl0,regh0,regl1,regh1,regl2,regh2, & sum) integer regl0,regh0,regl1,regh1,regl2,regh2 double precision v0(*) double precision v1(*) double precision mask(*) double precision sum integer i, jdiff, kdiff jdiff = regh0 - regl0 + 1 kdiff = (regh1 - regl1 + 1) * jdiff do i = kdiff + jdiff + 2, kdiff * (regh2 - regl2) - jdiff - 1 sum = sum + mask(i) * v0(i) * v1(i) end do end c----------------------------------------------------------------------- subroutine hgcg1( & r, p, z, x, w, c, mask, & regl0,regh0,regl1,regh1,regl2,regh2, & alpha, rho) integer regl0,regh0,regl1,regh1,regl2,regh2 double precision r(*) double precision p(*) double precision z(*) double precision x(*) double precision w(*) double precision c(*) double precision mask(*) double precision alpha, rho integer i, jdiff, kdiff jdiff = regh0 - regl0 + 1 kdiff = (regh1 - regl1 + 1) * jdiff do i = kdiff + jdiff + 2, kdiff * (regh2 - regl2) - jdiff - 1 r(i) = r(i) - alpha * w(i) x(i) = x(i) + alpha * p(i) z(i) = r(i) * c(i) rho = rho + mask(i) * z(i) * r(i) end do end c----------------------------------------------------------------------- subroutine hgcg2( & p, z, & regl0,regh0,regl1,regh1,regl2,regh2, & alpha) integer regl0,regh0,regl1,regh1,regl2,regh2 double precision p(*) double precision z(*) double precision alpha integer i, jdiff, kdiff jdiff = regh0 - regl0 + 1 kdiff = (regh1 - regl1 + 1) * jdiff do i = kdiff + jdiff + 2, kdiff * (regh2 - regl2) - jdiff - 1 p(i) = alpha * p(i) + z(i) end do end c----------------------------------------------------------------------- subroutine hgcg_cd( & r, p, z, x, w, c, mask, & ngrids, strid1, strid2, nvals, & rs, ps, zs, xs, ws, cs, ms, & nsets, edge, nvals1, nvals2, dstart, sstart, & dstrd1, dstrd2, sstrd1, sstrd2, & hx, alpha, rho, it, pcode) double precision r(0:*), p(0:*), z(0:*) double precision x(0:*), w(0:*), c(0:*), mask(0:*) integer ngrids integer strid1(ngrids), strid2(ngrids), nvals(ngrids) integer rs(ngrids), ps(ngrids), zs(ngrids) integer xs(ngrids), ws(ngrids), cs(ngrids), ms(ngrids) double precision edge(0:*) integer nsets integer nvals1(nsets), nvals2(nsets) integer dstart(nsets), sstart(nsets) integer dstrd1(nsets), dstrd2(nsets) integer sstrd1(nsets), sstrd2(nsets) double precision hx, alpha, rho double precision hxm2, facm, tol, rhoold integer it, pcode, k, i, j, MAXITER parameter (MAXITER = 250) hxm2 = 1.0D0 / (hx*hx) cifdef HG_CROSS_STENCIL facm = -hxm2 celse c facm = -hxm2 / three cendif rho = 0.0D0 do k = 1, ngrids c must do this loop over entire array to initialize borders of p do i = 0, nvals(k) - 1 z(zs(k)+i) = r(rs(k)+i) * c(cs(k)+i) p(ps(k)+i) = z(zs(k)+i) rho = rho + mask(ms(k)+i) * z(zs(k)+i) * r(rs(k)+i) end do end do tol = rho / 1000 if (tol .le. 0.0D0) return 100 continue it = it + 1 if (it .gt. MAXITER) then STOP "FORTRAN hgcg---conjugate-gradient iteration failed" end if rhoold = rho alpha = 0.0D0 do k = 1, nsets do j = 0, nvals2(k) - 1 do i = 0, nvals1(k) - 1 edge(dstart(k) + j * dstrd2(k) + i * dstrd1(k)) = & edge(sstart(k) + j * sstrd2(k) + i * sstrd1(k)) end do end do end do do k = 1, ngrids do i = strid1(k) + strid2(k) + 1, & nvals(k) - strid1(k) - strid2(k) - 2 cifdef HG_CROSS_STENCIL w(ws(k)+i) = facm * & (p(ps(k)+i-1) + p(ps(k)+i+1) + & p(ps(k)+i-strid1(k)) + p(ps(k)+i+strid1(k)) + & p(ps(k)+i-strid2(k)) + p(ps(k)+i+strid2(k)) - & 6.0D0 * p(ps(k)+i)) celse c print *, "FORTRAN hgcg---full box stencils not implemented" cendif alpha = alpha + mask(ms(k)+i) * p(ps(k)+i) * w(ws(k)+i) end do end do alpha = rho / alpha rho = 0.0D0 do k = 1, ngrids do i = strid1(k) + strid2(k) + 1, & nvals(k) - strid1(k) - strid2(k) - 2 r(rs(k)+i) = r(rs(k)+i) - alpha * w(ws(k)+i) x(xs(k)+i) = x(xs(k)+i) + alpha * p(ps(k)+i) z(zs(k)+i) = r(rs(k)+i) * c(cs(k)+i) rho = rho + mask(ms(k)+i) * z(zs(k)+i) * r(rs(k)+i) end do end do if (pcode .ge. 3) then print *, it, rho end if if (rho .le. tol .or. it .gt. MAXITER) return alpha = rho / rhoold do k = 1, ngrids do i = strid1(k) + strid2(k) + 1, & nvals(k) - strid1(k) - strid2(k) - 2 p(ps(k)+i) = alpha * p(ps(k)+i) + z(zs(k)+i) end do end do go to 100 end ccseapps-2.5/CCSEApps/hgproj/hg_multi3d_full.f0000644000175000017500000022343211634153073022406 0ustar amckinstryamckinstryc twenty-seven point terrain version: c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along face subroutine hgfres_full( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & fdst, fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2, & cdst, cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2, & sigmaf, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & sigmac, scl0,sch0,scl1,sch1,scl2,sch2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz, ir, jr, kr, idim, idir, idd1) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2 integer cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer scl0,sch0,scl1,sch1,scl2,sch2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision hx, hy, hz double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1,fdstl2:fdsth2) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1,cdstl2:cdsth2) double precision sigmaf(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2, 3) double precision sigmac(scl0:sch0,scl1:sch1,scl2:sch2, 3) integer ir, jr, kr, idim, idir double precision fac00, fac0, fac1, fac2, tmp, cen integer i, j, k, is, js, ks, l, m, n integer idd1 integer ii, jj, kk, i1, j1, k1 double precision MXXC, MYYC, MZZC double precision MXXF, MYYF, MZZF MXXC(ii,jj,kk) = (4.0D0 * cdst(ii,j,k) + & 2.0D0 * (cdst(ii,jj,k) - cdst(i,jj,k) + & cdst(ii,j,kk) - cdst(i,j,kk)) + & (cdst(ii,jj,kk) - cdst(i,jj,kk))) MYYC(ii,jj,kk) = (4.0D0 * cdst(i,jj,k) + & 2.0D0 * (cdst(ii,jj,k) - cdst(ii,j,k) + & cdst(i,jj,kk) - cdst(i,j,kk)) + & (cdst(ii,jj,kk) - cdst(ii,j,kk))) MZZC(ii,jj,kk) = (4.0D0 * cdst(i,j,kk) + & 2.0D0 * (cdst(ii,j,kk) - cdst(ii,j,k) + & cdst(i,jj,kk) - cdst(i,jj,k)) + & (cdst(ii,jj,kk) - cdst(ii,jj,k))) MXXF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(ii,j1,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(i1,jj,k1) + & fdst(ii,j1,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(i1,jj,kk))) MYYF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,jj,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(ii,j1,kk))) MZZF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,j1,kk) + & 2.0D0 * (fdst(ii,j1,kk) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,jj,k1)) + & (fdst(ii,jj,kk) - fdst(ii,jj,k1))) fac00 = 1.0D0 / 36 if (idim .eq. 0) then i = regl0 if (idir .eq. 1) then is = i - 1 else is = i end if do k = regl2, regh2 do j = regl1, regh1 tmp = sigmac(is ,j-1,k-1,1) * MXXC(i-idir,j-1,k-1) & +sigmac(is ,j-1,k ,1) * MXXC(i-idir,j-1,k+1) & +sigmac(is ,j ,k-1,1) * MXXC(i-idir,j+1,k-1) & +sigmac(is ,j ,k ,1) * MXXC(i-idir,j+1,k+1) tmp = tmp & +sigmac(is ,j-1,k-1,2) * MYYC(i-idir,j-1,k-1) & +sigmac(is ,j-1,k ,2) * MYYC(i-idir,j-1,k+1) & +sigmac(is ,j ,k-1,2) * MYYC(i-idir,j+1,k-1) & +sigmac(is ,j ,k ,2) * MYYC(i-idir,j+1,k+1) tmp = tmp & +sigmac(is ,j-1,k-1,3) * MZZC(i-idir,j-1,k-1) & +sigmac(is ,j-1,k ,3) * MZZC(i-idir,j-1,k+1) & +sigmac(is ,j ,k-1,3) * MZZC(i-idir,j+1,k-1) & +sigmac(is ,j ,k ,3) * MZZC(i-idir,j+1,k+1) cen = & 4.0D0 * ( sigmac(is,j-1,k-1,1) + sigmac(is,j-1,k,1) & +sigmac(is,j ,k-1,1) + sigmac(is,j ,k,1) & +sigmac(is,j-1,k-1,2) + sigmac(is,j-1,k,2) & +sigmac(is,j ,k-1,2) + sigmac(is,j ,k,2) & +sigmac(is,j-1,k-1,3) + sigmac(is,j-1,k,3) & +sigmac(is,j ,k-1,3) + sigmac(is,j ,k,3)) res(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) - fac00 * (tmp - cen * cdst(i,j,k)) end do end do fac0 = fac00 / (jr * kr) i = i * ir if (idir .eq. 1) then is = i else is = i - 1 end if do l = -(kr-1), kr-1 fac2 = (kr-abs(l)) * fac0 do n = -(jr-1), jr-1 fac1 = (jr-abs(n)) * fac2 do k = kr*regl2, kr*regh2, kr do j = jr*regl1, jr*regh1, jr tmp = sigmaf(is,j+n-1,k+l-1,1) & * MXXF(i,j+n,k+l,i+idir,j+n-1,k+l-1) & +sigmaf(is,j+n-1,k+l ,1) & * MXXF(i,j+n,k+l,i+idir,j+n-1,k+l+1) & +sigmaf(is,j+n ,k+l-1,1) & * MXXF(i,j+n,k+l,i+idir,j+n+1,k+l-1) & +sigmaf(is,j+n ,k+l ,1) & * MXXF(i,j+n,k+l,i+idir,j+n+1,k+l+1) tmp = tmp & +sigmaf(is,j+n-1,k+l-1,2) & * MYYF(i,j+n,k+l,i+idir,j+n-1,k+l-1) & +sigmaf(is,j+n-1,k+l ,2) & * MYYF(i,j+n,k+l,i+idir,j+n-1,k+l+1) & +sigmaf(is,j+n ,k+l-1,2) & * MYYF(i,j+n,k+l,i+idir,j+n+1,k+l-1) & +sigmaf(is,j+n ,k+l ,2) & * MYYF(i,j+n,k+l,i+idir,j+n+1,k+l+1) tmp = tmp & +sigmaf(is,j+n-1,k+l-1,3) & * MZZF(i,j+n,k+l,i+idir,j+n-1,k+l-1) & +sigmaf(is,j+n-1,k+l ,3) & * MZZF(i,j+n,k+l,i+idir,j+n-1,k+l+1) & +sigmaf(is,j+n ,k+l-1,3) & * MZZF(i,j+n,k+l,i+idir,j+n+1,k+l-1) & +sigmaf(is,j+n ,k+l ,3) & * MZZF(i,j+n,k+l,i+idir,j+n+1,k+l+1) cen = & 4.0D0 *(sigmaf(is,j+n-1,k+l-1,1) + sigmaf(is,j+n-1,k+l ,1) & +sigmaf(is,j+n ,k+l-1,1) + sigmaf(is,j+n ,k+l ,1) & +sigmaf(is,j+n-1,k+l-1,2) + sigmaf(is,j+n-1,k+l ,2) & +sigmaf(is,j+n ,k+l-1,2) + sigmaf(is,j+n ,k+l ,2) & +sigmaf(is,j+n-1,k+l-1,3) + sigmaf(is,j+n-1,k+l ,3) & +sigmaf(is,j+n ,k+l-1,3) + sigmaf(is,j+n ,k+l ,3)) res(i,j,k) = res(i,j,k) & - fac1 * (tmp - cen * fdst(i,j+n,k+l)) end do end do end do end do else if (idim .eq. 1) then j = regl1 if (idir .eq. 1) then js = j - 1 else js = j end if do k = regl2, regh2 do i = regl0, regh0 tmp = sigmac(i-1,js,k-1,1) * MXXC(i-1,j-idir,k-1) & +sigmac(i-1,js,k ,1) * MXXC(i-1,j-idir,k+1) & +sigmac(i ,js,k-1,1) * MXXC(i+1,j-idir,k-1) & +sigmac(i ,js,k ,1) * MXXC(i+1,j-idir,k+1) tmp = tmp & +sigmac(i-1,js,k-1,2) * MYYC(i-1,j-idir,k-1) & +sigmac(i-1,js,k ,2) * MYYC(i-1,j-idir,k+1) & +sigmac(i ,js,k-1,2) * MYYC(i+1,j-idir,k-1) & +sigmac(i ,js,k ,2) * MYYC(i+1,j-idir,k+1) tmp = tmp & +sigmac(i-1,js,k-1,3) * MZZC(i-1,j-idir,k-1) & +sigmac(i-1,js,k ,3) * MZZC(i-1,j-idir,k+1) & +sigmac(i ,js,k-1,3) * MZZC(i+1,j-idir,k-1) & +sigmac(i ,js,k ,3) * MZZC(i+1,j-idir,k+1) cen = & 4.0D0 * (sigmac(i-1,js,k-1,1) + sigmac(i-1,js,k,1) & +sigmac(i ,js,k-1,1) + sigmac(i ,js,k,1) & +sigmac(i-1,js,k-1,2) + sigmac(i-1,js,k,2) & +sigmac(i ,js,k-1,2) + sigmac(i ,js,k,2) & +sigmac(i-1,js,k-1,3) + sigmac(i-1,js,k,3) & +sigmac(i ,js,k-1,3) + sigmac(i ,js,k,3)) res(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) - fac00 * (tmp - cen * cdst(i,j,k)) end do end do fac0 = fac00 / (ir * kr) j = j * jr if (idir .eq. 1) then js = j else js = j - 1 end if do l = -(kr-1), kr-1 fac2 = (kr-abs(l)) * fac0 do m = -(ir-1), ir-1 fac1 = (ir-abs(m)) * fac2 do k = kr*regl2, kr*regh2, kr do i = ir*regl0, ir*regh0, ir tmp = sigmaf(i+m-1,js,k+l-1,1) & * MXXF(i+m,j,k+l,i+m-1,j+idir,k+l-1) & +sigmaf(i+m-1,js,k+l ,1) & * MXXF(i+m,j,k+l,i+m-1,j+idir,k+l+1) & +sigmaf(i+m ,js,k+l-1,1) & * MXXF(i+m,j,k+l,i+m+1,j+idir,k+l-1) & +sigmaf(i+m ,js,k+l ,1) & * MXXF(i+m,j,k+l,i+m+1,j+idir,k+l+1) tmp = tmp & +sigmaf(i+m-1,js,k+l-1,2) & * MYYF(i+m,j,k+l,i+m-1,j+idir,k+l-1) & +sigmaf(i+m-1,js,k+l ,2) & * MYYF(i+m,j,k+l,i+m-1,j+idir,k+l+1) & +sigmaf(i+m ,js,k+l-1,2) & * MYYF(i+m,j,k+l,i+m+1,j+idir,k+l-1) & +sigmaf(i+m ,js,k+l ,2) & * MYYF(i+m,j,k+l,i+m+1,j+idir,k+l+1) tmp = tmp & +sigmaf(i+m-1,js,k+l-1,3) & * MZZF(i+m,j,k+l,i+m-1,j+idir,k+l-1) & +sigmaf(i+m-1,js,k+l ,3) & * MZZF(i+m,j,k+l,i+m-1,j+idir,k+l+1) & +sigmaf(i+m ,js,k+l-1,3) & * MZZF(i+m,j,k+l,i+m+1,j+idir,k+l-1) & +sigmaf(i+m ,js,k+l ,3) & * MZZF(i+m,j,k+l,i+m+1,j+idir,k+l+1) cen = & 4.0D0 * (sigmaf(i+m-1,js,k+l-1,1) + sigmaf(i+m-1,js,k+l ,1) & +sigmaf(i+m ,js,k+l-1,1) + sigmaf(i+m ,js,k+l ,1) & +sigmaf(i+m-1,js,k+l-1,2) + sigmaf(i+m-1,js,k+l ,2) & +sigmaf(i+m ,js,k+l-1,2) + sigmaf(i+m ,js,k+l ,2) & +sigmaf(i+m-1,js,k+l-1,3) + sigmaf(i+m-1,js,k+l ,3) & +sigmaf(i+m ,js,k+l-1,3) + sigmaf(i+m ,js,k+l ,3)) res(i,j,k) = res(i,j,k) - fac1 * (tmp - cen * fdst(i+m,j,k+l)) end do end do end do end do else k = regl2 if (idir .eq. 1) then ks = k - 1 else ks = k end if do j = regl1, regh1 do i = regl0, regh0 tmp = sigmac(i-1,j-1,ks,1) * MXXC(i-1,j-1,k-idir) & +sigmac(i-1,j ,ks,1) * MXXC(i-1,j+1,k-idir) & +sigmac(i ,j-1,ks,1) * MXXC(i+1,j-1,k-idir) & +sigmac(i ,j ,ks,1) * MXXC(i+1,j+1,k-idir) tmp = tmp & +sigmac(i-1,j-1,ks,2) * MYYC(i-1,j-1,k-idir) & +sigmac(i-1,j ,ks,2) * MYYC(i-1,j+1,k-idir) & +sigmac(i ,j-1,ks,2) * MYYC(i+1,j-1,k-idir) & +sigmac(i ,j ,ks,2) * MYYC(i+1,j+1,k-idir) tmp = tmp & +sigmac(i-1,j-1,ks,3) * MZZC(i-1,j-1,k-idir) & +sigmac(i-1,j ,ks,3) * MZZC(i-1,j+1,k-idir) & +sigmac(i ,j-1,ks,3) * MZZC(i+1,j-1,k-idir) & +sigmac(i ,j ,ks,3) * MZZC(i+1,j+1,k-idir) cen = & 4.0D0 * ( sigmac(i-1,j-1,ks,1) & +sigmac(i-1,j ,ks,1) & +sigmac(i ,j-1,ks,1) & +sigmac(i ,j ,ks,1) & +sigmac(i-1,j-1,ks,2) & +sigmac(i-1,j ,ks,2) & +sigmac(i ,j-1,ks,2) & +sigmac(i ,j ,ks,2) & +sigmac(i-1,j-1,ks,3) & +sigmac(i-1,j ,ks,3) & +sigmac(i ,j-1,ks,3) & +sigmac(i ,j ,ks,3)) res(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) - fac00 * (tmp - cen * cdst(i,j,k)) end do end do fac0 = fac00 / (ir * jr) k = k * kr if (idir .eq. 1) then ks = k else ks = k - 1 end if do n = -(jr-1), jr-1 fac2 = (jr-abs(n)) * fac0 do m = -(ir-1), ir-1 fac1 = (ir-abs(m)) * fac2 do j = jr*regl1, jr*regh1, jr do i = ir*regl0, ir*regh0, ir tmp = sigmaf(i+m-1,j+n-1,ks,1) & * MXXF(i+m,j+n,k,i+m-1,j+n-1,k+idir) & +sigmaf(i+m-1,j+n ,ks,1) & * MXXF(i+m,j+n,k,i+m-1,j+n+1,k+idir) & +sigmaf(i+m ,j+n-1,ks,1) & * MXXF(i+m,j+n,k,i+m+1,j+n-1,k+idir) & +sigmaf(i+m ,j+n ,ks,1) & * MXXF(i+m,j+n,k,i+m+1,j+n+1,k+idir) tmp = tmp & +sigmaf(i+m-1,j+n-1,ks,2) & * MYYF(i+m,j+n,k,i+m-1,j+n-1,k+idir) & +sigmaf(i+m-1,j+n ,ks,2) & * MYYF(i+m,j+n,k,i+m-1,j+n+1,k+idir) & +sigmaf(i+m ,j+n-1,ks,2) & * MYYF(i+m,j+n,k,i+m+1,j+n-1,k+idir) & +sigmaf(i+m ,j+n ,ks,2) & * MYYF(i+m,j+n,k,i+m+1,j+n+1,k+idir) tmp = tmp & +sigmaf(i+m-1,j+n-1,ks,3) & * MZZF(i+m,j+n,k,i+m-1,j+n-1,k+idir) & +sigmaf(i+m-1,j+n ,ks,3) & * MZZF(i+m,j+n,k,i+m-1,j+n+1,k+idir) & +sigmaf(i+m ,j+n-1,ks,3) & * MZZF(i+m,j+n,k,i+m+1,j+n-1,k+idir) & +sigmaf(i+m ,j+n ,ks,3) & * MZZF(i+m,j+n,k,i+m+1,j+n+1,k+idir) cen = & 4.0D0 * (sigmaf(i+m-1,j+n-1,ks,1) & +sigmaf(i+m-1,j+n ,ks,1) & +sigmaf(i+m ,j+n-1,ks,1) & +sigmaf(i+m ,j+n ,ks,1) & +sigmaf(i+m-1,j+n-1,ks,2) & +sigmaf(i+m-1,j+n ,ks,2) & +sigmaf(i+m ,j+n-1,ks,2) & +sigmaf(i+m ,j+n ,ks,2) & +sigmaf(i+m-1,j+n-1,ks,3) & +sigmaf(i+m-1,j+n ,ks,3) & +sigmaf(i+m ,j+n-1,ks,3) & +sigmaf(i+m ,j+n ,ks,3)) res(i,j,k) = res(i,j,k) - fac1 * (tmp - cen * fdst(i+m,j+n,k)) end do end do end do end do end if end c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along face subroutine hgeres_full( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & fdst, fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2, & cdst, cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2, & sigmaf, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & sigmac, scl0,sch0,scl1,sch1,scl2,sch2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz, ir, jr, kr, ga, ivect) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2 integer cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer scl0,sch0,scl1,sch1,scl2,sch2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision hx, hy, hz double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1,fdstl2:fdsth2) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1,cdstl2:cdsth2) double precision sigmaf(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2,3) double precision sigmac(scl0:sch0,scl1:sch1,scl2:sch2,3) integer ir, jr, kr, ivect(0:2), ga(0:1,0:1,0:1) double precision fac00, fac0, fac1, fac, tmp, cen integer ic, jc, kc, if, jf, kf, ji, ki, idir, jdir, kdir integer l, m, n integer ii, jj, kk, i1, j1, k1 double precision MXXC, MYYC, MZZC double precision MXXF, MYYF, MZZF MXXC(ii,jj,kk) = (4.0D0 * cdst(ii,jc,kc) + & 2.0D0 * (cdst(ii,jj,kc) - cdst(ic,jj,kc) + & cdst(ii,jc,kk) - cdst(ic,jc,kk)) + & (cdst(ii,jj,kk) - cdst(ic,jj,kk))) MYYC(ii,jj,kk) = (4.0D0 * cdst(ic,jj,kc) + & 2.0D0 * (cdst(ii,jj,kc) - cdst(ii,jc,kc) + & cdst(ic,jj,kk) - cdst(ic,jc,kk)) + & (cdst(ii,jj,kk) - cdst(ii,jc,kk))) MZZC(ii,jj,kk) = (4.0D0 * cdst(ic,jc,kk) + & 2.0D0 * (cdst(ii,jc,kk) - cdst(ii,jc,kc) + & cdst(ic,jj,kk) - cdst(ic,jj,kc)) + & (cdst(ii,jj,kk) - cdst(ii,jj,kc))) MXXF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(ii,j1,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(i1,jj,k1) + & fdst(ii,j1,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(i1,jj,kk))) MYYF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,jj,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(ii,j1,kk))) MZZF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,j1,kk) + & 2.0D0 * (fdst(ii,j1,kk) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,jj,k1)) + & (fdst(ii,jj,kk) - fdst(ii,jj,k1))) ic = regl0 jc = regl1 kc = regl2 if = ic * ir jf = jc * jr kf = kc * kr fac00 = 1.0D0 / 36 if (ivect(0) .eq. 0) then do if = ir*regl0, ir*regh0, ir res(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac0 = 1.0D0 / ir do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) .eq. 1) then do m = -(ir-1), ir-1 fac = (ir-abs(m)) * fac0 do if = ir*regl0, ir*regh0, ir tmp = sigmaf(if+m-1,jf+ji-1,kf+ki-1,1) * & MXXF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,1) * & MXXF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,2) * & MYYF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,2) * & MYYF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,3) * & MZZF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,3) * & MZZF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) cen = & 4.0D0 * ( sigmaf(if+m-1,jf+ji-1,kf+ki-1,1) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,1) & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,2) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,2) & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,3) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,3)) tmp = tmp - cen * fdst(if+m,jf,kf) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do else do ic = regl0, regh0 if = ic * ir tmp = sigmac(ic-1,jc+ji-1,kc+ki-1,1) * & MXXC(ic-1,jc+jdir,kc+kdir) & +sigmac(ic ,jc+ji-1,kc+ki-1,1) * & MXXC(ic+1,jc+jdir,kc+kdir) tmp = tmp & +sigmac(ic-1,jc+ji-1,kc+ki-1,2) * & MYYC(ic-1,jc+jdir,kc+kdir) & +sigmac(ic ,jc+ji-1,kc+ki-1,2) * & MYYC(ic+1,jc+jdir,kc+kdir) tmp = tmp & +sigmac(ic-1,jc+ji-1,kc+ki-1,3) * & MZZC(ic-1,jc+jdir,kc+kdir) & +sigmac(ic ,jc+ji-1,kc+ki-1,3) * & MZZC(ic+1,jc+jdir,kc+kdir) cen = & 4.0D0 * ( sigmac(ic-1,jc+ji-1,kc+ki-1,1) & +sigmac(ic ,jc+ji-1,kc+ki-1,1) & +sigmac(ic-1,jc+ji-1,kc+ki-1,2) & +sigmac(ic ,jc+ji-1,kc+ki-1,2) & +sigmac(ic-1,jc+ji-1,kc+ki-1,3) & +sigmac(ic ,jc+ji-1,kc+ki-1,3)) tmp = tmp - cen * cdst(ic,jc,kc) res(if,jf,kf) = res(if,jf,kf) + tmp end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) - ga(0,ji,1-ki) .eq. 1) then fac0 = 1.0D0 / (ir * jr) do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 do m = -(ir-1), ir-1 fac = (ir-abs(m)) * fac1 do if = ir*regl0, ir*regh0, ir tmp = sigmaf(if+m-1,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) cen = & 4.0D0 * (sigmaf(if+m-1,jf+n-1,kf+ki-1,1) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) & +sigmaf(if+m ,jf+n ,kf+ki-1,3)) tmp = tmp - cen * fdst(if+m,jf+n,kf) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if if (ga(0,ji,ki) - ga(0,1-ji,ki) .eq. 1) then fac0 = 1.0D0 / (ir * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do m = -(ir-1), ir-1 fac = (ir-abs(m)) * fac1 do if = ir*regl0, ir*regh0, ir tmp = sigmaf(if+m-1,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) cen = & 4.0D0 * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,1) & +sigmaf(if+m ,jf+ji-1,kf+l ,1) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) & +sigmaf(if+m-1,jf+ji-1,kf+l ,2) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) & +sigmaf(if+m ,jf+ji-1,kf+l ,2) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) & +sigmaf(if+m-1,jf+ji-1,kf+l ,3) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) & +sigmaf(if+m ,jf+ji-1,kf+l ,3)) tmp = tmp - cen * fdst(if+m,jf,kf+l) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if end do end do c weighting do if = ir*regl0, ir*regh0, ir res(if,jf,kf) = src(if,jf,kf) - res(if,jf,kf) * fac00 end do else if (ivect(1) .eq. 0) then do jf = jr*regl1, jr*regh1, jr res(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac0 = 1.0D0 / jr do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) .eq. 1) then do n = -(jr-1), jr-1 fac = (jr-abs(n)) * fac0 do jf = jr*regl1, jr*regh1, jr tmp = sigmaf(if+ii-1,jf+n-1,kf+ki-1,1) * & MXXF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,1) * & MXXF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,2) * & MYYF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,2) * & MYYF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,3) * & MZZF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,3) * & MZZF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) cen = & 4.0D0 * ( sigmaf(if+ii-1,jf+n-1,kf+ki-1,1) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,1) & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,2) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,2) & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,3) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,3)) tmp = tmp - cen * fdst(if,jf+n,kf) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do else do jc = regl1, regh1 jf = jc * jr tmp = sigmac(ic+ii-1,jc-1,kc+ki-1,1) * & MXXC(ic+idir,jc-1,kc+kdir) & +sigmac(ic+ii-1,jc ,kc+ki-1,1) * & MXXC(ic+idir,jc+1,kc+kdir) tmp = tmp & +sigmac(ic+ii-1,jc-1,kc+ki-1,2) * & MYYC(ic+idir,jc-1,kc+kdir) & +sigmac(ic+ii-1,jc ,kc+ki-1,2) * & MYYC(ic+idir,jc+1,kc+kdir) tmp = tmp & +sigmac(ic+ii-1,jc-1,kc+ki-1,3) * & MZZC(ic+idir,jc-1,kc+kdir) & +sigmac(ic+ii-1,jc ,kc+ki-1,3) * & MZZC(ic+idir,jc+1,kc+kdir) cen = & 4.0D0 * ( & +sigmac(ic+ii-1,jc-1,kc+ki-1,1) & +sigmac(ic+ii-1,jc ,kc+ki-1,1) & +sigmac(ic+ii-1,jc-1,kc+ki-1,2) & +sigmac(ic+ii-1,jc ,kc+ki-1,2) & +sigmac(ic+ii-1,jc-1,kc+ki-1,3) & +sigmac(ic+ii-1,jc ,kc+ki-1,3)) tmp = tmp - cen * cdst(ic,jc,kc) res(if,jf,kf) = res(if,jf,kf) + tmp end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) - ga(ii,0,1-ki) .eq. 1) then fac0 = 1.0D0 / (ir * jr) do n = -(jr-1), jr-1 fac1 = (jr-abs(n)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do jf = jr*regl1, jr*regh1, jr tmp = sigmaf(if+m-1,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) tmp = tmp & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir) cen = & 4.0D0 * (sigmaf(if+m-1,jf+n-1,kf+ki-1,1) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) & +sigmaf(if+m ,jf+n ,kf+ki-1,3)) tmp = tmp - cen * fdst(if+m,jf+n,kf) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if if (ga(ii,0,ki) - ga(1-ii,0,ki) .eq. 1) then fac0 = 1.0D0 / (jr * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do n = -(jr-1), jr-1 fac = (jr-abs(n)) * fac1 do jf = jr*regl1, jr*regh1, jr tmp = sigmaf(if+ii-1,jf+n-1,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) cen = & 4.0D0 * (sigmaf(if+ii-1,jf+n-1,kf+l-1,1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) & +sigmaf(if+ii-1,jf+n ,kf+l ,1) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) & +sigmaf(if+ii-1,jf+n-1,kf+l ,2) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) & +sigmaf(if+ii-1,jf+n ,kf+l ,2) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) & +sigmaf(if+ii-1,jf+n-1,kf+l ,3) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) & +sigmaf(if+ii-1,jf+n ,kf+l ,3)) tmp = tmp - cen * fdst(if,jf+n,kf+l) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if end do end do c weighting do jf = jr*regl1, jr*regh1, jr res(if,jf,kf) = src(if,jf,kf) - res(if,jf,kf) * fac00 end do else do kf = kr*regl2, kr*regh2, kr res(if,jf,kf) = 0.0D0 end do c quadrants c each quadrant is two octants and their share of the two central edges fac0 = 1.0D0 / kr do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) .eq. 1) then do l = -(kr-1), kr-1 fac = (kr-abs(l)) * fac0 do kf = kr*regl2, kr*regh2, kr tmp = sigmaf(if+ii-1,jf+ji-1,kf+l-1,1) * & MXXF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,1) * & MXXF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,2) * & MYYF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,2) * & MYYF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,3) * & MZZF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,3) * & MZZF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) cen = & 4.0D0 * (sigmaf(if+ii-1,jf+ji-1,kf+l-1,1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,1) & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,2) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,2) & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,3) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,3)) tmp = tmp - cen * fdst(if,jf,kf+l) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do else do kc = regl2, regh2 kf = kc * kr tmp = sigmac(ic+ii-1,jc+ji-1,kc-1,1) * & MXXC(ic+idir,jc+jdir,kc-1) & +sigmac(ic+ii-1,jc+ji-1,kc ,1) * & MXXC(ic+idir,jc+jdir,kc+1) tmp = tmp & +sigmac(ic+ii-1,jc+ji-1,kc-1,2) * & MYYC(ic+idir,jc+jdir,kc-1) & +sigmac(ic+ii-1,jc+ji-1,kc ,2) * & MYYC(ic+idir,jc+jdir,kc+1) tmp = tmp & +sigmac(ic+ii-1,jc+ji-1,kc-1,3) * & MZZC(ic+idir,jc+jdir,kc-1) & +sigmac(ic+ii-1,jc+ji-1,kc ,3) * & MZZC(ic+idir,jc+jdir,kc+1) cen = & 4.0D0 * (sigmac(ic+ii-1,jc+ji-1,kc-1,1) & +sigmac(ic+ii-1,jc+ji-1,kc ,1) & +sigmac(ic+ii-1,jc+ji-1,kc-1,2) & +sigmac(ic+ii-1,jc+ji-1,kc ,2) & +sigmac(ic+ii-1,jc+ji-1,kc-1,3) & +sigmac(ic+ii-1,jc+ji-1,kc ,3) ) tmp = tmp - cen * cdst(ic,jc,kc) res(if,jf,kf) = res(if,jf,kf) + tmp end do end if end do end do c faces c each face is two faces and two sides of an edge do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) - ga(ii,1-ji,0) .eq. 1) then fac0 = 1.0D0 / (ir * kr) do l = -(kr-1), kr-1 fac1 = (kr-abs(l)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do kf = kr*regl2, kr*regh2, kr tmp = sigmaf(if+m-1,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) tmp = tmp & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) cen = & 4.0D0 * (sigmaf(if+m-1,jf+ji-1,kf+l-1,1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,1) & +sigmaf(if+m ,jf+ji-1,kf+l ,1) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) & +sigmaf(if+m-1,jf+ji-1,kf+l ,2) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) & +sigmaf(if+m ,jf+ji-1,kf+l ,2) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) & +sigmaf(if+m-1,jf+ji-1,kf+l ,3) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) & +sigmaf(if+m ,jf+ji-1,kf+l ,3)) tmp = tmp - cen * fdst(if+m,jf,kf+l) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if if (ga(ii,ji,0) - ga(1-ii,ji,0) .eq. 1) then fac0 = 1.0D0 / (jr * kr) do l = -(kr-1), kr-1 fac1 = (kr-abs(l)) * fac0 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 do kf = kr*regl2, kr*regh2, kr tmp = sigmaf(if+ii-1,jf+n-1,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) tmp = tmp & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) cen = & 4.0D0 * (sigmaf(if+ii-1,jf+n-1,kf+l-1,1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) & +sigmaf(if+ii-1,jf+n ,kf+l ,1) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) & +sigmaf(if+ii-1,jf+n-1,kf+l ,2) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) & +sigmaf(if+ii-1,jf+n ,kf+l ,2) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) & +sigmaf(if+ii-1,jf+n-1,kf+l ,3) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) & +sigmaf(if+ii-1,jf+n ,kf+l ,3)) tmp = tmp - cen * fdst(if,jf+n,kf+l) res(if,jf,kf) = res(if,jf,kf) + fac * tmp end do end do end do end if end do end do c weighting do kf = kr*regl2, kr*regh2, kr res(if,jf,kf) = src(if,jf,kf) - res(if,jf,kf) * fac00 end do end if end c----------------------------------------------------------------------- c Note---assumes fdst linearly interpolated from cdst along face subroutine hgcres_full( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & fdst, fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2, & cdst, cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2, & sigmaf, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & sigmac, scl0,sch0,scl1,sch1,scl2,sch2, & regl0,regh0,regl1,regh1,regl2,regh2, & hx, hy, hz, ir, jr, kr, ga, idd) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fdstl0,fdsth0,fdstl1,fdsth1,fdstl2,fdsth2 integer cdstl0,cdsth0,cdstl1,cdsth1,cdstl2,cdsth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer scl0,sch0,scl1,sch1,scl2,sch2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision hx, hy, hz double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1,fdstl2:fdsth2) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1,cdstl2:cdsth2) double precision sigmaf(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2,3) double precision sigmac(scl0:sch0,scl1:sch1,scl2:sch2,3) integer ir, jr, kr, ga(0:1,0:1,0:1), idd double precision cen, sum, fac00, fac1, fac2, fac integer ic, jc, kc, if, jf, kf, ji, ki, idir, jdir, kdir integer l, m, n integer ii, jj, kk, i1, j1, k1 double precision MXXC, MYYC, MZZC double precision MXXF, MYYF, MZZF MXXC(ii,jj,kk) = (4.0D0 * cdst(ii,jc,kc) + & 2.0D0 * (cdst(ii,jj,kc) - cdst(ic,jj,kc) + & cdst(ii,jc,kk) - cdst(ic,jc,kk)) + & (cdst(ii,jj,kk) - cdst(ic,jj,kk))) MYYC(ii,jj,kk) = (4.0D0 * cdst(ic,jj,kc) + & 2.0D0 * (cdst(ii,jj,kc) - cdst(ii,jc,kc) + & cdst(ic,jj,kk) - cdst(ic,jc,kk)) + & (cdst(ii,jj,kk) - cdst(ii,jc,kk))) MZZC(ii,jj,kk) = (4.0D0 * cdst(ic,jc,kk) + & 2.0D0 * (cdst(ii,jc,kk) - cdst(ii,jc,kc) + & cdst(ic,jj,kk) - cdst(ic,jj,kc)) + & (cdst(ii,jj,kk) - cdst(ii,jj,kc))) MXXF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(ii,j1,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(i1,jj,k1) + & fdst(ii,j1,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(i1,jj,kk))) MYYF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,jj,k1) + & 2.0D0 * (fdst(ii,jj,k1) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,j1,kk)) + & (fdst(ii,jj,kk) - fdst(ii,j1,kk))) MZZF(i1,j1,k1,ii,jj,kk) = (4.0D0 * fdst(i1,j1,kk) + & 2.0D0 * (fdst(ii,j1,kk) - fdst(ii,j1,k1) + & fdst(i1,jj,kk) - fdst(i1,jj,k1)) + & (fdst(ii,jj,kk) - fdst(ii,jj,k1))) ic = regl0 jc = regl1 kc = regl2 if = ic * ir jf = jc * jr kf = kc * kr sum = 0.0D0 fac00 = 1.0D0 / 36 c octants do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) .eq. 1) then sum = sum & +sigmaf(if+ii-1,jf+ji-1,kf+ki-1,1) * & MXXF(if,jf,kf,if+idir,jf+jdir,kf+kdir) & +sigmaf(if+ii-1,jf+ji-1,kf+ki-1,2) * & MYYF(if,jf,kf,if+idir,jf+jdir,kf+kdir) & +sigmaf(if+ii-1,jf+ji-1,kf+ki-1,3) * & MZZF(if,jf,kf,if+idir,jf+jdir,kf+kdir) cen = & 4.0D0 * ( sigmaf(if+ii-1,jf+ji-1,kf+ki-1,1) & +sigmaf(if+ii-1,jf+ji-1,kf+ki-1,2) & +sigmaf(if+ii-1,jf+ji-1,kf+ki-1,3)) sum = sum - cen * fdst(if,jf,kf) else sum = sum & +sigmac(ic+ii-1,jc+ji-1,kc+ki-1,1) * & MXXC(ic+idir,jc+jdir,kc+kdir) & +sigmac(ic+ii-1,jc+ji-1,kc+ki-1,2) * & MYYC(ic+idir,jc+jdir,kc+kdir) & +sigmac(ic+ii-1,jc+ji-1,kc+ki-1,3) * & MZZC(ic+idir,jc+jdir,kc+kdir) cen = & 4.0D0 * ( sigmac(ic+ii-1,jc+ji-1,kc+ki-1,1) & +sigmac(ic+ii-1,jc+ji-1,kc+ki-1,2) & +sigmac(ic+ii-1,jc+ji-1,kc+ki-1,3)) sum = sum - cen * cdst(ic,jc,kc) end if end do end do end do c faces do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) - ga(ii,ji,1-ki) .eq. 1) then fac2 = 1.0D0 / (ir * jr) do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac2 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( & +sigmaf(if+m-1,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) * & MXXF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir)) sum = sum + fac * ( & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) * & MYYF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir)) sum = sum + fac * ( & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n-1,kf+kdir) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m-1,jf+n+1,kf+kdir) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n-1,kf+kdir) & +sigmaf(if+m ,jf+n ,kf+ki-1,3) * & MZZF(if+m,jf+n,kf,if+m+1,jf+n+1,kf+kdir)) cen = & 4.0D0 * ( sigmaf(if+m-1,jf+n-1,kf+ki-1,1) & +sigmaf(if+m-1,jf+n ,kf+ki-1,1) & +sigmaf(if+m ,jf+n-1,kf+ki-1,1) & +sigmaf(if+m ,jf+n ,kf+ki-1,1) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,2) & +sigmaf(if+m-1,jf+n ,kf+ki-1,2) & +sigmaf(if+m ,jf+n-1,kf+ki-1,2) & +sigmaf(if+m ,jf+n ,kf+ki-1,2) & +sigmaf(if+m-1,jf+n-1,kf+ki-1,3) & +sigmaf(if+m-1,jf+n ,kf+ki-1,3) & +sigmaf(if+m ,jf+n-1,kf+ki-1,3) & +sigmaf(if+m ,jf+n ,kf+ki-1,3)) sum = sum - fac * cen * fdst(if+m,jf+n,kf) end do end do end if if (ga(ii,ji,ki) - ga(ii,1-ji,ki) .eq. 1) then fac2 = 1.0D0 / (ir * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac2 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,1) * & MXXF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,2) * & MYYF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l-1) & +sigmaf(if+m-1,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m-1,jf+jdir,kf+l+1) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l-1) & +sigmaf(if+m ,jf+ji-1,kf+l ,3) * & MZZF(if+m,jf,kf+l,if+m+1,jf+jdir,kf+l+1) ) cen = & 4.0D0 * ( & + sigmaf(if+m-1,jf+ji-1,kf+l-1,1) & + sigmaf(if+m-1,jf+ji-1,kf+l,1) & + sigmaf(if+m ,jf+ji-1,kf+l-1,1) & + sigmaf(if+m ,jf+ji-1,kf+l,1) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,2) & + sigmaf(if+m-1,jf+ji-1,kf+l,2) & +sigmaf(if+m ,jf+ji-1,kf+l-1,2) & + sigmaf(if+m ,jf+ji-1,kf+l,2) & +sigmaf(if+m-1,jf+ji-1,kf+l-1,3) & + sigmaf(if+m-1,jf+ji-1,kf+l,3) & +sigmaf(if+m ,jf+ji-1,kf+l-1,3) & + sigmaf(if+m ,jf+ji-1,kf+l,3)) sum = sum - fac * cen * fdst(if+m,jf,kf+l) end do end do end if if (ga(ii,ji,ki) - ga(1-ii,ji,ki) .eq. 1) then fac2 = 1.0D0 / (jr * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac2 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,1) * & MXXF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,2) * & MYYF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l-1) & +sigmaf(if+ii-1,jf+n-1,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n-1,kf+l+1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l-1) & +sigmaf(if+ii-1,jf+n ,kf+l ,3) * & MZZF(if,jf+n,kf+l,if+idir,jf+n+1,kf+l+1) ) cen = & 4.0D0 * ( & sigmaf(if+ii-1,jf+n-1,kf+l-1,1) & + sigmaf(if+ii-1,jf+n-1,kf+l ,1) & +sigmaf(if+ii-1,jf+n ,kf+l-1,1) & + sigmaf(if+ii-1,jf+n ,kf+l ,1) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,2) & + sigmaf(if+ii-1,jf+n-1,kf+l ,2) & +sigmaf(if+ii-1,jf+n ,kf+l-1,2) & + sigmaf(if+ii-1,jf+n ,kf+l ,2) & +sigmaf(if+ii-1,jf+n-1,kf+l-1,3) & + sigmaf(if+ii-1,jf+n-1,kf+l ,3) & +sigmaf(if+ii-1,jf+n ,kf+l-1,3) & + sigmaf(if+ii-1,jf+n ,kf+l ,3)) sum = sum - fac * cen * fdst(if,jf+n,kf+l) end do end do end if end do end do end do c edges do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(ii,1-ji,ki), ga(ii,1-ji,1-ki)) & .eq. 1) then fac1 = 1.0D0 / ir do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,1) * & MXXF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,1) * & MXXF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) ) sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,2) * & MYYF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,2) * & MYYF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) ) sum = sum + fac * ( & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,3) * & MZZF(if+m,jf,kf,if+m-1,jf+jdir,kf+kdir) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,3) * & MZZF(if+m,jf,kf,if+m+1,jf+jdir,kf+kdir) ) cen = & 4.0D0 * ( sigmaf(if+m-1,jf+ji-1,kf+ki-1,1) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,1) & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,2) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,2) & +sigmaf(if+m-1,jf+ji-1,kf+ki-1,3) & +sigmaf(if+m ,jf+ji-1,kf+ki-1,3)) sum = sum - fac * cen * fdst(if+m,jf,kf) end do end if if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(1-ii,ji,ki), ga(1-ii,ji,1-ki)) & .eq. 1) then fac1 = 1.0D0 / jr do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,1) * & MXXF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,1) * & MXXF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,2) * & MYYF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,2) * & MYYF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,3) * & MZZF(if,jf+n,kf,if+idir,jf+n-1,kf+kdir) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,3) * & MZZF(if,jf+n,kf,if+idir,jf+n+1,kf+kdir) ) cen = & 4.0D0 * ( sigmaf(if+ii-1,jf+n-1,kf+ki-1,1) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,1) & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,2) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,2) & +sigmaf(if+ii-1,jf+n-1,kf+ki-1,3) & +sigmaf(if+ii-1,jf+n ,kf+ki-1,3)) sum = sum - fac * cen * fdst(if,jf+n,kf) end do end if if (ga(ii,ji,ki) - & min(ga(ii,1-ji,ki), ga(1-ii,ji,ki), ga(1-ii,1-ji,ki)) & .eq. 1) then fac1 = 1.0D0 / kr do l = kdir, kdir*(kr-1), kdir fac = (kr-abs(l)) * fac1 sum = sum + fac * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,1) * & MXXF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,1) * & MXXF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,2) * & MYYF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,2) * & MYYF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) ) sum = sum + fac * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,3) * & MZZF(if,jf,kf+l,if+idir,jf+jdir,kf+l-1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,3) * & MZZF(if,jf,kf+l,if+idir,jf+jdir,kf+l+1) ) cen = & 4.0D0 * ( & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,1) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,1) & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,2) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,2) & +sigmaf(if+ii-1,jf+ji-1,kf+l-1,3) & +sigmaf(if+ii-1,jf+ji-1,kf+l ,3)) sum = sum - fac * cen * fdst(if,jf,kf+l) end do end if end do end do end do c weighting res(if,jf,kf) = src(if,jf,kf) - sum * fac00 end c twenty-seven-point terrain stencils c----------------------------------------------------------------------- subroutine hgcen_full( & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & sig, sbl0,sbh0,sbl1,sbh1,sbl2,sbh2, & regl0,regh0,regl1,regh1,regl2,regh2) integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer sbl0,sbh0,sbl1,sbh1,sbl2,sbh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) double precision sig(sbl0:sbh0,sbl1:sbh1,sbl2:sbh2, 3) double precision tmp integer i, j, k do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 tmp = (4.0D0 * ( & sig(i-1,j-1,k-1,1) + sig(i-1,j-1,k,1) + & sig(i-1,j ,k-1,1) + sig(i-1,j ,k,1) + & sig(i ,j-1,k-1,1) + sig(i ,j-1,k,1) + & sig(i ,j ,k-1,1) + sig(i ,j ,k,1) + & sig(i-1,j-1,k-1,2) + sig(i-1,j-1,k,2) + & sig(i-1,j ,k-1,2) + sig(i-1,j ,k,2) + & sig(i ,j-1,k-1,2) + sig(i ,j-1,k,2) + & sig(i ,j ,k-1,2) + sig(i ,j ,k,2) + & sig(i-1,j-1,k-1,3) + sig(i-1,j-1,k,3) + & sig(i-1,j ,k-1,3) + sig(i-1,j ,k,3) + & sig(i ,j-1,k-1,3) + sig(i ,j-1,k,3) + & sig(i ,j ,k-1,3) + sig(i ,j ,k,3))) if ( tmp .eq. 0.0 ) then cen(i,j,k) = 0.0d0 else cen(i,j,k) = 36.0d0 / tmp end if end do end do end do end c----------------------------------------------------------------------- subroutine hgrlx_full( & cor, corl0,corh0,corl1,corh1,corl2,corh2, & res, resl0,resh0,resl1,resh1,resl2,resh2, & sig, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & regl0,regh0,regl1,regh1,regl2,regh2) integer corl0,corh0,corl1,corh1,corl2,corh2 integer resl0,resh0,resl1,resh1,resl2,resh2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision cor(corl0:corh0,corl1:corh1,corl2:corh2) double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision sig(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2, 3) double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) double precision fac, tmp integer i, j, k integer ii, jj, kk double precision MXX, MYY, MZZ MXX(ii,jj,kk) = (4.0D0 * cor(ii,j,k) + & 2.0D0 * (cor(ii,jj,k) - cor(i,jj,k) + & cor(ii,j,kk) - cor(i,j,kk)) + & (cor(ii,jj,kk) - cor(i,jj,kk))) MYY(ii,jj,kk) = (4.0D0 * cor(i,jj,k) + & 2.0D0 * (cor(ii,jj,k) - cor(ii,j,k) + & cor(i,jj,kk) - cor(i,j,kk)) + & (cor(ii,jj,kk) - cor(ii,j,kk))) MZZ(ii,jj,kk) = (4.0D0 * cor(i,j,kk) + & 2.0D0 * (cor(ii,j,kk) - cor(ii,j,k) + & cor(i,jj,kk) - cor(i,jj,k)) + & (cor(ii,jj,kk) - cor(ii,jj,k))) fac = 1.0D0 / 36 do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 cdir$ ivdep tmp = sig(i-1,j-1,k-1,1) * MXX(i-1,j-1,k-1) + & sig(i-1,j-1,k ,1) * MXX(i-1,j-1,k+1) + & sig(i-1,j ,k-1,1) * MXX(i-1,j+1,k-1) + & sig(i-1,j ,k ,1) * MXX(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,1) * MXX(i+1,j-1,k-1) + & sig(i ,j-1,k ,1) * MXX(i+1,j-1,k+1) + & sig(i ,j ,k-1,1) * MXX(i+1,j+1,k-1) + & sig(i ,j ,k ,1) * MXX(i+1,j+1,k+1) tmp = tmp + & sig(i-1,j-1,k-1,2) * MYY(i-1,j-1,k-1) + & sig(i-1,j-1,k ,2) * MYY(i-1,j-1,k+1) + & sig(i-1,j ,k-1,2) * MYY(i-1,j+1,k-1) + & sig(i-1,j ,k ,2) * MYY(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,2) * MYY(i+1,j-1,k-1) + & sig(i ,j-1,k ,2) * MYY(i+1,j-1,k+1) + & sig(i ,j ,k-1,2) * MYY(i+1,j+1,k-1) + & sig(i ,j ,k ,2) * MYY(i+1,j+1,k+1) tmp = tmp + & sig(i-1,j-1,k-1,3) * MZZ(i-1,j-1,k-1) + & sig(i-1,j-1,k ,3) * MZZ(i-1,j-1,k+1) + & sig(i-1,j ,k-1,3) * MZZ(i-1,j+1,k-1) + & sig(i-1,j ,k ,3) * MZZ(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,3) * MZZ(i+1,j-1,k-1) + & sig(i ,j-1,k ,3) * MZZ(i+1,j-1,k+1) + & sig(i ,j ,k-1,3) * MZZ(i+1,j+1,k-1) + & sig(i ,j ,k ,3) * MZZ(i+1,j+1,k+1) cor(i,j,k) = (fac * tmp - res(i,j,k)) * cen(i,j,k) end do end do end do end c cor substituted for dest to use same macro: c----------------------------------------------------------------------- subroutine hgres_full( & res, resl0,resh0,resl1,resh1,resl2,resh2, & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & cor, destl0,desth0,destl1,desth1,destl2,desth2, & sig, sfl0,sfh0,sfl1,sfh1,sfl2,sfh2, & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & regl0,regh0,regl1,regh1,regl2,regh2) integer resl0,resh0,resl1,resh1,resl2,resh2 integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer destl0,desth0,destl1,desth1,destl2,desth2 integer sfl0,sfh0,sfl1,sfh1,sfl2,sfh2 integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer regl0,regh0,regl1,regh1,regl2,regh2 double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision cor(destl0:desth0,destl1:desth1,destl2:desth2) double precision sig(sfl0:sfh0,sfl1:sfh1,sfl2:sfh2, 3) double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) double precision fac, tmp integer i, j, k integer ii, jj, kk double precision MXX, MYY, MZZ MXX(ii,jj,kk) = (4.0D0 * cor(ii,j,k) + & 2.0D0 * (cor(ii,jj,k) - cor(i,jj,k) + & cor(ii,j,kk) - cor(i,j,kk)) + & (cor(ii,jj,kk) - cor(i,jj,kk))) MYY(ii,jj,kk) = (4.0D0 * cor(i,jj,k) + & 2.0D0 * (cor(ii,jj,k) - cor(ii,j,k) + & cor(i,jj,kk) - cor(i,j,kk)) + & (cor(ii,jj,kk) - cor(ii,j,kk))) MZZ(ii,jj,kk) = (4.0D0 * cor(i,j,kk) + & 2.0D0 * (cor(ii,j,kk) - cor(ii,j,k) + & cor(i,jj,kk) - cor(i,jj,k)) + & (cor(ii,jj,kk) - cor(ii,jj,k))) fac = 1.0D0 / 36 do k = regl2, regh2 do j = regl1, regh1 do i = regl0, regh0 tmp = & sig(i-1,j-1,k-1,1) * MXX(i-1,j-1,k-1) + & sig(i-1,j-1,k ,1) * MXX(i-1,j-1,k+1) + & sig(i-1,j ,k-1,1) * MXX(i-1,j+1,k-1) + & sig(i-1,j ,k ,1) * MXX(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,1) * MXX(i+1,j-1,k-1) + & sig(i ,j-1,k ,1) * MXX(i+1,j-1,k+1) + & sig(i ,j ,k-1,1) * MXX(i+1,j+1,k-1) + & sig(i ,j ,k ,1) * MXX(i+1,j+1,k+1) tmp = tmp + & sig(i-1,j-1,k-1,2) * MYY(i-1,j-1,k-1) + & sig(i-1,j-1,k ,2) * MYY(i-1,j-1,k+1) + & sig(i-1,j ,k-1,2) * MYY(i-1,j+1,k-1) + & sig(i-1,j ,k ,2) * MYY(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,2) * MYY(i+1,j-1,k-1) + & sig(i ,j-1,k ,2) * MYY(i+1,j-1,k+1) + & sig(i ,j ,k-1,2) * MYY(i+1,j+1,k-1) + & sig(i ,j ,k ,2) * MYY(i+1,j+1,k+1) tmp = tmp + & sig(i-1,j-1,k-1,3) * MZZ(i-1,j-1,k-1) + & sig(i-1,j-1,k ,3) * MZZ(i-1,j-1,k+1) + & sig(i-1,j ,k-1,3) * MZZ(i-1,j+1,k-1) + & sig(i-1,j ,k ,3) * MZZ(i-1,j+1,k+1) tmp = tmp + & sig(i ,j-1,k-1,3) * MZZ(i+1,j-1,k-1) + & sig(i ,j-1,k ,3) * MZZ(i+1,j-1,k+1) + & sig(i ,j ,k-1,3) * MZZ(i+1,j+1,k-1) + & sig(i ,j ,k ,3) * MZZ(i+1,j+1,k+1) c c NOTE: The logic below to allow for cen=0, matches a set of logic in c hgcen where cen is calculated as cen=C/(sum of sigmas). If the c sum of the sigmas is zero, then cen is set to zero. So, the c logic here allows for the case of zero sigmas by eliminating the c last term. if (cen(i,j,k) .ne. 0.0D0) then res(i,j,k) = src(i,j,k) & - fac * tmp + cor(i,j,k) / cen(i,j,k) else res(i,j,k) = src(i,j,k) - fac * tmp end if end do end do end do end c----------------------------------------------------------------------- subroutine hgrlnf_full( & cor, corl0,corh0,corl1,corh1,corl2,corh2, & res, resl0,resh0,resl1,resh1,resl2,resh2, & wrk, wrkl0,wrkh0,wrkl1,wrkh1,wrkl2,wrkh2, & signd, snl0,snh0,snl1,snh1,snl2,snh2, & cen, cenl0,cenh0,cenl1,cenh1,cenl2,cenh2, & regl0,regh0,regl1,regh1,regl2,regh2, & doml0,domh0,doml1,domh1,doml2,domh2, & lsd, ipass) integer corl0,corh0,corl1,corh1,corl2,corh2 integer resl0,resh0,resl1,resh1,resl2,resh2 integer wrkl0,wrkh0,wrkl1,wrkh1,wrkl2,wrkh2 integer snl0,snh0,snl1,snh1,snl2,snh2 integer cenl0,cenh0,cenl1,cenh1,cenl2,cenh2 integer regl0,regh0,regl1,regh1,regl2,regh2 integer doml0,domh0,doml1,domh1,doml2,domh2 double precision cor(corl0:corh0,corl1:corh1,corl2:corh2) double precision res(resl0:resh0,resl1:resh1,resl2:resh2) double precision wrk(wrkl0:wrkh0,wrkl1:wrkh1,wrkl2:wrkh2) double precision signd(snl0:snh0,snl1:snh1,snl2:snh2, 3) double precision cen(cenl0:cenh0,cenl1:cenh1,cenl2:cenh2) integer lsd, ipass stop 'hgrlnf_full: no code' end ccseapps-2.5/CCSEApps/hgproj/hg_multi2d_terrain.f0000644000175000017500000006315211634153073023110 0ustar amckinstryamckinstryc----------------------------------------------------------------------- subroutine hgfres_terrain( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & fdst, fdstl0, fdsth0, fdstl1, fdsth1, & cdst, cdstl0, cdsth0, cdstl1, cdsth1, & sigmaf, sfl0, sfh0, sfl1, sfh1, & sigmac, scl0, sch0, scl1, sch1, & regl0, regh0, regl1, regh1, & hx, hy, ir, jr, idim, idir, idd1) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer fdstl0, fdsth0, fdstl1, fdsth1 integer cdstl0, cdsth0, cdstl1, cdsth1 integer sfl0, sfh0, sfl1, sfh1 integer scl0, sch0, scl1, sch1 integer regl0, regh0, regl1, regh1 double precision hx, hy double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1) double precision sigmaf(sfl0:sfh0,sfl1:sfh1, 3) double precision sigmac(scl0:sch0,scl1:sch1, 3) integer ir, jr, idim, idir double precision fac0, fac1, tmp integer i, j, is, js, m, n integer idd1 if (idim .eq. 0) then i = regl0 if (idir .eq. 1) then is = i - 1 else is = i end if fac0 = 1.d0 / 6.d0 do j = regl1, regh1 res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * & (sigmac(is,j-1,1) * & (cdst(i-idir,j-1) - cdst(i,j-1) + & 2.d0 * (cdst(i-idir,j) - cdst(i,j))) + & sigmac(is,j,1) * & (cdst(i-idir,j+1) - cdst(i,j+1) + & 2.d0 * (cdst(i-idir,j) - cdst(i,j))) + & sigmac(is,j-1,2) * & (cdst(i-idir,j-1) - cdst(i-idir,j) + & 2.d0 * (cdst(i,j-1) - cdst(i,j))) + & sigmac(is,j,2) * & (cdst(i-idir,j+1) - cdst(i-idir,j) + & 2.d0 * (cdst(i,j+1) - cdst(i,j))) - & 3.d0 * (sigmac(is,j-(i-is),3) * & (cdst(i-idir,j-idir) - cdst(i,j)) - & sigmac(is,j-(1-(i-is)),3) * & (cdst(i-idir,j+idir) - cdst(i,j)))) end do fac0 = fac0 / jr i = i * ir if (idir .eq. 1) then is = i else is = i - 1 end if do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5d0 * fac1 do j = jr*regl1, jr*regh1, jr tmp = & sigmaf(is,j-n-1,1) * & (fdst(i+idir,j-n-1) - fdst(i,j-n-1) + & 2.d0 * (fdst(i+idir,j-n) - fdst(i,j-n))) + & sigmaf(is,j-n,1) * & (fdst(i+idir,j-n+1) - fdst(i,j-n+1) + & 2.d0 * (fdst(i+idir,j-n) - fdst(i,j-n))) + & sigmaf(is,j+n-1,1) * & (fdst(i+idir,j+n-1) - fdst(i,j+n-1) + & 2.d0 * (fdst(i+idir,j+n) - fdst(i,j+n))) + & sigmaf(is,j+n,1) * & (fdst(i+idir,j+n+1) - fdst(i,j+n+1) + & 2.d0 * (fdst(i+idir,j+n) - fdst(i,j+n))) res(i,j) = res(i,j) - fac1 * (tmp + & sigmaf(is,j-n-1,2) * & (fdst(i+idir,j-n-1) - fdst(i+idir,j-n) + & 2.d0 * (fdst(i,j-n-1) - fdst(i,j-n))) + & sigmaf(is,j-n,2) * & (fdst(i+idir,j-n+1) - fdst(i+idir,j-n) + & 2.d0 * (fdst(i,j-n+1) - fdst(i,j-n))) + & sigmaf(is,j+n-1,2) * & (fdst(i+idir,j+n-1) - fdst(i+idir,j+n) + & 2.d0 * (fdst(i,j+n-1) - fdst(i,j+n))) + & sigmaf(is,j+n,2) * & (fdst(i+idir,j+n+1) - fdst(i+idir,j+n) + & 2.d0 * (fdst(i,j+n+1) - fdst(i,j+n))) - & 3.d0 * (sigmaf(is,j-n-(i-is),3) * & (fdst(i+idir,j-n+idir) - fdst(i+idir,j-n)) - & sigmaf(is,j-n-(1-(i-is)),3) * & (fdst(i+idir,j-n-idir) - fdst(i+idir,j-n)) + & sigmaf(is,j+n-(i-is),3) * & (fdst(i+idir,j+n+idir) - fdst(i+idir,j+n)) - & sigmaf(is,j+n-(1-(i-is)),3) * & (fdst(i+idir,j+n-idir) - fdst(i+idir,j+n)))) end do end do else j = regl1 if (idir .eq. 1) then js = j - 1 else js = j end if fac0 = 1.d0 / 6.d0 do i = regl0, regh0 res(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * & (sigmac(i-1,js,1) * & (cdst(i-1,j-idir) - cdst(i,j-idir) + & 2.d0 * (cdst(i-1,j) - cdst(i,j))) + & sigmac(i,js,1) * & (cdst(i+1,j-idir) - cdst(i,j-idir) + & 2.d0 * (cdst(i+1,j) - cdst(i,j))) + & sigmac(i-1,js,2) * & (cdst(i-1,j-idir) - cdst(i-1,j) + & 2.d0 * (cdst(i,j-idir) - cdst(i,j))) + & sigmac(i,js,2) * & (cdst(i+1,j-idir) - cdst(i+1,j) + & 2.d0 * (cdst(i,j-idir) - cdst(i,j))) - & 3.d0 * (sigmac(i-(j-js),js,3) * & (cdst(i-idir,j-idir) - cdst(i,j)) - & sigmac(i-(1-(j-js)),js,3) * & (cdst(i+idir,j-idir) - cdst(i,j)))) end do fac0 = fac0 / ir j = j * jr if (idir .eq. 1) then js = j else js = j - 1 end if do m = 0, ir-1 fac1 = (ir-m) * fac0 if (m .eq. 0) fac1 = 0.5d0 * fac1 do i = ir*regl0, ir*regh0, ir tmp = & sigmaf(i-m-1,js,1) * & (fdst(i-m-1,j+idir) - fdst(i-m,j+idir) + & 2.d0 * (fdst(i-m-1,j) - fdst(i-m,j))) + & sigmaf(i-m,js,1) * & (fdst(i-m+1,j+idir) - fdst(i-m,j+idir) + & 2.d0 * (fdst(i-m+1,j) - fdst(i-m,j))) + & sigmaf(i+m-1,js,1) * & (fdst(i+m-1,j+idir) - fdst(i+m,j+idir) + & 2.d0 * (fdst(i+m-1,j) - fdst(i+m,j))) + & sigmaf(i+m,js,1) * & (fdst(i+m+1,j+idir) - fdst(i+m,j+idir) + & 2.d0 * (fdst(i+m+1,j) - fdst(i+m,j))) res(i,j) = res(i,j) - fac1 * (tmp + & sigmaf(i-m-1,js,2) * & (fdst(i-m-1,j+idir) - fdst(i-m-1,j) + & 2.d0 * (fdst(i-m,j+idir) - fdst(i-m,j))) + & sigmaf(i-m,js,2) * & (fdst(i-m+1,j+idir) - fdst(i-m+1,j) + & 2.d0 * (fdst(i-m,j+idir) - fdst(i-m,j))) + & sigmaf(i+m-1,js,2) * & (fdst(i+m-1,j+idir) - fdst(i+m-1,j) + & 2.d0 * (fdst(i+m,j+idir) - fdst(i+m,j))) + & sigmaf(i+m,js,2) * & (fdst(i+m+1,j+idir) - fdst(i+m+1,j) + & 2.d0 * (fdst(i+m,j+idir) - fdst(i+m,j))) - & 3.d0 * (sigmaf(i-m-(j-js),js,3) * & (fdst(i-m+idir,j+idir) - fdst(i-m,j+idir)) - & sigmaf(i-m-(1-(j-js)),js,3) * & (fdst(i-m-idir,j+idir) - fdst(i-m,j+idir)) + & sigmaf(i+m-(j-js),js,3) * & (fdst(i+m+idir,j+idir) - fdst(i+m,j+idir)) - & sigmaf(i+m-(1-(j-js)),js,3) * & (fdst(i+m-idir,j+idir) - fdst(i+m,j+idir)))) end do end do end if end c----------------------------------------------------------------------- subroutine hgcres_terrain( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & fdst, fdstl0, fdsth0, fdstl1, fdsth1, & cdst, cdstl0, cdsth0, cdstl1, cdsth1, & sigmaf, sfl0, sfh0, sfl1, sfh1, & sigmac, scl0, sch0, scl1, sch1, & regl0, regh0, regl1, regh1, & hx, hy, ir, jr, ga, idd) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer fdstl0, fdsth0, fdstl1, fdsth1 integer cdstl0, cdsth0, cdstl1, cdsth1 integer sfl0, sfh0, sfl1, sfh1 integer scl0, sch0, scl1, sch1 integer regl0, regh0, regl1, regh1 double precision hx, hy double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision fdst(fdstl0:fdsth0,fdstl1:fdsth1) double precision cdst(cdstl0:cdsth0,cdstl1:cdsth1) double precision sigmaf(sfl0:sfh0,sfl1:sfh1, 3) double precision sigmac(scl0:sch0,scl1:sch1, 3) integer ir, jr, ga(0:1,0:1), idd double precision sum, fac, fac1 integer ic, jc, if, jf, ii, ji, idir, jdir, m, n ic = regl0 jc = regl1 if = ic * ir jf = jc * jr sum = 0.d0 c quadrants do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) .eq. 1) then sum = sum + sigmaf(if+ii-1,jf+ji-1,1) * & (fdst(if+idir,jf+jdir) - fdst(if,jf+jdir) + & 2.d0 * (fdst(if+idir,jf) - fdst(if,jf))) + & sigmaf(if+ii-1,jf+ji-1,2) * & (fdst(if+idir,jf+jdir) - fdst(if+idir,jf) + & 2.d0 * (fdst(if,jf+jdir) - fdst(if,jf))) - & sigmaf(if+ii-1,jf+ji-1,3) * idir * jdir * & 3.d0 * (fdst(if+idir,jf+jdir) - fdst(if,jf)) else sum = sum + sigmac(ic+ii-1,jc+ji-1,1) * & (cdst(ic+idir,jc+jdir) - cdst(ic,jc+jdir) + & 2.d0 * (cdst(ic+idir,jc) - cdst(ic,jc))) + & sigmac(ic+ii-1,jc+ji-1,2) * & (cdst(ic+idir,jc+jdir) - cdst(ic+idir,jc) + & 2.d0 * (cdst(ic,jc+jdir) - cdst(ic,jc))) - & sigmac(ic+ii-1,jc+ji-1,3) * idir * jdir * & 3.d0 * (cdst(ic+idir,jc+jdir) - cdst(ic,jc)) end if end do end do c edges do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji) - ga(ii,1-ji) .eq. 1) then fac1 = 1.d0 / ir do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * (sigmaf(if+m-1,jf+ji-1,1) * & (fdst(if+m-1,jf+jdir) - fdst(if+m,jf+jdir) + & 2.d0 * (fdst(if+m-1,jf) - fdst(if+m,jf))) + & sigmaf(if+m-1,jf+ji-1,2) * & (fdst(if+m-1,jf+jdir) - fdst(if+m-1,jf) + & 2.d0 * (fdst(if+m,jf+jdir) - fdst(if+m,jf))) + & sigmaf(if+m-1,jf+ji-1,3) * jdir * & 3.d0 * (fdst(if+m-1,jf+jdir) - fdst(if+m,jf)) + & sigmaf(if+m,jf+ji-1,1) * & (fdst(if+m+1,jf+jdir) - fdst(if+m,jf+jdir) + & 2.d0 * (fdst(if+m+1,jf) - fdst(if+m,jf))) + & sigmaf(if+m,jf+ji-1,2) * & (fdst(if+m+1,jf+jdir) - fdst(if+m+1,jf) + & 2.d0 * (fdst(if+m,jf+jdir) - fdst(if+m,jf))) - & sigmaf(if+m,jf+ji-1,3) * jdir * & 3.d0 * (fdst(if+m+1,jf+jdir) - fdst(if+m,jf))) end do end if if (ga(ii,ji) - ga(1-ii,ji) .eq. 1) then fac1 = 1.d0 / jr do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * (sigmaf(if+ii-1,jf+n-1,1) * & (fdst(if+idir,jf+n-1) - fdst(if,jf+n-1) + & 2.d0 * (fdst(if+idir,jf+n) - fdst(if,jf+n))) + & sigmaf(if+ii-1,jf+n-1,2) * & (fdst(if+idir,jf+n-1) - fdst(if+idir,jf+n) + & 2.d0 * (fdst(if,jf+n-1) - fdst(if,jf+n))) + & sigmaf(if+ii-1,jf+n-1,3) * idir * & 3.d0 * (fdst(if+idir,jf+n-1) - fdst(if,jf+n)) + & sigmaf(if+ii-1,jf+n,1) * & (fdst(if+idir,jf+n+1) - fdst(if,jf+n+1) + & 2.d0 * (fdst(if+idir,jf+n) - fdst(if,jf+n))) + & sigmaf(if+ii-1,jf+n,2) * & (fdst(if+idir,jf+n+1) - fdst(if+idir,jf+n) + & 2.d0 * (fdst(if,jf+n+1) - fdst(if,jf+n))) - & sigmaf(if+ii-1,jf+n,3) * idir * & 3.d0 * (fdst(if+idir,jf+n+1) - fdst(if,jf+n))) end do end if end do end do c weighting res(if,jf) = src(if,jf) - sum / 6.d0 end c nine-point terrain stencils c----------------------------------------------------------------------- subroutine hgcen_terrain(cen, cenl0, cenh0, cenl1, cenh1, & sig, sbl0, sbh0, sbl1, sbh1, & regl0, regh0, regl1, regh1) integer cenl0, cenh0, cenl1, cenh1 integer sbl0, sbh0, sbl1, sbh1 integer regl0, regh0, regl1, regh1 double precision cen(cenl0:cenh0,cenl1:cenh1) double precision sig(sbl0:sbh0,sbl1:sbh1, 3) double precision tmp integer i, j do j = regl1, regh1 do i = regl0, regh0 tmp = (2.d0 * (sig(i-1,j-1,1) + sig(i-1,j,1) + & sig(i,j-1,1) + sig(i,j,1) + & sig(i-1,j-1,2) + sig(i-1,j,2) + & sig(i,j-1,2) + sig(i,j,2)) + & 3.d0 * (sig(i-1,j,3) - sig(i-1,j-1,3) + & sig(i,j-1,3) - sig(i,j,3))) if ( tmp .eq. 0.0 ) then cen(i,j) = 0.0D0 else cen(i,j) = 6.0D0 / tmp end if end do end do c$$$ write(unit = 10, fmt = *) 'cen - hgcen_full' c$$$ write(unit = 10, fmt = *) cen c$$$ write(unit = 10, fmt = *) 'sig' c$$$ write(unit = 10, fmt = *) sig end c----------------------------------------------------------------------- subroutine hgrlx_terrain( & cor, corl0, corh0, corl1, corh1, & res, resl0, resh0, resl1, resh1, & sig, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1) integer corl0, corh0, corl1, corh1 integer resl0, resh0, resl1, resh1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 double precision cor(corl0:corh0,corl1:corh1) double precision res(resl0:resh0,resl1:resh1) double precision sig(sfl0:sfh0,sfl1:sfh1, 3) double precision cen(cenl0:cenh0,cenl1:cenh1) double precision fac double precision AVG integer i, j AVG()= fac * ( & sig(i-1,j-1,1) * & (cor(i-1,j-1) - cor(i,j-1) + 2.d0 * cor(i-1,j)) + & sig(i-1,j,1) * & (cor(i-1,j+1) - cor(i,j+1) + 2.d0 * cor(i-1,j)) + & sig(i,j-1,1) * & (cor(i+1,j-1) - cor(i,j-1) + 2.d0 * cor(i+1,j)) + & sig(i,j,1) * & (cor(i+1,j+1) - cor(i,j+1) + 2.d0 * cor(i+1,j)) + & sig(i-1,j-1,2) * & (cor(i-1,j-1) - cor(i-1,j) + 2.d0 * cor(i,j-1)) + & sig(i-1,j,2) * & (cor(i-1,j+1) - cor(i-1,j) + 2.d0 * cor(i,j+1)) + & sig(i,j-1,2) * & (cor(i+1,j-1) - cor(i+1,j) + 2.d0 * cor(i,j-1)) + & sig(i,j,2) * & (cor(i+1,j+1) - cor(i+1,j) + 2.d0 * cor(i,j+1)) - & 3.d0 * (sig(i-1,j-1,3) * cor(i-1,j-1) - & sig(i-1,j,3) * cor(i-1,j+1) - & sig(i,j-1,3) * cor(i+1,j-1) + & sig(i,j,3) * cor(i+1,j+1))) fac = 1.d0 / 6.d0 do j = regl1, regh1 cdir$ ivdep do i = regl0, regh0 cor(i,j) = (AVG() - res(i,j)) * cen(i,j) end do end do c$$$ write(unit = 10, fmt = *) 'cor' c$$$ write(unit = 10, fmt = *) cor c$$$ write(unit = 10, fmt = *) 'sig' c$$$ write(unit = 10, fmt = *) sig c$$$ write(unit = 10, fmt = *) 'res' c$$$ write(unit = 10, fmt = *) res c$$$ write(unit = 10, fmt = *) 'cen' c$$$ write(unit = 10, fmt = *) cen c$$$ stop end c----------------------------------------------------------------------- subroutine hgres_terrain( & res, resl0, resh0, resl1, resh1, & src, srcl0, srch0, srcl1, srch1, & dest, destl0, desth0, destl1, desth1, & sig, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1) integer resl0, resh0, resl1, resh1 integer srcl0, srch0, srcl1, srch1 integer destl0, desth0, destl1, desth1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 double precision res(resl0:resh0,resl1:resh1) double precision src(srcl0:srch0,srcl1:srch1) double precision dest(destl0:desth0,destl1:desth1) double precision sig(sfl0:sfh0,sfl1:sfh1, 3) double precision cen(cenl0:cenh0,cenl1:cenh1) double precision fac, tmp integer i, j fac = 1.d0 / 6.d0 do j = regl1, regh1 do i = regl0, regh0 tmp = & (sig(i-1,j-1,1) * & (dest(i-1,j-1) - dest(i,j-1) + & 2.d0 * (dest(i-1,j) - dest(i,j))) + & sig(i-1,j,1) * & (dest(i-1,j+1) - dest(i,j+1) + & 2.d0 * (dest(i-1,j) - dest(i,j))) + & sig(i,j-1,1) * & (dest(i+1,j-1) - dest(i,j-1) + & 2.d0 * (dest(i+1,j) - dest(i,j))) + & sig(i,j,1) * & (dest(i+1,j+1) - dest(i,j+1) + & 2.d0 * (dest(i+1,j) - dest(i,j)))) tmp = src(i,j) - fac * (tmp + & (sig(i-1,j-1,2) * & (dest(i-1,j-1) - dest(i-1,j) + & 2.d0 * (dest(i,j-1) - dest(i,j))) + & sig(i-1,j,2) * & (dest(i-1,j+1) - dest(i-1,j) + & 2.d0 * (dest(i,j+1) - dest(i,j))) + & sig(i,j-1,2) * & (dest(i+1,j-1) - dest(i+1,j) + & 2.d0 * (dest(i,j-1) - dest(i,j))) + & sig(i,j,2) * & (dest(i+1,j+1) - dest(i+1,j) + & 2.d0 * (dest(i,j+1) - dest(i,j))))) res(i,j) = tmp + 0.5d0 * & (sig(i-1,j-1,3) * & (dest(i-1,j-1) - dest(i,j)) - & sig(i-1,j,3) * & (dest(i-1,j+1) - dest(i,j)) - & sig(i,j-1,3) * & (dest(i+1,j-1) - dest(i,j)) + & sig(i,j,3) * & (dest(i+1,j+1) - dest(i,j))) end do end do end c----------------------------------------------------------------------- subroutine hgrlnf_terrain( & cor, corl0, corh0, corl1, corh1, & res, resl0, resh0, resl1, resh1, & wrk, wrkl0, wrkh0, wrkl1, wrkh1, & sig, sfl0, sfh0, sfl1, sfh1, & cen, cenl0, cenh0, cenl1, cenh1, & regl0, regh0, regl1, regh1, & doml0, domh0, doml1, domh1, & lsd, ipass) integer corl0, corh0, corl1, corh1 integer resl0, resh0, resl1, resh1 integer wrkl0, wrkh0, wrkl1, wrkh1 integer sfl0, sfh0, sfl1, sfh1 integer cenl0, cenh0, cenl1, cenh1 integer regl0, regh0, regl1, regh1 integer doml0, domh0, doml1, domh1 double precision cor(corl0:corh0,corl1:corh1) double precision res(resl0:resh0,resl1:resh1) double precision wrk(wrkl0:wrkh0,wrkl1:wrkh1) double precision sig(sfl0:sfh0,sfl1:sfh1, 3) double precision cen(cenl0:cenh0,cenl1:cenh1) integer lsd, ipass double precision fac, betm, aj double precision RHSL0,RHSL1 integer i, j, ioff RHSL0() = (res(i,j) - fac * ( & sig(i-1,j-1,1) * & (cor(i-1,j-1) - cor(i,j-1)) + & sig(i-1,j,1) * & (cor(i-1,j+1) - cor(i,j+1)) + & sig(i,j-1,1) * & (cor(i+1,j-1) - cor(i,j-1)) + & sig(i,j,1) * & (cor(i+1,j+1) - cor(i,j+1)) + & sig(i-1,j-1,2) * & (cor(i-1,j-1) + 2.d0 * cor(i,j-1)) + & sig(i-1,j,2) * & (cor(i-1,j+1) + 2.d0 * cor(i,j+1)) + & sig(i,j-1,2) * & (cor(i+1,j-1) + 2.d0 * cor(i,j-1)) + & sig(i,j,2) * & (cor(i+1,j+1) + 2.d0 * cor(i,j+1)) - & 3.d0 * (sig(i-1,j-1,3) * cor(i-1,j-1) - & sig(i-1,j,3) * cor(i-1,j+1) - & sig(i,j-1,3) * cor(i+1,j-1) + & sig(i,j,3) * cor(i+1,j+1)))) RHSL1() = (res(i,j) - fac * ( & sig(i-1,j-1,1) * & (cor(i-1,j-1) + 2.d0 * cor(i-1,j)) + & sig(i-1,j,1) * & (cor(i-1,j+1) + 2.d0 * cor(i-1,j)) + & sig(i,j-1,1) * & (cor(i+1,j-1) + 2.d0 * cor(i+1,j)) + & sig(i,j,1) * & (cor(i+1,j+1) + 2.d0 * cor(i+1,j)) + & sig(i-1,j-1,2) * & (cor(i-1,j-1) - cor(i-1,j)) + & sig(i-1,j,2) * & (cor(i-1,j+1) - cor(i-1,j)) + & sig(i,j-1,2) * & (cor(i+1,j-1) - cor(i+1,j)) + & sig(i,j,2) * & (cor(i+1,j+1) - cor(i+1,j)) - & 3.d0 * (sig(i-1,j-1,3) * cor(i-1,j-1) - & sig(i-1,j,3) * cor(i-1,j+1) - & sig(i,j-1,3) * cor(i+1,j-1) + & sig(i,j,3) * cor(i+1,j+1)))) fac = 1.d0 / 6.d0 if (lsd .eq. 0) then if (mod(regl1,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if i = regl0 do j = regl1 + ioff, regh1, 2 aj = fac * & (2.d0 * (sig(i,j-1,1) + sig(i,j,1)) - & (sig(i,j-1,2) + sig(i,j,2))) if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: wrk(i,j) = 0.d0 else if (regl0 .eq. doml0) then c neumann bdy: betm = -cen(i,j) cor(i,j) = RHSL0() * betm wrk(i,j) = 2.d0 * aj * betm end if wrk(i+1,j) = aj end do c forward solve loop: do i = regl0 + 1, regh0 - 1 do j = regl1 + ioff, regh1, 2 aj = wrk(i,j) if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) end if cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm aj = fac * & (2.d0 * (sig(i,j-1,1) + sig(i,j,1)) - & (sig(i,j-1,2) + sig(i,j,2))) wrk(i+1,j) = aj wrk(i,j) = aj * betm end do end do i = regh0 do j = regl1 + ioff, regh1, 2 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: else if (regh0 .eq. domh0) then c neumann bdy: aj = 2.d0 * wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm else if (i .gt. regl0) then c interface to grid at same level: aj = wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i-1,j)) cor(i,j) = (RHSL0() - aj * cor(i-1,j)) * betm aj = fac * & (2.d0 * (sig(i,j-1,1) + sig(i,j,1)) - & (sig(i,j-1,2) + sig(i,j,2))) wrk(i,j) = aj * betm end if end do else if (mod(regl0,2) .eq. 0) then ioff = ipass else ioff = 1 - ipass end if j = regl1 do i = regl0 + ioff, regh0, 2 aj = fac * & (2.d0 * (sig(i-1,j,2) + sig(i,j,2)) - & (sig(i-1,j,1) + sig(i,j,1))) if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: wrk(i,j) = 0.d0 else if (regl1 .eq. doml1) then c neumann bdy: betm = -cen(i,j) cor(i,j) = RHSL1() * betm wrk(i,j) = 2.d0 * aj * betm end if wrk(i,j+1) = aj end do c forward solve loop: do j = regl1 + 1, regh1 - 1 do i = regl0 + ioff, regh0, 2 aj = wrk(i,j) if (cen(i,j) .eq. 0.d0) then betm = 0.d0 else betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) end if cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = fac * & (2.d0 * (sig(i-1,j,2) + sig(i,j,2)) - & (sig(i-1,j,1) + sig(i,j,1))) wrk(i,j+1) = aj wrk(i,j) = aj * betm end do end do j = regh1 do i = regl0 + ioff, regh0, 2 if (cen(i,j) .eq. 0.d0) then c dirichlet bdy: else if (regh1 .eq. domh1) then c neumann bdy: aj = 2.d0 * wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm else if (j .gt. regl1) then c interface to grid at same level: aj = wrk(i,j) betm = 1.d0 / (-1.d0 / cen(i,j) - aj * wrk(i,j-1)) cor(i,j) = (RHSL1() - aj * cor(i,j-1)) * betm aj = fac * & (2.d0 * (sig(i-1,j,2) + sig(i,j,2)) - & (sig(i-1,j,1) + sig(i,j,1))) wrk(i,j) = aj * betm end if end do end if end ccseapps-2.5/CCSEApps/hgproj/OpenSource.txt0000644000175000017500000002434711634153073022005 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: HGProj Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/hgproj/hg_avg3d.f0000644000175000017500000006103611634153073021007 0ustar amckinstryamckinstryc----------------------------------------------------------------------- subroutine hgavg( & src, srcl0, srch0, srcl1, srch1, srcl2, srch2, & rf, fl0, fh0, fl1, fh1, fl2, fh2, & fregl0, fregh0, fregl1, fregh1, fregl2, fregh2) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer fregl0,fregh0,fregl1,fregh1,fregl2,fregh2 double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision rf(fl0:fh0,fl1:fh1,fl2:fh2) double precision fac parameter (fac = 0.1250D0) integer i, j, k do k = fregl2, fregh2 do j = fregl1, fregh1 do i = fregl0, fregh0 src(i,j,k) = src(i,j,k) + fac * & (rf(i-1,j-1,k-1) + rf(i-1,j-1,k) + & rf(i-1,j,k-1) + rf(i-1,j,k) + & rf(i,j-1,k-1) + rf(i,j-1,k) + & rf(i,j,k-1) + rf(i,j,k)) end do end do end do end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgfavg( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & rc, cl0,ch0,cl1,ch1,cl2,ch2, & rf, fl0,fh0,fl1,fh1,fl2,fh2, & cregl0,cregh0,cregl1,cregh1,cregl2,cregh2, & ir, jr, kr, idim, idir) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer cl0,ch0,cl1,ch1,cl2,ch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer cregl0,cregh0,cregl1,cregh1,cregl2,cregh2 double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision rc(cl0:ch0,cl1:ch1,cl2:ch2) double precision rf(fl0:fh0,fl1:fh1,fl2:fh2) integer ir, jr, kr, idim, idir double precision fac0, fac1, fac integer i, j, k, irc, irf, jrc, jrf, krc, krf, l, m, n if (idim .eq. 0) then i = cregl0 if (idir .eq. 1) then irc = i - 1 irf = i * ir else irc = i irf = i * ir - 1 end if fac0 = 0.25D0 * ir / (ir+1) do k = cregl2, cregh2 do j = cregl1, cregh1 src(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) + fac0 * & (rc(irc,j,k) + rc(irc,j,k-1) + & rc(irc,j-1,k) + rc(irc,j-1,k-1)) end do end do fac0 = fac0 / (ir * jr * kr * jr * kr) i = i * ir do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do k = kr*cregl2, kr*cregh2, kr do j = jr*cregl1, jr*cregh1, jr src(i,j,k) = src(i,j,k) + fac * & (rf(irf,j-n,k-l) + rf(irf,j-n,k-l-1) + & rf(irf,j-n-1,k-l) + rf(irf,j-n-1,k-l-1) + & rf(irf,j-n,k+l) + rf(irf,j-n,k+l-1) + & rf(irf,j-n-1,k+l) + rf(irf,j-n-1,k+l-1) + & rf(irf,j+n,k-l) + rf(irf,j+n,k-l-1) + & rf(irf,j+n-1,k-l) + rf(irf,j+n-1,k-l-1) + & rf(irf,j+n,k+l) + rf(irf,j+n,k+l-1) + & rf(irf,j+n-1,k+l) + rf(irf,j+n-1,k+l-1)) end do end do end do end do else if (idim .eq. 1) then j = cregl1 if (idir .eq. 1) then jrc = j - 1 jrf = j * jr else jrc = j jrf = j * jr - 1 end if fac0 = 0.25D0 * jr / (jr+1) do k = cregl2, cregh2 do i = cregl0, cregh0 src(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) + fac0 * & (rc(i,jrc,k) + rc(i-1,jrc,k) + & rc(i,jrc,k-1) + rc(i-1,jrc,k-1)) end do end do fac0 = fac0 / (ir * jr * kr * ir * kr) j = j * jr do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do k = kr*cregl2, kr*cregh2, kr do i = ir*cregl0, ir*cregh0, ir src(i,j,k) = src(i,j,k) + fac * & (rf(i-m,jrf,k-l) + rf(i-m-1,jrf,k-l) + & rf(i-m,jrf,k-l-1) + rf(i-m-1,jrf,k-l-1) + & rf(i-m,jrf,k+l) + rf(i-m-1,jrf,k+l) + & rf(i-m,jrf,k+l-1) + rf(i-m-1,jrf,k+l-1) + & rf(i+m,jrf,k-l) + rf(i+m-1,jrf,k-l) + & rf(i+m,jrf,k-l-1) + rf(i+m-1,jrf,k-l-1) + & rf(i+m,jrf,k+l) + rf(i+m-1,jrf,k+l) + & rf(i+m,jrf,k+l-1) + rf(i+m-1,jrf,k+l-1)) end do end do end do end do else k = cregl2 if (idir .eq. 1) then krc = k - 1 krf = k * kr else krc = k krf = k * kr - 1 end if fac0 = 0.25D0 * kr / (kr+1) do j = cregl1, cregh1 do i = cregl0, cregh0 src(i*ir,j*jr,k*kr) = & src(i*ir,j*jr,k*kr) + fac0 * & (rc(i,j,krc) + rc(i-1,j,krc) + & rc(i,j-1,krc) + rc(i-1,j-1,krc)) end do end do fac0 = fac0 / (ir * jr * kr * ir * jr) k = k * kr do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do j = jr*cregl1, jr*cregh1, jr do i = ir*cregl0, ir*cregh0, ir src(i,j,k) = src(i,j,k) + fac * & (rf(i-m,j-n,krf) + rf(i-m-1,j-n,krf) + & rf(i-m,j-n-1,krf) + rf(i-m-1,j-n-1,krf) + & rf(i-m,j+n,krf) + rf(i-m-1,j+n,krf) + & rf(i-m,j+n-1,krf) + rf(i-m-1,j+n-1,krf) + & rf(i+m,j-n,krf) + rf(i+m-1,j-n,krf) + & rf(i+m,j-n-1,krf) + rf(i+m-1,j-n-1,krf) + & rf(i+m,j+n,krf) + rf(i+m-1,j+n,krf) + & rf(i+m,j+n-1,krf) + rf(i+m-1,j+n-1,krf)) end do end do end do end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgeavg( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & rc, cl0,ch0,cl1,ch1,cl2,ch2, & rf, fl0,fh0,fl1,fh1,fl2,fh2, & cregl0,cregh0,cregl1,cregh1,cregl2,cregh2, & ir, jr, kr, ga, ivect) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer cl0,ch0,cl1,ch1,cl2,ch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer cregl0,cregh0,cregl1,cregh1,cregl2,cregh2 double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision rc(cl0:ch0,cl1:ch1,cl2:ch2) double precision rf(fl0:fh0,fl1:fh1,fl2:fh2) integer ir, jr, kr, ivect(0:2), ga(0:1,0:1,0:1) double precision rm3, center, cfac, ffac, fac0, fac1, fac integer ic, jc, kc, if, jf, kf, ii, ji, ki integer irc, irf, jrc, jrf, krc, krf, idir, jdir, kdir, l, m, n rm3 = 1.0D0 / (ir * jr * kr) ic = cregl0 jc = cregl1 kc = cregl2 if = ic * ir jf = jc * jr kf = kc * kr center = 0.0D0 if (ivect(0) .eq. 0) then c quadrants c each quadrant is two octants and their share of the two central edges ffac = 2.0D0 * ir * rm3 cfac = 2.0D0 do ki = 0, 1 do ji = 0, 1 if (ga(0,ji,ki) .eq. 1) then center = center + ffac else center = center + cfac end if end do end do do ki = 0, 1 do ji = 0, 1 if (ga(0,ji,ki) - ga(0,ji,1-ki) .eq. 1) then ffac = 2.0D0 * ir * (jr - 1) * rm3 center = center + ffac end if if (ga(0,ji,ki) - ga(0,1-ji,ki) .eq. 1) then ffac = 2.0D0 * ir * (kr - 1) * rm3 center = center + ffac end if end do end do center = 1.0D0 / center fac1 = center * rm3 / ir do ki = 0, 1 do ji = 0, 1 if (ga(0,ji,ki) .eq. 1) then krf = kf + ki - 1 jrf = jf + ji - 1 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = src(if,jf,kf) + fac * & (rf(if-m,jrf,krf) + rf(if-m-1,jrf,krf) + & rf(if+m,jrf,krf) + rf(if+m-1,jrf,krf)) end do end do else krc = kc + ki - 1 jrc = jc + ji - 1 do ic = cregl0, cregh0 if = ic * ir src(if,jf,kf) = src(if,jf,kf) + center * & (rc(ic,jrc,krc) + rc(ic-1,jrc,krc)) end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 if (ga(0,ji,ki) - ga(0,ji,1-ki) .eq. 1) then krf = kf + ki - 1 fac0 = center * rm3 / (ir * jr) do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = src(if,jf,kf) + fac * & (rf(if-m,jf+n,krf) + rf(if-m-1,jf+n,krf) + & rf(if-m,jf+n-1,krf) + rf(if-m-1,jf+n-1,krf) + & rf(if+m,jf+n,krf) + rf(if+m-1,jf+n,krf) + & rf(if+m,jf+n-1,krf) + rf(if+m-1,jf+n-1,krf)) end do end do end do end if if (ga(0,ji,ki) - ga(0,1-ji,ki) .eq. 1) then jrf = jf + ji - 1 fac0 = center * rm3 / (ir * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do m = 0, ir-1 fac = (ir-m) * fac1 if (m .eq. 0) fac = 0.5D0 * fac do if = ir*cregl0, ir*cregh0, ir src(if,jf,kf) = src(if,jf,kf) + fac * & (rf(if-m,jrf,kf+l) + rf(if-m-1,jrf,kf+l) + & rf(if-m,jrf,kf+l-1) + rf(if-m-1,jrf,kf+l-1) + & rf(if+m,jrf,kf+l) + rf(if+m-1,jrf,kf+l) + & rf(if+m,jrf,kf+l-1) + rf(if+m-1,jrf,kf+l-1)) end do end do end do end if end do end do else if (ivect(1) .eq. 0) then c quadrants c each quadrant is two octants and their share of the two central edges ffac = 2.0D0 * jr * rm3 cfac = 2.0D0 do ki = 0, 1 do ii = 0, 1 if (ga(ii,0,ki) .eq. 1) then center = center + ffac else center = center + cfac end if end do end do do ki = 0, 1 do ii = 0, 1 if (ga(ii,0,ki) - ga(ii,0,1-ki) .eq. 1) then ffac = 2.0D0 * jr * (ir - 1) * rm3 center = center + ffac end if if (ga(ii,0,ki) - ga(1-ii,0,ki) .eq. 1) then ffac = 2.0D0 * jr * (kr - 1) * rm3 center = center + ffac end if end do end do center = 1.0D0 / center fac1 = center * rm3 / jr do ki = 0, 1 do ii = 0, 1 if (ga(ii,0,ki) .eq. 1) then krf = kf + ki - 1 irf = if + ii - 1 do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = src(if,jf,kf) + fac * & (rf(irf,jf-n,krf) + rf(irf,jf-n-1,krf) + & rf(irf,jf+n,krf) + rf(irf,jf+n-1,krf)) end do end do else krc = kc + ki - 1 irc = ic + ii - 1 do jc = cregl1, cregh1 jf = jc * jr src(if,jf,kf) = src(if,jf,kf) + center * & (rc(irc,jc,krc) + rc(irc,jc-1,krc)) end do end if end do end do c faces c each face is two faces and two sides of an edge do ki = 0, 1 kdir = 2 * ki - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,0,ki) - ga(ii,0,1-ki) .eq. 1) then krf = kf + ki - 1 fac0 = center * rm3 / (ir * jr) do n = 0, jr-1 fac1 = (jr-n) * fac0 if (n .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = src(if,jf,kf) + fac * & (rf(if+m,jf-n,krf) + rf(if+m-1,jf-n,krf) + & rf(if+m,jf-n-1,krf) + rf(if+m-1,jf-n-1,krf) + & rf(if+m,jf+n,krf) + rf(if+m-1,jf+n,krf) + & rf(if+m,jf+n-1,krf) + rf(if+m-1,jf+n-1,krf)) end do end do end do end if if (ga(ii,0,ki) - ga(1-ii,0,ki) .eq. 1) then irf = if + ii - 1 fac0 = center * rm3 / (jr * kr) do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do n = 0, jr-1 fac = (jr-n) * fac1 if (n .eq. 0) fac = 0.5D0 * fac do jf = jr*cregl1, jr*cregh1, jr src(if,jf,kf) = src(if,jf,kf) + fac * & (rf(irf,jf-n,kf+l) + rf(irf,jf-n-1,kf+l) + & rf(irf,jf-n,kf+l-1) + rf(irf,jf-n-1,kf+l-1) + & rf(irf,jf+n,kf+l) + rf(irf,jf+n-1,kf+l) + & rf(irf,jf+n,kf+l-1) + rf(irf,jf+n-1,kf+l-1)) end do end do end do end if end do end do else c quadrants c each quadrant is two octants and their share of the two central edges ffac = 2.0D0 * kr * rm3 cfac = 2.0D0 do ji = 0, 1 do ii = 0, 1 if (ga(ii,ji,0) .eq. 1) then center = center + ffac else center = center + cfac end if end do end do do ji = 0, 1 do ii = 0, 1 if (ga(ii,ji,0) - ga(ii,1-ji,0) .eq. 1) then ffac = 2.0D0 * kr * (ir - 1) * rm3 center = center + ffac end if if (ga(ii,ji,0) - ga(1-ii,ji,0) .eq. 1) then ffac = 2.0D0 * kr * (jr - 1) * rm3 center = center + ffac end if end do end do center = 1.0D0 / center fac1 = center * rm3 / kr do ji = 0, 1 do ii = 0, 1 if (ga(ii,ji,0) .eq. 1) then jrf = jf + ji - 1 irf = if + ii - 1 do l = 0, kr-1 fac = (kr-l) * fac1 if (l .eq. 0) fac = 0.5D0 * fac do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = src(if,jf,kf) + fac * & (rf(irf,jrf,kf-l) + rf(irf,jrf,kf-l-1) + & rf(irf,jrf,kf+l) + rf(irf,jrf,kf+l-1)) end do end do else jrc = jc + ji - 1 irc = ic + ii - 1 do kc = cregl2, cregh2 kf = kc * kr src(if,jf,kf) = src(if,jf,kf) + center * & (rc(irc,jrc,kc) + rc(irc,jrc,kc-1)) end do end if end do end do c faces c each face is two faces and two sides of an edge do ji = 0, 1 jdir = 2 * ji - 1 do ii = 0, 1 idir = 2 * ii - 1 if (ga(ii,ji,0) - ga(ii,1-ji,0) .eq. 1) then jrf = jf + ji - 1 fac0 = center * rm3 / (ir * kr) do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = src(if,jf,kf) + fac * & (rf(if+m,jrf,kf-l) + rf(if+m-1,jrf,kf-l) + & rf(if+m,jrf,kf-l-1) + rf(if+m-1,jrf,kf-l-1) + & rf(if+m,jrf,kf+l) + rf(if+m-1,jrf,kf+l) + & rf(if+m,jrf,kf+l-1) + rf(if+m-1,jrf,kf+l-1)) end do end do end do end if if (ga(ii,ji,0) - ga(1-ii,ji,0) .eq. 1) then irf = if + ii - 1 fac0 = center * rm3 / (jr * kr) do l = 0, kr-1 fac1 = (kr-l) * fac0 if (l .eq. 0) fac1 = 0.5D0 * fac1 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 do kf = kr*cregl2, kr*cregh2, kr src(if,jf,kf) = src(if,jf,kf) + fac * & (rf(irf,jf+n,kf-l) + rf(irf,jf+n-1,kf-l) + & rf(irf,jf+n,kf-l-1) + rf(irf,jf+n-1,kf-l-1) + & rf(irf,jf+n,kf+l) + rf(irf,jf+n-1,kf+l) + & rf(irf,jf+n,kf+l-1) + rf(irf,jf+n-1,kf+l-1)) end do end do end do end if end do end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgcavg( & src, srcl0,srch0,srcl1,srch1,srcl2,srch2, & rc, cl0,ch0,cl1,ch1,cl2,ch2, & rf, fl0,fh0,fl1,fh1,fl2,fh2, & cregl0,cregh0,cregl1,cregh1,cregl2,cregh2, & ir, jr, kr, ga, idd) integer srcl0,srch0,srcl1,srch1,srcl2,srch2 integer cl0,ch0,cl1,ch1,cl2,ch2 integer fl0,fh0,fl1,fh1,fl2,fh2 integer cregl0,cregh0,cregl1,cregh1,cregl2,cregh2 double precision src(srcl0:srch0,srcl1:srch1,srcl2:srch2) double precision rc(cl0:ch0,cl1:ch1,cl2:ch2) double precision rf(fl0:fh0,fl1:fh1,fl2:fh2) integer ir, jr, kr, ga(0:1,0:1,0:1), idd double precision rm3, sum, center, cfac, ffac, fac0, fac1, fac integer ic, jc, kc, if, jf, kf, ii, ji, ki integer irc, irf, jrc, jrf, krc, krf, idir, jdir, kdir, l, m, n rm3 = 1.0D0 / (ir * jr * kr) ic = cregl0 jc = cregl1 kc = cregl2 if = ic * ir jf = jc * jr kf = kc * kr sum = 0.0D0 center = 0.0D0 c octants fac = rm3 ffac = rm3 cfac = 1.0D0 do ki = 0, 1 krf = kf + ki - 1 krc = kc + ki - 1 do ji = 0, 1 jrf = jf + ji - 1 jrc = jc + ji - 1 do ii = 0, 1 if (ga(ii,ji,ki) .eq. 1) then irf = if + ii - 1 center = center + ffac sum = sum + fac * rf(irf,jrf,krf) else irc = ic + ii - 1 center = center + cfac sum = sum + rc(irc,jrc,krc) end if end do end do end do c faces do ki = 0, 1 kdir = 2 * ki - 1 krf = kf + ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 jrf = jf + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 irf = if + ii - 1 if (ga(ii,ji,ki) - ga(ii,ji,1-ki) .eq. 1) then fac0 = rm3 / (ir * jr) ffac = (ir-1) * (jr-1) * rm3 center = center + ffac do n = jdir, jdir*(jr-1), jdir fac1 = (jr-abs(n)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * & (rf(if+m,jf+n,krf) + rf(if+m-1,jf+n,krf) + & rf(if+m,jf+n-1,krf) + rf(if+m-1,jf+n-1,krf)) end do end do end if if (ga(ii,ji,ki) - ga(ii,1-ji,ki) .eq. 1) then fac0 = rm3 / (ir * kr) ffac = (ir-1) * (kr-1) * rm3 center = center + ffac do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * & (rf(if+m,jrf,kf+l) + rf(if+m-1,jrf,kf+l) + & rf(if+m,jrf,kf+l-1) + rf(if+m-1,jrf,kf+l-1)) end do end do end if if (ga(ii,ji,ki) - ga(1-ii,ji,ki) .eq. 1) then fac0 = rm3 / (jr * kr) ffac = (jr-1) * (kr-1) * rm3 center = center + ffac do l = kdir, kdir*(kr-1), kdir fac1 = (kr-abs(l)) * fac0 do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * & (rf(irf,jf+n,kf+l) + rf(irf,jf+n,kf+l-1) + & rf(irf,jf+n-1,kf+l) + rf(irf,jf+n-1,kf+l-1)) end do end do end if end do end do end do c edges do ki = 0, 1 kdir = 2 * ki - 1 krf = kf + ki - 1 do ji = 0, 1 jdir = 2 * ji - 1 jrf = jf + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 irf = if + ii - 1 if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(ii,1-ji,ki), ga(ii,1-ji,1-ki)) & .eq. 1) then fac1 = rm3 / ir ffac = (ir-1) * rm3 center = center + ffac do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * & (rf(if+m,jrf,krf) + rf(if+m-1,jrf,krf)) end do end if if (ga(ii,ji,ki) - & min(ga(ii,ji,1-ki), ga(1-ii,ji,ki), ga(1-ii,ji,1-ki)) & .eq. 1) then fac1 = rm3 / jr ffac = (jr-1) * rm3 center = center + ffac do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * & (rf(irf,jf+n,krf) + rf(irf,jf+n-1,krf)) end do end if if (ga(ii,ji,ki) - & min(ga(ii,1-ji,ki), ga(1-ii,ji,ki), ga(1-ii,1-ji,ki)) & .eq. 1) then fac1 = rm3 / kr ffac = (kr-1) * rm3 center = center + ffac do l = kdir, kdir*(kr-1), kdir fac = (kr-abs(l)) * fac1 sum = sum + fac * & (rf(irf,jrf,kf+l) + rf(irf,jrf,kf+l-1)) end do end if end do end do end do c weighting src(if,jf,kf) = src(if,jf,kf) + sum / center end ccseapps-2.5/CCSEApps/hgproj/hg_avg2d.f0000644000175000017500000003155011634153073021004 0ustar amckinstryamckinstryc----------------------------------------------------------------------- subroutine hgavg( & src, srcl0, srch0, srcl1, srch1, & rf, fl0, fh0, fl1, fh1, & fregl0, fregh0, fregl1, fregh1, & hx, irz, imax, idense) integer srcl0, srch0, srcl1, srch1 integer fl0, fh0, fl1, fh1 integer fregl0, fregh0, fregl1, fregh1 double precision src(srcl0:srch0,srcl1:srch1) double precision rf(fl0:fh0,fl1:fh1) double precision hx integer irz, imax double precision fac, r1, r0m, r1m integer i, j integer idense c Need to modify the weighting of the RHS for the dense stencil if (idense .eq. 1) then fac = 0.25d0 * hx else fac = 0.25d0 endif do j = fregl1, fregh1 do i = fregl0, fregh0 c We want only this modification for the cross stencil if (irz .eq. 1 .and. i .eq. 0) then src(i,j) = src(i,j) + fac * (rf(i,j-1) + rf(i,j)) else src(i,j) = src(i,j) + fac * (rf(i-1,j-1) + rf(i-1,j) + & rf(i,j-1) + rf(i,j)) endif end do end do if ( idense .eq. 1 .and. irz .eq. 1) then c We dont want these extra terms for the cross stencil fac = hx / 24.d0 * hx r1 = (fregl0 - 0.5d0) * hx r1m = 1.d0 / r1 do i = fregl0, fregh0 r0m = r1m r1 = r1 + hx if (i .lt. imax) then r1m = 1.d0 / r1 else r1m = -r0m end if do j = fregl1, fregh1 src(i,j) = src(i,j) + fac * & (r0m * (rf(i-1,j) + rf(i-1,j-1)) - & r1m * (rf(i,j-1) + rf(i,j))) end do end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgfavg( & src, srcl0, srch0, srcl1, srch1, & rc, cl0, ch0, cl1, ch1, & rf, fl0, fh0, fl1, fh1, & cregl0, cregh0, cregl1, cregh1, & ir, jr, idim, idir, & hx, irz, imax, idense) integer srcl0, srch0, srcl1, srch1 integer cl0, ch0, cl1, ch1 integer fl0, fh0, fl1, fh1 integer cregl0, cregh0, cregl1, cregh1 double precision src(srcl0:srch0,srcl1:srch1) double precision rc(cl0:ch0,cl1:ch1) double precision rf(fl0:fh0,fl1:fh1) double precision hx integer ir, jr, idim, idir, irz, imax double precision fac0, fac, r, rfac, rfac0, rfac1 double precision rfac0m, rfac1m, rfac0p, rfac1p integer i, j, irc, jrc, irf, jrf, m, n integer idense c Need to modify the weighting of the RHS for the dense stencil if (idim .eq. 0) then i = cregl0 if (idir .eq. 1) then irc = i - 1 irf = i * ir else irc = i irf = i * ir - 1 end if fac0 = 0.5d0 * ir / (ir+1) if ( idense .eq. 1 ) fac0 = fac0 * hx do j = cregl1, cregh1 src(i*ir,j*jr) = src(i*ir,j*jr) + fac0 * & (rc(irc,j) + rc(irc,j-1)) end do if ( idense .eq. 1 ) then c We dont want these extra terms for the cross stencil if (irz .eq. 1) then r = (irc + 0.5d0) * (hx * ir) rfac = (hx * ir) / (6.d0 * r) do j = cregl1, cregh1 src(i*ir,j*jr) = src(i*ir,j*jr) + fac0 * & (rfac * idir * (rc(irc,j) + rc(irc,j-1))) end do r = (irf + 0.5d0) * hx rfac = hx / (6.d0 * r) end if end if fac0 = fac0 / (ir * jr * jr) if ( idense .eq. 1 ) fac0 = fac0 * hx i = i * ir do n = 0, jr-1 fac = (jr-n) * fac0 if (n .eq. 0) fac = 0.5d0 * fac do j = jr*cregl1, jr*cregh1, jr src(i,j) = src(i,j) + fac * & (rf(irf,j-n) + rf(irf,j-n-1) + & rf(irf,j+n) + rf(irf,j+n-1)) end do if ( idense .eq. 1 ) then c We dont want these extra terms for the cross stencil if (irz .eq. 1) then do j = jr*cregl1, jr*cregh1, jr src(i,j) = src(i,j) - fac * & (rfac * idir * (rf(irf,j-n) + rf(irf,j-n-1) + & rf(irf,j+n) + rf(irf,j+n-1))) end do end if end if end do else if (idim .eq. 1) then j = cregl1 if (idir .eq. 1) then jrc = j - 1 jrf = j * jr else jrc = j jrf = j * jr - 1 end if fac0 = 0.5d0 * jr / (jr+1) if ( idense .eq. 1 ) fac0 = fac0 * hx do i = cregl0, cregh0 src(i*ir,j*jr) = src(i*ir,j*jr) + fac0 * & (rc(i,jrc) + rc(i-1,jrc)) end do if (irz .eq. 1 .and. cregl0 .le. 0 .and. cregh0 .ge. 0) then i = 0 src(i*ir,j*jr) = src(i*ir,j*jr) - fac0 * rc(i-1,jrc) endif if ( idense .eq. 1 ) then c We dont want these extra terms for the cross stencil if (irz .eq. 1 .and. cregh0 .lt. imax) then do i = cregl0, cregh0 r = (i + 0.5d0) * (hx * ir) rfac0 = (hx * ir) / (6.d0 * (r - hx * ir)) rfac1 = (hx * ir) / (6.d0 * r) src(i*ir,j*jr) = src(i*ir,j*jr) + fac0 * & (rfac0 * rc(i-1,jrc) - rfac1 * rc(i,jrc)) end do else if (irz .eq. 1) then c This should only occur with a corner at the outer boundary, which c should be handled by the cavg routine instead: i = cregh0 r = (i - 0.5d0) * (hx * ir) rfac0 = (hx * ir) / (6.d0 * r) rfac1 = -rfac0 src(i*ir,j*jr) = src(i*ir,j*jr) + fac0 * & (rfac0 * rc(i-1,jrc) - rfac1 * rc(i,jrc)) end if end if fac0 = fac0 / (ir * ir * jr) if ( idense .eq. 1 ) fac0 = fac0 * hx j = j * jr do m = 0, ir-1 fac = (ir-m) * fac0 if (m .eq. 0) fac = 0.5d0 * fac do i = ir*cregl0, ir*cregh0, ir src(i,j) = src(i,j) + fac * & (rf(i-m,jrf) + rf(i-m-1,jrf) + & rf(i+m,jrf) + rf(i+m-1,jrf)) end do if (irz .eq. 1 .and. m .eq. 0 .and. & cregl0 .le. 0 .and. cregh0 .ge. 0) then i = 0 src(i*ir,j*jr) = src(i*ir,j*jr) - fac * & (rf(i-m-1,jrf) + rf(i+m-1,jrf)) endif if ( idense .eq. 1 ) then c We dont want these extra terms for the cross stencil if (irz .eq. 1 .and. cregh0 .lt. imax) then do i = ir*cregl0, ir*cregh0, ir r = (i + 0.5d0) * hx rfac0m = hx / (6.d0 * (r - (m + 1) * hx)) rfac1m = hx / (6.d0 * (r - m * hx)) rfac0p = hx / (6.d0 * (r + (m - 1) * hx)) rfac1p = hx / (6.d0 * (r + m * hx)) src(i,j) = src(i,j) + fac * & (rfac0m * rf(i-m-1,jrf) - rfac1m * rf(i-m,jrf) + & rfac0p * rf(i+m-1,jrf) - rfac1p * rf(i+m,jrf)) end do else if (irz .eq. 1) then c This should only occur with a corner at the outer boundary, which c should be handled by the cavg routine instead: i = ir*cregh0 r = (i + 0.5d0) * hx rfac0m = hx / (6.d0 * (r - (m + 1) * hx)) if (m .eq. 0) then rfac1m = -rfac0m else rfac1m = hx / (6.d0 * (r - m * hx)) end if rfac0p = -rfac1m rfac1p = -rfac0m src(i,j) = src(i,j) + fac * & (rfac0m * rf(i-m-1,jrf) - rfac1m * rf(i-m,jrf) + & rfac0p * rf(i+m-1,jrf) - rfac1p * rf(i+m,jrf)) end if end if end do end if end c----------------------------------------------------------------------- c Note---only generates values at coarse points along edge of fine grid subroutine hgcavg( & src, srcl0, srch0, srcl1, srch1, & rc, cl0, ch0, cl1, ch1, & rf, fl0, fh0, fl1, fh1, & cregl0, cregh0, cregl1, cregh1, & ir, jr, ga, idd, & hx, irz, imax, idense) integer srcl0, srch0, srcl1, srch1 integer cl0, ch0, cl1, ch1 integer fl0, fh0, fl1, fh1 integer cregl0, cregh0, cregl1, cregh1 double precision src(srcl0:srch0,srcl1:srch1) double precision rc(cl0:ch0,cl1:ch1) double precision rf(fl0:fh0,fl1:fh1) double precision hx integer ir, jr, ga(0:1,0:1), irz, imax, idd double precision rm2, sum, center, fac, ffac, cfac, fac1 double precision r, rfac, rfac0, rfac1 integer ic, jc, if, jf, ii, ji, irc, jrc, irf, jrf integer m, n, idir, jdir integer idense rm2 = 1.d0 / (ir * jr) ic = cregl0 jc = cregl1 if = ic * ir jf = jc * jr sum = 0.d0 center = 0.d0 c quadrants fac = rm2 ffac = rm2 cfac = 1.d0 do ji = 0, 1 jrf = jf + ji - 1 jrc = jc + ji - 1 do ii = 0, 1 if (ga(ii,ji) .eq. 1) then irf = if + ii - 1 center = center + ffac sum = sum + fac * rf(irf,jrf) if ( idense .eq. 0 ) then c We dont want these extra terms for the cross stencil if (irz .eq. 1) then idir = 2 * ii - 1 r = (irf + 0.5d0) * hx if (irf .lt. (ir * imax)) then rfac = hx / (6.d0 * r) else rfac = -hx / (6.d0 * (r - hx)) end if sum = sum - fac * rfac * idir * rf(irf,jrf) end if end if else irc = ic + ii - 1 center = center + cfac sum = sum + rc(irc,jrc) if ( idense .eq. 1 ) then c We dont want these extra terms for the cross stencil if (irz .eq. 1) then idir = 2 * ii - 1 r = (irc + 0.5d0) * (hx * ir) if (irc .lt. imax) then rfac = (hx * ir) / (6.d0 * r) else rfac = -(hx * ir) / (6.d0 * (r - (hx * ir))) end if sum = sum - rfac * idir * rc(irc,jrc) end if end if end if end do end do c We *only* want this modification for the 5-point stencil: c here we halve the average at the r=0 axis. if (irz .eq. 1 .and. ic .eq. 0) then sum = sum * 0.5d0 endif c edges do ji = 0, 1 jdir = 2 * ji - 1 jrf = jf + ji - 1 do ii = 0, 1 idir = 2 * ii - 1 irf = if + ii - 1 if (ga(ii,ji) - ga(ii,1-ji) .eq. 1) then fac1 = rm2 / ir ffac = (ir-1) * rm2 center = center + ffac do m = idir, idir*(ir-1), idir fac = (ir-abs(m)) * fac1 sum = sum + fac * (rf(if+m,jrf) + rf(if+m-1,jrf)) if ( idense .eq. 1 ) then c We dont want these extra terms for the cross stencil if (irz .eq. 1) then r = (if + 0.5d0) * hx if (irf .lt. (ir * imax)) then rfac0 = hx / (6.d0 * (r + (m - 1) * hx)) rfac1 = hx / (6.d0 * (r + m * hx)) else rfac0 = -hx / (6.d0 * (r - m * hx)) rfac1 = -hx / (6.d0 * (r - (m + 1) * hx)) end if sum = sum + fac * & (rfac0 * rf(if+m-1,jrf) - rfac1 * rf(if+m,jrf)) end if end if end do end if if (ga(ii,ji) - ga(1-ii,ji) .eq. 1) then fac1 = rm2 / jr ffac = (jr-1) * rm2 center = center + ffac do n = jdir, jdir*(jr-1), jdir fac = (jr-abs(n)) * fac1 sum = sum + fac * (rf(irf,jf+n) + rf(irf,jf+n-1)) if ( idense .eq. 1 ) then c We dont want these extra terms for the cross stencil if (irz .eq. 1) then r = (irf + 0.5d0) * hx rfac = hx / (6.d0 * r) sum = sum - fac * & (rfac * idir * (rf(irf,jf+n) + rf(irf,jf+n-1))) end if end if end do end if end do end do c weighting c Need to modify the weighting of the RHS for the dense stencil if ( idense .eq. 1 ) sum = sum * hx src(if,jf) = src(if,jf) + sum / center end ccseapps-2.5/CCSEApps/tensorMG/0000755000175000017500000000000011634153073017415 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/tensorMG/Make.package0000644000175000017500000000115711634153073021613 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.3 1999/04/05 16:49:25 car Exp $ # MCMG_BASE=EXE ifeq ($(LBASE),mcmg) MCMG_BASE=LIB endif C$(MCMG_BASE)_headers += DivVis.H MCCGSolver.H MCInterpBndryData.H MCLinOp.H C$(MCMG_BASE)_headers += MCMultiGrid.H C$(MCMG_BASE)_sources += DivVis.cpp MCCGSolver.cpp MCInterpBndryData.cpp MCLinOp.cpp C$(MCMG_BASE)_sources += MCMultiGrid.cpp F$(MCMG_BASE)_headers += DivVis_F.H MCINTERPBNDRYDATA_F.H MCLO_F.H F$(MCMG_BASE)_sources += MCLO_$(DIM)D.F MCINTERPBNDRYDATA_$(DIM)D.F ifeq ($(DIM),2) F$(MCMG_BASE)_sources += DV_2D.F else F$(MCMG_BASE)_sources += DV_3D1.F DV_3D2.F DV_3D3.F DV_3D4.F endif ccseapps-2.5/CCSEApps/tensorMG/DV_3D4.F0000644000175000017500000026544411634153073020466 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #define USE_TMP 1 #include #include "DivVis_F.H" #include #include "ArrayLim.H" c :::: usage: c :::: this .mF file is meant to be run through Mathematica. This converts c :::: compact symbolic expressions into fortran which is stored in a .F c :::: file. c---------------------------------------------------------------- c this is the fortran support file for the the operator c L(U) = alpha*a(x)*U - beta*Div( tau ) c c where U is the two component vector (u,v) and c tau is a three by three tensor c tau = | t_xx t_xy t_xz| c | t_xy t_yy t_yz| c | t_xz t_yz t_zz| c c t_xx = 2*mu * u_x c t_yy = 2*mu * v_y c t_zz = 2*mu * w_z c t_xy = mu*(u_y + v_x) c t_xz = mu*(u_z + w_x) c t_yz = mu*(v_z + w_y) c ::: define standard replacements used by Mathematica c ::: see file visc3d.ma c ::: Null c ::: interface notes: c ::: 1) trander* ALWAYS have values in them, even if the cells are c ::: all covered. Might as well. These are edge located derivative c ::: values. In index space, they are located the same as the mask c ::: cells. Which is somewhat anomalous. These are edge values, after c ::: all. While the masks are cell-centered. But it seems easier c ::: at the moment. c ::: 1a) trander is 3x3 for each location; first is component number, then c ::: derivative direction. Not all of these are used, in fact, only the c ::: component which is normal to the face is used, and only the c ::: tangential directions are used. c ::: 2) the normal derivatives are evaluated in the normal fashion. c ::: 3) tangential derivatives which reach outside the rectangle DO have c ::: to check the masks. subroutine FORT_APPLYBC ( $ flagden, flagbc, maxorder, $ u, DIMS(u), $ cdir, bct, bcl, $ bcval, DIMS(bcval), $ maskn, DIMS(maskn), $ maske, DIMS(maske), $ maskw, DIMS(maskw), $ masks, DIMS(masks), $ maskt, DIMS(maskt), $ maskb, DIMS(maskb), $ den, DIMS(den), $ exttd,DIMS(exttd), $ trander,DIMS(trander), $ lo, hi, nc, $ h $ ) c c If the boundary is of Neumann type, set the ghost cell value to c that of the outermost point in the valid data (2nd order accurate) c and then fill the "den" array with the value "1" c c c If flagbc==1: c c If the boundary is of Dirichlet type, construct a polynomial c interpolation through the boundary location and internal points c (at locations x(-1:len-2) that generates the ghost cell value (at c location xInt). Then fill the ghost cell with the interpolated value. c If flagden==1, load the "den" array with the interpolation c coefficient corresponding to outermost point in the valid region c ( the coef(0) corresponding to the location x(0) ) c c Note: c The bc type = LO_REFLECT_ODD is a special type of dirichlet condition, c in that we want a "zeroth" order interpolant to fill the ghost cell. c If this were treated in the normal way, then ALL boundaries would be c low order. c ::: other notes since previous developers didn't bother to document c ::: cdir is mnemonic for coordinate direction. i.e. which side is c ::: cdir==0->west c ::: cdir==3->east c ::: cdir==1->south c ::: cdir==4->north c ::: cdir==2->bottom c ::: cdir==5->top c integer maxorder integer nc, cdir, flagden, flagbc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(u) REAL_T u(DIMV(u),nc) integer DIMDEC(den) REAL_T den(DIMV(den),nc) integer DIMDEC(exttd) REAL_T exttd(DIMV(exttd),nc,3) integer DIMDEC(bcval) REAL_T bcval(DIMV(bcval),nc) integer DIMDEC(maskn) integer maskn(DIMV(maskn)) integer DIMDEC(maske) integer maske(DIMV(maske)) integer DIMDEC(maskw) integer maskw(DIMV(maskw)) integer DIMDEC(masks) integer masks(DIMV(masks)) integer DIMDEC(maskt) integer maskt(DIMV(maskt)) integer DIMDEC(maskb) integer maskb(DIMV(maskb)) integer DIMDEC(trander) REAL_T trander(DIMV(trander),3,3) integer bct(nc) REAL_T bcl REAL_T h(BL_SPACEDIM) c integer i integer j integer k integer n logical is_dirichlet logical is_neumann logical is_odd REAL_T xb REAL_T innder,outder,innloc REAL_T edgloc,outloc REAL_T lambda REAL_T hx,hy,hz c integer lenx integer leny integer lenz integer m c...........trial change ................. integer tmplen parameter(tmplen=256) REAL_T tmp(0:tmplen) c...........trial change ................. c integer Lmaxorder integer maxmaxorder parameter(maxmaxorder=4) REAL_T x(-1:maxmaxorder-2) REAL_T coef(-1:maxmaxorder-2) REAL_T xInt logical False, True parameter( False=.false.) parameter( True=.true. ) c is_dirichlet(i) = ( i .eq. LO_DIRICHLET ) is_neumann(i) = (i .eq. LO_NEUMANN) c if ( maxorder .eq. -1 ) then Lmaxorder = maxmaxorder else Lmaxorder = MIN(maxorder,maxmaxorder) endif lenx = MIN(hi(1)-lo(1), Lmaxorder-2) leny = MIN(hi(2)-lo(2), Lmaxorder-2) lenz = MIN(hi(3)-lo(3), Lmaxorder-2) hx = h(1) hy = h(2) hz = h(3) c...........trial change ................. if( (hi(1)-lo(1)+1).gt.tmplen .or. & (hi(2)-lo(2)+1).gt.tmplen .or. & (hi(3)-lo(3)+1).gt.tmplen) then write(6,*)'FORT_APPLYBC: tmplen must be larger' stop endif c...........trial change ................. c c TODO: c In order for this to work with growing multigrid, must c sort xa[] because it is possible for the xb value to lay c within this range. c c The west face of the grid c if(cdir .eq. 0) then do n = 1,nc if (is_neumann(bct(n))) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(lo(1)-1,j,k,n) = cvmgt( $ u(lo(1),j,k,n), $ u(lo(1)-1,j,k,n), $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo if ( flagden .eq. 1) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(lo(1),j,k,n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part c ::: ::: Null i = lo(1) c ::: ::: ::: Y do k=lo(3),hi(3) c ::: ::: ::: ::: interior part of west face do j=lo(2)+1,hi(2)-1 innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) trander(i-1,j,k,n,2) = innder enddo j = lo(2) if(masks(i,-1+j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,1+j,k,n)-U(i,2+j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif trander(i-1,j,k,n,2) = innder j = hi(2) if(maskn(i,1+j,k).gt.0) then innder = (U(i,-2+j,k,n)-4*U(i,-1+j,k,n)+3*U(i,j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif trander(i-1,j,k,n,2) = innder enddo c ::: ::: ::: Z do j=lo(2),hi(2) do k=lo(3)+1,hi(3)-1 innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) trander(i-1,j,k,n,3) = innder enddo k = lo(3) if(maskb(i,j,-1+k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,j,1+k,n)-U(i,j,2+k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif trander(i-1,j,k,n,3) = innder k = hi(3) if(maskt(i,j,1+k).gt.0) then innder = (U(i,j,-2+k,n)-4*U(i,j,-1+k,n)+3*U(i,j,k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif trander(i-1,j,k,n,3) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,lenx x(m) = m + 0.5 enddo x(-1) = - bcl/h(1) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenx+2, coef) #if USE_TMP do k = lo(3), hi(3) if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) tmp(j-lo(2)) = bcval(lo(1)-1,j,k,n)*coef(-1) enddo else do j = lo(2), hi(2) tmp(j-lo(2)) = 0.0 enddo endif do m = 0, lenx do j = lo(2), hi(2) tmp(j-lo(2)) = tmp(j-lo(2))+u(lo(1)+m,j,k,n)*coef(m) enddo enddo do j = lo(2), hi(2) u(lo(1)-1, j, k, n) = cvmgt( & tmp(j-lo(2)), $ u(lo(1)-1, j,k, n), $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo #else if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(lo(1)-1, j, k, n) = cvmgt( $ bcval(lo(1)-1,j,k,n)*coef(-1), $ u(lo(1)-1, j,k, n), $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo else do k = lo(3), hi(3) do j = lo(2), hi(2) u(lo(1)-1, j, k, n) = cvmgt( $ 0.0, $ u(lo(1)-1, j, k, n), $ maskw(lo(1)-1,j, k) .gt. 0) enddo enddo endif do k = lo(3), hi(3) do m = 0, lenx do j = lo(2), hi(2) u(lo(1)-1,j,k,n) = cvmgt( $ u(lo(1)-1,j,k,n) $ + u(lo(1)+m, j, k, n)*coef(m), $ u(lo(1)-1,j,k,n), $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(lo(1),j,k,n) = cvmgt(coef(0), 0.0, $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: Null c ::: ::: interior part of west side edgloc = 0. i = lo(1) c ::: ::: ::: Y do k=lo(3),hi(3) do j=lo(2)+1,hi(2)-1 if( maskw(-1+i,-1+j,k).eq.0.and.maskw(-1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-U(-1+i,-1+j,k,n)+U(-1+i,1+j,k,n))/(2.d0*hy) elseif( maskw(-1+i,j,k).eq.0.and.maskw(-1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(-1+i,j,k,n)+4*U(-1+i,1+j,k,n)-U(-1+i,2+j,k,n))/(2.d0 & *hy) elseif( maskw(-1+i,-1+j,k).eq.0.and.maskw(-1+i,j,k).eq.0)then outloc = -0.5 outder = (U(-1+i,-2+j,k,n)-4*U(-1+i,-1+j,k,n)+3*U(-1+i,j,k,n))/(2.d & 0*hy) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,2) else outder = 0. endif endif innloc = 0.5 innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,2) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: now endpoints j = lo(2) if( maskw(-1+i,-1+j,k).eq.0.and.maskw(-1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-U(-1+i,-1+j,k,n)+U(-1+i,1+j,k,n))/(2.d0*hy) elseif( maskw(-1+i,j,k).eq.0.and.maskw(-1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(-1+i,j,k,n)+4*U(-1+i,1+j,k,n)-U(-1+i,2+j,k,n))/(2.d0 & *hy) elseif( maskw(-1+i,-1+j,k).eq.0.and.maskw(-1+i,j,k).eq.0)then outloc = -0.5 outder = (U(-1+i,-2+j,k,n)-4*U(-1+i,-1+j,k,n)+3*U(-1+i,j,k,n))/(2.d & 0*hy) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,2) else outder = 0. endif endif if(masks(i,-1+j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,1+j,k,n)-U(i,2+j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,2) = lambda*innder+(1-lambda)*outder j = hi(2) if( maskw(-1+i,-1+j,k).eq.0.and.maskw(-1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-U(-1+i,-1+j,k,n)+U(-1+i,1+j,k,n))/(2.d0*hy) elseif( maskw(-1+i,j,k).eq.0.and.maskw(-1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(-1+i,j,k,n)+4*U(-1+i,1+j,k,n)-U(-1+i,2+j,k,n))/(2.d0 & *hy) elseif( maskw(-1+i,-1+j,k).eq.0.and.maskw(-1+i,j,k).eq.0)then outloc = -0.5 outder = (U(-1+i,-2+j,k,n)-4*U(-1+i,-1+j,k,n)+3*U(-1+i,j,k,n))/(2.d & 0*hy) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,2) else outder = 0. endif endif if(maskn(i,1+j,k).gt.0) then innder = (U(i,-2+j,k,n)-4*U(i,-1+j,k,n)+3*U(i,j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,2) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Z do j=lo(2),hi(2) do k=lo(3)+1,hi(3)-1 if( maskw(-1+i,j,-1+k).eq.0.and.maskw(-1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-U(-1+i,j,-1+k,n)+U(-1+i,j,1+k,n))/(2.d0*hz) elseif( maskw(-1+i,j,k).eq.0.and.maskw(-1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(-1+i,j,k,n)+4*U(-1+i,j,1+k,n)-U(-1+i,j,2+k,n))/(2.d0 & *hz) elseif( maskw(-1+i,j,-1+k).eq.0.and.maskw(-1+i,j,k).eq.0)then outloc = -0.5 outder = (U(-1+i,j,-2+k,n)-4*U(-1+i,j,-1+k,n)+3*U(-1+i,j,k,n))/(2.d & 0*hz) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,3) else outder = 0. endif endif innloc = 0.5 innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,3) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: now endpoints k = lo(3) if( maskw(-1+i,j,-1+k).eq.0.and.maskw(-1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-U(-1+i,j,-1+k,n)+U(-1+i,j,1+k,n))/(2.d0*hz) elseif( maskw(-1+i,j,k).eq.0.and.maskw(-1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(-1+i,j,k,n)+4*U(-1+i,j,1+k,n)-U(-1+i,j,2+k,n))/(2.d0 & *hz) elseif( maskw(-1+i,j,-1+k).eq.0.and.maskw(-1+i,j,k).eq.0)then outloc = -0.5 outder = (U(-1+i,j,-2+k,n)-4*U(-1+i,j,-1+k,n)+3*U(-1+i,j,k,n))/(2.d & 0*hz) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,3) else outder = 0. endif endif if(maskb(i,j,-1+k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,j,1+k,n)-U(i,j,2+k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,3) = lambda*innder+(1-lambda)*outder k = hi(3) if( maskw(-1+i,j,-1+k).eq.0.and.maskw(-1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-U(-1+i,j,-1+k,n)+U(-1+i,j,1+k,n))/(2.d0*hz) elseif( maskw(-1+i,j,k).eq.0.and.maskw(-1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(-1+i,j,k,n)+4*U(-1+i,j,1+k,n)-U(-1+i,j,2+k,n))/(2.d0 & *hz) elseif( maskw(-1+i,j,-1+k).eq.0.and.maskw(-1+i,j,k).eq.0)then outloc = -0.5 outder = (U(-1+i,j,-2+k,n)-4*U(-1+i,j,-1+k,n)+3*U(-1+i,j,k,n))/(2.d & 0*hz) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,3) else outder = 0. endif endif if(maskt(i,j,1+k).gt.0) then innder = (U(i,j,-2+k,n)-4*U(i,j,-1+k,n)+3*U(i,j,k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,3) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(lo(1)-1, j, k, n) = cvmgt( $ -u(lo(1),j,k,n), $ u(lo(1)-1,j,k,n), $ maskw(lo(1)-1,j,k) .gt. 0) trander(lo(1)-1,j,k,n,2) = 0. trander(lo(1)-1,j,k,n,3) = 0. enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(lo(1),j,k,n) = cvmgt(-1.0, 0.0, $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON WEST FACE IN APPLYBC' stop endif enddo endif c c The east face of the grid c if(cdir .eq. 3) then do n = 1,nc if(is_neumann(bct(n))) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(hi(1)+1,j,k,n) = cvmgt( $ u(hi(1), j, k, n), $ u(hi(1)+1, j, k, n), $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(hi(1),j,k,n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part i = hi(1) c ::: ::: ::: Y do k=lo(3),hi(3) c ::: ::: ::: ::: interior part of west face do j=lo(2)+1,hi(2)-1 innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) trander(i+1,j,k,n,2) = innder enddo j = lo(2) if(masks(i,-1+j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,1+j,k,n)-U(i,2+j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif trander(i+1,j,k,n,2) = innder j = hi(2) if(maskn(i,1+j,k).gt.0) then innder = (U(i,-2+j,k,n)-4*U(i,-1+j,k,n)+3*U(i,j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif trander(i+1,j,k,n,2) = innder enddo c ::: ::: ::: Z do j=lo(2),hi(2) do k=lo(3)+1,hi(3)-1 innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) trander(i+1,j,k,n,3) = innder enddo k = lo(3) if(maskb(i,j,-1+k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,j,1+k,n)-U(i,j,2+k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif trander(i+1,j,k,n,3) = innder k = hi(3) if(maskt(i,j,1+k).gt.0) then innder = (U(i,j,-2+k,n)-4*U(i,j,-1+k,n)+3*U(i,j,k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif trander(i+1,j,k,n,3) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,lenx x(m) = m + 0.5 enddo x(-1) = - bcl/h(1) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenx+2, coef) #if USE_TMP do k = lo(3), hi(3) if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) tmp(j-lo(2)) = bcval(hi(1)+1,j,k,n)*coef(-1) enddo else do j = lo(2), hi(2) tmp(j-lo(2)) = 0.0 enddo endif do m = 0, lenx do j = lo(2), hi(2) tmp(j-lo(2)) = tmp(j-lo(2))+u(hi(1)-m,j,k,n)*coef(m) enddo enddo do j = lo(2), hi(2) u(hi(1)+1,j,k,n) = cvmgt( $ tmp(j-lo(2)), $ u(hi(1)+1,j,k,n), $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo #else if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(hi(1)+1,j,k,n) = cvmgt( $ bcval(hi(1)+1,j,k,n)*coef(-1), $ u(hi(1)+1,j,k,n), $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo else do k = lo(3), hi(3) do j = lo(2), hi(2) u(hi(1)+1,j,k,n) = cvmgt( $ 0.0, $ u(hi(1)+1,j,k,n), $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo endif do k = lo(3), hi(3) do m = 0, lenx do j = lo(2), hi(2) u(hi(1)+1,j,k,n) = cvmgt( $ u(hi(1)+1,j,k,n) $ + u(hi(1)-m,j,k,n)*coef(m), $ u(hi(1)+1,j,k,n), $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(hi(1),j,k,n) = cvmgt(coef(0), 0.0, $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: interior part of west side edgloc = 0. i = hi(1) c ::: ::: ::: Y do k=lo(3),hi(3) do j=lo(2)+1,hi(2)-1 if( maske(1+i,-1+j,k).eq.0.and.maske(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-U(1+i,-1+j,k,n)+U(1+i,1+j,k,n))/(2.d0*hy) elseif( maske(1+i,j,k).eq.0.and.maske(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(1+i,j,k,n)+4*U(1+i,1+j,k,n)-U(1+i,2+j,k,n))/(2.d0*hy & ) elseif( maske(1+i,-1+j,k).eq.0.and.maske(1+i,j,k).eq.0)then outloc = -0.5 outder = (U(1+i,-2+j,k,n)-4*U(1+i,-1+j,k,n)+3*U(1+i,j,k,n))/(2.d0*h & y) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,2) else outder = 0. endif endif innloc = 0.5 innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,2) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: now endpoints j = lo(2) if( maske(1+i,-1+j,k).eq.0.and.maske(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-U(1+i,-1+j,k,n)+U(1+i,1+j,k,n))/(2.d0*hy) elseif( maske(1+i,j,k).eq.0.and.maske(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(1+i,j,k,n)+4*U(1+i,1+j,k,n)-U(1+i,2+j,k,n))/(2.d0*hy & ) elseif( maske(1+i,-1+j,k).eq.0.and.maske(1+i,j,k).eq.0)then outloc = -0.5 outder = (U(1+i,-2+j,k,n)-4*U(1+i,-1+j,k,n)+3*U(1+i,j,k,n))/(2.d0*h & y) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,2) else outder = 0. endif endif if(masks(i,-1+j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,1+j,k,n)-U(i,2+j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,2) = lambda*innder+(1-lambda)*outder j = hi(2) if( maske(1+i,-1+j,k).eq.0.and.maske(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-U(1+i,-1+j,k,n)+U(1+i,1+j,k,n))/(2.d0*hy) elseif( maske(1+i,j,k).eq.0.and.maske(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(1+i,j,k,n)+4*U(1+i,1+j,k,n)-U(1+i,2+j,k,n))/(2.d0*hy & ) elseif( maske(1+i,-1+j,k).eq.0.and.maske(1+i,j,k).eq.0)then outloc = -0.5 outder = (U(1+i,-2+j,k,n)-4*U(1+i,-1+j,k,n)+3*U(1+i,j,k,n))/(2.d0*h & y) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,2) else outder = 0. endif endif if(maskn(i,1+j,k).gt.0) then innder = (U(i,-2+j,k,n)-4*U(i,-1+j,k,n)+3*U(i,j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,2) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Z do j=lo(2),hi(2) do k=lo(3)+1,hi(3)-1 if( maske(1+i,j,-1+k).eq.0.and.maske(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-U(1+i,j,-1+k,n)+U(1+i,j,1+k,n))/(2.d0*hz) elseif( maske(1+i,j,k).eq.0.and.maske(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(1+i,j,k,n)+4*U(1+i,j,1+k,n)-U(1+i,j,2+k,n))/(2.d0*hz & ) elseif( maske(1+i,j,-1+k).eq.0.and.maske(1+i,j,k).eq.0)then outloc = -0.5 outder = (U(1+i,j,-2+k,n)-4*U(1+i,j,-1+k,n)+3*U(1+i,j,k,n))/(2.d0*h & z) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,3) else outder = 0. endif endif innloc = 0.5 innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,3) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: now endpoints k = lo(3) if( maske(1+i,j,-1+k).eq.0.and.maske(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-U(1+i,j,-1+k,n)+U(1+i,j,1+k,n))/(2.d0*hz) elseif( maske(1+i,j,k).eq.0.and.maske(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(1+i,j,k,n)+4*U(1+i,j,1+k,n)-U(1+i,j,2+k,n))/(2.d0*hz & ) elseif( maske(1+i,j,-1+k).eq.0.and.maske(1+i,j,k).eq.0)then outloc = -0.5 outder = (U(1+i,j,-2+k,n)-4*U(1+i,j,-1+k,n)+3*U(1+i,j,k,n))/(2.d0*h & z) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,3) else outder = 0. endif endif if(maskb(i,j,-1+k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,j,1+k,n)-U(i,j,2+k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,3) = lambda*innder+(1-lambda)*outder k = hi(3) if( maske(1+i,j,-1+k).eq.0.and.maske(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-U(1+i,j,-1+k,n)+U(1+i,j,1+k,n))/(2.d0*hz) elseif( maske(1+i,j,k).eq.0.and.maske(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(1+i,j,k,n)+4*U(1+i,j,1+k,n)-U(1+i,j,2+k,n))/(2.d0*hz & ) elseif( maske(1+i,j,-1+k).eq.0.and.maske(1+i,j,k).eq.0)then outloc = -0.5 outder = (U(1+i,j,-2+k,n)-4*U(1+i,j,-1+k,n)+3*U(1+i,j,k,n))/(2.d0*h & z) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,3) else outder = 0. endif endif if(maskt(i,j,1+k).gt.0) then innder = (U(i,j,-2+k,n)-4*U(i,j,-1+k,n)+3*U(i,j,k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,3) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(hi(1)+1, j, k, n) = cvmgt( $ -u(hi(1),j,k,n), $ u(hi(1)+1,j,k,n), $ maske(hi(1)+1,j,k) .gt. 0) trander(hi(1)+1,j,k,n,2) = 0. trander(hi(1)+1,j,k,n,3) = 0. enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(hi(1),j,k,n) = cvmgt(-1.0, 0.0, $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON RIGHT FACE IN APPLYBC' stop endif enddo endif c c The south of the Grid c if(cdir .eq. 1) then do n = 1,nc if(is_neumann(bct(n))) then do k = lo(3), hi(3) do i = lo(1),hi(1) u(i,lo(2)-1,k,n) = cvmgt( $ u(i,lo(2),k,n), $ u(i,lo(2)-1,k,n), $ masks(i,lo(2)-1,k) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1),hi(1) den(i,lo(2),k,n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part j = lo(2) c ::: ::: ::: X do k=lo(3),hi(3) c ::: ::: ::: ::: interior part of south face do i=lo(1)+1,hi(1)-1 innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) trander(i,j-1,k,n,1) = innder enddo i = lo(1) if(maskw(-1+i,j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(1+i,j,k,n)-U(2+i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif trander(i,j-1,k,n,1) = innder i = hi(1) if(maske(1+i,j,k).gt.0) then innder = (U(-2+i,j,k,n)-4*U(-1+i,j,k,n)+3*U(i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif trander(i,j-1,k,n,1) = innder enddo c ::: ::: ::: Z do i=lo(1),hi(1) c ::: ::: ::: ::: interior part of south face do k=lo(3)+1,hi(3)-1 innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) trander(i,j-1,k,n,3) = innder enddo k = lo(3) if(maskb(i,j,-1+k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,j,1+k,n)-U(i,j,2+k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif trander(i,j-1,k,n,3) = innder k = hi(3) if(maskt(i,j,1+k).gt.0) then innder = (U(i,j,-2+k,n)-4*U(i,j,-1+k,n)+3*U(i,j,k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif trander(i,j-1,k,n,3) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,leny x(m) = m + 0.5 enddo x(-1) = - bcl/h(2) xInt = - 0.5 call polyInterpCoeff(xInt, x, leny+2, coef) #if USE_TMP do k = lo(3), hi(3) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) tmp(i-lo(1)) = bcval(i,lo(2)-1,k,n)*coef(-1) enddo else do i = lo(1), hi(1) tmp(i-lo(1)) = 0.0 enddo endif do m = 0, leny do i = lo(1), hi(1) tmp(i-lo(1)) = tmp(i-lo(1))+u(i,lo(2)+m,k,n)*coef(m) enddo enddo do i = lo(1), hi(1) u(i,lo(2)-1,k,n) = cvmgt( $ tmp(i-lo(1)), $ u(i,lo(2)-1,k,n), $ masks(i,lo(2)-1,k) .gt. 0) enddo enddo #else if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,lo(2)-1,k,n) = cvmgt( $ bcval(i,lo(2)-1,k,n)*coef(-1), $ u(i,lo(2)-1,k,n), $ masks(i,lo(2)-1,k) .gt. 0) enddo enddo else do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,lo(2)-1,k,n) = cvmgt( $ 0.0, $ u(i,lo(2)-1,k,n), $ masks(i,lo(2)-1,k) .gt. 0) enddo enddo endif do k = lo(3), hi(3) do m = 0, leny do i = lo(1), hi(1) u(i, lo(2)-1, k, n) = cvmgt( $ u(i, lo(2)-1,k,n) $ + u(i, lo(2)+m, k,n)*coef(m), $ u(i, lo(2)-1, k, n), $ masks(i, lo(2)-1, k) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i, lo(2),k,n) = cvmgt(coef(0), 0.0, $ masks(i, lo(2)-1,k) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: interior part first, followed by end points edgloc = 0. j=lo(2) c ::: ::: ::: X do k=lo(3),hi(3) do i=lo(1)+1, hi(1)-1 if( masks(-1+i,-1+j,k).eq.0.and.masks(1+i,-1+j,k).eq.0)then outloc = -0.5 outder = (-U(-1+i,-1+j,k,n)+U(1+i,-1+j,k,n))/(2.d0*hx) elseif( masks(i,-1+j,k).eq.0.and.masks(1+i,-1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(i,-1+j,k,n)+4*U(1+i,-1+j,k,n)-U(2+i,-1+j,k,n))/(2.d0 & *hx) elseif( masks(-1+i,-1+j,k).eq.0.and.masks(i,-1+j,k).eq.0)then outloc = -0.5 outder = (U(-2+i,-1+j,k,n)-4*U(-1+i,-1+j,k,n)+3*U(i,-1+j,k,n))/(2.d & 0*hx) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,1) else outder = 0. endif endif innloc = 0.5 innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,1) = lambda*innder+(1-lambda)*outder enddo i = lo(1) if( masks(-1+i,-1+j,k).eq.0.and.masks(1+i,-1+j,k).eq.0)then outloc = -0.5 outder = (-U(-1+i,-1+j,k,n)+U(1+i,-1+j,k,n))/(2.d0*hx) elseif( masks(i,-1+j,k).eq.0.and.masks(1+i,-1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(i,-1+j,k,n)+4*U(1+i,-1+j,k,n)-U(2+i,-1+j,k,n))/(2.d0 & *hx) elseif( masks(-1+i,-1+j,k).eq.0.and.masks(i,-1+j,k).eq.0)then outloc = -0.5 outder = (U(-2+i,-1+j,k,n)-4*U(-1+i,-1+j,k,n)+3*U(i,-1+j,k,n))/(2.d & 0*hx) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,1) else outder = 0. endif endif if(maskw(-1+i,j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(1+i,j,k,n)-U(2+i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,1) = lambda*innder+(1-lambda)*outder i = hi(1) if( masks(-1+i,-1+j,k).eq.0.and.masks(1+i,-1+j,k).eq.0)then outloc = -0.5 outder = (-U(-1+i,-1+j,k,n)+U(1+i,-1+j,k,n))/(2.d0*hx) elseif( masks(i,-1+j,k).eq.0.and.masks(1+i,-1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(i,-1+j,k,n)+4*U(1+i,-1+j,k,n)-U(2+i,-1+j,k,n))/(2.d0 & *hx) elseif( masks(-1+i,-1+j,k).eq.0.and.masks(i,-1+j,k).eq.0)then outloc = -0.5 outder = (U(-2+i,-1+j,k,n)-4*U(-1+i,-1+j,k,n)+3*U(i,-1+j,k,n))/(2.d & 0*hx) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,1) else outder = 0. endif endif if(maske(1+i,j,k).gt.0) then innder = (U(-2+i,j,k,n)-4*U(-1+i,j,k,n)+3*U(i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,1) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Z do i=lo(1), hi(1) do k=lo(3)+1,hi(3)-1 if( masks(i,-1+j,-1+k).eq.0.and.masks(i,-1+j,1+k).eq.0)then outloc = -0.5 outder = (-U(i,-1+j,-1+k,n)+U(i,-1+j,1+k,n))/(2.d0*hz) elseif( masks(i,-1+j,k).eq.0.and.masks(i,-1+j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,-1+j,k,n)+4*U(i,-1+j,1+k,n)-U(i,-1+j,2+k,n))/(2.d0 & *hz) elseif( masks(i,-1+j,-1+k).eq.0.and.masks(i,-1+j,k).eq.0)then outloc = -0.5 outder = (U(i,-1+j,-2+k,n)-4*U(i,-1+j,-1+k,n)+3*U(i,-1+j,k,n))/(2.d & 0*hz) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,3) else outder = 0. endif endif innloc = 0.5 innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,3) = lambda*innder+(1-lambda)*outder enddo k = lo(3) if( masks(i,-1+j,-1+k).eq.0.and.masks(i,-1+j,1+k).eq.0)then outloc = -0.5 outder = (-U(i,-1+j,-1+k,n)+U(i,-1+j,1+k,n))/(2.d0*hz) elseif( masks(i,-1+j,k).eq.0.and.masks(i,-1+j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,-1+j,k,n)+4*U(i,-1+j,1+k,n)-U(i,-1+j,2+k,n))/(2.d0 & *hz) elseif( masks(i,-1+j,-1+k).eq.0.and.masks(i,-1+j,k).eq.0)then outloc = -0.5 outder = (U(i,-1+j,-2+k,n)-4*U(i,-1+j,-1+k,n)+3*U(i,-1+j,k,n))/(2.d & 0*hz) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,3) else outder = 0. endif endif if(maskb(i,j,-1+k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,j,1+k,n)-U(i,j,2+k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,3) = lambda*innder+(1-lambda)*outder k = hi(3) if( masks(i,-1+j,-1+k).eq.0.and.masks(i,-1+j,1+k).eq.0)then outloc = -0.5 outder = (-U(i,-1+j,-1+k,n)+U(i,-1+j,1+k,n))/(2.d0*hz) elseif( masks(i,-1+j,k).eq.0.and.masks(i,-1+j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,-1+j,k,n)+4*U(i,-1+j,1+k,n)-U(i,-1+j,2+k,n))/(2.d0 & *hz) elseif( masks(i,-1+j,-1+k).eq.0.and.masks(i,-1+j,k).eq.0)then outloc = -0.5 outder = (U(i,-1+j,-2+k,n)-4*U(i,-1+j,-1+k,n)+3*U(i,-1+j,k,n))/(2.d & 0*hz) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,3) else outder = 0. endif endif if(maskt(i,j,1+k).gt.0) then innder = (U(i,j,-2+k,n)-4*U(i,j,-1+k,n)+3*U(i,j,k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,3) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do k = lo(3), hi(3) do i = lo(1), hi(1) u(i, lo(2)-1, k, n) = cvmgt( $ -u(i,lo(2),k,n), $ u(i,lo(2)-1,k,n), $ masks(i,lo(2)-1,k) .gt. 0) trander(i,lo(2)-1,k,n,1) = 0. trander(i,lo(2)-1,k,n,3) = 0. enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,lo(2),k,n) = cvmgt(-1.0, 0.0, $ masks(i,lo(2)-1,k) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON BOTTOM FACE IN APPLYBC' stop endif enddo endif c c The north of the grid c if (cdir .eq. 4) then do n = 1,nc if(is_neumann(bct(n))) then do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,hi(2)+1,k,n) = cvmgt( $ u(i,hi(2),k,n), $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,hi(2),k,n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part j = hi(2) c ::: ::: ::: X do k=lo(3),hi(3) c ::: ::: ::: ::: interior part of south face do i=lo(1)+1,hi(1)-1 innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) trander(i,j+1,k,n,1) = innder enddo i = lo(1) if(maskw(-1+i,j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(1+i,j,k,n)-U(2+i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif trander(i,j+1,k,n,1) = innder i = hi(1) if(maske(1+i,j,k).gt.0) then innder = (U(-2+i,j,k,n)-4*U(-1+i,j,k,n)+3*U(i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif trander(i,j+1,k,n,1) = innder enddo c ::: ::: ::: Z do i=lo(1),hi(1) c ::: ::: ::: ::: interior part of south face do k=lo(3)+1,hi(3)-1 innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) trander(i,j+1,k,n,3) = innder enddo k = lo(3) if(maskb(i,j,-1+k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,j,1+k,n)-U(i,j,2+k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif trander(i,j+1,k,n,3) = innder k = hi(3) if(maskt(i,j,1+k).gt.0) then innder = (U(i,j,-2+k,n)-4*U(i,j,-1+k,n)+3*U(i,j,k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif trander(i,j+1,k,n,3) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,leny x(m) = m + 0.5 enddo x(-1) = - bcl/h(2) xInt = - 0.5 call polyInterpCoeff(xInt, x, leny+2, coef) #if USE_TMP do k = lo(3), hi(3) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) tmp(i-lo(1)) = bcval(i,hi(2)+1,k,n)*coef(-1) enddo else do i = lo(1), hi(1) tmp(i-lo(1)) = 0.0 enddo endif do m = 0, leny do i = lo(1), hi(1) tmp(i-lo(1)) = tmp(i-lo(1))+u(i,hi(2)-m,k,n)*coef(m) enddo enddo do i = lo(1), hi(1) u(i,hi(2)+1,k,n) = cvmgt( $ tmp(i-lo(1)), $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo #else if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,hi(2)+1,k,n) = cvmgt( $ bcval(i,hi(2)+1,k,n)*coef(-1), $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo else do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,hi(2)+1,k,n) = cvmgt( $ 0.0, $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo endif do k = lo(3), hi(3) do m = 0, leny do i = lo(1), hi(1) u(i, hi(2)+1,k,n) = cvmgt( $ u(i,hi(2)+1,k,n) $ + u(i, hi(2)-m,k,n)*coef(m), $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,hi(2),k,n) = cvmgt(coef(0), 0.0, $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: interior part first, followed by end points edgloc = 0. j=hi(2) c ::: ::: ::: X do k=lo(3),hi(3) do i=lo(1)+1, hi(1)-1 if( maskn(-1+i,1+j,k).eq.0.and.maskn(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-U(-1+i,1+j,k,n)+U(1+i,1+j,k,n))/(2.d0*hx) elseif( maskn(i,1+j,k).eq.0.and.maskn(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(i,1+j,k,n)+4*U(1+i,1+j,k,n)-U(2+i,1+j,k,n))/(2.d0*hx & ) elseif( maskn(-1+i,1+j,k).eq.0.and.maskn(i,1+j,k).eq.0)then outloc = -0.5 outder = (U(-2+i,1+j,k,n)-4*U(-1+i,1+j,k,n)+3*U(i,1+j,k,n))/(2.d0*h & x) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,1) else outder = 0. endif endif innloc = 0.5 innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,1) = lambda*innder+(1-lambda)*outder enddo i = lo(1) if( maskn(-1+i,1+j,k).eq.0.and.maskn(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-U(-1+i,1+j,k,n)+U(1+i,1+j,k,n))/(2.d0*hx) elseif( maskn(i,1+j,k).eq.0.and.maskn(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(i,1+j,k,n)+4*U(1+i,1+j,k,n)-U(2+i,1+j,k,n))/(2.d0*hx & ) elseif( maskn(-1+i,1+j,k).eq.0.and.maskn(i,1+j,k).eq.0)then outloc = -0.5 outder = (U(-2+i,1+j,k,n)-4*U(-1+i,1+j,k,n)+3*U(i,1+j,k,n))/(2.d0*h & x) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,1) else outder = 0. endif endif if(maskw(-1+i,j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(1+i,j,k,n)-U(2+i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,1) = lambda*innder+(1-lambda)*outder i = hi(1) if( maskn(-1+i,1+j,k).eq.0.and.maskn(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-U(-1+i,1+j,k,n)+U(1+i,1+j,k,n))/(2.d0*hx) elseif( maskn(i,1+j,k).eq.0.and.maskn(1+i,1+j,k).eq.0)then outloc = -0.5 outder = (-3*U(i,1+j,k,n)+4*U(1+i,1+j,k,n)-U(2+i,1+j,k,n))/(2.d0*hx & ) elseif( maskn(-1+i,1+j,k).eq.0.and.maskn(i,1+j,k).eq.0)then outloc = -0.5 outder = (U(-2+i,1+j,k,n)-4*U(-1+i,1+j,k,n)+3*U(i,1+j,k,n))/(2.d0*h & x) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,1) else outder = 0. endif endif if(maske(1+i,j,k).gt.0) then innder = (U(-2+i,j,k,n)-4*U(-1+i,j,k,n)+3*U(i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,1) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Z do i=lo(1), hi(1) do k=lo(3)+1,hi(3)-1 if( maskn(i,1+j,-1+k).eq.0.and.maskn(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-U(i,1+j,-1+k,n)+U(i,1+j,1+k,n))/(2.d0*hz) elseif( maskn(i,1+j,k).eq.0.and.maskn(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,1+j,k,n)+4*U(i,1+j,1+k,n)-U(i,1+j,2+k,n))/(2.d0*hz & ) elseif( maskn(i,1+j,-1+k).eq.0.and.maskn(i,1+j,k).eq.0)then outloc = -0.5 outder = (U(i,1+j,-2+k,n)-4*U(i,1+j,-1+k,n)+3*U(i,1+j,k,n))/(2.d0*h & z) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,3) else outder = 0. endif endif innloc = 0.5 innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,3) = lambda*innder+(1-lambda)*outder enddo k = lo(3) if( maskn(i,1+j,-1+k).eq.0.and.maskn(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-U(i,1+j,-1+k,n)+U(i,1+j,1+k,n))/(2.d0*hz) elseif( maskn(i,1+j,k).eq.0.and.maskn(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,1+j,k,n)+4*U(i,1+j,1+k,n)-U(i,1+j,2+k,n))/(2.d0*hz & ) elseif( maskn(i,1+j,-1+k).eq.0.and.maskn(i,1+j,k).eq.0)then outloc = -0.5 outder = (U(i,1+j,-2+k,n)-4*U(i,1+j,-1+k,n)+3*U(i,1+j,k,n))/(2.d0*h & z) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,3) else outder = 0. endif endif if(maskb(i,j,-1+k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,j,1+k,n)-U(i,j,2+k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,3) = lambda*innder+(1-lambda)*outder k = hi(3) if( maskn(i,1+j,-1+k).eq.0.and.maskn(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-U(i,1+j,-1+k,n)+U(i,1+j,1+k,n))/(2.d0*hz) elseif( maskn(i,1+j,k).eq.0.and.maskn(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,1+j,k,n)+4*U(i,1+j,1+k,n)-U(i,1+j,2+k,n))/(2.d0*hz & ) elseif( maskn(i,1+j,-1+k).eq.0.and.maskn(i,1+j,k).eq.0)then outloc = -0.5 outder = (U(i,1+j,-2+k,n)-4*U(i,1+j,-1+k,n)+3*U(i,1+j,k,n))/(2.d0*h & z) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,3) else outder = 0. endif endif if(maskt(i,j,1+k).gt.0) then innder = (U(i,j,-2+k,n)-4*U(i,j,-1+k,n)+3*U(i,j,k,n))/(2.d0*hz) else innder = (-U(i,j,-1+k,n)+U(i,j,1+k,n))/(2.d0*hz) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,3) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do k = lo(3), hi(3) do i = lo(1), hi(1) u(i, hi(2)+1, k, n) = cvmgt( $ -u(i,hi(2),k,n), $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) trander(i,hi(2)+1,k,n,1) = 0. trander(i,hi(2)+1,k,n,3) = 0. enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,hi(2),k,n) = cvmgt(-1.0, 0.0, $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON TOP FACE IN APPLYBC' stop endif enddo endif c c The bottom of the Grid c if(cdir .eq. 2) then do n = 1,nc if(is_neumann(bct(n))) then do j = lo(2), hi(2) do i = lo(1),hi(1) u(i,j,lo(3)-1,n) = cvmgt( $ u(i,j,lo(3),n), $ u(i,j,lo(3)-1,n), $ maskb(i,j,lo(3)-1) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1),hi(1) den(i,j,lo(3),n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part k = lo(3) c ::: ::: X do j=lo(2),hi(2) c ::: ::: ::: interior part of bottom face do i=lo(1)+1,hi(1)-1 innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) trander(i,j,k-1,n,1) = innder enddo i = lo(1) if( maskw(-1+i,j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(1+i,j,k,n)-U(2+i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif trander(i,j,k-1,n,1) = innder i = hi(1) if( maske(1+i,j,k).gt.0) then innder = (U(-2+i,j,k,n)-4*U(-1+i,j,k,n)+3*U(i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif trander(i,j,k-1,n,1) = innder enddo c ::: ::: ::: Y do i=lo(1),hi(1) c ::: ::: ::: interior part of bottom face do j=lo(2)+1,hi(2)-1 innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) trander(i,j,k-1,n,2) = innder enddo j = lo(2) if( masks(i,-1+j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,1+j,k,n)-U(i,2+j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif trander(i,j,k-1,n,2) = innder j = hi(2) if( maskn(i,1+j,k).gt.0) then innder = (U(i,-2+j,k,n)-4*U(i,-1+j,k,n)+3*U(i,j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif trander(i,j,k-1,n,2) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,lenz x(m) = m + 0.5 enddo x(-1) = - bcl/h(3) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenz+2, coef) #if USE_TMP do j = lo(2), hi(2) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) tmp(i-lo(1)) = bcval(i,j,lo(3)-1,n)*coef(-1) enddo else do i = lo(1), hi(1) tmp(i-lo(1)) = 0.0 enddo endif do m = 0, lenz do i = lo(1), hi(1) tmp(i-lo(1)) = tmp(i-lo(1))+u(i,j,lo(3)+m,n)*coef(m) enddo enddo do i=lo(1),hi(1) u(i,j,lo(3)-1,n) = cvmgt( & tmp(i-lo(1)), & u(i,j,lo(3)-1,n), & maskb(i,j,lo(3)-1).gt. 0 ) enddo enddo #else if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j,lo(3)-1,n) = cvmgt( $ bcval(i,j,lo(3)-1,n)*coef(-1), $ u(i,j,lo(3)-1,n), $ maskb(i,j,lo(3)-1) .gt. 0) enddo enddo else do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j,lo(3)-1,n) = cvmgt( $ 0.0, $ u(i,j,lo(3)-1,n), $ maskb(i,j,lo(3)-1) .gt. 0) enddo enddo endif do j = lo(2), hi(2) do m = 0, lenz do i = lo(1), hi(1) u(i, j, lo(3)-1, n) = cvmgt( $ u(i, j, lo(3)-1,n) $ + u(i, j, lo(3)+m, n)*coef(m), $ u(i, j, lo(3)-1,n), $ maskb(i, j, lo(3)-1) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i, j, lo(3),n) = cvmgt(coef(0), 0.0, $ maskb(i, j, lo(3)-1) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: interior part first, followed by end points edgloc = 0. k = lo(3) c ::: ::: ::: X do j=lo(2),hi(2) do i=lo(1)+1, hi(1)-1 if( maskb(-1+i,j,-1+k).eq.0.and.maskb(1+i,j,-1+k).eq.0)then outloc = -0.5 outder = (-U(-1+i,j,-1+k,n)+U(1+i,j,-1+k,n))/(2.d0*hx) else if( maskb(i,j,-1+k).eq.0.and.maskb(1+i,j,-1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,-1+k,n)+4*U(1+i,j,-1+k,n)-U(2+i,j,-1+k,n))/(2.d0 & *hx) else if( maskb(-1+i,j,-1+k).eq.0.and.maskb(i,j,-1+k).eq.0)then outloc = -0.5 outder = (U(-2+i,j,-1+k,n)-4*U(-1+i,j,-1+k,n)+3*U(i,j,-1+k,n))/(2.d & 0*hx) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,1) else outder = 0. endif endif innloc = 0.5 innder = (-u(-1+i,j,k,n)+u(1+i,j,k,n))/(2.d0*hx) lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,1) = lambda*innder+(1-lambda)*outder enddo i = lo(1) if( maskb(-1+i,j,-1+k).eq.0.and.maskb(1+i,j,-1+k).eq.0)then outloc = -0.5 outder = (-U(-1+i,j,-1+k,n)+U(1+i,j,-1+k,n))/(2.d0*hx) else if( maskb(i,j,-1+k).eq.0.and.maskb(1+i,j,-1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,-1+k,n)+4*U(1+i,j,-1+k,n)-U(2+i,j,-1+k,n))/(2.d0 & *hx) else if( maskb(-1+i,j,-1+k).eq.0.and.maskb(i,j,-1+k).eq.0)then outloc = -0.5 outder = (U(-2+i,j,-1+k,n)-4*U(-1+i,j,-1+k,n)+3*U(i,j,-1+k,n))/(2.d & 0*hx) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,1) else outder = 0. endif endif if(maskw(-1+i,j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(1+i,j,k,n)-U(2+i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,1) = lambda*innder+(1-lambda)*outder i = hi(1) if( maskb(-1+i,j,-1+k).eq.0.and.maskb(1+i,j,-1+k).eq.0)then outloc = -0.5 outder = (-U(-1+i,j,-1+k,n)+U(1+i,j,-1+k,n))/(2.d0*hx) else if( maskb(i,j,-1+k).eq.0.and.maskb(1+i,j,-1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,-1+k,n)+4*U(1+i,j,-1+k,n)-U(2+i,j,-1+k,n))/(2.d0 & *hx) else if( maskb(-1+i,j,-1+k).eq.0.and.maskb(i,j,-1+k).eq.0)then outloc = -0.5 outder = (U(-2+i,j,-1+k,n)-4*U(-1+i,j,-1+k,n)+3*U(i,j,-1+k,n))/(2.d & 0*hx) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,1) else outder = 0. endif endif if(maske(1+i,j,k).gt.0) then innder = (U(-2+i,j,k,n)-4*U(-1+i,j,k,n)+3*U(i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,1) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Y do i=lo(1), hi(1) do j=lo(2)+1,hi(2)-1 if( maskb(i,-1+j,-1+k).eq.0.and.maskb(i,1+j,-1+k).eq.0)then outloc = -0.5 outder = (-U(i,-1+j,-1+k,n)+U(i,1+j,-1+k,n))/(2.d0*hy) else if( maskb(i,j,-1+k).eq.0.and.maskb(i,1+j,-1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,-1+k,n)+4*U(i,1+j,-1+k,n)-U(i,2+j,-1+k,n))/(2.d0 & *hy) else if( maskb(i,-1+j,-1+k).eq.0.and.maskb(i,j,-1+k).eq.0)then outloc = -0.5 outder = (U(i,-2+j,-1+k,n)-4*U(i,-1+j,-1+k,n)+3*U(i,j,-1+k,n))/(2.d & 0*hy) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,2) else outder = 0. endif endif innloc = 0.5 innder = (-u(i,-1+j,k,n)+u(i,1+j,k,n))/(2.d0*hy) lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,2) = lambda*innder+(1-lambda)*outder enddo j = lo(2) if( maskb(i,-1+j,-1+k).eq.0.and.maskb(i,1+j,-1+k).eq.0)then outloc = -0.5 outder = (-U(i,-1+j,-1+k,n)+U(i,1+j,-1+k,n))/(2.d0*hy) else if( maskb(i,j,-1+k).eq.0.and.maskb(i,1+j,-1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,-1+k,n)+4*U(i,1+j,-1+k,n)-U(i,2+j,-1+k,n))/(2.d0 & *hy) else if( maskb(i,-1+j,-1+k).eq.0.and.maskb(i,j,-1+k).eq.0)then outloc = -0.5 outder = (U(i,-2+j,-1+k,n)-4*U(i,-1+j,-1+k,n)+3*U(i,j,-1+k,n))/(2.d & 0*hy) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,2) else outder = 0. endif endif if(masks(i,-1+j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,1+j,k,n)-U(i,2+j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,2) = lambda*innder+(1-lambda)*outder j = hi(2) if( maskb(i,-1+j,-1+k).eq.0.and.maskb(i,1+j,-1+k).eq.0)then outloc = -0.5 outder = (-U(i,-1+j,-1+k,n)+U(i,1+j,-1+k,n))/(2.d0*hy) else if( maskb(i,j,-1+k).eq.0.and.maskb(i,1+j,-1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,-1+k,n)+4*U(i,1+j,-1+k,n)-U(i,2+j,-1+k,n))/(2.d0 & *hy) else if( maskb(i,-1+j,-1+k).eq.0.and.maskb(i,j,-1+k).eq.0)then outloc = -0.5 outder = (U(i,-2+j,-1+k,n)-4*U(i,-1+j,-1+k,n)+3*U(i,j,-1+k,n))/(2.d & 0*hy) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,2) else outder = 0. endif endif if(maskn(i,1+j,k).gt.0) then innder = (U(i,-2+j,k,n)-4*U(i,-1+j,k,n)+3*U(i,j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,2) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do j = lo(2), hi(2) do i = lo(1), hi(1) u(i, j, lo(3)-1, n) = cvmgt( $ -u(i,j,lo(3),n), $ u(i,j,lo(3)-1,n), $ maskb(i,j,lo(3)-1) .gt. 0) trander(i,j,lo(3)-1,n,1) = 0. trander(i,j,lo(3)-1,n,2) = 0. enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j,lo(3),n) = cvmgt(-1.0, 0.0, $ maskb(i,j,lo(3)-1) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON FRONT FACE IN APPLYBC' stop endif enddo endif c c The top of the grid c if (cdir .eq. 5) then do n = 1,nc if(is_neumann(bct(n))) then do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j, hi(3)+1,n) = cvmgt( $ u(i,j, hi(3),n), $ u(i,j, hi(3)+1,n), $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j, hi(3),n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part k = hi(3) c ::: ::: X do j=lo(2),hi(2) c ::: ::: ::: interior part of bottom face do i=lo(1)+1,hi(1)-1 innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) trander(i,j,k+1,n,1) = innder enddo i = lo(1) if( maskw(-1+i,j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(1+i,j,k,n)-U(2+i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif trander(i,j,k+1,n,1) = innder i = hi(1) if( maske(1+i,j,k).gt.0) then innder = (U(-2+i,j,k,n)-4*U(-1+i,j,k,n)+3*U(i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif trander(i,j,k+1,n,1) = innder enddo c ::: ::: ::: Y do i=lo(1),hi(1) c ::: ::: ::: interior part of bottom face do j=lo(2)+1,hi(2)-1 innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) trander(i,j,k+1,n,2) = innder enddo j = lo(2) if( masks(i,-1+j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,1+j,k,n)-U(i,2+j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif trander(i,j,k+1,n,2) = innder j = hi(2) if( maskn(i,1+j,k).gt.0) then innder = (U(i,-2+j,k,n)-4*U(i,-1+j,k,n)+3*U(i,j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif trander(i,j,k+1,n,2) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,lenz x(m) = m + 0.5 enddo x(-1) = - bcl/h(3) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenz+2, coef) #if USE_TMP do j = lo(2), hi(2) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) tmp(i-lo(1)) = bcval(i,j, hi(3)+1,n)*coef(-1) enddo else do i = lo(1), hi(1) tmp(i-lo(1)) = 0.0 enddo endif do m = 0, lenz do i = lo(1), hi(1) tmp(i-lo(1)) = tmp(i-lo(1)) $ + u(i, j, hi(3)-m,n)*coef(m) enddo enddo do i = lo(1), hi(1) u(i,j, hi(3)+1,n) = cvmgt( $ tmp(i-lo(1)), $ u(i,j, hi(3)+1,n), $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo #else if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j, hi(3)+1,n) = cvmgt( $ bcval(i,j, hi(3)+1,n)*coef(-1), $ u(i,j, hi(3)+1,n), $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo else do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j, hi(3)+1,n) = cvmgt( $ 0.0, $ u(i,j, hi(3)+1,n), $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo endif do j = lo(2), hi(2) do m = 0, lenz do i = lo(1), hi(1) u(i, j, hi(3)+1,n) = cvmgt( $ u(i,j, hi(3)+1,n) $ + u(i, j, hi(3)-m,n)*coef(m), $ u(i,j, hi(3)+1,n), $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j, hi(3),n) = cvmgt(coef(0), 0.0, $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: interior part first, followed by end points edgloc = 0. k = hi(3) c ::: ::: ::: X do j=lo(2),hi(2) do i=lo(1)+1, hi(1)-1 if( maskt(-1+i,j,1+k).eq.0.and.maskt(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-U(-1+i,j,1+k,n)+U(1+i,j,1+k,n))/(2.d0*hx) else if( maskt(i,j,1+k).eq.0.and.maskt(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,1+k,n)+4*U(1+i,j,1+k,n)-U(2+i,j,1+k,n))/(2.d0*hx & ) else if( maskt(-1+i,j,1+k).eq.0.and.maskt(i,j,1+k).eq.0)then outloc = -0.5 outder = (U(-2+i,j,1+k,n)-4*U(-1+i,j,1+k,n)+3*U(i,j,1+k,n))/(2.d0*h & x) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,1) else outder = 0. endif endif innloc = 0.5 innder = (-u(-1+i,j,k,n)+u(1+i,j,k,n))/(2.d0*hx) lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,1) = lambda*innder+(1-lambda)*outder enddo i = lo(1) if( maskt(-1+i,j,1+k).eq.0.and.maskt(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-U(-1+i,j,1+k,n)+U(1+i,j,1+k,n))/(2.d0*hx) else if( maskt(i,j,1+k).eq.0.and.maskt(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,1+k,n)+4*U(1+i,j,1+k,n)-U(2+i,j,1+k,n))/(2.d0*hx & ) else if( maskt(-1+i,j,1+k).eq.0.and.maskt(i,j,1+k).eq.0)then outloc = -0.5 outder = (U(-2+i,j,1+k,n)-4*U(-1+i,j,1+k,n)+3*U(i,j,1+k,n))/(2.d0*h & x) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,1) else outder = 0. endif endif if(maskw(-1+i,j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(1+i,j,k,n)-U(2+i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,1) = lambda*innder+(1-lambda)*outder i = hi(1) if( maskt(-1+i,j,1+k).eq.0.and.maskt(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-U(-1+i,j,1+k,n)+U(1+i,j,1+k,n))/(2.d0*hx) else if( maskt(i,j,1+k).eq.0.and.maskt(1+i,j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,1+k,n)+4*U(1+i,j,1+k,n)-U(2+i,j,1+k,n))/(2.d0*hx & ) else if( maskt(-1+i,j,1+k).eq.0.and.maskt(i,j,1+k).eq.0)then outloc = -0.5 outder = (U(-2+i,j,1+k,n)-4*U(-1+i,j,1+k,n)+3*U(i,j,1+k,n))/(2.d0*h & x) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,1) else outder = 0. endif endif if(maske(1+i,j,k).gt.0) then innder = (U(-2+i,j,k,n)-4*U(-1+i,j,k,n)+3*U(i,j,k,n))/(2.d0*hx) else innder = (-U(-1+i,j,k,n)+U(1+i,j,k,n))/(2.d0*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,1) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Y do i=lo(1), hi(1) do j=lo(2)+1,hi(2)-1 if( maskt(i,-1+j,1+k).eq.0.and.maskt(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-U(i,-1+j,1+k,n)+U(i,1+j,1+k,n))/(2.d0*hy) else if( maskt(i,j,1+k).eq.0.and.maskt(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,1+k,n)+4*U(i,1+j,1+k,n)-U(i,2+j,1+k,n))/(2.d0*hy & ) else if( maskt(i,-1+j,1+k).eq.0.and.maskt(i,j,1+k).eq.0)then outloc = -0.5 outder = (U(i,-2+j,1+k,n)-4*U(i,-1+j,1+k,n)+3*U(i,j,1+k,n))/(2.d0*h & y) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,2) else outder = 0. endif endif innloc = 0.5 innder = (-u(i,-1+j,k,n)+u(i,1+j,k,n))/(2.d0*hy) lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,2) = lambda*innder+(1-lambda)*outder enddo j = lo(2) if( maskt(i,-1+j,1+k).eq.0.and.maskt(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-U(i,-1+j,1+k,n)+U(i,1+j,1+k,n))/(2.d0*hy) else if( maskt(i,j,1+k).eq.0.and.maskt(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,1+k,n)+4*U(i,1+j,1+k,n)-U(i,2+j,1+k,n))/(2.d0*hy & ) else if( maskt(i,-1+j,1+k).eq.0.and.maskt(i,j,1+k).eq.0)then outloc = -0.5 outder = (U(i,-2+j,1+k,n)-4*U(i,-1+j,1+k,n)+3*U(i,j,1+k,n))/(2.d0*h & y) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,2) else outder = 0. endif endif if(masks(i,-1+j,k).gt.0) then innder = (-3*U(i,j,k,n)+4*U(i,1+j,k,n)-U(i,2+j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,2) = lambda*innder+(1-lambda)*outder j = hi(2) if( maskt(i,-1+j,1+k).eq.0.and.maskt(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-U(i,-1+j,1+k,n)+U(i,1+j,1+k,n))/(2.d0*hy) else if( maskt(i,j,1+k).eq.0.and.maskt(i,1+j,1+k).eq.0)then outloc = -0.5 outder = (-3*U(i,j,1+k,n)+4*U(i,1+j,1+k,n)-U(i,2+j,1+k,n))/(2.d0*hy & ) else if( maskt(i,-1+j,1+k).eq.0.and.maskt(i,j,1+k).eq.0)then outloc = -0.5 outder = (U(i,-2+j,1+k,n)-4*U(i,-1+j,1+k,n)+3*U(i,j,1+k,n))/(2.d0*h & y) else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,2) else outder = 0. endif endif if(maskn(i,1+j,k).gt.0) then innder = (U(i,-2+j,k,n)-4*U(i,-1+j,k,n)+3*U(i,j,k,n))/(2.d0*hy) else innder = (-U(i,-1+j,k,n)+U(i,1+j,k,n))/(2.d0*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,2) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do j = lo(2), hi(2) do i = lo(1), hi(1) u(i, j, hi(3)+1, n) = cvmgt( $ -u(i,j,hi(3),n), $ u(i,j,hi(3)+1,n), $ maskt(i,j,hi(3)+1) .gt. 0) trander(i,j,hi(3)+1,n,1) = 0. trander(i,j,hi(3)+1,n,2) = 0. enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j,hi(3),n) = cvmgt(-1.0, 0.0, $ maskt(i,j,hi(3)+1) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON BACK FACE IN APPLYBC' stop endif enddo endif end ccseapps-2.5/CCSEApps/tensorMG/DV_3D3.F0000644000175000017500000047455411634153073020471 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include "DivVis_F.H" #include #include "ArrayLim.H" c :::: usage: c :::: this .mF file is meant to be run through Mathematica. This converts c :::: compact symbolic expressions into fortran which is stored in a .F c :::: file. c---------------------------------------------------------------- c this is the fortran support file for the the operator c L(U) = alpha*a(x)*U - beta*Div( tau ) c c where U is the two component vector (u,v) and c tau is a three by three tensor c tau = | t_xx t_xy t_xz| c | t_xy t_yy t_yz| c | t_xz t_yz t_zz| c c t_xx = 2*mu * u_x c t_yy = 2*mu * v_y c t_zz = 2*mu * w_z c t_xy = mu*(u_y + v_x) c t_xz = mu*(u_z + w_x) c t_yz = mu*(v_z + w_y) c ::: define standard replacements used by Mathematica c ::: see file visc3d.ma c ::: Null c ::: interface notes: c ::: 1) trander* ALWAYS have values in them, even if the cells are c ::: all covered. Might as well. These are edge located derivative c ::: values. In index space, they are located the same as the mask c ::: cells. Which is somewhat anomalous. These are edge values, after c ::: all. While the masks are cell-centered. But it seems easier c ::: at the moment. c ::: 2) the normal derivatives are evaluated in the normal fashion. c ::: 3) tangential derivatives which reach outside the rectangle DO have c ::: to check the masks. subroutine FORT_GSRB( $ u, DIMS(u), $ rhs, DIMS(rhs), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ muZ, DIMS(muZ), $ maskn,DIMS(maskn), $ fn, DIMS(fn), $ maske,DIMS(maske), $ fe, DIMS(fe), $ maskw,DIMS(maskw), $ fw, DIMS(fw), $ masks,DIMS(masks), $ fs, DIMS(fs), $ maskt,DIMS(maskt), $ ft, DIMS(ft), $ maskb,DIMS(maskb), $ fb, DIMS(fb), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ trandert,DIMS(trandert), $ tranderb,DIMS(tranderb), $ lo,hi,h,ncomp,phaseflag $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(rhs) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(muZ) integer DIMDEC(maskn) integer DIMDEC(fn) integer DIMDEC(maske) integer DIMDEC(fe) integer DIMDEC(maskw) integer DIMDEC(fw) integer DIMDEC(masks) integer DIMDEC(fs) integer DIMDEC(maskt) integer DIMDEC(ft) integer DIMDEC(maskb) integer DIMDEC(fb) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer DIMDEC(trandert) integer DIMDEC(tranderb) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) integer ncomp integer phaseflag REAL_T h(BL_SPACEDIM) REAL_T u(DIMV(u),3) REAL_T rhs(DIMV(rhs),3) REAL_T a(DIMV(a)) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) REAL_T muZ(DIMV(muZ)) integer maskn(DIMV(maskn)) REAL_T fn(DIMV(fn),3) integer maske(DIMV(maske)) REAL_T fe(DIMV(fe),3) integer maskw(DIMV(maskw)) REAL_T fw(DIMV(fw),3) integer masks(DIMV(masks)) REAL_T fs(DIMV(fs),3) integer maskt(DIMV(maskt)) REAL_T ft(DIMV(ft),3) integer maskb(DIMV(maskb)) REAL_T fb(DIMV(fb),3) c ::: for transverse derives, first 3 is for variable, second 3 is for c ::: direction of derivative. Obviously not all are used, but this is easy. REAL_T trandern(DIMV(trandern),3,3) REAL_T trandere(DIMV(trandere),3,3) REAL_T tranderw(DIMV(tranderw),3,3) REAL_T tranders(DIMV(tranders),3,3) REAL_T trandert(DIMV(trandert),3,3) REAL_T tranderb(DIMV(tranderb),3,3) integer i,j,k REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy,hz REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw REAL_T dudyn,dudys REAL_T dvdxe,dvdxw REAL_T dvdxn,dvdxs REAL_T dudzb,dudzt REAL_T dwdzt,dwdzb REAL_T dwdxb,dwdxt REAL_T dvdzb,dvdzt REAL_T dwdyb,dwdyt REAL_T dudzw,dudze REAL_T dwdxw,dwdxe REAL_T dvdzs,dvdzn REAL_T dwdys,dwdyn integer modx,mody,modz integer istart,jstart,kstart REAL_T diagu,diagv,diagw REAL_T operu,operv,operw logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) hz = h(3) if( ncomp .ne. 3 ) then write(6,*)'FORT_GSRB: bad ncomp',ncomp stop endif c ::: convert phase flag into modx and mody and modz if( phaseflag.eq.0 ) then modx = 0 mody = 0 modz = 0 elseif(phaseflag.eq.1) then modx = 1 mody = 0 modz = 0 elseif(phaseflag.eq.2) then modx = 0 mody = 1 modz = 0 elseif(phaseflag.eq.3) then modx = 1 mody = 1 modz = 0 elseif(phaseflag.eq.4) then modx = 0 mody = 0 modz = 1 elseif(phaseflag.eq.5) then modx = 1 mody = 0 modz = 1 elseif(phaseflag.eq.6) then modx = 0 mody = 1 modz = 1 elseif(phaseflag.eq.7) then modx = 1 mody = 1 modz = 1 else write(6,*)'FORT_GSRB: bad phaseflag', phaseflag stop endif c ::: cases: c ::: 0) interior. All usual derivative expressions c ::: 1-6) face but not on edge. c ::: 7-18) edge but not on corner. c ::: 19-26) corners. c ::: case 0 c ::: Null c ::: Null istart = lo(1)+1 if( mod(istart,2) .ne. modx ) istart = istart+1 jstart = lo(2)+1 if( mod(jstart,2) .ne. mody ) jstart = jstart+1 kstart = lo(3)+1 if( mod(kstart,2) .ne. modz ) kstart = kstart+1 do k=kstart,hi(3)-1,2 do j=jstart,hi(2)-1,2 do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: in interior, diagonal elements need no corrections c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo enddo c ::: case 1, top face c ::: Null c ::: Null c ::: Null k=hi(3) if( mod(k,2) .eq. modz ) then do j=jstart,hi(2)-1,2 do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=trandert(i,j,1+k,3,1) dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 2, bottom face c ::: Null c ::: Null c ::: Null k=lo(3) if( mod(k,2).eq.modz) then do j=jstart,hi(2)-1,2 do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=tranderb(i,j,-1+k,3,1) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) dwdyb=tranderb(i,j,-1+k,3,2) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 3, west face c ::: Null c ::: Null c ::: Null i = lo(1) if( mod(i,2) .eq. modx) then do k=kstart,hi(3)-1,2 do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=tranderw(-1+i,j,k,1,2) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) dudzw=tranderw(-1+i,j,k,1,3) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 4, east face c ::: Null c ::: Null c ::: Null i = hi(1) if( mod(i,2).eq.modx) then do k=kstart,hi(3)-1,2 do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=trandere(1+i,j,k,1,2) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=trandere(1+i,j,k,1,3) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 5, north face c ::: Null c ::: Null c ::: Null j = hi(2) if( mod(j,2).eq.mody) then do k=kstart,hi(3)-1,2 do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=trandern(i,1+j,k,2,1) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=trandern(i,1+j,k,2,3) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 6, south face c ::: Null c ::: Null c ::: Null j = lo(2) if( mod(j,2).eq.mody) then do k=kstart,hi(3)-1,2 do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=tranders(i,-1+j,k,2,1) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=tranders(i,-1+j,k,2,3) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 7, top-north edge c ::: Null c ::: Null c ::: Null k=hi(3) j=hi(2) if( mod(k,2).eq.modz .and. mod(j,2).eq.mody ) then do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=trandern(i,1+j,k,2,1) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=trandert(i,j,1+k,3,1) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,1)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 8, top-south edge c ::: Null k=hi(3) j=lo(2) if( mod(k,2).eq.modz .and. mod(j,2).eq.mody) then do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=tranders(i,-1+j,k,2,1) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=trandert(i,j,1+k,3,1) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif dvdzs=tranders(i,-1+j,k,2,3) if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 9, top-west edge c ::: Null k=hi(3) i=lo(1) if( mod(k,2).eq.modz .and. mod(i,2).eq.modx ) then do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=tranderw(-1+i,j,k,1,2) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=trandert(i,j,1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 10, top-east edge c ::: Null k=hi(3) i=hi(1) if( mod(k,2).eq.modz .and. mod(i,2).eq.modx) then do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=trandere(1+i,j,k,1,2) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 11, bottom-north edge c ::: Null k=lo(3) j=hi(2) if( mod(k,2).eq.modz .and. mod(j,2).eq.mody) then do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=trandern(i,1+j,k,2,1) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=tranderb(i,j,-1+k,3,1) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) dwdyb=tranderb(i,j,-1+k,3,2) if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 12, bottom-south edge c ::: Null k=lo(3) j=lo(2) if( mod(k,2).eq.modz .and. mod(j,2).eq.mody ) then do i=istart,hi(1)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=tranders(i,-1+j,k,2,1) dwdxb=tranderb(i,j,-1+k,3,1) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) dwdyb=tranderb(i,j,-1+k,3,2) if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif dvdzs=tranders(i,-1+j,k,2,3) if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 13, bottom-west edge c ::: Null k=lo(3) i=lo(1) if( mod(k,2).eq.modz .and. mod(i,2).eq.modx) then do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=tranderw(-1+i,j,k,1,2) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dwdyb=tranderb(i,j,-1+k,3,2) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) dudzw=tranderw(-1+i,j,k,1,3) if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 14, bottom-east edge c ::: Null k=lo(3) i=hi(1) if( mod(k,2).eq.modz .and. mod(i,2).eq.modx ) then do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dwdyb=tranderb(i,j,-1+k,3,2) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 15, east-north edge c ::: Null j=hi(2) i=hi(1) if( mod(j,2).eq.mody .and. mod(i,2).eq.modx ) then do k=kstart,hi(3)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=trandere(1+i,j,k,1,3) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=trandern(i,1+j,k,2,3) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 16, east-south edge c ::: Null j=lo(2) i=hi(1) if( mod(j,2).eq.mody .and. mod(i,2).eq.modx ) then do k=kstart,hi(3)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=trandere(1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 17, west-north edge c ::: Null j=hi(2) i=lo(1) if( mod(j,2).eq.mody .and. mod(i,2).eq.modx ) then do k=kstart,hi(3)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=tranderw(-1+i,j,k,1,3) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=trandern(i,1+j,k,2,3) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 18, west-south edge c ::: Null j=lo(2) i=lo(1) if( mod(j,2).eq.mody .and. mod(i,2).eq.modx ) then do k=kstart,hi(3)-1,2 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=tranderw(-1+i,j,k,1,3) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=tranders(i,-1+j,k,2,3) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fw(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fw(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 19, top-north-east corner c ::: Null k=hi(3) j=hi(2) i=hi(1) if( mod(k,2).eq.modz .and. mod(j,2).eq.mody .and. mod(i,2).eq.modx ) then c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dudye=trandere(1+i,j,k,1,2) if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 20, top-north-west corner c ::: Null i=lo(1) j=hi(2) k=hi(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 21, top-south-east corner c ::: Null i=hi(1) j=lo(2) k=hi(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dudye=trandere(1+i,j,k,1,2) if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 22, top-south-west corner c ::: Null i=lo(1) j=lo(2) k=hi(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif dvdzs=tranders(i,-1+j,k,2,3) if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 23, bottom-north-east corner c ::: Null i=hi(1) j=hi(2) k=lo(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dwdyb=tranderb(i,j,-1+k,3,2) if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 24, bottom-north-west corner c ::: Null i=lo(1) j=hi(2) k=lo(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) dwdyb=tranderb(i,j,-1+k,3,2) if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=tranderw(-1+i,j,k,1,3) if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 25, bottom-south-east corner c ::: Null i=hi(1) j=lo(2) k=lo(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) dwdxb=tranderb(i,j,-1+k,3,1) if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dwdyb=tranderb(i,j,-1+k,3,2) if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 26, bottom-south-west corner c ::: Null i=lo(1) j=lo(2) k=lo(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) dwdxb=tranderb(i,j,-1+k,3,1) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) dwdyb=tranderb(i,j,-1+k,3,2) if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=tranderw(-1+i,j,k,1,3) if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif dvdzs=tranders(i,-1+j,k,2,3) if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) operv = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) operw = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif return end ccseapps-2.5/CCSEApps/tensorMG/DV_2D.mF0000644000175000017500000032147611634153073020554 0ustar amckinstryamckinstry#include #include "DivVis_F.H" #include #include "ArrayLim.H" c :::: usage: c :::: this .mF file is meant to be run through Mathematica. This converts c :::: compact symbolic expressions into fortran which is stored in a .F c :::: file. c---------------------------------------------------------------- c this is the fortran support file for the the operator c L(U) = alpha*a(x)*U - beta*Div( tau ) c c where U is the two component vector (u,v) and c tau is a two by two tensor c tau = | t_xx t_xy | c | t_xy t_yy | c c t_xx = 2*mu * u_x c t_xy = mu*(u_y + v_x) c t_yy = 2*mu * v_y c and alpha is a diagonal 2x2 matrix, says rick c ::: define standard replacements used by Mathematica c ::: see file visc2d.ma c ::: <* standardrepl = { dudx[i+half ,j ]->dudxe, dudx[i-1+half,j ]->dudxw, dvdy[i,j+half]-> dvdyn , dvdy[i,j-1+half]-> dvdys , dudy[i,j +half]-> dudyn , dudy[i,j-1+half]-> dudys , dudy[i+half,j]-> dudye , dudy[i-1+half,j]-> dudyw , dvdx[i,j +half]-> dvdxn , dvdx[i,j-1+half]-> dvdxs , dvdx[i+half,j]-> dvdxe , dvdx[i-1+half,j]-> dvdxw , murepl1, murepl2, tauxxdef, tauyydef, tauxydef,vol->hx*hy }; *> c ::: interface notes: c ::: 1) trander* ALWAYS have values in them, even if the cells are c ::: all covered. Might as well. These are edge located derivative c ::: values. In index space, they are located the same as the mask c ::: cells. Which is somewhat anomalous. These are edge values, after c ::: all. While the masks are cell-centered. But it seems easier c ::: at the moment. c ::: 2) the normal derivatives are evaluated in the normal fashion. c ::: 3) tangential derivatives which reach outside the rectangle DO have c ::: to check the masks. subroutine FORT_DVAPPLY( $ u, DIMS(u), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ out, DIMS(out), $ maskn,DIMS(maskn), $ maske,DIMS(maske), $ maskw,DIMS(maskw), $ masks,DIMS(masks), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ lo,hi,h $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(out) integer DIMDEC(maskn) integer DIMDEC(maske) integer DIMDEC(maskw) integer DIMDEC(masks) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) REAL_T h(BL_SPACEDIM) REAL_T u(DIMV(u),2) REAL_T a(DIMV(a),2) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) REAL_T out(DIMV(out),2) integer maskn(DIMV(maskn)) integer maske(DIMV(maske)) integer maskw(DIMV(maskw)) integer masks(DIMV(masks)) REAL_T trandern(DIMV(trandern),2) REAL_T trandere(DIMV(trandere),2) REAL_T tranderw(DIMV(tranderw),2) REAL_T tranders(DIMV(tranders),2) integer i,j REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw,dudyn,dudys REAL_T dvdxe,dvdxw,dvdxn,dvdxs logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) c ::: make some mathematica definitions c ::: allDerivAllUV makes replacements for the deriv expressions and c ::: maps U and V to the correct values c ::: <* allDerivAllUV = {dudxdef,dvdydef,dudydef1,dudydef2, dvdxdef1,dvdxdef2,urepl,vrepl} ; *> c ::: cases: c ::: 1) interior. All normal derivative expressions c ::: 2) edge but not on corner. check mask value to see if use outside c ::: value or use interpolations c ::: 3) corners. Must check mask values to see if use outside values c ::: values or use interpolations ON TWO SIDES. But must also c ::: check to see if need to do one-sided derivs for tangential c ::: derivatives. c ::: case 1 do j=lo(2)+1,hi(2)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = <* dudy[i+half,j] //. allDerivAllUV *> dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression out(i,j,1) = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> out(i,j,2) = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> enddo enddo c ::: ::: case 2a: north side c ::: <* indexcond = Function[ {i,j}, (j>0) ] ; *> c ::: <* maskray = maskn ; *> c ::: j = hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i+half,j] //. allDerivAllUV, indexcond,maskray] *> ) then dudye = <* (DOneY[u,i ,j,-1]+ DOneY[u,i+1,j,-1])/2 //. allDerivAllUV *> else dudye = <* dudy[i+half,j] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,maskray] *> ) then dudyw = <* (DOneY[u,i ,j,-1]+ DOneY[u,i-1,j,-1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif dvdxn = trandern(i,j+1,2) dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression out(i,j,1) = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> out(i,j,2) = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> enddo c ::: case 2b south side c ::: <* indexcond = Function[ {i,j}, (j<0) ] ; *> c ::: <* maskray = masks ; *> j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i+half,j] //. allDerivAllUV, indexcond,maskray] *> ) then dudye = <* (DOneY[u,i ,j,+1]+ DOneY[u,i+1,j,+1])/2 //. allDerivAllUV *> else dudye = <* dudy[i+half,j] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,maskray] *> ) then dudyw = <* (DOneY[u,i ,j,+1]+ DOneY[u,i-1,j,+1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> dvdxs = tranders(i,j-1,2) dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression out(i,j,1) = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> out(i,j,2) = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> enddo c ::: case 2c: west side story c ::: <* indexcond = Function[ {i,j}, (i<0) ] ; *> c ::: <* maskray = maskw ; *> i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = <* dudy[i+half,j] //. allDerivAllUV *> dudyw = tranderw(i-1,j,1) if( <* dependentCellsNotCovered[dvdx[i,j+half] //. allDerivAllUV, indexcond, maskray] *> ) then dvdxn = <* (DOneX[v,i,j ,+1]+ DOneX[v,i,j+1,+1])/2 //. allDerivAllUV *> else dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond, maskray] *> ) then dvdxs = <* (DOneX[v,i,j ,+1]+ DOneX[v,i,j-1,+1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression out(i,j,1) = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> out(i,j,2) = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> enddo c ::: case 2d: east side story c ::: <* indexcond = Function[ {i,j}, (i>0) ] ; *> c ::: <* maskray = maske ; *> i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = trandere(i+1,j,1) dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dvdx[i,j+half] //. allDerivAllUV, indexcond, maskray] *> ) then dvdxn = <* (DOneX[v,i,j ,-1]+ DOneX[v,i,j+1,-1])/2 //. allDerivAllUV *> else dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond, maskray] *> ) then dvdxs = <* (DOneX[v,i,j ,-1]+ DOneX[v,i,j-1,-1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression out(i,j,1) = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> out(i,j,2) = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> enddo c ::: case 3a: north-east corner c ::: <* indexcond = Function[ {i,j}, (i>0)||(j>0) ] ; *> c ::: <* Clear[ maskray ] ; *> j=hi(2) i=hi(1) c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = trandere(i+1,j,1) if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,maskn] *> ) then dudyw = <* (DOneY[u,i-1,j,-1]+ DOneY[u,i ,j,-1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif dvdxn = trandern(i,j+1,2) if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond,maske] *> ) then dvdxs = <* (DOneX[v,i,j-1,-1]+ DOneX[v,i,j ,-1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression out(i,j,1) = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> out(i,j,2) = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: case 3b: south-east corner, plus i, minus j, plus i, plus j c ::: <* indexcond = Function[ {i,j}, (i>0)||(j<0) ] ; *> j=lo(2) i=hi(1) c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = trandere(i+1,j,1) if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,masks] *> ) then dudyw = <* (DOneY[u,i-1,j,+1]+ DOneY[u,i ,j,+1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dvdx[i,j+half] //. allDerivAllUV, indexcond,maske] *> ) then dvdxn = <* (DOneX[v,i,j+1,-1]+ DOneX[v,i,j ,-1])/2 //. allDerivAllUV *> else dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> endif dvdxs = tranders(i,j-1,2) dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression out(i,j,1) = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> out(i,j,2) = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: case 3c: south-west corner, minus i, minus j c ::: <* indexcond = Function[ {i,j}, (i<0)||(j<0) ] ; *> j=lo(2) i=lo(1) c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i+half,j] //. allDerivAllUV, indexcond,masks] *> ) then dudye = <* (DOneY[u,i+1,j,+1]+ DOneY[u,i ,j,+1])/2 //. allDerivAllUV *> else dudye = <* dudy[i+half,j] //. allDerivAllUV *> endif dudyw = tranderw(i-1,j,1) if( <* dependentCellsNotCovered[dvdx[i,j+half] //. allDerivAllUV, indexcond,maskw] *> ) then dvdxn = <* (DOneX[v,i,j+1,+1]+ DOneX[v,i,j ,+1])/2 //. allDerivAllUV *> else dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> endif dvdxs = tranders(i,j-1,2) dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression out(i,j,1) = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> out(i,j,2) = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: case 3d: north-west corner, minus i, plus j c ::: <* indexcond = Function[ {i,j}, (i<0)||(j>0) ] ; *> j=hi(2) i=lo(1) c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i+half,j] //. allDerivAllUV, indexcond,maskn] *> ) then dudye = <* (DOneY[u,i+1,j,-1]+ DOneY[u,i ,j,-1])/2 //. allDerivAllUV *> else dudye = <* dudy[i+half,j] //. allDerivAllUV *> endif dudyw = tranderw(i-1,j,1) dvdxn = trandern(i,j+1,2) if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond,maskw] *> ) then dvdxs = <* (DOneX[v,i,j-1,+1]+ DOneX[v,i,j ,+1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression out(i,j,1) = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> out(i,j,2) = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> return end c ------------------------------------------------------------------- c ... a point of interpretation here: lo and hi are the covered area in c ... cell centered coordinates. The dimension of the x and y fluxes have c ... to be at least one larger in the appropriate direction. c ... we use the "usual" interpretation of fluxes: cell i has a left flux c ... numbered i and a right flux numbered i+1 subroutine FORT_DVFLUX( $ u, DIMS(u), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ xflux,DIMS(xflux), $ yflux,DIMS(yflux), $ maskn,DIMS(maskn), $ maske,DIMS(maske), $ maskw,DIMS(maskw), $ masks,DIMS(masks), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ lo,hi,h $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(xflux) integer DIMDEC(yflux) integer DIMDEC(maskn) integer DIMDEC(maske) integer DIMDEC(maskw) integer DIMDEC(masks) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) REAL_T h(BL_SPACEDIM) REAL_T u(DIMV(u),2) REAL_T a(DIMV(a),2) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) REAL_T xflux(DIMV(xflux),2) REAL_T yflux(DIMV(yflux),2) integer maskn(DIMV(maskn)) integer maske(DIMV(maske)) integer maskw(DIMV(maskw)) integer masks(DIMV(masks)) REAL_T trandern(DIMV(trandern),2) REAL_T trandere(DIMV(trandere),2) REAL_T tranderw(DIMV(tranderw),2) REAL_T tranders(DIMV(tranders),2) integer i,j REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw,dudyn,dudys REAL_T dvdxe,dvdxw,dvdxn,dvdxs logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) c ::: make some mathematica definitions c ::: allDerivAllUV makes replacements for the deriv expressions and c ::: maps U and V to the correct values c ::: <* allDerivAllUV = {dudxdef,dvdydef,dudydef1,dudydef2, dvdxdef1,dvdxdef2,urepl,vrepl} ; *> c ::: cases: c ::: 1) interior. All normal derivative expressions c ::: 2) edge but not on corner. check mask value to see if use outside c ::: value or use interpolations c ::: 3) corners. Must check mask values to see if use outside values c ::: values or use interpolations ON TWO SIDES. But must also c ::: check to see if need to do one-sided derivs for tangential c ::: derivatives. c ::: case 1 do j=lo(2)+1,hi(2) do i=lo(1)+1,hi(1) c ::: get expressions for appropriate derivatives dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression xflux(i,j,1) = -(<* tauxx[i-1+half,j] //. standardrepl *>) xflux(i,j,2) = -(<* tauxy[i-1+half,j] //. standardrepl *>) yflux(i,j,1) = -(<* tauxy[i,j-1+half] //. standardrepl *>) yflux(i,j,2) = -(<* tauyy[i,j-1+half] //. standardrepl *>) enddo enddo c ::: ::: case 2a: north side c ::: <* indexcond = Function[ {i,j}, (j>0) ] ; *> c ::: <* maskray = maskn ; *> c ::: j = hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for appropriate derivatives dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,maskray] *> ) then dudyw = <* (DOneY[u,i ,j,-1]+ DOneY[u,i-1,j,-1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif dvdxn = trandern(i,j+1,2) dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression xflux(i,j,1) = -(<* tauxx[i-1+half,j] //. standardrepl *>) xflux(i,j,2) = -(<* tauxy[i-1+half,j] //. standardrepl *>) yflux(i,j+1,1) = -(<* tauxy[i,j+half] //. standardrepl *>) yflux(i,j+1,2) = -(<* tauyy[i,j+half] //. standardrepl *>) enddo c ::: case 2b south side c ::: <* indexcond = Function[ {i,j}, (j<0) ] ; *> c ::: <* maskray = masks ; *> j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for appropriate derivatives dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,maskray] *> ) then dudyw = <* (DOneY[u,i ,j,+1]+ DOneY[u,i-1,j,+1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif dvdxs = tranders(i,j-1,2) dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression xflux(i,j,1) = -(<* tauxx[i-1+half,j] //. standardrepl *>) xflux(i,j,2) = -(<* tauxy[i-1+half,j] //. standardrepl *>) yflux(i,j,1) = -(<* tauxy[i,j-1+half] //. standardrepl *>) yflux(i,j,2) = -(<* tauyy[i,j-1+half] //. standardrepl *>) enddo c ::: case 2c: west side story c ::: <* indexcond = Function[ {i,j}, (i<0) ] ; *> c ::: <* maskray = maskw ; *> i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for appropriate derivatives dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudyw = tranderw(i-1,j,1) if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond, maskray] *> ) then dvdxs = <* (DOneX[v,i,j ,+1]+ DOneX[v,i,j-1,+1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression xflux(i,j,1) = -(<* tauxx[i-1+half,j] //. standardrepl *>) xflux(i,j,2) = -(<* tauxy[i-1+half,j] //. standardrepl *>) yflux(i,j,1) = -(<* tauxy[i,j-1+half] //. standardrepl *>) yflux(i,j,2) = -(<* tauyy[i,j-1+half] //. standardrepl *>) enddo c ::: case 2d: east side story c ::: <* indexcond = Function[ {i,j}, (i>0) ] ; *> c ::: <* maskray = maske ; *> i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = trandere(i+1,j,1) if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond, maskray] *> ) then dvdxs = <* (DOneX[v,i,j ,-1]+ DOneX[v,i,j-1,-1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> c ::: evaluate expression xflux(i+1,j,1) = -(<* tauxx[i+half,j] //. standardrepl *>) xflux(i+1,j,2) = -(<* tauxy[i+half,j] //. standardrepl *>) yflux(i,j,1) = -(<* tauxy[i,j-1+half] //. standardrepl *>) yflux(i,j,2) = -(<* tauyy[i,j-1+half] //. standardrepl *>) enddo c ::: case 3a: north-east corner c ::: <* indexcond = Function[ {i,j}, (i>0)||(j>0) ] ; *> c ::: <* Clear[ maskray ] ; *> j=hi(2) i=hi(1) c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = trandere(i+1,j,1) if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,maskn] *> ) then dudyw = <* (DOneY[u,i-1,j,-1]+ DOneY[u,i ,j,-1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif dvdxn = trandern(i,j+1,2) if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond,maske] *> ) then dvdxs = <* (DOneX[v,i,j-1,-1]+ DOneX[v,i,j ,-1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression xflux(i,j,1) = -(<* tauxx[i-1+half,j] //. standardrepl *>) xflux(i,j,2) = -(<* tauxy[i-1+half,j] //. standardrepl *>) xflux(i+1,j,1) = -(<* tauxx[i+half,j] //. standardrepl *>) xflux(i+1,j,2) = -(<* tauxy[i+half,j] //. standardrepl *>) yflux(i,j,1) = -(<* tauxy[i,j-1+half] //. standardrepl *>) yflux(i,j,2) = -(<* tauyy[i,j-1+half] //. standardrepl *>) yflux(i,j+1,1) = -(<* tauxy[i,j+half] //. standardrepl *>) yflux(i,j+1,2) = -(<* tauyy[i,j+half] //. standardrepl *>) c ::: case 3b: south-east corner, plus i, minus j, plus i, plus j c ::: <* indexcond = Function[ {i,j}, (i>0)||(j<0) ] ; *> j=lo(2) i=hi(1) c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = trandere(i+1,j,1) if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,masks] *> ) then dudyw = <* (DOneY[u,i-1,j,+1]+ DOneY[u,i ,j,+1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dvdx[i,j+half] //. allDerivAllUV, indexcond,maske] *> ) then dvdxn = <* (DOneX[v,i,j+1,-1]+ DOneX[v,i,j ,-1])/2 //. allDerivAllUV *> else dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> endif dvdxs = tranders(i,j-1,2) dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression xflux(i,j,1) = -(<* tauxx[i-1+half,j] //. standardrepl *>) xflux(i,j,2) = -(<* tauxy[i-1+half,j] //. standardrepl *>) xflux(i+1,j,1) = -(<* tauxx[i+half,j] //. standardrepl *>) xflux(i+1,j,2) = -(<* tauxy[i+half,j] //. standardrepl *>) yflux(i,j,1) = -(<* tauxy[i,j-1+half] //. standardrepl *>) yflux(i,j,2) = -(<* tauyy[i,j-1+half] //. standardrepl *>) yflux(i,j+1,1) = -(<* tauxy[i,j+half] //. standardrepl *>) yflux(i,j+1,2) = -(<* tauyy[i,j+half] //. standardrepl *>) c ::: case 3c: south-west corner, minus i, minus j c ::: <* indexcond = Function[ {i,j}, (i<0)||(j<0) ] ; *> j=lo(2) i=lo(1) c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i+half,j] //. allDerivAllUV, indexcond,masks] *> ) then dudye = <* (DOneY[u,i+1,j,+1]+ DOneY[u,i ,j,+1])/2 //. allDerivAllUV *> else dudye = <* dudy[i+half,j] //. allDerivAllUV *> endif dudyw = tranderw(i-1,j,1) if( <* dependentCellsNotCovered[dvdx[i,j+half] //. allDerivAllUV, indexcond,maskw] *> ) then dvdxn = <* (DOneX[v,i,j+1,+1]+ DOneX[v,i,j ,+1])/2 //. allDerivAllUV *> else dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> endif dvdxs = tranders(i,j-1,2) dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression xflux(i,j,1) = -(<* tauxx[i-1+half,j] //. standardrepl *>) xflux(i,j,2) = -(<* tauxy[i-1+half,j] //. standardrepl *>) xflux(i+1,j,1) = -(<* tauxx[i+half,j] //. standardrepl *>) xflux(i+1,j,2) = -(<* tauxy[i+half,j] //. standardrepl *>) yflux(i,j,1) = -(<* tauxy[i,j-1+half] //. standardrepl *>) yflux(i,j,2) = -(<* tauyy[i,j-1+half] //. standardrepl *>) yflux(i,j+1,1) = -(<* tauxy[i,j+half] //. standardrepl *>) yflux(i,j+1,2) = -(<* tauyy[i,j+half] //. standardrepl *>) c ::: case 3d: north-west corner, minus i, plus j c ::: <* indexcond = Function[ {i,j}, (i<0)||(j>0) ] ; *> j=hi(2) i=lo(1) c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i+half,j] //. allDerivAllUV, indexcond,maskn] *> ) then dudye = <* (DOneY[u,i+1,j,-1]+ DOneY[u,i ,j,-1])/2 //. allDerivAllUV *> else dudye = <* dudy[i+half,j] //. allDerivAllUV *> endif dudyw = tranderw(i-1,j,1) dvdxn = trandern(i,j+1,2) if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond,maskw] *> ) then dvdxs = <* (DOneX[v,i,j-1,+1]+ DOneX[v,i,j ,+1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: evaluate expression xflux(i,j,1) = -(<* tauxx[i-1+half,j] //. standardrepl *>) xflux(i,j,2) = -(<* tauxy[i-1+half,j] //. standardrepl *>) xflux(i+1,j,1) = -(<* tauxx[i+half,j] //. standardrepl *>) xflux(i+1,j,2) = -(<* tauxy[i+half,j] //. standardrepl *>) yflux(i,j,1) = -(<* tauxy[i,j-1+half] //. standardrepl *>) yflux(i,j,2) = -(<* tauyy[i,j-1+half] //. standardrepl *>) yflux(i,j+1,1) = -(<* tauxy[i,j+half] //. standardrepl *>) yflux(i,j+1,2) = -(<* tauyy[i,j+half] //. standardrepl *>) return end c----------------------------------------------------------------------- subroutine FORT_APPLYBC ( $ flagden, flagbc, maxorder, $ u, DIMS(u), $ cdir, bct, bcl, $ bcval, DIMS(bcval), $ mask, DIMS(mask), $ maskp, DIMS(maskp), $ maskm, DIMS(maskm), $ den, DIMS(den), $ exttd, DIMS(exttd), $ tander,DIMS(tander), $ lo, hi, nc, $ h $ ) c c If the boundary is of Neumann type, set the ghost cell value to c that of the outermost point in the valid data (2nd order accurate) c and then fill the "den" array with the value "1" c c c If flagbc==1: c c If the boundary is of Dirichlet type, construct a polynomial c interpolation through the boundary location and internal points c (at locations x(-1:len-2) that generates the ghost cell value (at c location xInt). Then fill the ghost cell with the interpolated value. c If flagden==1, load the "den" array with the interpolation c coefficient corresponding to outermost point in the valid region c ( the coef(0) corresponding to the location x(0) ) c c Note: c The bc type = LO_REFLECT_ODD is a special type of boundary condition. c ::: the old FORT_APPLYBC put values out in ghost cells. The new c ::: FORT_APPLYBC makes a distinction between normal and tangential derivs. c ::: the normal derivatives are still evaluated with ghost cells ( and c ::: the den array for adjusting the diagonal element). Tangential c ::: derivatives are NOT computed from the ghost cells (note: we are c ::: discussing here the tangential derivates which are centered on the c ::: external cells walls of the rectangular domain. Internal tangential c ::: derivatives whose stencil extends outside the rectangular domain have c ::: still ANOTHER calculational trick, one sided derivatives, which is c ::: implemented in the apply operator). For these tangential derivatives, c ::: if some of the cells in the stencil are uncovered, the derivative is c ::: computed half from cells which are internal, plus an externally supplied c ::: tangential derivative centered at location bcl. c ??? exttd is the externally supplied tangential derivative which is c ??? centered at bcl from wall. Since the location of exttd is c ??? indeterminate (determined by bcl), we arbitrarily index it in the c ??? cell just outside the wall. c ??? tander is the calculated tangential derivative which is centered at c ??? at the wall. It is indexed as if it were a cell centered quantity c ??? just outside the wall. This is anomalous since it is really edge c ??? centered on the outer wall. c c ::: other notes since previous developers didn't bother to document c ::: cdir is mnemonic for coordinate direction, i.e. which side this is c ::: cdir==0 -> left wall c ::: cdir==2 -> right c ::: cdir==1 -> bottom c ::: cdir==3 -> top c ::: notes about mask c ::: since we now require other masks, there are 3. c ::: 1) mask -- the main one covering the cells off the side of valid domain. c ::: 2) maskp -- the plus end of transverse direction c ::: 3) maskn -- the minus end of transverse direction integer maxorder integer nc, cdir, flagden, flagbc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(u) REAL_T u(DIMV(u),nc) integer DIMDEC(den) REAL_T den(DIMV(den),nc) integer DIMDEC(exttd) REAL_T exttd(DIMV(exttd),nc) integer DIMDEC(tander) REAL_T tander(DIMV(tander),nc) integer DIMDEC(bcval) REAL_T bcval(DIMV(bcval),nc) integer DIMDEC(mask) integer mask(DIMV(mask)) integer DIMDEC(maskp) integer maskp(DIMV(maskp)) integer DIMDEC(maskm) integer maskm(DIMV(maskm)) integer bct(nc) REAL_T bcl REAL_T h(BL_SPACEDIM) c REAL_T hx,hy,lambda REAL_T innder,outder REAL_T innloc,outloc,edgloc integer i integer j integer n logical is_dirichlet logical is_neumann logical is_odd REAL_T xb c integer lenx integer leny integer m c integer Lmaxorder integer maxmaxorder parameter(maxmaxorder=4) REAL_T x(-1:maxmaxorder-2) REAL_T coef(-1:maxmaxorder-2) REAL_T xInt c logical False, True parameter( False=.false.) parameter( True=.true. ) c is_dirichlet(i) = ( i .eq. LO_DIRICHLET ) is_neumann(i) = ( i .eq. LO_NEUMANN ) hx = h(1) hy = h(2) c if ( maxorder .eq. -1 ) then Lmaxorder = maxmaxorder else Lmaxorder = MIN(maxorder,maxmaxorder) endif lenx = MIN(hi(1)-lo(1), Lmaxorder-2) leny = MIN(hi(2)-lo(2), Lmaxorder-2) c c TODO: c In order for this to work with growing multigrid, must c sort xa[] because it is possible for the xb value to lay c within this range. c c The Left face of the grid c if(cdir .eq. 0) then do n = 1, nc if (is_neumann(bct(n))) then do j = lo(2), hi(2) u(lo(1)-1,j,n) = cvmgt( $ u(lo(1),j,n), $ u(lo(1)-1,j,n), $ mask(lo(1)-1,j) .gt. 0) enddo if ( flagden .eq. 1) then do j = lo(2), hi(2) den(lo(1),j,n) = 1.0 enddo endif c :::::: now do the tangential derivative part c :::::: <* Clear[indexcond] ; *> c :::::: interior part of left side i = lo(1) do j=lo(2)+1,hi(2)-1 innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> tander(i-1,j,n) = innder enddo c :::::: now end points c :::::: lower leftside j = lo(2) if( <* dependentCellsNotCovered[DTwoY[u,i,j] //. allDerivAllUV, Function[{i,j}, (j<0)], maskm] *> ) then innder = <* DOneY[U,i,j,n,+1] //. allDerivAllUV *> else innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> endif tander(i-1,j,n) = innder c :::::: upper left side j = hi(2) if( <* dependentCellsNotCovered[DTwoY[u,i,j] //. allDerivAllUV, Function[{i,j}, (j>0)], maskp] *> ) then innder = <* DOneY[U,i,j,n,-1] //. allDerivAllUV *> else innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> endif tander(i-1,j,n) = innder else if (is_dirichlet(bct(n))) then do m=0,lenx x(m) = m + 0.5 enddo x(-1) = - bcl/h(1) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenx+2, coef) if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) u(lo(1)-1, j, n) = cvmgt( $ bcval(lo(1)-1,j,n)*coef(-1), $ u(lo(1)-1, j, n), $ mask(lo(1)-1,j) .gt. 0) enddo else do j = lo(2), hi(2) u(lo(1)-1, j, n) = cvmgt( $ 0.0, $ u(lo(1)-1, j, n), $ mask(lo(1)-1,j) .gt. 0) enddo endif do m = 0, lenx do j = lo(2), hi(2) u(lo(1)-1,j,n) = cvmgt( $ u(lo(1)-1,j,n) $ + u(lo(1)+m, j, n)*coef(m), $ u(lo(1)-1,j,n), $ mask(lo(1)-1,j) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(lo(1),j,n) = cvmgt(coef(0), 0.0, $ mask(lo(1)-1,j) .gt. 0) enddo endif c :::::: now do the tangential derivative part c :::::: <* Clear[indexcond] ; *> c :::::: interior part of left side edgloc = 0. i = lo(1) do j=lo(2)+1,hi(2)-1 if( <* dependentCellsCovered[DTwoY[u,i-1,j] //. allDerivAllUV, Function[{i,j},(i<0)],mask] *> ) then outloc = -0.5 outder = <* DTwoY[U,i-1,j,n] //. allDerivAllUV *> elseif( <* dependentCellsCovered[DOneY[u,i-1,j,+1] //. allDerivAllUV, Function[{i,j},(i<0)],mask] *> ) then outloc = -0.5 outder = <* DOneY[U,i-1,j,n,+1] //. allDerivAllUV *> elseif( <* dependentCellsCovered[DOneY[u,i-1,j,-1] //. allDerivAllUV, Function[{i,j},(i<0)],mask] *> ) then outloc = -0.5 outder = <* DOneY[U,i-1,j,n,-1] //. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,n) else outder = 0. endif endif innloc = 0.5 innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> lambda = (edgloc-outloc)/(innloc-outloc) tander(i-1,j,n) = lambda*innder+(1-lambda)*outder enddo c :::::: now end points c :::::: lower leftside j = lo(2) if( <* dependentCellsCovered[DTwoY[u,i-1,j] //. allDerivAllUV, Function[{i,j}, (i<0)], mask] *> ) then outloc = -0.5 outder = <* DTwoY[U,i-1,j,n] //. allDerivAllUV *> elseif( <* dependentCellsCovered[DOneY[u,i-1,j,+1] //. allDerivAllUV, Function[{i,j}, (i<0)], mask] *> ) then outloc = -0.5 outder = <* DOneY[U,i-1,j,n,+1] //. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,n) else outder = 0. endif endif if( <* dependentCellsNotCovered[DTwoY[u,i,j] //. allDerivAllUV, Function[{i,j}, (j<0)], maskm] *> ) then innder = <* DOneY[U,i,j,n,+1] //. allDerivAllUV *> else innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i-1,j,n) = lambda*innder+(1-lambda)*outder c :::::: upper left side j = hi(2) if( <* dependentCellsCovered[DTwoY[u,i-1,j] //. allDerivAllUV, Function[{i,j}, (i<0)], mask] *> ) then outloc = -0.5 outder = <* DTwoY[U,i-1,j,n] //. allDerivAllUV *> elseif( <* dependentCellsCovered[DOneY[u,i-1,j,-1] //. allDerivAllUV, Function[{i,j}, (i<0)], mask] *> ) then outloc = -0.5 outder = <* DOneY[U,i-1,j,n,-1] //. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,n) else outder = 0. endif endif if( <* dependentCellsNotCovered[DTwoY[u,i,j] //. allDerivAllUV, Function[{i,j}, (j>0)], maskp] *> ) then innder = <* DOneY[U,i,j,n,-1] //. allDerivAllUV *> else innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i-1,j,n) = lambda*innder+(1-lambda)*outder else if ( bct(n) .eq. LO_REFLECT_ODD ) then do j = lo(2), hi(2) u(lo(1)-1, j, n) = cvmgt( $ -u(lo(1),j,n), $ u(lo(1)-1, j, n), $ mask(lo(1)-1,j) .gt. 0) tander(lo(1)-1,j,n) = 0.0 enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(lo(1),j,n) = cvmgt(-1.0, 0.0, $ mask(lo(1)-1,j) .gt. 0) enddo endif else print *,'UNKNOWN BC ON LEFT FACE IN APPLYBC' stop endif enddo endif c c The Right face of the grid c if(cdir .eq. 2) then do n = 1, nc if(is_neumann(bct(n))) then do j = lo(2), hi(2) u(hi(1)+1,j,n) = cvmgt( $ u(hi(1), j, n), $ u(hi(1)+1, j, n), $ mask(hi(1)+1,j) .gt. 0) enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(hi(1),j,n) = 1.0 enddo endif c :::::: now do the tangential derivative part c :::::: <* Clear[indexcond] ; *> c :::::: interior part of right side i = hi(1) do j=lo(2)+1,hi(2)-1 innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> tander(i+1,j,n) = innder enddo c :::::: now end points c :::::: lower right side j = lo(2) if( <* dependentCellsNotCovered[DTwoY[u,i,j] //. allDerivAllUV, Function[{i,j}, (j<0)], maskm] *> ) then innder = <* DOneY[U,i,j,n,+1] //. allDerivAllUV *> else innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> endif tander(i+1,j,n) = innder c :::::: upper right side j = hi(2) if( <* dependentCellsNotCovered[DTwoY[u,i,j] //. allDerivAllUV, Function[{i,j}, (j>0)], maskp] *> ) then innder = <* DOneY[U,i,j,n,-1] //. allDerivAllUV *> else innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> endif tander(i+1,j,n) = innder else if (is_dirichlet(bct(n))) then do m=0,lenx x(m) = m + 0.5 enddo x(-1) = - bcl/h(1) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenx+2, coef) if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) u(hi(1)+1,j,n) = cvmgt( $ bcval(hi(1)+1,j,n)*coef(-1), $ u(hi(1)+1,j,n), $ mask(hi(1)+1,j) .gt. 0) enddo else do j = lo(2), hi(2) u(hi(1)+1,j,n) = cvmgt( $ 0.0, $ u(hi(1)+1,j,n), $ mask(hi(1)+1,j) .gt. 0) enddo endif do m = 0, lenx do j = lo(2), hi(2) u(hi(1)+1,j,n) = cvmgt( $ u(hi(1)+1,j,n) $ + u(hi(1)-m,j,n)*coef(m), $ u(hi(1)+1,j,n), $ mask(hi(1)+1,j) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(hi(1),j,n) = cvmgt(coef(0), 0.0, $ mask(hi(1)+1,j) .gt. 0) enddo endif c :::::: now do the tangential derivative part c :::::: <* Clear[indexcond] ; *> c :::::: interior part of right side edgloc = 0. i = hi(1) do j=lo(2)+1,hi(2)-1 if( <* dependentCellsCovered[DTwoY[u,i+1,j] //. allDerivAllUV, Function[{i,j},(i>0)],mask] *> ) then outloc = -0.5 outder = <* DTwoY[U,i+1,j,n] //. allDerivAllUV *> elseif( <* dependentCellsCovered[DOneY[u,i+1,j,+1] //. allDerivAllUV, Function[{i,j},(i>0)],mask] *> ) then outloc = -0.5 outder = <* DOneY[U,i+1,j,n,+1] //. allDerivAllUV *> elseif( <* dependentCellsCovered[DOneY[u,i+1,j,-1] //. allDerivAllUV, Function[{i,j},(i>0)],mask] *> ) then outloc = -0.5 outder = <* DOneY[U,i+1,j,n,-1] //. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,n) else outder = 0. endif endif innloc = 0.5 innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> lambda = (edgloc-outloc)/(innloc-outloc) tander(i+1,j,n) = lambda*innder+(1-lambda)*outder enddo c :::::: now end points c :::::: lower right side j = lo(2) if( <* dependentCellsCovered[DTwoY[u,i+1,j] //. allDerivAllUV, Function[{i,j}, (i>0)], mask] *> ) then outloc = -0.5 outder = <* DTwoY[U,i+1,j,n] //. allDerivAllUV *> elseif( <* dependentCellsCovered[DOneY[u,i+1,j,+1] //. allDerivAllUV, Function[{i,j}, (i>0)], mask] *> ) then outloc = -0.5 outder = <* DOneY[U,i+1,j,n,+1] //. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,n) else outder = 0. endif endif if( <* dependentCellsNotCovered[DTwoY[u,i,j] //. allDerivAllUV, Function[{i,j}, (j<0)], maskm] *> ) then innder = <* DOneY[U,i,j,n,+1] //. allDerivAllUV *> else innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i+1,j,n) = lambda*innder+(1-lambda)*outder c :::::: upper right side j = hi(2) if( <* dependentCellsCovered[DTwoY[u,i+1,j] //. allDerivAllUV, Function[{i,j}, (i>0)], mask] *> ) then outloc = -0.5 outder = <* DTwoY[U,i+1,j,n] //. allDerivAllUV *> elseif( <* dependentCellsCovered[DOneY[u,i+1,j,-1] //. allDerivAllUV, Function[{i,j}, (i>0)], mask] *> ) then outloc = -0.5 outder = <* DOneY[U,i+1,j,n,-1] //. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,n) else outder = 0. endif endif if( <* dependentCellsNotCovered[DTwoY[u,i,j] //. allDerivAllUV, Function[{i,j}, (j>0)], maskp] *> ) then innder = <* DOneY[U,i,j,n,-1] //. allDerivAllUV *> else innder = <* DTwoY[U,i,j,n] //. allDerivAllUV *> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i+1,j,n) = lambda*innder+(1-lambda)*outder else if ( bct(n) .eq. LO_REFLECT_ODD ) then do j = lo(2), hi(2) u(hi(1)+1, j, n) = cvmgt( $ -u(hi(1),j,n), $ u(hi(1)+1, j, n), $ mask(hi(1)+1,j) .gt. 0) c ::: tangential der is trivial tander(hi(1)+1,j,n) = 0.0 enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(hi(1),j,n) = cvmgt(-1.0, 0.0, $ mask(hi(1)+1,j) .gt. 0) enddo endif else print *,'UNKNOWN BC ON RIGHT FACE IN APPLYBC' stop endif enddo endif c c The Bottom of the Grid c if(cdir .eq. 1) then do n = 1, nc if(is_neumann(bct(n))) then do i = lo(1),hi(1) u(i,lo(2)-1,n) = cvmgt( $ u(i,lo(2),n), $ u(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) enddo if ( flagden .eq. 1 ) then do i = lo(1),hi(1) den(i,lo(2),n) = 1.0 enddo endif c :::::: now do the tangential derivative part c :::::: interior part of bottom side j = lo(2) do i=lo(1)+1,hi(1)-1 innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> tander(i,j-1,n) = innder enddo c :::::: now end points c :::::: left bottom side i = lo(1) if( <* dependentCellsNotCovered[DTwoX[u,i,j] //. allDerivAllUV, Function[{i,j}, (i<0)], maskm] *> ) then innder = <* DOneX[U,i,j,n,+1] //. allDerivAllUV *> else innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> endif tander(i,j-1,n) = innder c :::::: right bottom side i = hi(1) if( <* dependentCellsNotCovered[DTwoX[u,i,j] //. allDerivAllUV, Function[{i,j}, (i>0)], maskp] *> ) then innder = <* DOneX[U,i,j,n,-1] //. allDerivAllUV *> else innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> endif tander(i,j-1,n) = innder else if (is_dirichlet(bct(n))) then do m=0,leny x(m) = m + 0.5 enddo x(-1) = - bcl/h(2) xInt = - 0.5 call polyInterpCoeff(xInt, x, leny+2, coef) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) u(i,lo(2)-1,n) = cvmgt( $ bcval(i,lo(2)-1,n)*coef(-1), $ u(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) enddo else do i = lo(1), hi(1) u(i,lo(2)-1,n) = cvmgt( $ 0.0, $ u(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) enddo endif do m = 0, leny do i = lo(1), hi(1) u(i, lo(2)-1, n) = cvmgt( $ u(i, lo(2)-1,n) $ + u(i, lo(2)+m,n)*coef(m), $ u(i, lo(2)-1, n), $ mask(i, lo(2)-1) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i, lo(2),n) = cvmgt(coef(0), 0.0, $ mask(i, lo(2)-1) .gt. 0) enddo endif c :::::: now do the tangential derivative part c :::::: interior part of bottom side edgloc = 0. j = lo(2) do i=lo(1)+1,hi(1)-1 if( <* dependentCellsCovered[DTwoX[u,i,j-1] //. allDerivAllUV, Function[{i,j},(j<0)],mask] *> ) then outloc = -0.5 outder = <* DTwoX[U,i,j-1,n] //. allDerivAllUV *> else if( <* dependentCellsCovered[DOneX[u,i,j-1,+1]//. allDerivAllUV, Function[{i,j},(j<0)],mask] *> ) then outloc = -0.5 outder = <* DOneX[U,i,j-1,n,+1] //. allDerivAllUV *> else if( <* dependentCellsCovered[DOneX[u,i,j-1,-1]//. allDerivAllUV, Function[{i,j},(j<0)],mask] *> ) then outloc = -0.5 outder = <* DOneX[U,i,j-1,n,-1] //. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j-1,n) else outder = 0. endif endif innloc = 0.5 innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j-1,n) = lambda*innder+(1-lambda)*outder enddo c :::::: now end points c :::::: left bottom side i = lo(1) if( <* dependentCellsCovered[DTwoX[u,i,j-1] //. allDerivAllUV, Function[{i,j}, (j<0)], mask] *> ) then outloc = -0.5 outder = <* DTwoX[U,i,j-1,n] //. allDerivAllUV *> else if( <* dependentCellsCovered[DOneX[u,i,j-1,+1]//. allDerivAllUV, Function[{i,j},(j<0)],mask] *> ) then outloc = -0.5 outder = <* DOneX[U,i,j-1,n,+1] //. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j-1,n) else outder = 0. endif endif if( <* dependentCellsNotCovered[DTwoX[u,i,j] //. allDerivAllUV, Function[{i,j}, (i<0)], maskm] *> ) then innder = <* DOneX[U,i,j,n,+1] //. allDerivAllUV *> else innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j-1,n) = lambda*innder+(1-lambda)*outder c :::::: right bottom side i = hi(1) if( <* dependentCellsCovered[DTwoX[u,i,j-1] //. allDerivAllUV, Function[{i,j}, (j<0)], mask] *> ) then outloc = -0.5 outder = <* DTwoX[U,i,j-1,n] //. allDerivAllUV *> else if( <* dependentCellsCovered[DOneX[u,i,j-1,-1]//. allDerivAllUV, Function[{i,j},(j<0)],mask] *> ) then outloc = -0.5 outder = <* DOneX[U,i,j-1,n,-1] //. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j-1,n) else outder = 0. endif endif if( <* dependentCellsNotCovered[DTwoX[u,i,j] //. allDerivAllUV, Function[{i,j}, (i>0)], maskp] *> ) then innder = <* DOneX[U,i,j,n,-1] //. allDerivAllUV *> else innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j-1,n) = lambda*innder+(1-lambda)*outder else if ( bct(n) .eq. LO_REFLECT_ODD ) then do i = lo(1), hi(1) u(i,lo(2)-1,n) = cvmgt( $ -u(i,lo(2),n), $ u(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) tander(i,lo(2)-1,n) = 0.0 enddo if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,lo(2),n) = cvmgt(-1.0, 0.0, $ mask(i,lo(2)-1) .gt. 0) enddo endif else print *,'UNKNOWN BC ON BOTTOM FACE IN APPLYBC' stop endif enddo endif c c The top of the grid c if (cdir .eq. 3) then do n = 1, nc if(is_neumann(bct(n))) then do i = lo(1), hi(1) u(i,hi(2)+1,n) = cvmgt( $ u(i,hi(2),n), $ u(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) enddo if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,hi(2),n) = 1.0 enddo endif c :::::: now do the tangential derivative part c :::::: interior part of top side j = hi(2) do i=lo(1)+1,hi(1)-1 innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> tander(i,j+1,n) = innder enddo c :::::: now end points c :::::: left top side i = lo(1) if( <* dependentCellsNotCovered[DTwoX[u,i,j] //. allDerivAllUV, Function[{i,j}, (i<0)], maskm] *> ) then innder = <* DOneX[U,i,j,n,+1] //. allDerivAllUV *> else innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> endif tander(i,j+1,n) = innder c :::::: right top side i = hi(1) if( <* dependentCellsNotCovered[DTwoX[u,i,j] //. allDerivAllUV, Function[{i,j}, (i>0)], maskp] *> ) then innder = <* DOneX[U,i,j,n,-1] //. allDerivAllUV *> else innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> endif tander(i,j+1,n) = innder else if (is_dirichlet(bct(n))) then if ( bct(n) .eq. LO_REFLECT_ODD ) leny = 0 do m=0,leny x(m) = m + 0.5 enddo x(-1) = - bcl/h(2) xInt = - 0.5 call polyInterpCoeff(xInt, x, leny+2, coef) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) u(i,hi(2)+1,n) = cvmgt( $ bcval(i,hi(2)+1,n)*coef(-1), $ u(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) enddo else do i = lo(1), hi(1) u(i,hi(2)+1,n) = cvmgt( $ 0.0, $ u(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) enddo endif do m = 0, leny do i = lo(1), hi(1) u(i, hi(2)+1,n) = cvmgt( $ u(i,hi(2)+1,n) $ + u(i, hi(2)-m,n)*coef(m), $ u(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,hi(2),n) = cvmgt(coef(0), 0.0, $ mask(i,hi(2)+1) .gt. 0) enddo endif c :::::: now do the tangential derivative part c :::::: interior part of top side edgloc = 0. j = hi(2) do i=lo(1)+1,hi(1)-1 if( <* dependentCellsCovered[DTwoX[u,i,j+1] //. allDerivAllUV, Function[{i,j},(j>0)],mask] *> ) then outloc = -0.5 outder = <* DTwoX[U,i,j+1,n] //. allDerivAllUV *> else if( <* dependentCellsCovered[DOneX[u,i,j+1,+1]//. allDerivAllUV, Function[{i,j},(j>0)],mask] *> ) then outloc = -0.5 outder = <* DOneX[U,i,j+1,n,+1]//. allDerivAllUV *> else if( <* dependentCellsCovered[DOneX[u,i,j+1,-1]//. allDerivAllUV, Function[{i,j},(j>0)],mask] *> ) then outloc = -0.5 outder = <* DOneX[U,i,j+1,n,-1]//. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j+1,n) else outder = 0. endif endif innloc = 0.5 innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j+1,n) = lambda*innder+(1-lambda)*outder enddo c :::::: now end points c :::::: left top side i = lo(1) if( <* dependentCellsCovered[DTwoX[u,i,j+1] //. allDerivAllUV, Function[{i,j}, (j>0)], mask] *> ) then outloc = -0.5 outder = <* DTwoX[U,i,j+1,n] //. allDerivAllUV *> else if( <* dependentCellsCovered[DOneX[u,i,j+1,+1]//. allDerivAllUV, Function[{i,j},(j>0)],mask] *> ) then outloc = -0.5 outder = <* DOneX[U,i,j+1,n,+1]//. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j+1,n) else outder = 0. endif endif if( <* dependentCellsNotCovered[DTwoX[u,i,j] //. allDerivAllUV, Function[{i,j}, (i<0)], maskm] *> ) then innder = <* DOneX[U,i,j,n,+1] //. allDerivAllUV *> else innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j+1,n) = lambda*innder+(1-lambda)*outder c :::::: right top side i = hi(1) if( <* dependentCellsCovered[DTwoX[u,i,j+1] //. allDerivAllUV, Function[{i,j}, (j>0)], mask] *> ) then outloc = -0.5 outder = <* DTwoX[U,i,j+1,n] //. allDerivAllUV *> else if( <* dependentCellsCovered[DOneX[u,i,j+1,-1]//. allDerivAllUV, Function[{i,j},(j>0)],mask] *> ) then outloc = -0.5 outder = <* DOneX[U,i,j+1,n,-1]//. allDerivAllUV *> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j+1,n) else outder = 0. endif endif if( <* dependentCellsNotCovered[DTwoX[u,i,j] //. allDerivAllUV, Function[{i,j}, (i>0)], maskp] *> ) then innder = <* DOneX[U,i,j,n,-1] //. allDerivAllUV *> else innder = <* DTwoX[U,i,j,n] //. allDerivAllUV *> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j+1,n) = lambda*innder+(1-lambda)*outder else if ( bct(n) .eq. LO_REFLECT_ODD ) then do i = lo(1), hi(1) u(i,hi(2)+1,n) = cvmgt( $ -u(i,hi(2),n), $ u(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) tander(i,hi(2)+1,n) = 0.0 enddo if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,hi(2),n) = cvmgt(-1.0, 0.0, $ mask(i,hi(2)+1) .gt. 0) enddo endif else print *,'UNKNOWN BC ON TOP FACE IN APPLYBC' stop endif enddo endif c end subroutine FORT_GSRB ( $ u, DIMS(u), $ rhs, DIMS(rhs), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ maskn,DIMS(maskn), $ fn, DIMS(fn), $ maske,DIMS(maske), $ fe, DIMS(fe), $ maskw,DIMS(maskw), $ fw, DIMS(fw), $ masks,DIMS(masks), $ fs, DIMS(fs), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ lo,hi,h,nc,phaseflag $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(rhs) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(maskn) integer DIMDEC(maske) integer DIMDEC(maskw) integer DIMDEC(masks) integer DIMDEC(fn) integer DIMDEC(fe) integer DIMDEC(fw) integer DIMDEC(fs) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) REAL_T h(BL_SPACEDIM) integer nc,phaseflag REAL_T u(DIMV(u),2) REAL_T rhs(DIMV(rhs),2) REAL_T a(DIMV(a),2) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) integer maskn(DIMV(maskn)) integer maske(DIMV(maske)) integer maskw(DIMV(maskw)) integer masks(DIMV(masks)) REAL_T fn(DIMV(fn),nc) REAL_T fe(DIMV(fe),nc) REAL_T fw(DIMV(fw),nc) REAL_T fs(DIMV(fs),nc) REAL_T trandern(DIMV(trandern),2) REAL_T trandere(DIMV(trandere),2) REAL_T tranderw(DIMV(tranderw),2) REAL_T tranders(DIMV(tranders),2) integer i,j,modx,mody integer istart,jstart REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw,dudyn,dudys REAL_T dvdxe,dvdxw,dvdxn,dvdxs REAL_T diagu, diagv REAL_T operu, operv logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) if( nc .ne. 2 ) then write(6,*)'FORT_GSRB: bad nc',nc stop endif c ::: convert phase flag into modx and mody if( phaseflag.eq.0 ) then modx = 0 mody = 0 elseif(phaseflag.eq.1) then modx = 1 mody = 0 elseif(phaseflag.eq.2) then modx = 0 mody = 1 elseif(phaseflag.eq.3) then modx = 1 mody = 1 else write(6,*)'FORT_GSRB: bad phaseflag', phaseflag stop endif c ::: cases: c ::: 1) interior. All normal derivative expressions c ::: 2) edge but not on corner. check mask value to see if use outside c ::: value or use interpolations c ::: 3) corners. Must check mask values to see if use outside values c ::: values or use interpolations ON TWO SIDES. But must also c ::: check to see if need to do one-sided derivs for tangential c ::: derivatives. c ::: case 1 istart = lo(1)+1 if( mod(istart,2) .ne. modx ) istart = istart+1 jstart = lo(2)+1 if( mod(jstart,2) .ne. mody ) jstart = jstart+1 do j = jstart,hi(2)-1,2 do i = istart,hi(1)-1,2 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = <* dudy[i+half,j] //. allDerivAllUV *> dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) c ::: evaluate operator operu = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> operv = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) enddo enddo c ::: case 2a) north side c ::: <* indexcond = Function[ {i,j}, (j>0) ] ; *> c ::: <* maskray = maskn ; *> j = hi(2) if( mod(j,2) .eq. mody ) then do i = istart,hi(1)-1,2 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i+half,j] //. allDerivAllUV, indexcond,maskray] *> ) then dudye = <* (DOneY[u,i ,j,-1]+ DOneY[u,i+1,j,-1])/2 //. allDerivAllUV *> else dudye = <* dudy[i+half,j] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,maskray] *> ) then dudyw = <* (DOneY[u,i ,j,-1]+ DOneY[u,i-1,j,-1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif dvdxn = trandern(i,j+1,2) dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maskn(i,j+1).gt. 0) then diagu = diagu - fn(i,j,1)*beta*muY(i,j+1)/hy**2 diagv = diagv - fn(i,j,2)*2*beta*muY(i,j+1)/hy**2 endif c ::: evaluate operator operu = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> operv = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) enddo endif c ::: case 2b south side c ::: <* indexcond = Function[ {i,j}, (j<0) ] ; *> c ::: <* maskray = masks ; *> j=lo(2) if( mod(j,2) .eq. mody ) then do i=istart,hi(1)-1,2 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i+half,j] //. allDerivAllUV, indexcond,maskray] *> ) then dudye = <* (DOneY[u,i ,j,+1]+ DOneY[u,i+1,j,+1])/2 //. allDerivAllUV *> else dudye = <* dudy[i+half,j] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,maskray] *> ) then dudyw = <* (DOneY[u,i ,j,+1]+ DOneY[u,i-1,j,+1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> dvdxs = tranders(i,j-1,2) dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( masks(i,j-1).gt. 0) then diagu = diagu - fs(i,j,1)*beta*muY(i,j)/hy**2 diagv = diagv - fs(i,j,2)*2*beta*muY(i,j)/hy**2 endif c ::: evaluate operator operu = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> operv = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) enddo endif c ::: case 2c: west side story c ::: <* indexcond = Function[ {i,j}, (i<0) ] ; *> c ::: <* maskray = maskw ; *> i=lo(1) if( mod(i,2) .eq. modx ) then do j=jstart,hi(2)-1,2 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = <* dudy[i+half,j] //. allDerivAllUV *> dudyw = tranderw(i-1,j,1) if( <* dependentCellsNotCovered[dvdx[i,j+half] //. allDerivAllUV, indexcond, maskray] *> ) then dvdxn = <* (DOneX[v,i,j ,+1]+ DOneX[v,i,j+1,+1])/2 //. allDerivAllUV *> else dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond, maskray] *> ) then dvdxs = <* (DOneX[v,i,j ,+1]+ DOneX[v,i,j-1,+1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maskw(i-1,j).gt. 0) then diagu = diagu - fw(i,j,1)*2*beta*muX(i,j)/hx**2 diagv = diagv - fw(i,j,2)* beta*muX(i,j)/hy**2 endif c ::: evaluate operator operu = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> operv = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) enddo endif c ::: case 2d: east side story c ::: <* indexcond = Function[ {i,j}, (i>0) ] ; *> c ::: <* maskray = maske ; *> i=hi(1) if( mod(i,2) .eq. modx ) then do j=jstart,hi(2)-1,2 c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = trandere(i+1,j,1) dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dvdx[i,j+half] //. allDerivAllUV, indexcond, maskray] *> ) then dvdxn = <* (DOneX[v,i,j ,-1]+ DOneX[v,i,j+1,-1])/2 //. allDerivAllUV *> else dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond, maskray] *> ) then dvdxs = <* (DOneX[v,i,j ,-1]+ DOneX[v,i,j-1,-1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maske(i+1,j).gt. 0) then diagu = diagu - fe(i,j,1)*2*beta*muX(i+1,j)/hx**2 diagv = diagv - fe(i,j,2)* beta*muX(i+1,j)/hy**2 endif c ::: evaluate operator operu = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> operv = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) enddo endif c ::: case 3a: north-east corner, plus i, plus j c ::: <* indexcond = Function[ {i,j}, (i>0)||(j>0) ] ; *> c ::: <* Clear[ maskray ] ; *> j=hi(2) i=hi(1) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody) then c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = trandere(i+1,j,1) if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,maskn] *> ) then dudyw = <* (DOneY[u,i-1,j,-1]+ DOneY[u,i ,j,-1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif dvdxn = trandern(i,j+1,2) if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond,maske] *> ) then dvdxs = <* (DOneX[v,i,j-1,-1]+ DOneX[v,i,j ,-1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maske(i+1,j).gt. 0) then diagu = diagu - fe(i,j,1)*2*beta*muX(i+1,j)/hx**2 diagv = diagv - fe(i,j,2)* beta*muX(i+1,j)/hy**2 endif if( maskn(i,j+1).gt. 0) then diagu = diagu - fn(i,j,1)*beta*muY(i,j+1)/hy**2 diagv = diagv - fn(i,j,2)*2*beta*muY(i,j+1)/hy**2 endif c ::: evaluate operator operu = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> operv = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) endif c ::: case 3b: south-east corner, plus i, minus j, plus i, plus j c ::: <* indexcond = Function[ {i,j}, (i>0)||(j<0) ] ; *> j=lo(2) i=hi(1) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody) then c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> dudye = trandere(i+1,j,1) if( <* dependentCellsNotCovered[dudy[i-1+half,j] //. allDerivAllUV, indexcond,masks] *> ) then dudyw = <* (DOneY[u,i-1,j,+1]+ DOneY[u,i ,j,+1])/2 //. allDerivAllUV *> else dudyw = <* dudy[i-1+half,j] //. allDerivAllUV *> endif if( <* dependentCellsNotCovered[dvdx[i,j+half] //. allDerivAllUV, indexcond,maske] *> ) then dvdxn = <* (DOneX[v,i,j+1,-1]+ DOneX[v,i,j ,-1])/2 //. allDerivAllUV *> else dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> endif dvdxs = tranders(i,j-1,2) dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maske(i+1,j).gt. 0) then diagu = diagu - fe(i,j,1)*2*beta*muX(i+1,j)/hx**2 diagv = diagv - fe(i,j,2)* beta*muX(i+1,j)/hy**2 endif if( masks(i,j-1).gt. 0) then diagu = diagu - fs(i,j,1)*beta*muY(i,j)/hy**2 diagv = diagv - fs(i,j,2)*2*beta*muY(i,j)/hy**2 endif c ::: evaluate operator operu = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> operv = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) endif c ::: case 3c: south-west corner, minus i, minus j c ::: <* indexcond = Function[ {i,j}, (i<0)||(j<0) ] ; *> j=lo(2) i=lo(1) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody) then c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i+half,j] //. allDerivAllUV, indexcond,masks] *> ) then dudye = <* (DOneY[u,i+1,j,+1]+ DOneY[u,i ,j,+1])/2 //. allDerivAllUV *> else dudye = <* dudy[i+half,j] //. allDerivAllUV *> endif dudyw = tranderw(i-1,j,1) if( <* dependentCellsNotCovered[dvdx[i,j+half] //. allDerivAllUV, indexcond,maskw] *> ) then dvdxn = <* (DOneX[v,i,j+1,+1]+ DOneX[v,i,j ,+1])/2 //. allDerivAllUV *> else dvdxn = <* dvdx[i,j +half] //. allDerivAllUV *> endif dvdxs = tranders(i,j-1,2) dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maskw(i-1,j).gt. 0) then diagu = diagu - fw(i,j,1)*2*beta*muX(i,j)/hx**2 diagv = diagv - fw(i,j,2)* beta*muX(i,j)/hy**2 endif if( masks(i,j-1).gt. 0) then diagu = diagu - fs(i,j,1)*beta*muY(i,j)/hy**2 diagv = diagv - fs(i,j,2)*2*beta*muY(i,j)/hy**2 endif c ::: evaluate operator operu = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> operv = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) endif c ::: case 3d: north-west corner, minus i, plus j c ::: <* indexcond = Function[ {i,j}, (i<0)||(j>0) ] ; *> j=hi(2) i=lo(1) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody) then c ::: get expressions for appropriate derivatives dudxe = <* dudx[i+half,j] //. allDerivAllUV *> dudxw = <* dudx[i-1+half,j] //. allDerivAllUV *> dvdyn = <* dvdy[i,j+half] //. allDerivAllUV *> dvdys = <* dvdy[i,j-1+half] //. allDerivAllUV *> dudyn = <* dudy[i,j +half] //. allDerivAllUV *> dudys = <* dudy[i,j-1+half] //. allDerivAllUV *> if( <* dependentCellsNotCovered[dudy[i+half,j] //. allDerivAllUV, indexcond,maskn] *> ) then dudye = <* (DOneY[u,i+1,j,-1]+ DOneY[u,i ,j,-1])/2 //. allDerivAllUV *> else dudye = <* dudy[i+half,j] //. allDerivAllUV *> endif dudyw = tranderw(i-1,j,1) dvdxn = trandern(i,j+1,2) if( <* dependentCellsNotCovered[dvdx[i,j-1+half] //. allDerivAllUV, indexcond,maskw] *> ) then dvdxs = <* (DOneX[v,i,j-1,+1]+ DOneX[v,i,j ,+1])/2 //. allDerivAllUV *> else dvdxs = <* dvdx[i,j-1+half] //. allDerivAllUV *> endif dvdxe = <* dvdx[i+half,j] //. allDerivAllUV *> dvdxw = <* dvdx[i-1+half,j] //. allDerivAllUV *> c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maskw(i-1,j).gt. 0) then diagu = diagu - fw(i,j,1)*2*beta*muX(i,j)/hx**2 diagv = diagv - fw(i,j,2)* beta*muX(i,j)/hy**2 endif if( maskn(i,j+1).gt. 0) then diagu = diagu - fn(i,j,1)*beta*muY(i,j+1)/hy**2 diagv = diagv - fn(i,j,2)*2*beta*muY(i,j+1)/hy**2 endif c ::: evaluate operator operu = <* (alpha*a[i,j,1]*u[i,j,1] - beta* ( hy*(tauxx[i+half,j]-tauxx[i-1+half,j])+ hx*(tauxy[i,j+half]-tauxy[i,j-1+half] ))/vol ) //. standardrepl *> operv = <* (alpha*a[i,j,2]*u[i,j,2] - beta* ( hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half] ))/vol ) //. standardrepl *> c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) endif return end ccseapps-2.5/CCSEApps/tensorMG/DV_3D2.mF0000644000175000017500000021473211634153073020633 0ustar amckinstryamckinstry#include #include "DivVis_F.H" #include #include "ArrayLim.H" c :::: usage: c :::: this .mF file is meant to be run through Mathematica. This converts c :::: compact symbolic expressions into fortran which is stored in a .F c :::: file. c---------------------------------------------------------------- c this is the fortran support file for the the operator c L(U) = alpha*a(x)*U - beta*Div( tau ) c c where U is the two component vector (u,v) and c tau is a three by three tensor c tau = | t_xx t_xy t_xz| c | t_xy t_yy t_yz| c | t_xz t_yz t_zz| c c t_xx = 2*mu * u_x c t_yy = 2*mu * v_y c t_zz = 2*mu * w_z c t_xy = mu*(u_y + v_x) c t_xz = mu*(u_z + w_x) c t_yz = mu*(v_z + w_y) c ::: define standard replacements used by Mathematica c ::: see file visc3d.ma c ::: <* standardrepl = { dudx[i+half ,j ,k ]->dudxe, dudx[i-1+half,j ,k ]->dudxw, dvdy[i, j+half ,k ]->dvdyn , dvdy[i, j-1+half,k ]->dvdys , dwdz[i, j ,k+half ]->dwdzt, dwdz[i, j ,k-1+half]->dwdzb, dudy[i, j +half,k]-> dudyn , dudy[i, j-1+half,k]-> dudys , dudy[i+half, j ,k]-> dudye , dudy[i-1+half,j ,k]-> dudyw , dvdx[i, j +half,k]-> dvdxn , dvdx[i, j-1+half,k]-> dvdxs , dvdx[i+half, j ,k]-> dvdxe , dvdx[i-1+half,j ,k]-> dvdxw , dudz[i ,j ,k+half ]->dudzt, dudz[i ,j ,k-1+half]->dudzb, dudz[i+half ,j ,k ]->dudze, dudz[i-1+half,j ,k ]->dudzw, dvdz[i ,j ,k+half ]->dvdzt, dvdz[i ,j ,k-1+half]->dvdzb, dvdz[i ,j+half ,k ]->dvdzn, dvdz[i ,j-1+half,k ]->dvdzs, dwdx[i+half ,j ,k ]->dwdxe, dwdx[i+half-1,j ,k ]->dwdxw, dwdx[i ,j ,k+half ]->dwdxt, dwdx[i ,j ,k+half-1]->dwdxb, dwdy[i ,j+half ,k ]->dwdyn, dwdy[i ,j+half-1,k ]->dwdys, dwdy[i ,j ,k+half ]->dwdyt, dwdy[i ,j ,k+half-1]->dwdyb, murepl1, murepl2,murepl3, tauxxdef, tauyydef,tauxydef,tauxzdef,tauyzdef, tauzzdef, vol->hx*hy*hz }; *> c ------------------------------------------------------------------- c ... a point of interpretation here: lo and hi are the covered area in c ... cell centered coordinates. The dimension of the x and y fluxes have c ... to be at least one larger in the appropriate direction. c ... we use the "usual" interpretation of fluxes: cell i has a left flux c ... numbered i and a right flux numbered i+1 subroutine FORT_DVFLUX( $ u, DIMS(u), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ muZ, DIMS(muZ), $ xflux,DIMS(xflux), $ yflux,DIMS(yflux), $ zflux,DIMS(zflux), $ maskn,DIMS(maskn), $ maske,DIMS(maske), $ maskw,DIMS(maskw), $ masks,DIMS(masks), $ maskt,DIMS(maskt), $ maskb,DIMS(maskb), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ trandert,DIMS(trandert), $ tranderb,DIMS(tranderb), $ lo,hi,h $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(muZ) integer DIMDEC(xflux) integer DIMDEC(yflux) integer DIMDEC(zflux) integer DIMDEC(maskn) integer DIMDEC(maske) integer DIMDEC(maskw) integer DIMDEC(masks) integer DIMDEC(maskt) integer DIMDEC(maskb) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer DIMDEC(trandert) integer DIMDEC(tranderb) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) REAL_T h(BL_SPACEDIM) REAL_T u(DIMV(u),3) REAL_T a(DIMV(a)) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) REAL_T muZ(DIMV(muZ)) REAL_T xflux(DIMV(xflux),3) REAL_T yflux(DIMV(yflux),3) REAL_T zflux(DIMV(zflux),3) integer maskn(DIMV(maskn)) integer maske(DIMV(maske)) integer maskw(DIMV(maskw)) integer masks(DIMV(masks)) integer maskt(DIMV(maskt)) integer maskb(DIMV(maskb)) c ::: for transverse derives, first 3 is for variable, second 3 is for c ::: direction of derivative. Obviously not all are used, but this is easy. REAL_T trandern(DIMV(trandern),3,3) REAL_T trandere(DIMV(trandere),3,3) REAL_T tranderw(DIMV(tranderw),3,3) REAL_T tranders(DIMV(tranders),3,3) REAL_T trandert(DIMV(trandert),3,3) REAL_T tranderb(DIMV(tranderb),3,3) integer i,j,k REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy,hz REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw REAL_T dudyn,dudys REAL_T dvdxe,dvdxw REAL_T dvdxn,dvdxs REAL_T dudzb,dudzt REAL_T dwdzt,dwdzb REAL_T dwdxb,dwdxt REAL_T dvdzb,dvdzt REAL_T dwdyb,dwdyt REAL_T dudzw,dudze REAL_T dwdxw,dwdxe REAL_T dvdzs,dvdzn REAL_T dwdys,dwdyn logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) hz = h(3) c ::: cases: c ::: 0) interior. All usual derivative expressions c ::: 1-6) face but not on edge. c ::: 7-18) edge but not on corner. c ::: 19-26) corners. c ::: case 0 c ::: <* indexcond = Function[ {i,j,k}, False ] ; *> c ::: <* maskray = maskerr ; *> do k=lo(3)+1,hi(3) do j=lo(2)+1,hi(2) do i=lo(1)+1,hi(1) c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo enddo enddo c ::: case 1, top face c ::: <* indexcond = Function[{i,j,k},k>0] ; *> c ::: <* maskray = maskt ; *> c ::: <* tranderiv = trandert ; *> c ::: wst k=hi(3) do j=lo(2)+1,hi(2) do i=lo(1)+1,hi(1) c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k+1,1)=-(<*FA[tauxz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,2)=-(<*FA[tauyz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,3)=-(<*FA[tauzz[i,j,k+half]//. standardrepl] *>) enddo enddo c ::: case 2, bottom face c ::: <* indexcond = Function[{i,j,k},k<0] ; *> c ::: <* maskray = maskb ; *> c ::: <* tranderiv = tranderb ; *> c ::: wsb k=lo(3) do j=lo(2)+1,hi(2) do i=lo(1)+1,hi(1) c ::: get expressions for normal derivatives c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo enddo c ::: case 3, west face c ::: <* indexcond = Function[{i,j,k},i<0] ; *> c ::: <* maskray = maskw ; *> c ::: <* tranderiv = tranderw ; *> c ::: wsb i = lo(1) do k=lo(3)+1,hi(3) do j=lo(2)+1,hi(2) c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo enddo c ::: case 4, east face c ::: <* indexcond = Function[{i,j,k},i>0] ; *> c ::: <* maskray = maske ; *> c ::: <* tranderiv = trandere ; *> c ::: esb i = hi(1) do k=lo(3)+1,hi(3) do j=lo(2)+1,hi(2) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i+1,j,k,1)=-(<*FA[tauxx[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,2)=-(<*FA[tauxy[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,3)=-(<*FA[tauxz[i+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo enddo c ::: case 5, north face c ::: <* indexcond = Function[{i,j,k},j>0] ; *> c ::: <* maskray = maskn ; *> c ::: <* tranderiv = trandern ; *> c ::: wnb j = hi(2) do k=lo(3)+1,hi(3) do i=lo(1)+1,hi(1) c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j+1,k,1)=-(<*FA[tauxy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,2)=-(<*FA[tauyy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,3)=-(<*FA[tauyz[i,j+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo enddo c ::: case 6, south face c ::: <* indexcond = Function[{i,j,k},j<0] ; *> c ::: <* maskray = masks ; *> c ::: <* tranderiv = tranders ; *> c ::: wsb j = lo(2) do k=lo(3)+1,hi(3) do i=lo(1)+1,hi(1) c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo enddo c ::: case 7, top-north edge c ::: <* indexcond = Function[{i,j,k},(k>0||j>0)] ; *> c ::: <* Clear[maskray] *> c ::: <* Clear[tranderiv] *> c ::: tnw k=hi(3) j=hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j+1,k,1)=-(<*FA[tauxy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,2)=-(<*FA[tauyy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,3)=-(<*FA[tauyz[i,j+half,k]//. standardrepl] *>) zflux(i,j,k+1,1)=-(<*FA[tauxz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,2)=-(<*FA[tauyz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,3)=-(<*FA[tauzz[i,j,k+half]//. standardrepl] *>) enddo c ::: case 8, top-south edge c ::: <* indexcond = Function[{i,j,k},(k>0||j<0)] ; *> c ::: tsw k=hi(3) j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k+1,1)=-(<*FA[tauxz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,2)=-(<*FA[tauyz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,3)=-(<*FA[tauzz[i,j,k+half]//. standardrepl] *>) enddo c ::: case 9, top-west edge c ::: <* indexcond = Function[{i,j,k},(k>0||i<0)] ; *> c ::: tsw k=hi(3) i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k+1,1)=-(<*FA[tauxz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,2)=-(<*FA[tauyz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,3)=-(<*FA[tauzz[i,j,k+half]//. standardrepl] *>) enddo c ::: case 10, top-east edge c ::: <* indexcond = Function[{i,j,k},(k>0||i>0)] ; *> c ::: tes k=hi(3) i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> c ::: evaluate expression xflux(i+1,j,k,1)=-(<*FA[tauxx[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,2)=-(<*FA[tauxy[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,3)=-(<*FA[tauxz[i+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k+1,1)=-(<*FA[tauxz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,2)=-(<*FA[tauyz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,3)=-(<*FA[tauzz[i,j,k+half]//. standardrepl] *>) enddo c ::: case 11, bottom-north edge c ::: <* indexcond = Function[{i,j,k},(k<0||j>0)] ; *> c ::: bnw k=lo(3) j=hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j+1,k,1)=-(<*FA[tauxy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,2)=-(<*FA[tauyy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,3)=-(<*FA[tauyz[i,j+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo c ::: case 12, bottom-south edge c ::: <* indexcond = Function[{i,j,k},(k<0||j<0)] ; *> c ::: bsw k=lo(3) j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo c ::: case 13, bottom-west edge c ::: <* indexcond = Function[{i,j,k},(k<0||i<0)] ; *> c ::: bws k=lo(3) i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo c ::: case 14, bottom-east edge c ::: <* indexcond = Function[{i,j,k},(k<0||i>0)] ; *> c ::: bse k=lo(3) i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> c ::: evaluate expression xflux(i+1,j,k,1)=-(<*FA[tauxx[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,2)=-(<*FA[tauxy[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,3)=-(<*FA[tauxz[i+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo c ::: case 15, east-north edge c ::: <* indexcond = Function[{i,j,k},(j>0||i>0)] ; *> c ::: neb j=hi(2) i=hi(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i+1,j,k,1)=-(<*FA[tauxx[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,2)=-(<*FA[tauxy[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,3)=-(<*FA[tauxz[i+half,j,k]//. standardrepl] *>) yflux(i,j+1,k,1)=-(<*FA[tauxy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,2)=-(<*FA[tauyy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,3)=-(<*FA[tauyz[i,j+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo c ::: case 16, east-south edge c ::: <* indexcond = Function[{i,j,k},(j<0||i>0)] ; *> c ::: esb j=lo(2) i=hi(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i+1,j,k,1)=-(<*FA[tauxx[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,2)=-(<*FA[tauxy[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,3)=-(<*FA[tauxz[i+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo c ::: case 17, west-north edge c ::: <* indexcond = Function[{i,j,k},(j>0||i<0)] ; *> c ::: nwb j=hi(2) i=lo(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j+1,k,1)=-(<*FA[tauxy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,2)=-(<*FA[tauyy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,3)=-(<*FA[tauyz[i,j+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo c ::: case 18, west-south edge c ::: <* indexcond = Function[{i,j,k},(j<0||i<0)] ; *> c ::: swb j=lo(2) i=lo(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskray] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) enddo c ::: case 19, top-north-east corner c ::: <* indexcond = Function[{i,j,k},(k>0||j>0||i>0)] ; *> c ::: tbnsew k=hi(3) j=hi(2) i=hi(1) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,1)=-(<*FA[tauxx[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,2)=-(<*FA[tauxy[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,3)=-(<*FA[tauxz[i+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) yflux(i,j+1,k,1)=-(<*FA[tauxy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,2)=-(<*FA[tauyy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,3)=-(<*FA[tauyz[i,j+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k+1,1)=-(<*FA[tauxz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,2)=-(<*FA[tauyz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,3)=-(<*FA[tauzz[i,j,k+half]//. standardrepl] *>) c ::: case 20, top-north-west corner c ::: <* indexcond = Function[{i,j,k},(k>0||j>0||i<0)] ; *> c ::: tbnsw i=lo(1) j=hi(2) k=hi(3) c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) yflux(i,j+1,k,1)=-(<*FA[tauxy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,2)=-(<*FA[tauyy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,3)=-(<*FA[tauyz[i,j+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k+1,1)=-(<*FA[tauxz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,2)=-(<*FA[tauyz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,3)=-(<*FA[tauzz[i,j,k+half]//. standardrepl] *>) c ::: case 21, top-south-east corner c ::: <* indexcond = Function[{i,j,k},(k>0||j<0||i>0)] ; *> c ::: tbsew i=hi(1) j=lo(2) k=hi(3) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,1)=-(<*FA[tauxx[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,2)=-(<*FA[tauxy[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,3)=-(<*FA[tauxz[i+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k+1,1)=-(<*FA[tauxz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,2)=-(<*FA[tauyz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,3)=-(<*FA[tauzz[i,j,k+half]//. standardrepl] *>) c ::: case 22, top-south-west corner c ::: <* indexcond = Function[{i,j,k},(k>0||j<0||i<0)] ; *> c ::: tbsw i=lo(1) j=lo(2) k=hi(3) c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k+1,1)=-(<*FA[tauxz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,2)=-(<*FA[tauyz[i,j,k+half]//. standardrepl] *>) zflux(i,j,k+1,3)=-(<*FA[tauzz[i,j,k+half]//. standardrepl] *>) c ::: case 23, bottom-north-east corner c ::: <* indexcond = Function[{i,j,k},(k<0||j>0||i>0)] ; *> c ::: bnsew i=hi(1) j=hi(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,1)=-(<*FA[tauxx[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,2)=-(<*FA[tauxy[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,3)=-(<*FA[tauxz[i+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) yflux(i,j+1,k,1)=-(<*FA[tauxy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,2)=-(<*FA[tauyy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,3)=-(<*FA[tauyz[i,j+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) c ::: case 24, bottom-north-west corner c ::: <* indexcond = Function[{i,j,k},(k<0||j>0||i<0)] ; *> c ::: bnsw i=lo(1) j=hi(2) k=lo(3) c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) yflux(i,j+1,k,1)=-(<*FA[tauxy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,2)=-(<*FA[tauyy[i,j+half,k]//. standardrepl] *>) yflux(i,j+1,k,3)=-(<*FA[tauyz[i,j+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) c ::: case 25, bottom-south-east corner c ::: <* indexcond = Function[{i,j,k},(k<0||j<0||i>0)] ; *> c ::: bsew i=hi(1) j=lo(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,1)=-(<*FA[tauxx[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,2)=-(<*FA[tauxy[i+half,j,k]//. standardrepl] *>) xflux(i+1,j,k,3)=-(<*FA[tauxz[i+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) c ::: case 26, bottom-south-west corner c ::: <* indexcond = Function[{i,j,k},(k<0||j<0||i<0)] ; *> i=lo(1) j=lo(2) k=lo(3) c ::: get expressions for normal derivatives dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> c ::: evaluate expression xflux(i,j,k,1)=-(<*FA[tauxx[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,2)=-(<*FA[tauxy[i-1+half,j,k]//. standardrepl] *>) xflux(i,j,k,3)=-(<*FA[tauxz[i-1+half,j,k]//. standardrepl] *>) yflux(i,j,k,1)=-(<*FA[tauxy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,2)=-(<*FA[tauyy[i,j-1+half,k]//. standardrepl] *>) yflux(i,j,k,3)=-(<*FA[tauyz[i,j-1+half,k]//. standardrepl] *>) zflux(i,j,k,1)=-(<*FA[tauxz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,2)=-(<*FA[tauyz[i,j,k-1+half]//. standardrepl] *>) zflux(i,j,k,3)=-(<*FA[tauzz[i,j,k-1+half]//. standardrepl] *>) end ccseapps-2.5/CCSEApps/tensorMG/GNUmakefile0000644000175000017500000000252211634153073021470 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.8 1999/05/24 18:11:46 car Exp $ # PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) PRECISION = DOUBLE DEBUG = FALSE DEBUG = TRUE PROFILE = FALSE DIM = 3 DIM = 2 COMP = KCC USE_MPI = FALSE USE_MPI = TRUE USE_NETCDF = FALSE # # The base name of the library we're building. # LBASE = mcmg # # Where libraries and include files will be installed. # INSTALL_ROOT = $(TOP) include $(TOP)/mk/Make.defs ./Make.package INCLUDE_LOCATIONS += $(TOP)/include ifeq ($(KCC_VERSION),3.3) CXXFLAGS += --one_instantiation_per_object endif all: $(optionsLib) # # Libraries to close against. # ifeq ($(COMP), KCC) LibsToCloseAgainst := $(TOP)/lib/$(machineSuffix)/libmg$(DIM)d.a LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libamr$(DIM)d.a LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libbndry$(DIM)d.a LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libbox$(DIM)d.a $(optionsLib): $(LibsToCloseAgainst) endif ifeq ($(USE_NETCDF),TRUE) LIBRARIES += /usr/people/stevens/bin/libnetcdf.a INCLUDE_LOCATIONS += /usr/people/stevens/bin endif # # For running 3rd only # 3RD = 1 3RD = ifdef 3RD LDFLAGS += --link_command_prefix 3rd LDFLAGS += -non_shared -v endif ifeq ($(MACHINE),T3E) # # Turn off warning about double precision constants. # FOPTF += -M 1110 FDEBF += -M 1110 endif include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/tensorMG/DV_3D1.mF0000644000175000017500000035355511634153073020641 0ustar amckinstryamckinstry#include #include "DivVis_F.H" #include #include "ArrayLim.H" c :::: usage: c :::: this .mF file is meant to be run through Mathematica. This converts c :::: compact symbolic expressions into fortran which is stored in a .F c :::: file. c---------------------------------------------------------------- c this is the fortran support file for the the operator c L(U) = alpha*a(x)*U - beta*Div( tau ) c c where U is the two component vector (u,v) and c tau is a three by three tensor c tau = | t_xx t_xy t_xz| c | t_xy t_yy t_yz| c | t_xz t_yz t_zz| c c t_xx = 2*mu * u_x c t_yy = 2*mu * v_y c t_zz = 2*mu * w_z c t_xy = mu*(u_y + v_x) c t_xz = mu*(u_z + w_x) c t_yz = mu*(v_z + w_y) c ::: define standard replacements used by Mathematica c ::: see file visc3d.ma c ::: <* standardrepl = { dudx[i+half ,j ,k ]->dudxe, dudx[i-1+half,j ,k ]->dudxw, dvdy[i, j+half ,k ]->dvdyn , dvdy[i, j-1+half,k ]->dvdys , dwdz[i, j ,k+half ]->dwdzt, dwdz[i, j ,k-1+half]->dwdzb, dudy[i, j +half,k]-> dudyn , dudy[i, j-1+half,k]-> dudys , dudy[i+half, j ,k]-> dudye , dudy[i-1+half,j ,k]-> dudyw , dvdx[i, j +half,k]-> dvdxn , dvdx[i, j-1+half,k]-> dvdxs , dvdx[i+half, j ,k]-> dvdxe , dvdx[i-1+half,j ,k]-> dvdxw , dudz[i ,j ,k+half ]->dudzt, dudz[i ,j ,k-1+half]->dudzb, dudz[i+half ,j ,k ]->dudze, dudz[i-1+half,j ,k ]->dudzw, dvdz[i ,j ,k+half ]->dvdzt, dvdz[i ,j ,k-1+half]->dvdzb, dvdz[i ,j+half ,k ]->dvdzn, dvdz[i ,j-1+half,k ]->dvdzs, dwdx[i+half ,j ,k ]->dwdxe, dwdx[i+half-1,j ,k ]->dwdxw, dwdx[i ,j ,k+half ]->dwdxt, dwdx[i ,j ,k+half-1]->dwdxb, dwdy[i ,j+half ,k ]->dwdyn, dwdy[i ,j+half-1,k ]->dwdys, dwdy[i ,j ,k+half ]->dwdyt, dwdy[i ,j ,k+half-1]->dwdyb, murepl1, murepl2,murepl3, tauxxdef, tauyydef,tauxydef,tauxzdef,tauyzdef, tauzzdef, vol->hx*hy*hz }; *> c ::: interface notes: c ::: 1) trander* ALWAYS have values in them, even if the cells are c ::: all covered. Might as well. These are edge located derivative c ::: values. In index space, they are located the same as the mask c ::: cells. Which is somewhat anomalous. These are edge values, after c ::: all. While the masks are cell-centered. But it seems easier c ::: at the moment. c ::: 2) the normal derivatives are evaluated in the normal fashion. c ::: 3) tangential derivatives which reach outside the rectangle DO have c ::: to check the masks. subroutine FORT_DVAPPLY( $ u, DIMS(u), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ muZ, DIMS(muZ), $ out, DIMS(out), $ maskn,DIMS(maskn), $ maske,DIMS(maske), $ maskw,DIMS(maskw), $ masks,DIMS(masks), $ maskt,DIMS(maskt), $ maskb,DIMS(maskb), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ trandert,DIMS(trandert), $ tranderb,DIMS(tranderb), $ lo,hi,h $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(muZ) integer DIMDEC(out) integer DIMDEC(maskn) integer DIMDEC(maske) integer DIMDEC(maskw) integer DIMDEC(masks) integer DIMDEC(maskt) integer DIMDEC(maskb) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer DIMDEC(trandert) integer DIMDEC(tranderb) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) REAL_T h(BL_SPACEDIM) REAL_T u(DIMV(u),3) REAL_T a(DIMV(a)) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) REAL_T muZ(DIMV(muZ)) REAL_T out(DIMV(out),3) integer maskn(DIMV(maskn)) integer maske(DIMV(maske)) integer maskw(DIMV(maskw)) integer masks(DIMV(masks)) integer maskt(DIMV(maskt)) integer maskb(DIMV(maskb)) c ::: for transverse derives, first 3 is for variable, second 3 is for c ::: direction of derivative. Obviously not all are used, but this is easy. REAL_T trandern(DIMV(trandern),3,3) REAL_T trandere(DIMV(trandere),3,3) REAL_T tranderw(DIMV(tranderw),3,3) REAL_T tranders(DIMV(tranders),3,3) REAL_T trandert(DIMV(trandert),3,3) REAL_T tranderb(DIMV(tranderb),3,3) integer i,j,k REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy,hz REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw REAL_T dudyn,dudys REAL_T dvdxe,dvdxw REAL_T dvdxn,dvdxs REAL_T dudzb,dudzt REAL_T dwdzt,dwdzb REAL_T dwdxb,dwdxt REAL_T dvdzb,dvdzt REAL_T dwdyb,dwdyt REAL_T dudzw,dudze REAL_T dwdxw,dwdxe REAL_T dvdzs,dvdzn REAL_T dwdys,dwdyn logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) hz = h(3) c ::: cases: c ::: 0) interior. All usual derivative expressions c ::: 1-6) face but not on edge. c ::: 7-18) edge but not on corner. c ::: 19-26) corners. c ::: case 0 c ::: <* indexcond = Function[ {i,j,k}, False ] ; *> c ::: <* maskray = maskerr ; *> do k=lo(3)+1,hi(3)-1 do j=lo(2)+1,hi(2)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo enddo enddo c ::: case 1, top face c ::: <* indexcond = Function[{i,j,k},k>0] ; *> c ::: <* maskray = maskt ; *> c ::: <* tranderiv = trandert ; *> k=hi(3) do j=lo(2)+1,hi(2)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo enddo c ::: case 2, bottom face c ::: <* indexcond = Function[{i,j,k},k<0] ; *> c ::: <* maskray = maskb ; *> c ::: <* tranderiv = tranderb ; *> k=lo(3) do j=lo(2)+1,hi(2)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo enddo c ::: case 3, west face c ::: <* indexcond = Function[{i,j,k},i<0] ; *> c ::: <* maskray = maskw ; *> c ::: <* tranderiv = tranderw ; *> i = lo(1) do k=lo(3)+1,hi(3)-1 do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo enddo c ::: case 4, east face c ::: <* indexcond = Function[{i,j,k},i>0] ; *> c ::: <* maskray = maske ; *> c ::: <* tranderiv = trandere ; *> i = hi(1) do k=lo(3)+1,hi(3)-1 do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo enddo c ::: case 5, north face c ::: <* indexcond = Function[{i,j,k},j>0] ; *> c ::: <* maskray = maskn ; *> c ::: <* tranderiv = trandern ; *> j = hi(2) do k=lo(3)+1,hi(3)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo enddo c ::: case 6, south face c ::: <* indexcond = Function[{i,j,k},j<0] ; *> c ::: <* maskray = masks ; *> c ::: <* tranderiv = tranders ; *> j = lo(2) do k=lo(3)+1,hi(3)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo enddo c ::: case 7, top-north edge c ::: <* indexcond = Function[{i,j,k},(k>0||j>0)] ; *> c ::: <* Clear[maskray] *> c ::: <* Clear[tranderiv] *> k=hi(3) j=hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 8, top-south edge c ::: <* indexcond = Function[{i,j,k},(k>0||j<0)] ; *> k=hi(3) j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 9, top-west edge c ::: <* indexcond = Function[{i,j,k},(k>0||i<0)] ; *> k=hi(3) i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 10, top-east edge c ::: <* indexcond = Function[{i,j,k},(k>0||i>0)] ; *> k=hi(3) i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 11, bottom-north edge c ::: <* indexcond = Function[{i,j,k},(k<0||j>0)] ; *> k=lo(3) j=hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 12, bottom-south edge c ::: <* indexcond = Function[{i,j,k},(k<0||j<0)] ; *> k=lo(3) j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 13, bottom-west edge c ::: <* indexcond = Function[{i,j,k},(k<0||i<0)] ; *> k=lo(3) i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 14, bottom-east edge c ::: <* indexcond = Function[{i,j,k},(k<0||i>0)] ; *> k=lo(3) i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 15, east-north edge c ::: <* indexcond = Function[{i,j,k},(j>0||i>0)] ; *> j=hi(2) i=hi(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 16, east-south edge c ::: <* indexcond = Function[{i,j,k},(j<0||i>0)] ; *> j=lo(2) i=hi(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 17, west-north edge c ::: <* indexcond = Function[{i,j,k},(j>0||i<0)] ; *> j=hi(2) i=lo(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 18, west-south edge c ::: <* indexcond = Function[{i,j,k},(j<0||i<0)] ; *> j=lo(2) i=lo(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> enddo c ::: case 19, top-north-east corner c ::: <* indexcond = Function[{i,j,k},(k>0||j>0||i>0)] ; *> k=hi(3) j=hi(2) i=hi(1) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: case 20, top-north-west corner c ::: <* indexcond = Function[{i,j,k},(k>0||j>0||i<0)] ; *> i=lo(1) j=hi(2) k=hi(3) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: case 21, top-south-east corner c ::: <* indexcond = Function[{i,j,k},(k>0||j<0||i>0)] ; *> i=hi(1) j=lo(2) k=hi(3) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: case 22, top-south-west corner c ::: <* indexcond = Function[{i,j,k},(k>0||j<0||i<0)] ; *> i=lo(1) j=lo(2) k=hi(3) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: case 23, bottom-north-east corner c ::: <* indexcond = Function[{i,j,k},(k<0||j>0||i>0)] ; *> i=hi(1) j=hi(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: case 24, bottom-north-west corner c ::: <* indexcond = Function[{i,j,k},(k<0||j>0||i<0)] ; *> i=lo(1) j=hi(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: case 25, bottom-south-east corner c ::: <* indexcond = Function[{i,j,k},(k<0||j<0||i>0)] ; *> i=hi(1) j=lo(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: case 26, bottom-south-west corner c ::: <* indexcond = Function[{i,j,k},(k<0||j<0||i<0)] ; *> i=lo(1) j=lo(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: evaluate expression out(i,j,k,1) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,2) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> out(i,j,k,3) = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> return end ccseapps-2.5/CCSEApps/tensorMG/MCLO_F.H0000644000175000017500000001135411634153073020531 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MCLO_F_H_ #define _MCLO_F_H_ #include #if defined(BL_LANG_FORT) #if (BL_SPACEDIM == 2) #define FORT_AVERAGECC mcaveragecc2dgen #define FORT_AVERAGEEC mcaverageec2dgen #define FORT_HARMONIC_AVERAGEEC mcharaverageec2dgen #define FORT_RESIDL mcresid2dgen #endif #if (BL_SPACEDIM == 3) #define FORT_AVERAGECC mcaveragecc3dgen #define FORT_AVERAGEEC mcaverageec3dgen #define FORT_HARMONIC_AVERAGEEC mcharaverageec3dgen #define FORT_RESIDL mcresid3dgen #endif #else #if (BL_SPACEDIM == 2) #if defined(BL_FORT_USE_UPPERCASE) #define FORT_AVERAGECC MCAVERAGECC2DGEN #define FORT_AVERAGEEC MCAVERAGEEC2DGEN #define FORT_HARMONIC_AVERAGEEC MCHARAVERAGEEC2DGEN #define FORT_RESIDL MCRESID2DGEN #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_AVERAGECC mcaveragecc2dgen #define FORT_AVERAGEEC mcaverageec2dgen #define FORT_HARMONIC_AVERAGEEC mcharaverageec2dgen #define FORT_RESIDL mcresid2dgen #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_AVERAGECC mcaveragecc2dgen_ #define FORT_AVERAGEEC mcaverageec2dgen_ #define FORT_HARMONIC_AVERAGEEC mcharaverageec2dgen_ #define FORT_RESIDL mcresid2dgen_ #endif #endif #if (BL_SPACEDIM == 3) #if defined(BL_FORT_USE_UPPERCASE) #define FORT_AVERAGECC MCAVERAGECC3DGEN #define FORT_AVERAGEEC MCAVERAGEEC3DGEN #define FORT_HARMONIC_AVERAGEEC MCHARAVERAGEEC3DGEN #define FORT_RESIDL MCRESID3DGEN #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_AVERAGECC mcaveragecc3dgen #define FORT_AVERAGEEC mcaverageec3dgen #define FORT_HARMONIC_AVERAGEEC mcharaverageec3dgen #define FORT_RESIDL mcresid3dgen #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_AVERAGECC mcaveragecc3dgen_ #define FORT_AVERAGEEC mcaverageec3dgen_ #define FORT_HARMONIC_AVERAGEEC mcharaverageec3dgen_ #define FORT_RESIDL mcresid3dgen_ #endif #endif #include extern "C" { void FORT_RESIDL ( Real* res , ARLIM_P(res_lo), ARLIM_P(res_hi), const Real* rhs, ARLIM_P(rhs_lo), ARLIM_P(rhs_hi), const Real* phi, ARLIM_P(phi_lo), ARLIM_P(phi_hi), const int* lo, const int* hi, const int* nc ); void FORT_APPLYBC( const int *flagden, // 1 if want values in den const int *flagbc, // 1 for inhomogeneous const int *maxorder, // maxorder of interpolant Real *phi, ARLIM_P(phi_lo), ARLIM_P(phi_hi), const int *cdir, const int *bct, const Real *bcl, const Real *bcval, ARLIM_P(bcval_lo), ARLIM_P(bcval_hi), const int *mask, ARLIM_P(mask_lo), ARLIM_P(mask_hi), const int *maskp, ARLIM_P(maskp_lo), ARLIM_P(maskp_hi), const int *maskm, ARLIM_P(maskm_lo), ARLIM_P(maskm_hi), Real *den, ARLIM_P(den_lo), ARLIM_P(den_hi), const Real *exttd, ARLIM_P(exttd_lo), ARLIM_P(exttd_hi), Real *tander, ARLIM_P(tander_lo),ARLIM_P(tander_hi), const int *lo, const int *hi, const int *nc, const Real *h ); void FORT_AVERAGECC ( Real* crseX, ARLIM_P(crseX_lo), ARLIM_P(crseX_hi), const Real* fineX, ARLIM_P(fineX_lo), ARLIM_P(fineX_hi), const int *tlo, const int *thi, const int *nc ); void FORT_AVERAGEEC ( Real* crseX, ARLIM_P(crseX_lo), ARLIM_P(crseX_hi), const Real* fineX, ARLIM_P(fineX_lo), ARLIM_P(fineX_hi), const int *tlo, const int *thi, const int *nc, const int *axis ); void FORT_HARMONIC_AVERAGEEC ( Real* crseX, ARLIM_P(crseX_lo), ARLIM_P(crseX_hi), const Real* fineX, ARLIM_P(fineX_lo), ARLIM_P(fineX_hi), const int *tlo, const int *thi, const int *nc, const int *axis ); } #endif #endif /*_MCLO_F_H_*/ ccseapps-2.5/CCSEApps/tensorMG/MCINTERPBNDRYDATA_F.H0000644000175000017500000001164211634153073022451 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _INTERPBNDRY_F_H_ #define _INTERPBNDRY_F_H_ "%W% %G%" #ifdef BL_LANG_FORT # define FORT_BDINTERPXLO mcbdintrpxlo # define FORT_BDINTERPXHI mcbdintrpxhi # define FORT_BDIDERIVXLO mcbdiderivxlo # define FORT_BDIDERIVXHI mcbdiderivxhi # if (BL_SPACEDIM > 1) # define FORT_BDINTERPYLO mcbdintrpylo # define FORT_BDINTERPYHI mcbdintrpyhi # define FORT_BDIDERIVYLO mcbdiderivylo # define FORT_BDIDERIVYHI mcbdiderivyhi # endif # if (BL_SPACEDIM > 2) # define FORT_BDINTERPZLO mcbdintrpzlo # define FORT_BDINTERPZHI mcbdintrpzhi # define FORT_BDIDERIVZLO mcbdiderivzlo # define FORT_BDIDERIVZHI mcbdiderivzhi # endif #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_BDINTERPXLO MCBDINTRPXLO # define FORT_BDINTERPXHI MCBDINTRPXHI # define FORT_BDIDERIVXLO MCBDIDERIVXLO # define FORT_BDIDERIVXHI MCBDIDERIVXHI # if (BL_SPACEDIM > 1) # define FORT_BDINTERPYLO MCBDINTRPYLO # define FORT_BDINTERPYHI MCBDINTRPYHI # define FORT_BDIDERIVYLO MCBDIDERIVYLO # define FORT_BDIDERIVYHI MCBDIDERIVYHI # endif # if (BL_SPACEDIM > 2) # define FORT_BDINTERPZLO MCBDINTRPZLO # define FORT_BDINTERPZHI MCBDINTRPZHI # define FORT_BDIDERIVZLO MCBDIDERIVZLO # define FORT_BDIDERIVZHI MCBDIDERIVZHI # endif # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_BDINTERPXLO mcbdintrpxlo # define FORT_BDINTERPXHI mcbdintrpxhi # define FORT_BDIDERIVXLO mcbdiderivxlo # define FORT_BDIDERIVXHI mcbdiderivxhi # if (BL_SPACEDIM > 1) # define FORT_BDINTERPYLO mcbdintrpylo # define FORT_BDINTERPYHI mcbdintrpyhi # define FORT_BDIDERIVYLO mcbdiderivylo # define FORT_BDIDERIVYHI mcbdiderivyhi # endif # if (BL_SPACEDIM > 2) # define FORT_BDINTERPZLO mcbdintrpzlo # define FORT_BDINTERPZHI mcbdintrpzhi # define FORT_BDIDERIVZLO mcbdiderivzlo # define FORT_BDIDERIVZHI mcbdiderivzhi # endif # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_BDINTERPXLO mcbdintrpxlo_ # define FORT_BDINTERPXHI mcbdintrpxhi_ # define FORT_BDIDERIVXLO mcbdiderivxlo_ # define FORT_BDIDERIVXHI mcbdiderivxhi_ # if (BL_SPACEDIM > 1) # define FORT_BDINTERPYLO mcbdintrpylo_ # define FORT_BDINTERPYHI mcbdintrpyhi_ # define FORT_BDIDERIVYLO mcbdiderivylo_ # define FORT_BDIDERIVYHI mcbdiderivyhi_ # endif # if (BL_SPACEDIM > 2) # define FORT_BDINTERPZLO mcbdintrpzlo_ # define FORT_BDINTERPZHI mcbdintrpzhi_ # define FORT_BDIDERIVZLO mcbdiderivzlo_ # define FORT_BDIDERIVZHI mcbdiderivzhi_ # endif #endif #include typedef void BDInterpFunc(Real* bndr, ARLIM_P(blo), ARLIM_P(bhi), const int* lo, const int* hi, ARLIM_P(cblo), ARLIM_P(cbhi), const int* nvar, const int* ratio, const int* not_covered, const int* mask, ARLIM_P(mlo), ARLIM_P(mhi), const Real* crse, ARLIM_P(clo), ARLIM_P(chi), Real* derives, const Real* hfine); typedef void BDPhysDerivative(Real* bndr, ARLIM_P(blo), ARLIM_P(bhi), const int* lo, const int* hi, const Real* finefab, ARLIM_P(flo), ARLIM_P(fhi), const int* nvar, const Real* hfine); extern "C" { BDInterpFunc FORT_BDINTERPXLO; BDInterpFunc FORT_BDINTERPXHI; BDPhysDerivative FORT_BDIDERIVXLO; BDPhysDerivative FORT_BDIDERIVXHI; #if (BL_SPACEDIM > 1) BDInterpFunc FORT_BDINTERPYLO; BDInterpFunc FORT_BDINTERPYHI; BDPhysDerivative FORT_BDIDERIVYLO; BDPhysDerivative FORT_BDIDERIVYHI; #endif #if (BL_SPACEDIM > 2) BDInterpFunc FORT_BDINTERPZLO; BDInterpFunc FORT_BDINTERPZHI; BDPhysDerivative FORT_BDIDERIVZLO; BDPhysDerivative FORT_BDIDERIVZHI; #endif } #endif #endif ccseapps-2.5/CCSEApps/tensorMG/visc3d.nb0000644000175000017500000023332111634153073021135 0ustar amckinstryamckinstry(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 61315, 2219]*) (*NotebookOutlinePosition[ 62304, 2253]*) (* CellTagsIndexPosition[ 62260, 2249]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell[TextData[ "a clone of visc2d.ma which\nshould work in 3D"], "Subtitle", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData["definition of tau"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ tauxxdef = tauxx[i_ + half, j_ ,k_] -> \t\t2*mu[i+half,j,k]*dudx[i+half,j,k]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(tauxx[half + i_, j_, k_] \[Rule] 2\ dudx[half + i, j, k]\ mu[half + i, j, k]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ tauyydef = tauyy[i_, j_ + half,k_] -> \t\t2*mu[i,j+half,k] * dvdy[i,j+half,k]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(tauyy[i_, half + j_, k_] \[Rule] 2\ dvdy[i, half + j, k]\ mu[i, half + j, k]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ tauzzdef = tauzz[i_,j_,k_+half] -> \t\t2*mu[i,j,k+half]*dwdz[i,j,k+half]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(tauzz[i_, j_, half + k_] \[Rule] 2\ dwdz[i, j, half + k]\ mu[i, j, half + k]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ tauxydef = tauxy[i_,j_,k_] -> mu[i,j,k]* \t\t\t\t\t\t\t(dudy[i,j,k]+dvdx[i,j,k])\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(tauxydef\)\" is similar \ to existing symbols \!\({tauxxdef, tauyydef}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(tauxy\)\" is similar to \ existing symbols \!\({tauxx, tauyy}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dudy\)\" is similar to \ existing symbols \!\({dudx, dvdy}\)."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell\"\) will be suppressed during \ this calculation."\)], "Message"], Cell[BoxData[ \(tauxy[i_, j_, k_] \[Rule] \((dudy[i, j, k] + dvdx[i, j, k])\)\ mu[i, j, k]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ tauxzdef = tauxz[i_,j_,k_] -> mu[i,j,k]* \t\t\t\t\t\t\t(dudz[i,j,k]+dwdx[i,j,k])\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(tauxzdef\)\" is similar \ to existing symbols \!\({tauxxdef, tauxydef, tauzzdef}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(tauxz\)\" is similar to \ existing symbols \!\({tauxx, tauxy, tauzz}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dudz\)\" is similar to \ existing symbols \!\({dudx, dudy, dwdz}\)."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell\"\) will be suppressed during \ this calculation."\)], "Message"], Cell[BoxData[ \(tauxz[i_, j_, k_] \[Rule] \((dudz[i, j, k] + dwdx[i, j, k])\)\ mu[i, j, k]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ tauyzdef = tauyz[i_,j_,k_] -> mu[i,j,k]* \t\t\t\t\t\t\t(dvdz[i,j,k]+dwdy[i,j,k])\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(tauyzdef\)\" is similar \ to existing symbols \!\({tauxzdef, tauyydef, tauzzdef}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(tauyz\)\" is similar to \ existing symbols \!\({tauxz, tauyy, tauzz}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dvdz\)\" is similar to \ existing symbols \!\({dudz, dvdx, dvdy, dwdz}\)."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell\"\) will be suppressed during \ this calculation."\)], "Message"], Cell[BoxData[ \(tauyz[i_, j_, k_] \[Rule] \((dvdz[i, j, k] + dwdy[i, j, k])\)\ mu[i, j, k]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["definitions of derivatives"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData["diagonal derivatives"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ dudxdef = dudx[i_+half,j_,k_] -> \t\t(u[i+1,j,k]-u[i,j,k])/hx\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(dudx[half + i_, j_, k_] \[Rule] \(\(-u[i, j, k]\) + u[1 + i, j, k]\)\/hx\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ dvdydef = dvdy[i_,j_+half,k_] -> \t\t(v[i,j+1,k]-v[i,j,k])/hy\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(dvdy[i_, half + j_, k_] \[Rule] \(\(-v[i, j, k]\) + v[i, 1 + j, k]\)\/hy\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ dwdzdef = dwdz[i_,j_,k_+half] -> \t\t(w[i,j,k+1]-w[i,j,k])/hz\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(dwdz[i_, j_, half + k_] \[Rule] \(\(-w[i, j, k]\) + w[i, j, 1 + k]\)\/hz\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["dudy"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dudydef1 = dudy[i_,j_+half,k_] -> (u[i,j+1,k]-u[i,j,k])/hy", "Input", AspectRatioFixed->True], Cell[BoxData[ \(dudy[i_, half + j_, k_] \[Rule] \(\(-u[i, j, k]\) + u[i, 1 + j, k]\)\/hy\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ dudydef2 = dudy[i_+half,j_,k_] -> \t\t(u[i,j+1,k]-u[i,j-1,k]+u[i+1,j+1,k]-u[i+1,j-1,k])/ \t\t\t\t\t\t\t\t\t\t\t\t\t(4*hy)\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(dudy[half + i_, j_, k_] \[Rule] \(1\/\(4\ hy\)\(( \(-u[i, \(-1\) + j, k]\) + u[i, 1 + j, k] - u[1 + i, \(-1\) + j, k] + u[1 + i, 1 + j, k])\)\)\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["dudz"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dudzdef1 = dudz[i_,j_,k_+half]->(u[i,j,k+1]-u[i,j,k])/hz", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(dudzdef1\)\" is similar \ to existing symbol \"\!\(dudydef1\)\"."\)], "Message"], Cell[BoxData[ \(dudz[i_, j_, half + k_] \[Rule] \(\(-u[i, j, k]\) + u[i, j, 1 + k]\)\/hz\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ dudzdef2 = dudz[i_+half,j_,k_] -> \t\t(u[i,j,k+1]-u[i,j,k-1]+u[i+1,j,k+1]-u[i+1,j,k-1])/ \t\t\t\t\t\t\t\t\t\t\t\t(4*hz)\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(dudzdef2\)\" is similar \ to existing symbol \"\!\(dudydef2\)\"."\)], "Message"], Cell[BoxData[ \(dudz[half + i_, j_, k_] \[Rule] \(1\/\(4\ hz\)\(( \(-u[i, j, \(-1\) + k]\) + u[i, j, 1 + k] - u[1 + i, j, \(-1\) + k] + u[1 + i, j, 1 + k])\)\)\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["dvdx"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dvdxdef1 = dvdx[i_+half,j_,k_] -> (v[i+1,j,k]-v[i,j,k])/hx", "Input", AspectRatioFixed->True], Cell[BoxData[ \(dvdx[half + i_, j_, k_] \[Rule] \(\(-v[i, j, k]\) + v[1 + i, j, k]\)\/hx\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ dvdxdef2 = dvdx[i_,j_+half,k_] -> \t\t(v[i+1,j+1,k]-v[i-1,j+1,k]+v[i+1,j,k]-v[i-1,j,k])/(4*hx)\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(dvdx[i_, half + j_, k_] \[Rule] \(1\/\(4\ hx\)\(( \(-v[\(-1\) + i, j, k]\) - v[\(-1\) + i, 1 + j, k] + v[1 + i, j, k] + v[1 + i, 1 + j, k])\)\)\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["dvdz"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dvdzdef1 = dvdz[i_,j_,k_+half]->(v[i,j,k+1]-v[i,j,k])/hz", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dvdzdef1\)\" is similar \ to existing symbols \!\({dudzdef1, dvdxdef1}\)."\)], "Message"], Cell[BoxData[ \(dvdz[i_, j_, half + k_] \[Rule] \(\(-v[i, j, k]\) + v[i, j, 1 + k]\)\/hz\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ dvdzdef2 = dvdz[i_,j_+half,k_]-> \t\t(v[i,j,k+1]-v[i,j,k-1]+v[i,j+1,k+1]-v[i,j+1,k-1])/ \t\t\t\t\t\t\t\t\t\t\t\t(4*hz)\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dvdzdef2\)\" is similar \ to existing symbols \!\({dudzdef2, dvdxdef2}\)."\)], "Message"], Cell[BoxData[ \(dvdz[i_, half + j_, k_] \[Rule] \(1\/\(4\ hz\)\(( \(-v[i, j, \(-1\) + k]\) + v[i, j, 1 + k] - v[i, 1 + j, \(-1\) + k] + v[i, 1 + j, 1 + k])\)\)\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["dwdx"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dwdxdef1 = dwdx[i_+half,j_,k_]->(w[i+1,j,k]-w[i,j,k])/hx", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(dwdxdef1\)\" is similar \ to existing symbol \"\!\(dvdxdef1\)\"."\)], "Message"], Cell[BoxData[ \(dwdx[half + i_, j_, k_] \[Rule] \(\(-w[i, j, k]\) + w[1 + i, j, k]\)\/hx\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ dwdxdef2 = dwdx[i_,j_,k_+half]-> \t\t(w[i+1,j,k]-w[i-1,j,k]+w[i+1,j,k+1]-w[i-1,j,k+1])/ \t\t\t\t\t\t\t\t\t\t\t(4*hx)\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(dwdxdef2\)\" is similar \ to existing symbol \"\!\(dvdxdef2\)\"."\)], "Message"], Cell[BoxData[ \(dwdx[i_, j_, half + k_] \[Rule] \(1\/\(4\ hx\)\(( \(-w[\(-1\) + i, j, k]\) - w[\(-1\) + i, j, 1 + k] + w[1 + i, j, k] + w[1 + i, j, 1 + k])\)\)\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["dwdy"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ dwdydef1 = dwdy[i_,j_+half,k_] -> \t\t(w[i,j+1,k]-w[i,j,k])/hy\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dwdydef1\)\" is similar \ to existing symbols \!\({dudydef1, dwdxdef1}\)."\)], "Message"], Cell[BoxData[ \(dwdy[i_, half + j_, k_] \[Rule] \(\(-w[i, j, k]\) + w[i, 1 + j, k]\)\/hy\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ dwdydef2 = dwdy[i_,j_,k_+half] -> \t(w[i,j+1,k]-w[i,j-1,k]+w[i,j+1,k+1]-w[i,j-1,k+1])/(4*hy)\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dwdydef2\)\" is similar \ to existing symbols \!\({dudydef2, dwdxdef2}\)."\)], "Message"], Cell[BoxData[ \(dwdy[i_, j_, half + k_] \[Rule] \(1\/\(4\ hy\)\(( \(-w[i, \(-1\) + j, k]\) - w[i, \(-1\) + j, 1 + k] + w[i, 1 + j, k] + w[i, 1 + j, 1 + k])\)\)\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["definitions used to test taylor expansions"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ taylorudef = u[i_,j_,k_]-> \t\t\tU[x0,y0,z0]+ \t\t\tDuDx[x0,y0,z0]*((i+1/2)*hx-x0)+ \t\t\tDuDy[x0,y0,z0]*((j+1/2)*hy-y0)+ \t\t\tDuDz[x0,y0,z0]*((k+1/2)*hz-z0)+ \t\t\tD2uDy2[x0,y0,z0]/2*((i+1/2)*hx-x0)^2+ \t\t\tD2uDx2[x0,y0,z0]/2*((j+1/2)*hy-y0)^2+ \t\t\tD2uDz2[x0,y0,z0]/2*((k+1/2)*hz-z0)^2+ \t\t\tD2uDxDy[x0,y0,z0]*((i+1/2)*hx-x0)*((j+1/2)*hy-y0)+ \t\t\tD2uDxDz[x0,y0,z0]*((i+1/2)*hx-x0)*((k+1/2)*hz-z0)+ \t\t\tD2uDyDz[x0,y0,z0]*((j+1/2)*hy-y0)*((k+1/2)*hz-z0)\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(DuDy\)\" is similar to \ existing symbol \"\!\(DuDx\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DuDz\)\" is similar to \ existing symbols \!\({DuDx, DuDy}\)."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(D2uDx2\)\" is similar \ to existing symbol \"\!\(D2uDy2\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(D2uDz2\)\" is similar \ to existing symbols \!\({D2uDx2, D2uDy2}\)."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(D2uDxDz\)\" is similar \ to existing symbol \"\!\(D2uDxDy\)\"."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell1\"\) will be suppressed \ during this calculation."\)], "Message"], Cell[BoxData[ \(u[i_, j_, k_] \[Rule] 1\/2\ \((hy\ \((1\/2 + j)\) - y0)\)\^2\ D2uDx2[x0, y0, z0] + \((hx\ \((1\/2 + i)\) - x0)\)\ \((hy\ \((1\/2 + j)\) - y0)\)\ D2uDxDy[x0, y0, z0] + \((hx\ \((1\/2 + i)\) - x0)\)\ \((hz\ \((1\/2 + k)\) - z0)\)\ D2uDxDz[x0, y0, z0] + 1\/2\ \((hx\ \((1\/2 + i)\) - x0)\)\^2\ D2uDy2[x0, y0, z0] + \((hy\ \((1\/2 + j)\) - y0)\)\ \((hz\ \((1\/2 + k)\) - z0)\)\ D2uDyDz[x0, y0, z0] + 1\/2\ \((hz\ \((1\/2 + k)\) - z0)\)\^2\ D2uDz2[x0, y0, z0] + \((hx\ \((1\/2 + i)\) - x0)\)\ DuDx[x0, y0, z0] + \((hy\ \((1\/2 + j)\) - y0)\)\ DuDy[x0, y0, z0] + \((hz\ \((1\/2 + k)\) - z0)\)\ DuDz[x0, y0, z0] + U[x0, y0, z0]\)], "Output"] }, Open ]], Cell["dog = dudy[i+half,j,k] //. {dudydef1,dudydef2,taylorudef} ;", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog /. {i->0,j->0,k->0,x0->hx,y0->hy/2,z0->hz/2}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDy[hx, hy\/2, hz\/2]\)], "Output"] }, Open ]], Cell["dog = dudy[i,j+half,k] //. {dudydef1,dudydef2,taylorudef} ;", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog /. {i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDy[hx\/2, hy, hz\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ taylorvdef = v[i_,j_,k_]-> \t\t\tV[x0,y0,z0]+ \t\t\tDvDx[x0,y0,z0]*((i+1/2)*hx-x0)+ \t\t\tDvDy[x0,y0,z0]*((j+1/2)*hy-y0)+ \t\t\tDvDz[x0,y0,z0]*((k+1/2)*hz-z0)+ \t\t\tD2vDy2[x0,y0,z0]/2*((i+1/2)*hx-x0)^2+ \t\t\tD2vDx2[x0,y0,z0]/2*((j+1/2)*hy-y0)^2+ \t\t\tD2vDz2[x0,y0,z0]/2*((k+1/2)*hz-z0)^2+ \t\t\tD2vDxDy[x0,y0,z0]*((i+1/2)*hx-x0)*((j+1/2)*hy-y0)+ \t\t\tD2vDxDz[x0,y0,z0]*((i+1/2)*hx-x0)*((k+1/2)*hz-z0)+ \t\t\tD2vDyDz[x0,y0,z0]*((j+1/2)*hy-y0)*((k+1/2)*hz-z0)\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(taylorvdef\)\" is \ similar to existing symbol \"\!\(taylorudef\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(DvDx\)\" is similar to \ existing symbol \"\!\(DuDx\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DvDy\)\" is similar to \ existing symbols \!\({DuDy, DvDx}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DvDz\)\" is similar to \ existing symbols \!\({DuDz, DvDx, DvDy}\)."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(D2vDy2\)\" is similar \ to existing symbol \"\!\(D2uDy2\)\"."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell1\"\) will be suppressed \ during this calculation."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(D2vDx2\)\" is similar \ to existing symbols \!\({D2uDx2, D2vDy2}\)."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell\"\) will be suppressed during \ this calculation."\)], "Message"], Cell[BoxData[ \(v[i_, j_, k_] \[Rule] 1\/2\ \((hy\ \((1\/2 + j)\) - y0)\)\^2\ D2vDx2[x0, y0, z0] + \((hx\ \((1\/2 + i)\) - x0)\)\ \((hy\ \((1\/2 + j)\) - y0)\)\ D2vDxDy[x0, y0, z0] + \((hx\ \((1\/2 + i)\) - x0)\)\ \((hz\ \((1\/2 + k)\) - z0)\)\ D2vDxDz[x0, y0, z0] + 1\/2\ \((hx\ \((1\/2 + i)\) - x0)\)\^2\ D2vDy2[x0, y0, z0] + \((hy\ \((1\/2 + j)\) - y0)\)\ \((hz\ \((1\/2 + k)\) - z0)\)\ D2vDyDz[x0, y0, z0] + 1\/2\ \((hz\ \((1\/2 + k)\) - z0)\)\^2\ D2vDz2[x0, y0, z0] + \((hx\ \((1\/2 + i)\) - x0)\)\ DvDx[x0, y0, z0] + \((hy\ \((1\/2 + j)\) - y0)\)\ DvDy[x0, y0, z0] + \((hz\ \((1\/2 + k)\) - z0)\)\ DvDz[x0, y0, z0] + V[x0, y0, z0]\)], "Output"] }, Open ]], Cell["dog = dvdy[i,j+half,k] //. {dvdydef, taylorvdef} ;", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog /. {i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DvDy[hx\/2, hy, hz\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ taylorwdef = w[i_,j_,k_]-> \t\t\tW[x0,y0,z0]+ \t\t\tDwDx[x0,y0,z0]*((i+1/2)*hx-x0)+ \t\t\tDwDy[x0,y0,z0]*((j+1/2)*hy-y0)+ \t\t\tDwDz[x0,y0,z0]*((k+1/2)*hz-z0)+ \t\t\tD2wDy2[x0,y0,z0]/2*((i+1/2)*hx-x0)^2+ \t\t\tD2wDx2[x0,y0,z0]/2*((j+1/2)*hy-y0)^2+ \t\t\tD2wDz2[x0,y0,z0]/2*((k+1/2)*hz-z0)^2+ \t\t\tD2wDxDy[x0,y0,z0]*((i+1/2)*hx-x0)*((j+1/2)*hy-y0)+ \t\t\tD2wDxDz[x0,y0,z0]*((i+1/2)*hx-x0)*((k+1/2)*hz-z0)+ \t\t\tD2wDyDz[x0,y0,z0]*((j+1/2)*hy-y0)*((k+1/2)*hz-z0)\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(taylorwdef\)\" is \ similar to existing symbols \!\({taylorudef, taylorvdef}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DwDx\)\" is similar to \ existing symbols \!\({DuDx, DvDx}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DwDy\)\" is similar to \ existing symbols \!\({DuDy, DvDy, DwDx}\)."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell\"\) will be suppressed during \ this calculation."\)], "Message"], Cell[BoxData[ \(w[i_, j_, k_] \[Rule] 1\/2\ \((hy\ \((1\/2 + j)\) - y0)\)\^2\ D2wDx2[x0, y0, z0] + \((hx\ \((1\/2 + i)\) - x0)\)\ \((hy\ \((1\/2 + j)\) - y0)\)\ D2wDxDy[x0, y0, z0] + \((hx\ \((1\/2 + i)\) - x0)\)\ \((hz\ \((1\/2 + k)\) - z0)\)\ D2wDxDz[x0, y0, z0] + 1\/2\ \((hx\ \((1\/2 + i)\) - x0)\)\^2\ D2wDy2[x0, y0, z0] + \((hy\ \((1\/2 + j)\) - y0)\)\ \((hz\ \((1\/2 + k)\) - z0)\)\ D2wDyDz[x0, y0, z0] + 1\/2\ \((hz\ \((1\/2 + k)\) - z0)\)\^2\ D2wDz2[x0, y0, z0] + \((hx\ \((1\/2 + i)\) - x0)\)\ DwDx[x0, y0, z0] + \((hy\ \((1\/2 + j)\) - y0)\)\ DwDy[x0, y0, z0] + \((hz\ \((1\/2 + k)\) - z0)\)\ DwDz[x0, y0, z0] + W[x0, y0, z0]\)], "Output"] }, Open ]], Cell["dog = dwdy[i,j+half,k] //. {dwdydef1,dwdydef2, taylorwdef} ;", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog /. {i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DwDy[hx\/2, hy, hz\/2]\)], "Output"] }, Open ]], Cell["dog = dwdy[i,j,k+half] //. {dwdydef1,dwdydef2, taylorwdef} ;", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog /. {i->0,j->0,k->0,x0->hx/2,y0->hy/2,z0->hz}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DwDy[hx\/2, hy\/2, hz]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ taylormudef = mu[i_,j_]-> \t\t\tMU[x0,y0,z0]+ \t\t\tDmuDx[x0,y0,z0]*((i+1/2)*hx-x0)+ \t\t\tDmuDy[x0,y0,z0]*((j+1/2)*hy-y0)+ \t\t\tDmuDz[x0,y0,z0]*((k+1/2)*hz-z0) \ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(taylormudef\)\" is \ similar to existing symbol \"\!\(taylorudef\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(DmuDx\)\" is similar to \ existing symbol \"\!\(DuDx\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DmuDy\)\" is similar to \ existing symbols \!\({DmuDx, DuDy}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DmuDz\)\" is similar to \ existing symbols \!\({DmuDx, DmuDy, DuDz}\)."\)], "Message"], Cell[BoxData[ \(mu[i_, j_] \[Rule] \((hx\ \((1\/2 + i)\) - x0)\)\ DmuDx[x0, y0, z0] + \((hy\ \((1\/2 + j)\) - y0)\)\ DmuDy[x0, y0, z0] + \((hz\ \((1\/2 + k)\) - z0)\)\ DmuDz[x0, y0, z0] + MU[x0, y0, z0]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["tests"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData["diagonal elements of tau"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ dog = tauxx[i+half,j,k] //. \t\t{tauxxdef,dudxdef,taylormudef,taylorudef};\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ dog //. {half->1/2,i->0,j->0,k->0,x0->hx,y0 -> hy/2,z0->hz/2 } \ \ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(2\ DuDx[hx, hy\/2, hz\/2]\ mu[1\/2, 0, 0]\)], "Output"] }, Open ]], Cell["\<\ dog = tauyy[i,j+half,k] //. \t\t{tauyydef,dvdydef,taylormudef,taylorvdef};\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(2\ DvDy[hx\/2, hy, hz\/2]\ mu[0, 1\/2, 0]\)], "Output"] }, Open ]], Cell["\<\ dog = tauzz[i,j,k+half] //. \t\t{tauzzdef,dwdzdef,taylormudef,taylorvdef,taylorwdef};\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy/2,z0->hz}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(2\ DwDz[hx\/2, hy\/2, hz]\ mu[0, 0, 1\/2]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[" tauxy"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ dog = tauxy[i,j+half,k] //. \t\t{tauxydef,dudydef1,dudydef2,dvdxdef1,dvdxdef2, \t\t taylormudef,taylorudef,taylorvdef};\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(\((DuDy[hx\/2, hy, hz\/2] + DvDx[hx\/2, hy, hz\/2])\)\ mu[0, 1\/2, 0]\)], "Output"] }, Open ]], Cell["\<\ dog = tauxy[i+half,j,k] //. \t\t{tauxydef,dudydef1,dudydef2,dvdxdef1,dvdxdef2, \t\t taylormudef,taylorudef,taylorvdef};\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog //. {half->1/2,i->0,j->0,k->0,x0->hx,y0->hy/2,z0->hz/2}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(\((DuDy[hx, hy\/2, hz\/2] + DvDx[hx, hy\/2, hz\/2])\)\ mu[1\/2, 0, 0]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[" tauxz"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ dog = tauxz[i+half,j,k] //. \t\t{tauxzdef,dudzdef1,dudzdef2,dwdxdef1,dwdxdef2, \t\t taylormudef,taylorudef,taylorwdef} ;\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog //. {half->1/2,i->0,j->0,k->0,x0->hx,y0->hy/2,z0->hz/2}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(\((DuDz[hx, hy\/2, hz\/2] + DwDx[hx, hy\/2, hz\/2])\)\ mu[1\/2, 0, 0]\)], "Output"] }, Open ]], Cell["\<\ dog = tauxz[i,j,k+half] //. \t\t{tauxzdef,dudzdef1,dudzdef2,dwdxdef1,dwdxdef2, \t\t taylormudef,taylorudef,taylorwdef} ;\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy/2,z0->hz}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(\((DuDz[hx\/2, hy\/2, hz] + DwDx[hx\/2, hy\/2, hz])\)\ mu[0, 0, 1\/2]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[" tauyz"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ dog = tauyz[i,j+half,k] //. \t\t{tauyzdef,dvdzdef1,dvdzdef2,dwdydef1,dwdydef2, \t\t taylormudef,taylorvdef,taylorwdef} ;\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(\((DvDz[hx\/2, hy, hz\/2] + DwDy[hx\/2, hy, hz\/2])\)\ mu[0, 1\/2, 0]\)], "Output"] }, Open ]], Cell["\<\ dog = tauyz[i,j,k+half] //. \t\t{tauyzdef,dvdzdef1,dvdzdef2,dwdydef1,dwdydef2, \t\t taylormudef,taylorvdef,taylorwdef} ;\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy/2,z0->hz}", "Input", AspectRatioFixed->True], Cell[BoxData[ \(\((DvDz[hx\/2, hy\/2, hz] + DwDy[hx\/2, hy\/2, hz])\)\ mu[0, 0, 1\/2]\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["definitions used for fortran output"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["murepl1 = mu[i_,j_+half,k_] -> muY[i,j+1,k]", "Input", AspectRatioFixed->True], Cell[BoxData[ \(mu[i_, half + j_, k_] \[Rule] muY[i, 1 + j, k]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["murepl2 = mu[i_+half,j_,k_] -> muX[i+1,j,k]", "Input", AspectRatioFixed->True], Cell[BoxData[ \(mu[half + i_, j_, k_] \[Rule] muX[1 + i, j, k]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["murepl3 = mu[i_,j_,k_+half] -> muZ[i,j,k+1]", "Input", AspectRatioFixed->True], Cell[BoxData[ \(mu[i_, j_, half + k_] \[Rule] muZ[i, j, 1 + k]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["urepl = u[i_,j_,k_] -> U[i,j,k,1]", "Input", AspectRatioFixed->True], Cell[BoxData[ \(u[i_, j_, k_] \[Rule] U[i, j, k, 1]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["vrepl = v[i_,j_,k_] -> U[i,j,k,2]", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(vrepl\)\" is similar to \ existing symbol \"\!\(urepl\)\"."\)], "Message"], Cell[BoxData[ \(v[i_, j_, k_] \[Rule] U[i, j, k, 2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["wrepl = w[i_,j_,k_] -> U[i,j,k,3]", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(wrepl\)\" is similar to \ existing symbols \!\({urepl, vrepl}\)."\)], "Message"], Cell[BoxData[ \(w[i_, j_, k_] \[Rule] U[i, j, k, 3]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "dependentCellsNotCovered is a function which returns a logical expression \ suitable for inclusion in fortran. Give an expression, exp, we wish to \ determine which mesh locations are accessed by the expression. However, we \ do not wish to examine all possible locations, only those outside the grid \ patch region. So we provide a second argument, which is a boolean function \ taking two arguments. The combination will give logical expressions testing \ the mask for cells utilized by the\nexpression and for which the boolean \ function, logfunc[il,jl], evaluates as true. The third argument is the name \ of the mask array"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["Clear[ dependentCellsNotCovered ]", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ dependentCellsNotCovered[exp_ , logfunc_ ,maskfun_] := Module[{cond,lexp,il,jl,kl,ml}, \tcond = False; \tlexp = exp; \tFor[il=-1,il<=+1,il++, For[jl=-1,jl<=+1,jl++, For[kl=-1,kl<=+1,kl++, For[ml=1,ml<=3,ml++, If[ (logfunc[il,jl,kl]) && \t (Coefficient[ \t\t Expand[ \t\t exp \t\t ] , \t\t U[i+il,j+jl,k+kl,ml] \t ] =!= 0), cond = cond || (maskfun[i+il,j+jl,k+kl]>0) \t ] \t ] ] ] ]; cond ]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(exp\)\" is similar to \ existing symbol \"\!\(Exp\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(lexp\)\" is similar to \ existing symbol \"\!\(exp\)\"."\)], "Message"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ dependentCellsNotCovered[abba*U[i+1,j-1,k,1]+U[i-1,j-1,k+1,2] \t\t\t\t\t\t\t, Function[{i,j,k},(k>0)] , \t\t\t\t\t\t\t masks ]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(masks[\(-1\) + i, \(-1\) + j, 1 + k] > 0\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "dependentCellsCovered is the logical inverse of dependentCellsNotCovered"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["Clear[ dependentCellsCovered ]", "Input", AspectRatioFixed->True], Cell["\<\ dependentCellsCovered[exp_ , logfunc_ ,maskfun_] := Module[{cond,lexp,il,jl,kl,ml}, \tcond = True; \tlexp = exp; \tFor[il=-1,il<=+1,il++, For[jl=-1,jl<=+1,jl++, For[kl=-1,kl<=+1,kl++, For[ml=1,ml<=3,ml++, If[ (logfunc[il,jl,kl]) && \t (Coefficient[ \t\t Expand[ \t\t exp \t\t ] , \t\t U[i+il,j+jl,k+kl,ml] \t ] =!= 0), cond = cond && (maskfun[i+il,j+jl,k+kl]==0) \t ] \t ] ] ] ]; cond ]\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ dependentCellsCovered[abba*U[i+1,j-1,k,1]+U[i-1,j-1,k+1,2] \t\t\t\t\t\t\t, Function[{i,j,k},(k>0)] , \t\t\t\t\t\t\t masks ]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(masks[\(-1\) + i, \(-1\) + j, 1 + k] == 0\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["definitions for two sided derivs"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["DTwoX[u_,i_,j_,k_] := (u[i+1,j,k]-u[i-1,j,k])/(2*hx)", "Input", AspectRatioFixed->True], Cell["DTwoX[u_,i_,j_,k_,n_] := (u[i+1,j,k,n]-u[i-1,j,k,n])/(2*hx)", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ Simplify[ DTwoX[u,0,0,0] //. {taylorudef,x0->hx/2,y0->hy/2, \t\t\t\t\t\t\t\t\tz0->hz/2} ]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDx[hx\/2, hy\/2, hz\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["DTwoY[u_,i_,j_,k_] := (u[i,j+1,k]-u[i,j-1,k])/(2*hy)", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(DTwoY\)\" is similar to \ existing symbol \"\!\(DTwoX\)\"."\)], "Message"] }, Open ]], Cell["DTwoY[u_,i_,j_,k_,n_] := (u[i,j+1,k,n]-u[i,j-1,k,n])/(2*hy)", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ Simplify[ DTwoY[u,0,0,0] //. {taylorudef,x0->hx/2,y0->hy/2, \t\t\t\t\t\t\t\t\tz0->hz/2} ]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDy[hx\/2, hy\/2, hz\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["DTwoZ[u_,i_,j_,k_] := (u[i,j,k+1]-u[i,j,k-1])/(2*hz)", "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DTwoZ\)\" is similar to \ existing symbols \!\({DTwoX, DTwoY}\)."\)], "Message"] }, Open ]], Cell["DTwoZ[u_,i_,j_,k_,n_] := (u[i,j,k+1,n]-u[i,j,k-1,n])/(2*hz)", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ Simplify[ DTwoZ[u,0,0,0] //. {taylorudef,x0->hx/2,y0->hy/2, \t\t\t\t\t\t\t\t\tz0->hz/2} ]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDz[hx\/2, hy\/2, hz\/2]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "definitions for Do One-sided Derivative in X direction. if sign is \ positive, \nit means extend the stencil in the positivie x direction. if \ negative, extend\nin other direction"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Clear[DOneX]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(DOneX[u_, i_, j_, k_, sign_]\ := \ \n\t\t \((\(-u[i + 2, j, k]\) + 4*u[i + 1, j, k] - 3*u[i, j, k])\)/\n \t\t\t\t\t\t\t\t\t\((2*hx)\)\ \ /; \ sign == 1\)], "Input"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(sign\)\" is similar to \ existing symbol \"\!\(Sign\)\"."\)], "Message"] }, Open ]], Cell[BoxData[ \(DOneX[u_, i_, j_, k_, sign_]\ := \ \n\t\t \((u[i - 2, j, k] - 4*u[i - 1, j, k] + 3*u[i, j, k])\)/\n \t\t\t\t\t\t\t\t\t\((2*hx)\)\ /; \ sign == \(-1\)\)], "Input"], Cell[BoxData[ \(DOneX[u_, i_, j_, k_, n_, sign_]\ := \ \n\t\t \((\(-u[i + 2, j, k, n]\) + 4*u[i + 1, j, k, n] - 3*u[i, j, k, n])\)/\n \t\t\t\t\t\t\t\t\t\((2*hx)\)\ /; \ sign == 1\)], "Input"], Cell[BoxData[ \(DOneX[u_, i_, j_, k_, n_, sign_]\ := \ \n\t\t \((u[i - 2, j, k, n] - 4*u[i - 1, j, k, n] + 3*u[i, j, k, n])\)/\n \t\t\t\t\t\t\t\t\t\((2*hx)\)\ /; \ sign == \(-1\)\)], "Input"], Cell[CellGroupData[{ Cell["\<\ Simplify[ DOneX[u,0,0,0,-1] //. \t\t{taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDx[hx\/2, hy\/2, hz\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Simplify[ DOneX[u,0,0,0,+1] //. \t\t{taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDx[hx\/2, hy\/2, hz\/2]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "definitions for Do One-sided Derivative in Y direction. if sign is \ positive, \nit means extend the stencil in the positivie y direction. if \ negative, extend\nin other direction"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Clear[DOneY]\)], "Input"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(DOneY\)\" is similar to \ existing symbol \"\!\(DOneX\)\"."\)], "Message"] }, Open ]], Cell[BoxData[ \(DOneY[u_, i_, j_, k_, sign_]\ := \ \n\t\t \((\(-u[i, j + 2, k]\) + 4*u[i, j + 1, k] - 3*u[i, j, k])\)/\n \t\t\t\t\t\t\t\t\t\((2*hy)\)\ /; \ sign == 1\)], "Input"], Cell[BoxData[ \(DOneY[u_, i_, j_, k_, sign_]\ := \ \n\t\t \((u[i, j - 2, k] - 4*u[i, j - 1, k] + 3*u[i, j, k])\)/\n \t\t\t\t\t\t\t\t\t\((2*hy)\)\ /; \ sign == \(-1\)\)], "Input"], Cell[BoxData[ \(DOneY[u_, i_, j_, k_, n_, sign_]\ := \ \n\t\t \((\(-u[i, j + 2, k, n]\) + 4*u[i, j + 1, k, n] - 3*u[i, j, k, n])\)/\n \t\t\t\t\t\t\t\t\t\((2*hy)\)\ /; \ sign == 1\)], "Input"], Cell[BoxData[ \(DOneY[u_, i_, j_, k_, n_, sign_]\ := \ \n\t\t \((u[i, j - 2, k, n] - 4*u[i, j - 1, k, n] + 3*u[i, j, k, n])\)/\n \t\t\t\t\t\t\t\t\t\((2*hy)\)\ /; \ sign == \(-1\)\)], "Input"], Cell[CellGroupData[{ Cell["\<\ Simplify[ DOneY[u,0,0,0,-1] //. \t\t{taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDy[hx\/2, hy\/2, hz\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Simplify[ DOneY[u,0,0,0,+1] //. \t\t{taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDy[hx\/2, hy\/2, hz\/2]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "definitions for Do One-sided Derivative in Z direction. if sign is \ positive, \nit means extend the stencil in the positivie z direction. if \ negative, extend\nin other direction"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Clear[DOneZ]\)], "Input"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DOneZ\)\" is similar to \ existing symbols \!\({DOneX, DOneY}\)."\)], "Message"] }, Open ]], Cell[BoxData[ \(DOneZ[u_, i_, j_, k_, sign_]\ := \ \n\t\t \((\(-u[i, j, k + 2]\) + 4*u[i, j, k + 1] - 3*u[i, j, k])\)/\n \t\t\t\t\t\t\t\t\t\((2*hz)\)\ /; \ sign == 1\)], "Input"], Cell[BoxData[ \(DOneZ[u_, i_, j_, k_, sign_]\ := \ \n\t\t \((u[i, j, k - 2] - 4*u[i, j, k - 1] + 3*u[i, j, k])\)/\n \t\t\t\t\t\t\t\t\t\((2*hz)\)\ \ /; \ sign == \(-1\)\)], "Input"], Cell[BoxData[ \(DOneZ[u_, i_, j_, k_, n_, sign_]\ := \ \n\t\t \((\(-u[i, j, k + 2, n]\) + 4*u[i, j, k + 1, n] - 3*u[i, j, k, n])\)/\n \t\t\t\t\t\t\t\t\t\((2*hz)\)\ /; \ sign == 1\)], "Input"], Cell[BoxData[ \(DOneZ[u_, i_, j_, k_, n_, sign_]\ := \ \n\t\t \((u[i, j, k - 2, n] - 4*u[i, j, k - 1, n] + 3*u[i, j, k, n])\)/\n \t\t\t\t\t\t\t\t\t\((2*hz)\)\ \ /; \ sign == \(-1\)\)], "Input"], Cell[CellGroupData[{ Cell["\<\ Simplify[ DOneZ[u,0,0,0,-1] //. \t\t{taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDz[hx\/2, hy\/2, hz\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Simplify[ DOneZ[u,0,0,0,+1] //. \t\t{taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}]\ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDz[hx\/2, hy\/2, hz\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[TextData["useful one-sided derivatives"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Clear[dvdxalt, dudyalt, dvdzalt, dwdyalt, dudzalt, dwdxalt]\)], "Input"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(dvdzalt\)\" is similar \ to existing symbol \"\!\(dvdxalt\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(dwdyalt\)\" is similar \ to existing symbol \"\!\(dudyalt\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dudzalt\)\" is similar \ to existing symbols \!\({dudyalt, dvdzalt}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dwdxalt\)\" is similar \ to existing symbols \!\({dvdxalt, dwdyalt}\)."\)], "Message"] }, Open ]], Cell[BoxData[ \(dvdxalt[i_, j_ + half, k_, sign_]\ := \ \((DOneX[v, i, j, k, sign] + DOneX[v, i, j + 1, k, sign])\)/2\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(dvdxalt[i, j + half, k, 1]\)], "Input"], Cell[BoxData[ \(1\/2\ \((\(\(-3\)\ v[i, j, k] + 4\ v[1 + i, j, k] - v[2 + i, j, k]\)\/\(2\ hx \) + \(\(-3\)\ v[i, 1 + j, k] + 4\ v[1 + i, 1 + j, k] - v[2 + i, 1 + j, k]\)\/\(2\ hx\))\)\)], "Output"] }, Open ]], Cell["\<\ dudyalt[i_+half,j_,k_,sign_] := (DOneY[u,i ,j,k,sign]+ \t\t\t\t\t\t\t DOneY[u,i+1,j,k,sign])/2\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dudyalt[i + half, j, k, 1]\)], "Input"], Cell[BoxData[ \(1\/2\ \((\(\(-3\)\ u[i, j, k] + 4\ u[i, 1 + j, k] - u[i, 2 + j, k]\)\/\(2\ hy \) + \(\(-3\)\ u[1 + i, j, k] + 4\ u[1 + i, 1 + j, k] - u[1 + i, 2 + j, k]\)\/\(2\ hy\))\)\)], "Output"] }, Open ]], Cell["\<\ dvdzalt[i_,j_+half,k_,sign_] := (DOneZ[v,i,j ,k,sign]+ \t\t\t\t\t\t\t DOneZ[v,i,j+1,k,sign])/2\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dvdzalt[i, j + half, k, 1]\)], "Input"], Cell[BoxData[ \(1\/2\ \((\(\(-3\)\ v[i, j, k] + 4\ v[i, j, 1 + k] - v[i, j, 2 + k]\)\/\(2\ hz \) + \(\(-3\)\ v[i, 1 + j, k] + 4\ v[i, 1 + j, 1 + k] - v[i, 1 + j, 2 + k]\)\/\(2\ hz\))\)\)], "Output"] }, Open ]], Cell["\<\ dwdyalt[i_,j_,k_+half,sign_] := (DOneY[w,i,j,k ,sign]+ \t\t\t\t\t\t\t\t DOneY[w,i,j,k+1,sign])/2\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dwdyalt[i, j, k + half, 1]\)], "Input"], Cell[BoxData[ \(1\/2\ \((\(\(-3\)\ w[i, j, k] + 4\ w[i, 1 + j, k] - w[i, 2 + j, k]\)\/\(2\ hy \) + \(\(-3\)\ w[i, j, 1 + k] + 4\ w[i, 1 + j, 1 + k] - w[i, 2 + j, 1 + k]\)\/\(2\ hy\))\)\)], "Output"] }, Open ]], Cell["\<\ dudzalt[i_+half,j_,k_,sign_] := (DOneZ[u,i ,j,k,sign]+ \t\t\t\t\t\t\t\t DOneZ[u,i+1,j,k,sign])/2\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dudzalt[i + half, j, k, 1]\)], "Input"], Cell[BoxData[ \(1\/2\ \((\(\(-3\)\ u[i, j, k] + 4\ u[i, j, 1 + k] - u[i, j, 2 + k]\)\/\(2\ hz \) + \(\(-3\)\ u[1 + i, j, k] + 4\ u[1 + i, j, 1 + k] - u[1 + i, j, 2 + k]\)\/\(2\ hz\))\)\)], "Output"] }, Open ]], Cell["\<\ dwdxalt[i_,j_,k_+half,sign_] := (DOneX[w,i,j,k ,sign]+ \t\t\t\t\t\t\t\t DOneX[w,i,j,k+1,sign])/2\ \>", "Input", AspectRatioFixed->True] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dwdxalt[i, j, k + half, 1]\)], "Input"], Cell[BoxData[ \(1\/2\ \((\(\(-3\)\ w[i, j, k] + 4\ w[1 + i, j, k] - w[2 + i, j, k]\)\/\(2\ hx \) + \(\(-3\)\ w[i, j, 1 + k] + 4\ w[1 + i, j, 1 + k] - w[2 + i, j, 1 + k]\)\/\(2\ hx\))\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[TextData["setup to use the Format.m package "], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["Off[General::spell,General::spell1];", "Input", AspectRatioFixed->True], Cell["SetOptions[$Output,PageWidth->73];", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["<True], Cell[BoxData[ \(exp::"shdw" \( : \ \) "Symbol \!\(\"exp\"\) appears in multiple contexts \!\({\"Format`\", \ \"Global`\"}\); definitions in context \!\(\"Format`\"\) may shadow or be \ shadowed by other definitions."\)], "Message"], Cell[BoxData[ \(sign::"shdw" \( : \ \) "Symbol \!\(\"sign\"\) appears in multiple contexts \!\({\"Format`\", \ \"Global`\"}\); definitions in context \!\(\"Format`\"\) may shadow or be \ shadowed by other definitions."\)], "Message"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "substitution for all derivatives and variables"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ allDerivAllUV = {dudxdef, \t\t\t\t dvdydef, \t\t\t\t dwdzdef, \t\t\t\t dudydef1,dudydef2, \t\t\t\t dudzdef1,dudzdef2, \t\t\t\t dvdxdef1,dvdxdef2, \t\t\t\t dvdzdef1,dvdzdef2, \t\t\t\t dwdxdef1,dwdxdef2, \t\t\t\t dwdydef1,dwdydef2, \t\t\t\t urepl, \t\t\t\t vrepl, \t\t\t\t wrepl};\ \>", "Input", AspectRatioFixed->True], Cell["\<\ allUVW = { urepl, \t\t\t\t vrepl, \t\t\t\t wrepl};\ \>", "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData["transverse u derivs"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell["tduext[half+i,j,k] = trandere[i+1,j,k,1];", "Input", AspectRatioFixed->True], Cell["tduext[half+i-1,j,k] = tranderw[i-1,j,k,1];", "Input", AspectRatioFixed->True], Cell["tduext[i,j+half,k] = trandern[i,j+1,k,1];", "Input", AspectRatioFixed->True], Cell["tduext[i,j-1+half,k] = tranders[i,j-1,k,1];", "Input", AspectRatioFixed->True], Cell["tduext[i,j,k+half] = trandert[i,j,k+1,1];", "Input", AspectRatioFixed->True], Cell["tduext[i,j,k-1+half] = tranderb[i,j,k-1,1];", "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData["transverse v derivs"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell["tdvext[half+i,j,k] = trandere[i+1,j,k,2];", "Input", AspectRatioFixed->True], Cell["tdvext[half+i-1,j,k] = tranderw[i-1,j,k,2];", "Input", AspectRatioFixed->True], Cell["tdvext[i,j+half,k] = trandern[i,j+1,k,2];", "Input", AspectRatioFixed->True], Cell["tdvext[i,j-1+half,k] = tranders[i,j-1,k,2];", "Input", AspectRatioFixed->True], Cell["tdvext[i,j,k+half] = trandert[i,j,k+1,2];", "Input", AspectRatioFixed->True], Cell["tdvext[i,j,k-1+half] = tranderb[i,j,k-1,2];", "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData["transverse w derivs"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell["tdwext[half+i,j,k] = trandere[i+1,j,k,3];", "Input", AspectRatioFixed->True], Cell["tdwext[half+i-1,j,k] = tranderw[i-1,j,k,3];", "Input", AspectRatioFixed->True], Cell["tdwext[i,j+half,k] = trandern[i,j+1,k,3];", "Input", AspectRatioFixed->True], Cell["tdwext[i,j-1+half,k] = tranders[i,j-1,k,3];", "Input", AspectRatioFixed->True], Cell["tdwext[i,j,k+half] = trandert[i,j,k+1,3];", "Input", AspectRatioFixed->True], Cell["tdwext[i,j,k-1+half] = tranderb[i,j,k-1,3];", "Input", AspectRatioFixed->True] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "an alternate approach which seeks to automatically determine which \n\ direction to use for one sided deriv"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ altgen[lhs_,indx_,indy_,indz_, exp_,expalt_,expext_, varindx_,derivindx_, indexcond_,mask_] := \tBlock[ \t\t{tmpcond,tmp,tmpalt, \t\t depplus,depminus,sign, \t\t line1,line2,line3,line4,line5, \t\t icase,jcase,kcase}, \t\t(* conditions are False if expression is safe to use *) \t\ttmpcond = dependentCellsNotCovered[ \t\t\t\t\texp[indx,indy,indz] //. allDerivAllUV, \t\t\t\t\tindexcond,mask]; \t\tdepplus = dependentCellsNotCovered[ \t\t\t\t\texpalt[indx,indy,indz,+1] //.allDerivAllUV, \t\t\t\t\tindexcond,mask]; \t\tdepminus = dependentCellsNotCovered[ \t\t\t\t\texpalt[indx,indy,indz,-1] //.allDerivAllUV, \t\t\t\t\tindexcond,mask]; \t\t(* temporary *) \t\tIf[ depplus === False , \t\t\tsign = 1, \t\t\tIf[ depminus === False , \t\t\t\tsign = -1, \t\t\t\tsign = 0 (* means neither of one \t\t\t\t sided is safe *) \t\t\t] \t\t]; \t\t(* treat 3 different cases *) \t\tWhich[ \t\t\ttmpcond === False, \t\t\t(* exp does not extend into masked region *) \t\t\tFortranAssign[ \t\t\t\tlhs, \t\t\t\texp[indx,indy,indz] //.allDerivAllUV, \t\t\t\tAssignToArray->{U}, \t\t\t\tAssignPrecision->Infinity \t\t\t], \t\t\t \t\t\ttmpcond =!= False && sign != 0, \t\t\t(* exp extends outside, output conditional mask *) \t\t\ttmp = FortranAssign[ \t\t\t\ttmpcond, \t\t\t\tAssignToArray->{mask}, \t\t\t\tAssignIndent->\"\", \t\t\t\tAssignPrecision->Infinity \t\t\t]; \t\t\ttmpalt =dependentCellsNotCovered[ \t\t\t\t\texpalt[indx,indx,indz,sign]//.allDerivAllUV, \t\t\t\t\t\tindexcond,mask]; \t\t\tline1 = StringForm[\" if(``) then \", tmp]; \t\t\tline2 = FortranAssign[ \t\t\t\tlhs, \t\t\t\texpalt[indx,indy,indz,sign]//.allDerivAllUV, \t\t\t\tAssignToArray->{U}, \t\t\t\tAssignPrecision->Infinity \t\t\t]; \t\t\tline3 = StringForm[\" else\"]; \t\t\tline4 = FortranAssign[ \t\t\t\tlhs, \t\t\t\texp[indx,indy,indz] //.allDerivAllUV, \t\t\t\tAssignToArray->{U}, \t\t\t\tAssignPrecision->Infinity \t\t\t]; \t\t\tIf[tmpalt =!= False , \t\t\t\t(* this is an error, the alternate form should \t\t\t\t be specified to be inside safe region *) \t\t \t\tline5 = StringForm[\" error in tandergen\"] \t\t \t, \t\t \t\tline5 = StringForm[\" endif\"] \t\t\t]; \t\t\tColumnForm[{line1,line2,line3,line4,line5}], \t\t\t \t\t\tTrue, \t\t\t(* cannot use exp or expalt, must be \t\t\t externally supplied derivative *) \t\t\t(* need to figure out where to evaluate \t\t\t the transverse derivative *) \t\t\ticase = Which[ indx === i-1+half, -1, \t\t\t\t\t\t indx === i , 0, \t\t\t\t\t\t indx === i +half, +1, \t\t\t\t\t\t _, Print[\"error in icase\"]]; \t\t\tjcase = Which[ indy === j-1+half, -1, \t\t\t\t\t\t indy === j , 0, \t\t\t\t\t\t indy === j +half, +1, \t\t\t\t\t\t _, Print[\"error in jcase\"]]; \t\t\tkcase = Which[ indz === k-1+half, -1, \t\t\t\t\t\t indz === k , 0, \t\t\t\t\t\t indz === k +half, +1, \t\t\t\t\t\t _, Print[\"error in kcase\"]]; \t\t \t\t\tFortranAssign[ \t\t\t\t\tlhs, expext[i+icase, \t\t\t\t\t\t\t\tj+jcase, \t\t\t\t\t\t\t\tk+kcase, \t\t\t\t\t\t\t\tvarindx,derivindx], \t\t\t\t\tAssignToArray->{trandere,tranderw, \t\t\t\t\t\t\t\t\ttrandern,tranders, \t\t\t\t\t\t\t\t\ttrandert,tranderb}, \t\t\t\t\tAssignPrecision->Infinity]\t \t\t]\t \t]\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ altgen[ dwdxt, \t\ti,j,k+half, \t\tdwdx,dwdxalt, \t\ttrandern,3,1,Function[{i,j,k},(k>0)], \t\tmaskn ]\ \>", "Input", AspectRatioFixed->True], Cell[OutputFormData["\<\ \" dwdxt=trandern(i,j,1+k,3,1)\"\ \>", "\<\ dwdxt=trandern(i,j,1+k,3,1)\ \>"], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ altgen[ dudye, \t\ti+half,j,k, \t\tdudy, \t\tdudyalt, \t\ttduext, \t\t1,2, \t\tFunction[{i,j,k},(i<0)], \t\tmaskn ] \ \>", "Input", AspectRatioFixed->True], Cell[OutputFormData["\<\ \" \\ dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1)\\n & \\ +U(1+i,1+j,k,1))/(4.d0*hy)\"\ \>", "\<\ dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy)\ \>"], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ altgen[ dudye, \t\ti+half,j,k, \t\tdudy, \t\tdudyalt, \t\ttrandere, \t\t1,2, \t\tFunction[{i,j,k},(i>0)], \t\tmaskn ] \ \>", "Input", AspectRatioFixed->True], Cell[OutputFormData["\<\ \" dudye=trandere(1+i,j,k,1,2)\"\ \>", "\<\ dudye=trandere(1+i,j,k,1,2)\ \>"], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ altgen[ dudye, \t\ti+half,j,k, \t\tdudy, \t\tdudyalt, \t\ttranderns, \t\t1,2, \t\tFunction[{i,j,k},(j<0)], \t\tmaskn ] \ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ InterpretationBox[GridBox[{ { "\<\" \ if(\\!\\(\\*FrameBox[\\\"\\\\\\\"maskn(i,-1+j,k).gt.0.or.maskn(1+i,-1+j,k).gt.\ 0\\\\\\\"\\\", Rule[BoxFrame, False], Rule[BoxMargins, False]]\\)) then \ \"\>"}, { FrameBox[ \(" dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1))\n \ & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i\n & \ ,2+j,k,1))/(2.d0*hy))/2.d0"\), BoxFrame->False, BoxMargins->False]}, {"\<\" else\"\>"}, { FrameBox[ \(" dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1)\n \ & +U(1+i,1+j,k,1))/(4.d0*hy)"\), BoxFrame->False, BoxMargins->False]}, {"\<\" endif\"\>"} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { StringForm[ " if(``) then ", OutputForm[ ColumnForm[ { "maskn(i,-1+j,k).gt.0.or.maskn(1+i,-1+j,k).gt.0"}]]], OutputForm[ ColumnForm[ { " dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1))\n \ & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i\n & \ ,2+j,k,1))/(2.d0*hy))/2.d0"}]], StringForm[ " else"], OutputForm[ ColumnForm[ { " dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1)\n \ & +U(1+i,1+j,k,1))/(4.d0*hy)"}]], StringForm[ " endif"]}], Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ altgen[ dudye, \t\ti+half,j,k, \t\tdudy, \t\tdudyalt, \t\ttrandere, \t\t1,2, \t\tFunction[{i,j,k},(j>0)], \t\tmaskn ] \ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ InterpretationBox[GridBox[{ { "\<\" \ if(\\!\\(\\*FrameBox[\\\"\\\\\\\"maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0\ \\\\\\\"\\\", Rule[BoxFrame, False], Rule[BoxMargins, False]]\\)) then \"\>"}, { FrameBox[ \(" dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1)\n \ & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U\n & \ (1+i,j,k,1))/(2.d0*hy))/2.d0"\), BoxFrame->False, BoxMargins->False]}, {"\<\" else\"\>"}, { FrameBox[ \(" dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1)\n \ & +U(1+i,1+j,k,1))/(4.d0*hy)"\), BoxFrame->False, BoxMargins->False]}, {"\<\" endif\"\>"} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { StringForm[ " if(``) then ", OutputForm[ ColumnForm[ {"maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0"}]]], OutputForm[ ColumnForm[ { " dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1)\n \ & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U\n & \ (1+i,j,k,1))/(2.d0*hy))/2.d0"}]], StringForm[ " else"], OutputForm[ ColumnForm[ { " dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1)\n \ & +U(1+i,1+j,k,1))/(4.d0*hy)"}]], StringForm[ " endif"]}], Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ altgen[ dudye, \t\ti+half,j,k, \t\tdudy, \t\tdudyalt, \t\ttranderb, \t\t1,2, \t\tFunction[{i,j,k},(k<0)], \t\tmaskn ] \ \>", "Input", AspectRatioFixed->True], Cell[OutputFormData["\<\ \" \\ dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1)\\n & \\ +U(1+i,1+j,k,1))/(4.d0*hy)\"\ \>", "\<\ dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy)\ \>"], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ altgen[ dudye, \t\ti+half,j,k, \t\tdudy, \t\tdudyalt, \t\ttrandert, \t\t1,2, \t\tFunction[{i,j,k},(k>0)], \t\tmaskn ] \ \>", "Input", AspectRatioFixed->True], Cell[OutputFormData["\<\ \" \\ dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1)\\n & \\ +U(1+i,1+j,k,1))/(4.d0*hy)\"\ \>", "\<\ dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy)\ \>"], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[TextData["a short-hand function"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ FA[x_] := FortranAssign[x, \t\t\t\t\t\tAssignToArray->{U,muX,muY,muZ,a,u, \t\t\t\t\t\t\t\t\t\tmaskn,maske,maskw, \t\t\t\t\t\t\t\t\t\tmasks,maskt,maskb}, \t\t\t\t\t\tAssignIndent->\"\", \t\t\t\t\t\tAssignPrecision->Infinity];\t\t\ \>", "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell["\<\ DeleteFile[ \"dog.mf\"]; CopyFile[ \"DV_3D1.mF\" , \"dog.mf\"]; Splice[\"dog.mf\",FormatType->OutputForm]; DeleteFile[ \"DV_3D1.F\"]; CopyFile[ \"dog.f\", \"DV_3D1.F\" ]; <<\"!touch DV_3D1.F\" \ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DeleteFile::"nffil" \( : \ \) "File not found during \!\(DeleteFile[\"DV_3D1.F\"]\)."\)], "Message"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ DeleteFile[ \"dog.mf\"]; CopyFile[ \"DV_3D2.mF\" , \"dog.mf\"]; Splice[\"dog.mf\",FormatType->OutputForm]; DeleteFile[ \"DV_3D2.F\"]; CopyFile[ \"dog.f\", \"DV_3D2.F\" ]; <<\"!touch DV_3D2.F\" \ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DeleteFile::"nffil" \( : \ \) "File not found during \!\(DeleteFile[\"DV_3D2.F\"]\)."\)], "Message"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ DeleteFile[ \"dog.mf\"]; CopyFile[ \"DV_3D3.mF\" , \"dog.mf\"]; Splice[\"dog.mf\",FormatType->OutputForm]; DeleteFile[ \"DV_3D3.F\"]; CopyFile[ \"dog.f\", \"DV_3D3.F\" ]; <<\"!touch DV_3D3.F\" \ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DeleteFile::"nffil" \( : \ \) "File not found during \!\(DeleteFile[\"DV_3D3.F\"]\)."\)], "Message"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ DeleteFile[ \"dog.mf\"]; CopyFile[ \"DV_3D4.mF\" , \"dog.mf\"]; Splice[\"dog.mf\",FormatType->OutputForm]; DeleteFile[ \"DV_3D4.F\"]; CopyFile[ \"dog.f\", \"DV_3D4.F\" ]; <<\"!touch DV_3D4.F\" \ \>", "Input", AspectRatioFixed->True], Cell[BoxData[ \(DeleteFile::"nffil" \( : \ \) "File not found during \!\(DeleteFile[\"DV_3D4.F\"]\)."\)], "Message"] }, Open ]], Cell[TextData[ "\n FA[ Coefficient[Expand[\n alpha*a[i,j,k]*u[i,j,k]-beta*(\n\t\ hy*hz*(tauxx[i+half ,j , k]-\n\t tauxx[i-1+half,j , k])+\n\t\ hx*hz*(tauxy[i ,j+half ,k]- \n\t tauxy[i ,j-1+half,k])+\n\ \thx*hy*(tauxz[i ,j ,k+half]-\n\t tauxz[i ,j \ ,k-1+half]))/vol //. \n\t {murepl1,murepl2,murepl3,\n\t \ tauxxdef,tauyydef,tauxydef,tauxzdef,tauyzdef,\n\t tauzzdef,\n\t \ vol->hx*hy*hz,\n\t dudxdef,dvdydef,dwdzdef,\n\t \ dudydef1,dudydef2,\n\t dudzdef1,dudzdef2,\n\t \ dwdxdef1,dwdxdef2,\n\t dvdxdef1,dvdxdef2 }\n ],u[i,j+1,k]]]\n\t \ "], "Input", AspectRatioFixed->True], Cell[TextData[ "\nFA[Coefficient[ Expand[\n alpha*a[i,j,k]*v[i,j,k]-beta*(\n\t\ hy*hz*(tauxy[i+half ,j , k]-\n\t tauxy[i-1+half,j , k])+\n\t\ hx*hz*(tauyy[i ,j+half ,k]- \n\t tauyy[i ,j-1+half,k])+\n\ \thx*hy*(tauyz[i ,j ,k+half]-\n\t tauyz[i ,j \ ,k-1+half]))/vol //. \n\t {murepl1,murepl2,murepl3,\n\t \ tauxxdef,tauyydef,tauxydef,tauxzdef,tauyzdef,\n\t tauzzdef,\n\t \ vol->hx*hy*hz,\n\t dudxdef,dvdydef,dwdzdef,\n\t \ dudydef1,dudydef2,\n\t dudzdef1,dudzdef2,\n\t \ dwdxdef1,dwdxdef2,\n\t dvdxdef1,dvdxdef2,\n\t \ dvdzdef1,dvdzdef2,\n\t dwdydef1,dwdydef2 } ] , v[i,j+1,k] ] ]"], "Input", AspectRatioFixed->True], Cell[TextData[ "\nFA[ Coefficient[ Expand[\n alpha*a[i,j,k]*w[i,j,k]-beta*(\n\t\ hy*hz*(tauxz[i+half ,j , k]-\n\t tauxz[i-1+half,j , k])+\n\t\ hx*hz*(tauyz[i ,j+half ,k]- \n\t tauyz[i ,j-1+half,k])+\n\ \thx*hy*(tauzz[i ,j ,k+half]-\n\t tauzz[i ,j \ ,k-1+half]))/vol //. \n\t {murepl1,murepl2,murepl3,\n\t \ tauxxdef,tauyydef,tauxydef,tauxzdef,tauyzdef,\n\t tauzzdef,\n\t \ vol->hx*hy*hz,\n\t dudxdef,dvdydef,dwdzdef,\n\t \ dudydef1,dudydef2,\n\t dudzdef1,dudzdef2,\n\t \ dwdxdef1,dwdxdef2,\n\t dvdxdef1,dvdxdef2,\n\t \ dvdzdef1,dvdzdef2,\n\t dwdydef1,dwdydef2 } ] , w[i,j+1,k] ] ]"], "Input", AspectRatioFixed->True], Cell[TextData["\n\tDTwoY[u,i,j,k] //. allDerivAllUV"], "Input", AspectRatioFixed->True], Cell[TextData[ "FA[ dependentCellsNotCovered[\n\tDTwoY[u,i,j,k] //. allDerivAllUV,\n\t\ Function[{i,j,k},(j<0)],masks] ]"], "Input", AspectRatioFixed->True], Cell[TextData["FA[ DTwoY[U,i,j,k,n] ]"], "Input", AspectRatioFixed->True] }, Open ]] }, Open ]] }, Open ]] }, Open ]] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{517, 949}, WindowMargins->{{Automatic, 112}, {Automatic, 22}}, PrintingPageRange->{Automatic, Automatic}, PrintingOptions->{"PaperSize"->{612, 792}, "PaperOrientation"->"Portrait", "Magnification"->1}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1731, 51, 125, 3, 93, "Subtitle", Evaluatable->False], Cell[CellGroupData[{ Cell[1881, 58, 94, 2, 47, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[2000, 64, 128, 4, 42, "Input"], Cell[2131, 70, 117, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2285, 77, 128, 4, 42, "Input"], Cell[2416, 83, 117, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2570, 90, 123, 4, 42, "Input"], Cell[2696, 96, 117, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2850, 103, 131, 4, 42, "Input"], Cell[2984, 109, 191, 3, 55, "Message"], Cell[3178, 114, 182, 3, 55, "Message"], Cell[3363, 119, 179, 3, 39, "Message"], Cell[3545, 124, 160, 3, 39, "Message"], Cell[3708, 129, 115, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3860, 136, 131, 4, 42, "Input"], Cell[3994, 142, 201, 3, 55, "Message"], Cell[4198, 147, 189, 3, 55, "Message"], Cell[4390, 152, 185, 3, 55, "Message"], Cell[4578, 157, 160, 3, 39, "Message"], Cell[4741, 162, 115, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4893, 169, 131, 4, 42, "Input"], Cell[5027, 175, 201, 3, 55, "Message"], Cell[5231, 180, 189, 3, 55, "Message"], Cell[5423, 185, 191, 3, 55, "Message"], Cell[5617, 190, 160, 3, 39, "Message"], Cell[5780, 195, 115, 2, 27, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[5944, 203, 103, 2, 47, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[6072, 209, 103, 2, 42, "Subsubsection", Evaluatable->False], Cell[CellGroupData[{ Cell[6200, 215, 113, 4, 42, "Input"], Cell[6316, 221, 113, 2, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6466, 228, 112, 4, 42, "Input"], Cell[6581, 234, 113, 2, 50, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6731, 241, 112, 4, 42, "Input"], Cell[6846, 247, 113, 2, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7008, 255, 87, 2, 42, "Subsubsection", Evaluatable->False], Cell[CellGroupData[{ Cell[7120, 261, 101, 1, 27, "Input"], Cell[7224, 264, 113, 2, 50, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7374, 271, 173, 5, 57, "Input"], Cell[7550, 278, 203, 4, 69, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7802, 288, 87, 2, 42, "Subsubsection", Evaluatable->False], Cell[CellGroupData[{ Cell[7914, 294, 99, 1, 27, "Input"], Cell[8016, 297, 183, 3, 39, "Message"], Cell[8202, 302, 113, 2, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[8352, 309, 170, 5, 57, "Input"], Cell[8525, 316, 183, 3, 39, "Message"], Cell[8711, 321, 203, 4, 65, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[8963, 331, 87, 2, 42, "Subsubsection", Evaluatable->False], Cell[CellGroupData[{ Cell[9075, 337, 101, 1, 27, "Input"], Cell[9179, 340, 113, 2, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[9329, 347, 145, 4, 57, "Input"], Cell[9477, 353, 203, 4, 65, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[9729, 363, 87, 2, 42, "Subsubsection", Evaluatable->False], Cell[CellGroupData[{ Cell[9841, 369, 99, 1, 27, "Input"], Cell[9943, 372, 191, 3, 55, "Message"], Cell[10137, 377, 113, 2, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[10287, 384, 169, 5, 57, "Input"], Cell[10459, 391, 191, 3, 55, "Message"], Cell[10653, 396, 203, 4, 65, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[10905, 406, 87, 2, 42, "Subsubsection", Evaluatable->False], Cell[CellGroupData[{ Cell[11017, 412, 99, 1, 27, "Input"], Cell[11119, 415, 183, 3, 39, "Message"], Cell[11305, 420, 113, 2, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[11455, 427, 167, 5, 57, "Input"], Cell[11625, 434, 183, 3, 39, "Message"], Cell[11811, 439, 203, 4, 65, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[12063, 449, 87, 2, 42, "Subsubsection", Evaluatable->False], Cell[CellGroupData[{ Cell[12175, 455, 113, 4, 42, "Input"], Cell[12291, 461, 191, 3, 55, "Message"], Cell[12485, 466, 113, 2, 50, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12635, 473, 143, 4, 42, "Input"], Cell[12781, 479, 191, 3, 55, "Message"], Cell[12975, 484, 203, 4, 69, "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[13239, 495, 119, 2, 47, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[13383, 501, 512, 13, 207, "Input"], Cell[13898, 516, 175, 3, 39, "Message"], Cell[14076, 521, 179, 3, 39, "Message"], Cell[14258, 526, 179, 3, 39, "Message"], Cell[14440, 531, 185, 3, 55, "Message"], Cell[14628, 536, 181, 3, 39, "Message"], Cell[14812, 541, 161, 3, 39, "Message"], Cell[14976, 546, 769, 14, 381, "Output"] }, Open ]], Cell[15760, 563, 102, 1, 27, "Input"], Cell[CellGroupData[{ Cell[15887, 568, 91, 1, 27, "Input"], Cell[15981, 571, 56, 1, 47, "Output"] }, Open ]], Cell[16052, 575, 102, 1, 27, "Input"], Cell[CellGroupData[{ Cell[16179, 580, 91, 1, 27, "Input"], Cell[16273, 583, 56, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16366, 589, 512, 13, 207, "Input"], Cell[16881, 604, 187, 3, 55, "Message"], Cell[17071, 609, 175, 3, 39, "Message"], Cell[17249, 614, 179, 3, 39, "Message"], Cell[17431, 619, 185, 3, 55, "Message"], Cell[17619, 624, 179, 3, 39, "Message"], Cell[17801, 629, 161, 3, 39, "Message"], Cell[17965, 634, 185, 3, 55, "Message"], Cell[18153, 639, 160, 3, 39, "Message"], Cell[18316, 644, 769, 14, 381, "Output"] }, Open ]], Cell[19100, 661, 93, 1, 27, "Input"], Cell[CellGroupData[{ Cell[19218, 666, 91, 1, 27, "Input"], Cell[19312, 669, 56, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[19405, 675, 512, 13, 207, "Input"], Cell[19920, 690, 197, 3, 55, "Message"], Cell[20120, 695, 179, 3, 39, "Message"], Cell[20302, 700, 185, 3, 55, "Message"], Cell[20490, 705, 160, 3, 39, "Message"], Cell[20653, 710, 769, 14, 381, "Output"] }, Open ]], Cell[21437, 727, 103, 1, 27, "Input"], Cell[CellGroupData[{ Cell[21565, 732, 91, 1, 27, "Input"], Cell[21659, 735, 56, 1, 47, "Output"] }, Open ]], Cell[21730, 739, 103, 1, 27, "Input"], Cell[CellGroupData[{ Cell[21858, 744, 91, 1, 27, "Input"], Cell[21952, 747, 56, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[22045, 753, 213, 8, 102, "Input"], Cell[22261, 763, 188, 3, 55, "Message"], Cell[22452, 768, 176, 3, 39, "Message"], Cell[22631, 773, 181, 3, 39, "Message"], Cell[22815, 778, 188, 3, 55, "Message"], Cell[23006, 783, 248, 5, 129, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[23303, 794, 82, 2, 47, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[23410, 800, 107, 2, 42, "Subsubsection", Evaluatable->False], Cell[23520, 804, 125, 4, 42, "Input"], Cell[CellGroupData[{ Cell[23670, 812, 117, 4, 42, "Input"], Cell[23790, 818, 75, 1, 47, "Output"] }, Open ]], Cell[23880, 822, 126, 4, 42, "Input"], Cell[CellGroupData[{ Cell[24031, 830, 102, 1, 27, "Input"], Cell[24136, 833, 75, 1, 47, "Output"] }, Open ]], Cell[24226, 837, 137, 4, 42, "Input"], Cell[CellGroupData[{ Cell[24388, 845, 102, 1, 27, "Input"], Cell[24493, 848, 75, 1, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[24617, 855, 89, 2, 42, "Subsubsection", Evaluatable->False], Cell[24709, 859, 170, 5, 57, "Input"], Cell[CellGroupData[{ Cell[24904, 868, 102, 1, 27, "Input"], Cell[25009, 871, 110, 2, 47, "Output"] }, Open ]], Cell[25134, 876, 170, 5, 57, "Input"], Cell[CellGroupData[{ Cell[25329, 885, 102, 1, 27, "Input"], Cell[25434, 888, 110, 2, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[25593, 896, 89, 2, 42, "Subsubsection", Evaluatable->False], Cell[25685, 900, 171, 5, 57, "Input"], Cell[CellGroupData[{ Cell[25881, 909, 102, 1, 27, "Input"], Cell[25986, 912, 110, 2, 47, "Output"] }, Open ]], Cell[26111, 917, 171, 5, 57, "Input"], Cell[CellGroupData[{ Cell[26307, 926, 102, 1, 27, "Input"], Cell[26412, 929, 110, 2, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[26571, 937, 89, 2, 42, "Subsubsection", Evaluatable->False], Cell[26663, 941, 171, 5, 57, "Input"], Cell[CellGroupData[{ Cell[26859, 950, 102, 1, 27, "Input"], Cell[26964, 953, 110, 2, 47, "Output"] }, Open ]], Cell[27089, 958, 171, 5, 57, "Input"], Cell[CellGroupData[{ Cell[27285, 967, 102, 1, 27, "Input"], Cell[27390, 970, 110, 2, 47, "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[27561, 979, 112, 2, 47, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[27698, 985, 86, 1, 27, "Input"], Cell[27787, 988, 80, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27904, 994, 86, 1, 27, "Input"], Cell[27993, 997, 80, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[28110, 1003, 86, 1, 27, "Input"], Cell[28199, 1006, 80, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[28316, 1012, 76, 1, 27, "Input"], Cell[28395, 1015, 69, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[28501, 1021, 76, 1, 27, "Input"], Cell[28580, 1024, 177, 3, 39, "Message"], Cell[28760, 1029, 69, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[28866, 1035, 76, 1, 27, "Input"], Cell[28945, 1038, 182, 3, 55, "Message"], Cell[29130, 1043, 69, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[29236, 1049, 713, 11, 181, "Subsection", Evaluatable->False], Cell[29952, 1062, 76, 1, 27, "Input"], Cell[CellGroupData[{ Cell[30053, 1067, 563, 24, 357, "Input"], Cell[30619, 1093, 173, 3, 39, "Message"], Cell[30795, 1098, 174, 3, 39, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[31006, 1106, 180, 5, 72, "Input"], Cell[31189, 1113, 74, 1, 27, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[31312, 1120, 156, 4, 62, "Subsection", Evaluatable->False], Cell[31471, 1126, 73, 1, 27, "Input"], Cell[31547, 1129, 560, 24, 357, "Input"], Cell[CellGroupData[{ Cell[32132, 1157, 177, 5, 57, "Input"], Cell[32312, 1164, 75, 1, 27, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[32436, 1171, 112, 2, 45, "Subsection", Evaluatable->False], Cell[32551, 1175, 95, 1, 27, "Input"], Cell[32649, 1178, 102, 1, 27, "Input"], Cell[CellGroupData[{ Cell[32776, 1183, 140, 4, 42, "Input"], Cell[32919, 1189, 59, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[33015, 1195, 95, 1, 27, "Input"], Cell[33113, 1198, 177, 3, 39, "Message"] }, Open ]], Cell[33305, 1204, 102, 1, 27, "Input"], Cell[CellGroupData[{ Cell[33432, 1209, 140, 4, 42, "Input"], Cell[33575, 1215, 59, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[33671, 1221, 95, 1, 27, "Input"], Cell[33769, 1224, 182, 3, 55, "Message"] }, Open ]], Cell[33966, 1230, 102, 1, 27, "Input"], Cell[CellGroupData[{ Cell[34093, 1235, 140, 4, 42, "Input"], Cell[34236, 1241, 59, 1, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[34344, 1248, 263, 5, 113, "Subsection", Evaluatable->False], Cell[34610, 1255, 45, 1, 27, "Input"], Cell[CellGroupData[{ Cell[34680, 1260, 202, 3, 59, "Input"], Cell[34885, 1265, 175, 3, 39, "Message"] }, Open ]], Cell[35075, 1271, 200, 3, 59, "Input"], Cell[35278, 1276, 213, 3, 59, "Input"], Cell[35494, 1281, 213, 3, 59, "Input"], Cell[CellGroupData[{ Cell[35732, 1288, 128, 4, 42, "Input"], Cell[35863, 1294, 59, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[35959, 1300, 128, 4, 42, "Input"], Cell[36090, 1306, 59, 1, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[36198, 1313, 263, 5, 113, "Subsection", Evaluatable->False], Cell[CellGroupData[{ Cell[36486, 1322, 45, 1, 27, "Input"], Cell[36534, 1325, 177, 3, 39, "Message"] }, Open ]], Cell[36726, 1331, 200, 3, 59, "Input"], Cell[36929, 1336, 200, 3, 59, "Input"], Cell[37132, 1341, 213, 3, 59, "Input"], Cell[37348, 1346, 213, 3, 59, "Input"], Cell[CellGroupData[{ Cell[37586, 1353, 128, 4, 42, "Input"], Cell[37717, 1359, 59, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[37813, 1365, 128, 4, 42, "Input"], Cell[37944, 1371, 59, 1, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[38052, 1378, 263, 5, 113, "Subsection", Evaluatable->False], Cell[CellGroupData[{ Cell[38340, 1387, 45, 1, 27, "Input"], Cell[38388, 1390, 182, 3, 55, "Message"] }, Open ]], Cell[38585, 1396, 200, 3, 59, "Input"], Cell[38788, 1401, 202, 3, 59, "Input"], Cell[38993, 1406, 213, 3, 59, "Input"], Cell[39209, 1411, 215, 3, 59, "Input"], Cell[CellGroupData[{ Cell[39449, 1418, 128, 4, 42, "Input"], Cell[39580, 1424, 59, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[39676, 1430, 128, 4, 42, "Input"], Cell[39807, 1436, 59, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[39903, 1442, 111, 2, 42, "Subsubsection", Evaluatable->False], Cell[CellGroupData[{ Cell[40039, 1448, 92, 1, 27, "Input"], Cell[40134, 1451, 181, 3, 39, "Message"], Cell[40318, 1456, 181, 3, 39, "Message"], Cell[40502, 1461, 188, 3, 55, "Message"], Cell[40693, 1466, 188, 3, 55, "Message"] }, Open ]], Cell[40896, 1472, 145, 3, 43, "Input"], Cell[CellGroupData[{ Cell[41066, 1479, 59, 1, 27, "Input"], Cell[41128, 1482, 238, 4, 88, "Output"] }, Open ]], Cell[41381, 1489, 150, 4, 42, "Input"], Cell[CellGroupData[{ Cell[41556, 1497, 59, 1, 27, "Input"], Cell[41618, 1500, 238, 4, 97, "Output"] }, Open ]], Cell[41871, 1507, 150, 4, 42, "Input"], Cell[CellGroupData[{ Cell[42046, 1515, 59, 1, 27, "Input"], Cell[42108, 1518, 238, 4, 88, "Output"] }, Open ]], Cell[42361, 1525, 148, 4, 42, "Input"], Cell[CellGroupData[{ Cell[42534, 1533, 59, 1, 27, "Input"], Cell[42596, 1536, 238, 4, 97, "Output"] }, Open ]], Cell[42849, 1543, 148, 4, 42, "Input"], Cell[CellGroupData[{ Cell[43022, 1551, 59, 1, 27, "Input"], Cell[43084, 1554, 238, 4, 88, "Output"] }, Open ]], Cell[43337, 1561, 148, 4, 42, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[43534, 1571, 59, 1, 27, "Input"], Cell[43596, 1574, 238, 4, 88, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[43871, 1583, 114, 2, 45, "Subsection", Evaluatable->False], Cell[43988, 1587, 79, 1, 27, "Input"], Cell[44070, 1590, 77, 1, 27, "Input"], Cell[CellGroupData[{ Cell[44172, 1595, 93, 1, 27, "Input"], Cell[44268, 1598, 242, 4, 55, "Message"], Cell[44513, 1604, 244, 4, 55, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[44794, 1613, 130, 3, 42, "Subsubsection", Evaluatable->False], Cell[44927, 1618, 329, 14, 192, "Input"], Cell[45259, 1634, 107, 5, 57, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[45403, 1644, 102, 2, 42, "Subsubsection", Evaluatable->False], Cell[45508, 1648, 84, 1, 27, "Input"], Cell[45595, 1651, 86, 1, 27, "Input"], Cell[45684, 1654, 84, 1, 27, "Input"], Cell[45771, 1657, 86, 1, 27, "Input"], Cell[45860, 1660, 84, 1, 27, "Input"], Cell[45947, 1663, 86, 1, 27, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[46070, 1669, 102, 2, 42, "Subsubsection", Evaluatable->False], Cell[46175, 1673, 84, 1, 27, "Input"], Cell[46262, 1676, 86, 1, 27, "Input"], Cell[46351, 1679, 84, 1, 27, "Input"], Cell[46438, 1682, 86, 1, 27, "Input"], Cell[46527, 1685, 84, 1, 27, "Input"], Cell[46614, 1688, 86, 1, 27, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[46737, 1694, 102, 2, 42, "Subsubsection", Evaluatable->False], Cell[46842, 1698, 84, 1, 27, "Input"], Cell[46929, 1701, 86, 1, 27, "Input"], Cell[47018, 1704, 84, 1, 27, "Input"], Cell[47105, 1707, 86, 1, 27, "Input"], Cell[47194, 1710, 84, 1, 27, "Input"], Cell[47281, 1713, 86, 1, 27, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[47416, 1720, 188, 4, 62, "Subsection", Evaluatable->False], Cell[47607, 1726, 3297, 107, 1677, "Input"], Cell[CellGroupData[{ Cell[50929, 1837, 154, 7, 87, "Input"], Cell[51086, 1846, 129, 5, 38, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[51252, 1856, 168, 10, 132, "Input"], Cell[51423, 1868, 253, 8, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[51713, 1881, 170, 10, 132, "Input"], Cell[51886, 1893, 129, 5, 38, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[52052, 1903, 171, 10, 132, "Input"], Cell[52226, 1915, 1635, 46, 149, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[53898, 1966, 170, 10, 132, "Input"], Cell[54071, 1978, 1616, 44, 149, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[55724, 2027, 170, 10, 132, "Input"], Cell[55897, 2039, 253, 8, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[56187, 2052, 170, 10, 132, "Input"], Cell[56360, 2064, 253, 8, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[56650, 2077, 104, 2, 42, "Subsubsection", Evaluatable->False], Cell[56757, 2081, 279, 8, 102, "Input"], Cell[CellGroupData[{ Cell[57061, 2093, 244, 9, 117, "Input"], Cell[57308, 2104, 127, 2, 39, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[57472, 2111, 244, 9, 117, "Input"], Cell[57719, 2122, 127, 2, 39, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[57883, 2129, 244, 9, 117, "Input"], Cell[58130, 2140, 127, 2, 39, "Message"] }, Open ]], Cell[CellGroupData[{ Cell[58294, 2147, 244, 9, 117, "Input"], Cell[58541, 2158, 127, 2, 39, "Message"] }, Open ]], Cell[58683, 2163, 712, 11, 312, "Input"], Cell[59398, 2176, 765, 12, 312, "Input"], Cell[60166, 2190, 766, 12, 312, "Input"], Cell[60935, 2204, 89, 1, 42, "Input"], Cell[61027, 2207, 158, 3, 57, "Input"], Cell[61188, 2212, 75, 1, 27, "Input"] }, Open ]] }, Open ]] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************) ccseapps-2.5/CCSEApps/tensorMG/DV_3D4.mF0000644000175000017500000031324211634153073020631 0ustar amckinstryamckinstry#define USE_TMP 1 #include #include "DivVis_F.H" #include #include "ArrayLim.H" c :::: usage: c :::: this .mF file is meant to be run through Mathematica. This converts c :::: compact symbolic expressions into fortran which is stored in a .F c :::: file. c---------------------------------------------------------------- c this is the fortran support file for the the operator c L(U) = alpha*a(x)*U - beta*Div( tau ) c c where U is the two component vector (u,v) and c tau is a three by three tensor c tau = | t_xx t_xy t_xz| c | t_xy t_yy t_yz| c | t_xz t_yz t_zz| c c t_xx = 2*mu * u_x c t_yy = 2*mu * v_y c t_zz = 2*mu * w_z c t_xy = mu*(u_y + v_x) c t_xz = mu*(u_z + w_x) c t_yz = mu*(v_z + w_y) c ::: define standard replacements used by Mathematica c ::: see file visc3d.ma c ::: <* standardrepl = { dudx[i+half ,j ,k ]->dudxe, dudx[i-1+half,j ,k ]->dudxw, dvdy[i, j+half ,k ]->dvdyn , dvdy[i, j-1+half,k ]->dvdys , dwdz[i, j ,k+half ]->dwdzt, dwdz[i, j ,k-1+half]->dwdzb, dudy[i, j +half,k]-> dudyn , dudy[i, j-1+half,k]-> dudys , dudy[i+half, j ,k]-> dudye , dudy[i-1+half,j ,k]-> dudyw , dvdx[i, j +half,k]-> dvdxn , dvdx[i, j-1+half,k]-> dvdxs , dvdx[i+half, j ,k]-> dvdxe , dvdx[i-1+half,j ,k]-> dvdxw , dudz[i ,j ,k+half ]->dudzt, dudz[i ,j ,k-1+half]->dudzb, dudz[i+half ,j ,k ]->dudze, dudz[i-1+half,j ,k ]->dudzw, dvdz[i ,j ,k+half ]->dvdzt, dvdz[i ,j ,k-1+half]->dvdzb, dvdz[i ,j+half ,k ]->dvdzn, dvdz[i ,j-1+half,k ]->dvdzs, dwdx[i+half ,j ,k ]->dwdxe, dwdx[i+half-1,j ,k ]->dwdxw, dwdx[i ,j ,k+half ]->dwdxt, dwdx[i ,j ,k+half-1]->dwdxb, dwdy[i ,j+half ,k ]->dwdyn, dwdy[i ,j+half-1,k ]->dwdys, dwdy[i ,j ,k+half ]->dwdyt, dwdy[i ,j ,k+half-1]->dwdyb, murepl1, murepl2,murepl3, tauxxdef, tauyydef,tauxydef,tauxzdef,tauyzdef, tauzzdef, vol->hx*hy*hz }; *> c ::: interface notes: c ::: 1) trander* ALWAYS have values in them, even if the cells are c ::: all covered. Might as well. These are edge located derivative c ::: values. In index space, they are located the same as the mask c ::: cells. Which is somewhat anomalous. These are edge values, after c ::: all. While the masks are cell-centered. But it seems easier c ::: at the moment. c ::: 1a) trander is 3x3 for each location; first is component number, then c ::: derivative direction. Not all of these are used, in fact, only the c ::: component which is normal to the face is used, and only the c ::: tangential directions are used. c ::: 2) the normal derivatives are evaluated in the normal fashion. c ::: 3) tangential derivatives which reach outside the rectangle DO have c ::: to check the masks. subroutine FORT_APPLYBC ( $ flagden, flagbc, maxorder, $ u, DIMS(u), $ cdir, bct, bcl, $ bcval, DIMS(bcval), $ maskn, DIMS(maskn), $ maske, DIMS(maske), $ maskw, DIMS(maskw), $ masks, DIMS(masks), $ maskt, DIMS(maskt), $ maskb, DIMS(maskb), $ den, DIMS(den), $ exttd,DIMS(exttd), $ trander,DIMS(trander), $ lo, hi, nc, $ h $ ) c c If the boundary is of Neumann type, set the ghost cell value to c that of the outermost point in the valid data (2nd order accurate) c and then fill the "den" array with the value "1" c c c If flagbc==1: c c If the boundary is of Dirichlet type, construct a polynomial c interpolation through the boundary location and internal points c (at locations x(-1:len-2) that generates the ghost cell value (at c location xInt). Then fill the ghost cell with the interpolated value. c If flagden==1, load the "den" array with the interpolation c coefficient corresponding to outermost point in the valid region c ( the coef(0) corresponding to the location x(0) ) c c Note: c The bc type = LO_REFLECT_ODD is a special type of dirichlet condition, c in that we want a "zeroth" order interpolant to fill the ghost cell. c If this were treated in the normal way, then ALL boundaries would be c low order. c ::: other notes since previous developers didn't bother to document c ::: cdir is mnemonic for coordinate direction. i.e. which side is c ::: cdir==0->west c ::: cdir==3->east c ::: cdir==1->south c ::: cdir==4->north c ::: cdir==2->bottom c ::: cdir==5->top c integer maxorder integer nc, cdir, flagden, flagbc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(u) REAL_T u(DIMV(u),nc) integer DIMDEC(den) REAL_T den(DIMV(den),nc) integer DIMDEC(exttd) REAL_T exttd(DIMV(exttd),nc,3) integer DIMDEC(bcval) REAL_T bcval(DIMV(bcval),nc) integer DIMDEC(maskn) integer maskn(DIMV(maskn)) integer DIMDEC(maske) integer maske(DIMV(maske)) integer DIMDEC(maskw) integer maskw(DIMV(maskw)) integer DIMDEC(masks) integer masks(DIMV(masks)) integer DIMDEC(maskt) integer maskt(DIMV(maskt)) integer DIMDEC(maskb) integer maskb(DIMV(maskb)) integer DIMDEC(trander) REAL_T trander(DIMV(trander),3,3) integer bct(nc) REAL_T bcl REAL_T h(BL_SPACEDIM) c integer i integer j integer k integer n logical is_dirichlet logical is_neumann logical is_odd REAL_T xb REAL_T innder,outder,innloc REAL_T edgloc,outloc REAL_T lambda REAL_T hx,hy,hz c integer lenx integer leny integer lenz integer m c...........trial change ................. integer tmplen parameter(tmplen=256) REAL_T tmp(0:tmplen) c...........trial change ................. c integer Lmaxorder integer maxmaxorder parameter(maxmaxorder=4) REAL_T x(-1:maxmaxorder-2) REAL_T coef(-1:maxmaxorder-2) REAL_T xInt logical False, True parameter( False=.false.) parameter( True=.true. ) c is_dirichlet(i) = ( i .eq. LO_DIRICHLET ) is_neumann(i) = (i .eq. LO_NEUMANN) c if ( maxorder .eq. -1 ) then Lmaxorder = maxmaxorder else Lmaxorder = MIN(maxorder,maxmaxorder) endif lenx = MIN(hi(1)-lo(1), Lmaxorder-2) leny = MIN(hi(2)-lo(2), Lmaxorder-2) lenz = MIN(hi(3)-lo(3), Lmaxorder-2) hx = h(1) hy = h(2) hz = h(3) c...........trial change ................. if( (hi(1)-lo(1)+1).gt.tmplen .or. & (hi(2)-lo(2)+1).gt.tmplen .or. & (hi(3)-lo(3)+1).gt.tmplen) then write(6,*)'FORT_APPLYBC: tmplen must be larger' stop endif c...........trial change ................. c c TODO: c In order for this to work with growing multigrid, must c sort xa[] because it is possible for the xb value to lay c within this range. c c The west face of the grid c if(cdir .eq. 0) then do n = 1,nc if (is_neumann(bct(n))) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(lo(1)-1,j,k,n) = cvmgt( $ u(lo(1),j,k,n), $ u(lo(1)-1,j,k,n), $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo if ( flagden .eq. 1) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(lo(1),j,k,n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part c ::: ::: <* Clear[indexcond]; *> i = lo(1) c ::: ::: ::: Y do k=lo(3),hi(3) c ::: ::: ::: ::: interior part of west face do j=lo(2)+1,hi(2)-1 innder = <* FA[DTwoY[U,i,j,k,n] //. allUVW] *> trander(i-1,j,k,n,2) = innder enddo j = lo(2) if(<* FA[ dependentCellsNotCovered[DTwoY[u,i,j,k] //. allUVW, Function[{i,j,k},(j<0)], masks]]*>) then innder = <* FA[DOneY[U,i,j,k,n,+1] //. allUVW ]*> else innder = <* FA[DTwoY[U,i,j,k,n] ]*> endif trander(i-1,j,k,n,2) = innder j = hi(2) if(<* FA[ dependentCellsNotCovered[DTwoY[u,i,j,k] //. allUVW, Function[{i,j,k},(j>0)], maskn]]*>) then innder = <* FA[DOneY[U,i,j,k,n,-1] //. allUVW ]*> else innder = <* FA[DTwoY[U,i,j,k,n] ]*> endif trander(i-1,j,k,n,2) = innder enddo c ::: ::: ::: Z do j=lo(2),hi(2) do k=lo(3)+1,hi(3)-1 innder = <* FA[DTwoZ[U,i,j,k,n] //. allUVW ]*> trander(i-1,j,k,n,3) = innder enddo k = lo(3) if(<* FA[ dependentCellsNotCovered[DTwoZ[u,i,j,k] //. allUVW, Function[{i,j,k},(k<0)], maskb]]*>) then innder = <* FA[DOneZ[U,i,j,k,n,+1] //. allUVW ]*> else innder = <* FA[DTwoZ[U,i,j,k,n] ]*> endif trander(i-1,j,k,n,3) = innder k = hi(3) if(<* FA[ dependentCellsNotCovered[DTwoZ[u,i,j,k] //. allUVW, Function[{i,j,k},(k>0)], maskt]]*>) then innder = <* FA[DOneZ[U,i,j,k,n,-1] //. allUVW ]*> else innder = <* FA[DTwoZ[U,i,j,k,n] ]*> endif trander(i-1,j,k,n,3) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,lenx x(m) = m + 0.5 enddo x(-1) = - bcl/h(1) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenx+2, coef) #if USE_TMP do k = lo(3), hi(3) if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) tmp(j-lo(2)) = bcval(lo(1)-1,j,k,n)*coef(-1) enddo else do j = lo(2), hi(2) tmp(j-lo(2)) = 0.0 enddo endif do m = 0, lenx do j = lo(2), hi(2) tmp(j-lo(2)) = tmp(j-lo(2))+u(lo(1)+m,j,k,n)*coef(m) enddo enddo do j = lo(2), hi(2) u(lo(1)-1, j, k, n) = cvmgt( & tmp(j-lo(2)), $ u(lo(1)-1, j,k, n), $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo #else if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(lo(1)-1, j, k, n) = cvmgt( $ bcval(lo(1)-1,j,k,n)*coef(-1), $ u(lo(1)-1, j,k, n), $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo else do k = lo(3), hi(3) do j = lo(2), hi(2) u(lo(1)-1, j, k, n) = cvmgt( $ 0.0, $ u(lo(1)-1, j, k, n), $ maskw(lo(1)-1,j, k) .gt. 0) enddo enddo endif do k = lo(3), hi(3) do m = 0, lenx do j = lo(2), hi(2) u(lo(1)-1,j,k,n) = cvmgt( $ u(lo(1)-1,j,k,n) $ + u(lo(1)+m, j, k, n)*coef(m), $ u(lo(1)-1,j,k,n), $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(lo(1),j,k,n) = cvmgt(coef(0), 0.0, $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: <* Clear[indexcond] ; *> c ::: ::: interior part of west side edgloc = 0. i = lo(1) c ::: ::: ::: Y do k=lo(3),hi(3) do j=lo(2)+1,hi(2)-1 if( <* FA[ dependentCellsCovered[DTwoY[u,i-1,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i-1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i-1,j,k,+1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i-1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i-1,j,k,-1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i-1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,2) else outder = 0. endif endif innloc = 0.5 innder = <* FA[ DTwoY[U,i,j,k,n] ]*> lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,2) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: now endpoints j = lo(2) if( <* FA[dependentCellsCovered[DTwoY[u,i-1,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i-1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i-1,j,k,+1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i-1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i-1,j,k,-1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i-1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,2) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>) then innder = <*FA[DOneY[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoY[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,2) = lambda*innder+(1-lambda)*outder j = hi(2) if( <* FA[dependentCellsCovered[DTwoY[u,i-1,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i-1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i-1,j,k,+1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i-1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i-1,j,k,-1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i-1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,2) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>) then innder = <*FA[DOneY[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoY[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,2) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Z do j=lo(2),hi(2) do k=lo(3)+1,hi(3)-1 if( <* FA[ dependentCellsCovered[DTwoZ[u,i-1,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i-1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i-1,j,k,+1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i-1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i-1,j,k,-1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i-1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,3) else outder = 0. endif endif innloc = 0.5 innder = <* FA[ DTwoZ[U,i,j,k,n] ]*> lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,3) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: now endpoints k = lo(3) if( <* FA[dependentCellsCovered[DTwoZ[u,i-1,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i-1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i-1,j,k,+1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i-1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i-1,j,k,-1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i-1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,3) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoZ[u,i,j,k]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>) then innder = <*FA[DOneZ[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoZ[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,3) = lambda*innder+(1-lambda)*outder k = hi(3) if( <* FA[dependentCellsCovered[DTwoZ[u,i-1,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i-1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i-1,j,k,+1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i-1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i-1,j,k,-1]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i-1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,k,n,3) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoZ[u,i,j,k]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>) then innder = <*FA[DOneZ[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoZ[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i-1,j,k,n,3) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(lo(1)-1, j, k, n) = cvmgt( $ -u(lo(1),j,k,n), $ u(lo(1)-1,j,k,n), $ maskw(lo(1)-1,j,k) .gt. 0) trander(lo(1)-1,j,k,n,2) = 0. trander(lo(1)-1,j,k,n,3) = 0. enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(lo(1),j,k,n) = cvmgt(-1.0, 0.0, $ maskw(lo(1)-1,j,k) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON WEST FACE IN APPLYBC' stop endif enddo endif c c The east face of the grid c if(cdir .eq. 3) then do n = 1,nc if(is_neumann(bct(n))) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(hi(1)+1,j,k,n) = cvmgt( $ u(hi(1), j, k, n), $ u(hi(1)+1, j, k, n), $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(hi(1),j,k,n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part i = hi(1) c ::: ::: ::: Y do k=lo(3),hi(3) c ::: ::: ::: ::: interior part of west face do j=lo(2)+1,hi(2)-1 innder = <* FA[DTwoY[U,i,j,k,n] //. allUVW] *> trander(i+1,j,k,n,2) = innder enddo j = lo(2) if(<* FA[ dependentCellsNotCovered[DTwoY[u,i,j,k] //. allUVW, Function[{i,j,k},(j<0)], masks]]*>) then innder = <* FA[DOneY[U,i,j,k,n,+1] //. allUVW ]*> else innder = <* FA[DTwoY[U,i,j,k,n] ]*> endif trander(i+1,j,k,n,2) = innder j = hi(2) if(<* FA[ dependentCellsNotCovered[DTwoY[u,i,j,k] //. allUVW, Function[{i,j,k},(j>0)], maskn]]*>) then innder = <* FA[DOneY[U,i,j,k,n,-1] //. allUVW ]*> else innder = <* FA[DTwoY[U,i,j,k,n] ]*> endif trander(i+1,j,k,n,2) = innder enddo c ::: ::: ::: Z do j=lo(2),hi(2) do k=lo(3)+1,hi(3)-1 innder = <* FA[DTwoZ[U,i,j,k,n] //. allUVW ]*> trander(i+1,j,k,n,3) = innder enddo k = lo(3) if(<* FA[ dependentCellsNotCovered[DTwoZ[u,i,j,k] //. allUVW, Function[{i,j,k},(k<0)], maskb]]*>) then innder = <* FA[DOneZ[U,i,j,k,n,+1] //. allUVW ]*> else innder = <* FA[DTwoZ[U,i,j,k,n] ]*> endif trander(i+1,j,k,n,3) = innder k = hi(3) if(<* FA[ dependentCellsNotCovered[DTwoZ[u,i,j,k] //. allUVW, Function[{i,j,k},(k>0)], maskt]]*>) then innder = <* FA[DOneZ[U,i,j,k,n,-1] //. allUVW ]*> else innder = <* FA[DTwoZ[U,i,j,k,n] ]*> endif trander(i+1,j,k,n,3) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,lenx x(m) = m + 0.5 enddo x(-1) = - bcl/h(1) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenx+2, coef) #if USE_TMP do k = lo(3), hi(3) if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) tmp(j-lo(2)) = bcval(hi(1)+1,j,k,n)*coef(-1) enddo else do j = lo(2), hi(2) tmp(j-lo(2)) = 0.0 enddo endif do m = 0, lenx do j = lo(2), hi(2) tmp(j-lo(2)) = tmp(j-lo(2))+u(hi(1)-m,j,k,n)*coef(m) enddo enddo do j = lo(2), hi(2) u(hi(1)+1,j,k,n) = cvmgt( $ tmp(j-lo(2)), $ u(hi(1)+1,j,k,n), $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo #else if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(hi(1)+1,j,k,n) = cvmgt( $ bcval(hi(1)+1,j,k,n)*coef(-1), $ u(hi(1)+1,j,k,n), $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo else do k = lo(3), hi(3) do j = lo(2), hi(2) u(hi(1)+1,j,k,n) = cvmgt( $ 0.0, $ u(hi(1)+1,j,k,n), $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo endif do k = lo(3), hi(3) do m = 0, lenx do j = lo(2), hi(2) u(hi(1)+1,j,k,n) = cvmgt( $ u(hi(1)+1,j,k,n) $ + u(hi(1)-m,j,k,n)*coef(m), $ u(hi(1)+1,j,k,n), $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(hi(1),j,k,n) = cvmgt(coef(0), 0.0, $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: interior part of west side edgloc = 0. i = hi(1) c ::: ::: ::: Y do k=lo(3),hi(3) do j=lo(2)+1,hi(2)-1 if( <* FA[ dependentCellsCovered[DTwoY[u,i+1,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i+1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i+1,j,k,+1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i+1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i+1,j,k,-1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i+1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,2) else outder = 0. endif endif innloc = 0.5 innder = <* FA[ DTwoY[U,i,j,k,n] ]*> lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,2) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: now endpoints j = lo(2) if( <* FA[dependentCellsCovered[DTwoY[u,i+1,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i+1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i+1,j,k,+1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i+1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i+1,j,k,-1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i+1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,2) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>) then innder = <*FA[DOneY[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoY[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,2) = lambda*innder+(1-lambda)*outder j = hi(2) if( <* FA[dependentCellsCovered[DTwoY[u,i+1,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i+1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i+1,j,k,+1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i+1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneY[u,i+1,j,k,-1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i+1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,2) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>) then innder = <*FA[DOneY[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoY[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,2) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Z do j=lo(2),hi(2) do k=lo(3)+1,hi(3)-1 if( <* FA[ dependentCellsCovered[DTwoZ[u,i+1,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i+1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i+1,j,k,+1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i+1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i+1,j,k,-1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i+1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,3) else outder = 0. endif endif innloc = 0.5 innder = <* FA[ DTwoZ[U,i,j,k,n] ]*> lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,3) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: now endpoints k = lo(3) if( <* FA[dependentCellsCovered[DTwoZ[u,i+1,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i+1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i+1,j,k,+1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i+1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i+1,j,k,-1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i+1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,3) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoZ[u,i,j,k]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>) then innder = <*FA[DOneZ[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoZ[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,3) = lambda*innder+(1-lambda)*outder k = hi(3) if( <* FA[dependentCellsCovered[DTwoZ[u,i+1,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i+1,j,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i+1,j,k,+1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i+1,j,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i+1,j,k,-1]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i+1,j,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,k,n,3) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoZ[u,i,j,k]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>) then innder = <*FA[DOneZ[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoZ[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i+1,j,k,n,3) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do k = lo(3), hi(3) do j = lo(2), hi(2) u(hi(1)+1, j, k, n) = cvmgt( $ -u(hi(1),j,k,n), $ u(hi(1)+1,j,k,n), $ maske(hi(1)+1,j,k) .gt. 0) trander(hi(1)+1,j,k,n,2) = 0. trander(hi(1)+1,j,k,n,3) = 0. enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do j = lo(2), hi(2) den(hi(1),j,k,n) = cvmgt(-1.0, 0.0, $ maske(hi(1)+1,j,k) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON RIGHT FACE IN APPLYBC' stop endif enddo endif c c The south of the Grid c if(cdir .eq. 1) then do n = 1,nc if(is_neumann(bct(n))) then do k = lo(3), hi(3) do i = lo(1),hi(1) u(i,lo(2)-1,k,n) = cvmgt( $ u(i,lo(2),k,n), $ u(i,lo(2)-1,k,n), $ masks(i,lo(2)-1,k) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1),hi(1) den(i,lo(2),k,n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part j = lo(2) c ::: ::: ::: X do k=lo(3),hi(3) c ::: ::: ::: ::: interior part of south face do i=lo(1)+1,hi(1)-1 innder = <* FA[DTwoX[U,i,j,k,n]] *> trander(i,j-1,k,n,1) = innder enddo i = lo(1) if(<*FA[ dependentCellsNotCovered[DTwoX[u,i,j,k] //. allUVW, Function[{i,j,k},(i<0)],maskw]]*>) then innder = <* FA[DOneX[U,i,j,k,n,+1]]*> else innder = <* FA[DTwoX[U,i,j,k,n]]*> endif trander(i,j-1,k,n,1) = innder i = hi(1) if(<*FA[ dependentCellsNotCovered[DTwoX[u,i,j,k] //. allUVW, Function[{i,j,k},(i>0)],maske]]*>) then innder = <* FA[DOneX[U,i,j,k,n,-1]]*> else innder = <* FA[DTwoX[U,i,j,k,n]]*> endif trander(i,j-1,k,n,1) = innder enddo c ::: ::: ::: Z do i=lo(1),hi(1) c ::: ::: ::: ::: interior part of south face do k=lo(3)+1,hi(3)-1 innder = <* FA[DTwoZ[U,i,j,k,n]]*> trander(i,j-1,k,n,3) = innder enddo k = lo(3) if(<* FA[ dependentCellsNotCovered[DTwoZ[u,i,j,k] //. allUVW, Function[{i,j,k},(k<0)], maskb]]*>) then innder = <* FA[DOneZ[U,i,j,k,n,+1] //. allUVW ]*> else innder = <* FA[DTwoZ[U,i,j,k,n] ]*> endif trander(i,j-1,k,n,3) = innder k = hi(3) if(<* FA[ dependentCellsNotCovered[DTwoZ[u,i,j,k] //. allUVW, Function[{i,j,k},(k>0)], maskt]]*>) then innder = <* FA[DOneZ[U,i,j,k,n,-1] //. allUVW ]*> else innder = <* FA[DTwoZ[U,i,j,k,n] ]*> endif trander(i,j-1,k,n,3) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,leny x(m) = m + 0.5 enddo x(-1) = - bcl/h(2) xInt = - 0.5 call polyInterpCoeff(xInt, x, leny+2, coef) #if USE_TMP do k = lo(3), hi(3) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) tmp(i-lo(1)) = bcval(i,lo(2)-1,k,n)*coef(-1) enddo else do i = lo(1), hi(1) tmp(i-lo(1)) = 0.0 enddo endif do m = 0, leny do i = lo(1), hi(1) tmp(i-lo(1)) = tmp(i-lo(1))+u(i,lo(2)+m,k,n)*coef(m) enddo enddo do i = lo(1), hi(1) u(i,lo(2)-1,k,n) = cvmgt( $ tmp(i-lo(1)), $ u(i,lo(2)-1,k,n), $ masks(i,lo(2)-1,k) .gt. 0) enddo enddo #else if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,lo(2)-1,k,n) = cvmgt( $ bcval(i,lo(2)-1,k,n)*coef(-1), $ u(i,lo(2)-1,k,n), $ masks(i,lo(2)-1,k) .gt. 0) enddo enddo else do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,lo(2)-1,k,n) = cvmgt( $ 0.0, $ u(i,lo(2)-1,k,n), $ masks(i,lo(2)-1,k) .gt. 0) enddo enddo endif do k = lo(3), hi(3) do m = 0, leny do i = lo(1), hi(1) u(i, lo(2)-1, k, n) = cvmgt( $ u(i, lo(2)-1,k,n) $ + u(i, lo(2)+m, k,n)*coef(m), $ u(i, lo(2)-1, k, n), $ masks(i, lo(2)-1, k) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i, lo(2),k,n) = cvmgt(coef(0), 0.0, $ masks(i, lo(2)-1,k) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: interior part first, followed by end points edgloc = 0. j=lo(2) c ::: ::: ::: X do k=lo(3),hi(3) do i=lo(1)+1, hi(1)-1 if( <* FA[ dependentCellsCovered[DTwoX[u,i,j-1,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j-1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j-1,k,+1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j-1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j-1,k,-1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j-1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,1) else outder = 0. endif endif innloc = 0.5 innder = <*FA[ DTwoX[U,i,j,k,n] ] *> lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,1) = lambda*innder+(1-lambda)*outder enddo i = lo(1) if( <* FA[ dependentCellsCovered[DTwoX[u,i,j-1,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j-1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j-1,k,+1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j-1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j-1,k,-1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j-1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,1) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>) then innder = <*FA[DOneX[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoX[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,1) = lambda*innder+(1-lambda)*outder i = hi(1) if( <* FA[ dependentCellsCovered[DTwoX[u,i,j-1,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j-1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j-1,k,+1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j-1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j-1,k,-1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j-1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,1) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>) then innder = <*FA[DOneX[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoX[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,1) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Z do i=lo(1), hi(1) do k=lo(3)+1,hi(3)-1 if( <* FA[ dependentCellsCovered[DTwoZ[u,i,j-1,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i,j-1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j-1,k,+1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j-1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j-1,k,-1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j-1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,3) else outder = 0. endif endif innloc = 0.5 innder = <*FA[ DTwoZ[U,i,j,k,n] ] *> lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,3) = lambda*innder+(1-lambda)*outder enddo k = lo(3) if( <* FA[ dependentCellsCovered[DTwoZ[u,i,j-1,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i,j-1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j-1,k,+1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j-1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j-1,k,-1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j-1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,3) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoZ[u,i,j,k]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>) then innder = <*FA[DOneZ[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoZ[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,3) = lambda*innder+(1-lambda)*outder k = hi(3) if( <* FA[ dependentCellsCovered[DTwoZ[u,i,j-1,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i,j-1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j-1,k,+1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j-1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j-1,k,-1]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j-1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j-1,k,n,3) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoZ[u,i,j,k]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>) then innder = <*FA[DOneZ[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoZ[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j-1,k,n,3) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do k = lo(3), hi(3) do i = lo(1), hi(1) u(i, lo(2)-1, k, n) = cvmgt( $ -u(i,lo(2),k,n), $ u(i,lo(2)-1,k,n), $ masks(i,lo(2)-1,k) .gt. 0) trander(i,lo(2)-1,k,n,1) = 0. trander(i,lo(2)-1,k,n,3) = 0. enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,lo(2),k,n) = cvmgt(-1.0, 0.0, $ masks(i,lo(2)-1,k) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON BOTTOM FACE IN APPLYBC' stop endif enddo endif c c The north of the grid c if (cdir .eq. 4) then do n = 1,nc if(is_neumann(bct(n))) then do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,hi(2)+1,k,n) = cvmgt( $ u(i,hi(2),k,n), $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,hi(2),k,n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part j = hi(2) c ::: ::: ::: X do k=lo(3),hi(3) c ::: ::: ::: ::: interior part of south face do i=lo(1)+1,hi(1)-1 innder = <* FA[DTwoX[U,i,j,k,n]] *> trander(i,j+1,k,n,1) = innder enddo i = lo(1) if(<*FA[ dependentCellsNotCovered[DTwoX[u,i,j,k] //. allUVW, Function[{i,j,k},(i<0)],maskw]]*>) then innder = <* FA[DOneX[U,i,j,k,n,+1]]*> else innder = <* FA[DTwoX[U,i,j,k,n]]*> endif trander(i,j+1,k,n,1) = innder i = hi(1) if(<*FA[ dependentCellsNotCovered[DTwoX[u,i,j,k] //. allUVW, Function[{i,j,k},(i>0)],maske]]*>) then innder = <* FA[DOneX[U,i,j,k,n,-1]]*> else innder = <* FA[DTwoX[U,i,j,k,n]]*> endif trander(i,j+1,k,n,1) = innder enddo c ::: ::: ::: Z do i=lo(1),hi(1) c ::: ::: ::: ::: interior part of south face do k=lo(3)+1,hi(3)-1 innder = <* FA[DTwoZ[U,i,j,k,n]]*> trander(i,j+1,k,n,3) = innder enddo k = lo(3) if(<* FA[ dependentCellsNotCovered[DTwoZ[u,i,j,k] //. allUVW, Function[{i,j,k},(k<0)], maskb]]*>) then innder = <* FA[DOneZ[U,i,j,k,n,+1] //. allUVW ]*> else innder = <* FA[DTwoZ[U,i,j,k,n] ]*> endif trander(i,j+1,k,n,3) = innder k = hi(3) if(<* FA[ dependentCellsNotCovered[DTwoZ[u,i,j,k] //. allUVW, Function[{i,j,k},(k>0)], maskt]]*>) then innder = <* FA[DOneZ[U,i,j,k,n,-1] //. allUVW ]*> else innder = <* FA[DTwoZ[U,i,j,k,n] ]*> endif trander(i,j+1,k,n,3) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,leny x(m) = m + 0.5 enddo x(-1) = - bcl/h(2) xInt = - 0.5 call polyInterpCoeff(xInt, x, leny+2, coef) #if USE_TMP do k = lo(3), hi(3) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) tmp(i-lo(1)) = bcval(i,hi(2)+1,k,n)*coef(-1) enddo else do i = lo(1), hi(1) tmp(i-lo(1)) = 0.0 enddo endif do m = 0, leny do i = lo(1), hi(1) tmp(i-lo(1)) = tmp(i-lo(1))+u(i,hi(2)-m,k,n)*coef(m) enddo enddo do i = lo(1), hi(1) u(i,hi(2)+1,k,n) = cvmgt( $ tmp(i-lo(1)), $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo #else if ( flagbc .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,hi(2)+1,k,n) = cvmgt( $ bcval(i,hi(2)+1,k,n)*coef(-1), $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo else do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,hi(2)+1,k,n) = cvmgt( $ 0.0, $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo endif do k = lo(3), hi(3) do m = 0, leny do i = lo(1), hi(1) u(i, hi(2)+1,k,n) = cvmgt( $ u(i,hi(2)+1,k,n) $ + u(i, hi(2)-m,k,n)*coef(m), $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,hi(2),k,n) = cvmgt(coef(0), 0.0, $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: interior part first, followed by end points edgloc = 0. j=hi(2) c ::: ::: ::: X do k=lo(3),hi(3) do i=lo(1)+1, hi(1)-1 if( <* FA[ dependentCellsCovered[DTwoX[u,i,j+1,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j+1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j+1,k,+1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j+1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j+1,k,-1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j+1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,1) else outder = 0. endif endif innloc = 0.5 innder = <*FA[ DTwoX[U,i,j,k,n] ] *> lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,1) = lambda*innder+(1-lambda)*outder enddo i = lo(1) if( <* FA[ dependentCellsCovered[DTwoX[u,i,j+1,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j+1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j+1,k,+1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j+1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j+1,k,-1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j+1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,1) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>) then innder = <*FA[DOneX[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoX[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,1) = lambda*innder+(1-lambda)*outder i = hi(1) if( <* FA[ dependentCellsCovered[DTwoX[u,i,j+1,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j+1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j+1,k,+1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j+1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneX[u,i,j+1,k,-1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j+1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,1) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>) then innder = <*FA[DOneX[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoX[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,1) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Z do i=lo(1), hi(1) do k=lo(3)+1,hi(3)-1 if( <* FA[ dependentCellsCovered[DTwoZ[u,i,j+1,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i,j+1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j+1,k,+1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j+1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j+1,k,-1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j+1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,3) else outder = 0. endif endif innloc = 0.5 innder = <*FA[ DTwoZ[U,i,j,k,n] ] *> lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,3) = lambda*innder+(1-lambda)*outder enddo k = lo(3) if( <* FA[ dependentCellsCovered[DTwoZ[u,i,j+1,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i,j+1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j+1,k,+1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j+1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j+1,k,-1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j+1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,3) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoZ[u,i,j,k]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>) then innder = <*FA[DOneZ[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoZ[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,3) = lambda*innder+(1-lambda)*outder k = hi(3) if( <* FA[ dependentCellsCovered[DTwoZ[u,i,j+1,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DTwoZ[U,i,j+1,k,n]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j+1,k,+1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j+1,k,n,+1]]*> elseif( <* FA[ dependentCellsCovered[DOneZ[u,i,j+1,k,-1]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>)then outloc = -0.5 outder = <*FA[DOneZ[U,i,j+1,k,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j+1,k,n,3) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoZ[u,i,j,k]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>) then innder = <*FA[DOneZ[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoZ[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j+1,k,n,3) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do k = lo(3), hi(3) do i = lo(1), hi(1) u(i, hi(2)+1, k, n) = cvmgt( $ -u(i,hi(2),k,n), $ u(i,hi(2)+1,k,n), $ maskn(i,hi(2)+1,k) .gt. 0) trander(i,hi(2)+1,k,n,1) = 0. trander(i,hi(2)+1,k,n,3) = 0. enddo enddo if ( flagden .eq. 1 ) then do k = lo(3), hi(3) do i = lo(1), hi(1) den(i,hi(2),k,n) = cvmgt(-1.0, 0.0, $ maskn(i,hi(2)+1,k) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON TOP FACE IN APPLYBC' stop endif enddo endif c c The bottom of the Grid c if(cdir .eq. 2) then do n = 1,nc if(is_neumann(bct(n))) then do j = lo(2), hi(2) do i = lo(1),hi(1) u(i,j,lo(3)-1,n) = cvmgt( $ u(i,j,lo(3),n), $ u(i,j,lo(3)-1,n), $ maskb(i,j,lo(3)-1) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1),hi(1) den(i,j,lo(3),n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part k = lo(3) c ::: ::: X do j=lo(2),hi(2) c ::: ::: ::: interior part of bottom face do i=lo(1)+1,hi(1)-1 innder = <* FA[DTwoX[U,i,j,k,n]] *> trander(i,j,k-1,n,1) = innder enddo i = lo(1) if( <*FA[ dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>) then innder = <* FA[DOneX[U,i,j,k,n,+1]]*> else innder = <* FA[DTwoX[U,i,j,k,n]]*> endif trander(i,j,k-1,n,1) = innder i = hi(1) if( <*FA[ dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>) then innder = <* FA[DOneX[U,i,j,k,n,-1]]*> else innder = <* FA[DTwoX[U,i,j,k,n]]*> endif trander(i,j,k-1,n,1) = innder enddo c ::: ::: ::: Y do i=lo(1),hi(1) c ::: ::: ::: interior part of bottom face do j=lo(2)+1,hi(2)-1 innder = <* FA[ DTwoY[U,i,j,k,n]] *> trander(i,j,k-1,n,2) = innder enddo j = lo(2) if( <* FA[ dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>) then innder = <* FA[ DOneY[U,i,j,k,n,+1] ] *> else innder = <* FA[ DTwoY[U,i,j,k,n] ] *> endif trander(i,j,k-1,n,2) = innder j = hi(2) if( <* FA[ dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>) then innder = <* FA[ DOneY[U,i,j,k,n,-1] ] *> else innder = <* FA[ DTwoY[U,i,j,k,n] ] *> endif trander(i,j,k-1,n,2) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,lenz x(m) = m + 0.5 enddo x(-1) = - bcl/h(3) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenz+2, coef) #if USE_TMP do j = lo(2), hi(2) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) tmp(i-lo(1)) = bcval(i,j,lo(3)-1,n)*coef(-1) enddo else do i = lo(1), hi(1) tmp(i-lo(1)) = 0.0 enddo endif do m = 0, lenz do i = lo(1), hi(1) tmp(i-lo(1)) = tmp(i-lo(1))+u(i,j,lo(3)+m,n)*coef(m) enddo enddo do i=lo(1),hi(1) u(i,j,lo(3)-1,n) = cvmgt( & tmp(i-lo(1)), & u(i,j,lo(3)-1,n), & maskb(i,j,lo(3)-1).gt. 0 ) enddo enddo #else if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j,lo(3)-1,n) = cvmgt( $ bcval(i,j,lo(3)-1,n)*coef(-1), $ u(i,j,lo(3)-1,n), $ maskb(i,j,lo(3)-1) .gt. 0) enddo enddo else do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j,lo(3)-1,n) = cvmgt( $ 0.0, $ u(i,j,lo(3)-1,n), $ maskb(i,j,lo(3)-1) .gt. 0) enddo enddo endif do j = lo(2), hi(2) do m = 0, lenz do i = lo(1), hi(1) u(i, j, lo(3)-1, n) = cvmgt( $ u(i, j, lo(3)-1,n) $ + u(i, j, lo(3)+m, n)*coef(m), $ u(i, j, lo(3)-1,n), $ maskb(i, j, lo(3)-1) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i, j, lo(3),n) = cvmgt(coef(0), 0.0, $ maskb(i, j, lo(3)-1) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: interior part first, followed by end points edgloc = 0. k = lo(3) c ::: ::: ::: X do j=lo(2),hi(2) do i=lo(1)+1, hi(1)-1 if( <* FA[ dependentCellsCovered[DTwoX[u,i,j,k-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j,k-1,n]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k-1,+1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k-1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k-1,-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k-1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,1) else outder = 0. endif endif innloc = 0.5 innder = <*FA[ DTwoX[u,i,j,k,n] ] *> lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,1) = lambda*innder+(1-lambda)*outder enddo i = lo(1) if( <* FA[ dependentCellsCovered[DTwoX[u,i,j,k-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j,k-1,n]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k-1,+1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k-1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k-1,-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k-1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,1) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>) then innder = <*FA[DOneX[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoX[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,1) = lambda*innder+(1-lambda)*outder i = hi(1) if( <* FA[ dependentCellsCovered[DTwoX[u,i,j,k-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j,k-1,n]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k-1,+1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k-1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k-1,-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k-1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,1) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>) then innder = <*FA[DOneX[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoX[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,1) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Y do i=lo(1), hi(1) do j=lo(2)+1,hi(2)-1 if( <* FA[ dependentCellsCovered[DTwoY[u,i,j,k-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i,j,k-1,n]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k-1,+1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k-1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k-1,-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k-1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,2) else outder = 0. endif endif innloc = 0.5 innder = <*FA[ DTwoY[u,i,j,k,n] ] *> lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,2) = lambda*innder+(1-lambda)*outder enddo j = lo(2) if( <* FA[ dependentCellsCovered[DTwoY[u,i,j,k-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i,j,k-1,n]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k-1,+1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k-1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k-1,-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k-1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,2) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>) then innder = <*FA[DOneY[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoY[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,2) = lambda*innder+(1-lambda)*outder j = hi(2) if( <* FA[ dependentCellsCovered[DTwoY[u,i,j,k-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i,j,k-1,n]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k-1,+1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k-1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k-1,-1]//.allUVW, Function[{i,j,k},(k<0)],maskb]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k-1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k-1,n,2) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>) then innder = <*FA[DOneY[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoY[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k-1,n,2) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do j = lo(2), hi(2) do i = lo(1), hi(1) u(i, j, lo(3)-1, n) = cvmgt( $ -u(i,j,lo(3),n), $ u(i,j,lo(3)-1,n), $ maskb(i,j,lo(3)-1) .gt. 0) trander(i,j,lo(3)-1,n,1) = 0. trander(i,j,lo(3)-1,n,2) = 0. enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j,lo(3),n) = cvmgt(-1.0, 0.0, $ maskb(i,j,lo(3)-1) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON FRONT FACE IN APPLYBC' stop endif enddo endif c c The top of the grid c if (cdir .eq. 5) then do n = 1,nc if(is_neumann(bct(n))) then do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j, hi(3)+1,n) = cvmgt( $ u(i,j, hi(3),n), $ u(i,j, hi(3)+1,n), $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j, hi(3),n) = 1.0 enddo enddo endif c ::: ::: now do the tangential derivative part k = hi(3) c ::: ::: X do j=lo(2),hi(2) c ::: ::: ::: interior part of bottom face do i=lo(1)+1,hi(1)-1 innder = <* FA[DTwoX[U,i,j,k,n]] *> trander(i,j,k+1,n,1) = innder enddo i = lo(1) if( <*FA[ dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>) then innder = <* FA[DOneX[U,i,j,k,n,+1]]*> else innder = <* FA[DTwoX[U,i,j,k,n]]*> endif trander(i,j,k+1,n,1) = innder i = hi(1) if( <*FA[ dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>) then innder = <* FA[DOneX[U,i,j,k,n,-1]]*> else innder = <* FA[DTwoX[U,i,j,k,n]]*> endif trander(i,j,k+1,n,1) = innder enddo c ::: ::: ::: Y do i=lo(1),hi(1) c ::: ::: ::: interior part of bottom face do j=lo(2)+1,hi(2)-1 innder = <* FA[ DTwoY[U,i,j,k,n]] *> trander(i,j,k+1,n,2) = innder enddo j = lo(2) if( <* FA[ dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>) then innder = <* FA[ DOneY[U,i,j,k,n,+1] ] *> else innder = <* FA[ DTwoY[U,i,j,k,n] ] *> endif trander(i,j,k+1,n,2) = innder j = hi(2) if( <* FA[ dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>) then innder = <* FA[ DOneY[U,i,j,k,n,-1] ] *> else innder = <* FA[ DTwoY[U,i,j,k,n] ] *> endif trander(i,j,k+1,n,2) = innder enddo else if (is_dirichlet(bct(n))) then do m=0,lenz x(m) = m + 0.5 enddo x(-1) = - bcl/h(3) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenz+2, coef) #if USE_TMP do j = lo(2), hi(2) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) tmp(i-lo(1)) = bcval(i,j, hi(3)+1,n)*coef(-1) enddo else do i = lo(1), hi(1) tmp(i-lo(1)) = 0.0 enddo endif do m = 0, lenz do i = lo(1), hi(1) tmp(i-lo(1)) = tmp(i-lo(1)) $ + u(i, j, hi(3)-m,n)*coef(m) enddo enddo do i = lo(1), hi(1) u(i,j, hi(3)+1,n) = cvmgt( $ tmp(i-lo(1)), $ u(i,j, hi(3)+1,n), $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo #else if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j, hi(3)+1,n) = cvmgt( $ bcval(i,j, hi(3)+1,n)*coef(-1), $ u(i,j, hi(3)+1,n), $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo else do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j, hi(3)+1,n) = cvmgt( $ 0.0, $ u(i,j, hi(3)+1,n), $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo endif do j = lo(2), hi(2) do m = 0, lenz do i = lo(1), hi(1) u(i, j, hi(3)+1,n) = cvmgt( $ u(i,j, hi(3)+1,n) $ + u(i, j, hi(3)-m,n)*coef(m), $ u(i,j, hi(3)+1,n), $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo enddo #endif if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j, hi(3),n) = cvmgt(coef(0), 0.0, $ maskt(i,j, hi(3)+1) .gt. 0) enddo enddo endif c ::: ::: now do the tangential deriv part c ::: ::: interior part first, followed by end points edgloc = 0. k = hi(3) c ::: ::: ::: X do j=lo(2),hi(2) do i=lo(1)+1, hi(1)-1 if( <* FA[ dependentCellsCovered[DTwoX[u,i,j,k+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j,k+1,n]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k+1,+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k+1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k+1,-1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k+1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,1) else outder = 0. endif endif innloc = 0.5 innder = <*FA[ DTwoX[u,i,j,k,n] ] *> lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,1) = lambda*innder+(1-lambda)*outder enddo i = lo(1) if( <* FA[ dependentCellsCovered[DTwoX[u,i,j,k+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j,k+1,n]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k+1,+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k+1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k+1,-1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k+1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,1) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i<0)],maskw]]*>) then innder = <*FA[DOneX[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoX[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,1) = lambda*innder+(1-lambda)*outder i = hi(1) if( <* FA[ dependentCellsCovered[DTwoX[u,i,j,k+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DTwoX[U,i,j,k+1,n]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k+1,+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k+1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneX[u,i,j,k+1,-1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneX[U,i,j,k+1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,1) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoX[u,i,j,k]//.allUVW, Function[{i,j,k},(i>0)],maske]]*>) then innder = <*FA[DOneX[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoX[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,1) = lambda*innder+(1-lambda)*outder enddo c ::: ::: ::: Y do i=lo(1), hi(1) do j=lo(2)+1,hi(2)-1 if( <* FA[ dependentCellsCovered[DTwoY[u,i,j,k+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i,j,k+1,n]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k+1,+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k+1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k+1,-1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k+1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,2) else outder = 0. endif endif innloc = 0.5 innder = <*FA[ DTwoY[u,i,j,k,n] ] *> lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,2) = lambda*innder+(1-lambda)*outder enddo j = lo(2) if( <* FA[ dependentCellsCovered[DTwoY[u,i,j,k+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i,j,k+1,n]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k+1,+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k+1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k+1,-1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k+1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,2) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j<0)],masks]]*>) then innder = <*FA[DOneY[U,i,j,k,n,+1]]*> else innder = <*FA[DTwoY[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,2) = lambda*innder+(1-lambda)*outder j = hi(2) if( <* FA[ dependentCellsCovered[DTwoY[u,i,j,k+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DTwoY[U,i,j,k+1,n]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k+1,+1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k+1,n,+1]]*> else if( <* FA[ dependentCellsCovered[DOneY[u,i,j,k+1,-1]//.allUVW, Function[{i,j,k},(k>0)],maskt]]*>)then outloc = -0.5 outder = <*FA[DOneY[U,i,j,k+1,n,-1]]*> else outloc = x(-1) if( flagbc .eq. 1 ) then outder = exttd(i,j,k+1,n,2) else outder = 0. endif endif if(<*FA[dependentCellsNotCovered[DTwoY[u,i,j,k]//.allUVW, Function[{i,j,k},(j>0)],maskn]]*>) then innder = <*FA[DOneY[U,i,j,k,n,-1]]*> else innder = <*FA[DTwoY[U,i,j,k,n]]*> endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) trander(i,j,k+1,n,2) = lambda*innder+(1-lambda)*outder enddo else if ( bct(n) .eq. LO_REFLECT_ODD ) then do j = lo(2), hi(2) do i = lo(1), hi(1) u(i, j, hi(3)+1, n) = cvmgt( $ -u(i,j,hi(3),n), $ u(i,j,hi(3)+1,n), $ maskt(i,j,hi(3)+1) .gt. 0) trander(i,j,hi(3)+1,n,1) = 0. trander(i,j,hi(3)+1,n,2) = 0. enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) do i = lo(1), hi(1) den(i,j,hi(3),n) = cvmgt(-1.0, 0.0, $ maskt(i,j,hi(3)+1) .gt. 0) enddo enddo endif else print *,'UNKNOWN BC ON BACK FACE IN APPLYBC' stop endif enddo endif end ccseapps-2.5/CCSEApps/tensorMG/MCINTERPBNDRYDATA_3D.F0000644000175000017500000030620211634153073022527 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "BC_TYPES.H" #include "REAL.H" #include "CONSTANTS.H" #include "MCINTERPBNDRYDATA_F.H" #include "ArrayLim.H" #define SDIM 3 #define NUMDERIV 9 #define DX 1 #define DY 2 #define DZ 3 #define D2X 4 #define D2Y 5 #define D2Z 6 #define DXY 7 #define DXZ 8 #define DYZ 9 c ::: CX,CY,CZ are the "component" number for storing derivative information c ::: see the assignments to bdry at the bottom of each of the subroutines. c ::: This should be more suggestive of how info is being stored than c ::: writing plain numbers. #define CX 1 #define CY 2 #define CZ 3 c --------------------------------------------------------------- c :: FORT_BDINTERPXLO : Interpolation on Xlo Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables in solution, half number in bdry c :: ratio => refinement ratio c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPXLO (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratio,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives,hfine) integer nvar, ratio, not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),(1+3)*nvar) REAL_T derives(DIM23(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T hfine(BL_SPACEDIM-1) REAL_T yy, zz integer i, j, k, ic, jc, kc, joff, koff, n integer jclo, jchi, kclo, kchi REAL_T hc(3),hf(3) c ::: ------------ functions ------------------------------ logical notUsable,Usable REAL_T ddxcen,ddx2cen,ddxplus,ddxminus REAL_T ddycen,ddy2cen,ddyplus,ddyminus REAL_T ddzcen,ddz2cen,ddzplus,ddzminus REAL_T ddxdycen,ddxdypp,ddxdypm,ddxdymp,ddxdymm REAL_T ddxdzcen,ddxdzpp,ddxdzpm,ddxdzmp,ddxdzmm REAL_T ddydzcen,ddydzpp,ddydzpm,ddydzmp,ddydzmm logical okxypp,okxypm,okxymp,okxymm,okxycen logical okxzpp,okxzpm,okxzmp,okxzmm,okxzcen logical okyzpp,okyzpm,okyzmp,okyzmm,okyzcen REAL_T ddxlowp,ddxlowm REAL_T ddylowp,ddylowm REAL_T ddzlowp,ddzlowm notUsable(i,j,k) = (mask(i,j,k).ne.not_covered) Usable(i,j,k) = (mask(i,j,k).eq.not_covered) ddxcen(i,j,k,n) = (crse(i+1,j,k,n)-crse(i-1,j,k,n))/(2*hc(1)) ddycen(i,j,k,n) = (crse(i,j+1,k,n)-crse(i,j-1,k,n))/(2*hc(2)) ddzcen(i,j,k,n) = (crse(i,j,k+1,n)-crse(i,j,k-1,n))/(2*hc(3)) ddx2cen(i,j,k,n)=(crse(i+1,j,k,n)-2*crse(i,j,k,n)+crse(i-1,j,k,n)) & /(hc(1)**2) ddy2cen(i,j,k,n)=(crse(i,j+1,k,n)-2*crse(i,j,k,n)+crse(i,j-1,k,n)) & /(hc(2)**2) ddz2cen(i,j,k,n)=(crse(i,j,k+1,n)-2*crse(i,j,k,n)+crse(i,j,k-1,n)) & /(hc(3)**2) ddxplus(i,j,k,n)=(-crse(i+2,j,k,n)+4*crse(i+1,j,k,n)-3*crse(i,j,k,n)) & /(2*hc(1)) ddyplus(i,j,k,n)=(-crse(i,j+2,k,n)+4*crse(i,j+1,k,n)-3*crse(i,j,k,n)) & /(2*hc(2)) ddzplus(i,j,k,n)=(-crse(i,j,k+2,n)+4*crse(i,j,k+1,n)-3*crse(i,j,k,n)) & /(2*hc(3)) ddxminus(i,j,k,n)=(+crse(i-2,j,k,n)-4*crse(i-1,j,k,n)+3*crse(i,j,k,n)) & /(2*hc(1)) ddyminus(i,j,k,n)=(+crse(i,j-2,k,n)-4*crse(i,j-1,k,n)+3*crse(i,j,k,n)) & /(2*hc(2)) ddzminus(i,j,k,n)=(+crse(i,j,k-2,n)-4*crse(i,j,k-1,n)+3*crse(i,j,k,n)) & /(2*hc(3)) ddxdycen(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i+1,j-1,k,n)+crse(i-1,j-1,k,n))/(4*hc(1)*hc(2)) okxycen(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i+1,j-1,k).and.Usable(i-1,j-1,k)) ddxdypp(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i,j+1,k,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(2)) okxypp(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i,j+1,k) & .and.Usable(i+1,j,k)) ddxdypm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j-1,k,n)+crse(i,j-1,k,n))/(4*hc(1)*hc(2)) okxypm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j-1,k).and.Usable(i,j-1,k)) ddxdymp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(2)) okxymp(i,j,k)=(Usable(i,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i-1,j,k)) ddxdymm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j-1,k,n)+crse(i-1,j-1,k,n))/(hc(1)*hc(2)) okxymm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j-1,k).and.Usable(i-1,j-1,k)) ddxdzcen(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i+1,j,k-1,n)+crse(i-1,j,k-1,n))/(4*hc(1)*hc(3)) okxzcen(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i+1,j,k-1).and.Usable(i-1,j,k-1)) ddxdzpp(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i,j,k+1,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(3)) okxzpp(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i,j,k+1) & .and.Usable(i+1,j,k)) ddxdzpm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j,k-1,n)+crse(i,j,k-1,n))/(4*hc(1)*hc(3)) okxzpm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j,k-1).and.Usable(i,j,k-1)) ddxdzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(3)) okxzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i-1,j,k)) ddxdzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j,k-1,n)+crse(i-1,j,k-1,n))/(hc(1)*hc(3)) okxzmm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j,k-1).and.Usable(i-1,j,k-1)) ddydzcen(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j+1,k-1,n)+crse(i,j-1,k-1,n))/(4*hc(2)*hc(3)) okyzcen(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j+1,k-1).and.Usable(i,j-1,k-1)) ddydzpp(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j,k+1,n) & -crse(i,j+1,k,n)+crse(i,j,k,n))/(hc(2)*hc(3)) okyzpp(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j,k+1) & .and.Usable(i,j+1,k)) ddydzpm(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n) & -crse(i,j+1,k-1,n)+crse(i,j,k-1,n))/(4*hc(2)*hc(3)) okyzpm(i,j,k)=(Usable(i,j+1,k) & .and.Usable(i,j+1,k-1).and.Usable(i,j,k-1)) ddydzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j,k,n)+crse(i,j-1,k,n))/(hc(2)*hc(3)) okyzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j-1,k)) ddydzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i,j-1,k,n) & -crse(i,j,k-1,n)+crse(i,j-1,k-1,n))/(hc(2)*hc(3)) okyzmm(i,j,k)=(Usable(i,j-1,k) & .and.Usable(i,j,k-1).and.Usable(i,j-1,k-1)) ddxlowp(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n))/hc(1) ddylowp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n))/hc(2) ddzlowp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j,k,n))/hc(3) ddxlowm(i,j,k,n)=(-crse(i-1,j,k,n)+crse(i,j,k,n))/hc(1) ddylowm(i,j,k,n)=(-crse(i,j-1,k,n)+crse(i,j,k,n))/hc(2) ddzlowm(i,j,k,n)=(-crse(i,j,k-1,n)+crse(i,j,k,n))/hc(3) c ::: ------------ functions ------------------------------ kclo = ARG_L3(cb) kchi = ARG_H3(cb) jclo = ARG_L2(cb) jchi = ARG_H2(cb) ic = ARG_L1(cb)-1 i = lo(1)-1 c ::: ::: hf(1) = 0 hf(2) = hfine(1) hf(3) = hfine(2) hc(1) = 0 hc(2) = hfine(1)*ratio hc(3) = hfine(2)*ratio c ::: ::: do n = 1, nvar c ::::: calculate derivatives for interpolation do kc = kclo, kchi k = ratio*kc do jc = jclo, jchi j = ratio*jc derives(jc,kc,DY) = ddycen(ic,jc,kc,n) derives(jc,kc,D2Y) = ddy2cen(ic,jc,kc,n) if( notUsable(i,j-1,k) .and. notUsable(i,j+ratio,k) ) then derives(jc,kc,DY) = zero derives(jc,kc,D2Y) = zero else if( notUsable(i,j-1,k) .and. Usable(i,j+ratio,k) ) then c :::: :::: : positive side usable if( jc+2.le.jchi+1 ) then if( Usable(i,j+2*ratio,k) ) then derives(jc,kc,DY)=ddyplus(ic,jc,kc,n) derives(jc,kc,D2Y)=ddy2cen(ic,jc+1,kc,n) else derives(jc,kc,DY)=ddylowp(ic,jc,kc,n) derives(jc,kc,D2Y)=zero endif else derives(jc,kc,DY)=ddylowp(ic,jc,kc,n) derives(jc,kc,D2Y)=zero endif else if( Usable(i,j-1,k) .and. notUsable(i,j+ratio,k) ) then c :::: :::: : negative side usable if( jc-2.ge.jclo-1 ) then if( Usable(i,j-1,k) ) then derives(jc,kc,DY)=ddyminus(ic,jc,kc,n) derives(jc,kc,D2Y)=ddy2cen(ic,jc-1,kc,n) else derives(jc,kc,DY)=ddylowm(ic,jc,kc,n) derives(jc,kc,D2Y)=zero endif else derives(jc,kc,DY)=ddylowm(ic,jc,kc,n) derives(jc,kc,D2Y)=zero endif endif derives(jc,kc,DZ) = ddzcen(ic,jc,kc,n) derives(jc,kc,D2Z) = ddz2cen(ic,jc,kc,n) if( notUsable(i,j,k-1) .and. notUsable(i,j,k+ratio)) then derives(jc,kc,DZ) = zero derives(jc,kc,D2Z) = zero else if( notUsable(i,j,k-1) .and. Usable(i,j,k+ratio)) then c :::: :::: : positive size usable if( kc+2.le.kchi+1 ) then if( Usable(i,j,k+2*ratio) ) then derives(jc,kc,DZ) = ddzplus(ic,jc,kc,n) derives(jc,kc,D2Z) = ddz2cen(ic,jc,kc+1,n) else derives(jc,kc,DZ) = ddzlowp(ic,jc,kc,n) derives(jc,kc,D2Z) = zero endif else derives(jc,kc,DZ) = ddzlowp(ic,jc,kc,n) derives(jc,kc,D2Z) = zero endif else if( Usable(i,j,k-1) .and. notUsable(i,j,k+ratio)) then c :::: :::: : negative size usable if( kc-2.ge.kclo-1 ) then if( Usable(i,j,k-1) ) then derives(jc,kc,DZ) = ddzminus(ic,jc,kc,n) derives(jc,kc,D2Z) = ddz2cen(ic,jc,kc-1,n) else derives(jc,kc,DZ) = ddzlowm(ic,jc,kc,n) derives(jc,kc,D2Z) = zero endif else derives(jc,kc,DZ) = ddzlowm(ic,jc,kc,n) derives(jc,kc,D2Z) = zero endif endif if( okyzcen(i,j,k) ) then derives(jc,kc,DYZ) = ddydzcen(ic,jc,kc,n) else if( okyzpp(i,j,k) ) then derives(jc,kc,DYZ) = ddydzpp(ic,jc,kc,n) else if( okyzpm(i,j,k) ) then derives(jc,kc,DYZ) = ddydzpm(ic,jc,kc,n) else if( okyzmp(i,j,k) ) then derives(jc,kc,DYZ) = ddydzmp(ic,jc,kc,n) else if( okyzmm(i,j,k) ) then derives(jc,kc,DYZ) = ddydzmm(ic,jc,kc,n) else derives(jc,kc,DYZ) = zero endif enddo enddo c ::::: interpolate to fine grid do koff = 0, ratio - 1 zz = (koff+half)*hf(3)-hc(3)/2 do kc = kclo,kchi k = ratio*kc + koff do joff = 0, ratio - 1 yy = (joff+half)*hf(2)-hc(2)/2 do jc = jclo, jchi j = ratio*jc + joff bdry(i,j,k,n) = crse(ic,jc,kc,n) + & yy*derives(jc,kc,DY) + & half*yy**2*derives(jc,kc,D2Y) + & zz*derives(jc,kc,DZ) + & half*zz**2*derives(jc,kc,D2Z) + & yy*zz*derives(jc,kc,DYZ) bdry(i,j,k,n+CY*nvar) = & derives(jc,kc,DY)+ & yy*derives(jc,kc,D2Y)+ & zz*derives(jc,kc,DYZ) bdry(i,j,k,n+CZ*nvar) = & derives(jc,kc,DZ)+ & zz*derives(jc,kc,D2Z)+ & yy*derives(jc,kc,DYZ) enddo enddo enddo enddo enddo return end c --------------------------------------------------------------- c :: FORT_BDINTERPXHI : Interpolation on Xhi Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables in solution, half number in bdry c :: ratio => refinement ratio c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPXHI (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratio,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives,hfine) integer nvar, ratio, not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),(1+3)*nvar) REAL_T derives(DIM23(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T hfine(BL_SPACEDIM-1) REAL_T yy, zz integer i, j, k, ic, jc, kc, joff, koff, n integer jclo, jchi, kclo, kchi REAL_T hc(3),hf(3) c ::: ------------ functions ------------------------------ logical notUsable,Usable REAL_T ddxcen,ddx2cen,ddxplus,ddxminus REAL_T ddycen,ddy2cen,ddyplus,ddyminus REAL_T ddzcen,ddz2cen,ddzplus,ddzminus REAL_T ddxdycen,ddxdypp,ddxdypm,ddxdymp,ddxdymm REAL_T ddxdzcen,ddxdzpp,ddxdzpm,ddxdzmp,ddxdzmm REAL_T ddydzcen,ddydzpp,ddydzpm,ddydzmp,ddydzmm logical okxypp,okxypm,okxymp,okxymm,okxycen logical okxzpp,okxzpm,okxzmp,okxzmm,okxzcen logical okyzpp,okyzpm,okyzmp,okyzmm,okyzcen REAL_T ddxlowp,ddxlowm REAL_T ddylowp,ddylowm REAL_T ddzlowp,ddzlowm notUsable(i,j,k) = (mask(i,j,k).ne.not_covered) Usable(i,j,k) = (mask(i,j,k).eq.not_covered) ddxcen(i,j,k,n) = (crse(i+1,j,k,n)-crse(i-1,j,k,n))/(2*hc(1)) ddycen(i,j,k,n) = (crse(i,j+1,k,n)-crse(i,j-1,k,n))/(2*hc(2)) ddzcen(i,j,k,n) = (crse(i,j,k+1,n)-crse(i,j,k-1,n))/(2*hc(3)) ddx2cen(i,j,k,n)=(crse(i+1,j,k,n)-2*crse(i,j,k,n)+crse(i-1,j,k,n)) & /(hc(1)**2) ddy2cen(i,j,k,n)=(crse(i,j+1,k,n)-2*crse(i,j,k,n)+crse(i,j-1,k,n)) & /(hc(2)**2) ddz2cen(i,j,k,n)=(crse(i,j,k+1,n)-2*crse(i,j,k,n)+crse(i,j,k-1,n)) & /(hc(3)**2) ddxplus(i,j,k,n)=(-crse(i+2,j,k,n)+4*crse(i+1,j,k,n)-3*crse(i,j,k,n)) & /(2*hc(1)) ddyplus(i,j,k,n)=(-crse(i,j+2,k,n)+4*crse(i,j+1,k,n)-3*crse(i,j,k,n)) & /(2*hc(2)) ddzplus(i,j,k,n)=(-crse(i,j,k+2,n)+4*crse(i,j,k+1,n)-3*crse(i,j,k,n)) & /(2*hc(3)) ddxminus(i,j,k,n)=(+crse(i-2,j,k,n)-4*crse(i-1,j,k,n)+3*crse(i,j,k,n)) & /(2*hc(1)) ddyminus(i,j,k,n)=(+crse(i,j-2,k,n)-4*crse(i,j-1,k,n)+3*crse(i,j,k,n)) & /(2*hc(2)) ddzminus(i,j,k,n)=(+crse(i,j,k-2,n)-4*crse(i,j,k-1,n)+3*crse(i,j,k,n)) & /(2*hc(3)) ddxdycen(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i+1,j-1,k,n)+crse(i-1,j-1,k,n))/(4*hc(1)*hc(2)) okxycen(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i+1,j-1,k).and.Usable(i-1,j-1,k)) ddxdypp(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i,j+1,k,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(2)) okxypp(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i,j+1,k) & .and.Usable(i+1,j,k)) ddxdypm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j-1,k,n)+crse(i,j-1,k,n))/(4*hc(1)*hc(2)) okxypm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j-1,k).and.Usable(i,j-1,k)) ddxdymp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(2)) okxymp(i,j,k)=(Usable(i,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i-1,j,k)) ddxdymm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j-1,k,n)+crse(i-1,j-1,k,n))/(hc(1)*hc(2)) okxymm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j-1,k).and.Usable(i-1,j-1,k)) ddxdzcen(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i+1,j,k-1,n)+crse(i-1,j,k-1,n))/(4*hc(1)*hc(3)) okxzcen(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i+1,j,k-1).and.Usable(i-1,j,k-1)) ddxdzpp(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i,j,k+1,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(3)) okxzpp(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i,j,k+1) & .and.Usable(i+1,j,k)) ddxdzpm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j,k-1,n)+crse(i,j,k-1,n))/(4*hc(1)*hc(3)) okxzpm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j,k-1).and.Usable(i,j,k-1)) ddxdzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(3)) okxzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i-1,j,k)) ddxdzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j,k-1,n)+crse(i-1,j,k-1,n))/(hc(1)*hc(3)) okxzmm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j,k-1).and.Usable(i-1,j,k-1)) ddydzcen(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j+1,k-1,n)+crse(i,j-1,k-1,n))/(4*hc(2)*hc(3)) okyzcen(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j+1,k-1).and.Usable(i,j-1,k-1)) ddydzpp(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j,k+1,n) & -crse(i,j+1,k,n)+crse(i,j,k,n))/(hc(2)*hc(3)) okyzpp(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j,k+1) & .and.Usable(i,j+1,k)) ddydzpm(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n) & -crse(i,j+1,k-1,n)+crse(i,j,k-1,n))/(4*hc(2)*hc(3)) okyzpm(i,j,k)=(Usable(i,j+1,k) & .and.Usable(i,j+1,k-1).and.Usable(i,j,k-1)) ddydzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j,k,n)+crse(i,j-1,k,n))/(hc(2)*hc(3)) okyzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j-1,k)) ddydzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i,j-1,k,n) & -crse(i,j,k-1,n)+crse(i,j-1,k-1,n))/(hc(2)*hc(3)) okyzmm(i,j,k)=(Usable(i,j-1,k) & .and.Usable(i,j,k-1).and.Usable(i,j-1,k-1)) ddxlowp(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n))/hc(1) ddylowp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n))/hc(2) ddzlowp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j,k,n))/hc(3) ddxlowm(i,j,k,n)=(-crse(i-1,j,k,n)+crse(i,j,k,n))/hc(1) ddylowm(i,j,k,n)=(-crse(i,j-1,k,n)+crse(i,j,k,n))/hc(2) ddzlowm(i,j,k,n)=(-crse(i,j,k-1,n)+crse(i,j,k,n))/hc(3) c ::: ------------ functions ------------------------------ kclo = ARG_L3(cb) kchi = ARG_H3(cb) jclo = ARG_L2(cb) jchi = ARG_H2(cb) ic = ARG_H1(cb)+1 i = hi(1)+1 c ::: ::: hf(1) = 0 hf(2) = hfine(1) hf(3) = hfine(2) hc(1) = 0 hc(2) = hfine(1)*ratio hc(3) = hfine(2)*ratio c ::: ::: do n = 1, nvar c ::::: calculate derivatives for interpolation do kc = kclo, kchi k = ratio*kc do jc = jclo, jchi j = ratio*jc derives(jc,kc,DY) = ddycen(ic,jc,kc,n) derives(jc,kc,D2Y) = ddy2cen(ic,jc,kc,n) if( notUsable(i,j-1,k) .and. notUsable(i,j+ratio,k) ) then derives(jc,kc,DY) = zero derives(jc,kc,D2Y) = zero else if( notUsable(i,j-1,k) .and. Usable(i,j+ratio,k) ) then c :::: :::: : positive side usable if( jc+2.le.jchi+1 ) then if( Usable(i,j+2*ratio,k) ) then derives(jc,kc,DY)=ddyplus(ic,jc,kc,n) derives(jc,kc,D2Y)=ddy2cen(ic,jc+1,kc,n) else derives(jc,kc,DY)=ddylowp(ic,jc,kc,n) derives(jc,kc,D2Y)=zero endif else derives(jc,kc,DY)=ddylowp(ic,jc,kc,n) derives(jc,kc,D2Y)=zero endif else if( Usable(i,j-1,k) .and. notUsable(i,j+ratio,k) ) then c :::: :::: : negative side usable if( jc-2.ge.jclo-1 ) then if( Usable(i,j-1,k) ) then derives(jc,kc,DY)=ddyminus(ic,jc,kc,n) derives(jc,kc,D2Y)=ddy2cen(ic,jc-1,kc,n) else derives(jc,kc,DY)=ddylowm(ic,jc,kc,n) derives(jc,kc,D2Y)=zero endif else derives(jc,kc,DY)=ddylowm(ic,jc,kc,n) derives(jc,kc,D2Y)=zero endif endif derives(jc,kc,DZ) = ddzcen(ic,jc,kc,n) derives(jc,kc,D2Z) = ddz2cen(ic,jc,kc,n) if( notUsable(i,j,k-1) .and. notUsable(i,j,k+ratio)) then derives(jc,kc,DZ) = zero derives(jc,kc,D2Z) = zero else if( notUsable(i,j,k-1) .and. Usable(i,j,k+ratio)) then c :::: :::: : positive size usable if( kc+2.le.kchi+1 ) then if( Usable(i,j,k+2*ratio) ) then derives(jc,kc,DZ) = ddzplus(ic,jc,kc,n) derives(jc,kc,D2Z) = ddz2cen(ic,jc,kc+1,n) else derives(jc,kc,DZ) = ddzlowp(ic,jc,kc,n) derives(jc,kc,D2Z) = zero endif else derives(jc,kc,DZ) = ddzlowp(ic,jc,kc,n) derives(jc,kc,D2Z) = zero endif else if( Usable(i,j,k-1) .and. notUsable(i,j,k+ratio)) then c :::: :::: : negative size usable if( kc-2.ge.kclo-1 ) then if( Usable(i,j,k-1) ) then derives(jc,kc,DZ) = ddzminus(ic,jc,kc,n) derives(jc,kc,D2Z) = ddz2cen(ic,jc,kc-1,n) else derives(jc,kc,DZ) = ddzlowm(ic,jc,kc,n) derives(jc,kc,D2Z) = zero endif else derives(jc,kc,DZ) = ddzlowm(ic,jc,kc,n) derives(jc,kc,D2Z) = zero endif endif if( okyzcen(i,j,k) ) then derives(jc,kc,DYZ) = ddydzcen(ic,jc,kc,n) else if( okyzpp(i,j,k) ) then derives(jc,kc,DYZ) = ddydzpp(ic,jc,kc,n) else if( okyzpm(i,j,k) ) then derives(jc,kc,DYZ) = ddydzpm(ic,jc,kc,n) else if( okyzmp(i,j,k) ) then derives(jc,kc,DYZ) = ddydzmp(ic,jc,kc,n) else if( okyzmm(i,j,k) ) then derives(jc,kc,DYZ) = ddydzmm(ic,jc,kc,n) else derives(jc,kc,DYZ) = zero endif enddo enddo c ::::: interpolate to fine grid do koff = 0, ratio - 1 zz = (koff+half)*hf(3)-hc(3)/2 do kc = kclo,kchi k = ratio*kc + koff do joff = 0, ratio - 1 yy = (joff+half)*hf(2)-hc(2)/2 do jc = jclo, jchi j = ratio*jc + joff bdry(i,j,k,n) = crse(ic,jc,kc,n) + & yy*derives(jc,kc,DY) + & half*yy**2*derives(jc,kc,D2Y) + & zz*derives(jc,kc,DZ) + & half*zz**2*derives(jc,kc,D2Z) + & yy*zz*derives(jc,kc,DYZ) bdry(i,j,k,n+CY*nvar) = & derives(jc,kc,DY)+ & yy*derives(jc,kc,D2Y)+ & zz*derives(jc,kc,DYZ) bdry(i,j,k,n+CZ*nvar) = & derives(jc,kc,DZ)+ & zz*derives(jc,kc,D2Z)+ & yy*derives(jc,kc,DYZ) enddo enddo enddo enddo enddo return end c --------------------------------------------------------------- c :: FORT_BDINTERPYLO : Interpolation on Ylo Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables in solution, half number in bdry c :: ratio => refinement ratio c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPYLO (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratio,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives,hfine) integer nvar, ratio, not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),(1+3)*nvar) REAL_T derives(DIM13(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T hfine(BL_SPACEDIM-1) REAL_T xx, zz integer i, j, k, ic, jc, kc, ioff, koff, n integer iclo, ichi, kclo, kchi REAL_T hc(3),hf(3) c ::: ------------ functions ------------------------------ logical notUsable,Usable REAL_T ddxcen,ddx2cen,ddxplus,ddxminus REAL_T ddycen,ddy2cen,ddyplus,ddyminus REAL_T ddzcen,ddz2cen,ddzplus,ddzminus REAL_T ddxdycen,ddxdypp,ddxdypm,ddxdymp,ddxdymm REAL_T ddxdzcen,ddxdzpp,ddxdzpm,ddxdzmp,ddxdzmm REAL_T ddydzcen,ddydzpp,ddydzpm,ddydzmp,ddydzmm logical okxypp,okxypm,okxymp,okxymm,okxycen logical okxzpp,okxzpm,okxzmp,okxzmm,okxzcen logical okyzpp,okyzpm,okyzmp,okyzmm,okyzcen REAL_T ddxlowp,ddxlowm REAL_T ddylowp,ddylowm REAL_T ddzlowp,ddzlowm notUsable(i,j,k) = (mask(i,j,k).ne.not_covered) Usable(i,j,k) = (mask(i,j,k).eq.not_covered) ddxcen(i,j,k,n) = (crse(i+1,j,k,n)-crse(i-1,j,k,n))/(2*hc(1)) ddycen(i,j,k,n) = (crse(i,j+1,k,n)-crse(i,j-1,k,n))/(2*hc(2)) ddzcen(i,j,k,n) = (crse(i,j,k+1,n)-crse(i,j,k-1,n))/(2*hc(3)) ddx2cen(i,j,k,n)=(crse(i+1,j,k,n)-2*crse(i,j,k,n)+crse(i-1,j,k,n)) & /(hc(1)**2) ddy2cen(i,j,k,n)=(crse(i,j+1,k,n)-2*crse(i,j,k,n)+crse(i,j-1,k,n)) & /(hc(2)**2) ddz2cen(i,j,k,n)=(crse(i,j,k+1,n)-2*crse(i,j,k,n)+crse(i,j,k-1,n)) & /(hc(3)**2) ddxplus(i,j,k,n)=(-crse(i+2,j,k,n)+4*crse(i+1,j,k,n)-3*crse(i,j,k,n)) & /(2*hc(1)) ddyplus(i,j,k,n)=(-crse(i,j+2,k,n)+4*crse(i,j+1,k,n)-3*crse(i,j,k,n)) & /(2*hc(2)) ddzplus(i,j,k,n)=(-crse(i,j,k+2,n)+4*crse(i,j,k+1,n)-3*crse(i,j,k,n)) & /(2*hc(3)) ddxminus(i,j,k,n)=(+crse(i-2,j,k,n)-4*crse(i-1,j,k,n)+3*crse(i,j,k,n)) & /(2*hc(1)) ddyminus(i,j,k,n)=(+crse(i,j-2,k,n)-4*crse(i,j-1,k,n)+3*crse(i,j,k,n)) & /(2*hc(2)) ddzminus(i,j,k,n)=(+crse(i,j,k-2,n)-4*crse(i,j,k-1,n)+3*crse(i,j,k,n)) & /(2*hc(3)) ddxdycen(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i+1,j-1,k,n)+crse(i-1,j-1,k,n))/(4*hc(1)*hc(2)) okxycen(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i+1,j-1,k).and.Usable(i-1,j-1,k)) ddxdypp(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i,j+1,k,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(2)) okxypp(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i,j+1,k) & .and.Usable(i+1,j,k)) ddxdypm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j-1,k,n)+crse(i,j-1,k,n))/(4*hc(1)*hc(2)) okxypm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j-1,k).and.Usable(i,j-1,k)) ddxdymp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(2)) okxymp(i,j,k)=(Usable(i,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i-1,j,k)) ddxdymm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j-1,k,n)+crse(i-1,j-1,k,n))/(hc(1)*hc(2)) okxymm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j-1,k).and.Usable(i-1,j-1,k)) ddxdzcen(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i+1,j,k-1,n)+crse(i-1,j,k-1,n))/(4*hc(1)*hc(3)) okxzcen(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i+1,j,k-1).and.Usable(i-1,j,k-1)) ddxdzpp(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i,j,k+1,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(3)) okxzpp(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i,j,k+1) & .and.Usable(i+1,j,k)) ddxdzpm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j,k-1,n)+crse(i,j,k-1,n))/(4*hc(1)*hc(3)) okxzpm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j,k-1).and.Usable(i,j,k-1)) ddxdzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(3)) okxzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i-1,j,k)) ddxdzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j,k-1,n)+crse(i-1,j,k-1,n))/(hc(1)*hc(3)) okxzmm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j,k-1).and.Usable(i-1,j,k-1)) ddydzcen(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j+1,k-1,n)+crse(i,j-1,k-1,n))/(4*hc(2)*hc(3)) okyzcen(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j+1,k-1).and.Usable(i,j-1,k-1)) ddydzpp(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j,k+1,n) & -crse(i,j+1,k,n)+crse(i,j,k,n))/(hc(2)*hc(3)) okyzpp(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j,k+1) & .and.Usable(i,j+1,k)) ddydzpm(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n) & -crse(i,j+1,k-1,n)+crse(i,j,k-1,n))/(4*hc(2)*hc(3)) okyzpm(i,j,k)=(Usable(i,j+1,k) & .and.Usable(i,j+1,k-1).and.Usable(i,j,k-1)) ddydzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j,k,n)+crse(i,j-1,k,n))/(hc(2)*hc(3)) okyzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j-1,k)) ddydzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i,j-1,k,n) & -crse(i,j,k-1,n)+crse(i,j-1,k-1,n))/(hc(2)*hc(3)) okyzmm(i,j,k)=(Usable(i,j-1,k) & .and.Usable(i,j,k-1).and.Usable(i,j-1,k-1)) ddxlowp(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n))/hc(1) ddylowp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n))/hc(2) ddzlowp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j,k,n))/hc(3) ddxlowm(i,j,k,n)=(-crse(i-1,j,k,n)+crse(i,j,k,n))/hc(1) ddylowm(i,j,k,n)=(-crse(i,j-1,k,n)+crse(i,j,k,n))/hc(2) ddzlowm(i,j,k,n)=(-crse(i,j,k-1,n)+crse(i,j,k,n))/hc(3) c ::: ------------ functions ------------------------------ kclo = ARG_L3(cb) kchi = ARG_H3(cb) iclo = ARG_L1(cb) ichi = ARG_H1(cb) jc = ARG_L2(cb)-1 j = lo(2)-1 c ::: ::: hf(1) = hfine(1) hf(2) = 0 hf(3) = hfine(2) hc(1) = hfine(1)*ratio hc(2) = 0 hc(3) = hfine(2)*ratio c ::: ::: do n = 1, nvar c ::::: calculate derivatives for interpolation do kc = kclo, kchi k = ratio*kc do ic = iclo, ichi i = ratio*ic derives(ic,kc,DX) = ddxcen(ic,jc,kc,n) derives(ic,kc,D2X) = ddx2cen(ic,jc,kc,n) if( notUsable(i-1,j,k) .and. notUsable(i+ratio,j,k) ) then derives(ic,kc,DX) = zero derives(ic,kc,D2X) = zero else if( notUsable(i-1,j,k) .and. Usable(i+ratio,j,k) ) then c :::: :::: : positive side usable if( ic+2.le.ichi+1 ) then if( Usable(i+2*ratio,j,k) ) then derives(ic,kc,DX)=ddxplus(ic,jc,kc,n) derives(ic,kc,D2X)=ddx2cen(ic+1,jc,kc,n) else derives(ic,kc,DX)=ddxlowp(ic,jc,kc,n) derives(ic,kc,D2X)=zero endif else derives(ic,kc,DX)=ddxlowp(ic,jc,kc,n) derives(ic,kc,D2X)=zero endif else if( Usable(i-1,j,k) .and. notUsable(i+ratio,j,k) ) then c :::: :::: : negative side usable if( ic-2.ge.iclo-1 ) then if( Usable(i-1,j,k) ) then derives(ic,kc,DX)=ddxminus(ic,jc,kc,n) derives(ic,kc,D2X)=ddx2cen(ic-1,jc,kc,n) else derives(ic,kc,DX)=ddxlowm(ic,jc,kc,n) derives(ic,kc,D2X)=zero endif else derives(ic,kc,DX)=ddxlowm(ic,jc,kc,n) derives(ic,kc,D2X)=zero endif endif derives(ic,kc,DZ) = ddzcen(ic,jc,kc,n) derives(ic,kc,D2Z) = ddz2cen(ic,jc,kc,n) if( notUsable(i,j,k-1) .and. notUsable(i,j,k+ratio)) then derives(ic,kc,DZ) = zero derives(ic,kc,D2Z) = zero else if( notUsable(i,j,k-1) .and. Usable(i,j,k+ratio)) then c :::: :::: : positive size usable if( kc+2.le.kchi+1 ) then if( Usable(i,j,k+2*ratio) ) then derives(ic,kc,DZ) = ddzplus(ic,jc,kc,n) derives(ic,kc,D2Z) = ddz2cen(ic,jc,kc+1,n) else derives(ic,kc,DZ) = ddzlowp(ic,jc,kc,n) derives(ic,kc,D2Z) = zero endif else derives(ic,kc,DZ) = ddzlowp(ic,jc,kc,n) derives(ic,kc,D2Z) = zero endif else if( Usable(i,j,k-1) .and. notUsable(i,j,k+ratio)) then c :::: :::: : negative size usable if( kc-2.ge.kclo-1 ) then if( Usable(i,j,k-1) ) then derives(ic,kc,DZ) = ddzminus(ic,jc,kc,n) derives(ic,kc,D2Z) = ddz2cen(ic,jc,kc-1,n) else derives(ic,kc,DZ) = ddzlowm(ic,jc,kc,n) derives(ic,kc,D2Z) = zero endif else derives(ic,kc,DZ) = ddzlowm(ic,jc,kc,n) derives(ic,kc,D2Z) = zero endif endif if( okxzcen(i,j,k) ) then derives(ic,kc,DXZ) = ddxdzcen(ic,jc,kc,n) else if( okxzpp(i,j,k) ) then derives(ic,kc,DXZ) = ddxdzpp(ic,jc,kc,n) else if( okxzpm(i,j,k) ) then derives(ic,kc,DXZ) = ddxdzpm(ic,jc,kc,n) else if( okxzmp(i,j,k) ) then derives(ic,kc,DXZ) = ddxdzmp(ic,jc,kc,n) else if( okxzmm(i,j,k) ) then derives(ic,kc,DXZ) = ddxdzmm(ic,jc,kc,n) else derives(ic,kc,DXZ) = zero endif enddo enddo c ::::: interpolate to fine grid do koff = 0, ratio - 1 zz = (koff+half)*hf(3)-hc(3)/2 do kc = kclo,kchi k = ratio*kc + koff do ioff = 0, ratio - 1 xx = (ioff+half)*hf(1)-hc(1)/2 do ic = iclo, ichi i = ratio*ic + ioff bdry(i,j,k,n) = crse(ic,jc,kc,n) + & xx*derives(ic,kc,DX) + & half*xx**2*derives(ic,kc,D2X) + & zz*derives(ic,kc,DZ) + & half*zz**2*derives(ic,kc,D2Z) + & xx*zz*derives(ic,kc,DXZ) bdry(i,j,k,n+CX*nvar) = & derives(ic,kc,DX)+ & xx*derives(ic,kc,D2X)+ & zz*derives(ic,kc,DXZ) bdry(i,j,k,n+CZ*nvar) = & derives(ic,kc,DZ)+ & zz*derives(ic,kc,D2Z)+ & xx*derives(ic,kc,DXZ) enddo enddo enddo enddo enddo return end c --------------------------------------------------------------- c :: FORT_BDINTERPYHI : Interpolation on Yhi Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables in solution, half number in bdry c :: ratio => refinement ratio c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPYHI (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratio,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives,hfine) integer nvar, ratio, not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),(1+3)*nvar) REAL_T derives(DIM13(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T hfine(BL_SPACEDIM-1) REAL_T xx, zz integer i, j, k, ic, jc, kc, ioff, koff, n integer iclo, ichi, kclo, kchi REAL_T hc(3),hf(3) c ::: ------------ functions ------------------------------ logical notUsable,Usable REAL_T ddxcen,ddx2cen,ddxplus,ddxminus REAL_T ddycen,ddy2cen,ddyplus,ddyminus REAL_T ddzcen,ddz2cen,ddzplus,ddzminus REAL_T ddxdycen,ddxdypp,ddxdypm,ddxdymp,ddxdymm REAL_T ddxdzcen,ddxdzpp,ddxdzpm,ddxdzmp,ddxdzmm REAL_T ddydzcen,ddydzpp,ddydzpm,ddydzmp,ddydzmm logical okxypp,okxypm,okxymp,okxymm,okxycen logical okxzpp,okxzpm,okxzmp,okxzmm,okxzcen logical okyzpp,okyzpm,okyzmp,okyzmm,okyzcen REAL_T ddxlowp,ddxlowm REAL_T ddylowp,ddylowm REAL_T ddzlowp,ddzlowm notUsable(i,j,k) = (mask(i,j,k).ne.not_covered) Usable(i,j,k) = (mask(i,j,k).eq.not_covered) ddxcen(i,j,k,n) = (crse(i+1,j,k,n)-crse(i-1,j,k,n))/(2*hc(1)) ddycen(i,j,k,n) = (crse(i,j+1,k,n)-crse(i,j-1,k,n))/(2*hc(2)) ddzcen(i,j,k,n) = (crse(i,j,k+1,n)-crse(i,j,k-1,n))/(2*hc(3)) ddx2cen(i,j,k,n)=(crse(i+1,j,k,n)-2*crse(i,j,k,n)+crse(i-1,j,k,n)) & /(hc(1)**2) ddy2cen(i,j,k,n)=(crse(i,j+1,k,n)-2*crse(i,j,k,n)+crse(i,j-1,k,n)) & /(hc(2)**2) ddz2cen(i,j,k,n)=(crse(i,j,k+1,n)-2*crse(i,j,k,n)+crse(i,j,k-1,n)) & /(hc(3)**2) ddxplus(i,j,k,n)=(-crse(i+2,j,k,n)+4*crse(i+1,j,k,n)-3*crse(i,j,k,n)) & /(2*hc(1)) ddyplus(i,j,k,n)=(-crse(i,j+2,k,n)+4*crse(i,j+1,k,n)-3*crse(i,j,k,n)) & /(2*hc(2)) ddzplus(i,j,k,n)=(-crse(i,j,k+2,n)+4*crse(i,j,k+1,n)-3*crse(i,j,k,n)) & /(2*hc(3)) ddxminus(i,j,k,n)=(+crse(i-2,j,k,n)-4*crse(i-1,j,k,n)+3*crse(i,j,k,n)) & /(2*hc(1)) ddyminus(i,j,k,n)=(+crse(i,j-2,k,n)-4*crse(i,j-1,k,n)+3*crse(i,j,k,n)) & /(2*hc(2)) ddzminus(i,j,k,n)=(+crse(i,j,k-2,n)-4*crse(i,j,k-1,n)+3*crse(i,j,k,n)) & /(2*hc(3)) ddxdycen(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i+1,j-1,k,n)+crse(i-1,j-1,k,n))/(4*hc(1)*hc(2)) okxycen(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i+1,j-1,k).and.Usable(i-1,j-1,k)) ddxdypp(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i,j+1,k,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(2)) okxypp(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i,j+1,k) & .and.Usable(i+1,j,k)) ddxdypm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j-1,k,n)+crse(i,j-1,k,n))/(4*hc(1)*hc(2)) okxypm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j-1,k).and.Usable(i,j-1,k)) ddxdymp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(2)) okxymp(i,j,k)=(Usable(i,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i-1,j,k)) ddxdymm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j-1,k,n)+crse(i-1,j-1,k,n))/(hc(1)*hc(2)) okxymm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j-1,k).and.Usable(i-1,j-1,k)) ddxdzcen(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i+1,j,k-1,n)+crse(i-1,j,k-1,n))/(4*hc(1)*hc(3)) okxzcen(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i+1,j,k-1).and.Usable(i-1,j,k-1)) ddxdzpp(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i,j,k+1,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(3)) okxzpp(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i,j,k+1) & .and.Usable(i+1,j,k)) ddxdzpm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j,k-1,n)+crse(i,j,k-1,n))/(4*hc(1)*hc(3)) okxzpm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j,k-1).and.Usable(i,j,k-1)) ddxdzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(3)) okxzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i-1,j,k)) ddxdzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j,k-1,n)+crse(i-1,j,k-1,n))/(hc(1)*hc(3)) okxzmm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j,k-1).and.Usable(i-1,j,k-1)) ddydzcen(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j+1,k-1,n)+crse(i,j-1,k-1,n))/(4*hc(2)*hc(3)) okyzcen(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j+1,k-1).and.Usable(i,j-1,k-1)) ddydzpp(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j,k+1,n) & -crse(i,j+1,k,n)+crse(i,j,k,n))/(hc(2)*hc(3)) okyzpp(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j,k+1) & .and.Usable(i,j+1,k)) ddydzpm(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n) & -crse(i,j+1,k-1,n)+crse(i,j,k-1,n))/(4*hc(2)*hc(3)) okyzpm(i,j,k)=(Usable(i,j+1,k) & .and.Usable(i,j+1,k-1).and.Usable(i,j,k-1)) ddydzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j,k,n)+crse(i,j-1,k,n))/(hc(2)*hc(3)) okyzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j-1,k)) ddydzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i,j-1,k,n) & -crse(i,j,k-1,n)+crse(i,j-1,k-1,n))/(hc(2)*hc(3)) okyzmm(i,j,k)=(Usable(i,j-1,k) & .and.Usable(i,j,k-1).and.Usable(i,j-1,k-1)) ddxlowp(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n))/hc(1) ddylowp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n))/hc(2) ddzlowp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j,k,n))/hc(3) ddxlowm(i,j,k,n)=(-crse(i-1,j,k,n)+crse(i,j,k,n))/hc(1) ddylowm(i,j,k,n)=(-crse(i,j-1,k,n)+crse(i,j,k,n))/hc(2) ddzlowm(i,j,k,n)=(-crse(i,j,k-1,n)+crse(i,j,k,n))/hc(3) c ::: ------------ functions ------------------------------ kclo = ARG_L3(cb) kchi = ARG_H3(cb) iclo = ARG_L1(cb) ichi = ARG_H1(cb) jc = ARG_H2(cb)+1 j = hi(2)+1 c ::: ::: hf(1) = hfine(1) hf(2) = 0 hf(3) = hfine(2) hc(1) = hfine(1)*ratio hc(2) = 0 hc(3) = hfine(2)*ratio c ::: ::: do n = 1, nvar c ::::: calculate derivatives for interpolation do kc = kclo, kchi k = ratio*kc do ic = iclo, ichi i = ratio*ic derives(ic,kc,DX) = ddxcen(ic,jc,kc,n) derives(ic,kc,D2X) = ddx2cen(ic,jc,kc,n) if( notUsable(i-1,j,k) .and. notUsable(i+ratio,j,k) ) then derives(ic,kc,DX) = zero derives(ic,kc,D2X) = zero else if( notUsable(i-1,j,k) .and. Usable(i+ratio,j,k) ) then c :::: :::: : positive side usable if( ic+2.le.ichi+1 ) then if( Usable(i+2*ratio,j,k) ) then derives(ic,kc,DX)=ddxplus(ic,jc,kc,n) derives(ic,kc,D2X)=ddx2cen(ic+1,jc,kc,n) else derives(ic,kc,DX)=ddxlowp(ic,jc,kc,n) derives(ic,kc,D2X)=zero endif else derives(ic,kc,DX)=ddxlowp(ic,jc,kc,n) derives(ic,kc,D2X)=zero endif else if( Usable(i-1,j,k) .and. notUsable(i+ratio,j,k) ) then c :::: :::: : negative side usable if( ic-2.ge.iclo-1 ) then if( Usable(i-1,j,k) ) then derives(ic,kc,DX)=ddxminus(ic,jc,kc,n) derives(ic,kc,D2X)=ddx2cen(ic-1,jc,kc,n) else derives(ic,kc,DX)=ddxlowm(ic,jc,kc,n) derives(ic,kc,D2X)=zero endif else derives(ic,kc,DX)=ddxlowm(ic,jc,kc,n) derives(ic,kc,D2X)=zero endif endif derives(ic,kc,DZ) = ddzcen(ic,jc,kc,n) derives(ic,kc,D2Z) = ddz2cen(ic,jc,kc,n) if( notUsable(i,j,k-1) .and. notUsable(i,j,k+ratio)) then derives(ic,kc,DZ) = zero derives(ic,kc,D2Z) = zero else if( notUsable(i,j,k-1) .and. Usable(i,j,k+ratio)) then c :::: :::: : positive size usable if( kc+2.le.kchi+1 ) then if( Usable(i,j,k+2*ratio) ) then derives(ic,kc,DZ) = ddzplus(ic,jc,kc,n) derives(ic,kc,D2Z) = ddz2cen(ic,jc,kc+1,n) else derives(ic,kc,DZ) = ddzlowp(ic,jc,kc,n) derives(ic,kc,D2Z) = zero endif else derives(ic,kc,DZ) = ddzlowp(ic,jc,kc,n) derives(ic,kc,D2Z) = zero endif else if( Usable(i,j,k-1) .and. notUsable(i,j,k+ratio)) then c :::: :::: : negative size usable if( kc-2.ge.kclo-1 ) then if( Usable(i,j,k-1) ) then derives(ic,kc,DZ) = ddzminus(ic,jc,kc,n) derives(ic,kc,D2Z) = ddz2cen(ic,jc,kc-1,n) else derives(ic,kc,DZ) = ddzlowm(ic,jc,kc,n) derives(ic,kc,D2Z) = zero endif else derives(ic,kc,DZ) = ddzlowm(ic,jc,kc,n) derives(ic,kc,D2Z) = zero endif endif if( okxzcen(i,j,k) ) then derives(ic,kc,DXZ) = ddxdzcen(ic,jc,kc,n) else if( okxzpp(i,j,k) ) then derives(ic,kc,DXZ) = ddxdzpp(ic,jc,kc,n) else if( okxzpm(i,j,k) ) then derives(ic,kc,DXZ) = ddxdzpm(ic,jc,kc,n) else if( okxzmp(i,j,k) ) then derives(ic,kc,DXZ) = ddxdzmp(ic,jc,kc,n) else if( okxzmm(i,j,k) ) then derives(ic,kc,DXZ) = ddxdzmm(ic,jc,kc,n) else derives(ic,kc,DXZ) = zero endif enddo enddo c ::::: interpolate to fine grid do koff = 0, ratio - 1 zz = (koff+half)*hf(3)-hc(3)/2 do kc = kclo,kchi k = ratio*kc + koff do ioff = 0, ratio - 1 xx = (ioff+half)*hf(1)-hc(1)/2 do ic = iclo, ichi i = ratio*ic + ioff bdry(i,j,k,n) = crse(ic,jc,kc,n) + & xx*derives(ic,kc,DX) + & half*xx**2*derives(ic,kc,D2X) + & zz*derives(ic,kc,DZ) + & half*zz**2*derives(ic,kc,D2Z) + & xx*zz*derives(ic,kc,DXZ) bdry(i,j,k,n+CX*nvar) = & derives(ic,kc,DX)+ & xx*derives(ic,kc,D2X)+ & zz*derives(ic,kc,DXZ) bdry(i,j,k,n+CZ*nvar) = & derives(ic,kc,DZ)+ & zz*derives(ic,kc,D2Z)+ & xx*derives(ic,kc,DXZ) enddo enddo enddo enddo enddo return end c --------------------------------------------------------------- c :: FORT_BDINTERPZLO : Interpolation on Zlo Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables in solution, half number in bdry c :: ratio => refinement ratio c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPZLO (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratio,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives,hfine) integer nvar, ratio, not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),(1+3)*nvar) REAL_T derives(DIM12(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T hfine(BL_SPACEDIM-1) REAL_T yy, xx integer i, j, k, ic, jc, kc, ioff, joff, n integer iclo, ichi, jclo, jchi REAL_T hc(3),hf(3) c ::: ------------ functions ------------------------------ logical notUsable,Usable REAL_T ddxcen,ddx2cen,ddxplus,ddxminus REAL_T ddycen,ddy2cen,ddyplus,ddyminus REAL_T ddzcen,ddz2cen,ddzplus,ddzminus REAL_T ddxdycen,ddxdypp,ddxdypm,ddxdymp,ddxdymm REAL_T ddxdzcen,ddxdzpp,ddxdzpm,ddxdzmp,ddxdzmm REAL_T ddydzcen,ddydzpp,ddydzpm,ddydzmp,ddydzmm logical okxypp,okxypm,okxymp,okxymm,okxycen logical okxzpp,okxzpm,okxzmp,okxzmm,okxzcen logical okyzpp,okyzpm,okyzmp,okyzmm,okyzcen REAL_T ddxlowp,ddxlowm REAL_T ddylowp,ddylowm REAL_T ddzlowp,ddzlowm notUsable(i,j,k) = (mask(i,j,k).ne.not_covered) Usable(i,j,k) = (mask(i,j,k).eq.not_covered) ddxcen(i,j,k,n) = (crse(i+1,j,k,n)-crse(i-1,j,k,n))/(2*hc(1)) ddycen(i,j,k,n) = (crse(i,j+1,k,n)-crse(i,j-1,k,n))/(2*hc(2)) ddzcen(i,j,k,n) = (crse(i,j,k+1,n)-crse(i,j,k-1,n))/(2*hc(3)) ddx2cen(i,j,k,n)=(crse(i+1,j,k,n)-2*crse(i,j,k,n)+crse(i-1,j,k,n)) & /(hc(1)**2) ddy2cen(i,j,k,n)=(crse(i,j+1,k,n)-2*crse(i,j,k,n)+crse(i,j-1,k,n)) & /(hc(2)**2) ddz2cen(i,j,k,n)=(crse(i,j,k+1,n)-2*crse(i,j,k,n)+crse(i,j,k-1,n)) & /(hc(3)**2) ddxplus(i,j,k,n)=(-crse(i+2,j,k,n)+4*crse(i+1,j,k,n)-3*crse(i,j,k,n)) & /(2*hc(1)) ddyplus(i,j,k,n)=(-crse(i,j+2,k,n)+4*crse(i,j+1,k,n)-3*crse(i,j,k,n)) & /(2*hc(2)) ddzplus(i,j,k,n)=(-crse(i,j,k+2,n)+4*crse(i,j,k+1,n)-3*crse(i,j,k,n)) & /(2*hc(3)) ddxminus(i,j,k,n)=(+crse(i-2,j,k,n)-4*crse(i-1,j,k,n)+3*crse(i,j,k,n)) & /(2*hc(1)) ddyminus(i,j,k,n)=(+crse(i,j-2,k,n)-4*crse(i,j-1,k,n)+3*crse(i,j,k,n)) & /(2*hc(2)) ddzminus(i,j,k,n)=(+crse(i,j,k-2,n)-4*crse(i,j,k-1,n)+3*crse(i,j,k,n)) & /(2*hc(3)) ddxdycen(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i+1,j-1,k,n)+crse(i-1,j-1,k,n))/(4*hc(1)*hc(2)) okxycen(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i+1,j-1,k).and.Usable(i-1,j-1,k)) ddxdypp(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i,j+1,k,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(2)) okxypp(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i,j+1,k) & .and.Usable(i+1,j,k)) ddxdypm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j-1,k,n)+crse(i,j-1,k,n))/(4*hc(1)*hc(2)) okxypm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j-1,k).and.Usable(i,j-1,k)) ddxdymp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(2)) okxymp(i,j,k)=(Usable(i,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i-1,j,k)) ddxdymm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j-1,k,n)+crse(i-1,j-1,k,n))/(hc(1)*hc(2)) okxymm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j-1,k).and.Usable(i-1,j-1,k)) ddxdzcen(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i+1,j,k-1,n)+crse(i-1,j,k-1,n))/(4*hc(1)*hc(3)) okxzcen(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i+1,j,k-1).and.Usable(i-1,j,k-1)) ddxdzpp(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i,j,k+1,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(3)) okxzpp(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i,j,k+1) & .and.Usable(i+1,j,k)) ddxdzpm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j,k-1,n)+crse(i,j,k-1,n))/(4*hc(1)*hc(3)) okxzpm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j,k-1).and.Usable(i,j,k-1)) ddxdzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(3)) okxzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i-1,j,k)) ddxdzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j,k-1,n)+crse(i-1,j,k-1,n))/(hc(1)*hc(3)) okxzmm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j,k-1).and.Usable(i-1,j,k-1)) ddydzcen(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j+1,k-1,n)+crse(i,j-1,k-1,n))/(4*hc(2)*hc(3)) okyzcen(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j+1,k-1).and.Usable(i,j-1,k-1)) ddydzpp(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j,k+1,n) & -crse(i,j+1,k,n)+crse(i,j,k,n))/(hc(2)*hc(3)) okyzpp(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j,k+1) & .and.Usable(i,j+1,k)) ddydzpm(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n) & -crse(i,j+1,k-1,n)+crse(i,j,k-1,n))/(4*hc(2)*hc(3)) okyzpm(i,j,k)=(Usable(i,j+1,k) & .and.Usable(i,j+1,k-1).and.Usable(i,j,k-1)) ddydzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j,k,n)+crse(i,j-1,k,n))/(hc(2)*hc(3)) okyzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j-1,k)) ddydzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i,j-1,k,n) & -crse(i,j,k-1,n)+crse(i,j-1,k-1,n))/(hc(2)*hc(3)) okyzmm(i,j,k)=(Usable(i,j-1,k) & .and.Usable(i,j,k-1).and.Usable(i,j-1,k-1)) ddxlowp(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n))/hc(1) ddylowp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n))/hc(2) ddzlowp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j,k,n))/hc(3) ddxlowm(i,j,k,n)=(-crse(i-1,j,k,n)+crse(i,j,k,n))/hc(1) ddylowm(i,j,k,n)=(-crse(i,j-1,k,n)+crse(i,j,k,n))/hc(2) ddzlowm(i,j,k,n)=(-crse(i,j,k-1,n)+crse(i,j,k,n))/hc(3) c ::: ------------ functions ------------------------------ jclo = ARG_L2(cb) jchi = ARG_H2(cb) iclo = ARG_L1(cb) ichi = ARG_H1(cb) kc = ARG_L3(cb)-1 k = lo(3)-1 c ::: ::: hf(1) = hfine(1) hf(2) = hfine(2) hf(3) = 0 hc(1) = hfine(1)*ratio hc(2) = hfine(2)*ratio hc(3) = 0 c ::: ::: do n = 1, nvar c ::::: calculate derivatives for interpolation do jc = jclo, jchi j = ratio*jc do ic = iclo, ichi i = ratio*ic derives(ic,jc,DX) = ddxcen(ic,jc,kc,n) derives(ic,jc,D2X) = ddx2cen(ic,jc,kc,n) if( notUsable(i-1,j,k) .and. notUsable(i+ratio,j,k) ) then derives(ic,jc,DX) = zero derives(ic,jc,D2X) = zero else if( notUsable(i-1,j,k) .and. Usable(i+ratio,j,k) ) then c :::: :::: : positive side usable if( ic+2.le.ichi+1 ) then if( Usable(i+2*ratio,j,k) ) then derives(ic,jc,DX)=ddxplus(ic,jc,kc,n) derives(ic,jc,D2X)=ddx2cen(ic+1,jc,kc,n) else derives(ic,jc,DX)=ddxlowp(ic,jc,kc,n) derives(ic,jc,D2X)=zero endif else derives(ic,jc,DX)=ddxlowp(ic,jc,kc,n) derives(ic,jc,D2X)=zero endif else if( Usable(i-1,j,k) .and. notUsable(i+ratio,j,k) ) then c :::: :::: : negative side usable if( ic-2.ge.iclo-1 ) then if( Usable(i-1,j,k) ) then derives(ic,jc,DX)=ddxminus(ic,jc,kc,n) derives(ic,jc,D2X)=ddx2cen(ic-1,jc,kc,n) else derives(ic,jc,DX)=ddxlowm(ic,jc,kc,n) derives(ic,jc,D2X)=zero endif else derives(ic,jc,DX)=ddxlowm(ic,jc,kc,n) derives(ic,jc,D2X)=zero endif endif derives(ic,jc,DY) = ddycen(ic,jc,kc,n) derives(ic,jc,D2Y) = ddy2cen(ic,jc,kc,n) if( notUsable(i,j-1,k) .and. notUsable(i,j+ratio,k) ) then derives(ic,jc,DY) = zero derives(ic,jc,D2Y) = zero else if( notUsable(i,j-1,k) .and. Usable(i,j+ratio,k) ) then c :::: :::: : positive side usable if( jc+2.le.jchi+1 ) then if( Usable(i,j+2*ratio,k) ) then derives(ic,jc,DY)=ddyplus(ic,jc,kc,n) derives(ic,jc,D2Y)=ddy2cen(ic,jc+1,kc,n) else derives(ic,jc,DY)=ddylowp(ic,jc,kc,n) derives(ic,jc,D2Y)=zero endif else derives(ic,jc,DY)=ddylowp(ic,jc,kc,n) derives(ic,jc,D2Y)=zero endif else if( Usable(i,j-1,k) .and. notUsable(i,j+ratio,k) ) then c :::: :::: : negative side usable if( jc-2.ge.jclo-1 ) then if( Usable(i,j-1,k) ) then derives(ic,jc,DY)=ddyminus(ic,jc,kc,n) derives(ic,jc,D2Y)=ddy2cen(ic,jc-1,kc,n) else derives(ic,jc,DY)=ddylowm(ic,jc,kc,n) derives(ic,jc,D2Y)=zero endif else derives(ic,jc,DY)=ddylowm(ic,jc,kc,n) derives(ic,jc,D2Y)=zero endif endif if( okxycen(i,j,k) ) then derives(ic,jc,DXY) = ddxdycen(ic,jc,kc,n) else if( okxypp(i,j,k) ) then derives(ic,jc,DXY) = ddxdypp(ic,jc,kc,n) else if( okxypm(i,j,k) ) then derives(ic,jc,DXY) = ddxdypm(ic,jc,kc,n) else if( okxymp(i,j,k) ) then derives(ic,jc,DXY) = ddxdymp(ic,jc,kc,n) else if( okxymm(i,j,k) ) then derives(ic,jc,DXY) = ddxdymm(ic,jc,kc,n) else derives(ic,jc,DXY) = zero endif enddo enddo c ::::: interpolate to fine grid do joff = 0, ratio - 1 yy = (joff+half)*hf(2)-hc(2)/2 do jc = jclo,jchi j = ratio*jc + joff do ioff = 0, ratio - 1 xx = (ioff+half)*hf(1)-hc(1)/2 do ic = iclo, ichi i = ratio*ic + ioff bdry(i,j,k,n) = crse(ic,jc,kc,n) + & xx*derives(ic,jc,DX) + & half*xx**2*derives(ic,jc,D2X) + & yy*derives(ic,jc,DY) + & half*yy**2*derives(ic,jc,D2Y) + & xx*yy*derives(ic,jc,DXY) bdry(i,j,k,n+CX*nvar) = & derives(ic,jc,DX)+ & xx*derives(ic,jc,D2X)+ & yy*derives(ic,jc,DXY) bdry(i,j,k,n+CY*nvar) = & derives(ic,jc,DY)+ & yy*derives(ic,jc,D2Y)+ & xx*derives(ic,jc,DXY) enddo enddo enddo enddo enddo return end c --------------------------------------------------------------- c :: FORT_BDINTERPZHI : Interpolation on Zhi Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables in solution, half number in bdry c :: ratio => refinement ratio c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array for derivatives c --------------------------------------------------------------- subroutine FORT_BDINTERPZHI (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratio,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives,hfine) integer nvar, ratio, not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(cb) integer DIMDEC(mask) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),(1+3)*nvar) REAL_T derives(DIM12(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T hfine(BL_SPACEDIM-1) REAL_T yy, xx integer i, j, k, ic, jc, kc, ioff, joff, n integer iclo, ichi, jclo, jchi REAL_T hc(3),hf(3) c ::: ------------ functions ------------------------------ logical notUsable,Usable REAL_T ddxcen,ddx2cen,ddxplus,ddxminus REAL_T ddycen,ddy2cen,ddyplus,ddyminus REAL_T ddzcen,ddz2cen,ddzplus,ddzminus REAL_T ddxdycen,ddxdypp,ddxdypm,ddxdymp,ddxdymm REAL_T ddxdzcen,ddxdzpp,ddxdzpm,ddxdzmp,ddxdzmm REAL_T ddydzcen,ddydzpp,ddydzpm,ddydzmp,ddydzmm logical okxypp,okxypm,okxymp,okxymm,okxycen logical okxzpp,okxzpm,okxzmp,okxzmm,okxzcen logical okyzpp,okyzpm,okyzmp,okyzmm,okyzcen REAL_T ddxlowp,ddxlowm REAL_T ddylowp,ddylowm REAL_T ddzlowp,ddzlowm notUsable(i,j,k) = (mask(i,j,k).ne.not_covered) Usable(i,j,k) = (mask(i,j,k).eq.not_covered) ddxcen(i,j,k,n) = (crse(i+1,j,k,n)-crse(i-1,j,k,n))/(2*hc(1)) ddycen(i,j,k,n) = (crse(i,j+1,k,n)-crse(i,j-1,k,n))/(2*hc(2)) ddzcen(i,j,k,n) = (crse(i,j,k+1,n)-crse(i,j,k-1,n))/(2*hc(3)) ddx2cen(i,j,k,n)=(crse(i+1,j,k,n)-2*crse(i,j,k,n)+crse(i-1,j,k,n)) & /(hc(1)**2) ddy2cen(i,j,k,n)=(crse(i,j+1,k,n)-2*crse(i,j,k,n)+crse(i,j-1,k,n)) & /(hc(2)**2) ddz2cen(i,j,k,n)=(crse(i,j,k+1,n)-2*crse(i,j,k,n)+crse(i,j,k-1,n)) & /(hc(3)**2) ddxplus(i,j,k,n)=(-crse(i+2,j,k,n)+4*crse(i+1,j,k,n)-3*crse(i,j,k,n)) & /(2*hc(1)) ddyplus(i,j,k,n)=(-crse(i,j+2,k,n)+4*crse(i,j+1,k,n)-3*crse(i,j,k,n)) & /(2*hc(2)) ddzplus(i,j,k,n)=(-crse(i,j,k+2,n)+4*crse(i,j,k+1,n)-3*crse(i,j,k,n)) & /(2*hc(3)) ddxminus(i,j,k,n)=(+crse(i-2,j,k,n)-4*crse(i-1,j,k,n)+3*crse(i,j,k,n)) & /(2*hc(1)) ddyminus(i,j,k,n)=(+crse(i,j-2,k,n)-4*crse(i,j-1,k,n)+3*crse(i,j,k,n)) & /(2*hc(2)) ddzminus(i,j,k,n)=(+crse(i,j,k-2,n)-4*crse(i,j,k-1,n)+3*crse(i,j,k,n)) & /(2*hc(3)) ddxdycen(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i+1,j-1,k,n)+crse(i-1,j-1,k,n))/(4*hc(1)*hc(2)) okxycen(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i+1,j-1,k).and.Usable(i-1,j-1,k)) ddxdypp(i,j,k,n)=(crse(i+1,j+1,k,n)-crse(i,j+1,k,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(2)) okxypp(i,j,k)=(Usable(i+1,j+1,k).and.Usable(i,j+1,k) & .and.Usable(i+1,j,k)) ddxdypm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j-1,k,n)+crse(i,j-1,k,n))/(4*hc(1)*hc(2)) okxypm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j-1,k).and.Usable(i,j-1,k)) ddxdymp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i-1,j+1,k,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(2)) okxymp(i,j,k)=(Usable(i,j+1,k).and.Usable(i-1,j+1,k) & .and.Usable(i-1,j,k)) ddxdymm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j-1,k,n)+crse(i-1,j-1,k,n))/(hc(1)*hc(2)) okxymm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j-1,k).and.Usable(i-1,j-1,k)) ddxdzcen(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i+1,j,k-1,n)+crse(i-1,j,k-1,n))/(4*hc(1)*hc(3)) okxzcen(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i+1,j,k-1).and.Usable(i-1,j,k-1)) ddxdzpp(i,j,k,n)=(crse(i+1,j,k+1,n)-crse(i,j,k+1,n) & -crse(i+1,j,k,n)+crse(i,j,k,n))/(hc(1)*hc(3)) okxzpp(i,j,k)=(Usable(i+1,j,k+1).and.Usable(i,j,k+1) & .and.Usable(i+1,j,k)) ddxdzpm(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n) & -crse(i+1,j,k-1,n)+crse(i,j,k-1,n))/(4*hc(1)*hc(3)) okxzpm(i,j,k)=(Usable(i+1,j,k) & .and.Usable(i+1,j,k-1).and.Usable(i,j,k-1)) ddxdzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i-1,j,k+1,n) & -crse(i,j,k,n)+crse(i-1,j,k,n))/(hc(1)*hc(3)) okxzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i-1,j,k+1) & .and.Usable(i-1,j,k)) ddxdzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i-1,j,k,n) & -crse(i,j,k-1,n)+crse(i-1,j,k-1,n))/(hc(1)*hc(3)) okxzmm(i,j,k)=(Usable(i-1,j,k) & .and.Usable(i,j,k-1).and.Usable(i-1,j,k-1)) ddydzcen(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j+1,k-1,n)+crse(i,j-1,k-1,n))/(4*hc(2)*hc(3)) okyzcen(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j+1,k-1).and.Usable(i,j-1,k-1)) ddydzpp(i,j,k,n)=(crse(i,j+1,k+1,n)-crse(i,j,k+1,n) & -crse(i,j+1,k,n)+crse(i,j,k,n))/(hc(2)*hc(3)) okyzpp(i,j,k)=(Usable(i,j+1,k+1).and.Usable(i,j,k+1) & .and.Usable(i,j+1,k)) ddydzpm(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n) & -crse(i,j+1,k-1,n)+crse(i,j,k-1,n))/(4*hc(2)*hc(3)) okyzpm(i,j,k)=(Usable(i,j+1,k) & .and.Usable(i,j+1,k-1).and.Usable(i,j,k-1)) ddydzmp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j-1,k+1,n) & -crse(i,j,k,n)+crse(i,j-1,k,n))/(hc(2)*hc(3)) okyzmp(i,j,k)=(Usable(i,j,k+1).and.Usable(i,j-1,k+1) & .and.Usable(i,j-1,k)) ddydzmm(i,j,k,n)=(crse(i,j,k,n)-crse(i,j-1,k,n) & -crse(i,j,k-1,n)+crse(i,j-1,k-1,n))/(hc(2)*hc(3)) okyzmm(i,j,k)=(Usable(i,j-1,k) & .and.Usable(i,j,k-1).and.Usable(i,j-1,k-1)) ddxlowp(i,j,k,n)=(crse(i+1,j,k,n)-crse(i,j,k,n))/hc(1) ddylowp(i,j,k,n)=(crse(i,j+1,k,n)-crse(i,j,k,n))/hc(2) ddzlowp(i,j,k,n)=(crse(i,j,k+1,n)-crse(i,j,k,n))/hc(3) ddxlowm(i,j,k,n)=(-crse(i-1,j,k,n)+crse(i,j,k,n))/hc(1) ddylowm(i,j,k,n)=(-crse(i,j-1,k,n)+crse(i,j,k,n))/hc(2) ddzlowm(i,j,k,n)=(-crse(i,j,k-1,n)+crse(i,j,k,n))/hc(3) c ::: ------------ functions ------------------------------ jclo = ARG_L2(cb) jchi = ARG_H2(cb) iclo = ARG_L1(cb) ichi = ARG_H1(cb) kc = ARG_H3(cb)+1 k = hi(3)+1 c ::: ::: hf(1) = hfine(1) hf(2) = hfine(2) hf(3) = 0 hc(1) = hfine(1)*ratio hc(2) = hfine(2)*ratio hc(3) = 0 c ::: ::: do n = 1, nvar c ::::: calculate derivatives for interpolation do jc = jclo, jchi j = ratio*jc do ic = iclo, ichi i = ratio*ic derives(ic,jc,DX) = ddxcen(ic,jc,kc,n) derives(ic,jc,D2X) = ddx2cen(ic,jc,kc,n) if( notUsable(i-1,j,k) .and. notUsable(i+ratio,j,k) ) then derives(ic,jc,DX) = zero derives(ic,jc,D2X) = zero else if( notUsable(i-1,j,k) .and. Usable(i+ratio,j,k) ) then c :::: :::: : positive side usable if( ic+2.le.ichi+1 ) then if( Usable(i+2*ratio,j,k) ) then derives(ic,jc,DX)=ddxplus(ic,jc,kc,n) derives(ic,jc,D2X)=ddx2cen(ic+1,jc,kc,n) else derives(ic,jc,DX)=ddxlowp(ic,jc,kc,n) derives(ic,jc,D2X)=zero endif else derives(ic,jc,DX)=ddxlowp(ic,jc,kc,n) derives(ic,jc,D2X)=zero endif else if( Usable(i-1,j,k) .and. notUsable(i+ratio,j,k) ) then c :::: :::: : negative side usable if( ic-2.ge.iclo-1 ) then if( Usable(i-1,j,k) ) then derives(ic,jc,DX)=ddxminus(ic,jc,kc,n) derives(ic,jc,D2X)=ddx2cen(ic-1,jc,kc,n) else derives(ic,jc,DX)=ddxlowm(ic,jc,kc,n) derives(ic,jc,D2X)=zero endif else derives(ic,jc,DX)=ddxlowm(ic,jc,kc,n) derives(ic,jc,D2X)=zero endif endif derives(ic,jc,DY) = ddycen(ic,jc,kc,n) derives(ic,jc,D2Y) = ddy2cen(ic,jc,kc,n) if( notUsable(i,j-1,k) .and. notUsable(i,j+ratio,k) ) then derives(ic,jc,DY) = zero derives(ic,jc,D2Y) = zero else if( notUsable(i,j-1,k) .and. Usable(i,j+ratio,k) ) then c :::: :::: : positive side usable if( jc+2.le.jchi+1 ) then if( Usable(i,j+2*ratio,k) ) then derives(ic,jc,DY)=ddyplus(ic,jc,kc,n) derives(ic,jc,D2Y)=ddy2cen(ic,jc+1,kc,n) else derives(ic,jc,DY)=ddylowp(ic,jc,kc,n) derives(ic,jc,D2Y)=zero endif else derives(ic,jc,DY)=ddylowp(ic,jc,kc,n) derives(ic,jc,D2Y)=zero endif else if( Usable(i,j-1,k) .and. notUsable(i,j+ratio,k) ) then c :::: :::: : negative side usable if( jc-2.ge.jclo-1 ) then if( Usable(i,j-1,k) ) then derives(ic,jc,DY)=ddyminus(ic,jc,kc,n) derives(ic,jc,D2Y)=ddy2cen(ic,jc-1,kc,n) else derives(ic,jc,DY)=ddylowm(ic,jc,kc,n) derives(ic,jc,D2Y)=zero endif else derives(ic,jc,DY)=ddylowm(ic,jc,kc,n) derives(ic,jc,D2Y)=zero endif endif if( okxycen(i,j,k) ) then derives(ic,jc,DXY) = ddxdycen(ic,jc,kc,n) else if( okxypp(i,j,k) ) then derives(ic,jc,DXY) = ddxdypp(ic,jc,kc,n) else if( okxypm(i,j,k) ) then derives(ic,jc,DXY) = ddxdypm(ic,jc,kc,n) else if( okxymp(i,j,k) ) then derives(ic,jc,DXY) = ddxdymp(ic,jc,kc,n) else if( okxymm(i,j,k) ) then derives(ic,jc,DXY) = ddxdymm(ic,jc,kc,n) else derives(ic,jc,DXY) = zero endif enddo enddo c ::::: interpolate to fine grid do joff = 0, ratio - 1 yy = (joff+half)*hf(2)-hc(2)/2 do jc = jclo,jchi j = ratio*jc + joff do ioff = 0, ratio - 1 xx = (ioff+half)*hf(1)-hc(1)/2 do ic = iclo, ichi i = ratio*ic + ioff bdry(i,j,k,n) = crse(ic,jc,kc,n) + & xx*derives(ic,jc,DX) + & half*xx**2*derives(ic,jc,D2X) + & yy*derives(ic,jc,DY) + & half*yy**2*derives(ic,jc,D2Y) + & xx*yy*derives(ic,jc,DXY) bdry(i,j,k,n+CX*nvar) = & derives(ic,jc,DX)+ & xx*derives(ic,jc,D2X)+ & yy*derives(ic,jc,DXY) bdry(i,j,k,n+CY*nvar) = & derives(ic,jc,DY)+ & yy*derives(ic,jc,D2Y)+ & xx*derives(ic,jc,DXY) enddo enddo enddo enddo enddo return end c ------------------------------------------------------------------------ c :: FORT_BDIDERIVXLO : copy from Xlo face of fine fab (getting values c :: which were stuck there by the physical boundary condition routines) c :: to get the first nvar values in bdry. The following 3*nvar values c :: are gotten by computing the transverse derivative. Two formulas c :: are used: 1) on the interior a centered difference is used; c :: 2) at the end points a one-sided difference is used. No check c :: is made to check that the one-sided difference does not poke out c :: the other side of the grid. But if grids are that small, a lot c :: of things will be blowing up. c :: NOTE: only the transverse derivs are computed, so one of the c :: derivs if filled with error values c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: lo,hi => index limits of "grid". So all action takes place in cells c :: outside the grid c :: fine => fine grid data which has phys-bc data stuffed in it c :: nvar => number of components in fine. But you write (3+1) times as many c :: components of data in bdry because you compute transverse c :: derivatives as well c :: hfine => delta x in transverse direction; needed for derivs c ------------------------------------------------------------------------ subroutine FORT_BDIDERIVXLO( bdry, DIMS(bdry), & lo, hi, & fine, DIMS(fine), & nvar, hfine) integer nvar REAL_T hfine(3) integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(fine) REAL_T bdry(DIMV(bdry),(3+1)*nvar) REAL_T fine(DIMV(fine), nvar) integer i,j,k,n REAL_T h(3) c ::: ------ begin functions ------- REAL_T ddxcen REAL_T ddycen REAL_T ddzcen REAL_T ddxplus,ddxminus,ddyplus,ddyminus,ddzplus,ddzminus ddxcen(i,j,k,n) = (fine(i+1,j,k,n)-fine(i-1,j,k,n))/(2*h(1)) ddycen(i,j,k,n) = (fine(i,j+1,k,n)-fine(i,j-1,k,n))/(2*h(2)) ddzcen(i,j,k,n) = (fine(i,j,k+1,n)-fine(i,j,k-1,n))/(2*h(3)) ddxplus(i,j,k,n)=(-fine(i+2,j,k,n)+4*fine(i+1,j,k,n)-3*fine(i,j,k,n)) & /(2*h(1)) ddyplus(i,j,k,n)=(-fine(i,j+2,k,n)+4*fine(i,j+1,k,n)-3*fine(i,j,k,n)) & /(2*h(2)) ddzplus(i,j,k,n)=(-fine(i,j,k+2,n)+4*fine(i,j,k+1,n)-3*fine(i,j,k,n)) & /(2*h(3)) ddxminus(i,j,k,n)=(+fine(i-2,j,k,n)-4*fine(i-1,j,k,n)+3*fine(i,j,k,n)) & /(2*h(1)) ddyminus(i,j,k,n)=(+fine(i,j-2,k,n)-4*fine(i,j-1,k,n)+3*fine(i,j,k,n)) & /(2*h(2)) ddzminus(i,j,k,n)=(+fine(i,j,k-2,n)-4*fine(i,j,k-1,n)+3*fine(i,j,k,n)) & /(2*h(3)) c ::: ------ end functions ------- i = lo(1)-1 h(1) = 0 h(2) = hfine(1) h(3) = hfine(2) do n=1,nvar c ::: ::: copy boundary values over do k=lo(3),hi(3) do j=lo(2),hi(2) bdry(i,j,k,n) = fine(i,j,k,n) enddo enddo c ::: ::: do stinking calculation of derivativ using centered difference c ::: ::: this ONLY makes sense for DIRICHLET BC. For other BC, c ::: ::: we will not use these values. c ::: ::: First, do y deriv do k=lo(3),hi(3) j=lo(2) bdry(i,j,k,n+CY*nvar) = ddyplus(i,j,k,n) do j=lo(2)+1,hi(2)-1 bdry(i,j,k,n+CY*nvar) = ddycen(i,j,k,n) enddo j=hi(2) bdry(i,j,k,n+CY*nvar) = ddyminus(i,j,k,n) enddo c ::: ::: next, do z deriv do j=lo(2),hi(2) k=lo(3) bdry(i,j,k,n+CZ*nvar) = ddzplus(i,j,k,n) do k=lo(3)+1,hi(3)-1 bdry(i,j,k,n+CZ*nvar) = ddzcen(i,j,k,n) enddo k=hi(3) bdry(i,j,k,n+CZ*nvar) = ddzminus(i,j,k,n) enddo enddo return end c ------------------------------------------------------------------------ c :: FORT_BDIDERIVXHI : copy from Xhi face of fine fab (getting values c :: which were stuck there by the physical boundary condition routines) c :: to get the first nvar values in bdry. The following 3*nvar values c :: are gotten by computing the transverse derivative. Two formulas c :: are used: 1) on the interior a centered difference is used; c :: 2) at the end points a one-sided difference is used. No check c :: is made to check that the one-sided difference does not poke out c :: the other side of the grid. But if grids are that small, a lot c :: of things will be blowing up. c :: NOTE: only the transverse derivs are computed, so one of the c :: derivs if filled with error values c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: lo,hi => index limits of "grid". So all action takes place in cells c :: outside the grid c :: fine => fine grid data which has phys-bc data stuffed in it c :: nvar => number of components in fine. But you write (3+1) times as many c :: components of data in bdry because you compute transverse c :: derivatives as well c :: hfine => delta x in transverse direction; needed for derivs c ------------------------------------------------------------------------ subroutine FORT_BDIDERIVXHI( bdry, DIMS(bdry), & lo, hi, & fine, DIMS(fine), & nvar, hfine) integer nvar REAL_T hfine(3) integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(fine) REAL_T bdry(DIMV(bdry),(3+1)*nvar) REAL_T fine(DIMV(fine), nvar) integer i,j,k,n REAL_T h(3) c ::: ------ begin functions ------- REAL_T ddxcen REAL_T ddycen REAL_T ddzcen REAL_T ddxplus,ddxminus,ddyplus,ddyminus,ddzplus,ddzminus ddxcen(i,j,k,n) = (fine(i+1,j,k,n)-fine(i-1,j,k,n))/(2*h(1)) ddycen(i,j,k,n) = (fine(i,j+1,k,n)-fine(i,j-1,k,n))/(2*h(2)) ddzcen(i,j,k,n) = (fine(i,j,k+1,n)-fine(i,j,k-1,n))/(2*h(3)) ddxplus(i,j,k,n)=(-fine(i+2,j,k,n)+4*fine(i+1,j,k,n)-3*fine(i,j,k,n)) & /(2*h(1)) ddyplus(i,j,k,n)=(-fine(i,j+2,k,n)+4*fine(i,j+1,k,n)-3*fine(i,j,k,n)) & /(2*h(2)) ddzplus(i,j,k,n)=(-fine(i,j,k+2,n)+4*fine(i,j,k+1,n)-3*fine(i,j,k,n)) & /(2*h(3)) ddxminus(i,j,k,n)=(+fine(i-2,j,k,n)-4*fine(i-1,j,k,n)+3*fine(i,j,k,n)) & /(2*h(1)) ddyminus(i,j,k,n)=(+fine(i,j-2,k,n)-4*fine(i,j-1,k,n)+3*fine(i,j,k,n)) & /(2*h(2)) ddzminus(i,j,k,n)=(+fine(i,j,k-2,n)-4*fine(i,j,k-1,n)+3*fine(i,j,k,n)) & /(2*h(3)) c ::: ------ end functions ------- i = hi(1)+1 h(1) = 0 h(2) = hfine(1) h(3) = hfine(2) do n=1,nvar c ::: ::: copy boundary values over do k=lo(3),hi(3) do j=lo(2),hi(2) bdry(i,j,k,n) = fine(i,j,k,n) enddo enddo c ::: ::: do stinking calculation of derivativ using centered difference c ::: ::: this ONLY makes sense for DIRICHLET BC. For other BC, c ::: ::: we will not use these values. c ::: ::: First, do y deriv do k=lo(3),hi(3) j=lo(2) bdry(i,j,k,n+CY*nvar) = ddyplus(i,j,k,n) do j=lo(2)+1,hi(2)-1 bdry(i,j,k,n+CY*nvar) = ddycen(i,j,k,n) enddo j=hi(2) bdry(i,j,k,n+CY*nvar) = ddyminus(i,j,k,n) enddo c ::: ::: next, do z deriv do j=lo(2),hi(2) k=lo(3) bdry(i,j,k,n+CZ*nvar) = ddzplus(i,j,k,n) do k=lo(3)+1,hi(3)-1 bdry(i,j,k,n+CZ*nvar) = ddzcen(i,j,k,n) enddo k=hi(3) bdry(i,j,k,n+CZ*nvar) = ddzminus(i,j,k,n) enddo enddo return end c ------------------------------------------------------------------------ c :: FORT_BDIDERIVYLO : copy from Ylo face of fine fab (getting values c :: which were stuck there by the physical boundary condition routines) c :: to get the first nvar values in bdry. The following 3*nvar values c :: are gotten by computing the transverse derivative. Two formulas c :: are used: 1) on the interior a centered difference is used; c :: 2) at the end points a one-sided difference is used. No check c :: is made to check that the one-sided difference does not poke out c :: the other side of the grid. But if grids are that small, a lot c :: of things will be blowing up. c :: NOTE: only the transverse derivs are computed, so one of the c :: derivs if filled with error values c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: lo,hi => index limits of "grid". So all action takes place in cells c :: outside the grid c :: fine => fine grid data which has phys-bc data stuffed in it c :: nvar => number of components in fine. But you write (3+1) times as many c :: components of data in bdry because you compute transverse c :: derivatives as well c :: hfine => delta x in transverse direction; needed for derivs c ------------------------------------------------------------------------ subroutine FORT_BDIDERIVYLO( bdry, DIMS(bdry), & lo, hi, & fine, DIMS(fine), & nvar, hfine) integer nvar REAL_T hfine(3) integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(fine) REAL_T bdry(DIMV(bdry),(3+1)*nvar) REAL_T fine(DIMV(fine), nvar) integer i,j,k,n REAL_T h(3) c ::: ------ begin functions ------- REAL_T ddxcen REAL_T ddycen REAL_T ddzcen REAL_T ddxplus,ddxminus,ddyplus,ddyminus,ddzplus,ddzminus ddxcen(i,j,k,n) = (fine(i+1,j,k,n)-fine(i-1,j,k,n))/(2*h(1)) ddycen(i,j,k,n) = (fine(i,j+1,k,n)-fine(i,j-1,k,n))/(2*h(2)) ddzcen(i,j,k,n) = (fine(i,j,k+1,n)-fine(i,j,k-1,n))/(2*h(3)) ddxplus(i,j,k,n)=(-fine(i+2,j,k,n)+4*fine(i+1,j,k,n)-3*fine(i,j,k,n)) & /(2*h(1)) ddyplus(i,j,k,n)=(-fine(i,j+2,k,n)+4*fine(i,j+1,k,n)-3*fine(i,j,k,n)) & /(2*h(2)) ddzplus(i,j,k,n)=(-fine(i,j,k+2,n)+4*fine(i,j,k+1,n)-3*fine(i,j,k,n)) & /(2*h(3)) ddxminus(i,j,k,n)=(+fine(i-2,j,k,n)-4*fine(i-1,j,k,n)+3*fine(i,j,k,n)) & /(2*h(1)) ddyminus(i,j,k,n)=(+fine(i,j-2,k,n)-4*fine(i,j-1,k,n)+3*fine(i,j,k,n)) & /(2*h(2)) ddzminus(i,j,k,n)=(+fine(i,j,k-2,n)-4*fine(i,j,k-1,n)+3*fine(i,j,k,n)) & /(2*h(3)) c ::: ------ end functions ------- j = lo(2)-1 h(1) = hfine(1) h(2) = 0 h(3) = hfine(2) do n=1,nvar c ::: ::: copy boundary values over do k=lo(3),hi(3) do i=lo(1),hi(1) bdry(i,j,k,n) = fine(i,j,k,n) enddo enddo c ::: ::: do stinking calculation of derivativ using centered difference c ::: ::: this ONLY makes sense for DIRICHLET BC. For other BC, c ::: ::: we will not use these values. c ::: ::: First, do x deriv do k=lo(3),hi(3) i=lo(1) bdry(i,j,k,n+CX*nvar) = ddxplus(i,j,k,n) do i=lo(1)+1,hi(1)-1 bdry(i,j,k,n+CX*nvar) = ddxcen(i,j,k,n) enddo i=hi(1) bdry(i,j,k,n+CX*nvar) = ddxminus(i,j,k,n) enddo c ::: ::: next, do z deriv do i=lo(1),hi(1) k=lo(3) bdry(i,j,k,n+CZ*nvar) = ddzplus(i,j,k,n) do k=lo(3)+1,hi(3)-1 bdry(i,j,k,n+CZ*nvar) = ddzcen(i,j,k,n) enddo k=hi(3) bdry(i,j,k,n+CZ*nvar) = ddzminus(i,j,k,n) enddo enddo return end c ------------------------------------------------------------------------ c :: FORT_BDIDERIVYHI : copy from Yhi face of fine fab (getting values c :: which were stuck there by the physical boundary condition routines) c :: to get the first nvar values in bdry. The following 3*nvar values c :: are gotten by computing the transverse derivative. Two formulas c :: are used: 1) on the interior a centered difference is used; c :: 2) at the end points a one-sided difference is used. No check c :: is made to check that the one-sided difference does not poke out c :: the other side of the grid. But if grids are that small, a lot c :: of things will be blowing up. c :: NOTE: only the transverse derivs are computed, so one of the c :: derivs if filled with error values c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: lo,hi => index limits of "grid". So all action takes place in cells c :: outside the grid c :: fine => fine grid data which has phys-bc data stuffed in it c :: nvar => number of components in fine. But you write (3+1) times as many c :: components of data in bdry because you compute transverse c :: derivatives as well c :: hfine => delta x in transverse direction; needed for derivs c ------------------------------------------------------------------------ subroutine FORT_BDIDERIVYHI( bdry, DIMS(bdry), & lo, hi, & fine, DIMS(fine), & nvar, hfine) integer nvar REAL_T hfine(3) integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(fine) REAL_T bdry(DIMV(bdry),(3+1)*nvar) REAL_T fine(DIMV(fine), nvar) integer i,j,k,n REAL_T h(3) c ::: ------ begin functions ------- REAL_T ddxcen REAL_T ddycen REAL_T ddzcen REAL_T ddxplus,ddxminus,ddyplus,ddyminus,ddzplus,ddzminus ddxcen(i,j,k,n) = (fine(i+1,j,k,n)-fine(i-1,j,k,n))/(2*h(1)) ddycen(i,j,k,n) = (fine(i,j+1,k,n)-fine(i,j-1,k,n))/(2*h(2)) ddzcen(i,j,k,n) = (fine(i,j,k+1,n)-fine(i,j,k-1,n))/(2*h(3)) ddxplus(i,j,k,n)=(-fine(i+2,j,k,n)+4*fine(i+1,j,k,n)-3*fine(i,j,k,n)) & /(2*h(1)) ddyplus(i,j,k,n)=(-fine(i,j+2,k,n)+4*fine(i,j+1,k,n)-3*fine(i,j,k,n)) & /(2*h(2)) ddzplus(i,j,k,n)=(-fine(i,j,k+2,n)+4*fine(i,j,k+1,n)-3*fine(i,j,k,n)) & /(2*h(3)) ddxminus(i,j,k,n)=(+fine(i-2,j,k,n)-4*fine(i-1,j,k,n)+3*fine(i,j,k,n)) & /(2*h(1)) ddyminus(i,j,k,n)=(+fine(i,j-2,k,n)-4*fine(i,j-1,k,n)+3*fine(i,j,k,n)) & /(2*h(2)) ddzminus(i,j,k,n)=(+fine(i,j,k-2,n)-4*fine(i,j,k-1,n)+3*fine(i,j,k,n)) & /(2*h(3)) c ::: ------ end functions ------- j = hi(2)+1 h(1) = hfine(1) h(2) = 0 h(3) = hfine(2) do n=1,nvar c ::: ::: copy boundary values over do k=lo(3),hi(3) do i=lo(1),hi(1) bdry(i,j,k,n) = fine(i,j,k,n) enddo enddo c ::: ::: do stinking calculation of derivativ using centered difference c ::: ::: this ONLY makes sense for DIRICHLET BC. For other BC, c ::: ::: we will not use these values. c ::: ::: First, do x deriv do k=lo(3),hi(3) i=lo(1) bdry(i,j,k,n+CX*nvar) = ddxplus(i,j,k,n) do i=lo(1)+1,hi(1)-1 bdry(i,j,k,n+CX*nvar) = ddxcen(i,j,k,n) enddo i=hi(1) bdry(i,j,k,n+CX*nvar) = ddxminus(i,j,k,n) enddo c ::: ::: next, do z deriv do i=lo(1),hi(1) k=lo(3) bdry(i,j,k,n+CZ*nvar) = ddzplus(i,j,k,n) do k=lo(3)+1,hi(3)-1 bdry(i,j,k,n+CZ*nvar) = ddzcen(i,j,k,n) enddo k=hi(3) bdry(i,j,k,n+CZ*nvar) = ddzminus(i,j,k,n) enddo enddo return end c ------------------------------------------------------------------------ c :: FORT_BDIDERIVZLO : copy from Zlo face of fine fab (getting values c :: which were stuck there by the physical boundary condition routines) c :: to get the first nvar values in bdry. The following 3*nvar values c :: are gotten by computing the transverse derivative. Two formulas c :: are used: 1) on the interior a centered difference is used; c :: 2) at the end points a one-sided difference is used. No check c :: is made to check that the one-sided difference does not poke out c :: the other side of the grid. But if grids are that small, a lot c :: of things will be blowing up. c :: NOTE: only the transverse derivs are computed, so one of the c :: derivs if filled with error values c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: lo,hi => index limits of "grid". So all action takes place in cells c :: outside the grid c :: fine => fine grid data which has phys-bc data stuffed in it c :: nvar => number of components in fine. But you write (3+1) times as many c :: components of data in bdry because you compute transverse c :: derivatives as well c :: hfine => delta x in transverse direction; needed for derivs c ------------------------------------------------------------------------ subroutine FORT_BDIDERIVZLO( bdry, DIMS(bdry), & lo, hi, & fine, DIMS(fine), & nvar, hfine) integer nvar REAL_T hfine(3) integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(fine) REAL_T bdry(DIMV(bdry),(3+1)*nvar) REAL_T fine(DIMV(fine), nvar) integer i,j,k,n REAL_T h(3) c ::: ------ begin functions ------- REAL_T ddxcen REAL_T ddycen REAL_T ddzcen REAL_T ddxplus,ddxminus,ddyplus,ddyminus,ddzplus,ddzminus ddxcen(i,j,k,n) = (fine(i+1,j,k,n)-fine(i-1,j,k,n))/(2*h(1)) ddycen(i,j,k,n) = (fine(i,j+1,k,n)-fine(i,j-1,k,n))/(2*h(2)) ddzcen(i,j,k,n) = (fine(i,j,k+1,n)-fine(i,j,k-1,n))/(2*h(3)) ddxplus(i,j,k,n)=(-fine(i+2,j,k,n)+4*fine(i+1,j,k,n)-3*fine(i,j,k,n)) & /(2*h(1)) ddyplus(i,j,k,n)=(-fine(i,j+2,k,n)+4*fine(i,j+1,k,n)-3*fine(i,j,k,n)) & /(2*h(2)) ddzplus(i,j,k,n)=(-fine(i,j,k+2,n)+4*fine(i,j,k+1,n)-3*fine(i,j,k,n)) & /(2*h(3)) ddxminus(i,j,k,n)=(+fine(i-2,j,k,n)-4*fine(i-1,j,k,n)+3*fine(i,j,k,n)) & /(2*h(1)) ddyminus(i,j,k,n)=(+fine(i,j-2,k,n)-4*fine(i,j-1,k,n)+3*fine(i,j,k,n)) & /(2*h(2)) ddzminus(i,j,k,n)=(+fine(i,j,k-2,n)-4*fine(i,j,k-1,n)+3*fine(i,j,k,n)) & /(2*h(3)) c ::: ------ end functions ------- k = lo(3)-1 h(1) = hfine(1) h(2) = hfine(2) h(3) = 0 do n=1,nvar c ::: ::: copy boundary values over do j=lo(2),hi(2) do i=lo(1),hi(1) bdry(i,j,k,n) = fine(i,j,k,n) enddo enddo c ::: ::: do stinking calculation of derivativ using centered difference c ::: ::: this ONLY makes sense for DIRICHLET BC. For other BC, c ::: ::: we will not use these values. c ::: ::: First, do y deriv do i=lo(1),hi(1) j=lo(2) bdry(i,j,k,n+CY*nvar) = ddyplus(i,j,k,n) do j=lo(2)+1,hi(2)-1 bdry(i,j,k,n+CY*nvar) = ddycen(i,j,k,n) enddo j=hi(2) bdry(i,j,k,n+CY*nvar) = ddyminus(i,j,k,n) enddo c ::: ::: next, do x deriv do j=lo(2),hi(2) i=lo(1) bdry(i,j,k,n+CX*nvar) = ddxplus(i,j,k,n) do i=lo(1)+1,hi(1)-1 bdry(i,j,k,n+CX*nvar) = ddxcen(i,j,k,n) enddo i=hi(1) bdry(i,j,k,n+CX*nvar) = ddxminus(i,j,k,n) enddo enddo return end c ------------------------------------------------------------------------ c :: FORT_BDIDERIVZHI : copy from Zhi face of fine fab (getting values c :: which were stuck there by the physical boundary condition routines) c :: to get the first nvar values in bdry. The following 3*nvar values c :: are gotten by computing the transverse derivative. Two formulas c :: are used: 1) on the interior a centered difference is used; c :: 2) at the end points a one-sided difference is used. No check c :: is made to check that the one-sided difference does not poke out c :: the other side of the grid. But if grids are that small, a lot c :: of things will be blowing up. c :: NOTE: only the transverse derivs are computed, so one of the c :: derivs if filled with error values c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: lo,hi => index limits of "grid". So all action takes place in cells c :: outside the grid c :: fine => fine grid data which has phys-bc data stuffed in it c :: nvar => number of components in fine. But you write (3+1) times as many c :: components of data in bdry because you compute transverse c :: derivatives as well c :: hfine => delta x in transverse direction; needed for derivs c ------------------------------------------------------------------------ subroutine FORT_BDIDERIVZHI( bdry, DIMS(bdry), & lo, hi, & fine, DIMS(fine), & nvar, hfine) integer nvar REAL_T hfine(3) integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(fine) REAL_T bdry(DIMV(bdry),(3+1)*nvar) REAL_T fine(DIMV(fine), nvar) integer i,j,k,n REAL_T h(3) c ::: ------ begin functions ------- REAL_T ddxcen REAL_T ddycen REAL_T ddzcen REAL_T ddxplus,ddxminus,ddyplus,ddyminus,ddzplus,ddzminus ddxcen(i,j,k,n) = (fine(i+1,j,k,n)-fine(i-1,j,k,n))/(2*h(1)) ddycen(i,j,k,n) = (fine(i,j+1,k,n)-fine(i,j-1,k,n))/(2*h(2)) ddzcen(i,j,k,n) = (fine(i,j,k+1,n)-fine(i,j,k-1,n))/(2*h(3)) ddxplus(i,j,k,n)=(-fine(i+2,j,k,n)+4*fine(i+1,j,k,n)-3*fine(i,j,k,n)) & /(2*h(1)) ddyplus(i,j,k,n)=(-fine(i,j+2,k,n)+4*fine(i,j+1,k,n)-3*fine(i,j,k,n)) & /(2*h(2)) ddzplus(i,j,k,n)=(-fine(i,j,k+2,n)+4*fine(i,j,k+1,n)-3*fine(i,j,k,n)) & /(2*h(3)) ddxminus(i,j,k,n)=(+fine(i-2,j,k,n)-4*fine(i-1,j,k,n)+3*fine(i,j,k,n)) & /(2*h(1)) ddyminus(i,j,k,n)=(+fine(i,j-2,k,n)-4*fine(i,j-1,k,n)+3*fine(i,j,k,n)) & /(2*h(2)) ddzminus(i,j,k,n)=(+fine(i,j,k-2,n)-4*fine(i,j,k-1,n)+3*fine(i,j,k,n)) & /(2*h(3)) c ::: ------ end functions ------- k = hi(3)+1 h(1) = hfine(1) h(2) = hfine(2) h(3) = 0 do n=1,nvar c ::: ::: copy boundary values over do j=lo(2),hi(2) do i=lo(1),hi(1) bdry(i,j,k,n) = fine(i,j,k,n) enddo enddo c ::: ::: do stinking calculation of derivativ using centered difference c ::: ::: this ONLY makes sense for DIRICHLET BC. For other BC, c ::: ::: we will not use these values. c ::: ::: First, do y deriv do i=lo(1),hi(1) j=lo(2) bdry(i,j,k,n+CY*nvar) = ddyplus(i,j,k,n) do j=lo(2)+1,hi(2)-1 bdry(i,j,k,n+CY*nvar) = ddycen(i,j,k,n) enddo j=hi(2) bdry(i,j,k,n+CY*nvar) = ddyminus(i,j,k,n) enddo c ::: ::: next, do x deriv do j=lo(2),hi(2) i=lo(1) bdry(i,j,k,n+CX*nvar) = ddxplus(i,j,k,n) do i=lo(1)+1,hi(1)-1 bdry(i,j,k,n+CX*nvar) = ddxcen(i,j,k,n) enddo i=hi(1) bdry(i,j,k,n+CX*nvar) = ddxminus(i,j,k,n) enddo enddo return end #undef SDIM #undef NUMDERIV #undef DX #undef DY #undef DZ #undef D2X #undef D2Y #undef D2Z #undef DXY #undef DXZ #undef DYZ ccseapps-2.5/CCSEApps/tensorMG/DV_3D3.mF0000644000175000017500000047264411634153073020644 0ustar amckinstryamckinstry#include #include "DivVis_F.H" #include #include "ArrayLim.H" c :::: usage: c :::: this .mF file is meant to be run through Mathematica. This converts c :::: compact symbolic expressions into fortran which is stored in a .F c :::: file. c---------------------------------------------------------------- c this is the fortran support file for the the operator c L(U) = alpha*a(x)*U - beta*Div( tau ) c c where U is the two component vector (u,v) and c tau is a three by three tensor c tau = | t_xx t_xy t_xz| c | t_xy t_yy t_yz| c | t_xz t_yz t_zz| c c t_xx = 2*mu * u_x c t_yy = 2*mu * v_y c t_zz = 2*mu * w_z c t_xy = mu*(u_y + v_x) c t_xz = mu*(u_z + w_x) c t_yz = mu*(v_z + w_y) c ::: define standard replacements used by Mathematica c ::: see file visc3d.ma c ::: <* standardrepl = { dudx[i+half ,j ,k ]->dudxe, dudx[i-1+half,j ,k ]->dudxw, dvdy[i, j+half ,k ]->dvdyn , dvdy[i, j-1+half,k ]->dvdys , dwdz[i, j ,k+half ]->dwdzt, dwdz[i, j ,k-1+half]->dwdzb, dudy[i, j +half,k]-> dudyn , dudy[i, j-1+half,k]-> dudys , dudy[i+half, j ,k]-> dudye , dudy[i-1+half,j ,k]-> dudyw , dvdx[i, j +half,k]-> dvdxn , dvdx[i, j-1+half,k]-> dvdxs , dvdx[i+half, j ,k]-> dvdxe , dvdx[i-1+half,j ,k]-> dvdxw , dudz[i ,j ,k+half ]->dudzt, dudz[i ,j ,k-1+half]->dudzb, dudz[i+half ,j ,k ]->dudze, dudz[i-1+half,j ,k ]->dudzw, dvdz[i ,j ,k+half ]->dvdzt, dvdz[i ,j ,k-1+half]->dvdzb, dvdz[i ,j+half ,k ]->dvdzn, dvdz[i ,j-1+half,k ]->dvdzs, dwdx[i+half ,j ,k ]->dwdxe, dwdx[i+half-1,j ,k ]->dwdxw, dwdx[i ,j ,k+half ]->dwdxt, dwdx[i ,j ,k+half-1]->dwdxb, dwdy[i ,j+half ,k ]->dwdyn, dwdy[i ,j+half-1,k ]->dwdys, dwdy[i ,j ,k+half ]->dwdyt, dwdy[i ,j ,k+half-1]->dwdyb, murepl1, murepl2,murepl3, tauxxdef, tauyydef,tauxydef,tauxzdef,tauyzdef, tauzzdef, vol->hx*hy*hz }; *> c ::: interface notes: c ::: 1) trander* ALWAYS have values in them, even if the cells are c ::: all covered. Might as well. These are edge located derivative c ::: values. In index space, they are located the same as the mask c ::: cells. Which is somewhat anomalous. These are edge values, after c ::: all. While the masks are cell-centered. But it seems easier c ::: at the moment. c ::: 2) the normal derivatives are evaluated in the normal fashion. c ::: 3) tangential derivatives which reach outside the rectangle DO have c ::: to check the masks. subroutine FORT_GSRB( $ u, DIMS(u), $ rhs, DIMS(rhs), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ muZ, DIMS(muZ), $ maskn,DIMS(maskn), $ fn, DIMS(fn), $ maske,DIMS(maske), $ fe, DIMS(fe), $ maskw,DIMS(maskw), $ fw, DIMS(fw), $ masks,DIMS(masks), $ fs, DIMS(fs), $ maskt,DIMS(maskt), $ ft, DIMS(ft), $ maskb,DIMS(maskb), $ fb, DIMS(fb), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ trandert,DIMS(trandert), $ tranderb,DIMS(tranderb), $ lo,hi,h,ncomp,phaseflag $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(rhs) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(muZ) integer DIMDEC(maskn) integer DIMDEC(fn) integer DIMDEC(maske) integer DIMDEC(fe) integer DIMDEC(maskw) integer DIMDEC(fw) integer DIMDEC(masks) integer DIMDEC(fs) integer DIMDEC(maskt) integer DIMDEC(ft) integer DIMDEC(maskb) integer DIMDEC(fb) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer DIMDEC(trandert) integer DIMDEC(tranderb) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) integer ncomp integer phaseflag REAL_T h(BL_SPACEDIM) REAL_T u(DIMV(u),3) REAL_T rhs(DIMV(rhs),3) REAL_T a(DIMV(a)) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) REAL_T muZ(DIMV(muZ)) integer maskn(DIMV(maskn)) REAL_T fn(DIMV(fn),3) integer maske(DIMV(maske)) REAL_T fe(DIMV(fe),3) integer maskw(DIMV(maskw)) REAL_T fw(DIMV(fw),3) integer masks(DIMV(masks)) REAL_T fs(DIMV(fs),3) integer maskt(DIMV(maskt)) REAL_T ft(DIMV(ft),3) integer maskb(DIMV(maskb)) REAL_T fb(DIMV(fb),3) c ::: for transverse derives, first 3 is for variable, second 3 is for c ::: direction of derivative. Obviously not all are used, but this is easy. REAL_T trandern(DIMV(trandern),3,3) REAL_T trandere(DIMV(trandere),3,3) REAL_T tranderw(DIMV(tranderw),3,3) REAL_T tranders(DIMV(tranders),3,3) REAL_T trandert(DIMV(trandert),3,3) REAL_T tranderb(DIMV(tranderb),3,3) integer i,j,k REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy,hz REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw REAL_T dudyn,dudys REAL_T dvdxe,dvdxw REAL_T dvdxn,dvdxs REAL_T dudzb,dudzt REAL_T dwdzt,dwdzb REAL_T dwdxb,dwdxt REAL_T dvdzb,dvdzt REAL_T dwdyb,dwdyt REAL_T dudzw,dudze REAL_T dwdxw,dwdxe REAL_T dvdzs,dvdzn REAL_T dwdys,dwdyn integer modx,mody,modz integer istart,jstart,kstart REAL_T diagu,diagv,diagw REAL_T operu,operv,operw logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) hz = h(3) if( ncomp .ne. 3 ) then write(6,*)'FORT_GSRB: bad ncomp',ncomp stop endif c ::: convert phase flag into modx and mody and modz if( phaseflag.eq.0 ) then modx = 0 mody = 0 modz = 0 elseif(phaseflag.eq.1) then modx = 1 mody = 0 modz = 0 elseif(phaseflag.eq.2) then modx = 0 mody = 1 modz = 0 elseif(phaseflag.eq.3) then modx = 1 mody = 1 modz = 0 elseif(phaseflag.eq.4) then modx = 0 mody = 0 modz = 1 elseif(phaseflag.eq.5) then modx = 1 mody = 0 modz = 1 elseif(phaseflag.eq.6) then modx = 0 mody = 1 modz = 1 elseif(phaseflag.eq.7) then modx = 1 mody = 1 modz = 1 else write(6,*)'FORT_GSRB: bad phaseflag', phaseflag stop endif c ::: cases: c ::: 0) interior. All usual derivative expressions c ::: 1-6) face but not on edge. c ::: 7-18) edge but not on corner. c ::: 19-26) corners. c ::: case 0 c ::: <* indexcond = Function[ {i,j,k}, False ] ; *> c ::: <* maskray = maskerr ; *> istart = lo(1)+1 if( mod(istart,2) .ne. modx ) istart = istart+1 jstart = lo(2)+1 if( mod(jstart,2) .ne. mody ) jstart = jstart+1 kstart = lo(3)+1 if( mod(kstart,2) .ne. modz ) kstart = kstart+1 do k=kstart,hi(3)-1,2 do j=jstart,hi(2)-1,2 do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: in interior, diagonal elements need no corrections c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo enddo c ::: case 1, top face c ::: <* indexcond = Function[{i,j,k},k>0] ; *> c ::: <* maskray = maskt ; *> c ::: <* tranderiv = trandert ; *> k=hi(3) if( mod(k,2) .eq. modz ) then do j=jstart,hi(2)-1,2 do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 2, bottom face c ::: <* indexcond = Function[{i,j,k},k<0] ; *> c ::: <* maskray = maskb ; *> c ::: <* tranderiv = tranderb ; *> k=lo(3) if( mod(k,2).eq.modz) then do j=jstart,hi(2)-1,2 do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 3, west face c ::: <* indexcond = Function[{i,j,k},i<0] ; *> c ::: <* maskray = maskw ; *> c ::: <* tranderiv = tranderw ; *> i = lo(1) if( mod(i,2) .eq. modx) then do k=kstart,hi(3)-1,2 do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 4, east face c ::: <* indexcond = Function[{i,j,k},i>0] ; *> c ::: <* maskray = maske ; *> c ::: <* tranderiv = trandere ; *> i = hi(1) if( mod(i,2).eq.modx) then do k=kstart,hi(3)-1,2 do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 5, north face c ::: <* indexcond = Function[{i,j,k},j>0] ; *> c ::: <* maskray = maskn ; *> c ::: <* tranderiv = trandern ; *> j = hi(2) if( mod(j,2).eq.mody) then do k=kstart,hi(3)-1,2 do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 6, south face c ::: <* indexcond = Function[{i,j,k},j<0] ; *> c ::: <* maskray = masks ; *> c ::: <* tranderiv = tranders ; *> j = lo(2) if( mod(j,2).eq.mody) then do k=kstart,hi(3)-1,2 do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo enddo endif c ::: case 7, top-north edge c ::: <* indexcond = Function[{i,j,k},(k>0||j>0)] ; *> c ::: <* Clear[maskray] *> c ::: <* Clear[tranderiv] *> k=hi(3) j=hi(2) if( mod(k,2).eq.modz .and. mod(j,2).eq.mody ) then do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,1)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 8, top-south edge c ::: <* indexcond = Function[{i,j,k},(k>0||j<0)] ; *> k=hi(3) j=lo(2) if( mod(k,2).eq.modz .and. mod(j,2).eq.mody) then do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 9, top-west edge c ::: <* indexcond = Function[{i,j,k},(k>0||i<0)] ; *> k=hi(3) i=lo(1) if( mod(k,2).eq.modz .and. mod(i,2).eq.modx ) then do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 10, top-east edge c ::: <* indexcond = Function[{i,j,k},(k>0||i>0)] ; *> k=hi(3) i=hi(1) if( mod(k,2).eq.modz .and. mod(i,2).eq.modx) then do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskt ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 11, bottom-north edge c ::: <* indexcond = Function[{i,j,k},(k<0||j>0)] ; *> k=lo(3) j=hi(2) if( mod(k,2).eq.modz .and. mod(j,2).eq.mody) then do i=istart,hi(1)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 12, bottom-south edge c ::: <* indexcond = Function[{i,j,k},(k<0||j<0)] ; *> k=lo(3) j=lo(2) if( mod(k,2).eq.modz .and. mod(j,2).eq.mody ) then do i=istart,hi(1)-1 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskray] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskray] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskray] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 13, bottom-west edge c ::: <* indexcond = Function[{i,j,k},(k<0||i<0)] ; *> k=lo(3) i=lo(1) if( mod(k,2).eq.modz .and. mod(i,2).eq.modx) then do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskray] *> <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 14, bottom-east edge c ::: <* indexcond = Function[{i,j,k},(k<0||i>0)] ; *> k=lo(3) i=hi(1) if( mod(k,2).eq.modz .and. mod(i,2).eq.modx ) then do j=jstart,hi(2)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskray] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskray] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskray] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskray] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskb ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 15, east-north edge c ::: <* indexcond = Function[{i,j,k},(j>0||i>0)] ; *> j=hi(2) i=hi(1) if( mod(j,2).eq.mody .and. mod(i,2).eq.modx ) then do k=kstart,hi(3)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 16, east-south edge c ::: <* indexcond = Function[{i,j,k},(j<0||i>0)] ; *> j=lo(2) i=hi(1) if( mod(j,2).eq.mody .and. mod(i,2).eq.modx ) then do k=kstart,hi(3)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 17, west-north edge c ::: <* indexcond = Function[{i,j,k},(j>0||i<0)] ; *> j=hi(2) i=lo(1) if( mod(j,2).eq.mody .and. mod(i,2).eq.modx ) then do k=kstart,hi(3)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 18, west-south edge c ::: <* indexcond = Function[{i,j,k},(j<0||i<0)] ; *> j=lo(2) i=lo(1) if( mod(j,2).eq.mody .and. mod(i,2).eq.modx ) then do k=kstart,hi(3)-1,2 c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,tranderiv,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,tranderiv,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,tranderiv,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,tranderiv,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskray] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,tranderiv,1,3,indexcond,maskray] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskray] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,tranderiv,2,3,indexcond,maskray] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fw(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fw(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) enddo endif c ::: case 19, top-north-east corner c ::: <* indexcond = Function[{i,j,k},(k>0||j>0||i>0)] ; *> k=hi(3) j=hi(2) i=hi(1) if( mod(k,2).eq.modz .and. mod(j,2).eq.mody .and. mod(i,2).eq.modx ) then c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 20, top-north-west corner c ::: <* indexcond = Function[{i,j,k},(k>0||j>0||i<0)] ; *> i=lo(1) j=hi(2) k=hi(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 21, top-south-east corner c ::: <* indexcond = Function[{i,j,k},(k>0||j<0||i>0)] ; *> i=hi(1) j=lo(2) k=hi(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 22, top-south-west corner c ::: <* indexcond = Function[{i,j,k},(k>0||j<0||i<0)] ; *> i=lo(1) j=lo(2) k=hi(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskt ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskt ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskt ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskt ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskt(i,j,k+1) .gt. 0 ) then diagu = diagu -ft(i,j,k,1)*(beta*muZ(i,j,1+k)/hz**2) diagv = diagv -ft(i,j,k,2)*(beta*muZ(i,j,1+k)/hz**2) diagw = diagw -ft(i,j,k,3)*2.d0*beta*muZ(i,j,1+k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 23, bottom-north-east corner c ::: <* indexcond = Function[{i,j,k},(k<0||j>0||i>0)] ; *> i=hi(1) j=hi(2) k=lo(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 24, bottom-north-west corner c ::: <* indexcond = Function[{i,j,k},(k<0||j>0||i<0)] ; *> i=lo(1) j=hi(2) k=lo(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,maskn ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,maskn ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,maskn ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,maskn ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( maskn(i,j+1,k) .gt. 0 ) then diagu = diagu -fn(i,j,k,1)*(beta*muY(i,1+j,k)/hy**2) diagv = diagv -fn(i,j,k,2)*2.d0*beta*muY(i,1+j,k)/hy**2 diagw = diagw -fn(i,j,k,3)*(beta*muY(i,1+j,k)/hy**2) endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 25, bottom-south-east corner c ::: <* indexcond = Function[{i,j,k},(k<0||j<0||i>0)] ; *> i=hi(1) j=lo(2) k=lo(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maske ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maske ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maske ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maske ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif if( maske(i+1,j,k) .gt. 0 ) then diagu = diagu -fe(i,j,k,1)*2.d0*beta*muX(1+i,j,k)/hx**2 diagv = diagv -fe(i,j,k,2)*(beta*muX(1+i,j,k)/hx**2) diagw = diagw -fe(i,j,k,3)*(beta*muX(1+i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif c ::: case 26, bottom-south-west corner c ::: <* indexcond = Function[{i,j,k},(k<0||j<0||i<0)] ; *> i=lo(1) j=lo(2) k=lo(3) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody .and. mod(k,2).eq.modz ) then c ::: get expressions for normal derivatives dudxe = <* FA[ dudx[i+half,j,k] //. allDerivAllUV ] *> dudxw = <* FA[ dudx[i-1+half,j,k] //. allDerivAllUV ] *> dvdyn = <* FA[ dvdy[i,j+half,k] //. allDerivAllUV ] *> dvdys = <* FA[ dvdy[i,j-1+half,k] //. allDerivAllUV ] *> dwdzt = <* FA[ dwdz[i,j,k+half] //. allDerivAllUV ] *> dwdzb = <* FA[ dwdz[i,j,k-1+half] //. allDerivAllUV ] *> dudyn = <* FA[ dudy[i,j +half,k] //. allDerivAllUV ] *> dudys = <* FA[ dudy[i,j-1+half,k] //. allDerivAllUV ] *> dvdxe = <* FA[ dvdx[i+half,j,k] //. allDerivAllUV ] *> dvdxw = <* FA[ dvdx[i-1+half,j,k] //. allDerivAllUV ] *> dudzt = <* FA[ dudz[i ,j,k +half] //. allDerivAllUV ] *> dudzb = <* FA[ dudz[i ,j,k-1+half] //. allDerivAllUV ] *> dvdzb = <* FA[ dvdz[i, j, k-1+half] //. allDerivAllUV ] *> dvdzt = <* FA[ dvdz[i, j, k +half] //. allDerivAllUV ] *> dwdxw = <* FA[ dwdx[i-1+half,j,k ] //. allDerivAllUV ] *> dwdxe = <* FA[ dwdx[i +half,j,k ] //. allDerivAllUV ] *> dwdys = <* FA[ dwdy[i,j-1+half,k ] //. allDerivAllUV ] *> dwdyn = <* FA[ dwdy[i,j +half,k ] //. allDerivAllUV ] *> c ::: get expressions for tangential derivatives <*altgen[dvdxn,i,j +half,k,dvdx,dvdxalt,trandern ,2,1,indexcond,maskw ] *> <*altgen[dvdxs,i,j-1+half,k,dvdx,dvdxalt,tranders ,2,1,indexcond,maskw ] *> <*altgen[dwdxb,i,j,k-1+half,dwdx,dwdxalt,tranderb ,3,1,indexcond,maskw ] *> <*altgen[dwdxt,i,j,k +half,dwdx,dwdxalt,trandert ,3,1,indexcond,maskw ] *> <*altgen[dudye,i +half,j,k,dudy,dudyalt,trandere ,1,2,indexcond,masks ] *> <*altgen[dudyw,i-1+half,j,k,dudy,dudyalt,tranderw ,1,2,indexcond,masks ] *> <*altgen[dwdyb,i,j,k-1+half,dwdy,dwdyalt,tranderb ,3,2,indexcond,masks ] *> <*altgen[dwdyt,i,j,k +half,dwdy,dwdyalt,trandert ,3,2,indexcond,masks ] *> <*altgen[dudzw,i-1+half,j,k,dudz,dudzalt,tranderw ,1,3,indexcond,maskb ] *> <*altgen[dudze,i +half,j,k,dudz,dudzalt,trandere ,1,3,indexcond,maskb ] *> <*altgen[dvdzs,i,j-1+half,k,dvdz,dvdzalt,tranders ,2,3,indexcond,maskb ] *> <*altgen[dvdzn,i,j +half,k,dvdz,dvdzalt,trandern ,2,3,indexcond,maskb ] *> c ::: get diagonal element diagu = alpha*a(i,j,k)+2.d0*beta*muX(i,j,k)/hx**2+2.d0*beta*muX(1 & +i,j,k)/hx**2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagv = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+2.d0*beta*muY(i,j,k)/hy**2+2.d0*beta*muY(i,1+ & j,k)/hy**2+beta*muZ(i,j,k)/hz**2+beta*muZ(i,j,1+k & )/hz**2 diagw = alpha*a(i,j,k)+beta*muX(i,j,k)/hx**2+beta*muX(1+i,j,k)/hx & **2+beta*muY(i,j,k)/hy**2+beta*muY(i,1+j,k)/hy**2 & +2.d0*beta*muZ(i,j,k)/hz**2+2.d0*beta*muZ(i,j,1+k & )/hz**2 c ::: correct diagonal elements for ghost cell contrib if( maskb(i,j,k-1) .gt. 0 ) then diagu = diagu -fb(i,j,k,1)*(beta*muZ(i,j,k)/hz**2) diagv = diagv -fb(i,j,k,2)*(beta*muZ(i,j,k)/hz**2) diagw = diagw -fb(i,j,k,3)*2.d0*beta*muZ(i,j,k)/hz**2 endif if( masks(i,j-1,k) .gt. 0 ) then diagu = diagu -fs(i,j,k,1)*(beta*muY(i,j,k)/hy**2) diagv = diagv -fs(i,j,k,2)*2.d0*beta*muY(i,j,k)/hy**2 diagw = diagw -fs(i,j,k,3)*(beta*muY(i,j,k)/hy**2) endif if( maskw(i-1,j,k) .gt. 0 ) then diagu = diagu -fw(i,j,k,1)*2.d0*beta*muX(i,j,k)/hx**2 diagv = diagv -fw(i,j,k,2)*(beta*muX(i,j,k)/hx**2) diagw = diagw -fw(i,j,k,3)*(beta*muX(i,j,k)/hx**2) endif c ::: evaluate expression operu = <* FA[ (alpha*a[i,j,k]*u[i,j,k,1] - beta* ( hy*hz*(tauxx[i+half ,j ,k]- tauxx[i-1+half,j ,k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k] )+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operv = <* FA[ (alpha*a[i,j,k]*u[i,j,k,2] - beta* ( hy*hz*(tauxy[i+half ,j ,k]- tauxy[i-1+half,j ,k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k] )+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> operw = <* FA[ (alpha*a[i,j,k]*u[i,j,k,3] - beta* ( hy*hz*(tauxz[i+half ,j ,k]- tauxz[i-1+half,j ,k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k] )+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol ) //. standardrepl ] *> c ::: do relaxation u(i,j,k,1) = (rhs(i,j,k,1)-operu)/diagu+u(i,j,k,1) u(i,j,k,2) = (rhs(i,j,k,2)-operv)/diagv+u(i,j,k,2) u(i,j,k,3) = (rhs(i,j,k,3)-operw)/diagw+u(i,j,k,3) endif return end ccseapps-2.5/CCSEApps/tensorMG/DivVis_F.H0000644000175000017500000002572211634153073021207 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _DivVis_F_H_ #define _DivVis_F_H_ "$Id" #include #if defined(BL_LANG_FORT) # if (BL_SPACEDIM==2) # define FORT_DVAPPLY dvapply2d # define FORT_DVFLUX dvflux2d # define FORT_GSRB gsrbvisc2d # define FORT_APPLYBC mcapplybc2dgen # define FORT_RESIDL mcresid2dgen # define FORT_AVERAGECC mcaveragecc2dgen # define FORT_AVERAGEEC mcaverageec2dgen # define FORT_HARMONIC_AVERAGEEC mcharaverageec2dgen # elif(BL_SPACEDIM==3) # define FORT_DVAPPLY dvapply3d # define FORT_DVFLUX dvflux3d # define FORT_GSRB gsrbvisc3d # define FORT_APPLYBC mcapplybc3dgen # define FORT_RESIDL mcresid3dgen # define FORT_AVERAGECC mcaveragecc3dgen # define FORT_AVERAGEEC mcaverageec3dgen # define FORT_HARMONIC_AVERAGEEC mcharaverageec3dgen # endif #else #if (BL_SPACEDIM == 2) # if defined(BL_FORT_USE_UPPERCASE) # define FORT_DVAPPLY DVAPPLY2D # define FORT_DVFLUX DVFLUX2D # define FORT_GSRB GSRBVISC2D # define FORT_APPLYBC MCAPPLYBC2DGEN # define FORT_RESIDL MCRESID2DGEN # define FORT_AVERAGECC MCAVERAGECC2DGEN # define FORT_AVERAGEEC MCAVERAGEEC2DGEN # define FORT_HARMONIC_AVERAGEEC MCHARAVERAGEEC2DGEN # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_DVAPPLY dvapply2d # define FORT_DVFLUX dvflux2d # define FORT_GSRB gsrbvisc2d # define FORT_APPLYBC mcapplybc2dgen # define FORT_RESIDL mcresid2dgen # define FORT_AVERAGECC mcaveragecc2dgen # define FORT_AVERAGEEC mcaverageec2dgen # define FORT_HARMONIC_AVERAGEEC mcharaverageec2dgen # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_DVAPPLY dvapply2d_ # define FORT_DVFLUX dvflux2d_ # define FORT_GSRB gsrbvisc2d_ # define FORT_APPLYBC mcapplybc2dgen_ # define FORT_RESIDL mcresid2dgen_ # define FORT_AVERAGECC mcaveragecc2dgen_ # define FORT_AVERAGEEC mcaverageec2dgen_ # define FORT_HARMONIC_AVERAGEEC mcharaverageec2dgen_ # endif #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_DVAPPLY DVAPPLY3D # define FORT_DVFLUX DVFLUX3D # define FORT_GSRB GSRBVISC3D # define FORT_APPLYBC MCAPPLYBC3DGEN # define FORT_RESIDL MCRESID3DGEN # define FORT_AVERAGECC MCAVERAGECC3DGEN # define FORT_AVERAGEEC MCAVERAGEEC3DGEN # define FORT_HARMONIC_AVERAGEEC MCHARAVERAGEEC3DGEN # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_DVAPPLY dvapply3d # define FORT_DVFLUX dvflux3d # define FORT_GSRB gsrbvisc3d # define FORT_APPLYBC mcapplybc3dgen # define FORT_RESIDL mcresid3dgen # define FORT_AVERAGECC mcaveragecc3dgen # define FORT_AVERAGEEC mcaverageec3dgen # define FORT_HARMONIC_AVERAGEEC mcharaverageec3dgen # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_DVAPPLY dvapply3d_ # define FORT_DVFLUX dvflux3d_ # define FORT_GSRB gsrbvisc3d_ # define FORT_APPLYBC mcapplybc3dgen_ # define FORT_RESIDL mcresid3dgen_ # define FORT_AVERAGECC mcaveragecc3dgen_ # define FORT_AVERAGEEC mcaverageec3dgen_ # define FORT_HARMONIC_AVERAGEEC mcharaverageec3dgen_ # endif #endif #include extern "C" { void FORT_AVERAGECC ( Real* crseX, ARLIM_P(crseX_lo), ARLIM_P(crseX_hi), const Real* fineX, ARLIM_P(fineX_lo), ARLIM_P(fineX_hi), const int *tlo, const int *thi, const int *nc ); void FORT_RESIDL ( Real* res , ARLIM_P(res_lo), ARLIM_P(res_hi), const Real* rhs, ARLIM_P(rhs_lo), ARLIM_P(rhs_hi), const Real* phi, ARLIM_P(phi_lo), ARLIM_P(phi_hi), const int* lo, const int* hi, const int* nc ); void FORT_AVERAGEEC ( Real* crseX, ARLIM_P(crseX_lo), ARLIM_P(crseX_hi), const Real* fineX, ARLIM_P(fineX_lo), ARLIM_P(fineX_hi), const int *tlo, const int *thi, const int *nc, const int *axis ); void FORT_HARMONIC_AVERAGEEC ( Real* crseX, ARLIM_P(crseX_lo), ARLIM_P(crseX_hi), const Real* fineX, ARLIM_P(fineX_lo), ARLIM_P(fineX_hi), const int *tlo, const int *thi, const int *nc, const int *axis ); void FORT_DVAPPLY( const Real*u, ARLIM_P(ulo), ARLIM_P(uhi), const Real*alpha, const Real*beta, const Real*a, ARLIM_P(alo), ARLIM_P(ahi), const Real*muX, ARLIM_P(muXlo), ARLIM_P(muXhi), const Real*muY, ARLIM_P(muYlo), ARLIM_P(muYhi), #if (BL_SPACEDIM > 2) const Real*muZ, ARLIM_P(muZlo), ARLIM_P(muZhi), #endif Real*out, ARLIM_P(outlo), ARLIM_P(outhi), const int*maskn, ARLIM_P(masknlo), ARLIM_P(masknhi), const int*maske, ARLIM_P(maskelo), ARLIM_P(maskehi), const int*maskw, ARLIM_P(maskwlo), ARLIM_P(maskwhi), const int*masks, ARLIM_P(maskslo), ARLIM_P(maskshi), #if (BL_SPACEDIM > 2) const int*maskt, ARLIM_P(masktlo), ARLIM_P(maskthi), const int*maskb, ARLIM_P(maskblo), ARLIM_P(maskbhi), #endif const Real*trandern, ARLIM_P(trandernlo),ARLIM_P(trandernhi), const Real*trandere, ARLIM_P(tranderelo),ARLIM_P(tranderehi), const Real*tranderw, ARLIM_P(tranderwlo),ARLIM_P(tranderwhi), const Real*tranders, ARLIM_P(tranderslo),ARLIM_P(trandershi), #if (BL_SPACEDIM > 2) const Real*trandert, ARLIM_P(trandertlo),ARLIM_P(tranderthi), const Real*tranderb, ARLIM_P(tranderblo),ARLIM_P(tranderbhi), #endif const int* lo, const int* hi, const Real* h); void FORT_DVFLUX( const Real*u, ARLIM_P(ulo), ARLIM_P(uhi), const Real*alpha, const Real*beta, const Real*a, ARLIM_P(alo), ARLIM_P(ahi), const Real*muX, ARLIM_P(muXlo), ARLIM_P(muXhi), const Real*muY, ARLIM_P(muYlo), ARLIM_P(muYhi), #if BL_SPACEDIM>2 const Real*muZ, ARLIM_P(muZlo), ARLIM_P(muZhi), #endif Real*xflux, ARLIM_P(xfluxlo), ARLIM_P(xfluxhi), Real*yflux, ARLIM_P(yfluxlo), ARLIM_P(yfluxhi), #if BL_SPACEDIM>2 Real*zflux, ARLIM_P(zfluxlo), ARLIM_P(zfluxhi), #endif const int*maskn, ARLIM_P(masknlo), ARLIM_P(masknhi), const int*maske, ARLIM_P(maskelo), ARLIM_P(maskehi), const int*maskw, ARLIM_P(maskwlo), ARLIM_P(maskwhi), const int*masks, ARLIM_P(maskslo), ARLIM_P(maskshi), #if BL_SPACEDIM>2 const int*maskt, ARLIM_P(masktlo), ARLIM_P(maskthi), const int*maskb, ARLIM_P(maskblo), ARLIM_P(maskbhi), #endif const Real*trandern, ARLIM_P(trandernlo),ARLIM_P(trandernhi), const Real*trandere, ARLIM_P(tranderelo),ARLIM_P(tranderehi), const Real*tranderw, ARLIM_P(tranderwlo),ARLIM_P(tranderwhi), const Real*tranders, ARLIM_P(tranderslo),ARLIM_P(trandershi), #if BL_SPACEDIM>2 const Real*trandert, ARLIM_P(trandertlo),ARLIM_P(tranderthi), const Real*tranderb, ARLIM_P(tranderblo),ARLIM_P(tranderbhi), #endif const int* lo, const int* hi, const Real* h); void FORT_GSRB( Real* u, ARLIM_P(ulo), ARLIM_P(uhi), const Real* rhs, ARLIM_P(rhslo), ARLIM_P(rhshi), Real* alpha, Real* beta, const Real* a, ARLIM_P(alo), ARLIM_P(ahi), const Real* muX, ARLIM_P(muXlo), ARLIM_P(muXhi), const Real* muY, ARLIM_P(muYlo), ARLIM_P(muYhi), #if BL_SPACEDIM>2 const Real* muZ, ARLIM_P(muZlo), ARLIM_P(muZhi), #endif const int* maskn, ARLIM_P(masknlo), ARLIM_P(masknhi), const Real* fn, ARLIM_P(fnlo), ARLIM_P(fnhi), const int* maske, ARLIM_P(maskelo), ARLIM_P(maskehi), const Real* fe, ARLIM_P(felo), ARLIM_P(fehi), const int* maskw, ARLIM_P(maskwlo), ARLIM_P(maskwhi), const Real* fw, ARLIM_P(fwlo), ARLIM_P(fwhi), const int* masks, ARLIM_P(maskslo), ARLIM_P(maskshi), const Real* fs, ARLIM_P(fslo), ARLIM_P(fshi), #if BL_SPACEDIM>2 const int* maskt, ARLIM_P(masktlo), ARLIM_P(maskthi), const Real* ft, ARLIM_P(ftlo), ARLIM_P(fthi), const int* maskb, ARLIM_P(maskblo), ARLIM_P(maskbhi), const Real* fb, ARLIM_P(fblo), ARLIM_P(fbhi), #endif const Real* trandern, ARLIM_P(trandernlo), ARLIM_P(trandernhi), const Real* trandere, ARLIM_P(tranderelo), ARLIM_P(tranderehi), const Real* tranderw, ARLIM_P(tranderwlo), ARLIM_P(tranderwhi), const Real* tranders, ARLIM_P(tranderslo), ARLIM_P(trandershi), #if BL_SPACEDIM>2 const Real* trandert, ARLIM_P(trandertlo), ARLIM_P(tranderthi), const Real* tranderb, ARLIM_P(tranderblo), ARLIM_P(tranderbhi), #endif const int* lo, const int* hi, const Real* h, int &nc, int &phaseflag); void FORT_APPLYBC( const int *flagden, // 1 if want values in den const int *flagbc, // 1 for inhomogeneous const int *maxorder, // maxorder of interpolant Real *phi, ARLIM_P(phi_lo), ARLIM_P(phi_hi), const int *cdir, const int *bct, const Real *bcl, const Real *bcval, ARLIM_P(bcval_lo), ARLIM_P(bcval_hi), #if BL_SPACEDIM==2 const int *mask, ARLIM_P(mask_lo), ARLIM_P(mask_hi), const int *maskp, ARLIM_P(maskp_lo), ARLIM_P(maskp_hi), const int *maskm, ARLIM_P(maskm_lo), ARLIM_P(maskm_hi), #elif BL_SPACEDIM==3 const int *maskn, ARLIM_P(maskn_lo), ARLIM_P(maskn_hi), const int *maske, ARLIM_P(maske_lo), ARLIM_P(maske_hi), const int *maskw, ARLIM_P(maskw_lo), ARLIM_P(maskw_hi), const int *masks, ARLIM_P(masks_lo), ARLIM_P(masks_hi), const int *maskt, ARLIM_P(maskt_lo), ARLIM_P(maskt_hi), const int *maskb, ARLIM_P(maskb_lo), ARLIM_P(maskb_hi), #endif Real *den, ARLIM_P(den_lo), ARLIM_P(den_hi), const Real *exttd, ARLIM_P(exttd_lo), ARLIM_P(exttd_hi), Real *tander, ARLIM_P(tander_lo),ARLIM_P(tander_hi), const int *lo, const int *hi, const int *nc, const Real *h ); } #endif #endif ccseapps-2.5/CCSEApps/tensorMG/MCLinOp.H0000644000175000017500000002745311634153073021002 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MCLINOP_H_ #define _MCLINOP_H_ // // $Id: MCLinOp.H,v 1.10 2001/08/01 21:51:07 lijewski Exp $ // #include #include #include #include #include #include #include #include enum MCBC_Mode { MCHomogeneous_BC = 0, MCInhomogeneous_BC }; //@Man: /*@Memo: A MCLinOp is a virtual base class for general linear operators capable of acting on multicomponent MultiFabs. Eventually, this should be merged back into LinOp. All implementation and access functions are designed to make a MCLinOp object useful for representing and solving a set of linear equations on a union of rectangles in 2D or 3D. */ /*@Doc: A MCLinOp contains all the information necessary to construct and maintain a linear operator which acts on a cell-centered MultiFab. It is a virtual base class, and therefore cannot itself be instantiated. The virtual functions implement "apply" and "smooth" operators (for the internal nodes), and therefore determine the mathematical character of the operator. MCLinOp, on the other hand, determines the implementation, filling ghost cells and creating coarsened versions of the domain and operator, etc. necessary for solving linear systems. MCLinOp is designed specifically for representing discrete approximations to partial differential operators. It requires a BndryData object, which maintains ghost cell data surrounding each rectangle in the domain, as well as position and boundary condition type specifiers. It also requires a (vector/scalar) grid spacing. On levels above the base level, MCLinOp internally recognizes adjacent domain rectangles (using methods similar to those in the BndryData class) and when applying boundary conditions (filling ghost cell regions) will give preference to "valid" data (i.e. ghost cells covered by adjacent grids are filled with the corresponding data from the interior of that adjacent grid rather than via the auxiliary boundary instructions). A MCLinOp constructs a set of "levels", which are useful for linear solution methods such as multigrid. On each grid, a new level is created by uniformly coarsening the grid structure by a factor of two in each coordinate direction (and then allocating and initializing any internal data necessary--new level grid spacing, for example). A MCLinOp can fill boundary ghost cells, compute a "norm" and coordinate the "apply" and "smooth" operations at each level. Note that there are the same number of levels on each grid in the MCLinOp's domain. If a boundary type specifier indicates the type "BndryData:: LO_DIRICHLET", the ghost cells not covered by adjacent grids are filled on demand by a polynomial interpolant (of settable order) to compute the value specified in the BndryData FabSets along the edge of the grid boxes. A value is put into the ghost cell of the input multifab that can be assumed to exist outside the domain, at equal spacing with the rest of the nodes. "BndryData::LO_NEUMANN" conditions result in ghost cells filled by second order extrapolation, and results in again filling the ghost cell with a value appropriate for application in a constant spacing cell-centered discretization. The order of the interpolant is set by default in this class to 2, which is compatible with most simple algebraic relaxation methods for linear systems based on numerical PDE's. The interpolant can be queried/set via member functions, and is applied uniformly over the domain. The boundary location is specified as a distance from the wall of the grid block, and is given in the same units that the grid spacing, h, is specified. All the member functions of MCLinOp which interact directly with the apply() member take a MCBC_Mode flag. The BC_mode can be either MCHomogeneous_BC, or MCInhomogeneous_BC. It is a strict requirement of the linear operator that MCLinOp::apply(out,in,level,bc_mode=MCHomogeneous_BC) acting on in=0 returns out=0. */ class MCLinOp { public: // //@ManDoc: allocate a MCLinOp for this box array, boundary and (uniform) spacing info // MCLinOp (const BndryData& mgb, const Real _h); // //@ManDoc: allocate MCLinOp for this boxArray, boundary data and spacing array info // MCLinOp (const BndryData& mgb, const Real* _h); // //@ManDoc: alocate a MCLinOp, pull level structure from _Lp at level // MCLinOp (const MCLinOp& _Lp, int level); // //@ManDoc: destructor // virtual ~MCLinOp (); // //@ManDoc: applies level MCLinOp to "in", returns "out", uses BC_mode flag // void apply (MultiFab& out, MultiFab& in, int level = 0, MCBC_Mode bc_mode = MCInhomogeneous_BC); // //@ManDoc: fills level boundary cells using BC_mode flag, int. BC data if reqd // void applyBC (MultiFab& inout, int level = 0, MCBC_Mode bc_mode = MCInhomogeneous_BC); // //@ManDoc: compute the level residual = rhsL - L(solnL) // void residual (MultiFab& residL, const MultiFab& rhsL, MultiFab& solnL, int level = 0, MCBC_Mode bc_mode = MCInhomogeneous_BC); // //@ManDoc: smooth the level system L(solnL)=rhsL // void smooth (MultiFab& solnL, const MultiFab& rhsL, int level = 0, MCBC_Mode bc_mode = MCInhomogeneous_BC); // //@ManDoc: Compute the norm of "in" // Real norm (const MultiFab& in, int level = 0) const; // //@ManDoc: return the boundary data object // const BndryData& bndryData () const; // //@ManDoc: set the boundary data object // void bndryData (const BndryData& bd); // //@ManDoc: return the box array // const BoxArray& boxArray (int level = 0) const; // //@ManDoc: return the number of grids // int numGrids () const; // //@ManDoc: return the number of levels // int numLevels () const; // //@ManDoc: return the order of the boundary condition interpolant // int maxOrder () const; // //@ManDoc: set the order of the boundary condition interpolant // int maxOrder (int maxorder_); // //@ManDoc: construct/allocate internal data necessary for adding a new level // virtual void prepareForLevel (int level); // //@ManDoc: remove internal data necessary for a level and all higher // virtual void clearToLevel (int level); // //@ManDoc: return number of components. This is virtual since only the derived knows // virtual int numberComponents () = 0; // //@ManDoc: number of relaxation phases. Only derived class knows. // virtual int numberPhases () = 0; // //@ManDoc: output the operator to an ASCII stream // friend std::ostream& operator<< (std::ostream& os, const MCLinOp& lp); // //@ManDoc: compute the number of components required in BCRec. // static int bcComponentsNeeded(); protected: // //@ManDoc: number of components // int numcomp; // //@ManDoc: number of relaxation phases // int numphase; // //@ManDoc: virtual to apply the level operator to the internal nodes of "in", return result in "out" // virtual void Fapply (MultiFab& out, const MultiFab& in, int level) = 0; // //@ManDoc: virtual to carry out the level smoothing operation for L(solnL)=rhsL on internal nodes. Modify solnL in place. // virtual void Fsmooth (MultiFab& solnL, const MultiFab& rhsL, int level, int phaseflag) = 0; protected: // //@ManDoc: build coefficients at coarser level by interpolating "fine" (builds in appropriate node/cell centering) // void makeCoefficients (MultiFab& crse, const MultiFab& fine, int level); // //@ManDoc: initialize MCLinOp internal data // static void initialize (); // //@ManDoc: Helper functin for object construction // void initConstruct (const Real* _h); // //@ManDoc: Array (on level) of Tuples (on dimension) of grid spacings // Array< Tuple > h; // //@ManDoc: Array (on level) of pointers to BoxArray's of MCLinOp's domain // Array< BoxArray > gbox; // //@ManDoc: Array (on level) of pointers to BndryRegisters along each grid for scratch data required to modify internal stencil on boundary // Array< CpClassPtr< BndryRegister > > undrrelxr; // //@ManDoc: Array (on level) of pointers to BndryRegisters along each grid for tangential derivative data // Array< CpClassPtr< BndryRegister > > tangderiv; // //@ManDoc: Array (on level) of Arrays (on grid) of Arrays (on orientation) of pointers to Masks for whether boundary Fabs are covered, not_covered, outside_domain // Array< Array< Array< Mask*> > > maskvals; // //@ManDoc: boundary data class // BndryData bgb; // //@ManDoc: Array (on level) of geometry objects. Needed for determining whether stuff intersects on periodic domains // Array< Geometry > geomarray; // //@ManDoc: flag (=1 if use harmonic averaged interpolation for coefficients, =0 is arithmetic averaging) // int harmavg; // //@ManDoc: flag (>0 is verbose execution) // int verbose; // //@ManDoc: maximum interpolation order used for constructing Dirichlet ghost node values // int maxorder; // //@ManDoc: flag (=1 if internal data initialized) // static bool initialized; // //@ManDoc: default value for harm_avg // static int def_harmavg; // //@ManDoc: default value for verbose // static int def_verbose; // //@ManDoc: default maximum BC interpolant order // static int def_maxorder; }; inline const BndryData& MCLinOp::bndryData () const { return bgb; } inline void MCLinOp::bndryData (const BndryData& bd) { BL_ASSERT(gbox[0] == bd.boxes()); bgb = bd; } inline int MCLinOp::numLevels () const { return h.size(); } inline const BoxArray& MCLinOp::boxArray (int level) const { BL_ASSERT(level < numLevels()); return gbox[level]; } inline int MCLinOp::numGrids () const { return gbox[0].size(); } inline int MCLinOp::maxOrder () const { return maxorder; } inline int MCLinOp::maxOrder (int maxorder_) { BL_ASSERT(maxorder_ >= 2); maxorder_ = (maxorder_ < 2 ? 2 : maxorder_ ); int omaxorder = maxorder; maxorder = maxorder_; return omaxorder; } #endif /*_MCLINOP_H_*/ ccseapps-2.5/CCSEApps/tensorMG/MCCGSolver.cpp0000644000175000017500000002777511634153073022047 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MCCGSolver.cpp,v 1.13 2001/10/05 07:19:55 marc Exp $ // #include #include #include #include #include #include #include int MCCGSolver::initialized = 0; int MCCGSolver::def_maxiter = 40; int MCCGSolver::def_verbose = 0; int MCCGSolver::def_isExpert = 0; double MCCGSolver::def_unstable_criterion = 10.; void MCCGSolver::initialize () { ParmParse pp("cg"); pp.query("maxiter", def_maxiter); pp.query("v", def_verbose); pp.query("isExpert", def_isExpert); if (ParallelDescriptor::IOProcessor() && def_verbose) { std::cout << "def_maxiter=" << def_maxiter << '\n'; std::cout << "def_unstable_criterion=" << def_unstable_criterion << '\n'; std::cout << "def_isExpert=" << def_isExpert << '\n'; } initialized = 1; } MCCGSolver::MCCGSolver (MCLinOp& _Lp, bool _use_mg_precond, int _lev) : isExpert((int)def_isExpert), Lp(_Lp), lev(_lev), use_mg_precond(_use_mg_precond), mg_precond(NULL) { if (!initialized) initialize(); maxiter = def_maxiter; verbose = def_verbose; set_mg_precond(); } void MCCGSolver::set_mg_precond () { delete mg_precond; if (use_mg_precond) { mg_precond = new MCMultiGrid(Lp); mg_precond->setNumIter(1); } } MCCGSolver::~MCCGSolver () { delete mg_precond; } Real MCCGSolver::norm (const MultiFab& res) { // // Compute max-norm. // const int p = 0; Real restot = 0.0; Real resk = 0.0; const int ncomp = res.nComp(); const BoxArray& gbox = res.boxArray(); for (MFIter mfi(res); mfi.isValid(); ++mfi) { BL_ASSERT(mfi.validbox() == gbox[mfi.index()]); resk = res[mfi].norm(mfi.validbox(), p, 0, ncomp); if (p == 0) { restot = std::max(restot, resk); } else if (p == 2) { restot += resk*resk; } else BoxLib::Error("BOGUS P IN NORM"); } if (p == 0) { ParallelDescriptor::ReduceRealMax(restot); } else if (p == 2) { ParallelDescriptor::ReduceRealSum(restot); restot = sqrt(restot); } return restot; } void MCCGSolver::solve (MultiFab& sol, const MultiFab& rhs, Real eps_rel, Real eps_abs, MCBC_Mode bc_mode) { // // algorithm: // k=0;r=rhs-A*soln_0; // while (||r_k||^2_2 > eps^2*||r_o||^2_2 && k < maxiter { // k++ // solve Mz_k-1 = r_k-1 (if preconditioning, else z_k-1 = r_k-1) // rho_k-1 = r_k-1^T z_k-1 // if (k=1) { p_1 = z_0 } // else { beta = rho_k-1/rho_k-2; p = z + beta*p } // w = Ap // alpha = rho_k-1/p^tw // x += alpha p // r -= alpha w // } // BL_ASSERT(sol.boxArray() == Lp.boxArray(lev)); BL_ASSERT(rhs.boxArray() == Lp.boxArray(lev)); int nghost = 1; int ncomp = sol.nComp(); MultiFab* s = new MultiFab(sol.boxArray(), ncomp, nghost); MultiFab* r = new MultiFab(sol.boxArray(), ncomp, nghost); MultiFab* z = new MultiFab(sol.boxArray(), ncomp, nghost); MultiFab* w = new MultiFab(sol.boxArray(), ncomp, nghost); MultiFab* p = new MultiFab(sol.boxArray(), ncomp, nghost); // // Copy initial guess into a temp multifab guaranteed to have ghost cells. // int srccomp=0; int destcomp=0; nghost=0; s->copy(sol,srccomp,destcomp,ncomp); /* Note: This routine assumes the MCLinOp is linear, and that when bc_mode = MCHomogeneous_BC, MCLinOp::apply() on a zero vector will return a zero vector. Given that, we define the problem we solve here from the original equation: Lp(sol) = rhs --> Lp(s) + Lp(sol,bc_mode=MCHomogeneous_BC) = rhs where s is set to the incoming solution guess. Rewriting, Lp(sol,bc_mode=MCHomogeneous_BC) = r [ = rhs - Lp(s) ]. CG needs the residual of this equation on our initial guess. But because we made the above assumption, r - Lp(sol,bc_mode=MCHomogeneous_BC) = r = rhs - Lp(s) Which is simply the residual of the original equation evaluated at the initial guess. Thus we get by with only one call to Lp.residual. Without this assumption, we'd need two. */ Lp.residual((*r), rhs, (*s), lev, bc_mode); // // Set initial guess for correction to 0. // sol.setVal(0.0); // // Set bc_mode=homogeneous. // MCBC_Mode temp_bc_mode=MCHomogeneous_BC; Real rnorm = norm(*r); Real rnorm0 = rnorm; Real minrnorm = rnorm; int ret = 0; // will return this value if all goes well if (verbose > 0 && ParallelDescriptor::IOProcessor()) { for (int k = 0; k < lev; k++) std::cout << " "; std::cout << "MCCGsolver: Initial error (error0) = " << rnorm0 << '\n'; } Real beta, rho, rhoold=0.0; /* WARNING: The MultiFab copies used below to update z and p require nghost=0 to avoid the possibility of filling valid regions with uninitialized data in the invalid regions of neighboring grids. The default behavior in MultiFab copies will likely be changed in the future. */ // // Note: if eps_rel or eps_abs < 0: that test is effectively bypassed. // for (int nit = 0; (nit < maxiter) && (rnorm > eps_rel*rnorm0) && (rnorm > eps_abs); ++nit) { if (use_mg_precond) { // // solve Mz_k-1 = r_k-1 and rho_k-1 = r_k-1^T z_k-1 // z->setVal(0.); mg_precond->solve( *z, *r, eps_rel, eps_abs, temp_bc_mode ); } else { // // No preconditioner, z_k-1 = r_k-1 and rho_k-1 = r_k-1^T r_k-1. // srccomp=0; destcomp=0; z->copy(*r, srccomp, destcomp, ncomp); } rho = 0.0; int ncomp = z->nComp(); const BoxArray& gbox = r->boxArray(); for (MFIter rmfi(*r); rmfi.isValid(); ++rmfi) { Real trho; FORT_CGXDOTY( &trho, (*z)[rmfi].dataPtr(), ARLIM((*z)[rmfi].loVect()), ARLIM((*z)[rmfi].hiVect()), (*r)[rmfi].dataPtr(), ARLIM((*r)[rmfi].loVect()), ARLIM((*r)[rmfi].hiVect()), rmfi.validbox().loVect(), rmfi.validbox().hiVect(), &ncomp); rho += trho; } ParallelDescriptor::ReduceRealSum(rho); if (nit == 0) { // // k=1, p_1 = z_0. // srccomp=0; destcomp=0; nghost=0; p->copy(*z, srccomp, destcomp, ncomp); } else { // // k>1, beta = rho_k-1/rho_k-2 and p = z + beta*p // beta = rho/rhoold; advance( (*p), beta, (*z) ); } // // w = Ap, and compute Transpose(p).w // Real pw = axp( (*w), (*p), temp_bc_mode ); // // alpha = rho_k-1/p^tw. // Real alpha = rho/pw; if (verbose > 2 && ParallelDescriptor::IOProcessor()) { for (int k = 0; k < lev; k++) std::cout << " "; std::cout << "MCCGSolver:" << " nit " << nit << " pw " << pw << " rho " << rho << " alpha " << alpha; if (nit == 0) std::cout << " beta undefined ..."; else std::cout << " beta " << beta << " ..."; } // // x += alpha p and r -= alpha w // rhoold = rho; update( sol, alpha, (*r), (*p), (*w) ); rnorm = norm(*r); if (rnorm > def_unstable_criterion*minrnorm) { ret = 2; break; } else if (rnorm < minrnorm) { minrnorm = rnorm; } if (verbose > 1 || (((eps_rel > 0. && rnorm < eps_rel*rnorm0) || (eps_abs > 0. && rnorm < eps_abs)) && verbose)) { if (ParallelDescriptor::IOProcessor()) { for (int k = 0; k < lev; k++) std::cout << " "; std::cout << "MCCGSolver: Iteration " << nit << " error/error0 " << rnorm/rnorm0 << '\n'; } } } if (ret != 0 && isExpert == false) { BoxLib::Error("MCCGSolver:: apparent accuracy problem; try expert setting or change unstable_criterion"); } if (ret==0 && rnorm > eps_rel*rnorm0 && rnorm > eps_abs) { BoxLib::Error("MCCGSolver:: failed to converge!"); } // // Omit ghost update since maybe not initialized in calling routine. // BoxLib_1.99 has no MultiFab::plus(MultiFab&) member, which would // operate only in valid regions; do explicitly. Add to boundary // values stored in initialsolution. // if (ret == 0) { srccomp=0; nghost=0; sol.plus((*s),srccomp,ncomp,nghost); } delete s; delete r; delete w; delete p; delete z; } void MCCGSolver::advance (MultiFab& p, Real beta, const MultiFab& z) { // // Compute p = z + beta p // int ncomp = p.nComp(); const BoxArray& gbox = Lp.boxArray(lev); const BoxArray& zbox = z.boxArray(); for (MFIter pmfi(p); pmfi.isValid(); ++pmfi) { const Box& bx = zbox[pmfi.index()]; BL_ASSERT(bx == gbox[pmfi.index()]); FORT_CGADVCP( p[pmfi].dataPtr(), ARLIM(p[pmfi].loVect()), ARLIM(p[pmfi].hiVect()), z[pmfi].dataPtr(), ARLIM(z[pmfi].loVect()), ARLIM(z[pmfi].hiVect()), &beta, bx.loVect(), bx.hiVect(),&ncomp); } } void MCCGSolver::update (MultiFab& sol, Real alpha, MultiFab& r, const MultiFab& p, const MultiFab& w) { // // Compute x =+ alpha p and r -= alpha w // const BoxArray& gbox = Lp.boxArray(lev); int ncomp = r.nComp(); for (MFIter solmfi(sol); solmfi.isValid(); ++solmfi) { FORT_CGUPDATE( sol[solmfi].dataPtr(), ARLIM(sol[solmfi].loVect()),ARLIM(sol[solmfi].hiVect()), r[solmfi].dataPtr(), ARLIM(r[solmfi].loVect()),ARLIM(r[solmfi].hiVect()), &alpha, w[solmfi].dataPtr(), ARLIM(w[solmfi].loVect()),ARLIM(w[solmfi].hiVect()), p[solmfi].dataPtr(), ARLIM(p[solmfi].loVect()), ARLIM(p[solmfi].hiVect()), solmfi.validbox().loVect(), solmfi.validbox().hiVect(),&ncomp); } } Real MCCGSolver::axp (MultiFab& w, MultiFab& p, MCBC_Mode bc_mode) { // // Compute w = A.p, and return Transpose(p).w // Real pw = 0.0; const BoxArray& gbox = Lp.boxArray(lev); Lp.apply(w, p, lev, bc_mode); int ncomp = p.nComp(); for (MFIter pmfi(p); pmfi.isValid(); ++pmfi) { Real tpw; FORT_CGXDOTY( &tpw, p[pmfi].dataPtr(),ARLIM(p[pmfi].loVect()),ARLIM(p[pmfi].hiVect()), w[pmfi].dataPtr(),ARLIM(w[pmfi].loVect()),ARLIM(w[pmfi].hiVect()), pmfi.validbox().loVect(), pmfi.validbox().hiVect(),&ncomp); pw += tpw; } ParallelDescriptor::ReduceRealSum(pw); return pw; } ccseapps-2.5/CCSEApps/tensorMG/DivVis.cpp0000644000175000017500000004127711634153073021340 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: DivVis.cpp,v 1.11 2001/08/09 22:42:00 marc Exp $ // #include #include #include Real DivVis::a_def = 0.0; Real DivVis::b_def = 1.0; Real DivVis::alpha_def = 1.0; Real DivVis::beta_def = 1.0; int DivVis::numberComponents () { return BL_SPACEDIM; } int DivVis::numberPhases () { return BL_SPACEDIM==2 ? 4 : 8; } DivVis::DivVis (const BndryData& _bd, Real _h) : MCLinOp(_bd, _h), alpha(alpha_def), beta(beta_def) { Real __h[BL_SPACEDIM]; D_TERM(__h[0]=_h;, __h[1]=_h;, __h[2]=_h;); initConstruct(__h); } DivVis::DivVis (const BndryData& _bd, const Real* _h) : MCLinOp(_bd, _h), alpha(alpha_def), beta(beta_def) { initConstruct(_h); } void DivVis::initConstruct (const Real* _h) { const int level = 0; const BoxArray& grids = gbox[level]; initCoefficients(gbox[level]); numcomp = numberComponents(); // wyc numphase = numberPhases(); // wyc undrrelxr.resize(1); undrrelxr[level] = new BndryRegister(gbox[level], 1, 0, 0, numcomp); tangderiv.resize(1); #if BL_SPACEDIM==2 tangderiv[level] = new BndryRegister(gbox[level], 0, 1, 0, numcomp); #elif BL_SPACEDIM==3 tangderiv[level] = new BndryRegister(gbox[level], 0, 1, 0, numcomp*(1+3)); #else # error "BL_SPACEDIME must be 2 or 3" #endif } DivVis::~DivVis () { clearToLevel(-1); } void DivVis::setScalars (Real _alpha, Real _beta) { alpha = _alpha; beta = _beta; } void DivVis::clearToLevel (int level) { BL_ASSERT(level >= -1); for (int i = level+1; i < numLevels(); ++i) { delete acoefs[i]; for (int j = 0; j < BL_SPACEDIM; ++j) { delete bcoefs[i][j]; } } } void DivVis::prepareForLevel (int level) { MCLinOp::prepareForLevel(level); if (level == 0) return; prepareForLevel(level-1); // // If coefficients were marked invalid, or if not yet made, make new ones // (Note: makeCoefficients is a MCLinOp routine, and it allocates AND // fills coefficients. A more efficient implementation would allocate // and fill in separate steps--we could then use the a_valid bool // along with the length of a_valid to separately determine whether to // fill or allocate the coefficient MultiFabs. // if (level >= a_valid.size() || a_valid[level] == false) { if (acoefs.size() < level+1) { acoefs.resize(level+1); acoefs[level] = new MultiFab; } else { delete acoefs[level]; acoefs[level] = new MultiFab; } makeCoefficients(*acoefs[level], *acoefs[level-1], level); a_valid.resize(level+1); a_valid[level] = true; } if (level >= b_valid.size() || b_valid[level] == false) { if (bcoefs.size() < level+1) { bcoefs.resize(level+1); for (int i = 0; i < BL_SPACEDIM; ++i) bcoefs[level][i] = new MultiFab; } else { for (int i = 0; i < BL_SPACEDIM; ++i) { delete bcoefs[level][i]; bcoefs[level][i] = new MultiFab; } } for (int i = 0; i < BL_SPACEDIM; ++i) makeCoefficients(*bcoefs[level][i], *bcoefs[level-1][i], level); b_valid.resize(level+1); b_valid[level] = true; } } void DivVis::initCoefficients (const BoxArray &_ba) { const int nGrow = 0; const int level = 0; acoefs.resize(1); bcoefs.resize(1); // // In 2D, need 2 components for "a" to handle r-z properly (will need three // for r-theta-phi, but allowing only 3D cartesian for now). // const int nComp = (BL_SPACEDIM == 2 ? 2 : 1); #ifndef NDEBUG if (BL_SPACEDIM == 3) BL_ASSERT(geomarray[level].IsCartesian()); #endif acoefs[level] = new MultiFab(_ba, nComp, nGrow); acoefs[level]->setVal(a_def); a_valid.resize(1); a_valid[level] = true; for (int i = 0; i < BL_SPACEDIM; ++i) { BoxArray edge_boxes(_ba); edge_boxes.surroundingNodes(i); bcoefs[level][i] = new MultiFab(edge_boxes, 1, nGrow); bcoefs[level][i]->setVal(b_def); } b_valid.resize(1); b_valid[level] = true; } void DivVis::invalidate_a_to_level (int lev) { lev = (lev >= 0 ? lev : 0); for (int i = lev; i < numLevels(); i++) a_valid[i]=false; } void DivVis::invalidate_b_to_level (int lev) { lev = (lev >= 0 ? lev : 0); for (int i = lev; i < numLevels(); i++) b_valid[i]=false; } void DivVis::aCoefficients (const MultiFab& _a) { BL_ASSERT(_a.ok()); BL_ASSERT(_a.boxArray() == (acoefs[0])->boxArray()); const int nComp = (BL_SPACEDIM == 2 ? 2 : 1); BL_ASSERT(_a.nComp() == nComp); invalidate_a_to_level(0); (*acoefs[0]).copy(_a,0,0,nComp); } void DivVis::bCoefficients (const MultiFab& _b, int dir) { BL_ASSERT(_b.ok()); BL_ASSERT(_b.boxArray() == (bcoefs[0][dir])->boxArray()); BL_ASSERT(_b.nComp() == 1); invalidate_b_to_level(0); (*bcoefs[0][dir]).copy(_b,0,0,1); } const MultiFab& DivVis::aCoefficients (int level) { prepareForLevel(level); return *acoefs[level]; } const MultiFab& DivVis::bCoefficients (int dir, int level) { prepareForLevel(level); return *bcoefs[level][dir]; } // // Must be defined for MultiGrid/CGSolver to work. // void DivVis::Fsmooth (MultiFab& solnL, const MultiFab& rhsL, int level, int phaseflag) { OrientationIter oitr; const FabSet& fw = (*undrrelxr[level])[oitr()]; const FabSet& tdw = (*tangderiv[level])[oitr()]; oitr++; const FabSet& fs = (*undrrelxr[level])[oitr()]; const FabSet& tds = (*tangderiv[level])[oitr()]; oitr++; #if BL_SPACEDIM>2 const FabSet& fb = (*undrrelxr[level])[oitr()]; const FabSet& tdb = (*tangderiv[level])[oitr()]; oitr++; #endif const FabSet& fe = (*undrrelxr[level])[oitr()]; const FabSet& tde = (*tangderiv[level])[oitr()]; oitr++; const FabSet& fn = (*undrrelxr[level])[oitr()]; const FabSet& tdn = (*tangderiv[level])[oitr()]; oitr++; #if BL_SPACEDIM>2 const FabSet& ft = (*undrrelxr[level])[oitr()]; const FabSet& tdt = (*tangderiv[level])[oitr()]; oitr++; #endif const MultiFab& a = aCoefficients(level); D_TERM(const MultiFab& bX = bCoefficients(0,level);, const MultiFab& bY = bCoefficients(1,level);, const MultiFab& bZ = bCoefficients(2,level);); int nc = solnL.nComp(); for (MFIter solnLmfi(solnL); solnLmfi.isValid(); ++solnLmfi) { oitr.rewind(); const int gn = solnLmfi.index(); D_TERM(const Mask& mw = *maskvals[level][gn][oitr()]; oitr++;, const Mask& ms = *maskvals[level][gn][oitr()]; oitr++;, const Mask& mb = *maskvals[level][gn][oitr()]; oitr++;); D_TERM(const Mask& me = *maskvals[level][gn][oitr()]; oitr++;, const Mask& mn = *maskvals[level][gn][oitr()]; oitr++;, const Mask& mt = *maskvals[level][gn][oitr()]; oitr++;); FORT_GSRB( solnL[solnLmfi].dataPtr(), ARLIM(solnL[solnLmfi].loVect()),ARLIM(solnL[solnLmfi].hiVect()), rhsL[solnLmfi].dataPtr(), ARLIM(rhsL[solnLmfi].loVect()), ARLIM(rhsL[solnLmfi].hiVect()), &alpha, &beta, a[solnLmfi].dataPtr(), ARLIM(a[solnLmfi].loVect()), ARLIM(a[solnLmfi].hiVect()), bX[solnLmfi].dataPtr(), ARLIM(bX[solnLmfi].loVect()), ARLIM(bX[solnLmfi].hiVect()), bY[solnLmfi].dataPtr(), ARLIM(bY[solnLmfi].loVect()), ARLIM(bY[solnLmfi].hiVect()), #if BL_SPACEDIM>2 bZ[solnLmfi].dataPtr(), ARLIM(bZ[solnLmfi].loVect()), ARLIM(bZ[solnLmfi].hiVect()), #endif mn.dataPtr(), ARLIM(mn.loVect()),ARLIM(mn.hiVect()), fn[solnLmfi].dataPtr(), ARLIM(fn[solnLmfi].loVect()), ARLIM(fn[solnLmfi].hiVect()), me.dataPtr(), ARLIM(me.loVect()),ARLIM(me.hiVect()), fe[solnLmfi].dataPtr(), ARLIM(fe[solnLmfi].loVect()), ARLIM(fe[solnLmfi].hiVect()), mw.dataPtr(), ARLIM(mw.loVect()),ARLIM(mw.hiVect()), fw[solnLmfi].dataPtr(), ARLIM(fw[solnLmfi].loVect()), ARLIM(fw[solnLmfi].hiVect()), ms.dataPtr(), ARLIM(ms.loVect()),ARLIM(ms.hiVect()), fs[solnLmfi].dataPtr(), ARLIM(fs[solnLmfi].loVect()), ARLIM(fs[solnLmfi].hiVect()), #if BL_SPACEDIM>2 mt.dataPtr(), ARLIM(mt.loVect()),ARLIM(mt.hiVect()), ft[solnLmfi].dataPtr(), ARLIM(ft[solnLmfi].loVect()), ARLIM(ft[solnLmfi].hiVect()), mb.dataPtr(), ARLIM(mb.loVect()),ARLIM(mb.hiVect()), fb[solnLmfi].dataPtr(), ARLIM(fb[solnLmfi].loVect()), ARLIM(fb[solnLmfi].hiVect()), #endif tdn[solnLmfi].dataPtr(), ARLIM(tdn[solnLmfi].loVect()),ARLIM(tdn[solnLmfi].hiVect()), tde[solnLmfi].dataPtr(), ARLIM(tde[solnLmfi].loVect()),ARLIM(tde[solnLmfi].hiVect()), tdw[solnLmfi].dataPtr(), ARLIM(tdw[solnLmfi].loVect()),ARLIM(tdw[solnLmfi].hiVect()), tds[solnLmfi].dataPtr(), ARLIM(tds[solnLmfi].loVect()),ARLIM(tds[solnLmfi].hiVect()), #if BL_SPACEDIM>2 tdt[solnLmfi].dataPtr(), ARLIM(tdt[solnLmfi].loVect()),ARLIM(tdt[solnLmfi].hiVect()), tdb[solnLmfi].dataPtr(), ARLIM(tdb[solnLmfi].loVect()),ARLIM(tdb[solnLmfi].hiVect()), #endif solnLmfi.validbox().loVect(), solnLmfi.validbox().hiVect(), h[level], nc, phaseflag); } } void DivVis::compFlux (D_DECL(MultiFab& xflux, MultiFab& yflux, MultiFab& zflux), MultiFab& x) { const int level = 0; MCBC_Mode bc_mode = MCInhomogeneous_BC; applyBC(x,level,bc_mode); const MultiFab& a = aCoefficients(level); D_TERM(const MultiFab& bX = bCoefficients(0,level);, const MultiFab& bY = bCoefficients(1,level);, const MultiFab& bZ = bCoefficients(2,level);); OrientationIter oitr; D_TERM(const FabSet& tdw = (*tangderiv[level])[oitr()]; oitr++;, const FabSet& tds = (*tangderiv[level])[oitr()]; oitr++;, const FabSet& tdb = (*tangderiv[level])[oitr()]; oitr++;); D_TERM(const FabSet& tde = (*tangderiv[level])[oitr()]; oitr++;, const FabSet& tdn = (*tangderiv[level])[oitr()]; oitr++;, const FabSet& tdt = (*tangderiv[level])[oitr()]; oitr++;); const int nc = x.nComp(); BL_ASSERT(nc == BL_SPACEDIM); BL_ASSERT(nc == xflux.nComp()); BL_ASSERT(nc == yflux.nComp()); for (MFIter xmfi(x); xmfi.isValid(); ++xmfi) { oitr.rewind(); const int gn = xmfi.index(); D_TERM(const Mask& mw = *maskvals[level][gn][oitr()]; oitr++;, const Mask& ms = *maskvals[level][gn][oitr()]; oitr++;, const Mask& mb = *maskvals[level][gn][oitr()]; oitr++;); D_TERM(const Mask& me = *maskvals[level][gn][oitr()]; oitr++;, const Mask& mn = *maskvals[level][gn][oitr()]; oitr++;, const Mask& mt = *maskvals[level][gn][oitr()]; oitr++;); FORT_DVFLUX( x[xmfi].dataPtr(), ARLIM(x[xmfi].loVect()), ARLIM(x[xmfi].hiVect()), &alpha, &beta, a[xmfi].dataPtr(), ARLIM(a[xmfi].loVect()), ARLIM(a[xmfi].hiVect()), bX[xmfi].dataPtr(), ARLIM(bX[xmfi].loVect()), ARLIM(bX[xmfi].hiVect()), bY[xmfi].dataPtr(), ARLIM(bY[xmfi].loVect()), ARLIM(bY[xmfi].hiVect()), #if BL_SPACEDIM>2 bZ[xmfi].dataPtr(), ARLIM(bZ[xmfi].loVect()), ARLIM(bZ[xmfi].hiVect()), #endif xflux[xmfi].dataPtr(), ARLIM(xflux[xmfi].loVect()), ARLIM(xflux[xmfi].hiVect()), yflux[xmfi].dataPtr(), ARLIM(yflux[xmfi].loVect()), ARLIM(yflux[xmfi].hiVect()), #if BL_SPACEDIM>2 zflux[xmfi].dataPtr(), ARLIM(zflux[xmfi].loVect()), ARLIM(zflux[xmfi].hiVect()), #endif mn.dataPtr(), ARLIM(mn.loVect()),ARLIM(mn.hiVect()), me.dataPtr(), ARLIM(me.loVect()),ARLIM(me.hiVect()), mw.dataPtr(), ARLIM(mw.loVect()),ARLIM(mw.hiVect()), ms.dataPtr(), ARLIM(ms.loVect()),ARLIM(ms.hiVect()), #if BL_SPACEDIM>2 mt.dataPtr(), ARLIM(mt.loVect()),ARLIM(mt.hiVect()), mb.dataPtr(), ARLIM(mb.loVect()),ARLIM(mb.hiVect()), #endif tdn[xmfi].dataPtr(), ARLIM(tdn[xmfi].loVect()),ARLIM(tdn[xmfi].hiVect()), tde[xmfi].dataPtr(), ARLIM(tde[xmfi].loVect()),ARLIM(tde[xmfi].hiVect()), tdw[xmfi].dataPtr(), ARLIM(tdw[xmfi].loVect()),ARLIM(tdw[xmfi].hiVect()), tds[xmfi].dataPtr(), ARLIM(tds[xmfi].loVect()),ARLIM(tds[xmfi].hiVect()), #if BL_SPACEDIM>2 tdt[xmfi].dataPtr(), ARLIM(tdt[xmfi].loVect()),ARLIM(tdt[xmfi].hiVect()), tdb[xmfi].dataPtr(), ARLIM(tdb[xmfi].loVect()),ARLIM(tdb[xmfi].hiVect()), #endif xmfi.validbox().loVect(), xmfi.validbox().hiVect(), h[level]); } } void DivVis::Fapply (MultiFab& y, const MultiFab& x, int level) { const MultiFab& a = aCoefficients(level); D_TERM(const MultiFab& bX = bCoefficients(0,level);, const MultiFab& bY = bCoefficients(1,level);, const MultiFab& bZ = bCoefficients(2,level);); OrientationIter oitr; D_TERM(const FabSet& tdw = (*tangderiv[level])[oitr()]; oitr++;, const FabSet& tds = (*tangderiv[level])[oitr()]; oitr++;, const FabSet& tdb = (*tangderiv[level])[oitr()]; oitr++;); D_TERM(const FabSet& tde = (*tangderiv[level])[oitr()]; oitr++;, const FabSet& tdn = (*tangderiv[level])[oitr()]; oitr++;, const FabSet& tdt = (*tangderiv[level])[oitr()]; oitr++;); const int nc = y.nComp(); for (MFIter xmfi(x); xmfi.isValid(); ++xmfi) { oitr.rewind(); const int gn = xmfi.index(); D_TERM(const Mask& mw = *maskvals[level][gn][oitr()]; oitr++;, const Mask& ms = *maskvals[level][gn][oitr()]; oitr++;, const Mask& mb = *maskvals[level][gn][oitr()]; oitr++;); D_TERM(const Mask& me = *maskvals[level][gn][oitr()]; oitr++;, const Mask& mn = *maskvals[level][gn][oitr()]; oitr++;, const Mask& mt = *maskvals[level][gn][oitr()]; oitr++;); FORT_DVAPPLY( x[xmfi].dataPtr(), ARLIM(x[xmfi].loVect()), ARLIM(x[xmfi].hiVect()), &alpha, &beta, a[xmfi].dataPtr(), ARLIM(a[xmfi].loVect()), ARLIM(a[xmfi].hiVect()), bX[xmfi].dataPtr(), ARLIM(bX[xmfi].loVect()), ARLIM(bX[xmfi].hiVect()), bY[xmfi].dataPtr(), ARLIM(bY[xmfi].loVect()), ARLIM(bY[xmfi].hiVect()), #if BL_SPACEDIM>2 bZ[xmfi].dataPtr(), ARLIM(bZ[xmfi].loVect()), ARLIM(bZ[xmfi].hiVect()), #endif y[xmfi].dataPtr(), ARLIM(y[xmfi].loVect()), ARLIM(y[xmfi].hiVect()), mn.dataPtr(), ARLIM(mn.loVect()),ARLIM(mn.hiVect()), me.dataPtr(), ARLIM(me.loVect()),ARLIM(me.hiVect()), mw.dataPtr(), ARLIM(mw.loVect()),ARLIM(mw.hiVect()), ms.dataPtr(), ARLIM(ms.loVect()),ARLIM(ms.hiVect()), #if BL_SPACEDIM>2 mt.dataPtr(), ARLIM(mt.loVect()),ARLIM(mt.hiVect()), mb.dataPtr(), ARLIM(mb.loVect()),ARLIM(mb.hiVect()), #endif tdn[xmfi].dataPtr(), ARLIM(tdn[xmfi].loVect()),ARLIM(tdn[xmfi].hiVect()), tde[xmfi].dataPtr(), ARLIM(tde[xmfi].loVect()),ARLIM(tde[xmfi].hiVect()), tdw[xmfi].dataPtr(), ARLIM(tdw[xmfi].loVect()),ARLIM(tdw[xmfi].hiVect()), tds[xmfi].dataPtr(), ARLIM(tds[xmfi].loVect()),ARLIM(tds[xmfi].hiVect()), #if BL_SPACEDIM>2 tdt[xmfi].dataPtr(), ARLIM(tdt[xmfi].loVect()),ARLIM(tdt[xmfi].hiVect()), tdb[xmfi].dataPtr(), ARLIM(tdb[xmfi].loVect()),ARLIM(tdb[xmfi].hiVect()), #endif xmfi.validbox().loVect(), xmfi.validbox().hiVect(), h[level]); } } ccseapps-2.5/CCSEApps/tensorMG/MCLO_3D.F0000644000175000017500000001666411634153073020621 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include "LO_BCTYPES.H" #include "MCLO_F.H" #include "ArrayLim.H" c----------------------------------------------------------------------- subroutine FORT_RESIDL ( $ res, DIMS(res), $ rhs, DIMS(rhs), $ phi, DIMS(phi), $ lo, hi, nc $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(phi) REAL_T phi(DIMV(phi),nc) integer DIMDEC(rhs) REAL_T rhs(DIMV(rhs),nc) integer DIMDEC(res) REAL_T res(DIMV(res),nc) c integer i integer j integer k integer n c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) res(i,j,k,n) = rhs(i,j,k,n) - phi(i,j,k,n) enddo enddo enddo enddo c end c----------------------------------------------------------------------- subroutine FORT_HARMONIC_AVERAGEEC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc, $ cdir $ ) c integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer cdir integer DIMDEC(f) REAL_T f(DIMV(f),nc) integer DIMDEC(c) REAL_T c(DIMV(c),nc) c REAL_T factor parameter(factor=4.0d0) integer n integer i integer j integer k c if ( cdir .eq. 0 ) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1)+1 c c(i,j,k,n) = factor/( $ + 1.0/f(2*i,2*j ,2*k ,n) $ + 1.0/f(2*i,2*j+1,2*k ,n) $ + 1.0/f(2*i,2*j ,2*k+1,n) $ + 1.0/f(2*i,2*j+1,2*k+1,n) ) c enddo enddo enddo enddo else if (cdir .eq. 1 ) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2)+1 do i = lo(1), hi(1) c c(i,j,k,n) = factor/( $ + 1.0/f(2*i ,2*j,2*k ,n) $ + 1.0/f(2*i+1,2*j,2*k ,n) $ + 1.0/f(2*i ,2*j,2*k+1,n) $ + 1.0/f(2*i+1,2*j,2*k+1,n) ) c enddo enddo enddo enddo else if (cdir .eq. 2 ) then do n = 1, nc do k = lo(3), hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) c c(i,j,k,n) = factor/( $ + 1.0/f(2*i ,2*j ,2*k,n) $ + 1.0/f(2*i+1,2*j ,2*k,n) $ + 1.0/f(2*i ,2*j+1,2*k,n) $ + 1.0/f(2*i+1,2*j+1,2*k,n) ) c enddo enddo enddo enddo endif c end c----------------------------------------------------------------------- subroutine FORT_AVERAGEEC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc, $ cdir $ ) c integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer cdir integer DIMDEC(f) REAL_T f(DIMV(f),nc) integer DIMDEC(c) REAL_T c(DIMV(c),nc) c integer n integer i integer j integer k REAL_T factor parameter(factor = 0.25d0) c if ( cdir .eq. 0 ) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1)+1 c c(i,j,k,n) = factor*( $ + f(2*i,2*j ,2*k ,n) $ + f(2*i,2*j+1,2*k ,n) $ + f(2*i,2*j ,2*k+1,n) $ + f(2*i,2*j+1,2*k+1,n) ) c enddo enddo enddo enddo else if (cdir .eq. 1 ) then do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2)+1 do i = lo(1), hi(1) c c(i,j,k,n) = factor*( $ + f(2*i ,2*j,2*k ,n) $ + f(2*i+1,2*j,2*k ,n) $ + f(2*i ,2*j,2*k+1,n) $ + f(2*i+1,2*j,2*k+1,n) ) c enddo enddo enddo enddo else if (cdir .eq. 2 ) then do n = 1, nc do k = lo(3), hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) c c(i,j,k,n) = factor*( $ + f(2*i ,2*j ,2*k,n) $ + f(2*i+1,2*j ,2*k,n) $ + f(2*i ,2*j+1,2*k,n) $ + f(2*i+1,2*j+1,2*k,n) ) c enddo enddo enddo enddo endif c end c----------------------------------------------------------------------- subroutine FORT_AVERAGECC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc $ ) c integer nc integer DIMDEC(f) integer DIMDEC(c) integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) REAL_T f(DIMV(f),nc) REAL_T c(DIMV(c),nc) c integer i integer j integer k integer n REAL_T factor parameter(factor=0.125d0) c do n = 1, nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) c c(i,j,k,n) = factor*( $ + f(2*i+1,2*j+1,2*k ,n) $ + f(2*i ,2*j+1,2*k ,n) $ + f(2*i+1,2*j ,2*k ,n) $ + f(2*i ,2*j ,2*k ,n) $ + f(2*i+1,2*j+1,2*k+1,n) $ + f(2*i ,2*j+1,2*k+1,n) $ + f(2*i+1,2*j ,2*k+1,n) $ + f(2*i ,2*j ,2*k+1,n) ) c enddo enddo enddo enddo c end ccseapps-2.5/CCSEApps/tensorMG/visc2d.ma0000644000175000017500000012742611634153073021142 0ustar amckinstryamckinstry(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "X Window System Mathematica Notebook Front End Version 2.2"; X11StandardFontEncoding; fontset = title, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, fontName, "times"; fontset = subtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, fontName, "times"; fontset = subsubtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, fontName, "times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, fontName, "times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, fontName, "times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, fontName, "times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, fontName, "times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, 12, fontName, "courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, fontName, "courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, fontName, "courier"; fontset = name, inactive, noPageBreakInGroup, nohscroll, preserveAspect, M7, italic, B65535, 10, fontName, "times"; fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 12, fontName, "times"; fontset = leftheader, 12, fontName, "times"; fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, 12, fontName, "times"; fontset = leftfooter, 12, fontName, "times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "courier"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";paletteColors = 128; automaticGrouping; currentKernel; ] :[font = section; inactive; preserveAspect; startGroup] definition of tau :[font = input; preserveAspect; startGroup] tauxxdef = tauxx[i_ + half, j_ ] -> 2*mu[i+half,j]*dudx[i+half,j] :[font = output; output; inactive; preserveAspect; endGroup] tauxx[half + (i_), j_] -> 2*dudx[half + i, j]*mu[half + i, j] ;[o] tauxx[half + (i_), j_] -> 2 dudx[half + i, j] mu[half + i, j] :[font = input; preserveAspect; startGroup] tauyydef = tauyy[i_, j_ + half] -> 2*mu[i,j+half] * dvdy[i,j+half] :[font = output; output; inactive; preserveAspect; endGroup] tauyy[i_, half + (j_)] -> 2*dvdy[i, half + j]*mu[i, half + j] ;[o] tauyy[i_, half + (j_)] -> 2 dvdy[i, half + j] mu[i, half + j] :[font = input; preserveAspect; startGroup] tauxydef = tauxy[i_,j_] -> mu[i,j]*(dudy[i,j]+dvdx[i,j]) :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "tauxydef" is similar to existing symbols {tauxxdef, tauyydef}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "tauxy" is similar to existing symbols {tauxx, tauyy}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "dudy" is similar to existing symbols {dudx, dvdy}. :[font = message; inactive; preserveAspect] General::stop: Further output of General::spell will be suppressed during this calculation. :[font = output; output; inactive; preserveAspect; endGroup; endGroup] tauxy[i_, j_] -> (dudy[i, j] + dvdx[i, j])*mu[i, j] ;[o] tauxy[i_, j_] -> (dudy[i, j] + dvdx[i, j]) mu[i, j] :[font = section; inactive; preserveAspect; startGroup] definitions of derivatives :[font = input; preserveAspect; startGroup] dudydef1 = dudy[i_,j_+half] -> (u[i,j+1]-u[i,j])/hy :[font = output; output; inactive; preserveAspect; endGroup] dudy[i_, half + (j_)] -> (-u[i, j] + u[i, 1 + j])/hy ;[o] -u[i, j] + u[i, 1 + j] dudy[i_, half + (j_)] -> ---------------------- hy :[font = input; preserveAspect; startGroup] dvdxdef1 = dvdx[i_+half,j_] -> (v[i+1,j]-v[i,j])/hx :[font = output; output; inactive; preserveAspect; endGroup] dvdx[half + (i_), j_] -> (-v[i, j] + v[1 + i, j])/hx ;[o] -v[i, j] + v[1 + i, j] dvdx[half + (i_), j_] -> ---------------------- hx :[font = input; preserveAspect; startGroup] dudydef2 = dudy[i_+half,j_] -> (u[i,j+1]-u[i,j-1]+u[i+1,j+1]-u[i+1,j-1])/(4*hy) :[font = output; output; inactive; preserveAspect; endGroup] dudy[half + (i_), j_] -> (-u[i, -1 + j] + u[i, 1 + j] - u[1 + i, -1 + j] + u[1 + i, 1 + j])/(4*hy) ;[o] dudy[half + (i_), j_] -> (-u[i, -1 + j] + u[i, 1 + j] - u[1 + i, -1 + j] + u[1 + i, 1 + j]) / (4 hy) :[font = input; preserveAspect; startGroup] dvdxdef2 = dvdx[i_,j_+half] -> (v[i+1,j+1]-v[i-1,j+1]+v[i+1,j]-v[i-1,j])/(4*hx) :[font = output; output; inactive; preserveAspect; endGroup] dvdx[i_, half + (j_)] -> (-v[-1 + i, j] - v[-1 + i, 1 + j] + v[1 + i, j] + v[1 + i, 1 + j])/(4*hx) ;[o] dvdx[i_, half + (j_)] -> (-v[-1 + i, j] - v[-1 + i, 1 + j] + v[1 + i, j] + v[1 + i, 1 + j]) / (4 hx) :[font = input; preserveAspect; startGroup] dudxdef = dudx[i_+half,j_] -> (u[i+1,j]-u[i,j])/hx :[font = output; output; inactive; preserveAspect; endGroup] dudx[half + (i_), j_] -> (-u[i, j] + u[1 + i, j])/hx ;[o] -u[i, j] + u[1 + i, j] dudx[half + (i_), j_] -> ---------------------- hx :[font = input; preserveAspect; startGroup] dvdydef = dvdy[i_,j_+half] -> (v[i,j+1]-v[i,j])/hy :[font = output; output; inactive; preserveAspect; endGroup; endGroup] dvdy[i_, half + (j_)] -> (-v[i, j] + v[i, 1 + j])/hy ;[o] -v[i, j] + v[i, 1 + j] dvdy[i_, half + (j_)] -> ---------------------- hy :[font = section; inactive; preserveAspect; startGroup] definitions used to test taylor expansions :[font = input; preserveAspect; startGroup] taylorudef = u[i_,j_]-> U[x0,y0]+ DuDx[x0,y0]*((i+1/2)*hx-x0)+ DuDy[x0,y0]*((j+1/2)*hy-y0)+ D2uDy2[x0,y0]/2*((i+1/2)*hx-x0)^2+ D2uDx2[x0,y0]/2*((j+1/2)*hy-y0)^2+ D2uDxDy[x0,y0]*((i+1/2)*hx-x0)*((j+1/2)*hy-y0) :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "DuDy" is similar to existing symbol "DuDx". :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "D2uDx2" is similar to existing symbol "D2uDy2". :[font = output; output; inactive; preserveAspect; endGroup] u[i_, j_] -> (hx*(1/2 + i) - x0)*DuDx[x0, y0] + (hy*(1/2 + j) - y0)*DuDy[x0, y0] + (hx*(1/2 + i) - x0)*(hy*(1/2 + j) - y0)*D2uDxDy[x0, y0] + ((hy*(1/2 + j) - y0)^2*D2uDx2[x0, y0])/2 + ((hx*(1/2 + i) - x0)^2*D2uDy2[x0, y0])/2 + U[x0, y0] ;[o] u[i_, j_] -> 1 (hx (- + i) - x0) DuDx[x0, y0] + 2 1 (hy (- + j) - y0) DuDy[x0, y0] + 2 1 1 (hx (- + i) - x0) (hy (- + j) - y0) D2uDxDy[x0, y0] + 2 2 1 2 (hy (- + j) - y0) D2uDx2[x0, y0] 2 --------------------------------- + 2 1 2 (hx (- + i) - x0) D2uDy2[x0, y0] 2 --------------------------------- + U[x0, y0] 2 :[font = input; preserveAspect] dog = dudy[i+half,j] //. {dudydef1,dudydef2,taylorudef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,x0->hx,y0->hy/2} :[font = output; output; inactive; preserveAspect; endGroup] DuDy[hx, hy/2] ;[o] hy DuDy[hx, --] 2 :[font = input; preserveAspect] dog = dudy[i,j+half] //. {dudydef1,dudydef2,taylorudef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,x0->hx/2,y0->hy} :[font = output; output; inactive; preserveAspect; endGroup] DuDy[hx/2, hy] ;[o] hx DuDy[--, hy] 2 :[font = input; preserveAspect] dog = dudx[i+half,j] //. {dudxdef,taylorudef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,x0->hx,y0->hy/2} :[font = output; output; inactive; preserveAspect; endGroup] DuDx[hx, hy/2] ;[o] hy DuDx[hx, --] 2 :[font = input; preserveAspect; startGroup] taylorvdef = v[i_,j_]-> V[x0,y0]+ DvDx[x0,y0]*((i+1/2)*hx-x0)+ DvDy[x0,y0]*((j+1/2)*hy-y0)+ D2vDy2[x0,y0]/2*((i+1/2)*hx-x0)^2+ D2vDx2[x0,y0]/2*((j+1/2)*hy-y0)^2+ D2vDxDy[x0,y0]*((i+1/2)*hx-x0)*((j+1/2)*hy-y0) :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "taylorvdef" is similar to existing symbol "taylorudef". :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "DvDx" is similar to existing symbol "DuDx". :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "DvDy" is similar to existing symbols {DuDy, DvDx}. :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "D2vDy2" is similar to existing symbol "D2uDy2". :[font = message; inactive; preserveAspect] General::stop: Further output of General::spell1 will be suppressed during this calculation. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "D2vDx2" is similar to existing symbols {D2uDx2, D2vDy2}. :[font = output; output; inactive; preserveAspect; endGroup] v[i_, j_] -> (hx*(1/2 + i) - x0)*DvDx[x0, y0] + (hy*(1/2 + j) - y0)*DvDy[x0, y0] + (hx*(1/2 + i) - x0)*(hy*(1/2 + j) - y0)*D2vDxDy[x0, y0] + ((hy*(1/2 + j) - y0)^2*D2vDx2[x0, y0])/2 + ((hx*(1/2 + i) - x0)^2*D2vDy2[x0, y0])/2 + V[x0, y0] ;[o] v[i_, j_] -> 1 (hx (- + i) - x0) DvDx[x0, y0] + 2 1 (hy (- + j) - y0) DvDy[x0, y0] + 2 1 1 (hx (- + i) - x0) (hy (- + j) - y0) D2vDxDy[x0, y0] + 2 2 1 2 (hy (- + j) - y0) D2vDx2[x0, y0] 2 --------------------------------- + 2 1 2 (hx (- + i) - x0) D2vDy2[x0, y0] 2 --------------------------------- + V[x0, y0] 2 :[font = input; preserveAspect] dog = dvdy[i,j+half] //. {dvdydef, taylorvdef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,x0->hx/2,y0->hy} :[font = output; output; inactive; preserveAspect; endGroup] DvDy[hx/2, hy] ;[o] hx DvDy[--, hy] 2 :[font = input; preserveAspect] dog = dvdx[i,j+half] //. {dvdxdef1,dvdxdef2,taylorvdef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,x0->hx/2,y0->hy} :[font = output; output; inactive; preserveAspect; endGroup] DvDx[hx/2, hy] ;[o] hx DvDx[--, hy] 2 :[font = input; preserveAspect] dog = dvdx[i+half,j] //. {dvdxdef1,dvdxdef2,taylorvdef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,x0->hx,y0->hy/2} :[font = output; output; inactive; preserveAspect; endGroup] DvDx[hx, hy/2] ;[o] hy DvDx[hx, --] 2 :[font = input; preserveAspect; startGroup] taylormudef = mu[i_,j_]-> MU[x0,y0]+ DmuDx[x0,y0]*((i+1/2)*hx-x0)+ DmuDy[x0,y0]*((j+1/2)*hy-y0) :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "taylormudef" is similar to existing symbol "taylorudef". :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "DmuDx" is similar to existing symbol "DuDx". :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "DmuDy" is similar to existing symbols {DmuDx, DuDy}. :[font = output; output; inactive; preserveAspect; endGroup; endGroup] mu[i_, j_] -> (hx*(1/2 + i) - x0)*DmuDx[x0, y0] + (hy*(1/2 + j) - y0)*DmuDy[x0, y0] + MU[x0, y0] ;[o] mu[i_, j_] -> 1 (hx (- + i) - x0) DmuDx[x0, y0] + 2 1 (hy (- + j) - y0) DmuDy[x0, y0] + MU[x0, y0] 2 :[font = section; inactive; preserveAspect; startGroup] tests :[font = input; preserveAspect] dog = tauxx[i+half,j] //. {tauxxdef,dudxdef,taylormudef,taylorudef}; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,x0->hx,y0 -> hy/2 } :[font = output; output; inactive; preserveAspect; endGroup] 2*DuDx[hx, hy/2]*MU[hx, hy/2] ;[o] hy hy 2 DuDx[hx, --] MU[hx, --] 2 2 :[font = input; preserveAspect] dog = tauyy[i,j+half] //. {tauyydef,dvdydef,taylormudef,taylorvdef}; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,x0->hx/2,y0->hy} :[font = output; output; inactive; preserveAspect; endGroup] 2*DvDy[hx/2, hy]*MU[hx/2, hy] ;[o] hx hx 2 DvDy[--, hy] MU[--, hy] 2 2 :[font = input; preserveAspect] dog = tauxy[i,j+half] //. {tauxydef,dudydef1,dudydef2,dvdxdef1,dvdxdef2, taylormudef,taylorudef,taylorvdef}; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,x0->hx/2,y0->hy} :[font = output; output; inactive; preserveAspect; endGroup] (DuDy[hx/2, hy] + DvDx[hx/2, hy])*MU[hx/2, hy] ;[o] hx hx hx (DuDy[--, hy] + DvDx[--, hy]) MU[--, hy] 2 2 2 :[font = input; preserveAspect] dog = tauxy[i+half,j] //. {tauxydef,dudydef1,dudydef2,dvdxdef1,dvdxdef2, taylormudef,taylorudef,taylorvdef}; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,x0->hx,y0->hy/2} :[font = output; output; inactive; preserveAspect; endGroup; endGroup] (DuDy[hx, hy/2] + DvDx[hx, hy/2])*MU[hx, hy/2] ;[o] hy hy hy (DuDy[hx, --] + DvDx[hx, --]) MU[hx, --] 2 2 2 :[font = section; inactive; preserveAspect; startGroup] definitions used for fortran output :[font = input; preserveAspect; startGroup] murepl1 = mu[i_,j_+half] -> muY[i,j+1] :[font = output; output; inactive; preserveAspect; endGroup] mu[i_, half + (j_)] -> muY[i, 1 + j] ;[o] mu[i_, half + (j_)] -> muY[i, 1 + j] :[font = input; preserveAspect; startGroup] murepl2 = mu[i_+half,j_] -> muX[i+1,j] :[font = output; output; inactive; preserveAspect; endGroup] mu[half + (i_), j_] -> muX[1 + i, j] ;[o] mu[half + (i_), j_] -> muX[1 + i, j] :[font = input; preserveAspect; startGroup] urepl = u[i_,j_] -> U[i,j,1] :[font = output; output; inactive; preserveAspect; endGroup] u[i_, j_] -> U[i, j, 1] ;[o] u[i_, j_] -> U[i, j, 1] :[font = input; preserveAspect; startGroup] vrepl = v[i_,j_] -> U[i,j,2] :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "vrepl" is similar to existing symbol "urepl". :[font = output; output; inactive; preserveAspect; endGroup] v[i_, j_] -> U[i, j, 2] ;[o] v[i_, j_] -> U[i, j, 2] :[font = input; preserveAspect; startGroup] tauxy[i,j+half] //. {tauxydef,dudydef1,dudydef2,dvdxdef1,dvdxdef2, murepl1,murepl2,urepl,vrepl} :[font = output; output; inactive; preserveAspect; endGroup] muY[i, 1 + j]*((-U[i, j, 1] + U[i, 1 + j, 1])/hy + (-U[-1 + i, j, 2] - U[-1 + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2])/(4*hx)) ;[o] -U[i, j, 1] + U[i, 1 + j, 1] muY[i, 1 + j] (---------------------------- + hy (-U[-1 + i, j, 2] - U[-1 + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2]) / (4 hx)) :[font = input; preserveAspect; startGroup] (tauxy[i,j+half]-tauxy[i,j-1+half]+ tauxx[i+half,j]-tauxx[i-1+half,j]) //. {tauxxdef,tauxydef, dudydef1,dudydef2,dvdxdef1,dvdxdef2,dudxdef,dvdydef, murepl1,murepl2,urepl,vrepl} :[font = output; output; inactive; preserveAspect; endGroup] (-2*muX[i, j]*(-U[-1 + i, j, 1] + U[i, j, 1]))/hx + (2*muX[1 + i, j]*(-U[i, j, 1] + U[1 + i, j, 1]))/hx - muY[i, j]*((-U[i, -1 + j, 1] + U[i, j, 1])/hy + (-U[-1 + i, -1 + j, 2] - U[-1 + i, j, 2] + U[1 + i, -1 + j, 2] + U[1 + i, j, 2])/(4*hx)) + muY[i, 1 + j]*((-U[i, j, 1] + U[i, 1 + j, 1])/hy + (-U[-1 + i, j, 2] - U[-1 + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2])/(4*hx)) ;[o] -2 muX[i, j] (-U[-1 + i, j, 1] + U[i, j, 1]) -------------------------------------------- + hx 2 muX[1 + i, j] (-U[i, j, 1] + U[1 + i, j, 1]) ---------------------------------------------- - hx -U[i, -1 + j, 1] + U[i, j, 1] muY[i, j] (----------------------------- + hy (-U[-1 + i, -1 + j, 2] - U[-1 + i, j, 2] + U[1 + i, -1 + j, 2] + U[1 + i, j, 2]) / (4 hx)) + -U[i, j, 1] + U[i, 1 + j, 1] muY[i, 1 + j] (---------------------------- + hy (-U[-1 + i, j, 2] - U[-1 + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2]) / (4 hx)) :[font = subsection; inactive; preserveAspect; startGroup] Extract stencil information from operator :[font = input; preserveAspect; startGroup] dog = alpha*a[i,j]*U[i,j,1]- beta*(hy*(tauxx[i+half,j]-tauxx[i-1+half,j]) + hx*(tauxy[i,j+half]-tauxy[i,j-1+half]))/vol //. {tauxxdef,tauxydef, dudydef1,dudydef2,dvdxdef1,dvdxdef2, dudxdef,dvdydef, murepl1,murepl2,urepl,vrepl,vol->hx*hy} :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "beta" is similar to existing symbol "Beta". :[font = output; output; inactive; preserveAspect; endGroup] alpha*a[i, j]*U[i, j, 1] - (beta*(hy*((-2*muX[i, j]*(-U[-1 + i, j, 1] + U[i, j, 1]))/ hx + (2*muX[1 + i, j]* (-U[i, j, 1] + U[1 + i, j, 1]))/hx) + hx*(-(muY[i, j]*((-U[i, -1 + j, 1] + U[i, j, 1])/ hy + (-U[-1 + i, -1 + j, 2] - U[-1 + i, j, 2] + U[1 + i, -1 + j, 2] + U[1 + i, j, 2])/(4*hx))) + muY[i, 1 + j]*((-U[i, j, 1] + U[i, 1 + j, 1])/ hy + (-U[-1 + i, j, 2] - U[-1 + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2])/(4*hx)))))/(hx*hy) ;[o] alpha a[i, j] U[i, j, 1] - -2 muX[i, j] (-U[-1 + i, j, 1] + U[i, j, 1]) (beta (hy (-------------------------------------------- + hx 2 muX[1 + i, j] (-U[i, j, 1] + U[1 + i, j, 1]) ----------------------------------------------) + hx -U[i, -1 + j, 1] + U[i, j, 1] hx (-(muY[i, j] (----------------------------- + hy (-U[-1 + i, -1 + j, 2] - U[-1 + i, j, 2] + U[1 + i, -1 + j, 2] + U[1 + i, j, 2]) / (4 hx))) + -U[i, j, 1] + U[i, 1 + j, 1] muY[i, 1 + j] (---------------------------- + hy (-U[-1 + i, j, 2] - U[-1 + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2]) / (4 hx))))) / (hx hy) :[font = input; preserveAspect; startGroup] Coefficient[Expand[dog],U[i,j,1]] :[font = output; output; inactive; preserveAspect; endGroup] alpha*a[i, j] + (2*beta*muX[i, j])/hx^2 + (2*beta*muX[1 + i, j])/hx^2 + (beta*muY[i, j])/hy^2 + (beta*muY[i, 1 + j])/hy^2 ;[o] 2 beta muX[i, j] 2 beta muX[1 + i, j] alpha a[i, j] + ---------------- + -------------------- + 2 2 hx hx beta muY[i, j] beta muY[i, 1 + j] -------------- + ------------------ 2 2 hy hy :[font = input; preserveAspect; startGroup] Coefficient[Expand[dog],U[i+1,j,1]] :[font = output; output; inactive; preserveAspect; endGroup] (-2*beta*muX[1 + i, j])/hx^2 ;[o] -2 beta muX[1 + i, j] --------------------- 2 hx :[font = input; preserveAspect; startGroup] Coefficient[Expand[dog],U[i-1,j,1]] :[font = output; output; inactive; preserveAspect; endGroup] (-2*beta*muX[i, j])/hx^2 ;[o] -2 beta muX[i, j] ----------------- 2 hx :[font = input; preserveAspect; startGroup] Coefficient[Expand[dog],U[i,j+1,1]] :[font = output; output; inactive; preserveAspect; endGroup] -((beta*muY[i, 1 + j])/hy^2) ;[o] beta muY[i, 1 + j] -(------------------) 2 hy :[font = input; preserveAspect; startGroup] Coefficient[Expand[dog],U[i,j-1,1]] :[font = output; output; inactive; preserveAspect; endGroup] -((beta*muY[i, j])/hy^2) ;[o] beta muY[i, j] -(--------------) 2 hy :[font = input; preserveAspect; startGroup] dog = alpha*a[i,j]*U[i,j,2] - beta*(hy*(tauxy[i+half,j]-tauxy[i-1+half,j])+ hx*(tauyy[i,j+half]-tauyy[i,j-1+half]))/vol //. {tauyydef,tauxydef, dudydef1,dudydef2,dvdxdef1,dvdxdef2, dudxdef,dvdydef, murepl1,murepl2,urepl,vrepl,vol->hx*hy} :[font = output; output; inactive; preserveAspect; endGroup] alpha*a[i, j]*U[i, j, 2] - (beta*(hx*((-2*muY[i, j]*(-U[i, -1 + j, 2] + U[i, j, 2]))/ hy + (2*muY[i, 1 + j]* (-U[i, j, 2] + U[i, 1 + j, 2]))/hy) + hy*(-(muX[i, j]*((-U[-1 + i, j, 2] + U[i, j, 2])/ hx + (-U[-1 + i, -1 + j, 1] + U[-1 + i, 1 + j, 1] - U[i, -1 + j, 1] + U[i, 1 + j, 1])/(4*hy))) + muX[1 + i, j]*((-U[i, j, 2] + U[1 + i, j, 2])/ hx + (-U[i, -1 + j, 1] + U[i, 1 + j, 1] - U[1 + i, -1 + j, 1] + U[1 + i, 1 + j, 1])/ (4*hy)))))/(hx*hy) ;[o] alpha a[i, j] U[i, j, 2] - -2 muY[i, j] (-U[i, -1 + j, 2] + U[i, j, 2]) (beta (hx (-------------------------------------------- + hy 2 muY[i, 1 + j] (-U[i, j, 2] + U[i, 1 + j, 2]) ----------------------------------------------) + hy -U[-1 + i, j, 2] + U[i, j, 2] hy (-(muX[i, j] (----------------------------- + hx (-U[-1 + i, -1 + j, 1] + U[-1 + i, 1 + j, 1] - U[i, -1 + j, 1] + U[i, 1 + j, 1]) / (4 hy))) + -U[i, j, 2] + U[1 + i, j, 2] muX[1 + i, j] (---------------------------- + hx (-U[i, -1 + j, 1] + U[i, 1 + j, 1] - U[1 + i, -1 + j, 1] + U[1 + i, 1 + j, 1]) / (4 hy))))) / (hx hy) :[font = input; preserveAspect; startGroup] Coefficient[Expand[dog],U[i,j,2]] :[font = output; output; inactive; preserveAspect; endGroup] alpha*a[i, j] + (beta*muX[i, j])/hx^2 + (beta*muX[1 + i, j])/hx^2 + (2*beta*muY[i, j])/hy^2 + (2*beta*muY[i, 1 + j])/hy^2 ;[o] beta muX[i, j] beta muX[1 + i, j] alpha a[i, j] + -------------- + ------------------ + 2 2 hx hx 2 beta muY[i, j] 2 beta muY[i, 1 + j] ---------------- + -------------------- 2 2 hy hy :[font = input; preserveAspect; startGroup] Coefficient[Expand[dog],U[i+1,j,2]] :[font = output; output; inactive; preserveAspect; endGroup] -((beta*muX[1 + i, j])/hx^2) ;[o] beta muX[1 + i, j] -(------------------) 2 hx :[font = input; preserveAspect; startGroup] Coefficient[Expand[dog],U[i-1,j,2]] :[font = output; output; inactive; preserveAspect; endGroup] -((beta*muX[i, j])/hx^2) ;[o] beta muX[i, j] -(--------------) 2 hx :[font = input; preserveAspect; startGroup] Coefficient[Expand[dog],U[i,j+1,2]] :[font = output; output; inactive; preserveAspect; endGroup] (-2*beta*muY[i, 1 + j])/hy^2 ;[o] -2 beta muY[i, 1 + j] --------------------- 2 hy :[font = input; preserveAspect; startGroup] Coefficient[Expand[dog],U[i,j-1,2]] :[font = output; output; inactive; preserveAspect; endGroup] (-2*beta*muY[i, j])/hy^2 ;[o] -2 beta muY[i, j] ----------------- 2 hy :[font = subsubsection; inactive; preserveAspect; startGroup] dependentCellsNotCovered is a function which returns a logical expression suitable for inclusion in fortran. Give an expression, exp, we wish to determine which mesh locations are accessed by the expression. However, we do not wish to examine all possible locations, only those outside the grid patch region. So we provide a second argument, which is a boolean function taking two arguments. The combination will give logical expressions testing the mask for cells utilized by the expression and for which the boolean function, logfunc[il,jl], evaluates as true. The third argument is the name of the mask array :[font = input; preserveAspect] Clear[ dependentCellsNotCovered ] :[font = input; preserveAspect; endGroup] dependentCellsNotCovered[exp_ , logfunc_ ,maskfun_] := Module[{cond,lexp}, cond = False; lexp = exp; For[il=-2,il<=+2,il++, For[jl=-2,jl<=+2,jl++, For[kl=1,kl<=2,kl++, If[ (logfunc[il,jl]) && (Coefficient[ Expand[ exp ] , U[i+il,j+jl,kl] ] =!= 0), cond = cond || (maskfun[i+il,j+jl]>0) ] ] ] ]; cond ] :[font = subsubsection; inactive; preserveAspect; startGroup] dependentCellsCovered is more or less the converse of dependentCellsNotCovered. dependentCellsCovered will return true if all the cells in the expression (properly restricted by the mask function) ARE covered. dependentCellsNotCovered returned true if one or more of the cells were not covered. :[font = input; preserveAspect] Clear[ dependentCellsCovered ] :[font = input; preserveAspect; endGroup] dependentCellsCovered[exp_ , logfunc_ ,maskfun_] := Module[{cond,lexp}, cond = True; lexp = exp; For[il=-2,il<=+2,il++, For[jl=-2,jl<=+2,jl++, For[kl=1,kl<=2,kl++, If[ (logfunc[il,jl]) && (Coefficient[ Expand[ exp ] , U[i+il,j+jl,kl] ] =!= 0), cond = cond && (maskfun[i+il,j+jl]==0) ] ] ] ]; cond ] :[font = subsubsection; inactive; preserveAspect; startGroup] this is an alternate definition which treats cells with mask .eq. 1 as untrusted, rather than mask .gt. 0 :[font = input; preserveAspect] dependentCellsNotCoveredalt[exp_ , logfunc_ ,maskfun_] := Module[{cond,lexp}, cond = False; lexp = exp; For[il=-2,il<=+2,il++, For[jl=-2,jl<=+2,jl++, For[kl=1,kl<=2,kl++, If[ (logfunc[il,jl]) && (Coefficient[ Expand[ exp ] , U[i+il,j+jl,kl] ] =!= 0), cond = cond || (maskfun[i+il,j+jl]==1) ] ] ] ]; cond ] :[font = input; preserveAspect; startGroup] dependentCellsNotCovered[abba*U[i+1,j-1,1]+U[i-1,j-1,2] , (#2<0)& , masks ] :[font = output; output; inactive; preserveAspect; endGroup] masks[-1 + i, -1 + j] > 0 || masks[1 + i, -1 + j] > 0 ;[o] masks[-1 + i, -1 + j] > 0 || masks[1 + i, -1 + j] > 0 :[font = input; preserveAspect] f[x_] := f1*(x-x2)(x-x3)/(x1-x2)/(x1-x3)+ f2*(x-x1)(x-x3)/(x2-x1)/(x2-x3)+ f3*(x-x1)(x-x2)/(x3-x1)/(x3-x2) :[font = input; preserveAspect; startGroup] dog = Simplify[ D[f[x],x] /. {x1->0,x2->-h,x3->-2*h,x->0} ] :[font = output; output; inactive; preserveAspect; endGroup] (3*f1 - 4*f2 + f3)/(2*h) ;[o] 3 f1 - 4 f2 + f3 ---------------- 2 h :[font = input; preserveAspect; startGroup] dog /. {f1->0, f2->h^2, f3->4*h^2 } :[font = output; output; inactive; preserveAspect; endGroup] 0 ;[o] 0 :[font = input; preserveAspect; startGroup] dog /. {f1->0,f2->h^3,f3->8*h^3} :[font = output; output; inactive; preserveAspect; endGroup] 2*h^2 ;[o] 2 2 h :[font = input; preserveAspect; startGroup] dog = Simplify[ D[f[x],x,x] /. {x1->0,x2->-h,x3->-2*h,x->0} ] :[font = output; output; inactive; preserveAspect; endGroup; endGroup; endGroup] (f1 - 2*f2 + f3)/h^2 ;[o] f1 - 2 f2 + f3 -------------- 2 h :[font = subsection; inactive; preserveAspect; startGroup] definitions for Do One-sided Derivative in X direction. if sign is positive, it means extend the stencil in the positivie x direction. if negative, extend in other direction :[font = input; preserveAspect] DOneX[u_,i_,j_,sign_] := (-u[i+2,j]+4*u[i+1,j]-3*u[i,j])/ (2*hx) /; sign==1 :[font = input; preserveAspect] DOneX[u_,i_,j_,sign_] := (u[i-2,j]-4*u[i-1,j]+3*u[i,j])/ (2*hx) /; sign==-1 :[font = input; preserveAspect] DOneX[u_,i_,j_,k_,sign_] := (-u[i+2,j,k]+4*u[i+1,j,k]- 3*u[i,j,k])/(2*hx) /; sign==1 :[font = input; preserveAspect] DOneX[u_,i_,j_,k_,sign_] := (u[i-2,j,k]-4*u[i-1,j,k]+ 3*u[i,j,k])/(2*hx) /; sign==-1 :[font = input; preserveAspect; startGroup] Simplify[ DOneX[u,0,0,-1] //. {taylorudef,x0->hx/2,y0->hy/2}] :[font = output; output; inactive; preserveAspect; endGroup] DuDx[hx/2, hy/2] ;[o] hx hy DuDx[--, --] 2 2 :[font = input; preserveAspect; startGroup] Simplify[ DOneX[u,0,0,+1] //. {taylorudef,x0->hx/2,y0->hy/2}] :[font = output; output; inactive; preserveAspect; endGroup; endGroup] DuDx[hx/2, hy/2] ;[o] hx hy DuDx[--, --] 2 2 :[font = subsection; inactive; preserveAspect; startGroup] definitions for Do One-sided Derivative in Y direction. if sign is positive, it means extend the stencil in the positivie y direction. if negative, extend in other direction :[font = input; preserveAspect; startGroup] DOneY[u_,i_,j_,sign_] := (-u[i,j+2]+4*u[i,j+1]-3*u[i,j])/ (2*hy) /; sign==1 :[font = message; inactive; preserveAspect; endGroup] General::spell1: Possible spelling error: new symbol name "DOneY" is similar to existing symbol "DOneX". :[font = input; preserveAspect] DOneY[u_,i_,j_,sign_] := (u[i,j-2]-4*u[i,j-1]+3*u[i,j])/ (2*hy) /; sign==-1 :[font = input; preserveAspect] DOneY[u_,i_,j_,k_,sign_] := (-u[i,j+2,k]+4*u[i,j+1,k]- 3*u[i,j,k])/(2*hy) /; sign==1 :[font = input; preserveAspect] DOneY[u_,i_,j_,k_,sign_] := (u[i,j-2,k]-4*u[i,j-1,k]+ 3*u[i,j,k])/(2*hy) /; sign==-1 :[font = input; preserveAspect; startGroup] Simplify[ DOneY[u,0,0,-1] //. {taylorudef,x0->hx/2,y0->hy/2}] :[font = output; output; inactive; preserveAspect; endGroup] DuDy[hx/2, hy/2] ;[o] hx hy DuDy[--, --] 2 2 :[font = input; preserveAspect; startGroup] Simplify[ DOneY[u,0,0,+1] //. {taylorudef,x0->hx/2,y0->hy/2}] :[font = output; output; inactive; preserveAspect; endGroup; endGroup] DuDy[hx/2, hy/2] ;[o] hx hy DuDy[--, --] 2 2 :[font = subsection; inactive; preserveAspect; startGroup] definitions for two sided deriv in x direction. :[font = input; preserveAspect] DTwoX[u_,i_,j_] := (u[i+1,j]-u[i-1,j])/(2*hx) :[font = input; preserveAspect] DTwoX[u_,i_,j_,k_] := (u[i+1,j,k]-u[i-1,j,k])/(2*hx) :[font = input; preserveAspect; startGroup] Simplify[ DTwoX[u,0,0] //. {taylorudef,x0->hx/2,y0->hy/2} ] :[font = output; output; inactive; preserveAspect; endGroup] DuDx[hx/2, hy/2] ;[o] hx hy DuDx[--, --] 2 2 :[font = input; preserveAspect; startGroup] DTwoY[u_,i_,j_] := (u[i,j+1]-u[i,j-1])/(2*hy) :[font = message; inactive; preserveAspect; endGroup] General::spell1: Possible spelling error: new symbol name "DTwoY" is similar to existing symbol "DTwoX". :[font = input; preserveAspect] DTwoY[u_,i_,j_,k_] := (u[i,j+1,k]-u[i,j-1,k])/(2*hy) :[font = input; preserveAspect; startGroup] Simplify[ DTwoY[u,0,0] //. {taylorudef,x0->hx/2,y0->hy/2} ] :[font = output; output; inactive; preserveAspect; endGroup] DuDy[hx/2, hy/2] ;[o] hx hy DuDy[--, --] 2 2 :[font = input; preserveAspect; endGroup; endGroup] DeleteFile[ "dog.mf"]; CopyFile[ "DV_2D.mF" , "dog.mf"]; Splice["dog.mf"]; DeleteFile[ "DV_2D.F"]; CopyFile[ "dog.f", "DV_2D.F" ]; <<"!touch DV_2D.F" :[font = section; inactive; preserveAspect; startGroup] Start figuring out how to write stencil :[font = input; preserveAspect; startGroup] out1 = alpha*a[i,j]*U[i,j,1]- beta*(hy*(tauxx[i+half,j]-tauxx[i-1+half,j]) + hx*(tauxy[i,j+half]-tauxy[i,j-1+half]))/vol //. {tauxxdef,tauxydef, dudydef1,dudydef2,dvdxdef1,dvdxdef2, dudxdef,dvdydef, murepl1,murepl2,urepl,vrepl,vol->hx*hy} :[font = output; output; inactive; preserveAspect; endGroup] alpha*a[i, j]*U[i, j, 1] - (beta*(hy*((-2*muX[i, j]*(-U[-1 + i, j, 1] + U[i, j, 1]))/ hx + (2*muX[1 + i, j]* (-U[i, j, 1] + U[1 + i, j, 1]))/hx) + hx*(-(muY[i, j]*((-U[i, -1 + j, 1] + U[i, j, 1])/hy + (-U[-1 + i, -1 + j, 2] - U[-1 + i, j, 2] + U[1 + i, -1 + j, 2] + U[1 + i, j, 2])/ (4*hx))) + muY[i, 1 + j]*((-U[i, j, 1] + U[i, 1 + j, 1])/hy + (-U[-1 + i, j, 2] - U[-1 + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2])/(4*hx))) ))/(hx*hy) ;[o] alpha a[i, j] U[i, j, 1] - -2 muX[i, j] (-U[-1 + i, j, 1] + U[i, j, 1]) (beta (hy (-------------------------------------------- + hx 2 muX[1 + i, j] (-U[i, j, 1] + U[1 + i, j, 1]) ----------------------------------------------) + hx -U[i, -1 + j, 1] + U[i, j, 1] hx (-(muY[i, j] (----------------------------- + hy (-U[-1 + i, -1 + j, 2] - U[-1 + i, j, 2] + U[1 + i, -1 + j, 2] + U[1 + i, j, 2]) / (4 hx))) + -U[i, j, 1] + U[i, 1 + j, 1] muY[i, 1 + j] (---------------------------- + hy (-U[-1 + i, j, 2] - U[-1 + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2]) / (4 hx) )))) / (hx hy) :[font = input; preserveAspect; startGroup] Coefficient[Expand[out1],U[i,j,1]] :[font = output; output; inactive; preserveAspect; endGroup] alpha*a[i, j] + (2*beta*muX[i, j])/hx^2 + (2*beta*muX[1 + i, j])/hx^2 + (beta*muY[i, j])/hy^2 + (beta*muY[i, 1 + j])/hy^2 ;[o] 2 beta muX[i, j] 2 beta muX[1 + i, j] alpha a[i, j] + ---------------- + -------------------- + 2 2 hx hx beta muY[i, j] beta muY[i, 1 + j] -------------- + ------------------ 2 2 hy hy :[font = subsection; inactive; preserveAspect; startGroup] setup to use the Format.m package :[font = input; preserveAspect] Off[General::spell,General::spell1]; :[font = input; preserveAspect] SetOptions[$Output,PageWidth->73]; :[font = input; preserveAspect; startGroup] <{muY,muX,a,coef,polycoef}] ] :[font = input; preserveAspect] stencilInc[exp_,kin_] := Block[{iind,il,jl,kl,list1,list2,indices,tmp,indtrn}, indices={ { 0, 0,KO}, {-1, 0,KW}, { 0,-1,KS}, {-1,-1,KSW}, {-1,+1,KNW} }; list1={}; list2={}; For[iind=1,iind<=5,iind++, il = indices[[iind,1]]; jl = indices[[iind,2]]; indtrn = indices[[iind,3]]; For[kl=1,kl<=2,kl++, tmp=Coefficient[Expand[exp],U[i+il,j+jl,kl]]; If[tmp=!=0, list1=Append[list1,coef[i,j,indtrn,kin,kl]]; list2=Append[list2,coef[i,j,indtrn,kin,kl]+ Coefficient[Expand[exp],U[i+il,j,kl]]] ] ] ]; FortranAssign[Evaluate[list1],list2, AssignToArray->{muY,muX,a,coef,polycoef}] ] :[font = input; preserveAspect; endGroup] stencilDec[exp_,kin_] := Block[{iind,il,jl,kl,list1,list2,indices,tmp,indtrn}, indices={ { 0, 0,KO}, {-1, 0,KW}, { 0,-1,KS}, {-1,-1,KSW}, {-1,+1,KNW} }; list1={}; list2={}; For[iind=1,iind<=5,iind++, il = indices[[iind,1]]; jl = indices[[iind,2]]; indtrn = indices[[iind,3]]; For[kl=1,kl<=2,kl++, tmp=Coefficient[Expand[exp],U[i+il,j+jl,kl]]; If[tmp=!=0, list1=Append[list1,coef[i,jl,indtrn,kin,kl]]; list2=Append[list2,coef[i,j,indtrn,kin,kl]- Coefficient[Expand[exp],U[i+il,j,kl]]] ] ] ]; FortranAssign[Evaluate[list1],list2, AssignToArray->{muY,muX,a,coef,polycoef}] ] :[font = subsection; inactive; preserveAspect; startGroup] This is slight variation on dependentCellsNotCovered. Uses Format.m :[font = input; preserveAspect] Clear[ depCellNotCovered ] :[font = input; preserveAspect] dependentCellIsCovered[exp_ , logfunc_ ,maskfun_] := Module[{cond,lexp}, cond = False; lexp = exp; For[il=-2,il<=+2,il++, For[jl=-2,jl<=+2,jl++, For[kl=1,kl<=2,kl++, If[ (logfunc[il,jl]) && (Coefficient[ Expand[ exp ] , U[i+il,j+jl,kl] ] =!= 0), cond = cond || (maskfun[i+il,j+jl]>0) ] ] ] ]; FortranAssign[ cond, AssignToArray->{maskray} ] ] :[font = input; preserveAspect] Clear[stencoef] :[font = input; preserveAspect; startGroup] stencilDef[out1,1] :[font = output; output; inactive; preserveAspect; fontLeading = 0; endGroup] coef(i,j,KO,1,1)=alpha*a(i,j)+2.d0*beta*muX(i,j)/hx & **2+2.d0*beta*muX(1+i,j)/hx**2+beta*muY(i,j)/hy**2+ & beta*muY(i,1+j)/hy**2 coef(i,j,KW,1,1)=-2.d0*beta*muX(i,j)/hx**2 coef(i,j,KW,1,2)=-2.5d-1*beta*muY(i,j)/(hx*hy)+2.5d & -1*beta*muY(i,1+j)/(hx*hy) coef(i,j,KS,1,1)=alpha*a(i,j)+2.d0*beta*muX(i,j)/hx & **2+2.d0*beta*muX(1+i,j)/hx**2+beta*muY(i,j)/hy**2+ & beta*muY(i,1+j)/hy**2 coef(i,j,KSW,1,2)=-2.5d-1*beta*muY(i,j)/(hx*hy)+2.5 & d-1*beta*muY(i,1+j)/(hx*hy) coef(i,j,KNW,1,2)=-2.5d-1*beta*muY(i,j)/(hx*hy)+2.5 & d-1*beta*muY(i,1+j)/(hx*hy) ;[o] coef(i,j,KO,1,1)=alpha*a(i,j)+2.d0*beta*muX(i,j)/hx & **2+2.d0*beta*muX(1+i,j)/hx**2+beta*muY(i,j)/hy**2+ & beta*muY(i,1+j)/hy**2 coef(i,j,KW,1,1)=-2.d0*beta*muX(i,j)/hx**2 coef(i,j,KW,1,2)=-2.5d-1*beta*muY(i,j)/(hx*hy)+2.5d & -1*beta*muY(i,1+j)/(hx*hy) coef(i,j,KS,1,1)=alpha*a(i,j)+2.d0*beta*muX(i,j)/hx & **2+2.d0*beta*muX(1+i,j)/hx**2+beta*muY(i,j)/hy**2+ & beta*muY(i,1+j)/hy**2 coef(i,j,KSW,1,2)=-2.5d-1*beta*muY(i,j)/(hx*hy)+2.5 & d-1*beta*muY(i,1+j)/(hx*hy) coef(i,j,KNW,1,2)=-2.5d-1*beta*muY(i,j)/(hx*hy)+2.5 & d-1*beta*muY(i,1+j)/(hx*hy) :[font = input; preserveAspect; startGroup] dog1 = Expand[ vol*(alpha*a[i,j]*U[i,j,1]- beta*(hy*(tauxx[i+half,j]-tauxx[i-1+half,j]) + hx*(tauxy[i,j+half]-tauxy[i,j-1+half]))/vol ) //. {tauxxdef,tauxydef, murepl1,murepl2,urepl,vrepl,vol->hx*hy} ] //InputForm :[font = output; output; inactive; preserveAspect; fontLeading = 0; endGroup] InputForm[2*beta*hy*dudx[-1 + half + i, j]*muX[i, j] - 2*beta*hy*dudx[half + i, j]*muX[1 + i, j] + beta*hx*dudy[i, -1 + half + j]*muY[i, j] + beta*hx*dvdx[i, -1 + half + j]*muY[i, j] - beta*hx*dudy[i, half + j]*muY[i, 1 + j] - beta*hx*dvdx[i, half + j]*muY[i, 1 + j] + alpha*hx*hy*a[i, j]*U[i, j, 1]] ;[o] 2*beta*hy*dudx[-1 + half + i, j]*muX[i, j] - 2*beta*hy*dudx[half + i, j]*muX[1 + i, j] + beta*hx*dudy[i, -1 + half + j]*muY[i, j] + beta*hx*dvdx[i, -1 + half + j]*muY[i, j] - beta*hx*dudy[i, half + j]*muY[i, 1 + j] - beta*hx*dvdx[i, half + j]*muY[i, 1 + j] + alpha*hx*hy*a[i, j]*U[i, j, 1] :[font = input; preserveAspect; startGroup] Splice[ "dog.mf",FormatType->OutputForm] :[font = message; inactive; preserveAspect] Splice::splicx: Syntax error in Mathematica input dependentCellsNotCovered[DOneX[u,i,j+1,+1]//.. allDerivAllUV, Function[{i,j},(j>0),mask] :[font = output; output; inactive; preserveAspect; endGroup] Splice["dog.mf", FormatType -> OutputForm] ;[o] Splice[dog.mf, FormatType -> OutputForm] :[font = input; preserveAspect; startGroup] Splice[ "ratdog.mf",FormatType->OutputForm] :[font = output; output; inactive; preserveAspect; endGroup] "ratdog.mf" ;[o] ratdog.mf :[font = input; preserveAspect; startGroup] exntop+exnbot :[font = output; output; inactive; preserveAspect; endGroup] (beta*muY[i, j]*(-U[-1 + i, -1 + j, 2] + U[1 + i, -1 + j, 2]))/4 + (beta*muY[i, j]*(-U[-1 + i, j, 2] + U[1 + i, j, 2]))/4 ;[o] (beta muY[i, j] (-U[-1 + i, -1 + j, 2] + U[1 + i, -1 + j, 2])) / 4 + beta muY[i, j] (-U[-1 + i, j, 2] + U[1 + i, j, 2]) -------------------------------------------------- 4 :[font = input; preserveAspect; startGroup] dependentCellIsCovered[exntop+exnbot,indexcond,maskray] :[font = output; output; inactive; preserveAspect; fontLeading = 0; endGroup] (masklox(-1+i,-1+j).gt.0).or.(masklox(-1+i,j).gt.0) ;[o] (masklox(-1+i,-1+j).gt.0).or.(masklox(-1+i,j).gt.0) :[font = input; preserveAspect; startGroup] Expand[exntop] :[font = output; output; inactive; preserveAspect; endGroup] -(beta*muY[i, j]*U[-1 + i, j, 2])/4 + (beta*muY[i, j]*U[1 + i, j, 2])/4 ;[o] -(beta muY[i, j] U[-1 + i, j, 2]) --------------------------------- + 4 beta muY[i, j] U[1 + i, j, 2] ----------------------------- 4 :[font = input; preserveAspect; startGroup] outdog = 2*beta*hy*dudx[-1+half+i,j] //. {dudxdef,u[i-1,j]->u[i,j]} :[font = output; output; inactive; preserveAspect; endGroup; endGroup; endGroup] 0 ;[o] 0 ^*)ccseapps-2.5/CCSEApps/tensorMG/MCINTERPBNDRYDATA_2D.F0000644000175000017500000006325211634153073022533 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "BC_TYPES.H" #include "REAL.H" #include "CONSTANTS.H" #include "MCINTERPBNDRYDATA_F.H" #include "ArrayLim.H" #define SDIM 2 #define NUMDERIV 2 #define XDER 1 #define X2DER 2 c --------------------------------------------------------------- c :: FORT_BDINTERPXLO : Interpolation on Xlo Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables in solution, half number in bdry c :: ratio => refinement ratio c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array c --------------------------------------------------------------- subroutine FORT_BDINTERPXLO (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratio,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives,hfine) integer nvar, ratio, not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(mask) integer DIMDEC(crse) integer DIMDEC(cb) REAL_T bdry(DIMV(bdry),2*nvar) REAL_T derives(DIM2(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T hfine REAL_T hcrse REAL_T xx integer i, j, ic, jc, off, n integer jclo, jchi jclo = ARG_L2(cb) jchi = ARG_H2(cb) ic = ARG_L1(cb)-1 i = lo(1)-1 hcrse = ratio*hfine do n = 1, nvar c ::::: define interp coefs do jc = jclo, jchi j = ratio*jc if( mask(i,j-1).eq.not_covered .and. & mask(i,j+ratio).eq.not_covered ) then derives(jc,XDER) = (crse(ic,jc+1,n)-crse(ic,jc-1,n))/(2*hcrse) derives(jc,X2DER) = (crse(ic,jc+1,n) & - crse(ic,jc ,n) * two & + crse(ic,jc-1,n))/hcrse**2 else if( mask(i,j-1).ne.not_covered .and. & mask(i,j+ratio).ne.not_covered ) then c ::: drop order by 2 derives(jc,XDER ) = zero derives(jc,X2DER) = zero else if( mask(i,j+ratio).eq. not_covered ) then c ::: j-1 bad, so try + dir if( jc+2 .le. jchi+1 ) then if( mask(i,j+2*ratio).eq.not_covered ) then c ::: can use 3 point stencils for j,j+1,j+2 derives(jc,XDER) = (-crse(ic,jc+2,n)+4*crse(ic,jc+1,n)- & 3*crse(ic,jc,n))/(2*hcrse) derives(jc,X2DER) = (crse(ic,jc+2,n)-2*crse(ic,jc+1,n) & +crse(ic,jc,n))/hcrse**2 else c ::: use j,j+1, drop order derives(jc,XDER) = (crse(ic,jc+1,n)-crse(ic,jc,n))/hcrse derives(jc,X2DER) = zero endif else c ::: use j,j+1, drop order derives(jc,XDER) = (crse(ic,jc+1,n)-crse(ic,jc,n))/hcrse derives(jc,X2DER) = zero endif else if( mask(i,j-1) .eq. not_covered ) then c ::: try - direction if( jc-2 .ge. jclo-1 ) then if( mask(i,j-1) .eq. not_covered ) then c ::: can use 3 point stencils derives(jc,XDER) = (crse(ic,jc-2,n)-4*crse(ic,jc-1,n) & +3*crse(ic,jc,n))/(2*hcrse) derives(jc,X2DER) = (crse(ic,jc-2,n)-2*crse(ic,jc-1,n) & +crse(ic,jc,n))/hcrse**2 else derives(jc,XDER) = (crse(ic,jc,n)-crse(ic,jc-1,n))/hcrse derives(jc,X2DER) = zero endif else derives(jc,XDER) = (crse(ic,jc,n)-crse(ic,jc-1,n))/hcrse derives(jc,X2DER) = zero endif else write(6,*)'impossible BDINTERPYLO' stop endif enddo do off = 0, ratio - 1 xx = (off+0.5)*hfine-hcrse/2 do jc = jclo, jchi j = ratio*jc + off bdry(i,j,n) = crse(ic,jc,n) & +derives(jc,XDER)*xx & +derives(jc,X2DER)*xx**2/2 bdry(i,j,n+nvar) = & derives(jc,XDER)+derives(jc,X2DER)*xx enddo enddo enddo return end c --------------------------------------------------------------- c :: FORT_BDINTERPXHI : Interpolation on Xhi Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables in solution, half number in bdry c :: ratio => refinement ratio c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array c --------------------------------------------------------------- subroutine FORT_BDINTERPXHI (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratio,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives,hfine) integer nvar, ratio, not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(mask) integer DIMDEC(cb) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),2*nvar) REAL_T derives(DIM2(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T hfine REAL_T hcrse REAL_T xx integer i, j, ic, jc, off, n integer jclo, jchi jclo = ARG_L2(cb) jchi = ARG_H2(cb) ic = ARG_H1(cb)+1 i = hi(1)+1 hcrse = ratio*hfine do n = 1, nvar c ::::: define interp coefs do jc = jclo, jchi j = ratio*jc if( mask(i,j-1).eq.not_covered .and. & mask(i,j+ratio).eq.not_covered ) then derives(jc,XDER) = (crse(ic,jc+1,n)-crse(ic,jc-1,n))/(2*hcrse) derives(jc,X2DER) = (crse(ic,jc+1,n) & - crse(ic,jc ,n) * two & + crse(ic,jc-1,n))/hcrse**2 else if( mask(i,j-1).ne.not_covered .and. & mask(i,j+ratio).ne.not_covered ) then c ::: drop order by 2 derives(jc,XDER ) = zero derives(jc,X2DER) = zero else if( mask(i,j+ratio).eq. not_covered ) then c ::: j-1 bad, so try + dir if( jc+2 .le. jchi+1 ) then if( mask(i,j+2*ratio).eq.not_covered ) then c ::: can use 3 point stencils for j,j+1,j+2 derives(jc,XDER) = (-crse(ic,jc+2,n)+4*crse(ic,jc+1,n)- & 3*crse(ic,jc,n))/(2*hcrse) derives(jc,X2DER) = (crse(ic,jc+2,n)-2*crse(ic,jc+1,n) & +crse(ic,jc,n))/hcrse**2 else c ::: use j,j+1, drop order derives(jc,XDER) = (crse(ic,jc+1,n)-crse(ic,jc,n))/hcrse derives(jc,X2DER) = zero endif else c ::: use j,j+1, drop order derives(jc,XDER) = (crse(ic,jc+1,n)-crse(ic,jc,n))/hcrse derives(jc,X2DER) = zero endif else if( mask(i,j-1) .eq. not_covered ) then c ::: try - direction if( jc-2 .ge. jclo-1 ) then if( mask(i,j-1) .eq. not_covered ) then c ::: can use 3 point stencils derives(jc,XDER) = (crse(ic,jc-2,n)-4*crse(ic,jc-1,n) & +3*crse(ic,jc,n))/(2*hcrse) derives(jc,X2DER) = (crse(ic,jc-2,n)-2*crse(ic,jc-1,n) & +crse(ic,jc,n))/hcrse**2 else derives(jc,XDER) = (crse(ic,jc,n)-crse(ic,jc-1,n))/hcrse derives(jc,X2DER) = zero endif else derives(jc,XDER) = (crse(ic,jc,n)-crse(ic,jc-1,n))/hcrse derives(jc,X2DER) = zero endif else write(6,*)'impossible BDINTERPYLO' stop endif enddo do off = 0, ratio - 1 xx = (off+0.5)*hfine-hcrse/2 do jc = jclo, jchi j = ratio*jc + off bdry(i,j,n) = crse(ic,jc,n) & +derives(jc,XDER)*xx & +derives(jc,X2DER)*xx**2/2 bdry(i,j,n+nvar) = & derives(jc,XDER)+derives(jc,X2DER)*xx enddo enddo enddo return end c --------------------------------------------------------------- c :: FORT_BDINTERPYLO : Interpolation on Ylo Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables in solution, half number in bdry c :: ratio => refinement ratio c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array c --------------------------------------------------------------- subroutine FORT_BDINTERPYLO (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratio,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives,hfine) integer nvar, ratio, not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(mask) integer DIMDEC(cb) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),2*nvar) REAL_T derives(DIM1(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx integer i, j, ic, jc, off, n integer iclo, ichi REAL_T hfine REAL_T hcrse iclo = ARG_L1(cb) ichi = ARG_H1(cb) jc = ARG_L2(cb)-1 j = lo(2)-1 hcrse = ratio*hfine do n = 1, nvar c ::::: define interp coefs do ic = iclo, ichi i = ratio*ic if( mask(i-1,j).eq.not_covered .and. & mask(i+ratio,j).eq.not_covered ) then c :::: use adjoining points derives(ic,XDER ) = (crse(ic+1,jc,n)-crse(ic-1,jc,n))/(2*hcrse) derives(ic,X2DER) = (crse(ic+1,jc,n)-2*crse(ic,jc,n)+ & crse(ic-1,jc,n))/hcrse**2 else if( mask(i-1,j).ne.not_covered .and. & mask(i+ratio,j).ne.not_covered ) then c :::: must drop order by two derives(ic,XDER ) = zero derives(ic,X2DER) = zero else if( mask(i+ratio,j).eq.not_covered ) then c ::: i-1 bad, try other direction if( ic+2 .le. ichi+1 ) then if( mask(i+2*ratio,j).eq.not_covered ) then c ::: can use 3 points stencils for i,i+1,i+2 derives(ic,XDER ) = (-crse(ic+2,jc,n)+4*crse(ic+1,jc,n)- & 3*crse(ic,jc,n))/(2*hcrse) derives(ic,X2DER) = (crse(ic+2,jc,n)-2*crse(ic+1,jc,n)+ & crse(ic,jc,n))/hcrse**2 else c ::: use i,i+1 derives(ic,XDER ) = (crse(ic+1,jc,n)-crse(ic,jc,n))/hcrse derives(ic,X2DER) = zero endif else c ::: use i,i+1 derives(ic,XDER ) = (crse(ic+1,jc,n)-crse(ic,jc,n))/hcrse derives(ic,X2DER) = zero endif else if( mask(i-1,j).eq.not_covered ) then c ::: i+1 bad, try other direction if( ic-2 .ge. iclo-1 ) then if( mask(i-1,j) .eq. not_covered ) then c ::: can use 3 points stencils for i,i-1,i-2 derives(ic,XDER ) = (+crse(ic-2,jc,n)-4*crse(ic-1,jc,n)+ & 3*crse(ic,jc,n))/(2*hcrse) derives(ic,X2DER) = (crse(ic-2,jc,n)-2*crse(ic-1,jc,n)+ & crse(ic,jc,n))/hcrse**2 else c ::: use i,i-1 derives(ic,XDER ) = (crse(ic,jc,n)-crse(ic-1,jc,n))/hcrse derives(ic,X2DER) = zero endif else c ::: use i,i-1 derives(ic,XDER ) = (crse(ic,jc,n)-crse(ic-1,jc,n))/hcrse derives(ic,X2DER) = zero endif else write(6,*)'impossible BDINTERPYLO' stop endif enddo do off = 0, ratio - 1 xx = (off+0.5)*hfine-hcrse/2 do ic = iclo, ichi i = ratio*ic + off bdry(i,j,n) = crse(ic,jc,n) & + derives(ic,XDER)*xx & + derives(ic,X2DER)*xx**2/2 bdry(i,j,n+nvar) = & + derives(ic,XDER) + derives(ic,X2DER)*xx enddo enddo enddo return end c --------------------------------------------------------------- c :: FORT_BDINTERPYHI : Interpolation on Yhi Face c :: Quadratic Interpolation from crse data c :: in directions transverse to face of grid c :: c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: DIMS(bdry) => index limits of bdry c :: lo,hi => index limits of grd interior c :: DIMS(cb) => index limits of coarsened grid interior c :: nvar => number of variables in solution, half number in bdry c :: ratio => refinement ratio c :: not_covered => mask is set to this value if cell is not c :: covered by another fine grid and not outside the domain. c :: mask => fine grid mask bndry strip c :: DIMS(mask) => index limits of mask array c :: crse => crse grid bndry data strip c :: DIMS(crse) => index limits of crse array c :: derives => crse grid tmp array c --------------------------------------------------------------- subroutine FORT_BDINTERPYHI (bdry,DIMS(bdry), & lo,hi,DIMS(cb),nvar,ratio,not_covered, & mask,DIMS(mask),crse,DIMS(crse),derives,hfine) integer nvar, ratio, not_covered integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(mask) integer DIMDEC(cb) integer DIMDEC(crse) REAL_T bdry(DIMV(bdry),2*nvar) REAL_T derives(DIM1(cb),NUMDERIV) integer mask(DIMV(mask)) REAL_T crse(DIMV(crse),nvar) REAL_T xx integer i, j, ic, jc, off, n integer iclo, ichi REAL_T hfine REAL_T hcrse iclo = ARG_L1(cb) ichi = ARG_H1(cb) jc = ARG_H2(cb)+1 j = hi(2)+1 hcrse = ratio*hfine do n = 1, nvar c ::::: define interp coefs do ic = iclo, ichi i = ratio*ic if( mask(i-1,j).eq.not_covered .and. & mask(i+ratio,j).eq.not_covered ) then c :::: use adjoining points derives(ic,XDER ) = (crse(ic+1,jc,n)-crse(ic-1,jc,n))/(2*hcrse) derives(ic,X2DER) = (crse(ic+1,jc,n)-2*crse(ic,jc,n)+ & crse(ic-1,jc,n))/hcrse**2 else if( mask(i-1,j).ne.not_covered .and. & mask(i+ratio,j).ne.not_covered ) then c :::: must drop order by two derives(ic,XDER ) = zero derives(ic,X2DER) = zero else if( mask(i+ratio,j).eq.not_covered ) then c ::: i-1 bad, try other direction if( ic+2 .le. ichi+1 ) then if( mask(i+2*ratio,j).eq.not_covered ) then c ::: can use 3 points stencils for i,i+1,i+2 derives(ic,XDER ) = (-crse(ic+2,jc,n)+4*crse(ic+1,jc,n)- & 3*crse(ic,jc,n))/(2*hcrse) derives(ic,X2DER) = (crse(ic+2,jc,n)-2*crse(ic+1,jc,n)+ & crse(ic,jc,n))/hcrse**2 else c ::: use i,i+1 derives(ic,XDER ) = (crse(ic+1,jc,n)-crse(ic,jc,n))/hcrse derives(ic,X2DER) = zero endif else c ::: use i,i+1 derives(ic,XDER ) = (crse(ic+1,jc,n)-crse(ic,jc,n))/hcrse derives(ic,X2DER) = zero endif else if( mask(i-1,j).eq.not_covered ) then c ::: i+1 bad, try other direction if( ic-2 .ge. iclo-1 ) then if( mask(i-1,j) .eq. not_covered ) then c ::: can use 3 points stencils for i,i-1,i-2 derives(ic,XDER ) = (+crse(ic-2,jc,n)-4*crse(ic-1,jc,n)+ & 3*crse(ic,jc,n))/(2*hcrse) derives(ic,X2DER) = (crse(ic-2,jc,n)-2*crse(ic-1,jc,n)+ & crse(ic,jc,n))/hcrse**2 else c ::: use i,i-1 derives(ic,XDER ) = (crse(ic,jc,n)-crse(ic-1,jc,n))/hcrse derives(ic,X2DER) = zero endif else c ::: use i,i-1 derives(ic,XDER ) = (crse(ic,jc,n)-crse(ic-1,jc,n))/hcrse derives(ic,X2DER) = zero endif else write(6,*)'impossible BDINTERPYHI' stop endif enddo do off = 0, ratio - 1 xx = (off+0.5)*hfine-hcrse/2 do ic = iclo, ichi i = ratio*ic + off bdry(i,j,n) = crse(ic,jc,n) & + derives(ic,XDER)*xx & + derives(ic,X2DER)*xx**2/2 bdry(i,j,n+nvar) = & + derives(ic,XDER) + derives(ic,X2DER)*xx enddo enddo enddo return end c ------------------------------------------------------------------------ c :: FORT_BDIDERIVXLO : copy from Xlo face of fine fab (getting values c :: which were stuck there by the physical boundary condition routines) c :: to get the first nvar values in bdry. The second nvar values c :: are gotten by computing the transverse derivative. Two formulas c :: are used: 1) on the interior a centered difference is used; c :: 2) at the end points a one-sided difference is used. No check c :: is made to check that the one-sided difference does not poke out c :: the other side of the grid. But if grids are that small, a lot c :: of things will be blowing up. c :: Inputs/Outputs: c :: bdry <= fine grid bndry data strip c :: lo,hi => index limits of "grid". So all action takes place in cells c :: outside the grid c :: fine => fine grid data which has phys-bc data stuffed in it c :: nvar => number of components in fine. But you write twice as many c :: components of data in bdry because you compute transverse c :: derivatives as well c :: hfine => delta x in transverse direction; needed for derivs c ------------------------------------------------------------------------ subroutine FORT_BDIDERIVXLO( bdry, DIMS(bdry), & lo, hi, & fine, DIMS(fine), & nvar, hfine) integer nvar REAL_T hfine integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(fine) REAL_T bdry(DIMV(bdry),2*nvar) REAL_T fine(DIMV(fine), nvar) integer i,j,n i = lo(1)-1 do n=1,nvar c ::: ::: copy boundary values over do j=lo(2),hi(2) bdry(i,j,n) = fine(i,j,n) enddo c ::: ::: do stinking calculation of derivativ using centered difference c ::: ::: this ONLY makes sense for DIRICHLET BC. For other BC, c ::: ::: we will not use these values. do j=lo(2)+1,hi(2)-1 bdry(i,j,n+nvar) = (fine(i,j+1,n)-fine(i,j-1,n))/(2*hfine) enddo j = lo(2) bdry(i,j,n+nvar) = (-fine(i,j+2,n)+4*fine(i,j+1,n)-3*fine(i,j,n))/ & (2*hfine) j = hi(2) bdry(i,j,n+nvar) = (+fine(i,j-2,n)-4*fine(i,j-1,n)+3*fine(i,j,n))/ & (2*hfine) enddo return end subroutine FORT_BDIDERIVXHI( bdry, DIMS(bdry), & lo, hi, & fine, DIMS(fine), & nvar, hfine) integer nvar REAL_T hfine integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(fine) REAL_T bdry(DIMV(bdry),2*nvar) REAL_T fine(DIMV(fine), nvar) integer i,j,n i = hi(1)+1 do n=1,nvar c ::: ::: copy boundary values over do j=lo(2),hi(2) bdry(i,j,n) = fine(i,j,n) enddo c ::: ::: do stinking calculation of derivativ using centered difference c ::: ::: this ONLY makes sense for DIRICHLET BC. For other BC, c ::: ::: we will not use these values. do j=lo(2)+1,hi(2)-1 bdry(i,j,n+nvar) = (fine(i,j+1,n)-fine(i,j-1,n))/(2*hfine) enddo j = lo(2) bdry(i,j,n+nvar) = (-fine(i,j+2,n)+4*fine(i,j+1,n)-3*fine(i,j,n))/ & (2*hfine) j = hi(2) bdry(i,j,n+nvar) = (+fine(i,j-2,n)-4*fine(i,j-1,n)+3*fine(i,j,n))/ & (2*hfine) enddo return end subroutine FORT_BDIDERIVYLO( bdry, DIMS(bdry), & lo, hi, & fine, DIMS(fine), & nvar, hfine) integer nvar REAL_T hfine integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(fine) REAL_T bdry(DIMV(bdry),2*nvar) REAL_T fine(DIMV(fine), nvar) integer i,j,n j = lo(2)-1 do n=1,nvar c ::: ::: copy boundary values over do i=lo(1),hi(1) bdry(i,j,n) = fine(i,j,n) enddo c ::: ::: do stinking calculation of derivativ using centered difference c ::: ::: this ONLY makes sense for DIRICHLET BC. For other BC, c ::: ::: we will not use these values. do i=lo(1)+1,hi(1)-1 bdry(i,j,n+nvar) = (fine(i+1,j,n)-fine(i-1,j,n))/(2*hfine) enddo i = lo(1) bdry(i,j,n+nvar) = (-fine(i+2,j,n)+4*fine(i+1,j,n)-3*fine(i,j,n))/ & (2*hfine) i = hi(1) bdry(i,j,n+nvar) = (+fine(i-2,j,n)-4*fine(i-1,j,n)+3*fine(i,j,n))/ & (2*hfine) enddo return end subroutine FORT_BDIDERIVYHI( bdry, DIMS(bdry), & lo, hi, & fine, DIMS(fine), & nvar, hfine) integer nvar REAL_T hfine integer lo(SDIM), hi(SDIM) integer DIMDEC(bdry) integer DIMDEC(fine) REAL_T bdry(DIMV(bdry),2*nvar) REAL_T fine(DIMV(fine), nvar) integer i,j,n j = hi(2)+1 do n=1,nvar c ::: ::: copy boundary values over do i=lo(1),hi(1) bdry(i,j,n) = fine(i,j,n) enddo c ::: ::: do stinking calculation of derivativ using centered difference c ::: ::: this ONLY makes sense for DIRICHLET BC. For other BC, c ::: ::: we will not use these values. do i=lo(1)+1,hi(1)-1 bdry(i,j,n+nvar) = (fine(i+1,j,n)-fine(i-1,j,n))/(2*hfine) enddo i = lo(1) bdry(i,j,n+nvar) = (-fine(i+2,j,n)+4*fine(i+1,j,n)-3*fine(i,j,n))/ & (2*hfine) i = hi(1) bdry(i,j,n+nvar) = (+fine(i-2,j,n)-4*fine(i-1,j,n)+3*fine(i,j,n))/ & (2*hfine) enddo return end ccseapps-2.5/CCSEApps/tensorMG/MCInterpBndryData.H0000644000175000017500000001001311634153073022773 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MCINTERPBNDRYDATA_H_ #define _MCINTERPBNDRYDATA_H_ // // $Id: MCInterpBndryData.H,v 1.8 2000/10/02 20:53:39 lijewski Exp $ // #include #include #include #include #include #include #include #include #include //@Man: /*@Memo: An MCInterpBndryData object adds to a BndryData object the ability to manipulate and set the data stored in the boundary cells. */ /*@Doc: The "Interpbndrydata" class is a virtual base class derived from BndryData. It is intended to provide a more physical method for filling boundary-related data. Boundary values in a BndryData object are stored in FabSets around each grid in the domain, and the MCInterpBndryData class provides a mechanism for filling these FabSets, consistent with AMR-like numerical discretizations. When asked to set it's boundary values, an MCInterpBndryData object: \begin{enumerate} \item Fills with physical boundary values if the FAB is on the domain boundary ({\it the corresponding values are presumed to be stored in the ghost cells of a MultiFab given to the boundary filling routine}) \item Fills on intersection with data from the VALID region of the input MultiFab, ensuring that adjacent FABs use consistent data at their intersection, and otherwise, \item Fills with values interpolated from a coarser FAB that bounds the cells that do not meet the above two criteria \end{enumerate} */ class MCInterpBndryData : public BndryData { public: //@ManMemo: Constructor // //@ManDoc: default constructor // MCInterpBndryData () : BndryData() {} // //@ManDoc: constructor for given BoxArray, etc // MCInterpBndryData (const BoxArray& _grids, int _ncomp, const Geometry& geom); // //@ManDoc: interpret user BCs to those expected by LinOp // virtual void setBndryConds (const BCRec& phys_bc, int ratio, int comp=0) = 0; // //@ManDoc: set bndry values at coarse level (non interpolation performed) // void setBndryValues (const MultiFab& mf, int mf_start, int bnd_start, int num_comp, const Array& phys_bc); // //@ManDoc: set bndry values at fine level, performing necessary interpolations // void setBndryValues (const ::BndryRegister& crse, int c_start, const MultiFab& fine, int f_start, int bnd_start, int num_comp, int ratio, const Array& phys_bc); }; #endif /*_MCINTERPBNDRYDATA_H_*/ ccseapps-2.5/CCSEApps/tensorMG/DV_2D.F0000644000175000017500000030210211634153073020360 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include "DivVis_F.H" #include #include "ArrayLim.H" c :::: usage: c :::: this .mF file is meant to be run through Mathematica. This converts c :::: compact symbolic expressions into fortran which is stored in a .F c :::: file. c---------------------------------------------------------------- c this is the fortran support file for the the operator c L(U) = alpha*a(x)*U - beta*Div( tau ) c c where U is the two component vector (u,v) and c tau is a two by two tensor c tau = | t_xx t_xy | c | t_xy t_yy | c c t_xx = 2*mu * u_x c t_xy = mu*(u_y + v_x) c t_yy = 2*mu * v_y c and alpha is a diagonal 2x2 matrix, says rick c ::: define standard replacements used by Mathematica c ::: see file visc2d.ma c ::: Null c ::: interface notes: c ::: 1) trander* ALWAYS have values in them, even if the cells are c ::: all covered. Might as well. These are edge located derivative c ::: values. In index space, they are located the same as the mask c ::: cells. Which is somewhat anomalous. These are edge values, after c ::: all. While the masks are cell-centered. But it seems easier c ::: at the moment. c ::: 2) the normal derivatives are evaluated in the normal fashion. c ::: 3) tangential derivatives which reach outside the rectangle DO have c ::: to check the masks. subroutine FORT_DVAPPLY( $ u, DIMS(u), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ out, DIMS(out), $ maskn,DIMS(maskn), $ maske,DIMS(maske), $ maskw,DIMS(maskw), $ masks,DIMS(masks), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ lo,hi,h $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(out) integer DIMDEC(maskn) integer DIMDEC(maske) integer DIMDEC(maskw) integer DIMDEC(masks) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) REAL_T h(BL_SPACEDIM) REAL_T u(DIMV(u),2) REAL_T a(DIMV(a),2) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) REAL_T out(DIMV(out),2) integer maskn(DIMV(maskn)) integer maske(DIMV(maske)) integer maskw(DIMV(maskw)) integer masks(DIMV(masks)) REAL_T trandern(DIMV(trandern),2) REAL_T trandere(DIMV(trandere),2) REAL_T tranderw(DIMV(tranderw),2) REAL_T tranders(DIMV(tranders),2) integer i,j REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw,dudyn,dudys REAL_T dvdxe,dvdxw,dvdxn,dvdxs logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) c ::: make some mathematica definitions c ::: allDerivAllUV makes replacements for the deriv expressions and c ::: maps U and V to the correct values c ::: Null c ::: cases: c ::: 1) interior. All normal derivative expressions c ::: 2) edge but not on corner. check mask value to see if use outside c ::: value or use interpolations c ::: 3) corners. Must check mask values to see if use outside values c ::: values or use interpolations ON TWO SIDES. But must also c ::: check to see if need to do one-sided derivs for tangential c ::: derivatives. c ::: case 1 do j=lo(2)+1,hi(2)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression out(i,j,1) = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) out(i,j,2) = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) enddo enddo c ::: ::: case 2a: north side c ::: Null c ::: Null c ::: j = hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( maskn(i,1 + j).gt.0.or.maskn(1 + i,1 + j).gt.0 ) then dudye = ((U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy) + - (U(1 + i,-2 + j,1) - 4*U(1 + i,-1 + j,1) + 3*U(1 + i,j,1))/(2.*hy))/ - 2. else dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) endif if( maskn(-1 + i,1 + j).gt.0.or.maskn(i,1 + j).gt.0 ) then dudyw = ((U(-1 + i,-2 + j,1) - 4*U(-1 + i,-1 + j,1) + 3*U(-1 + i,j,1))/ - (2.*hy) + (U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy))/ - 2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif dvdxn = trandern(i,j+1,2) dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression out(i,j,1) = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) out(i,j,2) = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) enddo c ::: case 2b south side c ::: Null c ::: Null j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( masks(i,-1 + j).gt.0.or.masks(1 + i,-1 + j).gt.0 ) then dudye = ((-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy) + - (-3*U(1 + i,j,1) + 4*U(1 + i,1 + j,1) - U(1 + i,2 + j,1))/(2.*hy))/ - 2. else dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) endif if( masks(-1 + i,-1 + j).gt.0.or.masks(i,-1 + j).gt.0 ) then dudyw = ((-3*U(-1 + i,j,1) + 4*U(-1 + i,1 + j,1) - U(-1 + i,2 + j,1))/ - (2.*hy) + (-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy))/2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) dvdxs = tranders(i,j-1,2) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression out(i,j,1) = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) out(i,j,2) = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) enddo c ::: case 2c: west side story c ::: Null c ::: Null i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) dudyw = tranderw(i-1,j,1) if( maskw(-1 + i,j).gt.0.or.maskw(-1 + i,1 + j).gt.0 ) then dvdxn = ((-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx) + - (-3*U(i,1 + j,2) + 4*U(1 + i,1 + j,2) - U(2 + i,1 + j,2))/(2.*hx))/ - 2. else dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) endif if( maskw(-1 + i,-1 + j).gt.0.or.maskw(-1 + i,j).gt.0 ) then dvdxs = ((-3*U(i,-1 + j,2) + 4*U(1 + i,-1 + j,2) - U(2 + i,-1 + j,2))/ - (2.*hx) + (-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx))/2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression out(i,j,1) = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) out(i,j,2) = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) enddo c ::: case 2d: east side story c ::: Null c ::: Null i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = trandere(i+1,j,1) dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) if( maske(1 + i,j).gt.0.or.maske(1 + i,1 + j).gt.0 ) then dvdxn = ((U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx) + - (U(-2 + i,1 + j,2) - 4*U(-1 + i,1 + j,2) + 3*U(i,1 + j,2))/(2.*hx))/ - 2. else dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) endif if( maske(1 + i,-1 + j).gt.0.or.maske(1 + i,j).gt.0 ) then dvdxs = ((U(-2 + i,-1 + j,2) - 4*U(-1 + i,-1 + j,2) + 3*U(i,-1 + j,2))/ - (2.*hx) + (U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx))/ - 2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression out(i,j,1) = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) out(i,j,2) = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) enddo c ::: case 3a: north-east corner c ::: Null c ::: Null j=hi(2) i=hi(1) c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = trandere(i+1,j,1) if( maskn(-1 + i,1 + j).gt.0.or.maskn(i,1 + j).gt.0 ) then dudyw = ((U(-1 + i,-2 + j,1) - 4*U(-1 + i,-1 + j,1) + 3*U(-1 + i,j,1))/ - (2.*hy) + (U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy))/ - 2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif dvdxn = trandern(i,j+1,2) if( maske(1 + i,-1 + j).gt.0.or.maske(1 + i,j).gt.0 ) then dvdxs = ((U(-2 + i,-1 + j,2) - 4*U(-1 + i,-1 + j,2) + 3*U(i,-1 + j,2))/ - (2.*hx) + (U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx))/ - 2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression out(i,j,1) = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) out(i,j,2) = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: case 3b: south-east corner, plus i, minus j, plus i, plus j c ::: Null j=lo(2) i=hi(1) c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = trandere(i+1,j,1) if( masks(-1 + i,-1 + j).gt.0.or.masks(i,-1 + j).gt.0 ) then dudyw = ((-3*U(-1 + i,j,1) + 4*U(-1 + i,1 + j,1) - U(-1 + i,2 + j,1))/ - (2.*hy) + (-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy))/2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif if( maske(1 + i,j).gt.0.or.maske(1 + i,1 + j).gt.0 ) then dvdxn = ((U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx) + - (U(-2 + i,1 + j,2) - 4*U(-1 + i,1 + j,2) + 3*U(i,1 + j,2))/(2.*hx))/ - 2. else dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) endif dvdxs = tranders(i,j-1,2) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression out(i,j,1) = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) out(i,j,2) = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: case 3c: south-west corner, minus i, minus j c ::: Null j=lo(2) i=lo(1) c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( masks(i,-1 + j).gt.0.or.masks(1 + i,-1 + j).gt.0 ) then dudye = ((-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy) + - (-3*U(1 + i,j,1) + 4*U(1 + i,1 + j,1) - U(1 + i,2 + j,1))/(2.*hy))/ - 2. else dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) endif dudyw = tranderw(i-1,j,1) if( maskw(-1 + i,j).gt.0.or.maskw(-1 + i,1 + j).gt.0 ) then dvdxn = ((-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx) + - (-3*U(i,1 + j,2) + 4*U(1 + i,1 + j,2) - U(2 + i,1 + j,2))/(2.*hx))/ - 2. else dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) endif dvdxs = tranders(i,j-1,2) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression out(i,j,1) = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) out(i,j,2) = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: case 3d: north-west corner, minus i, plus j c ::: Null j=hi(2) i=lo(1) c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( maskn(i,1 + j).gt.0.or.maskn(1 + i,1 + j).gt.0 ) then dudye = ((U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy) + - (U(1 + i,-2 + j,1) - 4*U(1 + i,-1 + j,1) + 3*U(1 + i,j,1))/(2.*hy))/ - 2. else dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) endif dudyw = tranderw(i-1,j,1) dvdxn = trandern(i,j+1,2) if( maskw(-1 + i,-1 + j).gt.0.or.maskw(-1 + i,j).gt.0 ) then dvdxs = ((-3*U(i,-1 + j,2) + 4*U(1 + i,-1 + j,2) - U(2 + i,-1 + j,2))/ - (2.*hx) + (-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx))/2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression out(i,j,1) = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) out(i,j,2) = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) return end c ------------------------------------------------------------------- c ... a point of interpretation here: lo and hi are the covered area in c ... cell centered coordinates. The dimension of the x and y fluxes have c ... to be at least one larger in the appropriate direction. c ... we use the "usual" interpretation of fluxes: cell i has a left flux c ... numbered i and a right flux numbered i+1 subroutine FORT_DVFLUX( $ u, DIMS(u), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ xflux,DIMS(xflux), $ yflux,DIMS(yflux), $ maskn,DIMS(maskn), $ maske,DIMS(maske), $ maskw,DIMS(maskw), $ masks,DIMS(masks), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ lo,hi,h $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(xflux) integer DIMDEC(yflux) integer DIMDEC(maskn) integer DIMDEC(maske) integer DIMDEC(maskw) integer DIMDEC(masks) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) REAL_T h(BL_SPACEDIM) REAL_T u(DIMV(u),2) REAL_T a(DIMV(a),2) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) REAL_T xflux(DIMV(xflux),2) REAL_T yflux(DIMV(yflux),2) integer maskn(DIMV(maskn)) integer maske(DIMV(maske)) integer maskw(DIMV(maskw)) integer masks(DIMV(masks)) REAL_T trandern(DIMV(trandern),2) REAL_T trandere(DIMV(trandere),2) REAL_T tranderw(DIMV(tranderw),2) REAL_T tranders(DIMV(tranders),2) integer i,j REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw,dudyn,dudys REAL_T dvdxe,dvdxw,dvdxn,dvdxs logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) c ::: make some mathematica definitions c ::: allDerivAllUV makes replacements for the deriv expressions and c ::: maps U and V to the correct values c ::: Null c ::: cases: c ::: 1) interior. All normal derivative expressions c ::: 2) edge but not on corner. check mask value to see if use outside c ::: value or use interpolations c ::: 3) corners. Must check mask values to see if use outside values c ::: values or use interpolations ON TWO SIDES. But must also c ::: check to see if need to do one-sided derivs for tangential c ::: derivatives. c ::: case 1 do j=lo(2)+1,hi(2) do i=lo(1)+1,hi(1) c ::: get expressions for appropriate derivatives dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression xflux(i,j,1) = -(2*dudxw*muX(i,j)) xflux(i,j,2) = -((dudyw + dvdxw)*muX(i,j)) yflux(i,j,1) = -((dudys + dvdxs)*muY(i,j)) yflux(i,j,2) = -(2*dvdys*muY(i,j)) enddo enddo c ::: ::: case 2a: north side c ::: Null c ::: Null c ::: j = hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for appropriate derivatives dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy if( maskn(-1 + i,1 + j).gt.0.or.maskn(i,1 + j).gt.0 ) then dudyw = ((U(-1 + i,-2 + j,1) - 4*U(-1 + i,-1 + j,1) + 3*U(-1 + i,j,1))/ - (2.*hy) + (U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy))/ - 2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif dvdxn = trandern(i,j+1,2) dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression xflux(i,j,1) = -(2*dudxw*muX(i,j)) xflux(i,j,2) = -((dudyw + dvdxw)*muX(i,j)) yflux(i,j+1,1) = -((dudyn + dvdxn)*muY(i,1 + j)) yflux(i,j+1,2) = -(2*dvdyn*muY(i,1 + j)) enddo c ::: case 2b south side c ::: Null c ::: Null j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for appropriate derivatives dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( masks(-1 + i,-1 + j).gt.0.or.masks(i,-1 + j).gt.0 ) then dudyw = ((-3*U(-1 + i,j,1) + 4*U(-1 + i,1 + j,1) - U(-1 + i,2 + j,1))/ - (2.*hy) + (-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy))/2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif dvdxs = tranders(i,j-1,2) dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression xflux(i,j,1) = -(2*dudxw*muX(i,j)) xflux(i,j,2) = -((dudyw + dvdxw)*muX(i,j)) yflux(i,j,1) = -((dudys + dvdxs)*muY(i,j)) yflux(i,j,2) = -(2*dvdys*muY(i,j)) enddo c ::: case 2c: west side story c ::: Null c ::: Null i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for appropriate derivatives dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudyw = tranderw(i-1,j,1) if( maskw(-1 + i,-1 + j).gt.0.or.maskw(-1 + i,j).gt.0 ) then dvdxs = ((-3*U(i,-1 + j,2) + 4*U(1 + i,-1 + j,2) - U(2 + i,-1 + j,2))/ - (2.*hx) + (-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx))/2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression xflux(i,j,1) = -(2*dudxw*muX(i,j)) xflux(i,j,2) = -((dudyw + dvdxw)*muX(i,j)) yflux(i,j,1) = -((dudys + dvdxs)*muY(i,j)) yflux(i,j,2) = -(2*dvdys*muY(i,j)) enddo c ::: case 2d: east side story c ::: Null c ::: Null i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = trandere(i+1,j,1) if( maske(1 + i,-1 + j).gt.0.or.maske(1 + i,j).gt.0 ) then dvdxs = ((U(-2 + i,-1 + j,2) - 4*U(-1 + i,-1 + j,2) + 3*U(i,-1 + j,2))/ - (2.*hx) + (U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx))/ - 2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx c ::: evaluate expression xflux(i+1,j,1) = -(2*dudxe*muX(1 + i,j)) xflux(i+1,j,2) = -((dudye + dvdxe)*muX(1 + i,j)) yflux(i,j,1) = -((dudys + dvdxs)*muY(i,j)) yflux(i,j,2) = -(2*dvdys*muY(i,j)) enddo c ::: case 3a: north-east corner c ::: Null c ::: Null j=hi(2) i=hi(1) c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = trandere(i+1,j,1) if( maskn(-1 + i,1 + j).gt.0.or.maskn(i,1 + j).gt.0 ) then dudyw = ((U(-1 + i,-2 + j,1) - 4*U(-1 + i,-1 + j,1) + 3*U(-1 + i,j,1))/ - (2.*hy) + (U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy))/ - 2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif dvdxn = trandern(i,j+1,2) if( maske(1 + i,-1 + j).gt.0.or.maske(1 + i,j).gt.0 ) then dvdxs = ((U(-2 + i,-1 + j,2) - 4*U(-1 + i,-1 + j,2) + 3*U(i,-1 + j,2))/ - (2.*hx) + (U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx))/ - 2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression xflux(i,j,1) = -(2*dudxw*muX(i,j)) xflux(i,j,2) = -((dudyw + dvdxw)*muX(i,j)) xflux(i+1,j,1) = -(2*dudxe*muX(1 + i,j)) xflux(i+1,j,2) = -((dudye + dvdxe)*muX(1 + i,j)) yflux(i,j,1) = -((dudys + dvdxs)*muY(i,j)) yflux(i,j,2) = -(2*dvdys*muY(i,j)) yflux(i,j+1,1) = -((dudyn + dvdxn)*muY(i,1 + j)) yflux(i,j+1,2) = -(2*dvdyn*muY(i,1 + j)) c ::: case 3b: south-east corner, plus i, minus j, plus i, plus j c ::: Null j=lo(2) i=hi(1) c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = trandere(i+1,j,1) if( masks(-1 + i,-1 + j).gt.0.or.masks(i,-1 + j).gt.0 ) then dudyw = ((-3*U(-1 + i,j,1) + 4*U(-1 + i,1 + j,1) - U(-1 + i,2 + j,1))/ - (2.*hy) + (-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy))/2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif if( maske(1 + i,j).gt.0.or.maske(1 + i,1 + j).gt.0 ) then dvdxn = ((U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx) + - (U(-2 + i,1 + j,2) - 4*U(-1 + i,1 + j,2) + 3*U(i,1 + j,2))/(2.*hx))/ - 2. else dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) endif dvdxs = tranders(i,j-1,2) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression xflux(i,j,1) = -(2*dudxw*muX(i,j)) xflux(i,j,2) = -((dudyw + dvdxw)*muX(i,j)) xflux(i+1,j,1) = -(2*dudxe*muX(1 + i,j)) xflux(i+1,j,2) = -((dudye + dvdxe)*muX(1 + i,j)) yflux(i,j,1) = -((dudys + dvdxs)*muY(i,j)) yflux(i,j,2) = -(2*dvdys*muY(i,j)) yflux(i,j+1,1) = -((dudyn + dvdxn)*muY(i,1 + j)) yflux(i,j+1,2) = -(2*dvdyn*muY(i,1 + j)) c ::: case 3c: south-west corner, minus i, minus j c ::: Null j=lo(2) i=lo(1) c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( masks(i,-1 + j).gt.0.or.masks(1 + i,-1 + j).gt.0 ) then dudye = ((-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy) + - (-3*U(1 + i,j,1) + 4*U(1 + i,1 + j,1) - U(1 + i,2 + j,1))/(2.*hy))/ - 2. else dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) endif dudyw = tranderw(i-1,j,1) if( maskw(-1 + i,j).gt.0.or.maskw(-1 + i,1 + j).gt.0 ) then dvdxn = ((-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx) + - (-3*U(i,1 + j,2) + 4*U(1 + i,1 + j,2) - U(2 + i,1 + j,2))/(2.*hx))/ - 2. else dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) endif dvdxs = tranders(i,j-1,2) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression xflux(i,j,1) = -(2*dudxw*muX(i,j)) xflux(i,j,2) = -((dudyw + dvdxw)*muX(i,j)) xflux(i+1,j,1) = -(2*dudxe*muX(1 + i,j)) xflux(i+1,j,2) = -((dudye + dvdxe)*muX(1 + i,j)) yflux(i,j,1) = -((dudys + dvdxs)*muY(i,j)) yflux(i,j,2) = -(2*dvdys*muY(i,j)) yflux(i,j+1,1) = -((dudyn + dvdxn)*muY(i,1 + j)) yflux(i,j+1,2) = -(2*dvdyn*muY(i,1 + j)) c ::: case 3d: north-west corner, minus i, plus j c ::: Null j=hi(2) i=lo(1) c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( maskn(i,1 + j).gt.0.or.maskn(1 + i,1 + j).gt.0 ) then dudye = ((U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy) + - (U(1 + i,-2 + j,1) - 4*U(1 + i,-1 + j,1) + 3*U(1 + i,j,1))/(2.*hy))/ - 2. else dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) endif dudyw = tranderw(i-1,j,1) dvdxn = trandern(i,j+1,2) if( maskw(-1 + i,-1 + j).gt.0.or.maskw(-1 + i,j).gt.0 ) then dvdxs = ((-3*U(i,-1 + j,2) + 4*U(1 + i,-1 + j,2) - U(2 + i,-1 + j,2))/ - (2.*hx) + (-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx))/2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: evaluate expression xflux(i,j,1) = -(2*dudxw*muX(i,j)) xflux(i,j,2) = -((dudyw + dvdxw)*muX(i,j)) xflux(i+1,j,1) = -(2*dudxe*muX(1 + i,j)) xflux(i+1,j,2) = -((dudye + dvdxe)*muX(1 + i,j)) yflux(i,j,1) = -((dudys + dvdxs)*muY(i,j)) yflux(i,j,2) = -(2*dvdys*muY(i,j)) yflux(i,j+1,1) = -((dudyn + dvdxn)*muY(i,1 + j)) yflux(i,j+1,2) = -(2*dvdyn*muY(i,1 + j)) return end c----------------------------------------------------------------------- subroutine FORT_APPLYBC ( $ flagden, flagbc, maxorder, $ u, DIMS(u), $ cdir, bct, bcl, $ bcval, DIMS(bcval), $ mask, DIMS(mask), $ maskp, DIMS(maskp), $ maskm, DIMS(maskm), $ den, DIMS(den), $ exttd, DIMS(exttd), $ tander,DIMS(tander), $ lo, hi, nc, $ h $ ) c c If the boundary is of Neumann type, set the ghost cell value to c that of the outermost point in the valid data (2nd order accurate) c and then fill the "den" array with the value "1" c c c If flagbc==1: c c If the boundary is of Dirichlet type, construct a polynomial c interpolation through the boundary location and internal points c (at locations x(-1:len-2) that generates the ghost cell value (at c location xInt). Then fill the ghost cell with the interpolated value. c If flagden==1, load the "den" array with the interpolation c coefficient corresponding to outermost point in the valid region c ( the coef(0) corresponding to the location x(0) ) c c Note: c The bc type = LO_REFLECT_ODD is a special type of boundary condition. c ::: the old FORT_APPLYBC put values out in ghost cells. The new c ::: FORT_APPLYBC makes a distinction between normal and tangential derivs. c ::: the normal derivatives are still evaluated with ghost cells ( and c ::: the den array for adjusting the diagonal element). Tangential c ::: derivatives are NOT computed from the ghost cells (note: we are c ::: discussing here the tangential derivates which are centered on the c ::: external cells walls of the rectangular domain. Internal tangential c ::: derivatives whose stencil extends outside the rectangular domain have c ::: still ANOTHER calculational trick, one sided derivatives, which is c ::: implemented in the apply operator). For these tangential derivatives, c ::: if some of the cells in the stencil are uncovered, the derivative is c ::: computed half from cells which are internal, plus an externally supplied c ::: tangential derivative centered at location bcl. c ??? exttd is the externally supplied tangential derivative which is c ??? centered at bcl from wall. Since the location of exttd is c ??? indeterminate (determined by bcl), we arbitrarily index it in the c ??? cell just outside the wall. c ??? tander is the calculated tangential derivative which is centered at c ??? at the wall. It is indexed as if it were a cell centered quantity c ??? just outside the wall. This is anomalous since it is really edge c ??? centered on the outer wall. c c ::: other notes since previous developers didn't bother to document c ::: cdir is mnemonic for coordinate direction, i.e. which side this is c ::: cdir==0 -> left wall c ::: cdir==2 -> right c ::: cdir==1 -> bottom c ::: cdir==3 -> top c ::: notes about mask c ::: since we now require other masks, there are 3. c ::: 1) mask -- the main one covering the cells off the side of valid domain. c ::: 2) maskp -- the plus end of transverse direction c ::: 3) maskn -- the minus end of transverse direction integer maxorder integer nc, cdir, flagden, flagbc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(u) REAL_T u(DIMV(u),nc) integer DIMDEC(den) REAL_T den(DIMV(den),nc) integer DIMDEC(exttd) REAL_T exttd(DIMV(exttd),nc) integer DIMDEC(tander) REAL_T tander(DIMV(tander),nc) integer DIMDEC(bcval) REAL_T bcval(DIMV(bcval),nc) integer DIMDEC(mask) integer mask(DIMV(mask)) integer DIMDEC(maskp) integer maskp(DIMV(maskp)) integer DIMDEC(maskm) integer maskm(DIMV(maskm)) integer bct(nc) REAL_T bcl REAL_T h(BL_SPACEDIM) c REAL_T hx,hy,lambda REAL_T innder,outder REAL_T innloc,outloc,edgloc integer i integer j integer n logical is_dirichlet logical is_neumann logical is_odd REAL_T xb c integer lenx integer leny integer m c integer Lmaxorder integer maxmaxorder parameter(maxmaxorder=4) REAL_T x(-1:maxmaxorder-2) REAL_T coef(-1:maxmaxorder-2) REAL_T xInt c logical False, True parameter( False=.false.) parameter( True=.true. ) c is_dirichlet(i) = ( i .eq. LO_DIRICHLET ) is_neumann(i) = ( i .eq. LO_NEUMANN ) hx = h(1) hy = h(2) c if ( maxorder .eq. -1 ) then Lmaxorder = maxmaxorder else Lmaxorder = MIN(maxorder,maxmaxorder) endif lenx = MIN(hi(1)-lo(1), Lmaxorder-2) leny = MIN(hi(2)-lo(2), Lmaxorder-2) c c TODO: c In order for this to work with growing multigrid, must c sort xa[] because it is possible for the xb value to lay c within this range. c c The Left face of the grid c if(cdir .eq. 0) then do n = 1, nc if (is_neumann(bct(n))) then do j = lo(2), hi(2) u(lo(1)-1,j,n) = cvmgt( $ u(lo(1),j,n), $ u(lo(1)-1,j,n), $ mask(lo(1)-1,j) .gt. 0) enddo if ( flagden .eq. 1) then do j = lo(2), hi(2) den(lo(1),j,n) = 1.0 enddo endif c :::::: now do the tangential derivative part c :::::: Null c :::::: interior part of left side i = lo(1) do j=lo(2)+1,hi(2)-1 innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) tander(i-1,j,n) = innder enddo c :::::: now end points c :::::: lower leftside j = lo(2) if( maskm(i,-1 + j).gt.0 ) then innder = (-3*U(i,j,n) + 4*U(i,1 + j,n) - U(i,2 + j,n))/(2.*hy) else innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) endif tander(i-1,j,n) = innder c :::::: upper left side j = hi(2) if( maskp(i,1 + j).gt.0 ) then innder = (U(i,-2 + j,n) - 4*U(i,-1 + j,n) + 3*U(i,j,n))/(2.*hy) else innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) endif tander(i-1,j,n) = innder else if (is_dirichlet(bct(n))) then do m=0,lenx x(m) = m + 0.5 enddo x(-1) = - bcl/h(1) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenx+2, coef) if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) u(lo(1)-1, j, n) = cvmgt( $ bcval(lo(1)-1,j,n)*coef(-1), $ u(lo(1)-1, j, n), $ mask(lo(1)-1,j) .gt. 0) enddo else do j = lo(2), hi(2) u(lo(1)-1, j, n) = cvmgt( $ 0.0, $ u(lo(1)-1, j, n), $ mask(lo(1)-1,j) .gt. 0) enddo endif do m = 0, lenx do j = lo(2), hi(2) u(lo(1)-1,j,n) = cvmgt( $ u(lo(1)-1,j,n) $ + u(lo(1)+m, j, n)*coef(m), $ u(lo(1)-1,j,n), $ mask(lo(1)-1,j) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(lo(1),j,n) = cvmgt(coef(0), 0.0, $ mask(lo(1)-1,j) .gt. 0) enddo endif c :::::: now do the tangential derivative part c :::::: Null c :::::: interior part of left side edgloc = 0. i = lo(1) do j=lo(2)+1,hi(2)-1 if( mask(-1 + i,-1 + j).eq.0.and.mask(-1 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-U(-1 + i,-1 + j,n) + U(-1 + i,1 + j,n))/(2.*hy) elseif( mask(-1 + i,j).eq.0.and.mask(-1 + i,1 + j).eq.0.and.mask(-1 + i,2 + j).eq.0 ) then outloc = -0.5 outder = (-3*U(-1 + i,j,n) + 4*U(-1 + i,1 + j,n) - U(-1 + i,2 + j,n))/(2.*hy) elseif( mask(-1 + i,-2 + j).eq.0.and.mask(-1 + i,-1 + j).eq.0.and.mask(-1 + i,j).eq.0 ) then outloc = -0.5 outder = (U(-1 + i,-2 + j,n) - 4*U(-1 + i,-1 + j,n) + 3*U(-1 + i,j,n))/(2.*hy) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,n) else outder = 0. endif endif innloc = 0.5 innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) lambda = (edgloc-outloc)/(innloc-outloc) tander(i-1,j,n) = lambda*innder+(1-lambda)*outder enddo c :::::: now end points c :::::: lower leftside j = lo(2) if( mask(-1 + i,-1 + j).eq.0.and.mask(-1 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-U(-1 + i,-1 + j,n) + U(-1 + i,1 + j,n))/(2.*hy) elseif( mask(-1 + i,j).eq.0.and.mask(-1 + i,1 + j).eq.0.and.mask(-1 + i,2 + j).eq.0 ) then outloc = -0.5 outder = (-3*U(-1 + i,j,n) + 4*U(-1 + i,1 + j,n) - U(-1 + i,2 + j,n))/(2.*hy) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,n) else outder = 0. endif endif if( maskm(i,-1 + j).gt.0 ) then innder = (-3*U(i,j,n) + 4*U(i,1 + j,n) - U(i,2 + j,n))/(2.*hy) else innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i-1,j,n) = lambda*innder+(1-lambda)*outder c :::::: upper left side j = hi(2) if( mask(-1 + i,-1 + j).eq.0.and.mask(-1 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-U(-1 + i,-1 + j,n) + U(-1 + i,1 + j,n))/(2.*hy) elseif( mask(-1 + i,-2 + j).eq.0.and.mask(-1 + i,-1 + j).eq.0.and.mask(-1 + i,j).eq.0 ) then outloc = -0.5 outder = (U(-1 + i,-2 + j,n) - 4*U(-1 + i,-1 + j,n) + 3*U(-1 + i,j,n))/(2.*hy) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i-1,j,n) else outder = 0. endif endif if( maskp(i,1 + j).gt.0 ) then innder = (U(i,-2 + j,n) - 4*U(i,-1 + j,n) + 3*U(i,j,n))/(2.*hy) else innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i-1,j,n) = lambda*innder+(1-lambda)*outder else if ( bct(n) .eq. LO_REFLECT_ODD ) then do j = lo(2), hi(2) u(lo(1)-1, j, n) = cvmgt( $ -u(lo(1),j,n), $ u(lo(1)-1, j, n), $ mask(lo(1)-1,j) .gt. 0) tander(lo(1)-1,j,n) = 0.0 enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(lo(1),j,n) = cvmgt(-1.0, 0.0, $ mask(lo(1)-1,j) .gt. 0) enddo endif else print *,'UNKNOWN BC ON LEFT FACE IN APPLYBC' stop endif enddo endif c c The Right face of the grid c if(cdir .eq. 2) then do n = 1, nc if(is_neumann(bct(n))) then do j = lo(2), hi(2) u(hi(1)+1,j,n) = cvmgt( $ u(hi(1), j, n), $ u(hi(1)+1, j, n), $ mask(hi(1)+1,j) .gt. 0) enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(hi(1),j,n) = 1.0 enddo endif c :::::: now do the tangential derivative part c :::::: Null c :::::: interior part of right side i = hi(1) do j=lo(2)+1,hi(2)-1 innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) tander(i+1,j,n) = innder enddo c :::::: now end points c :::::: lower right side j = lo(2) if( maskm(i,-1 + j).gt.0 ) then innder = (-3*U(i,j,n) + 4*U(i,1 + j,n) - U(i,2 + j,n))/(2.*hy) else innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) endif tander(i+1,j,n) = innder c :::::: upper right side j = hi(2) if( maskp(i,1 + j).gt.0 ) then innder = (U(i,-2 + j,n) - 4*U(i,-1 + j,n) + 3*U(i,j,n))/(2.*hy) else innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) endif tander(i+1,j,n) = innder else if (is_dirichlet(bct(n))) then do m=0,lenx x(m) = m + 0.5 enddo x(-1) = - bcl/h(1) xInt = - 0.5 call polyInterpCoeff(xInt, x, lenx+2, coef) if ( flagbc .eq. 1 ) then do j = lo(2), hi(2) u(hi(1)+1,j,n) = cvmgt( $ bcval(hi(1)+1,j,n)*coef(-1), $ u(hi(1)+1,j,n), $ mask(hi(1)+1,j) .gt. 0) enddo else do j = lo(2), hi(2) u(hi(1)+1,j,n) = cvmgt( $ 0.0, $ u(hi(1)+1,j,n), $ mask(hi(1)+1,j) .gt. 0) enddo endif do m = 0, lenx do j = lo(2), hi(2) u(hi(1)+1,j,n) = cvmgt( $ u(hi(1)+1,j,n) $ + u(hi(1)-m,j,n)*coef(m), $ u(hi(1)+1,j,n), $ mask(hi(1)+1,j) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(hi(1),j,n) = cvmgt(coef(0), 0.0, $ mask(hi(1)+1,j) .gt. 0) enddo endif c :::::: now do the tangential derivative part c :::::: Null c :::::: interior part of right side edgloc = 0. i = hi(1) do j=lo(2)+1,hi(2)-1 if( mask(1 + i,-1 + j).eq.0.and.mask(1 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-U(1 + i,-1 + j,n) + U(1 + i,1 + j,n))/(2.*hy) elseif( mask(1 + i,j).eq.0.and.mask(1 + i,1 + j).eq.0.and.mask(1 + i,2 + j).eq.0 ) then outloc = -0.5 outder = (-3*U(1 + i,j,n) + 4*U(1 + i,1 + j,n) - U(1 + i,2 + j,n))/(2.*hy) elseif( mask(1 + i,-2 + j).eq.0.and.mask(1 + i,-1 + j).eq.0.and.mask(1 + i,j).eq.0 ) then outloc = -0.5 outder = (U(1 + i,-2 + j,n) - 4*U(1 + i,-1 + j,n) + 3*U(1 + i,j,n))/(2.*hy) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,n) else outder = 0. endif endif innloc = 0.5 innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) lambda = (edgloc-outloc)/(innloc-outloc) tander(i+1,j,n) = lambda*innder+(1-lambda)*outder enddo c :::::: now end points c :::::: lower right side j = lo(2) if( mask(1 + i,-1 + j).eq.0.and.mask(1 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-U(1 + i,-1 + j,n) + U(1 + i,1 + j,n))/(2.*hy) elseif( mask(1 + i,j).eq.0.and.mask(1 + i,1 + j).eq.0.and.mask(1 + i,2 + j).eq.0 ) then outloc = -0.5 outder = (-3*U(1 + i,j,n) + 4*U(1 + i,1 + j,n) - U(1 + i,2 + j,n))/(2.*hy) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,n) else outder = 0. endif endif if( maskm(i,-1 + j).gt.0 ) then innder = (-3*U(i,j,n) + 4*U(i,1 + j,n) - U(i,2 + j,n))/(2.*hy) else innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i+1,j,n) = lambda*innder+(1-lambda)*outder c :::::: upper right side j = hi(2) if( mask(1 + i,-1 + j).eq.0.and.mask(1 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-U(1 + i,-1 + j,n) + U(1 + i,1 + j,n))/(2.*hy) elseif( mask(1 + i,-2 + j).eq.0.and.mask(1 + i,-1 + j).eq.0.and.mask(1 + i,j).eq.0 ) then outloc = -0.5 outder = (U(1 + i,-2 + j,n) - 4*U(1 + i,-1 + j,n) + 3*U(1 + i,j,n))/(2.*hy) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i+1,j,n) else outder = 0. endif endif if( maskp(i,1 + j).gt.0 ) then innder = (U(i,-2 + j,n) - 4*U(i,-1 + j,n) + 3*U(i,j,n))/(2.*hy) else innder = (-U(i,-1 + j,n) + U(i,1 + j,n))/(2.*hy) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i+1,j,n) = lambda*innder+(1-lambda)*outder else if ( bct(n) .eq. LO_REFLECT_ODD ) then do j = lo(2), hi(2) u(hi(1)+1, j, n) = cvmgt( $ -u(hi(1),j,n), $ u(hi(1)+1, j, n), $ mask(hi(1)+1,j) .gt. 0) c ::: tangential der is trivial tander(hi(1)+1,j,n) = 0.0 enddo if ( flagden .eq. 1 ) then do j = lo(2), hi(2) den(hi(1),j,n) = cvmgt(-1.0, 0.0, $ mask(hi(1)+1,j) .gt. 0) enddo endif else print *,'UNKNOWN BC ON RIGHT FACE IN APPLYBC' stop endif enddo endif c c The Bottom of the Grid c if(cdir .eq. 1) then do n = 1, nc if(is_neumann(bct(n))) then do i = lo(1),hi(1) u(i,lo(2)-1,n) = cvmgt( $ u(i,lo(2),n), $ u(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) enddo if ( flagden .eq. 1 ) then do i = lo(1),hi(1) den(i,lo(2),n) = 1.0 enddo endif c :::::: now do the tangential derivative part c :::::: interior part of bottom side j = lo(2) do i=lo(1)+1,hi(1)-1 innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) tander(i,j-1,n) = innder enddo c :::::: now end points c :::::: left bottom side i = lo(1) if( maskm(-1 + i,j).gt.0 ) then innder = (-3*U(i,j,n) + 4*U(1 + i,j,n) - U(2 + i,j,n))/(2.*hx) else innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) endif tander(i,j-1,n) = innder c :::::: right bottom side i = hi(1) if( maskp(1 + i,j).gt.0 ) then innder = (U(-2 + i,j,n) - 4*U(-1 + i,j,n) + 3*U(i,j,n))/(2.*hx) else innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) endif tander(i,j-1,n) = innder else if (is_dirichlet(bct(n))) then do m=0,leny x(m) = m + 0.5 enddo x(-1) = - bcl/h(2) xInt = - 0.5 call polyInterpCoeff(xInt, x, leny+2, coef) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) u(i,lo(2)-1,n) = cvmgt( $ bcval(i,lo(2)-1,n)*coef(-1), $ u(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) enddo else do i = lo(1), hi(1) u(i,lo(2)-1,n) = cvmgt( $ 0.0, $ u(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) enddo endif do m = 0, leny do i = lo(1), hi(1) u(i, lo(2)-1, n) = cvmgt( $ u(i, lo(2)-1,n) $ + u(i, lo(2)+m,n)*coef(m), $ u(i, lo(2)-1, n), $ mask(i, lo(2)-1) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i, lo(2),n) = cvmgt(coef(0), 0.0, $ mask(i, lo(2)-1) .gt. 0) enddo endif c :::::: now do the tangential derivative part c :::::: interior part of bottom side edgloc = 0. j = lo(2) do i=lo(1)+1,hi(1)-1 if( mask(-1 + i,-1 + j).eq.0.and.mask(1 + i,-1 + j).eq.0 ) then outloc = -0.5 outder = (-U(-1 + i,-1 + j,n) + U(1 + i,-1 + j,n))/(2.*hx) else if( mask(i,-1 + j).eq.0.and.mask(1 + i,-1 + j).eq.0.and.mask(2 + i,-1 + j).eq.0 ) then outloc = -0.5 outder = (-3*U(i,-1 + j,n) + 4*U(1 + i,-1 + j,n) - U(2 + i,-1 + j,n))/(2.*hx) else if( mask(-2 + i,-1 + j).eq.0.and.mask(-1 + i,-1 + j).eq.0.and.mask(i,-1 + j).eq.0 ) then outloc = -0.5 outder = (U(-2 + i,-1 + j,n) - 4*U(-1 + i,-1 + j,n) + 3*U(i,-1 + j,n))/(2.*hx) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j-1,n) else outder = 0. endif endif innloc = 0.5 innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j-1,n) = lambda*innder+(1-lambda)*outder enddo c :::::: now end points c :::::: left bottom side i = lo(1) if( mask(-1 + i,-1 + j).eq.0.and.mask(1 + i,-1 + j).eq.0 ) then outloc = -0.5 outder = (-U(-1 + i,-1 + j,n) + U(1 + i,-1 + j,n))/(2.*hx) else if( mask(i,-1 + j).eq.0.and.mask(1 + i,-1 + j).eq.0.and.mask(2 + i,-1 + j).eq.0 ) then outloc = -0.5 outder = (-3*U(i,-1 + j,n) + 4*U(1 + i,-1 + j,n) - U(2 + i,-1 + j,n))/(2.*hx) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j-1,n) else outder = 0. endif endif if( maskm(-1 + i,j).gt.0 ) then innder = (-3*U(i,j,n) + 4*U(1 + i,j,n) - U(2 + i,j,n))/(2.*hx) else innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j-1,n) = lambda*innder+(1-lambda)*outder c :::::: right bottom side i = hi(1) if( mask(-1 + i,-1 + j).eq.0.and.mask(1 + i,-1 + j).eq.0 ) then outloc = -0.5 outder = (-U(-1 + i,-1 + j,n) + U(1 + i,-1 + j,n))/(2.*hx) else if( mask(-2 + i,-1 + j).eq.0.and.mask(-1 + i,-1 + j).eq.0.and.mask(i,-1 + j).eq.0 ) then outloc = -0.5 outder = (U(-2 + i,-1 + j,n) - 4*U(-1 + i,-1 + j,n) + 3*U(i,-1 + j,n))/(2.*hx) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j-1,n) else outder = 0. endif endif if( maskp(1 + i,j).gt.0 ) then innder = (U(-2 + i,j,n) - 4*U(-1 + i,j,n) + 3*U(i,j,n))/(2.*hx) else innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j-1,n) = lambda*innder+(1-lambda)*outder else if ( bct(n) .eq. LO_REFLECT_ODD ) then do i = lo(1), hi(1) u(i,lo(2)-1,n) = cvmgt( $ -u(i,lo(2),n), $ u(i,lo(2)-1,n), $ mask(i,lo(2)-1) .gt. 0) tander(i,lo(2)-1,n) = 0.0 enddo if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,lo(2),n) = cvmgt(-1.0, 0.0, $ mask(i,lo(2)-1) .gt. 0) enddo endif else print *,'UNKNOWN BC ON BOTTOM FACE IN APPLYBC' stop endif enddo endif c c The top of the grid c if (cdir .eq. 3) then do n = 1, nc if(is_neumann(bct(n))) then do i = lo(1), hi(1) u(i,hi(2)+1,n) = cvmgt( $ u(i,hi(2),n), $ u(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) enddo if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,hi(2),n) = 1.0 enddo endif c :::::: now do the tangential derivative part c :::::: interior part of top side j = hi(2) do i=lo(1)+1,hi(1)-1 innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) tander(i,j+1,n) = innder enddo c :::::: now end points c :::::: left top side i = lo(1) if( maskm(-1 + i,j).gt.0 ) then innder = (-3*U(i,j,n) + 4*U(1 + i,j,n) - U(2 + i,j,n))/(2.*hx) else innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) endif tander(i,j+1,n) = innder c :::::: right top side i = hi(1) if( maskp(1 + i,j).gt.0 ) then innder = (U(-2 + i,j,n) - 4*U(-1 + i,j,n) + 3*U(i,j,n))/(2.*hx) else innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) endif tander(i,j+1,n) = innder else if (is_dirichlet(bct(n))) then if ( bct(n) .eq. LO_REFLECT_ODD ) leny = 0 do m=0,leny x(m) = m + 0.5 enddo x(-1) = - bcl/h(2) xInt = - 0.5 call polyInterpCoeff(xInt, x, leny+2, coef) if ( flagbc .eq. 1 ) then do i = lo(1), hi(1) u(i,hi(2)+1,n) = cvmgt( $ bcval(i,hi(2)+1,n)*coef(-1), $ u(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) enddo else do i = lo(1), hi(1) u(i,hi(2)+1,n) = cvmgt( $ 0.0, $ u(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) enddo endif do m = 0, leny do i = lo(1), hi(1) u(i, hi(2)+1,n) = cvmgt( $ u(i,hi(2)+1,n) $ + u(i, hi(2)-m,n)*coef(m), $ u(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) enddo enddo if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,hi(2),n) = cvmgt(coef(0), 0.0, $ mask(i,hi(2)+1) .gt. 0) enddo endif c :::::: now do the tangential derivative part c :::::: interior part of top side edgloc = 0. j = hi(2) do i=lo(1)+1,hi(1)-1 if( mask(-1 + i,1 + j).eq.0.and.mask(1 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-U(-1 + i,1 + j,n) + U(1 + i,1 + j,n))/(2.*hx) else if( mask(i,1 + j).eq.0.and.mask(1 + i,1 + j).eq.0.and.mask(2 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-3*U(i,1 + j,n) + 4*U(1 + i,1 + j,n) - U(2 + i,1 + j,n))/(2.*hx) else if( mask(-2 + i,1 + j).eq.0.and.mask(-1 + i,1 + j).eq.0.and.mask(i,1 + j).eq.0 ) then outloc = -0.5 outder = (U(-2 + i,1 + j,n) - 4*U(-1 + i,1 + j,n) + 3*U(i,1 + j,n))/(2.*hx) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j+1,n) else outder = 0. endif endif innloc = 0.5 innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j+1,n) = lambda*innder+(1-lambda)*outder enddo c :::::: now end points c :::::: left top side i = lo(1) if( mask(-1 + i,1 + j).eq.0.and.mask(1 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-U(-1 + i,1 + j,n) + U(1 + i,1 + j,n))/(2.*hx) else if( mask(i,1 + j).eq.0.and.mask(1 + i,1 + j).eq.0.and.mask(2 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-3*U(i,1 + j,n) + 4*U(1 + i,1 + j,n) - U(2 + i,1 + j,n))/(2.*hx) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j+1,n) else outder = 0. endif endif if( maskm(-1 + i,j).gt.0 ) then innder = (-3*U(i,j,n) + 4*U(1 + i,j,n) - U(2 + i,j,n))/(2.*hx) else innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j+1,n) = lambda*innder+(1-lambda)*outder c :::::: right top side i = hi(1) if( mask(-1 + i,1 + j).eq.0.and.mask(1 + i,1 + j).eq.0 ) then outloc = -0.5 outder = (-U(-1 + i,1 + j,n) + U(1 + i,1 + j,n))/(2.*hx) else if( mask(-2 + i,1 + j).eq.0.and.mask(-1 + i,1 + j).eq.0.and.mask(i,1 + j).eq.0 ) then outloc = -0.5 outder = (U(-2 + i,1 + j,n) - 4*U(-1 + i,1 + j,n) + 3*U(i,1 + j,n))/(2.*hx) else outloc = x(-1) if( flagbc .eq. 1) then outder = exttd(i,j+1,n) else outder = 0. endif endif if( maskp(1 + i,j).gt.0 ) then innder = (U(-2 + i,j,n) - 4*U(-1 + i,j,n) + 3*U(i,j,n))/(2.*hx) else innder = (-U(-1 + i,j,n) + U(1 + i,j,n))/(2.*hx) endif innloc = 0.5 lambda = (edgloc-outloc)/(innloc-outloc) tander(i,j+1,n) = lambda*innder+(1-lambda)*outder else if ( bct(n) .eq. LO_REFLECT_ODD ) then do i = lo(1), hi(1) u(i,hi(2)+1,n) = cvmgt( $ -u(i,hi(2),n), $ u(i,hi(2)+1,n), $ mask(i,hi(2)+1) .gt. 0) tander(i,hi(2)+1,n) = 0.0 enddo if ( flagden .eq. 1 ) then do i = lo(1), hi(1) den(i,hi(2),n) = cvmgt(-1.0, 0.0, $ mask(i,hi(2)+1) .gt. 0) enddo endif else print *,'UNKNOWN BC ON TOP FACE IN APPLYBC' stop endif enddo endif c end subroutine FORT_GSRB ( $ u, DIMS(u), $ rhs, DIMS(rhs), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ maskn,DIMS(maskn), $ fn, DIMS(fn), $ maske,DIMS(maske), $ fe, DIMS(fe), $ maskw,DIMS(maskw), $ fw, DIMS(fw), $ masks,DIMS(masks), $ fs, DIMS(fs), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ lo,hi,h,nc,phaseflag $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(rhs) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(maskn) integer DIMDEC(maske) integer DIMDEC(maskw) integer DIMDEC(masks) integer DIMDEC(fn) integer DIMDEC(fe) integer DIMDEC(fw) integer DIMDEC(fs) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) REAL_T h(BL_SPACEDIM) integer nc,phaseflag REAL_T u(DIMV(u),2) REAL_T rhs(DIMV(rhs),2) REAL_T a(DIMV(a),2) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) integer maskn(DIMV(maskn)) integer maske(DIMV(maske)) integer maskw(DIMV(maskw)) integer masks(DIMV(masks)) REAL_T fn(DIMV(fn),nc) REAL_T fe(DIMV(fe),nc) REAL_T fw(DIMV(fw),nc) REAL_T fs(DIMV(fs),nc) REAL_T trandern(DIMV(trandern),2) REAL_T trandere(DIMV(trandere),2) REAL_T tranderw(DIMV(tranderw),2) REAL_T tranders(DIMV(tranders),2) integer i,j,modx,mody integer istart,jstart REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw,dudyn,dudys REAL_T dvdxe,dvdxw,dvdxn,dvdxs REAL_T diagu, diagv REAL_T operu, operv logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) if( nc .ne. 2 ) then write(6,*)'FORT_GSRB: bad nc',nc stop endif c ::: convert phase flag into modx and mody if( phaseflag.eq.0 ) then modx = 0 mody = 0 elseif(phaseflag.eq.1) then modx = 1 mody = 0 elseif(phaseflag.eq.2) then modx = 0 mody = 1 elseif(phaseflag.eq.3) then modx = 1 mody = 1 else write(6,*)'FORT_GSRB: bad phaseflag', phaseflag stop endif c ::: cases: c ::: 1) interior. All normal derivative expressions c ::: 2) edge but not on corner. check mask value to see if use outside c ::: value or use interpolations c ::: 3) corners. Must check mask values to see if use outside values c ::: values or use interpolations ON TWO SIDES. But must also c ::: check to see if need to do one-sided derivs for tangential c ::: derivatives. c ::: case 1 istart = lo(1)+1 if( mod(istart,2) .ne. modx ) istart = istart+1 jstart = lo(2)+1 if( mod(jstart,2) .ne. mody ) jstart = jstart+1 do j = jstart,hi(2)-1,2 do i = istart,hi(1)-1,2 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) c ::: evaluate operator operu = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) operv = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) enddo enddo c ::: case 2a) north side c ::: Null c ::: Null j = hi(2) if( mod(j,2) .eq. mody ) then do i = istart,hi(1)-1,2 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( maskn(i,1 + j).gt.0.or.maskn(1 + i,1 + j).gt.0 ) then dudye = ((U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy) + - (U(1 + i,-2 + j,1) - 4*U(1 + i,-1 + j,1) + 3*U(1 + i,j,1))/(2.*hy))/ - 2. else dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) endif if( maskn(-1 + i,1 + j).gt.0.or.maskn(i,1 + j).gt.0 ) then dudyw = ((U(-1 + i,-2 + j,1) - 4*U(-1 + i,-1 + j,1) + 3*U(-1 + i,j,1))/ - (2.*hy) + (U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy))/ - 2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif dvdxn = trandern(i,j+1,2) dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maskn(i,j+1).gt. 0) then diagu = diagu - fn(i,j,1)*beta*muY(i,j+1)/hy**2 diagv = diagv - fn(i,j,2)*2*beta*muY(i,j+1)/hy**2 endif c ::: evaluate operator operu = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) operv = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) enddo endif c ::: case 2b south side c ::: Null c ::: Null j=lo(2) if( mod(j,2) .eq. mody ) then do i=istart,hi(1)-1,2 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( masks(i,-1 + j).gt.0.or.masks(1 + i,-1 + j).gt.0 ) then dudye = ((-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy) + - (-3*U(1 + i,j,1) + 4*U(1 + i,1 + j,1) - U(1 + i,2 + j,1))/(2.*hy))/ - 2. else dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) endif if( masks(-1 + i,-1 + j).gt.0.or.masks(i,-1 + j).gt.0 ) then dudyw = ((-3*U(-1 + i,j,1) + 4*U(-1 + i,1 + j,1) - U(-1 + i,2 + j,1))/ - (2.*hy) + (-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy))/2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) dvdxs = tranders(i,j-1,2) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( masks(i,j-1).gt. 0) then diagu = diagu - fs(i,j,1)*beta*muY(i,j)/hy**2 diagv = diagv - fs(i,j,2)*2*beta*muY(i,j)/hy**2 endif c ::: evaluate operator operu = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) operv = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) enddo endif c ::: case 2c: west side story c ::: Null c ::: Null i=lo(1) if( mod(i,2) .eq. modx ) then do j=jstart,hi(2)-1,2 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) dudyw = tranderw(i-1,j,1) if( maskw(-1 + i,j).gt.0.or.maskw(-1 + i,1 + j).gt.0 ) then dvdxn = ((-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx) + - (-3*U(i,1 + j,2) + 4*U(1 + i,1 + j,2) - U(2 + i,1 + j,2))/(2.*hx))/ - 2. else dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) endif if( maskw(-1 + i,-1 + j).gt.0.or.maskw(-1 + i,j).gt.0 ) then dvdxs = ((-3*U(i,-1 + j,2) + 4*U(1 + i,-1 + j,2) - U(2 + i,-1 + j,2))/ - (2.*hx) + (-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx))/2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maskw(i-1,j).gt. 0) then diagu = diagu - fw(i,j,1)*2*beta*muX(i,j)/hx**2 diagv = diagv - fw(i,j,2)* beta*muX(i,j)/hy**2 endif c ::: evaluate operator operu = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) operv = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) enddo endif c ::: case 2d: east side story c ::: Null c ::: Null i=hi(1) if( mod(i,2) .eq. modx ) then do j=jstart,hi(2)-1,2 c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = trandere(i+1,j,1) dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) if( maske(1 + i,j).gt.0.or.maske(1 + i,1 + j).gt.0 ) then dvdxn = ((U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx) + - (U(-2 + i,1 + j,2) - 4*U(-1 + i,1 + j,2) + 3*U(i,1 + j,2))/(2.*hx))/ - 2. else dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) endif if( maske(1 + i,-1 + j).gt.0.or.maske(1 + i,j).gt.0 ) then dvdxs = ((U(-2 + i,-1 + j,2) - 4*U(-1 + i,-1 + j,2) + 3*U(i,-1 + j,2))/ - (2.*hx) + (U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx))/ - 2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maske(i+1,j).gt. 0) then diagu = diagu - fe(i,j,1)*2*beta*muX(i+1,j)/hx**2 diagv = diagv - fe(i,j,2)* beta*muX(i+1,j)/hy**2 endif c ::: evaluate operator operu = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) operv = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) enddo endif c ::: case 3a: north-east corner, plus i, plus j c ::: Null c ::: Null j=hi(2) i=hi(1) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody) then c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = trandere(i+1,j,1) if( maskn(-1 + i,1 + j).gt.0.or.maskn(i,1 + j).gt.0 ) then dudyw = ((U(-1 + i,-2 + j,1) - 4*U(-1 + i,-1 + j,1) + 3*U(-1 + i,j,1))/ - (2.*hy) + (U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy))/ - 2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif dvdxn = trandern(i,j+1,2) if( maske(1 + i,-1 + j).gt.0.or.maske(1 + i,j).gt.0 ) then dvdxs = ((U(-2 + i,-1 + j,2) - 4*U(-1 + i,-1 + j,2) + 3*U(i,-1 + j,2))/ - (2.*hx) + (U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx))/ - 2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maske(i+1,j).gt. 0) then diagu = diagu - fe(i,j,1)*2*beta*muX(i+1,j)/hx**2 diagv = diagv - fe(i,j,2)* beta*muX(i+1,j)/hy**2 endif if( maskn(i,j+1).gt. 0) then diagu = diagu - fn(i,j,1)*beta*muY(i,j+1)/hy**2 diagv = diagv - fn(i,j,2)*2*beta*muY(i,j+1)/hy**2 endif c ::: evaluate operator operu = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) operv = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) endif c ::: case 3b: south-east corner, plus i, minus j, plus i, plus j c ::: Null j=lo(2) i=hi(1) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody) then c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy dudye = trandere(i+1,j,1) if( masks(-1 + i,-1 + j).gt.0.or.masks(i,-1 + j).gt.0 ) then dudyw = ((-3*U(-1 + i,j,1) + 4*U(-1 + i,1 + j,1) - U(-1 + i,2 + j,1))/ - (2.*hy) + (-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy))/2. else dudyw = (-U(-1 + i,-1 + j,1) + U(-1 + i,1 + j,1) - U(i,-1 + j,1) + - U(i,1 + j,1))/(4.*hy) endif if( maske(1 + i,j).gt.0.or.maske(1 + i,1 + j).gt.0 ) then dvdxn = ((U(-2 + i,j,2) - 4*U(-1 + i,j,2) + 3*U(i,j,2))/(2.*hx) + - (U(-2 + i,1 + j,2) - 4*U(-1 + i,1 + j,2) + 3*U(i,1 + j,2))/(2.*hx))/ - 2. else dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) endif dvdxs = tranders(i,j-1,2) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maske(i+1,j).gt. 0) then diagu = diagu - fe(i,j,1)*2*beta*muX(i+1,j)/hx**2 diagv = diagv - fe(i,j,2)* beta*muX(i+1,j)/hy**2 endif if( masks(i,j-1).gt. 0) then diagu = diagu - fs(i,j,1)*beta*muY(i,j)/hy**2 diagv = diagv - fs(i,j,2)*2*beta*muY(i,j)/hy**2 endif c ::: evaluate operator operu = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) operv = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) endif c ::: case 3c: south-west corner, minus i, minus j c ::: Null j=lo(2) i=lo(1) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody) then c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( masks(i,-1 + j).gt.0.or.masks(1 + i,-1 + j).gt.0 ) then dudye = ((-3*U(i,j,1) + 4*U(i,1 + j,1) - U(i,2 + j,1))/(2.*hy) + - (-3*U(1 + i,j,1) + 4*U(1 + i,1 + j,1) - U(1 + i,2 + j,1))/(2.*hy))/ - 2. else dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) endif dudyw = tranderw(i-1,j,1) if( maskw(-1 + i,j).gt.0.or.maskw(-1 + i,1 + j).gt.0 ) then dvdxn = ((-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx) + - (-3*U(i,1 + j,2) + 4*U(1 + i,1 + j,2) - U(2 + i,1 + j,2))/(2.*hx))/ - 2. else dvdxn = (-U(-1 + i,j,2) - U(-1 + i,1 + j,2) + U(1 + i,j,2) + - U(1 + i,1 + j,2))/(4.*hx) endif dvdxs = tranders(i,j-1,2) dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maskw(i-1,j).gt. 0) then diagu = diagu - fw(i,j,1)*2*beta*muX(i,j)/hx**2 diagv = diagv - fw(i,j,2)* beta*muX(i,j)/hy**2 endif if( masks(i,j-1).gt. 0) then diagu = diagu - fs(i,j,1)*beta*muY(i,j)/hy**2 diagv = diagv - fs(i,j,2)*2*beta*muY(i,j)/hy**2 endif c ::: evaluate operator operu = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) operv = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) endif c ::: case 3d: north-west corner, minus i, plus j c ::: Null j=hi(2) i=lo(1) if( mod(i,2).eq.modx .and. mod(j,2).eq.mody) then c ::: get expressions for appropriate derivatives dudxe = (-U(i,j,1) + U(1 + i,j,1))/hx dudxw = (-U(-1 + i,j,1) + U(i,j,1))/hx dvdyn = (-U(i,j,2) + U(i,1 + j,2))/hy dvdys = (-U(i,-1 + j,2) + U(i,j,2))/hy dudyn = (-U(i,j,1) + U(i,1 + j,1))/hy dudys = (-U(i,-1 + j,1) + U(i,j,1))/hy if( maskn(i,1 + j).gt.0.or.maskn(1 + i,1 + j).gt.0 ) then dudye = ((U(i,-2 + j,1) - 4*U(i,-1 + j,1) + 3*U(i,j,1))/(2.*hy) + - (U(1 + i,-2 + j,1) - 4*U(1 + i,-1 + j,1) + 3*U(1 + i,j,1))/(2.*hy))/ - 2. else dudye = (-U(i,-1 + j,1) + U(i,1 + j,1) - U(1 + i,-1 + j,1) + - U(1 + i,1 + j,1))/(4.*hy) endif dudyw = tranderw(i-1,j,1) dvdxn = trandern(i,j+1,2) if( maskw(-1 + i,-1 + j).gt.0.or.maskw(-1 + i,j).gt.0 ) then dvdxs = ((-3*U(i,-1 + j,2) + 4*U(1 + i,-1 + j,2) - U(2 + i,-1 + j,2))/ - (2.*hx) + (-3*U(i,j,2) + 4*U(1 + i,j,2) - U(2 + i,j,2))/(2.*hx))/2. else dvdxs = (-U(-1 + i,-1 + j,2) - U(-1 + i,j,2) + U(1 + i,-1 + j,2) + - U(1 + i,j,2))/(4.*hx) endif dvdxe = (-U(i,j,2) + U(1 + i,j,2))/hx dvdxw = (-U(-1 + i,j,2) + U(i,j,2))/hx c ::: get diagonal element diagu = alpha*a(i,j,1) + $ 2*beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ beta*(muY(i,j)+muY(i,j+1))/(hy**2) diagv = alpha*a(i,j,2) + $ beta*(muX(i,j)+muX(i+1,j))/(hx**2)+ $ 2*beta*(muY(i,j)+muY(i,j+1))/(hy**2) if( maskw(i-1,j).gt. 0) then diagu = diagu - fw(i,j,1)*2*beta*muX(i,j)/hx**2 diagv = diagv - fw(i,j,2)* beta*muX(i,j)/hy**2 endif if( maskn(i,j+1).gt. 0) then diagu = diagu - fn(i,j,1)*beta*muY(i,j+1)/hy**2 diagv = diagv - fn(i,j,2)*2*beta*muY(i,j+1)/hy**2 endif c ::: evaluate operator operu = -((beta*(hy*(-2*dudxw*muX(i,j) + 2*dudxe*muX(1 + i,j)) + - hx*(-((dudys + dvdxs)*muY(i,j)) + (dudyn + dvdxn)*muY(i,1 + j)) - ))/(hx*hy)) + alpha*a(i,j,1)*u(i,j,1) operv = -((beta*(hy*(-((dudyw + dvdxw)*muX(i,j)) + - (dudye + dvdxe)*muX(1 + i,j)) + - hx*(-2*dvdys*muY(i,j) + 2*dvdyn*muY(i,1 + j))))/(hx*hy)) + - alpha*a(i,j,2)*u(i,j,2) c ::: do relaxation u(i,j,1) = (rhs(i,j,1)-operu)/diagu + u(i,j,1) u(i,j,2) = (rhs(i,j,2)-operv)/diagv + u(i,j,2) endif return end ccseapps-2.5/CCSEApps/tensorMG/MCInterpBndryData.cpp0000644000175000017500000002125311634153073023376 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MCInterpBndryData.cpp,v 1.15 2002/11/13 17:15:20 lijewski Exp $ // #include #include #include #include #include #include static BDInterpFunc* bdfunc[2*BL_SPACEDIM]; static BDPhysDerivative* bdider[2*BL_SPACEDIM]; static int bdfunc_set = 0; static void bdfunc_init () { const Orientation xloface(0,Orientation::low); const Orientation xhiface(0,Orientation::high); bdfunc[xloface] = FORT_BDINTERPXLO; bdfunc[xhiface] = FORT_BDINTERPXHI; bdider[xloface] = FORT_BDIDERIVXLO; bdider[xhiface] = FORT_BDIDERIVXHI; #if (BL_SPACEDIM > 1) const Orientation yloface(1,Orientation::low); const Orientation yhiface(1,Orientation::high); bdfunc[yloface] = FORT_BDINTERPYLO; bdfunc[yhiface] = FORT_BDINTERPYHI; bdider[yloface] = FORT_BDIDERIVYLO; bdider[yhiface] = FORT_BDIDERIVYHI; #endif #if (BL_SPACEDIM > 2) const Orientation zloface(2,Orientation::low); const Orientation zhiface(2,Orientation::high); bdfunc[zloface] = FORT_BDINTERPZLO; bdfunc[zhiface] = FORT_BDINTERPZHI; bdider[zloface] = FORT_BDIDERIVZLO; bdider[zhiface] = FORT_BDIDERIVZHI; #endif } #if (BL_SPACEDIM == 2) #define NUMDERIV 2 #endif #if (BL_SPACEDIM == 3) #define NUMDERIV 9 #endif #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); #define DEF_CLIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ const Real* fabdat = (fab).dataPtr(); MCInterpBndryData::MCInterpBndryData (const BoxArray& _grids, int _ncomp, const Geometry& geom) : BndryData(_grids,_ncomp,geom) {} // // At the coarsest level the bndry values are taken from adjacent grids. // void MCInterpBndryData::setBndryValues(const MultiFab& mf, int mf_start, int bnd_start, int num_comp, const Array& bc ) { if (!bdfunc_set) bdfunc_init(); BL_ASSERT(grids.size()); BL_ASSERT(grids == mf.boxArray()); int nDer = MCLinOp::bcComponentsNeeded(); BL_ASSERT(bc.size()==nDer); int ratio = 1; for (int n=bnd_start; n& bc) { if (!bdfunc_set) bdfunc_init(); BL_ASSERT(grids.size()); BL_ASSERT(grids == fine.boxArray()); int nDer = MCLinOp::bcComponentsNeeded(); BL_ASSERT(bc.size()==nDer); for (int n=bnd_start; n tmplen) { delete [] derives; tmplen = mxlen; #if (BL_SPACEDIM > 2) tmplen *= mxlen; #endif derives = new Real[tmplen*NUMDERIV]; } const int* lo = fine_bx.loVect(); const int* hi = fine_bx.hiVect(); const FArrayBox& fine_grd = fine[finemfi]; const int* finelo = fine_grd.loVect(); const int* finehi = fine_grd.hiVect(); const Real* finedat = fine_grd.dataPtr(f_start); for (OrientationIter fi; fi; ++fi) { Orientation face(fi()); int dir = face.coordDir(); // // Load up hfine with perpindicular h's. // Real hfine[BL_SPACEDIM]; int kdir = 0; for (int idir = 0; idir < BL_SPACEDIM; ++idir) { if (idir == dir) continue; hfine[kdir++] = h[idir]; } FArrayBox& bnd_fab = bndry[face][finemfi.index()]; const int* blo = bnd_fab.loVect(); const int* bhi = bnd_fab.hiVect(); Real* bdat = bnd_fab.dataPtr(bnd_start); if (fine_bx[face] != fine_domain[face] || geom.isPeriodic(dir)) { // // Internal or periodic edge, interpolate from crse data. // const Mask& mask = masks[face][finemfi.index()]; const int* mlo = mask.loVect(); const int* mhi = mask.hiVect(); const int* mdat = mask.dataPtr(); const FArrayBox& crse_fab = crse[face][finemfi.index()]; const int* clo = crse_fab.loVect(); const int* chi = crse_fab.hiVect(); const Real* cdat = crse_fab.dataPtr(c_start); int is_not_covered = BndryData::not_covered; bdfunc[face](bdat,ARLIM(blo),ARLIM(bhi), lo,hi,ARLIM(cblo),ARLIM(cbhi), &num_comp,&ratio,&is_not_covered, mdat,ARLIM(mlo),ARLIM(mhi), cdat,ARLIM(clo),ARLIM(chi),derives,hfine); } else { // // This copies data from ghost region of grid, plus // computes derivative. // bdider[face](bdat,ARLIM(blo),ARLIM(bhi), lo, hi, finedat,ARLIM(finelo),ARLIM(finehi), &num_comp,hfine); } } } delete [] derives; } ccseapps-2.5/CCSEApps/tensorMG/visc3d.ma0000644000175000017500000016452611634153073021145 0ustar amckinstryamckinstry(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "X Window System Mathematica Notebook Front End Version 2.2"; X11StandardFontEncoding; fontset = title, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, fontName, "times"; fontset = subtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, fontName, "times"; fontset = subsubtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, fontName, "times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, fontName, "times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, fontName, "times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, fontName, "times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, fontName, "times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, 12, fontName, "courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, fontName, "courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 12, fontName, "courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, fontName, "courier"; fontset = name, inactive, noPageBreakInGroup, nohscroll, preserveAspect, M7, italic, B65535, 10, fontName, "times"; fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 12, fontName, "times"; fontset = leftheader, 12, fontName, "times"; fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, 12, fontName, "times"; fontset = leftfooter, 12, fontName, "times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "courier"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";paletteColors = 128; automaticGrouping; currentKernel; ] :[font = subtitle; inactive; preserveAspect; startGroup] a clone of visc2d.ma which should work in 3D :[font = section; inactive; preserveAspect; startGroup] definition of tau :[font = input; preserveAspect; startGroup] tauxxdef = tauxx[i_ + half, j_ ,k_] -> 2*mu[i+half,j,k]*dudx[i+half,j,k] :[font = output; output; inactive; preserveAspect; endGroup] tauxx[half + (i_), j_, k_] -> 2*dudx[half + i, j, k]*mu[half + i, j, k] ;[o] tauxx[half + (i_), j_, k_] -> 2 dudx[half + i, j, k] mu[half + i, j, k] :[font = input; preserveAspect; startGroup] tauyydef = tauyy[i_, j_ + half,k_] -> 2*mu[i,j+half,k] * dvdy[i,j+half,k] :[font = output; output; inactive; preserveAspect; endGroup] tauyy[i_, half + (j_), k_] -> 2*dvdy[i, half + j, k]*mu[i, half + j, k] ;[o] tauyy[i_, half + (j_), k_] -> 2 dvdy[i, half + j, k] mu[i, half + j, k] :[font = input; preserveAspect; startGroup] tauzzdef = tauzz[i_,j_,k_+half] -> 2*mu[i,j,k+half]*dwdz[i,j,k+half] :[font = output; output; inactive; preserveAspect; endGroup] tauzz[i_, j_, half + (k_)] -> 2*dwdz[i, j, half + k]*mu[i, j, half + k] ;[o] tauzz[i_, j_, half + (k_)] -> 2 dwdz[i, j, half + k] mu[i, j, half + k] :[font = input; preserveAspect; startGroup] tauxydef = tauxy[i_,j_,k_] -> mu[i,j,k]* (dudy[i,j,k]+dvdx[i,j,k]) :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "tauxydef" is similar to existing symbols {tauxxdef, tauyydef}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "tauxy" is similar to existing symbols {tauxx, tauyy}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "dudy" is similar to existing symbols {dudx, dvdy}. :[font = message; inactive; preserveAspect] General::stop: Further output of General::spell will be suppressed during this calculation. :[font = output; output; inactive; preserveAspect; endGroup] tauxy[i_, j_, k_] -> (dudy[i, j, k] + dvdx[i, j, k])*mu[i, j, k] ;[o] tauxy[i_, j_, k_] -> (dudy[i, j, k] + dvdx[i, j, k]) mu[i, j, k] :[font = input; preserveAspect; startGroup] tauxzdef = tauxz[i_,j_,k_] -> mu[i,j,k]* (dudz[i,j,k]+dwdx[i,j,k]) :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "tauxzdef" is similar to existing symbols {tauxxdef, tauxydef, tauzzdef}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "tauxz" is similar to existing symbols {tauxx, tauxy, tauzz}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "dudz" is similar to existing symbols {dudx, dudy, dwdz}. :[font = message; inactive; preserveAspect] General::stop: Further output of General::spell will be suppressed during this calculation. :[font = output; output; inactive; preserveAspect; endGroup] tauxz[i_, j_, k_] -> (dudz[i, j, k] + dwdx[i, j, k])*mu[i, j, k] ;[o] tauxz[i_, j_, k_] -> (dudz[i, j, k] + dwdx[i, j, k]) mu[i, j, k] :[font = input; preserveAspect; startGroup] tauyzdef = tauyz[i_,j_,k_] -> mu[i,j,k]* (dvdz[i,j,k]+dwdy[i,j,k]) :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "tauyzdef" is similar to existing symbols {tauxzdef, tauyydef, tauzzdef}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "tauyz" is similar to existing symbols {tauxz, tauyy, tauzz}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "dvdz" is similar to existing symbols {dudz, dvdx, dvdy, dwdz}. :[font = message; inactive; preserveAspect] General::stop: Further output of General::spell will be suppressed during this calculation. :[font = output; output; inactive; preserveAspect; endGroup; endGroup] tauyz[i_, j_, k_] -> (dvdz[i, j, k] + dwdy[i, j, k])*mu[i, j, k] ;[o] tauyz[i_, j_, k_] -> (dvdz[i, j, k] + dwdy[i, j, k]) mu[i, j, k] :[font = section; inactive; preserveAspect; startGroup] definitions of derivatives :[font = subsubsection; inactive; preserveAspect; startGroup] diagonal derivatives :[font = input; preserveAspect; startGroup] dudxdef = dudx[i_+half,j_,k_] -> (u[i+1,j,k]-u[i,j,k])/hx :[font = output; output; inactive; preserveAspect; endGroup] dudx[half + (i_), j_, k_] -> (-u[i, j, k] + u[1 + i, j, k])/hx ;[o] -u[i, j, k] + u[1 + i, j, k] dudx[half + (i_), j_, k_] -> ---------------------------- hx :[font = input; preserveAspect; startGroup] dvdydef = dvdy[i_,j_+half,k_] -> (v[i,j+1,k]-v[i,j,k])/hy :[font = output; output; inactive; preserveAspect; endGroup] dvdy[i_, half + (j_), k_] -> (-v[i, j, k] + v[i, 1 + j, k])/hy ;[o] -v[i, j, k] + v[i, 1 + j, k] dvdy[i_, half + (j_), k_] -> ---------------------------- hy :[font = input; preserveAspect; startGroup] dwdzdef = dwdz[i_,j_,k_+half] -> (w[i,j,k+1]-w[i,j,k])/hz :[font = output; output; inactive; preserveAspect; endGroup; endGroup] dwdz[i_, j_, half + (k_)] -> (-w[i, j, k] + w[i, j, 1 + k])/hz ;[o] -w[i, j, k] + w[i, j, 1 + k] dwdz[i_, j_, half + (k_)] -> ---------------------------- hz :[font = subsubsection; inactive; preserveAspect; startGroup] dudy :[font = input; preserveAspect; startGroup] dudydef1 = dudy[i_,j_+half,k_] -> (u[i,j+1,k]-u[i,j,k])/hy :[font = output; output; inactive; preserveAspect; endGroup] dudy[i_, half + (j_), k_] -> (-u[i, j, k] + u[i, 1 + j, k])/hy ;[o] -u[i, j, k] + u[i, 1 + j, k] dudy[i_, half + (j_), k_] -> ---------------------------- hy :[font = input; preserveAspect; startGroup] dudydef2 = dudy[i_+half,j_,k_] -> (u[i,j+1,k]-u[i,j-1,k]+u[i+1,j+1,k]-u[i+1,j-1,k])/ (4*hy) :[font = output; output; inactive; preserveAspect; endGroup; endGroup] dudy[half + (i_), j_, k_] -> (-u[i, -1 + j, k] + u[i, 1 + j, k] - u[1 + i, -1 + j, k] + u[1 + i, 1 + j, k])/(4*hy) ;[o] dudy[half + (i_), j_, k_] -> (-u[i, -1 + j, k] + u[i, 1 + j, k] - u[1 + i, -1 + j, k] + u[1 + i, 1 + j, k]) / (4 hy) :[font = subsubsection; inactive; preserveAspect; startGroup] dudz :[font = input; preserveAspect; startGroup] dudzdef1 = dudz[i_,j_,k_+half]->(u[i,j,k+1]-u[i,j,k])/hz :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "dudzdef1" is similar to existing symbol "dudydef1". :[font = output; output; inactive; preserveAspect; endGroup] dudz[i_, j_, half + (k_)] -> (-u[i, j, k] + u[i, j, 1 + k])/hz ;[o] -u[i, j, k] + u[i, j, 1 + k] dudz[i_, j_, half + (k_)] -> ---------------------------- hz :[font = input; preserveAspect; startGroup] dudzdef2 = dudz[i_+half,j_,k_] -> (u[i,j,k+1]-u[i,j,k-1]+u[i+1,j,k+1]-u[i+1,j,k-1])/ (4*hz) :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "dudzdef2" is similar to existing symbol "dudydef2". :[font = output; output; inactive; preserveAspect; endGroup; endGroup] dudz[half + (i_), j_, k_] -> (-u[i, j, -1 + k] + u[i, j, 1 + k] - u[1 + i, j, -1 + k] + u[1 + i, j, 1 + k])/(4*hz) ;[o] dudz[half + (i_), j_, k_] -> (-u[i, j, -1 + k] + u[i, j, 1 + k] - u[1 + i, j, -1 + k] + u[1 + i, j, 1 + k]) / (4 hz) :[font = subsubsection; inactive; preserveAspect; startGroup] dvdx :[font = input; preserveAspect; startGroup] dvdxdef1 = dvdx[i_+half,j_,k_] -> (v[i+1,j,k]-v[i,j,k])/hx :[font = output; output; inactive; preserveAspect; endGroup] dvdx[half + (i_), j_, k_] -> (-v[i, j, k] + v[1 + i, j, k])/hx ;[o] -v[i, j, k] + v[1 + i, j, k] dvdx[half + (i_), j_, k_] -> ---------------------------- hx :[font = input; preserveAspect; startGroup] dvdxdef2 = dvdx[i_,j_+half,k_] -> (v[i+1,j+1,k]-v[i-1,j+1,k]+v[i+1,j,k]-v[i-1,j,k])/(4*hx) :[font = output; output; inactive; preserveAspect; endGroup; endGroup] dvdx[i_, half + (j_), k_] -> (-v[-1 + i, j, k] - v[-1 + i, 1 + j, k] + v[1 + i, j, k] + v[1 + i, 1 + j, k])/(4*hx) ;[o] dvdx[i_, half + (j_), k_] -> (-v[-1 + i, j, k] - v[-1 + i, 1 + j, k] + v[1 + i, j, k] + v[1 + i, 1 + j, k]) / (4 hx) :[font = subsubsection; inactive; preserveAspect; startGroup] dvdz :[font = input; preserveAspect; startGroup] dvdzdef1 = dvdz[i_,j_,k_+half]->(v[i,j,k+1]-v[i,j,k])/hz :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "dvdzdef1" is similar to existing symbols {dudzdef1, dvdxdef1}. :[font = output; output; inactive; preserveAspect; endGroup] dvdz[i_, j_, half + (k_)] -> (-v[i, j, k] + v[i, j, 1 + k])/hz ;[o] -v[i, j, k] + v[i, j, 1 + k] dvdz[i_, j_, half + (k_)] -> ---------------------------- hz :[font = input; preserveAspect; startGroup] dvdzdef2 = dvdz[i_,j_+half,k_]-> (v[i,j,k+1]-v[i,j,k-1]+v[i,j+1,k+1]-v[i,j+1,k-1])/ (4*hz) :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "dvdzdef2" is similar to existing symbols {dudzdef2, dvdxdef2}. :[font = output; output; inactive; preserveAspect; endGroup; endGroup] dvdz[i_, half + (j_), k_] -> (-v[i, j, -1 + k] + v[i, j, 1 + k] - v[i, 1 + j, -1 + k] + v[i, 1 + j, 1 + k])/(4*hz) ;[o] dvdz[i_, half + (j_), k_] -> (-v[i, j, -1 + k] + v[i, j, 1 + k] - v[i, 1 + j, -1 + k] + v[i, 1 + j, 1 + k]) / (4 hz) :[font = subsubsection; inactive; preserveAspect; startGroup] dwdx :[font = input; preserveAspect; startGroup] dwdxdef1 = dwdx[i_+half,j_,k_]->(w[i+1,j,k]-w[i,j,k])/hx :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "dwdxdef1" is similar to existing symbol "dvdxdef1". :[font = output; output; inactive; preserveAspect; endGroup] dwdx[half + (i_), j_, k_] -> (-w[i, j, k] + w[1 + i, j, k])/hx ;[o] -w[i, j, k] + w[1 + i, j, k] dwdx[half + (i_), j_, k_] -> ---------------------------- hx :[font = input; preserveAspect; startGroup] dwdxdef2 = dwdx[i_,j_,k_+half]-> (w[i+1,j,k]-w[i-1,j,k]+w[i+1,j,k+1]-w[i-1,j,k+1])/ (4*hx) :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "dwdxdef2" is similar to existing symbol "dvdxdef2". :[font = output; output; inactive; preserveAspect; endGroup; endGroup] dwdx[i_, j_, half + (k_)] -> (-w[-1 + i, j, k] - w[-1 + i, j, 1 + k] + w[1 + i, j, k] + w[1 + i, j, 1 + k])/(4*hx) ;[o] dwdx[i_, j_, half + (k_)] -> (-w[-1 + i, j, k] - w[-1 + i, j, 1 + k] + w[1 + i, j, k] + w[1 + i, j, 1 + k]) / (4 hx) :[font = subsubsection; inactive; preserveAspect; startGroup] dwdy :[font = input; preserveAspect; startGroup] dwdydef1 = dwdy[i_,j_+half,k_] -> (w[i,j+1,k]-w[i,j,k])/hy :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "dwdydef1" is similar to existing symbols {dudydef1, dwdxdef1}. :[font = output; output; inactive; preserveAspect; endGroup] dwdy[i_, half + (j_), k_] -> (-w[i, j, k] + w[i, 1 + j, k])/hy ;[o] -w[i, j, k] + w[i, 1 + j, k] dwdy[i_, half + (j_), k_] -> ---------------------------- hy :[font = input; preserveAspect; startGroup] dwdydef2 = dwdy[i_,j_,k_+half] -> (w[i,j+1,k]-w[i,j-1,k]+w[i,j+1,k+1]-w[i,j-1,k+1])/(4*hy) :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "dwdydef2" is similar to existing symbols {dudydef2, dwdxdef2}. :[font = output; output; inactive; preserveAspect; endGroup; endGroup; endGroup] dwdy[i_, j_, half + (k_)] -> (-w[i, -1 + j, k] - w[i, -1 + j, 1 + k] + w[i, 1 + j, k] + w[i, 1 + j, 1 + k])/(4*hy) ;[o] dwdy[i_, j_, half + (k_)] -> (-w[i, -1 + j, k] - w[i, -1 + j, 1 + k] + w[i, 1 + j, k] + w[i, 1 + j, 1 + k]) / (4 hy) :[font = section; inactive; preserveAspect; startGroup] definitions used to test taylor expansions :[font = input; preserveAspect; startGroup] taylorudef = u[i_,j_,k_]-> U[x0,y0,z0]+ DuDx[x0,y0,z0]*((i+1/2)*hx-x0)+ DuDy[x0,y0,z0]*((j+1/2)*hy-y0)+ DuDz[x0,y0,z0]*((k+1/2)*hz-z0)+ D2uDy2[x0,y0,z0]/2*((i+1/2)*hx-x0)^2+ D2uDx2[x0,y0,z0]/2*((j+1/2)*hy-y0)^2+ D2uDz2[x0,y0,z0]/2*((k+1/2)*hz-z0)^2+ D2uDxDy[x0,y0,z0]*((i+1/2)*hx-x0)*((j+1/2)*hy-y0)+ D2uDxDz[x0,y0,z0]*((i+1/2)*hx-x0)*((k+1/2)*hz-z0)+ D2uDyDz[x0,y0,z0]*((j+1/2)*hy-y0)*((k+1/2)*hz-z0) :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "DuDy" is similar to existing symbol "DuDx". :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "DuDz" is similar to existing symbols {DuDx, DuDy}. :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "D2uDx2" is similar to existing symbol "D2uDy2". :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "D2uDz2" is similar to existing symbols {D2uDx2, D2uDy2}. :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "D2uDxDz" is similar to existing symbol "D2uDxDy". :[font = message; inactive; preserveAspect] General::stop: Further output of General::spell1 will be suppressed during this calculation. :[font = output; output; inactive; preserveAspect; endGroup] u[i_, j_, k_] -> (hx*(1/2 + i) - x0)*DuDx[x0, y0, z0] + (hy*(1/2 + j) - y0)*DuDy[x0, y0, z0] + (hz*(1/2 + k) - z0)*DuDz[x0, y0, z0] + (hx*(1/2 + i) - x0)*(hy*(1/2 + j) - y0)* D2uDxDy[x0, y0, z0] + (hx*(1/2 + i) - x0)*(hz*(1/2 + k) - z0)* D2uDxDz[x0, y0, z0] + ((hy*(1/2 + j) - y0)^2*D2uDx2[x0, y0, z0])/2 + (hy*(1/2 + j) - y0)*(hz*(1/2 + k) - z0)* D2uDyDz[x0, y0, z0] + ((hx*(1/2 + i) - x0)^2*D2uDy2[x0, y0, z0])/2 + ((hz*(1/2 + k) - z0)^2*D2uDz2[x0, y0, z0])/2 + U[x0, y0, z0] ;[o] u[i_, j_, k_] -> 1 (hx (- + i) - x0) DuDx[x0, y0, z0] + 2 1 (hy (- + j) - y0) DuDy[x0, y0, z0] + 2 1 (hz (- + k) - z0) DuDz[x0, y0, z0] + 2 1 1 (hx (- + i) - x0) (hy (- + j) - y0) 2 2 D2uDxDy[x0, y0, z0] + 1 1 (hx (- + i) - x0) (hz (- + k) - z0) 2 2 D2uDxDz[x0, y0, z0] + 1 2 (hy (- + j) - y0) D2uDx2[x0, y0, z0] 2 ------------------------------------- + 2 1 1 (hy (- + j) - y0) (hz (- + k) - z0) 2 2 D2uDyDz[x0, y0, z0] + 1 2 (hx (- + i) - x0) D2uDy2[x0, y0, z0] 2 ------------------------------------- + 2 1 2 (hz (- + k) - z0) D2uDz2[x0, y0, z0] 2 ------------------------------------- + U[x0, y0, z0] 2 :[font = input; preserveAspect] dog = dudy[i+half,j,k] //. {dudydef1,dudydef2,taylorudef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,k->0,x0->hx,y0->hy/2,z0->hz/2} :[font = output; output; inactive; preserveAspect; endGroup] DuDy[hx, hy/2, hz/2] ;[o] hy hz DuDy[hx, --, --] 2 2 :[font = input; preserveAspect] dog = dudy[i,j+half,k] //. {dudydef1,dudydef2,taylorudef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2} :[font = output; output; inactive; preserveAspect; endGroup] DuDy[hx/2, hy, hz/2] ;[o] hx hz DuDy[--, hy, --] 2 2 :[font = input; preserveAspect; startGroup] taylorvdef = v[i_,j_,k_]-> V[x0,y0,z0]+ DvDx[x0,y0,z0]*((i+1/2)*hx-x0)+ DvDy[x0,y0,z0]*((j+1/2)*hy-y0)+ DvDz[x0,y0,z0]*((k+1/2)*hz-z0)+ D2vDy2[x0,y0,z0]/2*((i+1/2)*hx-x0)^2+ D2vDx2[x0,y0,z0]/2*((j+1/2)*hy-y0)^2+ D2vDz2[x0,y0,z0]/2*((k+1/2)*hz-z0)^2+ D2vDxDy[x0,y0,z0]*((i+1/2)*hx-x0)*((j+1/2)*hy-y0)+ D2vDxDz[x0,y0,z0]*((i+1/2)*hx-x0)*((k+1/2)*hz-z0)+ D2vDyDz[x0,y0,z0]*((j+1/2)*hy-y0)*((k+1/2)*hz-z0) :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "taylorvdef" is similar to existing symbol "taylorudef". :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "DvDx" is similar to existing symbol "DuDx". :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "DvDy" is similar to existing symbols {DuDy, DvDx}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "DvDz" is similar to existing symbols {DuDz, DvDx, DvDy}. :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "D2vDy2" is similar to existing symbol "D2uDy2". :[font = message; inactive; preserveAspect] General::stop: Further output of General::spell1 will be suppressed during this calculation. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "D2vDx2" is similar to existing symbols {D2uDx2, D2vDy2}. :[font = message; inactive; preserveAspect] General::stop: Further output of General::spell will be suppressed during this calculation. :[font = output; output; inactive; preserveAspect; endGroup] v[i_, j_, k_] -> (hx*(1/2 + i) - x0)*DvDx[x0, y0, z0] + (hy*(1/2 + j) - y0)*DvDy[x0, y0, z0] + (hz*(1/2 + k) - z0)*DvDz[x0, y0, z0] + (hx*(1/2 + i) - x0)*(hy*(1/2 + j) - y0)* D2vDxDy[x0, y0, z0] + (hx*(1/2 + i) - x0)*(hz*(1/2 + k) - z0)* D2vDxDz[x0, y0, z0] + ((hy*(1/2 + j) - y0)^2*D2vDx2[x0, y0, z0])/2 + (hy*(1/2 + j) - y0)*(hz*(1/2 + k) - z0)* D2vDyDz[x0, y0, z0] + ((hx*(1/2 + i) - x0)^2*D2vDy2[x0, y0, z0])/2 + ((hz*(1/2 + k) - z0)^2*D2vDz2[x0, y0, z0])/2 + V[x0, y0, z0] ;[o] v[i_, j_, k_] -> 1 (hx (- + i) - x0) DvDx[x0, y0, z0] + 2 1 (hy (- + j) - y0) DvDy[x0, y0, z0] + 2 1 (hz (- + k) - z0) DvDz[x0, y0, z0] + 2 1 1 (hx (- + i) - x0) (hy (- + j) - y0) 2 2 D2vDxDy[x0, y0, z0] + 1 1 (hx (- + i) - x0) (hz (- + k) - z0) 2 2 D2vDxDz[x0, y0, z0] + 1 2 (hy (- + j) - y0) D2vDx2[x0, y0, z0] 2 ------------------------------------- + 2 1 1 (hy (- + j) - y0) (hz (- + k) - z0) 2 2 D2vDyDz[x0, y0, z0] + 1 2 (hx (- + i) - x0) D2vDy2[x0, y0, z0] 2 ------------------------------------- + 2 1 2 (hz (- + k) - z0) D2vDz2[x0, y0, z0] 2 ------------------------------------- + V[x0, y0, z0] 2 :[font = input; preserveAspect] dog = dvdy[i,j+half,k] //. {dvdydef, taylorvdef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2} :[font = output; output; inactive; preserveAspect; endGroup] DvDy[hx/2, hy, hz/2] ;[o] hx hz DvDy[--, hy, --] 2 2 :[font = input; preserveAspect; startGroup] taylorwdef = w[i_,j_,k_]-> W[x0,y0,z0]+ DwDx[x0,y0,z0]*((i+1/2)*hx-x0)+ DwDy[x0,y0,z0]*((j+1/2)*hy-y0)+ DwDz[x0,y0,z0]*((k+1/2)*hz-z0)+ D2wDy2[x0,y0,z0]/2*((i+1/2)*hx-x0)^2+ D2wDx2[x0,y0,z0]/2*((j+1/2)*hy-y0)^2+ D2wDz2[x0,y0,z0]/2*((k+1/2)*hz-z0)^2+ D2wDxDy[x0,y0,z0]*((i+1/2)*hx-x0)*((j+1/2)*hy-y0)+ D2wDxDz[x0,y0,z0]*((i+1/2)*hx-x0)*((k+1/2)*hz-z0)+ D2wDyDz[x0,y0,z0]*((j+1/2)*hy-y0)*((k+1/2)*hz-z0) :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "taylorwdef" is similar to existing symbols {taylorudef, taylorvdef}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "DwDx" is similar to existing symbols {DuDx, DvDx}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "DwDy" is similar to existing symbols {DuDy, DvDy, DwDx}. :[font = message; inactive; preserveAspect] General::stop: Further output of General::spell will be suppressed during this calculation. :[font = output; output; inactive; preserveAspect; endGroup] w[i_, j_, k_] -> (hx*(1/2 + i) - x0)*DwDx[x0, y0, z0] + (hy*(1/2 + j) - y0)*DwDy[x0, y0, z0] + (hz*(1/2 + k) - z0)*DwDz[x0, y0, z0] + (hx*(1/2 + i) - x0)*(hy*(1/2 + j) - y0)* D2wDxDy[x0, y0, z0] + (hx*(1/2 + i) - x0)*(hz*(1/2 + k) - z0)* D2wDxDz[x0, y0, z0] + ((hy*(1/2 + j) - y0)^2*D2wDx2[x0, y0, z0])/2 + (hy*(1/2 + j) - y0)*(hz*(1/2 + k) - z0)* D2wDyDz[x0, y0, z0] + ((hx*(1/2 + i) - x0)^2*D2wDy2[x0, y0, z0])/2 + ((hz*(1/2 + k) - z0)^2*D2wDz2[x0, y0, z0])/2 + W[x0, y0, z0] ;[o] w[i_, j_, k_] -> 1 (hx (- + i) - x0) DwDx[x0, y0, z0] + 2 1 (hy (- + j) - y0) DwDy[x0, y0, z0] + 2 1 (hz (- + k) - z0) DwDz[x0, y0, z0] + 2 1 1 (hx (- + i) - x0) (hy (- + j) - y0) 2 2 D2wDxDy[x0, y0, z0] + 1 1 (hx (- + i) - x0) (hz (- + k) - z0) 2 2 D2wDxDz[x0, y0, z0] + 1 2 (hy (- + j) - y0) D2wDx2[x0, y0, z0] 2 ------------------------------------- + 2 1 1 (hy (- + j) - y0) (hz (- + k) - z0) 2 2 D2wDyDz[x0, y0, z0] + 1 2 (hx (- + i) - x0) D2wDy2[x0, y0, z0] 2 ------------------------------------- + 2 1 2 (hz (- + k) - z0) D2wDz2[x0, y0, z0] 2 ------------------------------------- + W[x0, y0, z0] 2 :[font = input; preserveAspect] dog = dwdy[i,j+half,k] //. {dwdydef1,dwdydef2, taylorwdef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2} :[font = output; output; inactive; preserveAspect; endGroup] DwDy[hx/2, hy, hz/2] ;[o] hx hz DwDy[--, hy, --] 2 2 :[font = input; preserveAspect] dog = dwdy[i,j,k+half] //. {dwdydef1,dwdydef2, taylorwdef} ; :[font = input; preserveAspect; startGroup] dog /. {i->0,j->0,k->0,x0->hx/2,y0->hy/2,z0->hz} :[font = output; output; inactive; preserveAspect; endGroup] DwDy[hx/2, hy/2, hz] ;[o] hx hy DwDy[--, --, hz] 2 2 :[font = input; preserveAspect; startGroup] taylormudef = mu[i_,j_]-> MU[x0,y0,z0]+ DmuDx[x0,y0,z0]*((i+1/2)*hx-x0)+ DmuDy[x0,y0,z0]*((j+1/2)*hy-y0)+ DmuDz[x0,y0,z0]*((k+1/2)*hz-z0) :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "taylormudef" is similar to existing symbol "taylorudef". :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "DmuDx" is similar to existing symbol "DuDx". :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "DmuDy" is similar to existing symbols {DmuDx, DuDy}. :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "DmuDz" is similar to existing symbols {DmuDx, DmuDy, DuDz}. :[font = output; output; inactive; preserveAspect; endGroup; endGroup] mu[i_, j_] -> (hx*(1/2 + i) - x0)*DmuDx[x0, y0, z0] + (hy*(1/2 + j) - y0)*DmuDy[x0, y0, z0] + (hz*(1/2 + k) - z0)*DmuDz[x0, y0, z0] + MU[x0, y0, z0] ;[o] mu[i_, j_] -> 1 (hx (- + i) - x0) DmuDx[x0, y0, z0] + 2 1 (hy (- + j) - y0) DmuDy[x0, y0, z0] + 2 1 (hz (- + k) - z0) DmuDz[x0, y0, z0] + MU[x0, y0, z0] 2 :[font = section; inactive; preserveAspect; startGroup] tests :[font = subsubsection; inactive; preserveAspect; startGroup] diagonal elements of tau :[font = input; preserveAspect] dog = tauxx[i+half,j,k] //. {tauxxdef,dudxdef,taylormudef,taylorudef}; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,k->0,x0->hx,y0 -> hy/2,z0->hz/2 } :[font = output; output; inactive; preserveAspect; endGroup] 2*DuDx[hx, hy/2, hz/2]*mu[1/2, 0, 0] ;[o] hy hz 1 2 DuDx[hx, --, --] mu[-, 0, 0] 2 2 2 :[font = input; preserveAspect] dog = tauyy[i,j+half,k] //. {tauyydef,dvdydef,taylormudef,taylorvdef}; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2} :[font = output; output; inactive; preserveAspect; endGroup] 2*DvDy[hx/2, hy, hz/2]*mu[0, 1/2, 0] ;[o] hx hz 1 2 DvDy[--, hy, --] mu[0, -, 0] 2 2 2 :[font = input; preserveAspect] dog = tauzz[i,j,k+half] //. {tauzzdef,dwdzdef,taylormudef,taylorvdef,taylorwdef}; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy/2,z0->hz} :[font = output; output; inactive; preserveAspect; endGroup; endGroup] 2*DwDz[hx/2, hy/2, hz]*mu[0, 0, 1/2] ;[o] hx hy 1 2 DwDz[--, --, hz] mu[0, 0, -] 2 2 2 :[font = subsubsection; inactive; preserveAspect; startGroup] tauxy :[font = input; preserveAspect] dog = tauxy[i,j+half,k] //. {tauxydef,dudydef1,dudydef2,dvdxdef1,dvdxdef2, taylormudef,taylorudef,taylorvdef}; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2} :[font = output; output; inactive; preserveAspect; endGroup] (DuDy[hx/2, hy, hz/2] + DvDx[hx/2, hy, hz/2])*mu[0, 1/2, 0] ;[o] hx hz hx hz 1 (DuDy[--, hy, --] + DvDx[--, hy, --]) mu[0, -, 0] 2 2 2 2 2 :[font = input; preserveAspect] dog = tauxy[i+half,j,k] //. {tauxydef,dudydef1,dudydef2,dvdxdef1,dvdxdef2, taylormudef,taylorudef,taylorvdef}; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,k->0,x0->hx,y0->hy/2,z0->hz/2} :[font = output; output; inactive; preserveAspect; endGroup; endGroup] (DuDy[hx, hy/2, hz/2] + DvDx[hx, hy/2, hz/2])*mu[1/2, 0, 0] ;[o] hy hz hy hz 1 (DuDy[hx, --, --] + DvDx[hx, --, --]) mu[-, 0, 0] 2 2 2 2 2 :[font = subsubsection; inactive; preserveAspect; startGroup] tauxz :[font = input; preserveAspect] dog = tauxz[i+half,j,k] //. {tauxzdef,dudzdef1,dudzdef2,dwdxdef1,dwdxdef2, taylormudef,taylorudef,taylorwdef} ; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,k->0,x0->hx,y0->hy/2,z0->hz/2} :[font = output; output; inactive; preserveAspect; endGroup] (DuDz[hx, hy/2, hz/2] + DwDx[hx, hy/2, hz/2])*mu[1/2, 0, 0] ;[o] hy hz hy hz 1 (DuDz[hx, --, --] + DwDx[hx, --, --]) mu[-, 0, 0] 2 2 2 2 2 :[font = input; preserveAspect] dog = tauxz[i,j,k+half] //. {tauxzdef,dudzdef1,dudzdef2,dwdxdef1,dwdxdef2, taylormudef,taylorudef,taylorwdef} ; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy/2,z0->hz} :[font = output; output; inactive; preserveAspect; endGroup; endGroup] (DuDz[hx/2, hy/2, hz] + DwDx[hx/2, hy/2, hz])*mu[0, 0, 1/2] ;[o] hx hy hx hy 1 (DuDz[--, --, hz] + DwDx[--, --, hz]) mu[0, 0, -] 2 2 2 2 2 :[font = subsubsection; inactive; preserveAspect; startGroup] tauyz :[font = input; preserveAspect] dog = tauyz[i,j+half,k] //. {tauyzdef,dvdzdef1,dvdzdef2,dwdydef1,dwdydef2, taylormudef,taylorvdef,taylorwdef} ; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy,z0->hz/2} :[font = output; output; inactive; preserveAspect; endGroup] (DvDz[hx/2, hy, hz/2] + DwDy[hx/2, hy, hz/2])*mu[0, 1/2, 0] ;[o] hx hz hx hz 1 (DvDz[--, hy, --] + DwDy[--, hy, --]) mu[0, -, 0] 2 2 2 2 2 :[font = input; preserveAspect] dog = tauyz[i,j,k+half] //. {tauyzdef,dvdzdef1,dvdzdef2,dwdydef1,dwdydef2, taylormudef,taylorvdef,taylorwdef} ; :[font = input; preserveAspect; startGroup] dog //. {half->1/2,i->0,j->0,k->0,x0->hx/2,y0->hy/2,z0->hz} :[font = output; output; inactive; preserveAspect; endGroup; endGroup; endGroup] (DvDz[hx/2, hy/2, hz] + DwDy[hx/2, hy/2, hz])*mu[0, 0, 1/2] ;[o] hx hy hx hy 1 (DvDz[--, --, hz] + DwDy[--, --, hz]) mu[0, 0, -] 2 2 2 2 2 :[font = section; inactive; preserveAspect; startGroup] definitions used for fortran output :[font = input; preserveAspect; startGroup] murepl1 = mu[i_,j_+half,k_] -> muY[i,j+1,k] :[font = output; output; inactive; preserveAspect; endGroup] mu[i_, half + (j_), k_] -> muY[i, 1 + j, k] ;[o] mu[i_, half + (j_), k_] -> muY[i, 1 + j, k] :[font = input; preserveAspect; startGroup] murepl2 = mu[i_+half,j_,k_] -> muX[i+1,j,k] :[font = output; output; inactive; preserveAspect; endGroup] mu[half + (i_), j_, k_] -> muX[1 + i, j, k] ;[o] mu[half + (i_), j_, k_] -> muX[1 + i, j, k] :[font = input; preserveAspect; startGroup] murepl3 = mu[i_,j_,k_+half] -> muZ[i,j,k+1] :[font = output; output; inactive; preserveAspect; endGroup] mu[i_, j_, half + (k_)] -> muZ[i, j, 1 + k] ;[o] mu[i_, j_, half + (k_)] -> muZ[i, j, 1 + k] :[font = input; preserveAspect; startGroup] urepl = u[i_,j_,k_] -> U[i,j,k,1] :[font = output; output; inactive; preserveAspect; endGroup] u[i_, j_, k_] -> U[i, j, k, 1] ;[o] u[i_, j_, k_] -> U[i, j, k, 1] :[font = input; preserveAspect; startGroup] vrepl = v[i_,j_,k_] -> U[i,j,k,2] :[font = message; inactive; preserveAspect] General::spell1: Possible spelling error: new symbol name "vrepl" is similar to existing symbol "urepl". :[font = output; output; inactive; preserveAspect; endGroup] v[i_, j_, k_] -> U[i, j, k, 2] ;[o] v[i_, j_, k_] -> U[i, j, k, 2] :[font = input; preserveAspect; startGroup] wrepl = w[i_,j_,k_] -> U[i,j,k,3] :[font = message; inactive; preserveAspect] General::spell: Possible spelling error: new symbol name "wrepl" is similar to existing symbols {urepl, vrepl}. :[font = output; output; inactive; preserveAspect; endGroup] w[i_, j_, k_] -> U[i, j, k, 3] ;[o] w[i_, j_, k_] -> U[i, j, k, 3] :[font = subsection; inactive; preserveAspect; startGroup] dependentCellsNotCovered is a function which returns a logical expression suitable for inclusion in fortran. Give an expression, exp, we wish to determine which mesh locations are accessed by the expression. However, we do not wish to examine all possible locations, only those outside the grid patch region. So we provide a second argument, which is a boolean function taking two arguments. The combination will give logical expressions testing the mask for cells utilized by the expression and for which the boolean function, logfunc[il,jl], evaluates as true. The third argument is the name of the mask array :[font = input; preserveAspect] Clear[ dependentCellsNotCovered ] :[font = input; preserveAspect; startGroup] dependentCellsNotCovered[exp_ , logfunc_ ,maskfun_] := Module[{cond,lexp,il,jl,kl,ml}, cond = False; lexp = exp; For[il=-1,il<=+1,il++, For[jl=-1,jl<=+1,jl++, For[kl=-1,kl<=+1,kl++, For[ml=1,ml<=3,ml++, If[ (logfunc[il,jl,kl]) && (Coefficient[ Expand[ exp ] , U[i+il,j+jl,k+kl,ml] ] =!= 0), cond = cond || (maskfun[i+il,j+jl,k+kl]>0) ] ] ] ] ]; cond ] :[font = message; inactive; preserveAspect; endGroup] General::spell1: Possible spelling error: new symbol name "lexp" is similar to existing symbol "exp". :[font = input; preserveAspect; startGroup] dependentCellsNotCovered[abba*U[i+1,j-1,k,1]+U[i-1,j-1,k+1,2] , Function[{i,j,k},(k>0)] , masks ] :[font = output; output; inactive; preserveAspect; endGroup; endGroup] masks[-1 + i, -1 + j, 1 + k] > 0 ;[o] masks[-1 + i, -1 + j, 1 + k] > 0 :[font = subsection; inactive; preserveAspect; startGroup] dependentCellsCovered is the logical inverse of dependentCellsNotCovered :[font = input; preserveAspect] Clear[ dependentCellsCovered ] :[font = input; preserveAspect] dependentCellsCovered[exp_ , logfunc_ ,maskfun_] := Module[{cond,lexp,il,jl,kl,ml}, cond = True; lexp = exp; For[il=-1,il<=+1,il++, For[jl=-1,jl<=+1,jl++, For[kl=-1,kl<=+1,kl++, For[ml=1,ml<=3,ml++, If[ (logfunc[il,jl,kl]) && (Coefficient[ Expand[ exp ] , U[i+il,j+jl,k+kl,ml] ] =!= 0), cond = cond && (maskfun[i+il,j+jl,k+kl]==0) ] ] ] ] ]; cond ] :[font = input; preserveAspect; startGroup] dependentCellsCovered[abba*U[i+1,j-1,k,1]+U[i-1,j-1,k+1,2] , Function[{i,j,k},(k>0)] , masks ] :[font = output; output; inactive; preserveAspect; endGroup; endGroup] masks[-1 + i, -1 + j, 1 + k] == 0 ;[o] masks[-1 + i, -1 + j, 1 + k] == 0 :[font = subsection; inactive; preserveAspect; startGroup] definitions for two sided derivs :[font = input; preserveAspect] DTwoX[u_,i_,j_,k_] := (u[i+1,j,k]-u[i-1,j,k])/(2*hx) :[font = input; preserveAspect] DTwoX[u_,i_,j_,k_,n_] := (u[i+1,j,k,n]-u[i-1,j,k,n])/(2*hx) :[font = input; preserveAspect; startGroup] Simplify[ DTwoX[u,0,0,0] //. {taylorudef,x0->hx/2,y0->hy/2, z0->hz/2} ] :[font = output; output; inactive; preserveAspect; endGroup] DuDx[hx/2, hy/2, hz/2] ;[o] hx hy hz DuDx[--, --, --] 2 2 2 :[font = input; preserveAspect; startGroup] DTwoY[u_,i_,j_,k_] := (u[i,j+1,k]-u[i,j-1,k])/(2*hy) :[font = message; inactive; preserveAspect; endGroup] General::spell1: Possible spelling error: new symbol name "DTwoY" is similar to existing symbol "DTwoX". :[font = input; preserveAspect] DTwoY[u_,i_,j_,k_,n_] := (u[i,j+1,k,n]-u[i,j-1,k,n])/(2*hy) :[font = input; preserveAspect; startGroup] Simplify[ DTwoY[u,0,0,0] //. {taylorudef,x0->hx/2,y0->hy/2, z0->hz/2} ] :[font = output; output; inactive; preserveAspect; endGroup] DuDy[hx/2, hy/2, hz/2] ;[o] hx hy hz DuDy[--, --, --] 2 2 2 :[font = input; preserveAspect; startGroup] DTwoZ[u_,i_,j_,k_] := (u[i,j,k+1]-u[i,j,k-1])/(2*hz) :[font = message; inactive; preserveAspect; endGroup] General::spell: Possible spelling error: new symbol name "DTwoZ" is similar to existing symbols {DTwoX, DTwoY}. :[font = input; preserveAspect] DTwoZ[u_,i_,j_,k_,n_] := (u[i,j,k+1,n]-u[i,j,k-1,n])/(2*hz) :[font = input; preserveAspect; startGroup] Simplify[ DTwoZ[u,0,0,0] //. {taylorudef,x0->hx/2,y0->hy/2, z0->hz/2} ] :[font = output; output; inactive; preserveAspect; endGroup; endGroup] DuDz[hx/2, hy/2, hz/2] ;[o] hx hy hz DuDz[--, --, --] 2 2 2 :[font = subsection; inactive; preserveAspect; startGroup] definitions for Do One-sided Derivative in X direction. if sign is positive, it means extend the stencil in the positivie x direction. if negative, extend in other direction :[font = input; preserveAspect] DOneX[u_,i_,j_,k_,sign_] := (-u[i+2,j,k]+4*u[i+1,j,k]-3*u[i,j,k])/ (2*hx) /; sign==1 :[font = input; preserveAspect] DOneX[u_,i_,j_,k_,sign_] := (u[i-2,j,k]-4*u[i-1,j,k]+3*u[i,j,k])/ (2*hx) /; sign==-1 :[font = input; preserveAspect] DOneX[u_,i_,j_,k_,n_,sign_] := (-u[i+2,j,k,n]+4*u[i+1,j,k,n]-3*u[i,j,k,n])/ (2*hx) /; sign==1 :[font = input; preserveAspect] DOneX[u_,i_,j_,k_,n_,sign_] := (u[i-2,j,k,n]-4*u[i-1,j,k,n]+3*u[i,j,k,n])/ (2*hx) /; sign==-1 :[font = input; preserveAspect; startGroup] Simplify[ DOneX[u,0,0,0,-1] //. {taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}] :[font = output; output; inactive; preserveAspect; endGroup] DuDx[hx/2, hy/2, hz/2] ;[o] hx hy hz DuDx[--, --, --] 2 2 2 :[font = input; preserveAspect; startGroup] Simplify[ DOneX[u,0,0,0,+1] //. {taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}] :[font = output; output; inactive; preserveAspect; endGroup; endGroup] DuDx[hx/2, hy/2, hz/2] ;[o] hx hy hz DuDx[--, --, --] 2 2 2 :[font = subsection; inactive; preserveAspect; startGroup] definitions for Do One-sided Derivative in Y direction. if sign is positive, it means extend the stencil in the positivie y direction. if negative, extend in other direction :[font = input; preserveAspect; startGroup] DOneY[u_,i_,j_,k_,sign_] := (-u[i,j+2,k]+4*u[i,j+1,k]-3*u[i,j,k])/ (2*hy) /; sign==1 :[font = message; inactive; preserveAspect; endGroup] General::spell1: Possible spelling error: new symbol name "DOneY" is similar to existing symbol "DOneX". :[font = input; preserveAspect] DOneY[u_,i_,j_,k_,sign_] := (u[i,j-2,k]-4*u[i,j-1,k]+3*u[i,j,k])/ (2*hy) /; sign==-1 :[font = input; preserveAspect] DOneY[u_,i_,j_,k_,n_,sign_] := (-u[i,j+2,k,n]+4*u[i,j+1,k,n]-3*u[i,j,k,n])/ (2*hy) /; sign==1 :[font = input; preserveAspect] DOneY[u_,i_,j_,k_,n_,sign_] := (u[i,j-2,k,n]-4*u[i,j-1,k,n]+3*u[i,j,k,n])/ (2*hy) /; sign==-1 :[font = input; preserveAspect; startGroup] Simplify[ DOneY[u,0,0,0,-1] //. {taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}] :[font = output; output; inactive; preserveAspect; endGroup] DuDy[hx/2, hy/2, hz/2] ;[o] hx hy hz DuDy[--, --, --] 2 2 2 :[font = input; preserveAspect; startGroup] Simplify[ DOneY[u,0,0,0,+1] //. {taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}] :[font = output; output; inactive; preserveAspect; endGroup; endGroup] DuDy[hx/2, hy/2, hz/2] ;[o] hx hy hz DuDy[--, --, --] 2 2 2 :[font = subsection; inactive; preserveAspect; startGroup] definitions for Do One-sided Derivative in Z direction. if sign is positive, it means extend the stencil in the positivie z direction. if negative, extend in other direction :[font = input; preserveAspect; startGroup] DOneZ[u_,i_,j_,k_,sign_] := (-u[i,j,k+2]+4*u[i,j,k+1]-3*u[i,j,k])/ (2*hz) /; sign==1 :[font = message; inactive; preserveAspect; endGroup] General::spell: Possible spelling error: new symbol name "DOneZ" is similar to existing symbols {DOneX, DOneY}. :[font = input; preserveAspect] DOneZ[u_,i_,j_,k_,sign_] := (u[i,j,k-2]-4*u[i,j,k-1]+3*u[i,j,k])/ (2*hz) /; sign==-1 :[font = input; preserveAspect] DOneZ[u_,i_,j_,k_,n_,sign_] := (-u[i,j,k+2,n]+4*u[i,j,k+1,n]-3*u[i,j,k,n])/ (2*hz) /; sign==1 :[font = input; preserveAspect] DOneZ[u_,i_,j_,k_,n_,sign_] := (u[i,j,k-2,n]-4*u[i,j,k-1,n]+3*u[i,j,k,n])/ (2*hz) /; sign==-1 :[font = input; preserveAspect; startGroup] Simplify[ DOneZ[u,0,0,0,-1] //. {taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}] :[font = output; output; inactive; preserveAspect; endGroup] DuDz[hx/2, hy/2, hz/2] ;[o] hx hy hz DuDz[--, --, --] 2 2 2 :[font = input; preserveAspect; startGroup] Simplify[ DOneZ[u,0,0,0,+1] //. {taylorudef,x0->hx/2,y0->hy/2,z0->hz/2}] :[font = output; output; inactive; preserveAspect; endGroup] DuDz[hx/2, hy/2, hz/2] ;[o] hx hy hz DuDz[--, --, --] 2 2 2 :[font = subsubsection; inactive; preserveAspect; startGroup] useful one-sided derivatives :[font = input; preserveAspect] dvdxalt[i_,j_+half,k_,sign_] := (DOneX[v,i,j ,k,sign]+ DOneX[v,i,j+1,k,sign])/2 :[font = input; preserveAspect] dudyalt[i_+half,j_,k_,sign_] := (DOneY[u,i ,j,k,sign]+ DOneY[u,i+1,j,k,sign])/2 :[font = input; preserveAspect; startGroup] dvdzalt[i_,j_+half,k_,sign_] := (DOneZ[v,i,j ,k,sign]+ DOneZ[v,i,j+1,k,sign])/2 :[font = message; inactive; preserveAspect; endGroup] General::spell1: Possible spelling error: new symbol name "dvdzalt" is similar to existing symbol "dvdxalt". :[font = input; preserveAspect; startGroup] dwdyalt[i_,j_,k_+half,sign_] := (DOneY[w,i,j,k ,sign]+ DOneY[w,i,j,k+1,sign])/2 :[font = message; inactive; preserveAspect; endGroup] General::spell1: Possible spelling error: new symbol name "dwdyalt" is similar to existing symbol "dudyalt". :[font = input; preserveAspect; startGroup] dudzalt[i_+half,j_,k_,sign_] := (DOneZ[u,i ,j,k,sign]+ DOneZ[u,i+1,j,k,sign])/2 :[font = message; inactive; preserveAspect; endGroup] General::spell: Possible spelling error: new symbol name "dudzalt" is similar to existing symbols {dudyalt, dvdzalt}. :[font = input; preserveAspect; startGroup] dwdxalt[i_,j_,k_+half,sign_] := (DOneX[w,i,j,k ,sign]+ DOneX[w,i,j,k+1,sign])/2 :[font = message; inactive; preserveAspect; endGroup; endGroup; endGroup] General::spell: Possible spelling error: new symbol name "dwdxalt" is similar to existing symbols {dvdxalt, dwdyalt}. :[font = subsection; inactive; preserveAspect; startGroup] setup to use the Format.m package :[font = input; preserveAspect] Off[General::spell,General::spell1]; :[font = input; preserveAspect] SetOptions[$Output,PageWidth->73]; :[font = input; preserveAspect; startGroup] <{U} ], tmpcond =!= False && sign != 0, (* exp extends outside, output conditional mask *) tmp = FortranAssign[ tmpcond, AssignToArray->{mask}, AssignIndent->"" ]; tmpalt =dependentCellsNotCovered[ expalt[indx,indx,indz,sign]//.allDerivAllUV, indexcond,mask]; line1 = StringForm[" if(``) then ", tmp]; line2 = FortranAssign[ lhs, expalt[indx,indy,indz,sign]//.allDerivAllUV, AssignToArray->{U} ]; line3 = StringForm[" else"]; line4 = FortranAssign[ lhs, exp[indx,indy,indz] //.allDerivAllUV, AssignToArray->{U} ]; If[tmpalt =!= False , (* this is an error, the alternate form should be specified to be inside safe region *) line5 = StringForm[" error in tandergen"] , line5 = StringForm[" endif"] ]; ColumnForm[{line1,line2,line3,line4,line5}], True, (* cannot use exp or expalt, must be externally supplied derivative *) (* need to figure out where to evaluate the transverse derivative *) icase = Which[ indx === i-1+half, -1, indx === i , 0, indx === i +half, +1, _, Print["error in icase"]]; jcase = Which[ indy === j-1+half, -1, indy === j , 0, indy === j +half, +1, _, Print["error in jcase"]]; kcase = Which[ indz === k-1+half, -1, indz === k , 0, indz === k +half, +1, _, Print["error in kcase"]]; FortranAssign[ lhs, expext[i+icase, j+jcase, k+kcase, varindx,derivindx], AssignToArray->{trandere,tranderw, trandern,tranders, trandert,tranderb}] ] ] :[font = input; preserveAspect; startGroup] altgen[ dwdxt, i,j,k+half, dwdx,dwdxalt, trandern,3,1,Function[{i,j,k},(k>0)], maskn ] :[font = output; output; inactive; preserveAspect; fontLeading = 0; endGroup] dwdxt=trandern(i,j,1+k,3,1) ;[o] dwdxt=trandern(i,j,1+k,3,1) :[font = input; preserveAspect; startGroup] altgen[ dudye, i+half,j,k, dudy, dudyalt, tduext, 1,2, Function[{i,j,k},(i<0)], maskn ] :[font = output; output; inactive; preserveAspect; fontLeading = 0; endGroup] dudye=2.5d-1*(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1 & +j,k,1)+U(1+i,1+j,k,1))/hy ;[o] dudye=2.5d-1*(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1 & +j,k,1)+U(1+i,1+j,k,1))/hy :[font = input; preserveAspect; startGroup] altgen[ dudye, i+half,j,k, dudy, dudyalt, trandere, 1,2, Function[{i,j,k},(i>0)], maskn ] :[font = output; output; inactive; preserveAspect; endGroup] dudye=trandere(1+i,j,k,1,2) ;[o] dudye=trandere(1+i,j,k,1,2) :[font = input; preserveAspect; startGroup] altgen[ dudye, i+half,j,k, dudy, dudyalt, tranderns, 1,2, Function[{i,j,k},(j<0)], maskn ] :[font = output; output; inactive; preserveAspect; fontLeading = 0; endGroup] StringForm[" if(``) then ", (maskn(i,-1+j,k).gt.0).or.(maskn(1+i,-1+j,k).gt.0)] dudye=5.d-1*(5.d-1*(-3.d0*U(i,j,k,1)+4.d0*U(i,1+j, & k,1)-U(i,2+j,k,1))/hy+5.d-1*(-3.d0*U(1+i,j,k,1)+4. & d0*U(1+i,1+j,k,1)-U(1+i,2+j,k,1))/hy) StringForm[" else"] dudye=2.5d-1*(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1 & +j,k,1)+U(1+i,1+j,k,1))/hy StringForm[" endif"] ;[o] if((maskn(i,-1+j,k).gt.0).or.(maskn(1+i,-1+j,k).gt.0) ) then dudye=5.d-1*(5.d-1*(-3.d0*U(i,j,k,1)+4.d0*U(i,1+j, & k,1)-U(i,2+j,k,1))/hy+5.d-1*(-3.d0*U(1+i,j,k,1)+4. & d0*U(1+i,1+j,k,1)-U(1+i,2+j,k,1))/hy) else dudye=2.5d-1*(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1 & +j,k,1)+U(1+i,1+j,k,1))/hy endif :[font = input; preserveAspect; startGroup] altgen[ dudye, i+half,j,k, dudy, dudyalt, trandere, 1,2, Function[{i,j,k},(j>0)], maskn ] :[font = output; output; inactive; preserveAspect; fontLeading = 0; endGroup] StringForm[" if(``) then ", (maskn(i,1+j,k).gt.0).or.(maskn(1+i,1+j,k).gt.0)] dudye=5.d-1*(5.d-1*(U(i,-2+j,k,1)-4.d0*U(i,-1+j,k, & 1)+3.d0*U(i,j,k,1))/hy+5.d-1*(U(1+i,-2+j,k,1)-4.d0 & *U(1+i,-1+j,k,1)+3.d0*U(1+i,j,k,1))/hy) StringForm[" else"] dudye=2.5d-1*(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1 & +j,k,1)+U(1+i,1+j,k,1))/hy StringForm[" endif"] ;[o] if((maskn(i,1+j,k).gt.0).or.(maskn(1+i,1+j,k).gt.0) ) then dudye=5.d-1*(5.d-1*(U(i,-2+j,k,1)-4.d0*U(i,-1+j,k, & 1)+3.d0*U(i,j,k,1))/hy+5.d-1*(U(1+i,-2+j,k,1)-4.d0 & *U(1+i,-1+j,k,1)+3.d0*U(1+i,j,k,1))/hy) else dudye=2.5d-1*(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1 & +j,k,1)+U(1+i,1+j,k,1))/hy endif :[font = input; preserveAspect; startGroup] altgen[ dudye, i+half,j,k, dudy, dudyalt, tranderb, 1,2, Function[{i,j,k},(k<0)], maskn ] :[font = output; output; inactive; preserveAspect; fontLeading = 0; endGroup] dudye=2.5d-1*(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1 & +j,k,1)+U(1+i,1+j,k,1))/hy ;[o] dudye=2.5d-1*(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1 & +j,k,1)+U(1+i,1+j,k,1))/hy :[font = input; preserveAspect; startGroup] altgen[ dudye, i+half,j,k, dudy, dudyalt, trandert, 1,2, Function[{i,j,k},(k>0)], maskn ] :[font = output; output; inactive; preserveAspect; fontLeading = 0; endGroup] dudye=2.5d-1*(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1 & +j,k,1)+U(1+i,1+j,k,1))/hy ;[o] dudye=2.5d-1*(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1 & +j,k,1)+U(1+i,1+j,k,1))/hy :[font = subsubsection; inactive; preserveAspect; startGroup] a short-hand function :[font = input; preserveAspect] FA[x_] := FortranAssign[x, AssignToArray->{U,muX,muY,muZ,a,u, maskn,maske,maskw, masks,maskt,maskb}, AssignIndent->"" ]; :[font = input; preserveAspect] DeleteFile[ "dog.mf"]; CopyFile[ "DV_3D1.mF" , "dog.mf"]; Splice["dog.mf",FormatType->OutputForm]; DeleteFile[ "DV_3D1.F"]; CopyFile[ "dog.f", "DV_3D1.F" ]; <<"!touch DV_3D1.F" :[font = input; preserveAspect] DeleteFile[ "dog.mf"]; CopyFile[ "DV_3D2.mF" , "dog.mf"]; Splice["dog.mf",FormatType->OutputForm]; DeleteFile[ "DV_3D2.F"]; CopyFile[ "dog.f", "DV_3D2.F" ]; <<"!touch DV_3D2.F" :[font = input; preserveAspect] DeleteFile[ "dog.mf"]; CopyFile[ "DV_3D3.mF" , "dog.mf"]; Splice["dog.mf",FormatType->OutputForm]; DeleteFile[ "DV_3D3.F"]; CopyFile[ "dog.f", "DV_3D3.F" ]; <<"!touch DV_3D3.F" :[font = input; preserveAspect] DeleteFile[ "dog.mf"]; CopyFile[ "DV_3D4.mF" , "dog.mf"]; Splice["dog.mf",FormatType->OutputForm]; DeleteFile[ "DV_3D4.F"]; CopyFile[ "dog.f", "DV_3D4.F" ]; <<"!touch DV_3D4.F" :[font = input; preserveAspect; startGroup] FA[ Coefficient[Expand[ alpha*a[i,j,k]*u[i,j,k]-beta*( hy*hz*(tauxx[i+half ,j , k]- tauxx[i-1+half,j , k])+ hx*hz*(tauxy[i ,j+half ,k]- tauxy[i ,j-1+half,k])+ hx*hy*(tauxz[i ,j ,k+half]- tauxz[i ,j ,k-1+half]))/vol //. {murepl1,murepl2,murepl3, tauxxdef,tauyydef,tauxydef,tauxzdef,tauyzdef, tauzzdef, vol->hx*hy*hz, dudxdef,dvdydef,dwdzdef, dudydef1,dudydef2, dudzdef1,dudzdef2, dwdxdef1,dwdxdef2, dvdxdef1,dvdxdef2 } ],u[i,j+1,k]]] :[font = output; output; inactive; preserveAspect; endGroup] -(beta*muY(i,1+j,k)/hy**2) ;[o] -(beta*muY(i,1+j,k)/hy**2) :[font = input; preserveAspect; startGroup] FA[Coefficient[ Expand[ alpha*a[i,j,k]*v[i,j,k]-beta*( hy*hz*(tauxy[i+half ,j , k]- tauxy[i-1+half,j , k])+ hx*hz*(tauyy[i ,j+half ,k]- tauyy[i ,j-1+half,k])+ hx*hy*(tauyz[i ,j ,k+half]- tauyz[i ,j ,k-1+half]))/vol //. {murepl1,murepl2,murepl3, tauxxdef,tauyydef,tauxydef,tauxzdef,tauyzdef, tauzzdef, vol->hx*hy*hz, dudxdef,dvdydef,dwdzdef, dudydef1,dudydef2, dudzdef1,dudzdef2, dwdxdef1,dwdxdef2, dvdxdef1,dvdxdef2, dvdzdef1,dvdzdef2, dwdydef1,dwdydef2 } ] , v[i,j+1,k] ] ] :[font = output; output; inactive; preserveAspect; endGroup] -2.d0*beta*muY(i,1+j,k)/hy**2 ;[o] -2.d0*beta*muY(i,1+j,k)/hy**2 :[font = input; preserveAspect; startGroup] FA[ Coefficient[ Expand[ alpha*a[i,j,k]*w[i,j,k]-beta*( hy*hz*(tauxz[i+half ,j , k]- tauxz[i-1+half,j , k])+ hx*hz*(tauyz[i ,j+half ,k]- tauyz[i ,j-1+half,k])+ hx*hy*(tauzz[i ,j ,k+half]- tauzz[i ,j ,k-1+half]))/vol //. {murepl1,murepl2,murepl3, tauxxdef,tauyydef,tauxydef,tauxzdef,tauyzdef, tauzzdef, vol->hx*hy*hz, dudxdef,dvdydef,dwdzdef, dudydef1,dudydef2, dudzdef1,dudzdef2, dwdxdef1,dwdxdef2, dvdxdef1,dvdxdef2, dvdzdef1,dvdzdef2, dwdydef1,dwdydef2 } ] , w[i,j+1,k] ] ] :[font = output; output; inactive; preserveAspect; endGroup] -(beta*muY(i,1+j,k)/hy**2) ;[o] -(beta*muY(i,1+j,k)/hy**2) :[font = input; preserveAspect; startGroup] DTwoY[u,i,j,k] //. allDerivAllUV :[font = output; output; inactive; preserveAspect; endGroup] (-U[i, -1 + j, k, 1] + U[i, 1 + j, k, 1])/(2*hy) ;[o] -U[i, -1 + j, k, 1] + U[i, 1 + j, k, 1] --------------------------------------- 2 hy :[font = input; preserveAspect; startGroup] FA[ dependentCellsNotCovered[ DTwoY[u,i,j,k] //. allDerivAllUV, Function[{i,j,k},(j<0)],masks] ] :[font = output; output; inactive; preserveAspect; endGroup] masks(i,-1+j,k).gt.0 ;[o] masks(i,-1+j,k).gt.0 :[font = input; preserveAspect; startGroup] FA[ DTwoY[U,i,j,k,n] ] :[font = output; output; inactive; preserveAspect; endGroup; endGroup; endGroup; endGroup; endGroup] 5.d-1*(-U(i,-1+j,k,n)+U(i,1+j,k,n))/hy ;[o] 5.d-1*(-U(i,-1+j,k,n)+U(i,1+j,k,n))/hy ^*)ccseapps-2.5/CCSEApps/tensorMG/visc2d.nb0000644000175000017500000014624011634153073021137 0ustar amckinstryamckinstry(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 40789, 1347]*) (*NotebookOutlinePosition[ 41639, 1377]*) (* CellTagsIndexPosition[ 41595, 1373]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell[TextData["definition of tau"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(tauxxdef = tauxx[i_ + half, j_] \[Rule] 2\ mu[i + half, j]\ dudx[i + half, j]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(tauxx[half + i_, j_] \[Rule] 2\ dudx[half + i, j]\ mu[half + i, j]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(tauyydef = tauyy[i_, j_ + half] \[Rule] 2\ mu[i, j + half]\ dvdy[i, j + half]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(tauyy[i_, half + j_] \[Rule] 2\ dvdy[i, half + j]\ mu[i, half + j]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(tauxydef = tauxy[i_, j_] \[Rule] mu[i, j]\ \((dudy[i, j] + dvdx[i, j])\)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(tauxydef\)\" is similar \ to existing symbols \!\({tauxxdef, tauyydef}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(tauxy\)\" is similar to \ existing symbols \!\({tauxx, tauyy}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dudy\)\" is similar to \ existing symbols \!\({dudx, dvdy}\)."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell\"\) will be suppressed during \ this calculation."\)], "Message"], Cell[BoxData[ \(tauxy[i_, j_] \[Rule] \((dudy[i, j] + dvdx[i, j])\)\ mu[i, j]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["definitions of derivatives"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dudydef1 = dudy[i_, j_ + half] \[Rule] \(u[i, j + 1] - u[i, j]\)\/hy\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(dudy[i_, half + j_] \[Rule] \(\(-u[i, j]\) + u[i, 1 + j]\)\/hy\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dvdxdef1 = dvdx[i_ + half, j_] \[Rule] \(v[i + 1, j] - v[i, j]\)\/hx\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(dvdx[half + i_, j_] \[Rule] \(\(-v[i, j]\) + v[1 + i, j]\)\/hx\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dudydef2 = dudy[i_ + half, j_] \[Rule] \(u[i, j + 1] - u[i, j - 1] + u[i + 1, j + 1] - u[i + 1, j - 1]\)\/\(4 \ hy\)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(dudy[half + i_, j_] \[Rule] \(\(-u[i, \(-1\) + j]\) + u[i, 1 + j] - u[1 + i, \(-1\) + j] + u[1 + i, 1 + j]\)\/\(4\ hy\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dvdxdef2 = dvdx[i_, j_ + half] \[Rule] \(v[i + 1, j + 1] - v[i - 1, j + 1] + v[i + 1, j] - v[i - 1, j]\)\/\(4 \ hx\)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(dvdx[i_, half + j_] \[Rule] \(\(-v[\(-1\) + i, j]\) - v[\(-1\) + i, 1 + j] + v[1 + i, j] + v[1 + i, 1 + j]\)\/\(4\ hx\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dudxdef = dudx[i_ + half, j_] \[Rule] \(u[i + 1, j] - u[i, j]\)\/hx\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(dudx[half + i_, j_] \[Rule] \(\(-u[i, j]\) + u[1 + i, j]\)\/hx\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dvdydef = dvdy[i_, j_ + half] \[Rule] \(v[i, j + 1] - v[i, j]\)\/hy\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(dvdy[i_, half + j_] \[Rule] \(\(-v[i, j]\) + v[i, 1 + j]\)\/hy\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["definitions used to test taylor expansions"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(taylorudef = u[i_, j_] \[Rule] U[x0, y0] + DuDx[x0, y0]\ \((\((i + 1\/2)\)\ hx - x0)\) + DuDy[x0, y0]\ \((\((j + 1\/2)\)\ hy - y0)\) + 1\/2\ D2uDy2[x0, y0]\ \((\((i + 1\/2)\)\ hx - x0)\)\^2 + 1\/2\ D2uDx2[x0, y0]\ \((\((j + 1\/2)\)\ hy - y0)\)\^2 + D2uDxDy[x0, y0]\ \((\((i + 1\/2)\)\ hx - x0)\)\ \((\((j + 1\/2)\)\ hy - y0)\)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(DuDy\)\" is similar to \ existing symbol \"\!\(DuDx\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(D2uDx2\)\" is similar \ to existing symbol \"\!\(D2uDy2\)\"."\)], "Message"], Cell[BoxData[ \(u[i_, j_] \[Rule] 1\/2\ \((hy\ \((1\/2 + j)\) - y0)\)\^2\ D2uDx2[x0, y0] + \((hx\ \((1\/2 + i)\) - x0)\)\ \((hy\ \((1\/2 + j)\) - y0)\)\ D2uDxDy[x0, y0] + 1\/2\ \((hx\ \((1\/2 + i)\) - x0)\)\^2\ D2uDy2[x0, y0] + \((hx\ \((1\/2 + i)\) - x0)\)\ DuDx[x0, y0] + \((hy\ \((1\/2 + j)\) - y0)\)\ DuDy[x0, y0] + U[x0, y0]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(dog = dudy[i + half, j] //. {dudydef1, dudydef2, taylorudef}; \)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog /. {i \[Rule] 0, j \[Rule] 0, x0 \[Rule] hx, y0 \[Rule] hy\/2}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDy[hx, hy\/2]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(dog = dudy[i, j + half] //. {dudydef1, dudydef2, taylorudef}; \)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog /. {i \[Rule] 0, j \[Rule] 0, x0 \[Rule] hx\/2, y0 \[Rule] hy}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDy[hx\/2, hy]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(dog = dudx[i + half, j] //. {dudxdef, taylorudef}; \)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog /. {i \[Rule] 0, j \[Rule] 0, x0 \[Rule] hx, y0 \[Rule] hy\/2}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDx[hx, hy\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(taylorvdef = v[i_, j_] \[Rule] V[x0, y0] + DvDx[x0, y0]\ \((\((i + 1\/2)\)\ hx - x0)\) + DvDy[x0, y0]\ \((\((j + 1\/2)\)\ hy - y0)\) + 1\/2\ D2vDy2[x0, y0]\ \((\((i + 1\/2)\)\ hx - x0)\)\^2 + 1\/2\ D2vDx2[x0, y0]\ \((\((j + 1\/2)\)\ hy - y0)\)\^2 + D2vDxDy[x0, y0]\ \((\((i + 1\/2)\)\ hx - x0)\)\ \((\((j + 1\/2)\)\ hy - y0)\)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(taylorvdef\)\" is \ similar to existing symbol \"\!\(taylorudef\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(DvDx\)\" is similar to \ existing symbol \"\!\(DuDx\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DvDy\)\" is similar to \ existing symbols \!\({DuDy, DvDx}\)."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(D2vDy2\)\" is similar \ to existing symbol \"\!\(D2uDy2\)\"."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell1\"\) will be suppressed \ during this calculation."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(D2vDx2\)\" is similar \ to existing symbols \!\({D2uDx2, D2vDy2}\)."\)], "Message"], Cell[BoxData[ \(v[i_, j_] \[Rule] 1\/2\ \((hy\ \((1\/2 + j)\) - y0)\)\^2\ D2vDx2[x0, y0] + \((hx\ \((1\/2 + i)\) - x0)\)\ \((hy\ \((1\/2 + j)\) - y0)\)\ D2vDxDy[x0, y0] + 1\/2\ \((hx\ \((1\/2 + i)\) - x0)\)\^2\ D2vDy2[x0, y0] + \((hx\ \((1\/2 + i)\) - x0)\)\ DvDx[x0, y0] + \((hy\ \((1\/2 + j)\) - y0)\)\ DvDy[x0, y0] + V[x0, y0]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(dog = dvdy[i, j + half] //. {dvdydef, taylorvdef}; \)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog /. {i \[Rule] 0, j \[Rule] 0, x0 \[Rule] hx\/2, y0 \[Rule] hy}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DvDy[hx\/2, hy]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(dog = dvdx[i, j + half] //. {dvdxdef1, dvdxdef2, taylorvdef}; \)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog /. {i \[Rule] 0, j \[Rule] 0, x0 \[Rule] hx\/2, y0 \[Rule] hy}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DvDx[hx\/2, hy]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(dog = dvdx[i + half, j] //. {dvdxdef1, dvdxdef2, taylorvdef}; \)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog /. {i \[Rule] 0, j \[Rule] 0, x0 \[Rule] hx, y0 \[Rule] hy\/2}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DvDx[hx, hy\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(taylormudef = mu[i_, j_] \[Rule] MU[x0, y0] + DmuDx[x0, y0]\ \((\((i + 1\/2)\)\ hx - x0)\) + DmuDy[x0, y0]\ \((\((j + 1\/2)\)\ hy - y0)\)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(taylormudef\)\" is \ similar to existing symbol \"\!\(taylorudef\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(DmuDx\)\" is similar to \ existing symbol \"\!\(DuDx\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(DmuDy\)\" is similar to \ existing symbols \!\({DmuDx, DuDy}\)."\)], "Message"], Cell[BoxData[ \(mu[i_, j_] \[Rule] \((hx\ \((1\/2 + i)\) - x0)\)\ DmuDx[x0, y0] + \((hy\ \((1\/2 + j)\) - y0)\)\ DmuDy[x0, y0] + MU[x0, y0]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["tests"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(dog = tauxx[i + half, j] //. {tauxxdef, dudxdef, taylormudef, taylorudef}; \)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog //. {half \[Rule] 1\/2, i \[Rule] 0, j \[Rule] 0, x0 \[Rule] hx, y0 \[Rule] hy\/2}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(2\ DuDx[hx, hy\/2]\ MU[hx, hy\/2]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(dog = tauyy[i, j + half] //. {tauyydef, dvdydef, taylormudef, taylorvdef}; \)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog //. {half \[Rule] 1\/2, i \[Rule] 0, j \[Rule] 0, x0 \[Rule] hx\/2, y0 \[Rule] hy}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(2\ DvDy[hx\/2, hy]\ MU[hx\/2, hy]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(dog = tauxy[i, j + half] //. {tauxydef, dudydef1, dudydef2, dvdxdef1, dvdxdef2, taylormudef, taylorudef, taylorvdef}; \)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog //. {half \[Rule] 1\/2, i \[Rule] 0, j \[Rule] 0, x0 \[Rule] hx\/2, y0 \[Rule] hy}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\((DuDy[hx\/2, hy] + DvDx[hx\/2, hy])\)\ MU[hx\/2, hy]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(dog = tauxy[i + half, j] //. {tauxydef, dudydef1, dudydef2, dvdxdef1, dvdxdef2, taylormudef, taylorudef, taylorvdef}; \)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog //. {half \[Rule] 1\/2, i \[Rule] 0, j \[Rule] 0, x0 \[Rule] hx, y0 \[Rule] hy\/2}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\((DuDy[hx, hy\/2] + DvDx[hx, hy\/2])\)\ MU[hx, hy\/2]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["definitions used for fortran output"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(murepl1 = mu[i_, j_ + half] \[Rule] muY[i, j + 1]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(mu[i_, half + j_] \[Rule] muY[i, 1 + j]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(murepl2 = mu[i_ + half, j_] \[Rule] muX[i + 1, j]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(mu[half + i_, j_] \[Rule] muX[1 + i, j]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(urepl = u[i_, j_] \[Rule] U[i, j, 1]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(u[i_, j_] \[Rule] U[i, j, 1]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(vrepl = v[i_, j_] \[Rule] U[i, j, 2]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(vrepl\)\" is similar to \ existing symbol \"\!\(urepl\)\"."\)], "Message"], Cell[BoxData[ \(v[i_, j_] \[Rule] U[i, j, 2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(tauxy[i, j + half] //. {tauxydef, dudydef1, dudydef2, dvdxdef1, dvdxdef2, murepl1, murepl2, urepl, vrepl}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(muY[i, 1 + j]\ \((\(\(-U[i, j, 1]\) + U[i, 1 + j, 1]\)\/hy + \(1\/\(4\ hx\)\(( \(-U[\(-1\) + i, j, 2]\) - U[\(-1\) + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2])\)\))\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(tauxy[i, j + half] - tauxy[i, j - 1 + half] + tauxx[i + half, j] - tauxx[i - 1 + half, j] //. {tauxxdef, tauxydef, dudydef1, dudydef2, dvdxdef1, dvdxdef2, dudxdef, dvdydef, murepl1, murepl2, urepl, vrepl} \)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(-\(\(2\ muX[i, j]\ \((\(-U[\(-1\) + i, j, 1]\) + U[i, j, 1])\)\)\/hx \)\) + \(2\ muX[1 + i, j]\ \((\(-U[i, j, 1]\) + U[1 + i, j, 1])\)\)\/hx - muY[i, j]\ \((\(\(-U[i, \(-1\) + j, 1]\) + U[i, j, 1]\)\/hy + \(1\/\(4\ hx\)\(( \(-U[\(-1\) + i, \(-1\) + j, 2]\) - U[\(-1\) + i, j, 2] + U[1 + i, \(-1\) + j, 2] + U[1 + i, j, 2])\)\))\) + muY[i, 1 + j]\ \((\(\(-U[i, j, 1]\) + U[i, 1 + j, 1]\)\/hy + \(1\/\(4\ hx\)\(( \(-U[\(-1\) + i, j, 2]\) - U[\(-1\) + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2])\)\))\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Extract stencil information from operator"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog = alpha\ a[i, j]\ U[i, j, 1] - \(1\/vol\) \((beta\ \(( hy\ \((tauxx[i + half, j] - tauxx[i - 1 + half, j])\) + hx\ \((tauxy[i, j + half] - tauxy[i, j - 1 + half])\))\)) \) //. {tauxxdef, tauxydef, dudydef1, dudydef2, dvdxdef1, dvdxdef2, dudxdef, dvdydef, murepl1, murepl2, urepl, vrepl, vol \[Rule] hx\ hy}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(beta\)\" is similar to \ existing symbol \"\!\(Beta\)\"."\)], "Message"], Cell[BoxData[ \(alpha\ a[i, j]\ U[i, j, 1] - \(1\/\(hx\ hy\)\(( beta\ \(( hy\ \((\(-\(\(2\ muX[i, j]\ \((\(-U[\(-1\) + i, j, 1]\) + U[i, j, 1])\)\)\/hx \)\) + \(2\ muX[1 + i, j]\ \((\(-U[i, j, 1]\) + U[1 + i, j, 1])\)\)\/hx)\) + hx\ \((\(-muY[i, j]\)\ \((\(\(-U[i, \(-1\) + j, 1]\) + U[i, j, 1]\)\/hy + \(1\/\(4\ hx\)\(( \(-U[\(-1\) + i, \(-1\) + j, 2]\) - U[\(-1\) + i, j, 2] + U[1 + i, \(-1\) + j, 2] + U[1 + i, j, 2])\)\))\) + muY[i, 1 + j]\ \((\(\(-U[i, j, 1]\) + U[i, 1 + j, 1]\)\/hy + \(1\/\(4\ hx\)\(( \(-U[\(-1\) + i, j, 2]\) - U[\(-1\) + i, 1 + j, 2] + U[1 + i, j, 2] + U[1 + i, 1 + j, 2])\)\))\))\))\))\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Coefficient[Expand[dog], U[i, j, 1]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(alpha\ a[i, j] + \(2\ beta\ muX[i, j]\)\/hx\^2 + \(2\ beta\ muX[1 + i, j]\)\/hx\^2 + \(beta\ muY[i, j]\)\/hy\^2 + \(beta\ muY[i, 1 + j]\)\/hy\^2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Coefficient[Expand[dog], U[i + 1, j, 1]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(-\(\(2\ beta\ muX[1 + i, j]\)\/hx\^2\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Coefficient[Expand[dog], U[i - 1, j, 1]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(-\(\(2\ beta\ muX[i, j]\)\/hx\^2\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Coefficient[Expand[dog], U[i, j + 1, 1]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(-\(\(beta\ muY[i, 1 + j]\)\/hy\^2\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Coefficient[Expand[dog], U[i, j - 1, 1]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(-\(\(beta\ muY[i, j]\)\/hy\^2\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dog = alpha\ a[i, j]\ U[i, j, 2] - \(1\/vol\) \((beta\ \(( hy\ \((tauxy[i + half, j] - tauxy[i - 1 + half, j])\) + hx\ \((tauyy[i, j + half] - tauyy[i, j - 1 + half])\))\)) \) //. {tauyydef, tauxydef, dudydef1, dudydef2, dvdxdef1, dvdxdef2, dudxdef, dvdydef, murepl1, murepl2, urepl, vrepl, vol \[Rule] hx\ hy}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(alpha\ a[i, j]\ U[i, j, 2] - \(1\/\(hx\ hy\)\(( beta\ \(( hx\ \((\(-\(\(2\ muY[i, j]\ \((\(-U[i, \(-1\) + j, 2]\) + U[i, j, 2])\)\)\/hy \)\) + \(2\ muY[i, 1 + j]\ \((\(-U[i, j, 2]\) + U[i, 1 + j, 2])\)\)\/hy)\) + hy\ \((\(-muX[i, j]\)\ \((\(\(-U[\(-1\) + i, j, 2]\) + U[i, j, 2]\)\/hx + \(1\/\(4\ hy\)\(( \(-U[\(-1\) + i, \(-1\) + j, 1]\) + U[\(-1\) + i, 1 + j, 1] - U[i, \(-1\) + j, 1] + U[i, 1 + j, 1])\)\))\) + muX[1 + i, j]\ \((\(\(-U[i, j, 2]\) + U[1 + i, j, 2]\)\/hx + \(1\/\(4\ hy\)\(( \(-U[i, \(-1\) + j, 1]\) + U[i, 1 + j, 1] - U[1 + i, \(-1\) + j, 1] + U[1 + i, 1 + j, 1]) \)\))\))\))\))\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Coefficient[Expand[dog], U[i, j, 2]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(alpha\ a[i, j] + \(beta\ muX[i, j]\)\/hx\^2 + \(beta\ muX[1 + i, j]\)\/hx\^2 + \(2\ beta\ muY[i, j]\)\/hy\^2 + \(2\ beta\ muY[i, 1 + j]\)\/hy\^2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Coefficient[Expand[dog], U[i + 1, j, 2]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(-\(\(beta\ muX[1 + i, j]\)\/hx\^2\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Coefficient[Expand[dog], U[i - 1, j, 2]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(-\(\(beta\ muX[i, j]\)\/hx\^2\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Coefficient[Expand[dog], U[i, j + 1, 2]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(-\(\(2\ beta\ muY[i, 1 + j]\)\/hy\^2\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Coefficient[Expand[dog], U[i, j - 1, 2]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(-\(\(2\ beta\ muY[i, j]\)\/hy\^2\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "dependentCellsNotCovered is a function which returns a logical expression \ suitable for\ninclusion in fortran. Give an expression, exp, we wish to \ determine which mesh locations are accessed by the expression. However, we \ do not wish to examine\nall possible locations, only those outside the grid \ patch region. So we provide\na second argument, which is a boolean function \ taking two arguments. The combination will give logical expressions testing \ the mask for cells utilized by the\nexpression and for which the boolean \ function, logfunc[il,jl], evaluates as true. The\nthird argument is the name \ of the mask array"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Clear[dependentCellsNotCovered]\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dependentCellsNotCovered[exp_, logfunc_, maskfun_] := Module[{cond, lexp}, cond = False; lexp = exp; For[il = \(-2\), il \[LessEqual] \(+2\), \(il++\), For[jl = \(-2\), jl \[LessEqual] \(+2\), \(jl++\), For[kl = 1, kl \[LessEqual] 2, \(kl++\), If[logfunc[il, jl] && Coefficient[Expand[exp], U[i + il, j + jl, kl]] =!= 0, cond = cond || maskfun[i + il, j + jl] > 0]]]]; cond]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(exp\)\" is similar to \ existing symbol \"\!\(Exp\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(lexp\)\" is similar to \ existing symbol \"\!\(exp\)\"."\)], "Message"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "dependentCellsCovered is more or less the converse of \ dependentCellsNotCovered.\ndependentCellsCovered will return true if all the \ cells in the expression (properly\nrestricted by the mask function) ARE \ covered. dependentCellsNotCovered returned\ntrue if one or more of the cells \ were not covered."], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Clear[dependentCellsCovered]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(dependentCellsCovered[exp_, logfunc_, maskfun_] := Module[{cond, lexp}, cond = True; lexp = exp; For[il = \(-2\), il \[LessEqual] \(+2\), \(il++\), For[jl = \(-2\), jl \[LessEqual] \(+2\), \(jl++\), For[kl = 1, kl \[LessEqual] 2, \(kl++\), If[logfunc[il, jl] && Coefficient[Expand[exp], U[i + il, j + jl, kl]] =!= 0, cond = cond && maskfun[i + il, j + jl] == 0]]]]; cond]\)], "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "this is an alternate definition which treats cells with mask .eq. 1 as \ untrusted,\nrather than mask .gt. 0"], "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(dependentCellsNotCoveredalt[exp_, logfunc_, maskfun_] := Module[{cond, lexp}, cond = False; lexp = exp; For[il = \(-2\), il \[LessEqual] \(+2\), \(il++\), For[jl = \(-2\), jl \[LessEqual] \(+2\), \(jl++\), For[kl = 1, kl \[LessEqual] 2, \(kl++\), If[logfunc[il, jl] && Coefficient[Expand[exp], U[i + il, j + jl, kl]] =!= 0, cond = cond || maskfun[i + il, j + jl] == 1]]]]; cond]\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dependentCellsNotCovered[ abba\ U[i + 1, j - 1, 1] + U[i - 1, j - 1, 2], #2 < 0&, masks]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(masks[\(-1\) + i, \(-1\) + j] > 0 || masks[1 + i, \(-1\) + j] > 0\)], "Output"] }, Open ]], Cell[BoxData[ \(f[x_] := \(f1\ \((x - x2)\)\ \((x - x3)\)\)\/\(\((x1 - x2)\)\ \((x1 - x3)\)\) + \(f2\ \((x - x1)\)\ \((x - x3)\)\)\/\(\((x2 - x1)\)\ \((x2 - x3)\)\) + \(f3\ \((x - x1)\)\ \((x - x2)\)\)\/\(\((x3 - x1)\)\ \((x3 - x2)\)\)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(dog = Simplify[\[PartialD]\_x f[x] /. {x1 \[Rule] 0, x2 \[Rule] \(-h\), x3 \[Rule] \(-2\)\ h, x \[Rule] 0}]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(3\ f1 - 4\ f2 + f3\)\/\(2\ h\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dog /. {f1 \[Rule] 0, f2 \[Rule] h\^2, f3 \[Rule] 4\ h\^2}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(0\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dog /. {f1 \[Rule] 0, f2 \[Rule] h\^3, f3 \[Rule] 8\ h\^3}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(2\ h\^2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(dog = Simplify[\[PartialD]\_\(x, x\)f[x] /. {x1 \[Rule] 0, x2 \[Rule] \(-h\), x3 \[Rule] \(-2\)\ h, x \[Rule] 0}]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(f1 - 2\ f2 + f3\)\/h\^2\)], "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "definitions for Do One-sided Derivative in X direction. if sign is \ positive, \nit means extend the stencil in the positivie x direction. if \ negative, extend\nin other direction"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(DOneX[u_, i_, j_, sign_]\ := \ \((\(-u[i + 2, j]\) + 4*u[i + 1, j] - 3*u[i, j])\)/\((2*hx)\)\ /; \ sign == 1\)], "Input"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(sign\)\" is similar to \ existing symbol \"\!\(Sign\)\"."\)], "Message"] }, Open ]], Cell[BoxData[ \(DOneX[u_, i_, j_, sign_]\ := \ \((u[i - 2, j] - 4*u[i - 1, j] + 3*u[i, j])\)/\((2*hx)\)\ /; \ sign == \(-1\)\)], "Input"], Cell[BoxData[ \(DOneX[u_, i_, j_, k_, sign_]\ := \ \((\(-u[i + 2, j, k]\) + 4*u[i + 1, j, k] - 3*u[i, j, k])\)/ \((2*hx)\)\ /; \ sign == 1\)], "Input"], Cell[BoxData[ \(DOneX[u_, i_, j_, k_, sign_]\ := \ \((u[i - 2, j, k] - 4*u[i - 1, j, k] + 3*u[i, j, k])\)/\((2*hx)\)\ /; \ sign == \(-1\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ DOneX[u, 0, 0, \(-1\)] //. {taylorudef, x0 \[Rule] hx\/2, y0 \[Rule] hy\/2}]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDx[hx\/2, hy\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ DOneX[u, 0, 0, \(+1\)] //. {taylorudef, x0 \[Rule] hx\/2, y0 \[Rule] hy\/2}]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDx[hx\/2, hy\/2]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "definitions for Do One-sided Derivative in Y direction. if sign is \ positive, \nit means extend the stencil in the positivie y direction. if \ negative, extend\nin other direction"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(DOneY[u_, i_, j_, sign_]\ := \ \((\(-u[i, j + 2]\) + 4*u[i, j + 1] - 3*u[i, j])\)/\((2*hy)\)\ /; \ sign == 1\)], "Input"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(DOneY\)\" is similar to \ existing symbol \"\!\(DOneX\)\"."\)], "Message"] }, Open ]], Cell[BoxData[ \(DOneY[u_, i_, j_, sign_]\ := \ \((u[i, j - 2] - 4*u[i, j - 1] + 3*u[i, j])\)/\((2*hy)\)\ /; \ sign == \(-1\)\)], "Input"], Cell[BoxData[ \(DOneY[u_, i_, j_, k_, sign_]\ := \ \((\(-u[i, j + 2, k]\) + 4*u[i, j + 1, k] - 3*u[i, j, k])\)/ \((2*hy)\)\ /; \ sign == 1\)], "Input"], Cell[BoxData[ \(DOneY[u_, i_, j_, k_, sign_]\ := \ \((u[i, j - 2, k] - 4*u[i, j - 1, k] + 3*u[i, j, k])\)/\((2*hy)\)\ /; \ sign == \(-1\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ DOneY[u, 0, 0, \(-1\)] //. {taylorudef, x0 \[Rule] hx\/2, y0 \[Rule] hy\/2}]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDy[hx\/2, hy\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ DOneY[u, 0, 0, \(+1\)] //. {taylorudef, x0 \[Rule] hx\/2, y0 \[Rule] hy\/2}]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDy[hx\/2, hy\/2]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["definitions for two sided deriv in x direction."], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(DTwoX[u_, i_, j_] := \(u[i + 1, j] - u[i - 1, j]\)\/\(2\ hx\)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DTwoX[u_, i_, j_, k_] := \(u[i + 1, j, k] - u[i - 1, j, k]\)\/\(2\ hx\)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ DTwoX[u, 0, 0] //. {taylorudef, x0 \[Rule] hx\/2, y0 \[Rule] hy\/2}] \)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDx[hx\/2, hy\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(DTwoY[u_, i_, j_] := \(u[i, j + 1] - u[i, j - 1]\)\/\(2\ hy\)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(DTwoY\)\" is similar to \ existing symbol \"\!\(DTwoX\)\"."\)], "Message"] }, Open ]], Cell[BoxData[ \(DTwoY[u_, i_, j_, k_] := \(u[i, j + 1, k] - u[i, j - 1, k]\)\/\(2\ hy\)\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ DTwoY[u, 0, 0] //. {taylorudef, x0 \[Rule] hx\/2, y0 \[Rule] hy\/2}] \)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(DuDy[hx\/2, hy\/2]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\(DeleteFile["\"]; \)\), \(\(CopyFile["\", "\"]; \)\), \(\(Splice["\"]; \)\), \(\(DeleteFile["\"]; \)\), \(\(CopyFile["\", "\"]; \)\), \(<< "\"\)}], "Input", AspectRatioFixed->True], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(dudxe\)\" is similar to \ existing symbol \"\!\(dudx\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dudxw\)\" is similar to \ existing symbols \!\({dudx, dudxe}\)."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(dvdyn\)\" is similar to \ existing symbol \"\!\(dvdy\)\"."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dvdys\)\" is similar to \ existing symbols \!\({dvdy, dvdyn}\)."\)], "Message"], Cell[BoxData[ \(General::"spell" \( : \ \) "Possible spelling error: new symbol name \"\!\(dudyn\)\" is similar to \ existing symbols \!\({dudy, dvdyn}\)."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell\"\) will be suppressed during \ this calculation."\)], "Message"], Cell[BoxData[ \(General::"spell1" \( : \ \) "Possible spelling error: new symbol name \"\!\(maskn\)\" is similar to \ existing symbol \"\!\(masks\)\"."\)], "Message"], Cell[BoxData[ \(General::"stop" \( : \ \) "Further output of \!\(General :: \"spell1\"\) will be suppressed \ during this calculation."\)], "Message"], Cell[BoxData[ \(DeleteFile::"nffil" \( : \ \) "File not found during \!\(DeleteFile[\"DV_2D.F\"]\)."\)], "Message"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData["Start figuring out how to write stencil"], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(out1 = alpha\ a[i, j]\ U[i, j, 1] - \(1\/vol\(( beta\ \(( hy\ \((tauxx[i + half, j] - tauxx[i - 1 + half, j])\) + hx\ \((tauxy[i, j + half] - tauxy[i, j - 1 + half])\))\)) \)\) //. {tauxxdef, tauxydef, dudydef1, dudydef2, dvdxdef1, dvdxdef2, dudxdef, dvdydef, murepl1, murepl2, urepl, vrepl, vol \[Rule] hx\ hy}\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Coefficient[Expand[out1], U[i, j, 1]]\)], "Input", AspectRatioFixed->True], Cell[CellGroupData[{ Cell[TextData["setup to use the Format.m package "], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(Off[General::"\", General::"\"]; \)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(SetOptions[$Output, PageWidth \[Rule] 73]; \)\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(<< "\"\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(stencilDef[exp_, kin_] := Block[{iind, il, jl, kl, list1, list2, indices, tmp, indtrn}, indices = {{0, 0, KO}, {\(-1\), 0, KW}, {0, \(-1\), KS}, {\(-1\), \(-1\), KSW}, {\(-1\), \(+1\), KNW}}; list1 = {}; list2 = {}; For[iind = 1, iind \[LessEqual] 5, \(iind++\), il = indices\[LeftDoubleBracket]iind, 1\[RightDoubleBracket]; jl = indices\[LeftDoubleBracket]iind, 2\[RightDoubleBracket]; indtrn = indices\[LeftDoubleBracket]iind, 3\[RightDoubleBracket]; For[kl = 1, kl \[LessEqual] 2, \(kl++\), tmp = Coefficient[Expand[exp], U[i + il, j + jl, kl]]; If[tmp =!= 0, list1 = Append[list1, coef[i, j, indtrn, kin, kl]]; list2 = Append[list2, \(+Coefficient[Expand[exp], U[i + il, j, kl]]\)]]]]; FortranAssign[Evaluate[list1], list2, AssignToArray \[Rule] {muY, muX, a, coef, polycoef}]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(stencilInc[exp_, kin_] := Block[{iind, il, jl, kl, list1, list2, indices, tmp, indtrn}, indices = {{0, 0, KO}, {\(-1\), 0, KW}, {0, \(-1\), KS}, {\(-1\), \(-1\), KSW}, {\(-1\), \(+1\), KNW}}; list1 = {}; list2 = {}; For[iind = 1, iind \[LessEqual] 5, \(iind++\), il = indices\[LeftDoubleBracket]iind, 1\[RightDoubleBracket]; jl = indices\[LeftDoubleBracket]iind, 2\[RightDoubleBracket]; indtrn = indices\[LeftDoubleBracket]iind, 3\[RightDoubleBracket]; For[kl = 1, kl \[LessEqual] 2, \(kl++\), tmp = Coefficient[Expand[exp], U[i + il, j + jl, kl]]; If[tmp =!= 0, list1 = Append[list1, coef[i, j, indtrn, kin, kl]]; list2 = Append[list2, coef[i, j, indtrn, kin, kl] + Coefficient[Expand[exp], U[i + il, j, kl]]]]]]; FortranAssign[Evaluate[list1], list2, AssignToArray \[Rule] {muY, muX, a, coef, polycoef}]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(stencilDec[exp_, kin_] := Block[{iind, il, jl, kl, list1, list2, indices, tmp, indtrn}, indices = {{0, 0, KO}, {\(-1\), 0, KW}, {0, \(-1\), KS}, {\(-1\), \(-1\), KSW}, {\(-1\), \(+1\), KNW}}; list1 = {}; list2 = {}; For[iind = 1, iind \[LessEqual] 5, \(iind++\), il = indices\[LeftDoubleBracket]iind, 1\[RightDoubleBracket]; jl = indices\[LeftDoubleBracket]iind, 2\[RightDoubleBracket]; indtrn = indices\[LeftDoubleBracket]iind, 3\[RightDoubleBracket]; For[kl = 1, kl \[LessEqual] 2, \(kl++\), tmp = Coefficient[Expand[exp], U[i + il, j + jl, kl]]; If[tmp =!= 0, list1 = Append[list1, coef[i, jl, indtrn, kin, kl]]; list2 = Append[list2, coef[i, j, indtrn, kin, kl] - Coefficient[Expand[exp], U[i + il, j, kl]]]]]]; FortranAssign[Evaluate[list1], list2, AssignToArray \[Rule] {muY, muX, a, coef, polycoef}]]\)], "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "This is slight variation on dependentCellsNotCovered. Uses Format.m"], "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Clear[depCellNotCovered]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(dependentCellIsCovered[exp_, logfunc_, maskfun_] := Module[{cond, lexp}, cond = False; lexp = exp; For[il = \(-2\), il \[LessEqual] \(+2\), \(il++\), For[jl = \(-2\), jl \[LessEqual] \(+2\), \(jl++\), For[kl = 1, kl \[LessEqual] 2, \(kl++\), If[logfunc[il, jl] && Coefficient[Expand[exp], U[i + il, j + jl, kl]] =!= 0, cond = cond || maskfun[i + il, j + jl] > 0]]]]; FortranAssign[cond, AssignToArray \[Rule] {maskray}]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Clear[stencoef]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(stencilDef[out1, 1]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(dog1 = InputForm[ Expand[vol\ \((alpha\ a[i, j]\ U[i, j, 1] - \(1\/vol\(( beta\ \(( hy\ \((tauxx[i + half, j] - tauxx[i - 1 + half, j]) \) + hx\ \((tauxy[i, j + half] - tauxy[i, j - 1 + half])\)) \))\)\))\) //. {tauxxdef, tauxydef, murepl1, murepl2, urepl, vrepl, vol \[Rule] hx\ hy}]]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Splice["\", FormatType \[Rule] OutputForm]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(Splice["\", FormatType \[Rule] OutputForm]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(exntop + exnbot\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(dependentCellIsCovered[exntop + exnbot, indexcond, maskray]\)], "Input",\ AspectRatioFixed->True], Cell[BoxData[ \(Expand[exntop]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(outdog = 2\ beta\ hy\ dudx[\(-1\) + half + i, j] //. {dudxdef, u[i - 1, j] \[Rule] u[i, j]}\)], "Input", AspectRatioFixed->True] }, Open ]] }, Open ]] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{535, 959}, WindowMargins->{{Automatic, 359}, {Automatic, 22}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1731, 51, 94, 2, 47, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[1850, 57, 146, 4, 27, "Input"], Cell[1999, 63, 103, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2139, 70, 146, 4, 27, "Input"], Cell[2288, 76, 103, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2428, 83, 141, 4, 27, "Input"], Cell[2572, 89, 191, 3, 55, "Message"], Cell[2766, 94, 182, 3, 39, "Message"], Cell[2951, 99, 179, 3, 39, "Message"], Cell[3133, 104, 160, 3, 39, "Message"], Cell[3296, 109, 98, 2, 27, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[3443, 117, 103, 2, 47, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[3571, 123, 134, 3, 50, "Input"], Cell[3708, 128, 99, 2, 50, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3844, 135, 134, 3, 47, "Input"], Cell[3981, 140, 99, 2, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4117, 147, 203, 5, 69, "Input"], Cell[4323, 154, 171, 3, 69, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4531, 162, 203, 5, 65, "Input"], Cell[4737, 169, 171, 3, 65, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4945, 177, 129, 3, 47, "Input"], Cell[5077, 182, 99, 2, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[5213, 189, 129, 3, 50, "Input"], Cell[5345, 194, 99, 2, 50, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[5493, 202, 119, 2, 47, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[5637, 208, 458, 9, 190, "Input"], Cell[6098, 219, 175, 3, 39, "Message"], Cell[6276, 224, 179, 3, 39, "Message"], Cell[6458, 229, 401, 7, 193, "Output"] }, Open ]], Cell[6874, 239, 128, 3, 27, "Input"], Cell[CellGroupData[{ Cell[7027, 246, 128, 3, 47, "Input"], Cell[7158, 251, 49, 1, 47, "Output"] }, Open ]], Cell[7222, 255, 128, 3, 27, "Input"], Cell[CellGroupData[{ Cell[7375, 262, 128, 3, 47, "Input"], Cell[7506, 267, 49, 1, 47, "Output"] }, Open ]], Cell[7570, 271, 114, 2, 27, "Input"], Cell[CellGroupData[{ Cell[7709, 277, 128, 3, 47, "Input"], Cell[7840, 282, 49, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7926, 288, 458, 9, 190, "Input"], Cell[8387, 299, 187, 3, 39, "Message"], Cell[8577, 304, 175, 3, 39, "Message"], Cell[8755, 309, 179, 3, 39, "Message"], Cell[8937, 314, 179, 3, 39, "Message"], Cell[9119, 319, 161, 3, 39, "Message"], Cell[9283, 324, 185, 3, 39, "Message"], Cell[9471, 329, 401, 7, 193, "Output"] }, Open ]], Cell[9887, 339, 114, 2, 27, "Input"], Cell[CellGroupData[{ Cell[10026, 345, 128, 3, 47, "Input"], Cell[10157, 350, 49, 1, 47, "Output"] }, Open ]], Cell[10221, 354, 128, 3, 27, "Input"], Cell[CellGroupData[{ Cell[10374, 361, 128, 3, 47, "Input"], Cell[10505, 366, 49, 1, 47, "Output"] }, Open ]], Cell[10569, 370, 128, 3, 27, "Input"], Cell[CellGroupData[{ Cell[10722, 377, 128, 3, 47, "Input"], Cell[10853, 382, 49, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[10939, 388, 223, 5, 65, "Input"], Cell[11165, 395, 188, 3, 39, "Message"], Cell[11356, 400, 176, 3, 39, "Message"], Cell[11535, 405, 181, 3, 39, "Message"], Cell[11719, 410, 173, 3, 88, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[11941, 419, 82, 2, 47, "Section", Evaluatable->False], Cell[12026, 423, 150, 4, 43, "Input"], Cell[CellGroupData[{ Cell[12201, 431, 154, 3, 47, "Input"], Cell[12358, 436, 67, 1, 47, "Output"] }, Open ]], Cell[12440, 440, 150, 4, 43, "Input"], Cell[CellGroupData[{ Cell[12615, 448, 154, 3, 47, "Input"], Cell[12772, 453, 67, 1, 47, "Output"] }, Open ]], Cell[12854, 457, 199, 4, 43, "Input"], Cell[CellGroupData[{ Cell[13078, 465, 154, 3, 47, "Input"], Cell[13235, 470, 88, 1, 47, "Output"] }, Open ]], Cell[13338, 474, 199, 4, 43, "Input"], Cell[CellGroupData[{ Cell[13562, 482, 154, 3, 47, "Input"], Cell[13719, 487, 88, 1, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[13856, 494, 112, 2, 47, "Section", Evaluatable->False], Cell[CellGroupData[{ Cell[13993, 500, 108, 2, 27, "Input"], Cell[14104, 504, 73, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[14214, 510, 108, 2, 27, "Input"], Cell[14325, 514, 73, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[14435, 520, 95, 2, 27, "Input"], Cell[14533, 524, 62, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[14632, 530, 95, 2, 27, "Input"], Cell[14730, 534, 177, 3, 39, "Message"], Cell[14910, 539, 62, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15009, 545, 173, 3, 43, "Input"], Cell[15185, 550, 254, 5, 95, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15476, 560, 290, 5, 75, "Input"], Cell[15769, 567, 686, 13, 266, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16492, 585, 121, 2, 45, "Subsection", Evaluatable->False], Cell[CellGroupData[{ Cell[16638, 591, 475, 10, 115, "Input"], Cell[17116, 603, 175, 3, 39, "Message"], Cell[17294, 608, 1081, 21, 397, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[18412, 634, 95, 2, 27, "Input"], Cell[18510, 638, 192, 3, 91, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[18739, 646, 99, 2, 27, "Input"], Cell[18841, 650, 76, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[18954, 656, 99, 2, 27, "Input"], Cell[19056, 660, 72, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[19165, 666, 99, 2, 27, "Input"], Cell[19267, 670, 73, 1, 50, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[19377, 676, 99, 2, 27, "Input"], Cell[19479, 680, 69, 1, 50, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[19585, 686, 475, 10, 115, "Input"], Cell[20063, 698, 1076, 20, 382, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21176, 723, 95, 2, 27, "Input"], Cell[21274, 727, 192, 3, 91, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21503, 735, 99, 2, 27, "Input"], Cell[21605, 739, 73, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21715, 745, 99, 2, 27, "Input"], Cell[21817, 749, 69, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21923, 755, 99, 2, 27, "Input"], Cell[22025, 759, 76, 1, 50, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[22138, 765, 99, 2, 27, "Input"], Cell[22240, 769, 72, 1, 50, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[22349, 775, 720, 11, 154, "Subsubsection", Evaluatable->False], Cell[23072, 788, 90, 2, 27, "Input"], Cell[CellGroupData[{ Cell[23187, 794, 527, 10, 123, "Input"], Cell[23717, 806, 173, 3, 39, "Message"], Cell[23893, 811, 174, 3, 39, "Message"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[24116, 820, 390, 7, 90, "Subsubsection", Evaluatable->False], Cell[24509, 829, 87, 2, 27, "Input"], Cell[24599, 833, 524, 10, 123, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[25160, 848, 192, 4, 58, "Subsubsection", Evaluatable->False], Cell[25355, 854, 531, 10, 123, "Input"], Cell[CellGroupData[{ Cell[25911, 868, 156, 4, 43, "Input"], Cell[26070, 874, 102, 2, 27, "Output"] }, Open ]], Cell[26187, 879, 329, 7, 68, "Input"], Cell[CellGroupData[{ Cell[26541, 890, 186, 4, 27, "Input"], Cell[26730, 896, 66, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26833, 902, 117, 2, 34, "Input"], Cell[26953, 906, 35, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27025, 912, 117, 2, 34, "Input"], Cell[27145, 916, 41, 1, 32, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27223, 922, 192, 4, 28, "Input"], Cell[27418, 928, 59, 1, 47, "Output"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[27538, 936, 263, 5, 79, "Subsection", Evaluatable->False], Cell[CellGroupData[{ Cell[27826, 945, 159, 3, 43, "Input"], Cell[27988, 950, 175, 3, 39, "Message"] }, Open ]], Cell[28178, 956, 159, 3, 43, "Input"], Cell[28340, 961, 174, 3, 59, "Input"], Cell[28517, 966, 172, 3, 59, "Input"], Cell[CellGroupData[{ Cell[28714, 973, 162, 4, 47, "Input"], Cell[28879, 979, 52, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[28968, 985, 162, 4, 47, "Input"], Cell[29133, 991, 52, 1, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[29234, 998, 263, 5, 79, "Subsection", Evaluatable->False], Cell[CellGroupData[{ Cell[29522, 1007, 159, 3, 43, "Input"], Cell[29684, 1012, 177, 3, 39, "Message"] }, Open ]], Cell[29876, 1018, 159, 3, 43, "Input"], Cell[30038, 1023, 174, 3, 59, "Input"], Cell[30215, 1028, 172, 3, 59, "Input"], Cell[CellGroupData[{ Cell[30412, 1035, 162, 4, 47, "Input"], Cell[30577, 1041, 52, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[30666, 1047, 162, 4, 47, "Input"], Cell[30831, 1053, 52, 1, 47, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[30932, 1060, 127, 2, 45, "Subsection", Evaluatable->False], Cell[31062, 1064, 123, 3, 47, "Input"], Cell[31188, 1069, 137, 3, 47, "Input"], Cell[CellGroupData[{ Cell[31350, 1076, 150, 4, 47, "Input"], Cell[31503, 1082, 52, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[31592, 1088, 123, 3, 50, "Input"], Cell[31718, 1093, 177, 3, 39, "Message"] }, Open ]], Cell[31910, 1099, 137, 3, 50, "Input"], Cell[CellGroupData[{ Cell[32072, 1106, 150, 4, 47, "Input"], Cell[32225, 1112, 52, 1, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[32314, 1118, 312, 7, 107, "Input"], Cell[32629, 1127, 176, 3, 39, "Message"], Cell[32808, 1132, 181, 3, 39, "Message"], Cell[32992, 1137, 176, 3, 39, "Message"], Cell[33171, 1142, 181, 3, 39, "Message"], Cell[33355, 1147, 181, 3, 39, "Message"], Cell[33539, 1152, 160, 3, 39, "Message"], Cell[33702, 1157, 177, 3, 39, "Message"], Cell[33882, 1162, 161, 3, 39, "Message"], Cell[34046, 1167, 126, 2, 23, "Message"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[34233, 1176, 116, 2, 47, "Section", Evaluatable->False], Cell[34352, 1180, 469, 10, 115, "Input"], Cell[34824, 1192, 96, 2, 27, "Input"], Cell[CellGroupData[{ Cell[34945, 1198, 114, 2, 45, "Subsection", Evaluatable->False], Cell[35062, 1202, 113, 2, 27, "Input"], Cell[35178, 1206, 106, 2, 27, "Input"], Cell[35287, 1210, 116, 2, 27, "Input"], Cell[35406, 1214, 1004, 16, 203, "Input"], Cell[36413, 1232, 1050, 17, 203, "Input"], Cell[37466, 1251, 1066, 18, 203, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[38569, 1274, 152, 4, 45, "Subsection", Evaluatable->False], Cell[38724, 1280, 83, 2, 27, "Input"], Cell[38810, 1284, 579, 10, 123, "Input"], Cell[39392, 1296, 74, 2, 27, "Input"], Cell[39469, 1300, 78, 2, 27, "Input"], Cell[39550, 1304, 535, 12, 155, "Input"], Cell[40088, 1318, 110, 2, 27, "Input"], Cell[40201, 1322, 113, 2, 27, "Input"], Cell[40317, 1326, 74, 2, 27, "Input"], Cell[40394, 1330, 120, 3, 27, "Input"], Cell[40517, 1335, 73, 2, 27, "Input"], Cell[40593, 1339, 168, 4, 43, "Input"] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************) ccseapps-2.5/CCSEApps/tensorMG/MCLO_2D.F0000644000175000017500000001231011634153073020600 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: MCLO_2D.F,v 1.2 1998/11/17 19:11:09 lijewski Exp $ c #include #include #include #include c----------------------------------------------------------------------- subroutine FORT_RESIDL ( $ res, DIMS(res), $ rhs, DIMS(rhs), $ phi, DIMS(phi), $ lo, hi, nc $ ) integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer DIMDEC(phi) REAL_T phi(DIMV(phi),nc) integer DIMDEC(rhs) REAL_T rhs(DIMV(rhs),nc) integer DIMDEC(res) REAL_T res(DIMV(res),nc) c integer i integer j integer n c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) res(i,j,n) = rhs(i,j,n) - phi(i,j,n) enddo enddo enddo c end c----------------------------------------------------------------------- subroutine FORT_HARMONIC_AVERAGEEC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc, $ cdir $ ) c integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer cdir integer DIMDEC(f) REAL_T f(DIMV(f),nc) integer DIMDEC(c) REAL_T c(DIMV(c),nc) c REAL_T factor, den parameter(factor=2.00) integer n integer i integer j c if ( cdir .eq. 0 ) then do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1)+1 den = f(2*i,2*j,n) + f(2*i,2*j+1,n) if (den .ne. 0.0) then c(i,j,n) = factor*f(2*i,2*j,n)*f(2*i,2*j+1,n)/den else c(i,j,n) = 0.0 endif enddo enddo enddo else if (cdir .eq. 1 ) then do n = 1, nc do j = lo(2), hi(2)+1 do i = lo(1), hi(1) den = f(2*i,2*j,n) + f(2*i+1,2*j,n) if (den .ne. 0.0) then c(i,j,n) = factor*f(2*i,2*j,n)*f(2*i+1,2*j,n)/den else c(i,j,n) = 0.0 endif enddo enddo enddo endif c end c----------------------------------------------------------------------- subroutine FORT_AVERAGEEC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc, $ cdir $ ) c integer nc integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) integer cdir integer DIMDEC(f) REAL_T f(DIMV(f),nc) integer DIMDEC(c) REAL_T c(DIMV(c),nc) c integer n integer i integer j REAL_T denom parameter(denom=0.50d0) c if (cdir .eq. 0 ) then do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1)+1 c(i,j,n) = (f(2*i,2*j,n) + f(2*i,2*j+1,n))*denom enddo enddo enddo else if (cdir .eq. 1) then do n = 1, nc do j = lo(2), hi(2)+1 do i = lo(1), hi(1) c(i,j,n) = (f(2*i,2*j,n) + f(2*i+1,2*j,n))*denom enddo enddo enddo endif c end c----------------------------------------------------------------------- subroutine FORT_AVERAGECC ( $ c, DIMS(c), $ f, DIMS(f), $ lo, hi, nc $ ) c integer nc integer DIMDEC(f) integer DIMDEC(c) integer lo(BL_SPACEDIM) integer hi(BL_SPACEDIM) REAL_T f(DIMV(f),nc) REAL_T c(DIMV(c),nc) c integer i integer j integer n REAL_T denom parameter(denom=0.25d0) c do n = 1, nc do j = lo(2), hi(2) do i = lo(1), hi(1) c(i,j,n) = ( $ f(2*i+1,2*j+1,n) + f(2*i ,2*j+1,n) $ + f(2*i+1,2*j ,n) + f(2*i ,2*j ,n))*denom enddo enddo enddo c end ccseapps-2.5/CCSEApps/tensorMG/MCLinOp.cpp0000644000175000017500000004400111634153073021361 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MCLinOp.cpp,v 1.18 2001/08/09 22:42:01 marc Exp $ // // Differences from LinOp: den has nc components, bct has nc components. // #include #include #include #include #include #include "LO_BCTYPES.H" #include "DivVis_F.H" #include "MCLinOp.H" bool MCLinOp::initialized = false; int MCLinOp::def_harmavg = 0; int MCLinOp::def_verbose = 0; int MCLinOp::def_maxorder = 2; #ifndef NDEBUG // // MCLinOp::applyBC fills MCLinOp_grow ghost cells with data expected in // MCLinOp::apply() therefore, the incoming MultiFab to MCLinOp::applyBC() // better have this many ghost allocated. // const int MCLinOp_grow = 1; #endif void MCLinOp::initialize () { ParmParse pp("MCLp"); pp.query("harmavg", def_harmavg); pp.query("v", def_verbose); if (ParallelDescriptor::IOProcessor() && def_verbose) std::cout << "def_harmavg = " << def_harmavg << '\n'; initialized = true; } MCLinOp::MCLinOp (const BndryData& _bgb, const Real _h) : bgb(_bgb) { BL_ASSERT (MCLinOp::bcComponentsNeeded() == bgb.nComp()); Real __h[BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; i++) { __h[i] = _h; } initConstruct(__h); } MCLinOp::MCLinOp (const BndryData& _bgb, const Real* _h) : bgb(_bgb) { BL_ASSERT (MCLinOp::bcComponentsNeeded() == bgb.nComp()); initConstruct(_h); } MCLinOp::~MCLinOp () { for (int i = 0; i < maskvals.size(); ++i) { for (int j=0; j < maskvals[i].size(); ++j) { for (int k = 0; k < maskvals[i][j].size(); ++k) { delete maskvals[i][j][k]; } } } } MCLinOp::MCLinOp (const MCLinOp& _lp, int level) : bgb(_lp.bgb) { BL_ASSERT(_lp.numLevels() > level); harmavg = _lp.harmavg; verbose = _lp.verbose; gbox.resize(1); gbox[0] = _lp.boxArray(level); geomarray.resize(1); geomarray[0] = bgb.getGeom(); h.resize(1); h[0] = _lp.h[level]; // level should be prepared here. undrrelxr.resize(1); undrrelxr[0] = _lp.undrrelxr[level]; tangderiv.resize(1); tangderiv[0] = _lp.tangderiv[level]; } void MCLinOp::initConstruct (const Real* _h) { if (!initialized) initialize(); harmavg = def_harmavg; verbose = def_verbose; gbox.resize(1); int level = 0; gbox[level] = bgb.boxes(); geomarray.resize(1); geomarray[level] = bgb.getGeom(); h.resize(1); maxorder = def_maxorder; for (int i = 0; i < BL_SPACEDIM; ++i) { h[level][i] = _h[i]; } maskvals.resize(1); maskvals[level].resize(gbox[level].size()); // // For each orientation, build NULL masks, then use distributed allocation // for (int i = 0; i < gbox[level].size(); i++) { maskvals[level][i].resize(2*BL_SPACEDIM, (Mask*)0); } const int myproc = ParallelDescriptor::MyProc(); for (OrientationIter oitr; oitr; ++oitr) { Orientation face = oitr(); const FabSet& bndry = bgb[face]; for (int i = 0; i < gbox[level].size(); i++) { if (bndry.DistributionMap()[i] == myproc) { const PArray& pam = bgb.bndryMasks(face); BL_ASSERT(maskvals[level][i][face] == 0); maskvals[level][i][face] = new Mask(pam[i].box(), 1); maskvals[level][i][face]->copy(pam[i]); } } } } int MCLinOp::bcComponentsNeeded() { float d = (float) BL_SPACEDIM; int nDer = (int) (pow(d,d-1)+d); return nDer; } void MCLinOp::apply (MultiFab& out, MultiFab& in, int level, MCBC_Mode bc_mode) { applyBC(in,level,bc_mode); Fapply(out,in,level); } void MCLinOp::applyBC (MultiFab& inout, int level, MCBC_Mode bc_mode) { // // The inout MultiFab must have at least MCLinOp_grow ghost cells // for applyBC() // BL_ASSERT(inout.nGrow() >= MCLinOp_grow); // // The inout MultiFab must have at least Periodic_BC_grow cells for the // algorithms taking care of periodic boundary conditions. // BL_ASSERT(inout.nGrow() >= MCLinOp_grow); // // No coarsened boundary values, cannot apply inhomog at lev>0. // BL_ASSERT(!(level>0 && bc_mode == MCInhomogeneous_BC)); int flagden = 1; // fill in the bndry data and undrrelxr int flagbc = 1; // with values if (bc_mode == MCHomogeneous_BC) flagbc = 0; // nodata if homog int nc = inout.nComp(); BL_ASSERT(nc == numcomp ); inout.FillBoundary(); prepareForLevel(level); geomarray[level].FillPeriodicBoundary(inout,0,nc); // // Fill boundary cells. // OrientationIter oitr; while (oitr) { const Array > &b = bgb.bndryConds(oitr()); const Array &r = bgb.bndryLocs(oitr()); FabSet& f = (*undrrelxr[level])[oitr()]; FabSet& td = (*tangderiv[level])[oitr()]; int cdr(oitr()); const FabSet& fs = bgb.bndryValues(oitr()); int cdir = oitr().coordDir(); for (MFIter inoutmfi(inout); inoutmfi.isValid(); ++inoutmfi) { const int gn = inoutmfi.index(); BL_ASSERT(gbox[level][inoutmfi.index()] == inoutmfi.validbox()); Real bcl(r[gn]); const int *bct = (const int *)b[gn].dataPtr(); const FArrayBox& fsfab = fs[inoutmfi.index()]; const Real* bcvalptr = fsfab.dataPtr(); // // Way external derivs stored. // const Real* exttdptr = fsfab.dataPtr(numcomp); const int* fslo = fsfab.loVect(); const int* fshi = fsfab.hiVect(); FArrayBox& inoutfab = inout[inoutmfi]; FArrayBox& denfab = f[inoutmfi.index()]; FArrayBox& tdfab = td[inoutmfi.index()]; #if BL_SPACEDIM==2 int perpdir; if (cdir == 0) perpdir = 1; else if (cdir == 1) perpdir = 0; else BoxLib::Abort("MCLinOp::applyBC(): bad logic"); const Mask& m = *maskvals[level][gn][oitr()]; const Mask& mphi = *maskvals[level][gn][Orientation(perpdir, Orientation::high)]; const Mask& mplo = *maskvals[level][gn][Orientation(perpdir, Orientation::low)]; FORT_APPLYBC( &flagden, &flagbc, &maxorder, inoutfab.dataPtr(), ARLIM(inoutfab.loVect()), ARLIM(inoutfab.hiVect()), &cdr, bct, &bcl, bcvalptr, ARLIM(fslo), ARLIM(fshi), m.dataPtr(), ARLIM(m.loVect()), ARLIM(m.hiVect()), mphi.dataPtr(), ARLIM(mphi.loVect()), ARLIM(mphi.hiVect()), mplo.dataPtr(), ARLIM(mplo.loVect()), ARLIM(mplo.hiVect()), denfab.dataPtr(), ARLIM(denfab.loVect()), ARLIM(denfab.hiVect()), exttdptr, ARLIM(fslo), ARLIM(fshi), tdfab.dataPtr(),ARLIM(tdfab.loVect()),ARLIM(tdfab.hiVect()), inoutmfi.validbox().loVect(), inoutmfi.validbox().hiVect(), &nc, h[level]); #elif BL_SPACEDIM==3 const Mask& mn = *maskvals[level][gn][Orientation(1,Orientation::high)]; const Mask& me = *maskvals[level][gn][Orientation(0,Orientation::high)]; const Mask& mw = *maskvals[level][gn][Orientation(0,Orientation::low)]; const Mask& ms = *maskvals[level][gn][Orientation(1,Orientation::low)]; const Mask& mt = *maskvals[level][gn][Orientation(2,Orientation::high)]; const Mask& mb = *maskvals[level][gn][Orientation(2,Orientation::low)]; FORT_APPLYBC( &flagden, &flagbc, &maxorder, inoutfab.dataPtr(), ARLIM(inoutfab.loVect()), ARLIM(inoutfab.hiVect()), &cdr, bct, &bcl, bcvalptr, ARLIM(fslo), ARLIM(fshi), mn.dataPtr(),ARLIM(mn.loVect()),ARLIM(mn.hiVect()), me.dataPtr(),ARLIM(me.loVect()),ARLIM(me.hiVect()), mw.dataPtr(),ARLIM(mw.loVect()),ARLIM(mw.hiVect()), ms.dataPtr(),ARLIM(ms.loVect()),ARLIM(ms.hiVect()), mt.dataPtr(),ARLIM(mt.loVect()),ARLIM(mt.hiVect()), mb.dataPtr(),ARLIM(mb.loVect()),ARLIM(mb.hiVect()), denfab.dataPtr(), ARLIM(denfab.loVect()), ARLIM(denfab.hiVect()), exttdptr, ARLIM(fslo), ARLIM(fshi), tdfab.dataPtr(),ARLIM(tdfab.loVect()),ARLIM(tdfab.hiVect()), inoutmfi.validbox().loVect(), inoutmfi.validbox().hiVect(), &nc, h[level]); #endif } ++oitr; } } void MCLinOp::residual (MultiFab& residL, const MultiFab& rhsL, MultiFab& solnL, int level, MCBC_Mode bc_mode) { apply(residL, solnL, level, bc_mode); for (MFIter solnLmfi(solnL); solnLmfi.isValid(); ++solnLmfi) { int nc = residL.nComp(); FORT_RESIDL( residL[solnLmfi].dataPtr(), ARLIM(residL[solnLmfi].loVect()), ARLIM(residL[solnLmfi].hiVect()), rhsL[solnLmfi].dataPtr(), ARLIM(rhsL[solnLmfi].loVect()), ARLIM(rhsL[solnLmfi].hiVect()), residL[solnLmfi].dataPtr(), ARLIM(residL[solnLmfi].loVect()), ARLIM(residL[solnLmfi].hiVect()), solnLmfi.validbox().loVect(), solnLmfi.validbox().hiVect(), &nc); } } void MCLinOp::smooth (MultiFab& solnL, const MultiFab& rhsL, int level, MCBC_Mode bc_mode) { for (int phaseflag = 0; phaseflag < numphase; phaseflag++) { applyBC(solnL, level, bc_mode); Fsmooth(solnL, rhsL, level, phaseflag); } } Real MCLinOp::norm (const MultiFab& in, int level) const { Real norm = 0.0; for (MFIter inmfi(in); inmfi.isValid(); ++inmfi) { Real tnorm = in[inmfi].norm(gbox[level][inmfi.index()]); norm += tnorm*tnorm; } ParallelDescriptor::ReduceRealSum(norm); return norm; } void MCLinOp::clearToLevel (int level) { for (int i = level+1; i < numLevels(); ++i) { delete undrrelxr[i].release(); delete tangderiv[i].release(); gbox[i].clear(); } h.resize(level+1); gbox.resize(level+1); undrrelxr.resize(level+1); tangderiv.resize(level+1); } void MCLinOp::prepareForLevel (int level) { if (level == 0) return; MCLinOp::prepareForLevel(level-1); if (h.size() > level) return; // // Assume from here down that this is a new level one coarser than existing // BL_ASSERT(h.size() == level); h.resize(level+1); int i; for (i = 0; i < BL_SPACEDIM; ++i) h[level][i] = h[level-1][i]*2.0; geomarray.resize(level+1); Box curdomain = Box( geomarray[level-1].Domain() ).coarsen(2); geomarray[level].define( curdomain ); // // Add a box to the new coarser level (assign removes old BoxArray) // gbox.resize(level+1); gbox[level] = BoxArray(gbox[level-1]).coarsen(2); // // Add the BndryRegister of relax values to the new coarser level. // BL_ASSERT(undrrelxr.size() == level); undrrelxr.resize(level+1); undrrelxr[level] = new BndryRegister(gbox[level], 1, 0, 0, numcomp); // // Add the BndryRegister to hold tagential derivatives to the new // coarser level. // BL_ASSERT(tangderiv.size() == level); tangderiv.resize(level+1); // // Figure out how many components. // const FabSet& samplefs = (*tangderiv[level-1])[Orientation(0,Orientation::low)]; tangderiv[level] = new BndryRegister(gbox[level],0,1,0,samplefs.nComp()); // // Add an Array of Array of maskvals to the new coarser level // For each orientation, build NULL masks, then use distributed allocation // Initial masks for coarse levels, ignore outside_domain possibility since // we always solve homogeneous equation on coarse levels. // BL_ASSERT(maskvals.size() == level); maskvals.resize(level+1); maskvals[level].resize(gbox[level].size()); for (i = 0; i < gbox[level].size(); i++) { maskvals[level][i].resize(2*BL_SPACEDIM, (Mask*)0); } int myproc = ParallelDescriptor::MyProc(); Array pshifts(27); for (OrientationIter oitr; oitr; ++oitr) { Orientation face = oitr(); // // Use bgb's distribution map for masks. // for (FabSetIter bndryfsi(bgb[face]); bndryfsi.isValid(); ++bndryfsi) { const int gn = bndryfsi.index(); Box bx_k = BoxLib::adjCell(gbox[level][gn], face, 1); // // Extend box in directions orthogonal to face normal. // for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (dir == oitr()) continue; bx_k.grow(dir,1); } BL_ASSERT(maskvals[level][gn][face] == 0); maskvals[level][gn][face] = new Mask(bx_k, 1); Mask& curmask = *(maskvals[level][gn][face]); curmask.setVal(BndryData::not_covered); for (int gno = 0; gno < gbox[level].size(); ++gno) { Box btmp = gbox[level][gno] & bx_k; if (gno != gn && btmp.ok()) curmask.setVal(BndryData::covered, btmp,0); } // // Now take care of periodic wraparounds. // Geometry& curgeom = geomarray[level]; if (curgeom.isAnyPeriodic() && !curdomain.contains(bx_k)) { curgeom.periodicShift(curdomain, bx_k, pshifts); for (int iiv = 0; iiv= 0) d.surroundingNodes(cdir); int nGrow=0; cs.define(d, nc, nGrow, Fab_allocate); cs.setVal(0.0); const BoxArray& grids = gbox[level]; for (MFIter csmfi(cs); csmfi.isValid(); ++csmfi) { switch(cdir) { case -1: FORT_AVERAGECC( cs[csmfi].dataPtr(), ARLIM(cs[csmfi].loVect()), ARLIM(cs[csmfi].hiVect()), fn[csmfi].dataPtr(), ARLIM(fn[csmfi].loVect()), ARLIM(fn[csmfi].hiVect()), grids[csmfi.index()].loVect(), grids[csmfi.index()].hiVect(), &nc); break; case 0: case 1: case 2: if ( harmavg ) { FORT_HARMONIC_AVERAGEEC( cs[csmfi].dataPtr(), ARLIM(cs[csmfi].loVect()), ARLIM(cs[csmfi].hiVect()), fn[csmfi].dataPtr(), ARLIM(fn[csmfi].loVect()), ARLIM(fn[csmfi].hiVect()), grids[csmfi.index()].loVect(), grids[csmfi.index()].hiVect(), &nc, &cdir); } else { FORT_AVERAGEEC( cs[csmfi].dataPtr(), ARLIM(cs[csmfi].loVect()), ARLIM(cs[csmfi].hiVect()), fn[csmfi].dataPtr(), ARLIM(fn[csmfi].loVect()), ARLIM(fn[csmfi].hiVect()), grids[csmfi.index()].loVect(), grids[csmfi.index()].hiVect(), &nc, &cdir); } break; default: BoxLib::Error("MCLinOp::makeCoeffients(): bad coefficient coarsening direction!"); } } } std::ostream& operator<< (std::ostream& os, const MCLinOp& lp) { if (ParallelDescriptor::IOProcessor()) { os << "MCLinOp" << std::endl; os << "Grids: " << std::endl; for (int level = 0; level < lp.h.size(); ++level) { os << " level = " << level << ": " << lp.gbox[level] << std::endl; } os << "Grid Spacing: " << std::endl; for (int level = 0; level < lp.h.size(); ++level) { os << " level = " << level << ", dx = "; for (int d =0; d < BL_SPACEDIM; ++d) { os << lp.h[level][d] << " "; } os << std::endl; } os << "Harmonic average? " << (lp.harmavg == 1 ? "yes" : "no") << std::endl; os << "Verbosity: " << lp.verbose << std::endl; os << "Max Order: " << lp.maxorder << std::endl; } if (ParallelDescriptor::IOProcessor()) { os << "Masks:" << std::endl; } for (int level = 0; level < lp.h.size(); ++level) { if (ParallelDescriptor::IOProcessor()) os << "level = " << level << std::endl; for (int nproc = 0; nproc < ParallelDescriptor::NProcs(); ++nproc) { if (nproc == ParallelDescriptor::MyProc()) { os << "Processor " << nproc << std::endl; for (OrientationIter oitr; oitr; ++oitr) { Orientation face = oitr(); for (int i=0; i #include "DivVis_F.H" #include #include "ArrayLim.H" c :::: usage: c :::: this .mF file is meant to be run through Mathematica. This converts c :::: compact symbolic expressions into fortran which is stored in a .F c :::: file. c---------------------------------------------------------------- c this is the fortran support file for the the operator c L(U) = alpha*a(x)*U - beta*Div( tau ) c c where U is the two component vector (u,v) and c tau is a three by three tensor c tau = | t_xx t_xy t_xz| c | t_xy t_yy t_yz| c | t_xz t_yz t_zz| c c t_xx = 2*mu * u_x c t_yy = 2*mu * v_y c t_zz = 2*mu * w_z c t_xy = mu*(u_y + v_x) c t_xz = mu*(u_z + w_x) c t_yz = mu*(v_z + w_y) c ::: define standard replacements used by Mathematica c ::: see file visc3d.ma c ::: Null c ::: interface notes: c ::: 1) trander* ALWAYS have values in them, even if the cells are c ::: all covered. Might as well. These are edge located derivative c ::: values. In index space, they are located the same as the mask c ::: cells. Which is somewhat anomalous. These are edge values, after c ::: all. While the masks are cell-centered. But it seems easier c ::: at the moment. c ::: 2) the normal derivatives are evaluated in the normal fashion. c ::: 3) tangential derivatives which reach outside the rectangle DO have c ::: to check the masks. subroutine FORT_DVAPPLY( $ u, DIMS(u), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ muZ, DIMS(muZ), $ out, DIMS(out), $ maskn,DIMS(maskn), $ maske,DIMS(maske), $ maskw,DIMS(maskw), $ masks,DIMS(masks), $ maskt,DIMS(maskt), $ maskb,DIMS(maskb), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ trandert,DIMS(trandert), $ tranderb,DIMS(tranderb), $ lo,hi,h $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(muZ) integer DIMDEC(out) integer DIMDEC(maskn) integer DIMDEC(maske) integer DIMDEC(maskw) integer DIMDEC(masks) integer DIMDEC(maskt) integer DIMDEC(maskb) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer DIMDEC(trandert) integer DIMDEC(tranderb) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) REAL_T h(BL_SPACEDIM) REAL_T u(DIMV(u),3) REAL_T a(DIMV(a)) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) REAL_T muZ(DIMV(muZ)) REAL_T out(DIMV(out),3) integer maskn(DIMV(maskn)) integer maske(DIMV(maske)) integer maskw(DIMV(maskw)) integer masks(DIMV(masks)) integer maskt(DIMV(maskt)) integer maskb(DIMV(maskb)) c ::: for transverse derives, first 3 is for variable, second 3 is for c ::: direction of derivative. Obviously not all are used, but this is easy. REAL_T trandern(DIMV(trandern),3,3) REAL_T trandere(DIMV(trandere),3,3) REAL_T tranderw(DIMV(tranderw),3,3) REAL_T tranders(DIMV(tranders),3,3) REAL_T trandert(DIMV(trandert),3,3) REAL_T tranderb(DIMV(tranderb),3,3) integer i,j,k REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy,hz REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw REAL_T dudyn,dudys REAL_T dvdxe,dvdxw REAL_T dvdxn,dvdxs REAL_T dudzb,dudzt REAL_T dwdzt,dwdzb REAL_T dwdxb,dwdxt REAL_T dvdzb,dvdzt REAL_T dwdyb,dwdyt REAL_T dudzw,dudze REAL_T dwdxw,dwdxe REAL_T dvdzs,dvdzn REAL_T dwdys,dwdyn logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) hz = h(3) c ::: cases: c ::: 0) interior. All usual derivative expressions c ::: 1-6) face but not on edge. c ::: 7-18) edge but not on corner. c ::: 19-26) corners. c ::: case 0 c ::: Null c ::: Null do k=lo(3)+1,hi(3)-1 do j=lo(2)+1,hi(2)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo enddo enddo c ::: case 1, top face c ::: Null c ::: Null c ::: Null k=hi(3) do j=lo(2)+1,hi(2)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=trandert(i,j,1+k,3,1) dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo enddo c ::: case 2, bottom face c ::: Null c ::: Null c ::: Null k=lo(3) do j=lo(2)+1,hi(2)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=tranderb(i,j,-1+k,3,1) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) dwdyb=tranderb(i,j,-1+k,3,2) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo enddo c ::: case 3, west face c ::: Null c ::: Null c ::: Null i = lo(1) do k=lo(3)+1,hi(3)-1 do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=tranderw(-1+i,j,k,1,2) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) dudzw=tranderw(-1+i,j,k,1,3) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo enddo c ::: case 4, east face c ::: Null c ::: Null c ::: Null i = hi(1) do k=lo(3)+1,hi(3)-1 do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=trandere(1+i,j,k,1,2) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=trandere(1+i,j,k,1,3) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo enddo c ::: case 5, north face c ::: Null c ::: Null c ::: Null j = hi(2) do k=lo(3)+1,hi(3)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=trandern(i,1+j,k,2,1) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo enddo c ::: case 6, south face c ::: Null c ::: Null c ::: Null j = lo(2) do k=lo(3)+1,hi(3)-1 do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=tranders(i,-1+j,k,2,1) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=tranders(i,-1+j,k,2,3) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo enddo c ::: case 7, top-north edge c ::: Null c ::: Null c ::: Null k=hi(3) j=hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=trandern(i,1+j,k,2,1) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=trandert(i,j,1+k,3,1) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 8, top-south edge c ::: Null k=hi(3) j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=tranders(i,-1+j,k,2,1) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dwdxt=trandert(i,j,1+k,3,1) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif dvdzs=tranders(i,-1+j,k,2,3) if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 9, top-west edge c ::: Null k=hi(3) i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=tranderw(-1+i,j,k,1,2) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=trandert(i,j,1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 10, top-east edge c ::: Null k=hi(3) i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=trandere(1+i,j,k,1,2) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 11, bottom-north edge c ::: Null k=lo(3) j=hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=trandern(i,1+j,k,2,1) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=tranderb(i,j,-1+k,3,1) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) dwdyb=tranderb(i,j,-1+k,3,2) if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 12, bottom-south edge c ::: Null k=lo(3) j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) dvdxs=tranders(i,-1+j,k,2,1) dwdxb=tranderb(i,j,-1+k,3,1) dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) dwdyb=tranderb(i,j,-1+k,3,2) if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif dvdzs=tranders(i,-1+j,k,2,3) if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 13, bottom-west edge c ::: Null k=lo(3) i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) dudyw=tranderw(-1+i,j,k,1,2) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dwdyb=tranderb(i,j,-1+k,3,2) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) dudzw=tranderw(-1+i,j,k,1,3) if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 14, bottom-east edge c ::: Null k=lo(3) i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dwdyb=tranderb(i,j,-1+k,3,2) dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 15, east-north edge c ::: Null j=hi(2) i=hi(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=trandere(1+i,j,k,1,3) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 16, east-south edge c ::: Null j=lo(2) i=hi(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dudze=trandere(1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 17, west-north edge c ::: Null j=hi(2) i=lo(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=tranderw(-1+i,j,k,1,3) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 18, west-south edge c ::: Null j=lo(2) i=lo(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=tranderw(-1+i,j,k,1,3) dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) dvdzs=tranders(i,-1+j,k,2,3) dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) enddo c ::: case 19, top-north-east corner c ::: Null k=hi(3) j=hi(2) i=hi(1) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dudye=trandere(1+i,j,k,1,2) if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: case 20, top-north-west corner c ::: Null i=lo(1) j=hi(2) k=hi(3) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: case 21, top-south-east corner c ::: Null i=hi(1) j=lo(2) k=hi(3) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dudye=trandere(1+i,j,k,1,2) if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: case 22, top-south-west corner c ::: Null i=lo(1) j=lo(2) k=hi(3) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) if(maskt(i,j,1+k).gt.0.or.maskt(1+i,j,1+k).gt.0) then dudze=((U(i,j,-2+k,1)-4*U(i,j,-1+k,1)+3*U(i,j,k,1) & )/(2.d0*hz)+(U(1+i,j,-2+k,1)-4*U(1+i,j,-1+k,1)+3*U & (1+i,j,k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif dvdzs=tranders(i,-1+j,k,2,3) if(maskt(i,j,1+k).gt.0.or.maskt(i,1+j,1+k).gt.0) then dvdzn=((U(i,j,-2+k,2)-4*U(i,j,-1+k,2)+3*U(i,j,k,2) & )/(2.d0*hz)+(U(i,1+j,-2+k,2)-4*U(i,1+j,-1+k,2)+3*U & (i,1+j,k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: case 23, bottom-north-east corner c ::: Null i=hi(1) j=hi(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dwdyb=tranderb(i,j,-1+k,3,2) if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: case 24, bottom-north-west corner c ::: Null i=lo(1) j=hi(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif if(maskn(i,1+j,k).gt.0.or.maskn(1+i,1+j,k).gt.0) then dudye=((U(i,-2+j,k,1)-4*U(i,-1+j,k,1)+3*U(i,j,k,1) & )/(2.d0*hy)+(U(1+i,-2+j,k,1)-4*U(1+i,-1+j,k,1)+3*U & (1+i,j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) dwdyb=tranderb(i,j,-1+k,3,2) if(maskn(i,1+j,k).gt.0.or.maskn(i,1+j,1+k).gt.0) then dwdyt=((U(i,-2+j,k,3)-4*U(i,-1+j,k,3)+3*U(i,j,k,3) & )/(2.d0*hy)+(U(i,-2+j,1+k,3)-4*U(i,-1+j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=tranderw(-1+i,j,k,1,3) if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: case 25, bottom-south-east corner c ::: Null i=hi(1) j=lo(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maske(1+i,j,k).gt.0.or.maske(1+i,1+j,k).gt.0) then dvdxn=((U(-2+i,j,k,2)-4*U(-1+i,j,k,2)+3*U(i,j,k,2) & )/(2.d0*hx)+(U(-2+i,1+j,k,2)-4*U(-1+i,1+j,k,2)+3*U & (i,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) dwdxb=tranderb(i,j,-1+k,3,1) if(maske(1+i,j,k).gt.0.or.maske(1+i,j,1+k).gt.0) then dwdxt=((U(-2+i,j,k,3)-4*U(-1+i,j,k,3)+3*U(i,j,k,3) & )/(2.d0*hx)+(U(-2+i,j,1+k,3)-4*U(-1+i,j,1+k,3)+3*U & (i,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dwdyb=tranderb(i,j,-1+k,3,2) if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) c ::: case 26, bottom-south-west corner c ::: Null i=lo(1) j=lo(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,1+j,k).gt.0) then dvdxn=((-3*U(i,j,k,2)+4*U(1+i,j,k,2)-U(2+i,j,k,2)) & /(2.d0*hx)+(-3*U(i,1+j,k,2)+4*U(1+i,1+j,k,2)-U(2+i & ,1+j,k,2))/(2.d0*hx))/2.d0 else dvdxn=(-U(-1+i,j,k,2)-U(-1+i,1+j,k,2)+U(1+i,j,k,2) & +U(1+i,1+j,k,2))/(4.d0*hx) endif dvdxs=tranders(i,-1+j,k,2,1) dwdxb=tranderb(i,j,-1+k,3,1) if(maskw(-1+i,j,k).gt.0.or.maskw(-1+i,j,1+k).gt.0) then dwdxt=((-3*U(i,j,k,3)+4*U(1+i,j,k,3)-U(2+i,j,k,3)) & /(2.d0*hx)+(-3*U(i,j,1+k,3)+4*U(1+i,j,1+k,3)-U(2+i & ,j,1+k,3))/(2.d0*hx))/2.d0 else dwdxt=(-U(-1+i,j,k,3)-U(-1+i,j,1+k,3)+U(1+i,j,k,3) & +U(1+i,j,1+k,3))/(4.d0*hx) endif if(masks(i,-1+j,k).gt.0.or.masks(1+i,-1+j,k).gt.0) then dudye=((-3*U(i,j,k,1)+4*U(i,1+j,k,1)-U(i,2+j,k,1)) & /(2.d0*hy)+(-3*U(1+i,j,k,1)+4*U(1+i,1+j,k,1)-U(1+i & ,2+j,k,1))/(2.d0*hy))/2.d0 else dudye=(-U(i,-1+j,k,1)+U(i,1+j,k,1)-U(1+i,-1+j,k,1) & +U(1+i,1+j,k,1))/(4.d0*hy) endif dudyw=tranderw(-1+i,j,k,1,2) dwdyb=tranderb(i,j,-1+k,3,2) if(masks(i,-1+j,k).gt.0.or.masks(i,-1+j,1+k).gt.0) then dwdyt=((-3*U(i,j,k,3)+4*U(i,1+j,k,3)-U(i,2+j,k,3)) & /(2.d0*hy)+(-3*U(i,j,1+k,3)+4*U(i,1+j,1+k,3)-U(i,2 & +j,1+k,3))/(2.d0*hy))/2.d0 else dwdyt=(-U(i,-1+j,k,3)-U(i,-1+j,1+k,3)+U(i,1+j,k,3) & +U(i,1+j,1+k,3))/(4.d0*hy) endif dudzw=tranderw(-1+i,j,k,1,3) if(maskb(i,j,-1+k).gt.0.or.maskb(1+i,j,-1+k).gt.0) then dudze=((-3*U(i,j,k,1)+4*U(i,j,1+k,1)-U(i,j,2+k,1)) & /(2.d0*hz)+(-3*U(1+i,j,k,1)+4*U(1+i,j,1+k,1)-U(1+i & ,j,2+k,1))/(2.d0*hz))/2.d0 else dudze=(-U(i,j,-1+k,1)+U(i,j,1+k,1)-U(1+i,j,-1+k,1) & +U(1+i,j,1+k,1))/(4.d0*hz) endif dvdzs=tranders(i,-1+j,k,2,3) if(maskb(i,j,-1+k).gt.0.or.maskb(i,1+j,-1+k).gt.0) then dvdzn=((-3*U(i,j,k,2)+4*U(i,j,1+k,2)-U(i,j,2+k,2)) & /(2.d0*hz)+(-3*U(i,1+j,k,2)+4*U(i,1+j,1+k,2)-U(i,1 & +j,2+k,2))/(2.d0*hz))/2.d0 else dvdzn=(-U(i,j,-1+k,2)+U(i,j,1+k,2)-U(i,1+j,-1+k,2) & +U(i,1+j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression out(i,j,k,1) = -((beta*(hy*hz*(-2*dudxw*muX(i,j,k)+2*dudxe*muX(1+i,j,k))+ & hx*hz*(-((dudys+dvdxs)*muY(i,j,k))+(dudyn+dvdxn)*m & uY(i,1+j,k))+hx*hy*(-((dudzb+dwdxb)*muZ(i,j,k))+(d & udzt+dwdxt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,1) out(i,j,k,2) = -((beta*(hy*hz*(-((dudyw+dvdxw)*muX(i,j,k))+(dudye+dvdxe)* & muX(1+i,j,k))+hx*hz*(-2*dvdys*muY(i,j,k)+2*dvdyn*m & uY(i,1+j,k))+hx*hy*(-((dvdzb+dwdyb)*muZ(i,j,k))+(d & vdzt+dwdyt)*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,2) out(i,j,k,3) = -((beta*(hy*hz*(-((dudzw+dwdxw)*muX(i,j,k))+(dudze+dwdxe)* & muX(1+i,j,k))+hx*hz*(-((dvdzs+dwdys)*muY(i,j,k))+( & dvdzn+dwdyn)*muY(i,1+j,k))+hx*hy*(-2*dwdzb*muZ(i,j & ,k)+2*dwdzt*muZ(i,j,1+k))))/(hx*hy*hz))+alpha*a(i, & j,k)*u(i,j,k,3) return end ccseapps-2.5/CCSEApps/tensorMG/MCMultiGrid.cpp0000644000175000017500000003032411634153073022243 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MCMultiGrid.cpp,v 1.12 2001/08/09 22:42:01 marc Exp $ // #include #include #include #include #include #include #include #include "MG_F.H" #include "MCMultiGrid.H" const char NL = '\n'; bool MCMultiGrid::initialized = false; int MCMultiGrid::def_nu_0 = 1; int MCMultiGrid::def_nu_1 = 2; int MCMultiGrid::def_nu_2 = 2; int MCMultiGrid::def_nu_f = 8; int MCMultiGrid::def_maxiter = 40; int MCMultiGrid::def_numiter = -1; int MCMultiGrid::def_verbose = 0; int MCMultiGrid::def_usecg = 1; Real MCMultiGrid::def_rtol_b = 0.01; Real MCMultiGrid::def_atol_b = -1.0; int MCMultiGrid::def_nu_b = 0; int MCMultiGrid::def_numLevelsMAX = 1024; void MCMultiGrid::initialize () { ParmParse pp("mg"); initialized = true; pp.query("maxiter", def_maxiter); pp.query("numiter", def_numiter); pp.query("nu_0", def_nu_0); pp.query("nu_1", def_nu_1); pp.query("nu_2", def_nu_2); pp.query("nu_f", def_nu_f); pp.query("v", def_verbose); pp.query("usecg", def_usecg); pp.query("rtol_b", def_rtol_b); pp.query("bot_atol", def_atol_b); pp.query("nu_b", def_nu_b); pp.query("numLevelsMAX", def_numLevelsMAX); if (ParallelDescriptor::IOProcessor() && def_verbose) { std::cout << "def_nu_0 = " << def_nu_0 << NL; std::cout << "def_nu_1 = " << def_nu_1 << NL; std::cout << "def_nu_2 = " << def_nu_2 << NL; std::cout << "def_nu_f = " << def_nu_f << NL; std::cout << "def_maxiter = " << def_maxiter << NL; std::cout << "def_usecg = " << def_usecg << NL; std::cout << "def_rtol_b = " << def_rtol_b << NL; std::cout << "def_atol_b = " << def_atol_b << NL; std::cout << "def_nu_b = " << def_nu_b << NL; std::cout << "def_numLevelsMAX = " << def_numLevelsMAX << NL; } } MCMultiGrid::MCMultiGrid (MCLinOp &_Lp) : Lp(_Lp), initialsolution(0) { if (!initialized) initialize(); maxiter = def_maxiter; numiter = def_numiter; nu_0 = def_nu_0; nu_1 = def_nu_1; nu_2 = def_nu_2; nu_f = def_nu_f; usecg = def_usecg; verbose = def_verbose; rtol_b = def_rtol_b; atol_b = def_atol_b; nu_b = def_nu_b; numLevelsMAX = def_numLevelsMAX; numlevels = numLevels(); numcomps = _Lp.numberComponents(); } MCMultiGrid::~MCMultiGrid () { delete initialsolution; for (int i = 0; i < cor.size(); ++i) { delete res[i]; delete rhs[i]; delete cor[i]; } } Real MCMultiGrid::errorEstimate (int level, MCBC_Mode bc_mode) { // // Get inf-norm of residual. // int p = 0; Lp.residual(*res[level], *rhs[level], *cor[level], level, bc_mode); Real restot = 0.0; Real resk = 0.0; const BoxArray& gbox = Lp.boxArray(0); for (MFIter resmfi(*res[level]); resmfi.isValid(); ++resmfi) { BL_ASSERT(gbox[resmfi.index()] == resmfi.validbox()); resk = (*res[level])[resmfi].norm(resmfi.validbox(),p,0,numcomps); restot = std::max(restot, resk); } ParallelDescriptor::ReduceRealMax(restot); return restot; } void MCMultiGrid::prepareForLevel (int level) { // // Build this level by allocating reqd internal MultiFabs if necessary // if (cor.size() > level) return; res.resize(level+1, (MultiFab*)0); rhs.resize(level+1, (MultiFab*)0); cor.resize(level+1, (MultiFab*)0); Lp.prepareForLevel(level); if (cor[level] == 0) { res[level] = new MultiFab(Lp.boxArray(level),numcomps,1); rhs[level] = new MultiFab(Lp.boxArray(level),numcomps,1); cor[level] = new MultiFab(Lp.boxArray(level),numcomps,1); if (level == 0) { initialsolution = new MultiFab(Lp.boxArray(0), numcomps, 1); } } } void MCMultiGrid::residualCorrectionForm (MultiFab& resL, const MultiFab& rhsL, MultiFab& solnL, const MultiFab& inisol, MCBC_Mode bc_mode, int level) { // // Using the linearity of the operator, Lp, we can solve this system // instead by solving for the correction required to the initial guess. // initialsolution->copy(inisol); solnL.copy(inisol); Lp.residual(resL, rhsL, solnL, level, bc_mode); solnL.setVal(0.0); } void MCMultiGrid::solve (MultiFab& _sol, const MultiFab& _rhs, Real _eps_rel, Real _eps_abs, MCBC_Mode bc_mode) { BL_ASSERT(numcomps == _sol.nComp()); // // Prepare memory for new level, and solve the general boundary // value problem to within relative error _eps_rel. Customized // to solve at level=0 // int level = 0; prepareForLevel(level); residualCorrectionForm(*rhs[level],_rhs,*cor[level],_sol,bc_mode,level); if (!solve_(_sol, _eps_rel, _eps_abs, MCHomogeneous_BC, level)) BoxLib::Error("MCMultiGrid::solve(): failed to converge!"); } int MCMultiGrid::solve_ (MultiFab& _sol, Real eps_rel, Real eps_abs, MCBC_Mode bc_mode, int level) { // // Relax system maxiter times, stop if relative error <= _eps_rel or // if absolute err <= _abs_eps // int returnVal = 0; // should use bool for return value from this function Real error0 = errorEstimate(level, bc_mode); Real error = error0; if (verbose && ParallelDescriptor::IOProcessor()) { for (int k = 0; k < level; k++) std::cout << " "; std::cout << "MCMultiGrid: Initial error (error0) = " << error0 << NL; } if (eps_rel < 1.0e-16 && eps_rel > 0.0 && ParallelDescriptor::IOProcessor()) { std::cout << "MCMultiGrid: Tolerance " << eps_rel << " < 1e-16 is probably set too low" << NL; } int nit; // // Initialize correction to zero at this level (auto-filled at levels below) // (*cor[level]).setVal(0.0); // // Note: if eps_rel, eps_abs < 0 then that test is effectively bypassed. // for (nit = 0; (nit < maxiter) && (nit < numiter || numiter < 0) && (error > eps_rel*error0) && (error > eps_abs); ++nit) { relax(*cor[level], *rhs[level], level, eps_rel, eps_abs, bc_mode); error = errorEstimate(level, bc_mode); if (verbose > 1 || (((eps_rel > 0. && error < eps_rel*error0) || (eps_abs > 0. && error < eps_abs)) && verbose) ) { if (ParallelDescriptor::IOProcessor()) { for (int k = 0; k < level; k++) std::cout << " "; std::cout << "MCMultiGrid: Iteration " << nit << " error/error0 " << error/error0 << NL; } } } if (nit == numiter || error <= eps_rel*error0 || error <= eps_abs) { // // Omit ghost update since maybe not initialized in calling routine. // BoxLib_1.99 has no MultiFab::plus(MultiFab&) member, which would // operate only in valid regions; do explicitly. Add to boundary // values stored in initialsolution. // _sol.copy(*cor[level]); _sol.plus(*initialsolution,0,_sol.nComp(),0); returnVal = 1; } // // Otherwise, failed to solve satisfactorily. // return returnVal; } int MCMultiGrid::getNumLevels (int _numlevels) { BL_ASSERT(_numlevels >= 0); int oldnumlevels = numlevels; numlevels = std::min(_numlevels, numLevels()); return oldnumlevels; } int MCMultiGrid::numLevels () const { int ng = Lp.numGrids(); int lv = numLevelsMAX; // // The routine `falls through' since coarsening and refining // a unit box does not yield the initial box. // const BoxArray &bs = Lp.boxArray(0); for (int i = 0; i < ng; ++i) { int llv = 0; Box tmp = bs[i]; if (tmp.shortside() <= 3 ) BoxLib::Error("MCMultiGrid::numLevels(): fine grid too small"); for (;;) { Box ctmp = tmp; ctmp.coarsen(2); Box rctmp = ctmp; rctmp.refine(2); if (tmp != rctmp) break; if (ctmp.numPts() == 1) break; // // wyc -- change so grid does not get too small // wyc -- this is necessary for one-sided derivs in tensor-solve // wyc -- when BBMGoUR is implemented, this will only be // wyc -- necessary on finest level // if (ctmp.shortside() <= 3) break; llv++; tmp = ctmp; } // // Set number of levels so that every box can be refined to there. // lv = (lv < llv)? lv : llv; } return lv+1; // including coarsest } void MCMultiGrid::relax (MultiFab& solL, MultiFab& rhsL, int level, Real eps_rel, Real eps_abs, MCBC_Mode bc_mode) { // // Recursively relax system. Equivalent to multigrid V-cycle. // At coarsest grid, call coarsestSmooth. // if (level < numlevels - 1 ) { for (int i = preSmooth() ; i > 0 ; i--) Lp.smooth(solL, rhsL, level, bc_mode); Lp.residual(*res[level], rhsL, solL, level, bc_mode); prepareForLevel(level+1); average(*rhs[level+1], *res[level]); cor[level+1]->setVal(0.0); for (int i = cntRelax(); i > 0 ; i--) relax(*cor[level+1],*rhs[level+1],level+1,eps_rel,eps_abs,bc_mode); interpolate(solL, *cor[level+1]); for (int i = postSmooth(); i > 0 ; i--) Lp.smooth(solL, rhsL, level, bc_mode); } else { coarsestSmooth(solL, rhsL, level, eps_rel, eps_abs, bc_mode); } } void MCMultiGrid::coarsestSmooth (MultiFab& solL, MultiFab& rhsL, int level, Real eps_rel, Real eps_abs, MCBC_Mode bc_mode) { prepareForLevel(level); if (usecg == 0) { for (int i = finalSmooth(); i > 0; i--) Lp.smooth(solL, rhsL, level, bc_mode); } else { bool use_mg_precond = false; MCCGSolver cg(Lp, use_mg_precond, level); cg.solve(solL, rhsL, rtol_b, atol_b, bc_mode); for(int i=0; i #include //@Man: /*@Memo: A DivVis tailors the description of a linear operator to apply the second-order central difference approximation to the differential operator, alpha*a(x).u(x) - beta*div[tau(u(x))], on a cell-centered MultiFab, u(x). Here, alpha and beta are constants, a(x) is a cell-centered MultiFab, and b(x) is a vector of wall-centered MultiFabs, 1 per dimension. u(x) can have multiple components, but all coefficient info is scalar, and norm reports on ALL components together. tau is a three by three tensor b(x)*(u_{i,j}+u_{j,i}) */ /*@Doc: A DivVis tailors a LinOp (a virtual base class for general linear operators) to compute the second-order central difference approximation to the differential operator, \begin{center} alpha*a(x).u(x) - beta*div[tau(u(x))], \end{center} on a cell-centered MultiFab, u(x). Here, alpha and beta are constants, a(x) is a cell-centered MultiFab, and b(x) is a vector of wall-centered MultiFabs, 1 per dimension. u(x) can have multiple components, but all coefficient info is scalar, and norm reports on ALL components together. Tau is the 3 by 3 tensor \begin{center} b(x)*(u_{i,j}+u_{j,i}) \end{center} This class provides the necessary implementations for applying the operator, and for smoothing a guessed solution to the linear equation system, L(u(x)) = rhs (where rhs is another cell-centered MultiFab). This class also provides access functions to set/control the coefficient MultiFabs a and b, as well as the scalars, alpha and beta. These customizations are designed for 2D and 3D, with constant (but not necessarily equal) mesh spacing in each direction. Application of the operator and smoothing are "level" operations, and therefore must access "hidden" level data (such as boundary conditions, etc) as required, in concert with the semantics of the underlying LinOp defintions. Accordingly, these implementations are "protected" and called only by the publically accessible members of the virtual base class, LinOp. Note that these implementations may therefore assume that boundary (ghost) nodes and other pertinent information are filled properly by the base class functions prior to call. Defaults are as follows for the coefficients: \begin{itemize} \item alpha = 1.0 \item beta = 1.0 \item a (MultiFab) = 0.0 \item b (MultiFab) = 1.0 \end{itemize} */ class DivVis : public MCLinOp { public: // //@ManDoc: constructor for box array, boundary data and scalar mesh spacing // DivVis (const BndryData& bd, Real _h); // //@ManDoc: constructor for box array, boundary data and vector mesh spacing // DivVis (const BndryData& bd, const Real* _h); // //@ManDoc: destructor // virtual ~DivVis (); // //@ManDoc: set scalar coefficients // void setScalars (Real _alpha, Real _beta); // //@ManDoc: get scalar alpha coefficient // Real get_alpha () const; // //@ManDoc: get scalar beta coefficient // Real get_beta () const; // //@ManDoc: return reference to "a" coefficients for base level // const MultiFab& aCoefficients (int level = 0); // //@ManDoc: return reference to "b" coefficients for base level // const MultiFab& bCoefficients (int dir, int level = 0); // //@ManDoc: copy _a into "a" coeffs for base level // void aCoefficients (const MultiFab& _a); // //@ManDoc: copy _b into "b" coeffs in "dir" coordinate direction for base level // void bCoefficients (const MultiFab& _b, int dir); // //@ManDoc: alternative (older) version of above members // void setCoefficients (const MultiFab &_a, const MultiFab &_bX, const MultiFab &_bY #if BL_SPACEDIM==3 ,const MultiFab &_bZ #endif ); // //@ManDoc: collective version of above members (taking an array of MultiFabs for "b") // void setCoefficients (const MultiFab& _a, const MultiFab* _b); // //@ManDoc: allocate/fill internal data for new level // virtual void prepareForLevel (int level); // //@ManDoc: remove internal data for this level and all levels above // virtual void clearToLevel (int level); // //@ManDoc: set flags so that a coeffs at lev and coarser require recalculation // void invalidate_a_to_level (int lev); // //@ManDoc: set flags so that b coeffs at lev and coarser require recalculation // void invalidate_b_to_level (int lev); // //@ManDoc: computes flux associated with operator // void compFlux (MultiFab &xflux, MultiFab &yflux, #if BL_SPACEDIM>2 MultiFab &zflux, #endif MultiFab& in); protected: // //@ManDoc: initialize a full set (a,b) of coefficients on the box array // void initCoefficients (const BoxArray &_ba); // //@ManDoc: compute out=L (in) at level=level // virtual void Fapply (MultiFab& out, const MultiFab& in, int level); // //@ManDoc: apply smoother to improve residual to L(solnL)=rhsL // virtual void Fsmooth (MultiFab& solnL, const MultiFab& rhsL, int level, int phaseflag); // //@ManDoc: return number of components. This is virtual since only the derived knows // virtual int numberComponents (); // //@ManDoc: number of relaxation phases. On derived class knows. // virtual int numberPhases (); // //@ManDoc: Helper function for object construction // void initConstruct (const Real* _h); protected: // //@ManDoc: Array (on level) of "a" coefficients // Array< MultiFab* > acoefs; // //@ManDoc: Array (on level) of Tuple (on dimension) of "b" coefficients // Array< Tuple< MultiFab*, BL_SPACEDIM> > bcoefs; // //@ManDoc: Scalar "alpha" coefficient // Real alpha; // //@ManDoc: Scalar "beta" coefficient // Real beta; private: // // Flag, can a coeffs be trusted at a level. // std::vector a_valid; // Flag, can b coeffs be trusted at a level. // std::vector b_valid; // // Default value for a (MultiFab) coeficient. // static Real a_def; // // Default value for b (MultiFab) coeficient. // static Real b_def; // // Default value for alpha (scalar) coeficient. // static Real alpha_def; // // Default value for beta (scalar) coeficient. // static Real beta_def; // // Disallow copy constructors (for now...to be fixed). // DivVis (const DivVis&); DivVis& operator = (const DivVis&); }; inline Real DivVis::get_alpha () const { return alpha; } inline Real DivVis::get_beta () const { return beta; } inline void DivVis::setCoefficients (const MultiFab &_a, const MultiFab &_bX, const MultiFab &_bY #if BL_SPACEDIM==3 ,const MultiFab &_bZ #endif ) { aCoefficients(_a); bCoefficients(_bX, 0); bCoefficients(_bY, 1); #if BL_SPACEDIM==3 bCoefficients(_bZ, 2); #endif } inline void DivVis::setCoefficients (const MultiFab& _a, const MultiFab* _b) { aCoefficients(_a); for (int n = 0; n < BL_SPACEDIM; ++n) bCoefficients(_b[n], n); } #endif /*_DivVis_H_*/ ccseapps-2.5/CCSEApps/tensorMG/Test/0000755000175000017500000000000011634153073020334 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/tensorMG/Test/Make.package0000644000175000017500000000042711634153073022531 0ustar amckinstryamckinstry# # tensorMG test sources # CEXE_sources += TestMCViscBndry.cpp testVI.cpp CEXE_headers += TestMCViscBndry.H FEXE_sources += main_$(DIM)D.F FEXE_headers += main_F.H INCLUDE_LOCATIONS += . # # utility stuff # CEXE_sources += WritePlotFile.cpp CEXE_headers += WritePlotfile.H ccseapps-2.5/CCSEApps/tensorMG/Test/main_2D.F0000644000175000017500000002135611634153073021723 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include "main_F.H" #if 0 c .. 1 is 0 c .. 2 is x c .. 3 is xy #define DOGU 1 c .. 1 is y**2 c .. 2 is y c .. 3 is (24-y)**2 c .. 4 is 0 c .. 5 is x**2 #define DOGV 1 subroutine FORT_FILLCRSE ( $ crse, DIMS(crse), $ h, nc $ ) integer nc integer DIMDEC(crse) REAL_T crse(DIMV(crse),nc) REAL_T h(BL_SPACEDIM) c integer i, j, n REAL_T x, y c do n=1,nc if( n .eq. 1 ) then do j=ARG_L2(crse), ARG_H2(crse) y = (j + 0.5)*h(2) do i=ARG_L1(crse), ARG_H1(crse) x = (i + 0.5)*h(1) #if DOGU==1 crse(i,j,n)=0 #elif DOGU==2 crse(i,j,n)=x #elif DOGU==3 crse(i,j,n)=x*y #else error is error #endif enddo enddo else do j=ARG_L2(crse), ARG_H2(crse) y = (j + 0.5)*h(2) do i=ARG_L1(crse), ARG_H1(crse) x = (i + 0.5)*h(1) #if DOGV==1 crse(i,j,n)=y*y #elif DOGV==2 crse(i,j,n)=y #elif DOGV==3 crse(i,j,n)=(24-y)*(24-y) #elif DOGV==4 crse(i,j,n)=0 #elif DOGV==5 crse(i,j,n)=x*x #else error is error #endif enddo enddo endif enddo end subroutine FORT_FILLFINE ( $ fine, DIMS(fine), $ h, nc $ ) integer nc integer DIMDEC(fine) REAL_T fine(DIMV(fine),nc) REAL_T h(BL_SPACEDIM) c integer i, j, n REAL_T x, y c do n=1,nc if( n .eq. 1 ) then do j=ARG_L2(fine), ARG_H2(fine) y = (j + 0.5)*h(2) do i=ARG_L1(fine), ARG_H1(fine) x = (i + 0.5)*h(1) if( x .gt. 0 ) then #if DOGU==1 fine(i,j,n)=0 #elif DOGU==2 fine(i,j,n)=x #elif DOGU==3 fine(i,j,n)=x*y #else error is error #endif else c....................at physical boundary, use homog bc fine(i,j,n) = 0 endif enddo enddo else do j=ARG_L2(fine), ARG_H2(fine) y = (j + 0.5)*h(2) do i=ARG_L1(fine), ARG_H1(fine) x = (i + 0.5)*h(1) if( x .gt. 0 ) then #if DOGV==1 fine(i,j,n)=y*y #elif DOGV==2 fine(i,j,n)=y #elif DOGV==3 fine(i,j,n)=(24-y)*(24-y) #elif DOGV==4 fine(i,j,n)=0 #elif DOGV==5 fine(i,j,n)=x*x #else error is error #endif else fine(i,j,n) = 0 endif enddo enddo endif enddo end #else #define TEST_EXT 0 #define POWER 3 #define MUPOWER 3 subroutine FORT_FILLCRSE ( $ crse, DIMS(crse), $ h, nc $ ) integer nc integer DIMDEC(crse) REAL_T crse(DIMV(crse),nc) REAL_T h(BL_SPACEDIM) c integer i, j, n REAL_T x, y REAL_T cux,cuy,cuz REAL_T cvx,cvy,cvz REAL_T cwx,cwy,cwz REAL_T alpha,beta,gamma namelist /fortin/ cux,cuy,cuz, $ cvx,cvy,cvz,cwx,cwy,cwz,alpha,beta,gamma c open(9,file='probin',form='formatted',status='old') read(9,fortin) close(9) do j=ARG_L2(crse), ARG_H2(crse) y = (j + 0.5)*h(2) do i=ARG_L1(crse), ARG_H1(crse) x = (i + 0.5)*h(1) crse(i,j,1)=cux*x**POWER+cuy*y**POWER crse(i,j,2)=cvx*x**POWER+cvy*y**POWER enddo enddo end subroutine FORT_FILLFINE ( $ fine, DIMS(fine), $ h, nc $ ) integer nc integer DIMDEC(fine) REAL_T fine(DIMV(fine),nc) REAL_T h(BL_SPACEDIM) c integer i, j, n REAL_T x, y c REAL_T cux,cuy,cuz REAL_T cvx,cvy,cvz REAL_T cwx,cwy,cwz REAL_T alpha,beta,gamma namelist /fortin/ cux,cuy,cuz, $ cvx,cvy,cvz,cwx,cwy,cwz,alpha,beta,gamma c open(9,file='probin',form='formatted',status='old') read(9,fortin) close(9) c do j=ARG_L2(fine), ARG_H2(fine) y = (j + 0.5)*h(2) #if TEST_EXT if( j.lt.0) y = 0 #endif do i=ARG_L1(fine), ARG_H1(fine) x = (i + 0.5)*h(1) #if TEST_EXT if( i.lt.0) x = 0 #endif fine(i,j,1)=cux*x**POWER+cuy*y**POWER fine(i,j,2)=cvx*x**POWER+cvy*y**POWER enddo enddo end subroutine FORT_FILLRHS ( $ rhs, DIMS(rhs), $ h, nc $ ) integer nc integer DIMDEC(rhs) REAL_T rhs(DIMV(rhs),nc) REAL_T h(BL_SPACEDIM) c integer i, j, n REAL_T x, y c REAL_T cux,cuy,cuz REAL_T cvx,cvy,cvz REAL_T cwx,cwy,cwz REAL_T alpha,beta,gamma namelist /fortin/ cux,cuy,cuz, $ cvx,cvy,cvz,cwx,cwy,cwz,alpha,beta,gamma c open(9,file='probin',form='formatted',status='old') read(9,fortin) close(9) c do j=ARG_L2(rhs), ARG_H2(rhs) y = (j + 0.5)*h(2) do i=ARG_L1(rhs), ARG_H1(rhs) x = (i + 0.5)*h(1) #if (POWER==3)&(MUPOWER==3) rhs(i,j,1)= -( - 18*alpha*cux*x**4 + 3*beta*y**2*(3*cvx*x**2 + 3*cuy*y**2) + - 12*cux*x*(1 + alpha*x**3 + beta*y**3) + - 6*cuy*y*(1 + alpha*x**3 + beta*y**3) & ) rhs(i,j,2)= -( - 18*beta*cvy*y**4 + 3*alpha*x**2*(3*cvx*x**2 + 3*cuy*y**2) + - 6*cvx*x*(1 + alpha*x**3 + beta*y**3) + - 12*cvy*y*(1 + alpha*x**3 + beta*y**3) & ) #endif #if (POWER==2)&(MUPOWER==3) rhs(i,j,1)= -( - 12*alpha*cux*x**3 + 3*beta*y**2*(2*cvx*x + 2*cuy*y) + - 4*cux*(1 + alpha*x**3 + beta*y**3) + - 2*cuy*(1 + alpha*x**3 + beta*y**3) & ) rhs(i,j,2)= -( - 12*beta*cvy*y**3 + 3*alpha*x**2*(2*cvx*x + 2*cuy*y) + - 2*cvx*(1 + alpha*x**3 + beta*y**3) + - 4*cvy*(1 + alpha*x**3 + beta*y**3) & ) #endif enddo enddo end subroutine FORT_MAKEMU( $ mu,DIMS(mu), $ h, idir ) integer idir integer DIMDEC(mu) REAL_T mu(DIMV(mu)) REAL_T h(BL_SPACEDIM) integer i,j REAL_T x,y c REAL_T cux,cuy,cuz REAL_T cvx,cvy,cvz REAL_T cwx,cwy,cwz REAL_T alpha,beta,gamma namelist /fortin/ cux,cuy,cuz, $ cvx,cvy,cvz,cwx,cwy,cwz,alpha,beta,gamma c open(9,file='probin',form='formatted',status='old') read(9,fortin) close(9) c if( idir .eq. 0 ) then do j=ARG_L2(mu),ARG_H2(mu) y = (j+0.5)*h(2) do i=ARG_L1(mu),ARG_H1(mu) x = (i)*h(1) mu(i,j) = 1+alpha*x**MUPOWER+beta*y**MUPOWER enddo enddo else if( idir .eq. 1 ) then do j=ARG_L2(mu),ARG_H2(mu) y = (j)*h(2) do i=ARG_L1(mu),ARG_H1(mu) x = (i+0.5)*h(1) mu(i,j) = 1+alpha*x**MUPOWER+beta*y**MUPOWER enddo enddo else write(6,*)'FORT_MAKEMU: bad idir' stop endif return end #endif ccseapps-2.5/CCSEApps/tensorMG/Test/GNUmakefile0000644000175000017500000000461511634153073022414 0ustar amckinstryamckinstryPRECISION = DOUBLE DEBUG = FALSE DEBUG = TRUE PROFILE = FALSE DIM = 3 DIM = 2 COMP = KCC PBOXLIB_HOME = ../.. USE_MPI = FALSE USE_NETCDF=FALSE USE_ARRAYVIEW = FALSE USE_ARRAYVIEW = TRUE EBASE = mcmg LBASE = HERE = . include $(PBOXLIB_HOME)/mk/Make.defs include $(HERE)/Make.package # Get BoxLib stuff INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/include LIBRARY_LOCATIONS += $(PBOXLIB_HOME)/lib/$(machineSuffix) LIBRARIES += -lmcmg$(DIM)d -lmg$(DIM)d -lamr$(DIM)d -lbndry$(DIM)d -lbox$(DIM)d ifeq ($(DEBUG),TRUE) ifeq ($(USE_ARRAYVIEW),TRUE) ARRAYVIEWDIR = $(PBOXLIB_HOME)/ArrayView LIBRARY_LOCATIONS += $(ARRAYVIEWDIR) LIBRARIES += -larrayview$(optionsSuffix) DEFINES += -DBL_USE_ARRAYVIEW endif INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/util CEXE_headers += TV_TempWrite.H endif ifeq ($(USE_NETCDF),TRUE) LIBRARIES += /usr/people/stevens/bin/libnetcdf.a INCLUDE_LOCATIONS += /usr/people/stevens/bin endif ###### exception library (for newest bsplib) ifeq ($(MACHINE), OSF1) LIBRARY_LOCATIONS += /usr/ccs/lib/cmplrs/cc LIBRARIES += -lexc endif 3RD = 1 3RD= ifdef 3RD # FOR RUNNING 3RD ONLY LDFLAGS += --link_command_prefix 3rd #CXXDEBF = +K0 --link_command_prefix 3rd -non_shared LDFLAGS += -non_shared -v #LIBRARIES += -ldnet_stub #FDEBF += -automatic # FOR RUNNING 3RD ONLY endif CXXFLAGS += CXXOPTF += CXXDEBF += CFLAGS += COPTF += CDEBF += FOPTF = -fast all: $(executable) $(executable): $(LIBRARIES) libs: cd $(PBOXLIB_HOME)/pBoxLib_2; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install cd $(PBOXLIB_HOME)/bndrylib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install cd $(PBOXLIB_HOME)/amrlib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install cd $(PBOXLIB_HOME)/mglib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install cd $(PBOXLIB_HOME)/tensorMG; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install ifdef USE_ARRAYVIEW cd $(ARRAYVIEWDIR); $(MAKE) -f GNUmakefile.arrayviewlib PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) endif vpath %.cpp : . .. vpath %.F : . .. vpath %.a $(LIBRARY_LOCATIONS) include $(PBOXLIB_HOME)/mk/Make.rules ccseapps-2.5/CCSEApps/tensorMG/Test/TestMCViscBndry.H0000644000175000017500000000355711634153073023442 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MCVISCBNDRY_H_ #define _MCVISCBNDRY_H_ #include #include class MCViscBndry : public MCInterpBndryData { public: MCViscBndry() : MCInterpBndryData() {} MCViscBndry(const BoxArray& _grids, const Geometry& geom) : #if BL_SPACEDIM == 2 MCInterpBndryData(_grids,4,geom) {}; #elif BL_SPACEDIM == 3 MCInterpBndryData(_grids,3*(1+3),geom) {}; #endif virtual void setBndryConds (const BCRec& phys_bc, int ratio, int comp=0); void setHomogValues(); }; #endif ccseapps-2.5/CCSEApps/tensorMG/Test/inputs0000644000175000017500000000033211634153073021577 0ustar amckinstryamckinstrygeometry.coord_sys = 0 # 0 => cart, 1 => RZ geometry.prob_lo = -0.0625 -0.0625 -0.0625 geometry.prob_hi = 1.0625 1.0625 1.0625 cg.v = 2 cg.maxiter = 500 mg.v = 2 mg.usecg = 0 boxes = grids/gr16.dog ccseapps-2.5/CCSEApps/tensorMG/Test/main_3D.F0000644000175000017500000002023411634153073021716 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include "main_F.H" #define TEST_EXT 1 #define POWER 3 #define MUPOWER 3 subroutine FORT_FILLCRSE ( $ crse, DIMS(crse), $ h, nc $ ) integer nc integer DIMDEC(crse) REAL_T crse(DIMV(crse),nc) REAL_T h(BL_SPACEDIM) c integer i, j, k, n REAL_T x, y, z REAL_T cux,cuy,cuz REAL_T cvx,cvy,cvz REAL_T cwx,cwy,cwz REAL_T alpha,beta,gamma namelist /fortin/ cux,cuy,cuz, $ cvx,cvy,cvz,cwx,cwy,cwz,alpha,beta,gamma c open(9,file='probin',form='formatted',status='old') read(9,fortin) close(9) do k=ARG_L3(crse), ARG_H3(crse) z = (k+0.5)*h(3) do j=ARG_L2(crse), ARG_H2(crse) y = (j + 0.5)*h(2) do i=ARG_L1(crse), ARG_H1(crse) x = (i + 0.5)*h(1) crse(i,j,k,1)=cux*x**POWER+cuy*y**POWER+cuz*z**POWER crse(i,j,k,2)=cvx*x**POWER+cvy*y**POWER+cvz*z**POWER crse(i,j,k,3)=cwx*x**POWER+cwy*y**POWER+cwz*z**POWER enddo enddo enddo end subroutine FORT_FILLFINE ( $ fine, DIMS(fine), $ h, nc $ ) integer nc integer DIMDEC(fine) REAL_T fine(DIMV(fine),nc) REAL_T h(BL_SPACEDIM) c integer i, j, k, n REAL_T x, y,z c REAL_T cux,cuy,cuz REAL_T cvx,cvy,cvz REAL_T cwx,cwy,cwz REAL_T alpha,beta,gamma namelist /fortin/ cux,cuy,cuz, $ cvx,cvy,cvz,cwx,cwy,cwz,alpha,beta,gamma c open(9,file='probin',form='formatted',status='old') read(9,fortin) close(9) c do k=ARG_L3(fine), ARG_H3(fine) z = (k + 0.5)*h(3) #if TEST_EXT if( k.lt.0) z = 0 #endif do j=ARG_L2(fine), ARG_H2(fine) y = (j + 0.5)*h(2) #if TEST_EXT if( j.lt.0) y = 0 #endif do i=ARG_L1(fine), ARG_H1(fine) x = (i + 0.5)*h(1) #if TEST_EXT if( i.lt.0) x = 0 #endif fine(i,j,k,1)=cux*x**POWER+cuy*y**POWER+cuz*z**POWER fine(i,j,k,2)=cvx*x**POWER+cvy*y**POWER+cvz*z**POWER fine(i,j,k,3)=cwx*x**POWER+cwy*y**POWER+cwz*z**POWER enddo enddo enddo end subroutine FORT_FILLRHS ( $ rhs, DIMS(rhs), $ h, nc $ ) integer nc integer DIMDEC(rhs) REAL_T rhs(DIMV(rhs),nc) REAL_T h(BL_SPACEDIM) c integer i, j, k, n REAL_T x, y,z c REAL_T cux,cuy,cuz REAL_T cvx,cvy,cvz REAL_T cwx,cwy,cwz REAL_T alpha,beta,gamma namelist /fortin/ cux,cuy,cuz, $ cvx,cvy,cvz,cwx,cwy,cwz,alpha,beta,gamma c open(9,file='probin',form='formatted',status='old') read(9,fortin) close(9) c do k=ARG_L3(rhs), ARG_H3(rhs) z = (k + 0.5)*h(3) do j=ARG_L2(rhs), ARG_H2(rhs) y = (j + 0.5)*h(2) do i=ARG_L1(rhs), ARG_H1(rhs) x = (i + 0.5)*h(1) #if (POWER==3)&(MUPOWER==3) rhs(i,j,k,1)= -( - 18*alpha*cux*x**4 + 3*beta*y**2*(3*cvx*x**2 + 3*cuy*y**2) + - 3*gamma*z**2*(3*cwx*x**2 + 3*cuz*z**2) + - 12*cux*x*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 6*cuy*y*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 6*cuz*z*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) & ) rhs(i,j,k,2)= -( - 18*beta*cvy*y**4 + 3*alpha*x**2*(3*cvx*x**2 + 3*cuy*y**2) + - 3*gamma*z**2*(3*cwy*y**2 + 3*cvz*z**2) + - 6*cvx*x*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 12*cvy*y*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 6*cvz*z*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) & ) rhs(i,j,k,3)= -( - 18*cwz*gamma*z**4 + 3*alpha*x**2*(3*cwx*x**2 + 3*cuz*z**2) + - 3*beta*y**2*(3*cwy*y**2 + 3*cvz*z**2) + - 6*cwx*x*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 6*cwy*y*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 12*cwz*z*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) & ) #endif #if (POWER==2)&(MUPOWER==3) rhs(i,j,k,1)= -( - 12*alpha*cux*x**3 + 3*beta*y**2*(2*cvx*x + 2*cuy*y) + - 3*gamma*z**2*(2*cwx*x + 2*cuz*z) + - 4*cux*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 2*cuy*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 2*cuz*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) & ) rhs(i,j,k,2)= -( - 12*beta*cvy*y**3 + 3*alpha*x**2*(2*cvx*x + 2*cuy*y) + - 3*gamma*z**2*(2*cwy*y + 2*cvz*z) + - 2*cvx*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 4*cvy*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 2*cvz*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) & ) rhs(i,j,k,3)= -( - 12*cwz*gamma*z**3 + 3*alpha*x**2*(2*cwx*x + 2*cuz*z) + - 3*beta*y**2*(2*cwy*y + 2*cvz*z) + - 2*cwx*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 2*cwy*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) + - 4*cwz*(1 + alpha*x**3 + beta*y**3 + gamma*z**3) & ) #endif enddo enddo enddo end subroutine FORT_MAKEMU( $ mu,DIMS(mu), $ h, idir ) integer idir integer DIMDEC(mu) REAL_T mu(DIMV(mu)) REAL_T h(BL_SPACEDIM) integer i,j,k REAL_T x,y,z c REAL_T cux,cuy,cuz REAL_T cvx,cvy,cvz REAL_T cwx,cwy,cwz REAL_T alpha,beta,gamma namelist /fortin/ cux,cuy,cuz, $ cvx,cvy,cvz,cwx,cwy,cwz,alpha,beta,gamma c open(9,file='probin',form='formatted',status='old') read(9,fortin) close(9) c if( idir .eq. 0 ) then do k=ARG_L3(mu),ARG_H3(mu) z = (k+0.5)*h(3) do j=ARG_L2(mu),ARG_H2(mu) y = (j+0.5)*h(2) do i=ARG_L1(mu),ARG_H1(mu) x = (i)*h(1) mu(i,j,k) = 1+alpha*x**MUPOWER+beta*y**MUPOWER+gamma*z**MUPOWER enddo enddo enddo else if( idir .eq. 1 ) then do k=ARG_L3(mu),ARG_H3(mu) z = (k+0.5)*h(3) do j=ARG_L2(mu),ARG_H2(mu) y = (j)*h(2) do i=ARG_L1(mu),ARG_H1(mu) x = (i+0.5)*h(1) mu(i,j,k) = 1+alpha*x**MUPOWER+beta*y**MUPOWER+gamma*z**MUPOWER enddo enddo enddo else if( idir .eq. 2 ) then do k=ARG_L3(mu),ARG_H3(mu) z = (k)*h(3) do j=ARG_L2(mu),ARG_H2(mu) y = (j+0.5)*h(2) do i=ARG_L1(mu),ARG_H1(mu) x = (i+0.5)*h(1) mu(i,j,k) = 1+alpha*x**MUPOWER+beta*y**MUPOWER+gamma*z**MUPOWER enddo enddo enddo else write(6,*)'FORT_MAKEMU: bad idir' stop endif return end ccseapps-2.5/CCSEApps/tensorMG/Test/amrvis.defaults0000644000175000017500000000045611634153073023373 0ustar amckinstryamckinstrypalette Palette initialderived state_0 initialscale 8 numberformat %8.5f maxpixmapsize 200000 reservesystemcolors 24 showboxes TRUE windowheight 650 windowwidth 700 filetype newplt fabordering alpha ccseapps-2.5/CCSEApps/tensorMG/Test/dotest0000644000175000017500000000236011634153073021562 0ustar amckinstryamckinstryALPHA=0 BETA=0 GAMMA=1 COM=mcmg3d.OSF1.KCC.ex for i in 1 2 3 4 5 6 7 8 9 do echo " case $i -------------------------- " CUX=0 CUY=0 CUZ=0 CVX=0 CVY=0 CVZ=0 CWX=0 CWY=0 CWZ=0 if test $i = 1 then CUX=1 elif test $i = 2 then CUY=1 elif test $i = 3 then CUZ=1 elif test $i = 4 then CVX=1 elif test $i = 5 then CVY=1 elif test $i = 6 then CVZ=1 elif test $i = 7 then CWX=1 elif test $i = 8 then CWY=1 elif test $i = 9 then CWZ=1 fi # construct probin { echo " \$fortin" echo echo " cux = $CUX" echo " cuy = $CUY" echo " cuz = $CUZ" echo echo " cvx = $CVX" echo " cvy = $CVY" echo " cvz = $CVZ" echo echo " cwx = $CWX" echo " cwy = $CWY" echo " cwz = $CWZ" echo echo " alpha = $ALPHA" echo " beta = $BETA" echo " gamma = $GAMMA" echo echo " \$end" } > probin #${COM} inputs boxes=grids/gr8.dog geometry.prob_lo = "-0.125 -0.125 -0.125" geometry.prob_hi = "1.125 1.125 1.125" | grep n2 ${COM} inputs boxes=grids/gr16.dog geometry.prob_lo = "-0.0625 -0.0625 -0.0625" geometry.prob_hi = "1.0625 1.0625 1.0625" | grep 'n[23]' ${COM} inputs boxes=grids/gr32.dog geometry.prob_lo = "-0.03125 -0.03125 -0.03125" geometry.prob_hi = "1.03125 1.03125 1.03125" | grep 'n[23]' done ccseapps-2.5/CCSEApps/tensorMG/Test/Palette0000644000175000017500000000140011634153073021650 0ustar amckinstryamckinstry #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúöñíéäàÛ×ÓÎÊÅÁ½¸´¯«§¢ž™•‘Œˆƒ #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ccseapps-2.5/CCSEApps/tensorMG/Test/probin0000644000175000017500000000020511634153073021545 0ustar amckinstryamckinstry $fortin cux = 1 cuy = 0 cuz = 0 cvx = 0 cvy = 0 cvz = 0 cwx = 0 cwy = 0 cwz = 1 alpha = 1 beta = 1 gamma = 1 $end ccseapps-2.5/CCSEApps/tensorMG/Test/inputs2D0000644000175000017500000000032411634153073021766 0ustar amckinstryamckinstrygeometry.coord_sys = 0 # 0 => cart, 1 => RZ geometry.prob_lo = 0 0 geometry.prob_hi = 1 1 geometry.is_periodic = 0 1 cg.v = 2 cg.maxiter = 500 mg.v = 2 mg.usecg = 0 cg.maxiter = 500 boxes = grids/gr2D ccseapps-2.5/CCSEApps/tensorMG/Test/inputs3D0000644000175000017500000000030311634153073021764 0ustar amckinstryamckinstrygeometry.coord_sys = 0 # 0 => cart, 1 => RZ geometry.prob_lo = 0 0 0 geometry.prob_hi = 1 1 1 cg.v = 2 cg.maxiter = 500 mg.v = 2 mg.usecg = 0 mg.maxiter = 500 boxes = grids/gr.3_2x3x4 ccseapps-2.5/CCSEApps/tensorMG/Test/inputs80000644000175000017500000000032311634153073021667 0ustar amckinstryamckinstrygeometry.coord_sys = 0 # 0 => cart, 1 => RZ geometry.prob_lo = -0.125 -0.125 -0.125 geometry.prob_hi = 1.125 1.125 1.125 cg.v = 2 cg.maxiter = 500 mg.v = 2 mg.usecg = 0 boxes = grids/gr8.dog ccseapps-2.5/CCSEApps/tensorMG/Test/doit0000644000175000017500000000156111634153073021221 0ustar amckinstryamckinstry: b shell COM=mcmg2d.OSF1.KCC.DEBUG.ex CMP='~wyc/_crimson/_cvsdir/billc/varden/_tensor/_cmp/cmp_fab3d.OSF1.KCC.DEBUG.ex' echo 8 cccccccccccccccc ${COM} inputs boxes=grids/gr8.dog geometry.prob_lo = "-0.125 -0.125 -0.125" geometry.prob_hi = "1.125 1.125 1.125" mv dog.fab dog8.fab echo 16 cccccccccccccccc ${COM} inputs boxes=grids/gr16.dog geometry.prob_lo = "-0.0625 -0.0625 -0.0625" geometry.prob_hi = "1.0625 1.0625 1.0625" mv dog.fab dog16.fab echo 32 cccccccccccccccc ${COM} inputs boxes=grids/gr32.dog geometry.prob_lo = "-0.03125 -0.03125 -0.03125" geometry.prob_hi = "1.03125 1.03125 1.03125" mv dog.fab dog32.fab $CMP -1 dog16.fab dog8.fab $CMP -1 dog32.fab dog16.fab exit 0 echo 64 cccccccccccccccc ${COM} inputs boxes=grids/gr64.dog geometry.prob_lo = "-0.015625 -0.015625 -0.015625" geometry.prob_hi = "1.015625 1.015625 1.015625" mv dog.fab dog64.fab ccseapps-2.5/CCSEApps/tensorMG/Test/testVI.cpp0000644000175000017500000002702011634153073022257 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #ifdef BL_ARCH_CRAY #ifdef BL_USE_DOUBLE #error "DOUBLE PRECISION NOT ALLOWED ON CRAY" #endif #endif #ifndef WIN32 #include #endif #include #include #include #include #include #include #include #ifndef NDEBUG #ifdef BL_USE_ARRAYVIEW #include #endif #include #endif #include #include #include #include #include #include #include using std::setprecision; #ifndef WIN32 using std::set_new_handler; #endif #include #include BoxList readBoxList(aString file, BOX& domain ); int main (int argc, char* argv[]) { // // Make sure to catch new failures. // #ifndef WIN32 set_new_handler(Utility::OutOfMemory); #endif ParallelDescriptor::StartParallel(&argc,&argv); cout << setprecision(10); if(argc < 2) { cerr << "usage: " << argv[0] << " inputsfile [options]" << '\n'; exit(-1); } ParmParse pp(argc-2,argv+2,NULL,argv[1]); // // Initialize random seed after we're running in parallel. // Utility::InitRandom(ParallelDescriptor::MyProc() + 1); #ifndef WIN32 int sleeptime = 0; pp.query("sleep", sleeptime); sleep(sleeptime); #endif TRACER("mcmg"); int n; #if BL_SPACEDIM == 2 Box container(IntVect(0,0),IntVect(11,11)); aString boxfile("gr.2_small_a") ; #elif BL_SPACEDIM == 3 Box container(IntVect(0,0,0),IntVect(11,11,11)); aString boxfile("grids/gr.3_small_a") ; #endif pp.query("boxes", boxfile); BoxArray bs(readBoxList(boxfile,container)); Geometry geom(container); const Real* H = geom.CellSize(); int ratio=2; pp.query("ratio", ratio); // allocate/init soln and rhs int Ncomp=BL_SPACEDIM; int Nghost=0; int Ngrids=bs.length(); MultiFab soln(bs, Ncomp, Nghost, Fab_allocate); soln.setVal(0.0); MultiFab out(bs, Ncomp, Nghost, Fab_allocate); MultiFab rhs(bs, Ncomp, Nghost, Fab_allocate); rhs.setVal(0.0); for(MultiFabIterator rhsmfi(rhs); rhsmfi.isValid(); ++rhsmfi) { FORT_FILLRHS(rhsmfi().dataPtr(), ARLIM(rhsmfi().loVect()),ARLIM(rhsmfi().hiVect()), H,&Ncomp); } // Create the boundary object MCViscBndry vbd(bs,geom); // Create the BCRec's interpreted by ViscBndry objects #if BL_SPACEDIM==2 Array pbcarray(4); pbcarray[0] = BCRec(D_DECL(REFLECT_ODD,REFLECT_EVEN,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[1] = BCRec(D_DECL(REFLECT_EVEN,REFLECT_ODD,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[2] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[3] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); #elif BL_SPACEDIM==3 Array pbcarray(12); #define TEST_EXT 0 #if TEST_EXT pbcarray[0] = BCRec(EXT_DIR,EXT_DIR,EXT_DIR,EXT_DIR,EXT_DIR,EXT_DIR); pbcarray[1] = BCRec(EXT_DIR,EXT_DIR,EXT_DIR,EXT_DIR,EXT_DIR,EXT_DIR); pbcarray[2] = BCRec(EXT_DIR,EXT_DIR,EXT_DIR,EXT_DIR,EXT_DIR,EXT_DIR); #else pbcarray[0] = BCRec(INT_DIR,INT_DIR,INT_DIR,INT_DIR,INT_DIR,INT_DIR); pbcarray[1] = BCRec(INT_DIR,INT_DIR,INT_DIR,INT_DIR,INT_DIR,INT_DIR); pbcarray[2] = BCRec(INT_DIR,INT_DIR,INT_DIR,INT_DIR,INT_DIR,INT_DIR); #endif // the other bc's don't really matter. Just init with anything pbcarray[3] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[4] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[5] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[6] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[7] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[8] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[9] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[10] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); pbcarray[11] = BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR)); #endif Nghost = 1; // need space for bc info MultiFab fine(bs,Ncomp,Nghost,Fab_allocate); for(MultiFabIterator finemfi(fine); finemfi.isValid(); ++finemfi) { FORT_FILLFINE(finemfi().dataPtr(), ARLIM(finemfi().loVect()),ARLIM(finemfi().hiVect()), H,&Ncomp); } // Create "background coarse data" BOX crse_bx = Box(container).coarsen(ratio).grow(1); REAL h_crse[BL_SPACEDIM]; for (n=0; n2 b[2] = 1.0; #endif MultiFab acoefs; int NcompA = (BL_SPACEDIM == 2 ? 2 : 1); acoefs.define(bs, NcompA, Nghost, Fab_allocate); acoefs.setVal(a); MultiFab bcoefs[BL_SPACEDIM]; for (n=0; n> over dimension lp.setCoefficients(acoefs, bcoefs); #if 1 lp.maxOrder(4); #endif Nghost = 1; MultiFab tsoln(bs, Ncomp, Nghost, Fab_allocate); tsoln.setVal(0.0); #if 1 tsoln.copy(fine); #endif #if 0 // testing apply lp.apply(out,tsoln); Box subbox = out[0].box(); REAL n1 = out[0].norm(subbox,1,0,BL_SPACEDIM)*pow(H[0],BL_SPACEDIM); ParallelDescriptor::ReduceRealSum(n1); if (ParallelDescriptor::IOProcessor()) { cout << "n1 output is "<2 BoxArray zfluxbox(bs); zfluxbox.surroundingNodes(2); MultiFab zflux(zfluxbox,Ncomp,Nghost,Fab_allocate); zflux.setVal(1.e30); #endif lp.compFlux(xflux, yflux, #if BL_SPACEDIM>2 zflux, #endif tsoln); // Write fluxes writeMF(&xflux,"xflux.mfab"); writeMF(&yflux,"yflux.mfab"); #if BL_SPACEDIM>2 writeMF(&zflux,"zflux.mfab"); #endif #endif #endif REAL tolerance = 1.0e-10; pp.query("tol", tolerance); REAL tolerance_abs = 1.0e-10; pp.query("tol_abs", tolerance_abs); #if 0 cout << "Bndry Data object:" << endl; cout << lp.bndryData() << endl; #endif #if 0 bool use_mg_pre = false; MCCGSolver cg(lp,use_mg_pre); cg.solve(soln,rhs,tolerance,tolerance_abs); #else MCMultiGrid mg(lp); mg.solve(soln,rhs,tolerance,tolerance_abs); #endif #if 0 cout << "MCLinOp object:" << endl; cout << lp << endl; #endif // Write solution writePlotFile("pltfile",soln,geom,refRatio,bgVal); #if 0 // apply operator to soln to see if really satisfies eqn tsoln.copy(soln); lp.apply(out,tsoln); soln.copy(out); // Output "apply" results on soln writePlotFile("plt_apply",soln,geom,refRatio,bgVal); // Compute truncation for(MultiFabIterator smfi(soln); smfi.isValid(); ++smfi) { DependentMultiFabIterator fmfi(smfi,fine); smfi() -= fmfi(); } for( int icomp=0; icomp < BL_SPACEDIM ; icomp++ ) { Real solnMin = soln.min(icomp); Real solnMax = soln.max(icomp); ParallelDescriptor::ReduceRealMin(solnMin); ParallelDescriptor::ReduceRealMax(solnMax); if (ParallelDescriptor::IOProcessor()) { cout << icomp << " "<> domain; int numbox; boxspec >> numbox; for(int i=0; i> tmpbox; if( ! domain.contains(tmpbox)) { cerr << "readBoxList: bogus box " << tmpbox << endl; exit(1); } retval.append(tmpbox); } boxspec.close(); return retval; } ccseapps-2.5/CCSEApps/tensorMG/Test/vpramps.dat0000644000175000017500000000013611634153073022516 0ustar amckinstryamckinstry1 2 5 0 42 140 220 255 0.0 0.0 0.5 0.8 1.0 4 0 4 128 255 0.0 0.6 0.8 1.0 0.10 0.90 ccseapps-2.5/CCSEApps/tensorMG/Test/TestMCViscBndry.cpp0000644000175000017500000000543711634153073024034 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include void MCViscBndry::setBndryConds (const BCRec& bc, int ratio, int comp) { #if BL_SPACEDIM == 2 BL_ASSERT(comp<2*2); // u and v, plus derivs of same #elif BL_SPACEDIM == 3 BL_ASSERT(comp<3*(3+1)); // u and v, plus derivs of same #endif const REAL* dx = geom.CellSize(); const BOX& domain = geom.Domain(); for (OrientationIter fi; fi; ++fi) { Array &bloc = bcloc[fi()]; Array< Array >& bctag = bcond[fi()]; int dir = fi().coordDir(); REAL delta = dx[dir]*ratio; int p_bc = (fi().isLow() ? bc.lo(dir): bc.hi(dir)); for (int i = 0; i < boxes().length(); i++) { if (domain[fi()] == boxes()[i][fi()] && !geom.isPeriodic(dir)) { // All physical bc values are located on face if (p_bc == EXT_DIR ) { bctag[i][comp] = LO_DIRICHLET; bloc[i] = 0.0; } else if (p_bc == FOEXTRAP || p_bc == HOEXTRAP || p_bc == REFLECT_EVEN) { bctag[i][comp] = LO_NEUMANN; bloc[i] = 0.0; } else if( p_bc == REFLECT_ODD ) { bctag[i][comp] = LO_REFLECT_ODD; bloc[i] = 0.0; } } else { // internal bndry, distance is half of crse bctag[i][comp] = LO_DIRICHLET; bloc[i] = 0.5*delta; } } } } // ************************************************************************* void MCViscBndry::setHomogValues() { for (int grd = 0; grd < boxes().length(); grd++) for (OrientationIter fi; fi; ++fi) bndry[fi()][grd].setVal(0.); } ccseapps-2.5/CCSEApps/tensorMG/Test/grids/0000755000175000017500000000000011634153073021444 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/tensorMG/Test/grids/gr16x8.dog0000644000175000017500000000040411634153073023174 0ustar amckinstryamckinstry((-1,-1,-1)(32,32,32)(0,0,0)) 8 ((0,0,0)(15,15,15)(0,0,0)) ((0,16,0)(15,31,15)(0,0,0)) ((16,0,0)(31,15,15)(0,0,0)) ((16,16,0)(31,31,15)(0,0,0)) ((0,0,16)(15,15,31)(0,0,0)) ((0,16,16)(15,31,31)(0,0,0)) ((16,0,16)(31,15,31)(0,0,0)) ((16,16,16)(31,31,31)(0,0,0)) ccseapps-2.5/CCSEApps/tensorMG/Test/grids/gr32x8.dog0000644000175000017500000000040411634153073023172 0ustar amckinstryamckinstry((-1,-1,-1)(64,64,64)(0,0,0)) 8 ((0,0,0)(31,31,31)(0,0,0)) ((0,32,0)(31,63,31)(0,0,0)) ((32,0,0)(63,31,31)(0,0,0)) ((32,32,0)(63,63,31)(0,0,0)) ((0,0,32)(31,31,63)(0,0,0)) ((0,32,32)(31,63,63)(0,0,0)) ((32,0,32)(63,31,63)(0,0,0)) ((32,32,32)(63,63,63)(0,0,0)) ccseapps-2.5/CCSEApps/tensorMG/Test/grids/gr8.dog0000644000175000017500000000006511634153073022640 0ustar amckinstryamckinstry((-1,-1,-1)(8,8,8)(0,0,0)) 1 ((0,0,0)(7,7,7)(0,0,0)) ccseapps-2.5/CCSEApps/tensorMG/Test/grids/gr32.dog0000644000175000017500000000007311634153073022714 0ustar amckinstryamckinstry((-1,-1,-1)(32,32,32)(0,0,0)) 1 ((0,0,0)(31,31,31)(0,0,0)) ccseapps-2.5/CCSEApps/tensorMG/Test/grids/gr64.dog0000644000175000017500000000007311634153073022721 0ustar amckinstryamckinstry((-1,-1,-1)(64,64,64)(0,0,0)) 1 ((0,0,0)(63,63,63)(0,0,0)) ccseapps-2.5/CCSEApps/tensorMG/Test/grids/gr.3_2x3x40000644000175000017500000000124111634153073023106 0ustar amckinstryamckinstry((0,0,0)(15,23,31)(0,0,0)) 24 ((0,0,0)(7,7,7)(0,0,0)) ((8,0,0)(15,7,7)(0,0,0)) ((0,8,0)(7,15,7)(0,0,0)) ((8,8,0)(15,15,7)(0,0,0)) ((0,16,0)(7,23,7)(0,0,0)) ((8,16,0)(15,23,7)(0,0,0)) ((0,0,8)(7,7,15)(0,0,0)) ((8,0,8)(15,7,15)(0,0,0)) ((0,8,8)(7,15,15)(0,0,0)) ((8,8,8)(15,15,15)(0,0,0)) ((0,16,8)(7,23,15)(0,0,0)) ((8,16,8)(15,23,15)(0,0,0)) ((0,0,16)(7,7,23)(0,0,0)) ((8,0,16)(15,7,23)(0,0,0)) ((0,8,16)(7,15,23)(0,0,0)) ((8,8,16)(15,15,23)(0,0,0)) ((0,16,16)(7,23,23)(0,0,0)) ((8,16,16)(15,23,23)(0,0,0)) ((0,0,24)(7,7,31)(0,0,0)) ((8,0,24)(15,7,31)(0,0,0)) ((0,8,24)(7,15,31)(0,0,0)) ((8,8,24)(15,15,31)(0,0,0)) ((0,16,24)(7,23,31)(0,0,0)) ((8,16,24)(15,23,31)(0,0,0)) ccseapps-2.5/CCSEApps/tensorMG/Test/grids/gr16.dog0000644000175000017500000000007311634153073022716 0ustar amckinstryamckinstry((-1,-1,-1)(16,16,16)(0,0,0)) 1 ((0,0,0)(15,15,15)(0,0,0)) ccseapps-2.5/CCSEApps/tensorMG/Test/grids/gr2D0000644000175000017500000000015211634153073022163 0ustar amckinstryamckinstry((0,0)(63,63)(0,0)) 4 ((0,0)(31,31)(0,0)) ((32,0)(63,31)(0,0)) ((0,32)(31,63)(0,0)) ((32,32)(63,63)(0,0)) ccseapps-2.5/CCSEApps/tensorMG/Test/main_F.H0000644000175000017500000000555511634153073021650 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _main_F_H_ #define _main_F_H_ #include #if defined(BL_LANG_FORT) #if (BL_SPACEDIM == 2) #define FORT_FILLCRSE fillcrse2d #define FORT_FILLFINE fillfine2d #define FORT_MAKEMU makemu2d #define FORT_FILLRHS fillrhs2d #endif #if (BL_SPACEDIM == 3) #define FORT_FILLCRSE fillcrse3d #define FORT_FILLFINE fillfine3d #define FORT_MAKEMU makemu3d #define FORT_FILLRHS fillrhs3d #endif #else #if (BL_SPACEDIM == 2) #ifdef BL_FORT_USE_UPPERCASE #define FORT_FILLCRSE FILLCRSE2D #define FORT_FILLFINE FILLFINE2D #define FORT_MAKEMU MAKEMU2D #define FORT_FILLRHS FILLRHS2D #endif #ifdef BL_FORT_USE_UNDERSCORE #define FORT_FILLCRSE fillcrse2d_ #define FORT_FILLFINE fillfine2d_ #define FORT_MAKEMU makemu2d_ #define FORT_FILLRHS fillrhs2d_ #endif #endif #if (BL_SPACEDIM == 3) #ifdef BL_FORT_USE_UPPERCASE #define FORT_FILLCRSE FILLCRSE3D #define FORT_FILLFINE FILLFINE3D #define FORT_MAKEMU MAKEMU2D #define FORT_FILLRHS FILLRHS2D #endif #ifdef BL_FORT_USE_UNDERSCORE #define FORT_FILLCRSE fillcrse3d_ #define FORT_FILLFINE fillfine3d_ #define FORT_MAKEMU makemu3d_ #define FORT_FILLRHS fillrhs3d_ #endif #endif extern "C" { void FORT_FILLCRSE ( REAL* crse, ARLIM_P(crse_lo), ARLIM_P(crse_hi), const REAL* h, const int* nc ); void FORT_FILLFINE ( REAL* fine, ARLIM_P(fine_lo), ARLIM_P(fine_hi), const REAL* h, const int* nc ); void FORT_FILLRHS ( REAL* fine, ARLIM_P(fine_lo), ARLIM_P(fine_hi), const REAL* h, const int* nc ); void FORT_MAKEMU( REAL*mu, ARLIM_P(mulo),ARLIM_P(muhi), const REAL* h, int&idir ); }; #endif #endif ccseapps-2.5/CCSEApps/tensorMG/MCMultiGrid.H0000644000175000017500000003416211634153073021654 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MCMULTIGRID_H_ #define _MCMULTIGRID_H_ // // $Id: MCMultiGrid.H,v 1.5 2000/10/02 20:53:40 lijewski Exp $ // #include #include #include #include #include //@Man: /*@Memo: A MCMultiGrid solves the linear equation, L(phi)=rhs, for a MCLinOp L and MultiFabs rhs and phi using a V-type cycle of the MCMultiGrid algorithm */ /*@Doc: A MCMultiGrid object solves the linear equation, L(phi)=rhs for a MCLinOp L, and MultiFabs phi and rhs. A MCMultiGrid is constructed with a fully initialized 2D or 3D MCLinOp, and responds to "solve" requests of various signatures, ultimately performing a recursive "relax" operation over a hierachy of grid levels. The MCLinOp therefore must employ "levels" of application, as well as be able to provide an implementation of the Gauss-Seidel red-black iterations on all levels. At the coarsest level, the user has the option of applying the GSRB smoother a set number of iterations. Optionally, a Conjugate Gradient solver, CGSolver, may be used to solve the coarsest system. If the user chooses to use the conjugate gradient bottom solve, the absolute and relative tolerances of this solve are independently settable distinct from the tolerances of the mg solve. However, it rarely makes sense to stop cg after a fixed number of iterations, so that capability was omited, wrt the mg options. As a final option, the user may choose to follow the cg solve with a fixed number of relaxation passes (the relaxer within the class MCLinOp). The solve request (implicitly) includes a flag as to whether the system is to be solved with homogeneous boundary conditions or no. If homogeneous BCs are requested, all boundary information within the MCLinOp is used, except that the values of boundary FabSets are zeroed. Implementation Note: This algorithm implements solution of equations in a way that requires linearity of the operator. In "residual correction form", equations are solved only for the "correction" to the initial guess that is required to solve the desired system. In particular, boundary conditions are assumed to be satisfied after a single application of the linear operator (therefore, the correction is homogeneous at the boundary). As a result, after putting the problem in residual correction form, the entire system MG hierarchy has homigeneous boundary conditions (thus avoiding the need to interpolate BC values, and simplifying the logic of the coarse-fine transfer operations). This solver therefore cannot incorporate fully nonlinear systems. Default settings: There are a number of options in the multigrid algorithm details. In addition to changing the actual smoothers employed, the user has access to the following parameters (defaults shown in parentheses): \begin{itemize} \item nu_1(2) Number of passes of the pre-smoother \item nu_2(2) Number of passes of the post-smoother \item nu_0(1) Number of passes of the coarse-grid smoother per cycle \item nu_f(8) Number of passes of the bottom smoother (if not using the conjugate-gradient bottom solve) \item maxiter(40) Maximum number of full multigrid cycles allowed to solve the system \item numiter(-1) Number of full multigrid cycles to perform (should be less than maxiter for fixed number of MG cycles; value is ignored if < 0) \item verbose(0) Verbosity (1-results, 2-progress) \item usecg(1) Whether to use the conjugate-gradient solver for the coarsest (bottom) solve of the multigrid hierarchy \item atol_b(-1.0) Absolute error tolerance (<0 => ignored) for cg \item rtol_b(.01) Relative error tolerance (<0 => ignored) for cg \item nu_b(0) Number of passes of the bottom smoother taken {\it AFTER} the cg bottom solve (value ignored if <= 0) \item numLevelsMAX(1024) maximum number of mg levels \end{itemize} */ class MCMultiGrid { public: // //@ManDoc: constructor // MCMultiGrid (MCLinOp &_Lp); // //@ManDoc: destructor // virtual ~MCMultiGrid (); // //@ManDoc: solve the system to relative err eps_rel, absolute err eps_abs // virtual void solve (MultiFab& solution, const MultiFab& _rhs, Real eps_rel = -1.0, Real eps_abs = -1.0, MCBC_Mode bc_mode = MCInhomogeneous_BC); // //@ManDoc: return the linear operator // MCLinOp& linOp (); // //@ManDoc: set the maximum permitted multigrid iterations // void setMaxIter (int _maxiter); // //@ManDoc: return the maximum permitted multigrid iterations // int getMaxIter () const; // //@ManDoc: set the number of multigrid iterations to perform // void setNumIter (int _numiter); // //@ManDoc: return the number of multigrid iterations // int getNumIter () const; // //@ManDoc: set the flag for whether to use CGSolver at coarsest level // void setUseCG (int _usecg); // //@ManDoc: return the flag for whether to use CGSolver at coarsest level // int getUseCG () const; // //@ManDoc: set/return the number of multigrid levels // int getNumLevels (int _numlevels); // //@ManDoc: return the number of multigrid levels // int getNumLevels () const; // //@ManDoc: return the number of components in solution // int getNumComponents () const; // //@ManDoc: set the verbosity value // void setVerbose (int _verbose); // //@ManDoc: return the verbosity value // int getVerbose (); // //@ManDoc: set the number of passes of the pre-smoother // void set_preSmooth (int pre_smooth); // //@ManDoc: set the number of passes of the post-smoother // void set_postSmooth (int post_smooth); // //@ManDoc: set the number of passes of the coarse-grid smoother/mg iteration // void set_cntRelax (int cnt_relax); // //@ManDoc: set the number of passes of the bottom mg relaxer // void set_finalSmooth (int final_smooth); // //@ManDoc: Return the number of pre-smooth iterations at the level // int preSmooth () const; // //@ManDoc: Return the number of post-smooth iterations at the level // int postSmooth () const; // //@ManDoc: Return the number of level relaxations (not implemented) // int cntRelax () const; // //@ManDoc: Return the number of smoothing passes at bottom of MG (if no cg) // int finalSmooth () const; // //@ManDoc: set the maximum permitted absolute tolerance (<0 bypasses test) // void set_atol_b (Real atol); // //@ManDoc: get the maximum permitted absolute tolerance // Real get_atol_b () const; // //@ManDoc: set the maximum permitted relative tolerance (<0 bypasses test) // void set_rtol_b (Real rtol); // //@ManDoc: get the maximum permitted relative tolerance // Real get_rtol_b () const; // //@ManDoc: set the number of post-cg relax passes // void set_nu_b (int _nu_b); // //@ManDoc: set the number of post-cg relax passes // int get_nu_b () const; protected: // //@ManDoc: Solve the linear system to relative and absolute tolerance // virtual int solve_ (MultiFab& _sol, Real _eps_rel, Real _eps_abs, MCBC_Mode bc_mode, int level); // //@ManDoc: Put the system in r-c form // void residualCorrectionForm (MultiFab& newrhs, const MultiFab& oldrhs, MultiFab& initialsolution, const MultiFab& inisol, MCBC_Mode bc_mode, int level); // //@ManDoc: Make space, set switches for new solution level // void prepareForLevel (int level); // //@ManDoc: Compute the number of multigrid levels, assuming ratio=2 // int numLevels () const; // //@ManDoc: Return scalar estimate of error // virtual Real errorEstimate (int level, MCBC_Mode bc_mode); // //@ManDoc: Transfer MultiFab from fine to coarse level // void average (MultiFab& c, const MultiFab& f); // //@ManDoc: Transfer MultiFab from coarse to fine level // void interpolate (MultiFab& f, const MultiFab& c); // //@ManDoc: Perform a MG V-cycle // void relax (MultiFab& solL, MultiFab& rhsL, int level, Real eps_rel, Real eps_abs, MCBC_Mode bc_mode); // //@ManDoc: Perform relaxation at bottom of V-cycle // virtual void coarsestSmooth (MultiFab& solL, MultiFab& rhsL, int level, Real eps_rel, Real eps_abs, MCBC_Mode bc_mode); protected: // //@ManDoc: default flag, whether to use CG at bottom of MG cycle // static int def_usecg; // //@ManDoc: set flags, etc // static void initialize (); // //@ManDoc: default number of level, pre-, post and bottom smooths // static int def_nu_0, def_nu_1, def_nu_2, def_nu_f; // //@ManDoc: default number of post-cg relax passes // static int def_nu_b; // //@ManDoc: default maximum number of complete MG cycle iterations // static int def_maxiter; // //@ManDoc: default number of complete MG cycle iterations to perform // static int def_numiter; // //@ManDoc: default verbosity // static int def_verbose; // //@ManDoc: default relative, absolute tolerances for cg solve // static Real def_rtol_b, def_atol_b; // //@ManDoc: default maximum number of mg levels // static int def_numLevelsMAX; // //@ManDoc: verbosity // int verbose; // //@ManDoc: Number of MG levels. numlevels-1 is coarsest grid allowed. // int numlevels; // //@ManDoc: Number of components in solution // int numcomps; // //@ManDoc: current maximum number of allowed iterations // int maxiter; // //@ManDoc: current number of iterations to take // int numiter; // //@ManDoc: current number of level, pre-, post- and bottom smooths // int nu_0, nu_1, nu_2, nu_f; // //@ManDoc: current number of post-cg relax passes // int nu_b; // //@ManDoc: current flag, whether to use CG at bottom of MG cycle // int usecg; // //@ManDoc: relative, absolute tolerances // Real rtol_b, atol_b; // //@ManDoc: maximum number of mg levels // int numLevelsMAX; // //@ManDoc: internal temp data to store initial guess of solution // MultiFab* initialsolution; // //@ManDoc: internal temp data // Array< MultiFab* > res; // //@ManDoc: internal temp data // Array< MultiFab* > rhs; // //@ManDoc: internal temp data // Array< MultiFab* > cor; // //@ManDoc: internal reference to linear operator // MCLinOp &Lp; private: // //@ManDoc: flag, whether initialized // static bool initialized; // //@ManDoc: Disallow copy constructor, assignment operator // MCMultiGrid (const MCMultiGrid&); MCMultiGrid& operator= (const MCMultiGrid&); }; inline MCLinOp& MCMultiGrid::linOp () { return Lp; } inline void MCMultiGrid::setMaxIter (int _maxiter) { maxiter = _maxiter; } inline int MCMultiGrid::getMaxIter () const { return maxiter; } inline void MCMultiGrid::setNumIter (int _numiter) { numiter = _numiter; } inline int MCMultiGrid::getNumIter () const { return numiter; } inline void MCMultiGrid::setUseCG (int _usecg) { usecg = _usecg; } inline int MCMultiGrid::getUseCG () const { return usecg; } inline int MCMultiGrid::getNumLevels () const { return numlevels; } inline int MCMultiGrid::getNumComponents () const { return numcomps; } inline void MCMultiGrid::setVerbose (int _verbose) { verbose = _verbose; } inline int MCMultiGrid::getVerbose () { return verbose; } inline void MCMultiGrid::set_preSmooth (int pre_smooth) { nu_1 = pre_smooth; } inline void MCMultiGrid::set_postSmooth (int post_smooth) { nu_2 = post_smooth; } inline void MCMultiGrid::set_cntRelax (int cnt_relax) { nu_0 = cnt_relax; } inline void MCMultiGrid::set_finalSmooth (int final_smooth) { nu_f = final_smooth; } inline int MCMultiGrid::preSmooth () const { return nu_1; } inline int MCMultiGrid::postSmooth () const { return nu_2; } inline int MCMultiGrid::cntRelax () const { return nu_0; } inline int MCMultiGrid::finalSmooth () const { return nu_f; } inline void MCMultiGrid::set_atol_b (Real atol) { atol_b = atol; } inline Real MCMultiGrid::get_atol_b () const { return atol_b; } inline void MCMultiGrid::set_rtol_b (Real rtol) { rtol_b = rtol; } inline Real MCMultiGrid::get_rtol_b () const { return rtol_b; } inline void MCMultiGrid::set_nu_b (int _nu_b) { nu_b = _nu_b; } inline int MCMultiGrid::get_nu_b () const { return nu_b; } #endif /*_MCMULTIGRID_H_*/ ccseapps-2.5/CCSEApps/tensorMG/OpenSource.txt0000644000175000017500000002435111634153073022245 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: TensorMG Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/tensorMG/MCCGSolver.H0000644000175000017500000002042311634153073021433 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MCCGSOLVER_H_ #define _MCCGSOLVER_H_ // // $Id: MCCGSolver.H,v 1.8 2001/10/05 07:19:55 marc Exp $ // #include #include #include #include #include #include //@Man: /*@Memo: A CGColver solves the linear equation, L(phi)=rhs, for a MCLinOp L and MultiFabs rhs and phi, using the conjugate gradient algorithm, either vanilla, or preconditioned via a single V-cycle of multigrid. */ /*@Doc: A MCCGSolver object solves the linear equation, L(phi)=rhs for a MCLinOp L, and MultiFabs phi and rhs. A MCCGSolver is constructed with a fully initialized 2D or 3D MCLinOp, and responds to "solve" requests of various signatures. The solve request (implicitly) includes a flag as to whether the system is to be solved with homogeneous boundary conditions or no. If homogeneous BCs are requested, all boundary information within the MCLinOp is used, except that the values of boundary FabSets are zeroed. The algorithm follows closely that described of p15 of the SIAM book, "Templates for the Solution of Linear Systems". Before solving a system, a small number of control parameters may be modified (maximum number of allowed iterations, reporting verbosity, etc). Also, either on construction or via member access functions, the user may choose to use a V-cycle 1-step MCMultiGrid preconditioner within the CG loop by setting the appropriate bool flag (see members/ctrs below). The MG preconditioner used is just an instantiation of a MCMultiGrid class object (the MCMultiGrid class is documented separately). Implementation Notes: \begin{itemize} \item This algorithm implements solution of equations in a way that requires linearity of the operator. In "residual correction form", equations are solved only for the "correction" to the initial guess that is required to solve the desired system. In particular, boundary conditions are assumed to be satisfied after a single application of the linear operator (therefore, the correction is homogeneous at the boundary). As a result, after putting the problem in residual correction form, the entire system CG system has homigeneous boundary conditions. This solver therefore cannot incorporate fully nonlinear systems. \item In general, a MCLinOp has the ability to apply high-order interpolation methods for computing boundary values. However, if the operator used in this MCCGSolver is non-symmetric, cg performance suffers tremendously. As a result, BC's should be applied with interpolants of order less than or equal to 2. We do not enforce this condition rigourosly, since it would interfere with the user's definition of the operator. If cg performance is bad however, setting the MCLinOp's maxorder=2 is a good place to start. \end{itemize} Default settings: The user has access to the following options in the cg algorithm: \begin{itemize} \item maxiter(40) Maximum number of cg cycles allowed to solve the system before abandoning \item verbose(0) Verbosity (1-results, 2-progress, 3-detailed progress) \item use_mg_precond(false) Whether to use the V-cycle multigrid solver for the preconditioner system \end{itemize} */ class MCCGSolver { public: // //@ManDoc: constructor // MCCGSolver (MCLinOp& _Lp, bool _use_mg_precond = false, int _lev=0); // //@ManDoc: destructor // virtual ~MCCGSolver (); // //@ManDoc: solve the system, Lp(solnL)=rhsL to relative err, tolerance // virtual void solve (MultiFab& solnL, const MultiFab& rhsL, Real eps_rel = -1.0, Real eps_abs = -1.0, MCBC_Mode bc_mode = MCInhomogeneous_BC); // //@ManDoc: set maximum allowed number of CG iterations // void setMaxIter (int _maxiter); // //@ManDoc: get maximum allowed number of CG iterations // int getMaxIter () const; // //@ManDoc: set expert mode // void setExpert( bool flag ) { isExpert = flag; } // //@ManDoc: get expert flag // bool getExpert() { return isExpert; } // //@ManDoc: set flag determining whether MG preconditioning is used // void setUseMGPrecond (bool _use_mg_precond); // //@ManDoc: get flag determining whether MG preconditioning is used // bool getUseMGPrecond () const; // //@ManDoc: set the verbosity value // void setVerbose (int _verbose); // //@ManDoc: return the verbosity value // int getVerbose (); protected: // //@ManDoc: construct work space, initialize parameters // static void initialize (); // //@ManDoc: if (use_mg_precond == 1) then define the MCMultiGrid * mg_precond // void set_mg_precond (); // //@ManDoc: compute p = z + beta p in the CG algorithm // void advance (MultiFab& p, Real beta, const MultiFab& z); // //@ManDoc: compute x =+ alpha p and r -= alpha w in the CG algorithm // void update (MultiFab& sol, Real alpha, MultiFab& r, const MultiFab& p, const MultiFab& w); // //@ManDoc: compute w = A.p, and return Transpose(p).w in the CG algorithm // Real axp (MultiFab& w, MultiFab& p, MCBC_Mode bc_mode); // //@ManDoc: compute a suitable norm of the residual, used to check stopping criteria // Real norm (const MultiFab& res); // //@ManDoc: MCMultiGrid solver to be used as preconditioner // MCMultiGrid* mg_precond; // //@ManDoc: flag, whether initialized yet // static int initialized; // //@ManDoc: default maximum number of allowed iterations, verbosity // static int def_maxiter, def_verbose; // //@ManDoc: flag: use multigrid as a preconditioner // bool use_mg_precond; // //@ManDoc: default unstable_criterion used to test for loss of accuracy in // static double def_unstable_criterion; // //@ManDoc: flag determining action when error conditions are hit // static int def_isExpert; bool isExpert; // //@ManDoc: current maximum number of allowed iterations, verbosity // int maxiter, verbose; // //@ManDoc: reference to operator for linear system to be solved // MCLinOp &Lp; // //@ManDoc: integer to choose which "level" of the linear operator to use // int lev; private: // //@ManDoc: disable copy constructor, = operator // MCCGSolver (const MCCGSolver&); MCCGSolver& operator= (const MCCGSolver&); }; inline void MCCGSolver::setMaxIter (int _maxiter) { maxiter = _maxiter; } inline int MCCGSolver::getMaxIter () const { return maxiter; } inline void MCCGSolver::setUseMGPrecond (bool _use_mg_precond) { use_mg_precond = _use_mg_precond; set_mg_precond(); } inline bool MCCGSolver::getUseMGPrecond () const { return use_mg_precond; } inline void MCCGSolver::setVerbose (int _verbose) { verbose = _verbose; } inline int MCCGSolver::getVerbose () { return verbose; } #endif /*_MCCGSOLVER_H_*/ ccseapps-2.5/CCSEApps/tensorMG/DV_3D2.F0000644000175000017500000021135711634153073020456 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include "DivVis_F.H" #include #include "ArrayLim.H" c :::: usage: c :::: this .mF file is meant to be run through Mathematica. This converts c :::: compact symbolic expressions into fortran which is stored in a .F c :::: file. c---------------------------------------------------------------- c this is the fortran support file for the the operator c L(U) = alpha*a(x)*U - beta*Div( tau ) c c where U is the two component vector (u,v) and c tau is a three by three tensor c tau = | t_xx t_xy t_xz| c | t_xy t_yy t_yz| c | t_xz t_yz t_zz| c c t_xx = 2*mu * u_x c t_yy = 2*mu * v_y c t_zz = 2*mu * w_z c t_xy = mu*(u_y + v_x) c t_xz = mu*(u_z + w_x) c t_yz = mu*(v_z + w_y) c ::: define standard replacements used by Mathematica c ::: see file visc3d.ma c ::: Null c ------------------------------------------------------------------- c ... a point of interpretation here: lo and hi are the covered area in c ... cell centered coordinates. The dimension of the x and y fluxes have c ... to be at least one larger in the appropriate direction. c ... we use the "usual" interpretation of fluxes: cell i has a left flux c ... numbered i and a right flux numbered i+1 subroutine FORT_DVFLUX( $ u, DIMS(u), $ alpha, beta, $ a, DIMS(a), $ muX, DIMS(muX), $ muY, DIMS(muY), $ muZ, DIMS(muZ), $ xflux,DIMS(xflux), $ yflux,DIMS(yflux), $ zflux,DIMS(zflux), $ maskn,DIMS(maskn), $ maske,DIMS(maske), $ maskw,DIMS(maskw), $ masks,DIMS(masks), $ maskt,DIMS(maskt), $ maskb,DIMS(maskb), $ trandern,DIMS(trandern), $ trandere,DIMS(trandere), $ tranderw,DIMS(tranderw), $ tranders,DIMS(tranders), $ trandert,DIMS(trandert), $ tranderb,DIMS(tranderb), $ lo,hi,h $ ) REAL_T alpha, beta integer DIMDEC(u) integer DIMDEC(a) integer DIMDEC(muX) integer DIMDEC(muY) integer DIMDEC(muZ) integer DIMDEC(xflux) integer DIMDEC(yflux) integer DIMDEC(zflux) integer DIMDEC(maskn) integer DIMDEC(maske) integer DIMDEC(maskw) integer DIMDEC(masks) integer DIMDEC(maskt) integer DIMDEC(maskb) integer DIMDEC(trandern) integer DIMDEC(trandere) integer DIMDEC(tranderw) integer DIMDEC(tranders) integer DIMDEC(trandert) integer DIMDEC(tranderb) integer lo(BL_SPACEDIM), hi(BL_SPACEDIM) REAL_T h(BL_SPACEDIM) REAL_T u(DIMV(u),3) REAL_T a(DIMV(a)) REAL_T muX(DIMV(muX)) REAL_T muY(DIMV(muY)) REAL_T muZ(DIMV(muZ)) REAL_T xflux(DIMV(xflux),3) REAL_T yflux(DIMV(yflux),3) REAL_T zflux(DIMV(zflux),3) integer maskn(DIMV(maskn)) integer maske(DIMV(maske)) integer maskw(DIMV(maskw)) integer masks(DIMV(masks)) integer maskt(DIMV(maskt)) integer maskb(DIMV(maskb)) c ::: for transverse derives, first 3 is for variable, second 3 is for c ::: direction of derivative. Obviously not all are used, but this is easy. REAL_T trandern(DIMV(trandern),3,3) REAL_T trandere(DIMV(trandere),3,3) REAL_T tranderw(DIMV(tranderw),3,3) REAL_T tranders(DIMV(tranders),3,3) REAL_T trandert(DIMV(trandert),3,3) REAL_T tranderb(DIMV(tranderb),3,3) integer i,j,k REAL_T tauxxw,tauxxe,tauyyn,tauyys REAL_T tauxye,tauxyw,tauxyn,tauxys REAL_T hx,hy,hz REAL_T dudxe,dudxw REAL_T dvdyn,dvdys REAL_T dudye,dudyw REAL_T dudyn,dudys REAL_T dvdxe,dvdxw REAL_T dvdxn,dvdxs REAL_T dudzb,dudzt REAL_T dwdzt,dwdzb REAL_T dwdxb,dwdxt REAL_T dvdzb,dvdzt REAL_T dwdyb,dwdyt REAL_T dudzw,dudze REAL_T dwdxw,dwdxe REAL_T dvdzs,dvdzn REAL_T dwdys,dwdyn logical False, True parameter( False=.false.) parameter( True=.true. ) hx = h(1) hy = h(2) hz = h(3) c ::: cases: c ::: 0) interior. All usual derivative expressions c ::: 1-6) face but not on edge. c ::: 7-18) edge but not on corner. c ::: 19-26) corners. c ::: case 0 c ::: Null c ::: Null do k=lo(3)+1,hi(3) do j=lo(2)+1,hi(2) do i=lo(1)+1,hi(1) c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo enddo enddo c ::: case 1, top face c ::: Null c ::: Null c ::: Null c ::: wst k=hi(3) do j=lo(2)+1,hi(2) do i=lo(1)+1,hi(1) c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxt=trandert(i,j,1+k,3,1) dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k+1,1)=-((dudzt+dwdxt)*muZ(i,j,1+k)) zflux(i,j,k+1,2)=-((dvdzt+dwdyt)*muZ(i,j,1+k)) zflux(i,j,k+1,3)=-(2*dwdzt*muZ(i,j,1+k)) enddo enddo c ::: case 2, bottom face c ::: Null c ::: Null c ::: Null c ::: wsb k=lo(3) do j=lo(2)+1,hi(2) do i=lo(1)+1,hi(1) c ::: get expressions for normal derivatives c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) dwdxb=tranderb(i,j,-1+k,3,1) dwdyb=tranderb(i,j,-1+k,3,2) if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo enddo c ::: case 3, west face c ::: Null c ::: Null c ::: Null c ::: wsb i = lo(1) do k=lo(3)+1,hi(3) do j=lo(2)+1,hi(2) c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dudyw=tranderw(-1+i,j,k,1,2) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dudzw=tranderw(-1+i,j,k,1,3) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo enddo c ::: case 4, east face c ::: Null c ::: Null c ::: Null c ::: esb i = hi(1) do k=lo(3)+1,hi(3) do j=lo(2)+1,hi(2) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dudye=trandere(1+i,j,k,1,2) if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) dudze=trandere(1+i,j,k,1,3) dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) c ::: evaluate expression xflux(i+1,j,k,1)=-(2*dudxe*muX(1+i,j,k)) xflux(i+1,j,k,2)=-((dudye+dvdxe)*muX(1+i,j,k)) xflux(i+1,j,k,3)=-((dudze+dwdxe)*muX(1+i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo enddo c ::: case 5, north face c ::: Null c ::: Null c ::: Null c ::: wnb j = hi(2) do k=lo(3)+1,hi(3) do i=lo(1)+1,hi(1) c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=trandern(i,1+j,k,2,1) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j+1,k,1)=-((dudyn+dvdxn)*muY(i,1+j,k)) yflux(i,j+1,k,2)=-(2*dvdyn*muY(i,1+j,k)) yflux(i,j+1,k,3)=-((dvdzn+dwdyn)*muY(i,1+j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo enddo c ::: case 6, south face c ::: Null c ::: Null c ::: Null c ::: wsb j = lo(2) do k=lo(3)+1,hi(3) do i=lo(1)+1,hi(1) c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxs=tranders(i,-1+j,k,2,1) dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) dvdzs=tranders(i,-1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo enddo c ::: case 7, top-north edge c ::: Null c ::: Null c ::: Null c ::: tnw k=hi(3) j=hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=trandern(i,1+j,k,2,1) dwdxt=trandert(i,j,1+k,3,1) dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j+1,k,1)=-((dudyn+dvdxn)*muY(i,1+j,k)) yflux(i,j+1,k,2)=-(2*dvdyn*muY(i,1+j,k)) yflux(i,j+1,k,3)=-((dvdzn+dwdyn)*muY(i,1+j,k)) zflux(i,j,k+1,1)=-((dudzt+dwdxt)*muZ(i,j,1+k)) zflux(i,j,k+1,2)=-((dvdzt+dwdyt)*muZ(i,j,1+k)) zflux(i,j,k+1,3)=-(2*dwdzt*muZ(i,j,1+k)) enddo c ::: case 8, top-south edge c ::: Null c ::: tsw k=hi(3) j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxs=tranders(i,-1+j,k,2,1) dwdxt=trandert(i,j,1+k,3,1) dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dvdzs=tranders(i,-1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k+1,1)=-((dudzt+dwdxt)*muZ(i,j,1+k)) zflux(i,j,k+1,2)=-((dvdzt+dwdyt)*muZ(i,j,1+k)) zflux(i,j,k+1,3)=-(2*dwdzt*muZ(i,j,1+k)) enddo c ::: case 9, top-west edge c ::: Null c ::: tsw k=hi(3) i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dudyw=tranderw(-1+i,j,k,1,2) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dwdyt=trandert(i,j,1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k+1,1)=-((dudzt+dwdxt)*muZ(i,j,1+k)) zflux(i,j,k+1,2)=-((dvdzt+dwdyt)*muZ(i,j,1+k)) zflux(i,j,k+1,3)=-(2*dwdzt*muZ(i,j,1+k)) enddo c ::: case 10, top-east edge c ::: Null c ::: tes k=hi(3) i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dudye=trandere(1+i,j,k,1,2) if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dwdyt=trandert(i,j,1+k,3,2) dudze=trandere(1+i,j,k,1,3) if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression xflux(i+1,j,k,1)=-(2*dudxe*muX(1+i,j,k)) xflux(i+1,j,k,2)=-((dudye+dvdxe)*muX(1+i,j,k)) xflux(i+1,j,k,3)=-((dudze+dwdxe)*muX(1+i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k+1,1)=-((dudzt+dwdxt)*muZ(i,j,1+k)) zflux(i,j,k+1,2)=-((dvdzt+dwdyt)*muZ(i,j,1+k)) zflux(i,j,k+1,3)=-(2*dwdzt*muZ(i,j,1+k)) enddo c ::: case 11, bottom-north edge c ::: Null c ::: bnw k=lo(3) j=hi(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxn=trandern(i,1+j,k,2,1) dwdxb=tranderb(i,j,-1+k,3,1) dwdyb=tranderb(i,j,-1+k,3,2) if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j+1,k,1)=-((dudyn+dvdxn)*muY(i,1+j,k)) yflux(i,j+1,k,2)=-(2*dvdyn*muY(i,1+j,k)) yflux(i,j+1,k,3)=-((dvdzn+dwdyn)*muY(i,1+j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo c ::: case 12, bottom-south edge c ::: Null c ::: bsw k=lo(3) j=lo(2) do i=lo(1)+1,hi(1)-1 c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dvdxs=tranders(i,-1+j,k,2,1) dwdxb=tranderb(i,j,-1+k,3,1) dwdyb=tranderb(i,j,-1+k,3,2) if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dvdzs=tranders(i,-1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo c ::: case 13, bottom-west edge c ::: Null c ::: bws k=lo(3) i=lo(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dudyw=tranderw(-1+i,j,k,1,2) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) dwdyb=tranderb(i,j,-1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo c ::: case 14, bottom-east edge c ::: Null c ::: bse k=lo(3) i=hi(1) do j=lo(2)+1,hi(2)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) dudye=trandere(1+i,j,k,1,2) dwdyb=tranderb(i,j,-1+k,3,2) dudze=trandere(1+i,j,k,1,3) if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif c ::: evaluate expression xflux(i+1,j,k,1)=-(2*dudxe*muX(1+i,j,k)) xflux(i+1,j,k,2)=-((dudye+dvdxe)*muX(1+i,j,k)) xflux(i+1,j,k,3)=-((dudze+dwdxe)*muX(1+i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo c ::: case 15, east-north edge c ::: Null c ::: neb j=hi(2) i=hi(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dudze=trandere(1+i,j,k,1,3) dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression xflux(i+1,j,k,1)=-(2*dudxe*muX(1+i,j,k)) xflux(i+1,j,k,2)=-((dudye+dvdxe)*muX(1+i,j,k)) xflux(i+1,j,k,3)=-((dudze+dwdxe)*muX(1+i,j,k)) yflux(i,j+1,k,1)=-((dudyn+dvdxn)*muY(i,1+j,k)) yflux(i,j+1,k,2)=-(2*dvdyn*muY(i,1+j,k)) yflux(i,j+1,k,3)=-((dvdzn+dwdyn)*muY(i,1+j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo c ::: case 16, east-south edge c ::: Null c ::: esb j=lo(2) i=hi(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dvdxs=tranders(i,-1+j,k,2,1) if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dudye=trandere(1+i,j,k,1,2) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dudze=trandere(1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) c ::: evaluate expression xflux(i+1,j,k,1)=-(2*dudxe*muX(1+i,j,k)) xflux(i+1,j,k,2)=-((dudye+dvdxe)*muX(1+i,j,k)) xflux(i+1,j,k,3)=-((dudze+dwdxe)*muX(1+i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo c ::: case 17, west-north edge c ::: Null c ::: nwb j=hi(2) i=lo(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dudyw=tranderw(-1+i,j,k,1,2) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dudzw=tranderw(-1+i,j,k,1,3) dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j+1,k,1)=-((dudyn+dvdxn)*muY(i,1+j,k)) yflux(i,j+1,k,2)=-(2*dvdyn*muY(i,1+j,k)) yflux(i,j+1,k,3)=-((dvdzn+dwdyn)*muY(i,1+j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo c ::: case 18, west-south edge c ::: Null c ::: swb j=lo(2) i=lo(1) do k=lo(3)+1,hi(3)-1 c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dvdxs=tranders(i,-1+j,k,2,1) if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dudyw=tranderw(-1+i,j,k,1,2) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dudzw=tranderw(-1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) enddo c ::: case 19, top-north-east corner c ::: Null c ::: tbnsew k=hi(3) j=hi(2) i=hi(1) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dudye=trandere(1+i,j,k,1,2) if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) xflux(i+1,j,k,1)=-(2*dudxe*muX(1+i,j,k)) xflux(i+1,j,k,2)=-((dudye+dvdxe)*muX(1+i,j,k)) xflux(i+1,j,k,3)=-((dudze+dwdxe)*muX(1+i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) yflux(i,j+1,k,1)=-((dudyn+dvdxn)*muY(i,1+j,k)) yflux(i,j+1,k,2)=-(2*dvdyn*muY(i,1+j,k)) yflux(i,j+1,k,3)=-((dvdzn+dwdyn)*muY(i,1+j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) zflux(i,j,k+1,1)=-((dudzt+dwdxt)*muZ(i,j,1+k)) zflux(i,j,k+1,2)=-((dvdzt+dwdyt)*muZ(i,j,1+k)) zflux(i,j,k+1,3)=-(2*dwdzt*muZ(i,j,1+k)) c ::: case 20, top-north-west corner c ::: Null c ::: tbnsw i=lo(1) j=hi(2) k=hi(3) c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dudyw=tranderw(-1+i,j,k,1,2) if(maskn(i,1+j,-1+k).gt.0.or.maskn(i,1+j,k).gt.0) then dwdyb=((U(i,-2+j,-1+k,3)-4*U(i,-1+j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hy)+(U(i,-2+j,k,3)-4*U(i,-1+j,k,3 & )+3*U(i,j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) if(maskt(i,-1+j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dvdzs=((U(i,-1+j,-2+k,2)-4*U(i,-1+j,-1+k,2)+3*U(i, & -1+j,k,2))/(2.d0*hz)+(U(i,j,-2+k,2)-4*U(i,j,-1+k,2 & )+3*U(i,j,k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) yflux(i,j+1,k,1)=-((dudyn+dvdxn)*muY(i,1+j,k)) yflux(i,j+1,k,2)=-(2*dvdyn*muY(i,1+j,k)) yflux(i,j+1,k,3)=-((dvdzn+dwdyn)*muY(i,1+j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) zflux(i,j,k+1,1)=-((dudzt+dwdxt)*muZ(i,j,1+k)) zflux(i,j,k+1,2)=-((dvdzt+dwdyt)*muZ(i,j,1+k)) zflux(i,j,k+1,3)=-(2*dwdzt*muZ(i,j,1+k)) c ::: case 21, top-south-east corner c ::: Null c ::: tbsew i=hi(1) j=lo(2) k=hi(3) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dvdxs=tranders(i,-1+j,k,2,1) if(maske(1+i,j,-1+k).gt.0.or.maske(1+i,j,k).gt.0) then dwdxb=((U(-2+i,j,-1+k,3)-4*U(-1+i,j,-1+k,3)+3*U(i, & j,-1+k,3))/(2.d0*hx)+(U(-2+i,j,k,3)-4*U(-1+i,j,k,3 & )+3*U(i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dudye=trandere(1+i,j,k,1,2) if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) if(maskt(-1+i,j,1+k).gt.0.or.maskt(i,j,1+k).gt.0) then dudzw=((U(-1+i,j,-2+k,1)-4*U(-1+i,j,-1+k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hz)+(U(i,j,-2+k,1)-4*U(i,j,-1+k,1 & )+3*U(i,j,k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) xflux(i+1,j,k,1)=-(2*dudxe*muX(1+i,j,k)) xflux(i+1,j,k,2)=-((dudye+dvdxe)*muX(1+i,j,k)) xflux(i+1,j,k,3)=-((dudze+dwdxe)*muX(1+i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) zflux(i,j,k+1,1)=-((dudzt+dwdxt)*muZ(i,j,1+k)) zflux(i,j,k+1,2)=-((dvdzt+dwdyt)*muZ(i,j,1+k)) zflux(i,j,k+1,3)=-(2*dwdzt*muZ(i,j,1+k)) c ::: case 22, top-south-west corner c ::: Null c ::: tbsw i=lo(1) j=lo(2) k=hi(3) c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzt = (-U(i,j,k,3)+U(i,j,1+k,3))/hz dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzt = (-U(i,j,k,1)+U(i,j,1+k,1))/hz dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dvdzt = (-U(i,j,k,2)+U(i,j,1+k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dvdxs=tranders(i,-1+j,k,2,1) if(maskw(-1+i,j,-1+k).gt.0.or.maskw(-1+i,j,k).gt.0) then dwdxb=((-3*U(i,j,-1+k,3)+4*U(1+i,j,-1+k,3)-U(2+i,j & ,-1+k,3))/(2.d0*hx)+(-3*U(i,j,k,3)+4*U(1+i,j,k,3)- & U(2+i,j,k,3))/(2.d0*hx))/2.d0 else dwdxb=(-U(-1+i,j,-1+k,3)-U(-1+i,j,k,3)+U(1+i,j,-1+ & k,3)+U(1+i,j,k,3))/(4.d0*hx) endif dwdxt=trandert(i,j,1+k,3,1) dudyw=tranderw(-1+i,j,k,1,2) if(masks(i,-1+j,-1+k).gt.0.or.masks(i,-1+j,k).gt.0) then dwdyb=((-3*U(i,j,-1+k,3)+4*U(i,1+j,-1+k,3)-U(i,2+j & ,-1+k,3))/(2.d0*hy)+(-3*U(i,j,k,3)+4*U(i,1+j,k,3)- & U(i,2+j,k,3))/(2.d0*hy))/2.d0 else dwdyb=(-U(i,-1+j,-1+k,3)-U(i,-1+j,k,3)+U(i,1+j,-1+ & k,3)+U(i,1+j,k,3))/(4.d0*hy) endif dwdyt=trandert(i,j,1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) zflux(i,j,k+1,1)=-((dudzt+dwdxt)*muZ(i,j,1+k)) zflux(i,j,k+1,2)=-((dvdzt+dwdyt)*muZ(i,j,1+k)) zflux(i,j,k+1,3)=-(2*dwdzt*muZ(i,j,1+k)) c ::: case 23, bottom-north-east corner c ::: Null c ::: bnsew i=hi(1) j=hi(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maske(1+i,-1+j,k).gt.0.or.maske(1+i,j,k).gt.0) then dvdxs=((U(-2+i,-1+j,k,2)-4*U(-1+i,-1+j,k,2)+3*U(i, & -1+j,k,2))/(2.d0*hx)+(U(-2+i,j,k,2)-4*U(-1+i,j,k,2 & )+3*U(i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) dudye=trandere(1+i,j,k,1,2) if(maskn(-1+i,1+j,k).gt.0.or.maskn(i,1+j,k).gt.0) then dudyw=((U(-1+i,-2+j,k,1)-4*U(-1+i,-1+j,k,1)+3*U(-1 & +i,j,k,1))/(2.d0*hy)+(U(i,-2+j,k,1)-4*U(i,-1+j,k,1 & )+3*U(i,j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dwdyb=tranderb(i,j,-1+k,3,2) if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) xflux(i+1,j,k,1)=-(2*dudxe*muX(1+i,j,k)) xflux(i+1,j,k,2)=-((dudye+dvdxe)*muX(1+i,j,k)) xflux(i+1,j,k,3)=-((dudze+dwdxe)*muX(1+i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) yflux(i,j+1,k,1)=-((dudyn+dvdxn)*muY(i,1+j,k)) yflux(i,j+1,k,2)=-(2*dvdyn*muY(i,1+j,k)) yflux(i,j+1,k,3)=-((dvdzn+dwdyn)*muY(i,1+j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) c ::: case 24, bottom-north-west corner c ::: Null c ::: bnsw i=lo(1) j=hi(2) k=lo(3) c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdyn = (-U(i,j,k,2)+U(i,1+j,k,2))/hy dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudyn = (-U(i,j,k,1)+U(i,1+j,k,1))/hy dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy dwdyn = (-U(i,j,k,3)+U(i,1+j,k,3))/hy c ::: get expressions for tangential derivatives dvdxn=trandern(i,1+j,k,2,1) if(maskw(-1+i,-1+j,k).gt.0.or.maskw(-1+i,j,k).gt.0) then dvdxs=((-3*U(i,-1+j,k,2)+4*U(1+i,-1+j,k,2)-U(2+i,- & 1+j,k,2))/(2.d0*hx)+(-3*U(i,j,k,2)+4*U(1+i,j,k,2)- & U(2+i,j,k,2))/(2.d0*hx))/2.d0 else dvdxs=(-U(-1+i,-1+j,k,2)-U(-1+i,j,k,2)+U(1+i,-1+j, & k,2)+U(1+i,j,k,2))/(4.d0*hx) endif dwdxb=tranderb(i,j,-1+k,3,1) dudyw=tranderw(-1+i,j,k,1,2) dwdyb=tranderb(i,j,-1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) if(maskb(i,-1+j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dvdzs=((-3*U(i,-1+j,k,2)+4*U(i,-1+j,1+k,2)-U(i,-1+ & j,2+k,2))/(2.d0*hz)+(-3*U(i,j,k,2)+4*U(i,j,1+k,2)- & U(i,j,2+k,2))/(2.d0*hz))/2.d0 else dvdzs=(-U(i,-1+j,-1+k,2)+U(i,-1+j,1+k,2)-U(i,j,-1+ & k,2)+U(i,j,1+k,2))/(4.d0*hz) endif dvdzn=trandern(i,1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) yflux(i,j+1,k,1)=-((dudyn+dvdxn)*muY(i,1+j,k)) yflux(i,j+1,k,2)=-(2*dvdyn*muY(i,1+j,k)) yflux(i,j+1,k,3)=-((dvdzn+dwdyn)*muY(i,1+j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) c ::: case 25, bottom-south-east corner c ::: Null c ::: bsew i=hi(1) j=lo(2) k=lo(3) c ::: get expressions for normal derivatives dudxe = (-U(i,j,k,1)+U(1+i,j,k,1))/hx dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxe = (-U(i,j,k,2)+U(1+i,j,k,2))/hx dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdxe = (-U(i,j,k,3)+U(1+i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dvdxs=tranders(i,-1+j,k,2,1) dwdxb=tranderb(i,j,-1+k,3,1) dudye=trandere(1+i,j,k,1,2) if(masks(-1+i,-1+j,k).gt.0.or.masks(i,-1+j,k).gt.0) then dudyw=((-3*U(-1+i,j,k,1)+4*U(-1+i,1+j,k,1)-U(-1+i, & 2+j,k,1))/(2.d0*hy)+(-3*U(i,j,k,1)+4*U(i,1+j,k,1)- & U(i,2+j,k,1))/(2.d0*hy))/2.d0 else dudyw=(-U(-1+i,-1+j,k,1)+U(-1+i,1+j,k,1)-U(i,-1+j, & k,1)+U(i,1+j,k,1))/(4.d0*hy) endif dwdyb=tranderb(i,j,-1+k,3,2) if(maskb(-1+i,j,-1+k).gt.0.or.maskb(i,j,-1+k).gt.0) then dudzw=((-3*U(-1+i,j,k,1)+4*U(-1+i,j,1+k,1)-U(-1+i, & j,2+k,1))/(2.d0*hz)+(-3*U(i,j,k,1)+4*U(i,j,1+k,1)- & U(i,j,2+k,1))/(2.d0*hz))/2.d0 else dudzw=(-U(-1+i,j,-1+k,1)+U(-1+i,j,1+k,1)-U(i,j,-1+ & k,1)+U(i,j,1+k,1))/(4.d0*hz) endif dudze=trandere(1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) xflux(i+1,j,k,1)=-(2*dudxe*muX(1+i,j,k)) xflux(i+1,j,k,2)=-((dudye+dvdxe)*muX(1+i,j,k)) xflux(i+1,j,k,3)=-((dudze+dwdxe)*muX(1+i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) c ::: case 26, bottom-south-west corner c ::: Null i=lo(1) j=lo(2) k=lo(3) c ::: get expressions for normal derivatives dudxw = (-U(-1+i,j,k,1)+U(i,j,k,1))/hx dvdys = (-U(i,-1+j,k,2)+U(i,j,k,2))/hy dwdzb = (-U(i,j,-1+k,3)+U(i,j,k,3))/hz dudys = (-U(i,-1+j,k,1)+U(i,j,k,1))/hy dvdxw = (-U(-1+i,j,k,2)+U(i,j,k,2))/hx dudzb = (-U(i,j,-1+k,1)+U(i,j,k,1))/hz dvdzb = (-U(i,j,-1+k,2)+U(i,j,k,2))/hz dwdxw = (-U(-1+i,j,k,3)+U(i,j,k,3))/hx dwdys = (-U(i,-1+j,k,3)+U(i,j,k,3))/hy c ::: get expressions for tangential derivatives dvdxs=tranders(i,-1+j,k,2,1) dwdxb=tranderb(i,j,-1+k,3,1) dudyw=tranderw(-1+i,j,k,1,2) dwdyb=tranderb(i,j,-1+k,3,2) dudzw=tranderw(-1+i,j,k,1,3) dvdzs=tranders(i,-1+j,k,2,3) c ::: evaluate expression xflux(i,j,k,1)=-(2*dudxw*muX(i,j,k)) xflux(i,j,k,2)=-((dudyw+dvdxw)*muX(i,j,k)) xflux(i,j,k,3)=-((dudzw+dwdxw)*muX(i,j,k)) yflux(i,j,k,1)=-((dudys+dvdxs)*muY(i,j,k)) yflux(i,j,k,2)=-(2*dvdys*muY(i,j,k)) yflux(i,j,k,3)=-((dvdzs+dwdys)*muY(i,j,k)) zflux(i,j,k,1)=-((dudzb+dwdxb)*muZ(i,j,k)) zflux(i,j,k,2)=-((dvdzb+dwdyb)*muZ(i,j,k)) zflux(i,j,k,3)=-(2*dwdzb*muZ(i,j,k)) end ccseapps-2.5/CCSEApps/amrlib/0000755000175000017500000000000011634153073017125 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/amrlib/StateData.H0000644000175000017500000002050611634153073021113 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _StateData_H_ #define _StateData_H_ // // $Id: StateData.H,v 1.19 2001/08/01 21:50:46 lijewski Exp $ // #include #include #include #include #include #include class RealBox; class StateDescriptor; namespace BoxLib { void readBoxArray (BoxArray&, std::istream&, bool); } // //@Man: //@Memo: Current and previous level-time data. /*@Doc: StateData holds state data on a level for the current and previous time step. */ class StateData { public: // //@ManDoc: The default constructor. // StateData (); // //@ManDoc: Constructor that properly initializes data members. // StateData (const Box& p_domain, const BoxArray& grds, const StateDescriptor* d, Real cur_time, Real dt); // //@ManDoc: The destructor. // ~StateData (); // //@ManDoc: Initializes data members if you used default constructor. // void define (const Box& p_domain, const BoxArray& grds, const StateDescriptor& d, Real cur_time, Real dt); // //@ManDoc: Sets up the boundary conditions. // void buildBC (); // //@ManDoc: Allocates space for old timestep data. // void allocOldData (); // //@ManDoc: Deletes the space used by the old timestep data. // void removeOldData (); // //@ManDoc: Reverts back to initial state. // void reset (); // //@ManDoc: Old data becomes new data and new time is incremented by dt. // void swapTimeLevels (Real dt); // //@ManDoc: Sets time of old and new data. // void setTimeLevel (Real t_new, Real dt_old, Real dt_new); // //@ManDoc: Sets time of old data. // void setOldTimeLevel (Real t_old); // //@ManDoc: Sets time of new data. // void setNewTimeLevel (Real t_new); void RegisterData (MultiFabCopyDescriptor& multiFabCopyDesc, Array& mfid); void linInterpAddBox (MultiFabCopyDescriptor& multiFabCopyDesc, Array& mfid, BoxList* returnedUnfillableBoxes, Array& returnedFillBoxIds, const Box& subbox, Real time, int src_comp, int dest_comp, int num_comp, bool extrap = false); void linInterpFillFab (MultiFabCopyDescriptor& fabCopyDesc, const Array& mfid, const Array& fillBoxIds, FArrayBox& dest, Real time, int src_comp, int dest_comp, int num_comp, bool extrap = false); // //@ManDoc: Set physical bndry values for all state variables in range. // void FillBoundary (FArrayBox& dest, Real time, const Real* dx, const RealBox& prob_domain, int dest_comp, int src_comp, int num_comp = 1); // //@ManDoc: Set physical bndry values for all state variables in range. // void FillBoundary (const Real* dx, const RealBox& prob_domain, int src_comp, int num_comp = 1, int do_new = 1); // //@ManDoc: Write the state data to a checkpoint file. // void checkPoint (const std::string& name, const std::string& fullpathname, std::ostream& os, VisMF::How how, bool dump_old = true); // //@ManDoc: Initializes state data from a checkpoint file. // void restart (std::istream& is, const StateDescriptor& d, const std::string& restart_file, bool bReadSpecial = false); // //@ManDoc: Returns the StateDescriptor. // const StateDescriptor* descriptor () const; // //@ManDoc: Returns the valid domain. // const Box& getDomain () const; // //@ManDoc: Returns the BoxArray. // const BoxArray& boxArray () const; // //@ManDoc: Returns the current time. // Real curTime () const; // //@ManDoc: Returns the previous time. // Real prevTime () const; // //@ManDoc: Returns the new data. // MultiFab& newData (); // //@ManDoc: Returns the new data. // const MultiFab& newData () const; // //@ManDoc: Returns the old data. // MultiFab& oldData (); // //@ManDoc: Returns the old data. // const MultiFab& oldData () const; // //@ManDoc: Returns the FAB of new data at grid index `i'. // FArrayBox& newGrid (int i); // //@ManDoc: Returns the FAB of old data at grid index `i'. // FArrayBox& oldGrid (int i); // //@ManDoc: Returns an array of boundary condition records for the // specified component. Each element in the array corresponds // to a grid in the state. // Array& getBCs (int comp); // //@ManDoc: Returns boundary conditions of specified component on the // specified grid. // const BCRec& getBC (int comp, int i) const; // //@ManDoc: Prints out the time interval. // void printTimeInterval (std::ostream& os) const; // //@ManDoc: True if there is any old data available. // bool hasOldData () const; // //@ManDoc: True if there is any new data available. // bool hasNewData () const; protected: struct TimeInterval { Real start; Real stop; }; // // Pointer to data descriptor. // const StateDescriptor* desc; // // Problem domain. // Box domain; // // Grids defined at this level. // BoxArray grids; // // Time variable assoc with new data. // TimeInterval new_time; // // Time variable assoc with old data. // TimeInterval old_time; // // Pointer to new-time data. // MultiFab* new_data; // // Pointer to previous time data. // MultiFab* old_data; // // Boundary conditions for the grids at this level. // Array< Array > bc; }; #endif /*_StateData_H_*/ ccseapps-2.5/CCSEApps/amrlib/Banner.html0000644000175000017500000000056711634153073021230 0ustar amckinstryamckinstry

Problems with this Web page should be sent to webmaster@mothra.lbl.gov

Bugs in the software should be sent to guthamr-bugs@mothra.lbl.gov

(C)opyright by Lawrence Berkeley National Laboratory ccseapps-2.5/CCSEApps/amrlib/DatasetClient.cpp0000644000175000017500000005414411634153073022365 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: DatasetClient.cpp,v 1.18 2001/08/01 21:50:45 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include #include "Box.H" #include "FArrayBox.H" #include "MultiFab.H" #include "TagBox.H" #include "DatasetClient.H" const int MaxBufSize = 1024; const int PortOffset = 5000; const char* const DefaultFormat = "%7.5e"; static bool CreateSocket (int& newsocket) { int sockfd; struct sockaddr_in serveraddr; char* serverhost = "localhost"; struct hostent* serverhostp; int GETUID_SERVER_PORT = getuid() + PortOffset; if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { perror("Bad client socket create"); return false; } // // Set up the socket structures. // bzero((char*)&serveraddr, sizeof(struct sockaddr_in)); serveraddr.sin_family = AF_INET; if ((serverhostp = gethostbyname(serverhost)) == (struct hostent *) 0) { cerr << "gethostbyname on " << serverhost << " failed" << endl; return false; } u_long sAddr(serveraddr.sin_addr.s_addr); bcopy(serverhostp->h_addr, (char*)&sAddr, serverhostp->h_length); serveraddr.sin_port = htons(GETUID_SERVER_PORT); // // Connect to the server. // if (connect(sockfd, (sockaddr *)&serveraddr, sizeof(serveraddr)) < 0) { perror ("Bad client connect"); return false; } newsocket = sockfd; return true; } static bool SendString (int sockfd, const char* sendstring) { int count; char ptrbuffer[MaxBufSize]; if (send(sockfd, sendstring, strlen(sendstring), 0) < 0) { perror("Bad client sendstring send"); return false; } // // Wait for acknowledgment. // if ((count = recv(sockfd, ptrbuffer, MaxBufSize, 0)) < 0) { perror("Bad sendstring ack."); return false; } ptrbuffer[count] = '\0'; return true; } static bool SendRealArray (int sockfd, Real* data[], int nvar, const int* lodim, const int* hidim) { int count; char buffer[MaxBufSize]; char ptrbuffer[MaxBufSize]; Box dataBox = Box(IntVect(lodim), IntVect(hidim)); // // Send the box. // ostrstream bufferstream(buffer, sizeof(buffer)); bufferstream << dataBox << ends; if (send(sockfd, buffer, strlen(buffer), 0) < 0) { perror("Bad client box send"); return false; } // // Wait for acknowledgment. // if ((count = recv(sockfd, buffer, MaxBufSize, 0)) < 0) { perror("Bad box ack."); return false; } buffer[count] = '\0'; // // Send nComp. // sprintf(buffer, "%d", nvar); if (send(sockfd, buffer, strlen(buffer), 0) < 0) { perror("Bad client nComp send"); return false; } // // Wait for acknowledgment. // if ((count = recv(sockfd, buffer, MaxBufSize, 0)) < 0) { perror("Bad nComp ack."); return false; } buffer[count] = '\0'; // // Send the data. // long t_long = sizeof(Real) * dataBox.numPts(); BL_ASSERT(t_long < INT_MAX); int totalDataBytes = int(t_long); for (int dataComponent = 0; dataComponent < nvar; dataComponent++) { int totalBytesSent = 0; int dataBytesRemaining = totalDataBytes; char* dataComponentStartingAddress = (char*)data[dataComponent]; while (totalBytesSent < totalDataBytes) { // // Send a chunk of data. // char* getDataHere = dataComponentStartingAddress+totalBytesSent; int dataBufferSize = dataBytesRemaining; if ((count = write(sockfd, getDataHere, dataBufferSize)) < 0) { perror("Bad client data send"); return false; } totalBytesSent += count; dataBytesRemaining -= count; } } // // Send the pointer. // ostrstream ptrbufferstream(ptrbuffer, sizeof(ptrbuffer)); ptrbufferstream << data[0] << ends; if (send(sockfd, ptrbuffer, strlen(ptrbuffer), 0) < 0) { perror("Bad client data ptr send"); return false; } // // Wait for acknowledgment. // if ((count = recv(sockfd, ptrbuffer, MaxBufSize, 0)) < 0) { perror("Bad data ptr ack."); return false; } ptrbuffer[count] = '\0'; return true; } bool ArrayViewFab (FArrayBox* fab) { return ArrayViewFabFormatLabel(fab, DefaultFormat, "Fab"); } bool ArrayView (FArrayBox* fab) { return ArrayViewFab(fab); } bool ArrayViewFabFormatLabel (FArrayBox* fab, const char* format, const char* label) { int N = fab->nComp(); if (N < 1) { cerr << "Error in ArrayView: fab nComp < 1: fab->nComp = " << N << endl; return false; } if (!fab->box().ok()) { cerr << "Error in ArrayView: bad fab box = " << fab->box() << endl; return false; } Real** dataArray = new Real*[N]; for (int d = 0; d < N; d++) dataArray[d] = fab->dataPtr(d); bool returnValue = ArrayViewRealPtrArrayNVarDims(dataArray, N, fab->box().smallEnd().getVect(), fab->box().bigEnd().getVect(), format, label); delete [] dataArray; return returnValue; } bool ArrayViewMultiFab (MultiFab* mf) { return ArrayViewMultiFabFormatLabel(mf,DefaultFormat,"MultiFab"); } bool ArrayViewMultiFabElement (MultiFab* mf, int element) { return ArrayViewMultiFabElementFormatLabel(mf, element, DefaultFormat, "MultiFab element"); } bool ArrayViewMultiFabElementFormatLabel (MultiFab* mf, int element, const char* format, const char* label) { if (!mf->ok()) { cerr << "Error in ArrayViewMultiFabComp: MultiFab is not ok()." << endl; return false; } if (element < 0 || element >= mf->length()) { cerr << "Error in ArrayViewMultiFabElement: element index is not" << endl; cerr << " within range of MultiFab.length()." << endl; cerr << " MultiFab.length() = " << mf->length() << endl; cerr << " Requested element = " << element << endl; return false; } return ArrayViewFabFormatLabel(&((*mf)[element]),format,label); } bool ArrayViewReal (Real* data, const int* lodim, const int* hidim) { return ArrayViewRealFormatLabel(data, lodim, hidim, DefaultFormat, "Real Array"); } bool ArrayViewRealFormatLabel (Real* data, const int* lodim, const int* hidim, const char* format, const char* label) { return ArrayViewRealNVarFormatLabel(data,1,lodim,hidim,format,label); } bool ArrayViewRealNVar (Real* data, int nvar, const int* lodim, const int* hidim) { return ArrayViewRealNVarFormatLabel(data, nvar, lodim, hidim, DefaultFormat, "Real Array"); } bool ArrayViewRealNVarFormatLabel (Real* data, int nvar, const int* lodim, const int* hidim, const char* format, const char* label) { if (data == 0) { cerr << "Error in ArrayView: data pointer == 0" << endl; return false; } if (nvar < 1) { cerr << "Error in ArrayView: nComp < 1: nvar = " << nvar << endl; return false; } Real** dataArray = new Real*[nvar]; long npts = 1; for (int sd = 0; sd < BL_SPACEDIM; sd++) npts *= (hidim[sd] - lodim[sd] + 1); for (int d = 0; d < nvar; d++) { char* tempCharPtr = (char*)data; tempCharPtr += d * npts * sizeof(Real); dataArray[d] = (Real*)tempCharPtr; } bool returnValue = ArrayViewRealPtrArrayNVarDims(dataArray, nvar, lodim, hidim, format, label); delete [] dataArray; return returnValue; } #if (BL_SPACEDIM == 2) bool ArrayViewRealDims (Real* data, int xlo, int ylo, int xhi, int yhi) { return ArrayViewRealDimsFormatLabel(data, xlo, ylo, xhi, yhi, DefaultFormat, "Real data"); } bool ArrayViewRealDimsFormatLabel (Real* data, int xlo, int ylo, int xhi, int yhi, const char* format, const char* label) { return ArrayViewRealNVarDimsFormatLabel(data, 1, xlo, ylo, xhi, yhi, format, label); } bool ArrayViewRealNVarDims (Real* data, int nvar, int xlo, int ylo, int xhi, int yhi) { return ArrayViewRealNVarDimsFormatLabel(data, nvar, xlo, ylo, xhi, yhi, DefaultFormat, "Real data"); } bool ArrayViewRealNVarDimsFormatLabel (Real* data, int nvar, int xlo, int ylo, int xhi, int yhi, const char* format, const char* label) { int lodims[BL_SPACEDIM], hidims[BL_SPACEDIM]; if (data == 0) { cerr << "Error in ArrayView: data pointer == 0" << endl; return false; } if (nvar < 1) { cerr << "Error in ArrayView: nComp < 1: nvar = " << nvar << endl; return false; } if (xlo > xhi) { cerr << "Error in ArrayView: xlo > xhi: " << xlo << " > " << xhi << endl; return false; } if (ylo > yhi) { cerr << "Error in ArrayView: ylo > yhi: " << ylo << " > " << yhi << endl; return false; } lodims[0] = xlo; lodims[1] = ylo; hidims[0] = xhi; hidims[1] = yhi; return ArrayViewRealNVarFormatLabel(data,nvar,lodims,hidims,format,label); } #else bool ArrayViewRealDims (Real* data, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi) { return ArrayViewRealDimsFormatLabel(data, xlo, ylo, zlo, xhi, yhi, zhi, DefaultFormat, "Real data"); } bool ArrayViewRealDimsFormatLabel (Real* data, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi, const char* format, const char* label) { return ArrayViewRealNVarDimsFormatLabel(data, 1, xlo, ylo, zlo, xhi, yhi, zhi, format, label); } bool ArrayViewRealNVarDims (Real* data, int nvar, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi) { return ArrayViewRealNVarDimsFormatLabel(data, nvar, xlo, ylo, zlo, xhi, yhi, zhi, DefaultFormat, "Real data"); } bool ArrayViewRealNVarDimsFormatLabel (Real* data, int nvar, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi, const char* format, const char* label) { int lodims[BL_SPACEDIM], hidims[BL_SPACEDIM]; if (data == 0) { cerr << "Error in ArrayView: data pointer == 0" << endl; return false; } if (nvar < 1) { cerr << "Error in ArrayView: nComp < 1: nvar = " << nvar << endl; return false; } if (xlo > xhi) { cerr << "Error in ArrayView: xlo > xhi: " << xlo << " > " << xhi << endl; return false; } if (ylo > yhi) { cerr << "Error in ArrayView: ylo > yhi: " << ylo << " > " << yhi << endl; return false; } if (zlo > zhi) { cerr << "Error in ArrayView: zlo > zhi: " << zlo << " > " << zhi << endl; return false; } lodims[0] = xlo; lodims[1] = ylo; lodims[2] = zlo; hidims[0] = xhi; hidims[1] = yhi; hidims[2] = zhi; return ArrayViewRealNVarFormatLabel(data,nvar,lodims,hidims,format,label); } #endif bool ArrayViewRealPtrArrayNVarDims (Real* data[], int nvar, const int* lodim, const int* hidim, const char* format, const char* label) { int sockfd; if (!CreateSocket(sockfd)) return false; // // Send data label. // if (!SendString(sockfd, label)) return false; // // Send format. // if (!SendString(sockfd, format)) return false; // // Send isMultiFab. // if (!SendString(sockfd, "false")) return false; // // Send the data. // return SendRealArray(sockfd, data, nvar, lodim, hidim); } bool ArrayViewMultiFabFormatLabel (MultiFab* mf, const char* format, const char* label) { int sockfd; char buffer[MaxBufSize]; if (!CreateSocket(sockfd)) return false; // // Send data label. // if (!SendString(sockfd, label)) return false; // // Send format. // if (!SendString(sockfd, format)) return false; // // Send isMultiFab. // if (!SendString(sockfd, "true")) return false; // // Send nElements. // sprintf(buffer, "%d", mf->length()); if (!SendString(sockfd, buffer)) return false; // // Send the data. // for (int element = 0; element < mf->length(); element++) { // // Construct dataArray for this element. // FArrayBox& fab = (*mf)[element]; int nvar = fab.nComp(); Real** dataArray = new Real * [nvar]; for (int d = 0; d < nvar; d++) dataArray[d] = fab.dataPtr(d); if (!SendRealArray(sockfd, dataArray, nvar, fab.box().loVect(), fab.box().hiVect())) { return false; } delete [] dataArray; } return true; } bool ArrayViewTagBox (TagBox* tb) { const int N = tb->nComp(); if (N < 1) { cerr << "Error in ArrayView: fab nComp < 1: fab->nComp = " << N << endl; return false; } if (!tb->box().ok()) { cerr << "Error in ArrayView: bad fab box = " << tb->box() << endl; return false; } // // Create a temp fab and put the TagBox values into it. // FArrayBox debugFab(tb->box(), N); for (int nv = 0; nv < N; ++nv) { Real* debugFabPtr = debugFab.dataPtr(nv); char* debugTagBoxPtr = tb->dataPtr(nv); for (int i = 0; i < tb->box().numPts() ; ++i) debugFabPtr[i] = debugTagBoxPtr[i]; } Real** dataArray = new Real*[N]; for (int d = 0; d < N; d++) dataArray[d] = debugFab.dataPtr(d); bool returnValue = ArrayViewRealPtrArrayNVarDims(dataArray, N, debugFab.box().smallEnd().getVect(), debugFab.box().bigEnd().getVect(), "%3.0f", " TagBox "); delete [] dataArray; return returnValue; } bool ArrayViewTagBoxArray (TagBoxArray* tba) { const int N = tba->nComp(); if (N < 1) { cerr << "Error in ArrayView: fab nComp < 1: fab->nComp = " << N << endl; return false; } if (!tba->ok()) { cerr << "Error in ArrayView: bad TagBoxArray." << endl; return false; } // // Create a temp MultiFab and put the TagBoxArray values into it. // MultiFab debugMultiFab(tba->boxArray(), N, tba->nGrow()); for (int nfab = 0; nfab < tba->length(); ++nfab) { FArrayBox& debugFab = debugMultiFab[nfab]; TagBox & debugTagBox = (*tba)[nfab]; for (int nv = 0; nv < N; ++nv) { Real* debugFabPtr = debugFab.dataPtr(nv); char* debugTagBoxPtr = debugTagBox.dataPtr(nv); for (int i = 0; i < debugTagBox.box().numPts() ; ++i) debugFabPtr[i] = debugTagBoxPtr[i]; } } bool returnValue = ArrayViewMultiFabFormatLabel(&debugMultiFab, "%3.0f", " TagBoxArray "); return returnValue; } // // Mumber functions of ArrayViewHelperClass -- do NOT inline these. // ArrayViewHelperClass::ArrayViewHelperClass () {} ArrayViewHelperClass::~ArrayViewHelperClass () {} ccseapps-2.5/CCSEApps/amrlib/Make.package0000644000175000017500000000206211634153073021317 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.10 2000/05/03 03:36:40 propp Exp $ # AMRLIB_BASE=EXE ifeq ($(LBASE),amr) AMRLIB_BASE=LIB endif C$(AMRLIB_BASE)_sources += Amr.cpp AmrLevel.cpp BCRec.cpp Cluster.cpp \ Derive.cpp ErrorList.cpp FluxRegister.cpp \ Interpolater.cpp SlabStat.cpp StateData.cpp \ StateDescriptor.cpp StationData.cpp TagBox.cpp C$(AMRLIB_BASE)_headers += Amr.H AmrLevel.H BCRec.H BC_TYPES.H \ Cluster.H Derive.H ErrorList.H FluxRegister.H \ LevelBld.H Interpolater.H SlabStat.H StateData.H \ StateDescriptor.H StationData.H TagBox.H PROB_AMR_F.H F$(AMRLIB_BASE)_headers += FLUXREG_F.H INTERP_F.H MAKESLICE_F.H SLABSTAT_F.H F$(AMRLIB_BASE)_sources += FILCC_$(DIM)D.F FLUXREG_$(DIM)D.F INTERP_$(DIM)D.F \ SLABSTAT_$(DIM)D.F ARRAYLIM_$(DIM)D.F ifeq ($(DIM),3) F$(AMRLIB_BASE)_sources += MAKESLICE_$(DIM)D.F endif ifeq ($(USE_ARRAYVIEW),TRUE) C$(AMRLIB_BASE)_headers += DatasetClient.H C$(AMRLIB_BASE)_sources += DatasetClient.cpp endif ccseapps-2.5/CCSEApps/amrlib/SlabStat.cpp0000644000175000017500000002410711634153073021352 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: SlabStat.cpp,v 1.15 2001/08/09 22:42:00 marc Exp $ // #include #include #include #include SlabStatRec::SlabStatRec (const std::string& name, int ncomp, Array& vars, int ngrow, int level, const BoxArray& boxes, SlabStatFunc func) : m_name(name), m_ncomp(ncomp), m_vars(vars), m_ngrow(ngrow), m_level(level), m_boxes(boxes), m_func(func), m_mf(m_boxes,m_ncomp,0), m_tmp_mf(m_boxes,m_vars.size(),m_ngrow), m_interval(0) { m_mf.setVal(0); } const std::string& SlabStatRec::name () const { return m_name; } int SlabStatRec::nComp () const { return m_ncomp; } const Array& SlabStatRec::vars () const { return m_vars; } long SlabStatRec::nVariables () const { return m_vars.size(); } int SlabStatRec::nGrow () const { return m_ngrow; } int SlabStatRec::level () const { return m_level; } const BoxArray& SlabStatRec::boxes () const { return m_boxes; } SlabStatFunc SlabStatRec::func () const { return m_func; } MultiFab& SlabStatRec::mf () { return m_mf; } MultiFab& SlabStatRec::tmp_mf () { return m_tmp_mf; } Real SlabStatRec::interval () const { return m_interval; } // // This is a helper function for the following constructor. // // It opens "file" and looks for the Boxes on which the statistic // "name" is to be calculated. // // The structure of the file: // // # // # Lines beginning with a pound sign are comments. // # // default: // N // level // b1 // b2 // ... // bN // name: // M // level // b1 // b2 // ... // bM // static void Boxes (const std::string& file, const std::string& name, BoxArray& boxes, int& boxesLevel) { const std::string TheDflt = "default:"; const std::string TheName = name + ":"; std::ifstream is(file.c_str(),std::ios::in); if (!is.good()) BoxLib::FileOpenFailed(file); #define STRIP while( is.get() != '\n' ) BoxArray ba_dflt; BoxArray ba_name; int bxLvl_dflt; int bxLvl_name; std::string line; while (std::getline(is,line)) { if (line.empty() || line[0] == '#') continue; if (line == TheDflt || line == TheName) { bool dflt = (line == TheDflt) ? true : false; int N; int lvl; Box bx; BoxList bl; is >> N; STRIP; is >> lvl; STRIP; BL_ASSERT(N > 0); for (int i = 0; i < N; i++) { is >> bx; STRIP; bl.push_back(bx); } if (dflt) { ba_dflt = BoxArray(bl); bxLvl_dflt = lvl; } else { ba_name = BoxArray(bl); bxLvl_name = lvl; } } } is.close(); if (ba_dflt.size() == 0 && ba_name.size() == 0) BoxLib::Abort("slabstats.boxes doesn't have appropriate structure"); boxes = ba_name.size() ? ba_name : ba_dflt; boxesLevel = ba_name.size() ? bxLvl_name : bxLvl_dflt; #undef STRIP } SlabStatRec::SlabStatRec (const std::string& name, int ncomp, Array& vars, int ngrow, SlabStatFunc func) : m_name(name), m_ncomp(ncomp), m_vars(vars), m_ngrow(ngrow), m_func(func), m_interval(0) { ParmParse pp("slabstat"); std::string file; if (!pp.query("boxes", file)) BoxLib::Abort("SlabStatRec: slabstat.boxes isn't defined"); Boxes(file, m_name, m_boxes, m_level); m_mf.define(m_boxes, m_ncomp, 0, Fab_allocate); m_tmp_mf.define(m_boxes, m_vars.size(), m_ngrow, Fab_allocate); m_mf.setVal(0); } SlabStatRec::~SlabStatRec () {} SlabStatList::SlabStatList () {} SlabStatList::~SlabStatList () { for (std::list::iterator li = m_list.begin(); li != m_list.end(); ++li) { delete *li; } } void SlabStatList::add (const std::string& name, int ncomp, Array& vars, int ngrow, int level, const BoxArray& boxes, SlabStatFunc func) { m_list.push_back(new SlabStatRec(name,ncomp,vars,ngrow,level,boxes,func)); } void SlabStatList::add (const std::string& name, int ncomp, Array& vars, int ngrow, SlabStatFunc func) { m_list.push_back(new SlabStatRec(name,ncomp,vars,ngrow,func)); } std::list& SlabStatList::list () { return m_list; } void SlabStatList::update (AmrLevel& amrlevel, Real time, Real dt) { for (std::list::iterator li = m_list.begin(); li != m_list.end(); ++li) { if ((*li)->level() == amrlevel.Level()) { (*li)->m_interval += dt; for (int i = 0; i < (*li)->tmp_mf().nComp(); i++) { amrlevel.derive((*li)->vars()[i],time+dt,(*li)->tmp_mf(),i); } for (MFIter dmfi((*li)->mf()); dmfi.isValid(); ++dmfi) { FArrayBox& dfab = (*li)->mf()[dmfi]; const FArrayBox& sfab = (*li)->tmp_mf()[dmfi]; const int nsrc = sfab.nComp(); const int ndst = dfab.nComp(); (*li)->func()(sfab.dataPtr(), ARLIM(sfab.box().loVect()), ARLIM(sfab.box().hiVect()), &nsrc, dfab.dataPtr(), ARLIM(dfab.box().loVect()), ARLIM(dfab.box().hiVect()), &ndst, &dt, amrlevel.Geom().CellSize()); } } } } void SlabStatList::checkPoint (PArray& amrLevels, int level0_step) { if (m_list.empty()) return; // // We put SlabStats in a subdirectory of the directory, 'slabstats'. // std::string statdir = "slabstats"; if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(statdir, 0755)) BoxLib::CreateDirectoryFailed(statdir); statdir = statdir + "/stats"; statdir = BoxLib::Concatenate(statdir, level0_step); // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(statdir, 0755)) BoxLib::CreateDirectoryFailed(statdir); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); if (ParallelDescriptor::IOProcessor()) { // // Only the IOProcessor() writes to the header file. // const std::string HeaderFileName = statdir + "/Header"; std::ofstream HeaderFile; HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc); if (!HeaderFile.good()) BoxLib::FileOpenFailed(HeaderFileName); int prec = HeaderFile.precision(30); HeaderFile << m_list.size() << '\n'; for (std::list::const_iterator li = m_list.begin(); li != m_list.end(); ++li) { HeaderFile << (*li)->name() << " " << (*li)->level() << '\n'; } HeaderFile << (*m_list.begin())->interval() << '\n'; for (int dir = 0; dir < BL_SPACEDIM; dir++) HeaderFile << Geometry::ProbLo(dir) << " "; HeaderFile << '\n'; for (int dir = 0; dir < BL_SPACEDIM; dir++) HeaderFile << Geometry::ProbHi(dir) << " "; HeaderFile << '\n'; for (int level = 0; level < amrLevels.size(); level++) { for (int dir = 0; dir < BL_SPACEDIM; dir++) HeaderFile << amrLevels[level].Geom().CellSize(dir) << " "; HeaderFile << '\n'; } HeaderFile.precision(prec); if (!HeaderFile.good()) BoxLib::Error("SlabStat::checkPoint() failed"); } // // Write out the SlabStat MultiFabs. // const std::string path = statdir + "/"; for (std::list::iterator li = m_list.begin(); li != m_list.end(); ++li) { VisMF::Write((*li)->mf(),path+(*li)->name()); (*li)->m_interval = 0; (*li)->mf().setVal(0); } } ccseapps-2.5/CCSEApps/amrlib/Interpolater.H0000644000175000017500000003436011634153073021714 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _INTERPOLATER_H_ #define _INTERPOLATER_H_ // // $Id: Interpolater.H,v 1.10 2002/09/27 19:20:00 almgren Exp $ // #include #include #include class Geometry; class FArrayBox; // //@Man: //@Memo: Virtual base class for interpolaters. /*@Doc: Specifies interpolater interface for coarse-to-fine interpolation in space. */ class Interpolater { public: // //@ManDoc: The destructor. // virtual ~Interpolater (); /*@ManDoc: Returns coarsened box given fine box and refinement ratio. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual Box CoarseBox (const Box& fine, int ratio) = 0; /*@ManDoc: Returns coarsened box given fine box and refinement ratio. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual Box CoarseBox (const Box& fine, const IntVect& ratio) = 0; /*@ManDoc: Coarse to fine interpolation in space. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr) = 0; // //@ManDoc: Re-visit the interpolation to protect against under- or overshoots. // virtual void protect (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, FArrayBox& fine_state, int state_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr) {}; }; // //@Man: //@Memo: Bilinear interpolation on node centered data. /*@Doc: Bilinear interpolation on node centered data. */ class NodeBilinear : public Interpolater { public: // //@ManDoc: The destructor. // virtual ~NodeBilinear (); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, int ratio); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, const IntVect& ratio); // //@ManDoc: Coarse to fine interpolation in space. // virtual void interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr); }; // //@Man: //@Memo: Bilinear interpolation on cell centered data. /*@Doc: Bilinear interpolation on cell centered data. */ class CellBilinear : public Interpolater { public: // //@ManDoc: The destructor. // virtual ~CellBilinear (); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, int ratio); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, const IntVect& ratio); // //@ManDoc: Coarse to fine interpolation in space. // virtual void interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr); }; // //@Man: //@Memo: Conservative interpolation on cell centered data /*@Doc: Conservative interpolation on cell centered data */ class CellConservative : public Interpolater { public: // //@ManDoc: The constructor. // CellConservative (bool limit = true); // //@ManDoc: The destructor. // virtual ~CellConservative (); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, int ratio); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, const IntVect& ratio); // //@ManDoc: Coarse to fine interpolation in space. // virtual void interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr); private: bool do_limited_slope; }; // //@Man: //@Memo: Linear conservative interpolation on cell centered data /*@Doc: Linear conservative interpolation on cell centered data I.e, conservative interpolation with a limiting scheme that preserves the value of any linear combination of the fab components; e.g., if sum\_ivar a(ic,jc,ivar)*fab(ic,jc,ivar) = 0, then sum\_ivar a(ic,jc,ivar)*fab(if,jf,ivar) = 0 is satisfied in all fine cells if,jf covering coarse cell ic,jc. If do\_linear\_limiting = 0, the interpolation scheme is identical to the used in CellConservative for do\_limited\_slopes=1. */ class CellConservativeLinear : public Interpolater { public: // //@ManDoc: The constructor. // CellConservativeLinear (bool do_linear_limiting_= true); // //@ManDoc: The destructor. // virtual ~CellConservativeLinear (); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, int ratio); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, const IntVect& ratio); // //@ManDoc: Coarse to fine interpolation in space. // virtual void interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr); private: bool do_linear_limiting; }; // //@Man: //@Memo: Lin. cons. interp. on cc data with protection against under/over-shoots. /*@Doc: Linear conservative interpolation on cell centered data but with protection against undershoots or overshoots. */ class CellConservativeProtected : public Interpolater { public: // //@ManDoc: The constructor. // CellConservativeProtected (); // //@ManDoc: The destructor. // virtual ~CellConservativeProtected (); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, int ratio); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, const IntVect& ratio); // //@ManDoc: Coarse to fine interpolation in space. // virtual void interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr); // //@ManDoc: Re-visit the interpolation to protect against under- or overshoots. // virtual void protect (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, FArrayBox& fine_state, int state_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr); }; // //@Man: //@Memo: Quadratic interpolation on cell centered data. /*@Doc: Quadratic interpolation on cell centered data. */ class CellQuadratic : public Interpolater { public: // //@ManDoc: The constructor. // CellQuadratic (bool limit = true); // //@ManDoc: The destructor. // virtual ~CellQuadratic (); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, int ratio); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, const IntVect& ratio); // //@ManDoc: Coarse to fine interpolation in space. // virtual void interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr); private: bool do_limited_slope; }; // //@Man: //@Memo: Piecewise Constant interpolation on cell centered data. /*@Doc: Piecewise Constant interpolation on cell centered data. */ class PCInterp : public Interpolater { public: // //@ManDoc: The destructor. // virtual ~PCInterp (); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, int ratio); // //@ManDoc: Returns coarsened box given fine box and refinement ratio. // virtual Box CoarseBox (const Box& fine, const IntVect& ratio); // //@ManDoc: Coarse to fine interpolation in space. // virtual void interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr); }; // // CONSTRUCT A GLOBAL OBJECT OF EACH VERSION. // extern NodeBilinear node_bilinear_interp; extern CellBilinear cell_bilinear_interp; extern CellConservative cell_cons_interp; extern CellQuadratic quadratic_interp; extern CellConservative unlimited_cc_interp; extern PCInterp pc_interp; extern CellConservativeLinear lincc_interp; extern CellConservativeLinear nonlincc_interp; extern CellConservativeProtected protected_interp; #endif /*_INTERPOLATER_H_*/ ccseapps-2.5/CCSEApps/amrlib/Cluster.cpp0000644000175000017500000002543711634153073021265 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Cluster.cpp,v 1.18 2001/08/09 16:20:37 marc Exp $ // #include #include #include #include enum CutStatus { HoleCut=0, SteepCut, BisectCut, InvalidCut }; Cluster::Cluster () : m_ar(0) {} Cluster::Cluster (IntVect* a, long len) : m_ar(a), m_len(len) { minBox(); } Cluster::~Cluster () {} const Box& Cluster::box () const { return m_bx; } bool Cluster::ok () const { return m_ar != 0 && m_len > 0; } long Cluster::numTag () const { return m_len; } Real Cluster::eff () const { BL_ASSERT(ok()); return ((Real) numTag())/((Real) m_bx.numPts()); } // // Predicate in call to std::partition() in Cluster::Cluster(Cluster,Box). // class InBox { public: InBox (const Box& b) : m_box(b) {} bool operator() (const IntVect& iv) const { return m_box.contains(iv); } private: const Box& m_box; }; Cluster::Cluster (Cluster& c, const Box& b) : m_ar(0), m_len(0) { BL_ASSERT(b.ok()); BL_ASSERT(c.m_ar != 0 && c.m_len > 0); if (b.contains(c.m_bx)) { m_bx = c.m_bx; m_ar = c.m_ar; m_len = c.m_len; c.m_ar = 0; c.m_len = 0; c.m_bx = Box(); } else { IntVect* prt_it = std::partition(c.m_ar, c.m_ar+c.m_len, InBox(b)); if (prt_it == c.m_ar) { // // None of the points in `c.m_ar' were in `b'. // m_ar = 0; m_len = 0; m_bx = Box(); } else if (prt_it == (c.m_ar+c.m_len)) { // // All the points in `c.m_ar' were in `b'. // m_bx = c.m_bx; m_ar = c.m_ar; m_len = c.m_len; c.m_ar = 0; c.m_len = 0; c.m_bx = Box(); } else { m_ar = c.m_ar; m_len = prt_it - m_ar; c.m_ar = prt_it; c.m_len = c.m_len - m_len; minBox(); c.minBox(); } } } void Cluster::distribute (ClusterList& clst, const BoxDomain& bd) { BL_ASSERT(ok()); BL_ASSERT(bd.ok()); BL_ASSERT(clst.length() == 0); for (BoxDomain::const_iterator bdi = bd.begin(); bdi != bd.end() && ok(); ++bdi) { Cluster* c = new Cluster(*this, *bdi); if (c->ok()) clst.append(c); else delete c; } } long Cluster::numTag (const Box& b) const { long cnt = 0; for (int i = 0; i < m_len; i++) { if (b.contains(m_ar[i])) cnt++; } return cnt; } void Cluster::minBox () { if (m_len == 0) { m_bx = Box(); } else { IntVect lo = m_ar[0], hi = lo; for (int i = 1; i < m_len; i++) { lo.min(m_ar[i]); hi.max(m_ar[i]); } m_bx = Box(lo,hi); } } // // Finds best cut location in histogram. // static int FindCut (const int* hist, int lo, int hi, CutStatus& status) { const int MINOFF = 2; const int CUT_THRESH = 2; status = InvalidCut; int len = hi - lo + 1; // // Check validity of histogram. // if (len <= 1) return lo; // // First find centermost point where hist == 0 (if any). // int mid = len/2; int cutpoint = -1; int i; for (i = 0; i < len; i++) { if (hist[i] == 0) { status = HoleCut; if (abs(cutpoint-mid) > abs(i-mid)) { cutpoint = i; if (i > mid) break; } } } if (status == HoleCut) return lo + cutpoint; // // If we got here, there was no obvious cutpoint, try // finding place where change in second derivative is max. // Array dhist(len,0); for (i = 1; i < len-1; i++) dhist[i] = hist[i+1] - 2*hist[i] + hist[i-1]; int locmax = -1; for (i = 0+MINOFF; i < len-MINOFF; i++) { int iprev = dhist[i-1]; int icur = dhist[i]; int locdif = abs(iprev-icur); if (iprev*icur < 0 && locdif >= locmax) { if (locdif > locmax) { status = SteepCut; cutpoint = i; locmax = locdif; } else { // // Select location nearest center of range. // if (abs(i-mid) < abs(cutpoint-mid)) cutpoint = i; } } } if (locmax <= CUT_THRESH) { // // Just recommend a bisect cut. // cutpoint = mid; status = BisectCut; } return lo + cutpoint; } // // Predicate in call to std::partition() in Cluster::chop(). // class Cut { public: Cut (const IntVect& cut, int dir) : m_cut(cut), m_dir(dir) {} bool operator() (const IntVect& iv) const { return iv[m_dir] < m_cut[m_dir] ? true : false; } private: const IntVect& m_cut; int m_dir; }; Cluster* Cluster::chop () { BL_ASSERT(m_len > 1); BL_ASSERT(!(m_ar == 0)); const int* lo = m_bx.loVect(); const int* hi = m_bx.hiVect(); const int* len = m_bx.length().getVect(); // // Compute histogram. // int* hist[BL_SPACEDIM]; for (int n = 0; n < BL_SPACEDIM; n++) { hist[n] = new int[len[n]]; for (int i = 0; i < len[n]; i++) hist[n][i] = 0; } for (int n = 0; n < m_len; n++) { const int* p = m_ar[n].getVect(); D_TERM( hist[0][p[0]-lo[0]]++;, hist[1][p[1]-lo[1]]++;, hist[2][p[2]-lo[2]]++; ) } // // Find cutpoint and cutstatus in each index direction. // CutStatus mincut = InvalidCut; CutStatus status[BL_SPACEDIM]; IntVect cut; for (int n = 0, mincount = 0; n < BL_SPACEDIM; n++) { cut[n] = FindCut(hist[n], lo[n], hi[n], status[n]); if (status[n] < mincut) { mincut = status[n]; mincount = 1; } else if (status[n] == mincut) { mincount++; } } BL_ASSERT(mincut != InvalidCut); // // Select best cutpoint and direction. // int dir; for (int n = 0, minlen = -1; n < BL_SPACEDIM; n++) { if (status[n] == mincut) { int mincutlen = std::min(cut[n]-lo[n],hi[n]-cut[n]); if (mincutlen > minlen) { dir = n; minlen = mincutlen; } } } BL_ASSERT(dir >= 0 && dir < BL_SPACEDIM); int nlo = 0; for (int i = lo[dir]; i < cut[dir]; i++) nlo += hist[dir][i-lo[dir]]; BL_ASSERT(nlo > 0 && nlo < m_len); int nhi = m_len - nlo; for (int i = 0; i < BL_SPACEDIM; i++) delete [] hist[i]; IntVect* prt_it = std::partition(m_ar, m_ar+m_len, Cut(cut,dir)); BL_ASSERT((prt_it-m_ar) == nlo); BL_ASSERT(((m_ar+m_len)-prt_it) == nhi); m_len = nlo; minBox(); return new Cluster(prt_it, nhi); } ClusterList::ClusterList () : lst() {} ClusterList::ClusterList (IntVect* pts, long len) { lst.push_back(new Cluster(pts,len)); } ClusterList::~ClusterList () { for (std::list::iterator cli = lst.begin(); cli != lst.end(); ++cli) { delete *cli; } } int ClusterList::length () const { return lst.size(); } void ClusterList::append (Cluster* c) { lst.push_back(c); } BoxArray ClusterList::boxArray () const { BoxArray ba(lst.size()); int i = 0; for (std::list::const_iterator cli = lst.begin(); cli != lst.end(); ++cli, ++i) { ba.set(i,(*cli)->box()); } return ba; } void ClusterList::boxArray (BoxArray& ba) const { ba.clear(); ba.resize(lst.size()); int i = 0; for (std::list::const_iterator cli = lst.begin(); cli != lst.end(); ++cli, ++i) { ba.set(i,(*cli)->box()); } } BoxList ClusterList::boxList() const { BoxList blst; for (std::list::const_iterator cli = lst.begin(); cli != lst.end(); ++cli) { blst.push_back((*cli)->box()); } return blst; } void ClusterList::boxList (BoxList& blst) const { blst.clear(); for (std::list::const_iterator cli = lst.begin(); cli != lst.end(); ++cli) { blst.push_back((*cli)->box()); } } void ClusterList::chop (Real eff) { for (std::list::iterator cli = lst.begin(); cli != lst.end(); ) { if ((*cli)->eff() < eff) { lst.push_back((*cli)->chop()); } else { ++cli; } } } void ClusterList::intersect (const BoxDomain& dom) { for (std::list::iterator cli = lst.begin(); cli != lst.end(); ) { Cluster* c = *cli; if (dom.contains(c->box())) { ++cli; } else { BoxDomain bxdom; BoxLib::intersect(bxdom, dom, c->box()); if (bxdom.size() > 0) { ClusterList clst; c->distribute(clst,bxdom); lst.splice(lst.end(),clst.lst); } // // Must explicitly delete c. // delete c; lst.erase(cli++); } } } ccseapps-2.5/CCSEApps/amrlib/SLABSTAT_3D.F0000644000175000017500000002420011634153073020775 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: SLABSTAT_3D.F,v 1.4 2002/11/27 21:54:19 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "SPACE.H" #include "CONSTANTS.H" #include "ArrayLim.H" #include "SLABSTAT_F.H" #define SDIM 3 c c ::: ----------------------------------------------------------- c ::: This is a general routine to calculate the running statistics c ::: required to calculate the Reynolds averaged first four moments c ::: of the state components passed in. This is a general routine c ::: and will work for any number of state components. If the state c ::: is passed in in the order (a, b, c, d), then the running averages c ::: which are returned are in the order, c ::: , , , , c ::: , , , , c ::: , , , , c ::: , , , c ::: c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: runStats <= Array to contain the running statistics c ::: DIMS(runStats) => Dimensions of the running statistics array c ::: nStats => Number of components in the statistics array c ::: state =) Array containing the state data c ::: DIMS(state) => Dimensions of the state data array c ::: nStateComp => Number of components in the state array c ::: dt => Time step c ::: delta => Grid spacing c ::: ----------------------------------------------------------- c subroutine FORT_REYNAVG_FIRST4MOMS(state, DIMS(state), nStateComp, $ runStats, DIMS(runStats), nStats, $ dt, delta) implicit none c c ::::: passed variables c integer nStats, nStateComp integer DIMDEC(state) integer DIMDEC(runStats) REAL_T dt REAL_T delta(SDIM) REAL_T runStats(DIMV(runStats),nStats) REAL_T state(DIMV(state),nStateComp) c c ::::: local variables c integer i, j, k, n, nghost integer loStats(SDIM), hiStats(SDIM) integer loState(SDIM), hiState(SDIM) c c =================================== c ::: Set the Values of LO and HI ::: c =================================== c call SET_LOHI(DIMS(runStats), loStats, hiStats) call SET_LOHI(DIMS(state), loState, hiState) #ifndef NDEBUG if (nStats .NE. 4*nStateComp) then write(*,1000) nStats, nStateComp 1000 format('Incorrect relationship between nStats and nStateComp in', $ /'FORT_REYNAVG_FIRST4MOMS. Should have nStats = 4*nStateComp', $ /' nStats = ', I5, 5x, 'nStateComp = ', I5) call bl_error("stop") endif nghost = 0 do n = 1, SDIM if (loState(n) .GT. loStats(n) - nghost .OR. $ hiState(n) .LT. hiStats(n) + nghost) then write(*,1010) n, nghost, loStats, hiStats, loState, hiState 1010 format('Incorrect number of ghost cells in the state date in', $ /'FORT_REYNAVG_FIRST4MOMS.', $ /' Direction = ', I2, 5x, 'nghost = ', I2, $ /' loStats = ', SDIM (I2,1x), 5x, 'hiStats = ', SDIM (I2,1x), $ /' loState = ', SDIM (I2,1x), 5x, 'hiState = ', SDIM (I2,1x)) call bl_error("stop") endif enddo #endif c c ==================================== c ::: Calculate Running Statistics ::: c ==================================== c do n = 1, nStateComp do k = loStats(3), hiStats(3) do j = loStats(2), hiStats(2) do i = loStats(1), hiStats(1) runStats(i,j,k,n) = runStats(i,j,k,n) $ + dt * state(i,j,k,n) runStats(i,j,k,n+nStateComp) = runStats(i,j,k,n+nStateComp) $ + dt * state(i,j,k,n)**2 runStats(i,j,k,n+2*nStateComp) = runStats(i,j,k,n+2*nStateComp) $ + dt * state(i,j,k,n)**3 runStats(i,j,k,n+3*nStateComp) = runStats(i,j,k,n+3*nStateComp) $ + dt * state(i,j,k,n)**4 enddo enddo enddo enddo c c return end c c ::: ----------------------------------------------------------- c ::: This is a general routine to calculate the running statistics c ::: required to calculate the Favre averaged first four moments c ::: of the state components passed in. This is a general routine c ::: and will work for any number of state components. The first state c ::: component is assumed to be density, so it is used in the Favre averages. c ::: If the state is passed in in the order (Rho, a, b, c, d), c ::: then the running averages which are returned are in the order, c ::: , , , , , c ::: , , , , , c ::: , , , , , c ::: , , , , c ::: c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: runStats <= Array to contain the running statistics c ::: DIMS(runStats) => Dimensions of the running statistics array c ::: nStats => Number of components in the statistics array c ::: state =) Array containing the state data c ::: DIMS(state) => Dimensions of the state data array c ::: nStateComp => Number of components in the state array c ::: dt => Time step c ::: delta => Grid spacing c ::: ----------------------------------------------------------- c subroutine FORT_FAVREAVG_FIRST4MOMS(state, DIMS(state), nStateComp, $ runStats, DIMS(runStats), nStats, $ dt, delta) implicit none c c ::::: passed variables c integer nStats, nStateComp integer DIMDEC(state) integer DIMDEC(runStats) REAL_T dt REAL_T delta(SDIM) REAL_T runStats(DIMV(runStats),nStats) REAL_T state(DIMV(state),nStateComp) c c ::::: local variables c integer i, j, k, n, nghost integer loStats(SDIM), hiStats(SDIM) integer loState(SDIM), hiState(SDIM) c c =================================== c ::: Set the Values of LO and HI ::: c =================================== c call SET_LOHI(DIMS(runStats), loStats, hiStats) call SET_LOHI(DIMS(state), loState, hiState) #ifndef NDEBUG if (nStats .NE. 4*nStateComp) then write(*,1000) nStats, nStateComp 1000 format('Incorrect relationship between nStats and nStateComp in', $ /'FORT_FAVREAVG_FIRST4MOMS. Should have nStats = 4*nStateComp', $ /' nStats = ', I5, 5x, 'nStateComp = ', I5) call bl_error("stop") endif nghost = 0 do n = 1, SDIM if (loState(n) .GT. loStats(n) - nghost .OR. $ hiState(n) .LT. hiStats(n) + nghost) then write(*,1010) n, nghost, loStats, hiStats, loState, hiState 1010 format('Incorrect number of ghost cells in the state date in', $ /'FORT_FAVREAVG_FIRST4MOMS.', $ /' Direction = ', I2, 5x, 'nghost = ', I2, $ /' loStats = ', SDIM (I2,1x), 5x, 'hiStats = ', SDIM (I2,1x), $ /' loState = ', SDIM (I2,1x), 5x, 'hiState = ', SDIM (I2,1x)) call bl_error("stop") endif enddo #endif c c ==================================== c ::: Calculate Running Statistics ::: c ==================================== c do k = loStats(3), hiStats(3) do j = loStats(2), hiStats(2) do i = loStats(1), hiStats(1) runStats(i,j,k,1) = runStats(i,j,k,1) + dt * state(i,j,k,1) runStats(i,j,k,1+nStateComp) = runStats(i,j,k,1+nStateComp) $ + dt * state(i,j,k,1)**2 runStats(i,j,k,1+2*nStateComp) = runStats(i,j,k,1+2*nStateComp) $ + dt * state(i,j,k,1)**3 runStats(i,j,k,1+3*nStateComp) = runStats(i,j,k,1+3*nStateComp) $ + dt * state(i,j,k,1)**4 enddo enddo enddo do n = 2, nStateComp do k = loStats(3), hiStats(3) do j = loStats(2), hiStats(2) do i = loStats(1), hiStats(1) runStats(i,j,k,n) = runStats(i,j,k,n) $ + dt * (state(i,j,k,1) * state(i,j,k,n)) runStats(i,j,k,n+nStateComp) = runStats(i,j,k,n+nStateComp) $ + dt * (state(i,j,k,1) * state(i,j,k,n))**2 runStats(i,j,k,n+2*nStateComp) = runStats(i,j,k,n+2*nStateComp) $ + dt * (state(i,j,k,1) * state(i,j,k,n))**3 runStats(i,j,k,n+3*nStateComp) = runStats(i,j,k,n+3*nStateComp) $ + dt * (state(i,j,k,1) * state(i,j,k,n))**4 enddo enddo enddo enddo c c return end ccseapps-2.5/CCSEApps/amrlib/INTERP_F.H0000644000175000017500000002122211634153073020503 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _INTERP_NAMES_H #define _INTERP_NAMES_H /* ** $Id: INTERP_F.H,v 1.13 2002/10/07 20:44:37 almgren Exp $ */ #ifdef BL_LANG_FORT # define FORT_NBINTERP nbinterp # define FORT_CBINTERP cbinterp # define FORT_CCINTERP ccinterp # define FORT_LINCCINTERP linccinterp # define FORT_CQINTERP cqinterp # define FORT_CCINTERP2 ccinterp2 # define FORT_PCINTERP pcinterp # define FORT_PROTECT_INTERP printerp #else # ifdef BL_FORT_USE_UPPERCASE # define FORT_NBINTERP NBINTERP # define FORT_CBINTERP CBINTERP # define FORT_CCINTERP CCINTERP # define FORT_LINCCINTERP LINCCINTERP # define FORT_CQINTERP CQINTERP # define FORT_CCINTERP2 CCINTERP2 # define FORT_PCINTERP PCINTERP # define FORT_PROTECT_INTERP PRINTERP # else # ifdef BL_FORT_USE_LOWERCASE # define FORT_NBINTERP nbinterp # define FORT_CBINTERP cbinterp # define FORT_CCINTERP ccinterp # define FORT_LINCCINTERP linccinterp # define FORT_CQINTERP cqinterp # define FORT_CCINTERP2 ccinterp2 # define FORT_PCINTERP pcinterp # define FORT_PROTECT_INTERP printerp # else # define FORT_NBINTERP nbinterp_ # define FORT_CBINTERP cbinterp_ # define FORT_CCINTERP ccinterp_ # define FORT_LINCCINTERP linccinterp_ # define FORT_CQINTERP cqinterp_ # define FORT_CCINTERP2 ccinterp2_ # define FORT_PCINTERP pcinterp_ # define FORT_PROTECT_INTERP printerp_ # endif # endif #include extern "C" { void FORT_NBINTERP (const Real* crse, ARLIM_P(clo), ARLIM_P(chi), ARLIM_P(cblo), ARLIM_P(cbhi), Real* fine, ARLIM_P(flo), ARLIM_P(fhi), ARLIM_P(fblo), ARLIM_P(fbhi), D_DECL(const int* lrx,const int* lry,const int* lrz), const int* nvar, Real* slope, const int* num_slope); void FORT_CBINTERP (const Real* crse, ARLIM_P(clo), ARLIM_P(chi), ARLIM_P(cblo), ARLIM_P(cbhi), Real* fine, ARLIM_P(flo), ARLIM_P(fhi), ARLIM_P(fblo), ARLIM_P(fbhi), D_DECL(const int* lrx,const int* lry,const int* lrz), const int* nvar, Real* slope, const int* num_slope, Real* strip, const int* strip_lo, const int* strip_hi); void FORT_CCINTERP (Real* fine, ARLIM_P(flo), ARLIM_P(fhi), ARLIM_P(fblo), ARLIM_P(fbhi), const int* nvar, D_DECL(const int* lrx,const int* lry,const int* lrz), const Real* crse, const int* clo, const int* chi, ARLIM_P(cblo), ARLIM_P(cbhi), const int* fslo, const int* fshi, Real* cslope, const int* clen, Real* fslope, Real* fdat, const int* flen, Real* voff, const int* bc, const int* lim_slope, D_DECL(const Real* fvcx,const Real* fvcy, const Real* fvcz), D_DECL(const Real* cvcx,const Real* cvcy, const Real* cvcz), Real* cmax, Real* cmin, Real* alpha); void FORT_CCINTERP2 (Real* fine, const int* flo, const int* fhi, ARLIM_P(fblo), ARLIM_P(fbhi), const int* nvar, D_DECL(const int* lrx,const int* lry,const int* lrz), const Real* crse, const int* clo, const int* chi, ARLIM_P(cblo), ARLIM_P(cbhi), const int* fslo, const int* fshi, Real* cslope, const int* clen, Real* fslope, Real* fdat, const int* flen, Real* voff, const int* bc, const int* lim_slope, D_DECL(const Real* fvcx,const Real* fvcy, const Real* fvcz), D_DECL(const Real* cvcx,const Real* cvcy, const Real* cvcz)); void FORT_LINCCINTERP (Real* fine, ARLIM_P(flo), ARLIM_P(fhi), const int* fblo, const int* fbhi, ARLIM_P(fvcblo), ARLIM_P(fvcbhi), const Real* crse, ARLIM_P(clo), ARLIM_P(chi), ARLIM_P(cvcblo), ARLIM_P(cvcbhi), Real* ucc_xslopes, Real* lcc_xslopes, Real* xslope_factors, Real* ucc_yslopes, Real* lcc_yslopes, Real* yslope_factors, #if (BL_SPACEDIM==3) Real* ucc_zslopes, Real* lcc_zslopes, Real* zslope_factors, #endif ARLIM_P(csblo), ARLIM_P(csbhi), const int* csblo, const int* csbhi, const int* nvar, D_DECL(const int* lrx,const int* lry,const int* lrz), const int* bc, const int* lim_limit, D_DECL(const Real* fvcx,const Real* fvcy, const Real* fvcz), D_DECL(const Real* cvcx,const Real* cvcy, const Real* cvcz), D_DECL(const Real* voffx,const Real* voffy, const Real* voffz)); void FORT_CQINTERP (Real* fine, ARLIM_P(flo), ARLIM_P(fhi), ARLIM_P(fblo), ARLIM_P(fbhi), const int* nvar, D_DECL(const int* lrx,const int* lry,const int* lrz), const Real* crse, const int* clo, const int* chi, ARLIM_P(cblo), ARLIM_P(cbhi), const int* fslo, const int* fshi, Real* cslope, const int* clen, Real* fslope, Real* fdat, const int* flen, Real* voff, const int* bc, const int* lim_slope, D_DECL(const Real* fvcx,const Real* fvcy, const Real* fvcz), D_DECL(const Real* cvcx,const Real* cvcy, const Real* cvcz)); void FORT_PCINTERP (const Real* crse, ARLIM_P(clo), ARLIM_P(chi), const int* cblo, const int* cbhi, Real* fine, ARLIM_P(flo), ARLIM_P(fhi), const int* fblo, const int* fbhi, const int* longdir, D_DECL(const int* lrx,const int* lry,const int* lrz), const int* nvar, Real* strip, const int* strip_lo, const int* strip_hi); void FORT_PROTECT_INTERP ( Real* fine, ARLIM_P(flo), ARLIM_P(fhi), const int* fblo, const int* fbhi, const Real* crse, ARLIM_P(clo), ARLIM_P(chi), const int* cblo, const int* cbhi, #if (BL_SPACEDIM == 2) const Real* fvcx, const Real* fvcy, ARLIM_P(fblo), ARLIM_P(fbhi), const Real* cvcx, const Real* cvcy, ARLIM_P(cblo), ARLIM_P(cbhi), #endif Real* state, ARLIM_P(slo), ARLIM_P(shi), const int* nvar, D_DECL(const int* lrx,const int* lry,const int* lrz), const int* bc); } #endif #endif /*_INTERP_NAMES_H*/ ccseapps-2.5/CCSEApps/amrlib/MAKESLICE_F.H0000644000175000017500000000511311634153073021000 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MAKESLICE_F_H_ #define _MAKESLICE_F_H_ /* ** $Id: MAKESLICE_F.H,v 1.7 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT #if (BL_SPACEDIM==3) # define FORT_MAKESLICE makeslice # define FORT_MAKEMASKSLICE makemaskslice #endif #else # ifdef BL_FORT_USE_UPPERCASE #if (BL_SPACEDIM==3) # define FORT_MAKESLICE MAKESLICE # define FORT_MAKEMASKSLICE MAKEMASKSLICE #endif # else # ifdef BL_FORT_USE_LOWERCASE #if (BL_SPACEDIM==3) # define FORT_MAKESLICE makeslice # define FORT_MAKEMASKSLICE makemaskslice #endif # else #if (BL_SPACEDIM==3) # define FORT_MAKESLICE makeslice_ # define FORT_MAKEMASKSLICE makemaskslice_ #endif # endif # endif extern "C" { #if (BL_SPACEDIM==3) void FORT_MAKESLICE(const Real* data1,ARLIM_P(data1l), ARLIM_P(data1h), Real* data2,ARLIM_P(data2l), ARLIM_P(data2h), Real* data_min, Real* data_max,Real* slice_val, int* slice,const Real* dx); void FORT_MAKEMASKSLICE(const int* data1,ARLIM_P(data1l), ARLIM_P(data1h), int* data2,ARLIM_P(data2l), ARLIM_P(data2h), Real* data_min, Real* data_max,Real* slice_val, int* slice,const Real* dx); #endif }; #endif #endif /*_MAKESLICE_F_H_*/ ccseapps-2.5/CCSEApps/amrlib/PROB_AMR_F.H0000644000175000017500000000464211634153073020752 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _PROB_AMR_F_H_ #define _PROB_AMR_F_H_ /* ** $Id: PROB_AMR_F.H,v 1.9 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_PROBINIT probinit #ifdef BL_SYNC_RANTABLES # define FORT_SYNC_RANTABLES syncrantables #endif #else # ifdef BL_FORT_USE_UPPERCASE # define FORT_PROBINIT PROBINIT #ifdef BL_SYNC_RANTABLES # define FORT_SYNC_RANTABLES SYNCRANTABLES #endif # else # ifdef BL_FORT_USE_LOWERCASE # define FORT_PROBINIT probinit #ifdef BL_SYNC_RANTABLES # define FORT_SYNC_RANTABLES syncrantables #endif # else # define FORT_PROBINIT probinit_ #ifdef BL_SYNC_RANTABLES # define FORT_SYNC_RANTABLES syncrantables_ #endif # endif # endif extern "C" { void FORT_PROBINIT (const int* init, const int* name, const int* namelen, const Real* problo, const Real* probhi); #ifdef BL_SYNC_RANTABLES void FORT_SYNC_RANTABLES (Real *RanPhaseTable, Real *RanAmplTable, const int* igetput); #endif } #endif #endif /*_PROB_AMR_F_H_*/ ccseapps-2.5/CCSEApps/amrlib/MAKESLICE_3D.F0000644000175000017500000001531111634153073021060 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: MAKESLICE_3D.F,v 1.7 1998/11/03 18:16:38 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "ArrayLim.H" #include "REAL.H" #include "CONSTANTS.H" #include "MAKESLICE_F.H" #define SDIM 3 #define npart 20 subroutine FORT_MAKEMASKSLICE(data1,DIMS(data1), & data2,DIMS(data2),data_min,data_max,slice_val,slice,dx) integer DIMDEC(data1) integer DIMDEC(data2) integer data1(DIMV(data1)) integer data2(DIMV(data2)) REAL_T dx(SDIM) REAL_T data_min,data_max,slice_val integer slice integer dlo1(SDIM), dhi1(SDIM) integer dlo2(SDIM), dhi2(SDIM) integer index,idx1,idx2,found,i,j,k,kval,kval1,kval2 integer leftval,rightval REAL_T zval,tval,floatdata dlo1(1) = ARG_L1(data1) dlo1(2) = ARG_L2(data1) dlo1(3) = ARG_L3(data1) dhi1(1) = ARG_H1(data1) dhi1(2) = ARG_H2(data1) dhi1(3) = ARG_H3(data1) dlo2(1) = ARG_L1(data2) dlo2(2) = ARG_L2(data2) dlo2(3) = ARG_L3(data2) dhi2(1) = ARG_H1(data2) dhi2(2) = ARG_H2(data2) dhi2(3) = ARG_H3(data2) if ((dlo2(3).ne.0).or.(dhi2(3).ne.0)) then write (6,*) "second data must be thin!" end if if (slice.eq.0) then idx1=1 idx2=2 index=3 else if (slice.eq.1) then idx1=1 idx2=3 index=2 else idx1=2 idx2=3 index=1 end if if ( (dlo1(idx1).ne.dlo2(1)).or.(dlo1(idx2).ne.dlo2(2)).or. & (dhi1(idx1).ne.dhi2(1)).or.(dhi1(idx2).ne.dhi2(2)) ) then write (6,*) "thin data must jive with 3d data!" end if found=0 do k=dlo1(index)-1,dhi1(index) zval=(k+half)*dx(index) if ((slice_val.ge.zval).and.(slice_val.le.zval+dx(index)).and. & (found.eq.0)) then found=1 kval=k end if end do if (found.eq.0) then write (6,*) "slice data out of range!" end if kval1=kval kval2=kval+1 if (kval1.lt.dlo1(index)) then kval1=kval2 end if if (kval2.gt.dhi1(index)) then kval2=kval1 end if do i=dlo1(idx1),dhi1(idx1) do j=dlo1(idx2),dhi1(idx2) zval=(kval+half)*dx(index) if (slice.eq.0) then leftval=data1(i,j,kval1) rightval=data1(i,j,kval2) else if (slice.eq.1) then leftval=data1(i,kval1,j) rightval=data1(i,kval2,j) else if (slice.eq.2) then leftval=data1(kval1,i,j) rightval=data1(kval2,i,j) end if tval=(slice_val-zval)/dx(index) floatdata=leftval*(one-tval)+rightval*tval if (floatdata.gt.zero) then data2(i,j,0)=1 else data2(i,j,0)=0 end if end do end do end subroutine FORT_MAKESLICE(data1,DIMS(data1), & data2,DIMS(data2),data_min,data_max,slice_val, & slice,dx) integer DIMDEC(data1) integer DIMDEC(data2) REAL_T data1(DIMV(data1)) REAL_T data2(DIMV(data2)) REAL_T dx(SDIM) REAL_T data_min,data_max,slice_val integer slice integer index,idx1,idx2,found,i,j,k,kval,kval1,kval2 REAL_T zval,leftval,rightval,tval integer dlo1(SDIM),dhi1(SDIM) integer dlo2(SDIM),dhi2(SDIM) dlo1(1) = ARG_L1(data1) dlo1(2) = ARG_L2(data1) dlo1(3) = ARG_L3(data1) dhi1(1) = ARG_H1(data1) dhi1(2) = ARG_H2(data1) dhi1(3) = ARG_H3(data1) dlo2(1) = ARG_L1(data2) dlo2(2) = ARG_L2(data2) dlo2(3) = ARG_L3(data2) dhi2(1) = ARG_H1(data2) dhi2(2) = ARG_H2(data2) dhi2(3) = ARG_H3(data2) if ((dlo2(3).ne.0).or.(dhi2(3).ne.0)) then write (6,*) "second data must be thin!" end if if (slice.eq.0) then idx1=1 idx2=2 index=3 else if (slice.eq.1) then idx1=1 idx2=3 index=2 else idx1=2 idx2=3 index=1 end if if ( (dlo1(idx1).ne.dlo2(1)).or.(dlo1(idx2).ne.dlo2(2)).or. & (dhi1(idx1).ne.dhi2(1)).or.(dhi1(idx2).ne.dhi2(2)) ) then write (6,*) "thin data must jive with 3d data!" end if found=0 do k=dlo1(index)-1,dhi1(index) zval=(k+half)*dx(index) if ((slice_val.ge.zval).and.(slice_val.le.zval+dx(index)).and. & (found.eq.0)) then found=1 kval=k end if end do if (found.eq.0) then write (6,*) "slice data out of range!" end if kval1=kval kval2=kval+1 if (kval1.lt.dlo1(index)) then kval1=kval2 end if if (kval2.gt.dhi1(index)) then kval2=kval1 end if do i=dlo1(idx1),dhi1(idx1) do j=dlo1(idx2),dhi1(idx2) zval=(kval+half)*dx(index) if (slice.eq.0) then leftval=data1(i,j,kval1) rightval=data1(i,j,kval2) else if (slice.eq.1) then leftval=data1(i,kval1,j) rightval=data1(i,kval2,j) else if (slice.eq.2) then leftval=data1(kval1,i,j) rightval=data1(kval2,i,j) end if tval=(slice_val-zval)/dx(index) data2(i,j,0)=leftval*(one-tval)+rightval*tval end do end do end ccseapps-2.5/CCSEApps/amrlib/GNUmakefile0000644000175000017500000000435011634153073021201 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.10 1999/05/24 18:11:44 car Exp $ # PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) # # Variables for the user to set ... # PRECISION = DOUBLE DEBUG = TRUE DIM = 3 COMP = KCC USE_MPI = TRUE # # The base name of the library we're building. # LBASE = amr # # Where libraries and include files will be installed. # INSTALL_ROOT = $(TOP) include $(TOP)/mk/Make.defs # # Here's where we enable the accessibility of ArrayView. # USE_ARRAYVIEW = FALSE # # Use ArrayView on OSF1 ... # ifeq ($(MACHINE),OSF1) USE_ARRAYVIEW = TRUE endif ifeq ($(USE_ARRAYVIEW),TRUE) DEFINES += -DBL_USE_ARRAYVIEW endif include ./Make.package INCLUDE_LOCATIONS += $(TOP)/include ifeq ($(KCC_VERSION),3.3) CXXFLAGS += --one_instantiation_per_object endif all: $(optionsLib) # # Libraries to close against. # ifeq ($(COMP), KCC) LibsToCloseAgainst := $(TOP)/lib/$(machineSuffix)/libbndry$(DIM)d.a LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libbox$(DIM)d.a $(optionsLib): $(LibsToCloseAgainst) endif include $(TOP)/mk/Make.rules # # Temp stuff for doing html docs. # _docHeaders := $(sort $(wildcard *.H)) _htmlDir := html # # This will make the HTML files in the directory html provided # any of the relevant .H files have changed more recently than the # directory itself. # html: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ $(RM) -r $(_htmlDir); \ mkdir -p $(_htmlDir); \ doc++ -f -j -B Banner.html -d $(_htmlDir) $(_docHeaders); \ fi AmrLib.tex: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ doc++ -f -t -j -o AmrLib.tex -ep docxx_squish $(_docHeaders); \ sed '/[\]usepackage[{]docxx[}]/d' < AmrLib.tex > .junk; \ mv .junk AmrLib.tex; \ fi AmrLib.dvi: AmrLib.tex latex AmrLib.tex; latex AmrLib.tex AmrLib.ps: AmrLib.dvi dvips AmrLib.dvi -o AmrLib.ps # # Install the PostScript file into $(INSTALL_ROOT)/ps # install_ps: AmrLib.ps -if [ ! -d $(INSTALL_ROOT)/ps ]; then \ mkdir -p $(INSTALL_ROOT)/ps; \ chmod 755 $(INSTALL_ROOT)/ps; \ fi $(INSTALL_DATA) AmrLib.ps $(INSTALL_ROOT)/ps ccseapps-2.5/CCSEApps/amrlib/LevelBld.H0000644000175000017500000000612611634153073020734 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _LEVELBLD_H_ #define _LEVELBLD_H_ // // $Id: LevelBld.H,v 1.6 2000/10/02 20:48:42 lijewski Exp $ // #include #include #include #include #include extern LevelBld* getLevelBld (); // //@Man: //@Memo: Builds problem-specific AmrLevels. /*@Doc: Abstract base class specifying an interface for building problem-specific AmrLevels. */ class LevelBld { public: /*@ManDoc: Perform any problem-dependent setup such as physical boundary condition and derived quantities. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void variableSetUp () = 0; /*@ManDoc: Perform any problem-dependent cleanup. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void variableCleanUp () = 0; /*@ManDoc: This is a virtual constructor for types derived from AmrLevel. The derived type is initialized with the default constructor. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual AmrLevel* operator() () = 0; /*@ManDoc: This is a virtual constructor for types derived from AmrLevel. The derived type is initialized with the five specified variables. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual AmrLevel* operator() (Amr& papa, int lev, const Geometry& geom_lev, const BoxArray& ba, Real time) = 0; }; #endif /*_LEVELBLD_H_*/ ccseapps-2.5/CCSEApps/amrlib/FLUXREG_3D.F0000644000175000017500000004044711634153073020707 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: FLUXREG_3D.F,v 1.10 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "FLUXREG_F.H" #include "ArrayLim.H" #if defined(BL_USE_FLOAT) || defined(BL_T3E) || defined(BL_CRAY) #define BL_USE_FLOAT_CONST #define onetominuseight 1.0e-8 #else #define BL_USE_DOUBLE_CONST #define onetominuseight 1.0d-8 #endif #define SDIM 3 c ::: ----------------------------------------------------------- c ::: Init coarse grid flux into flux register c ::: c ::: INPUTS/OUTPUTS: c ::: flx => flux array c ::: DIMS(flx) => index limits for flx c ::: reg <= flux register c ::: DIMS(reg) => index limits for reg c ::: lo,hi => region of update c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRCRSEINIT (reg,DIMS(reg),flx,DIMS(flx),lo,hi, & numcomp,dir,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer lo(SDIM), hi(SDIM) integer numcomp, dir REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) integer n, i, j, k do n = 1, numcomp do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) reg(i,j,k,n) = mult*flx(i,j,k,n) end do end do end do end do end c ::: ----------------------------------------------------------- c ::: Init coarse grid flux (times area) into flux register c ::: c ::: INPUTS/OUTPUTS: c ::: flx => flux array c ::: DIMS(flx) => index limits for flx c ::: area => aread of cell edge c ::: DIMS(area) => index limits for area c ::: reg <= flux register c ::: DIMS(reg) => index limits for reg c ::: lo,hi => region of update c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRCAINIT (reg,DIMS(reg),flx,DIMS(flx), & area,DIMS(area),lo,hi, & numcomp,dir,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer DIMDEC(area) integer lo(SDIM), hi(SDIM) integer numcomp, dir REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) REAL_T area(DIMV(area)) integer n, i, j, k do n = 1, numcomp do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) reg(i,j,k,n) = mult*area(i,j,k)*flx(i,j,k,n) end do end do end do end do end c ::: ----------------------------------------------------------- c ::: Add fine grid flux to flux register. Flux array is a fine grid c ::: edge based object, Register is a coarse grid edge based object. c ::: It is assumed that the coarsened flux region contains the register c ::: region. c ::: c ::: INPUTS/OUTPUTS: c ::: reg <=> edge centered coarse grid flux register c ::: DIMS(reg) => index limits for reg c ::: flx => edge centered fine grid flux array c ::: DIMS(flx) => index limits for flx c ::: numcomp => number of components to update c ::: dir => direction normal to flux register c ::: ratio(3) => refinement ratios between coarse and fine c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRFINEADD(reg,DIMS(reg),flx,DIMS(flx), & numcomp,dir,ratio,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer ratio(3), dir, numcomp REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) integer n, i, j, k, ic, jc, kc, ioff, joff, koff integer ratiox, ratioy, ratioz ratiox = ratio(1) ratioy = ratio(2) ratioz = ratio(3) if (dir .eq. 0) then c c ::::: flux normal to X direction c ic = ARG_L1(reg) i = ic*ratiox if (ARG_L1(reg) .ne. ARG_H1(reg)) then call bl_abort("FORT_FRFINEADD: bad register direction") end if if (i .lt. ARG_L1(flx) .or. i .gt. ARG_H1(flx)) then call bl_abort("FORT_FRFINEADD: index outside flux range") end if do n = 1, numcomp do koff = 0, ratioz-1 do kc = ARG_L3(reg), ARG_H3(reg) k = ratioz*kc + koff do joff = 0, ratioy-1 do jc = ARG_L2(reg), ARG_H2(reg) j = ratioy*jc + joff reg(ic,jc,kc,n) = reg(ic,jc,kc,n) + mult*flx(i,j,k,n) end do end do end do end do end do else if (dir .eq. 1) then c ::::: flux normal to Y direction jc = ARG_L2(reg) j = jc*ratioy if (ARG_L2(reg) .ne. ARG_H2(reg)) then call bl_abort("FORT_FRFINEADD: bad register direction") end if if (j .lt. ARG_L2(flx) .or. j .gt. ARG_H2(flx)) then call bl_abort("FORT_FRFINEADD: index outside flux range") end if do n = 1, numcomp do koff = 0, ratioz-1 do kc = ARG_L3(reg), ARG_H3(reg) k = ratioz*kc + koff do ioff = 0, ratiox-1 do ic = ARG_L1(reg), ARG_H1(reg) i = ratiox*ic + ioff reg(ic,jc,kc,n) = reg(ic,jc,kc,n) + mult*flx(i,j,k,n) end do end do end do end do end do else c c ::::: flux normal to Z direction c kc = ARG_L3(reg) k = kc*ratioz if (ARG_L3(reg) .ne. ARG_H3(reg)) then call bl_abort("FORT_FRFINEADD: bad register direction") end if if (k .lt. ARG_L3(flx) .or. k .gt. ARG_H3(flx)) then call bl_abort("FORT_FRFINEADD: index outside flux range") end if do n = 1, numcomp do joff = 0, ratioy-1 do jc = ARG_L2(reg), ARG_H2(reg) j = ratioy*jc + joff do ioff = 0, ratiox-1 do ic = ARG_L1(reg), ARG_H1(reg) i = ratiox*ic + ioff reg(ic,jc,kc,n) = reg(ic,jc,kc,n) + mult*flx(i,j,k,n) end do end do end do end do end do end if end c ::: ----------------------------------------------------------- c ::: Add fine grid flux times area to flux register. c ::: Flux array is a fine grid edge based object, Register is a c ::: coarse grid edge based object. c ::: It is assumed that the coarsened flux region contains the register c ::: region. c ::: c ::: INPUTS/OUTPUTS: c ::: reg <=> edge centered coarse grid flux register c ::: DIMS(reg) => index limits for reg c ::: flx => edge centered fine grid flux array c ::: DIMS(flx) => index limits for flx c ::: area => edge centered area array c ::: DIMS(area) => index limits for area c ::: numcomp => number of components to update c ::: dir => direction normal to flux register c ::: ratio(3) => refinement ratios between coarse and fine c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRFAADD(reg,DIMS(reg),flx,DIMS(flx),area,DIMS(area), & numcomp,dir,ratio,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer DIMDEC(area) integer ratio(3), dir, numcomp REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) REAL_T area(DIMV(area)) integer n, i, j, k, ic, jc, kc, ioff, joff, koff integer ratiox, ratioy, ratioz ratiox = ratio(1) ratioy = ratio(2) ratioz = ratio(3) if (dir .eq. 0) then c c ::::: flux normal to X direction c ic = ARG_L1(reg) i = ic*ratiox if (ARG_L1(reg) .ne. ARG_H1(reg)) then call bl_abort("FORT_FRFAADD: bad register direction") end if if (i .lt. ARG_L1(flx) .or. i .gt. ARG_H1(flx)) then call bl_abort("FORT_FRFAADD: index outside flux range") end if do n = 1, numcomp do koff = 0, ratioz-1 do kc = ARG_L3(reg), ARG_H3(reg) k = ratioz*kc + koff do joff = 0, ratioy-1 do jc = ARG_L2(reg), ARG_H2(reg) j = ratioy*jc + joff reg(ic,jc,kc,n) = reg(ic,jc,kc,n) + & mult*area(i,j,k)*flx(i,j,k,n) end do end do end do end do end do else if (dir .eq. 1) then c c ::::: flux normal to Y direction c jc = ARG_L2(reg) j = jc*ratioy if (ARG_L2(reg) .ne. ARG_H2(reg)) then call bl_abort("FORT_FRFAADD: bad register direction") end if if (j .lt. ARG_L2(flx) .or. j .gt. ARG_H2(flx)) then call bl_abort("FORT_FRFAADD: index outside flux range") end if do n = 1, numcomp do koff = 0, ratioz-1 do kc = ARG_L3(reg), ARG_H3(reg) k = ratioz*kc + koff do ioff = 0, ratiox-1 do ic = ARG_L1(reg), ARG_H1(reg) i = ratiox*ic + ioff reg(ic,jc,kc,n) = reg(ic,jc,kc,n) + & mult*area(i,j,k)*flx(i,j,k,n) end do end do end do end do end do else c c ::::: flux normal to Z direction c kc = ARG_L3(reg) k = kc*ratioz if (ARG_L3(reg) .ne. ARG_H3(reg)) then call bl_abort("FORT_FRFAADD: bad register direction") end if if (k .lt. ARG_L3(flx) .or. k .gt. ARG_H3(flx)) then call bl_abort("FORT_FRFAADD: index outside flux range") end if do n = 1, numcomp do joff = 0, ratioy-1 do jc = ARG_L2(reg), ARG_H2(reg) j = ratioy*jc + joff do ioff = 0, ratiox-1 do ic = ARG_L1(reg), ARG_H1(reg) i = ratiox*ic + ioff reg(ic,jc,kc,n) = reg(ic,jc,kc,n) + & mult*area(i,j,k)*flx(i,j,k,n) end do end do end do end do end do end if end c :: c :: -------------------------------------------------------------- c :: reflux: reflux the data on the outer boundary of c :: a fine grid. c :: c :: Inputs/Outputs c :: s <=> state data array c :: DIMS(s) => index limits of s array c :: vol => volume array c :: DIMS(vol) => index limits of vol array c :: reg => flux register c :: DIMS(reg) => index limits of reg array c :: lo,hi => subregion of s array to be updated c :: numcomp => number of components to update c :: mult => multiplative factor (+1 or -1 depending on nomal) c :: -------------------------------------------------------------- c :: subroutine FORT_FRREFLUX (s,DIMS(s),vol,DIMS(vol),reg,DIMS(reg), & lo,hi,numcomp,mult) integer DIMDEC(s) integer DIMDEC(vol) integer DIMDEC(reg) integer lo(SDIM), hi(SDIM) integer numcomp REAL_T mult REAL_T s(DIMV(s),numcomp) REAL_T vol(DIMV(vol)) REAL_T reg(DIMV(reg),numcomp) integer n, i, j, k do n = 1, numcomp do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) s(i,j,k,n) = s(i,j,k,n) + mult*reg(i,j,k,n)/vol(i,j,k) end do end do end do end do end c :: c :: -------------------------------------------------------------- c :: cvreflux: constant volume version of reflux c :: c :: Inputs/Outputs c :: s <=> state data array c :: DIMS(s) => index limits of s array c :: dx => cell size c :: reg => flux register c :: DIMS(reg) => index limits of reg array c :: lo,hi => subregion of s array to be updated c :: numcomp => number of components to update c :: mult => multiplative factor (+1 or -1 depending on nomal) c :: -------------------------------------------------------------- c :: subroutine FORT_FRCVREFLUX (s,DIMS(s),dx,reg,DIMS(reg),lo,hi, & numcomp,mult) integer DIMDEC(s) integer DIMDEC(reg) integer lo(SDIM), hi(SDIM) integer numcomp REAL_T mult, dx(SDIM) REAL_T reg(DIMV(reg),numcomp) REAL_T s(DIMV(s),numcomp) integer n, i, j, k REAL_T vmult vmult = mult/(dx(1)*dx(2)*dx(3)) do n = 1, numcomp do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) s(i,j,k,n) = s(i,j,k,n) + vmult*reg(i,j,k,n) end do end do end do end do end c ::: ----------------------------------------------------------- c ::: Add flux register into coarse grid flux (opposite of standard reflux ops) c ::: c ::: INPUTS/OUTPUTS: c ::: flx => flux array c ::: DIMS(flx) => index limits for flx c ::: reg <= flux register c ::: DIMS(reg) => index limits for reg c ::: lo,hi => region of update c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_SCALADDTO (flx,DIMS(flx),area,DIMS(area),reg,DIMS(reg), $ lo,hi,numcomp,mult) integer DIMDEC(flx) integer DIMDEC(area) integer DIMDEC(reg) integer lo(SDIM), hi(SDIM) integer numcomp REAL_T mult REAL_T flx(DIMV(flx),numcomp) REAL_T area(DIMV(area)) REAL_T reg(DIMV(reg),numcomp) integer n, i, j, k, istart if (area(lo(1),lo(2),lo(3)) .lt. onetominuseight) then do n = 1, numcomp do k = lo(3), hi(3) do j = lo(2), hi(2) flx(lo(1),j,k,n) = flx(lo(1),j,k,n) end do end do end do istart = lo(1)+1 else istart = lo(1) end if do n = 1, numcomp do k = lo(3), hi(3) do j = lo(2), hi(2) do i = istart, hi(1) flx(i,j,k,n) = flx(i,j,k,n) + mult*reg(i,j,k,numcomp)/area(i,j,k) end do end do end do end do end ccseapps-2.5/CCSEApps/amrlib/StateDescriptor.cpp0000644000175000017500000003621011634153073022752 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: StateDescriptor.cpp,v 1.18 2003/02/06 18:14:29 lijewski Exp $ // #include #include #include #include #include #include #include StateDescriptor::BndryFunc::BndryFunc () : m_func(0), m_gfunc(0) {} StateDescriptor::BndryFunc::BndryFunc (BndryFuncDefault inFunc) : m_func(inFunc), m_gfunc(0) {} StateDescriptor::BndryFunc::BndryFunc (BndryFuncDefault inFunc, BndryFuncDefault gFunc) : m_func(inFunc), m_gfunc(gFunc) {} StateDescriptor::BndryFunc* StateDescriptor::BndryFunc::clone () const { return new BndryFunc(*this); } StateDescriptor::BndryFunc::~BndryFunc () {} void StateDescriptor::BndryFunc::operator () (Real* data,const int* lo,const int* hi, const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc) const { BL_ASSERT(m_func != 0); m_func(data,ARLIM(lo),ARLIM(hi),dom_lo,dom_hi,dx,grd_lo,time,bc); } void StateDescriptor::BndryFunc::operator () (Real* data,const int* lo,const int* hi, const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc, bool) const { BL_ASSERT(m_gfunc != 0); m_gfunc(data,ARLIM(lo),ARLIM(hi),dom_lo,dom_hi,dx,grd_lo,time,bc); } DescriptorList::DescriptorList () : desc(PArrayManage) {} void DescriptorList::clear () { desc.clear(); } int DescriptorList::size () const { return desc.size(); } void DescriptorList::resetComponentBCs (int indx, int comp, const BCRec& bc, const StateDescriptor::BndryFunc& func) { desc[indx].resetComponentBCs(comp,bc,func); } void DescriptorList::setComponent (int indx, int comp, const std::string& nm, const BCRec& bc, const StateDescriptor::BndryFunc& func, Interpolater* interp, int max_map_start_comp, int min_map_end_comp) { desc[indx].setComponent(comp,nm,bc,func,interp,max_map_start_comp,min_map_end_comp); } void DescriptorList::setComponent (int indx, int comp, const Array& nm, const Array& bc, const StateDescriptor::BndryFunc& func, Interpolater* interp) { for (int i = 0; i < nm.size(); i++) { const bool master = (i == 0) ? true : false; desc[indx].setComponent(comp+i,nm[i],bc[i],func,interp,master,nm.size()); } } const StateDescriptor& DescriptorList::operator[] (int k) const { return desc[k]; } void DescriptorList::addDescriptor (int indx, IndexType typ, StateDescriptor::TimeCenter ttyp, int nextra, int num_comp, Interpolater* interp, bool extrap) { if (indx >= desc.size()) desc.resize(indx+1); desc.set(indx,new StateDescriptor(typ,ttyp,indx,nextra,num_comp,interp,extrap)); } StateDescriptor::StateDescriptor () : id(-1), ncomp(0), ngrow(0), mapper(0), m_extrap(false), bc_func(PArrayManage), t_type(Point) {} StateDescriptor::StateDescriptor (IndexType btyp, StateDescriptor::TimeCenter ttyp, int ident, int nextra, int num_comp, Interpolater* interp, bool extrap) : type(btyp), t_type(ttyp), id(ident), ngrow(nextra), ncomp(num_comp), mapper(interp), m_extrap(extrap), bc_func(PArrayManage) { BL_ASSERT (num_comp > 0); names.resize(num_comp); bc.resize(num_comp); bc_func.resize(num_comp); mapper_comp.resize(num_comp); m_master.resize(num_comp); m_groupsize.resize(num_comp); max_map_start_comp.resize(num_comp); min_map_end_comp.resize(num_comp); } StateDescriptor::~StateDescriptor () { mapper = 0; } void StateDescriptor::resetComponentBCs (int comp, const BCRec& bcr, const BndryFunc& func) { BL_ASSERT(comp >= 0 && comp < ncomp); bc_func.clear(comp); bc_func.set(comp,func.clone()); bc[comp] = bcr; } IndexType StateDescriptor::getType () const { return type; } StateDescriptor::TimeCenter StateDescriptor::timeType () const { return t_type; } int StateDescriptor::nComp () const { return ncomp; } int StateDescriptor::nExtra () const { return ngrow; } Interpolater* StateDescriptor::interp () const { return mapper; } Interpolater* StateDescriptor::interp (int i) const { return mapper_comp[i] == 0 ? mapper : mapper_comp[i]; } const std::string& StateDescriptor::name (int i) const { return names[i]; } const BCRec& StateDescriptor::getBC (int i) const { return bc[i]; } const Array& StateDescriptor::getBCs () const { return bc; } bool StateDescriptor::extrap () const { return m_extrap; } const StateDescriptor::BndryFunc& StateDescriptor::bndryFill (int i) const { return bc_func[i]; } int StateDescriptor::inRange (int sc, int nc) const { return sc>=0 && sc+nc<=ncomp; } void StateDescriptor::define (IndexType btyp, StateDescriptor::TimeCenter ttyp, int ident, int nextra, int num_comp, Interpolater* interp, bool extrap) { type = btyp; t_type = ttyp; id = ident; ngrow = nextra; ncomp = num_comp; mapper = interp; m_extrap = extrap; BL_ASSERT (num_comp > 0); names.resize(num_comp); bc.resize(num_comp); bc_func.resize(num_comp); mapper_comp.resize(num_comp); m_master.resize(num_comp); m_groupsize.resize(num_comp); max_map_start_comp.resize(num_comp); min_map_end_comp.resize(num_comp); } void StateDescriptor::setComponent (int comp, const std::string& nm, const BCRec& bcr, const StateDescriptor::BndryFunc& func, Interpolater* interp, int max_map_start_comp_, int min_map_end_comp_) { bc_func.clear(comp); bc_func.set(comp,func.clone()); names[comp] = nm; bc[comp] = bcr; mapper_comp[comp] = interp; m_master[comp] = false; m_groupsize[comp] = 0; if (max_map_start_comp_>=0 && min_map_end_comp_>=0) { BL_ASSERT(comp >= max_map_start_comp_ && comp <= min_map_end_comp_ && min_map_end_comp_ < ncomp); max_map_start_comp[comp] = max_map_start_comp_; min_map_end_comp[comp] = min_map_end_comp_; } else { max_map_start_comp[comp] = comp; min_map_end_comp[comp] = comp; } } void StateDescriptor::setComponent (int comp, const std::string& nm, const BCRec& bcr, const StateDescriptor::BndryFunc& func, Interpolater* interp, bool master, int groupsize) { setComponent(comp,nm,bcr,func,interp,-1,-1); m_master[comp] = master; m_groupsize[comp] = groupsize; } void StateDescriptor::dumpNames (std::ostream& os, int start_comp, int num_comp) const { BL_ASSERT(start_comp >= 0 && start_comp+num_comp <= ncomp); for (int k = 0; k < num_comp; k++) { os << names[start_comp+k] << ' '; } } void StateDescriptor::setUpMaps (int& use_default_map, const Interpolater* default_map, int start_comp, int num_comp, Interpolater**& maps, int& nmaps, int*& map_start_comp, int*& map_num_comp, int*& max_start_comp, int*& min_end_comp) const { BL_ASSERT(start_comp>=0 && start_comp+num_comp-1 < ncomp && num_comp>0); maps = 0; map_start_comp = 0; map_num_comp = 0; max_start_comp = 0; min_end_comp = 0; // // First, count number of interpolaters needed and allocate. // Interpolater* map = mapper_comp[start_comp]; if (!map) map = (Interpolater*) default_map; nmaps = 1; int icomp = start_comp+1; use_default_map = 1; while (icomp < start_comp+num_comp) { Interpolater* mapper_icomp = mapper_comp[icomp]; if (!mapper_icomp) { mapper_icomp = (Interpolater *) default_map; } else { use_default_map = 0; } if (map != mapper_icomp) { map = mapper_icomp; nmaps++; } icomp++; } if (use_default_map) return; maps = new Interpolater*[nmaps]; map_start_comp = new int[nmaps]; map_num_comp = new int[nmaps]; min_end_comp = new int[nmaps]; max_start_comp = new int[nmaps]; // // Now fill the slots. // int imap = 0; if (mapper_comp[start_comp]) { maps[imap] = mapper_comp[start_comp]; } else { maps[imap] = (Interpolater *) default_map; } icomp = start_comp+1; map_start_comp[imap] = start_comp; map_num_comp[imap] = 1; min_end_comp[imap] = min_map_end_comp[start_comp]; max_start_comp[imap] = max_map_start_comp[start_comp]; while (icomp < start_comp+num_comp) { Interpolater* mapper_icomp = mapper_comp[icomp]; if (!mapper_icomp) mapper_icomp = (Interpolater *) default_map; if (maps[imap] != mapper_icomp) { imap++; BL_ASSERT (imap < nmaps); maps[imap] = mapper_icomp; map_start_comp[imap] = icomp; map_num_comp[imap] = 1; min_end_comp[imap] = min_map_end_comp[icomp]; max_start_comp[imap] = max_map_start_comp[icomp]; } else { map_num_comp[imap]++; min_end_comp[imap] = std::max(min_end_comp[imap],min_map_end_comp[icomp]); max_start_comp[imap] = std::min(max_start_comp[imap],max_map_start_comp[icomp]); } icomp++; } } void StateDescriptor::cleanUpMaps (Interpolater**& maps, int*& map_start_comp, int*& map_num_comp, int*& max_start_comp, int*& min_end_comp) const { delete [] maps; delete [] map_start_comp; delete [] map_num_comp; delete [] max_start_comp; delete [] min_end_comp; } bool StateDescriptor::identicalInterps (int scomp, int ncomp) const { BL_ASSERT(scomp >= 0); BL_ASSERT(ncomp >= 1); Interpolater* map = interp(scomp); for (int i = scomp+1; i < scomp+ncomp; i++) if (!(map == interp(i))) return false; return true; } std::vector< std::pair > StateDescriptor::sameInterps (int scomp, int ncomp) const { BL_ASSERT(scomp >= 0); BL_ASSERT(ncomp >= 1); std::vector< std::pair > range; Interpolater* map = interp(scomp); int SComp = scomp, NComp = 1; for (int i = scomp+1; i < scomp+ncomp; i++) { if (map == interp(i)) { NComp++; } else { range.push_back(std::pair(SComp,NComp)); map = interp(i); SComp = i; NComp = 1; } } range.push_back(std::pair(SComp,NComp)); #ifndef NDEBUG int sum = 0; for (int i = 0; i < range.size(); i++) sum += range[i].second; BL_ASSERT(sum == ncomp); #endif return range; } ccseapps-2.5/CCSEApps/amrlib/Derive.cpp0000644000175000017500000001552211634153073021054 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Derive.cpp,v 1.16 2001/08/09 22:42:00 marc Exp $ // #include #include #include #include DeriveRec::DeriveRec (const std::string& name, IndexType result_type, int nvar_derive, DeriveFunc der_func, DeriveBoxMap box_map, Interpolater* interp) : derive_name(name), der_type(result_type), n_derive(nvar_derive), variable_names(), func(der_func), mapper(interp), bx_map(box_map), n_state(0), nsr(0), rng(0), bcr(0) {} DeriveRec::DeriveRec (const std::string& name, IndexType result_type, int nvar_derive, Array& var_names, DeriveFunc der_func, DeriveBoxMap box_map, Interpolater* interp) : derive_name(name), der_type(result_type), n_derive(nvar_derive), variable_names(var_names), func(der_func), mapper(interp), bx_map(box_map), n_state(0), nsr(0), rng(0), bcr(0) {} DeriveRec::~DeriveRec () { delete [] bcr; func = 0; mapper = 0; bx_map = 0; while (rng != 0) { StateRange* r = rng; rng = rng->next; delete r; } } const std::string& DeriveRec::name () const { return derive_name; } IndexType DeriveRec::deriveType () const { return der_type; } DeriveFunc DeriveRec::derFunc () const { return func; } DeriveRec::DeriveBoxMap DeriveRec::boxMap () const { return bx_map; } Interpolater* DeriveRec::interp () const { return mapper; } int DeriveRec::numDerive () const { return n_derive; } int DeriveRec::numRange () const { return nsr; } int DeriveRec::numState () const { return n_state; } const int* DeriveRec::getBC () const { return bcr; } void DeriveRec::addRange (const DescriptorList& d_list, int state_indx, int src_comp, int num_comp) { const StateDescriptor& d = d_list[state_indx]; StateRange* r = new StateRange; r->typ = state_indx; r->sc = src_comp; r->nc = num_comp; r->next = 0; // // Add to end of list. // if (rng == 0) { rng = r; } else { StateRange* prev = rng; while (prev->next != 0) prev = prev->next; prev->next = r; } nsr++; n_state += num_comp; buildBC(d_list); } void DeriveRec::getRange (int k, int& state_indx, int& src_comp, int& num_comp) const { StateRange* r; for (r = rng; r != 0 && k > 0; k--, r = r->next) ; BL_ASSERT(r != 0); state_indx = r->typ; src_comp = r->sc; num_comp = r->nc; } void DeriveRec::buildBC (const DescriptorList& d_list) { BL_ASSERT(nsr > 0); delete [] bcr; bcr = new int[2*BL_SPACEDIM*n_state]; int* bci = bcr; for (DeriveRec::StateRange* r = rng; r != 0; r = r->next) { const StateDescriptor& d = d_list[r->typ]; for (int k = 0; k < r->nc; k++) { const int* bc = d.getBC(r->sc + k).vect(); for (int j = 0; j < 2*BL_SPACEDIM; j++) { bci[j] = bc[j]; } bci += 2*BL_SPACEDIM; } } } const std::string& DeriveRec::variableName(int comp) const { if (comp < variable_names.size()) return variable_names[comp]; return derive_name; } DeriveList::DeriveList () {} void DeriveList::add (const std::string& name, IndexType result_type, int nvar_der, DeriveFunc der_func, DeriveRec::DeriveBoxMap bx_map, Interpolater* interp) { lst.push_back(DeriveRec(name,result_type,nvar_der,der_func,bx_map,interp)); } void DeriveList::add (const std::string& name, IndexType res_typ, int nvar_der, Array& vars, DeriveFunc der_func, DeriveRec::DeriveBoxMap bx_map, Interpolater* interp) { lst.push_back(DeriveRec(name,res_typ,nvar_der,vars,der_func,bx_map,interp)); } std::list& DeriveList::dlist () { return lst; } bool DeriveList::canDerive (const std::string& name) const { for (std::list::const_iterator li = lst.begin(); li != lst.end(); ++li) { if (li->derive_name == name) return true; } return false; } const DeriveRec* DeriveList::get (const std::string& name) const { for (std::list::const_iterator li = lst.begin(); li != lst.end(); ++li) { if (li->derive_name == name) return &(*li); } return 0; } void DeriveList::addComponent (const std::string& name, const DescriptorList& d_list, int state_indx, int s_comp, int n_comp) { std::list::iterator li = lst.begin(); for ( ; li != lst.end(); ++li) { if (li->derive_name == name) break; } BL_ASSERT (li != lst.end()); li->addRange(d_list, state_indx, s_comp, n_comp); } ccseapps-2.5/CCSEApps/amrlib/DatasetClient.H0000644000175000017500000001746411634153073021776 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _DATASETCLIENT_H_ #define _DATASETCLIENT_H_ // // $Id: DatasetClient.H,v 1.2 2000/10/02 20:48:41 lijewski Exp $ // extern "C" { // // "format" is the printf format for numerical display ( ex: "%5.3f" ). // "label" is the first part of the window title ( ex: "myfabname" ). // "element" is a single element of a MultiFab (which is a fab). // "nvar" is the number of variables in a Real array. // "lodim" and "hidim" are array dimensions of size [BL_SPACEDIM] // bool ArrayView (FArrayBox* fab); bool ArrayViewFab (FArrayBox* fab); bool ArrayViewFabFormatLabel (FArrayBox* fab, const char* format, const char* label); // // View a single fab from the multifab. // bool ArrayViewMultiFabElement (MultiFab* multifab, int element); bool ArrayViewMultiFabElementFormatLabel (MultiFab* multifab, int element, const char* format, const char* label); // // View the entire multifab. // bool ArrayViewMultiFab (MultiFab* multifab); bool ArrayViewMultiFabFormatLabel (MultiFab* multifab, const char* format, const char* label); bool ArrayViewReal (Real* data, const int* lodim, const int* hidim); bool ArrayViewRealFormatLabel (Real* data, const int* lodim, const int* hidim, const char* format, const char* label); bool ArrayViewRealNVar (Real* data, int nvar, const int* lodim, const int* hidim); bool ArrayViewRealNVarFormatLabel (Real* data, int nvar, const int* lodim, const int* hidim, const char* format, const char* label); #if (BL_SPACEDIM == 2) bool ArrayViewRealDims (Real* data, int xlo, int ylo, int xhi, int yhi); bool ArrayViewRealDimsFormatLabel (Real* data, int xlo, int ylo, int xhi, int yhi, const char* format, const char* label); bool ArrayViewRealNVarDims (Real* data, int nvar, int xlo, int ylo, int xhi, int yhi); bool ArrayViewRealNVarDimsFormatLabel (Real* data, int nvar, int xlo, int ylo, int xhi, int yhi, const char* format, const char* label); #else bool ArrayViewRealDims (Real* data, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi); bool ArrayViewRealDimsFormatLabel (Real* data, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi, const char* format, const char* label); bool ArrayViewRealNVarDims (Real* data, int nvar, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi); bool ArrayViewRealNVarDimsFormatLabel (Real* data, int nvar, int xlo, int ylo, int zlo, int xhi, int yhi, int zhi, const char* format, const char* label); #endif bool ArrayViewRealPtrArrayNVarDims (Real* data[], int nvar, const int* lodim, const int* hidim, const char* format, const char* label); // // Stuff for TagBoxs and TagBoxArrays as well. // bool ArrayViewTagBox (TagBox* tb); bool ArrayViewTagBoxArray (TagBoxArray* tba); }; // // This class is a helper class for the ArrayView stuff. // // We define it's member functions in the same module as the above defined // functions that we want accessible by the debugger. We then define an // object of this class in any module that includes this file. Since the // compiler MUST construct and destruct that object, it'll have to link in // the module that contains those member functions, which just happens to // contain the definitions for the above functions. // class ArrayViewHelperClass { public: ArrayViewHelperClass (); ~ArrayViewHelperClass (); }; static ArrayViewHelperClass An_Array_View_Helper_Class_Object; #endif /*_DATASETCLIENT_H_*/ ccseapps-2.5/CCSEApps/amrlib/FLUXREG_F.H0000644000175000017500000001110511634153073020615 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _FLUXREG_F_H_ #define _FLUXREG_F_H_ "%W% %G%" #ifdef BL_LANG_FORT # define FORT_FRCRSEINIT frcrseinit # define FORT_FRFINEADD frfineadd # define FORT_FRCAINIT frcainit # define FORT_FRFAADD frfaadd # define FORT_FRREFLUX frreflux # define FORT_FRCVREFLUX frcvreflux # define FORT_SCALADDTO scaladdto #else # ifdef BL_FORT_USE_UPPERCASE # define FORT_FRCRSEINIT FRCRSEINIT # define FORT_FRFINEADD FRFINEADD # define FORT_FRCAINIT FRCAINIT # define FORT_FRFAADD FRFAADD # define FORT_FRREFLUX FRREFLUX # define FORT_FRCVREFLUX FRCVREFLUX # define FORT_SCALADDTO SCALADDTO # else # ifdef BL_FORT_USE_LOWERCASE # define FORT_FRCRSEINIT frcrseinit # define FORT_FRFINEADD frfineadd # define FORT_FRCAINIT frcainit # define FORT_FRFAADD frfaadd # define FORT_FRREFLUX frreflux # define FORT_FRCVREFLUX frcvreflux # define FORT_SCALADDTO scaladdto # else # define FORT_FRCRSEINIT frcrseinit_ # define FORT_FRFINEADD frfineadd_ # define FORT_FRCAINIT frcainit_ # define FORT_FRFAADD frfaadd_ # define FORT_FRREFLUX frreflux_ # define FORT_FRCVREFLUX frcvreflux_ # define FORT_SCALADDTO scaladdto_ # endif # endif #include extern "C" { void FORT_FRCRSEINIT (Real* reg, ARLIM_P(rlo), ARLIM_P(rhi), const Real* flx, ARLIM_P(flo), ARLIM_P(fhi), const int* lo, const int* hi, const int* numcomp, const int* dir, const Real* mult); void FORT_FRCAINIT (Real* reg, ARLIM_P(rlo), ARLIM_P(rhi), const Real* flx, ARLIM_P(flo), ARLIM_P(fhi), const Real* area, ARLIM_P(alo), ARLIM_P(ahi), const int* lo, const int* hi, const int* numcomp, const int* dir, const Real* mult); void FORT_FRFINEADD (Real* reg, ARLIM_P(rlo), ARLIM_P(rhi), const Real* flx, ARLIM_P(flo), ARLIM_P(fhi), const int* numcomp, const int* dir, const int* ratio, const Real* mult); void FORT_FRFAADD (Real* reg, ARLIM_P(rlo), ARLIM_P(rhi), const Real* flx, ARLIM_P(flo), ARLIM_P(fhi), const Real* area, ARLIM_P(alo), ARLIM_P(ahi), const int* numcomp, const int* dir, const int* ratio, const Real* mult); void FORT_FRREFLUX (Real* s, ARLIM_P(slo), ARLIM_P(shi), const Real* vol, ARLIM_P(vlo), ARLIM_P(vhi), const Real* reg, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const int* numcomp, const Real* mult); void FORT_FRCVREFLUX (Real* s, ARLIM_P(slo), ARLIM_P(shi), const Real* dx, const Real* reg, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const int* numcomp, const Real* mult); void FORT_SCALADDTO (Real * flx, ARLIM_P(flo), ARLIM_P(fhi), const Real * area, ARLIM_P(alo), ARLIM_P(ahi), Real * reg, ARLIM_P(rlo), ARLIM_P(rhi), const int * lo, const int * hi, const int * numcomp, const Real * mult); } #endif #endif ccseapps-2.5/CCSEApps/amrlib/AmrLevel.cpp0000644000175000017500000013171511634153073021350 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: AmrLevel.cpp,v 1.94 2003/03/07 17:39:39 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include DescriptorList AmrLevel::desc_lst; DeriveList AmrLevel::derive_lst; SlabStatList AmrLevel::slabstat_lst; void AmrLevel::postCoarseTimeStep (Real time) {} int AmrLevel::Level () const { return level; } const BoxArray& AmrLevel::boxArray () const { return grids; } int AmrLevel::numGrids () const { return grids.size(); } const Array& AmrLevel::gridLocations () const { return grid_loc; } const Box& AmrLevel::Domain () const { return geom.Domain(); } int AmrLevel::nStep () const { return parent->levelSteps(level); } const Geometry& AmrLevel::Geom () const { return geom; } void AmrLevel::setPhysBoundaryValues (int state_indx, int comp, int ncomp, int do_new) { state[state_indx].FillBoundary(geom.CellSize(), geom.ProbDomain(), comp, ncomp, do_new); } StateData& AmrLevel::get_state_data (int state_indx) { return state[state_indx]; } MultiFab& AmrLevel::get_old_data (int state_indx) { return state[state_indx].oldData(); } const MultiFab& AmrLevel::get_old_data (int state_indx) const { return state[state_indx].oldData(); } MultiFab& AmrLevel::get_new_data (int state_indx) { return state[state_indx].newData(); } const MultiFab& AmrLevel::get_new_data (int state_indx) const { return state[state_indx].newData(); } const DescriptorList& AmrLevel::get_desc_lst () { return desc_lst; } SlabStatList& AmrLevel::get_slabstat_lst () { return slabstat_lst; } void AmrLevel::set_preferred_boundary_values (MultiFab& S, int state_index, int scomp, int dcomp, int ncomp, Real time) const {} DeriveList& AmrLevel::get_derive_lst () { return derive_lst; } void AmrLevel::manual_tags_placement (TagBoxArray& tags, Array& bf_lev) {} AmrLevel::AmrLevel () { parent = 0; level = -1; } AmrLevel::AmrLevel (Amr& papa, int lev, const Geometry& level_geom, const BoxArray& ba, Real time) : geom(level_geom), grids(ba) { level = lev; parent = &papa; fine_ratio = IntVect::TheUnitVector(); fine_ratio.scale(-1); crse_ratio = IntVect::TheUnitVector(); crse_ratio.scale(-1); if (level > 0) { crse_ratio = parent->refRatio(level-1); } if (level < parent->maxLevel()) { fine_ratio = parent->refRatio(level); } state.resize(desc_lst.size()); for (int i = 0; i < state.size(); i++) { state[i].define(geom.Domain(), grids, desc_lst[i], time, parent->dtLevel(lev)); } finishConstructor(); } void AmrLevel::restart (Amr& papa, std::istream& is, bool bReadSpecial) { parent = &papa; is >> level; is >> geom; fine_ratio = IntVect::TheUnitVector(); fine_ratio.scale(-1); crse_ratio = IntVect::TheUnitVector(); crse_ratio.scale(-1); if (level > 0) { crse_ratio = parent->refRatio(level-1); } if (level < parent->maxLevel()) { fine_ratio = parent->refRatio(level); } if (bReadSpecial) { BoxLib::readBoxArray(grids, is, bReadSpecial); } else { grids.readFrom(is); } int nstate; is >> nstate; int ndesc = desc_lst.size(); BL_ASSERT(nstate == ndesc); state.resize(ndesc); for (int i = 0; i < ndesc; i++) { state[i].restart(is, desc_lst[i], papa.theRestartFile(), bReadSpecial); } finishConstructor(); } void AmrLevel::finishConstructor () { // // Set physical locations of grids. // grid_loc.resize(grids.size()); for (int i = 0; i < grid_loc.size(); i++) { grid_loc[i] = RealBox(grids[i],geom.CellSize(),geom.ProbLo()); } } void AmrLevel::setTimeLevel (Real time, Real dt_old, Real dt_new) { for (int k = 0; k < desc_lst.size(); k++) { state[k].setTimeLevel(time,dt_old,dt_new); } } bool AmrLevel::isStateVariable (const std::string& name, int& typ, int& n) { for (typ = 0; typ < desc_lst.size(); typ++) { const StateDescriptor& desc = desc_lst[typ]; for (n = 0; n < desc.nComp(); n++) { if (desc.name(n) == name) return true; } } return false; } long AmrLevel::countCells () const { long cnt = 0; for (int i = 0; i < grids.size(); i++) { cnt += grids[i].numPts(); } return cnt; } void AmrLevel::checkPoint (const std::string& dir, std::ostream& os, VisMF::How how) { int ndesc = desc_lst.size(), i; // // Build directory to hold the MultiFabs in the StateData at this level. // The directory is relative the the directory containing the Header file. // char buf[64]; sprintf(buf, "Level_%d", level); std::string Level = buf; // // Now for the full pathname of that directory. // std::string FullPath = dir; if (!FullPath.empty() && FullPath[FullPath.length()-1] != '/') { FullPath += '/'; } FullPath += Level; // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) BoxLib::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); if (ParallelDescriptor::IOProcessor()) { os << level << '\n' << geom << '\n'; grids.writeOn(os); os << ndesc << '\n'; } // // Output state data. // for (i = 0; i < ndesc; i++) { // // Now build the full relative pathname of the StateData. // The name is relative to the Header file containing this name. // It's the name that gets written into the Header. // // There is only one MultiFab written out at each level in HyperCLaw. // std::string PathNameInHeader = Level; sprintf(buf, "/SD_%d", i); PathNameInHeader += buf; std::string FullPathName = FullPath; FullPathName += buf; state[i].checkPoint(PathNameInHeader, FullPathName, os, how); } } AmrLevel::~AmrLevel () { parent = 0; } void AmrLevel::allocOldData () { for (int i = 0; i < desc_lst.size(); i++) { state[i].allocOldData(); } } void AmrLevel::removeOldData () { for (int i = 0; i < desc_lst.size(); i++) { state[i].removeOldData(); } } void AmrLevel::reset () { for (int i = 0; i < desc_lst.size(); i++) { state[i].reset(); } } MultiFab& AmrLevel::get_data (int state_indx, Real time) { const Real old_time = state[state_indx].prevTime(); const Real new_time = state[state_indx].curTime(); const Real eps = 0.001*(new_time - old_time); if (time > old_time-eps && time < old_time+eps) { return get_old_data(state_indx); } else if (time > new_time-eps && time < new_time+eps) { return get_new_data(state_indx); } else { BoxLib::Error("get_data: invalid time"); static MultiFab bogus; return bogus; } } void AmrLevel::setPhysBoundaryValues (int state_indx, int comp, int ncomp, Real time) { const Real old_time = state[state_indx].prevTime(); const Real new_time = state[state_indx].curTime(); const Real eps = 0.001*(new_time - old_time); int do_new; if (time > old_time-eps && time < old_time+eps) { do_new = 0; } else if (time > new_time-eps && time < new_time+eps) { do_new = 1; } else { BoxLib::Error("AmrLevel::setPhysBndryValues(): invalid time"); } state[state_indx].FillBoundary(geom.CellSize(), geom.ProbDomain(), comp, ncomp, do_new); } FillPatchIteratorHelper::FillPatchIteratorHelper (AmrLevel& amrlevel, MultiFab& leveldata) : MFIter(leveldata), m_amrlevel(amrlevel), m_leveldata(leveldata), m_mfid(m_amrlevel.level+1), m_finebox(m_leveldata.boxArray().size()), m_crsebox(m_leveldata.boxArray().size()), m_fbid(m_leveldata.boxArray().size()), m_ba(m_leveldata.boxArray().size()), m_init(false) {} FillPatchIterator::FillPatchIterator (AmrLevel& amrlevel, MultiFab& leveldata) : MFIter(leveldata), m_amrlevel(amrlevel), m_leveldata(leveldata), m_fph(PArrayManage), m_ncomp(0) {} FillPatchIteratorHelper::FillPatchIteratorHelper (AmrLevel& amrlevel, MultiFab& leveldata, int boxGrow, Real time, int index, int scomp, int ncomp, Interpolater* mapper) : MFIter(leveldata), m_amrlevel(amrlevel), m_leveldata(leveldata), m_mfid(m_amrlevel.level+1), m_finebox(m_leveldata.boxArray().size()), m_crsebox(m_leveldata.boxArray().size()), m_fbid(m_leveldata.boxArray().size()), m_ba(m_leveldata.boxArray().size()), m_time(time), m_growsize(boxGrow), m_index(index), m_scomp(scomp), m_ncomp(ncomp), m_init(false) { Initialize(boxGrow,time,index,scomp,ncomp,mapper); } FillPatchIterator::FillPatchIterator (AmrLevel& amrlevel, MultiFab& leveldata, int boxGrow, Real time, int index, int scomp, int ncomp) : MFIter(leveldata), m_amrlevel(amrlevel), m_leveldata(leveldata), m_fph(PArrayManage), m_ncomp(ncomp) { BL_ASSERT(scomp >= 0); BL_ASSERT(ncomp >= 1); BL_ASSERT(AmrLevel::desc_lst[index].inRange(scomp,ncomp)); BL_ASSERT(0 <= index && index < AmrLevel::desc_lst.size()); Initialize(boxGrow,time,index,scomp,ncomp); } static bool NeedToTouchUpPhysCorners (const Geometry& geom) { int n = 0; for (int dir = 0; dir < BL_SPACEDIM; dir++) if (geom.isPeriodic(dir)) n++; return geom.isAnyPeriodic() && n < BL_SPACEDIM; } void FillPatchIteratorHelper::Initialize (int boxGrow, Real time, int index, int scomp, int ncomp, Interpolater* mapper) { BL_ASSERT(mapper); BL_ASSERT(scomp >= 0); BL_ASSERT(ncomp >= 1); BL_ASSERT(AmrLevel::desc_lst[index].inRange(scomp,ncomp)); BL_ASSERT(0 <= index && index < AmrLevel::desc_lst.size()); m_map = mapper; m_time = time; m_growsize = boxGrow; m_index = index; m_scomp = scomp; m_ncomp = ncomp; m_FixUpCorners = NeedToTouchUpPhysCorners(m_amrlevel.geom); const int MyProc = ParallelDescriptor::MyProc(); PArray& amrLevels = m_amrlevel.parent->getAmrLevels(); const AmrLevel& topLevel = amrLevels[m_amrlevel.level]; const Box& topPDomain = topLevel.state[m_index].getDomain(); const IndexType boxType = m_leveldata.boxArray()[0].ixType(); const bool extrap = AmrLevel::desc_lst[m_index].extrap(); // // Check that are the interpolaters are identical. // BL_ASSERT(AmrLevel::desc_lst[m_index].identicalInterps(scomp,ncomp)); for (int l = 0; l <= m_amrlevel.level; ++l) { amrLevels[l].state[m_index].RegisterData(m_mfcd, m_mfid[l]); } for (int i = 0; i < m_ba.size(); ++i) { if (m_leveldata.DistributionMap()[i] == MyProc) { m_ba.set(i, m_leveldata.boxArray()[i]); m_fbid[i].resize(m_amrlevel.level + 1); m_finebox[i].resize(m_amrlevel.level + 1); m_crsebox[i].resize(m_amrlevel.level + 1); } } m_ba.grow(m_growsize); // These are the ones we want to fillpatch. BoxList unfillableThisLevel(boxType), tempUnfillable(boxType); std::vector unfilledThisLevel, crse_boxes; Array pshifts(27); for (int ibox = 0; ibox < m_ba.size(); ++ibox) { if (m_leveldata.DistributionMap()[ibox] != MyProc) continue; unfilledThisLevel.clear(); unfilledThisLevel.push_back(m_ba[ibox]); if (!topPDomain.contains(m_ba[ibox])) { unfilledThisLevel.back() &= topPDomain; if (topLevel.geom.isAnyPeriodic()) { // // May need to add additional unique pieces of valid region // in order to do periodic copies into ghost cells. // topLevel.geom.periodicShift(topPDomain,m_ba[ibox],pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { Box shbox = m_ba[ibox] + pshifts[iiv]; shbox &= topPDomain; if (boxType.nodeCentered()) { for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (pshifts[iiv][dir] > 0) shbox.growHi(dir,-1); else if (pshifts[iiv][dir] < 0) shbox.growLo(dir,-1); } } if (shbox.ok()) { BoxList bl = BoxLib::boxDiff(shbox,m_ba[ibox]); for (BoxList::iterator bli = bl.begin(); bli != bl.end(); ++bli) { unfilledThisLevel.push_back(*bli); } } } } } bool Done = false; for (int l = m_amrlevel.level; l >= 0 && !Done; --l) { unfillableThisLevel.clear(); StateData& theState = amrLevels[l].state[m_index]; const Box& thePDomain = theState.getDomain(); const Geometry& theGeom = amrLevels[l].geom; const bool is_periodic = theGeom.isAnyPeriodic(); const IntVect& fine_ratio = amrLevels[l].fine_ratio; // // These are the boxes on this level contained in thePDomain // that need to be filled in order to directly fill at the // highest level or to interpolate up to the next higher level. // m_finebox[ibox][l].resize(unfilledThisLevel.size()); for (int i = 0; i < unfilledThisLevel.size(); i++) m_finebox[ibox][l][i] = unfilledThisLevel[i]; // // Now build coarse boxes needed to interpolate to fine. // // If we're periodic and we're not at the finest level, we may // need to get some additional data at this level in order to // properly fill the CoarseBox()d versions of the fineboxes. // crse_boxes.clear(); const Array& FineBoxes = m_finebox[ibox][l]; for (int i = 0; i < FineBoxes.size(); i++) { crse_boxes.push_back(FineBoxes[i]); if (l != m_amrlevel.level) { Box cbox = m_map->CoarseBox(FineBoxes[i],fine_ratio); crse_boxes.back() = cbox; if (is_periodic && !thePDomain.contains(cbox)) { theGeom.periodicShift(thePDomain,cbox,pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { Box shbox = cbox + pshifts[iiv]; shbox &= thePDomain; if (boxType.nodeCentered()) { for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (pshifts[iiv][dir] > 0) shbox.growHi(dir,-1); else if (pshifts[iiv][dir] < 0) shbox.growLo(dir,-1); } } if (shbox.ok()) crse_boxes.push_back(shbox); } } } } m_crsebox[ibox][l].resize(crse_boxes.size()); m_fbid[ibox][l].resize(crse_boxes.size()); // // Now attempt to get as much coarse data as possible. // Array& CrseBoxes = m_crsebox[ibox][l]; for (int i = 0; i < CrseBoxes.size(); i++) { BL_ASSERT(tempUnfillable.isEmpty()); CrseBoxes[i] = crse_boxes[i]; BL_ASSERT(CrseBoxes[i].intersects(thePDomain)); theState.linInterpAddBox(m_mfcd, m_mfid[l], &tempUnfillable, m_fbid[ibox][l][i], CrseBoxes[i], m_time, m_scomp, 0, m_ncomp, extrap); unfillableThisLevel.catenate(tempUnfillable); } unfillableThisLevel.intersect(thePDomain); if (unfillableThisLevel.isEmpty()) { Done = true; } else { unfilledThisLevel.clear(); for (BoxList::iterator bli = unfillableThisLevel.begin(); bli != unfillableThisLevel.end(); ++bli) { unfilledThisLevel.push_back(*bli); } } } } m_mfcd.CollectData(); m_init = true; } void FillPatchIterator::Initialize (int boxGrow, Real time, int index, int scomp, int ncomp) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::Initialize()"); BL_ASSERT(scomp >= 0); BL_ASSERT(ncomp >= 1); BL_ASSERT(0 <= index && index < AmrLevel::desc_lst.size()); const StateDescriptor& desc = AmrLevel::desc_lst[index]; m_ncomp = ncomp; m_range = desc.sameInterps(scomp,ncomp); m_fph.resize(m_range.size()); for (int i = 0; i < m_range.size(); i++) { const int SComp = m_range[i].first; const int NComp = m_range[i].second; m_fph.set(i,new FillPatchIteratorHelper(m_amrlevel, m_leveldata, boxGrow, time, index, SComp, NComp, desc.interp(SComp))); } BoxList bl(m_leveldata.boxArray()[0].ixType()); for (int i = 0; i < m_leveldata.boxArray().size(); i++) bl.push_back(BoxLib::grow(m_leveldata.boxArray()[i], boxGrow)); BoxArray nba(bl); m_fabs.define(nba,m_ncomp,0,Fab_allocate); BL_ASSERT(m_leveldata.DistributionMap() == m_fabs.DistributionMap()); // // Now fill all our FABs. // for (MFIter mfi(m_fabs); mfi.isValid(); ++mfi) { int DComp = 0; for (int i = 0; i < m_range.size(); i++) { m_fph[i].fill(m_fabs[mfi.index()],DComp,mfi.index()); DComp += m_range[i].second; } BL_ASSERT(DComp == m_ncomp); } // // Call hack to touch up fillPatched data // m_amrlevel.set_preferred_boundary_values(m_fabs, index, scomp, 0, ncomp, time); } static bool HasPhysBndry (const Box& b, const Box& dmn, const Geometry& geom) { for (int i = 0; i < BL_SPACEDIM; i++) { if (!geom.isPeriodic(i)) { if (b.smallEnd(i) < dmn.smallEnd(i) || b.bigEnd(i) > dmn.bigEnd(i)) { return true; } } } return false; } static void FixUpPhysCorners (FArrayBox& fab, StateData& TheState, const Geometry& TheGeom, Real time, int scomp, int dcomp, int ncomp) { BL_PROFILE("FixUpPhysCorners"); const Box& ProbDomain = TheState.getDomain(); if (!HasPhysBndry(fab.box(),ProbDomain,TheGeom)) return; FArrayBox tmp; Box GrownDomain = ProbDomain; for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (!TheGeom.isPeriodic(dir)) { int lo = ProbDomain.smallEnd(dir) - fab.box().smallEnd(dir); int hi = fab.box().bigEnd(dir) - ProbDomain.bigEnd(dir); if (lo > 0) GrownDomain.growLo(dir,lo); if (hi > 0) GrownDomain.growHi(dir,hi); } } for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (!TheGeom.isPeriodic(dir)) continue; Box lo_slab = fab.box(); Box hi_slab = fab.box(); lo_slab.shift(dir, ProbDomain.length(dir)); hi_slab.shift(dir,-ProbDomain.length(dir)); lo_slab &= GrownDomain; hi_slab &= GrownDomain; if (lo_slab.ok()) { lo_slab.shift(dir,-ProbDomain.length(dir)); BL_ASSERT(fab.box().contains(lo_slab)); BL_ASSERT(HasPhysBndry(lo_slab,ProbDomain,TheGeom)); tmp.resize(lo_slab,ncomp); tmp.copy(fab,dcomp,0,ncomp); tmp.shift(dir,ProbDomain.length(dir)); TheState.FillBoundary(tmp, time, TheGeom.CellSize(), TheGeom.ProbDomain(), 0, scomp, ncomp); tmp.shift(dir,-ProbDomain.length(dir)); fab.copy(tmp,0,dcomp,ncomp); } if (hi_slab.ok()) { hi_slab.shift(dir,ProbDomain.length(dir)); BL_ASSERT(fab.box().contains(hi_slab)); BL_ASSERT(HasPhysBndry(hi_slab,ProbDomain,TheGeom)); tmp.resize(hi_slab,ncomp); tmp.copy(fab,dcomp,0,ncomp); tmp.shift(dir,-ProbDomain.length(dir)); TheState.FillBoundary(tmp, time, TheGeom.CellSize(), TheGeom.ProbDomain(), 0, scomp, ncomp); tmp.shift(dir,ProbDomain.length(dir)); fab.copy(tmp,0,dcomp,ncomp); } } } #include static Mutex fill_mutex; void FillPatchIteratorHelper::fill (FArrayBox& fab, int dcomp, int idx) { BL_ASSERT(fab.box() == m_ba[idx]); BL_ASSERT(fab.nComp() >= dcomp + m_ncomp); Array pshifts(27); Array bcr(m_ncomp); Array< PArray > cfab(m_amrlevel.level+1); const bool extrap = AmrLevel::desc_lst[m_index].extrap(); PArray& amrLevels = m_amrlevel.parent->getAmrLevels(); #ifndef NDEBUG // // Set to special value we'll later check to ensure we've filled the FAB. // fab.setVal(2.e200,fab.box(),dcomp,m_ncomp); #endif // // Build all coarse fabs from which we'll interpolate and // fill them with coarse data as best we can. // for (int l = 0; l <= m_amrlevel.level; l++) { StateData& TheState = amrLevels[l].state[m_index]; PArray& CrseFabs = cfab[l]; cfab[l].resize(m_crsebox[idx][l].size(),PArrayManage); for (int i = 0; i < CrseFabs.size(); i++) { const Box& cbox = m_crsebox[idx][l][i]; BL_ASSERT(cbox.ok()); // // Set to special value we'll later check // to ensure we've filled the FABs at the coarse level. // CrseFabs.set(i, new FArrayBox(cbox,m_ncomp)); #ifndef NDEBUG CrseFabs[i].setVal(3.e200); #endif TheState.linInterpFillFab(m_mfcd, m_mfid[l], m_fbid[idx][l][i], CrseFabs[i], m_time, 0, 0, m_ncomp, extrap); } } // // Now work from the bottom up interpolating to next higher level. // for (int l = 0; l < m_amrlevel.level; l++) { StateData& TheState = amrLevels[l].state[m_index]; PArray& CrseFabs = cfab[l]; const Geometry& TheGeom = amrLevels[l].geom; const Box& ThePDomain = TheState.getDomain(); if (TheGeom.isAnyPeriodic()) { // // Fill CrseFabs with periodic data in preparation for interp(). // for (int i = 0; i < CrseFabs.size(); i++) { FArrayBox& dstfab = CrseFabs[i]; if (!ThePDomain.contains(dstfab.box())) { TheGeom.periodicShift(ThePDomain,dstfab.box(),pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { Box fullsrcbox = dstfab.box() + pshifts[iiv]; fullsrcbox &= ThePDomain; for (int j = 0; j < CrseFabs.size(); j++) { FArrayBox& srcfab = CrseFabs[j]; Box srcbox = fullsrcbox & srcfab.box(); if (srcbox.ok()) { Box dstbox = srcbox - pshifts[iiv]; dstfab.copy(srcfab,srcbox,0,dstbox,0,m_ncomp); } } } } } } // // Set non-periodic BCs in coarse data -- what we interpolate with. // This MUST come after the periodic fill mumbo-jumbo. // const Real* theCellSize = TheGeom.CellSize(); const RealBox& theProbDomain = TheGeom.ProbDomain(); for (int i = 0; i < CrseFabs.size(); i++) { if (!ThePDomain.contains(CrseFabs[i].box())) { TheState.FillBoundary(CrseFabs[i], m_time, theCellSize, theProbDomain, 0, m_scomp, m_ncomp); } // // The coarse FAB had better be completely filled with "good" data. // BL_ASSERT(CrseFabs[i].norm(0,0,m_ncomp) < 3.e200); } if (m_FixUpCorners) { for (int i = 0; i < CrseFabs.size(); i++) FixUpPhysCorners(CrseFabs[i],TheState,TheGeom,m_time,m_scomp,0,m_ncomp); } // // Interpolate up to next level. // const IntVect& fine_ratio = amrLevels[l].fine_ratio; const Array& FineBoxes = m_finebox[idx][l]; StateData& fState = amrLevels[l+1].state[m_index]; const Box& fDomain = fState.getDomain(); PArray& FinerCrseFabs = cfab[l+1]; const Array& theBCs = AmrLevel::desc_lst[m_index].getBCs(); FArrayBox finefab, crsefab; for (int i = 0; i < FineBoxes.size(); i++) { finefab.resize(FineBoxes[i],m_ncomp); Box crse_box = m_map->CoarseBox(finefab.box(),fine_ratio); crsefab.resize(crse_box,m_ncomp); // // Fill crsefab from m_crsebox via copy on intersect. // for (int j = 0; j < CrseFabs.size(); j++) crsefab.copy(CrseFabs[j]); // // Get boundary conditions for the fine patch. // BoxLib::setBC(finefab.box(), fDomain, m_scomp, 0, m_ncomp, theBCs, bcr); // // The coarse FAB had better be completely filled with "good" data. // BL_ASSERT(crsefab.norm(0,0,m_ncomp) < 3.e200); // // Interpolate up to fine patch. // m_map->interp(crsefab, 0, finefab, 0, m_ncomp, finefab.box(), fine_ratio, amrLevels[l].geom, amrLevels[l+1].geom, bcr); // // Copy intersect finefab into next level m_crseboxes. // for (int j = 0; j < FinerCrseFabs.size(); j++) FinerCrseFabs[j].copy(finefab); } // // No longer need coarse data at this level. // CrseFabs.clear(); } // // Now for the finest level stuff. // StateData& FineState = m_amrlevel.state[m_index]; const Box& FineDomain = FineState.getDomain(); const Geometry& FineGeom = m_amrlevel.geom; PArray& FinestCrseFabs = cfab[m_amrlevel.level]; // // Copy intersect coarse into destination fab. // for (int i = 0; i < FinestCrseFabs.size(); i++) fab.copy(FinestCrseFabs[i],0,dcomp,m_ncomp); if (FineGeom.isAnyPeriodic() && !FineDomain.contains(fab.box())) { FineGeom.periodicShift(FineDomain,fab.box(),pshifts); for (int i = 0; i < FinestCrseFabs.size(); i++) { for (int iiv = 0; iiv < pshifts.size(); iiv++) { fab.shift(pshifts[iiv]); Box src_dst = FinestCrseFabs[i].box() & fab.box(); src_dst &= FineDomain; if (src_dst.ok()) fab.copy(FinestCrseFabs[i],src_dst,0,src_dst,dcomp,m_ncomp); fab.shift(-pshifts[iiv]); } } } // // No longer need coarse data at finest level. // FinestCrseFabs.clear(); // // Final set of non-periodic BCs. // if (!FineState.getDomain().contains(fab.box())) { FineState.FillBoundary(fab, m_time, FineGeom.CellSize(), FineGeom.ProbDomain(), dcomp, m_scomp, m_ncomp); } if (m_FixUpCorners) { FixUpPhysCorners(fab,FineState,FineGeom,m_time,m_scomp,dcomp,m_ncomp); } } bool FillPatchIteratorHelper::isValid () { BL_ASSERT(m_init); return MFIter::isValid() ? true : false; } void FillPatchIterator::operator++ () { MFIter::operator++(); for (int i = 0; i < m_fph.size(); i++) ++m_fph[i]; } bool FillPatchIterator::isValid () { BL_ASSERT(m_ncomp > 0); BL_ASSERT(m_fph.size() == m_range.size()); if (!MFIter::isValid()) return false; for (int i = 0; i < m_fph.size(); i++) { bool result = m_fph[i].isValid(); BL_ASSERT(result == true); } return true; } FillPatchIteratorHelper::~FillPatchIteratorHelper () {} FillPatchIterator::~FillPatchIterator () {} void AmrLevel::FillCoarsePatch (MultiFab& mf, int dcomp, Real time, int index, int scomp, int ncomp) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::FillCoarsePatch()"); // // Must fill this region on crse level and interpolate. // BL_ASSERT(level != 0); BL_ASSERT(ncomp <= (mf.nComp()-dcomp)); BL_ASSERT(0 <= index && index < desc_lst.size()); Array bcr(ncomp); int DComp = dcomp; const StateDescriptor& desc = desc_lst[index]; const Box& pdomain = state[index].getDomain(); const BoxArray& mf_BA = mf.boxArray(); AmrLevel& clev = parent->getLevel(level-1); std::vector< std::pair > ranges = desc.sameInterps(scomp,ncomp); BL_ASSERT(desc.inRange(scomp, ncomp)); for (int i = 0; i < ranges.size(); i++) { const int SComp = ranges[i].first; const int NComp = ranges[i].second; Interpolater* mapper = desc.interp(SComp); BoxArray crseBA(mf_BA.size()); for (int j = 0; j < crseBA.size(); ++j) { BL_ASSERT(mf_BA[j].ixType() == desc.getType()); crseBA.set(j,mapper->CoarseBox(mf_BA[j],crse_ratio)); } MultiFab crseMF(crseBA,NComp,0,Fab_noallocate); FillPatchIterator fpi(clev,crseMF,0,time,index,SComp,NComp); for ( ; fpi.isValid(); ++fpi) { const Box& dbox = mf_BA[fpi.index()]; BoxLib::setBC(dbox,pdomain,SComp,0,NComp,desc.getBCs(),bcr); mapper->interp(fpi(), 0, mf[fpi], DComp, NComp, dbox, crse_ratio, clev.geom, geom, bcr); } DComp += NComp; } } MultiFab* AmrLevel::derive (const std::string& name, Real time, int ngrow) { BL_ASSERT(ngrow >= 0); MultiFab* mf = 0; int index, scomp, ncomp; if (isStateVariable(name, index, scomp)) { mf = new MultiFab(state[index].boxArray(), 1, ngrow); FillPatchIterator fpi(*this,get_new_data(index),ngrow,time,index,scomp,1); for ( ; fpi.isValid(); ++fpi) { BL_ASSERT((*mf)[fpi].box() == fpi().box()); (*mf)[fpi].copy(fpi()); } } else if (const DeriveRec* rec = derive_lst.get(name)) { rec->getRange(0, index, scomp, ncomp); BoxArray srcBA(state[index].boxArray()); BoxArray dstBA(state[index].boxArray()); srcBA.convert(rec->boxMap()); dstBA.convert(rec->deriveType()); MultiFab srcMF(srcBA, rec->numState(), ngrow); for (int k = 0, dc = 0; k < rec->numRange(); k++, dc += ncomp) { rec->getRange(k, index, scomp, ncomp); FillPatchIterator fpi(*this,srcMF,ngrow,time,index,scomp,ncomp); for ( ; fpi.isValid(); ++fpi) { srcMF[fpi].copy(fpi(), 0, dc, ncomp); } } mf = new MultiFab(dstBA, rec->numDerive(), ngrow); for (MFIter mfi(srcMF); mfi.isValid(); ++mfi) { int grid_no = mfi.index(); Real* ddat = (*mf)[grid_no].dataPtr(); const int* dlo = (*mf)[grid_no].loVect(); const int* dhi = (*mf)[grid_no].hiVect(); int n_der = rec->numDerive(); Real* cdat = srcMF[mfi].dataPtr(); const int* clo = srcMF[mfi].loVect(); const int* chi = srcMF[mfi].hiVect(); int n_state = rec->numState(); const int* dom_lo = state[index].getDomain().loVect(); const int* dom_hi = state[index].getDomain().hiVect(); const Real* dx = geom.CellSize(); const int* bcr = rec->getBC(); const Real* xlo = grid_loc[grid_no].lo(); Real dt = parent->dtLevel(level); rec->derFunc()(ddat,ARLIM(dlo),ARLIM(dhi),&n_der, cdat,ARLIM(clo),ARLIM(chi),&n_state, dlo,dhi,dom_lo,dom_hi,dx,xlo,&time,&dt,bcr, &level,&grid_no); } } else { // // If we got here, cannot derive given name. // std::string msg("AmrLevel::derive(MultiFab*): unknown variable: "); msg += name; BoxLib::Error(msg.c_str()); } return mf; } void AmrLevel::derive (const std::string& name, Real time, MultiFab& mf, int dcomp) { BL_ASSERT(dcomp < mf.nComp()); const int ngrow = mf.nGrow(); int index, scomp, ncomp; if (isStateVariable(name,index,scomp)) { FillPatchIterator fpi(*this,mf,ngrow,time,index,scomp,1); for ( ; fpi.isValid(); ++fpi) { BL_ASSERT(mf[fpi].box() == fpi().box()); mf[fpi].copy(fpi(),0,dcomp,1); } } else if (const DeriveRec* rec = derive_lst.get(name)) { rec->getRange(0,index,scomp,ncomp); BoxArray srcBA(mf.boxArray()); BoxArray dstBA(mf.boxArray()); srcBA.convert(state[index].boxArray()[0].ixType()); BL_ASSERT(rec->deriveType() == dstBA[0].ixType()); MultiFab srcMF(srcBA,rec->numState(),ngrow); for (int k = 0, dc = 0; k < rec->numRange(); k++, dc += ncomp) { rec->getRange(k,index,scomp,ncomp); FillPatchIterator fpi(*this,srcMF,ngrow,time,index,scomp,ncomp); for ( ; fpi.isValid(); ++fpi) { BL_ASSERT(srcMF[fpi].box() == fpi().box()); srcMF[fpi].copy(fpi(),0,dc,ncomp); } } for (MFIter mfi(srcMF); mfi.isValid(); ++mfi) { int idx = mfi.index(); Real* ddat = mf[idx].dataPtr(dcomp); const int* dlo = mf[idx].loVect(); const int* dhi = mf[idx].hiVect(); int n_der = rec->numDerive(); Real* cdat = srcMF[mfi].dataPtr(); const int* clo = srcMF[mfi].loVect(); const int* chi = srcMF[mfi].hiVect(); int n_state = rec->numState(); const int* dom_lo = state[index].getDomain().loVect(); const int* dom_hi = state[index].getDomain().hiVect(); const Real* dx = geom.CellSize(); const int* bcr = rec->getBC(); const RealBox temp = RealBox(mf[idx].box(),geom.CellSize(),geom.ProbLo()); const Real* xlo = temp.lo(); Real dt = parent->dtLevel(level); rec->derFunc()(ddat,ARLIM(dlo),ARLIM(dhi),&n_der, cdat,ARLIM(clo),ARLIM(chi),&n_state, dlo,dhi,dom_lo,dom_hi,dx,xlo,&time,&dt,bcr, &level,&idx); } } else { // // If we got here, cannot derive given name. // std::string msg("AmrLevel::derive(MultiFab*): unknown variable: "); msg += name; BoxLib::Error(msg.c_str()); } } Array AmrLevel::getBCArray (int State_Type, int gridno, int strt_comp, int ncomp) { Array bc(2*BL_SPACEDIM*ncomp); for (int n = 0; n < ncomp; n++) { const int* b_rec = state[State_Type].getBC(strt_comp+n,gridno).vect(); for (int m = 0; m < 2*BL_SPACEDIM; m++) bc[2*BL_SPACEDIM*n + m] = b_rec[m]; } return bc; } int AmrLevel::okToRegrid () { return true; } void AmrLevel::setPlotVariables () { ParmParse pp("amr"); if (pp.contains("plot_vars")) { std::string nm; int nPltVars = pp.countval("plot_vars"); for (int i = 0; i < nPltVars; i++) { pp.get("plot_vars", nm, i); if (nm == "ALL") parent->fillStatePlotVarList(); else if (nm == "NONE") parent->clearStatePlotVarList(); else parent->addStatePlotVar(nm); } } else { // // The default is to add them all. // parent->fillStatePlotVarList(); } if (pp.contains("derive_plot_vars")) { std::string nm; int nDrvPltVars = pp.countval("derive_plot_vars"); for (int i = 0; i < nDrvPltVars; i++) { pp.get("derive_plot_vars", nm, i); if (nm == "ALL") parent->fillDerivePlotVarList(); else if (nm == "NONE") parent->clearDerivePlotVarList(); else parent->addDerivePlotVar(nm); } } else { // // The default is to add none of them. // parent->clearDerivePlotVarList(); } } AmrLevel::TimeLevel AmrLevel::which_time (int indx, Real time) const { const Real oldtime = state[indx].prevTime(); const Real newtime = state[indx].curTime(); const Real haftime = .5 * (oldtime + newtime); const Real epsilon = 0.001 * (newtime - oldtime); BL_ASSERT(time >= oldtime-epsilon && time <= newtime+epsilon); if (time >= oldtime-epsilon && time <= oldtime+epsilon) { return AmrOldTime; } else if (time >= newtime-epsilon && time <= newtime+epsilon) { return AmrNewTime; } else if (time >= haftime-epsilon && time <= haftime+epsilon) { return AmrHalfTime; } return AmrOtherTime; } ccseapps-2.5/CCSEApps/amrlib/SLABSTAT_2D.F0000644000175000017500000002354111634153073021003 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: SLABSTAT_2D.F,v 1.4 2002/11/27 21:54:19 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "SPACE.H" #include "CONSTANTS.H" #include "ArrayLim.H" #include "SLABSTAT_F.H" #define SDIM 2 c c ::: ----------------------------------------------------------- c ::: This is a general routine to calculate the running statistics c ::: required to calculate the Reynolds averaged first four moments c ::: of the state components passed in. This is a general routine c ::: and will work for any number of state components. If the state c ::: is passed in in the order (a, b, c, d), then the running averages c ::: which are returned are in the order, c ::: , , , , c ::: , , , , c ::: , , , , c ::: , , , c ::: c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: runStats <= Array to contain the running statistics c ::: DIMS(runStats) => Dimensions of the running statistics array c ::: nStats => Number of components in the statistics array c ::: state =) Array containing the state data c ::: DIMS(state) => Dimensions of the state data array c ::: nStateComp => Number of components in the state array c ::: dt => Time step c ::: delta => Grid spacing c ::: ----------------------------------------------------------- c subroutine FORT_REYNAVG_FIRST4MOMS(state, DIMS(state), nStateComp, $ runStats, DIMS(runStats), nStats, $ dt, delta) implicit none c c ::::: passed variables c integer nStats, nStateComp integer DIMDEC(state) integer DIMDEC(runStats) REAL_T dt REAL_T delta(SDIM) REAL_T runStats(DIMV(runStats),nStats) REAL_T state(DIMV(state),nStateComp) c c ::::: local variables c integer i, j, n, nghost integer loStats(SDIM), hiStats(SDIM) integer loState(SDIM), hiState(SDIM) c c =================================== c ::: Set the Values of LO and HI ::: c =================================== c call SET_LOHI(DIMS(runStats), loStats, hiStats) call SET_LOHI(DIMS(state), loState, hiState) #ifndef NDEBUG if (nStats .NE. 4*nStateComp) then write(*,1000) nStats, nStateComp 1000 format('Incorrect relationship between nStats and nStateComp in', $ /'FORT_REYNAVG_FIRST4MOMS. Shoud have nStats = 4*nStateComp', $ /' nStats = ', I5, 5x, 'nStateComp = ', I5) call bl_error("stop") endif nghost = 0 do n = 1, SDIM if (loState(n) .GT. loStats(n) - nghost .OR. $ hiState(n) .LT. hiStats(n) + nghost) then write(*,1010) n, nghost, loStats, hiStats, loState, hiState 1010 format('Incorrect number of ghost cells in the state date in', $ /'FORT_REYNAVG_FIRST4MOMS.', $ /' Direction = ', I2, 5x, 'nghost = ', I2, $ /' loStats = ', SDIM (I2,1x), 5x, 'hiStats = ', SDIM (I2,1x), $ /' loState = ', SDIM (I2,1x), 5x, 'hiState = ', SDIM (I2,1x)) call bl_error("stop") endif enddo #endif c c ==================================== c ::: Calculate Running Statistics ::: c ==================================== c do n = 1, nStateComp do j = loStats(2), hiStats(2) do i = loStats(1), hiStats(1) runStats(i,j,n) = runStats(i,j,n) + dt * state(i,j,n) runStats(i,j,n+nStateComp) = runStats(i,j,n+nStateComp) $ + dt * state(i,j,n)**2 runStats(i,j,n+2*nStateComp) = runStats(i,j,n+2*nStateComp) $ + dt * state(i,j,n)**3 runStats(i,j,n+3*nStateComp) = runStats(i,j,n+3*nStateComp) $ + dt * state(i,j,n)**4 enddo enddo enddo c c return end c c ::: ----------------------------------------------------------- c ::: This is a general routine to calculate the running statistics c ::: required to calculate the Favre averaged first four moments c ::: of the state components passed in. This is a general routine c ::: and will work for any number of state components. The first state c ::: component is assumed to be density, so it is used in the Favre averages. c ::: If the state is passed in in the order (Rho, a, b, c, d), c ::: then the running averages which are returned are in the order, c ::: , , , , , c ::: , , , , , c ::: , , , , , c ::: , , , , c ::: c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: runStats <= Array to contain the running statistics c ::: DIMS(runStats) => Dimensions of the running statistics array c ::: nStats => Number of components in the statistics array c ::: state =) Array containing the state data c ::: DIMS(state) => Dimensions of the state data array c ::: nStateComp => Number of components in the state array c ::: dt => Time step c ::: delta => Grid spacing c ::: ----------------------------------------------------------- c subroutine FORT_FAVREAVG_FIRST4MOMS(state, DIMS(state), nStateComp, $ runStats, DIMS(runStats), nStats, $ dt, delta) implicit none c c ::::: passed variables c integer nStats, nStateComp integer DIMDEC(state) integer DIMDEC(runStats) REAL_T dt REAL_T delta(SDIM) REAL_T runStats(DIMV(runStats),nStats) REAL_T state(DIMV(state),nStateComp) c c ::::: local variables c integer i, j, n, nghost integer loStats(SDIM), hiStats(SDIM) integer loState(SDIM), hiState(SDIM) c c =================================== c ::: Set the Values of LO and HI ::: c =================================== c call SET_LOHI(DIMS(runStats), loStats, hiStats) call SET_LOHI(DIMS(state), loState, hiState) #ifndef NDEBUG if (nStats .NE. 4*nStateComp) then write(*,1000) nStats, nStateComp 1000 format('Incorrect relationship between nStats and nStateComp in', $ /'FORT_FAVREAVG_FIRST4MOMS. Shoud have nStats = 4*nStateComp', $ /' nStats = ', I5, 5x, 'nStateComp = ', I5) call bl_error("stop") endif nghost = 0 do n = 1, SDIM if (loState(n) .GT. loStats(n) - nghost .OR. $ hiState(n) .LT. hiStats(n) + nghost) then write(*,1010) n, nghost, loStats, hiStats, loState, hiState 1010 format('Incorrect number of ghost cells in the state date in', $ /'FORT_FAVREAVG_FIRST4MOMS.', $ /' Direction = ', I2, 5x, 'nghost = ', I2, $ /' loStats = ', SDIM (I2,1x), 5x, 'hiStats = ', SDIM (I2,1x), $ /' loState = ', SDIM (I2,1x), 5x, 'hiState = ', SDIM (I2,1x)) call bl_error("stop") endif enddo #endif c c ==================================== c ::: Calculate Running Statistics ::: c ==================================== c do j = loStats(2), hiStats(2) do i = loStats(1), hiStats(1) runStats(i,j,1) = runStats(i,j,1) + dt * state(i,j,1) runStats(i,j,1+nStateComp) = runStats(i,j,1+nStateComp) $ + dt * state(i,j,1)**2 runStats(i,j,1+2*nStateComp) = runStats(i,j,1+2*nStateComp) $ + dt * state(i,j,1)**3 runStats(i,j,1+3*nStateComp) = runStats(i,j,1+3*nStateComp) $ + dt * state(i,j,1)**4 enddo enddo do n = 2, nStateComp do j = loStats(2), hiStats(2) do i = loStats(1), hiStats(1) runStats(i,j,n) = runStats(i,j,n) $ + dt * (state(i,j,1) * state(i,j,n)) runStats(i,j,n+nStateComp) = runStats(i,j,n+nStateComp) $ + dt * (state(i,j,1) * state(i,j,n))**2 runStats(i,j,n+2*nStateComp) = runStats(i,j,n+2*nStateComp) $ + dt * (state(i,j,1) * state(i,j,n))**3 runStats(i,j,n+3*nStateComp) = runStats(i,j,n+3*nStateComp) $ + dt * (state(i,j,1) * state(i,j,n))**4 enddo enddo enddo c c return end ccseapps-2.5/CCSEApps/amrlib/AmrLevel.H0000644000175000017500000004271311634153073020754 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _AmrLevel_H_ #define _AmrLevel_H_ // // $Id: AmrLevel.H,v 1.54 2003/03/07 17:39:39 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class TagBox; class TagBoxArray; // //@Man: //@Memo: Virtual base class for managing individual levels. /*@Doc: AmrLevel functions both as a container for state data on a level and also manages the advancement of data in time. */ class AmrLevel { friend class FillPatchIterator; friend class FillPatchIteratorHelper; public: // //@ManDoc: What time are we at? // enum TimeLevel { AmrOldTime, AmrHalfTime, AmrNewTime, AmrOtherTime }; // //@ManDoc: The destructor. // virtual ~AmrLevel (); /*@ManDoc: A string written as the first item in writePlotFile() at level zero. This MUST be defined by each derived class. It is so we can distinguish between different types of plot files. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual std::string thePlotFileType () const = 0; /*@ManDoc: Write plot file stuff to specified directory. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void writePlotFile (const std::string& dir, std::ostream& os, VisMF::How how = VisMF::OneFilePerCPU) = 0; // //@ManDoc: Write current state to checkpoint file. // virtual void checkPoint (const std::string& dir, std::ostream& os, VisMF::How how = VisMF::OneFilePerCPU); // //@ManDoc: Restart from a checkpoint file. // virtual void restart (Amr& papa, std::istream& is, bool bReadSpecial = false); // //@ManDoc: Is name a state variable? // static bool isStateVariable (const std::string& name, int& state_indx, int& ncomp); /*@ManDoc: Compute the initial time step. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void computeInitialDt (int finest_level, int sub_cycle, Array& n_cycle, const Array& ref_ratio, Array& dt_level, Real stop_time) = 0; /*@ManDoc: Compute the next time step. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void computeNewDt (int finest_level, int sub_cycle, Array& n_cycle, const Array& ref_ratio, Array& dt_min, Array& dt_level, Real stop_time) = 0; /*@ManDoc: Do an integration step on this level. Returns maximum safe time step. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual Real advance (Real time, Real dt, int iteration, int ncycle) = 0; /*@ManDoc: Contains operations to be done after a timestep. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void post_timestep (int iteration) = 0; /*@ManDoc: Contains operations to be done only after a full coarse timestep. The default implementation does nothing. */ virtual void postCoarseTimeStep (Real time); /*@ManDoc: Operations to be done after restart. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void post_restart () = 0; /*@ManDoc: Operations to be done after regridding (like avgDown). This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void post_regrid (int lbase, int new_finest) = 0; /*@ManDoc: Operations to be done after initialization. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void post_init (Real stop_time) = 0; /*@ManDoc: Is it ok to continue the calculation? This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual int okToContinue () = 0; /*@ManDoc: Should I regrid with this level as base level? This test is only evaluated when level\_count >= regrid\_int as well. Defaults to true. */ virtual int okToRegrid (); /*@ManDoc: Init grid data at problem start-up. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void initData () = 0; // //@ManDoc: Set the time levels of state data. // virtual void setTimeLevel (Real time, Real dt_old, Real dt_new); // //@ManDoc: Alloc space for old time data. // virtual void allocOldData (); // //@ManDoc: Delete old-time data. // virtual void removeOldData (); /*@ManDoc: Init data on this level from another AmrLevel (during regrid). This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void init (AmrLevel &old) = 0; /*@ManDoc: Init data on this level after regridding if old AmrLevel did not previously exist. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void init () = 0; // //@ManDoc: Reset data to initial time by swapping new and old time data. // void reset (); // //@ManDoc: Returns this AmrLevel. // int Level () const; // //@ManDoc: List of grids at this level. // const BoxArray& boxArray () const; // //@ManDoc: Number of grids at this level. // int numGrids () const; // //@ManDoc: Physical locations of grids at this level. // const Array& gridLocations () const; // //@ManDoc: Returns the indices defining physical domain. // const Box& Domain () const; // //@ManDoc: Timestep n at this level. // int nStep () const; // //@ManDoc: Returns the geometry object. // const Geometry& Geom () const; // //@ManDoc: Returns number of cells on level. // long countCells () const; /*@ManDoc: Error estimation for regridding. This is a pure virtual function and hence MUST be implemented by derived classes. */ virtual void errorEst (TagBoxArray& tb, int clearval, int tagval, Real time, int n_error_buf = 0, int ngrow = 0) = 0; // //@ManDoc: Interpolate from coarse level to the valid area in dest. // void FillCoarsePatch (MultiFab& dest, int dcomp, Real time, int state_idx, int scomp, int ncomp); // //@ManDoc: Function to set physical boundary conditions. // void setPhysBoundaryValues (int state_indx, int comp, int ncomp, int do_new = 1); // //@ManDoc: Another function to set physical boundary conditions. // void setPhysBoundaryValues (int state_indx, int comp, int ncomp, Real time); /*@ManDoc: Returns a MultiFab containing the derived data for this level. The user is responsible for deleting this pointer when done with it. If ngrow>0 the MultiFab is built on the appropriately grown BoxArray. */ MultiFab* derive (const std::string& name, Real time, int ngrow); /*@ManDoc: This version of derive() fills the dcomp'th component of mf with the derived quantity. */ void derive (const std::string& name, Real time, MultiFab& mf, int dcomp); // //@ManDoc: State data object. // StateData& get_state_data (int state_indx); // //@ManDoc: State data at old time. // MultiFab& get_old_data (int state_indx); // //@ManDoc: State data at old time. // const MultiFab& get_old_data (int state_indx) const; // //@ManDoc: State data at new time. // MultiFab& get_new_data (int state_indx); // //@ManDoc: State data at new time. // const MultiFab& get_new_data (int state_indx) const; // //@ManDoc: Returns list of Descriptors. // static const DescriptorList& get_desc_lst (); // //@ManDoc: Returns list of derived variables. // static DeriveList& get_derive_lst (); // //@ManDoc: Returns list of slab stats. // static SlabStatList& get_slabstat_lst (); // //@ManDoc: Boundary condition access function. // Array getBCArray (int State_Type, int gridno, int scomp, int ncomp); // //@ManDoc: Get state data at specified index and time. // MultiFab& get_data (int state_indx, Real time); // //@ManDoc: Hack to allow override of (non-fine-fine) fillpatched boundary data // virtual void set_preferred_boundary_values (MultiFab& S, int state_index, int scomp, int dcomp, int ncomp, Real time) const; // //@ManDoc: Called in grid\_places after other tagging routines to modify // the list of tagged points. Default implementation does nothing. // virtual void manual_tags_placement (TagBoxArray& tags, Array& bf_lev); // //@ManDoc: Modify list of variables to be plotted // virtual void setPlotVariables (); // //@ManDoc: Returns one the TimeLevel enums. // Asserts that time is between AmrOldTime and AmrNewTime. // TimeLevel which_time (int state_indx, Real time) const; protected: // // The constructors -- for derived classes. // AmrLevel (); AmrLevel (Amr& papa, int lev, const Geometry& level_geom, const BoxArray& bl, Real time); // // Common code used by all constructors. // void finishConstructor (); // // The Data. // int level; // AMR level (0 is coarsest). Geometry geom; // Geom at this level. BoxArray grids; // Cell-centered locations of grids. Array grid_loc; // Physical locations of each grid. Amr* parent; // Pointer to parent AMR structure. IntVect crse_ratio; // Refinement ratio to coarser level. IntVect fine_ratio; // Refinement ratio to finer level. static DeriveList derive_lst; // List of derived quantities. static DescriptorList desc_lst; // List of state variables. static SlabStatList slabstat_lst; // List of SlabStats. Array state; // Array of state data. private: // // Disallowed. // AmrLevel (const AmrLevel&); AmrLevel& operator = (const AmrLevel&); }; // // Forward declaration. // class FillPatchIteratorHelper; class FillPatchIterator : public MFIter { public: FillPatchIterator (AmrLevel& amrlevel, MultiFab& leveldata); FillPatchIterator (AmrLevel& amrlevel, MultiFab& leveldata, int boxGrow, Real time, int state_indx, int scomp, int ncomp); void Initialize (int boxGrow, Real time, int state_indx, int scomp, int ncomp); ~FillPatchIterator (); FArrayBox& operator() () { return m_fabs[index()]; } bool isValid (); void operator++ (); const Box& UngrownBox () const { return MFIter::validbox(); } private: // // Disallowed. // FillPatchIterator (); FillPatchIterator (const FillPatchIterator& rhs); FillPatchIterator& operator= (const FillPatchIterator& rhs); // // The data. // AmrLevel& m_amrlevel; MultiFab& m_leveldata; std::vector< std::pair > m_range; PArray m_fph; MultiFab m_fabs; int m_ncomp; }; class FillPatchIteratorHelper : public MFIter { public: friend class FillPatchIterator; FillPatchIteratorHelper (AmrLevel& amrlevel, MultiFab& leveldata); FillPatchIteratorHelper (AmrLevel& amrlevel, MultiFab& leveldata, int boxGrow, Real time, int state_indx, int scomp, int ncomp, Interpolater* mapper); void Initialize (int boxGrow, Real time, int state_indx, int scomp, int ncomp, Interpolater* mapper); ~FillPatchIteratorHelper (); void fill (FArrayBox& fab, int dcomp, int idx); bool isValid (); private: // // Disallowed. // FillPatchIteratorHelper (); FillPatchIteratorHelper (const FillPatchIteratorHelper& rhs); FillPatchIteratorHelper& operator= (const FillPatchIteratorHelper& rhs); // // The data. // AmrLevel& m_amrlevel; MultiFab& m_leveldata; MultiFabCopyDescriptor m_mfcd; Array > m_mfid; // [level][oldnew] Interpolater* m_map; Array > > m_finebox; // [grid][level][validregion] Array > > m_crsebox; // [grid][level][fillablesubbox] Array > > > m_fbid;// [grid][level][fillablesubbox][oldnew] BoxArray m_ba; Real m_time; int m_growsize; int m_index; int m_scomp; int m_ncomp; bool m_init; bool m_FixUpCorners; }; #endif /*_AmrLevel_H_*/ ccseapps-2.5/CCSEApps/amrlib/BCRec.H0000644000175000017500000000725511634153073020165 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BCREC_H_ #define _BCREC_H_ // // $Id: BCRec.H,v 1.9 2001/08/01 21:50:44 lijewski Exp $ // #include #include // //@Man: //@Memo: Boundary Condition Records. /*@Doc: Necessary information and functions for computing boundary conditions. */ class BCRec { public: // //@ManDoc: The default constructor -- sets to invalid boundary types. // BCRec (); // //@ManDoc: The constructor. // BCRec (D_DECL(int loX, int loY, int loZ), D_DECL(int hiX, int hiY, int hiZ)); // //@ManDoc: Another constructor. // BCRec (const int* lo, const int* hi); /*@ManDoc: Yet another constructor. Inherits bndry types from bc\_domain when bx lies on edge of domain otherwise gets interior Dirchlet. */ BCRec (const Box& bx, const Box& domain, const BCRec& bc_domain); // //@ManDoc: Explicitly set lo bndry value. // void setLo (int dir, int bc_val); // //@ManDoc: Explicitly set hi bndry value. // void setHi (int dir, int bc_val); // //@ManDoc: Return bndry values (used in calls to FORTRAN). // const int* vect () const; // //@ManDoc: Return low-end boundary data. // const int* lo () const; // //@ManDoc: Return high-end boundary data. // const int* hi () const; // //@ManDoc: Return low-end boundary data in direction

. // int lo (int dir) const; // //@ManDoc: Return high-end boundary data in direction . // int hi (int dir) const; // //@ManDoc: ASCII write to ostream. // friend std::ostream& operator << (std::ostream&, const BCRec&); protected: // // Array of integer values describing boundary conditions. // int bc[2*BL_SPACEDIM]; }; namespace BoxLib { // // Function for setting a BC. // void setBC (const Box& bx, const Box& domain, const BCRec& bc_dom, BCRec& bcr); // // Function for setting array of BCs. // void setBC (const Box& bx, const Box& domain, int src_comp, int dest_comp, int ncomp, const Array& bc_dom, Array& bcr); } #endif /*_BCREC_H_*/ ccseapps-2.5/CCSEApps/amrlib/FILCC_1D.F0000644000175000017500000001027311634153073020403 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: FILCC_1D.F,v 1.1 2001/08/16 23:06:48 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "ArrayLim.H" #define SDIM 1 c ::: ----------------------------------------------------------- c ::: This routine is intended to be a generic fill function c ::: for cell-centered data. It knows how to extrapolate c ::: and reflect data and is used to supplement the problem-specific c ::: fill functions which call it. c ::: c ::: INPUTS/OUTPUTS: c ::: q <= array to fill c ::: lo,hi => index extent of q array c ::: domlo,domhi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of q array c ::: bc => array of boundary flags bc(SPACEDIM,lo:hi) c ::: c ::: NOTE: all corner as well as edge data is filled if not EXT_DIR c ::: ----------------------------------------------------------- subroutine filcc(q,DIMS(q),domlo,domhi,dx,xlo,bc) integer DIMDEC(q) integer domlo(SDIM), domhi(SDIM) integer bc(SDIM,2) REAL_T xlo(SDIM), dx(SDIM) REAL_T q(DIMV(q)) integer nlft, nrgt integer ilo, ihi integer i integer is, ie nlft = max(0,domlo(1)-ARG_L1(q)) nrgt = max(0,ARG_H1(q)-domhi(1)) is = max(ARG_L1(q),domlo(1)) ie = min(ARG_H1(q),domhi(1)) c ::::: first fill sides if (nlft .gt. 0) then ilo = domlo(1) if (bc(1,1) .eq. FOEXTRAP) then do i = 1, nlft q(ilo-i) = q(ilo) end do else if (bc(1,1) .eq. HOEXTRAP) then do i = 2, nlft q(ilo-i) = q(ilo) end do if (ilo+2 .le. ie) then q(ilo-1) = (fifteen*q(ilo) - ten*q(ilo+1) + $ three*q(ilo+2)) * eighth else q(ilo-1) = half*(three*q(ilo) - q(ilo+1)) end if else if (bc(1,1) .eq. REFLECT_EVEN) then do i = 1, nlft q(ilo-i) = q(ilo+i-1) end do else if (bc(1,1) .eq. REFLECT_ODD) then do i = 1, nlft q(ilo-i) = -q(ilo+i-1) end do end if end if if (nrgt .gt. 0) then ihi = domhi(1) if (bc(1,2) .eq. FOEXTRAP) then do i = 1, nrgt q(ihi+i) = q(ihi) end do else if (bc(1,2) .eq. HOEXTRAP) then do i = 2, nrgt q(ihi+i) = q(ihi) end do if (ihi-2 .ge. is) then q(ihi+1) = (fifteen*q(ihi) - ten*q(ihi-1) + $ three*q(ihi-2)) * eighth else q(ihi+1) = half*(three*q(ihi) - q(ihi-1)) end if else if (bc(1,2) .eq. REFLECT_EVEN) then do i = 1, nrgt q(ihi+i) = q(ihi-i+1) end do else if (bc(1,2) .eq. REFLECT_ODD) then do i = 1, nrgt q(ihi+i) = -q(ihi-i+1) end do end if end if return end ccseapps-2.5/CCSEApps/amrlib/INTERP_1D.F0000644000175000017500000005220111634153073020561 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #undef BL_LANG_CC #define BL_LANG_FORT //#include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "INTERP_F.H" #include "ArrayLim.H" #include "ONE_D.H" #define IX_PROJ(A,B) (A+B*iabs(A))/B-iabs(A) #define SDIM BL_SPACEDIM c ::: -------------------------------------------------------------- c ::: nbinterp: node based bilinear interpolation c ::: c ::: INPUTS/OUTPUTS c ::: fine <=> (modify) fine grid array c ::: DIMS(fine) => (const) index limits of fine grid c ::: DIMS(fb) => (const) subregion of fine grid to get values c ::: c ::: crse => (const) coarse grid data widened by 1 zone c ::: DIMS(crse) => (const) index limits of coarse grid c ::: c ::: lratio => (const) refinement ratio between levels c ::: nvar => (const) number of components in array c ::: num_slp => (const) number of types of slopes c ::: strip_lo,strip_hi => (const) index limits of strip array c ::: c ::: ::: TEMPORARY ARRAYS c ::: sl => num_slp 1-D slope arrays c ::: strip => 1-D temp array c ::: -------------------------------------------------------------- c ::: subroutine FORT_NBINTERP (crse, DIMS(crse), DIMS(cb), $ fine, DIMS(fine), DIMS(fb), $ lratio, nvar, $ sl, num_slp, strip, strip_lo, strip_hi) integer DIMDEC(crse) integer DIMDEC(cb) integer DIMDEC(fine) integer DIMDEC(fb) integer lratio, nvar integer num_slp integer strip_lo, strip_hi REAL_T fine(DIMV(fine), nvar) REAL_T crse(DIMV(crse), nvar) REAL_T sl(DIM1(cb),num_slp) REAL_T strip(strip_lo:strip_hi,0:lratio) #define SLX 1 #define SLY 2 #define SLXY 3 c ::: local var integer lx, ly, lz integer i,j,k,ii,jj,kk,n integer ibeg,iend,jstrs,jends,jbeg,jend integer lys,lye REAL_T invratio invratio = one/dble(lratio) ibeg = max( ARG_L1(cb)*lratio, ARG_L1(fine) ) iend = min( ARG_H1(cb)*lratio, ARG_H1(fine) ) do 100 n = 1, nvar c ::: first fill a strip that will fit do i = ARG_L1(cb), ARG_H1(cb)-1 sl(i,SLX) = invratio*(crse(i+1,n)-crse(i,n)) enddo i = ARG_H1(cb) do lx = 0, lratio-1 do i = ARG_L1(cb), ARG_H1(cb)-1 ii = i*lratio + lx strip(ii,0) = crse(i,n) $ + dble(lx)*sl(i,SLX) enddo enddo i = ARG_H1(cb) ii = i*lratio strip(ii,0) = crse(i,n) c ::: copy on intersection do i = ibeg,iend fine(i,n) = strip(i,0) enddo 100 continue return end #undef SLX #undef SLY #undef SLXY c ::: c ::: -------------------------------------------------------------- c ::: cbinterp: cell centered bilinear interpolation c ::: c ::: NOTE: it is assumed that the coarse grid array is c ::: large enough to define interpolated values c ::: in the region fblo:fbhi on the fine grid c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: DIMS(fine) => (const) index limits of fine grid c ::: DIMS(fb) => (const) subregion of fine grid to get values c ::: c ::: crse => (const) coarse grid data c ::: DIMS(crse) => (const) index limits of coarse grid c ::: c ::: lratio => (const) refinement ratio between levels c ::: nvar => (const) number of components in array c ::: c ::: TEMPORARY ARRAYS c ::: slx,sly,slxy => 1-D slope arrays c ::: strip => 1-D temp array c ::: -------------------------------------------------------------- c ::: subroutine FORT_CBINTERP (crse, DIMS(crse), DIMS(cb), $ fine, DIMS(fine), DIMS(fb), $ lratio, nvar, $ sl, num_slp, strip, strip_lo, strip_hi) integer DIMDEC(crse) integer DIMDEC(cb) integer DIMDEC(fine) integer DIMDEC(fb) integer lratio, nvar integer num_slp integer strip_lo, strip_hi REAL_T fine(DIMV(fine), nvar) REAL_T crse(DIMV(crse), nvar) REAL_T sl(DIM1(cb),num_slp) REAL_T strip(strip_lo:strip_hi) #define SLX 1 #define SLY 2 #define SLXY 3 c ::: local var integer lx, ly integer hrat, ic, jc, jfn, jfc, i, j, n REAL_T x, y REAL_T denom denom = one/dble(2*lratio) hrat = lratio/2 do 200 n = 1, nvar c ::: first fill a strip that will fit do ic = ARG_L1(cb),ARG_H1(cb)-1 sl(ic,SLX) = crse(ic+1,n)-crse(ic,n) enddo do lx = 0, lratio-1 do ic = ARG_L1(cb), ARG_H1(cb)-1 i = ic*lratio + lx x = denom*(two*lratio + one) strip(i) = crse(ic,n) + x*sl(ic,SLX) enddo enddo c ::: stuff into output array do i = ARG_L1(fb), ARG_H1(fb) fine(i,n) = strip(i-hrat) enddo 230 continue 200 continue return end #undef SLX #undef SLY #undef SLXY c ::: c ::: -------------------------------------------------------------- c ::: ccinterp: conservative interpolation from coarse grid to c ::: subregion of fine grid defined by (fblo,fbhi) c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: nvar => (const) number of variables in state vector c ::: lratio => (const) refinement ratio between levels c ::: c ::: crse => (const) coarse grid data widended by 1 zone c ::: and unrolled c ::: clo,chi => (const) one dimensional limits of crse grid c ::: cslo,cshi => (const) coarse grid index limits where c ::: slopes are to be defined. This is c ::: the projection of (fblo,fbhi) down c ::: to the coarse level c ::: fslo,fshi => (const) fine grid index limits where c ::: slopes are needed. This is the c ::: refinement of (cslo,cshi) and c ::: contains but may not be identical c ::: to (fblo,fbhi). c ::: cslope => (modify) temp array coarse grid slopes c ::: clen => (const) length of coarse gtid slopes c ::: fslope => (modify) temp array for fine grid slope c ::: flen => (const) length of fine grid slope array c ::: fdat => (const) temp array for fine grid data c ::: limslope => (const) != 0 => limit slopes c ::: c ::: NOTE: data must be sent in so that c ::: cslope(1,*) and crse(1,*) are associated with c ::: the same cell c ::: c ::: EXAMPLE: c ::: Suppose the patch called "fine" has index extent: c ::: c ::: floi1 = 3, fhii1 = 12 c ::: floi2 = 8, fhii2 = 20 c ::: c ::: suppose the subergion of this patch that is to be filled c ::: by interpolation has index extent: c ::: c ::: fblo(1) = 5, fbhi(1) = 10 c ::: fblo(2) = 13, fbhi(2) = 20 c ::: c ::: suppose the refinement ratio is 2 c ::: c ::: Then the coarsening of this subregion (to level 0) is c ::: c ::: cb_l1 = 2 cb_h1 = 5 (ncbx = 4) c ::: cb_l2 = 6 cb_h2 = 10 (ncby = 5) c ::: c ::: In order to compute slopes, we need one extra row of c ::: coarse grid zones: c ::: c ::: cslo(1) = 1 cshi(1) = 6 (ncsx = 6) c ::: cslo(2) = 5 cshi(2) = 11 (ncsy = 7) c ::: c ::: This is the size of the coarse grid array of data that filpatch c ::: has filled at level 0. c ::: The "cslope" and "crse" arrays are this size. c ::: c ::: In order to unroll the slope calculation we make these arrays look c ::: like 1-D arrays. The mapping from 2-D to 1-D is as fillows: c ::: c ::: The point (cb_l(1),cb_l(2)) -> 1 c ::: The point (cslo(1),cslo(2)) -> clo = 1 - 1 - ncsx = -6 c ::: c ::: The point (cb_h1,cb_h2) -> clen = ncby*ncsx - 2 = 5*6-2 = 28 c ::: The point (cshi(1),cshi(2)) -> chi = clo + ncsx*ncsy - 1 c ::: = -6 + 6*7 - 1 = 35 c ::: c ::: ------------------------------------------------- c ::: | | | | | | chi | c ::: 11 | 30 | 31 | 32 | 33 | 34 | 35 | cshi(2) c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | clen | | c ::: 10 | 24 | 25 | 26 | 27 | 28 | 29 | cb_h(2) c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 9 | 18 | 19 | 20 | 21 | 22 | 23 | c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 8 | 12 | 13 | 14 | 15 | 16 | 17 | c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 7 | 6 | 7 | 8 | 9 | 10 | 11 | c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 6 | 0 | 1 | 2 | 3 | 4 | 5 | cb_l(2) c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | clo | | | | | | c ::: 5 | -6 | -5 | -4 | -3 | -2 | -1 | cslo(2) c ::: | | | | | | | c ::: ------------------------------------------------- c ::: 1 2 3 4 5 6 c ::: cb_l1 cb_h1 c ::: cslo(1) cshi(1) c ::: c ::: c ::: In the 1-D coordinates: c ::: ist = 1 = stride in I direction c ::: jst = 6 = stride in J direction (ncsx) c ::: c ::: -------------------------------------------------------------- c ::: #if 0 subroutine FORT_CCINTERP (fine, DIMS(fine), $ fb_l1, fb_h1, $ nvar, lratio, crse, clo, chi, $ cb_l1, cb_h1, $ fslo, fshi, cslope, clen, fslope, fdat, $ flen, voff, bc, limslope, $ fvcx, cvcx) integer DIMDEC(fine) integer fslo(1), fshi(1) integer fb_l1, fb_h1 integer cb_l1, cb_h1 integer clo, chi integer lratio, nvar, clen, flen, limslope integer bc(1,2,nvar) REAL_T fine(DIMV(fine),nvar) REAL_T crse(clo:chi, nvar) REAL_T cslope(clo:chi, 2) REAL_T fslope(flen, 2) REAL_T fdat(flen) REAL_T voff(flen) REAL_T fvcx(fb_l1:fb_h1+1) REAL_T cvcx(cb_l1:cb_h1+1) #define bclo(i,n) bc(i,1,n) #define bchi(i,n) bc(i,2,n) c ::: local var c ::: local var integer n, fn integer i, ic, ioff integer j, jc, joff integer ist, jst REAL_T hafrat, volratio REAL_T cen, forw, back, slp, sgn REAL_T fcen, ccen REAL_T xoff, yoff integer ncbx, ncby integer ncsx, ncsy integer islo, jslo integer icc, istart, iend integer lenx, leny, maxlen logical xok, yok hafrat = half*dble(lratio-1) volratio = one/dble(lratio) ncbx = cb_h1-cb_l1+1 ncsx = ncbx+2 ist = 1 do 200 i = fb_l1, fb_h1 fn = i-fslo(1)+1 ic = IX_PROJ(i,lratio) fcen = half*(fvcx(i)+fvcx(i+1)) ccen = half*(cvcx(ic)+cvcx(ic+1)) voff(fn) = (fcen-ccen)/(cvcx(ic+1)-cvcx(ic)) 200 continue do 210 n = 1, nvar c ::: ::::: compute slopes in x direction do 220 i = 1, clen cen = half*(crse(i+ist,n)-crse(i-ist,n)) forw = crse(i+ist,n)-crse(i,n) back = crse(i,n)-crse(i-ist,n) slp = sign(one,cen)*min(abs(cen),abs(forw),abs(back)) cslope(i,1)=cvmgp(slp,zero,forw*back) 220 continue c ::: .....::::: strip out a fine grid slope vector do 230 ioff = 1, lratio icc = clo + ist istart = ioff iend = ioff + (ncbx-1)*lratio do 240 fn = istart, iend, lratio fslope(fn,1) = cslope(icc,1) fdat(fn) = crse(icc,n) icc = icc + ist 240 continue 230 continue do 250 i = fb_l1, fb_h1 fn = i-fslo(1)+1 fine(i,n) = fdat(fn) + voff(fn)*fslope(fn,1) 250 continue 210 continue return end #endif # if 1 subroutine FORT_CCINTERP (fine, DIMS(fine), $ fb_l1, fb_h1, $ nvar, lratio, crse, clo, chi, $ cb_l1, cb_h1, $ fslo, fshi, cslope, clen, fslope, fdat, $ flen, voff, bc, limslope, $ fvcx, cvcx) integer DIMDEC(fine) integer fslo(1), fshi(1) integer fb_l1, fb_h1 integer cb_l1, cb_h1 integer clo, chi integer lratio, nvar, clen, flen, limslope integer bc(1,2,nvar) REAL_T fine(DIMV(fine),nvar) REAL_T crse(clo:chi, nvar) REAL_T cslope(clo:chi, 2) REAL_T fslope(flen, 2) REAL_T fdat(flen) REAL_T voff(flen) REAL_T fvcx(fb_l1:fb_h1+1) REAL_T cvcx(cb_l1:cb_h1+1) #if 0 #define bclo(i,n) bc(i,1,n) #define bchi(i,n) bc(i,2,n) #endif c ::: local var integer n, fn integer i, ic, ioff integer j, jc, joff integer ist, jst REAL_T hafrat, volratio REAL_T cen, forw, back, slp, sgn REAL_T fcen, ccen REAL_T xoff, yoff integer ncbx, ncby integer ncsx, ncsy integer islo, jslo integer icc, istart, iend integer lenx, leny, maxlen logical xok, yok hafrat = half*dble(lratio-1) volratio = one/dble(lratio) ncbx = cb_h1-cb_l1+1 xok = (ncbx .ge. 2) ncsx = ncbx+2 ist = 1 islo = cb_l1-1 jst = ncsx lenx = fb_h1-fb_l1+1 do i = fb_l1, fb_h1 fn = i-fslo(1)+1 ic = IX_PROJ(i,lratio) fcen = half*(fvcx(i)+fvcx(i+1)) ccen = half*(cvcx(ic)+cvcx(ic+1)) voff(fn) = (fcen-ccen)/(cvcx(ic+1)-cvcx(ic)) enddo c ::: ::::: added to prevent underflow for small crse values do n = 1, nvar do i = clo, chi crse(i,n) = cvmgt(crse(i,n),zero,abs(crse(i,n)).gt.1.0D-20) enddo enddo do 290 n = 1, nvar c ::: ::::: compute slopes in x direction if (limslope .ne. 0) then do i = 1, clen cen = half*(crse(i+ist,n)-crse(i-ist,n)) forw = two*(crse(i+ist,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-ist,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,1)=sign(one,cen)*min(slp,abs(cen)) enddo if (xok) then c if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then if (bc(1,1,n) .eq. EXT_DIR .or. bc(1,1,n).eq.HOEXTRAP) then do i = 1, clen, jst cen = -sixteen/fifteen*crse(i-ist,n) + half*crse(i,n) $ + two3rd*crse(i+ist,n) - tenth*crse(i+2*ist,n) sgn = sign(one,crse(i+ist,n)-crse(i-ist,n)) forw = two*(crse(i+ist,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-ist,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,1)=sgn*min(slp,abs(cen)) enddo endif if (bc(1,2,n) .eq. EXT_DIR .or. bc(1,2,n).eq.HOEXTRAP) then do i = ncbx, clen, jst cen = sixteen/fifteen*crse(i+ist,n) - half*crse(i,n) $ - two3rd*crse(i-ist,n) + tenth*crse(i-2*ist,n) sgn = sign(one,crse(i+ist,n)-crse(i-ist,n)) forw = two*(crse(i+ist,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-ist,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,1)=sgn*min(slp,abs(cen)) enddo endif endif else do i = 1, clen cen = half*(crse(i+ist,n)-crse(i-ist,n)) cslope(i,1)=cen enddo if (xok) then c if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then if (bc(1,1,n) .eq. EXT_DIR .or. bc(1,1,n).eq.HOEXTRAP) then do i = 1, clen, jst cen = -sixteen/fifteen*crse(i-ist,n) + half*crse(i,n) $ + two3rd*crse(i+ist,n) - tenth*crse(i+2*ist,n) cslope(i,1)=cen enddo endif if (bc(1,2,n) .eq. EXT_DIR .or. bc(1,2,n).eq.HOEXTRAP) then do i = ncbx, clen, jst cen = sixteen/fifteen*crse(i+ist,n) - half*crse(i,n) $ - two3rd*crse(i-ist,n) + tenth*crse(i-2*ist,n) cslope(i,1)=cen enddo endif endif endif c ::::: strip out a fine grid slope vector do 370 ioff = 1, lratio icc = clo + ist istart = ioff iend = ioff + (ncbx-1)*lratio do 380 fn = istart, iend, lratio fslope(fn,1) = cslope(icc,1) c fslope(fn,2) = cslope(icc,2) fdat(fn) = crse(icc,n) icc = icc + ist 380 continue 370 continue do 400 i = fb_l1, fb_h1 fn = i-fslo(1)+1 fine(i,n) = fdat(fn) + voff(fn)*fslope(fn,1) 400 continue 391 continue 290 continue return end #endif c ::: c ::: -------------------------------------------------------------- c ::: pcinterp: cell centered piecewise constant interpolation c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: c ::: crse => (const) coarse grid data c ::: clo,chi => (const) index limits of coarse grid c ::: cblo,cbhi => (const) coarse grid region containing fblo,fbhi c ::: c ::: longdir => (const) which index direction is longest (1 or 2) c ::: ratio => (const) refinement ratio between levels c ::: nvar => (const) number of components in array c ::: c ::: TEMPORARY ARRAYS c ::: ftmp => 1-D temp array c ::: -------------------------------------------------------------- c ::: subroutine FORT_PCINTERP (crse,DIMS(crse),cblo,cbhi, & fine,DIMS(fine),fblo,fbhi, & longdir,lratio,nvar,ftmp,ftmp_lo,ftmp_hi) integer DIMDEC(crse) integer cblo(2), cbhi(2) integer DIMDEC(fine) integer fblo(2), fbhi(2) integer ftmp_lo, ftmp_hi integer nvar, lratio, longdir REAL_T crse(DIMV(crse), nvar) REAL_T fine(DIMV(fine), nvar) REAL_T ftmp(ftmp_lo:ftmp_hi) REAL_T sumrho integer i, j, ic, jc, ioff, joff, n do n = 1, nvar do ioff = 0, lratio-1 do ic = cblo(1), cbhi(1) i = lratio*ic + ioff ftmp(i) = crse(ic,n) enddo enddo do i = fblo(1), fbhi(1) fine(i,n) = ftmp(i) enddo enddo #if 0 do i = fblo(1), fbhi(1) sumrho = fine(i,5)+fine(i,8) if(abs(sumrho-fine(i,1)) .gt. 1.d-15) then write(6,*)' sum of rhos .ne. total ' endif enddo #endif return end ccseapps-2.5/CCSEApps/amrlib/SlabStat.H0000644000175000017500000001567511634153073020771 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _SlabStat_H_ #define _SlabStat_H_ // // $Id: SlabStat.H,v 1.9 2001/08/01 21:50:46 lijewski Exp $ // #include #include #include #include #include // // Forward declaration. // class AmrLevel; extern "C" { // // Type of extern "C" function called by SlabStat to compute a statistic. // // `dst' contains the statistics to be updated in place. // `src' contains the variables need to calculate the statistics. // typedef void (*SlabStatFunc)(const Real* src, ARLIM_P(src_lo), ARLIM_P(src_hi), const int* nsrc, Real* dst, ARLIM_P(dst_lo), ARLIM_P(dst_hi), const int* ndst, const Real* dt, const Real* dx); } // //@Man: //@Memo: Slab Statistics Record /*@Doc: SlabStatRecs are designed to control the output of running averages as a simulation proceeds. A required list of state and derived variables is specified, as well as a list of boxes on which the statistics are to be calculated. Every time step on the level where these boxes are defined, the specified fortran function is called and the running statistics are accumulated. The statistics are written out every check_int level 0 timesteps. */ class SlabStatRec { friend class SlabStatList; public: // //@ManDoc: The name of the statistic. // const std::string& name () const; // //@ManDoc: Number of components in the statistic. // int nComp () const; // //@ManDoc: The names of State/Derived variables needed for statistic. // const Array& vars () const; // //@ManDoc: Number of variables used to calculate statistic. // long nVariables () const; // //@ManDoc: Ghost cells needed in the variables when calculating statistic. // int nGrow () const; // //@ManDoc: Level on which to calculate the statistic // int level () const; // //@ManDoc: Boxes, at specified level, on which to calculate the statistic. // const BoxArray& boxes () const; // //@ManDoc: The SlabStatFunc used to calculate the statistic. // SlabStatFunc func () const; // //@ManDoc: The MultiFab in which statistics are accumulated. // MultiFab& mf (); // //@ManDoc: Temporary (grown) MultiFab used in calculating the statistic. // MultiFab& tmp_mf (); // //@ManDoc: Interval over which the stats have been calculated. // Real interval () const; protected: // // A Constructor. // SlabStatRec (const std::string& name, int ncomp, Array& vars, int ngrow, int level, const BoxArray& boxes, SlabStatFunc func); // // Another Constructor. // SlabStatRec (const std::string& name, int ncomp, Array& vars, int ngrow, SlabStatFunc func); // // Destructor. // ~SlabStatRec (); // // Name of statistic // std::string m_name; // // Number of components in the statistic. // int m_ncomp; // // Names of State/Derived variables needed to calculate statistic. // Array m_vars; // // Ghost cells needed in variables when calculating the statistic. // int m_ngrow; // // Level on which to calculate statistic. // int m_level; // // Boxes, at specified level, on which to calculate the statistic. // BoxArray m_boxes; // // Function that computes the statistic. // SlabStatFunc m_func; // // MultiFab in which to accumulate statistics across checkpoints. // MultiFab m_mf; // // Temporary (grown) MultiFab used in calculating the statistic. // MultiFab m_tmp_mf; // // Time interval over which the Stats have been summed. // Real m_interval; private: // // Disallowed. // SlabStatRec (const SlabStatRec&); SlabStatRec& operator= (const SlabStatRec&); }; // //@Man: //@Memo: A list of SlabStatRecs. /*@Doc: SlabStatList manages and provides access to the list of SlabStatRecs. */ class SlabStatList { public: // //@ManDoc: The default constructor. // SlabStatList (); // //@ManDoc: The destructor. // ~SlabStatList (); // //@ManDoc: Adds another entry to the list of SlabStats. // void add (const std::string& name, int ncomp, Array& vars, int ngrow, int level, const BoxArray& boxes, SlabStatFunc func); // //@ManDoc: Another way to add an entry to the list of SlabStats. // void add (const std::string& name, int ncomp, Array& vars, int ngrow, SlabStatFunc func); // //@ManDoc: Update the statistics in the list. // void update (AmrLevel& amrlevel, Real time, Real dt); // //@ManDoc: Write out any SlabStats in the list. // void checkPoint (PArray& amrLevels, int level0_step); std::list& list (); private: // // Disallowed. // SlabStatList (const SlabStatList&); SlabStatList& operator= (const SlabStatList&); std::list m_list; }; #endif /*_SlabStat_H_*/ ccseapps-2.5/CCSEApps/amrlib/Derive.H0000644000175000017500000001777611634153073020476 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _Derive_H_ #define _Derive_H_ // // $Id: Derive.H,v 1.15 2001/08/01 21:50:45 lijewski Exp $ // #include #include #include #include #include #include class DescriptorList; extern "C" { // // Type of extern "C" function called by DeriveRec to compute derived quantity. // typedef void (*DeriveFunc)(Real* data, ARLIM_P(dlo), ARLIM_P(dhi), const int* nvar, const Real* compdat, ARLIM_P(compdat_lo), ARLIM_P(compdat_hi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; } // //@Man: //@Memo: Derived Type Record /*@Doc: Computes quantities derived from state data. DeriveRec is designed to compute quantities which can be derived from the state data contained in AmrLevel and its derivatives. Some examples might be kinetic energy, vorticity, concentration gradients ... */ class DeriveRec { friend class DeriveList; public: // //@ManDoc: A pointer to function taking and returning a Box. // typedef Box (*DeriveBoxMap)(const Box&); // //@ManDoc: The destructor. // ~DeriveRec (); // //@ManDoc: The name of the derived type. // const std::string& name () const; // //@ManDoc: The names of components // const std::string& variableName (int comp) const; // //@ManDoc: The IndexType of the derived type. // IndexType deriveType () const; // //@ManDoc: The DeriveFunc used to calculate the derived type. // DeriveFunc derFunc () const; // //@ManDoc: Maps state data box to derived data box. // DeriveBoxMap boxMap () const; // //@ManDoc: Type of interpolater to use in computing derived type. // Interpolater* interp () const; // //@ManDoc: Number of components in the derived type. // int numDerive () const; // //@ManDoc: Number of different chunks of state data needed for derived type. // int numRange () const; // //@ManDoc: Total number of state variables needed for derived type. // int numState () const; // //@ManDoc: The boundary conditions. // const int* getBC () const; /*@ManDoc: Sets state\_indx, src\_comp and num\_comp for the kth range (or chunk) of state data components needed to calculate the derived quantity. */ void getRange (int k, int& state_indx, int& src_comp, int& num_comp) const; protected: // // Constructor. // DeriveRec (const std::string& name, IndexType result_type, int nvar_derive, DeriveFunc der_func, DeriveBoxMap box_map, Interpolater* interp = &pc_interp); // // Constructor. // DeriveRec (const std::string& name, IndexType result_type, int nvar_derive, Array& var_names, DeriveFunc der_func, DeriveBoxMap box_map, Interpolater* interp = &pc_interp); void addRange (const DescriptorList& d_list, int state_indx, int src_comp, int num_comp); void buildBC (const DescriptorList& d_list); // // An element of a linked list to point to state quantities in AmrLevels. // struct StateRange { int typ; int sc; int nc; StateRange* next; }; // // Name of derived quantity. // std::string derive_name; // // Names of derived variables // Array variable_names; // // Type of derived quantity. // IndexType der_type; // // Number of components in derived quantity. // int n_derive; // // Function that computes derived quantity from state variables. // DeriveFunc func; // // Interpolater for mapping crse grid derived data to finer levels. // Interpolater* mapper; // // Box mapper that specifies constituent region given derived region. // DeriveBoxMap bx_map; // // Total number of state variables. // int n_state; // // Number of state ranges. // int nsr; // // List of state data subranges required to derive given quantity. // StateRange* rng; // // Array of bndry types. // int* bcr; }; // //@Man: //@Memo: A list of DeriveRecs. /*@Doc: DeriveList manages and provides access to the list of DeriveRecs. */ class DeriveList { public: // //@ManDoc: The default constructor. // DeriveList (); // //@ManDoc: Determines whether quantity identified by is in the registry. // bool canDerive (const std::string& name) const; // //@ManDoc: Access the particular record in registry. // const DeriveRec* get (const std::string& name) const; // //@ManDoc: Adds another entry to the registry. // void add (const std::string& name, IndexType result_type, int nvar_derive, DeriveFunc der_func, DeriveRec::DeriveBoxMap box_map, Interpolater* interp = &pc_interp); // //@ManDoc: Adds another entry to the registry. // void add (const std::string& name, IndexType result_type, int nvar_derive, Array& var_names, DeriveFunc der_func, DeriveRec::DeriveBoxMap box_map, Interpolater* interp = &pc_interp); // //@ManDoc: Adds another StateRange to the DeriveRec identified by . // void addComponent (const std::string& name, const DescriptorList& d_list, int state_indx, int start_comp, int ncomp); std::list& dlist (); private: // // Disallowed. // DeriveList (const DeriveList&); DeriveList& operator= (const DeriveList&); std::list lst; }; #endif /*_Derive_H_*/ ccseapps-2.5/CCSEApps/amrlib/FLUSH_F.H0000644000175000017500000000271611634153073020372 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _FLUSH_F_H_ #define _FLUSH_F_H_ c c $Id: FLUSH_F.H,v 1.1 2000/06/21 22:07:34 sstanley Exp $ c #if defined(BL_AIX) #define FORT_FLUSH flush_ #else #define FORT_FLUSH flush #endif #endif ccseapps-2.5/CCSEApps/amrlib/StateDescriptor.H0000644000175000017500000003066411634153073022366 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _StateDescriptor_H_ #define _StateDescriptor_H_ // // $Id: StateDescriptor.H,v 1.21 2003/02/06 18:14:29 lijewski Exp $ // #include #include #include #include #include #include #include #include class Interpolater; extern "C" { typedef void (*BndryFuncDefault)(Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); } // //@Man: //@Memo: Attributes of StateData. /*@Doc: Attributes of StateData. */ class StateDescriptor { friend class DescriptorList; public: // //@ManDoc: Defines the temporal centeredness of data. // enum TimeCenter { Point = 0 , Interval }; // //@ManDoc: Type of function called by BCRec for user-supplied boundary data. // // Class wrapper around BndryFuncDefault. // class BndryFunc { public: // // Bogus constructor. // BndryFunc (); // // A Constructor. // BndryFunc (BndryFuncDefault inFunc); // // Another Constructor. // BndryFunc (BndryFuncDefault inFunc,BndryFuncDefault gFunc); // // Return a ptr to a clone of this object. // It is the responsibility of the caller to delete the result. // virtual BndryFunc* clone () const; // // Destructor. // virtual ~BndryFunc (); // // Fill boundary cells using "regular" function. // virtual void operator () (Real* data, const int* lo, const int* hi, const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc) const; // // Fill boundary cells using "group" function. // virtual void operator () (Real* data, const int* lo, const int* hi, const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc, bool) const; private: BndryFuncDefault m_func; BndryFuncDefault m_gfunc; }; // //@ManDoc: The default constructor. // StateDescriptor (); // //@ManDoc: Constructor that sets all data members. // StateDescriptor (IndexType btyp, TimeCenter ttyp, int ident, int nextra, int num_comp, Interpolater* interp, bool extrap = false); // //@ManDoc: The destructor. // ~StateDescriptor (); // //@ManDoc: Define the data members if constructed with default construtor. // void define (IndexType btyp, TimeCenter ttyp, int ident, int nextra, int num_comp, Interpolater* interp, bool extrap = false); // //@ManDoc: Sets details of `comp' component. // void setComponent (int comp, const std::string& nm, const BCRec& bc, const BndryFunc& func, Interpolater* interp = 0, int max_map_start_comp = -1, int min_map_end_comp = -1); // //@ManDoc: Sets details of `comp' component. // void setComponent (int comp, const std::string& nm, const BCRec& bc, const BndryFunc& func, Interpolater* interp, bool master_or_slave, int groupsize); // //@ManDoc: Resets boundary condition data for `comp' component. // void resetComponentBCs (int comp, const BCRec& bcr, const BndryFunc& func); // //@ManDoc: Set interpolaters for a subset of the state vector components. // void setUpMaps (int& use_default_map, const Interpolater* default_map, int start_comp, int num_comp, Interpolater**& maps, int& nmaps, int*& map_start_comp, int*& map_num_comp, int*& max_start_comp, int*& min_end_comp) const; // //@ManDoc: Cleanup interpolaters for a subset of the state vector components. // void cleanUpMaps (Interpolater**& maps, int*& map_start_comp, int*& map_num_comp, int*& max_start_comp, int*& min_end_comp) const; // //@ManDoc: Output names of components. // void dumpNames (std::ostream& os, int start_comp, int num_comp) const; // //@ManDoc: Returns the IndexType. // IndexType getType () const; // //@ManDoc: Returns StateDescriptor::TimeCenter. // StateDescriptor::TimeCenter timeType () const; // //@ManDoc: Returns number of components. // int nComp () const; // //@ManDoc: Returns the grow factor. // int nExtra () const; // //@ManDoc: Returns the interpolater. // Interpolater* interp () const; // //@ManDoc: Returns the interpolater of specified component. // Interpolater* interp (int i) const; // //@ManDoc: Returns the name of specified component. // const std::string& name (int i) const; // //@ManDoc: Returns the BCRec of specified component. // const BCRec& getBC (int i) const; // //@ManDoc: Returns all BCRecs. // const Array& getBCs () const; // //@ManDoc: Returns the BndryFunc of specified component. // const BndryFunc& bndryFill (int i) const; // //@ManDoc: Is sc>=0 \&\& sc+nc<=ncomp ? // int inRange (int sc, int nc) const; // //@ManDoc: Are the interpolaters in the specified range identical? // bool identicalInterps (int scomp, int ncomp) const; // //@ManDoc: Returns contiguous ranges of comps with identical interpolaters. // std::vector< std::pair > sameInterps (int scomp, int ncomp) const; // //@ManDoc: Can extrapolate in time. // bool extrap () const; bool master (int i) const { return m_master[i]; } int groupsize (int i) const { return m_groupsize[i]; } protected: IndexType type; // Cell centered, node centered ... TimeCenter t_type; // Temporal centering int id; // Unique id int ncomp; // Number of components int ngrow; // Grow factor Interpolater* mapper; // Default interpolator bool m_extrap; // Can extrapolate in time? Array names; // Printable names of components Array bc; // Array of bndry types for entire level PArray bc_func; // PArray of pointers to bndry fill functions std::vector m_master; // Are we a master or slave? Array m_groupsize; // Groupsize if we're a master // // If mapper_comp[icomp] != 0, that map is used instead of mapper // when interpolating icomp; otherwise, mapper is used. // Array mapper_comp; // // For component icomp, max_map_start_comp[icomp] and // min_map_end_comp[icomp] represent the maximum starting index and // minimum ending index with which to use mapper_comp[icomp] when // interpolating component icomp. These are convenient for using // with "coupled" multiple component maps like CellConservativeLinear. // // If there is no need to "couple" a component, max_map_start_comp[icomp] // and min_map_end_comp[icomp] simply equal icomp. // Array max_map_start_comp; Array min_map_end_comp; }; // //@Man: //@Memo: A List of StateDescriptors. /*@Doc: A container class for StateDescriptors. */ class DescriptorList { public: // //@ManDoc: The constructor. // DescriptorList (); // //@ManDoc: Set the list to its default state. // void clear (); // //@ManDoc: Returns number of elements in the list. // int size () const; // //@ManDoc: Adds new StateDescriptor at index `indx' to list. // void addDescriptor (int indx, IndexType typ, StateDescriptor::TimeCenter ttyp, int nextra, int num_comp, Interpolater* interp, bool extrap = false); // //@ManDoc: Calls resetComponentBCs() on StateDescriptor at index `indx'. // void resetComponentBCs (int indx, int comp, const BCRec& bc, const StateDescriptor::BndryFunc& func); // //@ManDoc: Calls setComponent() on StateDescriptor at index `indx'. // void setComponent (int indx, int comp, const std::string& nm, const BCRec& bc, const StateDescriptor::BndryFunc& func, Interpolater* interp = 0, int max_map_start_comp = -1, int min_map_end_comp = -1); // //@ManDoc: Calls setComponent() on StateDescriptor at index `indx' on group. // void setComponent (int indx, int comp, const Array& nm, const Array& bc, const StateDescriptor::BndryFunc& func, Interpolater* interp = 0); // //@ManDoc: Returns StateDescriptor at index `k'. // const StateDescriptor& operator[] (int k) const; private: // // These are disallowed. // DescriptorList (const DescriptorList&); DescriptorList& operator= (const DescriptorList&); PArray desc; }; #endif /*_StateDescriptor_H_*/ ccseapps-2.5/CCSEApps/amrlib/SLABSTAT_F.H0000644000175000017500000000550011634153073020720 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _SLABSTAT_F_H_ #define _SLABSTAT_F_H_ /* ** $Id: SLABSTAT_F.H,v 1.3 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_REYNAVG_FIRST4MOMS reynavg_first4moms # define FORT_FAVREAVG_FIRST4MOMS favreavg_first4moms #else # ifdef BL_FORT_USE_UPPERCASE # define FORT_REYNAVG_FIRST4MOMS REYNAVG_FIRST4MOMS # define FORT_FAVREAVG_FIRST4MOMS FAVREAVG_FIRST4MOMS # else # ifdef BL_FORT_USE_LOWERCASE # define FORT_REYNAVG_FIRST4MOMS reynavg_first4moms # define FORT_FAVREAVG_FIRST4MOMS favreavg_first4moms # else # define FORT_REYNAVG_FIRST4MOMS reynavg_first4moms_ # define FORT_FAVREAVG_FIRST4MOMS favreavg_first4moms_ # endif # endif extern "C" { void FORT_REYNAVG_FIRST4MOMS (const Real* src, ARLIM_P(src_lo), ARLIM_P(src_hi), const int* nsrc, Real* dst, ARLIM_P(dst_lo), ARLIM_P(dst_hi), const int* ndst, const Real* dt, const Real* dx); void FORT_FAVREAVG_FIRST4MOMS (const Real* src, ARLIM_P(src_lo), ARLIM_P(src_hi), const int* nsrc, Real* dst, ARLIM_P(dst_lo), ARLIM_P(dst_hi), const int* ndst, const Real* dt, const Real* dx); } #endif #endif /*_SLABSTAT_F_H_*/ ccseapps-2.5/CCSEApps/amrlib/FILCC_2D.F0000644000175000017500000003431411634153073020406 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: FILCC_2D.F,v 1.8 2002/07/31 22:32:02 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "ArrayLim.H" #define SDIM 2 c ::: ----------------------------------------------------------- c ::: This routine is intended to be a generic fill function c ::: for cell-centered data. It knows how to extrapolate c ::: and reflect data and is used to supplement the problem-specific c ::: fill functions which call it. c ::: c ::: INPUTS/OUTPUTS: c ::: q <= array to fill c ::: lo,hi => index extent of q array c ::: domlo,domhi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of q array c ::: bc => array of boundary flags bc(SPACEDIM,lo:hi) c ::: c ::: NOTE: all corner as well as edge data is filled if not EXT_DIR c ::: ----------------------------------------------------------- subroutine filcc(q,DIMS(q),domlo,domhi,dx,xlo,bc) integer DIMDEC(q) integer domlo(SDIM), domhi(SDIM) integer bc(SDIM,2) REAL_T xlo(SDIM), dx(SDIM) REAL_T q(DIMV(q)) integer nlft, nrgt, nbot, ntop integer ilo, ihi, jlo, jhi integer i, j integer is, ie, js, je nlft = max(0,domlo(1)-ARG_L1(q)) nrgt = max(0,ARG_H1(q)-domhi(1)) nbot = max(0,domlo(2)-ARG_L2(q)) ntop = max(0,ARG_H2(q)-domhi(2)) is = max(ARG_L1(q),domlo(1)) ie = min(ARG_H1(q),domhi(1)) js = max(ARG_L2(q),domlo(2)) je = min(ARG_H2(q),domhi(2)) c ::::: first fill sides if (nlft .gt. 0) then ilo = domlo(1) if (bc(1,1) .eq. FOEXTRAP) then do i = 1, nlft do j = ARG_L2(q), ARG_H2(q) q(ilo-i,j) = q(ilo,j) end do end do else if (bc(1,1) .eq. HOEXTRAP) then do i = 2, nlft do j = ARG_L2(q), ARG_H2(q) q(ilo-i,j) = q(ilo,j) end do end do if (ilo+2 .le. ie) then do j = ARG_L2(q), ARG_H2(q) q(ilo-1,j) = (15*q(ilo,j) - 10*q(ilo+1,j) + $ 3*q(ilo+2,j)) * eighth end do else do j = ARG_L2(q), ARG_H2(q) q(ilo-1,j) = half*(3*q(ilo,j) - q(ilo+1,j)) end do end if else if (bc(1,1) .eq. REFLECT_EVEN) then do i = 1, nlft do j = ARG_L2(q), ARG_H2(q) q(ilo-i,j) = q(ilo+i-1,j) end do end do else if (bc(1,1) .eq. REFLECT_ODD) then do i = 1, nlft do j = ARG_L2(q), ARG_H2(q) q(ilo-i,j) = -q(ilo+i-1,j) end do end do end if end if if (nrgt .gt. 0) then ihi = domhi(1) if (bc(1,2) .eq. FOEXTRAP) then do i = 1, nrgt do j = ARG_L2(q), ARG_H2(q) q(ihi+i,j) = q(ihi,j) end do end do else if (bc(1,2) .eq. HOEXTRAP) then do i = 2, nrgt do j = ARG_L2(q), ARG_H2(q) q(ihi+i,j) = q(ihi,j) end do end do if (ihi-2 .ge. is) then do j = ARG_L2(q), ARG_H2(q) q(ihi+1,j) = (15*q(ihi,j) - 10*q(ihi-1,j) + $ 3*q(ihi-2,j)) * eighth end do else do j = ARG_L2(q), ARG_H2(q) q(ihi+1,j) = half*(3*q(ihi,j) - q(ihi-1,j)) end do end if else if (bc(1,2) .eq. REFLECT_EVEN) then do i = 1, nrgt do j = ARG_L2(q), ARG_H2(q) q(ihi+i,j) = q(ihi-i+1,j) end do end do else if (bc(1,2) .eq. REFLECT_ODD) then do i = 1, nrgt do j = ARG_L2(q), ARG_H2(q) q(ihi+i,j) = -q(ihi-i+1,j) end do end do end if end if if (nbot .gt. 0) then jlo = domlo(2) if (bc(2,1) .eq. FOEXTRAP) then do j = 1, nbot do i = ARG_L1(q), ARG_H1(q) q(i,jlo-j) = q(i,jlo) end do end do else if (bc(2,1) .eq. HOEXTRAP) then do j = 2, nbot do i = ARG_L1(q), ARG_H1(q) q(i,jlo-j) = q(i,jlo) end do end do if (jlo+2 .le. je) then do i = ARG_L1(q), ARG_H1(q) q(i,jlo-1) = (15*q(i,jlo) - 10*q(i,jlo+1) + $ 3*q(i,jlo+2)) * eighth end do else do i = ARG_L1(q), ARG_H1(q) q(i,jlo-1) = half*(3*q(i,jlo) - q(i,jlo+1)) end do end if else if (bc(2,1) .eq. REFLECT_EVEN) then do j = 1, nbot do i = ARG_L1(q), ARG_H1(q) q(i,jlo-j) = q(i,jlo+j-1) end do end do else if (bc(2,1) .eq. REFLECT_ODD) then do j = 1, nbot do i = ARG_L1(q), ARG_H1(q) q(i,jlo-j) = -q(i,jlo+j-1) end do end do end if end if if (ntop .gt. 0) then jhi = domhi(2) if (bc(2,2) .eq. FOEXTRAP) then do j = 1, ntop do i = ARG_L1(q), ARG_H1(q) q(i,jhi+j) = q(i,jhi) end do end do else if (bc(2,2) .eq. HOEXTRAP) then do j = 2, ntop do i = ARG_L1(q), ARG_H1(q) q(i,jhi+j) = q(i,jhi) end do end do if (jhi-2 .ge. js) then do i = ARG_L1(q), ARG_H1(q) q(i,jhi+1) = (15*q(i,jhi) - 10*q(i,jhi-1) + $ 3*q(i,jhi-2)) * eighth end do else do i = ARG_L1(q), ARG_H1(q) q(i,jhi+1) = half*(3*q(i,jhi) - q(i,jhi-1)) end do end if else if (bc(2,2) .eq. REFLECT_EVEN) then do j = 1, ntop do i = ARG_L1(q), ARG_H1(q) q(i,jhi+j) = q(i,jhi-j+1) end do end do else if (bc(2,2) .eq. REFLECT_ODD) then do j = 1, ntop do i = ARG_L1(q), ARG_H1(q) q(i,jhi+j) = -q(i,jhi-j+1) end do end do end if end if if ((nlft .gt. 0 .and. bc(1,1) .eq. HOEXTRAP) .and. $ (nbot .gt. 0 .and. bc(2,1) .eq. HOEXTRAP) ) then if (jlo+2 .le. je) then q(ilo-1,jlo-1) = half * eighth * $ (15*q(ilo-1,jlo) - 10*q(ilo-1,jlo+1) + 3*q(ilo-1,jlo+2)) else q(ilo-1,jlo-1) = half * half * $ (3*q(ilo-1,jlo) - q(ilo-1,jlo+1)) end if if (ilo+2 .le. ie) then q(ilo-1,jlo-1) = q(ilo-1,jlo-1) + half * eighth * $ (15*q(ilo,jlo-1) - 10*q(ilo+1,jlo-1) + 3*q(ilo+2,jlo-1)) else q(ilo-1,jlo-1) = q(ilo-1,jlo-1) + half * half * $ (3*q(ilo,jlo-1) - q(ilo+1,jlo-1)) end if end if if ((nlft .gt. 0 .and. bc(1,1) .eq. HOEXTRAP) .and. $ (ntop .gt. 0 .and. bc(2,2) .eq. HOEXTRAP) ) then if (jhi-2 .ge. js) then q(ilo-1,jhi+1) = half * eighth * $ (15*q(ilo-1,jhi) - 10*q(ilo-1,jhi-1) + 3*q(ilo-1,jhi-2)) else q(ilo-1,jhi+1) = half * half * $ (3*q(ilo-1,jhi) - q(ilo-1,jhi-1)) end if if (ilo+2 .le. ie) then q(ilo-1,jhi+1) = q(ilo-1,jhi+1) + half * eighth * $ (15*q(ilo,jhi+1) - 10*q(ilo+1,jhi+1) + 3*q(ilo+2,jhi+1)) else q(ilo-1,jhi+1) = q(ilo-1,jhi+1) + half * half * $ (3*q(ilo,jhi+1) - q(ilo+1,jhi+1)) end if end if if ((nrgt .gt. 0 .and. bc(1,2) .eq. HOEXTRAP) .and. $ (nbot .gt. 0 .and. bc(2,1) .eq. HOEXTRAP) ) then if (jlo+2 .le. je) then q(ihi+1,jlo-1) = half * eighth * $ (15*q(ihi+1,jlo) - 10*q(ihi+1,jlo+1) + 3*q(ihi+1,jlo+2)) else q(ihi+1,jlo-1) = half * half * $ (3*q(ihi+1,jlo) - q(ihi+1,jlo+1)) end if if (ihi-2 .ge. is) then q(ihi+1,jlo-1) = q(ihi+1,jlo-1) + half * eighth * $ (15*q(ihi,jlo-1) - 10*q(ihi-1,jlo-1) + 3*q(ihi-2,jlo-1)) else q(ihi+1,jlo-1) = q(ihi+1,jlo-1) + half * half * $ (3*q(ihi,jlo-1) - q(ihi-1,jlo-1)) end if end if if ((nrgt .gt. 0 .and. bc(1,2) .eq. HOEXTRAP) .and. $ (ntop .gt. 0 .and. bc(2,2) .eq. HOEXTRAP) ) then if (jhi-2 .ge. js) then q(ihi+1,jhi+1) = half * eighth * $ (15*q(ihi+1,jhi) - 10*q(ihi+1,jhi-1) + 3*q(ihi+1,jhi-2)) else q(ihi+1,jhi+1) = half * half * $ (3*q(ihi+1,jhi) - q(ihi+1,jhi-1)) end if if (ihi-2 .ge. is) then q(ihi+1,jhi+1) = q(ihi+1,jhi+1) + half * eighth * $ (15*q(ihi,jhi+1) - 10*q(ihi-1,jhi+1) + 3*q(ihi-2,jhi+1)) else q(ihi+1,jhi+1) = q(ihi+1,jhi+1) + half * half * $ (3*q(ihi,jhi+1) - q(ihi-1,jhi+1)) end if end if return end subroutine hoextraptocc(q,DIMS(q),domlo,domhi,dx,xlo) integer DIMDEC(q) integer domlo(SDIM), domhi(SDIM) REAL_T xlo(SDIM), dx(SDIM) REAL_T q(DIMV(q)) integer nlft, nrgt, nbot, ntop integer ilo, ihi, jlo, jhi integer i, j integer is, ie, js, je nlft = max(0,domlo(1)-ARG_L1(q)) nrgt = max(0,ARG_H1(q)-domhi(1)) nbot = max(0,domlo(2)-ARG_L2(q)) ntop = max(0,ARG_H2(q)-domhi(2)) is = max(ARG_L1(q),domlo(1)) ie = min(ARG_H1(q),domhi(1)) js = max(ARG_L2(q),domlo(2)) je = min(ARG_H2(q),domhi(2)) c c First fill sides. c if (nlft .gt. 0) then ilo = domlo(1) do i = 2, nlft do j = ARG_L2(q), ARG_H2(q) q(ilo-i,j) = q(ilo,j) end do end do if (ilo+2 .le. ie) then do j = ARG_L2(q), ARG_H2(q) q(ilo-1,j) = 3*q(ilo,j) - 3*q(ilo+1,j) + q(ilo+2,j) end do else do j = ARG_L2(q), ARG_H2(q) q(ilo-1,j) = 2*q(ilo,j) - q(ilo+1,j) end do end if end if if (nrgt .gt. 0) then ihi = domhi(1) do i = 2, nrgt do j = ARG_L2(q), ARG_H2(q) q(ihi+i,j) = q(ihi,j) end do end do if (ihi-2 .ge. is) then do j = ARG_L2(q), ARG_H2(q) q(ihi+1,j) = 3*q(ihi,j) - 3*q(ihi-1,j) + q(ihi-2,j) end do else do j = ARG_L2(q), ARG_H2(q) q(ihi+1,j) = 2*q(ihi,j) - q(ihi-1,j) end do end if end if if (nbot .gt. 0) then jlo = domlo(2) do j = 2, nbot do i = ARG_L1(q), ARG_H1(q) q(i,jlo-j) = q(i,jlo) end do end do if (jlo+2 .le. je) then do i = ARG_L1(q), ARG_H1(q) q(i,jlo-1) = 3*q(i,jlo) - 3*q(i,jlo+1) + q(i,jlo+2) end do else do i = ARG_L1(q), ARG_H1(q) q(i,jlo-1) = 2*q(i,jlo) - q(i,jlo+1) end do end if end if if (ntop .gt. 0) then jhi = domhi(2) do j = 2, ntop do i = ARG_L1(q), ARG_H1(q) q(i,jhi+j) = q(i,jhi) end do end do if (jhi-2 .ge. js) then do i = ARG_L1(q), ARG_H1(q) q(i,jhi+1) = 3*q(i,jhi) - 3*q(i,jhi-1) + q(i,jhi-2) end do else do i = ARG_L1(q), ARG_H1(q) q(i,jhi+1) = 2*q(i,jhi) - q(i,jhi-1) end do end if end if if (jlo+2 .le. je) then q(ilo-1,jlo-1) = half * $ (3*q(ilo-1,jlo) - 3*q(ilo-1,jlo+1) + q(ilo-1,jlo+2)) else q(ilo-1,jlo-1) = half * (2*q(ilo-1,jlo) - q(ilo-1,jlo+1)) end if if (ilo+2 .le. ie) then q(ilo-1,jlo-1) = q(ilo-1,jlo-1) + half * $ (3*q(ilo,jlo-1) - 3*q(ilo+1,jlo-1) + q(ilo+2,jlo-1)) else q(ilo-1,jlo-1) = q(ilo-1,jlo-1) + half * $ (2*q(ilo,jlo-1) - q(ilo+1,jlo-1)) end if if (jhi-2 .ge. js) then q(ilo-1,jhi+1) = half * $ (3*q(ilo-1,jhi) - 3*q(ilo-1,jhi-1) + q(ilo-1,jhi-2)) else q(ilo-1,jhi+1) = half * (2*q(ilo-1,jhi) - q(ilo-1,jhi-1)) end if if (ilo+2 .le. ie) then q(ilo-1,jhi+1) = q(ilo-1,jhi+1) + half * $ (3*q(ilo,jhi+1) - 3*q(ilo+1,jhi+1) + q(ilo+2,jhi+1)) else q(ilo-1,jhi+1) = q(ilo-1,jhi+1) + half * $ (2*q(ilo,jhi+1) - q(ilo+1,jhi+1)) end if if (jlo+2 .le. je) then q(ihi+1,jlo-1) = half * $ (3*q(ihi+1,jlo) - 3*q(ihi+1,jlo+1) + q(ihi+1,jlo+2)) else q(ihi+1,jlo-1) = half * (2*q(ihi+1,jlo) - q(ihi+1,jlo+1)) end if if (ihi-2 .ge. is) then q(ihi+1,jlo-1) = q(ihi+1,jlo-1) + half * $ (3*q(ihi,jlo-1) - 3*q(ihi-1,jlo-1) + q(ihi-2,jlo-1)) else q(ihi+1,jlo-1) = q(ihi+1,jlo-1) + half * $ (2*q(ihi,jlo-1) - q(ihi-1,jlo-1)) end if if (jhi-2 .ge. js) then q(ihi+1,jhi+1) = half * $ (3*q(ihi+1,jhi) - 3*q(ihi+1,jhi-1) + q(ihi+1,jhi-2)) else q(ihi+1,jhi+1) = half * (2*q(ihi+1,jhi) - q(ihi+1,jhi-1)) end if if (ihi-2 .ge. is) then q(ihi+1,jhi+1) = q(ihi+1,jhi+1) + half * $ (3*q(ihi,jhi+1) - 3*q(ihi-1,jhi+1) + q(ihi-2,jhi+1)) else q(ihi+1,jhi+1) = q(ihi+1,jhi+1) + half * $ (2*q(ihi,jhi+1) - q(ihi-1,jhi+1)) end if end ccseapps-2.5/CCSEApps/amrlib/BC_TYPES.H0000644000175000017500000001077611634153073020521 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BC_TYPES_H_ #define _BC_TYPES_H_ #if 0 --------------------------------------------------------------------- CONVERSIONS FROM PHYSICAL TO MATHEMATICAL BCs PHYS BC | Velocity | Temperature | Scalars | --------------------------------------------------------------------- INTERIOR | | | | or | INT_DIR | INT_DIR | INT_DIR | PERIODIC | | | | --------------------------------------------------------------------- | | | | INFLOW | EXT_DIR | EXT_DIR | EXT_DIR | | | | | --------------------------------------------------------------------- | | | | OUTFLOW | FOEXTRAP | FOEXTRAP | FOEXTRAP | | | | | --------------------------------------------------------------------- NO SLIP WALL | | | | with | EXT_DIR | REFLECT_EVEN | HOEXTRAP | ADIABATIC TEMP | U = V = 0 | dT/dn = 0 | | --------------------------------------------------------------------- NO SLIP WALL | | | | with | EXT_DIR | EXT_DIR | HOEXTRAP | FIXED TEMP | U = V = 0 | | | --------------------------------------------------------------------- SLIP WALL | | | | with | Un=0 EXT_DIR | REFLECT_EVEN | HOEXTRAP | ADIABATIC TEMP | Ut HOEXTRAP | dT/dn = 0 | | --------------------------------------------------------------------- SLIP WALL | | | | with | Un=0 EXT_DIR | EXT_DIR | HOEXTRAP | FIXED TEMP | Ut HOEXTRAP | | | --------------------------------------------------------------------- | | | | SYMMETRY | Un REFLECT_ODD | REFLECT_EVEN | REFLECT_EVEN | | Ut REFLECT_EVEN| | | --------------------------------------------------------------------- INT_DIR : data taken from other grids or interpolated EXT_DIR : data specified on EDGE (FACE) of bndry HOEXTRAP : higher order extrapolation to EDGE of bndry FOEXTRAP : first order extrapolation from last cell in interior REFLECT_EVEN : F(-n) = F(n) true reflection from interior cells REFLECT_ODD : F(-n) = -F(n) true reflection from interior cells #endif #ifndef BL_LANG_FORT enum physicalBndryTypes {Interior,Inflow,Outflow,Symmetry, SlipWall,NoSlipWall}; #endif #define BOGUS_BC -666 #define REFLECT_ODD -1 #define INT_DIR 0 #define REFLECT_EVEN 1 #define FOEXTRAP 2 #define EXT_DIR 3 #define HOEXTRAP 4 #define Interior 0 #define Inflow 1 #define Outflow 2 #define Symmetry 3 #define SlipWall 4 #define NoSlipWall 5 #endif ccseapps-2.5/CCSEApps/amrlib/FILCC_3D.F0000644000175000017500000014240511634153073020410 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: FILCC_3D.F,v 1.8 2002/07/31 22:32:02 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "ArrayLim.H" #define SDIM 3 c ::: ----------------------------------------------------------- c ::: This routine is intended to be a generic fill function c ::: for cell centered data. It knows how to exrapolate, c ::: and reflect data and can be used to suppliment problem c ::: specific fill functions (ie. EXT_DIR). c ::: c ::: INPUTS/OUTPUTS: c ::: q <= array to fill c ::: DIMS(q) => index extent of q array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of q array c ::: bc => array of boundary flags bc(SPACEDIM,lo:hi) c ::: c ::: NOTE: corner data not used in computing soln but must have c ::: reasonable values for arithmetic to live c ::: ----------------------------------------------------------- subroutine filcc(q,DIMS(q),domlo,domhi,dx,xlo,bc) integer DIMDEC(q) integer domlo(SDIM), domhi(SDIM) REAL_T xlo(SDIM), dx(SDIM) REAL_T q(DIMV(q)) integer bc(SDIM,2) integer nlft, nrgt, nbot, ntop, nup, ndwn integer ilo, ihi, jlo, jhi, klo, khi integer is, ie, js, je, ks, ke integer i, j, k is = max(ARG_L1(q),domlo(1)) ie = min(ARG_H1(q),domhi(1)) js = max(ARG_L2(q),domlo(2)) je = min(ARG_H2(q),domhi(2)) ks = max(ARG_L3(q),domlo(3)) ke = min(ARG_H3(q),domhi(3)) nlft = max(0,domlo(1)-ARG_L1(q)) nrgt = max(0,ARG_H1(q)-domhi(1)) nbot = max(0,domlo(2)-ARG_L2(q)) ntop = max(0,ARG_H2(q)-domhi(2)) ndwn = max(0,domlo(3)-ARG_L3(q)) nup = max(0,ARG_H3(q)-domhi(3)) c c ::::: first fill sides c if (nlft .gt. 0) then ilo = domlo(1) if (bc(1,1) .eq. FOEXTRAP) then do i = 1, nlft do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ilo-i,j,k) = q(ilo,j,k) end do end do end do else if (bc(1,1) .eq. HOEXTRAP) then do i = 2, nlft do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ilo-i,j,k) = q(ilo,j,k) end do end do end do if (ilo+2 .le. ie) then do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,k) = (15*q(ilo,j,k) - 10*q(ilo+1,j,k) + $ 3*q(ilo+2,j,k)) * eighth end do end do else do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,k) = half*(3*q(ilo,j,k) - q(ilo+1,j,k)) end do end do end if else if (bc(1,1) .eq. REFLECT_EVEN) then do i = 1, nlft do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ilo-i,j,k) = q(ilo+i-1,j,k) end do end do end do else if (bc(1,1) .eq. REFLECT_ODD) then do i = 1, nlft do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ilo-i,j,k) = -q(ilo+i-1,j,k) end do end do end do end if end if if (nrgt .gt. 0) then ihi = domhi(1) if (bc(1,2) .eq. FOEXTRAP) then do i = 1, nrgt do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ihi+i,j,k) = q(ihi,j,k) end do end do end do else if (bc(1,2) .eq. HOEXTRAP) then do i = 2, nrgt do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ihi+i,j,k) = q(ihi,j,k) end do end do end do if (ihi-2 .ge. is) then do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,k) = (15*q(ihi,j,k) - 10*q(ihi-1,j,k) + $ 3*q(ihi-2,j,k)) * eighth end do end do else do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,k) = half*(3*q(ihi,j,k) - q(ihi-1,j,k)) end do end do end if else if (bc(1,2) .eq. REFLECT_EVEN) then do i = 1, nrgt do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ihi+i,j,k) = q(ihi-i+1,j,k) end do end do end do else if (bc(1,2) .eq. REFLECT_ODD) then do i = 1, nrgt do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ihi+i,j,k) = -q(ihi-i+1,j,k) end do end do end do end if end if if (nbot .gt. 0) then jlo = domlo(2) if (bc(2,1) .eq. FOEXTRAP) then do j = 1, nbot do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jlo-j,k) = q(i,jlo,k) end do end do end do else if (bc(2,1) .eq. HOEXTRAP) then do j = 2, nbot do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jlo-j,k) = q(i,jlo,k) end do end do end do if (jlo+2 .le. je) then do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,k) = (15*q(i,jlo,k) - 10*q(i,jlo+1,k) + $ 3*q(i,jlo+2,k)) * eighth end do end do else do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,k) = half*(3*q(i,jlo,k) - q(i,jlo+1,k)) end do end do end if else if (bc(2,1) .eq. REFLECT_EVEN) then do j = 1, nbot do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jlo-j,k) = q(i,jlo+j-1,k) end do end do end do else if (bc(2,1) .eq. REFLECT_ODD) then do j = 1, nbot do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jlo-j,k) = -q(i,jlo+j-1,k) end do end do end do end if end if if (ntop .gt. 0) then jhi = domhi(2) if (bc(2,2) .eq. FOEXTRAP) then do j = 1, ntop do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jhi+j,k) = q(i,jhi,k) end do end do end do else if (bc(2,2) .eq. HOEXTRAP) then do j = 2, ntop do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jhi+j,k) = q(i,jhi,k) end do end do end do if (jhi-2 .ge. js) then do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,k) = (15*q(i,jhi,k) - 10*q(i,jhi-1,k) + $ 3*q(i,jhi-2,k)) * eighth end do end do else do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,k) = half*(3*q(i,jhi,k) - q(i,jhi-1,k)) end do end do end if else if (bc(2,2) .eq. REFLECT_EVEN) then do j = 1, ntop do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jhi+j,k) = q(i,jhi-j+1,k) end do end do end do else if (bc(2,2) .eq. REFLECT_ODD) then do j = 1, ntop do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jhi+j,k) = -q(i,jhi-j+1,k) end do end do end do end if end if if (ndwn .gt. 0) then klo = domlo(3) if (bc(3,1) .eq. FOEXTRAP) then do k = 1, ndwn do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,klo-k) = q(i,j,klo) end do end do end do else if (bc(3,1) .eq. HOEXTRAP) then do k = 2, ndwn do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,klo-k) = q(i,j,klo) end do end do end do if (klo+2 .le. ke) then do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,klo-1) = (15*q(i,j,klo) - 10*q(i,j,klo+1) + $ 3*q(i,j,klo+2)) * eighth end do end do else do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,klo-1) = half*(3*q(i,j,klo) - q(i,j,klo+1)) end do end do end if else if (bc(3,1) .eq. REFLECT_EVEN) then do k = 1, ndwn do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,klo-k) = q(i,j,klo+k-1) end do end do end do else if (bc(3,1) .eq. REFLECT_ODD) then do k = 1, ndwn do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,klo-k) = -q(i,j,klo+k-1) end do end do end do end if end if if (nup .gt. 0) then khi = domhi(3) if (bc(3,2) .eq. FOEXTRAP) then do k = 1, nup do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,khi+k) = q(i,j,khi) end do end do end do else if (bc(3,2) .eq. HOEXTRAP) then do k = 2, nup do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,khi+k) = q(i,j,khi) end do end do end do if (khi-2 .ge. ks) then do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,khi+1) = (15*q(i,j,khi) - 10*q(i,j,khi-1) + $ 3*q(i,j,khi-2)) * eighth end do end do else do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,khi+1) = half*(3*q(i,j,khi) - q(i,j,khi-1)) end do end do end if else if (bc(3,2) .eq. REFLECT_EVEN) then do k = 1, nup do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,khi+k) = q(i,j,khi-k+1) end do end do end do else if (bc(3,2) .eq. REFLECT_ODD) then do k = 1, nup do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,khi+k) = -q(i,j,khi-k+1) end do end do end do end if end if c c First correct the i-j edges and all corners c if ((nlft .gt. 0 .and. bc(1,1) .eq. HOEXTRAP) .and. $ (nbot .gt. 0 .and. bc(2,1) .eq. HOEXTRAP) ) then if (jlo+2 .le. je) then do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jlo-1,k) = half * eighth * $ (15*q(ilo-1,jlo,k) - 10*q(ilo-1,jlo+1,k) + $ 3*q(ilo-1,jlo+2,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jlo-1,k) = half * half * $ (3*q(ilo-1,jlo,k) - q(ilo-1,jlo+1,k)) end do end if if (ilo+2 .le. ie) then do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jlo-1,k) = q(ilo-1,jlo-1,k) + half * eighth * $ (15*q(ilo,jlo-1,k) - 10*q(ilo+1,jlo-1,k) + $ 3*q(ilo+2,jlo-1,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jlo-1,k) = q(ilo-1,jlo-1,k) + half * half * $ (3*q(ilo,jlo-1,k) - q(ilo+1,jlo-1,k)) end do end if if (ndwn .gt. 0 .and. bc(3,1) .eq. HOEXTRAP) then if (klo+2 .le. ke) then q(ilo-1,jlo-1,klo-1) = eighth * ( $ (15*q(ilo-1,jlo-1,klo) - 10*q(ilo-1,jlo-1,klo+1) + $ 3*q(ilo-1,jlo-1,klo+2)) ) else q(ilo-1,jlo-1,klo-1) = half * $ (3*q(ilo-1,jlo-1,klo) - q(ilo-1,jlo-1,klo+1)) end if end if if (nup .gt. 0 .and. bc(3,2) .eq. HOEXTRAP) then if (khi-2 .ge. ks) then q(ilo-1,jlo-1,khi+1) = eighth * ( $ (15*q(ilo-1,jlo-1,khi) - 10*q(ilo-1,jlo-1,khi-1) + $ 3*q(ilo-1,jlo-1,khi-2)) ) else q(ilo-1,jlo-1,khi+1) = half * $ (3*q(ilo-1,jlo-1,khi) - q(ilo-1,jlo-1,khi-1)) end if end if end if c c **************************************************************************** c if ((nlft .gt. 0 .and. bc(1,1) .eq. HOEXTRAP) .and. $ (ntop .gt. 0 .and. bc(2,2) .eq. HOEXTRAP) ) then if (jhi-2 .ge. js) then do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jhi+1,k) = half * eighth * $ (15*q(ilo-1,jhi,k) - 10*q(ilo-1,jhi-1,k) + $ 3*q(ilo-1,jhi-2,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jhi+1,k) = half * half * $ (3*q(ilo-1,jhi,k) - q(ilo-1,jhi-1,k)) end do end if if (ilo+2 .le. ie) then do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jhi+1,k) = q(ilo-1,jhi+1,k) + half * eighth * $ (15*q(ilo,jhi+1,k) - 10*q(ilo+1,jhi+1,k) + $ 3*q(ilo+2,jhi+1,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jhi+1,k) = q(ilo-1,jhi+1,k) + half * half * $ (3*q(ilo,jhi+1,k) - q(ilo+1,jhi+1,k)) end do end if if (ndwn .gt. 0 .and. bc(3,1) .eq. HOEXTRAP) then if (klo+2 .le. ke) then q(ilo-1,jhi+1,klo-1) = eighth * ( $ (15*q(ilo-1,jhi+1,klo) - 10*q(ilo-1,jhi+1,klo+1) + $ 3*q(ilo-1,jhi+1,klo+2)) ) else q(ilo-1,jhi+1,klo-1) = half * $ (3*q(ilo-1,jhi+1,klo) - q(ilo-1,jhi+1,klo+1)) end if end if if (nup .gt. 0 .and. bc(3,2) .eq. HOEXTRAP) then if (khi-2 .ge. ks) then q(ilo-1,jhi+1,khi+1) = eighth * ( $ (15*q(ilo-1,jhi+1,khi) - 10*q(ilo-1,jhi+1,khi-1) + $ 3*q(ilo-1,jhi+1,khi-2)) ) else q(ilo-1,jhi+1,khi+1) = half * $ (3*q(ilo-1,jhi+1,khi) - q(ilo-1,jhi+1,khi-1)) end if end if end if c c **************************************************************************** c if ((nrgt .gt. 0 .and. bc(1,2) .eq. HOEXTRAP) .and. $ (nbot .gt. 0 .and. bc(2,1) .eq. HOEXTRAP) ) then if (jlo+2 .le. je) then do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jlo-1,k) = half * eighth * $ (15*q(ihi+1,jlo,k) - 10*q(ihi+1,jlo+1,k) + $ 3*q(ihi+1,jlo+2,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jlo-1,k) = half * half * $ (3*q(ihi+1,jlo,k) - q(ihi+1,jlo+1,k)) end do end if if (ihi-2 .ge. is) then do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jlo-1,k) = q(ihi+1,jlo-1,k) + half * eighth * $ (15*q(ihi,jlo-1,k) - 10*q(ihi-1,jlo-1,k) + $ 3*q(ihi-2,jlo-1,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jlo-1,k) = q(ihi+1,jlo-1,k) + half * half * $ (3*q(ihi,jlo-1,k) - q(ihi-1,jlo-1,k)) end do end if if (ndwn .gt. 0 .and. bc(3,1) .eq. HOEXTRAP) then if (klo+2 .le. ke) then q(ihi+1,jlo-1,klo-1) = eighth * $ (15*q(ihi+1,jlo-1,klo) - 10*q(ihi+1,jlo-1,klo+1) + $ 3*q(ihi+1,jlo-1,klo+2)) else q(ihi+1,jlo-1,klo-1) = half * $ (3*q(ihi+1,jlo-1,klo) - q(ihi+1,jlo-1,klo+1)) end if end if if (nup .gt. 0 .and. bc(3,2) .eq. HOEXTRAP) then if (khi-2 .ge. ks) then q(ihi+1,jlo-1,khi+1) = eighth * $ (15*q(ihi+1,jlo-1,khi) - 10*q(ihi+1,jlo-1,khi-1) + $ 3*q(ihi+1,jlo-1,khi-2)) else q(ihi+1,jlo-1,khi+1) = half * $ (3*q(ihi+1,jlo-1,khi) - q(ihi+1,jlo-1,khi-1)) end if end if end if c c **************************************************************************** c if ((nrgt .gt. 0 .and. bc(1,2) .eq. HOEXTRAP) .and. $ (ntop .gt. 0 .and. bc(2,2) .eq. HOEXTRAP) ) then if (jhi-2 .ge. js) then do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jhi+1,k) = half * eighth * $ (15*q(ihi+1,jhi,k) - 10*q(ihi+1,jhi-1,k) + $ 3*q(ihi+1,jhi-2,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jhi+1,k) = half * half * $ (3*q(ihi+1,jhi,k) - q(ihi+1,jhi-1,k)) end do end if if (ihi-2 .ge. is) then do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jhi+1,k) = q(ihi+1,jhi+1,k) + half * eighth * $ (15*q(ihi,jhi+1,k) - 10*q(ihi-1,jhi+1,k) + $ 3*q(ihi-2,jhi+1,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jhi+1,k) = q(ihi+1,jhi+1,k) + half * half * $ (3*q(ihi,jhi+1,k) - q(ihi-1,jhi+1,k)) end do end if if (ndwn .gt. 0 .and. bc(3,1) .eq. HOEXTRAP) then if (klo+2 .le. ke) then q(ihi+1,jhi+1,klo-1) = eighth * $ (15*q(ihi+1,jhi+1,klo) - 10*q(ihi+1,jhi+1,klo+1) + $ 3*q(ihi+1,jhi+1,klo+2)) else q(ihi+1,jhi+1,klo-1) = half * $ (3*q(ihi+1,jhi+1,klo) - q(ihi+1,jhi+1,klo+1)) end if end if if (nup .gt. 0 .and. bc(3,2) .eq. HOEXTRAP) then if (khi-2 .ge. ks) then q(ihi+1,jhi+1,khi+1) = eighth * $ (15*q(ihi+1,jhi+1,khi) - 10*q(ihi+1,jhi+1,khi-1) + $ 3*q(ihi+1,jhi+1,khi-2)) else q(ihi+1,jhi+1,khi+1) = half * $ (3*q(ihi+1,jhi+1,khi) - q(ihi+1,jhi+1,khi-1)) end if end if end if c c Next correct the i-k edges c if ((nlft .gt. 0 .and. bc(1,1) .eq. HOEXTRAP) .and. $ (ndwn .gt. 0 .and. bc(3,1) .eq. HOEXTRAP) ) then if (klo+2 .le. ke) then do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,klo-1) = half * eighth * $ (15*q(ilo-1,j,klo) - 10*q(ilo-1,j,klo+1) + $ 3*q(ilo-1,j,klo+2)) end do else do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,klo-1) = half * half * $ (3*q(ilo-1,j,klo) - q(ilo-1,j,klo+1)) end do end if if (ilo+2 .le. ie) then do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,klo-1) = q(ilo-1,j,klo-1) + half * eighth * $ (15*q(ilo,j,klo-1) - 10*q(ilo+1,j,klo-1) + $ 3*q(ilo+2,j,klo-1)) end do else do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,klo-1) = q(ilo-1,j,klo-1) + half * half * $ (3*q(ilo,j,klo-1) - q(ilo+1,j,klo-1)) end do end if end if c c **************************************************************************** c if ((nlft .gt. 0 .and. bc(1,1) .eq. HOEXTRAP) .and. $ (nup .gt. 0 .and. bc(3,2) .eq. HOEXTRAP) ) then if (khi-2 .ge. ks) then do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,khi+1) = half * eighth * $ (15*q(ilo-1,j,khi) - 10*q(ilo-1,j,khi-1) + $ 3*q(ilo-1,j,khi-2)) end do else do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,khi+1) = half * half * $ (3*q(ilo-1,j,khi) - q(ilo-1,j,khi-1)) end do end if if (ilo+2 .le. ie) then do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,khi+1) = q(ilo-1,j,khi+1) + half * eighth * $ (15*q(ilo,j,khi+1) - 10*q(ilo+1,j,khi+1) + $ 3*q(ilo+2,j,khi+1)) end do else do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,khi+1) = q(ilo-1,j,khi+1) + half * half * $ (3*q(ilo,j,khi+1) - q(ilo+1,j,khi+1)) end do end if end if c c **************************************************************************** c if ((nrgt .gt. 0 .and. bc(1,2) .eq. HOEXTRAP) .and. $ (ndwn .gt. 0 .and. bc(3,1) .eq. HOEXTRAP) ) then if (klo+2 .le. ke) then do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,klo-1) = half * eighth * $ (15*q(ihi+1,j,klo) - 10*q(ihi+1,j,klo+1) + $ 3*q(ihi+1,j,klo+2)) end do else do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,klo-1) = half * half * $ (3*q(ihi+1,j,klo) - q(ihi+1,j,klo+1)) end do end if if (ihi-2 .ge. is) then do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,klo-1) = q(ihi+1,j,klo-1) + half * eighth * $ (15*q(ihi,j,klo-1) - 10*q(ihi-1,j,klo-1) + $ 3*q(ihi-2,j,klo-1)) end do else do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,klo-1) = q(ihi+1,j,klo-1) + half * half * $ (3*q(ihi,j,klo-1) - q(ihi-1,j,klo-1)) end do end if end if c c **************************************************************************** c if ((nrgt .gt. 0 .and. bc(1,2) .eq. HOEXTRAP) .and. $ (nup .gt. 0 .and. bc(3,2) .eq. HOEXTRAP) ) then if (khi-2 .ge. ks) then do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,khi+1) = half * eighth * $ (15*q(ihi+1,j,khi) - 10*q(ihi+1,j,khi-1) + $ 3*q(ihi+1,j,khi-2)) end do else do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,khi+1) = half * half * $ (3*q(ihi+1,j,khi) - q(ihi+1,j,khi-1)) end do end if if (ihi-2 .ge. is) then do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,khi+1) = q(ihi+1,j,khi+1) + half * eighth * $ (15*q(ihi,j,khi+1) - 10*q(ihi-1,j,khi+1) + $ 3*q(ihi-2,j,khi+1)) end do else do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,khi+1) = q(ihi+1,j,khi+1) + half * half * $ (3*q(ihi,j,khi+1) - q(ihi-1,j,khi+1)) end do end if end if c c Next correct the j-k edges c if ((nbot .gt. 0 .and. bc(2,1) .eq. HOEXTRAP) .and. $ (ndwn .gt. 0 .and. bc(3,1) .eq. HOEXTRAP) ) then if (klo+2 .le. ke) then do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,klo-1) = half * eighth * $ (15*q(i,jlo-1,klo) - 10*q(i,jlo-1,klo+1) + $ 3*q(i,jlo-1,klo+2)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,klo-1) = half * half * $ (3*q(i,jlo-1,klo) - q(i,jlo-1,klo+1)) end do end if if (jlo+2 .le. je) then do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,klo-1) = q(i,jlo-1,klo-1) + half * eighth * $ (15*q(i,jlo,klo-1) - 10*q(i,jlo+1,klo-1) + $ 3*q(i,jlo+2,klo-1)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,klo-1) = q(i,jlo-1,klo-1) + half * half * $ (3*q(i,jlo,klo-1) - q(i,jlo+1,klo-1)) end do end if end if c c **************************************************************************** c if ((nbot .gt. 0 .and. bc(2,1) .eq. HOEXTRAP) .and. $ (nup .gt. 0 .and. bc(3,2) .eq. HOEXTRAP) ) then if (khi-2 .ge. ks) then do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,khi+1) = half * eighth * $ (15*q(i,jlo-1,khi) - 10*q(i,jlo-1,khi-1) + $ 3*q(i,jlo-1,khi-2)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,khi+1) = half * half * $ (3*q(i,jlo-1,khi) - q(i,jlo-1,khi-1)) end do end if if (jlo+2 .le. je) then do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,khi+1) = q(i,jlo-1,khi+1) + half * eighth * $ (15*q(i,jlo,khi+1) - 10*q(i,jlo+1,khi+1) + $ 3*q(i,jlo+2,khi+1)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,khi+1) = q(i,jlo-1,khi+1) + half * half * $ (3*q(i,jlo,khi+1) - q(i,jlo+1,khi+1)) end do end if end if c c **************************************************************************** c if ((ntop .gt. 0 .and. bc(2,2) .eq. HOEXTRAP) .and. $ (ndwn .gt. 0 .and. bc(3,1) .eq. HOEXTRAP) ) then if (klo+2 .le. ke) then do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,klo-1) = half * eighth * $ (15*q(i,jhi+1,klo) - 10*q(i,jhi+1,klo+1) + $ 3*q(i,jhi+1,klo+2)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,klo-1) = half * half * $ (3*q(i,jhi+1,klo) - q(i,jhi+1,klo+1)) end do end if if (jhi-2 .ge. js) then do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,klo-1) = q(i,jhi+1,klo-1) + half * eighth * $ (15*q(i,jhi,klo-1) - 10*q(i,jhi-1,klo-1) + $ 3*q(i,jhi-2,klo-1)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,klo-1) = q(i,jhi+1,klo-1) + half * half * $ (3*q(i,jhi,klo-1) - q(i,jhi-1,klo-1)) end do end if end if c c **************************************************************************** c if ((ntop .gt. 0 .and. bc(2,2) .eq. HOEXTRAP) .and. $ (nup .gt. 0 .and. bc(3,2) .eq. HOEXTRAP) ) then if (khi-2 .ge. ks) then do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,khi+1) = half * eighth * $ (15*q(i,jhi+1,khi) - 10*q(i,jhi+1,khi-1) + $ 3*q(i,jhi+1,khi-2)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,khi+1) = half * half * $ (3*q(i,jhi+1,khi) - q(i,jhi+1,khi-1)) end do end if if (jhi-2 .ge. js) then do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,khi+1) = q(i,jhi+1,khi+1) + half * eighth * $ (15*q(i,jhi,khi+1) - 10*q(i,jhi-1,khi+1) + $ 3*q(i,jhi-2,khi+1)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,khi+1) = q(i,jhi+1,khi+1) + half * half * $ (3*q(i,jhi,khi+1) - q(i,jhi-1,khi+1)) end do end if end if end subroutine hoextraptocc(q,DIMS(q),domlo,domhi,dx,xlo) integer DIMDEC(q) integer domlo(SDIM), domhi(SDIM) REAL_T xlo(SDIM), dx(SDIM) REAL_T q(DIMV(q)) integer nlft, nrgt, nbot, ntop, nup, ndwn integer ilo, ihi, jlo, jhi, klo, khi integer is, ie, js, je, ks, ke integer i, j, k is = max(ARG_L1(q),domlo(1)) ie = min(ARG_H1(q),domhi(1)) js = max(ARG_L2(q),domlo(2)) je = min(ARG_H2(q),domhi(2)) ks = max(ARG_L3(q),domlo(3)) ke = min(ARG_H3(q),domhi(3)) nlft = max(0,domlo(1)-ARG_L1(q)) nrgt = max(0,ARG_H1(q)-domhi(1)) nbot = max(0,domlo(2)-ARG_L2(q)) ntop = max(0,ARG_H2(q)-domhi(2)) ndwn = max(0,domlo(3)-ARG_L3(q)) nup = max(0,ARG_H3(q)-domhi(3)) c c First fill sides. c if (nlft .gt. 0) then ilo = domlo(1) do i = 2, nlft do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ilo-i,j,k) = q(ilo,j,k) end do end do end do if (ilo+2 .le. ie) then do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,k) = 3*q(ilo,j,k) - 3*q(ilo+1,j,k) + $ q(ilo+2,j,k) end do end do else do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,k) = 2*q(ilo,j,k) - q(ilo+1,j,k) end do end do end if end if if (nrgt .gt. 0) then ihi = domhi(1) do i = 2, nrgt do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ihi+i,j,k) = q(ihi,j,k) end do end do end do if (ihi-2 .ge. is) then do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,k) = 3*q(ihi,j,k) - 3*q(ihi-1,j,k) + $ q(ihi-2,j,k) end do end do else do k = ARG_L3(q),ARG_H3(q) do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,k) = 2*q(ihi,j,k) - q(ihi-1,j,k) end do end do end if end if if (nbot .gt. 0) then jlo = domlo(2) do j = 2, nbot do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jlo-j,k) = q(i,jlo,k) end do end do end do if (jlo+2 .le. je) then do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,k) = 3*q(i,jlo,k) - 3*q(i,jlo+1,k) + $ q(i,jlo+2,k) end do end do else do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,k) = 2*q(i,jlo,k) - q(i,jlo+1,k) end do end do end if end if if (ntop .gt. 0) then jhi = domhi(2) do j = 2, ntop do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jhi+j,k) = q(i,jhi,k) end do end do end do if (jhi-2 .ge. js) then do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,k) = 3*q(i,jhi,k) - 3*q(i,jhi-1,k) + $ q(i,jhi-2,k) end do end do else do k = ARG_L3(q),ARG_H3(q) do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,k) = 2*q(i,jhi,k) - q(i,jhi-1,k) end do end do end if end if if (ndwn .gt. 0) then klo = domlo(3) do k = 2, ndwn do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,klo-k) = q(i,j,klo) end do end do end do if (klo+2 .le. ke) then do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,klo-1) = 3*q(i,j,klo) - 3*q(i,j,klo+1) + $ q(i,j,klo+2) end do end do else do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,klo-1) = 2*q(i,j,klo) - q(i,j,klo+1) end do end do end if end if if (nup .gt. 0) then khi = domhi(3) do k = 2, nup do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,khi+k) = q(i,j,khi) end do end do end do if (khi-2 .ge. ks) then do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,khi+1) = 3*q(i,j,khi) - 3*q(i,j,khi-1) + $ q(i,j,khi-2) end do end do else do j = ARG_L2(q),ARG_H2(q) do i = ARG_L1(q),ARG_H1(q) q(i,j,khi+1) = 2*q(i,j,khi) - q(i,j,khi-1) end do end do end if end if c c First correct the i-j edges and all corners c if ((nlft .gt. 0) .and. (nbot .gt. 0)) then if (jlo+2 .le. je) then do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jlo-1,k) = half * $ (3*q(ilo-1,jlo,k) - 3*q(ilo-1,jlo+1,k) + $ q(ilo-1,jlo+2,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jlo-1,k) = half * $ (2*q(ilo-1,jlo,k) - q(ilo-1,jlo+1,k)) end do end if if (ilo+2 .le. ie) then do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jlo-1,k) = q(ilo-1,jlo-1,k) + half * $ (3*q(ilo,jlo-1,k) - 3*q(ilo+1,jlo-1,k) + $ q(ilo+2,jlo-1,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jlo-1,k) = q(ilo-1,jlo-1,k) + half * $ (2*q(ilo,jlo-1,k) - q(ilo+1,jlo-1,k)) end do end if if (ndwn .gt. 0) then if (klo+2 .le. ke) then q(ilo-1,jlo-1,klo-1) = $ (3*q(ilo-1,jlo-1,klo) - 3*q(ilo-1,jlo-1,klo+1) + $ q(ilo-1,jlo-1,klo+2)) else q(ilo-1,jlo-1,klo-1) = $ (2*q(ilo-1,jlo-1,klo) - q(ilo-1,jlo-1,klo+1)) end if end if if (nup .gt. 0) then if (khi-2 .ge. ks) then q(ilo-1,jlo-1,khi+1) = $ (3*q(ilo-1,jlo-1,khi) - 3*q(ilo-1,jlo-1,khi-1) + $ q(ilo-1,jlo-1,khi-2)) else q(ilo-1,jlo-1,khi+1) = $ (2*q(ilo-1,jlo-1,khi) - q(ilo-1,jlo-1,khi-1)) end if end if end if c c **************************************************************************** c if ((nlft .gt. 0) .and. (ntop .gt. 0)) then if (jhi-2 .ge. js) then do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jhi+1,k) = half * $ (3*q(ilo-1,jhi,k) - 3*q(ilo-1,jhi-1,k) + $ q(ilo-1,jhi-2,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jhi+1,k) = half * $ (2*q(ilo-1,jhi,k) - q(ilo-1,jhi-1,k)) end do end if if (ilo+2 .le. ie) then do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jhi+1,k) = q(ilo-1,jhi+1,k) + half * $ (3*q(ilo,jhi+1,k) - 3*q(ilo+1,jhi+1,k) + $ q(ilo+2,jhi+1,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ilo-1,jhi+1,k) = q(ilo-1,jhi+1,k) + half * $ (2*q(ilo,jhi+1,k) - q(ilo+1,jhi+1,k)) end do end if if (ndwn .gt. 0) then if (klo+2 .le. ke) then q(ilo-1,jhi+1,klo-1) = $ (3*q(ilo-1,jhi+1,klo) - 3*q(ilo-1,jhi+1,klo+1) + $ q(ilo-1,jhi+1,klo+2)) else q(ilo-1,jhi+1,klo-1) = $ (2*q(ilo-1,jhi+1,klo) - q(ilo-1,jhi+1,klo+1)) end if end if if (nup .gt. 0) then if (khi-2 .ge. ks) then q(ilo-1,jhi+1,khi+1) = $ (3*q(ilo-1,jhi+1,khi) - 3*q(ilo-1,jhi+1,khi-1) + $ q(ilo-1,jhi+1,khi-2)) else q(ilo-1,jhi+1,khi+1) = $ (2*q(ilo-1,jhi+1,khi) - q(ilo-1,jhi+1,khi-1)) end if end if end if c c **************************************************************************** c if ((nrgt .gt. 0) .and. (nbot .gt. 0)) then if (jlo+2 .le. je) then do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jlo-1,k) = half * $ (3*q(ihi+1,jlo,k) - 3*q(ihi+1,jlo+1,k) + $ q(ihi+1,jlo+2,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jlo-1,k) = half * $ (2*q(ihi+1,jlo,k) - q(ihi+1,jlo+1,k)) end do end if if (ihi-2 .ge. is) then do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jlo-1,k) = q(ihi+1,jlo-1,k) + half * $ (3*q(ihi,jlo-1,k) - 3*q(ihi-1,jlo-1,k) + $ q(ihi-2,jlo-1,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jlo-1,k) = q(ihi+1,jlo-1,k) + half * $ (2*q(ihi,jlo-1,k) - q(ihi-1,jlo-1,k)) end do end if if (ndwn .gt. 0) then if (klo+2 .le. ke) then q(ihi+1,jlo-1,klo-1) = $ (3*q(ihi+1,jlo-1,klo) - 3*q(ihi+1,jlo-1,klo+1) + $ q(ihi+1,jlo-1,klo+2)) else q(ihi+1,jlo-1,klo-1) = $ (2*q(ihi+1,jlo-1,klo) - q(ihi+1,jlo-1,klo+1)) end if end if if (nup .gt. 0) then if (khi-2 .ge. ks) then q(ihi+1,jlo-1,khi+1) = $ (3*q(ihi+1,jlo-1,khi) - 3*q(ihi+1,jlo-1,khi-1) + $ q(ihi+1,jlo-1,khi-2)) else q(ihi+1,jlo-1,khi+1) = $ (2*q(ihi+1,jlo-1,khi) - q(ihi+1,jlo-1,khi-1)) end if end if end if c c **************************************************************************** c if ((nrgt .gt. 0) .and. (ntop .gt. 0)) then if (jhi-2 .ge. js) then do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jhi+1,k) = half * $ (3*q(ihi+1,jhi,k) - 3*q(ihi+1,jhi-1,k) + $ q(ihi+1,jhi-2,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jhi+1,k) = half * $ (2*q(ihi+1,jhi,k) - q(ihi+1,jhi-1,k)) end do end if if (ihi-2 .ge. is) then do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jhi+1,k) = q(ihi+1,jhi+1,k) + half * $ (3*q(ihi,jhi+1,k) - 3*q(ihi-1,jhi+1,k) + $ q(ihi-2,jhi+1,k)) end do else do k = ARG_L3(q),ARG_H3(q) q(ihi+1,jhi+1,k) = q(ihi+1,jhi+1,k) + half * $ (2*q(ihi,jhi+1,k) - q(ihi-1,jhi+1,k)) end do end if if (ndwn .gt. 0) then if (klo+2 .le. ke) then q(ihi+1,jhi+1,klo-1) = $ (3*q(ihi+1,jhi+1,klo) - 3*q(ihi+1,jhi+1,klo+1) + $ q(ihi+1,jhi+1,klo+2)) else q(ihi+1,jhi+1,klo-1) = $ (2*q(ihi+1,jhi+1,klo) - q(ihi+1,jhi+1,klo+1)) end if end if if (nup .gt. 0) then if (khi-2 .ge. ks) then q(ihi+1,jhi+1,khi+1) = $ (3*q(ihi+1,jhi+1,khi) - 3*q(ihi+1,jhi+1,khi-1) + $ q(ihi+1,jhi+1,khi-2)) else q(ihi+1,jhi+1,khi+1) = $ (2*q(ihi+1,jhi+1,khi) - q(ihi+1,jhi+1,khi-1)) end if end if end if c c Next correct the i-k edges c if ((nlft .gt. 0) .and. (ndwn .gt. 0)) then if (klo+2 .le. ke) then do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,klo-1) = half * $ (3*q(ilo-1,j,klo) - 3*q(ilo-1,j,klo+1) + $ q(ilo-1,j,klo+2)) end do else do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,klo-1) = half * $ (2*q(ilo-1,j,klo) - q(ilo-1,j,klo+1)) end do end if if (ilo+2 .le. ie) then do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,klo-1) = q(ilo-1,j,klo-1) + half * $ (3*q(ilo,j,klo-1) - 3*q(ilo+1,j,klo-1) + $ q(ilo+2,j,klo-1)) end do else do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,klo-1) = q(ilo-1,j,klo-1) + half * $ (2*q(ilo,j,klo-1) - q(ilo+1,j,klo-1)) end do end if end if c c **************************************************************************** c if ((nlft .gt. 0) .and. (nup .gt. 0)) then if (khi-2 .ge. ks) then do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,khi+1) = half * $ (3*q(ilo-1,j,khi) - 3*q(ilo-1,j,khi-1) + $ q(ilo-1,j,khi-2)) end do else do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,khi+1) = half * $ (2*q(ilo-1,j,khi) - q(ilo-1,j,khi-1)) end do end if if (ilo+2 .le. ie) then do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,khi+1) = q(ilo-1,j,khi+1) + half * $ (3*q(ilo,j,khi+1) - 3*q(ilo+1,j,khi+1) + $ q(ilo+2,j,khi+1)) end do else do j = ARG_L2(q),ARG_H2(q) q(ilo-1,j,khi+1) = q(ilo-1,j,khi+1) + half * $ (2*q(ilo,j,khi+1) - q(ilo+1,j,khi+1)) end do end if end if c c **************************************************************************** c if ((nrgt .gt. 0) .and. (ndwn .gt. 0)) then if (klo+2 .le. ke) then do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,klo-1) = half * $ (3*q(ihi+1,j,klo) - 3*q(ihi+1,j,klo+1) + $ q(ihi+1,j,klo+2)) end do else do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,klo-1) = half * $ (2*q(ihi+1,j,klo) - q(ihi+1,j,klo+1)) end do end if if (ihi-2 .ge. is) then do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,klo-1) = q(ihi+1,j,klo-1) + half * $ (3*q(ihi,j,klo-1) - 3*q(ihi-1,j,klo-1) + $ q(ihi-2,j,klo-1)) end do else do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,klo-1) = q(ihi+1,j,klo-1) + half * $ (2*q(ihi,j,klo-1) - q(ihi-1,j,klo-1)) end do end if end if c c **************************************************************************** c if ((nrgt .gt. 0) .and. (nup .gt. 0)) then if (khi-2 .ge. ks) then do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,khi+1) = half * $ (3*q(ihi+1,j,khi) - 3*q(ihi+1,j,khi-1) + $ q(ihi+1,j,khi-2)) end do else do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,khi+1) = half * $ (2*q(ihi+1,j,khi) - q(ihi+1,j,khi-1)) end do end if if (ihi-2 .ge. is) then do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,khi+1) = q(ihi+1,j,khi+1) + half * $ (3*q(ihi,j,khi+1) - 3*q(ihi-1,j,khi+1) + $ q(ihi-2,j,khi+1)) end do else do j = ARG_L2(q),ARG_H2(q) q(ihi+1,j,khi+1) = q(ihi+1,j,khi+1) + half * $ (2*q(ihi,j,khi+1) - q(ihi-1,j,khi+1)) end do end if end if c c Next correct the j-k edges c if ((nbot .gt. 0) .and. (ndwn .gt. 0)) then if (klo+2 .le. ke) then do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,klo-1) = half * $ (3*q(i,jlo-1,klo) - 3*q(i,jlo-1,klo+1) + $ q(i,jlo-1,klo+2)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,klo-1) = half * $ (2*q(i,jlo-1,klo) - q(i,jlo-1,klo+1)) end do end if if (jlo+2 .le. je) then do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,klo-1) = q(i,jlo-1,klo-1) + half * $ (3*q(i,jlo,klo-1) - 3*q(i,jlo+1,klo-1) + $ q(i,jlo+2,klo-1)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,klo-1) = q(i,jlo-1,klo-1) + half * $ (2*q(i,jlo,klo-1) - q(i,jlo+1,klo-1)) end do end if end if c c **************************************************************************** c if ((nbot .gt. 0) .and. (nup .gt. 0)) then if (khi-2 .ge. ks) then do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,khi+1) = half * $ (3*q(i,jlo-1,khi) - 3*q(i,jlo-1,khi-1) + $ q(i,jlo-1,khi-2)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,khi+1) = half * $ (2*q(i,jlo-1,khi) - q(i,jlo-1,khi-1)) end do end if if (jlo+2 .le. je) then do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,khi+1) = q(i,jlo-1,khi+1) + half * $ (3*q(i,jlo,khi+1) - 3*q(i,jlo+1,khi+1) + $ q(i,jlo+2,khi+1)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jlo-1,khi+1) = q(i,jlo-1,khi+1) + half * $ (2*q(i,jlo,khi+1) - q(i,jlo+1,khi+1)) end do end if end if c c **************************************************************************** c if ((ntop .gt. 0) .and. (ndwn .gt. 0)) then if (klo+2 .le. ke) then do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,klo-1) = half * $ (3*q(i,jhi+1,klo) - 3*q(i,jhi+1,klo+1) + $ q(i,jhi+1,klo+2)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,klo-1) = half * $ (2*q(i,jhi+1,klo) - q(i,jhi+1,klo+1)) end do end if if (jhi-2 .ge. js) then do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,klo-1) = q(i,jhi+1,klo-1) + half * $ (3*q(i,jhi,klo-1) - 3*q(i,jhi-1,klo-1) + $ q(i,jhi-2,klo-1)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,klo-1) = q(i,jhi+1,klo-1) + half * $ (2*q(i,jhi,klo-1) - q(i,jhi-1,klo-1)) end do end if end if c c **************************************************************************** c if ((ntop .gt. 0) .and. (nup .gt. 0)) then if (khi-2 .ge. ks) then do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,khi+1) = half * $ (3*q(i,jhi+1,khi) - 3*q(i,jhi+1,khi-1) + $ q(i,jhi+1,khi-2)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,khi+1) = half * $ (2*q(i,jhi+1,khi) - q(i,jhi+1,khi-1)) end do end if if (jhi-2 .ge. js) then do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,khi+1) = q(i,jhi+1,khi+1) + half * $ (3*q(i,jhi,khi+1) - 3*q(i,jhi-1,khi+1) + $ q(i,jhi-2,khi+1)) end do else do i = ARG_L1(q),ARG_H1(q) q(i,jhi+1,khi+1) = q(i,jhi+1,khi+1) + half * $ (2*q(i,jhi,khi+1) - q(i,jhi-1,khi+1)) end do end if end if end ccseapps-2.5/CCSEApps/amrlib/Amr.H0000644000175000017500000002733711634153073017771 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _Amr_H_ #define _Amr_H_ // // $Id: Amr.H,v 1.30 2001/08/01 21:50:44 lijewski Exp $ // #include #include #include #include #include #include #include class AmrLevel; class LevelBld; // //@Man: //@Memo: Manages hierarchy of levels for time-dependent AMR computations. /*@Doc: The Amr class is designed to manage parts of the computation which do not belong on a single level, like establishing and updating the hierarchy of levels, global timestepping, and managing the different AmrLevels */ class Amr { public: // //@ManDoc: The constructor. // Amr (); // //@ManDoc: The destructor. // ~Amr (); // //@ManDoc: Init data after construction. Must be called before timestepping. // void init (Real strt_time, Real stop_time); // //@ManDoc: Set the timestep on each level. // void setDtLevel (const Array& dt_lev); // //@ManDoc: Set the dtmin on each level. // void setDtMin (const Array& dt_lev); // //@ManDoc: Set the cycle count on each level. // void setNCycle (const Array& mss); // //@ManDoc: Largest allowable grid. // int maxGridSize () const; // //@ManDoc: Subcycle in time? // int subCycle () const; // //@ManDoc: Maximum allowable level. // int maxLevel () const; // //@ManDoc: Finest currently existing level. // int finestLevel () const; // //@ManDoc: Physical time. // Real cumTime () const; // //@ManDoc: Time step at specified level. // Real dtLevel (int level) const; // //@ManDoc: Array of time steps at all levels. // const Array& dtLevel () const; // //@ManDoc: Geometry object. // const Geometry& Geom (int level) const; // //@ManDoc: Number of subcycled time steps. // int nCycle (int level) const; // //@ManDoc: Refinement ratio. // IntVect refRatio (int coarse_level) const; // //@ManDoc: Maximum refinement ratio in any direction. // int MaxRefRatio (int level) const; // //@ManDoc: Refinement ratios between all levels. // const Array& refRatio () const; // //@ManDoc: Number of time steps at specified level. // int levelSteps (int lev) const; // //@ManDoc: Interval between regridding. // int regridInt (int lev) const; // //@ManDoc: Number of time steps between checkpoint files. // int checkInt () const; // //@ManDoc: Time between checkpoint files. // Real checkPer() const; // //@ManDoc: Number of time steps between plot files. // int plotInt () const; // //@ManDoc: Time between plot files. // Real plotPer () const; /*@ManDoc: The names of state variables to output in the plotfile. They can be set using the amr.plot\_vars variable in a ParmParse inputs file. */ static const std::list& statePlotVars (); /*@ManDoc: Is the string the name of a variable in state\_plot\_vars? */ static bool isStatePlotVar (const std::string& name); /*@ManDoc: If the string is not the name of a variable in state\_plot\_vars, add it to state\_plot\_vars. */ static void addStatePlotVar (const std::string& name); /*@ManDoc: Remove the string from state\_plot\_vars. */ static void deleteStatePlotVar (const std::string& name); /*@ManDoc: Clear the list of state\_plot\_vars. */ static void clearStatePlotVarList (); /*@ManDoc: Fill the list of state\_plot\_vars with all of the state quantities. */ static void fillStatePlotVarList (); /*@ManDoc: The names of derived variables to output in the plotfile. They can be set using the amr.derive\_plot\_vars variable in a ParmParse inputs file. */ static const std::list& derivePlotVars (); /*@ManDoc: Is the string the name of a variable in derive\_plot\_vars? */ static bool isDerivePlotVar (const std::string& name); /*@ManDoc: If the string is not the name of a variable in derive\_plot\_vars, add it to derive\_plot\_vars. */ static void addDerivePlotVar (const std::string& name); /*@ManDoc: Remove the string from derive\_plot\_vars. */ static void deleteDerivePlotVar (const std::string& name); /*@ManDoc: Clear the list of derive\_plot\_vars. */ static void clearDerivePlotVarList (); /*@ManDoc: Fill the list of derive\_plot\_vars with all derived quantities. */ static void fillDerivePlotVarList (); // //@ManDoc: Number of buffer cells in error estimator. // int nErrorBuf (int lev) const; // //@ManDoc: Minimum allowable grid efficiency. // Real gridEff () const; // //@ManDoc: Number of cells to define proper nesting // int nProper () const; // //@ManDoc: List of grids at each level. // const BoxArray& boxArray (int lev) const; // //@ManDoc: AmrLevel lev. // AmrLevel& getLevel (int lev); // //@ManDoc: PArray of AmrLevels. // PArray& getAmrLevels (); // //@ManDoc: Total number of cells. // long cellCount (); // //@ManDoc: Number of cells at given level. // long cellCount (int lev); // //@ManDoc: Total number of grids. // int numGrids (); // //@ManDoc: Number of grids at given level. // int numGrids (int lev); // //@ManDoc: More work to be done? // virtual int okToContinue (); // //@ManDoc: Do a complete integration cycle. // void coarseTimeStep (Real stop_time); // //@ManDoc: Retrieve derived data. User is responsible for deleting pointer. // MultiFab* derive (const std::string& name, Real time, int lev, int ngrow); // //@ManDoc: Name of the restart file. // const std::string& theRestartFile () const; // //@ManDoc: The ith datalog file. Do with it what you want. // std::ostream& DataLog (int i); protected: // // Used by grid_places(). // static void ProjPeriodic (BoxDomain& bd, const Geometry& geom); // // Write the plot file to be used for visualization. // void writePlotFile (const std::string& root, int num); // // Initialize grid hierarchy. // void initialInit (Real strt_time, Real stop_time); // // Check for valid input. // void checkInput (); // // Write current state into a chk* file. // void checkPoint (); // // Restart from a checkpoint file. // void restart (const std::string& filename); // // Define and initialize coarsest level. // void defBaseLevel (Real start_time); // // Define and initialize refined levels. // void bldFineLevels (Real start_time); // // Rebuild grid hierarchy finer than lbase. // void regrid (int lbase, Real time, bool initial = false); // // Define new grid locations (called from regrid) and put into new_grids. // void grid_places (int lbase, Real time, int& new_finest, Array& new_grids); // // Do a single timestep on level L. // void timeStep (int level, Real dt, int iter, int ncycle); void printGridInfo (std::ostream& os, int min_lev, int max_lev); void setRecordGridInfo (const std::string&); void setRecordRunInfo (const std::string&); void setRecordDataInfo (int i, const std::string&); // // The data ... // std::string grids_file; // Grids file that will bypass regridding. int max_level; // Maximum allowed level. int finest_level; // Current finest level. Array ref_ratio; // Refinement ratios [0:finest_level-1] PArray amr_level; // Array of levels Array geom; // Index extent of domain at all levels. Real cumtime; // Physical time variable. Array dt_level; // Timestep at this level. Array level_steps; // Number of time steps at this level. Array level_count; Array n_cycle; Array dt_min; bool isPeriodic[BL_SPACEDIM]; // Domain periodic? Array regrid_int; // Interval between regridding. Array n_error_buf; // Buffer cells around each tagged cell. Array blocking_factor; // Blocking factor in grid generation. Real grid_eff; // Grid efficiency. int max_grid_size; // Maximum allowable grid size. int n_proper; // # cells required for proper nesting. int last_checkpoint; // Step number of previous checkpoint. int check_int; // How often checkpoint (# time steps). Real check_per; // How often checkpoint (units of time). std::string check_file_root; // Root name of checkpoint file. int last_plotfile; // Step number of previous plotfile. int plot_int; // How often plotfile (# of time steps) Real plot_per; // How often plotfile (in units of time) std::string plot_file_root; // Root name of plotfile. StationData station; int verbose; int record_grid_info; int record_run_info; std::ofstream gridlog; std::ofstream runlog; PArray datalog; int sub_cycle; std::string restart_file; std::string probin_file; LevelBld* levelbld; // // The static data ... // static std::list state_plot_vars; // State Vars to dump to plotfile static std::list derive_plot_vars; // Derived Vars to dump to plotfile static bool first_plotfile; private: // // Disallowed // Amr (const Amr& rhs); Amr& operator= (const Amr& rhs); }; #endif /*_Amr_H_*/ ccseapps-2.5/CCSEApps/amrlib/StationData.cpp0000644000175000017500000002246711634153073022057 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: StationData.cpp,v 1.15 2001/08/09 22:42:00 marc Exp $ // #include #include #include #include #include #include StationRec::StationRec () { D_TERM(pos[0],=pos[1],=pos[2]) = -1; id = level = grd = -1; own = false; } StationData::~StationData () { m_ofile.close(); } void StationData::init () { // // ParmParse variables: // // StationData.vars -- Names of StateData components to output // StationData.coord -- BL_SPACEDIM array of Reals // StationData.coord -- the next one // StationData.coord -- ditto ... // ParmParse pp("StationData"); if (pp.contains("vars")) { const int N = pp.countval("vars"); m_vars.resize(N); m_IsDerived.resize(N); m_typ.resize(N); m_ncomp.resize(N); for (int i = 0; i < N; i++) { pp.get("vars", m_vars[i], i); m_IsDerived[i] = false; if (!AmrLevel::isStateVariable(m_vars[i],m_typ[i],m_ncomp[i])) { if (AmrLevel::get_derive_lst().canDerive(m_vars[i])) { m_IsDerived[i] = true; m_ncomp[i] = 0; } else { std::cout << "StationData::init(): `" << m_vars[i] << "' is not a state or derived variable\n"; BoxLib::Abort(); } } } } if (m_vars.size() > 0 && pp.contains("coord")) { static int identifier; Array data(BL_SPACEDIM); const int N = pp.countname("coord"); m_stn.resize(N); for (int k = 0; k < N; k++) { pp.getktharr("coord", k, data, 0, BL_SPACEDIM); D_TERM(m_stn[k].pos[0] = data[0];, m_stn[k].pos[1] = data[1];, m_stn[k].pos[2] = data[2];); BL_ASSERT(Geometry::ProbDomain().contains(data.dataPtr())); m_stn[k].id = identifier++; } } if (m_vars.size() > 0) { // // Make "Stations/" directory. // // Only the I/O processor makes the directory if it doesn't exist. // static const std::string Dir("Stations"); if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(Dir, 0755)) BoxLib::CreateDirectoryFailed(Dir); // // Everyone must wait till directory is built. // ParallelDescriptor::Barrier(); // // Open the data file. // char buf[80]; sprintf(buf, "Stations/stn_CPU_%04d", ParallelDescriptor::MyProc()); m_ofile.open(buf, std::ios::out|std::ios::app); m_ofile.precision(30); BL_ASSERT(!m_ofile.bad()); // // Output the list of stations. // std::ofstream os("Stations/Station.List", std::ios::out); for (int i = 0; i < m_stn.size(); i++) { os << m_stn[i].id; for (int k = 0; k < BL_SPACEDIM; k++) { os << '\t' << m_stn[i].pos[k]; } os << '\n'; } } } void StationData::report (Real time, int level, const AmrLevel& amrlevel) { if (m_stn.size() <= 0) return; static Array data; const int N = m_vars.size(); const int MyProc = ParallelDescriptor::MyProc(); data.resize(N); Array mfPtrs(N, 0); int nGhost = 0; for (int iVar = 0; iVar < m_vars.size(); ++iVar) { if (m_IsDerived[iVar]) { mfPtrs[iVar] = const_cast(amrlevel).derive(m_vars[iVar], time, nGhost); } } for (int i = 0; i < m_stn.size(); i++) { if (m_stn[i].own && m_stn[i].level == level) { // // Fill in the `data' vector. // for (int j = 0; j < N; j++) { if(m_IsDerived[j]) { const MultiFab* mf = mfPtrs[j]; BL_ASSERT(mf != NULL); BL_ASSERT(mf->DistributionMap() == amrlevel.get_new_data(0).DistributionMap()); BL_ASSERT(mf->DistributionMap()[m_stn[i].grd] == MyProc); // // Find IntVect so we can index into FAB. // We want to use Geometry::CellIndex(). // Must adjust the position to account for NodeCentered-ness. // IndexType ityp = amrlevel.get_derive_lst().get(m_vars[j])->deriveType(); Real pos[BL_SPACEDIM]; D_TERM(pos[0] = m_stn[i].pos[0] + .5 * ityp[0];, pos[1] = m_stn[i].pos[1] + .5 * ityp[1];, pos[2] = m_stn[i].pos[2] + .5 * ityp[2];); IntVect idx = amrlevel.Geom().CellIndex(&pos[0]); data[j] = (*mf)[m_stn[i].grd](idx,m_ncomp[j]); } else { const MultiFab& mf = amrlevel.get_new_data(m_typ[j]); BL_ASSERT(mf.nComp() > m_ncomp[j]); BL_ASSERT(mf.DistributionMap()[m_stn[i].grd] == MyProc); // // Find IntVect so we can index into FAB. // We want to use Geometry::CellIndex(). // Must adjust the position to account for NodeCentered-ness. // IndexType ityp = amrlevel.get_desc_lst()[m_typ[j]].getType(); Real pos[BL_SPACEDIM]; D_TERM(pos[0] = m_stn[i].pos[0] + .5 * ityp[0];, pos[1] = m_stn[i].pos[1] + .5 * ityp[1];, pos[2] = m_stn[i].pos[2] + .5 * ityp[2];); IntVect idx = amrlevel.Geom().CellIndex(&pos[0]); data[j] = mf[m_stn[i].grd](idx,m_ncomp[j]); } } // // Write data to output stream. // m_ofile << m_stn[i].id << ' ' << time << ' '; for (int k = 0; k < BL_SPACEDIM; k++) { m_ofile << m_stn[i].pos[k] << ' '; } for (int k = 0; k < N; k++) { m_ofile << data[k] << ' '; } m_ofile << '\n'; } } m_ofile.flush(); BL_ASSERT(!m_ofile.bad()); for (int iVarD = 0; iVarD < m_vars.size(); ++iVarD) { if (m_IsDerived[iVarD]) { delete mfPtrs[iVarD]; } } } void StationData::findGrid (const PArray& levels, const Array& geoms) { BL_ASSERT(geoms.size() == levels.size()); if (m_stn.size() <= 0) return; // // Flag all stations as not having a home. // for (int i = 0; i < m_stn.size(); i++) m_stn[i].level = -1; // // Find level and grid owning the data. // const int MyProc = ParallelDescriptor::MyProc(); for (int level = levels.size()-1; level >= 0; level--) { const Array& boxes = levels[level].gridLocations(); MultiFab mf(levels[level].boxArray(),1,0,Fab_noallocate); BL_ASSERT(mf.boxArray().size() == boxes.size()); for (int i = 0; i < m_stn.size(); i++) { if (m_stn[i].level < 0) { for (int j = 0; j < boxes.size(); j++) { if (boxes[j].contains(&m_stn[i].pos[0])) { m_stn[i].grd = j; m_stn[i].own = (mf.DistributionMap()[j] == MyProc); m_stn[i].level = level; break; } } } } } } ccseapps-2.5/CCSEApps/amrlib/ErrorList.cpp0000644000175000017500000000533311634153073021562 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ErrorList.cpp,v 1.10 2001/08/01 21:50:45 lijewski Exp $ // #include #include #include ErrorRec::ErrorRec (const std::string& nm, int ng, ErrorType etyp, ErrorFunc f) : derive_name(nm), ngrow(ng), err_func(f), err_type(etyp) {} const std::string& ErrorRec::name () const { return derive_name; } int ErrorRec::nGrow () const { return ngrow; } ErrorRec::ErrorType ErrorRec::errType () const { return err_type; } ErrorFunc ErrorRec::errFunc () const { return err_func; } int ErrorList::size () const { return vec.size(); } void ErrorList::add (const std::string& name, int nextra, ErrorRec::ErrorType typ, ErrorFunc func) { // // Keep list in order of definition, append(). // vec.push_back(ErrorRec(name, nextra, typ, func)); } const ErrorRec& ErrorList::operator[] (int k) const { BL_ASSERT(k < size()); return vec[k]; } static const char* err_name[] = { "Richardson", "Special" }; std::ostream& operator << (std::ostream& os, const ErrorList& elst) { for (int i = 0; i < elst.size(); i++) { os << elst[i].name() << ' ' << elst[i].nGrow() << ' ' << err_name[elst[i].errType()] << '\n'; } return os; } ccseapps-2.5/CCSEApps/amrlib/.cvsignore0000644000175000017500000000021011634153073021116 0ustar amckinstryamckinstry*.for Debug Debug3D Release Release3D *.ncb *.opt *.plg grdlog ti_files chk[0-9][0-9][0-9][0-9] plt[0-9][0-9][0-9][0-9] *.pixie *.Addrs ccseapps-2.5/CCSEApps/amrlib/FluxRegister.H0000644000175000017500000001653111634153073021667 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _FLUXREGISTER_H_ #define _FLUXREGISTER_H_ // // $Id: FluxRegister.H,v 1.13 2002/11/14 07:08:32 marc Exp $ // #include class Geometry; // //@Man: //@Memo: Flux Register. /*@Doc: Stores and manipulates fluxes at coarse-fine interfaces. */ class FluxRegister : public BndryRegister { public: // //@ManDoc: The default constructor. // FluxRegister(); /*@ManDoc: The constructor. Note that this takes the fine BoxArray. */ FluxRegister (const BoxArray& fine_boxes, const IntVect& ref_ratio, int fine_lev, int nvar); // //@ManDoc: The destructor. // virtual ~FluxRegister (); // //@ManDoc: An enum that says whether to add or copy src data to members. // enum FrOp {COPY = 0, ADD = 1}; /*@ManDoc: Initialize after using default constructor. Note that this takes the fine BoxArray. */ virtual void define (const BoxArray& fine_boxes, const IntVect& ref_ratio, int fine_lev, int nvar); // //@ManDoc: Returns the refinement ratio. // const IntVect& refRatio () const; // //@ManDoc: Returns the level number of the fine level. // int fineLevel () const; // //@ManDoc: Returns the level number of the coarse level (fineLevel()-1). // int crseLevel () const; // //@ManDoc: The number of components. // int nComp () const; // //@ManDoc: The coarsened boxes. // const BoxArray& coarsenedBoxes () const; // //@ManDoc: Returns the sum of the registers. // Real SumReg (int comp) const; // //@ManDoc: Copy from flux register to FAB `flx'. // void copyTo (FArrayBox& flx, int dir, int src_comp, int dest_comp, int num_comp); // //@ManDoc: flx = flx + mult*register. // void addTo (FArrayBox& flx, int dir, Real mult, int src_comp, int dest_comp, int num_comp); // //@ManDoc: mf = fm + mult*register. // void addTo (MultiFab& mf, int dir, Real mult, int src_comp, int dest_comp, int num_comp); // //@ManDoc: Initialize flux correction with coarse data. // void CrseInit (const MultiFab& mflx, const MultiFab& area, int dir, int srccomp, int destcomp, int numcomp, Real mult = -1.0, FrOp op = FluxRegister::COPY); // //@ManDoc: Initialize flux correction with coarse data. // void CrseInit (const FArrayBox& flux, const Box& subbox, int dir, int srccomp, int destcomp, int numcomp, Real mult = -1.0, FrOp op = FluxRegister::COPY); // // This isn't documented -- it's a parallel feature :-( // // It MUST be called after all CrseInit()s outside of // any implicit or explicit parallel loop. // void CrseInitFinish (FrOp op = FluxRegister::COPY); // //@ManDoc: Increment flux correction with fine data. // void FineAdd (const MultiFab& mflx, int dir, int srccomp, int destcomp, int numcomp, Real mult); // //@ManDoc: Increment flux correction with fine data. // void FineAdd (const MultiFab& mflx, const MultiFab& area, int dir, int srccomp, int destcomp, int numcomp, Real mult); // //@ManDoc: Increment flux correction with fine data. // void FineAdd (const FArrayBox& flux, int dir, int boxno, int srccomp, int destcomp, int numcomp, Real mult); // //@ManDoc: Increment flux correction with fine data. // void FineAdd (const FArrayBox& flux, const FArrayBox& area, int dir, int boxno, int srccomp, int destcomp, int numcomp, Real mult); // //@ManDoc: Apply flux correction. Note that this takes the coarse Geometry. // void Reflux (MultiFab& mf, const MultiFab& volume, Real scale, int srccomp, int destcomp, int numcomp, const Geometry& crse_geom); // //@ManDoc: Constant volume version of Reflux(). Note that this takes the coarse Geometry. // void Reflux (MultiFab& mf, Real scale, int srccomp, int destcomp, int numcomp, const Geometry& crse_geom); protected: // // Refinement ratio // IntVect ratio; // // Current level + 1. // int fine_level; // // Number of state components. // int ncomp; // // Helper member function. // void increment (const FArrayBox& fab, int dir); }; #endif /*_FLUXREGISTER_H_*/ ccseapps-2.5/CCSEApps/amrlib/TagBox.H0000644000175000017500000001264611634153073020433 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _TagBox_H_ #define _TagBox_H_ // // $Id: TagBox.H,v 1.18 2003/02/28 22:42:15 lijewski Exp $ // #include #include #include #include #include #include #include #include #include // //@Man: //@Memo: Tagged cells in a Box. /*@Doc: This class is used to tag cells in a Box that need addition refinement. */ class TagBox : public BaseFab { public: // //@ManDoc: The type of each tag. // typedef char TagType; // //@ManDoc: Possible values for each cell. // enum TagVal { CLEAR=0, BUF, SET }; // //@ManDoc: Construct an invalid TagBox with no memory. // TagBox (); // //@ManDoc: Construct a TagBox on Box `bx' with number of components `n'. // TagBox (const Box& bx, int n = 1); // //@ManDoc: Resize the box on which the TagBox is defined. // void resize (const Box& b, int ncomp=1); /*@ManDoc: Construct and return a new tagbox in which the coarsened cell is tagged of any of the corresponding fine cells are tagged. */ TagBox* coarsen (const IntVect& ratio); /*@ManDoc: Mark neighbors of every tagged cell a distance nbuff away only search interior for initial tagged points where nwid is given as the width of the bndry region. */ void buffer (int nbuff, int nwid); // //@ManDoc: Tag cells on intersect with src if corresponding src cell is tagged. // void merge (const TagBox& src); /*@ManDoc: Add location of every tagged cell to IntVect array, starting at given location. Returns the number of collated points. */ int collate (IntVect* ar, int start) const; // //@ManDoc: Returns number of tagged cells in specified Box. // int numTags (const Box& bx) const; // //@ManDoc: Returns total number of tagged cells in the TagBox. // int numTags () const; /*@ManDoc: Returns Array of size domain.numPts() suitable for calling Fortran, with positions set to same value as in the TagBox dataPtr(). */ Array tags () const; /*@ManDoc: Set values as specified by the array. It's an error if ar.length() != domain.numPts(). */ void tags (const Array& ar); private: // // Disallowed. // TagBox (const TagBox& rhs); TagBox& operator= (const TagBox& rhs); }; // //@Man: //@Memo: An array of TagBoxes. /*@Doc: A container class for TagBoxes. */ class TagBoxArray : public FabArray { public: // //@ManDoc: The type of each tag. // typedef TagBox::TagType TagType; // //@ManDoc: The constructor. // TagBoxArray (const BoxArray& bs, int _ngrow=0); // //@ManDoc: Returns the grow factor for the TagBoxArray. // int borderSize () const; // //@ManDoc: Calls buffer() on all contained TagBoxes. // void buffer (int nbuf); /*@ManDoc: Map tagged cells through a periodic boundary to other grids in TagBoxArray cells which were outside domain are set to TagBox::CLEAR. */ void mapPeriodic (const Geometry& geom); // //@ManDoc: Set values in `bd' to `val'. // void setVal (const BoxDomain& bd, TagBox::TagVal val); // //@ManDoc: Set values in `ba' to `val'. // void setVal (const BoxArray& ba, TagBox::TagVal val); // //@ManDoc: Calls coarsen() on all contained TagBoxes. // void coarsen (const IntVect& ratio); // //@ManDoc: The total number of Tags in all the contained TagBoxes. // long numTags () const; /*@ManDoc: Calls collate() on all contained TagBoxes. The callee must delete[] the space when not needed. */ IntVect* collate (long& numtags) const; private: // // Disallowed. // TagBoxArray (); TagBoxArray (const TagBoxArray& rhs); TagBoxArray& operator= (const TagBoxArray& rhs); // // Not to be confused with FabArray::n_grow which defines // the invalid regions of the fabs in the FabArray. // int m_border; }; #endif /*_TagBox_H_*/ ccseapps-2.5/CCSEApps/amrlib/StationData.H0000644000175000017500000000622611634153073021457 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _StationData_H_ #define _StationData_H_ // // $Id: StationData.H,v 1.10 2001/08/01 21:50:46 lijewski Exp $ // #include #include #include #include #include #include #include #include // // Forward declaration. // class AmrLevel; struct StationRec { StationRec (); Real pos[BL_SPACEDIM]; // Physical coordinates int id; // Identifier int level; // Finest level containing station int grd; // Index of BoxArray containing FAB bool own; // Does this CPU own the data at grd? }; class StationData { public: ~StationData (); // // Init from ParmParse. // // ParmParse variables: // // StationData.vars -- Names of StateData components to output // StationData.coord -- BL_SPACEDIM array of Reals // StationData.coord -- the next one // StationData.coord -- ditto ... // // Data files have the form: "Station/stn_CPU_NNNN" // void init (); // // Collect data for all station points at level and write to station file. // void report (Real time, int level, const AmrLevel& amrlevel); // // Locate finest level grid for each station point. // void findGrid (const PArray& levels, const Array& geoms); private: Array m_stn; // Array of stations. Array m_vars; // Names of StateData components to output. std::vector m_IsDerived; // true if the variable is a derived quantity Array m_typ; // The state_index corresponding to m_vars. Array m_ncomp; // The component of the state_index for m_typ. std::ofstream m_ofile; // Output stream. }; #endif /*_StationData_H_*/ ccseapps-2.5/CCSEApps/amrlib/ARRAYLIM_3D.F0000644000175000017500000000664211634153073021012 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: ARRAYLIM_3D.F,v 1.1 2000/04/21 16:20:21 sstanley Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #define SDIM 3 c ::: ----------------------------------------------------------- c ::: This routine sets the values for the lo() and hi() arrays c ::: from the ARG_L1, ARG_H1, ... macros. This is done since c ::: it is more convenient to use the lo() and hi() arrays. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: DIMS(holder)=> index extent of place holder array c ::: lo(SDIM) <= lower index limits c ::: hi(SDIM) <= upper index limits c ::: ----------------------------------------------------------- subroutine SET_LOHI(DIMS(holder), lo, hi) implicit none c c :::: Passed Variables :::: c integer DIMDEC(holder) integer lo(SDIM), hi(SDIM) c c -------------------------------------- c :::: Set Values for lo() and hi() :::: c -------------------------------------- c lo(1) = ARG_L1(holder) hi(1) = ARG_H1(holder) lo(2) = ARG_L2(holder) hi(2) = ARG_H2(holder) lo(3) = ARG_L3(holder) hi(3) = ARG_H3(holder) return end c ::: ----------------------------------------------------------- c ::: This routine sets the values for the ARG_L1, ARG_H1, ... macros c ::: from the lo() and hi() arrays. This is done since c ::: it is more convenient to use the macros to dimension arrays. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: FF_DIMS(holder) <= index extent of place holder array c ::: lo(SDIM) => lower index limits c ::: hi(SDIM) => upper index limits c ::: ----------------------------------------------------------- subroutine SET_ARGS(DIMS(holder), lo, hi) implicit none c c :::: Passed Variables :::: c integer DIMDEC(holder) integer lo(SDIM), hi(SDIM) c c -------------------------------------- c :::: Set Values for lo() and hi() :::: c -------------------------------------- c ARG_L1(holder) = lo(1) ARG_H1(holder) = hi(1) ARG_L2(holder) = lo(2) ARG_H2(holder) = hi(2) ARG_L3(holder) = lo(3) ARG_H3(holder) = hi(3) c c return end ccseapps-2.5/CCSEApps/amrlib/ErrorList.H0000644000175000017500000000777311634153073021201 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _ErrorList_H_ #define _ErrorList_H_ // // $Id: ErrorList.H,v 1.10 2001/08/01 21:50:45 lijewski Exp $ // #include #include #include #include extern "C" { // // Type of extern "C" function called by ErrorRec to do tagging of cells for refinement. // typedef void (*ErrorFunc)(int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* lo, const int * hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); } // //@Man: //@Memo: Error Record. /*@Doc: ErrorRec is designed to tag cells for regridding based on the state data contained in AmrLevel and its derivatives. It is conceivable that actual error tagging will be through derivation, so provision is made for this as well. */ class ErrorRec { public: // //@ManDoc: Error types. // enum ErrorType { Richardson=0, Special }; // //@ManDoc: The constructor. // ErrorRec (const std::string& nm, int ng, ErrorType etyp, ErrorFunc f); // //@ManDoc: The name of the quantity to derive. // const std::string& name () const; // //@ManDoc: The number of extra zones needed for derivation. // int nGrow () const; // //@ManDoc: The type of the error tagging. // ErrorType errType () const; // //@ManDoc: The extern "C" function to do the error tagging. // ErrorFunc errFunc () const; private: // // Name of quantity to derive. // std::string derive_name; // // Number of extra zones. // int ngrow; // // Function to do error estimation. // ErrorFunc err_func; // // The type of Error. // ErrorType err_type; }; // //@Man: //@Memo: A List of ErrorRecs. /*@Doc: Container class for ErrorRecs. */ class ErrorList { public: // //@ManDoc: The number of ErrorRecs in the list. // int size () const; // //@ManDoc: Append a new ErrorRec to the list. // void add (const std::string& name, int nextra, ErrorRec::ErrorType typ, ErrorFunc func); // //@ManDoc: The kth ErrorRec. // const ErrorRec& operator[] (int k) const; private: std::vector vec; }; std::ostream& operator << (std::ostream& os, const ErrorList& elst); #endif ccseapps-2.5/CCSEApps/amrlib/ARRAYLIM_2D.F0000644000175000017500000000644111634153073021006 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: ARRAYLIM_2D.F,v 1.1 2000/04/21 16:20:21 sstanley Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #define SDIM 2 c ::: ----------------------------------------------------------- c ::: This routine sets the values for the lo() and hi() arrays c ::: from the ARG_L1, ARG_H1, ... macros. This is done since c ::: it is more convenient to use the lo() and hi() arrays. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: DIMS(holder)=> index extent of place holder array c ::: lo(SDIM) <= lower index limits c ::: hi(SDIM) <= upper index limits c ::: ----------------------------------------------------------- subroutine SET_LOHI(DIMS(holder), lo, hi) implicit none c c :::: Passed Variables :::: c integer DIMDEC(holder) integer lo(SDIM), hi(SDIM) c c -------------------------------------- c :::: Set Values for lo() and hi() :::: c -------------------------------------- c lo(1) = ARG_L1(holder) hi(1) = ARG_H1(holder) lo(2) = ARG_L2(holder) hi(2) = ARG_H2(holder) end c ::: ----------------------------------------------------------- c ::: This routine sets the values for the ARG_L1, ARG_H1, ... macros c ::: from the lo() and hi() arrays. This is done since c ::: it is more convenient to use the macros to dimension arrays. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: FF_DIMS(holder) <= index extent of place holder array c ::: lo(SDIM) => lower index limits c ::: hi(SDIM) => upper index limits c ::: ----------------------------------------------------------- subroutine SET_ARGS(DIMS(holder), lo, hi) implicit none c c :::: Passed Variables :::: c integer DIMDEC(holder) integer lo(SDIM), hi(SDIM) c c -------------------------------------- c :::: Set Values for lo() and hi() :::: c -------------------------------------- c ARG_L1(holder) = lo(1) ARG_H1(holder) = hi(1) ARG_L2(holder) = lo(2) ARG_H2(holder) = hi(2) c c return end ccseapps-2.5/CCSEApps/amrlib/Cluster.H0000644000175000017500000001324111634153073020660 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _Cluster_H_ #define _Cluster_H_ // // $Id: Cluster.H,v 1.13 2001/08/01 21:50:44 lijewski Exp $ // #include #include #include #include #include #include class BoxDomain; class ClusterList; // //@Man: //@Memo: A cluster of tagged cells. /*@Doc: Utility class for tagging error cells. */ class Cluster { public: // //@ManDoc: The default constructor -- builds invalid Cluster. // Cluster (); /*@ManDoc: Construct a cluster from an array of IntVects. The Cluster object does NOT take over memory management of array; i.e. that's the user's ultimate responsibility. */ Cluster (IntVect* a, long len); /*@ManDoc: Construct new cluster by removing all points from c that lie in box b. Cluster c is modified and may become invalid. */ Cluster (Cluster& c, const Box& b); // //@ManDoc: The destructor. Does NOT destroy the initial IntVect array. // ~Cluster (); // //@ManDoc: Return minimal box containing all tagged points. // const Box& box () const; // //@ManDoc: Does cluster contain any points? // bool ok () const; // //@ManDoc: Returns number of tagged points in cluster. // long numTag () const; // //@ManDoc: Return number of tagged points in intersection of cluster and Box b. // long numTag (const Box& b) const; /*@ManDoc: This operation splits a cluster into two pieces by selecting a cutting plane with certain optimal characteristics then dividing the tagged points into clusters on either side of the plane. One cluster is returned as a new object the other is the modified calling object. */ Cluster* chop (); /*@ManDoc: Constructs a list of cluster objects obtained by intersecting this cluster with each box in bl. The list is retruned in the argument clst. For each intersection that includes tagged points, construct a new cluster by removing those points from this object. Empty intersections or those that contain no tagged points will not generate a new cluster. Note that this cluster will be modified and possibly become invalid in the process. */ void distribute (ClusterList& clst, const BoxDomain& bd); // //@ManDoc: Compute ratio of tagged to total number of points in cluster. // Real eff () const; private: // // These are disallowed. // Cluster (const Cluster&); Cluster& operator= (const Cluster&); // // Compute and store minimal box containing tagged points. // void minBox (); // // The data. // Box m_bx; IntVect* m_ar; long m_len; }; // //@Man: //@Memo: A list of Cluster objects /*@Doc: A container class for Cluster. */ class ClusterList { public: // //@ManDoc: The default constructor. // ClusterList (); // //@ManDoc: Construct a list containing Cluster(pts,len). // ClusterList (IntVect* pts, long len); // //@ManDoc: The destructor. // ~ClusterList (); // //@ManDoc: Return number of clusters in list. // int length () const; // //@ManDoc: Add cluster to end of list. // void append (Cluster* c); // //@ManDoc: Return array of boxes corresponding to clusters. // BoxArray boxArray () const; // //@ManDoc: Return array of boxes corresponding to clusters in argument. // void boxArray (BoxArray& ba) const; // //@ManDoc: Return list of boxes corresponding to clusters. // BoxList boxList() const; // //@ManDoc: Return list of boxes corresponding to clusters in argument. // void boxList (BoxList& blst) const; // //@ManDoc: Chop all clusters in list that have poor efficiency. // void chop (Real eff); /*@ManDoc: Intersect clusters with BoxDomain to insure cluster boxes are interior to domain. */ void intersect (const BoxDomain& dom); private: // // These are disallowed. // ClusterList (const ClusterList&); ClusterList& operator= (const ClusterList&); // // The data. // std::list lst; }; #endif /*_Cluster_H_*/ ccseapps-2.5/CCSEApps/amrlib/BCRec.cpp0000644000175000017500000001065611634153073020557 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BCRec.cpp,v 1.9 2001/08/01 21:50:44 lijewski Exp $ // #include #include BCRec::BCRec () {} BCRec::BCRec (D_DECL(int loX, int loY, int loZ), D_DECL(int hiX, int hiY, int hiZ)) { D_EXPR(bc[0] = loX, bc[1] = loY, bc[2] = loZ); D_EXPR(bc[BL_SPACEDIM]=hiX, bc[BL_SPACEDIM+1]=hiY, bc[BL_SPACEDIM+2]=hiZ); } BCRec::BCRec (const int* lo, const int* hi) { BL_ASSERT(!(lo == 0)); BL_ASSERT(!(hi == 0)); for (int i = 0; i < BL_SPACEDIM; i++) { bc[i] = lo[i]; bc[i+BL_SPACEDIM] = hi[i]; } } BCRec::BCRec (const Box& bx, const Box& domain, const BCRec& bc_domain) { const int* bxlo = bx.loVect(); const int* bxhi = bx.hiVect(); const int* dlo = domain.loVect(); const int* dhi = domain.hiVect(); for (int dir = 0; dir < BL_SPACEDIM; dir++) { int lo = dir; int hi = dir+BL_SPACEDIM; bc[lo] = ( bxlo[dir]<=dlo[dir] ? bc_domain.bc[lo] : INT_DIR ); bc[hi] = ( bxhi[dir]>=dhi[dir] ? bc_domain.bc[hi] : INT_DIR ); } } void BCRec::setLo (int dir, int bc_val) { bc[dir] = bc_val; } void BCRec::setHi (int dir, int bc_val) { bc[BL_SPACEDIM+dir] = bc_val; } const int* BCRec::vect () const { return bc; } const int* BCRec::lo () const { return bc; } const int* BCRec::hi () const { return bc+BL_SPACEDIM; } int BCRec::lo (int dir) const { return bc[dir]; } int BCRec::hi (int dir) const { return bc[BL_SPACEDIM+dir]; } void BoxLib::setBC (const Box& bx, const Box& domain, int src_comp, int dest_comp, int ncomp, const Array& bc_dom, Array& bcr) { const int* bxlo = bx.loVect(); const int* bxhi = bx.hiVect(); const int* dlo = domain.loVect(); const int* dhi = domain.hiVect(); for (int i = 0; i < ncomp; i++) { int dc = dest_comp + i; int sc = src_comp + i; int dir; for (dir = 0; dir < BL_SPACEDIM; dir++) { bcr[dc].setLo(dir, ( bxlo[dir]<=dlo[dir] ? bc_dom[sc].lo(dir) : INT_DIR )); bcr[dc].setHi(dir, ( bxhi[dir]>=dhi[dir] ? bc_dom[sc].hi(dir) : INT_DIR )); } } } void BoxLib::setBC (const Box& bx, const Box& domain, const BCRec& bc_dom, BCRec& bcr) { const int* bxlo = bx.loVect(); const int* bxhi = bx.hiVect(); const int* dlo = domain.loVect(); const int* dhi = domain.hiVect(); for (int dir = 0; dir < BL_SPACEDIM; dir++) { bcr.setLo(dir, ( bxlo[dir]<=dlo[dir] ? bc_dom.lo(dir) : INT_DIR )); bcr.setHi(dir, ( bxhi[dir]>=dhi[dir] ? bc_dom.hi(dir) : INT_DIR )); } } std::ostream& operator<< (std::ostream& os, const BCRec& b) { os << "(BCREC "; for (int i = 0; i < BL_SPACEDIM; i++) { os << b.bc[i] << ':' << b.bc[i+BL_SPACEDIM] << ' '; } os << ')'; return os; } ccseapps-2.5/CCSEApps/amrlib/FluxRegister.cpp0000644000175000017500000011500711634153073022260 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: FluxRegister.cpp,v 1.76 2002/12/20 23:05:39 car Exp $ // #include #include #include #include #include #include #include #include #include #include FluxRegister::FluxRegister () { fine_level = ncomp = -1; ratio = IntVect::TheUnitVector(); ratio.scale(-1); } FluxRegister::FluxRegister (const BoxArray& fine_boxes, const IntVect& ref_ratio, int fine_lev, int nvar) { define(fine_boxes,ref_ratio,fine_lev,nvar); } const IntVect& FluxRegister::refRatio () const { return ratio; } int FluxRegister::fineLevel () const { return fine_level; } int FluxRegister::crseLevel () const { return fine_level-1; } int FluxRegister::nComp () const { return ncomp; } const BoxArray& FluxRegister::coarsenedBoxes () const { return grids; } void FluxRegister::define (const BoxArray& fine_boxes, const IntVect& ref_ratio, int fine_lev, int nvar) { BL_ASSERT(fine_boxes.isDisjoint()); BL_ASSERT(grids.size() == 0); ratio = ref_ratio; fine_level = fine_lev; ncomp = nvar; grids.define(fine_boxes); grids.coarsen(ratio); for (int dir = 0; dir < BL_SPACEDIM; dir++) { const Orientation lo_face(dir,Orientation::low); const Orientation hi_face(dir,Orientation::high); IndexType typ(IndexType::TheCellType()); typ.setType(dir,IndexType::NODE); BndryRegister::define(lo_face,typ,0,1,0,nvar); BndryRegister::define(hi_face,typ,0,1,0,nvar); } } FluxRegister::~FluxRegister () {} Real FluxRegister::SumReg (int comp) const { Real sum = 0.0; for (int dir = 0; dir < BL_SPACEDIM; dir++) { const FabSet& lofabs = bndry[Orientation(dir,Orientation::low)]; const FabSet& hifabs = bndry[Orientation(dir,Orientation::high)]; for (FabSetIter fsi(lofabs); fsi.isValid(); ++fsi) { sum += lofabs[fsi].sum(comp); sum -= hifabs[fsi].sum(comp); } } ParallelDescriptor::ReduceRealSum(sum); return sum; } void FluxRegister::copyTo (FArrayBox& flx, int dir, int src_comp, int dest_comp, int num_comp) { BL_ASSERT(dir >= 0 && dir < BL_SPACEDIM); const FabSet& lofabs = bndry[Orientation(dir,Orientation::low)]; const FabSet& hifabs = bndry[Orientation(dir,Orientation::high)]; lofabs.copyTo(flx,src_comp,dest_comp,num_comp); hifabs.copyTo(flx,src_comp,dest_comp,num_comp); } // // Structure used by Reflux()s. // struct RF { RF () : m_fabidx(-1), m_fridx(-1), m_shifted(false) {} RF (int fabidx, int fridx, Orientation face, FillBoxId fbid) : m_fabidx(fabidx), m_fridx(fridx), m_face(face), m_fbid(fbid), m_shifted(false) {} RF (const IntVect& iv, int fabidx, int fridx, Orientation face, FillBoxId fbid) : m_iv(iv), m_fabidx(fabidx), m_fridx(fridx), m_face(face), m_fbid(fbid), m_shifted(true) {} RF (const RF& rhs) : m_iv(rhs.m_iv), m_fabidx(rhs.m_fabidx), m_fridx(rhs.m_fridx), m_face(rhs.m_face), m_fbid(rhs.m_fbid), m_shifted(rhs.m_shifted) {} RF& operator= (const RF& rhs) { m_iv = rhs.m_iv; m_fabidx = rhs.m_fabidx; m_fridx = rhs.m_fridx; m_face = rhs.m_face; m_fbid = rhs.m_fbid; m_shifted = rhs.m_shifted; return *this; } IntVect m_iv; int m_fabidx; int m_fridx; Orientation m_face; FillBoxId m_fbid; bool m_shifted; }; void FluxRegister::Reflux (MultiFab& S, const MultiFab& volume, Real scale, int src_comp, int dest_comp, int num_comp, const Geometry& geom) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::Reflux(MultiFab&,...)"); FabSetCopyDescriptor fscd; FabSetId fsid[2*BL_SPACEDIM]; for (OrientationIter fi; fi; ++fi) { fsid[fi()] = fscd.RegisterFabSet(&bndry[fi()]); } std::vector RFs; Array pshifts(27); for (MFIter mfi(S); mfi.isValid(); ++mfi) { Real* s_dat = S[mfi].dataPtr(dest_comp); const int* slo = S[mfi].loVect(); const int* shi = S[mfi].hiVect(); const Real* vol_dat = volume[mfi].dataPtr(); const int* vlo = volume[mfi].loVect(); const int* vhi = volume[mfi].hiVect(); // // Find flux register that intersect with this grid. // for (int k = 0; k < grids.size(); k++) { Box bx = BoxLib::grow(grids[k],1); if (bx.intersects(mfi.validbox())) { for (OrientationIter fi; fi; ++fi) { // // low(high) face of fine grid => high (low) // face of the exterior coarse grid cell updated. // Box ovlp = mfi.validbox() & BoxLib::adjCell(grids[k],fi()); if (ovlp.ok()) { FillBoxId fbid = fscd.AddBox(fsid[fi()], bndry[fi()].box(k), 0, k, src_comp, 0, num_comp); RFs.push_back(RF(mfi.index(),k,fi(),fbid)); } } } // // Add periodic possibilities. // if (geom.isAnyPeriodic() && !geom.Domain().contains(bx)) { geom.periodicShift(bx,mfi.validbox(),pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { const IntVect& iv = pshifts[iiv]; S[mfi].shift(iv); const int* slo = S[mfi].loVect(); const int* shi = S[mfi].hiVect(); // // This is a funny situation. I don't want to permanently // change vol, but I need to do a shift on it. I'll shift // it back later, so the overall change is nil. But to do // this, I have to cheat and do a cast. This is pretty // disgusting. // FArrayBox* cheatvol = const_cast(&volume[mfi]); BL_ASSERT(cheatvol != 0); cheatvol->shift(iv); const int* vlo = cheatvol->loVect(); const int* vhi = cheatvol->hiVect(); Box sftbox = mfi.validbox(); sftbox.shift(iv); BL_ASSERT(bx.intersects(sftbox)); for (OrientationIter fi; fi; ++fi) { // // low(high) face of fine grid => high (low) // face of the exterior coarse grid cell updated. // Box ovlp = sftbox & BoxLib::adjCell(grids[k],fi()); if (ovlp.ok()) { FillBoxId fbid = fscd.AddBox(fsid[fi()], bndry[fi()].box(k), 0, k, src_comp, 0, num_comp); RFs.push_back(RF(iv,mfi.index(),k,fi(),fbid)); } } S[mfi].shift(-iv); cheatvol->shift(-iv); } } } } fscd.CollectData(); const int MyProc = ParallelDescriptor::MyProc(); FArrayBox reg; for (int i = 0; i < RFs.size(); i++) { const RF& rf = RFs[i]; const FillBoxId& fbid = rf.m_fbid; BL_ASSERT(bndry[rf.m_face].box(rf.m_fridx) == fbid.box()); BL_ASSERT(S.DistributionMap()[rf.m_fabidx] == MyProc); BL_ASSERT(volume.DistributionMap()[rf.m_fabidx] == MyProc); FArrayBox& fab_S = S[rf.m_fabidx]; const FArrayBox& fab_volume = volume[rf.m_fabidx]; Real* s_dat = fab_S.dataPtr(dest_comp); const int* slo = fab_S.loVect(); const int* shi = fab_S.hiVect(); const Real* vol_dat = fab_volume.dataPtr(); Box fine_face = BoxLib::adjCell(grids[rf.m_fridx],rf.m_face); Real mult = rf.m_face.isLow() ? -scale : scale; const int* rlo = fine_face.loVect(); const int* rhi = fine_face.hiVect(); if (!rf.m_shifted) { Box ovlp = S.box(rf.m_fabidx) & fine_face; BL_ASSERT(ovlp.ok()); reg.resize(fbid.box(), num_comp); fscd.FillFab(fsid[rf.m_face], fbid, reg); const Real* reg_dat = reg.dataPtr(0); const int* vlo = fab_volume.loVect(); const int* vhi = fab_volume.hiVect(); const int* lo = ovlp.loVect(); const int* hi = ovlp.hiVect(); FORT_FRREFLUX(s_dat,ARLIM(slo),ARLIM(shi), vol_dat,ARLIM(vlo),ARLIM(vhi), reg_dat,ARLIM(rlo),ARLIM(rhi), lo,hi,&num_comp,&mult); } else { fab_S.shift(rf.m_iv); // // This is a funny situation. I don't want to permanently // change vol, but I need to do a shift on it. I'll shift // it back later, so the overall change is nil. But to do // this, I have to cheat and do a cast. This is pretty // disgusting. // FArrayBox* cheatvol = const_cast(&fab_volume); BL_ASSERT(cheatvol != 0); cheatvol->shift(rf.m_iv); Box sftbox = S.box(rf.m_fabidx); sftbox.shift(rf.m_iv); Box ovlp = sftbox & fine_face; BL_ASSERT(ovlp.ok()); reg.resize(fbid.box(), num_comp); fscd.FillFab(fsid[rf.m_face], fbid, reg); const Real* reg_dat = reg.dataPtr(0); const int* vlo = cheatvol->loVect(); const int* vhi = cheatvol->hiVect(); const int* lo = ovlp.loVect(); const int* hi = ovlp.hiVect(); FORT_FRREFLUX(s_dat,ARLIM(slo),ARLIM(shi), vol_dat,ARLIM(vlo),ARLIM(vhi), reg_dat,ARLIM(rlo),ARLIM(rhi),lo,hi, &num_comp,&mult); fab_S.shift(-rf.m_iv); cheatvol->shift(-rf.m_iv); } } } void FluxRegister::Reflux (MultiFab& S, Real scale, int src_comp, int dest_comp, int num_comp, const Geometry& geom) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::Reflux(MultiFab&, Real,...)"); const Real* dx = geom.CellSize(); FabSetCopyDescriptor fscd; FabSetId fsid[2*BL_SPACEDIM]; for (OrientationIter fi; fi; ++fi) { fsid[fi()] = fscd.RegisterFabSet(&bndry[fi()]); } std::vector RFs; Array pshifts(27); for (MFIter mfi(S); mfi.isValid(); ++mfi) { // // Find flux register that intersects with this grid. // for (int k = 0; k < grids.size(); k++) { Box bx = BoxLib::grow(grids[k],1); if (bx.intersects(mfi.validbox())) { for (OrientationIter fi; fi; ++fi) { Box ovlp = mfi.validbox() & BoxLib::adjCell(grids[k],fi()); if (ovlp.ok()) { FillBoxId fbid = fscd.AddBox(fsid[fi()], bndry[fi()].box(k), 0, k, src_comp, 0, num_comp); RFs.push_back(RF(mfi.index(),k,fi(),fbid)); } } } // // Add periodic possibilities. // if (geom.isAnyPeriodic() && !geom.Domain().contains(bx)) { geom.periodicShift(bx,mfi.validbox(),pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { const IntVect& iv = pshifts[iiv]; S[mfi].shift(iv); const int* slo = S[mfi].loVect(); const int* shi = S[mfi].hiVect(); Box sftbox = mfi.validbox(); sftbox.shift(iv); BL_ASSERT(bx.intersects(sftbox)); for (OrientationIter fi; fi; ++fi) { // // low(high) face of fine grid => high (low) // face of the exterior coarse grid cell updated. // Box ovlp = sftbox & BoxLib::adjCell(grids[k],fi()); if (ovlp.ok()) { FillBoxId fbid = fscd.AddBox(fsid[fi()], bndry[fi()].box(k), 0, k, src_comp, 0, num_comp); RFs.push_back(RF(iv,mfi.index(),k,fi(),fbid)); } } S[mfi].shift(-iv); } } } } fscd.CollectData(); const int MyProc = ParallelDescriptor::MyProc(); FArrayBox reg; for (int i = 0; i < RFs.size(); i++) { const RF& rf = RFs[i]; const FillBoxId& fbid = rf.m_fbid; BL_ASSERT(bndry[rf.m_face].box(rf.m_fridx) == fbid.box()); BL_ASSERT(S.DistributionMap()[rf.m_fabidx] == MyProc); FArrayBox& fab_S = S[rf.m_fabidx]; Box fine_face = BoxLib::adjCell(grids[rf.m_fridx],rf.m_face); Real mult = rf.m_face.isLow() ? -scale : scale; const int* rlo = fine_face.loVect(); const int* rhi = fine_face.hiVect(); Real* s_dat = fab_S.dataPtr(dest_comp); const int* slo = fab_S.loVect(); const int* shi = fab_S.hiVect(); if (!rf.m_shifted) { Box ovlp = S.box(rf.m_fabidx) & fine_face; BL_ASSERT(ovlp.ok()); reg.resize(fbid.box(), num_comp); fscd.FillFab(fsid[rf.m_face], fbid, reg); const Real* reg_dat = reg.dataPtr(0); const int* lo = ovlp.loVect(); const int* hi = ovlp.hiVect(); FORT_FRCVREFLUX(s_dat,ARLIM(slo),ARLIM(shi),dx, reg_dat,ARLIM(rlo),ARLIM(rhi),lo,hi, &num_comp,&mult); } else { fab_S.shift(rf.m_iv); Box sftbox = S.box(rf.m_fabidx); sftbox.shift(rf.m_iv); Box ovlp = sftbox & fine_face; BL_ASSERT(ovlp.ok()); reg.resize(fbid.box(), num_comp); fscd.FillFab(fsid[rf.m_face], fbid, reg); const Real* reg_dat = reg.dataPtr(0); const int* lo = ovlp.loVect(); const int* hi = ovlp.hiVect(); FORT_FRCVREFLUX(s_dat,ARLIM(slo),ARLIM(shi),dx, reg_dat,ARLIM(rlo),ARLIM(rhi), lo,hi,&num_comp,&mult); fab_S.shift(-rf.m_iv); } } } void FluxRegister::CrseInit (const MultiFab& mflx, const MultiFab& area, int dir, int srccomp, int destcomp, int numcomp, Real mult, FrOp op) { BL_ASSERT(srccomp >= 0 && srccomp+numcomp <= mflx.nComp()); BL_ASSERT(destcomp >= 0 && destcomp+numcomp <= ncomp); const Orientation face_lo(dir,Orientation::low); const Orientation face_hi(dir,Orientation::high); MultiFabCopyDescriptor mfcd; MultiFabId mfid_mflx = mfcd.RegisterFabArray(const_cast(&mflx)); MultiFabId mfid_area = mfcd.RegisterFabArray(const_cast(&area)); std::vector fillBoxId_mflx, fillBoxId_area; for (FabSetIter mfi_lo(bndry[face_lo]); mfi_lo.isValid(); ++mfi_lo) { for (int k = 0; k < mflx.boxArray().size(); k++) { Box lobox = mfi_lo.fabbox() & mflx.boxArray()[k]; if (lobox.ok()) { fillBoxId_mflx.push_back(mfcd.AddBox(mfid_mflx, lobox, 0, k, srccomp, 0, numcomp)); BL_ASSERT(fillBoxId_mflx.back().box() == lobox); // // Here we'll save the index into the FabSet. // fillBoxId_mflx.back().FabIndex(mfi_lo.index()); fillBoxId_area.push_back(mfcd.AddBox(mfid_area, lobox, 0, k, 0, 0, 1)); BL_ASSERT(fillBoxId_area.back().box() == lobox); // // Here we'll save the direction. // fillBoxId_area.back().FabIndex(Orientation::low); } Box hibox = bndry[face_hi].fabbox(mfi_lo.index()) & mflx.boxArray()[k]; if (hibox.ok()) { fillBoxId_mflx.push_back(mfcd.AddBox(mfid_mflx, hibox, 0, k, srccomp, 0, numcomp)); BL_ASSERT(fillBoxId_mflx.back().box() == hibox); // // Here we'll save the index into the FabSet. // fillBoxId_mflx.back().FabIndex(mfi_lo.index()); fillBoxId_area.push_back(mfcd.AddBox(mfid_area, hibox, 0, k, 0, 0, 1)); BL_ASSERT(fillBoxId_area.back().box() == hibox); // // Here we'll save the direction. // fillBoxId_area.back().FabIndex(Orientation::high); } } } mfcd.CollectData(); BL_ASSERT(fillBoxId_mflx.size() == fillBoxId_area.size()); const int MyProc = ParallelDescriptor::MyProc(); FArrayBox mflx_fab, area_fab, tmp_fab; for (int i = 0; i < fillBoxId_mflx.size(); i++) { const FillBoxId& fbid_mflx = fillBoxId_mflx[i]; const FillBoxId& fbid_area = fillBoxId_area[i]; BL_ASSERT(fbid_mflx.box() == fbid_area.box()); Orientation the_face(dir,Orientation::Side(fbid_area.FabIndex())); BL_ASSERT(the_face == face_lo || the_face == face_hi); mflx_fab.resize(fbid_mflx.box(), numcomp); mfcd.FillFab(mfid_mflx, fbid_mflx, mflx_fab); area_fab.resize(fbid_mflx.box(), 1); mfcd.FillFab(mfid_area, fbid_area, area_fab); FabSet& fabset = bndry[the_face]; const int fabindex = fbid_mflx.FabIndex(); BL_ASSERT(fabset.DistributionMap()[fabindex] == MyProc); FArrayBox& fab = fabset[fabindex]; tmp_fab.resize(fabset[fabindex].box(),numcomp); const int* flo = mflx_fab.box().loVect(); const int* fhi = mflx_fab.box().hiVect(); const Real* flx_dat = mflx_fab.dataPtr(); const int* alo = area_fab.box().loVect(); const int* ahi = area_fab.box().hiVect(); const Real* area_dat = area_fab.dataPtr(); const int* rlo = tmp_fab.loVect(); const int* rhi = tmp_fab.hiVect(); Real* lodat = tmp_fab.dataPtr(); const int* lo = fbid_mflx.box().loVect(); const int* hi = fbid_mflx.box().hiVect(); FORT_FRCAINIT(lodat,ARLIM(rlo),ARLIM(rhi), flx_dat,ARLIM(flo),ARLIM(fhi), area_dat,ARLIM(alo),ARLIM(ahi), lo,hi,&numcomp,&dir,&mult); if (op == COPY) { fab.copy(tmp_fab,fbid_mflx.box(),0,fbid_mflx.box(),destcomp,numcomp); } else { fab.plus(tmp_fab,fbid_mflx.box(),0,destcomp,numcomp); } } } // // Helper function and data for CrseInit()/CrseInitFinish(). // static Array CIMsgs; static std::vector CITags; static std::vector CIFabs; static BArena CIArena; static Mutex CIMutex; static void DoIt (Orientation face, int k, FabSet* bndry, const Box& bx, const FArrayBox& flux, int srccomp, int destcomp, int numcomp, Real mult, FluxRegister::FrOp op = FluxRegister::COPY) { const DistributionMapping& dMap = bndry[face].DistributionMap(); if (ParallelDescriptor::MyProc() == dMap[k]) { // // Local data. // if ( op == FluxRegister::COPY ) { bndry[face][k].copy(flux, bx, srccomp, bx, destcomp, numcomp); bndry[face][k].mult(mult, bx, destcomp, numcomp); } else { FArrayBox tmp(bx, numcomp); tmp.copy(flux, bx, srccomp, bx, 0, numcomp); tmp.mult(mult); bndry[face][k].plus(tmp, bx, bx, 0, destcomp, numcomp); } } else { FabComTag tag; tag.toProc = dMap[k]; tag.fabIndex = k; tag.box = bx; tag.face = face; tag.destComp = destcomp; tag.nComp = numcomp; FArrayBox* fab = new FArrayBox(bx, numcomp); fab->copy(flux, bx, srccomp, bx, 0, numcomp); fab->mult(mult, bx, 0, numcomp); Lock lock(CIMutex); CITags.push_back(tag); CIFabs.push_back(fab); if (CIMsgs.size() == 0) CIMsgs.resize(ParallelDescriptor::NProcs(), 0); CIMsgs[dMap[k]]++; } } void FluxRegister::CrseInit (const FArrayBox& flux, const Box& subbox, int dir, int srccomp, int destcomp, int numcomp, Real mult, FrOp op) { BL_ASSERT(flux.box().contains(subbox)); BL_ASSERT(srccomp >= 0 && srccomp+numcomp <= flux.nComp()); BL_ASSERT(destcomp >= 0 && destcomp+numcomp <= ncomp); Arena* oldarena = BoxLib::ResetArena(&CIArena); for (int k = 0; k < grids.size(); k++) { const Orientation lo(dir,Orientation::low); const Orientation hi(dir,Orientation::high); const Box lobox = bndry[lo].box(k) & subbox; const Box hibox = bndry[hi].box(k) & subbox; if (lobox.ok()) { DoIt(lo,k,bndry,lobox,flux,srccomp,destcomp,numcomp,mult,op); } if (hibox.ok()) { DoIt(hi,k,bndry,hibox,flux,srccomp,destcomp,numcomp,mult,op); } } BoxLib::ResetArena(oldarena); } void FluxRegister::CrseInitFinish (FrOp op) { if (ParallelDescriptor::NProcs() == 1) return; Arena* oldarena = BoxLib::ResetArena(&CIArena); const int seqno_1 = ParallelDescriptor::SeqNum(); const int seqno_2 = ParallelDescriptor::SeqNum(); const int MyProc = ParallelDescriptor::MyProc(); const int NProcs = ParallelDescriptor::NProcs(); const int IOProc = ParallelDescriptor::IOProcessorNumber(); BL_ASSERT(CITags.size() == CIFabs.size()); if (CIMsgs.size() == 0) CIMsgs.resize(ParallelDescriptor::NProcs(),0); BL_ASSERT(CIMsgs[MyProc] == 0); Array Rcvs(NProcs,0); Array indx(NProcs); Array fab_data(NProcs); Array senddata; Array status(NProcs); Array req_cd(NProcs,MPI_REQUEST_NULL); Array req_data(NProcs,MPI_REQUEST_NULL); int NumRcvs = 0, idx = 0, NWaits = 0; // // Set Rcvs[i] to # of blocks we expect to get from CPU i ... // for (int i = 0; i < NProcs; i++) { ParallelDescriptor::Gather(&CIMsgs[i], 1, Rcvs.dataPtr(), 1, i); } BL_ASSERT(Rcvs[MyProc] == 0); for (int i = 0; i < NProcs; i++) NumRcvs += Rcvs[i]; Array recvdata(NumRcvs); // // Make sure we can treat CommData as a stream of integers. // BL_ASSERT(sizeof(CommData) == CommData::DIM*sizeof(int)); // // Post one receive for each chunk being sent by other CPUs. // This is the CommData describing the FAB data that will be sent. // for (int i = 0; i < NProcs; i++) { if (Rcvs[i] > 0) { NWaits++; int* data = reinterpret_cast(&recvdata[idx]); const size_t N = Rcvs[i]*CommData::DIM; req_cd[i] = ParallelDescriptor::Arecv(data,N,i,seqno_1).req(); idx += Rcvs[i]; } } BL_ASSERT(idx == NumRcvs); // // Now send the CommData. // for (int i = 0; i < NProcs; i++) { if (CIMsgs[i] > 0) { senddata.resize(CIMsgs[i]); int Processed = 0; for (int j = 0; j < CITags.size(); j++) { if (CITags[j].toProc == i) { CommData data(CITags[j].face, CITags[j].fabIndex, MyProc, 0, CITags[j].nComp, CITags[j].destComp, // Store as srcComp() 0, // Not used. CITags[j].box); senddata[Processed++] = data; } } BL_ASSERT(Processed == CIMsgs[i]); int* data = reinterpret_cast(senddata.dataPtr()); const size_t N = senddata.size() * CommData::DIM; ParallelDescriptor::Send(data, N, i, seqno_1); } } // // Post one receive for data being sent by CPU i ... // for (int completed; NWaits > 0; NWaits -= completed) { ParallelDescriptor::Waitsome(req_cd, completed, indx, status); for (int k = 0; k < completed; k++) { // // Got to figure out # of Reals to expect from this CPU. // const int Ncpu = indx[k]; idx = 0; for (int j = 0; j < Ncpu; j++) idx += Rcvs[j]; size_t N = 0; for (int j = 0; j < Rcvs[Ncpu]; j++) N += recvdata[idx+j].box().numPts() * recvdata[idx+j].nComp(); BL_ASSERT(N < INT_MAX); fab_data[Ncpu] = static_cast(BoxLib::The_Arena()->alloc(N*sizeof(Real))); req_data[Ncpu] = ParallelDescriptor::Arecv(fab_data[Ncpu],N,Ncpu,seqno_2).req(); } } // // Send the agglomerated FAB data. // for (int i = 0; i < NProcs; i++) { if (CIMsgs[i] > 0) { size_t N = 0; for (int j = 0; j < CITags.size(); j++) if (CITags[j].toProc == i) N += CITags[j].box.numPts() * CITags[j].nComp; BL_ASSERT(N < INT_MAX); Real* data = static_cast(BoxLib::The_Arena()->alloc(N*sizeof(Real))); Real* dptr = data; for (int j = 0; j < CITags.size(); j++) { if (CITags[j].toProc == i) { BL_ASSERT(CITags[j].box == CIFabs[j]->box()); BL_ASSERT(CITags[j].nComp == CIFabs[j]->nComp()); int count = CITags[j].box.numPts() * CITags[j].nComp; memcpy(dptr, CIFabs[j]->dataPtr(), count * sizeof(Real)); delete CIFabs[j]; CIFabs[j] = 0; dptr += count; } } BL_ASSERT(data + N == dptr); ParallelDescriptor::Send(data, N, i, seqno_2); BoxLib::The_Arena()->free(data); } } { // // Now receive and unpack FAB data. // FArrayBox fab; NWaits = 0; for (int i = 0; i < NProcs; i++) if (req_data[i] != MPI_REQUEST_NULL) NWaits++; for (int completed; NWaits > 0; NWaits -= completed) { ParallelDescriptor::Waitsome(req_data, completed, indx, status); for (int k = 0; k < completed; k++) { const int Ncpu = indx[k]; idx = 0; for (int j = 0; j < Ncpu; j++) idx += Rcvs[j]; int Processed = 0; Real* dptr = fab_data[Ncpu]; BL_ASSERT(!(dptr == 0)); for (int j = 0; j < Rcvs[Ncpu]; j++) { const CommData& cd = recvdata[idx+j]; fab.resize(cd.box(),cd.nComp()); int N = fab.box().numPts() * fab.nComp(); BL_ASSERT(N < INT_MAX); memcpy(fab.dataPtr(), dptr, N * sizeof(Real)); if (op == COPY) { bndry[cd.face()][cd.fabindex()].copy(fab, fab.box(), 0, fab.box(), cd.srcComp(), cd.nComp()); } else { bndry[cd.face()][cd.fabindex()].plus(fab, fab.box(), fab.box(), 0, cd.srcComp(), cd.nComp()); } dptr += N; Processed++; } BL_ASSERT(Processed == Rcvs[Ncpu]); BoxLib::The_Arena()->free(fab_data[Ncpu]); } } // // Null out vectors. // CIFabs.erase(CIFabs.begin(), CIFabs.end()); CITags.erase(CITags.begin(), CITags.end()); // // Zero out CIMsgs. // for (int i = 0; i < NProcs; i++) CIMsgs[i] = 0; } BoxLib::ResetArena(oldarena); } void FluxRegister::FineAdd (const MultiFab& mflx, int dir, int srccomp, int destcomp, int numcomp, Real mult) { for (MFIter mflxmfi(mflx); mflxmfi.isValid(); ++mflxmfi) { FineAdd(mflx[mflxmfi],dir,mflxmfi.index(),srccomp,destcomp,numcomp,mult); } } void FluxRegister::FineAdd (const MultiFab& mflx, const MultiFab& area, int dir, int srccomp, int destcomp, int numcomp, Real mult) { for (MFIter mflxmfi(mflx); mflxmfi.isValid(); ++mflxmfi) { FineAdd(mflx[mflxmfi],area[mflxmfi],dir,mflxmfi.index(),srccomp,destcomp,numcomp,mult); } } void FluxRegister::FineAdd (const FArrayBox& flux, int dir, int boxno, int srccomp, int destcomp, int numcomp, Real mult) { BL_ASSERT(srccomp >= 0 && srccomp+numcomp <= flux.nComp()); BL_ASSERT(destcomp >= 0 && destcomp+numcomp <= ncomp); #ifndef NDEBUG Box cbox = BoxLib::coarsen(flux.box(),ratio); #endif const Box& flxbox = flux.box(); const int* flo = flxbox.loVect(); const int* fhi = flxbox.hiVect(); const Real* flxdat = flux.dataPtr(srccomp); FArrayBox& loreg = bndry[Orientation(dir,Orientation::low)][boxno]; BL_ASSERT(cbox.contains(loreg.box())); const int* rlo = loreg.box().loVect(); const int* rhi = loreg.box().hiVect(); Real* lodat = loreg.dataPtr(destcomp); FORT_FRFINEADD(lodat,ARLIM(rlo),ARLIM(rhi), flxdat,ARLIM(flo),ARLIM(fhi), &numcomp,&dir,ratio.getVect(),&mult); FArrayBox& hireg = bndry[Orientation(dir,Orientation::high)][boxno]; BL_ASSERT(cbox.contains(hireg.box())); rlo = hireg.box().loVect(); rhi = hireg.box().hiVect(); Real* hidat = hireg.dataPtr(destcomp); FORT_FRFINEADD(hidat,ARLIM(rlo),ARLIM(rhi), flxdat,ARLIM(flo),ARLIM(fhi), &numcomp,&dir,ratio.getVect(),&mult); } void FluxRegister::FineAdd (const FArrayBox& flux, const FArrayBox& area, int dir, int boxno, int srccomp, int destcomp, int numcomp, Real mult) { BL_ASSERT(srccomp >= 0 && srccomp+numcomp <= flux.nComp()); BL_ASSERT(destcomp >= 0 && destcomp+numcomp <= ncomp); #ifndef NDEBUG Box cbox = BoxLib::coarsen(flux.box(),ratio); #endif const Real* area_dat = area.dataPtr(); const int* alo = area.loVect(); const int* ahi = area.hiVect(); const Box& flxbox = flux.box(); const int* flo = flxbox.loVect(); const int* fhi = flxbox.hiVect(); const Real* flxdat = flux.dataPtr(srccomp); FArrayBox& loreg = bndry[Orientation(dir,Orientation::low)][boxno]; BL_ASSERT(cbox.contains(loreg.box())); const int* rlo = loreg.box().loVect(); const int* rhi = loreg.box().hiVect(); Real* lodat = loreg.dataPtr(destcomp); FORT_FRFAADD(lodat,ARLIM(rlo),ARLIM(rhi), flxdat,ARLIM(flo),ARLIM(fhi), area_dat,ARLIM(alo),ARLIM(ahi), &numcomp,&dir,ratio.getVect(),&mult); FArrayBox& hireg = bndry[Orientation(dir,Orientation::high)][boxno]; BL_ASSERT(cbox.contains(hireg.box())); rlo = hireg.box().loVect(); rhi = hireg.box().hiVect(); Real* hidat = hireg.dataPtr(destcomp); FORT_FRFAADD(hidat,ARLIM(rlo),ARLIM(rhi), flxdat,ARLIM(flo),ARLIM(fhi), area_dat,ARLIM(alo),ARLIM(ahi), &numcomp,&dir,ratio.getVect(),&mult); } ccseapps-2.5/CCSEApps/amrlib/TagBox.cpp0000644000175000017500000004172411634153073021025 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: TagBox.cpp,v 1.65 2003/02/28 22:42:15 lijewski Exp $ // #include #include #include #include #include #include #include #include #include TagBox::TagBox () {} TagBox::TagBox (const Box& bx, int n) : BaseFab(bx,n) { setVal(TagBox::CLEAR); } void TagBox::resize (const Box& b, int ncomp) { BaseFab::resize(b,ncomp); } TagBox* TagBox::coarsen (const IntVect& ratio) { Box cbx(domain); cbx.coarsen(ratio); TagBox* crse = new TagBox(cbx); const Box& cbox = crse->box(); Box b1(BoxLib::refine(cbox,ratio)); const int* flo = domain.loVect(); const int* fhi = domain.hiVect(); const int* flen = domain.length().getVect(); const int* clo = cbox.loVect(); const int* chi = cbox.hiVect(); const int* clen = cbox.length().getVect(); const int* lo = b1.loVect(); const int* hi = b1.hiVect(); const int* len = b1.length().getVect(); int longlen, dir; longlen = b1.longside(dir); TagType* fdat = dataPtr(); TagType* cdat = crse->dataPtr(); TagType* t = new TagType[longlen]; for (int i = 0; i < longlen; i++) t[i] = TagBox::CLEAR; int klo = 0, khi = 0, jlo = 0, jhi = 0, ilo, ihi; D_TERM(ilo=flo[0]; ihi=fhi[0]; , jlo=flo[1]; jhi=fhi[1]; , klo=flo[2]; khi=fhi[2];) #define IXPROJ(i,r) (((i)+(r)*std::abs(i))/(r) - std::abs(i)) #define IOFF(j,k,lo,len) D_TERM(0, +(j-lo[1])*len[0], +(k-lo[2])*len[0]*len[1]) #define JOFF(i,k,lo,len) D_TERM(i-lo[0], +0, +(k-lo[2])*len[0]*len[1]) #define KOFF(i,j,lo,len) D_TERM(i-lo[0], +(j-lo[1])*len[0], +0) // // hack // dir = 0; int ratiox = 1, ratioy = 1, ratioz = 1; D_TERM(ratiox = ratio[0];, ratioy = ratio[1];, ratioz = ratio[2];) int dummy_ratio = 1; if (dir == 0) { for (int k = klo; k <= khi; k++) { int kc = IXPROJ(k,ratioz); for (int j = jlo; j <= jhi; j++) { int jc = IXPROJ(j,ratioy); TagType* c = cdat + IOFF(jc,kc,clo,clen); const TagType* f = fdat + IOFF(j,k,flo,flen); // // Copy fine grid row of values into tmp array. // for (int i = ilo; i <= ihi; i++) t[i-lo[0]] = f[i-ilo]; for (int off = 0; off < ratiox; off++) { for (int ic = 0; ic < clen[0]; ic++) { int i = ic*ratiox + off; c[ic] = std::max(c[ic],t[i]); } } } } } else if (dir == 1) { for (int k = klo; k <= khi; k++) { int kc = IXPROJ(k,dummy_ratio); for (int i = ilo; i <= ihi; i++) { int ic = IXPROJ(i,dummy_ratio); TagType* c = cdat + JOFF(ic,kc,clo,clen); const TagType* f = fdat + JOFF(i,k,flo,flen); // // Copy fine grid row of values into tmp array. // int strd = flen[0]; for (int j = jlo; j <= jhi; j++) t[j-lo[1]] = f[(j-jlo)*strd]; for (int off = 0; off < dummy_ratio; off++) { int jc = 0; strd = clen[0]; for (int jcnt = 0; jcnt < clen[1]; jcnt++) { int j = jcnt*dummy_ratio + off; c[jc] = std::max(c[jc],t[j]); jc += strd; } } } } } else { for (int j = jlo; j <= jhi; j++) { int jc = IXPROJ(j,dummy_ratio); for (int i = ilo; i <= ihi; i++) { int ic = IXPROJ(i,dummy_ratio); TagType* c = cdat + KOFF(ic,jc,clo,clen); const TagType* f = fdat + KOFF(i,j,flo,flen); // // Copy fine grid row of values into tmp array. // int strd = flen[0]*flen[1]; for (int k = klo; k <= khi; k++) t[k-lo[2]] = f[(k-klo)*strd]; for (int off = 0; off < dummy_ratio; off++) { int kc = 0; strd = clen[0]*clen[1]; for (int kcnt = 0; kcnt < clen[2]; kcnt++) { int k = kcnt*dummy_ratio + off; c[kc] = std::max(c[kc],t[k]); kc += strd; } } } } } delete [] t; return crse; #undef ABS #undef IXPROJ #undef IOFF #undef JOFF #undef KOFF } void TagBox::buffer (int nbuff, int nwid) { // // Note: this routine assumes cell with TagBox::SET tag are in // interior of tagbox (region = grow(domain,-nwid)). // Box inside(domain); inside.grow(-nwid); const int* inlo = inside.loVect(); const int* inhi = inside.hiVect(); int klo = 0, khi = 0, jlo = 0, jhi = 0, ilo, ihi; D_TERM(ilo=inlo[0]; ihi=inhi[0]; , jlo=inlo[1]; jhi=inhi[1]; , klo=inlo[2]; khi=inhi[2];) const int* len = domain.length().getVect(); const int* lo = domain.loVect(); int ni = 0, nj = 0, nk = 0; D_TERM(ni, =nj, =nk) = nbuff; TagType* d = dataPtr(); #define OFF(i,j,k,lo,len) D_TERM(i-lo[0], +(j-lo[1])*len[0] , +(k-lo[2])*len[0]*len[1]) for (int k = klo; k <= khi; k++) { for (int j = jlo; j <= jhi; j++) { for (int i = ilo; i <= ihi; i++) { TagType* d_check = d + OFF(i,j,k,lo,len); if (*d_check == TagBox::SET) { for (int k = -nk; k <= nk; k++) { for (int j = -nj; j <= nj; j++) { for (int i = -ni; i <= ni; i++) { TagType* dn = d_check+ D_TERM(i, +j*len[0], +k*len[0]*len[1]); if (*dn !=TagBox::SET) *dn = TagBox::BUF; } } } } } } } #undef OFF } void TagBox::merge (const TagBox& src) { // // Compute intersections. // Box bx = domain & src.domain; if (bx.ok()) { const int* dlo = domain.loVect(); const int* dlen = domain.length().getVect(); const int* slo = src.domain.loVect(); const int* slen = src.domain.length().getVect(); const int* lo = bx.loVect(); const int* hi = bx.hiVect(); const TagType* ds0 = src.dataPtr(); TagType* dd0 = dataPtr(); int klo = 0, khi = 0, jlo = 0, jhi = 0, ilo, ihi; D_TERM(ilo=lo[0]; ihi=hi[0]; , jlo=lo[1]; jhi=hi[1]; , klo=lo[2]; khi=hi[2];) #define OFF(i,j,k,lo,len) D_TERM(i-lo[0], +(j-lo[1])*len[0] , +(k-lo[2])*len[0]*len[1]) for (int k = klo; k <= khi; k++) { for (int j = jlo; j <= jhi; j++) { for (int i = ilo; i <= ihi; i++) { const TagType* ds = ds0 + OFF(i,j,k,slo,slen); if (*ds != TagBox::CLEAR) { TagType* dd = dd0 + OFF(i,j,k,dlo,dlen); *dd = TagBox::SET; } } } } } #undef OFF } int TagBox::numTags () const { int nt = 0; long t_long = domain.numPts(); BL_ASSERT(t_long < INT_MAX); int len = static_cast(t_long); const TagType* d = dataPtr(); for (int n = 0; n < len; n++) { if (d[n] != TagBox::CLEAR) nt++; } return nt; } int TagBox::numTags (const Box& b) const { TagBox tempTagBox(b,1); tempTagBox.copy(*this); return tempTagBox.numTags(); } int TagBox::collate (IntVect* ar, int start) const { BL_ASSERT(!(ar == 0)); BL_ASSERT(start >= 0); // // Starting at given offset of array ar, enter location (IntVect) of // each tagged cell in tagbox. // int count = 0; const int* len = domain.length().getVect(); const int* lo = domain.loVect(); const TagType* d = dataPtr(); int ni = 1, nj = 1, nk = 1; D_TERM(ni = len[0]; , nj = len[1]; , nk = len[2];) for (int k = 0; k < nk; k++) { for (int j = 0; j < nj; j++) { for (int i = 0; i < ni; i++) { const TagType* dn = d + D_TERM(i, +j*len[0], +k*len[0]*len[1]); if (*dn != TagBox::CLEAR) { ar[start++] = IntVect(D_DECL(lo[0]+i,lo[1]+j,lo[2]+k)); count++; } } } } return count; } Array TagBox::tags () const { Array ar(domain.numPts(), TagBox::CLEAR); const TagType* cptr = dataPtr(); int* iptr = ar.dataPtr(); for (int i = 0; i < ar.size(); i++, cptr++, iptr++) { if (*cptr) *iptr = *cptr; } return ar; } void TagBox::tags (const Array& ar) { BL_ASSERT(ar.size() == domain.numPts()); TagType* cptr = dataPtr(); const int* iptr = ar.dataPtr(); for (int i = 0; i < ar.size(); i++, cptr++, iptr++) { if (*iptr) *cptr = *iptr; } } TagBoxArray::TagBoxArray (const BoxArray& ba, int ngrow) : m_border(ngrow) { BoxArray grownBoxArray(ba); grownBoxArray.grow(ngrow); define(grownBoxArray, 1, 0, Fab_allocate); } int TagBoxArray::borderSize () const { return m_border; } void TagBoxArray::buffer (int nbuf) { if (!(nbuf == 0)) { BL_ASSERT(nbuf <= m_border); for (MFIter fai(*this); fai.isValid(); ++fai) { get(fai).buffer(nbuf, m_border); } } } void TagBoxArray::mapPeriodic (const Geometry& geom) { if (!geom.isAnyPeriodic()) return; FabArrayCopyDescriptor facd; FabArrayId faid = facd.RegisterFabArray(this); const int MyProc = ParallelDescriptor::MyProc(); const Box& domain = geom.Domain(); Array pshifts(27); std::vector fillBoxId; std::vector shifts; for (int i = 0; i < boxarray.size(); i++) { if (!domain.contains(boxarray[i])) { geom.periodicShift(domain, boxarray[i], pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { Box shiftbox(boxarray[i]); shiftbox.shift(pshifts[iiv]); for (int j = 0; j < boxarray.size(); j++) { if (distributionMap[j] == MyProc) { Box intbox = boxarray[j] & shiftbox; if (intbox.ok()) { intbox.shift(-pshifts[iiv]); fillBoxId.push_back(facd.AddBox(faid, intbox, 0, i, 0, 0, n_comp)); BL_ASSERT(fillBoxId.back().box() == intbox); // // Here we'll save the index into fabparray. // fillBoxId.back().FabIndex(j); // // Maintain a parallel array of IntVect shifts. // shifts.push_back(pshifts[iiv]); } } } } } } facd.CollectData(); BL_ASSERT(fillBoxId.size() == shifts.size()); TagBox src; for (int i = 0; i < fillBoxId.size(); i++) { BL_ASSERT(distributionMap[fillBoxId[i].FabIndex()] == MyProc); src.resize(fillBoxId[i].box(), n_comp); facd.FillFab(faid, fillBoxId[i], src); src.shift(shifts[i]); fabparray[fillBoxId[i].FabIndex()].merge(src); } } long TagBoxArray::numTags () const { long ntag = 0; for (MFIter fai(*this); fai.isValid(); ++fai) { ntag += get(fai).numTags(); } ParallelDescriptor::ReduceLongSum(ntag); return ntag; } // // Used by collate(). // struct IntVectComp { bool operator () (const IntVect& lhs, const IntVect& rhs) const { return lhs.lexLT(rhs); } }; IntVect* TagBoxArray::collate (long& numtags) const { numtags = numTags(); // // The caller of collate() is responsible for delete[]ing this space. // IntVect* TheCollateSpace = new IntVect[numtags]; const int NGrids = fabparray.size(); Array sharedNTags(NGrids); // Shared numTags per grid. Array startOffset(NGrids); // Start locations per grid. for (MFIter fai(*this); fai.isValid(); ++fai) { sharedNTags[fai.index()] = get(fai).numTags(); } const DistributionMapping& dMap = DistributionMap(); for (int i = 0; i < NGrids; ++i) { ParallelDescriptor::Bcast(&sharedNTags[i],1,dMap[i]); } startOffset[0] = 0; for (int i = 1; i < NGrids; ++i) { startOffset[i] = startOffset[i-1]+sharedNTags[i-1]; } // // Communicate all local points so all procs have the same global set. // for (MFIter fai(*this); fai.isValid(); ++fai) { get(fai).collate(TheCollateSpace,startOffset[fai.index()]); } // // Make sure can pass IntVect as array of ints. // BL_ASSERT(sizeof(IntVect) == BL_SPACEDIM * sizeof(int)); for (int i = 0; i < NGrids; ++i) { int* iptr = reinterpret_cast(TheCollateSpace+startOffset[i]); ParallelDescriptor::Bcast(iptr, sharedNTags[i]*BL_SPACEDIM, dMap[i]); } // // Remove duplicate IntVects. // std::sort(TheCollateSpace, TheCollateSpace+numtags, IntVectComp()); IntVect* end = std::unique(TheCollateSpace,TheCollateSpace+numtags); ptrdiff_t duplicates = (TheCollateSpace+numtags) - end; BL_ASSERT(duplicates >= 0); numtags -= duplicates; return TheCollateSpace; } void TagBoxArray::setVal (const BoxDomain& bd, TagBox::TagVal val) { for (MFIter fai(*this); fai.isValid(); ++fai) { for (BoxDomain::const_iterator bdi = bd.begin(); bdi != bd.end(); ++bdi) { Box isect = *bdi & fai.validbox(); if (isect.ok()) { get(fai).setVal(val,isect,0); } } } } void TagBoxArray::setVal (const BoxArray& ba, TagBox::TagVal val) { for (MFIter fai(*this); fai.isValid(); ++fai) { for (int j = 0; j < ba.size(); j++) { Box isect = fai.validbox() & ba[j]; if (isect.ok()) { get(fai).setVal(val,isect,0); } } } } void TagBoxArray::coarsen (const IntVect & ratio) { for (MFIter fai(*this); fai.isValid(); ++fai) { TagBox* tfine = fabparray.remove(fai.index()); TagBox* tcrse = tfine->coarsen(ratio); fabparray.set(fai.index(),tcrse); delete tfine; } boxarray.coarsen(ratio); m_border = 0; } ccseapps-2.5/CCSEApps/amrlib/INTERP_2D.F0000644000175000017500000017354511634153073020601 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: INTERP_2D.F,v 1.23 2002/12/11 20:43:22 almgren Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "INTERP_F.H" #include #define IX_PROJ(A,B) (A+B*iabs(A))/B-iabs(A) #define SDIM 2 c ::: -------------------------------------------------------------- c ::: nbinterp: node based bilinear interpolation c ::: c ::: INPUTS/OUTPUTS c ::: fine <=> (modify) fine grid array c ::: DIMS(fine) => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: c ::: crse => (const) coarse grid data widened by 1 zone c ::: DIMS(crse) => (const) index limits of coarse grid c ::: c ::: lratio(3) => (const) refinement ratio between levels c ::: nvar => (const) number of components in array c ::: num_slp => (const) number of types of slopes c ::: c ::: TEMPORARY ARRAYS c ::: sl => num_slp 1-D slope arrays c ::: -------------------------------------------------------------- c ::: subroutine FORT_NBINTERP (crse, DIMS(crse), DIMS(cb), $ fine, DIMS(fine), DIMS(fb), $ lratiox, lratioy, nvar, $ sl, num_slp) integer DIMDEC(crse) integer DIMDEC(cb) integer DIMDEC(fine) integer DIMDEC(fb) integer lratiox, lratioy, nvar integer num_slp REAL_T fine(DIMV(fine),nvar) REAL_T crse(DIMV(crse),nvar) REAL_T sl(DIM1(cb),num_slp) #define SLX 1 #define SLY 2 #define SLXY 3 c ::: local var integer lx, ly integer i, j, ifn, jfn, n integer ilo, ihi, jlo, jhi integer jstrtFine, jstopFine, istrtFine, istopFine REAL_T fx, fy REAL_T RX, RY, RXY REAL_T dx0, d0x, dx1 REAL_T slope slope(i,j,n,fx,fy) = crse(i,j,n) + & fx*sl(i,SLX) + fy*sl(i,SLY) + fx*fy*sl(i,SLXY) RX = one/dble(lratiox) RY = one/dble(lratioy) RXY = RX*RY c c NOTES: c 1) (i, j) loop over the coarse cells c 2) ?strtFine and ?stopFine are the beginning and ending fine cell c indices corresponding to the current coarse cell. ?stopFine c is restricted for the last coarse cell in each direction since c for this cell we only need to do the face and not the fine nodes c inside this cell. c 3) (lx, ly) as well as ?lo and ?hi refer to the fine node indices c as an offset from ?strtFine. c do 100 n = 1, nvar do 120 j = ARG_L2(cb), ARG_H2(cb) jstrtFine = j * lratioy jstopFine = jstrtFine + lratioy - 1 if (j .eq. ARG_H2(cb)) jstopFine = jstrtFine jlo = max(ARG_L2(fb),jstrtFine) - jstrtFine jhi = min(ARG_H2(fb),jstopFine) - jstrtFine c c ::::: compute slopes ::::: c c NOTE: The IF logic in the calculation of the slopes is to c prevent stepping out of bounds on the coarse data when c computing the slopes on the ARG_H?(cb) cells. These c slopes actually are not used since they are multiplied by c zero. c do i = ARG_L1(cb), ARG_H1(cb) dx0 = zero if (i .NE. ARG_H1(cb)) dx0 = crse(i+1,j,n) - crse(i,j,n) d0x = zero if (j .NE. ARG_H2(cb)) d0x = crse(i,j+1,n) - crse(i,j,n) dx1 = zero if (i .NE. ARG_H1(cb) .and. j .NE. ARG_H2(cb)) $ dx1 = crse(i+1,j+1,n) - crse(i,j+1,n) sl(i,SLX) = RX*dx0 sl(i,SLY) = RY*d0x sl(i,SLXY) = RXY*(dx1 - dx0) end do c c ::::: compute fine strip of interpolated data c do ly = jlo, jhi jfn = lratioy * j + ly fy = dble(ly) do i = ARG_L1(cb), ARG_H1(cb) istrtFine = i * lratiox istopFine = istrtFine + lratiox - 1 if (i .eq. ARG_H1(cb)) istopFine = istrtFine ilo = max(ARG_L1(fb),istrtFine) - istrtFine ihi = min(ARG_H1(fb),istopFine) - istrtFine do lx = ilo, ihi ifn = lratiox * i + lx fx = dble(lx) fine(ifn,jfn,n) = slope(i,j,n,fx,fy) end do end do end do c ::::: end of do j 120 continue c ::::: end of do n 100 continue #undef SLX #undef SLY #undef SLXY end c ::: c ::: -------------------------------------------------------------- c ::: cbinterp: cell centered bilinear interpolation c ::: c ::: NOTE: it is assumed that the coarse grid array is c ::: large enough to define interpolated values c ::: in the region fblo:fbhi on the fine grid c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: DIMS(fine) => (const) index limits of fine grid c ::: DIMS(fb) => (const) subregion of fine grid to get values c ::: c ::: crse => (const) coarse grid data c ::: DIMS(crse) => (const) index limits of coarse grid c ::: c ::: lratio(2) => (const) refinement ratio between levels c ::: nvar => (const) number of components in array c ::: c ::: TEMPORARY ARRAYS c ::: slx,sly,slxy => 1-D slope arrays c ::: strip => 1-D temp array c ::: -------------------------------------------------------------- c ::: subroutine FORT_CBINTERP (crse, DIMS(crse), DIMS(cb), $ fine, DIMS(fine), DIMS(fb), $ lratiox, lratioy, nvar, $ sl, num_slp, strip, strip_lo, strip_hi) integer DIMDEC(crse) integer DIMDEC(cb) integer DIMDEC(fine) integer DIMDEC(fb) integer lratiox, lratioy, nvar integer num_slp integer strip_lo, strip_hi REAL_T fine(DIMV(fine), nvar) REAL_T crse(DIMV(crse), nvar) REAL_T sl(DIM1(cb),num_slp) REAL_T strip(strip_lo:strip_hi) #define SLX 1 #define SLY 2 #define SLXY 3 c ::: local var integer lx, ly, hratx, hraty, ic, jc, jfn, jfc, i, j, n REAL_T x, y, denomx, denomy denomx = one/dble(2*lratiox) denomy = one/dble(2*lratioy) hratx = lratiox/2 hraty = lratioy/2 do n = 1, nvar do jc = ARG_L2(cb), ARG_H2(cb)-1 c ::: first fill a strip that will fit do ic = ARG_L1(cb), ARG_H1(cb)-1 sl(ic,SLX) = crse(ic+1,jc,n)-crse(ic,jc,n) sl(ic,SLY) = crse(ic,jc+1,n)-crse(ic,jc,n) sl(ic,SLXY) = crse(ic+1,jc+1,n)-crse(ic+1,jc,n) $ - crse(ic ,jc+1,n)+crse(ic ,jc,n) end do do ly = 0, lratioy-1 jfn = jc*lratioy + ly jfc = jfn + hraty if (jfc .ge. ARG_L2(fb) .and. jfc .le. ARG_H2(fb)) then y = denomy*(two*ly + one) do lx = 0, lratiox-1 do ic = ARG_L1(cb), ARG_H1(cb)-1 i = ic*lratiox + lx x = denomx*(two*lx + one) strip(i) = crse(ic,jc,n) + x*sl(ic,SLX) + $ y*sl(ic,SLY) + x*y*sl(ic,SLXY) end do end do c ::: stuff into output array do i = ARG_L1(fb), ARG_H1(fb) fine(i,jfc,n) = strip(i-hratx) end do end if end do end do end do end #undef SLX #undef SLY #undef SLXY c ::: c ::: -------------------------------------------------------------- c ::: ccinterp: conservative interpolation from coarse grid to c ::: subregion of fine grid defined by (fblo,fbhi) c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: nvar => (const) number of variables in state vector c ::: lratio(2) => (const) refinement ratio between levels c ::: c ::: crse => (const) coarse grid data widended by 1 zone c ::: and unrolled c ::: clo,chi => (const) one dimensional limits of crse grid c ::: cslo,cshi => (const) coarse grid index limits where c ::: slopes are to be defined. This is c ::: the projection of (fblo,fbhi) down c ::: to the coarse level c ::: fslo,fshi => (const) fine grid index limits where c ::: slopes are needed. This is the c ::: refinement of (cslo,cshi) and c ::: contains but may not be identical c ::: to (fblo,fbhi). c ::: cslope => (modify) temp array coarse grid slopes c ::: clen => (const) length of coarse gtid slopes c ::: fslope => (modify) temp array for fine grid slope c ::: flen => (const) length of fine grid slope array c ::: fdat => (const) temp array for fine grid data c ::: limslope => (const) != 0 => limit slopes c ::: c ::: NOTE: data must be sent in so that c ::: cslope(1,*) and crse(1,*) are associated with c ::: the same cell c ::: c ::: EXAMPLE: c ::: Suppose the patch called "fine" has index extent: c ::: c ::: floi1 = 3, fhii1 = 12 c ::: floi2 = 8, fhii2 = 20 c ::: c ::: suppose the subergion of this patch that is to be filled c ::: by interpolation has index extent: c ::: c ::: fblo(1) = 5, fbhi(1) = 10 c ::: fblo(2) = 13, fbhi(2) = 20 c ::: c ::: suppose the refinement ratio is 2 c ::: c ::: Then the coarsening of this subregion (to level 0) is c ::: c ::: cb_l1 = 2 cb_h1 = 5 (ncbx = 4) c ::: cb_l2 = 6 cb_h2 = 10 (ncby = 5) c ::: c ::: In order to compute slopes, we need one extra row of c ::: coarse grid zones: c ::: c ::: cslo(1) = 1 cshi(1) = 6 (ncsx = 6) c ::: cslo(2) = 5 cshi(2) = 11 (ncsy = 7) c ::: c ::: This is the size of the coarse grid array of data that filpatch c ::: has filled at level 0. c ::: The "cslope" and "crse" arrays are this size. c ::: c ::: In order to unroll the slope calculation we make these arrays look c ::: like 1-D arrays. The mapping from 2-D to 1-D is as fillows: c ::: c ::: The point (cb_l(1),cb_l(2)) -> 1 c ::: The point (cslo(1),cslo(2)) -> clo = 1 - 1 - ncsx = -6 c ::: c ::: The point (cb_h1,cb_h2) -> clen = ncby*ncsx - 2 = 5*6-2 = 28 c ::: The point (cshi(1),cshi(2)) -> chi = clo + ncsx*ncsy - 1 c ::: = -6 + 6*7 - 1 = 35 c ::: c ::: ------------------------------------------------- c ::: | | | | | | chi | c ::: 11 | 30 | 31 | 32 | 33 | 34 | 35 | cshi(2) c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | clen | | c ::: 10 | 24 | 25 | 26 | 27 | 28 | 29 | cb_h(2) c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 9 | 18 | 19 | 20 | 21 | 22 | 23 | c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 8 | 12 | 13 | 14 | 15 | 16 | 17 | c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 7 | 6 | 7 | 8 | 9 | 10 | 11 | c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 6 | 0 | 1 | 2 | 3 | 4 | 5 | cb_l(2) c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | clo | | | | | | c ::: 5 | -6 | -5 | -4 | -3 | -2 | -1 | cslo(2) c ::: | | | | | | | c ::: ------------------------------------------------- c ::: 1 2 3 4 5 6 c ::: cb_l1 cb_h1 c ::: cslo(1) cshi(1) c ::: c ::: c ::: In the 1-D coordinates: c ::: ist = 1 = stride in I direction c ::: jst = 6 = stride in J direction (ncsx) c ::: c ::: -------------------------------------------------------------- c ::: subroutine FORT_CCINTERP (fine, DIMS(fine), $ fb_l1, fb_l2, fb_h1, fb_h2, $ nvar, lratiox, lratioy, crse, clo, chi, $ cb_l1, cb_l2, cb_h1, cb_h2, $ fslo, fshi, cslope, clen, fslope, fdat, $ flen, voff, bc, limslope, $ fvcx, fvcy, cvcx, cvcy, $ cmax, cmin, alpha) integer DIMDEC(fine) integer fslo(2), fshi(2) integer fb_l1, fb_l2, fb_h1, fb_h2 integer cb_l1, cb_l2, cb_h1, cb_h2 integer clo, chi integer lratiox, lratioy, nvar, clen, flen, limslope integer bc(2,2,nvar) REAL_T fine(DIMV(fine),nvar) REAL_T crse(clo:chi, nvar) REAL_T cslope(clo:chi, 2) REAL_T cmax(clo:chi) REAL_T cmin(clo:chi) REAL_T alpha(clo:chi) REAL_T fslope(flen, 2) REAL_T fdat(flen) REAL_T voff(flen) REAL_T fvcx(fb_l1:fb_h1+1) REAL_T fvcy(fb_l2:fb_h2+1) REAL_T cvcx(cb_l1:cb_h1+1) REAL_T cvcy(cb_l2:cb_h2+1) #define bclo(i,n) bc(i,1,n) #define bchi(i,n) bc(i,2,n) c ::: local var integer n, fn integer i, ic, ioff integer j, jc, joff integer ist, jst integer cslo(2),cshi(2) REAL_T cen, forw, back, slp, sgn REAL_T fcen, ccen REAL_T xoff, yoff REAL_T corr_fact REAL_T orig_corr_fact integer ncbx, ncby integer ncsx, ncsy integer islo, jslo integer icc, istart, iend logical xok, yok c ::: helpful statement function integer sloc sloc(i,j) = clo+i-cslo(1) + ncsx*(j-cslo(2)) cslo(1) = cb_l1-1 cslo(2) = cb_l2-1 cshi(1) = cb_h1+1 cshi(2) = cb_h2+1 ncbx = cb_h1-cb_l1+1 ncby = cb_h2-cb_l2+1 xok = (ncbx .ge. 2) yok = (ncby .ge. 2) ncsx = ncbx+2 ncsy = ncby+2 ist = 1 jst = ncsx islo = cb_l1-1 jslo = cb_l2-1 do i = fb_l1, fb_h1 fn = i-fslo(1)+1 ic = IX_PROJ(i,lratiox) fcen = half*(fvcx(i)+fvcx(i+1)) ccen = half*(cvcx(ic)+cvcx(ic+1)) voff(fn) = (fcen-ccen)/(cvcx(ic+1)-cvcx(ic)) end do c ::: ::::: added to prevent underflow for small crse values do n = 1, nvar do i = clo, chi crse(i,n) = cvmgt(crse(i,n),zero,abs(crse(i,n)).gt.1.0D-20) end do end do do 290 n = 1, nvar do i = 1,clen alpha(i) = 1.d0 cmax(i) = crse(i,n) cmin(i) = crse(i,n) do joff = -jst,jst,jst do ioff = -ist,ist,ist cmax(i) = max(cmax(i),crse(i+ioff+joff,n)) cmin(i) = min(cmin(i),crse(i+ioff+joff,n)) enddo enddo end do c ::: ::::: compute slopes in x direction if (limslope .ne. 0) then do i = 1, clen cen = half*(crse(i+ist,n)-crse(i-ist,n)) forw = two*(crse(i+ist,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-ist,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,1)=sign(one,cen)*min(slp,abs(cen)) end do if (xok) then if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then do i = 1, clen, jst cen = -sixteen/fifteen*crse(i-ist,n) + half*crse(i,n) $ + two3rd*crse(i+ist,n) - tenth*crse(i+2*ist,n) sgn = sign(one,cen) forw = two*(crse(i+ist,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-ist,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,1)=sgn*min(slp,abs(cen)) end do end if if (bchi(1,n) .eq. EXT_DIR .or. bchi(1,n).eq.HOEXTRAP) then do i = ncbx, clen, jst cen = sixteen/fifteen*crse(i+ist,n) - half*crse(i,n) $ - two3rd*crse(i-ist,n) + tenth*crse(i-2*ist,n) sgn = sign(one,cen) forw = two*(crse(i+ist,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-ist,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,1)=sgn*min(slp,abs(cen)) end do end if end if else do i = 1, clen cen = half*(crse(i+ist,n)-crse(i-ist,n)) cslope(i,1)=cen end do if (xok) then if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then do i = 1, clen, jst cen = -sixteen/fifteen*crse(i-ist,n) + half*crse(i,n) $ + two3rd*crse(i+ist,n) - tenth*crse(i+2*ist,n) cslope(i,1)=cen end do end if if (bchi(1,n) .eq. EXT_DIR .or. bchi(1,n).eq.HOEXTRAP) then do i = ncbx, clen, jst cen = sixteen/fifteen*crse(i+ist,n) - half*crse(i,n) $ - two3rd*crse(i-ist,n) + tenth*crse(i-2*ist,n) cslope(i,1)=cen end do end if end if end if c ::: ::::: compute slopes in y direction if (limslope .ne. 0) then do i = 1, clen cen = half*(crse(i+jst,n)-crse(i-jst,n)) forw = two*(crse(i+jst,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-jst,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,2)=sign(one,cen)*min(slp,abs(cen)) end do if (yok) then if (bclo(2,n) .eq. EXT_DIR .or. bclo(2,n).eq.HOEXTRAP) then do i = 1, ncbx cen = -sixteen/fifteen*crse(i-jst,n) + half*crse(i,n) $ + two3rd*crse(i+jst,n) - tenth*crse(i+2*jst,n) sgn = sign(one,cen) forw = two*(crse(i+jst,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-jst,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,2)=sgn*min(slp,abs(cen)) end do end if if (bchi(2,n) .eq. EXT_DIR .or. bchi(2,n).eq.HOEXTRAP) then do i = clen-ncbx,clen cen = sixteen/fifteen*crse(i+jst,n) - half*crse(i,n) $ - two3rd*crse(i-jst,n) + tenth*crse(i-2*jst,n) sgn = sign(one,cen) forw = two*(crse(i+jst,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-jst,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,2)=sgn*min(slp,abs(cen)) end do end if end if else do i = 1, clen cen = half*(crse(i+jst,n)-crse(i-jst,n)) cslope(i,2)=cen end do if (yok) then if (bclo(2,n) .eq. EXT_DIR .or. bclo(2,n).eq.HOEXTRAP) then do i = 1, ncbx cen = -sixteen/fifteen*crse(i-jst,n) + half*crse(i,n) $ + two3rd*crse(i+jst,n) - tenth*crse(i+2*jst,n) cslope(i,2)=cen end do end if if (bchi(2,n) .eq. EXT_DIR .or. bchi(2,n).eq.HOEXTRAP) then do i = clen-ncbx,clen cen = sixteen/fifteen*crse(i+jst,n) - half*crse(i,n) $ - two3rd*crse(i-jst,n) + tenth*crse(i-2*jst,n) cslope(i,2)=cen end do end if end if end if do 360 jc = cb_l2, cb_h2 c ::::: strip out a fine grid slope vector do 370 ioff = 1, lratiox icc = clo + ist + jst*(jc-jslo) istart = ioff iend = ioff + (ncbx-1)*lratiox do 380 fn = istart, iend, lratiox fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fdat(fn) = crse(icc,n) icc = icc + ist 380 continue 370 continue c Limit slopes so as to not introduce new maxs or mins. do 385 joff = 0, lratioy-1 j = lratioy*jc + joff if ((j.lt.fb_l2).or.(j.gt.fb_h2)) goto 385 fcen = half*(fvcy(j)+fvcy(j+1)) ccen = half*(cvcy(jc)+cvcy(jc+1)) yoff = (fcen-ccen)/(cvcy(jc+1)-cvcy(jc)) do 387 i = fb_l1, fb_h1 fn = i-fslo(1)+1 orig_corr_fact = voff(fn)*fslope(fn,1) & + yoff *fslope(fn,2) fine(i,j,n) = fdat(fn) + orig_corr_fact ic = IX_PROJ(i,lratiox) icc = sloc(ic,jc) if ((fine(i,j,n) .gt. cmax(icc)) .and. $ (abs(orig_corr_fact) .gt. 1.e-10*abs(fdat(fn)))) then corr_fact = (cmax(icc) - fdat(fn)) / orig_corr_fact alpha(icc) = min(alpha(icc),corr_fact) endif if ((fine(i,j,n) .lt. cmin(icc)) .and. $ (abs(orig_corr_fact) .gt. 1.e-10*abs(fdat(fn)))) then corr_fact = (cmin(icc) - fdat(fn)) / orig_corr_fact alpha(icc) = min(alpha(icc),corr_fact) endif #ifndef NDEBUG if (alpha(icc) .lt. 0.d0) then print *,'OOPS - ALPHA SHOULD BE POSITIVE IN CCINTERP ' print *,'ICC = ',icc print *,'ALPHA = ',alpha(icc) print *,'ORIG_CORR_FACT = ',orig_corr_fact call bl_abort(" ") endif if (alpha(icc) .gt. 1.d0) then print *,'OOPS - ALPHA SHOULD BE <= 1.0 IN CCINTERP ' print *,'ICC = ',icc print *,'ALPHA = ',alpha(icc) print *,'ORIG_CORR_FACT = ',orig_corr_fact call bl_abort(" ") endif #endif 387 continue 385 continue c Now interpolate to fine grid for real. do 390 joff = 0, lratioy-1 j = lratioy*jc + joff if ((j.lt.fb_l2).or.(j.gt.fb_h2)) goto 390 fcen = half*(fvcy(j)+fvcy(j+1)) ccen = half*(cvcy(jc)+cvcy(jc+1)) yoff = (fcen-ccen)/(cvcy(jc+1)-cvcy(jc)) do 400 i = fb_l1, fb_h1 fn = i-fslo(1)+1 ic = IX_PROJ(i,lratiox) icc = sloc(ic,jc) fine(i,j,n) = fdat(fn) + alpha(icc) * & ( voff(fn)*fslope(fn,1) & +yoff *fslope(fn,2) ) 400 continue 390 continue 360 continue 290 continue end c ::: c ::: -------------------------------------------------------------- c ::: linccinterp: linear conservative interpolation from coarse grid to c ::: subregion of fine grid defined by (fblo,fbhi) c ::: c ::: The interpolation is linear in that it uses a c ::: a limiting scheme that preserves the value of c ::: any linear combination of the c ::: coarse grid data components--e.g., c ::: if sum_ivar a(ic,jc,ivar)*fab(ic,jc,ivar) = 0, then c ::: sum_ivar a(ic,jc,ivar)*fab(if,jf,ivar) = 0 is satisfied c ::: in all fine cells if,jf covering coarse cell ic,jc. c ::: c ::: If lin_limit = 0, the interpolation scheme is identical to c ::: the used in ccinterp for limslope=1; the results should c ::: be exactly the same -- difference = hard 0. c ::: c ::: Unlike FORT_CCINTERP, this routine does not do any clever unrolling c ::: and it does not use any 1-d strip--all calculations are done c ::: on full 2-d arrays. The onlu concession to vectorization c ::: is that the innermost loops are longest. c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: nvar => (const) number of variables in state vector c ::: lratio(2) => (const) refinement ratio between levels c ::: c ::: crse => (const) coarse grid data widended by 1 zone c ::: clo,chi => (const) index limits of crse grid c ::: cslo,cshi => (const) coarse grid index limits where c ::: slopes are to be defined. This is c ::: the projection of (fblo,fbhi) down c ::: to the coarse level c ::: ucslope => (modify) temp array of unlimited coarse grid slopes c ::: lcslope => (modify) temp array of limited coarse grid slopes c ::: slope_factor => (modify) temp array of slope limiting factors c ::: lin_limit => (const) != 0 => do linear slope limiting scheme c ::: c ::: -------------------------------------------------------------- c ::: subroutine FORT_LINCCINTERP (fine, DIMS(fine), fblo, fbhi, & DIMS(fvcb), & crse, DIMS(crse), DIMS(cvcb), & uc_xslope, lc_xslope, xslope_factor, & uc_yslope, lc_yslope, yslope_factor, & DIMS(cslope), & cslopelo, cslopehi, $ nvar, lratiox, lratioy, $ bc, lin_limit, $ fvcx, fvcy, cvcx, cvcy, & voffx, voffy) implicit none integer DIMDEC(fine) integer DIMDEC(crse) integer DIMDEC(fvcb) integer DIMDEC(cvcb) integer DIMDEC(cslope) integer fblo(2), fbhi(2) integer cslopelo(2), cslopehi(2) integer lratiox, lratioy, nvar, lin_limit integer bc(2,2,nvar) REAL_T fine(DIMV(fine),nvar) REAL_T crse(DIMV(crse), nvar) REAL_T uc_xslope(DIMV(cslope),nvar) REAL_T lc_xslope(DIMV(cslope),nvar) REAL_T xslope_factor(DIMV(cslope)) REAL_T uc_yslope(DIMV(cslope),nvar) REAL_T lc_yslope(DIMV(cslope),nvar) REAL_T yslope_factor(DIMV(cslope)) REAL_T fvcx(DIM1(fvcb)) REAL_T fvcy(DIM2(fvcb)) REAL_T voffx(DIM1(fvcb)) REAL_T voffy(DIM2(fvcb)) REAL_T cvcx(DIM1(cvcb)) REAL_T cvcy(DIM2(cvcb)) #define bclo(i,n) bc(i,1,n) #define bchi(i,n) bc(i,2,n) c ::: local var integer n integer i, ic integer j, jc REAL_T cen, forw, back, slp, sgn REAL_T factorn, denom, slope_factor, dummy REAL_T fxcen, cxcen, fycen, cycen logical xok, yok integer ncbx, ncby ncbx = cslopehi(1)-cslopelo(1)+1 ncby = cslopehi(2)-cslopelo(2)+1 xok = (ncbx .ge. 2) yok = (ncby .ge. 2) do j = fblo(2), fbhi(2) jc = IX_PROJ(j,lratioy) fycen = half*(fvcy(j)+fvcy(j+1)) cycen = half*(cvcy(jc)+cvcy(jc+1)) voffy(j) = (fycen-cycen)/(cvcy(jc+1)-cvcy(jc)) end do do i = fblo(1), fbhi(1) ic = IX_PROJ(i,lratiox) fxcen = half*(fvcx(i)+fvcx(i+1)) cxcen = half*(cvcx(ic)+cvcx(ic+1)) voffx(i) = (fxcen-cxcen)/(cvcx(ic+1)-cvcx(ic)) end do if(ncbx.gt.ncby)then c=============== CASE 1: x direction is long direction =================== c ... added to prevent underflow for small crse values do n = 1, nvar do j = cslopelo(2)-1,cslopehi(2)+1 do i = cslopelo(1)-1, cslopehi(1)+1 crse(i,j,n) = cvmgt(crse(i,j,n),zero,abs(crse(i,j,n)).gt.1.0e-20) end do end do end do c ... computed unlimited and limited slopes do n = 1, nvar c ... --> in x direction do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) uc_xslope(i,j,n) = half*(crse(i+1,j,n)-crse(i-1,j,n)) c ... note: the following 6 lines of code is repeated in two other places. c A similar code snippet appears three times in the y slope c calculation. Although it looks wasteful, writing the code c this way sped up the routine by ~10% (on DEC-alpha). So leave c it alone unless you can make it faster -- rbp cen = uc_xslope(i,j,n) forw = two*(crse(i+1,j,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i-1,j,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end do if (xok) then if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then i = cslopelo(1) do j=cslopelo(2), cslopehi(2) uc_xslope(i,j,n) = -sixteen/fifteen*crse(i-1,j,n) & + half*crse(i,j,n) $ + two3rd*crse(i+1,j,n) - tenth*crse(i+2,j,n) cen = uc_xslope(i,j,n) forw = two*(crse(i+1,j,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i-1,j,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end if if (bchi(1,n) .eq. EXT_DIR .or. bchi(1,n).eq.HOEXTRAP) then i = cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_xslope(i,j,n) = sixteen/fifteen*crse(i+1,j,n) & - half*crse(i,j,n) $ - two3rd*crse(i-1,j,n) + tenth*crse(i-2,j,n) cen = uc_xslope(i,j,n) forw = two*(crse(i+1,j,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i-1,j,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end if end if c ... --> in y direction do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) uc_yslope(i,j,n) = half*(crse(i,j+1,n)-crse(i,j-1,n)) cen = uc_yslope(i,j,n) forw = two*(crse(i,j+1,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i,j-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end do if (yok) then if (bclo(2,n) .eq. EXT_DIR .or. bclo(2,n).eq.HOEXTRAP) then j = cslopelo(2) do i=cslopelo(1), cslopehi(1) uc_yslope(i,j,n) = -sixteen/fifteen*crse(i,j-1,n) & + half*crse(i,j,n) $ + two3rd*crse(i,j+1,n) - tenth*crse(i,j+2,n) cen = uc_yslope(i,j,n) forw = two*(crse(i,j+1,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i,j-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end if if (bchi(2,n) .eq. EXT_DIR .or. bchi(2,n).eq.HOEXTRAP) then j = cslopehi(2) do i=cslopelo(1), cslopehi(1) uc_yslope(i,j,n) = sixteen/fifteen*crse(i,j+1,n) & - half*crse(i,j,n) $ - two3rd*crse(i,j-1,n) + tenth*crse(i,j-2,n) cen = uc_yslope(i,j,n) forw = two*(crse(i,j+1,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i,j-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end if end if end do if (lin_limit.eq.1)then c ... compute linear limited slopes c Note that the limited and the unlimited slopes c have the same sign, and it is assumed that they do. c ... --> compute slope factors do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) xslope_factor(i,j) = one yslope_factor(i,j) = one end do end do do n = 1, nvar do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) denom = uc_xslope(i,j,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_xslope(i,j,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) xslope_factor(i,j) = min(xslope_factor(i,j),factorn) denom = uc_yslope(i,j,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_yslope(i,j,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) yslope_factor(i,j) = min(yslope_factor(i,j),factorn) end do end do end do c ... --> compute linear limited slopes do n = 1, nvar do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) lc_xslope(i,j,n) = xslope_factor(i,j)*uc_xslope(i,j,n) lc_yslope(i,j,n) = yslope_factor(i,j)*uc_yslope(i,j,n) end do end do end do end if c ... do the interpolation do n = 1, nvar do j = fblo(2), fbhi(2) jc = IX_PROJ(j,lratioy) do i = fblo(1), fbhi(1) ic = IX_PROJ(i,lratiox) fine(i,j,n) = crse(ic,jc,n) + voffx(i)*lc_xslope(ic,jc,n) & + voffy(j)*lc_yslope(ic,jc,n) end do end do end do else c=============== CASE 2: y direction is long direction =================== c ... added to prevent underflow for small crse values do n = 1, nvar do i = cslopelo(1)-1, cslopehi(1)+1 do j = cslopelo(2)-1,cslopehi(2)+1 crse(i,j,n) = cvmgt(crse(i,j,n),zero,abs(crse(i,j,n)).gt.1.0e-20) end do end do end do c ... computed unlimited and limited slopes do n = 1, nvar c ... --> in x direction do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_xslope(i,j,n) = half*(crse(i+1,j,n)-crse(i-1,j,n)) cen = uc_xslope(i,j,n) forw = two*(crse(i+1,j,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i-1,j,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end do if (xok) then if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then i = cslopelo(1) do j=cslopelo(2), cslopehi(2) uc_xslope(i,j,n) = -sixteen/fifteen*crse(i-1,j,n) & + half*crse(i,j,n) $ + two3rd*crse(i+1,j,n) - tenth*crse(i+2,j,n) cen = uc_xslope(i,j,n) forw = two*(crse(i+1,j,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i-1,j,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end if if (bchi(1,n) .eq. EXT_DIR .or. bchi(1,n).eq.HOEXTRAP) then i = cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_xslope(i,j,n) = sixteen/fifteen*crse(i+1,j,n) & - half*crse(i,j,n) $ - two3rd*crse(i-1,j,n) + tenth*crse(i-2,j,n) cen = uc_xslope(i,j,n) forw = two*(crse(i+1,j,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i-1,j,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end if end if c ... --> in y direction do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_yslope(i,j,n) = half*(crse(i,j+1,n)-crse(i,j-1,n)) cen = uc_yslope(i,j,n) forw = two*(crse(i,j+1,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i,j-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end do if (yok) then if (bclo(2,n) .eq. EXT_DIR .or. bclo(2,n).eq.HOEXTRAP) then j = cslopelo(2) do i=cslopelo(1), cslopehi(1) uc_yslope(i,j,n) = -sixteen/fifteen*crse(i,j-1,n) & + half*crse(i,j,n) $ + two3rd*crse(i,j+1,n) - tenth*crse(i,j+2,n) cen = uc_yslope(i,j,n) forw = two*(crse(i,j+1,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i,j-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end if if (bchi(2,n) .eq. EXT_DIR .or. bchi(2,n).eq.HOEXTRAP) then j = cslopehi(2) do i=cslopelo(1), cslopehi(1) uc_yslope(i,j,n) = sixteen/fifteen*crse(i,j+1,n) & - half*crse(i,j,n) $ - two3rd*crse(i,j-1,n) + tenth*crse(i,j-2,n) cen = uc_yslope(i,j,n) forw = two*(crse(i,j+1,n)-crse(i,j,n)) back = two*(crse(i,j,n)-crse(i,j-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,n)=sign(one,cen)*min(slp,abs(cen)) end do end if end if end do if (lin_limit.eq.1)then c ... compute linear limited slopes c Note that the limited and the unlimited slopes c have the same sign, and it is assumed that they do. c ... --> compute slope factors do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) xslope_factor(i,j) = 1.0 yslope_factor(i,j) = 1.0 end do end do do n = 1, nvar do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) denom = uc_xslope(i,j,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_xslope(i,j,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) xslope_factor(i,j) = min(xslope_factor(i,j),factorn) denom = uc_yslope(i,j,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_yslope(i,j,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) yslope_factor(i,j) = min(yslope_factor(i,j),factorn) end do end do end do c ... --> compute linear limited slopes do n = 1, nvar do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) lc_xslope(i,j,n) = xslope_factor(i,j)*uc_xslope(i,j,n) lc_yslope(i,j,n) = yslope_factor(i,j)*uc_yslope(i,j,n) end do end do end do end if c ... do the interpolation do n = 1, nvar do i = fblo(1), fbhi(1) ic = IX_PROJ(i,lratiox) do j = fblo(2), fbhi(2) jc = IX_PROJ(j,lratioy) fine(i,j,n) = crse(ic,jc,n) + voffx(i)*lc_xslope(ic,jc,n) & + voffy(j)*lc_yslope(ic,jc,n) end do end do end do end if end c ::: c ::: -------------------------------------------------------------- c ::: subroutine FORT_CQINTERP (fine, DIMS(fine), $ fb_l1, fb_l2, fb_h1, fb_h2, $ nvar, lratiox, lratioy, crse, clo, chi, $ cb_l1, cb_l2, cb_h1, cb_h2, $ fslo, fshi, cslope, clen, fslope, fdat, $ flen, voff, bc, limslope, $ fvcx, fvcy, cvcx, cvcy) integer DIMDEC(fine) integer fslo(2), fshi(2) integer fb_l1, fb_l2, fb_h1, fb_h2 integer cb_l1, cb_l2, cb_h1, cb_h2 integer clo, chi integer lratiox, lratioy, nvar, clen, flen, limslope integer bc(2,2,nvar) REAL_T fine(DIMV(fine),nvar) REAL_T crse(clo:chi, nvar) REAL_T cslope(clo:chi, 5) REAL_T fslope(flen, 5) REAL_T fdat(flen) REAL_T voff(flen) REAL_T fvcx(fb_l1:fb_h1+1) REAL_T fvcy(fb_l2:fb_h2+1) REAL_T cvcx(cb_l1:cb_h1+1) REAL_T cvcy(cb_l2:cb_h2+1) #define bclo(i,n) bc(i,1,n) #define bchi(i,n) bc(i,2,n) c ::: local var integer n, fn integer i, ic, ioff integer j, jc, joff integer ist, jst REAL_T cen, forw, back, slp, sgn REAL_T fcen, ccen REAL_T diffxy,diffxx,diffyy REAL_T xoff, yoff integer ncbx, ncby integer ncsx, ncsy integer islo, jslo integer icc, istart, iend logical xok, yok ncbx = cb_h1-cb_l1+1 ncby = cb_h2-cb_l2+1 xok = (ncbx .ge. 2) yok = (ncby .ge. 2) ncsx = ncbx+2 ncsy = ncby+2 ist = 1 jst = ncsx islo = cb_l1-1 jslo = cb_l2-1 do i = fb_l1, fb_h1 fn = i-fslo(1)+1 ic = IX_PROJ(i,lratiox) fcen = half*(fvcx(i)+fvcx(i+1)) ccen = half*(cvcx(ic)+cvcx(ic+1)) voff(fn) = (fcen-ccen)/(cvcx(ic+1)-cvcx(ic)) end do c ::: ::::: added to prevent underflow for small crse values do n = 1, nvar do i = clo, chi crse(i,n) = cvmgt(crse(i,n),zero,abs(crse(i,n)).gt.1.0e-20) end do end do do 290 n = 1, nvar c ::: ::::: compute slopes in x direction do i = 1, clen cen = half*(crse(i+ist,n)-crse(i-ist,n)) diffxy = fourth*(crse(i+ist+jst,n)+crse(i-ist-jst,n) $ -crse(i-ist+jst,n)-crse(i+ist-jst,n)) diffxx = crse(i+ist,n)-two*crse(i,n)+crse(i-ist,n) cslope(i,1)=cen cslope(i,3)=diffxx cslope(i,5)=diffxy end do if (xok) then if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then do i = 1, clen, jst cen = -sixteen/fifteen*crse(i-ist,n) + half*crse(i,n) $ + two3rd*crse(i+ist,n) - tenth*crse(i+2*ist,n) cslope(i,1)=cen cslope(i,3)=zero cslope(i,5)=zero end do end if if (bchi(1,n) .eq. EXT_DIR .or. bchi(1,n).eq.HOEXTRAP) then do i = ncbx, clen, jst cen = sixteen/fifteen*crse(i+ist,n) - half*crse(i,n) $ - two3rd*crse(i-ist,n) + tenth*crse(i-2*ist,n) cslope(i,1)=cen cslope(i,3)=zero cslope(i,5)=zero end do end if end if c ::: ::::: compute slopes in y direction do i = 1, clen cen = half*(crse(i+jst,n)-crse(i-jst,n)) diffyy = crse(i+jst,n)-two*crse(i,n)+crse(i-jst,n) cslope(i,2)=cen cslope(i,4)=diffyy end do if (yok) then if (bclo(2,n) .eq. EXT_DIR .or. bclo(2,n).eq.HOEXTRAP) then do i = 1, ncbx cen = -sixteen/fifteen*crse(i-jst,n) + half*crse(i,n) $ + two3rd*crse(i+jst,n) - tenth*crse(i+2*jst,n) cslope(i,2)=cen cslope(i,4)=zero cslope(i,5)=zero end do end if if (bchi(2,n) .eq. EXT_DIR .or. bchi(2,n).eq.HOEXTRAP) then do i = clen-ncbx,clen cen = sixteen/fifteen*crse(i+jst,n) - half*crse(i,n) $ - two3rd*crse(i-jst,n) + tenth*crse(i-2*jst,n) cslope(i,2)=cen cslope(i,4)=zero cslope(i,5)=zero end do end if end if do 360 jc = cb_l2, cb_h2 c ::::: strip out a fine grid slope vector do 370 ioff = 1, lratiox icc = clo + ist + jst*(jc-jslo) istart = ioff iend = ioff + (ncbx-1)*lratiox do 380 fn = istart, iend, lratiox fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fslope(fn,3) = cslope(icc,3) fslope(fn,4) = cslope(icc,4) fslope(fn,5) = cslope(icc,5) fdat(fn) = crse(icc,n) icc = icc + ist 380 continue 370 continue do 390 joff = 0, lratioy-1 j = lratioy*jc + joff if ((j.lt.fb_l2).or.(j.gt.fb_h2)) goto 390 fcen = half*(fvcy(j)+fvcy(j+1)) ccen = half*(cvcy(jc)+cvcy(jc+1)) yoff = (fcen-ccen)/(cvcy(jc+1)-cvcy(jc)) do 400 i = fb_l1, fb_h1 fn = i-fslo(1)+1 fine(i,j,n) = fdat(fn) + voff(fn)*fslope(fn,1) & + voff(fn)*voff(fn)*fslope(fn,3) & + yoff*fslope(fn,2) & + yoff*yoff*fslope(fn,4) & + voff(fn)*yoff*fslope(fn,5) 400 continue 390 continue 360 continue 290 continue end c ::: c ::: -------------------------------------------------------------- c ::: pcinterp: cell centered piecewise constant interpolation c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: c ::: crse => (const) coarse grid data c ::: clo,chi => (const) index limits of coarse grid c ::: cblo,cbhi => (const) coarse grid region containing fblo,fbhi c ::: c ::: longdir => (const) which index direction is longest (1 or 2) c ::: lratio(2) => (const) refinement ratio between levels c ::: nvar => (const) number of components in array c ::: c ::: TEMPORARY ARRAYS c ::: ftmp => 1-D temp array c ::: -------------------------------------------------------------- c ::: subroutine FORT_PCINTERP (crse,DIMS(crse),cblo,cbhi, & fine,DIMS(fine),fblo,fbhi, & longdir,lratiox,lratioy,nvar, & ftmp,ftmp_lo,ftmp_hi) integer DIMDEC(crse) integer cblo(2), cbhi(2) integer DIMDEC(fine) integer fblo(2), fbhi(2) integer ftmp_lo, ftmp_hi integer nvar, lratiox, lratioy, longdir REAL_T crse(DIMV(crse), nvar) REAL_T fine(DIMV(fine), nvar) REAL_T ftmp(ftmp_lo:ftmp_hi) integer i, j, ic, jc, ioff, joff, n if (longdir .eq. 1) then do n = 1, nvar do jc = cblo(2), cbhi(2) j = jc*lratioy do ioff = 0, lratiox-1 do ic = cblo(1), cbhi(1) i = lratiox*ic + ioff ftmp(i) = crse(ic,jc,n) end do end do do joff = 0, lratioy-1 j = lratioy*jc + joff if (j.ge.fblo(2).and.j.le.fbhi(2)) then do i = fblo(1), fbhi(1) fine(i,j,n) = ftmp(i) end do end if end do end do end do else do n = 1, nvar do ic = cblo(1), cbhi(1) i = ic*lratiox do joff = 0, lratioy-1 do jc = cblo(2), cbhi(2) j = lratioy*jc + joff ftmp(j) = crse(ic,jc,n) end do end do do ioff = 0, lratiox-1 i = lratiox*ic + ioff if (i.ge.fblo(1).and.i.le.fbhi(1)) then do j = fblo(2), fbhi(2) fine(i,j,n) = ftmp(j) end do end if end do end do end do end if end c ::: c ::: -------------------------------------------------------------- c ::: protect_interp: redo interpolation if the result of linccinterp c ::: generates under- or overshoots. c ::: c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: cblo,cbhi => (const) coarse equivalent of fblo,fbhi c ::: nvar => (const) number of variables in state vector c ::: lratio(3) => (const) refinement ratio between levels c ::: c ::: crse => (const) coarse grid data widended by 1 zone c ::: clo,chi => (const) index limits of crse grid c ::: c ::: -------------------------------------------------------------- c ::: subroutine FORT_PROTECT_INTERP (fine, DIMS(fine), fblo, fbhi, & crse, DIMS(crse), cblo, cbhi, & fvcx, fvcy, & fb_l1, fb_l2, fb_h1, fb_h2, & cvcx, cvcy, & cb_l1, cb_l2, cb_h1, cb_h2, & fine_state, DIMS(state), & nvar, lratiox, lratioy, bc) implicit none integer DIMDEC(fine) integer DIMDEC(crse) integer DIMDEC(state) integer fblo(2), fbhi(2) integer cblo(2), cbhi(2) integer fb_l1, fb_l2, fb_h1, fb_h2 integer cb_l1, cb_l2, cb_h1, cb_h2 integer lratiox, lratioy, nvar integer bc(2,2,nvar) REAL_T fine(DIMV(fine),nvar) REAL_T crse(DIMV(crse), nvar) REAL_T fine_state(DIMV(state), nvar) REAL_T fvcx(fb_l1:fb_h1) REAL_T fvcy(fb_l2:fb_h2) REAL_T cvcx(cb_l1:cb_h1) REAL_T cvcy(cb_l2:cb_h2) REAL_T alpha, sumN, sumP, negVal, posVal REAL_T crseTot, crseTotnew REAL_T orig_fine(0:15,0:15) REAL_T fvol,cvol integer redo_me integer ilo,ihi,jlo,jhi integer i,j,ic,jc,n,nn integer icase do jc = cblo(2), cbhi(2) do ic = cblo(1), cbhi(1) ilo = max(lratiox*ic ,fine_l1) ihi = min(lratiox*ic+(lratiox-1),fine_h1) jlo = max(lratioy*jc ,fine_l2) jhi = min(lratioy*jc+(lratioy-1),fine_h2) do n = 2, nvar-1 redo_me = 0 do j = jlo,jhi do i = ilo,ihi if ((fine_state(i,j,n)+fine(i,j,n)) .lt. 0.d0) redo_me = 1 enddo enddo c c **************************************************************************************** c c If all the fine values are non-negative after the original interpolated c correction, then we do nothing here. c c If any of the fine values are negative after the original interpolated c correction, then we do our best. c c Special cases: c c 1) Coarse correction > 0, and fine_state has some cells with c negative values which will be filled before adding to the other cells. c Use the correction to bring negative cells to zero, then c distribute the remaining positive proportionally. c c 2) Coarse correction > 0, and correction can not make them all c positive. Add correction only to the negative cells, in proportion c to their magnitude. c c 3) Coarse correction < 0, and fine_state DOES NOT have enough c have enough positive state to absorb it. Here we bring c all the positive fine cells to zero then distribute the remaining c negative amount in such a way as to make them all as close to the c same negative value as possible. c c 4) Coarse correction < 0, fine_state has enough c positive state to absorb it without making any fine c cells negative, BUT fine_state+fine is currently negative c in at least one fine cell. Here just take a constant percentage c away from each positive and don't touch the negatives. c c crseTot = volume-weighted sum of all interpolated values of the correction, c which is equivalent to the total volume-weighted coarse correction c SumN = volume-weighted sum of all negative values of fine_state c SumP = volume-weighted sum of all positive values of fine_state c c **************************************************************************************** c if (redo_me .eq. 1) then icase = 0 do j = jlo,jhi do i = ilo,ihi orig_fine(i-ilo,j-jlo) = fine(i,j,n) enddo enddo crseTot = 0.d0 do j = jlo,jhi do i = ilo,ihi fvol = (fvcx(i+1)-fvcx(i)) * (fvcy(j+1)-fvcy(j)) crseTot = crseTot + fvol * fine(i,j,n) enddo enddo cvol = (cvcx(ic+1)-cvcx(ic)) * (cvcy(jc+1)-cvcy(jc)) sumN = zero sumP = zero do j = jlo,jhi do i = ilo,ihi fvol = (fvcx(i+1)-fvcx(i)) * (fvcy(j+1)-fvcy(j)) if (fine_state(i,j,n) .le. 0.d0) then sumN = SumN + fvol * fine_state(i,j,n) else sumP = sumP + fvol * fine_state(i,j,n) endif enddo enddo if (crseTot .gt. 0.d0 .and. crseTot .ge. abs(sumN)) then c Here we want to fill in the negative values first, then add c the remaining positive proportionally. icase = 1 do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,n) .le. 0.d0) then fine(i,j,n) = -fine_state(i,j,n) endif enddo enddo if (sumP > 0.d0) then alpha = (crseTot - abs(sumN)) / sumP do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,n) .ge. 0.d0) then fine(i,j,n) = alpha * fine_state(i,j,n) endif enddo enddo else posVal = (crseTot - abs(sumN)) / cvol do j = jlo,jhi do i = ilo,ihi fine(i,j,n) = fine(i,j,n) + posVal enddo enddo endif endif if (crseTot .gt. 0.d0. and. crseTot .lt. abs(sumN)) then c Here we don't have enough positive correction to fill all the c negative values of state, so we just try to fill them proportionally c and don't add any correction to the states already positive. icase = 2 alpha = crseTot / abs(sumN) do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,n) .lt. 0.d0) then fine(i,j,n) = alpha * abs(fine_state(i,j,n)) else fine(i,j,n) = 0.d0 endif enddo enddo endif if (crseTot .lt. 0.d0. and. abs(crseTot) .gt. sumP) then c Here we don't have enough positive states to absorb all the c negative correction, so we want to end up with all the fine c cells having the same negative value. icase = 3 negVal = (sumP + sumN + crseTot)/cvol do j = jlo,jhi do i = ilo,ihi fine(i,j,n) = negVal - fine_state(i,j,n) enddo enddo endif if (crseTot .lt. 0.d0 .and. abs(crseTot) .lt. sumP $ .and. (sumP+sumN+crseTot) .gt. 0.d0) then c Here we have enough positive states to absorb all the c negative correction *and* redistribute to make negative cells c positive. icase = 4 alpha = (crseTot + sumN) / sumP do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,n) .lt. 0.d0) then fine(i,j,n) = -fine_state(i,j,n) else fine(i,j,n) = alpha * fine_state(i,j,n) endif enddo enddo endif if (crseTot .lt. 0.d0. and. abs(crseTot) .lt. sumP $ .and. (sumP+sumN+crseTot) .le. 0.d0) then c Here we have enough positive states to absorb all the c negative correction, but not to fix the states already negative. c We bring all the positive states to zero, and use whatever c remaining positiveness from the states to help the negative states. icase = 5 alpha = (crseTot + sumP) / sumN do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,n) .gt. 0.d0) then fine(i,j,n) = -fine_state(i,j,n) else fine(i,j,n) = alpha * fine_state(i,j,n) endif enddo enddo endif crseTotnew = 0.d0 do j = jlo,jhi do i = ilo,ihi fvol = (fvcx(i+1)-fvcx(i)) * (fvcy(j+1)-fvcy(j)) crseTotnew = crseTotnew + fvol * fine(i,j,n) enddo enddo if (abs(crseTotnew - crseTot)/cvol .gt. 1.e-8) then print *,' ' print *,'BLEW CONSERVATION with ICASE = ',icase print *,'AT COARSE CELL ',ic,jc,' AND COMPONENT ',n print *,'CRSETOT NEW OLD ',crseTotnew, crseTot print *,'CVOL ',cvol print *,'SUMP SUMN ',sumP,sumN do j = jlo,jhi do i = ilo,ihi fvol = (fvcx(i+1)-fvcx(i)) * (fvcy(j+1)-fvcy(j)) print *,'FINE OLD NEW ',i,j,orig_fine(i-ilo,j-jlo), $ fine(i,j,n), fine_state(i,j,n), $ fvol if (abs(fvol) .lt. 1.e-20) then print *,'MAKING FVOL ',fvcx(i+1),fvcx(i),fvcy(j+1),fvcy(j) endif enddo enddo endif c do j = jlo,jhi c do i = ilo,ihi c if ((fine_state(i,j,n) + fine(i,j,n)) .lt. 0.d0) then c print *,'STILL NEGATIVE AT ',i,j,n c print *,'AT COARSE CELL ',ic,jc c print *,'FINE STATE ',fine_state(i,j,n) c print *,'FINE CORRECTION ',fine(i,j,n) c print *,'CRSETOT ',crseTot c print *,'SUMN / SUMP ',sumN, sumP c print *,' ' c endif c enddo c enddo c enddo c End (if redo .eq. 1) endif enddo c Set sync for density (n=1) to sum of spec sync (2:nvar-1) do j = jlo,jhi do i = ilo,ihi fine(i,j,1) = 0.d0 do n = 2,nvar-1 fine(i,j,1) = fine(i,j,1) + fine(i,j,n) enddo enddo enddo c End of coarse index loops enddo enddo end ccseapps-2.5/CCSEApps/amrlib/FLUXREG_2D.F0000644000175000017500000002702711634153073020705 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: FLUXREG_2D.F,v 1.8 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "FLUXREG_F.H" #include "ArrayLim.H" #define SDIM 2 c ::: ----------------------------------------------------------- c ::: Init coarse grid flux into flux register c ::: c ::: INPUTS/OUTPUTS: c ::: flx => flux array c ::: DIMS(flx) => index limits for flx c ::: reg <= flux register c ::: DIMS(reg) => index limits for reg c ::: lo,hi => region of update c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRCRSEINIT (reg,DIMS(reg),flx,DIMS(flx),lo,hi, & numcomp,dir,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer lo(SDIM), hi(SDIM) integer numcomp, dir REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) integer n, i, j do n = 1, numcomp do j = lo(2), hi(2) do i = lo(1), hi(1) reg(i,j,n) = mult*flx(i,j,n) end do end do end do end c ::: ----------------------------------------------------------- c ::: Init coarse grid flux (times area) into flux register c ::: c ::: INPUTS/OUTPUTS: c ::: flx => flux array c ::: DIMS(flx) => index limits for flx c ::: reg <= flux register c ::: DIMS(reg) => index limits for reg c ::: area => aread of cell edge c ::: DIMS(area) => index limits for area c ::: lo,hi => region of update c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRCAINIT (reg,DIMS(reg),flx,DIMS(flx), & area,DIMS(area),lo,hi, & numcomp,dir,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer DIMDEC(area) integer lo(SDIM), hi(SDIM) integer numcomp, dir REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) REAL_T area(DIMV(area)) integer n, i, j do n = 1, numcomp do j = lo(2), hi(2) do i = lo(1), hi(1) reg(i,j,n) = mult*area(i,j)*flx(i,j,n) end do end do end do end c ::: ----------------------------------------------------------- c ::: Add fine grid flux to flux register. Flux array is a fine grid c ::: edge based object, Register is a coarse grid edge based object. c ::: It is assumed that the coarsened flux region contains the register c ::: region. c ::: c ::: INPUTS/OUTPUTS: c ::: reg <=> edge centered coarse grid flux register c ::: DIMS(reg) => index limits for reg c ::: flx => edge centered fine grid flux array c ::: DIMS(flx) => index limits for flx c ::: numcomp => number of components to update c ::: dir => direction normal to flux register c ::: ratio(2) => refinement ratios between coarse and fine c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRFINEADD(reg,DIMS(reg),flx,DIMS(flx), & numcomp,dir,ratio,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer ratio(2), dir, numcomp REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) integer n, i, j, ic, jc, off integer ratiox, ratioy ratiox = ratio(1) ratioy = ratio(2) if (dir .eq. 0) then c ::::: flux normal to X direction ic = ARG_L1(reg) i = ic*ratiox if (ARG_L1(reg) .ne. ARG_H1(reg)) then call bl_abort("FORT_FRFINEADD: bad register direction") end if if (i .lt. ARG_L1(flx) .or. i .gt. ARG_H1(flx)) then call bl_abort("FORT_FRFINEADD: index outside flux range") end if do n = 1, numcomp do off = 0, ratioy-1 do jc = ARG_L2(reg), ARG_H2(reg) j = ratioy*jc + off reg(ic,jc,n) = reg(ic,jc,n) + mult*flx(i,j,n) end do end do end do else c ::::: flux normal to Y direction jc = ARG_L2(reg) j = jc*ratioy if (ARG_L2(reg) .ne. ARG_H2(reg)) then call bl_abort("FORT_FRFINEADD: bad register direction") end if if (j .lt. ARG_L2(flx) .or. j .gt. ARG_H2(flx)) then call bl_abort("FORT_FRFINEADD: index outside flux range") end if do n = 1, numcomp do off = 0, ratiox-1 do ic = ARG_L1(reg), ARG_H1(reg) i = ratiox*ic + off reg(ic,jc,n) = reg(ic,jc,n) + mult*flx(i,j,n) end do end do end do end if end c ::: ----------------------------------------------------------- c ::: Add fine grid flux times area to flux register. c ::: Flux array is a fine grid edge based object, Register is a c ::: coarse grid edge based object. c ::: It is assumed that the coarsened flux region contains the register c ::: region. c ::: c ::: INPUTS/OUTPUTS: c ::: reg <=> edge centered coarse grid flux register c ::: rlo,rhi => index limits for reg c ::: flx => edge centered fine grid flux array c ::: DIMS(flx) => index limits for flx c ::: area => edge centered area array c ::: DIMS(area) => index limits for area c ::: numcomp => number of components to update c ::: dir => direction normal to flux register c ::: ratio(2) => refinements ratio between coarse and fine c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRFAADD(reg,DIMS(reg),flx,DIMS(flx),area,DIMS(area), & numcomp,dir,ratio,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer DIMDEC(area) integer ratio(2), dir, numcomp REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) REAL_T area(DIMV(area)) integer n, i, j, ic, jc, off integer ratiox, ratioy ratiox = ratio(1) ratioy = ratio(2) if (dir .eq. 0) then c ::::: flux normal to X direction ic = ARG_L1(reg) i = ic*ratiox if (ARG_L1(reg) .ne. ARG_H1(reg)) then call bl_abort("FORT_FRFAADD: bad register direction") end if if (i .lt. ARG_L1(flx) .or. i .gt. ARG_H1(flx)) then call bl_abort("FORT_FRFAADD: index outside flux range") end if do n = 1, numcomp do off = 0, ratioy-1 do jc = ARG_L2(reg), ARG_H2(reg) j = ratioy*jc + off reg(ic,jc,n) = reg(ic,jc,n) + mult*area(i,j)*flx(i,j,n) end do end do end do else c ::::: flux normal to Y direction jc = ARG_L2(reg) j = jc*ratioy if (ARG_L2(reg) .ne. ARG_H2(reg)) then call bl_abort("FORT_FRFAADD: bad register direction") end if if (j .lt. ARG_L2(flx) .or. j .gt. ARG_H2(flx)) then call bl_abort("FORT_FRFAADD: index outside flux range") end if do n = 1, numcomp do off = 0, ratiox-1 do ic = ARG_L1(reg), ARG_H1(reg) i = ratiox*ic + off reg(ic,jc,n) = reg(ic,jc,n) + mult*area(i,j)*flx(i,j,n) end do end do end do end if end c :: c :: -------------------------------------------------------------- c :: reflux: reflux the data on the outer boundary of c :: a fine grid. c :: c :: Inputs/Outputs c :: s <=> state data array c :: slo,shi => index limits of s array c :: vol => volume array c :: vlo,vhi => index limits of vol array c :: reg => flux register c :: rlo,rhi => index limits of reg array c :: lo,hi => subregion of s array to be updated c :: numcomp => number of components to update c :: mult => multiplative factor (+1 or -1 depending on nomal) c :: -------------------------------------------------------------- c :: subroutine FORT_FRREFLUX (s,DIMS(s),vol,DIMS(vol),reg,DIMS(reg),lo,hi, & numcomp,mult) integer DIMDEC(s) integer DIMDEC(vol) integer DIMDEC(reg) integer lo(SDIM), hi(SDIM) integer numcomp REAL_T mult REAL_T reg(DIMV(reg),numcomp) c :: For Multifluid reg is defined as: REAL_T reg(DIMV(reg),numcomp+FLUX_EXTRA) REAL_T s(DIMV(s),numcomp) REAL_T vol(DIMV(vol)) integer n, i, j do n = 1, numcomp do j = lo(2), hi(2) do i = lo(1), hi(1) s(i,j,n) = s(i,j,n) + mult*reg(i,j,n)/vol(i,j) end do end do end do end c :: c :: -------------------------------------------------------------- c :: cvreflux: constant volume version of reflux c :: c :: Inputs/Outputs c :: s <=> state data array c :: slo,shi => index limits of s array c :: dx => cell size c :: reg => flux register c :: rlo,rhi => index limits of reg array c :: lo,hi => subregion of s array to be updated c :: numcomp => number of components to update c :: mult => multiplative factor (+1 or -1 depending on nomal) c :: -------------------------------------------------------------- c :: subroutine FORT_FRCVREFLUX (s,DIMS(s),dx,reg,DIMS(reg),lo,hi, & numcomp,mult) integer DIMDEC(s) integer DIMDEC(reg) integer lo(SDIM), hi(SDIM) integer numcomp REAL_T mult, dx(SDIM) REAL_T reg(DIMV(reg),numcomp) c :: For Multifluid reg is defined as: REAL_T reg(DIMV(reg),numcomp+FLUX_EXTRA) REAL_T s(DIMV(s),numcomp) integer n, i, j REAL_T vmult vmult = mult/(dx(1)*dx(2)) do n = 1, numcomp do j = lo(2), hi(2) do i = lo(1), hi(1) s(i,j,n) = s(i,j,n) + vmult*reg(i,j,n) end do end do end do end ccseapps-2.5/CCSEApps/amrlib/Amr.cpp0000644000175000017500000015636411634153073020367 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Amr.cpp,v 1.134 2003/02/28 22:42:15 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef BL_USE_ARRAYVIEW #include #endif // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif // // Static objects. // std::list Amr::state_plot_vars; std::list Amr::derive_plot_vars; bool Amr::first_plotfile = true; // // I now want to add a version string to the checkpoint file. // static const std::string CheckPointVersion = "CheckPointVersion_1.0"; // // Force immediate full (level 0) regrid() on restart? // static int regrid_on_restart = 0; static int plotfile_on_restart = 0; std::ostream& Amr::DataLog (int i) { return datalog[i]; } int Amr::checkInt () const { return check_int; } Real Amr::checkPer () const { return check_per; } int Amr::plotInt () const { return plot_int; } Real Amr::plotPer () const { return plot_per; } const std::list& Amr::statePlotVars () { return state_plot_vars; } const std::list& Amr::derivePlotVars () { return derive_plot_vars; } int Amr::maxGridSize () const { return max_grid_size; } int Amr::maxLevel () const { return max_level; } int Amr::finestLevel () const { return finest_level; } IntVect Amr::refRatio (int level) const { return ref_ratio[level]; } int Amr::nCycle (int level) const { return n_cycle[level]; } const Array& Amr::refRatio () const { return ref_ratio; } Real Amr::dtLevel (int level) const { return dt_level[level]; } const Array& Amr::dtLevel () const { return dt_level; } const Geometry& Amr::Geom (int level) const { return geom[level]; } int Amr::levelSteps (int i) const { return level_steps[i]; } Real Amr::cumTime () const { return cumtime; } int Amr::regridInt (int lev) const { return regrid_int[lev]; } int Amr::nErrorBuf (int lev) const { return n_error_buf[lev]; } Real Amr::gridEff () const { return grid_eff; } int Amr::subCycle () const { return sub_cycle; } int Amr::nProper () const { return n_proper; } const std::string& Amr::theRestartFile () const { return restart_file; } void Amr::setDtMin (const Array& dt_min_in) { for (int i = 0; i <= finest_level; i++) dt_min[i] = dt_min_in[i]; } AmrLevel& Amr::getLevel (int lev) { return amr_level[lev]; } PArray& Amr::getAmrLevels () { return amr_level; } long Amr::cellCount (int lev) { return amr_level[lev].countCells(); } int Amr::numGrids (int lev) { return amr_level[lev].numGrids(); } const BoxArray& Amr::boxArray (int lev) const { return amr_level[lev].boxArray(); } MultiFab* Amr::derive (const std::string& name, Real time, int lev, int ngrow) { return amr_level[lev].derive(name,time,ngrow); } int Amr::MaxRefRatio (int level) const { int maxval = 0; for (int n = 0; nvariableSetUp(); // // Set default values. // max_level = -1; record_run_info = false; record_grid_info = false; grid_eff = 0.7; last_checkpoint = 0; last_plotfile = 0; plot_int = -1; n_proper = 1; max_grid_size = (BL_SPACEDIM == 2) ? 128 : 32; int i; for (i = 0; i < BL_SPACEDIM; i++) isPeriodic[i] = false; ParmParse pp("amr"); // // Check for command line flags. // verbose = 0; pp.query("v",verbose); pp.query("regrid_on_restart",regrid_on_restart); pp.query("plotfile_on_restart",plotfile_on_restart); sub_cycle = true; if (pp.contains("nosub")) sub_cycle = false; pp.query("regrid_file",grids_file); if (pp.contains("run_log")) { std::string log_file_name; pp.get("run_log",log_file_name); setRecordRunInfo(log_file_name); } if (pp.contains("grid_log")) { std::string grid_file_name; pp.get("grid_log",grid_file_name); setRecordGridInfo(grid_file_name); } if (pp.contains("data_log")) { int num_datalogs = pp.countval("data_log"); datalog.resize(num_datalogs); Array data_file_names(num_datalogs); pp.queryarr("data_log",data_file_names,0,num_datalogs); for (int i = 0; i < num_datalogs; i++) setRecordDataInfo(i,data_file_names[i]); } probin_file = "probin"; // Make "probin" the default if (pp.contains("probin_file")) { pp.get("probin_file",probin_file); } // // Restart or run from scratch? // pp.query("restart", restart_file); // // Read max_level and alloc memory for container objects. // pp.get("max_level", max_level); int nlev = max_level+1; geom.resize(nlev); dt_level.resize(nlev); level_steps.resize(nlev); level_count.resize(nlev); regrid_int.resize(nlev); n_cycle.resize(nlev); dt_min.resize(nlev); blocking_factor.resize(nlev); n_error_buf.resize(nlev); amr_level.resize(nlev); // // Set bogus values. // for (i = 0; i < nlev; i++) { dt_level[i] = 1.e200; // Something nonzero so old & new will differ level_steps[i] = 0; level_count[i] = 0; regrid_int[i] = 0; n_cycle[i] = 0; dt_min[i] = 0.0; n_error_buf[i] = 1; blocking_factor[i] = 1; } ref_ratio.resize(max_level); for (i = 0; i < max_level; i++) ref_ratio[i] = IntVect::TheZeroVector(); // // Read other amr specific values. // check_file_root = "chk"; pp.query("check_file",check_file_root); check_int = -1; int got_check_int = pp.query("check_int",check_int); check_per = -1.0; int got_check_per = pp.query("check_per",check_per); if (got_check_int == 1 && got_check_per == 1) { BoxLib::Error("Must only specify amr.check_int OR amr.check_per"); } else if (got_check_per == 1 && ParallelDescriptor::IOProcessor()) { BoxLib::Warning("Specifying amr.check_per will change the time step"); } plot_file_root = "plt"; pp.query("plot_file",plot_file_root); plot_int = -1; int got_plot_int = pp.query("plot_int",plot_int); plot_per = -1.0; int got_plot_per = pp.query("plot_per",plot_per); if (got_plot_int == 1 && got_plot_per == 1) { BoxLib::Error("Must only specify amr.plot_int OR amr.plot_per"); } else if (got_plot_per == 1 && ParallelDescriptor::IOProcessor()) { BoxLib::Warning("Specifying amr.plot_per will change the time step"); } pp.query("max_grid_size",max_grid_size); pp.query("n_proper",n_proper); pp.query("grid_eff",grid_eff); pp.queryarr("n_error_buf",n_error_buf,0,max_level); // // Read in the refinement ratio IntVects as integer BL_SPACEDIM-tuples. // if (max_level > 0) { const int nratios_vect = max_level*BL_SPACEDIM; Array ratios_vect(nratios_vect); int got_vect = pp.queryarr("ref_ratio_vect",ratios_vect,0,nratios_vect); Array ratios(max_level); const int got_int = pp.queryarr("ref_ratio",ratios,0,max_level); if (got_int == 1 && got_vect == 1 && ParallelDescriptor::IOProcessor()) { BoxLib::Warning("Only input *either* ref_ratio or ref_ratio_vect"); } else if (got_vect == 1) { int k = 0; for (i = 0; i < max_level; i++) { for (int n = 0; n < BL_SPACEDIM; n++,k++) ref_ratio[i][n] = ratios_vect[k]; } } else if (got_int == 1) { for (i = 0; i < max_level; i++) { for (int n = 0; n < BL_SPACEDIM; n++) ref_ratio[i][n] = ratios[i]; } } else { BoxLib::Error("Must input *either* ref_ratio or ref_ratio_vect"); } } // // Read in the blocking_factors. // if (pp.countval("blocking_factor") == 1) { // // Set all values to the single available value. // int the_blocking_factor = 0; pp.query("blocking_factor",the_blocking_factor); for (i = 0; i < max_level; i++) { blocking_factor[i] = the_blocking_factor; } } else { // // Otherwise we expect a vector of blocking factors. // pp.queryarr("blocking_factor",blocking_factor,0,max_level); } // // Read computational domain and set geometry. // Array n_cell(BL_SPACEDIM); pp.getarr("n_cell",n_cell,0,BL_SPACEDIM); BL_ASSERT(n_cell.size() == BL_SPACEDIM); IntVect lo(IntVect::TheZeroVector()), hi(n_cell); hi -= IntVect::TheUnitVector(); Box index_domain(lo,hi); for (i = 0; i <= max_level; i++) { geom[i].define(index_domain); if (i < max_level) index_domain.refine(ref_ratio[i]); } // // Now define offset for CoordSys. // Real offset[BL_SPACEDIM]; for (i = 0; i < BL_SPACEDIM; i++) { const Real delta = Geometry::ProbLength(i)/(Real)n_cell[i]; offset[i] = Geometry::ProbLo(i) + delta*lo[i]; } CoordSys::SetOffset(offset); // // Set regrid interval. // int ri; pp.get("regrid_int",ri); for (int k = 0; k <= max_level; k++) regrid_int[k] = ri; } bool Amr::isStatePlotVar (const std::string& name) { std::list::const_iterator li = state_plot_vars.begin(); for ( ; li != state_plot_vars.end(); ++li) if (*li == name) return true; return false; } void Amr::fillStatePlotVarList () { state_plot_vars.clear(); const DescriptorList& desc_lst = AmrLevel::get_desc_lst(); for (int typ = 0; typ < desc_lst.size(); typ++) for (int comp = 0; comp < desc_lst[typ].nComp();comp++) if (desc_lst[typ].getType() == IndexType::TheCellType()) state_plot_vars.push_back(desc_lst[typ].name(comp)); } void Amr::clearStatePlotVarList () { state_plot_vars.clear(); } void Amr::addStatePlotVar (const std::string& name) { if (!isStatePlotVar(name)) state_plot_vars.push_back(name); } void Amr::deleteStatePlotVar (const std::string& name) { if (isStatePlotVar(name)) state_plot_vars.remove(name); } bool Amr::isDerivePlotVar (const std::string& name) { for (std::list::const_iterator li = derive_plot_vars.begin(); li != derive_plot_vars.end(); ++li) { if (*li == name) return true; } return false; } void Amr::fillDerivePlotVarList () { derive_plot_vars.clear(); DeriveList& derive_lst = AmrLevel::get_derive_lst(); std::list& dlist = derive_lst.dlist(); for (std::list::const_iterator it = dlist.begin(); it != dlist.end(); ++it) { if (it->deriveType() == IndexType::TheCellType()) { derive_plot_vars.push_back(it->name()); } } } void Amr::clearDerivePlotVarList () { derive_plot_vars.clear(); } void Amr::addDerivePlotVar (const std::string& name) { if (!isDerivePlotVar(name)) derive_plot_vars.push_back(name); } void Amr::deleteDerivePlotVar (const std::string& name) { if (isDerivePlotVar(name)) derive_plot_vars.remove(name); } Amr::~Amr () { if (level_steps[0] > last_checkpoint) checkPoint(); if (level_steps[0] > last_plotfile) writePlotFile(plot_file_root,level_steps[0]); levelbld->variableCleanUp(); } void Amr::setRecordGridInfo (const std::string& filename) { record_grid_info= true; gridlog.open(filename.c_str(),std::ios::out|std::ios::app); if (!gridlog.good()) BoxLib::FileOpenFailed(filename); } void Amr::setRecordRunInfo (const std::string& filename) { record_run_info= true; runlog.open(filename.c_str(),std::ios::out|std::ios::app); if (!runlog.good()) BoxLib::FileOpenFailed(filename); } void Amr::setRecordDataInfo (int i, const std::string& filename) { datalog.set(i,new std::ofstream); datalog[i].open(filename.c_str(),std::ios::out|std::ios::app); if (!datalog[i].good()) BoxLib::FileOpenFailed(filename); } void Amr::setDtLevel (const Array& dt_lev) { for (int i = 0; i <= finest_level; i++) dt_level[i] = dt_lev[i]; } void Amr::setNCycle (const Array& ns) { for (int i = 0; i <= finest_level; i++) n_cycle[i] = ns[i]; } long Amr::cellCount () { long cnt = 0; for (int i = 0; i <= finest_level; i++) cnt += amr_level[i].countCells(); return cnt; } int Amr::numGrids () { int cnt = 0; for (int i = 0; i <= finest_level; i++) cnt += amr_level[i].numGrids(); return cnt; } int Amr::okToContinue () { int ok = true; for (int i = 0; ok && (i <= finest_level); i++) ok = ok && amr_level[i].okToContinue(); return ok; } void Amr::writePlotFile (const std::string& root, int num) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::writePlotFile()"); if (first_plotfile) { first_plotfile = false; amr_level[0].setPlotVariables(); } Real dPlotFileTime0 = ParallelDescriptor::second(); const std::string pltfile = BoxLib::Concatenate(root,num); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "PLOTFILE: file = " << pltfile << std::endl; if (record_run_info && ParallelDescriptor::IOProcessor()) runlog << "PLOTFILE: file = " << pltfile << '\n'; // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(pltfile, 0755)) BoxLib::CreateDirectoryFailed(pltfile); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string HeaderFileName = pltfile + "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream HeaderFile; HeaderFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); int old_prec; if (ParallelDescriptor::IOProcessor()) { // // Only the IOProcessor() writes to the header file. // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc); if (!HeaderFile.good()) BoxLib::FileOpenFailed(HeaderFileName); old_prec = HeaderFile.precision(30); } for (int k = 0; k <= finest_level; k++) amr_level[k].writePlotFile(pltfile, HeaderFile); if (ParallelDescriptor::IOProcessor()) { HeaderFile.precision(old_prec); if (!HeaderFile.good()) BoxLib::Error("Amr::writePlotFile() failed"); } const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real dPlotFileTime1 = ParallelDescriptor::second(); Real dPlotFileTime = dPlotFileTime1 - dPlotFileTime0; Real wctime = ParallelDescriptor::second(); ParallelDescriptor::ReduceRealMax(wctime,IOProc); ParallelDescriptor::ReduceRealMax(dPlotFileTime,IOProc); if (ParallelDescriptor::IOProcessor()) { std::cout << "Write plotfile time = " << dPlotFileTime << " seconds" << '\n' << "Total wall clock seconds since start(restart) = " << wctime << std::endl; } } void Amr::checkInput () { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::checkInput()"); if (max_level < 0) BoxLib::Error("checkInput: max_level not set"); // // Check that multigrid factor is a power of 2. // for (int i = 0; i < max_level; i++) { int k = blocking_factor[i]; while ( k > 0 && (k%2 == 0) ) k /= 2; if (k != 1) BoxLib::Error("Amr::checkInputs: multiGrid factor not power of 2"); } // // Check level dependent values. // int i; for (i = 0; i < max_level; i++) { if (MaxRefRatio(i) < 2 || MaxRefRatio(i) > 12) BoxLib::Error("checkInput bad ref_ratios"); } const Box& domain = geom[0].Domain(); if (!domain.ok()) BoxLib::Error("level 0 domain bad or not set"); // // Check that domain size has a factor of blocking_factor[0]. // for (i = 0; i < BL_SPACEDIM; i++) { int len = domain.length(i); if (len%blocking_factor[0] != 0) BoxLib::Error("domain size not divisible by blocking_factor"); } // // Check that max_grid_size has a factor of blocking_factor. // for (i = 0; i < max_level; i++) { for (int n=0; n 0 || plot_per > 0) writePlotFile(plot_file_root,level_steps[0]); } } void Amr::initialInit (Real strt_time, Real stop_time) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::initialInit()"); checkInput(); // // Generate internal values from user-supplied values. // finest_level = 0; // // Init problem dependent data. // int init = true; // // Populate integer array with name of `probin' file. // int probin_file_length = probin_file.length(); Array probin_file_name(probin_file_length); for (int i = 0; i < probin_file_length; i++) probin_file_name[i] = probin_file[i]; FORT_PROBINIT(&init, probin_file_name.dataPtr(), &probin_file_length, Geometry::ProbLo(), Geometry::ProbHi()); #ifdef BL_SYNC_RANTABLES int iGet(0), iSet(1); const int iTableSize(64); Real *RanAmpl = new Real[iTableSize]; Real *RanPhase = new Real[iTableSize]; FORT_SYNC_RANTABLES(RanPhase, RanAmpl, &iGet); ParallelDescriptor::Bcast(RanPhase, iTableSize); ParallelDescriptor::Bcast(RanAmpl, iTableSize); FORT_SYNC_RANTABLES(RanPhase, RanAmpl, &iSet); delete [] RanAmpl; delete [] RanPhase; #endif cumtime = strt_time; // // Define base level grids. // defBaseLevel(strt_time); // // Compute dt and set time levels of all grid data. // amr_level[0].computeInitialDt(finest_level, sub_cycle, n_cycle, ref_ratio, dt_level, stop_time); // // The following was added for multifluid. // Real dt0 = dt_level[0]; dt_min[0] = dt_level[0]; n_cycle[0] = 1; for (int lev = 1; lev <= max_level; lev++) { const int fact = sub_cycle ? ref_ratio[lev-1][0] : 1; dt0 /= Real(fact); dt_level[lev] = dt0; dt_min[lev] = dt_level[lev]; n_cycle[lev] = fact; } if (max_level > 0) bldFineLevels(strt_time); for (int lev = 0; lev <= finest_level; lev++) amr_level[lev].setTimeLevel(strt_time,dt_level[lev],dt_level[lev]); for (int lev = 0; lev <= finest_level; lev++) amr_level[lev].post_regrid(0,finest_level); // // Perform any special post_initialization operations. // for (int lev = 0; lev <= finest_level; lev++) amr_level[lev].post_init(stop_time); for (int lev = 0; lev <= finest_level; lev++) { level_count[lev] = 0; level_steps[lev] = 0; } if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "INITIAL GRIDS \n"; printGridInfo(std::cout,0,finest_level); } if (record_grid_info && ParallelDescriptor::IOProcessor()) { gridlog << "INITIAL GRIDS \n"; printGridInfo(gridlog,0,finest_level); } station.init(); station.findGrid(amr_level,geom); } // // Shared by restart() and checkPoint(). // static std::string the_previous_ckfile; void Amr::restart (const std::string& filename) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::restart()"); Real dRestartTime0 = ParallelDescriptor::second(); int i; if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "restarting calculation from file: " << filename << std::endl; if (record_run_info && ParallelDescriptor::IOProcessor()) runlog << "RESTART from file = " << filename << '\n'; // // Init problem dependent data. // int init = false; // // Populate integer array with name of `probin' file. // int probin_file_length = probin_file.length(); Array probin_file_name(probin_file_length); for (int i = 0; i < probin_file_length; i++) probin_file_name[i] = probin_file[i]; FORT_PROBINIT(&init, probin_file_name.dataPtr(), &probin_file_length, Geometry::ProbLo(), Geometry::ProbHi()); // // Start calculation from given restart file. // if (record_run_info && ParallelDescriptor::IOProcessor()) runlog << "RESTART from file = " << filename << '\n'; // // Open the checkpoint header file for reading. // std::string File = filename; File += '/'; File += "Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ifstream is; is.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); is.open(File.c_str(), std::ios::in); if (!is.good()) BoxLib::FileOpenFailed(File); // // Read global data. // // Attempt to differentiate between old and new CheckPointFiles. // int spdim; bool new_checkpoint_format = false; std::string first_line; std::getline(is,first_line); if (first_line == CheckPointVersion) { new_checkpoint_format = true; is >> spdim; } else { spdim = atoi(first_line.c_str()); } if (spdim != BL_SPACEDIM) { std::cerr << "Amr::restart(): bad spacedim = " << spdim << '\n'; BoxLib::Abort(); } is >> cumtime; int mx_lev; is >> mx_lev; if (max_level < mx_lev) BoxLib::Error("Amr::restart(): different max_level"); is >> finest_level; for (i = 0; i <= mx_lev; i++) is >> geom[i]; for (i = 0; i < mx_lev; i++) is >> ref_ratio[i]; for (i = 0; i <= mx_lev; i++) is >> dt_level[i]; if (new_checkpoint_format) { for (i = 0; i <= mx_lev; i++) is >> dt_min[i]; } else { for (i = 0; i <= mx_lev; i++) dt_min[i] = dt_level[i]; } for (i = 0; i <= mx_lev; i++) is >> n_cycle[i]; for (i = 0; i <= mx_lev; i++) is >> level_steps[i]; for (i = 0; i <= mx_lev; i++) is >> level_count[i]; // // Set bndry conditions. // if (max_level > mx_lev) { for (i = mx_lev+1; i <= max_level; i++) { const int rat = MaxRefRatio(i-1); const int mult = sub_cycle ? rat : 1; dt_level[i] = dt_level[i-1]/Real(rat); n_cycle[i] = mult; level_steps[i] = mult*level_steps[i-1]; level_count[i] = 0; } if (!sub_cycle) { for (i = 0; i <= max_level; i++) dt_level[i] = dt_level[max_level]; } } if (regrid_on_restart) level_count[0] = regrid_int[0]; checkInput(); // // Read levels. // int lev; for (lev = 0; lev <= finest_level; lev++) { amr_level.set(lev,(*levelbld)()); amr_level[lev].restart(*this, is); } // // Build any additional data structures. // for (lev = 0; lev <= finest_level; lev++) amr_level[lev].post_restart(); station.init(); station.findGrid(amr_level,geom); const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real dRestartTime1 = ParallelDescriptor::second(); Real dRestartTime = dRestartTime1 - dRestartTime0; ParallelDescriptor::ReduceRealMax(dRestartTime,IOProc); if (ParallelDescriptor::IOProcessor()) { std::cout << "Restart time = " << dRestartTime << " seconds." << std::endl; the_previous_ckfile = filename; } } void Amr::checkPoint () { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::checkPoint()"); // // In checkpoint files always write out FABs in NATIVE format. // FABio::Format thePrevFormat = FArrayBox::getFormat(); FArrayBox::setFormat(FABio::FAB_NATIVE); Real dCheckPointTime0 = ParallelDescriptor::second(); const std::string ckfile = BoxLib::Concatenate(check_file_root,level_steps[0]); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "CHECKPOINT: file = " << ckfile << std::endl; if (record_run_info && ParallelDescriptor::IOProcessor()) runlog << "CHECKPOINT: file = " << ckfile << '\n'; // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(ckfile, 0755)) BoxLib::CreateDirectoryFailed(ckfile); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string HeaderFileName = ckfile + "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream HeaderFile; HeaderFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); int old_prec, i; if (ParallelDescriptor::IOProcessor()) { // // Only the IOProcessor() writes to the header file. // HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc); if (!HeaderFile.good()) BoxLib::FileOpenFailed(HeaderFileName); old_prec = HeaderFile.precision(30); HeaderFile << CheckPointVersion << '\n' << BL_SPACEDIM << '\n' << cumtime << '\n' << max_level << '\n' << finest_level << '\n'; // // Write out problem domain. // for (i = 0; i <= max_level; i++) HeaderFile << geom[i] << ' '; HeaderFile << '\n'; for (i = 0; i < max_level; i++) HeaderFile << ref_ratio[i] << ' '; HeaderFile << '\n'; for (i = 0; i <= max_level; i++) HeaderFile << dt_level[i] << ' '; HeaderFile << '\n'; for (i = 0; i <= max_level; i++) HeaderFile << dt_min[i] << ' '; HeaderFile << '\n'; for (i = 0; i <= max_level; i++) HeaderFile << n_cycle[i] << ' '; HeaderFile << '\n'; for (i = 0; i <= max_level; i++) HeaderFile << level_steps[i] << ' '; HeaderFile << '\n'; for (i = 0; i <= max_level; i++) HeaderFile << level_count[i] << ' '; HeaderFile << '\n'; } for (i = 0; i <= finest_level; i++) amr_level[i].checkPoint(ckfile, HeaderFile); if (ParallelDescriptor::IOProcessor()) { HeaderFile.precision(old_prec); if (!HeaderFile.good()) BoxLib::Error("Amr::checkpoint() failed"); } // // Dump out any SlabStats MultiFabs. // AmrLevel::get_slabstat_lst().checkPoint(getAmrLevels(), level_steps[0]); // // Don't forget to reset FAB format. // FArrayBox::setFormat(thePrevFormat); const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real dCheckPointTime = ParallelDescriptor::second() - dCheckPointTime0; ParallelDescriptor::ReduceRealMax(dCheckPointTime,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "checkPoint() time = " << dCheckPointTime << " secs." << std::endl; } void Amr::timeStep (int level, Real time, int iteration, int niter) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::timeStep()"); // // Time to regrid? // int lev_top = std::min(finest_level, max_level-1); for (int i = level; i <= lev_top; i++) { const int old_finest = finest_level; if (level_count[i] >= regrid_int[i] && amr_level[i].okToRegrid()) { regrid(i,time); for (int k = i; k <= finest_level; k++) level_count[k] = 0; if (old_finest < finest_level) { // // The new levels will not have valid time steps // and iteration counts. // for (int k = old_finest+1; k <= finest_level; k++) { const int fact = sub_cycle ? MaxRefRatio(k-1) : 1; dt_level[k] = dt_level[k-1]/Real(fact); n_cycle[k] = fact; } } } if (old_finest > finest_level) lev_top = std::min(finest_level, max_level-1); } // // check to see if should write plotfile // This routine is here so it is done after the restart regrid. // if (plotfile_on_restart && !(restart_file.empty()) ) { plotfile_on_restart = 0; writePlotFile(plot_file_root,level_steps[0]); } // // Advance grids at this level. // if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "ADVANCE grids at level " << level << " with dt = " << dt_level[level] << std::endl; } Real dt_new = amr_level[level].advance(time,dt_level[level],iteration,niter); dt_min[level] = iteration == 1 ? dt_new : std::min(dt_min[level],dt_new); level_steps[level]++; level_count[level]++; if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "Advanced " << amr_level[level].countCells() << " cells at level " << level << std::endl; } station.report(time+dt_level[level],level,amr_level[level]); AmrLevel::get_slabstat_lst().update(amr_level[level],time,dt_level[level]); // // Advance grids at higher level. // if (level < finest_level) { const int lev_fine = level+1; if (sub_cycle) { const int ncycle = n_cycle[lev_fine]; for (int i = 1; i <= ncycle; i++) timeStep(lev_fine,time+(i-1)*dt_level[lev_fine],i,ncycle); } else { timeStep(lev_fine,time,1,1); } } amr_level[level].post_timestep(iteration); } void Amr::coarseTimeStep (Real stop_time) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::coarseTimeStep()"); // // Compute new dt. // if (level_steps[0] > 0) amr_level[0].computeNewDt(finest_level, sub_cycle, n_cycle, ref_ratio, dt_min, dt_level, stop_time); timeStep(0,cumtime,1,1); cumtime += dt_level[0]; amr_level[0].postCoarseTimeStep(cumtime); if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "\nSTEP = " << level_steps[0] << " TIME = " << cumtime << " DT = " << dt_level[0] << '\n' << std::endl; } if (record_run_info && ParallelDescriptor::IOProcessor()) { runlog << "STEP = " << level_steps[0] << " TIME = " << cumtime << " DT = " << dt_level[0] << '\n'; } int check_test = 0; if (check_per > 0.0) { const int num_per = int((cumtime+.001*dt_level[0]) / check_per); const Real resid = cumtime - num_per * check_per; if (resid < .001*dt_level[0]) check_test = 1; } if ((check_int > 0 && level_steps[0] % check_int == 0) || check_test == 1) { last_checkpoint = level_steps[0]; checkPoint(); } int plot_test = 0; if (plot_per > 0.0) { const int num_per = int((cumtime+.001*dt_level[0]) / plot_per); const Real resid = cumtime - num_per * plot_per; if (resid < .001*dt_level[0]) plot_test = 1; } if ((plot_int > 0 && level_steps[0] % plot_int == 0) || plot_test == 1) { last_plotfile = level_steps[0]; writePlotFile(plot_file_root,level_steps[0]); } } void Amr::defBaseLevel (Real strt_time) { // // Check that base domain has even number of zones in all directions. // const Box& domain = geom[0].Domain(); const int* d_len = domain.length().getVect(); for (int idir = 0; idir < BL_SPACEDIM; idir++) if (d_len[idir]%2 != 0) BoxLib::Error("defBaseLevel: must have even number of cells"); // // Coarsening before we split the grids ensures that each resulting // grid will have an even number of cells in each direction. // BoxArray lev0(1); lev0.set(0,BoxLib::coarsen(domain,2)); // // Now split up into list of grids within max_grid_size limit. // lev0.maxSize(max_grid_size/2); // // Now refine these boxes back to level 0. // lev0.refine(2); // // Now build level 0 grids. // amr_level.set(0,(*levelbld)(*this,0,geom[0],lev0,strt_time)); lev0.clear(); // // Now init level 0 grids with data. // amr_level[0].initData(); } void Amr::regrid (int lbase, Real time, bool initial) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::regrid()"); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "REGRID: at level lbase = " << lbase << std::endl; if (record_run_info && ParallelDescriptor::IOProcessor()) runlog << "REGRID: at level lbase = " << lbase << std::endl; // // Remove old-time grid space at highest level. // if (finest_level == max_level) amr_level[finest_level].removeOldData(); // // Compute positions of new grids. // int new_finest; Array new_grid_places(max_level+1); if (lbase <= std::min(finest_level,max_level-1)) grid_places(lbase,time,new_finest, new_grid_places); bool regrid_level_zero = lbase == 0 && new_grid_places[0] != amr_level[0].boxArray(); const int start = regrid_level_zero ? 0 : lbase+1; // // Reclaim old-time grid space for all remain levels > lbase. // for (int lev = start; lev <= finest_level; lev++) amr_level[lev].removeOldData(); // // Reclaim all remaining storage for levels > new_finest. // for (int lev = new_finest+1; lev <= finest_level; lev++) amr_level.clear(lev); finest_level = new_finest; if (lbase == 0) { FabSet::FlushCache(); MultiFab::FlushSICache(); Geometry::FlushPIRMCache(); DistributionMapping::FlushCache(); if (!regrid_level_zero) { const MultiFab& mf = amr_level[0].get_new_data(0); BL_ASSERT(mf.ok()); DistributionMapping::AddToCache(mf.DistributionMap()); } // // Recache the distribution maps for SlabStat MFs. // std::list& ssl = AmrLevel::get_slabstat_lst().list(); for (std::list::iterator li = ssl.begin(); li != ssl.end(); ++li) { DistributionMapping::AddToCache((*li)->mf().DistributionMap()); } } // // Define the new grids from level start up to new_finest. // for (int lev = start; lev <= new_finest; lev++) { // // Construct skeleton of new level. // AmrLevel* a = (*levelbld)(*this,lev,geom[lev],new_grid_places[lev],cumtime); if (initial) { // // We're being called on startup from bldFineLevels(). // a->initData(); } else if (amr_level.defined(lev)) { // // Init with data from old structure then remove old structure. // a->init(amr_level[lev]); } else { a->init(); } amr_level.clear(lev); amr_level.set(lev,a); } // // Build any additional data structures after grid generation. // for (int lev = 0; lev <= new_finest; lev++) amr_level[lev].post_regrid(lbase,new_finest); station.findGrid(amr_level,geom); // // Report creation of new grids. // if ((verbose || record_run_info) && ParallelDescriptor::IOProcessor()) { for (int lev = start; lev <= finest_level; lev++) { const int numgrids = amr_level[lev].numGrids(); const long ncells = amr_level[lev].countCells(); Real frac = 100.0*Real(ncells); for (int d=0; d& new_grids) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::grid_places()"); int i, max_crse = std::min(finest_level,max_level-1); if (lbase == 0) { // // Recalculate level 0 BoxArray in case max_grid_size has changed. // This is done exactly as in defBaseLev(). // BoxArray lev0(1); lev0.set(0,BoxLib::coarsen(geom[0].Domain(),2)); // // Now split up into list of grids within max_grid_size limit. // lev0.maxSize(max_grid_size/2); // // Now refine these boxes back to level 0. // lev0.refine(2); new_grids[0] = lev0; } if (!grids_file.empty()) { #define STRIP while( is.get() != '\n' ) std::ifstream is(grids_file.c_str(),std::ios::in); if (!is.good()) BoxLib::FileOpenFailed(grids_file); new_finest = std::min(max_level,(finest_level+1)); int in_finest; is >> in_finest; STRIP; new_finest = std::min(new_finest,in_finest); int ngrid; for (int lev = 1; lev <= new_finest; lev++) { BoxList bl; is >> ngrid; STRIP; for (i = 0; i < ngrid; i++) { Box bx; is >> bx; STRIP; if (lev > lbase) { bx.refine(ref_ratio[lev-1]); if (bx.longside() > max_grid_size) { std::cout << "Grid " << bx << " too large" << '\n'; BoxLib::Error(); } bl.push_back(bx); } } if (lev > lbase) new_grids[lev].define(bl); } is.close(); return; #undef STRIP } // // Construct problem domain at each level. // Array bf_lev(max_level); // Blocking factor at each level. Array rr_lev(max_level); Array pc_domain(max_level); // Coarsened problem domain. for (i = 0; i <= max_crse; i++) { for (int n=0; n p_n(max_level); // Proper nesting domain. Array p_n_comp(max_level); // Complement proper nesting domain. BoxDomain fd1; const BoxArray& bbase = amr_level[lbase].boxArray(); for (i = 0; i < bbase.size(); i++) fd1.add(BoxLib::coarsen(bbase[i],bf_lev[lbase])); p_n_comp[lbase].complementIn(pc_domain[lbase],fd1); p_n_comp[lbase].accrete(n_proper); Geometry tmp2(pc_domain[lbase]); Amr::ProjPeriodic(p_n_comp[lbase], tmp2); p_n_comp[lbase].minimize(); p_n[lbase].complementIn(pc_domain[lbase],p_n_comp[lbase]); p_n[lbase].minimize(); fd1.clear(); for (i = lbase+1; i <= max_crse; i++) { BoxList bl; for (BoxDomain::const_iterator bdi = p_n_comp[i-1].begin(); bdi != p_n_comp[i-1].end(); ++bdi) { bl.push_back(BoxLib::refine(*bdi,rr_lev[i-1])); } p_n_comp[i].clear(); p_n_comp[i].add(bl); p_n_comp[i].accrete(n_proper); Geometry tmp3(pc_domain[i]); Amr::ProjPeriodic(p_n_comp[i], tmp3); p_n[i].complementIn(pc_domain[i],p_n_comp[i]); p_n[i].minimize(); } // // Now generate grids from finest level down. // new_finest = lbase; for (int levc = max_crse; levc >= lbase; levc--) { int levf = levc+1; // // Construct TagBoxArray with sufficient grow factor to contain // new levels projected down to this level. // const BoxArray& old_grids = amr_level[levc].boxArray(); int ngrow = 0; BoxArray ba_proj; if (levf < new_finest) { BoxList blst(old_grids); ba_proj.define(new_grids[levf+1]); ba_proj.coarsen(ref_ratio[levf]); ba_proj.grow(n_proper); ba_proj.coarsen(ref_ratio[levc]); while (!blst.contains(ba_proj)) { blst.accrete(1); ngrow++; } } TagBoxArray tags(old_grids,n_error_buf[levc]+ngrow); amr_level[levc].errorEst(tags, TagBox::CLEAR,TagBox::SET,time, n_error_buf[levc],ngrow); // // If new grids have been constructed above this level, project // those grids down and tag cells on intersections to ensure // proper nesting. // // NOTE: this loop replaces the previous code: // if (levf < new_finest) // tags.setVal(ba_proj,TagBox::SET); // The problem with this code is that it effectively // "buffered the buffer cells", i.e., the grids at level // levf+1 which were created by buffering with n_error_buf[levf] // are then coarsened down twice to define tagging at // level levc, which will then also be buffered. This can // create grids which are larger than necessary. // if (levf < new_finest) { int nerr = n_error_buf[levf]; BoxList bl_tagged; for (int i = 0; i < new_grids[levf+1].size(); i++) bl_tagged.push_back(BoxLib::coarsen(new_grids[levf+1][i],ref_ratio[levf])); // // This grows the boxes by nerr if they touch the edge of the // domain in preparation for them being shrunk by nerr later. // We want the net effect to be that grids are NOT shrunk away // from the edges of the domain. // for (BoxList::iterator blt = bl_tagged.begin(); blt != bl_tagged.end(); ++blt) { for (int idir = 0; idir < BL_SPACEDIM; idir++) { if (blt->smallEnd(idir) == geom[levf].Domain().smallEnd(idir)) blt->growLo(idir,nerr); if (blt->bigEnd(idir) == geom[levf].Domain().bigEnd(idir)) blt->growHi(idir,nerr); } } Box mboxF = BoxLib::grow(bl_tagged.minimalBox(),1); BoxList blFcomp = BoxLib::complementIn(mboxF,bl_tagged); IntVect iv = IntVect(D_DECL(nerr/ref_ratio[levf][0], nerr/ref_ratio[levf][1], nerr/ref_ratio[levf][2])); for (BoxList::iterator bli = blFcomp.begin(); bli != blFcomp.end(); ++bli) { bli->grow(iv); } BoxList blF = BoxLib::complementIn(mboxF,blFcomp); BoxArray baF(blF); baF.grow(n_proper); // // We need to do this in case the error buffering at // levc will not be enough to cover the error buffering // at levf which was just subtracted off. // for (int idir = 0; idir < BL_SPACEDIM; idir++) { if (nerr > n_error_buf[levc]*ref_ratio[levc][idir]) baF.grow(idir,nerr-n_error_buf[levc]*ref_ratio[levc][idir]); } baF.coarsen(ref_ratio[levc]); tags.setVal(baF,TagBox::SET); } // // Buffer error cells. // tags.buffer(n_error_buf[levc]); // // Coarsen the taglist by blocking_factor. // int bl_max = 0; for (int n=0; n 1) tags.coarsen(bf_lev[levc]); // // Remove or add tagged points which violate/satisfy additional // user-specified criteria. // amr_level[levc].manual_tags_placement(tags, bf_lev); // // Map tagged points through periodic boundaries, if any. // Geometry tmpgeom(pc_domain[levc]); tags.mapPeriodic(tmpgeom); // // Remove cells outside proper nesting domain for this level. // tags.setVal(p_n_comp[levc],TagBox::CLEAR); // // Create initial cluster containing all tagged points. // long len = 0; IntVect* pts = tags.collate(len); tags.clear(); if (len > 0) { // // Created new level, now generate efficient grids. // new_finest = std::max(new_finest,levf); // // Construct initial cluster. // ClusterList clist(pts,len); clist.chop(grid_eff); clist.intersect(p_n[levc]); // // Efficient properly nested Clusters have been constructed // now generate list of grids at level levf. // BoxList new_bx; clist.boxList(new_bx); new_bx.refine(bf_lev[levc]); new_bx.minimize(); IntVect largest_grid_size; for (int n = 0; n < BL_SPACEDIM; n++) largest_grid_size[n] = max_grid_size / ref_ratio[levc][n]; // // Ensure new grid boxes are at most max_grid_size in index dirs. // new_bx.maxSize(largest_grid_size); // // Refine up to levf. // new_bx.refine(ref_ratio[levc]); if (!new_bx.isDisjoint()) { std::cout << "WARNING: new grids at level " << levf << " not disjoint:\n" << new_bx << '\n'; } new_grids[levf].define(new_bx); } // // Don't forget to get rid of space used for collate()ing. // delete [] pts; } } void Amr::bldFineLevels (Real strt_time) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::bldFineLevels()"); finest_level = 0; Array grids(max_level+1); // // Get initial grid placement. // do { int new_finest; grid_places(finest_level,strt_time,new_finest,grids); if (new_finest <= finest_level) break; // // Create a new level and link with others. // finest_level = new_finest; AmrLevel* level = (*levelbld)(*this, new_finest, geom[new_finest], grids[new_finest], strt_time); amr_level.set(new_finest,level); amr_level[new_finest].initData(); } while (finest_level < max_level); // // Iterate grids to ensure fine grids encompass all interesting gunk. // bool grids_the_same; do { for (int i = 0; i <= finest_level; i++) grids[i] = amr_level[i].boxArray(); regrid(0,strt_time,true); grids_the_same = true; for (int i = 0; i <= finest_level && grids_the_same; i++) if (!(grids[i] == amr_level[i].boxArray())) grids_the_same = false; } while (!grids_the_same); } ccseapps-2.5/CCSEApps/amrlib/OpenSource.txt0000644000175000017500000002434711634153073021762 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: AmrLib Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/amrlib/StateData.cpp0000644000175000017500000004611411634153073021511 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: StateData.cpp,v 1.40 2003/02/06 18:14:29 lijewski Exp $ // #include #include #include #include #include #include #include const Real INVALID_TIME = -1.0e200; const int MFNEWDATA = 0; const int MFOLDDATA = 1; StateData::StateData () { desc = 0; new_data = old_data = 0; new_time.start = INVALID_TIME; new_time.stop = INVALID_TIME; old_time.start = INVALID_TIME; old_time.stop = INVALID_TIME; } StateData::StateData (const Box& p_domain, const BoxArray& grds, const StateDescriptor* d, Real cur_time, Real dt) { define(p_domain, grds, *d, cur_time, dt); } void StateData::define (const Box& p_domain, const BoxArray& grds, const StateDescriptor& d, Real time, Real dt) { domain = p_domain; desc = &d; grids.define(grds); // // Convert to proper type. // IndexType typ(desc->getType()); StateDescriptor::TimeCenter t_typ(desc->timeType()); if (!typ.cellCentered()) { domain.convert(typ); grids.convert(typ); } if (t_typ == StateDescriptor::Point) { new_time.start = new_time.stop = time; old_time.start = old_time.stop = time - dt; } else { new_time.start = time; new_time.stop = time+dt; old_time.start = time-dt; old_time.stop = time; } int ncomp = desc->nComp(); new_data = new MultiFab(grids,ncomp,desc->nExtra(),Fab_allocate); old_data = 0; buildBC(); } void StateData::reset () { new_time = old_time; old_time.start = old_time.stop = INVALID_TIME; std::swap(old_data, new_data); } void StateData::restart (std::istream& is, const StateDescriptor& d, const std::string& chkfile, bool bReadSpecial) { if (bReadSpecial) ParallelDescriptor::Abort(); // not implemented desc = &d; is >> domain; if (bReadSpecial) { BoxLib::readBoxArray(grids, is, bReadSpecial); } else { grids.readFrom(is); } is >> old_time.start; is >> old_time.stop; is >> new_time.start; is >> new_time.stop; int nsets; is >> nsets; old_data = 0; new_data = new MultiFab; std::string mf_name; is >> mf_name; // // Note that mf_name is relative to the Header file. // We need to prepend the name of the chkfile directory. // std::string FullPathName = chkfile; if (!chkfile.empty() && chkfile[chkfile.length()-1] != '/') FullPathName += '/'; FullPathName += mf_name; VisMF::Read(*new_data, FullPathName); if (nsets == 2) { old_data = new MultiFab; is >> mf_name; // // Note that mf_name is relative to the Header file. // We need to prepend the name of the chkfile directory. // FullPathName = chkfile; if (!chkfile.empty() && chkfile[chkfile.length()-1] != '/') FullPathName += '/'; FullPathName += mf_name; VisMF::Read(*old_data, FullPathName); } buildBC(); } void StateData::buildBC () { int ncomp = desc->nComp(); bc.resize(ncomp); for (int i = 0; i < ncomp; i++) { bc[i].resize(grids.size()); for (int j = 0; j < grids.size(); j++) { BCRec bcr; BoxLib::setBC(grids[j],domain,desc->getBC(i),bcr); bc[i].set(j,bcr); } } } StateData::~StateData() { desc = 0; delete new_data; delete old_data; } void StateData::allocOldData () { if (old_data == 0) { old_data = new MultiFab(grids,desc->nComp(),desc->nExtra()); } } void StateData::removeOldData () { delete old_data; old_data = 0; } const StateDescriptor* StateData::descriptor () const { return desc; } const Box& StateData::getDomain () const { return domain; } const BoxArray& StateData::boxArray () const { return grids; } Real StateData::curTime () const { return 0.5*(new_time.start + new_time.stop); } Real StateData::prevTime () const { return 0.5*(old_time.start + old_time.stop); } MultiFab& StateData::newData () { BL_ASSERT(new_data != 0); return *new_data; } const MultiFab& StateData::newData () const { BL_ASSERT(new_data != 0); return *new_data; } MultiFab& StateData::oldData () { BL_ASSERT(old_data != 0); return *old_data; } const MultiFab& StateData::oldData () const { BL_ASSERT(old_data != 0); return *old_data; } FArrayBox& StateData::newGrid (int i) { BL_ASSERT(new_data != 0); return (*new_data)[i]; } FArrayBox& StateData::oldGrid (int i) { BL_ASSERT(old_data != 0); return (*old_data)[i]; } Array& StateData::getBCs (int comp) { return bc[comp]; } const BCRec& StateData::getBC (int comp, int i) const { return bc[comp][i]; } bool StateData::hasOldData () const { return old_data != 0; } bool StateData::hasNewData () const { return new_data != 0; } void StateData::setOldTimeLevel (Real time) { if (desc->timeType() == StateDescriptor::Point) { old_time.start = old_time.stop = time; } else { BoxLib::Error("StateData::setOldTimeLevel called with Interval"); } } void StateData::setNewTimeLevel (Real time) { if (desc->timeType() == StateDescriptor::Point) { new_time.start = new_time.stop = time; } else { BoxLib::Error("StateData::setNewTimeLevel called with Interval"); } } void StateData::setTimeLevel (Real time, Real dt_old, Real dt_new) { if (desc->timeType() == StateDescriptor::Point) { new_time.start = new_time.stop = time; old_time.start = old_time.stop = time - dt_old; } else { new_time.start = time; new_time.stop = time+dt_new; old_time.start = time-dt_old; old_time.stop = time; } } void StateData::swapTimeLevels (Real dt) { old_time = new_time; if (desc->timeType() == StateDescriptor::Point) { new_time.start += dt; new_time.stop += dt; } else { new_time.start = new_time.stop; new_time.stop += dt; } std::swap(old_data, new_data); } void StateData::FillBoundary (const Real* dx, const RealBox& prob_domain, int src_comp, int num_comp, int do_new) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::FillBoundary()"); Real cur_time; if (desc->timeType() == StateDescriptor::Point) { cur_time = new_time.start; if (!do_new) cur_time = old_time.start; } else { cur_time = 0.5*(new_time.start + new_time.stop); if (!do_new) cur_time = 0.5*(old_time.start + old_time.stop); } // // Make ghost cell data consistent before bc's. // if (do_new) { new_data->FillBoundary(src_comp, num_comp); } else { old_data->FillBoundary(src_comp, num_comp); } BL_ASSERT((do_new && new_data != 0) || old_data != 0); MultiFab& mf = do_new ? *new_data : *old_data; for (MFIter mfi(mf); mfi.isValid(); ++mfi) { FillBoundary(mf[mfi],cur_time,dx,prob_domain,src_comp,src_comp,num_comp); } } void StateData::FillBoundary (FArrayBox& dest, Real time, const Real* dx, const RealBox& prob_domain, int dest_comp, int src_comp, int num_comp) { BL_ASSERT(dest.box().ixType() == desc->getType()); if (domain.contains(dest.box())) return; const Box& bx = dest.box(); const int* dlo = dest.loVect(); const int* dhi = dest.hiVect(); const int* plo = domain.loVect(); const int* phi = domain.hiVect(); Real xlo[BL_SPACEDIM]; BCRec bcr; const Real* problo = prob_domain.lo(); for (int i = 0; i < BL_SPACEDIM; i++) { xlo[i] = problo[i] + dx[i]*(dlo[i]-plo[i]); } for (int i = 0; i < num_comp; ) { const int dc = dest_comp+i; const int sc = src_comp+i; Real* dat = dest.dataPtr(dc); if (desc->master(sc)) { int groupsize = desc->groupsize(sc); BL_ASSERT(groupsize != 0); if (groupsize+i <= num_comp) { // // Can do the whole group at once. // int* bcrs = new int[2*BL_SPACEDIM*groupsize]; int* bci = bcrs; for (int j = 0; j < groupsize; j++) { BoxLib::setBC(bx,domain,desc->getBC(sc+j),bcr); const int* bc = bcr.vect(); for (int k = 0; k < 2*BL_SPACEDIM; k++) bci[k] = bc[k]; bci += 2*BL_SPACEDIM; } // // Use the "group" boundary fill routine. // desc->bndryFill(sc)(dat,dlo,dhi,plo,phi,dx,xlo,&time,bcrs,true); delete [] bcrs; i += groupsize; } else { BoxLib::setBC(bx,domain,desc->getBC(sc),bcr); desc->bndryFill(sc)(dat,dlo,dhi,plo,phi,dx,xlo,&time,bcr.vect()); i++; } } else { BoxLib::setBC(bx,domain,desc->getBC(sc),bcr); desc->bndryFill(sc)(dat,dlo,dhi,plo,phi,dx,xlo,&time,bcr.vect()); i++; } } } void StateData::RegisterData (MultiFabCopyDescriptor& multiFabCopyDesc, Array& mfid) { mfid.resize(2); mfid[MFNEWDATA] = multiFabCopyDesc.RegisterFabArray(new_data); mfid[MFOLDDATA] = multiFabCopyDesc.RegisterFabArray(old_data); } void StateData::linInterpAddBox (MultiFabCopyDescriptor& multiFabCopyDesc, Array& mfid, BoxList* unfillableBoxes, Array& returnedFillBoxIds, const Box& subbox, Real time, int src_comp, int dest_comp, int num_comp, bool extrap) { if (desc->timeType() == StateDescriptor::Point) { if (old_data == 0) { returnedFillBoxIds.resize(1); returnedFillBoxIds[0] = multiFabCopyDesc.AddBox(mfid[MFNEWDATA], subbox, unfillableBoxes, src_comp, dest_comp, num_comp); } else { BoxLib::linInterpAddBox(multiFabCopyDesc, unfillableBoxes, returnedFillBoxIds, subbox, mfid[MFOLDDATA], mfid[MFNEWDATA], old_time.start, new_time.start, time, src_comp, dest_comp, num_comp, extrap); } } else { Real teps = (new_time.start - old_time.start)/1000.0; if (time > new_time.start-teps && time < new_time.stop+teps) { returnedFillBoxIds.resize(1); returnedFillBoxIds[0] = multiFabCopyDesc.AddBox(mfid[MFNEWDATA], subbox, unfillableBoxes, src_comp, dest_comp, num_comp); } else if (old_data != 0 && time > old_time.start-teps && time < old_time.stop+teps) { returnedFillBoxIds.resize(1); returnedFillBoxIds[0] = multiFabCopyDesc.AddBox(mfid[MFOLDDATA], subbox, unfillableBoxes, src_comp, dest_comp, num_comp); } else { BoxLib::Error("StateData::linInterp(): cannot interp"); } } } void StateData::linInterpFillFab (MultiFabCopyDescriptor& multiFabCopyDesc, const Array& mfid, const Array& fillBoxIds, FArrayBox& dest, Real time, int src_comp, int dest_comp, int num_comp, bool extrap) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::linInterpFillFab()"); if (desc->timeType() == StateDescriptor::Point) { if (old_data == 0) { multiFabCopyDesc.FillFab(mfid[MFNEWDATA], fillBoxIds[0], dest); } else { BoxLib::linInterpFillFab(multiFabCopyDesc, fillBoxIds, mfid[MFOLDDATA], mfid[MFNEWDATA], dest, old_time.start, new_time.start, time, src_comp, dest_comp, num_comp, extrap); } } else { Real teps = (new_time.start - old_time.start)/1000.0; if (time > new_time.start-teps && time < new_time.stop+teps) { multiFabCopyDesc.FillFab(mfid[MFNEWDATA], fillBoxIds[0], dest); } else if (old_data != 0 && time > old_time.start-teps && time < old_time.stop+teps) { multiFabCopyDesc.FillFab(mfid[MFOLDDATA], fillBoxIds[0], dest); } else { BoxLib::Error("StateData::linInterp(): cannot interp"); } } } void StateData::checkPoint (const std::string& name, const std::string& fullpathname, std::ostream& os, VisMF::How how, bool dump_old) { static const std::string NewSuffix("_New_MF"); static const std::string OldSuffix("_Old_MF"); if (dump_old == true && old_data == 0) { dump_old = false; } if (ParallelDescriptor::IOProcessor()) { // // The relative name gets written to the Header file. // std::string mf_name_old = name; mf_name_old += OldSuffix; std::string mf_name_new = name; mf_name_new += NewSuffix; os << domain << '\n'; grids.writeOn(os); os << old_time.start << '\n' << old_time.stop << '\n' << new_time.start << '\n' << new_time.stop << '\n'; if (dump_old) { os << 2 << '\n' << mf_name_new << '\n' << mf_name_old << '\n'; } else { os << 1 << '\n' << mf_name_new << '\n'; } } BL_ASSERT(new_data); std::string mf_fullpath_new = fullpathname; mf_fullpath_new += NewSuffix; VisMF::Write(*new_data,mf_fullpath_new,how); if (dump_old) { BL_ASSERT(old_data); std::string mf_fullpath_old = fullpathname; mf_fullpath_old += OldSuffix; VisMF::Write(*old_data,mf_fullpath_old,how); } } void StateData::printTimeInterval (std::ostream &os) const { os << '[' << old_time.start << ' ' << old_time.stop << "] [" << new_time.start << ' ' << new_time.stop << ']' << '\n'; } // // The following is from the asci version of StateData.C // const int BL_IGNORE_MAX = 100000; void BoxLib::readBoxArray (BoxArray& ba, std::istream& is, bool bReadSpecial) { if (bReadSpecial == false) { ba.readFrom(is); } else { BL_ASSERT(ba.size() == 0); int maxbox; unsigned long in_hash; // will be ignored is.ignore(BL_IGNORE_MAX, '(') >> maxbox >> in_hash; ba.resize(maxbox); for (int i = 0; i < maxbox; i++) { Box b; is >> b; ba.set(i, b); } is.ignore(BL_IGNORE_MAX, ')'); if (is.fail()) BoxLib::Error("readBoxArray(BoxArray&,istream&,int) failed"); } } ccseapps-2.5/CCSEApps/amrlib/bc_types.fi0000644000175000017500000000063711634153073021263 0ustar amckinstryamckinstry! See BC_TYPES.H for discussion INTEGER BOGUS_BC PARAMETER (BOGUS_BC=-666) INTEGER REFLECT_ODD PARAMETER (REFLECT_ODD=-1) INTEGER INT_DIR PARAMETER (INT_DIR=0) INTEGER REFLECT_EVEN PARAMETER (REFLECT_EVEN=1) INTEGER FOEXTRAP PARAMETER (FOEXTRAP=2) INTEGER EXT_DIR PARAMETER (EXT_DIR=3) INTEGER HOEXTRAP PARAMETER (HOEXTRAP=4) ccseapps-2.5/CCSEApps/amrlib/INTERP_3D.F0000644000175000017500000026171511634153073020577 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ C c $Id: INTERP_3D.F,v 1.26 2002/12/11 20:43:22 almgren Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "INTERP_F.H" #include "ArrayLim.H" #define IX_PROJ(A,B) (A+B*iabs(A))/B-iabs(A) #define SDIM 3 c ::: -------------------------------------------------------------- c ::: nbinterp: node based bilinear interpolation c ::: c ::: INPUTS/OUTPUTS c ::: fine <=> (modify) fine grid array c ::: DIMS(fine) => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: c ::: crse => (const) coarse grid data widened by 1 zone c ::: DIMS(crse) => (const) index limits of coarse grid c ::: c ::: lratio(3) => (const) refinement ratio between levels c ::: nvar => (const) number of components in array c ::: num_slp => (const) number of types of slopes c ::: c ::: TEMPORARY ARRAYS c ::: sl => num_slp 1-D slope arrays c ::: strip => 1-D temp array c ::: -------------------------------------------------------------- c ::: subroutine FORT_NBINTERP (crse, DIMS(crse), DIMS(cb), $ fine, DIMS(fine), DIMS(fb), $ lratiox, lratioy, lratioz, nvar, $ sl, num_slp) integer DIMDEC(crse) integer DIMDEC(cb) integer DIMDEC(fine) integer DIMDEC(fb) integer lratiox, lratioy, lratioz, nvar integer num_slp REAL_T fine(DIMV(fine),nvar) REAL_T crse(DIMV(crse),nvar) REAL_T sl(DIM1(cb),num_slp) #define SLX 1 #define SLY 2 #define SLZ 3 #define SLXY 4 #define SLXZ 5 #define SLYZ 6 #define SLXYZ 7 c ::: local var integer lx, ly, lz integer i, j, k, ifn, jfn, kfn, n integer ilo, ihi, jlo, jhi, klo, khi integer kstrtFine, kstopFine, jstrtFine, jstopFine, istrtFine, istopFine REAL_T fx, fy,fz REAL_T RX, RY, RZ, RXY, RXZ, RYZ, RXYZ REAL_T dx00, d0x0, d00x, dx10, dx01, d0x1, dx11 REAL_T slope slope(i,j,k,n,fx,fy,fz) = crse(i,j,k,n) + & fx*sl(i,SLX) + fy*sl(i,SLY) + fz*sl(i,SLZ) + & fx*fy*sl(i,SLXY) + fx*fz*sl(i,SLXZ) + fy*fz*sl(i,SLYZ) + & fx*fy*fz*sl(i,SLXYZ) RX = one/dble(lratiox) RY = one/dble(lratioy) RZ = one/dble(lratioz) RXY = RX*RY RXZ = RX*RZ RYZ = RY*RZ RXYZ = RX*RY*RZ c c NOTES: c 1) (i, j, k) loop over the coarse cells c 2) ?strtFine and ?stopFine are the beginning and ending fine cell c indices corresponding to the current coarse cell. ?stopFine c is restricted for the last coarse cell in each direction since c for this cell we only need to do the face and not the fine nodes c inside this cell. c 3) (lx, ly, lz) as well as ?lo and ?hi refer to the fine node indices c as an offset from ?strtFine. c do 100 n = 1, nvar do 110 k = ARG_L3(cb), ARG_H3(cb) kstrtFine = k * lratioz kstopFine = kstrtFine + lratioz - 1 if (k .eq. ARG_H3(cb)) kstopFine = kstrtFine klo = max(ARG_L3(fb),kstrtFine) - kstrtFine khi = min(ARG_H3(fb),kstopFine) - kstrtFine do 120 j = ARG_L2(cb), ARG_H2(cb) jstrtFine = j * lratioy jstopFine = jstrtFine + lratioy - 1 if (j .eq. ARG_H2(cb)) jstopFine = jstrtFine jlo = max(ARG_L2(fb),jstrtFine) - jstrtFine jhi = min(ARG_H2(fb),jstopFine) - jstrtFine c c ::::: compute slopes ::::: c c NOTE: The IF logic in the calculation of the slopes is to c prevent stepping out of bounds on the coarse data when c computing the slopes on the ARG_H?(cb) cells. These c slopes actually are not used since they are multiplied by c zero. c do i = ARG_L1(cb), ARG_H1(cb) dx00 = zero if (i .NE. ARG_H1(cb)) dx00 = crse(i+1,j,k,n) - crse(i,j,k,n) d0x0 = zero if (j .NE. ARG_H2(cb)) d0x0 = crse(i,j+1,k,n) - crse(i,j,k,n) d00x = zero if (k .NE. ARG_H3(cb)) d00x = crse(i,j,k+1,n) - crse(i,j,k,n) dx10 = zero if (i .NE. ARG_H1(cb) .and. j .NE. ARG_H2(cb)) $ dx10 = crse(i+1,j+1,k,n) - crse(i,j+1,k,n) dx01 = zero if (i .NE. ARG_H1(cb) .and. k .NE. ARG_H3(cb)) $ dx01 = crse(i+1,j,k+1,n) - crse(i,j,k+1,n) d0x1 = zero if (j .NE. ARG_H2(cb) .and. k .NE. ARG_H3(cb)) $ d0x1 = crse(i,j+1,k+1,n) - crse(i,j,k+1,n) dx11 = zero if (i .NE. ARG_H1(cb) .and. j .NE. ARG_H2(cb) $ .and. k .NE. ARG_H3(cb)) $ dx11 = crse(i+1,j+1,k+1,n) - crse(i,j+1,k+1,n) sl(i,SLX) = RX*dx00 sl(i,SLY) = RY*d0x0 sl(i,SLZ) = RZ*d00x sl(i,SLXY) = RXY*(dx10 - dx00) sl(i,SLXZ) = RXZ*(dx01 - dx00) sl(i,SLYZ) = RYZ*(d0x1 - d0x0) sl(i,SLXYZ) = RXYZ*(dx11 - dx01 - dx10 + dx00) end do c c ::::: compute fine strip of interpolated data c do lz = klo, khi kfn = lratioz * k + lz fz = dble(lz) do ly = jlo, jhi jfn = lratioy * j + ly fy = dble(ly) do i = ARG_L1(cb), ARG_H1(cb) istrtFine = i * lratiox istopFine = istrtFine + lratiox - 1 if (i .eq. ARG_H1(cb)) istopFine = istrtFine ilo = max(ARG_L1(fb),istrtFine) - istrtFine ihi = min(ARG_H1(fb),istopFine) - istrtFine do lx = ilo, ihi ifn = lratiox * i + lx fx = dble(lx) fine(ifn,jfn,kfn,n) = slope(i,j,k,n,fx,fy,fz) end do end do end do end do c ::::: end of do j 120 continue c ::::: end of do k 110 continue c ::::: end of do n 100 continue #undef SLX #undef SLY #undef SLZ #undef SLXY #undef SLXZ #undef SLYZ #undef SLXYZ end c ::: c ::: -------------------------------------------------------------- c ::: cbinterp: cell centered bilinear interpolation c ::: c ::: NOTE: it is assumed that the coarse grid array is c ::: large enough to define interpolated values c ::: in the region fblo:fbhi on the fine grid c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: DIMS(fine) => (const) index limits of fine grid c ::: DIMS(fb) => (const) subregion of fine grid to get values c ::: c ::: crse => (const) coarse grid data c ::: DIMS(crse) => (const) index limits of coarse grid c ::: c ::: lratio(3) => (const) refinement ratio between levels c ::: nvar => (const) number of components in array c ::: c ::: TEMPORARY ARRAYS c ::: slx,sly,slxy => 1-D slope arrays c ::: strip => 1-D temp array c ::: -------------------------------------------------------------- c ::: subroutine FORT_CBINTERP (crse, DIMS(crse), DIMS(cb), $ fine, DIMS(fine), DIMS(fb), $ lratiox, lratioy, lratioz, nvar, $ sl, num_slp, strip, strip_lo, strip_hi) integer DIMDEC(crse) integer DIMDEC(cb) integer DIMDEC(fine) integer DIMDEC(fb) integer lratiox, lratioy, lratioz, nvar integer num_slp integer strip_lo, strip_hi REAL_T fine(DIMV(fine),nvar) REAL_T crse(DIMV(crse),nvar) REAL_T strip(strip_lo:strip_hi) REAL_T sl(DIM1(cb), num_slp) c ::: local var #if 0 integer lx, ly integer hrat, ic, jc, jfn, jfc, i, j, n REAL_T x, y REAL_T denom #endif call bl_abort("FORT_CBINTERP not implemented") end c ::: -------------------------------------------------------------- c ::: ccinterp: conservative interpolation from coarse grid to c ::: subregion of fine grid defined by (fblo,fbhi) c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: DIMS(fine) => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: nvar => (const) number of variables in state vector c ::: lratio(3) => (const) refinement ratio between levels c ::: c ::: crse => (const) coarse grid data widened by 1 zone c ::: and unrolled c ::: clo,chi => (const) one dimensional limits of crse grid c ::: cslo,cshi => (const) coarse grid index limits where c ::: slopes are to be defined. This is c ::: the projection of (fblo,fbhi) down c ::: to the coarse level c ::: fslo,fshi => (const) fine grid index limits where c ::: slopes are needed. This is the c ::: refinement of (cslo,cshi) and c ::: contains but may not be identical c ::: to (fblo,fbhi). c ::: cslope => (modify) temp array coarse grid slopes c ::: clen => (const) length of coarse grid slopes c ::: fslope => (modify) temp array for fine grid slope c ::: flen => (const) length of fine grid slope array c ::: fdat => (const) temp array for fine grid data c ::: limslope => (const) != 0 => limit slopes c ::: c ::: NOTE: data must be sent in so that c ::: cslope(1,*) and crse(1,*) are associated with c ::: the same cell c ::: c ::: 2-D EXAMPLE: c ::: Suppose the patch called "fine" has index extent: c ::: c ::: floi1 = 3, fhii1 = 12 c ::: floi2 = 8, fhii2 = 20 c ::: c ::: suppose the subergion of this patch that is to be filled c ::: by interpolation has index extent: c ::: c ::: fb_l1 = 5, fb_h1 = 10 c ::: fb_l2 = 13, fb_h2 = 20 c ::: c ::: suppose the refinement ratio is 2 c ::: c ::: Then the coarsening of this subregion (to level 0) is c ::: c ::: cb_l1 = 2 cb_h1 = 5 (ncbx = 4) c ::: cb_l2 = 6 cb_h2 = 10 (ncby = 5) c ::: c ::: In order to compute slopes, we need one extra row of c ::: coarse grid zones: c ::: c ::: cslo(1) = 1 cshi(1) = 6 (ncsx = 6) c ::: cslo(2) = 5 cshi(2) = 11 (ncsy = 7) c ::: c ::: This is the size of the coarse grid array of data that filpatch c ::: has filled at level 0. c ::: The "cslope" and "crse" arrays are this size. c ::: c ::: In order to unroll the slope calculation we make these arrays look c ::: like 1-D arrays. The mapping from 2-D to 1-D is as follows: c ::: c ::: The point (cb_l1,cb_l2) -> 1 c ::: The point (cslo(1),cslo(2)) -> clo = 1 - 1 - ncsx = -6 c ::: c ::: The point (cbhi(1),cbhi(2)) -> clen = ncby*ncsx - 2 = 5*6-2 = 28 c ::: The point (cshi(1),cshi(2)) -> chi = clo + ncsx*ncsy - 1 c ::: = -6 + 6*7 - 1 = 35 c ::: c ::: ------------------------------------------------- c ::: | | | | | | chi | c ::: 11 | 30 | 31 | 32 | 33 | 34 | 35 | cshi(2) c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | clen | | c ::: 10 | 24 | 25 | 26 | 27 | 28 | 29 | cb_h2 c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 9 | 18 | 19 | 20 | 21 | 22 | 23 | c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 8 | 12 | 13 | 14 | 15 | 16 | 17 | c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 7 | 6 | 7 | 8 | 9 | 10 | 11 | c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | | | | | | | c ::: 6 | 0 | 1 | 2 | 3 | 4 | 5 | cb_l2 c ::: | | | | | | | c ::: ------------------------------------------------- c ::: | clo | | | | | | c ::: 5 | -6 | -5 | -4 | -3 | -2 | -1 | cslo(2) c ::: | | | | | | | c ::: ------------------------------------------------- c ::: 1 2 3 4 5 6 c ::: cb_l1 cb_h1 c ::: cslo(1) cshi(1) c ::: c ::: c ::: In the 1-D coordinates: c ::: ist = 1 = stride in I direction c ::: jst = 6 = stride in J direction (ncsx) c ::: c ::: -------------------------------------------------------------- subroutine FORT_CCINTERP (fine, DIMS(fine), $ DIMS(fb), $ nvar,lratiox,lratioy,lratioz,crse,clo, $ chi, DIMS(cb), $ fslo, fshi, cslope, clen, fslope, fdat, $ flen, voff, bc, limslope, $ fvcx, fvcy, fvcz, cvcx, cvcy, cvcz, $ cmax, cmin, alpha) integer DIMDEC(fine) integer DIMDEC(fb) integer DIMDEC(cb) integer fslo(3), fshi(3) integer nvar, lratiox, lratioy, lratioz integer bc(3,2,nvar) integer clen, flen, clo, chi, limslope REAL_T fine(DIMV(fine),nvar) REAL_T crse(clo:chi, nvar) REAL_T cslope(clo:chi, 3) REAL_T cmax(clo:chi) REAL_T cmin(clo:chi) REAL_T alpha(clo:chi) REAL_T fslope(flen, 3) REAL_T fdat(flen) REAL_T voff(flen) REAL_T fvcx(fb_l1:fb_h1+1) REAL_T fvcy(fb_l2:fb_h2+1) REAL_T fvcz(fb_l3:fb_h3+1) REAL_T cvcx(cb_l1:cb_h1+1) REAL_T cvcy(cb_l2:cb_h2+1) REAL_T cvcz(cb_l3:cb_h3+1) #define bclo(i,n) bc(i,1,n) #define bchi(i,n) bc(i,2,n) c ::: local var integer n, fn integer i, ii, ic, ioff integer j, jj, jc, joff integer k, kk, kc, koff integer ist, jst, kst integer cslo(3), cshi(3) REAL_T cen, forw, back, slp, sgn REAL_T fcen, ccen REAL_T xoff, yoff, zoff integer ncbx, ncby, ncbz integer ncsx, ncsy, ncsz integer islo, jslo, kslo integer icc, istart, iend integer ilo, ihi, jlo, jhi, klo, khi logical xok, yok, zok c :::::: helpful statement functions integer sloc integer strd REAL_T slplft, slprgt REAL_T corr_fact REAL_T orig_corr_fact sloc(i,j,k) = clo+i-cslo(1)+ncsx*(j-cslo(2)+ncsy*(k-cslo(3))) slplft(i,strd,n) = -sixteen/fifteen*crse(i-strd,n) $ + half*crse(i,n) $ + two3rd*crse(i+strd,n) $ - tenth*crse(i+2*strd,n) slprgt(i,strd,n) = sixteen/fifteen*crse(i+strd,n) $ - half*crse(i,n) $ - two3rd*crse(i-strd,n) $ + tenth*crse(i-2*strd,n) ncbx = cb_h1-cb_l1+1 ncby = cb_h2-cb_l2+1 ncbz = cb_h3-cb_l3+1 cslo(1) = cb_l1-1 cshi(1) = cb_h1+1 cslo(2) = cb_l2-1 cshi(2) = cb_h2+1 cslo(3) = cb_l3-1 cshi(3) = cb_h3+1 xok = (cb_h1-cb_l1+1 .ge. 2) yok = (cb_h2-cb_l2+1 .ge. 2) zok = (cb_h3-cb_l3+1 .ge. 2) ncsx = ncbx+2 ncsy = ncby+2 ncsz = ncbz+2 ist = 1 jst = ncsx kst = ncsx*ncsy islo = cb_l1-1 jslo = cb_l2-1 kslo = cb_l3-1 do i = fb_l1, fb_h1 fn = i-fslo(1)+1 ic = IX_PROJ(i,lratiox) fcen = half*(fvcx(i)+fvcx(i+1)) ccen = half*(cvcx(ic)+cvcx(ic+1)) voff(fn) = (fcen-ccen)/(cvcx(ic+1)-cvcx(ic)) end do do 100 n = 1, nvar do i = 1,clen alpha(i) = 1.d0 cmax(i) = crse(i,n) cmin(i) = crse(i,n) do koff = -kst,kst,kst do joff = -jst,jst,jst do ioff = -ist,ist,ist cmax(i) = max(cmax(i),crse(i+ioff+joff+koff,n)) cmin(i) = min(cmin(i),crse(i+ioff+joff+koff,n)) end do end do end do end do c ::: ::::: compute slopes in x direction if (limslope .ne. 0) then do i = 1, clen cen = half*(crse(i+ist,n)-crse(i-ist,n)) forw = two*(crse(i+ist,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-ist,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,1)=sign(one,cen)*min(slp,abs(cen)) end do if (xok) then if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then do i = 1, clen, jst cen = slplft(i,ist,n) sgn = sign(one,cen) forw = two*(crse(i+ist,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-ist,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,1)=sgn*min(slp,abs(cen)) end do end if if (bchi(1,n) .eq. EXT_DIR .or. bchi(1,n).eq.HOEXTRAP) then do i = ncbx, clen, jst cen = slprgt(i,ist,n) sgn = sign(one,cen) forw = two*(crse(i+ist,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-ist,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,1)=sgn*min(slp,abs(cen)) end do end if end if else do i = 1, clen cslope(i,1) = half*(crse(i+ist,n)-crse(i-ist,n)) end do if (xok) then if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then do i = 1, clen, jst cslope(i,1) = slplft(i,ist,n) end do end if if (bchi(1,n) .eq. EXT_DIR .or. bchi(1,n).eq.HOEXTRAP) then do i = ncbx, clen, jst cslope(i,1) = slprgt(i,ist,n) end do end if end if end if c ::: ::::: compute slopes in y direction if (limslope .ne. 0) then do i = 1, clen cen = half*(crse(i+jst,n)-crse(i-jst,n)) forw = two*(crse(i+jst,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-jst,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,2)=sign(one,cen)*min(slp,abs(cen)) end do if (yok) then if (bclo(2,n) .eq. EXT_DIR .or. bclo(2,n).eq.HOEXTRAP) then do k = cb_l3, cb_h3 ilo = sloc(cb_l1,cb_l2,k) ihi = sloc(cb_h1,cb_l2,k) do i = ilo, ihi cen = slplft(i,jst,n) sgn = sign(one,cen) forw = two*(crse(i+jst,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-jst,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,2)=sgn*min(slp,abs(cen)) end do end do end if if (bchi(2,n) .eq. EXT_DIR .or. bchi(2,n).eq.HOEXTRAP) then do k = cb_l3, cb_h3 ilo = sloc(cb_l1,cb_h2,k) ihi = sloc(cb_h1,cb_h2,k) do i = ilo, ihi cen = slprgt(i,jst,n) sgn = sign(one,cen) forw = two*(crse(i+jst,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-jst,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,2)=sgn*min(slp,abs(cen)) end do end do end if end if else do i = 1, clen cslope(i,2) = half*(crse(i+jst,n)-crse(i-jst,n)) end do if (yok) then if (bclo(2,n) .eq. EXT_DIR .or. bclo(2,n).eq.HOEXTRAP) then do k = cb_l2, cb_h3 ilo = sloc(cb_l1,cb_l2,k) ihi = sloc(cb_h1,cb_l2,k) do i = ilo, ihi cslope(i,2) = slplft(i,jst,n) end do end do end if if (bchi(2,n) .eq. EXT_DIR .or. bchi(2,n).eq.HOEXTRAP) then do k = cb_l3, cb_h3 ilo = sloc(cb_l1,cb_h2,k) ihi = sloc(cb_h1,cb_h2,k) do i = ilo, ihi cslope(i,2) = slprgt(i,jst,n) end do end do end if end if end if c ::: ::::: compute slopes in z direction if (limslope .ne. 0) then do i = 1, clen cen = half*(crse(i+kst,n)-crse(i-kst,n)) forw = two*(crse(i+kst,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-kst,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,3)=sign(one,cen)*min(slp,abs(cen)) end do if (zok) then if (bclo(3,n) .eq. EXT_DIR .or. bclo(3,n).eq.HOEXTRAP) then ilo = sloc(cb_l1,cb_l2,cb_l3) ihi = sloc(cb_h1,cb_h2,cb_l3) do i = ilo, ihi cen = slplft(i,kst,n) sgn = sign(one,cen) forw = two*(crse(i+kst,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-kst,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,3)=sgn*min(slp,abs(cen)) end do end if if (bchi(3,n) .eq. EXT_DIR .or. bchi(3,n).eq.HOEXTRAP) then ilo = sloc(cb_l1,cb_l2,cb_h3) ihi = sloc(cb_h1,cb_h2,cb_h3) do i = ilo, ihi cen = slprgt(i,kst,n) sgn = sign(one,cen) forw = two*(crse(i+kst,n)-crse(i,n)) back = two*(crse(i,n)-crse(i-kst,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) cslope(i,3)=sgn*min(slp,abs(cen)) end do end if end if else do i = 1, clen cslope(i,3) = half*(crse(i+kst,n)-crse(i-kst,n)) end do if (zok) then if (bclo(3,n) .eq. EXT_DIR .or. bclo(3,n).eq.HOEXTRAP) then ilo = sloc(cb_l1,cb_l2,cb_l3) ihi = sloc(cb_h1,cb_h2,cb_l3) do i = ilo, ihi cslope(i,3) = slplft(i,kst,n) end do end if if (bchi(3,n) .eq. EXT_DIR .or. bchi(3,n).eq.HOEXTRAP) then ilo = sloc(cb_l1,cb_l2,cb_h3) ihi = sloc(cb_h1,cb_h2,cb_h3) do i = ilo, ihi cslope(i,3) = slprgt(i,kst,n) end do end if end if end if do 200 kc = cb_l3, cb_h3 do 250 jc = cb_l2, cb_h2 c ::: ::::: strip out fine grid slope vectors do ioff = 1, lratiox icc = sloc(cb_l1,jc,kc) istart = ioff iend = ioff + (ncbx-1)*lratiox do fn = istart, iend, lratiox fslope(fn,1) = cslope(icc,1) fslope(fn,2) = cslope(icc,2) fslope(fn,3) = cslope(icc,3) fdat(fn) = crse(icc,n) icc = icc + ist end do end do c Limit slopes so as to not introduce new maxs or mins. jj = lratioy*jc jlo = max(jj,fb_l2) - jj jhi = min(jj+lratioy-1,fb_h2) - jj kk = lratioz*kc klo = max(kk,fb_l3) - kk khi = min(kk+lratioz-1,fb_h3) - kk do koff = klo, khi k = lratioz*kc + koff fcen = half*(fvcz(k) +fvcz(k+1)) ccen = half*(cvcz(kc)+cvcz(kc+1)) zoff = (fcen-ccen)/(cvcz(kc+1)-cvcz(kc)) do joff = jlo, jhi j = lratioy*jc + joff fcen = half*(fvcy(j) +fvcy(j+1)) ccen = half*(cvcy(jc)+cvcy(jc+1)) yoff = (fcen-ccen)/(cvcy(jc+1)-cvcy(jc)) do i = fb_l1, fb_h1 fn = i-fslo(1)+1 orig_corr_fact = $ voff(fn)*fslope(fn,1)+ $ yoff*fslope(fn,2)+ $ zoff*fslope(fn,3) fine(i,j,k,n) = fdat(fn) + orig_corr_fact ic = IX_PROJ(i,lratiox) icc = sloc(ic,jc,kc) if ( (fine(i,j,k,n) .gt. cmax(icc)) .and. $ (abs(orig_corr_fact) .gt. 1.e-10*abs(fdat(fn)))) then corr_fact = (cmax(icc) - fdat(fn)) / orig_corr_fact alpha(icc) = min(alpha(icc),corr_fact) endif if ( (fine(i,j,k,n) .lt. cmin(icc)) .and. $ (abs(orig_corr_fact) .gt. 1.e-10*abs(fdat(fn)))) then corr_fact = (cmin(icc) - fdat(fn)) / orig_corr_fact alpha(icc) = min(alpha(icc),corr_fact) endif #ifndef NDEBUG if (alpha(icc) .lt. 0.d0) then print *,'OOPS - ALPHA SHOULD BE POSITIVE IN CCINTERP ' print *,'ICC = ',icc print *,'ALPHA = ',alpha(icc) print *,'ORIG_CORR_FACT = ',orig_corr_fact call bl_abort(" ") endif if (alpha(icc) .gt. 1.d0) then print *,'OOPS - ALPHA SHOULD BE <= 1. IN CCINTERP ' print *,'ICC = ',icc print *,'ALPHA = ',alpha(icc) print *,'ORIG_CORR_FACT = ',orig_corr_fact call bl_abort(" ") endif #endif end do end do end do c end do c ::: ::::: Now interpolate to fine grid for real. jj = lratioy*jc jlo = max(jj,fb_l2) - jj jhi = min(jj+lratioy-1,fb_h2) - jj kk = lratioz*kc klo = max(kk,fb_l3) - kk khi = min(kk+lratioz-1,fb_h3) - kk do koff = klo, khi k = lratioz*kc + koff fcen = half*(fvcz(k) +fvcz(k+1)) ccen = half*(cvcz(kc)+cvcz(kc+1)) zoff = (fcen-ccen)/(cvcz(kc+1)-cvcz(kc)) do joff = jlo, jhi j = lratioy*jc + joff fcen = half*(fvcy(j) +fvcy(j+1)) ccen = half*(cvcy(jc)+cvcy(jc+1)) yoff = (fcen-ccen)/(cvcy(jc+1)-cvcy(jc)) do i = fb_l1, fb_h1 fn = i-fslo(1)+1 ic = IX_PROJ(i,lratiox) icc = sloc(ic,jc,kc) fine(i,j,k,n) = fdat(fn) + alpha(icc) * ( $ voff(fn)*fslope(fn,1)+ $ yoff*fslope(fn,2)+ $ zoff*fslope(fn,3) ) end do end do end do 250 continue 200 continue 100 continue end c ::: c ::: -------------------------------------------------------------- c ::: linccinterp: linear conservative interpolation from coarse grid to c ::: subregion of fine grid defined by (fblo,fbhi) c ::: c ::: The interpolation is linear in that it uses a c ::: a limiting scheme that preserves the value of c ::: any linear combination of the c ::: coarse grid data components--e.g., c ::: if sum_ivar a(ic,jc,ivar)*fab(ic,jc,ivar) = 0, then c ::: sum_ivar a(ic,jc,ivar)*fab(if,jf,ivar) = 0 is satisfied c ::: in all fine cells if,jf covering coarse cell ic,jc. c ::: c ::: If lin_limit = 0, the interpolation scheme is identical to c ::: the used in ccinterp for limslope=1; the results should c ::: be exactly the same -- difference = hard 0. c ::: c ::: Unlike FORT_CCINTERP, this routine does not do any clever unrolling c ::: and it does not use any 1-d strip--all calculations are done c ::: on full 2-d arrays. The onlu concession to vectorization c ::: is that the innermost loops are longest. c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: nvar => (const) number of variables in state vector c ::: lratio(2) => (const) refinement ratio between levels c ::: c ::: crse => (const) coarse grid data widended by 1 zone c ::: clo,chi => (const) index limits of crse grid c ::: cslo,cshi => (const) coarse grid index limits where c ::: slopes are to be defined. This is c ::: the projection of (fblo,fbhi) down c ::: to the coarse level c ::: ucslope => (modify) temp array of unlimited coarse grid slopes c ::: lcslope => (modify) temp array of limited coarse grid slopes c ::: slope_factor => (modify) temp array of slope limiting factors c ::: lin_limit => (const) != 0 => do linear slope limiting scheme c ::: c ::: -------------------------------------------------------------- c ::: subroutine FORT_LINCCINTERP (fine, DIMS(fine), fblo, fbhi, & DIMS(fvcb), & crse, DIMS(crse), DIMS(cvcb), & uc_xslope, lc_xslope, xslope_factor, & uc_yslope, lc_yslope, yslope_factor, & uc_zslope, lc_zslope, zslope_factor, & DIMS(cslope), & cslopelo, cslopehi, $ nvar, lratiox, lratioy, lratioz, $ bc, lin_limit, $ fvcx, fvcy, fvcz, cvcx, cvcy, cvcz, $ voffx,voffy,voffz) implicit none integer DIMDEC(fine) integer DIMDEC(crse) integer DIMDEC(fvcb) integer DIMDEC(cvcb) integer DIMDEC(cslope) integer fblo(3), fbhi(3) integer cslopelo(3), cslopehi(3) integer lratiox, lratioy, lratioz, nvar, lin_limit integer bc(3,2,nvar) REAL_T fine(DIMV(fine),nvar) REAL_T crse(DIMV(crse), nvar) REAL_T uc_xslope(DIMV(cslope),nvar) REAL_T lc_xslope(DIMV(cslope),nvar) REAL_T xslope_factor(DIMV(cslope)) REAL_T uc_yslope(DIMV(cslope),nvar) REAL_T lc_yslope(DIMV(cslope),nvar) REAL_T yslope_factor(DIMV(cslope)) REAL_T uc_zslope(DIMV(cslope),nvar) REAL_T lc_zslope(DIMV(cslope),nvar) REAL_T zslope_factor(DIMV(cslope)) REAL_T fvcx(DIM1(fvcb)) REAL_T fvcy(DIM2(fvcb)) REAL_T fvcz(DIM3(fvcb)) REAL_T voffx(DIM1(fvcb)) REAL_T voffy(DIM2(fvcb)) REAL_T voffz(DIM3(fvcb)) REAL_T cvcx(DIM1(cvcb)) REAL_T cvcy(DIM2(cvcb)) REAL_T cvcz(DIM3(cvcb)) #define bclo(i,n) bc(i,1,n) #define bchi(i,n) bc(i,2,n) c ::: local var integer n integer i, ic integer j, jc integer k, kc REAL_T cen, forw, back, slp REAL_T factorn, denom REAL_T fxcen, cxcen, fycen, cycen, fzcen, czcen logical xok, yok, zok integer ncbx, ncby, ncbz ncbx = cslopehi(1)-cslopelo(1)+1 ncby = cslopehi(2)-cslopelo(2)+1 ncbz = cslopehi(3)-cslopelo(3)+1 xok = (ncbx .ge. 2) yok = (ncby .ge. 2) zok = (ncbz .ge. 2) do k = fblo(3), fbhi(3) kc = IX_PROJ(k,lratioz) fzcen = half*(fvcz(k)+fvcz(k+1)) czcen = half*(cvcz(kc)+cvcz(kc+1)) voffz(k) = (fzcen-czcen)/(cvcz(kc+1)-cvcz(kc)) end do do j = fblo(2), fbhi(2) jc = IX_PROJ(j,lratioy) fycen = half*(fvcy(j)+fvcy(j+1)) cycen = half*(cvcy(jc)+cvcy(jc+1)) voffy(j) = (fycen-cycen)/(cvcy(jc+1)-cvcy(jc)) end do do i = fblo(1), fbhi(1) ic = IX_PROJ(i,lratiox) fxcen = half*(fvcx(i)+fvcx(i+1)) cxcen = half*(cvcx(ic)+cvcx(ic+1)) voffx(i) = (fxcen-cxcen)/(cvcx(ic+1)-cvcx(ic)) end do if(ncbx.ge.ncby.and.ncbx.ge.ncbz)then c=============== CASE 1: x direction is long direction ====================== c ... added to prevent underflow for small crse values do n = 1, nvar do k = cslopelo(3)-1,cslopehi(3)+1 do j = cslopelo(2)-1,cslopehi(2)+1 do i = cslopelo(1)-1, cslopehi(1)+1 crse(i,j,k,n) = cvmgt(crse(i,j,k,n),zero,abs(crse(i,j,k,n)).gt.1.0D-20) end do end do end do end do c ... computed unlimited and limited slopes do n = 1, nvar c ... --> in x direction do k=cslopelo(3), cslopehi(3) do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) uc_xslope(i,j,k,n) = half*(crse(i+1,j,k,n)-crse(i-1,j,k,n)) c ... note: the following 6 lines of code is repeated in two other places. c Similar code snippets appear three times in both the y and z c slope calculations. Although it looks wasteful, writing the code c this way sped up the routine by ~10% (on DEC-alpha). So leave c it alone unless you can make it faster -- rbp cen = uc_xslope(i,j,k,n) forw = two*(crse(i+1,j,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i-1,j,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end do if (xok) then if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then i = cslopelo(1) do k=cslopelo(3), cslopehi(3) do j=cslopelo(2), cslopehi(2) uc_xslope(i,j,k,n) = -sixteen/fifteen*crse(i-1,j,k,n) & + half*crse(i,j,k,n) $ + two3rd*crse(i+1,j,k,n) - tenth*crse(i+2,j,k,n) cen = uc_xslope(i,j,k,n) forw = two*(crse(i+1,j,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i-1,j,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if if (bchi(1,n) .eq. EXT_DIR .or. bchi(1,n).eq.HOEXTRAP) then i = cslopehi(1) do k=cslopelo(3), cslopehi(3) do j=cslopelo(2), cslopehi(2) uc_xslope(i,j,k,n) = sixteen/fifteen*crse(i+1,j,k,n) & - half*crse(i,j,k,n) $ - two3rd*crse(i-1,j,k,n) + tenth*crse(i-2,j,k,n) cen = uc_xslope(i,j,k,n) forw = two*(crse(i+1,j,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i-1,j,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if end if c ... --> in y direction do k=cslopelo(3), cslopehi(3) do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) uc_yslope(i,j,k,n) = half*(crse(i,j+1,k,n)-crse(i,j-1,k,n)) cen = uc_yslope(i,j,k,n) forw = two*(crse(i,j+1,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j-1,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end do if (yok) then if (bclo(2,n) .eq. EXT_DIR .or. bclo(2,n).eq.HOEXTRAP) then j = cslopelo(2) do k=cslopelo(3), cslopehi(3) do i=cslopelo(1), cslopehi(1) uc_yslope(i,j,k,n) = -sixteen/fifteen*crse(i,j-1,k,n) & + half*crse(i,j,k,n) $ + two3rd*crse(i,j+1,k,n) - tenth*crse(i,j+2,k,n) cen = uc_yslope(i,j,k,n) forw = two*(crse(i,j+1,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j-1,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if if (bchi(2,n) .eq. EXT_DIR .or. bchi(2,n).eq.HOEXTRAP) then j = cslopehi(2) do k=cslopelo(3), cslopehi(3) do i=cslopelo(1), cslopehi(1) uc_yslope(i,j,k,n) = sixteen/fifteen*crse(i,j+1,k,n) & - half*crse(i,j,k,n) $ - two3rd*crse(i,j-1,k,n) + tenth*crse(i,j-2,k,n) cen = uc_yslope(i,j,k,n) forw = two*(crse(i,j+1,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j-1,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if end if c ... --> in z direction do k=cslopelo(3), cslopehi(3) do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) uc_zslope(i,j,k,n) = half*(crse(i,j,k+1,n)-crse(i,j,k-1,n)) cen = uc_zslope(i,j,k,n) forw = two*(crse(i,j,k+1,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j,k-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_zslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end do if (zok) then if (bclo(3,n) .eq. EXT_DIR .or. bclo(3,n).eq.HOEXTRAP) then k = cslopelo(3) do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) uc_zslope(i,j,k,n) = -sixteen/fifteen*crse(i,j,k-1,n) & + half*crse(i,j,k,n) $ + two3rd*crse(i,j,k+1,n) - tenth*crse(i,j,k+2,n) cen = uc_zslope(i,j,k,n) forw = two*(crse(i,j,k+1,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j,k-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_zslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if if (bchi(3,n) .eq. EXT_DIR .or. bchi(3,n).eq.HOEXTRAP) then k = cslopehi(3) do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) uc_zslope(i,j,k,n) = sixteen/fifteen*crse(i,j,k+1,n) & - half*crse(i,j,k,n) $ - two3rd*crse(i,j,k-1,n) + tenth*crse(i,j,k-2,n) cen = uc_zslope(i,j,k,n) forw = two*(crse(i,j,k+1,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j,k-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_zslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if end if end do if (lin_limit.eq.1)then c ... compute linear limited slopes c Note that the limited and the unlimited slopes c have the same sign, and it is assumed that they do. c ... --> compute slope factors do k=cslopelo(3), cslopehi(3) do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) xslope_factor(i,j,k) = one yslope_factor(i,j,k) = one zslope_factor(i,j,k) = one end do end do end do do n = 1, nvar do k=cslopelo(3), cslopehi(3) do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) denom = uc_xslope(i,j,k,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_xslope(i,j,k,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) xslope_factor(i,j,k) = min(xslope_factor(i,j,k),factorn) denom = uc_yslope(i,j,k,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_yslope(i,j,k,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) yslope_factor(i,j,k) = min(yslope_factor(i,j,k),factorn) denom = uc_zslope(i,j,k,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_zslope(i,j,k,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) zslope_factor(i,j,k) = min(zslope_factor(i,j,k),factorn) end do end do end do end do c ... --> compute linear limited slopes do n = 1, nvar do k=cslopelo(3), cslopehi(3) do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) lc_xslope(i,j,k,n) = xslope_factor(i,j,k)*uc_xslope(i,j,k,n) lc_yslope(i,j,k,n) = yslope_factor(i,j,k)*uc_yslope(i,j,k,n) lc_zslope(i,j,k,n) = zslope_factor(i,j,k)*uc_zslope(i,j,k,n) end do end do end do end do end if c ... do the interpolation do n = 1, nvar do k = fblo(3), fbhi(3) kc = IX_PROJ(k,lratioz) do j = fblo(2), fbhi(2) jc = IX_PROJ(j,lratioy) do i = fblo(1), fbhi(1) ic = IX_PROJ(i,lratiox) fine(i,j,k,n) = crse(ic,jc,kc,n) + voffx(i)*lc_xslope(ic,jc,kc,n) & + voffy(j)*lc_yslope(ic,jc,kc,n) & + voffz(k)*lc_zslope(ic,jc,kc,n) end do end do end do end do else if(ncby.ge.ncbx.and.ncby.ge.ncbz)then c=============== CASE 2: y direction is long direction ====================== c ... added to prevent underflow for small crse values do n = 1, nvar do k = cslopelo(3)-1,cslopehi(3)+1 do i = cslopelo(1)-1, cslopehi(1)+1 do j = cslopelo(2)-1,cslopehi(2)+1 crse(i,j,k,n) = cvmgt(crse(i,j,k,n),zero,abs(crse(i,j,k,n)).gt.1.0D-20) end do end do end do end do c ... computed unlimited and limited slopes do n = 1, nvar c ... --> in x direction do k=cslopelo(3), cslopehi(3) do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_xslope(i,j,k,n) = half*(crse(i+1,j,k,n)-crse(i-1,j,k,n)) cen = uc_xslope(i,j,k,n) forw = two*(crse(i+1,j,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i-1,j,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end do if (xok) then if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then i = cslopelo(1) do k=cslopelo(3), cslopehi(3) do j=cslopelo(2), cslopehi(2) uc_xslope(i,j,k,n) = -sixteen/fifteen*crse(i-1,j,k,n) & + half*crse(i,j,k,n) $ + two3rd*crse(i+1,j,k,n) - tenth*crse(i+2,j,k,n) cen = uc_xslope(i,j,k,n) forw = two*(crse(i+1,j,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i-1,j,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if if (bchi(1,n) .eq. EXT_DIR .or. bchi(1,n).eq.HOEXTRAP) then i = cslopehi(1) do k=cslopelo(3), cslopehi(3) do j=cslopelo(2), cslopehi(2) uc_xslope(i,j,k,n) = sixteen/fifteen*crse(i+1,j,k,n) & - half*crse(i,j,k,n) $ - two3rd*crse(i-1,j,k,n) + tenth*crse(i-2,j,k,n) cen = uc_xslope(i,j,k,n) forw = two*(crse(i+1,j,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i-1,j,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if end if c ... --> in y direction do k=cslopelo(3), cslopehi(3) do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_yslope(i,j,k,n) = half*(crse(i,j+1,k,n)-crse(i,j-1,k,n)) cen = uc_yslope(i,j,k,n) forw = two*(crse(i,j+1,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j-1,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end do if (yok) then if (bclo(2,n) .eq. EXT_DIR .or. bclo(2,n).eq.HOEXTRAP) then j = cslopelo(2) do k=cslopelo(3), cslopehi(3) do i=cslopelo(1), cslopehi(1) uc_yslope(i,j,k,n) = -sixteen/fifteen*crse(i,j-1,k,n) & + half*crse(i,j,k,n) $ + two3rd*crse(i,j+1,k,n) - tenth*crse(i,j+2,k,n) cen = uc_yslope(i,j,k,n) forw = two*(crse(i,j+1,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j-1,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if if (bchi(2,n) .eq. EXT_DIR .or. bchi(2,n).eq.HOEXTRAP) then j = cslopehi(2) do k=cslopelo(3), cslopehi(3) do i=cslopelo(1), cslopehi(1) uc_yslope(i,j,k,n) = sixteen/fifteen*crse(i,j+1,k,n) & - half*crse(i,j,k,n) $ - two3rd*crse(i,j-1,k,n) + tenth*crse(i,j-2,k,n) cen = uc_yslope(i,j,k,n) forw = two*(crse(i,j+1,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j-1,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if end if c ... --> in z direction do k=cslopelo(3), cslopehi(3) do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_zslope(i,j,k,n) = half*(crse(i,j,k+1,n)-crse(i,j,k-1,n)) cen = uc_zslope(i,j,k,n) forw = two*(crse(i,j,k+1,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j,k-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_zslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end do if (zok) then if (bclo(3,n) .eq. EXT_DIR .or. bclo(3,n).eq.HOEXTRAP) then k = cslopelo(3) do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_zslope(i,j,k,n) = -sixteen/fifteen*crse(i,j,k-1,n) & + half*crse(i,j,k,n) $ + two3rd*crse(i,j,k+1,n) - tenth*crse(i,j,k+2,n) cen = uc_zslope(i,j,k,n) forw = two*(crse(i,j,k+1,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j,k-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_zslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if if (bchi(3,n) .eq. EXT_DIR .or. bchi(3,n).eq.HOEXTRAP) then k = cslopehi(3) do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_zslope(i,j,k,n) = sixteen/fifteen*crse(i,j,k+1,n) & - half*crse(i,j,k,n) $ - two3rd*crse(i,j,k-1,n) + tenth*crse(i,j,k-2,n) cen = uc_zslope(i,j,k,n) forw = two*(crse(i,j,k+1,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j,k-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_zslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if end if end do if (lin_limit.eq.1)then c ... compute linear limited slopes c Note that the limited and the unlimited slopes c have the same sign, and it is assumed that they do. c ... --> compute slope factors do k=cslopelo(3), cslopehi(3) do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) xslope_factor(i,j,k) = one yslope_factor(i,j,k) = one zslope_factor(i,j,k) = one end do end do end do do n = 1, nvar do k=cslopelo(3), cslopehi(3) do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) denom = uc_xslope(i,j,k,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_xslope(i,j,k,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) xslope_factor(i,j,k) = min(xslope_factor(i,j,k),factorn) denom = uc_yslope(i,j,k,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_yslope(i,j,k,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) yslope_factor(i,j,k) = min(yslope_factor(i,j,k),factorn) denom = uc_zslope(i,j,k,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_zslope(i,j,k,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) zslope_factor(i,j,k) = min(zslope_factor(i,j,k),factorn) end do end do end do end do c ... --> compute linear limited slopes do n = 1, nvar do k=cslopelo(3), cslopehi(3) do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) lc_xslope(i,j,k,n) = xslope_factor(i,j,k)*uc_xslope(i,j,k,n) lc_yslope(i,j,k,n) = yslope_factor(i,j,k)*uc_yslope(i,j,k,n) lc_zslope(i,j,k,n) = zslope_factor(i,j,k)*uc_zslope(i,j,k,n) end do end do end do end do end if c ... do the interpolation do n = 1, nvar do k = fblo(3), fbhi(3) kc = IX_PROJ(k,lratioz) do i = fblo(1), fbhi(1) ic = IX_PROJ(i,lratiox) do j = fblo(2), fbhi(2) jc = IX_PROJ(j,lratioy) fine(i,j,k,n) = crse(ic,jc,kc,n) + voffx(i)*lc_xslope(ic,jc,kc,n) & + voffy(j)*lc_yslope(ic,jc,kc,n) & + voffz(k)*lc_zslope(ic,jc,kc,n) end do end do end do end do else if(ncbz.ge.ncbx.and.ncbz.ge.ncby)then c=============== CASE 3: z direction is long direction ====================== c ... added to prevent underflow for small crse values do n = 1, nvar do j = cslopelo(2)-1,cslopehi(2)+1 do i = cslopelo(1)-1, cslopehi(1)+1 do k = cslopelo(3)-1,cslopehi(3)+1 crse(i,j,k,n) = cvmgt(crse(i,j,k,n),zero,abs(crse(i,j,k,n)).gt.1.0D-20) end do end do end do end do c ... computed unlimited and limited slopes do n = 1, nvar c ... --> in x direction do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) do k=cslopelo(3), cslopehi(3) uc_xslope(i,j,k,n) = half*(crse(i+1,j,k,n)-crse(i-1,j,k,n)) cen = uc_xslope(i,j,k,n) forw = two*(crse(i+1,j,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i-1,j,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end do if (xok) then if (bclo(1,n) .eq. EXT_DIR .or. bclo(1,n).eq.HOEXTRAP) then i = cslopelo(1) do j=cslopelo(2), cslopehi(2) do k=cslopelo(3), cslopehi(3) uc_xslope(i,j,k,n) = -sixteen/fifteen*crse(i-1,j,k,n) & + half*crse(i,j,k,n) $ + two3rd*crse(i+1,j,k,n) - tenth*crse(i+2,j,k,n) cen = uc_xslope(i,j,k,n) forw = two*(crse(i+1,j,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i-1,j,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if if (bchi(1,n) .eq. EXT_DIR .or. bchi(1,n).eq.HOEXTRAP) then i = cslopehi(1) do j=cslopelo(2), cslopehi(2) do k=cslopelo(3), cslopehi(3) uc_xslope(i,j,k,n) = sixteen/fifteen*crse(i+1,j,k,n) & - half*crse(i,j,k,n) $ - two3rd*crse(i-1,j,k,n) + tenth*crse(i-2,j,k,n) cen = uc_xslope(i,j,k,n) forw = two*(crse(i+1,j,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i-1,j,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_xslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if end if c ... --> in y direction do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) do k=cslopelo(3), cslopehi(3) uc_yslope(i,j,k,n) = half*(crse(i,j+1,k,n)-crse(i,j-1,k,n)) cen = uc_yslope(i,j,k,n) forw = two*(crse(i,j+1,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j-1,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end do if (yok) then if (bclo(2,n) .eq. EXT_DIR .or. bclo(2,n).eq.HOEXTRAP) then j = cslopelo(2) do i=cslopelo(1), cslopehi(1) do k=cslopelo(3), cslopehi(3) uc_yslope(i,j,k,n) = -sixteen/fifteen*crse(i,j-1,k,n) & + half*crse(i,j,k,n) $ + two3rd*crse(i,j+1,k,n) - tenth*crse(i,j+2,k,n) cen = uc_yslope(i,j,k,n) forw = two*(crse(i,j+1,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j-1,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if if (bchi(2,n) .eq. EXT_DIR .or. bchi(2,n).eq.HOEXTRAP) then j = cslopehi(2) do i=cslopelo(1), cslopehi(1) do k=cslopelo(3), cslopehi(3) uc_yslope(i,j,k,n) = sixteen/fifteen*crse(i,j+1,k,n) & - half*crse(i,j,k,n) $ - two3rd*crse(i,j-1,k,n) + tenth*crse(i,j-2,k,n) cen = uc_yslope(i,j,k,n) forw = two*(crse(i,j+1,k,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j-1,k,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_yslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if end if c ... --> in z direction do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) do k=cslopelo(3), cslopehi(3) uc_zslope(i,j,k,n) = half*(crse(i,j,k+1,n)-crse(i,j,k-1,n)) cen = uc_zslope(i,j,k,n) forw = two*(crse(i,j,k+1,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j,k-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_zslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end do if (zok) then if (bclo(3,n) .eq. EXT_DIR .or. bclo(3,n).eq.HOEXTRAP) then k = cslopelo(3) do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_zslope(i,j,k,n) = -sixteen/fifteen*crse(i,j,k-1,n) & + half*crse(i,j,k,n) $ + two3rd*crse(i,j,k+1,n) - tenth*crse(i,j,k+2,n) cen = uc_zslope(i,j,k,n) forw = two*(crse(i,j,k+1,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j,k-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_zslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if if (bchi(3,n) .eq. EXT_DIR .or. bchi(3,n).eq.HOEXTRAP) then k = cslopehi(3) do i=cslopelo(1), cslopehi(1) do j=cslopelo(2), cslopehi(2) uc_zslope(i,j,k,n) = sixteen/fifteen*crse(i,j,k+1,n) & - half*crse(i,j,k,n) $ - two3rd*crse(i,j,k-1,n) + tenth*crse(i,j,k-2,n) cen = uc_zslope(i,j,k,n) forw = two*(crse(i,j,k+1,n)-crse(i,j,k,n)) back = two*(crse(i,j,k,n)-crse(i,j,k-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) lc_zslope(i,j,k,n)=sign(one,cen)*min(slp,abs(cen)) end do end do end if end if end do if (lin_limit.eq.1)then c ... compute linear limited slopes c Note that the limited and the unlimited slopes c have the same sign, and it is assumed that they do. c ... --> compute slope factors do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) do k=cslopelo(3), cslopehi(3) xslope_factor(i,j,k) = one yslope_factor(i,j,k) = one zslope_factor(i,j,k) = one end do end do end do do n = 1, nvar do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) do k=cslopelo(3), cslopehi(3) denom = uc_xslope(i,j,k,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_xslope(i,j,k,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) xslope_factor(i,j,k) = min(xslope_factor(i,j,k),factorn) denom = uc_yslope(i,j,k,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_yslope(i,j,k,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) yslope_factor(i,j,k) = min(yslope_factor(i,j,k),factorn) denom = uc_zslope(i,j,k,n) denom = cvmgt(denom,one,denom.ne.zero) factorn = lc_zslope(i,j,k,n)/denom factorn = cvmgt(one,factorn,denom.eq.zero) zslope_factor(i,j,k) = min(zslope_factor(i,j,k),factorn) end do end do end do end do c ... --> compute linear limited slopes do n = 1, nvar do j=cslopelo(2), cslopehi(2) do i=cslopelo(1), cslopehi(1) do k=cslopelo(3), cslopehi(3) lc_xslope(i,j,k,n) = xslope_factor(i,j,k)*uc_xslope(i,j,k,n) lc_yslope(i,j,k,n) = yslope_factor(i,j,k)*uc_yslope(i,j,k,n) lc_zslope(i,j,k,n) = zslope_factor(i,j,k)*uc_zslope(i,j,k,n) end do end do end do end do end if c ... do the interpolation do n = 1, nvar do j = fblo(2), fbhi(2) jc = IX_PROJ(j,lratioy) do i = fblo(1), fbhi(1) ic = IX_PROJ(i,lratiox) do k = fblo(3), fbhi(3) kc = IX_PROJ(k,lratioz) fine(i,j,k,n) = crse(ic,jc,kc,n) + voffx(i)*lc_xslope(ic,jc,kc,n) & + voffy(j)*lc_yslope(ic,jc,kc,n) & + voffz(k)*lc_zslope(ic,jc,kc,n) end do end do end do end do end if end c ::: c ::: -------------------------------------------------------------- c ::: subroutine FORT_CQINTERP (fine, DIMS(fine), $ DIMS(fb), $ nvar, lratiox, lratioy, lratioz, crse, $ clo, chi, DIMS(cb), $ fslo, fshi, cslope, clen, fslope, fdat, $ flen, voff, bc, limslope, $ fvcx, fvcy, fvcz, cvcx, cvcy, cvcz) integer DIMDEC(fine) integer DIMDEC(fb) integer DIMDEC(cb) integer fslo(3), fshi(3) integer nvar, lratiox, lratioy, lratioz integer bc(3,2,nvar) integer clen, flen, clo, chi, limslope REAL_T fine(DIMV(fine),nvar) REAL_T crse(clo:chi, nvar) REAL_T cslope(clo:chi, 3) REAL_T fslope(flen, 3) REAL_T fdat(flen) REAL_T voff(flen) REAL_T fvcx(fb_l1:fb_h1+1) REAL_T fvcy(fb_l2:fb_h2+1) REAL_T fvcz(fb_l3:fb_h3+1) REAL_T cvcx(cb_l1:cb_h1+1) REAL_T cvcy(cb_l2:cb_h2+1) REAL_T cvcz(cb_l3:cb_h3+1) call bl_abort('QUADRATIC INTERP NOT IMPLEMEMNTED IN 3-D') end # if 0 c c ----------------------------------------------------------------- c THIS IS A SCALAR VERSION OF THE ABOVE CODE c ----------------------------------------------------------------- c subroutine FORT_CCINTERP2 (fine, DIMS(fine), $ fb_l1, fb_l2, fb_l3, $ fb_h1, fb_h2, fb_h3, $ nvar, lratiox, lratioy, lratioz, crse, $ clo, chi, cb_l1, cb_l2, cb_l3, $ cb_h1, cb_h2, cb_h3, $ fslo, fshi, cslope, clen, fslope, fdat, $ flen, voff, bc, limslope) integer DIMDEC(fine) integer fb_l1, fb_l2, fb_l3 integer fb_h1, fb_h2, fb_h3 integer cb_l1, cb_l2, cb_l3 integer cb_h1, cb_h2, cb_h3 integer fslo(3), fshi(3) integer bc(3,2,nvar) integer lratiox, lratioy, lratioz, nvar, clen, flen, clo, chi integer limslope REAL_T fine(DIMV(fine),nvar) REAL_T crse(cb_l1-1:cb_h1+1, cb_l2-1:cb_h2+1, & cb_l3-1:cb_h3+1, nvar ) REAL_T cslope(cb_l1-1:cb_h1+1, cb_l2-1:cb_h2+1, & cb_l3-1:cb_h3+1, 3 ) REAL_T fslope(flen, 3) REAL_T fdat(flen) REAL_T voff(flen) #define bclo(i,n) bc(i,1,n) #define bchi(i,n) bc(i,2,n) c ::: local var integer n, fn integer i, ii, ic, ioff integer j, jj, jc, joff integer k, kk, kc, koff REAL_T hafratx, hafraty, hafratz, volratiox, volratioy, volratioz REAL_T cen, forw, back, slp REAL_T xoff, yoff, zoff REAL_T cx, cy, cz REAL_T sgn integer ilo, ihi, jlo, jhi, klo, khi c :::::: helpful statement functions REAL_T slplox, slphix, slploy, slphiy, slploz, slphiz REAL_T c1, c2, c3, c4 slplox(i,j,k,n) = - c1*crse(i-1,j,k,n) $ + c2*crse(i ,j,k,n) $ + c3*crse(i+1,j,k,n) $ - c4*crse(i+2,j,k,n) slphix(i,j,k,n) = c1*crse(i+1,j,k,n) $ - c2*crse(i ,j,k,n) $ - c3*crse(i-1,j,k,n) $ + c4*crse(i-2,j,k,n) slploy(i,j,k,n) = - c1*crse(i,j-1,k,n) $ + c2*crse(i,j ,k,n) $ + c3*crse(i,j+1,k,n) $ - c4*crse(i,j+2,k,n) slphiy(i,j,k,n) = c1*crse(i,j+1,k,n) $ - c2*crse(i,j ,k,n) $ - c3*crse(i,j-1,k,n) $ + c4*crse(i,j-2,k,n) slploz(i,j,k,n) = - c1*crse(i,j,k-1,n) $ + c2*crse(i,j,k ,n) $ + c3*crse(i,j,k+1,n) $ - c4*crse(i,j,k+2,n) slphiz(i,j,k,n) = c1*crse(i,j,k+1,n) $ - c2*crse(i,j,k ,n) $ - c3*crse(i,j,k-1,n) $ + c4*crse(i,j,k-2,n) c1 = sixteen/fifteen c2 = half c3 = two3rd c4 = tenth hafratx = half*dble(lratiox-1) hafraty = half*dble(lratioy-1) hafratz = half*dble(lratioz-1) volratiox = one/dble(lratiox) volratioy = one/dble(lratioy) volratioz = one/dble(lratioz) do n = 1, nvar do kc = cb_l3, cb_h3 do jc = cb_l2, cb_h2 do ic = cb_l1, cb_h1 c ::::: compute x slopes if (limslope .ne. 0) then cen = half*(crse(ic+1,jc,kc,n)-crse(ic-1,jc,kc,n)) forw = two*(crse(ic+1,jc,kc,n)-crse(ic,jc,kc,n)) back = two*(crse(ic,jc,kc,n) - crse(ic-1,jc,kc,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) sgn = sign(one,cen) cx = sgn*min(slp,abs(cen)) if (ic.eq.cb_l1 .and. (bclo(1,n) .eq. EXT_DIR & .or. bclo(1,n).eq.HOEXTRAP)) then cen = slplox(ic,jc,kc,n) cx = sgn*min(slp,abs(cen)) end if if (ic.eq.cb_h1 .and. (bchi(1,n) .eq. EXT_DIR & .or. bchi(1,n).eq.HOEXTRAP)) then cen = slphix(ic,jc,kc,n) cx = sgn*min(slp,abs(cen)) end if else cx = half*(crse(ic+1,jc,kc,n)-crse(ic-1,jc,kc,n)) if (ic.eq.cb_l1 .and. (bclo(1,n) .eq. EXT_DIR & .or. bclo(1,n).eq.HOEXTRAP)) then cx = slplox(ic,jc,kc,n) end if if (ic.eq.cb_h1 .and. (bchi(1,n) .eq. EXT_DIR & .or. bchi(1,n).eq.HOEXTRAP)) then cx = slphix(ic,jc,kc,n) end if end if c ::::: slopes in the Y direction if (limslope .ne. 0) then cen = half*(crse(ic,jc+1,kc,n)-crse(ic,jc-1,kc,n)) forw = two*(crse(ic,jc+1,kc,n)-crse(ic,jc,kc,n)) back = two*(crse(ic,jc,kc,n) - crse(ic,jc-1,kc,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) sgn = sign(one,cen) cy = sgn*min(slp,abs(cen)) if (jc.eq.cb_l2 .and. (bclo(2,n) .eq. EXT_DIR & .or. bclo(2,n).eq.HOEXTRAP)) then cen = slploy(ic,jc,kc,n) cy = sgn*min(slp,abs(cen)) end if if (jc.eq.cb_h2 .and. (bchi(2,n) .eq. EXT_DIR & .or. bchi(2,n).eq.HOEXTRAP)) then cen = slphiy(ic,jc,kc,n) cy = sgn*min(slp,abs(cen)) end if else cy = half*(crse(ic,jc+1,kc,n)-crse(ic,jc-1,kc,n)) if (jc.eq.cb_l2 .and. (bclo(2,n) .eq. EXT_DIR & .or. bclo(2,n).eq.HOEXTRAP)) then cy = slploy(ic,jc,kc,n) end if if (ic.eq.cb_h2 .and. (bchi(2,n) .eq. EXT_DIR & .or. bchi(2,n).eq.HOEXTRAP)) then cy = slphiy(ic,jc,kc,n) end if end if c ::::: slopes in the Z direction if (limslope .ne. 0) then cen = half*(crse(ic,jc,kc+1,n)-crse(ic,jc,kc-1,n)) forw = two*(crse(ic,jc,kc+1,n)-crse(ic,jc,kc,n)) back = two*(crse(ic,jc,kc,n) - crse(ic,jc,kc-1,n)) slp = min(abs(forw),abs(back)) slp = cvmgp(slp,zero,forw*back) sgn = sign(one,cen) cz = sgn*min(slp,abs(cen)) if (kc.eq.cb_l3 .and. (bclo(3,n) .eq. EXT_DIR & .or. bclo(3,n).eq.HOEXTRAP)) then cen = slploz(ic,jc,kc,n) cz = sgn*min(slp,abs(cen)) end if if (kc.eq.cb_h3 .and. (bchi(3,n) .eq. EXT_DIR & .or. bchi(3,n).eq.HOEXTRAP)) then cen = slphiz(ic,jc,kc,n) cz = sgn*min(slp,abs(cen)) end if else cz = half*(crse(ic,jc,kc+1,n)-crse(ic,jc,kc-1,n)) if (kc.eq.cb_l3 .and. (bclo(3,n) .eq. EXT_DIR & .or. bclo(3,n).eq.HOEXTRAP)) then cz = slploz(ic,jc,kc,n) end if if (kc.eq.cb_h3 .and. (bchi(3,n) .eq. EXT_DIR & .or. bchi(3,n).eq.HOEXTRAP)) then cz = slphiz(ic,jc,kc,n) end if end if c ::::: now interpolate to fine grid ii = lratiox*ic ilo = max(ii,fb_l1) - ii ihi = min(ii+lratiox-1,fb_h1) - ii jj = lratioy*jc jlo = max(jj,fb_l2) - jj jhi = min(jj+lratioy-1,fb_h2) - jj kk = lratioz*kc klo = max(kk,fb_l3) - kk khi = min(kk+lratioz-1,fb_h2) - kk do koff = klo, khi k = lratioz*kc + koff zoff = dble(koff)-hafratz do joff = jlo, jhi j = lratioy*jc + joff yoff = dble(joff)-hafraty do ioff = ilo, ihi i = lratiox*ic + ioff xoff = dble(ioff)-hafratx fine(i,j,k,n) = crse(ic,jc,kc,n) + & ( volratiox*xoff*cx + volratioy*yoff*cy & + volratioz*zoff*cz ) end do end do end do end do end do end do end do end #endif c ::: c ::: -------------------------------------------------------------- c ::: pcinterp: cell centered piecewise constant interpolation c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: DIMS(fine) => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: c ::: crse => (const) coarse grid data c ::: DIMS(crse) => (const) index limits of coarse grid c ::: cblo,cbhi => (const) coarse grid region containing fblo,fbhi c ::: c ::: longdir => (const) which index direction is longest (1 or 2) c ::: lratio(3) => (const) refinement ratio between levels c ::: nvar => (const) number of components in array c ::: c ::: TEMPORARY ARRAYS c ::: ftmp => 1-D temp array c ::: -------------------------------------------------------------- c ::: subroutine FORT_PCINTERP (crse,DIMS(crse),cblo,cbhi, & fine,DIMS(fine),fblo,fbhi, & longdir,lratiox,lratioy,lratioz,nvar, & ftmp, ftmp_lo, ftmp_hi) integer DIMDEC(crse) integer cblo(3), cbhi(3) integer DIMDEC(fine) integer fblo(3), fbhi(3) integer nvar, lratiox, lratioy, lratioz, longdir integer ftmp_lo, ftmp_hi REAL_T crse(DIMV(crse), nvar) REAL_T fine(DIMV(fine), nvar) REAL_T ftmp(ftmp_lo:ftmp_hi) integer i, j, k, ic, jc, kc, ioff, joff, koff, n integer istrt, istop, jstrt, jstop, kstrt, kstop integer ilo, ihi, jlo, jhi, klo, khi if (longdir .eq. 1) then do n = 1, nvar do kc = cblo(3), cbhi(3) kstrt = kc*lratioz kstop = (kc+1)*lratioz - 1 klo = max(fblo(3),kstrt) khi = min(fbhi(3),kstop) do jc = cblo(2), cbhi(2) c ::::: fill strip in i direction do ioff = 0, lratiox-1 do ic = cblo(1), cbhi(1) i = lratiox*ic + ioff ftmp(i) = crse(ic,jc,kc,n) end do end do c ::::: stuff into fine array jstrt = jc*lratioy jstop = (jc+1)*lratioy - 1 jlo = max(fblo(2),jstrt) jhi = min(fbhi(2),jstop) do k = klo, khi do j = jlo, jhi do i = fblo(1), fbhi(1) fine(i,j,k,n) = ftmp(i) end do end do end do end do end do end do else if (longdir.eq.2) then do n = 1, nvar do kc = cblo(3), cbhi(3) kstrt = kc*lratioz kstop = (kc+1)*lratioz - 1 klo = max(fblo(3),kstrt) khi = min(fbhi(3),kstop) do ic = cblo(1), cbhi(1) c ::::: fill strip in j direction do joff = 0, lratioy-1 do jc = cblo(2), cbhi(2) j = lratioy*jc + joff ftmp(j) = crse(ic,jc,kc,n) end do end do c ::::: stuff into fine array istrt = ic*lratiox istop = (ic+1)*lratiox - 1 ilo = max(fblo(1),istrt) ihi = min(fbhi(1),istop) do k = klo, khi do i = ilo, ihi do j = fblo(2), fbhi(2) fine(i,j,k,n) = ftmp(j) end do end do end do end do end do end do else do n = 1, nvar do ic = cblo(1), cbhi(1) istrt = ic*lratiox istop = (ic+1)*lratiox - 1 ilo = max(fblo(1),istrt) ihi = min(fbhi(1),istop) do jc = cblo(2), cbhi(2) c ::::: fill strip in k direction do koff = 0, lratioz-1 do kc = cblo(3), cbhi(3) k = lratioz*kc + koff ftmp(k) = crse(ic,jc,kc,n) end do end do c ::::: stuff into fine array jstrt = jc*lratioy jstop = (jc+1)*lratioy - 1 jlo = max(fblo(2),jstrt) jhi = min(fbhi(2),jstop) do i = ilo, ihi do j = jlo, jhi do k = fblo(3), fbhi(3) fine(i,j,k,n) = ftmp(k) end do end do end do end do end do end do end if end c ::: c ::: -------------------------------------------------------------- c ::: protect_interp: redo interpolation if the result of linccinterp c ::: generates under- or overshoots. c ::: c ::: c ::: Inputs/Outputs c ::: fine <=> (modify) fine grid array c ::: flo,fhi => (const) index limits of fine grid c ::: fblo,fbhi => (const) subregion of fine grid to get values c ::: cblo,cbhi => (const) coarse equivalent of fblo,fbhi c ::: nvar => (const) number of variables in state vector c ::: lratio(3) => (const) refinement ratio between levels c ::: c ::: crse => (const) coarse grid data widended by 1 zone c ::: clo,chi => (const) index limits of crse grid c ::: c ::: -------------------------------------------------------------- c ::: subroutine FORT_PROTECT_INTERP (fine, DIMS(fine), fblo, fbhi, & crse, DIMS(crse), cblo, cbhi, & fine_state, DIMS(state), & nvar, lratiox, lratioy, lratioz, bc) implicit none integer DIMDEC(fine) integer DIMDEC(crse) integer DIMDEC(state) integer fblo(3), fbhi(3) integer cblo(3), cbhi(3) integer lratiox, lratioy, lratioz, nvar integer bc(3,2,nvar) REAL_T fine(DIMV(fine),nvar) REAL_T crse(DIMV(crse), nvar) REAL_T fine_state(DIMV(state), nvar) REAL_T sum(nvar) REAL_T crse_tot(nvar) integer num_cells_ok(nvar) integer rMAX parameter (rMAX = 8) REAL_T alpha, sumN, sumP, crseTot, negVal, posVal REAL_T sum_fine_new,sum_fine_old REAL_T orig_fine(0:rMAX-1,0:rMAX-1,0:rMAX-1) integer redo_me integer ilo,ihi,jlo,jhi,klo,khi integer i,j,k,ic,jc,kc,n,nn integer numFineCells integer icase do kc = cblo(3), cbhi(3) do jc = cblo(2), cbhi(2) do ic = cblo(1), cbhi(1) ilo = max(lratiox*ic ,fine_l1) ihi = min(lratiox*ic+(lratiox-1),fine_h1) jlo = max(lratioy*jc ,fine_l2) jhi = min(lratioy*jc+(lratioy-1),fine_h2) klo = max(lratioz*kc ,fine_l3) khi = min(lratioz*kc+(lratioz-1),fine_h3) do n = 2, nvar-1 redo_me = 0 do k = klo,khi do j = jlo,jhi do i = ilo,ihi if ((fine_state(i,j,k,n)+fine(i,j,k,n)) .lt. 0.d0) redo_me = 1 enddo enddo enddo c c **************************************************************************************** c c If all the fine values are non-negative after the original interpolated c correction, then we do nothing here. c c If any of the fine values are negative after the original interpolated c correction, then we do our best. c c Special cases: c c 1) Coarse correction > 0, and fine_state has some cells with c negative values which will be filled before adding to the other cells. c Use the correction to bring negative cells to zero, then c distribute the remaining positive proportionally. c c 2) Coarse correction > 0, and correction can not make them all c positive. Add correction only to the negative cells, in proportion c to their magnitude. c c 3) Coarse correction < 0, and fine_state DOES NOT have enough c have enough positive state to absorb it. Here we bring c all the positive fine cells to zero then distribute the remaining c negative amount in such a way as to make them all as close to the c same negative value as possible. c c 4) Coarse correction < 0, fine_state has enough c positive state to absorb it without making any fine c cells negative, BUT fine_state+fine is currently negative c in at least one fine cell. Here just take a constant percentage c away from each positive and don't touch the negatives. c c crseTot = sum of all interpolated values of the correction, c which is equivalent to the coarse correction * ratio**3 c SumN = sum of all negative values of fine_state c SumP = sum of all positive values of fine_state c c **************************************************************************************** c if (redo_me .eq. 1) then icase = 0 sum_fine_old = 0.d0 do k = klo,khi do j = jlo,jhi do i = ilo,ihi sum_fine_old = sum_fine_old + fine(i,j,k,n) orig_fine(i-ilo,j-jlo,k-klo) = fine(i,j,k,n) enddo enddo enddo crseTot = sum_fine_old numFineCells = (ihi-ilo+1) * (jhi-jlo+1) * (khi-klo+1) sumN = zero sumP = zero do k = klo,khi do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,k,n) .le. 0.d0) then sumN = SumN + fine_state(i,j,k,n) else sumP = sumP + fine_state(i,j,k,n) endif enddo enddo enddo if (crseTot .gt. 0.d0 .and. crseTot .ge. abs(sumN)) then c Here we want to fill in the negative values first, then add c the remaining positive proportionally. icase = 1 do k = klo,khi do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,k,n) .le. 0.d0) then fine(i,j,k,n) = -fine_state(i,j,k,n) endif enddo enddo enddo if (sumP > 0.d0) then alpha = (crseTot - abs(sumN)) / sumP do k = klo,khi do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,k,n) .ge. 0.d0) then fine(i,j,k,n) = alpha * fine_state(i,j,k,n) endif enddo enddo enddo else posVal = (crseTot - abs(sumN)) / float(numFineCells) do k = klo,khi do j = jlo,jhi do i = ilo,ihi fine(i,j,k,n) = fine(i,j,k,n) + posVal enddo enddo enddo endif endif if (crseTot .gt. 0.d0. and. crseTot .lt. abs(sumN)) then c Here we don't have enough positive correction to fill all the c negative values of state, so we just try to fill them proportionally c and don't add any correction to the states already positive. icase = 2 alpha = crseTot / abs(sumN) do k = klo,khi do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,k,n) .lt. 0.d0) then fine(i,j,k,n) = alpha * abs(fine_state(i,j,k,n)) else fine(i,j,k,n) = 0.d0 endif enddo enddo enddo endif if (crseTot .lt. 0.d0. and. abs(crseTot) .gt. sumP) then c Here we don't have enough positive states to absorb all the c negative correction, so we want to end up with all the fine c cells having the same negative value. icase = 3 negVal = (sumP + sumN + crseTot)/float(numFineCells) do k = klo,khi do j = jlo,jhi do i = ilo,ihi fine(i,j,k,n) = negVal - fine_state(i,j,k,n) enddo enddo enddo endif if (crseTot .lt. 0.d0 .and. abs(crseTot) .lt. sumP $ .and. (sumP+sumN+crseTot) .gt. 0.d0) then c Here we have enough positive states to absorb all the c negative correction *and* redistribute to make negative cells c positive. icase = 4 alpha = (crseTot + sumN) / sumP do k = klo,khi do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,k,n) .lt. 0.d0) then fine(i,j,k,n) = -fine_state(i,j,k,n) else fine(i,j,k,n) = alpha * fine_state(i,j,k,n) endif enddo enddo enddo endif if (crseTot .lt. 0.d0. and. abs(crseTot) .lt. sumP $ .and. (sumP+sumN+crseTot) .le. 0.d0) then c Here we have enough positive states to absorb all the c negative correction, but not to fix the states already negative. c We bring all the positive states to zero, and use whatever c remaining positiveness from the states to help the negative states. icase = 5 alpha = (crseTot + sumP) / sumN do k = klo,khi do j = jlo,jhi do i = ilo,ihi if (fine_state(i,j,k,n) .gt. 0.d0) then fine(i,j,k,n) = -fine_state(i,j,k,n) else fine(i,j,k,n) = alpha * fine_state(i,j,k,n) endif enddo enddo enddo endif sum_fine_new = 0.d0 do k = klo,khi do j = jlo,jhi do i = ilo,ihi sum_fine_new = sum_fine_new + fine(i,j,k,n) enddo enddo enddo if (abs(sum_fine_new - sum_fine_old) .gt. 1.e-8) then print *,' ' print *,'PROTECT_INTERP: BLEW CONSERVATION with ICASE = ',icase print *,'AT COARSE CELL ',ic,jc,kc,' AND COMPONENT ',n print *,'NEW SUM / OLD SUM ',sum_fine_new, sum_fine_old print *,'CRSETOT ',crseTot print *,'SUMP SUMN ',sumP,sumN do k = klo,khi do j = jlo,jhi do i = ilo,ihi print *,'FINE OLD NEW ',i,j,k,orig_fine(i-ilo,j-jlo,k-klo), $ fine(i,j,k,n), fine_state(i,j,k,n) enddo enddo enddo endif c do k = klo,khi c do j = jlo,jhi c do i = ilo,ihi c if ((fine_state(i,j,k,n) + fine(i,j,k,n)) .lt. 0.d0) then c print *,'STILL NEGATIVE AT ',i,j,k,n c print *,'AT COARSE CELL ',ic,jc,kc c print *,'FINE STATE ',fine_state(i,j,k,n) c print *,'FINE CORRECTION ',fine(i,j,k,n) c print *,'CRSETOT ',crseTot c print *,'SUMN / SUMP ',sumN, sumP c print *,' ' c endif c enddo c enddo c enddo c End (if redo .eq. 1) endif enddo c Set sync for density (n=1) to sum of spec sync (2:nvar-1) do k = klo,khi do j = jlo,jhi do i = ilo,ihi fine(i,j,k,1) = 0.d0 do n = 2,nvar-1 fine(i,j,k,1) = fine(i,j,k,1) + fine(i,j,k,n) enddo enddo enddo enddo c End of coarse index loops enddo enddo enddo end ccseapps-2.5/CCSEApps/amrlib/Interpolater.cpp0000644000175000017500000007335211634153073022313 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Interpolater.cpp,v 1.30 2002/11/08 22:00:51 lijewski Exp $ // #include #include #include #include #include #include #include #include // // Note that in 1D, CellConservativeLinear and CellQuadratic // interpolation are turned off in a hardwired way. // // // CONSTRUCT A GLOBAL OBJECT OF EACH VERSION. // NodeBilinear node_bilinear_interp; CellBilinear cell_bilinear_interp; CellConservative cell_cons_interp; CellQuadratic quadratic_interp; CellConservative unlimited_cc_interp(0); PCInterp pc_interp; CellConservativeLinear lincc_interp; CellConservativeLinear nonlincc_interp(0); CellConservativeProtected protected_interp; Interpolater::~Interpolater () {} NodeBilinear::~NodeBilinear () {} Box NodeBilinear::CoarseBox (const Box& fine, int ratio) { Box b = BoxLib::coarsen(fine,ratio); for (int i = 0; i < BL_SPACEDIM; i++) { if (b.length(i) < 2) { // // Don't want degenerate boxes. // b.growHi(i,1); } } return b; } Box NodeBilinear::CoarseBox (const Box& fine, const IntVect& ratio) { Box b = BoxLib::coarsen(fine,ratio); for (int i = 0; i < BL_SPACEDIM; i++) { if (b.length(i) < 2) { // // Don't want degenerate boxes. // b.growHi(i,1); } } return b; } void NodeBilinear::interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& /* crse_geom */, const Geometry& /* fine_geom */, Array& /*bcr*/) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::interp"); // // Set up to call FORTRAN. // const int* clo = crse.box().loVect(); const int* chi = crse.box().hiVect(); const int* flo = fine.loVect(); const int* fhi = fine.hiVect(); const int* lo = fine_region.loVect(); const int* hi = fine_region.hiVect(); int num_slope = (int) pow(2.0,BL_SPACEDIM)-1; int len0 = crse.box().length()[0]; int slp_len = num_slope*len0; Array strip(slp_len); const Real* cdat = crse.dataPtr(crse_comp); Real* fdat = fine.dataPtr(fine_comp); const int* ratioV = ratio.getVect(); FORT_NBINTERP (cdat,ARLIM(clo),ARLIM(chi),ARLIM(clo),ARLIM(chi), fdat,ARLIM(flo),ARLIM(fhi),ARLIM(lo),ARLIM(hi), D_DECL(&ratioV[0],&ratioV[1],&ratioV[2]),&ncomp, strip.dataPtr(),&num_slope); } CellBilinear::~CellBilinear () {} Box CellBilinear::CoarseBox (const Box& fine, int ratio) { return CoarseBox(fine, ratio*IntVect::TheUnitVector()); } Box CellBilinear::CoarseBox (const Box& fine, const IntVect& ratio) { const int* lo = fine.loVect(); const int* hi = fine.hiVect(); Box crse(BoxLib::coarsen(fine,ratio)); const int* clo = crse.loVect(); const int* chi = crse.hiVect(); for (int i = 0; i < BL_SPACEDIM; i++) { int iratio = ratio[i]; int hrat = iratio/2; if (lo[i] < clo[i]*ratio[i] + hrat) crse.growLo(i,1); if (hi[i] >= chi[i]*ratio[i] + hrat) crse.growHi(i,1); } return crse; } void CellBilinear::interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect & ratio, const Geometry& /* crse_geom */, const Geometry& /* fine_geom */, Array& /*bcr*/) { BoxLib::Error("interp: not implemented"); // // Set up to call FORTRAN. // const int* clo = crse.box().loVect(); const int* chi = crse.box().hiVect(); const int* flo = fine.loVect(); const int* fhi = fine.hiVect(); const int* lo = fine_region.loVect(); const int* hi = fine_region.hiVect(); int num_slope = (int) pow(2.0,BL_SPACEDIM)-1; int len0 = crse.box().length()[0]; int slp_len = num_slope*len0; Array slope(slp_len); int strp_len = len0*ratio[0]; Array strip(strp_len); int strip_lo = ratio[0] * clo[0]; int strip_hi = ratio[0] * chi[0]; const Real* cdat = crse.dataPtr(crse_comp); Real* fdat = fine.dataPtr(fine_comp); const int* ratioV = ratio.getVect(); FORT_CBINTERP (cdat,ARLIM(clo),ARLIM(chi),ARLIM(clo),ARLIM(chi), fdat,ARLIM(flo),ARLIM(fhi),ARLIM(lo),ARLIM(hi), D_DECL(&ratioV[0],&ratioV[1],&ratioV[2]),&ncomp, slope.dataPtr(),&num_slope,strip.dataPtr(),&strip_lo,&strip_hi); } CellConservative::CellConservative (bool limit) { do_limited_slope = limit; } CellConservative::~CellConservative () {} Box CellConservative::CoarseBox (const Box& fine, const IntVect& ratio) { Box crse = BoxLib::coarsen(fine,ratio); crse.grow(1); return crse; } Box CellConservative::CoarseBox (const Box& fine, int ratio) { Box crse = BoxLib::coarsen(fine,ratio); crse.grow(1); return crse; } static Array GetBCArray (const Array& bcr) { Array bc(2*BL_SPACEDIM*bcr.size()); for (int n = 0; n < bcr.size(); n++) { const int* b_rec = bcr[n].vect(); for (int m = 0; m < 2*BL_SPACEDIM; m++) { bc[2*BL_SPACEDIM*n + m] = b_rec[m]; } } return bc; } void CellConservative::interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect & ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::interp"); BL_ASSERT(bcr.size() >= ncomp); BL_ASSERT(fine_geom.Domain().contains(fine_region)); // // Make box which is intersection of fine_region and domain of fine. // Box target_fine_region = fine_region & fine.box(); Box crse_bx = BoxLib::coarsen(target_fine_region,ratio); Box fslope_bx = BoxLib::refine(crse_bx,ratio); Box cslope_bx = crse_bx; cslope_bx.grow(1); BL_ASSERT(crse.box().contains(cslope_bx)); // // Alloc temp space for coarse grid slopes. // long t_long = cslope_bx.numPts(); BL_ASSERT(t_long < INT_MAX); int c_len = int(t_long); Array cslope(BL_SPACEDIM*c_len); // Introduce these arrays to hold the coarse maxs and mins and the // correction factor alpha. std::vector cmax(c_len); std::vector cmin(c_len); std::vector alpha(c_len); int loslp = cslope_bx.index(crse_bx.smallEnd()); int hislp = cslope_bx.index(crse_bx.bigEnd()); t_long = cslope_bx.numPts(); BL_ASSERT(t_long < INT_MAX); int cslope_vol = int(t_long); int clo = 1 - loslp; int chi = clo + cslope_vol - 1; c_len = hislp - loslp + 1; // // Alloc temp space for one strip of fine grid slopes. // int dir; int f_len = fslope_bx.longside(dir); Array strip((BL_SPACEDIM+2)*f_len); Real* fstrip = strip.dataPtr(); Real* foff = fstrip + f_len; Real* fslope = foff + f_len; // // Get coarse and fine edge-centered volume coordinates. // Array fvc[BL_SPACEDIM]; Array cvc[BL_SPACEDIM]; for (dir = 0; dir < BL_SPACEDIM; dir++) { fine_geom.GetEdgeVolCoord(fvc[dir],target_fine_region,dir); crse_geom.GetEdgeVolCoord(cvc[dir],crse_bx,dir); } // // Alloc tmp space for slope calc and to allow for vectorization. // Real* fdat = fine.dataPtr(fine_comp); const Real* cdat = crse.dataPtr(crse_comp); const int* flo = fine.loVect(); const int* fhi = fine.hiVect(); const int* fblo = target_fine_region.loVect(); const int* fbhi = target_fine_region.hiVect(); const int* cblo = crse_bx.loVect(); const int* cbhi = crse_bx.hiVect(); const int* cflo = crse.loVect(); const int* cfhi = crse.hiVect(); const int* fslo = fslope_bx.loVect(); const int* fshi = fslope_bx.hiVect(); int slope_flag = (do_limited_slope ? 1 : 0); Array bc = GetBCArray(bcr); const int* ratioV = ratio.getVect(); FORT_CCINTERP (fdat,ARLIM(flo),ARLIM(fhi), ARLIM(fblo), ARLIM(fbhi), &ncomp,D_DECL(&ratioV[0],&ratioV[1],&ratioV[2]), cdat,&clo,&chi, ARLIM(cblo), ARLIM(cbhi), fslo,fshi, cslope.dataPtr(),&c_len,fslope,fstrip,&f_len,foff, bc.dataPtr(), &slope_flag, D_DECL(fvc[0].dataPtr(),fvc[1].dataPtr(),fvc[2].dataPtr()), D_DECL(cvc[0].dataPtr(),cvc[1].dataPtr(),cvc[2].dataPtr()), &cmax[0],&cmin[0],&alpha[0]); } CellConservativeLinear::CellConservativeLinear (bool do_linear_limiting_) { do_linear_limiting = do_linear_limiting_; } CellConservativeLinear::~CellConservativeLinear () {} Box CellConservativeLinear::CoarseBox (const Box& fine, const IntVect& ratio) { Box crse = BoxLib::coarsen(fine,ratio); crse.grow(1); return crse; } Box CellConservativeLinear::CoarseBox (const Box& fine, int ratio) { Box crse(BoxLib::coarsen(fine,ratio)); crse.grow(1); return crse; } void CellConservativeLinear::interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::interp"); BL_ASSERT(bcr.size() >= ncomp); BL_ASSERT(fine_geom.Domain().contains(fine_region)); // // Make box which is intersection of fine_region and domain of fine. // Box target_fine_region = fine_region & fine.box(); // // crse_bx is coarsening of target_fine_region, grown by 1. // Box crse_bx = CoarseBox(target_fine_region,ratio); // // Slopes are needed only on coarsening of target_fine_region. // Box cslope_bx(crse_bx); cslope_bx.grow(-1); // // Get coarse and fine edge-centered volume coordinates. // Array fvc[BL_SPACEDIM]; Array cvc[BL_SPACEDIM]; int dir; for (dir = 0; dir < BL_SPACEDIM; dir++) { fine_geom.GetEdgeVolCoord(fvc[dir],target_fine_region,dir); crse_geom.GetEdgeVolCoord(cvc[dir],crse_bx,dir); } // // alloc tmp space for slope calc. // // In ucc_slopes and lcc_slopes , there is a slight abuse of // the number of compenents argument // --> there is a slope for each component in each coordinate // direction // FArrayBox ucc_slopes(cslope_bx,ncomp*BL_SPACEDIM); FArrayBox lcc_slopes(cslope_bx,ncomp*BL_SPACEDIM); FArrayBox slope_factors(cslope_bx,BL_SPACEDIM); Real* fdat = fine.dataPtr(fine_comp); const Real* cdat = crse.dataPtr(crse_comp); Real* ucc_xsldat = ucc_slopes.dataPtr(0); Real* lcc_xsldat = lcc_slopes.dataPtr(0); Real* xslfac_dat = slope_factors.dataPtr(0); Real* ucc_ysldat = ucc_slopes.dataPtr(ncomp); Real* lcc_ysldat = lcc_slopes.dataPtr(ncomp); Real* yslfac_dat = slope_factors.dataPtr(1); #if (BL_SPACEDIM==3) Real* ucc_zsldat = ucc_slopes.dataPtr(2*ncomp); Real* lcc_zsldat = lcc_slopes.dataPtr(2*ncomp); Real* zslfac_dat = slope_factors.dataPtr(2); #endif const int* flo = fine.loVect(); const int* fhi = fine.hiVect(); const int* clo = crse.loVect(); const int* chi = crse.hiVect(); const int* fblo = target_fine_region.loVect(); const int* fbhi = target_fine_region.hiVect(); const int* csbhi = cslope_bx.hiVect(); const int* csblo = cslope_bx.loVect(); int lin_limit = (do_linear_limiting ? 1 : 0); const int* cvcblo = crse_bx.loVect(); const int* fvcblo = target_fine_region.loVect(); int cvcbhi[BL_SPACEDIM]; int fvcbhi[BL_SPACEDIM]; for (dir=0; dir bc = GetBCArray(bcr); const int* ratioV = ratio.getVect(); #if (BL_SPACEDIM > 1) FORT_LINCCINTERP (fdat,ARLIM(flo),ARLIM(fhi), fblo, fbhi, ARLIM(fvcblo), ARLIM(fvcbhi), cdat,ARLIM(clo),ARLIM(chi), ARLIM(cvcblo), ARLIM(cvcbhi), ucc_xsldat, lcc_xsldat, xslfac_dat, ucc_ysldat, lcc_ysldat, yslfac_dat, #if (BL_SPACEDIM==3) ucc_zsldat, lcc_zsldat, zslfac_dat, #endif ARLIM(csblo), ARLIM(csbhi), csblo, csbhi, &ncomp,D_DECL(&ratioV[0],&ratioV[1],&ratioV[2]), bc.dataPtr(), &lin_limit, D_DECL(fvc[0].dataPtr(),fvc[1].dataPtr(),fvc[2].dataPtr()), D_DECL(cvc[0].dataPtr(),cvc[1].dataPtr(),cvc[2].dataPtr()), D_DECL(voffx,voffy,voffz)); D_TERM(delete [] voffx;, delete [] voffy;, delete [] voffz;); #endif /*(BL_SPACEDIM > 1)*/ } CellQuadratic::CellQuadratic (bool limit) { do_limited_slope = limit; } CellQuadratic::~CellQuadratic () {} Box CellQuadratic::CoarseBox (const Box& fine, const IntVect& ratio) { Box crse = BoxLib::coarsen(fine,ratio); crse.grow(1); return crse; } Box CellQuadratic::CoarseBox (const Box& fine, int ratio) { Box crse = BoxLib::coarsen(fine,ratio); crse.grow(1); return crse; } void CellQuadratic::interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::interp"); BL_ASSERT(bcr.size() >= ncomp); BL_ASSERT(fine_geom.Domain().contains(fine_region)); // // Make box which is intersection of fine_region and domain of fine. // Box target_fine_region = fine_region & fine.box(); Box crse_bx(BoxLib::coarsen(target_fine_region,ratio)); Box fslope_bx(BoxLib::refine(crse_bx,ratio)); Box cslope_bx(crse_bx); cslope_bx.grow(1); BL_ASSERT(crse.box().contains(cslope_bx)); // // Alloc temp space for coarse grid slopes: here we use 5 // instead of BL_SPACEDIM because of the x^2, y^2 and xy terms // long t_long = cslope_bx.numPts(); BL_ASSERT(t_long < INT_MAX); int c_len = int(t_long); Array cslope(5*c_len); int loslp = cslope_bx.index(crse_bx.smallEnd()); int hislp = cslope_bx.index(crse_bx.bigEnd()); t_long = cslope_bx.numPts(); BL_ASSERT(t_long < INT_MAX); int cslope_vol = int(t_long); int clo = 1 - loslp; int chi = clo + cslope_vol - 1; c_len = hislp - loslp + 1; // // Alloc temp space for one strip of fine grid slopes: here we use 5 // instead of BL_SPACEDIM because of the x^2, y^2 and xy terms. // int dir; int f_len = fslope_bx.longside(dir); Array strip((5+2)*f_len); Real* fstrip = strip.dataPtr(); Real* foff = fstrip + f_len; Real* fslope = foff + f_len; // // Get coarse and fine edge-centered volume coordinates. // Array fvc[BL_SPACEDIM]; Array cvc[BL_SPACEDIM]; for (dir = 0; dir < BL_SPACEDIM; dir++) { fine_geom.GetEdgeVolCoord(fvc[dir],target_fine_region,dir); crse_geom.GetEdgeVolCoord(cvc[dir],crse_bx,dir); } // // Alloc tmp space for slope calc and to allow for vectorization. // Real* fdat = fine.dataPtr(fine_comp); const Real* cdat = crse.dataPtr(crse_comp); const int* flo = fine.loVect(); const int* fhi = fine.hiVect(); const int* fblo = target_fine_region.loVect(); const int* fbhi = target_fine_region.hiVect(); const int* cblo = crse_bx.loVect(); const int* cbhi = crse_bx.hiVect(); const int* cflo = crse.loVect(); const int* cfhi = crse.hiVect(); const int* fslo = fslope_bx.loVect(); const int* fshi = fslope_bx.hiVect(); int slope_flag = (do_limited_slope ? 1 : 0); Array bc = GetBCArray(bcr); const int* ratioV = ratio.getVect(); #if (BL_SPACEDIM > 1) FORT_CQINTERP (fdat,ARLIM(flo),ARLIM(fhi), ARLIM(fblo), ARLIM(fbhi), &ncomp,D_DECL(&ratioV[0],&ratioV[1],&ratioV[2]), cdat,&clo,&chi, ARLIM(cblo), ARLIM(cbhi), fslo,fshi, cslope.dataPtr(),&c_len,fslope,fstrip,&f_len,foff, bc.dataPtr(), &slope_flag, D_DECL(fvc[0].dataPtr(),fvc[1].dataPtr(),fvc[2].dataPtr()), D_DECL(cvc[0].dataPtr(),cvc[1].dataPtr(),cvc[2].dataPtr())); #endif /*(BL_SPACEDIM > 1)*/ } PCInterp::~PCInterp () {} Box PCInterp::CoarseBox (const Box& fine, int ratio) { return BoxLib::coarsen(fine,ratio); } Box PCInterp::CoarseBox (const Box& fine, const IntVect& ratio) { return BoxLib::coarsen(fine,ratio); } void PCInterp::interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& /*crse_geom*/, const Geometry& /*fine_geom*/, Array& /*bcr*/) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::interp"); // // Set up to call FORTRAN. // const int* clo = crse.box().loVect(); const int* chi = crse.box().hiVect(); const int* flo = fine.loVect(); const int* fhi = fine.hiVect(); const int* fblo = fine_region.loVect(); const int* fbhi = fine_region.hiVect(); Box cregion(BoxLib::coarsen(fine_region,ratio)); const int* cblo = cregion.loVect(); const int* cbhi = cregion.hiVect(); int long_dir; int long_len = cregion.longside(long_dir); int s_len = long_len*ratio[long_dir]; Array strip(s_len); int strip_lo = ratio[long_dir] * cblo[long_dir]; int strip_hi = ratio[long_dir] * (cbhi[long_dir]+1) - 1; // // Convert long_dir to FORTRAN (1 based) index. // long_dir++; const Real* cdat = crse.dataPtr(crse_comp); Real* fdat = fine.dataPtr(fine_comp); const int* ratioV = ratio.getVect(); FORT_PCINTERP (cdat,ARLIM(clo),ARLIM(chi),cblo,cbhi, fdat,ARLIM(flo),ARLIM(fhi),fblo,fbhi, &long_dir,D_DECL(&ratioV[0],&ratioV[1],&ratioV[2]), &ncomp,strip.dataPtr(),&strip_lo,&strip_hi); } CellConservativeProtected::CellConservativeProtected () {} CellConservativeProtected::~CellConservativeProtected () {} Box CellConservativeProtected::CoarseBox (const Box& fine, const IntVect& ratio) { Box crse = BoxLib::coarsen(fine,ratio); crse.grow(1); return crse; } Box CellConservativeProtected::CoarseBox (const Box& fine, int ratio) { Box crse(BoxLib::coarsen(fine,ratio)); crse.grow(1); return crse; } void CellConservativeProtected::interp (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::interp"); BL_ASSERT(bcr.size() >= ncomp); BL_ASSERT(fine_geom.Domain().contains(fine_region)); // // Make box which is intersection of fine_region and domain of fine. // Box target_fine_region = fine_region & fine.box(); // // crse_bx is coarsening of target_fine_region, grown by 1. // Box crse_bx = CoarseBox(target_fine_region,ratio); // // Slopes are needed only on coarsening of target_fine_region. // Box cslope_bx(crse_bx); cslope_bx.grow(-1); // // Get coarse and fine edge-centered volume coordinates. // Array fvc[BL_SPACEDIM]; Array cvc[BL_SPACEDIM]; int dir; for (dir = 0; dir < BL_SPACEDIM; dir++) { fine_geom.GetEdgeVolCoord(fvc[dir],target_fine_region,dir); crse_geom.GetEdgeVolCoord(cvc[dir],crse_bx,dir); } // // alloc tmp space for slope calc. // // In ucc_slopes and lcc_slopes , there is a slight abuse of // the number of compenents argument // --> there is a slope for each component in each coordinate // direction // FArrayBox ucc_slopes(cslope_bx,ncomp*BL_SPACEDIM); FArrayBox lcc_slopes(cslope_bx,ncomp*BL_SPACEDIM); FArrayBox slope_factors(cslope_bx,BL_SPACEDIM); Real* fdat = fine.dataPtr(fine_comp); const Real* cdat = crse.dataPtr(crse_comp); Real* ucc_xsldat = ucc_slopes.dataPtr(0); Real* lcc_xsldat = lcc_slopes.dataPtr(0); Real* xslfac_dat = slope_factors.dataPtr(0); Real* ucc_ysldat = ucc_slopes.dataPtr(ncomp); Real* lcc_ysldat = lcc_slopes.dataPtr(ncomp); Real* yslfac_dat = slope_factors.dataPtr(1); #if (BL_SPACEDIM==3) Real* ucc_zsldat = ucc_slopes.dataPtr(2*ncomp); Real* lcc_zsldat = lcc_slopes.dataPtr(2*ncomp); Real* zslfac_dat = slope_factors.dataPtr(2); #endif const int* flo = fine.loVect(); const int* fhi = fine.hiVect(); const int* clo = crse.loVect(); const int* chi = crse.hiVect(); const int* fblo = target_fine_region.loVect(); const int* fbhi = target_fine_region.hiVect(); const int* csbhi = cslope_bx.hiVect(); const int* csblo = cslope_bx.loVect(); int lin_limit = 1; const int* cvcblo = crse_bx.loVect(); const int* fvcblo = target_fine_region.loVect(); int cvcbhi[BL_SPACEDIM]; int fvcbhi[BL_SPACEDIM]; for (dir=0; dir bc = GetBCArray(bcr); const int* ratioV = ratio.getVect(); #if (BL_SPACEDIM > 1) FORT_LINCCINTERP (fdat,ARLIM(flo),ARLIM(fhi), fblo, fbhi, ARLIM(fvcblo), ARLIM(fvcbhi), cdat,ARLIM(clo),ARLIM(chi), ARLIM(cvcblo), ARLIM(cvcbhi), ucc_xsldat, lcc_xsldat, xslfac_dat, ucc_ysldat, lcc_ysldat, yslfac_dat, #if (BL_SPACEDIM==3) ucc_zsldat, lcc_zsldat, zslfac_dat, #endif ARLIM(csblo), ARLIM(csbhi), csblo, csbhi, &ncomp,D_DECL(&ratioV[0],&ratioV[1],&ratioV[2]), bc.dataPtr(), &lin_limit, D_DECL(fvc[0].dataPtr(),fvc[1].dataPtr(),fvc[2].dataPtr()), D_DECL(cvc[0].dataPtr(),cvc[1].dataPtr(),cvc[2].dataPtr()), D_DECL(voffx,voffy,voffz)); D_TERM(delete [] voffx;, delete [] voffy;, delete [] voffz;); #endif /*(BL_SPACEDIM > 1)*/ } void CellConservativeProtected::protect (const FArrayBox& crse, int crse_comp, FArrayBox& fine, int fine_comp, FArrayBox& fine_state, int state_comp, int ncomp, const Box& fine_region, const IntVect& ratio, const Geometry& crse_geom, const Geometry& fine_geom, Array& bcr) { BL_ASSERT(bcr.size() >= ncomp); BL_ASSERT(fine_geom.Domain().contains(fine_region)); // // Make box which is intersection of fine_region and domain of fine. // Box target_fine_region = fine_region & fine.box(); // // crse_bx is coarsening of target_fine_region, grown by 1. // Box crse_bx = CoarseBox(target_fine_region,ratio); // // cs_bx is coarsening of target_fine_region. // Box cs_bx(crse_bx); cs_bx.grow(-1); // // Get coarse and fine edge-centered volume coordinates. // int dir; Array fvc[BL_SPACEDIM]; Array cvc[BL_SPACEDIM]; for (dir = 0; dir < BL_SPACEDIM; dir++) { fine_geom.GetEdgeVolCoord(fvc[dir],target_fine_region,dir); crse_geom.GetEdgeVolCoord(cvc[dir],crse_bx,dir); } #if (BL_SPACEDIM == 2) const int* cvcblo = crse_bx.loVect(); const int* fvcblo = target_fine_region.loVect(); int cvcbhi[BL_SPACEDIM]; int fvcbhi[BL_SPACEDIM]; for (dir=0; dir bc = GetBCArray(bcr); const int* ratioV = ratio.getVect(); #if (BL_SPACEDIM > 1) FORT_PROTECT_INTERP (fdat,ARLIM(flo),ARLIM(fhi), fblo, fbhi, cdat,ARLIM(clo),ARLIM(chi), csblo, csbhi, #if (BL_SPACEDIM == 2) fvc[0].dataPtr(),fvc[1].dataPtr(), ARLIM(fvcblo), ARLIM(fvcbhi), cvc[0].dataPtr(),cvc[1].dataPtr(), ARLIM(cvcblo), ARLIM(cvcbhi), #endif state_dat, ARLIM(slo), ARLIM(shi), &ncomp,D_DECL(&ratioV[0],&ratioV[1],&ratioV[2]), bc.dataPtr()); #endif /*(BL_SPACEDIM > 1)*/ } ccseapps-2.5/CCSEApps/amrlib/FLUXREG_1D.F0000644000175000017500000002603411634153073020701 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: FLUXREG_1D.F,v 1.2 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "FLUXREG_F.H" #include "ArrayLim.H" #define SDIM 1 c ::: ----------------------------------------------------------- c ::: Init coarse grid flux into flux register c ::: c ::: INPUTS/OUTPUTS: c ::: flx => flux array c ::: DIMS(flx) => index limits for flx c ::: reg <= flux register c ::: DIMS(reg) => index limits for reg c ::: lo,hi => region of update c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRCRSEINIT (reg,DIMS(reg),flx,DIMS(flx),lo,hi, & numcomp,dir,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer lo(SDIM), hi(SDIM) integer numcomp, dir REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) integer n, i, lenx lenx = hi(1)-lo(1)+1 do n = 1, numcomp do i = lo(1), hi(1) reg(i,n) = mult*flx(i,n) end do end do return end c ::: ----------------------------------------------------------- c ::: Init coarse grid flux (times area) into flux register c ::: c ::: INPUTS/OUTPUTS: c ::: flx => flux array c ::: DIMS(flx) => index limits for flx c ::: reg <= flux register c ::: DIMS(reg) => index limits for reg c ::: area => aread of cell edge c ::: DIMS(area) => index limits for area c ::: lo,hi => region of update c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRCAINIT (reg,DIMS(reg),flx,DIMS(flx), & area,DIMS(area),lo,hi, & numcomp,dir,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer DIMDEC(area) integer lo(SDIM), hi(SDIM) integer numcomp, dir REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) REAL_T area(DIMV(area)) integer n, i, lenx lenx = hi(1)-lo(1)+1 do n = 1, numcomp do i = lo(1), hi(1) reg(i,n) = mult*area(i)*flx(i,n) end do end do return end c ::: ----------------------------------------------------------- c ::: Add fine grid flux to flux register. Flux array is a fine grid c ::: edge based object, Register is a coarse grid edge based object. c ::: It is assumed that the coarsened flux region contains the register c ::: region. c ::: c ::: INPUTS/OUTPUTS: c ::: reg <=> edge centered coarse grid flux register c ::: DIMS(reg) => index limits for reg c ::: flx => edge centered fine grid flux array c ::: DIMS(flx) => index limits for flx c ::: numcomp => number of components to update c ::: dir => direction normal to flux register c ::: ratio(2) => refinement ratios between coarse and fine c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRFINEADD(reg,DIMS(reg),flx,DIMS(flx), & numcomp,dir,ratio,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer ratio(1), dir, numcomp REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) integer n, i, ic integer ratiox ratiox = ratio(1) if (dir .eq. 0) then c ::::: flux normal to X direction ic = ARG_L1(reg) i = ic*ratiox if (ARG_L1(reg) .ne. ARG_H1(reg)) then call bl_abort("FORT_FRFINEADD: bad register direction") end if if (i .lt. ARG_L1(flx) .or. i .gt. ARG_H1(flx)) then call bl_abort("FORT_FRFINEADD: index outside flux range") end if do n = 1, numcomp reg(ic,n) = reg(ic,n) + mult*flx(i,n) end do end if return end c ::: ----------------------------------------------------------- c ::: Add fine grid flux times area to flux register. c ::: Flux array is a fine grid edge based object, Register is a c ::: coarse grid edge based object. c ::: It is assumed that the coarsened flux region contains the register c ::: region. c ::: c ::: INPUTS/OUTPUTS: c ::: reg <=> edge centered coarse grid flux register c ::: rlo,rhi => index limits for reg c ::: flx => edge centered fine grid flux array c ::: DIMS(flx) => index limits for flx c ::: area => edge centered area array c ::: DIMS(area) => index limits for area c ::: numcomp => number of components to update c ::: dir => direction normal to flux register c ::: ratio(2) => refinements ratio between coarse and fine c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FRFAADD(reg,DIMS(reg),flx,DIMS(flx),area,DIMS(area), & numcomp,dir,ratio,mult) integer DIMDEC(reg) integer DIMDEC(flx) integer DIMDEC(area) integer ratio(1), dir, numcomp REAL_T mult REAL_T reg(DIMV(reg),numcomp) REAL_T flx(DIMV(flx),numcomp) REAL_T area(DIMV(area)) integer n, i, ic integer ratiox ratiox = ratio(1) if (dir .eq. 0) then c ::::: flux normal to X direction ic = ARG_L1(reg) i = ic*ratiox if (ARG_L1(reg) .ne. ARG_H1(reg)) then call bl_abort("FORT_FRFAADD: bad register direction") end if if (i .lt. ARG_L1(flx) .or. i .gt. ARG_H1(flx)) then call bl_abort("FORT_FRFAADD: index outside flux range") end if do n = 1, numcomp reg(ic,n) = reg(ic,n) + mult*area(i)*flx(i,n) end do end if return end c :: c :: -------------------------------------------------------------- c :: reflux: reflux the data on the outer boundary of c :: a fine grid. c :: c :: Inputs/Outputs c :: s <=> state data array c :: slo,shi => index limits of s array c :: vol => volume array c :: vlo,vhi => index limits of vol array c :: reg => flux register c :: rlo,rhi => index limits of reg array c :: lo,hi => subregion of s array to be updated c :: numcomp => number of components to update c :: mult => multiplative factor (+1 or -1 depending on nomal) c :: -------------------------------------------------------------- c :: subroutine FORT_FRREFLUX (s,DIMS(s),vol,DIMS(vol),reg,DIMS(reg),lo,hi, & numcomp,mult) integer DIMDEC(s) integer DIMDEC(vol) integer DIMDEC(reg) integer lo(SDIM), hi(SDIM) integer numcomp REAL_T mult REAL_T reg(DIMV(reg),numcomp) c :: For Multifluid reg is defined as: REAL_T reg(DIMV(reg),numcomp+FLUX_EXTRA) REAL_T s(DIMV(s),numcomp) REAL_T vol(DIMV(vol)) integer n, i, lenx lenx = hi(1) - lo(1) + 1 do n = 1, numcomp do i = lo(1), hi(1) s(i,n) = s(i,n) + mult*reg(i,n)/vol(i) end do end do return end c :: c :: -------------------------------------------------------------- c :: cvreflux: constant volume version of reflux c :: c :: Inputs/Outputs c :: s <=> state data array c :: slo,shi => index limits of s array c :: dx => cell size c :: reg => flux register c :: rlo,rhi => index limits of reg array c :: lo,hi => subregion of s array to be updated c :: numcomp => number of components to update c :: mult => multiplative factor (+1 or -1 depending on nomal) c :: -------------------------------------------------------------- c :: subroutine FORT_FRCVREFLUX (s,DIMS(s),dx,reg,DIMS(reg),lo,hi, & numcomp,mult) integer DIMDEC(s) integer DIMDEC(reg) integer lo(SDIM), hi(SDIM) integer numcomp REAL_T mult, dx(SDIM) REAL_T reg(DIMV(reg),numcomp) c :: For Multifluid reg is defined as: REAL_T reg(DIMV(reg),numcomp+FLUX_EXTRA) REAL_T s(DIMV(s),numcomp) integer n, i, lenx REAL_T vol vol = dx(1) lenx = hi(1) - lo(1) + 1 do n = 1, numcomp do i = lo(1), hi(1) s(i,n) = s(i,n) + mult*reg(i,n)/vol end do end do return end c ::: ----------------------------------------------------------- c ::: Add flux register into coarse grid flux (opposite of standard reflux ops) c ::: c ::: INPUTS/OUTPUTS: c ::: flx => flux array c ::: DIMS(flx) => index limits for flx c ::: reg <= flux register c ::: DIMS(reg) => index limits for reg c ::: lo,hi => region of update c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_SCALADDTO (flx,DIMS(flx),area,DIMS(area),reg,DIMS(reg), $ lo,hi,numcomp,mult) integer DIMDEC(flx) integer DIMDEC(area) integer DIMDEC(reg) integer lo(SDIM), hi(SDIM) integer numcomp REAL_T mult REAL_T flx(DIMV(flx),numcomp) REAL_T area(DIMV(area)) REAL_T reg(DIMV(reg),numcomp) integer n, i, istart if (area(lo(1)) .lt. 1.d-8) then do n = 1, numcomp flx(lo(1),n) = flx(lo(1),n) end do istart = lo(1)+1 else istart = lo(1) end if do n = 1, numcomp do i = istart, hi(1) flx(i,n) = flx(i,n) + mult*reg(i,numcomp)/area(i) end do end do return end ccseapps-2.5/CCSEApps/HCAll/0000755000175000017500000000000011634153073016602 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/HCAll/Banner.html0000644000175000017500000000056711634153073020705 0ustar amckinstryamckinstry

Problems with this Web page should be sent to webmaster@mothra.lbl.gov

Bugs in the software should be sent to guthamr-bugs@mothra.lbl.gov

(C)opyright by Lawrence Berkeley National Laboratory ccseapps-2.5/CCSEApps/HCAll/Make.package0000644000175000017500000000062311634153073020775 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.23 2000/04/24 16:56:39 sstanley Exp $ # CEXE_headers += Prob.H probdata.H ProbBld.H LevelAdvance.H HyperCLaw.H CEXE_headers += SplitIntegrator.H CEXE_sources += main.cpp HyperCLaw.cpp LevelAdvance.cpp Prob.cpp FEXE_headers += GODUNOV_F.H DERIVE_F.H HYPERCLAW_F.H PROB_F.H FEXE_sources += GODUNOV_$(DIM)D.F DERIVE_$(DIM)D.F HYPERCLAW_$(DIM)D.F FEXE_sources += PROB_$(DIM)D.F ccseapps-2.5/CCSEApps/HCAll/main.cpp0000644000175000017500000000765611634153073020250 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: main.cpp,v 1.44 2002/03/13 18:59:37 vince Exp $ // #include #include #include #include #ifndef WIN32 #include #endif #include #include #include #include #include #include #include #include #include int main (int argc, char* argv[]) { // // Make sure to catch new failures. // BoxLib::Initialize(argc,argv); Real dRunTime1 = ParallelDescriptor::second(); std::cout << std::setprecision(10); int max_step; Real strt_time; Real stop_time; ParmParse pp; max_step = -1; strt_time = 0.0; stop_time = -1.0; pp.query("max_step",max_step); pp.query("strt_time",strt_time); pp.query("stop_time",stop_time); if (strt_time < 0.0) { BoxLib::Abort("MUST SPECIFY a non-negative strt_time"); } if (max_step < 0 && stop_time < 0.0) { BoxLib::Abort( "Exiting because neither max_step nor stop_time is non-negative."); } // // Initialize random seed after we're running in parallel. // Amr* amrptr = new Amr; amrptr->init(strt_time,stop_time); while ( amrptr->okToContinue() && (amrptr->levelSteps(0) < max_step || max_step < 0) && (amrptr->cumTime() < stop_time || stop_time < 0.0) ) { // // Do a timestep. // amrptr->coarseTimeStep(stop_time); } delete amrptr; // // This MUST follow the above delete as ~Amr() may dump files to disk. // const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real dRunTime2 = ParallelDescriptor::second() - dRunTime1; ParallelDescriptor::ReduceRealMax(dRunTime2,IOProc); if (ParallelDescriptor::IOProcessor()) { std::cout << "Run time = " << dRunTime2 << std::endl; } if (CArena* arena = dynamic_cast(BoxLib::The_Arena())) { // // A barrier to make sure our output follows that of RunStats. // ParallelDescriptor::Barrier(); // // We're using a CArena -- output some FAB memory stats. // // This'll output total # of bytes of heap space in the Arena. // // It's actually the high water mark of heap space required by FABs. // char buf[256]; sprintf(buf, "CPU(%d): Heap Space (bytes) used by Coalescing FAB Arena: %ld", ParallelDescriptor::MyProc(), arena->heap_space_used()); std::cout << buf << std::endl; } BoxLib::Finalize(); return 0; } ccseapps-2.5/CCSEApps/HCAll/bubble/0000755000175000017500000000000011634153073020035 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/HCAll/bubble/HYPERCLAW_3D.F0000644000175000017500000002471411634153073022040 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: HYPERCLAW_3D.F,v 1.2 1999/04/02 19:28:19 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "HYPERCLAW_F.H" #include "ArrayLim.H" #include "integrator.fh" #define SDIM 3 c :: c :: ---------------------------------------------------------- c :: estimate the timestep for this grid r c :: c :: INPUTS/OUTPUTS c :: state => state array c :: slo,shi => index limits of state array c :: c => c array c :: clo,chi => index limits of c array c :: delta => cell size c :: dt <= timestep estimate c :: c :: ---------------------------------------------------------- c :: subroutine FORT_ESTDT (state,DIMS(s),c,DIMS(c),lo,hi,delta,dt,nv) integer nv integer lo(SDIM), hi(SDIM) integer DIMDEC(s) integer DIMDEC(c) REAL_T dt REAL_T delta(SDIM) REAL_T state(DIMV(s),nv) REAL_T c(DIMV(c)) integer i, j, k, is,ie,js,je, ks,ke REAL_T ux,uy,uz,dt1,dt2,dt3,dx,dy, dz REAL_T small,gdum,pdum,csdum is = lo(1) js = lo(2) ks = lo(3) ie = hi(1) je = hi(2) ke = hi(3) dx = delta(1) dy = delta(2) dz = delta(3) dt = bigreal do k = ks, ke do j = js, je do i = is, ie ux = state(i,j,k,2)/state(i,j,k,1) uy = state(i,j,k,3)/state(i,j,k,1) uz = state(i,j,k,4)/state(i,j,k,1) state(i,j,k,5) = state(i,j,k,5)/state(i,j,k,1) - $ half*(ux**2 + uy**2 + uz**2) state(i,j,k,6) = state(i,j,k,6)/state(i,j,k,1) end do end do end do call eos(state(is,js,ks,1),state(is,js,ks,5),state(is,js,ks,6), $ DIMS(s), $ gdum,pdum,c,csdum, $ DIMS(c), $ lo, hi,0,0,1,0) do k = ks, ke do j = js, je do i = is, ie ux = abs(state(i,j,k,2))/state(i,j,k,1) uy = abs(state(i,j,k,3))/state(i,j,k,1) uz = abs(state(i,j,k,4))/state(i,j,k,1) dt1 = dx/(c(i,j,k) + ux) dt2 = dy/(c(i,j,k) + uy) dt3 = dz/(c(i,j,k) + uz) dt = min(dt,dt1,dt2,dt3) end do end do end do end c :: ---------------------------------------------------------- c :: Volume-weight average the fine grid data onto the coarse c :: grid. Overlap is given in coarse grid coordinates. c :: c :: INPUTS / OUTPUTS: c :: crse <= coarse grid data c :: clo,chi => index limits of crse array interior c :: ngc => number of ghost cells in coarse array c :: nvar => number of components in arrays c :: fine => fine grid data c :: flo,fhi => index limits of fine array interior c :: ngf => number of ghost cells in fine array c :: rfine => (ignore) used in 2-D RZ calc c :: lo,hi => index limits of overlap (crse grid) c :: lrat => refinement ratio c :: c :: NOTE: c :: Assumes all data cell centered c :: ---------------------------------------------------------- c :: subroutine FORT_AVGDOWN (crse,DIMS(c),nvar,cv,DIMS(cv), & fine,DIMS(f),fv,DIMS(fv),lo,hi,lrat) integer DIMDEC(c) integer DIMDEC(cv) integer DIMDEC(f) integer DIMDEC(fv) integer lo(SDIM), hi(SDIM) integer nvar, lrat(SDIM) REAL_T crse(DIMV(c),nvar) REAL_T cv(DIMV(cv)) REAL_T fine(DIMV(f),nvar) REAL_T fv(DIMV(fv)) integer i, j, k, n, ic, jc, kc, ioff, joff, koff integer lenx, leny, lenz, mxlen integer lratx, lraty, lratz REAL_T volfrac lratx = lrat(1) lraty = lrat(2) lratz = lrat(3) lenx = hi(1)-lo(1)+1 leny = hi(2)-lo(2)+1 lenz = hi(3)-lo(3)+1 mxlen = max(lenx,leny,lenz) volfrac = one/float(lrat(1)*lrat(2)*lrat(3)) if (lenx .eq. mxlen) then do n = 1, nvar c c ::::: set coarse grid to zero on overlap c do kc = lo(3), hi(3) do jc = lo(2), hi(2) do ic = lo(1), hi(1) crse(ic,jc,kc,n) = zero enddo enddo enddo c c ::::: sum fine data c do koff = 0, lratz-1 do kc = lo(3),hi(3) k = kc*lratz + koff do joff = 0, lraty-1 do jc = lo(2), hi(2) j = jc*lraty + joff do ioff = 0, lratx-1 do ic = lo(1), hi(1) i = ic*lratx + ioff crse(ic,jc,kc,n) = crse(ic,jc,kc,n) + fine(i,j,k,n) enddo enddo enddo enddo enddo enddo c c ::::: divide out by volume weight c do kc = lo(3), hi(3) do jc = lo(2), hi(2) do ic = lo(1), hi(1) crse(ic,jc,kc,n) = volfrac*crse(ic,jc,kc,n) enddo enddo enddo end do else if (leny .eq. mxlen) then do n = 1, nvar c c ::::: set coarse grid to zero on overlap c do kc = lo(3), hi(3) do ic = lo(1), hi(1) do jc = lo(2), hi(2) crse(ic,jc,kc,n) = zero enddo enddo enddo c c ::::: sum fine data c do koff = 0, lratz-1 do kc = lo(3), hi(3) k = kc*lratz + koff do ioff = 0, lratx-1 do ic = lo(1), hi(1) i = ic*lratx + ioff do joff = 0, lraty-1 do jc = lo(2), hi(2) j = jc*lraty + joff crse(ic,jc,kc,n) = crse(ic,jc,kc,n) + fine(i,j,k,n) enddo enddo enddo enddo enddo enddo c c ::::: divide out by volume weight c do kc = lo(3), hi(3) do ic = lo(1), hi(1) do jc = lo(2), hi(2) crse(ic,jc,kc,n) = volfrac*crse(ic,jc,kc,n) enddo enddo enddo end do else do n = 1, nvar c c ::::: set coarse grid to zero on overlap c do ic = lo(1), hi(1) do jc = lo(2), hi(2) do kc = lo(3), hi(3) crse(ic,jc,kc,n) = zero enddo enddo enddo c c ::::: sum fine data c do joff = 0, lraty-1 do jc = lo(2), hi(2) j = jc*lraty + joff do ioff = 0, lratx-1 do ic = lo(1), hi(1) i = ic*lratx + ioff do koff = 0, lratz-1 do kc = lo(3), hi(3) k = kc*lratz + koff crse(ic,jc,kc,n) = crse(ic,jc,kc,n) + fine(i,j,k,n) enddo enddo enddo enddo enddo enddo c c ::::: divide out by volume weight c do jc = lo(2), hi(2) do ic = lo(1), hi(1) do kc = lo(3), hi(3) crse(ic,jc,kc,n) = volfrac*crse(ic,jc,kc,n) enddo enddo enddo end do end if end c :: ---------------------------------------------------------- c :: SUMMASS c :: MASS = sum{ vol(i,j)*rho(i,j) } c :: c :: INPUTS / OUTPUTS: c :: rho => density field c :: rlo,rhi => index limits of rho aray c :: lo,hi => index limits of grid interior c :: delta => cell size c :: mass <= total mass c :: r => radius at cell center c :: irlo,hi => index limits of r array c :: rz_flag => == 1 if R_Z coords c :: tmp => temp column array c :: ---------------------------------------------------------- c :: subroutine FORT_SUMMASS(rho,DIMS(r),lo,hi,delta,mass, & r,irlo,irhi,rz_flag,tmp, tlo, thi) integer irlo, irhi, rz_flag integer DIMDEC(r) integer lo(SDIM), hi(SDIM) REAL_T mass, delta(SDIM) REAL_T rho(DIMV(r)) REAL_T r(irlo:irhi) integer tlo, thi REAL_T tmp(tlo:thi) integer i, j, k REAL_T dx, dy, dz, vol dx = delta(1) dy = delta(2) dz = delta(3) vol = dx*dy*dz do j = lo(2),hi(2) tmp(j) = zero enddo do k = lo(3), hi(3) do i = lo(1), hi(1) do j = lo(2), hi(2) tmp(j) = tmp(j) + vol*rho(i,j,k) enddo enddo enddo mass = zero do j = lo(2), hi(2) mass = mass + tmp(j) enddo end ccseapps-2.5/CCSEApps/HCAll/bubble/GODUNOV_2D.F0000644000175000017500000014446511634153073021630 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ /* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: GODUNOV_2D.F,v 1.1 2002/04/11 22:36:43 marc Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "GODUNOV_F.H" #include "ArrayLim.H" #define SDIM 2 #define NGHOST 3 #define LEFT 0 #define RIGHT 1 #define BOTTOM 2 #define TOP 3 #define INTERIOR -1 #define ON_PHYS_B 0 #define NQ (5+NADV) #if __STDC__==1 #define BL_ARGL1(u) u##_l1 #define BL_ARGL2(u) u##_l2 #define BL_ARGH1(u) u##_h1 #define BL_ARGH2(u) u##_h2 #define BL_IARG(u) u##_l1, u##_l2, u##_h1, u##_h2 #define BL_UVAR(u,v) REAL_T u(v##_l1:v##_h1, v##_l2:v##_h2) #else #define BL_ARGL1(u) u/**/_l1 #define BL_ARGL2(u) u/**/_l2 #define BL_ARGH1(u) u/**/_h1 #define BL_ARGH2(u) u/**/_h2 #define BL_IARG(u) u/**/_l1, u/**/_l2, u/**/_h1, u/**/_h2 #define BL_UVAR(u,v) REAL_T u(v/**/_l1:v/**/_h1, v/**/_l2:v/**/_h2) #endif c c From ArrayLim.H ... c #define BL_FARG(u) u, DIMS(u) #define BL_FBOUNDS(u) integer DIMDEC(u) #define BL_FARRAY(u,n) REAL_T u(DIMV(u), n) #define BL_FARRAY1(u) REAL_T u(DIMV(u)) #if __STDC__==1 #define BL_BARG(b) b##lo, b##hi #define BL_BBOUNDS(b) integer b##lo(2), b##hi(2) #else #define BL_BARG(b) b/**/lo, b/**/hi #define BL_BBOUNDS(b) integer b/**/lo(2), b/**/hi(2) #endif c c --------------------------------------------------------------- c:: Characteristic tracing for hyperbolic conservation law c:: Arguments: c:: q => field of primitive variables c:: qx => x-slopes of primitive variables c:: c => sound speed c:: enth <= enthalpy c:: qbarl <= left-edge traced state c:: qbarr <= right-edge traced state c:: bxlo,bxhi => index limits of grid interior c:: bc => array of bndry condition flags c:: delta => cell size c:: dt => timestep size c:: nvar => number of characteristic variables c --------------------------------------------------------------- c ::: these give meaning to the primitive variable components #define QRHO 1 #define QVEL1 2 #define QVEL2 3 #define QPRES 4 #define QRHOE 5 #if(NADV>0) #define QADV 6 #endif subroutine FORT_XTRACE( $ BL_FARG(q), $ BL_FARG(qx), $ BL_FARG(c), BL_FARG(enth), BL_FARG(qbarl), BL_FARG(qbarr), $ BL_FARG(dloga), BL_FARG(courno), & BL_BARG(bx), & delta, dt, bc, gBndry, nvar & ) integer nvar, gBndry(0:SDIM*SDIM-1) integer bc(SDIM,2,nvar-1),qbc(SDIM,2,NQ) REAL_T delta(SDIM), dt BL_FBOUNDS(q) BL_FBOUNDS(qx) BL_FBOUNDS(c) BL_FBOUNDS(enth) BL_FBOUNDS(qbarl) BL_FBOUNDS(qbarr) BL_FBOUNDS(dloga) BL_FBOUNDS(courno) BL_BBOUNDS(bx) BL_FARRAY(q,nvar) BL_FARRAY(qx,nvar) BL_FARRAY(qbarl,nvar) BL_FARRAY(qbarr,nvar) BL_FARRAY1(c) BL_FARRAY1(enth) BL_FARRAY1(dloga) BL_FARRAY1(courno) integer i, j, n, nbc integer is, ie, js, je, isedg, ieedg,jsedg,jeedg REAL_T dx, dy REAL_T spvol, dtbydx, scr, eken, eta, dthalf REAL_T sourcp, sourcr, source, avgarea REAL_T alpham, alphap, alpha0r, alpha0e REAL_T alpha0v1 REAL_T spminus, spplus, spzero REAL_T apright, amright REAL_T apleft, amleft REAL_T azrright, azeright, azv1rght REAL_T azrleft, azeleft, azv1left REAL_T smallr REAL_T reflect REAL_T gdum,csdum,pdum c ::: some useful macro definitions # define U(i,j) q(i,j,QVEL1) # define V(i,j) q(i,j,QVEL2) # define P(i,j) q(i,j,QPRES) # define RHO(i,j) q(i,j,QRHO) # define RHOE(i,j) q(i,j,QRHOE) #if(NADV>0) # define ADV(i,j) q(i,j,QADV) #endif # define DU(i,j) qx(i,j,QVEL1) # define DV(i,j) qx(i,j,QVEL2) # define DP(i,j) qx(i,j,QPRES) # define DRHO(i,j) qx(i,j,QRHO) # define DRHOE(i,j) qx(i,j,QRHOE) #if(NADV>0) # define DADV(i,j) qx(i,j,QADV) #endif dx = delta(1) dy = delta(2) is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) isedg = qbarl_l1 ieedg = qbarl_h1 jsedg = qbarl_l2 jeedg = qbarl_h2 smallr = 1.0d-6 dtbydx = dt/dx #if 0 c ::: convert energy to intensive form for eos call do j = js,je do i =is,ie RHOE(i,j) = RHOE(i,j)/RHO(i,j) end do end do call eos(RHO(is,js),RHOE(is,js), $ gdum,pdum,c,csdum,bxlo,bxhi,0,0,1,0) #endif c convert energy to extensive form and compute courant number do j = js,je do i =is,ie c RHOE(i,j) = RHOE(i,j)*RHO(i,j) courno(i,j) = dtbydx*(c(i,j)+abs(U(i,j))) end do end do c characteristic analysis do j = jsedg,jeedg do i = isedg,ieedg-1 enth(i,j) = (RHOE(i,j)/RHO(i,j) + $ P(i,j)/RHO(i,j))/c(i,j)**2 alpham = half*(DP(i,j)/(RHO(i,j)*c(i,j)) - DU(i,j))*RHO(i,j) $ /c(i,j) alphap = half*(DP(i,j)/(RHO(i,j)*c(i,j)) + DU(i,j))*RHO(i,j) $ /c(i,j) alpha0r = DRHO(i,j) - DP(i,j)/c(i,j)**2 alpha0e = DRHOE(i,j) - DP(i,j)*enth(i,j) alpha0v1 = DV(i,j) c ::: ::::: Right state of edge at left spminus = cvmgp(-one,(U(i,j) - c(i,j))*dtbydx,U(i,j) - c(i,j)) spplus = cvmgp(-one,(U(i,j) + c(i,j))*dtbydx,U(i,j) + c(i,j)) spzero = cvmgp(-one, U(i,j) *dtbydx,U(i,j) ) apright = half*(-one - spplus )*alphap amright = half*(-one - spminus)*alpham azrright= half*(-one - spzero )*alpha0r azeright= half*(-one - spzero )*alpha0e azv1rght= half*(-one - spzero )*alpha0v1 qbarr(i,j,QRHO) = q(i,j,QRHO) + apright + amright + azrright qbarr(i,j,QRHO) = max(smallr, qbarr(i,j,QRHO)) qbarr(i,j,QVEL1) = q(i,j,QVEL1) + $ (apright - amright)*c(i,j)/RHO(i,j) qbarr(i,j,QVEL2) = q(i,j,QVEL2) + azv1rght qbarr(i,j,QPRES) = q(i,j,QPRES) + $ (apright + amright)*c(i,j)**2 qbarr(i,j,QRHOE) = q(i,j,QRHOE) + (apright + $ amright)*enth(i,j)*c(i,j)**2 + azeright #if(NADV>0) qbarr(i,j,QADV) = q(i,j,QADV)+half*(-one-spzero)*DADV(i,j) #endif c ::: ::::: Left state of edge at right spminus = cvmgp((U(i,j) - c(i,j))*dtbydx,one,U(i,j) - c(i,j)) spplus = cvmgp((U(i,j) + c(i,j))*dtbydx,one,U(i,j) + c(i,j)) spzero = cvmgp( U(i,j) *dtbydx,one,U(i,j) ) apleft = half*(one - spplus )*alphap amleft = half*(one - spminus)*alpham azrleft= half*(one - spzero )*alpha0r azeleft= half*(one - spzero )*alpha0e azv1left= half*(one - spzero )*alpha0v1 qbarl(i+1,j,QRHO) = q(i,j,QRHO) + apleft + amleft + azrleft qbarl(i+1,j,QRHO) = max(smallr, qbarl(i+1,j,QRHO)) qbarl(i+1,j,QVEL1) = q(i,j,QVEL1) + $ (apleft - amleft)*c(i,j)/RHO(i,j) qbarl(i+1,j,QVEL2) = q(i,j,QVEL2) + azv1left qbarl(i+1,j,QPRES) = q(i,j,QPRES) + $ (apleft + amleft)*c(i,j)**2 qbarl(i+1,j,QRHOE) = q(i,j,QRHOE) + (apleft + amleft)* $ enth(i,j)*c(i,j)**2 + azeleft #if(NADV>0) qbarl(i+1,j,QADV) = q(i,j,QADV)+half*(one-spzero)*DADV(i,j) #endif end do end do c ::: Colella hack near R=0 singularity do j = js,je do i = is,ie if (dloga(i,j) .ne. zero) then eta = (one-courno(i,j))/(c(i,j)*dt*dloga(i,j)) eta = min(one, eta) dloga(i,j) = dloga(i,j) * eta end if end do end do dthalf = half*dt c ::: add geometric source terms to traced states do j = jsedg,jeedg do i = isedg,ieedg-1 sourcr = -RHO(i,j)*dloga(i,j)*U(i,j)*dthalf sourcp = sourcr*c(i,j)**2 source = sourcp*enth(i,j) qbarl(i+1,j,QRHO) = qbarl(i+1,j,QRHO) + sourcr qbarl(i+1,j,QRHO) = max(smallr, qbarl(i+1,j,QRHO)) qbarl(i+1,j,QPRES) = qbarl(i+1,j,QPRES) + sourcp qbarl(i+1,j,QRHOE) = qbarl(i+1,j,QRHOE) + source qbarr(i,j ,QRHO) = qbarr(i,j ,QRHO) + sourcr qbarr(i,j ,QRHO) = max(smallr, qbarr(i,j,QRHO)) qbarr(i,j ,QPRES) = qbarr(i,j ,QPRES) + sourcp qbarr(i,j ,QRHOE) = qbarr(i,j ,QRHOE) + source end do end do #if 0 c ::: convert energy back to intensive form c ::: for eos call in RIEMANN do j = js,je do i =is,ie RHOE(i,j) = RHOE(i,j)/RHO(i,j) end do end do #endif #if 0 c warning: nqvar = nstatevar+1 do n = 1, nvar-1 qbc(1,1,n) = bc(1,1,n) qbc(1,2,n) = bc(1,2,n) qbc(2,1,n) = bc(2,1,n) qbc(2,2,n) = bc(2,2,n) end do qbc(1,1,nvar) = qbc(1,1,nvar-1) qbc(1,2,nvar) = qbc(1,2,nvar-1) qbc(2,1,nvar) = qbc(2,1,nvar-1) qbc(2,2,nvar) = qbc(2,2,nvar-1) do n = 1,nvar do j = jsedg,jeedg reflect = cvmgt(-one,one,qbc(1,1,n).eq.REFLECT_ODD) i = isedg qbarl(i,j,n) = reflect*qbarr(i,j,n) reflect = cvmgt(-one,one,qbc(1,2,n).eq.REFLECT_ODD) i = ieedg qbarr(i,j,n) = reflect*qbarl(i,j,n) end do end do #endif #undef U #undef V #undef P #undef RHO #undef RHOE #undef DU #undef DV #undef DP #undef DRHO #undef DRHOE #if(NADV>0) #undef DADV #endif return end c c --------------------------------------------------------------- c:: Y characteristic tracing for hyperbolic conservation law c:: Arguments: c:: q => field of primitive variables c:: qy => x-slopes of primitive variables c:: c => sound speed c:: enth <= enthalpy c:: qbarl <= bottom-edge traced state c:: qbarr <= top-edge traced state c:: bxlo,bxhi => index limits of grid interior c:: bc => array of bndry condition flags c:: delta => cell size c:: dt => timestep size c:: nvar => number of characteristic variables c --------------------------------------------------------------- c ::: these give meaning to the primitive variable components #define QRHO 1 #define QVEL1 2 #define QVEL2 3 #define QPRES 4 #define QRHOE 5 #if(NADV>0) #define QADV 6 #endif subroutine FORT_YTRACE( & BL_FARG(q), & BL_FARG(qy), & BL_FARG(c), & BL_FARG(enth), & BL_FARG(qbarl), & BL_FARG(qbarr), & BL_FARG(dloga), & BL_FARG(courno), & BL_BARG(bx), & delta, dt, bc, gBndry, nvar & ) integer nvar, gBndry(0:SDIM*SDIM-1) integer bc(SDIM,2,nvar-1),qbc(SDIM,2,NQ) REAL_T delta(SDIM), dt BL_FBOUNDS(q) BL_FBOUNDS(qy) BL_FBOUNDS(qbarl) BL_FBOUNDS(qbarr) BL_FBOUNDS(c) BL_FBOUNDS(enth) BL_FBOUNDS(dloga) BL_FBOUNDS(courno) BL_BBOUNDS(bx) BL_FARRAY(q,nvar) BL_FARRAY(qy,nvar) BL_FARRAY(qbarl,nvar) BL_FARRAY(qbarr,nvar) BL_FARRAY1(c) BL_FARRAY1(enth) BL_FARRAY1(dloga) BL_FARRAY1(courno) integer i, j, n, nbc integer is, ie, js, je, isedg, ieedg,jsedg,jeedg REAL_T dx, dy REAL_T spvol, dtbydx, scr, eken, eta, dthalf REAL_T sourcp, sourcr, source, avgarea REAL_T alpham, alphap, alpha0r, alpha0e REAL_T alpha0v1 REAL_T spminus, spplus, spzero REAL_T apright, amright REAL_T apleft, amleft REAL_T azrright, azeright, azv1rght REAL_T azrleft, azeleft, azv1left REAL_T smallr REAL_T reflect REAL_T gdum,csdum,pdum c ::: some useful macro definitions # define U(i,j) q(i,j,QVEL1) # define V(i,j) q(i,j,QVEL2) # define P(i,j) q(i,j,QPRES) # define RHO(i,j) q(i,j,QRHO) # define RHOE(i,j) q(i,j,QRHOE) #if(NADV>0) # define ADV(i,j) q(i,j,QADV) #endif # define DU(i,j) qy(i,j,QVEL1) # define DV(i,j) qy(i,j,QVEL2) # define DP(i,j) qy(i,j,QPRES) # define DRHO(i,j) qy(i,j,QRHO) # define DRHOE(i,j) qy(i,j,QRHOE) #if(NADV>0) # define DADV(i,j) qy(i,j,QADV) #endif dx = delta(1) dy = delta(2) is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) isedg = qbarl_l1 ieedg = qbarl_h1 jsedg = qbarl_l2 jeedg = qbarl_h2 smallr = 1.0d-6 dtbydx = dt/dx c ::: convert energy to intensive form for eos call #if 0 do j = js,je do i =is,ie RHOE(i,j) = RHOE(i,j)/RHO(i,j) end do end do call eos(RHO(is,js),RHOE(is,js), $ gdum,pdum,c,csdum,bxlo,bxhi,0,0,1,0) #endif c convert energy back to extensive form and compute courant number do j = js,je do i =is,ie c RHOE(i,j) = RHOE(i,j)*RHO(i,j) courno(i,j) = dtbydx*(c(i,j)+abs(V(i,j))) end do end do c characteristic analysis do j = jsedg,jeedg-1 do i = isedg,ieedg enth(i,j) = (RHOE(i,j)/RHO(i,j) + $ P(i,j)/RHO(i,j))/c(i,j)**2 alpham = half*(DP(i,j)/(RHO(i,j)*c(i,j)) - DV(i,j))*RHO(i,j) $ /c(i,j) alphap = half*(DP(i,j)/(RHO(i,j)*c(i,j)) + DV(i,j))*RHO(i,j) $ /c(i,j) alpha0r = DRHO(i,j) - DP(i,j)/c(i,j)**2 alpha0e = DRHOE(i,j) - DP(i,j)*enth(i,j) alpha0v1 = DU(i,j) c ::: ::::: Top state of edge at bottom spminus = cvmgp(-one,(V(i,j) - c(i,j))*dtbydx,V(i,j) - c(i,j)) spplus = cvmgp(-one,(V(i,j) + c(i,j))*dtbydx,V(i,j) + c(i,j)) spzero = cvmgp(-one, V(i,j) *dtbydx,V(i,j) ) apright = half*(-one - spplus )*alphap amright = half*(-one - spminus)*alpham azrright= half*(-one - spzero )*alpha0r azeright= half*(-one - spzero )*alpha0e azv1rght= half*(-one - spzero )*alpha0v1 qbarr(i,j,QRHO) = q(i,j,QRHO) + apright + amright + azrright qbarr(i,j,QRHO) = max(smallr, qbarr(i,j,QRHO)) qbarr(i,j,QVEL2) = q(i,j,QVEL2) + $ (apright - amright)*c(i,j)/RHO(i,j) qbarr(i,j,QVEL1) = q(i,j,QVEL1) + azv1rght qbarr(i,j,QPRES) = q(i,j,QPRES) + $ (apright + amright)*c(i,j)**2 qbarr(i,j,QRHOE) = q(i,j,QRHOE) + (apright + $ amright)*enth(i,j)*c(i,j)**2 + azeright #if(NADV>0) qbarr(i,j,QADV) = q(i,j,QADV)+half*(-one-spzero)*DADV(i,j) #endif c ::: ::::: Bottom state of edge at top spminus = cvmgp((V(i,j) - c(i,j))*dtbydx,one,V(i,j) - c(i,j)) spplus = cvmgp((V(i,j) + c(i,j))*dtbydx,one,V(i,j) + c(i,j)) spzero = cvmgp( V(i,j) *dtbydx,one,V(i,j) ) apleft = half*(one - spplus )*alphap amleft = half*(one - spminus)*alpham azrleft= half*(one - spzero )*alpha0r azeleft= half*(one - spzero )*alpha0e azv1left= half*(one - spzero )*alpha0v1 qbarl(i,j+1,QRHO) = q(i,j,QRHO) + apleft + amleft + azrleft qbarl(i,j+1,QRHO) = max(smallr, qbarl(i,j+1,QRHO)) qbarl(i,j+1,QVEL2) = q(i,j,QVEL2) + $ (apleft - amleft)*c(i,j)/RHO(i,j) qbarl(i,j+1,QVEL1) = q(i,j,QVEL1) + azv1left qbarl(i,j+1,QPRES) = q(i,j,QPRES) + $ (apleft + amleft)*c(i,j)**2 qbarl(i,j+1,QRHOE) = q(i,j,QRHOE) + (apleft + amleft)* $ enth(i,j)*c(i,j)**2 + azeleft #if(NADV>0) qbarl(i,j+1,QADV) = q(i,j,QADV)+half*(one-spzero)*DADV(i,j) #endif end do end do c ::: Colella hack near R=0 singularity do j = js,je do i = is,ie if (dloga(i,j) .ne. zero) then eta = (one-courno(i,j))/(c(i,j)*dt*dloga(i,j)) eta = min(one, eta) dloga(i,j) = dloga(i,j) * eta end if end do end do dthalf = half*dt c ::: add geometric source terms to traced states do j = jsedg,jeedg-1 do i = isedg,ieedg sourcr = -RHO(i,j)*dloga(i,j)*V(i,j)*dthalf sourcp = sourcr*c(i,j)**2 source = sourcp*enth(i,j) qbarl(i,j+1,QRHO) = qbarl(i,j+1,QRHO) + sourcr qbarl(i,j+1,QRHO) = max(smallr, qbarl(i,j+1,QRHO)) qbarl(i,j+1,QPRES) = qbarl(i,j+1,QPRES) + sourcp qbarl(i,j+1,QRHOE) = qbarl(i,j+1,QRHOE) + source qbarr(i,j ,QRHO) = qbarr(i,j ,QRHO) + sourcr qbarr(i,j ,QRHO) = max(smallr, qbarr(i,j,QRHO)) qbarr(i,j ,QPRES) = qbarr(i,j ,QPRES) + sourcp qbarr(i,j ,QRHOE) = qbarr(i,j ,QRHOE) + source end do end do #if 0 c ::: convert energy back to intensive form c ::: for eos call in RIEMANN do j = js,je do i =is,ie RHOE(i,j) = RHOE(i,j)/RHO(i,j) end do end do #endif #if 0 c warning: nqvar = nstatevar+1 do n = 1, nvar-1 qbc(1,1,n) = bc(1,1,n) qbc(1,2,n) = bc(1,2,n) qbc(2,1,n) = bc(2,1,n) qbc(2,2,n) = bc(2,2,n) end do qbc(1,1,nvar) = qbc(1,1,nvar-1) qbc(1,2,nvar) = qbc(1,2,nvar-1) qbc(2,1,nvar) = qbc(2,1,nvar-1) qbc(2,2,nvar) = qbc(2,2,nvar-1) do n = 1,nvar do i = isedg,ieedg j = jsedg reflect = cvmgt(-one,one,qbc(2,1,n).eq.REFLECT_ODD) c reflect = one qbarl(i,j,n) = reflect*qbarr(i,j,n) j = jeedg reflect = cvmgt(-one,one,qbc(2,2,n).eq.REFLECT_ODD) c reflect = one qbarr(i,j,n) = reflect*qbarl(i,j,n) end do end do #endif #undef U #undef V #undef P #undef RHO #undef RHOE #undef DU #undef DV #undef DP #undef DRHO #undef DRHOE #if(NADV>0) #undef DADV #endif return end #define SRHO 1 #define SXMOM 2 #define SYMOM 3 #define SRHOE 4 #if(NADV>0) #define SADV 5 #endif subroutine FORT_RIEMANN( & BL_FARG(qbarm), & BL_FARG(qbarp), & BL_FARG(flux), & BL_FARG(rho), & BL_FARG(e), & BL_FARG(adv), & BL_FARG(c), & BL_FARG(csml), & BL_FARG(gamc), & BL_FARG(rgdnv), & BL_FARG(ugdnv), & BL_FARG(pgdnv), & BL_FARG(egdnv), & BL_FARG(utgdnv), #if(NADV>0) & BL_FARG(advgdnv), #endif & BL_FARG(ustar), & BL_BARG(bx), & sweep, npvar, nsvar) integer sweep, npvar, nsvar BL_FBOUNDS(qbarm) BL_FBOUNDS(qbarp) BL_FBOUNDS(c) BL_FBOUNDS(rho) BL_FBOUNDS(e) BL_FBOUNDS(adv) BL_FBOUNDS(csml) BL_FBOUNDS(gamc) BL_FBOUNDS(rgdnv) BL_FBOUNDS(ugdnv) BL_FBOUNDS(pgdnv) BL_FBOUNDS(egdnv) BL_FBOUNDS(utgdnv) #if(NADV>0) BL_FBOUNDS(advgdnv) #endif BL_FBOUNDS(ustar) BL_FBOUNDS(flux) BL_BBOUNDS(bx) BL_FARRAY(qbarm,npvar) BL_FARRAY(qbarp,npvar) BL_FARRAY1(c) BL_FARRAY1(rho) BL_FARRAY1(e) BL_FARRAY1(adv) BL_FARRAY1(csml) BL_FARRAY1(gamc) BL_FARRAY1(rgdnv) BL_FARRAY1(ugdnv) BL_FARRAY1(pgdnv) BL_FARRAY1(egdnv) BL_FARRAY1(utgdnv) #if(NADV>0) BL_FARRAY1(advgdnv) #endif BL_FARRAY1(ustar) BL_FARRAY(flux,nsvar) REAL_T wl, wr, cav, pstar REAL_T ro, uo, po, eo, gamco, co, entho REAL_T rstar, estar, cstar REAL_T sgnm, spin, spout, ushock, frac, divuvs REAL_T scr REAL_T csmall, wsmall, smallr,pdum, small integer qvnrml, qvtrns integer is,ie,js,je, i,j integer lo(2), hi(2) if(sweep.eq.0)then c ::: x-direction qvnrml = QVEL1 qvtrns = QVEL2 else if(sweep.eq.1)then c ::: y-direction qvnrml = QVEL2 qvtrns = QVEL1 else print *,'Abort: Bogus sweep value passed to RIEMANN' write(6,*) 'sweep = ', sweep stop end if smallr = 1.0d-6 small = 1.0d-6 is = flux_l1 ie = flux_h1 js = flux_l2 je = flux_h2 #if 0 call eos(rho,e,gamc,pdum,c,csml,bxlo,bxhi,1,0,1,1) #endif do j = js,je do i = is,ie if(sweep.eq.0)then csmall = max(csml(i-1,j),csml(i,j)) cav = half*(c(i,j) + c(i-1,j)) wsmall = smallr*csmall wl = max(wsmall,sqrt(abs(gamc(i-1,j)* $ qbarm(i,j,QPRES)*qbarm(i,j,QRHO)))) else csmall = max(csml(i,j-1),csml(i,j)) cav = half*(c(i,j) + c(i,j-1)) wsmall = smallr*csmall wl = max(wsmall,sqrt(abs(gamc(i,j-1)* $ qbarm(i,j,QPRES)*qbarm(i,j,QRHO)))) end if wr = max(wsmall,sqrt(abs(gamc(i,j )*qbarp(i,j,QPRES)* $ qbarp(i,j,QRHO)))) pstar = ((wr*qbarm(i,j,QPRES) + wl*qbarp(i,j,QPRES)) + wl*wr* $ (qbarm(i,j,qvnrml) - qbarp(i,j,qvnrml)))/(wl + wr) ustar(i,j) = ((wl*qbarm(i,j,qvnrml) + wr*qbarp(i,j,qvnrml)) + $ (qbarm(i,j,QPRES) - qbarp(i,j,QPRES)))/(wl + wr) ro = cvmgp(qbarm(i,j,QRHO),qbarp(i,j,QRHO),ustar(i,j)) uo = cvmgp(qbarm(i,j,qvnrml),qbarp(i,j,qvnrml),ustar(i,j)) po = cvmgp(qbarm(i,j,QPRES),qbarp(i,j,QPRES),ustar(i,j)) eo = cvmgp(qbarm(i,j,QRHOE),qbarp(i,j,QRHOE),ustar(i,j)) if(sweep.eq.0)then gamco = cvmgp(gamc(i-1,j),gamc(i,j),ustar(i,j)) else gamco = cvmgp(gamc(i,j-1),gamc(i,j),ustar(i,j)) end if co = max(csmall,sqrt(abs(gamco*po/ro))) entho = (eo/ro + po/ro)/co**2 rstar = ro + (pstar - po)/co**2 rstar = max(rstar,smallr) estar = eo + (pstar - po)*entho cstar = max(csmall,sqrt(abs(gamco*pstar/rstar))) sgnm = sign(one,ustar(i,j)) spout = co - sgnm*uo spin = cstar - sgnm*ustar(i,j) ushock = half*(spin + spout) spin = cvmgp(ushock,spin,pstar - po) spout = cvmgp(ushock,spout,pstar - po) scr = cvmgz(small*cav,spout - spin,spout - spin) frac = (one + (spout + spin)/scr)*half frac = max(zero,min(one,frac)) utgdnv(i,j) = cvmgp(qbarm(i,j,qvtrns),qbarp(i,j,qvtrns),ustar(i,j)) #if(NADV>0) advgdnv(i,j) = cvmgp(qbarm(i,j,QADV),qbarp(i,j,QADV), ustar(i,j)) #endif rgdnv(i,j) = frac*rstar + (one - frac)*ro ugdnv(i,j) = frac*ustar(i,j) + (one - frac)*uo pgdnv(i,j) = frac*pstar + (one - frac)*po egdnv(i,j) = frac*estar + (one - frac)*eo rgdnv(i,j) = cvmgp(rgdnv(i,j),ro,spout) ugdnv(i,j) = cvmgp(ugdnv(i,j),uo,spout) pgdnv(i,j) = cvmgp(pgdnv(i,j),po,spout) egdnv(i,j) = cvmgp(egdnv(i,j),eo,spout) rgdnv(i,j) = cvmgp(rstar,rgdnv(i,j),spin) ugdnv(i,j) = cvmgp(ustar(i,j),ugdnv(i,j),spin) pgdnv(i,j) = cvmgp(pstar,pgdnv(i,j),spin) egdnv(i,j) = cvmgp(estar,egdnv(i,j),spin) end do end do c ::: ::::: compute fluxes do j = js,je do i = is,ie flux(i,j,SRHO) = ugdnv(i,j)*rgdnv(i,j) flux(i,j,qvnrml) = ugdnv(i,j)*flux(i,j,SRHO) flux(i,j,qvtrns) = utgdnv(i,j)*flux(i,j,SRHO) flux(i,j,SRHOE) = flux(i,j,SRHO)* $ (half*(ugdnv(i,j)**2+utgdnv(i,j)**2)+ $ egdnv(i,j)/rgdnv(i,j)) + ugdnv(i,j)*pgdnv(i,j) #if(NADV>0) flux(i,j,SADV) = flux(i,j,SRHO)*advgdnv(i,j) #endif end do end do return end subroutine FORT_DIVF( & BL_FARG(state), & BL_FARG(div_f), & BL_FARG(xflux), & BL_FARG(yflux), & BL_BARG(bx), & delta, dt, nvar & ) integer nvar REAL_T delta(SDIM), dt BL_FBOUNDS(state) BL_FBOUNDS(div_f) BL_FBOUNDS(xflux) BL_FBOUNDS(yflux) BL_BBOUNDS(bx) BL_FARRAY(state,nvar) BL_FARRAY(div_f,nvar) BL_FARRAY(xflux,nvar) BL_FARRAY(yflux,nvar) integer i, j, n integer is, ie, js, je REAL_T hx, hy, vol hx = delta(1) hy = delta(2) vol = hx*hy is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) c ::::: Compute div(u*s). Note the sign. do n = 1,nvar do i = is, ie do j = js, je div_f(i,j,n) = & - (xflux(i,j,n) - xflux(i+1,j,n) & + yflux(i,j,n) - yflux(i,j+1,n))/vol end do end do end do return end subroutine FORT_COPYSTATE( & BL_FARG(state), & BL_FARG(xflux), & BL_FARG(yflux), & BL_FARG(gstate), & BL_BARG(bx), & nvar & ) integer nvar REAL_T delta(SDIM), dt BL_FBOUNDS(state) BL_FBOUNDS(xflux) BL_FBOUNDS(yflux) BL_FBOUNDS(gstate) BL_BBOUNDS(bx) BL_FARRAY(state,nvar) BL_FARRAY(xflux,nvar) BL_FARRAY(yflux,nvar) BL_FARRAY(gstate,nvar) integer i, j, n integer is, ie, js, je is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) do n = 1,nvar do i = is, ie do j = js, je gstate(i,j,n) = state(i,j,n) end do end do end do return end c c --------------------------------------------------------------- c Node-based divergence for artificial viscosity calculation c --------------------------------------------------------------- c subroutine FORT_DIVUNODE ( & BL_FARG(state), & BL_FARG(div), & delta, nvar, gbndry) integer nvar, gbndry(0:SDIM*SDIM-1) REAL_T delta(SDIM) BL_FBOUNDS(state) BL_FBOUNDS(div) BL_FARRAY(state,nvar) BL_FARRAY1(div) integer i,j REAL_T ux,vy,uij,vij,uimj,vimj,uijm,vijm,uimjm,vimjm do j = div_l2,div_h2 do i = div_l1, div_h1 uij = state(i,j,2)/state(i,j,1) vij = state(i,j,3)/state(i,j,1) uimj = state(i-1,j,2)/state(i-1,j,1) vimj = state(i-1,j,3)/state(i-1,j,1) uijm = state(i,j-1,2)/state(i,j-1,1) vijm = state(i,j-1,3)/state(i,j-1,1) uimjm = state(i-1,j-1,2)/state(i-1,j-1,1) vimjm = state(i-1,j-1,3)/state(i-1,j-1,1) ux = half* (uij - uimj + uijm - uimjm)/delta(1) vy = half* (vij - vijm + vimj - vimjm)/delta(2) div(i,j) = ux + vy end do end do return end c c--------------------------------------------------------------- c:: X-slopes for characteristic tracing c:: Arguments: c:: s => primitive variables c:: slx <= slopes c:: bc => bndry condition flags c:: nvar => number of advected quantities. c --------------------------------------------------------------- c subroutine FORT_SLOPEX2(BL_FARG(s),BL_FARG(slx),nv,gBndry) integer nv,gBndry(0:SDIM*SDIM-1) BL_FBOUNDS(s) BL_FBOUNDS(slx) BL_FARRAY(s,nv) BL_FARRAY(slx,nv) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ie,je,i,j,iv is = slx_l1 js = slx_l2 ie = slx_h1 je = slx_h2 do 100 iv = 1,nv do 160 j = js,je do 170 i = is,ie del = half*(s(i+1,j,iv)-s(i-1,j,iv)) dpls = two*(s(i+1,j,iv) - s(i ,j,iv)) dmin = two*(s(i ,j,iv) - s(i-1,j,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(i,j,iv)= sflag*min(slim,abs(del)) 170 continue 160 continue 100 continue return end subroutine FORT_FLATENX(BL_FARG(q),BL_FARG(flatn), $ BL_FARG(dp), BL_FARG(z), BL_FARG(chi), $ BL_FARG(p), BL_FARG(c),nv) integer nv BL_FBOUNDS(q) BL_FBOUNDS(flatn) BL_FBOUNDS(dp) BL_FBOUNDS(z) BL_FBOUNDS(chi) BL_FBOUNDS(p) BL_FBOUNDS(c) BL_FARRAY(q,nv) BL_FARRAY1(flatn) BL_FARRAY1(dp) BL_FARRAY1(z) BL_FARRAY1(chi) BL_FARRAY1(p) BL_FARRAY1(c) integer is,js,ie,je, i,j REAL_T shktst, zcut1, zcut2, dzcut REAL_T denom, zeta, tst, tmp #include "xxmeth.fh" c ::: ::::: knobs for detection of strong shock #ifdef BL_USE_FLOAT data shktst /0.33/ data zcut1 /0.75/ data zcut2 /0.85/ #endif #ifdef BL_USE_DOUBLE data shktst /0.33d0/ data zcut1 /0.75d0/ data zcut2 /0.85d0/ #endif dzcut = one/(zcut2-zcut1) c c this is a hack. need to compute the pressure from the state in c a general way. c if(iorder .eq. 3) then return else c c could use z or chi limits equivalently c is = dp_l1 ie = dp_h1 js = dp_l2 je = dp_h2 do j = js,je do i = is,ie dp(i,j) = p(i+1,j)-p(i-1,j) denom = max(smallp,abs(p(i+2,j)-p(i-2,j))) zeta = abs(dp(i,j))/denom z(i,j) = min(one,max(zero, dzcut*(zeta-zcut1))) tst = cvmgp(one,zero,q(i-1,j,QVEL1)-q(i+1,j,QVEL1)) tmp = min(q(i+1,j,QRHO)*c(i+1,j)**2,q(i-1,j,QRHO)*c(i-1,j)**2) chi(i,j) = cvmgt(tst,zero,(abs(dp(i,j))/tmp).gt.shktst) end do end do is = flatn_l1 ie = flatn_h1 js = flatn_l2 je = flatn_h2 do j = js,je do i = is,ie flatn(i,j) = one-max(chi(i-1,j)*z(i-1,j),chi(i,j)*z(i,j), $ chi(i+1,j)*z(i+1,j)) end do end do end if return end subroutine FORT_FLATENY(BL_FARG(q),BL_FARG(flatn), $ BL_FARG(dp), BL_FARG(z), BL_FARG(chi), $ BL_FARG(p), BL_FARG(c), nv) integer nv BL_FBOUNDS(q) BL_FBOUNDS(flatn) BL_FBOUNDS(dp) BL_FBOUNDS(z) BL_FBOUNDS(chi) BL_FBOUNDS(p) BL_FBOUNDS(c) BL_FARRAY(q,nv) BL_FARRAY1(flatn) BL_FARRAY1(dp) BL_FARRAY1(z) BL_FARRAY1(chi) BL_FARRAY1(p) BL_FARRAY1(c) integer is,js,ie,je, i,j REAL_T shktst, zcut1, zcut2, dzcut REAL_T denom, zeta, tst, tmp #include "xxmeth.fh" c ::: ::::: knobs for detection of strong shock #ifdef BL_USE_FLOAT data shktst /0.33/ data zcut1 /0.75/ data zcut2 /0.85/ #endif #ifdef BL_USE_DOUBLE data shktst /0.33d0/ data zcut1 /0.75d0/ data zcut2 /0.85d0/ #endif dzcut = one/(zcut2-zcut1) if(iorder .eq. 3) then return else c c could use z or chi limits equivalently c is = dp_l1 ie = dp_h1 js = dp_l2 je = dp_h2 do j = js,je do i = is,ie dp(i,j) = p(i,j+1)-p(i,j-1) denom = max(smallp,abs(p(i,j+2)-p(i,j-2))) zeta = abs(dp(i,j))/denom z(i,j) = min(one,max(zero, dzcut*(zeta-zcut1))) tst = cvmgp(one,zero,q(i,j-1,QVEL2)-q(i,j+1,QVEL2)) tmp = min(q(i,j+1,QRHO)*c(i,j+1)**2,q(i,j-1,QRHO)*c(i,j-1)**2) chi(i,j) = cvmgt(tst,zero,(abs(dp(i,j))/tmp).gt.shktst) end do end do is = flatn_l1 ie = flatn_h1 js = flatn_l2 je = flatn_h2 do j = js,je do i = is,ie flatn(i,j) = one-max(chi(i,j-1)*z(i,j-1),chi(i,j)*z(i,j), $ chi(i,j+1)*z(i,j+1)) end do end do end if return end c c--------------------------------------------------------------- c:: X-slopes for characteristic tracing c:: Arguments: c:: s => primitive variables c:: slx <= slopes c:: bc => bndry condition flags c:: nvar => number of advected quantities. c --------------------------------------------------------------- c subroutine FORT_SLOPEX(BL_FARG(s),BL_FARG(slx),BL_FARG(flatn), $ BL_FARG(scen),BL_FARG(ssgn),BL_FARG(slim),BL_FARG(dsf),nv,gBndry) integer nv,gBndry(0:SDIM*SDIM-1) BL_FBOUNDS(s) BL_FBOUNDS(slx) BL_FBOUNDS(flatn) BL_FBOUNDS(scen) BL_FBOUNDS(ssgn) BL_FBOUNDS(slim) BL_FBOUNDS(dsf) BL_FARRAY(s,nv) BL_FARRAY(slx,nv) BL_FARRAY1(flatn) BL_FARRAY1(scen) BL_FARRAY1(ssgn) BL_FARRAY1(slim) BL_FARRAY1(dsf) REAL_T dpls,dmin,ds REAL_T del,sflag, dq4 integer is,js,ie,je,i,j,iv #include "xxmeth.fh" if(iorder .eq. 1) then return else do 100 iv = 1,nv is = dsf_l1 js = dsf_l2 ie = dsf_h1 je = dsf_h2 do 160 j = js,je do 170 i = is,ie scen(i,j) = (s(i+1,j,iv)-s(i-1,j,iv)) dpls = (s(i+1,j,iv) - s(i ,j,iv)) dmin = (s(i ,j,iv) - s(i-1,j,iv)) ssgn(i,j) = sign(one,scen(i,j)) slim(i,j) = two*min(abs(dpls),abs(dmin)) slim(i,j) = cvmgp(slim(i,j),zero,dpls*dmin) dsf(i,j) = ssgn(i,j)*min(half*abs(scen(i,j)),slim(i,j)) 170 continue 160 continue is = slx_l1 ie = slx_h1 js = slx_l2 je = slx_h2 do j = js,je do i = is,ie dq4 = two3rd*(scen(i,j) - forth*(dsf(i+1,j)+dsf(i-1,j))) slx(i,j,iv) = ssgn(i,j)*flatn(i,j)*min(abs(dq4),slim(i,j)) c slx(i,j,iv) = ssgn(i,j)*min(abs(dq4),slim(i,j)) c slx(i,j,iv) = ssgn(i,j)*min(slim(i,j),half*abs(scen(i,j))) end do end do 100 continue end if return end c c--------------------------------------------------------------- c:: Y-slopes for characteristic tracing c:: Arguments: c:: s => primitive variables c:: slx <= slopes c:: bc => bndry condition flags c:: nvar => number of advected quantities. c --------------------------------------------------------------- c subroutine FORT_SLOPEY(BL_FARG(s),BL_FARG(sly),BL_FARG(flatn), $ BL_FARG(scen),BL_FARG(ssgn),BL_FARG(slim),BL_FARG(dsf),nv,gBndry) integer nv,gBndry(0:SDIM*SDIM-1) BL_FBOUNDS(s) BL_FBOUNDS(sly) BL_FBOUNDS(flatn) BL_FBOUNDS(scen) BL_FBOUNDS(ssgn) BL_FBOUNDS(slim) BL_FBOUNDS(dsf) BL_FARRAY(s,nv) BL_FARRAY(sly,nv) BL_FARRAY1(flatn) BL_FARRAY1(scen) BL_FARRAY1(ssgn) BL_FARRAY1(slim) BL_FARRAY1(dsf) REAL_T dpls,dmin,ds REAL_T del,sflag, dq4 integer is,js,ie,je,i,j,iv #include "xxmeth.fh" if(iorder .eq. 1) then return else do 100 iv = 1,nv is = dsf_l1 js = dsf_l2 ie = dsf_h1 je = dsf_h2 do 160 j = js,je do 170 i = is,ie scen(i,j) = (s(i,j+1,iv)-s(i,j-1,iv)) dpls = (s(i,j+1,iv) - s(i ,j,iv)) dmin = (s(i ,j,iv) - s(i,j-1,iv)) ssgn(i,j) = sign(one,scen(i,j)) slim(i,j) = two*min(abs(dpls),abs(dmin)) slim(i,j) = cvmgp(slim(i,j),zero,dpls*dmin) dsf(i,j) = ssgn(i,j)*min(half*abs(scen(i,j)),slim(i,j)) 170 continue 160 continue is = sly_l1 ie = sly_h1 js = sly_l2 je = sly_h2 do j = js,je do i = is,ie dq4 = two3rd*(scen(i,j) - forth*(dsf(i,j+1)+dsf(i,j-1))) sly(i,j,iv) = ssgn(i,j)*flatn(i,j)*min(abs(dq4),slim(i,j)) c sly(i,j,iv) = ssgn(i,j)*min(abs(dq4),slim(i,j)) c sly(i,j,iv) = ssgn(i,j)*min(slim(i,j),half*abs(scen(i,j))) end do end do 100 continue end if return end c c --------------------------------------------------------------- c c --------------------------------------------------------------- c:: Y-slopes for characteristic tracing c:: Arguments: c:: s => primitive variables c:: sly <= slopes c:: bc => bndry condition flags c:: nvar => number of advected quantities. c --------------------------------------------------------------- c subroutine FORT_SLOPEY2(BL_FARG(s),BL_FARG(sly),nv,gBndry) integer nv,gBndry(0:SDIM*SDIM-1) BL_FBOUNDS(s) BL_FBOUNDS(sly) BL_FARRAY(s,nv) BL_FARRAY(sly,nv) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ie,je,i,j,iv is = sly_l1 js = sly_l2 ie = sly_h1 je = sly_h2 do 150 iv = 1,nv do 180 j = js,je do 190 i = is,ie del = half*(s(i,j+1,iv)-s(i,j-1,iv)) dpls = two*(s(i,j+1,iv) - s(i,j,iv )) dmin = two*(s(i,j,iv ) - s(i,j-1,iv)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,j,iv)= sflag*min(slim,abs(del)) 190 continue 180 continue 150 continue return end c c --------------------------------------------------------------- c:: Calculate metric coefficients c --------------------------------------------------------------- c subroutine FORT_METRICS(BL_FARG(vol),BL_FARG(dloga),BL_FARG(area), $ BL_BARG(bx),delta, coordsys) REAL_T delta(SDIM) BL_FBOUNDS(vol) BL_FBOUNDS(dloga) BL_FBOUNDS(area) BL_BBOUNDS(bx) BL_FARRAY1(vol) BL_FARRAY1(dloga) BL_FARRAY(area,SDIM) integer i,j,is,ie,js,je,coordsys REAL_T dx,dy is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) dx = delta(1) dy = delta(2) if (coordsys.eq.0) then do j = js, je do i = is, ie vol(i,j) = dx*dy dloga(i,j) = zero area(i,j,1) = dy area(i,j,2) = dx end do end do else print *,'Abort: Not wired for r-z yet.' stop end if return end c c-------------------------------------------------------------- c Conservative update and other final stuff -- x direction c--------------------------------------------------------------- c subroutine FORT_UPDATEX( & BL_FARG(s), & BL_FARG(flux), & BL_FARG(pgdnv), & BL_FARG(div), & BL_FARG(area), & BL_FARG(vol), & BL_BARG(bx), & delta, dt, nv, sweep, bc, gBndry) integer nv, gBndry(0:SDIM*SDIM-1) integer bc(SDIM,2,nv) BL_FBOUNDS(s) BL_FBOUNDS(flux) BL_FBOUNDS(pgdnv) BL_FBOUNDS(div) BL_FBOUNDS(area) BL_FBOUNDS(vol) BL_BBOUNDS(bx) BL_FARRAY(s,nv) BL_FARRAY(flux,nv) BL_FARRAY1(pgdnv) BL_FARRAY1(div) BL_FARRAY1(area) BL_FARRAY1(vol) REAL_T dt REAL_T delta(SDIM) integer sweep, vnrml integer is, ie, js, je, i, j, iv, ivbc integer isflx, ieflx, jsflx, jeflx REAL_T dx, dy,trandiv, divuvs REAL_T avgarea REAL_T leftbc, rightbc #include "xxmeth.fh" is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) isflx = flux_l1 ieflx = flux_h1 jsflx = flux_l2 jeflx = flux_h2 dx = delta(1) dy = delta(2) if(sweep.eq.0)then vnrml = 2 else print *,'Abort: bogus sweep value in UPDATEX' stop end if c c ::: add artifical viscosity and convert to extensive quantities c do iv = 1, nv do j = jsflx,jeflx do i = isflx, ieflx trandiv = half*(div(i,j) + div(i,j+1)) divuvs = difmag*dx*trandiv divuvs = min(zero,divuvs) flux(i,j, iv)= flux(i,j, iv) + $ divuvs*(s(i,j, iv) - s(i-1,j,iv)) flux(i,j,iv) = flux(i,j,iv)*dt*area(i,j) end do end do end do c c ::: conservsative update c do iv = 1, nv do j = js, je do i = is, ie s(i,j,iv) = s(i,j,iv) + $ (flux(i,j,iv) - flux(i+1,j,iv))/vol(i,j) end do end do end do c c ::: add pressure term to normal momnentum c do j = js, je do i = is, ie avgarea = half*(area(i,j) + area(i+1,j)) s(i,j,vnrml) = s(i,j,vnrml) + dt*avgarea* $ (pgdnv(i,j) - pgdnv(i+1,j))/vol(i,j) end do end do c c ::: add pressure term to normal momnentum flux c do j = jsflx,jeflx do i = isflx,ieflx flux(i,j,vnrml) = flux(i,j,vnrml) + dt*area(i,j)*pgdnv(i,j) end do end do c if(onBndry .eq. 1) then #if 0 do iv = 1,nv c ::: left face ivbc = bc(1,1,iv) do j = js, je do i = is-2,is-1 if (ivbc .eq. EXT_DIR) then s(i,j,iv) = leftbc else if(ivbc .eq. FOEXTRAP .or. ivbc .eq. HOEXTRAP .or. $ ivbc .eq. REFLECT_EVEN) then s(i,j,iv) = s(is,j,iv) else if(ivbc .eq. REFLECT_ODD) then s(i,j,iv) = -s(is,j,iv) end if end do end do c ::: right face ivbc = bc(1,2,iv) do j = js-1, je+1 do i = ie+1,ie+2 if (ivbc .eq. EXT_DIR) then s(i,j,iv) = rightbc else if(ivbc .eq. FOEXTRAP .or. ivbc .eq. HOEXTRAP .or. $ ivbc .eq. REFLECT_EVEN) then s(i,j,iv) = s(ie,j,iv) else if(ivbc .eq. REFLECT_ODD) then s(i,j,iv) = -s(ie,j,iv) end if end do end do end do c else c end if #endif return end c c-------------------------------------------------------------- c Conservative update and other final stuff -- y direction c--------------------------------------------------------------- c subroutine FORT_UPDATEY( & BL_FARG(s), & BL_FARG(flux), & BL_FARG(pgdnv), & BL_FARG(div), & BL_FARG(area), & BL_FARG(vol), & BL_BARG(bx), & delta, dt, nv, sweep, bc, gBndry) integer nv, gBndry(0:SDIM*SDIM-1) integer bc(SDIM,2,nv) BL_FBOUNDS(s) BL_FBOUNDS(flux) BL_FBOUNDS(pgdnv) BL_FBOUNDS(div) BL_FBOUNDS(area) BL_FBOUNDS(vol) BL_BBOUNDS(bx) BL_FARRAY(s,nv) BL_FARRAY(flux,nv) BL_FARRAY1(pgdnv) BL_FARRAY1(div) BL_FARRAY1(area) BL_FARRAY1(vol) REAL_T dt REAL_T delta(SDIM) integer vnrml,sweep integer is, ie, js, je, i, j, iv, ivbc integer isflx, ieflx, jsflx, jeflx REAL_T dx, dy,trandiv, divuvs REAL_T avgarea REAL_T botbc, topbc #include "xxmeth.fh" if(sweep.eq.1)then vnrml = 3 else print *,'Abort: bogus sweep value in UPDATEY' stop end if is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) isflx = flux_l1 ieflx = flux_h1 jsflx = flux_l2 jeflx = flux_h2 dx = delta(1) dy = delta(2) c c ::: add artifical viscosity and convert to extensive quantities c do iv = 1, nv do j = jsflx,jeflx do i = isflx,ieflx trandiv = half*(div(i,j) + div(i+1,j)) divuvs = difmag*dx*trandiv divuvs = min(zero,divuvs) flux(i,j, iv)= flux(i,j, iv) + $ divuvs*(s(i,j, iv) - s(i,j-1,iv)) flux(i,j,iv) = flux(i,j,iv)*dt*area(i,j) end do end do end do c c ::: conservsative update c do iv = 1, nv do j = js, je do i = is, ie s(i,j,iv) = s(i,j,iv) + $ (flux(i,j,iv) - flux(i,j+1,iv))/vol(i,j) end do end do end do c c ::: add pressure term to normal momnentum c do j = js, je do i = is, ie avgarea = half*(area(i,j) + area(i,j+1)) s(i,j,vnrml) = s(i,j,vnrml) + dt*avgarea* $ (pgdnv(i,j) - pgdnv(i,j+1))/vol(i,j) end do end do c c ::: add pressure term to normal momnentum flux c do j = jsflx, jeflx do i = isflx, ieflx flux(i,j,vnrml) = flux(i,j,vnrml) + dt*area(i,j)*pgdnv(i,j) end do end do c if(onBndry .eq. 1) then #if 0 do iv = 1,nv c ::: bottom face ivbc = bc(2,1,iv) do i = is, ie do j = js-2,js-1 if (ivbc .eq. EXT_DIR) then s(i,j,iv) = botbc else if(ivbc .eq. FOEXTRAP .or. ivbc .eq. HOEXTRAP .or. $ ivbc .eq. REFLECT_EVEN) then s(i,j,iv) = s(i,js,iv) else if(ivbc .eq. REFLECT_ODD) then s(i,j,iv) = -s(i,js,iv) end if end do end do c ::: top face ivbc = bc(2,2,iv) do i = is, ie do j = je+1,je+2 if (ivbc .eq. EXT_DIR) then s(i,j,iv) = topbc else if(ivbc .eq. FOEXTRAP .or. ivbc .eq. HOEXTRAP .or. $ ivbc .eq. REFLECT_EVEN) then s(i,j,iv) = s(i,je,iv) else if(ivbc .eq. REFLECT_ODD) then s(i,j,iv) = -s(i,je,iv) end if end do end do end do c else c end if #endif return end #if 1 subroutine FORT_PRIMITIVES( & BL_FARG(s), & BL_FARG(q), & BL_FARG(p), & BL_FARG(c), & BL_FARG(csml), & BL_FARG(gamc), & BL_BARG(bx), & bc, ns, nq, sweep) integer ns, nq, sweep integer bc(SDIM,2,ns) BL_FBOUNDS(s) BL_FBOUNDS(q) BL_FBOUNDS(p) BL_FBOUNDS(c) BL_FBOUNDS(csml) BL_FBOUNDS(gamc) BL_BBOUNDS(bx) BL_FARRAY(s,ns) BL_FARRAY(q,nq) BL_FARRAY1(p) BL_FARRAY1(c) BL_FARRAY1(csml) BL_FARRAY1(gamc) integer is,ie,js,je,i,j REAL_T u,v,w,rho,e REAL_T gdum,cdum,csdum, reflect #include "xxmeth.fh" is = bxlo(1) js = bxlo(2) ie = bxhi(1) je = bxhi(2) do j = js, je do i = is, ie rho = max(s(i,j,SRHO),smallr) u = s(i,j,SXMOM)/s(i,j,SRHO) v = s(i,j,SYMOM)/s(i,j,SRHO) e = s(i,j,SRHOE)/rho - half*(u**2 + v**2) q(i,j,QRHO) = rho q(i,j,QVEL1) = u q(i,j,QVEL2) = v q(i,j,QRHOE) = e #if(NADV>0) q(i,j,QADV) = S(i,j,SADV)/s(i,j,SRHO) #endif enddo enddo call eos(q(BL_ARGL1(q),BL_ARGL2(q),QRHO), $ q(BL_ARGL1(q),BL_ARGL2(q),QRHOE), $ q(BL_ARGL1(q),BL_ARGL2(q),QADV), $ BL_IARG(q), $ gamc(BL_ARGL1(c),BL_ARGL2(c)), $ q(BL_ARGL1(c),BL_ARGL2(c),QPRES), $ c(BL_ARGL1(c),BL_ARGL2(c)), $ csml(BL_ARGL1(c),BL_ARGL2(c)), $ BL_IARG(c), $ bxlo,bxhi,1,1,1,1) do j = js, je do i = is, ie q(i,j,QPRES) = max(smallp,q(i,j,QPRES)) p(i,j) = q(i,j,QPRES) q(i,j,QRHOE) = q(i,j,QRHOE)*q(i,j,QRHO) c c(i,j) = sqrt(gamc(i,j)*q(i,j,QPRES)/q(i,j,QRHO)) c csml(i,j) = max(small,small*c(i,j)) enddo enddo end #else subroutine FORT_PRIMITIVES( & BL_FARG(s), & BL_FARG(q), & BL_FARG(p), & BL_FARG(c), & BL_FARG(csml), $ BL_FARG(gamc), & BL_BARG(bx), & bc, ns, nq, sweep) integer ns, nq, sweep integer bc(SDIM,2,ns) BL_FBOUNDS(s) BL_FBOUNDS(q) BL_FBOUNDS(p) BL_FBOUNDS(c) BL_FBOUNDS(csml) BL_FBOUNDS(gamc) BL_BBOUNDS(bx) BL_FARRAY(s,ns) BL_FARRAY(q,nq) BL_FARRAY1(p) BL_FARRAY1(c) BL_FARRAY1(csml) BL_FARRAY1(gamc) integer is,ie,js,je,i,j REAL_T u,v,rho,e REAL_T gdum,cdum,csdum, reflect #include "xxmeth.fh" is = bxlo(1) js = bxlo(2) ie = bxhi(1) je = bxhi(2) do j = js, je do i = is, ie rho = max(s(i,j,SRHO),smallr) u = s(i,j,SXMOM)/rho v = s(i,j,SYMOM)/rho e = s(i,j,SRHOE)/rho - half*(u**2 + v**2) q(i,j,QRHO) = rho q(i,j,QVEL1) = u q(i,j,QVEL2) = v q(i,j,QRHOE) = e end do end do call eos(q(is,js,QRHO),q(is,js,QRHOE), $ gamc(is,js),q(is,js,QPRES),cdum,csdum, $ bxlo,bxhi,1,1,0,0) do j = js, je do i = is, ie q(i,j,QPRES) = max(smallp,q(i,j,QPRES)) p(i,j) = q(i,j,QPRES) q(i,j,QRHOE) = q(i,j,QRHOE)*q(i,j,QRHO) c c(i,j) = sqrt(gamc(i,j)*q(i,j,QPRES)/q(i,j,QRHO)) c csml(i,j) = max(small,small*c(i,j)) end do end do return end #endif ccseapps-2.5/CCSEApps/HCAll/bubble/.3rd0000644000175000017500000000001311634153073020520 0ustar amckinstryamckinstryignore rus ccseapps-2.5/CCSEApps/HCAll/bubble/PROB_2D.F0000644000175000017500000005226311634153073021243 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ /* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: PROB_2D.F,v 1.2 2003/01/22 23:11:05 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "PROB_F.H" #include "ArrayLim.H" #include "integrator.fh" #define SDIM 2 c ::: ----------------------------------------------------------- c ::: This routine is called at problem initialization time c ::: and when restarting from a checkpoint file. c ::: The purpose is (1) to specify the initial time value c ::: (not all problems start at time=0.0) and (2) to read c ::: problem specific data from a namelist or other input c ::: files and possibly store them or derived information c ::: in FORTRAN common blocks for later use. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: init => TRUE if called at start of problem run c ::: FALSE if called from restart c ::: name => name of "probin" file c ::: namlen => length of name c ::: strttime <= start problem with this time variable c ::: c ::: ----------------------------------------------------------- c subroutine FORT_PROBINIT (init,name,namlen,problo,probhi) integer init,namlen integer name(namlen) REAL_T problo(SDIM), probhi(SDIM) integer untin,i,j,k #include "probdata.H" #include "xxmeth.fh" namelist /fortin/ tol_int, dengrad, bubgrad,ecent, $ xcloud,ycloud,zcloud,radius,pertmag, $ denfact,shockpos,rmach, $ gamamb,gamcld,difmag, iorder, smallr, smallp, small REAL_T rn c c Build "probin" filename -- the name of file containing fortin namelist. c integer maxlen parameter (maxlen=256) character probin*(maxlen) if (namlen .gt. maxlen) then write(6,*) 'probin file name too long' stop end if do i = 1, namlen probin(i:i) = char(name(i)) end do pertmag = zero untin = 9 if (namlen .eq. 0) then c open(untin,file='probin',form='formatted',status='old', action='read') open(untin,file='probin',form='formatted',status='old') else c open(untin,file=probin(1:namlen),form='formatted',status='old', action='read') open(untin,file=probin(1:namlen),form='formatted',status='old') end if read(untin,fortin) c write(6,fortin) close(unit=untin) c ::: define state of ambient gas rhoamb = one pamb = one/gamamb u1amb = zero u2amb = zero eamb = pamb/((gamamb-one)*rhoamb) c c ::: define state of ambient but dense cloud c rhocld = rhoamb*denfact pcld = pamb u1cld = u1amb u2cld = u2amb ecld = pcld/((gamcld-one)*rhocld) c c ::: define state of shock c ashk = sqrt(gamamb*pamb/rhoamb) u1shk = ashk*two*(rmach**2-one)/((gamamb+one)*rmach ) u2shk = zero rhoshk = rhoamb*((gamamb+one)*rmach**2)/((gamamb-one)*rmach**2 + two) pshk = pamb*(one + ( two*gamamb*(rmach**2 - one)) / (gamamb+one) ) eshk = pshk / ((gamamb-one)*rhoshk) c u1amb = u1amb - u1shk c u1cld = u1cld - u1shk c u1shk = zero c c ::: translate to conserved quantities c eamb = rhoamb*(eamb + half*(u1amb**2 + u2amb**2)) u1amb = rhoamb*u1amb u2amb = rhoamb*u2amb eshk = rhoshk*(eshk + half*(u1shk**2 + u2shk**2)) u1shk = rhoshk*u1shk u2shk = rhoshk*u2shk ecld = rhocld*(ecld + half*(u1cld**2 + u2cld**2)) u1cld = rhocld*u1cld u2cld = rhocld*u2cld c c set random amplitudes c if (pertmag .gt. zero) then do j = 4,8 do i = 4,8 call blutilrand(rn) ranampl(i,j,4) = pertmag * two * (rn - half) call blutilrand(rn) ranphse(i,j,4) = two * Pi * rn end do end do end if return end c ::: ----------------------------------------------------------- c ::: This routine is called at problem setup time and is used c ::: to initialize data on each grid. c ::: c ::: NOTE: all arrays have one cell of ghost zones surrounding c ::: the grid interior. Values in these cells need not c ::: be set here. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: level => amr level of grid c ::: time => time at which to init data c ::: lo,hi => index limits of grid interior (cell centered) c ::: nstate => number of state components. You should know c ::: this already! c ::: state <= Scalar array c ::: delta => cell size c ::: xlo,xhi => physical locations of lower left and upper c ::: right hand corner of grid. (does not include c ::: ghost region). c ::: ----------------------------------------------------------- subroutine FORT_INITDATA(level, time, lo, hi, $ nstate, state, DIMS(state), $ delta, xlo, xhi) integer level, nstate integer lo(SDIM),hi(SDIM) integer DIMDEC(state) REAL_T time, delta(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T state(DIMV(state),nstate) c ::::: local variables REAL_T pert, dist #include "probdata.H" c ::: local var integer i, j, ii, jj, intsx, intsy integer iamp,jamp,kamp REAL_T dx, dy, rsq REAL_T xcen, ycen dx = delta(1) dy = delta(2) do j = lo(2), hi(2) do i = lo(1), hi(1) xcen = xlo(1) + dx*(float(i-lo(1)) + half) ycen = xlo(2) + dy*(float(j-lo(2)) + half) if (xcen .lt. shockpos) then state(i,j,1) = rhoshk state(i,j,2) = u1shk state(i,j,3) = u2shk state(i,j,4) = eshk #if(NADV>0) state(i,j,5) = zero #endif else rsq = (xcen-xcloud)**2+(ycen-ycloud)**2 dist = sqrt(rsq) if (dist .le. radius) then pert = one do jamp = 4,8 do iamp = 4,8 pert = pert + ranampl(iamp,jamp,4)* & cos(ranphse(iamp,jamp,4)+two*Pi*iamp*(xcen-xcloud)/radius)* & cos(ranphse(iamp,jamp,4)+two*Pi*jamp*(ycen-ycloud)/radius) end do end do state(i,j,1) = pert * rhocld state(i,j,2) = pert * u1cld state(i,j,3) = pert * u2cld state(i,j,4) = pert * ecld #if(NADV>0) state(i,j,5) = one * rhocld #endif else state(i,j,1) = rhoamb state(i,j,2) = u1amb state(i,j,3) = u2amb state(i,j,4) = eamb #if(NADV>0) state(i,j,5) = zero * rhoamb #endif end if end if end do end do return end c ::: ----------------------------------------------------------- c ::: This routine will tag high error cells based on the c ::: density gradient c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: tag <= integer tag array c ::: lo,hi => index extent of tag array c ::: set => integer value to tag cell for refinement c ::: clear => integer value to untag cell c ::: rho => density array c ::: ng => number of ghost zones in rho array (should be 1) c ::: nvar => number of components in rho array (should be 1) c ::: domlo,hi => index extent of problem domain c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of tag array c ::: problo => phys loc of lower left corner of prob domain c ::: time => problem evolution time c ::: ----------------------------------------------------------- subroutine FORT_DENERROR (tag,DIMS(tag),set,clear, & adv,DIMS(adv),lo,hi,nvar, & domlo,domhi,delta,xlo, & problo,time,level) integer DIMDEC(tag) integer DIMDEC(adv) integer lo(SDIM), hi(SDIM) integer nvar, set, clear, level integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), problo(SDIM), time integer tag(DIMV(tag)) REAL_T adv(DIMV(adv),nvar) REAL_T x, y, ax, ay, aerr, denloc integer i, j REAL_T tracer logical ltest #include "probdata.H" #include "xxmeth.fh" do j = lo(2), hi(2) do i = lo(1), hi(1) ax = abs(adv(i+1,j,1) - adv(i-1,j,1)) ay = abs(adv(i,j+1,1) - adv(i,j-1,1)) aerr = max(ax,ay) tag(i,j) = cvmgt(set,tag(i,j),aerr.gt.dengrad) end do end do if (tol_int .gt. zero ) then do j = lo(2), hi(2) do i = lo(1), hi(1) tracer = adv(i,j,5)/adv(i,j,1) ltest = (tracer.gt.tol_int) .and. (tracer.lt. (one-tol_int)) tag(i,j) = cvmgt(set,tag(i,j),ltest) end do end do end if end c c Fill den, xmom, ymom, zden, eden as a group. c subroutine FORT_HYPFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc) integer DIMS(adv) integer bc(SDIM,2,4) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv),4) call FORT_DENFILL (adv(ARG_L1(adv),ARG_L2(adv),1), & DIMS(adv),domlo,domhi,delta,xlo,time,bc(1,1,1)) call FORT_XMOMFILL (adv(ARG_L1(adv),ARG_L2(adv),2), & DIMS(adv),domlo,domhi,delta,xlo,time,bc(1,1,2)) call FORT_YMOMFILL (adv(ARG_L1(adv),ARG_L2(adv),3), & DIMS(adv),domlo,domhi,delta,xlo,time,bc(1,1,3)) call FORT_EDENFILL (adv(ARG_L1(adv),ARG_L2(adv),4), & DIMS(adv),domlo,domhi,delta,xlo,time,bc(1,1,5)) end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: adv <= advected quantity array c ::: lo,hi => index extent of adv array c ::: domlo,hi => index extent of problem domain c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of adv array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_DENFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc ) integer DIMS(adv) integer bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j integer lo(SDIM),hi(SDIM) #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 hi(1) = adv_h1 hi(2) = adv_h2 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) adv(i,j) = rhoshk end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) adv(i,j) = rhoamb end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) adv(i,j) = adv(i,domlo(2)) end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) adv(i,j) = adv(i,domhi(2)) end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: adv <= advected quantity array c ::: lo,hi => index extent of adv array c ::: domlo,hi => index extent of problem domain c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of adv array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_XMOMFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc ) integer DIMS(adv) integer bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j integer lo(SDIM),hi(SDIM) #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 hi(1) = adv_h1 hi(2) = adv_h2 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) adv(i,j) = u1shk end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) adv(i,j) = u1amb end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) adv(i,j) = adv(i,domlo(2)) end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) adv(i,j) = adv(i,domhi(2)) end do end do end if end subroutine FORT_YMOMFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc ) integer DIMS(adv) integer lo(SDIM), hi(SDIM), bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 hi(1) = adv_h1 hi(2) = adv_h2 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) adv(i,j) = u2shk end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) adv(i,j) = u2amb end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) adv(i,j) = -adv(i,domlo(2)) end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) adv(i,j) = -adv(i,domhi(2)) end do end do end if end subroutine FORT_EDENFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc ) integer DIMS(adv) integer lo(SDIM), hi(SDIM), bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 hi(1) = adv_h1 hi(2) = adv_h2 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) adv(i,j) = eshk end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) adv(i,j) = eamb end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) adv(i,j) = adv(i,domlo(2)) end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) adv(i,j) = adv(i,domhi(2)) end do end do end if end subroutine FORT_TRACFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc ) integer DIMS(adv) integer lo(SDIM), hi(SDIM), bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 hi(1) = adv_h1 hi(2) = adv_h2 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) adv(i,j) = zero end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) adv(i,j) = zero end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) adv(i,j) = adv(i,domlo(2)) end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) adv(i,j) = adv(i,domhi(2)) end do end do end if end ccseapps-2.5/CCSEApps/HCAll/bubble/integrator.fh0000644000175000017500000000244011634153073022532 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #define NADV 1 ccseapps-2.5/CCSEApps/HCAll/bubble/probin.helium0000644000175000017500000000051211634153073022531 0ustar amckinstryamckinstry $fortin difmag = 0.1 iorder = 2 xcloud = 16.00 ycloud = 0.00 zcloud = 0.00 radius = 2.25 denfact = .139 ecent = 1. shockpos = 13.50 rmach = 1.25 gamamb = 1.4 gamcld = 1.666667 smallp = 1.d-06 smallr = 1.d-06 smallr = 1.d-06 dengrad = .10 tol_int = .05 pertmag = 0.01 $end ccseapps-2.5/CCSEApps/HCAll/bubble/DERIVE_3D.F0000644000175000017500000003440611634153073021457 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: DERIVE_3D.F,v 1.2 1999/05/24 18:11:42 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "DERIVE_F.H" #include "ArrayLim.H" #include "integrator.fh" #if defined(BL_USE_FLOAT) || defined(BL_T3E) #define BL_USE_FLOAT_CONST #define onetominussix 1.0e-6 #define onetominusten 1.0e-10 #define onetoten 1.0e+10 #define onepointfour 1.4 #endif #if defined(BL_USE_DOUBLE) && !defined(BL_T3E) #define BL_USE_DOUBLE_CONST #define onetominussix 1.0d-6 #define onetominusten 1.0d-10 #define onetoten 1.0d+10 #define onepointfour 1.4d+00 #endif #define SDIM 3 c c A derived-quantity derivation routine that copies from input to output. c subroutine FORT_DERCOPY (e,DIMS(e),nv,dat,DIMS(dat),ncomp, $ lo,hi,domlo,domhi,delta,xlo,time,dt,bc, $ level,gridno) integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp, level, gridno integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer i,j,k,nc if (nv .ne. ncomp) then write(6,*) "FORT_DERCOPY: invalid call" stop end if if ((e_l1 .ne. dat_l1) .or. $ (e_l2 .ne. dat_l2) .or. $ (e_l3 .ne. dat_l3) .or. $ (e_h1 .ne. dat_h1) .or. $ (e_h2 .ne. dat_h2) .or. $ (e_h3 .ne. dat_h3)) then write(6,*) "FORT_DERCOPY: invalid call" stop end if do nc = 1, nv do k = e_l3, e_h3 do j = e_l2, e_h2 do i = e_l1, e_h1 e(i,j,k,nc) = dat(i,j,k,nc) enddo enddo enddo enddo end c ::: ----------------------------------------------------------- c ::: This routine will derive log of given scalar quantity c ::: c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: e <= logden array (cell centered) c ::: elo,ehi => index extent of e array c ::: nv => number of components in e array (should be 1) c ::: dat => data neded to derive logden c ::: should be density c ::: dlo,dhi => index limits of dat array c ::: ncomp => number of components of dat array (3) c ::: lo,hi => subrange of e array where result is requested c ::: domlo,hi => index extent of problem domain (cell centered) c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of e array c ::: time => problem evolution time c ::: bc => array of bndry types for component values c ::: valid only if component touches bndry c ::: ----------------------------------------------------------- subroutine FORT_DERLOGS (e,DIMS(e),nv,dat,DIMS(dat),ncomp, $ lo,hi,domlo,domhi,delta,xlo,time,dt,bc, $ level,gridno) integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp, level, gridno integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer i,j,k integer nxlo, nxhi, nylo, nyhi, nzlo, nzhi REAL_T rho REAL_T sml parameter (sml = 1.0e-10) c c::::: lets punt if not in domain interior c nxlo = max(0,domlo(1)-lo(1)) nxhi = max(0,hi(1)-domhi(1)) nylo = max(0,domlo(2)-lo(2)) nyhi = max(0,hi(2)-domhi(2)) nzlo = max(0,domlo(3)-lo(3)) nzhi = max(0,hi(3)-domhi(3)) if (nxlo+nxhi+nylo+nyhi+nzlo+nzhi .gt. 0) then write(6,*) "FORT_DERLOGS: outside domain" stop end if do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) rho = max(dat(i,j,k,1),sml) e(i,j,k,1) = log10(rho) enddo enddo enddo end c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: derive velocity: this routine will derive velocity c ::: from momentum c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: e <= velocity array (cell centered) c ::: elo,ehi => index extent of e array c ::: nv => number of components in e array (should be 1) c ::: dat => data neded to derive velocity c ::: dlo,dhi => index limits of dat array c ::: ncomp => number of components of dat array (2) c ::: lo,hi => subrange of e array where result is requested c ::: domlo,hi => index extent of problem domain (cell centered) c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of e array c ::: time => problem evolution time c ::: bc => array of bndry types for component values c ::: valid only if component touches bndry c ::: ----------------------------------------------------------- subroutine FORT_DERVEL (e,DIMS(e),nv,dat,DIMS(dat),ncomp, $ lo,hi,domlo,domhi,delta,xlo,time,dt,bc, $ level,gridno) integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp, level, gridno integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer i,j,k integer nlft, nrgt, nbot, ntop,nfrnt, nbck REAL_T u, v, w c c::::: lets punt if not in domain interior c nlft = max(0,domlo(1)-lo(1)) nrgt = max(0,hi(1)-domhi(1)) nbot = max(0,domlo(2)-lo(2)) ntop = max(0,hi(2)-domhi(2)) nfrnt = max(0,domlo(3)-lo(3)) nbck = max(0,hi(3)-domhi(3)) if (nlft+nrgt+nbot+ntop+nfrnt+nbck .gt. 0) then write(6,*) "FORT_DERXVEL: outside domain" stop end if do k = lo(3),hi(3) do j = lo(2),hi(2) do i = lo(1),hi(1) e(i,j,k,1) = dat(i,j,k,2)/dat(i,j,k,1) end do end do end do end c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: this thing will derive pressure. Calls eos. c ::: c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: e <= pressuree array (cell centered) c ::: elo,ehi => index extent of e array c ::: nv => number of components in e array (should be 1) c ::: dat => data neded to derive pressure c ::: dlo,dhi => index limits of dat array c ::: ncomp => number of components of dat array (4) c ::: lo,hi => subrange of e array where result is requested c ::: domlo,hi => index extent of problem domain (cell centered) c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of e array c ::: time => problem evolution time c ::: bc => array of bndry types for component values c ::: valid only if component touches bndry c ::: ----------------------------------------------------------- subroutine FORT_DERPRES (e,DIMS(e),nv,dat,DIMS(dat),ncomp, $ lo,hi,domlo,domhi,delta,xlo,time,dt,bc, $ level,gridno) integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp, level, gridno integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) c c ::: local arrays c REAL_T eint REAL_T cdum, gdum, csdum, rhomax, rhomin c c ::: local var c integer i,j,k integer npts, ii, ist REAL_T rho, ux, uy,uz, pmax, pmin, bigp #include "xxmeth.fh" smallp = onetominussix bigp = onetoten do k = lo(3),hi(3) do j = lo(2),hi(2) do i = lo(1), hi(1) rho = dat(i,j,k,1) ux = dat(i,j,k,2)/rho uy = dat(i,j,k,3)/rho uz = dat(i,j,k,4)/rho eint = (dat(i,j,k,5) - half*(ux**2+uy**2+uz**2))/rho e(i,j,k,2) = eint e(i,j,k,3) = rho e(i,j,k,4) = dat(i,j,k,6)/rho end do end do end do call eos(e(ARG_L1(e),ARG_L2(e),ARG_L3(e),3), $ e(ARG_L1(e),ARG_L2(e),ARG_L3(e),2), $ e(ARG_L1(e),ARG_L2(e),ARG_L3(e),4), $ DIMS(e), $ gdum, $ e(ARG_L1(e),ARG_L2(e),ARG_L3(e),1), $ cdum, csdum, $ DIMS(e), $ lo, hi, 0, 1, 0, 0) end subroutine eos(rho,eint,comp,DIMS(rho),gamc,p,c,csml,DIMS(c), $ lo,hi,lgamc,lp,lc,lcsml) integer lgamc, lp, lc, lcsml integer lo(3), hi(3) integer DIMDEC(rho) integer DIMDEC(c) REAL_T rho(DIMV(rho),1) REAL_T eint(DIMV(rho),1) REAL_T comp(DIMV(rho),1) REAL_T c(DIMV(c),1) REAL_T gamc(DIMV(c),1) REAL_T p(DIMV(c),1) REAL_T csml(DIMV(c),1) REAL_T pres, cc, psml integer j,k do k = lo(3), hi(3) do j = lo(2), hi(2) call eosstrip(rho(lo(1),j,k,1), $ eint(lo(1),j,k,1), $ comp(lo(1),j,k,1), $ gamc(lo(1),j,k,1), $ p(lo(1),j,k,1), $ c(lo(1),j,k,1), $ csml(lo(1),j,k,1), $ lo(1),hi(1),lgamc,lp,lc,lcsml,j,k) end do end do end subroutine eosstrip(rrr,eee,comp,gamiso,ppp,c,csml,nlo,nhi, & lgamc,lp,lc,lcsml,jin,kin) c :: c :: Inputs and Outpus c :: rrr => (const) mass density c :: eee => (const) internal energy per unit volume c :: comp => (const) the volume fraction of HE c :: n => (const) size of all argument arrays c :: nlo => (const) beginning location c :: nhi => (const) end location c :: gamiso <= (modify) sound speed gamma c :: ppp <= (modify) pressure c :: c <= (modify) sound speed c :: csml <= (modify) sound speed floor c :: lgamc => (const) =1 -> return gamiso c :: lp => (const) =1 -> return pressure c :: lc => (const) =1 -> return sound speed c :: lcsml => (const) =1 -> return sound speed floor c c::::: dummy arguments c integer n, nlo, nhi integer lgamc, lp, lc, lcsml REAL_T rrr(nlo:nhi), eee(nlo:nhi), comp(nlo:nhi), ppp(nlo:nhi) REAL_T gamiso(nlo:nhi), c(nlo:nhi), csml(nlo:nhi) REAL_T comptmp integer jin,kin #include "xxmeth.fh" #include "probdata.H" c c::::: local variables c integer k,npts REAL_T ptmp,gamtmp,gamctmp c::::: calculate gamma by linear interpolation. c if (lgamc .eq. 1) then do k = nlo,nhi comptmp = max(min(comp(k),one),zero) gamiso(k) = one/(comptmp/gamcld+(one-comptmp)/gamamb) end do end if c c::::: calculate presure in units of eee c if (lp .eq. 1) then do k = nlo,nhi comptmp = max(min(comp(k),one),zero) gamtmp= one+one/(comptmp/(gamcld-one)+(one-comptmp)/(gamamb-one)) ppp(k) = (gamtmp - one)*eee(k)*rrr(k) end do end if if (lcsml .eq. 1 .and. lc .ne. 1) then write(6,*) "EOS: cannot ask for csml without c" stop end if if (lc .eq. 1) then if (lp .eq. 1 .and. lgamc .eq. 1) then do k = nlo,nhi c(k) = sqrt(gamiso(k)*abs(ppp(k))/max(rrr(k),smallr)) c(k) = max(c(k),small) end do else if (lp .eq. 1 .and. lgamc .ne. 1) then c c::::: have pressure but not gamiso c do k = nlo,nhi comptmp = max(min(comp(k),one),zero) gamtmp= one+one/(comptmp/(gamcld-one)+(one-comptmp)/(gamamb-one)) c(k) = sqrt(gamtmp*abs(ppp(k))/max(rrr(k),smallr)) c(k) = max(c(k),small) end do else if (lgamc .eq. 1 .and. lp .ne. 1) then c c::::: have gamiso but not pressure c do k = nlo,nhi comptmp = max(min(comp(k),one),zero) gamtmp= one+one/(comptmp/(gamcld-one)+(one-comptmp)/(gamamb-one)) ptmp = (gamtmp - one)*eee(k)*rrr(k) c(k) = sqrt(gamiso(k)*abs(ptmp)/max(rrr(k),smallr)) c(k) = max(c(k),small) end do else do k = nlo,nhi comptmp = max(min(comp(k),one),zero) gamtmp= one+one/(comptmp/(gamcld-one)+(one-comptmp)/(gamamb-one)) ptmp = (gamtmp-one)*eee(k)*rrr(k) gamctmp = one/(comptmp/gamcld+(one-comptmp)/gamamb) c(k) = sqrt(gamctmp*abs(ptmp)/max(rrr(k),smallr)) c(k) = max(c(k),small) end do end if if (lcsml .eq. 1) then do k = nlo,nhi csml(k) = max(small,small*c(k)) end do end if end if end ccseapps-2.5/CCSEApps/HCAll/bubble/inputs.2d.helium0000644000175000017500000000624411634153073023076 0ustar amckinstryamckinstry# ------------------ INPUTS TO MAIN PROGRAM ------------------- max_step = 30 # maximum timestep stop_time = 18.0 # maximum problem time # ------------------ INPUTS TO AMR CLASS --------------------- # set up for bubble geometry.coord_sys = 0 # 0 => cart, 1 => RZ geometry.prob_lo = -4.45 -4.45 geometry.prob_hi = 4.45 4.45 geometry.is_periodic = 0 0 amr.v = 1 # Verbose output? amr.n_cell = 8 8 amr.max_level = 3 # maximum level number allowed amr.ref_ratio = 4 2 2 # refinement ratio amr.regrid_int = 2 # how often to regrid amr.n_error_buf = 1 1 1 1 # number of buffer cells in error est amr.grid_eff = 0.8 # what constitutes an efficient grid amr.blocking_factor = 1 # block factor in grid generation amr.check_int = 20 # number of timesteps between checkpoints amr.check_file = chk # root name of checkpoint file amr.plot_file = plt amr.plot_int = 2 #amr.plot_vars = density xmom ymom zmom eden tracer amr.grid_log = grdlog # name of grid logging file amr.probin_file = probin.2d.helium # name of Fortran initialization file amr.max_grid_size = 16 amr.max_grid_size = 32 #amr.regrid_file=grids.fp # ------------------ INPUTS TO PHYSICS CLASS ------------------- hyp.v = 1 # Verbose output? hyp.dt_cutoff = 0.000000001 # level 0 timestep below which we halt hyp.cfl = 1.0 # cfl number for hyperbolic system hyp.cfl = 0.7 # cfl number for hyperbolic system hyp.cfl = 0.9 # cfl number for hyperbolic system hyp.init_shrink = 0.3 # scale back initial timestep hyp.change_max = 1.1 # scale back initial timestep hyp.gravity = 0. hyp.sum_interval = 0 # timesteps between computing mass hyp.do_reflux = 1 # 1 => do refluxing hyp.bogus_value = 5.0e+5 # ---------------- PROBLEM DEPENDENT INPUTS Prob.lo_bc = 1 4 Prob.hi_bc = 2 4 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall # # select form of FAB output: default is NATIVE # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE # # Initializes distribution strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 0.1 #StationData.coord = 0.11 0.21 0.3 #StationData.coord = 0.5 0.5 0.5 #StationData.coord = 1.23 1.23 1.23 #StationData.coord = 0.23 1.53 2.83 #StationData.coord = 2.34 2.34 2.34 ccseapps-2.5/CCSEApps/HCAll/bubble/DERIVE_2D.F0000644000175000017500000003516711634153073021463 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ /* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: DERIVE_2D.F,v 1.1 2002/04/11 22:36:43 marc Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #define MAX_DIM 100 #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "DERIVE_F.H" #include "ArrayLim.H" #define SDIM 2 c c A derived-quantity derivation routine that copies from input to output. c subroutine FORT_DERCOPY (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt,bc, & level,gridno) integer lo(2), hi(2) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp, level, gridno integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer i,j,nc if (nv .ne. ncomp) then write(6,*) "FORT_DERCOPY: invalid call" stop end if if ((e_l1 .ne. dat_l1) .or. $ (e_l2 .ne. dat_l2) .or. $ (e_h1 .ne. dat_h1) .or. $ (e_h2 .ne. dat_h2)) then write(6,*) "FORT_DERCOPY: invalid call" stop end if do nc = 1, nv do j = e_l2, e_h2 do i = e_l1, e_h1 e(i,j,nc) = dat(i,j,nc) end do end do end do end c ::: ----------------------------------------------------------- c ::: This routine will derive log of given scalar quantity c ::: c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: e <= logden array (cell centered) c ::: DIMS(e) => index extent of e array c ::: nv => number of components in e array (should be 1) c ::: dat => data neded to derive logden c ::: should be density c ::: DIMS(dat) => index limits of dat array c ::: ncomp => number of components of dat array (3) c ::: lo,hi => subrange of e array where result is requested c ::: domlo,hi => index extent of problem domain (cell centered) c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of e array c ::: time => problem evolution time c ::: bc => array of bndry types for component values c ::: valid only if component touches bndry c ::: level => level of the data c ::: gridno => which grid is this on c ::: ----------------------------------------------------------- subroutine FORT_DERLOGS (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt,bc, & level,gridno) integer lo(2), hi(2) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp, level, gridno integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer i,j integer nlft, nrgt, nbot, ntop REAL_T rho REAL_T sml data sml / 1.0e-10 / c ::::: lets punt if not in domain interior nlft = max(0,domlo(1)-lo(1)) nrgt = max(0,hi(1)-domhi(1)) nbot = max(0,domlo(2)-lo(2)) ntop = max(0,hi(2)-domhi(2)) if (nlft+nrgt+nbot+ntop .gt. 0) then write(6,*) "FORT_DERLOGS: outside domain" stop end if do j = lo(2), hi(2) do i = lo(1), hi(1) rho = max(dat(i,j,1),sml) e(i,j,1) = log10(rho) end do end do end c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: derive velocity: this routine will derive velocity c ::: from momentum c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: e <= velocity array (cell centered) c ::: DIMS(e) => index extent of e array c ::: nv => number of components in e array (should be 1) c ::: dat => data neded to derive velocity c ::: DIMS(dat) => index limits of dat array c ::: ncomp => number of components of dat array (2) c ::: lo,hi => subrange of e array where result is requested c ::: domlo,hi => index extent of problem domain (cell centered) c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of e array c ::: time => problem evolution time c ::: bc => array of bndry types for component values c ::: valid only if component touches bndry c ::: level => level of the data c ::: gridno => which grid is this on c ::: ----------------------------------------------------------- subroutine FORT_DERVEL (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt,bc, & level,gridno) integer lo(2), hi(2) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp, level, gridno integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer i,j integer nlft, nrgt, nbot, ntop REAL_T u, v c ::::: lets punt if not in domain interior nlft = max(0,domlo(1)-lo(1)) nrgt = max(0,hi(1)-domhi(1)) nbot = max(0,domlo(2)-lo(2)) ntop = max(0,hi(2)-domhi(2)) if (nlft+nrgt+nbot+ntop .gt. 0) then write(6,*) "FORT_DERVEL: outside domain" stop end if do 600 j = lo(2),hi(2) do 610 i = lo(1),hi(1) e(i,j,1) = dat(i,j,2)/dat(i,j,1) 610 continue 600 continue end c ::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: c ::: this thing will derive pressure. Calls eos. c ::: c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: e <= pressuree array (cell centered) c ::: DIMS(e) => index extent of e array c ::: nv => number of components in e array (should be 1) c ::: dat => data neded to derive pressure c ::: DIMS(dat) => index limits of dat array c ::: ncomp => number of components of dat array (4) c ::: lo,hi => subrange of e array where result is requested c ::: domlo,hi => index extent of problem domain (cell centered) c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of e array c ::: time => problem evolution time c ::: bc => array of bndry types for component values c ::: valid only if component touches bndry c ::: level => level of the data c ::: gridno => which grid is this on c ::: ----------------------------------------------------------- subroutine FORT_DERPRES (e,DIMS(e),nv,dat,DIMS(dat),ncomp, $ lo,hi,domlo,domhi,delta,xlo,time,dt,bc, $ level,gridno) integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp, level, gridno integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) c c ::: local arrays c REAL_T eint REAL_T cdum, gdum, csdum, rhomax, rhomin c c ::: local var c integer i,j integer npts, ii, ist REAL_T rho, ux, uy, pmax, pmin, bigp #include "xxmeth.fh" smallp = onetominussix bigp = onetoten do j = lo(2),hi(2) do i = lo(1), hi(1) rho = dat(i,j,1) ux = dat(i,j,2)/rho uy = dat(i,j,3)/rho eint = (dat(i,j,4) - half*(ux**2+uy**2))/rho e(i,j,2) = eint e(i,j,3) = rho e(i,j,4) = dat(i,j,5)/rho end do end do call eos(e(ARG_L1(e),ARG_L2(e),3), $ e(ARG_L1(e),ARG_L2(e),2), $ e(ARG_L1(e),ARG_L2(e),4), $ DIMS(e), $ gdum, $ e(ARG_L1(e),ARG_L2(e),1), $ cdum, csdum, $ DIMS(e), $ lo, hi, 0, 1, 0, 0) end subroutine eos(rho,eint,comp,DIMS(rho),gamc,p,c,csml,DIMS(c), $ lo,hi,lgamc,lp,lc,lcsml) integer lgamc, lp, lc, lcsml integer lo(2), hi(2) integer DIMDEC(rho) integer DIMDEC(c) REAL_T rho(DIMV(rho),1) REAL_T eint(DIMV(rho),1) REAL_T comp(DIMV(rho),1) REAL_T c(DIMV(c),1) REAL_T gamc(DIMV(c),1) REAL_T p(DIMV(c),1) REAL_T csml(DIMV(c),1) REAL_T pres, cc, psml integer j do j = lo(2), hi(2) call eosstrip(rho(lo(1),j,1), $ eint(lo(1),j,1), $ comp(lo(1),j,1), $ gamc(lo(1),j,1), $ p(lo(1),j,1), $ c(lo(1),j,1), $ csml(lo(1),j,1), $ lo(1),hi(1),lgamc,lp,lc,lcsml) end do end subroutine eosstrip(rrr,eee,comp,gamiso,ppp,c,csml,nlo,nhi, & lgamc,lp,lc,lcsml) c :: c :: Inputs and Outpus c :: rrr => (const) mass density c :: eee => (const) internal energy per unit volume c :: comp => (const) the volume fraction of HE c :: n => (const) size of all argument arrays c :: nlo => (const) beginning location c :: nhi => (const) end location c :: gamiso <= (modify) sound speed gamma c :: ppp <= (modify) pressure c :: c <= (modify) sound speed c :: csml <= (modify) sound speed floor c :: lgamc => (const) =1 -> return gamiso c :: lp => (const) =1 -> return pressure c :: lc => (const) =1 -> return sound speed c :: lcsml => (const) =1 -> return sound speed floor c c::::: dummy arguments c integer n, nlo, nhi integer lgamc, lp, lc, lcsml REAL_T rrr(nlo:nhi), eee(nlo:nhi), comp(nlo:nhi), ppp(nlo:nhi) REAL_T gamiso(nlo:nhi), c(nlo:nhi), csml(nlo:nhi) REAL_T comptmp #include "xxmeth.fh" #include "probdata.H" c c::::: local variables c integer k,npts REAL_T ptmp,gamtmp,gamctmp c::::: calculate gamma by linear interpolation. c if (lgamc .eq. 1) then do k = nlo,nhi comptmp = max(min(comp(k),one),zero) gamiso(k) = one/(comptmp/gamcld+(one-comptmp)/gamamb) end do end if c c::::: calculate presure in units of eee c if (lp .eq. 1) then do k = nlo,nhi comptmp = max(min(comp(k),one),zero) gamtmp= one+one/(comptmp/(gamcld-one)+(one-comptmp)/(gamamb-one)) ppp(k) = (gamtmp - one)*eee(k)*rrr(k) end do end if if (lcsml .eq. 1 .and. lc .ne. 1) then write(6,*) "EOS: cannot ask for csml without c" stop end if if (lc .eq. 1) then if (lp .eq. 1 .and. lgamc .eq. 1) then do k = nlo,nhi c(k) = sqrt(gamiso(k)*abs(ppp(k))/max(rrr(k),smallr)) c(k) = max(c(k),small) end do else if (lp .eq. 1 .and. lgamc .ne. 1) then c c::::: have pressure but not gamiso c do k = nlo,nhi comptmp = max(min(comp(k),one),zero) gamtmp= one+one/(comptmp/(gamcld-one)+(one-comptmp)/(gamamb-one)) c(k) = sqrt(gamtmp*abs(ppp(k))/max(rrr(k),smallr)) c(k) = max(c(k),small) end do else if (lgamc .eq. 1 .and. lp .ne. 1) then c c::::: have gamiso but not pressure c do k = nlo,nhi comptmp = max(min(comp(k),one),zero) gamtmp= one+one/(comptmp/(gamcld-one)+(one-comptmp)/(gamamb-one)) ptmp = (gamtmp - one)*eee(k)*rrr(k) c(k) = sqrt(gamiso(k)*abs(ptmp)/max(rrr(k),smallr)) c(k) = max(c(k),small) end do else do k = nlo,nhi comptmp = max(min(comp(k),one),zero) gamtmp= one+one/(comptmp/(gamcld-one)+(one-comptmp)/(gamamb-one)) ptmp = (gamtmp-one)*eee(k)*rrr(k) gamctmp = one/(comptmp/gamcld+(one-comptmp)/gamamb) c(k) = sqrt(gamctmp*abs(ptmp)/max(rrr(k),smallr)) c(k) = max(c(k),small) end do end if if (lcsml .eq. 1) then do k = nlo,nhi csml(k) = max(small,small*c(k)) end do end if end if end ccseapps-2.5/CCSEApps/HCAll/bubble/probin.freon0000644000175000017500000000051211634153073022357 0ustar amckinstryamckinstry $fortin difmag = 0.1 iorder = 2 xcloud = 16.00 ycloud = 0.00 zcloud = 0.00 radius = 1.25 denfact = 3.0246 ecent = 1.96 shockpos = 14.50 rmach = 1.25 gamamb = 1.4 gamcld = 1.25 smallp = 1.d-06 smallr = 1.d-06 smallr = 1.d-06 dengrad = .10 tol_int = .05 pertmag = 0.01 $end ccseapps-2.5/CCSEApps/HCAll/bubble/inputs.helium0000644000175000017500000000667411634153073022601 0ustar amckinstryamckinstry# ------------------ INPUTS TO MAIN PROGRAM ------------------- max_step = 100 # maximum timestep max_step = 10 # maximum timestep stop_time = 18.0 # maximum problem time # ------------------ INPUTS TO AMR CLASS --------------------- # set up for bubble geometry.coord_sys = 0 # 0 => cart, 1 => RZ geometry.prob_lo = 0. -4.45 -4.45 geometry.prob_hi = 35.6 4.45 4.45 geometry.is_periodic = 0 0 0 amr.v = 1 # Verbose output? amr.n_cell = 128 32 32 amr.n_cell = 64 16 16 amr.n_cell = 32 8 8 amr.max_level = 2 # maximum level number allowed amr.max_level = 0 # maximum level number allowed amr.max_level = 1 # maximum level number allowed amr.ref_ratio = 4 4 # refinement ratio amr.ref_ratio = 2 4 # refinement ratio amr.regrid_int = 2 # how often to regrid amr.n_error_buf = 2 2 1 1 # number of buffer cells in error est amr.grid_eff = 0.7 # what constitutes an efficient grid amr.blocking_factor = 1 # block factor in grid generation amr.check_int = 20 # number of timesteps between checkpoints amr.check_file = chk 20 # root name of checkpoint file amr.plot_file = plt 10 amr.plot_int = 10 #amr.plot_vars = density xmom ymom zmom eden tracer amr.grid_log = grdlog # name of grid logging file amr.probin_file = probin.helium # name of the Fortran initialization file amr.max_grid_size = 32 amr.max_grid_size = 16 #amr.regrid_file=grids.fp # ------------------ INPUTS TO PHYSICS CLASS ------------------- hyp.v = 1 # Verbose output? hyp.dt_cutoff = 0.000000001 # level 0 timestep below which we halt hyp.cfl = 1.0 # cfl number for hyperbolic system hyp.cfl = 0.7 # cfl number for hyperbolic system hyp.cfl = 0.9 # cfl number for hyperbolic system hyp.init_shrink = 0.3 # scale back initial timestep hyp.change_max = 1.1 # scale back initial timestep hyp.gravity = 0. hyp.sum_interval = 0 # timesteps between computing mass hyp.do_reflux = 1 # 1 => do refluxing hyp.bogus_value = 5.0e+5 # ---------------- PROBLEM DEPENDENT INPUTS Prob.lo_bc = 2 4 4 Prob.hi_bc = 1 4 4 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall # # select form of FAB output: default is NATIVE # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE # # Initializes distribution strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 0.1 #StationData.coord = 0.11 0.21 0.3 #StationData.coord = 0.5 0.5 0.5 #StationData.coord = 1.23 1.23 1.23 #StationData.coord = 0.23 1.53 2.83 #StationData.coord = 2.34 2.34 2.34 ccseapps-2.5/CCSEApps/HCAll/bubble/probin.2d.helium0000644000175000017500000000046511634153073023044 0ustar amckinstryamckinstry $fortin difmag = 0.1 iorder = 2 xcloud = 0.00 ycloud = 0.00 radius = 1.25 denfact = .1 shockpos = -3 rmach = 1.25 gamamb = 1.4 gamcld = 1.666667 smallp = 1.d-06 smallr = 1.d-06 smallr = 1.d-06 dengrad = .1 tol_int = -.05 pertmag = 0.01 pertmag = 0.0 $end ccseapps-2.5/CCSEApps/HCAll/bubble/probdata.H0000644000175000017500000000374111634153073021747 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ REAL_T ranampl(4:8,4:8,4:8),ranphse(4:8,4:8,4:8) REAL_T tol_int,dengrad,bubgrad,pertmag REAL_T xcloud,ycloud,zcloud,radius,denfact,ecent REAL_T shockpos,rmach,gamamb,gamcld REAL_T rhoamb,u1amb,u2amb,u3amb,eamb,pamb, $ rhoshk,u1shk,u2shk,u3shk,eshk,pshk,ashk, $ rhocld,u1cld,u2cld,u3cld,ecld,pcld common /probdt1/ tol_int,dengrad common /probdt2/ xcloud,ycloud,zcloud,radius,denfact,ecent common /probdt3/ shockpos,rmach,gamamb,gamcld,ranampl,ranphse, $ pertmag common /probdt4/ rhoamb,u1amb,u2amb,u3amb,eamb, $ rhoshk,u1shk,u2shk,u3shk,eshk, $ rhocld,u1cld,u2cld,u3cld,ecld ccseapps-2.5/CCSEApps/HCAll/bubble/inputs.freon0000644000175000017500000000663511634153073022424 0ustar amckinstryamckinstry# ------------------ INPUTS TO MAIN PROGRAM ------------------- max_step = 100 # maximum timestep max_step = 10 # maximum timestep stop_time = 60.0 # maximum problem time # ------------------ INPUTS TO AMR CLASS --------------------- # set up for bubble geometry.coord_sys = 0 # 0 => cart, 1 => RZ geometry.prob_lo = 0. -4.45 -4.45 geometry.prob_hi = 22.25 4.45 4.45 geometry.is_periodic = 0 0 0 amr.v = 1 # Verbose output? amr.n_cell = 80 32 32 amr.n_cell = 40 16 16 amr.max_level = 2 # maximum level number allowed amr.max_level = 0 # maximum level number allowed amr.max_level = 1 # maximum level number allowed amr.ref_ratio = 4 4 # refinement ratio amr.ref_ratio = 2 4 # refinement ratio amr.regrid_int = 2 # how often to regrid amr.n_error_buf = 2 2 1 1 # number of buffer cells in error est amr.grid_eff = 0.7 # what constitutes an efficient grid amr.blocking_factor = 1 # block factor in grid generation amr.check_int = 20 # number of timesteps between checkpoints amr.check_file = chk 20 # root name of checkpoint file amr.plot_file = plt 10 amr.plot_int = 10 #amr.plot_vars = density xmom ymom zmom eden tracer amr.grid_log = grdlog # name of grid logging file amr.probin_file = probin.freon # name of the Fortran initialization file amr.max_grid_size = 32 amr.max_grid_size = 16 #amr.regrid_file=grids.fp # ------------------ INPUTS TO PHYSICS CLASS ------------------- hyp.v = 1 # Verbose output? hyp.dt_cutoff = 0.000000001 # level 0 timestep below which we halt hyp.cfl = 1.0 # cfl number for hyperbolic system hyp.cfl = 0.7 # cfl number for hyperbolic system hyp.cfl = 0.9 # cfl number for hyperbolic system hyp.init_shrink = 0.3 # scale back initial timestep hyp.change_max = 1.1 # scale back initial timestep hyp.gravity = 0. hyp.sum_interval = 0 # timesteps between computing mass hyp.do_reflux = 1 # 1 => do refluxing hyp.bogus_value = 5.0e+5 # ---------------- PROBLEM DEPENDENT INPUTS Prob.lo_bc = 2 4 4 Prob.hi_bc = 1 4 4 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall # # select form of FAB output: default is NATIVE # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE # # Initializes distribution strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 0.1 #StationData.coord = 0.11 0.21 0.3 #StationData.coord = 0.5 0.5 0.5 #StationData.coord = 1.23 1.23 1.23 #StationData.coord = 0.23 1.53 2.83 #StationData.coord = 2.34 2.34 2.34 ccseapps-2.5/CCSEApps/HCAll/bubble/PROB_3D.F0000644000175000017500000007023311634153073021241 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: PROB_3D.F,v 1.6 2003/01/22 23:11:05 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "PROB_F.H" #include "ArrayLim.H" #include "integrator.fh" #define SDIM 3 c ::: ----------------------------------------------------------- c ::: This routine is called at problem initialization time c ::: and when restarting from a checkpoint file. c ::: The purpose is (1) to specify the initial time value c ::: (not all problems start at time=0.0) and (2) to read c ::: problem specific data from a namelist or other input c ::: files and possibly store them or derived information c ::: in FORTRAN common blocks for later use. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: init => TRUE if called at start of problem run c ::: FALSE if called from restart c ::: name => name of "probin" file c ::: namlen => length of name c ::: strttime <= start problem with this time variable c ::: c ::: ----------------------------------------------------------- c subroutine FORT_PROBINIT (init,name,namlen,problo,probhi) integer init,namlen integer name(namlen) REAL_T problo(SDIM), probhi(SDIM) integer untin,i,j,k #include "probdata.H" #include "xxmeth.fh" namelist /fortin/ tol_int, dengrad, bubgrad,ecent, $ xcloud,ycloud,zcloud,radius,pertmag, $ denfact,shockpos,rmach, $ gamamb,gamcld,difmag, iorder, smallr, smallp, small REAL_T rn c c Build "probin" filename -- the name of file containing fortin namelist. c integer maxlen parameter (maxlen=256) character probin*(maxlen) if (namlen .gt. maxlen) then write(6,*) 'probin file name too long' stop end if do i = 1, namlen probin(i:i) = char(name(i)) end do pertmag = zero untin = 9 if (namlen .eq. 0) then c open(untin,file='probin',form='formatted',status='old', action='read') open(untin,file='probin',form='formatted',status='old') else c open(untin,file=probin(1:namlen),form='formatted',status='old', action='read') open(untin,file=probin(1:namlen),form='formatted',status='old') end if read(untin,fortin) c write(6,fortin) close(unit=untin) c ::: define state of ambient gas rhoamb = one pamb = one/gamamb u1amb = zero u2amb = zero u3amb = zero eamb = pamb/((gamamb-one)*rhoamb) c c ::: define state of ambient but dense cloud c rhocld = rhoamb*denfact pcld = pamb u1cld = u1amb u2cld = u2amb u3cld = u3amb ecld = pcld/((gamcld-one)*rhocld) c c ::: define state of shock c ashk = sqrt(gamamb*pamb/rhoamb) u1shk = ashk*two*(rmach**2-one)/((gamamb+one)*rmach ) u2shk = zero u3shk = zero rhoshk = rhoamb*((gamamb+one)*rmach**2)/((gamamb-one)*rmach**2 + two) pshk = pamb*(one + ( two*gamamb*(rmach**2 - one)) / (gamamb+one) ) eshk = pshk / ((gamamb-one)*rhoshk) u1amb = u1amb - u1shk u1cld = u1cld - u1shk u1shk = zero c c ::: translate to conserved quantities c eamb = rhoamb*(eamb + half*(u1amb**2 + u2amb**2 + u3amb**2)) u1amb = rhoamb*u1amb u2amb = rhoamb*u2amb u3amb = rhoamb*u3amb eshk = rhoshk*(eshk + half*(u1shk**2 + u2shk**2 + u3shk**2)) u1shk = rhoshk*u1shk u2shk = rhoshk*u2shk u3shk = rhoshk*u3shk ecld = rhocld*(ecld + half*(u1cld**2 + u2cld**2 + u3cld**2)) u1cld = rhocld*u1cld u2cld = rhocld*u2cld u3cld = rhocld*u3cld c c set random amplitudes c if (pertmag .gt. zero) then do k = 4,8 do j = 4,8 do i = 4,8 call blutilrand(rn) ranampl(i,j,k) = pertmag * two * (rn - half) call blutilrand(rn) ranphse(i,j,k) = two * Pi * rn end do end do end do end if return end c ::: ----------------------------------------------------------- c ::: This routine is called at problem setup time and is used c ::: to initialize data on each grid. c ::: c ::: NOTE: all arrays have one cell of ghost zones surrounding c ::: the grid interior. Values in these cells need not c ::: be set here. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: level => amr level of grid c ::: time => time at which to init data c ::: lo,hi => index limits of grid interior (cell centered) c ::: nstate => number of state components. You should know c ::: this already! c ::: state <= Scalar array c ::: delta => cell size c ::: xlo,xhi => physical locations of lower left and upper c ::: right hand corner of grid. (does not include c ::: ghost region). c ::: ----------------------------------------------------------- subroutine FORT_INITDATA(level, time, lo, hi, $ nstate, state, DIMS(state), $ delta, xlo, xhi) integer level, nstate integer lo(SDIM),hi(SDIM) integer DIMDEC(state) REAL_T time, delta(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T state(DIMV(state),nstate) c ::::: local variables REAL_T pert, dist #include "probdata.H" c ::: local var integer i, j, k, ii, jj, kk, intsx, intsy, intsz integer iamp,jamp,kamp REAL_T dx, dy, dz, rsq REAL_T xcen, ycen, zcen dx = delta(1) dy = delta(2) dz = delta(3) do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) xcen = xlo(1) + dx*(float(i-lo(1)) + half) ycen = xlo(2) + dy*(float(j-lo(2)) + half) zcen = xlo(3) + dz*(float(k-lo(3)) + half) if (xcen .lt. shockpos) then state(i,j,k,1) = rhoshk state(i,j,k,2) = u1shk state(i,j,k,3) = u2shk state(i,j,k,4) = u3shk state(i,j,k,5) = eshk #if(NADV>0) state(i,j,k,6) = zero #endif else rsq = (xcen-xcloud)**2+(ycen-ycloud)**2+ 1 ((zcen-zcloud)**2)/ecent dist = sqrt(rsq) if (dist .le. radius) then pert = one do kamp = 4,8 do jamp = 4,8 do iamp = 4,8 pert = pert + ranampl(iamp,jamp,kamp)* & cos(ranphse(iamp,jamp,kamp)+two*Pi*kamp*(xcen-xcloud)/radius)* & cos(ranphse(iamp,jamp,kamp)+two*Pi*jamp*(ycen-ycloud)/radius)* & cos(ranphse(iamp,jamp,kamp)+two*Pi*iamp*(zcen-zcloud)/radius) end do end do end do state(i,j,k,1) = pert * rhocld state(i,j,k,2) = pert * u1cld state(i,j,k,3) = pert * u2cld state(i,j,k,4) = pert * u3cld state(i,j,k,5) = pert * ecld #if(NADV>0) state(i,j,k,6) = pert * rhocld #endif else state(i,j,k,1) = rhoamb state(i,j,k,2) = u1amb state(i,j,k,3) = u2amb state(i,j,k,4) = u3amb state(i,j,k,5) = eamb #if(NADV>0) state(i,j,k,6) = zero #endif end if end if end do end do end do return end c ::: ----------------------------------------------------------- c ::: This routine will tag high error cells based on the c ::: density gradient c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: tag <= integer tag array c ::: lo,hi => index extent of tag array c ::: set => integer value to tag cell for refinement c ::: clear => integer value to untag cell c ::: rho => density array c ::: ng => number of ghost zones in rho array (should be 1) c ::: nvar => number of components in rho array (should be 1) c ::: domlo,hi => index extent of problem domain c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of tag array c ::: problo => phys loc of lower left corner of prob domain c ::: time => problem evolution time c ::: ----------------------------------------------------------- subroutine FORT_DENERROR (tag,DIMS(tag),set,clear, & adv,DIMS(adv),lo,hi,nvar, & domlo,domhi,delta,xlo, & problo,time,level) integer DIMDEC(tag) integer DIMDEC(adv) integer lo(SDIM), hi(SDIM) integer nvar, set, clear, level integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), problo(SDIM), time integer tag(DIMV(tag)) REAL_T adv(DIMV(adv),nvar) REAL_T x, y, z,ax, ay, az,aerr, denloc integer i, j,k, leni, lenj, lenk REAL_T tracer logical ltest #include "probdata.H" #include "xxmeth.fh" leni = hi(1)-lo(1) lenj = hi(2)-lo(2) lenk = hi(3)-lo(3) do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) ax = abs(adv(i+1,j,k,1) - adv(i-1,j,k,1)) ay = abs(adv(i,j+1,k,1) - adv(i,j-1,k,1)) az = abs(adv(i,j,k+1,1) - adv(i,j,k-1,1)) aerr = max(ax,ay,az) denloc = min(adv(i,j,k,1),adv(i,j,k+1,1),adv(i,j,k-1,1)) denloc = min(denloc,adv(i,j+1,k,1),adv(i,j-1,k,1)) denloc = min(denloc,adv(i+1,j,k,1),adv(i-1,j,k,1)) denloc = max(denloc,smallr) aerr = aerr / denloc tag(i,j,k) = cvmgt(set,tag(i,j,k),aerr.gt.dengrad) end do end do end do if (tol_int .gt. zero ) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tracer = adv(i,j,k,6)/adv(i,j,k,1) ltest = (tracer.gt.tol_int) .and. (tracer.lt. (one-tol_int)) tag(i,j,k) = cvmgt(set,tag(i,j,k),ltest) end do end do end do end if end c c Fill den, xmom, ymom, zden, eden as a group. c subroutine FORT_HYPFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc) integer DIMS(adv) integer bc(SDIM,2,5) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv),5) call FORT_DENFILL (adv(ARG_L1(adv),ARG_L2(adv),ARG_L3(adv),1), & DIMS(adv),domlo,domhi,delta,xlo,time,bc(1,1,1)) call FORT_XMOMFILL (adv(ARG_L1(adv),ARG_L2(adv),ARG_L3(adv),2), & DIMS(adv),domlo,domhi,delta,xlo,time,bc(1,1,2)) call FORT_YMOMFILL (adv(ARG_L1(adv),ARG_L2(adv),ARG_L3(adv),3), & DIMS(adv),domlo,domhi,delta,xlo,time,bc(1,1,3)) call FORT_ZMOMFILL (adv(ARG_L1(adv),ARG_L2(adv),ARG_L3(adv),4), & DIMS(adv),domlo,domhi,delta,xlo,time,bc(1,1,4)) call FORT_EDENFILL (adv(ARG_L1(adv),ARG_L2(adv),ARG_L3(adv),5), & DIMS(adv),domlo,domhi,delta,xlo,time,bc(1,1,5)) end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: adv <= advected quantity array c ::: lo,hi => index extent of adv array c ::: domlo,hi => index extent of problem domain c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of adv array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_DENFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc) integer DIMS(adv) integer bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j, k REAL_T y,x integer lo(SDIM),hi(SDIM) #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 lo(3) = adv_l3 hi(1) = adv_h1 hi(2) = adv_h2 hi(3) = adv_h3 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = rhoshk end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = rhoamb end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) do k = lo(3),hi(3) adv(i,j,k) = adv(i,domlo(2),k) end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) do k = lo(3),hi(3) adv(i,j,k) = adv(i,domhi(2),k) end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.lo(3).lt.domlo(3)) then do k = lo(3), domlo(3)-1 do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = adv(i,j,domlo(3)) end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.hi(3).gt.domhi(3)) then do k = domhi(3)+1, hi(3) do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = adv(i,j,domhi(3)) end do end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: adv <= advected quantity array c ::: lo,hi => index extent of adv array c ::: domlo,hi => index extent of problem domain c ::: delta => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of adv array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_XMOMFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc ) integer DIMS(adv) integer bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j,k REAL_T y,x integer lo(SDIM),hi(SDIM) #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 lo(3) = adv_l3 hi(1) = adv_h1 hi(2) = adv_h2 hi(3) = adv_h3 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = u1shk end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = u1amb end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) do k = lo(3), hi(3) adv(i,j,k) = adv(i,domlo(2),k) end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) do k = lo(3), hi(3) adv(i,j,k) = adv(i,domhi(2),k) end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.lo(3).lt.domlo(3)) then do k = lo(3), domlo(3)-1 do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = adv(i,j,domlo(3)) end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.hi(3).gt.domhi(3)) then do k = domhi(3)+1, hi(3) do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = adv(i,j,domhi(3)) end do end do end do end if end subroutine FORT_YMOMFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc ) integer DIMS(adv) integer lo(SDIM), hi(SDIM), bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j, k REAL_T y,x #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 lo(3) = adv_l3 hi(1) = adv_h1 hi(2) = adv_h2 hi(3) = adv_h3 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) do k = lo(3), hi(3) y = xlo(2) + delta(2)*(float(j-lo(2)) + 0.5) adv(i,j,k) = u2shk end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = u2amb end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) do k = lo(3), hi(3) adv(i,j,k) = -adv(i,domlo(2),k) end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) do k = lo(3), hi(3) adv(i,j,k) = -adv(i,domhi(2),k) end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.lo(3).lt.domlo(3)) then do k = lo(3), domlo(3)-1 do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = adv(i,j,domlo(3)) end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.hi(3).gt.domhi(3)) then do k = domhi(3)+1, hi(3) do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = adv(i,j,domhi(3)) end do end do end do end if end subroutine FORT_ZMOMFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc ) integer DIMS(adv) integer bc(SDIM,2),lo(SDIM),hi(SDIM) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j, k REAL_T y,x #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 lo(3) = adv_l3 hi(1) = adv_h1 hi(2) = adv_h2 hi(3) = adv_h3 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = u3shk end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = u3amb end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) do k = lo(3), hi(3) adv(i,j,k) = -adv(i,domlo(2),k) end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) do k = lo(3), hi(3) adv(i,j,k) = -adv(i,domhi(2),k) end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.lo(3).lt.domlo(3)) then do k = lo(3), domlo(3)-1 do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = -adv(i,j,domlo(3)) end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.hi(3).gt.domhi(3)) then do k = domhi(3)+1, hi(3) do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = -adv(i,j,domhi(3)) end do end do end do end if end subroutine FORT_EDENFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc ) integer DIMS(adv) integer lo(SDIM), hi(SDIM), bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j,k REAL_T y,x #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 lo(3) = adv_l3 hi(1) = adv_h1 hi(2) = adv_h2 hi(3) = adv_h3 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = eshk end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = eamb end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) do k = lo(3), hi(3) adv(i,j,k) = adv(i,domlo(2),k) end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) do k = lo(3), hi(3) adv(i,j,k) = adv(i,domhi(2),k) end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.lo(3).lt.domlo(3)) then do k = lo(3), domlo(3)-1 do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = adv(i,j,domlo(3)) end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.hi(3).gt.domhi(3)) then do k = domhi(3)+1, hi(3) do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = adv(i,j,domhi(3)) end do end do end do end if end subroutine FORT_TRACFILL (adv,DIMS(adv),domlo,domhi,delta, & xlo,time,bc ) integer DIMS(adv) integer lo(SDIM), hi(SDIM), bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer i, j,k REAL_T y,x #include "probdata.H" lo(1) = adv_l1 lo(2) = adv_l2 lo(3) = adv_l3 hi(1) = adv_h1 hi(2) = adv_h2 hi(3) = adv_h3 call filcc (adv,DIMS(adv),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = zero end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) do k = lo(3), hi(3) adv(i,j,k) = zero end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) do k = lo(3), hi(3) adv(i,j,k) = adv(i,domlo(2),k) end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) do k = lo(3), hi(3) adv(i,j,k) = adv(i,domhi(2),k) end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.lo(3).lt.domlo(3)) then do k = lo(3), domlo(3)-1 do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = adv(i,j,domlo(3)) end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.hi(3).gt.domhi(3)) then do k = domhi(3)+1, hi(3) do i = lo(1), hi(1) do j = lo(2), hi(2) adv(i,j,k) = adv(i,j,domhi(3)) end do end do end do end if end ccseapps-2.5/CCSEApps/HCAll/bubble/GODUNOV_3D.F0000644000175000017500000020557511634153073021631 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: GODUNOV_3D.F,v 1.3 2001/02/14 19:05:36 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "GODUNOV_F.H" #include "ArrayLim.H" #include "integrator.fh" #if defined(BL_USE_FLOAT) || defined(BL_T3E) #define BL_USE_FLOAT_CONST #define onetominussix 1.0e-6 #define onepointfour 1.4 #endif #if defined(BL_USE_DOUBLE) && ! defined(BL_T3E) #define BL_USE_DOUBLE_CONST #define onetominussix 1.0d-6 #define onepointfour 1.4d+00 #endif #define SDIM 3 #define NGHOST 3 #define LEFT 0 #define RIGHT 1 #define BOTTOM 2 #define TOP 3 #define FRONT 4 #define BACK 5 #define INTERIOR -1 #define ON_PHYS_B 0 #define NTHERM 6 #define NQ (6+NADV) #if __STDC__==1 #define BL_ARGL1(u) u##_l1 #define BL_ARGL2(u) u##_l2 #define BL_ARGL3(u) u##_l3 #define BL_ARGH1(u) u##_h1 #define BL_ARGH2(u) u##_h2 #define BL_ARGH3(u) u##_h3 #define BL_IARG(u) u##_l1, u##_l2, u##_l3, u##_h1, u##_h2, u##_h3 #define BL_UVAR(u,v) REAL_T u(v##_l1:v##_h1, v##_l2:v##_h2, v##_l3:v##_h3) #else #define BL_ARGL1(u) u/**/_l1 #define BL_ARGL2(u) u/**/_l2 #define BL_ARGL3(u) u/**/_l3 #define BL_ARGH1(u) u/**/_h1 #define BL_ARGH2(u) u/**/_h2 #define BL_ARGH3(u) u/**/_h3 #define BL_IARG(u) u/**/_l1, u/**/_l2, u/**/_l3, u/**/_h1, u/**/_h2, u/**/_h3 #define BL_UVAR(u,v) REAL_T u(v/**/_l1:v/**/_h1, v/**/_l2:v/**/_h2, v/**/_l3:v/**/_h3) #endif c c From ArrayLim.H ... c #define BL_FARG(u) u, DIMS(u) #define BL_FBOUNDS(u) integer DIMDEC(u) #define BL_FARRAY(u,n) REAL_T u(DIMV(u), n) #define BL_FARRAY1(u) REAL_T u(DIMV(u)) #if __STDC__==1 #define BL_BARG(b) b##lo, b##hi #define BL_BBOUNDS(b) integer b##lo(3), b##hi(3) #else #define BL_BARG(b) b/**/lo, b/**/hi #define BL_BBOUNDS(b) integer b/**/lo(3), b/**/hi(3) #endif c c --------------------------------------------------------------- c:: Characteristic tracing for hyperbolic conservation law c:: Arguments: c:: q => field of primitive variables c:: qx => x-slopes of primitive variables c:: c => sound speed c:: enth <= enthalpy c:: qbarl <= left-edge traced state c:: qbarr <= right-edge traced state c:: bxlo,bxhi => index limits of grid interior c:: bc => array of bndry condition flags c:: delta => cell size c:: dt => timestep size c:: nvar => number of characteristic variables c --------------------------------------------------------------- c ::: these give meaning to the primitive variable components #define QRHO 1 #define QVEL1 2 #define QVEL2 3 #define QVEL3 4 #define QPRES 5 #define QRHOE 6 #if(NADV>0) #define QADV 7 #endif subroutine FORT_XTRACE( & BL_FARG(q), & BL_FARG(qx), & BL_FARG(c), & BL_FARG(enth), & BL_FARG(qbarl), & BL_FARG(qbarr), & BL_FARG(dloga), & BL_FARG(courno), & BL_BARG(bx), & delta, dt, bc, gBndry, nvar & ) integer nvar, gBndry(0:2*SDIM-1) integer bc(SDIM,2,nvar-1),qbc(SDIM,2,NQ) REAL_T delta(SDIM), dt BL_FBOUNDS(q) BL_FARRAY(q,nvar) BL_FBOUNDS(qx) BL_FARRAY(qx,nvar) BL_FBOUNDS(qbarl) BL_FARRAY(qbarl,nvar) BL_FBOUNDS(qbarr) BL_FARRAY(qbarr,nvar) BL_FBOUNDS(c) BL_FARRAY1(c) BL_FBOUNDS(enth) BL_FARRAY1(enth) BL_FBOUNDS(dloga) BL_FARRAY1(dloga) BL_FBOUNDS(courno) BL_FARRAY1(courno) BL_BBOUNDS(bx) integer i, j, k, n, nbc integer is, ie, js, je, ks, ke, isedg, ieedg,jsedg,jeedg integer ksedg, keedg REAL_T dx, dy, dz REAL_T spvol, dtbydx, scr, eken, eta, dthalf REAL_T sourcp, sourcr, source, avgarea REAL_T alpham, alphap, alpha0r, alpha0e REAL_T alpha0v1,alpha0v2 REAL_T spminus, spplus, spzero REAL_T apright, amright REAL_T apleft, amleft REAL_T azrright, azeright, azv1rght,azv2rght REAL_T azrleft, azeleft, azv1left,azv2left REAL_T smallr REAL_T reflect REAL_T gdum,csdum,pdum integer iv c ::: some useful macro definitions # define U(i,j,k) q(i,j,k,QVEL1) # define V(i,j,k) q(i,j,k,QVEL2) # define W(i,j,k) q(i,j,k,QVEL3) # define P(i,j,k) q(i,j,k,QPRES) # define RHO(i,j,k) q(i,j,k,QRHO) # define RHOE(i,j,k) q(i,j,k,QRHOE) #if(NADV>0) # define ADV(i,j,k) q(i,j,k,QADV) #endif # define DU(i,j,k) qx(i,j,k,QVEL1) # define DV(i,j,k) qx(i,j,k,QVEL2) # define DW(i,j,k) qx(i,j,k,QVEL3) # define DP(i,j,k) qx(i,j,k,QPRES) # define DRHO(i,j,k) qx(i,j,k,QRHO) # define DRHOE(i,j,k) qx(i,j,k,QRHOE) #if(NADV>0) # define DADV(i,j,k) qx(i,j,k,QADV) #endif dx = delta(1) dy = delta(2) dz = delta(3) is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) ks = bxlo(3) ke = bxhi(3) isedg = qbarl_l1 ieedg = qbarl_h1 jsedg = qbarl_l2 jeedg = qbarl_h2 ksedg = qbarl_l3 keedg = qbarl_h3 smallr = onetominussix dtbydx = dt/dx c ::: convert energy to intensive form for eos call c do k = ks,ke c do j = js,je c do i =is,ie c RHOE(i,j,k) = RHOE(i,j,k)/RHO(i,j,k) c enddo c enddo c enddo c convert energy to extensive form and compute courant number do k = ks,ke do j = js,je do i =is,ie c RHOE(i,j,k) = RHOE(i,j,k)*RHO(i,j,k) courno(i,j,k) = dtbydx*(c(i,j,k)+abs(U(i,j,k))) enddo enddo enddo c characteristic analysis do k = ksedg,keedg do j = jsedg,jeedg do i = isedg,ieedg-1 enth(i,j,k) = (RHOE(i,j,k)/RHO(i,j,k) + $ P(i,j,k)/RHO(i,j,k))/c(i,j,k)**2 alpham = half*(DP(i,j,k)/(RHO(i,j,k)*c(i,j,k)) - DU(i,j,k))*RHO(i,j,k) $ /c(i,j,k) alphap = half*(DP(i,j,k)/(RHO(i,j,k)*c(i,j,k)) + DU(i,j,k))*RHO(i,j,k) $ /c(i,j,k) alpha0r = DRHO(i,j,k) - DP(i,j,k)/c(i,j,k)**2 alpha0e = DRHOE(i,j,k) - DP(i,j,k)*enth(i,j,k) alpha0v1 = DV(i,j,k) alpha0v2 = DW(i,j,k) c ::: ::::: Right state of edge at left spminus = cvmgp(-one,(U(i,j,k) - c(i,j,k))*dtbydx,U(i,j,k) - c(i,j,k)) spplus = cvmgp(-one,(U(i,j,k) + c(i,j,k))*dtbydx,U(i,j,k) + c(i,j,k)) spzero = cvmgp(-one, U(i,j,k) *dtbydx,U(i,j,k) ) apright = half*(-one - spplus )*alphap amright = half*(-one - spminus)*alpham azrright= half*(-one - spzero )*alpha0r azeright= half*(-one - spzero )*alpha0e azv1rght= half*(-one - spzero )*alpha0v1 azv2rght= half*(-one - spzero )*alpha0v2 qbarr(i,j,k,QRHO) = q(i,j,k,QRHO) + apright + amright + azrright qbarr(i,j,k,QRHO) = max(smallr, qbarr(i,j,k,QRHO)) qbarr(i,j,k,QVEL1) = q(i,j,k,QVEL1) + $ (apright - amright)*c(i,j,k)/RHO(i,j,k) qbarr(i,j,k,QVEL2) = q(i,j,k,QVEL2) + azv1rght qbarr(i,j,k,QVEL3) = q(i,j,k,QVEL3) + azv2rght qbarr(i,j,k,QPRES) = q(i,j,k,QPRES) + $ (apright + amright)*c(i,j,k)**2 qbarr(i,j,k,QRHOE) = q(i,j,k,QRHOE) + (apright + $ amright)*enth(i,j,k)*c(i,j,k)**2 + azeright #if(NADV>0) qbarr(i,j,k,QADV) = q(i,j,k,QADV)+half*(-one-spzero)*DADV(i,j,k) #endif c ::: ::::: Left state of edge at right spminus = cvmgp((U(i,j,k) - c(i,j,k))*dtbydx,one,U(i,j,k) - c(i,j,k)) spplus = cvmgp((U(i,j,k) + c(i,j,k))*dtbydx,one,U(i,j,k) + c(i,j,k)) spzero = cvmgp( U(i,j,k) *dtbydx,one,U(i,j,k) ) apleft = half*(one - spplus )*alphap amleft = half*(one - spminus)*alpham azrleft= half*(one - spzero )*alpha0r azeleft= half*(one - spzero )*alpha0e azv1left= half*(one - spzero )*alpha0v1 azv2left= half*(one - spzero )*alpha0v2 qbarl(i+1,j,k,QRHO) = q(i,j,k,QRHO) + apleft + amleft + azrleft qbarl(i+1,j,k,QRHO) = max(smallr, qbarl(i+1,j,k,QRHO)) qbarl(i+1,j,k,QVEL1) = q(i,j,k,QVEL1) + $ (apleft - amleft)*c(i,j,k)/RHO(i,j,k) qbarl(i+1,j,k,QVEL2) = q(i,j,k,QVEL2) + azv1left qbarl(i+1,j,k,QVEL3) = q(i,j,k,QVEL3) + azv2left qbarl(i+1,j,k,QPRES) = q(i,j,k,QPRES) + $ (apleft + amleft)*c(i,j,k)**2 qbarl(i+1,j,k,QRHOE) = q(i,j,k,QRHOE) + (apleft + amleft)* $ enth(i,j,k)*c(i,j,k)**2 + azeleft #if(NADV>0) qbarl(i+1,j,k,QADV) = q(i,j,k,QADV)+half*(one-spzero)*DADV(i,j,k) #endif enddo enddo enddo c ::: Colella hack near R=0 singularity do k = ks,ke do j = js,je do i = is,ie if (dloga(i,j,k) .ne. zero) then eta = (one-courno(i,j,k))/(c(i,j,k)*dt*dloga(i,j,k)) eta = min(one, eta) dloga(i,j,k) = dloga(i,j,k) * eta endif enddo enddo enddo dthalf = half*dt c ::: add geometric source terms to traced states do k = ksedg,keedg do j = jsedg,jeedg do i = isedg,ieedg-1 sourcr = -RHO(i,j,k)*dloga(i,j,k)*U(i,j,k)*dthalf sourcp = sourcr*c(i,j,k)**2 source = sourcp*enth(i,j,k) qbarl(i+1,j,k,QRHO) = qbarl(i+1,j,k,QRHO) + sourcr qbarl(i+1,j,k,QRHO) = max(smallr, qbarl(i+1,j,k,QRHO)) qbarl(i+1,j,k,QPRES) = qbarl(i+1,j,k,QPRES) + sourcp qbarl(i+1,j,k,QRHOE) = qbarl(i+1,j,k,QRHOE) + source qbarr(i,j,k,QRHO) = qbarr(i,j,k,QRHO) + sourcr qbarr(i,j,k,QRHO) = max(smallr, qbarr(i,j,k,QRHO)) qbarr(i,j,k,QPRES) = qbarr(i,j,k,QPRES) + sourcp qbarr(i,j,k,QRHOE) = qbarr(i,j,k,QRHOE) + source enddo enddo enddo c ::: convert energy back to intensive form c ::: for eos call in RIEMANN c do k = ks,ke c do j = js,je c do i =is,ie c RHOE(i,j,k) = RHOE(i,j,k)/RHO(i,j,k) c enddo c enddo c enddo #undef U #undef V #undef W #undef P #undef RHO #undef RHOE #undef DU #undef DV #undef DW #undef DP #undef DRHO #undef DRHOE #if(NADV>0) #undef DADV #endif end c c --------------------------------------------------------------- c:: Y characteristic tracing for hyperbolic conservation law c:: Arguments: c:: q => field of primitive variables c:: qy => x-slopes of primitive variables c:: c => sound speed c:: enth <= enthalpy c:: qbarl <= bottom-edge traced state c:: qbarr <= top-edge traced state c:: bxlo,bxhi => index limits of grid interior c:: bc => array of bndry condition flags c:: delta => cell size c:: dt => timestep size c:: nvar => number of characteristic variables c --------------------------------------------------------------- c ::: these give meaning to the primitive variable components #define QRHO 1 #define QVEL1 2 #define QVEL2 3 #define QVEL3 4 #define QPRES 5 #define QRHOE 6 #if(NADV>0) #define QADV 7 #endif subroutine FORT_YTRACE( & BL_FARG(q), & BL_FARG(qy), & BL_FARG(c), & BL_FARG(enth), & BL_FARG(qbarl), & BL_FARG(qbarr), & BL_FARG(dloga), & BL_FARG(courno), & BL_BARG(bx), & delta, dt, bc, gBndry, nvar & ) integer nvar, gBndry(0:2*SDIM-1) integer bc(SDIM,2,nvar-1),qbc(SDIM,2,NQ) REAL_T delta(SDIM), dt BL_FBOUNDS(q) BL_FARRAY(q,nvar) BL_FBOUNDS(qy) BL_FARRAY(qy,nvar) BL_FBOUNDS(qbarl) BL_FARRAY(qbarl,nvar) BL_FBOUNDS(qbarr) BL_FARRAY(qbarr,nvar) BL_FBOUNDS(c) BL_FARRAY1(c) BL_FBOUNDS(enth) BL_FARRAY1(enth) BL_FBOUNDS(dloga) BL_FARRAY1(dloga) BL_FBOUNDS(courno) BL_FARRAY1(courno) BL_BBOUNDS(bx) integer i, j,k, n, nbc integer is,ie,js,je,ks,ke,isedg,ieedg,jsedg,jeedg,ksedg,keedg REAL_T dx, dy,dz REAL_T spvol, dtbydx, scr, eken, eta, dthalf REAL_T sourcp, sourcr, source, avgarea REAL_T alpham, alphap, alpha0r, alpha0e REAL_T alpha0v1,alpha0v2 REAL_T spminus, spplus, spzero REAL_T apright, amright REAL_T apleft, amleft REAL_T azrright, azeright, azv1rght,azv2rght REAL_T azrleft, azeleft, azv1left,azv2left REAL_T smallr REAL_T reflect REAL_T gdum,csdum,pdum c ::: some useful macro definitions # define U(i,j,k) q(i,j,k,QVEL1) # define V(i,j,k) q(i,j,k,QVEL2) # define W(i,j,k) q(i,j,k,QVEL3) # define P(i,j,k) q(i,j,k,QPRES) # define RHO(i,j,k) q(i,j,k,QRHO) # define RHOE(i,j,k) q(i,j,k,QRHOE) #if(NADV>0) # define ADV(i,j,k) q(i,j,k,QADV) #endif # define DU(i,j,k) qy(i,j,k,QVEL1) # define DV(i,j,k) qy(i,j,k,QVEL2) # define DW(i,j,k) qy(i,j,k,QVEL3) # define DP(i,j,k) qy(i,j,k,QPRES) # define DRHO(i,j,k) qy(i,j,k,QRHO) # define DRHOE(i,j,k) qy(i,j,k,QRHOE) #if(NADV>0) # define DADV(i,j,k) qy(i,j,k,QADV) #endif dx = delta(1) dy = delta(2) dz = delta(3) is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) ks = bxlo(3) ke = bxhi(3) isedg = qbarl_l1 ieedg = qbarl_h1 jsedg = qbarl_l2 jeedg = qbarl_h2 ksedg = qbarl_l3 keedg = qbarl_h3 smallr = onetominussix dtbydx = dt/dx c ::: convert energy to intensive form for eos call c do k = ks,ke c do j = js,je c do i =is,ie c RHOE(i,j,k) = RHOE(i,j,k)/RHO(i,j,k) c enddo c enddo c enddo c convert energy back to extensive form and compute courant number do k = ks,ke do j = js,je do i =is,ie c RHOE(i,j,k) = RHOE(i,j,k)*RHO(i,j,k) courno(i,j,k) = dtbydx*(c(i,j,k)+abs(V(i,j,k))) enddo enddo enddo c characteristic analysis do k = ksedg,keedg do j = jsedg,jeedg-1 do i = isedg,ieedg enth(i,j,k) = (RHOE(i,j,k)/RHO(i,j,k) + $ P(i,j,k)/RHO(i,j,k))/c(i,j,k)**2 alpham = half*(DP(i,j,k)/(RHO(i,j,k)*c(i,j,k)) - DV(i,j,k))*RHO(i,j,k) $ /c(i,j,k) alphap = half*(DP(i,j,k)/(RHO(i,j,k)*c(i,j,k)) + DV(i,j,k))*RHO(i,j,k) $ /c(i,j,k) alpha0r = DRHO(i,j,k) - DP(i,j,k)/c(i,j,k)**2 alpha0e = DRHOE(i,j,k) - DP(i,j,k)*enth(i,j,k) alpha0v1 = DU(i,j,k) alpha0v2 = DW(i,j,k) c ::: ::::: Top state of edge at bottom spminus = cvmgp(-one,(V(i,j,k) - c(i,j,k))*dtbydx,V(i,j,k) - c(i,j,k)) spplus = cvmgp(-one,(V(i,j,k) + c(i,j,k))*dtbydx,V(i,j,k) + c(i,j,k)) spzero = cvmgp(-one, V(i,j,k) *dtbydx,V(i,j,k) ) apright = half*(-one - spplus )*alphap amright = half*(-one - spminus)*alpham azrright= half*(-one - spzero )*alpha0r azeright= half*(-one - spzero )*alpha0e azv1rght= half*(-one - spzero )*alpha0v1 azv2rght= half*(-one - spzero )*alpha0v2 qbarr(i,j,k,QRHO) = q(i,j,k,QRHO) + apright + amright + azrright qbarr(i,j,k,QRHO) = max(smallr, qbarr(i,j,k,QRHO)) qbarr(i,j,k,QVEL2) = q(i,j,k,QVEL2) + $ (apright - amright)*c(i,j,k)/RHO(i,j,k) qbarr(i,j,k,QVEL1) = q(i,j,k,QVEL1) + azv1rght qbarr(i,j,k,QVEL3) = q(i,j,k,QVEL3) + azv2rght qbarr(i,j,k,QPRES) = q(i,j,k,QPRES) + $ (apright + amright)*c(i,j,k)**2 qbarr(i,j,k,QRHOE) = q(i,j,k,QRHOE) + (apright + $ amright)*enth(i,j,k)*c(i,j,k)**2 + azeright #if(NADV>0) qbarr(i,j,k,QADV) = q(i,j,k,QADV)+half*(-one-spzero)*DADV(i,j,k) #endif c ::: ::::: Bottom state of edge at top spminus = cvmgp((V(i,j,k) - c(i,j,k))*dtbydx,one,V(i,j,k) - c(i,j,k)) spplus = cvmgp((V(i,j,k) + c(i,j,k))*dtbydx,one,V(i,j,k) + c(i,j,k)) spzero = cvmgp( V(i,j,k) *dtbydx,one,V(i,j,k) ) apleft = half*(one - spplus )*alphap amleft = half*(one - spminus)*alpham azrleft= half*(one - spzero )*alpha0r azeleft= half*(one - spzero )*alpha0e azv1left= half*(one - spzero )*alpha0v1 azv2left= half*(one - spzero )*alpha0v2 qbarl(i,j+1,k,QRHO) = q(i,j,k,QRHO) + apleft + amleft + azrleft qbarl(i,j+1,k,QRHO) = max(smallr, qbarl(i,j+1,k,QRHO)) qbarl(i,j+1,k,QVEL2) = q(i,j,k,QVEL2) + $ (apleft - amleft)*c(i,j,k)/RHO(i,j,k) qbarl(i,j+1,k,QVEL1) = q(i,j,k,QVEL1) + azv1left qbarl(i,j+1,k,QVEL3) = q(i,j,k,QVEL3) + azv2left qbarl(i,j+1,k,QPRES) = q(i,j,k,QPRES) + $ (apleft + amleft)*c(i,j,k)**2 qbarl(i,j+1,k,QRHOE) = q(i,j,k,QRHOE) + (apleft + amleft)* $ enth(i,j,k)*c(i,j,k)**2 + azeleft #if(NADV>0) qbarl(i,j+1,k,QADV) = q(i,j,k,QADV)+half*(one-spzero)*DADV(i,j,k) #endif enddo enddo enddo c ::: Colella hack near R=0 singularity do k = ks,ke do j = js,je do i = is,ie if (dloga(i,j,k) .ne. zero) then eta = (one-courno(i,j,k))/(c(i,j,k)*dt*dloga(i,j,k)) eta = min(one, eta) dloga(i,j,k) = dloga(i,j,k) * eta endif enddo enddo enddo dthalf = half*dt c ::: add geometric source terms to traced states do k = ksedg,keedg do j = jsedg,jeedg-1 do i = isedg,ieedg sourcr = -RHO(i,j,k)*dloga(i,j,k)*V(i,j,k)*dthalf sourcp = sourcr*c(i,j,k)**2 source = sourcp*enth(i,j,k) qbarl(i,j+1,k,QRHO) = qbarl(i,j+1,k,QRHO) + sourcr qbarl(i,j+1,k,QRHO) = max(smallr, qbarl(i,j+1,k,QRHO)) qbarl(i,j+1,k,QPRES) = qbarl(i,j+1,k,QPRES) + sourcp qbarl(i,j+1,k,QRHOE) = qbarl(i,j+1,k,QRHOE) + source qbarr(i,j,k ,QRHO) = qbarr(i,j,k ,QRHO) + sourcr qbarr(i,j,k ,QRHO) = max(smallr, qbarr(i,j,k,QRHO)) qbarr(i,j,k ,QPRES) = qbarr(i,j,k ,QPRES) + sourcp qbarr(i,j,k ,QRHOE) = qbarr(i,j,k ,QRHOE) + source enddo enddo enddo c ::: convert energy back to intensive form c ::: for eos call in RIEMANN c do k = ks,ke c do j = js,je c do i =is,ie c RHOE(i,j,k) = RHOE(i,j,k)/RHO(i,j,k) c enddo c enddo c enddo #undef U #undef V #undef W #undef P #undef RHO #undef RHOE #undef DU #undef DV #undef DW #undef DP #undef DRHO #undef DRHOE #if(NADV>0) #undef DADV #endif end subroutine FORT_ZTRACE( & BL_FARG(q), & BL_FARG(qz), & BL_FARG(c), & BL_FARG(enth), & BL_FARG(qbarl), & BL_FARG(qbarr), & BL_FARG(dloga), & BL_FARG(courno), & BL_BARG(bx), & delta, dt, bc, gBndry, nvar & ) integer nvar, gBndry(0:2*SDIM-1) integer bc(SDIM,2,nvar-1),qbc(SDIM,2,NQ) REAL_T delta(SDIM), dt BL_FBOUNDS(q) BL_FARRAY(q,nvar) BL_FBOUNDS(qz) BL_FARRAY(qz,nvar) BL_FBOUNDS(qbarl) BL_FARRAY(qbarl,nvar) BL_FBOUNDS(qbarr) BL_FARRAY(qbarr,nvar) BL_FBOUNDS(c) BL_FARRAY1(c) BL_FBOUNDS(enth) BL_FARRAY1(enth) BL_FBOUNDS(dloga) BL_FARRAY1(dloga) BL_FBOUNDS(courno) BL_FARRAY1(courno) BL_BBOUNDS(bx) integer i, j,k, n, nbc integer is,ie,js,je,ks,ke,isedg,ieedg,jsedg,jeedg,ksedg,keedg REAL_T dx, dy,dz REAL_T spvol, dtbydx, scr, eken, eta, dthalf REAL_T sourcp, sourcr, source, avgarea REAL_T alpham, alphap, alpha0r, alpha0e REAL_T alpha0v1,alpha0v2 REAL_T spminus, spplus, spzero REAL_T apright, amright REAL_T apleft, amleft REAL_T azrright, azeright, azv1rght,azv2rght REAL_T azrleft, azeleft, azv1left,azv2left REAL_T smallr REAL_T reflect REAL_T gdum,csdum,pdum c ::: some useful macro definitions # define U(i,j,k) q(i,j,k,QVEL1) # define V(i,j,k) q(i,j,k,QVEL2) # define W(i,j,k) q(i,j,k,QVEL3) # define P(i,j,k) q(i,j,k,QPRES) # define RHO(i,j,k) q(i,j,k,QRHO) # define RHOE(i,j,k) q(i,j,k,QRHOE) #if(NADV>0) # define ADV(i,j,k) q(i,j,k,QADV) #endif # define DU(i,j,k) qz(i,j,k,QVEL1) # define DV(i,j,k) qz(i,j,k,QVEL2) # define DW(i,j,k) qz(i,j,k,QVEL3) # define DP(i,j,k) qz(i,j,k,QPRES) # define DRHO(i,j,k) qz(i,j,k,QRHO) # define DRHOE(i,j,k) qz(i,j,k,QRHOE) #if(NADV>0) # define DADV(i,j,k) qz(i,j,k,QADV) #endif dx = delta(1) dy = delta(2) dz = delta(3) is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) ks = bxlo(3) ke = bxhi(3) isedg = qbarl_l1 ieedg = qbarl_h1 jsedg = qbarl_l2 jeedg = qbarl_h2 ksedg = qbarl_l3 keedg = qbarl_h3 smallr = onetominussix dtbydx = dt/dx c ::: convert energy to intensive form for eos call c do k = ks,ke c do j = js,je c do i =is,ie c RHOE(i,j,k) = RHOE(i,j,k)/RHO(i,j,k) c enddo c enddo c enddo c convert energy back to extensive form and compute courant number do k = ks,ke do j = js,je do i =is,ie c RHOE(i,j,k) = RHOE(i,j,k)*RHO(i,j,k) courno(i,j,k) = dtbydx*(c(i,j,k)+abs(W(i,j,k))) enddo enddo enddo c characteristic analysis do k = ksedg,keedg-1 do j = jsedg,jeedg do i = isedg,ieedg enth(i,j,k) = (RHOE(i,j,k)/RHO(i,j,k) + $ P(i,j,k)/RHO(i,j,k))/c(i,j,k)**2 alpham = half*(DP(i,j,k)/(RHO(i,j,k)*c(i,j,k)) - DW(i,j,k))*RHO(i,j,k) $ /c(i,j,k) alphap = half*(DP(i,j,k)/(RHO(i,j,k)*c(i,j,k)) + DW(i,j,k))*RHO(i,j,k) $ /c(i,j,k) alpha0r = DRHO(i,j,k) - DP(i,j,k)/c(i,j,k)**2 alpha0e = DRHOE(i,j,k) - DP(i,j,k)*enth(i,j,k) alpha0v1 = DU(i,j,k) alpha0v2 = DV(i,j,k) c ::: ::::: Top state of edge at bottom spminus = cvmgp(-one,(W(i,j,k) - c(i,j,k))*dtbydx,W(i,j,k) - c(i,j,k)) spplus = cvmgp(-one,(W(i,j,k) + c(i,j,k))*dtbydx,W(i,j,k) + c(i,j,k)) spzero = cvmgp(-one, W(i,j,k) *dtbydx,W(i,j,k) ) apright = half*(-one - spplus )*alphap amright = half*(-one - spminus)*alpham azrright= half*(-one - spzero )*alpha0r azeright= half*(-one - spzero )*alpha0e azv1rght= half*(-one - spzero )*alpha0v1 azv2rght= half*(-one - spzero )*alpha0v2 qbarr(i,j,k,QRHO) = q(i,j,k,QRHO) + apright + amright + azrright qbarr(i,j,k,QRHO) = max(smallr, qbarr(i,j,k,QRHO)) qbarr(i,j,k,QVEL3) = q(i,j,k,QVEL3) + $ (apright - amright)*c(i,j,k)/RHO(i,j,k) qbarr(i,j,k,QVEL1) = q(i,j,k,QVEL1) + azv1rght qbarr(i,j,k,QVEL2) = q(i,j,k,QVEL2) + azv2rght qbarr(i,j,k,QPRES) = q(i,j,k,QPRES) + $ (apright + amright)*c(i,j,k)**2 qbarr(i,j,k,QRHOE) = q(i,j,k,QRHOE) + (apright + $ amright)*enth(i,j,k)*c(i,j,k)**2 + azeright #if(NADV>0) qbarr(i,j,k,QADV) = q(i,j,k,QADV)+half*(-one-spzero)*DADV(i,j,k) #endif c ::: ::::: Bottom state of edge at top spminus = cvmgp((W(i,j,k) - c(i,j,k))*dtbydx,one,W(i,j,k) - c(i,j,k)) spplus = cvmgp((W(i,j,k) + c(i,j,k))*dtbydx,one,W(i,j,k) + c(i,j,k)) spzero = cvmgp( W(i,j,k) *dtbydx,one,W(i,j,k) ) apleft = half*(one - spplus )*alphap amleft = half*(one - spminus)*alpham azrleft= half*(one - spzero )*alpha0r azeleft= half*(one - spzero )*alpha0e azv1left= half*(one - spzero )*alpha0v1 azv2left= half*(one - spzero )*alpha0v2 qbarl(i,j,k+1,QRHO) = q(i,j,k,QRHO) + apleft + amleft + azrleft qbarl(i,j,k+1,QRHO) = max(smallr, qbarl(i,j,k+1,QRHO)) qbarl(i,j,k+1,QVEL3) = q(i,j,k,QVEL3) + $ (apleft - amleft)*c(i,j,k)/RHO(i,j,k) qbarl(i,j,k+1,QVEL1) = q(i,j,k,QVEL1) + azv1left qbarl(i,j,k+1,QVEL2) = q(i,j,k,QVEL2) + azv2left qbarl(i,j,k+1,QPRES) = q(i,j,k,QPRES) + $ (apleft + amleft)*c(i,j,k)**2 qbarl(i,j,k+1,QRHOE) = q(i,j,k,QRHOE) + (apleft + amleft)* $ enth(i,j,k)*c(i,j,k)**2 + azeleft #if(NADV>0) qbarl(i,j,k+1,QADV) = q(i,j,k,QADV)+half*(one-spzero)*DADV(i,j,k) #endif enddo enddo enddo c ::: Colella hack near R=0 singularity do k = ks,ke do j = js,je do i = is,ie if (dloga(i,j,k) .ne. zero) then eta = (one-courno(i,j,k))/(c(i,j,k)*dt*dloga(i,j,k)) eta = min(one, eta) dloga(i,j,k) = dloga(i,j,k) * eta endif enddo enddo enddo dthalf = half*dt c ::: add geometric source terms to traced states do k = ksedg,keedg-1 do j = jsedg,jeedg do i = isedg,ieedg sourcr = -RHO(i,j,k)*dloga(i,j,k)*W(i,j,k)*dthalf sourcp = sourcr*c(i,j,k)**2 source = sourcp*enth(i,j,k) qbarl(i,j,k+1,QRHO) = qbarl(i,j,k+1,QRHO) + sourcr qbarl(i,j,k+1,QRHO) = max(smallr, qbarl(i,j,k+1,QRHO)) qbarl(i,j,k+1,QPRES) = qbarl(i,j,k+1,QPRES) + sourcp qbarl(i,j,k+1,QRHOE) = qbarl(i,j,k+1,QRHOE) + source qbarr(i,j,k ,QRHO) = qbarr(i,j,k ,QRHO) + sourcr qbarr(i,j,k ,QRHO) = max(smallr, qbarr(i,j,k,QRHO)) qbarr(i,j,k ,QPRES) = qbarr(i,j,k ,QPRES) + sourcp qbarr(i,j,k ,QRHOE) = qbarr(i,j,k ,QRHOE) + source enddo enddo enddo c ::: convert energy back to intensive form c ::: for eos call in RIEMANN c do k = ks,ke c do j = js,je c do i =is,ie c RHOE(i,j,k) = RHOE(i,j,k)/RHO(i,j,k) c enddo c enddo c enddo #undef U #undef V #undef W #undef P #undef RHO #undef RHOE #undef DU #undef DV #undef DW #undef DP #undef DRHO #undef DRHOE #if(NADV>0) #undef DADV #endif end #define SRHO 1 #define SXMOM 2 #define SYMOM 3 #define SZMOM 4 #define SRHOE 5 #if(NADV>0) #define SADV 6 #endif subroutine RIEMANN( & BL_FARG(qbarm), & BL_FARG(qbarp), & BL_FARG(flux), & BL_FARG(rho), & BL_FARG(e), & BL_FARG(adv), & BL_FARG(c), & BL_FARG(csml), & BL_FARG(gamc), & BL_FARG(rgdnv), & BL_FARG(ugdnv), & BL_FARG(pgdnv), & BL_FARG(egdnv), & BL_FARG(utgdnv), #if(NADV>0) & BL_FARG(advgdnv), #endif & BL_FARG(ustar), & BL_BARG(bx), & sweep, npvar, nsvar) integer sweep, npvar, nsvar BL_FBOUNDS(qbarm) BL_FARRAY(qbarm,npvar) BL_FBOUNDS(qbarp) BL_FARRAY(qbarp,npvar) BL_FBOUNDS(c) BL_FARRAY1(c) BL_FBOUNDS(rho) BL_FARRAY1(rho) BL_FBOUNDS(e) BL_FARRAY1(e) BL_FBOUNDS(adv) BL_FARRAY1(adv) BL_FBOUNDS(csml) BL_FARRAY1(csml) BL_FBOUNDS(gamc) BL_FARRAY1(gamc) BL_FBOUNDS(rgdnv) BL_FARRAY1(rgdnv) BL_FBOUNDS(ugdnv) BL_FARRAY1(ugdnv) BL_FBOUNDS(pgdnv) BL_FARRAY1(pgdnv) BL_FBOUNDS(egdnv) BL_FARRAY1(egdnv) BL_FBOUNDS(utgdnv) BL_FARRAY(utgdnv,2) BL_FBOUNDS(advgdnv) BL_FARRAY1(advgdnv) BL_FBOUNDS(ustar) BL_FARRAY1(ustar) BL_FBOUNDS(flux) BL_FARRAY(flux,nsvar) BL_BBOUNDS(bx) REAL_T wl, wr, cav, pstar REAL_T ro, uo, po, eo, gamco, co, entho REAL_T rstar, estar, cstar REAL_T sgnm, spin, spout, ushock, frac, divuvs REAL_T scr REAL_T csmall, wsmall, smallr, small REAL_T gam_tmp, pdum, c_tmp, csml_tmp integer qvnrml, qvtrns1, qvtrns2 integer is,ie,js,je,ks,ke, i,j,k integer lo(3), hi(3) if(sweep.eq.0)then c ::: x-direction qvnrml = QVEL1 qvtrns1 = QVEL2 qvtrns2 = QVEL3 elseif(sweep.eq.1)then c ::: y-direction qvnrml = QVEL2 qvtrns1 = QVEL1 qvtrns2 = QVEL3 elseif(sweep.eq.2)then c ::: z-direction qvnrml = QVEL3 qvtrns1 = QVEL1 qvtrns2 = QVEL2 else print *,'Abort: Bogus sweep value passed to RIEMANN' stop endif smallr = onetominussix small = onetominussix is = flux_l1 ie = flux_h1 js = flux_l2 je = flux_h2 ks = flux_l3 ke = flux_h3 do k = ks,ke do j = js,je do i = is,ie if(sweep.eq.0)then csmall = max(csml(i-1,j,k),csml(i,j,k)) cav = half*(c(i,j,k) + c(i-1,j,k)) wsmall = smallr*csmall wl = max(wsmall,sqrt(abs(gamc(i-1,j,k)* $ qbarm(i,j,k,QPRES)*qbarm(i,j,k,QRHO)))) elseif(sweep.eq.1)then csmall = max(csml(i,j-1,k),csml(i,j,k)) cav = half*(c(i,j,k) + c(i,j-1,k)) wsmall = smallr*csmall wl = max(wsmall,sqrt(abs(gamc(i,j-1,k)* $ qbarm(i,j,k,QPRES)*qbarm(i,j,k,QRHO)))) elseif(sweep.eq.2)then csmall = max(csml(i,j,k-1),csml(i,j,k)) cav = half*(c(i,j,k) + c(i,j,k-1)) wsmall = smallr*csmall wl = max(wsmall,sqrt(abs(gamc(i,j,k-1)* $ qbarm(i,j,k,QPRES)*qbarm(i,j,k,QRHO)))) else print *,'Abort: Bogus sweep value passed to RIEMANN' stop endif wr = max(wsmall,sqrt(abs(gamc(i,j,k )*qbarp(i,j,k,QPRES)* $ qbarp(i,j,k,QRHO)))) pstar = ((wr*qbarm(i,j,k,QPRES) + wl*qbarp(i,j,k,QPRES)) + wl*wr* $ (qbarm(i,j,k,qvnrml) - qbarp(i,j,k,qvnrml)))/(wl + wr) ustar(i,j,k) = ((wl*qbarm(i,j,k,qvnrml) + wr*qbarp(i,j,k,qvnrml)) + $ (qbarm(i,j,k,QPRES) - qbarp(i,j,k,QPRES)))/(wl + wr) ro = cvmgp(qbarm(i,j,k,QRHO),qbarp(i,j,k,QRHO),ustar(i,j,k)) uo = cvmgp(qbarm(i,j,k,qvnrml),qbarp(i,j,k,qvnrml),ustar(i,j,k)) po = cvmgp(qbarm(i,j,k,QPRES),qbarp(i,j,k,QPRES),ustar(i,j,k)) eo = cvmgp(qbarm(i,j,k,QRHOE),qbarp(i,j,k,QRHOE),ustar(i,j,k)) if(sweep.eq.0)then gamco = cvmgp(gamc(i-1,j,k),gamc(i,j,k),ustar(i,j,k)) elseif(sweep.eq.1)then gamco = cvmgp(gamc(i,j-1,k),gamc(i,j,k),ustar(i,j,k)) else gamco = cvmgp(gamc(i,j,k-1),gamc(i,j,k),ustar(i,j,k)) endif co = max(csmall,sqrt(abs(gamco*po/ro))) entho = (eo/ro + po/ro)/co**2 rstar = ro + (pstar - po)/co**2 rstar = max(rstar,smallr) estar = eo + (pstar - po)*entho cstar = max(csmall,sqrt(abs(gamco*pstar/rstar))) sgnm = sign(one,ustar(i,j,k)) spout = co - sgnm*uo spin = cstar - sgnm*ustar(i,j,k) ushock = half*(spin + spout) spin = cvmgp(ushock,spin,pstar - po) spout = cvmgp(ushock,spout,pstar - po) scr = cvmgz(small*cav,spout - spin,spout - spin) frac = (one + (spout + spin)/scr)*half frac = max(zero,min(one,frac)) utgdnv(i,j,k,1) = cvmgp(qbarm(i,j,k,qvtrns1), & qbarp(i,j,k,qvtrns1),ustar(i,j,k)) utgdnv(i,j,k,2) = cvmgp(qbarm(i,j,k,qvtrns2), & qbarp(i,j,k,qvtrns2),ustar(i,j,k)) #if(NADV>0) advgdnv(i,j,k) = cvmgp(qbarm(i,j,k,QADV),qbarp(i,j,k,QADV), & ustar(i,j,k)) #endif rgdnv(i,j,k) = frac*rstar + (one - frac)*ro ugdnv(i,j,k) = frac*ustar(i,j,k) + (one - frac)*uo pgdnv(i,j,k) = frac*pstar + (one - frac)*po egdnv(i,j,k) = frac*estar + (one - frac)*eo rgdnv(i,j,k) = cvmgp(rgdnv(i,j,k),ro,spout) ugdnv(i,j,k) = cvmgp(ugdnv(i,j,k),uo,spout) pgdnv(i,j,k) = cvmgp(pgdnv(i,j,k),po,spout) egdnv(i,j,k) = cvmgp(egdnv(i,j,k),eo,spout) rgdnv(i,j,k) = cvmgp(rstar,rgdnv(i,j,k),spin) ugdnv(i,j,k) = cvmgp(ustar(i,j,k),ugdnv(i,j,k),spin) pgdnv(i,j,k) = cvmgp(pstar,pgdnv(i,j,k),spin) egdnv(i,j,k) = cvmgp(estar,egdnv(i,j,k),spin) enddo enddo enddo c ::: ::::: compute fluxes do k = ks,ke do j = js,je do i = is,ie flux(i,j,k,SRHO) = ugdnv(i,j,k)*rgdnv(i,j,k) flux(i,j,k,qvnrml) = ugdnv(i,j,k)*flux(i,j,k,SRHO) flux(i,j,k,qvtrns1) = utgdnv(i,j,k,1)*flux(i,j,k,SRHO) flux(i,j,k,qvtrns2) = utgdnv(i,j,k,2)*flux(i,j,k,SRHO) flux(i,j,k,SRHOE) = flux(i,j,k,SRHO)* $ (half*(ugdnv(i,j,k)**2+utgdnv(i,j,k,1)**2+utgdnv(i,j,k,2)**2) $ +egdnv(i,j,k)/rgdnv(i,j,k)) + ugdnv(i,j,k)*pgdnv(i,j,k) #if(NADV>0) flux(i,j,k,SADV) = flux(i,j,k,SRHO)*advgdnv(i,j,k) #endif enddo enddo enddo end subroutine FORT_COPYSTATE( & BL_FARG(state), & BL_FARG(gstate), & BL_BARG(bx), & nvar) integer nvar BL_FBOUNDS(state) BL_FARRAY(state,nvar) BL_FBOUNDS(gstate) BL_FARRAY(gstate,nvar) BL_BBOUNDS(bx) integer i, j, k, n integer is, ie, js, je, ks, ke is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) ks = bxlo(3) ke = bxhi(3) do n = 1,nvar do k = ks, ke do j = js, je do i = is, ie gstate(i,j,k,n) = state(i,j,k,n) enddo enddo enddo enddo end c c --------------------------------------------------------------- c Node-based divergence for artificial viscosity calculation c --------------------------------------------------------------- c subroutine FORT_DIVUNODE ( & BL_FARG(state), & BL_FARG(div), & delta, nvar, gbndry) integer nvar, gbndry(0:2*SDIM-1) REAL_T delta(SDIM) BL_FBOUNDS(state) BL_FARRAY(state,nvar) BL_FBOUNDS(div) BL_FARRAY1(div) integer i,j,k, is, js, ks, ie, je, ke REAL_T ux,vy,wz REAL_T uijk,uimjk,uijmk,uimjmk,uijkm,uimjkm,uijmkm,uimjmkm REAL_T vijk,vijmk,vimjk,vimjmk,vijkm,vijmkm,vimjkm,vimjmkm REAL_T wijk,wijkm,wimjk,wimjkm,wimjmk,wimjmkm,wijmk,wijmkm REAL_T quarter is = div_l1 ie = div_h1 js = div_l2 je = div_h2 ks = div_l3 ke = div_h3 quarter = 0.25 do k = div_l3, div_h3 do j = div_l2, div_h2 do i = div_l1, div_h1 uijk = state(i,j,k,2)/state(i,j,k,1) uimjk = state(i-1,j,k,2)/state(i-1,j,k,1) uijmk = state(i,j-1,k,2)/state(i,j-1,k,1) uimjmk = state(i-1,j-1,k,2)/state(i-1,j-1,k,1) uijkm = state(i,j,k-1,2)/state(i,j,k-1,1) uimjkm = state(i-1,j,k-1,2)/state(i-1,j,k-1,1) uijmkm = state(i,j-1,k-1,2)/state(i,j-1,k-1,1) uimjmkm = state(i-1,j-1,k-1,2)/state(i-1,j-1,k-1,1) vijk = state(i,j,k,3)/state(i,j,k,1) vimjk = state(i-1,j,k,3)/state(i-1,j,k,1) vijmk = state(i,j-1,k,3)/state(i,j-1,k,1) vimjmk = state(i-1,j-1,k,3)/state(i-1,j-1,k,1) vijkm = state(i,j,k-1,3)/state(i,j,k-1,1) vimjkm = state(i-1,j,k-1,3)/state(i-1,j,k-1,1) vijmkm = state(i,j-1,k-1,3)/state(i,j-1,k-1,1) vimjmkm = state(i-1,j-1,k-1,3)/state(i-1,j-1,k-1,1) wijk = state(i,j,k,4)/state(i,j,k,1) wimjk = state(i-1,j,k,4)/state(i-1,j,k,1) wijmk = state(i,j-1,k,4)/state(i,j-1,k,1) wimjmk = state(i-1,j-1,k,4)/state(i-1,j-1,k,1) wijkm = state(i,j,k-1,4)/state(i,j,k-1,1) wimjkm = state(i-1,j,k-1,4)/state(i-1,j,k-1,1) wijmkm = state(i,j-1,k-1,4)/state(i,j-1,k-1,1) wimjmkm = state(i-1,j-1,k-1,4)/state(i-1,j-1,k-1,1) ux = quarter*(uijk-uimjk+uijmk-uimjmk+ & uijkm-uimjkm+uijmkm-uimjmkm)/delta(1) vy = quarter*(vijk+vimjk-vijmk-vimjmk+ & vijkm+vimjkm-vijmkm-vimjmkm)/delta(2) wz = quarter*(wijk+wimjk+wijmk+wimjmk- & wijkm-wimjkm-wijmkm-wimjmkm)/delta(3) div(i,j,k) = ux + vy + wz enddo enddo enddo end c c-------------------------------------------------------------- c Conservative update and other final stuff -- x direction c--------------------------------------------------------------- c subroutine FORT_UPDATEX( & BL_FARG(s), & BL_FARG(flux), & BL_FARG(pgdnv), & BL_FARG(div), & BL_FARG(area), & BL_FARG(vol), & BL_BARG(bx), & delta, dt, nv, sweep, bc, gBndry) integer nv, gBndry(0:2*SDIM-1) integer bc(SDIM,2,nv) BL_FBOUNDS(s) BL_FARRAY(s,nv) BL_FBOUNDS(flux) BL_FARRAY(flux,nv) BL_FBOUNDS(pgdnv) BL_FARRAY1(pgdnv) BL_FBOUNDS(div) BL_FARRAY1(div) BL_FBOUNDS(area) BL_FARRAY1(area) BL_FBOUNDS(vol) BL_FARRAY1(vol) BL_BBOUNDS(bx) REAL_T dt REAL_T delta(SDIM) integer sweep, vnrml integer is, ie, js, je,ks,ke, i, j,k, iv, ivbc integer isflx, ieflx, jsflx, jeflx, ksflx,keflx REAL_T dx, dy,dz,trandiv, divuvs, difmag REAL_T avgarea REAL_T leftbc, rightbc REAL_T trandiv1, trandiv1p, trandivy, trandivz data difmag / tenth / is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) ks = bxlo(3) ke = bxhi(3) isflx = flux_l1 ieflx = flux_h1 jsflx = flux_l2 jeflx = flux_h2 ksflx = flux_l3 keflx = flux_h3 dx = delta(1) dy = delta(2) dz = delta(3) if(sweep.eq.0)then vnrml = 2 else print *,'Abort: bogus sweep value in UPDATEX' stop endif c c ::: add artifical viscosity and convert to extensive quantities c do iv = 1, nv do k = ksflx,keflx do j = jsflx,jeflx do i = isflx, ieflx trandiv = fourth*(div(i,j,k) + div(i,j+1,k) & +div(i,j,k+1) + div(i,j+1,k+1)) divuvs = difmag*dx*trandiv divuvs = min(zero,divuvs) flux(i,j,k, iv)= flux(i,j,k, iv) + $ divuvs*(s(i,j,k, iv) - s(i-1,j,k,iv)) flux(i,j,k,iv) = flux(i,j,k,iv)*dt*area(i,j,k) enddo enddo enddo enddo c c ::: conservative update c do iv = 1, nv do k = ks, ke do j = js, je do i = is, ie s(i,j,k,iv) = s(i,j,k,iv) + $ (flux(i,j,k,iv) - flux(i+1,j,k,iv))/vol(i,j,k) enddo enddo enddo enddo c c ::: add pressure term to normal momnentum c do k = ks, ke do j = js, je do i = is, ie avgarea = half*(area(i,j,k) + area(i+1,j,k)) s(i,j,k,vnrml) = s(i,j,k,vnrml) + dt*avgarea* $ (pgdnv(i,j,k) - pgdnv(i+1,j,k))/vol(i,j,k) enddo enddo enddo c c ::: add pressure term to normal momnentum flux c do k = ksflx,keflx do j = jsflx,jeflx do i = isflx,ieflx flux(i,j,k,vnrml) = flux(i,j,k,vnrml) + dt*area(i,j,k)*pgdnv(i,j,k) enddo enddo enddo end c c-------------------------------------------------------------- c Conservative update and other final stuff -- y direction c--------------------------------------------------------------- c subroutine FORT_UPDATEY( & BL_FARG(s), & BL_FARG(flux), & BL_FARG(pgdnv), & BL_FARG(div), & BL_FARG(area), & BL_FARG(vol), & BL_BARG(bx), & delta, dt, nv, sweep, bc, gBndry) integer nv, gBndry(0:2*SDIM-1) integer bc(SDIM,2,nv) BL_FBOUNDS(s) BL_FARRAY(s,nv) BL_FBOUNDS(flux) BL_FARRAY(flux,nv) BL_FBOUNDS(pgdnv) BL_FARRAY1(pgdnv) BL_FBOUNDS(div) BL_FARRAY1(div) BL_FBOUNDS(area) BL_FARRAY1(area) BL_FBOUNDS(vol) BL_FARRAY1(vol) BL_BBOUNDS(bx) REAL_T dt REAL_T delta(SDIM) integer vnrml,sweep integer is, ie, js, je,ks,ke, i, j,k, iv, ivbc integer isflx, ieflx, jsflx, jeflx, ksflx, keflx REAL_T dx, dy,dz,trandiv, divuvs, difmag REAL_T avgarea REAL_T botbc, topbc REAL_T trandiv1, trandiv1p, trandivy, trandivz data difmag / tenth / if(sweep.eq.1)then vnrml = 3 else print *,'Abort: bogus sweep value in UPDATEY' stop endif is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) ks = bxlo(3) ke = bxhi(3) isflx = flux_l1 ieflx = flux_h1 jsflx = flux_l2 jeflx = flux_h2 ksflx = flux_l3 keflx = flux_h3 dx = delta(1) dy = delta(2) dz = delta(3) c c ::: add artifical viscosity and convert to extensive quantities c do iv = 1, nv do k = ksflx,keflx do j = jsflx,jeflx do i = isflx,ieflx trandiv = fourth*(div(i,j,k) + div(i+1,j,k) & +div(i,j,k+1) + div(i+1,j,k+1)) divuvs = difmag*dy*trandiv divuvs = min(zero,divuvs) flux(i,j,k, iv)= flux(i,j,k, iv) + $ divuvs*(s(i,j,k, iv) - s(i,j-1,k,iv)) flux(i,j,k,iv) = flux(i,j,k,iv)*dt*area(i,j,k) enddo enddo enddo enddo c c ::: conservsative update c do iv = 1, nv do k = ks, ke do j = js, je do i = is, ie s(i,j,k,iv) = s(i,j,k,iv) + $ (flux(i,j,k,iv) - flux(i,j+1,k,iv))/vol(i,j,k) enddo enddo enddo enddo c c ::: add pressure term to normal momnentum c do k = ks, ke do j = js, je do i = is, ie avgarea = half*(area(i,j,k) + area(i,j+1,k)) s(i,j,k,vnrml) = s(i,j,k,vnrml) + dt*avgarea* $ (pgdnv(i,j,k) - pgdnv(i,j+1,k))/vol(i,j,k) enddo enddo enddo c c ::: add pressure term to normal momnentum flux c do k = ksflx, keflx do j = jsflx, jeflx do i = isflx, ieflx flux(i,j,k,vnrml) = flux(i,j,k,vnrml) + dt*area(i,j,k)*pgdnv(i,j,k) enddo enddo enddo end c c-------------------------------------------------------------- c Conservative update and other final stuff -- z direction c--------------------------------------------------------------- c subroutine FORT_UPDATEZ( & BL_FARG(s), & BL_FARG(flux), & BL_FARG(pgdnv), & BL_FARG(div), & BL_FARG(area), & BL_FARG(vol), & BL_BARG(bx), & delta, dt, nv, sweep, bc, gBndry) integer nv, gBndry(0:2*SDIM-1) integer bc(SDIM,2,nv) BL_FBOUNDS(s) BL_FARRAY(s,nv) BL_FBOUNDS(flux) BL_FARRAY(flux,nv) BL_FBOUNDS(pgdnv) BL_FARRAY1(pgdnv) BL_FBOUNDS(div) BL_FARRAY1(div) BL_FBOUNDS(area) BL_FARRAY1(area) BL_FBOUNDS(vol) BL_FARRAY1(vol) BL_BBOUNDS(bx) REAL_T dt REAL_T delta(SDIM) integer vnrml,sweep integer is, ie, js, je, ks,ke,i, j, k,iv, ivbc integer isflx, ieflx, jsflx, jeflx,ksflx,keflx REAL_T dx, dy,dz,trandiv, divuvs, difmag REAL_T avgarea REAL_T botbc, topbc REAL_T trandiv1, trandiv1p, trandivy, trandivz data difmag / tenth / if(sweep.eq.2)then vnrml = 4 else print *,'Abort: bogus sweep value in UPDATEZ' stop endif is = bxlo(1) ie = bxhi(1) js = bxlo(2) je = bxhi(2) ks = bxlo(3) ke = bxhi(3) isflx = flux_l1 ieflx = flux_h1 jsflx = flux_l2 jeflx = flux_h2 ksflx = flux_l3 keflx = flux_h3 dx = delta(1) dy = delta(2) dz = delta(3) c c ::: add artifical viscosity and convert to extensive quantities c do iv = 1, nv do k = ksflx,keflx do j = jsflx,jeflx do i = isflx,ieflx trandiv = fourth*(div(i,j,k) + div(i,j+1,k) & +div(i+1,j,k) + div(i+1,j+1,k)) divuvs = difmag*dz*trandiv divuvs = min(zero,divuvs) flux(i,j,k, iv)= flux(i,j,k, iv) + $ divuvs*(s(i,j,k, iv) - s(i,j,k-1,iv)) flux(i,j,k,iv) = flux(i,j,k,iv)*dt*area(i,j,k) enddo enddo enddo enddo c c ::: conservsative update c do iv = 1, nv do k = ks, ke do j = js, je do i = is, ie s(i,j,k,iv) = s(i,j,k,iv) + $ (flux(i,j,k,iv) - flux(i,j,k+1,iv))/vol(i,j,k) enddo enddo enddo enddo c c ::: add pressure term to normal momnentum c do k = ks, ke do j = js, je do i = is, ie avgarea = half*(area(i,j,k) + area(i,j,k+1)) s(i,j,k,vnrml) = s(i,j,k,vnrml) + dt*avgarea* $ (pgdnv(i,j,k) - pgdnv(i,j,k+1))/vol(i,j,k) enddo enddo enddo c c ::: add pressure term to normal momnentum flux c do k = ksflx, keflx do j = jsflx, jeflx do i = isflx, ieflx flux(i,j,k,vnrml) = flux(i,j,k,vnrml) + dt*area(i,j,k)*pgdnv(i,j,k) enddo enddo enddo end subroutine FORT_PRIMITIVES( & BL_FARG(s), & BL_FARG(q), & BL_FARG(p), & BL_FARG(c), & BL_FARG(csml), & BL_FARG(gamc), & BL_BARG(bx), & bc, ns, nq, sweep) integer ns, nq, sweep integer bc(SDIM,2,ns) BL_FBOUNDS(s) BL_FBOUNDS(q) BL_FBOUNDS(p) BL_FBOUNDS(c) BL_FBOUNDS(csml) BL_FBOUNDS(gamc) BL_BBOUNDS(bx) BL_FARRAY(s,ns) BL_FARRAY(q,nq) BL_FARRAY1(p) BL_FARRAY1(c) BL_FARRAY1(csml) BL_FARRAY1(gamc) integer is,ie,js,je,ks,ke,i,j,k REAL_T u,v,w,rho,e REAL_T gdum,cdum,csdum, reflect #include "xxmeth.fh" is = bxlo(1) js = bxlo(2) ks = bxlo(3) ie = bxhi(1) je = bxhi(2) ke = bxhi(3) do k = ks, ke do j = js, je do i = is, ie rho = max(s(i,j,k,SRHO),smallr) u = s(i,j,k,SXMOM)/s(i,j,k,SRHO) v = s(i,j,k,SYMOM)/s(i,j,k,SRHO) w = s(i,j,k,SZMOM)/s(i,j,k,SRHO) e = s(i,j,k,SRHOE)/rho - half*(u**2 + v**2 + w**2) q(i,j,k,QRHO) = rho q(i,j,k,QVEL1) = u q(i,j,k,QVEL2) = v q(i,j,k,QVEL3) = w q(i,j,k,QRHOE) = e #if(NADV>0) q(i,j,k,QADV) = S(i,j,k,SADV)/s(i,j,k,SRHO) #endif enddo enddo enddo call eos(q(BL_ARGL1(q),BL_ARGL2(q),BL_ARGL3(q),QRHO), $ q(BL_ARGL1(q),BL_ARGL2(q),BL_ARGL3(q),QRHOE), $ q(BL_ARGL1(q),BL_ARGL2(q),BL_ARGL3(q),QADV), $ BL_IARG(q), $ gamc(BL_ARGL1(c),BL_ARGL2(c),BL_ARGL3(c)), $ q(BL_ARGL1(c),BL_ARGL2(c),BL_ARGL3(c),QPRES), $ c(BL_ARGL1(c),BL_ARGL2(c),BL_ARGL3(c)), $ csml(BL_ARGL1(c),BL_ARGL2(c),BL_ARGL3(c)), $ BL_IARG(c), $ bxlo,bxhi,1,1,1,1) do k = ks, ke do j = js, je do i = is, ie q(i,j,k,QPRES) = max(smallp,q(i,j,k,QPRES)) p(i,j,k) = q(i,j,k,QPRES) q(i,j,k,QRHOE) = q(i,j,k,QRHOE)*q(i,j,k,QRHO) c c(i,j,k) = sqrt(gamc(i,j,k)*q(i,j,k,QPRES)/q(i,j,k,QRHO)) c csml(i,j,k) = max(small,small*c(i,j,k)) enddo enddo enddo end subroutine FORT_FLATENX(BL_FARG(q),BL_FARG(flatn), $ BL_FARG(dp), BL_FARG(z), BL_FARG(chi), $ BL_FARG(p), BL_FARG(c),nv) integer nv BL_FBOUNDS(q) BL_FBOUNDS(flatn) BL_FBOUNDS(dp) BL_FBOUNDS(z) BL_FBOUNDS(chi) BL_FBOUNDS(p) BL_FBOUNDS(c) BL_FARRAY(q,nv) BL_FARRAY1(flatn) BL_FARRAY1(dp) BL_FARRAY1(z) BL_FARRAY1(chi) BL_FARRAY1(p) BL_FARRAY1(c) integer is,js,ks,ie,je,ke, i,j,k REAL_T shktst, zcut1, zcut2, dzcut REAL_T denom, zeta, tst, tmp #include "xxmeth.fh" c ::: ::::: knobs for detection of strong shock #ifdef BL_USE_FLOAT_CONST data shktst /0.33/ data zcut1 /0.75/ data zcut2 /0.85/ #endif #ifdef BL_USE_DOUBLE_CONST data shktst /0.33d0/ data zcut1 /0.75d0/ data zcut2 /0.85d0/ #endif dzcut = one/(zcut2-zcut1) is = q_l1 ie = q_h1 js = q_l2 je = q_h2 ks = q_l3 ke = q_h3 if(iorder .eq. 3) then return else c c this is a hack. need to compute the pressure from the state in c a general way. c #if 0 do i = is,ie do j = js,je do k = ks,ke p(i,j,k) = q(i,j,k,QPRES) c(i,j,k) = sqrt(onepointfour*p(i,j,k)/q(i,j,k,QRHO)) enddo enddo enddo #endif c c could use z or chi limits equivalently c is = dp_l1 ie = dp_h1 js = dp_l2 je = dp_h2 ks = dp_l3 ke = dp_h3 do k = ks,ke do j = js,je do i = is,ie dp(i,j,k) = p(i+1,j,k)-p(i-1,j,k) denom = max(smallp,abs(p(i+2,j,k)-p(i-2,j,k))) zeta = abs(dp(i,j,k))/denom z(i,j,k) = min(one,max(zero, dzcut*(zeta-zcut1))) tst = cvmgp(one,zero,q(i-1,j,k,QVEL1)-q(i+1,j,k,QVEL1)) tmp = min(q(i+1,j,k,QRHO)*c(i+1,j,k)**2,q(i-1,j,k,QRHO)*c(i-1,j,k)**2) chi(i,j,k) = cvmgt(tst,zero,(abs(dp(i,j,k))/tmp).gt.shktst) enddo enddo enddo is = flatn_l1 ie = flatn_h1 js = flatn_l2 je = flatn_h2 ks = flatn_l3 ke = flatn_h3 do k = ks,ke do j = js,je do i = is,ie flatn(i,j,k) = one-max(chi(i-1,j,k)*z(i-1,j,k), $ chi(i,j,k)*z(i,j,k), $ chi(i+1,j,k)*z(i+1,j,k)) enddo enddo enddo endif end subroutine FORT_FLATENY(BL_FARG(q),BL_FARG(flatn), $ BL_FARG(dp), BL_FARG(z), BL_FARG(chi), $ BL_FARG(p), BL_FARG(c),nv) integer nv BL_FBOUNDS(q) BL_FBOUNDS(flatn) BL_FBOUNDS(dp) BL_FBOUNDS(z) BL_FBOUNDS(chi) BL_FBOUNDS(p) BL_FBOUNDS(c) BL_FARRAY(q,nv) BL_FARRAY1(flatn) BL_FARRAY1(dp) BL_FARRAY1(z) BL_FARRAY1(chi) BL_FARRAY1(p) BL_FARRAY1(c) integer is,js,ks,ie,je,ke, i,j,k REAL_T shktst, zcut1, zcut2, dzcut REAL_T denom, zeta, tst, tmp #include "xxmeth.fh" c ::: ::::: knobs for detection of strong shock #ifdef BL_USE_FLOAT_CONST data shktst /0.33/ data zcut1 /0.75/ data zcut2 /0.85/ #endif #ifdef BL_USE_DOUBLE_CONST data shktst /0.33d0/ data zcut1 /0.75d0/ data zcut2 /0.85d0/ #endif dzcut = one/(zcut2-zcut1) is = q_l1 ie = q_h1 js = q_l2 je = q_h2 ks = q_l3 ke = q_h3 if(iorder .eq. 3) then return else c c this is a hack. need to compute the pressure from the state in c a general way. c #if 0 do i = is,ie do j = js,je do k = ks,ke p(i,j,k) = q(i,j,k,QPRES) c(i,j,k) = sqrt(onepointfour*p(i,j,k)/q(i,j,k,QRHO)) enddo enddo enddo #endif c c could use z or chi limits equivalently c is = dp_l1 ie = dp_h1 js = dp_l2 je = dp_h2 ks = dp_l3 ke = dp_h3 do k = ks,ke do j = js,je do i = is,ie dp(i,j,k) = p(i,j+1,k)-p(i,j-1,k) denom = max(smallp,abs(p(i,j+2,k)-p(i,j-2,k))) zeta = abs(dp(i,j,k))/denom z(i,j,k) = min(one,max(zero, dzcut*(zeta-zcut1))) tst = cvmgp(one,zero,q(i,j-1,k,QVEL2)-q(i,j+1,k,QVEL2)) tmp = min(q(i,j+1,k,QRHO)*c(i,j+1,k)**2,q(i,j-1,k,QRHO)*c(i,j-1,k)**2) chi(i,j,k) = cvmgt(tst,zero,(abs(dp(i,j,k))/tmp).gt.shktst) enddo enddo enddo is = flatn_l1 ie = flatn_h1 js = flatn_l2 je = flatn_h2 ks = flatn_l3 ke = flatn_h3 do k = ks,ke do j = js,je do i = is,ie flatn(i,j,k) = one-max(chi(i,j-1,k)*z(i,j-1,k),chi(i,j,k)*z(i,j,k), $ chi(i,j+1,k)*z(i,j+1,k)) enddo enddo enddo endif end subroutine FORT_FLATENZ(BL_FARG(q),BL_FARG(flatn), $ BL_FARG(dp), BL_FARG(z), BL_FARG(chi), $ BL_FARG(p), BL_FARG(c),nv) integer nv BL_FBOUNDS(q) BL_FBOUNDS(flatn) BL_FBOUNDS(dp) BL_FBOUNDS(z) BL_FBOUNDS(chi) BL_FBOUNDS(p) BL_FBOUNDS(c) BL_FARRAY(q,nv) BL_FARRAY1(flatn) BL_FARRAY1(dp) BL_FARRAY1(z) BL_FARRAY1(chi) BL_FARRAY1(p) BL_FARRAY1(c) integer is,js,ks,ie,je,ke, i,j,k REAL_T shktst, zcut1, zcut2, dzcut REAL_T denom, zeta, tst, tmp #include "xxmeth.fh" c ::: ::::: knobs for detection of strong shock #ifdef BL_USE_FLOAT_CONST data shktst /0.33/ data zcut1 /0.75/ data zcut2 /0.85/ #endif #ifdef BL_USE_DOUBLE_CONST data shktst /0.33d0/ data zcut1 /0.75d0/ data zcut2 /0.85d0/ #endif dzcut = one/(zcut2-zcut1) is = q_l1 ie = q_h1 js = q_l2 je = q_h2 ks = q_l3 ke = q_h3 if(iorder .eq. 3) then return else c c this is a hack. need to compute the pressure from the state in c a general way. c #if 0 do i = is,ie do j = js,je do k = ks,ke p(i,j,k) = q(i,j,k,QPRES) c(i,j,k) = sqrt(onepointfour*p(i,j,k)/q(i,j,k,QRHO)) enddo enddo enddo #endif c c could use z or chi limits equivalently c is = dp_l1 ie = dp_h1 js = dp_l2 je = dp_h2 ks = dp_l3 ke = dp_h3 do k = ks,ke do j = js,je do i = is,ie dp(i,j,k) = p(i,j,k+1)-p(i,j,k-1) denom = max(smallp,abs(p(i,j,k+2)-p(i,j,k-2))) zeta = abs(dp(i,j,k))/denom z(i,j,k) = min(one,max(zero, dzcut*(zeta-zcut1))) tst = cvmgp(one,zero,q(i,j,k-1,QVEL3)-q(i,j,k+1,QVEL3)) tmp = min(q(i,j,k+1,QRHO)*c(i,j,k+1)**2,q(i,j,k-1,QRHO)*c(i,j,k-1)**2) chi(i,j,k) = cvmgt(tst,zero,(abs(dp(i,j,k))/tmp).gt.shktst) enddo enddo enddo is = flatn_l1 ie = flatn_h1 js = flatn_l2 je = flatn_h2 ks = flatn_l3 ke = flatn_h3 do k = ks,ke do j = js,je do i = is,ie flatn(i,j,k) = one-max(chi(i,j,k-1)*z(i,j,k-1),chi(i,j,k)*z(i,j,k), $ chi(i,j,k+1)*z(i,j,k+1)) enddo enddo enddo endif end c c--------------------------------------------------------------- c:: X-slopes for characteristic tracing c:: Arguments: c:: s => primitive variables c:: slx <= slopes c:: bc => bndry condition flags c:: nvar => number of advected quantities. c --------------------------------------------------------------- c subroutine FORT_SLOPEX(BL_FARG(s),BL_FARG(slx),BL_FARG(flatn), $ BL_FARG(scen),BL_FARG(ssgn),BL_FARG(slim),BL_FARG(dsf),nv,gBndry) integer nv,gBndry(0:2*SDIM-1) BL_FBOUNDS(s) BL_FBOUNDS(slx) BL_FBOUNDS(flatn) BL_FBOUNDS(scen) BL_FBOUNDS(ssgn) BL_FBOUNDS(slim) BL_FBOUNDS(dsf) BL_FARRAY(s,nv) BL_FARRAY(slx,nv) BL_FARRAY1(flatn) BL_FARRAY1(scen) BL_FARRAY1(ssgn) BL_FARRAY1(slim) BL_FARRAY1(dsf) REAL_T dpls,dmin,ds REAL_T del,sflag, dq4 integer is,js,ks,ie,je,ke,i,j,k,iv #include "xxmeth.fh" if(iorder .eq. 1) then return else do 100 iv = 1,nv is = dsf_l1 js = dsf_l2 ks = dsf_l3 ie = dsf_h1 je = dsf_h2 ke = dsf_h3 do k = ks,ke do j = js,je do i = is,ie scen(i,j,k) = (s(i+1,j,k,iv)-s(i-1,j,k,iv)) dpls = (s(i+1,j,k,iv) - s(i ,j,k,iv)) dmin = (s(i ,j,k,iv) - s(i-1,j,k,iv)) ssgn(i,j,k) = sign(one,scen(i,j,k)) slim(i,j,k) = two*min(abs(dpls),abs(dmin)) slim(i,j,k) = cvmgp(slim(i,j,k),zero,dpls*dmin) dsf(i,j,k) = ssgn(i,j,k)*min(half*abs(scen(i,j,k)),slim(i,j,k)) enddo enddo enddo is = slx_l1 js = slx_l2 ks = slx_l3 ie = slx_h1 je = slx_h2 ke = slx_h3 do k = ks,ke do j = js,je do i = is,ie dq4 = two3rd*(scen(i,j,k) - forth*(dsf(i+1,j,k)+dsf(i-1,j,k))) slx(i,j,k,iv) = ssgn(i,j,k)*flatn(i,j,k)*min(abs(dq4),slim(i,j,k)) enddo enddo enddo 100 continue endif end c c--------------------------------------------------------------- c:: Y-slopes for characteristic tracing c:: Arguments: c:: s => primitive variables c:: slx <= slopes c:: bc => bndry condition flags c:: nvar => number of advected quantities. c --------------------------------------------------------------- c subroutine FORT_SLOPEY(BL_FARG(s),BL_FARG(sly),BL_FARG(flatn), $ BL_FARG(scen),BL_FARG(ssgn),BL_FARG(slim),BL_FARG(dsf),nv,gBndry) integer nv,gBndry(0:SDIM*SDIM-1) BL_FBOUNDS(s) BL_FBOUNDS(sly) BL_FBOUNDS(flatn) BL_FBOUNDS(scen) BL_FBOUNDS(ssgn) BL_FBOUNDS(slim) BL_FBOUNDS(dsf) BL_FARRAY(s,nv) BL_FARRAY(sly,nv) BL_FARRAY1(flatn) BL_FARRAY1(scen) BL_FARRAY1(ssgn) BL_FARRAY1(slim) BL_FARRAY1(dsf) REAL_T dpls,dmin,ds REAL_T del,sflag, dq4 integer is,js,ks,ie,je,ke,i,j,k,iv #include "xxmeth.fh" if(iorder .eq. 1) then return else do 100 iv = 1,nv is = dsf_l1 js = dsf_l2 ks = dsf_l3 ie = dsf_h1 je = dsf_h2 ke = dsf_h3 do k = ks,ke do j = js,je do i = is,ie scen(i,j,k) = (s(i,j+1,k,iv)-s(i,j-1,k,iv)) dpls = (s(i,j+1,k,iv) - s(i ,j,k,iv)) dmin = (s(i ,j,k,iv) - s(i,j-1,k,iv)) ssgn(i,j,k) = sign(one,scen(i,j,k)) slim(i,j,k) = two*min(abs(dpls),abs(dmin)) slim(i,j,k) = cvmgp(slim(i,j,k),zero,dpls*dmin) dsf(i,j,k) = ssgn(i,j,k)*min(half*abs(scen(i,j,k)),slim(i,j,k)) enddo enddo enddo is = sly_l1 js = sly_l2 ks = sly_l3 ie = sly_h1 je = sly_h2 ke = sly_h3 do k = ks,ke do j = js,je do i = is,ie dq4 = two3rd*(scen(i,j,k) - forth*(dsf(i,j+1,k)+dsf(i,j-1,k))) sly(i,j,k,iv) = ssgn(i,j,k)*flatn(i,j,k)*min(abs(dq4),slim(i,j,k)) enddo enddo enddo 100 continue endif end c c--------------------------------------------------------------- c:: Z-slopes for characteristic tracing c:: Arguments: c:: s => primitive variables c:: slx <= slopes c:: bc => bndry condition flags c:: nvar => number of advected quantities. c --------------------------------------------------------------- c subroutine FORT_SLOPEZ(BL_FARG(s),BL_FARG(sly),BL_FARG(flatn), $ BL_FARG(scen),BL_FARG(ssgn),BL_FARG(slim),BL_FARG(dsf),nv,gBndry) integer nv,gBndry(0:SDIM*SDIM-1) BL_FBOUNDS(s) BL_FBOUNDS(sly) BL_FBOUNDS(flatn) BL_FBOUNDS(scen) BL_FBOUNDS(ssgn) BL_FBOUNDS(slim) BL_FBOUNDS(dsf) BL_FARRAY(s,nv) BL_FARRAY(sly,nv) BL_FARRAY1(flatn) BL_FARRAY1(scen) BL_FARRAY1(ssgn) BL_FARRAY1(slim) BL_FARRAY1(dsf) REAL_T dpls,dmin,ds REAL_T del,sflag, dq4 integer is,js,ks,ie,je,ke,i,j,k,iv #include "xxmeth.fh" if(iorder .eq. 1) then return else do 100 iv = 1,nv is = dsf_l1 js = dsf_l2 ks = dsf_l3 ie = dsf_h1 je = dsf_h2 ke = dsf_h3 do k = ks,ke do j = js,je do i = is,ie scen(i,j,k) = (s(i,j,k+1,iv)-s(i,j,k-1,iv)) dpls = (s(i,j,k+1,iv) - s(i ,j,k,iv)) dmin = (s(i ,j,k,iv) - s(i,j,k-1,iv)) ssgn(i,j,k) = sign(one,scen(i,j,k)) slim(i,j,k) = two*min(abs(dpls),abs(dmin)) slim(i,j,k) = cvmgp(slim(i,j,k),zero,dpls*dmin) dsf(i,j,k) = ssgn(i,j,k)*min(half*abs(scen(i,j,k)),slim(i,j,k)) enddo enddo enddo is = sly_l1 js = sly_l2 ks = sly_l3 ie = sly_h1 je = sly_h2 ke = sly_h3 do k = ks,ke do j = js,je do i = is,ie dq4 = two3rd*(scen(i,j,k) - forth*(dsf(i,j,k+1)+dsf(i,j,k-1))) sly(i,j,k,iv) = ssgn(i,j,k)*flatn(i,j,k)*min(abs(dq4),slim(i,j,k)) enddo enddo enddo 100 continue endif end c c--------------------------------------------------------------- c:: X-slopes for characteristic tracing c:: Arguments: c:: s => primitive variables c:: slx <= slopes c:: bc => bndry condition flags c:: nvar => number of advected quantities. c --------------------------------------------------------------- c subroutine FORT_SLOPEX2(BL_FARG(s),BL_FARG(slx),nv,gBndry) integer nv,gBndry(0:2*SDIM-1) BL_FBOUNDS(s) BL_FARRAY(s,nv) BL_FBOUNDS(slx) BL_FARRAY(slx,nv) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ks,ie,je,ke,i,j,k,iv is = slx_l1 js = slx_l2 ks = slx_l3 ie = slx_h1 je = slx_h2 ke = slx_h3 do 100 iv = 1,nv do 150 k = ks,ke do 160 j = js,je do 170 i = is,ie del = half*(s(i+1,j,k,iv)-s(i-1,j,k,iv)) dpls = two*(s(i+1,j,k,iv) - s(i ,j,k,iv)) dmin = two*(s(i ,j,k,iv) - s(i-1,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(i,j,k,iv)= sflag*min(slim,abs(del)) 170 continue 160 continue 150 continue 100 continue end c c --------------------------------------------------------------- c:: Y-slopes for characteristic tracing c:: Arguments: c:: s => primitive variables c:: sly <= slopes c:: bc => bndry condition flags c:: nvar => number of advected quantities. c --------------------------------------------------------------- c subroutine FORT_SLOPEY2(BL_FARG(s),BL_FARG(sly),nv,gBndry) integer nv,gBndry(0:2*SDIM-1) BL_FBOUNDS(s) BL_FARRAY(s,nv) BL_FBOUNDS(sly) BL_FARRAY(sly,nv) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ks,ie,je,ke,i,j,k,iv is = sly_l1 js = sly_l2 ks = sly_l3 ie = sly_h1 je = sly_h2 ke = sly_h3 do 150 iv = 1,nv do 170 k = ks,ke do 180 j = js,je do 190 i = is,ie del = half*(s(i,j+1,k,iv)-s(i,j-1,k,iv)) dpls = two*(s(i,j+1,k,iv) - s(i,j,k,iv )) dmin = two*(s(i,j,k,iv ) - s(i,j-1,k,iv)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,j,k,iv)= sflag*min(slim,abs(del)) 190 continue 180 continue 170 continue 150 continue end c c --------------------------------------------------------------- c:: z-slopes for characteristic tracing c:: Arguments: c:: s => primitive variables c:: sly <= slopes c:: bc => bndry condition flags c:: nvar => number of advected quantities. c --------------------------------------------------------------- c subroutine FORT_SLOPEZ2(BL_FARG(s),BL_FARG(slz),nv,gBndry) integer nv,gBndry(0:2*SDIM-1) BL_FBOUNDS(s) BL_FARRAY(s,nv) BL_FBOUNDS(slz) BL_FARRAY(slz,nv) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ks,ie,je,ke,i,j,k,iv is = slz_l1 js = slz_l2 ks = slz_l3 ie = slz_h1 je = slz_h2 ke = slz_h3 do 150 iv = 1,nv do 170 k = ks,ke do 180 j = js,je do 190 i = is,ie del = half*(s(i,j,k+1,iv)-s(i,j,k-1,iv)) dpls = two*(s(i,j,k+1,iv) - s(i,j,k,iv )) dmin = two*(s(i,j,k,iv ) - s(i,j,k-1,iv)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,k,iv)= sflag*min(slim,abs(del)) 190 continue 180 continue 170 continue 150 continue end ccseapps-2.5/CCSEApps/HCAll/bubble/HYPERCLAW_2D.F0000644000175000017500000002432311634153073022033 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ /* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: HYPERCLAW_2D.F,v 1.1 2002/04/11 22:36:43 marc Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "HYPERCLAW_F.H" #include "ArrayLim.H" #define SDIM 2 c :: c :: ---------------------------------------------------------- c :: estimate the timestep for this grid r c :: c :: INPUTS/OUTPUTS c :: state => state array c :: slo,shi => index limits of state array c :: c => c array c :: clo,chi => index limits of c array c :: delta => cell size c :: dt <= timestep estimate c :: c :: ---------------------------------------------------------- c :: #if 1 subroutine FORT_ESTDT (state,DIMS(s),c,DIMS(c),lo,hi,delta,dt,nv) integer nv integer lo(SDIM), hi(SDIM) integer DIMDEC(s) integer DIMDEC(c) REAL_T dt REAL_T delta(SDIM) REAL_T state(DIMV(s),nv) REAL_T c(DIMV(c)) integer i, j, is,ie,js,je REAL_T ux,uy,dt1,dt2,dx,dy REAL_T small,gdum,pdum,csdum is = lo(1) js = lo(2) ie = hi(1) je = hi(2) dx = delta(1) dy = delta(2) dt = bigreal do j = js, je do i = is, ie ux = state(i,j,2)/state(i,j,1) uy = state(i,j,3)/state(i,j,1) state(i,j,4) = state(i,j,4)/state(i,j,1) - $ half*(ux**2 + uy**2) state(i,j,5) = state(i,j,5)/state(i,j,1) end do end do call eos(state(is,js,1),state(is,js,4),state(is,js,5), $ DIMS(s), $ gdum,pdum,c,csdum, $ DIMS(c), $ lo, hi,0,0,1,0) do j = js, je do i = is, ie ux = abs(state(i,j,2))/state(i,j,1) uy = abs(state(i,j,3))/state(i,j,1) dt1 = dx/(c(i,j) + ux) dt2 = dy/(c(i,j) + uy) dt = min(dt,dt1,dt2) end do end do end #else subroutine FORT_ESTDT (state,DIMS(s),c,DIMS(c),lo,hi,delta,dt,nv) integer nv integer lo(SDIM), hi(SDIM) integer DIMDEC(s) integer DIMDEC(c) REAL_T dt REAL_T delta(SDIM) REAL_T state(DIMV(s),nv) REAL_T c(DIMV(c)) integer i, j, is,ie,js,je REAL_T ux,uy,dt1,dt2,dx,dy REAL_T small,gdum,pdum,csdum is = lo(1) js = lo(2) ie = hi(1) je = hi(2) dx = delta(1) dy = delta(2) dt = bigreal do j = js, je do i = is, ie ux = state(i,j,2)/state(i,j,1) uy = state(i,j,3)/state(i,j,1) state(i,j,4) = state(i,j,4)/state(i,j,1) - $ half*(ux**2 + uy**2) end do end do call eos(state(is,js,1),state(is,js,4),gdum,pdum, $ c,csdum,lo,hi,0,0,1,0) do j = js, je do i = is, ie ux = abs(state(i,j,2))/state(i,j,1) uy = abs(state(i,j,3))/state(i,j,1) dt1 = dx/(c(i,j) + ux) dt2 = dy/(c(i,j) + uy) dt = min(dt,dt1,dt2) end do end do end #endif c :: ---------------------------------------------------------- c :: Volume-weight average the fine grid data onto the coarse c :: grid. Overlap is given in coarse grid coordinates. c :: c :: INPUTS / OUTPUTS: c :: crse <= coarse grid data c :: clo,chi => index limits of crse array c :: nvar => number of components in arrays c :: cv => coarse grid volume array c :: cvlo,cvhi => index limits of cv c :: fine => fine grid data c :: flo,fhi => index limits of fine array c :: fv => fine grid volume array c :: fvlo,fvhi => index limits of fv array c :: lo,hi => index limits of overlap (crse grid) c :: lrat => refinement ratio c :: ---------------------------------------------------------- c :: subroutine FORT_AVGDOWN (crse,DIMS(c),nvar,cv,DIMS(cv), & fine,DIMS(f),fv,DIMS(fv),lo,hi,lrat) integer DIMDEC(c) integer DIMDEC(cv) integer DIMDEC(f) integer DIMDEC(fv) integer lo(SDIM), hi(SDIM) integer nvar, lrat REAL_T crse(DIMV(c),nvar) REAL_T cv(DIMV(cv)) REAL_T fine(DIMV(f),nvar) REAL_T fv(DIMV(fv)) integer i, j, n, ic, jc, ioff, joff integer lenx, leny lenx = hi(1)-lo(1)+1 leny = hi(2)-lo(2)+1 if (lenx .ge. leny) then do n = 1, nvar c c ::::: set coarse grid to zero on overlap c do jc = lo(2), hi(2) do ic = lo(1), hi(1) crse(ic,jc,n) = zero end do end do c c ::::: sum fine data c do joff = 0, lrat-1 do jc = lo(2), hi(2) j = jc*lrat + joff do ioff = 0, lrat-1 do ic = lo(1), hi(1) i = ic*lrat + ioff crse(ic,jc,n) = crse(ic,jc,n) + fv(i,j)*fine(i,j,n) end do end do end do end do c c ::::: divide out by volume weight c do jc = lo(2), hi(2) do ic = lo(1), hi(1) crse(ic,jc,n) = crse(ic,jc,n)/cv(ic,jc) end do end do end do else do n = 1, nvar c c ::::: set coarse grid to zero on overlap c do ic = lo(1), hi(1) do jc = lo(2), hi(2) crse(ic,jc,n) = zero end do end do c c ::::: sum fine data c do ioff = 0, lrat-1 do ic = lo(1), hi(1) i = ic*lrat + ioff do joff = 0, lrat-1 do jc = lo(2), hi(2) j = jc*lrat + joff crse(ic,jc,n) = crse(ic,jc,n) + fv(i,j)*fine(i,j,n) end do end do end do end do c c ::::: divide out by volume weight c do ic = lo(1), hi(1) do jc = lo(2), hi(2) crse(ic,jc,n) = crse(ic,jc,n)/cv(ic,jc) end do end do end do end if end c :: ---------------------------------------------------------- c :: SUMMASS c :: MASS = sum{ vol(i,j)*rho(i,j) } c :: c :: INPUTS / OUTPUTS: c :: rho => density field c :: rlo,rhi => index limits of rho aray c :: lo,hi => index limits of grid interior c :: delta => cell size c :: mass <= total mass c :: r => radius at cell center c :: irlo,hi => index limits of r array c :: rz_flag => == 1 if R_Z coords c :: tmp => temp column array c :: ---------------------------------------------------------- c :: subroutine FORT_SUMMASS(rho,DIMS(r),lo,hi,delta,mass, & r,irlo,irhi,rz_flag,tmp,tlo,thi) integer irlo, irhi, rz_flag integer DIMDEC(r) integer lo(2), hi(2) REAL_T mass, delta(2) REAL_T rho(DIMV(r)) REAL_T r(irlo:irhi) integer tlo,thi REAL_T tmp(tlo:thi) integer i, j REAL_T dr, dz, vol dr = delta(1) dz = delta(2) do j = lo(2),hi(2) tmp(j) = zero end do do i = lo(1), hi(1) vol = dr*dz if (rz_flag .eq. 1) vol = vol*two*Pi*r(i) do j = lo(2), hi(2) tmp(j) = tmp(j) + vol*rho(i,j) end do end do mass = zero do j = lo(2), hi(2) mass = mass + tmp(j) end do end ccseapps-2.5/CCSEApps/HCAll/bubble/GODUNOV_F.H0000644000175000017500000002474711634153073021552 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GODUNOV_F_H_ #define _GODUNOV_F_H_ /* ** $Id: GODUNOV_F.H,v 1.5 2002/04/26 22:10:01 lijewski Exp $ */ #define BL_FAA_TYPE(u) Real* u, ARLIM_P(u), ARLIM_P(u) #define BL_BOXARG_TYPE(bx) const int*, const int* #define BL_FAA(u) u.dataPtr(),ARLIM(u.loVect()),ARLIM(u.hiVect()) #define BL_FAAN(u,n) u.dataPtr(n),ARLIM(u.loVect()),ARLIM(u.hiVect()) #define BL_BOXARG(b) b.loVect(), b.hiVect() #include "integrator.fh" #ifdef BL_LANG_FORT # define FORT_XTRACE xtrace # define FORT_YTRACE ytrace # define FORT_DIVF divf # define FORT_COPYSTATE copystate # define FORT_DIVUNODE divunode # define FORT_FLATENX flatenx # define FORT_FLATENY flateny # define FORT_SLOPEX slopex # define FORT_SLOPEY slopey # define FORT_UPDATEX updatex # define FORT_UPDATEY updatey # define FORT_METRICS metrics # define FORT_RIEMANN riemann # define FORT_PRIMITIVES primitives #if(BL_SPACEDIM == 3) # define FORT_FLATENZ flatenz # define FORT_UPDATEZ updatez # define FORT_SLOPEZ slopez # define FORT_ZTRACE ztrace #endif #else # ifdef BL_FORT_USE_UPPERCASE # define FORT_XTRACE XTRACE # define FORT_YTRACE YTRACE # define FORT_DIVF DIVF # define FORT_COPYSTATE COPYSTATE # define FORT_DIVUNODE DIVUNODE # define FORT_FLATENX FLATENX # define FORT_FLATENY FLATENY # define FORT_SLOPEX SLOPEX # define FORT_SLOPEY SLOPEY # define FORT_UPDATEX UPDATEX # define FORT_UPDATEY UPDATEY # define FORT_METRICS METRICS # define FORT_RIEMANN RIEMANN # define FORT_PRIMITIVES PRIMITIVES # if(BL_SPACEDIM == 3) # define FORT_UPDATEZ UPDATEZ # define FORT_SLOPEZ SLOPEZ # define FORT_ZTRACE ZTRACE # define FORT_FLATENZ FLATENZ # endif # else # ifdef BL_FORT_USE_LOWERCASE # define FORT_XTRACE xtrace # define FORT_YTRACE ytrace # define FORT_DIVF divf # define FORT_COPYSTATE copystate # define FORT_DIVUNODE divunode # define FORT_FLATENX flatenx # define FORT_FLATENY flateny # define FORT_SLOPEX slopex # define FORT_SLOPEY slopey # define FORT_UPDATEX updatex # define FORT_UPDATEY updatey # define FORT_METRICS metrics # define FORT_RIEMANN riemann # define FORT_PRIMITIVES primitives # if(BL_SPACEDIM == 3) # define FORT_FLATENZ flatenz # define FORT_UPDATEZ updatez # define FORT_SLOPEZ slopez # define FORT_ZTRACE ztrace # endif # else # define FORT_XTRACE xtrace_ # define FORT_YTRACE ytrace_ # define FORT_DIVF divf_ # define FORT_COPYSTATE copystate_ # define FORT_DIVUNODE divunode_ # define FORT_FLATENX flatenx_ # define FORT_FLATENY flateny_ # define FORT_SLOPEX slopex_ # define FORT_SLOPEY slopey_ # define FORT_UPDATEX updatex_ # define FORT_UPDATEY updatey_ # define FORT_METRICS metrics_ # define FORT_RIEMANN riemann_ # define FORT_PRIMITIVES primitives_ # if(BL_SPACEDIM == 3) # define FORT_FLATENZ flatenz_ # define FORT_UPDATEZ updatez_ # define FORT_SLOPEZ slopez_ # define FORT_ZTRACE ztrace_ # endif # endif # endif extern "C" { void FORT_XTRACE( BL_FAA_TYPE(q), BL_FAA_TYPE(qx), BL_FAA_TYPE(c), BL_FAA_TYPE(enth), BL_FAA_TYPE(qbarl), BL_FAA_TYPE(qbarr), BL_FAA_TYPE(dloga), BL_FAA_TYPE(courno), BL_BOXARG_TYPE(bx), const Real*, Real* ,int*, int*, int* ); void FORT_YTRACE( BL_FAA_TYPE(q), BL_FAA_TYPE(qy), BL_FAA_TYPE(c), BL_FAA_TYPE(enth), BL_FAA_TYPE(qbarb), BL_FAA_TYPE(qbart), BL_FAA_TYPE(dloga), BL_FAA_TYPE(courno), BL_BOXARG_TYPE(bx), const Real*, Real* ,int*, int*, int* ); #if(BL_SPACEDIM==3) void FORT_ZTRACE( BL_FAA_TYPE(q), BL_FAA_TYPE(qz), BL_FAA_TYPE(c), BL_FAA_TYPE(enth), BL_FAA_TYPE(qbarb), BL_FAA_TYPE(qbart), BL_FAA_TYPE(dloga), BL_FAA_TYPE(courno), BL_BOXARG_TYPE(bx), const Real*, Real* ,int*, int*, int* ); #endif void FORT_DIVF( BL_FAA_TYPE(state), BL_FAA_TYPE(div_f), BL_FAA_TYPE(xflux), BL_FAA_TYPE(yflux), BL_BOXARG_TYPE(bx), const Real*,const Real*,int* ); void FORT_COPYSTATE( BL_FAA_TYPE(state), BL_FAA_TYPE(levelState), BL_BOXARG_TYPE(bx), int* ); void FORT_DIVUNODE ( BL_FAA_TYPE(state), BL_FAA_TYPE(divu), const Real*, int*, int*); void FORT_FLATENX ( BL_FAA_TYPE(q), BL_FAA_TYPE(flatnx), BL_FAA_TYPE(dp), BL_FAA_TYPE(z), BL_FAA_TYPE(chi), BL_FAA_TYPE(p), BL_FAA_TYPE(c), int* ); void FORT_FLATENY ( BL_FAA_TYPE(q), BL_FAA_TYPE(flatny), BL_FAA_TYPE(dp), BL_FAA_TYPE(z), BL_FAA_TYPE(chi), BL_FAA_TYPE(p), BL_FAA_TYPE(c), int* ); #if(BL_SPACEDIM==3) void FORT_FLATENZ ( BL_FAA_TYPE(q), BL_FAA_TYPE(flatnz), BL_FAA_TYPE(dp), BL_FAA_TYPE(z), BL_FAA_TYPE(chi), BL_FAA_TYPE(p), BL_FAA_TYPE(c), int* ); #endif void FORT_SLOPEX ( BL_FAA_TYPE(q), BL_FAA_TYPE(qx), BL_FAA_TYPE(flatnx), BL_FAA_TYPE(qcen), BL_FAA_TYPE(qsgn), BL_FAA_TYPE(qlim), BL_FAA_TYPE(dfq), int*, int* ); void FORT_SLOPEY ( BL_FAA_TYPE(q), BL_FAA_TYPE(qy), BL_FAA_TYPE(flatny), BL_FAA_TYPE(qcen), BL_FAA_TYPE(qsgn), BL_FAA_TYPE(qlim), BL_FAA_TYPE(dfq), int*, int* ); #if(BL_SPACEDIM==3) void FORT_SLOPEZ ( BL_FAA_TYPE(q), BL_FAA_TYPE(qz), BL_FAA_TYPE(flatnz), BL_FAA_TYPE(qcen), BL_FAA_TYPE(qsgn), BL_FAA_TYPE(qlim), BL_FAA_TYPE(dfq), int*, int* ); #endif void FORT_METRICS ( BL_FAA_TYPE(vol), BL_FAA_TYPE(dloga), BL_FAA_TYPE(area), BL_BOXARG_TYPE(bx), const Real*, int* ); void FORT_UPDATEX ( BL_FAA_TYPE(state), BL_FAA_TYPE(xflux), BL_FAA_TYPE(pgdnv), BL_FAA_TYPE(divu), BL_FAA_TYPE(area), BL_FAA_TYPE(vol), BL_BOXARG_TYPE(bx), const Real*,const Real*,int*, int*, int*, int* ); void FORT_UPDATEY ( BL_FAA_TYPE(state), BL_FAA_TYPE(yflux), BL_FAA_TYPE(pgdnv), BL_FAA_TYPE(divu), BL_FAA_TYPE(area), BL_FAA_TYPE(vol), BL_BOXARG_TYPE(bx), const Real*,const Real*,int*, int*, int*, int* ); #if(BL_SPACEDIM==3) void FORT_UPDATEZ ( BL_FAA_TYPE(state), BL_FAA_TYPE(zflux), BL_FAA_TYPE(pgdnv), BL_FAA_TYPE(divu), BL_FAA_TYPE(area), BL_FAA_TYPE(vol), BL_BOXARG_TYPE(bx), const Real*,const Real*,int*, int*, int*, int* ); #endif void FORT_RIEMANN ( BL_FAA_TYPE(qbarl), BL_FAA_TYPE(qbarr), BL_FAA_TYPE(xflux), BL_FAA_TYPE(q0), BL_FAA_TYPE(q4), BL_FAA_TYPE(q6), BL_FAA_TYPE(c), BL_FAA_TYPE(csml), BL_FAA_TYPE(gamc), BL_FAA_TYPE(rgdnv), BL_FAA_TYPE(ugdnv), BL_FAA_TYPE(pgdnv), BL_FAA_TYPE(egdnv), BL_FAA_TYPE(utgdnv), #if(NADV>0) BL_FAA_TYPE(advgdnv), #endif BL_FAA_TYPE(ustar), BL_BOXARG_TYPE(bx), int*, int*, int* ); void FORT_PRIMITIVES ( BL_FAA_TYPE(state), BL_FAA_TYPE(q), BL_FAA_TYPE(p), BL_FAA_TYPE(c), BL_FAA_TYPE(csml), BL_FAA_TYPE(gamc), BL_BOXARG_TYPE(bx), int*, int*, int*, int* ); } #endif #endif /*_GODUNOV_F_H_*/ ccseapps-2.5/CCSEApps/HCAll/GNUmakefile0000644000175000017500000001276211634153073020664 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.74 2002/12/10 00:58:32 vince Exp $ # PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) # # Where libraries and include files will be installed. # INSTALL_ROOT = $(TOP) # # Variables settable by users. # PRECISION = DOUBLE PROFILE = TRUE PROFILE = FALSE COMP = mpKCC COMP = KCC COMP = g++ DEBUG = FALSE DEBUG = TRUE DIM = 2 DIM = 3 USE_MPI = TRUE USE_MPI = FALSE USE_ARRAYVIEW = TRUE USE_ARRAYVIEW = FALSE # # Base name of the executable. # EBASE = hyperclaw # # Here's where we decide which of the problems to build. # # PROB_DIR is the name of a subdirectory of the directory # containing this GNUmakefile. It contains the problem-specific # Fortran code for the problem type that you wish to run. # # Currently supported: # # bubble # PROB_DIR = bubble ifeq ($(PROB_DIR), explosion) DEFINES += -DBL_SYNC_RANTABLES endif ifeq ($(PROB_DIR), gravslab) DEFINES += -DBL_ADD_GRAVITY endif #CXXFLAGS += -fprm c -ieee #CXXFLAGS += -ieee #CXXFLAGS += -fprm c include $(TOP)/mk/Make.defs ./Make.package ############################################### arrayview ifeq (USE_ARRAYVIEW, TRUE) DEFINES += -DBL_USE_ARRAYVIEW #ARRAYVIEWDIR = $(VINCEDIR)/ArrayView ARRAYVIEWDIR = . INCLUDE_LOCATIONS += $(ARRAYVIEWDIR) #LIBRARY_LOCATIONS += $(ARRAYVIEWDIR) #LIBRARIES += -larrayview$(DIM)d.$(machineSuffix) endif BUILD_INPLACE := FALSE BUILD_INPLACE := TRUE ifeq ($(BUILD_INPLACE), TRUE) include $(TOP)/amrlib/Make.package include $(TOP)/bndrylib/Make.package include $(TOP)/BoxLib/Make.package INCLUDE_LOCATIONS += ./$(PROB_DIR) INCLUDE_LOCATIONS += . INCLUDE_LOCATIONS += $(TOP)/amrlib INCLUDE_LOCATIONS += $(TOP)/bndrylib INCLUDE_LOCATIONS += $(TOP)/BoxLib INCLUDE_LOCATIONS += $(TOP) else INCLUDE_LOCATIONS += . ./$(PROB_DIR) $(TOP)/include LIBRARY_LOCATIONS += $(TOP)/lib/$(machineSuffix) LIBRARIES += -lamr$(DIM)d -lbndry$(DIM)d -lbox$(DIM)d endif ifeq ($(MACHINE), OSF1) # # Some additional stuff for our preferred development/debugging environment. # ifeq ($(PRECISION), DOUBLE) FFLAGS += -real_size 64 endif FDEBF += -C FDEBF += -warn argument_checking FDEBF += -warn declarations ifneq ($(FC), f90) FDEBF += -warn truncated_source FDEBF += -warn unused endif endif SOURCE_DIRS = ./$(PROB_DIR) . ifeq ($(BUILD_INPLACE), TRUE) SOURCE_DIRS += $(TOP)/amrlib $(TOP)/bndrylib $(TOP)/BoxLib ifeq ($(PROB_DIR), hyperchem) DEFINES += -DBL_USE_CHEM SOURCE_DIRS += $(TOP)/HeatTransfer/ChemKinDriver include $(TOP)/HeatTransfer/ChemKinDriver/Make.package INCLUDE_LOCATIONS += $(TOP)/HeatTransfer/ChemKinDriver endif endif vpath %.cpp $(SOURCE_DIRS) vpath %.H $(SOURCE_DIRS) vpath %.h $(SOURCE_DIRS) vpath %.F $(SOURCE_DIRS) vpath %.f $(SOURCE_DIRS) all: $(executable) ifeq ($(MACHINE),T3E) # # We don't explicity set the path of the mpi directory on the T3E. # $(executable): $(filter-out -lmpi, $(LIBRARIES)) else $(executable): $(LIBRARIES) endif ifneq ($(BUILD_INPLACE), TRUE) # # Build and install all libraries needed by HyperCLaw in proper order. # libs: cd $(TOP)/BoxLib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install cd $(TOP)/bndrylib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install cd $(TOP)/amrlib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install # # Cleanup needed libraries. # cleanlibs: cd $(TOP)/BoxLib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) clean cd $(TOP)/bndrylib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) clean cd $(TOP)/amrlib; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) clean endif # # Temp stuff for doing html docs. # _docHeaders := $(sort $(wildcard *.H)) _htmlDir := html # # This will make the HTML files in the directory html provided # any of the relevant .H files have changed more recently than the # directory itself. # html: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ $(RM) -r $(_htmlDir); \ mkdir -p $(_htmlDir); \ doc++ -f -j -B Banner.html -d $(_htmlDir) $(_docHeaders); \ fi HyperCLaw.tex: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ doc++ -f -t -j -o HyperCLaw.tex -ep docxx_squish $(_docHeaders); \ sed '/[\]usepackage[{]docxx[}]/d' < HyperCLaw.tex > .junk; \ mv .junk HyperCLaw.tex; \ fi HyperCLaw.dvi: HyperCLaw.tex latex HyperCLaw.tex; latex HyperCLaw.tex HyperCLaw.ps: HyperCLaw.dvi dvips HyperCLaw.dvi -o HyperCLaw.ps # # Create MS-IDE dsp file to build this project # DspOlevel = 1 DspFileRoot = $(EBASE)$(DIM)d ifeq ($(DEBUG), TRUE) DspFileRoot := $(join $(DspFileRoot),.DEBUG) DspOlevel := 0 endif dsp: $(DspFileRoot).dsp .dspDepends: $(FEXE_sources) $(FEXE_headers) $(fEXE_sources) $(CEXE_headers) $(CEXE_sources) $(INCLUDE_LOCATIONS) @echo $^ > .dspDepends $(DspFileRoot).dsp: .dspDepends @(echo Building DSP file = $(DspFileRoot).dsp;\ $(TOP)/scripts/dsp.mak -p $(DspFileRoot) -t $(TOP) -d $(DIM) -o $(DspFileRoot).dsp -O $(DspOlevel) -f $^) .PHONY: dsp .dspDepends include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/HCAll/Prob.H0000644000175000017500000000524711634153073017625 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _Prob_H_ #define _Prob_H_ // // $Id: Prob.H,v 1.8 2000/10/02 20:47:02 lijewski Exp $ // #include #include #include // //@Man: //@Memo: Problem-dependent class derived from AmrLevel and HyperCLaw /*@Doc: Prob contains all the problem dependent parts, most notably variableSetUp(), where things like physical boundary conditions, derived quantities, and other static variables are set up ... */ class Prob : public HyperCLaw { friend class ProbBld; public: // //@ManDoc: The default constructor. // Prob (); // //@ManDoc: The main constructor. // Prob (Amr& papa, int lev, const Geometry& level_geom, const BoxArray& bl, Real time); // //@ManDoc: The destructor. // virtual ~Prob (); // //@ManDoc: Defines static variables, physical boundary conditions, derived quantities // static void variableSetUp (); // //@ManDoc: Cleans up after variableSetUp(). // static void variableCleanUp (); // //@ManDoc: Calls HyperCLaw::read\_params() // static void read_params (); // //@ManDoc: Sums integrated quantities. // virtual void sum_integrated_quantities (); protected: Prob& getLevel (int lev) { return *(Prob*) &parent->getLevel(lev); } }; #endif /*_Prob_H_*/ ccseapps-2.5/CCSEApps/HCAll/Prob.cpp0000644000175000017500000005442411634153073020221 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Prob.cpp,v 1.52 2003/02/07 18:04:08 lijewski Exp $ // #include #include #include #include #include #include #include #include #include using std::ofstream; using std::cerr; using std::cout; using std::ios; static bool do_group_bndry_fills = true; #if 0 #include #include void TagBoxView (const TagBox& tb) { Box bx(tb.box()); FArrayBox fab(bx); for (IntVect iv = bx.smallEnd(); iv <= bx.bigEnd(); bx.next(iv)) { fab(iv,0) = tb(iv); } ArrayView(&fab); } #else void inspectFAB (FArrayBox& unfab) { char filename[256]; sprintf(filename,"inspect.fab"); std::ofstream osout(filename,std::ios::out); unfab.writeOn(osout); osout.close(); system("/usr/local/bin/amrvis2d -fab inspect.fab&"); } void inspectFAB (FArrayBox& unfab, int n) { char filename[256]; sprintf(filename,"inspect%d.fab",n); std::ofstream osout(filename,std::ios::out); unfab.writeOn(osout); osout.close(); } void inspectTAG (const TagBox& tb) { Box bx(tb.box()); FArrayBox fab(bx); for (IntVect iv = bx.smallEnd(); iv <= bx.bigEnd(); bx.next(iv)) { fab(iv,0) = tb(iv); } inspectFAB( fab ); } void inspectTAG (const TagBox& tb, int n) { Box bx(tb.box()); FArrayBox fab(bx); for (IntVect iv = bx.smallEnd(); iv <= bx.bigEnd(); bx.next(iv)) { fab(iv,0) = tb(iv); } inspectFAB( fab,n ); } void inspectTAGArray (const TagBoxArray& tba) { MFIter fai(tba); for ( ; fai.isValid(); ++fai) inspectTAG(tba[fai], fai.index()); } #endif // // ProbBld class instantiation // ProbBld blobbld; LevelBld* getLevelBld() { return &blobbld; } // // ProbBld class implementation // void ProbBld::variableSetUp() { Prob::variableSetUp(); } void ProbBld::variableCleanUp() { Prob::variableCleanUp(); } AmrLevel* ProbBld::operator() () { return new Prob; } AmrLevel* ProbBld::operator() (Amr& papa, int lev, const Geometry& level_geom, const BoxArray& ba, Real time) { return new Prob(papa, lev, level_geom, ba, time); } typedef StateDescriptor::BndryFunc BndryFunc; #ifdef BL_USE_CHEM extern "C" { // // Function called by BCRec for user-supplied boundary data. // typedef void (*ChemBndryFunc_FortBndryFunc)(Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc, const int* stateID); } class ChemBndryFunc : public BndryFunc { public: // // Bogus constructor. // ChemBndryFunc() : m_func(0), m_stateID(-1) {} // // Constructor. // ChemBndryFunc (ChemBndryFunc_FortBndryFunc inFunc, const std::string& stateName) : m_func(inFunc), m_stateName(stateName) { m_stateID = getStateID(m_stateName); BL_ASSERT(m_stateID >= 0); } // // Another Constructor which sets "regular" and "group" fill routines.. // ChemBndryFunc (ChemBndryFunc_FortBndryFunc inFunc, const std::string& stateName, BndryFuncDefault gFunc) : BndryFunc(gFunc,gFunc), m_func(inFunc), m_stateName(stateName) { m_stateID = getStateID(m_stateName); BL_ASSERT(m_stateID >= 0); } // // Destructor. // virtual ~ChemBndryFunc () {} virtual StateDescriptor::BndryFunc* clone () const { // // Bitwise copy ok here, no copy ctr required. // return new ChemBndryFunc(*this); } // // Fill boundary cells. // The other virtual function in BndryFunc will // give us the appropriate call for "group" fills. // virtual void operator () (Real* data, const int* lo, const int* hi, const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc) const { BL_ASSERT(m_func != 0); m_func(data,ARLIM(lo),ARLIM(hi),dom_lo,dom_hi,dx,grd_lo,time,bc,&m_stateID); } // // Access. // int getStateID () const { return m_stateID; } const std::string& getStateName () const { return m_stateName; } ChemBndryFunc_FortBndryFunc getBndryFunc () const { return m_func; } protected: static int getStateID (const std::string& stateName) { const Array& names = HyperCLaw::getChemDriver().speciesNames(); for (int i(0); i < names.size(); ++i) { if (names[i] == stateName) { return i; } } return -1; } private: ChemBndryFunc_FortBndryFunc m_func; std::string m_stateName; int m_stateID; }; #endif // // Box Map function(s) for derived types. // static Box the_same_box (const Box& b) { return b; } // // Components are Interior, Inflow, Outflow, Symmetry, SlipWall, NoSlipWall // static int scalar_bc[] = { INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN }; static int norm_vel_bc[] = { INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_ODD, REFLECT_ODD, REFLECT_ODD }; static int tang_vel_bc[] = { INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN }; #ifdef BL_USE_CHEM static int species_bc[] = { INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN }; #endif static void set_scalar_bc (BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); for (int i = 0; i < BL_SPACEDIM; i++) { bc.setLo(i,scalar_bc[lo_bc[i]]); bc.setHi(i,scalar_bc[hi_bc[i]]); } } static void set_x_vel_bc(BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); bc.setLo(0,norm_vel_bc[lo_bc[0]]); bc.setHi(0,norm_vel_bc[hi_bc[0]]); bc.setLo(1,tang_vel_bc[lo_bc[1]]); bc.setHi(1,tang_vel_bc[hi_bc[1]]); #if (BL_SPACEDIM == 3) bc.setLo(2,tang_vel_bc[lo_bc[2]]); bc.setHi(2,tang_vel_bc[hi_bc[2]]); #endif } static void set_y_vel_bc(BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); bc.setLo(0,tang_vel_bc[lo_bc[0]]); bc.setHi(0,tang_vel_bc[hi_bc[0]]); bc.setLo(1,norm_vel_bc[lo_bc[1]]); bc.setHi(1,norm_vel_bc[hi_bc[1]]); #if (BL_SPACEDIM == 3) bc.setLo(2,tang_vel_bc[lo_bc[2]]); bc.setHi(2,tang_vel_bc[hi_bc[2]]); #endif } #if (BL_SPACEDIM == 3) static void set_z_vel_bc(BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); bc.setLo(0,tang_vel_bc[lo_bc[0]]); bc.setHi(0,tang_vel_bc[hi_bc[0]]); bc.setLo(1,tang_vel_bc[lo_bc[1]]); bc.setHi(1,tang_vel_bc[hi_bc[1]]); bc.setLo(2,norm_vel_bc[lo_bc[2]]); bc.setHi(2,norm_vel_bc[hi_bc[2]]); } #endif #ifdef BL_USE_CHEM static void set_species_bc (BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); for (int i = 0; i < BL_SPACEDIM; i++) { bc.setLo(i,species_bc[lo_bc[i]]); bc.setHi(i,species_bc[hi_bc[i]]); } } #endif void Prob::variableSetUp () { BL_ASSERT(desc_lst.size() == 0); phys_bc.setLo(0,Outflow); phys_bc.setLo(1,SlipWall); phys_bc.setHi(0,Outflow); phys_bc.setHi(1,SlipWall); #if(BL_SPACEDIM==3) phys_bc.setLo(2,SlipWall); phys_bc.setHi(2,SlipWall); #endif // // By reading parmparse, can override phys_bc. // read_params(); // // Define the physical bndry conditions here. // if (CoordSys::IsRZ()) phys_bc.setLo(0,Symmetry); // // Set up projector bndry. // const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); // // Check phys_bc against possible periodic geometry // if periodic, must have internal BC marked. // if (Geometry::isAnyPeriodic()) { // // Do idiot check. Periodic means interior in those directions. // for (int dir = 0; dir0) int Tracer = counter++; #if(NADV>1) BoxLib::Error("Prob::variableSetUp: Only one Advected quantity allowed"); #endif #endif #ifdef BL_USE_CHEM NumSpec = getChemDriver().numSpecies(); if (NumSpec > 0) { FirstSpec = counter++; counter += NumSpec - 2; LastSpec = counter++; } const int tmp = (int)Density; FORT_SETCOMPS (&tmp, &Xmom,&Ymom,&Zmom,&Eden, &FirstSpec,&Tracer); const Array& names = getChemDriver().speciesNames(); if (ParallelDescriptor::IOProcessor()) { std::cout << NumSpec << " Chemical species interpreted:\n { "; for (int i = 0; i < names.size(); i++) std::cout << names[i] << ' ' << ' '; std::cout << '}' << '\n' << '\n'; } #endif NUM_STATE = counter; // // DEFINE SCALAR VARIABLES // desc_lst.addDescriptor(State_Type,IndexType::TheCellType(), StateDescriptor::Point,1,NUM_STATE, &cell_cons_interp); const int nsc = BL_SPACEDIM==3 ? 5 : 4; Array bcs(nsc); Array name(nsc); set_scalar_bc(bc,phys_bc); bcs[0] = bc; name[0] = "density"; desc_lst.setComponent(State_Type,Density,"density",bc,BndryFunc(FORT_DENFILL)); set_x_vel_bc(bc,phys_bc); bcs[1] = bc; name[1] = "xmom"; desc_lst.setComponent(State_Type,Xmom,"xmom",bc,BndryFunc(FORT_XMOMFILL)); set_y_vel_bc(bc,phys_bc); bcs[2] = bc; name[2] = "ymom"; desc_lst.setComponent(State_Type,Ymom,"ymom",bc,BndryFunc(FORT_YMOMFILL)); #if(BL_SPACEDIM==3) set_z_vel_bc(bc,phys_bc); bcs[3] = bc; name[3] = "zmom"; desc_lst.setComponent(State_Type,Zmom,"zmom",bc,BndryFunc(FORT_ZMOMFILL)); #endif set_scalar_bc(bc,phys_bc); bcs[nsc-1] = bc; name[nsc-1] = "eden"; desc_lst.setComponent(State_Type,Eden,"eden",bc,BndryFunc(FORT_EDENFILL)); // // To enable "group" operations on filling species, we need to // overwrite the first component specifing how to do "regular" // and "group" fill operations. // if (do_group_bndry_fills) { desc_lst.setComponent(State_Type, Density, name, bcs, BndryFunc(FORT_DENFILL,FORT_HYPFILL)); } #ifdef BL_USE_CHEM bcs.resize(NumSpec); name.resize(NumSpec); set_species_bc(bc,phys_bc); for (int i=0; i 0) set_scalar_bc(bc,phys_bc); desc_lst.setComponent(State_Type,Tracer,"tracer",bc,BndryFunc(FORT_TRACFILL)); #endif // // DEFINE DERIVED QUANTITIES // // log of Density // derive_lst.add("log_den",IndexType::TheCellType(),1,FORT_DERLOGS,the_same_box); derive_lst.addComponent("log_den",desc_lst,State_Type,Density,1); // // Pressure // #ifdef BL_USE_CHEM const int nWorkPres = 4 + NumSpec; #else const int nWorkPres = 4; #endif derive_lst.add("pressure",IndexType::TheCellType(),nWorkPres, FORT_DERPRES,the_same_box); derive_lst.addComponent("pressure",desc_lst,State_Type,Density,NUM_STATE); // // Xvel // derive_lst.add("xvel",IndexType::TheCellType(),1,FORT_DERVEL,the_same_box); derive_lst.addComponent("xvel",desc_lst,State_Type,Density,2); // // Yvel // derive_lst.add("yvel",IndexType::TheCellType(),1,FORT_DERVEL,the_same_box); derive_lst.addComponent("yvel",desc_lst,State_Type,Density,1); derive_lst.addComponent("yvel",desc_lst,State_Type,Ymom,1); #if(BL_SPACEDIM==3) // // Zvel // derive_lst.add("zvel",IndexType::TheCellType(),1,FORT_DERVEL,the_same_box); derive_lst.addComponent("zvel",desc_lst,State_Type,Density,1); derive_lst.addComponent("zvel",desc_lst,State_Type,Zmom,1); #endif // // log of Eden // derive_lst.add("log_eden",IndexType::TheCellType(),1,FORT_DERLOGS,the_same_box); derive_lst.addComponent("log_eden",desc_lst,State_Type,Eden,1); // // A derived quantity equal to all the state variables. // derive_lst.add("FULLSTATE",IndexType::TheCellType(),NUM_STATE,FORT_DERCOPY,the_same_box); derive_lst.addComponent("FULLSTATE",desc_lst,State_Type,Density,NUM_STATE); // // DEFINE ERROR ESTIMATION QUANTITIES // err_list.add("FULLSTATE",1,ErrorRec::Special,FORT_DENERROR); #if(NADV>0) //err_list.add("tracer",1,Special,FORT_TRCERROR); #endif #if 0 // // DEFINE SLAB STATISTICS // Array vars(4); vars[0] = "density"; vars[1] = "xvel"; vars[2] = "yvel"; vars[3] = "zvel"; AmrLevel::get_slabstat_lst().add("VelStats0", 4*vars.size(), vars, 0, FORT_FAVREAVG_FIRST4MOMS); AmrLevel::get_slabstat_lst().add("VelStats1", 4*vars.size(), vars, 0, FORT_FAVREAVG_FIRST4MOMS); #endif } Prob::~Prob () {} void Prob::variableCleanUp () { HyperCLaw::variableCleanUp(); } Prob::Prob () : HyperCLaw() {} Prob::Prob(Amr& papa, int lev, const Geometry& level_geom, const BoxArray& bl, Real time) : HyperCLaw(papa,lev,level_geom,bl,time) {} void Prob::read_params () { HyperCLaw::read_params(); // // Read parameters from input file and command line. // ParmParse pp("Prob"); pp.query("do_group_bndry_fills",do_group_bndry_fills); Array lo_bc(BL_SPACEDIM), hi_bc(BL_SPACEDIM); pp.getarr("lo_bc",lo_bc,0,BL_SPACEDIM); pp.getarr("hi_bc",hi_bc,0,BL_SPACEDIM); for (int i = 0; i < BL_SPACEDIM; i++) { phys_bc.setLo(i,lo_bc[i]); phys_bc.setHi(i,hi_bc[i]); } } #ifdef BL_USE_CHEM void Prob::sum_integrated_quantities () { int finest_level = parent->finestLevel(); Real time = state[State_Type].curTime(); const Array& names = HyperCLaw::getChemDriver().speciesNames(); NumSpec = getChemDriver().numSpecies(); Real * Integral = new Real[NumSpec]; for (int i=0; i #include // //@Man: //@Memo: Problem-dependent level builder. /*@Doc: This class provides a virtual constructor interface for problem-specific objects derived from AmrLevel. */ class ProbBld : public LevelBld { // //@ManDoc: Defines static variables, physical boundary conditions, derived quantities // virtual void variableSetUp (); // //@ManDoc: Cleans up after variableSetUp(). // virtual void variableCleanUp (); // //@ManDoc: Returns a problem-specific AmrLevel derived type using the default constructor. // virtual AmrLevel* operator() (); // //@ManDoc: Returns a problem-specific AmrLevel derived type using the five passed variables. // virtual AmrLevel* operator() (Amr& papa, int lev, const Geometry& level_geom, const BoxArray& ba, Real time); }; #endif /*_ProbBld_H_*/ ccseapps-2.5/CCSEApps/HCAll/HyperCLaw.H0000644000175000017500000002130611634153073020553 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _HyperCLaw_H_ #define _HyperCLaw_H_ // // $Id: HyperCLaw.H,v 1.27 2002/03/13 23:15:30 vince Exp $ // #include #include #include #include #include #ifdef BL_USE_CHEM # include #endif #include using std::istream; using std::ostream; enum StateType { State_Type=0, NUM_STATE_TYPE }; #if (BL_SPACEDIM == 2) enum StateNames { Density = 0 }; #else enum StateNames { Density = 0 }; #endif // //@Man: //@Memo: AmrLevel-derived class for hyperbolic systems of conservation laws. /*@Doc: This class advances a system of hyperbolic conservation laws in time by calling the LevelAdvance operator. It is expected that another, problem-dependent class will be derived from this physics-dependent class. */ class HyperCLaw : public AmrLevel { public: // //@ManDoc: Default constructor. Builds invalid object. // HyperCLaw (); // //@ManDoc: The basic constructor. // HyperCLaw (Amr& papa, int lev, const Geometry& level_geom, const BoxArray& bl, Real time); // //@ManDoc: The destructor. // virtual ~HyperCLaw (); // //@ManDoc: Restart from a checkpoint file. // virtual void restart (Amr& papa, std::istream& is, bool bReadSpecial = false); /*@ManDoc: A string written as the first item in writePlotFile() at level zero. It is so we can distinguish between different types of plot files. For HyperCLaw it has the form: HyperCLaw-Vnnn */ virtual std::string thePlotFileType () const; // //@ManDoc: Write a plotfile to specified directory. // virtual void writePlotFile (const std::string& dir, std::ostream& os, VisMF::How how); // //@ManDoc: Define data descriptors. // static void variableSetUp (); // //@ManDoc: Cleanup data descriptors at end of run. // static void variableCleanUp (); // //@ManDoc: Initialize grid data at problem start-up. // virtual void initData (); // //@ManDoc: Get problem metrics. // MultiFab& Area (int dir); // //@ManDoc: The volume of the multifab. // MultiFab& Volume (); // //@ManDoc: Set time levels of state data. // virtual void setTimeLevel (Real time, Real dt_old, Real dt_new); // //@ManDoc: Initialize data on this level from another HyperCLaw (during regrid). // virtual void init (AmrLevel& old); // //@ManDoc: Initialize data on this level after regridding if old level did not previously exist // virtual void init (); // //@ManDoc: Proceed with next timestep? // virtual int okToContinue (); // //@ManDoc: Advance grids at this level in time. // virtual Real advance (Real time, Real dt, int iteration, int ncycle); // //@ManDoc: Estimate time step. // Real estTimeStep (); // //@ManDoc: Compute initial time step. // Real initialTimeStep (); // //@ManDoc: Compute initial `dt'. // virtual void computeInitialDt (int finest_level, int sub_cycle, Array& n_cycle, const Array& ref_ratio, Array& dt_level, Real stop_time); // //@ManDoc: Compute new `dt'. // virtual void computeNewDt (int finest_level, int sub_cycle, Array& n_cycle, const Array& ref_ratio, Array& dt_min, Array& dt_level, Real stop_time); // //@ManDoc: Allocate data at old time. // virtual void allocOldData (); // //@ManDoc: Remove data at old time. // virtual void removeOldData (); // //@ManDoc: Do work after timestep(). // virtual void post_timestep (int iteration); // //@ManDoc: Do work after regrid(). // virtual void post_regrid (int lbase, int new_finest); // //@ManDoc: Do work after a restart(). // virtual void post_restart (); // //@ManDoc: Do work after init(). // virtual void post_init (Real stop_time); // //@ManDoc: Error estimation for regridding. // virtual void errorEst (TagBoxArray& tb, int clearval, int tagval, Real time, int n_error_buf = 0, int ngrow = 0); // //@ManDoc: Fill MultiFab at specified time with coarse data. // void FillCoarseMultiFab (MultiFab& dest, int dst_comp, Real time, int state_indx, int src_comp, int ncomp); #ifdef BL_USE_CHEM // //@ManDoc: Access to chemistry driver object // static ChemKinDriver& getChemDriver (); #endif protected: static void read_params (); HyperCLaw& getLevel (int lev); FluxRegister& getFluxReg (); FluxRegister& getFluxReg (int lev); void reflux (); void avgDown (); void buildMetrics (); // integrate derived quantities over domain Real sumDerive (const std::string& name, Real time); Real volWgtSum (const std::string& name, Real time); virtual void sum_integrated_quantities () = 0; // // The data. // MultiFab volume; MultiFab area[BL_SPACEDIM]; PArray radius; FluxRegister* flux_reg; // // Static data members. // static int radius_grow; static int verbose; static Real cfl; static Real init_shrink; static Real change_max; static int do_reflux; static int do_richardson; static int initial_step; static ErrorList err_list; static Real gravity; static int NUM_STATE; static BCRec phys_bc; #ifdef BL_USE_CHEM static ChemKinDriver* chemDriver; static int NumSpec; static int FirstSpec; static int LastSpec; #endif }; // // Inlines. // inline MultiFab& HyperCLaw::Area (int dir) { return area[dir]; } inline MultiFab& HyperCLaw::Volume () { return volume; } inline HyperCLaw& HyperCLaw::getLevel (int lev) { return *(HyperCLaw *) &parent->getLevel(lev); } inline FluxRegister& HyperCLaw::getFluxReg () { BL_ASSERT(flux_reg); return *flux_reg; } inline FluxRegister& HyperCLaw::getFluxReg (int lev) { return getLevel(lev).getFluxReg(); } inline Real HyperCLaw::initialTimeStep () { return init_shrink*estTimeStep(); } #ifdef BL_USE_CHEM inline ChemKinDriver& HyperCLaw::getChemDriver () { return *chemDriver; } #endif #endif /*_HyperCLaw_H_*/ ccseapps-2.5/CCSEApps/HCAll/PROB_F.H0000644000175000017500000002337211634153073017731 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _PROB_F_H_ #define _PROB_F_H_ /* ** $Id: PROB_F.H,v 1.21 2003/02/07 18:04:08 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_INITDATA initdata # define FORT_PROBINIT probinit # define FORT_DENFILL denfill # define FORT_HYPFILL hypfill # define FORT_XMOMFILL xmomfill # define FORT_YMOMFILL ymomfill # define FORT_ZMOMFILL zmomfill # define FORT_EDENFILL edenfill # define FORT_CHEMFILL chemfill # define FORT_ALLCHEMFILL allchemfill # define FORT_TRACFILL tracfill # define FORT_DENERROR denerror # define FORT_TRCERROR trcerror # ifdef BL_USE_CHEM # define FORT_SETCOMPS setcomps # define FORT_MIB_CHEM mibchem # define FORT_FINIT finit # endif # ifdef BL_SYNC_RANTABLES # define FORT_SYNC_RANTABLES syncrantables # endif # ifdef BL_BS_HOLEINTOP # define FORT_GETHOLEPARAMS getholeparams # endif #else # ifdef BL_FORT_USE_UPPERCASE # define FORT_INITDATA INITDATA # define FORT_PROBINIT PROBINIT # define FORT_DENFILL DENFILL # define FORT_HYPFILL HYPFILL # define FORT_XMOMFILL XMOMFILL # define FORT_YMOMFILL YMOMFILL # define FORT_ZMOMFILL ZMOMFILL # define FORT_EDENFILL EDENFILL # define FORT_CHEMFILL CHEMFILL # define FORT_ALLCHEMFILL ALLCHEMFILL # define FORT_TRACFILL TRACFILL # define FORT_DENERROR DENERROR # define FORT_TRCERROR TRCERROR # ifdef BL_USE_CHEM # define FORT_SETCOMPS SETCOMPS # define FORT_MIB_CHEM MIBCHEM # define FORT_FINIT FINIT # endif # ifdef BL_SYNC_RANTABLES # define FORT_SYNC_RANTABLES SYNCRANTABLES # endif # ifdef BL_BS_HOLEINTOP # define FORT_GETHOLEPARAMS GETHOLEPARAMS # endif # else # ifdef BL_FORT_USE_LOWERCASE # define FORT_INITDATA initdata # define FORT_PROBINIT probinit # define FORT_DENFILL denfill # define FORT_HYPFILL hypfill # define FORT_XMOMFILL xmomfill # define FORT_YMOMFILL ymomfill # define FORT_ZMOMFILL zmomfill # define FORT_EDENFILL edenfill # define FORT_CHEMFILL chemfill # define FORT_ALLCHEMFILL allchemfill # define FORT_TRACFILL tracfill # define FORT_DENERROR denerror # define FORT_TRCERROR trcerror # ifdef BL_USE_CHEM # define FORT_SETCOMPS setcomps # define FORT_MIB_CHEM mibchem # define FORT_FINIT finit # endif # ifdef BL_SYNC_RANTABLES # define FORT_SYNC_RANTABLES syncrantables # endif # ifdef BL_BS_HOLEINTOP # define FORT_GETHOLEPARAMS getholeparams # endif # else # define FORT_INITDATA initdata_ # define FORT_PROBINIT probinit_ # define FORT_DENFILL denfill_ # define FORT_HYPFILL hypfill_ # define FORT_XMOMFILL xmomfill_ # define FORT_YMOMFILL ymomfill_ # define FORT_ZMOMFILL zmomfill_ # define FORT_EDENFILL edenfill_ # define FORT_CHEMFILL chemfill_ # define FORT_ALLCHEMFILL allchemfill_ # define FORT_TRACFILL tracfill_ # define FORT_DENERROR denerror_ # define FORT_TRCERROR trcerror_ # ifdef BL_USE_CHEM # define FORT_SETCOMPS setcomps_ # define FORT_MIB_CHEM mibchem_ # define FORT_FINIT finit_ # endif # ifdef BL_SYNC_RANTABLES # define FORT_SYNC_RANTABLES syncrantables_ # endif # ifdef BL_BS_HOLEINTOP # define FORT_GETHOLEPARAMS getholeparams_ # endif # endif # endif #include "ArrayLim.H" extern "C" { void FORT_PROBINIT (const int* init, const int* name, const int* namelen, const Real* problo, const Real* probhi); #ifdef BL_SYNC_RANTABLES void FORT_SYNC_RANTABLES (Real *RanPhaseTable, Real *RanAmplTable, const int* igetput); #endif #ifdef BL_BS_HOLEINTOP void FORT_GETHOLEPARAMS (Real *xholeloc, Real *yholeloc, Real *rhole); #endif #ifdef BL_EXPLOSION_INIT void FORT_INITDATA (const int* level, const Real* time, const int* lo,const int* hi, const int* nscal, Real* scal, ARLIM_P(lo), ARLIM_P(hi), const int* nblastinit, Real* blastinit, ARLIM_P(blastlo), ARLIM_P(blasthi), const Real* dx, const Real* xlo, const Real* xhi); #else void FORT_INITDATA (const int* level, const Real* time, const int* lo,const int* hi, const int* nscal, Real* scal, ARLIM_P(lo), ARLIM_P(hi), const Real* dx, const Real* xlo, const Real* xhi); #endif void FORT_DENFILL (Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_HYPFILL (Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_XMOMFILL (Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_YMOMFILL (Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_ZMOMFILL (Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_EDENFILL (Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_CHEMFILL (Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc, const int* stateID); void FORT_ALLCHEMFILL (Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_TRACFILL (Real* data, ARLIM_P(lo), ARLIM_P(hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_DENERROR (int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(dlo), ARLIM_P(dhi), const int* lo, const int* hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); void FORT_TRCERROR (int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(dlo), ARLIM_P(dhi), const int* lo, const int* hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); #ifdef BL_USE_CHEM void FORT_SETCOMPS (const int* rho, const int* Xmom, const int* Ymom, const int* Zmom, const int* Eden, const int* FirstSpec, const int* Tracer); void FORT_MIB_CHEM(const int* lo, const int* hi, Real* s, ARLIM_P(slo), ARLIM_P(shi)); void FORT_FINIT(const int* lo, const int* hi, Real* s, ARLIM_P(slo), ARLIM_P(shi),Real* dt); #endif } #endif #endif /*_PROB_F_H_*/ ccseapps-2.5/CCSEApps/HCAll/.cvsignore0000644000175000017500000000017711634153073020607 0ustar amckinstryamckinstry*.for Debug Release *.ncb *.opt *.plg grdlog ti_files chk[0-9][0-9][0-9][0-9] plt[0-9][0-9][0-9][0-9] *.pixie *.Addrs make.out ccseapps-2.5/CCSEApps/HCAll/HyperCLaw.cpp0000644000175000017500000007772311634153073021164 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: HyperCLaw.cpp,v 1.76 2002/03/13 23:43:09 vince Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::pair; using std::cout; using std::endl; #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); #define DEF_CLIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ const Real* fabdat = (fab).dataPtr(); #define FA_XPND(f) D_DECL(f[0].dataPtr(),f[1].dataPtr(),f[2].dataPtr()) #define FA_NORM_XPND(f) D_DECL(f[0].dataPtr(0),f[1].dataPtr(1),f[2].dataPtr(2)) #define FA_COMP_XPND(f,k) D_DECL(f[0].dataPtr(k),f[1].dataPtr(k),f[2].dataPtr(k)) static int sum_interval = -1; static Real fixed_dt = -1.0; static Real dt_cutoff = 0.0; static Real bogus_value = 1.0e+20; int HyperCLaw::verbose; Real HyperCLaw::cfl = 0.8; Real HyperCLaw::init_shrink = 0.5; Real HyperCLaw::change_max = 1.1; Real HyperCLaw::gravity; int HyperCLaw::initial_step; ErrorList HyperCLaw::err_list; int HyperCLaw::radius_grow = 1; BCRec HyperCLaw::phys_bc; int HyperCLaw::NUM_STATE; int HyperCLaw::do_reflux = 1; int HyperCLaw::do_richardson = 1; #ifdef BL_USE_CHEM ChemKinDriver* HyperCLaw::chemDriver = 0; int HyperCLaw::NumSpec = 0; int HyperCLaw::FirstSpec = -1; int HyperCLaw::LastSpec = -1; const std::string chemfile_DEF = "chem.inp"; const std::string chemoutfile_DEF = ""; const std::string thermfile_DEF = "therm.dat"; const std::string tranfile_DEF = "tran.dat"; #endif void HyperCLaw::variableSetUp () { BoxLib::Error("HyperCLaw::variableSetUp() not defined"); } void HyperCLaw::variableCleanUp () { desc_lst.clear(); #ifdef BL_USE_CHEM delete chemDriver; chemDriver = 0; #endif } void HyperCLaw::read_params () { ParmParse pp("hyp"); pp.query("v",verbose); verbose = (verbose ? 1 : 0); pp.get("init_shrink",init_shrink); pp.get("cfl",cfl); pp.get("gravity",gravity); pp.query("change_max",change_max); pp.query("fixed_dt",fixed_dt); pp.query("bogus_value",bogus_value); pp.query("sum_interval",sum_interval); pp.query("do_reflux",do_reflux); do_reflux = (do_reflux ? 1 : 0); pp.query("do_richardson",do_richardson); do_richardson = (do_richardson ? 1 : 0); pp.get("dt_cutoff",dt_cutoff); #ifdef BL_USE_CHEM std::string chemfile=chemfile_DEF; pp.query("chemfile",chemfile); std::string chemoutfile=chemoutfile_DEF; pp.query("chemoutfile",chemoutfile); std::string thermfile=thermfile_DEF; pp.query("thermfile",thermfile); std::string tranfile=tranfile_DEF; pp.query("tranfile",tranfile); chemDriver = new ChemKinDriver(chemfile, chemoutfile, thermfile, tranfile); #endif } HyperCLaw::HyperCLaw () : radius(PArrayManage) { flux_reg = 0; } HyperCLaw::HyperCLaw (Amr& papa, int lev, const Geometry& level_geom, const BoxArray& bl, Real time) : AmrLevel(papa,lev,level_geom,bl,time), radius(PArrayManage) { buildMetrics(); flux_reg = 0; if (level > 0 && do_reflux) { flux_reg = new FluxRegister(grids,crse_ratio,level,NUM_STATE); } } HyperCLaw::~HyperCLaw () { delete flux_reg; int ngrd = grids.size(); } void HyperCLaw::restart (Amr& papa, std::istream& is, bool bReadSpecial) { AmrLevel::restart(papa,is,bReadSpecial); buildMetrics(); BL_ASSERT(flux_reg == 0); if (level > 0 && do_reflux) { flux_reg = new FluxRegister(grids,crse_ratio,level,NUM_STATE); } } std::string HyperCLaw::thePlotFileType () const { // // Increment this whenever the writePlotFile() format changes. // static const std::string the_plot_file_type("HyperCLaw-V1.1"); return the_plot_file_type; } void HyperCLaw::writePlotFile (const std::string& dir, std::ostream& os, VisMF::How how) #if 0 { int i, n; // // There is only one MultiFab written out at each level in HyperCLaw. // static const std::string MultiFabBaseName("/MultiFab"); // // Build the directory to hold the MultiFabs at this level. // The name is relative to the directory containing the Header file. // char buf[64]; sprintf(buf, "Level_%d", level); std::string Level = buf; // // Now for the full pathname of that directory. // std::string FullPath = dir; if (!FullPath.empty() && FullPath[FullPath.length()-1] != '/') FullPath += '/'; FullPath += Level; // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) BoxLib::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); const StateDescriptor& d_cell = desc_lst[State_Type]; // // The list of indices of State to write to plotfile. // std::vector idx_map; for (i = 0; i < NUM_STATE; i++) if (parent->isStatePlotVar(d_cell.name(i))) idx_map.push_back(i); BL_ASSERT(idx_map.size() > 0 && idx_map.size() <= NUM_STATE); if (ParallelDescriptor::IOProcessor()) { if (level == 0) { // // The first thing we write out is the plot file type. // os << thePlotFileType() << '\n'; // // Only write out velocity and scalar data. // os << idx_map.size() << '\n'; for (n = 0; n < idx_map.size(); n++) os << d_cell.name(idx_map[n]) << '\n'; os << BL_SPACEDIM << '\n'; os << parent->cumTime() << '\n'; int f_lev = parent->finestLevel(); os << f_lev << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << Geometry::ProbLo(i) << ' '; os << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << Geometry::ProbHi(i) << ' '; os << '\n'; for (i = 0; i < f_lev; i++) os << parent->refRatio(i) << ' '; os << '\n'; for (i = 0; i <= f_lev; i++) os << parent->Geom(i).Domain() << ' '; os << '\n'; for (i = 0; i <= f_lev; i++) os << parent->levelSteps(i) << ' '; os << '\n'; for (i = 0; i <= f_lev; i++) { const Real* dx_lev = parent->Geom(i).CellSize(); for (int k = 0; k < BL_SPACEDIM; k++) os << dx_lev[k] << ' '; os << '\n'; } os << (int) CoordSys::Coord() << '\n'; os << "0\n"; // The bndry data. } // // Now write state data. // int ngrds = grids.size(); Real cur_time = state[State_Type].curTime(); MultiFab& cell_dat = state[State_Type].newData(); os << level << ' ' << ngrds << ' ' << cur_time << '\n'; os << parent->levelSteps(level) << '\n'; for (i = 0; i < cell_dat.boxArray().size(); ++i) { for (n = 0; n < BL_SPACEDIM; n++) os << grid_loc[i].lo(n) << ' ' << grid_loc[i].hi(n) << '\n'; } // // Finally, the full relative pathname of the MultiFab. // The name is relative to the Header file containing this name. // It's the name that gets written into the Header. // std::string PathNameInHeader = Level; PathNameInHeader += MultiFabBaseName; os << PathNameInHeader << '\n'; } // // Now amend FullPath to contain full pathname of MF. // FullPath += MultiFabBaseName; const MultiFab& mf = state[State_Type].newData(); if (idx_map.size() == NUM_STATE) { // // Set ghost cells to average of min/max during VisMF::Write(). // VisMF::Write(mf,FullPath,how,true); } else { // // Make MultiFab containing copy of selected components. // // Note that we don't copy the ghost cells. // MultiFab nmf(mf.boxArray(), idx_map.size(), 0); for (MFIter mfi(nmf); mfi.isValid(); ++mfi) { FArrayBox& fab_dst = nmf[mfi]; const FArrayBox& fab_src = mf[mfi]; for (i = 0; i < idx_map.size(); i++) { fab_dst.copy(fab_src, idx_map[i], i, 1); } } VisMF::Write(nmf,FullPath,how); } } #else { int i, n; // // The list of indices of State to write to plotfile. // first component of pair is state_type, // second component of pair is component # within the state_type // vector > plot_var_map; for (int typ = 0; typ < desc_lst.size(); typ++) for (int comp = 0; comp < desc_lst[typ].nComp();comp++) if (parent->isStatePlotVar(desc_lst[typ].name(comp)) && desc_lst[typ].getType() == IndexType::TheCellType()) plot_var_map.push_back(pair(typ,comp)); int num_derive = 0; std::list derive_names; const std::list& dlist = derive_lst.dlist(); for (std::list::const_iterator it = dlist.begin(); it != dlist.end(); ++it) { if (parent->isDerivePlotVar(it->name())) { derive_names.push_back(it->name()); num_derive++; } } int n_data_items = plot_var_map.size() + num_derive; Real cur_time = state[State_Type].curTime(); if (level == 0 && ParallelDescriptor::IOProcessor()) { // // The first thing we write out is the plotfile type. // os << thePlotFileType() << '\n'; if (n_data_items == 0) BoxLib::Error("Must specify at least one valid data item to plot"); os << n_data_items << '\n'; // // Names of variables -- first state, then derived // for (i =0; i < plot_var_map.size(); i++) { int typ = plot_var_map[i].first; int comp = plot_var_map[i].second; os << desc_lst[typ].name(comp) << '\n'; } for ( std::list::iterator it = derive_names.begin(); it != derive_names.end(); ++it) { const DeriveRec* rec = derive_lst.get(*it); os << rec->variableName(0) << '\n'; } os << BL_SPACEDIM << '\n'; os << parent->cumTime() << '\n'; int f_lev = parent->finestLevel(); os << f_lev << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << Geometry::ProbLo(i) << ' '; os << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << Geometry::ProbHi(i) << ' '; os << '\n'; for (i = 0; i < f_lev; i++) os << parent->refRatio(i)[0] << ' '; os << '\n'; for (i = 0; i <= f_lev; i++) os << parent->Geom(i).Domain() << ' '; os << '\n'; for (i = 0; i <= f_lev; i++) os << parent->levelSteps(i) << ' '; os << '\n'; for (i = 0; i <= f_lev; i++) { for (int k = 0; k < BL_SPACEDIM; k++) os << parent->Geom(i).CellSize()[k] << ' '; os << '\n'; } os << (int) CoordSys::Coord() << '\n'; os << "0\n"; // Write bndry data. } // Build the directory to hold the MultiFab at this level. // The name is relative to the directory containing the Header file. // static const std::string BaseName = "/MultiFab"; char buf[64]; sprintf(buf, "Level_%d", level); std::string Level = buf; // // Now for the full pathname of that directory. // std::string FullPath = dir; if (!FullPath.empty() && FullPath[FullPath.size()-1] != '/') FullPath += '/'; FullPath += Level; // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) BoxLib::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); if (ParallelDescriptor::IOProcessor()) { os << level << ' ' << grids.size() << ' ' << cur_time << '\n'; os << parent->levelSteps(level) << '\n'; for (i = 0; i < grids.size(); ++i) { for (n = 0; n < BL_SPACEDIM; n++) os << grid_loc[i].lo(n) << ' ' << grid_loc[i].hi(n) << '\n'; } // // The full relative pathname of the MultiFabs at this level. // The name is relative to the Header file containing this name. // It's the name that gets written into the Header. // if (n_data_items > 0) { std::string PathNameInHeader = Level; PathNameInHeader += BaseName; os << PathNameInHeader << '\n'; } } // // We combine all of the multifabs -- state, derived, etc -- into one // multifab -- plotMF. // NOTE: we are assuming that each state variable has one component, // but a derived variable is allowed to have multiple components. int cnt = 0; const int nGrow = 0; MultiFab plotMF(grids,n_data_items,nGrow); MultiFab* this_dat = 0; // // Cull data from state variables -- use no ghost cells. // for (i = 0; i < plot_var_map.size(); i++) { int typ = plot_var_map[i].first; int comp = plot_var_map[i].second; this_dat = &state[typ].newData(); MultiFab::Copy(plotMF,*this_dat,comp,cnt,1,nGrow); cnt++; } // // Cull data from derived variables. // if (derive_names.size() > 0) { for (std::list::iterator it = derive_names.begin(); it != derive_names.end(); ++it) { const DeriveRec* rec = derive_lst.get(*it); MultiFab* derive_dat = derive(*it,cur_time,nGrow); MultiFab::Copy(plotMF,*derive_dat,0,cnt,1,nGrow); delete derive_dat; cnt++; } } // // Use the Full pathname when naming the MultiFab. // std::string TheFullPath = FullPath; TheFullPath += BaseName; VisMF::Write(plotMF,TheFullPath,how,true); } #endif void HyperCLaw::buildMetrics () { const int ngrd = grids.size(); radius.resize(ngrd); const Real* dx = geom.CellSize(); for (int i = 0; i < ngrd; i++) { const Box& b = grids[i]; int ilo = b.smallEnd(0)-radius_grow; int ihi = b.bigEnd(0)+radius_grow; int len = ihi - ilo + 1; Real* rad = new Real[len]; radius.set(i,rad); if (CoordSys::IsCartesian()) { for (int j = 0; j < len; j++) { rad[j] = 1.0; } } else { const Real xlo = grid_loc[i].lo(0) + (0.5 - radius_grow)*dx[0]; for (int j = 0; j < len; j++) { rad[j] = xlo + j*dx[0]; } } } // // Build volume and face area arrays. // volume is not PArrayManaged, must manually delete. // volume.clear(); // // area is not PArrayManaged, must manually delete. // for (int dir = 0; dir < BL_SPACEDIM; dir++) { area[dir].clear(); } geom.GetVolume(volume,grids,GEOM_GROW); for (int dir = 0; dir < BL_SPACEDIM; dir++) { geom.GetFaceArea(area[dir],grids,dir,GEOM_GROW); } } void HyperCLaw::setTimeLevel (Real time, Real dt_old, Real dt_new) { state[State_Type].setTimeLevel(time,dt_old,dt_new); } void HyperCLaw::initData () { // // Loop over grids, call FORTRAN function to init with data. // int ns = NUM_STATE; const Real* dx = geom.CellSize(); MultiFab& S_new = get_new_data(State_Type); Real cur_time = state[State_Type].curTime(); for (MFIter mfi(S_new); mfi.isValid(); ++mfi) { const int* glo = mfi.validbox().loVect(); const int* ghi = mfi.validbox().hiVect(); const int* slo = mfi.fabbox().loVect(); const int* shi = mfi.fabbox().hiVect(); FORT_INITDATA (&level,&cur_time, glo, ghi, &ns, S_new[mfi].dataPtr(),ARLIM(slo), ARLIM(shi), dx,grid_loc[mfi.index()].lo(), grid_loc[mfi.index()].hi()); } } void HyperCLaw::init (AmrLevel &old) { HyperCLaw* oldlev = (HyperCLaw*) &old; // // Create new grid data by fillpatching from old. // Real dt_new = parent->dtLevel(level); Real cur_time = oldlev->state[State_Type].curTime(); Real prev_time = oldlev->state[State_Type].prevTime(); Real dt_old = cur_time - prev_time; setTimeLevel(cur_time,dt_old,dt_new); MultiFab& S_new = get_new_data(State_Type); FillPatchIterator fpi(old,S_new,0,cur_time,State_Type,0,NUM_STATE); for ( ; fpi.isValid(); ++fpi) { S_new[fpi].copy(fpi()); } } // // This version inits the data on a new level that did not // exist before regridding. // void HyperCLaw::init () { Real dt = parent->dtLevel(level); Real cur_time = getLevel(level-1).state[State_Type].curTime(); Real prev_time = getLevel(level-1).state[State_Type].prevTime(); Real dt_old = (cur_time - prev_time)/(Real)parent->MaxRefRatio(level-1); setTimeLevel(cur_time,dt_old,dt); MultiFab& S_new = get_new_data(State_Type); FillCoarseMultiFab(S_new, 0, cur_time, State_Type, 0, NUM_STATE); } Real HyperCLaw::estTimeStep () { if (fixed_dt > 0.0) return fixed_dt; const Real* dx = geom.CellSize(); Real cur_time = state[State_Type].curTime(); Real estdt = 1.0e+20; MultiFab& stateMF = get_new_data(State_Type); FArrayBox stateFab, c; for (MFIter mfi(stateMF); mfi.isValid(); ++mfi) { stateFab.resize(mfi.validbox(), NUM_STATE); c.resize(mfi.validbox(), 1); stateFab.copy(stateMF[mfi]); DEF_LIMITS(stateFab, state_dat, slo, shi); DEF_LIMITS(c, c_dat, clo, chi); Real dt; FORT_ESTDT(state_dat, ARLIM(slo), ARLIM(shi), c_dat, ARLIM(clo), ARLIM(chi), slo, shi, dx, &dt, &NUM_STATE); estdt = std::min(estdt,dt); } estdt *= cfl; ParallelDescriptor::ReduceRealMin(estdt); if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "HyperCLaw::estTimeStep: estdt = " << estdt << '\n'; } return estdt; } void HyperCLaw::computeNewDt (int finest_level, int sub_cycle, Array& n_cycle, const Array& ref_ratio, Array& dt_min, Array& dt_level, Real stop_time) { // // We are at the end of a coarse grid timecycle. // Compute the timesteps for the next iteration. // if (level > 0) return; int i; n_cycle[0] = 1; for (i = 1; i <= finest_level; i++) { n_cycle[i] = sub_cycle ? parent->MaxRefRatio(i-1) : 1; } Real dt_0 = 1.0e+100; int n_factor = 1; for (i = 0; i <= finest_level; i++) { HyperCLaw& adv_level = getLevel(i); dt_min[i] = adv_level.estTimeStep(); dt_min[i] = std::min(dt_min[i],change_max*dt_level[i]); n_factor *= n_cycle[i]; dt_0 = std::min(dt_0,n_factor*dt_min[i]); } // // Limit dt's by the value of stop_time. // const Real eps = 0.001*dt_0; Real cur_time = state[State_Type].curTime(); if (stop_time >= 0.0) { if ((cur_time + dt_0) > (stop_time - eps)) dt_0 = stop_time - cur_time; } n_factor = 1; for (i = 0; i <= finest_level; i++) { n_factor *= n_cycle[i]; dt_level[i] = dt_0/n_factor; } } void HyperCLaw::computeInitialDt (int finest_level, int sub_cycle, Array& n_cycle, const Array& ref_ratio, Array& dt_level, Real stop_time) { // // Grids have been constructed, compute dt for all levels. // if (level > 0) return; int i; n_cycle[0] = 1; for (i = 1; i <= finest_level; i++) { n_cycle[i] = sub_cycle ? parent->MaxRefRatio(i-1) : 1; } Real dt_0 = 1.0e+100; int n_factor = 1; for (i = 0; i <= finest_level; i++) { dt_level[i] = getLevel(i).initialTimeStep(); n_factor *= n_cycle[i]; dt_0 = std::min(dt_0,n_factor*dt_level[i]); } // // Limit dt's by the value of stop_time. // const Real eps = 0.001*dt_0; Real cur_time = state[State_Type].curTime(); if (stop_time >= 0.0) { if ((cur_time + dt_0) > (stop_time - eps)) dt_0 = stop_time - cur_time; } n_factor = 1; for (i = 0; i <= finest_level; i++) { n_factor *= n_cycle[i]; dt_level[i] = dt_0/n_factor; } } void HyperCLaw::post_timestep (int iteration) { // // Integration cycle on fine level grids is complete // do post_timestep stuff here. // int finest_level = parent->finestLevel(); if (level < finest_level) { if (do_reflux) reflux(); avgDown(); } if (level == 0) { int nstep = parent->levelSteps(0); if ((sum_interval > 0) && (nstep%sum_interval == 0) ) { sum_integrated_quantities(); } } } void HyperCLaw::post_restart () { // // Build any additional data structures after restart. // } void HyperCLaw::post_regrid (int /* lbase */, int /* new_finest */) {} void HyperCLaw::post_init (Real stop_time) { if (level > 0) return; // // Average data down from finer levels // so that conserved data is consistant between levels. // int finest_level = parent->finestLevel(); for (int k = finest_level-1; k>= 0; k--) getLevel(k).avgDown(); } int HyperCLaw::okToContinue () { if (level > 0) return 1; return parent->dtLevel(0) > dt_cutoff; } // // Return largest safe timestep that can be used. // Real HyperCLaw::advance (Real time, Real dt, int iteration, int ncycle) { int finest_level = parent->finestLevel(); if (do_reflux && level < finest_level) { // // Set reflux registers to zero. // getFluxReg(level+1).setVal(0.0); } for (int k = 0; k < NUM_STATE_TYPE; k++) { state[k].allocOldData(); state[k].swapTimeLevels(dt); } // // Get pointers to Flux registers, or set pointer to zero if not there. // FluxRegister *fine = 0; FluxRegister *current = 0; if (do_reflux && level < finest_level) fine = &getFluxReg(level+1); if (do_reflux && level > 0) current = &getFluxReg(level); // // Call LevelAdvance -- This will directly update the state. // Real dt_new = LevelAdvance(grids, get_new_data(State_Type), *this, *fine, *current, State_Type, 0, NUM_STATE, do_reflux, dt, time, geom.CellSize()); return dt_new; } void HyperCLaw::reflux () { if (!(level == parent->finestLevel())) { BL_ASSERT(do_reflux); const int ns = NUM_STATE; getFluxReg(level+1).Reflux(get_new_data(State_Type),1.0,0,0,ns,geom); } } void HyperCLaw::avgDown () { if (level == parent->finestLevel()) return; const int ncomp = NUM_STATE; HyperCLaw& fine_lev = getLevel(level+1); MultiFab& S_crse = get_new_data(State_Type); MultiFab& S_fine = fine_lev.get_new_data(State_Type); MultiFab& fvolume = fine_lev.volume; BL_ASSERT(S_crse.boxArray() == volume.boxArray()); BL_ASSERT(fvolume.boxArray() == S_fine.boxArray()); // // Coarsen() the fine stuff on processors owning the fine data. // BoxArray crse_S_fine_BA(S_fine.boxArray().size()); for (int i = 0; i < S_fine.boxArray().size(); ++i) { crse_S_fine_BA.set(i,BoxLib::coarsen(S_fine.boxArray()[i],fine_ratio)); } MultiFab crse_S_fine(crse_S_fine_BA,ncomp,0); MultiFab crse_fvolume(crse_S_fine_BA,1,0); crse_fvolume.copy(volume); for (MFIter mfi(S_fine); mfi.isValid(); ++mfi) { const int i = mfi.index(); const Box& ovlp = crse_S_fine_BA[i]; FArrayBox& crse_fab = crse_S_fine[i]; const FArrayBox& crse_vol = crse_fvolume[i]; FArrayBox& fine_fab = S_fine[i]; const FArrayBox& fine_vol = fvolume[i]; DEF_LIMITS(crse_fab,c_dat,clo,chi); DEF_CLIMITS(crse_vol,cv_dat,cvlo,cvhi); DEF_CLIMITS(fine_fab,f_dat,flo,fhi); DEF_CLIMITS(fine_vol,fv_dat,fvlo,fvhi); FORT_AVGDOWN(c_dat,ARLIM(clo), ARLIM(chi),&ncomp, cv_dat,ARLIM(cvlo),ARLIM(cvhi), f_dat,ARLIM(flo),ARLIM(fhi), fv_dat,ARLIM(fvlo),ARLIM(fvhi), ovlp.loVect(),ovlp.hiVect(),fine_ratio.getVect()); } S_crse.copy(crse_S_fine); } void HyperCLaw::allocOldData () { for (int k = 0; k < NUM_STATE_TYPE; k++) state[k].allocOldData(); } void HyperCLaw::removeOldData() { AmrLevel::removeOldData(); } void HyperCLaw::errorEst (TagBoxArray& tags, int clearval, int tagval, Real time, int n_error_buf, int ngrow) { const int* domain_lo = geom.Domain().loVect(); const int* domain_hi = geom.Domain().hiVect(); const Real* dx = geom.CellSize(); const Real* prob_lo = geom.ProbLo(); for (int j = 0; j < err_list.size(); j++) { MultiFab* mf = derive(err_list[j].name(), time, err_list[j].nGrow()); BL_ASSERT(!(mf == 0)); for (MFIter mfi(*mf); mfi.isValid(); ++mfi) { Array itags = tags[mfi].tags(); int* tptr = itags.dataPtr(); const int* tlo = tags[mfi].box().loVect(); const int* thi = tags[mfi].box().hiVect(); const int* lo = mfi.validbox().loVect(); const int* hi = mfi.validbox().hiVect(); const Real* xlo = grid_loc[mfi.index()].lo(); Real* dat = mf->get(mfi).dataPtr(); const int* dlo = mf->get(mfi).box().loVect(); const int* dhi = mf->get(mfi).box().hiVect(); const int ncomp = mf->get(mfi).nComp(); err_list[j].errFunc()(tptr, ARLIM(tlo), ARLIM(thi), &tagval, &clearval, dat, ARLIM(dlo), ARLIM(dhi), lo,hi, &ncomp, domain_lo, domain_hi, dx, xlo, prob_lo, &time, &level); // // Don't forget to set the tags in the TagBox. // tags[mfi.index()].tags(itags); } delete mf; } } Real HyperCLaw::sumDerive (const std::string& name, Real time) { Real sum = 0.0; int finest_level = parent->finestLevel(); MultiFab* mf = derive(name, time, 0); BL_ASSERT(!(mf == 0)); for (MFIter mfi(*mf); mfi.isValid(); ++mfi) { FArrayBox& fab = mf->get(mfi); if (level < finest_level) { const BoxArray& f_box = parent->boxArray(level+1); for (int j = 0; j < f_box.size(); j++) { Box c_box = BoxLib::coarsen(f_box[j],fine_ratio) & grids[mfi.index()]; if (c_box.ok()) fab.setVal(0.0,c_box,0); } } sum += fab.sum(0); } delete mf; ParallelDescriptor::ReduceRealSum(sum); return sum; } Real HyperCLaw::volWgtSum (const std::string& name, Real time) { Real sum = 0.0; int finest_level = parent->finestLevel(); int rz_flag = CoordSys::IsRZ() ? 1 : 0; const Real* dx = geom.CellSize(); MultiFab* mf = derive(name,time,0); BL_ASSERT(!(mf == 0)); for (MFIter mfi(*mf); mfi.isValid(); ++mfi) { FArrayBox& fab = mf->get(mfi); if (level < finest_level) { const BoxArray& f_box = parent->boxArray(level+1); for (int j = 0; j < f_box.size(); j++) { Box c_box = BoxLib::coarsen(f_box[j],fine_ratio) & grids[mfi.index()]; if (c_box.ok()) fab.setVal(0.0,c_box,0); } } Real s; const Real* dat = fab.dataPtr(); const int* dlo = fab.loVect(); const int* dhi = fab.hiVect(); const int* lo = grids[mfi.index()].loVect(); const int* hi = grids[mfi.index()].hiVect(); Real* rad = &radius[mfi.index()]; int irlo = lo[0]-radius_grow; int irhi = hi[0]+radius_grow; Array tmp(hi[1]-lo[1]+1); // // Note that this routine will do a volume weighted sum of // whatever quantity is passed in, not strictly the "mass". // FORT_SUMMASS(dat, ARLIM(dlo), ARLIM(dhi), lo, hi, dx, &s, rad, &irlo, &irhi, &rz_flag, tmp.dataPtr(), &lo[1], &hi[1]); sum += s; } delete mf; ParallelDescriptor::ReduceRealSum(sum); return sum; } void HyperCLaw::FillCoarseMultiFab (MultiFab& destMF, int dst_comp, Real time, int state_indx, int src_comp, int ncomp) { FillCoarsePatch(destMF,dst_comp,time,state_indx,src_comp,ncomp); } ccseapps-2.5/CCSEApps/HCAll/LevelAdvance.H0000644000175000017500000000562011634153073021247 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef LEVELADVANCE_H_ #define LEVELADVANCE_H_ // // $Id: LevelAdvance.H,v 1.13 2000/10/02 20:47:01 lijewski Exp $ // #include #include #include #include // // Forward declarations. // class AmrLevel; class FluxRegister; /*@Doc: LevelAdvance solves a system of hyperbolic conservation laws via an operator-split, second-order Godunov method. Users familiar with CCSE legacy gas dynamics codes will note that "plmde" no longer exists. The characteristic tracing and the Riemann solve have been split off into separate routines, both called from the level operator. */ Real LevelAdvance( // BoxArray where state is defined BoxArray& bx, // state on bx[level] MultiFab& levelState, // AMR level containing data AmrLevel& level, // Flux register for next finer level. FluxRegister& finer, // Flux level for current level; incremented here. FluxRegister& current, // StateType int State_Type, // First component int strtComp, // Number of state components. int numComp, // Refluxing flag int do_reflux, // Time step. Real dt, // Physical time Real time, // dx[BL_SPACEDIM] == mesh spacing. const Real* dx); #endif /*LEVELADVANCE_H_*/ ccseapps-2.5/CCSEApps/HCAll/DERIVE_F.H0000644000175000017500000001071011634153073020135 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _DERIVE_F_H_ #define _DERIVE_F_H_ /* ** $Id: DERIVE_F.H,v 1.15 2002/04/26 22:10:01 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_DERLOGS derlogs # define FORT_DERVEL dervel # define FORT_DERPRES derpres # define FORT_DERCOPY dercopy #else # ifdef BL_FORT_USE_UPPERCASE # define FORT_DERLOGS DERLOGS # define FORT_DERVEL DERVEL # define FORT_DERPRES DERPRES # define FORT_DERCOPY DERCOPY # else # ifdef BL_FORT_USE_LOWERCASE # define FORT_DERLOGS derlogs # define FORT_DERVEL dervel # define FORT_DERPRES derpres # define FORT_DERCOPY dercopy # else # define FORT_DERLOGS derlogs_ # define FORT_DERVEL dervel_ # define FORT_DERPRES derpres_ # define FORT_DERCOPY dercopy_ # endif # endif extern "C" { void FORT_DERLOGS (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* nvar, const Real* compdat, ARLIM_P(compdat_lo), ARLIM_P(compdat_hi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERVEL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* nvar, const Real* compdat, ARLIM_P(compdat_lo), ARLIM_P(compdat_hi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERPRES (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* nvar, const Real* compdat, ARLIM_P(compdat_lo), ARLIM_P(compdat_hi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERCOPY (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* nvar, const Real* compdat, ARLIM_P(compdat_lo), ARLIM_P(compdat_hi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; } #endif #endif /*_DERIVE_F_H_*/ ccseapps-2.5/CCSEApps/HCAll/LevelAdvance.cpp0000644000175000017500000004733611634153073021654 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: LevelAdvance.cpp,v 1.32 2001/09/06 21:18:07 lijewski Exp $ // #include #include #include #include #include #include #ifdef BL_USE_CHEM #include #endif enum { LeftFace, RightFace, Bottom, Top, Front, Back }; enum { interior = -1, OnPhysBndry, Buffered }; static void BoundaryStatus (const Box& grid, const Box& domain, int* boundary) { BL_ASSERT(boundary != 0); // // Determines whether any of the faces of an interior grid are touching // the physical boundary, are HYP_GROW away from the boundary, or // are > HYP_GROW away from the boundary // // Inputs: // const Box& grid -> the interior grid // const Box& domain -> the physical domain // // Outputs: // int* boundary <- flags the status of each grid face // const int ilo_diff = grid.smallEnd(0) - domain.smallEnd(0); const int jlo_diff = grid.smallEnd(1) - domain.smallEnd(1); const int ihi_diff = domain.bigEnd(0) - grid.bigEnd(0); const int jhi_diff = domain.bigEnd(1) - grid.bigEnd(1); BL_ASSERT(ilo_diff >= 0); BL_ASSERT(jlo_diff >= 0); BL_ASSERT(ihi_diff >= 0); BL_ASSERT(jhi_diff >= 0); #if (BL_SPACEDIM==3) const int klo_diff = grid.smallEnd(2) - domain.smallEnd(2); const int khi_diff = domain.bigEnd(2) - grid.bigEnd(2); BL_ASSERT(klo_diff >= 0); BL_ASSERT(khi_diff >= 0); #endif switch (ilo_diff) { case 0: boundary[LeftFace] = OnPhysBndry; break; case HYP_GROW: boundary[LeftFace] = Buffered; break; default: boundary[LeftFace] = interior; break; } switch (jlo_diff) { case 0: boundary[Bottom] = OnPhysBndry; break; case HYP_GROW: boundary[Bottom] = Buffered; break; default: boundary[Bottom] = interior; break; } switch (ihi_diff) { case 0: boundary[RightFace] = OnPhysBndry; break; case HYP_GROW: boundary[RightFace] = Buffered; break; default: boundary[RightFace] = interior; break; } switch (jhi_diff) { case 0: boundary[Top] = OnPhysBndry; break; case HYP_GROW: boundary[Top] = Buffered; break; default: boundary[Top] = interior; break; } #if (BL_SPACEDIM==3) switch (klo_diff) { case 0: boundary[Front] = OnPhysBndry; break; case HYP_GROW: boundary[Front] = Buffered; break; default: boundary[Front] = interior; break; } switch (khi_diff) { case 0: boundary[Back] = OnPhysBndry; break; case HYP_GROW: boundary[Back] = Buffered; break; default: boundary[Back] = interior; break; } #endif /*BL_SPACEDIM==3*/ } static void Flaten (FArrayBox& q, FArrayBox& flatn, FArrayBox& dp, FArrayBox& z, FArrayBox& chi, FArrayBox& p, FArrayBox& c, int numCVar, FArrayBox& qq, FArrayBox& qcen, FArrayBox& qsgn, FArrayBox& dqlim, FArrayBox& dqf, int* gBndry, int sweep) { switch (sweep) { case 0: FORT_FLATENX(BL_FAA(q),BL_FAA(flatn),BL_FAA(dp), BL_FAA(z),BL_FAA(chi),BL_FAA(p),BL_FAA(c),&numCVar); FORT_SLOPEX(BL_FAA(q),BL_FAA(qq),BL_FAA(flatn), BL_FAA(qcen),BL_FAA(qsgn), BL_FAA(dqlim), BL_FAA(dqf),&numCVar,gBndry); break; case 1: FORT_FLATENY(BL_FAA(q),BL_FAA(flatn),BL_FAA(dp), BL_FAA(z),BL_FAA(chi),BL_FAA(p),BL_FAA(c),&numCVar); FORT_SLOPEY(BL_FAA(q),BL_FAA(qq),BL_FAA(flatn), BL_FAA(qcen),BL_FAA(qsgn), BL_FAA(dqlim), BL_FAA(dqf),&numCVar,gBndry); break; #if (BL_SPACEDIM==3) case 2: FORT_FLATENZ(BL_FAA(q),BL_FAA(flatn),BL_FAA(dp), BL_FAA(z),BL_FAA(chi),BL_FAA(p),BL_FAA(c),&numCVar); FORT_SLOPEZ(BL_FAA(q),BL_FAA(qq),BL_FAA(flatn), BL_FAA(qcen),BL_FAA(qsgn), BL_FAA(dqlim), BL_FAA(dqf),&numCVar,gBndry); break; #endif /*BL_SPACEDIM==3*/ default: BoxLib::Error("Invalid value of sweep"); } } static void Trace (FArrayBox& q, FArrayBox& qq, FArrayBox& c, FArrayBox& enth, FArrayBox& qbarl, FArrayBox& qbarr, FArrayBox& dloga, FArrayBox& courno, Box& qqbx, const Real* dx, Real dt, int* bc, int* gBndry, int numCVar, int sweep) { switch (sweep) { case 0: FORT_XTRACE(BL_FAA(q), BL_FAA(qq), BL_FAA(c), BL_FAA(enth), BL_FAA(qbarl), BL_FAA(qbarr), BL_FAA(dloga),BL_FAA(courno), BL_BOXARG(qqbx), dx, &dt, bc, gBndry, &numCVar); break; case 1: FORT_YTRACE(BL_FAA(q), BL_FAA(qq), BL_FAA(c), BL_FAA(enth), BL_FAA(qbarl), BL_FAA(qbarr), BL_FAA(dloga),BL_FAA(courno), BL_BOXARG(qqbx), dx, &dt, bc, gBndry, &numCVar); break; #if (BL_SPACEDIM==3) case 2: FORT_ZTRACE(BL_FAA(q), BL_FAA(qq), BL_FAA(c), BL_FAA(enth), BL_FAA(qbarl), BL_FAA(qbarr), BL_FAA(dloga),BL_FAA(courno), BL_BOXARG(qqbx), dx, &dt, bc, gBndry, &numCVar); break; #endif /*BL_SPACEDIM==3*/ default: BoxLib::Error("Invalid value of sweep"); } } static void Update (FArrayBox& state, FArrayBox& flux, FArrayBox& pgdnv, FArrayBox& divu, FArrayBox& area, FArrayBox& vol, const Box& bx, const Real* dx, Real dt, int numComp, int sweep, int* bc, int* gBndry) { switch (sweep) { case 0: FORT_UPDATEX(BL_FAA(state), BL_FAA(flux), BL_FAA(pgdnv), BL_FAA(divu), BL_FAA(area), BL_FAA(vol), BL_BOXARG(bx), dx, &dt, &numComp, &sweep, bc, gBndry); break; case 1: FORT_UPDATEY(BL_FAA(state), BL_FAA(flux), BL_FAA(pgdnv), BL_FAA(divu), BL_FAA(area), BL_FAA(vol), BL_BOXARG(bx), dx, &dt, &numComp, &sweep, bc, gBndry); break; #if (BL_SPACEDIM==3) case 2: FORT_UPDATEZ(BL_FAA(state), BL_FAA(flux), BL_FAA(pgdnv), BL_FAA(divu), BL_FAA(area), BL_FAA(vol), BL_BOXARG(bx), dx, &dt, &numComp, &sweep, bc, gBndry); break; #endif /*BL_SPACEDIM==3*/ default: BoxLib::Error("Invalid value of sweep"); } } static Real Sweep (FArrayBox& state, FArrayBox& flux, FArrayBox& divu, const Box& bx, int* bc, int* gBndry, int numComp, int numCVar, Real dt, Real time, const Real* dx, FArrayBox& vol, FArrayBox& area, FArrayBox& dloga, int sweep) { Box bx_g2(bx); Box bx_g3(bx); Box bx_g4(bx); Box bx_g5(bx); bx_g2.grow(sweep,2); bx_g3.grow(sweep,3); bx_g4.grow(sweep,4); bx_g5.grow(sweep,5); Box flxbx(flux.box()); Box qbarbx(flxbx); qbarbx.grow(sweep,1); #ifdef BL_ADD_GRAVITY if (sweep == 2) { // // add gravity int ng(4); FORT_GRAVITY_UPDATE(BL_FAA(state), BL_BOXARG(bx), &dt, &numComp, bc, &ng); } #endif // // Derive primitive variables. // FArrayBox q(bx_g4,numCVar); FArrayBox gamc(bx_g4,1); FArrayBox p(bx_g4,1); FArrayBox c(bx_g4,1); FArrayBox csml(bx_g4,1); FORT_PRIMITIVES(BL_FAA(state), BL_FAA(q), BL_FAA(p), BL_FAA(c), BL_FAA(csml), BL_FAA(gamc), BL_BOXARG(bx_g4), bc, &numComp, &numCVar, &sweep); // // Fourth order slope calculation for x-sweep. // Box qqbx(bx); qqbx.grow(sweep,1); FArrayBox qq(qqbx,numCVar); FArrayBox flatn(qqbx,1); { // // Define temp space for 4th order slopes. // FArrayBox qcen(bx_g3,1); FArrayBox qsgn(bx_g3,1); FArrayBox dqlim(bx_g3,1); FArrayBox dqf(bx_g3,1); FArrayBox dp(bx_g2,1); FArrayBox z(bx_g2,1); FArrayBox chi(bx_g2,1); Flaten(q, flatn, dp, z, chi, p, c, numCVar, qq, qcen, qsgn, dqlim, dqf, gBndry, sweep); } Real cfl = 0; FArrayBox qbarl(qbarbx,numCVar); FArrayBox qbarr(qbarbx,numCVar); { // // Allocate space for temp arrays in tracing. // FArrayBox enth(qqbx,1); FArrayBox courno(qqbx,1); Trace(q,qq,c,enth,qbarl,qbarr,dloga,courno,qqbx, dx,dt,bc,gBndry,numCVar,sweep); cfl = courno.max(); } // // Allocate space for arrays in Riemann solver. // FArrayBox rgdnv(flxbx,1); FArrayBox ugdnv(flxbx,1); FArrayBox pgdnv(flxbx,1); FArrayBox egdnv(flxbx,1); FArrayBox utgdnv(flxbx,BL_SPACEDIM-1); #if (NADV>0) int ntrcomp = 1; #if BL_USE_CHEM ntrcomp += HyperCLaw::getChemDriver().numSpecies(); #endif FArrayBox advgdnv(flxbx,ntrcomp); #endif FArrayBox ustar(flxbx,1); int density = 0; #if (BL_SPACEDIM==2) int energy = 4; int tracer = 5; #elif (BL_SPACEDIM==3) int energy = 5; int tracer = 6; #endif FORT_RIEMANN(BL_FAA(qbarl), BL_FAA(qbarr), BL_FAA(flux), BL_FAAN(q,density), BL_FAAN(q,energy), BL_FAAN(q,tracer), BL_FAA(c), BL_FAA(csml), BL_FAA(gamc), BL_FAA(rgdnv), BL_FAA(ugdnv), BL_FAA(pgdnv), BL_FAA(egdnv), BL_FAA(utgdnv), #if (NADV>0) BL_FAA(advgdnv), #endif BL_FAA(ustar), BL_BOXARG(qqbx), &sweep, &numCVar, &numComp); // // Conservative update. // Update(state,flux,pgdnv,divu,area,vol,bx,dx,dt,numComp,sweep,bc,gBndry); #ifdef BL_USE_CHEM # ifdef BL_USE_MIB // // Do chemistry step, and set temperature. // FORT_MIB_CHEM(bx.loVect(),bx.hiVect(), state.dataPtr(),ARLIM(state.loVect()), ARLIM(state.hiVect())); # endif #endif return cfl; } Real LevelAdvance (BoxArray& grids, // => BoxArray where state is defined MultiFab& levelState, // <= state on bx[level] AmrLevel& levelData, // => level Data FluxRegister& finer, // => Flux register for next finer // level; initialized here. // &finer = 0 if finest level. FluxRegister& current, // <=> Flux level for current level; // incremented here. // ¤t = 0 if level = 0. int State_Type, // => int strtComp, // => beginning component int numStateVar, // => number of state components. int do_reflux, // => refluxing flag. Real dt, // => time step. Real time, // => time const Real* dx) // => dx[BL_SPACEDIM] = mesh spacing. { Real D_DECL(cflx, cfly, cflz); Real cfl = 0; const int numCVar = numStateVar + 1; const int nstep = levelData.nStep(); bool xySweep = 1 - nstep % 2; int i; Geometry g = levelData.Geom(); MultiFab levelVolume; g.GetVolume(levelVolume,grids,HYP_GROW); #if (BL_SPACEDIM==2) MultiFab levelDLogA[BL_SPACEDIM]; for (i = 0; i < BL_SPACEDIM ; i++) g.GetDLogA(levelDLogA[i],grids,i,HYP_GROW); #endif MultiFab levelArea[BL_SPACEDIM]; for (i = 0; i < BL_SPACEDIM ; i++) g.GetFaceArea(levelArea[i],grids,i,HYP_GROW); const int boxGrow = 5; FArrayBox divu, volume, xflux, yflux, zflux;; FArrayBox dloga[BL_SPACEDIM], area[BL_SPACEDIM]; for (FillPatchIterator fpi(levelData, levelState, boxGrow, time, State_Type, strtComp, numStateVar); fpi.isValid(); ++fpi) { int mfiindex = fpi.index(); // // Determine whether the grid is an interior grid, touching the // boundary, or HYP_GROW cells away from the boundary. // int gridBoundary[2*BL_SPACEDIM]; Box bx(fpi.UngrownBox()); BoundaryStatus(bx, levelData.Domain(), gridBoundary); // // Look at each of the faces of this grid and do the right thing. // for (OrientationIter face; face; ++face) if (gridBoundary[face()] == Buffered) bx.grow(face(), HYP_GROW); Box bx_g5(BoxLib::grow(bx,5)); Box bx_g4(BoxLib::grow(bx,4)); Box bx_g3(BoxLib::grow(bx,3)); Box bx_g2(BoxLib::grow(bx,2)); // // Create FAB for extended grid values (including boundaries) and fill. // FArrayBox& state = fpi(); Array bc = levelData.getBCArray(State_Type, mfiindex, strtComp, numStateVar); // // Calculate node-centered divergence for artificial viscosity. // divu.resize(BoxLib::surroundingNodes(bx_g4)); FORT_DIVUNODE(BL_FAA(state),BL_FAA(divu),dx,&numStateVar,gridBoundary); volume.resize(bx_g4,1); volume.copy(levelVolume[fpi]); for (i = 0; i < BL_SPACEDIM ; i++) { dloga[i].resize(bx_g4); #if (BL_SPACEDIM==2) dloga[i].copy(levelDLogA[i][mfiindex]); #else // // Hardwired for 3d Cartesian coords. // dloga[i].setVal(0.0); #endif } for (i = 0; i < BL_SPACEDIM ; i++) { area[i].resize(BoxLib::surroundingNodes(bx_g4,i)); area[i].copy(levelArea[i][mfiindex]); } // // Allocate fabs for fluxes. // Box fbx0 = BoxLib::surroundingNodes(bx,0); xflux.resize(fbx0,numStateVar); Box fbx1 = BoxLib::surroundingNodes(bx,1); yflux.resize(fbx1,numStateVar); #if (BL_SPACEDIM == 3) Box fbx2 = BoxLib::surroundingNodes(bx,2); zflux.resize(fbx2,numStateVar); #endif if (xySweep) { Box fbx00(fbx0); fbx00.grow(1,4); #if (BL_SPACEDIM == 3) fbx00.grow(2,4); Box fbx01(fbx1); fbx01.grow(2,4); yflux.resize(fbx01,numStateVar); #endif xflux.resize(fbx00,numStateVar); Box bx_0(bx); Box bx_1(bx); Box bx_2(bx); bx_0.grow(1,4); #if (BL_SPACEDIM == 3) bx_0.grow(2,4); bx_1.grow(2,4); #endif D_TERM(cflx = Sweep(state, xflux, divu, bx_0, bc.dataPtr(), gridBoundary, numStateVar, numCVar, dt, time, dx, volume, area[0], dloga[0], 0);, cfly = Sweep(state, yflux, divu, bx_1, bc.dataPtr(), gridBoundary, numStateVar, numCVar, dt, time, dx, volume, area[1], dloga[1], 1);, cflz = Sweep(state, zflux, divu, bx_2, bc.dataPtr(), gridBoundary, numStateVar, numCVar, dt, time, dx, volume, area[2], dloga[2], 2);); } else { #if (BL_SPACEDIM == 3) Box fbx12(fbx2); fbx12.grow(0,4); fbx12.grow(1,4); zflux.resize(fbx12,numStateVar); Box fbx11(fbx1); fbx11.grow(0,4); yflux.resize(fbx11,numStateVar); Box bx_0(bx); Box bx_1(bx); Box bx_2(bx); bx_2.grow(0,4); bx_2.grow(1,4); bx_1.grow(0,4); cflz = Sweep(state, zflux, divu, bx_2, bc.dataPtr(), gridBoundary, numStateVar, numCVar, dt, time, dx, volume, area[2], dloga[2], 2); cfly = Sweep(state, yflux, divu, bx_1, bc.dataPtr(), gridBoundary, numStateVar, numCVar, dt, time, dx, volume, area[1], dloga[1], 1); #elif (BL_SPACEDIM == 2) Box fbx10(fbx1); fbx10.grow(0,4); yflux.resize(fbx10,numStateVar); Box bx_0(bx); Box bx_1(bx); bx_1.grow(0,4); cfly = Sweep(state, yflux, divu, bx_1, bc.dataPtr(), gridBoundary, numStateVar, numCVar, dt, time, dx, volume, area[1], dloga[1], 1); #endif cflx = Sweep(state, xflux, divu, bx_0, bc.dataPtr(), gridBoundary, numStateVar, numCVar, dt, time, dx, volume, area[0], dloga[0], 0); } // // Copy local state back to list. // levelState[mfiindex].copy(state,grids[mfiindex],0,grids[mfiindex],0,numStateVar); D_EXPR(cfl=std::max(cflx,cfl), cfl=std::max(cfly,cfl), cfl=std::max(cflz,cfl)); if (do_reflux) { // // Fluxes expected to be in extensive form, // i.e. multiplied by the area of the edge. // if (&finer) { D_TERM(finer.CrseInit(xflux,xflux.box(),0,0,strtComp,numStateVar,-1);, finer.CrseInit(yflux,yflux.box(),1,0,strtComp,numStateVar,-1);, finer.CrseInit(zflux,zflux.box(),2,0,strtComp,numStateVar,-1);); } if (¤t) { D_TERM(current.FineAdd(xflux,0,mfiindex,0,strtComp,numStateVar,1);, current.FineAdd(yflux,1,mfiindex,0,strtComp,numStateVar,1);, current.FineAdd(zflux,2,mfiindex,0,strtComp,numStateVar,1);); } } } if (&finer) finer.CrseInitFinish(); ParallelDescriptor::ReduceRealMax(cfl); #if 0 #if BL_USE_CHEM // // Do chemistry step, and set temperature // for (MultiFabIterator mfi(levelState); mfi.isValid(); ++mfi) { const Box& box = mfi.validbox(); FArrayBox& state = mfi(); FORT_MIB_CHEM(box.loVect(),box.hiVect(), state.dataPtr(),ARLIM(state.loVect()), ARLIM(state.hiVect())); } #endif #endif return dt/cfl; } ccseapps-2.5/CCSEApps/HCAll/OpenSource.txt0000644000175000017500000002435211634153073021433 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: HyperCLaw Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/HCAll/HCAll.dsp0000644000175000017500000002316111634153073020240 0ustar amckinstryamckinstry# Microsoft Developer Studio Project File - Name="HCAll" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=HCAll - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "HCAll.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "HCAll.mak" CFG="HCAll - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "HCAll - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "HCAll - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe F90=df.exe RSC=rc.exe !IF "$(CFG)" == "HCAll - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE F90 /include:"Release/" /compile_only /nologo /warn:nofileopt # ADD F90 /include:"Release/" /compile_only /nologo /iface:cref /warn:nofileopt # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "." /I "..\amrlib" /I "..\bndrylib" /I "..\pBoxLib_2" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /D "BL_USE_DOUBLE" /D "BL_ARCH_IEEE" /D "BL_USE_NEW_HFILES" /D BL_SPACEDIM=3 /D "BL_FORT_USE_UPPERCASE" /D "BL_LANG_CC" /D for="if(0);else for" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dfor.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "HCAll - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE F90 /include:"Debug/" /compile_only /nologo /debug:full /optimize:0 /warn:nofileopt # ADD F90 /browser /include:"Debug/" /compile_only /nologo /debug:full /optimize:0 /check:bounds /iface:cref /threads /dbglibs /warn:nofileopt # SUBTRACT F90 /automatic # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /I "..\amrlib" /I "..\bndrylib" /I "..\pBoxLib_2" /D "_CONSOLE" /D "_MBCS" /D "_DEBUG" /D "WIN32" /D "BL_USE_DOUBLE" /D "BL_ARCH_IEEE" /D "BL_USE_NEW_HFILES" /D BL_SPACEDIM=3 /D "BL_FORT_USE_UPPERCASE" /D "BL_LANG_CC" /D for="if(0);else for" /D "BL_USE_MPI" /FR /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dfor.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "HCAll - Win32 Release" # Name "HCAll - Win32 Debug" # Begin Group "C++ Sources" # PROP Default_Filter "cpp" # Begin Source File SOURCE=.\DatasetClient.cpp # PROP Exclude_From_Build 1 # End Source File # Begin Source File SOURCE=.\HyperCLaw.cpp # End Source File # Begin Source File SOURCE=.\LevelAdvance.cpp # End Source File # Begin Source File SOURCE=.\main.cpp # End Source File # Begin Source File SOURCE=.\Mcc.cpp # PROP Exclude_From_Build 1 # End Source File # Begin Source File SOURCE=.\preload.cpp # PROP Exclude_From_Build 1 # End Source File # Begin Source File SOURCE=.\Prob.cpp # End Source File # End Group # Begin Group "C++ Headers" # PROP Default_Filter "h" # Begin Source File SOURCE=.\ArrayView.H # End Source File # Begin Source File SOURCE=.\DatasetClient.H # End Source File # Begin Source File SOURCE=.\DERIVE_F.H # End Source File # Begin Source File SOURCE=.\GODUNOV_F.H # End Source File # Begin Source File SOURCE=.\HyperCLaw.H # End Source File # Begin Source File SOURCE=.\HYPERCLAW_F.H # End Source File # Begin Source File SOURCE=.\LevelAdvance.H # End Source File # Begin Source File SOURCE=.\Prob.H # End Source File # Begin Source File SOURCE=.\PROB_F.H # End Source File # Begin Source File SOURCE=.\ProbBld.H # End Source File # Begin Source File SOURCE=.\probdata.H # End Source File # Begin Source File SOURCE=.\SplitIntegrator.H # End Source File # End Group # Begin Group "Fortran" # PROP Default_Filter "" # Begin Group "3D" # PROP Default_Filter "" # Begin Group "Temps" # PROP Default_Filter "for" # Begin Source File SOURCE=.\DERIVE_3D.For # End Source File # Begin Source File SOURCE=.\GODUNOV_3D.For # End Source File # Begin Source File SOURCE=.\HYPERCLAW_3D.For # End Source File # Begin Source File SOURCE=.\Prob_3d.for # End Source File # End Group # Begin Source File SOURCE=.\DERIVE_3D.F !IF "$(CFG)" == "HCAll - Win32 Release" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=.\DERIVE_3D.F InputName=DERIVE_3D "$(InputName).for" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" fpp /ansi /nologo /S. /S..\amrlib /S..\bndrylib /S..\pBoxLib_2 /DBL_LANG_FORT\ /DBL_SPACEDIM=3 /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH $(InputName).F | perl\ ..\scripts\strip72 -c > $(InputName).for # End Custom Build !ELSEIF "$(CFG)" == "HCAll - Win32 Debug" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=.\DERIVE_3D.F InputName=DERIVE_3D "$(InputName).for" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" fpp /m /ansi /nologo /S. /S..\amrlib /S..\bndrylib /S..\pBoxLib_2\ /DBL_LANG_FORT /DBL_SPACEDIM=3 /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH\ $(InputName).F | perl ..\scripts\strip72 -c > $(InputName).for # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\GODUNOV_3D.F !IF "$(CFG)" == "HCAll - Win32 Release" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=.\GODUNOV_3D.F InputName=GODUNOV_3D "$(InputName).for" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" fpp /ansi /nologo /S. /S..\amrlib /S..\bndrylib /S..\pBoxLib_2 /DBL_LANG_FORT\ /DBL_SPACEDIM=3 /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH $(InputName).F | perl\ ..\scripts\strip72 -c > $(InputName).for # End Custom Build !ELSEIF "$(CFG)" == "HCAll - Win32 Debug" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=.\GODUNOV_3D.F InputName=GODUNOV_3D "$(InputName).for" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" fpp /m /ansi /nologo /S. /S..\amrlib /S..\bndrylib /S..\pBoxLib_2\ /DBL_LANG_FORT /DBL_SPACEDIM=3 /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH\ $(InputName).F | perl ..\scripts\strip72 -c > $(InputName).for # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\HYPERCLAW_3D.F !IF "$(CFG)" == "HCAll - Win32 Release" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=.\HYPERCLAW_3D.F InputName=HYPERCLAW_3D "$(InputName).for" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" fpp /ansi /nologo /S. /S..\amrlib /S..\bndrylib /S..\pBoxLib_2 /DBL_LANG_FORT\ /DBL_SPACEDIM=3 /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH $(InputName).F | perl\ ..\scripts\strip72 -c > $(InputName).for # End Custom Build !ELSEIF "$(CFG)" == "HCAll - Win32 Debug" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=.\HYPERCLAW_3D.F InputName=HYPERCLAW_3D "$(InputName).for" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" fpp /m /ansi /nologo /S. /S..\amrlib /S..\bndrylib /S..\pBoxLib_2\ /DBL_LANG_FORT /DBL_SPACEDIM=3 /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH\ $(InputName).F | perl ..\scripts\strip72 -c > $(InputName).for # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\PROB_3D.F !IF "$(CFG)" == "HCAll - Win32 Release" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=.\PROB_3D.F InputName=PROB_3D "$(InputName).for" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" fpp /ansi /nologo /S. /S..\amrlib /S..\bndrylib /S..\pBoxLib_2 /DBL_LANG_FORT\ /DBL_SPACEDIM=3 /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH $(InputName).F | perl\ ..\scripts\strip72 -c > $(InputName).for # End Custom Build !ELSEIF "$(CFG)" == "HCAll - Win32 Debug" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=.\PROB_3D.F InputName=PROB_3D "$(InputName).for" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" fpp /m /ansi /nologo /S. /S..\amrlib /S..\bndrylib /S..\pBoxLib_2\ /DBL_LANG_FORT /DBL_SPACEDIM=3 /DBL_USE_DOUBLE /DBL_NO_FORT_FLUSH\ $(InputName).F | perl ..\scripts\strip72 -c > $(InputName).for # End Custom Build !ENDIF # End Source File # End Group # End Group # Begin Source File SOURCE=.\inputs # End Source File # End Target # End Project ccseapps-2.5/CCSEApps/COPYRIGHT0000644000175000017500000000231211634153073017150 0ustar amckinstryamckinstry(c) 1996-2000 The Regents of the University of California (through E.O. Lawrence Berkeley National Laboratory), subject to approval by the U.S. Department of Energy. Your use of this software is under license -- the license agreement is attached and included in the directory as license.txt or you may contact Berkeley Lab's Technology Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Government which consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright is obtained from the U.S. Department of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. ccseapps-2.5/CCSEApps/BoxLib/0000755000175000017500000000000011634153073017036 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/BoxLib/FArrayBox.H0000644000175000017500000003573111634153073021015 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_FARRAYBOX_H #define BL_FARRAYBOX_H // // $Id: FArrayBox.H,v 1.29 2001/08/02 16:01:43 car Exp $ // #include #include #include #include #include class FArrayBox; // //@Man: //@Memo: A Class Facilitating I/O for Fabs /*@Doc: This data-less class aids I/O for FABs and encapsulates information about the floating point format being used in output. Note that the "new" format for writing out FABs is self-describing; i.e. we can always read in a FAB written in the "new" format. For this reason, it is usually preferable to write FABs out in the native format on the machine, unless you're doing computations in 64 bit and only want to write out 32 bit FABs. With the exception of the enumeration constants, this class is primarily for FArrayBox implementors; i.e. user's shouldn't call any of the member functions in this class directly. */ class FABio { public: /*@ManDoc: An enum which controls precision of FAB output. Valid values are FAB\_FLOAT and FAB\_DOUBLE. This is deprecated; i.e. please don't use it except for reading old FABs as it will probably be going away in a later release. */ enum Precision { FAB_FLOAT = 0, FAB_DOUBLE }; /*@ManDoc: An enum which controls format of FAB output. Valid values are FAB\_ASCII, FAB\_IEEE, FAB\_NATIVE, FAB\_8BIT and FAB\_IEEE\_32; FAB\_ASCII: write the FAB out in ASCII format. FAB\_8BIT: write the FAB out with all floating-point values scaled to range 0 - 255. FAB\_NATIVE: write out floating-point values in the native format. This is usually the "best" choice of formats. FAB\_IEEE\_32: write out floating-point values in IEEE 32 bit normal format. This is recommended for use when your internal computations are done in 64 bits and you want to save space when writing out the FABs. FAB\_IEEE: this is deprecated. It is identical to FAB\_IEEE\_32. */ enum Format { FAB_ASCII = 0, FAB_IEEE, FAB_NATIVE, // // This is set to four so that when reading in an old FAB, // we don't get confused when we see an old FAB\_8BITRLE file. // FAB_8BIT = 4, FAB_IEEE_32 }; /*@ManDoc: An enum which controls byte ordering of FAB output. Valid values are FAB\_NORMAL\_ORDER, FAB\_REVERSE\_ORDER, and FAB\_REVERSE\_ORDER\_2. This is deprecated; i.e. please don't use it except for reading old FABs as it will probably be going away in a later release. These exist solely to describe the ordering of "old" FABs that you want to read. */ enum Ordering { FAB_NORMAL_ORDER, FAB_REVERSE_ORDER, FAB_REVERSE_ORDER_2 }; // // None of the member functions here are documented with doc++ // as this class really isn't meant for users. // //The virtual destructor. // virtual ~FABio (); // // Pure virtual function. Derived classes MUST override this // function to read an FArrayBox from the istream, under the // assumption that the header has alread been read. // virtual void read (std::istream& is, FArrayBox& fb) const = 0; // // Pure virtual function. Derived classes MUST override this // function to write the FArrayBox to the ostream, under the // assumption that the header for the FAB has already been // written. Write it out as if it only had num_comp components // with component comp being the first one. // virtual void write (std::ostream& os, const FArrayBox& fb, int comp, int num_comp) const = 0; // // Pure virtual function. Derived classes MUST override this // function to skip over the next FAB f in the istream, under the // assumption that the header for the FAB f has already been // skpped over. // virtual void skip (std::istream& is, FArrayBox& f) const = 0; virtual void skip (std::istream& is, FArrayBox& f, int nCompToSkip) const = 0; // // Write out a header describing FArrayBox f that contains // nvar components. It must be the case that nvar <= f.nComp(). // virtual void write_header (std::ostream& os, const FArrayBox& f, int nvar) const; // // Read in the header from the istream. // Returns a new'd FABio of the written-out type. // Complements write_header. The user is responsible // for delete'ing the returned FABio*. The FArrayBox f is // resized to be on the Box and number of components read // in from the header file. This is in preparation for // next doing a read. This is split up so that we can make // the read functions virtual, while having all the code for // detailing the type of FArrayBox that was written out in one place. // static FABio* read_header (std::istream& is, FArrayBox& f); // Same as above except create a single component fab with // data from the compIndex component of the istream fab. // Return the number of available components in the istream fab. static FABio* read_header (std::istream& is, FArrayBox& f, int compIndex, int& nCompAvailable); }; //@Man: //@Memo: A Fortran Array of REALs /*@Doc: Fortran Array Box's (generally called FAB's) are objects constructed to emulate the `FORTRAN' array. Useful operations can be performed upon FAB's in C++, and they provide a convenient interface to `FORTRAN' when it is necessary to retreat into that language. FArrayBox is derived from BaseFab. FArrayBox adds additional useful capabilities which make sense for Real types, such as I/O and L**p norms. FArrayBox's may be output in various format's with various precisions. Available formats are ascii, `IEEE 32', native, and 8bit. Ascii is self explanatory. IEEE 32 is the standard on most microprocessor based computers; it specifies that output should be in IEEE 32 bit floating point format in normal order. Native is the most efficient, but not necessarily most portable, I/O format for a given computer. 8bit is a 8 bit format, suitable for graphics output. In general, you probably want to use NATIVE, unless you need to write your data out with less precision than your computation in order to save space. The format and precision may be set in a file read by the ParmParse class by the "fab.format" variable. Allowed values are NATIVE, ASCII, 8BIT and IEEE32. FABs written using `operator<<' are always written in ASCII. FABS written using `writOn' use the FABio::Format specified with `setFormat' or the FABio::Format specified in the ParmParse file read by `init'. If the FABio::Format is not set explicitly by either of these two methods, then it defaults to NATIVE. The C pre-processor macro `BL\_SPACEDIM' must be defined to use this class. The internal precision of FARRAYBOX objects is set by defining either `BL\_USE\_FLOAT' or `BL\_USE\_DOUBLE' This is NOT a polymorphic class. This class does NOT provide a copy constructor or assignment operator. */ class FArrayBox : public BaseFab { // // FABio is a friend of ours. // friend class FABio; public: // //@ManDoc: Construct an invalid FAB with no memory. // FArrayBox (); // /*@ManDoc: Construct an initial FAB with the data space allocated but not inititialized. ncomp is the number of components (variables) at each data point in the Box. */ explicit FArrayBox (const Box& b, int ncomp=1); // FArrayBox (const FArrayBox&); // FArrayBox& operator= (const FArrayBox&); FArrayBox& operator= (const Real& r); // //@ManDoc: The destructor. // ~FArrayBox (); // // For debugging purposes we hide BaseFab version and do some extra work. // void resize (const Box& b, int N = 1); /*@ManDoc: Compute the Lp-norm of this FAB using components (scomp : scomp+ncomp-1). p < 0 -> ERROR. p = 0 -> infinity norm (max norm). p = 1 -> sum of ABS(FAB) p > 1 -> Lp-norm */ Real norm (int p = 2, int scomp = 0, int ncomp = 1) const; // //@ManDoc: Same as above except only on given subbox. // Real norm (const Box& subbox, int p = 2, int scomp = 0, int ncomp = 1) const; // //@ManDoc: Write FABs in ASCII form. // friend std::ostream& operator<< (std::ostream& os, const FArrayBox& fb); // //@ManDoc: Read FABs in ASCII form. // friend std::istream& operator>> (std::istream& is, FArrayBox& fb); /*@ManDoc: Writes out the FAB in whatever format you've set. The default format is ASCII. */ void writeOn (std::ostream& of) const; /*@ManDoc: Write only selected range of components. comp specifies from which component (starting at 0) to write at each point in space. num\_comp specifies how many data points to write out at each point is space -- it defaults to 1. It must be the case the comp >= 0 \&\& num\_comp >= 1 \&\& (comp+num\_comp) <= nComp(). The FAB is written out in whatever format you've set, with the default format being ASCII. The FAB that is written to disk will be an num\_comp component FAB. */ void writeOn (std::ostream& of, int comp, int num_comp=1) const; // //@ManDoc: Read FAB from istream. Format is as it was written out. // void readFrom (std::istream& is); /*@ManDoc: Read FAB from istream. Format is as it was written out. This creates a single component FAB with data from compIndex of the FAB from the istream. Returns the number of components available in the fab. */ int readFrom (std::istream& is, int compIndex); /*@ManDoc: Skip over the next FAB from the input stream. Return the Box defining the domain of the FAB and the number of components. */ static Box skipFAB (std::istream& is, int& num_comp); // //@ManDoc: Skip over the next FAB from the input stream. // static void skipFAB (std::istream& is); /*@ManDoc: Set the FABio::Format in the program. This is the preferred way to set the output format in "new" FABs. When desiging new programs, this should be the only function that needs to be called in order to set the format. */ static void setFormat (FABio::Format fmt); // //@ManDoc: Gets the FABio::Format set in the program. // static FABio::Format getFormat (); /*@ManDoc: Set the FABio::Ordering for reading old FABs. It does NOT set the ordering for output. This is deprecated. It exists only to facilitate reading old FABs. When you're reading in an "old" FAB, you must set the Ordering, before attempting to read it in. This is because FABs written out in the "old" format weren't self-describing; i.e. information such as the Ordering was lost when the "old" FAB was written out. */ static void setOrdering (FABio::Ordering ordering); /*@ManDoc: Gets the FABio::Ordering set in the program. This is deprecated. It does NOT do the right thing with the new FAB I/O format. */ static FABio::Ordering getOrdering (); /*@ManDoc: Set the FABio::Precision. This is deprecated. It is not useful with the "new" FAB I/O format. */ static void setPrecision (FABio::Precision precision); /*@ManDoc: Returns the FABio::Precision. This is deprecated. It is not useful with the "new" FAB I/O format. Always returns FABio::Float. */ static FABio::Precision getPrecision (); // //@ManDoc: Returns reference to the FABio object used by the program. // static const FABio& getFABio (); /*@ManDoc: Sets the FABio object used by the program. It is an error if the passed pointer `rd' is the null pointer. */ static void setFABio (FABio* rd); static bool set_do_initval (bool tf); static bool get_do_initval (); static Real set_initval (Real iv); static Real get_initval (); // // Initialize from ParmParse with "fab" prefix. // static void Initialize (); static void Finalize (); protected: // // Format and ordering for all FAB output. // This stuff exists solely to support reading old FABs. // static FABio::Format format; static FABio::Ordering ordering; // // The FABio pointer describing our output format. // static FABio* fabio; // // initial value // static bool do_initval; static Real initval; }; #endif /*BL_FARRAYBOX_H*/ ccseapps-2.5/CCSEApps/BoxLib/Banner.html0000644000175000017500000000056711634153073021141 0ustar amckinstryamckinstry

Problems with this Web page should be sent to webmaster@mothra.lbl.gov

Bugs in the software should be sent to guthamr-bugs@mothra.lbl.gov

(C)opyright by Lawrence Berkeley National Laboratory ccseapps-2.5/CCSEApps/BoxLib/Make.package0000644000175000017500000000440311634153073021231 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.37 2002/11/14 18:43:29 car Exp $ # BOXLIB_BASE=EXE ifeq ($(LBASE),box) BOXLIB_BASE=LIB endif # # Utility classes. # C$(BOXLIB_BASE)_headers += BoxLib.H BLVERSION.H C$(BOXLIB_BASE)_sources += BoxLib.cpp C$(BOXLIB_BASE)_sources += ParmParse.cpp Utility.cpp C$(BOXLIB_BASE)_headers += ParmParse.H Utility.H BLassert.H ArrayLim.H C$(BOXLIB_BASE)_headers += REAL.H CONSTANTS.H SPACE.H SPACE_F.H C$(BOXLIB_BASE)_sources += UseCount.cpp C$(BOXLIB_BASE)_headers += UseCount.H C$(BOXLIB_BASE)_sources += DistributionMapping.cpp ParallelDescriptor.cpp C$(BOXLIB_BASE)_headers += DistributionMapping.H ParallelDescriptor.H C$(BOXLIB_BASE)_sources += VisMF.cpp Arena.cpp BArena.cpp CArena.cpp C$(BOXLIB_BASE)_headers += VisMF.H Arena.H BArena.H CArena.H C$(BOXLIB_BASE)_sources += BLProfiler.cpp C$(BOXLIB_BASE)_headers += Profiler.H C$(BOXLIB_BASE)_headers += BLFort.H C$(BOXLIB_BASE)_sources += BLThread.cpp C$(BOXLIB_BASE)_headers += Thread.H C$(BOXLIB_BASE)_sources += BLWorkQueue.cpp C$(BOXLIB_BASE)_headers += WorkQueue.H ifeq ($(USE_MPI),TRUE) C$(BOXLIB_BASE)_sources += BLMpi.cpp endif # # Container classes. # T_headers += Array.H PArray.H Pointers.H Tuple.H # # FAB I/O stuff. # C${BOXLIB_BASE}_headers += FabConv.H FPC.H C${BOXLIB_BASE}_sources += FabConv.cpp FPC.cpp # # Index space. # C$(BOXLIB_BASE)_sources += Box.cpp IntVect.cpp IndexType.cpp Orientation.cpp C$(BOXLIB_BASE)_headers += Box.H IntVect.H IndexType.H Orientation.H # # Unions of rectangles. # C$(BOXLIB_BASE)_sources += BoxList.cpp BoxArray.cpp BoxDomain.cpp C$(BOXLIB_BASE)_headers += BoxList.H BoxArray.H BoxDomain.H # # FORTRAN array data. # C$(BOXLIB_BASE)_sources += FArrayBox.cpp C$(BOXLIB_BASE)_headers += FArrayBox.H C$(BOXLIB_BASE)_headers += Looping.H T_headers += BaseFab.H C$(BOXLIB_BASE)_sources += BaseFab.cpp # # FORTRAN data defined on unions of rectangles. # C$(BOXLIB_BASE)_sources += MultiFab.cpp C$(BOXLIB_BASE)_headers += MultiFab.H T_headers += FabArray.H C$(BOXLIB_BASE)_sources += FabArray.cpp T_headers += ccse-mpi.H # # Fortran interface routines. # f$(BOXLIB_BASE)_sources += BLutil_F.f f$(BOXLIB_BASE)_sources += BLParmParse_F.f f$(BOXLIB_BASE)_sources += BLBoxLib_F.f F$(BOXLIB_BASE)_sources += SPECIALIZE_$(DIM)D.F F$(BOXLIB_BASE)_headers += SPECIALIZE_F.H ccseapps-2.5/CCSEApps/BoxLib/BLMpi.w0000644000175000017500000000036711634153073020177 0ustar amckinstryamckinstry#include #include #include {{fnall fn_name MPI_Type_count MPI_Wtime }} BL_PROFILE_TIMER( bltimer, "{{fn_name}}()" ); BL_PROFILE_START( bltimer ); {{callfn}} BL_PROFILE_STOP( bltimer ); {{endfnall}} ccseapps-2.5/CCSEApps/BoxLib/IntVect.H0000644000175000017500000003662711634153073020541 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_INTVECT_H #define BL_INTVECT_H // // $Id: IntVect.H,v 1.21 2001/10/10 20:12:44 car Exp $ // #include #include #include #include #include // //@Man: //@Memo: An Integer Vector in SPACEDIM-Dimensional Space /*@Doc: The class IntVect is an implementation of an integer vector in a SPACEDIM-dimensional space. It represents a point in a discrete space. IntVect values are accessed using the operator[] function, as for a normal C++ array. In addition, the basic arithmetic operators have been overloaded to implement scaling and translation operations. */ class IntVect; namespace BoxLib { /*@ManDoc: Returns a basis vector in the given coordinate direction; eg. IntVect3d BASISV(1) == (0,1,0). Note that the coordinate directions are zero based. */ IntVect BASISV (int dir); /*@ManDoc: Returns the IntVect that is the component-wise minimum of two argument IntVects. */ IntVect min (const IntVect& p1, const IntVect& p2); /*@ManDoc: Returns the IntVect that is the component-wise minimum of two argument IntVects. */ IntVect max (const IntVect& p1, const IntVect& p2); /*@ManDoc: Returns a IntVect obtained by multiplying each of the components of this IntVect by s. */ IntVect scale (const IntVect& p, int s); /*@ManDoc: Returns an IntVect that is the reflection of input in the plane which passes through ref\_ix and normal to the coordinate direction idir. */ IntVect reflect(const IntVect& a, int ref_ix, int idir); /*@ManDoc: Returns IntVect obtained by adding s to each of the components of this IntVect. */ IntVect diagShift (const IntVect& p, int s); /*@ManDoc: Returns an IntVect that is the component-wise integer projection of p by s. */ IntVect coarsen (const IntVect& p, int s); /*@ManDoc: Returns an IntVect which is the component-wise integer projection of IntVect p1 by IntVect p2. */ IntVect coarsen (const IntVect& p1, const IntVect& p2); } // //@ManDoc: Returns p + s. // IntVect operator+ (int s, const IntVect& p); // //@ManDoc: Returns -p + s. // IntVect operator- (int s, const IntVect& p); // //@ManDoc: Returns p * s. // IntVect operator* (int s, const IntVect& p); // //@ManDoc: Print the IntVect to given output stream in ASCII. // std::ostream& operator<< (std::ostream& os, const IntVect& iv); // //@ManDoc: Read next IntVect from given input stream. // std::istream& operator>> (std::istream& os, IntVect& iv); class IntVect { friend MPI_Datatype ParallelDescriptor::Mpi_typemap::type(); public: // //@ManDoc: Construct an IntVect whose components are all zero. // IntVect (); /*@ManDoc: Construct an IntVect given the specific values for its coordinates. D\_DECL is a macro that sets the constructor to take BL\_SPACEDIM arguments. */ IntVect (D_DECL(int i, int j, int k)); /*@ManDoc: Construct an IntVect setting the coordinates to the corresponding values in the integer array a. */ explicit IntVect (const int* a); /*@ManDoc: Construct an IntVect from an Array. It is an error if the Array doesn' t have the same dimension as this IntVect. */ explicit IntVect (const Array& a); // //@ManDoc: The copy constructor. // IntVect (const IntVect& rhs); // //@ManDoc: The assignment operator. // IntVect& operator= (const IntVect& rhs); // //@ManDoc: Returns a reference to the i'th coordinate of the IntVect. // int& operator[] (int i); // //@ManDoc: Returns the i'th coordinate of the IntVect. // int operator[] (int i) const; // //@ManDoc: Set i'th coordinate of IntVect to val. // IntVect& setVal (int i, int val); /*@ManDoc: Returns a const pointer to an array of coordinates of the IntVect. Useful for arguments to FORTRAN calls. */ const int* getVect () const; /*@ManDoc: Returns true of IntVect is equivalent to argument IntVect. All comparisons between analogous components must be satisfied. */ bool operator== (const IntVect& p) const; /*@ManDoc: Returns true of IntVect is different from argument IntVect. All comparisons between analogous components must be satisfied. */ bool operator!= (const IntVect& p) const; /*@ManDoc: Returns true if IntVect is less than argument IntVect. All comparisons between analogous components must be satisfied. */ bool operator< (const IntVect& p) const; /*@ManDoc: Returns true if IntVect is less than or equal to argument IntVect. All comparisons between analogous components must be satisfied. */ bool operator<= (const IntVect& p) const; /*@ManDoc: Returns true if IntVect is greater than argument IntVect. All comparisons between analogous components must be satisfied. */ bool operator> (const IntVect& p) const; /*@ManDoc: Returns true if IntVect is greater than or equal to argument IntVect. All comparisons between analogous components must be satisfied. */ bool operator>= (const IntVect& p) const; /*@ManDoc: Returns true if this IntVect is lexically less than the argument. */ bool lexLT (const IntVect& s) const; /*@ManDoc: Returns true if this IntVect is lexically greater than the argument. */ bool lexGT (const IntVect& s) const; // //@ManDoc: Unary plus -- for completeness. // IntVect operator+ () const; // //@ManDoc: Unary Minus -- negates all components. // IntVect operator- () const; // //@ManDoc: Modifies IntVect by addition of a scaler to each component. // IntVect& operator+= (int s); // //@ManDoc: Modifies IntVect by component-wise addition with argument. // IntVect& operator+= (const IntVect& p); /*@ManDoc: Modifies IntVect by multiplication of a scaler to each component. */ IntVect& operator*= (int s); // //@ManDoc: Modifies IntVect by component-wise multiplication with argument. // IntVect& operator*= (const IntVect& p); // //@ManDoc: Modifies IntVect by division by a scaler to each component. // IntVect& operator/= (int s); // //@ManDoc: Modifies IntVect by component-wise division with argument. // IntVect& operator/= (const IntVect& p); // //@ManDoc: Modifies IntVect by subtraction of a scaler to each component. // IntVect& operator-= (int s); // //@ManDoc: Modifies IntVect by component-wise subtraction with argument. // IntVect& operator-= (const IntVect& p); // //@ManDoc: Returns component-wise sum of IntVect and argument. // IntVect operator+ (const IntVect& p) const; // //@ManDoc: Return an IntVect that is this IntVect + s. // IntVect operator+ (int s) const; // //@ManDoc: Returns component-wise difference of IntVect and argument. // IntVect operator- (const IntVect& p) const; // //@ManDoc: Return an IntVect that is this IntVect - s. // IntVect operator- (int s) const; // //@ManDoc: Returns component-wise product of IntVect and argument. // IntVect operator* (const IntVect& p) const; // //@ManDoc: Returns component-wise product of IntVect and s. // IntVect operator* (int s) const; // //@ManDoc: Returns component-wise division of IntVect by argument. // IntVect operator/ (const IntVect& p) const; // //@ManDoc: Returns component-wise division of IntVect by s. // IntVect operator/ (int s) const; // //@ManDoc: Modifies IntVect by taking component-wise min with argument. // IntVect& min (const IntVect& p); // //@ManDoc: Modifies IntVect by taking component-wise max with argument. // IntVect& max (const IntVect& p); // //@ManDoc: Modify IntVect by multiplying each coordinate by s. // IntVect& scale (int s); /*@ManDoc: Modify IntVect by reflecting it in the plane defined by the index ref\_ix and with normal in the direction of idir. */ IntVect& reflect (int ref_ix, int idir); // //@ManDoc: Modify IntVect by adding s to given coordinate. // IntVect& shift (int coord, int s); // //@ManDoc: Equivalent to shift(0,iv[0]).shift(1,iv[1]) ... // IntVect& shift (const IntVect& iv); // //@ManDoc: Modify IntVect by adding s to each coordinate. // IntVect& diagShift (int s); // //@ManDoc: Modify IntVect by component-wise integer projection. // IntVect& coarsen (const IntVect& p); // //@ManDoc: Modify IntVect by component-wise integer projection. // IntVect& coarsen (int p); /*@ManDoc: This static member function returns a reference to a constant IntVect object, all of whose BL\_SPACEDIM arguments are set to zero (0). Figuratively, it is the zero vector in BL\_SPACEDIM-dimensional space. It is provided as a convenient way to specify the zero vector. */ static const IntVect& TheZeroVector (); /*@ManDoc: This static member function returns a reference to a constant IntVect object, all of whose BL\_SPACEDIM arguments are set to one (1). Figuratively, it is the unit vector in BL\_SPACEDIM-dimensional space. It is provided as a convenient way to specify the unit vector. */ static const IntVect& TheUnitVector (); /*@ManDoc: This static member function returns a reference to a constant IntVect object, all of whose BL\_SPACEDIM arguments are set to IndexType::NODE. It is provided as a convenience to our users when defining Boxes. */ static const IntVect& TheNodeVector (); /*@ManDoc: This static member function returns a reference to a constant IntVect object, all of whose BL\_SPACEDIM arguments are set to IndexType::CELL. It is provided as a convenience to our users when defining Boxes. */ static const IntVect& TheCellVector (); protected: int vect[BL_SPACEDIM]; }; inline IntVect::IntVect () { D_EXPR(vect[0] = 0, vect[1] = 0, vect[2] = 0); } inline IntVect::IntVect (D_DECL(int i, int j, int k)) { D_EXPR(vect[0] = i, vect[1] = j, vect[2] = k); } inline IntVect::IntVect (const IntVect &iv) { D_EXPR(vect[0]=iv.vect[0], vect[1]=iv.vect[1], vect[2]=iv.vect[2]); } inline IntVect& IntVect::operator= (const IntVect &iv) { D_EXPR(vect[0]=iv.vect[0], vect[1]=iv.vect[1], vect[2]=iv.vect[2]); return *this; } inline int& IntVect::operator[] (int i) { BL_ASSERT(i>=0 && i < BL_SPACEDIM); return vect[i]; } inline int IntVect::operator[] (int i) const { BL_ASSERT(i>=0 && i < BL_SPACEDIM); return vect[i]; } inline const int* IntVect::getVect () const { return vect; } inline IntVect& IntVect::setVal (int i, int val) { BL_ASSERT(i >=0 && i < BL_SPACEDIM); vect[i] = val; return *this; } inline bool IntVect::operator== (const IntVect& p) const { return D_TERM(vect[0] == p[0], && vect[1] == p[1], && vect[2] == p[2]); } inline bool IntVect::operator!= (const IntVect& p) const { return D_TERM(vect[0] != p[0], || vect[1] != p[1], || vect[2] != p[2]); } inline bool IntVect::operator< (const IntVect& p) const { return D_TERM(vect[0] < p[0], && vect[1] < p[1], && vect[2] < p[2]); } inline bool IntVect::operator<= (const IntVect& p) const { return D_TERM(vect[0] <= p[0], && vect[1] <= p[1], && vect[2] <= p[2]); } inline bool IntVect::operator> (const IntVect& p) const { return D_TERM(vect[0] > p[0], && vect[1] > p[1], && vect[2] > p[2]); } inline bool IntVect::operator>= (const IntVect& p) const { return D_TERM(vect[0] >= p[0], && vect[1] >= p[1], && vect[2] >= p[2]); } inline IntVect IntVect::operator+ () const { return *this; } inline IntVect IntVect::operator- () const { return IntVect(D_DECL(-vect[0], -vect[1], -vect[2] )); } inline IntVect& IntVect::operator+= (int s) { D_EXPR(vect[0] += s, vect[1] += s, vect[2] += s); return *this; } inline IntVect& IntVect::operator+= (const IntVect& p) { D_EXPR(vect[0] += p[0], vect[1] += p[1], vect[2] += p[2]); return *this; } inline IntVect& IntVect::operator*= (int s) { D_EXPR(vect[0] *= s, vect[1] *= s, vect[2] *= s); return *this; } inline IntVect& IntVect::operator*= (const IntVect &p) { D_EXPR(vect[0] *= p[0], vect[1] *= p[1], vect[2] *= p[2]); return *this; } inline IntVect& IntVect::operator/= (int s) { D_EXPR(vect[0] /= s, vect[1] /= s, vect[2] /= s); return *this; } inline IntVect& IntVect::operator/= (const IntVect& p) { D_EXPR(vect[0] /= p[0], vect[1] /= p[1], vect[2] /= p[2]); return *this; } inline IntVect& IntVect::operator-= (int s) { D_EXPR(vect[0] -= s, vect[1] -= s, vect[2] -= s); return *this; } inline IntVect& IntVect::operator-= (const IntVect& p) { D_EXPR(vect[0] -= p[0], vect[1] -= p[1], vect[2] -= p[2]); return *this; } inline IntVect IntVect::operator+ (const IntVect& p) const { return IntVect(D_DECL(vect[0] + p[0], vect[1] + p[1], vect[2] + p[2])); } inline IntVect IntVect::operator+ (int s) const { return IntVect(D_DECL(vect[0] + s, vect[1] + s, vect[2] + s)); } inline IntVect IntVect::operator- (const IntVect& p) const { return IntVect(D_DECL(vect[0] - p[0], vect[1] - p[1], vect[2] - p[2])); } inline IntVect IntVect::operator- (int s) const { return IntVect(D_DECL(vect[0] - s, vect[1] - s, vect[2] - s)); } inline IntVect IntVect::operator* (const IntVect& p) const { return IntVect(D_DECL(vect[0] * p[0], vect[1] * p[1], vect[2] * p[2])); } inline IntVect IntVect::operator* (int s) const { return IntVect(D_DECL(vect[0] * s, vect[1] * s, vect[2] * s)); } inline IntVect IntVect::operator/ (const IntVect& p) const { return IntVect(D_DECL(vect[0] / p[0], vect[1] / p[1], vect[2] / p[2])); } inline IntVect IntVect::operator/ (int s) const { return IntVect(D_DECL(vect[0] / s, vect[1] / s, vect[2] / s)); } #endif /*BL_INTVECT_H*/ ccseapps-2.5/CCSEApps/BoxLib/BLassert.H0000644000175000017500000000546111634153073020674 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_BLASSERT_H #define BL_BLASSERT_H // // $Id: BLassert.H,v 1.5 2001/07/17 23:02:18 lijewski Exp $ // #include #ifdef BL_ASSERT #undef BL_ASSERT #endif #if defined(NDEBUG) /*@ManDoc: The macro BL\_ASSERT(EX) is a debugging macro, used to test the internal consistency of BoxLib, that may also be useful in user code. The argument EX is a C++ expression that you expect to always evaluate to true. When code is compiled with the DEBUG macro set to TRUE, the BL\_ASSERT(EX) macro expands to a boolean test of the expression EX. If that expression evaluates to true, nothing happens, but if the expression evaluates to false, a message is output detailing the file and line number of the BL\_ASSERT(EX) statement, as well as the literal expression EX itself, and then exits via abort() using BoxLib::Assert(). The idea is that if the assertion fails, something has gone terribly wrong somewhere. If the DEBUG macro is not set to TRUE, the BL\_ASSERT(EX) call becomes a null statement in the code, which will be eliminated by the code optimizer. */ #define BL_ASSERT(EX) ((void)0) #else #if defined(__sgi) || defined(__hpux) // // The problem here is that some brain-dead compilers cannot deal with a // void argument to the ternary operator. Currently SGI's OCC and CC on // HP-UX 9.0.1 have this problem. // #define BL_ASSERT(EX) if ((EX)) ; else BoxLib::Assert( # EX , __FILE__, __LINE__) #else #define BL_ASSERT(EX) (EX)?((void)0):BoxLib::Assert( # EX , __FILE__, __LINE__) #endif #endif #endif /*BL_BL_ASSERT_H*/ ccseapps-2.5/CCSEApps/BoxLib/Looping.H0000644000175000017500000022736311634153073020573 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_LOOPING_H #define BL_LOOPING_H // // $Id: Looping.H,v 1.13 2001/07/17 23:02:25 lijewski Exp $ // #if (BL_SPACEDIM == 1) /*@ManDoc: The macro ForAllThisPencil(T,b,ns,nc) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers. This macro acts upon the BaseFab *this. Instead of iterating over the entire Box b, it iterates over components starting at component ns and ending at component ns+nc-1, in all directions except the first coordinate direction. The user must iterate over the first coordinate direction within the ForAllThisPencil loop. The macro creates two internal reference variables; thisR that references the first element in the pencil, and thisLen that gives the length of the pencil. The first argument of the macro is a type: the type contained in the BaseFab that is being iterated over. We can rewrite the code illustrated in `ForAllThisBNN' in this form: template void BaseFab::performSetVal(const T val, const Box bx, int ns, int nc) { ForAllThisPencil(T,bx,ns,nc) { T* dog = \&thisR; for (int i = 0; i < thisLen; i++) dog[i] = val; } EndForPencil } Looping macro mnemonics: This stands for the current object C for a const X stands for a BaseFab B for a Box N for an int */ #define ForAllThisPencil(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length(); \ T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _n * _th_plen[0]); \ T &thisR = * _th_pp; \ const int thisLen = _b_len[0]; \ /*@ManDoc: The macro ForAllThisCPencil(T,b,ns,nc) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers. This is the constant version of ForAllThisPencil; i.e. it works when the underlying BaseFab is constant. Looping macro mnemonics: This stands for the current object C for a const X stands for a BaseFab B for a Box N for an int */ #define ForAllThisCPencil(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ const T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ int nR = _n; nR += 0; \ const T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _n * _th_plen[0]); \ const T &thisR = * _th_pp; \ const int thisLen = _b_len[0]; /*@ManDoc: The macro ForAllXBNN(T,x,b,ns,nc) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers. This macro acts upon the BaseFab x where the loop runs over the points in the Box b and over components starting at ns and ending at ns+nc-1. The first argument of the macro is a type: the type contained in the BaseFab that is being iterated over. The reference variable is xR, where x is literally replaced by the macros second argument. Thus an expression ForAllXBNN(int,dog,...) would have a reference variable dogR of type int. Looping macro mnemonics: This stands for the current object C for a const X stands for a BaseFab B for a Box N for an int */ #define ForAllXBNN(T,x,b,ns,nc) \ { \ BL_ASSERT(x.contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length(); \ T* _x_p = (x) .dataPtr(); \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ T *_x_pp = _x_p \ + ((_b_lo[0] - _x_plo[0]) \ + _n * _x_plen[0]); \ for(int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) { \ const int iR = _i + _b_lo[0]; \ T &x##R = * _x_pp; /*@ManDoc: The macro ForAllXCBNN(T,x,b,ns,nc) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers. This is the constant version of ForAllXBNN; i.e. it works when the underlying BaseFab is constant. Looping macro mnemonics: This stands for the current object C for a const X stands for a BaseFab B for a Box N for an int */ #define ForAllXCBNN(T,x,b,ns,nc) \ { \ BL_ASSERT(x.contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ const T* _x_p = (x).dataPtr(); \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ const T *_x_pp = _x_p \ + ((_b_lo[0] - _x_plo[0]) \ + _n * _x_plen[0]); \ for(int _i = 0; _i < _b_len[0]; ++_i) { \ const int iR = _i + _b_lo[0]; \ const T & x##R = _x_pp[_i]; /*@ManDoc: The ForAllThisBNN(T,b,ns,nc) macro is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers. This macro performs the loop over the current object (*this) where the loop runs over the points in the Box b and over components starting at ns and ending at ns+nc-1. The first argument of the macro is a type: the type contained in the BaseFab that is being iterated over. The reference variable is thisR. For example: template void BaseFab::performSetVal (const T val, const Box bx, int ns, int num) { ForAllThisBNN(T,bx,ns,num) { thisR = val; } EndFor } Looping macro mnemonics: This stands for the current object C for a const X stands for a BaseFab B for a Box N for an int */ #define ForAllThisBNN(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ int nR = _n; nR += 0; \ T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _n * _th_plen[0]); \ for(int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _b_lo[0]; iR += 0; \ T &thisR = * _th_pp; /*@ManDoc: The macro ForAllThisCBNN(T,b,ns,nc) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers. This is the constant version of ForAllThisBNN; i.e. it works when the underlying BaseFab is constant. Looping macro mnemonics: This stands for the current object C for a const X stands for a BaseFab B for a Box N for an int */ #define ForAllThisCBNN(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ const T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ const T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _n * _th_plen[0]); \ for(int _i = 0; _i < _b_len[0]; ++_i) { \ const int iR = _i + _b_lo[0]; \ const T &thisR = _th_pp[_i]; /*@ManDoc: The macro ForAllThisBNNXC(T,b,ns,nc,x,nss) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers. This macro acts upon the BaseFab *this and in addition is able to utiliize values in the const BaseFab x. The loop runs over the points in the Box b and over components starting at ns and ending at ns+nc-1. The reference variables are thisR and xR, respectively. As usual the x in xR is replaced by the macro's fifth argument. The sixth argument nss is the number of the argument in x that corresponds to the ns argument in *this. Looping macro mnemonics: This stands for the current object C for a const X stands for a BaseFab B for a Box N for an int */ #define ForAllThisBNNXC(T,b,ns,nc,x,nss) \ { \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ Box _subbox_((x).box()); \ _subbox_ &= box(); \ _subbox_ &= b; \ if(_subbox_.ok()) { \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_subbox_lo = _subbox_.loVect(); \ const int *_subbox_len = _subbox_.length().getVect(); \ T* _th_p = dataPtr(ns); \ const T* _x_p = (x).dataPtr(nss); \ for(int _n = 0; _n < (nc); ++_n) { \ int nR = _n; nR += 0; \ T *_th_pp = _th_p \ + ((_subbox_lo[0] - _th_plo[0]) \ + _n * _th_plen[0]); \ const T *_x_pp = _x_p \ + ((_subbox_lo[0] - _x_plo[0]) \ + _n * _x_plen[0]); \ for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _subbox_lo[0]; iR += 0; \ T &thisR = * _th_pp; const T & x##R = _x_pp[_i]; /*@ManDoc: The macro ForAllThisBNNXCBN(T,b,ns,nc,x,bx,nss) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers. This macro acts upon the BaseFab *this and in addition is able to utiliize values in the const BaseFab x. The loop runs over the points in the Box b with components starting at ns and ending at ns+nc-1. The reference variables are thisR and xR, respectively. As usual the x in xR is replaced by the macro's fifth argument. The sixth argument nss is the number of the argument in x that corresponds to the ns argument in *this. Box bx must be the same size as this->box() intersected with b. Looping macro mnemonics: This stands for the current object C for a const X stands for a BaseFab B for a Box N for an int */ #define ForAllThisBNNXCBN(T,b,ns,nc,x,bx,nss) \ { \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ Box _subbox_ = box(); \ _subbox_ &= b; \ BL_ASSERT(bx.sameSize(_subbox_)); \ if(_subbox_.ok()) { \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_subbox_lo = _subbox_.loVect(); \ const int *_subbox_len = _subbox_.length().getVect(); \ const int *_bx_lo = (bx).loVect(); \ /* const int *_bx_len = (bx).length().getVect(); */ \ T* _th_p = dataPtr(ns); \ const T* _x_p = (x).dataPtr(nss); \ for(int _n = 0; _n < (nc); ++_n) { \ int nR = _n + ns; nR += 0; \ int n##x##R = _n + nss; n##x##R += 0; \ T *_th_pp = _th_p \ + ((_subbox_lo[0] - _th_plo[0]) \ + _n * _th_plen[0]); \ const T *_x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) \ + _n * _x_plen[0]); \ for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _subbox_lo[0]; iR += 0; \ int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ T &thisR = * _th_pp; const T & x##R = _x_pp[_i]; /*@ManDoc: The macro ForAllThisBNNXCBNYCBN(T,b,ns,nc,x,bx,nsx,y,by,nsy) is intended to facilitate efficient looping over the contents of BaseFabs and objects derived from BaseFab. Special attention has been paid to make it work efficiently on vector supercomputers. This macro acts upon the BaseFab *this and in addition is able to utiliize values in the const BaseFab x and const BaseFab y. The loop runs over the points in the intersection of Box b with components starting at ns and ending at ns+nc-1. The reference variables are thisR, xR, and yR respectively. As usual the x in xR is replaced by the macro's fifth argument and likewise for the y in yR. The seventh argument nsx is the number of the argument in x that corresponds to the ns argument in *this, and the eighth argument nsy is the number of the argument in y that corresponds to the ns argument in *this. Boxes bx and by must be the same size as this->box() intersected with b. Looping macro mnemonics: This stands for the current object C for a const X stands for a BaseFab B for a Box N for an int */ #define ForAllThisBNNXCBNYCBN(T,b,ns,nc,x,bx,nsx,y,by,nsy) \ { \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ Box _subbox_ = box(); \ _subbox_ &= b; \ BL_ASSERT((bx).sameSize(_subbox_)); \ BL_ASSERT((by).sameSize(_subbox_)); \ if(_subbox_.ok()) { \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_y_plo = (y).loVect(); \ const int *_y_plen = (y).length(); \ const int *_subbox_lo = _subbox_.loVect(); \ const int *_subbox_len = _subbox_.length().getVect(); \ const int *_bx_lo = (bx).loVect(); \ /* const int *_bx_len = (bx).length().getVect(); */ \ const int *_by_lo = (by).loVect(); \ /* const int *_by_len = (by).length().getVect(); */ \ T* _th_p = dataPtr(ns); \ const T* _x_p = (x).dataPtr(nsx); \ const T* _y_p = (y).dataPtr(nsy); \ for(int _n = 0; _n < (nc); ++_n) { \ int nR = _n + ns; nR += 0; \ int n##x##R = _n + nsx; n##x##R += 0; \ int n##y##R = _n + nsy; n##y##R += 0; \ T *_th_pp = _th_p \ + ((_subbox_lo[0] - _th_plo[0]) \ + _n * _th_plen[0]); \ const T *_x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) \ + _n * _x_plen[0]); \ const T *_y_pp = _y_p \ + ((_by_lo[0] - _y_plo[0]) \ + _n * _y_plen[0]); \ for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _subbox_lo[0]; iR += 0; \ int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ int i##y##R = _i + _by_lo[0]; i##y##R += 0; \ T &thisR = * _th_pp; \ const T & x##R = _x_pp[_i]; \ const T & y##R = _y_pp[_i]; #define ForAllRevXBNYCBNNN(T,x,bx,nsx,y,by,nsy,nc,ri) \ { \ BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ BL_ASSERT((x).contains(bx)); \ BL_ASSERT((y).contains(by)); \ BL_ASSERT((bx).sameSize(by)); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_y_plo = (y).loVect(); \ const int *_y_plen = (y).length(); \ const int *_len = (bx).length().getVect(); \ const int *_bx_lo = (bx).loVect(); \ const int *_by_lo = (by).loVect(); \ T* _x_p = (x).dataPtr(nsx); \ const T* _y_p = (y).dataPtr(nsy); \ for(int _n = 0; _n < (nc); ++_n) { \ int n##x##R = _n + nsx; n##x##R += 0; \ int n##y##R = _n + nsy; n##y##R += 0; \ int _ix = 0; \ T *_x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) + _len[0] - 1 \ + _n * _x_plen[0]); \ const T *_y_pp = _y_p \ + ((_by_lo[0] - _y_plo[0]) \ + _n * _y_plen[0]); \ for(int _i = 0; _i < _len[0]; ++_i, --_ix) { \ T & x##R = _x_pp[_ix]; \ const T & y##R = _y_pp[_i]; /*@ManDoc: The macro EndForTX must be used to end all ForAllThisBNNXC, ForAllThisBNNXCBN and ForAllThisBNNXCBNYCBN looping constructs. */ #define EndForTX }}}} /*@ManDoc: The macro EndFor must be used to end all ForAllXBNN, ForAllXCBNN, ForAllThisBNN, and ForAllThisCBNN looping constructs. */ #define EndFor }}} /*@ManDoc: The macro EndForPencil must be used to end ForAll*Pencil looping constructs. */ #define EndForPencil }} #elif (BL_SPACEDIM == 2) #define ForAllThisCPencil(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ const T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ int nR = _n; nR += 0; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ const T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _n * _th_plen[1])); \ const T &thisR = * _th_pp; \ const int thisLen = _b_len[0]; #define ForAllThisPencil(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _n * _th_plen[1])); \ T &thisR = * _th_pp; \ const int thisLen = _b_len[0]; \ #define ForAllXBNN(T,x,b,ns,nc) \ { \ BL_ASSERT(x.contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ T* _x_p = (x) .dataPtr(); \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ T *_x_pp = _x_p \ + ((_b_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (jR - _x_plo[1]) \ + _n * _x_plen[1])); \ for(int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) { \ const int iR = _i + _b_lo[0]; \ T &x##R = * _x_pp; #define ForAllXCBNN(T,x,b,ns,nc) \ { \ BL_ASSERT(x.contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ const T* _x_p = (x).dataPtr(); \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ const T *_x_pp = _x_p \ + ((_b_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (jR - _x_plo[1]) \ + _n * _x_plen[1])); \ for(int _i = 0; _i < _b_len[0]; ++_i) { \ const int iR = _i + _b_lo[0]; \ const T & x##R = _x_pp[_i]; #define ForAllThisBNN(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ int nR = _n; nR += 0; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _n * _th_plen[1])); \ for(int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _b_lo[0]; iR += 0; \ T &thisR = * _th_pp; #define ForAllThisCBNN(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ const T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ const T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (_j + _b_lo[1] - _th_plo[1]) \ + _n * _th_plen[1])); \ for(int _i = 0; _i < _b_len[0]; ++_i) { \ const int iR = _i + _b_lo[0]; \ const T &thisR = _th_pp[_i]; #define ForAllThisBNNXC(T,b,ns,nc,x,nss) \ { \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ Box _subbox_((x).box()); \ _subbox_ &= box(); \ _subbox_ &= b; \ if(_subbox_.ok()) { \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_subbox_lo = _subbox_.loVect(); \ const int *_subbox_len = _subbox_.length().getVect(); \ T* _th_p = dataPtr(ns); \ const T* _x_p = (x).dataPtr(nss); \ for(int _n = 0; _n < (nc); ++_n) { \ int nR = _n; nR += 0; \ for(int _j = 0; _j < _subbox_len[1]; ++_j) { \ const int jR = _j + _subbox_lo[1]; \ T *_th_pp = _th_p \ + ((_subbox_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _n * _th_plen[1])); \ const T *_x_pp = _x_p \ + ((_subbox_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (jR - _x_plo[1]) \ + _n * _x_plen[1])); \ for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _subbox_lo[0]; iR += 0; \ T &thisR = * _th_pp; const T & x##R = _x_pp[_i]; #define ForAllThisBNNXCBN(T,b,ns,nc,x,bx,nss) \ { \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ Box _subbox_ = box(); \ _subbox_ &= b; \ BL_ASSERT(bx.sameSize(_subbox_)); \ if(_subbox_.ok()) { \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_subbox_lo = _subbox_.loVect(); \ const int *_subbox_len = _subbox_.length().getVect(); \ const int *_bx_lo = (bx).loVect(); \ /* const int *_bx_len = (bx).length().getVect(); */ \ T* _th_p = dataPtr(ns); \ const T* _x_p = (x).dataPtr(nss); \ for(int _n = 0; _n < (nc); ++_n) { \ int nR = _n + ns; nR += 0; \ int n##x##R = _n + nss; n##x##R += 0; \ for(int _j = 0; _j < _subbox_len[1]; ++_j) { \ const int jR = _j + _subbox_lo[1]; \ const int j##x##R = _j + _bx_lo[1]; \ T *_th_pp = _th_p \ + ((_subbox_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _n * _th_plen[1])); \ const T *_x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (j##x##R - _x_plo[1]) \ + _n * _x_plen[1])); \ for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _subbox_lo[0]; iR += 0; \ int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ T &thisR = * _th_pp; const T & x##R = _x_pp[_i]; #define ForAllThisBNNXCBNYCBN(T,b,ns,nc,x,bx,nsx,y,by,nsy) \ { \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ Box _subbox_ = box(); \ _subbox_ &= b; \ BL_ASSERT((bx).sameSize(_subbox_)); \ BL_ASSERT((by).sameSize(_subbox_)); \ if(_subbox_.ok()) { \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_y_plo = (y).loVect(); \ const int *_y_plen = (y).length(); \ const int *_subbox_lo = _subbox_.loVect(); \ const int *_subbox_len = _subbox_.length().getVect(); \ const int *_bx_lo = (bx).loVect(); \ /* const int *_bx_len = (bx).length().getVect(); */ \ const int *_by_lo = (by).loVect(); \ /* const int *_by_len = (by).length().getVect(); */ \ T* _th_p = dataPtr(ns); \ const T* _x_p = (x).dataPtr(nsx); \ const T* _y_p = (y).dataPtr(nsy); \ for(int _n = 0; _n < (nc); ++_n) { \ int nR = _n + ns; nR += 0; \ int n##x##R = _n + nsx; n##x##R += 0; \ int n##y##R = _n + nsy; n##y##R += 0; \ for(int _j = 0; _j < _subbox_len[1]; ++_j) { \ const int jR = _j + _subbox_lo[1]; \ const int j##x##R = _j + _bx_lo[1]; \ const int j##y##R = _j + _by_lo[1]; \ T *_th_pp = _th_p \ + ((_subbox_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _n * _th_plen[1])); \ const T *_x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (j##x##R - _x_plo[1]) \ + _n * _x_plen[1])); \ const T *_y_pp = _y_p \ + ((_by_lo[0] - _y_plo[0]) \ + _y_plen[0]*( \ (j##y##R - _y_plo[1]) \ + _n * _y_plen[1])); \ for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _subbox_lo[0]; iR += 0; \ int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ int i##y##R = _i + _by_lo[0]; i##y##R += 0; \ T &thisR = * _th_pp; \ const T & x##R = _x_pp[_i]; \ const T & y##R = _y_pp[_i]; #define ForAllRevXBNYCBNNN(T,x,bx,nsx,y,by,nsy,nc,ir) \ { \ BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ BL_ASSERT((ir) >= 0 && (ir) < BL_SPACEDIM); \ BL_ASSERT((x).contains(bx)); \ BL_ASSERT((y).contains(by)); \ BL_ASSERT((bx).sameSize(by)); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_y_plo = (y).loVect(); \ const int *_y_plen = (y).length(); \ const int *_bx_lo = (bx).loVect(); \ const int *_by_lo = (by).loVect(); \ const int *_len = (bx).length().getVect(); \ T* _x_p = (x).dataPtr(nsx); \ const T* _y_p = (y).dataPtr(nsy); \ for(int _n = 0; _n < (nc); ++_n) { \ int n##x##R = _n + nsx; n##x##R += 0; \ int n##y##R = _n + nsy; n##y##R += 0; \ for(int _j = 0; _j < _len[1]; ++_j) { \ const int j##x##R = _j + _bx_lo[1]; \ const int jrev##x##R = _len[1]-1-_j + _bx_lo[1]; \ const int j##y##R = _j + _by_lo[1]; \ T *_x_pp; \ int _ix = 0; \ int _istrd; \ if (ir == 0) { \ _x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) + _len[0] - 1 \ + _x_plen[0]*( \ (j##x##R - _x_plo[1]) \ + _n * _x_plen[1])); \ _istrd = -1; \ } else { \ _x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (jrev##x##R - _x_plo[1]) \ + _n * _x_plen[1])); \ _istrd = 1; \ } \ const T *_y_pp = _y_p \ + ((_by_lo[0] - _y_plo[0]) \ + _y_plen[0]*( \ (j##y##R - _y_plo[1]) \ + _n * _y_plen[1])); \ int _x_rev = _len[0]-1; _x_rev += 0; \ for(int _i = 0; _i < _len[0]; ++_i, _ix+=_istrd) { \ T & x##R = _x_pp[_ix]; \ const T & y##R = _y_pp[_i]; #define EndFor }}}} #define EndForTX }}}}} #define EndForPencil }}} #elif (BL_SPACEDIM == 3) #define ForAllThisCPencil(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ const T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ int nR = _n; nR += 0; \ for(int _k = 0; _k < _b_len[2]; ++_k) { \ const int kR = _k + _b_lo[2]; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ const T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _th_plen[1]*( \ (kR - _th_plo[2]) \ + _n * _th_plen[2]))); \ const T &thisR = * _th_pp; \ const int thisLen = _b_len[0]; #define ForAllThisPencil(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ for(int _k = 0; _k < _b_len[2]; ++_k) { \ const int kR = _k + _b_lo[2]; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _th_plen[1]*( \ (kR - _th_plo[2]) \ + _n * _th_plen[2]))); \ T &thisR = * _th_pp; \ const int thisLen = _b_len[0]; \ #define ForAllXBNN(T,x,b,ns,nc) \ { \ BL_ASSERT(x.contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ T* _x_p = (x) .dataPtr(); \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ for(int _k = 0; _k < _b_len[2]; ++_k) { \ const int kR = _k + _b_lo[2]; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ T *_x_pp = _x_p \ + ((_b_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (jR - _x_plo[1]) \ + _x_plen[1]*( \ (kR - _x_plo[2]) \ + _n * _x_plen[2]))); \ for(int _i = 0; _i < _b_len[0]; ++_i, ++_x_pp) { \ const int iR = _i + _b_lo[0]; \ T &x##R = * _x_pp; #define ForAllXCBNN(T,x,b,ns,nc) \ { \ BL_ASSERT(x.contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= (x).nComp()); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ const T* _x_p = (x).dataPtr(); \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ for(int _k = 0; _k < _b_len[2]; ++_k) { \ const int kR = _k + _b_lo[2]; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ const T *_x_pp = _x_p \ + ((_b_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (jR - _x_plo[1]) \ + _x_plen[1]*( \ (kR - _x_plo[2]) \ + _n * _x_plen[2]))); \ for(int _i = 0; _i < _b_len[0]; ++_i) { \ const int iR = _i + _b_lo[0]; \ const T & x##R = _x_pp[_i]; #define ForAllThisBNN(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ int nR = _n; nR += 0; \ for(int _k = 0; _k < _b_len[2]; ++_k) { \ const int kR = _k + _b_lo[2]; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _th_plen[1]*( \ (kR - _th_plo[2]) \ + _n * _th_plen[2]))); \ for(int _i = 0; _i < _b_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _b_lo[0]; iR += 0; \ T &thisR = * _th_pp; #define ForAllThisCBNN(T,b,ns,nc) \ { \ BL_ASSERT(contains(b)); \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_b_lo = (b).loVect(); \ const int *_b_len = (b).length().getVect(); \ const T* _th_p = dptr; \ for(int _n = (ns); _n < (ns)+(nc); ++_n) { \ const int nR = _n; \ for(int _k = 0; _k < _b_len[2]; ++_k) { \ const int kR = _k + _b_lo[2]; \ for(int _j = 0; _j < _b_len[1]; ++_j) { \ const int jR = _j + _b_lo[1]; \ const T *_th_pp = _th_p \ + ((_b_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _th_plen[1]*( \ (kR - _th_plo[2]) \ + _n * _th_plen[2]))); \ for(int _i = 0; _i < _b_len[0]; ++_i) { \ const int iR = _i + _b_lo[0]; \ const T &thisR = _th_pp[_i]; #define ForAllThisBNNXC(T,b,ns,nc,x,nss) \ { \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ Box _subbox_((x).box()); \ _subbox_ &= box(); \ _subbox_ &= b; \ if(_subbox_.ok()) { \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_subbox_lo = _subbox_.loVect(); \ const int *_subbox_len = _subbox_.length().getVect(); \ T* _th_p = dataPtr(ns); \ const T* _x_p = (x).dataPtr(nss); \ for(int _n = 0; _n < (nc); ++_n) { \ int nR = _n; nR += 0; \ for(int _k = 0; _k < _subbox_len[2]; ++_k) { \ const int kR = _k + _subbox_lo[2]; \ for(int _j = 0; _j < _subbox_len[1]; ++_j) { \ const int jR = _j + _subbox_lo[1]; \ T *_th_pp = _th_p \ + ((_subbox_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _th_plen[1]*( \ (kR - _th_plo[2]) \ + _n * _th_plen[2]))); \ const T *_x_pp = _x_p \ + ((_subbox_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (jR - _x_plo[1]) \ + _x_plen[1]*( \ (kR - _x_plo[2]) \ + _n * _x_plen[2]))); \ for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _subbox_lo[0]; iR += 0; \ T &thisR = * _th_pp; const T & x##R = _x_pp[_i]; #define ForAllThisBNNXCBN(T,b,ns,nc,x,bx,nss) \ { \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ BL_ASSERT((nss) >= 0 && (nss) + (nc) <= (x).nComp()); \ Box _subbox_(box()); \ _subbox_ &= b; \ BL_ASSERT((bx).sameSize(_subbox_)); \ if(_subbox_.ok()) { \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_subbox_lo = _subbox_.loVect(); \ const int *_subbox_len = _subbox_.length().getVect(); \ const int *_bx_lo = (bx).loVect(); \ /* const int *_bx_len = (bx).length().getVect(); */ \ T* _th_p = dataPtr(ns); \ const T* _x_p = (x).dataPtr(nss); \ for(int _n = 0; _n < (nc); ++_n) { \ int nR = _n + ns; nR += 0; \ int n##x##R = _n + nss; n##x##R += 0; \ for(int _k = 0; _k < _subbox_len[2]; ++_k) { \ const int kR = _k + _subbox_lo[2]; \ const int k##x##R = _k + _bx_lo[2]; \ for(int _j = 0; _j < _subbox_len[1]; ++_j) { \ const int jR = _j + _subbox_lo[1]; \ const int j##x##R = _j + _bx_lo[1]; \ T *_th_pp = _th_p \ + ((_subbox_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _th_plen[1]*( \ (kR - _th_plo[2]) \ + _n * _th_plen[2]))); \ const T *_x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (j##x##R - _x_plo[1]) \ + _x_plen[1]*( \ (k##x##R - _x_plo[2]) \ + _n * _x_plen[2]))); \ for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _subbox_lo[0]; iR += 0; \ int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ T &thisR = * _th_pp; const T & x##R = _x_pp[_i]; #define ForAllThisBNNXCBNYCBN(T,b,ns,nc,x,bx,nsx,y,by,nsy) \ { \ BL_ASSERT((ns) >= 0 && (ns) + (nc) <= nComp()); \ BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ Box _subbox_(box()); \ _subbox_ &= b; \ BL_ASSERT((bx).sameSize(_subbox_)); \ BL_ASSERT((by).sameSize(_subbox_)); \ if(_subbox_.ok()) { \ const int *_th_plo = loVect(); \ const int *_th_plen = length(); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_y_plo = (y).loVect(); \ const int *_y_plen = (y).length(); \ const int *_subbox_lo = _subbox_.loVect(); \ const int *_subbox_len = _subbox_.length().getVect(); \ const int *_bx_lo = (bx).loVect(); \ /* const int *_bx_len = (bx).length().getVect(); */ \ const int *_by_lo = (by).loVect(); \ /* const int *_by_len = (by).length().getVect(); */ \ T* _th_p = dataPtr(ns); \ const T* _x_p = (x).dataPtr(nsx); \ const T* _y_p = (y).dataPtr(nsy); \ for(int _n = 0; _n < (nc); ++_n) { \ int nR = _n + ns; nR += 0; \ int n##x##R = _n + nsx; n##x##R += 0; \ int n##y##R = _n + nsy; n##y##R += 0; \ for(int _k = 0; _k < _subbox_len[2]; ++_k) { \ const int kR = _k + _subbox_lo[2]; \ const int k##x##R = _k + _bx_lo[2]; \ const int k##y##R = _k + _by_lo[2]; \ for(int _j = 0; _j < _subbox_len[1]; ++_j) { \ const int jR = _j + _subbox_lo[1]; \ const int j##x##R = _j + _bx_lo[1]; \ const int j##y##R = _j + _by_lo[1]; \ T *_th_pp = _th_p \ + ((_subbox_lo[0] - _th_plo[0]) \ + _th_plen[0]*( \ (jR - _th_plo[1]) \ + _th_plen[1]*( \ (kR - _th_plo[2]) \ + _n * _th_plen[2]))); \ const T *_x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (j##x##R - _x_plo[1]) \ + _x_plen[1]*( \ (k##x##R - _x_plo[2]) \ + _n * _x_plen[2]))); \ const T *_y_pp = _y_p \ + ((_by_lo[0] - _y_plo[0]) \ + _y_plen[0]*( \ (j##y##R - _y_plo[1]) \ + _y_plen[1]*( \ (k##y##R - _y_plo[2]) \ + _n * _y_plen[2]))); \ for(int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { \ int iR = _i + _subbox_lo[0]; iR += 0; \ int i##x##R = _i + _bx_lo[0]; i##x##R += 0; \ int i##y##R = _i + _by_lo[0]; i##y##R += 0; \ T &thisR = * _th_pp; \ const T & x##R = _x_pp[_i]; \ const T & y##R = _y_pp[_i]; #define ForAllRevXBNYCBNNN(T,x,bx,nsx,y,by,nsy,nc,ir) \ { \ BL_ASSERT((ir) >= 0 && (ir) < BL_SPACEDIM); \ BL_ASSERT((nsx) >= 0 && (nsx) + (nc) <= (x).nComp()); \ BL_ASSERT((nsy) >= 0 && (nsy) + (nc) <= (y).nComp()); \ BL_ASSERT((x).contains(bx)); \ BL_ASSERT((y).contains(by)); \ BL_ASSERT((bx).sameSize(by)); \ const int *_x_plo = (x).loVect(); \ const int *_x_plen = (x).length(); \ const int *_y_plo = (y).loVect(); \ const int *_y_plen = (y).length(); \ const int *_bx_lo = (bx).loVect(); \ const int *_by_lo = (by).loVect(); \ const int *_len = (bx).length().getVect(); \ T* _x_p = (x).dataPtr(nsx); \ const T* _y_p = (y).dataPtr(nsy); \ for(int _n = 0; _n < (nc); ++_n) { \ int n##x##R = _n + nsx; n##x##R += 0; \ int n##y##R = _n + nsy; n##y##R += 0; \ for(int _k = 0; _k < _len[2]; ++_k) { \ const int k##x##R = _k + _bx_lo[2]; \ const int krev##x##R = _len[2]-1-_k + _bx_lo[2]; \ const int k##y##R = _k + _by_lo[2]; \ for(int _j = 0; _j < _len[1]; ++_j) { \ const int j##x##R = _j + _bx_lo[1]; \ const int jrev##x##R = _len[1]-1-_j + _bx_lo[1]; \ const int j##y##R = _j + _by_lo[1]; \ T *_x_pp; \ int _ix = 0; \ int _istrd = 1; \ if (ir == 0) { \ _x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) + _len[0]-1 \ + _x_plen[0]*( \ (j##x##R - _x_plo[1]) \ + _x_plen[1]*( \ (k##x##R - _x_plo[2]) \ + _n * _x_plen[2]))); \ _istrd = -1; \ } else if (ir == 1) { \ _x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (jrev##x##R - _x_plo[1]) \ + _x_plen[1]*( \ (k##x##R - _x_plo[2]) \ + _n * _x_plen[2]))); \ } else { \ _x_pp = _x_p \ + ((_bx_lo[0] - _x_plo[0]) \ + _x_plen[0]*( \ (j##x##R - _x_plo[1]) \ + _x_plen[1]*( \ (krev##x##R - _x_plo[2]) \ + _n * _x_plen[2]))); \ } \ const T *_y_pp = _y_p \ + ((_by_lo[0] - _y_plo[0]) \ + _y_plen[0]*( \ (j##y##R - _y_plo[1]) \ + _y_plen[1]*( \ (k##y##R - _y_plo[2]) \ + _n * _y_plen[2]))); \ for(int _i = 0; _i < _len[0]; ++_i, _ix += _istrd) { \ T & x##R = _x_pp[_ix]; \ const T & y##R = _y_pp[_i]; #define EndFor }}}}} #define EndForTX }}}}}} #define EndForPencil }}}} #endif /*@ManDoc: The macro ForAllX(T,x) is a shortened form of `ForAllXBNN' where the Box defaults to the domain of x and the components run over all the components of x. */ #define ForAllX(T,x) ForAllXBNN(T,x,((x).box()),0,((x).nComp())) /*@ManDoc: The macro ForAllXC(T,x) is the constant form of ForAllX(T,x). */ #define ForAllXC(T,x) ForAllXCBNN(T,x,((x).box()),0,((x).nComp())) /*@ManDoc: The macro ForAllXB(T,x,b) is a shortened form of `ForAllXBNN' where the components run over all the components of x. */ #define ForAllXB(T,x,b) ForAllXBNN(T,x,(b),0,(x).nComp()) /*@ManDoc: The macro ForAllXBC(T,x,b) is the constant form of ForAllXB(T,x,b). */ #define ForAllXBC(T,x,b) ForAllXCBNN(T,x,(b),0,(x).nComp()) /*@ManDoc: The macro ForAllThis(T) is a shortened form of `ForAllThisBNN' where the Box defaults to the domain of x and the components run over all the components of x. */ #define ForAllThis(T) ForAllThisBNN(T,domain,0,nComp()) /*@ManDoc: The macro ForAllThisC(T) is the constant form of ForAllThis(T). */ #define ForAllThisC(T) ForAllThisCBNN(T,domain,0,nComp()) /*@ManDoc: The macro ForAllThisB(T,b) is a shortened form of `ForAllThisBNN' where the components run over all the components of x. */ #define ForAllThisB(T,b) ForAllThisBNN(T,(b),0,nComp()) /*@ManDoc: The macro ForAllThisCB(T,b) is the constant form of ForAllThisB(T,b). */ #define ForAllThisCB(T,b) ForAllThisCBNN(T,(b),0,nComp()) /*@ManDoc: The macro ForAllThisNN(T,ns,nc) is a shortened form of `ForAllThisBNN' where the Box defaults to the domain of *this. */ #define ForAllThisNN(T,ns,nc) ForAllThisBNN(T,domain,ns,nc) /*@ManDoc: The macro ForAllThisXC(T,x) is a shortened form of `ForAllThisBNNXC' where the Box defaults to the domain of *this and the components run over all the components of *this. */ #define ForAllThisXC(T,x) ForAllThisBNNXC(T,domain,0,nComp(),x,0) #endif /*BL_LOOPING_H*/ ccseapps-2.5/CCSEApps/BoxLib/DistributionMapping.cpp0000644000175000017500000006325111634153073023544 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: DistributionMapping.cpp,v 1.66 2003/03/07 16:59:25 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include #include static int verbose = 0; static double max_efficiency = .95; // // Everyone uses the same Strategy -- defaults to KNAPSACK. // DistributionMapping::Strategy DistributionMapping::m_Strategy = DistributionMapping::KNAPSACK; DistributionMapping::PVMF DistributionMapping::m_BuildMap = &DistributionMapping::KnapSackProcessorMap; const Array& DistributionMapping::ProcessorMap () const { return m_procmap; } DistributionMapping::Strategy DistributionMapping::strategy () { return DistributionMapping::m_Strategy; } int DistributionMapping::CacheSize () { return m_Cache.size(); } void DistributionMapping::strategy (DistributionMapping::Strategy how) { DistributionMapping::m_Strategy = how; switch (how) { case ROUNDROBIN: m_BuildMap = &DistributionMapping::RoundRobinProcessorMap; break; case KNAPSACK: m_BuildMap = &DistributionMapping::KnapSackProcessorMap; break; default: BoxLib::Error("Bad DistributionMapping::Strategy"); } } // // We start out uninitialized. // bool DistributionMapping::m_Initialized = false; bool DistributionMapping::operator== (const DistributionMapping& rhs) const { return m_procmap == rhs.m_procmap; } bool DistributionMapping::operator!= (const DistributionMapping& rhs) const { return !operator==(rhs); } void DistributionMapping::Initialize () { DistributionMapping::m_Initialized = true; ParmParse pp("DistributionMapping"); pp.query("verbose", verbose); pp.query("efficiency", max_efficiency); std::string theStrategy; if (pp.query("strategy", theStrategy)) { if (theStrategy == "ROUNDROBIN") { strategy(ROUNDROBIN); } else if (theStrategy == "KNAPSACK") { strategy(KNAPSACK); } else { std::string msg("Unknown strategy: "); msg += theStrategy; BoxLib::Warning(msg.c_str()); } } } void DistributionMapping::Finalize () {} // // Our cache of processor maps. // std::vector< Array > DistributionMapping::m_Cache; bool DistributionMapping::GetMap (const BoxArray& boxes) { const int N = boxes.size(); BL_ASSERT(m_procmap.size() == N + 1); // // Search from back to front ... // for (int i = m_Cache.size() - 1; i >= 0; i--) { if (m_Cache[i].size() == N + 1) { const Array& cached_procmap = m_Cache[i]; for (int i = 0; i <= N; i++) m_procmap[i] = cached_procmap[i]; BL_ASSERT(m_procmap[N] == ParallelDescriptor::MyProc()); return true; } } return false; } DistributionMapping::DistributionMapping () {} DistributionMapping::DistributionMapping (const BoxArray& boxes, int nprocs) : m_procmap(boxes.size()+1) { define(boxes,nprocs); } DistributionMapping::DistributionMapping (const DistributionMapping& d1, const DistributionMapping& d2) { const Array& pmap_1 = d1.ProcessorMap(); const Array& pmap_2 = d2.ProcessorMap(); const int L1 = pmap_1.size() - 1; // Length not including sentinel. const int L2 = pmap_2.size() - 1; // Length not including sentinel. m_procmap.resize(L1+L2+1); for (int i = 0; i < L1; i++) m_procmap[i] = pmap_1[i]; for (int i = L1, j = 0; j < L2; i++, j++) m_procmap[i] = pmap_2[j]; // // Set sentinel equal to our processor number. // m_procmap[m_procmap.size()-1] = ParallelDescriptor::MyProc(); } void DistributionMapping::define (const BoxArray& boxes, int nprocs) { if (!(m_procmap.size() == boxes.size()+1)) m_procmap.resize(boxes.size()+1); if (DistributionMapping::m_Strategy == ROUNDROBIN) { // // Don't bother with the cache -- just do it :-) // (this->*m_BuildMap)(boxes,nprocs); } else { if (!GetMap(boxes)) { (this->*m_BuildMap)(boxes,nprocs); #if defined(BL_USE_MPI) && !defined(BL_NO_PROCMAP_CACHE) // // We always append new processor maps. // DistributionMapping::m_Cache.push_back(m_procmap); #endif } } } DistributionMapping::~DistributionMapping () {} void DistributionMapping::FlushCache () { DistributionMapping::m_Cache.clear(); } void DistributionMapping::AddToCache (const DistributionMapping& dm) { bool doit = true; const Array& pmap = dm.ProcessorMap(); if (pmap.size() > 0) { BL_ASSERT(pmap[pmap.size()-1] == ParallelDescriptor::MyProc()); for (unsigned int i = 0; i < m_Cache.size() && doit; i++) { if (pmap.size() == m_Cache[i].size()) { BL_ASSERT(pmap == m_Cache[i]); doit = false; } } if (doit) m_Cache.push_back(pmap); } } void DistributionMapping::RoundRobinProcessorMap (int nboxes, int nprocs) { BL_ASSERT(nboxes > 0); m_procmap.resize(nboxes+1); for (int i = 0; i < nboxes; i++) m_procmap[i] = i % nprocs; // // Set sentinel equal to our processor number. // m_procmap[nboxes] = ParallelDescriptor::MyProc(); } void DistributionMapping::RoundRobinProcessorMap (const BoxArray& boxes, int nprocs) { BL_ASSERT(boxes.size() > 0); BL_ASSERT(m_procmap.size() == boxes.size()+1); for (int i = 0; i < boxes.size(); i++) m_procmap[i] = i % nprocs; // // Set sentinel equal to our processor number. // m_procmap[boxes.size()] = ParallelDescriptor::MyProc(); } class WeightedBox { int m_boxid; long m_weight; public: WeightedBox () {} WeightedBox (int b, int w) : m_boxid(b), m_weight(w) {} long weight () const { return m_weight; } int boxid () const { return m_boxid; } bool operator< (const WeightedBox& rhs) const { return weight() > rhs.weight(); } }; class WeightedBoxList { std::list m_lb; long m_weight; public: WeightedBoxList() : m_weight(0) {} long weight () const { return m_weight; } void erase (std::list::iterator& it) { m_weight -= (*it).weight(); m_lb.erase(it); } void push_back (const WeightedBox& bx) { m_weight += bx.weight(); m_lb.push_back(bx); } std::list::const_iterator begin () const { return m_lb.begin(); } std::list::iterator begin () { return m_lb.begin(); } std::list::const_iterator end () const { return m_lb.end(); } std::list::iterator end () { return m_lb.end(); } bool operator< (const WeightedBoxList& rhs) const { return weight() > rhs.weight(); } }; static std::vector< std::list > knapsack (const std::vector& pts, int nprocs) { BL_PROFILE("knapsack()"); const Real strttime = ParallelDescriptor::second(); // // Sort balls by size largest first. // static std::list empty_list; // Work-around MSVC++ bug :-( std::vector< std::list > result(nprocs, empty_list); std::vector lb; lb.reserve(pts.size()); for (unsigned int i = 0; i < pts.size(); ++i) { lb.push_back(WeightedBox(i, pts[i])); } BL_ASSERT(lb.size() == pts.size()); std::sort(lb.begin(), lb.end()); BL_ASSERT(lb.size() == pts.size()); // // For each ball, starting with heaviest, assign ball to the lightest box. // std::priority_queue wblq; for (int i = 0; i < nprocs; ++i) { wblq.push(WeightedBoxList()); } BL_ASSERT(int(wblq.size()) == nprocs); for (unsigned int i = 0; i < pts.size(); ++i) { WeightedBoxList wbl = wblq.top(); wblq.pop(); wbl.push_back(lb[i]); wblq.push(wbl); } BL_ASSERT(int(wblq.size()) == nprocs); std::list wblqg; while (!wblq.empty()) { wblqg.push_back(wblq.top()); wblq.pop(); } BL_ASSERT(int(wblqg.size()) == nprocs); wblqg.sort(); // // Compute the max weight and the sum of the weights. // double max_weight = 0; double sum_weight = 0; std::list::iterator it = wblqg.begin(); for ( ; it != wblqg.end(); ++it) { long wgt = (*it).weight(); sum_weight += wgt; max_weight = (wgt > max_weight) ? wgt : max_weight; } double efficiency = sum_weight/(nprocs*max_weight); top: std::list::iterator it_top = wblqg.begin(); WeightedBoxList wbl_top = *it_top; // // For each ball in the heaviest box. // std::list::iterator it_wb = wbl_top.begin(); if (efficiency > max_efficiency) goto bottom; for ( ; it_wb != wbl_top.end(); ++it_wb ) { // // For each ball not in the heaviest box. // std::list::iterator it_chk = it_top; it_chk++; for ( ; it_chk != wblqg.end(); ++it_chk) { WeightedBoxList wbl_chk = *it_chk; std::list::iterator it_owb = wbl_chk.begin(); for ( ; it_owb != wbl_chk.end(); ++it_owb) { // // If exchanging these two balls reduces the load balance, // then exchange them and go to top. The way we are doing // things, sum_weight cannot change. So the efficiency will // increase if after we switch the two balls *it_wb and // *it_owb the max weight is reduced. // double w_tb = (*it_top).weight() + (*it_owb).weight() - (*it_wb).weight(); double w_ob = (*it_chk).weight() + (*it_wb).weight() - (*it_owb).weight(); // // If the other ball reduces the weight of the top box when // swapped, then it will change the efficiency. // if (w_tb < (*it_top).weight() && w_ob < (*it_top).weight()) { // // Adjust the sum weight and the max weight. // WeightedBox wb = *it_wb; WeightedBox owb = *it_owb; wblqg.erase(it_top); wblqg.erase(it_chk); wbl_top.erase(it_wb); wbl_chk.erase(it_owb); wbl_top.push_back(owb); wbl_chk.push_back(wb); std::list tmp; tmp.push_back(wbl_top); tmp.push_back(wbl_chk); tmp.sort(); wblqg.merge(tmp); max_weight = (*wblqg.begin()).weight(); efficiency = sum_weight/(nprocs*max_weight); goto top; } } } } bottom: if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "knapsack: efficiency = " << efficiency << std::endl; // // Here I am "load-balanced". // std::list::const_iterator cit = wblqg.begin(); for (int i = 0; i < nprocs; ++i) { const WeightedBoxList& wbl = *cit; std::list::const_iterator it1 = wbl.begin(); for ( ; it1 != wbl.end(); ++it1) { result[i].push_back((*it1).boxid()); } ++cit; } const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real stoptime = ParallelDescriptor::second() - strttime; if (verbose) { ParallelDescriptor::ReduceRealMax(stoptime,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "knapsack() time: " << stoptime << std::endl; } return result; } //static //int //HeaviestCPU (const std::vector& percpu) //{ // return std::distance(percpu.begin(),std::max_element(percpu.begin(),percpu.end())); //} static void SwapAndTest (const std::map< int,std::vector,std::greater >& samesize, const std::vector< std::vector >& nbrs, std::vector& procmap, std::vector& percpu, bool& swapped) { // int Hvy = HeaviestCPU(percpu); for (std::map< int,std::vector,std::greater >::const_iterator it = samesize.begin(); it != samesize.end(); ++it) { if (verbose > 1 && ParallelDescriptor::IOProcessor()) std::cout << "Trying to swap boxes of size: " << it->first << "\n"; for (std::vector::const_iterator lit1 = it->second.begin(); lit1 != it->second.end(); ++lit1) { std::vector::const_iterator lit2 = lit1; lit2++; for ( ; lit2 != it->second.end(); ++lit2) { BL_ASSERT(*lit1 != *lit2); // // Don't consider Boxes on the same CPU. // if (procmap[*lit1] == procmap[*lit2]) continue; // // Only swaps between CPU of highest latency to another. // // if (procmap[*lit1] != Hvy && procmap[*lit2] != Hvy) continue; // // Will swapping these boxes decrease latency? // const long percpu_lit1 = percpu[procmap[*lit1]]; const long percpu_lit2 = percpu[procmap[*lit2]]; // // Now change procmap & redo necessary calculations ... // std::swap(procmap[*lit1],procmap[*lit2]); // // Update percpu[] in place. // for (std::vector::const_iterator it = nbrs[*lit1].begin(); it != nbrs[*lit1].end(); ++it) { if (procmap[*it] == procmap[*lit2]) { percpu[procmap[*lit1]]++; percpu[procmap[*lit2]]++; } else if (procmap[*it] == procmap[*lit1]) { percpu[procmap[*lit1]]--; percpu[procmap[*lit2]]--; } else { percpu[procmap[*lit2]]--; percpu[procmap[*lit1]]++; } } for (std::vector::const_iterator it = nbrs[*lit2].begin(); it != nbrs[*lit2].end(); ++it) { if (procmap[*it] == procmap[*lit1]) { percpu[procmap[*lit1]]++; percpu[procmap[*lit2]]++; } else if (procmap[*it] == procmap[*lit2]) { percpu[procmap[*lit1]]--; percpu[procmap[*lit2]]--; } else { percpu[procmap[*lit1]]--; percpu[procmap[*lit2]]++; } } const long cost_old = percpu_lit1+percpu_lit2; const long cost_new = percpu[procmap[*lit1]]+percpu[procmap[*lit2]]; if (cost_new < cost_old) { swapped = true; // Hvy = HeaviestCPU(percpu); if (verbose > 2 && ParallelDescriptor::IOProcessor()) std::cout << "Swapping " << *lit1 << " & " << *lit2 << "\n"; } else { // // Undo our changes ... // std::swap(procmap[*lit1],procmap[*lit2]); percpu[procmap[*lit1]] = percpu_lit1; percpu[procmap[*lit2]] = percpu_lit2; } } } } } // // Try to "improve" the knapsack()d procmap ... // static void MinimizeCommCosts (std::vector& procmap, const BoxArray& ba, const std::vector& pts, int nprocs) { BL_PROFILE("MinimizeCommCosts()"); BL_ASSERT(ba.size() == pts.size()); BL_ASSERT(procmap.size() >= ba.size()); if (nprocs < 2) return; const Real strttime = ParallelDescriptor::second(); // // Build a data structure that'll tell us who are our neighbors. // std::vector< std::vector > nbrs(ba.size()); // // Our "grow" factor; i.e. how far our tentacles grope for our neighbors. // const int Ngrow = 1; BoxArray grown(ba.size()); for (int i = 0; i < ba.size(); i++) { grown.set(i,BoxLib::grow(ba[i],Ngrow)); } for (int i = 0; i < grown.size(); i++) { std::list li; for (int j = 0; j < grown.size(); j++) { if (i != j) { const Box isect = grown[i] & grown[j]; if (isect.ok()) { li.push_back(j); } } } nbrs[i].resize(li.size()); int k = 0; for (std::list::const_iterator it = li.begin(); it != li.end(); ++it, ++k) { nbrs[i][k] = *it; } } if (verbose > 1 && ParallelDescriptor::IOProcessor()) { std::cout << "The neighbors list:\n"; for (int i = 0; i < nbrs.size(); i++) { std::cout << i << "\t:"; for (std::vector::const_iterator it = nbrs[i].begin(); it != nbrs[i].end(); ++it) { std::cout << *it << ' '; } std::cout << "\n"; } } // // Want lists of box IDs having the same size. // std::map< int,std::vector,std::greater > samesize; for (int i = 0; i < pts.size(); i++) { samesize[pts[i]].push_back(i); } if (verbose > 1 && ParallelDescriptor::IOProcessor()) { std::cout << "Boxes sorted via numPts():\n"; for (std::map< int,std::vector,std::greater >::const_iterator it = samesize.begin(); it != samesize.end(); ++it) { std::cout << it->first << "\t:"; for (std::vector::const_iterator lit = it->second.begin(); lit != it->second.end(); ++lit) { std::cout << *lit << ' '; } std::cout << "\n"; } } // // Build a data structure to maintain the latency count on a per-CPU basis. // std::vector percpu(nprocs,0); for (int i = 0; i < nbrs.size(); i++) { for (std::vector::const_iterator it = nbrs[i].begin(); it != nbrs[i].end(); ++it) { if (procmap[i] != procmap[*it]) percpu[procmap[*it]]++; } } if (verbose > 1 && ParallelDescriptor::IOProcessor()) { long cnt = 0; for (int i = 0; i < percpu.size(); i++) cnt += percpu[i]; std::cout << "Initial off-CPU connection count: " << cnt << std::endl; std::cout << "Initial per-CPU latency distribution:\n"; long mn = cnt, mx = 0; for (int i = 0; i < percpu.size(); i++) { mn = std::min(mn,percpu[i]); mx = std::max(mx,percpu[i]); std::cout << "CPU: " << i << '\t' << percpu[i] << '\n'; } std::cout << "Knapsack: initial communication efficiency: " << double(mn)/double(mx) << '\n'; } // // Now need to swap boxes of equal size & see if global minimum decreases. // bool swapped; // // Then minimize number of off-CPU messages. // do { swapped = false; SwapAndTest(samesize,nbrs,procmap,percpu,swapped); } while (swapped); if (verbose > 1 && ParallelDescriptor::IOProcessor()) { long cnt = 0; for (int i = 0; i < percpu.size(); i++) cnt += percpu[i]; std::cout << "Final off-CPU connection count: " << cnt << std::endl; std::cout << "Final per-CPU latency distribution:\n"; long mn = cnt, mx = 0; for (int i = 0; i < percpu.size(); i++) { mn = std::min(mn,percpu[i]); mx = std::max(mx,percpu[i]); std::cout << "CPU " << i << ":\t" << percpu[i] << '\n'; } std::cout << "Knapsack: final communication efficiency: " << double(mn)/double(mx) << '\n'; } const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real stoptime = ParallelDescriptor::second() - strttime; if (verbose) { ParallelDescriptor::ReduceRealMax(stoptime,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "MinimizeCommCosts() time: " << stoptime << std::endl; } } void DistributionMapping::KnapSackProcessorMap (const std::vector& pts, int nprocs) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::KnapSackProcessorMap(vector,"); BL_ASSERT(pts.size() > 0); m_procmap.resize(pts.size()+1); if (int(pts.size()) <= nprocs || nprocs < 2) { RoundRobinProcessorMap(pts.size(),nprocs); } else { std::vector< std::list > vec = knapsack(pts,nprocs); BL_ASSERT(int(vec.size()) == nprocs); std::list::iterator lit; for (unsigned int i = 0; i < vec.size(); i++) { for (lit = vec[i].begin(); lit != vec[i].end(); ++lit) { m_procmap[*lit] = i; } } // // Set sentinel equal to our processor number. // m_procmap[pts.size()] = ParallelDescriptor::MyProc(); } } void DistributionMapping::KnapSackProcessorMap (const BoxArray& boxes, int nprocs) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::KnapSackProcessorMap"); BL_ASSERT(boxes.size() > 0); BL_ASSERT(m_procmap.size() == boxes.size()+1); if (boxes.size() <= nprocs || nprocs < 2) { RoundRobinProcessorMap(boxes,nprocs); } else { std::vector pts(boxes.size()); for (unsigned int i = 0; i < pts.size(); i++) pts[i] = boxes[i].numPts(); std::vector< std::list > vec = knapsack(pts,nprocs); BL_ASSERT(int(vec.size()) == nprocs); std::list::iterator lit; for (unsigned int i = 0; i < vec.size(); i++) { for (lit = vec[i].begin(); lit != vec[i].end(); ++lit) { m_procmap[*lit] = i; } } MinimizeCommCosts(m_procmap,boxes,pts,nprocs); // // Set sentinel equal to our processor number. // m_procmap[boxes.size()] = ParallelDescriptor::MyProc(); } } void DistributionMapping::CacheStats (std::ostream& os) { os << "The DistributionMapping cache contains " << DistributionMapping::m_Cache.size() << " Processor Map(s):\n"; if (!DistributionMapping::m_Cache.empty()) { for (unsigned int i = 0; i < m_Cache.size(); i++) { os << "\tMap #" << i << " is of length " << m_Cache[i].size() << '\n'; } os << '\n'; } } std::ostream& operator<< (std::ostream& os, const DistributionMapping& pmap) { os << "(DistributionMapping" << '\n'; // // Do not print the sentinel value. // for (int i = 0; i < pmap.ProcessorMap().size() - 1; i++) { os << "m_procmap[" << i << "] = " << pmap.ProcessorMap()[i] << '\n'; } os << ')' << '\n'; if (os.fail()) BoxLib::Error("operator<<(ostream &, DistributionMapping &) failed"); return os; } ccseapps-2.5/CCSEApps/BoxLib/MultiFab.cpp0000644000175000017500000004630211634153073021252 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MultiFab.cpp,v 1.70 2002/12/11 17:02:16 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include void MultiFab::Copy (MultiFab& dst, const MultiFab& src, int srccomp, int dstcomp, int numcomp, int nghost) { BL_ASSERT(dst.boxArray() == src.boxArray()); BL_ASSERT(dst.distributionMap == src.distributionMap); BL_ASSERT(dst.nGrow() >= nghost && src.nGrow() >= nghost); for (MFIter mfi(dst); mfi.isValid(); ++mfi) { Box bx = BoxLib::grow(mfi.validbox(),nghost); if (bx.ok()) dst[mfi].copy(src[mfi], bx, srccomp, bx, dstcomp, numcomp); } } void MultiFab::FillBoundary () { FillBoundary(0, n_comp); } void MultiFab::plus (Real val, int nghost) { plus(val,0,n_comp,nghost); } void MultiFab::plus (Real val, const Box& region, int nghost) { plus(val,region,0,n_comp,nghost); } void MultiFab::mult (Real val, int nghost) { mult(val,0,n_comp,nghost); } void MultiFab::mult (Real val, const Box& region, int nghost) { mult(val,region,0,n_comp,nghost); } void MultiFab::invert (Real numerator, int nghost) { invert(numerator,0,n_comp,nghost); } void MultiFab::invert (Real numerator, const Box& region, int nghost) { invert(numerator,region,0,n_comp,nghost); } void MultiFab::negate (int nghost) { negate(0,n_comp,nghost); } void MultiFab::negate (const Box& region, int nghost) { negate(region,0,n_comp,nghost); } MultiFab::MultiFab () {} MultiFab::MultiFab (const BoxArray& bxs, int ncomp, int ngrow, FabAlloc alloc) : FabArray(bxs,ncomp,ngrow,alloc) {} void MultiFab::operator= (const Real& r) { setVal(r); } Real MultiFab::min (int comp, int nghost) const { BL_ASSERT(nghost >= 0 && nghost <= n_grow); Real mn = std::numeric_limits::max(); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { mn = std::min(mn,get(mfi).min(BoxLib::grow(mfi.validbox(),nghost),comp)); } ParallelDescriptor::ReduceRealMin(mn); return mn; } Real MultiFab::min (const Box& region, int comp, int nghost) const { BL_ASSERT(nghost >= 0 && nghost <= n_grow); Real mn = std::numeric_limits::max(); for ( MFIter mfi(*this); mfi.isValid(); ++mfi) { Box b = BoxLib::grow(mfi.validbox(),nghost) & region; if (b.ok()) mn = std::min(mn, get(mfi).min(b,comp)); } ParallelDescriptor::ReduceRealMin(mn); return mn; } Real MultiFab::max (int comp, int nghost) const { BL_ASSERT(nghost >= 0 && nghost <= n_grow); Real mn = -std::numeric_limits::max(); for ( MFIter mfi(*this); mfi.isValid(); ++mfi) { mn = std::max(mn, get(mfi).max(BoxLib::grow(mfi.validbox(),nghost),comp)); } ParallelDescriptor::ReduceRealMax(mn); return mn; } Real MultiFab::max (const Box& region, int comp, int nghost) const { BL_ASSERT(nghost >= 0 && nghost <= n_grow); Real mn = -std::numeric_limits::max(); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { Box b = BoxLib::grow(mfi.validbox(),nghost) & region; if (b.ok()) mn = std::max(mn, get(mfi).max(b,comp)); } ParallelDescriptor::ReduceRealMax(mn); return mn; } void MultiFab::minus (const MultiFab& mf, int strt_comp, int num_comp, int nghost) { BL_ASSERT(boxarray == mf.boxarray); BL_ASSERT(strt_comp >= 0); #ifndef NDEBUG int lst_comp = strt_comp + num_comp - 1; #endif BL_ASSERT(lst_comp < n_comp && lst_comp < mf.n_comp); BL_ASSERT(nghost <= n_grow && nghost <= mf.n_grow); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { Box bx = BoxLib::grow(mfi.validbox(),nghost); get(mfi).minus(mf[mfi], bx, strt_comp, strt_comp, num_comp); } } void MultiFab::plus (Real val, int comp, int num_comp, int nghost) { BL_ASSERT(nghost >= 0 && nghost <= n_grow); BL_ASSERT(comp+num_comp <= n_comp); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { get(mfi).plus(val,BoxLib::grow(mfi.validbox(),nghost),comp,num_comp); } } void MultiFab::plus (Real val, const Box& region, int comp, int num_comp, int nghost) { BL_ASSERT(nghost >= 0 && nghost <= n_grow); BL_ASSERT(comp+num_comp <= n_comp); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { Box b = BoxLib::grow(mfi.validbox(),nghost) & region; if (b.ok()) get(mfi).plus(val,b,comp,num_comp); } } void MultiFab::plus (const MultiFab& mf, int strt_comp, int num_comp, int nghost) { BL_ASSERT(boxarray == mf.boxarray); BL_ASSERT(strt_comp >= 0); #ifndef NDEBUG int lst_comp = strt_comp + num_comp - 1; #endif BL_ASSERT(lst_comp < n_comp && lst_comp < mf.n_comp); BL_ASSERT(nghost <= n_grow && nghost <= mf.n_grow); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { Box bx = BoxLib::grow(mfi.validbox(),nghost); get(mfi).plus(mf[mfi], bx, strt_comp, strt_comp, num_comp); } } void MultiFab::mult (Real val, int comp, int num_comp, int nghost) { BL_ASSERT(nghost >= 0 && nghost <= n_grow); BL_ASSERT(comp+num_comp <= n_comp); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { get(mfi).mult(val, BoxLib::grow(mfi.validbox(),nghost),comp,num_comp); } } void MultiFab::mult (Real val, const Box& region, int comp, int num_comp, int nghost) { BL_ASSERT(nghost >= 0 && nghost <= n_grow); BL_ASSERT(comp+num_comp <= n_comp); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { Box b = BoxLib::grow(mfi.validbox(),nghost) & region; if (b.ok()) get(mfi).mult(val, b, comp, num_comp); } } void MultiFab::invert (Real numerator, int comp, int num_comp, int nghost) { BL_ASSERT(nghost >= 0 && nghost <= n_grow); BL_ASSERT(comp+num_comp <= n_comp); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { get(mfi).invert(numerator, BoxLib::grow(mfi.validbox(),nghost),comp,num_comp); } } void MultiFab::invert (Real numerator, const Box& region, int comp, int num_comp, int nghost) { BL_ASSERT(nghost >= 0 && nghost <= n_grow); BL_ASSERT(comp+num_comp <= n_comp); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { Box b = BoxLib::grow(mfi.validbox(),nghost) & region; if (b.ok()) get(mfi).invert(numerator,b,comp,num_comp); } } void MultiFab::negate (int comp, int num_comp, int nghost) { BL_ASSERT(nghost >= 0 && nghost <= n_grow); BL_ASSERT(comp+num_comp <= n_comp); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { get(mfi).negate(BoxLib::grow(mfi.validbox(),nghost),comp,num_comp); } } void MultiFab::negate (const Box& region, int comp, int num_comp, int nghost) { BL_ASSERT(nghost >= 0 && nghost <= n_grow); BL_ASSERT(comp+num_comp <= n_comp); for (MFIter mfi(*this); mfi.isValid(); ++mfi) { Box b = BoxLib::grow(mfi.validbox(),nghost) & region; if (b.ok()) get(mfi).negate(b,comp,num_comp); } } void BoxLib::linInterpAddBox (MultiFabCopyDescriptor& fabCopyDesc, BoxList* returnUnfilledBoxes, Array& returnedFillBoxIds, const Box& subbox, const MultiFabId& faid1, const MultiFabId& faid2, Real t1, Real t2, Real t, int src_comp, int dest_comp, int num_comp, bool extrap) { const Real teps = (t2-t1)/1000.0; BL_ASSERT(extrap || ( (t>=t1-teps) && (t <= t2+teps) ) ); if (t >= t1-teps && t <= t1+teps) { returnedFillBoxIds.resize(1); returnedFillBoxIds[0] = fabCopyDesc.AddBox(faid1, subbox, returnUnfilledBoxes, src_comp, dest_comp, num_comp); } else if (t > t2-teps && t < t2+teps) { returnedFillBoxIds.resize(1); returnedFillBoxIds[0] = fabCopyDesc.AddBox(faid2, subbox, returnUnfilledBoxes, src_comp, dest_comp, num_comp); } else { returnedFillBoxIds.resize(2); BoxList tempUnfilledBoxes(subbox.ixType()); returnedFillBoxIds[0] = fabCopyDesc.AddBox(faid1, subbox, returnUnfilledBoxes, src_comp, dest_comp, num_comp); returnedFillBoxIds[1] = fabCopyDesc.AddBox(faid2, subbox, &tempUnfilledBoxes, src_comp, dest_comp, num_comp); // // The boxarrays for faid1 and faid2 should be the // same so only use returnUnfilledBoxes from one AddBox here. // } } void BoxLib::linInterpFillFab (MultiFabCopyDescriptor& fabCopyDesc, const Array& fillBoxIds, const MultiFabId& faid1, const MultiFabId& faid2, FArrayBox& dest, Real t1, Real t2, Real t, int src_comp, // these comps need to be removed int dest_comp, // from this routine int num_comp, bool extrap) { const Real teps = (t2-t1)/1000.0; BL_ASSERT(extrap || ( (t>=t1-teps) && (t <= t2+teps) ) ); if (t >= t1-teps && t <= t1+teps) { fabCopyDesc.FillFab(faid1, fillBoxIds[0], dest); } else if (t > t2-teps && t < t2+teps) { fabCopyDesc.FillFab(faid2, fillBoxIds[0], dest); } else { BL_ASSERT(dest_comp + num_comp <= dest.nComp()); FArrayBox dest1(dest.box(), dest.nComp()); dest1.setVal(Real(1.e30)); // FIXME - Whats a better value? FArrayBox dest2(dest.box(), dest.nComp()); dest2.setVal(Real(1.e30)); // FIXME - Whats a better value? fabCopyDesc.FillFab(faid1, fillBoxIds[0], dest1); fabCopyDesc.FillFab(faid2, fillBoxIds[1], dest2); dest.linInterp(dest1, dest1.box(), src_comp, dest2, dest2.box(), src_comp, t1, t2, t, dest.box(), dest_comp, num_comp); } } // // Holds single grid intersection record. // struct SIRec { SIRec () : m_i(-1), m_j(-1) {} SIRec (int i, int j, const Box& bx) : m_i(i), m_j(j), m_bx(bx) { BL_ASSERT(i >= 0); BL_ASSERT(j >= 0); } SIRec (const SIRec& rhs) : m_i(rhs.m_i), m_j(rhs.m_j), m_bx(rhs.m_bx), m_fbid(rhs.m_fbid) {} int m_i; int m_j; Box m_bx; FillBoxId m_fbid; }; // // Used in caching self-intersection info for FillBoundary(). // struct SI { SI (); SI (const BoxArray& ba, int ngrow); SI (const SI& rhs); ~SI (); bool operator== (const SI& rhs) const; bool operator!= (const SI& rhs) const; Array m_cache; // Snds cached for CollectData(). CommDataCache m_commdata; // Yet another cache for CollectData(). std::vector m_sirec; BoxArray m_ba; int m_ngrow; }; inline SI::SI () : m_ngrow(-1) {} inline SI::SI (const BoxArray& ba, int ngrow) : m_ba(ba), m_ngrow(ngrow) { BL_ASSERT(ngrow >= 0); } inline SI::SI (const SI& rhs) : m_cache(rhs.m_cache), m_commdata(rhs.m_commdata), m_sirec(rhs.m_sirec), m_ba(rhs.m_ba), m_ngrow(rhs.m_ngrow) {} inline SI::~SI () {} inline bool SI::operator== (const SI& rhs) const { return m_ngrow == rhs.m_ngrow && m_ba == rhs.m_ba; } inline bool SI::operator!= (const SI& rhs) const { return !operator==(rhs); } // // A useful typedef. // typedef std::list SIList; // // Cache of SI info. // static SIList SICache; void MultiFab::FlushSICache () { SICache.clear(); } int MultiFab::SICacheSize () { return SICache.size(); } static SI& BuildFBsirec (const SI& si, const MultiFab& mf) { BL_ASSERT(si.m_ngrow >= 0); BL_ASSERT(mf.nGrow() == si.m_ngrow); BL_ASSERT(mf.boxArray() == si.m_ba); // // Insert new ones at beginning of list. // SICache.push_front(si); //cout << "*** FB Cache Size = " << SICache.size() << endl; const BoxArray& ba = mf.boxArray(); const DistributionMapping& DMap = mf.DistributionMap(); const int MyProc = ParallelDescriptor::MyProc(); std::vector& sirec = SICache.front().m_sirec; Array& cache = SICache.front().m_cache; cache.resize(ParallelDescriptor::NProcs(),0); for (MFIter mfi(mf); mfi.isValid(); ++mfi) { const int i = mfi.index(); for (int j = 0; j < mf.size(); j++) { if (i != j) { if (ba[j].intersects(mf[mfi].box())) { Box bx = ba[j] & mf[mfi].box(); sirec.push_back(SIRec(i,j,bx)); if (DMap[j] != MyProc) // // If we intersect them then they'll intersect us. // cache[DMap[j]] += 1; } } } BL_ASSERT(cache[DMap[i]] == 0); } return SICache.front(); } // // Returns cached self-intersection records for MultiFab or builds them. // static SI& TheFBsirec (int scomp, int ncomp, const MultiFab& mf) { BL_ASSERT(ncomp > 0); BL_ASSERT(scomp >= 0); const SI si(mf.boxArray(), mf.nGrow()); for (SIList::iterator it = SICache.begin(); it != SICache.end(); ++it) { if (*it == si) { // // Adjust the ncomp & scomp in CommData. // Array& cd = (*it).m_commdata.theCommData(); for (int i = 0; i < cd.size(); i++) { cd[i].nComp(ncomp); cd[i].srcComp(scomp); } return *it; } } return BuildFBsirec(si,mf); } void MultiFab::FillBoundary (int scomp, int ncomp) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::FillBoundary(int, int)"); MultiFabCopyDescriptor mfcd; SI& si = TheFBsirec(scomp,ncomp,*this); const MultiFabId mfid = mfcd.RegisterMultiFab(this); // // Add boxes we need to collect. // for (unsigned int i = 0; i < si.m_sirec.size(); i++) { si.m_sirec[i].m_fbid = mfcd.AddBox(mfid, si.m_sirec[i].m_bx, 0, si.m_sirec[i].m_j, scomp, scomp, ncomp); } mfcd.CollectData(&si.m_cache,&si.m_commdata); for (unsigned int i = 0; i < si.m_sirec.size(); i++) { BL_ASSERT(DistributionMap()[si.m_sirec[i].m_i] == ParallelDescriptor::MyProc()); // // Directly fill the FAB. // mfcd.FillFab(mfid,si.m_sirec[i].m_fbid,(*this)[si.m_sirec[i].m_i]); } } ccseapps-2.5/CCSEApps/BoxLib/ArrayLim.H0000644000175000017500000001377011634153073020677 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_ARRAYLIM_H #define BL_ARRAYLIM_H /* ** $Id: ArrayLim.H,v 1.10 2002/06/04 16:48:48 car Exp $ */ #if !defined(BL_LANG_FORT) /* ** C stuff ... */ #ifdef BL_USE_ARLIM #error "BL_USE_ARLIM is deprecated" #define ARLIM_P(x) const int* #define ARLIM(x) x #else #if BL_SPACEDIM==1 #define ARLIM_P(x) const int& #define ARLIM(x) x[0] #elif BL_SPACEDIM==2 #define ARLIM_P(x) const int&,const int& #define ARLIM(x) x[0],x[1] #elif BL_SPACEDIM==3 #define ARLIM_P(x) const int&,const int&,const int& #define ARLIM(x) x[0],x[1],x[2] #endif #endif #define BL_TO_FORTRAN(x) (x).dataPtr(), ARLIM((x).loVect()), ARLIM((x).hiVect()) #define BL_TO_FORTRAN_N(x,n) (x).dataPtr(n), ARLIM((x).loVect()), ARLIM((x).hiVect()) #else /* ** Fortran stuff ... */ #include #ifdef BL_USE_ARLIM #error "This section of code is deprecated: BL_USE_ARLIM is invalid" #if (BL_SPACEDIM == 1) #define DIMS(a) a##_lo, a##_hi #define DIMDEC(a) a##_lo(1), a##_hi(1) #define DIMV(a) a##_lo(1):a##_hi(1) #define DIM1(a) a##_lo(1):a##_hi(1) #define ARG_L1(a) a##_lo(1) #define ARG_H1(a) a##_hi(1) #endif #if (BL_SPACEDIM == 2) #define DIMS(a) a##_lo, a##_hi #define DIMDEC(a) a##_lo(2), a##_hi(2) #define DIMV(a) a##_lo(1):a##_hi(1), a##_lo(2):a##_hi(2) #define DIM1(a) a##_lo(1):a##_hi(1) #define DIM2(a) a##_lo(2):a##_hi(2) #define ARG_L1(a) a##_lo(1) #define ARG_L2(a) a##_lo(2) #define ARG_H1(a) a##_hi(1) #define ARG_H2(a) a##_hi(2) #endif #if (BL_SPACEDIM == 3) #define DIMS(a) a##_lo, a##_hi #define DIMDEC(a) a##_lo(3), a##_hi(3) #define DIMV(a) a##_lo(1):a##_hi(1), a##_lo(2):a##_hi(2), a##_lo(3):a##_hi(3) #define DIM1(a) a##_lo(1):a##_hi(1) #define DIM2(a) a##_lo(2):a##_hi(2) #define DIM3(a) a##_lo(3):a##_hi(3) #define DIM12(a) a##_lo(1):a##_hi(1), a##_lo(2):a##_hi(2) #define DIM23(a) a##_lo(2):a##_hi(2), a##_lo(3):a##_hi(3) #define DIM13(a) a##_lo(1):a##_hi(1), a##_lo(3):a##_hi(3) #define ARG_L1(a) a##_lo(1) #define ARG_L2(a) a##_lo(2) #define ARG_L3(a) a##_lo(3) #define ARG_H1(a) a##_hi(1) #define ARG_H2(a) a##_hi(2) #define ARG_H3(a) a##_hi(3) #endif #else #if __STDC__==1 #if (BL_SPACEDIM == 1) #define DIMS(a) a##_l1, a##_h1 #define DIMDEC(a) a##_l1, a##_h1 #define DIMV(a) a##_l1:a##_h1 #define DIM1(a) a##_l1:a##_h1 #define ARG_L1(a) a##_l1 #define ARG_H1(a) a##_h1 #define DIMARG(a) a##(1) #endif #if (BL_SPACEDIM == 2) #define DIMS(a) a##_l1, a##_l2 , a##_h1, a##_h2 #define DIMDEC(a) a##_l1, a##_l2 , a##_h1, a##_h2 #define DIMV(a) a##_l1:a##_h1, a##_l2:a##_h2 #define DIM1(a) a##_l1:a##_h1 #define DIM2(a) a##_l2:a##_h2 #define ARG_L1(a) a##_l1 #define ARG_L2(a) a##_l2 #define ARG_H1(a) a##_h1 #define ARG_H2(a) a##_h2 #define DIMARG(a) a##(1),a##(2) #endif #if (BL_SPACEDIM == 3) #define DIMS(a) a##_l1, a##_l2 , a##_l3, a##_h1, a##_h2, a##_h3 #define DIMDEC(a) a##_l1, a##_l2 , a##_l3, a##_h1, a##_h2, a##_h3 #define DIMV(a) a##_l1:a##_h1, a##_l2:a##_h2, a##_l3:a##_h3 #define DIM1(a) a##_l1:a##_h1 #define DIM2(a) a##_l2:a##_h2 #define DIM3(a) a##_l3:a##_h3 #define DIM12(a) a##_l1:a##_h1, a##_l2:a##_h2 #define DIM23(a) a##_l2:a##_h2, a##_l3:a##_h3 #define DIM13(a) a##_l1:a##_h1, a##_l3:a##_h3 #define ARG_L1(a) a##_l1 #define ARG_L2(a) a##_l2 #define ARG_L3(a) a##_l3 #define ARG_H1(a) a##_h1 #define ARG_H2(a) a##_h2 #define ARG_H3(a) a##_h3 #define DIMARG(a) a##(1),a##(2),a##(3) #endif #else #if (BL_SPACEDIM == 1) #define DIMS(a) a/**/_l1, a/**/_h1 #define DIMDEC(a) a/**/_l1, a/**/_h1 #define DIMV(a) a/**/_l1:a/**/_h1 #define DIM1(a) a/**/_l1:a/**/_h1 #define ARG_L1(a) a/**/_l1 #define ARG_H1(a) a/**/_h1 #define DIMARG(a) a/**/(1) #endif #if (BL_SPACEDIM == 2) #define DIMS(a) a/**/_l1, a/**/_l2 , a/**/_h1, a/**/_h2 #define DIMDEC(a) a/**/_l1, a/**/_l2 , a/**/_h1, a/**/_h2 #define DIMV(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2 #define DIM1(a) a/**/_l1:a/**/_h1 #define DIM2(a) a/**/_l2:a/**/_h2 #define ARG_L1(a) a/**/_l1 #define ARG_L2(a) a/**/_l2 #define ARG_H1(a) a/**/_h1 #define ARG_H2(a) a/**/_h2 #define DIMARG(a) a/**/(1),a/**/(2) #endif #if (BL_SPACEDIM == 3) #define DIMS(a) a/**/_l1, a/**/_l2 , a/**/_l3, a/**/_h1, a/**/_h2, a/**/_h3 #define DIMDEC(a) a/**/_l1, a/**/_l2 , a/**/_l3, a/**/_h1, a/**/_h2, a/**/_h3 #define DIMV(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2, a/**/_l3:a/**/_h3 #define DIM1(a) a/**/_l1:a/**/_h1 #define DIM2(a) a/**/_l2:a/**/_h2 #define DIM3(a) a/**/_l3:a/**/_h3 #define DIM12(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2 #define DIM23(a) a/**/_l2:a/**/_h2, a/**/_l3:a/**/_h3 #define DIM13(a) a/**/_l1:a/**/_h1, a/**/_l3:a/**/_h3 #define ARG_L1(a) a/**/_l1 #define ARG_L2(a) a/**/_l2 #define ARG_L3(a) a/**/_l3 #define ARG_H1(a) a/**/_h1 #define ARG_H2(a) a/**/_h2 #define ARG_H3(a) a/**/_h3 #define DIMARG(a) a/**/(1),a/**/(2),a/**/(3) #endif #endif /*__STDC__==1*/ #endif /*BL_USE_ARLIM*/ #endif /*!defined(BL_LANG_FORT)*/ #endif /*BL_ARRAYLIM_H*/ ccseapps-2.5/CCSEApps/BoxLib/GNUmakefile0000644000175000017500000000511511634153073021112 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.21 2001/07/23 04:32:20 car Exp $ # PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) PRECISION = DOUBLE DEBUG = TRUE DIM = 3 COMP = KCC USE_MPI = TRUE #NAMESPACE = TRUE NAMESPACE = FALSE # # The base name of the library we're building. # LBASE = box # # Where libraries and include files will be installed. # INSTALL_ROOT = $(PBOXLIB_HOME) include $(TOP)/mk/Make.defs ./Make.package ifeq ($(KCC_VERSION),3.3) CXXFLAGS += --one_instantiation_per_object endif all: $(optionsLib) # # `install' does NOT try to build and install the HTML stuff. # doc++ isn't widely distributed enough to assume that. # For now you must invoke `install_html' separately. # install: all include $(TOP)/mk/Make.rules # # Temp stuff for doing html docs. # _docHeaders := $(sort $(wildcard *.H)) _htmlDir := html _installDir = $(instHtmlDir)/boxlib # # This unconditionally installs stuff from ./html into _installDir. # install_html: html -if [ ! -d $(_installDir) ]; then \ mkdir -p $(_installDir); \ chmod 755 $(_installDir); \ fi -cd $(_installDir); $(RM) * if [ -d $(_htmlDir) ]; then \ cd $(_htmlDir); \ for f in *; do \ $(INSTALL_DATA) $$f $(_installDir); \ done; \ fi # # This will make the HTML files in the directory html provided # any of the relevant .H files have changed more recently than the # directory itself. # html: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ $(RM) -r $(_htmlDir); \ mkdir -p $(_htmlDir); \ doc++ -f -j -B Banner.html -d $(_htmlDir) $(_docHeaders); \ fi BoxLib.tex: $(_docHeaders) -if `doc++ -h > /dev/null` ; then \ doc++ -f -t -j -o BoxLib.tex -ep docxx_squish $(_docHeaders); \ sed '/[\]usepackage[{]docxx[}]/d' < BoxLib.tex > .junk; \ mv .junk BoxLib.tex; \ fi BoxLib.dvi: BoxLib.tex latex BoxLib.tex; latex BoxLib.tex BoxLib.ps: BoxLib.dvi dvips BoxLib.dvi -o BoxLib.ps # # Install the PostScript file into ./ps # install_ps: BoxLib.ps -if [ ! -d $(INSTALL_ROOT)/ps ]; then \ mkdir -p $(INSTALL_ROOT)/ps; \ chmod 755 $(INSTALL_ROOT)/ps; \ fi $(INSTALL_DATA) BoxLib.ps $(INSTALL_ROOT)/ps WRAPPERGEN=$(PBOXLIB_HOME)/util/wrappergen/wrappergen BLMpi.cpp: BLMpi.w $(WRAPPERGEN) -c++ -o BLMpi.cpp -w BLMpi.w clean:: $(RM) -r html ccseapps-2.5/CCSEApps/BoxLib/BArena.cpp0000644000175000017500000000277011634153073020700 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BArena.cpp,v 1.10 2001/07/31 17:56:24 lijewski Exp $ // #include #include void* BArena::alloc (size_t _sz) { return ::operator new(_sz); } void BArena::free (void* pt) { ::operator delete(pt); } ccseapps-2.5/CCSEApps/BoxLib/BLParmParse_F.f0000644000175000017500000001005311634153073021561 0ustar amckinstryamckinstryc c $Id: BLParmParse_F.f,v 1.7 2003/01/03 19:25:11 car Exp $ c c----------------------------------------------------------------------- SUBROUTINE bl_pp_new(ipp, str) INTEGER ipp CHARACTER*(*) str INTEGER NSTR PARAMETER (NSTR = 128) INTEGER istr(NSTR) CALL blstr2int(istr, NSTR, str) CALL bl_pp_new_cpp(ipp, istr, NSTR) END c----------------------------------------------------------------------- SUBROUTINE bl_pp_record_new(ipp, ippr, str) INTEGER ipp, ippr CHARACTER*(*) str INTEGER NSTR PARAMETER (NSTR = 128) INTEGER istr(NSTR) CALL blstr2int(istr, NSTR, str) CALL bl_pp_record_new_cpp(ipp, ippr, istr, NSTR) END c----------------------------------------------------------------------- SUBROUTINE bl_pp_get_int(ierr, ipp, str, ival) INTEGER ierr, ipp INTEGER ival CHARACTER*(*) str INTEGER NSTR PARAMETER (NSTR = 128) INTEGER istr(NSTR) C CALL blstr2int(istr, NSTR, str) CALL bl_pp_get_int_cpp(ierr, ipp, istr, NSTR, ival) END c----------------------------------------------------------------------- SUBROUTINE bl_pp_get_int_n(ierr, ipp, str, ival, nval) INTEGER ierr, ipp, nval INTEGER ival(*) CHARACTER*(*) str INTEGER NSTR PARAMETER (NSTR = 128) INTEGER istr(NSTR) C CALL blstr2int(istr, NSTR, str) CALL bl_pp_get_int_n_cpp(ierr, ipp, istr, NSTR, ival, nval) END c----------------------------------------------------------------------- SUBROUTINE bl_pp_get_logical(ierr, ipp, str, lval) INTEGER ierr, ipp LOGICAL lval CHARACTER*(*) str INTEGER NSTR PARAMETER (NSTR = 128) INTEGER istr(NSTR) INTEGER ival C CALL blstr2int(istr, NSTR, str) CALL bl_pp_get_logical_cpp(ierr, ipp, istr, NSTR, ival) IF ( IERR .NE. 0 ) THEN IF ( ival .NE. 0 ) THEN lval = .TRUE. ELSE lval = .FALSE. END IF END IF END c----------------------------------------------------------------------- SUBROUTINE bl_pp_get_real(ierr, ipp, str, rval) INTEGER ierr, ipp REAL rval CHARACTER*(*) str INTEGER NSTR PARAMETER (NSTR = 128) INTEGER istr(NSTR) C CALL blstr2int(istr, NSTR, str) CALL bl_pp_get_real_cpp(ierr, ipp, istr, NSTR, rval) END c----------------------------------------------------------------------- SUBROUTINE bl_pp_get_real_n(ierr, ipp, str, rval,nval) INTEGER ierr, ipp, nval REAL rval(*) CHARACTER*(*) str INTEGER NSTR PARAMETER (NSTR = 128) INTEGER istr(NSTR) C CALL blstr2int(istr, NSTR, str) CALL bl_pp_get_real_n_cpp(ierr, ipp, istr, NSTR, rval,nval) END c----------------------------------------------------------------------- SUBROUTINE bl_pp_get_double(ierr, ipp, str, dval) INTEGER ierr, ipp DOUBLE PRECISION dval CHARACTER*(*) str INTEGER NSTR PARAMETER (NSTR = 128) INTEGER istr(NSTR) C CALL blstr2int(istr, NSTR, str) CALL bl_pp_get_double_cpp(ierr, ipp, istr, NSTR, dval) END c----------------------------------------------------------------------- SUBROUTINE bl_pp_get_double_n(ierr, ipp, str, dval, nval) INTEGER ierr, ipp, nval DOUBLE PRECISION dval CHARACTER*(*) str INTEGER NSTR PARAMETER (NSTR = 128) INTEGER istr(NSTR) C CALL blstr2int(istr, NSTR, str) CALL bl_pp_get_double_n_cpp(ierr, ipp, istr, NSTR, dval,nval) END c----------------------------------------------------------------------- SUBROUTINE bl_pp_get_string(ierr, ipp, str, ostr) INTEGER ierr, ipp CHARACTER*(*) ostr CHARACTER*(*) str INTEGER NSTR PARAMETER (NSTR = 128) INTEGER istr(NSTR) INTEGER iostr(NSTR) C CALL blstr2int(istr, NSTR, str) CALL bl_pp_get_string_cpp(ierr, ipp, istr, NSTR, iostr, NSTR) IF ( ierr .ne. 0 ) THEN CALL blint2str(ostr, iostr, NSTR) END IF END ccseapps-2.5/CCSEApps/BoxLib/FPC.cpp0000644000175000017500000001107711634153073020160 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: FPC.cpp,v 1.6 2001/07/19 16:57:32 lijewski Exp $ // #include // // FP orders. // const int FPC::normal_float_order[] = { 1, 2, 3, 4 }; const int FPC::reverse_float_order[] = { 4, 3, 2, 1 }; const int FPC::reverse_float_order_2[] = { 2, 1, 4, 3 }; const int FPC::normal_double_order[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; const int FPC::reverse_double_order[] = { 8, 7, 6, 5, 4, 3, 2, 1 }; const int FPC::reverse_double_order_2[] = { 2, 1, 4, 3, 6, 5, 8, 7 }; const int FPC::cray_float_order[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; // // Floating point formats. // const long FPC::ieee_float[] = { 32L, 8L, 23L, 0L, 1L, 9L, 0L, 0x7FL }; const long FPC::ieee_double[] = { 64L, 11L, 52L, 0L, 1L, 12L, 0L, 0x3FFL }; const long FPC::cray_float[] = { 64L, 15L, 48L, 0L, 1L, 16L, 1L, 0x4000L }; // // Every copy of the library will have exactly one // `nativeLongDescriptor' and `nativeRealDescriptor' compiled into it. // Each machine on which BoxLib runs MUST have them defined below. // const IntDescriptor& FPC::NativeLongDescriptor () { #if defined(__alpha) || defined(__i486__) || defined(WIN32) || defined(i386) || defined(__i386__) || defined(__ia64__) || defined(__x86_64__) static const IntDescriptor nld(sizeof(long), IntDescriptor::ReverseOrder); #endif #ifdef _CRAY1 static const IntDescriptor nld(sizeof(long), IntDescriptor::NormalOrder); #endif #if defined(__sgi) || \ defined(__sun) || \ defined(_AIX) || \ defined(_CRAYT3E) || \ defined(__hpux) static const IntDescriptor nld(sizeof(long), IntDescriptor::NormalOrder); #endif return nld; } const RealDescriptor& FPC::NativeRealDescriptor () { #if defined(__alpha) || defined(__i486__) || defined(WIN32) || defined(i386) || defined(__i386__) || defined(__ia64__) || defined(__x86_64__) #ifdef BL_USE_FLOAT static const RealDescriptor nrd(ieee_float, reverse_float_order, 4); #else static const RealDescriptor nrd(ieee_double, reverse_double_order, 8); #endif #endif #ifdef _CRAY1 static const RealDescriptor nrd(cray_float, cray_float_order, 8); #endif #if defined(__sgi) || \ defined(__sun) || \ defined(_AIX) || \ defined(_CRAYT3E) || \ defined(__hpux) #ifdef BL_USE_FLOAT static const RealDescriptor nrd(ieee_float, normal_float_order, 4); #else static const RealDescriptor nrd(ieee_double, normal_double_order, 8); #endif #endif return nrd; } const RealDescriptor& FPC::CrayRealDescriptor () { static const RealDescriptor crd(cray_float, cray_float_order, 8); return crd; } const RealDescriptor& FPC::Ieee32NormalRealDescriptor () { static const RealDescriptor i32rd(ieee_float, normal_float_order, 4); return i32rd; } const RealDescriptor& FPC::Ieee64NormalRealDescriptor () { static const RealDescriptor i64rd(ieee_double, normal_double_order, 8); return i64rd; } // // TODO -- add more machine descriptions. // #if !(defined(__alpha) || \ defined(_CRAY1) || \ defined(_CRAYT3E) || \ defined(__sgi) || \ defined(__sun) || \ defined(__i486__) || \ defined(i386) || \ defined(__i386__) || \ defined(__ia64__) || \ defined(__x86_64__) || \ defined(__hpux) || \ defined(_MSC_VER) || \ defined(_AIX)) #error We do not yet support FAB I/O on this machine #endif ccseapps-2.5/CCSEApps/BoxLib/REAL.H0000644000175000017500000001037711634153073017702 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_REAL_H #define BL_REAL_H /* * $Id: REAL.H,v 1.13 2002/06/04 16:48:48 car Exp $ */ #ifdef BL_USE_FLOAT # undef BL_USE_DOUBLE # undef BL_USE_FLOAT /*@ManDoc: The macro BL\_USE\_FLOAT indicates that C++ floating-point calculations should use "float" variables and Fortran floating-point calculations should use "real*4" variables. One of BL\_USE\_FLOAT or BL\_USE\_DOUBLE must always be defined when compiling and using BoxLib. */ # define BL_USE_FLOAT 1 #else # undef BL_USE_FLOAT # undef BL_USE_DOUBLE /*@ManDoc: The macro BL\_USE\_DOUBLE indicates that C++ floating-point calculations should use "double" variables and Fortran floating-point calculations should use "real*8" variables. One of BL\_USE\_FLOAT or BL\_USE\_DOUBLE must always be defined when compiling and using BoxLib. This macro is not allowed on Cray architectures; i.e. only BL\_USE\_FLOAT is allowed on Cray architectures. */ # define BL_USE_DOUBLE 1 #endif #if !defined(BL_LANG_FORT) /*@ManDoc: Real is a typedef specifying the precision of the floating-point calculations in C++ code. It will be either `float' or `double' depending upon which of the macros BL\_USE\_FLOAT or BL\_USE\_DOUBLE, respectively, is defined during compilations. For portability, you should write floating-point code in terms of this typedef, instead of using `float' or `double' directly. Note that exactly one of these macros must be defined when compiling any module that uses floating-point. Also, on Cray architectures all floating-point computations are done in 64 bits. */ #ifdef BL_USE_FLOAT typedef float Real; #else typedef double Real; #endif #else /*@ManDoc: The REAL\_T macro specifies the precision of the floating-point calculations in Fortran code. It will be either `real*4' or `real*8' depending upon which of the symbols BL\_USE\_FLOAT or BL\_USE\_DOUBLE, respectively, is defined during compilations. For portability, you should write floating-point code in terms of this macro, instead of using `real*4' or `real*8' directly. Note that exactly one of these macros must be defined when compiling any module that uses floating-point. Also, on Cray architectures all floating-point computations are done in 64 bits. */ #ifdef BL_USE_FLOAT #ifdef BL_USE_FORT_STAR_PRECISION # define REAL_T real*4 #else # define REAL_T REAL #endif #if __STDC__==1 # define BL_REAL(a) a##E0 # define BL_REAL_E(a,b) a##E##b #else # define BL_REAL(a) a/**/E0 # define BL_REAL_E(a,b) a/**/E/**/b #endif #else #ifdef BL_USE_FORT_STAR_PRECISION # define REAL_T real*8 #else # define REAL_T DOUBLE PRECISION #endif #if __STDC__==1 # define BL_REAL(a) a##D0 # define BL_REAL_E(a,b) a##D##b #else # define BL_REAL(a) a/**/D0 # define BL_REAL_E(a,b) a/**/D/**/b #endif #endif #endif /* !BL_LANG_FORT */ #if defined(BL_ARCH_CRAY) # if !defined(BL_USE_FLOAT) # error BL_USE_FLOAT required on CRAY architectures # endif #endif #endif /*BL_REAL_H*/ ccseapps-2.5/CCSEApps/BoxLib/docxx_squish.sty0000644000175000017500000005531611634153073022332 0ustar amckinstryamckinstry % begin LHH % expand text region on page % (we do this first since docxx needs to know some of these values) \setlength{\oddsidemargin}{0.3in} \setlength{\topmargin}{-0.5in} \setlength{\textheight}{9in} \setlength{\textwidth}{6in} % end LHH % % Switch off special characters except {}\ for the rest of the text. % \catcode`\&=12 \catcode`\_=13 \def_{{\tt\_}} \catcode`\~=11 \let\cxxtilde=~ \catcode`\~=13 \def~{{\tt\cxxtilde\relax}} \catcode`\,=\active% \def,{\char`\,\penalty-8\ } %\def,{++ } \catcode`\,=12 \def\<{{\tt <}} \def\>{{\tt >}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Define ... to do verbatim listing % \catcode`\=\active \catcode`\=\active {\obeyspaces\gdef {\ }} \def\ccverbatim{\strut\begingroup \catcode`\\=12 \catcode`\{=12 \catcode`\}=12 \catcode`\$=12 \catcode`\&=12 \catcode`\#=12 \catcode`\%=12 \catcode`\~=12 \catcode`\_=12 \catcode`\^=12 \catcode`\|=12 \catcode`\/=12 \obeyspaces\tt} \def{\let\par=\endgraf \ccverbatim \parskip=0pt \ccfinish} {\catcode`\=0 catcode`\=12 gdefccfinish#1{#1endgroup}} % % Definition of structuring comands. % \newcommand{\Section}[1]{\section{#1}} \newcommand{\SubSection}[1]{\subsection{#1}} \newcommand{\SubSubSection}[1]{\subsubsection{#1}} \newcommand{\Paragraph}[1]{\paragraph{#1}} \newcommand{\Ref}[1]{{\bf #1} ($\rightarrow$ \ref{#1})} \newcommand{\URL}[1]{{\tt #1}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % printing line #1 of code #2 % \newdimen\cxxcodewidth \cxxcodewidth=\textwidth \advance\cxxcodewidth by -21pt \def\cxxCodeLine#1#2{% {\hbox to 20pt{\tiny\hss#1}\parbox[t]{\cxxcodewidth}{\small#2}}% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for listing manual entries % \newdimen\cxxIdWidth \newdimen\cxxTypeWidth \newdimen\cxxProtoWidth \newdimen\cxxMemoWidth \newdimen\cxxPageWidth \cxxIdWidth=0.1\textwidth \cxxTypeWidth=0.15\textwidth \cxxProtoWidth=0.25\textwidth \cxxMemoWidth=0.43\textwidth \cxxPageWidth=\textwidth \advance\cxxPageWidth by-\cxxIdWidth \advance\cxxPageWidth by-\cxxTypeWidth \advance\cxxPageWidth by-\cxxProtoWidth \advance\cxxPageWidth by-\cxxMemoWidth \newdimen\cxxProtoMemoWidth \cxxProtoMemoWidth=\cxxProtoWidth \advance\cxxProtoMemoWidth by\cxxMemoWidth % begin LHH % affects vertical spacing in the listing of members within each class %\def\cxxStrut{\vrule width0pt height0pt depth9pt} \def\cxxStrut{\vrule width0pt height0pt depth3pt} % end LHH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 1: type % 2: name % 3: args % 4: memo % 5: id \def\cxxitem#1#2#3#4#5{\noindent{% \setbox5\hbox{#5 }% \ifdim\wd5>\cxxIdWidth% \setbox5\hbox{\hbox to \cxxIdWidth{\hss#5}}% \else \setbox5\hbox{\hbox to \cxxIdWidth{#5\hss}}% \fi% \setbox1\hbox{{% \catcode`\&=4% \catcode`\_=8% \def{\ccverbatim \ccfinish}#1% }}% \setbox2\hbox{{% \catcode`\&=4% \catcode`\_=8% \def{\ccverbatim \ccfinish}\textbf{#2} #3% }}% \setbox4\hbox{\parbox[t]{\cxxMemoWidth}{{% \raggedright\sloppy% \catcode`\&=4% \catcode`\_=8% \def{\ccverbatim \ccfinish}{\em #4} \cxxStrut% \def\page{#5}% \ifx\page\empty% \hss% \else% \ \dotfill% \hbox to 0pt{\hbox to \cxxPageWidth{\hss% \pageref{cxx.#5}% }\hss}% \fi% }}}% % \ifdim\wd1>\cxxTypeWidth% \hbox to \hsize{\unhbox5\hbox to \cxxTypeWidth{\unhbox1\hss}\hss}\\\nopagebreak% \setbox5\hbox{\hskip\cxxIdWidth}% \setbox1\hbox{\hskip\cxxTypeWidth}% \else% \setbox1\hbox{\hbox to \cxxTypeWidth{\unhbox1\hss}}% \fi% \ifdim\wd2>\cxxProtoWidth% \ifdim\wd2<\cxxProtoMemoWidth% \def\tmp{#4}% \ifx\tmp\empty% \def\tmp{#5}% \ifx\tmp\empty% \hbox to \hsize{\unhbox5\unhbox1\unhbox2\hss\cxxStrut}\\% \else% \hbox to \hsize{\unhbox5\unhbox1\unhbox2 \dotfill\hbox to \cxxPageWidth{\hss\pageref{cxx.#5}}% \cxxStrut}\\% \fi% \else% \hbox to \hsize{\unhbox5\unhbox1\unhbox2\hss}\\\nopagebreak% \hbox to \hsize{% \hskip\cxxIdWidth% \hskip\cxxTypeWidth% \hskip\cxxProtoWidth% \unhbox4\hss% }\\% \fi% \else% \hbox to \hsize{% \unhbox5% \unhbox1% \parbox[t]{\cxxProtoMemoWidth}{% \setbox255\hbox{\textbf{#2} (}% \hangindent=\wd255\hangafter=1% \raggedright\sloppy% {\catcode`\&=4\catcode`\_=8% \def{\ccverbatim \ccfinish}\textbf{#2} #3\strut}% }\hss% }\\\nopagebreak% \hbox to \hsize{% \hskip\cxxIdWidth% \hskip\cxxTypeWidth% \hskip\cxxProtoWidth% \unhbox4\hss% }\\% \fi% \else% \hbox to \hsize{% \unhbox5% \unhbox1% \hbox to \cxxProtoWidth{\unhbox2\hss}% \unhbox4\hss% }\\% \fi% }} \newdimen\cxxtypestart \cxxtypestart=0.05\textwidth %\advance\cxxtypestart by \labelsep \newdimen\cxxnamestart \cxxnamestart=\cxxtypestart \advance\cxxnamestart by 0.25\textwidth \newdimen\cxxargsstart \cxxargsstart=\cxxnamestart \advance\cxxargsstart by 0.2\textwidth \newdimen\cxxargswidth \cxxargswidth=\textwidth \advance\cxxargswidth by -\cxxargsstart \advance\cxxargswidth by -\spaceskip \newdimen\cxxmemostart \cxxmemostart=\cxxargsstart \advance\cxxmemostart by 0.12\textwidth \newenvironment{cxxlist}[1]{ \begingroup \catcode`\,=\active% \paragraph{#1}\strut\smallskip\\ }{ \endgroup } \newenvironment{cxxnames}{\begin{cxxlist}{Names}}{\end{cxxlist}} \newenvironment{cxxpublic}{\begin{cxxlist}{Public Members}}{\end{cxxlist}} \newenvironment{cxxprivate}{\begin{cxxlist}{Private Members}}{\end{cxxlist}} \newenvironment{cxxprotected}{\begin{cxxlist}{Protected Members}}{\end{cxxlist}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Numbered Frame box % \newlength{\cxxBoxLen}% \newlength{\cxxBoxHt}% \newlength{\cxxBoxDp}% \newlength{\cxxSideHt}% \newlength{\cxxSideLen}% \def\empty{} \def\idPos{1cm} % % box with id and name [optional width] % \newcommand{\aBox}[3][1pt]{{% \small% \def\width{#1}% \def\num{#2}% \def\name{#3}% \setbox0\hbox{\hskip\width{ \strut\name\strut} \hskip\width}% % \setlength{\cxxBoxLen}{\wd0}% \addtolength{\cxxBoxLen}{\width}% \addtolength{\cxxBoxLen}{\width}% \setbox2\hbox{\normalsize\strut\rule{\cxxBoxLen}{\width}}% % \ifx\num\empty% \setbox1\hbox{\strut}% \else% \setbox1\hbox{\rule{\idPos}{\width} { \sf\bf\strut #2 } }% \fi% \addtolength{\cxxBoxLen}{-\wd1}% \setbox1\hbox{\unhbox1\rule{\cxxBoxLen}{\width}}% % \setlength{\cxxSideHt}{\dp0}% \addtolength{\cxxSideHt}{\width}% \setlength{\cxxSideLen}{\dp0}% \addtolength{\cxxSideLen}{\ht0}% \addtolength{\cxxSideLen}{\dp1}% \addtolength{\cxxSideLen}{\width}% \addtolength{\cxxSideLen}{\width}% \setbox3\hbox{\hbox to 0pt{\hss\rule[-\cxxSideHt]{\width}{\cxxSideLen}}}% \setbox4\hbox{\hbox to 0pt{\rule[-\cxxSideHt]{\width}{\cxxSideLen}\hss}}% % \setlength{\cxxBoxHt}{\dp1}% \addtolength{\cxxBoxHt}{1pt}% \setlength{\cxxBoxDp}{\ht2}% \addtolength{\cxxBoxDp}{-\width}% \addtolength{\cxxBoxDp}{1pt}% % \setlength{\cxxBoxLen}{\ht3}% \addtolength{\cxxBoxLen}{\ht1}% % \vbox to \cxxBoxLen{% \hbox{\unhbox1}% \vskip-\cxxBoxHt% \hbox{\hskip\width\unhbox3\unhbox0\unhbox4}% %\vskip-\ht2% \vskip-\cxxBoxDp% \hbox{\unhbox2}% \vss% }% }} % % box with id and name [optional width] of size #4 % \newcommand{\sizeBox}[4][3pt]{{% \setbox0\hbox{ }% \setlength{\cxxSideLen}{#4}% \addtolength{\cxxSideLen}{-\wd0}% \addtolength{\cxxSideLen}{-\wd0}% \addtolength{\cxxSideLen}{-#1}% \addtolength{\cxxSideLen}{-#1}% \addtolength{\cxxSideLen}{-#1}% \addtolength{\cxxSideLen}{-#1}% \aBox[#1]{#2}{\hbox to \cxxSideLen{#3}}% }} % % box with id and name [optional width] over entire page width % \newcommand{\titleBox}[3][3pt]{{% \setbox0\hbox{ }% \setlength{\cxxSideLen}{\hsize}% \addtolength{\cxxSideLen}{-\wd0}% \addtolength{\cxxSideLen}{-\wd0}% \addtolength{\cxxSideLen}{-#1}% \addtolength{\cxxSideLen}{-#1}% \addtolength{\cxxSideLen}{-#1}% \addtolength{\cxxSideLen}{-#1}% \hbox{\aBox[#1]{#2}{\parbox[b]{\cxxSideLen}{#3}}}% }} % % centered box with id and name [optional width] of size #4 % \newcommand{\cBox}[4][3pt]{{% \setbox0\hbox{\aBox[#1]{#2}{#3}}% \ifdim\wd0<#4% \sizeBox[#1]{#2}{\hss#3\hss}{#4}% \else% \setlength{\cxxSideLen}{\wd0}% \advance\cxxSideLen by -#4% \hskip -0.5\cxxSideLen% \unhbox0% \fi% }} % % right expanding box with id and name [optional width] of size at least #4 % \newcommand{\rBox}[4][3pt]{{% \setbox0\hbox{\aBox[#1]{#2}{#3}\hss}% \ifdim\wd0>#4% \unhbox0% \else% \sizeBox[#1]{#2}{\hss#3\hss}{#4}% \fi% }} % % left expanding box with id and name [optional width] of size at least #4 % \newcommand{\lBox}[4][3pt]{{% \setbox0\hbox{\aBox[#1]{#2}{#3}\hss}% \ifdim\wd0>#4% \setlength{\cxxSideLen}{\wd0}% \advance\cxxSideLen by -#4% \hskip -\cxxSideLen% \unhbox0% \else% \sizeBox[#1]{#2}{\hss#3\hss}{#4}% \fi% }} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Pagestyle for documentation. % \newsavebox{\cxxHeadName} \newcommand{\ps@docxx}{% \renewcommand{\@oddhead}{\headlinetext}% \renewcommand{\@evenhead}{\headlinetext}% \renewcommand{\@oddfoot}{\footlinetext}% \renewcommand{\@evenfoot}{\footlinetext}% } \newcommand{\makeHeadLine}[2]{ \global\sbox{\cxxHeadName}{\vbox to 0pt{\vss% \hbox to \textwidth{% \hbox to 0pt{\strut\hbox to 1cm{\hss}\quad#1\hss}% \hfil#2\hfil% }% \vskip 1pt% \hbox to \textwidth{\hrulefill}% }}% } \newcommand\headlinetext{\usebox{\cxxHeadName}} \def\footlinetext{\hbox to \textwidth{ \vtop{% \hbox to \textwidth{\hrulefill}% \vskip -20pt% \hbox to \textwidth{{ \tiny\sf This page has been automatically generated with DOC++ \hss}}% \vskip -20pt \hbox to \textwidth{ \hbox{{\tiny\sf DOC++ is \copyright 1995 by }} \vtop{{\hbox{ \tiny\sf Detlev Stalling}% \vskip -25pt \hbox{ \tiny\sf Roland Wunderling}% \vskip -25pt \hbox{ \tiny\sf Malte Z\"ockler}% }}\hss \hss}% }% \hss\vtop{\vskip 10pt\hbox{\textrm{\thepage} }} }} \pagestyle{docxx} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for contents % \newcounter{cxxContentsDepth} \setcounter{cxxContentsDepth}{0} \newdimen\cxxContentsLengthIncr \cxxContentsLengthIncr=18pt \newdimen\cxxContentsLength \cxxContentsLength=\textwidth \advance\cxxContentsLength by -\cxxContentsLengthIncr \newenvironment{cxxContents}{ \ifcase \value{cxxContentsDepth} \makeHeadLine{}{Contents} \vskip 40pt \hbox to \hsize{\hskip 8pt\hskip\cxxContentsLengthIncr\Huge\bf Manual Entries\hss} \vskip 40pt \bf \else % >1 \rm \fi \begingroup \addtocounter{cxxContentsDepth}{1} \advance\cxxContentsLengthIncr by 8pt \advance\cxxContentsLength by -\cxxContentsLengthIncr }{ \addtocounter{cxxContentsDepth}{-1} \advance\cxxContentsLength by \cxxContentsLengthIncr \advance\cxxContentsLengthIncr by -8pt \ifcase \value{cxxContentsDepth} \vskip 12pt \or \vskip 9pt \else \vskip 3pt \fi \endgroup } \newcommand{\cxxContentsEntry}[3]{{ \def\emtpty{} \def\memo{#3} \ifx\memo\empty \setbox0\hbox{\parbox[t]{\cxxContentsLength}{\strut#2 \dotfill }} \else \setbox0\hbox{\parbox[t]{\cxxContentsLength}{\strut#2 --- {\em #3} \dotfill }} \fi \setbox1\hbox{\vtop{\vskip\dp0\vskip-\ht0\vskip-1.5pt\hbox to 20pt{\hss\rm \pageref{cxx.#1}}}} \hbox to \textwidth{% \hss\hbox to \cxxContentsLengthIncr{#1\hss}% \unhbox0\unhbox1% } }} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for class graph % \newdimen\cxxClassGraphShift \newdimen\cxxClassGraphLength \newdimen\cxxClassGraphHeight \newdimen\cxxClassGraphDepth \newdimen\cxxClassGraphTotV \setlength{\cxxClassGraphLength}{0.23\hsize} \setlength{\cxxClassGraphShift}{30pt} \setbox0\vbox{\aBox[5pt]{\strut}{\strut}} \setlength{\cxxClassGraphHeight}{\ht0} \setlength{\cxxClassGraphDepth}{\dp0} \addtolength{\cxxClassGraphDepth}{10pt} \setlength{\cxxClassGraphTotV}{\dp0} \addtolength{\cxxClassGraphTotV}{\ht0} \newenvironment{cxxInheritance}{ \begingroup \newcommand{\cxxCGSpace}[1]{% \vtop to \cxxClassGraphTotV{\hbox to \cxxClassGraphShift{% \vrule width0pt height \cxxClassGraphHeight depth \cxxClassGraphDepth% ##1}}% } \newcommand{\cxxSlashHline}{% \vrule width 0.1\cxxClassGraphShift height 3.5pt depth -3pt% \vrule width 0.1\cxxClassGraphShift height 0pt depth 0pt% \vrule width 0.1\cxxClassGraphShift height 3.5pt depth -3pt% \vrule width 0.1\cxxClassGraphShift height 0pt depth 0pt% \vrule width 0.1\cxxClassGraphShift height 3.5pt depth -3pt% } \newcommand{\cxxDotHline}{% \vrule width 0.06\cxxClassGraphShift height 3.5pt depth -3pt% \vrule width 0.05\cxxClassGraphShift height 0pt depth 0pt% \vrule width 0.06\cxxClassGraphShift height 3.5pt depth -3pt% \vrule width 0.05\cxxClassGraphShift height 0pt depth 0pt% \vrule width 0.06\cxxClassGraphShift height 3.5pt depth -3pt% \vrule width 0.05\cxxClassGraphShift height 0pt depth 0pt% \vrule width 0.06\cxxClassGraphShift height 3.5pt depth -3pt% \vrule width 0.05\cxxClassGraphShift height 0pt depth 0pt% \vrule width 0.06\cxxClassGraphShift height 3.5pt depth -3pt% } \newcommand{\cxxHline}{% \vrule width 0.5\cxxClassGraphShift height 3.5pt depth -3pt% } \newcommand{\cxxVup}{\hbox to 0pt{\hss% \vrule width 0.5pt height \cxxClassGraphHeight depth -3pt% \hss}} \newcommand{\cxxVlow}{\hbox to 0pt{\hss% \vtop to 0pt{\vskip-3pt% \hbox{\vrule width 0.5pt height 13pt depth \cxxClassGraphDepth}% \vss}% \hss}} \newcommand{\cxxLinkUp}{\hbox to 0pt{\hss\hskip 0.5\cxxClassGraphShift% \raise0.7\cxxClassGraphHeight\hbox to 0pt{\hss\textbf{\^}\hss}}}% \newcommand{\cxxLinkDown}{\hbox to 0pt{\hss\hskip 0.5\cxxClassGraphShift% \raise-0.6\cxxClassGraphHeight\vbox to 0pt{% \hbox to 0pt{\hss\textbf{$\lor$}\hss}\vss}}}% \newcommand{\cxxLinkLeft}{\hbox to 0pt{\hss\hskip 0.0\cxxClassGraphShift% \raise0.0\cxxClassGraphHeight\hbox to 0pt{\textbf{\tt\<}\hss}}}% \newcommand{\cxxLinkRight}{\hbox to 0pt{\hss\hskip 1.0\cxxClassGraphShift% \raise0.0\cxxClassGraphHeight\hbox to 0pt{\hss\textbf{\tt\>}}}}% \newcommand{\cxxInheritanceEntry}[5][]{ \hbox to \hsize{\hss% \vrule width0pt height \cxxClassGraphHeight depth \cxxClassGraphDepth% ##2% \def\tmp{##1}% \ifx\tmp\empty% \def\tmp{##5}% \ifx\tmp\empty% \rBox[1pt]{##3}{##4}{0.24\hsize}% \else% \lBox[1pt]{##3}{##4}{0.24\hsize}% \fi% \else% \cBox[2pt]{##3}{##4}{0.24\hsize}% \fi% ##5\hfill% }\vskip-1pt } \newcommand{\cxxNone}{\cxxCGSpace{\hss}} \newcommand{\cxxLong}{\cxxCGSpace{\hss\cxxVup\cxxVlow\hss}} % \newcommand{\cxxPubLeft}{\cxxCGSpace{\cxxHline\cxxVup\cxxVlow\hss}} \newcommand{\cxxProLeft}{\cxxCGSpace{\cxxSlashHline\cxxVup\cxxVlow\hss}} \newcommand{\cxxPriLeft}{\cxxCGSpace{\cxxDotHline\cxxVup\cxxVlow\hss}} \newcommand{\cxxPubleft}{\cxxCGSpace{\cxxHline\cxxVlow\hss}} \newcommand{\cxxProleft}{\cxxCGSpace{\cxxSlashHline\cxxVlow\hss}} \newcommand{\cxxPrileft}{\cxxCGSpace{\cxxDotHline\cxxVlow\hss}} \newcommand{\cxxLastPubLeft}{\cxxCGSpace{\cxxHline% \cxxVup\cxxLinkDown\cxxVlow\hss}} \newcommand{\cxxLastProLeft}{\cxxCGSpace{\cxxSlashHline% \cxxVup\cxxLinkDown\cxxVlow\hss}} \newcommand{\cxxLastPriLeft}{\cxxCGSpace{\cxxDotHline% \cxxVup\cxxLinkDown\cxxVlow\hss}} \newcommand{\cxxLastPubleft}{\cxxCGSpace{\cxxHline% \cxxVlow\cxxLinkDown\hss}} \newcommand{\cxxLastProleft}{\cxxCGSpace{\cxxSlashHline% \cxxVlow\cxxLinkDown\hss}} \newcommand{\cxxLastPrileft}{\cxxCGSpace{\cxxDotHline% \cxxVlow\cxxLinkDown\hss}} \newcommand{\cxxLinkPubLeft}{\cxxCGSpace{\cxxLinkLeft\cxxHline\cxxVup\cxxVlow\hss}} \newcommand{\cxxLinkProLeft}{\cxxCGSpace{\cxxLinkLeft\cxxSlashHline% \cxxVup\cxxVlow\hss}} \newcommand{\cxxLinkPriLeft}{\cxxCGSpace{\cxxLinkLeft\cxxDotHline% \cxxVup\cxxVlow\hss}} \newcommand{\cxxLinkPubleft}{\cxxCGSpace{\cxxLinkLeft\cxxHline\cxxVlow\hss}} \newcommand{\cxxLinkProleft}{\cxxCGSpace{\cxxLinkLeft\cxxSlashHline\cxxVlow\hss}} \newcommand{\cxxLinkPrileft}{\cxxCGSpace{\cxxLinkLeft\cxxDotHline\cxxVlow\hss}} % \newcommand{\cxxPubRight}{\cxxCGSpace{\hss\cxxVup\cxxVlow\cxxHline}} \newcommand{\cxxProRight}{\cxxCGSpace{\hss\cxxVup\cxxVlow\cxxSlashHline}} \newcommand{\cxxPriRight}{\cxxCGSpace{\hss\cxxVup\cxxVlow\cxxDotHline}} \newcommand{\cxxPubright}{\cxxCGSpace{\hss\cxxVup\cxxHline}} \newcommand{\cxxProright}{\cxxCGSpace{\hss\cxxVup\cxxSlashHline}} \newcommand{\cxxPriright}{\cxxCGSpace{\hss\cxxVup\cxxDotHline}} \newcommand{\cxxLinkPubRight}{\cxxCGSpace{\hss\cxxVup\cxxVlow\cxxHline\cxxLinkRight}} \newcommand{\cxxLinkProRight}{\cxxCGSpace{\hss\cxxVup\cxxVlow% \cxxSlashHline\cxxLinkRight}} \newcommand{\cxxLinkPriRight}{\cxxCGSpace{\hss\cxxVup\cxxVlow% \cxxDotHline\cxxLinkRight}} \newcommand{\cxxLinkPubright}{\cxxCGSpace{\hss\cxxVup\cxxHline\cxxLinkRight}} \newcommand{\cxxLinkProright}{\cxxCGSpace{\hss\cxxVup\cxxSlashHline\cxxLinkRight}} \newcommand{\cxxLinkPriright}{\cxxCGSpace{\hss\cxxVup\cxxDotHline\cxxLinkRight}} \newcommand{\cxxFirstPubRight}{\cxxCGSpace{\hss\cxxVup\cxxLinkUp\cxxVlow\cxxHline}} \newcommand{\cxxFirstProRight}{\cxxCGSpace{\hss\cxxVup\cxxLinkUp\cxxVlow% \cxxSlashHline}} \newcommand{\cxxFirstPriRight}{\cxxCGSpace{\hss\cxxVup\cxxLinkUp\cxxVlow\cxxDotHline}} \newcommand{\cxxFirstPubright}{\cxxCGSpace{\hss\cxxVup\cxxLinkUp\cxxHline}} \newcommand{\cxxFirstProright}{\cxxCGSpace{\hss\cxxVup\cxxLinkUp\cxxSlashHline}} \newcommand{\cxxFirstPriright}{\cxxCGSpace{\hss\cxxVup\cxxLinkUp\cxxDotHline}} }{ \endgroup } \newenvironment{cxxClassGraph}{ \begin{cxxInheritance} \newcommand{\cxxClassGraphEntry}[4]{ \hbox to \hsize{\hss% \vrule width0pt height \cxxClassGraphHeight depth \cxxClassGraphDepth% ##1% \def\tmp{##4}% \rBox[1pt]{##2}{##3}{0.24\hsize}% ##4% \hskip\cxxClassGraphShift\dotfill% \hbox to \cxxClassGraphShift{\hss\pageref{cxx.##2}}% }\vskip-1pt } \clearpage \pagebreak\strut \makeHeadLine{}{Class Graph} \vskip 20pt \hbox to \hsize{\Huge\bf \quad Class Graph\hss} \vskip 40pt } { \end{cxxInheritance} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for generic manual entries % arguments are: % #1 type % #2 name % #3 args % #4 memo % #5 number % \newdimen\cxxgenericstart \cxxgenericstart=\labelwidth \advance\cxxgenericstart by \labelsep \newdimen\cxxgenericwidth \cxxgenericwidth=\textwidth \advance\cxxgenericwidth by -\cxxgenericstart \newcounter{cxxDepth} \setcounter{cxxDepth}{0} \newlength{\cxxSize} % begin LHH % changes affect vertical spacing around and within most full-width boxes \newenvironment{cxxgeneric}[5]{ % % some local definitions % \def\empty{} \def\type{#1} \def\args{#3} \def\memo{#4} \def\id {#5} % % pagebreak ? % \ifcase \value{cxxDepth} % \clearpage % 0 % \pagebreak % \makeHeadLine{#5}{#2} % \setlength{\cxxSize}{2pt} \strut\smallskip\goodbreak% \setlength{\cxxSize}{1pt} \or % 1 \strut\smallskip\goodbreak% \setlength{\cxxSize}{1pt} \else % >2 \strut\smallskip\goodbreak% \setlength{\cxxSize}{0.5pt} \fi \addtocounter{cxxDepth}{1} % % write synopsis % \titleBox[\cxxSize]{\id}{\begingroup \catcode`\&=12% \catcode`\_=12% \vspace*{-1em} \begin{flushleft} \quad\normalsize% \ifx\type\empty \ifx\args\empty \strut{\bf #2}\\ \else \strut{\bf #2}\ \args \fi \else \strut\type\ {\bf #2}\ \args \fi \end{flushleft} \vspace*{-1em} \endgroup} \label{cxx.\id} \par %\smallskip }{ \addtocounter{cxxDepth}{-1} } % end LHH %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for function manual entries % arguments are: % #1 type % #2 name % #3 args % #4 memo % \newenvironment{cxxfunction}[5]{ \begin{cxxgeneric}{#1}{#2}{#3}{#4}{#5} \renewenvironment{cxxnames}{\begin{cxxlist}{Arguments}}{\end{cxxlist}} }{ \end{cxxgeneric} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for manual entries % arguments are: % #1 type % #2 name % #3 args % #4 memo % \newenvironment{cxxentry}[5]{ \begin{cxxgeneric}{#1}{#2}{#3}{#4}{#5}}{\end{cxxgeneric}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for union manual entries % arguments are: % #1 type % #2 name % #3 args % #4 memo % \newenvironment{cxxunion}[5]{ \begin{cxxgeneric}{#1}{#2}{#3}{#4}{#5} \renewenvironment{cxxnames}{\begin{cxxlist}{Members}}{\end{cxxlist}} }{ \end{cxxgeneric} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for typedef manual entries % arguments are: % #1 type % #2 name % #3 args % #4 memo % \newenvironment{cxxtypedef}[5]{ \begin{cxxgeneric}{#1}{#2}{}{#4}{#5} \renewenvironment{cxxnames}{\begin{cxxlist}{Members}}{\end{cxxlist}} }{ \end{cxxgeneric} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for macro manual entries % arguments are: % #1 type % #2 name % #3 args % #4 memo % \newenvironment{cxxmacro}[5]{ \begin{cxxgeneric}{\#define}{#2}{#3}{#4}{#5}}{\end{cxxgeneric}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for class manual entries % arguments are: % #1 type % #2 name % #3 args % #4 memo % \newenvironment{cxxclass}[5]{ \begin{cxxgeneric}{#1}{#2}{#3}{#4}{#5}}{\end{cxxgeneric}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for class manual entries % arguments are: % #1 type % #2 name % #3 args % #4 memo % \newenvironment{cxxvariable}[5]{ \begin{cxxgeneric}{#1}{#2}{#3}{#4}{#5} \renewenvironment{cxxnames}{\begin{cxxlist}{Names}}{\end{cxxlist}} }{ \end{cxxgeneric} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for documentation % \newenvironment{cxxdocumentation}{ % % switch on special characters for documentation section % \begingroup \catcode`\&=4 \catcode`\_=8 }{ \endgroup } \newenvironment{cxxdoc}{ % % switch on special characters for documentation section % \begin{cxxdocumentation} \strut\par }{ \end{cxxdocumentation} } \newenvironment{cxxsee}{ % % switch on special characters for documentation section % \begin{cxxdocumentation} \paragraph{See Also:\qquad} }{ \end{cxxdocumentation} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % environment for commented listing % arguments are: % #1 Section title % \newenvironment{cxximplementation}[1]{ \goodbreak \begin{cxxdocumentation} }{ \end{cxxdocumentation} } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\cxxCodeLine#1{ \strut\hbox to 20pt{\tiny\hss #1}\small %\advance\leftmargin by 20pt %\advance\textwidth by -20pt \ccverbatim \parskip=0pt \cxxCodeFinish} {\catcode`\=0 catcode`\=12 gdefcxxCodeFinish#1{hbox{#1}endgroup}} ccseapps-2.5/CCSEApps/BoxLib/Pointers.H0000644000175000017500000003262111634153073020756 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_POINTERS_H #define BL_POINTERS_H // // $Id: Pointers.H,v 1.16 2001/07/31 22:43:19 lijewski Exp $ // #include #include #include // //@Man: //@Memo: A Smart Pointer for Intrinsic or User-Defined Types /*@Doc: The template class CpPtr provides a simple wrapper around a pointer to type T (T*) that builds a copy of the pointed-to object when copied from one CpPtr to another. This is in contrast to a reference-counted pointer class that would maintain one pointed-to object with a reference count indicating the number of references. Hence we call this a "copied" smart pointer class. It is intended for use with any type type T, including the intrinsic types. This class does not supply an operator->(), as such an operator on intrinsic types has only recently become a part of the C++ language, and many compilers do not yet implement it. */ template class CpPtr { public: // //@ManDoc: The default constructor. The wrapped pointer is null. // CpPtr (); // //@ManDoc: Construct a CpPtr setting the wrapped pointer to rhs. // explicit CpPtr (T* rhs); // //@ManDoc: The destructor. Deletes the wrapped pointer. // ~CpPtr (); /*@ManDoc: The copy constructor. If the pointer wrapped by rhs is null, the wrapped pointer is null here as well. Otherwise, the contained pointer here is set to a new'd copy of that wrapped by rhs, with the two pointed-to values being identical. This assumes that type T has a well-defined and accessible copy constructor. T must also be a concrete type, not a abstract type. */ CpPtr (const CpPtr& rhs); /*@ManDoc: Sets the wrapped pointer to rhs. Deletes the previously wrapped pointer. */ CpPtr& operator= (T* rhs); /*@ManDoc: The copy assignment operator. If the pointer wrapped by rhs is null, the wrapped pointer is null here as well. Otherwise, the contained pointer here is set to a new'd copy of that wrapped by rhs, with the two pointed-to values being identical. This assumes that type T has a well-defined and accessible copy constructor. T must also be a concrete type, not a abstract type. */ CpPtr& operator= (const CpPtr& rhs); /*@ManDoc: Returns a reference to the value pointed to by the wrapped pointer; i.e. dereferencing this CpPtr, returns the dereferenced wrapped pointer. It is an error if the wrapped pointer is null. */ T& operator* () const; // //@ManDoc: Returns true if the wrapped pointer null. // bool isNull () const; // //@ManDoc: Sets the wrapped pointer to null and returns the previous value. // T* release (); // //@ManDoc: Are the two pointers (not the values to which they point) equal? // bool operator== (const CpPtr& rhs) const; // //@ManDoc: Are the two pointers not equal? // bool operator!= (const CpPtr& rhs) const; protected: T* ptr; }; // //@Man: //@Memo: A Smart Pointer for User-Defined Types /*@Doc: The template class CpClassPtr is derived from CpPtr. It provides a simple wrapper around a pointer to type T (a T*) that "does the right thing" when copied from one CpPtr to another. The type T MUST be a user-defined type, not an intrinsic type. Given this restriction, we can supply an operator->(). */ template class CpClassPtr : public CpPtr { public: // //@ManDoc: The default constructor. The wrapped pointer is null. // CpClassPtr (); // //@ManDoc: Construct a CpPtr setting the wrapped pointer to rhs. // explicit CpClassPtr (T* rhs); /*@ManDoc: The copy constructor. If the pointer wrapped by rhs is null, the wrapped pointer is null here as well. Otherwise, the contained pointer here is set to a new'd copy of that wrapped by rhs, with the two pointed-to values being identical. This assumes that type T has a well-defined and accessible copy constructor. T must also be a concrete type, not a abstract type. */ CpClassPtr (const CpClassPtr& rhs); /*@ManDoc: Sets the wrapped pointer to rhs. Deletes the previously wrapped pointer. */ CpClassPtr& operator= (T* rhs); /*@ManDoc: The copy assignment operator. If the pointer wrapped by rhs is null, the wrapped pointer is null here as well. Otherwise, the contained pointer here is set to a new'd copy of that wrapped by rhs, with the two pointed-to values being identical. This assumes that type T has a well-defined and accessible copy constructor. T must also be a concrete type, not a abstract type. */ CpClassPtr& operator= (const CpClassPtr& rhs); // //@ManDoc: Applies operator-> to the wrapped pointer. // T* operator-> () const; }; // //@Man: //@Memo: A Reference Counted Smart Pointer for Intrinsic or User-Defined Types /*@Doc: The template class LnPtr provides a reference counted wrapper around a pointer to type T (a T*). This "smart" pointer is intended for use with any type type T, including the intrinsic types. For this reason, we do not supply an operator->(), as such an operator on intrinsic types has only recently become a part of the C++ language and many compilers do not yet implement it. */ template class LnPtr { public: // //@ManDoc: The default constructor. The wrapped pointer is null. // LnPtr (); // //@ManDoc: Construct a LnPtr setting the wrapped pointer to rhs. // explicit LnPtr (T* rhs); /*@ManDoc: The copy assignment operator. The contained pointer is set to the one wrapped by rhs. The reference count is decremented on this object and the reference count is incremented for the newly wrapped pointer. */ LnPtr& operator= (const LnPtr& rhs); /*@ManDoc: Sets the wrapped pointer to rhs. Decrements the count on the previously wrapped pointer and deletes it if there was only one reference. */ LnPtr& operator= (T* rhs); /*@ManDoc: The destructor -- decrements the reference count and deletes the wrapped pointer if there is only one reference. */ ~LnPtr (); // //@ManDoc: Returns true if only one reference to the wrapped pointer. // bool unique () const; // //@ManDoc: Returns the number of references to the wrapped pointer. // int linkCount () const; /*@ManDoc: Returns a reference to the value pointed to by the wrapped pointer; i.e. dereferencing this LnPtr, returns the dereferenced wrapped pointer. It is an error if the wrapped pointer is null. */ T& operator* () const; // //@ManDoc: Returns true if the wrapped pointer is null. // bool isNull () const; // //@ManDoc: Are the two pointers (not the values to which they point) equal? // bool operator== (const LnPtr& rhs) const; // //@ManDoc: Are the two pointers not equal? // bool operator!= (const LnPtr& rhs) const; protected: T* ptr; private: UseCount ucnt; }; // //@Man: //@Memo: A Smart Reference Counted Pointer for User-Defined Types /*@Doc: The template class LnClassPtr is derived from LnPtr. It provides a reference counted wrapper around a pointer to type T (a T*). The type T MUST be a user-defined type, not an intrinsic type. Given this restriction, we can supply an operator->(). */ template class LnClassPtr : public LnPtr { public: // //@ManDoc: The default constructor. The wrapped pointer is null. // LnClassPtr (); // //@ManDoc: Construct a LnPtr setting the wrapped pointer to rhs. // explicit LnClassPtr (T* rhs); /*@ManDoc: The copy assignment operator. The contained pointer is set to the one wrapped by rhs. The reference count is decremented on this object and the reference count is incremented for the newly wrapped pointer. */ LnClassPtr& operator= (const LnClassPtr& rhs); /*@ManDoc: Sets the wrapped pointer to rhs. Decrements the count on the previously wrapped pointer and deletes it if there was only one reference. */ LnClassPtr& operator= (T* rhs); // //@ManDoc: Applies operator-> to the wrapped pointer. // T* operator->() const; }; template inline CpPtr::CpPtr () : ptr(0) {} template inline CpPtr::CpPtr (T* rhs) : ptr(rhs) {} template CpPtr::~CpPtr() { delete ptr; } template inline bool CpPtr::isNull () const { return ptr == 0; } template CpPtr::CpPtr (const CpPtr& rhs) { ptr = rhs.isNull() ? 0 : new T(*rhs.ptr); } template CpPtr& CpPtr::operator= (const CpPtr& rhs) { if (!(ptr == rhs.ptr)) { delete ptr; ptr = rhs.isNull() ? 0 : new T(*rhs.ptr); } return *this; } template CpPtr& CpPtr::operator= (T* rhs) { delete ptr; ptr = rhs; return *this; } template inline T& CpPtr::operator* () const { BL_ASSERT(ptr != 0); return *ptr; } template T* CpPtr::release () { T* old = ptr; ptr = 0; return old; } template inline bool CpPtr::operator== (const CpPtr& rhs) const { return ptr == rhs.ptr; } template inline bool CpPtr::operator!= (const CpPtr& rhs) const { return ptr != rhs.ptr; } template inline CpClassPtr::CpClassPtr () : CpPtr() {} template inline CpClassPtr::CpClassPtr (T* rhs) : CpPtr(rhs) {} template CpClassPtr::CpClassPtr (const CpClassPtr& rhs) : CpPtr(rhs) {} template inline CpClassPtr& CpClassPtr::operator= (T* rhs) { CpPtr::operator= (rhs); return *this; } template inline CpClassPtr& CpClassPtr::operator= (const CpClassPtr& rhs) { CpPtr::operator= (rhs); return *this; } template inline T* CpClassPtr::operator-> () const { return this->ptr; } template LnPtr::LnPtr () : ptr(0) {} template LnPtr::LnPtr(T* rhs) : ptr(rhs) {} template LnPtr& LnPtr::operator= (T* rhs) { if (unique()) delete ptr; ptr = rhs; ucnt = UseCount(); return *this; } template inline bool LnPtr::unique () const { return ucnt.unique(); } template LnPtr::~LnPtr () { if (ucnt.unique()) delete ptr; } template LnPtr& LnPtr::operator= (const LnPtr& rhs) { if (ptr != rhs.ptr) { if (unique()) delete ptr; ptr = rhs.ptr; ucnt = rhs.ucnt; } return *this; } template inline int LnPtr::linkCount () const { return ucnt.linkCount(); } template inline T& LnPtr::operator* () const { BL_ASSERT(ptr != 0); return *ptr; } template inline bool LnPtr::isNull () const { return ptr == 0; } template bool LnPtr::operator== (const LnPtr& rhs) const { return ptr == rhs.ptr; } template bool LnPtr::operator!= (const LnPtr& rhs) const { return ptr != rhs.ptr; } template LnClassPtr::LnClassPtr () {} template LnClassPtr::LnClassPtr (T* rhs) : LnPtr(rhs) {} template LnClassPtr& LnClassPtr::operator= (const LnClassPtr& rhs) { LnPtr::operator=(rhs); return *this; } template inline LnClassPtr& LnClassPtr::operator= (T* rhs) { LnPtr::operator=(rhs); return *this; } template inline T* LnClassPtr::operator->() const { return this->ptr; } #endif /*BL_POINTERS_H*/ ccseapps-2.5/CCSEApps/BoxLib/BaseFab.H0000644000175000017500000021672211634153073020444 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_BASEFAB_H #define BL_BASEFAB_H // // $Id: BaseFab.H,v 1.51 2003/01/23 20:10:01 car Exp $ // #include #include #include #include #include #include #include #include #include #include #include // //@Man: //@Memo: A Fortran Array-like Object /*@Doc: BaseFab emulates the Fortran array concept. Useful operations can be performed upon BaseFab's in C++, and they provide a convenient interface to Fortran when it is necessary to retreat into that language. `BaseFab' is a template class. Through use of the template, a `BaseFab' may be based upon any class. So far at least, most applications have been based upon simple types like `integer''s, `real*4''s, or `real*8''s. Most applications do not use BaseFab's directly, but utilize specialized classes derived from BaseFab. It will be easier to use a `BaseFab' if you understand the following concepts. `BaseFab' objects depend on the dimensionality of space (indirectly through the DOMAIN `Box' member). It is typical to define the macro `SPACEDIM' to be 1, 2, or 3 to indicate the dimension of space. See the discussion of class `Box' for more information. A `BaseFab' contains a `Box' DOMAIN, which indicates the integer indexing space over which the array is defined. A `BaseFab' also has NVAR components. By components, we mean that for each point in the rectangular indexing space, there are NVAR values associated with that point. A Fortran array corresponding to a `BaseFab' would have (SPACEDIM+1) dimensions. By design, the array layout in a `BaseFab' mirrors that of a Fortran array. The first index (x direction for example) varies most rapidly, the next index (y direction), if any, varies next fastest. The component index varies last, after all the spatial indices. It is sometimes convenient to be able to treat a sub-array within an existing `BaseFab' as a `BaseFab' in its own right. This is often referred to as 'aliasing' the `BaseFab'. Note that when aliasing is used, the BaseFab's domain will not, in general, be the same as the parent BaseFab's domain, nor will the number of components. BaseFab is a dimension dependent class, so SPACEDIM must be defined as either 1, 2, or 3 when compiling. This is NOT a polymorphic class. It does NOT provide a copy constructor or assignment operator. T MUST have a default constructor and an assignment operator. */ template class BaseFab { public: typedef T value_type; class BFProxy { friend class BaseFab; public: BFProxy operator() (const Box& bx, int n) const; BFProxy operator() (const Box& bx) const; BFProxy operator() (int n) const; BFProxy& operator= (const T& t); private: enum {ALL = -1}; BFProxy (BaseFab& bf, const Box& bx, int n); BaseFab& m_fab; const Box m_bx; int slice; }; class CBFProxy { friend class BaseFab; public: CBFProxy operator() (const Box& bx, int n) const; CBFProxy operator() (const Box& bx) const; CBFProxy operator() (int n) const; private: enum {ALL = -1}; CBFProxy (BaseFab& bf, const Box& bx, int n); const BaseFab& m_fab; const Box m_bx; int slice; }; /*@ManDoc: Construct an invalid `BaseFab'. The domain is invalid, the number of components is zero, and no actually array memory is allocated. An invalid `BaseFab' must be resized (see `BaseFab::resize') before use. */ BaseFab (); BaseFab (const BaseFab&); BaseFab& operator= (const BaseFab&); BaseFab& operator= (const T&); // // Proxy Interface // BFProxy operator() (const Box& bx, int n); BFProxy operator() (const Box& bx); BFProxy operator() (int n); CBFProxy operator() (const Box& bx, int n) const; CBFProxy operator() (const Box& bx) const; CBFProxy operator() (int n) const; // //@ManDoc: Make BaseFab with desired domain and number of components. // explicit BaseFab (const Box& bx, int n = 1); // //@ManDoc: The destructor deletes the array memory. // ~BaseFab (); /*@ManDoc: This function resizes a `BaseFab' so it covers the `Box' B with N components. The default action is that under resize()ing, the memory allocated for the `BaseFab' only grows and never shrinks. This function is particularly useful when a `BaseFab' is used as a temporary space which must be a different size whenever it is used. Resize()ing a temp will often be faster than re-allocating a `BaseFab' because memory allocation can often be avoided. */ void resize (const Box& b, int N = 1); /*@ManDoc: The function returns the `BaseFab' to the invalid state. (See comments for constructors above.) The memory is freed. */ void clear (); // //@ManDoc: Returns the number of components. // int nComp () const; // //@ManDoc: Returns the domain (box) where the array is defined. // const Box& box () const; /*@ManDoc: Returns a pointer to an array of SPACEDIM integers giving the length of the domain in each direction. */ const int* length () const; /*@ManDoc: Returns the lower corner of the domain. See class `Box' for analogue. */ const IntVect& smallEnd () const; /*@ManDoc: Returns the upper corner of the domain. See class `Box' for analogue. */ const IntVect& bigEnd () const; /*@ManDoc: Returns the lower corner of the domain. Instead of returning them in the form of INTVECT's, as in smallEnd and bigEnd, it returns the values as a pointer to an array of constant integers. This is useful when interfacing to Fortran subroutines. */ const int* loVect () const; /*@ManDoc: Returns the upper corner of the domain. Instead of returning them in the form of INTVECT's, as in smallEnd and bigEnd, it returns the values as a pointer to an array of constant integers. This is useful when interfacing to Fortran subroutines. */ const int* hiVect () const; /*@ManDoc: Returns true if the domain of fab is totally contained within the domain of this `BaseFab'. */ bool contains (const BaseFab& fab) const; /*@ManDoc: Returns true if bx is totally contained within the domain of this `BaseFab'. */ bool contains (const Box& bx) const; /*@ManDoc: Returns a pointer to an object of type T that is the value of the Nth component associated with the cell at the low end of the domain. This is commonly used to get a pointer to data in the array which is then handed off to a Fortran subroutine. Remember that data is stored in Fortran array order, with the component index coming last. In other words, `dataPtr' returns a pointer to all the Nth components. */ T* dataPtr (int N = 0); // //@ManDoc: Same as above except works on const FAB's. // const T* dataPtr (int N = 0) const; // //@ManDoc: Returns true if the data for the FAB has been allocated. // bool isAllocated () const; /*@ManDoc: Returns a reference to the Nth component value defined at position p in the domain. This operator may be inefficient if the C++ compiler is unable to optimize the C++ code. */ T& operator() (const IntVect& p, int N); // //@ManDoc: Same as above, except returns component 0. // T& operator() (const IntVect& p); // //@ManDoc: Same as above except works on const FAB's. // const T& operator() (const IntVect& p, int N) const; // //@ManDoc: Same as above, except returns component 0. // const T& operator() (const IntVect& p) const; /*@ManDoc: This function puts numcomp component values, starting at component N, from position pos in the domain into array data, that must be allocated by the user. */ void getVal (T* data, const IntVect& pos, int N, int numcomp) const; /*@ManDoc: Same as above, except that starts at component 0 and copies ALL comps. */ void getVal (T* data, const IntVect& pos) const; /*@ManDoc: The setVal functions set subregions in the `BaseFab' to a constant value. This most general form specifies the sub-box, the starting component number, and the number of components to be set. */ void setVal (T x, const Box& bx, int nstart, int ncomp); /*@ManDoc: Same as above, except the number of modified components is one. N is the component to be modified. */ void setVal (T x, const Box& bx, int N); // //@ManDoc: Same as above, except the subbox defaults to the entire domain. // void setVal (T x, int N); // //@ManDoc: Same as above, except ALL components are set. // void setVal (T x); /*@ManDoc: This function is analogous to the fourth form of setVal above, except that instead of setting values on the `Box' b, values are set on the complement of b in the domain. */ void setComplement (T x, const Box& b, int ns, int num); /*@ManDoc: The `copy' functions copy the contents of one `BaseFab' into another. The destination `BaseFab' is always the object which invokes the function. This, the most general form of copy, specifies the contents of any sub-box srcbox in `BaseFab' src may be copied into a (possibly different) destbox in the destination `BaseFab'. Note that although the srcbox and the destbox may be disjoint, they must be the same size and shape. If the sizes differ, the copy is undefined and a runtime error results. This copy function is the only one of the copy functions to allow a copy between differing boxes. The user also specifies how many components are copied, starting at component srccomp in src and stored starting at component destcomp. Note that the actual copy is made by the function `performCopy' of this class. The results are UNDEFINED if the src and dest are the same and the srcbox and destbox overlap. */ BaseFab& copy (const BaseFab& src, const Box& srcbox, int srccomp, const Box& destbox, int destcomp, int numcomp); /*@ManDoc: As above, except the destination `Box' and the source `Box' are taken to be the entire domain of the destination. A copy of the intersecting region is performed. Note that the actual copy is made by the function `performCopy' of this class. */ BaseFab& copy (const BaseFab& src, int srccomp, int destcomp, int numcomp = 1); /*@ManDoc: As above, except that the destination `Box' is specified, but the source `Box' is taken to the equal to the source `Box', and all components of the destination `BaseFab' are copied. Note that the actual copy is made by the function `performCopy' of this class. */ BaseFab& copy (const BaseFab& src, const Box& destbox); /*@ManDoc: As above, except that the destbox defaults to the entire domain of the destination BaseFab, and all components are copied. Note that the actual copy is made by the function `performCopy' of this class. */ BaseFab& copy (const BaseFab& src); /*@ManDoc: Perform shifts upon the domain of the `BaseFab'. They are completely analogous to the corresponding `Box' functions. There is no effect upon the array memory. */ BaseFab& shift (const IntVect& v); /*@ManDoc: Perform shifts upon the domain of the `BaseFab'. They are completely analogous to the corresponding `Box' functions. There is no effect upon the array memory. */ BaseFab& shift (int idir, int n_cell); /*@ManDoc: Perform shifts upon the domain of the `BaseFab'. They are completely analogous to the corresponding `Box' functions. There is no effect upon the array memory. */ BaseFab& shiftHalf (int dir, int num_halfs); /*@ManDoc: Perform shifts upon the domain of the `BaseFab'. They are completely analogous to the corresponding `Box' functions. There is no effect upon the array memory. */ BaseFab& shiftHalf (const IntVect& num_halfs); /*@ManDoc: Compute the Lp-norm of this FAB using components (scomp : scomp+ncomp-1). p < 0 -> ERROR p = 0 -> infinity norm (max norm) p = 1 -> sum of ABS(FAB) */ Real norm (int p, int scomp = 0, int ncomp = 1) const; // //@ManDoc: Same as above except only on given subbox. // Real norm (const Box& subbox, int p, int scomp = 0, int ncomp = 1) const; // //@ManDoc: Compute absolute value for all components of this FAB. // void abs (); // //@ManDoc: Same as above except only for components (comp: comp+numcomp-1) // void abs (int comp, int numcomp=1); // //@ManDoc: Calculate abs() on subbox for given component range. // void abs (const Box& subbox, int comp = 0, int numcomp=1); // //@ManDoc: Minimum value of given component. // T min (int comp = 0) const; // //@ManDoc: Minimum value of given component in given subbox. // T min (const Box& subbox, int comp = 0) const; // //@ManDoc: Maximum value of given component. // T max (int comp = 0) const; // //@ManDoc: Maximum value of given component in given subbox. // T max (const Box& subbox, int comp = 0) const; // //@ManDoc: Find location of minimum value in given component. // IntVect minIndex (int comp = 0) const; /*@ManDoc: Find location of minimum value in given component in given subbox. */ IntVect minIndex (const Box& subbox, int comp = 0) const; // //@ManDoc: Find location of maximum value in given component. // IntVect maxIndex (int comp = 0) const; /*@ManDoc: Find location of maximum value in given component in given subbox. */ IntVect maxIndex (const Box& subbox, int comp = 0) const; /*@ManDoc: Compute mask array with value of 1 in cells where BaseFab has value less than val, 0 otherwise. mask is resized by this function. The number of cells marked with 1 returned. */ int maskLT (BaseFab& mask, T val, int comp = 0) const; /*@ManDoc: Same as above except mark cells with value less than or equal to val. */ int maskLE (BaseFab& mask, T val, int comp = 0) const; // //@ManDoc: Same as above except mark cells with value equal to val. // int maskEQ (BaseFab& mask, T val, int comp = 0) const; // //@ManDoc: Same as above except mark cells with value greater than val. // int maskGT (BaseFab& mask, T val, int comp = 0) const; /*@ManDoc: Same as above except mark cells with value greater than or equal to val. */ int maskGE (BaseFab& mask, T val, int comp = 0) const; // //@ManDoc: Fill with a pattern of numbers. // void patternFill (int mark = 0); /*@ManDoc: Copies with index reversal from srcbox region of src into destbox region of this FAB. All components are copied and multiplied by corresponding multiplier. */ void copyRev (const Box& destbox, const BaseFab& src, const Box& srcbox, int reversal_index, T* multiplier); // //@ManDoc: Compute sum of given component of FAB state vector. // T sum (int comp, int numcomp = 1) const; /*@ManDoc: Compute sum of given component of FAB state vector in given subbox. */ T sum (const Box& subbox, int comp, int numcomp = 1) const; // //@ManDoc: Most general version, specify subbox and which components. // BaseFab& invert (T v, const Box& subbox, int comp=0, int numcomp=1); // //@ManDoc: As above except on entire domain. // BaseFab& invert (T v, int comp, int numcomp=1); // //@ManDoc: As above except on entire domain, all components. // BaseFab& invert (T v); // //@ManDoc: Negate BaseFab, most general. // BaseFab& negate (const Box& subbox, int comp=0, int numcomp=1); // //@ManDoc: As above, except on entire domain. // BaseFab& negate (int comp, int numcomp=1); // //@ManDoc: As above, except on entire domain and all components. // BaseFab& negate (); // //@ManDoc: Scalar addition (a[i] <- a[i] + r), most general. // BaseFab& plus (T r, const Box& b, int comp=0, int numcomp=1); // //@ManDoc: As above, except on entire domain. // BaseFab& plus (T r, int comp, int numcomp=1); // //@ManDoc: As above, except on entire domain and all components. // BaseFab& plus (T r); /*@ManDoc: Addition in place. This will often be more efficient than making new BaseFab for result. */ BaseFab& operator+= (T r); // //@ManDoc: FAB addition (a[i] <- a[i] + b[i]) in place. // BaseFab& operator+= (const BaseFab& f); // //@ManDoc: FAB addition (a[i] <- a[i] + b[i]). The same as += operator. // BaseFab& plus (const BaseFab& src); /*@ManDoc: Add src components (srccomp:srccomp+numcomp-1) to this FAB's components (destcomp:destcomp+numcomp-1) where the two FABs intersect. */ BaseFab& plus (const BaseFab& src, int srccomp, int destcomp, int numcomp=1); /*@ManDoc: Same as above except addition is restricted to intersection of subbox and src FAB. NOTE: subbox must be contained in this FAB. */ BaseFab& plus (const BaseFab& src, const Box& subbox, int srccomp, int destcomp, int numcomp=1); /*@ManDoc: Add srcbox region of src FAB to destbox region of this FAB. The srcbox and destbox must be same size. */ BaseFab& plus (const BaseFab& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp=1); /*@ManDoc: Scalar subtraction (a[i] <- a[i] - r). Note: use plus(-r) for more general operations. */ BaseFab& operator-= (T r); // //@ManDoc: FAB subtraction (a[i] <- a[i] - b[i]), in place. // BaseFab& operator-= (const BaseFab& f); // //@ManDoc: FAB subtraction (a[i] <- a[i] - b[i]). The same as -= operator. // BaseFab& minus (const BaseFab& src); /*@ManDoc: Subtract src components (srccomp:srccomp+numcomp-1) to this FAB's components (destcomp:destcomp+numcomp-1) where the two FABs intersect. */ BaseFab& minus (const BaseFab& src, int srccomp, int destcomp, int numcomp=1); /*@ManDoc: Same as above except subtraction is restricted to intersection of subbox and src FAB. NOTE: subbox must be contained in this FAB. */ BaseFab& minus (const BaseFab& src, const Box& subbox, int srccomp, int destcomp, int numcomp=1); /*@ManDoc: Subtract srcbox region of src FAB from destbox region of this FAB. srcbox and destbox must be same size. */ BaseFab& minus (const BaseFab& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp=1); // //@ManDoc: Scalar multiplication (a[i] <- a[i] * r), in place. // BaseFab& operator*= (T r); // //@ManDoc: Scalar multiplication (a[i] <- a[i] * r). The same as *=. // BaseFab& mult (T r); /*@ManDoc: Scalar multiplication, except control which components are multiplied. */ BaseFab& mult (T r, int comp, int numcomp=1); // //@ManDoc: As above, except specify sub-box. // BaseFab& mult (T r, const Box& b, int comp=0, int numcomp=1); // //@ManDoc: FAB multiplication (a[i] <- a[i] * b[i]), in place. // BaseFab& operator*= (const BaseFab& f); // //@ManDoc: As above. // BaseFab& mult (const BaseFab& src); /*@ManDoc: Multiply src components (srccomp:srccomp+numcomp-1) with this FAB's components (destcomp:destcomp+numcomp-1) where the two FABs intersect. */ BaseFab& mult (const BaseFab& src, int srccomp, int destcomp, int numcomp=1); /*@ManDoc: Same as above except multiplication is restricted to intersection of subbox and src FAB. NOTE: subbox must be contained in this FAB. */ BaseFab& mult (const BaseFab& src, const Box& subbox, int srccomp, int destcomp, int numcomp=1); /*@ManDoc: Multiply srcbox region of src FAB with destbox region of this FAB. The srcbox and destbox must be same size. */ BaseFab& mult (const BaseFab& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp=1); // //@ManDoc: Scalar division (a[i] <- a[i] / r), in place. // BaseFab& operator/= (T r); // //@ManDoc: Scalar division (a[i] <- a[i] / r), in place. // BaseFab& divide (T r); // //@ManDoc: As above except specify which components. // BaseFab& divide (T r, int comp, int numcomp=1); // //@ManDoc: As above except specify sub-box. // BaseFab& divide (T r, const Box& b, int comp=0, int numcomp=1); // //@ManDoc: FAB division, in place. // BaseFab& operator/= (const BaseFab& src); // //@ManDoc: Same as above. // BaseFab& divide (const BaseFab& src); /*@ManDoc: This FAB is numerator, src FAB is denominator divide src components (srccomp:srccomp+numcomp-1) into this FAB's components (destcomp:destcomp+numcomp-1) where the two FABs intersect. */ BaseFab& divide (const BaseFab& src, int srccomp, int destcomp, int numcomp=1); /*@ManDoc: Same as above except division is restricted to intersection of subbox and src FAB. NOTE: subbox must be contained in this FAB. */ BaseFab& divide (const BaseFab& src, const Box& subbox, int srccomp, int destcomp, int numcomp=1); /*@ManDoc: destbox region of this FAB is numerator. srcbox regions of src FAB is denominator. srcbox and destbox must be same size. */ BaseFab& divide (const BaseFab& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp=1); /*@ManDoc: Linear interpolation / extrapolation. Result is (t2-t)/(t2-t1)*f1 + (t-t1)/(t2-t1)*f2 Data is taken from b1 region of f1, b2 region of f2 and stored in b region of this FAB. Boxes b, b1 and b2 must be the same size. Data is taken from component comp1 of f1, comp2 of f2, and stored in component comp of this FAB. This FAB is returned as a reference for chaining. */ BaseFab& linInterp (const BaseFab& f1, const Box& b1, int comp1, const BaseFab& f2, const Box& b2, int comp2, Real t1, Real t2, Real t, const Box& b, int comp, int numcomp = 1); /*@ManDoc: Linear combination. Result is alpha*f1 + beta*f2. Data is taken from b1 region of f1, b2 region of f2 and stored in b region of this FAB. Boxes b, b1 and b2 must be the same size. Data is taken from component comp1 of f1, comp2 of f2, and stored in component comp of this FAB. This FAB is returned as a reference for chaining. */ BaseFab& linComb (const BaseFab& f1, const Box& b1, int comp1, const BaseFab& f2, const Box& b2, int comp2, Real alpha, Real beta, const Box& b, int comp, int numcomp = 1); protected: // // Allocates memory for the `BaseFab'. // void define (); // // Deallocates memory for the `BaseFab'. // void undefine (); // // The function called by BaseFab copy operations. // void performCopy (const BaseFab& src, const Box& srcbox, int srccomp, const Box& destbox, int destcomp, int numcomp); // // This function is called by the `BaseFab' setVal operations. // void performSetVal (T x, const Box& bx, int nstart, int numcomp); protected: Box domain; // My index space. int nvar; // Number components. long numpts; // Cached number of points in FAB. long truesize; // nvar*numpts that was allocated on heap. T* dptr; // The data pointer. }; template inline int BaseFab::nComp () const { return nvar; } template inline const Box& BaseFab::box () const { return domain; } template inline const int* BaseFab::length () const { return domain.length().getVect(); } template inline const IntVect& BaseFab::smallEnd () const { return domain.smallEnd(); } template inline const IntVect& BaseFab::bigEnd () const { return domain.bigEnd(); } template inline const int* BaseFab::loVect () const { return domain.loVect(); } template inline const int* BaseFab::hiVect () const { return domain.hiVect(); } template bool BaseFab::contains (const BaseFab& fab) const { return box().contains(fab.box()) && nvar <= fab.nvar; } template bool BaseFab::contains (const Box& bx) const { return box().contains(bx); } template inline T* BaseFab::dataPtr (int n) { BL_ASSERT(!(dptr == 0)); return &dptr[n*numpts]; } template inline const T* BaseFab::dataPtr (int n) const { BL_ASSERT(!(dptr == 0)); return &dptr[n*numpts]; } template inline bool BaseFab::isAllocated () const { return dptr != 0; } template inline T& BaseFab::operator() (const IntVect& p, int n) { BL_ASSERT(n >= 0); BL_ASSERT(n < nvar); BL_ASSERT(!(dptr == 0)); BL_ASSERT(domain.contains(p)); return dptr[domain.index(p)+n*numpts]; } template inline T& BaseFab::operator() (const IntVect& p) { BL_ASSERT(!(dptr == 0)); BL_ASSERT(domain.contains(p)); return dptr[domain.index(p)]; } template inline const T& BaseFab::operator() (const IntVect& p, int n) const { BL_ASSERT(n >= 0); BL_ASSERT(n < nvar); BL_ASSERT(!(dptr == 0)); BL_ASSERT(domain.contains(p)); return dptr[domain.index(p)+n*numpts]; } template inline const T& BaseFab::operator() (const IntVect& p) const { BL_ASSERT(!(dptr == 0)); BL_ASSERT(domain.contains(p)); return dptr[domain.index(p)]; } template void BaseFab::getVal (T* data, const IntVect& pos, int n, int numcomp) const { const int loc = domain.index(pos); const long size = domain.numPts(); BL_ASSERT(!(dptr == 0)); BL_ASSERT(n >= 0 && n + numcomp <= nvar); for (int k = 0; k < numcomp; k++) data[k] = dptr[loc+(n+k)*size]; } template void BaseFab::getVal (T* data, const IntVect& pos) const { getVal(data,pos,0,nvar); } template BaseFab& BaseFab::shift (const IntVect& v) { domain += v; return *this; } template BaseFab& BaseFab::shift (int idir, int n_cell) { domain.shift(idir,n_cell); return *this; } template BaseFab & BaseFab::shiftHalf (const IntVect& v) { domain.shiftHalf(v); return *this; } template BaseFab & BaseFab::shiftHalf (int idir, int n_cell) { domain.shiftHalf(idir,n_cell); return *this; } template void BaseFab::setVal (T val) { performSetVal(val,box(), 0, nvar); } template void BaseFab::setVal (T x, const Box& bx, int n) { performSetVal(x,bx,n,1); } template void BaseFab::setVal (T x, int n) { performSetVal(x,domain,n,1); } template void BaseFab::setVal (T x, const Box& b, int ns, int num) { performSetVal(x,b,ns,num); } template BaseFab& BaseFab::copy (const BaseFab& src, const Box& srcbox, int srccomp, const Box& destbox, int destcomp, int numcomp) { BL_ASSERT(destbox.ok()); BL_ASSERT(srcbox.sameSize(destbox)); BL_ASSERT(src.box().contains(srcbox)); BL_ASSERT(domain.contains(destbox)); BL_ASSERT(srccomp >= 0 && srccomp+numcomp <= src.nComp()); BL_ASSERT(destcomp >= 0 && destcomp+numcomp <= nvar); performCopy(src,srcbox,srccomp,destbox,destcomp,numcomp); return *this; } template BaseFab& BaseFab::copy (const BaseFab& src) { BL_ASSERT(nvar <= src.nvar); BL_ASSERT(domain.sameType(src.domain)); Box overlap(domain); overlap &= src.domain; if (overlap.ok()) performCopy(src,overlap,0,overlap,0,nvar); return *this; } template BaseFab& BaseFab::copy (const BaseFab& src, const Box& destbox) { BL_ASSERT(nvar <= src.nvar); BL_ASSERT(domain.contains(destbox)); Box overlap(destbox); overlap &= src.domain; if (overlap.ok()) performCopy(src,overlap,0,overlap,0,nvar); return *this; } template BaseFab& BaseFab::copy (const BaseFab& src, int srccomp, int destcomp, int numcomp) { BL_ASSERT(srccomp >= 0 && srccomp + numcomp <= src.nvar); BL_ASSERT(destcomp >= 0 && destcomp + numcomp <= nvar); Box overlap(domain); overlap &= src.domain; if (overlap.ok()) performCopy(src,overlap,srccomp,overlap,destcomp,numcomp); return *this; } template void BaseFab::define () { BL_ASSERT(nvar > 0); BL_ASSERT(dptr == 0); BL_ASSERT(numpts > 0); truesize = nvar*numpts; dptr = static_cast(BoxLib::The_Arena()->alloc(truesize*sizeof(T))); // // Now call T::T() on the raw memory so we have valid Ts. // T* ptr = dptr; for (int i = 0; i < truesize; i++, ptr++) new (ptr) T; } template void BaseFab::undefine () { // // Call T::~T() on the to-be-destroyed memory. // T* ptr = dptr; for (int i = 0; i < truesize; i++, ptr++) { ptr->~T(); } BoxLib::The_Arena()->free(dptr); dptr = 0; } template BaseFab::BaseFab () : domain(Box()), nvar(0), numpts(0), truesize(0), dptr(0) {} template BaseFab::BaseFab (const BaseFab& fab) : domain(fab.box()), nvar(fab.nComp()) { numpts = domain.numPts(); dptr = 0; define(); for ( int i = 0; i < numpts*nvar; ++i ) { dptr[i] = fab.dptr[i]; } } template BaseFab& BaseFab::operator= (const BaseFab& fab) { if ( this == &fab ) return *this; domain = fab.box(); nvar = fab.nComp(); numpts = domain.numPts(); dptr = 0; define(); for ( int i = 0; i < numpts*nvar; ++i ) { dptr[i] = fab.dptr[i]; } return *this; } template BaseFab& BaseFab::operator= (const T& t) { setVal(t); return *this; } template BaseFab::BaseFab (const Box& bx, int n) : domain(bx), nvar(n), numpts(bx.numPts()), dptr(0) { define(); } template void BaseFab::resize (const Box& b, int n) { nvar = n; domain = b; numpts = domain.numPts(); if (dptr == 0) { define(); } else if (nvar*numpts > truesize) { undefine(); define(); } } template BaseFab::~BaseFab () { undefine(); } template void BaseFab::clear () { undefine(); dptr = 0; domain = Box(); nvar = 0; numpts = 0; } // // performCopy() has been rewritten here so we can insert pragma's which // will enhance vectorization on the Cray's. The downside is that the // code is greatly expanded and rather incomprehensible. // template void BaseFab::performCopy (const BaseFab& src, const Box& srcbox, int srccomp, const Box& destbox, int destcomp, int numcomp) { BL_ASSERT(src.box().contains(srcbox)); BL_ASSERT(box().contains(destbox)); BL_ASSERT(destbox.sameSize(srcbox)); BL_ASSERT(srccomp >= 0 && srccomp+numcomp <= src.nComp()); BL_ASSERT(destcomp >= 0 && destcomp+numcomp <= nComp()); BL_PROFILE(BL_PROFILE_THIS_NAME() + "::performCopy()"); #if (BL_SPACEDIM == 1) { BL_ASSERT((destcomp) >= 0 && (destcomp) + (numcomp) <= nComp()); BL_ASSERT((srccomp) >= 0 && (srccomp) + (numcomp) <= (src).nComp()); Box _subbox_ = box(); _subbox_ &= destbox; BL_ASSERT(srcbox.sameSize(_subbox_)); if (_subbox_.ok()) { const int *_th_plo = loVect(); const int *_th_plen = length(); const int *_x_plo = (src).loVect(); const int *_x_plen = (src).length(); const int *_subbox_lo = _subbox_.loVect(); const int *_subbox_len = _subbox_.length().getVect(); const int *_bx_lo = (srcbox).loVect(); // const int *_bx_len = (srcbox).length().getVect(); T* _th_p = dataPtr(destcomp); const T* _x_p = (src).dataPtr(srccomp); for (int _n = 0; _n < (numcomp); ++_n) { T *_th_pp = _th_p + ((_subbox_lo[0]-_th_plo[0])+_n*_th_plen[0]); const T *_x_pp = _x_p + ((_bx_lo[0]-_x_plo[0])+_n*_x_plen[0]); #ifdef BL_ARCH_CRAY #pragma _CRI ivdep #endif for (int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { int iR = _i + _subbox_lo[0]; iR += 0; int ixR = _i + _bx_lo[0]; ixR += 0; T &thisR = * _th_pp; const T & srcR = _x_pp[_i]; #elif (BL_SPACEDIM == 2) { BL_ASSERT((destcomp) >= 0 && (destcomp) + (numcomp) <= nComp()); BL_ASSERT((srccomp) >= 0 && (srccomp) + (numcomp) <= (src).nComp()); Box _subbox_ = box(); _subbox_ &= destbox; BL_ASSERT(srcbox.sameSize(_subbox_)); if (_subbox_.ok()) { const int *_th_plo = loVect(); const int *_th_plen = length(); const int *_x_plo = (src).loVect(); const int *_x_plen = (src).length(); const int *_subbox_lo = _subbox_.loVect(); const int *_subbox_len = _subbox_.length().getVect(); const int *_bx_lo = (srcbox).loVect(); // const int *_bx_len = (srcbox).length().getVect(); T* _th_p = dataPtr(destcomp); const T* _x_p = (src).dataPtr(srccomp); for (int _n = 0; _n < (numcomp); ++_n) { int nR = _n + destcomp; nR += 0; int nxR = _n + srccomp; nxR += 0; for(int _j = 0; _j < _subbox_len[1]; ++_j) { const int jR = _j + _subbox_lo[1]; const int jxR = _j + _bx_lo[1]; T *_th_pp = _th_p + ((_subbox_lo[0] - _th_plo[0]) + _th_plen[0]*((jR - _th_plo[1]) + _n * _th_plen[1])); const T *_x_pp = _x_p + ((_bx_lo[0] - _x_plo[0]) + _x_plen[0]*((jxR - _x_plo[1]) + _n * _x_plen[1])); #ifdef BL_ARCH_CRAY # pragma _CRI ivdep #endif for (int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { T &thisR = * _th_pp; const T & srcR = _x_pp[_i]; #elif (BL_SPACEDIM == 3) { BL_ASSERT((destcomp) >= 0 && (destcomp) + (numcomp) <= nComp()); BL_ASSERT((srccomp) >= 0 && (srccomp) + (numcomp) <= (src).nComp()); Box _subbox_(box()); _subbox_ &= destbox; BL_ASSERT((srcbox).sameSize(_subbox_)); if (_subbox_.ok()) { const int *_th_plo = loVect(); const int *_th_plen = length(); const int *_x_plo = (src).loVect(); const int *_x_plen = (src).length(); const int *_subbox_lo = _subbox_.loVect(); const int *_subbox_len = _subbox_.length().getVect(); const int *_bx_lo = (srcbox).loVect(); // const int *_bx_len = (srcbox).length().getVect(); T* _th_p = dataPtr(destcomp); const T* _x_p = (src).dataPtr(srccomp); for (int _n = 0; _n < (numcomp); ++_n) { for (int _k = 0; _k < _subbox_len[2]; ++_k) { const int kR = _k + _subbox_lo[2]; const int kxR = _k + _bx_lo[2]; for(int _j = 0; _j < _subbox_len[1]; ++_j) { const int jR = _j + _subbox_lo[1]; const int jxR = _j + _bx_lo[1]; T *_th_pp = _th_p + ((_subbox_lo[0] - _th_plo[0]) + _th_plen[0]*((jR - _th_plo[1]) + _th_plen[1]*( (kR - _th_plo[2]) + _n * _th_plen[2]))); const T *_x_pp = _x_p + ((_bx_lo[0] - _x_plo[0]) + _x_plen[0]*((jxR - _x_plo[1]) + _x_plen[1]*( (kxR - _x_plo[2]) + _n * _x_plen[2]))); #ifdef BL_ARCH_CRAY # pragma _CRI ivdep #endif for (int _i = 0; _i < _subbox_len[0]; ++_i, ++_th_pp) { T &thisR = * _th_pp; const T & srcR = _x_pp[_i]; #endif { thisR = srcR; } #if (BL_SPACEDIM == 1) }}}} #elif (BL_SPACEDIM == 2) }}}}} #elif (BL_SPACEDIM == 3) }}}}}} #endif } #ifndef WIN32 // // Forward declaration of template specializaton for Real. // The definition is found in BaseFab.cpp. // template <> void BaseFab::performCopy (const BaseFab& src, const Box& srcbox, int srccomp, const Box& destbox, int destcomp, int numcomp); #endif template void BaseFab::performSetVal (T val, const Box& bx, int ns, int num) { BL_ASSERT(domain.contains(bx)); BL_ASSERT(ns >= 0 && ns + num <= nvar); if (bx == domain) { T* data = &dptr[ns*numpts]; for (long i = 0, N = num*numpts; i < N; i++) { *data++ = val; } } else { ForAllThisBNN(T,bx,ns,num) { thisR = val; } EndFor } } #ifndef WIN32 // // Forward declaration of template specializaton for Real. // Definition is found in BaseFab.cpp. // template <> void BaseFab::performSetVal (Real val, const Box& bx, int ns, int num); #endif template void BaseFab::setComplement (T x, const Box& b, int ns, int num) { BoxList b_lst = BoxLib::boxDiff(domain,b); for (BoxList::iterator bli = b_lst.begin(); bli != b_lst.end(); ++bli) performSetVal(x, *bli, ns, num); } template void BaseFab::abs () { ForAllThis(Real) { thisR = std::abs(thisR); } EndFor } template void BaseFab::abs (int comp, int numcomp) { ForAllThisNN(Real,comp,numcomp) { thisR = std::abs(thisR); } EndFor } template void BaseFab::abs (const Box& subbox, int comp, int numcomp) { ForAllThisBNN(Real,subbox,comp,numcomp) { thisR = std::abs(thisR); } EndFor } template Real BaseFab::norm (int p, int comp, int numcomp) const { return norm(domain,p,comp,numcomp); } template Real BaseFab::norm (const Box& subbox, int p, int comp, int numcomp) const { BL_ASSERT(comp >= 0 && comp+numcomp <= nComp()); BL_ASSERT(p >= 0); Real nrm = 0; Real* tmp = 0; int tmplen = 0; if (p == 0) { ForAllThisCPencil(T,subbox,comp,numcomp) { const T* row = &thisR; if (tmp == 0) { tmp = new Real[thisLen]; tmplen = thisLen; for (int i = 0; i < thisLen; i++) tmp[i] = std::abs(row[i]); } else { for (int i = 0; i < thisLen; i++) tmp[i] = std::max(tmp[i],std::abs(row[i])); } } EndForPencil nrm = tmp[0]; for (int i = 1; i < tmplen; i++) nrm = std::max(nrm, tmp[i]); } else if (p == 1) { ForAllThisCPencil(T,subbox,comp,numcomp) { const T* row = &thisR; if (tmp == 0) { tmp = new Real[thisLen]; tmplen = thisLen; for (int i = 0; i < thisLen; i++) tmp[i] = std::abs(row[i]); } else { for (int i = 0; i < thisLen; i++) tmp[i] += std::abs(row[i]); } } EndForPencil nrm = tmp[0]; for (int i = 1; i < tmplen; i++) nrm += tmp[i]; } else { BoxLib::Error("BaseFab::norm(): only p == 0 or p == 1 are supported"); } delete [] tmp; return nrm; } #ifdef BL_ARCH_CRAY #define RESTRICT restrict // // Template specialization for Real. // template<> Real BaseFab::norm (const Box& subbox, int p, int comp, int numcomp) const { BL_ASSERT(comp >= 0 && comp+numcomp <= nComp()); BL_ASSERT(p >= 0); Real* RESTRICT tmp = 0; int tmplen = 0; Real nrm = 0; if (p == 0) { ForAllThisCPencil(Real,subbox,comp,numcomp) { const Real* RESTRICT row = &thisR; if (tmp == 0) { tmp = new Real[thisLen]; tmplen = thisLen; #pragma _CRI ivdep for (int i = 0; i < thisLen; i++) tmp[i] = fabs(row[i]); } else { #pragma _CRI ivdep for (int i = 0; i < thisLen; i++) { Real a = fabs(row[i]); tmp[i] = tmp[i] > a ? tmp[i] : a ; } } } EndForPencil nrm = tmp[0]; for (int i = 1; i < tmplen; i++) { Real a = tmp[i]; nrm = nrm > a ? nrm : a ; } } else if (p == 1) { ForAllThisCPencil(Real,subbox,comp,numcomp) { const Real* row = &thisR; if (tmp == 0) { tmp = new Real[thisLen]; tmplen = thisLen; #pragma _CRI ivdep for (int i = 0; i < thisLen; i++) tmp[i] = fabs(row[i]); } else { #pragma _CRI ivdep for (int i = 0; i < thisLen; i++) { tmp[i] += fabs( row[i] ); } } } EndForPencil nrm = tmp[0]; #pragma _CRI ivdep for (int i = 1; i < tmplen; i++) nrm += tmp[i]; } else BoxLib::Error("BaseFab::norm(): only p == 0 or p == 1 are supported"); delete [] tmp; return nrm; } #endif template T BaseFab::min (int comp) const { T* _min_row = 0; int _X_len = 0; ForAllThisCPencil(T,domain,comp,1) { const T* _row = &thisR; if (_min_row == 0) { _min_row = new T[thisLen]; _X_len = thisLen; for (int i = 0; i < thisLen; i++) _min_row[i] = _row[i]; } else { for (int i = 0; i < thisLen; i++) _min_row[i] = std::min(_row[i],_min_row[i]); } } EndForPencil; T _min = _min_row[0]; for (int i = 1; i < _X_len; i++) _min = std::min(_min,_min_row[i]); delete [] _min_row; return _min; } template T BaseFab::min (const Box& subbox, int comp) const { T *_min_row = 0; int _X_len = 0; ForAllThisCPencil(T,subbox,comp,1) { const T* _row = &thisR; if (_min_row == 0) { _min_row = new T[thisLen]; _X_len = thisLen; for (int i = 0; i < thisLen; i++) _min_row[i] = _row[i]; } else { for (int i = 0; i < thisLen; i++) _min_row[i] = std::min(_row[i],_min_row[i]); } } EndForPencil; T _min = _min_row[0]; for (int i = 1; i < _X_len; i++) _min = std::min(_min,_min_row[i]); delete [] _min_row; return _min; } template T BaseFab::max (int comp) const { T* _max_row = 0; int _X_len = 0; ForAllThisCPencil(T,domain,comp,1) { const T* _row = &thisR; if (_max_row== 0) { _max_row = new T[thisLen]; _X_len = thisLen; for (int i = 0; i < thisLen; i++) _max_row[i] = _row[i]; } else { for (int i = 0; i < thisLen; i++) _max_row[i] = std::max(_row[i],_max_row[i]); } } EndForPencil; T _max = _max_row[0]; for (int i = 1; i < _X_len; i++) _max = std::max(_max,_max_row[i]); delete [] _max_row; return _max; } template T BaseFab::max (const Box& subbox, int comp) const { T* _max_row = 0; int _X_len = 0; ForAllThisCPencil(T,subbox,comp,1) { const T* _row = &thisR; if (_max_row == 0) { _max_row = new T[thisLen]; _X_len = thisLen; for (int i = 0; i < thisLen; i++) _max_row[i] = _row[i]; } else { for (int i = 0; i < thisLen; i++) _max_row[i] = std::max(_row[i],_max_row[i]); } } EndForPencil; T _max = _max_row[0]; for (int i = 1; i < _X_len; i++) _max = std::max(_max,_max_row[i]); delete [] _max_row; return _max; } template IntVect BaseFab::minIndex (int comp) const { IntVect _min_loc(domain.smallEnd()); T _min_val = (*this).operator()(_min_loc,comp); ForAllThisCBNN(T,domain,comp,1) { if (thisR < _min_val) { _min_val = thisR; D_EXPR(_min_loc[0] = iR, _min_loc[1] = jR, _min_loc[2] = kR); } } EndFor; return _min_loc; } template IntVect BaseFab::minIndex (const Box& subbox, int comp) const { IntVect _min_loc(subbox.smallEnd()); T _min_val = (*this).operator()(_min_loc,comp); ForAllThisCBNN(T,subbox,comp,1) { if (thisR < _min_val) { _min_val = thisR; D_EXPR(_min_loc[0] = iR, _min_loc[1] = jR, _min_loc[2] = kR); } } EndFor; return _min_loc; } template IntVect BaseFab::maxIndex (int comp) const { IntVect _max_loc(domain.smallEnd()); T _max_val = (*this).operator()(_max_loc,comp); ForAllThisCBNN(T,domain,comp,1) { if (thisR > _max_val) { _max_val = thisR; D_EXPR(_max_loc[0] = iR, _max_loc[1] = jR, _max_loc[2] = kR); } } EndFor; return _max_loc; } template IntVect BaseFab::maxIndex (const Box& subbox, int comp) const { IntVect _max_loc(subbox.smallEnd()); T _max_val = (*this).operator()(_max_loc,comp); ForAllThisCBNN(T,subbox,comp,1) { if (thisR > _max_val) { _max_val = thisR; D_EXPR(_max_loc[0] = iR, _max_loc[1] = jR, _max_loc[2] = kR); } } EndFor; return _max_loc; } template int BaseFab::maskLT (BaseFab& mask, T val, int comp) const { mask.resize(domain,1); mask.setVal(0); int* mptr = mask.dataPtr(); int cnt = 0; ForAllThisCBNN(T,domain,comp,1) { int ix = D_TERM(_i, +_j*_b_len[0], +_k*_b_len[0]*_b_len[1]); if (thisR < val) { mptr[ix] = 1; cnt++; } } EndFor; return cnt; } template int BaseFab::maskLE (BaseFab& mask, T val, int comp) const { mask.resize(domain,1); mask.setVal(0); int* mptr = mask.dataPtr(); int cnt = 0; ForAllThisCBNN(T,domain,comp,1) { int ix = D_TERM(_i, +_j*_b_len[0], +_k*_b_len[0]*_b_len[1]); if (thisR <= val) { mptr[ix] = 1; cnt++; } } EndFor; return cnt; } template int BaseFab::maskEQ (BaseFab& mask, T val, int comp) const { mask.resize(domain,1); mask.setVal(0); int* mptr = mask.dataPtr(); int cnt = 0; ForAllThisCBNN(T,domain,comp,1) { int ix = D_TERM(_i, +_j*_b_len[0], +_k*_b_len[0]*_b_len[1]); if (thisR == val) { mptr[ix] = 1; cnt++; } } EndFor; return cnt; } template int BaseFab::maskGT (BaseFab& mask, T val, int comp) const { mask.resize(domain,1); mask.setVal(0); int* mptr = mask.dataPtr(); int cnt = 0; ForAllThisCBNN(T,domain,comp,1) { int ix = D_TERM(_i, +_j*_b_len[0], +_k*_b_len[0]*_b_len[1]); if (thisR > val) { mptr[ix] = 1; cnt++; } } EndFor; return cnt; } template int BaseFab::maskGE(BaseFab& mask, T val, int comp) const { mask.resize(domain,1); mask.setVal(0); int* mptr = mask.dataPtr(); int cnt = 0; ForAllThisCBNN(T,domain,comp,1) { int ix = D_TERM(_i, +_j*_b_len[0], +_k*_b_len[0]*_b_len[1]); if (thisR >= val) { mptr[ix] = 1; cnt++; } } EndFor; return cnt; } template BaseFab& BaseFab::plus (T r) { return operator+=(r); } template BaseFab& BaseFab::plus (const BaseFab& x) { return operator+=(x); } template BaseFab& BaseFab::operator-= (T r) { return operator+=(-r); } template BaseFab& BaseFab::minus (const BaseFab& x) { return operator-=(x); } template BaseFab& BaseFab::mult (T r) { return operator*=(r); } template BaseFab& BaseFab::mult (const BaseFab& x) { return operator*=(x); } template BaseFab& BaseFab::divide (T r) { return operator/=(r); } template BaseFab& BaseFab::divide (const BaseFab& x) { return operator/=(x); } template void BaseFab::patternFill (int mark) { ForAllThis(T) { thisR = D_TERM(iR*100, +jR*10, + kR) + 1000*nR + 10000*mark; } EndFor } template void BaseFab::copyRev (const Box& destbox, const BaseFab& src, const Box& srcbox, int reversal_index, T* multiplier) { BaseFab& dest = *this; ForAllRevXBNYCBNNN(T,dest,destbox,0,src,srcbox,0,nComp(),reversal_index) { destR = multiplier[_n]*srcR; } EndFor } template T BaseFab::sum (int comp, int numcomp) const { T* _sum_row = 0; int _sum_len = 0; ForAllThisCPencil(T,domain,comp,numcomp) { const T* _row = &thisR; if (_sum_row == 0) { _sum_row = new T[thisLen]; _sum_len = thisLen; for (int i = 0; i < thisLen; i++) _sum_row[i] = _row[i]; } else { for (int i = 0; i < thisLen; i++) _sum_row[i] += _row[i]; } } EndForPencil; T _sum = _sum_row[0]; for (int i = 1; i < _sum_len; i++) _sum += _sum_row[i]; delete [] _sum_row; return _sum; } template T BaseFab::sum (const Box& subbox, int comp, int numcomp) const { T* _sum_row = 0; int _sum_len = 0; ForAllThisCPencil(T,subbox,comp,numcomp) { const T* _row = &thisR; if (_sum_row == 0) { _sum_row = new T[thisLen]; _sum_len = thisLen; for (int i = 0; i < thisLen; i++) _sum_row[i] = _row[i]; } else { for (int i = 0; i < thisLen; i++) { _sum_row[i] += _row[i]; } } } EndForPencil; T _sum = _sum_row[0]; for (int i = 1; i < _sum_len; i++) _sum += _sum_row[i]; delete [] _sum_row; return _sum; } template BaseFab& BaseFab::negate () { ForAllThis(T) { thisR = - thisR; } EndFor return *this; } template BaseFab& BaseFab::negate (int comp, int numcomp) { ForAllThisNN(T,comp,numcomp) { thisR = - thisR; } EndFor return *this; } template BaseFab& BaseFab::negate (const Box& b, int comp, int numcomp) { ForAllThisBNN(T,b,comp,numcomp) { thisR = - thisR; } EndFor return *this; } template BaseFab& BaseFab::invert (T r) { ForAllThis(T) { thisR = r/thisR; } EndFor return *this; } template BaseFab& BaseFab::invert (T r, int comp, int numcomp) { ForAllThisNN(T,comp,numcomp) { thisR = r/thisR; } EndFor return *this; } template BaseFab& BaseFab::invert (T r, const Box& b, int comp, int numcomp) { ForAllThisBNN(T,b,comp,numcomp) { thisR = r/thisR; } EndFor return *this; } template BaseFab& BaseFab::operator+= (T r) { ForAllThis(T) { thisR += r; } EndFor return *this; } template BaseFab& BaseFab::plus (T r, int comp, int numcomp) { ForAllThisNN(T,comp,numcomp) { thisR += r; } EndFor return *this; } template BaseFab& BaseFab::plus (T r, const Box& b, int comp, int numcomp) { ForAllThisBNN(T,b,comp,numcomp) { thisR += r; } EndFor return *this; } template BaseFab& BaseFab::operator+= (const BaseFab& x) { ForAllThisXC(T,x) { thisR += xR; } EndForTX return *this; } template BaseFab& BaseFab::plus (const BaseFab& src, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXC(T,domain,destcomp,numcomp,src,srccomp) { thisR += srcR; } EndForTX return *this; } template BaseFab& BaseFab::plus (const BaseFab& src, const Box& subbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXC(T,subbox,destcomp,numcomp,src,srccomp) { thisR += srcR; } EndForTX return *this; } template BaseFab& BaseFab::plus (const BaseFab& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXCBN(T,destbox,destcomp,numcomp,src,srcbox,srccomp) { thisR += srcR; } EndForTX return *this; } template BaseFab& BaseFab::operator-= (const BaseFab& x) { ForAllThisXC(T,x) { thisR -= xR; } EndForTX return *this; } template BaseFab& BaseFab::minus (const BaseFab& src, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXC(T,domain,destcomp,numcomp,src,srccomp) { thisR -= srcR; } EndForTX return *this; } template BaseFab& BaseFab::minus (const BaseFab& src, const Box& subbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXC(T,subbox,destcomp,numcomp,src,srccomp) { thisR -= srcR; } EndForTX return *this; } template BaseFab& BaseFab::minus (const BaseFab& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXCBN(T,destbox,destcomp,numcomp,src,srcbox,srccomp) { thisR -= srcR; } EndForTX return *this; } template BaseFab& BaseFab::operator*= (T r) { ForAllThis(T) { thisR *= r; } EndFor return *this; } template BaseFab& BaseFab::mult (T r, int comp, int numcomp) { ForAllThisNN(T,comp,numcomp) { thisR *= r; } EndFor return *this; } template BaseFab& BaseFab::mult (T r, const Box& b, int comp, int numcomp) { ForAllThisBNN(T,b,comp,numcomp) { thisR *= r; } EndFor return *this; } template BaseFab& BaseFab::operator*= (const BaseFab &x) { ForAllThisXC(T,x) { thisR *= xR; } EndForTX return *this; } template BaseFab& BaseFab::mult (const BaseFab& src, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXC(T,domain,destcomp,numcomp,src,srccomp) { thisR *= srcR; } EndForTX return *this; } template BaseFab& BaseFab::mult (const BaseFab& src, const Box& subbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXC(T,subbox,destcomp,numcomp,src,srccomp) { thisR *= srcR; } EndForTX return *this; } template BaseFab& BaseFab::mult (const BaseFab& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXCBN(T,destbox,destcomp,numcomp,src,srcbox,srccomp) { thisR *= srcR; } EndForTX return *this; } template BaseFab& BaseFab::operator/= (T r) { ForAllThis(T) { thisR /= r; } EndFor return *this; } template BaseFab& BaseFab::divide (T r, int comp, int numcomp) { ForAllThisNN(T,comp,numcomp) { thisR /= r; } EndFor return *this; } template BaseFab& BaseFab::divide (T r, const Box& b, int comp, int numcomp) { ForAllThisBNN(T,b,comp,numcomp) { thisR /= r; } EndFor return *this; } template BaseFab& BaseFab::operator/= (const BaseFab &x) { ForAllThisXC(T,x) { thisR /= xR; } EndForTX return *this; } template BaseFab& BaseFab::divide (const BaseFab& src, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXC(T,domain,destcomp,numcomp,src,srccomp) { thisR /= srcR; } EndForTX return *this; } template BaseFab& BaseFab::divide (const BaseFab& src, const Box& subbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXC(T,subbox,destcomp,numcomp,src,srccomp) { thisR /= srcR; } EndForTX return *this; } template BaseFab& BaseFab::divide (const BaseFab& src, const Box& srcbox, const Box& destbox, int srccomp, int destcomp, int numcomp) { ForAllThisBNNXCBN(T,destbox,destcomp,numcomp,src,srcbox,srccomp) { thisR /= srcR; } EndForTX return *this; } // // Linear Interpolation / Extrapolation // Result is (t2-t)/(t2-t1)*f1 + (t-t1)/(t2-t1)*f2 // Data is taken from b1 region of f1, b2 region of f2 // and stored in b region of this FAB. // Boxes b, b1 and b2 must be the same size. // Data is taken from component comp1 of f1, comp2 of f2, // and stored in component comp of this FAB. // This fab is returned as a reference for chaining. // template BaseFab& BaseFab::linInterp (const BaseFab& f1, const Box& b1, int comp1, const BaseFab& f2, const Box& b2, int comp2, Real t1, Real t2, Real t, const Box& b, int comp, int numcomp) { Real alpha = (t2-t)/(t2-t1); Real beta = (t-t1)/(t2-t1); ForAllThisBNNXCBNYCBN(T,b,comp,numcomp,f1,b1,comp1,f2,b2,comp2) { thisR = (T) (alpha*Real(f1R) + beta*Real(f2R)); } EndForTX return *this; } // // Linear combination, Result is alpha*f1 + beta*f2 // Data is taken from b1 region of f1, b2 region of f2 // and stored in b region of this FAB. // Boxes b, b1 and b2 must be the same size. // Data is taken from component comp1 of f1, comp2 of f2, // and stored in component comp of this FAB. // This fab is returned as a reference for chaining. // template BaseFab& BaseFab::linComb (const BaseFab& f1, const Box& b1, int comp1, const BaseFab& f2, const Box& b2, int comp2, Real alpha, Real beta, const Box& b, int comp, int numcomp) { ForAllThisBNNXCBNYCBN(T,b,comp,numcomp,f1,b1,comp1,f2,b2,comp2) { thisR = (T) (alpha*Real(f1R) + beta*Real(f2R)); } EndForTX return *this; } template typename BaseFab::BFProxy BaseFab::operator() (const Box& bx) { return BFProxy(*this, bx&box(), BFProxy::All); } template typename BaseFab::CBFProxy BaseFab::operator() (const Box& bx) const { return CBFProxy(*this, bx&box(), CBFProxy::All); } namespace BoxLib { class BF_init { public: BF_init (); ~BF_init (); private: static int m_cnt; }; } static BoxLib::BF_init file_scope_BF_init_object; #endif /*BL_BASEFAB_H*/ ccseapps-2.5/CCSEApps/BoxLib/BoxArray.H0000644000175000017500000002237311634153073020705 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_BOXARRAY_H #define BL_BOXARRAY_H // // $Id: BoxArray.H,v 1.31 2001/08/21 19:01:51 lijewski Exp $ // #include #include #include #include #include class BoxArray; namespace BoxLib { // //@ManDoc: Makes a BoxArray from the the complement of b2 in b1in. // BoxArray boxComplement (const Box& b1in, const Box& b2); // //@ManDoc: Makes a BoxArray from the complement of BoxArray ba in Box b. // BoxArray complementIn (const Box& b, const BoxArray& ba); // //@ManDoc: Makes a BoxArray from the intersection of Box b and BoxArray ba. // BoxArray intersect (const BoxArray& ba, const Box& b); // //@ManDoc: Makes a BoxArray from the intersection of two BoxArrays. // BoxArray intersect (const BoxArray& lhs, const BoxArray& rhs); } // //@ManDoc: Write a BoxArray to an ostream in ASCII format. // std::ostream& operator<< (std::ostream& os, const BoxArray& ba); // //@Man: //@Memo: An Array of Boxes /*@Doc: A BoxArray is a collection of Boxes stored in an Array. It is a reference-counted concrete class, not a polymorphic one; i.e. you cannot use any of the List member functions with a BoxList. */ class BoxArray { public: // //@ManDoc: Construct an empty BoxArray. // BoxArray (); // /// Make a boxarray out of a single box // BoxArray (const Box& bx); // //@ManDoc: Construct a BoxArray of the specified size. // explicit BoxArray (size_t size); // //@ManDoc: Construct a BoxArray from an array of Boxes of size nbox. // BoxArray (const Box* bxvec, int nbox); // //@ManDoc: Construct a BoxArray from a BoxList. // explicit BoxArray (const BoxList& bl); // //@ManDoc: The copy constructor. // BoxArray (const BoxArray& bs); // //@ManDoc: The assignment operator. // BoxArray& operator= (const BoxArray& rhs); // //@ManDoc: The destructor. // ~BoxArray (); /*@ManDoc: Initialize the BoxArray from the supplied BoxList. It is an error if the BoxArray has already been initialized. */ void define (const BoxList& bl); /*@ManDoc: Initialize the BoxArray from the supplied BoxArray. It is an error if the BoxArray has already been initialized. */ void define (const BoxArray& bs); // //@ManDoc: Remove all Boxes from the BoxArray. // void clear (); // //@ManDoc: Resizes the array. See Array::resize() for the gory details. // void resize (int len); // //@ManDoc: Returns the number of elements in the BoxArray. // int size () const; long numPts() const; /*@ManDoc: Initialize the BoxArray from the supplied istream. It is an error if the BoxArray has already been initialized. Note that the BoxArray in the istream must have been written using writeOn(). */ void readFrom (std::istream& is); // //@ManDoc: Output this BoxArray to a checkpoint file. // std::ostream& writeOn (std::ostream&) const; // //@ManDoc: Are the BoxArrays equal? // bool operator== (const BoxArray& rhs) const; // //@ManDoc: Are the BoxArrays not equal? // bool operator!= (const BoxArray& rhs) const; // //@ManDoc: Forces each Box in BoxArray to have sides <= block\_size. // BoxArray& maxSize (int block_size); // //@ManDoc: Refine each Box in the BoxArray to the specified ratio. // BoxArray& refine (int refinement_ratio); // //@ManDoc: Refine each Box in the BoxArray to the specified ratio. // BoxArray& refine (const IntVect& refinement_ratio); // //@ManDoc: Coarsen each Box in the BoxArray to the specified ratio. // BoxArray& coarsen (int refinement_ratio); // //@ManDoc: Coarsen each Box in the BoxArray to the specified ratio. // BoxArray& coarsen (const IntVect& refinement_ratio); // //@ManDoc: Grow each Box in the BoxArray by the specified amount. // BoxArray& grow (int n); // //@ManDoc: Grow each Box in the BoxArray by the specified amount. // BoxArray& grow (const IntVect& iv); /*@ManDoc: Grow each Box in the BoxArray on the low and high end by n\_cell cells in idir direction. */ BoxArray& grow (int idir, int n_cell); /*@ManDoc: Applies surroundingNodes(Box) to each Box in BoxArray. See the documentation of Box for details. */ BoxArray& surroundingNodes (); /*@ManDoc: Applies surroundingNodes(Box,int) to each Box in BoxArray. See the documentation of Box for details. */ BoxArray& surroundingNodes (int dir); // //@ManDoc: Applies Box::enclosedCells() to each Box in the BoxArray. // BoxArray& enclosedCells (); // //@ManDoc: Applies Box::enclosedCells(int) to each Box in the BoxArray. // BoxArray& enclosedCells (int dir); // //@ManDoc: Applies Box::convert(IndexType) to each Box in the BoxArray. // BoxArray& convert (IndexType typ); // //@ManDoc: Applies function (*fp)(Box) to each Box in the BoxArray. // BoxArray& convert (Box (*fp)(const Box&)); // //@ManDoc: Applies Box::shift(int,int) to each Box in the BoxArray. // BoxArray& shift (int dir, int nzones); // //@ManDoc: Applies Box::shiftHalf(int,int) to each Box in the BoxArray. // BoxArray& shiftHalf (int dir, int num_halfs); // //@ManDoc: Applies Box::shiftHalf(IntVect) to each Box in BoxArray. // BoxArray& shiftHalf (const IntVect &iv); // //@ManDoc: Set element i in this BoxArray to Box ibox. // void set (int i, const Box& ibox); // //@ManDoc: Returns element index of this BoxArray. // const Box& operator[] (int index) const; // //@ManDoc: Returns element index of this BoxArray. // const Box& get (int index) const; /*@ManDoc: Returns true if Box is valid and they all have the same IndexType. Is true by default if the BoxArray is empty. */ bool ok () const; // //@ManDoc: Returns true if set of intersecting Boxes in BoxArray is null. // bool isDisjoint () const; // //@ManDoc: Create a BoxList from this BoxArray. // BoxList boxList () const; // //@ManDoc: True if the IntVect is within any of the Boxes in this BoxArray. // bool contains (const IntVect& v) const; /*@ManDoc: True if the Box is within any of the Boxes in the List. The Box must also have the same IndexType as those in this BoxArray. */ bool contains (const Box& b) const; // //@ManDoc: True if all Boxes in bl are contained in this BoxArray. // bool contains (const BoxArray& bl) const; // //@ManDoc: Returns smallest Box that contains all Boxes in this BoxArray. // Box minimalBox () const; void reserve (long _truesize); protected: class Ref { friend class BoxArray; // // Constructors to match those in BoxArray .... // Ref (); Ref (size_t size); Ref (const BoxList& bl); Ref (std::istream& is); Ref (const Ref& rhs); // // Some defines()s to match those in BoxArray. // void define (const BoxList& bl); void define (std::istream& is); // // The data -- an Array of Boxes. // Array m_abox; }; // // Make `this' unique. // void uniqify (); // // The data -- a reference-counted pointer to a Ref. // LnClassPtr m_ref; }; inline int BoxArray::size () const { return m_ref->m_abox.size(); } inline const Box& BoxArray::operator[] (int index) const { return m_ref->m_abox.get(index); } inline const Box& BoxArray::get (int index) const { return m_ref->m_abox.get(index); } #endif /*BL_BOXARRAY_H*/ ccseapps-2.5/CCSEApps/BoxLib/FabConv.cpp0000644000175000017500000011613311634153073021065 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: FabConv.cpp,v 1.16 2001/07/24 18:16:53 lijewski Exp $ // #include #include #include #include #include #include #include #include #include // // Declarations of Cray-specific FP format to IEEE routines. // #if defined(BL_ARCH_CRAY) #define FORT_IEG2CRAY IEG2CRAY #define FORT_CRAY2IEG CRAY2IEG extern "C" { void FORT_IEG2CRAY(int& type, int& num, char* forn, int& bitoff, char* cry, int& stride, char& craych); void FORT_CRAY2IEG(int& type, int& num, char* forn, int& bitoff, char* cry, int& stride, char& craych); } #endif /*defined(BL_ARCH_CRAY)*/ RealDescriptor::~RealDescriptor() {} bool RealDescriptor::bAlwaysFixDenormals(false); IntDescriptor::IntDescriptor () {} IntDescriptor::IntDescriptor (long nb, Ordering o) : numbytes(nb), ord(o) {} IntDescriptor::Ordering IntDescriptor::order () const { return ord; } int IntDescriptor::numBytes () const { return numbytes; } bool IntDescriptor::operator== (const IntDescriptor& id) const { return ord == id.ord && numbytes == id.numbytes; } bool IntDescriptor::operator!= (const IntDescriptor& id) const { return !operator==(id); } RealDescriptor::RealDescriptor () {} RealDescriptor::RealDescriptor (const long* fr_, const int* ord_, int ordl_) : fr(fr_, 8), ord(ord_, ordl_) {} RealDescriptor::RealDescriptor (const RealDescriptor& rhs) : fr(rhs.fr), ord(rhs.ord) {} RealDescriptor& RealDescriptor::operator= (const RealDescriptor& rhs) { fr = rhs.fr; ord = rhs.ord; return *this; } const long* RealDescriptor::format () const { BL_ASSERT(fr.size() != 0); return fr.dataPtr(); } const Array& RealDescriptor::formatarray () const { BL_ASSERT(fr.size() != 0); return fr; } const int* RealDescriptor::order () const { BL_ASSERT(ord.size() != 0); return ord.dataPtr(); } const Array& RealDescriptor::orderarray () const { BL_ASSERT(ord.size() != 0); return ord; } int RealDescriptor::numBytes () const { BL_ASSERT(fr.size() != 0); return (fr[0] + 7 ) >> 3; } bool RealDescriptor::operator== (const RealDescriptor& rd) const { return fr == rd.fr && ord == rd.ord; } bool RealDescriptor::operator != (const RealDescriptor& rd) const { return !operator==(rd); } void RealDescriptor::SetFixDenormals() { bAlwaysFixDenormals = true; } // // This is not inlined as it's an inherited virtual. // RealDescriptor* RealDescriptor::clone () const { RealDescriptor* rd = new RealDescriptor(*this); return rd; } // // This exists solely to support reading "old" FABs. // static const int* selectOrdering (int prec, int ordering) { switch (prec) { case FABio::FAB_FLOAT: switch (ordering) { case FABio::FAB_NORMAL_ORDER: return FPC::normal_float_order; case FABio::FAB_REVERSE_ORDER: return FPC::reverse_float_order; case FABio::FAB_REVERSE_ORDER_2: return FPC::reverse_float_order_2; default: BoxLib::Error("selectOrdering(): Crazy ordering"); } break; case FABio::FAB_DOUBLE: switch (ordering) { case FABio::FAB_NORMAL_ORDER: return FPC::normal_double_order; case FABio::FAB_REVERSE_ORDER: return FPC::reverse_double_order; case FABio::FAB_REVERSE_ORDER_2: return FPC::reverse_double_order_2; default: BoxLib::Error("selectOrdering(): Crazy ordering"); } break; default: BoxLib::Error("selectOrdering(): Crazy precision"); } return 0; } // // This is here solely to support reading "old" FABs. // RealDescriptor* RealDescriptor::newRealDescriptor (int iot, int prec, const char* sys, int ordering) { RealDescriptor* rd = 0; switch (iot) { case FABio::FAB_IEEE: { const int* ord = selectOrdering(prec, ordering); switch (prec) { case FABio::FAB_FLOAT: if(strcmp(sys, "CRAY") == 0) { rd = new RealDescriptor(FPC::ieee_double, ord, 8); } else { rd = new RealDescriptor(FPC::ieee_float, ord, 4); } return rd; case FABio::FAB_DOUBLE: rd = new RealDescriptor(FPC::ieee_double, ord, 8); return rd; } } case FABio::FAB_NATIVE: if (sys != 0 && strncmp(sys, "CRAY", 4) == 0) { rd = new RealDescriptor(FPC::cray_float, FPC::cray_float_order, 8); return rd; } default: BoxLib::Error("RealDescriptor::newRealDescriptor(): Crazy precision"); } rd = new RealDescriptor; return rd; } inline void ONES_COMP_NEG (long& n, int nb, long incr) { if (nb == 8*sizeof(long)) n = ~n + incr; else { const long MSK = (1L << nb) - 1L; n = (~n + incr) & MSK; } } // // Return bit specified as on offset from the given pointer. // inline int _PD_get_bit (char* base, int offs, int nby, const int* ord) { int n = offs >> 3; int nbytes = n % nby; n -= nbytes; offs = offs % 8; if (ord == NULL) base += (n + nbytes); else base += (n + (ord[nbytes] - 1)); int mask = (1 << (7 - offs)); return (*base & mask) != 0; } // // Make a copy of the bit field specified by the starting bit, OFFS and // the number of bits, NBI, from the byte array pointed to by IN. // All indexing is 0 based. The copy is to be put in a long and returned. // This imposes a 32 bit limit (minimum) so repeated calls - must be made // for longer fields // static long _PD_extract_field (char* in, int offs, int nbi, int nby, const int* ord) { int ind; long bit_field = 0L; // // Move past the apropriate number of bytes so that the start bit is // in the first byte. OFFY is the offset of the byte containing the // bit OFFS // long n = offs >> 3; int offy = int(n % nby); n -= offy; offs = offs % 8; // // Advance the pointer past the unneeded items. // in += n; unsigned char bpb = 8 - offs; if (ord == NULL) ind = offy++; else { if (offy >= nby) { offy -= nby; in += nby; } ind = (ord[offy++] - 1); } int tgt = in[ind]; unsigned char mask = (1 << bpb) - 1; bit_field = ((bit_field << bpb) | (tgt & mask)); nbi -= bpb; if (nbi < 0) bit_field = bit_field >> (-nbi); else { for (; nbi > 0; nbi -= bpb) { // // ind = (ord == NULL) ? offy++ : (ord[offy++] - 1); // if (ord == NULL) ind = offy++; else { if (offy >= nby) { offy -= nby; in += nby; } ind = (ord[offy++] - 1); } tgt = in[ind]; bpb = nbi > 8 ? 8 : nbi; mask = (1 << bpb) - 1; bit_field = ((bit_field << bpb) | ((tgt >> (8 - bpb)) & mask)); } } return bit_field; } // // Byte reverse nitems words. Each word is nb bytes long where nb is even. // static void _PD_btrvout (char* out, long nb, long nitems) { for (long jl = 0, nbo2 = nb >> 1; jl < nbo2; jl++) { long jh = nb - jl - 1; char* p1 = out + jh; char* p2 = out + jl; for (long i = 0L; i < nitems; i++) { char tmp = *p1; *p1 = *p2; *p2 = tmp; p1 += nb; p2 += nb; } } } const int BitsMax = 8*sizeof(long); const int REVERSE_ORDER = 2; // // Copy the least significant NB bits from the given long into the byte array // pointed to by OUT. All indexing is 0 based. OFFS is the offset from the // beginning of OUT in bits. This assumes that the output bit array is // initialized to all zeros after offs. // inline void _PD_insert_field (long in_long, int nb, char* out, int offs, int l_order, int l_bytes) { int dm; long longmask; char* in = (char *) &in_long; // // If the output start bit is not in the first byte move past the // apropriate number of bytes so that the start bit is in the first byte. // if (offs > 7) { out += (offs >> 3); offs %= 8; } // // If mi is less than offs, copy the first dm bits over, reset offs to 0, // Advance mi by dm, and handle the rest as if mi >= offs. // int mi = BitsMax - nb; if (mi < offs) { dm = BitsMax - (8 - offs); if (nb == BitsMax) longmask = ~((1L << dm) - 1L); else longmask = ((1L << nb) - 1L) ^ ((1L << dm) - 1L); unsigned char fb = ((in_long&longmask)>>dm)&((1L<<(nb-dm))-1L); *(out++) |= fb; mi += 8 - offs; offs = 0; } // // Assuming mi >= offs, left shift the input so that it is bit aligned // with the output. // dm = mi - offs; longmask = ~((1L << dm) - 1L); in_long = (in_long << dm) & longmask; // // Reorder the bytes apropriately. // if (l_order == REVERSE_ORDER) _PD_btrvout(in, l_bytes, 1L); // // Copy the remaining aligned bytes over. // for (int n = (offs+nb+7)/8; n > 0; n--, *(out++) |= *(in++)) ; } // // Set the bit specified as on offset from the given pointer. // inline void _PD_set_bit (char* base, int offs) { int nbytes = offs >> 3; base += nbytes; offs -= 8*nbytes; int mask = (1 << (7 - offs)); *base |= mask; } // // Given a pointer to an array ARR with NITEMS of NBYTES each put them // in the order defined by ORD. This assumes they're in the order 1 .. n // on input. // static void _PD_reorder (char* arr, long nitems, int nbytes, const int* ord) { const int MAXLINE = 16; char local[MAXLINE]; for (int j; nitems > 0; nitems--) { arr--; for (j = 0; j < nbytes; local[j] = arr[ord[j]], j++); arr++; for (j = 0; j < nbytes; *(arr++) = local[j++]); } } // // This should only be called with two arrays of Reals. // It maps the `in' array into the `out' array, changing the ordering // from inord to outord. // static void permute_real_word_order (void* out, const void* in, long nitems, const int* outord, const int* inord) { const int REALSIZE = sizeof(Real); char* pin = (char*) in; char* pout = (char*) out; pin--; pout--; for (; nitems > 0; nitems--, pin += REALSIZE, pout += REALSIZE) { for (int i = 0; i < REALSIZE; i++) pout[outord[i]] = pin[inord[i]]; } } // // Parametrized Data Conversion Method // // Floating point formats are characterized by a set of parameters which // describe the fundamental elements of a floating point number. These are // // Sign - always assumed to be a single bit // - requires bit offset // Exponent - assumed to be a biased integer smaller than 32 bits // - (this allows the conversion to use a long on all known // - platforms - an exponent greater than 32 bits long would // - allow much larger numbers than should be needed for // - scientific computations) // - requires a bit offset, a bit length, and a bias // Mantissa - assumed to be a bitstream of arbitrary length // - requires a bit offset and a bit length // HMB - in all floating point representations the mantissa is // - normalized so that the most significant bit is one. // - in some formats the one is explicitly included in the // - representation and in others it is only implicit // - this gives some formats an extra bit of precision. // - requires a flag which is TRUE if the HMB is explicit // // Two other factors involved are: the byte order which could be // mixed with the bit layout of the numbers but isn't in actual practice // on current machines; and whether one's complement or two's complement // arithmetic is used. Modern machines all use two's complement arithmetic // and the model used here and now is that data from one's complement // machines is to be read only. This restriction is relatively easy // to relax, but there is no evidence that it should be. // // An issue which is not a problem in the current implementation is that // old machines with byte sizes other than 8 bits can be accomodated // because the conversions treat the input and output as bitstreams // instead of bytestreams. // // The conversion process is summarized as follows: // 1) Extract the sign bit and exponent field from the input number // 2) Subtract the bias of the source format and add the bias // of the target format // 3) Check for overflow in the exponent // 4) Insert the new exponent and the sign bit in the target stream // 5) Copy the mantissa bits from the source to the target // compensating for differences in the HMB between the two // formats // 6) Take care of any known anomalies - e.g. CRAY format is // inconsistent in that the HMB is explicitly on for all numbers // with the exception of 0.0 // 7) Reorder the bytes of the target stream appropriately // // The floating point formats for a variety of platforms are supplied by // PDBLib and are defined at the top of this file // _PD_FCONVERT - general floating point conversion routine // - convert from floating point format specified by infor // - to format specified by outfor // - // - floating point format specification: // - // - format[0] = # of bits per number // - format[1] = # of bits in exponent // - format[2] = # of bits in mantissa // - format[3] = start bit of sign // - format[4] = start bit of exponent // - format[5] = start bit of mantissa // - format[6] = high order mantissa bit (CRAY needs this) // - format[7] = bias of exponent // void PD_fconvert (void* out, const void* in, long nitems, int boffs, const long* outfor, const int* outord, const long* infor, const int* inord, int l_order, int l_bytes, int onescmp) { long i, expn, expn_max, hexpn, mant, DeltaBias, hmbo, hmbi; int nbits, inbytes, outbytes, sign; int indxin, indxout, inrem, outrem, dindx; int bi_sign, bo_sign, bi_exp, bo_exp, bi_mant, bo_mant; int nbi_exp, nbo_exp, nbi, nbo; char *lout, *lin; unsigned char *rout; nbi = int(infor[0]); nbo = int(outfor[0]); nbi_exp = int(infor[1]); nbo_exp = int(outfor[1]); bi_sign = int(infor[3] + boffs); bo_sign = int(outfor[3]); bi_exp = int(infor[4] + boffs); bo_exp = int(outfor[4]); bi_mant = int(infor[5] + boffs); bo_mant = int(outfor[5]); hmbo = (outfor[6] & 1L); hmbi = (infor[6] & 1L); inbytes = (nbi + 7) >> 3; outbytes = (nbo + 7) >> 3; DeltaBias = outfor[7] + hmbo - infor[7] - hmbi; hexpn = 1L << (outfor[1] - 1L); expn_max = (1L << outfor[1]) - 1L; size_t number = size_t(nitems); BL_ASSERT(int(number) == nitems); memset(out, 0, number*outbytes); lout = (char*)out; lin = (char*)in; for (i = 0L; i < nitems; i++) { // // Move the exponent over. // expn = _PD_extract_field(lin, bi_exp, nbi_exp, inbytes, inord); sign = _PD_get_bit(lin, bi_sign, inbytes, inord); // // If we have a negative number and ones complement arithmetic on the // input side (won't have it on the output side with modern data). // Take the complement of the exponent and mantissa. // if (onescmp) { if (sign) { ONES_COMP_NEG(expn, nbi_exp, 1L); } else expn += (expn < hexpn); } if (expn != 0) expn += DeltaBias; if ((0 <= expn) && (expn < expn_max)) { _PD_insert_field(expn, nbo_exp, lout, bo_exp, l_order, l_bytes); if (sign) _PD_set_bit(lout, bo_sign); indxin = bi_mant; inrem = int(infor[2]); indxout = bo_mant; outrem = int(outfor[2]); // // If input high mantissa bit (HMB) is assumed 1 and not written // (e.g. IEEE) but output HMB is assumed 0 (e.g. CRAY) write the // input starting at the output HMB+1 and set the HMB. // dindx = int(hmbo - hmbi); if (dindx > 0) { _PD_set_bit(lout, indxout); indxout += dindx; outrem -= dindx; } // // If input HMB is assumed 0 (e.g. CRAY) but output HMB is // assumed 1 and not written (e.g. IEEE) take the input from // HMB+1 and write it to output HMB. // else if (dindx < 0) { indxin -= dindx; inrem += dindx; } // // Move the mantissa over in sizeof(long) packets. // while ((inrem > 0) && (outrem > 0)) { nbits = BitsMax > inrem ? inrem : BitsMax; nbits = nbits > outrem ? outrem : nbits; mant = _PD_extract_field(lin, indxin, nbits, inbytes, inord); // // Do complement for negative ones complement data. // if (onescmp && sign) ONES_COMP_NEG(mant, nbits, 0L); _PD_insert_field(mant, nbits, lout, indxout, l_order, l_bytes); indxin += nbits; indxout += nbits; inrem -= nbits; outrem -= nbits; } } // // In case of overflow use 1.0e+(expn_max). // else if (expn_max <= expn) { _PD_insert_field(expn_max, nbo_exp, lout, bo_exp, l_order, l_bytes); if (_PD_get_bit(lin, bi_sign, inbytes, inord)) _PD_set_bit(lout, bo_sign); } bi_sign += nbi; bi_exp += nbi; bi_mant += nbi; bo_sign += nbo; bo_exp += nbo; bo_mant += nbo; } // // Handle CRAY inconsistency which has zero as the only floating point // number with a 0 in the HMB. Also problem for IEEE 96 bit float - fixed // by Dave Munro. // if (hmbo) { int j, mask = (1 << (7 - bo_mant % 8)); indxout = int(outfor[5]/8); rout = (unsigned char *) out; for (i = 0L; i < nitems; i++, rout += outbytes) { for (j = 0; j < outbytes; j++) if ((j == indxout) ? (rout[j] != mask) : rout[j]) break; if (j == outbytes) rout[indxout] = 0; } } // // Put the output bytes into the specified order. // _PD_reorder((char*)out, nitems, outbytes, outord); } // // These routines are specialized to do important floating point // conversions on the alpha. They make use of architectural knowledege to // run faster. Please add more of these as needed. // #if defined(__alpha) && !defined(BL_USE_FLOAT) static void cray64toalpha64_fconvert (void* out, const void* in, long nitems) { const long DeltaBias = 0x3FFL - 0x4000L - 1L; const long expn_max = (1L << 11L) - 1L; memset(out, 0, nitems*8); long *lin = (long *)in; long *lout = (long *)out; for (long i = 0; i < nitems; i++) { // // Step 1: change ordering to match alpha. // long ordinp = 0, input = *lin; for (size_t j = 0; j < sizeof(long); j++) { ordinp <<= 8; ordinp |= (input & 0xff); input >>= 8; } // // Step 2: extract sign, exponent as longs. // long sign = (ordinp>>63) & 1; long expn = (ordinp>>48) & 0x7FFF; long ordout = 0; // // Step 3: add biases. // if (expn != 0) expn += DeltaBias; if (0 <= expn && expn < expn_max) { ordout |= (sign<<63); ordout |= (expn<<52); // // Step 4 get the mantissa, keeping in mind cray HSB convention. // long mant = (ordinp) & 0x7FFFFFFFFFFF; mant <<= 5; ordout |= mant; } else if (expn_max <= expn) { // // Overflow. Make something big. // ordout = 0x7ff0000000000000L; ordout |= (sign<<63); } else // // Denorm? // ordout = 0; // // Step last: store results and update pointers. // lin++; *lout++ = ordout; } } #endif /*defined(__alpha) && !defined(BL_USE_FLOAT)*/ #if defined(__alpha) && defined(BL_USE_FLOAT) static void ieee32toalpha32_fconvert (void* out, const void* in, long nitems) { const long expn_max = (1L << 8L) - 1L; memset(out, 0, nitems*4); int* iin = (int*)in; int* iout = (int*)out; for (long i = 0; i < nitems; i++) { // // Step 1: change ordering to match alpha. // int ordinp = 0; for (int j = 0, input = *iin; j < sizeof(int); j++) { ordinp <<= 8; ordinp |= (input & 0xff); input >>= 8; } // // Step 2: extract exponent. // long expn = (ordinp>>23) & 0xFF; if (expn_max <= expn) { // // Overflow. Make something big. // int sign = ordinp & 0x80000000; ordinp = 0x7f800000; ordinp |= sign; } else if (expn <= 0) // // Denorm? // ordinp = 0; // // Step last: store results and update pointers. // iin++; *iout++ = ordinp; } } #endif /*defined(__alpha) && defined(BL_USE_FLOAT)*/ static void PD_fixdenormals (void* out, long nitems, const long* outfor, const int* outord) { const int nbo = int(outfor[0]); int nbo_exp = int(outfor[1]); int bo_exp = int(outfor[4]); int outbytes = (nbo + 7) >> 3; char* lout = (char*) out; for (long i = 0L; i < nitems; i++) { if (_PD_extract_field(lout, bo_exp, nbo_exp, outbytes, outord) == 0) { // // Set the word to zero. // char* loutoffset = lout+(i*outbytes); memset(loutoffset, '\0', outbytes); } bo_exp += nbo; } } // // It's really sad that I need to do this ... // #undef GETARRAY #define GETARRAY(TYPE) \ static \ void \ getarray (std::istream& is, \ Array< TYPE >& ar) \ { \ char c; \ is >> c; \ if (c != '(') \ BoxLib::Error("getarray(istream&): expected a \'(\'"); \ int size; \ is >> size; \ is >> c; \ if ( c != ',') \ BoxLib::Error("getarray(istream&): expected a \',\'"); \ is >> c; \ if (c != '(') \ BoxLib::Error("getarray(istream&): expected a \'(\'"); \ ar.resize(size); \ for(int i = 0; i < size; ++i) \ is >> ar[i]; \ is >> c; \ if (c != ')') \ BoxLib::Error("getarray(istream&): expected a \')\'"); \ is >> c; \ if (c != ')') \ BoxLib::Error("getarray(istream&): expected a \')\'"); \ } GETARRAY(int) GETARRAY(long) #undef GETARRAY #undef PUTARRAY #define PUTARRAY(TYPE) \ static \ void \ putarray (std::ostream& os, \ const Array< TYPE >& ar) \ { \ int i; \ os << '('; \ os << ar.size() << ", ("; \ for (i = 0; i < ar.size(); ++i) \ { \ os << ar[i]; \ if (i != ar.size() - 1) \ os << ' '; \ } \ os << "))"; \ } PUTARRAY(int) PUTARRAY(long) #undef PUTARRAY std::ostream& operator<< (std::ostream& os, const RealDescriptor& id) { os << "("; putarray(os, id.formatarray()); os << ','; putarray(os, id.orderarray()); os << ")"; if (os.fail()) BoxLib::Error("operator<<(ostream&,RealDescriptor&) failed"); return os; } std::istream& operator>> (std::istream& is, RealDescriptor& rd) { char c; is >> c; if (c != '(') BoxLib::Error("operator>>(istream&,RealDescriptor&): expected a \'(\'"); Array fmt; getarray(is, fmt); is >> c; if (c != ',') BoxLib::Error("operator>>(istream&,RealDescriptor&): expected a \',\'"); Array ord; getarray(is, ord); is >> c; if (c != ')') BoxLib::Error("operator>>(istream&,RealDescriptor&): expected a \')\'"); rd = RealDescriptor(fmt.dataPtr(),ord.dataPtr(),ord.size()); return is; } static void PD_convert (void* out, const void* in, long nitems, int boffs, const RealDescriptor& od, const RealDescriptor& id, const IntDescriptor& ld, int onescmp = 0) { #if defined(__alpha) && !defined(BL_USE_FLOAT) if (id == FPC::CrayRealDescriptor() && od == FPC::NativeRealDescriptor()) cray64toalpha64_fconvert(out, in, nitems); else #endif /*defined(__alpha) && !defined(BL_USE_FLOAT)*/ #if defined(__alpha) & defined( BL_USE_FLOAT) if (id==FPC::Ieee32NormalRealDescriptor() && od==FPC::NativeRealDescriptor()) ieee32toalpha32_fconvert(out, in, nitems); else #endif #if defined(BL_ARCH_CRAY) if (id==FPC::NativeRealDescriptor() && od==FPC::Ieee32NormalRealDescriptor()) { char craych; int wdsize = 4, conv_typ = 2, stride = 1, offset = 0, len = nitems; BL_ASSERT(len == nitems); FORT_CRAY2IEG(conv_typ,len,(char*)out,offset,(char*)in,stride,craych); } else if (id==FPC::NativeRealDescriptor() && od==FPC::Ieee64NormalRealDescriptor()) { // // Note that there is currently no way to specify that we want to // write out IEEE64 on a Cray. In fact, I don't believe there is // any need for this. Hence this block can never be reached. I'm // leaving it in solely for symmetry. Of course, there may be some // use for it in the future. // char craych; int wdsize = 8, conv_typ = 8, stride = 1, offset = 0, len = nitems; BL_ASSERT(len == nitems); FORT_CRAY2IEG(conv_typ,len,(char*)out,offset,(char*)in,stride,craych); } else if (id==FPC::Ieee32NormalRealDescriptor() && od==FPC::NativeRealDescriptor()) { char craych; int wdsize = 4, conv_typ = 2, stride = 1, offset = 0, len = nitems; BL_ASSERT(len == nitems); FORT_IEG2CRAY(conv_typ,len,(char*)in,offset,(char*)out,stride,craych); } else if (id==FPC::Ieee64NormalRealDescriptor() && od==FPC::NativeRealDescriptor()) { char craych; int wdsize = 8, conv_typ = 8, stride = 1, offset = 0, len = nitems; BL_ASSERT(len == nitems); FORT_IEG2CRAY(conv_typ,len,(char*)in,offset,(char*)out,stride,craych); } else #endif /*defined(BL_ARCH_CRAY)*/ if (od == id && boffs == 0) { size_t n = size_t(nitems); BL_ASSERT(int(n) == nitems); memcpy(out, in, n*od.numBytes()); } else if (od.formatarray() == id.formatarray() && boffs == 0 && !onescmp) permute_real_word_order(out, in, nitems, od.order(), id.order()); else { PD_fconvert(out, in, nitems, boffs, od.format(), od.order(), id.format(), id.order(), ld.order(), ld.numBytes(), onescmp); PD_fixdenormals(out, nitems, od.format(), od.order()); } } // // These routines aren't currently used. Eventually, we may define // convert() functions for integral types at which time these'll be used. // #if 0 // // Convert ones complement integers to twos complement. // Modern machines use twos complement arithmetic and therefore // this is a one way conversion. // static void _PD_ones_complement (char* out, long nitems, int nbo) { // // The next two lines are to get around a KCC warning message. // We've got to use signed chars here, but KCC won't let us // simply cast out to lout directly. // void* vout = out; signed char* lout = (signed char *) vout; for (int i = 0L; i < nitems; i++) { if (*lout < 0) { unsigned int carry = 1; for (int j = nbo-1; (j >= 0) && (carry > 0); j--) { carry += lout[j]; lout[j] = carry & 0xFF; carry = (carry > 0xFF); } } lout += nbo; } } // // Convert integers of nbi bytes to integers of nbo bytes. // The number of bytes for each integer are given. // static void PD_iconvert (void* out, void* in, long nitems, long nbo, int ordo, long nbi, int ordi, int onescmp = 0) { long i; int j; char *lout, *lin, *po, *pi; lin = (char*) in; lout = (char*) out; // // Convert nitems integers test sign bit to properly convert // negative integers. // if (nbi < nbo) { if (ordi == REVERSE_ORDER) { for (j = nbi; j < nbo; j++) { po = lout + j - nbi; pi = lin + nbi - 1; for (i = 0L; i < nitems; i++) { *po = (*pi & 0x80) ? 0xff : 0; po += nbo; pi += nbi; } } for (j = nbi; j > 0; j--) { po = lout + nbo - j; pi = lin + j - 1; for (i = 0L; i < nitems; i++) { *po = *pi; po += nbo; pi += nbi; } } } else { for (j = nbi; j < nbo; j++) { po = lout + j - nbi; pi = lin; for (i = 0L; i < nitems; i++) { *po = (*pi & 0x80) ? 0xff : 0; po += nbo; pi += nbi; } } for (j = 0; j < nbi; j++) { po = lout + j + nbo - nbi; pi = lin + j; for (i = 0L; i < nitems; i++) { *po = *pi; po += nbo; pi += nbi; } } } } else if (nbi >= nbo) { if (ordi == REVERSE_ORDER) { for (j = nbo; j > 0; j--) { po = lout + nbo - j; pi = lin + j - 1; for (i = 0L; i < nitems; i++) { *po = *pi; po += nbo; pi += nbi; } } } else { for (j = nbi - nbo; j < nbi; j++) { po = lout + j - nbi + nbo; pi = lin + j; for (i = 0L; i < nitems; i++) { *po = *pi; po += nbo; pi += nbi; } } } } // // If input used ones complement arithmetic convert to twos complement. // if (onescmp) _PD_ones_complement((char*)out, nitems, nbo); if (ordo == REVERSE_ORDER) _PD_btrvout((char*)out, nbo, nitems); } static void PD_convert (void* out, void* in, long nitems, const IntDescriptor& od, const IntDescriptor& id, int onescmp = 0) { if (od == id) memcpy(out, in, nitems*od.numBytes()); else { PD_iconvert(out, in, nitems, od.numBytes(), od.order(), id.numBytes(), id.order(), onescmp); } } #endif /*#if 0*/ // // Convert nitems in RealDescriptor format to native Real format. // void RealDescriptor::convertToNativeFormat (Real* out, long nitems, void* in, const RealDescriptor& id) { PD_convert(out, in, nitems, 0, FPC::NativeRealDescriptor(), id, FPC::NativeLongDescriptor()); if(bAlwaysFixDenormals) { PD_fixdenormals(out, nitems, FPC::NativeRealDescriptor().format(), FPC::NativeRealDescriptor().order()); } } // // Read nitems from istream in ReadDescriptor format to native Real format. // void RealDescriptor::convertToNativeFormat (Real* out, long nitems, std::istream& is, const RealDescriptor& id) { const int SHOULDREAD = 8192; char* bufr = new char[SHOULDREAD * id.numBytes()]; while (nitems > 0) { int get = int(nitems) > SHOULDREAD ? SHOULDREAD : int(nitems); is.read(bufr, id.numBytes()*get); PD_convert(out, bufr, get, 0, FPC::NativeRealDescriptor(), id, FPC::NativeLongDescriptor()); if(bAlwaysFixDenormals) { PD_fixdenormals(out, get, FPC::NativeRealDescriptor().format(), FPC::NativeRealDescriptor().order()); } nitems -= get; out += get; } if (is.fail()) BoxLib::Error("convert(Real*,long,istream&,RealDescriptor&) failed"); delete [] bufr; } // // Convert nitems Reals in native format to RealDescriptor format. // void RealDescriptor::convertFromNativeFormat (void* out, long nitems, Real* in, const RealDescriptor& od) { PD_convert(out, in, nitems, 0, od, FPC::NativeRealDescriptor(), FPC::NativeLongDescriptor()); } // // Convert nitems Reals in native format to RealDescriptor format // and write them to the ostream. // void RealDescriptor::convertFromNativeFormat (std::ostream& os, long nitems, const Real* in, const RealDescriptor& od) { const int SHOULDWRITE = 8192; char* bufr = new char[SHOULDWRITE * od.numBytes()]; while (nitems > 0) { int put = int(nitems) > SHOULDWRITE ? SHOULDWRITE : int(nitems); PD_convert(bufr, in, put, 0, od, FPC::NativeRealDescriptor(), FPC::NativeLongDescriptor()); os.write(bufr, od.numBytes()*put); nitems -= put; in += put; } if (os.fail()) BoxLib::Error("convert(ostream&,long,Real*,RealDescriptor&): failed"); delete [] bufr; } ccseapps-2.5/CCSEApps/BoxLib/BaseFab.cpp0000644000175000017500000001201611634153073021025 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include int BoxLib::BF_init::m_cnt = 0; static ThreadSpecificData* arena = 0; BoxLib::BF_init::BF_init () { if (m_cnt++ == 0) arena = new ThreadSpecificData; } BoxLib::BF_init::~BF_init () { if (--m_cnt == 0) delete arena; } Arena* BoxLib::ResetArena (Arena* newarena) { BL_ASSERT(newarena != 0); Arena* oldarena = arena->get(); BL_ASSERT(oldarena != 0); arena->set(newarena); return oldarena; } Arena* BoxLib::The_Arena () { BL_ASSERT(arena != 0); Arena* a = arena->get(); if (a == 0) { #if defined(BL_THREADS) || defined(BL_COALESCE_FABS) arena->set(a = new CArena); #else arena->set(a = new BArena); #endif } return a; } #ifndef WIN32 template<> void BaseFab::performCopy (const BaseFab& src, const Box& srcbox, int srccomp, const Box& destbox, int destcomp, int numcomp) { BL_ASSERT(destbox.ok()); BL_ASSERT(src.box().contains(srcbox)); BL_ASSERT(box().contains(destbox)); BL_ASSERT(destbox.sameSize(srcbox)); BL_ASSERT(srccomp >= 0 && srccomp+numcomp <= src.nComp()); BL_ASSERT(destcomp >= 0 && destcomp+numcomp <= nComp()); BL_PROFILE("template<> BaseFab::performCopy()"); if (destbox == domain && srcbox == src.box()) { Real* data_dst = dataPtr(destcomp); const Real* data_src = src.dataPtr(srccomp); for (long i = 0, N = numcomp*numpts; i < N; i++) { *data_dst++ = *data_src++; } } else { const int* destboxlo = destbox.loVect(); const int* destboxhi = destbox.hiVect(); const int* _th_plo = loVect(); const int* _th_phi = hiVect(); const int* _x_lo = srcbox.loVect(); const int* _x_hi = srcbox.hiVect(); const int* _x_plo = src.loVect(); const int* _x_phi = src.hiVect(); Real* _th_p = dataPtr(destcomp); const Real* _x_p = src.dataPtr(srccomp); FORT_FASTCOPY(_th_p, ARLIM(_th_plo), ARLIM(_th_phi), D_DECL(destboxlo[0],destboxlo[1],destboxlo[2]), D_DECL(destboxhi[0],destboxhi[1],destboxhi[2]), _x_p, ARLIM(_x_plo), ARLIM(_x_phi), D_DECL(_x_lo[0],_x_lo[1],_x_lo[2]), D_DECL(_x_hi[0],_x_hi[1],_x_hi[2]), numcomp); } } template<> void BaseFab::performSetVal (Real val, const Box& bx, int ns, int num) { BL_ASSERT(domain.contains(bx)); BL_ASSERT(ns >= 0 && ns + num <= nvar); if (bx == domain) { Real* data = &dptr[ns*numpts]; for (long i = 0, N = num*numpts; i < N; i++) { *data++ = val; } } else { const int* _box_lo = bx.loVect(); const int* _box_hi = bx.hiVect(); const int* _th_plo = loVect(); const int* _th_phi = hiVect(); Real* _th_p = dataPtr(ns); FORT_FASTSETVAL(&val, _box_lo, _box_hi, _th_p, ARLIM(_th_plo), ARLIM(_th_phi), num); } } #endif ccseapps-2.5/CCSEApps/BoxLib/Utility.cpp0000644000175000017500000006072311634153073021215 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Utility.cpp,v 1.64 2002/10/25 22:21:44 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #ifndef WIN32 #include #endif #include #include #include #include #include #include #ifdef WIN32 #include #define mkdir(a,b) _mkdir((a)) const char* path_sep_str = "\\"; #else const char* path_sep_str = "/"; #endif #ifdef BL_T3E #include #endif #if !defined(BL_ARCH_CRAY) && !defined(WIN32) && !defined(BL_T3E) #include #include #ifdef BL_AIX #undef _XOPEN_SOURCE_EXTENDED #define _XOPEN_SOURCE_EXTENDED 1 #endif #include #ifdef BL_AIX #undef _XOPEN_SOURCE_EXTENDED #endif #include #include // // This doesn't seem to be defined on SunOS when using g++. // #if defined(__GNUG__) && defined(__sun) && defined(BL_SunOS) extern "C" int gettimeofday (struct timeval*, struct timezone*); #endif double BoxLib::second (double* t) { struct tms buffer; times(&buffer); static long CyclesPerSecond = 0; if (CyclesPerSecond == 0) { #if defined(_SC_CLK_TCK) CyclesPerSecond = sysconf(_SC_CLK_TCK); if (CyclesPerSecond == -1) BoxLib::Error("second(double*): sysconf() failed"); #elif defined(HZ) CyclesPerSecond = HZ; #else CyclesPerSecond = 100; BoxLib::Warning("second(): sysconf(): default value of 100 for hz, worry about timings"); #endif } double dt = (buffer.tms_utime + buffer.tms_stime)/(1.0*CyclesPerSecond); if (t != 0) *t = dt; return dt; } static double get_initial_wall_clock_time () { struct timeval tp; if (gettimeofday(&tp, 0) != 0) BoxLib::Abort("get_time_of_day(): gettimeofday() failed"); return tp.tv_sec + tp.tv_usec/1000000.0; } // // Attempt to guarantee wsecond() gets initialized on program startup. // double BL_Initial_Wall_Clock_Time = get_initial_wall_clock_time(); double BoxLib::wsecond (double* t) { struct timeval tp; gettimeofday(&tp,0); double dt = tp.tv_sec + tp.tv_usec/1000000.0 - BL_Initial_Wall_Clock_Time; if (t != 0) *t = dt; return dt; } #elif defined(WIN32) // minimum requirement of WindowsNT #include namespace { double rate; bool inited = false; LONGLONG get_initial_wall_clock_time() { LARGE_INTEGER li; QueryPerformanceFrequency(&li); rate = 1.0/li.QuadPart; QueryPerformanceCounter(&li); inited = true; return li.QuadPart; } LONGLONG BL_Initial_Wall_Clock_Time = get_initial_wall_clock_time(); } double BoxLib::wsecond(double* rslt) { BL_ASSERT( inited ); LARGE_INTEGER li; QueryPerformanceCounter(&li); double result = double(li.QuadPart-BL_Initial_Wall_Clock_Time)*rate; if ( rslt ) *rslt = result; return result; } #include double BoxLib::second (double* r) { static clock_t start = -1; clock_t finish = clock(); if (start == -1) start = finish; double rr = double(finish - start)/CLOCKS_PER_SEC; if (r) *r = rr; return rr; } #elif defined(BL_ARCH_CRAY) #include extern "C" double SECOND(); extern "C" double RTC(); double BoxLib::second (double* t_) { double t = SECOND(); if (t_) *t_ = t; return t; } static double get_initial_wall_clock_time () { return RTC(); } // // Attempt to guarantee wsecond() gets initialized on program startup. // double BL_Initial_Wall_Clock_Time = get_initial_wall_clock_time(); double BoxLib::wsecond (double* t_) { double t = RTC() - BL_Initial_Wall_Clock_Time; if (t_) *t_ = t; return t; } #elif defined(BL_T3E) //#include #include extern "C" long _rtc(); static double BL_Clock_Rate; extern "C" { long IRTC_RATE(); long _irt(); } static long get_initial_wall_clock_time () { BL_Clock_Rate = IRTC_RATE(); return _rtc(); } // // Attempt to guarantee wsecond() gets initialized on program startup. // long BL_Initial_Wall_Clock_Time = get_initial_wall_clock_time(); // // NOTE: this is returning wall clock time, instead of cpu time. But on // the T3E, there is no difference (currently). If we call second() instead, // we may be higher overhead. Think about this one. // double BoxLib::second (double* t_) { double t = (_rtc() - BL_Initial_Wall_Clock_Time)/BL_Clock_Rate; if (t_) *t_ = t; return t; } double BoxLib::wsecond (double* t_) { double t = (_rtc() - BL_Initial_Wall_Clock_Time)/BL_Clock_Rate; if (t_) *t_ = t; return t; } #else #include double BoxLib::second (double* r) { static clock_t start = -1; clock_t finish = clock(); if (start == -1) start = finish; double rr = double(finish - start)/CLOCKS_PER_SEC; if (r) *r = rr; return rr; } static time_t get_initial_wall_clock_time () { return ::time(0); } // // Attempt to guarantee wsecond() gets initialized on program startup. // time_t BL_Initial_Wall_Clock_Time = get_initial_wall_clock_time(); double BoxLib::wsecond (double* r) { time_t finish; time(&finish); double rr = double(finish - BL_Initial_Wall_Clock_Time); if (r) *r = rr; return rr; } #endif /*!defined(BL_ARCH_CRAY) && !defined(WIN32) && !defined(BL_T3E)*/ void BoxLib::ResetWallClockTime () { BL_Initial_Wall_Clock_Time = get_initial_wall_clock_time(); } // // Return true if argument is a non-zero length string of digits. // bool BoxLib::is_integer (const char* str) { int len = 0; if (str == 0 || (len = strlen(str)) == 0) return false; for (int i = 0; i < len; i++) if (!isdigit(str[i])) return false; return true; } std::string BoxLib::Concatenate (const std::string& root, int num) { std::string result = root; char buf[32]; sprintf(buf, "%04d", num); result += buf; return result; } // // Creates the specified directories. `path' may be either a full pathname // or a relative pathname. It will create all the directories in the // pathname, if they don't already exist, so that on successful return the // pathname refers to an existing directory. Returns true or false // depending upon whether or not all it was successful. Also returns // true if `path' is NULL. `mode' is the mode passed to mkdir() for // any directories that must be created. // // For example, if it is passed the string "/a/b/c/d/e/f/g", it // will return successfully when all the directories in the pathname // exist; i.e. when the full pathname is a valid directory. // bool #ifdef WIN32 BoxLib::UtilCreateDirectory (const std::string& path, int) #else BoxLib::UtilCreateDirectory (const std::string& path, mode_t mode) #endif { if (path.length() == 0 || path == path_sep_str) return true; if (strchr(path.c_str(), *path_sep_str) == 0) { // // No slashes in the path. // return mkdir(path.c_str(),mode) < 0 && errno != EEXIST ? false : true; } else { // // Make copy of the directory pathname so we can write to it. // char* dir = new char[path.length() + 1]; (void) strcpy(dir, path.c_str()); char* slash = strchr(dir, *path_sep_str); if (dir[0] == *path_sep_str) { // // Got a full pathname. // do { if (*(slash+1) == 0) break; if ((slash = strchr(slash+1, *path_sep_str)) != 0) *slash = 0; if (mkdir(dir, mode) < 0 && errno != EEXIST) return false; if (slash) *slash = *path_sep_str; } while (slash); } else { // // Got a relative pathname. // do { *slash = 0; if (mkdir(dir, mode) < 0 && errno != EEXIST) return false; *slash = *path_sep_str; } while ((slash = strchr(slash+1, *path_sep_str)) != 0); if (mkdir(dir, mode) < 0 && errno != EEXIST) return false; } delete [] dir; return true; } } void BoxLib::CreateDirectoryFailed (const std::string& dir) { std::string msg("Couldn't create directory: "); msg += dir; BoxLib::Error(msg.c_str()); } void BoxLib::FileOpenFailed (const std::string& file) { std::string msg("Couldn't open file: "); msg += file; BoxLib::Error(msg.c_str()); } void BoxLib::UnlinkFile (const std::string& file) { unlink(file.c_str()); } void BoxLib::OutOfMemory () { #ifdef BL_T3E malloc_stats(0); #endif BoxLib::Error("Sorry, out of memory, bye ..."); } #ifdef WIN32 pid_t BoxLib::Execute (const char* cmd) { BoxLib::Error("Execute failed!"); return -1; } #else extern "C" pid_t fork(); pid_t BoxLib::Execute (const char* cmd) { pid_t pid = fork(); if (pid == 0) { system(cmd); exit(0); } return pid; } #endif // // Encapsulates Time // namespace { const long billion = 1000000000L; } BoxLib::Time::Time() { tv_sec = 0; tv_nsec = 0; } BoxLib::Time::Time(long s, long n) { BL_ASSERT(s >= 0); BL_ASSERT(n >= 0); BL_ASSERT(n < billion); tv_sec = s; tv_nsec = n; normalize(); } BoxLib::Time::Time(double d) { tv_sec = long(d); tv_nsec = long((d-tv_sec)*billion); normalize(); } double BoxLib::Time::as_double() const { return tv_sec + tv_nsec/double(billion); } long BoxLib::Time::as_long() const { return tv_sec + tv_nsec/billion; } BoxLib::Time& BoxLib::Time::operator+=(const Time& r) { tv_sec += r.tv_sec; tv_nsec += r.tv_nsec; normalize(); return *this; } BoxLib::Time BoxLib::Time::operator+(const Time& r) const { Time result(*this); return result+=r; } void BoxLib::Time::normalize() { if ( tv_nsec > billion ) { tv_nsec -= billion; tv_sec += 1; } } BoxLib::Time BoxLib::Time::get_time() { return Time(BoxLib::wsecond()); } // // BoxLib Interface to Mersenne Twistor // /* A C-program for MT19937: Real number version (1999/10/28) */ /* genrand() generates one pseudorandom real number (double) */ /* which is uniformly distributed on [0,1]-interval, for each */ /* call. sgenrand(seed) sets initial values to the working area */ /* of 624 words. Before genrand(), sgenrand(seed) must be */ /* called once. (seed is any 32-bit integer.) */ /* Integer generator is obtained by modifying two lines. */ /* Coded by Takuji Nishimura, considering the suggestions by */ /* Topher Cooper and Marc Rieffel in July-Aug. 1997. */ /* This library is free software under the Artistic license: */ /* see the file COPYING distributed together with this code. */ /* For the verification of the code, its output sequence file */ /* mt19937-1.out is attached (2001/4/2) */ /* Copyright (C) 1997, 1999 Makoto Matsumoto and Takuji Nishimura. */ /* Any feedback is very welcome. For any question, comments, */ /* see http://www.math.keio.ac.jp/matumoto/emt.html or email */ /* matumoto@math.keio.ac.jp */ /* REFERENCE */ /* M. Matsumoto and T. Nishimura, */ /* "Mersenne Twister: A 623-Dimensionally Equidistributed Uniform */ /* Pseudo-Random Number Generator", */ /* ACM Transactions on Modeling and Computer Simulation, */ /* Vol. 8, No. 1, January 1998, pp 3--30. */ namespace { // Period parameters // const int N = 624; const int M = 397; const unsigned long MATRIX_A = 0x9908B0DFUL; // constant vector a const unsigned long UPPER_MASK = 0x80000000UL; // most significant w-r bits const unsigned long LOWER_MASK = 0x7FFFFFFFUL; // least significant r bits // Tempering parameters const unsigned long TEMPERING_MASK_B = 0x9D2C5680UL; const unsigned long TEMPERING_MASK_C = 0xEFC60000UL; inline unsigned long TEMPERING_SHIFT_U(unsigned long y) { return y >> 11L; } inline unsigned long TEMPERING_SHIFT_S(unsigned long y) { return y << 7L ; } inline unsigned long TEMPERING_SHIFT_T(unsigned long y) { return y << 15L; } inline unsigned long TEMPERING_SHIFT_L(unsigned long y) { return y >> 18L; } } // initializing the array with a NONZERO seed void BoxLib::mt19937::sgenrand(unsigned long seed) { #ifdef BL_MERSENNE_ORIGINAL_INIT for ( int i = 0; i < N; ++i ) { mt[i] = seed & 0xFFFF0000UL; seed = 69069U * seed + 1; mt[i] |= (seed& 0xFFFF0000UL) >> 16; seed = 69069U*seed + 1; } #else mt[0]= seed & 0xffffffffUL; for ( mti=1; mti> 30L)) + mti); /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ /* In the previous versions, MSBs of the seed affect */ /* only MSBs of the array mt[]. */ /* 2002/01/09 modified by Makoto Matsumoto */ mt[mti] &= 0xffffffffUL; /* for >32 bit machines */ } #endif mti = N; } /* initialize by an array with array-length */ /* init_key is the array for initializing keys */ /* key_length is its length */ void BoxLib::mt19937::sgenrand(unsigned long init_key[], int key_length) { int i, j, k; sgenrand(19650218UL); i=1; j=0; k = (N>key_length ? N : key_length); for ( ; k; k-- ) { mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL)) + init_key[j] + j; /* non linear */ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; j++; if (i>=N) { mt[0] = mt[N-1]; i=1; } if (j>=key_length) j=0; } for ( k=N-1; k; k-- ) { mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL)) - i; /* non linear */ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; if (i>=N) { mt[0] = mt[N-1]; i=1; } } mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */ } void BoxLib::mt19937::reload() { unsigned long y; int kk; // mag01[x] = x * MATRIX_A for x=0,1 static unsigned long mag01[2]={0x0UL, MATRIX_A}; for ( kk=0; kk> 1L) ^ mag01[y & 0x1UL]; } for ( ; kk> 1L) ^ mag01[y & 0x1UL]; } y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK); mt[N-1] = mt[M-1] ^ (y >> 1L) ^ mag01[y & 0x1UL]; mti = 0; } unsigned long BoxLib::mt19937::igenrand() { // generate N words at one time if ( mti >= N ) reload(); unsigned long y = mt[mti++]; y ^= TEMPERING_SHIFT_U(y); y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B; y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C; y ^= TEMPERING_SHIFT_L(y); return y; } BoxLib::mt19937::mt19937(unsigned long seed) : init_seed(seed), mti(N+1) { sgenrand(seed); } BoxLib::mt19937::mt19937 (unsigned long seed_array[], int len) { sgenrand(seed_array, len); } void BoxLib::mt19937::rewind() { sgenrand(init_seed); } double BoxLib::mt19937::d1_value() { return double(igenrand())/0xFFFFFFFFUL; } double BoxLib::mt19937::d_value() { const double zzz = double(0x80000000UL)*2; return double(igenrand())/zzz; } long BoxLib::mt19937::l_value() { return igenrand()&0x7FFFFFFFUL; } unsigned long BoxLib::mt19937::u_value() { return igenrand(); } namespace { BoxLib::mt19937 the_generator; } void BoxLib::InitRandom (unsigned long seed) { the_generator = mt19937(seed); } double BoxLib::Random () { return the_generator.d1_value(); } // // Fortran entry points for BoxLib::Random(). // BL_FORT_PROC_DECL(BLUTILINITRAND,blutilinitrand)(const int* sd) { unsigned long seed = *sd; BoxLib::InitRandom(seed); } BL_FORT_PROC_DECL(BLUTILRAND,blutilrand)(Real* rn) { *rn = BoxLib::Random(); } // // The standard normal CDF, for one random variable. // // Author: W. J. Cody // URL: http://www.netlib.org/specfun/erf // // This is the erfc() routine only, adapted by the // transform stdnormal_cdf(u)=(erfc(-u/sqrt(2))/2; // static double stdnormal_cdf (double u) { static const double Sqrt_2 = 1.41421356237309504880; // sqrt(2) static const double Sqrt_1_Pi = 0.56418958354775628695; // 1/sqrt(Pi) static const double a[5] = { 1.161110663653770e-2, 3.951404679838207e-1, 2.846603853776254e+1, 1.887426188426510e+2, 3.209377589138469e+3 }; static const double b[5] = { 1.767766952966369e-1, 8.344316438579620e+0, 1.725514762600375e+2, 1.813893686502485e+3, 8.044716608901563e+3 }; static const double c[9] = { 2.15311535474403846e-8, 5.64188496988670089e-1, 8.88314979438837594e+0, 6.61191906371416295e+1, 2.98635138197400131e+2, 8.81952221241769090e+2, 1.71204761263407058e+3, 2.05107837782607147e+3, 1.23033935479799725e+3 }; static const double d[9] = { 1.00000000000000000e+0, 1.57449261107098347e+1, 1.17693950891312499e+2, 5.37181101862009858e+2, 1.62138957456669019e+3, 3.29079923573345963e+3, 4.36261909014324716e+3, 3.43936767414372164e+3, 1.23033935480374942e+3 }; static const double p[6] = { 1.63153871373020978e-2, 3.05326634961232344e-1, 3.60344899949804439e-1, 1.25781726111229246e-1, 1.60837851487422766e-2, 6.58749161529837803e-4 }; static const double q[6] = { 1.00000000000000000e+0, 2.56852019228982242e+0, 1.87295284992346047e+0, 5.27905102951428412e-1, 6.05183413124413191e-2, 2.33520497626869185e-3 }; double y, z; y = fabs(u); if (y <= 0.46875*Sqrt_2) { // // Evaluate erf() for |u| <= sqrt(2)*0.46875 // z = y*y; y = u*((((a[0]*z+a[1])*z+a[2])*z+a[3])*z+a[4]) /((((b[0]*z+b[1])*z+b[2])*z+b[3])*z+b[4]); return 0.5+y; } z = exp(-y*y/2)/2; if (y <= 4.0) { // // Evaluate erfc() for sqrt(2)*0.46875 <= |u| <= sqrt(2)*4.0 // y = y/Sqrt_2; y = ((((((((c[0]*y+c[1])*y+c[2])*y+c[3])*y+c[4])*y+c[5])*y+c[6])*y+c[7])*y+c[8]) /((((((((d[0]*y+d[1])*y+d[2])*y+d[3])*y+d[4])*y+d[5])*y+d[6])*y+d[7])*y+d[8]); y = z*y; } else { // // Evaluate erfc() for |u| > sqrt(2)*4.0 // z = z*Sqrt_2/y; y = 2/(y*y); y = y*(((((p[0]*y+p[1])*y+p[2])*y+p[3])*y+p[4])*y+p[5]) /(((((q[0]*y+q[1])*y+q[2])*y+q[3])*y+q[4])*y+q[5]); y = z*(Sqrt_1_Pi-y); } return u < 0.0 ? y : (1-y); } // // Lower tail quantile for standard normal distribution function. // // This function returns an approximation of the inverse cumulative // standard normal distribution function. I.e., given P, it returns // an approximation to the X satisfying P = Pr{Z <= X} where Z is a // random variable from the standard normal distribution. // // The algorithm uses a minimax approximation by rational functions // and the result has a relative error whose absolute value is less // than 1.15e-9. // // Author: Peter J. Acklam // Time-stamp: 2002-06-09 18:45:44 +0200 // E-mail: jacklam@math.uio.no // WWW URL: http://www.math.uio.no/~jacklam // // C implementation adapted from Peter's Perl version // double BoxLib::InvNormDist (double p, bool best) { if (p <= 0 || p >= 1) BoxLib::Error("BoxLib::InvNormDist(): p MUST be in (0,1)"); // // Coefficients in rational approximations. // static const double a[6] = { -3.969683028665376e+01, 2.209460984245205e+02, -2.759285104469687e+02, 1.383577518672690e+02, -3.066479806614716e+01, 2.506628277459239e+00 }; static const double b[5] = { -5.447609879822406e+01, 1.615858368580409e+02, -1.556989798598866e+02, 6.680131188771972e+01, -1.328068155288572e+01 }; static const double c[6] = { -7.784894002430293e-03, -3.223964580411365e-01, -2.400758277161838e+00, -2.549732539343734e+00, 4.374664141464968e+00, 2.938163982698783e+00 }; static const double d[4] = { 7.784695709041462e-03, 3.224671290700398e-01, 2.445134137142996e+00, 3.754408661907416e+00 }; static const double lo = 0.02425; static const double hi = 0.97575; double x; if (p < lo) { // // Rational approximation for lower region. // double q = sqrt(-2*log(p)); x = (((((c[0]*q+c[1])*q+c[2])*q+c[3])*q+c[4])*q+c[5]) / ((((d[0]*q+d[1])*q+d[2])*q+d[3])*q+1); } else if (p > hi) { // // Rational approximation for upper region. // double q = sqrt(-2*log(1-p)); x = -(((((c[0]*q+c[1])*q+c[2])*q+c[3])*q+c[4])*q+c[5]) / ((((d[0]*q+d[1])*q+d[2])*q+d[3])*q+1); } else { // // Rational approximation for central region. // double q = p - 0.5; double r = q*q; x = (((((a[0]*r+a[1])*r+a[2])*r+a[3])*r+a[4])*r+a[5])*q / (((((b[0]*r+b[1])*r+b[2])*r+b[3])*r+b[4])*r+1); } // // The relative error of the approximation has absolute value less // than 1.15e-9. One iteration of Halley's rational method (third // order) gives full machine precision. // if (best) { static const double Sqrt_2Pi = 2.5066282746310002; // sqrt(2*Pi) double e = stdnormal_cdf(x) - p; double u = e*Sqrt_2Pi*exp(x*x/2); x -= u/(1 + x*u/2); } return x; } // // Fortran entry points for BoxLib::InvNormDist(). // BL_FORT_PROC_DECL(BLINVNORMDIST,blinvnormdist)(Real* result) { double val; // // Get a random number in (0,1); // do { val = the_generator.d_value(); } while (val == 0); *result = BoxLib::InvNormDist(val,false); } BL_FORT_PROC_DECL(BLINVNORMDISTBEST,blinvnormdistbest)(Real* result) { double val; // // Get a random number in (0,1); // do { val = the_generator.d_value(); } while (val == 0); *result = BoxLib::InvNormDist(val,true); } // // Sugar for parsing IO // std::istream& BoxLib::operator>>(std::istream& is, const expect& exp) { int len = exp.istr.size(); int n = 0; while ( n < len ) { char c; is >> c; if ( !is ) break; if ( c != exp.istr[n++] ) { is.putback(c); break; } } if ( n != len ) { is.clear(std::ios::badbit|is.rdstate()); std::string msg = "expect fails to find \"" + exp.the_string() + "\""; BoxLib::Error(msg.c_str()); } return is; } BoxLib::expect::expect(const char* istr_) : istr(istr_) { } BoxLib::expect::expect(const std::string& str_) : istr(str_) { } BoxLib::expect::expect(char c) { istr += c; } const std::string& BoxLib::expect::the_string() const { return istr; } ccseapps-2.5/CCSEApps/BoxLib/BLBoxLib_F.f0000644000175000017500000000153311634153073021051 0ustar amckinstryamckinstryc----------------------------------------------------------------------- subroutine bl_error(str) character*(*) str integer NSTR parameter (NSTR = 128) integer istr(NSTR) call blstr2int(istr, NSTR, str) call bl_error_cpp(istr, NSTR) end c----------------------------------------------------------------------- subroutine bl_warning(str) character*(*) str integer NSTR parameter (NSTR = 128) integer istr(NSTR) call blstr2int(istr, NSTR, str) call bl_warning_cpp(istr, NSTR) end c----------------------------------------------------------------------- subroutine bl_abort(str) character*(*) str integer NSTR parameter (NSTR = 128) integer istr(NSTR) call blstr2int(istr, NSTR, str) call bl_abort_cpp(istr, NSTR) end ccseapps-2.5/CCSEApps/BoxLib/BLutil_F.f0000644000175000017500000000311511634153073020645 0ustar amckinstryamckinstryC C $Id: BLutil_F.f,v 1.4 2002/06/19 20:49:44 car Exp $ C C======================================================================= C C String handling routines: C Strings are handled differently in C++ and in FORTRAN. In order C to simplify the framework strings are passed from FORTRAN to C++ C as arrays of integer characters, terminated by the EOS symbol C which we set to -1 C blstr2int converts a FORTRAN string to an integer array, C blint2str converts an integer array to a FORTRAN string. C C----------------------------------------------------------------------- SUBROUTINE blstr2int(iarr, n, str) CHARACTER*(*) str INTEGER n, i, j INTEGER iarr(n) INTEGER EOS PARAMETER (EOS=-1) C IF ( n .LE. len(str) ) THEN STOP "blstr2int: str to large for iarr" END IF C Make sure that IARR is empty DO J = 1, N iarr(J) = ichar(' ') END DO j = 1 DO i = 1, len(str) iarr(j) = ichar(str(i:i)) j = j + 1 END DO C EOS iarr(j) = EOS C END C----------------------------------------------------------------------- SUBROUTINE blint2str(str, iarr, n) CHARACTER*(*) str INTEGER n INTEGER iarr(n) INTEGER EOS PARAMETER (EOS=-1) INTEGER i C DO i = 1, LEN(str) str(i:i) = ' ' END DO DO i = 1, n IF ( i .GT. LEN(str) ) STOP "blint2str: iarr to large for str" IF ( iarr(i) .EQ. EOS ) GO TO 100 str(i:i) = char(iarr(i)) END DO 100 CONTINUE C END ccseapps-2.5/CCSEApps/BoxLib/BLVERSION.H0000644000175000017500000000343211634153073020514 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BLVERSION_H #define BLVERSION_H // // $Id: BLVERSION.H,v 1.4 2001/07/17 23:02:18 lijewski Exp $ // /*@ManDoc: The major version number of boxlib -- an integer. The BoxLib version number has the form: BL\_VERSION\_MAJOR.BL\_VERSION\_MINOR */ #define BL_VERSION_MAJOR 2 /*@ManDoc: The minor version number of boxlib -- an integer. The BoxLib version number has the form: BL\_VERSION\_MAJOR.BL\_VERSION\_MINOR */ #define BL_VERSION_MINOR 5 #endif /*BLVERSION_H*/ ccseapps-2.5/CCSEApps/BoxLib/FArrayBox.cpp0000644000175000017500000006006611634153073021407 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: FArrayBox.cpp,v 1.46 2001/08/21 18:08:46 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(BL_ARCH_CRAY) static const char sys_name[] = "CRAY"; #else static const char sys_name[] = "IEEE"; #endif // // Default Ordering to Normal Order. // FABio::Ordering FArrayBox::ordering = FABio::FAB_NORMAL_ORDER; // // Our 8-bit FABio type. // class FABio_8bit : public FABio { public: virtual void read (std::istream& is, FArrayBox& fb) const; virtual void write (std::ostream& os, const FArrayBox& fb, int comp, int num_comp) const; virtual void skip (std::istream& is, FArrayBox& f) const; virtual void skip (std::istream& is, FArrayBox& f, int nCompToSkip) const; protected: virtual void write_header (std::ostream& os, const FArrayBox& f, int nvar) const; }; // // Our ASCII FABio type. // class FABio_ascii : public FABio { public: virtual void read (std::istream& is, FArrayBox& fb) const; virtual void write (std::ostream& os, const FArrayBox& fb, int comp, int num_comp) const; virtual void skip (std::istream& is, FArrayBox& f) const; virtual void skip (std::istream& is, FArrayBox& f, int nCompToSkip) const; protected: virtual void write_header (std::ostream& os, const FArrayBox& f, int nvar) const; }; // // Our binary FABio type. // class FABio_binary : public FABio { public: FABio_binary (RealDescriptor* rd_); virtual void read (std::istream& is, FArrayBox& fb) const; virtual void write (std::ostream& os, const FArrayBox& fb, int comp, int num_comp) const; virtual void skip (std::istream& is, FArrayBox& f) const; virtual void skip (std::istream& is, FArrayBox& f, int nCompToSkip) const; protected: virtual void write_header (std::ostream& os, const FArrayBox& f, int nvar) const; CpClassPtr rd; }; // // This isn't inlined as it's virtual. // FABio::~FABio () {} void FABio::write_header (std::ostream& os, const FArrayBox& f, int nvar) const { BL_ASSERT(nvar <= f.nComp()); os << f.box() << ' ' << nvar << '\n'; if (os.fail()) BoxLib::Error("FABio::write_header() failed"); } // // Default format and FABio pointer to NATIVE type. // // Note: these should ALWAYS be changed in concert. // FABio::Format FArrayBox::format = FABio::FAB_NATIVE; FABio* FArrayBox::fabio = new FABio_binary(FPC::NativeRealDescriptor().clone()); FArrayBox::FArrayBox () {} FArrayBox::FArrayBox (const FArrayBox& fab) : BaseFab(fab) {} FArrayBox& FArrayBox::operator= (const FArrayBox& fab) { BaseFab::operator=(fab); return *this; } FArrayBox& FArrayBox::operator= (const Real& v) { BaseFab::operator=(v); return *this; } FArrayBox::FArrayBox (const Box& b, int n) : BaseFab(b,n) { // // For debugging purposes set values to QNAN when possible. // if ( do_initval ) setVal(initval); } void FArrayBox::resize (const Box& b, int N) { BaseFab::resize(b,N); // // For debugging purposes set values to QNAN when possible. // if ( do_initval ) setVal(initval); } FABio::Format FArrayBox::getFormat () { return format; } const FABio& FArrayBox::getFABio () { return *fabio; } void FArrayBox::setFABio (FABio* rd) { BL_ASSERT(rd != 0); delete fabio; fabio = rd; } Real FArrayBox::norm (int p, int comp, int numcomp) const { return norm(domain,p,comp,numcomp); } void FArrayBox::writeOn (std::ostream& os) const { writeOn(os,0,nComp()); } void FArrayBox::skipFAB (std::istream& is) { int ignore = 0; skipFAB(is, ignore); } FArrayBox::~FArrayBox () {} void FArrayBox::setFormat (FABio::Format fmt) { FABio* fio = 0; RealDescriptor* rd = 0; switch (fmt) { case FABio::FAB_ASCII: fio = new FABio_ascii; break; case FABio::FAB_8BIT: fio = new FABio_8bit; break; case FABio::FAB_NATIVE: rd = FPC::NativeRealDescriptor().clone(); fio = new FABio_binary(rd); break; case FABio::FAB_IEEE: BoxLib::Warning("FABio::FAB_IEEE has been deprecated"); // // Fall through ... // case FABio::FAB_IEEE_32: rd = FPC::Ieee32NormalRealDescriptor().clone(); fio = new FABio_binary(rd); break; default: std::cerr << "FArrayBox::setFormat(): Bad FABio::Format = " << fmt; BoxLib::Abort(); } FArrayBox::format = fmt; setFABio(fio); } void FArrayBox::setOrdering (FABio::Ordering ordering_) { //BoxLib::Warning("FArrayBox::setOrdering() has been deprecated"); ordering = ordering_; } FABio::Ordering FArrayBox::getOrdering () { //BoxLib::Warning("FArrayBox::getOrdering() has been deprecated"); return ordering; } void FArrayBox::setPrecision (FABio::Precision) { BoxLib::Warning("FArrayBox::setPrecision() has been deprecated"); } FABio::Precision FArrayBox::getPrecision () { BoxLib::Warning("FArrayBox::getPrecision() has been deprecated"); return FABio::FAB_FLOAT; } #if !defined(NDEBUG) bool FArrayBox::do_initval = true; #else bool FArrayBox::do_initval = false; #endif Real FArrayBox::initval = std::numeric_limits::has_quiet_NaN ? std::numeric_limits::quiet_NaN() : std::numeric_limits::max(); bool FArrayBox::set_do_initval (bool tf) { bool o_tf = do_initval; do_initval = tf; return o_tf; } bool FArrayBox::get_do_initval () { return do_initval; } Real FArrayBox::set_initval (Real iv) { Real o_iv = initval; initval = iv; return o_iv; } Real FArrayBox::get_initval () { return initval; } void FArrayBox::Initialize () { ParmParse pp("fab"); std::string fmt; // // This block can legitimately set FAB output format. // if (pp.query("format", fmt)) { FABio* fio = 0; RealDescriptor* rd = 0; if (fmt == "ASCII") { FArrayBox::format = FABio::FAB_ASCII; fio = new FABio_ascii; } else if (fmt == "8BIT") { FArrayBox::format = FABio::FAB_8BIT; fio = new FABio_8bit; } else if (fmt == "NATIVE") { FArrayBox::format = FABio::FAB_NATIVE; rd = FPC::NativeRealDescriptor().clone(); fio = new FABio_binary(rd); } else if (fmt == "IEEE" || fmt == "IEEE32") { if (fmt == "IEEE") { FArrayBox::format = FABio::FAB_IEEE; BoxLib::Warning("IEEE fmt in ParmParse files is deprecated"); } else { FArrayBox::format = FABio::FAB_IEEE_32; } rd = FPC::Ieee32NormalRealDescriptor().clone(); fio = new FABio_binary(rd); } else { std::cerr << "FArrayBox::init(): Bad FABio::Format = " << fmt; BoxLib::Abort(); } setFABio(fio); } // // This block sets ordering which doesn't affect output format. // It is only used when reading in an old FAB. // std::string ord; if (pp.query("ordering", ord)) { if (ord == "NORMAL_ORDER") FArrayBox::setOrdering(FABio::FAB_NORMAL_ORDER); else if (ord == "REVERSE_ORDER") FArrayBox::setOrdering(FABio::FAB_REVERSE_ORDER); else if (ord == "REVERSE_ORDER_2") FArrayBox::setOrdering(FABio::FAB_REVERSE_ORDER_2); else { std::cerr << "FArrayBox::init(): Bad FABio::Ordering = " << ord; BoxLib::Abort(); } } pp.query("initval", initval); pp.query("do_initval", do_initval); } void FArrayBox::Finalize () {} Real FArrayBox::norm (const Box& subbox, int p, int comp, int ncomp) const { BL_ASSERT(p >= 0); BL_ASSERT(comp >= 0 && comp+ncomp <= nComp()); Real nrm = 0; Real* tmp = 0; int tmplen = 0; if (p == 0 || p == 1) { nrm = BaseFab::norm(subbox,p,comp,ncomp); } else if (p == 2) { ForAllThisCPencil(Real,subbox,comp,ncomp) { const Real* row = &thisR; if (tmp == 0) { tmp = new Real[thisLen]; tmplen = thisLen; for (int i = 0; i < thisLen; i++) tmp[i] = row[i]*row[i]; } else { for (int i = 0; i < thisLen; i++) tmp[i] += row[i]*row[i]; } } EndForPencil nrm = tmp[0]; for (int i = 1; i < tmplen; i++) nrm += tmp[i]; nrm = sqrt(nrm); } else { Real pwr = Real(p); ForAllThisCPencil(Real,subbox,comp,ncomp) { const Real* row = &thisR; if (tmp == 0) { tmp = new Real[thisLen]; tmplen = thisLen; for (int i = 0; i < thisLen; i++) tmp[i] = pow(row[i],pwr); } else { for (int i = 0; i < thisLen; i++) tmp[i] += pow(row[i],pwr); } } EndForPencil nrm = tmp[0]; for (int i = 1; i < tmplen; i++) nrm += tmp[i]; Real invpwr = 1.0/pwr; nrm = pow(nrm,invpwr); } delete [] tmp; return nrm; } // // Copied from Utility.H. // #define BL_IGNORE_MAX 100000 // // This is where lies all the smarts for recognizing FAB headers. // FABio* FABio::read_header (std::istream& is, FArrayBox& f) { int nvar; Box bx; FABio* fio = 0; RealDescriptor* rd = 0; char c; is >> c; if (c != 'F') BoxLib::Error("FABio::read_header(): expected \'F\'"); is >> c; if (c != 'A') BoxLib::Error("FABio::read_header(): expected \'A\'"); is >> c; if (c != 'B') BoxLib::Error("FABio::read_header(): expected \'B\'"); is >> c; if (c == ':') { // // The "old" FAB format. // int typ_in, wrd_in; is >> typ_in; is >> wrd_in; char machine[128]; is >> machine; is >> bx; is >> nvar; // // Set the FArrayBox to the appropriate size. // f.resize(bx,nvar); is.ignore(BL_IGNORE_MAX, '\n'); switch (typ_in) { case FABio::FAB_ASCII: fio = new FABio_ascii; break; case FABio::FAB_8BIT: fio = new FABio_8bit; break; case FABio::FAB_NATIVE: case FABio::FAB_IEEE: rd = RealDescriptor::newRealDescriptor(typ_in, wrd_in, machine, FArrayBox::ordering); fio = new FABio_binary(rd); break; default: BoxLib::Error("FABio::read_header(): Unrecognized FABio header"); } } else { // // The "new" FAB format. // is.putback(c); rd = new RealDescriptor; is >> *rd; is >> bx; is >> nvar; // // Set the FArrayBox to the appropriate size. // f.resize(bx,nvar); is.ignore(BL_IGNORE_MAX, '\n'); fio = new FABio_binary(rd); } if (is.fail()) BoxLib::Error("FABio::read_header() failed"); return fio; } FABio* FABio::read_header (std::istream& is, FArrayBox& f, int compIndex, int& nCompAvailable) { int nvar; Box bx; FABio* fio = 0; RealDescriptor* rd = 0; char c; is >> c; if (c != 'F') BoxLib::Error("FABio::read_header(): expected \'F\'"); is >> c; if (c != 'A') BoxLib::Error("FABio::read_header(): expected \'A\'"); is >> c; if (c != 'B') BoxLib::Error("FABio::read_header(): expected \'B\'"); is >> c; if (c == ':') { // // The "old" FAB format. // int typ_in, wrd_in; is >> typ_in; is >> wrd_in; char machine[128]; is >> machine; is >> bx; is >> nvar; nCompAvailable = nvar; nvar = 1; // make a single component fab // // Set the FArrayBox to the appropriate size. // f.resize(bx,nvar); is.ignore(BL_IGNORE_MAX, '\n'); switch (typ_in) { case FABio::FAB_ASCII: fio = new FABio_ascii; break; case FABio::FAB_8BIT: fio = new FABio_8bit; break; case FABio::FAB_NATIVE: case FABio::FAB_IEEE: rd = RealDescriptor::newRealDescriptor(typ_in, wrd_in, machine, FArrayBox::ordering); fio = new FABio_binary(rd); break; default: BoxLib::Error("FABio::read_header(): Unrecognized FABio header"); } } else { // // The "new" FAB format. // is.putback(c); rd = new RealDescriptor; is >> *rd; is >> bx; is >> nvar; nCompAvailable = nvar; nvar = 1; // make a single component fab // // Set the FArrayBox to the appropriate size. // f.resize(bx,nvar); is.ignore(BL_IGNORE_MAX, '\n'); fio = new FABio_binary(rd); } if (is.fail()) BoxLib::Error("FABio::read_header() failed"); return fio; } void FArrayBox::writeOn (std::ostream& os, int comp, int num_comp) const { BL_ASSERT(comp >= 0 && num_comp >= 1 && (comp+num_comp) <= nComp()); fabio->write_header(os, *this, num_comp); fabio->write(os, *this, comp, num_comp); } void FArrayBox::readFrom (std::istream& is) { FABio* fabrd = FABio::read_header(is, *this); fabrd->read(is, *this); delete fabrd; } int FArrayBox::readFrom (std::istream& is, int compIndex) { int nCompAvailable; FABio* fabrd = FABio::read_header(is, *this, compIndex, nCompAvailable); BL_ASSERT(compIndex >= 0 && compIndex < nCompAvailable); fabrd->skip(is, *this, compIndex); // skip data up to the component we want fabrd->read(is, *this); int remainingComponents = nCompAvailable - compIndex - 1; fabrd->skip(is, *this, remainingComponents); // skip to the end delete fabrd; return nCompAvailable; } Box FArrayBox::skipFAB (std::istream& is, int& num_comp) { FArrayBox f; FABio* fabrd = FABio::read_header(is, f); fabrd->skip(is, f); delete fabrd; num_comp = f.nComp(); return f.box(); } void FABio_ascii::write (std::ostream& os, const FArrayBox& f, int comp, int num_comp) const { BL_ASSERT(comp >= 0 && num_comp >= 1 && (comp+num_comp) <= f.nComp()); const Box& bx = f.box(); IntVect sm = bx.smallEnd(); IntVect bg = bx.bigEnd(); for (IntVect p = sm; p <= bg; bx.next(p)) { os << p; for (int k=0; k < num_comp; k++) os << " " << f(p,k+comp); os << '\n'; } os << '\n'; if (os.fail()) BoxLib::Error("FABio_ascii::write() failed"); } void FABio_ascii::read (std::istream& is, FArrayBox& f) const { const Box& bx = f.box(); IntVect sm = bx.smallEnd(); IntVect bg = bx.bigEnd(); IntVect p, q; for (p = sm; p <= bg; bx.next(p)) { is >> q; if (p != q) { std::cerr << "Error: read IntVect " << q << " should be " << p << '\n'; BoxLib::Error("FABio_ascii::read() bad IntVect"); } for (int k = 0; k < f.nComp(); k++) is >> f(p, k); } if (is.fail()) BoxLib::Error("FABio_ascii::read() failed"); } void FABio_ascii::skip (std::istream& is, FArrayBox& f) const { FABio_ascii::read(is, f); } void FABio_ascii::skip (std::istream& is, FArrayBox& f, int nCompToSkip) const { BoxLib::Error("FABio_ascii::skip(..., int nCompToSkip) not implemented"); } void FABio_ascii::write_header (std::ostream& os, const FArrayBox& f, int nvar) const { os << "FAB: " << FABio::FAB_ASCII << ' ' << 0 << ' ' << sys_name << '\n'; FABio::write_header(os, f, nvar); } void FABio_8bit::write (std::ostream& os, const FArrayBox& f, int comp, int num_comp) const { BL_ASSERT(comp >= 0 && num_comp >= 1 && (comp+num_comp) <= f.nComp()); const Real eps = Real(1.0e-8); // FIXME - whats a better value? const long siz = f.box().numPts(); unsigned char* c = new unsigned char[siz]; for (int k = 0; k < num_comp; k++) { const Real mn = f.min(k+comp); const Real mx = f.max(k+comp); const Real* dat = f.dataPtr(k+comp); Real rng = std::abs(mx-mn); rng = (rng < eps) ? 0.0 : 255.0/(mx-mn); for (long i = 0; i < siz; i++) { Real v = rng*(dat[i]-mn); int iv = (int) v; c[i] = (unsigned char) iv; } os << mn << " " << mx << '\n' << siz << '\n'; os.write((char*)c,siz); } delete [] c; if (os.fail()) BoxLib::Error("FABio_8bit::write() failed"); } void FABio_8bit::read (std::istream& is, FArrayBox& f) const { long siz = f.box().numPts(); unsigned char* c = new unsigned char[siz]; Real mn, mx; for (int nbytes, k = 0; k < f.nComp(); k++) { is >> mn >> mx >> nbytes; BL_ASSERT(nbytes == siz); while (is.get() != '\n') ; is.read((char*)c,siz); Real* dat = f.dataPtr(k); const Real rng = (mx-mn)/255.0; for (long i = 0; i < siz; i++) { int iv = (int) c[i]; Real v = (Real) iv; dat[i] = mn + rng*v; } } if (is.fail()) BoxLib::Error("FABio_8bit::read() failed"); delete [] c; } void FABio_8bit::skip (std::istream& is, FArrayBox& f) const { const Box& bx = f.box(); long siz = bx.numPts(); Real mn, mx; for (int nbytes, k = 0; k < f.nComp(); k++) { is >> mn >> mx >> nbytes; BL_ASSERT(nbytes == siz); while (is.get() != '\n') ; is.seekg(siz, std::ios::cur); } if (is.fail()) BoxLib::Error("FABio_8bit::skip() failed"); } void FABio_8bit::skip (std::istream& is, FArrayBox& f, int nCompToSkip) const { const Box& bx = f.box(); long siz = bx.numPts(); Real mn, mx; for (int nbytes, k = 0; k < nCompToSkip; k++) { is >> mn >> mx >> nbytes; BL_ASSERT(nbytes == siz); while (is.get() != '\n') ; is.seekg(siz, std::ios::cur); } if (is.fail()) BoxLib::Error("FABio_8bit::skip() failed"); } void FABio_8bit::write_header (std::ostream& os, const FArrayBox& f, int nvar) const { os << "FAB: " << FABio::FAB_8BIT << ' ' << 0 << ' ' << sys_name << '\n'; FABio::write_header(os, f, nvar); } FABio_binary::FABio_binary (RealDescriptor* rd_) : rd(rd_) {} void FABio_binary::write_header (std::ostream& os, const FArrayBox& f, int nvar) const { os << "FAB " << *rd; FABio::write_header(os, f, nvar); } void FABio_binary::read (std::istream& is, FArrayBox& f) const { const long base_siz = f.box().numPts(); Real* comp_ptr = f.dataPtr(0); const long siz = base_siz*f.nComp(); RealDescriptor::convertToNativeFormat(comp_ptr, siz, is, *rd); if (is.fail()) BoxLib::Error("FABio_binary::read() failed"); } void FABio_binary::write (std::ostream& os, const FArrayBox& f, int comp, int num_comp) const { BL_ASSERT(comp >= 0 && num_comp >= 1 && (comp+num_comp) <= f.nComp()); const long base_siz = f.box().numPts(); const Real* comp_ptr = f.dataPtr(comp); const long siz = base_siz*num_comp; RealDescriptor::convertFromNativeFormat(os, siz, comp_ptr, *rd); if (os.fail()) BoxLib::Error("FABio_binary::write() failed"); } void FABio_binary::skip (std::istream& is, FArrayBox& f) const { const Box& bx = f.box(); long base_siz = bx.numPts(); long siz = base_siz * f.nComp(); is.seekg(siz*rd->numBytes(), std::ios::cur); if (is.fail()) BoxLib::Error("FABio_binary::skip() failed"); } void FABio_binary::skip (std::istream& is, FArrayBox& f, int nCompToSkip) const { const Box& bx = f.box(); long base_siz = bx.numPts(); long siz = base_siz * nCompToSkip; is.seekg(siz*rd->numBytes(), std::ios::cur); if (is.fail()) BoxLib::Error("FABio_binary::skip(..., int nCompToSkip) failed"); } std::ostream& operator<< (std::ostream& os, const FArrayBox& f) { static FABio_ascii fabio_ascii; fabio_ascii.write(os,f,0,f.nComp()); return os; } std::istream& operator>> (std::istream& is, FArrayBox& f) { FABio* fabrd = FABio::read_header(is,f); fabrd->read(is,f); delete fabrd; return is; } ccseapps-2.5/CCSEApps/BoxLib/test/0000755000175000017500000000000011634153073020015 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/BoxLib/test/GNUmakefile0000644000175000017500000000302311634153073022065 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.9 2001/11/01 23:52:50 car Exp $ # # # Set these to the appropriate value. # COMP = KCC COMP = g++ DIM = 2 PRECISION = DOUBLE DEBUG = TRUE DEBUG = FALSE USE_MPI = TRUE USE_MPI = FALSE USE_THREADS = FALSE USE_THREADS = TRUE PROFILE = TRUE PROFILE = FALSE PBOXLIB_HOME = ../.. include $(PBOXLIB_HOME)/mk/Make.defs # # Base name of each of the executables we want to build. # I'm assuming that each of these is a stand-alone program, # that simply needs to link against BoxLib. # #_progs += tVisMF tDir t8BIT tFB tFAC tCArena #_progs += tProfiler tThread tWorkQueue #_progs += tRan #_progs := tProfiler _progs := tread _progs := tWorkQueue INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/BoxLib ifeq ($(COMP),g++) INCLUDE_LOCATIONS += $(PBOXLIB_HOME)/BoxLib/std endif VPATH = $(PBOXLIB_HOME)/BoxLib include $(PBOXLIB_HOME)/BoxLib/Make.package all: $(addsuffix $(optionsSuffix).ex, $(_progs)) $(addsuffix $(optionsSuffix).ex, $(_progs)) \ : %$(optionsSuffix).ex : %.cpp $(objForExecs) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(objForExecs) $(libraries) $(RM) $@.o # # Run the tests ... # runtests : $(addsuffix $(optionsSuffix).ex, $(_progs)) # # # for f in $(filter-out tFABiofilt%, \ $(addsuffix $(optionsSuffix).ex, $(_progs))); do \ echo "====> Testing $$f ..."; echo; ./$$f; echo; \ done clean:: $(RM) bl3_prof bl3_prof.m $(RM) *.ex *.o include $(PBOXLIB_HOME)/mk/Make.rules ccseapps-2.5/CCSEApps/BoxLib/test/tProfiler.cpp0000644000175000017500000000425411634153073022474 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include namespace BoxLib3 { namespace testing { void profiler_main(int& argc, char**& argv); } } extern "C" void* test_profiler_routine(void*) { BL_PROFILE("tp_routine"); // BoxLib3::Thread::sleep(1.0); return 0; } namespace { void thread_timing() { BL_PROFILE("a_thread_timing()"); FunctionThread ft(test_profiler_routine); FunctionThread ft1(test_profiler_routine); test_profiler_routine(0); ft.join(); ft1.join(); } } int main(int argc, char** argv) { BoxLib::Initialize(argc, argv); const double million = 1000000.0; BoxLib::WallTimer wt; wt.start(); wt.stop(); std::cout << "Wall timer reports (us) = " << wt.accum_time()*million << std::endl; std::cout << "Wall timer tick = (us) " << wt.tick()*million << std::endl; thread_timing(); BoxLib::Finalize(); } ccseapps-2.5/CCSEApps/BoxLib/test/mt19937int.out0000644000175000017500000002570011634153073022322 0ustar amckinstryamckinstry2867219139 1585203162 3113124129 2953900839 2463794868 3482265796 1164297043 3598195569 589972756 4112233867 767115311 4093075447 1322433849 3357085324 3300048468 3649464345 3676604632 1475054104 2601934239 3420804864 2492391180 28597038 1901037238 1209433535 3580317774 2488297452 79873538 3308484072 2913896343 4166196021 1930853421 3313543893 2603730014 2827553081 1952080899 1405101208 1959413290 2221997165 4110132150 1025637693 3670222467 3930802957 2581008338 1350592177 3907543700 4014701607 935323183 1742076441 3183014990 3775329649 2670402585 631538770 3348109412 2875142640 1153190187 1034841106 4215431531 3369145821 2443967621 489641649 1500338112 3753983456 714552875 1260890119 2952668397 3337192800 555421782 74804828 1151768793 1410928776 1120209439 2228198263 4057501661 3114914981 2544059595 3532152016 2287564919 2032846052 1496843742 3333090545 1817300007 250812909 1159923179 685307794 3541764804 461984834 3147015419 3371051674 740493100 1639766659 890836426 1816610558 740465142 185885280 4259873427 3958263241 4265440603 921638366 4154579172 805230647 3014407950 1805221957 561367725 2705796996 1548190021 2511308322 1037370857 3468383218 2263520462 100585698 1357493989 3614308996 171284736 2282220711 3523042469 2348826997 107252578 4276234757 3467471468 226242558 1135756939 1172828762 1603997125 2391541156 3151990464 1103261409 3154811332 1113077002 3536625341 2952420703 1239175044 2568687405 2847842220 3298739581 3765822280 1818781797 1788591806 1276077776 949399679 539881640 2515373476 3278313288 2195264511 3140718958 2245786462 3972928638 927276666 511152533 2786021231 3889288448 1460095448 3481321755 2645725544 2557599731 3008353305 2338169325 3715786542 2327664598 1670522570 398515741 3912248287 1871479044 819271481 1603628159 2242972174 3206947715 2994316262 3479367748 2428416502 3005191888 596767713 4276386271 629871933 1632138881 2115083989 801211500 3827872169 1960552366 1795052222 2979479912 87338528 3149244595 643926064 3517042602 2067922190 2800708034 196411345 1750850708 1469706228 2911845443 1988965279 2800355451 2805480064 2192011017 3674906385 2681712455 4227392471 2728849226 3329705101 1906618821 3142299622 1154270206 4163694621 1798769436 4013849691 2028970854 2216068645 1849210321 4107229332 2515252953 3522279734 1983720317 2024886240 3537672193 3930217610 72039252 1780891549 3528367504 251685934 1188909432 1947153461 370404364 3813997465 162450456 3817237392 3024813148 114391043 3190750639 2737018031 1006449521 3646726966 287956073 1149908372 487404965 2110874122 4169788922 2708120708 1662089132 509477256 1099251950 2939553466 4116915810 2237150968 2532635264 1924974342 2275083438 2001527850 85819681 1193976695 2861341617 1014135054 996772449 4164228014 1090591843 2130489362 769151670 995393661 930169499 53462752 966539569 1906551696 3460997327 3881239157 2276159353 119179965 1765229953 2268172609 1085009887 2675771386 458208333 1454994770 1017850103 2649434515 2999463338 388687986 3415289788 3023627127 1525959519 2452400350 2054320272 3631689268 2249184966 2108263178 2566643186 614451766 1697197121 1906804322 1965059615 3685123413 1808965526 3338843213 3764537527 3904177263 654414333 3369183195 172707682 1789534658 99114865 197192909 1307666933 3275439681 3162223316 2159224432 2431824578 479324619 1925592859 2627879461 792010626 472668456 4177737701 2599283126 3434190900 1904530818 1875549291 2782382323 1854703958 335047755 782741003 3349774673 2070491163 1444691247 4133539299 3021083499 2858372993 4249693401 3115492149 2825785659 3224153798 4151435371 4286292998 1256416790 1517863100 745532812 2757126489 4013428350 2423548174 2188411943 3829463160 1559482295 745669519 3439972168 161134094 3704705522 2092939826 3727766120 1109991787 3566213491 1293706699 1909349236 2420196524 2304746689 3635143867 3551959793 4288618652 669034647 3741111948 2199915868 2168112271 1697649112 1070896705 2790677773 929567277 3818265352 1552321291 1984195592 2012174866 3313686631 3187267079 3743463291 3456016892 3700547177 673536746 3681166837 639979024 908071910 285351138 3480863067 2726064042 3433216772 4179945392 3619009940 2905120322 1106151469 2104819134 3436744154 2515523866 2371838050 1019585697 3627952443 875737047 370873717 2940893797 685464258 748098950 3797185507 1051282146 2282833018 477323378 4052824808 3410768817 2708164210 3910080099 801512007 3165259863 3098921372 202576730 3056859886 3173659693 1703200672 1431918718 1548107888 4098890898 4025128517 1676726643 3185240256 1377418328 682127434 229406958 536272508 1302848757 2222642426 3401319609 342519951 3491817370 880356224 2288503572 2560186828 904726294 2902811194 2239545174 1380829270 1525997083 799156132 3864212205 768044736 2575515908 3700396389 1384921240 1784666717 2072282702 2273112071 73034983 1893910430 554586922 1002452453 244890730 1914712138 3103142789 4100378990 15082512 4138839635 286473904 28127927 4285718216 3253349861 848606688 751913560 2912664004 4265187531 3287406403 3072476689 1465740219 1119222960 1706572418 1637696965 1301369982 994855959 3172254721 2787055691 4037606898 2001758001 3068451101 1913702326 164846220 3386718455 2360582776 538955390 1122472306 2163787896 3820825269 473138414 403084459 780682841 1916392897 2137309162 2973130398 1560974537 383098889 2823811259 95656605 1100898974 2054803549 1432869091 39447374 3865802542 2243381851 326718209 3764656818 3855400005 3824649153 1760031250 3890102346 38307054 3248874532 997675099 1302054089 1134435193 3758588966 3856615910 3995873394 1997896248 2341490681 4139020774 4219325865 2880626819 1553845962 739906589 2668272545 1218350904 1726725379 3948906843 1266205878 3012873230 2240549028 377137844 907277693 2560807557 211027090 1865109379 1680481889 3006556199 1195935070 538932664 781359924 1623787727 2139406835 695091061 1267298086 644554442 2677351606 1079279370 2545101579 536974673 3409890995 328220108 3828121455 2972265230 2639000446 208138402 3320584784 3363876703 2161783108 3027769253 2818364264 1836513581 2700089162 3711109606 2707396532 2252522835 542106924 290861120 65506152 4196413643 358020078 911900450 2802065405 3188834047 616484753 4176172380 3492813945 795652043 342823405 3851175499 2477619202 974180631 2070155077 3048615955 3495083384 650122283 14857981 1511525369 1296338035 240671856 4168080735 2161570494 148980922 962978395 1307706563 3324956171 1322718131 1734073640 2389532755 382604108 432552756 311652177 2123865787 4157917041 3154366327 2978207584 1290868994 2007821863 3260860131 2640548616 3404112149 1612513188 3058779399 4287633829 2922820044 3033015498 3511571915 991947766 643957286 2436721391 3576617627 2376996434 1222099653 3675388593 1992634707 2782662035 1200611853 159589769 679751733 3161948893 589403970 1044672925 1965277612 1713774522 1215426812 1813238647 3046834204 1409105205 3251078319 3532268691 2616009849 1386097548 174492254 3978807460 2821108637 2107299989 3461277028 491302117 2132304916 4182289785 2030842100 926165801 1843009221 4893907 1091318508 2578976004 3429416159 3465002536 4047073710 3470663786 489006494 1589495825 2487643370 50052787 4184895002 478354171 4082727190 2983387324 3988219089 2947112381 2737973843 650841551 207036108 469279577 2683578043 3017632501 163011627 1693305508 3903975904 3023727891 2966166673 1330783281 714904080 487395952 3194176556 132096950 3471991421 3333279298 964375359 1852875757 3398189707 1367148533 3028366754 1975064118 1410547156 930454876 1797368724 1024933376 4216347534 2926795400 2780961322 2950171792 254604891 2461064346 3101055432 4066457036 2276047585 2005729740 702724217 352362105 4032003380 3868709967 3062450037 1984810322 1122228626 1836441070 3049160795 3505191268 1416228722 3011433267 3618970400 2634380746 521960665 1258860577 3646964245 482700194 576607559 1025672363 1619715344 2931841378 2383672736 4168420462 3899810386 2725154884 1643576117 4113444955 1695213625 929397946 4130386425 3278249905 338698100 2621561873 760291850 1827462673 2953977437 2802490860 952114118 1564374766 1510012037 2517230207 2879255110 1376858550 545337582 275466025 1766675460 841474537 2279046836 160777324 1685578416 97066962 70420376 2697708528 1312050661 277966306 2512268326 3560039935 3707673740 1802069091 2214309607 3679963423 2799689014 2064212423 2518670131 1071037431 3289103113 2832242556 626819162 2821900349 4205402301 3092543042 1327800001 2111287012 3356990396 2106560895 980585039 2374462023 3972980985 1815212590 2934114838 2466983682 2647086546 1917133448 757801743 2800426440 3462078459 1864979383 3711607473 3244474925 1082752058 1953813482 3572643973 1845637828 1693567413 1911166886 13616514 1527215536 944105697 3720955806 3011125828 3659854035 3491170189 1206734392 2464190967 259012728 351640621 348063345 237157049 2592736807 3472084471 967215995 1941684155 3333469178 4243822747 2837898655 2173645309 2144297387 4085774723 2739089063 1721981340 1029091741 3863714757 3169542690 1736267037 1087293093 3741407119 3003360275 4039152624 965607200 1494605756 2700809461 1862970278 2060187203 2636522014 2296966448 2138904618 830770044 2409839298 946077889 676163933 2337773259 1967578486 1364110453 1120981439 1505148538 3176892430 3788500489 2221440449 2877805945 1848017526 1060239654 2981107887 394732496 775694702 2465430652 256035109 672200319 4034366090 652227015 224664253 2832534389 2590752268 1616461983 474981047 1729743343 1033065486 3679817635 1945677673 4142123708 3441705395 3623363652 2888854797 3848994849 2774468965 733621242 1559397411 610848083 1861857918 290039215 1969085557 2949458979 4146721138 1709209040 3104641793 2414678267 3702112927 1922014713 3006301085 2557432695 1953275956 3475362527 3440824021 1879890923 4118996054 524339283 2248075324 1608569809 1946682979 1598268490 3463673619 456566908 1513321122 1918511241 3005439161 1218124360 2614200732 1479017575 2505142496 3134113721 2091183380 2232940223 1740181808 2202332383 2146620821 2123780007 3400091025 3142337592 1128001831 3655589806 3699941203 871253103 1532083500 883298808 2042462485 1141767415 3305182865 2246327140 1481051047 2467236685 1053025675 1128030915 579308527 4094341357 3312590487 2638764195 4224606959 975347930 2780688281 3249107391 1737859059 562230366 3107238138 1630808317 3323952099 2688243612 1676966491 1391319909 1149056605 160522031 1888652620 1204167962 2599816629 4096616603 2153451204 2234463327 2254107492 2798858945 1904589021 3082279528 618798780 3162900214 746972615 4152315314 3641376911 347959902 847266746 3443266042 4212579027 2141521991 2369733694 4051999217 2434367934 2274132668 3939258516 365865295 1762948411 3765297135 4284895923 1178072377 1164762067 2304673964 2601931087 660951723 324246673 1237854749 1390986182 3123416686 3229473430 647145616 2228556457 3484897681 3854370955 3714649568 1924448690 275933853 3254129074 1742363440 1030650439 ccseapps-2.5/CCSEApps/BoxLib/test/tFAC.cpp0000644000175000017500000000470611634153073021305 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: tFAC.cpp,v 1.5 2001/07/22 18:25:48 car Exp $ // // A simple program to test FabArray::copy() in parallel. // #if !(BL_SPACEDIM==2) #error "This code assumes BL_SPACEDIM==2" #endif #include int main (int argc, char** argv) { BoxLib::Initialize(argc, argv); BL_ASSERT(ParallelDescriptor::NProcs() == 2); BoxArray ba_1(1); BoxArray ba_2(5); ba_1.set(0, Box(IntVect(0,0), IntVect(4,4))); ba_2.set(0, Box(IntVect( 1,0), IntVect(3,0))); ba_2.set(1, Box(IntVect( 0,1), IntVect(4,1))); ba_2.set(2, Box(IntVect(-1,2), IntVect(3,2))); ba_2.set(3, Box(IntVect( 1,3), IntVect(5,3))); ba_2.set(4, Box(IntVect(-1,4), IntVect(5,4))); MultiFab mf_1(ba_1,1,0); MultiFab mf_2(ba_2,2,0); // // Set all on mf_1 to zero. // mf_1.setVal(0); // // Set the first component of mf_2 to zero. // mf_2.setVal(0,0,1,0); // // Set second component to relevent index. // for (int i = 0; i < mf_2.length(); i++) { mf_2.setVal(i+1,ba_2[i],1,1,0); } mf_1.copy(mf_2, 1, 0, 1); if (ParallelDescriptor::IOProcessor()) { cout << mf_1[0] << endl; } BoxLib::Finalize(); } ccseapps-2.5/CCSEApps/BoxLib/test/t8BIT.cpp0000644000175000017500000000346611634153073021424 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: t8BIT.cpp,v 1.2 2000/10/02 20:52:40 lijewski Exp $ // // A simple program to read in a MultiFab and write out in 8BIT format. // #include int main (int argc, char** argv) { argc--; argv++; FArrayBox::setFormat(FABio::FAB_8BIT); for (int i = 0; i < argc; i++) { cout << "Transforming " << argv[i] << " ... " << flush; aString name = argv[i]; MultiFab mf; VisMF::Read(mf, name); VisMF::Write(mf, name, VisMF::OneFilePerCPU, true); cout << "done" << endl; } } ccseapps-2.5/CCSEApps/BoxLib/test/tCArena.cpp0000644000175000017500000000523511634153073022043 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: tCArena.cpp,v 1.9 2001/10/17 17:53:33 lijewski Exp $ // #ifndef WIN32 #include #endif #include #include #include #include #include using std::list; #ifndef WIN32 using std::set_new_handler; #endif // // A simple class emulating how we use FABs. // class FB { public: FB (); ~FB (); bool ok () const; enum { CHUNKSIZE = 1024 }; private: // // Disallowed // FB (const FB& rhs); FB& operator= (const FB&); static CArena m_CArena; size_t m_size; double* m_data; }; CArena FB::m_CArena(100*CHUNKSIZE); FB::FB () { m_size = size_t(CHUNKSIZE*BoxLib::Random()); m_data = (double*) m_CArena.alloc(m_size*sizeof(double)); // // Set specific values in the data. // for (int i = 0; i < m_size; i++) m_data[i] = m_size; } FB::~FB () { ok(); m_CArena.free(m_data); } bool FB::ok () const { for (int i = 0; i < m_size; i++) BL_ASSERT(m_data[i] == m_size); return true; } int main () { set_new_handler(BoxLib::OutOfMemory); list fbl; for (int j = 0; j < 10; j++) { cout << "Loop == " << j << endl; for (int i = 0; i < 1000; i++) { fbl.push_back(new FB); } while (!fbl.empty()) { delete fbl.back(); fbl.pop_back(); } } return 0; } ccseapps-2.5/CCSEApps/BoxLib/test/tVisMF.cpp0000644000175000017500000001044711634153073021677 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: tVisMF.cpp,v 1.21 2001/07/22 18:25:48 car Exp $ // #include #include #include static int nBoxs = 10; static char* the_prog_name; static aString PerFab("PerFab"); static aString PerCPU("PerCPU"); // // How defaults to PerCPU. // static aString How(PerCPU); static void usage () { std::cout << "usage: " << the_prog_name << " [-nboxs N]" << std::endl; exit(1); } static void parse_args (char**& argv) { while (*++argv && **argv == '-') { if (strcmp(*argv, "-nboxs") == 0) { if (*++argv) { nBoxs = atoi(*argv); if (nBoxs <= 0) { std::cout << "nboxs must be positive" << std::endl; usage(); } } else { std::cout << "No argument to -nboxs supplied.\n"; usage(); } } else { std::cout << "Exiting, unknown option: " << *argv << std::endl; usage(); } } } static void Write_N_Read (const MultiFab& mf, const aString& mf_name) { if (ParallelDescriptor::IOProcessor()) { std::cout << "Writing the MultiFab to disk ...\n"; } double start, end; ParallelDescriptor::Barrier(); if (ParallelDescriptor::IOProcessor()) { start = BoxLib::wsecond(); } ParallelDescriptor::Barrier(); if (ParallelDescriptor::IOProcessor()) { end = BoxLib::wsecond(); std::cout << "\nWallclock time for MF write: " << (end-start) << '\n'; std::cout << "Reading the MultiFab from disk ...\n"; } VisMF vmf(mf_name); BL_ASSERT(vmf.length() == mf.boxArray().length()); for (ConstMultiFabIterator mfi(mf); mfi.isValid(); ++mfi) { //const FArrayBox& fab = vmf[mfi.index()]; const FArrayBox& fab = vmf.GetFab(mfi.index(), 0); std::cout << "\tCPU #" << ParallelDescriptor::MyProc() << " read FAB #" << mfi.index() << '\n'; } ParallelDescriptor::Barrier(); if (ParallelDescriptor::IOProcessor()) { std::cout << "Building new MultiFab from disk version ....\n\n"; } MultiFab new_mf; VisMF::Read(new_mf, mf_name); } int main (int argc, char** argv) { BoxLib::Initialize(argc, argv); the_prog_name = argv[0]; parse_args(argv); BoxArray ba(nBoxs); ba.set(0, Box(IntVect(D_DECL(0,0,0)), IntVect(D_DECL(2,2,2)))); for (int i = 1; i < nBoxs; i++) { ba.set(i,BoxLib::grow(ba[i-1],2)); } MultiFab mf(ba, 2, 1); for (ConstMultiFabIterator mfi(mf); mfi.isValid(); ++mfi) { mf[mfi.index()].setVal(mfi.index()+1); } // // Set cells in ghost region to zero. // mf.setBndry(0); static const aString mf_name = "Spam-n-Eggs"; Write_N_Read (mf, mf_name); BoxLib::Finalize(); } ccseapps-2.5/CCSEApps/BoxLib/test/tDir.cpp0000644000175000017500000000306511634153073021427 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: tDir.cpp,v 1.4 2001/07/22 18:25:48 car Exp $ // #include int main (int argc, char** argv) { if (argc == 2) { if (!BoxLib::UtilCreateDirectory(argv[1], 0755)) { std::cout << "Utility::UtilCreateDirectory() failed!!!\n"; } } } ccseapps-2.5/CCSEApps/BoxLib/test/tWorkQueue.cpp0000644000175000017500000000756411634153073022650 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #ifndef WIN32 #include #endif #include namespace { Mutex print_mutex; } #if 1 #define DPRINTF(arg) \ do \ { \ Lock lock(print_mutex); \ std::printf("tid(%d): ", Thread::getID()); \ std::printf arg; \ } \ while (false) #else #define DPRINTF(arg) #endif namespace { Mutex rand_mutex; int random_l() { Lock lock(rand_mutex); int i = rand(); return i; } } namespace { const int ITERATIONS = 25; struct power_t : public WorkQueue::task { power_t(int value_, int power_) : value(value_), power(power_) { assert(value >= 0); assert(power >= 0); } virtual void run(); int value; int power; }; struct engine_t { explicit engine_t(const pthread_t& thr_) : thread_id(thr_), calls(1) {} pthread_t thread_id; int calls; }; Mutex engine_list_mutex; std::list engine_list; WorkQueue workq(4); } void Engine_destructor(void* value_ptr) { engine_t* engine = static_cast(value_ptr); Lock lock(engine_list_mutex); engine_list.push_back(engine); } namespace { ThreadSpecificData engine_key(0, Engine_destructor); void power_t::run() { engine_t* engine = engine_key.get(); if ( engine == 0 ) { engine = new engine_t(pthread_self()); engine_key.set(engine); } else { engine->calls++; } int result = 1; DPRINTF(("Engine: computing %d^%d\n", value, power)); for ( int count = 1; count <= power; count++ ) { result *= value; } DPRINTF(("Engine: result %d\n", result)); } } extern "C" void* WorkQueue_routine(void*) { for ( int count = 0; count < ITERATIONS; count++ ) { power_t* element = new power_t(random_l() % 20, random_l() % 7); DPRINTF(("Request: %d^%d\n", element->value, element->power)); workq.add(element); sleep(random_l() % 5); } return 0; } int main(int argc, char** argv) { BoxLib::Initialize(argc, argv); FunctionThread ft(WorkQueue_routine); WorkQueue_routine(0); ft.join(); workq.add(0); workq.wait(); workq.drain(); sleep(1); // FIXME: wait for descructors to all be called int count = 0; int calls = 0; for ( std::list::const_iterator it = engine_list.begin(); it != engine_list.end(); ++it ) { engine_t* engine = *it; count++; calls += engine->calls; std::printf("engine %d(%ld): %d calls\n", count, engine->thread_id, engine->calls); delete engine; } std::printf("%d engine threads processed %d calls\n", count, calls); BoxLib::Finalize(); } ccseapps-2.5/CCSEApps/BoxLib/test/.cvsignore0000644000175000017500000000002211634153073022007 0ustar amckinstryamckinstrybl_prof bl_prof.m ccseapps-2.5/CCSEApps/BoxLib/test/tread.cpp0000644000175000017500000000473311634153073021627 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: tread.cpp,v 1.1 2001/10/11 16:33:38 lijewski Exp $ // // Read in and sum up FABs on command line. // // This assumes they're all the same size and shape. // #include #include #include #include int main (int argc, char** argv) { BoxLib::Initialize(argc, argv); if (argc < 2) { std::cerr << "tread: fab1 fab2 fab3 ..." << std::endl; exit(1); } int idx = 1; FArrayBox sum; std::ifstream ifs; ifs.open(argv[idx], std::ios::in); if (!ifs.good()) BoxLib::FileOpenFailed(argv[idx]); std::cout << "Reading " << argv[idx] << " ..." << std::endl; sum.readFrom(ifs); idx++; for ( ; idx < argc; idx++) { FArrayBox tmp; std::ifstream ifs; ifs.open(argv[idx], std::ios::in); if (!ifs.good()) BoxLib::FileOpenFailed(argv[idx]); std::cout << "Reading " << argv[idx] << " ..." << std::endl; tmp.readFrom(ifs); sum += tmp; } std::ofstream ofs; ofs.open("SUM",std::ios::out|std::ios::trunc); if (!ofs.good()) BoxLib::FileOpenFailed("SUM"); sum.writeOn(ofs); BoxLib::Finalize(); return 0; } ccseapps-2.5/CCSEApps/BoxLib/test/tFB.cpp0000644000175000017500000000611211634153073021174 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: tFB.cpp,v 1.8 2001/10/17 17:53:33 lijewski Exp $ // // A test program for FillBoundary(). // #include #include #include #ifndef WIN32 using std::set_new_handler; #endif static void DumpFirstFab (const MultiFab& mf) { BL_ASSERT(mf.length() > 1); if (ParallelDescriptor::IOProcessor()) { BL_ASSERT(mf.DistributionMap()[0] == ParallelDescriptor::MyProc()); cout << mf[0] << endl; } } static void DoIt (MultiFab& mf) { BL_ASSERT(mf.nComp() >= 2); mf.setVal(0); // // Do loop just filling first component. // for (int i = 0; i < 10; i++) { for(MultiFabIterator mfi(mf); mfi.isValid(); ++mfi) { mfi().setVal(mfi.index()+1,0); } mf.FillBoundary(0,1); DumpFirstFab(mf); } // // Do loop just filling second component. // for (int i = 0; i < 10; i++) { for(MultiFabIterator mfi(mf); mfi.isValid(); ++mfi) { mfi().setVal(mfi.index()+10,1); } mf.FillBoundary(1,1); DumpFirstFab(mf); } // // Do loop filling all components. // for (int i = 0; i < 10; i++) { for(MultiFabIterator mfi(mf); mfi.isValid(); ++mfi) { mfi().setVal(mfi.index()+100); } mf.FillBoundary(); DumpFirstFab(mf); } } int main (int argc, char** argv) { #ifndef WIN32 set_new_handler(BoxLib::OutOfMemory); #endif BoxLib::Initialize(argc, argv); BoxList bl; Box bx1(IntVect::TheZeroVector(),IntVect::TheUnitVector()); Box bx2 = bx1; bx2.shift(0,2); bl.append(bx1); bl.append(bx2); BoxArray ba(bl); MultiFab junk(ba,2,1), junky(ba,2,1); DoIt(junk); DoIt(junky); DoIt(junk); DoIt(junky); BoxLib::Finalize(); return 0; } ccseapps-2.5/CCSEApps/BoxLib/test/tRan.cpp0000644000175000017500000000353011634153073021426 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include // this mersenne_ran_main() outputs first 1000 generated numbers // compare against the output of mt19937int.out int main(int argc, char** argv) { BoxLib::Initialize(argc,argv); BoxLib::mt19937 rr(4357UL); std::ios::fmtflags ofmtflags = std::cout.setf(std::ios::fixed, std::ios::floatfield); std::cout << std::setprecision(8); for ( int j=0; j<1000; j++ ) { std::cout << std::setw(10) << rr.u_value() << ' '; if ( j%5==4 ) std::cout << std::endl; } std::cout << std::endl; BoxLib::Finalize(); } ccseapps-2.5/CCSEApps/BoxLib/test/tThread.cpp0000644000175000017500000001537211634153073022124 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include namespace testing { void prodcons_main(); void philosophers_main(); } namespace { Mutex rand_mutex; Mutex print_mutex; int random_l() { rand_mutex.lock(); int i = rand(); rand_mutex.unlock(); return i; } //extern Mutex Debug::print_mutex; #define PRINTMSG(x) \ do \ { \ Lock lock(print_mutex); \ x; \ } \ while ( false ) const int N_DINERS = 5; // n philosophers sharing n chopsticks Mutex chopsticks[N_DINERS]; // At most n philosophers are allowed into the room, others would // have to wait at the door. This restriction demonstrates the use // of condition variables. ConditionVariable room_cond; int room_occupancy = 0; } class philosopher* phillies[N_DINERS]; class philosopher : public Thread { public: philosopher(int id); protected: void* work(); private: const int id; }; philosopher::philosopher(int id_) : id(id_) { assert(id >=0 && id < N_DINERS); run(Detached); } void* philosopher::work() { int l = id; int r = l+1; if ( r == N_DINERS ) { r = 0; } if ( l & 1 ) { int t = l; l = r; r = t; } PRINTMSG( std::cout << "Philosopher #" << id << " has entered the room." << std::endl ); int count = random_l() % 10 + 1; while ( count-- ) { chopsticks[l].lock(); chopsticks[r].lock(); PRINTMSG( std::cout << "Philosopher #" << id << " is eating spaghetti now." << std::endl ); Thread::sleep(BoxLib::Time(random_l()%2,random_l()%1000000000)); chopsticks[l].unlock(); chopsticks[r].unlock(); PRINTMSG( std::cout << "Philosopher #" << id << " is pondering about life." << std::endl ); Thread::sleep(BoxLib::Time(random_l()%2,random_l()%1000000000)); } room_cond.lock(); room_occupancy--; phillies[id] = 0; room_cond.unlock(); room_cond.signal(); PRINTMSG( std::cout << "Philosopher #" << id << " has left the room (" << room_occupancy << " left)." << std::endl ); return 0; } void testing::philosophers_main() { if ( Thread::max_threads() == 1 ) { BoxLib::Error("not going to work"); } room_cond.lock(); for ( int i=0; i // //@Man: //@Memo: A Collection of Floating-Point Constants Supporting FAB I/O /*@Doc: This class is a poor-person's namespace of floating-point constants used in support of FAB I/O. Since we can't assume the existence of namespaces, and we don't like global constants, we make them static constant data members of this class. */ class FPC { public: // //@ManDoc: 4-element array representing "normal" float order: {1,2,3,4} // static const int normal_float_order[]; // //@ManDoc: 4-element array representing "reverse" float order: {4,3,2,1} // static const int reverse_float_order[]; // //@ManDoc: Another "reversed" FP order: {2,1,4,3} // static const int reverse_float_order_2[]; // //@ManDoc: The "normal" double order: {1,2,3,4,5,6,7,8} // static const int normal_double_order[]; // //@ManDoc: A "reversed" double order: {8,7,6,5,4,3,2,1} // static const int reverse_double_order[]; // //@ManDoc: Another "reversed" double order: {2,1,4,3,6,5,8,7} // static const int reverse_double_order_2[]; // //@ManDoc: The Cray float order: {1,2,3,4,5,6,7,8} // static const int cray_float_order[]; /*@ManDoc: Array detailing the format of IEEE 32-bit normal order floats. In general, here's what the various indices in "format" array means: format[0] = number of bits per number format[1] = number of bits in exponent format[2] = number of bits in mantissa format[3] = start bit of sign format[4] = start bit of exponent format[5] = start bit of mantissa format[6] = high order mantissa bit (CRAY needs this) format[7] = bias of exponent */ static const long ieee_float[]; // //@ManDoc: Array detailing the format of IEEE 64-bit normal order doubles. // static const long ieee_double[]; // //@ManDoc: Array detailing the format of Cray floating point. // static const long cray_float[]; /*@ManDoc: Returns a constant reference to an IntDescriptor describing the native "long" under which BoxLib was compiled. Each BoxLib library will have exactly one of these compiled into it. */ static const IntDescriptor& NativeLongDescriptor (); /*@ManDoc: Returns a constant reference to a RealDescriptor describing the native Real under which BoxLib was compiled. Each BoxLib library will have exactly one of these compiled into it. Note that "Real" will be one of "float" or "double" depending on how the version of BoxLib was built. */ static const RealDescriptor& NativeRealDescriptor (); /*@ManDoc: Returns a constant reference to a RealDescriptor detailing the Cray FP format. */ static const RealDescriptor& CrayRealDescriptor (); /*@ManDoc: Returns a constant reference to a RealDescriptor detailing the IEEE 32-bit normal FP format. */ static const RealDescriptor& Ieee32NormalRealDescriptor (); /*@ManDoc: Returns a constant reference to a RealDescriptor detailing the IEEE 64-bit normal FP format. */ static const RealDescriptor& Ieee64NormalRealDescriptor (); }; #endif /*BL_FPC_H*/ ccseapps-2.5/CCSEApps/BoxLib/IntVect.cpp0000644000175000017500000001636511634153073021131 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: IntVect.cpp,v 1.19 2001/08/01 18:14:13 lijewski Exp $ // #include #include #include #include #include #include #include #include const IntVect& IntVect::TheUnitVector () { static const IntVect Unit(D_DECL(1,1,1)); return Unit; } const IntVect& IntVect::TheZeroVector () { static const IntVect Zero(D_DECL(0,0,0)); return Zero; } const IntVect& IntVect::TheNodeVector () { static const IntVect Node(D_DECL(IndexType::NODE,IndexType::NODE,IndexType::NODE)); return Node; } const IntVect& IntVect::TheCellVector () { static const IntVect Cell(D_DECL(IndexType::CELL,IndexType::CELL,IndexType::CELL)); return Cell; } IntVect::IntVect (const int *a) { D_EXPR(vect[0] = a[0], vect[1] = a[1], vect[2] = a[2]); } IntVect::IntVect (const Array &a) { BL_ASSERT(a.size() == BL_SPACEDIM); D_EXPR(vect[0] = a[0], vect[1] = a[1], vect[2] = a[2]); } bool IntVect::lexLT (const IntVect &s) const { #define LLT0 (vect[0] < s[0]) #define LLT1 ((vect[0] == s[0]) && (vect[1] < s[1])) #define LLT2 ((vect[1] == s[1]) && (vect[2] < s[2])) #if BL_SPACEDIM == 1 return LLT0; #elif BL_SPACEDIM == 2 return LLT0 || LLT1; #elif BL_SPACEDIM == 3 return LLT0 || (vect[0]==s[0] && ((vect[1] < s[1] || LLT2))); #endif #undef LLT0 #undef LLT1 #undef LLT2 } bool IntVect::lexGT (const IntVect& s) const { #define LGT0 (vect[0] > s[0]) #define LGT1 ((vect[0] == s[0]) && (vect[1] > s[1])) #define LGT2 ((vect[1] == s[1]) && (vect[2] > s[2])) #if BL_SPACEDIM == 1 return LGT0; #elif BL_SPACEDIM == 2 return LGT0 || LGT1; #elif BL_SPACEDIM == 3 return LGT0 || (vect[0] == s[0] && ((vect[1] > s[1] || LGT2))); #endif #undef LGT0 #undef LGT1 #undef LGT2 } IntVect& IntVect::min (const IntVect& p) { D_EXPR(vect[0] = std::min(vect[0], p.vect[0]), vect[1] = std::min(vect[1], p.vect[1]), vect[2] = std::min(vect[2], p.vect[2])); return *this; } IntVect& IntVect::max (const IntVect& p) { D_EXPR(vect[0] = std::max(vect[0], p.vect[0]), vect[1] = std::max(vect[1], p.vect[1]), vect[2] = std::max(vect[2], p.vect[2])); return *this; } IntVect& IntVect::scale (int s) { D_EXPR(vect[0] *= s, vect[1] *= s, vect[2] *= s); return *this; } IntVect& IntVect::reflect (int ref_ix, int idir) { BL_ASSERT(idir >= 0 && idir < BL_SPACEDIM); vect[idir] = -vect[idir] + 2*ref_ix; return *this; } IntVect& IntVect::shift (int coord, int s) { BL_ASSERT(coord >= 0 && coord < BL_SPACEDIM); vect[coord] += s; return *this; } IntVect& IntVect::shift (const IntVect& iv) { *this += iv; return *this; } IntVect& IntVect::diagShift (int s) { D_EXPR(vect[0] += s, vect[1] += s, vect[2] += s); return *this; } IntVect operator+ (int s, const IntVect& p) { return IntVect(D_DECL(p[0] + s, p[1] + s, p[2] + s)); } IntVect operator- (int s, const IntVect& p) { return IntVect(D_DECL(s - p[0], s - p[1], s - p[2])); } IntVect operator* (int s, const IntVect& p) { return IntVect(D_DECL(s * p[0], s * p[1], s * p[2])); } IntVect BoxLib::scale (const IntVect& p, int s) { return IntVect(D_DECL(s * p[0], s * p[1], s * p[2])); } IntVect BoxLib::diagShift (const IntVect &p, int s) { return IntVect(D_DECL(p[0] + s, p[1] + s, p[2] + s)); } IntVect BoxLib::min (const IntVect& p1, const IntVect& p2) { IntVect p(p1); return p.min(p2); } IntVect BoxLib::max (const IntVect& p1, const IntVect& p2) { IntVect p(p1); return p.max(p2); } IntVect BoxLib::BASISV (int dir) { BL_ASSERT(dir >= 0 && dir < BL_SPACEDIM); IntVect tmp; tmp[dir] = 1; return tmp; } IntVect BoxLib::reflect (const IntVect& a, int ref_ix, int idir) { BL_ASSERT(idir >= 0 && idir < BL_SPACEDIM); IntVect b(a); b[idir] = -b[idir] + 2*ref_ix; return b; } IntVect BoxLib::coarsen (const IntVect& p, int s) { BL_ASSERT(s > 0); return IntVect( D_DECL((p[0]<0) ? -abs(p[0]+1)/s-1 : p[0]/s , (p[1]<0) ? -abs(p[1]+1)/s-1 : p[1]/s , (p[2]<0) ? -abs(p[2]+1)/s-1 : p[2]/s )); } IntVect BoxLib::coarsen (const IntVect& p1, const IntVect& p2) { BL_ASSERT(p2 > IntVect::TheZeroVector()); return IntVect( D_DECL( (p1[0]<0)?-abs(p1[0]+1)/p2[0]-1:p1[0]/p2[0], (p1[1]<0)?-abs(p1[1]+1)/p2[1]-1:p1[1]/p2[1], (p1[2]<0)?-abs(p1[2]+1)/p2[2]-1:p1[2]/p2[2]) ); } IntVect& IntVect::coarsen (int s) { BL_ASSERT(s > 0); for (int i = 0; i < BL_SPACEDIM; ++i) vect[i] = ((vect[i]<0) ? -abs(vect[i]+1)/s-1 : vect[i]/s); return *this; } IntVect& IntVect::coarsen (const IntVect& p) { BL_ASSERT(p > IntVect::TheZeroVector()); for (int i = 0; i // #define BL_IGNORE_MAX 100000 #include std::istream& operator>> (std::istream& is, IntVect& iv) { is >> std::ws; char c; is >> c; if (c == '(') { D_EXPR(is >> iv[0], is.ignore(BL_IGNORE_MAX, ',') >> iv[1], is.ignore(BL_IGNORE_MAX, ',') >> iv[2]); is.ignore(BL_IGNORE_MAX, ')'); } else { BoxLib::Error("operator>>(istream&,IntVect&): expected \'(\'"); } if (is.fail()) BoxLib::Error("operator>>(istream&,IntVect&) failed"); return is; } ccseapps-2.5/CCSEApps/BoxLib/std/0000755000175000017500000000000011634153073017630 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/BoxLib/std/limits0000644000175000017500000004344011634153073021061 0ustar amckinstryamckinstry/* * Copyright (c) 1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /* NOTE: This is not portable code. Parts of numeric_limits<> are * inherently machine-dependent, and this file is written for the MIPS * architecture and the SGI MIPSpro C++ compiler. Parts of it (in * particular, some of the characteristics of floating-point types) * are almost certainly incorrect for any other platform. */ #ifndef __SGI_CPP_LIMITS #define __SGI_CPP_LIMITS #include #include #include __STL_BEGIN_NAMESPACE enum float_round_style { round_indeterminate = -1, round_toward_zero = 0, round_to_nearest = 1, round_toward_infinity = 2, round_toward_neg_infinity = 3 }; enum float_denorm_style { denorm_indeterminate = -1, denorm_absent = 0, denorm_present = 1 }; // The C++ standard (section 18.2.1) requires that some of the members of // numeric_limits be static const data members that are given constant- // initializers within the class declaration. On compilers where the // __STL_STATIC_CONST_INIT_BUG macro is defined, it is impossible to write // a standard-conforming numeric_limits class. // // There are two possible workarounds: either initialize the data // members outside the class, or change them from data members to // enums. Neither workaround is satisfactory: the former makes it // impossible to use the data members in constant-expressions, and the // latter means they have the wrong type and that it is impossible to // take their addresses. We choose the former workaround. #ifdef __STL_STATIC_CONST_INIT_BUG # define __STL_DECLARE_LIMITS_MEMBER(__mem_type, __mem_name, __mem_value) \ enum { __mem_name = __mem_value } #else /* __STL_STATIC_CONST_INIT_BUG */ # define __STL_DECLARE_LIMITS_MEMBER(__mem_type, __mem_name, __mem_value) \ static const __mem_type __mem_name = __mem_value #endif /* __STL_STATIC_CONST_INIT_BUG */ // Base class for all specializations of numeric_limits. template class _Numeric_limits_base { public: __STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, false); static __number min() __STL_NOTHROW { return __number(); } static __number max() __STL_NOTHROW { return __number(); } __STL_DECLARE_LIMITS_MEMBER(int, digits, 0); __STL_DECLARE_LIMITS_MEMBER(int, digits10, 0); __STL_DECLARE_LIMITS_MEMBER(bool, is_signed, false); __STL_DECLARE_LIMITS_MEMBER(bool, is_integer, false); __STL_DECLARE_LIMITS_MEMBER(bool, is_exact, false); __STL_DECLARE_LIMITS_MEMBER(int, radix, 0); static __number epsilon() __STL_NOTHROW { return __number(); } static __number round_error() __STL_NOTHROW { return __number(); } __STL_DECLARE_LIMITS_MEMBER(int, min_exponent, 0); __STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, 0); __STL_DECLARE_LIMITS_MEMBER(int, max_exponent, 0); __STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, 0); __STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, false); __STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, false); __STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, false); __STL_DECLARE_LIMITS_MEMBER(float_denorm_style, has_denorm, denorm_absent); __STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false); static __number infinity() __STL_NOTHROW { return __number(); } static __number quiet_NaN() __STL_NOTHROW { return __number(); } static __number signaling_NaN() __STL_NOTHROW { return __number(); } static __number denorm_min() __STL_NOTHROW { return __number(); } __STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, false); __STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, false); __STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, false); __STL_DECLARE_LIMITS_MEMBER(bool, traps, false); __STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false); __STL_DECLARE_LIMITS_MEMBER(float_round_style, round_style, round_toward_zero); }; #ifdef __STL_STATIC_CONST_INIT_BUG # define __STL_DEFINE_NUMERIC_BASE_MEMBER(__type, __mem) #else /* __STL_STATIC_CONST_INIT_BUG */ # define __STL_DEFINE_NUMERIC_BASE_MEMBER(__type, __mem) \ template \ const __type _Numeric_limits_base<__number>:: __mem #endif /* __STL_STATIC_CONST_INIT_BUG */ __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, is_specialized); __STL_DEFINE_NUMERIC_BASE_MEMBER(int, digits); __STL_DEFINE_NUMERIC_BASE_MEMBER(int, digits10); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, is_signed); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, is_integer); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, is_exact); __STL_DEFINE_NUMERIC_BASE_MEMBER(int, radix); __STL_DEFINE_NUMERIC_BASE_MEMBER(int, min_exponent); __STL_DEFINE_NUMERIC_BASE_MEMBER(int, max_exponent); __STL_DEFINE_NUMERIC_BASE_MEMBER(int, min_exponent10); __STL_DEFINE_NUMERIC_BASE_MEMBER(int, max_exponent10); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, has_infinity); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, has_quiet_NaN); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, has_signaling_NaN); __STL_DEFINE_NUMERIC_BASE_MEMBER(float_denorm_style, has_denorm); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, has_denorm_loss); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, is_iec559); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, is_bounded); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, is_modulo); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, traps); __STL_DEFINE_NUMERIC_BASE_MEMBER(bool, tinyness_before); __STL_DEFINE_NUMERIC_BASE_MEMBER(float_round_style, round_style); // Base class for integers. template class _Integer_limits : public _Numeric_limits_base<_Int> { public: __STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true); static _Int min() __STL_NOTHROW { return __imin; } static _Int max() __STL_NOTHROW { return __imax; } __STL_DECLARE_LIMITS_MEMBER(int, digits, (__idigits < 0) ? (int)(sizeof(_Int) * CHAR_BIT) - (__imin == 0 ? 0 : 1) : __idigits); __STL_DECLARE_LIMITS_MEMBER(int, digits10, (digits * 301) / 1000); // log 2 = 0.301029995664... __STL_DECLARE_LIMITS_MEMBER(bool, is_signed, __imin != 0); __STL_DECLARE_LIMITS_MEMBER(bool, is_integer, true); __STL_DECLARE_LIMITS_MEMBER(bool, is_exact, true); __STL_DECLARE_LIMITS_MEMBER(int, radix, 2); __STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true); __STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, true); }; #ifdef __STL_STATIC_CONST_INIT_BUG # define __STL_DEFINE_INTEGER_LIMITS_MEMBER(__type, __mem) #else /* __STL_STATIC_CONST_INIT_BUG */ # define __STL_DEFINE_INTEGER_LIMITS_MEMBER(__type, __mem) \ template \ const __type _Integer_limits<_Int, __imin, __imax, __idigits>:: __mem #endif /* __STL_STATIC_CONST_INIT_BUG */ __STL_DEFINE_INTEGER_LIMITS_MEMBER(bool, is_specialized); __STL_DEFINE_INTEGER_LIMITS_MEMBER(int, digits); __STL_DEFINE_INTEGER_LIMITS_MEMBER(int, digits10); __STL_DEFINE_INTEGER_LIMITS_MEMBER(bool, is_signed); __STL_DEFINE_INTEGER_LIMITS_MEMBER(bool, is_integer); __STL_DEFINE_INTEGER_LIMITS_MEMBER(bool, is_exact); __STL_DEFINE_INTEGER_LIMITS_MEMBER(int, radix); __STL_DEFINE_INTEGER_LIMITS_MEMBER(bool, is_bounded); __STL_DEFINE_INTEGER_LIMITS_MEMBER(bool, is_modulo); // Base class for floating-point numbers. template class _Floating_limits : public _Numeric_limits_base<__number> { public: __STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true); __STL_DECLARE_LIMITS_MEMBER(int, digits, __Digits); __STL_DECLARE_LIMITS_MEMBER(int, digits10, __Digits10); __STL_DECLARE_LIMITS_MEMBER(bool, is_signed, true); __STL_DECLARE_LIMITS_MEMBER(int, radix, 2); __STL_DECLARE_LIMITS_MEMBER(int, min_exponent, __MinExp); __STL_DECLARE_LIMITS_MEMBER(int, max_exponent, __MaxExp); __STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, __MinExp10); __STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, __MaxExp10); __STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, true); __STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, true); __STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, true); __STL_DECLARE_LIMITS_MEMBER(float_denorm_style, has_denorm, denorm_indeterminate); __STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false); static __number infinity() __STL_NOTHROW { static const unsigned int _S_inf[sizeof(__number) / sizeof(int)] = { __InfinityWord }; return *reinterpret_cast(&_S_inf); } static __number quiet_NaN() __STL_NOTHROW { static const unsigned int _S_nan[sizeof(__number) / sizeof(int)] = { __QNaNWord }; return *reinterpret_cast(&_S_nan); } static __number signaling_NaN() __STL_NOTHROW { static const unsigned int _S_nan[sizeof(__number) / sizeof(int)] = { __SNaNWord }; return *reinterpret_cast(&_S_nan); } __STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, __IsIEC559); __STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true); __STL_DECLARE_LIMITS_MEMBER(bool, traps, true); __STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false); __STL_DECLARE_LIMITS_MEMBER(float_round_style, round_style, __RoundStyle); }; #ifdef __STL_STATIC_CONST_INIT_BUG # define __STL_DEFINE_FLOAT_LIMITS_MEMBER(__type, __mem) #else /* __STL_STATIC_CONST_INIT_BUG */ # define __STL_DEFINE_FLOAT_LIMITS_MEMBER(__type, __mem) \ template \ const __type _Floating_limits<__Num, __Dig, __Dig10, \ __MnX, __MxX, __MnX10, __MxX10, \ __Inf, __QNaN, __SNaN,__IsIEEE, __Sty>:: __mem #endif /* __STL_STATIC_CONST_INIT_BUG */ __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, is_specialized); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, digits); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, digits10); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, is_signed); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, radix); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, min_exponent); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, max_exponent); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, min_exponent10); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, max_exponent10); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, has_infinity); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, has_quiet_NaN); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, has_signaling_NaN); __STL_DEFINE_FLOAT_LIMITS_MEMBER(float_denorm_style, has_denorm); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, has_denorm_loss); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, is_iec559); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, is_bounded); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, traps); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, tinyness_before); __STL_DEFINE_FLOAT_LIMITS_MEMBER(float_round_style, round_style); #undef __STL_DECLARE_NUMERIC_LIMITS_MEMBER #undef __STL_DEFINE_NUMERIC_BASE_MEMBER #undef __STL_DEFINE_INTEGER_LIMITS_MEMBER #undef __STL_DEFINE_FLOAT_LIMITS_MEMBER // Class numeric_limits // The unspecialized class. template class numeric_limits : public _Numeric_limits_base {}; // Specializations for all built-in integral types. #ifndef __STL_NO_BOOL __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; #endif /* __STL_NO_BOOL */ __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; #ifdef __STL_HAS_WCHAR_T __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; #endif __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; #ifdef __STL_LONG_LONG // Some compilers have long long, but don't define the // LONGLONG_MIN and LONGLONG_MAX macros in limits.h. This // assumes that long long is 64 bits. #if !defined(ULONGLONG_MAX) #define ULONGLONG_MAX 0xffffffffffffffffLLU #endif #if !defined(LONGLONG_MAX) #define LONGLONG_MAX 0x7fffffffffffffffLL #endif #if !defined(LONGLONG_MIN) #define LONGLONG_MIN (-LONGLONG_MAX - 1) #endif __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; __STL_TEMPLATE_NULL class numeric_limits : public _Integer_limits {}; #endif /* __STL_LONG_LONG */ // Specializations for all built-in floating-point type. __STL_TEMPLATE_NULL class numeric_limits : public _Floating_limits { public: static float min() __STL_NOTHROW { return FLT_MIN; } static float denorm_min() __STL_NOTHROW { return FLT_MIN; } static float max() __STL_NOTHROW { return FLT_MAX; } static float epsilon() __STL_NOTHROW { return FLT_EPSILON; } static float round_error() __STL_NOTHROW { return 0.5f; } // Units: ulps. }; __STL_TEMPLATE_NULL class numeric_limits : public _Floating_limits { public: static double min() __STL_NOTHROW { return DBL_MIN; } static double denorm_min() __STL_NOTHROW { return DBL_MIN; } static double max() __STL_NOTHROW { return DBL_MAX; } static double epsilon() __STL_NOTHROW { return DBL_EPSILON; } static double round_error() __STL_NOTHROW { return 0.5; } // Units: ulps. }; __STL_TEMPLATE_NULL class numeric_limits : public _Floating_limits { public: static long double min() __STL_NOTHROW { return LDBL_MIN; } static long double denorm_min() __STL_NOTHROW { return LDBL_MIN; } static long double max() __STL_NOTHROW { return LDBL_MAX; } static long double epsilon() __STL_NOTHROW { return LDBL_EPSILON; } static long double round_error() __STL_NOTHROW { return 4; } // Units: ulps. }; __STL_END_NAMESPACE #endif /* __SGI_CPP_LIMITS */ // Local Variables: // mode:C++ // End: ccseapps-2.5/CCSEApps/BoxLib/SPACE.H0000644000175000017500000001256711634153073020015 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_SPACE_H #define BL_SPACE_H /* ** $Id: SPACE.H,v 1.11 2002/04/26 22:10:01 lijewski Exp $ */ #if defined(BL_SPACEDIM) && !defined(SPACEDIM) #define SPACEDIM BL_SPACEDIM #elif defined(SPACEDIM) && !defined(BL_SPACEDIM) /*@ManDoc: The BL\_SPACEDIM macro specifies the dimension of the BoxLib library to be built. Acceptable values are either 1, 2, or 3. This macro must be set for every compilation as many of the data structures of BoxLib rely on it being set. Code that depends on the dimensionality of the problem that you're trying to solve should be cast in terms of this macro. */ #define BL_SPACEDIM SPACEDIM #elif defined(BL_SPACEDIM) && defined(SPACEDIM) #elif BL_SPACEDIM != SPACEDIM #error SPACEDIM and BL_SPACEDIM must be identically defined #else #error At least one of BL_SPACEDIM or SPACEDIM must be defined #endif #if (BL_SPACEDIM != 1 && BL_SPACEDIM !=2 && BL_SPACEDIM != 3) #error BL_SPACEDIM must be either 1, 2, or 3 #endif #if !defined(BL_LANG_FORT) /*@ManDoc: The SpaceDim C++ integer constant specifies the dimension of the BoxLib library to be built. It is initialized to the value of the macro BL\_SPACEDIM. Hence it will have one of the values 1, 2, or 3. C++ code that depends on the dimensionality of the problem that you're trying to solve should be cast in terms of this constant, instead of the BL\_SPACEDIM macro, if possible, as constants are visible to debuggers while macros are not. */ namespace BoxLib { const int SpaceDim = BL_SPACEDIM; } #endif #if BL_SPACEDIM==1 /*@ManDoc: The D\_EXPR(a,b,c) macro expands to a comma expression that will evaluate SpaceDim of its arguments, counting from the left; i.e. BL\_SPACEDIM==1 implies only `a' is evaluated, BL\_SPACEDIM==2 implies both `a' and `b', and BL\_SPACEDIM==3 implies all three arguments are evaluated. This macro can be used to enhance the portability of code that works with structures whose size depends on BL\_SPACEDIM. For example: D\_EXPR(vect[0] *= s, vect[1] *= s, vect[2] *= s); More explicitly, this macro evaluates to one of ((void)((a),0)) ((void)((a),(b),0)) ((void)((a),(b),(c),0)) corresponding to BL\_SPACEDIM values of 1, 2, or 3. */ # define D_EXPR(a,b,c) ((void)((a),0)) /*@ManDoc: The D\_DECL(a,b,c) macro expands to a comma-separated list of 1, 2, or all 3 of the arguments of the call, depending on the value of BL\_SPACEDIM. This can be used to write portable function calls that depend on 1, 2, or 3 arguments, corresponding to the value of BL\_SPACEDIM. For example: return IntVect(D\_DECL(p[0] + s, p[1] + s, p[2] + s)); More explicitly, this macro evaluates to one of a a,b a,b,c corresponding to BL\_SPACEDIM values of 1, 2, or 3. */ # define D_DECL(a,b,c) a /*@ManDoc: The D\_TERM(a,b,c) macro expands to a whitespace-separated list of 1, 2, or all 3 of the arguments of the call, depending on the value of BL\_SPACEDIM. This can be used to write program logic that depend on 1, 2, or 3 arguments, corresponding to the value of BL\_SPACEDIM. For example: return D\_TERM(len[0], *len[1], *len[2]); More explicitly, this macro evaluates to one of a a b a b c corresponding to BL\_SPACEDIM values of 1, 2, or 3. */ # define D_TERM(a,b,c) a /*@ManDoc: The D\_PICK(a,b,c) macro expands to a single result equal to the 1st, 2nd, or 3rd of the arguments of the call, depending on the value of BL\_SPACEDIM. This can be used to write program logic that depend on the value of BL\_SPACEDIM. For example: maxsize = D_PICK(1024, 128, 32); More explicitly, this macro evaluates to one of maxsize = 1024; maxsize = 128; maxsize = 32; corresponding to BL\_SPACEDIM values of 1, 2, or 3. */ # define D_PICK(a,b,c) a #elif BL_SPACEDIM==2 # define D_EXPR(a,b,c) ((void)((a),(b),0)) # define D_DECL(a,b,c) a,b # define D_TERM(a,b,c) a b # define D_PICK(a,b,c) b #elif BL_SPACEDIM==3 # define D_EXPR(a,b,c) ((void)((a),(b),(c),0)) # define D_DECL(a,b,c) a,b,c # define D_TERM(a,b,c) a b c # define D_PICK(a,b,c) c #endif #endif /*BL_SPACE_H*/ ccseapps-2.5/CCSEApps/BoxLib/Arena.H0000644000175000017500000000507411634153073020203 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_ARENA_H #define BL_ARENA_H // // $Id: Arena.H,v 1.14 2001/10/23 17:01:02 lijewski Exp $ // #include class Arena; namespace BoxLib { Arena* The_Arena (); Arena* ResetArena (Arena*); } // //@Man: //@Memo: A Virtual Base Class for Dynamic Memory Management /*@Doc: This is a virtual base class for objects that manage their own dynamic memory allocation. Since it is a virtual base class, you have to derive something from it to use it. */ class Arena { public: virtual ~Arena (); /*@ManDoc: Allocate a dynamic memory arena of size sz. A pointer to this memory should be returned. */ virtual void* alloc (size_t sz) = 0; /*@ManDoc: A pure virtual function for deleting the arena pointed to by pt. */ virtual void free (void* pt) = 0; /*@ManDoc: Given a minimum required arena size of sz bytes, this returns the next largest arena size that will hold an integral number of objects of the largest of the types void*, long, double and function pointer. */ static size_t align (size_t sz); protected: // // Types used by align(). // union Word { void* p; double d; long l; void (*f) (); }; }; #endif /*BL_ARENA_H*/ ccseapps-2.5/CCSEApps/BoxLib/FabConv.H0000644000175000017500000002322311634153073020467 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_FABCONV_H #define BL_FABCONV_H // // $Id: FabConv.H,v 1.13 2001/07/26 20:08:45 lijewski Exp $ // #include #include #include #include // //@Man: //@Memo: A Descriptor of the Long Integer type /*@Doc: This class is meant to hold all information needed to completely describe the "long" type on a machine. To describe a "long" both the number of bytes in the long and their ordering, relative to canonical ordering 1 .. sizeof(long), needs to be specified. This allows us to write out "long"s in the native format on a machine, and then by also saving the IntDescriptor, we can read them back in on another machine and have enough information to construct the exact same "long" values. */ class IntDescriptor { public: /*@ManDoc: An enumeration describing the two ordering of a "long" that we currently support: NormalOrder and ReverseOrder. Other ordering may be added as BoxLib is ported to run on machines with non-standard "long" orderings. */ enum Ordering { NormalOrder = 1, ReverseOrder = 2 }; /*@ManDoc: The default constructor. Does not build a proper IntDescriptor. This should only be used when you need to build a generic IntDescriptor in order to be able to read in a specific one from an istream. */ IntDescriptor (); // //@ManDoc: Construct a specific IntDescriptor. // IntDescriptor (long nb, Ordering ordering = NormalOrder); // //@ManDoc: Returns the ordering of the "long". // Ordering order () const; // //@ManDoc: Returns the number of bytes in a "long". // int numBytes () const; // //@ManDoc: The equality operator. // bool operator== (const IntDescriptor& id) const; // //@ManDoc: The inequality operator. // bool operator!= (const IntDescriptor& id) const; protected: long numbytes; Ordering ord; }; // //@ManDoc: Write out an IntDescriptor to an ostream in ASCII. // std::ostream& operator<< (std::ostream& os, const IntDescriptor& id); // //@ManDoc: Read in an IntDescriptor from an istream. // std::istream& operator>> (std::istream& is, IntDescriptor& id); // //@Man: //@Memo: A Descriptor of the Real Type /*@Doc: This class is meant to hold all information needed to completely describe the "Real" floating-point type on a machine. By "Real" here we mean either the "float" or "double" type that this version of BoxLib was built with, which corresponds to whether BL\_USE\_FLOAT or BL\_USE\_DOUBLE was used to build the version of the library. To describe a "Real" type two arrays are needed: one detailing the ordering of the bytes in the Real, relative to the canonical ordering 1 .. sizeof(Real) and the other detailing the format of the floating-point number. The array detailing the format of a floating-point number is an eight-element array of longs containing the following information: format[0] = number of bits per number format[1] = number of bits in exponent format[2] = number of bits in mantissa format[3] = start bit of sign format[4] = start bit of exponent format[5] = start bit of mantissa format[6] = high order mantissa bit (CRAY needs this) format[7] = bias of exponent This allows us to write out "Real"s in the native format on a machine, and then by also saving the IntDescriptor, we can read them back in on another machine and have enough information to construct the exact same "Real" values, provided the Reals have the same size on the two machines. */ class RealDescriptor { public: /*@ManDoc: The default constructor. Does not build a proper RealDescriptor. This should only be used when you need to build a generic RealDescriptor in order to be able to read in a specific one from an istream. */ RealDescriptor (); /*@ManDoc: Construct a specific RealDescriptor, passing in the format of the Real, the order of the Real, and the length of the array detailing the ordering. */ RealDescriptor (const long* format, const int* order, int order_length); // //@ManDoc: The copy constructor. // RealDescriptor (const RealDescriptor& rhs); // //@ManDoc: The assignment operator. // RealDescriptor& operator= (const RealDescriptor& rhs); // //@ManDoc: Destructor is virtual incase a derived class has a non-trivial // destructor. virtual ~RealDescriptor (); // //@ManDoc: Returns the format array as a `const long*' // const long* format () const; // //@ManDoc: Returns const Array reference to the format array. // const Array& formatarray () const; // //@ManDoc: Returns the order array as a `const int*' // const int* order () const; // //@ManDoc: Returns const Array reference to the order array. // const Array& orderarray () const; // //@ManDoc: Returns the number of bytes in the Real. // int numBytes () const; // //@ManDoc: The equality operator. // bool operator== (const RealDescriptor& rd) const; // //@ManDoc: The inequality operator. // bool operator != (const RealDescriptor& rd) const; // //@ManDoc: Set to always fix denormals when converting to native format. // static void SetFixDenormals(); /*@ManDoc: Returns a copy of this RealDescriptor on the heap. The user is responsible for deletion. */ virtual RealDescriptor* clone () const; /*@ManDoc: Returns a RealDescriptor on the heap detailing requested floating-point type. Here format, precision, and ordering correspond to the enumerations in FABio. This is here to support reading "old" FABs. Do NOT use it in new code. */ static RealDescriptor* newRealDescriptor (int format, int precision, const char* systype, int ordering); /*@ManDoc: Convert nitems in RealDescriptor format to native Real format. The out array is assumed to be large enough to hold the resulting output. */ static void convertToNativeFormat (Real* out, long nitems, void* in, const RealDescriptor& id); /*@ManDoc: Read nitems from istream in ReadDescriptor format and convert them to the native Real format. The out array is assumed to be large enough to hold the resulting output. */ static void convertToNativeFormat (Real* out, long nitems, std::istream& is, const RealDescriptor& id); /*@ManDoc: Convert nitems Reals in native format to RealDescriptor format and write them to the ostream. */ static void convertFromNativeFormat (std::ostream& os, long nitems, const Real* in, const RealDescriptor& od); /*@ManDoc: Convert nitems Reals in native format to RealDescriptor format. The out array is assumed to be large enough to hold the resulting output. */ static void convertFromNativeFormat (void* out, long nitems, Real* in, const RealDescriptor& od); protected: Array fr; Array ord; static bool bAlwaysFixDenormals; }; // //@ManDoc: Write out an RealDescriptor to an ostream in ASCII. // std::ostream& operator<< (std::ostream& os, const RealDescriptor& id); // //@ManDoc: Read in a RealDescriptor from an istream. // std::istream& operator>> (std::istream& is, RealDescriptor& id); #endif /*BL_FABCONV_H*/ ccseapps-2.5/CCSEApps/BoxLib/BArena.H0000644000175000017500000000364511634153073020307 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_BARENA_H #define BL_BARENA_H // // $Id: BArena.H,v 1.10 2001/07/31 17:56:24 lijewski Exp $ // #include // //@Man: //@Memo: A Concrete Class for Dynamic Memory Management /*@Doc: This is the simplest dynamic memory management class derived from Arena. Makes calls to ::operator new() and ::operator delete(). */ class BArena : public Arena { public: /*@ManDoc: Allocates a dynamic memory arena of size sz. Returns a pointer to this memory. */ virtual void* alloc (size_t sz); // //@ManDoc: Deletes the arena pointed to by pt. // virtual void free (void* pt); }; #endif /*BL_BARENA_H*/ ccseapps-2.5/CCSEApps/BoxLib/Box.cpp0000644000175000017500000004504711634153073020304 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Box.cpp,v 1.23 2002/02/25 20:59:43 car Exp $ // #include #include #include #include #include const Box& Box::TheUnitBox () { static const Box Unit(IntVect::TheZeroVector(), IntVect::TheZeroVector()); return Unit; } Box::Box () : smallend(IntVect::TheUnitVector()), bigend(IntVect::TheZeroVector()), btype() {} Box::Box (const IntVect& small, const int* vec_len) : smallend(small), bigend(D_DECL(small[0]+vec_len[0]-1, small[1]+vec_len[1]-1, small[2]+vec_len[2]-1)) {} Box::Box (const IntVect& small, const IntVect& big, const IndexType& t) : smallend(small), bigend(big), btype(t) {} Box::Box (const IntVect& small, const IntVect& big) : smallend(small), bigend(big) {} Box::Box (const IntVect& small, const IntVect& big, const IntVect& typ) : smallend(small), bigend(big), btype(typ) { BL_ASSERT(typ >= IntVect::TheZeroVector() && typ <= IntVect::TheUnitVector()); } bool Box::volumeOK () const { long ignore; return volumeOK(ignore); } long Box::index (const IntVect& v) const { long result = v[0]-smallend[0]; #if BL_SPACEDIM==2 result += length(0)*(v[1]-smallend[1]); #elif BL_SPACEDIM==3 result += length(0)*(v[1]-smallend[1] +(v[2]-smallend[2])*length(1)); #endif return result; } Box& Box::setSmall (const IntVect& sm) { smallend = sm; return *this; } Box& Box::setSmall (int dir, int sm_index) { smallend.setVal(dir,sm_index); return *this; } Box& Box::setBig (const IntVect& bg) { bigend = bg; return *this; } Box& Box::setBig (int dir, int bg_index) { bigend.setVal(dir,bg_index); return *this; } Box& Box::setRange (int dir, int sm_index, int n_cells) { smallend.setVal(dir,sm_index); bigend.setVal(dir,sm_index+n_cells-1); return *this; } Box& Box::shift (int dir, int nzones) { smallend.shift(dir,nzones); bigend.shift(dir,nzones); return *this; } Box& Box::shift (const IntVect& iv) { smallend.shift(iv); bigend.shift(iv); return *this; } Box& Box::convert (const IntVect& typ) { BL_ASSERT(typ >= IntVect::TheZeroVector() && typ <= IntVect::TheUnitVector()); IntVect shft(typ - btype.ixType()); bigend += shft; btype = IndexType(typ); return *this; } Box& Box::convert (IndexType t) { for (int dir = 0; dir < BL_SPACEDIM; dir++) { unsigned int typ = t[dir]; unsigned int bitval = btype[dir]; int off = typ - bitval; bigend.shift(dir,off); btype.setType(dir, (IndexType::CellIndex) typ); } return *this; } Box BoxLib::surroundingNodes (const Box& b, int dir) { Box bx(b); return bx.surroundingNodes(dir); } Box& Box::surroundingNodes (int dir) { if (!(btype[dir])) { bigend.shift(dir,1); // // Set dir'th bit to 1 = IndexType::NODE. // btype.set(dir); } return *this; } Box BoxLib::surroundingNodes (const Box& b) { Box bx(b); return bx.surroundingNodes(); } Box& Box::surroundingNodes () { for (int i = 0; i < BL_SPACEDIM; ++i) if ((btype[i] == 0)) bigend.shift(i,1); btype.setall(); return *this; } Box BoxLib::enclosedCells (const Box& b, int dir) { Box bx(b); return bx.enclosedCells(dir); } Box& Box::enclosedCells (int dir) { if (btype[dir]) { bigend.shift(dir,-1); // // Set dir'th bit to 0 = IndexType::CELL. // btype.unset(dir); } return *this; } Box BoxLib::enclosedCells (const Box& b) { Box bx(b); return bx.enclosedCells(); } Box& Box::enclosedCells () { for (int i = 0 ; i < BL_SPACEDIM; ++i) if (btype[i]) bigend.shift(i,-1); btype.clear(); return *this; } Box& Box::operator+= (const IntVect& v) { smallend += v; bigend += v; return *this; } Box Box::operator+ (const IntVect& v) const { Box result = *this; return result += v; } Box& Box::operator-= (const IntVect& v) { smallend -= v; bigend -= v; return *this; } Box Box::operator- (const IntVect& v) const { Box result = *this; return result -= v; } Box& Box::grow (int i) { smallend.diagShift(-i); bigend.diagShift(i); return *this; } Box BoxLib::grow (const Box& b, int i) { Box result = b; return result.grow(i); } Box& Box::grow (const IntVect& v) { smallend -= v; bigend += v; return *this; } Box BoxLib::grow (const Box& b, const IntVect& v) { Box result = b; return result.grow(v); } Box& Box::grow (int idir, int n_cell) { smallend.shift(idir, -n_cell); bigend.shift(idir, n_cell); return *this; } Box& Box::grow (const Orientation& face, int n_cell) { int idir = face.coordDir(); if (face.isLow()) smallend.shift(idir, -n_cell); else bigend.shift(idir,n_cell); return *this; } Box& Box::growLo (int idir, int n_cell) { smallend.shift(idir, -n_cell); return *this; } Box& Box::growHi (int idir, int n_cell) { bigend.shift(idir,n_cell); return *this; } Box Box::operator& (const Box& rhs) const { Box lhs = *this; return lhs &= rhs; } bool Box::numPtsOK (long& N) const { BL_ASSERT(ok()); N = length(0); for (int i = 1; i < BL_SPACEDIM; i++) { if (length(i) == 0) { N = 0; return true; } else if (N <= std::numeric_limits::max()/length(i)) { N *= length(i); } else { // // The return value `N' will be undefined. // return false; } } return true; } long Box::numPts () const { long result; if (!numPtsOK(result)) BoxLib::Error("Arithmetic overflow in Box::numPts()"); return result; } bool Box::volumeOK (long& N) const { BL_ASSERT(ok()); N = length(0)-btype[0]; for (int i = 1; i < BL_SPACEDIM; i++) { long diff = (length(i)-btype[i]); if (diff == 0) { N = 0; return true; } else if (N <= std::numeric_limits::max()/diff) { N *= diff; } else { // // The return value of N will be undefined. // return false; } } return true; } long Box::volume () const { long result; if (!volumeOK(result)) BoxLib::Error("Arithmetic overflow in Box::volume()"); return result; } Box& Box::shiftHalf (int dir, int nzones) { int nbit = (nzones<0 ? -nzones : nzones)%2; int nshift = nzones/2; // // Toggle btyp bit if nzones is odd. // unsigned int bit_dir = btype[dir]; if (nbit) btype.flip(dir); if (nzones < 0) nshift -= (bit_dir ? nbit : 0); else nshift += (bit_dir ? 0 : nbit); smallend.shift(dir,nshift); bigend.shift(dir,nshift); return *this; } Box& Box::shiftHalf (const IntVect& nz) { for (int dir = 0; dir < BL_SPACEDIM; dir++) { shiftHalf(dir,nz[dir]); } return *this; } bool Box::intersects (const Box& b) const { Box isect = *this & b; return isect.ok(); } Box& Box::operator&= (const Box& b) { BL_ASSERT(sameType(b)); smallend.max(b.smallend); bigend.min(b.bigend); return *this; } void Box::next (IntVect& p) const { BL_ASSERT(contains(p)); p.shift(0,1); #if BL_SPACEDIM==2 if (!(p <= bigend)) { p.setVal(0,smallend[0]); p.shift(1,1); } #elif BL_SPACEDIM==3 if (!(p <= bigend)) { p.setVal(0,smallend[0]); p.shift(1,1); if (!(p <= bigend)) { p.setVal(1,smallend[1]); p.shift(2,1); } } #endif } // // Scan point over region of object Box with a vector incrment // point incrments by 0 direction portion of vector. When end of // Box is reached, an increment is made with the 1 direction portion // of the vector, and the 0 direction scan is resumed. // effectively, we are scanning a Box, whose length vector is the argument // vector over the object Box. // when scan is over, the argument point is over edge of object Box // this is the signal that we can go no further. // void Box::next (IntVect& p, const int* shv) const { BL_ASSERT(contains(p)); #if BL_SPACEDIM==1 p.shift(0,shv[0]); #elif BL_SPACEDIM==2 p.shift(0,shv[0]); if (!(p <= bigend)) { // // Reset 1 coord is on edge, and 2 coord is incremented. // p.setVal(0,smallend[0]); p.shift(1,shv[1]); } #elif BL_SPACEDIM==3 p.shift(0,shv[0]); if (!(p <= bigend)) { // // Reset 1 coord is on edge, and 2 coord is incremented. // p.setVal(0,smallend[0]); p.shift(1,shv[1]); if(!(p <= bigend)) { p.setVal(1,smallend[1]); p.shift(2,shv[2]); } } #endif } Box BoxLib::refine (const Box& b, int refinement_ratio) { Box result = b; return result.refine(refinement_ratio); } Box& Box::refine (int refinement_ratio) { IntVect shft(IntVect::TheUnitVector()); shft -= btype.ixType(); smallend.scale(refinement_ratio); bigend += shft; // Bigend does more than just multiply. bigend.scale(refinement_ratio); bigend -= shft; return *this; } Box BoxLib::refine (const Box& b, const IntVect& refinement_ratio) { Box result = b; return result.refine(refinement_ratio); } Box& Box::refine (const IntVect& refinement_ratio) { IntVect shft(IntVect::TheUnitVector()); shft -= btype.ixType(); smallend *= refinement_ratio; bigend += shft; bigend *= refinement_ratio; bigend -= shft; return *this; } // // Define a macro which will compute an object's length vector from // the smallend and bigend. Do several versions according to dimension // requires you to be in a member functions. int Box::longside () const { int ignore = 0; return longside(ignore); } int Box::longside (int& dir) const { int maxlen = length(0); dir = 0; for (int i = 1; i < BL_SPACEDIM; i++) { if (length(i) > maxlen) { maxlen = length(i); dir = i; } } return maxlen; } int Box::shortside () const { int ignore = 0; return shortside(ignore); } int Box::shortside (int& dir) const { int minlen = length(0); dir = 0; for (int i = 1; i < BL_SPACEDIM; i++) { if (length(i) < minlen) { minlen = length(i); dir = i; } } return minlen; } // // Modified Box is low end, returned Box is high end. // If CELL: chop_pnt included in high end. // If NODE: chop_pnt included in both Boxes. // Box Box::chop (int dir, int chop_pnt) { // // Define new high end Box including chop_pnt. // IntVect sm(smallend); IntVect bg(bigend); sm.setVal(dir,chop_pnt); if (btype[dir]) { // // NODE centered Box. // BL_ASSERT(chop_pnt > smallend[dir] && chop_pnt < bigend[dir]); // // Shrink original Box to just contain chop_pnt. // bigend.setVal(dir,chop_pnt); } else { // // CELL centered Box. // BL_ASSERT(chop_pnt > smallend[dir] && chop_pnt <= bigend[dir]); // // Shrink origional Box to one below chop_pnt. // bigend.setVal(dir,chop_pnt-1); } return Box(sm,bg,btype); } Box BoxLib::coarsen (const Box& b, int refinement_ratio) { Box result = b; return result.coarsen(refinement_ratio); } Box& Box::coarsen (int refinement_ratio) { smallend.coarsen(refinement_ratio); if (btype.any()) { IntVect off(IntVect::TheZeroVector()); for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (btype[dir]) if (bigend[dir]%refinement_ratio) off.setVal(dir,1); } bigend.coarsen(refinement_ratio); bigend += off; } else { bigend.coarsen(refinement_ratio); } return *this; } Box BoxLib::coarsen (const Box& b, const IntVect& refinement_ratio) { Box result = b; return result.coarsen(refinement_ratio); } Box& Box::coarsen (const IntVect& refinement_ratio) { smallend.coarsen(refinement_ratio); if (btype.any()) { IntVect off(IntVect::TheZeroVector()); for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (btype[dir]) { int b = bigend[dir]; int r = refinement_ratio[dir]; if (b%r) off.setVal(dir,1); } } bigend.coarsen(refinement_ratio); bigend += off; } else { bigend.coarsen(refinement_ratio); } return *this; } // // I/O functions. // std::ostream& operator<< (std::ostream& os, const Box& b) { os << '(' << b.smallEnd() << ' ' << b.bigEnd() << ' ' << b.type() << ')'; if (os.fail()) BoxLib::Error("operator<<(ostream&,Box&) failed"); return os; } // // Moved out of Utility.H // #define BL_IGNORE_MAX 100000 std::istream& operator>> (std::istream& is, Box& b) { IntVect lo, hi, typ; is >> std::ws; char c; is >> c; if (c == '(') { is >> lo >> hi; is >> c; // Read an optional IndexType is.putback(c); if ( c == '(' ) { is >> typ; } is.ignore(BL_IGNORE_MAX,')'); } else { BoxLib::Error("operator>>(istream&,Box&): expected \'(\'"); } b = Box(lo,hi,typ); if (is.fail()) BoxLib::Error("operator>>(istream&,Box&) failed"); return is; } Box BoxLib::minBox (const Box& b, const Box& o) { Box result = b; return result.minBox(o); } Box& Box::minBox (const Box &b) { BL_ASSERT(b.ok() && ok()); BL_ASSERT(sameType(b)); smallend.min(b.smallend); bigend.max(b.bigend); return *this; } Box BoxLib::bdryLo (const Box& b, int dir, int len) { IntVect low(b.smallEnd()); IntVect hi(b.bigEnd()); int sm = low[dir]; hi.setVal(dir,sm+len-1); // // set dir'th bit to 1 = IndexType::NODE. // IndexType typ(b.ixType()); typ.set(dir); return Box(low,hi,typ); } Box BoxLib::bdryHi (const Box& b, int dir, int len) { IntVect low(b.smallEnd()); IntVect hi(b.bigEnd()); unsigned int bitval = b.type()[dir]; int bg = hi[dir] + 1 - bitval%2; low.setVal(dir,bg); hi.setVal(dir,bg+len-1); // // Set dir'th bit to 1 = IndexType::NODE. // IndexType typ(b.ixType()); typ.set(dir); return Box(low,hi,typ); } Box BoxLib::bdryNode (const Box& b, const Orientation& face, int len) { int dir = face.coordDir(); IntVect low(b.smallEnd()); IntVect hi(b.bigEnd()); if (face.isLow()) { int sm = low[dir]; hi.setVal(dir,sm+len-1); } else { unsigned int bitval = b.type()[dir]; int bg = hi[dir] + 1 - bitval%2; low.setVal(dir,bg); hi.setVal(dir,bg+len-1); } // // Set dir'th bit to 1 = IndexType::NODE. // IndexType typ(b.ixType()); typ.set(dir); return Box(low,hi,typ); } Box BoxLib::adjCellLo (const Box& b, int dir, int len) { BL_ASSERT(len > 0); IntVect low(b.smallEnd()); IntVect hi(b.bigEnd()); int sm = low[dir]; low.setVal(dir,sm - len); hi.setVal(dir,sm - 1); // // Set dir'th bit to 0 = IndexType::CELL. // IndexType typ(b.ixType()); typ.unset(dir); return Box(low,hi,typ); } Box BoxLib::adjCellHi (const Box& b, int dir, int len) { BL_ASSERT(len > 0); IntVect low(b.smallEnd()); IntVect hi(b.bigEnd()); unsigned int bitval = b.type()[dir]; int bg = hi[dir] + 1 - bitval%2; low.setVal(dir,bg); hi.setVal(dir,bg + len - 1); // // Set dir'th bit to 0 = IndexType::CELL. // IndexType typ(b.ixType()); typ.unset(dir); return Box(low,hi,typ); } Box BoxLib::adjCell (const Box& b, const Orientation& face, int len) { BL_ASSERT(len > 0); IntVect low(b.smallEnd()); IntVect hi(b.bigEnd()); int dir = face.coordDir(); if (face.isLow()) { int sm = low[dir]; low.setVal(dir,sm - len); hi.setVal(dir,sm - 1); } else { unsigned int bitval = b.type()[dir]; int bg = hi[dir] + 1 - bitval%2; low.setVal(dir,bg); hi.setVal(dir,bg + len - 1); } // // Set dir'th bit to 0 = IndexType::CELL. // IndexType typ(b.ixType()); typ.unset(dir); return Box(low,hi,typ); } ccseapps-2.5/CCSEApps/BoxLib/Arena.cpp0000644000175000017500000000277011634153073020576 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Arena.cpp,v 1.2 2001/07/19 16:57:30 lijewski Exp $ // #include #include Arena::~Arena () {} size_t Arena::align (size_t s) { size_t x = s + sizeof(Word) - 1; x -= x%sizeof(Word); return x; } ccseapps-2.5/CCSEApps/BoxLib/SPECIALIZE_F.H0000644000175000017500000000513011634153073021043 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef SPECIALIZE_H #define SPECIALIZE_H #include #include #if defined(BL_LANG_FORT) #define FORT_FASTCOPY fastcopy #define FORT_FASTSETVAL fastsetval #else #if defined(BL_FORT_USE_UPPERCASE) #define FORT_FASTCOPY FASTCOPY #define FORT_FASTSETVAL FASTSETVAL #elif defined(BL_FORT_USE_LOWERCASE) #define FORT_FASTCOPY fastcopy #define FORT_FASTSETVAL fastsetval #elif defined(BL_FORT_USE_UNDERSCORE) #define FORT_FASTCOPY fastcopy_ #define FORT_FASTSETVAL fastsetval_ #endif extern "C" { void FORT_FASTCOPY (Real* dest, ARLIM_P(dlo), ARLIM_P(dhi), D_DECL(const int&,const int&,const int&), D_DECL(const int&,const int&,const int&), const Real* src, ARLIM_P(slo), ARLIM_P(shi), D_DECL(const int&,const int&,const int&), D_DECL(const int&,const int&,const int&), const int& ncomp); void FORT_FASTSETVAL (const Real* val, const int* lo, const int* hi, Real* dest, ARLIM_P(dlo), ARLIM_P(dhi), const int& ncomp); } #endif /*BL_LANG_CC*/ #endif /*SPECIALIZE_H*/ ccseapps-2.5/CCSEApps/BoxLib/Utility.H0000644000175000017500000003362411634153073020622 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_UTILITY_H #define BL_UTILITY_H // // $Id: Utility.H,v 1.53 2002/10/24 21:56:00 lijewski Exp $ // #include #include #include #ifndef WIN32 #include #include #endif #include #include // //@Man: //@Memo: Useful C++ Utility Functions /*@Doc: This data-less class is a poor-person's namespace of utility functions. Since we can't assume the existence of namespaces, and we don't like global functions, we put them into a data-less class as static member functions. */ namespace BoxLib { /*@ManDoc: Returns the total user and system time used by the calling process up to the point of the call. If t != 0, it also stores the result in t. */ double second (double* t = 0); /*@ManDoc: Returns the current time as the number of microseconds relative to program startup. If t != 0, it also stores the result in t. */ double wsecond (double* t = 0); // //@ManDoc: Reset start of Wall Clock Time for wsecond() to NOW. // void ResetWallClockTime (); // //@ManDoc: Return true if argument is a non-zero length string of digits. // bool is_integer (const char* str); // //@ManDoc: Returns rootNNNN where NNNN == num. // std::string Concatenate (const std::string& root, int num); /*@ManDoc: Creates the specified directories. `path' may be either a full pathname or a relative pathname. It will create all the directories in the pathname, if they don't already exist, so that on successful return the pathname refers to an existing directory. Returns true or false depending upon whether or not all it was successful. Also returns if `path' is NULL or "/". `mode' is the mode passed to mkdir() for any directories that must be created. For example, if it is passed the string "/a/b/c/d/e/f/g", it will return successfully when all the directories in the pathname exist; i.e. when the full pathname is a valid directory. In a Windows environment, the path separator is a '\', so that if using the example given above you must pass the string "\\a\\b\\c\\d\\e\\f\\g" (Note that you must escape the backslash in a character string), */ bool UtilCreateDirectory (const std::string& path, mode_t mode); // //@ManDoc: Output a message and abort when couldn't create the directory. // void CreateDirectoryFailed (const std::string& dir); // //@ManDoc: Output a message and abort when couldn't open the file. // void FileOpenFailed (const std::string& dir); // //@ManDoc: Attempt to unlink the file. Ignore any errors. // void UnlinkFile (const std::string& file); /*@ManDoc: Aborts after printing message indicating out-of-memory; i.e. operator new has failed. This is the "supported" set\_new\_handler() function for BoxLib applications. */ void OutOfMemory (); /*@ManDoc: This function returns an approximation of the inverse cumulative standard normal distribution function. I.e., given P, it returns an approximation to the X satisfying P = Pr{Z <= X} where Z is a random variable from the standard normal distribution. The algorithm uses a minimax approximation by rational functions and the result has a relative error whose absolute value is less than 1.15e-9. If "best" is true the approximation is further refined down to more or less machine precision using one iteration of Halley's Rational Method. Author: Peter J. Acklam Time-stamp: 2002-06-09 18:45:44 +0200 E-mail: jacklam@math.uio.no WWW URL: http://www.math.uio.no/~jacklam C implementation adapted from Peter's Perl version. "p" MUST be in the open interval (0,1). There are two entry points for Fortran: REAL\_T val call blinvnormdist(val) and REAL\_T val call blinvnormdistbest(val) Internally, these Fortran entry points call a static Mersenne Twister object (the same one called by blutilrand()) to get a random number in the open interval (0,1), and then sets "val" to the result of calling BoxLib::InvNormDist() with that random number. */ double InvNormDist (double p, bool best = false); /*@ManDoc: Mersenne Twister pseudo-random number generator. Generates one pseudorandom real number (double) which is uniformly distributed on [0,1]-interval for each call. Accepts any 32-bit integer as a seed -- uses 4357 as the default. Has a period of 2**19937. Mersenne Twister Home Page: http://www.math.keio.ac.jp/matumoto/emt.html There is also an entry point for Fortran callable as: REAL\_T rn call blutilrand(rn) Internally, blutilrand() calls a static Mersenne Twister oject (the same one used by BoxLib::Random()) to get a value in [0,1] and then sets "rn" to that value. */ double Random (); /*@ManDoc: Set the seed of the random number generator. There is also an entry point for Fortran callable as: INTEGER seed call blutilinitrand(seed) */ void InitRandom (unsigned long seed); /*@ManDoc: Try to execute a shell command in a subshell. User is responsible for calling waitpid() on the pid returned from this function. */ pid_t Execute (const char* cmd); // // Helper class for Times, used in Threads, Profiling, and Timers. // class Time { public: Time(); Time(long s, long n = 0); Time(double d); double as_double() const; long as_long() const; Time& operator+=(const Time&); Time operator+(const Time&) const; static Time get_time(); private: long tv_sec; long tv_nsec; void normalize(); }; // // Implements a simple in place Timer: // template class base_Timer; template std::ostream& operator<<(std::ostream&, const base_Timer&); typedef base_Timer WallTimer; typedef base_Timer CPUTimer; template class base_Timer { public: class bad_timer; base_Timer(); ~base_Timer(); void start(); void stop(); void reset(); double time() const; double accum_time() const; int count() const; bool is_running() const; static double tick(); private: bool running; double val; double held; double accum_val; int cnt; }; // // The Mersenne twistor : // class mt19937 { public: typedef unsigned long seed_type; explicit mt19937 (seed_type seed = 4357UL); mt19937 (seed_type array[], int array_len); void rewind(); double d1_value (); // [0,1] random numbers double d_value (); // [0,1) random numbers long l_value (); // [0,2^31-1] random numbers unsigned long u_value (); // [0,2^32-1] random numbers private: void sgenrand (unsigned long seed); void sgenrand (seed_type seed_array[], int len); unsigned long igenrand (); void reload (); private: enum { N = 624 }; unsigned long init_seed; unsigned long mt[N]; // the array for the state vector int mti; // mti==N+1 means mt[N] is not initialized }; class expect; std::istream& operator>>(std::istream&, const expect& exp); class expect { friend std::istream& operator>>(std::istream&, const expect& exp); public: explicit expect(const std::string& str_); explicit expect(const char* istr_); explicit expect(char c); const std::string& the_string() const; private: std::string istr; }; } // // I'm going to document right here all the BL macros that aren't documented // anywhere else. Note that all these #ifdef ... #endif blocks are necessary // to get doc++ to properly document the macros. // #ifdef BL_ARCH_CRAY #undef BL_ARCH_CRAY /*@ManDoc: The macro BL\_ARCH\_CRAY is defined only when compiling on a Cray architecture. The make subsystem automatically sets this if it detects that a compilation is taking place on a Cray system. */ #define BL_ARCH_CRAY 1 #endif /*BL_ARCH_CRAY*/ #ifdef BL_LANG_FORT #undef BL_LANG_FORT /*@ManDoc: The macro BL\_LANG\_FORT indicates that Fortran code is being compiled. */ #define BL_LANG_FORT 1 #endif /*BL_LANG_FORT*/ #ifdef BL_LANG_CC #undef BL_LANG_CC /*@ManDoc: The macro BL\_LANG\_CC indicates that C++ code is being compiled. */ #define BL_LANG_CC 1 #endif /*BL_LANG_CC*/ #ifdef BL_FORT_USE_UNDERSCORE #undef BL_FORT_USE_UNDERSCORE /*@ManDoc: The macro BL\_FORT\_USE\_UNDERSCORE indicates that C++ code should call Fortran routines by appending an underscore to the name of the Fortran routine. This is set automatically by the make subsystem. It is the default for all BoxLib-style programs except on Cray architectures. For example, if the Fortran routine is named abcxyx, then it will be called in C++ code as abcxyz\_. */ #define BL_FORT_USE_UNDERSCORE 1 #endif /*BL_FORT_USE_UNDERSCORE*/ #ifdef BL_FORT_USE_UPPERCASE #undef BL_FORT_USE_UPPERCASE /*@ManDoc: The macro BL\_FORT\_USE\_UPPERCASE indicates that C++ code should call Fortran routines using uppercase letters for all the letters in the routine. This is set automatically by the make subsystem. Currently it is only set when compiling on Cray architectures. For example, if the Fortran routine is named abcxyx, then it will be called in C++ code as ABCXYZ. */ #define BL_FORT_USE_UPPERCASE 1 #endif /*BL_FORT_USE_UPPERCASE*/ #ifdef BL_FORT_USE_LOWERCASE #undef BL_FORT_USE_LOWERCASE /*@ManDoc: The macro BL\_FORT\_USE\_LOWERCASE indicates that C++ code should call Fortran routines using lowercase letters for all the letters in the routine. This is set automatically by the make subsystem. For example, if the Fortran routine is named abcxyx, then it will be called in C++ code as abcxyx. */ #define BL_FORT_USE_LOWERCASE 1 #endif /*BL_FORT_USE_LOWERCASE*/ /*@ManDoc: BL\_IGNORE\_MAX is a macro that expands to the literal value 100000. It is defined when compiling either Fortran or C++ code; i.e. when either BL\_LANG\_CC or BL\_LANG\_FORT is defined. It is used in calls to istream::ignore() in the BoxLib code when reading in characters from an istream. We use this macro instead of the more proper INT\_MAX from since at least one compiler didn't work properly when istream::ignore() was passed INT\_MAX. */ #define BL_IGNORE_MAX 100000 // Implementation of the Timer template BoxLib::base_Timer::base_Timer() : running(false), val(0.0), accum_val(0.0), cnt(0) { } template BoxLib::base_Timer::~base_Timer() { BL_ASSERT( !running ); } template bool BoxLib::base_Timer::is_running() const { return running; } template inline void BoxLib::base_Timer::start() { BL_ASSERT( !running ); held = FCN(0); running = true; } template inline void BoxLib::base_Timer::stop() { BL_ASSERT( running ); val = (FCN(0) - held); #ifndef NDEBUG if ( val < 0 ) { std::cout << "Got a negative time " << val << "!" << std::endl; } #endif accum_val += val; cnt += 1; running = false; } template void BoxLib::base_Timer::reset() { BL_ASSERT( !running ); accum_val = 0; cnt = 0; } template double BoxLib::base_Timer::accum_time() const { BL_ASSERT( !running ); return accum_val; } template double BoxLib::base_Timer::time() const { BL_ASSERT( !running ); return val; } template int BoxLib::base_Timer::count() const { BL_ASSERT( !running ); return cnt; } // I stole this code from someplace, but I don't know where. template double BoxLib::base_Timer::tick() { const int M = 100; double timesfound[M]; // Collect a sequence of M unique time values from the system. for ( int i = 0; i < M; ++i ) { double t2; double t1 = FCN(0); while( ((t2 = FCN(0)) - t1) == 0 ) { } timesfound[i] = t2; } double minDelta = timesfound[1] - timesfound[0]; for ( int i = 2; i < M; i++ ) { minDelta = std::min(minDelta, std::max(timesfound[i]-timesfound[i-1], 0.0)); } return minDelta; } template std::ostream& operator<<(std::ostream& os, const BoxLib::base_Timer& bt) { return os << "[" << bt.accum_time() << "/" << bt.count() << "]"; } #endif /*BL_UTILITY_H*/ ccseapps-2.5/CCSEApps/BoxLib/BoxList.H0000644000175000017500000002366411634153073020546 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_BOXLIST_H #define BL_BOXLIST_H // // $Id: BoxList.H,v 1.30 2001/08/06 19:40:27 car Exp $ // #include #include #include #include #include // // Forward declarations. // class BoxArray; class BoxList; namespace BoxLib { /*@ManDoc: Returns a BoxList defining the complement of BoxList bl in Box b. */ BoxList complementIn (const Box& b, const BoxList& bl); // //@ManDoc: Returns BoxList defining the compliment of b2 in b1in. // BoxList boxDiff (const Box& b1in, const Box& b2); /*@ManDoc: Returns a new BoxList in which each Box is refined by the given ratio. */ BoxList refine (const BoxList& bl, int ratio); /*@ManDoc: Returns a new BoxList in which each Box is coarsened by the given ratio. */ BoxList coarsen (const BoxList& bl, int ratio); // //@ManDoc: Returns a BoxList defining the intersection of bl with b. // BoxList intersect (const BoxList& bl, const Box& b); // //@ManDoc: Returns a BoxList defining the intersection of bl with br. // BoxList intersect (const BoxList& bl, const BoxList& br); /*@ManDoc: Returns a new BoxList in which each Box is grown by the given size. */ BoxList accrete (const BoxList& bl, int sz); } // //@ManDoc: Output a BoxList to an ostream in ASCII format. // std::ostream& operator<< (std::ostream& os, const BoxList& blist); // //@Man: //@Memo: A List of Boxes /*@Doc: A BoxList is a class for managing a List of Boxes that share a common IndexType. This class implements operations for sets of Boxes. This is a concrete class, not a polymorphic one. */ class BoxList { public: friend class BoxDomain; typedef std::list::iterator iterator; typedef std::list::const_iterator const_iterator; // //@ManDoc: Construct an empty BoxList with IndexType::TheCellType(). // BoxList (); // /// Make a boxList consisting of a single Box // BoxList (const Box& bx); // //@ManDoc: Construct an empty BoxList with IndexType btyp // explicit BoxList (IndexType btyp); // //@ManDoc: Construct a BoxList from a BoxArray. // explicit BoxList (const BoxArray& ba); // //@ManDoc: Append a Box to this BoxList. // void push_back (const Box& bn); // //@ManDoc: Prepend a Box to this BoxList. // void push_front (const Box& bn); // //@ManDoc: Join the BoxList to ourselves. // void join (const BoxList& blist); // //@ManDoc: Catenate the BoxList to ourselves. Removes entries from blist. // void catenate (BoxList& blist); // //@ManDoc: Remove all Boxes from this BoxList. // void clear (); // //@ManDoc: The number of Boxes in this BoxList. // int size () const; iterator begin (); const_iterator begin () const; iterator end (); const_iterator end () const; /*@ManDoc: True if this BoxList is valid; i.e. all the Boxes are valid and they all have the same IndexType. Also returns true if the BoxList is empty. */ bool ok () const; // //@ManDoc: Is this BoxList equal to rhs? // bool operator== (const BoxList& rhs) const; // //@ManDoc: Is this BoxList notequal to rhs? // bool operator!= (const BoxList& rhs) const; // //@ManDoc: Is this BoxList empty? // bool isEmpty () const; // //@ManDoc: Is this BoxList not empty? // bool isNotEmpty () const; // //@ManDoc: True if the set of intersecting Boxes is empty. // bool isDisjoint () const; // //@ManDoc: True if the IntVect is within any of the Boxes in this BoxList. // bool contains (const IntVect& v) const; /*@ManDoc: True if the Box is within any of the Boxes in the List. The Box must also have the same IndexType as those in this BoxList. */ bool contains (const Box& b) const; // //@ManDoc: True if all Boxes in bl are contained in this BoxList. // bool contains (const BoxList& bl) const; // //@ManDoc: True if all Boxes in ba are contained in this BoxList. // bool contains (const BoxArray& ba) const; /*@ManDoc: Modify this BoxList to contain only its intersection with Box b. */ BoxList& intersect (const Box& b); /*@ManDoc: Modify this BoxList to contain only its intersection with BoxList b. */ BoxList& intersect (const BoxList& b); // //@ManDoc: Remove the Box from this BoxList. // BoxList& remove (const Box& bx); // //@ManDoc: Remove the pointed to Box from this BoxList. // BoxList& remove (iterator bli); // //@ManDoc: Creates the complement of BoxList bl in Box b. // BoxList& complementIn (const Box& b, const BoxList& bl); // //@ManDoc: Refine each Box in the BoxList by the ratio. // BoxList& refine (int ratio); // //@ManDoc: Refine each Box in the BoxList by the ratio. // BoxList& refine (const IntVect& ratio); // //@ManDoc: Coarsen each Box in the BoxList by the ratio. // BoxList& coarsen (int ratio); // //@ManDoc: Coarsen each Box in the BoxList by the ratio. // BoxList& coarsen (const IntVect& ratio); // //@ManDoc: Grow each Box in the BoxList by size sz. // BoxList& accrete (int sz); // //@ManDoc: Applies Box::shift(int,int) to each Box in the BoxList. // BoxList& shift (int dir, int nzones); // //@ManDoc: Applies Box::shiftHalf(int,int) to each Box in the BoxList. // BoxList& shiftHalf (int dir, int num_halfs); // //@ManDoc: Applies Box::shiftHalf(IntVect) to each Box in BoxList. // BoxList& shiftHalf (const IntVect& iv); /*@ManDoc: Merge adjacent Boxes in this BoxList. Return the number of Boxes merged. */ int simplify (); /*@ManDoc: Merges all possible adjacent Boxes. Returns the total number of Boxes merged. */ int minimize (); // //@ManDoc: Forces each Box in the BoxList to have sides of length <= chunk. // BoxList& maxSize (int chunk); /*@ManDoc: Forces each Box in the BoxList to have dimth side of length <= chunk[dim]. */ BoxList& maxSize (const IntVect& chunk); // //@ManDoc: Returns smallest Box that contains all Boxes in this BoxList. // Box minimalBox () const; // //@ManDoc: Returns the IndexType of Boxes in this BoxList. // IndexType ixType () const; /*@ManDoc: Applies surroundingNodes(Box) to each Box in BoxArray. See the documentation of Box for details. */ BoxList& surroundingNodes (); /*@ManDoc: Applies surroundingNodes(Box,int) to each Box in BoxList. See the documentation of Box for details. */ BoxList& surroundingNodes (int dir); // //@ManDoc: Applies Box::enclosedCells() to each Box in the BoxList. // BoxList& enclosedCells (); // //@ManDoc: Applies Box::enclosedCells(int) to each Box in the BoxList. // BoxList& enclosedCells (int dir); // //@ManDoc: Applies Box::convert(IndexType) to each Box in the BoxList. // BoxList& convert (IndexType typ); protected: // // The list of Boxes. // std::list lbox; // // Returns a reference to the List. // std::list& listBox(); // // Returns a constant reference to the List. // const std::list& listBox() const; private: // // The IndexType of Boxes in the BoxList. // IndexType btype; }; inline BoxList::iterator BoxList::begin() { return lbox.begin(); } inline BoxList::const_iterator BoxList::begin() const { return lbox.begin(); } inline BoxList::iterator BoxList::end() { return lbox.end(); } inline BoxList::const_iterator BoxList::end() const { return lbox.end(); } inline IndexType BoxList::ixType () const { return btype; } inline void BoxList::push_back (const Box& bn) { BL_ASSERT(ixType() == bn.ixType()); lbox.push_back(bn); } inline void BoxList::push_front (const Box& bn) { BL_ASSERT(ixType() == bn.ixType()); lbox.push_front(bn); } inline bool BoxList::isEmpty () const { return lbox.empty(); } inline int BoxList::size () const { return lbox.size(); } inline bool BoxList::isNotEmpty () const { return !lbox.empty(); } inline std::list& BoxList::listBox() { return lbox; } inline const std::list& BoxList::listBox() const { return lbox; } inline void BoxList::clear () { lbox.clear(); } #endif /*BL_BOXLIST_H*/ ccseapps-2.5/CCSEApps/BoxLib/CONSTANTS.H0000644000175000017500000000451711634153073020532 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_CONSTANTS_H #define BL_CONSTANTS_H /* * $Id: CONSTANTS.H,v 1.12 2001/08/02 16:37:49 car Exp $ */ #include #ifdef BL_LANG_FORT #define bigreal BL_REAL_E(1.0,30) #define zero BL_REAL(0.0) #define one BL_REAL(1.0) #define two BL_REAL(2.0) #define three BL_REAL(3.0) #define four BL_REAL(4.0) #define five BL_REAL(5.0) #define six BL_REAL(6.0) #define seven BL_REAL(7.0) #define eight BL_REAL(8.0) #define nine BL_REAL(9.0) #define ten BL_REAL(10.0) #define twelve BL_REAL(12.0) #define fifteen BL_REAL(15.0) #define sixteen BL_REAL(16.0) #define twenty BL_REAL(20.0) #define seventy BL_REAL(70.0) #define ninety BL_REAL(90.0) #define tenth BL_REAL(0.1) #define eighth BL_REAL(0.125) #define sixth BL_REAL(0.1666666666666667) #define fifth BL_REAL(0.2) #define forth BL_REAL(0.25) #define fourth BL_REAL(0.25) #define third BL_REAL(0.3333333333333333) #define half BL_REAL(0.5) #define two3rd BL_REAL(0.6666666666666667) #define Pi BL_REAL(3.1415926535897932) #endif /*BL_LANG_FORT*/ #endif /*BL_CONSTANTS_H*/ ccseapps-2.5/CCSEApps/BoxLib/CArena.H0000644000175000017500000001221011634153073020274 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_CARENA_H #define BL_CARENA_H #include #include #include #include #include #include // //@Man: //@Memo: A Concrete Class for Dynamic Memory Management /*@Doc: This is a coalescing memory manager. It allocates (possibly) large chunks of heap space and apportions it out as requested. It merges together neighboring chunks on each free(). */ class CArena : public Arena { public: /*@ManDoc: Construct a coalescing memory manager. `hunk\_size' is the minimum size of hunks of memory to allocate from the heap. If hunk\_size == 0 we use DefaultHunkSize as specified below. */ CArena (size_t hunk_size = 0); // //@ManDoc: The destructor. // virtual ~CArena (); // //@ManDoc: Allocate some memory. // virtual void* alloc (size_t nbytes); /*@ManDoc: Free up allocated memory. Merge neighboring free memory chunks into largest possible chunk. */ virtual void free (void* ap); // //@ManDoc: The current amount of heap space used by the CArena object. // size_t heap_space_used () const; // //@ManDoc: The default memory hunk size to grab from the heap. // enum { DefaultHunkSize = 1024*1024 }; protected: // // The nodes in our free list and block list. // class Node { public: // // The default constructor. // Node () : m_block(0), m_size(0) {} // // Another constructor. // Node (void* block, size_t size) : m_block(block), m_size(size) {} // // The copy constructor. // Node (const Node& rhs) : m_block(rhs.m_block), m_size(rhs.m_size) {} // // The copy assignment constructor. // Node& operator= (const Node& rhs) { m_block = rhs.m_block; m_size = rhs.m_size; return *this; } // // The "less-than" operator. // bool operator< (const Node& rhs) const { return m_block < rhs.m_block; } // // The equality operator. // bool operator== (const Node& rhs) const { return m_block == rhs.m_block; } // // The block address. // void* block () const { return m_block; } // // Set block address. // void block (void* blk) { m_block = blk; } // // The size of the memory block. // size_t size () const { return m_size; } // // Set size. // void size (size_t sz) { m_size = sz; } private: // // The block of memory we reference. // void* m_block; // // The size of the block we represent. // size_t m_size; }; // // The type of our freelist and blocklist. // We use a set sorted from lo to hi memory addresses. // typedef std::set NL; // // The list of blocks allocated via ::operator new(). // std::vector m_alloc; // // The free list of allocated but not currently used blocks. // Maintained in lo to hi memory sorted order. // NL m_freelist; // // The list of busy blocks. // A block is either on the freelist or on the blocklist, but not on both. // NL m_busylist; // // The minimal size of hunks to request via ::operator new(). // size_t m_hunk; // // The amount of heap space currently allocated. // size_t m_used; private: // // Disallowed. // CArena (const CArena& rhs); CArena& operator= (const CArena& rhs); }; // // The Arena used by BaseFab code. // extern Arena* The_FAB_Arena; #endif /*BL_CARENA_H*/ ccseapps-2.5/CCSEApps/BoxLib/SPECIALIZE_2D.F0000644000175000017500000000575111634153073021132 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include #include #include c c This function copies floating point numbers from one array to another. c subroutine FORT_FASTCOPY (dest, & DIMS(dest), & imin, jmin, imax, jmax, & src, & DIMS(src), & imn, jmn, imx, jmx, & ncomp) implicit none c c Bounds to fill in dest c integer imin, jmin, imax, jmax integer DIMDEC(dest) c c Bounds to fill from src c integer imn, jmn, imx, jmx integer DIMDEC(src) integer ncomp REAL_T dest(DIMV(dest),ncomp) REAL_T src(DIMV(src),ncomp) c c Local variables c integer i,j,k,ioff,joff ioff=imn-imin joff=jmn-jmin do k = 1, ncomp do j = jmin,jmax do i = imin,imax dest(i,j,k) = src(i+ioff,j+joff,k) end do end do end do end c c This function sets a section of an array to a value. c subroutine FORT_FASTSETVAL (val,lo,hi,dest,DIMS(dest),ncomp) implicit none integer ncomp integer lo(2), hi(2) integer DIMDEC(dest) REAL_T val REAL_T dest(DIMV(dest),ncomp) c c Local variables c integer i,j,k integer imin,jmin,imax,jmax imin = lo(1) jmin = lo(2) imax = hi(1) jmax = hi(2) do k = 1, ncomp do j = jmin,jmax do i = imin,imax dest(i,j,k) = val end do end do end do end ccseapps-2.5/CCSEApps/BoxLib/BLMpi.cpp0000644000175000017500000013075411634153073020517 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #ifdef __cplusplus extern "C" #endif int MPI_Allgather( void * sendbuf, int sendcount, MPI_Datatype sendtype, void * recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Allgather()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Allgather( sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Allgatherv( void * sendbuf, int sendcount, MPI_Datatype sendtype, void * recvbuf, int * recvcounts, int * displs, MPI_Datatype recvtype, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Allgatherv()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Allgatherv( sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Allreduce( void * sendbuf, void * recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Allreduce()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Allreduce( sendbuf, recvbuf, count, datatype, op, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Alltoall( void * sendbuf, int sendcount, MPI_Datatype sendtype, void * recvbuf, int recvcnt, MPI_Datatype recvtype, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Alltoall()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Alltoall( sendbuf, sendcount, sendtype, recvbuf, recvcnt, recvtype, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Alltoallv( void * sendbuf, int * sendcnts, int * sdispls, MPI_Datatype sendtype, void * recvbuf, int * recvcnts, int * rdispls, MPI_Datatype recvtype, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Alltoallv()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Alltoallv( sendbuf, sendcnts, sdispls, sendtype, recvbuf, recvcnts, rdispls, recvtype, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Barrier( MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Barrier()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Barrier( comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Bcast( void * buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Bcast()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Bcast( buffer, count, datatype, root, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Gather( void * sendbuf, int sendcnt, MPI_Datatype sendtype, void * recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Gather()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Gather( sendbuf, sendcnt, sendtype, recvbuf, recvcount, recvtype, root, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Gatherv( void * sendbuf, int sendcnt, MPI_Datatype sendtype, void * recvbuf, int * recvcnts, int * displs, MPI_Datatype recvtype, int root, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Gatherv()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Gatherv( sendbuf, sendcnt, sendtype, recvbuf, recvcnts, displs, recvtype, root, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Op_create( MPI_User_function * function, int commute, MPI_Op * op ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Op_create()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Op_create( function, commute, op ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Op_free( MPI_Op * op ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Op_free()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Op_free( op ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Reduce_scatter( void * sendbuf, void * recvbuf, int * recvcnts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Reduce_scatter()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Reduce_scatter( sendbuf, recvbuf, recvcnts, datatype, op, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Reduce( void * sendbuf, void * recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Reduce()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Reduce( sendbuf, recvbuf, count, datatype, op, root, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Scan( void * sendbuf, void * recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Scan()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Scan( sendbuf, recvbuf, count, datatype, op, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Scatter( void * sendbuf, int sendcnt, MPI_Datatype sendtype, void * recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Scatter()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Scatter( sendbuf, sendcnt, sendtype, recvbuf, recvcnt, recvtype, root, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Scatterv( void * sendbuf, int * sendcnts, int * displs, MPI_Datatype sendtype, void * recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Scatterv()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Scatterv( sendbuf, sendcnts, displs, sendtype, recvbuf, recvcnt, recvtype, root, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Attr_delete( MPI_Comm comm, int keyval ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Attr_delete()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Attr_delete( comm, keyval ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Attr_get( MPI_Comm comm, int keyval, void * attr_value, int * flag ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Attr_get()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Attr_get( comm, keyval, attr_value, flag ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Attr_put( MPI_Comm comm, int keyval, void * attr_value ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Attr_put()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Attr_put( comm, keyval, attr_value ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_compare( MPI_Comm comm1, MPI_Comm comm2, int * result ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_compare()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_compare( comm1, comm2, result ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_create( MPI_Comm comm, MPI_Group group, MPI_Comm * comm_out ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_create()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_create( comm, group, comm_out ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_dup( MPI_Comm comm, MPI_Comm * comm_out ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_dup()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_dup( comm, comm_out ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_free( MPI_Comm * comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_free()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_free( comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_group( MPI_Comm comm, MPI_Group * group ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_group()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_group( comm, group ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_rank( MPI_Comm comm, int * rank ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_rank()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_rank( comm, rank ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_remote_group( MPI_Comm comm, MPI_Group * group ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_remote_group()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_remote_group( comm, group ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_remote_size( MPI_Comm comm, int * size ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_remote_size()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_remote_size( comm, size ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_size( MPI_Comm comm, int * size ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_size()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_size( comm, size ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_split( MPI_Comm comm, int color, int key, MPI_Comm * comm_out ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_split()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_split( comm, color, key, comm_out ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Comm_test_inter( MPI_Comm comm, int * flag ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Comm_test_inter()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Comm_test_inter( comm, flag ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_compare( MPI_Group group1, MPI_Group group2, int * result ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_compare()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_compare( group1, group2, result ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_difference( MPI_Group group1, MPI_Group group2, MPI_Group * group_out ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_difference()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_difference( group1, group2, group_out ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_excl( MPI_Group group, int n, int * ranks, MPI_Group * newgroup ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_excl()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_excl( group, n, ranks, newgroup ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_free( MPI_Group * group ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_free()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_free( group ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_incl( MPI_Group group, int n, int * ranks, MPI_Group * group_out ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_incl()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_incl( group, n, ranks, group_out ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_intersection( MPI_Group group1, MPI_Group group2, MPI_Group * group_out ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_intersection()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_intersection( group1, group2, group_out ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_rank( MPI_Group group, int * rank ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_rank()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_rank( group, rank ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_range_excl( MPI_Group group, int n, int ranges[][3], MPI_Group * newgroup ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_range_excl()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_range_excl( group, n, ranges, newgroup ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_range_incl( MPI_Group group, int n, int ranges[][3], MPI_Group * newgroup ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_range_incl()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_range_incl( group, n, ranges, newgroup ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_size( MPI_Group group, int * size ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_size()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_size( group, size ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_translate_ranks( MPI_Group group_a, int n, int * ranks_a, MPI_Group group_b, int * ranks_b ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_translate_ranks()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_translate_ranks( group_a, n, ranks_a, group_b, ranks_b ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Group_union( MPI_Group group1, MPI_Group group2, MPI_Group * group_out ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Group_union()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Group_union( group1, group2, group_out ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Intercomm_create( MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm * comm_out ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Intercomm_create()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Intercomm_create( local_comm, local_leader, peer_comm, remote_leader, tag, comm_out ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Intercomm_merge( MPI_Comm comm, int high, MPI_Comm * comm_out ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Intercomm_merge()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Intercomm_merge( comm, high, comm_out ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Keyval_create( MPI_Copy_function * copy_fn, MPI_Delete_function * delete_fn, int * keyval, void * extra_state ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Keyval_create()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Keyval_create( copy_fn, delete_fn, keyval, extra_state ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Keyval_free( int * keyval ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Keyval_free()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Keyval_free( keyval ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Abort( MPI_Comm comm, int errorcode ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Abort()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Abort( comm, errorcode ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Error_class( int errorcode, int * errorclass ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Error_class()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Error_class( errorcode, errorclass ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Errhandler_create( MPI_Handler_function * function, MPI_Errhandler * errhandler ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Errhandler_create()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Errhandler_create( function, errhandler ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Errhandler_free( MPI_Errhandler * errhandler ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Errhandler_free()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Errhandler_free( errhandler ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Errhandler_get( MPI_Comm comm, MPI_Errhandler * errhandler ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Errhandler_get()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Errhandler_get( comm, errhandler ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Error_string( int errorcode, char * string, int * resultlen ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Error_string()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Error_string( errorcode, string, resultlen ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Errhandler_set( MPI_Comm comm, MPI_Errhandler errhandler ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Errhandler_set()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Errhandler_set( comm, errhandler ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Finalize( ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Finalize()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Finalize( ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Get_processor_name( char * name, int * resultlen ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Get_processor_name()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Get_processor_name( name, resultlen ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Init( int * argc, char *** argv ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Init()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Init( argc, argv ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Initialized( int * flag ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Initialized()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Initialized( flag ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif double MPI_Wtick( ) { double returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Wtick()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Wtick( ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Address( void * location, MPI_Aint * address ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Address()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Address( location, address ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Bsend( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Bsend()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Bsend( buf, count, datatype, dest, tag, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Bsend_init( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Bsend_init()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Bsend_init( buf, count, datatype, dest, tag, comm, request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Buffer_attach( void * buffer, int size ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Buffer_attach()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Buffer_attach( buffer, size ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Buffer_detach( void * buffer, int * size ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Buffer_detach()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Buffer_detach( buffer, size ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Cancel( MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Cancel()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Cancel( request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Request_free( MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Request_free()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Request_free( request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Recv_init( void * buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Recv_init()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Recv_init( buf, count, datatype, source, tag, comm, request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Send_init( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Send_init()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Send_init( buf, count, datatype, dest, tag, comm, request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Get_elements( MPI_Status * status, MPI_Datatype datatype, int * elements ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Get_elements()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Get_elements( status, datatype, elements ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Get_count( MPI_Status * status, MPI_Datatype datatype, int * count ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Get_count()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Get_count( status, datatype, count ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Ibsend( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Ibsend()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Ibsend( buf, count, datatype, dest, tag, comm, request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Iprobe( int source, int tag, MPI_Comm comm, int * flag, MPI_Status * status ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Iprobe()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Iprobe( source, tag, comm, flag, status ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Irecv( void * buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Irecv()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Irecv( buf, count, datatype, source, tag, comm, request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Irsend( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Irsend()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Irsend( buf, count, datatype, dest, tag, comm, request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Isend( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Isend()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Isend( buf, count, datatype, dest, tag, comm, request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Issend( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Issend()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Issend( buf, count, datatype, dest, tag, comm, request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Pack( void * inbuf, int incount, MPI_Datatype type, void * outbuf, int outcount, int * position, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Pack()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Pack( inbuf, incount, type, outbuf, outcount, position, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Pack_size( int incount, MPI_Datatype datatype, MPI_Comm comm, int * size ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Pack_size()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Pack_size( incount, datatype, comm, size ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Probe( int source, int tag, MPI_Comm comm, MPI_Status * status ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Probe()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Probe( source, tag, comm, status ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Recv( void * buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status * status ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Recv()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Recv( buf, count, datatype, source, tag, comm, status ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Rsend( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Rsend()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Rsend( buf, count, datatype, dest, tag, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Rsend_init( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Rsend_init()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Rsend_init( buf, count, datatype, dest, tag, comm, request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Send( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Send()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Send( buf, count, datatype, dest, tag, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Sendrecv( void * sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void * recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status * status ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Sendrecv()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Sendrecv( sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, recvtype, source, recvtag, comm, status ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Sendrecv_replace( void * buf, int count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Status * status ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Sendrecv_replace()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Sendrecv_replace( buf, count, datatype, dest, sendtag, source, recvtag, comm, status ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Ssend( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Ssend()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Ssend( buf, count, datatype, dest, tag, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Ssend_init( void * buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Ssend_init()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Ssend_init( buf, count, datatype, dest, tag, comm, request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Start( MPI_Request * request ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Start()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Start( request ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Startall( int count, MPI_Request * array_of_requests ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Startall()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Startall( count, array_of_requests ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Test( MPI_Request * request, int * flag, MPI_Status * status ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Test()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Test( request, flag, status ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Testall( int count, MPI_Request * array_of_requests, int * flag, MPI_Status * array_of_statuses ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Testall()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Testall( count, array_of_requests, flag, array_of_statuses ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Testany( int count, MPI_Request * array_of_requests, int * index, int * flag, MPI_Status * status ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Testany()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Testany( count, array_of_requests, index, flag, status ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Test_cancelled( MPI_Status * status, int * flag ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Test_cancelled()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Test_cancelled( status, flag ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Testsome( int incount, MPI_Request * array_of_requests, int * outcount, int * array_of_indices, MPI_Status * array_of_statuses ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Testsome()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Testsome( incount, array_of_requests, outcount, array_of_indices, array_of_statuses ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_commit( MPI_Datatype * datatype ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_commit()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_commit( datatype ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_contiguous( int count, MPI_Datatype old_type, MPI_Datatype * newtype ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_contiguous()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_contiguous( count, old_type, newtype ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_extent( MPI_Datatype datatype, MPI_Aint * extent ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_extent()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_extent( datatype, extent ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_free( MPI_Datatype * datatype ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_free()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_free( datatype ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_hindexed( int count, int * blocklens, MPI_Aint * indices, MPI_Datatype old_type, MPI_Datatype * newtype ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_hindexed()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_hindexed( count, blocklens, indices, old_type, newtype ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_hvector( int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype * newtype ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_hvector()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_hvector( count, blocklen, stride, old_type, newtype ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_indexed( int count, int * blocklens, int * indices, MPI_Datatype old_type, MPI_Datatype * newtype ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_indexed()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_indexed( count, blocklens, indices, old_type, newtype ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_lb( MPI_Datatype datatype, MPI_Aint * displacement ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_lb()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_lb( datatype, displacement ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_size( MPI_Datatype datatype, int * size ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_size()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_size( datatype, size ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_struct( int count, int * blocklens, MPI_Aint * indices, MPI_Datatype * old_types, MPI_Datatype * newtype ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_struct()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_struct( count, blocklens, indices, old_types, newtype ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_ub( MPI_Datatype datatype, MPI_Aint * displacement ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_ub()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_ub( datatype, displacement ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Type_vector( int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype * newtype ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Type_vector()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Type_vector( count, blocklen, stride, old_type, newtype ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Unpack( void * inbuf, int insize, int * position, void * outbuf, int outcount, MPI_Datatype type, MPI_Comm comm ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Unpack()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Unpack( inbuf, insize, position, outbuf, outcount, type, comm ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Wait( MPI_Request * request, MPI_Status * status ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Wait()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Wait( request, status ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Waitall( int count, MPI_Request * array_of_requests, MPI_Status * array_of_statuses ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Waitall()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Waitall( count, array_of_requests, array_of_statuses ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Waitany( int count, MPI_Request * array_of_requests, int * index, MPI_Status * status ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Waitany()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Waitany( count, array_of_requests, index, status ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Waitsome( int incount, MPI_Request * array_of_requests, int * outcount, int * array_of_indices, MPI_Status * array_of_statuses ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Waitsome()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Waitsome( incount, array_of_requests, outcount, array_of_indices, array_of_statuses ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Cart_coords( MPI_Comm comm, int rank, int maxdims, int * coords ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Cart_coords()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Cart_coords( comm, rank, maxdims, coords ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Cart_create( MPI_Comm comm_old, int ndims, int * dims, int * periods, int reorder, MPI_Comm * comm_cart ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Cart_create()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Cart_create( comm_old, ndims, dims, periods, reorder, comm_cart ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Cart_get( MPI_Comm comm, int maxdims, int * dims, int * periods, int * coords ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Cart_get()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Cart_get( comm, maxdims, dims, periods, coords ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Cart_map( MPI_Comm comm_old, int ndims, int * dims, int * periods, int * newrank ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Cart_map()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Cart_map( comm_old, ndims, dims, periods, newrank ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Cart_rank( MPI_Comm comm, int * coords, int * rank ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Cart_rank()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Cart_rank( comm, coords, rank ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Cart_shift( MPI_Comm comm, int direction, int displ, int * source, int * dest ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Cart_shift()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Cart_shift( comm, direction, displ, source, dest ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Cart_sub( MPI_Comm comm, int * remain_dims, MPI_Comm * comm_new ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Cart_sub()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Cart_sub( comm, remain_dims, comm_new ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Cartdim_get( MPI_Comm comm, int * ndims ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Cartdim_get()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Cartdim_get( comm, ndims ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Dims_create( int nnodes, int ndims, int * dims ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Dims_create()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Dims_create( nnodes, ndims, dims ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Graph_create( MPI_Comm comm_old, int nnodes, int * index, int * edges, int reorder, MPI_Comm * comm_graph ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Graph_create()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Graph_create( comm_old, nnodes, index, edges, reorder, comm_graph ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Graph_get( MPI_Comm comm, int maxindex, int maxedges, int * index, int * edges ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Graph_get()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Graph_get( comm, maxindex, maxedges, index, edges ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Graph_map( MPI_Comm comm_old, int nnodes, int * index, int * edges, int * newrank ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Graph_map()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Graph_map( comm_old, nnodes, index, edges, newrank ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Graph_neighbors( MPI_Comm comm, int rank, int maxneighbors, int * neighbors ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Graph_neighbors()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Graph_neighbors( comm, rank, maxneighbors, neighbors ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Graph_neighbors_count( MPI_Comm comm, int rank, int * nneighbors ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Graph_neighbors_count()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Graph_neighbors_count( comm, rank, nneighbors ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Graphdims_get( MPI_Comm comm, int * nnodes, int * nedges ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Graphdims_get()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Graphdims_get( comm, nnodes, nedges ); BL_PROFILE_STOP( bltimer ); return returnVal; } #ifdef __cplusplus extern "C" #endif int MPI_Topo_test( MPI_Comm comm, int * top_type ) { int returnVal; BL_PROFILE_TIMER( bltimer, "MPI_Topo_test()" ); BL_PROFILE_START( bltimer ); returnVal = PMPI_Topo_test( comm, top_type ); BL_PROFILE_STOP( bltimer ); return returnVal; } ccseapps-2.5/CCSEApps/BoxLib/DistributionMapping.H0000644000175000017500000001463511634153073023153 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_DISTRIBUTIONMAPPING_H #define BL_DISTRIBUTIONMAPPING_H // // $Id: DistributionMapping.H,v 1.23 2002/10/31 18:09:00 car Exp $ // #include #include #include #include class BoxArray; // //@Man: //@Memo: Calculates the distribution of FABs to processors. /*@Doc: This class calculates the distribution of FABs to processors in a FabArray in a multi-processor environment. By distribution is meant what CPU in the multi-processor environment owns what FAB. Only the BoxArray on which the FabArray is built is used in determining the distribution. The two types of distributions supported are round-robin and knapsack. In the round-robin distribution FAB `i' is owned by CPU `i%N' where N is total number of CPUs. In the knapsack distribution the FABs are partitioned across CPUs such that the total volume of the Boxes in the underlying BoxArray are as equal across CPUs as is possible. */ class DistributionMapping { public: // //@ManDoc: The distribution strategy: ROUNDROBIN or KNAPSACK. // enum Strategy { ROUNDROBIN, KNAPSACK }; // //@ManDoc: The default constructor. // DistributionMapping (); // //@ManDoc: Build mapping out of BoxArray over nprocs processors. // DistributionMapping (const BoxArray& boxes, int nprocs); // // This is a very specialized distribution map. // Do NOT use it unless you really understand what it does. // DistributionMapping (const DistributionMapping& d1, const DistributionMapping& d2); // //@ManDoc: The destructor. // ~DistributionMapping (); /*@ManDoc: Build mapping out of BoxArray over nprocs processors. You need to call this if you built your DistributionMapping with the default constructor. */ void define (const BoxArray& boxes, int nprocs); /*@ManDoc: Returns a constant reference to the mapping of boxes in the underlying BoxArray to the CPU that holds the FAB on that Box. ProcessorMap()[i] is an integer in the interval [0, NCPU) where NCPU is the number of CPUs being used. */ const Array& ProcessorMap () const; // //@ManDoc: Equivalent to ProcessorMap()[index]. // int operator[] (int index) const; // //@ManDoc: Set distribution strategy. // static void strategy (Strategy how); // //@ManDoc: Returns the distribution strategy. // static Strategy strategy (); /*@ManDoc: Flush the cache of processor maps. The processor map cache is only flushed manually. Only call this after a regridding before new MultiFabs are alloc()d. */ static void FlushCache (); // //@ManDoc: The size of the cache. // static int CacheSize (); // //@ManDoc: Append the ProcMap to the Cache. Checks for consistency. // static void AddToCache (const DistributionMapping& dm); // //@ManDoc: Output some simple cache statistics. // static void CacheStats (std::ostream& os); // //@ManDoc: Are the distributions equal? // bool operator== (const DistributionMapping& rhs) const; // //@ManDoc: Are the distributions different? // bool operator!= (const DistributionMapping& rhs) const; void RoundRobinProcessorMap (int nboxes, int nprocs); void KnapSackProcessorMap (const std::vector& boxes, int nprocs); // // Initializes distribution strategy from ParmParse. // // ParmParse options are: // // DistributionMapping.strategy = ROUNDROBIN // DistributionMapping.strategy = KNAPSACK // static void Initialize (); static void Finalize (); private: // // Two ways to create the processor map. // void RoundRobinProcessorMap (const BoxArray& boxes, int nprocs); void KnapSackProcessorMap (const BoxArray& boxes, int nprocs); // // Our cache of processor maps. // static std::vector< Array > m_Cache; // // Look for a cached processor map. // bool GetMap (const BoxArray& boxes); // // A useful typedef. // typedef void (DistributionMapping::*PVMF)(const BoxArray&,int); // // Everyone uses the same Strategy -- defaults to KNAPSACK. // static Strategy m_Strategy; // // Pointer to one of the CreateProcessorMap() functions. // Corresponds to the one specified by `m_Strategy'. // static PVMF m_BuildMap; // // Have we initialized from ParmParse yet? // static bool m_Initialized; // // Local data -- our processor map. // // The length is always equal to boxes.length()+1 where `boxes' is // the BoxArray on which the distribution is based. It is also true // that m_procmap[boxes.length()] == ParallelDescriptor::MyProc(). // This latter acts as a sentinel in some FabArray loops. // Array m_procmap; }; inline int DistributionMapping::operator[] (int index) const { return m_procmap[index]; } // // Our output operator. // std::ostream& operator<< (std::ostream& os, const DistributionMapping& pmap); #endif /*BL_DISTRIBUTIONMAPPING_H*/ ccseapps-2.5/CCSEApps/BoxLib/BLWorkQueue.cpp0000644000175000017500000001230411634153073021707 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BLWorkQueue.cpp,v 1.12 2001/11/16 18:05:16 car Exp $ // #include #include #include #include #include #include #include #include #include #include namespace { Mutex print_mutex; WorkQueue* bl_wrkq = 0; int verbose = 0; int stacksize = 0; } namespace BoxLib { WorkQueue& theWorkQueue() { return *bl_wrkq; } } void WorkQueue::Initialize () { ParmParse pp("workqueue"); int maxthreads = 0; pp.query("maxthreads", maxthreads); pp.query("verbose", verbose); pp.query("stacksize", stacksize); if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "workqueue.maxthreads = " << maxthreads << std::endl; std::cout << "workqueue.stacksize = " << stacksize << std::endl; } bl_wrkq = new WorkQueue(maxthreads); } void WorkQueue::Finalize () { delete bl_wrkq; } #define DPRINTF(arg) \ do \ { \ if ( verbose > 2 ) \ { \ Lock lock(print_mutex); \ std::cout << "tid(" << Thread::getID() << "): " \ << arg << std::endl; \ } \ } \ while (false) WorkQueue::WorkQueue(int maxthreads_) : quit(false), eof(false), maxthreads(maxthreads_), numthreads(0), idlethreads(0), tasks(0) { if ( maxthreads_ >= Thread::max_threads() ) { BoxLib::Error("maxthreads_ in workqueue exceeds system limit"); } if ( maxthreads_ < 0 ) { BoxLib::Error("maxthreads_ must be >= 0"); } } int WorkQueue::max_threads() const { return maxthreads; } int WorkQueue::num_threads() const { Lock lock(cv); return numthreads; } WorkQueue::task::~task() { } extern "C" void* WorkQueue_server(void* arg) { BL_PROFILE("WorkQueue_server()"); WorkQueue* wq = static_cast(arg); return wq->server(); } void* WorkQueue::server() { DPRINTF("A worker is starting"); Lock lock(cv); DPRINTF("Worker locked 0"); for (;;) { if ( tasks == 0 && eof ) { gate.open(); gate.release(); eof = false; } DPRINTF("Worker waiting for work"); while ( wrkq.empty() && !quit ) { idlethreads++; cv.wait(); idlethreads--; } DPRINTF("Work queue: wrkq.empty()(" << wrkq.empty()<< "), " << "quit(" << quit << "), " << "eof(" << eof << "), " << "tasks(" << tasks << ")"); if ( !wrkq.empty() ) { std::auto_ptr we(wrkq.front()); wrkq.pop(); if ( we.get() ) { eof = false; DPRINTF("Worker calling engine"); cv.unlock(); we->run(); cv.lock(); DPRINTF("Worker returning engine"); } else { DPRINTF("EOF reached"); eof = true; } tasks--; } if ( wrkq.empty() && quit ) { DPRINTF("Worker shutting down"); if ( --numthreads == 0 ) { cv.broadcast(); // FIXME same predicate! } break; } } DPRINTF("Worker exiting"); return 0; } void WorkQueue::drain() { Lock lock(cv); if ( numthreads > 0 ) { quit = true; if ( idlethreads > 0 ) { cv.broadcast(); } while ( numthreads > 0 ) { cv.wait(); // FIXME??? using same cv for two predicates } } } WorkQueue::~WorkQueue() { drain(); } void WorkQueue::add(task* item) { std::auto_ptr tsk(item); Lock lock(cv); if ( maxthreads == 0 ) { DPRINTF("maxthreads ==0 task"); if ( item ) { item->run(); } return; } wrkq.push(tsk.release()); tasks++; if ( idlethreads > 0 ) { DPRINTF("Signaling idle worker"); cv.signal(); } else if ( numthreads < maxthreads ) { DPRINTF("Creating new worker"); FunctionThread ft(WorkQueue_server,this,FunctionThread::Detached,stacksize); numthreads++; } } void WorkQueue::wait() { add( 0 ); if ( maxthreads ) { gate.wait(); } gate.close(); DPRINTF("wait: finished..."); } ccseapps-2.5/CCSEApps/BoxLib/SPACE_F.H0000644000175000017500000000437011634153073020253 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_SPACE_F_H #define BL_SPACE_F_H /* ** $Id: SPACE_F.H,v 1.6 2001/07/17 23:02:27 lijewski Exp $ */ #include #ifdef BL_LANG_FORT # if (BL_SPACEDIM == 1) /*@ManDoc: The DIM\_V() macro can be used to enhance the portability of Fortran code. It can be used whenever the BL\_LANG\_FORT preprocessor macro is defined. It is used to specify the dimensionality of Fortran arrays, corresponding to BL\_SPACEDIM. `lo' and `hi' are BL\_SPACEDIM-dimensional integer arrays that specify the low and high range of the array being specified. More explicitly, the macro evaluates to one of lo(1):hi(1) lo(1):hi(1),lo(2):hi(2) lo(1):hi(1),lo(2):hi(2),lo(3):hi(3) corresponding to BL\_SPACEDIM values of 1, 2, or 3. */ # define DIM_V(lo,hi) lo(1):hi(1) # elif (BL_SPACEDIM == 2) # define DIM_V(lo,hi) lo(1):hi(1),lo(2):hi(2) # elif (BL_SPACEDIM == 3) # define DIM_V(lo,hi) lo(1):hi(1),lo(2):hi(2),lo(3):hi(3) # endif #endif #endif /*BL_SPACE_F_H*/ ccseapps-2.5/CCSEApps/BoxLib/FabArray.H0000644000175000017500000014471411634153073020651 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_FABARRAY_H #define BL_FABARRAY_H // // $Id: FabArray.H,v 1.166 2002/12/18 18:44:23 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class FabArrayBase { public: FabArrayBase (); FabArrayBase (const BoxArray& bx, int nvar, int ngrow); FabArrayBase (const BoxArray& bx, int nvar, int ngrow, const DistributionMapping& map); virtual ~FabArrayBase(); // //@ManDoc: Returns the grow factor that defines the region of definition. // int nGrow () const; // //@ManDoc: Returns number of variables associated with each point (nvar). // int nComp () const; /*@ManDoc: Returns a constant reference to the BoxArray that defines the valid region associated with this FabArray. */ const BoxArray& boxArray () const; /*@ManDoc: Returns a constant reference to the Kth Box in the BoxArray. That is, the valid region of the Kth grid. */ virtual const Box& box (int K) const; /*@ManDoc: Returns the Kth FABs Box in the FabArray. That is, the region the Kth fab is actually defined on. */ virtual Box fabbox (int K) const; // //@ManDoc: Returns the number of FABs in the FabArray.. // int size () const; // //@ManDoc: Returns constant reference to associated DistributionMapping. // const DistributionMapping& DistributionMap () const; protected: // // The data ... // mutable BoxArray boxarray; /* So FabSets can modify'm */ DistributionMapping distributionMap; int n_grow; int n_comp; }; class MFIter { public: // //@ManDoc: Construct a MFIter. // explicit MFIter (const FabArrayBase& fabarray); // //@ManDoc: Returns the Box at the current index in the underlying BoxArray. // const Box& validbox () const; // //@ManDoc: Returns the Box of the FAB at which we currently point. // Box fabbox () const; // //@ManDoc: Increments iterator to the next FAB in the FabArray that we own. // void operator++ (); // //@ManDoc: Is the iterator valid i.e. is it associated with a FAB? // bool isValid (); // //@ManDoc: The index into the underlying BoxArray of the current FAB. // int index () const; // //@ManDoc: Constant reference to FabArray over which we're iterating. // const FabArrayBase& theFabArrayBase () const; static void setDebugging (bool debugging); protected: static bool g_debugging; const FabArrayBase& fabArray; int currentIndex; bool m_debugging; }; // // A forward declaration. // template class FabArray; template class FabArrayCopyDescriptor; // //@Man: //@Memo: A Collection of Fortran Array-like Objects /*@Doc: The FabArray class implements a collection (stored as an array) of Fortran array-like objects. The parameterized type FAB is intended to be any class derived from BaseFab. For example, FAB may be a BaseFab of integers, so we could write: FabArray< int,BaseFab > int\_fabs; Then int\_fabs is a FabArray that can hold a collection of BaseFab objects. FabArray is not just a general container class for Fortran arrays. It is intended to hold "grid" data for use in finite difference calculations in which the data is defined on a union of (usually disjoint) rectangular regions embedded in a uniform index space. This region, called the valid region, is represented by a BoxArray. For the purposes of this discussion, the Kth Box in the BoxArray represents the interior region of the Kth grid. Since the intent is to be used with finite difference calculations a FabArray also includes the notion of a boundary region for each grid. The boundary region is specified by the ngrow parameter which tells the FabArray to allocate each FAB to be ngrow cells larger in all directions than the underlying Box. The larger region covered by the union of all the FABs is called the region of definition. The underlying notion is that the valid region contains the grid interior data and the region of definition includes the interior region plus the boundary areas. Operations are available to copy data from the valid regions into these boundary areas where the two overlap. The number of components, that is, the number of values that can be stored in each cell of a FAB, is either given as an argument to the constructor or is inherent in the definition of the underlying FAB. Each FAB in the FabArray will have the same number of components. In summary, a FabArray is an array of FABs. The Kth element contains a FAB that holds the data for the Kth grid, a Box that defines the valid region of the Kth grid. A typical use for a FabArray would be to hold the solution vector or right-hand-side when solving a linear system of equations on a union of rectangular grids. The copy operations would be used to copy data from the valid regions of neighboring grids into the boundary regions after each relaxation step of the iterative method. If a multigrid method is used, a FabArray could be used to hold the data at each level in the multigrid hierarchy. This class is a concrete class not a polymorphic one. This class does NOT provide a copy constructor or assignment operator. */ /*@ManDoc: An enumumeration that controls whether or not the memory for a FAB will actually be allocated on construction of a FabArray. Possible values are: Fab\_noallocate and Fab\_allocate. */ enum FabAlloc { Fab_noallocate = 0, Fab_allocate }; template class FabArray : public FabArrayBase { public: typedef typename FAB::value_type value_type; // //@ManDoc: Constructs an empty FabArray. // FabArray (); /*@ManDoc: Construct a FabArray with a valid region defined by bxs and a region of definition defined by the grow factor ngrow and the number of components nvar. If mem\_mode is defined to be Fab\_allocate then FABs are allocated for each Box in the BoxArray. The size of the Kth FAB is given by bxs[K] grown by ngrow. If mem\_mode is defined to be Fab\_noallocate, then no FABs are allocated at this time, but can be defined later. The number of components in each FAB is not specified and is expected to be implicit in the definition of the FAB class. That is, the FAB constructor will take only a Box argument. Call this constructor number two. */ FabArray (const BoxArray& bxs, int nvar, int ngrow, FabAlloc mem_mode = Fab_allocate); // //@ManDoc: The (virtual) destructor -- deletes all FABs in the array. // virtual ~FabArray (); /*@ManDoc: Define this FabArray identically to that performed by the constructor having an analogous function signature. This is only valid if this FabArray was defined using the default constructor. */ void define (const BoxArray& bxs, int nvar, int ngrow, FabAlloc mem_mode); void define (const BoxArray& bxs, int nvar, int ngrow, const DistributionMapping& dm, FabAlloc mem_mode); /*@ManDoc: Returns true if the FabArray is well-defined. That is, if FABs are allocated for each Box in the BoxArray and the sizes of the FABs and the number of components are consistent with the definition of the FabArray. */ bool ok () const; /*@ManDoc: Returns a constant reference to the FAB associated with the Kth element. */ const FAB& operator[] (const MFIter& mfi) const; const FAB& get (const MFIter& mfi) const; // //@ManDoc: Returns a reference to the FAB associated with the Kth element. // FAB& operator[] (const MFIter& mfi); FAB& get (const MFIter& mfi); /*@ManDoc: Returns a constant reference to the FAB associated with the Kth element. */ const FAB& operator[] (int K) const; // //@ManDoc: Returns a reference to the FAB associated with the Kth element. // FAB& operator[] (int K); // //@ManDoc: Explicitly set the Kth FAB in the FabArray to point to elem. // void setFab (int K, FAB* elem); // //@ManDoc: Releases FAB memory in the FabArray. // void clear (); // //@ManDoc: Set all components in the valid region of each FAB to val. // void setVal (value_type val); void operator= (const value_type& val); /*@ManDoc: Set the value of num\_comp components in the valid region of each FAB in the FabArray, starting at component comp to val. Also set the value of nghost boundary cells. */ void setVal (value_type val, int comp, int num_comp, int nghost = 0); /*@ManDoc: Set the value of num\_comp components in the valid region of each FAB in the FabArray, starting at component comp, as well as nghost boundary cells, to val, provided they also intersect with the Box region. */ void setVal (value_type val, const Box& region, int comp, int num_comp, int nghost = 0); /*@ManDoc: Set all components in the valid region of each FAB in the FabArray to val, including nghost boundary cells. */ void setVal (value_type val, int nghost); /*@ManDoc: Set all components in the valid region of each FAB in the FabArray to val, including nghost boundary cells, that also intersect the Box region. */ void setVal (value_type val, const Box& region, int nghost); // //@ManDoc: Set all values in the boundary region to val. // void setBndry (value_type val); /*@ManDoc: Set ncomp values in the boundary region, starting at start\_comp to val. */ void setBndry (value_type val, int strt_comp, int ncomp); /*@ManDoc: This function copies data from fa to this FabArray. Each FAB in fa is intersected with all FABs in this FabArray and a copy is performed on the region of intersection. The intersection is restricted to the valid region of each FAB. */ void copy (const FabArray& fa); /*@ManDoc: This function copies data from src to this FabArray. Each FAB in src is intersected with all FABs in this FabArray and a copy is performed on the region of intersection. The intersection is restricted to the num\_comp components starting at src\_comp in the FabArray src, with the destination components in this FabArray starting at dest\_comp. */ void copy (const FabArray& src, int src_comp, int dest_comp, int num_comp); /*@ManDoc: Copies the values contained in the intersection of the valid region of this FabArray with the FAB dest into dest. */ void copy (FAB& dest) const; /*@ManDoc: Copies the values contained in the intersection of the valid region of this FabArray with the FAB dest and the Box subbox into that subregion of dest. */ void copy (FAB& dest, const Box& subbox) const; /*@ManDoc: Copies the values contained in the intersection of the num\_comp component valid region of this FabArray, starting at component src\_comp, with the FAB dest into dest, starting at component dest\_comp in dest. */ void copy (FAB& dest, int src_comp, int dest_comp, int num_comp) const; /*@ManDoc: Copies the values contained in the intersection of the num\_comp component valid region of this FabArray, starting at component src\_comp, with the FAB dest and the Box subbox, into dest, starting at component dest\_comp in dest. */ void copy (FAB& dest, const Box& subbox, int src_comp, int dest_comp, int num_comp) const; /*@ManDoc: Perform shifts on the FabArray. */ void shift (const IntVect& v); protected: PArray fabparray; private: // // These are disallowed. // FabArray (const FabArray&); FabArray& operator= (const FabArray&); // // This is used locally in all define functions. // void AllocFabs (); }; // // FillBoxID Helper class // class FillBoxId { public: FillBoxId (); FillBoxId (int newid, const Box& fillbox); int Id () const; int FabIndex () const; void FabIndex (int fabindex); const Box& box () const; private: Box m_fillBox; int m_fillBoxId; int m_fabIndex; }; // // Used to cache some CommData stuff in CollectData(). // class CommDataCache { public: CommDataCache (); void operator= (const Array& rhs); bool isValid () const { return m_valid; } Array& theCommData () { return m_commdata; } const Array& theCommData () const { return m_commdata; } private: Array m_commdata; bool m_valid; }; class FabArrayId { public: explicit FabArrayId (int newid = -1) : fabArrayId(newid) {} int Id () const { return fabArrayId; } bool operator== (const FabArrayId& rhs) const { return fabArrayId == rhs.fabArrayId; } private: int fabArrayId; }; // // This enum and the FabCopyDescriptor class should really be nested // in FabArrayCopyDescriptor (not done for portability reasons). // enum FillType { FillLocally, FillRemotely, Unfillable }; template struct FabCopyDescriptor { FabCopyDescriptor (); ~FabCopyDescriptor (); FAB* localFabSource; Box subBox; int myProc; int copyFromProc; int copyFromIndex; int fillBoxId; int srcComp; int destComp; int nComp; FillType fillType; bool cacheDataAllocated; private: // // Disallowed. // FabCopyDescriptor (const FabCopyDescriptor&); FabCopyDescriptor& operator= (const FabCopyDescriptor&); }; template FabCopyDescriptor::FabCopyDescriptor () : localFabSource(0), myProc(-1), copyFromProc(-1), copyFromIndex(-1), fillBoxId(-1), srcComp(-1), destComp(-1), nComp(-1), fillType(Unfillable), cacheDataAllocated(false) {} template FabCopyDescriptor::~FabCopyDescriptor () { if (cacheDataAllocated) delete localFabSource; } // // This class orchestrates filling a destination fab of size destFabBox // from fabarray on the local processor (myProc). // template class FabArrayCopyDescriptor { typedef std::multimap*> FCDMap; typedef typename FCDMap::value_type FCDMapValueType; typedef typename FCDMap::iterator FCDMapIter; typedef typename FCDMap::const_iterator FCDMapConstIter; public: FabArrayCopyDescriptor (); ~FabArrayCopyDescriptor (); FabArrayId RegisterFabArray(FabArray *fabarray); FillBoxId AddBox (FabArrayId fabarrayid, const Box& destFabBox, BoxList* unfilledBoxes, bool bUseValidBox = true); FillBoxId AddBox (FabArrayId fabarrayid, const Box& destFabBox, BoxList* unfilledBoxes, int srccomp, int destcomp, int numcomp, bool bUseValidBox = true); // // Add a box but only from FabArray[fabarrayindex]. // FillBoxId AddBox (FabArrayId fabarrayid, const Box& destFabBox, BoxList* unfilledBoxes, int fabarrayindex, int srccomp, int destcomp, int numcomp, bool bUseValidBox = true); void CollectData (Array* snd_cache = 0, CommDataCache* cd_cache = 0); void FillFab (FabArrayId fabarrayid, const FillBoxId& fillboxid, FAB& destFab); void FillFab (FabArrayId fabarrayid, const FillBoxId& fillboxid, FAB& destFab, const Box& destBox); void PrintStats () const; bool DataAvailable () const { return dataAvailable; } void clear (); int nFabArrays () const { return fabArrays.size(); } int nFabComTags () const { return fabComTagList.size(); } int nFabCopyDescs () const { return fabCopyDescList.size(); } protected: // // Helper function for AddBox() routines. // void AddBoxDoIt (FabArrayId fabarrayid, const Box& destFabBox, BoxList* returnedUnfilledBoxes, int faindex, int srccomp, int destcomp, int numcomp, bool bUseValidBox, BoxDomain& unfilledBoxDomain, BoxList& filledBoxes); std::vector*> fabArrays; std::vector fabCopyDescList; std::vector fabComTagList; int nextFillBoxId; bool dataAvailable; private: // // These are disallowed. // FabArrayCopyDescriptor (const FabArrayCopyDescriptor&); FabArrayCopyDescriptor& operator= (const FabArrayCopyDescriptor &); }; inline int FabArrayBase::nGrow () const { return n_grow; } inline const BoxArray& FabArrayBase::boxArray () const { return boxarray; } inline const Box& FabArrayBase::box (int K) const { return boxarray[K]; } inline int FabArrayBase::size () const { return boxarray.size(); } inline int FabArrayBase::nComp () const { return n_comp; } inline const DistributionMapping& FabArrayBase::DistributionMap () const { return distributionMap; } inline const FabArrayBase& MFIter::theFabArrayBase () const { return fabArray; } inline int MFIter::index () const { return currentIndex; } inline int FillBoxId::Id () const { return m_fillBoxId; } inline int FillBoxId::FabIndex () const { return m_fabIndex; } inline void FillBoxId::FabIndex (int fabindex) { m_fabIndex = fabindex; } inline const Box& FillBoxId::box () const { return m_fillBox; } template inline const FAB& FabArray::operator[] (const MFIter& mfi) const { return fabparray[mfi.index()]; } template inline const FAB& FabArray::get (const MFIter& mfi) const { return fabparray[mfi.index()]; } template inline FAB& FabArray::operator[] (const MFIter& mfi) { return fabparray[mfi.index()]; } template inline FAB& FabArray::get (const MFIter& mfi) { return fabparray[mfi.index()]; } template inline const FAB& FabArray::operator[] (int K) const { return fabparray[K]; } template inline FAB& FabArray::operator[] (int K) { return fabparray[K]; } template void FabArray::clear () { fabparray.clear(); } template void FabArray::setVal (value_type val, int nghost) { setVal(val,0,n_comp,nghost); } template void FabArray::setVal (value_type val, const Box& region, int nghost) { setVal(val,region,0,n_comp,nghost); } template FabArray::FabArray () : fabparray(0,PArrayManage) {} template FabArray::FabArray (const BoxArray& bxs, int nvar, int ngrow, FabAlloc alloc) : fabparray(0, PArrayManage) { define(bxs,nvar,ngrow,alloc); } template FabArray::~FabArray () {} template bool FabArray::ok () const { long isok = true; for (MFIter fai(*this); fai.isValid() && isok; ++fai) { if (fabparray.defined(fai.index())) { if (get(fai).box() != BoxLib::grow(box(fai.index()),n_grow)) { isok = false; } } else { isok = false; } } ParallelDescriptor::ReduceLongAnd(isok); return isok != 0; } template void FabArray::define (const BoxArray& bxs, int nvar, int ngrow, FabAlloc alloc) { BL_ASSERT(boxarray.size() == 0); n_grow = ngrow; n_comp = nvar; boxarray.define(bxs); distributionMap.define(boxarray,ParallelDescriptor::NProcsCFD()); fabparray.resize(bxs.size()); if (alloc == Fab_allocate) AllocFabs(); } template void FabArray::define (const BoxArray& bxs, int nvar, int ngrow, const DistributionMapping& dm, FabAlloc alloc) { BL_ASSERT(boxarray.size() == 0); n_grow = ngrow; n_comp = nvar; boxarray.define(bxs); distributionMap = dm; fabparray.resize(bxs.size()); if (alloc == Fab_allocate) AllocFabs(); } template void FabArray::AllocFabs () { for (MFIter fai(*this); fai.isValid(); ++fai) { Box tmp = BoxLib::grow(fai.validbox(), n_grow); fabparray.set(fai.index(), new FAB(tmp, n_comp)); } } template void FabArray::setFab (int boxno, FAB* elem) { // // Must check it is of the proper size. // if (n_comp == 0) n_comp = elem->nComp(); BL_ASSERT(n_comp == elem->nComp()); BL_ASSERT(boxarray.size() > 0); BL_ASSERT(elem->box() == BoxLib::grow(boxarray[boxno],n_grow)); BL_ASSERT(!fabparray.defined(boxno)); BL_ASSERT(distributionMap[boxno] == ParallelDescriptor::MyProc()); fabparray.set(boxno,elem); } template void FabArray::setBndry (value_type val) { setBndry(val, 0, n_comp); } template void FabArray::setBndry (value_type val, int strt_comp, int ncomp) { if (n_grow > 0) { for (MFIter fai(*this); fai.isValid(); ++fai) { get(fai).setComplement(val, fai.validbox(), strt_comp, ncomp); } } } template void FabArray::copy (const FabArray& src, int scomp, int dcomp, int ncomp) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::copy()"); if (boxarray == src.boxarray && distributionMap == src.distributionMap) { for (MFIter fai(*this); fai.isValid(); ++fai) { const Box& bx = fai.validbox(); get(fai).copy(src[fai],bx,scomp,bx,dcomp,ncomp); } return; } const int MyProc = ParallelDescriptor::MyProc(); const int NProcs = ParallelDescriptor::NProcs(); Array fab_data(NProcs); Array indx(NProcs); Array status(NProcs); Array reqs(NProcs); Array< std::vector > SndTags(NProcs); Array< std::vector > RcvTags(NProcs); FabComTag tag; for (int i = 0; i < size(); i++) { if (distributionMap[i] == MyProc) { for (int ii = 0; ii < src.boxarray.size(); ii++) { if (src.boxarray[ii].intersects(boxarray[i])) { Box bx = src.boxarray[ii] & boxarray[i]; if (src.distributionMap[ii] == MyProc) { fabparray[i].copy(src[ii],bx,scomp,bx,dcomp,ncomp); } else { tag.box = bx; tag.fabIndex = i; RcvTags[src.distributionMap[ii]].push_back(tag); } } } } else { for (int ii = 0; ii < src.boxarray.size(); ii++) { if (src.distributionMap[ii] == MyProc) { if (src.boxarray[ii].intersects(boxarray[i])) { tag.box = src.boxarray[ii] & boxarray[i]; tag.fabIndex = ii; SndTags[distributionMap[i]].push_back(tag); } } } } } if (NProcs == 1) return; const int seqno = ParallelDescriptor::SeqNum(); int NWaits = 0; // // Post one receive for each chunk being sent by other CPUs. // for (int i = 0; i < NProcs; i++) { reqs[i] = MPI_REQUEST_NULL; if (!RcvTags[i].empty()) { NWaits++; size_t N = 0; for (unsigned int j = 0; j < RcvTags[i].size(); j++) N += RcvTags[i][j].box.numPts() * ncomp; fab_data[i] = static_cast(BoxLib::The_Arena()->alloc(N*sizeof(value_type))); reqs[i] = ParallelDescriptor::Arecv(fab_data[i],N,i,seqno).req(); } } FAB fab; // // Send the agglomerated FAB data. // for (int i = 0; i < NProcs; i++) { if (!SndTags[i].empty()) { size_t N = 0; for (unsigned int j = 0; j < SndTags[i].size(); j++) N += SndTags[i][j].box.numPts() * ncomp; value_type* data = static_cast(BoxLib::The_Arena()->alloc(N*sizeof(value_type))); value_type* dptr = data; for (unsigned int j = 0; j < SndTags[i].size(); j++) { const Box& bx = SndTags[i][j].box; fab.resize(bx, ncomp); fab.copy(src[SndTags[i][j].fabIndex],bx,scomp,bx,0,ncomp); int count = bx.numPts() * ncomp; memcpy(dptr, fab.dataPtr(), count*sizeof(value_type)); dptr += count; } BL_ASSERT(data+N == dptr); ParallelDescriptor::Send(data, N, i, seqno); BoxLib::The_Arena()->free(data); } } // // Now receive and unpack FAB data. // for (int completed; NWaits > 0; NWaits -= completed) { ParallelDescriptor::Waitsome(reqs, completed, indx, status); for (int k = 0; k < completed; k++) { value_type* dptr = fab_data[indx[k]]; BL_ASSERT(!(dptr == 0)); for (unsigned int j = 0; j < RcvTags[indx[k]].size(); j++) { const Box& bx = RcvTags[indx[k]][j].box; fab.resize(bx, ncomp); int N = bx.numPts() * ncomp; memcpy(fab.dataPtr(), dptr, N*sizeof(value_type)); fabparray[RcvTags[indx[k]][j].fabIndex].copy(fab,bx,0,bx,dcomp,ncomp); dptr += N; } BoxLib::The_Arena()->free(fab_data[indx[k]]); } } } template void FabArray::copy (const FabArray& src) { copy(src,0,0,nComp()); } // // Copies to FABs, note that destination is first arg. // template void FabArray::copy (FAB& dest) const { copy(dest, dest.box(), 0, 0, dest.nComp()); } template void FabArray::copy (FAB& dest, const Box& subbox) const { copy(dest, subbox, 0, 0, dest.nComp()); } template void FabArray::copy (FAB& dest, int scomp, int dcomp, int ncomp) const { copy(dest, dest.box(), scomp, dcomp, ncomp); } template void FabArray::copy (FAB& dest, const Box& subbox, int scomp, int dcomp, int ncomp) const { BL_ASSERT(dcomp + ncomp <= dest.nComp()); BL_PROFILE(BL_PROFILE_THIS_NAME() + "::copy(Fab&, ...)"); if (ParallelDescriptor::NProcs() == 1) { for (int j = 0; j < size(); ++j) { if (boxarray[j].intersects(subbox)) { Box destbox = boxarray[j] & subbox; dest.copy(fabparray[j],destbox,scomp,destbox,dcomp,ncomp); } } return; } FArrayBox ovlp; for (int i = 0; i < size(); i++) { if (subbox.intersects(boxarray[i])) { Box bx = subbox & boxarray[i]; ovlp.resize(bx,ncomp); if (ParallelDescriptor::MyProc() == distributionMap[i]) { ovlp.copy(fabparray[i],bx,scomp,bx,0,ncomp); } const int N = bx.numPts()*ncomp; ParallelDescriptor::Bcast(ovlp.dataPtr(),N,distributionMap[i]); dest.copy(ovlp,bx,0,bx,dcomp,ncomp); } } } template void FabArray::setVal (value_type val) { for (MFIter fai(*this); fai.isValid(); ++fai) { get(fai).setVal(val); } } template inline void FabArray::operator= (const value_type& val) { setVal(val); } template void FabArray::setVal (value_type val, int comp, int ncomp, int nghost) { BL_ASSERT(nghost >= 0 && nghost <= n_grow); BL_ASSERT(comp+ncomp <= n_comp); for (MFIter fai(*this); fai.isValid(); ++fai) { get(fai).setVal(val,BoxLib::grow(fai.validbox(),nghost), comp, ncomp); } } template void FabArray::setVal (value_type val, const Box& region, int comp, int ncomp, int nghost) { BL_ASSERT(nghost >= 0 && nghost <= n_grow); BL_ASSERT(comp+ncomp <= n_comp); for (MFIter fai(*this); fai.isValid(); ++fai) { Box b = BoxLib::grow(fai.validbox(),nghost) & region; if (b.ok()) get(fai).setVal(val, b, comp, ncomp); } } template void FabArray::shift (const IntVect& v) { for(int id(0); id < BL_SPACEDIM; ++id) { boxarray.shift(id, v[id]); } for (MFIter fai(*this); fai.isValid(); ++fai) { get(fai).shift(v); } } template FabArrayCopyDescriptor::FabArrayCopyDescriptor () : nextFillBoxId(0), dataAvailable(false) {} template FabArrayId FabArrayCopyDescriptor::RegisterFabArray(FabArray* fabarray) { BL_ASSERT(fabArrays.size() == fabCopyDescList.size()); fabArrays.push_back(fabarray); /* Bump size() by one */ fabCopyDescList.resize(fabArrays.size(), FCDMap()); return FabArrayId(fabArrays.size() - 1); } template void FabArrayCopyDescriptor::AddBoxDoIt (FabArrayId fabarrayid, const Box& destFabBox, BoxList* returnedUnfilledBoxes, int faindex, int srccomp, int destcomp, int numcomp, bool bUseValidBox, BoxDomain& unfilledBoxDomain, BoxList& filledBoxes) { const int MyProc = ParallelDescriptor::MyProc(); FabArray* fabArray = fabArrays[fabarrayid.Id()]; BL_ASSERT(faindex >= 0 && faindex < fabArray->size()); Box intersect = destFabBox; if (bUseValidBox) { intersect &= fabArray->box(faindex); } else { intersect &= fabArray->fabbox(faindex); } if (intersect.ok()) { filledBoxes.push_back(intersect); FabCopyDescriptor* fcd = new FabCopyDescriptor; int remoteProc = fabArray->DistributionMap()[faindex]; fcd->fillBoxId = nextFillBoxId; fcd->subBox = intersect; fcd->myProc = MyProc; fcd->copyFromProc = remoteProc; fcd->copyFromIndex = faindex; fcd->srcComp = srccomp; fcd->destComp = destcomp; fcd->nComp = numcomp; if (MyProc == remoteProc) { // // Data is local. // fcd->fillType = FillLocally; fcd->localFabSource = &(*fabArray)[faindex]; } else { // // Data is remote. // FabComTag fabComTag; dataAvailable = false; fcd->fillType = FillRemotely; fcd->localFabSource = new FAB(intersect, numcomp); fcd->cacheDataAllocated = true; fabComTag.fabArrayId = fabarrayid.Id(); fabComTag.fillBoxId = nextFillBoxId; fabComTag.fabIndex = faindex; fabComTag.procThatNeedsData = MyProc; fabComTag.procThatHasData = remoteProc; fabComTag.box = intersect; fabComTag.srcComp = srccomp; fabComTag.destComp = destcomp; fabComTag.nComp = numcomp; // // Do not send the data yet. // fabComTagList.push_back(fabComTag); } fabCopyDescList[fabarrayid.Id()].insert(FCDMapValueType(fcd->fillBoxId,fcd)); if (!(returnedUnfilledBoxes == 0)) { unfilledBoxDomain.rmBox(intersect); } } } template FillBoxId FabArrayCopyDescriptor::AddBox (FabArrayId fabarrayid, const Box& destFabBox, BoxList* returnedUnfilledBoxes, int srccomp, int destcomp, int numcomp, bool bUseValidBox) { BoxDomain unfilledBoxDomain(destFabBox.ixType()); BoxList filledBoxes(destFabBox.ixType()); if (!(returnedUnfilledBoxes == 0)) { unfilledBoxDomain.add(destFabBox); } for (int i = 0, N = fabArrays[fabarrayid.Id()]->size(); i < N; i++) { AddBoxDoIt(fabarrayid, destFabBox, returnedUnfilledBoxes, i, srccomp, destcomp, numcomp, bUseValidBox, unfilledBoxDomain, filledBoxes); } if (!(returnedUnfilledBoxes == 0)) { returnedUnfilledBoxes->clear(); (*returnedUnfilledBoxes) = unfilledBoxDomain.boxList(); } return FillBoxId(nextFillBoxId++, destFabBox); } template FillBoxId FabArrayCopyDescriptor::AddBox (FabArrayId fabarrayid, const Box& destFabBox, BoxList* returnedUnfilledBoxes, int fabarrayindex, int srccomp, int destcomp, int numcomp, bool bUseValidBox) { BoxDomain unfilledBoxDomain(destFabBox.ixType()); BoxList filledBoxes(destFabBox.ixType()); if (!(returnedUnfilledBoxes == 0)) { unfilledBoxDomain.add(destFabBox); } AddBoxDoIt(fabarrayid, destFabBox, returnedUnfilledBoxes, fabarrayindex, srccomp, destcomp, numcomp, bUseValidBox, unfilledBoxDomain, filledBoxes); if (!(returnedUnfilledBoxes == 0)) { returnedUnfilledBoxes->clear(); (*returnedUnfilledBoxes) = unfilledBoxDomain.boxList(); } return FillBoxId(nextFillBoxId++, destFabBox); } template FillBoxId FabArrayCopyDescriptor::AddBox (FabArrayId fabarrayid, const Box& destFabBox, BoxList* returnedUnfilledBoxes, bool bUseValidBox) { return AddBox(fabarrayid, destFabBox, returnedUnfilledBoxes, 0, 0, fabArrays[fabarrayid.Id()]->nComp(), bUseValidBox); } template FabArrayCopyDescriptor::~FabArrayCopyDescriptor() { clear(); } template void FabArrayCopyDescriptor::clear () { for (unsigned int i = 0; i < fabCopyDescList.size(); ++i) { FCDMapIter fmi = fabCopyDescList[i].begin(); for ( ; fmi != fabCopyDescList[i].end(); ++fmi) { delete (*fmi).second; } } fabArrays.clear(); fabCopyDescList.clear(); fabComTagList.clear(); nextFillBoxId = 0; dataAvailable = false; } template void FabArrayCopyDescriptor::CollectData (Array* snd_cache, CommDataCache* cd_cache) { typedef typename FAB::value_type value_type; dataAvailable = true; const int NProcs = ParallelDescriptor::NProcs(); if (NProcs == 1) return; BL_PROFILE(BL_PROFILE_THIS_NAME() + "::CollectData()"); const int MyProc = ParallelDescriptor::MyProc(); const int seqno_1 = ParallelDescriptor::SeqNum(); const int seqno_2 = ParallelDescriptor::SeqNum(); Array recv_cd; Array senddata; Array Snds(NProcs,0); Array Rcvs(NProcs,0); Array indx(NProcs); Array fab_data(NProcs); Array req_data(NProcs,MPI_REQUEST_NULL); Array req_cd(NProcs,MPI_REQUEST_NULL); Array status(NProcs); int idx = 0, NumReqs = 0, NWaits; // // Set Rcvs[i] to # of blocks needed from CPU i // for (unsigned int i = 0; i < fabComTagList.size(); i++) { BL_ASSERT(fabComTagList[i].box.ok()); BL_ASSERT(fabComTagList[i].procThatNeedsData == MyProc); BL_ASSERT(fabComTagList[i].procThatHasData != MyProc); Rcvs[fabComTagList[i].procThatHasData]++; } BL_ASSERT(Rcvs[MyProc] == 0); // // Set Snds[i] to # of blocks we must send to CPU i ... // #ifdef NDEBUG if (snd_cache == 0 || snd_cache->size() == 0) #endif { for (int i = 0; i < NProcs; i++) { ParallelDescriptor::Gather(&Rcvs[i], 1, Snds.dataPtr(), 1, i); } BL_ASSERT(Snds[MyProc] == 0); } if (snd_cache) { if (snd_cache->size() > 0) { BL_ASSERT(Snds == *snd_cache); Snds = *snd_cache; } else { *snd_cache = Snds; } } for (int i = 0; i < NProcs; i++) NumReqs += Snds[i]; recv_cd.resize(NumReqs); // // Post one receive for each chunk being requested by other CPUs. // This is the CommData describing what FAB data needs to be sent. // #ifdef NDEBUG if (cd_cache == 0 || !cd_cache->isValid()) #endif { // // Make sure we can treat CommData as a stream of integers. // BL_ASSERT(sizeof(CommData) == CommData::DIM*sizeof(int)); for (int i = 0; i < NProcs; i++) { if (Snds[i] > 0) { int* D = reinterpret_cast(&recv_cd[idx]); const int N = Snds[i] * CommData::DIM; req_cd[i] = ParallelDescriptor::Arecv(D,N,i,seqno_1).req(); idx += Snds[i]; } } BL_ASSERT(idx == NumReqs); // // Make one send to each CPU from which we want data. // Start Send()ing to upper neighbor. // for (int k = 0, i = MyProc+1; k < NProcs; k++, i++) { i %= NProcs; if (Rcvs[i] > 0) { senddata.resize(Rcvs[i]); int Processed = 0; for (unsigned int j = 0; j < fabComTagList.size(); j++) { if (fabComTagList[j].procThatHasData == i) { CommData data(0, fabComTagList[j].fabIndex, MyProc, 0, fabComTagList[j].nComp, fabComTagList[j].srcComp, fabComTagList[j].fabArrayId, fabComTagList[j].box); senddata[Processed++] = data; } } BL_ASSERT(Processed == Rcvs[i]); int* D = reinterpret_cast(senddata.dataPtr()); const int N = senddata.size() * CommData::DIM; ParallelDescriptor::Send(D, N, i, seqno_1); } } NWaits = 0; for (int i = 0; i < NProcs; i++) if (req_cd[i] != MPI_REQUEST_NULL) NWaits++; for (int completed; NWaits > 0; NWaits -= completed) { ParallelDescriptor::Waitsome(req_cd, completed, indx, status); } } if (cd_cache) { if (cd_cache->isValid()) { BL_ASSERT(recv_cd == cd_cache->theCommData()); recv_cd = cd_cache->theCommData(); } else { *cd_cache = recv_cd; } } // // Post one receive for data being requested by other CPUs. // for (int i = 0; i < NProcs; i++) { if (Rcvs[i] > 0) { // // Got to figure out # of T's to expect from each CPU. // size_t N = 0; for (unsigned int j = 0; j < fabComTagList.size(); j++) if (fabComTagList[j].procThatHasData == i) N += fabComTagList[j].box.numPts()*fabComTagList[j].nComp; fab_data[i] = static_cast(BoxLib::The_Arena()->alloc(N*sizeof(value_type))); req_data[i] = ParallelDescriptor::Arecv(fab_data[i],N,i,seqno_2).req(); } } // // Send the agglomerated FAB data. Start Send()ing to upper neighbor. // idx = 0; FAB fab; for (int k = 0, i = MyProc+1; k < NProcs; k++, i++) { i %= NProcs; int strt = 0; for (int j = 0; j < i; j++) strt += Snds[j]; if (Snds[i] > 0) { size_t N = 0; for (int j = 0; j < Snds[i]; j++) N += recv_cd[strt+j].box().numPts() * recv_cd[strt+j].nComp(); value_type* data = static_cast(BoxLib::The_Arena()->alloc(N*sizeof(value_type))); value_type* dptr = data; for (int j = 0; j < Snds[i]; j++) { const CommData& cd = recv_cd[strt+j]; BL_ASSERT(cd.id() == 0); BL_ASSERT(cd.fromproc() == i); fab.resize(cd.box(), cd.nComp()); int count = fab.box().numPts() * fab.nComp(); fab.copy((*fabArrays[cd.fabarrayid()])[cd.fabindex()], fab.box(), cd.srcComp(), fab.box(), 0, cd.nComp()); memcpy(dptr, fab.dataPtr(), count*sizeof(value_type)); dptr += count; } BL_ASSERT(data+N == dptr); ParallelDescriptor::Send(data, N, i, seqno_2); BoxLib::The_Arena()->free(data); idx += Snds[i]; } } BL_ASSERT(idx == NumReqs); // // Now receive and unpack FAB data. // std::pair match; NWaits = 0; for (int i = 0; i < NProcs; i++) if (req_data[i] != MPI_REQUEST_NULL) NWaits++; for (int completed; NWaits > 0; NWaits -= completed) { ParallelDescriptor::Waitsome(req_data, completed, indx, status); for (int k = 0; k < completed; k++) { int Processed = 0; value_type* dptr = fab_data[indx[k]]; BL_ASSERT(!(dptr == 0)); for (unsigned int j = 0; j < fabComTagList.size(); j++) { if (fabComTagList[j].procThatHasData == indx[k]) { const FabComTag& tag = fabComTagList[j]; match = fabCopyDescList[tag.fabArrayId].equal_range(tag.fillBoxId); FCDMapIter fmi = match.first; for ( ; fmi != match.second; ++fmi) { FabCopyDescriptor* fcdp = (*fmi).second; BL_ASSERT(fcdp->fillBoxId == tag.fillBoxId); if (fcdp->subBox == tag.box) { value_type* dataPtr = fcdp->localFabSource->dataPtr(); BL_ASSERT(!(dataPtr == 0)); BL_ASSERT(fcdp->localFabSource->box() == tag.box); int N = tag.box.numPts()*tag.nComp; memcpy(dataPtr, dptr, N*sizeof(value_type)); dptr += N; Processed++; break; } } BL_ASSERT(!(fmi == match.second)); } } BL_ASSERT(Processed == Rcvs[indx[k]]); BoxLib::The_Arena()->free(fab_data[indx[k]]); } } } template void FabArrayCopyDescriptor::FillFab (FabArrayId faid, const FillBoxId& fillboxid, FAB& destFab) { BL_ASSERT(dataAvailable); std::pair match = fabCopyDescList[faid.Id()].equal_range(fillboxid.Id()); for (FCDMapIter fmi = match.first; fmi != match.second; ++fmi) { FabCopyDescriptor* fcdp = (*fmi).second; BL_ASSERT(fcdp->fillBoxId == fillboxid.Id()); destFab.copy(*fcdp->localFabSource, fcdp->subBox, fcdp->fillType == FillLocally ? fcdp->srcComp : 0, fcdp->subBox, fcdp->destComp, fcdp->nComp); } } template void FabArrayCopyDescriptor::FillFab (FabArrayId faid, const FillBoxId& fillboxid, FAB& destFab, const Box& destBox) { BL_ASSERT(dataAvailable); FCDMapIter fmi = fabCopyDescList[faid.Id()].lower_bound(fillboxid.Id()); BL_ASSERT(!(fmi == fabCopyDescList[faid.Id()].end())); FabCopyDescriptor* fcdp = (*fmi).second; BL_ASSERT(fcdp->fillBoxId == fillboxid.Id()); BL_ASSERT(fcdp->subBox.sameSize(destBox)); destFab.copy(*fcdp->localFabSource, fcdp->subBox, fcdp->fillType == FillLocally ? fcdp->srcComp : 0, destBox, fcdp->destComp, fcdp->nComp); BL_ASSERT(++fmi == fabCopyDescList[faid.Id()].upper_bound(fillboxid.Id())); } template void FabArrayCopyDescriptor::PrintStats () const { const int MyProc = ParallelDescriptor::MyProc(); std::cout << "----- " << MyProc << ": Parallel stats for FabArrayCopyDescriptor:" << '\n'; for (int fa = 0; fa < fabArrays.size(); ++fa) { std::cout << "fabArrays[" << fa << "]->boxArray() = " << fabArrays[fa]->boxArray() << '\n'; } } #endif /*BL_FABARRAY_H*/ ccseapps-2.5/CCSEApps/BoxLib/BLThread.cpp0000644000175000017500000005032511634153073021174 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BLThread.cpp,v 1.35 2002/04/15 20:12:26 car Exp $ // #include #include #include #include #ifdef WIN32 #define _WIN32_WINNT 0x0400 #include #else #include #include #include #include #ifdef BL_THREADS #include #endif #endif #include #include #include #include #include #include #include //#if defined(BL_OSF1) //extern "C" int usleep (useconds_t); //#endif namespace { const char* the_message_string(const char* file, int line, const char* call, int status = 0) { // // Should be large enough. // const int DIM = 1024; static char buf[DIM]; if ( status ) { std::sprintf(buf, "BoxLib Thread Error: File %s, line %d, %s: %s", file, line, call, std::strerror(status)); } else { std::sprintf(buf, "BoxLib Thread Error: File %s, line %d, %s", file, line, call); } buf[DIM-1] = '\0'; // Just to be safe. return buf; } ThreadSpecificData ts_tid; Mutex tid_lock; int thread_counter = 0; } namespace BoxLib { void Thread_Error(const char* file, int line, const char* call, int status = 0) { Error(the_message_string(file, line, call,status)); } } #define THREAD_REQUIRE(x) \ do \ { \ if ( int status = (x) ) \ { \ BoxLib::Thread_Error(__FILE__, __LINE__, #x, status); \ } \ } \ while ( false ) #define THREAD_ASSERT(x) \ do \ { \ if ( !(x) ) \ { \ BoxLib::Thread_Error(__FILE__,__LINE__,#x ); \ } \ } \ while ( false ) // Posix: #ifdef BL_THREADS #ifdef WIN32 class Mutex::Implementation { public: Implementation(); ~Implementation(); void lock(); void unlock(); bool trylock(); protected: #if 0 HANDLE m_mutex; #else CRITICAL_SECTION m_mutex; #endif }; class ConditionVariable::Implementation : public Mutex::Implementation { public: Implementation(); ~Implementation(); void signal(); void broadcast(); void wait(); private: enum { SIGNAL=0, BROADCAST=1, MAX_EVENTS=2}; int m_wc; CRITICAL_SECTION m_wcl; HANDLE m_events[MAX_EVENTS]; }; #else // //Mutex // class Mutex::Implementation { public: Implementation (); ~Implementation (); void lock (); bool trylock (); void unlock (); protected: friend class ConditionVariable::Implementation; pthread_mutex_t m_mutex; }; class ConditionVariable::Implementation : public Mutex::Implementation { public: Implementation (); ~Implementation (); void signal (); void broadcast (); void wait (); protected: pthread_cond_t m_cv; }; #endif #endif void Thread::sleep(const BoxLib::Time& spec_) { #ifdef WIN32 #else ::sleep(spec_.as_long()); #endif } // // Barrier // Barrier::Barrier(int i) : count(0), n_sleepers(0), releasing(false) { init(i); } void Barrier::init(int i) { THREAD_ASSERT( !releasing ); THREAD_ASSERT( n_sleepers == 0 ); count = i; } void Barrier::wait() { BL_PROFILE( BL_PROFILE_THIS_NAME() + "::wait()" ); bool release = false; lock(); // If previous cycle still releasing, wait // THREAD_ASSERT ( !releasing ); while ( releasing ) { ConditionVariable::wait(); } if ( ++n_sleepers == count ) { release = releasing = true; } else { // A poor thread cancelation Site Thread::CancelState tmp = Thread::setCancelState(Thread::Disable); while ( !releasing ) { ConditionVariable::wait(); } Thread::setCancelState(tmp); } if ( --n_sleepers == 0 ) { releasing = false; release = true; // Wake up waiters (if any) for next cycle } unlock(); if ( release ) { broadcast(); } } // // Semaphore // Semaphore::Semaphore(int val_) : value(val_) { } void Semaphore::wait() { BL_PROFILE( BL_PROFILE_THIS_NAME() + "::wait()" ); lock(); while ( value == 0 ) { ConditionVariable::wait(); } value--; unlock(); } bool Semaphore::trywait() { lock(); if ( value == 0 ) { unlock(); return false; } value--; unlock(); return true; } void Semaphore::post() { lock(); value++; unlock(); signal(); } // // // SemaphoreB::SemaphoreB(int val_) : val(val_) {} int SemaphoreB::down() { lock(); while (val <= 0) { wait(); } int t = --val; unlock(); return t; } int SemaphoreB::up() { lock(); int t = ++val; unlock(); signal(); return t; } int SemaphoreB::decrement() { lock(); int t = --val; unlock(); return t; } int SemaphoreB::value() { lock(); int t = val; unlock(); return t; } // // SingleBarrier // SingleBarrier::SingleBarrier(int i) : count(i), n_posters(0), n_waiters(0), releasing(false) { } void SingleBarrier::wait() { bool release = false; lock(); n_waiters++; while ( !releasing ) { ConditionVariable::wait(); } if ( --n_waiters == 0 ) { releasing = false; release = true; // Wake up waiters (if any) for next cycle n_posters=0; } unlock(); if ( release ) { broadcast(); } } void SingleBarrier::post() { bool release = false; lock(); // If previous cycle still releasing, wait while ( releasing ) { ConditionVariable::wait(); } if ( ++n_posters == count ) { releasing = true; release = true; // Wake up waiters (if any) for next cycle } unlock(); if ( release ) { broadcast(); } } // //Gate // Gate::Gate() : closed(true) { } void Gate::open() { lock(); closed = false; broadcast(); unlock(); } void Gate::close() { lock(); closed = true; unlock(); } void Gate::release() { broadcast(); } void Gate::wait() { BL_PROFILE( BL_PROFILE_THIS_NAME() + "::wait()" ); lock(); while ( closed ) { ConditionVariable::wait(); } unlock(); } // // Lock specialization // Lock::Lock(Semaphore& sem_) : sem(sem_) { sem.wait(); } Lock::~Lock() { sem.post(); } #ifdef BL_THREADS namespace { extern "C" { typedef void* (*thr_vpvp)(void*); typedef void (*thr_vvp)(void*); } } // // Thread // int Thread::getID() { // This works because FunctionThread creates ts_tid values on the worker threads. int* a = ts_tid.get(); if ( a == 0 ) { ts_tid.set(a = new int(0)); } return *a; } bool Thread::baseThread () { return getID() == 0; } #ifdef WIN32 Thread::CancelState Thread::setCancelState(CancelState cs) { return cs; } unsigned long Thread::max_threads() { return 32; // No real limit. } #else unsigned long Thread::max_threads() { #ifdef PTHREAD_THREADS_MAX BL_ASSERT( PTHREAD_THREADS_MAX >= 0 ); return PTHREAD_THREADS_MAX; #else return 64; #endif } void Thread::exit(void* st) { pthread_exit(st); } void Thread::yield() { #ifdef _POSIX_PRIORITY_SCHEDULING sched_yield(); #endif } Thread::CancelState Thread::setCancelState(CancelState state) { CancelState result; int newstate; switch ( state ) { case Enable: newstate = PTHREAD_CANCEL_ENABLE; break; case Disable: newstate = PTHREAD_CANCEL_DISABLE; break; } int oldstate; THREAD_REQUIRE( pthread_setcancelstate(newstate, &oldstate) ); switch ( oldstate ) { case PTHREAD_CANCEL_ENABLE: result = Enable; break; case PTHREAD_CANCEL_DISABLE: result = Disable; break; } return result; } #endif #ifdef WIN32 Mutex::Implementation::Implementation() { #if 0 m_mutex = CreateMutex(NULL,FALSE,NULL); #else InitializeCriticalSection(&m_mutex); #endif } Mutex::Implementation::~Implementation() { #if 0 CloseHandle(m_mutex); #else DeleteCriticalSection(&m_mutex); #endif } void Mutex::Implementation::lock () { #if 0 DWORD result = WaitForSingleObject(m_mutex, INFINITE); if ( result != WAIT_OBJECT_0 ) { BoxLib::Error("Mutex::Implementation::lock(): failed"); } #else EnterCriticalSection(&m_mutex); #endif } void Mutex::Implementation::unlock () { #if 0 ReleaseMutex(m_mutex); #else LeaveCriticalSection(&m_mutex); #endif } bool Mutex::Implementation::trylock () { #if 0 DWORD result = WaitForSingleObject(m_mutex, 0); switch ( result ) { case WAIT_TIMEOUT: return false; case WAIT_ABANDONED: return false; } return true; #else #ifdef DEBUG OSVERSIONINFO vi = { sizeof(vi) }; GetVersionEx(&vi); if (vi.dwPlatformId != VER_PLATFORM_WIN32_NT) { BoxLib::Error("trylock requires windows NT"); } #endif return TryEnterCriticalSection(&m_mutex) != 0; #endif } #else Mutex::Implementation::Implementation() { THREAD_REQUIRE( pthread_mutex_init(&m_mutex, 0) ); } Mutex::Implementation::~Implementation() { THREAD_REQUIRE( pthread_mutex_destroy(&m_mutex) ); } void Mutex::Implementation::lock() { THREAD_REQUIRE( pthread_mutex_lock(&m_mutex) ); } bool Mutex::Implementation::trylock() { int status = pthread_mutex_trylock(&m_mutex); if ( status == 0 ) return true; if ( status == EBUSY ) return false; BoxLib::Thread_Error(__FILE__,__LINE__,"pthread_mutex_trylock(&m_mutex)", status); return false; } void Mutex::Implementation::unlock() { THREAD_REQUIRE( pthread_mutex_unlock(&m_mutex) ); } #endif Mutex::Mutex() { m_impl = new Implementation; } Mutex::~Mutex() { delete m_impl; } void Mutex::lock() { m_impl->lock(); } bool Mutex::trylock() { return m_impl->trylock(); } void Mutex::unlock() { m_impl->unlock(); } // // ConditionVariable // #ifdef WIN32 ConditionVariable::Implementation::Implementation() { m_wc = 0; InitializeCriticalSection(&m_wcl); m_events[SIGNAL] = CreateEvent(NULL, FALSE, FALSE, NULL); m_events[BROADCAST] = CreateEvent(NULL, TRUE, FALSE, NULL); } ConditionVariable::Implementation::~Implementation() { CloseHandle(m_events[SIGNAL]); CloseHandle(m_events[BROADCAST]); DeleteCriticalSection(&m_wcl); } void ConditionVariable::Implementation::wait() { EnterCriticalSection(&m_wcl); m_wc++; LeaveCriticalSection(&m_wcl); unlock(); int result = WaitForMultipleObjects(2, m_events, FALSE, INFINITE); EnterCriticalSection(&m_wcl); m_wc--; bool lw = result == WAIT_OBJECT_0 + BROADCAST && m_wc == 0; LeaveCriticalSection(&m_wcl); if ( lw ) { ResetEvent(m_events[BROADCAST]); } lock(); } void ConditionVariable::Implementation::signal() { EnterCriticalSection(&m_wcl); bool hw = m_wc > 0; LeaveCriticalSection(&m_wcl); if ( hw ) { SetEvent(m_events[SIGNAL]); } } void ConditionVariable::Implementation::broadcast() { EnterCriticalSection(&m_wcl); bool hw = m_wc>0; LeaveCriticalSection(&m_wcl); if ( hw ) { SetEvent(m_events[BROADCAST]); } } #else ConditionVariable::Implementation::Implementation() { THREAD_REQUIRE( pthread_cond_init(&m_cv, 0) ); } ConditionVariable::Implementation::~Implementation() { THREAD_REQUIRE( pthread_cond_destroy(&m_cv) ); } void ConditionVariable::Implementation::signal() { THREAD_REQUIRE( pthread_cond_signal(&m_cv) ); } void ConditionVariable::Implementation::broadcast() { THREAD_REQUIRE( pthread_cond_broadcast(&m_cv) ); } void ConditionVariable::Implementation::wait() { THREAD_REQUIRE( pthread_cond_wait(&m_cv, &m_mutex) ); } #endif ConditionVariable::ConditionVariable() { m_impl = new Implementation(); } ConditionVariable::~ConditionVariable() { delete m_impl; } void ConditionVariable::signal() { m_impl->signal(); } void ConditionVariable::broadcast() { m_impl->broadcast(); } void ConditionVariable::wait() { m_impl->wait(); } void ConditionVariable::lock () { m_impl->lock(); } void ConditionVariable::unlock () { m_impl->unlock(); } bool ConditionVariable::trylock () { return m_impl->trylock(); } // //Thread Specific Data // #ifdef WIN32 class ThreadSpecificData::Implementation { public: Implementation(void (*tsd)(void*)); ~Implementation(); void* set (const void* v); void* get () const; private: DWORD m_key; }; ThreadSpecificData::Implementation::Implementation(void (*tsd)(void*)) { m_key = TlsAlloc(); } ThreadSpecificData::Implementation::~Implementation() { TlsFree(m_key); } void* ThreadSpecificData::Implementation::set(const void* v) { void* ov = TlsGetValue(m_key); TlsSetValue(m_key, const_cast(v)); return ov; } void* ThreadSpecificData::Implementation::get() const { return TlsGetValue(m_key); } #else class ThreadSpecificData::Implementation { public: Implementation(void (*tsd)(void*)); ~Implementation(); void* set (const void* v); void* get () const; private: pthread_key_t m_key; }; ThreadSpecificData::Implementation::Implementation(void (*tsd)(void*)) { //printf("%p: ThreadSpecificData::Implementation::Implementation()\n",this); THREAD_REQUIRE( pthread_key_create(&m_key, reinterpret_cast(tsd)) ); THREAD_ASSERT(get() == 0); } ThreadSpecificData::Implementation::~Implementation() { //printf("%p: ThreadSpecificData::Implementation::~Implementation()\n",this); THREAD_REQUIRE( pthread_key_delete(m_key) ); } void* ThreadSpecificData::Implementation::set(const void* v) { //printf("%p: ThreadSpecificData::Implementation::set(%p)\n",this,v); void* ov = pthread_getspecific(m_key); THREAD_REQUIRE( pthread_setspecific(m_key, v) ); return ov; } void* ThreadSpecificData::Implementation::get() const { void* v = pthread_getspecific(m_key); //printf("%p: ThreadSpecificData::Implementation::get(%p)\n",this,v); return v; } #endif ThreadSpecificData::ThreadSpecificData(void (*tsd)(void*)) { m_impl = new Implementation(tsd); } ThreadSpecificData::~ThreadSpecificData() { delete m_impl; } void* ThreadSpecificData::set(const void* v) { return m_impl->set(v); } void* ThreadSpecificData::get() const { return m_impl->get(); } struct thr_package { Thread_Function m_func; void* m_arg; }; extern "C" void* thr_func(void* arg_) { thr_package* tp = static_cast(arg_); Thread_Function func = tp->m_func; void* arg = tp->m_arg; delete tp; int* a = new int; { Lock l(tid_lock); *a = ++thread_counter; } // Initially the TS must be NULL THREAD_ASSERT( ts_tid.set(a) == 0 ); return (*func)(arg); } #ifdef WIN32 #include class FunctionThread::Implementation { public: Implementation (Thread_Function func_, void* arg_, DetachState st_, int stacksize); ~Implementation (); void* join() const; void detach() const; private: HANDLE m_tid; mutable bool m_jod; }; FunctionThread::Implementation::Implementation(Thread_Function func_, void* arg_, DetachState st_, int stacksize) { m_tid = (HANDLE) _beginthreadex(0, stacksize, reinterpret_cast(func_),arg_,0,0); } void* FunctionThread::Implementation::join() const { if ( WaitForSingleObject(m_tid, INFINITE) != WAIT_OBJECT_0 ) { CloseHandle(m_tid); } return 0; } FunctionThread::Implementation::~Implementation() { detach(); } void FunctionThread::Implementation::detach() const { if ( m_tid != 0) { CloseHandle(m_tid); } } #else class FunctionThread::Implementation { public: Implementation (Thread_Function func_, void* arg_, DetachState st_, int stacksize); ~Implementation (); void* join() const; void detach() const; private: mutable bool m_jod; pthread_t m_tid; }; FunctionThread::Implementation::Implementation(Thread_Function func_, void* arg_, DetachState st_, int stacksize) : m_jod(false) { BL_PROFILE( BL_PROFILE_THIS_NAME() + "::FunctionThread()" ); pthread_attr_t a; THREAD_REQUIRE( pthread_attr_init(&a)); #if defined( PTHREAD_STACK_MIN ) if (stacksize > PTHREAD_STACK_MIN) { THREAD_REQUIRE(pthread_attr_setstacksize(&a,stacksize)); } #else THREAD_REQUIRE(pthread_attr_setstacksize(&a,stacksize)); #endif int dstate; switch ( st_ ) { case Detached: m_jod = true; dstate = PTHREAD_CREATE_DETACHED; break; case Joinable: m_jod = false; dstate = PTHREAD_CREATE_JOINABLE; break; } THREAD_REQUIRE( pthread_attr_setdetachstate(&a, dstate) ); thr_package* tp = new thr_package; tp->m_func = func_; tp->m_arg = arg_; THREAD_REQUIRE( pthread_create(&m_tid, &a, thr_func, static_cast(tp)) ); } FunctionThread::Implementation::~Implementation() { detach(); } void* FunctionThread::Implementation::join() const { BL_PROFILE( BL_PROFILE_THIS_NAME() + "::join()" ); void* ret; if ( !m_jod ) { THREAD_REQUIRE( pthread_join(m_tid, &ret) ); m_jod = true; } return ret; } void FunctionThread::Implementation::detach() const { BL_PROFILE( BL_PROFILE_THIS_NAME() + "::detach()" ); if ( !m_jod ) { THREAD_REQUIRE( pthread_detach(m_tid) ); } m_jod = true; } #endif FunctionThread::FunctionThread(Thread_Function func_, void* arg_, DetachState st, int stacksize) { m_impl = new Implementation(func_, arg_, st, stacksize); } FunctionThread::~FunctionThread() { delete m_impl; } void* FunctionThread::join() const { return m_impl->join(); } void FunctionThread::detach() const { m_impl->detach(); } #else void Thread::exit(void*) { std::exit(0); } Thread::CancelState Thread::setCancelState(CancelState) { return Enable; } // // // class ThreadSpecificData::Implementation { public: Implementation(void (*tsd_)(void*)); ~Implementation(); void* set(const void* v_); void* get() const; void* v; void (*tsd)(void*); }; ThreadSpecificData::Implementation::Implementation(void (*tsd_)(void*)) : v(0), tsd(tsd_) { } ThreadSpecificData::Implementation::~Implementation() { } void* ThreadSpecificData::Implementation::set(const void* v_) { return v = const_cast(v_); } void* ThreadSpecificData::Implementation::get() const { return v; } ThreadSpecificData::ThreadSpecificData(void (*tsd_)(void*)) { m_impl = new Implementation(tsd_); } ThreadSpecificData::~ThreadSpecificData() { delete m_impl; } void* ThreadSpecificData::set(const void* v_) { return m_impl->set(v_); } void* ThreadSpecificData::get() const { return m_impl->get(); } // FuctioinThread FunctionThread::FunctionThread(Thread_Function func, void* arg_, DetachState st, int stacksize) { func(arg_); } FunctionThread::~FunctionThread() { detach(); } void* FunctionThread::join() const { return 0; } void FunctionThread::detach() const { } #endif ccseapps-2.5/CCSEApps/BoxLib/BoxList.cpp0000644000175000017500000003561611634153073021141 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BoxList.cpp,v 1.26 2001/08/06 19:40:27 car Exp $ // #include #include #include #include #include void BoxList::join (const BoxList& blist) { BL_ASSERT(ixType() == blist.ixType()); std::list lb = blist.lbox; lbox.splice(lbox.end(), lb); } void BoxList::catenate (BoxList& blist) { BL_ASSERT(ixType() == blist.ixType()); lbox.splice(lbox.end(), blist.lbox); BL_ASSERT(blist.isEmpty()); } bool BoxList::contains (const Box& b) const { BoxList bnew = BoxLib::complementIn(b,*this); return bnew.isEmpty(); } BoxList& BoxList::remove (const Box& bx) { BL_ASSERT(ixType() == bx.ixType()); lbox.remove(bx); return *this; } BoxList& BoxList::remove (iterator bli) { BL_ASSERT(ixType() == bli->ixType()); lbox.erase(bli); return *this; } BoxList BoxLib::intersect (const BoxList& bl, const Box& b) { BoxList newbl(bl); return newbl.intersect(b); } BoxList BoxLib::intersect (const BoxList& bl, const BoxList& br) { BoxList newbl(bl); return newbl.intersect(br); } BoxList BoxLib::refine (const BoxList& bl, int ratio) { BoxList nbl(bl); return nbl.refine(ratio); } BoxList BoxLib::coarsen (const BoxList& bl, int ratio) { BoxList nbl(bl); return nbl.coarsen(ratio); } BoxList BoxLib::accrete (const BoxList& bl, int sz) { BoxList nbl(bl); return nbl.accrete(sz); } bool BoxList::operator!= (const BoxList& rhs) const { return !operator==(rhs); } BoxList::BoxList () : lbox(), btype(IndexType::TheCellType()) {} BoxList::BoxList (const Box& bx) : btype(bx.ixType()) { push_back(bx); } BoxList::BoxList (IndexType _btype) : lbox(), btype(_btype) {} BoxList::BoxList (const BoxArray &ba) : lbox(), btype() { if (ba.size() > 0) btype = ba[0].ixType(); for (int i = 0; i < ba.size(); ++i) push_back(ba[i]); } bool BoxList::ok () const { bool isok = true; const_iterator bli = begin(); if ( bli != end() ) { for (Box b(*bli); bli != end() && isok; ++bli) { isok = bli->ok() && bli->sameType(b); } } return isok; } bool BoxList::isDisjoint () const { bool isdisjoint = true; for (const_iterator bli = begin(); bli != end() && isdisjoint; ++bli) { const_iterator bli2 = bli; // // Skip the first element. // ++bli2; for (; bli2 != end() && isdisjoint; ++bli2) { if (bli->intersects(*bli2)) { isdisjoint = false; } } } return isdisjoint; } bool BoxList::contains (const IntVect& v) const { bool contained = false; for (const_iterator bli = begin(); bli != end() && !contained; ++bli) { if (bli->contains(v)) { contained = true; } } return contained; } bool BoxList::contains (const BoxList& bl) const { for (const_iterator bli = bl.begin(); bli != bl.end(); ++bli) { if ( !contains(*bli) ) { return false; } } return true; } bool BoxList::contains (const BoxArray& ba) const { for (int i = 0; i < ba.size(); i++) if (!contains(ba[i])) return false; return true; } BoxList& BoxList::intersect (const Box& b) { for (iterator bli= begin(); bli != end(); ) { if (bli->intersects(b)) { *bli &= b; ++bli; } else { bli = lbox.erase(bli); } } return *this; } BoxList& BoxList::intersect (const BoxList& b) { BoxList bl; for (iterator lhs = begin(); lhs != end(); ++lhs) { for (const_iterator rhs = b.begin(); rhs != b.end(); ++rhs) { if ( lhs->intersects(*rhs) ) { bl.push_back(*lhs & *rhs); } } } *this = bl; return *this; } BoxList BoxLib::complementIn (const Box& b, const BoxList& bl) { BoxList newb(b.ixType()); newb.push_back(b); for (BoxList::const_iterator bli = bl.begin(); bli != bl.end() && newb.isNotEmpty(); ++bli) { for (BoxList::iterator newbli = newb.begin(); newbli != newb.end(); ) { if ( newbli->intersects(*bli)) { BoxList tm = BoxLib::boxDiff(*newbli, *bli); newb.catenate(tm); newb.remove(newbli++); } else { ++newbli; } } } return newb; } BoxList& BoxList::complementIn (const Box& b, const BoxList& bl) { clear(); push_back(b); for (const_iterator bli = bl.begin(); bli != bl.end() && isNotEmpty(); ++bli) { for (iterator newbli = lbox.begin(); newbli != lbox.end(); ) { if ( newbli->intersects(*bli) ) { BoxList tm = BoxLib::boxDiff(*newbli, *bli); lbox.splice(lbox.end(), tm.lbox); lbox.erase(newbli++); } else { ++newbli; } } } return *this; } BoxList& BoxList::refine (int ratio) { for (iterator bli = begin(); bli != end(); ++bli) { bli->refine(ratio); } return *this; } BoxList& BoxList::refine (const IntVect& ratio) { for (iterator bli = begin(); bli != end(); ++bli) { bli->refine(ratio); } return *this; } BoxList& BoxList::coarsen (int ratio) { for (iterator bli = begin(); bli != end(); ++bli) { bli->coarsen(ratio); } return *this; } BoxList& BoxList::coarsen (const IntVect& ratio) { for (iterator bli = begin(); bli != end(); ++bli) { bli->coarsen(ratio); } return *this; } BoxList& BoxList::accrete (int sz) { for (iterator bli = begin(); bli != end(); ++bli) { bli->grow(sz); } return *this; } BoxList& BoxList::shift (int dir, int nzones) { for (iterator bli = begin(); bli != end(); ++bli) { bli->shift(dir, nzones); } return *this; } BoxList& BoxList::shiftHalf (int dir, int num_halfs) { for (iterator bli = begin(); bli != end(); ++bli) { bli->shiftHalf(dir, num_halfs); } return *this; } BoxList& BoxList::shiftHalf (const IntVect& iv) { for (iterator bli = begin(); bli != end(); ++bli) { bli->shiftHalf(iv); } return *this; } // // Returns a list of boxes defining the compliment of b2 in b1in. // BoxList BoxLib::boxDiff (const Box& b1in, const Box& b2) { Box b1(b1in); BoxList b_list(b1.ixType()); if ( !b2.contains(b1) ) { if ( !b1.intersects(b2) ) { b_list.push_back(b1); } else { const int* b2lo = b2.loVect(); const int* b2hi = b2.hiVect(); for (int i = 0; i < BL_SPACEDIM; i++) { const int* b1lo = b1.loVect(); const int* b1hi = b1.hiVect(); if ((b1lo[i] < b2lo[i]) && (b2lo[i] <= b1hi[i])) { Box bn(b1); bn.setSmall(i,b1lo[i]); bn.setBig(i,b2lo[i]-1); b_list.push_back(bn); b1.setSmall(i,b2lo[i]); } if ((b1lo[i] <= b2hi[i]) && (b2hi[i] < b1hi[i])) { Box bn(b1); bn.setSmall(i,b2hi[i]+1); bn.setBig(i,b1hi[i]); b_list.push_back(bn); b1.setBig(i,b2hi[i]); } } } } return b_list; } int BoxList::simplify () { // // Try to merge adjacent boxes. // int count = 0; int lo[BL_SPACEDIM]; int hi[BL_SPACEDIM]; for (iterator bla = begin(); bla != end(); ) { const int* alo = bla->loVect(); const int* ahi = bla->hiVect(); bool match = false; iterator blb = bla; ++blb; while ( blb != end() ) { const int* blo = blb->loVect(); const int* bhi = blb->hiVect(); // // Determine of a and b can be coalasced. // They must have equal extents in all index direciton // except possibly one and must abutt in that direction. // bool canjoin = true; int joincnt = 0; for (int i = 0; i < BL_SPACEDIM; i++) { if (alo[i]==blo[i] && ahi[i]==bhi[i]) { lo[i] = alo[i]; hi[i] = ahi[i]; } else if (alo[i]<=blo[i] && blo[i]<=ahi[i]+1) { lo[i] = alo[i]; hi[i] = std::max(ahi[i],bhi[i]); joincnt++; } else if (blo[i]<=alo[i] && alo[i]<=bhi[i]+1) { lo[i] = blo[i]; hi[i] = std::max(ahi[i],bhi[i]); joincnt++; } else { canjoin = false; break; } } if (canjoin && (joincnt <= 1)) { // // Modify b and remove a from the list. // blb->setSmall(IntVect(lo)); blb->setBig(IntVect(hi)); lbox.erase(bla++); count++; match = true; break; } else { // // No match found, try next element. // ++blb; } } // // If a match was found, a was already advanced in the list. // if (!match) ++bla; } return count; } int BoxList::minimize () { int cnt = 0; for (int n; (n=simplify()) > 0; ) cnt += n; return cnt; } Box BoxList::minimalBox () const { Box minbox; if ( !isEmpty() ) { const_iterator bli = begin(); minbox = *bli; while ( bli != end() ) { minbox.minBox(*bli++); } } return minbox; } BoxList& BoxList::maxSize (const IntVect& chunk) { for (iterator bli = begin(); bli != end(); ++bli) { const int* len = bli->length().getVect(); for (int i = 0; i < BL_SPACEDIM; i++) { if (len[i] > chunk[i]) { // // Reduce by powers of 2. // int ratio = 1; int bs = chunk[i]; int nlen = len[i]; while ((bs%2 == 0) && (nlen%2 == 0)) { ratio *= 2; bs /= 2; nlen /= 2; } // // Determine number and size of (coarsened) cuts. // const int numblk = nlen/bs + (nlen%bs ? 1 : 0); const int size = nlen/numblk; const int extra = nlen%numblk; // // Number of cuts = number of blocks - 1. // for (int k = 0; k < numblk-1; k++) { // // Compute size of this chunk, expand by power of 2. // const int ksize = (k < extra ? size+1 : size) * ratio; // // Chop from high end. // const int pos = bli->bigEnd(i) - ksize + 1; push_back(bli->chop(i,pos)); } } } // // b has been chopped down to size and pieces split off // have been added to the end of the list so that they // can be checked for splitting (in other directions) later. // } return *this; } BoxList& BoxList::maxSize (int chunk) { return maxSize(IntVect(D_DECL(chunk,chunk,chunk))); } BoxList& BoxList::surroundingNodes () { for (iterator bli = begin(); bli != end(); ++bli) { bli->surroundingNodes(); } return *this; } BoxList& BoxList::surroundingNodes (int dir) { for (iterator bli = begin(); bli != end(); ++bli) { bli->surroundingNodes(dir); } return *this; } BoxList& BoxList::enclosedCells () { for (iterator bli = begin(); bli != end(); ++bli) { bli->enclosedCells(); } return *this; } BoxList& BoxList::enclosedCells (int dir) { for (iterator bli = begin(); bli != end(); ++bli) { bli->enclosedCells(dir); } return *this; } BoxList& BoxList::convert (IndexType typ) { btype = typ; for (iterator bli = begin(); bli != end(); ++bli) { bli->convert(typ); } return *this; } std::ostream& operator<< (std::ostream& os, const BoxList& blist) { BoxList::const_iterator bli = blist.begin(); os << "(BoxList " << blist.size() << ' ' << blist.ixType() << '\n'; for (int count = 1; bli != blist.end(); ++bli, ++count) { os << count << " : " << *bli << '\n'; } os << ')' << '\n'; if (os.fail()) BoxLib::Error("operator<<(ostream&,BoxList&) failed"); return os; } bool BoxList::operator== (const BoxList& rhs) const { bool rc = true; if (size() != rhs.size()) { rc = false; } else { BoxList::const_iterator liter = begin(), riter = rhs.begin(); for (; liter != end() && rc; ++liter, ++riter) { if ( !( *liter == *riter) ) { rc = false; } } } return rc; } ccseapps-2.5/CCSEApps/BoxLib/BoxDomain.cpp0000644000175000017500000001351211634153073021424 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BoxDomain.cpp,v 1.18 2001/08/06 19:40:27 car Exp $ // #include #include BoxDomain& BoxDomain::intersect (const Box& b) { BoxList::intersect(b); BL_ASSERT(ok()); return *this; } void BoxLib::intersect (BoxDomain& dest, const BoxDomain& fin, const Box& b) { dest = fin; dest.intersect(b); } BoxDomain& BoxDomain::refine (int ratio) { BoxList::refine(ratio); BL_ASSERT(ok()); return *this; } void BoxLib::refine (BoxDomain& dest, const BoxDomain& fin, int ratio) { dest = fin; dest.refine(ratio); } void BoxLib::accrete (BoxDomain& dest, const BoxDomain& fin, int sz) { dest = fin; dest.accrete(sz); } void BoxLib::coarsen (BoxDomain& dest, const BoxDomain& fin, int ratio) { dest = fin; dest.coarsen(ratio); } BoxDomain& BoxDomain::complementIn (const Box& b, const BoxDomain& bl) { BoxList::complementIn(b,bl); BL_ASSERT(ok()); return *this; } BoxDomain BoxLib::complementIn (const Box& b, const BoxDomain& bl) { BoxDomain result; result.complementIn(b,bl); return result; } BoxList BoxDomain::boxList () const { return BoxList(*this); } bool BoxDomain::operator== (const BoxDomain& rhs) const { return BoxList::operator==(rhs); } bool BoxDomain::operator!= (const BoxDomain& rhs) const { return !BoxList::operator==(rhs); } BoxDomain::BoxDomain () : BoxList(IndexType::TheCellType()) {} BoxDomain::BoxDomain (IndexType _ctype) : BoxList(_ctype) {} BoxDomain::BoxDomain (const Box& bx) : BoxList(bx.ixType()) { add(bx); } void BoxDomain::add (const Box& b) { BL_ASSERT(b.ixType() == ixType()); std::list check; check.push_back(b); for (iterator bli = lbox.begin(); bli != lbox.end(); ++bli) { std::list tmp; for (iterator ci = check.begin(); ci != check.end(); ) { if (ci->intersects(*bli)) { // // Remove c from the check list, compute the // part of it that is outside bln and collect // those boxes in the tmp list. // BoxList tmpbl(BoxLib::boxDiff(*ci, *bli)); tmp.splice(tmp.end(), tmpbl.listBox()); check.erase(ci++); } else { ++ci; } } check.splice(check.end(), tmp); } // // At this point, the only thing left in the check list // are boxes that nowhere intersect boxes in the domain. // lbox.splice(lbox.end(), check); BL_ASSERT(ok()); } void BoxDomain::add (const BoxList& bl) { for (BoxList::const_iterator bli = bl.begin(); bli != bl.end(); ++bli) add(*bli); } BoxDomain& BoxDomain::rmBox (const Box& b) { BL_ASSERT(b.ixType() == ixType()); std::list tmp; for (std::list::iterator bli = lbox.begin(); bli != lbox.end(); ) { if (bli->intersects(b)) { BoxList tmpbl(BoxLib::boxDiff(*bli,b)); tmp.splice(tmp.end(), tmpbl.listBox()); lbox.erase(bli++); } else { ++bli; } } lbox.splice(lbox.end(), tmp); return *this; } bool BoxDomain::ok () const { // // First check to see if boxes are valid. // bool status = BoxList::ok(); if (status) { // // Now check to see that boxes are disjoint. // for (const_iterator bli = begin(); bli != end(); ++bli) { const_iterator blii = bli; ++blii; for ( ; blii != end(); ++blii) { if (bli->intersects(*blii)) { std::cout << "Invalid DOMAIN, boxes overlap" << '\n' << "b1 = " << *bli << '\n' << "b2 = " << *blii << '\n'; status = false; } } } } return status; } BoxDomain& BoxDomain::accrete (int sz) { BoxList bl(*this); bl.accrete(sz); clear(); add(bl); return *this; } BoxDomain& BoxDomain::coarsen (int ratio) { BoxList bl(*this); bl.coarsen(ratio); clear(); add(bl); return *this; } std::ostream& operator<< (std::ostream& os, const BoxDomain& bd) { os << "(BoxDomain " << bd.boxList() << ")" << std::flush; if (os.fail()) BoxLib::Error("operator<<(ostream&,BoxDomain&) failed"); return os; } ccseapps-2.5/CCSEApps/BoxLib/FabArray.cpp0000644000175000017500000000723711634153073021242 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include FabArrayBase::FabArrayBase () {} FabArrayBase::FabArrayBase (const BoxArray& bxs, int nvar, int ngrow) : boxarray(bxs), distributionMap(boxarray, ParallelDescriptor::NProcsCFD()), n_grow(ngrow), n_comp(nvar) {} FabArrayBase::FabArrayBase (const BoxArray& bxs, int nvar, int ngrow, const DistributionMapping& map) : boxarray(bxs), distributionMap(map), n_grow(ngrow), n_comp(nvar) {} FabArrayBase::~FabArrayBase () {} Box FabArrayBase::fabbox (int K) const { // // Do not use fabparray[K] because it may not be valid in parallel. // return BoxLib::grow(boxarray[K], n_grow); } bool MFIter::g_debugging = false; MFIter::MFIter (const FabArrayBase& fabarray) : fabArray(fabarray), currentIndex(0), m_debugging(g_debugging) { // // Increment the currentIndex to start at the first valid index // for this ParallelDescriptor::MyProc. // const int MyProc = ParallelDescriptor::MyProc(); while (fabArray.DistributionMap()[currentIndex] != MyProc) { ++currentIndex; } } void MFIter::operator++ () { const int MyProc = ParallelDescriptor::MyProc(); // // Go to the next index on this processor. // do { ++currentIndex; } while (fabArray.DistributionMap()[currentIndex] != MyProc); } void MFIter::setDebugging (bool debugging) { g_debugging = debugging; } bool MFIter::isValid () { BL_ASSERT(currentIndex >= 0); bool rc = currentIndex < fabArray.size(); if (m_debugging) { if (rc) return true; ParallelDescriptor::Barrier(); return false; } return rc; } const Box& MFIter::validbox () const { return fabArray.box(currentIndex); } Box MFIter::fabbox () const { return fabArray.fabbox(currentIndex); } FillBoxId::FillBoxId () : m_fillBoxId(-1), m_fabIndex(-1) {} FillBoxId::FillBoxId (int newid, const Box& fillbox) : m_fillBox(fillbox), m_fillBoxId(newid), m_fabIndex(-1) {} // // Used to cache some CommData stuff in CollectData(). // CommDataCache::CommDataCache () : m_valid(false) {} void CommDataCache::operator= (const Array& rhs) { m_commdata = rhs; m_valid = true; } ccseapps-2.5/CCSEApps/BoxLib/winstd.H0000644000175000017500000000542711634153073020467 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _WINSTD_H_ #define _WINSTD_H_ // This files 'fixes' MSVC 6 so that it is more like real C++. #if defined(WIN32) && !defined(__MINGW32__) // The STL and template classes in general will yield symbols greater // than 256 chars, which are truncated; this suppresses the CL // warning. #pragma warning(disable:4786) #define NOMINMAX #include #include #include #include //#undef max //#undef min #undef abs typedef int mode_t; typedef int pid_t; // Place some globals in the standard namespace, where they belong namespace std { template inline T min(const T& l, const T& r) { return (l inline T max(const T& l, const T& r) { return (l inline T abs(const T& r) { return (r<0)?-r:r; } using ::pow; using ::fabs; using ::sqrt; using ::exp; using ::log; using ::log10; using ::sin; using ::cos; using ::tan; using ::asin; using ::acos; using ::atan; using ::sinh; using ::cosh; using ::tanh; using ::floor; using ::ceil; using ::fmod; using ::frexp; using ::ldexp; using ::modf; using ::exit; using ::abort; using ::strerror; using ::sprintf; } #endif #if defined( BL_OSF1 ) && !defined(BL_KCC_VERSION) namespace std { template inline T abs(const T& r) { return (r<0)?-r:r; } } #endif #if defined( BL_Linux ) && (BL_ICC_MAJOR_VERSION == 5) namespace std { template inline T abs(const T& r) { return (r<0)?-r:r; } } #endif #if defined( BL_GCC_VERSION) && (BL_GCC_MAJOR_VERSION < 3) #define BL_USE_SETBUF #endif #endif ccseapps-2.5/CCSEApps/BoxLib/BoxLib.cpp0000644000175000017500000001413211634153073020722 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BoxLib.cpp,v 1.30 2002/11/14 18:43:29 car Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define bl_str(s) # s #define bl_xstr(s) bl_str(s) // // The definition of our version string. // // Takes the form: boxlib version 2.0 built Jun 25 1996 at 14:52:36 // const char * const version = "boxlib version " bl_xstr(BL_VERSION_MAJOR) "." bl_xstr(BL_VERSION_MINOR) " built " __DATE__ " at " __TIME__; #undef bl_str #undef bl_xstr // // This is used by BoxLib::Error(), BoxLib::Abort(), and BoxLib::Assert() // to ensure that when writing the message to stderr, that no additional // heap-based memory is allocated. // static void write_to_stderr_without_buffering (const char* str) { // // Flush all buffers. // fflush(NULL); if (str) { // // Add some `!'s and a newline to the string. // const char * const end = " !!!\n"; fwrite(str, strlen(str), 1, stderr); fwrite(end, strlen(end), 1, stderr); } } void BL_this_is_a_dummy_routine_to_force_version_into_executable () { write_to_stderr_without_buffering(version); } static void write_lib_id(const char* msg) { fflush(0); const char* const boxlib = "BoxLib::"; fwrite(boxlib, strlen(boxlib), 1, stderr); if ( msg ) { fwrite(msg, strlen(msg), 1, stderr); fwrite("::", 2, 1, stderr); } } void BoxLib::Error (const char* msg) { write_lib_id("Error"); write_to_stderr_without_buffering(msg); ParallelDescriptor::Abort(); } namespace { const int EOS = -1; std::string Trim (const std::string& str) { int n; for ( n = str.size(); --n >= 0; ) { if ( str[n] != ' ' ) break; } std::string result; for (int i = 0; i <= n; ++i ) { result += str[i]; } return result; } std::string Fint_2_string (const int* iarr, int nlen) { std::string res; for ( int i = 0; i < nlen && *iarr != EOS; ++i ) { res += *iarr++; } return Trim(res); } } #include BL_FORT_PROC_DECL(BL_ERROR_CPP,bl_error_cpp) ( const int istr[], const int* NSTR ) { std::string res = Fint_2_string(istr, *NSTR); BoxLib::Error(res.c_str()); } BL_FORT_PROC_DECL(BL_WARNING_CPP,bl_warning_cpp) ( const int istr[], const int* NSTR ) { std::string res = Fint_2_string(istr, *NSTR); BoxLib::Warning(res.c_str()); } BL_FORT_PROC_DECL(BL_ABORT_CPP,bl_abort_cpp) ( const int istr[], const int* NSTR ) { std::string res = Fint_2_string(istr, *NSTR); BoxLib::Abort(res.c_str()); } void BoxLib::Abort (const char* msg) { write_lib_id("Abort"); write_to_stderr_without_buffering(msg); ParallelDescriptor::Abort(); } void BoxLib::Warning (const char* msg) { if (msg) { std::cerr << msg << '!' << '\n'; } } void BoxLib::Assert (const char* EX, const char* file, int line) { const int DIMENSION = 1024; char buf[DIMENSION+1]; sprintf(buf, "Assertion `%s' failed, file \"%s\", line %d", EX, file, line); // // Just to be a little safer :-) // buf[DIMENSION] = 0; write_to_stderr_without_buffering(buf); ParallelDescriptor::Abort(); } void BoxLib::OutOfMemory (const char* file, int line) { BoxLib::Assert("operator new", file, line); } namespace { Profiler* bl_prf; } void BoxLib::Initialize (int& argc, char**& argv) { static Profiler::Tag bl_prf_tag("BoxLib"); #ifndef WIN32 // // Make sure to catch new failures. // std::set_new_handler(BoxLib::OutOfMemory); #endif bl_prf = new Profiler(bl_prf_tag, true); bl_prf->start(); ParallelDescriptor::StartParallel(&argc, &argv); if (argc == 1) { ParmParse::Initialize(0,0,0); } else { if (strchr(argv[1],'=')) { ParmParse::Initialize(argc-1,argv+1,0); } else { ParmParse::Initialize(argc-2,argv+2,argv[1]); } } Profiler::Initialize(); WorkQueue::Initialize(); // // Initialize random seed after we're running in parallel. // BoxLib::InitRandom(ParallelDescriptor::MyProc() + 1); FArrayBox::Initialize(); DistributionMapping::Initialize(); std::cout << std::setprecision(10); } void BoxLib::Finalize () { bl_prf->stop(); delete bl_prf; DistributionMapping::Finalize(); FArrayBox::Finalize(); WorkQueue::Finalize(); Profiler::Finalize(); ParmParse::Finalize(); ParallelDescriptor::EndParallel(); } ccseapps-2.5/CCSEApps/BoxLib/MultiFab.H0000644000175000017500000003734011634153073020661 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_MULTIFAB_H #define BL_MULTIFAB_H // // $Id: MultiFab.H,v 1.43 2001/08/02 16:01:44 car Exp $ // #include #include #include #include // // Forward declaration. // typedef FabArrayId MultiFabId; class MultiFabCopyDescriptor; class MultiFab; namespace BoxLib { void linInterpAddBox (MultiFabCopyDescriptor& fabCopyDesc, BoxList* returnUnfilledBoxes, Array& returnedFillBoxIds, const Box& subbox, const MultiFabId& faid1, const MultiFabId& faid2, Real t1, Real t2, Real t, int src_comp, int dest_comp, int num_comp, bool extrap); void linInterpFillFab (MultiFabCopyDescriptor& fabCopyDesc, const Array& fillBoxIds, const MultiFabId& faid1, const MultiFabId& faid2, FArrayBox& dest, Real t1, Real t2, Real t, int src_comp, int dest_comp, int num_comp, bool extrap); } // //@Man: //@Memo: A Collection of FArrayBoxes /*@Doc: The MultiFab class is publically derived from the FabArray class. It is a collection (stored as an array) of FArrayBoxes useful for storing floating point data on a domain defined by a union of rectangular regions embedded in a uniform index space. The MultiFab class extends the function of the underlying FabArray class just as the FArrayBox class extends the funtion of BaseFab. Additional member functions are defined for I/O and simple arithmetic operations on these aggregate objects. This class does NOT provide a copy constructor or assignment operator. */ class MultiFab : public FabArray { public: /*@ManDoc: Constructs an empty MultiFab. Data can be defined at a later time using the `define' member functions inherited from FabArray. */ MultiFab (); /*@ManDoc: Constructs a MultiFab with a valid region defined by bxs and a region of definition defined by the grow factor ngrow. If mem\_mode is defined to be Fab\_allocate then FArrayBoxes are allocated for each Box in the BoxArray. The size of the FArrayBox is given by the Box grown by ngrow and the number of components is given by ncomp. If mem\_mode is defined to be Fab\_noallocate then no FArrayBoxes are allocated at this time but can be defined later. */ MultiFab (const BoxArray& bs, int ncomp, int ngrow, FabAlloc mem_mode = Fab_allocate); void operator= (const Real& r); /*@ManDoc: Returns the minimum value contained in component comp of the MultiFab. The parameter nghost determines the number of boundary cells to search for the minimum. The default is to search only the valid regions of the FArrayBoxes. */ Real min (int comp, int nghost = 0) const; /*@ManDoc: Identical to the previous min() function, but confines its search to intersection of Box b and the MultiFab. */ Real min (const Box& b, int comp, int nghost = 0) const; /*@ManDoc: Returns the maximum value contained in component comp of the MultiFab. The parameter nghost determines the number of boundary cells to search for the maximum. The default is to search only the valid regions of the FArrayBoxes. */ Real max (int comp, int nghost = 0) const; /*@ManDoc: Identical to the previous max() function, but confines its search to intersection of Box b and the MultiFab. */ Real max (const Box& b, int comp, int nghost = 0) const; /*@ManDoc: Adds the scalar value val to the value of each cell in the specified subregion of the MultiFab. The subregion consists of the num\_comp components starting at component comp. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified. */ void plus (Real val, int comp, int num_comp, int nghost = 0); /*@ManDoc: Identical to the previous version of plus(), with the restriction that the subregion is further constrained to the intersection with Box region. */ void plus (Real val, const Box& region, int comp, int num_comp, int nghost = 0); /*@ManDoc: Adds the scalar value val to the value of each cell in the valid region of each component of the MultiFab. The value of nghost specifies the number of cells in the boundary region that should be modified. */ void plus (Real val, int nghost); /*@ManDoc: Adds the scalar value val to the value of each cell in the valid region of each component of the MultiFab, that also intersects the Box region. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified. */ void plus (Real val, const Box& region, int nghost); /*@ManDoc: Scales the value of each cell in the specified subregion of the MultiFab by the scalar val (a[i] <- a[i]*val). The subregion consists of the num\_comp components starting at component comp. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified. */ void mult (Real val, int comp, int num_comp, int nghost = 0); /*@ManDoc: Identical to the previous version of mult(), with the restriction that the subregion is further constrained to the intersection with Box region. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified. */ void mult (Real val, const Box& region, int comp, int num_comp, int nghost = 0); /*@ManDoc: Scales the value of each cell in the valid region of each component of the MultiFab by the scalar val (a[i] <- a[i]*val). The value of nghost specifies the number of cells in the boundary region that should be modified. */ void mult (Real val, int nghost = 0); /*@ManDoc: Scales the value of each cell in the valid region of each component of the MultiFab by the scalar val (a[i] <- a[i]*val), that also intersects the Box region. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified. */ void mult (Real val, const Box& region, int nghost = 0); /*@ManDoc: Replaces the value of each cell in the specified subregion of the MultiFab with its reciprocal multiplied by the value of numerator. The subregion consists of the num\_comp components starting at component comp. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified. */ void invert (Real numerator, int comp, int num_comp, int nghost = 0); /*@ManDoc: Identical to the previous version of invert(), with the restriction that the subregion is further constrained to the intersection with Box region. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified. */ void invert (Real numerator, const Box& region, int comp, int num_comp, int nghost = 0); /*@ManDoc: Replaces the value of each cell in the specified subregion of the MultiFab with its reciprocal multiplied by the value of numerator. The value of nghost specifies the number of cells in the boundary region that should be modified. */ void invert (Real numerator, int nghost); /*@ManDoc: Replaces the value of each cell in the specified subregion of the MultiFab, that also intersects the Box region, with its reciprocal multiplied by the value of numerator. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified. */ void invert (Real numerator, const Box& region, int nghost); /*@ManDoc: Negates the value of each cell in the specified subregion of the MultiFab. The subregion consists of the num\_comp components starting at component comp. The value of nghost specifies the number of cells in the boundary region of each FArrayBox in the subregion that should be modified. */ void negate (int comp, int num_comp, int nghost = 0); /*@ManDoc: Identical to the previous version of negate(), with the restriction that the subregion is further constrained to the intersection with Box region. */ void negate (const Box& region, int comp, int num_comp, int nghost = 0); /*@ManDoc: Negates the value of each cell in the valid region of the MultiFab. The value of nghost specifies the number of cells in the boundary region that should be modified. */ void negate (int nghost = 0); /*@ManDoc: Negates the value of each cell in the valid region of the MultiFab that also intersects the Box region. The value of nghost specifies the number of cells in the boundary region that should be modified. */ void negate (const Box& region, int nghost = 0); /*@ManDoc: This function adds the values of the cells in mf to the corresponding cells of this MultiFab. mf is required to have the same BoxArray or "valid region" as this MultiFab. The addition is done only to num\_comp components, starting with component number strt\_comp. The parameter nghost specifies the number of boundary cells that will be modified. If nghost == 0, only the valid region of each FArrayBox will be modified. */ void plus (const MultiFab& mf, int strt_comp, int num_comp, int nghost); /*@ManDoc: This function subtracts the values of the cells in mf from the corresponding cells of this MultiFab. mf is required to have the same BoxArray or "valid region" as this MultiFab. The subtraction is done only to num\_comp components, starting with component number strt\_comp. The parameter nghost specifies the number of boundary cells that will be modified. If nghost == 0, only the valid region of each FArrayBox will be modified. */ void minus (const MultiFab& mf, int strt_comp, int num_comp, int nghost); /*@ManDoc: Copy on intersection within MultiFab. Data is copied from valid regions to intersecting regions of definition. The purpose is to fill in the boundary regions of each FAB in the MultiFab. */ void FillBoundary (); /*@ManDoc: Same as FillBoundary(), but only copies num\_comp components starting at src\_comp. */ void FillBoundary (int src_comp, int num_comp); // //@ManDoc: Flush the cache of self-intersection info used by FillBoundary. // static void FlushSICache (); // //@ManDoc: The size of the cache of self-intersection info. // static int SICacheSize (); /*@ManDoc: Copy from `src' to `dst' including `nghost' ghost cells. The two MultiFabs MUST have the same underlying BoxArray. */ static void Copy (MultiFab& dst, const MultiFab& src, int srccomp, int dstcomp, int numcomp, int nghost); private: // // These are disabled. // MultiFab (const MultiFab& rhs); MultiFab& operator= (const MultiFab& rhs); }; class MultiFabCopyDescriptor : public FabArrayCopyDescriptor { public: MultiFabCopyDescriptor () : FabArrayCopyDescriptor() {} MultiFabId RegisterMultiFab (MultiFab* mf) { return RegisterFabArray(mf); } private: // // These are disallowed. // MultiFabCopyDescriptor (const MultiFabCopyDescriptor&); MultiFabCopyDescriptor& operator= (const MultiFabCopyDescriptor&); }; #endif /*BL_MULTIFAB_H*/ ccseapps-2.5/CCSEApps/BoxLib/SPECIALIZE_3D.F0000644000175000017500000000633711634153073021134 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include #include #include #include c c This function copies floating point numbers from one array to another. c subroutine FORT_FASTCOPY (dest, & DIMS(dest), & imin, jmin, kmin, imax, jmax, kmax, & src, & DIMS(src), & imn, jmn, kmn, imx, jmx, kmx, & ncomp) implicit none c c Bounds to fill in dest c integer imin, jmin, kmin, imax, jmax, kmax integer DIMDEC(dest) c c Bounds to fill from src c integer imn, jmn, kmn, imx, jmx, kmx integer DIMDEC(src) integer ncomp REAL_T dest(DIMV(dest),ncomp) REAL_T src(DIMV(src),ncomp) c c Local variables c integer i,j,k,l,ioff,joff,koff ioff=imn-imin joff=jmn-jmin koff=kmn-kmin do l = 1, ncomp do k = kmin,kmax do j = jmin,jmax do i = imin,imax dest(i,j,k,l) = src(i+ioff,j+joff,k+koff,l) end do end do end do end do end c c This function sets a section of an array to a value. c subroutine FORT_FASTSETVAL (val,lo,hi,dest,DIMS(dest),ncomp) implicit none integer ncomp integer lo(3), hi(3) integer DIMDEC(dest) REAL_T val REAL_T dest(DIMV(dest),ncomp) c c Local variables. c integer i,j,k,l integer imin,jmin,kmin,imax,jmax,kmax imin = lo(1) jmin = lo(2) kmin = lo(3) imax = hi(1) jmax = hi(2) kmax = hi(3) do l = 1, ncomp do k = kmin,kmax do j = jmin,jmax do i = imin,imax dest(i,j,k,l) = val end do end do end do end do end ccseapps-2.5/CCSEApps/BoxLib/Box.H0000644000175000017500000005454111634153073017710 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_BOX_H #define BL_BOX_H // // $Id: Box.H,v 1.25 2001/10/10 20:12:44 car Exp $ // #ifdef NODEV #undef NODEV #endif #include #include #include #include #include #include // // Forward declaration. // class Box; namespace BoxLib { /*@ManDoc: Grow Box in all directions by given amount. NOTE: n\_cell negative shrinks the Box by that number of cells. */ Box grow (const Box& b, int i); // //@ManDoc: Grow Box in each direction by specified amount. // Box grow (const Box& b, const IntVect& v); /*@ManDoc: Coarsen Box by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/ratio and hi <- hi/ratio. NOTE: if type(dir) = NODE centered: lo <- lo/ratio and hi <- hi/ratio + ((hi%ratio)==0 ? 0 : 1). That is, refinement of coarsened Box must contain the original Box. */ Box coarsen (const Box& b, int refinement_ratio); /*@ManDoc: Coarsen Box by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/ratio and hi <- hi/ratio. NOTE: if type(dir) = NODE centered: lo <- lo/ratio and hi <- hi/ratio + ((hi%ratio)==0 ? 0 : 1). That is, refinement of coarsened Box must contain the original Box. */ Box coarsen (const Box& b, const IntVect& refinement_ratio); /*@ManDoc: Refine Box by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo*ratio and hi <- (hi+1)*ratio - 1. NOTE: if type(dir) = NODE centered: lo <- lo*ratio and hi <- hi*ratio. */ Box refine (const Box& b, int refinement_ratio); /*@ManDoc: Refine Box by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo*ratio and hi <- (hi+1)*ratio - 1. NOTE: if type(dir) = NODE centered: lo <- lo*ratio and hi <- hi*ratio. */ Box refine (const Box& b, const IntVect& refinement_ratio); /*@ManDoc: Return a Box with NODE based coordinates in direction dir that encloses Box b. NOTE: equivalent to b.convert(dir,NODE) NOTE: error if b.type(dir) == NODE. */ Box surroundingNodes (const Box& b, int dir); /*@ManDoc: Return a Box with NODE based coordinates in all directions that encloses Box b. */ Box surroundingNodes (const Box& b); /*@ManDoc: Return a Box with CELL based coordinates in direction dir that is enclosed by b. NOTE: equivalent to b.convert(dir,CELL) NOTE: error if b.type(dir) == CELL. */ Box enclosedCells (const Box& b, int dir); /*@ManDoc: Return a Box with CELL based coordinates in all directions that is enclosed by b. */ Box enclosedCells (const Box& b); /*@ManDoc: Returns the edge-centered Box (in direction dir) defining the low side of Box b. */ Box bdryLo (const Box& b, int dir, int len=1); /*@ManDoc: Returns the edge-centered Box (in direction dir) defining the high side of Box b. */ Box bdryHi (const Box& b, int dir, int len=1); /*@ManDoc: Similar to bdryLo and bdryHi except that it operates on the given face of box b. */ Box bdryNode (const Box& b, const Orientation& face, int len=1); /*@ManDoc: Return the cell centered Box of length len adjacent to b on the low end along the coordinate direction dir. The return Box is identical to b in the other directions. The return Box and b have an empty intersection. NOTE: len >= 1 NOTE: Box retval = b.adjCellLo(b,dir,len) is equivalent to the following set of operations: Box retval(b); retval.convert(dir,Box::CELL); retval.setrange(dir,retval.smallEnd(dir)-len,len); */ Box adjCellLo (const Box& b, int dir, int len=1); /*@ManDoc: Similar to adjCellLo but builds an adjacent Box on the high end. */ Box adjCellHi (const Box& b, int dir, int len=1); /*@ManDoc: Similar to adjCellLo and adjCellHi; operates on given face. */ Box adjCell (const Box& b, const Orientation& face, int len=1); /*@ManDoc: Modify Box to that of the minimum Box containing both the original Box and the argument. Both Boxes must have identical type. */ Box minBox (const Box& b1, const Box& b2); } // //@ManDoc: Write an ASCII representation to the ostream. // std::ostream& operator<< (std::ostream& os, const Box& bx); // //@ManDoc: Read from istream. // std::istream& operator>> (std::istream& os, Box& bx); // //@Man: //@Memo: A Rectangular Domain on an Integer Lattice /*@Doc: A Box is an abstraction for defining discrete regions of SPACEDIM indexing space. Boxes have an IndexType, which defines IndexType::CELL or IndexType::NODE based points for each direction and a low and high INTVECT which defines the lower and upper corners of the Box. Boxes can exist in positive and negative indexing space. Box is a dimension dependent class, so SPACEDIM must be defined as either 1, 2, or 3 when compiling. For historical reasons, BOX is synonomous with Box. That usage is deprecated, however. */ class Box { friend MPI_Datatype ParallelDescriptor::Mpi_typemap::type(); public: /*@ManDoc: The default constructor. For safety, the constructed Box is invalid and may be tested for validity with ok(). */ Box (); // //@ManDoc: Construct cell-centered type Box. // Box (const IntVect& small, const IntVect& big); // //@ManDoc: Construct box with specified lengths. // Box (const IntVect& small, const int* vec_len); /*@ManDoc: Construct Box with given type. small and big are expected to be consistent with given type. */ Box (const IntVect& small, const IntVect& big, const IntVect& typ); // //@ManDoc: Construct dimension specific Boxes. // Box (const IntVect& small, const IntVect& big, const IndexType& t); // //@ManDoc: Get the smallend of the box. // const IntVect& smallEnd () const; // //@ManDoc: Return the coordinate of the low end in the given direction. // int smallEnd (int dir) const; // //@ManDoc: Get the bigend. // const IntVect& bigEnd () const; // //@ManDoc: Return the coordinate of the high end in the given direction. // int bigEnd (int dir) const; // //@ManDoc: Return the indexing type. // IndexType ixType () const; // //@ManDoc: Return the indexing type. // IntVect type () const; // //@ManDoc: Return the indexing type in the specified direction. // IndexType::CellIndex type (int dir) const; // //@ManDoc: Return the length of the Box. // const IntVect& length () const; // //@ManDoc: Return the length of the Box in given direction. // int length (int dir) const; /*@ManDoc: Returns a constant pointer the array of low end coordinates. Useful for calls to FORTRAN. */ const int* loVect () const; /*@ManDoc: Returns a constant pointer the array of high end coordinates. Useful for calls to FORTRAN. */ const int* hiVect () const; /*@ManDoc: Returns a constant pointer to the array of coordinates in the Box. Useful for fortran, but otherwise too dangerous for use. */ const int* getVect () const; // //@ManDoc: Returns the coordinate normal to given face. // int operator[] (const Orientation& face) const; // //@ManDoc: Checks if it is a proper box (including a valid type). // bool isEmpty () const; // //@ManDoc: Checks if it is a proper Box (including a valid type). // bool ok () const; // //@ManDoc: Returns true if argument is contained within Box. // bool contains (const IntVect& p) const; /*@ManDoc: Returns true if argument is contained within Box. It is an error if the Boxes have different types. */ bool contains (const Box& b) const; /*@ManDoc: Returns true if Boxes have non-null intersections. It is an error if the Boxes have different types. */ bool intersects (const Box& b) const; /*@ManDoc: Returns true is Boxes same size, ie translates of each other,. It is an error if they have different types. */ bool sameSize (const Box& b) const; // //@ManDoc: Returns true if Boxes have same type. // bool sameType (const Box &b) const; // //@ManDoc: Returns true if Boxes are identical (including type). // bool operator== (const Box& b) const; // //@ManDoc: Returns true if Boxes differ (including type). // bool operator!= (const Box& b) const; // //@ManDoc: Returns true if Box is cell-centered in all indexing directions. // bool cellCentered () const; // //@ManDoc: Is the number calculated by numPts() representable in a long? // bool numPtsOK () const; /*@ManDoc: Returns the number of points contained in the Box, else abort()s if the number cannot be represented in a long. */ long numPts () const; // //@ManDoc: Is the number calculated by volume() representable in a long? // bool volumeOK () const; /*@ManDoc: Return the volume, in indexing space, of region enclosed by this Box. This is identical to numPts() for CELL centered Box; i.e. consider a edge-based box in 2D which has two edges in it. This box has one cell center, located between the two edges. numPts() would return 2 as would volume(). Otherwise, numPts() >= volume(). Abort()s if the number cannot be represented in a long. */ long volume () const; /*@ManDoc: Returns length of longest side. dir is modified to give direction with longest side: 0...SPACEDIM-1. Ignores type. */ int longside (int& dir) const; // //@ManDoc: Returns length of longest side. Ignores type. // int longside () const; /*@ManDoc: Returns length of shortest side. dir is modified to give direction with shortest side: 0...SPACEDIM-1. Ignores type. */ int shortside (int& dir) const; // //@ManDoc: Returns length of shortest side. Ignores type. // int shortside () const; /*@ManDoc: Returns offset of point from smallend; i.e. index(smallend) -> 0, bigend would return volume()-1. Is used in accessing FArrayBox. */ long index (const IntVect& v) const; // //@ManDoc: Redefine the small end of the Box. // Box& setSmall (const IntVect& sm); // //@ManDoc: Redefine the small end of the Box. // Box& setSmall (int dir, int sm_index); // //@ManDoc: Redefine the big end of the Box. // Box& setBig (const IntVect& bg); // //@ManDoc: Redefine the big end of the Box. // Box& setBig (int dir, int bg_index); /*@ManDoc: Set the entire range in a given direction, starting at sm\_index with length n\_cells. NOTE: This will yield an illegal Box if n\_cells <= 0. */ Box& setRange (int dir, int sm_index, int n_cells = 1); /*@ManDoc: Shift this Box nzones indexing positions in coordinate direction dir. */ Box& shift (int dir, int nzones); // //@ManDoc: Equivalent to b.shift(0,iv[0]).shift(1,iv[1]) .... // Box& shift (const IntVect& iv); /*@ManDoc: This member shifts the Box by "half" indicies, thereby converting the Box from type CELL to NODE and visa-versa. b.shiftHalf(0,1) shifts b to the right by 1/2 cells. b.shiftHalf(1,-3) shifts b in the -j direction by 3/2 cells. NOTE: If num\_halfs is EVEN the shift is num\_halfs/2 full zones and hence will not change the type. This is: b.shifthalf(4) == b.shift(2). */ Box& shiftHalf (int dir, int num_halfs); // //@ManDoc: Equivalent to b.shiftHalf(0,iv[0]).shiftHalf(1,iv[1]) ... // Box& shiftHalf (const IntVect& iv); /*@ManDoc: Convert the Box from the current type into the argument type. This may change the Box coordinates: type CELL -> NODE : increase coordinate by one on high end type NODE -> CELL : reduce coordinate by one on high end other type mappings make no change. */ Box& convert (IndexType typ); /*@ManDoc: Convert the Box from the current type into the argument type. This may change the Box coordinates: type CELL -> NODE : increase coordinate by one on high end type NODE -> CELL : reduce coordinate by one on high end other type mappings make no change. */ Box& convert (const IntVect& typ); // //@ManDoc: Convert to NODE type in all directions. // Box& surroundingNodes (); // //@ManDoc: Convert to NODE type in given direction. // Box& surroundingNodes (int dir); // //@ManDoc: Convert to CELL type in all directions. // Box& enclosedCells (); // //@ManDoc: Convert to CELL type in given direction. // Box& enclosedCells (int dir); /*@ManDoc: Return Box that is intersection of this Box and argument. The Boxes MUST be of same type. */ Box operator& (const Box&) const; /*@ManDoc: Intersect this Box with its argument. The Boxes MUST be of the same type. */ Box& operator&= (const Box&); /*@ManDoc: Modify Box to that of the minimum Box containing both the original Box and the argument. Both Boxes must have identical type. */ Box& minBox (const Box &); // //@ManDoc: Shift Box (relative) by given IntVect. // Box& operator+= (const IntVect& v); // //@ManDoc: Shift Box (relative) by given IntVect. // Box operator+ (const IntVect& v) const; // //@ManDoc: Shift Box (relative) by given IntVect. // Box& operator-= (const IntVect& v); // //@ManDoc: Shift Box (relative) by given IntVect. // Box operator- (const IntVect& v) const; /*@ManDoc: Chop the Box at the chop\_pnt in the dir direction returns one Box, modifies the object Box. The union of the two is the original Box. The modified Box is the low end, the returned Box is the high end. If type(dir) = CELL, the Boxes are disjoint with the chop\_pnt included in the high end (new Box). It is an ERROR if chop\_pnt is the low end of the orig Box. If type(dir) = NODE, the chop\_pnt is included in both Boxes but is the only point in common. It is also an error if the chop\_pnt is an end node of the Box. */ Box chop (int dir, int chop_pnt); /*@ManDoc: Grow Box in all directions by given amount. NOTE: n\_cell negative shrinks the Box by that number of cells. */ Box& grow (int i); // //@ManDoc: Grow Box in each direction by specified amount. // Box& grow (const IntVect& v); /*@ManDoc: Grow the Box on the low and high end by n\_cell cells in direction idir. */ Box& grow (int idir, int n_cell); /*@ManDoc: Grow the Box on the low end by n\_cell cells in direction idir. NOTE: n\_cell negative shrinks the Box by that number of cells. */ Box& growLo (int idir, int n_cell=1); /*@ManDoc: Grow the Box on the high end by n\_cell cells in direction idir. NOTE: n\_cell negative shrinks the Box by that number of cells. */ Box& growHi (int idir, int n_cell=1); // //@ManDoc: Grow in the direction of the given face. // Box& grow (const Orientation& face, int n_cell=1); /*@ManDoc: Refine Box by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo*ratio and hi <- (hi+1)*ratio - 1. NOTE: if type(dir) = NODE centered: lo <- lo*ratio and hi <- hi*ratio. */ Box& refine (int refinement_ratio); /*@ManDoc: Refine Box by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo*ratio and hi <- (hi+1)*ratio - 1. NOTE: if type(dir) = NODE centered: lo <- lo*ratio and hi <- hi*ratio. */ Box& refine (const IntVect& refinement_ratio); /*@ManDoc: Coarsen Box by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/ratio and hi <- hi/ratio. NOTE: if type(dir) = NODE centered: lo <- lo/ratio and hi <- hi/ratio + ((hi%ratio)==0 ? 0 : 1). That is, refinement of coarsened Box must contain the original Box. */ Box& coarsen (int refinement_ratio); /*@ManDoc: Coarsen Box by given (positive) refinement ratio. NOTE: if type(dir) = CELL centered: lo <- lo/ratio and hi <- hi/ratio. NOTE: if type(dir) = NODE centered: lo <- lo/ratio and hi <- hi/ratio + ((hi%ratio)==0 ? 0 : 1). That is, refinement of coarsened Box must contain the original Box. */ Box& coarsen (const IntVect& refinement_ratio); /*@ManDoc: Step through the rectangle. It is a runtime error to give a point not inside rectangle. Iteration may not be efficient. */ void next (IntVect &) const; /*@ManDoc: Scan argument IntVect over object second arg is increment vector. Runtime error if IntVect is not contained in object Box. Iteration may not be efficient. */ void next (IntVect& p, const int* shv) const; /*@ManDoc: This static member function returns a constant reference to an object of type Box representing the unit box in BL\_SPACEDIM-dimensional space. */ static const Box& TheUnitBox (); protected: // // A helper function for numPtsOK() and numPts(). // bool numPtsOK (long& N) const; // // A helper function for volumeOK() and volume(). // bool volumeOK (long& N) const; IntVect smallend; IntVect bigend; mutable IntVect len; IndexType btype; }; inline const IntVect& Box::smallEnd () const { return smallend; } inline int Box::smallEnd (int dir) const { return smallend[dir]; } inline const IntVect& Box::bigEnd () const { return bigend; } inline int Box::bigEnd (int dir) const { return bigend[dir]; } inline IndexType Box::ixType () const { return btype; } inline IntVect Box::type () const { return btype.ixType(); } inline IndexType::CellIndex Box::type (int dir) const { return btype.ixType(dir); } inline int Box::length (int dir) const { return bigend[dir] - smallend[dir] + 1; } inline const int* Box::loVect () const { return smallend.getVect(); } inline const int* Box::hiVect () const { return bigend.getVect(); } inline const int* Box::getVect () const { return smallend.getVect(); } inline int Box::operator[] (const Orientation& face) const { const int dir = face.coordDir(); return face.isLow() ? smallend[dir] : bigend[dir]; } inline bool Box::numPtsOK () const { long ignore; return numPtsOK(ignore); } inline bool Box::isEmpty () const { return numPts() == 0; } inline bool Box::sameType (const Box &b) const { return btype == b.btype; } inline bool Box::contains (const IntVect& p) const { return p >= smallend && p <= bigend; } inline bool Box::contains (const Box& b) const { BL_ASSERT(sameType(b)); return b.smallend >= smallend && b.bigend <= bigend; } inline bool Box::sameSize (const Box& b) const { BL_ASSERT(sameType(b)); return D_TERM(length(0) == b.length(0), && length(1)==b.length(1), && length(2)==b.length(2)); } inline bool Box::operator== (const Box& b) const { return smallend == b.smallend && bigend == b.bigend && b.btype == btype; } inline bool Box::operator!= (const Box& b) const { return !operator==(b); } inline bool Box::cellCentered () const { return !btype.any(); } inline bool Box::ok () const { return (bigend >= smallend) && btype.ok(); } inline const IntVect& Box::length () const { D_EXPR(len[0] = bigend[0]-smallend[0] + 1, len[1] = bigend[1]-smallend[1] + 1, len[2] = bigend[2]-smallend[2] + 1); return len; } #endif /*BL_BOX_H*/ ccseapps-2.5/CCSEApps/BoxLib/BLFort.H0000644000175000017500000000366011634153073020304 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BL_BLFORT_H_ #define _BL_BLFORT_H_ #include #include #ifndef BL_LANG_FORT #if defined(BL_FORT_USE_UPPERCASE) #define __BL_FORT_NAME__(A,B) A #elif defined(BL_FORT_USE_LOWERCASE) #define __BL_FORT_NAME__(A,B) B #elif defined(BL_FORT_USE_UNDERSCORE) #define __BL_FORT_NAME__(A,B) B##_ #else #error "One of BL_FORT_USE_{UPPERCASE,LOWERCASE,UNDERSCORE} must be defined" #endif #define BL_FORT_PROC_DECL(A,B) extern "C" void __BL_FORT_NAME__(A,B) #define BL_FORT_PROC_CALL(A,B) __BL_FORT_NAME__(A,B) #define BL_FORT_PROC_NAME(A,B) __BL_FORT_NAME__(A,B) #define BL_FORT_FAB_ARG(A) Real* A##_fab, ARLIM_P(A##_lo), ARLIM_P(A##_hi) #endif #endif ccseapps-2.5/CCSEApps/BoxLib/Tuple.H0000644000175000017500000001047311634153073020245 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_TUPLE_H #define BL_TUPLE_H // // $Id: Tuple.H,v 1.13 2001/07/31 22:43:19 lijewski Exp $ // #include #include // //@Man: //@Memo: Ordered Tuples for Types T /*@Doc: This class represents ordered tuples of some user-specified concrete type T for N > 0. The type T must have a default constructor. If the non-default constructor, copy constructor, or copy assignment operator are used, T must also have a copy constructor. */ template class Tuple { public: /*@ManDoc: The default constructor. For user-defined types T, the default constructor for T will be run on each of the N objects in the Tuple. For builtin (intrinsic) types, the values in the Tuple will be garbage. */ Tuple (); /*@ManDoc: Constructs a Tuple, initializing the elements in the Tuple with the corresponding elements in the vector v. This assumes that v contains at least N elements of type T -- an assumption that is NOT checked. For user-defined types, T must have a well-defined and accessible copy constructor. */ explicit Tuple (const T* v); // // The copy constructor. // Tuple (const Tuple& rhs); // // The copy assignment operator. // Tuple& operator= (const Tuple& rhs); /*@ManDoc: Returns a reference to the i'th element in the Tuple, counting from zero. Performs range checking when the library is compiled in debug mode. */ T& operator[] (int i); /*@ManDoc: Returns a constant reference to the i'th element in the Tuple, counting from zero. Performs range checking when the library is compiled in debug mode. */ const T& operator[] (int i) const; /*@ManDoc: Returns the address of the underlying vector of T representation. This should ONLY be used when interfacing to Fortran as it breaks the encapsulation of the class. */ operator const T* () const; protected: // // The underlying vector of T representing the Tuple. // T vect[N]; }; template inline Tuple::Tuple() {} template inline T& Tuple::operator[] (int i) { BL_ASSERT(0 <= i && i < N); return vect[i]; } template inline const T& Tuple::operator[] (int i) const { BL_ASSERT(0 <= i && i < N); return vect[i]; } template inline Tuple::operator const T* () const { return &vect[0]; } template Tuple::Tuple (const T* v) { BL_ASSERT(v != 0); for (size_t i = 0; i < N; ++i) vect[i] = v[i]; } template Tuple::Tuple (const Tuple& rhs) { for (size_t i = 0; i < N; ++i) vect[i] = rhs.vect[i]; } template Tuple& Tuple::operator= (const Tuple& rhs) { for (size_t i = 0; i < N; ++i) vect[i] = rhs.vect[i]; return *this; } #endif /*BL_TUPLE_H*/ ccseapps-2.5/CCSEApps/BoxLib/.cvsignore0000644000175000017500000000033011634153073021032 0ustar amckinstryamckinstry*.for html Debug Debug3D Release Release3D BoxLib.tex BoxLib.log BoxLib.aux BoxLib.pdf BoxLib.ncb BoxLib.opt BoxLib.plg BoxLib.stc grdlog ti_files chk[0-9][0-9][0-9][0-9] plt[0-9][0-9][0-9][0-9] *.pixie *.Addrs *.ii ccseapps-2.5/CCSEApps/BoxLib/BoxDomain.H0000644000175000017500000001346611634153073021041 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_BOXDOMAIN_H #define BL_BOXDOMAIN_H // // $Id: BoxDomain.H,v 1.27 2002/03/26 20:04:06 lijewski Exp $ // #include #include #include #include #include // // Forward declaration. // class BoxDomain; namespace BoxLib { // //@ManDoc: Returns the complement of BoxDomain bl in Box b. // BoxDomain complementIn (const Box& b, const BoxDomain& bl); /*@ManDoc: Coarsen all Boxes in the domain by the refinement ratio. The result is placed into a new BoxDomain. */ void coarsen (BoxDomain& dest, const BoxDomain& fin, int ratio); /*@ManDoc: Refine all Boxes in the domain by the refinement ratio and return the result in dest. */ void refine (BoxDomain& dest, const BoxDomain& fin, int ratio); /*@ManDoc: Compute the intersection of BoxDomain fin with Box b and place the result into BoxDomain dest. */ void intersect (BoxDomain& dest, const BoxDomain& fin, const Box& b); /*@ManDoc: Grow each Box in BoxDomain fin by size sz and place the result into BoxDomain dest. */ void accrete (BoxDomain& dest, const BoxDomain& fin, int sz = 1); } // //@ManDoc: Output a BoxDomain to an ostream is ASCII format. // std::ostream& operator<< (std::ostream& os, const BoxDomain& bd); // //@Man: //@Memo: A List of Disjoint Boxes /*@Doc: A BoxDomain is a BoxList with the restriction that Boxes in the list are disjoint. Note that a BoxDomain is NOT a BoxList due to the protected inheritance. This is a concrete class, not a polymorphic one. */ class BoxDomain : protected BoxList { public: typedef BoxList::const_iterator const_iterator; // //@ManDoc: Construct an empty BoxDomain of IndexType::TheCellType(). // BoxDomain (); // /// A Box Domain out of single Box // BoxDomain (const Box& bx); // //@ManDoc: Construct an empty BoxDomain of IndexType itype. // explicit BoxDomain (IndexType itype); // //@ManDoc: Add a Box to the domain. // void add (const Box& b); // //@ManDoc: Add all Boxes in the BoxList to the domain. // void add (const BoxList& bl); // //@ManDoc: Remove a box from the domain. // BoxDomain& rmBox (const Box& b); /*@ManDoc: Returns True if this BoxDomain is valid. Checks for disjointness. Returns true if the BoxDomain is empty. */ bool ok () const; // //@ManDoc: Promoted from BoxList. // using BoxList::clear; // //@ManDoc: Promoted from BoxList. // using BoxList::size; // //@ManDoc: Promoted from BoxList. // using BoxList::isEmpty; // //@ManDoc: Promoted from BoxList. // using BoxList::isNotEmpty; // //@ManDoc: Promoted from BoxList. // using BoxList::minimalBox; // //@ManDoc: Promoted from BoxList. // using BoxList::ixType; // //@ManDoc: Promoted from BoxList. // using BoxList::minimize; // //@ManDoc: Promoted from BoxList. // using BoxList::simplify; // //@ManDoc: Promoted from BoxList. // using BoxList::begin; // //@ManDoc: Promoted from BoxList. // using BoxList::end; // //@ManDoc: Promoted from BoxList // using BoxList::contains; // //@ManDoc: Promoted from BoxList // using BoxList::shift; // //@ManDoc: Promoted from BoxList // using BoxList::shiftHalf; // //@ManDoc: Create a BoxList from this BoxDomain. // BoxList boxList () const; // //@ManDoc: Are the BoxDomains equal? // bool operator== (const BoxDomain& rhs) const; // //@ManDoc: Are the BoxDomains not equal? // bool operator!= (const BoxDomain& rhs) const; // //@ManDoc: Refine all Boxes in the domain by the refinement ratio. // BoxDomain& refine (int ratio); // //@ManDoc: Coarsen all Boxes in the domain by the refinement ratio. // BoxDomain& coarsen (int ratio); // //@ManDoc: Intersect this BoxDomain with Box b. // BoxDomain& intersect (const Box& b); // //@ManDoc: Grow each Box by size sz. // BoxDomain& accrete (int sz); // //@ManDoc: Creates the complement of BoxDomain bl in Box b. // BoxDomain& complementIn (const Box& b, const BoxDomain& bl); }; #endif /*BL_BOXDOMAIN_H*/ ccseapps-2.5/CCSEApps/BoxLib/ParallelDescriptor.cpp0000644000175000017500000005737611634153073023357 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ParallelDescriptor.cpp,v 1.98 2003/01/27 17:10:36 car Exp $ // #include #include #include #include #include FabComTag::FabComTag () { fromProc = 0; toProc = 0; fabIndex = 0; fineIndex = 0; srcComp = 0; destComp = 0; nComp = 0; face = 0; fabArrayId = 0; fillBoxId = 0; procThatNeedsData = 0; procThatHasData = 0; } // // Definition of non-inline members of CommData. // namespace ParallelDescriptor { // // My processor ID. // int m_MyId = -1; // // The number of processors. // int m_nProcs = -1; // // The number of processors in CFD part of computation. // int m_nProcsCFD = -1; // // BoxLib's Communicator // MPI_Comm m_comm; const int ioProcessor = 0; namespace util { // // Reduce helper functons. // void DoAllReduceReal (Real& r, MPI_Op op); void DoAllReduceLong (long& r, MPI_Op op); void DoAllReduceInt (int& r, MPI_Op op); void DoReduceReal (Real& r, MPI_Op op, int cpu); void DoReduceLong (long& r, MPI_Op op, int cpu); void DoReduceInt (int& r, MPI_Op op, int cpu); // // Sets number of CPUs to use in CFD portion of computation via ParmParse. // void SetNProcsCFD (); } } int ParallelDescriptor::NProcsCFD () { if (m_nProcsCFD == -1) util::SetNProcsCFD(); BL_ASSERT(m_nProcsCFD != -1); return m_nProcsCFD; } CommData::CommData () { for (int i = 0; i < length(); i++) m_data[i] = 0; } CommData::CommData (int face, int fabindex, int fromproc, int id, int ncomp, int srccomp, int fabarrayid, const Box& box) { m_data[0] = face; m_data[1] = fabindex; m_data[2] = fromproc; m_data[3] = id; m_data[4] = ncomp; m_data[5] = srccomp; m_data[6] = fabarrayid; const IntVect& sm = box.smallEnd(); for (int i = 0; i < BL_SPACEDIM; i++) m_data[7+i] = sm[i]; const IntVect& bg = box.bigEnd(); for (int i = 0; i < BL_SPACEDIM; i++) m_data[7+BL_SPACEDIM+i] = bg[i]; IntVect typ = box.type(); for (int i = 0; i < BL_SPACEDIM; i++) m_data[7+2*BL_SPACEDIM+i] = typ[i]; } CommData::CommData (const CommData& rhs) { for (int i = 0; i < length(); i++) m_data[i] = rhs.m_data[i]; } CommData& CommData::operator= (const CommData& rhs) { if (!(this == &rhs)) { for (int i = 0; i < length(); i++) m_data[i] = rhs.m_data[i]; } return *this; } bool CommData::operator== (const CommData& rhs) const { for (int i = 0; i < length(); i++) if (!(m_data[i] == rhs.m_data[i])) return false; return true; } std::ostream& operator<< (std::ostream& os, const CommData& cd) { os << cd.face() << ' ' << cd.fabindex() << ' ' << cd.fromproc() << ' ' << cd.id() << ' ' << cd.nComp() << ' ' << cd.srcComp() << ' ' << cd.fabarrayid() << ' ' << cd.box(); return os; } std::ostream& operator<< (std::ostream& os, const Array& cd) { for (int i = 0; i < cd.size(); i++) os << cd[i] << '\n'; return os; } #ifdef BL_USE_MPI #include namespace { const char* the_message_string (const char* file, int line, const char* call, int status) { // // Should be large enough. // const int DIM = 1024; static char buf[DIM]; if ( status ) { std::sprintf(buf, "BoxLib MPI Error: File %s, line %d, %s: %s", file, line, call, ParallelDescriptor::ErrorString(status)); } else { std::sprintf(buf, "BoxLib MPI Error: File %s, line %d, %s", file, line, call); } buf[DIM-1] = '\0'; // Just to be safe. return buf; } } namespace ParallelDescriptor { void MPI_Error (const char* file, int line, const char* str, int rc) { BoxLib::Error(the_message_string(file, line, str, rc)); } } void ParallelDescriptor::Abort () { #ifdef WIN32 throw; #endif MPI_Abort(Communicator(), -1); } void ParallelDescriptor::Abort (int errorcode) { BoxLib::Abort(ErrorString(errorcode)); } const char* ParallelDescriptor::ErrorString (int errorcode) { BL_ASSERT(errorcode > 0 && errorcode <= MPI_ERR_LASTCODE); int len = 0; static char msg[MPI_MAX_ERROR_STRING+1]; MPI_Error_string(errorcode, msg, &len); BL_ASSERT(len <= MPI_MAX_ERROR_STRING); return msg; } ParallelDescriptor::Message::Message () : m_finished(true), m_type(MPI_DATATYPE_NULL), m_req(MPI_REQUEST_NULL) {} ParallelDescriptor::Message::Message (MPI_Request req_, MPI_Datatype type_) : m_finished(false), m_type(type_), m_req(req_) {} ParallelDescriptor::Message::Message (MPI_Status stat_, MPI_Datatype type_) : m_finished(true), m_type(type_), m_req(MPI_REQUEST_NULL), m_stat(stat_) {} void ParallelDescriptor::Message::wait () { BL_MPI_REQUIRE( MPI_Wait(&m_req, &m_stat) ); } bool ParallelDescriptor::Message::test () { int flag; BL_MPI_REQUIRE( MPI_Test(&m_req, &flag, &m_stat) ); m_finished = flag != 0; return m_finished; } int ParallelDescriptor::Message::tag () const { if ( !m_finished ) BoxLib::Error("Message::tag: Not Finished!"); return m_stat.MPI_TAG; } int ParallelDescriptor::Message::pid () const { if ( !m_finished ) BoxLib::Error("Message::pid: Not Finished!"); return m_stat.MPI_SOURCE; } size_t ParallelDescriptor::Message::count () const { if ( m_type == MPI_DATATYPE_NULL ) BoxLib::Error("Message::count: Bad Type!"); if ( !m_finished ) BoxLib::Error("Message::count: Not Finished!"); int cnt; BL_MPI_REQUIRE( MPI_Get_count(&m_stat, m_type, &cnt) ); return cnt; } MPI_Datatype ParallelDescriptor::Message::type () const { return m_type; } MPI_Request ParallelDescriptor::Message::req () const { return m_req; } void ParallelDescriptor::util::SetNProcsCFD () { BL_ASSERT(m_nProcs != -1); BL_ASSERT(m_nProcsCFD == -1); m_nProcsCFD = m_nProcs; ParmParse pp("ParallelDescriptor"); if (pp.query("nProcsCFD",m_nProcsCFD)) { if (!(m_nProcsCFD > 0 && m_nProcsCFD <= m_nProcs)) m_nProcsCFD = m_nProcs; if (ParallelDescriptor::IOProcessor()) std::cout << "--> Running job with NProcsCFD = " << m_nProcsCFD << std::endl; } } void ParallelDescriptor::StartParallel (int* argc, char*** argv) { BL_ASSERT(m_MyId == -1); BL_ASSERT(m_nProcs == -1); BL_ASSERT(m_nProcsCFD == -1); m_comm = MPI_COMM_WORLD; int sflag; BL_MPI_REQUIRE( MPI_Initialized(&sflag) ); if (!sflag) BL_MPI_REQUIRE( MPI_Init(argc, argv) ); BL_MPI_REQUIRE( MPI_Comm_size(Communicator(), &m_nProcs) ); BL_MPI_REQUIRE( MPI_Comm_rank(Communicator(), &m_MyId) ); // // Wait till all other processes are properly started. // BL_MPI_REQUIRE( MPI_Barrier(Communicator()) ); } void ParallelDescriptor::EndParallel () { BL_ASSERT(m_MyId != -1); BL_ASSERT(m_nProcs != -1); BL_MPI_REQUIRE( MPI_Finalize() ); } double ParallelDescriptor::second () { return MPI_Wtime(); } void ParallelDescriptor::Barrier () { BL_MPI_REQUIRE( MPI_Barrier(ParallelDescriptor::Communicator()) ); } void ParallelDescriptor::Barrier (MPI_Comm comm) { BL_MPI_REQUIRE( MPI_Barrier(comm) ); } void ParallelDescriptor::Test (MPI_Request& request, int& flag, MPI_Status& status) { BL_MPI_REQUIRE( MPI_Test(&request,&flag,&status) ); } void ParallelDescriptor::Comm_dup (MPI_Comm comm, MPI_Comm& newcomm) { BL_MPI_REQUIRE( MPI_Comm_dup(comm, &newcomm) ); } void ParallelDescriptor::util::DoAllReduceReal (Real& r, MPI_Op op) { Real recv; BL_MPI_REQUIRE( MPI_Allreduce(&r, &recv, 1, Mpi_typemap::type(), op, Communicator()) ); r = recv; } void ParallelDescriptor::util::DoReduceReal (Real& r, MPI_Op op, int cpu) { Real recv; BL_MPI_REQUIRE( MPI_Reduce(&r, &recv, 1, Mpi_typemap::type(), op, cpu, Communicator()) ); if (ParallelDescriptor::MyProc() == cpu) r = recv; } void ParallelDescriptor::ReduceRealMax (Real& r) { util::DoAllReduceReal(r,MPI_MAX); } void ParallelDescriptor::ReduceRealMin (Real& r) { util::DoAllReduceReal(r,MPI_MIN); } void ParallelDescriptor::ReduceRealSum (Real& r) { util::DoAllReduceReal(r,MPI_SUM); } void ParallelDescriptor::ReduceRealMax (Real& r, int cpu) { util::DoReduceReal(r,MPI_MAX,cpu); } void ParallelDescriptor::ReduceRealMin (Real& r, int cpu) { util::DoReduceReal(r,MPI_MIN,cpu); } void ParallelDescriptor::ReduceRealSum (Real& r, int cpu) { util::DoReduceReal(r,MPI_SUM,cpu); } void ParallelDescriptor::util::DoAllReduceLong (long& r, MPI_Op op) { long recv; BL_MPI_REQUIRE( MPI_Allreduce(&r, &recv, 1, MPI_LONG, op, Communicator()) ); r = recv; } void ParallelDescriptor::util::DoReduceLong (long& r, MPI_Op op, int cpu) { long recv; BL_MPI_REQUIRE( MPI_Reduce(&r, &recv, 1, MPI_LONG, op, cpu, Communicator())); if (ParallelDescriptor::MyProc() == cpu) r = recv; } void ParallelDescriptor::ReduceLongAnd (long& r) { util::DoAllReduceLong(r,MPI_LAND); } void ParallelDescriptor::ReduceLongSum (long& r) { util::DoAllReduceLong(r,MPI_SUM); } void ParallelDescriptor::ReduceLongMax (long& r) { util::DoAllReduceLong(r,MPI_MAX); } void ParallelDescriptor::ReduceLongMin (long& r) { util::DoAllReduceLong(r,MPI_MIN); } void ParallelDescriptor::ReduceLongAnd (long& r, int cpu) { util::DoReduceLong(r,MPI_LAND,cpu); } void ParallelDescriptor::ReduceLongSum (long& r, int cpu) { util::DoReduceLong(r,MPI_SUM,cpu); } void ParallelDescriptor::ReduceLongMax (long& r, int cpu) { util::DoReduceLong(r,MPI_MAX,cpu); } void ParallelDescriptor::ReduceLongMin (long& r, int cpu) { util::DoReduceLong(r,MPI_MIN,cpu); } void ParallelDescriptor::util::DoAllReduceInt (int& r, MPI_Op op) { int recv; BL_MPI_REQUIRE( MPI_Allreduce(&r, &recv, 1, MPI_INT, op, Communicator())); r = recv; } void ParallelDescriptor::util::DoReduceInt (int& r, MPI_Op op, int cpu) { int recv; BL_MPI_REQUIRE( MPI_Reduce(&r, &recv, 1, MPI_INT, op, cpu, Communicator())); if (ParallelDescriptor::MyProc() == cpu) r = recv; } void ParallelDescriptor::ReduceIntSum (int& r) { util::DoAllReduceInt(r,MPI_SUM); } void ParallelDescriptor::ReduceIntMax (int& r) { util::DoAllReduceInt(r,MPI_MAX); } void ParallelDescriptor::ReduceIntMin (int& r) { util::DoAllReduceInt(r,MPI_MIN); } void ParallelDescriptor::ReduceIntSum (int& r, int cpu) { util::DoReduceInt(r,MPI_SUM,cpu); } void ParallelDescriptor::ReduceIntMax (int& r, int cpu) { util::DoReduceInt(r,MPI_MAX,cpu); } void ParallelDescriptor::ReduceIntMin (int& r, int cpu) { util::DoReduceInt(r,MPI_MIN,cpu); } void ParallelDescriptor::ReduceBoolAnd (bool& r) { int src = r; // `src' is either 0 or 1. util::DoAllReduceInt(src,MPI_SUM); r = (src == ParallelDescriptor::NProcs()) ? true : false; } void ParallelDescriptor::ReduceBoolOr (bool& r) { int src = r; // `src' is either 0 or 1. util::DoAllReduceInt(src,MPI_SUM); r = (src == 0) ? false : true; } void ParallelDescriptor::ReduceBoolAnd (bool& r, int cpu) { int src = r; // `src' is either 0 or 1. util::DoReduceInt(src,MPI_SUM,cpu); if (ParallelDescriptor::MyProc() == cpu) r = (src == ParallelDescriptor::NProcs()) ? true : false; } void ParallelDescriptor::ReduceBoolOr (bool& r, int cpu) { int src = r; // `src' is either 0 or 1. util::DoReduceInt(src,MPI_SUM,cpu); if (ParallelDescriptor::MyProc() == cpu) r = (src == 0) ? false : true; } void ParallelDescriptor::Gather (Real* sendbuf, int nsend, Real* recvbuf, int root) { BL_ASSERT(root >= 0); BL_ASSERT(nsend > 0); BL_ASSERT(!(sendbuf == 0)); BL_ASSERT(!(recvbuf == 0)); MPI_Datatype typ = Mpi_typemap::type(); BL_MPI_REQUIRE( MPI_Gather(sendbuf, nsend, typ, recvbuf, nsend, typ, root, Communicator())); } MPI_Op ParallelDescriptor::Max::op () { return MPI_MAX; } MPI_Op ParallelDescriptor::Min::op () { return MPI_MIN; } MPI_Op ParallelDescriptor::Sum::op () { return MPI_SUM; } MPI_Op ParallelDescriptor::Prod::op () { return MPI_PROD; } MPI_Op ParallelDescriptor::Logical_And::op () { return MPI_LAND; } MPI_Op ParallelDescriptor::Boolean_And::op () { return MPI_BAND; } MPI_Op ParallelDescriptor::Logical_Or::op () { return MPI_LOR; } MPI_Op ParallelDescriptor::Boolean_Or::op () { return MPI_BOR; } MPI_Op ParallelDescriptor::Logical_XOr::op () { return MPI_LXOR; } MPI_Op ParallelDescriptor::Boolean_XOr::op () { return MPI_BXOR; } template <> MPI_Datatype ParallelDescriptor::Mpi_typemap::type () { return MPI_CHAR; } template <> MPI_Datatype ParallelDescriptor::Mpi_typemap::type () { return MPI_SHORT; } template <> MPI_Datatype ParallelDescriptor::Mpi_typemap::type () { return MPI_INT; } template <> MPI_Datatype ParallelDescriptor::Mpi_typemap::type () { return MPI_LONG; } template <> MPI_Datatype ParallelDescriptor::Mpi_typemap::type () { return MPI_UNSIGNED_CHAR; } template <> MPI_Datatype ParallelDescriptor::Mpi_typemap::type () { return MPI_UNSIGNED_SHORT; } template <> MPI_Datatype ParallelDescriptor::Mpi_typemap::type () { return MPI_UNSIGNED; } template <> MPI_Datatype ParallelDescriptor::Mpi_typemap::type () { return MPI_UNSIGNED_LONG; } template <> MPI_Datatype ParallelDescriptor::Mpi_typemap::type () { return MPI_FLOAT; } template <> MPI_Datatype ParallelDescriptor::Mpi_typemap::type () { return MPI_DOUBLE; } void ParallelDescriptor::Waitsome (Array& reqs, int& completed, Array& indx, Array& status) { BL_MPI_REQUIRE( MPI_Waitsome(reqs.size(), reqs.dataPtr(), &completed, indx.dataPtr(), status.dataPtr())); } #else /*!BL_USE_MPI*/ void ParallelDescriptor::StartParallel (int*, char***) { m_nProcs = 1; m_nProcsCFD = 1; m_MyId = 0; m_comm = 0; } void ParallelDescriptor::Gather (Real* sendbuf, int nsend, Real* recvbuf, int root) { BL_ASSERT(root == 0); BL_ASSERT(nsend > 0); BL_ASSERT(!(sendbuf == 0)); BL_ASSERT(!(recvbuf == 0)); for (int i = 0; i < nsend; ++i) recvbuf[i] = sendbuf[i]; } ParallelDescriptor::Message::Message () : m_finished(true) {} void ParallelDescriptor::Message::wait () {} bool ParallelDescriptor::Message::test () { return m_finished; } MPI_Request ParallelDescriptor::Message::req () const { return m_req; } void ParallelDescriptor::util::SetNProcsCFD () {} void ParallelDescriptor::EndParallel () {} void ParallelDescriptor::Abort () { #ifdef WIN32 throw; #else std::abort(); #endif } void ParallelDescriptor::Abort (int) { #ifdef WIN32 throw; #else std::abort(); #endif } const char* ParallelDescriptor::ErrorString (int) { return ""; } void ParallelDescriptor::Barrier () {} void ParallelDescriptor::Barrier (MPI_Comm) {} void ParallelDescriptor::Test (MPI_Request&, int&, MPI_Status&) {} void ParallelDescriptor::Comm_dup (MPI_Comm, MPI_Comm&) {} void ParallelDescriptor::ReduceRealMax (Real&) {} void ParallelDescriptor::ReduceRealMin (Real&) {} void ParallelDescriptor::ReduceRealSum (Real&) {} void ParallelDescriptor::ReduceRealMax (Real&,int) {} void ParallelDescriptor::ReduceRealMin (Real&,int) {} void ParallelDescriptor::ReduceRealSum (Real&,int) {} void ParallelDescriptor::ReduceLongAnd (long&) {} void ParallelDescriptor::ReduceLongSum (long&) {} void ParallelDescriptor::ReduceLongMax (long&) {} void ParallelDescriptor::ReduceLongMin (long&) {} void ParallelDescriptor::ReduceLongAnd (long&,int) {} void ParallelDescriptor::ReduceLongSum (long&,int) {} void ParallelDescriptor::ReduceLongMax (long&,int) {} void ParallelDescriptor::ReduceLongMin (long&,int) {} void ParallelDescriptor::ReduceIntSum (int&) {} void ParallelDescriptor::ReduceIntMax (int&) {} void ParallelDescriptor::ReduceIntMin (int&) {} void ParallelDescriptor::ReduceIntSum (int&,int) {} void ParallelDescriptor::ReduceIntMax (int&,int) {} void ParallelDescriptor::ReduceIntMin (int&,int) {} void ParallelDescriptor::ReduceBoolAnd (bool&) {} void ParallelDescriptor::ReduceBoolOr (bool&) {} void ParallelDescriptor::ReduceBoolAnd (bool&,int) {} void ParallelDescriptor::ReduceBoolOr (bool&,int) {} // // Here so we don't need to include in . // double ParallelDescriptor::second () { return BoxLib::wsecond(); } void ParallelDescriptor::Waitsome (Array& reqs, int& completed, Array& indx, Array& status) {} #endif // // This function is the same whether or not we're using MPI. // int ParallelDescriptor::SeqNum () { const int BEG = 1000; const int END = 9000; static int seqno = BEG; int result = seqno++; if (seqno > END) seqno = BEG; return result; } #include BL_FORT_PROC_DECL(BL_PD_BARRIER,bl_pd_barrier)() { ParallelDescriptor::Barrier(); } BL_FORT_PROC_DECL(BL_PD_COMMUNICATOR,bl_pd_communicator)(void* vcomm) { MPI_Comm* comm = reinterpret_cast(vcomm); *comm = ParallelDescriptor::Communicator(); } BL_FORT_PROC_DECL(BL_PD_MYPROC,bl_pd_myproc)(int* myproc) { *myproc = ParallelDescriptor::MyProc(); } BL_FORT_PROC_DECL(BL_PD_NPROCS,bl_pd_nprocs)(int* nprocs) { *nprocs = ParallelDescriptor::NProcs(); } BL_FORT_PROC_DECL(BL_PD_IOPROC,bl_pd_ioproc)(int* ioproc) { *ioproc = ParallelDescriptor::IOProcessorNumber(); } BL_FORT_PROC_DECL(BL_PD_IS_IOPROC,bl_pd_is_ioproc)(int* ioproc) { *ioproc = ParallelDescriptor::IOProcessor()?1:0; } BL_FORT_PROC_DECL(BL_PD_ABORT,bl_pd_abort)() { ParallelDescriptor::Abort(); } #ifdef BL_USE_MPI namespace ParallelDescriptor { template <> MPI_Datatype Mpi_typemap::type() { static MPI_Datatype mine(MPI_DATATYPE_NULL); if ( mine == MPI_DATATYPE_NULL ) { IntVect iv[2]; // Used to construct the data types MPI_Datatype types[] = { MPI_LB, MPI_INT, MPI_UB}; int blocklens[] = { 1, BL_SPACEDIM, 1}; MPI_Aint disp[3]; int n = 0; BL_MPI_REQUIRE( MPI_Address(&iv[0], &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&iv[0].vect, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&iv[1], &disp[n++]) ); for ( int i = n-1; i >= 0; i-- ) { disp[i] -= disp[0]; } BL_MPI_REQUIRE( MPI_Type_struct(n, blocklens, disp, types, &mine) ); BL_MPI_REQUIRE( MPI_Type_commit( &mine ) ); } return mine; } template <> MPI_Datatype Mpi_typemap::type() { static MPI_Datatype mine(MPI_DATATYPE_NULL); if ( mine == MPI_DATATYPE_NULL ) { IndexType iv[2]; // Used to construct the data types MPI_Datatype types[] = { MPI_LB, MPI_UNSIGNED, MPI_UB}; int blocklens[] = { 1, 1, 1}; MPI_Aint disp[3]; int n = 0; BL_MPI_REQUIRE( MPI_Address(&iv[0], &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&iv[0].itype, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&iv[1], &disp[n++]) ); for ( int i = n-1; i >= 0; i-- ) { disp[i] -= disp[0]; } BL_MPI_REQUIRE( MPI_Type_struct(n, blocklens, disp, types, &mine) ); BL_MPI_REQUIRE( MPI_Type_commit( &mine ) ); } return mine; } template <> MPI_Datatype Mpi_typemap::type() { static MPI_Datatype mine(MPI_DATATYPE_NULL); if ( mine == MPI_DATATYPE_NULL ) { Box iv[2]; // Used to construct the data types MPI_Datatype types[] = { MPI_LB, Mpi_typemap::type(), Mpi_typemap::type(), Mpi_typemap::type(), MPI_UB}; int blocklens[] = { 1, 1, 1, 1, 1}; MPI_Aint disp[5]; int n = 0; BL_MPI_REQUIRE( MPI_Address(&iv[0], &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&iv[0].smallend, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&iv[0].bigend, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&iv[0].btype, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&iv[1], &disp[n++]) ); for ( int i = n-1; i >= 0; i-- ) { disp[i] -= disp[0]; } BL_MPI_REQUIRE( MPI_Type_struct(n, blocklens, disp, types, &mine) ); BL_MPI_REQUIRE( MPI_Type_commit( &mine ) ); } return mine; } } #endif ccseapps-2.5/CCSEApps/BoxLib/BoxLib.H0000644000175000017500000000570011634153073020330 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_BOXLIB_H #define BL_BOXLIB_H // // $Id: BoxLib.H,v 1.15 2001/07/31 17:56:25 lijewski Exp $ // // //@Man: //@Memo: Error-reporting Functions and Version Number /*@Doc: This class consists entirely of static error-reporting functions that are used throughout the BoxLib implementation together with a version string. In the best of all possible worlds we'd use a namespace, but we aren't there, yet :-) Note that all the output functions add a terminating exclamation mark, so there is no need to add any punctuation to sentences that get output explicitly. */ namespace BoxLib { void Initialize (int& argc, char**& argv); void Finalize(); // //@ManDoc: Print out message to cerr and exit via BoxLib::Abort(). // void Error (const char * msg = 0); // //@ManDoc: Print out warning message to cerr. // void Warning (const char * msg); // //@ManDoc: Print out message to cerr and exit via abort(). // void Abort (const char * msg = 0); /*@ManDoc: Prints assertion failed messages to cerr and exits via abort(). Intended for use by the BL\_ASSERT() macro in . */ void Assert (const char* EX, const char* file, int line); /*@ManDoc: Prints out an out-of-memory message and aborts. It is called by various BoxLib routines when a call to new fails. Called as BoxLib::OutOfMemory(\_\_FILE\_\_, \_\_LINE\_\_); */ void OutOfMemory (const char* file, int line); #ifdef NDEBUG const bool NDebug = true; #else const bool NDebug = false; #endif } #endif /*BL_BOXLIB_H*/ ccseapps-2.5/CCSEApps/BoxLib/ParmParse.cpp0000644000175000017500000012276111634153073021445 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ParmParse.cpp,v 1.47 2003/01/03 19:25:11 car Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // // Used by constructor to build table. // ParmParse::PP_entry::PP_entry (const std::string& name, const std::list& vals) : m_name(name), m_table(0), m_queried(false) { for ( std::list::const_iterator li = vals.begin(); li != vals.end(); ++li ) { m_vals.push_back(*li); } } ParmParse::PP_entry::PP_entry (const std::string& name, const std::list& table) : m_name(name), m_table(new Table(table)), m_queried(false) { } ParmParse::PP_entry::PP_entry (const PP_entry& pe) : m_name(pe.m_name), m_vals(pe.m_vals), m_table(0), m_queried(pe.m_queried) { if ( pe.m_table ) { m_table = new Table(*pe.m_table); } } ParmParse::PP_entry::~PP_entry () { delete m_table; } ParmParse::PP_entry& ParmParse::PP_entry::operator= (const PP_entry& pe) { if ( &pe == this ) return *this; m_name = pe.m_name; m_vals = pe.m_vals; m_table = 0; m_queried = pe.m_queried; if ( pe.m_table ) { m_table = new Table(*pe.m_table); } return *this; } std::ostream& operator<< (std::ostream& os, const ParmParse::PP_entry& pp) { os << pp.m_name << "(nvals = " << pp.m_vals.size() << ") " << " :: ["; int n = pp.m_vals.size(); for ( int i = 0; i < n; i++ ) { os << pp.m_vals[i]; if ( i < n-1 ) os << ", "; } os << "]"; if ( !os ) { BoxLib::Error("write on ostream failed"); } return os; } namespace { enum PType { pDefn, pValue, pEQ_sign, pOpenBracket, pCloseBracket, pEOF }; template bool is (const std::string& str, T& val) { std::istringstream s(str); s >> val; if ( !s ) return false; return true; } template <> bool is (const std::string& str, std::string& val) { val = str; return true; } template <> bool is (const std::string& str, bool& val) { if ( str == "true" || str == "t" ) { val = true; return true; } if ( str == "false" || str == "f" ) { val = false; return true; } int int_val; if ( is(str, int_val) ) { val = int_val != 0; return true; } double dbl_val; if ( is(str, dbl_val) ) { val = dbl_val != 0; return true; } return false; } ParmParse::Table g_table; typedef std::list::iterator list_iterator; typedef std::list::const_iterator const_list_iterator; template const char* tok_name(const T&) { return typeid(T).name(); } template const char* tok_name(std::vector&) { return tok_name(T());} #if 0 template <> const char* tok_name(const bool&) { return "bool"; } template <> const char* tok_name(const int&) { return "int"; } template <> const char* tok_name(const float&) { return "float"; } template <> const char* tok_name(const double&) { return "double"; } template <> const char* tok_name(const std::string&) { return "std::string"; } template <> const char* tok_name(const Box&) { return "Box"; } template <> const char* tok_name(const IntVect&) { return "IntVect"; } #endif // // Simple lexical analyser. // enum lexState { START, STRING, QUOTED_STRING, IDENTIFIER, LIST }; const char* const state_name[] = { "START", "STRING", "QUOTED_STRING", "IDENTIFIER", "LIST" }; void eat_garbage (const char*& str) { for (;;) { if ( *str == 0 ) break; else if ( *str == '#' ) { while ( *str && *str != '\n' ) { str++; } continue; } else if ( isspace(*str) ) { str++; } else { break; } } } PType getToken (const char*& str, char* ostr) { #define ERROR_MESS \ ostr[k++] = '\0'; \ std::cerr << "ParmParse::getToken(): invalid string = " << ostr << '\n'; \ std::cerr << "STATE = " << state_name[state] \ << ", next char = " << ch << '\n'; \ std::cerr << ", rest of input = \n" << str << '\n'; \ BoxLib::Abort() // // Eat white space and comments. // eat_garbage(str); // // Check for end of file. // if ( *str == 0 ) { return pEOF; } // // Start token scan. // lexState state = START; int k = 0; // index of output string int pcnt = 0; // Tracks nested parens while (1) { char ch = *str; if ( ch == 0 ) { BoxLib::Error("ParmParse::getToken: EOF while parsing"); } switch (state) { case START: if ( ch == '=' ) { ostr[k++] = ch; str++; ostr[k++] = 0; return pEQ_sign; } else if ( ch == '"' ) { str++; state = QUOTED_STRING; } else if ( ch == '(' ) { ostr[k++] = ch; str++; pcnt = 1; state = LIST; } else if ( ch == '{' ) { str++; return pOpenBracket; } else if ( ch == '}' ) { str++; return pCloseBracket; } else if ( isalpha(ch) ) { ostr[k++] = ch; str++; state = IDENTIFIER; } else { ostr[k++] = ch; str++; state = STRING; } break; case IDENTIFIER: if ( isalnum(ch) || ch == '_' || ch == '.' || ch == '[' || ch == ']' ) { ostr[k++] = ch; str++; } else if ( isspace(ch) || ch == '=' ) { ostr[k++] = 0; return pDefn; } else { ostr[k++] = ch; str++; state = STRING; } break; case LIST: if ( ch == '(' ) { ostr[k++] = ch; str++; pcnt++; } else if ( ch == ')' ) { ostr[k++] = ch; str++; pcnt--; if ( pcnt == 0 ) { ostr[k++] = 0; return pValue; } } else { ostr[k++] = ch; str++; } break; case STRING: if ( isspace(ch) || ch == '=' ) { ostr[k++] = 0; return pValue; } else { ostr[k++] = ch; str++; } break; case QUOTED_STRING: if ( ch == '"' ) { str++; ostr[k++] = 0; return pValue; } else { ostr[k++] = ch; str++; } break; default: ERROR_MESS; } } #undef ERROR_MESS } // // Keyword aware string comparison. // static bool ppfound (const std::string& keyword, const ParmParse::PP_entry& pe, bool recordQ) { return (recordQ == (pe.m_table!=0)) && (keyword == pe.m_name); } // // Return the index of the n'th occurence of a parameter name, // except if n==-1, return the index of the last occurence. // Return 0 if the specified occurence does not exist. // const ParmParse::PP_entry* ppindex (const ParmParse::Table& table, int n, const std::string& name, bool recordQ) { const ParmParse::PP_entry* fnd = 0; if ( n == ParmParse::LAST ) { // // Search from back of list. // for (std::list::const_reverse_iterator li = table.rbegin(); li != table.rend(); ++li) { if ( ppfound(name, *li, recordQ) ) { fnd = &*li; break; } } } else { for ( const_list_iterator li=table.begin(); li != table.end(); ++li ) { if ( ppfound(name, *li, recordQ) ) { fnd = &*li; if ( --n < 0 ) { break; } } } if ( n >= 0) { fnd = 0; } } if ( fnd ) { // // Found an entry; mark all occurences of name as used. // for ( const_list_iterator li=table.begin(); li != table.end(); ++li ) { if ( ppfound(name, *li, recordQ) ) { li->m_queried = true; } } } return fnd; } void bldTable (const char*& str, std::list& tab); static void read_file (const char* fname, std::list& tab) { // // Space for input file if it exists. // Note: on CRAY, access requires (char*) not (const char*). // if ( fname != 0 && fname[0] != 0 ) { FILE* pffd = fopen(fname, "rb"); if ( pffd == 0 ) { std::cerr << "ParmParse::read_file(): couldn't open \"" << fname << "\""; BoxLib::Abort(); } // // Get the length. // fseek(pffd, 0, 2); int pflen = (int)ftell(pffd); rewind(pffd); char* str = new char[pflen+1]; memset(str,0,pflen+1); int nread = fread(str, 1, pflen, pffd); if ( !(nread == pflen) ) { std::cerr << "ParmParse::read_file(): fread() only " << nread << " bytes out of " << pflen << " from " << fname; BoxLib::Abort(); } fclose(pffd); const char* b = str; bldTable(b, tab); delete [] str; } } void addDefn (std::string& def, std::list& val, std::list& tab) { static const std::string FileKeyword("FILE"); // // Check that defn exists. // if ( def.empty() ) { val.clear(); return; } // // Check that it has values. // if ( val.empty() ) { std::cerr << "ParmParse::addDefn(): no values for definition " << def << "\n"; BoxLib::Abort(); } // // Check if this defn is a file include directive. // if ( def == FileKeyword && val.size() == 1 ) { // // Read file and add to this table. // const char* fname = val.front().c_str(); read_file(fname, tab); } else { tab.push_back(ParmParse::PP_entry(def,val)); } val.clear(); def = std::string(); } void addTable (std::string& def, ParmParse::Table& val, std::list& tab) { if ( def.empty() ) { val.clear(); return; } // // Check that it has values. // if ( val.empty() ) { std::cerr << "ParmParse::addTable(): no values for Table " << def << "\n"; BoxLib::Abort(); } tab.push_back(ParmParse::PP_entry(def, val)); val.clear(); def = std::string(); } void bldTable (const char*& str, std::list& tab) { std::string cur_name; std::list cur_list; ParmParse::Table cur_table; std::string tmp_str; PType token; const int SCRATCH_STR_LEN = 200; char tokname[SCRATCH_STR_LEN]; for (;;) { token = getToken(str, tokname); switch (token) { case pCloseBracket: if ( !cur_name.empty() && cur_list.empty() ) { BoxLib::Abort("ParmParse::bldTable() defn with no list"); } case pEOF: addDefn(cur_name,cur_list,tab); return; case pOpenBracket: if ( cur_name.empty() ) { BoxLib::Abort("ParmParse::bldTabe() '{' with no blocknamne"); } if ( !cur_list.empty() ) { tmp_str = cur_list.back(); cur_list.pop_back(); addDefn(cur_name, cur_list, tab); cur_name = tmp_str; } bldTable(str, cur_table); addTable(cur_name, cur_table, tab); break; case pEQ_sign: if ( cur_name.empty() ) { BoxLib::Abort("ParmParse::bldTable() EQ with no current defn"); } if ( !cur_list.empty() ) { tmp_str = cur_list.back(); cur_list.pop_back(); addDefn(cur_name,cur_list,tab); cur_name = tmp_str; } // // Read one too far, remove last name on list. // break; case pDefn: if ( cur_name.empty() ) { cur_name = tokname; break; } // // Otherwise, fall through, this may be a string. // case pValue: if ( cur_name.empty() ) { tokname[SCRATCH_STR_LEN-1] = 0; std::string msg("ParmParse::bldTable(): value with no defn: "); msg += tokname; BoxLib::Abort(msg.c_str()); } cur_list.push_back(tokname); break; } } } namespace { template bool squeryval (const ParmParse::Table& table, const std::string& name, T& ptr, int ival, int occurence) { // // Get last occurrance of name in table. // const ParmParse::PP_entry* def = ppindex(table, occurence, name, false); if ( def == 0 ) { return false; } // // Does it have ival values? // if ( ival >= def->m_vals.size() ) { std::cerr << "ParmParse::queryval no value number" << ival << " for "; if ( occurence == ParmParse::LAST ) { std::cerr << "last occurence of "; } else { std::cerr << " occurence " << occurence << " of "; } std::cerr << def->m_name << '\n' << *def << '\n'; BoxLib::Abort(); } const std::string& valname = def->m_vals[ival]; bool ok = is(valname, ptr); if ( !ok ) { std::cerr << "ParmParse::queryval type mismatch on value number " << ival << " of " << '\n'; if ( occurence == ParmParse::LAST ) { std::cerr << " last occurence of "; } else { std::cerr << " occurence number " << occurence << " of "; } std::cerr << def->m_name << '\n'; std::cerr << " Expected an \"" << tok_name(ptr) << "\" type which can't be parsed from the string \"" << valname << "\"\n" << *def << '\n'; BoxLib::Abort(); } return true; } template void sgetval (const ParmParse::Table& table, const std::string& name, T& ptr, int ival, int occurence) { if ( squeryval(table, name,ptr,ival,occurence) == 0 ) { std::cerr << "ParmParse::getval "; if ( occurence >= 0 ) { std::cerr << "occurence number " << occurence << " of "; } std::cerr << "ParmParse::getval(): " << name << " not found in table" << '\n'; ParmParse::dumpTable(std::cerr); BoxLib::Abort(); } } template bool squeryarr (const ParmParse::Table& table, const std::string& name, std::vector& ptr, int start_ix, int num_val, int occurence) { // // Get last occurrance of name in table. // const ParmParse::PP_entry *def = ppindex(table,occurence, name, false); if ( def == 0 ) { return false; } // // Does it have sufficient number of values and are they all // the same type? // if ( num_val == ParmParse::ALL ) { num_val = def->m_vals.size(); } if ( num_val == 0 ) return true; int stop_ix = start_ix + num_val - 1; if ( ptr.size() < stop_ix ) { ptr.resize(stop_ix + 1); } if ( stop_ix >= def->m_vals.size() ) { std::cerr << "ParmParse::queryarr too many values requested for"; if ( occurence == ParmParse::LAST ) { std::cerr << " last occurence of "; } else { std::cerr << " occurence " << occurence << " of "; } std::cerr << def->m_name << '\n' << *def << '\n'; BoxLib::Abort(); } for ( int n = start_ix; n <= stop_ix; n++ ) { const std::string& valname = def->m_vals[n]; bool ok = is(valname, ptr[n]); if ( !ok ) { std::cerr << "ParmParse::queryarr type mismatch on value number " << n << " of "; if ( occurence == ParmParse::LAST ) { std::cerr << " last occurence of "; } else { std::cerr << " occurence number " << occurence << " of "; } std::cerr << def->m_name << '\n'; std::cerr << " Expected an \"" << tok_name(ptr) << "\" type which can't be parsed from the string \"" << valname << "\"\n" << *def << '\n'; BoxLib::Abort(); } } return true; } template void sgetarr (const ParmParse::Table& table, const std::string& name, std::vector& ptr, int start_ix, int num_val, int occurence) { if ( squeryarr(table,name,ptr,start_ix,num_val,occurence) == 0 ) { std::cerr << "ParmParse::sgetarr "; if ( occurence >= 0 ) { std::cerr << "occurence number " << occurence << " of "; } std::cerr << "ParmParse::sgetarr(): " << name << " not found in table" << '\n'; ParmParse::dumpTable(std::cerr); BoxLib::Abort(); } } } // // Initialize ParmParse. // bool initialized = false; void ppinit (int argc, char** argv, const char* parfile, ParmParse::Table& table) { if ( parfile != 0 ) { read_file(parfile, table); } if ( argc > 0 ) { std::string argstr; const char SPACE = ' '; for ( int i = 0; i < argc; i++ ) { argstr += argv[i]; argstr += SPACE; } std::list arg_table; const char* b = argstr.c_str(); bldTable(b, arg_table); // // Append arg_table to end of existing table. // g_table.splice(table.end(), arg_table); } initialized = true; } } // End of unnamed namespace. std::string ParmParse::prefixedName (const std::string& str) const { if ( str.empty() ) { BoxLib::Error("ParmParse::prefixedName: has empty name"); } if ( !m_pstack.top().empty()) { return m_pstack.top() + '.' + str; } return str; } void ParmParse::pushPrefix (const std::string& str) { std::string s(str); if ( !s.empty() ) { if ( !m_pstack.top().empty() ) { s = m_pstack.top() + "." + s; } m_pstack.push(s); } } void ParmParse::popPrefix () { if ( m_pstack.size() <= 1 ) { BoxLib::Error("ParmParse::popPrefix: stack underflow"); } m_pstack.pop(); } std::string ParmParse::getPrefix() const { return m_pstack.top(); } void ParmParse::Initialize (int argc, char** argv, const char* parfile) { if ( initialized ) { BoxLib::Error("ParmParse::Initialize(): already initialized!"); } ppinit(argc, argv, parfile, g_table); } ParmParse::ParmParse (const std::string& prefix) : m_table(g_table) { m_pstack.push(prefix); } ParmParse::ParmParse (const Table& table) : m_table(table) { m_pstack.push(""); } ParmParse::Frame::Frame (ParmParse& pp, const std::string& pfix) : m_pp(pp), m_np(0) { push(pfix); BL_ASSERT( m_np == 1 ); } ParmParse::Frame::~Frame () { BL_ASSERT( m_np > 0 ); while ( m_np ) { pop(); } BL_ASSERT( m_np == 0 ); } void ParmParse::Frame::push (const std::string& str) { m_pp.pushPrefix(str); m_np++; } void ParmParse::Frame::pop () { BL_ASSERT( m_np > 0); m_pp.popPrefix(); m_np--; } std::string ParmParse::Frame::getPrefix () const { return m_pp.getPrefix(); } namespace { bool unused_table_entries_q (const ParmParse::Table& table) { for ( const_list_iterator li = table.begin(); li != table.end(); ++li ) { if ( li->m_table ) { if ( !li->m_queried ) { return true; } else { return unused_table_entries_q(*li->m_table); } } else if ( !li->m_queried ) { return true; } } return false; } void finalize_table (std::string pfx, const ParmParse::Table& table) { for ( const_list_iterator li = table.begin(); li != table.end(); ++li ) { if ( li->m_table ) { if ( !li->m_queried ) { std::cout << "Record " << li->m_name << std::endl; } else { finalize_table(pfx + "::" + li->m_name, *li->m_table); } } else if ( !li->m_queried ) { std::cout << pfx << "::" << *li << std::endl; } } } } void ParmParse::Finalize () { if ( ParallelDescriptor::IOProcessor() && unused_table_entries_q(g_table)) { std::cout << "Unused ParmParse Variables:\n"; finalize_table("[TOP]", g_table); std::cout << "done.\n"; // // First loop through and delete all queried entries. // } g_table.clear(); } void ParmParse::dumpTable (std::ostream& os) { for ( const_list_iterator li=g_table.begin(); li != g_table.end(); ++li ) { os << *li << std::endl; } } int ParmParse::countval (const char* name, int n) const { // // First find n'th occurance of name in table. // const PP_entry* def = ppindex(m_table, n, prefixedName(name), false); return def == 0 ? 0 : def->m_vals.size(); } // BOOL void ParmParse::getkth (const char* name, int k, bool& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival,k); } void ParmParse::get (const char* name, bool& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival, LAST); } int ParmParse::querykth (const char* name, int k, bool& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival,k); } int ParmParse::query (const char* name, bool& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival, LAST); } // INT void ParmParse::getkth (const char* name, int k, int& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival,k); } void ParmParse::get (const char* name, int& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival, LAST); } int ParmParse::querykth (const char* name, int k, int& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival,k); } int ParmParse::query (const char* name, int& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival, LAST); } void ParmParse::getktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val,k); } void ParmParse::getarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } int ParmParse::queryktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix,num_val,k); } int ParmParse::queryarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } // FLOAT void ParmParse::getkth (const char* name, int k, float& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival,k); } void ParmParse::get (const char* name, float& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival, LAST); } int ParmParse::querykth (const char* name, int k, float& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival,k); } int ParmParse::query (const char* name, float& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival, LAST); } void ParmParse::getktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val,k); } void ParmParse::getarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } int ParmParse::queryktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix, num_val,k); } int ParmParse::queryarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } // DOUBLE void ParmParse::getkth (const char* name, int k, double& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival,k); } void ParmParse::get (const char* name, double& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival, LAST); } int ParmParse::querykth (const char* name, int k, double& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival,k); } int ParmParse::query (const char* name, double& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival, LAST); } void ParmParse::getktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val,k); } void ParmParse::getarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } int ParmParse::queryktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix, num_val,k); } int ParmParse::queryarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } // STRING void ParmParse::getkth (const char* name, int k, std::string& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival,k); } void ParmParse::get (const char* name, std::string& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival, LAST); } int ParmParse::querykth (const char* name, int k, std::string& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival,k); } int ParmParse::query (const char* name, std::string& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival, LAST); } void ParmParse::getktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val,k); } void ParmParse::getarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } int ParmParse::queryktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix, num_val,k); } int ParmParse::queryarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } // INTVECT void ParmParse::getkth (const char* name, int k, IntVect& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival,k); } void ParmParse::get (const char* name, IntVect& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival, LAST); } int ParmParse::querykth (const char* name, int k, IntVect& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival,k); } int ParmParse::query (const char* name, IntVect& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival, LAST); } void ParmParse::getktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val,k); } void ParmParse::getarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } int ParmParse::queryktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix, num_val,k); } int ParmParse::queryarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } // BOX void ParmParse::getkth (const char* name, int k, Box& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival,k); } void ParmParse::get (const char* name, Box& ptr, int ival) const { sgetval(m_table, prefixedName(name),ptr,ival, LAST); } int ParmParse::querykth (const char* name, int k, Box& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival,k); } int ParmParse::query (const char* name, Box& ptr, int ival) const { return squeryval(m_table, prefixedName(name),ptr,ival, LAST); } void ParmParse::getktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val,k); } void ParmParse::getarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { sgetarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } int ParmParse::queryktharr (const char* name, int k, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix, num_val,k); } int ParmParse::queryarr (const char* name, std::vector& ptr, int start_ix, int num_val) const { return squeryarr(m_table, prefixedName(name),ptr,start_ix,num_val, LAST); } // // Return number of occurences of parameter name. // int ParmParse::countname (const std::string& name) const { int cnt = 0; for ( const_list_iterator li=m_table.begin(); li != m_table.end(); ++li ) { if ( ppfound(prefixedName(name), *li, false) ) { cnt++; } } return cnt; } int ParmParse::countRecords (const std::string& name) const { int cnt = 0; for ( const_list_iterator li=m_table.begin(); li != m_table.end(); ++li ) { if ( ppfound(prefixedName(name), *li, true) ) { cnt++; } } return cnt; } // // Return true if name in table. // bool ParmParse::contains (const char* name) const { for ( const_list_iterator li = m_table.begin(); li != m_table.end(); ++li ) { if ( ppfound(prefixedName(name), *li, false)) { // // Found an entry; mark all occurences of name as used. // for ( const_list_iterator lli = m_table.begin(); lli != m_table.end(); ++lli ) { if ( ppfound(prefixedName(name), *lli, false) ) { lli->m_queried = true; } } return true; } } return false; } ParmParse::Record ParmParse::getRecord (const std::string& name, int n) const { const PP_entry* pe = ppindex(m_table, n, prefixedName(name), true); if ( pe == 0 ) { std::cerr << "ParmParse::getRecord: record " << name << " not found" << std::endl; BoxLib::Abort(); } return Record(ParmParse(*pe->m_table)); } // // // ParmParse::Record::Record ( const ParmParse& pp ) : m_pp(pp) { } const ParmParse* ParmParse::Record::operator-> () const { return &m_pp; } const ParmParse& ParmParse::Record::operator* () const { return m_pp; } // // FOrtran Interface routines // #include #include namespace { int parser_cnt = 0; std::map parsers; const int EOS = -1; void Fstring_2_int (int istr[], int nlen, const std::string& str) { int i; for ( i = 0; i < nlen-1 && i < str.size(); ++i ) { istr[i] = str[i]; } istr[i] = EOS; } std::string Trim (const std::string& str) { int n; for ( n = str.size(); --n >= 0; ) { if ( str[n] != ' ' ) break; } std::string result; for (int i = 0; i <= n; ++i ) { result += str[i]; } return result; } std::string Fint_2_string (const int* iarr, int nlen) { std::string res; for ( int i = 0; i < nlen && *iarr != EOS; ++i ) { res += *iarr++; } return Trim(res); } void require_valid_parmparse(const std::string& str, int pp) { std::map::const_iterator it = parsers.find(pp); if ( it == parsers.end() ) { std::cerr << "In routine: " << str << ": "; BoxLib::Error("require_valid_parser::not a valid parsers"); } } void require_valid_size(const std::string& str, int asize, int nsize) { if (asize > nsize) { std::cerr << "In routine: " << str << ": "; BoxLib::Error("require_valid_size::not large enough input array"); } } } BL_FORT_PROC_DECL(BL_PP_NEW_CPP, bl_pp_new_cpp)(int* pp, const int istr[], const int* nstr) { *pp = ++parser_cnt; parsers[*pp] = new ParmParse(Trim(Fint_2_string(istr, *nstr))); } BL_FORT_PROC_DECL(BL_PP_DELETE, bl_pp_delete)(int* pp) { require_valid_parmparse("BL_PP_DELETE", *pp); delete parsers[*pp]; parsers.erase(*pp); } BL_FORT_PROC_DECL(BL_PP_GET_INT_CPP, bl_pp_get_int_cpp)(int* ierr, const int* pp, const int istr[], const int* nstr, int* val) { require_valid_parmparse("BL_PP_GET_INT", *pp); *ierr = parsers[*pp]->query(Fint_2_string(istr, *nstr).c_str(), *val); } BL_FORT_PROC_DECL(BL_PP_GET_INT_N_CPP, bl_pp_get_int_n_cpp)(int* ierr, const int* pp, const int istr[], const int* nstr, int val[], int* nval) { std::vector arr; require_valid_parmparse("BL_PP_GET_INT_N", *pp); *ierr = parsers[*pp]->queryarr(Fint_2_string(istr, *nstr).c_str(), arr); require_valid_size("BL_PP_GET_INT_N", arr.size(), *nval); for ( int i = 0; i < arr.size(); ++i ) { val[i] = arr[i]; } *nval = arr.size(); } BL_FORT_PROC_DECL(BL_PP_GET_LOGICAL_CPP, bl_pp_get_logical_cpp)(int* ierr, const int* pp, const int istr[], const int* nstr, int* lval) { bool val; require_valid_parmparse("BL_PP_GET_LOGICAL", *pp); *ierr = parsers[*pp]->query(Fint_2_string(istr, *nstr).c_str(), val); if ( *ierr ) { *lval = val; } } BL_FORT_PROC_DECL(BL_PP_GET_REAL_CPP, bl_pp_get_real_cpp)(int* ierr, const int* pp, const int istr[], const int* nstr, float* val) { require_valid_parmparse("BL_PP_GET_REAL", *pp); *ierr = parsers[*pp]->query(Fint_2_string(istr, *nstr).c_str(), *val); } BL_FORT_PROC_DECL(BL_PP_GET_REAL_N_CPP, bl_pp_get_real_n_cpp)(int* ierr, const int* pp, const int istr[], const int* nstr, float val[], int* nval) { std::vector arr; require_valid_parmparse("BL_PP_GET_REAL_N", *pp); *ierr = parsers[*pp]->queryarr(Fint_2_string(istr, *nstr).c_str(), arr); require_valid_size("BL_PP_GET_REAL_N", arr.size(), *nval); for ( int i = 0; i < arr.size(); ++i ) { val[i] = arr[i]; } *nval = arr.size(); } BL_FORT_PROC_DECL(BL_PP_GET_DOUBLE_CPP, bl_pp_get_double_cpp)(int* ierr, const int* pp, const int istr[], const int* nstr, double* val) { require_valid_parmparse("BL_PP_GET_DOUBLE", *pp); *ierr = parsers[*pp]->query(Fint_2_string(istr, *nstr).c_str(), *val); } BL_FORT_PROC_DECL(BL_PP_GET_DOUBLE_N_CPP, bl_pp_get_double_n_cpp)(int* ierr, const int* pp, const int istr[], const int* nstr, double val[], int* nval) { std::vector arr; require_valid_parmparse("BL_PP_GET_DOUBLE_N", *pp); *ierr = parsers[*pp]->queryarr(Fint_2_string(istr, *nstr).c_str(), arr); require_valid_size("BL_PP_GET_INT_N", arr.size(), *nval); for ( int i = 0; i < arr.size(); ++i ) { val[i] = arr[i]; } *nval = arr.size(); } BL_FORT_PROC_DECL(BL_PP_GET_STRING_CPP, bl_pp_get_string_cpp)(int* ierr, const int* pp, const int istr[], const int* nstr, int ostr[], const int* onstr) { require_valid_parmparse("BL_PP_GET_STRING", *pp); std::string ss; *ierr = parsers[*pp]->query(Fint_2_string(istr, *nstr).c_str(), ss); if ( *ierr ) { Fstring_2_int(ostr, *onstr, ss); } } BL_FORT_PROC_DECL(BL_PP_RECORD_NEW_CPP,bl_pp_record_new_cpp)(const int* pp, int* ppr, const int istr[], const int* nstr) { require_valid_parmparse("BL_PP_RECORD_NEW", *pp); ParmParse::Record record = parsers[*pp]->getRecord(Fint_2_string(istr, *nstr).c_str()); *ppr = ++parser_cnt; parsers[*ppr] = new ParmParse(*record); } BL_FORT_PROC_DECL(BL_PP_RECORD_DELETE,bl_pp_record_delete)(int* ppr) { require_valid_parmparse("BL_PP_RECORD_DELETE", *ppr); delete parsers[*ppr]; parsers.erase(*ppr); } ccseapps-2.5/CCSEApps/BoxLib/WorkQueue.H0000644000175000017500000000441511634153073021102 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BL_WORKQUEUE_H_ #define _BL_WORKQUEUE_H_ // // $Id: WorkQueue.H,v 1.5 2001/11/16 18:19:33 car Exp $ // #include #include extern "C" void* WorkQueue_server(void*); class WorkQueue; class WorkQueue { public: friend void* WorkQueue_server (void*); class task; explicit WorkQueue (int maxthreads_); virtual ~WorkQueue (); int max_threads () const; int num_threads () const; void add (task* data); void drain (); void wait (); virtual void* server (); static void Initialize (); static void Finalize (); protected: mutable ConditionVariable cv; Gate gate; std::queue wrkq; bool quit; bool eof; const int maxthreads; int numthreads; int idlethreads; int tasks; WorkQueue (const WorkQueue&); WorkQueue& operator= (const WorkQueue&); }; class WorkQueue::task { public: virtual void run () = 0; virtual ~task (); }; namespace BoxLib { WorkQueue& theWorkQueue (); } #endif /*_BL_WORKQUEUE_H_*/ ccseapps-2.5/CCSEApps/BoxLib/Orientation.cpp0000644000175000017500000000407211634153073022040 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Orientation.cpp,v 1.9 2001/07/31 22:43:19 lijewski Exp $ // #include #include #include std::ostream& operator<< (std::ostream& os, const Orientation& o) { os << '('<< int(o) << ')' ; if (os.fail()) BoxLib::Error("operator<<(ostream&,Orientation&) failed"); return os; } // // Copied from // #define BL_IGNORE_MAX 100000 std::istream& operator>> (std::istream& is, Orientation& o) { char c; is >> c; if (c == '(') { is >> o.val; is.ignore(BL_IGNORE_MAX, ')'); } else { BoxLib::Error("operator>>(istream&,Orientation&): expected \'(\'"); } if (is.fail()) BoxLib::Error("operator>>(ostream&,Orientation&) failed"); return is; } ccseapps-2.5/CCSEApps/BoxLib/UseCount.cpp0000644000175000017500000000345011634153073021311 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: UseCount.cpp,v 1.2 2001/07/31 22:43:19 lijewski Exp $ // #include UseCount::UseCount () : cnt(new unsigned int(1)) {} UseCount::UseCount (const UseCount& rhs) : cnt(rhs.cnt) { ++*cnt; } void UseCount::decrement () { if (unique()) { delete cnt; cnt = 0; } else { --*cnt; } } UseCount& UseCount::operator= (const UseCount& rhs) { ++*rhs.cnt; decrement(); cnt = rhs.cnt; return *this; } UseCount::~UseCount () { decrement(); } ccseapps-2.5/CCSEApps/BoxLib/ParallelDescriptor.H0000644000175000017500000005063711634153073022755 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_PARALLELDESCRIPTOR_H #define BL_PARALLELDESCRIPTOR_H // // $Id: ParallelDescriptor.H,v 1.76 2002/12/03 00:02:42 lijewski Exp $ // #include #include #include #include // // Used for collecting information used in communicating FABs. // struct FabComTag { int fromProc; int toProc; int fabIndex; int fineIndex; int srcComp; int destComp; int nComp; int face; int fabArrayId; int fillBoxId; int procThatNeedsData; int procThatHasData; Box box; FabComTag (); }; // // Data structure used by a few routines when MPI is enabled. // // Used to communicate up to seven integers and a box. // // We'll store all the info in a single array of integers. // struct CommData { // // We encapsulate seven `int's and a `Box' as an `int[3*BL_SPACEDIM+7]'. // enum { DIM = 3*BL_SPACEDIM+7 }; int m_data[DIM]; CommData (); CommData (int face, int fabindex, int fromproc, int id, int ncomp, int srccomp, int fabarrayid, const Box& box); CommData (const CommData& rhs); CommData& operator= (const CommData& rhs); // // Compare two CommData's. // bool operator== (const CommData& rhs) const; bool operator!= (const CommData& rhs) const { return !operator==(rhs); } // // The number of integers. // int length () const { return DIM; } // // Pointer to the data. // int* dataPtr() { return &m_data[0]; } // // The face. // int face () const { return m_data[0]; } // // The fabindex. // int fabindex () const { return m_data[1]; } // // The processor sending this data. // int fromproc () const { return m_data[2]; } // // The ID of this message. // // Meant to be used as the MPI tag in a send/receive of additional // data associated with this data. // int id () const { return m_data[3]; } // // The number of components. // int nComp () const { return m_data[4]; } void nComp (int ncomp) { m_data[4] = ncomp; } // // The src component. // int srcComp () const { return m_data[5]; } void srcComp (int scomp) { m_data[5] = scomp; } // // The ID of the fab array. // int fabarrayid () const { return m_data[6]; } // // The contained box. // Box box () const { return Box(IntVect(&m_data[7]), IntVect(&m_data[7+BL_SPACEDIM]), IntVect(&m_data[7+2*BL_SPACEDIM])); } }; // // Yes you can output CommData. // std::ostream& operator<< (std::ostream& os, const CommData& cd); std::ostream& operator<< (std::ostream& os, const Array& cd); // //@Man: //@Memo: Parallel functions. /*@Doc: This class contains functions used for implementing parallelism. */ namespace ParallelDescriptor { class Message { public: Message (); Message (MPI_Request req_, MPI_Datatype type_); Message (MPI_Status stat_, MPI_Datatype type_); void wait (); bool test (); size_t count () const; int tag () const; int pid () const; MPI_Datatype type () const; MPI_Request req () const; private: bool m_finished; MPI_Datatype m_type; MPI_Request m_req; mutable MPI_Status m_stat; }; /*@ManDoc: Perform any needed parallel initialization. This MUST be the first routine in this class called from within a program. */ void StartParallel (int* argc = 0, char*** argv = 0); /*@ManDoc: Perform any needed parallel finalization. This MUST be the last routine in this class called from within a program. */ void EndParallel (); // //@ManDoc: Returns processor number of calling program. // extern int m_MyId; inline int MyProc () { BL_ASSERT(m_MyId != -1); return m_MyId; } // //@ManDoc: Returns number of CPUs involved in the computation. // extern int m_nProcs; inline int NProcs () { BL_ASSERT(m_nProcs != -1); return m_nProcs; } // //@ManDoc: The CPU number of the I/O Processor. // extern const int ioProcessor; inline int IOProcessorNumber () { return ioProcessor; } // //@ManDoc: Is this CPU the I/O Processor? // inline bool IOProcessor () { return MyProc() == IOProcessorNumber(); } // //@ManDoc: Returns number of CPUs to use in CFD portion of computation. // int NProcsCFD (); // //@ManDoc: BoxLib's Parallel Communicator, probably MPI_COMM_WORLD // extern MPI_Comm m_comm; inline MPI_Comm Communicator () { return m_comm; } // //@ManDoc: // void Barrier (); void Barrier (MPI_Comm comm); // //@ManDoc: // void Test (MPI_Request& request, int& flag, MPI_Status& status); // //@ManDoc: // void Comm_dup (MPI_Comm comm, MPI_Comm& newcomm); // //@ManDoc: Issue architecture specific Abort. // void Abort (); // //@ManDoc: Abort with specified error code. // void Abort (int errorcode); // //@ManDoc: ErrorString return string associated with error internal error condition // const char* ErrorString (int errcode); // //@ManDoc: Returns wall-clock seconds since start of execution. // double second (); // //@ManDoc: And-wise boolean reduction. // void ReduceBoolAnd (bool& rvar); // //@ManDoc: And-wise boolean reduction to specified cpu. // void ReduceBoolAnd (bool& rvar, int cpu); // //@ManDoc: Or-wise boolean reduction. // void ReduceBoolOr (bool& rvar); // //@ManDoc: Or-wise boolean reduction to specified cpu. // void ReduceBoolOr (bool& rvar, int cpu); // //@ManDoc: Real sum reduction. // void ReduceRealSum (Real& rvar); // //@ManDoc: Real sum reduction to specified cpu. // void ReduceRealSum (Real& rvar, int cpu); // //@ManDoc: Real max reduction. // void ReduceRealMax (Real& rvar); // //@ManDoc: Real max reduction to specified cpu. // void ReduceRealMax (Real& rvar, int cpu); // //@ManDoc: Real min reduction. // void ReduceRealMin (Real& rvar); // //@ManDoc: Real min reduction to specified cpu. // void ReduceRealMin (Real& rvar, int cpu); // //@ManDoc: Integer sum reduction. // void ReduceIntSum (int& rvar); // //@ManDoc: Integer sum reduction to specified cpu. // void ReduceIntSum (int& rvar, int cpu); // //@ManDoc: Integer max reduction. // void ReduceIntMax (int& rvar); // //@ManDoc: Integer max reduction to specified cpu. // void ReduceIntMax (int& rvar, int cpu); // //@ManDoc: Integer min reduction. // void ReduceIntMin (int& rvar); // //@ManDoc: Integer min reduction to specified cpu. // void ReduceIntMin (int& rvar, int cpu); // //@ManDoc: Long sum reduction. // void ReduceLongSum (long& rvar); // //@ManDoc: Long sum reduction to specified cpu. // void ReduceLongSum (long& rvar, int cpu); // //@ManDoc: Long max reduction. // void ReduceLongMax (long& rvar); // //@ManDoc: Long max reduction to specified cpu. // void ReduceLongMax (long& rvar, int cpu); // //@ManDoc: Long min reduction. // void ReduceLongMin (long& rvar); // //@ManDoc: Long min reduction to specified cpu. // void ReduceLongMin (long& rvar, int cpu); // //@ManDoc: Long and-wise reduction. // void ReduceLongAnd (long& rvar); // //@ManDoc: Long and-wise reduction to specified cpu. // void ReduceLongAnd (long& rvar, int cpu); // //@ManDoc: Parallel gather. // void Gather (Real* sendbuf, int sendcount, Real* recvbuf, int root); // //@ManDoc: Returns sequential message sequence numbers in range 1000-9000. // int SeqNum (); template Message Asend(const T*, size_t n, int pid, int tag); template Message Asend(const T*, size_t n, int pid, int tag, MPI_Comm comm); template Message Asend(const std::vector& buf, int pid, int tag); template Message Arecv(T*, size_t n, int pid, int tag); template Message Arecv(T*, size_t n, int pid, int tag, MPI_Comm comm); template Message Arecv(std::vector& buf, int pid, int tag); template Message Send(const T* buf, size_t n, int dst_pid, int tag); template Message Send(const std::vector& buf, int dst_pid, int tag); template Message Recv(T*, size_t n, int pid, int tag); template Message Recv(std::vector& t, int pid, int tag); template void Bcast(T*, size_t n, int root = 0); template T Reduce(const T& t); template void Scatter(T*, size_t n, const T1*, size_t n1, int root); template void Gather(const T*, size_t n, T1*, size_t n1, int root); template std::vector Gather(const T&, int root); void Waitsome (Array&, int&, Array&, Array&); void MPI_Error(const char* file, int line, const char* msg, int rc); } #define BL_MPI_REQUIRE(x) \ do \ { \ if ( int l_status_ = (x) ) \ { \ ParallelDescriptor::MPI_Error(__FILE__,__LINE__,#x, l_status_); \ } \ } \ while ( false ) #if BL_USE_MPI template ParallelDescriptor::Message ParallelDescriptor::Asend (const T* buf, size_t n, int dst_pid, int tag) { MPI_Request req; BL_MPI_REQUIRE( MPI_Isend(const_cast(buf), n, Mpi_typemap::type(), dst_pid, tag, Communicator(), &req) ); return Message(req, Mpi_typemap::type()); } template ParallelDescriptor::Message ParallelDescriptor::Asend (const T* buf, size_t n, int dst_pid, int tag, MPI_Comm comm) { MPI_Request req; BL_MPI_REQUIRE( MPI_Isend(const_cast(buf), n, Mpi_typemap::type(), dst_pid, tag, comm, &req) ); return Message(req, Mpi_typemap::type()); } template ParallelDescriptor::Message ParallelDescriptor::Asend (const std::vector& buf, int dst_pid, int tag) { MPI_Request req; BL_MPI_REQUIRE( MPI_Isend(const_cast(&buf[0]), buf.size(), Mpi_typemap::type(), dst_pid, tag, Communicator(), &req) ); return Message(req, Mpi_typemap::type()); } template ParallelDescriptor::Message ParallelDescriptor::Send (const T* buf, size_t n, int dst_pid, int tag) { BL_MPI_REQUIRE( MPI_Send(const_cast(buf), n, Mpi_typemap::type(), dst_pid, tag, Communicator()) ); return Message(); } template ParallelDescriptor::Message ParallelDescriptor::Send (const std::vector& buf, int dst_pid, int tag) { BL_MPI_REQUIRE( MPI_Send(const_cast(&buf[0]), buf.size(), Mpi_typemap::type(), dst_pid, tag, Communicator()) ); return Message(); } template ParallelDescriptor::Message ParallelDescriptor::Arecv (T* buf, size_t n, int src_pid, int tag) { MPI_Request req; BL_MPI_REQUIRE( MPI_Irecv(buf, n, Mpi_typemap::type(), src_pid, tag, Communicator(), &req) ); return Message(req, Mpi_typemap::type()); } template ParallelDescriptor::Message ParallelDescriptor::Arecv (T* buf, size_t n, int src_pid, int tag, MPI_Comm comm) { MPI_Request req; BL_MPI_REQUIRE( MPI_Irecv(buf, n, Mpi_typemap::type(), src_pid, tag, comm, &req) ); return Message(req, Mpi_typemap::type()); } template ParallelDescriptor::Message ParallelDescriptor::Arecv (std::vector& buf, int src_pid, int tag) { MPI_Request req; BL_MPI_REQUIRE( MPI_Irecv(&buf[0], buf.size(), Mpi_typemap::type(), src_pid, tag, Communicator(), &req) ); return Message(req, Mpi_typemap::type()); } template ParallelDescriptor::Message ParallelDescriptor::Recv (T* buf, size_t n, int src_pid, int tag) { MPI_Status stat; BL_MPI_REQUIRE( MPI_Recv(buf, n, Mpi_typemap::type(), src_pid, tag, Communicator(), &stat) ); return Message(stat, Mpi_typemap::type()); } template ParallelDescriptor::Message ParallelDescriptor::Recv (std::vector& buf, int src_pid, int tag) { MPI_Status stat; BL_MPI_REQUIRE( MPI_Recv(&buf[0], buf.size(), Mpi_typemap::type(), src_pid, tag, Communicator(), &stat) ); return Message(stat, Mpi_typemap::type()); } template T ParallelDescriptor::Reduce (const T& t) { T recv; BL_MPI_REQUIRE( MPI_Allreduce(const_cast(&t), &recv, 1, Mpi_typemap::type(), Op::op(), Communicator()) ); return recv; } template void ParallelDescriptor::Bcast (T* t, size_t n, int root) { BL_MPI_REQUIRE( MPI_Bcast(t, n, Mpi_typemap::type(), root, Communicator()) ); } template void ParallelDescriptor::Gather (const T* t, size_t n, T1* t1, size_t n1, int root) { BL_MPI_REQUIRE( MPI_Gather(const_cast(t), n, Mpi_typemap::type(), t1, n1, Mpi_typemap::type(), root, Communicator()) ); } template std::vector ParallelDescriptor::Gather (const T& t, int root) { std::vector resl; if ( root == MyProc() ) resl.resize(NProcs()); BL_MPI_REQUIRE( MPI_Gather(const_cast(&t), 1, Mpi_typemap::type(), &resl[0], 1, Mpi_typemap::type(), root, Communicator()) ); return resl; } template void ParallelDescriptor::Scatter (T* t, size_t n, const T1* t1, size_t n1, int root) { BL_MPI_REQUIRE( MPI_Scatter(const_cast(t1), n1, Mpi_typemap::type(), t, n, Mpi_typemap::type(), root, Communicator()) ); } #else namespace ParallelDescriptor { template Message Asend(const T* buf, size_t n, int dst_pid, int tag) { return Message(); } template Message Asend(const T* buf, size_t n, int dst_pid, int tag, MPI_Comm comm) { return Message(); } template Message Asend(const std::vector& buf, int dst_pid, int tag) { return Message(); } template Message Send(const T* buf, size_t n, int dst_pid, int tag) { return Message(); } template Message Send(const std::vector& buf, int dst_pid, int tag) { return Message(); } template Message Arecv(T* buf, size_t n, int src_pid, int tag) { return Message(); } template Message Arecv(T* buf, size_t n, int src_pid, int tag, MPI_Comm comm) { return Message(); } template Message Arecv(std::vector& buf, int src_pid, int tag) { return Message(); } template Message Recv(T* buf, size_t n, int src_pid, int tag) { return Message(); } template Message Recv(std::vector& buf, int src_pid, int tag) { return Message(); } template T Reduce(const T& t) { return t; } template void Bcast(T* t, size_t n, int root) {} template void Gather(const T* t, size_t n, T1* t1, size_t n1, int root) {} template std::vector Gather(const T& t, int root) { std::vector resl(1); resl[0] = t; return resl; } template void Scatter(T* t, size_t n, const T1* t1, size_t n1, int root) {} } #endif #endif /*BL_PARALLELDESCRIPTOR_H*/ ccseapps-2.5/CCSEApps/BoxLib/VisMF.H0000644000175000017500000002121611634153073020135 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_VISMF_H #define BL_VISMF_H // // $Id: VisMF.H,v 1.51 2001/07/31 17:56:27 lijewski Exp $ // #include // //@Man: //@Memo: File I/O for MultiFabs. /*@Doc: Wrapper class for reading/writing MultiFabs to disk in various "smart" ways. */ class VisMF { public: // //@ManDoc: How we write out MultiFabs. // enum How { OneFilePerCPU }; /*@ManDoc: Construct by reading in the on-disk VisMF of the specified name. The MF on-disk is read lazily. The name here is the name of the MF not the name of the on-disk file. */ explicit VisMF (const std::string& mf_name); // //@ManDoc: A structure containing info regarding an on-disk FAB. // struct FabOnDisk { // //@ManDoc: The default constructor -- null out all fields. // FabOnDisk (); // //@ManDoc: Constructor that sets the two values. // FabOnDisk (const std::string& name, long offset); // // The two data values in a FabOnDisk structure. // std::string m_name; // The name of file containing the FAB. long m_head; // Offset to start of FAB in file. // // Prefixed to lines of FabOnDisk I/O. // static const std::string Prefix; }; // //@ManDoc: An on-disk MultiFab contains this info in a header file. // struct Header { // // The current version of the MultiFab Header code. // enum { Version = 1 }; // //@ManDoc: The default constructor. // Header (); // //@ManDoc: Construct from a MultiFab. // Header (const MultiFab& mf, How how); // // The data. // int m_vers; // The version # of the Header. How m_how; // How the MF was written to disk. int m_ncomp; // Number of components in MF. int m_ngrow; // The number of ghost cells in MF. BoxArray m_ba; // The BoxArray of the MF. Array< FabOnDisk > m_fod; // FabOnDisk info for contained FABs. Array< Array > m_min; // The min()s of each component of FABs. Array< Array > m_max; // The max()s of each component of FABs. }; // //@ManDoc: The number of components in the on-disk MultiFab. // int nComp () const; // //@ManDoc: The grow factor of the on-disk MultiFab. // int nGrow () const; // //@ManDoc: # of FABs in the VisMF. Equal to # of Boxes in the BoxArray. // int size () const; // //@ManDoc: The BoxArray of the on-disk MultiFab. // const BoxArray& boxArray () const; // //@ManDoc: The min of the FAB (in valid region) at specified index and component. // Real min (int fabIndex, int nComp) const; // //@ManDoc: The max of the FAB (in valid region) at specified index and component. // Real max (int fabIndex, int nComp) const; /*@ManDoc: The FAB at the specified index and component. Reads it from disk if necessary. This reads only the specified component. */ const FArrayBox& GetFab (int fabIndex, int compIndex) const; // //@ManDoc: Delete()s the FAB at the specified index and component. // void clear (int fabIndex, int compIndex); // //@ManDoc: Delete()s the FAB at the specified index (all components). // void clear (int fabIndex); // //@ManDoc: Delete()s all the FABs. // void clear (); /*@ManDoc: Write a MultiFab to disk in a "smart" way. Returns the total number of bytes written on this processor. If set\_ghost is true, sets the ghost cells in the MultiFab to one-half the average of the min and max over the valid region of each contained FAB. */ static long Write (const MultiFab& mf, const std::string& name, VisMF::How how = OneFilePerCPU, bool set_ghost = false); /*@ManDoc: Read a MultiFab from disk written using VisMF::Write(). The MultiFab `mf' must have been defined using the default constructor. */ static void Read (MultiFab& mf, const std::string& name); // //@ManDoc: We try to do I/O with buffers of this size. // enum { IO_Buffer_Size = 40960 * 32 }; // // The type of a char buffer required by [p]setbuf(). // #ifdef BL_SETBUF_SIGNED_CHAR typedef signed char Setbuf_Char_Type; #else typedef char Setbuf_Char_Type; #endif // //@ManDoc: A simple character buffer for setbuf() usage. // typedef Array IO_Buffer; // //@ManDoc: The file offset of the passed ostream. // static long FileOffset (std::ostream& os); // //@ManDoc: Read the entire fab (all components). // FArrayBox* readFAB (int fabIndex, const std::string& mfName); // //@ManDoc: Read the specified fab component. // FArrayBox* readFAB (int fabIndex, int ncomp); private: // // These are disallowed. // VisMF (const VisMF&); VisMF& operator= (const VisMF&); static FabOnDisk Write (const FArrayBox& fab, const std::string& filename, std::ostream& os, long& bytes); static long WriteHeader (const std::string& mf_name, VisMF::Header& hdr); // // Read the fab. // If ncomp == -1 reads the whole FAB. // Otherwise read just that component. // static FArrayBox* readFAB (int fabIndex, const std::string& mf_name, const Header& hdr, int ncomp = -1); static std::string DirName (const std::string& filename); static std::string BaseName (const std::string& filename); // // The suffix appended to files containing FAB data. // static const std::string FabFileSuffix; // // The suffix appended to files containing MultiFabs. // static const std::string MultiFabHdrFileSuffix; // // Name of the MultiFab. // std::string m_mfname; // // The VisMF header as read from disk. // Header m_hdr; // // We manage the FABs individually. // mutable Array< Array > m_pa; }; // // Write a FabOnDisk to an ostream in ASCII. // std::ostream& operator<< (std::ostream& os, const VisMF::FabOnDisk& fod); // // Read a FabOnDisk from an istream. // std::istream& operator>> (std::istream& is, VisMF::FabOnDisk& fod); // // Write an Array to an ostream in ASCII. // std::ostream& operator<< (std::ostream& os, const Array& fa); // // Read an Array from an istream. // std::istream& operator>> (std::istream& is, Array& fa); // // Write a VisMF::Header to an ostream in ASCII. // std::ostream& operator<< (std::ostream& os, const VisMF::Header& hd); // // Read a VisMF::Header from an istream. // std::istream& operator>> (std::istream& is, VisMF::Header& hd); #endif /*BL_VISMF_H*/ ccseapps-2.5/CCSEApps/BoxLib/CArena.cpp0000644000175000017500000001357211634153073020703 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: CArena.cpp,v 1.31 2001/12/13 23:46:08 car Exp $ // #include #include #include #include CArena::CArena (size_t hunk_size) { // // Force alignment of hunksize. // m_hunk = Arena::align(hunk_size == 0 ? DefaultHunkSize : hunk_size); m_used = 0; BL_ASSERT(m_hunk >= hunk_size); BL_ASSERT(m_hunk%sizeof(Arena::Word) == 0); } CArena::~CArena () { for (unsigned int i = 0; i < m_alloc.size(); i++) ::operator delete(m_alloc[i]); } void* CArena::alloc (size_t nbytes) { nbytes = Arena::align(nbytes == 0 ? 1 : nbytes); // // Find node in freelist at lowest memory address that'll satisfy request. // NL::iterator free_it = m_freelist.begin(); for ( ; free_it != m_freelist.end(); ++free_it) if ((*free_it).size() >= nbytes) break; void* vp = 0; if (free_it == m_freelist.end()) { const size_t N = nbytes < m_hunk ? m_hunk : nbytes; vp = ::operator new(N); m_used += N; m_alloc.push_back(vp); if (nbytes < m_hunk) { // // Add leftover chunk to free list. // // Insert with a hint -- should be largest block in the set. // void* block = static_cast(vp) + nbytes; m_freelist.insert(m_freelist.end(), Node(block, m_hunk-nbytes)); } } else { BL_ASSERT((*free_it).size() >= nbytes); BL_ASSERT(m_busylist.find(*free_it) == m_busylist.end()); vp = (*free_it).block(); if ((*free_it).size() > nbytes) { // // Insert remainder of free block back into freelist. // // Insert with a hint -- right after the current block being split. // Node freeblock = *free_it; freeblock.size(freeblock.size() - nbytes); freeblock.block(static_cast(vp) + nbytes); m_freelist.insert(free_it, freeblock); } m_freelist.erase(free_it); } m_busylist.insert(Node(vp, nbytes)); BL_ASSERT(!(vp == 0)); return vp; } void CArena::free (void* vp) { if (vp == 0) // // Allow calls with NULL as allowed by C++ delete. // return; // // `vp' had better be in the busy list. // NL::iterator busy_it = m_busylist.find(Node(vp,0)); BL_ASSERT(!(busy_it == m_busylist.end())); BL_ASSERT(m_freelist.find(*busy_it) == m_freelist.end()); void* freeblock = static_cast((*busy_it).block()); // // Put free'd block on free list and save iterator to insert()ed position. // std::pair pair_it = m_freelist.insert(*busy_it); BL_ASSERT(pair_it.second == true); NL::iterator free_it = pair_it.first; BL_ASSERT(free_it != m_freelist.end() && (*free_it).block() == freeblock); // // And remove from busy list. // m_busylist.erase(busy_it); // // Coalesce freeblock(s) on lo and hi side of this block. // if (!(free_it == m_freelist.begin())) { NL::iterator lo_it = free_it; --lo_it; void* addr = static_cast((*lo_it).block()) + (*lo_it).size(); if (addr == (*free_it).block()) { // // This cast is needed as iterators to set return const values; // i.e. we can't legally change an element of a set. // In this case I want to change the size() of a block // in the freelist. Since size() is not used in the ordering // relations in the set, this won't effect the order; // i.e. it won't muck up the ordering of elements in the set. // I don't want to have to remove the element from the set and // then reinsert it with a different size() as it'll just go // back into the same place in the set. // Node* node = const_cast(&(*lo_it)); BL_ASSERT(!(node == 0)); node->size((*lo_it).size() + (*free_it).size()); m_freelist.erase(free_it); free_it = lo_it; } } NL::iterator hi_it = free_it; void* addr = static_cast((*free_it).block()) + (*free_it).size(); if (++hi_it != m_freelist.end() && addr == (*hi_it).block()) { // // Ditto the above comment. // Node* node = const_cast(&(*free_it)); BL_ASSERT(!(node == 0)); node->size((*free_it).size() + (*hi_it).size()); m_freelist.erase(hi_it); } } size_t CArena::heap_space_used () const { return m_used; } ccseapps-2.5/CCSEApps/BoxLib/IndexType.H0000644000175000017500000001515611634153073021070 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_INDEXTYPE_H #define BL_INDEXTYPE_H // // $Id: IndexType.H,v 1.14 2001/10/10 20:12:44 car Exp $ // #include #include #include #include // //@Man: //@Memo: Cell-Based or Node-Based Indices /*@Doc: The class IndexType defines an index as being cell based or node (edge) based in each of the BL\_SPACEDIM directions. This class defines an enumerated type CellIndex to be either CELL or NODE; i.e. each of the BL\_SPACEDIM dimensions must be either CELL or NODE. */ class IndexType { friend MPI_Datatype ParallelDescriptor::Mpi_typemap::type(); public: // //@ManDoc: The cell index type: one of CELL or NODE. // enum CellIndex { CELL = 0, NODE = 1 }; // //@ManDoc: The default constructor // IndexType (); // //@ManDoc: The copy constructor. // IndexType (const IndexType& rhs); // //@ManDoc: Construct an IndexType identical to an IntVect. // explicit IndexType (const IntVect& iv); // //@ManDoc: The assignment operator. // IndexType& operator= (const IndexType& rhs); /*@ManDoc: Construct an IndexType given an explicit CellIndex for each direction. D\_DECL is a macro that sets the constructor to take BL\_SPACEDIM arguments. */ IndexType (D_DECL(CellIndex i, CellIndex j, CellIndex k)); // //@ManDoc: Set IndexType to be NODE based in direction dir. // void set (int dir); // //@ManDoc: Set IndexType to be CELL based in direction dir. // void unset (int dir); // //@ManDoc: True if IndexType is NODE based in direction dir. // bool test (int dir) const; // //@ManDoc: Set NODE based in all directions. // void setall (); // //@ManDoc: Set CELL based in all directions. // void clear (); // //@ManDoc: True if this IndexType is NODE based in any direction. // bool any () const; // //@ManDoc: True if IndexType is valid. // bool ok () const; // //@ManDoc: Change from CELL to NODE or NODE to CELL in direction dir. // void flip (int i); // //@ManDoc: True if IndexTypes are identical. // bool operator== (const IndexType& t) const; // //@ManDoc: True if IndexTypes are not identical. // bool operator!= (const IndexType& t) const; // //@ManDoc: True if the IndexType is CELL based in all directions. // bool cellCentered () const; // //@ManDoc: True if the IndexType is NODE based in all directions. // bool nodeCentered () const; // //@ManDoc: Set IndexType to CellIndex type t in direction dir. // void setType (int dir, CellIndex t); // //@ManDoc: Returns the CellIndex in direction dir. // CellIndex ixType (int dir) const; // //@ManDoc: Return an integer representing the IndexType in direction dir. // int operator[] (int dir) const; // //@ManDoc: Fill an IntVect of size BL\_SPACEDIM with IndexTypes. // IntVect ixType () const; /*@ManDoc: This static member function returns an IndexType object of value IndexType::CELL. It is provided as a convenience to our users when defining a Box all of whose faces should be of type IndexType::CELL. */ static IndexType TheCellType (); /*@ManDoc: This static member function returns an IndexType object of value IndexType::NODE. It is provided as a convenience to our users when defining a Box all of whose faces should be of type IndexType::NODE. */ static IndexType TheNodeType (); private: // // Returns 1<> (std::istream& is, IndexType& itype); inline int IndexType::mask (int k) { return 1< // //@Man: //@Memo: /*@Doc: An enum that controls whether or not class PArray manages the pointed to objects, as well as the pointer itself. Valid values are PArrayNoManage and PArrayManage. */ enum PArrayPolicy { PArrayNoManage = 0, PArrayManage = 1 }; // //@Man: //@Memo: An Array of Pointers to Objects of Type T /*@Doc: The PArray class is similar to the Array class except that it implements an array of pointers to objects of type T rather than an array of the objects themselves. As with Array objects, PArray objects know about their length, can be dynamically resized and have built-in automatic bounds checking. When a PArray object is destructed, should only the pointers be destructed or should the objects to which they point also be deleted? The PArray class allows for both scenarios. By default, it will only remove the pointers. If the array is constructed with the PArrayManage argument it will also delete all the objects pointed to in the array. This is a concrete class, not a polymorphic one. PArrays do NOT provide a copy constructor or an assignment operator. */ template class PArray { public: /*@ManDoc: Constructs a PArray with no elements. The default memory management policy is not to delete the underlying objects upon destruction. */ explicit PArray (PArrayPolicy _managed = PArrayNoManage); /*@ManDoc: Constructs a PArray of length len of null pointers. The default memory management policy is not to delete the underlying objects upon destruction. */ explicit PArray (int len, PArrayPolicy _managed = PArrayNoManage); /*@ManDoc: The destructor. If the memory management policy was set to Manage upon construction, this destructor will also delete all objects referenced by the pointers in this array. */ ~PArray (); // //@ManDoc: Returns true if the i'th element is not the null pointer. // bool defined (int i) const; /*@ManDoc: Returns a constant reference to the object pointed to by the i'th element in this PArray. Performs bounds checking when the library is compiled in debug mode. */ const T& operator[] (int i) const; /*@ManDoc: Returns a reference to the object pointed to by the i'th element in this PArray. Performs bounds checking when the library is compiled in debug mode. */ T& operator[] (int i); /*@ManDoc: Returns a constant reference to the object pointed to by the i'th element in the PArray. It is an error if the i'th element is the null pointer. */ const T& get (int i) const; /*@ManDoc: Returns a reference to the object pointed to by the i'th element in the PArray. It is an error if the i'th element is the null pointer. */ T& get (int i); /*@ManDoc: Defines the i'th element of this PArray to the pointer value elem. It is an error if the i'th element previously had a value. */ void set (int i, T* elem); // //@ManDoc: Returns the number of elements. // int size () const; /*@ManDoc: This function sets each pointer in this PArray to null. If the memory management policy was set to Manage upon construction, this function will also delete all objects referenced by the pointers in this array. */ void clear (); /*@ManDoc: The i'th element in this PArray is set to null. If the memory management policy was set to Manage upon construction, this function will also delete the object referenced by that pointer. */ void clear (int i); /*@ManDoc: This function changes the size of the array to newsize while preserving the value of as many array elements as possible. If newsize is greater than the current length, the array is grown and the new elements are null pointers. If newsize is less than the current length the array is cropped with the remaining elements retaining their original pointer values. If the memory management policy was set to Manage, any cropped pointers are deleted. */ void resize (int newsize); /*@ManDoc: This function does a resize and changes the PArrayPolicy. (Especially for arrays of PArray where the user wants the default policy to be managed--the default constructor makes the default unmanaged). If the new managed policy is different from the old one, none of the elements of the original are retained. */ void resize (int newsize, PArrayPolicy newmanagedpolicy); /*@ManDoc: Removes the i'th element from the PArray and returns the pointer to the calling function. Nulls out the pointer in the PArray. */ T* remove (int i); protected: // // The underlying representation. // Array vp; // // The memory management policy. // PArrayPolicy managed; public: // // Disallow these. FIXME // PArray (const PArray&); // PArray operator= (const PArray&); }; template PArray::PArray (const PArray& c) { BL_ASSERT(c.size()==0); managed = c.managed; } template PArray::PArray (PArrayPolicy _managed) : managed(_managed) {} template inline bool PArray::defined (int i) const { return vp[i] != 0; } template inline const T& PArray::operator[] (int i) const { BL_ASSERT(vp[i] != 0); return *((T*)(vp[i])); } template inline T& PArray::operator[] (int i) { BL_ASSERT(vp[i] != 0); return *((T*)(vp[i])); } template inline const T& PArray::get (int i) const { BL_ASSERT(vp[i] != 0); return *((T*)(vp[i])); } template inline T& PArray::get (int i) { BL_ASSERT(vp[i] != 0); return *((T*)(vp[i])); } template inline void PArray::set (int i, T* elem) { BL_ASSERT(vp[i] == 0); vp[i] = elem; } template inline int PArray::size () const { return vp.size(); } template T* PArray::remove (int i) { BL_ASSERT(vp[i] != 0); void* tmp = vp[i]; vp[i] = 0; return (T*) tmp; } template void PArray::clear (int n) { if (managed) delete ((T*)(vp[n])); vp[n] = 0; } template PArray::PArray (int len, PArrayPolicy _managed) : vp(len), managed(_managed) { for (int i = 0; i < size(); i++) vp[i] = 0; } template void PArray::clear () { if (managed) { for (int i = 0; i < size(); ++i) { delete ((T*)(vp[i])); } } for (int i = 0; i < size(); ++i) vp[i] = 0; } template PArray::~PArray () { clear(); } template void PArray::resize (int newlen) { void** ovp = vp.size() ? &vp[0] : 0; int oldlen = vp.size(); vp.resize(newlen); for (int i = oldlen; i < newlen; ++i) vp[i] = 0; if (managed) { for (int i = newlen; i < oldlen; i++) { delete ((T*)(ovp[i])); ovp[i] = 0; } } } template void PArray::resize (int newlen, PArrayPolicy newmanagedpolicy) { if (newmanagedpolicy == managed) { resize(newlen); } else { clear(); resize(newlen); managed = newmanagedpolicy; } } #endif /*BL_PARRAY_H*/ ccseapps-2.5/CCSEApps/BoxLib/ccse-mpi.H0000644000175000017500000000624211634153073020653 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_CCSE_MPP #define BL_CCSE_MPP // // $Id: ccse-mpi.H,v 1.14 2001/12/03 22:24:54 lijewski Exp $ // // // This header encapsulates the MPI header. // // By placing here we make it easier to recompile with or w/o MPI. // #ifdef BL_USE_MPI #include #include namespace ParallelDescriptor { template struct Mpi_typemap { static MPI_Datatype type(); }; // // Template functions to return MPI_Datatype depending on argument type. // template <> MPI_Datatype Mpi_typemap::type(); template <> MPI_Datatype Mpi_typemap::type(); template <> MPI_Datatype Mpi_typemap::type(); template <> MPI_Datatype Mpi_typemap::type(); template <> MPI_Datatype Mpi_typemap::type(); template <> MPI_Datatype Mpi_typemap::type(); template <> MPI_Datatype Mpi_typemap::type(); template <> MPI_Datatype Mpi_typemap::type(); template <> MPI_Datatype Mpi_typemap::type(); template <> MPI_Datatype Mpi_typemap::type(); struct Max { static MPI_Op op(); }; struct Min { static MPI_Op op(); }; struct Sum { static MPI_Op op(); }; struct Prod { static MPI_Op op(); }; struct Logical_And { static MPI_Op op(); }; struct Boolean_And { static MPI_Op op(); }; struct Logical_Or { static MPI_Op op(); }; struct Boolean_Or { static MPI_Op op(); }; struct Logical_XOr { static MPI_Op op(); }; struct Boolean_XOr { static MPI_Op op(); }; } #else typedef int MPI_Op; typedef int MPI_Comm; typedef int MPI_Datatype; struct MPI_Status {}; typedef int MPI_Request; const int MPI_REQUEST_NULL = 0; const int MPI_COMM_WORLD = 0; namespace ParallelDescriptor { template struct Mpi_typemap { static MPI_Datatype type(); }; } #endif /*BL_USE_MPI*/ #endif /*BL_CCSE_MPP*/ ccseapps-2.5/CCSEApps/BoxLib/IndexType.cpp0000644000175000017500000000666011634153073021463 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: IndexType.cpp,v 1.12 2001/07/31 22:43:18 lijewski Exp $ // #include #include #include IndexType::IndexType (const IntVect& iv) { itype = D_TERM((iv[0]?1:0), | ((iv[1]?1:0)<<1), | ((iv[2]?1:0)<<2)); } IndexType::IndexType (D_DECL(CellIndex i, CellIndex j, CellIndex k)) { itype = D_TERM(i, | (j<<1), | (k<<2)); } void IndexType::setType (int dir, CellIndex t) { t == CELL ? unset(dir) : set(dir); } IndexType::CellIndex IndexType::ixType (int dir) const { return (CellIndex) ((itype & (1<> dir); } IntVect IndexType::ixType () const { return IntVect(D_DECL(itype&1, (itype>>1)&1, (itype>>2)&1)); } IndexType IndexType::TheCellType () { static const IndexType Cell(D_DECL(IndexType::CELL, IndexType::CELL, IndexType::CELL)); return Cell; } IndexType IndexType::TheNodeType () { static const IndexType Node(D_DECL(IndexType::NODE, IndexType::NODE, IndexType::NODE)); return Node; } std::ostream& operator<< (std::ostream& os, const IndexType& it) { os << '(' << D_TERM( (it.test(0)?'N':'C'), << ',' << (it.test(1)?'N':'C'), << ',' << (it.test(2)?'N':'C')) << ')' << std::flush; if (os.fail()) BoxLib::Error("operator<<(ostream&,IndexType&) failed"); return os; } // // Copied from // #define BL_IGNORE_MAX 100000 std::istream& operator>> (std::istream& is, IndexType& it) { char D_DECL(t0,t1,t2); D_EXPR( is.ignore(BL_IGNORE_MAX, '(') >> t0, is.ignore(BL_IGNORE_MAX, ',') >> t1, is.ignore(BL_IGNORE_MAX, ',') >> t2); is.ignore(BL_IGNORE_MAX, ')'); D_TERM( BL_ASSERT(t0 == 'C' || t0 == 'N'); t0=='N'?it.set(0):it.unset(0); , BL_ASSERT(t1 == 'C' || t1 == 'N'); t1=='N'?it.set(1):it.unset(1); , BL_ASSERT(t2 == 'C' || t2 == 'N'); t2=='N'?it.set(2):it.unset(2)); if (is.fail()) BoxLib::Error("operator>>(ostream&,IndexType&) failed"); return is; } ccseapps-2.5/CCSEApps/BoxLib/BLProfiler.cpp0000644000175000017500000006472311634153073021556 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BLProfiler.cpp,v 1.27 2002/11/11 17:49:53 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct timer_packet { enum sort_criterion { sort_time, sort_self, sort_count, sort_name, sort_avg_time, sort_var_time, sort_max_time, sort_min_time }; timer_packet() : count(0), time(0), self(0), avg_time(0), var_time(0), max_time(std::numeric_limits::min()), min_time(std::numeric_limits::max()) {} timer_packet(int count_, double time_, double self_, double avg_time_, double var_time_, double max_time_, double min_time_) : count(count_), time(time_), self(self_), avg_time(avg_time_), var_time(var_time_), max_time(max_time_), min_time(min_time_) {} bool operator<(const timer_packet& r) const { if ( increasing ) { switch ( sort_by ) { case sort_time : return time > r.time; case sort_self : return self > r.self; case sort_count : return count > r.count; case sort_avg_time : return avg_time > r.avg_time; case sort_var_time : return var_time > r.var_time; case sort_max_time : return max_time > r.max_time; case sort_min_time : return min_time > r.min_time; case sort_name : return name < r.name; default : return self > r.self; } } else { switch ( sort_by ) { case sort_time : return time < r.time; case sort_self : return self < r.self; case sort_count : return count < r.count; case sort_avg_time : return avg_time < r.avg_time; case sort_var_time : return var_time < r.var_time; case sort_max_time : return max_time < r.max_time; case sort_min_time : return min_time < r.min_time; case sort_name : return name > r.name; default : return self < r.self; } } } timer_packet& operator+=(const timer_packet& tp) { if ( name == "" ) { name = tp.name; } BL_ASSERT( name == tp.name ); count += tp.count; time += tp.time; self += tp.self; max_time = std::max(max_time, tp.max_time); min_time = std::min(min_time, tp.min_time); avg_time = time/count; var_time = 0.0; return *this; } struct by_name { bool operator()(const timer_packet& l, const timer_packet& r) { return l.name < r.name; } }; private: static sort_criterion sort_by; static bool increasing; public: int count; double time; double self; double avg_time; double var_time; double max_time; double min_time; std::string name; // wont be messaged }; bool timer_packet::increasing = true; timer_packet::sort_criterion timer_packet::sort_by = timer_packet::sort_self; #ifdef BL_USE_MPI namespace ParallelDescriptor { template <> MPI_Datatype Mpi_typemap::type() { static MPI_Datatype mine(MPI_DATATYPE_NULL); if ( mine == MPI_DATATYPE_NULL ) { timer_packet tp[2]; // Used to construct the data types MPI_Datatype types[] = { MPI_LB, MPI_INT, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_UB}; int blocklens[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1}; MPI_Aint disp[9]; int n = 0; BL_MPI_REQUIRE( MPI_Address(&tp[0], &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&tp[0].count, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&tp[0].time, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&tp[0].self, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&tp[0].avg_time, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&tp[0].var_time, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&tp[0].max_time, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&tp[0].min_time, &disp[n++]) ); BL_MPI_REQUIRE( MPI_Address(&tp[1], &disp[n++]) ); for ( int i = n-1; i >= 0; i-- ) { disp[i] -= disp[0]; } BL_ASSERT( n == sizeof(types)/sizeof(MPI_Datatype) ); BL_ASSERT( n == sizeof(disp)/sizeof(MPI_Aint) ); BL_ASSERT( n == sizeof(blocklens)/sizeof(int) ); BL_MPI_REQUIRE( MPI_Type_struct(n, blocklens, disp, types, &mine) ); BL_MPI_REQUIRE( MPI_Type_commit( &mine ) ); } return mine; } } #endif namespace { std::map tagr; std::map inv_tagr; Mutex profiling_mutex; } class ThreadTimerNode { friend std::ostream& operator<<(std::ostream& os, const ThreadTimerNode& tree); public: typedef std::map::iterator iterator; typedef std::map::const_iterator const_iterator; ThreadTimerNode() : wtimer(new BoxLib::WallTimer), avg_time(0), var_time(0), max_time(0), min_time(0) {} ThreadTimerNode* operator[](const std::string& str); ThreadTimerNode* find(const std::string& str); const_iterator begin() const { return cntr.begin(); } const_iterator end() const { return cntr.end(); } void stop(); void start() { wtimer->start(); } double accum_time() const; int accum_count() const; double self_time() const; double max_timer() const { return max_time; } double min_timer() const { return min_time; } double child_time() const; void print(std::ostream& os, const std::string& str, int level); void mma_print(std::ostream& os, const std::string& str, int level); const std::map& nodes() const; private: ThreadTimerNode(const ThreadTimerNode&); ThreadTimerNode& operator=(const ThreadTimerNode&); BoxLib::WallTimer* wtimer; double avg_time; double var_time; double max_time; double min_time; std::map cntr; }; inline void ThreadTimerNode::stop() { wtimer->stop(); double X = wtimer->time(); int N = wtimer->count(); if ( N == 1 ) { avg_time = X; max_time = X; min_time = X; var_time = 0.0; } else { max_time = std::max(X, max_time); min_time = std::min(X, min_time); double oavg = avg_time; avg_time = ( X + avg_time*(N-1))/N; var_time = ( var_time*(N-2) + X*X - N*avg_time*avg_time + (N-1)*oavg*oavg )/ (N - 1); if ( var_time < 0.0 ) var_time = 0.0; } } const std::map& ThreadTimerNode::nodes() const { return cntr; } double ThreadTimerNode::accum_time() const { return wtimer->accum_time(); } int ThreadTimerNode::accum_count() const { return wtimer->count(); } double ThreadTimerNode::self_time() const { return accum_time() - child_time(); } double ThreadTimerNode::child_time() const { double t = 0; for ( const_iterator it = begin(); it != end(); ++it ) { t += it->second->wtimer->accum_time(); } return t; } inline ThreadTimerNode* ThreadTimerNode::operator[](const std::string& str) { iterator it = cntr.find(str); if ( it == cntr.end() ) { return cntr[str] = new ThreadTimerNode; } else { return it->second; } } inline ThreadTimerNode* ThreadTimerNode::find(const std::string& str) { iterator it = cntr.find(str); if ( it == cntr.end() ) { return cntr[str] = new ThreadTimerNode; } else { return it->second; } } class ThreadTimerTree { public: ThreadTimerTree() { current = new ThreadTimerNode; } ThreadTimerNode* push(const std::string& str) { ThreadTimerNode* deeper = current->find(str); ttd_stack.push(current); current = deeper; BL_ASSERT(current); return current; } ThreadTimerNode* pop() { ThreadTimerNode* t = current; BL_ASSERT(ttd_stack.size() > 0); current = ttd_stack.top(); ttd_stack.pop(); BL_ASSERT(t); return t; } ThreadTimerNode* head() const { return current; } int size () const { return ttd_stack.size(); } void print(std::ostream& os) const; void mma_print(std::ostream& os) const; private: ThreadTimerTree(const ThreadTimerTree&); ThreadTimerTree& operator=(const ThreadTimerTree&); ThreadTimerNode* current; std::stack ttd_stack; }; namespace { const int spcmult = 2; const int name_field_width = 40; const int name_field_bumper = 2; const int name_field_ellipse = 3; const int timer_field_width = 24; const int time_field_width = 14; const int count_field_width = 8; void spacer(std::ostream& os, int n, char c = ' ') { for ( int i = 0; i < n; ++i ) { os << c; } } void show_name_field(std::ostream&, int level, const std::string& str); void show_time_count(std::ostream&, int wd, double acc, int cnt); void show_time(std::ostream& os, double time, int scale = 1000); void show_count(std::ostream& os, int count); void aggregate_field_title(std::ostream& os); } std::ostream& operator<<(std::ostream& os, const timer_packet& tp) { show_count(os, tp.count); os << ' '; show_time(os, tp.time); os << ' '; show_time(os, tp.self); os << ' '; show_time(os, tp.max_time); os << ' '; show_time(os, tp.min_time); os << ' '; show_time(os, tp.avg_time); os << ' '; show_name_field(os, 0, tp.name); return os; } struct ttn_packet { std::string name; int count; double time; double self; double max_time; double min_time; double avg_time; double var_time; ThreadTimerNode* ttn; struct by_name { bool operator()(const ttn_packet& l, const ttn_packet& r) { return l.name < r.name; } }; struct by_self { bool operator()(const ttn_packet& l, const ttn_packet& r) { return l.self > r.self; } }; }; void ThreadTimerNode::print(std::ostream& os, const std::string& str, int level) { show_time_count(os, timer_field_width, wtimer->accum_time(), wtimer->count()); show_time(os, self_time()); os << ' '; show_time(os, max_time); os << ' '; show_time(os, min_time); os << ' '; show_time(os, avg_time); os << ' '; show_time(os, std::sqrt(var_time), 1000000); os << " "; show_name_field(os, level, str); os << '\n'; std::vector ttns; for ( const_iterator it = begin(); it != end(); ++it ) { ttn_packet ttn; ttn.name = it->first; ttn.ttn = it->second; ttn.count = it->second->wtimer->count(); ttn.time = it->second->wtimer->accum_time(); ttn.self = it->second->self_time(); ttn.max_time = it->second->max_time; ttn.min_time = it->second->min_time; ttn.avg_time = it->second->avg_time; ttn.var_time = it->second->var_time; ttns.push_back(ttn); } std::sort(ttns.begin(), ttns.end(), ttn_packet::by_self()); for ( std::vector::const_iterator it = ttns.begin(); it != ttns.end(); ++it ) { it->ttn->print(os, it->name, level+1); } } void ThreadTimerTree::print(std::ostream& os) const { for ( std::map::const_iterator it = head()->begin(); it != head()->end(); ++it ) { it->second->print(os, it->first, 0); } } void ThreadTimerNode::mma_print(std::ostream& os, const std::string& str, int level) { os << "\n"; spacer(os, 2*(1+level), ' '); os << "bl3TimerNode[" << "\"" << str << "\"" << ", " << wtimer->accum_time() << ", " << wtimer->count() << ", " << self_time() << ", " << max_time << ", " << min_time << ", " << avg_time << ", " << std::sqrt(var_time) << ", "; os << "{"; for ( const_iterator it = begin(); it != end(); ) { it->second->mma_print(os, it->first, level+1); if ( ++it != end() ) os << ", "; } os << "}"; os << "]"; } void ThreadTimerTree::mma_print(std::ostream& os) const { os << "{"; for ( std::map::const_iterator it = head()->begin(); it != head()->end(); ) { it->second->mma_print(os, it->first, 0); if ( ++it != head()->end() ) os << ", "; } os << "}"; } void grovel(const ThreadTimerNode* nodes, const std::string& str, timer_packet& t) { for ( ThreadTimerNode::const_iterator it = nodes->begin(); it != nodes->end(); ++it ) { if ( it->first == str ) { t.time += it->second->accum_time(); t.count += it->second->accum_count(); t.self += it->second->self_time(); t.max_time = std::max(it->second->max_timer(), t.max_time); t.min_time = std::min(it->second->min_timer(), t.min_time); t.avg_time = t.time/t.count; } grovel(it->second, str, t); } } bool Profiler::profiling = true; int Profiler::Tag::next_itag = 0; namespace { ThreadSpecificData tt_i; Mutex tt_mutex; std::vector tt_data; bool verbose = false; std::string filename("bl_prof"); bool mma = false; } Profiler::Tag::Tag(const std::string& tag_) : tag(tag_) { if ( is_profiling() ) { Lock lock(profiling_mutex); if ( tagr.find(tag) != tagr.end() ) { std::cerr << "BL_PROFILE:: name: " << tag_ << " already registered" << std::endl; BoxLib::Abort(); } itag = next_itag++; tagr[tag] = itag; inv_tagr[itag] = tag; } } const std::string& Profiler::Tag::name() const { return tag; } void Profiler::Initialize() { ParmParse pp("profiler"); pp.query("filename", filename); pp.query("mma", mma); pp.query("profiling", profiling); pp.query("verbose", verbose); if ( verbose && ParallelDescriptor::IOProcessor() ) { std::cout << "profiler.filename" << filename << std::endl; std::cout << "profiler.mma" << mma << std::endl; std::cout << "profiler.profiling" << profiling << std::endl; std::cout << "profiler.verbose" << verbose << std::endl; } } std::string Profiler::clean_name(const std::string& str) { #ifdef __GNUC__ // // g++ prepends runtime type id strings with their length :-( // std::string result; unsigned int i = 0; unsigned cnt = 0; while ( i < str.length() ) { if ( !isdigit(str[i]) ) break; cnt += (str[i] - '0') + cnt*10; i++; } for (; i < str.length(); ++i) { result += str[i]; } return result; #else return str; #endif } void Profiler::Finalize() { #ifdef BL_PROFILING // Try to measure overhead: for ( int i = 0; i < 100; ++i ) { BL_PROFILE("Profiler::Finalize():load"); } if ( profiling ) off(); glean(); #endif } Profiler::Profiler(const Tag& tag_, bool hold) : tag(tag_), started(false) { int* a = tt_i.get(); if ( a == 0 ) { tt_i.set(a = new int); Lock lock(tt_mutex); *a = tt_data.size(); tt_data.push_back(new ThreadTimerTree); } if ( !hold ) { start(); } } Profiler::~Profiler() { if ( started ) stop(); } void Profiler::start() { BL_ASSERT( !started ); if ( profiling ) tt_data[*tt_i.get()]->push(tag.name())->start(); if ( verbose && ParallelDescriptor::IOProcessor() ) { std::cout << ">> "; spacer(std::cout,2*tt_data[*tt_i.get()]->size(),' '); std::cout << tag.name() << '\n'; } started = true; } void Profiler::stop() { BL_ASSERT( started ); if ( verbose && ParallelDescriptor::IOProcessor() ) { std::cout << "<< "; spacer(std::cout,2*tt_data[*tt_i.get()]->size(),' '); std::cout << tag.name() << '\n'; } if ( profiling ) tt_data[*tt_i.get()]->pop()->stop(); started = false; } namespace { void mma_dump() { // MMA dump std::string mma_fname = filename + ".m"; if ( ParallelDescriptor::IOProcessor() ) { std::ofstream os(mma_fname.c_str()); os << "{"; } for ( int i = 0; i < ParallelDescriptor::NProcs(); ++i ) { if ( i == ParallelDescriptor::MyProc() ) { std::ofstream os(mma_fname.c_str(), std::ios::app); std::ios::fmtflags oldFlags = os.flags(); os.setf(std::ios::fixed, std::ios::floatfield); int oprec = os.precision(8); os << "{"; for ( std::vector::const_iterator it = tt_data.begin(); it != tt_data.end(); ) { (*it)->mma_print(os); if ( ++it != tt_data.end() ) os << ", "; } os.precision(oprec); os.flags(oldFlags); os << "}\n"; if ( i != ParallelDescriptor::NProcs()-1 ) os << ", "; } ParallelDescriptor::Barrier(); } if ( ParallelDescriptor::IOProcessor() ) { std::ofstream os(mma_fname.c_str(), std::ios::app); os << "}"; } } } void Profiler::glean() { // for all threads on this processor build a cumulative timer structure using grovel. std::vector tps; for ( std::map::const_iterator jt = tagr.begin(); jt != tagr.end(); ++jt ) { timer_packet t; t.name = jt->first; for ( std::vector::const_iterator it = tt_data.begin(); it != tt_data.end(); ++it) { grovel((*it)->head(), jt->first, t); } tps.push_back(t); } std::vector< std::vector< timer_packet> > t_packets; if ( ParallelDescriptor::IOProcessor() ) { t_packets.resize(ParallelDescriptor::NProcs()); t_packets[0] = tps; } std::vector ntags = ParallelDescriptor::Gather(tagr.size(), ParallelDescriptor::IOProcessorNumber()); for ( int i = 1; i < ParallelDescriptor::NProcs(); ++i ) { if ( ParallelDescriptor::IOProcessor() ) { std::vector lngths(ntags[i]); ParallelDescriptor::Recv(lngths, i, 101); std::vector< std::string > strngs; for ( unsigned int j = 0; j < lngths.size(); ++j ) { std::vector a(lngths[j]); ParallelDescriptor::Recv(a, i, 102); strngs.push_back(std::string(a.begin(), a.end())); } t_packets[i].resize(ntags[i]); ParallelDescriptor::Recv(t_packets[i], i, 103); for ( unsigned int j = 0; j < ntags[i]; ++j ) { t_packets[i][j].name = strngs[j]; } } else if ( ParallelDescriptor::MyProc() == i ) { std::vector lngths; for ( std::vector::const_iterator it = tps.begin(); it != tps.end(); ++it ) { lngths.push_back(it->name.size()); } ParallelDescriptor::Send(lngths, 0, 101); for ( std::vector::const_iterator it = tps.begin(); it != tps.end(); ++it ) { const char* name = it->name.c_str(); ParallelDescriptor::Send(name, it->name.size(), 0, 102); } ParallelDescriptor::Send(tps, 0, 103); } } if ( ParallelDescriptor::IOProcessor() ) { std::vector< timer_packet > tp_total; for ( int i = 0; i < ParallelDescriptor::NProcs(); ++i ) { std::copy(t_packets[i].begin(), t_packets[i].end(), std::back_inserter(tp_total)); } std::sort(tp_total.begin(), tp_total.end(), timer_packet::by_name()); std::vector tp_summary; timer_packet t; for ( std::vector::iterator it = tp_total.begin(); it != tp_total.end(); ++it ) { t += *it; std::vector::const_iterator it1(it); ++it1; if ( it1 == tp_total.end() || it->name != it1->name ) { // finish the current one tp_summary.push_back(t); t = timer_packet(); continue; } } std::sort(tp_summary.begin(), tp_summary.end()); // SUmmary std::ofstream os(filename.c_str()); if ( !os ) { std::cerr << "filename = " << filename << std::endl; BoxLib::Error("failed to open prof file"); } os << "------------------------------------------------------------------------\n\n"; os << "Profiling report\n\n"; os << "------------------------------------------------------------------------\n\n"; os << "Timer resolution is "; show_time(os, BoxLib::WallTimer::tick(), 1000000); os << " (us)\n"; os << "Number of Processors: " << ParallelDescriptor::NProcs() << std::endl; spacer(os, 2, '\n'); spacer(os, 72, '-'); os << '\n'; spacer(os, 72, '-'); os << '\n'; os << "Aggregate report\n\n"; spacer(os, 16, '-'); os << '\n'; aggregate_field_title(os); std::copy(tp_summary.begin(), tp_summary.end(), std::ostream_iterator(os, "\n")); spacer(os, 2, '\n'); spacer(os, 72, '-'); os << '\n'; spacer(os, 72, '-'); os << '\n'; os << "Per-Processor Report" << '\n'; spacer(os, 20, '-'); os << '\n'; os << "Number of processes Reporting " << t_packets.size() << std::endl; for ( int i = 0; i < ParallelDescriptor::NProcs(); ++i ) { std::vector< timer_packet > tps( t_packets[i] ); std::sort(tps.begin(), tps.end()); os << "\nProcessor :" << i << std::endl; spacer(os, 20, '-'); os << '\n'; aggregate_field_title(os); std::copy(tps.begin(), tps.end(), std::ostream_iterator(os, "\n")); } spacer(os, 2, '\n'); spacer(os, 72, '-'); os << '\n'; os << "Details Profiling report\n"; spacer(os, 72, '-'); os << '\n'; } for ( int i = 0; i < ParallelDescriptor::NProcs(); ++i ) { if ( i == ParallelDescriptor::MyProc() ) { std::ofstream os(filename.c_str(), std::ios::app); os << "\nProcessor Number " << std::setw(4) << i << std::endl; os << "-----------------" "----\n"; os << "\nNumber of threads = " << std::setw(4) << tt_data.size() << std::endl; os << "--------------------" "----\n"; int cnt = 0; for ( std::vector::const_iterator it = tt_data.begin(); it != tt_data.end(); ++it) { os << "\n\n"; os << "Thread " << std::setw(4) << cnt++ << std::endl; os << "-------" "----\n"; std::ios::fmtflags fldadjust = os.setf(std::ios::right, std::ios::adjustfield); os << std::setw(timer_field_width) << "Time (ms)/ Count " << ' '; os << std::setw(time_field_width) << "Self (ms)" << ' '; os << std::setw(time_field_width) << "Max (ms)" << ' '; os << std::setw(time_field_width) << "Min (ms)" << ' '; os << std::setw(time_field_width) << "Avg (ms)" << ' '; os << std::setw(time_field_width) << "STD (us)" << ' '; os.setf(std::ios::left, std::ios::adjustfield); os << std::setw(name_field_width) << "Timer: "; os << std::endl << std::flush; os.setf(fldadjust, std::ios::adjustfield); spacer(os, name_field_width + timer_field_width + 5*(time_field_width+1), '-'); os << '\n'; (*it)->print(os); os << '\n'; aggregate_field_title(os); std::vector tps; for ( std::map::const_iterator jt = tagr.begin(); jt != tagr.end(); ++jt ) { timer_packet t; t.name = jt->first; grovel((*it)->head(), jt->first, t); tps.push_back(t); } std::sort(tps.begin(), tps.end()); for ( std::vector::const_iterator jt = tps.begin(); jt != tps.end(); ++jt ) { if ( jt->time != 0 ) { os << *jt << std::endl; } } } os << std::endl; } ParallelDescriptor::Barrier(); } if ( mma ) { mma_dump(); } } bool Profiler::is_profiling() { Lock lock(profiling_mutex); return profiling; } void Profiler::on() { Lock lock(profiling_mutex); profiling = true; } void Profiler::off() { Lock lock(profiling_mutex); profiling = false; } namespace { void show_time_count(std::ostream& os, int wd, double time, int count) { std::ios::fmtflags oldFlags = os.flags(); if ( wd >= 3 ) { wd -= 3; } int fwd = 2*wd/3; int oprec = os.precision(); int prec = fwd-1-5-3; if ( prec < 0 ) prec = oprec; #ifdef __GNUC__ char buff[128]; sprintf(buff, "[%*.*f/%*d]", 2*wd/3, prec, time*1000, 1*wd/3, count); os << buff; #else os << std::fixed; os << std::showpoint; os << std::setprecision(prec); os << std::setw(0) // Reset the width to zero..." << "[" << std::setw(2*wd/3) << time*1000 << "/" << std::setw(1*wd/3) << count << "]"; os << std::setprecision(oprec); #endif os.flags(oldFlags); } void show_time(std::ostream& os, double time, int scale) { int precred = 0; int tscale = scale; while ( tscale /= 10 ) { precred++; } std::ios::fmtflags oldFlags = os.flags(); int fwd = time_field_width; int oprec = os.precision(); int prec = fwd-1-5-precred; if ( prec < 0 ) prec = oprec; #ifdef __GNUC__ char buff[1024]; sprintf(buff, "%*.*f", fwd, prec, time*scale); os << buff; #else os << std::fixed; os << std::showpoint; os << std::setprecision(prec) << std::setw(fwd) << time*scale; os << std::setprecision(oprec); #endif os.flags(oldFlags); } void show_count(std::ostream& os, int count) { os << std::setw(count_field_width) << count; } void show_name_field(std::ostream& os, int level, const std::string& str) { spacer(os, level*spcmult); os << str; if ( false ) { int len = str.size(); int wdth = name_field_width - level*spcmult - name_field_bumper; if ( len > wdth ) { int plen = len - wdth + name_field_ellipse; spacer(os, name_field_ellipse, '.'); os << std::setw(wdth-name_field_ellipse) << str.substr(plen); } else { os << std::setw(wdth) << str.substr(0, wdth); } spacer(os, name_field_bumper); } } void aggregate_field_title(std::ostream& os) { std::ios::fmtflags fldadjust = os.setf(std::ios::right, std::ios::adjustfield); os << std::setw(count_field_width) << "Count" << ' '; os << std::setw(time_field_width) << "Total (ms)" << ' '; os << std::setw(time_field_width) << "Self (ms)" << ' '; os << std::setw(time_field_width) << "Max (ms)" << ' '; os << std::setw(time_field_width) << "Min (ms)" << ' '; os << std::setw(time_field_width) << "Avg (ms)" << ' '; os.setf(std::ios::left, std::ios::adjustfield); os << std::setw(name_field_width) << "Registered profilers:"; os.setf(fldadjust, std::ios::adjustfield); os << '\n'; spacer(os, name_field_width + count_field_width + 5*(time_field_width+1), '-'); os << '\n'; } } ccseapps-2.5/CCSEApps/BoxLib/UseCount.H0000644000175000017500000000525611634153073020724 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_USECOUNT_H #define BL_USECOUNT_H // // $Id: UseCount.H,v 1.13 2001/07/31 22:43:19 lijewski Exp $ // #include #include // //@Man: //@Memo: A Class Encapsulating Reference Counts /*@Doc: This class encapsulates reference counts. */ class UseCount { public: // //@ManDoc: Construct a UseCount initialized to one. // UseCount (); // //@ManDoc: The copy constructor -- bumps reference count. // UseCount (const UseCount& rhs); /*@ManDoc: The assignment operator. Increments the reference count on rhs, decrements the reference count on this, and then makes this and rhs point to the same reference count. */ UseCount& operator= (const UseCount& rhs); // //@ManDoc: The destructor -- decrements the reference count. // ~UseCount (); // //@ManDoc: The UseCount is unique if the reference count == 1. // bool unique () const; // //@ManDoc: Returns the reference count. // int linkCount () const; private: // // A pointer to the reference count. // unsigned int* cnt; // // Decrement the reference count and delete the reference // counter if there are no more references. // void decrement (); }; inline bool UseCount::unique () const { return *cnt == 1; } inline int UseCount::linkCount () const { return *cnt; } #endif /*BL_USECOUNT_H*/ ccseapps-2.5/CCSEApps/BoxLib/ParmParse.H0000644000175000017500000011104011634153073021036 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_PARMPARSE_H #define BL_PARMPARSE_H // // $Id: ParmParse.H,v 1.28 2001/08/13 01:54:26 car Exp $ // #include #include #include #include #include // // ParmParse class implements a simple database for the storage and // retrieval of command-line and input-file arguments. The entries are // stored in a static table in (name,value_list) pairs. // // The format of the input file is a series of DEFINITIONS. // // A DEFINITION is of the form = ... // The equal sign is important since the list of values can span multiple // lines. // // Comments in an input file include all text from a '#' character to the // end of the line. Here is an example input file: // // niter = 100 # niter is an integer // title = "Double Wammy" # example of a string with spaces // cell_size = 0.5 0.75 # cell spacing in each dimension // plot.var = Density 1 10 # a list of values // plot.var = Energy 5 12 # another list of values // bigarray = 1 2 3 4 5 6 7 8 # first part of array // 9 10 11 12 # continuation of bigarray // test = apple "boy blue" 10 20 30 40 // FILE = prob_file # insert contents of this "prob_file" here // // The "FILE = " definition is special. Rather than just // adding this entry to the database, it reads the contents of // into the database. // // ParmParse stores all entries in a static table which is built the // first time a ParmParse object is constructed (usually in main()). // Subsequent invocations have access to this table. // A ParmParse constructor has an optional "prefix" argument that will // limit the searches to only those entries of the table with this prefix // in name. For example: // ParmParse pp("plot"); // will find only those entries with name given by "plot.". // // All values in the table are stored as strings. For example, the // values of "cell_size" in the above input file are stored as the // strings "0.5" and "0.75". These strings can be returned as either // string of numeric values by the query functions. // Character strings with spaces must be delimited by double quotes // in the input file but the quotes are stripped before they are entered // into the table. For example, 'title' in the above input file has a // single value, the string 'Double Wammy' (without the quotes). // Each value in the list associated with a definition can be referred to // by its index number. The index numbers start at 0 just like an array // in the C programming language. Consider the definition of "test" in // the above input file. The first value 'apple'is a string with index // 0. The second value 'boy blue' is a string with index 1. The // remaining four values are integers indexed 2, 3, 4, and 5. // // For a string value to represent an integer or float it must fit the // following regular experssion: // Sign ::= '+' | '-' // Digit ::= '0' | '1' | ... | '9' // Integer ::= [Sign]Digit+ // Exp ::= ('e'|'E')Integer // Float ::= ( Integer[.Digit*][Exp] | [Integer].Digit+[Exp] ) // // Where '+' indicates one or more occurences, '*' represents zero or // more occurences, '|' means one or the other and '[]' represents zero // or one occurence. // // Note that floats and doubles have the same string representation and // that the FORTRAN "double" exponent format is not supported. // That is, 1.0d+3 is not a valid representation of a floating point // number but that 1.0e+3 is acceptable. // // There are a host of functions allowing the user to query the database // and retrieve values. Here are some general rules about the names of // the member functions: // // * Functions with the string "get" in their names attempt to get a // value or an array of values from the table. They generate a // run-time error if they are not successful. // // * Functions with the string "query" in their names attempt to get a // value or an array of values from the table. They return the value 1 // (true) if they are successful and 0 (false) if not. // // * Functions with the string "kth" in their names get values from // the Kth entry with the given name in the database. This is // necessary since there may be multiple definitions with the same // name in the database. // // * Functions without the string "kth" in their names get values from // the last entry with the given name in the database. Note that the // definitions from the command line are appended to the database table // and hence will be the last entries. // // * Functions with the string "arr" in their names get an Array of // values from the given entry in the table. The array argument is // resized (if necessary) to hold all the values requested. // // * Functions without the string "arr" in their names get single // values from the given entry in the table. // // The following is a code sample showing how to use ParmParse: // // main(int argc, char **argv) // { // char* in_file_name = argv[1]; // ParmParse::Initialize(argc-2, argv+2, in_file_name); // // // Query table for value of "niter". If not in table // // then set to default value // if (!pp.query("niter",niter)) niter = 20; // // // read array of cell sizes if in table // Array dx; // if (nx=pp.countval("cell_size")) { // // get nx values starting at index 0 and store in dx. // // dx is automatically resized here. // pp.getarr("cell_size",dx,0,nx); // } // ParmParse::Finalize(); // } // // void do_graphics() // { // // // // Will only query entries with the "plot" prefix: // // // ParmParse pp("plot"); // // // // Read all variables with "plot.var" keyword. // // // std::string var_name; // Array range; // int num = pp.countname("var"); // for (int k = 0; k < num; k++) // { // // // // Element 0 in list is a string. // // // pp.getkth("var",k,var_name,0); // // // // Elements 1 and 2 are integers. // // Note that "range" will be resized to hold 2 elements. // // // pp.getktharr("var",k,range,1,2); // cout << "variable = " << var_name << "lo, hi = ", // << range[0] << " " << range[1] << endl; // } // } // ----------------------------------------------------------------- // ----------------------- END COMMENTS --------------------------- // ----------------------------------------------------------------- //@Man: //@Memo: Parse Parameters From Command Line and Input Files /*@Doc: The ParmParse class is used to interpret parameters passed in to a program from the command line and an arbitrary collection of input files. The parameters are stored in static table that can be queried by any object of type ParmParse. A parameter is a "definition". A definition is of the form " = ...". It is stored in the table as a name, value-list pair. In the following example, niter is a definition with the single integer value 10; name is a definition with the string value "big code" and dx is a definition with the two floating point values 0.5 and 0.75 and iv is an IntVect(5,4) prog niter = 10 name = "big code" dx = 0.5 0.75 iv=(5,4) The ParmParse class has two constructors. The first is responsible for building the table and is usually called by the main routine of an application. It has arguments for the command line argc and argv parameters, as well as an optional filename argument for reading definitions from an input file. The table is built by reading the input file first (if it exists) with the command line arguments added to the end of the table. The order of a definition in the table is significant, so command line parameters can be used to override definitions in the input file. A definition of the explicit form: FILE= is not added to the table but is a directive to include the named file at that point in the table. The second constructor is generally used by other classes in the code. It permits access to the table via a large collection of query functions. Both constructors have an optional prefix argument that narrows the search to entries in the table with the same prefix. For example, let PlanR be a ParmParse object with code prefix "ope". PlanR.get("val",v) will look for an entry in the parameter list of the form: ope.val==, and will reject all entries not starting with the correct code prefix. The query functions search the table for definition names that match a given string (and prefix) and return values from the corresponding value list. The values can be returned as ints, Arrays, floats, Arrays, doubles, Arrays, std::strings, or Arrays. All values in the table are stored as std::string objects, but if an int, float, or double is requested, the translation is done automatically. In the previous example, the value of niter could be returned as either an std::string, an int, a double, or a float. The values of dx can be returned as std::strings, floats, or doubles, but the value of name can be returned only as an std::string. Comments in an input file include all text from a `\#' character to the end of the line. Here is a sample input file: niter = 100 title = "Double Wammy" cell\_size = 0.5 0.75 plot.var = Density 1 10 plot.var = Energy 5 12 bigarray = 1 2 3 4 5 6 7 8 9 10 11 12 aBox = ((0,0) (5,5)) test = apple "boy blue" 10 20 30 40 FILE = prob\_file */ class Box; class IntVect; class ParmParse { public: class Frame; class Record; enum { LAST = -1, FIRST = 0, ALL = -1 }; /*@ManDoc: Construct an additional ParmParse object sharing the same internal table as any other such objects in existence. If prefix is specified, load this string as the code prefix for this particular ParmParse object. */ explicit ParmParse (const std::string& prefix = std::string()); // //@ManDoc: Returns true if name is in table. // bool contains (const char* name) const; /*@ManDoc: Returns the number of values associated with nth occurence of name (prepended with the prefix) in the table. n == -1 implies the last occurence. */ int countval (const char* name, int n = LAST) const; /*@ManDoc: Returns the number of times the given name (prepended with prefix) appears in the table. */ int countname (const std::string& name) const; /** Returns the number of records of the given name (prepended with prefix) appears in the table */ int countRecords (const std::string& name) const; /// Returns the nth record of the given name, or zero if none found. Record getRecord (const std::string& name, int n = LAST) const; // //@ManDoc: Write the contents of the table in ASCII to the ostream. // static void dumpTable (std::ostream& os); /*@ManDoc: Get the ival'th value of kth occurrence of the requested name. If successful, the value is converted to a bool and stored in reference ref. If the kth occurrence does not exist or ival'th value does not exist, or if the printed representation of the value cannot be converted to an bool, an error message is output and the program halts. Note that ival == 0 is the first value in the list. ParmParse converte the value 'true', and non-zero integers or floats to bool(true), and bool(false) for 'false' or zero integer or float values. */ void getkth (const char* name, int k, bool& ref, int ival = FIRST) const; // //@ManDoc: Same as getkth() but searches for the last occurrence of name. // void get (const char* name, bool& ref, int ival = FIRST) const; /*@ManDoc: Similar to getkth() but returns 0 if there is no kth occurrence of name. If successful, it returns 1 and stores the value in ref. If the kth occurrence exists, but ival'th value of that occurrence does not, or if there is a type mismatch, then the program signals an error and halts. */ int querykth (const char* name, int k, bool& ref, int ival = FIRST) const; // //@ManDoc: Same as querykth() but searches for the last occurrence of name. // int query (const char* name, bool& ref, int ival = FIRST) const; /*@ManDoc: Get the ival'th value of kth occurrence of the requested name. If successful, the value is converted to an int and stored in reference ref. If the kth occurrence does not exist or ival'th value does not exist, or if the printed representation of the value cannot be converted to an int, an error message is output and the program halts. Note that ival == 0 is the first value in the list. */ void getkth (const char* name, int k, int& ref, int ival = FIRST) const; //@ManDoc: Same as getkth() but searches for the last occurrence of name. // void get (const char* name, int& ref, int ival = FIRST) const; /*@ManDoc: Similar to getkth() but returns 0 if there is no kth occurrence of name. If successful, it returns 1 and stores the value in ref. If the kth occurrence exists, but ival'th value of that occurrence does not, or if there is a type mismatch, then the program signals an error and halts. */ int querykth (const char* name, int k, int& ref, int ival = FIRST) const; // //@ManDoc: Same as querykth() but searches for the last occurrence of name. // int query (const char* name, int& ref, int ival = FIRST) const; /*@ManDoc: Get the ival'th value of kth occurrence of the requested name. If successful, the value is converted to a float and stored in reference ref. If the kth occurrence does not exist or ival'th value does not exist, or if the printed representation of the value cannot be converted to a float, an error message is output and the program halts. Note that ival == 0 is the first value in the list. */ void getkth (const char* name, int k, float& ref, int ival = FIRST) const; // //@ManDoc: Same as getkth() but searches for the last occurrence of name. // void get (const char* name, float& ref, int ival = FIRST) const; /*@ManDoc: Similar to getkth() but returns 0 if there is no kth occurrence of name. If successful, it returns 1 and stores the value in ref. If the kth occurrence exists, but ival'th value of that occurrence does not, or if there is a type mismatch, then the program signals an error and halts. */ int querykth (const char* name, int k, float& ref, int ival = FIRST) const; // //@ManDoc: Same as querykth() but searches for the last occurrence of name. // int query (const char* name, float& ref, int ival = FIRST) const; /*@ManDoc: Get the ival'th value of kth occurrence of the requested name. If successful, the value is converted to a double and stored in reference ref. If the kth occurrence does not exist or ival'th value does not exist, or if the printed representation of the value cannot be converted to a double, an error message is output and the program halts. Note that ival = 0 is the first value in the list. */ void getkth (const char* name, int k, double& ref, int ival = FIRST) const; // //@ManDoc: Same as getkth() but searches for the last occurrence of name. // void get (const char* name, double& ref, int ival = FIRST) const; /*@ManDoc: Similar to getkth() but returns 0 if there is no kth occurrence of name. If successful, it returns 1 and stores the value in ref. If the kth occurrence exists, but ival'th value of that occurrence does not, or if there is a type mismatch, then the program signals an error and halts. */ int querykth (const char* name, int k, double& ref, int ival = FIRST) const; // //@ManDoc: Same as querykth() but searches for the last occurrence of name. // int query (const char* name, double& ref, int ival = FIRST) const; /*@ManDoc: Get the ival'th value of kth occurrence of the requested name. If successful, the value is converted to a std::string and stored in reference ref. If the kth occurrence does not exist or ival'th value does not exist, or if the printed representation of the value cannot be converted to a std::string, an error message is output and the program halts. Note that ival = 0 is the first value in the list. */ void getkth (const char* name, int k, std::string& ref, int ival = FIRST) const; // //@ManDoc: Same as getkth() but searches for the last occurrence of name. // void get (const char* name, std::string& ref, int ival = FIRST) const; /*@ManDoc: Similar to getkth() but returns 0 if there is no kth occurrence of name. If successful, it returns 1 and stores the value in ref. If the kth occurrence exists, but ival'th value of that occurrence does not, or if there is a type mismatch, then the program signals an error and halts. */ int querykth (const char* name, int k, std::string& ref, int ival = FIRST) const; // //@ManDoc: Same as querykth() but searches for the last occurrence of name. // int query (const char* name, std::string& ref, int ival = FIRST) const; /*@ManDoc: Get the ival'th value of kth occurrence of the requested name. If successful, the value is converted to an IntVect and stored in reference ref. If the kth occurrence does not exist or ival'th value does not exist, or if the printed representation of the value cannot be converted to a IntVect, an error message is output and the program halts. Note that ival = 0 is the first value in the list. */ void getkth (const char* name, int k, IntVect& ref, int ival = FIRST) const; // //@ManDoc: Same as getkth() but searches for the last occurrence of name. // void get (const char* name, IntVect& ref, int ival = FIRST) const; /*@ManDoc: Similar to getkth() but returns 0 if there is no kth occurrence of name. If successful, it returns 1 and stores the value in ref. If the kth occurrence exists, but ival'th value of that occurrence does not, or if there is a type mismatch, then the program signals an error and halts. */ int querykth (const char* name, int k, IntVect& ref, int ival = FIRST) const; // //@ManDoc: Same as querykth() but searches for the last occurrence of name. // int query (const char* name, IntVect& ref, int ival = FIRST) const; /*@ManDoc: Get the ival'th value of kth occurrence of the requested name. If successful, the value is converted to a Box and stored in reference ref. If the kth occurrence does not exist or ival'th value does not exist, or if the printed representation of the value cannot be converted to a Box, an error message is output and the program halts. Note that ival = 0 is the first value in the list. */ void getkth (const char* name, int k, Box& ref, int ival = FIRST) const; // //@ManDoc: Same as getkth() but searches for the last occurrence of name. // void get (const char* name, Box& ref, int ival = FIRST) const; /*@ManDoc: Similar to getkth() but returns 0 if there is no kth occurrence of name. If successful, it returns 1 and stores the value in ref. If the kth occurrence exists, but ival'th value of that occurrence does not, or if there is a type mismatch, then the program signals an error and halts. */ int querykth (const char* name, int k, Box& ref, int ival = FIRST) const; // //@ManDoc: Same as querykth() but searches for the last occurrence of name. // int query (const char* name, Box& ref, int ival = FIRST) const; /*@ManDoc: Gets an std::vector of num\_val values from kth occurrence of given name. If successful, the values are converted to an int and stored in the std::vector object ref. ref is resized (if necessary) to hold num\_val values. The value in the list indexed by start\_ix is copied into std::vector[0], std::vector[1] holds start\_ix+1, etc. If the kth occurrence does not exist or there are fewer than start\_ix + num\_val values associated with the kth occurrence, or if some of the values cannot be converted to an int, an error message is reported and the program halts. */ void getktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as getktharr() but searches for last occurrence of name. // void getarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: queryktharr() is to querykth() as getktharr() is to getkth(). // int queryktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as queryktharr() but searches for last occurrence of name. // int queryarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; /*@ManDoc: Gets an std::vector of num\_val values from kth occurrence of given name. If successful, the values are converted to a float and stored in the std::vector object ref. ref is resized (if necessary) to hold num\_val values. The value in the list indexed by start\_ix is copied into std::vector[0], std::vector[1] holds start\_ix+1, etc. If the kth occurrence does not exist or there are fewer than start\_ix + num\_val values associated with the kth occurrence, or if some of the values cannot be converted to a float, an error message is reported and the program halts. */ void getktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as getktharr() but searches for last occurrence of name. // void getarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: queryktharr() is to querykth() as getktharr() is to getkth(). // int queryktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as queryktharr() but searches for last occurrence of name. // int queryarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; /*@ManDoc: Gets an std::vector of num\_val values from kth occurrence of given name. If successful, the values are converted to a double and stored in the std::vector object ref. ref is resized (if necessary) to hold num\_val values. The value in the list indexed by start\_ix is copied into std::vector[0], std::vector[1] holds start\_ix+1, etc. If the kth occurrence does not exist or there are fewer than start\_ix + num\_val values associated with the kth occurrence, or if some of the values cannot be converted to a double, an error message is reported and the program halts. */ void getktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as getktharr() but searches for last occurrence of name. // void getarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: queryktharr() is to querykth() as getktharr() is to getkth(). // int queryktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as queryktharr() but searches for last occurrence of name. // int queryarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; /*@ManDoc: Gets an std::vector of num\_val values from kth occurrence of given name. If successful, the values are converted to an std::string and stored in the std::vector object ref. ref is resized (if necessary) to hold num\_val values. The value in the list indexed by start\_ix is copied into std::vector[0], std::vector[1] holds start\_ix+1, etc. If the kth occurrence does not exist or there are fewer than start\_ix + num\_val values associated with the kth occurrence, or if some of the values cannot be converted to an std::string, an error message is reported and the program halts. */ void getktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as getktharr() but searches for last occurrence of name. // void getarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: queryktharr() is to querykth() as getktharr() is to getkth(). // int queryktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as queryktharr() but searches for last occurrence of name.2 // int queryarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; /*@ManDoc: Gets an std::vector of num\_val values from kth occurrence of given name. If successful, the values are converted to an IntVect and stored in the std::vector object ref. ref is resized (if necessary) to hold num\_val values. The value in the list indexed by start\_ix is copied into std::vector[0], std::vector[1] holds start\_ix+1, etc. If the kth occurrence does not exist or there are fewer than start\_ix + num\_val values associated with the kth occurrence, or if some of the values cannot be converted to an IntVect, an error message is reported and the program halts. */ void getktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as getktharr() but searches for last occurrence of name. // void getarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: queryktharr() is to querykth() as getktharr() is to getkth(). // int queryktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as queryktharr() but searches for last occurrence of name.2 // int queryarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; /*@ManDoc: Gets an std::vector of num\_val values from kth occurrence of given name. If successful, the values are converted to an Box and stored in the std::vector object ref. ref is resized (if necessary) to hold num\_val values. The value in the list indexed by start\_ix is copied into std::vector[0], std::vector[1] holds start\_ix+1, etc. If the kth occurrence does not exist or there are fewer than start\_ix + num\_val values associated with the kth occurrence, or if some of the values cannot be converted to an Box, an error message is reported and the program halts. */ void getktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as getktharr() but searches for last occurrence of name. // void getarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: queryktharr() is to querykth() as getktharr() is to getkth(). // int queryktharr (const char* name, int k, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; // //@ManDoc: Same as queryktharr() but searches for last occurrence of name.2 // int queryarr (const char* name, std::vector& ref, int start_ix = FIRST, int num_val = ALL) const; /*@ManDoc: Construct an initial ParmParse object from the argc and argv passed in to main(). An error will be signalled if another ParmParse object currently exists. If parfile is specified, read the parameters in from that file first and then append those derived from argv to the table. If prefix is specified, load this string as the code prefix for this particular ParmParse object. */ static void Initialize(int argc, char** argv, const char* parfile); /*@ManDoc: The destructor. The internal static table will only be deleted if there are no other ParmParse objects in existence. */ static void Finalize(); /* publicly needed helpers */ struct PP_entry; typedef std::list Table; private: friend class Frame; friend class Record; explicit ParmParse (const Table& tbl); /// Set/Get the prefix. std::string getPrefix() const; std::string setPrefix(const std::string& str); void pushPrefix(const std::string& str); void popPrefix(); std::string prefixedName (const std::string& str) const; // // Prefix used in keyword search. // std::stack m_pstack; const Table& m_table; }; struct ParmParse::PP_entry { PP_entry (const std::string& name, const std::list& vals); PP_entry (const std::string& name, const Table& table); PP_entry (const PP_entry& pe); PP_entry& operator= (const PP_entry& pe); ~PP_entry (); std::string m_name; std::vector m_vals; Table* m_table; mutable bool m_queried; }; class ParmParse::Frame { public: Frame (ParmParse& pp, const std::string& str); ~Frame (); void push(const std::string& str); void pop(); std::string getPrefix() const; private: ParmParse& m_pp; int m_np; }; class ParmParse::Record { public: const ParmParse* operator->() const; const ParmParse& operator* () const; private: friend class ParmParse; explicit Record (const ParmParse& pp); ParmParse m_pp; }; #endif /*BL_PARMPARSE_H*/ ccseapps-2.5/CCSEApps/BoxLib/BoxArray.cpp0000644000175000017500000002531111634153073021273 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: BoxArray.cpp,v 1.33 2002/03/11 21:53:57 car Exp $ // #include #include #include void BoxArray::reserve (long _truesize) { if (!m_ref.unique()) uniqify(); m_ref->m_abox.reserve(_truesize); } BoxArray::Ref::Ref () {} BoxArray::BoxArray () : m_ref(new BoxArray::Ref) {} BoxArray::BoxArray (const Box& bx) : m_ref(new BoxArray::Ref(1)) { m_ref->m_abox[0] = bx; } BoxArray::Ref::Ref (const BoxList& bl) { define(bl); } BoxArray::BoxArray (const BoxList& bl) : m_ref(new BoxArray::Ref(bl)) {} BoxArray::Ref::Ref (std::istream& is) { define(is); } BoxArray::BoxArray (const BoxArray& rhs) : m_ref(rhs.m_ref) {} BoxArray::Ref::Ref (size_t size) : m_abox(size) {} BoxArray::BoxArray (size_t size) : m_ref(new BoxArray::Ref(size)) {} BoxArray::BoxArray (const Box* bxvec, int nbox) : m_ref(new BoxArray::Ref(nbox)) { for (int i = 0; i < nbox; i++) m_ref->m_abox[i] = *bxvec++; } BoxArray::Ref::Ref (const Ref& rhs) : m_abox(rhs.m_abox) {} BoxArray& BoxArray::operator= (const BoxArray& rhs) { m_ref = rhs.m_ref; return *this; } void BoxArray::uniqify () { m_ref = new Ref(*m_ref); } void BoxArray::clear () { if (!m_ref.unique()) uniqify(); m_ref->m_abox.clear(); } void BoxArray::resize (int len) { if (!m_ref.unique()) uniqify(); m_ref->m_abox.resize(len); } void BoxArray::set (int i, const Box& ibox) { if (!m_ref.unique()) uniqify(); m_ref->m_abox.set(i, ibox); } // // Moved out of Utility.H // #define BL_IGNORE_MAX 100000 void BoxArray::readFrom (std::istream& is) { BL_ASSERT(size() == 0); if (!m_ref.unique()) uniqify(); m_ref->define(is); } void BoxArray::Ref::define (std::istream& is) { // // TODO -- completely remove the fiction of a hash value. // BL_ASSERT(m_abox.size() == 0); int maxbox; unsigned long hash; is.ignore(BL_IGNORE_MAX, '(') >> maxbox >> hash; m_abox.resize(maxbox); for (int i = 0; i < m_abox.size(); i++) is >> m_abox.get(i); is.ignore(BL_IGNORE_MAX, ')'); if (is.fail()) BoxLib::Error("BoxArray::define(istream&) failed"); } void BoxArray::define (const BoxList& bl) { BL_ASSERT(size() == 0); if (!m_ref.unique()) uniqify(); m_ref->define(bl); } void BoxArray::Ref::define (const BoxList& bl) { BL_ASSERT(m_abox.size() == 0); m_abox.resize(bl.size()); int count = 0; for (BoxList::const_iterator bli = bl.begin(); bli != bl.end(); ++bli) m_abox.get(count++) = *bli; } void BoxArray::define (const BoxArray& bs) { BL_ASSERT(size() == 0); m_ref = bs.m_ref; } BoxArray::~BoxArray () {} bool BoxArray::operator== (const BoxArray& rhs) const { return m_ref == rhs.m_ref || m_ref->m_abox == rhs.m_ref->m_abox; } bool BoxArray::operator!= (const BoxArray& rhs) const { return !operator==(rhs); } BoxArray& BoxArray::refine (int refinement_ratio) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).refine(refinement_ratio); return *this; } BoxArray& BoxArray::refine (const IntVect& iv) { if (!m_ref.unique()) uniqify(); for (int i = 0; i m_abox.get(i).refine(iv); return *this; } BoxArray& BoxArray::shift (int dir, int nzones) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).shift(dir, nzones); return *this; } BoxArray& BoxArray::shiftHalf (int dir, int num_halfs) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).shiftHalf(dir, num_halfs); return *this; } BoxArray& BoxArray::shiftHalf (const IntVect& iv) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).shiftHalf(iv); return *this; } BoxArray& BoxArray::coarsen (int refinement_ratio) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).coarsen(refinement_ratio); return *this; } BoxArray& BoxArray::coarsen (const IntVect& iv) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).coarsen(iv); return *this; } BoxArray& BoxArray::grow (int n) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).grow(n); return *this; } BoxArray& BoxArray::grow (const IntVect& iv) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).grow(iv); return *this; } BoxArray& BoxArray::grow (int dir, int n_cell) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).grow(dir, n_cell); return *this; } bool BoxArray::contains (const IntVect& v) const { for (int i = 0; i < size(); i++) if (m_ref->m_abox.get(i).contains(v)) return true; return false; } bool BoxArray::contains (const Box& b) const { BoxArray bnew = BoxLib::complementIn(b, *this); return bnew.size() == 0; } bool BoxArray::contains (const BoxArray& bl) const { for (int i = 0; i < bl.size(); i++) if (!contains(bl.m_ref->m_abox.get(i))) return false; return true; } BoxArray& BoxArray::surroundingNodes () { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).surroundingNodes(); return *this; } BoxArray& BoxArray::surroundingNodes (int dir) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).surroundingNodes(dir); return *this; } BoxArray& BoxArray::enclosedCells () { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).enclosedCells(); return *this; } BoxArray& BoxArray::enclosedCells (int dir) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).enclosedCells(dir); return *this; } BoxArray& BoxArray::convert (IndexType typ) { if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox.get(i).convert(typ); return *this; } BoxArray& BoxArray::convert (Box (*fp)(const Box&)) { BL_ASSERT(!(fp == 0)); if (!m_ref.unique()) uniqify(); for (int i = 0; i < size(); i++) m_ref->m_abox[i] = (*fp)(m_ref->m_abox[i]); return *this; } std::ostream& BoxArray::writeOn (std::ostream& os) const { // // TODO -- completely remove the fiction of a hash value. // os << '(' << size() << ' ' << 0 << '\n'; for (int i = 0; i < size(); i++) os << get(i) << '\n'; os << ')'; if (os.fail()) BoxLib::Error("BoxArray::writeOn(ostream&) failed"); return os; } bool BoxArray::isDisjoint () const { for (int i = 0; i < size(); i++) for (int j = i + 1; j < size(); j++) if (get(i).intersects(get(j))) return false; return true; } bool BoxArray::ok () const { bool isok = true; if (size() > 0) { const Box& bx0 = m_ref->m_abox[0]; if (size() == 1) isok = bx0.ok(); for (int i = 1; i < size() && isok; i++) { const Box& bxi = m_ref->m_abox[i]; isok = bxi.ok() && bxi.sameType(bx0); } } return isok; } long BoxArray::numPts () const { long result = 0; for ( int i = 0; i < size(); ++i ) { result += m_ref->m_abox.get(i).numPts(); } return result; } BoxArray& BoxArray::maxSize (int block_size) { BoxList blst(*this); blst.maxSize(block_size); clear(); m_ref->m_abox.resize(blst.size()); BoxList::iterator bli = blst.begin(); for (int i = 0; bli != blst.end(); ++bli) set(i++, *bli); return *this; } std::ostream& operator<< (std::ostream& os, const BoxArray& ba) { // // TODO -- completely remove the fiction of a hash value. // os << "(BoxArray maxbox(" << ba.size() << ")\n m_ref->m_hash_sig(" << 0 << ")\n "; for (int i = 0; i < ba.size(); ++i) os << ba[i] << ' '; os << ")\n"; if (os.fail()) BoxLib::Error("operator<<(ostream& os,const BoxArray&) failed"); return os; } BoxList BoxArray::boxList () const { if ( size() == 0 ) return BoxList(); BoxList newb(get(0).ixType()); for (int i = 0; i < size(); ++i) newb.push_back(get(i)); return newb; } Box BoxArray::minimalBox () const { Box minbox; if (size() > 0) { minbox = m_ref->m_abox.get(0); for (int i = 0; i < size(); i++) minbox.minBox(m_ref->m_abox.get(i)); } return minbox; } BoxArray BoxLib::boxComplement (const Box& b1in, const Box& b2) { return BoxArray(BoxLib::boxDiff(b1in, b2)); } BoxArray BoxLib::complementIn (const Box& b, const BoxArray& ba) { return BoxArray(BoxLib::complementIn(b, ba.boxList())); } BoxArray BoxLib::intersect (const BoxArray& ba, const Box& b) { return BoxArray(BoxLib::intersect(ba.boxList(), b)); } BoxArray BoxLib::intersect (const BoxArray& lhs, const BoxArray& rhs) { return BoxArray(BoxLib::intersect(lhs.boxList(), rhs.boxList())); } ccseapps-2.5/CCSEApps/BoxLib/Thread.H0000644000175000017500000002676711634153073020400 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BL_THREAD_H_ #define _BL_THREAD_H_ // // $Id: Thread.H,v 1.20 2002/04/11 19:40:29 car Exp $ // //#include #include // // An abstract base class for defining threaded operations. // // You must be very careful when using Pthread objects to ensure // that the Pthread object exists at least as long as the POSIX // thread executing the work() routine is running. // Most of this was written by Mike Lijewski extern "C" { typedef void* (*Thread_Function)(void*); } class FunctionThread; class Mutex; class ConditionVariable; class Barrier; class SingleBarrier; class Semaphore; class SemaphoreB; class Gate; template class Lock; template class TryLock; template <> class Lock; template class SafeVariable; template class ThreadSpecificData; template <> class ThreadSpecificData; // // Mutex // // // This Mutex class is designed to be used in a very stylized manner. // While we can instantiate a Mutex, to lock or unlock it we must instantiate // a Lock object with the Mutex. This makes locked Mutexes exception-safe. // If we want to trylock it we must use a TryLock object. // class Mutex { public: class Implementation; Mutex(); virtual ~Mutex(); void lock(); void unlock(); bool trylock(); private: Mutex(const Mutex&); void operator=(const Mutex&); #if !defined(BL_ICC_VERSION) void* operator new(size_t size); #endif protected: Implementation* m_impl; }; // // Lock // // // In order to ensure that Mutexes get released when an exception happens, // we introduce yet another class that must be used to lock and unlock a // Mutex. // // We have the following stylized method of defining a Mutex and then // locking and unlocking it: // // int counter; // A shared counter. // Mutex counterMT; // A mutex on the counter. // // { // // // // Instantiate Lock object in its own scope. // // This locks the Mutex `counterMT'. // // // Lock lock(counterMT); // // // // Update the counter. // // // counter += 1; // // // // On exit from the scope the Lock destructor is called which // // will unlock the Mutex `counterMT'. // } // template class Lock { public: explicit Lock(M& mutex); ~Lock(); private: Lock(const Lock&); void operator=(const Lock&); #if !defined(BL_ICC_VERSION) void* operator new(size_t size); #endif M& m_mutex; }; template Lock::Lock (M& mutex) : m_mutex(mutex) { m_mutex.lock(); } template Lock::~Lock() { m_mutex.unlock(); } // // TryLock // // // We have the following stylized method of defining a Mutex and then // attempting to lock and unlock it: // // int counter; // A shared counter. // Mutex counterMT; // A mutex on the counter. // // { // // // // Instantiate TryLock object in its own scope. // // This attempts to lock the Mutex `counterMT'. // // // TryLock trylock(counterMT); // // if ( trylock.locked() ) // { // // // // Update the counter. // // // counter += 1; // } // // // // On exit from the scope the TryLock destructor is called which // // will unlock the Mutex `counterMT' only if it was successfully // // locked. // // // } // template class TryLock { public: explicit TryLock(M& mutex); ~TryLock(); bool locked() const; private: TryLock(const TryLock&); void operator=(const TryLock&); void* operator new(size_t size); M& m_mutex; bool m_locked; }; template TryLock::TryLock(M& mutex) : m_mutex(mutex), m_locked(mutex.trylock()) { } template TryLock::~TryLock() { if ( m_locked ) { m_mutex.unlock(); } } template bool TryLock::locked() const { return m_locked; } // // ConditionVariable // class ConditionVariable { public: class Implementation; ConditionVariable(); ~ConditionVariable(); void signal(); // Signal at least one waiting thread. void broadcast(); // Signal all waiting threads. void wait(); // Wait on the condition. void lock(); void unlock(); bool trylock(); private: ConditionVariable(const ConditionVariable&); void operator=(const ConditionVariable&); Implementation* m_impl; }; // // Barrier // class Barrier : protected ConditionVariable { public: explicit Barrier(int cnt = 0); void init(int cnt); void wait(); private: Barrier(const Barrier&); void operator=(const Barrier&); int count; // Number of threads to wait for int n_sleepers; // Number of threads to waiting bool releasing; // Still waking up sleepers }; // // Semaphore // class Semaphore : protected ConditionVariable { public: explicit Semaphore(int val_ = 1); void wait(); bool trywait(); void post(); private: Semaphore(const Semaphore&); void operator=(const Semaphore&); int value; }; template <> class Lock { public: explicit Lock(Semaphore& sem_); ~Lock(); private: Semaphore& sem; }; // // SemaphoreB // class SemaphoreB : protected ConditionVariable { public: explicit SemaphoreB(int val_ = 1); int down(); int up(); int value(); int decrement(); private: SemaphoreB(const SemaphoreB&); void operator=(const SemaphoreB&); int val; }; // //Single Barrier // class SingleBarrier : protected ConditionVariable { public: explicit SingleBarrier(int); void wait(); void post(); private: SingleBarrier(const SingleBarrier&); void operator=(const SingleBarrier&); int count; // Number of threads to post int n_posters; // Number of threads who posted int n_waiters; // Number of threads waiting bool releasing; // Still waking up sleepers }; // // Gate // class Gate : protected ConditionVariable { public: Gate(); void open(); void close(); void release(); void wait(); private: Gate(const Gate&); void operator=(const Gate&); bool closed; }; // //SafeVariable // template class SafeVariable { public: void set(const T& n); const T get() const; SafeVariable& operator=(const T& n); operator const T() const; private: T val; mutable M m; }; template void SafeVariable::set(const T& n) { m.lock(); val = n; m.unlock(); } template < class T, class M> const T SafeVariable::get() const { m.lock(); const T tval = val; m.unlock(); return tval; } template SafeVariable& SafeVariable::operator=(const T& n) { set(n); return *this; } template SafeVariable::operator const T() const { return get(); } // //ThreadSpecific Data // template <> class ThreadSpecificData { public: class Implementation; explicit ThreadSpecificData(void (*dst)(void*) = 0); virtual ~ThreadSpecificData() = 0; void* set(const void* t); void* get() const; private: Implementation* m_impl; }; template class ThreadSpecificData : private ThreadSpecificData { public: explicit ThreadSpecificData(const T* p = 0); ThreadSpecificData (const T* p, void (*TSD_DESTROY)(void*)); virtual ~ThreadSpecificData(); T* set(const T* t); T* get() const; T* operator->(); T& operator*(); T* release(); void reset(const T* p = 0); private: ThreadSpecificData(const ThreadSpecificData&); void operator=(const ThreadSpecificData&); static void tsd_destroy(void*); }; template ThreadSpecificData::ThreadSpecificData(const T* p) : ThreadSpecificData(tsd_destroy) { if ( p ) set(p); } template ThreadSpecificData::ThreadSpecificData(const T* p, void (*THR_DESTROY)(void*)) : ThreadSpecificData(THR_DESTROY) { if ( p ) set(p); } template ThreadSpecificData::~ThreadSpecificData() { reset(); } template T* ThreadSpecificData::set(const T* v) { return static_cast(ThreadSpecificData::set(static_cast(v))); } template T* ThreadSpecificData::get() const { return static_cast(ThreadSpecificData::get()); } template T* ThreadSpecificData::operator->() { return get(); } template T& ThreadSpecificData::operator*() { return *get(); } template T* ThreadSpecificData::release() { return set(0); } template void ThreadSpecificData::reset(const T* p) { delete set(p); } template void ThreadSpecificData::tsd_destroy(void* v) { //printf("ThreadSpecificData::tsd_destroy(%p)\n",v); delete static_cast(v); } // // Thread // namespace Thread { void sleep (const BoxLib::Time& tspec); unsigned long max_threads (); void exit (void* status = 0); void yield (); int getID (); bool baseThread (); enum CancelState { Enable, Disable }; CancelState setCancelState (CancelState state); } class FunctionThread { public: enum DetachState { Joinable, Detached }; class Implementation; FunctionThread(Thread_Function func_, void* arg_ = 0, DetachState = Joinable, int stacksize = 0); ~FunctionThread(); void* join() const; void detach() const; protected: Implementation* m_impl; }; namespace BoxLib { void Thread_Error(const char* file, int lineno, const char* message, int status); } #ifndef BL_THREADS #include // Thread namespace Thread { inline unsigned long max_threads() { return 1UL;} inline int getID () { return 0; } inline bool baseThread () { return true; } } // Mutex inline Mutex::Mutex() {} inline Mutex::~Mutex() {} inline void Mutex::lock() {} inline void Mutex::unlock() {} // ConditionVariable inline ConditionVariable::ConditionVariable() {} inline ConditionVariable::~ConditionVariable() {} inline void ConditionVariable::broadcast() {} inline void ConditionVariable::signal() {} inline void ConditionVariable::wait() {} inline void ConditionVariable::lock() {} inline void ConditionVariable::unlock() {} #endif #endif ccseapps-2.5/CCSEApps/BoxLib/Profiler.H0000644000175000017500000000534211634153073020735 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BL_PROFILER_H_ #define _BL_PROFILER_H_ // // $Id: Profiler.H,v 1.8 2001/08/21 22:16:26 car Exp $ // #include #include #include class Profiler { public: class Tag; Profiler(const Tag& tag_, bool hold = false); void start(); void stop(); ~Profiler(); static void on(); static void off(); static bool is_profiling(); static std::string clean_name(const std::string& str); static void Initialize(); static void Finalize(); private: static void glean(); const Tag& tag; bool started; static bool profiling; Profiler(const Profiler& prf); Profiler& operator=(const Profiler& prf); }; class Profiler::Tag { public: explicit Tag(const std::string& tag_); const std::string& name() const; private: int itag; const std::string tag; static int next_itag; }; #ifdef BL_PROFILING #define BL_PROFILE(a) \ static Profiler::Tag bl_prf_tag_((a)); \ Profiler bl_prf_(bl_prf_tag_, false) #define BL_PROFILE_TIMER(var, a) \ static Profiler::Tag bl_prf_tag_##var((a)); \ Profiler bl_prf_##var(bl_prf_tag_##var, true) #define BL_PROFILE_START(var) bl_prf_##var.start() #define BL_PROFILE_STOP(var) bl_prf_##var.stop() #define BL_PROFILE_THIS_NAME() Profiler::clean_name(std::string(typeid(*this).name())) #else #define BL_PROFILE(a) #define BL_PROFILE_TIMER(var, a) #define BL_PROFILE_START(var) #define BL_PROFILE_STOP(var) #define BL_PROFILE_THIS_NAME() #endif #endif ccseapps-2.5/CCSEApps/BoxLib/OpenSource.txt0000644000175000017500000002434711634153073021673 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: BoxLib Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/BoxLib/Orientation.H0000644000175000017500000002125311634153073021445 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_ORIENTATION_H #define BL_ORIENTATION_H // // $Id: Orientation.H,v 1.15 2001/07/31 22:43:19 lijewski Exp $ // #include #include #include class OrientationIter; // //@Man: //@Memo: Encapsulation of the Orientation of the Faces of a Box /*@Doc: This class encapsulates the orientation of the faces of a Box by providing an ordering of each of the faces of a Box in BL\_SPACEDIM dimensions. This allows iterating over all the faces of a Box. The ordering first traverses the BL\_SPACEDIM low sides from direction 0 .. BL\_SPACEDIM-1 and then the BL\_SPACEDIM high sides from direction 0 .. BL\_SPACEDIM-1. */ class Orientation { public: friend class OrientationIter; // //@ManDoc: In each dimension a face is either low or high. // enum Side { low = 0, high = 1 }; // //@ManDoc: The default constructor. // Orientation (); // //@ManDoc: Set the orientation of a side. // Orientation (int dir, Side side); // //@ManDoc: The copy constructor. // Orientation (const Orientation& rhs); // //@ManDoc: The assignment operator. // Orientation& operator= (const Orientation& rhs); // //@ManDoc: Logical equality. // bool operator== (const Orientation& o) const; // //@ManDoc: Logical inequality. // bool operator!= (const Orientation& o) const; // //@ManDoc: Less-than. // bool operator< (const Orientation& o) const; // //@ManDoc: Less-than or equal. // bool operator<= (const Orientation& o) const; // //@ManDoc: Greater-than. // bool operator> (const Orientation& o) const; // //@ManDoc: Greater-than or equal. // bool operator>= (const Orientation& o) const; /*@ManDoc: This conversion operator maps an orientation into a unique integer in the range [0 .. 2*BL\_SPACEDIM-1] according to the above ordering. */ operator int () const; // //@ManDoc: Return opposite orientation. // Orientation flip () const; // //@ManDoc: Returns the coordinate direction. // int coordDir () const; // //@ManDoc: Returns the orientation of the face -- low or high. // Side faceDir () const; // //@ManDoc: Returns true if Orientation is low. // bool isLow () const; // //@ManDoc: Returns true if Orientation is high. // bool isHigh () const; // //@ManDoc: Read from an istream. // friend std::istream& operator>> (std::istream& os, Orientation& o); protected: // // Used internally. // Orientation (int val); private: int val; }; // //@ManDoc: Write to an ostream in ASCII format. // std::ostream& operator<< (std::ostream& os, const Orientation& o); // //@Man: //@Memo: An Iterator over the Orientation of Faces of a Box //@Doc: // class OrientationIter { public: // //@ManDoc: The default constructor. // OrientationIter (); // //@ManDoc: Construct an iterator on the Orientation. // OrientationIter (const Orientation& _face); // //@ManDoc: The copy constructor. // OrientationIter (const OrientationIter& it); // //@ManDoc: The assignment operator. // OrientationIter& operator= (const OrientationIter& it); // //@ManDoc: Reset (rewind) the iterator. // void rewind (); // //@ManDoc: Return the orientation of the face. // Orientation operator() () const; // //@ManDoc: Cast to void*. Used to test if iterator is valid. // operator void* (); // //@ManDoc: Pre-decrement. // OrientationIter& operator-- (); // //@ManDoc: Pre-increment. // OrientationIter& operator++ (); // //@ManDoc: Post-decrement. // OrientationIter operator-- (int); // //@ManDoc: Post-increment. // OrientationIter operator++ (int); // //@ManDoc: The equality operator. // bool operator== (const OrientationIter& oi) const; // //@ManDoc: The inequality operator. // bool operator!= (const OrientationIter& oi) const; protected: int face; // // Construct an iterator on the face. // OrientationIter (int _face); // // Is the iterator valid? // bool ok () const; }; inline Orientation::Orientation (int _val) : val(_val) {} inline Orientation::Orientation () : val(-1) {} inline Orientation::Orientation (int _dir, Side _side) : val(BL_SPACEDIM*_side + _dir) { BL_ASSERT(0 <= _dir && _dir < BL_SPACEDIM); } inline Orientation::Orientation (const Orientation& o) : val(o.val) {} inline Orientation& Orientation::operator= (const Orientation& o) { val = o.val; return *this; } inline bool Orientation::operator== (const Orientation& o) const { return val == o.val; } inline bool Orientation::operator!= (const Orientation& o) const { return val != o.val; } inline bool Orientation::operator< (const Orientation& o) const { return val < o.val; } inline bool Orientation::operator<= (const Orientation& o) const { return val <= o.val; } inline bool Orientation::operator> (const Orientation& o) const { return val > o.val; } inline bool Orientation::operator>= (const Orientation& o) const { return val >= o.val; } inline Orientation::operator int () const { return val; } inline int Orientation::coordDir () const { return val%BL_SPACEDIM; } inline Orientation::Side Orientation::faceDir () const { return Side(val/BL_SPACEDIM); } inline bool Orientation::isLow () const { return val < BL_SPACEDIM; } inline bool Orientation::isHigh () const { return val >= BL_SPACEDIM; } inline Orientation Orientation::flip () const { return Orientation(val < BL_SPACEDIM ? val+BL_SPACEDIM : val-BL_SPACEDIM); } inline OrientationIter::OrientationIter (int _face) : face(_face) {} inline OrientationIter::OrientationIter () : face(0) {} inline OrientationIter::OrientationIter (const Orientation& _face) : face(_face) {} inline bool OrientationIter::ok () const { return 0 <= face && face < 2*BL_SPACEDIM; } inline OrientationIter::OrientationIter (const OrientationIter& it) { BL_ASSERT(it.ok()); face = it.face; } inline OrientationIter& OrientationIter::operator= (const OrientationIter& it) { BL_ASSERT(it.ok()); face = it.face; return *this; } inline void OrientationIter::rewind () { face = 0; } inline Orientation OrientationIter::operator() () const { BL_ASSERT(ok()); return Orientation(face); } inline OrientationIter::operator void* () { return 0 <= face && face < 2*BL_SPACEDIM ? this : 0; } inline OrientationIter& OrientationIter::operator-- () { BL_ASSERT(ok()); --face; return *this; } inline OrientationIter& OrientationIter::operator++ () { BL_ASSERT(ok()); ++face; return *this; } inline OrientationIter OrientationIter::operator-- (int) { BL_ASSERT(ok()); return OrientationIter(face--); } inline OrientationIter OrientationIter::operator++ (int) { BL_ASSERT(ok()); return OrientationIter(face++); } inline bool OrientationIter::operator== (const OrientationIter& oi) const { BL_ASSERT(ok() && oi.ok()); return face == oi.face; } inline bool OrientationIter::operator!= (const OrientationIter& oi) const { BL_ASSERT(ok() && oi.ok()); return face != oi.face; } #endif /*BL_ORIENTATION_H*/ ccseapps-2.5/CCSEApps/BoxLib/VisMF.cpp0000644000175000017500000005316711634153073020542 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: VisMF.cpp,v 1.92 2002/04/17 22:22:19 vince Exp $ // #include #include #include // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #include #include #include const std::string VisMF::FabFileSuffix("_D_"); const std::string VisMF::MultiFabHdrFileSuffix("_H"); const std::string VisMF::FabOnDisk::Prefix("FabOnDisk:"); std::ostream& operator<< (std::ostream& os, const VisMF::FabOnDisk& fod) { os << VisMF::FabOnDisk::Prefix << ' ' << fod.m_name << ' ' << fod.m_head; if (!os.good()) BoxLib::Error("Write of VisMF::FabOnDisk failed"); return os; } std::istream& operator>> (std::istream& is, VisMF::FabOnDisk& fod) { std::string str; is >> str; BL_ASSERT(str == VisMF::FabOnDisk::Prefix); is >> fod.m_name; is >> fod.m_head; if (!is.good()) BoxLib::Error("Read of VisMF::FabOnDisk failed"); return is; } std::ostream& operator<< (std::ostream& os, const Array& fa) { long i = 0, N = fa.size(); os << N << '\n'; for ( ; i < N; i++) { os << fa[i] << '\n'; } if (!os.good()) BoxLib::Error("Write of Array failed"); return os; } std::istream& operator>> (std::istream& is, Array& fa) { long i = 0, N; is >> N; BL_ASSERT(N >= 0); fa.resize(N); for ( ; i < N; i++) { is >> fa[i]; } if (!is.good()) BoxLib::Error("Read of Array failed"); return is; } static std::ostream& operator<< (std::ostream& os, const Array< Array >& ar) { long i = 0, N = ar.size(), M = (N == 0) ? 0 : ar[0].size(); os << N << ',' << M << '\n'; for ( ; i < N; i++) { BL_ASSERT(ar[i].size() == M); for (long j = 0; j < M; j++) { os << ar[i][j] << ','; } os << '\n'; } if (!os.good()) BoxLib::Error("Write of Array> failed"); return os; } static std::istream& operator>> (std::istream& is, Array< Array >& ar) { char ch; long i = 0, N, M; is >> N >> ch >> M; BL_ASSERT(N >= 0); BL_ASSERT(ch == ','); BL_ASSERT(M >= 0); ar.resize(N); for ( ; i < N; i++) { ar[i].resize(M); for (long j = 0; j < M; j++) { is >> ar[i][j] >> ch; BL_ASSERT(ch == ','); } } if (!is.good()) BoxLib::Error("Read of Array> failed"); return is; } std::ostream& operator<< (std::ostream& os, const VisMF::Header& hd) { // // Up the precision for the Reals in m_min and m_max. // int old_prec = os.precision(15); os << hd.m_vers << '\n'; os << int(hd.m_how) << '\n'; os << hd.m_ncomp << '\n'; os << hd.m_ngrow << '\n'; hd.m_ba.writeOn(os); os << '\n'; os << hd.m_fod << '\n'; os << hd.m_min << '\n'; os << hd.m_max << '\n'; os.precision(old_prec); if (!os.good()) BoxLib::Error("Write of VisMF::Header failed"); return os; } std::istream& operator>> (std::istream& is, VisMF::Header& hd) { is >> hd.m_vers; BL_ASSERT(hd.m_vers == VisMF::Header::Version); int how; is >> how; switch (how) { case VisMF::OneFilePerCPU: hd.m_how = VisMF::OneFilePerCPU; break; default: BoxLib::Error("Bad case in switch"); } is >> hd.m_ncomp; BL_ASSERT(hd.m_ncomp >= 0); is >> hd.m_ngrow; BL_ASSERT(hd.m_ngrow >= 0); hd.m_ba.readFrom(is); is >> hd.m_fod; BL_ASSERT(hd.m_ba.size() == hd.m_fod.size()); is >> hd.m_min; is >> hd.m_max; BL_ASSERT(hd.m_ba.size() == hd.m_min.size()); BL_ASSERT(hd.m_ba.size() == hd.m_max.size()); if (!is.good()) BoxLib::Error("Read of VisMF::Header failed"); return is; } VisMF::FabOnDisk::FabOnDisk () {} VisMF::FabOnDisk::FabOnDisk (const std::string& name, long offset) : m_name(name), m_head(offset) {} int VisMF::nComp () const { return m_hdr.m_ncomp; } int VisMF::nGrow () const { return m_hdr.m_ngrow; } int VisMF::size () const { return m_hdr.m_ba.size(); } const BoxArray& VisMF::boxArray () const { return m_hdr.m_ba; } Real VisMF::min (int fabIndex, int nComp) const { BL_ASSERT(0 <= fabIndex && fabIndex < m_hdr.m_ba.size()); BL_ASSERT(0 <= nComp && nComp < m_hdr.m_ncomp); return m_hdr.m_min[fabIndex][nComp]; } Real VisMF::max (int fabIndex, int nComp) const { BL_ASSERT(0 <= fabIndex && fabIndex < m_hdr.m_ba.size()); BL_ASSERT(0 <= nComp && nComp < m_hdr.m_ncomp); return m_hdr.m_max[fabIndex][nComp]; } const FArrayBox& VisMF::GetFab (int fabIndex, int ncomp) const { if (m_pa[ncomp][fabIndex] == 0) { m_pa[ncomp][fabIndex] = VisMF::readFAB(fabIndex,m_mfname,m_hdr,ncomp); } return *m_pa[ncomp][fabIndex]; } void VisMF::clear (int fabIndex, int compIndex) { delete m_pa[compIndex][fabIndex]; } long VisMF::FileOffset (std::ostream& os) { return #if defined(__KCC) #if ((BL_KCC_MAJOR_VERSION >= 4) || (BL_KCC_MAJOR_VERSION == 3 && BL_KCC_MINOR_VERSION > 3) || (BL_KCC_MAJOR_VERSION == 0)) os.tellp(); #else os.tellp().offset(); #endif #else os.tellp(); #endif } FArrayBox* VisMF::readFAB (int idx, const std::string& mf_name) { return VisMF::readFAB(idx,mf_name,m_hdr,-1); } FArrayBox* VisMF::readFAB (int idx, int ncomp) { return VisMF::readFAB(idx,m_mfname,m_hdr,ncomp); } std::string VisMF::BaseName (const std::string& filename) { BL_ASSERT(filename[filename.length() - 1] != '/'); if (char* slash = strrchr(filename.c_str(), '/')) { // // Got at least one slash -- give'm the following tail. // return std::string(slash + 1); } else { // // No leading directory portion to name. // return filename; } } std::string VisMF::DirName (const std::string& filename) { BL_ASSERT(filename[filename.length() - 1] != '/'); static const std::string TheNullString(""); const char* str = filename.c_str(); if (char* slash = strrchr(str, '/')) { // // Got at least one slash -- give'm the dirname including last slash. // int len = (slash - str) + 1; char* buf = new char[len+1]; strncpy(buf, str, len); buf[len] = 0; // Stringify std::string dirname = buf; delete [] buf; return dirname; } else { // // No directory name here. // return TheNullString; } } VisMF::FabOnDisk VisMF::Write (const FArrayBox& fab, const std::string& filename, std::ostream& os, long& bytes) { VisMF::FabOnDisk fab_on_disk(filename, VisMF::FileOffset(os)); fab.writeOn(os); // // Add in the number of bytes in the FAB including the FAB header. // bytes += (VisMF::FileOffset(os) - fab_on_disk.m_head); return fab_on_disk; } // // This does not build a valid header. // VisMF::Header::Header () : m_vers(0) {} // // The more-or-less complete header only exists at IOProcessor(). // VisMF::Header::Header (const MultiFab& mf, VisMF::How how) : m_vers(VisMF::Header::Version), m_how(how), m_ncomp(mf.nComp()), m_ngrow(mf.nGrow()), m_ba(mf.boxArray()), m_fod(m_ba.size()), m_min(m_ba.size()), m_max(m_ba.size()) { #ifdef BL_USE_MPI // // Note that m_min and m_max are only calculated on CPU owning the fab. // We pass this data back to IOProcessor() so it sees the whole Header. // const int SeqNo = ParallelDescriptor::SeqNum(); const int NProcs = ParallelDescriptor::NProcs(); const int IOProc = ParallelDescriptor::IOProcessorNumber(); int nFabs = 0; for (MFIter mfi(mf); mfi.isValid(); ++mfi) { nFabs++; const int idx = mfi.index(); m_min[idx].resize(m_ncomp); m_max[idx].resize(m_ncomp); BL_ASSERT(mf[mfi].box().contains(m_ba[idx])); for (long j = 0; j < m_ncomp; j++) { m_min[idx][j] = mf[mfi].min(m_ba[idx],j); m_max[idx][j] = mf[mfi].max(m_ba[idx],j); } } if (!ParallelDescriptor::IOProcessor()) { if (nFabs) { Array senddata(2*m_ncomp*nFabs); int offset = 0; for (MFIter mfi(mf); mfi.isValid(); ++mfi) { const int idx = mfi.index(); for (int i = 0; i < m_ncomp; i++) { senddata[offset+i] = m_min[idx][i]; senddata[offset+m_ncomp+i] = m_max[idx][i]; } offset += 2*m_ncomp; } BL_ASSERT(offset == 2*m_ncomp*nFabs); BL_MPI_REQUIRE( MPI_Send(senddata.dataPtr(), 2*m_ncomp*nFabs, ParallelDescriptor::Mpi_typemap::type(), IOProc, SeqNo, ParallelDescriptor::Communicator()) ); BL_ASSERT(offset == 2*m_ncomp*nFabs); } } else { const Array& procmap = mf.DistributionMap().ProcessorMap(); Array fabs(NProcs,0); Array indx(NProcs); Array reqs(NProcs,MPI_REQUEST_NULL); Array status(NProcs); Array< Array > data(NProcs); for (int i = 0, N = procmap.size(); i < N; i++) fabs[procmap[i]]++; fabs[IOProc] = 0; int NWaits = 0; for (int i = 0; i < NProcs; i++) { if (fabs[i]) { NWaits++; data[i].resize(2*m_ncomp*fabs[i]); BL_MPI_REQUIRE( MPI_Irecv(data[i].dataPtr(), 2*m_ncomp*fabs[i], ParallelDescriptor::Mpi_typemap::type(), i, SeqNo, ParallelDescriptor::Communicator(), &reqs[i]) ); } } for (int completed; NWaits > 0; NWaits -= completed) { BL_MPI_REQUIRE( MPI_Waitsome(NProcs, reqs.dataPtr(), &completed, indx.dataPtr(), status.dataPtr()) ); for (int k = 0; k < completed; k++) { int Ncpu = indx[k], offset = 0; for (int idx = 0, N = procmap.size(); idx < N; idx++) { if (procmap[idx] == Ncpu) { m_min[idx].resize(m_ncomp); m_max[idx].resize(m_ncomp); for (int i = 0; i < m_ncomp; i++) { m_min[idx][i] = data[Ncpu][offset+i]; m_max[idx][i] = data[Ncpu][offset+m_ncomp+i]; } offset += 2*m_ncomp; } } BL_ASSERT(offset == 2*m_ncomp*fabs[Ncpu]); } } } #else for (MFIter mfi(mf); mfi.isValid(); ++mfi) { const int idx = mfi.index(); m_min[idx].resize(m_ncomp); m_max[idx].resize(m_ncomp); BL_ASSERT(mf[mfi].box().contains(m_ba[idx])); for (long j = 0; j < m_ncomp; j++) { m_min[idx][j] = mf[mfi].min(m_ba[idx],j); m_max[idx][j] = mf[mfi].max(m_ba[idx],j); } } #endif /*BL_USE_MPI*/ } long VisMF::WriteHeader (const std::string& mf_name, VisMF::Header& hdr) { long bytes = 0; // // When running in parallel only one processor should do this I/O. // if (ParallelDescriptor::IOProcessor()) { std::string MFHdrFileName = mf_name; MFHdrFileName += VisMF::MultiFabHdrFileSuffix; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream MFHdrFile; MFHdrFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); MFHdrFile.open(MFHdrFileName.c_str(), std::ios::out|std::ios::trunc); if (!MFHdrFile.good()) BoxLib::FileOpenFailed(MFHdrFileName); MFHdrFile << hdr; // // Add in the number of bytes written out in the Header. // bytes += VisMF::FileOffset(MFHdrFile); } return bytes; } long VisMF::Write (const MultiFab& mf, const std::string& mf_name, VisMF::How how, bool set_ghost) { BL_ASSERT(mf_name[mf_name.length() - 1] != '/'); const int MyProc = ParallelDescriptor::MyProc(); long bytes = 0; VisMF::Header hdr(mf, how); if (set_ghost) { MultiFab* the_mf = const_cast(&mf); BL_ASSERT(!(the_mf == 0)); BL_ASSERT(hdr.m_ba == mf.boxArray()); BL_ASSERT(hdr.m_ncomp == mf.nComp()); for (MFIter mfi(*the_mf); mfi.isValid(); ++mfi) { const int idx = mfi.index(); for (int j = 0; j < hdr.m_ncomp; j++) { const Real val = (hdr.m_min[idx][j] + hdr.m_max[idx][j]) / 2; the_mf->get(mfi).setComplement(val, hdr.m_ba[idx], j, 1); } } } char buf[sizeof(int) + 1]; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::string FullFileName = mf_name; FullFileName += VisMF::FabFileSuffix; sprintf(buf, "%04d", MyProc); FullFileName += buf; std::ofstream FabFile; FabFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); FabFile.open(FullFileName.c_str(), std::ios::out|std::ios::trunc|std::ios::binary); if (!FabFile.good()) BoxLib::FileOpenFailed(FullFileName); std::string basename = VisMF::BaseName(FullFileName); for (MFIter mfi(mf); mfi.isValid(); ++mfi) hdr.m_fod[mfi.index()] = VisMF::Write(mf[mfi],basename,FabFile,bytes); #ifdef BL_USE_MPI const int SeqNo = ParallelDescriptor::SeqNum(); const int NProcs = ParallelDescriptor::NProcs(); const int IOProc = ParallelDescriptor::IOProcessorNumber(); if (!ParallelDescriptor::IOProcessor()) { int nFabs = 0, idx = 0; for (MFIter mfi(mf); mfi.isValid(); ++mfi) nFabs++; if (nFabs) { Array senddata(nFabs); for (MFIter mfi(mf); mfi.isValid(); ++mfi) senddata[idx++] = hdr.m_fod[mfi.index()].m_head; BL_MPI_REQUIRE( MPI_Send(senddata.dataPtr(), nFabs, MPI_LONG, IOProc, SeqNo, ParallelDescriptor::Communicator())); } BL_ASSERT(idx == nFabs); } else { const Array& procmap = mf.DistributionMap().ProcessorMap(); Array fabs(NProcs,0); Array indx(NProcs); Array reqs(NProcs,MPI_REQUEST_NULL); Array status(NProcs); Array< Array > data(NProcs); for (int i = 0, N = procmap.size(); i < N; i++) fabs[procmap[i]]++; fabs[IOProc] = 0; int NWaits = 0; for (int i = 0; i < NProcs; i++) { if (fabs[i]) { NWaits++; data[i].resize(fabs[i]); BL_MPI_REQUIRE( MPI_Irecv(data[i].dataPtr(), fabs[i], MPI_LONG, i, SeqNo, ParallelDescriptor::Communicator(), &reqs[i])); } } for (int completed; NWaits > 0; NWaits -= completed) { BL_MPI_REQUIRE( MPI_Waitsome(NProcs, reqs.dataPtr(), &completed, indx.dataPtr(), status.dataPtr())); for (int k = 0; k < completed; k++) { int Ncpu = indx[k], offset = 0; for (int idx = 0, N = procmap.size(); idx < N; idx++) { if (procmap[idx] == Ncpu) { hdr.m_fod[idx].m_head = data[Ncpu][offset++]; std::string name = mf_name; name += VisMF::FabFileSuffix; sprintf(buf, "%04d", Ncpu); name += buf; hdr.m_fod[idx].m_name = VisMF::BaseName(name); } } BL_ASSERT(offset == fabs[Ncpu]); } } } #endif /*BL_USE_MPI*/ if (VisMF::FileOffset(FabFile) <= 0) BoxLib::UnlinkFile(FullFileName); bytes += VisMF::WriteHeader(mf_name, hdr); return bytes; } VisMF::VisMF (const std::string& mf_name) : m_mfname(mf_name) { std::string FullHdrFileName = m_mfname; FullHdrFileName += VisMF::MultiFabHdrFileSuffix; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ifstream ifs; ifs.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); ifs.open(FullHdrFileName.c_str(), std::ios::in); if (!ifs.good()) BoxLib::FileOpenFailed(FullHdrFileName); ifs >> m_hdr; m_pa.resize(m_hdr.m_ncomp); for (int nComp = 0; nComp < m_pa.size(); ++nComp) { m_pa[nComp].resize(m_hdr.m_ba.size()); for (int ii = 0; ii < m_pa[nComp].size(); ++ii) { m_pa[nComp][ii] = 0; } } } FArrayBox* VisMF::readFAB (int idx, const std::string& mf_name, const VisMF::Header& hdr, int ncomp) { Box fab_box = hdr.m_ba[idx]; if (hdr.m_ngrow) fab_box.grow(hdr.m_ngrow); FArrayBox* fab = new FArrayBox(fab_box, ncomp == -1 ? hdr.m_ncomp : 1); std::string FullFileName = VisMF::DirName(mf_name); FullFileName += hdr.m_fod[idx].m_name; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ifstream ifs; ifs.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); ifs.open(FullFileName.c_str(), std::ios::in|std::ios::binary); if (!ifs.good()) BoxLib::FileOpenFailed(FullFileName); if (hdr.m_fod[idx].m_head) ifs.seekg(hdr.m_fod[idx].m_head, std::ios::beg); if (ncomp == -1) { fab->readFrom(ifs); } else { fab->readFrom(ifs, ncomp); } return fab; } void VisMF::Read (MultiFab& mf, const std::string& mf_name) { VisMF::Header hdr; std::string FullHdrFileName = mf_name; FullHdrFileName += VisMF::MultiFabHdrFileSuffix; { VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ifstream ifs; ifs.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); ifs.open(FullHdrFileName.c_str(), std::ios::in); if (!ifs.good()) BoxLib::FileOpenFailed(FullHdrFileName); ifs >> hdr; } mf.define(hdr.m_ba, hdr.m_ncomp, hdr.m_ngrow, Fab_noallocate); for (MFIter mfi(mf); mfi.isValid(); ++mfi) { mf.setFab(mfi.index(), VisMF::readFAB(mfi.index(), mf_name, hdr)); } BL_ASSERT(mf.ok()); } void VisMF::clear (int fabIndex) { for (int ncomp = 0; ncomp < m_pa.size(); ++ncomp) { clear(ncomp, fabIndex); } } void VisMF::clear () { for (int ncomp = 0; ncomp < m_pa.size(); ++ncomp) { for (int fabIndex = 0; fabIndex < m_pa[ncomp].size(); ++fabIndex) { clear(ncomp, fabIndex); } } } ccseapps-2.5/CCSEApps/BoxLib/Array.H0000644000175000017500000001526711634153073020240 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef BL_ARRAY_H #define BL_ARRAY_H // // $Id: Array.H,v 1.30 2001/08/02 01:11:36 car Exp $ // #include #include #include #include template class Array; // //@Man: //@Memo: An Array of Objects of Type T /*@Doc: This class implements an array of objects of the parameterized type T. In contrast with the predefined C++ array type, an `Array' object knows its size, can be dynamically resized, and provides automatic bounds checking. The bounds checking can be turned off by specifying the -DNDEBUG flag on the command line when compiling the BOXLIB library. The main reason for defining the ARRAY class is that it is used, either by composition or inheritance, to implement many of the other classes in the BOXLIB library. The `Array' class works by storing copies of the objects it contains. If the objects are large, such as `FARRAYBOX's it is probably better to use the `PArray' class which is an array class that stores pointers to the objects (avoiding expensive copies). The `Array' class destructs all objects in the array when it is itself destructed. If this is not the desired action, the `PArray' class should be used. In the Array class, there are two different concepts of size: the amount of space allocated, and the amount of space actually used. Obviously, the allocated space must be larger than the used space. We separate these two concepts to allow the user to optionally avoid memory allocation costs. Rather than construct and destroy a temporary Array many times, it may be less expensive to allocate it once with enough memory to handle all uses, and resize the Array for each particular use. See the member functions `reserve', `shrinkWrap', and `resize'. Note that care must be taken when deriving classes from `Array'. It is a concrete class, not a polymorphic one. This class does NOT provide an assignment operator for assigning an integer to an Array. */ template class Array : public std::vector { public: // //@ManDoc: Constructs an `Array' with no elements // Array (); /*@ManDoc: Constructs an `Array' of size len with the value of each element defined by the default constructor for `T'. */ explicit Array (size_t len); /*@ManDoc: Constructs an `Array' of size len with the value of each elements given by initialvalue. */ Array (size_t len, const T& initialvalue); /*@ManDoc: Constructs an `Array' of size len in which the K'th value is a copy of vec[K]. */ Array (const T* vec, size_t len); int size () const; /*@ManDoc: Returns a reference to the K'th element in this `Array'. The element can be modified through this reference. The result can be used as an L-value. */ T& operator[] (size_t i); // //@ManDoc: Same as above, except acts on const Array's. // const T& operator[] (size_t i) const; // //@ManDoc: Different syntax for operator[] (long i). // T& get (size_t i); // //@ManDoc: Different syntax for const operator[] (long i). // const T& get (size_t i) const; /*@ManDoc: Returns pointer to vector of data. This function breaks object encapsulation and should only be used for interfacing to Fortran subroutines. */ T* dataPtr (); // //@ManDoc: Same as above for constant arrays. // const T* dataPtr () const; // //@ManDoc: Changes the i'th element of this `Array' to elem. // void set (size_t i, const T& elem); // //@ManDoc: This function swaps the i'th and j'th element of the array. // void swap (size_t i, size_t j); private: // // This is disallowed. // Array& operator= (int); }; template inline int Array::size () const { const std::vector& a = *this; return a.size(); } template inline T& Array::operator[] (size_t i) { BL_ASSERT(i < size()); std::vector& a = *this; return a[i]; } template inline const T& Array::operator[] (size_t i) const { BL_ASSERT(i < size()); const std::vector& a = *this; return a[i]; } template inline T& Array::get (size_t i) { BL_ASSERT(i < size()); return this->operator[](i); } template inline const T& Array::get (size_t i) const { BL_ASSERT(i < size()); return std::vector::operator[](i); } template inline void Array::set (size_t i, const T& elem) { get(i) = elem; } template inline T* Array::dataPtr () { return &this->operator[](0); } template inline const T* Array::dataPtr () const { return &this->operator[](0); } template Array::Array () : std::vector() {} template Array::Array (size_t len) : std::vector(len) {} template Array::Array (size_t len, const T& initialValue) : std::vector(len, initialValue) {} template Array::Array (const T* vec, size_t len) : std::vector(len) { BL_ASSERT(len == 0 || vec != 0); for (size_t i = 0; i < len; ++i) { this->operator[](i) = vec[i]; } } #endif /*BL_ARRAY_H*/ ccseapps-2.5/CCSEApps/.cvsignore0000644000175000017500000000021311634153073017653 0ustar amckinstryamckinstry*.for Debug Debug3D Release Release3D *.ncb *.opt *.plg grdlog chk[0-9][0-9][0-9][0-9] plt[0-9][0-9][0-9][0-9] *.pixie *.Addrs include lib ccseapps-2.5/CCSEApps/varden3d/0000755000175000017500000000000011634153073017365 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/varden3d/setscalbc.F0000644000175000017500000001646311634153073021451 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #if BL_USE_FLOAT #define threehalves 1.5e0 #else #define threehalves 1.5d0 #endif c ************************************************************************* c ** SETSCALBC ** c ** Impose the physical boundary conditions on scalars s c ************************************************************************* subroutine setscalbc(s,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi, $ which_scal,dx,time) implicit none integer DIMS integer which_scal integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi REAL_T dx(3) REAL_T time REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) c Local variables integer is,ie,js,je,ks,ke,i,j,k is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 if (bcz_lo .eq. PERIODIC) then do j = js,je do i = is,ie s(i,j,ks-1) = s(i,j,ke) enddo enddo elseif (bcz_lo .eq. WALL) then c NOTE: THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL BOUNDARY, c NOT IN THE GHOST CELL do j = js,je do i = is,ie c s(i,j,ks-1) = threehalves*s(i,j,ks) - half*s(i,j,ks+1) s(i,j,ks-1) = s(i,j,ks) enddo enddo elseif (bcz_lo .eq. INLET) then call scalinflow(s,DIMS,time,2,0,which_scal) elseif (bcz_lo .eq. OUTLET) then do j = js,je do i = is,ie c s(i,j,ks-1) = threehalves*s(i,j,ks) - half*s(i,j,ks+1) s(i,j,ks-1) = s(i,j,ks) enddo enddo else print *,'bogus bcz_lo in setscalbc ',bcz_lo stop endif if (bcz_hi .eq. PERIODIC) then do j = js,je do i = is,ie s(i,j,ke+1) = s(i,j,ks) enddo enddo elseif (bcz_hi .eq. WALL) then c NOTE: THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL BOUNDARY, c NOT IN THE GHOST CELL do j = js,je do i = is,ie c s(i,j,ke+1) = threehalves*s(i,j,ke) - half*s(i,j,ke-1) s(i,j,ke+1) = s(i,j,ke) enddo enddo elseif (bcz_hi .eq. INLET) then call scalinflow(s,DIMS,time,2,1,which_scal) elseif (bcz_hi .eq. OUTLET) then do j = js,je do i = is,ie c s(i,j,ke+1) = threehalves*s(i,j,ke) - half*s(i,j,ke-1) s(i,j,ke+1) = s(i,j,ke) enddo enddo else print *,'bogus bcz_hi in setscalbc ',bcz_hi stop endif if (bcy_lo .eq. PERIODIC) then do k = ks-1,ke+1 do i = is,ie s(i,js-1,k)=s(i,je,k) enddo enddo elseif (bcy_lo .eq. WALL) then c NOTE: THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL BOUNDARY, c NOT IN THE GHOST CELL do k = ks-1,ke+1 do i = is,ie c s(i,js-1,k) = threehalves*s(i,js,k) - half*s(i,js+1,k) s(i,js-1,k) = s(i,js,k) enddo enddo elseif (bcy_lo .eq. INLET) then call scalinflow(s,DIMS,time,1,0,which_scal) elseif (bcy_lo .eq. OUTLET) then do k = ks-1,ke+1 do i = is,ie c s(i,js-1,k) = threehalves*s(i,js,k) - half*s(i,js+1,k) s(i,js-1,k) = s(i,js,k) enddo enddo else print *,'bogus bcy_lo in setscalbc ',bcy_lo stop endif if (bcy_hi .eq. PERIODIC) then do k = ks-1,ke+1 do i = is,ie s(i,je+1,k)=s(i,js,k) enddo enddo elseif (bcy_hi .eq. WALL) then c NOTE: THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL BOUNDARY, c NOT IN THE GHOST CELL do k = ks-1,ke+1 do i = is,ie c s(i,je+1,k) = threehalves*s(i,je,k) - half*s(i,je-1,k) s(i,je+1,k) = s(i,je,k) enddo enddo elseif (bcy_hi .eq. INLET) then call scalinflow(s,DIMS,time,1,1,which_scal) elseif (bcy_hi .eq. OUTLET) then do k = ks-1,ke+1 do i = is,ie c s(i,je+1,k) = threehalves*s(i,je,k) - half*s(i,je-1,k) s(i,je+1,k) = s(i,je,k) enddo enddo else print *,'bogus bcy_hi in setscalbc ',bcy_hi stop endif if (bcx_lo .eq. PERIODIC) then do k = ks-1,ke+1 do j = js-1,je+1 s(is-1,j,k) = s(ie,j,k) enddo enddo elseif (bcx_lo .eq. WALL) then c NOTE: THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL BOUNDARY, c NOT IN THE GHOST CELL do k = ks-1,ke+1 do j = js-1,je+1 c s(is-1,j,k) = threehalves*s(is,j,k) - half*s(is+1,j,k) s(is-1,j,k) = s(is,j,k) enddo enddo elseif (bcx_lo .eq. INLET) then call scalinflow(s,DIMS,time,0,0,which_scal) elseif (bcx_lo .eq. OUTLET) then do k = ks-1,ke+1 do j = js-1,je+1 c s(is-1,j,k) = threehalves*s(is,j,k) - half*s(is+1,j,k) s(is-1,j,k) = s(is,j,k) enddo enddo else print *,'bogus bcx_lo in setscalbc ',bcx_lo stop endif if (bcx_hi .eq. PERIODIC) then do k = ks-1,ke+1 do j = js-1,je+1 s(ie+1,j,k) = s(is,j,k) enddo enddo elseif (bcx_hi .eq. WALL) then c NOTE: THESE VALUES ARE DEFINED ON THE EDGE OF THE PHYSICAL BOUNDARY, c NOT IN THE GHOST CELL do k = ks-1,ke+1 do j = js-1,je+1 c s(ie+1,j,k) = threehalves*s(ie,j,k) - half*s(ie-1,j,k) s(ie+1,j,k) = s(ie,j,k) enddo enddo elseif (bcx_hi .eq. INLET) then call scalinflow(s,DIMS,time,0,1,which_scal) elseif (bcx_hi .eq. OUTLET) then do k = ks-1,ke+1 do j = js-1,je+1 c s(ie+1,j,k) = threehalves*s(ie,j,k) - half*s(ie-1,j,k) s(ie+1,j,k) = s(ie,j,k) enddo enddo else print *,'bogus bcx_hi in setscalbc ',bcx_hi stop endif return end ccseapps-2.5/CCSEApps/varden3d/Make.package0000644000175000017500000000115411634153073021560 0ustar amckinstryamckinstryCODE_C_SOURCES = \ macproj.cpp hgproj.cpp main.cpp Grid.cpp \ multigrid.cpp diffuser.cpp CODE_C_HEADERS = \ macproj.H hgproj.H Grid.H globals.H \ multigrid.H diffuser.H CODE_F_SOURCES = \ cmpdt.F laplac.F setscalbc.F mkscalforce.F \ mac.F prob.F slopex.F slopey.F \ slopez.F visc.F scalupd.F velupd.F \ hg.F setvelbc.F mkforce.F mkdivucc.F \ mkadvvel.F mkvelflux.F mkscaflux.F mkdivunod.F CODE_F_HEADERS = MACPROJ_F.H HGPROJ_F.H VISC_F.H GRID_F.H probdata.H CEXE_sources += $(CODE_C_SOURCES) FEXE_sources += $(CODE_F_SOURCES) CEXE_headers += $(CODE_C_HEADERS) FEXE_headers += $(CODE_F_HEADERS) ccseapps-2.5/CCSEApps/varden3d/probin10000644000175000017500000000006611634153073020664 0ustar amckinstryamckinstry $fortin prob_type = 1 velfact = 1.0 $end ccseapps-2.5/CCSEApps/varden3d/slopez.F0000644000175000017500000002050611634153073021013 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** SLOPEZ ** c ** Compute the slope of nvar components of s in the z-direction c ************************************************************************* subroutine FORT_SLOPEZ(s,slz,dzscr,DIMS,nvar,bcz_lo,bcz_hi,slope_order) implicit none integer DIMS integer nvar integer bcz_lo,bcz_hi integer slope_order REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,nvar) REAL_T slz(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,nvar) REAL_T dzscr(lo_3-1:hi_3+1,4) integer cen,lim,flag,fromm parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ks,ie,je,ke,i,j,k,iv is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 c ::: HERE DOING 1ST ORDER if (slope_order .eq. 0) then do iv = 1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is-1,ie+1 slz(i,j,k,iv) = zero enddo enddo enddo enddo c ::: HERE DOING 2ND ORDER else if (slope_order .eq. 2) then do iv = 1,nvar do k = ks,ke do j = js-1,je+1 do i = is-1,ie+1 del = half*(s(i,j,k+1,iv) - s(i,j,k-1,iv)) dpls = two *(s(i,j,k+1,iv) - s(i,j,k ,iv)) dmin = two *(s(i,j,k ,iv) - s(i,j,k-1,iv)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,k,iv)= sflag*min(slim,abs(del)) enddo enddo enddo if (bcz_lo .eq. PERIODIC) then do j = js-1,je+1 do i = is-1,ie+1 slz(i,j,ks-1,iv) = slz(i,j,ke,iv) enddo enddo elseif (bcz_lo .eq. WALL .or. bcz_lo .eq. INLET) then do j = js-1,je+1 do i = is-1,ie+1 slz(i,j,ks-1,iv) = zero del = (s(i,j,ks+1,iv)+three*s(i,j,ks,iv)- $ four*s(i,j,ks-1,iv)) * third dpls = two*(s(i,j,ks+1,iv) - s(i,j,ks ,iv)) dmin = two*(s(i,j,ks ,iv) - s(i,j,ks-1,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,ks,iv)= sflag*min(slim,abs(del)) enddo enddo elseif (bcz_lo .eq. OUTLET) then do j = js-1,je+1 do i = is-1, ie+1 slz(i,j,ks-1,iv) = zero enddo enddo endif if (bcz_hi .eq. PERIODIC) then do j = js-1,je+1 do i = is-1,ie+1 slz(i,j,ke+1,iv) = slz(i,j,ks,iv) enddo enddo elseif (bcz_hi .eq. WALL .or. bcz_hi .eq. INLET) then do j = js-1,je+1 do i = is-1, ie+1 slz(i,j,ke+1,iv) = zero del = -(s(i,j,ke-1,iv)+three*s(i,j,ke,iv)- $ four*s(i,j,ke+1,iv)) * third dpls = two*(s(i,j,ke+1,iv) - s(i,j,ke ,iv)) dmin = two*(s(i,j,ke ,iv) - s(i,j,ke-1,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,ke,iv)= sflag*min(slim,abs(del)) enddo enddo elseif (bcz_hi .eq. OUTLET) then do j = js-1,je+1 do i = is-1, ie+1 slz(i,j,ke+1,iv) = zero enddo enddo endif enddo else c ::: HERE DOING 4TH ORDER do iv=1,nvar do j = js-1,je+1 do i = is-1,ie+1 do k = ks,ke dzscr(k,cen) = half*(s(i,j,k+1,iv)-s(i,j,k-1,iv)) dmin = two*(s(i,j,k ,iv)-s(i,j,k-1,iv)) dpls = two*(s(i,j,k+1,iv)-s(i,j,k ,iv)) dzscr(k,lim) = min(abs(dmin),abs(dpls)) dzscr(k,lim) = cvmgp(dzscr(k,lim),zero,dpls*dmin) dzscr(k,flag) = sign(one,dzscr(k,cen)) dzscr(k,fromm)= dzscr(k,flag)*min(dzscr(k,lim),abs(dzscr(k,cen))) enddo if (bcz_lo .eq. PERIODIC) then dzscr(ks-1,fromm) = dzscr(ke,fromm) else dzscr(ks-1,fromm) = dzscr(ks,fromm) endif if (bcz_hi .eq. PERIODIC) then dzscr(ke+1,fromm) = dzscr(ks,fromm) else dzscr(ke+1,fromm) = dzscr(ke,fromm) endif do k = ks,ke ds = two * two3rd * dzscr(k,cen) - $ sixth * (dzscr(k+1,fromm) + dzscr(k-1,fromm)) slz(i,j,k,iv) = dzscr(k,flag)*min(abs(ds),dzscr(k,lim)) enddo if (bcz_lo .eq. PERIODIC) then slz(i,j,ks-1,iv) = slz(i,j,ke,iv) elseif (bcz_lo .eq. WALL .or. bcz_lo .eq. INLET) then slz(i,j,ks-1,iv) = zero del = -sixteen/fifteen*s(i,j,ks-1,iv) + half*s(i,j,ks ,iv) + $ two3rd*s(i,j,ks+1,iv) - tenth*s(i,j,ks+2,iv) dmin = two*(s(i,j,ks ,iv)-s(i,j,ks-1,iv)) dpls = two*(s(i,j,ks+1,iv)-s(i,j,ks ,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,ks,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at ks+1 using the revised dzscr(ks,fromm) dzscr(ks,fromm) = slz(i,j,ks,iv) ds = two * two3rd * dzscr(ks+1,cen) - $ sixth * (dzscr(ks+2,fromm) + dzscr(ks,fromm)) slz(i,j,ks+1,iv) = dzscr(ks+1,flag)*min(abs(ds),dzscr(ks+1,lim)) elseif (bcz_lo .eq. OUTLET) then slz(i,j,ks-1,iv) = zero endif if (bcz_hi .eq. PERIODIC) then slz(i,j,ke+1,iv) = slz(i,j,ks,iv) elseif (bcz_hi .eq. WALL .or. bcz_hi .eq. INLET) then slz(i,j,ke+1,iv) = zero del = -( -sixteen/fifteen*s(i,j,ke+1,iv) + half*s(i,j,ke ,iv) $ + two3rd*s(i,j,ke-1,iv) - tenth*s(i,j,ke-2,iv) ) dmin = two*(s(i,j,ke ,iv)-s(i,j,ke-1,iv)) dpls = two*(s(i,j,ke+1,iv)-s(i,j,ke ,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slz(i,j,ke,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at ke-1 using the revised dzscr(ke,fromm) dzscr(ke,fromm) = slz(i,j,ke,iv) ds = two * two3rd * dzscr(ke-1,cen) - $ sixth * (dzscr(ke-2,fromm) + dzscr(ke,fromm)) slz(i,j,ke-1,iv) = dzscr(ke-1,flag)*min(abs(ds),dzscr(ke-1,lim)) elseif (bcz_hi .eq. OUTLET) then slz(i,j,ke+1,iv) = zero endif enddo enddo enddo endif return end ccseapps-2.5/CCSEApps/varden3d/main.cpp0000644000175000017500000001511311634153073021016 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #include #include #include // declare global variables here Real init_shrink = 1.0; Real gravity = 0.0; int bcx_lo; int bcx_hi; int bcy_lo; int bcy_hi; int bcz_lo; int bcz_hi; const int * lo; const int * hi; typedef char* charString; // functions called void print_usage(int,char**); void parse_command_line(int, char**, charString&, charString&); void writePlotFile(Grid *, int, Real, std::string&); // ################################################################### // ##### MAIN PROGRAM // ################################################################### main(int argc, char *argv[]) { BoxLib::Initialize(argc,argv); charString in_file = NULL; charString res_file = NULL; parse_command_line(argc,argv,in_file,res_file); ParmParse pp; int max_step; Real stop_time; Real cfl; int check_int; int plot_int; std::string check_file_root = "chk"; std::string plot_file_root = "plt"; pp.get("max_step",max_step); pp.get("stop_time",stop_time); pp.get("cfl",cfl); pp.query("init_shrink",init_shrink); pp.query("gravity",gravity); pp.get("check_int",check_int); pp.query("check_file_root",check_file_root); pp.get("plot_int",plot_int); pp.query("plot_file_root",plot_file_root); std::string probin_file; if (pp.contains("probin_file")) { pp.get("probin_file",probin_file); } pp.get("bcx_lo",bcx_lo); pp.get("bcx_hi",bcx_hi); pp.get("bcy_lo",bcy_lo); pp.get("bcy_hi",bcy_hi); pp.get("bcz_lo",bcz_lo); pp.get("bcz_hi",bcz_hi); if (bcx_lo == PERIODIC && bcx_hi != PERIODIC) { std::cout << "IF bcx_lo is periodic then bcx_hi must be periodic " << std::endl; exit(0); } if (bcx_hi == PERIODIC && bcx_lo != PERIODIC) { std::cout << "IF bcx_hi is periodic then bcx_lo must be periodic " << std::endl; exit(0); } if (bcy_lo == PERIODIC && bcy_hi != PERIODIC) { std::cout << "IF bcy_lo is periodic then bcy_hi must be periodic " << std::endl; exit(0); } if (bcy_hi == PERIODIC && bcy_lo != PERIODIC) { std::cout << "IF bcy_hi is periodic then bcy_lo must be periodic " << std::endl; exit(0); } if (bcz_lo == PERIODIC && bcz_hi != PERIODIC) { std::cout << "IF bcz_lo is periodic then bcz_hi must be periodic " << std::endl; exit(0); } if (bcz_hi == PERIODIC && bcz_lo != PERIODIC) { std::cout << "IF bcz_hi is periodic then bcz_lo must be periodic " << std::endl; exit(0); } Grid* grid = new Grid(probin_file); Real time = 0.0; Real dt = 0.0; int nstep = 0; grid->init(nstep,time,dt); // First do the iterations to calculate an initial pressure if (nstep == 0) { dt = std::min(init_shrink * grid->estimateDt(dt,cfl), stop_time - time); grid->initialIter(time,dt); grid->writeCheckPoint(nstep,time,dt,check_file_root); } writePlotFile(grid,nstep,time,plot_file_root); int last_checkpoint = nstep; int last_plotpoint = nstep; while (nstep < max_step && time <= stop_time - 1.e-10) { if (nstep > 0) dt = std::min(grid->estimateDt(dt,cfl), stop_time - time); nstep++; // do a timestep grid->advance(time, dt); time += dt; std::cout << "STEP = " << nstep << " TIME = " << time; std::cout << " DT = " << dt << std::endl; // checkpoint file? if (check_int > 0 && nstep%check_int == 0) { last_checkpoint = nstep; grid->writeCheckPoint(nstep,time,dt,check_file_root); }; if (plot_int > 0 && nstep%plot_int == 0) { last_plotpoint = nstep; writePlotFile(grid,nstep,time,plot_file_root); }; }; // dump final checkpoint file if needed if (nstep != last_checkpoint) { grid->writeCheckPoint(nstep,time,dt,check_file_root); }; // dump final pltfile file if needed if (nstep != last_plotpoint) { writePlotFile(grid,nstep,time,plot_file_root); }; // clean up memory usage delete grid; BoxLib::Finalize(); } // ################################################################### // ##### print_usage // ################################################################### void print_usage(int /* argc */, char *argv[]) { std::cerr << "usage:\n"; std::cerr << argv[0] << " infilename " << std::endl; std::cerr << "\n"; exit(1); } // ################################################################### // ##### parse_command_line // ################################################################### void parse_command_line(int argc, char *argv[], charString &in_file, charString &res_file) { // first input must be input file name if (argc < 2) print_usage(argc,argv); if (argv[1][0] == '-') { std::cerr << "first command line argument must be file name\n"; print_usage(argc,argv); }; in_file = argv[1]; } // ################################################################### // ##### writePlotFile // ################################################################### void writePlotFile(Grid* grid, int nstep, Real time, std::string& plot_file_root) { grid->writePlotFile(nstep,time,plot_file_root); } ccseapps-2.5/CCSEApps/varden3d/VISC_F.H0000644000175000017500000001251111634153073020507 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_INITSIGV initsigv # define FORT_COARSIGV coarsesigv # define FORT_RESID resv # define FORT_RHSNORM frhsnorm # define FORT_GSRBV gsrbv # define FORT_RESTRICT coarsev # define FORT_INTERPOLATE interpv #else #if defined (BL_FORT_USE_UNDERSCORE) # define FORT_INITSIGV initsigv_ # define FORT_COARSIGV coarsesigv_ # define FORT_RESID resv_ # define FORT_RHSNORM frhsnorm_ # define FORT_GSRBV gsrbv_ # define FORT_RESTRICT coarsev_ # define FORT_INTERPOLATE interpv_ #elif defined (BL_FORT_USE_UPPERCASE) # define FORT_INITSIGV INITSIGV # define FORT_COARSIGV COARSESIGV # define FORT_RESID RESV # define FORT_RHSNORM FRHSNORM # define FORT_GSRBV GSRBV # define FORT_RESTRICT COARSEV # define FORT_INTERPOLATE INTERPV #elif defined (BL_FORT_USE_LOWERCASE) # define FORT_INITSIGV initsigv # define FORT_COARSIGV coarsesigv # define FORT_RESID resv # define FORT_RHSNORM frhsnorm # define FORT_GSRBV gsrbv # define FORT_RESTRICT coarsev # define FORT_INTERPOLATE interpv #endif extern "C" { void FORT_RHSNORM(Real * staten, Real * source, const int& lo_mg_1, const int& lo_mg_2, const int& lo_mg_3, const int& hi_mg_1, const int& hi_mg_2, const int& hi_mg_3, Real * rhsnrm, Real * uinx_lo, Real * uinx_hi, Real * uiny_lo, Real * uiny_hi, Real * uinz_lo, Real * uinz_hi); void FORT_INITSIGV(Real * sigma , Real * rho, Real * mu, const int& lo_mg_1, const int& lo_mg_2, const int& lo_mg_3, const int& hi_mg_1, const int& hi_mg_2, const int& hi_mg_3); void FORT_RESID(Real * resid, Real * phi, Real * source, Real * sigma, Real * uinx_lo, Real * uinx_hi, Real * uiny_lo, Real * uiny_hi, Real * uinz_lo, Real * uinz_hi, const int& lo_mg_1, const int& lo_mg_2, const int& lo_mg_3, const int& hi_mg_1, const int& hi_mg_2, const int& hi_mg_3, Real * _hx, Real * _hy, Real * _hz, Real * rnorm, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, int * level); void FORT_COARSIGV(Real * sigma, Real * sigma_crse, const int& lo_mg_1, const int& lo_mg_2, const int& lo_mg_3, const int& hi_mg_1, const int& hi_mg_2, const int& hi_mg_3, const int& locmg_1, const int& locmg_2, const int& locmg_3, const int& hicmg_1, const int& hicmg_2, const int& hicmg_3); void FORT_GSRBV(Real * phi, Real * source, Real * sigma, Real * uinx_lo, Real * uinx_hi, Real * uiny_lo, Real * uiny_hi, Real * uinz_lo, Real * uinz_hi, const int& lo_mg_1, const int& lo_mg_2, const int& lo_mg_3, const int& hi_mg_1, const int& hi_mg_2, const int& hi_mg_3, Real * _hx, Real * _hy, Real * _hz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, int * level, int * nngsrb); void FORT_RESTRICT(Real * res, Real * resc, const int& lo_mg_1, const int& lo_mg_2, const int& lo_mg_3, const int& hi_mg_1, const int& hi_mg_2, const int& hi_mg_3, const int& locmg_1, const int& locmg_2, const int& locmg_3, const int& hicmg_1, const int& hicmg_2, const int& hicmg_3); void FORT_INTERPOLATE(Real * phi, Real * deltac, const int& lo_mg_1, const int& lo_mg_2, const int& lo_mg_3, const int& hi_mg_1, const int& hi_mg_2, const int& hi_mg_3, const int& loc_mg_1, const int& loc_mg_2, const int& loc_mg_3, const int& hic_mg_1, const int& hic_mg_2, const int& hic_mg_3); }; #endif ccseapps-2.5/CCSEApps/varden3d/mkdivunod.F0000644000175000017500000000440411634153073021476 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKDIVUNOD ** c ** Define the RHS of the node-centered divergence constraint c *************************************************************** subroutine FORT_MKDIVUNOD(divu_src,u,v,w,rho,time,dx,DIMS) implicit none integer DIMS REAL_T divu_src(lo_1 :hi_1+1,lo_2 :hi_2+1,lo_3 :hi_3+1) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T time REAL_T dx(3) c Local variables integer i,j,k do k = lo_3,hi_3+1 do j = lo_2,hi_2+1 do i = lo_1,hi_1+1 divu_src(i,j,k) = zero enddo enddo enddo return end ccseapps-2.5/CCSEApps/varden3d/hgproj.H0000644000175000017500000000740011634153073020770 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "multigrid.H" // //@Man: //@Memo: Nodal projection class for end-of-time-step nodal projection /*@ManDoc: This class handles the nodal projection of the new-time velocity. It computes RHS = D(V), and sends the RHS and coefficients sigma = 1/rho to the hgprojection_mg class, which solves the linear system using multigrid. */ class hg_projector { //@ManDoc: Problem domain in index space Box domain; //@ManDoc: Mesh spacing in x-direction Real _hx; //@ManDoc: Mesh spacing in y-direction Real _hy; //@ManDoc: Mesh spacing in z-direction Real _hz; //@ManDoc: Pressure update FArrayBox *phi; //@ManDoc: Tolerance to which DG(phi) = RHS should be solved Real tol; //@ManDoc: number of smoothing steps as you coarsen static int numSmoothCoarsen; //@ManDoc: number of smoothing steps as you refine static int numSmoothRefine; public: //@ManDoc: Constructor hg_projector(const Box& Domain, Real * dx); //@ManDoc: Destructor ~hg_projector(); //@ManDoc: Do the nodal projection void project(FArrayBox * state, FArrayBox * gradp, FArrayBox * rho, FArrayBox * divu_src, Real time, Real dt); //@ManDoc: Compute the pressure gradient at cell centers void gradient(FArrayBox & gradp, FArrayBox & pressure); }; //@ManDoc: The multigrid solver for the nodal projection class hgprojection_mg : public multigrid { //@Memo: Multigrid solver for nodal projection //@ManDoc: Inverse of density FArrayBox * sigma; //@ManDoc: Coefficient array on axes (average of sigma) FArrayBox * coeff; //@ManDoc: Next coarser multigrid level hgprojection_mg *Next; //@ManDoc: Scratch space for the conjugate gradient bottom solver FArrayBox * cgwork; //@ManDoc: Compute the residual R = RHS - DG(phi) Real residual(); //@ManDoc: Relax on the residual equation, updating phi void step(int); //@ManDoc: Coarsen the residual to the next coarser multigrid level void Restrict(); //@ManDoc: Interpolate the solution from the next coarser multigrid level void interpolate(); public: //@ManDoc: Constructor hgprojection_mg(const Box & Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Residual, FArrayBox * Sigma, FArrayBox * Coeff, Real Hx, Real Hy, Real Hz); //@ManDoc: Destructor ~hgprojection_mg(); }; ccseapps-2.5/CCSEApps/varden3d/GNUmakefile0000644000175000017500000000214311634153073021437 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.9 2002/04/03 23:11:35 almgren Exp $ # PRECISION = DOUBLE PROFILE = FALSE COMP = g++ DEBUG = FALSE DEBUG = TRUE DIM = 3 USE_MPI = FALSE USE_ARRAYVIEW = FALSE # # Base name of the executable. # EBASE = run PBOXLIB_HOME = .. # # Where libraries and include files will be installed. # include ../mk/Make.defs ./Make.package INCLUDE_LOCATIONS += . ../BoxLib include ../BoxLib/Make.package # # ArrayView # ifeq (USE_ARRAYVIEW, TRUE) DEFINES += -DBL_USE_ARRAYVIEW INCLUDE_LOCATIONS += . LIBRARIES += -lX11 endif ifeq ($(MACHINE), OSF1) # # Some additional stuff for our preferred development/debugging environment. # ifeq ($(PRECISION), DOUBLE) FFLAGS += -real_size 64 endif FDEBF += -C FDEBF += -warn argument_checking FDEBF += -warn declarations ifneq ($(FC), f90) FDEBF += -warn truncated_source FDEBF += -warn unused endif endif vpath %.H . ../BoxLib vpath %.cpp . ../BoxLib vpath %.F . all: $(executable) libs: cd $(PBOXLIB_HOME)/BoxLib; \ make PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) \ DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install include ../mk/Make.rules ccseapps-2.5/CCSEApps/varden3d/macproj.H0000644000175000017500000000715011634153073021134 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "multigrid.H" // //@Man: //@Memo: Projection class for intermediate MAC projection /*@ManDoc: This class handles the MAC projection of the intermediate edge-based advection velocity. It computes RHS = D(V), and sends the RHS and coefficients sigma = 1/rho to the macprojection_mg class, which solves the linear system using multigrid. */ class mac_projector { //@ManDoc: Un-buffered grid box Box domain; //@ManDoc: Mesh spacing in x-direction Real _hx; //@ManDoc: Mesh spacing in y-direction Real _hy; //@ManDoc: Mesh spacing in z-direction Real _hz; //@ManDoc: Tolerance to which DG(phi) = RHS should be solved Real tol; //@ManDoc: number of smoothing steps as you coarsen static int numSmoothCoarsen; //@ManDoc: number of smoothing steps as you refine static int numSmoothRefine; public: //@ManDoc: Constructor mac_projector(const Box& Domain, Real * dx); //@ManDoc: Destructor ~mac_projector(); //@ManDoc: Do the MAC projection void project(Real * uadv, Real * vadv, Real * wadv, Real * rho, FArrayBox& divu_src); }; //@ManDoc: Multigrid solver for the intermediate MAC projection class macprojection_mg : public multigrid { //@Memo: Multigrid solver for MAC projection //@ManDoc: Coefficient array on x-edges FArrayBox * sigmax; //@ManDoc: Coefficient array on y-edges FArrayBox * sigmay; //@ManDoc: Coefficient array on z-edges FArrayBox * sigmaz; //@ManDoc: Next coarser multigrid level macprojection_mg *Next; //@ManDoc: Scratch space for the conjugate gradient bottom solver FArrayBox *cgwork; //@ManDoc: Compute the residual R = RHS - DG(phi) Real residual(); //@ManDoc: Relax on the residual equation, updating phi void step(int); //@ManDoc: Coarsen the residual to the next coarser multigrid level void Restrict(); //@ManDoc: Interpolate the solution from the next coarser multigrid level void interpolate(); public: macprojection_mg(const Box& Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Residual, FArrayBox * Sigmax, FArrayBox * Sigmay, FArrayBox * Sigmaz, Real Hx, Real Hy, Real Hz); ~macprojection_mg(); }; ccseapps-2.5/CCSEApps/varden3d/prob.F0000644000175000017500000006057111634153073020447 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** PROBINIT ** c ** Read in the problem-dependent parameters for the FORTRAN common blocks c ************************************************************************* subroutine FORT_PROBINIT (name,namlen) integer namlen integer name(namlen) integer untin, i #include "probdata.H" namelist /fortin/ prob_type, $ in_xvel, in_yvel, in_zvel, in_density, in_tracer, $ xblob, yblob, zblob, radblob, denblob, velfact c Build `probin' filename -- the name of file containing fortin namelist. c integer maxlen parameter (maxlen=256) character probin*(maxlen) if (namlen .gt. maxlen) then write(6,*) 'probin file name too long' stop end if do i = 1, namlen probin(i:i) = char(name(i)) end do untin = 9 if (namlen .eq. 0) then open(untin,file='probin',form='formatted',status='old') else open(untin,file=probin(1:namlen),form='formatted',status='old') end if write(6,*) ' ' write(6,*) 'READING PROBIN_FILE ',probin(1:namlen) write(6,*) ' ' read(untin,fortin) close(unit=untin) end c ************************************************************************* c ** INITDATA ** c ** Call the appropriate subroutine to initialize the data c ************************************************************************* subroutine FORT_INITDATA(u,v,w,scal,DIMS,dx,time,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T dx(3) REAL_T time if (prob_type .eq. 1) then call initspin(u,v,w,scal,dx,DIMS,numscal) else if (prob_type .eq. 2) then call initbubble(u,v,w,scal,dx,DIMS,numscal) else if (prob_type .eq. 3) then call initshear(u,v,w,scal,dx,DIMS,numscal) else if (prob_type .eq. 4) then call initchannel(u,v,w,scal,dx,DIMS,numscal) else print *,'DONT KNOW THIS PROBLEM TYPE: ',prob_type stop endif return end c ************************************************************************* c ** INITSPIN ** c ** Initialize the constant density flow-in-a-box problem c ************************************************************************* subroutine initspin(u,v,w,scal,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T dx(3) c Local variables REAL_T x, y, z REAL_T spx, spy, spz, cpx, cpy, cpz integer i, j, k, n do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i-lo_1) + half) y = dx(2)*(float(j-lo_2) + half) z = dx(3)*(float(k-lo_3) + half) spx = sin(Pi*x) cpx = cos(Pi*x) spy = sin(Pi*y) cpy = cos(Pi*y) spz = sin(Pi*z) cpz = cos(Pi*z) u(i,j,k) = velfact*two*spy*cpy*spx**2 v(i,j,k) = -velfact*two*spx*cpx*spy**2 w(i,j,k) = zero scal(i,j,k,1) = one enddo enddo enddo do n = 2, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 scal(i,j,k,n) = zero enddo enddo enddo enddo return end c ************************************************************************* c ** INITBUBBLE ** c ** Initialize the bubble-drop in a box problem c ************************************************************************* subroutine initbubble(u,v,w,scal,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T dx(3) c Local variables REAL_T x, y, z, r integer i, j, k, n do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 u(i,j,k) = zero v(i,j,k) = zero w(i,j,k) = zero x = dx(1)*(float(i-lo_1) + half) y = dx(2)*(float(j-lo_2) + half) z = dx(3)*(float(k-lo_3) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2 + (z-zblob)**2) scal(i,j,k,1) = one+(denblob-one)*(half+half*tanh(100.d0*(radblob-r))) c scal(i,j,k,1) = cvmgt(denblob,one,r .lt. radblob) enddo enddo enddo do n = 2, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 scal(i,j,k,n) = zero enddo enddo enddo enddo return end c ************************************************************************* c ** INITSHEAR ** c ** Initialize a constant density doubly-periodic shear problem c ************************************************************************* subroutine initshear(u,v,w,scal,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T dx(3) c Local variables REAL_T x, y, z integer i, j, k, n do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i-lo_1) + half) y = dx(2)*(float(j-lo_2) + half) z = dx(3)*(float(k-lo_3) + half) u(i,j,k) = tanh(30.d0*(fourth - abs(y-half))) v(i,j,k) = 0.05d0 * sin(two*Pi*x) w(i,j,k) = zero scal(i,j,k,1) = one enddo enddo enddo do n = 2, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 scal(i,j,k,n) = zero enddo enddo enddo enddo return end c ************************************************************************* c ** INITCHANNEL ** c ** Initialize the channel inflow problem c ************************************************************************* subroutine initchannel(u,v,w,scal,dx,DIMS,numscal) implicit none #include "probdata.H" integer DIMS integer numscal REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T scal(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T dx(3) c Local variables REAL_T x, y, z, r integer i, j, k, n if (numscal .lt. 2) then print *,"CHANNEL FLOW NEEDS MORE SCALARS" stop endif do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 u(i,j,k) = in_xvel v(i,j,k) = in_yvel w(i,j,k) = in_zvel enddo enddo enddo do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 x = dx(1)*(float(i-lo_1) + half) y = dx(2)*(float(j-lo_2) + half) z = dx(3)*(float(k-lo_3) + half) r = sqrt((x-xblob)**2 + (y-yblob)**2 + (z-zblob)**2) scal(i,j,k,1) = cvmgt(denblob,in_density,r .lt. radblob) scal(i,j,k,2) = cvmgt(one ,in_tracer ,r .lt. radblob) enddo enddo enddo do n = 3, numscal do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 scal(i,j,k,n) = zero enddo enddo enddo enddo return end c ************************************************************************* c ** DERVORT ** c ** Derive a cell-centered vorticity c ************************************************************************* subroutine FORT_DERVORT(state,derval,derlo_1,derlo_2,derlo_3, $ derhi_1,derhi_2,derhi_3,DIMS,dx) implicit none integer DIMS integer derlo_1,derlo_2,derlo_3 integer derhi_1,derhi_2,derhi_3 REAL_T state(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,5) REAL_T derval(derlo_1:derhi_1,derlo_2:derhi_2,derlo_3:derhi_3) REAL_T dx(3) c Local variables integer i, j, k REAL_T derx, dery, derz do k = lo_3, hi_3 do j = lo_2, hi_2 do i = lo_1, hi_1 derx = eighth*(state(i+1,j+1,k-1,3)+state(i-1,j+1,k-1,3) $ +state(i+1,j+1,k+1,3)+state(i-1,j+1,k+1,3) $ -state(i+1,j-1,k-1,3)-state(i-1,j-1,k-1,3) $ -state(i+1,j-1,k+1,3)-state(i-1,j-1,k+1,3)) / dx(2) - $ eighth*(state(i+1,j+1,k+1,2)+state(i-1,j+1,k+1,2) $ +state(i+1,j-1,k+1,2)+state(i-1,j-1,k+1,2) $ -state(i+1,j+1,k-1,2)-state(i-1,j+1,k-1,2) $ -state(i+1,j-1,k-1,2)-state(i-1,j-1,k-1,2)) / dx(3) dery = eighth*(state(i+1,j+1,k-1,3)+state(i+1,j-1,k-1,3) $ +state(i+1,j+1,k+1,3)+state(i+1,j-1,k+1,3) $ -state(i-1,j+1,k-1,3)-state(i-1,j-1,k-1,3) $ -state(i-1,j+1,k+1,3)-state(i-1,j-1,k+1,3)) / dx(1) - $ eighth*(state(i+1,j+1,k+1,1)+state(i-1,j+1,k+1,1) $ +state(i+1,j-1,k+1,1)+state(i-1,j-1,k+1,1) $ -state(i+1,j+1,k-1,1)-state(i-1,j+1,k-1,1) $ -state(i+1,j-1,k-1,1)-state(i-1,j-1,k-1,1)) / dx(3) derz = eighth*(state(i+1,j+1,k-1,2)+state(i+1,j-1,k-1,2) $ +state(i+1,j+1,k+1,2)+state(i+1,j-1,k+1,2) $ -state(i-1,j+1,k-1,2)-state(i-1,j-1,k-1,2) $ -state(i-1,j+1,k+1,2)-state(i-1,j-1,k+1,2)) / dx(1) - $ eighth*(state(i+1,j+1,k-1,1)+state(i-1,j+1,k-1,1) $ +state(i+1,j+1,k+1,1)+state(i-1,j+1,k+1,1) $ -state(i+1,j-1,k-1,1)-state(i-1,j-1,k-1,1) $ -state(i+1,j-1,k+1,1)-state(i-1,j-1,k+1,1)) / dx(2) derval(i,j,k) = sqrt(derx**2 + dery**2 + derz**2) enddo enddo enddo return end c ************************************************************************* c ** DERAVGP ** c ** Average nodal pressure onto cell centers for plotting purposes c ************************************************************************* subroutine FORT_DERAVGP(pressure,dat,DIMS) implicit none integer DIMS REAL_T pressure(lo_1:hi_1+1,lo_2:hi_2+1,lo_3:hi_3+1) REAL_T dat(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3) c Local variables integer i, j, k do k = lo_3, hi_3 do j = lo_2, hi_2 do i = lo_1, hi_1 dat(i,j,k) = (pressure(i,j ,k ) + pressure(i+1,j ,k ) + $ pressure(i,j+1,k ) + pressure(i+1,j+1,k ) + $ pressure(i,j ,k+1) + pressure(i+1,j ,k+1) + $ pressure(i,j+1,k+1) + pressure(i+1,j+1,k+1) ) * eighth enddo enddo enddo return end c ************************************************************************* c ** FORT_SETCELLVELBC ** c ** set velocity bc for computation of derived variables c ************************************************************************* subroutine FORT_SETCELLVELBC(u,v,w,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi, $ bcz_lo,bcz_hi,visc_coef,dx,time) implicit none #include "probdata.H" integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi REAL_T visc_coef REAL_T dx(3) REAL_T time c Local variables integer i, j, k, is, ie, js, je, ks, ke is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 if (bcz_lo .eq. PERIODIC) then do j = js,je do i = is,ie w(i,j,ks-1) = w(i,j,ke) v(i,j,ks-1) = v(i,j,ke) u(i,j,ks-1) = u(i,j,ke) enddo enddo elseif (bcz_lo .eq. OUTLET) then do j = js,je do i = is,ie w(i,j,ks-1) = w(i,j,ks) v(i,j,ks-1) = v(i,j,ks) u(i,j,ks-1) = u(i,j,ks) enddo enddo elseif (bcz_lo .eq. INLET) then do j = js,je do i = is,ie w(i,j,ks-1) = two* in_zvel - w(i,j,ks) v(i,j,ks-1) = -v(i,j,ks) u(i,j,ks-1) = -u(i,j,ks) enddo enddo elseif (bcz_lo .eq. WALL) then do j = js,je do i = is,ie w(i,j,ks-1) = -w(i,j,ks) v(i,j,ks-1) = three*v(i,j,ks) - three*v(i,j,ks+1) + v(i,j,ks+2) u(i,j,ks-1) = three*u(i,j,ks) - three*u(i,j,ks+1) + u(i,j,ks+2) enddo enddo if (visc_coef .gt. zero) then do j = js,je do i = is,ie u(i,j,ks-1) = -u(i,j,ks) v(i,j,ks-1) = -v(i,j,ks) enddo enddo endif endif if (bcz_hi .eq. PERIODIC) then do j = js,je do i = is,ie w(i,j,ke+1) = w(i,j,ks) v(i,j,ke+1) = v(i,j,ks) u(i,j,ke+1) = u(i,j,ks) enddo enddo elseif (bcz_hi .eq. OUTLET) then do j = js,je do i = is,ie w(i,j,ke+1) = w(i,j,ke) v(i,j,ke+1) = v(i,j,ke) u(i,j,ke+1) = u(i,j,ke) enddo enddo elseif (bcz_hi .eq. INLET) then do j = js,je do i = is,ie w(i,j,ke+1) = two*in_zvel - w(i,j,ke) v(i,j,ke+1) = - v(i,j,ke) u(i,j,ke+1) = - u(i,j,ke) enddo enddo elseif (bcz_hi .eq. WALL) then do j = js,je do i = is,ie w(i,j,ke+1) = -w(i,j,ke) v(i,j,ke+1) = three*v(i,j,ke) - three*v(i,j,ke-1) + v(i,j,ke-2) u(i,j,ke+1) = three*u(i,j,ke) - three*u(i,j,ke-1) + u(i,j,ke-2) enddo enddo if (visc_coef .gt. zero) then do j = js,je do i = is,ie v(i,j,ke+1) = -v(i,j,ke) u(i,j,ke+1) = -u(i,j,ke) enddo enddo endif endif if (bcy_lo .eq. PERIODIC) then do k = ks-1,ke+1 do i = is ,ie w(i,js-1,k) = w(i,je,k) v(i,js-1,k) = v(i,je,k) u(i,js-1,k) = u(i,je,k) enddo enddo elseif (bcy_lo .eq. OUTLET) then do k = ks-1,ke+1 do i = is ,ie w(i,js-1,k) = w(i,js,k) v(i,js-1,k) = v(i,js,k) u(i,js-1,k) = u(i,js,k) enddo enddo elseif (bcy_lo .eq. INLET) then do k = ks-1,ke+1 do i = is ,ie v(i,js-1,k) = two* in_yvel - v(i,js,k) w(i,js-1,k) = -w(i,js,k) u(i,js-1,k) = -u(i,js,k) enddo enddo elseif (bcy_lo .eq. WALL) then do k = ks-1,ke+1 do i = is ,ie v(i,js-1,k) = -v(i,js,k) u(i,js-1,k) = three*u(i,js,k) - three*u(i,js+1,k)+u(i,js+2,k) w(i,js-1,k) = three*w(i,js,k) - three*w(i,js+1,k)+w(i,js+2,k) enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do i = is ,ie u(i,js-1,k) = -u(i,js,k) w(i,js-1,k) = -w(i,js,k) enddo enddo endif endif if (bcy_hi .eq. PERIODIC) then do k = ks-1,ke+1 do i = is,ie w(i,je+1,k) = w(i,js,k) v(i,je+1,k) = v(i,js,k) u(i,je+1,k) = u(i,js,k) enddo enddo elseif (bcy_hi .eq. OUTLET) then do k = ks-1,ke+1 do i = is,ie w(i,je+1,k) = w(i,je,k) v(i,je+1,k) = v(i,je,k) u(i,je+1,k) = u(i,je,k) enddo enddo elseif (bcy_hi .eq. INLET) then do k = ks-1,ke+1 do i = is ,ie v(i,je+1,k) = two*in_yvel - v(i,je,k) w(i,je+1,k) = - w(i,je,k) u(i,je+1,k) = - u(i,je,k) enddo enddo elseif (bcy_hi .eq. WALL) then do k = ks-1,ke+1 do i = is ,ie v(i,je+1,k) = -v(i,je,k) w(i,je+1,k) = three*w(i,je,k) - three*w(i,je-1,k)+w(i,je-2,k) u(i,je+1,k) = three*u(i,je,k) - three*u(i,je-1,k)+u(i,je-2,k) enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do i = is ,ie w(i,je+1,k) = -w(i,je,k) u(i,je+1,k) = -u(i,je,k) enddo enddo endif endif if (bcx_lo .eq. PERIODIC) then do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k) = u(ie,j,k) v(is-1,j,k) = v(ie,j,k) w(is-1,j,k) = w(ie,j,k) enddo enddo elseif (bcx_lo .eq. OUTLET) then do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k) = u(is,j,k) v(is-1,j,k) = v(is,j,k) w(is-1,j,k) = w(is,j,k) enddo enddo elseif (bcx_lo .eq. INLET) then do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k) = two*in_xvel - u(is,j,k) v(is-1,j,k) = - v(is,j,k) w(is-1,j,k) = - w(is,j,k) enddo enddo elseif (bcx_lo .eq. WALL) then do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k) = -u(is,j,k) v(is-1,j,k) = three*v(is,j,k)-three*v(is+1,j,k)+v(is+2,j,k) w(is-1,j,k) = three*w(is,j,k)-three*w(is+1,j,k)+w(is+2,j,k) enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do j = js-1,je+1 v(is-1,j,k) = -v(is,j,k) w(is-1,j,k) = -w(is,j,k) enddo enddo endif endif if (bcx_hi .eq. PERIODIC) then do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k) = u(is,j,k) v(ie+1,j,k) = v(is,j,k) w(ie+1,j,k) = w(is,j,k) enddo enddo elseif (bcx_hi .eq. OUTLET) then do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k) = u(ie,j,k) v(ie+1,j,k) = v(ie,j,k) w(ie+1,j,k) = w(ie,j,k) enddo enddo elseif (bcx_hi .eq. INLET) then do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k) = two *in_xvel - u(ie,j,k) v(ie+1,j,k) = - v(ie,j,k) w(ie+1,j,k) = - w(ie,j,k) enddo enddo elseif (bcx_hi .eq. WALL) then do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k) = - u(ie,j,k) v(ie+1,j,k) = three*v(ie,j,k)-three*v(ie-1,j,k)+v(ie-2,j,k) w(ie+1,j,k) = three*w(ie,j,k)-three*w(ie-1,j,k)+w(ie-2,j,k) enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do j = js-1,je+1 v(ie+1,j,k) = - v(ie,j,k) w(ie+1,j,k) = - w(ie,j,k) enddo enddo endif endif return end c ************************************************************************* c ** VELINFLOW ** c ** Impose the inflow boundary conditions on velocity c ************************************************************************* subroutine velinflow(u,DIMS,time,idir,is_hi) implicit none #include "probdata.H" integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T time integer idir,is_hi c Local variables integer i,j,k if (idir .eq. 0) then if (is_hi .eq. 0) then do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 u(lo_1-1,j,k) = in_xvel enddo enddo else do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 u(hi_1+1,j,k) = in_xvel enddo enddo endif elseif (idir .eq. 1) then if (is_hi .eq. 0) then do k = lo_3-1,hi_3+1 do i = lo_1-1,hi_1+1 u(i,lo_2-1,k) = in_yvel enddo enddo else do k = lo_3-1,hi_3+1 do i = lo_1-1,hi_1+1 u(i,hi_2+1,k) = in_yvel enddo enddo endif elseif (idir .eq. 2) then if (is_hi .eq. 0) then do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 u(i,j,lo_3-1) = in_zvel enddo enddo else do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 u(i,j,hi_3+1) = in_zvel enddo enddo endif else print *,'bogus idir in velinflow ',idir stop endif return end c ************************************************************************* c ** SCALINFLOW ** c ** Impose the inflow boundary conditions on scalars c ************************************************************************* subroutine scalinflow(s,DIMS,time,idir,is_hi,which_scal) implicit none #include "probdata.H" integer DIMS REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T time integer idir, is_hi integer which_scal c Local variables integer i,j,k REAL_T inflow_val if (which_scal .eq. 0) then inflow_val = in_density elseif (which_scal .eq. 1) then inflow_val = in_tracer else print *,"STOP IN SCALINFLOW " print *," -- DONT HAVE VALUE FOR THIS VARIABLE " stop endif if (idir .eq. 0) then if (is_hi .eq. 0) then do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 s(lo_1-1,j,k) = inflow_val enddo enddo else do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 s(hi_1+1,j,k) = inflow_val enddo enddo endif elseif (idir .eq. 1) then if (is_hi .eq. 0) then do k = lo_3-1,hi_3+1 do i = lo_1-1,hi_1+1 s(i,lo_2-1,k) = inflow_val enddo enddo else do k = lo_3-1,hi_3+1 do i = lo_1-1,hi_1+1 s(i,hi_2+1,k) = inflow_val enddo enddo endif elseif (idir .eq. 2) then if (is_hi .eq. 0) then do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 s(i,j,lo_3-1) = inflow_val enddo enddo else do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 s(i,j,hi_3+1) = inflow_val enddo enddo endif else print *,'bogus idir in scalinflow ',idir stop endif return end ccseapps-2.5/CCSEApps/varden3d/Grid.cpp0000644000175000017500000010360711634153073020765 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // // This MUST be defined if don't have pubsetbuf() in I/O Streams Library. // #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #define N_STATE 5 #define NDIM 3 #define ARLIM(x) x[0],x[1],x[2] int Grid::slope_order = 4; int Grid::init_iter = 2; Real Grid::fixed_dt = -1.0; // ************************************************************************ // ** constructor ** // ************************************************************************ Grid::Grid(std::string probin_file_read) { probin_file = probin_file_read; numscal = N_STATE - NDIM; parseInputs(); lo = prob_domain.smallEnd().getVect(); hi = prob_domain.bigEnd().getVect(); } // ************************************************************************ // ** parseInputs ** // ************************************************************************ void Grid::parseInputs() { ParmParse pp("grid"); Array n_cell(NDIM); pp.getarr("n_cell",n_cell,0,NDIM); IntVect pd_lo(0,0,0); IntVect pd_hi(n_cell[0]-1,n_cell[1]-1,n_cell[2]-1); prob_domain = Box(pd_lo,pd_hi); Array real_lo(NDIM); pp.getarr("prob_lo",real_lo,0,NDIM); Array real_hi(NDIM); pp.getarr("prob_hi",real_hi,0,NDIM); prob_lo[0] = real_lo[0]; prob_lo[1] = real_lo[1]; prob_lo[2] = real_lo[2]; prob_hi[0] = real_hi[0]; prob_hi[1] = real_hi[1]; prob_hi[2] = real_hi[2]; prob_size[0] = real_hi[0] - real_lo[0]; prob_size[1] = real_hi[1] - real_lo[1]; prob_size[2] = real_hi[2] - real_lo[2]; dx[0] = prob_size[0]/ (Real) n_cell[0] ; dx[1] = prob_size[1]/ (Real) n_cell[1] ; dx[2] = prob_size[2]/ (Real) n_cell[2] ; _hx = dx[0]; _hy = dx[1]; _hz = dx[2]; is_conserv.resize(numscal); int in_inputs = pp.countval("is_conserv"); if (in_inputs != numscal) { std::cout << "WRONG NUMBER OF INPUTS FOR grid.is_conserv " << std::endl; exit(0); } pp.getarr("is_conserv",is_conserv,0,numscal); for (int i = 0; i < numscal; i++) { if (is_conserv[i] != 0 && is_conserv[i] != 1) { std::cout << "each value of is_conserv must be 0 or 1 " << std::endl; exit(0); } } visc_coef = 0.0; pp.query("visc_coef",visc_coef); diff_coef.resize(numscal); in_inputs = pp.countval("diff_coef"); if (in_inputs != numscal) { std::cout << "WRONG NUMBER OF INPUTS FOR grid.diff_coef " << std::endl; exit(0); } pp.getarr("diff_coef",diff_coef,0,numscal); if (diff_coef[0] > 0.0) { std::cout << "DENSITY SHOULD NOT DIFFUSE " << std::endl; exit(0); } pp.query("slope_order",slope_order); if (slope_order != 0 && slope_order != 2 && slope_order != 4) { std::cout << "slope_order must be 0 or 2 or 4" << std::endl; exit(0); } pp.query("init_iter",init_iter); pp.query("restart",restart_file); pp.query("fixed_dt",fixed_dt); } // ************************************************************************ // ** init ** // ************************************************************************ // decide whether to initialize from beginning or from restart void Grid::init(int& nstep, Real& time, Real& dt) { int probin_file_length = probin_file.length(); Array probin_file_name(probin_file_length); for (int i = 0; i < probin_file_length; i++) probin_file_name[i] = probin_file[i]; FORT_PROBINIT(probin_file_name.dataPtr(), &probin_file_length); if (restart_file != "") { restart(restart_file,nstep,time,dt); } else { initialInit(nstep,time,dt); } } // ************************************************************************ // ** initialInit ** // ************************************************************************ void Grid::initialInit(int& nstep, Real& time, Real& dt) { nstep = 0; time = 0.0; dt = 0.0; Box sz(BoxLib::grow(prob_domain,1)); // alloc space for state variables state.resize(sz,N_STATE); staten.resize(sz,N_STATE); slopex.resize(sz,N_STATE); slopey.resize(sz,N_STATE); slopez.resize(sz,N_STATE); rhonph.resize(sz,1); visc.resize(sz,NDIM); visc.setVal(0.0); diff.resize(sz,numscal); diff.setVal(0.0); Box p_size(BoxLib::surroundingNodes(prob_domain)); pressure.resize(p_size,1); pressure.setVal(0.0); gradp.resize(sz,NDIM); gradp.setVal(0.0); force.resize(sz,NDIM); force.setVal(0.0); scalforce.resize(sz,numscal); scalforce.setVal(0.0); edgex.resize(sz,N_STATE); edgey.resize(sz,N_STATE); edgez.resize(sz,N_STATE); buildLinks(); proj = new hg_projector(prob_domain,dx); macproj = new mac_projector(prob_domain,dx); diffuse_op = new diffuser(prob_domain,dx); FORT_INITDATA(u,v,w,state.dataPtr(Density),ARLIM(lo),ARLIM(hi),dx,&time, &numscal); FORT_SETVELBC(u,v,w,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&time); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &n,dx,&time); } FArrayBox * rhotemp = new FArrayBox(sz,1); rhotemp->setVal(1.); FArrayBox divusrc; divusrc.resize(p_size,1); FORT_MKDIVUNOD(divusrc.dataPtr(),u,v,w,rho,&time,dx,ARLIM(lo),ARLIM(hi)); proj->project(&state,&pressure,rhotemp,&divusrc,time,dt); delete rhotemp; pressure.setVal(0.0); FORT_SETVELBC(u,v,w,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&time); } // ************************************************************************ // ** restart ** // ************************************************************************ void Grid::restart(std::string& filename, int& nstep, Real& time, Real& dt) { std::ifstream is(filename.c_str(),std::ios::in); is >> nstep; is >> time; is >> dt; is >> prob_domain; is >> bcx_lo; is >> bcx_hi; is >> bcy_lo; is >> bcy_hi; is >> bcz_lo; is >> bcz_hi; Box sz(BoxLib::grow(prob_domain,1)); // alloc space for state variables state.resize(sz,N_STATE); staten.resize(sz,N_STATE); slopex.resize(sz,N_STATE); slopey.resize(sz,N_STATE); slopez.resize(sz,N_STATE); rhonph.resize(sz,1); gradp.resize(sz,NDIM); force.resize(sz,NDIM); force.setVal(0.0); scalforce.resize(sz,numscal); scalforce.setVal(0.0); visc.resize(sz,NDIM); visc.setVal(0.0); diff.resize(sz,numscal); diff.setVal(0.0); edgex.resize(sz,N_STATE); edgey.resize(sz,N_STATE); edgez.resize(sz,N_STATE); Box p_size(BoxLib::surroundingNodes(prob_domain)); pressure.resize(p_size,1); state.readFrom(is); pressure.readFrom(is); buildLinks(); FORT_SETVELBC(u,v,w,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&time); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &n,dx,&time); } proj = new hg_projector(prob_domain,dx); macproj = new mac_projector(prob_domain,dx); diffuse_op = new diffuser(prob_domain,dx); } // ************************************************************************ // ** buildLinks ** // ************************************************************************ void Grid::buildLinks() { // build links to components of old-time state variables u = state.dataPtr(0); v = state.dataPtr(1); w = state.dataPtr(2); rho = state.dataPtr(NDIM); // build links to components of new-time state variables un = staten.dataPtr(0); vn = staten.dataPtr(1); wn = staten.dataPtr(2); rhon = staten.dataPtr(NDIM); rhohalf = rhonph.dataPtr(); // build links to pressure gradient px = gradp.dataPtr(); py = gradp.dataPtr(1); pz = gradp.dataPtr(2); _hx = dx[0]; _hy = dx[1]; _hz = dx[2]; uadv = new Real[(prob_domain.length()[0]+1)* prob_domain.length()[1] * prob_domain.length()[2] ]; vadv = new Real[ prob_domain.length()[0] *(prob_domain.length()[1]+1) * prob_domain.length()[2] ]; wadv = new Real[ prob_domain.length()[0] * prob_domain.length()[1] * (prob_domain.length()[2]+1)]; utrans = new Real[(prob_domain.length()[0]+1)* prob_domain.length()[1] * prob_domain.length()[2] ]; vtrans = new Real[ prob_domain.length()[0] *(prob_domain.length()[1]+1) * prob_domain.length()[2] ]; wtrans = new Real[ prob_domain.length()[0] * prob_domain.length()[1] * (prob_domain.length()[2]+1)]; } // ************************************************************************ // ** destructor ** // ************************************************************************ Grid::~Grid() { delete proj; delete macproj; delete diffuse_op; delete uadv; delete vadv; delete wadv; delete utrans; delete vtrans; delete wtrans; } // ************************************************************************ // ** writeCheckPoint ** // ************************************************************************ void Grid::writeCheckPoint(int nstep, Real time, Real dt, std::string& check_file_root) { // construct file name std::string chkfile = check_file_root; char buf[sizeof(int)+1]; sprintf (buf,"%04d",nstep); chkfile += buf; const char* chkfile_sep_str ="/"; if (chkfile.length() == 0) { BoxLib::Error("invalid check_file_root"); } if (strchr(chkfile.c_str(), *chkfile_sep_str) == 0) { // No slashes in the path, so no need to create directory. } else { // Make copy of the directory pathname so we can write to it. char* path = new char[chkfile.length() + 1]; (void) strcpy(path, chkfile.c_str()); char* slash = strrchr(path, *chkfile_sep_str); int fileNameLength = strlen(slash); int entireNameLength = strlen(path); int dirNameLength = entireNameLength - fileNameLength; char* chkdir= new char[dirNameLength+1]; strncpy(chkdir,path,dirNameLength); chkdir[dirNameLength] = path[entireNameLength]; // create the directory if (!BoxLib::UtilCreateDirectory(chkdir,0755)){ BoxLib::CreateDirectoryFailed(chkdir); } delete [] chkdir; delete [] path; } // open stream std::ofstream os(chkfile.c_str(),std::ios::out); os.precision(15); os << nstep << '\n'; os << time << '\n'; os << dt << '\n'; os << prob_domain << '\n'; os << bcx_lo << '\n'; os << bcx_hi << '\n'; os << bcy_lo << '\n'; os << bcy_hi << '\n'; os << bcz_lo << '\n'; os << bcz_hi << '\n'; state.writeOn(os); pressure.writeOn(os); } // ************************************************************************ // ** initialIter ** // ************************************************************************ void Grid::initialIter(Real time, Real dt) { for (int iter = 0; iter < init_iter; iter++) { timeStep(time,dt); } } // ************************************************************************ // ** advance ** // ************************************************************************ void Grid::advance(Real time, Real dt) { timeStep(time,dt); state.copy(staten,0,0,N_STATE); staten.setVal(0.); } // ************************************************************************ // ** timeStep ** // ************************************************************************ void Grid::timeStep(Real time, Real dt) { FORT_SETVELBC(u,v,w,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&time); getSlopes(0,NDIM); getGradP(); getForce(time); getViscTerm(); makeAdvVels(time,dt); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &n,dx,&time); } getSlopes(Density,N_STATE-NDIM); updateScalars(time,dt); getRhoHalf(time,dt); updateVelocity(time,dt); } // ************************************************************************ // ** getSlopes ** // ************************************************************************ void Grid::getSlopes(int first_comp, int num_comp) { int numx = prob_domain.length()[0]+2; Real *dfromx = new Real[4*numx]; FORT_SLOPEX(state.dataPtr(first_comp),slopex.dataPtr(first_comp), dfromx,ARLIM(lo),ARLIM(hi),&num_comp,&bcx_lo,&bcx_hi, &slope_order); delete dfromx; int numy = prob_domain.length()[1]+2; Real *dfromy = new Real[4*numy]; FORT_SLOPEY(state.dataPtr(first_comp),slopey.dataPtr(first_comp), dfromy,ARLIM(lo),ARLIM(hi),&num_comp,&bcy_lo,&bcy_hi, &slope_order); delete dfromy; int numz = prob_domain.length()[2]+2; Real *dfromz = new Real[4*numz]; FORT_SLOPEZ(state.dataPtr(first_comp),slopez.dataPtr(first_comp), dfromz,ARLIM(lo),ARLIM(hi),&num_comp,&bcz_lo,&bcz_hi, &slope_order); delete dfromz; } // ************************************************************************ // ** getViscTerm ** // ************************************************************************ void Grid::getViscTerm() { if (visc_coef > 0.) { for (int n = 0; n < NDIM; n++) { FORT_LAPLAC(state.dataPtr(n),visc.dataPtr(n), ARLIM(lo),ARLIM(hi),dx,&visc_coef, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); } } } // ************************************************************************ // ** getDiffTerm ** // ************************************************************************ void Grid::getDiffTerm() { for (int n = 0; n < numscal; n++) { Real dc = diff_coef[n]; if (dc > 0.) { FORT_LAPLAC(state.dataPtr(Density+n),diff.dataPtr(n), ARLIM(lo),ARLIM(hi),dx,&dc, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); } } } // ************************************************************************ // ** getGradP ** // ************************************************************************ void Grid::getGradP() { proj->gradient(gradp,pressure); } // ************************************************************************ // ** getForce ** // ************************************************************************ void Grid::getForce(Real current_time) { FORT_MKFORCE(force.dataPtr(),u,v,w,rho, &gravity,&visc_coef,¤t_time,dx,ARLIM(lo),ARLIM(hi)); } // ************************************************************************ // ** getScalForce ** // ************************************************************************ void Grid::getScalForce(Real current_time) { FORT_MKSCALFORCE(scalforce.dataPtr(),state.dataPtr(Density), ¤t_time,dx,ARLIM(lo),ARLIM(hi),&numscal); } // ************************************************************************ // ** makeAdvVel ** // ************************************************************************ void Grid::makeAdvVels(Real time, Real dt) { Real halftime = time + .5*dt; // Reset the bcs if inflow profile (for the case of time-dep inflow) if (bcx_lo == INLET || bcx_hi == INLET || bcy_lo == INLET || bcy_hi == INLET || bcz_lo == INLET || bcz_hi == INLET ) { FORT_SETVELBC(u,v,w,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&halftime); } int numx = prob_domain.length()[0]+2; int numy = prob_domain.length()[1]+2; int numz = prob_domain.length()[2]+2; Real *stlft = new Real[2*numx]; Real *strgt = stlft + numx; Real *stbot = new Real[2*numy]; Real *sttop = stbot + numy; Real *stdwn = new Real[2*numz]; Real *stup = stdwn + numz; Real * ux = slopex.dataPtr(Xvel); Real * vx = slopex.dataPtr(Yvel); Real * wx = slopex.dataPtr(Zvel); Real * uy = slopey.dataPtr(Xvel); Real * vy = slopey.dataPtr(Yvel); Real * wy = slopey.dataPtr(Zvel); Real * uz = slopez.dataPtr(Xvel); Real * vz = slopez.dataPtr(Yvel); Real * wz = slopez.dataPtr(Zvel); // This extrapolates u to the x-edges and v to the y-edges only. FORT_MKADVVEL(u,ux,uy,uz,v,vx,vy,vz,w,wx,wy,wz,rho,force.dataPtr(),px,py,pz, visc.dataPtr(),dx,dt,ARLIM(lo),ARLIM(hi), stlft,strgt,sttop,stbot,stdwn,stup, uadv,vadv,wadv,utrans,vtrans,wtrans, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi,&visc_coef); delete stlft; delete stbot; delete stdwn; // Create the cell-based source S for the divergence constraint Div(U) = S FArrayBox divusrc; divusrc.resize(prob_domain,1); FORT_MKDIVUCC(divusrc.dataPtr(),u,v,w,rho,&halftime,dx,ARLIM(lo),ARLIM(hi)); // This enforces the div(U) = S condition on the edge-based half-time // normal velocities macproj->project(uadv,vadv,wadv,rho,divusrc); } // ************************************************************************ // ** updateScalars ** // ************************************************************************ void Grid::updateScalars(Real time, Real dt) { Real newtime = time+dt; int numx = prob_domain.length()[0]+1; int numy = prob_domain.length()[1]+1; int numz = prob_domain.length()[2]+1; Real *stleft = new Real[2*numx]; Real *strght = stleft + numx; Real *stbot = new Real[2*numy]; Real *sttop = stbot + numy; Real *stdwn = new Real[2*numz]; Real *stup = stdwn + numz; if (bcx_lo == INLET || bcx_hi == INLET || bcy_lo == INLET || bcy_hi == INLET || bcz_lo == INLET || bcz_hi == INLET ) { Real halftime = time + .5*dt; for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(state.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &n,dx,&halftime); } } getDiffTerm(); getScalForce(time); FORT_MKSCAFLUX(state.dataPtr(Density) , edgex.dataPtr(Density) , edgey.dataPtr(Density), edgez.dataPtr(Density) , slopex.dataPtr(Density), slopey.dataPtr(Density), slopez.dataPtr(Density), uadv, vadv, wadv, utrans, vtrans, wtrans, u, diff.dataPtr(), scalforce.dataPtr(), stleft,strght,stbot,sttop,stdwn,stup, ARLIM(lo),ARLIM(hi),dx,&dt, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi,&numscal); delete stleft; delete stbot; delete stdwn; Real halftime = time + 0.5*dt; getScalForce(halftime); FORT_SCALUPD(state.dataPtr(Density), staten.dataPtr(Density), edgex.dataPtr(Density), edgey.dataPtr(Density), edgez.dataPtr(Density), uadv, vadv, wadv, diff.dataPtr(), scalforce.dataPtr(), ARLIM(lo),ARLIM(hi),dx,&dt,is_conserv.dataPtr(), &numscal); for (int n = 0; n < numscal; n++) { FORT_SETSCALBC(staten.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &n,dx,&newtime); if (diff_coef[n] > 0.0) { FArrayBox temp(BoxLib::grow(prob_domain,1),1); temp.setVal(0.); Real mu = .5*diff_coef[n]*dt; diffuse_op->solveScal(&staten,&temp,mu,Density+n); staten.copy(temp,0,Density+n,1); FORT_SETSCALBC(staten.dataPtr(Density+n),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &n,dx,&newtime); } } } // ************************************************************************ // ** getRhoHalf ** // ************************************************************************ void Grid::getRhoHalf(Real time, Real dt) { int src_comp = Density; int dest_comp = 0; rhonph.copy(state ,src_comp,dest_comp,1); rhonph.plus(staten,src_comp,dest_comp,1); rhonph.mult(0.5); if (bcx_lo == INLET || bcx_hi == INLET || bcy_lo == INLET || bcy_hi == INLET || bcz_lo == INLET || bcz_hi == INLET) { Real halftime = time + 0.5*dt; int n = 0; FORT_SETSCALBC(rhohalf,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &n,dx,&halftime); } } // ************************************************************************ // ** updateVelocity ** // ************************************************************************ void Grid::updateVelocity(Real time, Real dt) { int numx = prob_domain.length()[0]+1; int numy = prob_domain.length()[1]+1; int numz = prob_domain.length()[2]+1; Real *stlft = new Real[6*numx]; Real *strgt = stlft + 3*numx; Real *stbot = new Real[6*numy]; Real *sttop = stbot + 3*numy; Real *stdwn = new Real[6*numz]; Real *stup = stdwn + 3*numz; FORT_MKVELFLUX(state.dataPtr() , edgex.dataPtr() , edgey.dataPtr(), edgez.dataPtr() , slopex.dataPtr(), slopey.dataPtr(), slopez.dataPtr(), uadv, vadv, wadv, utrans, vtrans, wtrans, rho, px, py, pz, visc.dataPtr(), stlft,strgt,stbot,sttop,stdwn,stup, ARLIM(lo),ARLIM(hi),dx,&dt, force.dataPtr(),&visc_coef, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); delete stlft; delete stbot; delete stdwn; Real halftime = time + 0.5*dt; getForce(halftime); FORT_VELUPD(u,v,w,un,vn,wn,visc.dataPtr(),gradp.dataPtr(),rhohalf, uadv,vadv,wadv, edgex.dataPtr(),edgey.dataPtr(),edgez.dataPtr(), force.dataPtr(),&dt,ARLIM(lo),ARLIM(hi),dx); Real newtime = time+dt; FORT_SETVELBC(un,vn,wn,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&newtime); if (visc_coef > 0.0) { Real mu = .5*visc_coef*dt; for (int n = 0; n < NDIM; n++) { FArrayBox temp(BoxLib::grow(prob_domain,1),1); temp.setVal(0.); diffuse_op->solveVel(&staten,&temp,rhohalf,mu,n); staten.copy(temp,0,n,1); } } FORT_SETVELBC(un,vn,wn,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&newtime); // Create the node-based source S_t for the divergence constraint Div(U_t) = S_t FArrayBox divusrc, divutmp; Box p_size(BoxLib::surroundingNodes(prob_domain)); divusrc.resize(p_size,1); divutmp.resize(p_size,1); FORT_MKDIVUNOD(divutmp.dataPtr(),u ,v ,w ,rho ,&time,dx,ARLIM(lo),ARLIM(hi)); FORT_MKDIVUNOD(divusrc.dataPtr(),un,vn,wn,rhon,&newtime,dx,ARLIM(lo),ARLIM(hi)); divusrc.minus(divutmp); divusrc.mult(1./dt); // staten.minus(state,0,0,NDIM); staten.divide(dt,0,NDIM); proj->project(&staten,&pressure,&rhonph,&divusrc,time,dt); staten.mult(dt,0,NDIM); // staten.plus(state,0,0,NDIM); FORT_SETVELBC(un,vn,wn,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&newtime); } // ************************************************************************ // ** estimateDt ** // ************************************************************************ Real Grid::estimateDt(Real & dt, Real cfl) { getGradP(); Real cfl_temp = cfl; if (fixed_dt > 0) cfl_temp = 0.9; FORT_CMPDT(u,v,w,rho,px,py,pz,force.dataPtr(),dx,&dt,&cfl_temp, ARLIM(lo),ARLIM(hi)); if (fixed_dt > 0) { if (fixed_dt > dt) { std::cout << "WARNING: fixed_dt may be too big" << std::endl; std::cout << "fixed_dt = " << fixed_dt << " with CFL =0.9 computed_dt = " << dt << std::endl; } dt = fixed_dt; } std::cout << "Computing dt to be " << dt << std::endl; return dt; } // ************************************************************************ // ** DeriveFunc ** // ************************************************************************ // ------------ Define assoc between var name and derive func typedef void (*DeriveFunc) (Real* state, Real* derval, const int& der_lo_1, const int& der_lo_2, const int& der_lo_3, const int& der_hi_1, const int& der_hi_2, const int& der_hi_3, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, const Real* dx); // ************************************************************************ // ** DeriveRec ** // ************************************************************************ class DeriveRec { public: DeriveRec(std::string name, DeriveFunc f) : varname(name), func(f) {}; ~DeriveRec() {}; std::string varname; DeriveFunc func; }; DeriveRec vor_rec("vort", FORT_DERVORT); static DeriveRec deriveList[] = { vor_rec, }; int numDerive = sizeof(deriveList)/sizeof(DeriveRec); // ************************************************************************ // ** deriveData ** // ************************************************************************ void Grid::deriveData(FArrayBox& derval, const std::string& name, Real time) { // is it a state variable if (name == "x_velocity") { derval.copy(state,prob_domain,0,prob_domain,0,1); return; } else if (name == "y_velocity") { derval.copy(state,prob_domain,1,prob_domain,0,1); return; } else if (name == "z_velocity") { derval.copy(state,prob_domain,2,prob_domain,0,1); return; } else if (name == "density") { derval.copy(state,prob_domain,3,prob_domain,0,1); return; } else if (name == "tracer") { derval.copy(state,prob_domain,4,prob_domain,0,1); return; // IF YOU WISH TO ADD A NEW SCALAR VARIABLE, UNCOMMENT THESE LINES // } else if (name == "new_scalar") { // derval.copy(state,prob_domain,5,prob_domain,0,1); // return; } else if (name == "pressure") { FORT_DERAVGP(pressure.dataPtr(), derval.dataPtr(), ARLIM(lo), ARLIM(hi)); return; } else if (name == "px") { derval.copy(gradp,prob_domain,0,prob_domain,0,1); return; } else if (name == "py") { derval.copy(gradp,prob_domain,1,prob_domain,0,1); return; } else if (name == "pz") { derval.copy(gradp,prob_domain,2,prob_domain,0,1); return; } const int* derlo = derval.loVect(); const int* derhi = derval.hiVect(); // if we got here, check list of known derived quantities for (int i = 0; i < numDerive; i++) { if (name == deriveList[i].varname) { FORT_SETCELLVELBC(u,v,w,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&time); deriveList[i].func(state.dataPtr(),derval.dataPtr(), ARLIM(derlo),ARLIM(derhi), ARLIM(lo),ARLIM(hi),dx); FORT_SETVELBC(u,v,w,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&time); return; } } // if we got here, dont know how to derive this std::cerr << "Dont know how to derive " << name << std::endl; abort(); } // ************************************************************************ // ** writePlotFile ** // ************************************************************************ // ------------------------------------------------------------- void Grid::writePlotFile( int nstep, Real time, std::string& plot_file_root) { std::string pltfile = plot_file_root; char buf[sizeof(int)+1]; sprintf(buf,"%04d",nstep); pltfile += buf; // create directory if (!(BoxLib::UtilCreateDirectory(pltfile,0755))) { BoxLib::CreateDirectoryFailed(pltfile); } std::string HeaderFileName = pltfile + "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); std::ofstream HeaderFile; HeaderFile.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); int old_prec; HeaderFile.open(HeaderFileName.c_str(), std::ios::out|std::ios::trunc); if (!HeaderFile.good()) BoxLib::FileOpenFailed(HeaderFileName); old_prec = HeaderFile.precision(15); static const std::string RunstatString("write_pltfile"); int finest_level = 0; for (int k = 0; k <= finest_level; k++) { writePlotFile(pltfile, HeaderFile,nstep,time); } HeaderFile.precision(old_prec); if (!HeaderFile.good()) BoxLib::Error("Amr::writePlotFile() failed"); } std::string Grid::thePlotFileType() { // Increment this whenever the writePlotFile() format changes. // static const std::string the_plot_file_type("HyperCLaw-V1.1"); return the_plot_file_type; } void Grid::writePlotFile(std::string& dir, std::ostream& os, int nstep, Real time) { int i, n; int finest_level = 0; // plotfile type os << thePlotFileType() << '\n'; // number of components int numPlotComp = N_STATE + 1 + NDIM + numDerive; os << numPlotComp << '\n'; // names os << "x_velocity" << '\n'; os << "y_velocity" << '\n'; os << "z_velocity" << '\n'; os << "density" << '\n'; os << "tracer" << '\n'; // IF YOU WISH TO ADD A NEW SCALAR VARIABLE, UNCOMMENT THIS LINE // os << "new_scalar" << '\n'; os << "pressure"<< '\n'; os << "px" << '\n'; os << "py" << '\n'; os << "pz" << '\n'; os << "vort" << '\n'; static const std::string MultiFabBaseName("/MultiFab"); // dimensions os << NDIM << '\n'; // current time os << time << '\n'; // finest_level os << finest_level << '\n'; // problem_domain for (i = 0; i < NDIM; i++) os << prob_lo[i] << ' '; os << '\n'; for (i = 0; i < NDIM; i++) os << prob_hi[i] << ' '; os << '\n'; os << '\n'; // domain os << prob_domain << ' '; os << '\n'; os << nstep << '\n'; for (int k = 0; k < NDIM; k++) { os << dx[k] << ' '; } os << '\n'; int irz_temp = 0; os << irz_temp << '\n'; // write bndry data os << "0\n"; int thisLevel = 0; int numGridsOnLevel = 1; int IAMRSteps = 0; char buf[64]; sprintf(buf, "Level_%d",thisLevel); std::string Level = buf; std::string FullPath = dir; if (!FullPath.empty() && FullPath[FullPath.length()-1] != '/') FullPath += '/'; FullPath += Level; if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) BoxLib::CreateDirectoryFailed(FullPath); // now write state data os << thisLevel << ' ' << numGridsOnLevel << ' ' << time << '\n'; os << IAMRSteps << '\n'; for (n = 0; n < NDIM; n++) { os << prob_lo[n] << ' ' << prob_hi[n] << '\n'; } std::string PathNameInHeader = Level; PathNameInHeader += MultiFabBaseName; os << PathNameInHeader << '\n'; FullPath += MultiFabBaseName; // copy all of the data into the multifab. BoxArray bs(1); bs.set(0,prob_domain); FArrayBox temp(prob_domain,1); FArrayBox dat(prob_domain,numPlotComp); MultiFab mf(bs,numPlotComp,0,Fab_allocate); int counter = 0; // Writing the state data: u, v, rho, scalars dat.copy(state,0,0,N_STATE); counter += N_STATE; // Writing the pressure FORT_DERAVGP(pressure.dataPtr(), temp.dataPtr(), ARLIM(lo), ARLIM(hi)); dat.copy(temp,0,counter,1); counter++; // Writing the pressure gradient proj->gradient(gradp,pressure); dat.copy(gradp,0,counter,NDIM); counter += NDIM; // Writing the vorticity temp.resize(prob_domain,numDerive); for(i = 0; i < numDerive; i++) { FORT_SETCELLVELBC(u,v,w,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&time); deriveList[i].func(state.dataPtr(),temp.dataPtr(), ARLIM(lo),ARLIM(hi),ARLIM(lo),ARLIM(hi),dx); FORT_SETVELBC(u,v,w,ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &visc_coef,dx,&time); dat.copy(temp,0,counter,1); counter++; } mf[0].copy(dat); VisMF::Write(mf,FullPath,VisMF::OneFilePerCPU); } ccseapps-2.5/CCSEApps/varden3d/setvelbc.F0000644000175000017500000002456611634153073021320 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** SETVELBC ** c ** Impose the physical boundary conditions on the velocity (u,v) c ************************************************************************* subroutine setvelbc(u,v,w,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi, $ visc_coef,dx,time) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi REAL_T visc_coef REAL_T dx(3) REAL_T time c Local variables integer is,ie,js,je,ks,ke,i,j,k is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 if (bcz_lo .eq. PERIODIC) then do j = js,je do i = is,ie u(i,j,ks-1) = u(i,j,ke) v(i,j,ks-1) = v(i,j,ke) w(i,j,ks-1) = w(i,j,ke) enddo enddo elseif (bcz_lo .eq. WALL) then c ::: REMEMBER - THESE VALUES NOW LIVE ON CELL EDGES do j = js,je do i = is,ie w(i,j,ks-1) = zero u(i,j,ks-1) = (fifteen*u(i,j,ks ) - ten*u(i,j,ks+1) + $ three*u(i,j,ks+2)) / eight v(i,j,ks-1) = (fifteen*v(i,j,ks ) - ten*v(i,j,ks+1) + $ three*v(i,j,ks+2)) / eight enddo enddo if (visc_coef .gt. zero) then do j = js,je do i = is,ie u(i,j,ks-1) = zero v(i,j,ks-1) = zero enddo enddo endif elseif (bcz_lo .eq. INLET) then call velinflow(w,DIMS,time,2,0) do j = js,je do i = is,ie u(i,j,ks-1) = zero v(i,j,ks-1) = zero enddo enddo elseif (bcz_lo .eq. OUTLET) then do j = js,je do i = is,ie u(i,j,ks-1) = u(i,j,ks) v(i,j,ks-1) = v(i,j,ks) w(i,j,ks-1) = w(i,j,ks) enddo enddo else print *,'bogus bcz_lo in setvelbc ',bcz_lo stop endif if (bcz_hi .eq. PERIODIC) then do j = js,je do i = is,ie u(i,j,ke+1) = u(i,j,ks) v(i,j,ke+1) = v(i,j,ks) w(i,j,ke+1) = w(i,j,ks) enddo enddo elseif (bcz_hi .eq. WALL) then c ::: REMEMBER - THESE VALUES NOW LIVE ON CELL EDGES do j = js,je do i = is,ie w(i,j,ke+1) = zero u(i,j,ke+1) = (fifteen*u(i,j,ke ) - ten*u(i,j,ke-1) + $ three*u(i,j,ke-2)) / eight v(i,j,ke+1) = (fifteen*v(i,j,ke ) - ten*v(i,j,ke-1) + $ three*v(i,j,ke-2)) / eight enddo enddo if (visc_coef .gt. zero) then do j = js,je do i = is,ie u(i,j,ke+1) = zero v(i,j,ke+1) = zero enddo enddo endif elseif (bcz_hi .eq. INLET) then call velinflow(w,DIMS,time,2,1) do j = js,je do i = is,ie u(i,j,ke+1) = zero v(i,j,ke+1) = zero enddo enddo elseif (bcz_hi .eq. OUTLET) then do j = js,je do i = is,ie u(i,j,ke+1) = u(i,j,ke) v(i,j,ke+1) = v(i,j,ke) w(i,j,ke+1) = w(i,j,ke) enddo enddo else print *,'bogus bcz_hi in setvelbc ',bcz_hi stop endif if (bcy_lo .eq. PERIODIC) then do k = ks-1,ke+1 do i = is,ie u(i,js-1,k) = u(i,je,k) v(i,js-1,k) = v(i,je,k) w(i,js-1,k) = w(i,je,k) enddo enddo elseif (bcy_lo .eq. WALL) then c ::: REMEMBER - THESE VALUES NOW LIVE ON CELL EDGES do k = ks-1,ke+1 do i = is,ie v(i,js-1,k) = zero u(i,js-1,k) = (fifteen*u(i,js ,k) - ten*u(i,js+1,k) + $ three*u(i,js+2,k)) / eight w(i,js-1,k) = (fifteen*w(i,js ,k) - ten*w(i,js+1,k) + $ three*w(i,js+2,k)) / eight enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do i = is,ie u(i,js-1,k) = zero w(i,js-1,k) = zero enddo enddo endif elseif (bcy_lo .eq. INLET) then call velinflow(v,DIMS,time,1,0) do k = ks-1,ke+1 do i = is,ie u(i,js-1,k) = zero w(i,js-1,k) = zero enddo enddo elseif (bcy_lo .eq. OUTLET) then do k = ks-1,ke+1 do i = is,ie u(i,js-1,k) = u(i,js,k) v(i,js-1,k) = v(i,js,k) w(i,js-1,k) = w(i,js,k) enddo enddo else print *,'bogus bcy_lo in setvelbc ', bcy_lo stop endif if (bcy_hi .eq. PERIODIC) then do k = ks-1,ke+1 do i = is,ie u(i,je+1,k) = u(i,js,k) v(i,je+1,k) = v(i,js,k) w(i,je+1,k) = w(i,js,k) enddo enddo elseif (bcy_hi .eq. WALL) then c ::: REMEMBER - THESE VALUES NOW LIVE ON CELL EDGES do k = ks-1,ke+1 do i = is,ie v(i,je+1,k) = zero u(i,je+1,k) = (fifteen*u(i,je ,k) - ten*u(i,je-1,k) + $ three*u(i,je-2,k)) / eight w(i,je+1,k) = (fifteen*w(i,je ,k) - ten*w(i,je-1,k) + $ three*w(i,je-2,k)) / eight enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do i = is,ie u(i,je+1,k) = zero w(i,je+1,k) = zero enddo enddo endif elseif (bcy_hi .eq. INLET) then call velinflow(v,DIMS,time,1,1) do k = ks-1,ke+1 do i = is,ie u(i,je+1,k) = zero w(i,je+1,k) = zero enddo enddo elseif (bcy_hi .eq. OUTLET) then do k = ks-1,ke+1 do i = is,ie u(i,je+1,k) = u(i,je,k) v(i,je+1,k) = v(i,je,k) w(i,je+1,k) = w(i,je,k) enddo enddo else print *,'bogus bcy_hi in setvelbc ',bcy_hi stop endif if (bcx_lo .eq. PERIODIC) then do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k) = u(ie,j,k) v(is-1,j,k) = v(ie,j,k) w(is-1,j,k) = w(ie,j,k) enddo enddo elseif (bcx_lo .eq. WALL) then c ::: REMEMBER - THESE VALUES NOW LIVE ON CELL EDGES do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k) = zero v(is-1,j,k) = (fifteen*v(is ,j,k) - ten*v(is+1,j,k) + $ three*v(is+2,j,k)) / eight w(is-1,j,k) = (fifteen*w(is ,j,k) - ten*w(is+1,j,k) + $ three*w(is+2,j,k)) / eight enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do j = js-1,je+1 v(is-1,j,k) = zero w(is-1,j,k) = zero enddo enddo endif elseif (bcx_lo .eq. INLET) then call velinflow(u,DIMS,time,0,0) do k = ks-1,ke+1 do j = js-1,je+1 v(is-1,j,k) = zero w(is-1,j,k) = zero enddo enddo elseif (bcx_lo .eq. OUTLET) then do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k) = u(is,j,k) v(is-1,j,k) = v(is,j,k) w(is-1,j,k) = w(is,j,k) enddo enddo else print *,'bogus bcx_lo in setvelbc ',bcx_lo stop endif if (bcx_hi .eq. PERIODIC) then do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k) = u(is,j,k) v(ie+1,j,k) = v(is,j,k) w(ie+1,j,k) = w(is,j,k) enddo enddo elseif (bcx_hi .eq. WALL) then c ::: REMEMBER - THESE VALUES NOW LIVE ON CELL EDGES do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k) = zero v(ie+1,j,k) = (fifteen*v(ie ,j,k) - ten*v(ie-1,j,k) + $ three*v(ie-2,j,k)) / eight w(ie+1,j,k) = (fifteen*w(ie ,j,k) - ten*w(ie-1,j,k) + $ three*w(ie-2,j,k)) / eight enddo enddo if (visc_coef .gt. zero) then do k = ks-1,ke+1 do j = js-1,je+1 v(ie+1,j,k) = zero w(ie+1,j,k) = zero enddo enddo endif elseif (bcx_hi .eq. INLET) then call velinflow(u,DIMS,time,0,1) do k = ks-1,ke+1 do j = js-1,je+1 v(ie+1,j,k) = zero w(ie+1,j,k) = zero enddo enddo elseif (bcx_hi .eq. OUTLET) then do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k) = u(ie,j,k) v(ie+1,j,k) = v(ie,j,k) w(ie+1,j,k) = w(ie,j,k) enddo enddo else print *,'bogus bcx_hi in setvelbc ', bcx_hi stop endif return end ccseapps-2.5/CCSEApps/varden3d/README0000644000175000017500000002262011634153073020247 0ustar amckinstryamckinstry ########################################################################## INTRODUCTION ########################################################################## This code implements a single-grid variable density projection method for the incompressible Navier-Stokes equations. Here we use Godunov upwind methodology for the advection terms, a Crank-Nicholson discretization of the viscous terms in the momentum equation, and an approximate node-based projection to enforce the divergence-free constraint on velocity. This algorithm is described in detail in several papers; here we refer you to the section of the recent paper, "A Conservative Adaptive Projection Method for the Variable Density Incompressible Navier-Stokes Equations" on the single grid projection algorithm, which can be found on the web site. See also the references cited therein. ########################################################################## MAKING THE EXECUTABLE ########################################################################## To run this code, you must build the varden executable in this directory. You will also want to build the AmrVis executable in ../pAmrvis. Modify the GNUmakefile in this directory to set the following flags: DIM = 3 COMP = your compiler DEBUG = TRUE or FALSE PRECISION = DOUBLE or FLOAT USE_MPI = FALSE PROFILE = FALSE Now type "make." This should build the executable in this directory. If you have problems at this point, please contact Ann Almgren at ASAlmgren@lbl.gov The executable will look something like run3d.OSF1.KCC.ex . This is a three-dimensional executable built with the OSF1 operating system, the KCC compiler, and the DEBUG=FALSE flag set in the GNUmakefile. If DEBUG=TRUE, the executable will look like run3d.OSF1.KCC.DEBUG.ex . The DEBUG=TRUE option exercises certain debug options in the pBoxLib library, and turns on several Fortran debug options also, which may be helpful if you are trying to debug a new code. The DEBUG=FALSE version runs more quickly. Finally, to make the AmrVis executable, type "make" in the pAmrvis directory. Make sure that the GNUmakefile in that directory has DIM set to 3. ########################################################################## VIEWING THE DATA ########################################################################## To view the data resulting from calculations using the code, you will want to download and make the Amrvis program also available on the web site. Plot files (plt0001, e.g., after one time step) are generated by the VarDen code during runtime. The frequency of plot file generation is controlled in the inputs file by the parameter "plot_int." These files contain the velocity, scalars, pressure averaged onto cells, pressure gradient and vorticiy at the time specified. You can add additional derived quantities to the plot files by modifying Grid::writePlotFile. To view these plot files you will need to make the 3D executable in the ../pAmrvis directory. After the plot file (plt0001, e.g.) has been created, it can be viewed by typing ../pAmrvis/amrvis3d*ex plt0001 Sample plot files from each of the sample problems are included here in the subdirectory PlotFiles. ########################################################################## RUNNING THE EXECUTABLE ########################################################################## To run the code you will need two different files in your directory : one read by main(), the other read by FORT_PROBINIT. The first is typically called "inputs", but this name is set on the command line. The name of the second is typically "probin", but this name is set in the inputs file which is read in. There are four test problems set up for you to run; you can later edit the prob.F file and the inputs and probin files to create your own test problems. You can also modify the inputs and probin files to run these test problems at different resolution and with different parameters. ----------------------------------------------------------------------------- To run a constant-density inviscid spindown problem, type run3d.OSF1.KCC.ex inputs1 (This will read probin1) ----------------------------------------------------------------------------- To run a variable-density inviscid bubble drop problem, type run3d.OSF1.KCC.ex inputs2 (This will read probin2) ----------------------------------------------------------------------------- To run a constant-density triply periodic shear layer problem, type run3d.OSF1.KCC.ex inputs3 (This will read probin3) ----------------------------------------------------------------------------- To run a viscous flow-in-a-channel problem, type run3d.OSF1.KCC.ex inputs4 (This will read probin4) ########################################################################## To set up a different problem using the variables as given : x-velocity (u), y-velocity (v), z-velocity (w), density (rho), tracer (1) Determine which problem-specific constant parameters you would like to be able to change at run-time. Put these into probin (using the format there) and edit probdata.H to incorporate them appropriately - make sure to add them both to the declaration statement as well as the common block. (2) Edit FORT_INITDATA and/or the routines it calls in prob.F to set up your initial data. You must initialize all the state variables - u, v, w, rho, and the tracer. (3) If you would like the velocity field to satisfy div(u) = S rather than div(u) = 0, you must set S on cell centers and on nodes by editing mkdivucc.F and mkdivunod.F . The current default is S = 0. (4) If you would like to have a forcing term in your scalar equation, define it in mkscalforce.F IN INPUTS: (5) Set boundary conditions using the boundary condition flags bcx_lo, bcx_hi, bcy_lo, bcy_hi, bcz_lo and bcz_hi. See the comments there for a description of the flags. If you are using inflow boundary conditions, you must edit "setvelinflow" and "setscalinflow" in prob.F appropriately to supply the correct inflow boundary conditions. (6) If this is a viscous problem, set visc_coef to be the dynamic viscosity (assumed constant). (7) If you would like your scalar to diffuse, set the diff_coef array appropriately. (8) If you have gravity in your problem then set the gravity value according to your physical units. The default in mkforce.F is that gravity acts in the z-direction; you can of course change this. (9) Set max_step and stop_time to determine how long your calculation will run. If you want to be governed by max_step, set stop_time to a very large number. If you want to be governed by stop_time, set max_step to be a very large integer. (10)Set check_int and plot_int to govern your graphics output and restart capability. (11)Set grid.n_cell to be the size (in index space) of your problem, e.g. for a 16x32x64 calculation you would set grid.n_cell = 16 32 64 (12)Set grid.prob_lo and grid.prob_hi to be the physical coordinates of the low and high ends of your domain. E.g. if your calculation is in a 1x2x4 box starting at the origin, then set grid.prob_lo = 0. 0. 0. grid.prob_hi = 1. 2. 4. ########################################################################## IF YOU NEED TO, MODIFY THE FOLLOWING IN INPUTS. OTHERWISE, LEAVE AT THEIR DEFAULT VALUES. (13) Set the cfl number to be any number from 0 to 1 (in order to keep the calculation stable). Suggested value for a relatively stable problem is 0.9; if your problem is unstable at this value then you must reduce it accordingly. (14) If the problem starts with a small velocity but large acceleration, it is suggested that you set init_shrink to be smaller than 1, e.g. 0.1. If not, leave init_shrink = 1. (15) Decide how you want to advect your scalars, using conservative or convective differences. Set grid.is_conserv appropriately. (16) Leave slope_order = 4 and init_iter = 2 unless you have reasons to change them. (17) On a double precision workstation or a CRAY, leave the tolerances hg.tol and mac.tol at 1.e-12 unless you have reason to change them. For a single precision machine you will need to raise these values. (18) Leave the multigrid flags as is unless you like to see the convergence of the multigrid solves. ########################################################################## If you want to advect n additional quantities as tracers in addition to density, you must follow these steps: (1) Define N_STATE in Grid.cpp to be 5 + n. The current version of the code is set up to have only one scalar ("tracer") in addition to the density, hence N_STATE is set to 5. (2) Modify "Grid::deriveData(...) appropriately, mimicing the format which is there. (3) Modify "Grid::writePlotFile(...) appropriately, uncomment the line which is commented there using the name "new_scalar" - replace new_scalar by the name you used in (2) above. (4) Initialize the new variable appropriately in FORT_INITDATA in prob.F . (5) Modify mkscalforce.F appropriately if there is a forcing term for the new scalar. ccseapps-2.5/CCSEApps/varden3d/BCTypes.H0000644000175000017500000000316711634153073021016 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BC_TYPES_H_ #define _BC_TYPES_H_ #ifdef BL_LANG_FORT #define UNDEFINED -3 #define PERIODIC 1 #define WALL 2 #define INLET 3 #define OUTLET 4 #else /// type of boundary enum BndryTypes { /// undefined UNDEFINED = -3, /// periodic PERIODIC = 1, /// wall WALL, /// inlet INLET, /// outlet OUTLET }; #endif #endif ccseapps-2.5/CCSEApps/varden3d/hg.F0000644000175000017500000014012511634153073020075 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "HGPROJ_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #define CDIMS loc_1,loc_2,loc_3,hic_1,hic_2,hic_3 #define GDIMS g_lo_1,g_lo_2,g_lo_3,g_hi_1,g_hi_2,g_hi_3 #define PDIMS p_lo_1,p_lo_2,p_lo_3,p_hi_1,p_hi_2,p_hi_3 #if BL_USE_FLOAT #define sixteenth .0625e0 #else #define sixteenth .0625d0 #endif c ************************************************************************* c ** INITSIG ** c ** Define the 1/rho coefficients at the top level of the multigrid c ************************************************************************* subroutine FORT_INITSIG(sig,rho,DIMS, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T sig(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables integer i,j,k do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 sig(i,j,k) = one / rho(i,j,k) enddo enddo enddo if (bcx_lo .eq. PERIODIC) then do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 sig(lo_1-1,j,k) = sig(hi_1,j,k) sig(hi_1+1,j,k) = sig(lo_1,j,k) enddo enddo else do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 sig(lo_1-1,j,k) = zero sig(hi_1+1,j,k) = zero enddo enddo endif if (bcy_lo .eq. PERIODIC) then do k = lo_3-1,hi_3+1 do i = lo_1-1,hi_1+1 sig(i,lo_2-1,k) = sig(i,hi_2,k) sig(i,hi_2+1,k) = sig(i,lo_2,k) enddo enddo else do k = lo_3-1,hi_3+1 do i = lo_1-1,hi_1+1 sig(i,lo_2-1,k) = zero sig(i,hi_2+1,k) = zero enddo enddo endif if (bcz_lo .eq. PERIODIC) then do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 sig(i,j,lo_3-1) = sig(i,j,hi_3) sig(i,j,hi_3+1) = sig(i,j,lo_3) enddo enddo else do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 sig(i,j,lo_3-1) = zero sig(i,j,hi_3+1) = zero enddo enddo endif return end c ************************************************************************* c ** MKCOEFF ** c ** Define the coefficients along the axis as averages of sig. c ************************************************************************* subroutine FORT_MKCOEFF(coeff,sig,DIMS) implicit none integer DIMS REAL_T sig(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T coeff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) c Local variables integer i,j,k do k = lo_3 ,hi_3+1 do j = lo_2 ,hi_2+1 do i = lo_1-1,hi_1+1 coeff(i,j,k,1) = ( sig(i,j,k ) + sig(i,j-1,k ) + $ sig(i,j,k-1) + sig(i,j-1,k-1) ) * fourth enddo enddo enddo do k = lo_3 ,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1 ,hi_1+1 coeff(i,j,k,2) = ( sig(i,j,k ) + sig(i-1,j,k ) + $ sig(i,j,k-1) + sig(i-1,j,k-1) ) * fourth enddo enddo enddo do k = lo_3-1,hi_3+1 do j = lo_2 ,hi_2+1 do i = lo_1 ,hi_1+1 coeff(i,j,k,3) = ( sig(i ,j,k) + sig(i ,j-1,k) + $ sig(i-1,j,k) + sig(i-1,j-1,k) ) * fourth enddo enddo enddo return end c ************************************************************************* c ** GRADHG ** c ** Compute the cell-centered gradient of the nodal pressure field c ************************************************************************* subroutine FORT_GRADHG(gphi,GDIMS,phi,PDIMS,DIMS,hx,hy,hz, & bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS integer g_lo_1, g_lo_2, g_lo_3 integer g_hi_1, g_hi_2, g_hi_3 integer p_lo_1, p_lo_2, p_lo_3 integer p_hi_1, p_hi_2, p_hi_3 REAL_T gphi(g_lo_1:g_hi_1,g_lo_2:g_hi_2,g_lo_3:g_hi_3,3) REAL_T phi(p_lo_1:p_hi_1,p_lo_2:p_hi_2,p_lo_3:p_hi_3) REAL_T hx REAL_T hy REAL_T hz integer bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi c Local variables integer i, j, k,n do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 gphi(i,j,k,1) = fourth*(phi(i+1,j,k ) + phi(i+1,j+1,k ) + $ phi(i+1,j,k+1) + phi(i+1,j+1,k+1) - $ phi(i ,j,k ) - phi(i ,j+1,k ) - $ phi(i ,j,k+1) - phi(i ,j+1,k+1) ) /hx gphi(i,j,k,2) = fourth*(phi(i,j+1,k ) + phi(i+1,j+1,k ) + $ phi(i,j+1,k+1) + phi(i+1,j+1,k+1) - $ phi(i,j ,k ) - phi(i+1,j ,k ) - $ phi(i,j ,k+1) - phi(i+1,j ,k+1) ) /hy gphi(i,j,k,3) = fourth*(phi(i,j ,k+1) + phi(i+1,j ,k+1) + $ phi(i,j+1,k+1) + phi(i+1,j+1,k+1) - $ phi(i,j ,k ) - phi(i+1,j ,k ) - $ phi(i,j+1,k ) - phi(i+1,j+1,k ) ) /hz enddo enddo enddo if (g_lo_1 .le. lo_1-1 .and. g_hi_1 .ge. hi_1+1) then if (bcx_lo .eq. PERIODIC) then do k = lo_3,hi_3 do j = lo_2,hi_2 gphi(lo_1-1,j,k,1) = gphi(hi_1,j,k,1) gphi(lo_1-1,j,k,2) = gphi(hi_1,j,k,2) gphi(lo_1-1,j,k,3) = gphi(hi_1,j,k,3) enddo enddo endif if (bcx_hi .eq. PERIODIC) then do k = lo_3,hi_3 do j = lo_2,hi_2 gphi(hi_1+1,j,k,1) = gphi(lo_1,j,k,1) gphi(hi_1+1,j,k,2) = gphi(lo_1,j,k,2) gphi(hi_1+1,j,k,3) = gphi(lo_1,j,k,3) enddo enddo endif endif if (g_lo_2 .le. lo_2-1 .and. g_hi_2 .ge. hi_2+1) then if (bcy_lo .eq. PERIODIC) then do k = lo_3,hi_3 do i = lo_1,hi_1 gphi(i,lo_2-1,k,1) = gphi(i,hi_2,k,1) gphi(i,lo_2-1,k,2) = gphi(i,hi_2,k,2) gphi(i,lo_2-1,k,3) = gphi(i,hi_2,k,3) enddo enddo endif if (bcy_hi .eq. PERIODIC) then do k = lo_3,hi_3 do i = lo_1,hi_1 gphi(i,hi_2+1,k,1) = gphi(i,lo_2,k,1) gphi(i,hi_2+1,k,2) = gphi(i,lo_2,k,2) gphi(i,hi_2+1,k,3) = gphi(i,lo_2,k,3) enddo enddo endif endif if (g_lo_3 .le. lo_3-1 .and. g_hi_3 .ge. hi_3+1) then if (bcz_lo .eq. PERIODIC) then do j = lo_2,hi_2 do i = lo_1,hi_1 gphi(i,j,lo_3-1,1) = gphi(i,j,hi_3,1) gphi(i,j,lo_3-1,2) = gphi(i,j,hi_3,2) gphi(i,j,lo_3-1,3) = gphi(i,j,hi_3,3) enddo enddo endif if (bcz_hi .eq. PERIODIC) then do j = lo_2,hi_2 do i = lo_1,hi_1 gphi(i,j,hi_3+1,1) = gphi(i,j,lo_3,1) gphi(i,j,hi_3+1,2) = gphi(i,j,lo_3,2) gphi(i,j,hi_3+1,3) = gphi(i,j,lo_3,3) enddo enddo endif endif if (g_lo_1 .le. lo_1-1 .and. g_hi_1 .ge. hi_1+1 .and. & g_lo_2 .le. lo_2-1 .and. g_hi_2 .ge. hi_2+1) then if (bcx_lo .eq. PERIODIC .and. bcy_lo .eq. PERIODIC) then do n=1,3 do k = lo_3,hi_3 gphi(lo_1-1,lo_2-1,k,n) = gphi(hi_1,hi_2,k,n) gphi(hi_1+1,lo_2-1,k,n) = gphi(lo_1,hi_2,k,n) gphi(lo_1-1,hi_2+1,k,n) = gphi(hi_1,lo_2,k,n) gphi(hi_1+1,hi_2+1,k,n) = gphi(lo_1,lo_2,k,n) enddo enddo endif endif if (g_lo_1 .le. lo_1-1 .and. g_hi_1 .ge. hi_1+1 .and. & g_lo_3 .le. lo_3-1 .and. g_hi_3 .ge. hi_3+1) then if (bcx_lo .eq. PERIODIC .and. bcz_lo .eq. PERIODIC) then do n= 1,3 do j = lo_2,hi_2 gphi(lo_1-1,j,lo_3-1,n) = gphi(hi_1,j,hi_3,n) gphi(hi_1+1,j,lo_3-1,n) = gphi(lo_1,j,hi_3,n) gphi(lo_1-1,j,hi_3+1,n) = gphi(hi_1,j,lo_3,n) gphi(hi_1+1,j,hi_3+1,n) = gphi(lo_1,j,lo_3,n) enddo enddo endif endif if (g_lo_2 .le. lo_2-1 .and. g_hi_2 .ge. hi_2+1 .and. & g_lo_3 .le. lo_3-1 .and. g_hi_3 .ge. hi_3+1) then if (bcy_lo .eq. PERIODIC .and. bcz_lo .eq. PERIODIC) then do n= 1,3 do i = lo_1,hi_1 gphi(i,lo_2-1,lo_3-1,n) = gphi(i,hi_2,hi_3,n) gphi(i,hi_2+1,lo_3-1,n) = gphi(i,lo_2,hi_3,n) gphi(i,lo_2-1,hi_3+1,n) = gphi(i,hi_2,lo_3,n) gphi(i,hi_2+1,hi_3+1,n) = gphi(i,lo_2,lo_3,n) enddo enddo endif endif if (g_lo_1 .le. lo_1-1 .and. g_hi_1 .ge. hi_1+1 .and. & g_lo_2 .le. lo_2-1 .and. g_hi_2 .ge. hi_2+1 .and. & g_lo_3 .le. lo_3-1 .and. g_hi_3 .ge. hi_3+1) then if (bcx_lo .eq. PERIODIC .and. bcy_lo .eq. PERIODIC & .and. bcz_lo .eq. PERIODIC) then do n=1,3 gphi(lo_2-1,lo_2-1,lo_3-1,n) = gphi(hi_1,hi_2,hi_3,n) gphi(lo_2-1,hi_2+1,lo_3-1,n) = gphi(hi_1,lo_2,hi_3,n) gphi(lo_2-1,lo_2-1,hi_3+1,n) = gphi(hi_1,hi_2,lo_3,n) gphi(lo_2-1,hi_2+1,hi_3+1,n) = gphi(hi_1,lo_2,lo_3,n) gphi(hi_2+1,lo_2-1,lo_3-1,n) = gphi(lo_1,hi_2,hi_3,n) gphi(hi_2+1,hi_2+1,lo_3-1,n) = gphi(lo_1,lo_2,hi_3,n) gphi(hi_2+1,lo_2-1,hi_3+1,n) = gphi(lo_1,hi_2,lo_3,n) gphi(hi_2+1,hi_2+1,hi_3+1,n) = gphi(lo_1,lo_2,lo_3,n) enddo endif endif return end c ************************************************************************* c ** RHSHG ** c ** Compute the right-hand-side D(V) for the projection c ************************************************************************* subroutine FORT_RHSHG(du,u,divu_src,DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi, $ norm,time,dt,un,ustar) implicit none integer DIMS REAL_T du(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T divu_src(lo_1 :hi_1+1,lo_2 :hi_2+1,lo_3 :hi_3+1) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T hx REAL_T hy REAL_T hz REAL_T time REAL_T dt REAL_T un(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T ustar(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables REAL_T fac,facx,facy,facz,norm REAL_T factor, sum_src, sum_fac integer i, j, k, n integer is,ie,js,je,ks,ke integer istrt,iend integer jstrt,jend integer kstrt,kend logical is_singular is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 istrt = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) is_singular = .true. if (BCX_LO .eq. OUTLET .or. BCX_HI .eq. OUTLET .or. $ BCY_LO .eq. OUTLET .or. BCY_HI .eq. OUTLET .or. $ BCZ_LO .eq. OUTLET .or. BCZ_HI .eq. OUTLET) is_singular = .false. c note: originally, we set inflow bc here, but this was found to be c redundant, so it was deleted if (bcx_lo .eq. PERIODIC) then do n = 1,3 do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k,n) = u(ie,j,k,n) enddo enddo enddo else if (bcx_lo .eq. WALL) then do n = 1,3 do k = ks-1,ke+1 do j = js-1,je+1 u(is-1,j,k,n) = zero enddo enddo enddo endif if (bcx_hi .eq. PERIODIC) then do n = 1,3 do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k,n) = u(is,j,k,n) enddo enddo enddo else if (bcx_hi .eq. WALL) then do n = 1,3 do k = ks-1,ke+1 do j = js-1,je+1 u(ie+1,j,k,n) = zero enddo enddo enddo endif if (bcy_lo .eq. PERIODIC) then do n = 1,3 do k = ks-1,ke+1 do i = is-1,ie+1 u(i,js-1,k,n) = u(i,je,k,n) enddo enddo enddo else if (bcy_lo .eq. WALL) then do n = 1,3 do k = ks-1,ke+1 do i = is-1,ie+1 u(i,js-1,k,n) = zero enddo enddo enddo endif if (bcy_hi .eq. PERIODIC) then do n = 1,3 do k = ks-1,ke+1 do i = is-1,ie+1 u(i,je+1,k,n) = u(i,js,k,n) enddo enddo enddo else if (bcy_hi .eq. WALL) then do n = 1,3 do k = ks-1,ke+1 do i = is-1,ie+1 u(i,je+1,k,n) = zero enddo enddo enddo endif if (bcz_lo .eq. PERIODIC) then do n = 1,3 do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ks-1,n) = u(i,j,ke,n) enddo enddo enddo else if (bcz_lo .eq. WALL) then do n = 1,3 do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ks-1,n) = zero enddo enddo enddo endif if (bcz_hi .eq. PERIODIC) then do n = 1,3 do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ke+1,n) = u(i,j,ks,n) enddo enddo enddo else if (bcz_hi .eq. WALL) then do n = 1,3 do j = js-1,je+1 do i = is-1,ie+1 u(i,j,ke+1,n) = zero enddo enddo enddo endif facx = fourth / hx facy = fourth / hx facz = fourth / hx do k = kstrt,kend do j = jstrt,jend do i = istrt,iend du(i,j,k) = ((u(i ,j-1,k ,1) + u(i ,j,k ,1) + $ u(i ,j-1,k-1,1) + u(i ,j,k-1,1)) - $ (u(i-1,j-1,k ,1) + u(i-1,j,k ,1) + $ u(i-1,j-1,k-1,1) + u(i-1,j,k-1,1)) ) * facx $ + ((u(i-1,j ,k ,2) + u(i,j ,k ,2) + $ u(i-1,j ,k-1,2) + u(i,j ,k-1,2)) - $ (u(i-1,j-1,k ,2) + u(i,j-1,k ,2) + $ u(i-1,j-1,k-1,2) + u(i,j-1,k-1,2)) ) * facy $ + ((u(i-1,j ,k ,3) + u(i,j ,k ,3) + $ u(i-1,j-1,k ,3) + u(i,j-1,k ,3)) - $ (u(i-1,j ,k-1,3) + u(i,j ,k-1,3) + $ u(i-1,j-1,k-1,3) + u(i,j-1,k-1,3)) ) * facz du(i,j,k) = du(i,j,k) - divu_src(i,j,k) enddo enddo enddo norm = zero do k = kstrt,kend do j = jstrt,jend do i = istrt,iend fac = one fac = cvmgt(two*fac,fac,(i .eq. is ) .and. bcx_lo .eq. WALL) fac = cvmgt(two*fac,fac,(i .eq. ie+1) .and. bcx_hi .eq. WALL) fac = cvmgt(two*fac,fac,(j .eq. js ) .and. bcy_lo .eq. WALL) fac = cvmgt(two*fac,fac,(j .eq. je+1) .and. bcy_hi .eq. WALL) fac = cvmgt(two*fac,fac,(k .eq. ks ) .and. bcz_lo .eq. WALL) fac = cvmgt(two*fac,fac,(k .eq. ke+1) .and. bcz_hi .eq. WALL) du(i,j,k) = du(i,j,k) * fac enddo enddo enddo if (is_singular) then sum_src = zero sum_fac = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend factor = one factor = cvmgt(half*factor,factor,i.eq.lo_1 .or. i.eq.hi_1+1) factor = cvmgt(half*factor,factor,j.eq.lo_2 .or. j.eq.hi_2+1) factor = cvmgt(half*factor,factor,k.eq.lo_3 .or. k.eq.hi_3+1) sum_src = sum_src + factor * du(i,j,k) sum_fac = sum_fac + factor enddo enddo enddo sum_src = sum_src / sum_fac c write(6,999) sum_src do k = kstrt, kend do j = jstrt, jend do i = istrt, iend du(i,j,k) = du(i,j,k) - sum_src norm = max(norm, abs(du(i,j,k))) enddo enddo enddo endif 999 format('Singular adjustment is ',e12.5) return end c ************************************************************************* c ** PROJUHG ** c ** Define the updated pressure and vector field c ************************************************************************* subroutine FORT_PROJUHG(u,pressure,phi,gradphi,rhonph,DIMS) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T pressure(lo_1 :hi_1+1,lo_2 :hi_2+1,lo_3 :hi_3+1) REAL_T phi(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T gradphi(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T rhonph(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) c Local variables integer i, j, k do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 u(i,j,k,1) = u(i,j,k,1) - gradphi(i,j,k,1)/rhonph(i,j,k) u(i,j,k,2) = u(i,j,k,2) - gradphi(i,j,k,2)/rhonph(i,j,k) u(i,j,k,3) = u(i,j,k,3) - gradphi(i,j,k,3)/rhonph(i,j,k) enddo enddo enddo do k = lo_3,hi_3+1 do j = lo_2,hi_2+1 do i = lo_1,hi_1+1 c pressure(i,j,k) = pressure(i,j,k) + phi(i,j,k) pressure(i,j,k) = phi(i,j,k) enddo enddo enddo return end c ************************************************************************* c ** RESIDUAL ** c ** Compute the residual R = f - D(sig G(phi)) c ************************************************************************* subroutine FORT_RESIDUAL(residual,phi,source,coeff,dgphi, $ DIMS,hx,hy,hz,resnorm, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T residual(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T phi(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T source(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T coeff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T dgphi(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T hx REAL_T hy REAL_T hz REAL_T resnorm integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables integer i,j,k integer istrt,jstrt,kstrt integer iend,jend,kend resnorm = zero istrt = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) call makedgphi(phi,dgphi,coeff,DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) do k = kstrt,kend do j = jstrt,jend do i = istrt,iend residual(i,j,k) = source(i,j,k) - dgphi(i,j,k) enddo enddo enddo do k = kstrt,kend do j = jstrt,jend do i = istrt,iend resnorm = max(resnorm,abs(residual(i,j,k))) enddo enddo enddo return end c ************************************************************************* c ** RELAX ** c ** Gauss-Seidel relaxation c ************************************************************************* subroutine FORT_RELAX(phi,source,coeff,dgphi,DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi,nnrelax) implicit none integer DIMS REAL_T phi(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T source(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T coeff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T dgphi(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T hx REAL_T hy REAL_T hz integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi integer nnrelax c Local variables REAL_T facx, facy, facz REAL_T rfac integer i,j,k integer iter, ioff, iinc integer is,ie,js,je,ks,ke integer istrt, jstrt, kstrt integer iend, jend, kend is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 facx = one/(hx*hx) facy = one/(hy*hy) facz = one/(hz*hz) istrt = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) do iter = 1, nnrelax c do ioff = 0,1 if (bcx_lo .eq. PERIODIC) then do k = ks-1,ke+2 do j = js-1,je+2 phi(ie+1,j,k) = phi(is ,j,k) phi(ie+2,j,k) = phi(is+1,j,k) phi(is-1,j,k) = phi(ie ,j,k) enddo enddo endif if (bcy_lo .eq. PERIODIC) then do k = ks-1,ke+2 do i = is-1,ie+2 phi(i,je+1,k) = phi(i,js ,k) phi(i,je+2,k) = phi(i,js+1,k) phi(i,js-1,k) = phi(i,je ,k) enddo enddo endif if (bcz_lo .eq. PERIODIC) then do j = js-1,je+2 do i = is-1,ie+2 phi(i,j,ke+1) = phi(i,j,ks ) phi(i,j,ke+2) = phi(i,j,ks+1) phi(i,j,ks-1) = phi(i,j,ke ) enddo enddo endif c call makedgphi(phi,dgphi,coeff,DIMS,hx,hy,hz, c $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) do k = kstrt,kend do j = jstrt,jend c iinc = mod(j+k+ioff,2) c do i = istrt+iinc,iend,2 do i = istrt,iend dgphi(i,j,k) = $ (coeff(i ,j,k,1) * (phi(i+1,j,k) - phi(i,j,k)) + $ coeff(i-1,j,k,1) * (phi(i-1,j,k) - phi(i,j,k)) ) * facx + $ (coeff(i,j ,k,2) * (phi(i,j+1,k) - phi(i,j,k)) + $ coeff(i,j-1,k,2) * (phi(i,j-1,k) - phi(i,j,k)) ) * facy + $ (coeff(i,j,k ,3) * (phi(i,j,k+1) - phi(i,j,k)) + $ coeff(i,j,k-1,3) * (phi(i,j,k-1) - phi(i,j,k)) ) * facz rfac = (coeff(i,j,k,1) + coeff(i-1,j,k,1)) * facx + $ (coeff(i,j,k,2) + coeff(i,j-1,k,2)) * facy + $ (coeff(i,j,k,3) + coeff(i,j,k-1,3)) * facz if ( (i .eq. is .or. i .eq. ie+1) .and. bcx_lo .ne. PERIODIC) then dgphi(i,j,k) = two*dgphi(i,j,k) rfac = two * rfac endif if ( (j .eq. js .or. j .eq. je+1) .and. bcy_lo .ne. PERIODIC) then dgphi(i,j,k) = two*dgphi(i,j,k) rfac = two * rfac endif if ( (k .eq. ks .or. k .eq. ke+1) .and. bcz_lo .ne. PERIODIC) then dgphi(i,j,k) = two*dgphi(i,j,k) rfac = two * rfac endif rfac = one/rfac phi(i,j,k) = phi(i,j,k) + rfac*(dgphi(i,j,k) - source(i,j,k)) enddo enddo if (k .eq. ks+1 .and. bcz_lo .eq. PERIODIC) then do j = js-1,je+2 do i = is-1,ie+2 phi(i,j,ke+1) = phi(i,j,ks ) phi(i,j,ke+2) = phi(i,j,ks+1) enddo enddo endif enddo c enddo if (bcx_lo .eq. PERIODIC) then do k = ks-1,ke+2 do j = js-1,je+2 phi(ie+1,j,k) = phi(is ,j,k) phi(ie+2,j,k) = phi(is+1,j,k) phi(is-1,j,k) = phi(ie ,j,k) enddo enddo endif if (bcy_lo .eq. PERIODIC) then do k = ks-1,ke+2 do i = is-1,ie+2 phi(i,je+1,k) = phi(i,js ,k) phi(i,je+2,k) = phi(i,js+1,k) phi(i,js-1,k) = phi(i,je ,k) enddo enddo endif if (bcz_lo .eq. PERIODIC) then do j = js-1,je+2 do i = is-1,ie+2 phi(i,j,ke+1) = phi(i,j,ks ) phi(i,j,ke+2) = phi(i,j,ks+1) phi(i,j,ks-1) = phi(i,j,ke ) enddo enddo endif enddo return end c ************************************************************************* c ** COARSIG ** c ** Coarsening of the sig coefficients c ************************************************************************* subroutine FORT_COARSIG(sig,sigc,DIMS,CDIMS, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS integer CDIMS REAL_T sig(lo_1 -1:hi_1 +1,lo_2 -1:hi_2 +1,lo_3 -1:hi_3 +1) REAL_T sigc(loc_1-1:hic_1+1,loc_2-1:hic_2+1,loc_3-1:hic_3+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables integer i ,j, k integer i2,j2,k2 do k = loc_3,hic_3 do j = loc_2,hic_2 do i = loc_1,hic_1 i2 = 2*(i-loc_1)+lo_1 j2 = 2*(j-loc_2)+lo_2 k2 = 2*(k-loc_3)+lo_3 sigc(i,j,k) = ( sig(i2 ,j2,k2 ) + sig(i2 ,j2+1,k2 )+ $ sig(i2+1,j2,k2 ) + sig(i2+1,j2+1,k2 )+ $ sig(i2 ,j2,k2+1) + sig(i2 ,j2+1,k2+1)+ $ sig(i2+1,j2,k2+1) + sig(i2+1,j2+1,k2+1) ) * eighth enddo enddo enddo if (bcx_lo .eq. PERIODIC) then do k = loc_3-1,hic_3+1 do j = loc_2-1,hic_2+1 sigc(loc_1-1,j,k) = sigc(hic_1,j,k) sigc(hic_1+1,j,k) = sigc(loc_1,j,k) enddo enddo endif if (bcy_lo .eq. PERIODIC) then do k = loc_3-1,hic_3+1 do i = loc_1-1,hic_1+1 sigc(i,loc_2-1,k) = sigc(i,hic_2,k) sigc(i,hic_2+1,k) = sigc(i,loc_2,k) enddo enddo endif if (bcz_lo .eq. PERIODIC) then do j = loc_2-1,hic_2+1 do i = loc_1-1,hic_1+1 sigc(i,j,loc_3-1) = sigc(i,j,hic_3) sigc(i,j,hic_3+1) = sigc(i,j,loc_3) enddo enddo endif return end c ************************************************************************* c ** RESTRICT ** c ** Conservative restriction of the residual c ************************************************************************* subroutine FORT_RESTRICT(res,resc,DIMS,CDIMS, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS integer CDIMS REAL_T res(lo_1 -1:hi_1 +2,lo_2 -1:hi_2 +2,lo_3 -1:hi_3 +2) REAL_T resc(loc_1-1:hic_1+2,loc_2-1:hic_2+2,loc_3-1:hic_3+2) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables integer i,j,k,ii,jj,kk integer istrt,jstrt,kstrt integer iend,jend,kend REAL_T cen, faces, sides, corners istrt = cvmgt(loc_1+1,loc_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hic_1 ,hic_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(loc_2+1,loc_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hic_2 ,hic_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(loc_3+1,loc_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hic_3 ,hic_3+1,BCZ_HI .eq. OUTLET) if (bcx_lo .eq. PERIODIC) then do k = lo_3-1,hi_3+2 do j = lo_2-1,hi_2+2 res(hi_1+1,j,k) = res(lo_1 ,j,k) res(hi_1+2,j,k) = res(lo_1+1,j,k) res(lo_1-1,j,k) = res(hi_1 ,j,k) enddo enddo else do k = lo_3-1,hi_3+2 do j = lo_2-1,hi_2+2 res(hi_1+2,j,k) = res(hi_1 ,j,k) res(lo_1-1,j,k) = res(lo_1+1,j,k) enddo enddo endif if (bcy_lo .eq. PERIODIC) then do k = lo_3-1,hi_3+2 do i = lo_1-1,hi_1+2 res(i,hi_2+1,k) = res(i,lo_2 ,k) res(i,hi_2+2,k) = res(i,lo_2+1,k) res(i,lo_2-1,k) = res(i,hi_2 ,k) enddo enddo else do k = lo_3-1,hi_3+2 do i = lo_1-1,hi_1+2 res(i,hi_2+2,k) = res(i,hi_2 ,k) res(i,lo_2-1,k) = res(i,lo_2+1,k) enddo enddo endif if (bcz_lo .eq. PERIODIC) then do j = lo_2-1,hi_2+2 do i = lo_1-1,hi_1+2 res(i,j,hi_3+1) = res(i,j,lo_3 ) res(i,j,hi_3+2) = res(i,j,lo_3+1) res(i,j,lo_3-1) = res(i,j,hi_3 ) enddo enddo else do j = lo_2-1,hi_2+2 do i = lo_1-1,hi_1+2 res(i,j,hi_3+2) = res(i,j,hi_3 ) res(i,j,lo_3-1) = res(i,j,lo_3+1) enddo enddo endif do k = kstrt,kend do j = jstrt,jend do i = istrt,iend ii = 2*(i-loc_1)+lo_1 jj = 2*(j-loc_2)+lo_2 kk = 2*(k-loc_3)+lo_3 cen = res(ii,jj,kk) faces = res(ii+1,jj,kk) + res(ii-1,jj,kk) + $ res(ii,jj+1,kk) + res(ii,jj-1,kk) + $ res(ii,jj,kk+1) + res(ii,jj,kk-1) sides = res(ii+1,jj+1,kk) + res(ii-1,jj+1,kk) + $ res(ii+1,jj-1,kk) + res(ii-1,jj-1,kk) + $ res(ii+1,jj,kk+1) + res(ii-1,jj,kk+1) + $ res(ii+1,jj,kk-1) + res(ii-1,jj,kk-1) + $ res(ii,jj+1,kk+1) + res(ii,jj-1,kk+1) + $ res(ii,jj+1,kk-1) + res(ii,jj-1,kk-1) corners = res(ii+1,jj+1,kk+1) + res(ii-1,jj+1,kk+1) + $ res(ii+1,jj-1,kk+1) + res(ii-1,jj-1,kk+1) + $ res(ii+1,jj+1,kk-1) + res(ii-1,jj+1,kk-1) + $ res(ii+1,jj-1,kk-1) + res(ii-1,jj-1,kk-1) resc(i,j,k) = eighth * (cen + half * faces + $ fourth * sides + $ eighth * corners) enddo enddo enddo return end c ************************************************************************* c ** INTERP ** c ** Simple bilinear interpolation c ************************************************************************* subroutine FORT_INTERP(phi,deltac,DIMS,CDIMS) implicit none integer DIMS integer CDIMS REAL_T phi(lo_1 -1:hi_1 +2,lo_2 -1:hi_2 +2,lo_3 -1:hi_3 +2) REAL_T deltac(loc_1-1:hic_1+2,loc_2-1:hic_2+2,loc_3-1:hic_3+2) c Local variables integer i,j,k,ii,jj,kk integer is,ie,js,je,ks,ke,isc,iec,jsc,jec,ksc,kec is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 isc = loc_1 jsc = loc_2 ksc = loc_3 iec = hic_1 jec = hic_2 kec = hic_3 do k = ksc, kec+1 do j = jsc, jec+1 do i = isc, iec+1 ii = 2*(i-isc)+is jj = 2*(j-jsc)+js kk = 2*(k-ksc)+ks phi(ii,jj,kk) = deltac(i,j,k) enddo enddo enddo do k = ksc, kec+1 do j = jsc, jec do i = isc, iec+1 ii = 2*(i-isc)+is jj = 2*(j-jsc)+js kk = 2*(k-ksc)+ks phi(ii,jj+1,kk) = half*(deltac(i,j,k) + deltac(i,j+1,k)) enddo enddo enddo do j = jsc, jec+1 do k = ksc, kec+1 do i = isc, iec ii = 2*(i-isc)+is jj = 2*(j-jsc)+js kk = 2*(k-ksc)+ks phi(ii+1,jj,kk) = half*(deltac(i,j,k) + deltac(i+1,j,k)) enddo enddo enddo do j = jsc, jec+1 do i = isc, iec+1 do k = ksc, kec ii = 2*(i-isc)+is jj = 2*(j-jsc)+js kk = 2*(k-ksc)+ks phi(ii,jj,kk+1) = half*(deltac(i,j,k) + deltac(i,j,k+1)) enddo enddo enddo do k = ksc, kec+1 do j = jsc, jec do i = isc, iec ii = 2*(i-isc)+is jj = 2*(j-jsc)+js kk = 2*(k-ksc)+ks phi(ii+1,jj+1,kk) = fourth*(deltac(i,j ,k) + deltac(i+1,j ,k) + $ deltac(i,j+1,k) + deltac(i+1,j+1,k) ) enddo enddo enddo do j = jsc, jec+1 do k = ksc, kec do i = isc, iec ii = 2*(i-isc)+is jj = 2*(j-jsc)+js kk = 2*(k-ksc)+ks phi(ii+1,jj,kk+1) = fourth*(deltac(i,j,k ) + deltac(i+1,j,k ) + $ deltac(i,j,k+1) + deltac(i+1,j,k+1) ) enddo enddo enddo do j = jsc, jec do k = ksc, kec do i = isc, iec+1 ii = 2*(i-isc)+is jj = 2*(j-jsc)+js kk = 2*(k-ksc)+ks phi(ii,jj+1,kk+1) = fourth*(deltac(i,j,k ) + deltac(i,j+1,k ) + $ deltac(i,j,k+1) + deltac(i,j+1,k+1) ) enddo enddo enddo do j = jsc, jec do k = ksc, kec do i = isc, iec ii = 2*(i-isc)+is jj = 2*(j-jsc)+js kk = 2*(k-ksc)+ks phi(ii+1,jj+1,kk+1) = eighth*(deltac(i,j ,k ) + deltac(i+1,j ,k ) + $ deltac(i,j ,k+1) + deltac(i+1,j ,k+1) + $ deltac(i,j+1,k ) + deltac(i+1,j+1,k ) + $ deltac(i,j+1,k+1) + deltac(i+1,j+1,k+1) ) enddo enddo enddo return end c ************************************************************************* c ** MAKEDGPHI ** c ** Compute D(sig G(phi)) c ************************************************************************* subroutine makedgphi(phi,dgphi,coeff,DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T phi(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T dgphi(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T coeff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T hx REAL_T hy REAL_T hz integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables REAL_T facx, facy, facz integer is,ie,js,je,ks,ke integer i,j,k is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 if (bcx_lo .eq. PERIODIC) then do k = ks,ke+1 do j = js,je+1 phi(ie+2,j,k) = phi(is+1,j,k) phi(is-1,j,k) = phi(ie ,j,k) enddo enddo endif if (bcy_lo .eq. PERIODIC) then do k = ks,ke+1 do i = is,ie+1 phi(i,je+2,k) = phi(i,js+1,k) phi(i,js-1,k) = phi(i,je ,k) enddo enddo endif if (bcz_lo .eq. PERIODIC) then do j = js,je+1 do i = is,ie+1 phi(i,j,ke+2) = phi(i,j,ks+1) phi(i,j,ks-1) = phi(i,j,ke ) enddo enddo endif if (bcx_lo .eq. PERIODIC .and. bcy_lo .eq. PERIODIC) then do k = ks,ke+1 phi(is-1,js-1,k) = phi(ie,je,k) phi(is-1,je+2,k) = phi(ie,js+1,k) phi(ie+2,js-1,k) = phi(is+1,je,k) phi(ie+2,je+2,k) = phi(is+1,js+1,k) enddo endif if (bcx_lo .eq. PERIODIC .and. bcz_lo .eq. PERIODIC) then do j = js,je+1 phi(is-1,j,ks-1) = phi(ie,j,ke) phi(is-1,j,ke+2) = phi(ie,j,ks+1) phi(ie+2,j,ks-1) = phi(is+1,j,ke) phi(ie+2,j,ke+2) = phi(is+1,j,ks+1) enddo endif if (bcy_lo .eq. PERIODIC .and. bcz_lo .eq. PERIODIC) then do i = is,ie+1 phi(i,js-1,ks-1) = phi(i,je,ke) phi(i,js-1,ke+2) = phi(i,je,ks+1) phi(i,je+2,ks-1) = phi(i,js+1,ke) phi(i,je+2,ke+2) = phi(i,js+1,ks+1) enddo endif if (bcx_lo .eq. PERIODIC .and. bcy_lo .eq. PERIODIC & .and. bcz_lo .eq. PERIODIC) then phi(is-1,js-1,ks-1) = phi(ie ,je ,ke) phi(ie+2,js-1,ks-1) = phi(is+1,je ,ke) phi(is-1,je+2,ks-1) = phi(ie ,js+1,ke) phi(ie+2,je+2,ks-1) = phi(is+1,js+1,ke) phi(is-1,js-1,ke+2) = phi(ie ,je ,ks+1) phi(ie+2,js-1,ke+2) = phi(is+1,je ,ks+1) phi(is-1,je+2,ke+2) = phi(ie ,js+1,ks+1) phi(ie+2,je+2,ke+2) = phi(is+1,js+1,ks+1) endif facx = one / (hx*hx) facy = one / (hy*hy) facz = one / (hz*hz) do k = ks,ke+1 do j = js,je+1 do i = is,ie+1 dgphi(i,j,k) = $ (coeff(i ,j,k,1) * (phi(i+1,j,k) - phi(i,j,k)) + $ coeff(i-1,j,k,1) * (phi(i-1,j,k) - phi(i,j,k)) ) * facx + $ (coeff(i,j ,k,2) * (phi(i,j+1,k) - phi(i,j,k)) + $ coeff(i,j-1,k,2) * (phi(i,j-1,k) - phi(i,j,k)) ) * facy + $ (coeff(i,j,k ,3) * (phi(i,j,k+1) - phi(i,j,k)) + $ coeff(i,j,k-1,3) * (phi(i,j,k-1) - phi(i,j,k)) ) * facz enddo enddo enddo if (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) then do k = ks,ke+1 do j = js,je+1 dgphi(is ,j,k) = two * dgphi(is ,j,k) enddo enddo else if (bcx_lo .eq. OUTLET) then do k = ks,ke+1 do j = js,je+1 dgphi(is ,j,k) = zero enddo enddo endif if (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) then do k = ks,ke+1 do j = js,je+1 dgphi(ie+1,j,k) = two * dgphi(ie+1,j,k) enddo enddo else if (bcx_hi .eq. OUTLET) then do k = ks,ke+1 do j = js,je+1 dgphi(ie+1,j,k) = zero enddo enddo endif if (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) then do k = ks,ke+1 do i = is,ie+1 dgphi(i,js ,k) = two * dgphi(i,js ,k) enddo enddo else if (bcy_lo .eq. OUTLET) then do k = ks,ke+1 do i = is,ie+1 dgphi(i,js ,k) = zero enddo enddo endif if (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) then do k = ks,ke+1 do i = is,ie+1 dgphi(i,je+1,k) = two * dgphi(i,je+1,k) enddo enddo else if (bcy_hi .eq. OUTLET) then do k = ks,ke+1 do i = is,ie+1 dgphi(i,je+1,k) = zero enddo enddo endif if (bcz_lo .eq. WALL .or. bcz_lo .eq. INLET) then do j = js,je+1 do i = is,ie+1 dgphi(i,j,ks ) = two * dgphi(i,j,ks ) enddo enddo else if (bcz_lo .eq. OUTLET) then do j = js,je+1 do i = is,ie+1 dgphi(i,j,ks ) = zero enddo enddo endif if (bcz_hi .eq. WALL .or. bcz_hi .eq. INLET) then do j = js,je+1 do i = is,ie+1 dgphi(i,j,ke+1) = two * dgphi(i,j,ke+1) enddo enddo else if (bcz_hi .eq. OUTLET) then do j = js,je+1 do i = is,ie+1 dgphi(i,j,ke+1) = zero enddo enddo endif return end c ************************************************************************* c ** SOLVEHG ** c ************************************************************************* subroutine FORT_SOLVEHG(dest,dest0,source,coeff,sum,r,w,z,work, $ DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi, $ maxiter,norm,prob_norm) implicit none integer DIMS REAL_T dest(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T dest0(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T source(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T coeff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T sum(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T r(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T w(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T z(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T work(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T hx REAL_T hy REAL_T hz integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi integer maxiter REAL_T norm REAL_T prob_norm REAL_T sum0 c Local variables REAL_T factor REAL_T alpha REAL_T beta REAL_T rho REAL_T rhol REAL_T tol, tolfac REAL_T local_norm integer i,j,k integer iter integer istrt,iend integer jstrt,jend integer kstrt,kend tolfac = 1.0d-3 istrt = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) do k = lo_3-1,hi_3+2 do j = lo_2-1,hi_2+2 do i = lo_1-1,hi_1+2 dest0(i,j,k) = dest(i,j,k) dest(i,j,k) = zero enddo enddo enddo 10 call makedgphi(dest0,w,coeff,DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) rho = zero norm = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend r(i,j,k) = source(i,j,k) - w(i,j,k) enddo enddo enddo local_norm = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend factor = one factor = cvmgt(factor*half,factor,i.eq.lo_1 .or. i.eq.hi_1+1) factor = cvmgt(factor*half,factor,j.eq.lo_2 .or. j.eq.hi_2+1) factor = cvmgt(factor*half,factor,k.eq.lo_3 .or. k.eq.hi_3+1) local_norm = max(local_norm, abs(r(i,j,k))) z(i,j,k) = r(i,j,k) / sum(i,j,k) rho = rho + z(i,j,k) * r(i,j,k) * factor norm = max(norm,abs(r(i,j,k))) enddo enddo enddo tol = Max(tolfac*local_norm,1.0d-15*prob_norm) if (norm .le. tol) return do k = kstrt, kend do j = jstrt, jend do i = istrt, iend work(i,j,k) = zero dest(i,j,k) = z(i,j,k) enddo enddo enddo iter = 1 c write(6,1000) iter, norm/prob_norm 100 continue call makedgphi(dest,w,coeff,DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) alpha = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend factor = one factor = cvmgt(factor*half,factor,i.eq.lo_1 .or. i.eq.hi_1+1) factor = cvmgt(factor*half,factor,j.eq.lo_2 .or. j.eq.hi_2+1) factor = cvmgt(factor*half,factor,k.eq.lo_3 .or. k.eq.hi_3+1) alpha = alpha + dest(i,j,k)*w(i,j,k) * factor enddo enddo enddo alpha = rho / alpha rhol = rho rho = zero norm = zero do k = kstrt, kend do j = jstrt, jend do i = istrt, iend factor = one factor = cvmgt(factor*half,factor,i.eq.lo_1 .or. i.eq.hi_1+1) factor = cvmgt(factor*half,factor,j.eq.lo_2 .or. j.eq.hi_2+1) factor = cvmgt(factor*half,factor,k.eq.lo_3 .or. k.eq.hi_3+1) work(i,j,k) = work(i,j,k) + alpha * dest(i,j,k) r(i,j,k) = r(i,j,k) - alpha * w(i,j,k) z(i,j,k) = r(i,j,k) / sum(i,j,k) rho = rho + z(i,j,k) * r(i,j,k) * factor norm = max(norm,abs(r(i,j,k))) enddo enddo enddo iter = iter+1 c write(6,1000) iter, norm/prob_norm if (norm .le. tol) then do k = kstrt, kend do j = jstrt, jend do i = istrt, iend dest(i,j,k) = work(i,j,k) + dest0(i,j,k) enddo enddo enddo else if (iter .ge. maxiter .or. norm .ge. 100.d0*local_norm) then tolfac = 10.d0 * tolfac iter = 1 do k = kstrt, kend do j = jstrt, jend do i = istrt, iend dest(i,j,k) = zero enddo enddo enddo goto 10 else beta = rho / rhol do k = kstrt, kend do j = jstrt, jend do i = istrt, iend dest(i,j,k) = z(i,j,k) + beta * dest(i,j,k) enddo enddo enddo goto 100 endif 1000 format('Res/Res0 in solve: ',i4,2x,e12.5) return end c ************************************************************************* c ** MAKESUM ** c ************************************************************************* subroutine FORT_MAKESUM(sum,coeff,DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T sum(lo_1-1:hi_1+2,lo_2-1:hi_2+2,lo_3-1:hi_3+2) REAL_T coeff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T hx REAL_T hy REAL_T hz integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables integer i, j, k integer is, ie, js, je, ks, ke integer istrt,iend integer jstrt,jend integer kstrt,kend REAL_T facx, facy, facz facx = one/(hx*hx) facy = one/(hy*hy) facz = one/(hz*hz) is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 istrt = cvmgt(lo_1+1,lo_1 ,BCX_LO .eq. OUTLET) iend = cvmgt(hi_1 ,hi_1+1,BCX_HI .eq. OUTLET) jstrt = cvmgt(lo_2+1,lo_2 ,BCY_LO .eq. OUTLET) jend = cvmgt(hi_2 ,hi_2+1,BCY_HI .eq. OUTLET) kstrt = cvmgt(lo_3+1,lo_3 ,BCZ_LO .eq. OUTLET) kend = cvmgt(hi_3 ,hi_3+1,BCZ_HI .eq. OUTLET) do k = kstrt, kend do j = jstrt, jend do i = istrt, iend sum(i,j,k) = - ( $ (coeff(i,j,k,1) + coeff(i-1,j,k,1)) * facx + $ (coeff(i,j,k,2) + coeff(i,j-1,k,2)) * facy + $ (coeff(i,j,k,3) + coeff(i,j,k-1,3)) * facz ) enddo enddo enddo if (bcx_lo .eq. WALL) then do k = kstrt, kend do j = jstrt, jend sum(is ,j,k) = two * sum(is ,j,k) enddo enddo endif if (bcx_hi .eq. WALL) then do k = kstrt, kend do j = jstrt, jend sum(ie+1,j,k) = two * sum(ie+1,j,k) enddo enddo endif if (bcy_lo .eq. WALL) then do k = kstrt, kend do i = istrt, iend sum(i,js ,k) = two * sum(i,js ,k) enddo enddo endif if (bcy_hi .eq. WALL) then do k = kstrt, kend do i = istrt, iend sum(i,je+1,k) = two * sum(i,je+1,k) enddo enddo endif if (bcz_lo .eq. WALL) then do j = jstrt, jend do i = istrt, iend sum(i,j,ks ) = two * sum(i,j,ks ) enddo enddo endif if (bcz_hi .eq. WALL) then do j = jstrt, jend do i = istrt, iend sum(i,j,ke+1) = two * sum(i,j,ke+1) enddo enddo endif return end ccseapps-2.5/CCSEApps/varden3d/MACPROJ_F.H0000644000175000017500000001675011634153073021047 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_INITSIGMA initsigma # define FORT_COARSIGMA coarsigma # define FORT_RHSMAC rhsmac # define FORT_GRADMAC gradmac # define FORT_RESIDUAL resmac # define FORT_GSRB gsrbmac # define FORT_RESTRICT coarsres # define FORT_INTERPOLATE interp # define FORT_PROJUMAC projumac # define FORT_SOLVEMAC solvemac # define FORT_MKSUMMAC mksummac #else #if defined (BL_FORT_USE_UNDERSCORE) # define FORT_INITSIGMA initsigma_ # define FORT_COARSIGMA coarsigma_ # define FORT_RHSMAC rhsmac_ # define FORT_GRADMAC gradmac_ # define FORT_RESIDUAL resmac_ # define FORT_GSRB gsrbmac_ # define FORT_RESTRICT coarsres_ # define FORT_INTERPOLATE interp_ # define FORT_PROJUMAC projumac_ # define FORT_SOLVEMAC solvemac_ # define FORT_MKSUMMAC mksummac_ #elif defined (BL_FORT_USE_UPPERCASE) # define FORT_INITSIGMA INITSIGMA # define FORT_COARSIGMA COARSIGMA # define FORT_RHSMAC RHSMAC # define FORT_RESIDUAL RESMAC # define FORT_GSRB GSRBMAC # define FORT_GRADMAC GRADMAC # define FORT_RESTRICT COARSRES # define FORT_INTERPOLATE INTERP # define FORT_PROJUMAC PROJUMAC # define FORT_SOLVEMAC SOLVEMAC # define FORT_MKSUMMAC MKSUMMAC #elif defined (BL_FORT_USE_LOWERCASE) # define FORT_INITSIGMA initsigma # define FORT_COARSIGMA coarsigma # define FORT_RHSMAC rhsmac # define FORT_RESIDUAL resmac # define FORT_GSRB gsrbmac # define FORT_GRADMAC gradmac # define FORT_RESTRICT coarsres # define FORT_INTERPOLATE interp # define FORT_PROJUMAC projumac # define FORT_SOLVEMAC solvemac # define FORT_MKSUMMAC mksummac #endif extern "C" { void FORT_INITSIGMA(Real * sigmax, Real * sigmay, Real * sigmaz, Real * rho, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); void FORT_RHSMAC(Real * uhalfx, Real * uhalfy, Real * uhalfz, Real * divu_src, Real * rhs, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, Real * rhsnorm); void FORT_GRADMAC(Real * gradpx, Real * gradpy, Real * gradpz, Real * phi, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); void FORT_RESIDUAL(Real * resid, Real * phi, Real * f, Real * sigmax, Real * sigmay, Real * sigmaz, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, Real * rnorm, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); void FORT_COARSIGMA(Real * sigmax , Real * sigmay, Real * sigmaz, Real * sigmaxc, Real * sigmayc, Real * sigmazc, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, const int& loc_1, const int& loc_2, const int& loc_3, const int& hic_1, const int& hic_2, const int& hic_3); void FORT_GSRB(Real * phi, Real * f, Real * sigmax, Real * sigmay, Real * sigmaz, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, int * nngsrb); void FORT_RESTRICT(Real * res, Real * resc, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, const int& loc_1, const int& loc_2, const int& loc_3, const int& hic_1, const int& hic_2, const int& hic_3); void FORT_INTERPOLATE(Real * phi, Real * deltac, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, const int& loc_1, const int& loc_2, const int& loc_3, const int& hic_1, const int& hic_2, const int& hic_3); void FORT_PROJUMAC(Real * uhalfx, Real * uhalfy, Real * uhalfz, Real * gradpx, Real * gradpy, Real * gradpz, Real * rho, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3); void FORT_SOLVEMAC(Real * dest, Real * dest0, Real *source, Real * sigmax, Real * sigmay, Real * sigmaz, Real * sum, Real * r, Real * w, Real * z, Real * work, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, Real * rnorm, Real * prob_norm); void FORT_MKSUMMAC(Real * sigmax, Real * sigmay, Real * sigmaz, Real * sum, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); }; #endif ccseapps-2.5/CCSEApps/varden3d/amrvis.defaults0000644000175000017500000000042111634153073022414 0ustar amckinstryamckinstrypalette Palette initialderived x_vel initialscale 8 numberformat %8.6f maxpixmapsize 1000000 reservesystemcolors 35 showboxes TRUE windowheight 650 windowwidth 1100 fabordering alpha ccseapps-2.5/CCSEApps/varden3d/slopey.F0000644000175000017500000002004411634153073021007 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** SLOPEY ** c ** Compute the slope of nvar components of s in the y-direction c ************************************************************************* subroutine FORT_SLOPEY(s,sly,dyscr,DIMS,nvar,bcy_lo,bcy_hi,slope_order) implicit none integer DIMS integer nvar integer bcy_lo,bcy_hi integer slope_order REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,nvar) REAL_T sly(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,nvar) REAL_T dyscr(lo_2-1:hi_2+1,4) integer cen,lim,flag,fromm parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) REAL_T dpls,dmin,ds REAL_T del,slim,sflag integer is,js,ks,ie,je,ke,i,j,k,iv is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 c ::: HERE DOING 1ST ORDER if (slope_order .eq. 0) then do iv = 1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is-1,ie+1 sly(i,j,k,iv) = zero enddo enddo enddo enddo c ::: HERE DOING 2ND ORDER else if (slope_order .eq. 2) then do iv=1,nvar do k = ks-1,ke+1 do j = js,je do i = is-1,ie+1 del = half*(s(i,j+1,k,iv) - s(i,j-1,k,iv)) dpls = two *(s(i,j+1,k,iv) - s(i,j ,k,iv)) dmin = two *(s(i,j ,k,iv) - s(i,j-1,k,iv)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,j,k,iv)= sflag*min(slim,abs(del)) enddo enddo if (bcy_lo .eq. PERIODIC) then do i = is-1,ie+1 sly(i,js-1,k,iv) = sly(i,je,k,iv) enddo elseif (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) then do i = is-1,ie+1 sly(i,js-1,k,iv) = zero del = (s(i,js+1,k,iv)+three*s(i,js,k,iv)- $ four*s(i,js-1,k,iv)) * third dpls = two*(s(i,js+1,k,iv) - s(i,js ,k,iv)) dmin = two*(s(i,js ,k,iv) - s(i,js-1,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,js,k,iv)= sflag*min(slim,abs(del)) enddo elseif (bcy_lo .eq. OUTLET) then do i = is-1,ie+1 sly(i,js-1,k,iv)= zero enddo endif if (bcy_hi .eq. PERIODIC) then do i = is-1,ie+1 sly(i,je+1,k,iv) = sly(i,js,k,iv) enddo elseif (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) then do i = is-1, ie+1 sly(i,je+1,k,iv) = zero del = -(s(i,je-1,k,iv)+three*s(i,je,k,iv)- $ four*s(i,je+1,k,iv)) * third dpls = two*(s(i,je+1,k,iv) - s(i,je ,k,iv)) dmin = two*(s(i,je ,k,iv) - s(i,je-1,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,je,k,iv)= sflag*min(slim,abs(del)) enddo elseif (bcy_hi .eq. OUTLET) then do i = is-1,ie+1 sly(i,je+1,k,iv)= zero enddo endif enddo enddo else c ::: HERE DOING 4TH ORDER do iv=1,nvar do k = ks-1,ke+1 do i = is-1,ie+1 do j = js,je dyscr(j,cen) = half*(s(i,j+1,k,iv)-s(i,j-1,k,iv)) dmin = two*(s(i,j ,k,iv)-s(i,j-1,k,iv)) dpls = two*(s(i,j+1,k,iv)-s(i,j ,k,iv)) dyscr(j,lim) = min(abs(dmin),abs(dpls)) dyscr(j,lim) = cvmgp(dyscr(j,lim),zero,dpls*dmin) dyscr(j,flag) = sign(one,dyscr(j,cen)) dyscr(j,fromm)= dyscr(j,flag)*min(dyscr(j,lim),abs(dyscr(j,cen))) enddo if (bcy_lo .eq. PERIODIC) then dyscr(js-1,fromm) = dyscr(je,fromm) else dyscr(js-1,fromm) = dyscr(js,fromm) endif if (bcy_hi .eq. PERIODIC) then dyscr(je+1,fromm) = dyscr(js,fromm) else dyscr(je+1,fromm) = dyscr(je,fromm) endif do j = js,je ds = two * two3rd * dyscr(j,cen) - $ sixth * (dyscr(j+1,fromm) + dyscr(j-1,fromm)) sly(i,j,k,iv) = dyscr(j,flag)*min(abs(ds),dyscr(j,lim)) enddo if (bcy_lo .eq. PERIODIC) then sly(i,js-1,k,iv) = sly(i,je,k,iv) elseif (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) then sly(i,js-1,k,iv) = zero del = -sixteen/fifteen*s(i,js-1,k,iv) + half*s(i,js ,k,iv) + $ two3rd*s(i,js+1,k,iv) - tenth*s(i,js+2,k,iv) dmin = two*(s(i,js ,k,iv)-s(i,js-1,k,iv)) dpls = two*(s(i,js+1,k,iv)-s(i,js ,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,js,k,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at js+1 using the revised dyscr(js,fromm) dyscr(js,fromm) = sly(i,js,k,iv) ds = two * two3rd * dyscr(js+1,cen) - $ sixth * (dyscr(js+2,fromm) + dyscr(js,fromm)) sly(i,js+1,k,iv) = dyscr(js+1,flag)*min(abs(ds),dyscr(js+1,lim)) elseif (bcy_lo .eq. OUTLET) then sly(i,js-1,k,iv) = zero endif if (bcy_hi .eq. PERIODIC) then sly(i,je+1,k,iv) = sly(i,js,k,iv) elseif (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) then sly(i,je+1,k,iv) = zero del = -( -sixteen/fifteen*s(i,je+1,k,iv) + half*s(i,je ,k,iv) $ + two3rd*s(i,je-1,k,iv) - tenth*s(i,je-2,k,iv) ) dmin = two*(s(i,je ,k,iv)-s(i,je-1,k,iv)) dpls = two*(s(i,je+1,k,iv)-s(i,je ,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) sly(i,je,k,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at js+1 using the revised dyscr(js,fromm) dyscr(je,fromm) = sly(i,je,k,iv) ds = two * two3rd * dyscr(je-1,cen) - $ sixth * (dyscr(je-2,fromm) + dyscr(je,fromm)) sly(i,je-1,k,iv) = dyscr(je-1,flag)*min(abs(ds),dyscr(je-1,lim)) elseif (bcy_hi .eq. OUTLET) then sly(i,je+1,k,iv) = zero endif enddo enddo enddo endif return end ccseapps-2.5/CCSEApps/varden3d/Palette0000644000175000017500000000140011634153073020701 0ustar amckinstryamckinstry #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúöñíéäàÛ×ÓÎÊÅÁ½¸´¯«§¢ž™•‘Œˆƒ #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ccseapps-2.5/CCSEApps/varden3d/diffuser.H0000644000175000017500000001002411634153073021302 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // //@Man: //@Memo: Class for diffusive/viscous solves //@Doc: Class to handle Crank-Nicholson diffusive/viscous solves class diffuser { //@ManDoc: Problem domain in index space Box domain; //@ManDoc: Mesh spacing in x-direction Real _hx; //@ManDoc: Mesh spacing in y-direction Real _hy; //@ManDoc: Mesh spacing in z-direction Real _hz; //@ManDoc: Tolerance for multigrid iterative solve Real tol; //@ManDoc: number of smoothing steps as you coarsen static int numSmoothCoarsen; //@ManDoc: number of smoothing steps as you refine static int numSmoothRefine; public: //@ManDoc: Constructor diffuser(const Box& Domain, Real * dx); //@ManDoc: Destructor ~diffuser(); //@ManDoc: Solve for the new-time velocity void solveVel(FArrayBox * staten, FArrayBox * temp, Real * rho, Real mu, int n); //@ManDoc: Solve for the new-time scalar field void solveScal(FArrayBox * staten, FArrayBox * temp, Real mu, int n); }; //@ManDoc: Multigrid solver for the Crank-Nicholson discretization class diffuser_mg : public multigrid { //@Memo: Multigrid solver for diffusive/viscous solves. //@ManDoc: Multigrid level int level; //@ManDoc: Diffusive coefficient / Dynamic viscosity coefficient Real mu; //@ManDoc: Inflow values along the low x-edge Real *uinx_lo; //@ManDoc: Inflow values along the high x-edge Real *uinx_hi; //@ManDoc: Inflow values along the low y-edge Real *uiny_lo; //@ManDoc: Inflow values along the high y-edge Real *uiny_hi; //@ManDoc: Inflow values along the low z-edge Real *uinz_lo; //@ManDoc: Inflow values along the high z-edge Real *uinz_hi; //@ManDoc: Coefficients 1/rho FArrayBox *sigma; //@ManDoc: Pointer to the next coarsest multigrid level diffuser_mg *Next; //@ManDoc: Scratch space for the conjugate gradient bottom solver FArrayBox *cgwork; //@ManDoc: Compute the residual R = RHS - DG(phi) Real residual(); //@ManDoc: Relax on the residual equation, updating phi void step(int); //@ManDoc: Coarsen the residual to the next coarser multigrid level void Restrict(); //@ManDoc: Interpolate the solution from the next coarser multigrid level void interpolate(); public: //@ManDoc: Constructor diffuser_mg(const Box & Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Resid, FArrayBox * Sigma, Real * Uinx_lo, Real * Uinx_hi, Real * Uiny_lo, Real * Uiny_hi, Real * Uinz_lo, Real * Uinz_hi, Real Hx, Real Hy, Real Hz, int Level); //@ManDoc: Destructor ~diffuser_mg(); }; ccseapps-2.5/CCSEApps/varden3d/multigrid.H0000644000175000017500000000710111634153073021475 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MG_ #define _MG_ // //@Man: //@Memo: Multigrid class /*@Doc: This multigrid class provides the framework for doing the different multigrid solves. It provides virtual versions of the worker functions necessary for implementation of a solver: residual, step (relax or solve), restrict, and interpolate. It also allows for several types of multigrid cycles : V-cycles, W-Cycles, or FMV-cycles (Full Multigrid V-cycles) */ class multigrid { // This friend declaration compensates for a compiler bug. friend class diffuser_mg; friend class macprojection_mg; friend class hgprojection_mg; protected: Box domain; FArrayBox * phi; FArrayBox * source; FArrayBox * resid; Real _hx; Real _hy; Real _hz; multigrid *next; //@ManDoc: Is this the first instantiation of multigrid? static int first_mg; //@ManDoc: If true, print additional run-time diagnostics static int debug; //@ManDoc: Used to set degrees of verbosity (can be 0,1 or 2) static int verbose; //@ManDoc: Problem norm to be used to define convergence. static Real prob_norm; //@ManDoc: Compute the residual R = RHS - DG(phi) virtual Real residual() = 0; //@ManDoc: Relax on the residual equation, updating phi virtual void step(int) = 0; //@ManDoc: Coarsen the residual to the next coarser multigrid level virtual void Restrict() = 0; //@ManDoc: Interpolate the solution from the next coarser multigrid level virtual void interpolate() = 0; //@ManDoc: Coordinates of the low side of the domain const int * lo_mg; //@ManDoc: Coordinates of the high side of the domain const int * hi_mg; public: //@ManDoc: Constructor multigrid(const Box & Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Resid, Real Hx, Real Hy, Real Hz); //@ManDoc: Solve the linear equation by whichever means void solve(Real tol, Real prob_norm, int nngsrb, int i2=2); //@ManDoc: Perform a Full Multigrid V-Cycle (FMV) Real fmv(Real tol, int nngsrb, int i2=2); //@ManDoc: Perform a single V-Cycle Real vcycle(Real tol, int nngsrb, int i2=2); //@ManDoc: Perform a single W-Cycle Real wcycle(int nngsrb, int i2=2); }; #endif ccseapps-2.5/CCSEApps/varden3d/laplac.F0000644000175000017500000001506711634153073020741 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #if BL_USE_FLOAT #define twentyfive 25.e0 #define fifth 0.2 #else #define twentyfive 25.d0 #define fifth 0.2d0 #endif c ************************************************************************* c ** LAPLAC ** c ** Compute the viscous/diffusive terms for the momentum and scalar update c ** equations c ******************************************************************** subroutine laplac(u,lapu,DIMS,dx,diff_coef, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T dx(3) REAL_T diff_coef integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables REAL_T facx,facy,facz REAL_T uxx, uxx_lo, uxx_hi REAL_T uyy, uyy_lo, uyy_hi REAL_T uzz, uzz_lo, uzz_hi integer is, ie, js, je, ks, ke integer i,j,k is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 facx = one / (dx(1)*dx(1)) facy = one / (dx(2)*dx(2)) facz = one / (dx(3)*dx(3)) if (diff_coef .gt. zero) then do k = ks, ke do j = js, je do i = is, ie uxx = ( u(i+1,j,k) - two * u(i,j,k) + u(i-1,j,k) ) uyy = ( u(i,j+1,k) - two * u(i,j,k) + u(i,j-1,k) ) uzz = ( u(i,j,k+1) - two * u(i,j,k) + u(i,j,k-1) ) uxx_hi = (sixteen * u(ie+1,j,k) - twentyfive * u(ie,j,k) + $ ten * u(ie-1,j,k) - u(ie-2,j,k) ) * fifth uxx_lo = (sixteen * u(is-1,j,k) - twentyfive * u(is,j,k) + $ ten * u(is+1,j,k) - u(is+2,j,k) ) * fifth uxx = cvmgt(uxx_hi, uxx, i .eq. ie .and. $ (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) ) uxx = cvmgt(uxx_lo, uxx, i .eq. is .and. $ (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) ) uyy_hi = (sixteen * u(i,je+1,k) - twentyfive * u(i,je,k) + $ ten * u(i,je-1,k) - u(i,je-2,k) ) * fifth uyy_lo = (sixteen * u(i,js-1,k) - twentyfive * u(i,js,k) + $ ten * u(i,js+1,k) - u(i,js+2,k) ) * fifth uyy = cvmgt(uyy_hi, uyy, j .eq. je .and. $ (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) ) uyy = cvmgt(uyy_lo, uyy, j .eq. js .and. $ (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) ) uzz_hi = (sixteen * u(i,j,ke+1) - twentyfive * u(i,j,ke) + $ ten * u(i,j,ke-1) - u(i,j,ke-2) ) * fifth uzz_lo = (sixteen * u(i,j,ks-1) - twentyfive * u(i,j,ks) + $ ten * u(i,j,ks+1) - u(i,j,ks+2) ) * fifth uzz = cvmgt(uzz_hi, uzz, k .eq. ke .and. $ (bcz_hi .eq. WALL .or. bcz_hi .eq. INLET) ) uzz = cvmgt(uzz_lo, uzz, k .eq. ks .and. $ (bcz_lo .eq. WALL .or. bcz_lo .eq. INLET) ) lapu(i,j,k) = (uxx*facx + uyy*facy + uzz*facz) * diff_coef enddo enddo enddo else do k = ks, ke do j = js, je do i = is, ie lapu(i,j,k) = zero enddo enddo enddo endif if (bcx_lo .eq. PERIODIC) then do k = ks,ke do j = js,je lapu(is-1,j,k) = lapu(ie,j,k) lapu(ie+1,j,k) = lapu(is,j,k) enddo enddo endif if (bcy_lo .eq. PERIODIC) then do k = ks,ke do i = is,ie lapu(i,js-1,k) = lapu(i,je,k) lapu(i,je+1,k) = lapu(i,js,k) enddo enddo endif if (bcz_lo .eq. PERIODIC) then do j = js,je do i = is,ie lapu(i,j,ks-1) = lapu(i,j,ke) lapu(i,j,ke+1) = lapu(i,j,ks) enddo enddo endif if (bcx_lo .eq. PERIODIC .and. bcy_lo .eq. PERIODIC) then do k = ks,ke lapu(is-1,js-1,k) = lapu(ie,je,k) lapu(is-1,je+1,k) = lapu(ie,js,k) lapu(ie+1,js-1,k) = lapu(is,je,k) lapu(ie+1,je+1,k) = lapu(is,js,k) enddo endif if (bcx_lo .eq. PERIODIC .and. bcz_lo .eq. PERIODIC) then do j = js,je lapu(is-1,j,ks-1) = lapu(ie,j,ke) lapu(is-1,j,ke+1) = lapu(ie,j,ks) lapu(ie+1,j,ks-1) = lapu(is,j,ke) lapu(ie+1,j,ke+1) = lapu(is,j,ks) enddo endif if (bcy_lo .eq. PERIODIC .and. bcz_lo .eq. PERIODIC) then do i = is,ie lapu(i,js-1,ks-1) = lapu(i,je,ke) lapu(i,js-1,ke+1) = lapu(i,je,ks) lapu(i,je+1,ks-1) = lapu(i,js,ke) lapu(i,je+1,ke+1) = lapu(i,js,ks) enddo endif if (bcx_lo .eq. PERIODIC .and. bcy_lo .eq. PERIODIC .and. bcz_lo .eq. PERIODIC) then lapu(is-1,js-1,ks-1) = lapu(ie,je,ke) lapu(ie+1,js-1,ks-1) = lapu(is,je,ke) lapu(is-1,je+1,ks-1) = lapu(ie,js,ke) lapu(ie+1,je+1,ks-1) = lapu(is,js,ke) lapu(is-1,js-1,ke+1) = lapu(ie,je,ks) lapu(ie+1,js-1,ke+1) = lapu(is,je,ks) lapu(is-1,je+1,ke+1) = lapu(ie,js,ks) lapu(ie+1,je+1,ke+1) = lapu(is,js,ks) endif return end ccseapps-2.5/CCSEApps/varden3d/mkvelflux.F0000644000175000017500000012322011634153073021511 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKVELFLUX ** c ** Create the time-centered edge states for the velocity components c *************************************************************** subroutine FORT_MKVELFLUX(s,sedgex,sedgey,sedgez, $ slopex,slopey,slopez,uadv,vadv,wadv, $ utrans,vtrans,wtrans, $ rho,px,py,pz,lapu, $ s_l,s_r,s_b,s_t,s_d,s_u,DIMS, $ dx,dt,force,visc_coef, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T sedgex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T sedgey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T sedgez(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T slopex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T slopey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T slopez(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wadv(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T utrans(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vtrans(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wtrans(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T px(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T py(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T pz(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T s_l(lo_1:hi_1+1,3) REAL_T s_r(lo_1:hi_1+1,3) REAL_T s_b(lo_2:hi_2+1,3) REAL_T s_t(lo_2:hi_2+1,3) REAL_T s_d(lo_3:hi_3+1,3) REAL_T s_u(lo_3:hi_3+1,3) REAL_T dx(3) REAL_T dt REAL_T visc_coef integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables REAL_T ubardth, vbardth, wbardth REAL_T hx, hy, hz, dth REAL_T uplus,uminus,vplus,vminus,wplus,wminus,ut,vt,wt REAL_T utr,vtr,wtr,savg,uavg,vavg,wavg REAL_T uptop,upbot,umtop,umbot,uplft,uprgt,umlft,umrgt REAL_T vptop,vpbot,vmtop,vmbot,vplft,vprgt,vmlft,vmrgt REAL_T wptop,wpbot,wmtop,wmbot,wplft,wprgt,wmlft,wmrgt REAL_T eps logical ltm0,ltp0 integer i,j,k,is,js,ks,ie,je,ke,n eps = 1.0e-8 is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 dth = half*dt hx = dx(1) hy = dx(2) hz = dx(3) do k = ks,ke do j = js,je do i = is,ie c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Y-DIRECTION c ****************************************************************** wpbot = s(i,j ,k,3) + (half - dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,3) c $ + dth * lapu(i,j ,k,3) / rho(i,j,k) wptop = s(i,j+1,k,3) - (half + dth*s(i,j+1,k,2)/hy)*slopey(i,j+1,k,3) c $ + dth * lapu(i,j+1,k,3) / rho(i,j+1,k) vpbot = s(i,j ,k,2) + (half - dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,2) c $ + dth * lapu(i,j ,k,2) / rho(i,j,k) vptop = s(i,j+1,k,2) - (half + dth*s(i,j+1,k,2)/hy)*slopey(i,j+1,k,2) c $ + dth * lapu(i,j+1,k,2) / rho(i,j+1,k) upbot = s(i,j ,k,1) + (half - dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,1) c $ + dth * lapu(i, j,k,1) / rho(i,j,k) uptop = s(i,j+1,k,1) - (half + dth*s(i,j+1,k,2)/hy)*slopey(i,j+1,k,1) c $ + dth * lapu(i,j+1,k,1) / rho(i,j+1,k) ltp0 = (j .eq. je .and. bcy_hi .eq. INLET) wptop = cvmgt(s(i,je+1,k,3),wptop,ltp0) wpbot = cvmgt(s(i,je+1,k,3),wpbot,ltp0) vptop = cvmgt(s(i,je+1,k,2),vptop,ltp0) vpbot = cvmgt(s(i,je+1,k,2),vpbot,ltp0) uptop = cvmgt(s(i,je+1,k,1),uptop,ltp0) upbot = cvmgt(s(i,je+1,k,1),upbot,ltp0) ltp0 = (j .eq. je .and. bcy_hi .eq. WALL) vptop = cvmgt(zero,vptop,ltp0) vpbot = cvmgt(zero,vpbot,ltp0) uptop = cvmgt(upbot,uptop,ltp0) wptop = cvmgt(wpbot,wptop,ltp0) ltp0 = (j .eq. je .and. bcy_hi .eq. WALL .and. visc_coef .gt. zero) uptop = cvmgt(zero,uptop,ltp0) upbot = cvmgt(zero,upbot,ltp0) wptop = cvmgt(zero,wptop,ltp0) wpbot = cvmgt(zero,wpbot,ltp0) uplus = cvmgp(upbot,uptop,vtrans(i,j+1,k)) uavg = half * (upbot + uptop) uplus = cvmgt(uplus, uavg, abs(vtrans(i,j+1,k)) .gt. eps) vplus = cvmgp(vpbot,vptop,vtrans(i,j+1,k)) vavg = half * (vpbot + vptop) vplus = cvmgt(vplus, vavg, abs(vtrans(i,j+1,k)) .gt. eps) wplus = cvmgp(wpbot,wptop,vtrans(i,j+1,k)) wavg = half * (wpbot + wptop) wplus = cvmgt(wplus, wavg, abs(vtrans(i,j+1,k)) .gt. eps) wmtop = s(i,j ,k,3) - (half + dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,3) c $ + dth * lapu(i,j ,k,3) / rho(i,j,k) wmbot = s(i,j-1,k,3) + (half - dth*s(i,j-1,k,2)/hy)*slopey(i,j-1,k,3) c $ + dth * lapu(i,j-1,k,3) / rho(i,j-1,k) vmtop = s(i,j ,k,2) - (half + dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,2) c $ + dth * lapu(i,j ,k,2) / rho(i,j,k) vmbot = s(i,j-1,k,2) + (half - dth*s(i,j-1,k,2)/hy)*slopey(i,j-1,k,2) c $ + dth * lapu(i,j-1,k,2) / rho(i,j-1,k) umtop = s(i,j ,k,1) - (half + dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,1) c $ + dth * lapu(i,j ,k,1) / rho(i,j,k) umbot = s(i,j-1,k,1) + (half - dth*s(i,j-1,k,2)/hy)*slopey(i,j-1,k,1) c $ + dth * lapu(i,j-1,k,1) / rho(i,j-1,k) ltm0 = (j .eq. js .and. bcy_lo .eq. INLET) wmtop = cvmgt(s(i,js-1,k,3),wmtop,ltm0) wmbot = cvmgt(s(i,js-1,k,3),wmbot,ltm0) vmtop = cvmgt(s(i,js-1,k,2),vmtop,ltm0) vmbot = cvmgt(s(i,js-1,k,2),vmbot,ltm0) umtop = cvmgt(s(i,js-1,k,1),umtop,ltm0) umbot = cvmgt(s(i,js-1,k,1),umbot,ltm0) ltm0 = (j .eq. js .and. bcy_lo .eq. WALL) vmtop = cvmgt(zero ,vmtop,ltm0) vmbot = cvmgt(zero ,vmbot,ltm0) umbot = cvmgt(umtop,umbot,ltm0) wmbot = cvmgt(wmtop,wmbot,ltm0) ltm0 = (j .eq. js .and. bcy_lo .eq. WALL .and. $ visc_coef .gt. zero) umtop = cvmgt(zero,umtop,ltm0) umbot = cvmgt(zero,umbot,ltm0) wmtop = cvmgt(zero,wmtop,ltm0) wmbot = cvmgt(zero,wmbot,ltm0) uminus = cvmgp(umbot,umtop,vtrans(i,j,k)) uavg = half * (umbot + umtop) uminus = cvmgt(uminus, uavg, abs(vtrans(i,j,k)) .gt. eps) vminus = cvmgp(vmbot,vmtop,vtrans(i,j,k)) vavg = half * (vmbot + vmtop) vminus = cvmgt(vminus, vavg, abs(vtrans(i,j,k)) .gt. eps) wminus = cvmgp(wmbot,wmtop,vtrans(i,j,k)) wavg = half * (wmbot + wmtop) wminus = cvmgt(wminus, wavg, abs(vtrans(i,j,k)) .gt. eps) utr = half * (vtrans(i,j,k)+vtrans(i,j+1,k))*(uplus - uminus) / hy vtr = half * (vtrans(i,j,k)+vtrans(i,j+1,k))*(vplus - vminus) / hy wtr = half * (vtrans(i,j,k)+vtrans(i,j+1,k))*(wplus - wminus) / hy c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Z-DIRECTION c ****************************************************************** wpbot = s(i,j,k ,3) + (half - dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,3) c $ + dth * lapu(i,j,k ,3) / rho(i,j,k) wptop = s(i,j,k+1,3) - (half + dth*s(i,j,k+1,3)/hz)*slopez(i,j,k+1,3) c $ + dth * lapu(i,j,k+1,3) / rho(i,j,k+1) vpbot = s(i,j,k ,2) + (half - dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,2) c $ + dth * lapu(i,j,k ,2) / rho(i,j,k) vptop = s(i,j,k+1,2) - (half + dth*s(i,j,k+1,3)/hz)*slopez(i,j,k+1,2) c $ + dth * lapu(i,j,k+1,2) / rho(i,j,k+1) upbot = s(i,j,k ,1) + (half - dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,1) c $ + dth * lapu(i,j,k ,1) / rho(i,j,k) uptop = s(i,j,k+1,1) - (half + dth*s(i,j,k+1,3)/hz)*slopez(i,j,k+1,1) c $ + dth * lapu(i,j,k+1,1) / rho(i,j,k+1) ltp0 = (k .eq. ke .and. bcz_hi .eq. INLET) wptop = cvmgt(s(i,j,ke+1,3),wptop,ltp0) wpbot = cvmgt(s(i,j,ke+1,3),wpbot,ltp0) vptop = cvmgt(s(i,j,ke+1,2),vptop,ltp0) vpbot = cvmgt(s(i,j,ke+1,2),vpbot,ltp0) uptop = cvmgt(s(i,j,ke+1,1),uptop,ltp0) upbot = cvmgt(s(i,j,ke+1,1),upbot,ltp0) ltp0 = (k .eq. ke .and. bcz_hi .eq. WALL) wptop = cvmgt(zero,wptop,ltp0) wpbot = cvmgt(zero,wpbot,ltp0) uptop = cvmgt(upbot,uptop,ltp0) vptop = cvmgt(vpbot,vptop,ltp0) ltp0 = (k .eq. ke .and. bcz_hi .eq. WALL .and. visc_coef .gt. zero) uptop = cvmgt(zero,uptop,ltp0) upbot = cvmgt(zero,upbot,ltp0) vptop = cvmgt(zero,vptop,ltp0) vpbot = cvmgt(zero,vpbot,ltp0) uplus = cvmgp(upbot,uptop,wtrans(i,j,k+1)) uavg = half * (upbot + uptop) uplus = cvmgt(uplus, uavg, abs(wtrans(i,j,k+1)) .gt. eps) vplus = cvmgp(vpbot,vptop,wtrans(i,j,k+1)) vavg = half * (vpbot + vptop) vplus = cvmgt(vplus, vavg, abs(wtrans(i,j,k+1)) .gt. eps) wplus = cvmgp(wpbot,wptop,wtrans(i,j,k+1)) wavg = half * (wpbot + wptop) wplus = cvmgt(wplus, wavg, abs(wtrans(i,j,k+1)) .gt. eps) wmtop = s(i,j,k ,3) - (half + dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,3) c $ + dth * lapu(i,j,k ,3) / rho(i,j,k) wmbot = s(i,j,k-1,3) + (half - dth*s(i,j,k-1,3)/hz)*slopez(i,j,k-1,3) c $ + dth * lapu(i,j,k-1,3) / rho(i,j,k-1) vmtop = s(i,j,k ,2) - (half + dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,2) c $ + dth * lapu(i,j,k ,2) / rho(i,j,k) vmbot = s(i,j,k-1,2) + (half - dth*s(i,j,k-1,3)/hz)*slopez(i,j,k-1,2) c $ + dth * lapu(i,j,k-1,2) / rho(i,j,k-1) umtop = s(i,j,k ,1) - (half + dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,1) c $ + dth * lapu(i,j,k ,1) / rho(i,j,k) umbot = s(i,j,k-1,1) + (half - dth*s(i,j,k-1,3)/hz)*slopez(i,j,k-1,1) c $ + dth * lapu(i,j,k-1,1) / rho(i,j,k-1) ltm0 = (k .eq. ks .and. bcz_lo .eq. INLET) wmtop = cvmgt(s(i,j,ks-1,3),wmtop,ltm0) wmbot = cvmgt(s(i,j,ks-1,3),wmbot,ltm0) vmtop = cvmgt(s(i,j,ks-1,2),vmtop,ltm0) vmbot = cvmgt(s(i,j,ks-1,2),vmbot,ltm0) umtop = cvmgt(s(i,j,ks-1,1),umtop,ltm0) umbot = cvmgt(s(i,j,ks-1,1),umbot,ltm0) ltm0 = (k .eq. ks .and. bcz_lo .eq. WALL) wmtop = cvmgt(zero ,wmtop,ltm0) wmbot = cvmgt(zero ,wmbot,ltm0) umbot = cvmgt(umtop,umbot,ltm0) vmbot = cvmgt(vmtop,vmbot,ltm0) ltm0 = (k .eq. ks .and. bcz_lo .eq. WALL .and. $ visc_coef .gt. zero) umtop = cvmgt(zero,umtop,ltm0) umbot = cvmgt(zero,umbot,ltm0) vmtop = cvmgt(zero,vmtop,ltm0) vmbot = cvmgt(zero,vmbot,ltm0) uminus = cvmgp(umbot,umtop,wtrans(i,j,k)) uavg = half * (umbot + umtop) uminus = cvmgt(uminus, uavg, abs(wtrans(i,j,k)) .gt. eps) vminus = cvmgp(vmbot,vmtop,wtrans(i,j,k)) vavg = half * (vmbot + vmtop) vminus = cvmgt(vminus, vavg, abs(wtrans(i,j,k)) .gt. eps) wminus = cvmgp(wmbot,wmtop,wtrans(i,j,k)) wavg = half * (wmbot + wmtop) wminus = cvmgt(wminus, wavg, abs(wtrans(i,j,k)) .gt. eps) utr = utr + $ half * (wtrans(i,j,k)+wtrans(i,j,k+1))*(uplus - uminus) / hz vtr = vtr + $ half * (wtrans(i,j,k)+wtrans(i,j,k+1))*(vplus - vminus) / hz wtr = wtr + $ half * (wtrans(i,j,k)+wtrans(i,j,k+1))*(wplus - wminus) / hz c ****************************************************************** c MAKE LEFT AND RIGHT STATES c ****************************************************************** ut = (lapu(i,j,k,1)-px(i,j,k))/rho(i,j,k) - utr + force(i,j,k,1) vt = (lapu(i,j,k,2)-py(i,j,k))/rho(i,j,k) - vtr + force(i,j,k,2) wt = (lapu(i,j,k,3)-pz(i,j,k))/rho(i,j,k) - wtr + force(i,j,k,3) ubardth = dth*s(i,j,k,1)/hx s_l(i+1,1)= s(i,j,k,1) + (half-ubardth)*slopex(i,j,k,1) + dth*ut s_l(i+1,2)= s(i,j,k,2) + (half-ubardth)*slopex(i,j,k,2) + dth*vt s_l(i+1,3)= s(i,j,k,3) + (half-ubardth)*slopex(i,j,k,3) + dth*wt s_r(i ,1)= s(i,j,k,1) - (half+ubardth)*slopex(i,j,k,1) + dth*ut s_r(i ,2)= s(i,j,k,2) - (half+ubardth)*slopex(i,j,k,2) + dth*vt s_r(i ,3)= s(i,j,k,3) - (half+ubardth)*slopex(i,j,k,3) + dth*wt enddo if (bcx_lo .eq. PERIODIC) then s_l(is ,1) = s_l(ie+1,1) s_l(is ,2) = s_l(ie+1,2) s_l(is ,3) = s_l(ie+1,3) elseif (bcx_lo .eq. WALL) then s_l(is ,1) = zero s_r(is ,1) = zero s_l(is ,2) = s_r(is ,2) s_l(is ,3) = s_r(is ,3) elseif (bcx_lo .eq. INLET) then s_l(is ,1) = s(is-1,j,k,1) s_l(is ,2) = s(is-1,j,k,2) s_l(is ,3) = s(is-1,j,k,3) elseif (bcx_lo .eq. OUTLET) then s_l(is ,1) = s_r(is ,1) s_l(is ,2) = s_r(is ,2) s_l(is ,3) = s_r(is ,3) else print *,'bogus bcx_lo in mkvelflux ',bcx_lo stop endif if (bcx_hi .eq. PERIODIC) then s_r(ie+1,1) = s_r(is ,1) s_r(ie+1,2) = s_r(is ,2) s_r(ie+1,3) = s_r(is ,3) elseif (bcx_hi .eq. WALL) then s_l(ie+1,1) = zero s_r(ie+1,1) = zero s_r(ie+1,2) = s_l(ie+1,2) s_r(ie+1,3) = s_l(ie+1,3) elseif (bcx_hi .eq. INLET) then s_r(ie+1,1) = s(ie+1,j,k,1) s_r(ie+1,2) = s(ie+1,j,k,2) s_r(ie+1,3) = s(ie+1,j,k,3) elseif (bcx_hi .eq. OUTLET) then s_r(ie+1,1) = s_l(ie+1,1) s_r(ie+1,2) = s_l(ie+1,2) s_r(ie+1,3) = s_l(ie+1,3) else print *,'bogus bcx_hi in mkvelflux ',bcx_hi stop endif do n = 1,3 do i = is, ie+1 sedgex(i,j,k,n)=cvmgp(s_l(i,n),s_r(i,n),uadv(i,j,k)) savg = half*(s_r(i,n) + s_l(i,n)) sedgex(i,j,k,n)=cvmgt(savg,sedgex(i,j,k,n),abs(uadv(i,j,k)) .lt. eps) enddo enddo if (visc_coef .gt. 0. .and. bcx_lo .eq. WALL) then sedgex(is ,j,k,3) = zero sedgex(is ,j,k,2) = zero sedgex(is ,j,k,1) = zero endif if (visc_coef .gt. 0. .and. bcx_hi .eq. WALL) then sedgex(ie+1,j,k,3) = zero sedgex(ie+1,j,k,2) = zero sedgex(ie+1,j,k,1) = zero endif enddo enddo c ****************************************************************** c ****************************************************************** c ****************************************************************** c ::: loop for y fluxes do k = ks, ke do i = is, ie do j = js, je c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN X-DIRECTION c ****************************************************************** wplft = s(i ,j,k,3) + (half - dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,3) c $ + dth * lapu(i ,j,k,3) / rho(i ,j,k) wprgt = s(i+1,j,k,3) - (half + dth*s(i+1,j,k,1)/hx)*slopex(i+1,j,k,3) c $ + dth * lapu(i+1,j,k,3) / rho(i+1,j,k) vplft = s(i ,j,k,2) + (half - dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,2) c $ + dth * lapu(i ,j,k,2) / rho(i ,j,k) vprgt = s(i+1,j,k,2) - (half + dth*s(i+1,j,k,1)/hx)*slopex(i+1,j,k,2) c $ + dth * lapu(i+1,j,k,2) / rho(i+1,j,k) uplft = s(i ,j,k,1) + (half - dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,1) c $ + dth * lapu(i ,j,k,1) / rho(i ,j,k) uprgt = s(i+1,j,k,1) - (half + dth*s(i+1,j,k,1)/hx)*slopex(i+1,j,k,1) c $ + dth * lapu(i+1,j,k,1) / rho(i+1,j,k) ltp0 = (i .eq. ie .and. bcx_hi .eq. INLET) uprgt = cvmgt(s(ie+1,j,k,1),uprgt,ltp0) uplft = cvmgt(s(ie+1,j,k,1),uplft,ltp0) vprgt = cvmgt(s(ie+1,j,k,2),vprgt,ltp0) vplft = cvmgt(s(ie+1,j,k,2),vplft,ltp0) wprgt = cvmgt(s(ie+1,j,k,3),wprgt,ltp0) wplft = cvmgt(s(ie+1,j,k,3),wplft,ltp0) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL) uprgt = cvmgt(zero,uprgt,ltp0) uplft = cvmgt(zero,uplft,ltp0) vprgt = cvmgt(vplft,vprgt,ltp0) wprgt = cvmgt(wplft,wprgt,ltp0) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL .and. visc_coef .gt. zero) vprgt = cvmgt(zero,vprgt,ltp0) vplft = cvmgt(zero,vplft,ltp0) wprgt = cvmgt(zero,wprgt,ltp0) wplft = cvmgt(zero,wplft,ltp0) uplus = cvmgp(uplft,uprgt,utrans(i+1,j,k)) uavg = half * (uplft + uprgt) uplus = cvmgt(uplus, uavg, abs(utrans(i+1,j,k)) .gt. eps) vplus = cvmgp(vplft,vprgt,utrans(i+1,j,k)) vavg = half * (vplft + vprgt) vplus = cvmgt(vplus, vavg, abs(utrans(i+1,j,k)) .gt. eps) wplus = cvmgp(wplft,wprgt,utrans(i+1,j,k)) wavg = half * (wplft + wprgt) wplus = cvmgt(wplus, wavg, abs(utrans(i+1,j,k)) .gt. eps) wmrgt = s(i ,j,k,3) - (half + dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,3) c $ + dth * lapu(i ,j,k,3) / rho(i ,j,k) wmlft = s(i-1,j,k,3) + (half - dth*s(i-1,j,k,1)/hx)*slopex(i-1,j,k,3) c $ + dth * lapu(i-1,j,k,3) / rho(i-1,j,k) vmrgt = s(i ,j,k,2) - (half + dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,2) c $ + dth * lapu(i ,j,k,2) / rho(i ,j,k) vmlft = s(i-1,j,k,2) + (half - dth*s(i-1,j,k,1)/hx)*slopex(i-1,j,k,2) c $ + dth * lapu(i-1,j,k,2) / rho(i-1,j,k) umrgt = s(i ,j,k,1) - (half + dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,1) c $ + dth * lapu(i ,j,k,1) / rho(i ,j,k) umlft = s(i-1,j,k,1) + (half - dth*s(i-1,j,k,1)/hx)*slopex(i-1,j,k,1) c $ + dth * lapu(i-1,j,k,1) / rho(i-1,j,k) ltm0 = (i .eq. is .and. bcx_lo .eq. INLET) umrgt = cvmgt(s(is-1,j,k,1),umrgt,ltm0) umlft = cvmgt(s(is-1,j,k,1),umlft,ltm0) vmrgt = cvmgt(s(is-1,j,k,2),vmrgt,ltm0) vmlft = cvmgt(s(is-1,j,k,2),vmlft,ltm0) wmrgt = cvmgt(s(is-1,j,k,3),wmrgt,ltm0) wmlft = cvmgt(s(is-1,j,k,3),wmlft,ltm0) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL) umrgt = cvmgt(zero ,umrgt,ltm0) umlft = cvmgt(zero ,umlft,ltm0) vmlft = cvmgt(vmrgt,vmlft,ltm0) wmlft = cvmgt(wmrgt,wmlft,ltm0) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL .and. $ visc_coef .gt. zero) vmrgt = cvmgt(zero,vmrgt,ltm0) vmlft = cvmgt(zero,vmlft,ltm0) wmrgt = cvmgt(zero,wmrgt,ltm0) wmlft = cvmgt(zero,wmlft,ltm0) uminus = cvmgp(umlft,umrgt,utrans(i,j,k)) uavg = half * (umlft + umrgt) uminus = cvmgt(uminus, uavg, abs(utrans(i,j,k)) .gt. eps) vminus = cvmgp(vmlft,vmrgt,utrans(i,j,k)) vavg = half * (vmlft + vmrgt) vminus = cvmgt(vminus, vavg, abs(utrans(i,j,k)) .gt. eps) wminus = cvmgp(wmlft,wmrgt,utrans(i,j,k)) wavg = half * (wmlft + wmrgt) wminus = cvmgt(wminus, wavg, abs(utrans(i,j,k)) .gt. eps) utr = half * (utrans(i,j,k)+utrans(i+1,j,k))*(uplus - uminus) / hx vtr = half * (utrans(i,j,k)+utrans(i+1,j,k))*(vplus - vminus) / hx wtr = half * (utrans(i,j,k)+utrans(i+1,j,k))*(wplus - wminus) / hx c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Z-DIRECTION c ****************************************************************** wpbot = s(i,j,k ,3) + (half - dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,3) c $ + dth * lapu(i,j,k ,3) / rho(i,j,k) wptop = s(i,j,k+1,3) - (half + dth*s(i,j,k+1,3)/hz)*slopez(i,j,k+1,3) c $ + dth * lapu(i,j,k+1,3) / rho(i,j,k+1) vpbot = s(i,j,k ,2) + (half - dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,2) c $ + dth * lapu(i,j,k ,2) / rho(i,j,k) vptop = s(i,j,k+1,2) - (half + dth*s(i,j,k+1,3)/hz)*slopez(i,j,k+1,2) c $ + dth * lapu(i,j,k+1,2) / rho(i,j,k+1) upbot = s(i,j,k ,1) + (half - dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,1) c $ + dth * lapu(i,j,k ,1) / rho(i,j,k) uptop = s(i,j,k+1,1) - (half + dth*s(i,j,k+1,3)/hz)*slopez(i,j,k+1,1) c $ + dth * lapu(i,j,k+1,1) / rho(i,j,k+1) ltp0 = (k .eq. ke .and. bcz_hi .eq. INLET) wptop = cvmgt(s(i,j,ke+1,3),wptop,ltp0) wpbot = cvmgt(s(i,j,ke+1,3),wpbot,ltp0) vptop = cvmgt(s(i,j,ke+1,2),vptop,ltp0) vpbot = cvmgt(s(i,j,ke+1,2),vpbot,ltp0) uptop = cvmgt(s(i,j,ke+1,1),uptop,ltp0) upbot = cvmgt(s(i,j,ke+1,1),upbot,ltp0) ltp0 = (k .eq. ke .and. bcz_hi .eq. WALL) wptop = cvmgt(zero,wptop,ltp0) wpbot = cvmgt(zero,wpbot,ltp0) uptop = cvmgt(upbot,uptop,ltp0) vptop = cvmgt(vpbot,vptop,ltp0) ltp0 = (k .eq. ke .and. bcz_hi .eq. WALL .and. visc_coef .gt. zero) uptop = cvmgt(zero,uptop,ltp0) upbot = cvmgt(zero,upbot,ltp0) vptop = cvmgt(zero,vptop,ltp0) vpbot = cvmgt(zero,vpbot,ltp0) uplus = cvmgp(upbot,uptop,wtrans(i,j,k+1)) uavg = half * (upbot + uptop) uplus = cvmgt(uplus, uavg, abs(wtrans(i,j,k+1)) .gt. eps) vplus = cvmgp(vpbot,vptop,wtrans(i,j,k+1)) vavg = half * (vpbot + vptop) vplus = cvmgt(vplus, vavg, abs(wtrans(i,j,k+1)) .gt. eps) wplus = cvmgp(wpbot,wptop,wtrans(i,j,k+1)) wavg = half * (wpbot + wptop) wplus = cvmgt(wplus, wavg, abs(wtrans(i,j,k+1)) .gt. eps) wmtop = s(i,j,k ,3) - (half + dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,3) c $ + dth * lapu(i,j,k ,3) / rho(i,j,k) wmbot = s(i,j,k-1,3) + (half - dth*s(i,j,k-1,3)/hz)*slopez(i,j,k-1,3) c $ + dth * lapu(i,j,k-1,3) / rho(i,j,k-1) vmtop = s(i,j,k ,2) - (half + dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,2) c $ + dth * lapu(i,j,k ,2) / rho(i,j,k) vmbot = s(i,j,k-1,2) + (half - dth*s(i,j,k-1,3)/hz)*slopez(i,j,k-1,2) c $ + dth * lapu(i,j,k-1,2) / rho(i,j,k-1) umtop = s(i,j,k ,1) - (half + dth*s(i,j,k ,3)/hz)*slopez(i,j,k ,1) c $ + dth * lapu(i,j,k ,1) / rho(i,j,k) umbot = s(i,j,k-1,1) + (half - dth*s(i,j,k-1,3)/hz)*slopez(i,j,k-1,1) c $ + dth * lapu(i,j,k-1,1) / rho(i,j,k-1) ltm0 = (k .eq. ks .and. bcz_lo .eq. INLET) wmtop = cvmgt(s(i,j,ks-1,3),wmtop,ltm0) wmbot = cvmgt(s(i,j,ks-1,3),wmbot,ltm0) vmtop = cvmgt(s(i,j,ks-1,2),vmtop,ltm0) vmbot = cvmgt(s(i,j,ks-1,2),vmbot,ltm0) umtop = cvmgt(s(i,j,ks-1,1),umtop,ltm0) umbot = cvmgt(s(i,j,ks-1,1),umbot,ltm0) ltm0 = (k .eq. ks .and. bcz_lo .eq. WALL) wmtop = cvmgt(zero ,wmtop,ltm0) wmbot = cvmgt(zero ,wmbot,ltm0) umbot = cvmgt(umtop,umbot,ltm0) vmbot = cvmgt(vmtop,vmbot,ltm0) ltm0 = (k .eq. ks .and. bcz_lo .eq. WALL .and. $ visc_coef .gt. zero) umtop = cvmgt(zero,umtop,ltm0) umbot = cvmgt(zero,umbot,ltm0) vmtop = cvmgt(zero,vmtop,ltm0) vmbot = cvmgt(zero,vmbot,ltm0) uminus = cvmgp(umbot,umtop,wtrans(i,j,k)) uavg = half * (umbot + umtop) uminus = cvmgt(uminus, uavg, abs(wtrans(i,j,k)) .gt. eps) vminus = cvmgp(vmbot,vmtop,wtrans(i,j,k)) vavg = half * (vmbot + vmtop) vminus = cvmgt(vminus, vavg, abs(wtrans(i,j,k)) .gt. eps) wminus = cvmgp(wmbot,wmtop,wtrans(i,j,k)) wavg = half * (wmbot + wmtop) wminus = cvmgt(wminus, wavg, abs(wtrans(i,j,k)) .gt. eps) utr = utr + $ half * (wtrans(i,j,k)+wtrans(i,j,k+1))*(uplus - uminus) / hz vtr = vtr + $ half * (wtrans(i,j,k)+wtrans(i,j,k+1))*(vplus - vminus) / hz wtr = wtr + $ half * (wtrans(i,j,k)+wtrans(i,j,k+1))*(wplus - wminus) / hz c ****************************************************************** c MAKE TOP AND BOTTOM STATES c ****************************************************************** ut = (lapu(i,j,k,1)-px(i,j,k))/rho(i,j,k) - utr + force(i,j,k,1) vt = (lapu(i,j,k,2)-py(i,j,k))/rho(i,j,k) - vtr + force(i,j,k,2) wt = (lapu(i,j,k,3)-pz(i,j,k))/rho(i,j,k) - wtr + force(i,j,k,3) vbardth = dth*s(i,j,k,2)/hy s_b(j+1,1)= s(i,j,k,1) + (half-vbardth)*slopey(i,j,k,1) + dth*ut s_t(j ,1)= s(i,j,k,1) - (half+vbardth)*slopey(i,j,k,1) + dth*ut s_b(j+1,2)= s(i,j,k,2) + (half-vbardth)*slopey(i,j,k,2) + dth*vt s_t(j ,2)= s(i,j,k,2) - (half+vbardth)*slopey(i,j,k,2) + dth*vt s_b(j+1,3)= s(i,j,k,3) + (half-vbardth)*slopey(i,j,k,3) + dth*wt s_t(j ,3)= s(i,j,k,3) - (half+vbardth)*slopey(i,j,k,3) + dth*wt enddo if (bcy_lo .eq. PERIODIC) then s_b(js ,1) = s_b(je+1,1) s_b(js ,2) = s_b(je+1,2) s_b(js ,3) = s_b(je+1,3) elseif (bcy_lo .eq. WALL) then s_b(js ,1) = s_t(js ,1) s_b(js ,3) = s_t(js ,3) s_b(js ,2) = zero s_t(js ,2) = zero elseif (bcy_lo .eq. INLET) then s_b(js ,1) = s(i,js-1,k,1) s_b(js ,2) = s(i,js-1,k,2) s_b(js ,3) = s(i,js-1,k,3) elseif (bcy_lo .eq. OUTLET) then s_b(js ,1) = s_t(js ,1) s_b(js ,2) = s_t(js ,2) s_b(js ,3) = s_t(js ,3) else print *,'bogus bcy_lo in mkvelflux ',bcy_lo stop endif if (bcy_hi .eq. PERIODIC) then s_t(je+1,1) = s_t(js ,1) s_t(je+1,2) = s_t(js ,2) s_t(je+1,3) = s_t(js ,3) elseif (bcy_hi .eq. WALL) then s_t(je+1,1) = s_b(je+1,1) s_t(je+1,3) = s_b(je+1,3) s_b(je+1,2) = zero s_t(je+1,2) = zero elseif (bcy_hi .eq. INLET) then s_t(je+1,1) = s(i,je+1,k,1) s_t(je+1,2) = s(i,je+1,k,2) s_t(je+1,3) = s(i,je+1,k,3) elseif (bcy_hi .eq. OUTLET) then s_t(je+1,1) = s_b(je+1,1) s_t(je+1,2) = s_b(je+1,2) s_t(je+1,3) = s_b(je+1,3) else print *,'bogus bcy_hi in mkvelflux ',bcy_hi stop endif do n = 1,3 do j = js, je+1 sedgey(i,j,k,n)=cvmgp(s_b(j,n),s_t(j,n),vadv(i,j,k)) savg = half*(s_t(j,n) + s_b(j,n)) sedgey(i,j,k,n)=cvmgt(savg,sedgey(i,j,k,n),abs(vadv(i,j,k)) .lt. eps) enddo enddo if (visc_coef .gt. 0. .and. bcy_lo .eq. WALL) then sedgey(i,js ,k,3) = zero sedgey(i,js ,k,2) = zero sedgey(i,js ,k,1) = zero endif if (visc_coef .gt. 0. .and. bcy_hi .eq. WALL) then sedgey(i,je+1,k,3) = zero sedgey(i,je+1,k,2) = zero sedgey(i,je+1,k,1) = zero endif enddo enddo c ****************************************************************** c ****************************************************************** c ****************************************************************** c ::: loop for z fluxes do j = js, je do i = is, ie do k = ks, ke c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN X-DIRECTION c ****************************************************************** wplft = s(i ,j,k,3) + (half - dth*s(i ,j,k,1)/hx) * slopex(i ,j,k,3) c $ + dth * lapu(i ,j,k,3) / rho(i,j,k) wprgt = s(i+1,j,k,3) - (half + dth*s(i+1,j,k,1)/hx) * slopex(i+1,j,k,3) c $ + dth * lapu(i+1,j,k,3) / rho(i+1,j,k) vplft = s(i ,j,k,2) + (half - dth*s(i ,j,k,1)/hx) * slopex(i ,j,k,2) c $ + dth * lapu(i ,j,k,2) / rho(i,j,k) vprgt = s(i+1,j,k,2) - (half + dth*s(i+1,j,k,1)/hx) * slopex(i+1,j,k,2) c $ + dth * lapu(i+1,j,k,2) / rho(i+1,j,k) uplft = s(i ,j,k,1) + (half - dth*s(i ,j,k,1)/hx) * slopex(i ,j,k,1) c $ + dth * lapu(i ,j,k,1) / rho(i,j,k) uprgt = s(i+1,j,k,1) - (half + dth*s(i+1,j,k,1)/hx) * slopex(i+1,j,k,1) c $ + dth * lapu(i+1,j,k,1) / rho(i+1,j,k) ltp0 = (i .eq. ie .and. bcx_hi .eq. INLET) uprgt = cvmgt(s(ie+1,j,k,1),uprgt,ltp0) uplft = cvmgt(s(ie+1,j,k,1),uplft,ltp0) vprgt = cvmgt(s(ie+1,j,k,2),vprgt,ltp0) vplft = cvmgt(s(ie+1,j,k,2),vplft,ltp0) wprgt = cvmgt(s(ie+1,j,k,3),wprgt,ltp0) wplft = cvmgt(s(ie+1,j,k,3),wplft,ltp0) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL) uprgt = cvmgt(zero,uprgt,ltp0) uplft = cvmgt(zero,uplft,ltp0) vprgt = cvmgt(vplft,vprgt,ltp0) wprgt = cvmgt(wplft,wprgt,ltp0) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL .and. visc_coef .gt. zero) vprgt = cvmgt(zero,vprgt,ltp0) vplft = cvmgt(zero,vplft,ltp0) wprgt = cvmgt(zero,wprgt,ltp0) wplft = cvmgt(zero,wplft,ltp0) uplus = cvmgp(uplft,uprgt,utrans(i+1,j,k)) uavg = half * (uplft + uprgt) uplus = cvmgt(uplus, uavg, abs(utrans(i+1,j,k)) .gt. eps) vplus = cvmgp(vplft,vprgt,utrans(i+1,j,k)) vavg = half * (vplft + vprgt) vplus = cvmgt(vplus, vavg, abs(utrans(i+1,j,k)) .gt. eps) wplus = cvmgp(wplft,wprgt,utrans(i+1,j,k)) wavg = half * (wplft + wprgt) wplus = cvmgt(wplus, wavg, abs(utrans(i+1,j,k)) .gt. eps) wmrgt = s(i ,j,k,3) - (half + dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,3) c $ + dth * lapu(i ,j,k,3) / rho(i ,j,k) wmlft = s(i-1,j,k,3) + (half - dth*s(i-1,j,k,1)/hx)*slopex(i-1,j,k,3) c $ + dth * lapu(i-1,j,k,3) / rho(i-1,j,k) vmrgt = s(i ,j,k,2) - (half + dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,2) c $ + dth * lapu(i ,j,k,2) / rho(i ,j,k) vmlft = s(i-1,j,k,2) + (half - dth*s(i-1,j,k,1)/hx)*slopex(i-1,j,k,2) c $ + dth * lapu(i-1,j,k,2) / rho(i-1,j,k) umrgt = s(i ,j,k,1) - (half + dth*s(i ,j,k,1)/hx)*slopex(i ,j,k,1) c $ + dth * lapu(i ,j,k,1) / rho(i ,j,k) umlft = s(i-1,j,k,1) + (half - dth*s(i-1,j,k,1)/hx)*slopex(i-1,j,k,1) c $ + dth * lapu(i-1,j,k,1) / rho(i-1,j,k) ltm0 = (i .eq. is .and. bcx_lo .eq. INLET) umrgt = cvmgt(s(is-1,j,k,1),umrgt,ltm0) umlft = cvmgt(s(is-1,j,k,1),umlft,ltm0) vmrgt = cvmgt(s(is-1,j,k,2),vmrgt,ltm0) vmlft = cvmgt(s(is-1,j,k,2),vmlft,ltm0) wmrgt = cvmgt(s(is-1,j,k,3),wmrgt,ltm0) wmlft = cvmgt(s(is-1,j,k,3),wmlft,ltm0) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL) umrgt = cvmgt(zero ,umrgt,ltm0) umlft = cvmgt(zero ,umlft,ltm0) vmlft = cvmgt(vmrgt,vmlft,ltm0) wmlft = cvmgt(wmrgt,wmlft,ltm0) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL .and. $ visc_coef .gt. zero) vmrgt = cvmgt(zero,vmrgt,ltm0) vmlft = cvmgt(zero,vmlft,ltm0) wmrgt = cvmgt(zero,wmrgt,ltm0) wmlft = cvmgt(zero,wmlft,ltm0) uminus = cvmgp(umlft,umrgt,utrans(i,j,k)) uavg = half * (umlft + umrgt) uminus = cvmgt(uminus, uavg, abs(utrans(i,j,k)) .gt. eps) vminus = cvmgp(vmlft,vmrgt,utrans(i,j,k)) vavg = half * (vmlft + vmrgt) vminus = cvmgt(vminus, vavg, abs(utrans(i,j,k)) .gt. eps) wminus = cvmgp(wmlft,wmrgt,utrans(i,j,k)) wavg = half * (wmlft + wmrgt) wminus = cvmgt(wminus, wavg, abs(utrans(i,j,k)) .gt. eps) utr = half * (utrans(i,j,k)+utrans(i+1,j,k))*(uplus - uminus) / hx vtr = half * (utrans(i,j,k)+utrans(i+1,j,k))*(vplus - vminus) / hx wtr = half * (utrans(i,j,k)+utrans(i+1,j,k))*(wplus - wminus) / hx c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Y-DIRECTION c ****************************************************************** wpbot = s(i,j ,k,3) + (half - dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,3) c $ + dth * lapu(i,j ,k,3) / rho(i,j,k) wptop = s(i,j+1,k,3) - (half + dth*s(i,j+1,k,2)/hy)*slopey(i,j+1,k,3) c $ + dth * lapu(i,j+1,k,3) / rho(i,j+1,k) vpbot = s(i,j ,k,2) + (half - dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,2) c $ + dth * lapu(i,j ,k,2) / rho(i,j,k) vptop = s(i,j+1,k,2) - (half + dth*s(i,j+1,k,2)/hy)*slopey(i,j+1,k,2) c $ + dth * lapu(i,j+1,k,2) / rho(i,j+1,k) upbot = s(i,j ,k,1) + (half - dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,1) c $ + dth * lapu(i, j,k,1) / rho(i,j,k) uptop = s(i,j+1,k,1) - (half + dth*s(i,j+1,k,2)/hy)*slopey(i,j+1,k,1) c $ + dth * lapu(i,j+1,k,1) / rho(i,j+1,k) ltp0 = (j .eq. je .and. bcy_hi .eq. INLET) wptop = cvmgt(s(i,je+1,k,3),wptop,ltp0) wpbot = cvmgt(s(i,je+1,k,3),wpbot,ltp0) vptop = cvmgt(s(i,je+1,k,2),vptop,ltp0) vpbot = cvmgt(s(i,je+1,k,2),vpbot,ltp0) uptop = cvmgt(s(i,je+1,k,1),uptop,ltp0) upbot = cvmgt(s(i,je+1,k,1),upbot,ltp0) ltp0 = (j .eq. je .and. bcy_hi .eq. WALL) vptop = cvmgt(zero,vptop,ltp0) vpbot = cvmgt(zero,vpbot,ltp0) uptop = cvmgt(upbot,uptop,ltp0) wptop = cvmgt(wpbot,wptop,ltp0) ltp0 = (j .eq. je .and. bcy_hi .eq. WALL .and. visc_coef .gt. zero) uptop = cvmgt(zero,uptop,ltp0) upbot = cvmgt(zero,upbot,ltp0) wptop = cvmgt(zero,wptop,ltp0) wpbot = cvmgt(zero,wpbot,ltp0) uplus = cvmgp(upbot,uptop,vtrans(i,j+1,k)) uavg = half * (upbot + uptop) uplus = cvmgt(uplus, uavg, abs(vtrans(i,j+1,k)) .gt. eps) vplus = cvmgp(vpbot,vptop,vtrans(i,j+1,k)) vavg = half * (vpbot + vptop) vplus = cvmgt(vplus, vavg, abs(vtrans(i,j+1,k)) .gt. eps) wplus = cvmgp(wpbot,wptop,vtrans(i,j+1,k)) wavg = half * (wpbot + wptop) wplus = cvmgt(wplus, wavg, abs(vtrans(i,j+1,k)) .gt. eps) wmtop = s(i,j ,k,3) - (half + dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,3) c $ + dth * lapu(i,j ,k,3) / rho(i,j,k) wmbot = s(i,j-1,k,3) + (half - dth*s(i,j-1,k,2)/hy)*slopey(i,j-1,k,3) c $ + dth * lapu(i,j-1,k,3) / rho(i,j-1,k) vmtop = s(i,j ,k,2) - (half + dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,2) c $ + dth * lapu(i,j ,k,2) / rho(i,j,k) vmbot = s(i,j-1,k,2) + (half - dth*s(i,j-1,k,2)/hy)*slopey(i,j-1,k,2) c $ + dth * lapu(i,j-1,k,2) / rho(i,j-1,k) umtop = s(i,j ,k,1) - (half + dth*s(i,j ,k,2)/hy)*slopey(i,j ,k,1) c $ + dth * lapu(i,j ,k,1) / rho(i,j,k) umbot = s(i,j-1,k,1) + (half - dth*s(i,j-1,k,2)/hy)*slopey(i,j-1,k,1) c $ + dth * lapu(i,j-1,k,1) / rho(i,j-1,k) ltm0 = (j .eq. js .and. bcy_lo .eq. INLET) wmtop = cvmgt(s(i,js-1,k,3),wmtop,ltm0) wmbot = cvmgt(s(i,js-1,k,3),wmbot,ltm0) vmtop = cvmgt(s(i,js-1,k,2),vmtop,ltm0) vmbot = cvmgt(s(i,js-1,k,2),vmbot,ltm0) umtop = cvmgt(s(i,js-1,k,1),umtop,ltm0) umbot = cvmgt(s(i,js-1,k,1),umbot,ltm0) ltm0 = (j .eq. js .and. bcy_lo .eq. WALL) vmtop = cvmgt(zero ,vmtop,ltm0) vmbot = cvmgt(zero ,vmbot,ltm0) umbot = cvmgt(umtop,umbot,ltm0) wmbot = cvmgt(wmtop,wmbot,ltm0) ltm0 = (j .eq. js .and. bcy_lo .eq. WALL .and. visc_coef .gt. zero) umtop = cvmgt(zero,umtop,ltm0) umbot = cvmgt(zero,umbot,ltm0) wmtop = cvmgt(zero,wmtop,ltm0) wmbot = cvmgt(zero,wmbot,ltm0) uminus = cvmgp(umbot,umtop,vtrans(i,j,k)) uavg = half * (umbot + umtop) uminus = cvmgt(uminus, uavg, abs(vtrans(i,j,k)) .gt. eps) vminus = cvmgp(vmbot,vmtop,vtrans(i,j,k)) vavg = half * (vmbot + vmtop) vminus = cvmgt(vminus, vavg, abs(vtrans(i,j,k)) .gt. eps) wminus = cvmgp(wmbot,wmtop,vtrans(i,j,k)) wavg = half * (wmbot + wmtop) wminus = cvmgt(wminus, wavg, abs(vtrans(i,j,k)) .gt. eps) utr = utr + $ half * (vtrans(i,j,k)+vtrans(i,j+1,k))*(uplus - uminus) / hy vtr = vtr + $ half * (vtrans(i,j,k)+vtrans(i,j+1,k))*(vplus - vminus) / hy wtr = wtr + $ half * (vtrans(i,j,k)+vtrans(i,j+1,k))*(wplus - wminus) / hy c ****************************************************************** c MAKE DOWN AND UP STATES c ****************************************************************** ut = (lapu(i,j,k,1)-px(i,j,k))/rho(i,j,k) - utr + force(i,j,k,1) vt = (lapu(i,j,k,2)-py(i,j,k))/rho(i,j,k) - vtr + force(i,j,k,2) wt = (lapu(i,j,k,3)-pz(i,j,k))/rho(i,j,k) - wtr + force(i,j,k,3) wbardth = dth*s(i,j,k,3)/hz s_d(k+1,1)= s(i,j,k,1) + (half-wbardth)*slopez(i,j,k,1) + dth*ut s_u(k ,1)= s(i,j,k,1) - (half+wbardth)*slopez(i,j,k,1) + dth*ut s_d(k+1,2)= s(i,j,k,2) + (half-wbardth)*slopez(i,j,k,2) + dth*vt s_u(k ,2)= s(i,j,k,2) - (half+wbardth)*slopez(i,j,k,2) + dth*vt s_d(k+1,3)= s(i,j,k,3) + (half-wbardth)*slopez(i,j,k,3) + dth*wt s_u(k ,3)= s(i,j,k,3) - (half+wbardth)*slopez(i,j,k,3) + dth*wt enddo if (bcz_lo .eq. PERIODIC) then s_d(ks ,1) = s_d(ke+1,1) s_d(ks ,2) = s_d(ke+1,2) s_d(ks ,3) = s_d(ke+1,3) elseif (bcz_lo .eq. WALL) then s_d(ks ,1) = s_u(ks ,1) s_d(ks ,2) = s_u(ks ,2) s_d(ks ,3) = zero s_u(ks ,3) = zero elseif (bcz_lo .eq. INLET) then s_d(ks ,1) = s(i,j,ks-1,1) s_d(ks ,2) = s(i,j,ks-1,2) s_d(ks ,3) = s(i,j,ks-1,3) elseif (bcz_lo .eq. OUTLET) then s_d(ks ,1) = s_u(ks ,1) s_d(ks ,2) = s_u(ks ,2) s_d(ks ,3) = s_u(ks ,3) else print *,'bogus bcz_lo in mkvelflux ',bcz_lo stop endif if (bcz_hi .eq. PERIODIC) then s_u(ke+1,1) = s_u(ks ,1) s_u(ke+1,2) = s_u(ks ,2) s_u(ke+1,3) = s_u(ks ,3) elseif (bcz_hi .eq. WALL) then s_u(ke+1,1) = s_d(ke+1,1) s_u(ke+1,2) = s_d(ke+1,2) s_d(ke+1,3) = zero s_u(ke+1,3) = zero elseif (bcz_hi .eq. INLET) then s_u(ke+1,1) = s(i,j,ke+1,1) s_u(ke+1,2) = s(i,j,ke+1,2) s_u(ke+1,3) = s(i,j,ke+1,3) elseif (bcz_hi .eq. OUTLET) then s_u(ke+1,1) = s_d(ke+1,1) s_u(ke+1,2) = s_d(ke+1,2) s_u(ke+1,3) = s_d(ke+1,3) else print *,'bogus bcz_hi in mkvelflux ',bcz_hi stop endif do n = 1,3 do k = ks, ke+1 sedgez(i,j,k,n)=cvmgp(s_d(k,n),s_u(k,n),wadv(i,j,k)) savg = half*(s_d(k,n) + s_u(k,n)) sedgez(i,j,k,n)=cvmgt(savg,sedgez(i,j,k,n),abs(wadv(i,j,k)) .lt. eps) enddo enddo if ((visc_coef .gt. zero) .and. (bcz_lo .eq. WALL)) then sedgez(i,j,ks ,1) = zero sedgez(i,j,ks ,2) = zero sedgez(i,j,ks ,3) = zero endif if ((visc_coef .gt. zero) .and. (bcz_hi .eq. WALL)) then sedgez(i,j,ke+1,1) = zero sedgez(i,j,ke+1,2) = zero sedgez(i,j,ke+1,3) = zero endif enddo enddo return end ccseapps-2.5/CCSEApps/varden3d/mkadvvel.F0000644000175000017500000006523511634153073021320 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKADVVEL ** c ** Predict normal edge velocities to be MAC-projected and used c ** for advection velocities c *************************************************************** subroutine FORT_MKADVVEL(u,ux,uy,uz,v,vx,vy,vz,w,wx,wy,wz, $ rho,force,px,py,pz,lapu, $ dx,dt,DIMS, $ stleft,strght,stbot,sttop,stdwn,stup, $ uadv,vadv,wadv,utrans,vtrans,wtrans, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi, $ visc_coef) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T ux(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uy(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uz(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T vx(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T vy(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T vz(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T wx(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T wy(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T wz(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T px(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T py(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T pz(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T stleft(lo_1-1:hi_1+1) REAL_T strght(lo_1-1:hi_1+1) REAL_T stbot(lo_2-1:hi_2+1) REAL_T sttop(lo_2-1:hi_2+1) REAL_T stdwn(lo_3-1:hi_3+1) REAL_T stup(lo_3-1:hi_3+1) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wadv(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T utrans(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vtrans(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wtrans(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T dx(3) REAL_T dt integer bcx_lo, bcx_hi, bcy_lo, bcy_hi, bcz_lo, bcz_hi REAL_T visc_coef c Local variables REAL_T ubardth, vbardth, wbardth REAL_T hx,hy,hz,dth REAL_T uplus,uminus,vplus,vminus,wplus,wminus,ut,vt,wt REAL_T utr,vtr,wtr,savg REAL_T ulft,urgt REAL_T vtop,vbot REAL_T wtop,wbot REAL_T uptop,upbot,umtop,umbot,uplft,uprgt,umlft,umrgt REAL_T vptop,vpbot,vmtop,vmbot,vplft,vprgt,vmlft,vmrgt REAL_T wptop,wpbot,wmtop,wmbot,wplft,wprgt,wmlft,wmrgt REAL_T flgp,flgm REAL_T eps REAL_T umax,umin,vmax,vmin,wmax,wmin,rhomax,rhomin logical ltp,ltm,ltx,lty,ltz,ltm0,ltp0 integer i,j,k,is,js,ks,ie,je,ke eps = 1.0e-8 is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 dth = half*dt hx = dx(1) hy = dx(2) hz = dx(3) umax = -1.e30 vmax = -1.e30 wmax = -1.e30 rhomax = -1.e30 umin = 1.e30 vmin = 1.e30 wmin = 1.e30 rhomin = 1.e30 do k = lo_3, hi_3 do j = lo_2, hi_2 do i = lo_1, hi_1 umax = max(u(i,j,k),umax) umin = min(u(i,j,k),umin) vmax = max(v(i,j,k),vmax) vmin = min(v(i,j,k),vmin) wmax = max(w(i,j,k),wmax) wmin = min(w(i,j,k),wmin) rhomax = max(rho(i,j,k),rhomax) rhomin = min(rho(i,j,k),rhomin) enddo enddo enddo write(6,1000) umax,umin write(6,1001) vmax,vmin write(6,1002) wmax,wmin write(6,1003) rhomax,rhomin 1000 format(' U MAX/MIN : ',e21.14,2x,e21.14) 1001 format(' V MAX/MIN : ',e21.14,2x,e21.14) 1002 format(' W MAX/MIN : ',e21.14,2x,e21.14) 1003 format('RHO MAX/MIN : ',e21.14,2x,e21.14) c Create the z-velocity to be used for transverse derivatives. do k = ks,ke+1 do j = js,je do i = is,ie wtop = w(i,j,k ) - (half + dth*w(i,j,k )/hz) * wz(i,j,k ) c $ + dth * lapu(i,j,k ,3) / rho(i,j,k ) wbot = w(i,j,k-1) + (half - dth*w(i,j,k-1)/hz) * wz(i,j,k-1) c $ + dth * lapu(i,j,k-1,3) / rho(i,j,k-1) wtop = cvmgt(w(i,j,ks-1),wtop,k.eq.ks .and. BCZ_LO .eq. INLET) wtop = cvmgt(w(i,j,ke+1),wtop,k.eq.ke+1 .and. BCZ_HI .eq. INLET) wtop = cvmgt(zero ,wtop,k.eq.ks .and. BCZ_LO .eq. WALL) wtop = cvmgt(zero ,wtop,k.eq.ke+1 .and. BCZ_HI .eq. WALL) wbot = cvmgt(w(i,j,ks-1),wbot,k.eq.ks .and. BCZ_LO .eq. INLET) wbot = cvmgt(w(i,j,ke+1),wbot,k.eq.ke+1 .and. BCZ_HI .eq. INLET) wbot = cvmgt(zero ,wbot,k.eq.ks .and. BCZ_LO .eq. WALL) wbot = cvmgt(zero ,wbot,k.eq.ke+1 .and. BCZ_HI .eq. WALL) wtrans(i,j,k)=cvmgp(wbot,wtop,wbot+wtop) ltm = ( (wbot .le. zero .and. wtop .ge. zero) .or. $ (abs(wbot+wtop) .lt. eps)) wtrans(i,j,k) = cvmgt(zero,wtrans(i,j,k),ltm) enddo enddo enddo c Create the y-velocity to be used for transverse derivatives. do j = js,je+1 do k = ks,ke do i = is,ie vtop = v(i,j ,k) - (half + dth*v(i,j,k)/hy) * vy(i,j,k) c $ + dth * lapu(i,j ,k,2) / rho(i,j ,k) vbot = v(i,j-1,k) + (half - dth*v(i,j-1,k)/hy) * vy(i,j-1,k) c $ + dth * lapu(i,j-1,k,2) / rho(i,j-1,k) vtop = cvmgt(v(i,js-1,k),vtop,j.eq.js .and. BCY_LO .eq. INLET) vtop = cvmgt(v(i,je+1,k),vtop,j.eq.je+1 .and. BCY_HI .eq. INLET) vtop = cvmgt(zero ,vtop,j.eq.js .and. BCY_LO .eq. WALL) vtop = cvmgt(zero ,vtop,j.eq.je+1 .and. BCY_HI .eq. WALL) vbot = cvmgt(v(i,js-1,k),vbot,j.eq.js .and. BCY_LO .eq. INLET) vbot = cvmgt(v(i,je+1,k),vbot,j.eq.je+1 .and. BCY_HI .eq. INLET) vbot = cvmgt(zero ,vbot,j.eq.js .and. BCY_LO .eq. WALL) vbot = cvmgt(zero ,vbot,j.eq.je+1 .and. BCY_HI .eq. WALL) vtrans(i,j,k)=cvmgp(vbot,vtop,vbot+vtop) ltm = ( (vbot .le. zero .and. vtop .ge. zero) .or. $ (abs(vbot+vtop) .lt. eps)) vtrans(i,j,k) = cvmgt(zero,vtrans(i,j,k),ltm) enddo enddo enddo c Create the x-velocity to be used for transverse derivatives. do k = ks,ke do j = js,je do i = is,ie+1 urgt = u(i,j ,k) - (half + dth*u(i,j,k)/hx) * ux(i,j,k) c $ + dth * lapu(i ,j,k,1) / rho(i ,j,k) ulft = u(i-1,j,k) + (half - dth*u(i-1,j,k)/hx) * ux(i-1,j,k) c $ + dth * lapu(i-1,j,k,1) / rho(i-1,j,k) urgt = cvmgt(u(is-1,j,k),urgt,i.eq.is .and. BCX_LO .eq. INLET) urgt = cvmgt(u(ie+1,j,k),urgt,i.eq.ie+1 .and. BCX_HI .eq. INLET) urgt = cvmgt(zero ,urgt,i.eq.is .and. BCX_LO .eq. WALL) urgt = cvmgt(zero ,urgt,i.eq.ie+1 .and. BCX_HI .eq. WALL) ulft = cvmgt(u(is-1,j,k),ulft,i.eq.is .and. BCX_LO .eq. INLET) ulft = cvmgt(u(ie+1,j,k),ulft,i.eq.ie+1 .and. BCX_HI .eq. INLET) ulft = cvmgt(zero ,ulft,i.eq.is .and. BCX_LO .eq. WALL) ulft = cvmgt(zero ,ulft,i.eq.ie+1 .and. BCX_HI .eq. WALL) utrans(i,j,k) = cvmgp(ulft,urgt,ulft+urgt) ltm=( (ulft .le. zero .and. urgt .ge. zero) .or. $ (abs(ulft+urgt) .lt. eps) ) utrans(i,j,k) = cvmgt(zero,utrans(i,j,k),ltm) enddo enddo enddo c ::: loop for x fluxes do k = ks,ke do j = js,je do i = is,ie c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Y-DIRECTION c ****************************************************************** upbot = u(i,j ,k) + (half - dth*v(i,j ,k)/hy) * uy(i,j ,k) c $ + dth * lapu(i,j ,k,1) / rho(i,j ,k) uptop = u(i,j+1,k) - (half + dth*v(i,j+1,k)/hy) * uy(i,j+1,k) c $ + dth * lapu(i,j+1,k,1) / rho(i,j+1,k) uptop = cvmgt(u(i,je+1,k),uptop,j.eq.je .and. bcy_hi.eq.INLET) upbot = cvmgt(u(i,je+1,k),upbot,j.eq.je .and. bcy_hi.eq.INLET) uptop = cvmgt(upbot,uptop,j.eq.je .and. bcy_hi.eq.WALL) ltp0 = (j .eq. je .and. bcy_hi .eq. WALL .and. visc_coef .gt. zero) uptop = cvmgt(zero,uptop,ltp0) upbot = cvmgt(zero,upbot,ltp0) flgp=cvmgt(zero,one,abs(vtrans(i,j+1,k)).lt.eps) uplus = cvmgp(upbot,uptop,vtrans(i,j+1,k)) uplus = flgp * uplus + (one - flgp)*half*(uptop+upbot) umtop = u(i,j ,k) - (half + dth*v(i,j ,k)/hy) * uy(i,j,k) c $ + dth * lapu(i,j ,k,1) / rho(i,j ,k) umbot = u(i,j-1,k) + (half - dth*v(i,j-1,k)/hy) * uy(i,j-1,k) c $ + dth * lapu(i,j-1,k,1) / rho(i,j-1,k) umtop = cvmgt(u(i,js-1,k),umtop,j.eq.js .and. bcy_lo.eq.INLET) umbot = cvmgt(u(i,js-1,k),umbot,j.eq.js .and. bcy_lo.eq.INLET) umbot = cvmgt(umtop,umbot,j.eq.js .and. bcy_lo.eq.WALL) ltm0 = (j .eq. js .and. bcy_lo .eq. WALL .and. visc_coef .gt. zero) umtop = cvmgt(zero,umtop,ltm0) umbot = cvmgt(zero,umbot,ltm0) flgm=cvmgt(zero,one,abs(vtrans(i,j,k)).lt.eps) uminus = cvmgp(umbot,umtop,vtrans(i,j,k)) uminus = flgm * uminus + (one - flgm)*half*(umtop+umbot) utr = half * (vtrans(i,j,k)+vtrans(i,j+1,k))*(uplus - uminus) / hy c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Z-DIRECTION c ****************************************************************** upbot = u(i,j,k ) + (half - dth*w(i,j,k )/hz) * uz(i,j,k ) c $ + dth * lapu(i,j,k ,1) / rho(i,j,k ) uptop = u(i,j,k+1) - (half + dth*w(i,j,k+1)/hz) * uz(i,j,k+1) c $ + dth * lapu(i,j,k+1,1) / rho(i,j,k+1) uptop = cvmgt(u(i,j,ke+1),uptop,k.eq.ke .and. bcz_hi.eq.INLET) upbot = cvmgt(u(i,j,ke+1),upbot,k.eq.ke .and. bcz_hi.eq.INLET) uptop = cvmgt(upbot,uptop,k.eq.ke .and. bcz_hi.eq.WALL) ltp0 = (k .eq. ke .and. bcz_hi .eq. WALL .and. visc_coef .gt. zero) uptop = cvmgt(zero,uptop,ltp0) upbot = cvmgt(zero,upbot,ltp0) flgp=cvmgt(zero,one,abs(wtrans(i,j,k+1)).lt.eps) uplus = cvmgp(upbot,uptop,wtrans(i,j,k+1)) uplus = flgp * uplus + (one - flgp)*half*(uptop+upbot) umtop = u(i,j,k ) - (half + dth*w(i,j,k )/hz) * uz(i,j,k) c $ + dth * lapu(i,j,k ,1) / rho(i,j,k ) umbot = u(i,j,k-1) + (half - dth*w(i,j,k-1)/hz) * uz(i,j,k-1) c $ + dth * lapu(i,j,k-1,1) / rho(i,j,k-1) umtop = cvmgt(u(i,j,ks-1),umtop,k.eq.ks .and. bcz_lo.eq.INLET) umbot = cvmgt(u(i,j,ks-1),umbot,k.eq.ks .and. bcz_lo.eq.INLET) umbot = cvmgt(umtop,umbot,k.eq.ks .and. bcz_lo.eq.WALL) ltm0 = (k .eq. ks .and. bcz_lo .eq. WALL .and. visc_coef .gt. zero) umtop = cvmgt(zero,umtop,ltm0) umbot = cvmgt(zero,umbot,ltm0) flgm=cvmgt(zero,one,abs(wtrans(i,j,k)).lt.eps) uminus = cvmgp(umbot,umtop,wtrans(i,j,k)) uminus = flgm * uminus + (one - flgm)*half*(umtop+umbot) utr = utr + half * (wtrans(i,j,k)+wtrans(i,j,k+1))*(uplus - uminus) / hz c ****************************************************************** c ****************************************************************** ut = (lapu(i,j,k,1)-px(i,j,k))/rho(i,j,k) - utr + force(i,j,k,1) ubardth = dth*u(i,j,k)/hx stleft(i )= u(i,j,k) + (half-ubardth)*ux(i,j,k) + dth*ut strght(i-1)= u(i,j,k) - (half+ubardth)*ux(i,j,k) + dth*ut enddo if (bcx_lo .eq. PERIODIC) then stleft(is-1) = stleft(ie ) elseif (bcx_lo .eq. WALL) then stleft(is-1) = zero strght(is-1) = zero elseif (bcx_lo .eq. INLET) then stleft(is-1) = u(is-1,j,k) strght(is-1) = u(is-1,j,k) elseif (bcx_lo .eq. OUTLET) then stleft(is-1) = strght(is-1) else print *,'bogus bcx_lo in mkadvvel ',bcx_lo stop endif if (bcx_hi .eq. PERIODIC) then strght(ie ) = strght(is-1) elseif (bcx_hi .eq. WALL) then stleft(ie ) = zero strght(ie ) = zero elseif (bcx_hi .eq. INLET) then stleft(ie ) = u(ie+1,j,k) strght(ie ) = u(ie+1,j,k) elseif (bcx_hi .eq. OUTLET) then strght(ie ) = stleft(ie) else print *,'bogus bcx_hi in mkadvvel ',bcx_hi stop endif do i = is-1, ie savg = half*(strght(i) + stleft(i)) ltx = ( (stleft(i) .le. zero .and. $ strght(i) .ge. zero) .or. $ (abs(stleft(i) + strght(i)) .lt. eps) ) uadv(i+1,j,k)=cvmgp(stleft(i),strght(i),savg) uadv(i+1,j,k)=cvmgt(savg,uadv(i+1,j,k),ltx) enddo if (bcx_lo .eq. WALL) then uadv(is ,j,k) = zero endif if (bcx_hi .eq. WALL) then uadv(ie+1,j,k) = zero endif enddo enddo c ****************************************************************** c ****************************************************************** c ****************************************************************** c ::: loop for y fluxes do k = ks, ke do i = is, ie do j = js, je c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN X-DIRECTION c ****************************************************************** vplft = v(i ,j,k) + (half - dth*u(i ,j,k)/hx) * vx(i ,j,k) c $ + dth * lapu(i ,j,k,2) / rho(i ,j,k) vprgt = v(i+1,j,k) - (half + dth*u(i+1,j,k)/hx) * vx(i+1,j,k) c $ + dth * lapu(i+1,j,k,2) / rho(i+1,j,k) ltp0 = (i .eq. ie .and. bcx_hi .eq. INLET) vprgt = cvmgt(v(ie+1,j,k),vprgt,ltp0) vplft = cvmgt(v(ie+1,j,k),vplft,ltp0) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL) vprgt = cvmgt(vplft,vprgt,ltp0) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL .and. visc_coef .gt. zero) vprgt = cvmgt(zero,vprgt,ltp0) vplft = cvmgt(zero,vplft,ltp0) flgp=cvmgt(zero,one,abs(utrans(i+1,j,k)).lt.eps) vplus = cvmgp(vplft,vprgt,utrans(i+1,j,k)) vplus = flgp * vplus + (one - flgp)*half*(vprgt+vplft) vmrgt = v(i ,j,k) - (half + dth*u(i ,j,k)/hx) * vx(i ,j,k) c $ + dth * lapu(i ,j,k,2) / rho(i ,j,k) vmlft = v(i-1,j,k) + (half - dth*u(i-1,j,k)/hx) * vx(i-1,j,k) c $ + dth * lapu(i-1,j,k,2) / rho(i-1,j,k) ltm0 = (i .eq. is .and. bcx_lo .eq. INLET) vmrgt = cvmgt(v(is-1,j,k),vmrgt,ltm0) vmlft = cvmgt(v(is-1,j,k),vmlft,ltm0) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL) vmlft = cvmgt(vmrgt,vmlft,ltm0) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL .and. visc_coef .gt. zero) vmrgt = cvmgt(zero,vmrgt,ltm0) vmlft = cvmgt(zero,vmlft,ltm0) flgm=cvmgt(zero,one,abs(utrans(i,j,k)).lt.eps) vminus = cvmgp(vmlft,vmrgt,utrans(i,j,k)) vminus = flgm * vminus + (one - flgm)*half*(vmrgt+vmlft) vtr = half * (utrans(i,j,k)+utrans(i+1,j,k))*(vplus - vminus) / hx c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Z-DIRECTION c ****************************************************************** vplft = v(i,j,k ) + (half - dth*w(i,j,k )/hz) * vz(i,j,k ) c $ + dth * lapu(i,j,k ,2) / rho(i,j,k ) vprgt = v(i,j,k+1) - (half + dth*w(i,j,k+1)/hz) * vz(i,j,k+1) c $ + dth * lapu(i,j,k+1,2) / rho(i,j,k+1) ltp0 = (k .eq. ke .and. bcz_hi .eq. INLET) uptop = cvmgt(u(i,j,ke+1),uptop,ltp0) upbot = cvmgt(u(i,j,ke+1),upbot,ltp0) ltp0 = (k .eq. ke .and. bcz_hi .eq. WALL) vprgt = cvmgt(vplft,vprgt,ltp0) ltp0 = (k .eq. ke .and. bcz_hi .eq. WALL .and. visc_coef .gt. zero) vprgt = cvmgt(zero,vprgt,ltp0) vplft = cvmgt(zero,vplft,ltp0) flgp=cvmgt(zero,one,abs(wtrans(i,j,k+1)).lt.eps) vplus = cvmgp(vplft,vprgt,wtrans(i,j,k+1)) vplus = flgp * vplus + (one - flgp)*half*(vprgt+vplft) vmrgt = v(i,j,k ) - (half + dth*w(i,j,k )/hz) * vz(i,j,k ) c $ + dth * lapu(i,j,k ,2) / rho(i,j,k ) vmlft = v(i,j,k-1) + (half - dth*w(i,j,k-1)/hz) * vz(i,j,k-1) c $ + dth * lapu(i,j,k-1,2) / rho(i,j,k-1) ltm0 = (k .eq. ks .and. bcz_lo .eq. INLET) vmrgt = cvmgt(v(i,j,ks-1),vmrgt,ltm0) vmlft = cvmgt(v(i,j,ks-1),vmlft,ltm0) ltm0 = (k .eq. ks .and. bcz_lo .eq. WALL) vmlft = cvmgt(vmrgt,vmlft,ltm0) ltm0 = (k .eq. ks .and. bcz_lo .eq. WALL .and. visc_coef .gt. zero) vmrgt = cvmgt(zero,vmrgt,ltm0) vmlft = cvmgt(zero,vmlft,ltm0) flgm=cvmgt(zero,one,abs(wtrans(i,j,k)).lt.eps) vminus = cvmgp(vmlft,vmrgt,wtrans(i,j,k)) vminus = flgm * vminus + (one - flgm)*half*(vmrgt+vmlft) vtr = vtr + half * (wtrans(i,j,k)+wtrans(i,j,k+1))*(vplus - vminus) / hz c ****************************************************************** vt = (lapu(i,j,k,2)-py(i,j,k))/rho(i,j,k) - vtr + force(i,j,k,2) vbardth = dth*v(i,j,k)/hy stbot(j )= v(i,j,k) + (half-vbardth)*vy(i,j,k) + dth*vt sttop(j-1)= v(i,j,k) - (half+vbardth)*vy(i,j,k) + dth*vt enddo if (bcy_lo .eq. PERIODIC) then stbot(js-1) = stbot(je ) elseif (bcy_lo .eq. WALL) then stbot(js-1) = zero sttop(js-1) = zero elseif (bcy_lo .eq. INLET) then stbot(js-1) = v(i,js-1,k) sttop(js-1) = v(i,js-1,k) elseif (bcy_lo .eq. OUTLET) then stbot(js-1) = sttop(js-1) else print *,'bogus bcy_lo in mkadvvel ',bcy_lo stop endif if (bcy_hi .eq. PERIODIC) then sttop(je ) = sttop(js-1) elseif (bcy_hi .eq. WALL) then stbot(je ) = zero sttop(je ) = zero elseif (bcy_hi .eq. INLET) then sttop(je ) = v(i,je+1,k) sttop(je ) = v(i,je+1,k) elseif (bcy_hi .eq. OUTLET) then sttop(je ) = stbot(je) else print *,'bogus bcy_hi in mkadvvel ',bcy_hi stop endif do j = js-1, je savg = half*(stbot(j)+sttop(j)) lty = ( (stbot(j) .le. zero .and. sttop(j) .ge. zero) .or. $ (abs(stbot(j) + sttop(j)) .lt. eps) ) vadv(i,j+1,k)=cvmgp(stbot(j),sttop(j),savg) vadv(i,j+1,k)=cvmgt(savg,vadv(i,j+1,k),lty) enddo if (bcy_lo .eq. WALL) then vadv(i,js ,k) = zero endif if (bcy_hi .eq. WALL) then vadv(i,je+1,k) = zero endif enddo enddo c ****************************************************************** c ****************************************************************** c ****************************************************************** c ::: loop for z fluxes do j = js, je do i = is, ie do k = ks, ke c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN X-DIRECTION c ****************************************************************** wplft = w(i ,j,k) + (half - dth*u(i ,j,k)/hx) * wx(i ,j,k) c $ + dth * lapu(i ,j,k,3) / rho(i ,j,k) wprgt = w(i+1,j,k) - (half + dth*u(i+1,j,k)/hx) * wx(i+1,j,k) c $ + dth * lapu(i+1,j,k,3) / rho(i+1,j,k) ltp0 = (i .eq. ie .and. bcx_hi .eq. INLET) wprgt = cvmgt(w(ie+1,j,k),wprgt,ltp0) wplft = cvmgt(w(ie+1,j,k),wplft,ltp0) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL) wprgt = cvmgt(wplft,wprgt,ltp0) ltp0 = (i .eq. ie .and. bcx_hi .eq. WALL .and. visc_coef .gt. zero) wprgt = cvmgt(zero,wprgt,ltp0) wplft = cvmgt(zero,wplft,ltp0) flgp=cvmgt(zero,one,abs(utrans(i+1,j,k)).lt.eps) wplus = cvmgp(wplft,wprgt,utrans(i+1,j,k)) wplus = flgp * wplus + (one - flgp)*half*(wprgt+wplft) wmrgt = w(i ,j,k) - (half + dth*u(i ,j,k)/hx) * wx(i ,j,k) c $ + dth * lapu(i ,j,k,3) / rho(i ,j,k) wmlft = w(i-1,j,k) + (half - dth*u(i-1,j,k)/hx) * wx(i-1,j,k) c $ + dth * lapu(i-1,j,k,3) / rho(i-1,j,k) ltm0 = (i .eq. is .and. bcx_lo .eq. INLET) wmrgt = cvmgt(w(is-1,j,k),wmrgt,ltm0) wmlft = cvmgt(w(is-1,j,k),wmlft,ltm0) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL) wmlft = cvmgt(wmrgt,wmlft,ltm0) ltm0 = (i .eq. is .and. bcx_lo .eq. WALL .and. visc_coef .gt. zero) wmrgt = cvmgt(zero,wmrgt,ltm0) wmlft = cvmgt(zero,wmlft,ltm0) flgm=cvmgt(zero,one,abs(utrans(i,j,k)).lt.eps) wminus = cvmgp(wmlft,wmrgt,utrans(i,j,k)) wminus = flgm * wminus + (one - flgm)*half*(wmrgt+wmlft) wtr = half * (utrans(i,j,k)+utrans(i+1,j,k))*(wplus - wminus) / hx c ****************************************************************** c MAKE TRANSVERSE DERIVATIVES IN Y-DIRECTION c ****************************************************************** wpbot = w(i,j ,k) + (half - dth*v(i,j ,k)/hy) * wy(i,j ,k) c $ + dth * lapu(i,j ,k,3) / rho(i,j ,k) wptop = w(i,j+1,k) - (half + dth*v(i,j+1,k)/hy) * wy(i,j+1,k) c $ + dth * lapu(i,j+1,k,3) / rho(i,j+1,k) ltp0 = (j .eq. je .and. bcy_hi .eq. INLET) wptop = cvmgt(w(i,je+1,k),wptop,ltp0) wpbot = cvmgt(w(i,je+1,k),wpbot,ltp0) ltp0 = (j .eq. je .and. bcy_hi .eq. WALL) wptop = cvmgt(wpbot,wptop,ltp0) ltp0 = (j .eq. je .and. bcy_hi .eq. WALL .and. visc_coef .gt. zero) wptop = cvmgt(zero,wptop,ltp0) wpbot = cvmgt(zero,wpbot,ltp0) flgp=cvmgt(zero,one,abs(vtrans(i,j+1,k)).lt.eps) wplus = cvmgp(wpbot,wptop,vtrans(i,j+1,k)) wplus = flgp * wplus + (one - flgp)*half*(wptop+wpbot) wmtop = w(i,j ,k) - (half + dth*v(i,j ,k)/hy) * wy(i,j ,k) c $ + dth * lapu(i,j ,k,3) / rho(i,j ,k) wmbot = w(i,j-1,k) + (half - dth*v(i,j-1,k)/hy) * wy(i,j-1,k) c $ + dth * lapu(i,j-1,k,3) / rho(i,j-1,k) ltm0 = (j .eq. js .and. bcy_lo .eq. INLET) wmtop = cvmgt(w(i,js-1,k),wmtop,ltm0) wmbot = cvmgt(w(i,js-1,k),wmbot,ltm0) ltm0 = (j .eq. js .and. bcy_lo .eq. WALL) wmbot = cvmgt(wmtop,wmbot,ltm0) ltm0 = (j .eq. js .and. bcy_lo .eq. WALL .and. visc_coef .gt. zero) wmtop = cvmgt(zero,wmtop,ltm0) wmbot = cvmgt(zero,wmbot,ltm0) flgm=cvmgt(zero,one,abs(vtrans(i,j,k)).lt.eps) wminus = cvmgp(wmbot,wmtop,vtrans(i,j,k)) wminus = flgm * wminus + (one - flgm)*half*(wmtop+wmbot) wtr = wtr + half * (vtrans(i,j,k)+vtrans(i,j+1,k))*(wplus - wminus) / hy c ****************************************************************** wt = (lapu(i,j,k,3)-pz(i,j,k))/rho(i,j,k) - wtr + force(i,j,k,3) wbardth = dth*w(i,j,k)/hz stdwn(k )= w(i,j,k) + (half-wbardth)*wz(i,j,k) + dth*wt stup(k-1)= w(i,j,k) - (half+wbardth)*wz(i,j,k) + dth*wt enddo if (bcz_lo .eq. PERIODIC) then stdwn(ks-1) = stdwn(ke ) elseif (bcz_lo .eq. WALL) then stdwn(ks-1) = zero stup(ks-1) = zero elseif (bcz_lo .eq. INLET) then stdwn(ks-1) = w(i,j,ks-1) stup(ks-1) = w(i,j,ks-1) elseif (bcz_lo .eq. OUTLET) then stdwn(ks-1) = stup(ks-1) else print *,'bogus bcz_lo in mkadvvel ',bcz_lo stop endif if (bcz_hi .eq. PERIODIC) then stup(ke ) = stup(ks-1) elseif (bcz_hi .eq. WALL) then stdwn(ke ) = zero stup(ke ) = zero elseif (bcz_hi .eq. INLET) then stdwn(ke ) = w(i,j,ke+1) stup(ke ) = w(i,j,ke+1) elseif (bcz_hi .eq. OUTLET) then stup(ke ) = stdwn(ke) else print *,'bogus bcz_hi in mkadvvel ',bcz_hi stop endif do k = ks-1, ke savg = half*(stdwn(k)+stup(k)) ltz = ( (stdwn(k) .le. zero .and. stup(k) .ge. zero) .or. $ (abs(stdwn(k) + stup(k)) .lt. eps) ) wadv(i,j,k+1)=cvmgp(stdwn(k),stup(k),savg) wadv(i,j,k+1)=cvmgt(savg,wadv(i,j,k+1),ltz) enddo if (bcz_lo .eq. WALL) then wadv(i,j,ks ) = zero endif if (bcz_hi .eq. WALL) then wadv(i,j,ke+1) = zero endif enddo enddo return end ccseapps-2.5/CCSEApps/varden3d/probin20000644000175000017500000000015411634153073020663 0ustar amckinstryamckinstry $fortin prob_type = 2 xblob = 0.5 yblob = 0.5 zblob = 1.5 radblob = 0.2 denblob = 10. $end ccseapps-2.5/CCSEApps/varden3d/mkdivucc.F0000644000175000017500000000437311634153073021310 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKDIVUCC ** c ** Define the RHS of the cell-centered divergence constraint c *************************************************************** subroutine FORT_MKDIVUCC(divu_src,u,v,w,rho,time,dx,DIMS) implicit none integer DIMS REAL_T divu_src(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T time REAL_T dx(3) c Local variables integer i,j,k do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 divu_src(i,j,k) = zero enddo enddo enddo return end ccseapps-2.5/CCSEApps/varden3d/Grid.H0000644000175000017500000001675711634153073020403 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GRID_H_ #define _GRID_H_ #include #include #include #include #include #include enum StateNames { Xvel=0, Yvel, Zvel, Density, Tracer}; // //@Man: //@Doc: This class is called from main and handles all the work //@Memo: Handles all the time-stepping class Grid { protected: //@ManDoc: Pointer to a nodal projection operator hg_projector* proj; //@ManDoc: Pointer to a MAC projection operator mac_projector* macproj; //@ManDoc: Pointer to a solver for the Crank-Nicholson diffusive/viscous update diffuser* diffuse_op; //@ManDoc: Pointer to the old-time x-velocity Real* u; //@ManDoc: Pointer to the old-time y-velocity Real* v; //@ManDoc: Pointer to the old-time z-velocity Real* w; //@ManDoc: Pointer to the old-time density Real* rho; //@ManDoc: Pointer to the old-time x-velocity Real* un; //@ManDoc: Pointer to the new-time y-velocity Real* vn; //@ManDoc: Pointer to the new-time z-velocity Real* wn; //@ManDoc: Pointer to the new-time density Real* rhon; //@ManDoc: Pointer to the density at time (n+1/2) Real* rhohalf; //@ManDoc: Pointer to the x-component of pressure gradient Real* px; //@ManDoc: Pointer to the y-component of pressure gradient Real* py; //@ManDoc: Pointer to the z-component of pressure gradient Real* pz; //@ManDoc: Pointer to the normal advection velocity on x-faces Real *uadv; //@ManDoc: Pointer to the normal advection velocity on y-faces Real *vadv; //@ManDoc: Pointer to the normal advection velocity on z-faces Real *wadv; //@ManDoc: Pointer to the x-velocity used for transverse derivatives. Real *utrans; //@ManDoc: Pointer to the y-velocity used for transverse derivatives. Real *vtrans; //@ManDoc: Pointer to the z-velocity used for transverse derivatives. Real *wtrans; //@ManDoc: Order of the slope calculation (1st, 2nd, or 4th) static int slope_order; //@ManDoc: How many initial iterations to do static int init_iter; //@ManDoc:: fixed time step static Real fixed_dt; //@ManDoc: Mesh spacing in the x-direction Real _hx; //@ManDoc: Mesh spacing in the y-direction Real _hy; //@ManDoc: Mesh spacing in the z-direction Real _hz; //@ManDoc: File name of the checkpoint file to read from std::string restart_file; //@ManDoc: Read and parse the inputs file void parseInputs(); //@ManDoc: Build aliases to state variable components void buildLinks(); //@ManDoc: Restart calculation from checkpoint file void restart(std::string& filename, int& nstep, Real& time, Real& dt); Box prob_domain; Real prob_size[BL_SPACEDIM]; Real prob_lo[BL_SPACEDIM]; Real prob_hi[BL_SPACEDIM]; Real dx[BL_SPACEDIM]; std::string probin_file; FArrayBox state; FArrayBox staten; FArrayBox slopex; FArrayBox slopey; FArrayBox slopez; FArrayBox rhonph; FArrayBox pressure; FArrayBox gradp; FArrayBox force; FArrayBox scalforce; FArrayBox divu_src; FArrayBox visc; FArrayBox diff; FArrayBox edgex; FArrayBox edgey; FArrayBox edgez; /*@ManDoc: Array holds flags as to whether scalars should be conservatively or convectively updated */ Array is_conserv; /*@ManDoc: Array holds diffusion coefficients of advected scalars */ Array diff_coef; //@ManDoc: Coefficient of dynamic viscosity. Real visc_coef; //@ManDoc: Number of scalars, defined as N_STATE - NDIM int numscal; protected: //@ManDoc: Allocate and initialize state variables void initialInit(int& nstep, Real& time, Real& dt); //@ManDoc: Do all the work to advance state void timeStep(Real time, Real dt); //@ManDoc: Calculate the slopes of all state variables void getSlopes(int first_comp, int num_comp); //@ManDoc: Calculate the viscous terms for the momentum equations void getViscTerm(); //@ManDoc: Calculate the diffusive terms for the scalar update equations void getDiffTerm(); //@ManDoc: Calculate the pressure gradient void getGradP(); //@ManDoc: Define the forcing terms in the momentum equation void getForce(Real current_time); //@ManDoc: Define the forcing terms in the scalar equations void getScalForce(Real current_time); //@ManDoc: Create the edge-based half-time advection velocities void makeAdvVels(Real dt, Real time); //@ManDoc: Update the scalar quantities void updateScalars(Real dt, Real time); //@ManDoc: Update velocity void updateVelocity(Real dt, Real time); //@ManDoc: Calculate the half-time density = avg of rho and rhon void getRhoHalf(Real time, Real dt); public: //@ManDoc: Constructor Grid(std::string probin_file); //@ManDoc: Destructor ~Grid(); //@ManDoc: Calculate dt for the next time step Real estimateDt(Real & dt, Real cfl); //@ManDoc: Decide whether to init with initialInit or restart void init(int& nstep, Real& time, Real& dt); //@ManDoc: Perform the initial iterations to calculate an initial pressure void initialIter(Real time, Real dt); //@ManDoc: Call timeStep and swap staten with state. void advance(Real time, Real dt); //@ManDoc: Write a checkpoint file to be used for restart void writeCheckPoint(int nstep, Real time, Real dt, std::string& check_file_root); //@ManDoc: Write a pltfile to be used for viewing data void writePlotFile(int nstep, Real time, std::string& plot_file_root); //@ManDoc: Worker function to write a plotfile void writePlotFile(std::string& dir, std::ostream& HeaderFile, int nstep, Real time); //@ManDoc: Keep track of which style plotfiles you are using std::string thePlotFileType(); //@ManDoc: Derive the necesary quantity for the contour plots and plt files void deriveData(FArrayBox& data, const std::string& varname, Real time); //@ManDoc: Return the cell size const Real* cellSize() const { return dx; } //@ManDoc: Return the problem size const Real* probSize() const { return prob_size; } //@ManDoc: Return the problem domain const Box& probDomain() { return prob_domain; } }; #endif ccseapps-2.5/CCSEApps/varden3d/inputs10000644000175000017500000002374111634153073020722 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 80 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin1 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the z-direction. # The negative sign indicates that the force acts in the negative # z-direction. gravity = 0.0 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ############################################################################# # Boundary conditions in the low z-direction. # If bcz_lo = 1, the domain is periodic in the z-direction. # If bcz_lo = 2, the domain has a solid (reflecting) walls in the low z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_lo = 3, the domain has inflow at low z. # If bcz_lo = 4, the domain has outflow at low z. bcz_lo = 1 ############################################################################# # Boundary conditions in the high z-direction. # If bcz_hi = 1, the domain is periodic in the z-direction. # If bcz_hi = 2, the domain has a solid (reflecting) wall in the high z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_hi = 3, the domain has inflow at high z. # If bcz_hi = 4, the domain has outflow at high z. bcz_hi = 1 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. grid.n_cell = 16 16 16 ############################################################################# # The physical coordinates of the low end of the domain. # This is read by the Grid class. grid.prob_lo = 0. 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. # This is read by the Grid class. grid.prob_hi = 1. 1. 1. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. # This is read by the Grid class. grid.visc_coef = 0.0 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ############################################################################# ccseapps-2.5/CCSEApps/varden3d/probdata.H0000644000175000017500000000311611634153073021273 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ integer prob_type REAL_T in_xvel, in_yvel, in_zvel, in_density, in_tracer REAL_T xblob, yblob, zblob, radblob, denblob, velfact common /probdt0/ prob_type common /probdt1/ in_xvel, in_yvel, in_zvel, in_density, in_tracer common /probdt2/ xblob, yblob, zblob, radblob, denblob, velfact ccseapps-2.5/CCSEApps/varden3d/HGPROJ_F.H0000644000175000017500000001757511634153073020753 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_RHSHG rhshg # define FORT_RESIDUAL reshg # define FORT_RELAX relax # define FORT_GRADHG gradhg # define FORT_INITSIG initsigb # define FORT_MKCOEFF mkcoeff # define FORT_COARSIG coarsigb # define FORT_RESTRICT coarsresb # define FORT_INTERP interphg # define FORT_PROJUHG projuhg # define FORT_PROJHGD projhgd # define FORT_SOLVEHG solvehg # define FORT_MAKESUM makesum #else #if defined (BL_FORT_USE_UNDERSCORE) # define FORT_RHSHG rhshg_ # define FORT_RESIDUAL reshg_ # define FORT_RELAX relax_ # define FORT_GRADHG gradhg_ # define FORT_INITSIG initsigb_ # define FORT_MKCOEFF mkcoeff_ # define FORT_COARSIG coarsigb_ # define FORT_RESTRICT coarsresb_ # define FORT_INTERP interphg_ # define FORT_PROJUHG projuhg_ # define FORT_PROJHGD projhgd_ # define FORT_SOLVEHG solvehg_ # define FORT_MAKESUM makesum_ #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_RHSHG RHSHG # define FORT_RESIDUAL RESHG # define FORT_RELAX RELAX # define FORT_GRADHG GRADHG # define FORT_INITSIG INITSIGB # define FORT_MKCOEFF MKCOEFF # define FORT_COARSIG COARSIGB # define FORT_RESTRICT COARSRESB # define FORT_INTERP INTERPHG # define FORT_PROJUHG PROJUHG # define FORT_PROJHGD PROJHGD # define FORT_SOLVEHG SOLVEHG # define FORT_MAKESUM MAKESUM #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_RHSHG rhshg # define FORT_RESIDUAL reshg # define FORT_RELAX relax # define FORT_GRADHG gradhg # define FORT_INITSIG initsigb # define FORT_MKCOEFF mkcoeff # define FORT_COARSIG coarsigb # define FORT_RESTRICT coarsresb # define FORT_INTERP interphg # define FORT_PROJUHG projuhg # define FORT_PROJHGD projhgd # define FORT_SOLVEHG solvehg # define FORT_MAKESUM makesum #endif extern "C" { void FORT_INITSIG(Real * sigma, Real * rho, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); void FORT_MKCOEFF(Real * coeff, Real * sigma, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3); void FORT_RHSHG(Real * source, Real * state, Real * divu_src, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, Real * rhsnorm, Real * time, Real * dt, Real * utemp1, Real * utemp2); void FORT_GRADHG(Real * gradp, const int& glo_1, const int& glo_2, const int& glo_3, const int& ghi_1, const int& ghi_2, const int& ghi_3, Real * pressure, const int& plo_1, const int& plo_2, const int& plo_3, const int& phi_1, const int& phi_2, const int& phi_3, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, int * bcx_lo, int* bcx_hi, int* bcy_lo, int* bcy_hi, int * bcz_lo, int* bcz_hi); void FORT_RESIDUAL(Real * resid, Real * phi, Real * source, Real * coeff, Real * dgphi, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, Real * rnorm, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); void FORT_RELAX(Real * phi, Real * source, Real * coeff, Real * dgphi, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, int * nngsrb); void FORT_RESTRICT(Real * resid, Real * resid_crse, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, const int& loc_1, const int& loc_2, const int& loc_3, const int& hic_1, const int& hic_2, const int& hic_3, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); void FORT_COARSIG(Real * sigma, Real * sigmac, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, const int& loc_1, const int& loc_2, const int& loc_3, const int& hic_1, const int& hic_2, const int& hic_3, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); void FORT_INTERP(Real * temp, Real * phi_crse, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, const int& loc_1, const int& loc_2, const int& loc_3, const int& hic_1, const int& hic_2, const int& hic_3); void FORT_PROJUHG(Real * state, Real * pressure, Real * phi, Real * gradphi, Real * rho, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3); void FORT_SOLVEHG(Real * dest, Real * dest0, Real * source, Real * coeff, Real * sum, Real * r, Real * w, Real * z, Real * work, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * _hx, Real * _hy, Real * _hz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, int * maxiter, Real * norm, Real * norm0); void FORT_MAKESUM(Real * sum, Real * coeff, const int& lo_mg_1, const int& lo_mg_2, const int& lo_mg_3, const int& hi_mg_1, const int& hi_mg_2, const int& hi_mg_3, Real * _hx, Real * _hy, Real * _hz, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); }; #endif ccseapps-2.5/CCSEApps/varden3d/diffuser.cpp0000644000175000017500000002611211634153073021702 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #define ARLIM(x) x[0],x[1],x[2] int diffuser::numSmoothCoarsen = 2; int diffuser::numSmoothRefine = 2; // ************************************************************************ // ** constructor ** // ************************************************************************ diffuser::diffuser(const Box& Domain, Real * dx) : domain(Domain) { ParmParse pp("diff"); pp.get("tol",tol); pp.query("numSmoothCoarsen",numSmoothCoarsen); pp.query("numSmoothRefine",numSmoothRefine); _hx = dx[0]; _hy = dx[1]; _hz = dx[2]; } // ************************************************************************ // ** destructor ** // ************************************************************************ diffuser::~diffuser() { } // ************************************************************************ // ** solveVel ** // ************************************************************************ void diffuser::solveVel(FArrayBox * staten, FArrayBox * temp, Real * rho, Real mu, int n) { const int * lo = domain.smallEnd().getVect(); const int * hi = domain.bigEnd().getVect(); Real rhsnorm; diffuser_mg *solver; FArrayBox *source = new FArrayBox(domain,1); FArrayBox *sigma = new FArrayBox(BoxLib::grow(domain,1),1); FArrayBox *resid = new FArrayBox(domain,1); FORT_INITSIGV(sigma->dataPtr(),rho,&mu,ARLIM(lo),ARLIM(hi)); Real * uinx_lo = new Real[(domain.length()[1]+2)*(domain.length()[2]+2)]; Real * uinx_hi = new Real[(domain.length()[1]+2)*(domain.length()[2]+2)]; Real * uiny_lo = new Real[(domain.length()[0]+2)*(domain.length()[2]+2)]; Real * uiny_hi = new Real[(domain.length()[0]+2)*(domain.length()[2]+2)]; Real * uinz_lo = new Real[(domain.length()[0]+2)*(domain.length()[1]+2)]; Real * uinz_hi = new Real[(domain.length()[0]+2)*(domain.length()[1]+2)]; FORT_RHSNORM(staten->dataPtr(n),source->dataPtr(), ARLIM(lo),ARLIM(hi),&rhsnorm, uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi); std::cout << "Viscous RHS is " << rhsnorm << std::endl; if (rhsnorm > tol) { solver = new diffuser_mg(domain,temp,source,resid,sigma, uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi, _hx,_hy,_hz,0); solver->solve(tol*rhsnorm,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; } delete source; delete resid; delete sigma; delete uinx_lo; delete uinx_hi; delete uiny_lo; delete uiny_hi; delete uinz_lo; delete uinz_hi; } // ************************************************************************ // ** solveScal ** // ************************************************************************ void diffuser::solveScal(FArrayBox * staten, FArrayBox * temp, Real mu, int n) { const int * lo = domain.smallEnd().getVect(); const int * hi = domain.bigEnd().getVect(); Real rhsnorm; diffuser_mg *solver; FArrayBox *source = new FArrayBox(domain,1); FArrayBox *sigma = new FArrayBox(BoxLib::grow(domain,1),1); FArrayBox *resid = new FArrayBox(domain,1); sigma->setVal(mu); Real * uinx_lo = new Real[(domain.length()[1]+2)*(domain.length()[2]+2)]; Real * uinx_hi = new Real[(domain.length()[1]+2)*(domain.length()[2]+2)]; Real * uiny_lo = new Real[(domain.length()[0]+2)*(domain.length()[2]+2)]; Real * uiny_hi = new Real[(domain.length()[0]+2)*(domain.length()[2]+2)]; Real * uinz_lo = new Real[(domain.length()[0]+2)*(domain.length()[1]+2)]; Real * uinz_hi = new Real[(domain.length()[0]+2)*(domain.length()[1]+2)]; FORT_RHSNORM(staten->dataPtr(n),source->dataPtr(), ARLIM(lo),ARLIM(hi),&rhsnorm, uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi); std::cout << "Diffusive RHS is " << rhsnorm << std::endl; if (rhsnorm > tol) { solver = new diffuser_mg(domain,temp,source,resid,sigma, uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi, _hx,_hy,_hz,0); solver->solve(tol*rhsnorm,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; } delete source; delete resid; delete sigma; delete uinx_lo; delete uinx_hi; delete uiny_lo; delete uiny_hi; delete uinz_lo; delete uinz_hi; } // ************************************************************************ // ** constructor ** // ************************************************************************ diffuser_mg::diffuser_mg(const Box & Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Resid, FArrayBox * Sigma, Real * Uinx_lo, Real * Uinx_hi, Real * Uiny_lo, Real * Uiny_hi, Real * Uinz_lo, Real * Uinz_hi, Real Hx, Real Hy, Real Hz, int Level) : multigrid(Domain, Phi, Source, Resid, Hx, Hy, Hz) { uinx_lo = Uinx_lo; uinx_hi = Uinx_hi; uiny_lo = Uiny_lo; uiny_hi = Uiny_hi; uinz_lo = Uinz_lo; uinz_hi = Uinz_hi; sigma = Sigma; level = Level; // create next (coarser) level and set overrelaxation parameter const IntVect& len = domain.length(); if ( (len[0]&1) != 0 || (len[1]&1) != 0 || (len[2]&1) != 0) { cgwork = new FArrayBox(domain,3); Next = NULL; } else if (len[0] < 4 || len[1] < 4 || len[2] < 4) { cgwork = new FArrayBox(domain,3); Next = NULL; } else { cgwork = NULL; Box newdomain = BoxLib::coarsen(domain,2); FArrayBox* newphi = new FArrayBox(BoxLib::grow(newdomain,1),1); newphi->setVal(0.0); const int * loc_mg = newdomain.smallEnd().getVect(); const int * hic_mg = newdomain.bigEnd().getVect(); Real newhx = 2.0*_hx; Real newhy = 2.0*_hy; Real newhz = 2.0*_hz; FArrayBox* newsource = new FArrayBox(newdomain,1); FArrayBox* newresid = new FArrayBox(newdomain,1); FArrayBox* newsigma = new FArrayBox(BoxLib::grow(newdomain,1),1); FORT_COARSIGV(sigma->dataPtr(),newsigma->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg), ARLIM(loc_mg),ARLIM(hic_mg)); Real * newuinx_lo = new Real[(newdomain.length()[1]+2)* (newdomain.length()[2]+2)]; Real * newuinx_hi = new Real[(newdomain.length()[1]+2)* (newdomain.length()[2]+2)]; Real * newuiny_lo = new Real[(newdomain.length()[0]+2)* (newdomain.length()[2]+2)]; Real * newuiny_hi = new Real[(newdomain.length()[0]+2)* (newdomain.length()[2]+2)]; Real * newuinz_lo = new Real[(newdomain.length()[1]+2)* (newdomain.length()[2]+2)]; Real * newuinz_hi = new Real[(newdomain.length()[1]+2)* (newdomain.length()[2]+2)]; Next = new diffuser_mg(newdomain, newphi, newsource, newresid, newsigma, newuinx_lo, newuinx_hi, newuiny_lo, newuiny_hi, newuinz_lo, newuinz_hi, newhx, newhy, newhz, level-1); } next = Next; } // ************************************************************************ // ** destructor ** // ************************************************************************ diffuser_mg::~diffuser_mg() { if (Next != NULL) { delete Next->phi; delete Next->source; delete Next->resid; delete Next->uinx_lo; delete Next->uinx_hi; delete Next->uiny_lo; delete Next->uiny_hi; delete Next->uinz_lo; delete Next->uinz_hi; delete Next->sigma; delete Next; } delete cgwork; } // ************************************************************************ // ** residual ** // ************************************************************************ Real diffuser_mg::residual() { Real rnorm; FORT_RESID(resid->dataPtr(),phi->dataPtr(),source->dataPtr(), sigma->dataPtr(),uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi, ARLIM(lo_mg),ARLIM(hi_mg),&_hx,&_hy,&_hz,&rnorm, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi,&level); return rnorm; } // ************************************************************************ // ** step ** // ************************************************************************ void diffuser_mg::step(int nngsrb) { FORT_GSRBV(phi->dataPtr(),source->dataPtr(), sigma->dataPtr(), uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi, ARLIM(lo_mg),ARLIM(hi_mg),&_hx,&_hy,&_hz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &level,&nngsrb); } // ************************************************************************ // ** Restrict ** // ************************************************************************ void diffuser_mg::Restrict() { const int * loc_mg = next->domain.smallEnd().getVect(); const int * hic_mg = next->domain.bigEnd().getVect(); FORT_RESTRICT(resid->dataPtr(), next->source->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),ARLIM(loc_mg),ARLIM(hic_mg)); } // ************************************************************************ // ** interpolate ** // ************************************************************************ void diffuser_mg::interpolate() { const int * loc_mg = next->domain.smallEnd().getVect(); const int * hic_mg = next->domain.bigEnd().getVect(); FORT_INTERPOLATE(phi->dataPtr(), next->phi->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),ARLIM(loc_mg),ARLIM(hic_mg)); } ccseapps-2.5/CCSEApps/varden3d/mkscalforce.F0000644000175000017500000000417311634153073021772 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKFORCE ** c ** Define the forcing terms in the momentum equation c *************************************************************** subroutine FORT_MKSCALFORCE(force,s,time,dx,DIMS,numscal) implicit none integer DIMS integer numscal REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T time REAL_T dx(3) c Local variables integer i,j,k,n do n = 1,numscal do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 force(i,j,k,n) = zero enddo enddo enddo enddo return end ccseapps-2.5/CCSEApps/varden3d/scalupd.F0000644000175000017500000000760411634153073021136 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** SCALUPD ** c ** Update the scalars using conservative or convective differencing of fluxes c ************************************************************************* subroutine scalupd(s,sn,sedgex,sedgey,sedgez,uadv,vadv,wadv,diff,force, $ DIMS,dx,dt,is_conserv,numscal) implicit none integer DIMS integer numscal REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T sn(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T sedgex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T sedgey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T sedgez(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wadv(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T diff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numscal) REAL_T dx(3) REAL_T dt integer is_conserv(numscal) c Local variables REAL_T divsu REAL_T uconv REAL_T vconv REAL_T wconv integer i,j,k,n do n = 1, numscal if (is_conserv(n) .eq. 1) then do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 divsu = ( sedgex(i+1,j,k,n)*uadv(i+1,j,k) - $ sedgex(i ,j,k,n)*uadv(i ,j,k) )/dx(1) $ + ( sedgey(i,j+1,k,n)*vadv(i,j+1,k) - $ sedgey(i,j ,k,n)*vadv(i,j ,k) )/dx(2) $ + ( sedgez(i,j,k+1,n)*wadv(i,j,k+1) - $ sedgez(i,j,k ,n)*wadv(i,j,k ) )/dx(3) sn(i,j,k,n) = s(i,j,k,n) - dt*divsu + half*dt*diff(i,j,k,n)+dt*force(i,j,k,n) enddo enddo enddo else do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 uconv = half * (uadv(i+1,j,k) + uadv(i,j,k)) vconv = half * (vadv(i,j+1,k) + vadv(i,j,k)) wconv = half * (wadv(i,j,k+1) + wadv(i,j,k)) divsu = uconv * (sedgex(i+1,j,k,n) - sedgex(i,j,k,n)) / dx(1) + $ vconv * (sedgey(i,j+1,k,n) - sedgey(i,j,k,n)) / dx(2) + $ wconv * (sedgez(i,j,k+1,n) - sedgez(i,j,k,n)) / dx(3) sn(i,j,k,n) = s(i,j,k,n) - dt*divsu + half*dt*diff(i,j,k,n) + dt*force(i,j,k,n) enddo enddo enddo endif enddo return end ccseapps-2.5/CCSEApps/varden3d/GRID_F.H0000644000175000017500000003160611634153073020476 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_LANG_FORT # define FORT_INITDATA initdata # define FORT_PROBINIT probinit # define FORT_DERVORT dervort # define FORT_DERAVGP deravgp # define FORT_DERIVE derive # define FORT_CMPDT cmpdt # define FORT_SLOPEX fslopex # define FORT_SLOPEY fslopey # define FORT_SLOPEZ fslopez # define FORT_LAPLAC laplac # define FORT_MKFORCE mkforce # define FORT_MKSCALFORCE mkscalforce # define FORT_MKDIVUCC mkdivucc # define FORT_MKDIVUNOD mkdivunod # define FORT_MKADVVEL mkadvvel # define FORT_MKVELFLUX mkvelflux # define FORT_MKSCAFLUX mkscaflux # define FORT_SCALUPD scalupd # define FORT_VELUPD velupd # define FORT_SETVELBC setvelbc # define FORT_SETCELLVELBC setcellvelbc # define FORT_SETSCALBC setscalbc #else #if defined (BL_FORT_USE_UNDERSCORE) # define FORT_INITDATA initdata_ # define FORT_PROBINIT probinit_ # define FORT_DERVORT dervort_ # define FORT_DERAVGP deravgp_ # define FORT_DERIVE derive_ # define FORT_CMPDT cmpdt_ # define FORT_SLOPEX fslopex_ # define FORT_SLOPEY fslopey_ # define FORT_SLOPEZ fslopez_ # define FORT_LAPLAC laplac_ # define FORT_MKFORCE mkforce_ # define FORT_MKSCALFORCE mkscalforce_ # define FORT_MKDIVUCC mkdivucc_ # define FORT_MKDIVUNOD mkdivunod_ # define FORT_MKADVVEL mkadvvel_ # define FORT_MKVELFLUX mkvelflux_ # define FORT_MKSCAFLUX mkscaflux_ # define FORT_SCALUPD scalupd_ # define FORT_VELUPD velupd_ # define FORT_SETVELBC setvelbc_ # define FORT_SETCELLVELBC setcellvelbc_ # define FORT_SETSCALBC setscalbc_ #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_INITDATA INITDATA # define FORT_PROBINIT PROBINIT # define FORT_DERVORT DERVORT # define FORT_DERAVGP DERAVGP # define FORT_DERIVE DERIVE # define FORT_CMPDT CMPDT # define FORT_SLOPEX FSLOPEX # define FORT_SLOPEY FSLOPEY # define FORT_SLOPEZ FSLOPEZ # define FORT_MKFORCE MKFORCE # define FORT_MKSCALFORCE MKSCALFORCE # define FORT_MKDIVUCC MKDIVUCC # define FORT_MKDIVUNOD MKDIVUNOD # define FORT_LAPLAC LAPLAC # define FORT_MKADVVEL MKADVVEL # define FORT_MKVELFLUX MKVELFLUX # define FORT_MKSCAFLUX MKSCAFLUX # define FORT_SCALUPD SCALUPD # define FORT_VELUPD VELUPD # define FORT_SETVELBC SETVELBC # define FORT_SETCELLVELBC SETCELLVELBC # define FORT_SETSCALBC SETSCALBC #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_INITDATA initdata # define FORT_PROBINIT probinit # define FORT_DERVORT dervort # define FORT_DERAVGP deravgp # define FORT_DERIVE derive # define FORT_CMPDT cmpdt # define FORT_SLOPEX fslopex # define FORT_SLOPEY fslopey # define FORT_SLOPEZ fslopez # define FORT_MKFORCE mkforce # define FORT_MKSCALFORCE mkscalforce # define FORT_MKDIVUCC mkdivucc # define FORT_MKDIVUNOD mkdivunod # define FORT_LAPLAC laplac # define FORT_MKADVVEL mkadvvel # define FORT_MKVELFLUX mkvelflux # define FORT_MKSCAFLUX mkscaflux # define FORT_SCALUPD scalupd # define FORT_VELUPD velupd # define FORT_SETVELBC setvelbc # define FORT_SETCELLVELBC setcellvelbc # define FORT_SETSCALBC setscalbc #endif extern "C" { void FORT_INITDATA(Real * u, Real * v, Real * w, Real * scalars, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, const Real * dx, Real * time, int * numscal); void FORT_PROBINIT (const int* name, const int* namelen); void FORT_DERVORT(Real* state, Real * derval, const int& derlo_1, const int& derlo_2, const int& derlo_3, const int& derhi_1, const int& derhi_2, const int& derhi_3, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, const Real* dx); void FORT_DERAVGP(Real* pressure, Real * dat, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3); void FORT_CMPDT(Real * u, Real * v, Real * w, Real * rho, Real * px, Real * py, Real * pz, Real * force, Real* dx, Real * dt, Real * cfl, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3); void FORT_SLOPEX(Real * s, Real * slx, Real * dfromx, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, int * nvar, int * bcx_lo, int * bcx_hi, int * slope_order); void FORT_SLOPEY(Real * s, Real * sly, Real * dfromy, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, int * nvar, int * bcy_lo, int * bcy_hi, int * slope_order); void FORT_SLOPEZ(Real * s, Real * slz, Real * dfromz, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, int * nvar, int * bcz_lo, int * bcz_hi, int * slope_order); void FORT_LAPLAC(Real * u, Real * lapu, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * dx,Real * diff_coef, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); void FORT_MKFORCE(Real * force, Real * u, Real * v, Real * w, Real * rho, Real * gravity, Real * visc_coef, Real * time, const Real * dx, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3); void FORT_MKSCALFORCE(Real * force, Real * s, Real * time, const Real * dx, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, int * numscal); void FORT_MKDIVUCC(Real * divu_src, Real * u, Real * v, Real * w, Real * rho, Real * time, const Real * dx, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3); void FORT_MKDIVUNOD(Real * divu_src, Real * u, Real * v, Real * w, Real * rho, Real * time, const Real * dx, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3); void FORT_MKADVVEL(Real * u, Real * ux, Real * uy, Real * uz, Real * v, Real * vx, Real * vy, Real * vz, Real * w, Real * wx, Real * wy, Real * wz, Real * rho, Real * force, Real * px, Real * py, Real * pz, Real * lapu, Real * dx, Real & dt, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * stlft, Real * strgt, Real * sttop, Real * stbot, Real * stdwn, Real * stup, Real * uedgex, Real * uedgey, Real * uedgez, Real * utrans, Real * vtrans, Real * wtrans, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, Real * visc); void FORT_SCALUPD(Real * s, Real * sn, Real * sedgex, Real * sedgey, Real * sedgez, Real * uadv, Real * vadv, Real * wadv, Real * diff_term, Real * scalforce, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * dx,Real * dt, int * is_conserv, int * numscal); void FORT_MKVELFLUX(Real * s, Real * sedgex, Real * sedgey, Real * sedgez, Real * slopex, Real * slopey, Real * slopez, Real * uadv, Real * vadv, Real * wadv, Real * utrans, Real * vtrans, Real * wtrans, Real * rho, Real * px, Real * py, Real * pz, Real * lapu, Real * s_l, Real * s_r, Real * s_b, Real * s_t, Real * s_d, Real * s_u, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * dx, Real * dt, Real * force, Real * visc_coef, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi); void FORT_MKSCAFLUX(Real * s, Real * sedgex, Real * sedgey, Real * sedgez, Real * slopex, Real * slopey, Real * slopez, Real * uadv, Real * vadv, Real * wadv, Real * utrans, Real * vtrans, Real * wtrans, Real * u, Real * diff_term, Real * scalforce, Real * s_l, Real * s_r, Real * s_b, Real * s_t, Real * s_d, Real * s_u, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * dx,Real * dt, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, int * numqty); void FORT_VELUPD(Real * u, Real * v, Real * w, Real * ustar, Real * vstar, Real * wstar, Real * lapu, Real * gradp, Real * rhohalf, Real * uadv, Real * vadv, Real * wadv, Real * uhalfx, Real * uhalfy, Real * uhalfz, Real * force, Real * dt, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, Real * dx); void FORT_SETCELLVELBC(Real* u, Real* v, Real* w, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, Real * visc_coef, Real * dx, Real * time); void FORT_SETVELBC(Real* u, Real* v, Real* w, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, Real * visc_coef, Real * dx, Real * time); void FORT_SETSCALBC(Real * scal, const int& lo_1, const int& lo_2, const int& lo_3, const int& hi_1, const int& hi_2, const int& hi_3, int * bcx_lo, int * bcx_hi, int * bcy_lo, int * bcy_hi, int * bcz_lo, int * bcz_hi, int * which_scal, Real * dx, Real * time); }; #endif ccseapps-2.5/CCSEApps/varden3d/probin40000644000175000017500000000030311634153073020661 0ustar amckinstryamckinstry $fortin prob_type = 4 in_xvel = 1.0 in_yvel = 0.0 in_zvel = 0.0 in_density = 1.0 in_tracer = 0.0 xblob = 0.5 yblob = 0.5 zblob = 0.5 radblob = 0.2 denblob = 10. $end ccseapps-2.5/CCSEApps/varden3d/mkscaflux.F0000644000175000017500000002457211634153073021503 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKSCAFLUX ** c ** Create the time-centered edge states for scalars c *************************************************************** subroutine FORT_MKSCAFLUX(s,sedgex,sedgey,sedgez,slopex,slopey,slopez, $ uadv,vadv,wadv,utrans,vtrans,wtrans,u,diff,force, $ s_l,s_r,s_b,s_t,s_d,s_u,DIMS, $ dx,dt,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi,numqty) implicit none integer DIMS integer numqty REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numqty) REAL_T sedgex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numqty) REAL_T sedgey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numqty) REAL_T sedgez(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numqty) REAL_T slopex(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numqty) REAL_T slopey(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numqty) REAL_T slopez(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numqty) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wadv(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T utrans(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vtrans(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wtrans(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T diff(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numqty) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,numqty) REAL_T s_l(lo_1:hi_1+1) REAL_T s_r(lo_1:hi_1+1) REAL_T s_b(lo_2:hi_2+1) REAL_T s_t(lo_2:hi_2+1) REAL_T s_d(lo_3:hi_3+1) REAL_T s_u(lo_3:hi_3+1) REAL_T dx(3) REAL_T dt integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables REAL_T savg REAL_T sUpx1,sUpx2 REAL_T sUpy1,sUpy2 REAL_T sUpz1,sUpz2 REAL_T hx REAL_T hy REAL_T hz integer i,j,k,n,is,ie,js,je,ks,ke REAL_T eps eps = 1.0e-8 hx = dx(1) hy = dx(2) hz = dx(3) is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 c ::: First do s^(n+1/2) on the (i+1/2) boundaries. do n = 1, numqty do k = ks,ke do j = js,je do i = is,ie sUpy1 = cvmgp( s(i,j,k,n) , s(i,j+1,k,n), vtrans(i,j+1,k)) savg = half * (s(i,j,k,n) + s(i,j+1,k,n)) sUpy1 = cvmgt(sUpy1, savg, abs(vtrans(i,j+1,k)) .gt. eps) sUpy2 = cvmgp( s(i,j-1,k,n) , s(i,j,k,n), vtrans(i,j ,k)) savg = half * (s(i,j-1,k,n) + s(i,j,k,n)) sUpy2 = cvmgt(sUpy2, savg, abs(vtrans(i,j ,k)) .gt. eps) sUpz1 = cvmgp( s(i,j,k,n) , s(i,j,k+1,n), wtrans(i,j,k+1)) savg = half * (s(i,j,k,n) + s(i,j,k+1,n)) sUpz1 = cvmgt(sUpz1, savg, abs(wtrans(i,j,k+1)) .gt. eps) sUpz2 = cvmgp( s(i,j,k-1,n) , s(i,j,k,n), wtrans(i,j,k )) savg = half * (s(i,j,k-1,n) + s(i,j,k,n)) sUpz2 = cvmgt(sUpz2, savg, abs(wtrans(i,j,k )) .gt. eps) s_l(i+1) = s(i,j,k,n) + $ half*(one - u(i,j,k,1)*dt/hx)*slopex(i,j,k,n) - $ half*dt*u(i,j,k,2)*(sUpy1 - sUpy2)/hy - $ half*dt*u(i,j,k,3)*(sUpz1 - sUpz2)/hz + $ half*dt*(diff(i,j,k,n) + force(i,j,k,n)) s_r(i ) = s(i,j,k,n) - $ half*(one + u(i,j,k,1)*dt/hx)*slopex(i,j,k,n) - $ half*dt*u(i,j,k,2)*(sUpy1 - sUpy2)/hy - $ half*dt*u(i,j,k,3)*(sUpz1 - sUpz2)/hz + $ half*dt*(diff(i,j,k,n) + force(i,j,k,n)) enddo if (bcx_lo .eq. PERIODIC) then s_l(is ) = s_l(ie+1) elseif (bcx_lo .eq. WALL) then s_l(is ) = s_r(is ) elseif (bcx_lo .eq. INLET ) then s_l(is ) = s(is-1,j,k,n) elseif (bcx_lo .eq. OUTLET ) then s_l(is ) = s_r(is ) endif if (bcx_hi .eq. PERIODIC) then s_r(ie+1) = s_r(is ) elseif (bcx_hi .eq. WALL) then s_r(ie+1) = s_l(ie+1) elseif (bcx_hi .eq. INLET ) then s_r(ie+1) = s(ie+1,j,k,n) elseif (bcx_hi .eq. OUTLET ) then s_r(ie+1) = s_l(ie+1) endif do i = is,ie+1 sedgex(i,j,k,n)= cvmgp(s_l(i),s_r(i),uadv(i,j,k)) savg = half*(s_l(i) + s_r(i)) sedgex(i,j,k,n) = cvmgp(savg,sedgex(i,j,k,n),eps-abs(uadv(i,j,k))) enddo enddo enddo c ::: Now do s^(n+1/2) on the (j+1/2) boundaries. do k = ks,ke do i = is,ie do j = js,je sUpx1 = cvmgp( s(i,j,k,n) , s(i+1,j,k,n),utrans(i+1,j,k)) savg = half * (s(i,j,k,n) + s(i+1,j,k,n)) sUpx1 = cvmgt(sUpx1, savg, abs(utrans(i+1,j,k)) .gt. eps) sUpx2 = cvmgp( s(i-1,j,k,n) , s(i,j,k,n),utrans(i ,j,k)) savg = half * (s(i-1,j,k,n) + s(i,j,k,n)) sUpx2 = cvmgt(sUpx2, savg, abs(utrans(i,j,k)) .gt. eps) sUpz1 = cvmgp( s(i,j,k,n) , s(i,j,k+1,n),wtrans(i,j,k+1)) savg = half * (s(i,j,k,n) + s(i,j,k+1,n)) sUpz1 = cvmgt(sUpz1, savg, abs(wtrans(i,j,k+1)) .gt. eps) sUpz2 = cvmgp( s(i,j,k-1,n) , s(i,j,k,n),wtrans(i,j,k )) savg = half * (s(i,j,k-1,n) + s(i,j,k,n)) sUpz2 = cvmgt(sUpz2, savg, abs(wtrans(i,j,k)) .gt. eps) s_b(j+1) = s(i,j,k,n) + $ half*(one - u(i,j,k,2)*dt/hy)*slopey(i,j,k,n) - $ half*dt*u(i,j,k,1)*(sUpx1 - sUpx2)/hx - $ half*dt*u(i,j,k,3)*(sUpz1 - sUpz2)/hz + $ half*dt*(diff(i,j,k,n) + force(i,j,k,n)) s_t(j ) = s(i,j,k,n) - $ half*(one + u(i,j,k,2)*dt/hy)*slopey(i,j,k,n) - $ half*dt*u(i,j,k,1)*(sUpx1 - sUpx2)/hx - $ half*dt*u(i,j,k,3)*(sUpz1 - sUpz2)/hz + $ half*dt*(diff(i,j,k,n) + force(i,j,k,n)) enddo if (bcy_lo .eq. PERIODIC) then s_b(js ) = s_b(je+1) elseif (bcy_lo .eq. WALL ) then s_b(js ) = s_t(js ) elseif (bcy_lo .eq. INLET ) then s_b(js ) = s(i,js-1,k,n) elseif (bcy_lo .eq. OUTLET ) then s_b(js ) = s_t(js ) endif if (bcy_hi .eq. PERIODIC) then s_t(je+1) = s_t(js ) elseif (bcy_hi .eq. WALL ) then s_t(je+1) = s_b(je+1) elseif (bcy_hi .eq. INLET ) then s_t(je+1) = s(i,je+1,k,n) elseif (bcy_hi .eq. OUTLET ) then s_t(je+1) = s_b(je+1) endif do j = js, je+1 sedgey(i,j,k,n) = cvmgp(s_b(j),s_t(j),vadv(i,j,k)) savg = half*(s_b(j) + s_t(j)) sedgey(i,j,k,n) = cvmgp(savg,sedgey(i,j,k,n),eps-abs(vadv(i,j,k))) enddo enddo enddo c ::: Now do s^(n+1/2) on the (k+1/2) boundaries. do j = js,je do i = is,ie do k = ks,ke sUpx1 = cvmgp( s(i,j,k,n) , s(i+1,j,k,n),utrans(i+1,j,k)) savg = half * (s(i,j,k,n) + s(i+1,j,k,n)) sUpx1 = cvmgt(sUpx1, savg, abs(utrans(i+1,j,k)) .gt. eps) sUpx2 = cvmgp( s(i-1,j,k,n) , s(i,j,k,n),utrans(i ,j,k)) savg = half * (s(i-1,j,k,n) + s(i,j,k,n)) sUpx2 = cvmgt(sUpx2, savg, abs(utrans(i,j,k)) .gt. eps) sUpy1 = cvmgp( s(i,j,k,n) , s(i,j+1,k,n), vtrans(i,j+1,k)) savg = half * (s(i,j,k,n) + s(i,j+1,k,n)) sUpy1 = cvmgt(sUpy1, savg, abs(vtrans(i,j+1,k)) .gt. eps) sUpy2 = cvmgp( s(i,j-1,k,n) , s(i,j,k,n), vtrans(i,j ,k)) savg = half * (s(i,j-1,k,n) + s(i,j,k,n)) sUpy2 = cvmgt(sUpy2, savg, abs(vtrans(i,j ,k)) .gt. eps) s_d(k+1) = s(i,j,k,n) + $ half*(one - u(i,j,k,3)*dt/hz)*slopez(i,j,k,n) - $ half*dt*u(i,j,k,1)*(sUpx1 - sUpx2)/hx - $ half*dt*u(i,j,k,2)*(sUpy1 - sUpy2)/hy + $ half*dt*(diff(i,j,k,n) + force(i,j,k,n)) s_u(k ) = s(i,j,k,n) - $ half*(one + u(i,j,k,3)*dt/hz)*slopez(i,j,k,n) - $ half*dt*u(i,j,k,1)*(sUpx1 - sUpx2)/hx - $ half*dt*u(i,j,k,2)*(sUpy1 - sUpy2)/hy + $ half*dt*(diff(i,j,k,n) + force(i,j,k,n)) enddo if (bcz_lo .eq. PERIODIC) then s_d(ks ) = s_d(ke+1) elseif (bcz_lo .eq. WALL ) then s_d(ks ) = s_u(ks ) elseif (bcz_lo .eq. INLET ) then s_d(ks ) = s(i,j,ks-1,n) elseif (bcz_lo .eq. OUTLET ) then s_d(ks ) = s_u(ks ) endif if (bcz_hi .eq. PERIODIC) then s_u(ke+1) = s_u(ks ) elseif (bcz_hi .eq. WALL ) then s_u(ke+1) = s_d(ke+1) elseif (bcz_hi .eq. INLET ) then s_u(ke+1) = s(i,j,ke+1,n) elseif (bcz_hi .eq. OUTLET ) then s_u(ke+1) = s_d(ke+1) endif do k = ks, ke+1 sedgez(i,j,k,n) = cvmgp(s_d(k),s_u(k),wadv(i,j,k)) savg = half*(s_d(k) + s_u(k)) sedgez(i,j,k,n) = cvmgp(savg,sedgez(i,j,k,n),eps-abs(wadv(i,j,k))) enddo enddo enddo enddo return end ccseapps-2.5/CCSEApps/varden3d/inputs30000644000175000017500000002373411634153073020726 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 1000000 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1.0 ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin3 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 10000 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 1000 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################# # The acceleration of gravity, assumed to be in the z-direction. # The negative sign indicates that the force acts in the negative # z-direction. gravity = 0.0 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 1 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 1 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 1 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 1 ############################################################################# # Boundary conditions in the low z-direction. # If bcz_lo = 1, the domain is periodic in the z-direction. # If bcz_lo = 2, the domain has a solid (reflecting) walls in the low z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_lo = 3, the domain has inflow at low z. # If bcz_lo = 4, the domain has outflow at low z. bcz_lo = 1 ############################################################################# # Boundary conditions in the high z-direction. # If bcz_hi = 1, the domain is periodic in the z-direction. # If bcz_hi = 2, the domain has a solid (reflecting) wall in the high z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_hi = 3, the domain has inflow at high z. # If bcz_hi = 4, the domain has outflow at high z. bcz_hi = 1 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. grid.n_cell = 16 16 16 ############################################################################# # The physical coordinates of the low end of the domain. # This is read by the Grid class. grid.prob_lo = 0. 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. # This is read by the Grid class. grid.prob_hi = 1. 1. 1. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. # This is read by the Grid class. grid.visc_coef = 0.001 ############################################################################## # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ############################################################################# ccseapps-2.5/CCSEApps/varden3d/cmpdt.F0000644000175000017500000000705411634153073020611 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** CMPDT ** c ** Compute the new time step c ******************************************************************** subroutine FORT_CMPDT(u,v,w,rho,px,py,pz,force,dx,dt,cflfac,DIMS) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T px(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T py(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T pz(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T dx(3) REAL_T dt REAL_T cflfac c Local variables REAL_T spdx,spdy,spdz,dtold REAL_T pforcex,pforcey,pforcez REAL_T dtchange integer i, j, k REAL eps dtchange = 1.1d0 eps = 1.0e-8 dtold = dt spdx = zero spdy = zero spdz = zero pforcex = zero pforcey = zero pforcez = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 spdx = max(spdx ,abs(u(i,j,k))/dx(1)) spdy = max(spdy ,abs(v(i,j,k))/dx(2)) spdz = max(spdz ,abs(w(i,j,k))/dx(3)) pforcex = max(pforcex,abs(px(i,j,k)/rho(i,j,k)-force(i,j,k,1))) pforcey = max(pforcey,abs(py(i,j,k)/rho(i,j,k)-force(i,j,k,2))) pforcez = max(pforcez,abs(pz(i,j,k)/rho(i,j,k)-force(i,j,k,3))) enddo enddo enddo if (spdx.lt.eps .and. spdy.lt.eps .and. spdz.lt.eps) then dt = min(dx(1),dx(2),dx(3)) else dt = one / max(spdx,spdy,spdz) endif if (pforcex .gt. eps) then dt = min(dt,sqrt(two*dx(1)/pforcex)) endif if (pforcey .gt. eps) then dt = min(dt,sqrt(two*dx(2)/pforcey)) endif if (pforcez .gt. eps) then dt = min(dt,sqrt(two*dx(3)/pforcez)) endif dt = dt * cflfac if (dtold .gt. zero) dt = min(dt,dtchange*dtold) return end ccseapps-2.5/CCSEApps/varden3d/macproj.cpp0000644000175000017500000002440711634153073021533 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #define ARLIM(x) x[0],x[1],x[2] int mac_projector::numSmoothCoarsen = 2; int mac_projector::numSmoothRefine = 2; // ************************************************************************ // ** constructor ** // ************************************************************************ mac_projector::mac_projector(const Box& Domain, Real * dx) : domain(Domain) { ParmParse pp("mac"); pp.get("tol",tol); pp.query("numSmoothCoarsen",numSmoothCoarsen); pp.query("numSmoothRefine",numSmoothRefine); _hx = dx[0]; _hy = dx[1]; _hz = dx[2]; } // ************************************************************************ // ** destructor ** // ************************************************************************ mac_projector::~mac_projector() { } // ************************************************************************ // ** project ** // ************************************************************************ void mac_projector::project(Real * uadv, Real * vadv, Real * wadv, Real *rho, FArrayBox& divu_src) { FArrayBox *phi = new FArrayBox(BoxLib::grow(domain,1),1); phi->setVal(0.0); FArrayBox *source = new FArrayBox(domain,1); FArrayBox *resid = new FArrayBox(domain,1); Box xedges(domain); int idir = 0; int ngrow = 1; xedges.growHi(idir,ngrow); FArrayBox *sigmax = new FArrayBox(xedges,1); Box yedges(domain); idir = 1; ngrow = 1; yedges.growHi(idir,ngrow); FArrayBox *sigmay = new FArrayBox(yedges,1); Box zedges(domain); idir = 2; ngrow = 1; zedges.growHi(idir,ngrow); FArrayBox *sigmaz = new FArrayBox(zedges,1); FORT_INITSIGMA(sigmax->dataPtr(),sigmay->dataPtr(),sigmaz->dataPtr(),rho, ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); Real rhsnorm; FORT_RHSMAC(uadv,vadv,wadv,divu_src.dataPtr(),source->dataPtr(), ARLIM(lo),ARLIM(hi),&_hx,&_hy,&_hz,&rhsnorm); std::cout << "MAC Source norm: " << rhsnorm << std::endl; if (rhsnorm > tol) { macprojection_mg *solver = new macprojection_mg(domain,phi,source,resid,sigmax,sigmay,sigmaz, _hx,_hy,_hz); solver->solve(tol*rhsnorm,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; Real * gradpx = new Real[(domain.length()[0]+1)* domain.length()[1] * domain.length()[2] ]; Real * gradpy = new Real[ domain.length()[0] * (domain.length()[1]+1)* domain.length()[2] ]; Real * gradpz = new Real[ domain.length()[0] * domain.length()[1] * (domain.length()[2]+1)]; FORT_GRADMAC(gradpx,gradpy,gradpz,phi->dataPtr(),ARLIM(lo),ARLIM(hi), &_hx,&_hy,&_hz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); FORT_PROJUMAC(uadv, vadv, wadv, gradpx, gradpy, gradpz, rho, ARLIM(lo), ARLIM(hi)); delete gradpx; delete gradpy; delete gradpz; } delete phi; delete source; delete resid; delete sigmax; delete sigmay; delete sigmaz; } // ************************************************************************ // ** constructor ** // ************************************************************************ macprojection_mg::macprojection_mg(const Box& Domain, FArrayBox *Phi, FArrayBox *Source, FArrayBox *Resid, FArrayBox *Sigmax, FArrayBox *Sigmay, FArrayBox *Sigmaz, Real Hx, Real Hy, Real Hz) : multigrid(Domain, Phi, Source, Resid, Hx, Hy, Hz) { sigmax = Sigmax; sigmay = Sigmay; sigmaz = Sigmaz; // create next (coarser) level const IntVect& len = domain.length(); // If the grid has an odd number of cells, or has reached its minimum // length in either direction, then we can not coarsen any further. // If this is a pure multigrid cycle, use a conjugate gradient bottom // solver; if this is a multigrid preconditioner for a conjugate gradient // solve, then just relax many times at the bottom. if ( (len[0]&1) != 0 || (len[1]&1) != 0 || (len[2]&1) != 0 || len[0] < 4 || len[1] < 4 || len[2] < 4) { Next = NULL; cgwork = new FArrayBox(domain,4); FORT_MKSUMMAC(sigmax->dataPtr(), sigmay->dataPtr(), sigmaz->dataPtr(), cgwork->dataPtr(0), ARLIM(lo_mg), ARLIM(hi_mg), &_hx, &_hy, &_hz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); } else { cgwork = NULL; Box newdomain = BoxLib::coarsen(domain,2); FArrayBox* newphi = new FArrayBox(BoxLib::grow(newdomain,1),1); newphi->setVal(0.0); Real newhx = 2.0*_hx; Real newhy = 2.0*_hy; Real newhz = 2.0*_hz; FArrayBox* newresid = new FArrayBox(BoxLib::grow(newdomain,1),1); FArrayBox* newsigmax = new FArrayBox(BoxLib::grow(newdomain,1),1); FArrayBox* newsigmay = new FArrayBox(BoxLib::grow(newdomain,1),1); FArrayBox* newsigmaz = new FArrayBox(BoxLib::grow(newdomain,1),1); const int* dom_lo = domain.smallEnd().getVect(); const int* dom_hi = domain.bigEnd().getVect(); const int* new_lo = newdomain.smallEnd().getVect(); const int* new_hi = newdomain.bigEnd().getVect(); FORT_COARSIGMA(sigmax->dataPtr(),sigmay->dataPtr(),sigmaz->dataPtr(), newsigmax->dataPtr(),newsigmay->dataPtr(), newsigmaz->dataPtr(), ARLIM(dom_lo), ARLIM(dom_hi), ARLIM(new_lo), ARLIM(new_hi)); Next = new macprojection_mg(newdomain, newphi, new FArrayBox(newdomain,1), newresid, newsigmax, newsigmay, newsigmaz, newhx, newhy, newhz); } next = Next; } // ************************************************************************ // ** destructor ** // ************************************************************************ macprojection_mg::~macprojection_mg() { if (Next != NULL) { delete Next->phi; delete Next->source; delete Next->resid; delete Next->sigmax; delete Next->sigmay; delete Next->sigmaz; delete Next; } delete cgwork; } // ************************************************************************ // ** residual ** // ************************************************************************ Real macprojection_mg::residual() { Real rnorm; FORT_RESIDUAL(resid->dataPtr(),phi->dataPtr(),source->dataPtr(), sigmax->dataPtr(),sigmay->dataPtr(),sigmaz->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),&_hx,&_hy,&_hz,&rnorm, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); return rnorm; } // ************************************************************************ // ** step ** // ************************************************************************ void macprojection_mg::step(int nngsrb) { Real rnorm = 1.e10; if (cgwork != NULL) { FArrayBox * dest0 = new FArrayBox(BoxLib::grow(domain,1),1); FORT_SOLVEMAC(phi->dataPtr(), dest0->dataPtr(), source->dataPtr(), sigmax->dataPtr(), sigmay->dataPtr(), sigmaz->dataPtr(), cgwork->dataPtr(0), cgwork->dataPtr(1), cgwork->dataPtr(2), cgwork->dataPtr(3), resid->dataPtr(), ARLIM(lo_mg), ARLIM(hi_mg), &_hx, &_hy, &_hz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &rnorm,&prob_norm); delete dest0; } else { FORT_GSRB(phi->dataPtr(),source->dataPtr(), sigmax->dataPtr(),sigmay->dataPtr(), sigmaz->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),&_hx,&_hy,&_hz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi,&nngsrb); } } // ************************************************************************ // ** Restrict ** // ************************************************************************ void macprojection_mg::Restrict() { const int * loc = next->domain.smallEnd().getVect(); const int * hic = next->domain.bigEnd().getVect(); FORT_RESTRICT(resid->dataPtr(), next->source->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),ARLIM(loc),ARLIM(hic)); } // ************************************************************************ // ** interpolate ** // ************************************************************************ void macprojection_mg::interpolate() { const int * loc = next->domain.smallEnd().getVect(); const int * hic = next->domain.bigEnd().getVect(); FORT_INTERPOLATE(phi->dataPtr(), next->phi->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),ARLIM(loc),ARLIM(hic)); } ccseapps-2.5/CCSEApps/varden3d/hgproj.cpp0000644000175000017500000002512111634153073021363 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #include #define ARLIM(x) x[0],x[1],x[2] int hg_projector::numSmoothCoarsen = 2; int hg_projector::numSmoothRefine = 2; // ************************************************************************ // ** constructor ** // ************************************************************************ hg_projector::hg_projector(const Box& Domain, Real * dx) : domain(Domain) { ParmParse pp("hg"); pp.get("tol",tol); pp.query("numSmoothCoarsen",numSmoothCoarsen); pp.query("numSmoothRefine",numSmoothRefine); _hx = dx[0]; _hy = dx[1]; _hz = dx[2]; phi = new FArrayBox(BoxLib::surroundingNodes(BoxLib::grow(domain,1)),1); phi->setVal(0.0); } // ************************************************************************ // ** destructor ** // ************************************************************************ hg_projector::~hg_projector() { delete phi; } // ************************************************************************ // ** project ** // ************************************************************************ void hg_projector::project(FArrayBox * state, FArrayBox * pressure, FArrayBox * rho, FArrayBox * divu_src, Real time, Real dt) { Box sz(BoxLib::grow(domain,1)); Box p_size(BoxLib::surroundingNodes(sz)); FArrayBox *sigma = new FArrayBox(sz,1); FArrayBox *coeff = new FArrayBox(sz,3); FArrayBox *source = new FArrayBox(p_size,1); FArrayBox *resid = new FArrayBox(p_size,1); sigma->setVal(0.); coeff->setVal(0.); source->setVal(0.); resid->setVal(0.); FORT_INITSIG(sigma->dataPtr(),rho->dataPtr(),ARLIM(lo),ARLIM(hi), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); FArrayBox gradp(sz,3); gradp.setVal(0.); gradient(gradp,*pressure); for (int n = 0; n < 3; n++) { gradp.divide(*rho,domain,0,n,1); state->plus(gradp,domain,n,n,1); } Real rhsnorm; Real * utemp1 = new Real[sz.length()[0]*sz.length()[1]*sz.length()[2]]; Real * utemp2 = new Real[sz.length()[0]*sz.length()[1]*sz.length()[2]]; FORT_RHSHG(source->dataPtr(),state->dataPtr(),divu_src->dataPtr(), ARLIM(lo),ARLIM(hi),&_hx,&_hy,&_hz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi,&rhsnorm, &time,&dt,utemp1,utemp2); delete utemp1; delete utemp2; std::cout << "HG Source norm: " << rhsnorm << std::endl; if (rhsnorm > tol) { phi->setVal(0.0); hgprojection_mg *solver = new hgprojection_mg(domain,phi,source,resid,sigma,coeff,_hx,_hy,_hz); solver->solve(tol*rhsnorm,rhsnorm,numSmoothCoarsen,numSmoothRefine); delete solver; FArrayBox * gradphi = new FArrayBox(sz,3); gradient(*gradphi,*phi); FORT_PROJUHG(state->dataPtr(), pressure->dataPtr(), phi->dataPtr(), gradphi->dataPtr(),rho->dataPtr(),ARLIM(lo),ARLIM(hi)); delete gradphi; } delete sigma; delete coeff; delete source; delete resid; } // ************************************************************************ // ** gradient ** // ************************************************************************ void hg_projector::gradient(FArrayBox & gradp, FArrayBox & pressure) { const int * p_lo = pressure.loVect(); const int * p_hi = pressure.hiVect(); const int * g_lo = gradp.loVect(); const int * g_hi = gradp.hiVect(); FORT_GRADHG(gradp.dataPtr(),ARLIM(g_lo),ARLIM(g_hi), pressure.dataPtr(),ARLIM(p_lo),ARLIM(p_hi), ARLIM(lo),ARLIM(hi),&_hx,&_hy,&_hz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); } // ************************************************************************ // ** constructor ** // ************************************************************************ hgprojection_mg::hgprojection_mg(const Box& Domain, FArrayBox *Phi, FArrayBox *Source, FArrayBox *Resid, FArrayBox *Sigma, FArrayBox *Coeff, Real Hx, Real Hy, Real Hz) : multigrid(Domain, Phi, Source, Resid, Hx, Hy, Hz) { sigma = Sigma; coeff = Coeff; FORT_MKCOEFF(coeff->dataPtr(),sigma->dataPtr(),ARLIM(lo_mg),ARLIM(hi_mg)); const IntVect& len = domain.length(); // If the grid has an odd number of cells, or has reached its minimum // length in either direction, then we can not coarsen any further. // If this is a pure multigrid cycle, use a conjugate gradient bottom // solver; if this is a multigrid preconditioner for a conjugate gradient // solve, then just relax many times at the bottom. if ( (len[0]&1) != 0 || (len[1]&1) != 0 || (len[2]&1) != 0 || len[0] < 4 || len[1] < 4 || len[2] < 4) { Next = NULL; cgwork = new FArrayBox(BoxLib::surroundingNodes(BoxLib::grow(domain,1)),4); FORT_MAKESUM(cgwork->dataPtr(0), coeff->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg),&_hx,&_hy,&_hz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); } else { cgwork = NULL; Box newdomain = BoxLib::coarsen(domain,2); Box newp_size = BoxLib::surroundingNodes(BoxLib::grow(newdomain,1)); FArrayBox* newphi = new FArrayBox(newp_size,1); newphi->setVal(0.0); FArrayBox* newsigma = new FArrayBox(BoxLib::grow(newdomain,1),1); FArrayBox* newcoeff = new FArrayBox(BoxLib::grow(newdomain,1),3); FArrayBox* newresid = new FArrayBox(newp_size,1); newsigma->setVal(0.); newcoeff->setVal(0.); newresid->setVal(0.); FORT_COARSIG(sigma->dataPtr(),newsigma->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg), ARLIM(newdomain.smallEnd().getVect()), ARLIM(newdomain.bigEnd().getVect()), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); Real newhx = 2.0*_hx; Real newhy = 2.0*_hy; Real newhz = 2.0*_hz; Next = new hgprojection_mg(newdomain, newphi, new FArrayBox(newp_size,1), newresid, newsigma, newcoeff, newhx, newhy, newhz); } next = Next; } // ************************************************************************ // ** destructor ** // ************************************************************************ hgprojection_mg::~hgprojection_mg() { if (Next != NULL) { delete Next->phi; delete Next->source; delete Next->resid; delete Next->sigma; delete Next->coeff; delete Next; } delete cgwork; } // ************************************************************************ // ** residual ** // ************************************************************************ Real hgprojection_mg::residual() { Real rnorm; FArrayBox * dgphi = new FArrayBox(BoxLib::surroundingNodes(BoxLib::grow(domain,1)),1); FORT_RESIDUAL(resid->dataPtr(),phi->dataPtr(),source->dataPtr(), coeff->dataPtr(), dgphi->dataPtr(),ARLIM(lo_mg),ARLIM(hi_mg), &_hx,&_hy,&_hz,&rnorm, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); delete dgphi; return rnorm; } // ************************************************************************ // ** step ** // ************************************************************************ void hgprojection_mg::step(int nngsrb) { int maxiter = 100; FArrayBox * temp = new FArrayBox(BoxLib::surroundingNodes(BoxLib::grow(domain,1)),1); if (cgwork != NULL) { temp->copy(*phi); phi->setVal(0.); Real resnorm = 0.0; FORT_SOLVEHG(phi->dataPtr(), temp->dataPtr(), source->dataPtr(), coeff->dataPtr(), cgwork->dataPtr(0), cgwork->dataPtr(1), cgwork->dataPtr(2), cgwork->dataPtr(3), resid->dataPtr(), ARLIM(lo_mg), ARLIM(hi_mg), &_hx, &_hy, &_hz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi, &maxiter, &resnorm, &prob_norm); } else { FORT_RELAX(phi->dataPtr(),source->dataPtr(), coeff->dataPtr(), temp->dataPtr(),ARLIM(lo_mg),ARLIM(hi_mg), &_hx,&_hy,&_hz, &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi,&nngsrb); } delete temp; } // ************************************************************************ // ** Restrict ** // ************************************************************************ void hgprojection_mg::Restrict() { FORT_RESTRICT(resid->dataPtr(), next->source->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg), ARLIM(next->domain.smallEnd().getVect()), ARLIM(next->domain.bigEnd().getVect()), &bcx_lo,&bcx_hi,&bcy_lo,&bcy_hi,&bcz_lo,&bcz_hi); } // ************************************************************************ // ** interpolate ** // ************************************************************************ void hgprojection_mg::interpolate() { FArrayBox * temp = new FArrayBox(BoxLib::surroundingNodes(BoxLib::grow(domain,1)),1); temp->setVal(0.); FORT_INTERP(temp->dataPtr(), next->phi->dataPtr(), ARLIM(lo_mg),ARLIM(hi_mg), ARLIM(next->domain.smallEnd().getVect()), ARLIM(next->domain.bigEnd().getVect())); phi->plus(*temp,0,0,1); delete temp; } ccseapps-2.5/CCSEApps/varden3d/velupd.F0000644000175000017500000001064211634153073020776 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** VELUPD ** c ** Update the velocity components using convective differencing of fluxes c ** This field will then be projected to enforce the divergence constraint. c ************************************************************************* subroutine FORT_VELUPD(u,v,w,ustar,vstar,wstar,lapu,gradp,rhomid, $ uadv,vadv,wadv,uhalfx,uhalfy,uhalfz, $ force,dt,DIMS,dx) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T ustar(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T vstar(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T wstar(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T lapu(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T gradp(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T rhomid(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uadv(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vadv(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wadv(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T uhalfx(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T uhalfy(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T uhalfz(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T dt REAL_T dx(3) c Local variables integer i, j, k REAL_T ubar, vbar, wbar REAL_T ugradu, ugradv, ugradw do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 ubar = half*(uadv(i,j,k) + uadv(i+1,j,k)) vbar = half*(vadv(i,j,k) + vadv(i,j+1,k)) wbar = half*(wadv(i,j,k) + wadv(i,j,k+1)) ugradu = ubar*(uhalfx(i+1,j,k,1) - uhalfx(i,j,k,1))/dx(1) + $ vbar*(uhalfy(i,j+1,k,1) - uhalfy(i,j,k,1))/dx(2) + $ wbar*(uhalfz(i,j,k+1,1) - uhalfz(i,j,k,1))/dx(3) ugradv = ubar*(uhalfx(i+1,j,k,2) - uhalfx(i,j,k,2))/dx(1) + $ vbar*(uhalfy(i,j+1,k,2) - uhalfy(i,j,k,2))/dx(2) + $ wbar*(uhalfz(i,j,k+1,2) - uhalfz(i,j,k,2))/dx(3) ugradw = ubar*(uhalfx(i+1,j,k,3) - uhalfx(i,j,k,3))/dx(1) + $ vbar*(uhalfy(i,j+1,k,3) - uhalfy(i,j,k,3))/dx(2) + $ wbar*(uhalfz(i,j,k+1,3) - uhalfz(i,j,k,3))/dx(3) ustar(i,j,k) = u(i,j,k) + dt * ( half*lapu(i,j,k,1)/rhomid(i,j,k) $ - gradp(i,j,k,1)/rhomid(i,j,k) - ugradu + force(i,j,k,1) ) vstar(i,j,k) = v(i,j,k) + dt * ( half*lapu(i,j,k,2)/rhomid(i,j,k) $ - gradp(i,j,k,2)/rhomid(i,j,k) - ugradv + force(i,j,k,2) ) wstar(i,j,k) = w(i,j,k) + dt * ( half*lapu(i,j,k,3)/rhomid(i,j,k) $ - gradp(i,j,k,3)/rhomid(i,j,k) - ugradw + force(i,j,k,3) ) enddo enddo enddo return end ccseapps-2.5/CCSEApps/varden3d/multigrid.cpp0000644000175000017500000001256511634153073022102 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include #include #include #include #include #include #include #include #define ARLIM(x) x[0],x[1],x[2] int multigrid::debug = 0; int multigrid::verbose = 1; int multigrid::first_mg = 1; Real multigrid::prob_norm = 0.0; // ************************************************************************ // ** constructor ** // ************************************************************************ multigrid::multigrid(const Box & Domain, FArrayBox * Phi, FArrayBox * Source, FArrayBox * Resid, Real Hx, Real Hy, Real Hz) : domain(Domain) { if (first_mg) { first_mg = 0; ParmParse pp("multigrid"); pp.query("debug",debug); pp.query("verbose",verbose); } // set pointers to grids phi = Phi; source = Source; resid = Resid; lo_mg = domain.smallEnd().getVect(); hi_mg = domain.bigEnd().getVect(); // set mesh size _hx = Hx; _hy = Hy; _hz = Hz; // coarser levels may be added by constructors for derived classes next = NULL; } // ************************************************************************ // ** solve ** // ************************************************************************ void multigrid::solve(Real tol, Real Prob_norm, int nngsrb, int i2) { prob_norm = Prob_norm; int i = 1; Real rlast = residual(); Real res = rlast; if (rlast > tol) { while ((res = vcycle(tol,nngsrb,i2)) > tol) { i++; if (verbose == 2 || debug != 0) std::cout << "Res/Res0: " << res/prob_norm << " after " << i-1 << " iterations " << std::endl; } } if (verbose == 1 || debug != 0) { std::cout << "Res/Res0: " << res/prob_norm << " after " << i << " iterations " << std::endl; std::cout << " " << std::endl; } } // ************************************************************************ // ** vcycle ** // ************************************************************************ Real multigrid::vcycle(Real tol, int nngsrb, int i2) { Real rnorm = residual(); if (debug) std::cout << "MG Res/Res0 " << rnorm/prob_norm << " for " << domain.length() << std::endl; step(nngsrb); rnorm = residual(); if (debug) { std::cout << "MG Res/Res0 " << rnorm/prob_norm << " for " << domain.length() << std::endl; } if (next != NULL) { Restrict(); next->phi->setVal(0.0); int downiter = nngsrb; int upiter = i2; next->vcycle(tol,downiter,upiter); interpolate(); if (debug) { rnorm = residual(); std::cout << "MG Res/Res0 " << rnorm/prob_norm << " for " << domain.length() << std::endl; } step(i2); if (debug) { rnorm = residual(); std::cout << "MG Res/Res0 " << rnorm/prob_norm << " for " << domain.length() << std::endl; } } return rnorm; } // ************************************************************************ // ** fmv ** // ************************************************************************ Real multigrid::fmv(Real tol, int nngsrb, int i2) { step(nngsrb); if (next != NULL) { residual(); Restrict(); next->phi->setVal(0.0); Real nexttol = .25*tol; int downiter = nngsrb; int upiter = i2; next->fmv(nexttol,downiter,upiter); interpolate(); } return vcycle(tol,nngsrb,i2); } // ************************************************************************ // ** wcycle ** // ************************************************************************ Real multigrid::wcycle(int nngsrb, int i2) { Real rnorm; step(nngsrb); rnorm = residual(); if (next != NULL) { Restrict(); next->phi->setVal(0.0); int downiter = nngsrb; int upiter = i2; next->wcycle(downiter,upiter); next->wcycle(downiter,upiter); interpolate(); step(i2); rnorm = residual(); } return rnorm; } ccseapps-2.5/CCSEApps/varden3d/visc.F0000644000175000017500000006317411634153073020453 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "VISC_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #define CDIMS loc_1,loc_2,loc_3,hic_1,hic_2,hic_3 #if BL_USE_FLOAT #define twentyfive 25.e0 #define fifth 0.2 #else #define twentyfive 25.d0 #define fifth 0.2d0 #endif c ************************************************************************* c ** INITSIG ** c ** Define the 1/rho coefficients at the top level of the multigrid c ************************************************************************* subroutine FORT_INITSIGV(sigma,rho,rmu,DIMS) implicit none integer DIMS REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T rmu c Local variables integer i,j,k do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 sigma(i,j,k) = rmu/rho(i,j,k) enddo enddo enddo return end c ************************************************************************* c ** RHSNORM ** c ** Take the norm of the right-hand-side and fill the inflow registers c ************************************************************************* subroutine FORT_RHSNORM(rhs,source,DIMS,rnorm, $ uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi) implicit none integer DIMS REAL_T rhs(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T source(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T uinx_lo(lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uinx_hi(lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uiny_lo(lo_1-1:hi_1+1,lo_3-1:hi_3+1) REAL_T uiny_hi(lo_1-1:hi_1+1,lo_3-1:hi_3+1) REAL_T uinz_lo(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T uinz_hi(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T rnorm c Local variables integer i,j,k rnorm = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 rnorm = max(rnorm,abs(rhs(i,j,k))) source(i,j,k) = rhs(i,j,k) enddo enddo enddo do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 uinx_lo(j,k) = rhs(lo_1-1,j,k) uinx_hi(j,k) = rhs(hi_1+1,j,k) enddo enddo do k = lo_3-1,hi_3+1 do i = lo_1-1,hi_1+1 uiny_lo(i,k) = rhs(i,lo_2-1,k) uiny_hi(i,k) = rhs(i,hi_2+1,k) enddo enddo do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 uinz_lo(i,j) = rhs(i,j,lo_3-1) uinz_hi(i,j) = rhs(i,j,hi_3+1) enddo enddo return end c ************************************************************************* c ** RESID ** c ** Compute the residual c ************************************************************************* subroutine FORT_RESID(res,u,f,sigma, $ uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi, $ DIMS,hx,hy,hz,resnorm, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi,level) implicit none integer DIMS REAL_T res(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T f(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uinx_lo(lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uinx_hi(lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uiny_lo(lo_1-1:hi_1+1,lo_3-1:hi_3+1) REAL_T uiny_hi(lo_1-1:hi_1+1,lo_3-1:hi_3+1) REAL_T uinz_lo(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T uinz_hi(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T hx REAL_T hy REAL_T hz REAL_T resnorm integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi integer level c Local variables REAL_T rlu REAL_T dgu REAL_T hxsqinv REAL_T hysqinv REAL_T hzsqinv REAL_T uxx, uxx_lo, uxx_hi REAL_T uyy, uyy_lo, uyy_hi REAL_T uzz, uzz_lo, uzz_hi integer is,ie,js,je,ks,ke integer i,j,k is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) hzsqinv = one/(hz*hz) if (level .eq. 0) then call gsrbvbc(u,uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi, $ DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) endif do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 uxx = ( u(i+1,j,k) - two * u(i,j,k) + u(i-1,j,k) ) uxx_hi = (sixteen * u(ie+1,j,k) - twentyfive * u(ie,j,k) + $ ten * u(ie-1,j,k) - u(ie-2,j,k) ) * fifth uxx_lo = (sixteen * u(is-1,j,k) - twentyfive * u(is,j,k) + $ ten * u(is+1,j,k) - u(is+2,j,k) ) * fifth uxx = cvmgt(uxx_hi, uxx, i .eq. ie .and. $ (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) ) uxx = cvmgt(uxx_lo, uxx, i .eq. is .and. $ (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) ) uyy = ( u(i,j+1,k) - two * u(i,j,k) + u(i,j-1,k) ) uyy_hi = (sixteen * u(i,je+1,k) - twentyfive * u(i,je,k) + $ ten * u(i,je-1,k) - u(i,je-2,k) ) * fifth uyy_lo = (sixteen * u(i,js-1,k) - twentyfive * u(i,js,k) + $ ten * u(i,js+1,k) - u(i,js+2,k) ) * fifth uyy = cvmgt(uyy_hi, uyy, j .eq. je .and. $ (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) ) uyy = cvmgt(uyy_lo, uyy, j .eq. js .and. $ (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) ) uzz = ( u(i,j,k+1) - two * u(i,j,k) + u(i,j,k-1) ) uzz_hi = (sixteen * u(i,j,ke+1) - twentyfive * u(i,j,ke) + $ ten * u(i,j,ke-1) - u(i,j,ke-2) ) * fifth uzz_lo = (sixteen * u(i,j,ks-1) - twentyfive * u(i,j,ks) + $ ten * u(i,j,ks+1) - u(i,j,ks+2) ) * fifth uzz = cvmgt(uzz_hi, uzz, k .eq. ke .and. $ (bcz_hi .eq. WALL .or. bcz_hi .eq. INLET) ) uzz = cvmgt(uzz_lo, uzz, k .eq. ks .and. $ (bcz_lo .eq. WALL .or. bcz_lo .eq. INLET) ) dgu = uxx*hxsqinv + uyy*hysqinv + uzz*hzsqinv rlu = u(i,j,k) - dgu*sigma(i,j,k) res(i,j,k) = f(i,j,k) - rlu enddo enddo enddo resnorm = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 resnorm = max(resnorm,abs(res(i,j,k))) enddo enddo enddo return end c ************************************************************************* c ** GSRBV ** c ** Gauss-Seidel red-black relaxation c ************************************************************************* subroutine FORT_GSRBV(u,f,sigma, $ uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi, $ DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi, $ level,nngsrb) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T f(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T sigma(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uinx_lo(lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uinx_hi(lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uiny_lo(lo_1-1:hi_1+1,lo_3-1:hi_3+1) REAL_T uiny_hi(lo_1-1:hi_1+1,lo_3-1:hi_3+1) REAL_T uinz_lo(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T uinz_hi(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T hx REAL_T hy REAL_T hz integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi integer level integer nngsrb c Local variables REAL_T rlam,rlu REAL_T hxsqinv, hysqinv, hzsqinv REAL_T facx, facy, facz REAL_T uxx, uxx_lo, uxx_hi REAL_T uyy, uyy_lo, uyy_hi REAL_T uzz, uzz_lo, uzz_hi integer i,j,k,iter,ioff,iinc integer is,ie,js,je,ks,ke logical ltestx,ltesty,ltestz is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 hxsqinv = one / (hx*hx) hysqinv = one / (hy*hy) hzsqinv = one / (hz*hz) do iter = 1, nngsrb do ioff = 0,1 if (level .eq. 0) then call gsrbvbc(u,uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi, $ DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) else if (bcx_lo .eq. PERIODIC) then do k = ks,ke do j = js,je u(is-1,j,k) = u(ie,j,k) enddo enddo elseif (bcx_lo .eq. OUTLET) then do k = ks,ke do j = js,je u(is-1,j,k) = u(is,j,k) enddo enddo endif if (bcx_hi .eq. PERIODIC) then do k = ks,ke do j = js,je u(ie+1,j,k) = u(is,j,k) enddo enddo elseif (bcx_hi .eq. OUTLET) then do k = ks,ke do j = js,je u(ie+1,j,k) = u(ie,j,k) enddo enddo endif if (bcy_lo .eq. PERIODIC) then do k = ks,ke do i = is,ie u(i,js-1,k) = u(i,je,k) enddo enddo elseif (bcy_lo .eq. OUTLET) then do k = ks,ke do i = is,ie u(i,js-1,k) = u(i,js,k) enddo enddo endif if (bcy_hi .eq. PERIODIC) then do k = ks,ke do i = is,ie u(i,je+1,k) = u(i,js,k) enddo enddo elseif (bcy_hi .eq. OUTLET) then do k = ks,ke do i = is,ie u(i,je+1,k) = u(i,je,k) enddo enddo endif if (bcz_lo .eq. PERIODIC) then do j = js,je do i = is,ie u(i,j,ks-1) = u(i,j,ke) enddo enddo elseif (bcz_lo .eq. OUTLET) then do j = js,je do i = is,ie u(i,j,ks-1) = u(i,j,ks) enddo enddo endif if (bcz_hi .eq. PERIODIC) then do j = js,je do i = is,ie u(i,j,ke+1) = u(i,j,ks) enddo enddo elseif (bcz_hi .eq. OUTLET) then do j = js,je do i = is,ie u(i,j,ke+1) = u(i,j,ke) enddo enddo endif endif do k = ks,ke ltestz = ( (k .eq. ks .and. (bcz_lo .eq. WALL .or. bcz_lo .eq. INLET) ) .or. $ (k .eq. ke .and. (bcz_hi .eq. WALL .or. bcz_hi .eq. INLET) ) ) ltestz = (ltestz .and. level .eq. 0) facz = cvmgt(five,two,ltestz) do j = js,je ltesty = ( (j .eq. js .and. (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) ) .or. $ (j .eq. je .and. (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) ) ) ltesty = (ltesty .and. level .eq. 0) facy = cvmgt(five,two,ltesty) iinc = mod(j+k+ioff,2) do i = is+iinc,ie,2 ltestx = ( (i .eq. is .and. (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) ) .or. $ (i .eq. ie .and. (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) ) ) ltestx = (ltestx .and. level .eq. 0) facx = cvmgt(five,two,ltestx) rlam = one + sigma(i,j,k)*(facx * hxsqinv + $ facy * hysqinv + $ facz * hzsqinv ) rlam = one/rlam uxx = (u(i+1,j,k) - two*u(i,j,k) + u(i-1,j,k)) uxx_lo = (sixteen*u(is-1,j,k) - twentyfive*u(is,j,k) + $ ten*u(is+1,j,k) - u(is+2,j,k)) * fifth uxx_hi = (sixteen*u(ie+1,j,k) - twentyfive*u(ie,j,k) + $ ten*u(ie-1,j,k) - u(ie-2,j,k)) * fifth uxx = cvmgt(uxx_lo,uxx,i .eq. is .and. ltestx) uxx = cvmgt(uxx_hi,uxx,i .eq. ie .and. ltestx) uyy = (u(i,j+1,k) - two*u(i,j,k) + u(i,j-1,k)) uyy_lo = (sixteen*u(i,js-1,k) - twentyfive*u(i,js,k) + $ ten*u(i,js+1,k) - u(i,js+2,k)) * fifth uyy_hi = (sixteen*u(i,je+1,k) - twentyfive*u(i,je,k) + $ ten*u(i,je-1,k) - u(i,je-2,k)) * fifth uyy = cvmgt(uyy_lo,uyy,j .eq. js .and. ltesty) uyy = cvmgt(uyy_hi,uyy,j .eq. je .and. ltesty) uzz = (u(i,j,k+1) - two*u(i,j,k) + u(i,j,k-1)) uzz_lo = (sixteen*u(i,j,ks-1) - twentyfive*u(i,j,ks) + $ ten*u(i,j,ks+1) - u(i,j,ks+2)) * fifth uzz_hi = (sixteen*u(i,j,ke+1) - twentyfive*u(i,j,ke) + $ ten*u(i,j,ke-1) - u(i,j,ke-2)) * fifth uzz = cvmgt(uzz_lo,uzz,k .eq. ks .and. ltestz) uzz = cvmgt(uzz_hi,uzz,k .eq. ke .and. ltestz) rlu = u(i,j,k) - sigma(i,j,k)*(uxx * hxsqinv + $ uyy * hysqinv + $ uzz * hzsqinv ) u(i,j,k) = u(i,j,k) - rlam*(rlu - f(i,j,k)) enddo enddo enddo enddo if (level .eq. 0) then call gsrbvbc(u,uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi, $ DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) else if (bcx_lo .eq. PERIODIC) then do k = ks,ke do j = js,je u(is-1,j,k) = u(ie,j,k) enddo enddo elseif (bcx_lo .eq. OUTLET) then do k = ks,ke do j = js,je u(is-1,j,k) = u(is,j,k) enddo enddo endif if (bcx_hi .eq. PERIODIC) then do k = ks,ke do j = js,je u(ie+1,j,k) = u(is,j,k) enddo enddo elseif (bcx_hi .eq. OUTLET) then do k = ks,ke do j = js,je u(ie+1,j,k) = u(ie,j,k) enddo enddo endif if (bcy_lo .eq. PERIODIC) then do k = ks,ke do i = is,ie u(i,js-1,k) = u(i,je,k) enddo enddo elseif (bcy_lo .eq. OUTLET) then do k = ks,ke do i = is,ie u(i,js-1,k) = u(i,js,k) enddo enddo endif if (bcy_hi .eq. PERIODIC) then do k = ks,ke do i = is,ie u(i,je+1,k) = u(i,js,k) enddo enddo elseif (bcy_hi .eq. OUTLET) then do k = ks,ke do i = is,ie u(i,je+1,k) = u(i,je,k) enddo enddo endif if (bcz_lo .eq. PERIODIC) then do j = js,je do i = is,ie u(i,j,ks-1) = u(i,j,ke) enddo enddo elseif (bcz_lo .eq. OUTLET) then do j = js,je do i = is,ie u(i,j,ks-1) = u(i,j,ks) enddo enddo endif if (bcz_hi .eq. PERIODIC) then do j = js,je do i = is,ie u(i,j,ke+1) = u(i,j,ks) enddo enddo elseif (bcz_hi .eq. OUTLET) then do j = js,je do i = is,ie u(i,j,ke+1) = u(i,j,ke) enddo enddo endif endif enddo return end c ************************************************************************* c ** GSRBVBC ** c ** Impose phyical boundary conditions c ************************************************************************* subroutine gsrbvbc(u,uinx_lo,uinx_hi,uiny_lo,uiny_hi,uinz_lo,uinz_hi, $ DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uinx_lo(lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uinx_hi(lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T uiny_lo(lo_1-1:hi_1+1,lo_3-1:hi_3+1) REAL_T uiny_hi(lo_1-1:hi_1+1,lo_3-1:hi_3+1) REAL_T uinz_lo(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T uinz_hi(lo_1-1:hi_1+1,lo_2-1:hi_2+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables integer i,j,k,is,ie,js,je,ks,ke is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 c NOTE: WHEN BC = 2 or 3, THE STENCILS ASSUME THE GHOST CELL VALUES c APPLY AT THE EDGE, NOT AT THE CELL OUTSIDE!!! if (bcz_lo .eq. OUTLET) then do j = js,je do i = is,ie u(i,j,ks-1) = u(i,j,ks) enddo enddo elseif (bcz_lo .eq. INLET) then do j = js,je do i = is,ie u(i,j,ks-1) = uinz_lo(i,j) enddo enddo elseif (bcz_lo .eq. WALL) then do j = js,je do i = is,ie u(i,j,ks-1) = zero enddo enddo elseif (bcz_lo .eq. PERIODIC) then do j = js,je do i = is,ie u(i,j,ks-1) = u(i,j,ke) enddo enddo else print *,'bogus bcz_lo in gsrbvbc ',bcz_lo stop endif if (bcz_hi .eq. OUTLET) then do j = js,je do i = is,ie u(i,j,ke+1) = u(i,j,ke) enddo enddo elseif (bcz_hi .eq. INLET) then do j = js,je do i = is,ie u(i,j,ke+1) = uinz_hi(i,j) enddo enddo elseif (bcz_hi .eq. WALL) then do j = js,je do i = is,ie u(i,j,ke+1) = zero enddo enddo elseif (bcz_hi .eq. PERIODIC) then do j = js,je do i = is,ie u(i,j,ke+1) = u(i,j,ks) enddo enddo else print *,'bogus bcz_hi in gsrbvbc ',bcz_hi stop endif if (bcy_lo .eq. OUTLET) then do k = ks,ke do i = is,ie u(i,js-1,k) = u(i,js,k) enddo enddo elseif (bcy_lo .eq. INLET) then do k = ks,ke do i = is,ie u(i,js-1,k) = uiny_lo(i,k) enddo enddo elseif (bcy_lo .eq. WALL) then do k = ks,ke do i = is,ie u(i,js-1,k) = zero enddo enddo elseif (bcy_lo .eq. PERIODIC) then do k = ks,ke do i = is,ie u(i,js-1,k) = u(i,je,k) enddo enddo else print *,'bogus bcy_lo in gsrbvbc ',bcy_lo stop endif if (bcy_hi .eq. OUTLET) then do k = ks,ke do i = is,ie u(i,je+1,k) = u(i,je,k) enddo enddo elseif (bcy_hi .eq. INLET) then do k = ks,ke do i = is,ie u(i,je+1,k) = uiny_hi(i,k) enddo enddo elseif (bcy_hi .eq. WALL) then do k = ks,ke do i = is,ie u(i,je+1,k) = zero enddo enddo elseif (bcy_hi .eq. PERIODIC) then do k = ks,ke do i = is,ie u(i,je+1,k) = u(i,js,k) enddo enddo else print *,'bogus bcy_hi in gsrbvbc ',bcy_hi stop endif if (bcx_lo .eq. OUTLET) then do k = ks,ke do j = js,je u(is-1,j,k) = u(is,j,k) enddo enddo elseif (bcx_lo .eq. INLET) then do k = ks,ke do j = js,je u(is-1,j,k) = uinx_lo(j,k) enddo enddo elseif (bcx_lo .eq. WALL) then do k = ks,ke do j = js,je u(is-1,j,k) = zero enddo enddo elseif (bcx_lo .eq. PERIODIC) then do k = ks,ke do j = js,je u(is-1,j,k) = u(ie,j,k) enddo enddo else print *,'bogus bcx_lo in gsrbvbc ',bcx_lo stop endif if (bcx_hi .eq. OUTLET) then do k = ks,ke do j = js,je u(ie+1,j,k) = u(ie,j,k) enddo enddo elseif (bcx_hi .eq. INLET) then do k = ks,ke do j = js,je u(ie+1,j,k) = uinx_hi(j,k) enddo enddo elseif (bcx_hi .eq. WALL) then do k = ks,ke do j = js,je u(ie+1,j,k) = zero enddo enddo elseif (bcx_hi .eq. PERIODIC) then do k = ks,ke do j = js,je u(ie+1,j,k) = u(is,j,k) enddo enddo else print *,'bogus bcx_hi in gsrbvbc ',bcx_hi stop endif return end c ************************************************************************* c ** RESTRICT ** c ** Conservative restriction of the residual c ************************************************************************* subroutine FORT_RESTRICT(res,resc,DIMS,CDIMS) implicit none integer DIMS integer CDIMS REAL_T res(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T resc(loc_1:hic_1,loc_2:hic_2,loc_3:hic_3) c Local variables integer i,j,k integer twoi,twoj,twok do k = loc_3,hic_3 twok = 2*(k-loc_3)+ lo_3 do j = loc_2,hic_2 twoj = 2*(j-loc_2)+ lo_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+ lo_1 resc(i,j,k) = (res(twoi ,twoj ,twok ) + $ res(twoi+1,twoj ,twok ) + $ res(twoi ,twoj+1,twok ) + $ res(twoi+1,twoj+1,twok ) + $ res(twoi ,twoj ,twok+1) + $ res(twoi+1,twoj ,twok+1) + $ res(twoi ,twoj+1,twok+1) + $ res(twoi+1,twoj+1,twok+1) ) * eighth enddo enddo enddo return end c ************************************************************************* c ** COARSIGV ** c ** Coarsending of the coefficients c ************************************************************************* subroutine FORT_COARSIGV(sigma,sigmac,DIMS,CDIMS) implicit none integer DIMS integer CDIMS REAL_T sigma(lo_1 -1:hi_1 +1,lo_2 -1:hi_2+1 ,lo_3 -1:hi_3 +1) REAL_T sigmac(loc_1-1:hic_1+1,loc_2-1:hic_2+1,loc_3-1:hic_3+1) c Local variables integer i,j,k integer twoi,twoj,twok do k = loc_3,hic_3 twok = 2*(k-loc_3)+ lo_3 do j = loc_2,hic_2 twoj = 2*(j-loc_2)+ lo_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+ lo_1 sigmac(i,j,k) = (sigma(twoi ,twoj ,twok ) + $ sigma(twoi+1,twoj ,twok ) + $ sigma(twoi ,twoj+1,twok ) + $ sigma(twoi+1,twoj+1,twok ) + $ sigma(twoi ,twoj ,twok+1) + $ sigma(twoi+1,twoj ,twok+1) + $ sigma(twoi ,twoj+1,twok+1) + $ sigma(twoi+1,twoj+1,twok+1) ) * eighth enddo enddo enddo return end c ************************************************************************* c ** INTERPOLATE ** c ** Piecewise-constant interpolation c ************************************************************************* subroutine FORT_INTERPOLATE(u,deltac,DIMS,CDIMS) implicit none integer DIMS integer CDIMS REAL_T u(lo_1 -1:hi_1 +1,lo_2 -1:hi_2 +1,lo_3 -1:hi_3 +1) REAL_T deltac(loc_1-1:hic_1+1,loc_2-1:hic_2+1,loc_3-1:hic_3+1) c Local variables integer i,j,k integer twoi,twoj,twok do k = loc_3,hic_3 twok = 2*(k-loc_3)+ lo_3 do j = loc_2,hic_2 twoj = 2*(j-loc_2)+ lo_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+ lo_1 u(twoi ,twoj ,twok ) = u(twoi ,twoj ,twok ) + deltac(i,j,k) u(twoi+1,twoj ,twok ) = u(twoi+1,twoj ,twok ) + deltac(i,j,k) u(twoi ,twoj+1,twok ) = u(twoi ,twoj+1,twok ) + deltac(i,j,k) u(twoi+1,twoj+1,twok ) = u(twoi+1,twoj+1,twok ) + deltac(i,j,k) u(twoi ,twoj ,twok+1) = u(twoi ,twoj ,twok+1) + deltac(i,j,k) u(twoi+1,twoj ,twok+1) = u(twoi+1,twoj ,twok+1) + deltac(i,j,k) u(twoi ,twoj+1,twok+1) = u(twoi ,twoj+1,twok+1) + deltac(i,j,k) u(twoi+1,twoj+1,twok+1) = u(twoi+1,twoj+1,twok+1) + deltac(i,j,k) enddo enddo enddo return end ccseapps-2.5/CCSEApps/varden3d/inputs20000644000175000017500000002374211634153073020724 0ustar amckinstryamckinstry############################################################################# # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 240 ############################################################################# # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################# # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin2 ############################################################################# # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################# # Root part of checkpoint file name check_file_root = chk ############################################################################# # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################# # Root part of plotfile name. plot_file_root = plt ############################################################################# # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################# # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 0.1 ############################################################################# # The acceleration of gravity, assumed to be in the z-direction. # The negative sign indicates that the force acts in the negative # z-direction. gravity = -9.8 ############################################################################# # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 2 ############################################################################# # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 2 ############################################################################# # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ############################################################################# # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ############################################################################# # Boundary conditions in the low z-direction. # If bcz_lo = 1, the domain is periodic in the z-direction. # If bcz_lo = 2, the domain has a solid (reflecting) walls in the low z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_lo = 3, the domain has inflow at low z. # If bcz_lo = 4, the domain has outflow at low z. bcz_lo = 2 ############################################################################# # Boundary conditions in the high z-direction. # If bcz_hi = 1, the domain is periodic in the z-direction. # If bcz_hi = 2, the domain has a solid (reflecting) wall in the high z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_hi = 3, the domain has inflow at high z. # If bcz_hi = 4, the domain has outflow at high z. bcz_hi = 2 ############################################################################# # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. grid.n_cell = 16 16 32 ############################################################################# # The physical coordinates of the low end of the domain. # This is read by the Grid class. grid.prob_lo = 0. 0. 0. ############################################################################# # The physical coordinates of the high end of the domain. # This is read by the Grid class. grid.prob_hi = 1. 1. 2. ############################################################################# # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. # This is read by the Grid class. grid.visc_coef = 0.0 ############################################################################# # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################# # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################# # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################# # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################# # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################# # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################# # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ############################################################################# # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################# # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ############################################################################# ccseapps-2.5/CCSEApps/varden3d/slopex.F0000644000175000017500000001751411634153073021016 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** SLOPEX ** c ** Compute the slope of nvar components of s in the x-direction c ************************************************************************* subroutine FORT_SLOPEX(s,slx,dxscr,DIMS,nvar,bcx_lo,bcx_hi,slope_order) implicit none integer DIMS integer nvar REAL_T s(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,nvar) REAL_T slx(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,nvar) REAL_T dxscr(lo_1-1:hi_1+1,4) integer bcx_lo,bcx_hi integer slope_order c Local variables integer is,js,ks,ie,je,ke integer i,j,k,iv integer cen,lim,flag,fromm REAL_T del,slim,sflag REAL_T dpls,dmin,ds parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) is = lo_1 js = lo_2 ks = lo_3 ie = hi_1 je = hi_2 ke = hi_3 c HERE DOING 1ST ORDER if (slope_order .eq. 0) then do iv = 1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is-1,ie+1 slx(i,j,k,iv) = zero enddo enddo enddo enddo c HERE DOING 2ND ORDER else if (slope_order .eq. 2) then do iv=1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is,ie del = half*(s(i+1,j,k,iv) - s(i-1,j,k,iv)) dpls = two*(s(i+1,j,k,iv) - s(i ,j,k,iv)) dmin = two*(s(i ,j,k,iv) - s(i-1,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(i,j,k,iv)= sflag*min(slim,abs(del)) enddo if (bcx_lo .eq. PERIODIC) then slx(is-1,j,k,iv) = slx(ie,j,k,iv) elseif (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) then slx(is-1,j,k,iv) = zero del = (s(is+1,j,k,iv)+three*s(is,j,k,iv)- $ four*s(is-1,j,k,iv) ) * third dpls = two*(s(is+1,j,k,iv) - s(is ,j,k,iv)) dmin = two*(s(is ,j,k,iv) - s(is-1,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(is,j,k,iv)= sflag*min(slim,abs(del)) elseif (bcx_lo .eq. OUTLET) then slx(is-1,j,k,iv)= zero endif if (bcx_hi .eq. PERIODIC) then slx(ie+1,j,k,iv) = slx(is,j,k,iv) elseif (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) then slx(ie+1,j,k,iv) = zero del = -(s(ie-1,j,k,iv)+three*s(ie,j,k,iv)- $ four*s(ie+1,j,k,iv)) * third dpls = two*(s(ie+1,j,k,iv) - s(ie ,j,k,iv)) dmin = two*(s(ie ,j,k,iv) - s(ie-1,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(ie,j,k,iv)= sflag*min(slim,abs(del)) elseif (bcx_hi .eq. OUTLET) then slx(ie+1,j,k,iv)= zero endif enddo enddo enddo else c HERE DOING 4TH ORDER do iv=1,nvar do k = ks-1,ke+1 do j = js-1,je+1 do i = is,ie dxscr(i,cen) = half*(s(i+1,j,k,iv)-s(i-1,j,k,iv)) dmin = two*(s(i ,j,k,iv)-s(i-1,j,k,iv)) dpls = two*(s(i+1,j,k,iv)-s(i ,j,k,iv)) dxscr(i,lim)= min(abs(dmin),abs(dpls)) dxscr(i,lim) = cvmgp(dxscr(i,lim),zero,dpls*dmin) dxscr(i,flag) = sign(one,dxscr(i,cen)) dxscr(i,fromm)= dxscr(i,flag)*min(dxscr(i,lim), $ abs(dxscr(i,cen))) enddo if (bcx_lo .eq. PERIODIC) then dxscr(is-1,fromm) = dxscr(ie,fromm) else dxscr(is-1,fromm) = dxscr(is,fromm) endif if (bcx_hi .eq. PERIODIC) then dxscr(ie+1,fromm) = dxscr(is,fromm) else dxscr(ie+1,fromm) = dxscr(ie,fromm) endif do i = is,ie ds = two * two3rd * dxscr(i,cen) - $ sixth * (dxscr(i+1,fromm) + dxscr(i-1,fromm)) slx(i,j,k,iv) = dxscr(i,flag)*min(abs(ds),dxscr(i,lim)) enddo if (bcx_lo .eq. PERIODIC) then slx(is-1,j,k,iv)=slx(ie,j,k,iv) elseif (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) then slx(is-1,j,k,iv) = zero del = -sixteen/fifteen*s(is-1,j,k,iv) + half*s(is,j,k,iv) + $ two3rd*s(is+1,j,k,iv) - tenth*s(is+2,j,k,iv) dmin = two*(s(is ,j,k,iv)-s(is-1,j,k,iv)) dpls = two*(s(is+1,j,k,iv)-s(is ,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(is,j,k,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at is+1 using the revised dxscr(is,fromm) dxscr(is,fromm) = slx(is,j,k,iv) ds = two * two3rd * dxscr(is+1,cen) - $ sixth * (dxscr(is+2,fromm) + dxscr(is,fromm)) slx(is+1,j,k,iv) = dxscr(is+1,flag)*min(abs(ds),dxscr(is+1,lim)) elseif (bcx_lo .eq. OUTLET) then slx(is-1,j,k,iv)= zero endif if (bcx_hi .eq. PERIODIC) then slx(ie+1,j,k,iv)=slx(is,j,k,iv) elseif (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) then slx(ie+1,j,k,iv) = zero del = -( -sixteen/fifteen*s(ie+1,j,k,iv) + half*s(ie,j,k,iv) + $ two3rd*s(ie-1,j,k,iv) - tenth*s(ie-2,j,k,iv) ) dmin = two*(s(ie ,j,k,iv)-s(ie-1,j,k,iv)) dpls = two*(s(ie+1,j,k,iv)-s(ie ,j,k,iv)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflag = sign(one,del) slx(ie,j,k,iv)= sflag*min(slim,abs(del)) c Recalculate the slope at ie-1 using the revised dxscr(ie,fromm) dxscr(ie,fromm) = slx(ie,j,k,iv) ds = two * two3rd * dxscr(ie-1,cen) - $ sixth * (dxscr(ie-2,fromm) + dxscr(ie,fromm)) slx(ie-1,j,k,iv) = dxscr(ie-1,flag)*min(abs(ds),dxscr(ie-1,lim)) elseif (bcx_hi .eq. OUTLET) then slx(ie+1,j,k,iv)= zero endif enddo enddo enddo endif return end ccseapps-2.5/CCSEApps/varden3d/inputs40000644000175000017500000002376311634153073020731 0ustar amckinstryamckinstry############################################################################## # Maximum number of steps to run the calculation. Note that if # time = stop_time is reached first, the calculation will end with # nstep < max_step. max_step = 20 ############################################################################## # Maximum time at which to stop the calculation. Note that if # nstep = max_step is reached before time = stop_time,the calculation # will end with time < stop_time. stop_time = 1000000. ############################################################################## # Name of "probin" file to be read (defaults to "probin" if not set) probin_file = probin4 ############################################################################## # Frequency of checkpoint file generation. The code will write a # checkpoint file every check_int timesteps. These can be used to # restart the calculation. check_int = 100 ############################################################################## # Root part of checkpoint file name check_file_root = chk ############################################################################## # Frequency of plot file generation. The code will write a # plot file every plot_int timesteps. The plot file at nstep = 30, # for example, will be named plt0030. These plot files can be # viewed using the visualization tool "amrvis2d." plot_int = 10 ############################################################################## # Root part of plotfile name. plot_file_root = plt4_ ############################################################################## # CFL number for timestep constraint. The timestep is determined by # computing the largest stable timestep (based on the constraint for # explicit advection) and multiplying it by this number. cfl = .5 ############################################################################## # The factor by which to shrink the initial timestep. This is used to # initialize calculations with very unstable initial data. This factor # is only applied when the very first timestep is calculated. After that # point, the timestep is allowed to grow at most 10% per timestep. init_shrink = 1.0 ############################################################################## # The acceleration of gravity, assumed to be in the z-direction. # The negative sign indicates that the force acts in the negative # z-direction. gravity = 0.0 ############################################################################## # Boundary conditions in the low x-direction. # If bcx_lo = 1, the domain is periodic in the x-direction. # If bcx_lo = 2, the domain has a solid (reflecting) walls in the low x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_lo = 3, the domain has inflow at low x. # If bcx_lo = 4, the domain has outflow at low x. bcx_lo = 3 ############################################################################## # Boundary conditions in the high x-direction. # If bcx_hi = 1, the domain is periodic in the x-direction. # If bcx_hi = 2, the domain has a solid (reflecting) wall in the high x-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcx_hi = 3, the domain has inflow at high x. # If bcx_hi = 4, the domain has outflow at high x. bcx_hi = 4 ############################################################################## # Boundary conditions in the low y-direction. # If bcy_lo = 1, the domain is periodic in the y-direction. # If bcy_lo = 2, the domain has a solid (reflecting) walls in the low y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_lo = 3, the domain has inflow at low y. # If bcy_lo = 4, the domain has outflow at low y. bcy_lo = 2 ############################################################################## # Boundary conditions in the high y-direction. # If bcy_hi = 1, the domain is periodic in the y-direction. # If bcy_hi = 2, the domain has a solid (reflecting) wall in the high y-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcy_hi = 3, the domain has inflow at high y. # If bcy_hi = 4, the domain has outflow at high y. bcy_hi = 2 ############################################################################## # Boundary conditions in the low z-direction. # If bcz_lo = 1, the domain is periodic in the z-direction. # If bcz_lo = 2, the domain has a solid (reflecting) walls in the low z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_lo = 3, the domain has inflow at low z. # If bcz_lo = 4, the domain has outflow at low z. bcz_lo = 2 ############################################################################## # Boundary conditions in the high z-direction. # If bcz_hi = 1, the domain is periodic in the z-direction. # If bcz_hi = 2, the domain has a solid (reflecting) wall in the high z-dir. # (For visc_coef > 0 this is a no-slip wall; # for visc_coef <= 0 this is a slip wall.) # If bcz_hi = 3, the domain has inflow at high z. # If bcz_hi = 4, the domain has outflow at high z. bcz_hi = 2 ############################################################################## # The number of cells in the two coordinate directions. For optimal # multigrid performance each value should be a power of 2. # This is read by the Grid class. grid.n_cell = 32 16 16 ############################################################################## # The physical coordinates of the low end of the domain. # This is read by the Grid class. grid.prob_lo = 0. 0. 0. ############################################################################## # The physical coordinates of the high end of the domain. # This is read by the Grid class. grid.prob_hi = 2. 1. 1. ############################################################################## # The dynamic viscosity, assumed constant. If this coefficient is positive, # the algorithm uses a Crank-Nicholson discretization of the viscous terms # in the momentum equation. If this coefficient is zero or negative, # the equations are assumed to be inviscid. # This is read by the Grid class. grid.visc_coef = 0.001 ############################################################################## # The diffusion coefficient for each scalar, assumed constant. # If this coefficient is positive, the algorithm uses a Crank-Nicholson # discretization of the diffusive terms in the scalar update equation. # If this coefficient is zero or negative, it is assumed there is no diffusion. # There is one flag for each scalar variable. Note: the code will object # if you try to diffuse density. # This is read by the Grid class. grid.diff_coef = 0.0 0.01 ############################################################################## # The flag which determines how to difference the edge states of the # advected scalars. If is_conserv = 1, the edge states are multiplied # by edge velocities and the fluxes are differenced; if is_conserv = 0 # the edge velocities are averaged and multiplied by the difference of # the edge states. There is one flag for each scalar variable. # This is read by the Grid class. grid.is_conserv = 1 0 ############################################################################## # The order of the slope calculation. If slope_order = 0, the slopes # are set to zero; if slope_order = 2 a second-order accurate slope # calculation is done; if slope_order = 4 a fourth-order accurate slope # calculation is done. In all cases the higher-order slopes are then # monotonicity-limited, reducing the order in regions of strong gradients. # This is read by the Grid class. grid.slope_order= 4 ############################################################################## # The number of iterations taken before the first time step in order # to compute the initial pressure. # This is read by the Grid class. grid.init_iter = 2 ############################################################################## # The tolerance to determine convergence of the nodal projection. # This is read by the hg_projector class. hg.tol = 1.e-12 ############################################################################## # The tolerance to determine convergence of the MAC projection. # This is read by the mac_projector class. mac.tol = 1.e-12 ############################################################################## # The tolerance to determine convergence of the diffusive solves. # This is read by the diffuser class. diff.tol = 1.e-12 ################################################################################ # The number of smoothing steps as you coarsen and as you refine during # the nodal projection hg.numSmoothCoarsen = 2 hg.numSmoothRefine = 2 ############################################################################## # The number of smoothing steps as you coarsen and as you refine during # the MAC projection mac.numSmoothCoarsen = 2 mac.numSmoothRefine = 2 ############################################################################## # The number of smoothing steps as you coarsen and as you refine during # the diffusive solves. diff.numSmoothCoarsen = 2 diff.numSmoothRefine = 2 ####################################################################### # Flag which determines the level of verbosity of the multigrid class. # This is read by the multigrid class. The value should be 0 for # no verbosity, 1 for some verbosity, 2 for maximum verbosity. multigrid.verbose = 1 ############################################################################## # Flag which determines whether the max norm of the residual should be # printed at every level of the multigrid V-cycle. This is used only # for debugging purposes. This flag should be either 0 or 1. multigrid.debug = 0 ############################################################################## ccseapps-2.5/CCSEApps/varden3d/OpenSource.txt0000644000175000017500000002434711634153073022222 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: VarDen Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/varden3d/probin30000644000175000017500000000004211634153073020660 0ustar amckinstryamckinstry $fortin prob_type = 3 $end ccseapps-2.5/CCSEApps/varden3d/globals.H0000644000175000017500000000300511634153073021117 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GLOBALS_H_ #define _GLOBALS_H_ extern Real gravity; extern int bcx_lo; extern int bcx_hi; extern int bcy_lo; extern int bcy_hi; extern int bcz_lo; extern int bcz_hi; extern const int * lo; extern const int * hi; #endif ccseapps-2.5/CCSEApps/varden3d/mkforce.F0000644000175000017500000000455211634153073021130 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "GRID_F.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 c ************************************************************************* c ** MKFORCE ** c ** Define the forcing terms in the momentum equation c *************************************************************** subroutine FORT_MKFORCE(force,u,v,w,rho,gravity,visc_coef,time,dx,DIMS) implicit none integer DIMS REAL_T force(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1,3) REAL_T u(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T v(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T w(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T gravity REAL_T time REAL_T dx(3) REAL_T visc_coef c Local variables integer i,j,k do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 force(i,j,k,1) = zero force(i,j,k,2) = zero force(i,j,k,3) = gravity enddo enddo enddo return end ccseapps-2.5/CCSEApps/varden3d/mac.F0000644000175000017500000007353511634153073020251 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #include "REAL.H" #include "CONSTANTS.H" #include "MACPROJ_F.H" #include "BCTypes.H" #define DIMS lo_1,lo_2,lo_3,hi_1,hi_2,hi_3 #define CDIMS loc_1,loc_2,loc_3,hic_1,hic_2,hic_3 c ************************************************************************* c ** INITSIGMA ** c ** Define the 1/rho coefficients at the top level of the multigrid c ************************************************************************* subroutine FORT_INITSIGMA(sigmax,sigmay,sigmaz,rho,DIMS, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T sigmax(lo_1 :hi_1+1,lo_2 :hi_2 , lo_3 :hi_3) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2+1, lo_3 :hi_3) REAL_T sigmaz(lo_1 :hi_1 ,lo_2 :hi_2 , lo_3 :hi_3+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1, lo_3-1:hi_3+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables integer i,j,k REAL_T minsig,maxsig do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1+1,hi_1 sigmax(i,j,k) = two / (rho(i,j,k) + rho(i-1,j,k)) enddo if (bcx_lo .eq. PERIODIC) then sigmax(lo_1,j,k) = two / (rho(lo_1,j,k) + rho(hi_1,j,k)) else if (bcx_lo .eq. WALL) then sigmax(lo_1,j,k) = one / rho(lo_1,j,k) else if (bcx_lo .eq. INLET) then sigmax(lo_1,j,k) = one / rho(lo_1-1,j,k) else if (bcx_lo .eq. OUTLET) then sigmax(lo_1,j,k) = one / rho(lo_1,j,k) endif if (bcx_hi .eq. PERIODIC) then sigmax(hi_1+1,j,k) = sigmax(lo_1,j,k) else if (bcx_hi .eq. WALL) then sigmax(hi_1+1,j,k) = one / rho(hi_1,j,k) else if (bcx_hi .eq. INLET) then sigmax(hi_1+1,j,k) = one / rho(hi_1+1,j,k) else if (bcx_hi .eq. OUTLET) then sigmax(hi_1+1,j,k) = one / rho(hi_1,j,k) endif enddo enddo do k = lo_3,hi_3 do i = lo_1,hi_1 do j = lo_2+1,hi_2 sigmay(i,j,k) = two / (rho(i,j,k) + rho(i,j-1,k)) enddo if (bcy_lo .eq. PERIODIC) then sigmay(i,lo_2,k) = two / (rho(i,lo_2,k) + rho(i,hi_2,k)) else if (bcy_lo .eq. WALL) then sigmay(i,lo_2,k) = one / rho(i,lo_2 ,k) else if (bcy_lo .eq. INLET) then sigmay(i,lo_2,k) = one / rho(i,lo_2-1,k) else if (bcy_lo .eq. OUTLET) then sigmay(i,lo_2,k) = one / rho(i,lo_2 ,k) endif if (bcy_hi .eq. PERIODIC) then sigmay(i,hi_2+1,k) = sigmay(i,lo_2,k) else if (bcy_hi .eq. WALL) then sigmay(i,hi_2+1,k) = one / rho(i,hi_2 ,k) else if (bcy_hi .eq. INLET) then sigmay(i,hi_2+1,k) = one / rho(i,hi_2+1,k) else if (bcy_hi .eq. OUTLET) then sigmay(i,hi_2+1,k) = one / rho(i,hi_2 ,k) endif enddo enddo do j = lo_2,hi_2 do i = lo_1,hi_1 do k = lo_3+1,hi_3 sigmaz(i,j,k) = two / (rho(i,j,k) + rho(i,j,k-1)) enddo if (bcz_lo .eq. PERIODIC) then sigmaz(i,j,lo_3) = two / (rho(i,j,lo_3) + rho(i,j,hi_3)) else if (bcz_lo .eq. WALL) then sigmaz(i,j,lo_3) = one / rho(i,j,lo_3) else if (bcz_lo .eq. INLET) then sigmaz(i,j,lo_3) = one / rho(i,j,lo_3-1) else if (bcz_lo .eq. OUTLET) then sigmaz(i,j,lo_3) = one / rho(i,j,lo_3) endif if (bcz_hi .eq. PERIODIC) then sigmaz(i,j,hi_3+1) = sigmaz(i,j,lo_3) else if (bcz_hi .eq. WALL) then sigmaz(i,j,hi_3+1) = one / rho(i,j,hi_3) else if (bcz_hi .eq. INLET) then sigmaz(i,j,hi_3+1) = one / rho(i,j,hi_3+1) else if (bcz_hi .eq. OUTLET) then sigmaz(i,j,hi_3+1) = one / rho(i,j,hi_3) endif enddo enddo return end c ************************************************************************* c ** GRADMAC ** c ** Compute the gradient of phi c ************************************************************************* subroutine FORT_GRADMAC(gradpx,gradpy,gradpz,phi,DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T phi(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T gradpx(lo_1:hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T gradpy(lo_1:hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T gradpz(lo_1:hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T hx REAL_T hy REAL_T hz integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables integer i, is, ie, j, js, je, k, ks, ke is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 call bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) do k = ks,ke do j = js,je do i = is,ie+1 gradpx(i,j,k) = (phi(i,j,k) - phi(i-1,j,k))/hx enddo if (bcx_lo .eq. WALL .or. bcx_lo .eq. INLET) then gradpx(is ,j,k) = zero endif if (bcx_hi .eq. WALL .or. bcx_hi .eq. INLET) then gradpx(ie+1,j,k) = zero endif enddo enddo do k = ks,ke do i = is,ie do j = js,je+1 gradpy(i,j,k) = (phi(i,j,k) - phi(i,j-1,k))/hy enddo if (bcy_lo .eq. WALL .or. bcy_lo .eq. INLET) then gradpy(i,js ,k)= zero endif if (bcy_hi .eq. WALL .or. bcy_hi .eq. INLET) then gradpy(i,je+1,k) = zero endif enddo enddo do j = js,je do i = is,ie do k = ks,ke+1 gradpz(i,j,k) = (phi(i,j,k) - phi(i,j,k-1))/hz enddo if (bcz_lo .eq. WALL .or. bcz_lo .eq. INLET) then gradpz(i,j,ks )= zero endif if (bcz_hi .eq. WALL .or. bcz_hi .eq. INLET) then gradpz(i,j,ke+1) = zero endif enddo enddo return end c ************************************************************************* c ** PROJUMAC ** c ** Update the edge-based velocities c ************************************************************************* subroutine FORT_PROJUMAC(uadv,vadv,wadv,gradpx,gradpy,gradpz,rho,DIMS) implicit none integer DIMS REAL_T uadv(lo_1 :hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vadv(lo_1 :hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wadv(lo_1 :hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T gradpx(lo_1 :hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T gradpy(lo_1 :hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T gradpz(lo_1 :hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T rho(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) c Local variables REAL_T rhx,rhy,rhz integer i,j,k do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1+1 rhx = two / (rho(i,j,k) + rho(i-1,j,k)) uadv(i,j,k) = uadv(i,j,k) - gradpx(i,j,k) * rhx enddo enddo enddo do k = lo_3,hi_3 do j = lo_2,hi_2+1 do i = lo_1,hi_1 rhy = two / (rho(i,j,k) + rho(i,j-1,k)) vadv(i,j,k) = vadv(i,j,k) - gradpy(i,j,k) * rhy enddo enddo enddo do k = lo_3,hi_3+1 do j = lo_2,hi_2 do i = lo_1,hi_1 rhz = two / (rho(i,j,k) + rho(i,j,k-1)) wadv(i,j,k) = wadv(i,j,k) - gradpz(i,j,k) * rhz enddo enddo enddo return end c ************************************************************************* c ** RESIDUAL ** c ** Compute the residual R = f - D( sig G(phi) ) c ************************************************************************* subroutine FORT_RESIDUAL(resid,phi,f,sigmax,sigmay,sigmaz,DIMS, $ hx,hy,hz,resnorm, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T resid(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T phi(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T f(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T sigmax(lo_1 :hi_1+1,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2+1,lo_3 :hi_3 ) REAL_T sigmaz(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1) REAL_T hx REAL_T hy REAL_T hz REAL_T resnorm integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables REAL_T hxsqinv, hysqinv, hzsqinv REAL_T rfac, corr integer i,j,k hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) hzsqinv = one/(hz*hz) resnorm = zero call bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 rfac = ( sigmax(i+1,j,k) + sigmax(i,j,k))*hxsqinv + $ ( sigmay(i,j+1,k) + sigmay(i,j,k))*hysqinv + $ ( sigmaz(i,j,k+1) + sigmaz(i,j,k))*hzsqinv corr = $ ( sigmax(i+1,j,k)*phi(i+1,j,k) + sigmax(i,j,k)*phi(i-1,j,k))*hxsqinv $ +( sigmay(i,j+1,k)*phi(i,j+1,k) + sigmay(i,j,k)*phi(i,j-1,k))*hysqinv $ +( sigmaz(i,j,k+1)*phi(i,j,k+1) + sigmaz(i,j,k)*phi(i,j,k-1))*hzsqinv resid(i,j,k) = f(i,j,k) - (corr - rfac*phi(i,j,k)) resnorm = max(abs(resid(i,j,k)), resnorm) enddo enddo enddo return end c ************************************************************************* c ** GSRB ** c ** Gauss-Seidel red-black relaxation c ************************************************************************* subroutine FORT_GSRB(phi,f,sigmax,sigmay,sigmaz,DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi,nngsrb) implicit none integer DIMS REAL_T phi(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T f(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T sigmax(lo_1 :hi_1+1,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2+1,lo_3 :hi_3 ) REAL_T sigmaz(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1) REAL_T hx REAL_T hy REAL_T hz integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi integer nngsrb c Local variables REAL_T hxsq, hysq, hzsq, rfac, corr integer i, j, k integer iter, ioff, iinc hxsq = hx*hx hysq = hy*hy hzsq = hz*hz call bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) do iter = 1, nngsrb do ioff = 0,1 do k = lo_3,hi_3 do j = lo_2,hi_2 iinc = mod(j+k+ioff,2) do i = lo_1+iinc,hi_1,2 rfac = (sigmax(i+1,j,k) + sigmax(i,j,k))/hxsq + $ (sigmay(i,j+1,k) + sigmay(i,j,k))/hysq + $ (sigmaz(i,j,k+1) + sigmaz(i,j,k))/hzsq corr = $ ( sigmax(i+1,j,k)*phi(i+1,j,k) + sigmax(i,j,k)*phi(i-1,j,k))/hxsq + $ ( sigmay(i,j+1,k)*phi(i,j+1,k) + sigmay(i,j,k)*phi(i,j-1,k))/hysq + $ ( sigmaz(i,j,k+1)*phi(i,j,k+1) + sigmaz(i,j,k)*phi(i,j,k-1))/hzsq phi(i,j,k) = (corr - f(i,j,k))/rfac enddo enddo enddo call bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) enddo enddo return end c ************************************************************************* c ** BC ** c ** Impose boundary conditions c ************************************************************************* subroutine bc(phi,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T phi(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables integer i, j, k, is, ie, js, je, ks, ke is = lo_1 ie = hi_1 js = lo_2 je = hi_2 ks = lo_3 ke = hi_3 if (bcz_lo .eq. OUTLET) then do j = js,je do i = is,ie phi(i,j,ks-1) = -phi(i,j,ks) enddo enddo elseif (bcz_lo .eq. INLET) then do j = js,je do i = is,ie phi(i,j,ks-1) = phi(i,j,ks) enddo enddo elseif (bcz_lo .eq. WALL) then do j = js,je do i = is,ie phi(i,j,ks-1) = phi(i,j,ks) enddo enddo elseif (bcz_lo .eq. PERIODIC) then do j = js,je do i = is,ie phi(i,j,ks-1) = phi(i,j,ke) enddo enddo else print *,'bogus bcz_lo in bc ',bcz_lo stop endif if (bcz_hi .eq. OUTLET) then do j = js,je do i = is,ie phi(i,j,ke+1) = -phi(i,j,ke) enddo enddo elseif (bcz_hi .eq. INLET) then do j = js,je do i = is,ie phi(i,j,ke+1) = phi(i,j,ke) enddo enddo elseif (bcz_hi .eq. WALL) then do j = js,je do i = is,ie phi(i,j,ke+1) = phi(i,j,ke) enddo enddo elseif (bcz_hi .eq. PERIODIC) then do j = js,je do i = is,ie phi(i,j,ke+1) = phi(i,j,ks) enddo enddo else print *,'bogus bcz_hi in bc ',bcz_hi stop endif if (bcy_lo .eq. OUTLET) then do k = ks-1,ke+1 do i = is,ie phi(i,js-1,k) = -phi(i,js,k) enddo enddo elseif (bcy_lo .eq. INLET) then do k = ks-1,ke+1 do i = is,ie phi(i,js-1,k) = phi(i,js,k) enddo enddo elseif (bcy_lo .eq. WALL) then do k = ks-1,ke+1 do i = is,ie phi(i,js-1,k) = phi(i,js,k) enddo enddo elseif (bcy_lo .eq. PERIODIC) then do k = ks-1,ke+1 do i = is,ie phi(i,js-1,k) = phi(i,je,k) enddo enddo else print *,'bogus bcy_lo in bc ',bcy_lo stop endif if (bcy_hi .eq. OUTLET) then do k = ks-1,ke+1 do i = is,ie phi(i,je+1,k) = -phi(i,je,k) enddo enddo elseif (bcy_hi .eq. INLET) then do k = ks-1,ke+1 do i = is,ie phi(i,je+1,k) = phi(i,je,k) enddo enddo elseif (bcy_hi .eq. WALL) then do k = ks-1,ke+1 do i = is,ie phi(i,je+1,k) = phi(i,je,k) enddo enddo elseif (bcy_hi .eq. PERIODIC) then do k = ks-1,ke+1 do i = is,ie phi(i,je+1,k) = phi(i,js,k) enddo enddo else print *,'bogus bcy_hi in bc ',bcy_hi stop endif if (bcx_lo .eq. OUTLET) then do k = ks-1,ke+1 do j = js-1,je+1 phi(is-1,j,k) = -phi(is,j,k) enddo enddo elseif (bcx_lo .eq. INLET) then do k = ks-1,ke+1 do j = js-1,je+1 phi(is-1,j,k) = phi(is,j,k) enddo enddo elseif (bcx_lo .eq. WALL) then do k = ks-1,ke+1 do j = js-1,je+1 phi(is-1,j,k) = phi(is,j,k) enddo enddo elseif (bcx_lo .eq. PERIODIC) then do k = ks-1,ke+1 do j = js-1,je+1 phi(is-1,j,k) = phi(ie,j,k) enddo enddo else print *,'bogus bcx_lo in bc ',bcx_lo stop endif if (bcx_hi .eq. OUTLET) then do k = ks-1,ke+1 do j = js-1,je+1 phi(ie+1,j,k) = -phi(ie,j,k) enddo enddo elseif (bcx_hi .eq. INLET) then do k = ks-1,ke+1 do j = js-1,je+1 phi(ie+1,j,k) = phi(ie,j,k) enddo enddo elseif (bcx_hi .eq. WALL) then do k = ks-1,ke+1 do j = js-1,je+1 phi(ie+1,j,k) = phi(ie,j,k) enddo enddo elseif (bcx_hi .eq. PERIODIC) then do k = ks-1,ke+1 do j = js-1,je+1 phi(ie+1,j,k) = phi(is,j,k) enddo enddo else print *,'bogus bcx_hi in bc ',bcx_hi stop endif return end c ************************************************************************* c ** RHSMAC ** c ** Compute the right-hand-side D(U) for the MAC projection c ************************************************************************* subroutine FORT_RHSMAC(uadv,vadv,wadv,divu_src,rhs,DIMS,hx,hy,hz,rhsnorm) implicit none integer DIMS REAL_T uadv(lo_1 :hi_1+1,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T vadv(lo_1 :hi_1 ,lo_2:hi_2+1,lo_3:hi_3 ) REAL_T wadv(lo_1 :hi_1 ,lo_2:hi_2 ,lo_3:hi_3+1) REAL_T divu_src(lo_1 :hi_1 ,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T rhs(lo_1 :hi_1 ,lo_2:hi_2 ,lo_3:hi_3 ) REAL_T hx REAL_T hy REAL_T hz REAL_T rhsnorm c Local variables integer i,j,k rhsnorm = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 rhs(i,j,k) = (uadv(i+1,j,k) - uadv(i,j,k)) / hx + $ (vadv(i,j+1,k) - vadv(i,j,k)) / hy + $ (wadv(i,j,k+1) - wadv(i,j,k)) / hz rhs(i,j,k) = rhs(i,j,k) - divu_src(i,j,k) rhsnorm = max(rhsnorm,abs(rhs(i,j,k))) enddo enddo enddo return end c ************************************************************************* c ** COARSIGMA ** c ** Coarsen the edge-based sigma coefficients c ************************************************************************* subroutine FORT_COARSIGMA(sigmax,sigmay,sigmaz, $ sigmaxc,sigmayc,sigmazc,DIMS,CDIMS) implicit none integer DIMS integer CDIMS REAL_T sigmax(lo_1 :hi_1 +1,lo_2 :hi_2 ,lo_3:hi_3 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2 +1,lo_3:hi_3 ) REAL_T sigmaz(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3:hi_3+1) REAL_T sigmaxc(loc_1:hic_1+1,loc_2:hic_2 ,loc_3:hic_3 ) REAL_T sigmayc(loc_1:hic_1 ,loc_2:hic_2+1,loc_3:hic_3 ) REAL_T sigmazc(loc_1:hic_1 ,loc_2:hic_2 ,loc_3:hic_3+1) c Local variables integer i,j,k,twoi,twoj,twok do k = loc_3,hic_3 twok = 2*(k-loc_3)+lo_3 do j = loc_2,hic_2 twoj = 2*(j-loc_2)+lo_2 do i = loc_1,hic_1+1 twoi = 2*(i-loc_1)+lo_1 sigmaxc(i,j,k) = fourth*(sigmax(twoi,twoj ,twok ) + $ sigmax(twoi,twoj+1,twok ) + $ sigmax(twoi,twoj ,twok+1) + $ sigmax(twoi,twoj+1,twok+1) ) enddo enddo enddo do k = loc_3,hic_3 twok = 2*(k-loc_3)+lo_3 do j = loc_2,hic_2+1 twoj = 2*(j-loc_2)+lo_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+lo_1 sigmayc(i,j,k) = fourth*(sigmay(twoi ,twoj,twok ) + $ sigmay(twoi+1,twoj,twok ) + $ sigmay(twoi ,twoj,twok+1) + $ sigmay(twoi+1,twoj,twok+1) ) enddo enddo enddo do k = loc_3,hic_3+1 twok = 2*(k-loc_3)+lo_3 do j = loc_2,hic_2 twoj = 2*(j-loc_2)+lo_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+lo_1 sigmazc(i,j,k) = fourth*(sigmaz(twoi ,twoj ,twok) + $ sigmaz(twoi+1,twoj ,twok) + $ sigmaz(twoi ,twoj+1,twok) + $ sigmaz(twoi+1,twoj+1,twok) ) enddo enddo enddo return end c ************************************************************************* c ** RESTRICT ** c ** Conservatively average the residual c ************************************************************************* subroutine FORT_RESTRICT(res,resc,DIMS,CDIMS) implicit none integer DIMS integer CDIMS REAL_T res(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3) REAL_T resc(loc_1:hic_1,loc_2:hic_2,loc_3:hic_3) c Local variables integer i,j,k,twoi,twoj,twok do k = loc_3,hic_3 twok = 2*(k-loc_3)+lo_3 do j = loc_2,hic_2 twoj = 2*(j-loc_2)+lo_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+lo_1 resc(i,j,k) = (res(twoi ,twoj,twok ) + res(twoi ,twoj+1,twok ) + $ res(twoi+1,twoj,twok ) + res(twoi+1,twoj+1,twok ) + $ res(twoi ,twoj,twok+1) + res(twoi ,twoj+1,twok+1) + $ res(twoi+1,twoj,twok+1) + res(twoi+1,twoj+1,twok+1) ) resc(i,j,k) = resc(i,j,k) * eighth enddo enddo enddo return end c ************************************************************************* c ** INTERPOLATE ** c ** Piecewise constant interpolation c ************************************************************************* subroutine FORT_INTERPOLATE(phi,deltac,DIMS,CDIMS) implicit none integer DIMS integer CDIMS REAL_T phi(lo_1 -1:hi_1 +1,lo_2 -1:hi_2 +1,lo_3 -1:hi_3 +1) REAL_T deltac(loc_1-1:hic_1+1,loc_2-1:hic_2+1,loc_3-1:hic_3+1) c Local variables integer i,j,k,twoi,twoj,twok do k = loc_3,hic_3 twok = 2*(k-loc_3)+lo_3 do j = loc_2,hic_2 twoj = 2*(j-loc_2)+lo_2 do i = loc_1,hic_1 twoi = 2*(i-loc_1)+lo_1 phi(twoi ,twoj ,twok ) = phi(twoi ,twoj ,twok ) + deltac(i,j,k) phi(twoi+1,twoj ,twok ) = phi(twoi+1,twoj ,twok ) + deltac(i,j,k) phi(twoi ,twoj+1,twok ) = phi(twoi ,twoj+1,twok ) + deltac(i,j,k) phi(twoi+1,twoj+1,twok ) = phi(twoi+1,twoj+1,twok ) + deltac(i,j,k) phi(twoi ,twoj ,twok+1) = phi(twoi ,twoj ,twok+1) + deltac(i,j,k) phi(twoi+1,twoj ,twok+1) = phi(twoi+1,twoj ,twok+1) + deltac(i,j,k) phi(twoi ,twoj+1,twok+1) = phi(twoi ,twoj+1,twok+1) + deltac(i,j,k) phi(twoi+1,twoj+1,twok+1) = phi(twoi+1,twoj+1,twok+1) + deltac(i,j,k) enddo enddo enddo return end c ************************************************************************* c ** SOLVEMAC ** c ** Conjugate gradient bottom-solver c ************************************************************************* subroutine FORT_SOLVEMAC(dest, dest0, source, sigmax, sigmay, sigmaz, $ sum, r, w, z, work, DIMS , hx, hy, hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi, $ norm, prob_norm) implicit none integer DIMS REAL_T dest(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T dest0(lo_1-1:hi_1+1,lo_2-1:hi_2+1,lo_3-1:hi_3+1) REAL_T source(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T sigmax(lo_1 :hi_1+1,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2+1,lo_3 :hi_3 ) REAL_T sigmaz(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3+1) REAL_T sum(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T r(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T w(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T z(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T work(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3 :hi_3 ) REAL_T hx REAL_T hy REAL_T hz integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi REAL_T norm REAL_T prob_norm c Local variables integer i,j,k,is,ie,js,je,ks,ke,iter REAL_T alpha, beta, rho, rhol REAL_T local_norm REAL_T tol, tolfac REAL_T hxsqinv REAL_T hysqinv REAL_T hzsqinv tolfac = 1.0d-3 hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) hzsqinv = one/(hz*hz) call bc(dest,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) do k = lo_3-1,hi_3+1 do j = lo_2-1,hi_2+1 do i = lo_1-1,hi_1+1 dest0(i,j,k) = dest(i,j,k) dest(i,j,k) = zero enddo enddo enddo 10 do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 w(i,j,k) = $ ( sigmax(i+1,j,k)*dest0(i+1,j,k) + $ sigmax(i ,j,k)*dest0(i-1,j,k) )*hxsqinv + $ ( sigmay(i,j+1,k)*dest0(i,j+1,k) + $ sigmay(i,j ,k)*dest0(i,j-1,k) )*hysqinv + $ ( sigmaz(i,j,k+1)*dest0(i,j,k+1) + $ sigmaz(i,j,k )*dest0(i,j,k-1) )*hzsqinv - $ ( (sigmax(i+1,j,k) + sigmax(i,j,k))*hxsqinv + $ (sigmay(i,j+1,k) + sigmay(i,j,k))*hysqinv + $ (sigmaz(i,j,k+1) + sigmaz(i,j,k))*hzsqinv )*dest0(i,j,k) enddo enddo enddo do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 r(i,j,k) = source(i,j,k) - w(i,j,k) enddo enddo enddo rho = zero local_norm = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 z(i,j,k) = r(i,j,k) / sum(i,j,k) rho = rho + z(i,j,k) * r(i,j,k) local_norm = max(local_norm,abs(r(i,j,k))) enddo enddo enddo norm = local_norm tol = Max(tolfac*local_norm,1.0d-15*prob_norm) if (norm .le. tol) return do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 work(i,j,k) = zero dest(i,j,k) = z(i,j,k) enddo enddo enddo iter = 0 c write(6,1000) iter, norm/prob_norm 100 call bc(dest,DIMS,bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 w(i,j,k) = $ ( sigmax(i+1,j,k)*dest(i+1,j,k) + $ sigmax(i ,j,k)*dest(i-1,j,k) )*hxsqinv + $ ( sigmay(i,j+1,k)*dest(i,j+1,k) + $ sigmay(i,j ,k)*dest(i,j-1,k) )*hysqinv + $ ( sigmaz(i,j,k+1)*dest(i,j,k+1) + $ sigmaz(i,j,k )*dest(i,j,k-1) )*hzsqinv - $ ( (sigmax(i+1,j,k) + sigmax(i,j,k))*hxsqinv + $ (sigmay(i,j+1,k) + sigmay(i,j,k))*hysqinv + $ (sigmaz(i,j,k+1) + sigmaz(i,j,k))*hzsqinv )*dest(i,j,k) enddo enddo enddo alpha = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 alpha = alpha + dest(i,j,k)*w(i,j,k) enddo enddo enddo alpha = rho / alpha rhol = rho rho = zero norm = zero do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 work(i,j,k) = work(i,j,k) + alpha * dest(i,j,k) r(i,j,k) = r(i,j,k) - alpha * w(i,j,k) z(i,j,k) = r(i,j,k) / sum(i,j,k) rho = rho + z(i,j,k) * r(i,j,k) norm = max(norm,abs(r(i,j,k))) enddo enddo enddo iter = iter+1 c write(6,1000) iter, norm/prob_norm if (norm .le. tol) then do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 dest(i,j,k) = work(i,j,k) + dest0(i,j,k) enddo enddo enddo else if (iter .ge. 100 .or. norm .ge. 100.d0*local_norm) then tolfac = 10.d0 * tolfac iter = 1 do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 dest(i,j,k) = zero enddo enddo enddo goto 10 else beta = rho / rhol do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 dest(i,j,k) = z(i,j,k) + beta * dest(i,j,k) enddo enddo enddo goto 100 endif 1000 format('Res/Res0 in solve: ',i4,2x,e12.5) return end c ************************************************************************* c ** MKSUMMAC ** c ** Pre-compute the sum of coefficients for the conjugate gradient solver c ************************************************************************* subroutine FORT_MKSUMMAC(sigmax,sigmay,sigmaz,sum,DIMS,hx,hy,hz, $ bcx_lo,bcx_hi,bcy_lo,bcy_hi,bcz_lo,bcz_hi) implicit none integer DIMS REAL_T sigmax(lo_1 :hi_1+1,lo_2 :hi_2 ,lo_3:hi_3 ) REAL_T sigmay(lo_1 :hi_1 ,lo_2 :hi_2+1,lo_3:hi_3 ) REAL_T sigmaz(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3:hi_3+1) REAL_T sum(lo_1 :hi_1 ,lo_2 :hi_2 ,lo_3:hi_3) REAL_T hx REAL_T hy REAL_T hz integer bcx_lo,bcx_hi integer bcy_lo,bcy_hi integer bcz_lo,bcz_hi c Local variables REAL_T hxsqinv REAL_T hysqinv REAL_T hzsqinv integer i,j,k hxsqinv = one/(hx*hx) hysqinv = one/(hy*hy) hzsqinv = one/(hz*hz) do k = lo_3,hi_3 do j = lo_2,hi_2 do i = lo_1,hi_1 sum(i,j,k) = (sigmax(i+1,j,k) + sigmax(i,j,k))*hxsqinv + $ (sigmay(i,j+1,k) + sigmay(i,j,k))*hysqinv + $ (sigmaz(i,j,k+1) + sigmaz(i,j,k))*hzsqinv sum(i,j,k) = -sixth*sum(i,j,k) enddo enddo enddo return end ccseapps-2.5/CCSEApps/iamrlib/0000755000175000017500000000000011634153073017276 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/Make.package0000644000175000017500000000325311634153073021473 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.41 2000/11/02 18:08:02 lijewski Exp $ # IAMRLIB_BASE=EXE ifeq ($(LBASE),iamr) IAMRLIB_BASE=LIB endif C$(IAMRLIB_BASE)_sources += main.cpp SyncRegister.cpp ViscBndry.cpp MacBndry.cpp C$(IAMRLIB_BASE)_sources += ViscBndryTensor.cpp ProjOutFlowBC.cpp \ MacOutFlowBC.cpp OutFlowBC.cpp C$(IAMRLIB_BASE)_headers += ViscBndryTensor.H MacOutFlowBC.H \ ProjOutFlowBC.H OutFlowBC.H C$(IAMRLIB_BASE)_headers += SyncRegister.H RegType.H ViscBndry.H MacBndry.H F$(IAMRLIB_BASE)_headers += SYNCREG_F.H VISCOPERATOR_F.H \ PROJOUTFLOWBC_F.H MACOUTFLOWBC_F.H F$(IAMRLIB_BASE)_sources += SYNCREG_$(DIM)D.F VISCOPERATOR_$(DIM)D.F \ PROJOUTFLOWBC_$(DIM)D.F MACOUTFLOWBC_$(DIM)D.F # # Disconnect MacOperators for different mass continuity. # ifndef ATMOS_MACOP C$(IAMRLIB_BASE)_sources += MacOperator.cpp C$(IAMRLIB_BASE)_headers += MacOperator.H MacOpProjDrivers.H MacOpMacDrivers.H F$(IAMRLIB_BASE)_sources += MACOPERATOR_$(DIM)D.F F$(IAMRLIB_BASE)_headers += MACOPERATOR_F.H endif C$(IAMRLIB_BASE)_sources += NavierStokes.cpp Projection.cpp MacProj.cpp Godunov.cpp Diffusion.cpp C$(IAMRLIB_BASE)_headers += Projection.H MacProj.H Godunov.H Diffusion.H NavierStokes.H F$(IAMRLIB_BASE)_sources += DERIVE_$(DIM)D.F GODUNOV_F.F GODUNOV_$(DIM)D.F \ NAVIERSTOKES_$(DIM)D.F PROJECTION_$(DIM)D.F \ MACPROJ_$(DIM)D.F DIFFUSION_$(DIM)D.F \ SLABSTAT_NS_$(DIM)D.F F$(IAMRLIB_BASE)_headers += DERIVE_F.H GODCOMM_F.H GODUNOV_F.H PROJECTION_F.H \ MACPROJ_F.H DIFFUSION_F.H NAVIERSTOKES_F.H \ SLABSTAT_NS_F.H ccseapps-2.5/CCSEApps/iamrlib/MACOPERATOR_3D.F0000644000175000017500000002504411634153073021514 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: MACOPERATOR_3D.F,v 1.8 2003/02/05 22:11:42 almgren Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "MACOPERATOR_F.H" #include "ArrayLim.H" #define SDIM 3 c :: ---------------------------------------------------------- c :: MACCOEF c :: Compute the coefficents for MAC solve c :: c :: INPUTS / OUTPUTS: c :: cx,cy,cz <= edge coef arrays c :: DIMS(cx) => index limits for cx c :: DIMS(cy) => index limits for cy c :: DIMS(cz) => index limits for cz c :: ax,ay,az => edge based area arrays c :: DIMS(ax) => index limits for ax c :: DIMS(ay) => index limits for ay c :: DIMS(az) => index limits for az c :: rho => cell centered density array c :: DIMS(rho) => index limits of rho array c :: lo,hi => index limits for rhs c :: dx => cell size c :: ---------------------------------------------------------- c :: subroutine FORT_MACCOEF (cx,DIMS(cx),cy,DIMS(cy),cz,DIMS(cz), & ax,DIMS(ax),ay,DIMS(ay),az,DIMS(az), & rho,DIMS(rho),lo,hi,dx) integer DIMDEC(cx) integer DIMDEC(cy) integer DIMDEC(cz) integer DIMDEC(ax) integer DIMDEC(ay) integer DIMDEC(az) integer DIMDEC(rho) integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM) REAL_T cx(DIMV(cx)) REAL_T cy(DIMV(cy)) REAL_T cz(DIMV(cz)) REAL_T ax(DIMV(ax)) REAL_T ay(DIMV(ay)) REAL_T az(DIMV(az)) REAL_T rho(DIMV(rho)) integer i, j, k REAL_T rhoavg do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) if (rho(i,j,k) .lt. zero) then print *,' ' print *,'TESTING in MACCOEF ' print *,'RHO HAS GONE NEGATIVE AT ',i,j,k,rho(i,j,k) call bl_abort(" ") end if end do end do end do c c ::::: finish coef in X direction (part 2) c do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1)+1 rhoavg = half * ( rho(i,j,k) + rho(i-1,j,k) ) c cx(i,j,k) = half*dx(1)*ax(i,j,k)*(one/rho(i,j,k) + one/rho(i-1,j,k)) cx(i,j,k) = dx(1) * ax(i,j,k) / rhoavg end do end do end do c c ::::: finish coef in Y direction (part 2) c do k = lo(3), hi(3) do j = lo(2), hi(2)+1 do i = lo(1), hi(1) rhoavg = half * ( rho(i,j,k) + rho(i,j-1,k) ) c cy(i,j,k) = half*dx(2)*ay(i,j,k)*(one/rho(i,j,k) + one/rho(i,j-1,k)) cy(i,j,k) = dx(2) * ay(i,j,k) / rhoavg end do end do end do c c ::::: finish coef in Z direction (part 2) c do k = lo(3), hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) rhoavg = half * ( rho(i,j,k) + rho(i,j,k-1) ) c cz(i,j,k) = half*dx(3)*az(i,j,k)*(one/rho(i,j,k) + one/rho(i,j,k-1)) cz(i,j,k) = dx(3) * az(i,j,k) / rhoavg end do end do end do end c :: ---------------------------------------------------------- c :: MACRHS c :: Compute the RHS for MAC solve c :: c :: INPUTS / OUTPUTS: c :: ux,uy,uz <= edge velocity arrays c :: DIMS(ux) => index limits for ux c :: DIMS(uy) => index limits for uy c :: DIMS(uz) => index limits for uz c :: ax,ay,az => edge based area arrays c :: DIMS(ax) => index limits for ax c :: DIMS(ay) => index limits for ay c :: DIMS(az) => index limits for az c :: vol => cell centered volume array c :: DIMS(vol) => index limits of vol array c :: rhs <=> cell centered rhs array c :: DIMS(rhs) => index limits of rhs array c :: lo,hi => index limits for rhs c :: scale => scale factor c :: ---------------------------------------------------------- c :: subroutine FORT_MACRHS (ux,DIMS(ux),uy,DIMS(uy),uz,DIMS(uz), & ax,DIMS(ax),ay,DIMS(ay),az,DIMS(az), & vol,DIMS(vol),rhs,DIMS(rhs),lo,hi,scale) integer DIMDEC(ux) integer DIMDEC(uy) integer DIMDEC(uz) integer DIMDEC(ax) integer DIMDEC(ay) integer DIMDEC(az) integer DIMDEC(vol) integer DIMDEC(rhs) integer lo(SDIM), hi(SDIM) REAL_T scale REAL_T ux(DIMV(ux)) REAL_T uy(DIMV(uy)) REAL_T uz(DIMV(uz)) REAL_T ax(DIMV(ax)) REAL_T ay(DIMV(ay)) REAL_T az(DIMV(az)) REAL_T vol(DIMV(vol)) REAL_T rhs(DIMV(rhs)) integer i, j, k REAL_T divu c c ::::: rhs holds the divergence condition (possibly zero) c do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) divu = ax(i+1,j,k)*ux(i+1,j,k) - ax(i,j,k)*ux(i,j,k) & + ay(i,j+1,k)*uy(i,j+1,k) - ay(i,j,k)*uy(i,j,k) & + az(i,j,k+1)*uz(i,j,k+1) - az(i,j,k)*uz(i,j,k) rhs(i,j,k) = scale*(divu - vol(i,j,k)*rhs(i,j,k)) end do end do end do end c :: ---------------------------------------------------------- c :: MACUPDATE c :: Compute the update to velocity field to c :: make it divergence free c :: c :: INPUTS / OUTPUTS: c :: ux,uy,uz <= edge based velocity arrays c :: DIMS(ux) => index limits for ux c :: DIMS(uy) => index limits for uy c :: DIMS(uz) => index limits for uz c :: phi => soln from MAC project c :: DIMS(phi) => index limits for phi c :: rho => density at time N c :: DIMS(rho) => index limits for rho c :: dx => cell size c :: mult => scalar multiplier c :: ---------------------------------------------------------- c :: subroutine FORT_MACUPDATE( & init, & ux,DIMS(ux),uy,DIMS(uy),uz,DIMS(uz), & phi,DIMS(phi),rho,DIMS(rho), & lo,hi,dx,mult) integer DIMDEC(ux) integer DIMDEC(uy) integer DIMDEC(uz) integer DIMDEC(phi) integer DIMDEC(rho) integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM), mult REAL_T ux(DIMV(ux)) REAL_T uy(DIMV(uy)) REAL_T uz(DIMV(uz)) REAL_T phi(DIMV(phi)) REAL_T rho(DIMV(rho)) integer init integer i, j, k REAL_T rhoavg, gp c c set gradient to zero if initializing c if ( init .eq. 1 ) then do k = ARG_L3(ux), ARG_H3(ux) do j = ARG_L2(ux), ARG_H2(ux) do i = ARG_L1(ux), ARG_H1(ux) ux(i,j,k) = zero end do end do end do do k = ARG_L3(uy), ARG_H3(uy) do j = ARG_L2(uy), ARG_H2(uy) do i = ARG_L1(uy), ARG_H1(uy) uy(i,j,k) = zero end do end do end do do k = ARG_L3(uz), ARG_H3(uz) do j = ARG_L2(uz), ARG_H2(uz) do i = ARG_L1(uz), ARG_H1(uz) uz(i,j,k) = zero end do end do end do end if c c compute x MAC gradient c do k = lo(3),hi(3) do j = lo(2),hi(2) do i = lo(1),hi(1)+1 rhoavg = half*(rho(i,j,k) + rho(i-1,j,k)) gp = (phi(i,j,k)-phi(i-1,j,k))/dx(1) ux(i,j,k) = ux(i,j,k) + mult * gp / rhoavg end do end do end do c c compute y mac gradient c do k = lo(3),hi(3) do j = lo(2),hi(2)+1 do i = lo(1),hi(1) rhoavg = half*(rho(i,j,k) + rho(i,j-1,k)) gp = (phi(i,j,k)-phi(i,j-1,k))/dx(2) uy(i,j,k) = uy(i,j,k) + mult * gp / rhoavg end do end do end do c c compute z mac gradient c do k = lo(3),hi(3)+1 do j = lo(2),hi(2) do i = lo(1),hi(1) rhoavg = half*(rho(i,j,k) + rho(i,j,k-1)) gp = (phi(i,j,k)-phi(i,j,k-1))/dx(3) uz(i,j,k) = uz(i,j,k) + mult * gp / rhoavg end do end do end do end c :: ---------------------------------------------------------- c :: MACSYNCRHS c :: Modify the RHS for MAC SYNC solve c :: c :: INPUTS / OUTPUTS: c :: rhs <= right hand side array c :: lo,hi => index limits for rhs c :: vol => cell centered volume array c :: vlo,vhi => index limits of vol array c :: rhsscale => const multiplier to rhs c :: ---------------------------------------------------------- c :: subroutine FORT_MACSYNCRHS(rhs,DIMS(rhs),lo,hi, & vol,DIMS(vol),rhsscale) integer DIMDEC(rhs) integer DIMDEC(vol) integer lo(SDIM), hi(SDIM) REAL_T rhsscale REAL_T rhs(DIMV(rhs)) REAL_T vol(DIMV(vol)) integer i, j, k c c ::::: multiply by volume since reflux step (which computed rhs) c ::::: divided by volume. c do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) rhs(i,j,k) = rhsscale*vol(i,j,k)*rhs(i,j,k) end do end do end do end ccseapps-2.5/CCSEApps/iamrlib/SyncRegister.cpp0000644000175000017500000005533311634153073022434 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: SyncRegister.cpp,v 1.67 2002/11/26 22:40:45 lijewski Exp $ // #include #include #include #include #include #include #include #ifndef FORT_HGC2N #include #endif #include //#define BL_SYNC_DEBUG 1 #ifdef BL_SYNC_DEBUG static Real Norm_0 (const SyncRegister& br) { Real r = 0; for (OrientationIter face; face; ++face) { for (ConstFabSetIter cmfi(br[face()]); cmfi.isValid(); ++cmfi) { Real s = cmfi->norm(cmfi->box(), 0, 0, cmfi->nComp()); r = (r > s) ? r : s; } } ParallelDescriptor::ReduceRealMax(r,ParallelDescriptor::IOProcessorNumber()); return r; } static Real Norm_1 (const SyncRegister& br) { Real r = 0; for (OrientationIter face; face; ++face) { for (FabSetIter cmfi(br[face()]); cmfi.isValid(); ++cmfi) { r += cmfi->norm(cmfi->box(), 1, 0, cmfi->nComp()); } } ParallelDescriptor::ReduceRealSum(r,ParallelDescriptor::IOProcessorNumber()); return r; } static void WriteNorms (const SyncRegister& sr, const char* msg) { Real n_0 = Norm_0(sr); Real n_1 = Norm_1(sr); if (ParallelDescriptor::IOProcessor()) { cout << "*** " << msg << ": Norm_0: " << n_0 << endl; cout << "*** " << msg << ": Norm_1: " << n_1 << endl; } } #else inline void WriteNorms (const SyncRegister&, const char*) {} #endif /*BL_SYNC_DEBUG*/ // // Structure used by some SyncRegister functions. // struct SRRec { SRRec (Orientation face, int index, const IntVect& shift) : m_shift(shift), m_idx(index), m_face(face) {} SRRec (Orientation face, int index) : m_idx(index), m_face(face) {} FillBoxId m_fbid; IntVect m_shift; int m_idx; Orientation m_face; }; SyncRegister::SyncRegister () { fine_level = -1; ratio = IntVect::TheUnitVector(); ratio.scale(-1); } SyncRegister::SyncRegister (const BoxArray& fine_boxes, const IntVect& ref_ratio, int fine_lev) { ratio = IntVect::TheUnitVector(); ratio.scale(-1); define(fine_boxes,ref_ratio,fine_lev); } void SyncRegister::define (const BoxArray& fine_boxes, const IntVect& ref_ratio, int fine_lev) { for (int dir = 0; dir < BL_SPACEDIM; dir++) BL_ASSERT(ratio[dir] == -1); BL_ASSERT(grids.size() == 0); BL_ASSERT(fine_boxes.isDisjoint()); ratio = ref_ratio; fine_level = fine_lev; grids.define(fine_boxes); grids.coarsen(ratio); for (int dir = 0; dir < BL_SPACEDIM; dir++) { // // Construct BoxArrays for the FabSets. // const Orientation lo = Orientation(dir,Orientation::low); const Orientation hi = Orientation(dir,Orientation::high); BoxArray loBA(grids.size()); BoxArray hiBA(grids.size()); for (int k = 0; k < grids.size(); k++) { Box ndbox = BoxLib::surroundingNodes(grids[k]); Box nd_lo = ndbox; nd_lo.setRange(dir,ndbox.smallEnd(dir),1); loBA.set(k,nd_lo); Box nd_hi = ndbox; nd_hi.setRange(dir,ndbox.bigEnd(dir),1); hiBA.set(k,nd_hi); } // // Define the FabSets. // bndry[lo].define(loBA,1); bndry_mask[lo].define(loBA,1); bndry[hi].define(hiBA,1); bndry_mask[hi].define(hiBA,1); } } SyncRegister::~SyncRegister () {} Real SyncRegister::sum () { // // Sum values in all registers. Note that overlap is counted twice. // Box bb = grids[0]; for (int k = 1; k < grids.size(); k++) bb.minBox(grids[k]); bb.surroundingNodes(); FArrayBox bfab(bb,1); bfab.setVal(0); for (OrientationIter face; face; ++face) { for (FabSetIter fsi(bndry[face()]); fsi.isValid(); ++fsi) { bfab.copy(bndry[face()][fsi]); } } Real tempSum = bfab.sum(0,1); ParallelDescriptor::ReduceRealSum(tempSum); return tempSum; } // // If periodic, copy the values from sync registers onto the nodes of the // rhs which are not covered by sync registers through periodic shifts. // void SyncRegister::copyPeriodic (const Geometry& geom, const Box& domain, MultiFab& rhs) const { if (!geom.isAnyPeriodic()) return; const int MyProc = ParallelDescriptor::MyProc(); Array pshifts(27); std::vector srrec; FabSetCopyDescriptor fscd; FabSetId fsid[2*BL_SPACEDIM]; for (OrientationIter face; face; ++face) { fsid[face()] = fscd.RegisterFabSet((FabSet*) &bndry[face()]); for (MFIter mfi(rhs); mfi.isValid(); ++mfi) { for (int j = 0; j < grids.size(); j++) { geom.periodicShift(domain,bndry[face()].fabbox(j),pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { Box sbox = bndry[face()].fabbox(j) + pshifts[iiv]; if (sbox.intersects(rhs[mfi].box())) { sbox &= rhs[mfi].box(); sbox -= pshifts[iiv]; SRRec sr(face(), mfi.index(), pshifts[iiv]); sr.m_fbid = fscd.AddBox(fsid[face()], sbox, 0, j, 0, 0, rhs[mfi].nComp()); BL_ASSERT(sr.m_fbid.box() == sbox); srrec.push_back(sr); } } } } } fscd.CollectData(); for (int i = 0; i < srrec.size(); i++) { BL_ASSERT(rhs.DistributionMap()[srrec[i].m_idx] == MyProc); FArrayBox& fab = rhs[srrec[i].m_idx]; Box dstbox = srrec[i].m_fbid.box() + srrec[i].m_shift; fscd.FillFab(fsid[srrec[i].m_face], srrec[i].m_fbid, fab, dstbox); } } void SyncRegister::multByBndryMask (MultiFab& rhs) const { const int MyProc = ParallelDescriptor::MyProc(); FabSetCopyDescriptor fscd; FabSetId fsid[2*BL_SPACEDIM]; std::vector srrec; FArrayBox tmpfab; for (OrientationIter face; face; ++face) { fsid[face()] = fscd.RegisterFabSet((FabSet*) &bndry_mask[face()]); for (MFIter mfi(rhs); mfi.isValid(); ++mfi) { for (int j = 0; j < grids.size(); j++) { Box intersect = rhs[mfi].box() & bndry_mask[face()].fabbox(j); if (intersect.ok()) { SRRec sr(face(), mfi.index()); sr.m_fbid = fscd.AddBox(fsid[face()], intersect, 0, j, 0, 0, rhs[mfi].nComp()); BL_ASSERT(sr.m_fbid.box() == intersect); srrec.push_back(sr); } } } } fscd.CollectData(); for (int i = 0; i < srrec.size(); i++) { const Box& bx = srrec[i].m_fbid.box(); BL_ASSERT(rhs.DistributionMap()[srrec[i].m_idx] == MyProc); FArrayBox& rhs_fab = rhs[srrec[i].m_idx]; tmpfab.resize(bx, rhs_fab.nComp()); fscd.FillFab(fsid[srrec[i].m_face], srrec[i].m_fbid, tmpfab, bx); rhs_fab.mult(tmpfab, bx, bx, 0, 0, rhs_fab.nComp()); } } void SyncRegister::InitRHS (MultiFab& rhs, const Geometry& geom, const BCRec* phys_bc) { rhs.setVal(0); Box domain = BoxLib::surroundingNodes(geom.Domain()); const int MyProc = ParallelDescriptor::MyProc(); FabSetCopyDescriptor fscd; Array pshifts(27); // // Fill Rhs From Bndry Registers. // // If periodic, copy the values from sync registers onto the nodes of the // rhs which are not covered by sync registers through periodic shifts. // copyPeriodic(geom,domain,rhs); // // Overwrite above-set values on all nodes covered by a sync register. // for (OrientationIter face; face; ++face) { bndry[face()].copyTo(rhs); } const int* phys_lo = phys_bc->lo(); const int* phys_hi = phys_bc->hi(); Box node_domain = BoxLib::surroundingNodes(geom.Domain()); for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (!geom.isPeriodic(dir)) { Box domlo(node_domain), domhi(node_domain); domlo.setRange(dir,node_domain.smallEnd(dir),1); domhi.setRange(dir,node_domain.bigEnd(dir),1); for (MFIter mfi(rhs); mfi.isValid(); ++mfi) { Box blo = mfi.validbox() & domlo; Box bhi = mfi.validbox() & domhi; if (blo.ok() && phys_lo[dir] == Outflow) rhs[mfi].mult(0.0,blo,0,1); if (bhi.ok() && phys_hi[dir] == Outflow) rhs[mfi].mult(0.0,bhi,0,1); } } } // // Set Up bndry_mask. // for (OrientationIter face; face; ++face) { bndry_mask[face()].setVal(0); } FArrayBox tmpfab; for (OrientationIter face; face; ++face) { FabSet& fs = bndry_mask[face()]; for (FabSetIter fsi(fs); fsi.isValid(); ++fsi) { Box mask_cells = BoxLib::enclosedCells(BoxLib::grow(fs[fsi].box(),1)); tmpfab.resize(mask_cells,1); tmpfab.setVal(0); for (int n = 0; n < grids.size(); n++) { Box isect = mask_cells & grids[n]; if (isect.ok()) { tmpfab.setVal(1.0,isect,0,1); } } if (geom.isAnyPeriodic()) { geom.periodicShift(geom.Domain(),mask_cells,pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { mask_cells += pshifts[iiv]; for (int n = 0; n < grids.size(); n++) { Box intersect = mask_cells & grids[n]; if (intersect.ok()) { intersect -= pshifts[iiv]; tmpfab.setVal(1.0,intersect,0,1); } } mask_cells -= pshifts[iiv]; } } Real* mask_dat = fs[fsi].dataPtr(); const int* mlo = fs[fsi].loVect(); const int* mhi = fs[fsi].hiVect(); Real* cell_dat = tmpfab.dataPtr(); const int* clo = tmpfab.loVect(); const int* chi = tmpfab.hiVect(); FORT_MAKEMASK(mask_dat,ARLIM(mlo),ARLIM(mhi), cell_dat,ARLIM(clo),ARLIM(chi)); } } // // Here double the cell contributions if at a non-periodic physical bdry. // for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (!geom.isPeriodic(dir)) { Box domlo(node_domain), domhi(node_domain); domlo.setRange(dir,node_domain.smallEnd(dir),1); domhi.setRange(dir,node_domain.bigEnd(dir),1); for (OrientationIter face; face; ++face) { FabSet& fs = bndry_mask[face()]; for (FabSetIter fsi(fs); fsi.isValid(); ++fsi) { Box isect = fs[fsi].box() & domlo; if (isect.ok()) { fs[fsi].mult(2.0,isect,0,1); } isect = fs[fsi].box() & domhi; if (isect.ok()) { fs[fsi].mult(2.0,isect,0,1); } } } } } // // Here convert from sum of cell contributions to 0 or 1. // for (OrientationIter face; face; ++face) { FabSet& fs = bndry_mask[face()]; for (FabSetIter fsi(fs); fsi.isValid(); ++fsi) { Real* mask_dat = fs[fsi].dataPtr(); const int* mlo = fs[fsi].loVect(); const int* mhi = fs[fsi].hiVect(); FORT_CONVERTMASK(mask_dat,ARLIM(mlo),ARLIM(mhi)); } } multByBndryMask(rhs); WriteNorms(*this,"SyncRegister::InitRHS(E)"); } enum HowToBuild { WITH_BOX, WITH_SURROUNDING_BOX }; static void BuildMFs (const MultiFab& mf, MultiFab cloMF[BL_SPACEDIM], MultiFab chiMF[BL_SPACEDIM], const IntVect& ratio, HowToBuild how) { BL_ASSERT(how == WITH_BOX || how == WITH_SURROUNDING_BOX); for (int dir = 0; dir < BL_SPACEDIM; dir++) { BoxArray cloBA(mf.size()); BoxArray chiBA(mf.size()); for (int i = 0; i < mf.size(); i++) { Box bx = mf.boxArray()[i]; if (how == WITH_SURROUNDING_BOX) bx = BoxLib::surroundingNodes(mf.boxArray()[i]); Box tboxlo(bx), tboxhi(bx); tboxlo.setRange(dir,bx.smallEnd(dir),1); tboxhi.setRange(dir,bx.bigEnd(dir),1); cloBA.set(i,BoxLib::coarsen(tboxlo,ratio)); chiBA.set(i,BoxLib::coarsen(tboxhi,ratio)); } cloMF[dir].define(cloBA,1,0,Fab_allocate); chiMF[dir].define(chiBA,1,0,Fab_allocate); cloMF[dir].setVal(0); chiMF[dir].setVal(0); } } void SyncRegister::incrementPeriodic (const Geometry& geom, const Box& domain, const MultiFab& mf) { if (!geom.isAnyPeriodic()) return; const int MyProc = ParallelDescriptor::MyProc(); const BoxArray& mfBA = mf.boxArray(); Array pshifts(27); std::vector srrec; FArrayBox tmpfab; MultiFabCopyDescriptor mfcd; MultiFabId mfid = mfcd.RegisterFabArray((MultiFab*) &mf); for (OrientationIter face; face; ++face) { FabSet& fs = bndry[face()]; for (FabSetIter fsi(fs); fsi.isValid(); ++fsi) { for (int j = 0; j < mfBA.size(); j++) { geom.periodicShift(domain, mfBA[j], pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { Box sbox = mfBA[j] + pshifts[iiv]; if (sbox.intersects(fs[fsi].box())) { sbox &= fs[fsi].box(); sbox -= pshifts[iiv]; SRRec sr(face(), fsi.index(), pshifts[iiv]); sr.m_fbid = mfcd.AddBox(mfid, sbox, 0, j, 0, 0, mf.nComp()); BL_ASSERT(sr.m_fbid.box() == sbox); srrec.push_back(sr); } } } } } mfcd.CollectData(); for (int i = 0; i < srrec.size(); i++) { FabSet& fabset = bndry[srrec[i].m_face]; BL_ASSERT(fabset.DistributionMap()[srrec[i].m_idx] == MyProc); tmpfab.resize(srrec[i].m_fbid.box(), mf.nComp()); mfcd.FillFab(mfid, srrec[i].m_fbid, tmpfab); tmpfab.shift(srrec[i].m_shift); fabset[srrec[i].m_idx].plus(tmpfab, 0, 0, mf.nComp()); } } void SyncRegister::CrseInit (MultiFab* Sync_resid_crse, const Geometry& crse_geom, Real mult) { WriteNorms(*this,"SyncRegister::CrseInit(B)"); setVal(0.); Sync_resid_crse->mult(mult); Box crse_node_domain = BoxLib::surroundingNodes(crse_geom.Domain()); incrementPeriodic(crse_geom, crse_node_domain, *Sync_resid_crse); for (OrientationIter face; face; ++face) { bndry[face()].plusFrom(*Sync_resid_crse,0,0,0,1); } WriteNorms(*this,"SyncRegister::CrseInit(E)"); } void SyncRegister::CompAdd (MultiFab* Sync_resid_fine, const Geometry& fine_geom, const Geometry& crse_geom, const BCRec* phys_bc, const BoxArray& Pgrids, Real mult) { Array pshifts(27); for (MFIter mfi(*Sync_resid_fine); mfi.isValid(); ++mfi) { Box sync_box = mfi.validbox(); for (int i = 0; i < Pgrids.size(); i++) { Box isect = sync_box & Pgrids[i]; if (isect.ok()) { (*Sync_resid_fine)[mfi].setVal(0.0,isect,0,1); } fine_geom.periodicShift(sync_box, Pgrids[i], pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { Box isect = Pgrids[i] + pshifts[iiv]; isect &= sync_box; (*Sync_resid_fine)[mfi].setVal(0.0,isect,0,1); } } } FineAdd(Sync_resid_fine,fine_geom,crse_geom,phys_bc,mult); } void SyncRegister::FineAdd (MultiFab* Sync_resid_fine, const Geometry& fine_geom, const Geometry& crse_geom, const BCRec* phys_bc, Real mult) { WriteNorms(*this,"SyncRegister::FineAdd(B)"); MultiFab cloMF[BL_SPACEDIM], chiMF[BL_SPACEDIM]; BuildMFs(*Sync_resid_fine,cloMF,chiMF,ratio,WITH_BOX); Sync_resid_fine->mult(mult); const int* phys_lo = phys_bc->lo(); const int* phys_hi = phys_bc->hi(); Box fine_node_domain = BoxLib::surroundingNodes(fine_geom.Domain()); Box crse_node_domain = BoxLib::surroundingNodes(crse_geom.Domain()); // // Coarsen edge values. // for (MFIter mfi(*Sync_resid_fine); mfi.isValid(); ++mfi) { const int* resid_lo = (*Sync_resid_fine)[mfi].box().loVect(); const int* resid_hi = (*Sync_resid_fine)[mfi].box().hiVect(); for (int dir = 0; dir < BL_SPACEDIM; dir++) { FArrayBox& cfablo = cloMF[dir][mfi.index()]; const Box& cboxlo = cfablo.box(); const int* clo = cboxlo.loVect(); const int* chi = cboxlo.hiVect(); FORT_SRCRSEREG((*Sync_resid_fine)[mfi].dataPtr(), ARLIM(resid_lo),ARLIM(resid_hi), cfablo.dataPtr(),ARLIM(clo),ARLIM(chi), clo,chi,&dir,ratio.getVect()); FArrayBox& cfabhi = chiMF[dir][mfi.index()]; const Box& cboxhi = cfabhi.box(); clo = cboxhi.loVect(); chi = cboxhi.hiVect(); FORT_SRCRSEREG((*Sync_resid_fine)[mfi].dataPtr(), ARLIM(resid_lo),ARLIM(resid_hi), cfabhi.dataPtr(),ARLIM(clo),ARLIM(chi), clo,chi,&dir,ratio.getVect()); } } for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (!crse_geom.isPeriodic(dir)) { // // Now points on the physical bndry must be doubled // for any boundary but outflow or periodic // Box domlo(crse_node_domain), domhi(crse_node_domain); domlo.setRange(dir,crse_node_domain.smallEnd(dir),1); domhi.setRange(dir,crse_node_domain.bigEnd(dir),1); for (MFIter mfi(*Sync_resid_fine); mfi.isValid(); ++mfi) { for (int dir_cfab = 0; dir_cfab < BL_SPACEDIM; dir_cfab++) { FArrayBox& cfablo = cloMF[dir_cfab][mfi.index()]; const Box& cboxlo = cfablo.box(); Box isectlo = domlo & cboxlo; Box isecthi = domhi & cboxlo; if (isectlo.ok()) cfablo.mult(2.0,isectlo,0,1); if (isecthi.ok()) cfablo.mult(2.0,isecthi,0,1); FArrayBox& cfabhi = chiMF[dir_cfab][mfi.index()]; const Box& cboxhi = cfabhi.box(); isectlo = domlo & cboxhi; isecthi = domhi & cboxhi; if (isectlo.ok()) cfabhi.mult(2.0,isectlo,0,1); if (isecthi.ok()) cfabhi.mult(2.0,isecthi,0,1); } } } } // // Intersect and add to registers. // for (int dir = 0; dir < BL_SPACEDIM; dir++) { for (OrientationIter face; face; ++face) { bndry[face()].plusFrom(cloMF[dir],0,0,0,1); bndry[face()].plusFrom(chiMF[dir],0,0,0,1); } incrementPeriodic(crse_geom, crse_node_domain, cloMF[dir]); incrementPeriodic(crse_geom, crse_node_domain, chiMF[dir]); } WriteNorms(*this,"SyncRegister::FineAdd(E)"); } ccseapps-2.5/CCSEApps/iamrlib/SyncRegister.H0000644000175000017500000000715711634153073022042 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _SYNCREGISTER_H_ #define _SYNCREGISTER_H_ // // $Id: SyncRegister.H,v 1.17 2000/10/02 20:50:16 lijewski Exp $ // #include #include #include #include #include #include #include class SyncRegister : public BndryRegister { public: SyncRegister (); SyncRegister (const BoxArray& fine_boxes, const IntVect& ref_ratio, int fine_lev); ~SyncRegister (); void define (const BoxArray& fine_boxes, const IntVect& ref_ratio, int fine_lev); // // Access functions. // IntVect refRatio () const { return ratio; } int fineLevel () const { return fine_level; } int crseLevel () const { return fine_level-1; } const BoxArray& coarsenedBoxes () const { return grids; } void CrseInit (MultiFab* Sync_resid_crse, const Geometry& crse_geom, Real mult); void FineAdd (MultiFab* Sync_resid_crse, const Geometry& fine_geom, const Geometry& crse_geom, const BCRec* phys_bc, Real mult); void CompAdd (MultiFab* Sync_resid_crse, const Geometry& fine_geom, const Geometry& crse_geom, const BCRec* phys_bc, const BoxArray& Pgrids, Real mult); void InitRHS (MultiFab& rhs, const Geometry& geom, const BCRec* phys_bc); // // Compute sum of values (overlap values only counted once). // WARNING: this is a diagnostic and is not efficient. // Real sum (); protected: // // Helper member functions. // void incrementPeriodic (const Geometry& geom, const Box& domain, const MultiFab& mf); void copyPeriodic (const Geometry& geom, const Box& domain, MultiFab& rhs) const; void multByBndryMask (MultiFab& rhs) const; // // The data. // FabSet bndry_mask[2*BL_SPACEDIM]; IntVect ratio; int fine_level; }; #endif /*_SYNCREGISTER_H_*/ ccseapps-2.5/CCSEApps/iamrlib/MacOperator.cpp0000644000175000017500000003622311634153073022224 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MacOperator.cpp,v 1.29 2003/02/05 22:11:42 almgren Exp $ // #include #include #include #include #include #include #include #include #ifdef MG_USE_HYPRE #include #endif #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); #define DEF_CLIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ const Real* fabdat = (fab).dataPtr(); MacOperator::MacOperator (const BndryData& mgb, const Real* h) : ABecLaplacian(mgb,h) {} MacOperator::~MacOperator () {} // // Define the meaning of gradient for the multigrid object. // void MacOperator::setCoefficients (MultiFab* area, MultiFab& rho, int rho_comp, const Real* dx) { // // Should check that all BoxArrays are consistant. // const BoxArray& ba = gbox[0]; BL_ASSERT(rho.boxArray() == ba); // // First set scalar coeficients. // setScalars(0.0,1.0); // // Don't need to set a because alpha is set to zero. // const int n_grow = 0; D_TERM(MultiFab bxcoef(area[0].boxArray(),area[0].nComp(),n_grow);, MultiFab bycoef(area[1].boxArray(),area[1].nComp(),n_grow);, MultiFab bzcoef(area[2].boxArray(),area[2].nComp(),n_grow);); D_TERM(bxcoef.setVal(0);, bycoef.setVal(0);, bzcoef.setVal(0);); for (MFIter rhomfi(rho); rhomfi.isValid(); ++rhomfi) { BL_ASSERT(ba[rhomfi.index()] == rhomfi.validbox()); const Box& grd = ba[rhomfi.index()]; const int* lo = grd.loVect(); const int* hi = grd.hiVect(); FArrayBox& bx = bxcoef[rhomfi]; FArrayBox& by = bycoef[rhomfi]; const FArrayBox& ax = area[0][rhomfi]; const FArrayBox& ay = area[1][rhomfi]; const FArrayBox& den = rho[rhomfi]; DEF_LIMITS(bx,bx_dat,bxlo,bxhi); DEF_LIMITS(by,by_dat,bylo,byhi); DEF_CLIMITS(ax,ax_dat,axlo,axhi); DEF_CLIMITS(ay,ay_dat,aylo,ayhi); const int* dlo = den.loVect(); const int* dhi = den.hiVect(); const Real* den_dat = den.dataPtr(rho_comp); #if (BL_SPACEDIM == 2) FORT_MACCOEF(bx_dat,ARLIM(bxlo),ARLIM(bxhi), by_dat,ARLIM(bylo),ARLIM(byhi), ax_dat,ARLIM(axlo),ARLIM(axhi), ay_dat,ARLIM(aylo),ARLIM(ayhi), den_dat,ARLIM(dlo),ARLIM(dhi),lo,hi,dx); #endif #if (BL_SPACEDIM == 3) FArrayBox& bz = bzcoef[rhomfi]; const FArrayBox& az = area[2][rhomfi]; DEF_CLIMITS(az,az_dat,azlo,azhi); DEF_LIMITS(bz,bz_dat,bzlo,bzhi); FORT_MACCOEF(bx_dat,ARLIM(bxlo),ARLIM(bxhi), by_dat,ARLIM(bylo),ARLIM(byhi), bz_dat,ARLIM(bzlo),ARLIM(bzhi), ax_dat,ARLIM(axlo),ARLIM(axhi), ay_dat,ARLIM(aylo),ARLIM(ayhi), az_dat,ARLIM(azlo),ARLIM(azhi), den_dat,ARLIM(dlo),ARLIM(dhi),lo,hi,dx); #endif } D_TERM(bCoefficients(bxcoef,0);, bCoefficients(bycoef,1);, bCoefficients(bzcoef,2);); } // // This function creates the initial rhs for use in the mac multgrid solve. // void MacOperator::defRHS (MultiFab* area, MultiFab& volume, MultiFab& Rhs, MultiFab* vel, Real scale) { // // Should check that all BoxArrays are consistant. // const BoxArray& ba = gbox[0]; BL_ASSERT(Rhs.boxArray() == ba); for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { BL_ASSERT(ba[Rhsmfi.index()] == Rhsmfi.validbox()); const Box& grd = Rhsmfi.validbox(); const int* lo = grd.loVect(); const int* hi = grd.hiVect(); const FArrayBox& ax = area[0][Rhsmfi]; const FArrayBox& ay = area[1][Rhsmfi]; const FArrayBox& vol = volume[Rhsmfi]; const FArrayBox& ux = vel[0][Rhsmfi]; const FArrayBox& uy = vel[1][Rhsmfi]; FArrayBox& rhs = Rhs[Rhsmfi]; DEF_CLIMITS(ux,ux_dat,uxlo,uxhi); DEF_CLIMITS(uy,uy_dat,uylo,uyhi); DEF_CLIMITS(ax,ax_dat,axlo,axhi); DEF_CLIMITS(ay,ay_dat,aylo,ayhi); DEF_CLIMITS(vol,vol_dat,vlo,vhi); DEF_LIMITS(rhs,rhs_dat,rlo,rhi); #if (BL_SPACEDIM == 2) FORT_MACRHS(ux_dat,ARLIM(uxlo),ARLIM(uxhi), uy_dat,ARLIM(uylo),ARLIM(uyhi), ax_dat,ARLIM(axlo),ARLIM(axhi), ay_dat,ARLIM(aylo),ARLIM(ayhi), vol_dat,ARLIM(vlo),ARLIM(vhi), rhs_dat,ARLIM(rlo),ARLIM(rhi), lo,hi,&scale); #endif #if (BL_SPACEDIM == 3) const FArrayBox& az = area[2][Rhsmfi]; DEF_CLIMITS(az,az_dat,azlo,azhi); const FArrayBox& uz = vel[2][Rhsmfi]; DEF_CLIMITS(uz,uz_dat,uzlo,uzhi); FORT_MACRHS(ux_dat,ARLIM(uxlo),ARLIM(uxhi), uy_dat,ARLIM(uylo),ARLIM(uyhi), uz_dat,ARLIM(uzlo),ARLIM(uzhi), ax_dat,ARLIM(axlo),ARLIM(axhi), ay_dat,ARLIM(aylo),ARLIM(ayhi), az_dat,ARLIM(azlo),ARLIM(azhi), vol_dat,ARLIM(vlo),ARLIM(vhi), rhs_dat,ARLIM(rlo),ARLIM(rhi), lo,hi,&scale); #endif } Rhs.mult(-1.0,Rhs.nGrow()); } // // Apply the mac pressure gradient to a velocity field. // init, means that velocities are initialized here. // void mac_vel_update (int init, D_DECL(FArrayBox& ux, FArrayBox& uy, FArrayBox& uz), const FArrayBox& phi, const FArrayBox* rhoptr, int rho_comp, const Box& grd, int level, int n, const Real* dx, Real scale) { const int* lo = grd.loVect(); const int* hi = grd.hiVect(); const FArrayBox& rho = *rhoptr; DEF_LIMITS(ux,ux_dat,uxlo,uxhi); DEF_LIMITS(uy,uy_dat,uylo,uyhi); DEF_CLIMITS(phi,phi_dat,p_lo,p_hi); const int* rlo = rho.loVect(); const int* rhi = rho.hiVect(); const Real* rho_dat = rho.dataPtr(rho_comp); #if (BL_SPACEDIM == 2) FORT_MACUPDATE(&init, ux_dat,ARLIM(uxlo),ARLIM(uxhi), uy_dat,ARLIM(uylo),ARLIM(uyhi), phi_dat,ARLIM(p_lo),ARLIM(p_hi), rho_dat,ARLIM(rlo),ARLIM(rhi), lo,hi,dx,&scale); #endif #if (BL_SPACEDIM == 3) DEF_LIMITS(uz,uz_dat,uzlo,uzhi); FORT_MACUPDATE(&init, ux_dat,ARLIM(uxlo),ARLIM(uxhi), uy_dat,ARLIM(uylo),ARLIM(uyhi), uz_dat,ARLIM(uzlo),ARLIM(uzhi), phi_dat,ARLIM(p_lo),ARLIM(p_hi), rho_dat,ARLIM(rlo),ARLIM(rhi), lo,hi,dx,&scale); #endif } // // Apply the mac pressure gradient to the divergent mac velocities. // The resultant velocity field is nondivergent. // void MacOperator::velUpdate (MultiFab* Vel, MultiFab& Phi, const MultiFab& Rho, int rho_comp, const Real* dx, Real scale) { // // Should check that all BoxArrays are consistant. // const BoxArray& ba = gbox[0]; BL_ASSERT(Rho.boxArray() == ba); // // Set bndry data in ghost zones. // int apply_lev = 0; applyBC(Phi,0,1,apply_lev); for (MFIter Phimfi(Phi); Phimfi.isValid(); ++Phimfi) { BL_ASSERT(ba[Phimfi.index()] == Phimfi.validbox()); const Box& grd = Phimfi.validbox(); mac_vel_update(0, D_DECL(Vel[0][Phimfi],Vel[1][Phimfi],Vel[2][Phimfi]), Phi[Phimfi], &(Rho[Phimfi]), rho_comp, grd, 0, Phimfi.index(), dx, scale ); } } // // Multiply by volume*rhs_scale since reflux step (which computed rhs) // divided by volume. // void MacOperator::syncRhs (const MultiFab& Volume, MultiFab& Rhs, Real rhs_scale, const Real* dx) { const BoxArray& ba = gbox[0]; for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { BL_ASSERT(ba[Rhsmfi.index()] == Rhsmfi.validbox()); const Box& grd = Rhsmfi.validbox(); const int* lo = grd.loVect(); const int* hi = grd.hiVect(); FArrayBox& rhs = Rhs[Rhsmfi]; const FArrayBox& vol = Volume[Rhsmfi]; DEF_CLIMITS(vol,vol_dat,vlo,vhi); DEF_LIMITS(rhs,rhs_dat,rlo,rhi); FORT_MACSYNCRHS(rhs_dat,ARLIM(rlo),ARLIM(rhi),lo,hi, vol_dat,ARLIM(vlo),ARLIM(vhi),&rhs_scale); } Rhs.mult(-1.0,Rhs.nGrow()); } // // Driver functions follow. // // // A driver function for computing a level MAC solve. // void mac_level_driver (const MacBndry& mac_bndry, const BoxArray& grids, int the_solver, int level, int Density, const Real* dx, Real dt, Real mac_tol, Real mac_abs_tol, Real rhs_scale, MultiFab* area, MultiFab& volume, MultiFab& S, MultiFab& Rhs, MultiFab* u_mac, MultiFab* mac_phi) { BL_PROFILE("mac_level_driver"); MacOperator mac_op(mac_bndry,dx); mac_op.setCoefficients(area,S,Density,dx); mac_op.defRHS(area,volume,Rhs,u_mac,rhs_scale); mac_op.maxOrder(2); if (the_solver == 1 && mac_op.maxOrder() != 2) { BoxLib::Error("Can't use CGSolver with maxorder > 2"); } // // Construct MultiGrid or CGSolver object and solve system. // if (the_solver == 1) { bool use_mg_precond = true; CGSolver mac_cg(mac_op,use_mg_precond); mac_cg.solve(*mac_phi,Rhs,mac_tol,mac_abs_tol); } else if (the_solver == 2 ) { #ifdef MG_USE_HYPRE HypreABec hp(mac_phi->boxArray(), mac_bndry, dx, 0, false); hp.setScalars(mac_op.get_alpha(), mac_op.get_beta()); hp.aCoefficients(mac_op.aCoefficients()); for ( int i = 0; i < BL_SPACEDIM; ++i ) { hp.bCoefficients(mac_op.bCoefficients(i), i); } hp.setup_solver(mac_tol, mac_abs_tol, 50); hp.solve(*mac_phi, Rhs, true); hp.clear_solver(); #else BoxLib::Error("mac_level_driver::HypreABec not in this build"); #endif } else { MultiGrid mac_mg(mac_op); mac_mg.solve(*mac_phi,Rhs,mac_tol,mac_abs_tol); } // // velUpdate will set bndry values for mac_phi. // mac_op.velUpdate(u_mac,*mac_phi,S,Density,dx,-dt/2.0); } // // A driver function for computing a sync MAC solve. // void mac_sync_driver (const MacBndry& mac_bndry, const BoxArray& grids, int the_solver, int level, const Real* dx, Real dt, Real mac_sync_tol, Real mac_abs_tol, Real rhs_scale, MultiFab* area, MultiFab& volume, MultiFab& Rhs, MultiFab* rho_half, MultiFab* mac_sync_phi) { BL_PROFILE("mac_sync_driver"); MacOperator mac_op(mac_bndry,dx); mac_op.maxOrder(2); mac_op.setCoefficients(area,*rho_half, 0, dx); mac_op.syncRhs(volume,Rhs,rhs_scale,dx); if (the_solver == 1 && mac_op.maxOrder() != 2) { BoxLib::Error("Can't use CGSolver with maxorder > 2"); } // // Now construct MultiGrid or CGSolver object to solve system. // if (the_solver == 1) { bool use_mg_precond = true; CGSolver mac_cg(mac_op,use_mg_precond); mac_cg.solve(*mac_sync_phi,Rhs,mac_sync_tol,mac_abs_tol); } else if ( the_solver == 2 ) { #ifdef MG_USE_HYPRE HypreABec hp(mac_sync_phi->boxArray(), mac_bndry, dx, 0, false); hp.setScalars(mac_op.get_alpha(), mac_op.get_beta()); hp.aCoefficients(mac_op.aCoefficients()); for ( int i = 0; i < BL_SPACEDIM; ++i ) { hp.bCoefficients(mac_op.bCoefficients(i), i); } hp.setup_solver(mac_sync_tol, mac_abs_tol, 50); hp.solve(*mac_sync_phi, Rhs, true); hp.clear_solver(); #else BoxLib::Error("mac_sync_driver: HypreABec not in this build"); #endif } else { MultiGrid mac_mg(mac_op); mac_mg.solve(*mac_sync_phi,Rhs,mac_sync_tol,mac_abs_tol); } int mac_op_lev = 0; mac_op.applyBC(*mac_sync_phi,0,1,mac_op_lev); } // // Make an application specific initial guess. // void ProjFirstGuess (MultiFab& U_new, MultiFab& P_new, int level, const BoxArray& grids ) {} // // Scale the variables for a projection solve. // void proj_scale_var (MultiFab* rho, MultiFab* vel, const BoxArray& grids, int level) { } // // Unscale the variables for a projection solve. // void proj_unscale_var (MultiFab* rho, MultiFab* vel, const BoxArray& grids, int level) { } ccseapps-2.5/CCSEApps/iamrlib/main.cpp0000644000175000017500000001332111634153073020726 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: main.cpp,v 1.41 2001/10/16 20:00:11 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #ifndef NDEBUG extern "C" { void PrintBoxArray (const BoxArray& ba); void PrintBoxDomain (const BoxDomain& bd); void PrintTagBox (const TagBox& tb); void PrintTagBoxArray (const TagBoxArray& tba); void TagBoxCount (const TagBox& tb); void TagBoxArrayCount (const TagBoxArray& tba); } void PrintBoxArray (const BoxArray& ba) { std::cout << ba << std::endl; } void PrintBoxDomain (const BoxDomain& bd) { std::cout << bd << std::endl; } void PrintTagBox (const TagBox& tb) { const Box& bx = tb.box(); long count = 0; std::cout << "TagBox: box = " << bx << ":\n"; for (IntVect p = bx.smallEnd(); p <= bx.bigEnd(); bx.next(p)) { if (!(tb(p) == TagBox::CLEAR)) { count++; std::cout << p << ' '; } } std::cout << "Total tagged cells = " << count << std::endl; } void TagBoxCount (const TagBox& tb) { const Box& bx = tb.box(); long count = 0; for (IntVect p = bx.smallEnd(); p <= bx.bigEnd(); bx.next(p)) { if (!(tb(p) == TagBox::CLEAR)) { count++; } } std::cout << "Total tagged cells = " << count << std::endl; } void PrintTagBoxArray (const TagBoxArray& tba) { long count = 0; std::cout << "TagBoxArray:\n"; for (int i = 0; i < tba.size(); i++) { const Box& bx = tba[i].box(); std::cout << "\ti = " << i << ", box = " << bx << ":\n"; for (IntVect p = bx.smallEnd(); p <= bx.bigEnd(); bx.next(p)) { if (!(tba[i](p) == TagBox::CLEAR)) { count++; std::cout << p << ' '; } } std::cout << '\n'; } std::cout << "Total tagged cells = " << count << std::endl; } void TagBoxArrayCount (const TagBoxArray& tba) { long count = 0; for (int i = 0; i < tba.size(); i++) { const Box& bx = tba[i].box(); for (IntVect p = bx.smallEnd(); p <= bx.bigEnd(); bx.next(p)) { if (!(tba[i](p) == TagBox::CLEAR)) { count++; } } } std::cout << "Total tagged cells = " << count << std::endl; } #endif /*NDEBUG*/ int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); const Real run_strt = ParallelDescriptor::second(); int max_step; Real strt_time; Real stop_time; ParmParse pp; // // Initialize some Holy Grail junk. // HG::MPI_init(); max_step = -1; strt_time = 0.0; stop_time = -1.0; pp.query("max_step",max_step); pp.query("strt_time",strt_time); pp.query("stop_time",stop_time); if (strt_time < 0.0) BoxLib::Abort("MUST SPECIFY a non-negative strt_time"); if (max_step < 0 && stop_time < 0.0) { BoxLib::Abort( "Exiting because neither max_step nor stop_time is non-negative."); } Amr* amrptr = new Amr; amrptr->init(strt_time,stop_time); while ( amrptr->okToContinue() && (amrptr->levelSteps(0) < max_step || max_step < 0) && (amrptr->cumTime() < stop_time || stop_time < 0.0) ) { amrptr->coarseTimeStep(stop_time); } delete amrptr; // // Close down the Holy Grail junk. // HG::MPI_finish(); if (CArena* arena = dynamic_cast(BoxLib::The_Arena())) { // // We're using a CArena -- output some FAB memory stats. // This'll output total # of bytes of heap space in the Arena. // It's actually the high water mark of heap space required by FABs. // char buf[256]; sprintf(buf, "CPU(%d): Heap Space (bytes) used by Coalescing FAB Arena: %ld", ParallelDescriptor::MyProc(), arena->heap_space_used()); std::cout << buf << std::endl; } const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real run_stop = ParallelDescriptor::second() - run_strt; ParallelDescriptor::ReduceRealMax(run_stop,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "Run time = " << run_stop << std::endl; BoxLib::Finalize(); return 0; } ccseapps-2.5/CCSEApps/iamrlib/PROJECTION_3D.F0000644000175000017500000003274611634153073021423 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: PROJECTION_3D.F,v 1.13 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "PROJECTION_F.H" #include "ArrayLim.H" #define SDIM 3 subroutine FORT_FILTERP ( & pnew,scratch,DIMS(p), & lo,hi,dx,fac) c c ---------------------------------------------------------- c filter the pressure coming out of the level projection c c pnew := pnew - fac * lap_7pt(pnew) c c INPUTS / OUTPUTS: c pnew => c pnew <=> c p_lo,p_hi => index limits of pressure array c lo,hi => index limits of cell centered interior c fac => fudge factor for filtering c c ---------------------------------------------------------- c integer DIMDEC(p) REAL_T pnew(DIMV(p)) REAL_T scratch(DIMV(p)) integer lo(3), hi(3) REAL_T dx(3) REAL_T fac integer i, j, k REAL_T twelfth twelfth = one / twelve do k = lo(3)+1, hi(3) do j = lo(2)+1, hi(2) do i = lo(1)+1, hi(1) scratch(i,j,k) = six * pnew(i,j,k) - $ (pnew(i-1,j,k) + pnew(i+1,j,k) + $ pnew(i,j-1,k) + pnew(i,j+1,k) + $ pnew(i,j,k-1) + pnew(i,j,k+1) ) scratch(i,j,k) = - twelfth * scratch(i,j,k) * fac end do end do end do do k = lo(3)+1, hi(3) do j = lo(2)+1, hi(2) do i = lo(1)+1, hi(1) pnew(i,j,k) = pnew(i,j,k) + scratch(i,j,k) end do end do end do end subroutine FORT_ACCEL_TO_VEL( lo, hi, & uold,DIMS(uold), & dt, & unew,DIMS(unew) ) c c This function converts unew into a velocity via c Unew = Uold + alpha*Unew c integer lo(SDIM), hi(SDIM) REAL_T dt integer DIMDEC(uold),DIMDEC(unew) REAL_T uold(DIMV(uold),SDIM) REAL_T unew(DIMV(unew),SDIM) integer i, j, k, n do n = 1, SDIM do k = lo(3)-1, hi(3)+1 do j = lo(2)-1, hi(2)+1 do i = lo(1)-1, hi(1)+1 unew(i,j,k,n) = uold(i,j,k,n) + dt*unew(i,j,k,n) end do end do end do end do end subroutine FORT_VEL_TO_ACCEL( lo, hi, & unew,DIMS(unew), & uold,DIMS(uold), & dt ) c c This function converts unew into an acceleration c integer lo(SDIM), hi(SDIM) REAL_T dt integer DIMDEC(unew),DIMDEC(uold) REAL_T uold(DIMV(uold),SDIM) REAL_T unew(DIMV(unew),SDIM) integer i, j, k, n do n = 1, SDIM do k = lo(3)-1, hi(3)+1 do j = lo(2)-1, hi(2)+1 do i = lo(1)-1, hi(1)+1 unew(i,j,k,n) = (unew(i,j,k,n)-uold(i,j,k,n))/dt end do end do end do end do end subroutine FORT_PROJ_UPDATE( & boxlo, boxhi, nvar, ngrow, & un, DIMS(un), & alpha, & uo, DIMS(uo) ) c c This function updates un via un = un + alpha*uo c The loop bounds are determined in the C++ c integer boxlo(SDIM), boxhi(SDIM), nvar, ngrow REAL_T alpha integer DIMDEC(un),DIMDEC(uo) REAL_T un(DIMV(un),nvar) REAL_T uo(DIMV(uo),nvar) integer i, j, k, n do n = 1, nvar do k = boxlo(3), boxhi(3) do j = boxlo(2), boxhi(2) do i = boxlo(1), boxhi(1) un(i,j,k,n) = un(i,j,k,n) + alpha*uo(i,j,k,n) end do end do end do end do end subroutine FORT_RADMPY(a,DIMS(grid),ng,r,nr,n) c c multiply A by a Radius r c integer ng,nr integer n(SDIM) integer DIMDEC(grid) REAL_T a(ARG_L1(grid)-ng:ARG_H1(grid)+ng, $ ARG_L2(grid)-ng:ARG_H2(grid)+ng, $ ARG_L3(grid)-ng:ARG_H3(grid)+ng) REAL_T r(ARG_L1(grid)-nr:ARG_H1(grid)+nr) call bl_abort('SHOULD NEVER BE IN RADMPY IN 3D') end subroutine FORT_RADDIV(a,DIMS(grid),ng,r,nr,n) c c divide A by a Radius r c integer ng,nr integer n(SDIM) integer DIMDEC(grid) REAL_T a(ARG_L1(grid)-ng:ARG_H1(grid)+ng, $ ARG_L2(grid)-ng:ARG_H2(grid)+ng, $ ARG_L3(grid)-ng:ARG_H3(grid)+ng) REAL_T r(ARG_L1(grid)-nr:ARG_H1(grid)+nr) call bl_abort('SHOULD NEVER BE IN RADDIV IN 3D') end subroutine FORT_HGN2C( & isrz,lrweighted, DIMS(nodedat), nodedat, & DIMS(ccdat), lo, hi, ccdat) c ---------------------------------------------------------- c HGN2C c averages node centered data to cell centers for use in c holy grail projection implicit none integer isrz,lrweighted integer lo(SDIM), hi(SDIM) integer DIMDEC(ccdat) integer DIMDEC(nodedat) REAL_T nodedat(DIMV(nodedat)) REAL_T ccdat(DIMV(ccdat)) integer i,j,k if (ARG_H1(ccdat) .lt. lo(1) .or. & ARG_L1(ccdat) .gt. hi(1) .or. & ARG_H2(ccdat) .lt. lo(2) .or. & ARG_L2(ccdat) .gt. hi(2) .or. & ARG_H3(ccdat) .lt. lo(3) .or. & ARG_L3(ccdat) .gt. hi(3) .or. & ARG_H1(nodedat) .lt. lo(1)+1 .or. & ARG_L1(nodedat) .gt. hi(1) .or. & ARG_H2(nodedat) .lt. lo(2)+1 .or. & ARG_L2(nodedat) .gt. hi(2) .or. & ARG_H3(nodedat) .lt. lo(3)+1 .or. & ARG_L3(nodedat) .gt. hi(3) ) then call bl_abort("FORT_HG_CELL_TO_NODE: bad index limits") end if if(isrz.eq.1.and.lrweighted.ne.1)then call bl_abort('FORT_HGN2C : isrz=1 and lrweighted!=1 not implemented') end if do k=lo(3),hi(3) do j=lo(2),hi(2) do i=lo(1),hi(1) ccdat(i,j,k)=eighth*(nodedat(i ,j, k )+nodedat(i+1,j ,k )+ & nodedat(i ,j+1,k )+nodedat(i+1,j+1,k )+ & nodedat(i ,j, k+1)+nodedat(i+1,j ,k+1)+ & nodedat(i ,j+1,k+1)+nodedat(i+1,j+1,k+1)) end do end do end do end subroutine FORT_HGC2N( & nghost, DIMS(dat), dat, rcen, & DIMS(rhs), rhs, & domlo, domhi, lowfix, hifix, dr, is_rz) c c ---------------------------------------------------------- c HGC2N c averages cell centered data to nodes for use in c holy grail projection c c INPUTS / OUTPUTS: c nghost => indicates buffer of rhs that does not need values c dat => cell centered array to be averaged c DIMS(dat) => index limits of dat c rhslo,rhshi => index extents of rhs c rhs <= node centered array with results c rcen,lowfix,hifix are artifacts of 2D r-z version and are not used c ---------------------------------------------------------- c implicit none integer nghost integer domlo(SDIM), domhi(SDIM) integer DIMDEC(dat) integer DIMDEC(rhs) REAL_T dat(DIMV(dat)) REAL_T rhs(DIMV(rhs)) c not used integer is_rz, lowfix, hifix REAL_T rcen(DIM1(dat)) REAL_T dr c local variables integer i, j, k if (ARG_L1(rhs)+1 .lt. ARG_L1(dat) .or. $ ARG_H1(rhs)-1 .gt. ARG_H1(dat) .or. & ARG_L2(rhs)+1 .lt. ARG_L2(dat) .or. $ ARG_H2(rhs)-1 .gt. ARG_H2(dat) .or. & ARG_L3(rhs)+1 .lt. ARG_L3(dat) .or. $ ARG_H3(rhs)-1 .gt. ARG_H3(dat) ) then call bl_abort("FORT_HG_CELL_TO_NODE: bad index limits") end if do k=ARG_L3(rhs)+nghost,ARG_H3(rhs)-nghost do j=ARG_L2(rhs)+nghost,ARG_H2(rhs)-nghost do i=ARG_L1(rhs)+nghost,ARG_H1(rhs)-nghost rhs(i,j,k)=eighth*(dat(i-1,j-1,k )+dat(i-1,j,k )+ & dat(i ,j-1,k )+dat(i ,j,k )+ & dat(i-1,j-1,k-1)+dat(i-1,j,k-1)+ & dat(i ,j-1,k-1)+dat(i ,j,k-1)) end do end do end do end c ::: ----------------------------------------------------------- c ::: This routine will compute D (U / dt + sigma G^perp phi) c ::: c ::: NOTE: phi is node-centered c ::: sigma is cell-centered c ::: U is cell-centered c ::: c ::: As of now, this routine assumes dx == dy == dz c ::: Eventually, this will be changed.. c ::: c ::: INPUTS/OUTPUTS: c ::: phi => node centered data c ::: DIMS(phi) => index limits for phi c ::: sigma => cell-centered coefficient array c ::: DIMS(sigma)=> index limits for sigma c ::: u => cell-centered velocity array c ::: DIMS(u) => index limits for u c ::: divgp <= node-centered divergence of gradient c ::: DIMS(divgp)=> index limits for divgp c ::: lo,hi => node-centered subregion of divgp to define c ::: dx => cell sizes c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FILTRHS(phi,DIMS(phi),sigma,DIMS(sigma), & divgp,DIMS(divgp), & lo,hi,dx,mult,is_rz) integer DIMDEC(phi) integer DIMDEC(sigma) integer DIMDEC(divgp) integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM), mult REAL_T phi(DIMV(phi)) REAL_T sigma(DIMV(sigma)) REAL_T divgp(DIMV(divgp)) integer is_rz integer i, j, k REAL_T p1, p2, p3, p4, p5, p6, p7, p8, denom c NOTE: the factor of mult here accounts for the fact that one c takes ratio time steps on the fine grid for every one c timestep on the coarse grid. mult = 1/ratio. denom = -mult/(sixteen*dx(1)**2) c check and make sure dx == dy == dz if ( dx(1) .NE. dx(2) .or. dx(1) .NE. dx(3) ) then call bl_abort('FILTRHS: code for dx != dy != dz not implemented') endif do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) p1 = sigma(i,j,k)*( & five*(phi(i+1,j,k) + phi(i,j+1,k) + phi(i,j,k+1)) & - phi(i+1,j+1,k) - phi(i,j+1,k+1) - phi(i+1,j,k+1) & - three*phi(i+1,j+1,k+1) - nine*phi(i,j,k) ) p2 = sigma(i-1,j,k)*( & five*(phi(i-1,j,k) + phi(i,j+1,k) + phi(i,j,k+1)) & - phi(i-1,j+1,k) - phi(i,j+1,k+1) - phi(i-1,j,k+1) & - three*phi(i-1,j+1,k+1) - nine*phi(i,j,k) ) p3 = sigma(i,j-1,k)*( & five*(phi(i+1,j,k) + phi(i,j-1,k) + phi(i,j,k+1)) & - phi(i+1,j-1,k) - phi(i,j-1,k+1) - phi(i+1,j,k+1) & - three*phi(i+1,j-1,k+1) - nine*phi(i,j,k) ) p4 = sigma(i-1,j-1,k)*( & five*(phi(i-1,j,k) + phi(i,j-1,k) + phi(i,j,k+1)) & - phi(i-1,j-1,k) - phi(i,j-1,k+1) - phi(i-1,j,k+1) & - three*phi(i-1,j-1,k+1) - nine*phi(i,j,k) ) p5 = sigma(i,j,k-1)*( & five*(phi(i+1,j,k) + phi(i,j+1,k) + phi(i,j,k-1)) & - phi(i+1,j+1,k) - phi(i,j+1,k-1) - phi(i+1,j,k-1) & - three*phi(i+1,j+1,k-1) - nine*phi(i,j,k) ) p6 = sigma(i-1,j,k-1)*( & five*(phi(i-1,j,k) + phi(i,j+1,k) + phi(i,j,k-1)) & - phi(i-1,j+1,k) - phi(i,j+1,k-1) - phi(i-1,j,k-1) & - three*phi(i-1,j+1,k-1) - nine*phi(i,j,k) ) p7 = sigma(i,j-1,k-1)*( & five*(phi(i+1,j,k) + phi(i,j-1,k) + phi(i,j,k-1)) & - phi(i+1,j-1,k) - phi(i,j-1,k-1) - phi(i+1,j,k-1) & - three*phi(i+1,j-1,k-1) - nine*phi(i,j,k) ) p8 = sigma(i-1,j-1,k-1)*( & five*(phi(i-1,j,k) + phi(i,j-1,k) + phi(i,j,k-1)) & - phi(i-1,j-1,k) - phi(i,j-1,k-1) - phi(i-1,j,k-1) & - three*phi(i-1,j-1,k-1) - nine*phi(i,j,k) ) divgp(i,j,k) = denom*(p1+p2+p3+p4+p5+p6+p7+p8) end do end do end do end ccseapps-2.5/CCSEApps/iamrlib/GNUmakefile0000644000175000017500000000406711634153073021357 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.75 1999/05/24 18:11:44 car Exp $ # PBOXLIB_HOME = .. TOP = $(PBOXLIB_HOME) # # Where libraries and include files will be installed. # INSTALL_ROOT = $(TOP) # # Variables for the user to set ... # PRECISION = DOUBLE DEBUG = TRUE PROFILE = FALSE DIM = 3 COMP = KCC USE_WINDOWS = FALSE USE_MPI = TRUE # # What stencil do you want to use? # PRVERSION = v9 # # Use hgproj-serial -- only for testing. # # Touch Projection.cpp if you want to change the state of USE_HGPROJ_SERIAL. # USE_HGPROJ_SERIAL = TRUE USE_HGPROJ_SERIAL = FALSE # # The only stencils in which we're interested when using USE_HGPROJ_SERIAL. # ifeq ($(USE_HGPROJ_SERIAL),TRUE) DEFINES += -DBL_USE_HGPROJ_SERIAL endif ifeq ($(DIM),2) # # SYNCREG_2D.F builds RHS differently for 5 and 9 point stencils. # # Note that parallel hgproj currently only implements v5. # ifeq ($(findstring 9, $(PRVERSION)), 9) DEFINES += -DBL_PRVERSION=9 else DEFINES += -DBL_PRVERSION=5 endif endif # # The base name of the library we're building. # LBASE = iamr include $(TOP)/mk/Make.defs ./Make.package ifeq ($(USE_HGPROJ_SERIAL),FALSE) INCLUDE_LOCATIONS += . $(TOP)/include else INCLUDE_LOCATIONS += . $(TOP)/hgproj-serial INCLUDE_LOCATIONS += $(TOP)/hgproj-serial/include/$(DIM)d.$(PRVERSION) INCLUDE_LOCATIONS += $(TOP)/include endif ifeq ($(KCC_VERSION),3.3) CXXFLAGS += --one_instantiation_per_object endif all: $(optionsLib) # # Libraries to close against. # ifeq ($(COMP),KCC) LibsToCloseAgainst := $(TOP)/lib/$(machineSuffix)/libmcmg$(DIM)d.a LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libmg$(DIM)d.a LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libamr$(DIM)d.a LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libbndry$(DIM)d.a ifeq ($(USE_HGPROJ_SERIAL),FALSE) LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libproj$(DIM)d.a else LibsToCloseAgainst += $(TOP)/hgproj-serial/lib/$(machineSuffix)/libproj$(DIM)d.$(PRVERSION).a endif LibsToCloseAgainst += $(TOP)/lib/$(machineSuffix)/libbox$(DIM)d.a $(optionsLib): $(LibsToCloseAgainst) endif include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/iamrlib/MacOpProjDrivers.H0000644000175000017500000000372411634153073022606 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MACOPDRIVERS_H_ //==================================================================== // This header file contains declarations for the MacOperator Projection // driver routines //==================================================================== // scale the variables for a projection solve void proj_scale_var( MultiFab *rho, MultiFab *vel, const BoxArray &grids, int level ); // unscale the variables for a projection solve void proj_unscale_var( MultiFab *rho, MultiFab *vel, const BoxArray &grids, int level ); void ProjFirstGuess( MultiFab &U_new, MultiFab &P_new, int level, const BoxArray &grids ); #endif ccseapps-2.5/CCSEApps/iamrlib/PROB_NS_F.H0000644000175000017500000002067511634153073021030 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _PROB_NS_F_H_ #define _PROB_NS_F_H_ /* ** $Id: PROB_NS_F.H,v 1.1 2002/06/03 21:37:21 car Exp $ */ #ifdef BL_LANG_FORT # define FORT_INITDATA initdata # define FORT_DENFILL denfill # define FORT_ADVFILL advfill # define FORT_XVELFILL xvelfill # define FORT_YVELFILL yvelfill # define FORT_ZVELFILL zvelfill # define FORT_PRESFILL presfill # define FORT_TEMPFILL tempfill # define FORT_DIVUFILL divufill # define FORT_DSDTFILL dsdtfill # define FORT_DENERROR denerror # define FORT_ADVERROR adverror # define FORT_TEMPERROR temperror # define FORT_MVERROR mverror #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_INITDATA INITDATA # define FORT_DENFILL DENFILL # define FORT_ADVFILL ADVFILL # define FORT_XVELFILL XVELFILL # define FORT_YVELFILL YVELFILL # define FORT_ZVELFILL ZVELFILL # define FORT_PRESFILL PRESFILL # define FORT_TEMPFILL TEMPFILL # define FORT_DIVUFILL DIVUFILL # define FORT_DSDTFILL DSDTFILL # define FORT_DENERROR DENERROR # define FORT_ADVERROR ADVERROR # define FORT_TEMPERROR TEMPERROR # define FORT_MVERROR MVERROR # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_INITDATA initdata # define FORT_DENFILL denfill # define FORT_ADVFILL advfill # define FORT_XVELFILL xvelfill # define FORT_YVELFILL yvelfill # define FORT_ZVELFILL zvelfill # define FORT_PRESFILL presfill # define FORT_TEMPFILL tempfill # define FORT_DIVUFILL divufill # define FORT_DSDTFILL dsdtfill # define FORT_DENERROR denerror # define FORT_ADVERROR adverror # define FORT_TEMPERROR temperror # define FORT_MVERROR mverror # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_INITDATA initdata_ # define FORT_DENFILL denfill_ # define FORT_ADVFILL advfill_ # define FORT_XVELFILL xvelfill_ # define FORT_YVELFILL yvelfill_ # define FORT_ZVELFILL zvelfill_ # define FORT_PRESFILL presfill_ # define FORT_TEMPFILL tempfill_ # define FORT_DIVUFILL divufill_ # define FORT_DSDTFILL dsdtfill_ # define FORT_DENERROR denerror_ # define FORT_ADVERROR adverror_ # define FORT_TEMPERROR temperror_ # define FORT_MVERROR mverror_ # endif #include "ArrayLim.H" extern "C" { void FORT_INITDATA (const int* level, const Real* time, const int* lo, const int* hi, const int* nscal, Real* vel, Real* scal, ARLIM_P(s_lo), ARLIM_P(s_hi), Real* press, ARLIM_P(p_lo), ARLIM_P(p_hi), const Real* dx, const Real* xlo, const Real* xhi); void FORT_DENFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_ADVFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_XVELFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_YVELFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); #if (BL_SPACEDIM == 3) void FORT_ZVELFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); #endif void FORT_PRESFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_TEMPFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_DIVUFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_DSDTFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_DENERROR (int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* lo, const int* hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); void FORT_ADVERROR (int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* lo, const int* hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); void FORT_TEMPERROR (int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* lo, const int* hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); void FORT_MVERROR (int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* lo, const int* hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); } #endif #endif /*_PROB_F_H_*/ ccseapps-2.5/CCSEApps/iamrlib/MACPROJ_2D.F0000644000175000017500000001053711634153073021033 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: MACPROJ_2D.F,v 1.14 2000/06/02 17:25:51 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "MACPROJ_F.H" #include "ArrayLim.H" #define SDIM 2 c :: ---------------------------------------------------------- c :: MACDIV: compute the MAC divergence in generalized coordinates c :: c :: INPUTS / OUTPUTS: c :: dmac <= MAC divergence (cell centered) c :: DIMS(dmac) => index limits for dmac c :: lo,hi => index limits of grid interior c :: ux => X edge velocity c :: DIMS(ux) => index limits for ux c :: uy => Y edge velocity c :: DIMS(uy) => index limits for uy c :: xarea => area of cell faces in X dircetion c :: DIMS(ax) => index limits for ax c :: yarea => area of cell faces in Y dircetion c :: DIMS(ay) => index limits for ay c :: vol => cell volume c :: DIMS(vol) => index limits for vol c :: ---------------------------------------------------------- c :: subroutine FORT_MACDIV (dmac,DIMS(dmac),lo,hi, & ux,DIMS(ux),uy,DIMS(uy), & xarea,DIMS(ax),yarea,DIMS(ay), & vol,DIMS(vol)) integer DIMDEC(dmac) integer lo(SDIM), hi(SDIM) integer DIMDEC(ux) integer DIMDEC(uy) integer DIMDEC(ax) integer DIMDEC(ay) integer DIMDEC(vol) REAL_T dmac(DIMV(dmac)) REAL_T ux(DIMV(ux)) REAL_T uy(DIMV(uy)) REAL_T xarea(DIMV(ax)) REAL_T yarea(DIMV(ay)) REAL_T vol(DIMV(vol)) integer i, j do j = lo(2), hi(2) do i = lo(1), hi(1) dmac(i,j) = ( xarea(i+1,j)*ux(i+1,j) - xarea(i,j)*ux(i,j) & + yarea(i,j+1)*uy(i,j+1) - yarea(i,j)*uy(i,j) & )/vol(i,j) end do end do end c :: ---------------------------------------------------------- c :: UCORUPDT c :: Snew = Snew + mult*Sold*dmac c :: c :: INPUTS / OUTPUTS: c :: snew <= state vector at new time c :: sold => state vector at old time c :: DIMS(s) => index limits for sold and snew c :: lo,hi => index limits of grid interior c :: nvar => number of components in state vector c :: dmac => MAC divergence of Ucorr c :: DIMS(dmac) => index limits for dmac c :: mult => scalar multiplier c :: ---------------------------------------------------------- c :: subroutine FORT_UCORUPDT (snew,sold,DIMS(s),nvar,lo,hi, & dmac,DIMS(dmac),mult) integer DIMDEC(s) integer DIMDEC(dmac) integer nvar integer lo(SDIM), hi(SDIM) REAL_T snew(DIMV(s),nvar) REAL_T sold(DIMV(s),nvar) REAL_T dmac(DIMV(dmac)) REAL_T mult integer i, j, n do n = 1, nvar do j = lo(2), hi(2) do i = lo(1), hi(1) snew(i,j,n) = snew(i,j,n) + mult*dmac(i,j)*sold(i,j,n) end do end do end do end ccseapps-2.5/CCSEApps/iamrlib/MACOUTFLOWBC_2D.F0000644000175000017500000010422211634153073021620 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "MACOUTFLOWBC_F.H" #include "ArrayLim.H" #define SDIM 2 #if defined(BL_USE_FLOAT) || defined(BL_T3E) || defined(BL_CRAY) #define SMALL 1.0e-10 #else #define SMALL 1.0d-10 #endif c ************************************************************************* c ** EXTRAP_MAC c ************************************************************************* subroutine FORT_EXTRAP_MAC(DIMS(u0),u0,DIMS(u1),u1,DIMS(div),divu,DIMS(rho),rho, & r_len,redge,DIMS(divuExt),divuExt, & DIMS(rhoExt),rhoExt,dx,lo,hi,face,per,zeroIt) c c Compute the value of phi for macproj c c (subtract divu_ave twice due to precision problems) implicit none integer DIMDEC(u0) integer DIMDEC(u1) integer DIMDEC(div) integer DIMDEC(rho) integer r_len integer lo(SDIM),hi(SDIM) integer DIMDEC(divuExt) integer DIMDEC(rhoExt) REAL_T u0(DIMV(u0)) REAL_T u1(DIMV(u1)) REAL_T divu(DIMV(div)) REAL_T rho(DIMV(rho)) REAL_T redge(0:r_len-1) REAL_T divuExt(DIMV(divuExt)) REAL_T rhoExt(DIMV(rhoExt)) REAL_T dx(2) integer face integer per integer zeroIt c Local variables REAL_T small_pert REAL_T small_udiff parameter ( small_pert = SMALL) parameter (small_udiff = SMALL) integer i, j, neq,n REAL_T divu_ave1,divu_ave2 REAL_T max_divu, min_divu, max_pert REAL_T diff REAL_T rc,hx,hy integer ics,ice,jcs,jce integer ifs,ife,jfs,jfe integer if,jf,ic,jc c NOTE: Assumes that rho at edge between i, i-1 = half*(rho(i)+rho(i-1)) c (1) Linear fit of rho between nodes c (2) rho, divu on same boxes (box) c (3) phi is on box, shifted up one c (4) u is edge-based, on surroundingNodes(box) c Compute average of divu over outflow bc. Set trivial solution if average c is zero, or if divu is constant #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 ics = ARG_L1(rho) ice = ARG_H1(rho) jcs = ARG_L2(rho) jce = ARG_H2(rho) ifs = lo(1) ife = hi(1) jfs = lo(2) jfe = hi(2) hx = dx(1) hy = dx(2) zeroIt = 0 if (face .eq. XLO) then if = ifs max_divu = divu(ics,jcs) min_divu = max_divu do j = jcs, jce divuExt(j,if) = divu(ics,j) rhoExt(j,if) = rho(ics,j) max_divu = max(max_divu,divuExt(j,if)) min_divu = min(min_divu,divuExt(j,if)) end do c Here we modify divuExt to include the velocity terms. do j = jcs, jce divuExt(j,if) = redge(j-jcs)*(divuExt(j,if)*hy*hy - (u1(ics,j+1)-u1(ics,j))*hy) end do call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(jcs,if)) do j = jcs, jce max_pert = MAX(max_pert,ABS(divuExt(j,if))) end do c Make sure u_mac is periodic if (per .eq. 1) then diff = u1(ics,jcs)-u1(ics,jce+1) if (ABS(diff) .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE XLO : umac not periodic' write(6,*) 'V AT TOP: ',u1(ics,jce+1) write(6,*) 'V AT BOTTOM: ',u1(ics,jcs ) call bl_abort(" ") endif endif else if (face .eq. YLO) then jf = jfs max_divu = divu(ics,jcs) min_divu = max_divu do i = ics, ice divuExt(i,jf) = divu(i,jcs) rhoExt(i,jf) = rho(i,jcs) max_divu = max(max_divu,divuExt(i,jf)) min_divu = min(min_divu,divuExt(i,jf)) end do c Here we modify divuExt to include the velocity terms. do i = ics, ice rc = half*(redge(i+1-ics)+redge(i-ics)) divuExt(i,jf) = rc*divuExt(i,jf)*hx*hx - $ (redge(i+1-ics)*u0(i+1,jcs)-redge(i-ics)*u0(i,jcs))*hx end do call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,jf)) do i = ics, ice max_pert = MAX(max_pert,ABS(divuExt(i,jf))) end do c Make sure u_mac is periodic if (per .eq. 1) then diff = u0(ics,jcs)-u0(ice+1,jcs) if (ABS(diff) .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE YLO : umac not periodic' write(6,*) 'U AT LEFT: ',u0(ics ,jcs) write(6,*) 'U AT RGHT: ',u0(ice+1,jcs) call bl_abort(" ") endif endif else if (face .eq. XHI) then if = ife max_divu = divu(ice,jcs) min_divu = max_divu do j = jcs, jce divuExt(j,if) = divu(ice,j) rhoExt(j,if) = rho(ice,j) max_divu = max(max_divu,divuExt(j,if)) min_divu = min(min_divu,divuExt(j,if)) end do c Here we modify divuExt to include the velocity terms. do j = jcs, jce divuExt(j,if) = redge(j-jcs)*(divuExt(j,if)*hy*hy - (u1(ice,j+1)-u1(ice,j))*hy) end do call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(jcs,if)) do j = jcs, jce max_pert = MAX(max_pert,ABS(divuExt(j,if))) end do c Make sure u_mac is periodic if (per .eq. 1) then diff = u1(ice,jcs)-u1(ice,jce+1) if (ABS(diff) .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE XHI : umac not periodic' write(6,*) 'V AT TOP: ',u1(ice,jce+1) write(6,*) 'V AT BOTTOM: ',u1(ice,jcs ) call bl_abort(" ") endif endif else if (face .eq. YHI) then jf = jfe max_divu = divu(ics,jce) min_divu = max_divu do i = ics, ice divuExt(i,jf) = divu(i,jce) rhoExt(i,jf) = rho(i,jce) max_divu = max(max_divu,divuExt(i,jf)) min_divu = min(min_divu,divuExt(i,jf)) end do c Here we modify divuExt to include the velocity terms. do i = ics, ice rc = half*(redge(i+1-ics)+redge(i-ics)) divuExt(i,jf) = rc*divuExt(i,jf)*hx*hx - $ (redge(i+1-ics)*u0(i+1,jce)-redge(i-ics)*u0(i,jce))*hx end do call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,jf)) do i = ics, ice max_pert = MAX(max_pert,ABS(divuExt(i,jf))) end do c Make sure u_mac is periodic if (per .eq. 1) then diff = u0(ics,jce)-u0(ice+1,jce) if (ABS(diff) .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE YHI : umac not periodic' write(6,*) 'U AT LEFT: ',u0(ics ,jce) write(6,*) 'U AT RGHT: ',u0(ice+1,jce) call bl_abort(" ") endif endif endif c check to see if we should zero phi max_pert = max_pert/(ABS(divu_ave1+divu_ave2)+small_pert) if ((max_divu.eq.zero.and.min_divu.eq.zero) & .or.(max_pert.le.small_pert)) then zeroIt = 1 end if end c ************************************************************************* c ** SUBTRACTAVG c ************************************************************************* subroutine subtractavg(DIMS(divu),divu,redge,r_len,lo,hi,divu_ave,face) implicit none integer DIMDEC(divu) integer r_len integer lo(SDIM),hi(SDIM) REAL_T redge(0:r_len-1) REAL_T divu(DIMV(divu)) REAL_T divu_ave integer face integer i,j REAL_T rcen REAL_T vtot divu_ave = zero vtot = zero if (face .eq. XLO .or. face .eq. XHI) then i = lo(1) do j=lo(2),hi(2) vtot = vtot+one divu_ave = divu_ave+divu(j,i) enddo divu_ave = divu_ave/vtot do j=lo(2),hi(2) divu(j,i) = divu(j,i) - divu_ave enddo elseif (face .eq. YLO .or. face .eq. YHI) then j = lo(2) do i=lo(1),hi(1) rcen = half*(redge(i)+redge(i+1)) vtot = vtot+rcen divu_ave = divu_ave+rcen*divu(i,j) enddo divu_ave = divu_ave/vtot do i=lo(1),hi(1) divu(i,j) = divu(i,j) - divu_ave enddo else print*, "bad value of face in subtractavg" endif end #undef XLO #undef YLO #undef XHI #undef YHI c ************************************************************************* c ** MACRELAX c ************************************************************************* #define DGX (beta(i)*phi(i-1) - (beta(i)+beta(i+1))*phi(i) \ +beta(i+1)*phi(i+1))*(hxsqinv) subroutine FORT_MACRELAX(DIMS(rhs),rhs,DIMS(beta),beta,DIMS(phi),phi, & lo,hi,h,isPeriodic,niter) implicit none integer DIMDEC(beta) integer DIMDEC(rhs) integer DIMDEC(phi) REAL_T beta(DIM1(beta)) REAL_T rhs(DIM1(rhs)) REAL_T phi(DIM1(phi)) REAL_T h(SDIM) integer lo(SDIM),hi(SDIM) integer isPeriodic(SDIM) c Local variables integer redblack integer ics,ice integer i,iter REAL_T lam, dg REAL_T phitot,vtot logical setSingularPoint REAL_T maxnorm REAL_T hxsqinv integer niter hxsqinv = 1.0D0/(h(1)*h(1)) ics = lo(1) ice = hi(1) setSingularPoint = .false. call setmacbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) do iter = 1,niter do redblack = 0,1 do i=ics+redblack,ice,2 dg = DGX lam = -one/(hxsqinv*(beta(i)+beta(i+1))) phi(i) = phi(i) + lam*(rhs(i)-dg) enddo call setmacbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) end do end do end c ************************************************************************* c ** MACSUBTRACTAVGPHI c ************************************************************************* subroutine FORT_MACSUBTRACTAVGPHI(DIMS(phi),phi,r_lo,r_hi,r,lo,hi, & isPeriodic) implicit none integer DIMDEC(phi) REAL_T phi(DIM1(phi)) integer r_lo,r_hi REAL_T r(r_lo:r_hi) integer lo(SDIM),hi(SDIM) integer isPeriodic(SDIM) REAL_T phitot,vtot integer ics,ice,ine integer i logical setSingularPoint ics = lo(1) ice = hi(1) setSingularPoint = .false. phitot = zero vtot = zero do i=ics,ice phitot = phitot+phi(i)*r(i) vtot = vtot + r(i) enddo phitot = phitot/vtot do i=ics,ice phi(i) = phi(i) - phitot enddo call setmacbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) end c ************************************************************************* c ** MACRESID c ************************************************************************* subroutine FORT_MACRESID(DIMS(rhs),rhs,DIMS(beta),beta,DIMS(phi),phi, & DIMS(resid),resid,lo,hi,h,isPeriodic,maxnorm) implicit none integer DIMDEC(beta) integer DIMDEC(rhs) integer DIMDEC(phi) integer DIMDEC(resid) REAL_T beta(DIM1(beta)) REAL_T rhs(DIM1(rhs)) REAL_T phi(DIM1(phi)) REAL_T resid(DIM1(resid)) integer isPeriodic(SDIM) REAL_T h(SDIM) integer lo(SDIM),hi(SDIM) REAL_T maxnorm integer i REAL_T hxsqinv hxsqinv = one/(h(1)*h(1)) maxnorm = zero do i = lo(1),hi(1) resid(i) = rhs(i)-(DGX) maxnorm = max(maxnorm,ABS(resid(i))) enddo end c ************************************************************************* c ** SETMACBC c ************************************************************************* subroutine setmacbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) implicit none integer DIMDEC(phi) REAL_T phi(DIM1(phi)) integer lo(SDIM),hi(SDIM) integer isPeriodic(SDIM) integer ics,ice logical setSingularPoint ics = lo(1) ice = hi(1) if (isPeriodic(1) .NE. 1 .and. setSingularPoint) then phi(ice)= zero endif if (isPeriodic(1).eq.1) then phi(ics-1) = phi(ice) phi(ice+1) = phi(ics) else phi(ics-1) = phi(ics) phi(ice+1) = phi(ice) endif end c ************************************************************************* c ** MAC_SHIFT_PHI c ************************************************************************* subroutine FORT_MAC_SHIFT_PHI(DIMS(out),out,DIMS(in),in,face) implicit none integer face integer DIMDEC(in) integer DIMDEC(out) REAL_T in(DIMV(in)) REAL_T out(DIMV(out)) integer i,j #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 if (face .eq. XLO .or. face .eq. XHI) then do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j) = in(j,i) enddo enddo else if (face .eq. YLO .or. face .eq. YHI) then do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j) = in(i,j) enddo enddo endif #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** MAC_RESHIFT_PHI c ************************************************************************* subroutine FORT_MAC_RESHIFT_PHI(DIMS(out),out,DIMS(in),in,face) implicit none integer face integer DIMDEC(in) integer DIMDEC(out) REAL_T in(DIMV(in)) REAL_T out(DIMV(out)) integer i,j #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 if (face .eq. XLO .or. face .eq. XHI) then do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j) = in(j,i) enddo enddo else if (face .eq. YLO .or. face .eq. YHI) then do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j) = in(i,j) enddo enddo endif #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** SOLVEMAC c ************************************************************************* subroutine FORT_SOLVEMAC(p, DIMS(p),dest0, DIMS(dest0), & source,DIMS(source), sigma, DIMS(sigma), & cen, DIMS(cen), $ r,DIMS(r), w, DIMS(w),z, DIMS(z), & x, DIMS(x),lo, hi, h, $ isPeriodic, maxiter, tol, abs_tol,max_jump,norm) implicit none integer lo(SDIM),hi(SDIM) integer DIMDEC(p) integer DIMDEC(dest0) integer DIMDEC(source) integer DIMDEC(sigma) integer DIMDEC(cen) integer DIMDEC(r) integer DIMDEC(w) integer DIMDEC(z) integer DIMDEC(x) REAL_T p(DIM1(p)) REAL_T dest0(DIM1(dest0)) REAL_T source(DIM1(source)) REAL_T sigma(DIM1(sigma)) REAL_T cen(DIM1(cen)) REAL_T r(DIM1(r)) REAL_T w(DIM1(w)) REAL_T z(DIM1(z)) REAL_T x(DIM1(x)) REAL_T h(SDIM) integer isPeriodic(SDIM) REAL_T norm REAL_T tol integer maxiter REAL_T abs_tol,max_jump c Local variables integer i,iter integer istart,iend REAL_T alpha, beta, rho, rho_old REAL_T goal REAL_T norm0 logical setSingularPoint istart = lo(1) iend = hi(1) setSingularPoint = .false. do i = lo(1)-1,hi(1)+1 dest0(i) = p(i) p(i) = zero enddo do i=ARG_L1(w),ARG_H1(w) w(i) = zero enddo call setmacbc(DIMS(dest0),dest0,lo,hi,isPeriodic,setSingularPoint) call makemacdgphi(dest0,DIMS(dest0),w,DIMS(w),sigma,DIMS(sigma), & lo,hi,h,isPeriodic,setSingularPoint) do i = istart, iend r(i) = source(i) - w(i) enddo rho = zero norm0 = zero do i = istart, iend norm0 = max(norm0, abs(r(i))) z(i) = r(i) rho = rho + z(i) * r(i) enddo norm = norm0 goal = max(tol*norm0,abs_tol) if (norm0 .le. goal) then do i = istart, iend p(i) = dest0(i) enddo return endif do i = istart, iend x(i) = zero p(i) = z(i) enddo iter = 0 100 continue do i=ARG_L1(w),ARG_H1(w) w(i) = zero enddo call setmacbc(DIMS(p),p,lo,hi,isPeriodic,setSingularPoint) call makemacdgphi(p,DIMS(p),w,DIMS(w),sigma,DIMS(sigma), & lo,hi,h,isPeriodic,setSingularPoint) alpha = zero do i = istart, iend alpha = alpha + p(i)*w(i) enddo alpha = rho / alpha rho_old = rho rho = zero norm = zero do i = istart, iend x(i) = x(i) + alpha * p(i) r(i) = r(i) - alpha * w(i) z(i) = r(i) rho = rho + z(i) * r(i) norm = max(norm,abs(r(i))) enddo iter = iter+1 c write(6,*) iter,norm if (iter .gt. maxiter .or. norm .gt. max_jump*norm0) then print *, "cg solve in mac failed to converge" do i = istart, iend p(i) = x(i) + dest0(i) enddo call setmacbc(DIMS(p),p,lo,hi,isPeriodic,setSingularPoint) else if (norm .lt. goal) then do i = istart, iend p(i) = x(i) + dest0(i) enddo call setmacbc(DIMS(p),p,lo,hi,isPeriodic,setSingularPoint) else beta = rho / rho_old do i = istart, iend p(i) = z(i) + beta * p(i) enddo goto 100 endif return end subroutine makemacdgphi(phi,DIMS(phi),dgphi,DIMS(dgphi), & beta,DIMS(beta), & lo,hi,h,isPeriodic,setSingularPoint) implicit none integer DIMDEC(phi) integer DIMDEC(dgphi) integer DIMDEC(beta) REAL_T phi(DIM1(phi)) REAL_T dgphi(DIM1(dgphi)) REAL_T beta(DIM1(beta)) integer lo(SDIM),hi(SDIM) REAL_T h(SDIM) integer isPeriodic(SDIM) logical setSingularPoint integer i,j REAL_T hxsqinv hxsqinv = one/(h(1)*h(1)) do i = lo(1),hi(1) dgphi(i) = DGX enddo end c ************************************************************************* c ** COARSIGMA ** c ** Coarsen the edge-based sigma coefficients c ************************************************************************* subroutine FORT_COARSIGMA(sigma,DIMS(sigma),sigmac,DIMS(sigmac), & lo,hi,loc,hic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(sigma) integer DIMDEC(sigmac) REAL_T sigma(DIM1(sigma)) REAL_T sigmac(DIM1(sigmac)) c Local variables integer i,twoi do i = loc(1),hic(1)+1 twoi = 2*(i-loc(1))+lo(1) sigmac(i) = sigma(twoi) enddo return end c ************************************************************************* c ** RESTRICT ** c ** Conservatively average the residual c ************************************************************************* subroutine FORT_RESTRICT(res,DIMS(res),resc,DIMS(resc), & lo,hi,loc,hic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(res) integer DIMDEC(resc) REAL_T res(DIM1(res)) REAL_T resc(DIM1(resc)) c Local variables integer i,twoi c ::: NOTE: dont need factor of r here for volume-weighting because c ::: what were calling the residual is really already r*residual do i = loc(1),hic(1) twoi = 2*(i-loc(1))+lo(1) resc(i) = half*(res(twoi) + res(twoi+1)) enddo return end c ************************************************************************* c ** INTERPOLATE ** c ** Piecewise constant interpolation c ************************************************************************* subroutine FORT_INTERPOLATE(phi,DIMS(phi),deltac,DIMS(deltac), & lo,hi,loc,hic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(phi) integer DIMDEC(deltac) REAL_T phi(DIM1(phi)) REAL_T deltac(DIM1(deltac)) c Local variables integer i,twoi do i = loc(1), hic(1) twoi = 2*(i-loc(1))+lo(1) phi(twoi ) = phi(twoi ) + deltac(i) phi(twoi+1) = phi(twoi+1) + deltac(i) enddo return end c ************************************************************************* c ** MACPHIBC ** c ************************************************************************* subroutine FORT_MACPHIBC(phi,length,divuExt,rhoExt,redge,hx,per) c c Compute the value of phi for macproj to be used at an outflow face, c assuming that the tangential velocity on the edges of the outflow boundary c are either zero or periodic. c implicit none integer length integer r_len integer per REAL_T phi(length) REAL_T divuExt(0:length-1) REAL_T rhoExt(0:length-1) REAL_T redge(0:length) REAL_T hx c Local variables integer NstripMAX parameter (NstripMAX = 2000) integer i, j, neq,n REAL_T a(NstripMAX), b(NstripMAX), c(NstripMAX), s(NstripMAX) REAL_T alpha, beta, sVal logical rNormed REAL_T vtot REAL_T rL, rR, diff REAL_T phitot REAL_T rcen integer ics, ice c This description assumes outflow at yhi; however, code works for c outflow at any face. c NOTE: Assumes that rho at edge between i, i-1 = half*(rho(i)+rho(i-1)) c (1) Linear fit of rho between nodes c (2) rho, divu on same boxes (box) c (3) phi is on box, shifted up one c Solve d/dx( 1/rho d/dx( phi ) ) = dU/dx - (S - S_ave) [S = divu] c w/periodic or Neumann BC's, using a tridiagonal solve which detects, c and deals with, the singular equations. In the Neumann case, c arbitrarily set the upper right corner to zero to pin the solution. c Note that the RHS of this equation satisfies the solvability c constraint that Int[RHS.dV] = 0 by construction. c This implies that the normal component takes up the slack: c c d/dy( 1/rho d/dy( phi ) ) = dV/dy - S_ave c c This information should be used to construct the normal gradient of the c normal velocity, for the advective/diffusive step, for example. c In this implementation, use that d/dy == 0 at top, so y-edge centered c values come directly from cell-centers just inside domain #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 ics = 0 ice = length-1 neq = length if ( neq .gt. NStripMax ) then call bl_error( 'MACPHIBC: NStripMax too small' ) end if c Carry out non-trivial solve. First set interior equations, then do BC's do n = 2,neq-1 i = n + ics - 1 a(n)=two*redge(i )/(rhoExt(i)+rhoExt(i-1)) c(n)=two*redge(i+1)/(rhoExt(i)+rhoExt(i+1)) b(n)=- a(n) - c(n) s(n)= -divuExt(i) end do if (per .eq. 1) then c Do left-side periodic BC (keep r in there to guarantee correct scaling) i = ics beta=two*redge(i )/(rhoExt(i)+rhoExt(ice)) c(1)=two*redge(i+1)/(rhoExt(i)+rhoExt(i+1)) b(1)=- beta - c(1) s(1)= -divuExt(i) c Do right-side periodic i = ice a(neq)=two*redge(i )/(rhoExt(i)+rhoExt(i-1)) alpha =two*redge(i+1)/(rhoExt(i)+rhoExt(ics)) b(neq)=- a(neq) - alpha s(neq)= -divuExt(i) c Solve the equations call cyclic(a,b,c,alpha,beta,s,phi,neq) else c Solid walls, Neumann conditions (dphi/dx=u=0) i = ics c(1) = two*redge(i+1)/(rhoExt(i)+rhoExt(i+1)) b(1) = - c(1) s(1)= -divuExt(i) i = ice a(neq) = two*redge(i)/(rhoExt(i)+rhoExt(i-1)) b(neq) = - a(neq) s(neq)= -divuExt(i) c Solve the equations (we know they're singular, pass the arbitrary value, c and a flag that we've already normalized the rhs, in the sense that c Int[dU/dx - (S-S_ave)] == 0 sVal = zero rNormed = .true. call tridag_sing(a,b,c,s,phi,neq,sVal,rNormed) end if c Try normalizing phi to average to zero phitot = zero vtot = zero do n = 1,neq rcen = half*(redge(ics+n) + redge(ics+n-1)) phitot = phitot + phi(n)*rcen vtot = vtot + rcen end do phitot = phitot / vtot do n = 1,neq phi(n) = phi(n) - phitot end do #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** MACFILL_ONED ** c ************************************************************************* subroutine FORT_MACFILL_ONED(lenx,leny,length,faces,numOutFlowFaces, $ cc0,cc1,cc2,cc3, $ r0, r1, r2, r3 , conn, redge_conn) integer lenx,leny,length integer faces(4) integer numOutFlowFaces REAL_T cc0(leny,2) REAL_T cc1(lenx,2) REAL_T cc2(leny,2) REAL_T cc3(lenx,2) REAL_T conn(length,2) REAL_T r0(leny+1) REAL_T r1(lenx+1) REAL_T r2(leny+1) REAL_T r3(lenx+1) REAL_T redge_conn(length+1) integer xlo_outflow,ylo_outflow integer xhi_outflow,yhi_outflow integer i,ifinal,n REAL_T sum #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 c Want to find the single non-outflow face. xlo_outflow = 0 ylo_outflow = 0 xhi_outflow = 0 yhi_outflow = 0 do i = 1, numOutFlowFaces if (faces(i) .eq. XLO) xlo_outflow = 1 if (faces(i) .eq. YLO) ylo_outflow = 1 if (faces(i) .eq. XHI) xhi_outflow = 1 if (faces(i) .eq. YHI) yhi_outflow = 1 enddo c Possible combinations of faces to come in here: c cc0 cc1 cc2 cc3 c XLO YLO c XLO YHI c YLO XHI c YLO YHI c XLO YLO XHI c XLO XHI YHI c XLO YLO YHI c YLO XHI YHI c XLO YLO XHI YHI c We must remember here that the cc* arrays have already been c ordered so that the 2nd dimension is one cell wide. ifinal = 0 if (numOutFlowFaces .eq. 4 .or. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 0) ) then do i = 1,leny conn(i,1) = cc0(i,1) conn(i,2) = cc0(i,2) enddo do i = 1,leny+1 redge_conn(i) = r0(i) enddo ifinal = leny endif if (yhi_outflow .eq. 1 .and. $ .not. (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do i = 1,lenx conn(ifinal+i,1) = cc3(i,1) conn(ifinal+i,2) = cc3(i,2) enddo do i = 1,lenx+1 redge_conn(ifinal+i) = r3(i) enddo ifinal = ifinal + lenx endif if (xhi_outflow .eq. 1) then do i = 1,leny conn(ifinal+i,1) = cc2(leny+1-i,1) conn(ifinal+i,2) = cc2(leny+1-i,2) enddo do i = 1,leny+1 redge_conn(ifinal+i) = r2(leny+2-i) enddo ifinal = ifinal + leny endif if (ylo_outflow .eq. 1) then do i = 1,lenx conn(ifinal+i,1) = cc1(lenx+1-i,1) conn(ifinal+i,2) = cc1(lenx+1-i,2) enddo do i = 1,lenx+1 redge_conn(ifinal+i) = r1(lenx+2-i) enddo ifinal = ifinal + lenx endif if (numOutFlowFaces .lt. 4 .and. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 1) ) then do i = 1,leny conn(ifinal+i,1) = cc0(i,1) conn(ifinal+i,2) = cc0(i,2) enddo do i = 1,leny+1 redge_conn(ifinal+i) = r0(i) enddo ifinal = ifinal + leny endif if (yhi_outflow .eq. 1 .and. $ (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do i = 1,lenx conn(ifinal+i,1) = cc3(i,1) conn(ifinal+i,2) = cc3(i,2) enddo do i = 1,lenx+1 redge_conn(ifinal+i) = r3(i) enddo ifinal = ifinal + lenx endif length = ifinal sum = zero do i = 1,length sum = sum + conn(i,2) enddo #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** MACPHI_FROM_X ** c ************************************************************************* subroutine FORT_MACPHI_FROM_X(DIMS(phi),phi,length,x) integer DIMDEC(phi) integer length REAL_T phi(DIMV(phi)) REAL_T x(length) integer lenx, leny integer i,j c We know that the faces are ordered: XLO,XHI,YLO,YHI lenx = ARG_H1(phi)-ARG_L1(phi) leny = ARG_H2(phi)-ARG_L2(phi) if (lenx .eq. 0) then do j = 1,length phi(ARG_L1(phi),j-1) = x(j) enddo elseif (leny .eq. 0) then do i = 1,length phi(i-1,ARG_L2(phi)) = x(i) enddo endif #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** MACALLPHI_FROM_X ** c ************************************************************************* subroutine FORT_MACALLPHI_FROM_X(lenx,leny,length,faces,numOutFlowFaces, $ phi0,phi1,phi2,phi3,x) integer lenx,leny,length integer numOutFlowFaces integer faces(4) REAL_T phi0(0:leny-1) REAL_T phi1(0:lenx-1) REAL_T phi2(0:leny-1) REAL_T phi3(0:lenx-1) REAL_T x(0:length-1) integer xlo_outflow,ylo_outflow integer xhi_outflow,yhi_outflow integer i,j,ifinal,n #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 c Possible combinations of faces to come in here: c phi0 phi1 phi2 phi3 c XLO YLO c XLO YHI c YLO XHI c YLO YHI c XLO YLO XHI c XLO XHI YHI c XLO YLO YHI c YLO XHI YHI c XLO YLO XHI YHI c Want to find which are outflow faces. xlo_outflow = 0 ylo_outflow = 0 xhi_outflow = 0 yhi_outflow = 0 do i = 1, numOutFlowFaces if (faces(i) .eq. XLO) xlo_outflow = 1 if (faces(i) .eq. YLO) ylo_outflow = 1 if (faces(i) .eq. XHI) xhi_outflow = 1 if (faces(i) .eq. YHI) yhi_outflow = 1 enddo c We know that the faces are ordered: XLO,XHI,YLO,YHI ifinal = 0 if (numOutFlowFaces .eq. 4 .or. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 0) ) then do j = 0,leny-1 phi0(j) = x(j) enddo ifinal = leny endif if (yhi_outflow .eq. 1 .and. $ .not. (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do i = 0,lenx-1 phi3(i) = x(i+ifinal) enddo ifinal = ifinal+lenx endif if (xhi_outflow .eq. 1) then do j = 0,leny-1 phi2(leny-1-j) = x(ifinal+j) enddo ifinal = ifinal+leny endif if (ylo_outflow .eq. 1) then if (numOutFlowFaces .eq. 4) then do i = 0,lenx-1 phi1(lenx-1-i) = x(ifinal+i) enddo phi1(0) = x(0) else do i = 0,lenx-1 phi1(lenx-1-i) = x(ifinal+i) enddo endif ifinal = ifinal+lenx endif if (numOutFlowFaces .lt. 4 .and. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 1) ) then do j = 0,leny-1 phi0(j) = x(j+ifinal) enddo ifinal = ifinal+leny endif if (yhi_outflow .eq. 1 .and. $ (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do i = 0,lenx-1 phi3(i) = x(i+ifinal) enddo ifinal = ifinal+lenx endif end ccseapps-2.5/CCSEApps/iamrlib/DIFFUSION_3D.F0000644000175000017500000003531411634153073021267 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: DIFFUSION_3D.F,v 1.10 2002/08/29 22:14:52 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "DIFFUSION_F.H" #include "ArrayLim.H" #define SDIM 3 c :: c :: ---------------------------------------------------------- c :: compute the time averaged viscous flux at the given edge c :: for variable transport coefficients c :: c :: NOTE: c :: These are only computed for a reflux operation, and require c :: that the ghost cells have been filled according to the c :: diffusion operator (maybe this isnt such a good idea...) c :: ---------------------------------------------------------- c :: subroutine FORT_VISCFLUX_VC (s_o,s_n,DIMS(s),lo,hi, $ flux, DIMS(flux), area, DIMS(area), $ bn, bnp1, DIMS(b), $ dx,mult,theta,dir) integer lo(SDIM), hi(SDIM) integer DIMDEC(s) integer DIMDEC(flux) integer DIMDEC(area) integer DIMDEC(b) REAL_T s_o(DIMV(s)) REAL_T s_n(DIMV(s)) REAL_T flux(DIMV(flux)) REAL_T area(DIMV(area)) REAL_T bn(DIMV(b)) REAL_T bnp1(DIMV(b)) REAL_T dx REAL_T mult,theta integer dir integer i, j, k REAL_T sx1, sx2, sy1, sy2, sz1, sz2 REAL_T onemintheta onemintheta = one-theta if (dir .EQ. 0) then c ::::: compute X fluxes do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1)+1 sx1 = (s_o(i,j,k) - s_o(i-1,j,k))*bn(i,j,k) sx2 = (s_n(i,j,k) - s_n(i-1,j,k))*bnp1(i,j,k) flux(i,j,k) = mult*(onemintheta*sx1 + theta*sx2)*area(i,j,k)/dx end do end do end do else if (dir .EQ. 1) then c ::::: compute Y fluxes do k = lo(3), hi(3) do j = lo(2), hi(2)+1 do i = lo(1), hi(1) sy1 = (s_o(i,j,k) - s_o(i,j-1,k))*bn(i,j,k) sy2 = (s_n(i,j,k) - s_n(i,j-1,k))*bnp1(i,j,k) flux(i,j,k) = mult*(onemintheta*sy1 + theta*sy2)*area(i,j,k)/dx end do end do end do else if (dir .EQ. 2) then c ::::: compute Z fluxes do k = lo(3), hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) sz1 = (s_o(i,j,k) - s_o(i,j,k-1))*bn(i,j,k) sz2 = (s_n(i,j,k) - s_n(i,j,k-1))*bnp1(i,j,k) flux(i,j,k) = mult*(onemintheta*sz1 + theta*sz2)*area(i,j,k)/dx end do end do end do end if end c :: c :: ---------------------------------------------------------- c :: compute the time averaged viscous flux at the given edge c :: for constant transport coefficients c :: c :: NOTE: c :: These are only computed for a reflux operation, and require c :: that the ghost cells have been filled according to the c :: diffusion operator (maybe this isnt such a good idea...) c :: ---------------------------------------------------------- c :: subroutine FORT_VISCFLUX_CC (s_o,s_n,DIMS(s),lo,hi, $ flux, DIMS(flux), area, DIMS(area), $ dx,mult,theta,dir) integer lo(SDIM), hi(SDIM) integer DIMDEC(s) integer DIMDEC(flux) integer DIMDEC(area) REAL_T s_o(DIMV(s)) REAL_T s_n(DIMV(s)) REAL_T flux(DIMV(flux)) REAL_T area(DIMV(area)) REAL_T dx REAL_T mult,theta integer dir integer i, j, k REAL_T sx1, sx2, sy1, sy2, sz1, sz2 REAL_T onemintheta onemintheta = one-theta if (dir .EQ. 0) then c ::::: compute X fluxes do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1)+1 sx1 = s_o(i,j,k) - s_o(i-1,j,k) sx2 = s_n(i,j,k) - s_n(i-1,j,k) flux(i,j,k) = mult*(onemintheta*sx1 + theta*sx2)*area(i,j,k)/dx end do end do end do else if (dir .EQ. 1) then c ::::: compute Y fluxes do k = lo(3), hi(3) do j = lo(2), hi(2)+1 do i = lo(1), hi(1) sy1 = s_o(i,j,k) - s_o(i,j-1,k) sy2 = s_n(i,j,k) - s_n(i,j-1,k) flux(i,j,k) = mult*(onemintheta*sy1 + theta*sy2)*area(i,j,k)/dx end do end do end do else c ::::: compute Z fluxes do k = lo(3), hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) sz1 = s_o(i,j,k) - s_o(i,j,k-1) sz2 = s_n(i,j,k) - s_n(i,j,k-1) flux(i,j,k) = mult*(onemintheta*sz1 + theta*sz2)*area(i,j,k)/dx end do end do end do end if end subroutine FORT_VISCSYNCFLUX (ssync,DIMS(ssync),lo,hi, $ xflux,DIMS(xf),yflux,DIMS(yf), $ zflux,DIMS(zf), $ xarea,DIMS(ax),yarea,DIMS(ay), $ zarea,DIMS(az),dx,mult) integer lo(3), hi(3) integer DIMDEC(ssync) integer DIMDEC(xf) integer DIMDEC(yf) integer DIMDEC(zf) integer DIMDEC(ax) integer DIMDEC(ay) integer DIMDEC(az) REAL_T ssync(DIMV(ssync)) REAL_T xflux(DIMV(xf)) REAL_T yflux(DIMV(yf)) REAL_T zflux(DIMV(zf)) REAL_T xarea(DIMV(ax)) REAL_T yarea(DIMV(ay)) REAL_T zarea(DIMV(az)) REAL_T dx(3) REAL_T mult integer i, j, k, n REAL_T sx REAL_T sy REAL_T sz c c ::::: compute X fluxes c do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1)+1 sx = ssync(i,j,k) - ssync(i-1,j,k) xflux(i,j,k) = mult*sx*xarea(i,j,k)/dx(1) end do end do end do c c ::::: compute Y fluxes c do k = lo(3), hi(3) do j = lo(2), hi(2)+1 do i = lo(1), hi(1) sy = ssync(i,j,k) - ssync(i,j-1,k) yflux(i,j,k) = mult*sy*yarea(i,j,k)/dx(2) end do end do end do c c ::::: compute Z fluxes c do k = lo(3), hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) sz = ssync(i,j,k) - ssync(i,j,k-1) zflux(i,j,k) = half*mult*sz*zarea(i,j,k)/dx(3) end do end do end do end c :: ---------------------------------------------------------- c :: SETALPHA c :: alpha(i,j,k) = vol*(1+b/(r(i)^2)) / density c :: c :: INPUTS / OUTPUTS: c :: fab <= array to be modified c :: DIMS(fab) => index limits of fab c :: lo,hi => index limits of box c :: r => 1-d array of radius c :: DIMS(r) => index limits of r c :: b => viscous coefficient c :: vol => volume array c :: DIMS(vol) => index limits of fab c :: denfab => array of density at time n+1/2 c :: DIMS(den) => index limits of fab c :: usehoop => do we add hoop stress? NOT IN 3-D c :: useden => do we divide by density? (only if velocity component) c :: ---------------------------------------------------------- c :: subroutine FORT_SETALPHA (fab, DIMS(fab), lo, hi, r, DIMS(r), b, $ vol, DIMS(vol), denfab, DIMS(den), & usehoop,useden) integer DIMDEC(fab) integer DIMDEC(r) integer DIMDEC(vol) integer DIMDEC(den) integer lo(SDIM), hi(SDIM) integer usehoop,useden REAL_T fab(DIMV(fab)) REAL_T vol(DIMV(vol)) REAL_T denfab(DIMV(den)) REAL_T r(DIM1(r)) REAL_T b integer i, j, k if (useden .eq. 0) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) fab(i,j,k) = vol(i,j,k) end do end do end do else do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) fab(i,j,k) = vol(i,j,k) * denfab(i,j,k) end do end do end do end if end c :: ---------------------------------------------------------- c :: SET_TENSOR_ALPHA c :: alpha(i,j) = vol*density c :: c :: INPUTS / OUTPUTS: c :: fab <= array to be modified c :: DIMS(fab) => index limits of fab c :: lo,hi => index limits of box c :: r => 1-d array of radius c :: b => theta*dt or -(1-theta)*dt c :: vol => volume array c :: DIMS(vol) => index limits of fab c :: denfab => array of density at time n+1/2 c :: DIMS(den) => index limits of fab c :: usehoop => do we add hoop stress? (only if x-vel component) c :: useden => do we divide by density? (only if velocity component) c :: ---------------------------------------------------------- c :: subroutine FORT_SET_TENSOR_ALPHA (alpha, DIMS(alpha), lo, hi, r, DIMS(r), $ b, vol, DIMS(vol), & denfab,DIMS(den),betax,DIMS(betax), & betay,DIMS(betay),betaz,DIMS(betaz),isrz) integer DIMDEC(alpha) integer lo(SDIM), hi(SDIM) integer DIMDEC(vol) integer DIMDEC(den) integer DIMDEC(betax) integer DIMDEC(betay) integer DIMDEC(betaz) integer DIMDEC(r) REAL_T alpha(DIMV(alpha),1) REAL_T vol(DIMV(vol)) REAL_T denfab(DIMV(den)) REAL_T betax(DIMV(betax)) REAL_T betay(DIMV(betay)) REAL_T betaz(DIMV(betaz)) REAL_T r(DIM1(r)) REAL_T b, betacen integer isrz integer i, j, k do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) alpha(i,j,k,1) = vol(i,j,k) * denfab(i,j,k) end do end do end do end subroutine FORT_DIV_MU_SI(lo, hi, dx, mu, DIMS(divu), divu, & DIMS(divmusi), divmusi) implicit none c c ... inputs c integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM) integer DIMDEC(divu) REAL_T divu(DIMV(divu)) REAL_T mu c c ... outputs c integer DIMDEC(divmusi) REAL_T divmusi(DIMV(divmusi),SDIM) c c ... local c integer i,j,k REAL_T sleft, sright, stop, sbot, sfront, sback c c ... Note: the following IS correct for r-z. Terms from the hoop stress c cancel with terms from tau_rr to eliminate all r dependence. c do k=lo(3),hi(3) do j=lo(2),hi(2) do i=lo(1),hi(1) sleft = half*(divu(i-1,j,k)+divu(i,j,k)) sright = half*(divu(i+1,j,k)+divu(i,j,k)) divmusi(i,j,k,1) = mu*(sright-sleft)/dx(1) stop = half*(divu(i,j,k)+divu(i,j+1,k)) sbot = half*(divu(i,j-1,k)+divu(i,j,k)) divmusi(i,j,k,2) = mu*(stop-sbot)/dx(2) sfront = half*(divu(i,j,k)+divu(i,j,k+1)) sback = half*(divu(i,j,k-1)+divu(i,j,k)) divmusi(i,j,k,3) = mu*(sfront-sback)/dx(2) end do end do end do end subroutine FORT_DIV_VARMU_SI(lo, hi, dx, DIMS(divu), divu, & DIMS(betax), betax, DIMS(betay), betay, DIMS(betaz), & betaz, DIMS(divmusi), divmusi) implicit none c c ... inputs c integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM) integer DIMDEC(divu) REAL_T divu(DIMV(divu)) integer DIMDEC(betax) REAL_T betax(DIMV(betax)) integer DIMDEC(betay) REAL_T betay(DIMV(betay)) integer DIMDEC(betaz) REAL_T betaz(DIMV(betaz)) c c ... outputs c integer DIMDEC(divmusi) REAL_T divmusi(DIMV(divmusi),SDIM) c c ... local c integer i,j,k REAL_T sleft, sright, stop, sbot, sfront, sback do k=lo(3),hi(3) do j=lo(2),hi(2) do i=lo(1),hi(1) sleft = half*(divu(i-1,j,k)+divu(i,j,k)) sright = half*(divu(i+1,j,k)+divu(i,j,k)) divmusi(i,j,k,1) = (betax(i+1,j,k)*sright- & betax(i,j,k)*sleft)/dx(1) stop = half*(divu(i,j,k)+divu(i,j+1,k)) sbot = half*(divu(i,j-1,k)+divu(i,j,k)) divmusi(i,j,k,2) = (betay(i,j+1,k)*stop- & betay(i,j,k)*sbot)/dx(2) sfront = half*(divu(i,j,k)+divu(i,j,k+1)) sback = half*(divu(i,j,k-1)+divu(i,j,k)) divmusi(i,j,k,3) = (betaz(i,j,k+1)*sfront- & betaz(i,j,k)*sback)/dx(3) end do end do end do end subroutine FORT_CCTOEDGE(lo, hi, DIMS(beta), beta, & DIMS(betax), betax, DIMS(betay), betay, DIMS(betaz), betaz) implicit none c c ... inputs c integer lo(SDIM), hi(SDIM) integer DIMDEC(beta) REAL_T beta(DIMV(beta)) integer DIMDEC(betax) integer DIMDEC(betay) integer DIMDEC(betaz) c c ... outputs c REAL_T betax(DIMV(betax)) REAL_T betay(DIMV(betay)) REAL_T betaz(DIMV(betaz)) c c ... local c integer i,j,k do k=lo(3),hi(3) do j=lo(2),hi(2) do i=lo(1),hi(1)+1 betax(i,j,k) = .5D0*(beta(i-1,j,k)+beta(i,j,k)) end do end do end do do k=lo(3),hi(3) do j=lo(2),hi(2)+1 do i=lo(1),hi(1) betay(i,j,k) = .5D0*(beta(i,j-1,k)+beta(i,j,k)) end do end do end do do k=lo(3),hi(3)+1 do j=lo(2),hi(2) do i=lo(1),hi(1) betaz(i,j,k) = .5D0*(beta(i,j,k-1)+beta(i,j,k)) end do end do end do end ccseapps-2.5/CCSEApps/iamrlib/OutFlowBC.cpp0000644000175000017500000001415711634153073021616 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: OutFlowBC.cpp,v 1.6 2003/02/19 19:13:09 almgren Exp $ // #include #include #include "OutFlowBC.H" #include "ParmParse.H" OutFlowBC::OutFlowBC () {} OutFlowBC::~OutFlowBC () {} Box OutFlowBC::SemiGrow (const Box& baseBox, int nGrow, int direction) { IntVect grow_factor(D_DECL(nGrow,nGrow,nGrow)); grow_factor[direction] = 0; return BoxLib::grow(baseBox,grow_factor); } Box OutFlowBC::SemiCoarsen (const Box& baseBox, int ref_factor, int direction) { IntVect ref_ratio(D_DECL(ref_factor,ref_factor,ref_factor)); ref_ratio[direction] = 1; return BoxLib::coarsen(baseBox,ref_ratio); } OutFlowBC_MG::OutFlowBC_MG (const Box& Domain, FArrayBox* Phi, FArrayBox* Rhs, FArrayBox* Resid, FArrayBox* Beta, Real* H, int* IsPeriodic, bool is_scalar) : domain(Domain), phi(Phi), rhs(Rhs), resid(Resid), cgwork(0), beta(Beta), next(0), beta_is_scalar(is_scalar) { for (int dir = 0; dir < BL_SPACEDIM; dir++) { h[dir] = H[dir]; isPeriodic[dir] = IsPeriodic[dir]; } } OutFlowBC_MG::~OutFlowBC_MG () { if (next != 0) { delete next->phi; delete next->rhs; delete next->resid; if (beta_is_scalar) delete next->beta; else delete [] next->beta; delete next; } delete cgwork; } void OutFlowBC_MG::solve (Real tolerance, Real abs_tolerance, int i1, int i2, int maxIters, int verbose) { int iter = 1; Real rlast = residual(); Real res = rlast; Real goal = std::max(rlast*tolerance,abs_tolerance); if (verbose) { std::cout << "OutFlowBC:Initial Residual: " << rlast << std::endl; } if (rlast > goal) { while (((res = vcycle(i1,i2)) > goal) && (iter < maxIters)) { iter++; if (verbose) std::cout << "OutFlowBC: Residual: " << res << " at iteration " << iter << std::endl; } } if (iter >= maxIters) { std::cout << "OutFlowBC: solver reached maxIter\n" << "goal was: " << goal << " && res = " << res << std::endl; } if (verbose) { std::cout << "OutFlowBC: Final Residual: " << res << " after " << iter << " cycles\n\n"; } } Real OutFlowBC_MG::vcycle (int downiter, int upiter) { Real rnorm = residual(); step(downiter); rnorm = residual(); if (next != 0) { Restrict(); next->phi->setVal(0); next->vcycle(downiter,upiter); interpolate(); step(upiter); } return rnorm; } void OutFlowBC::GetOutFlowFaces (bool& haveOutFlow, Orientation* outFaces, BCRec* _phys_bc, int& numOutFlowBC) { haveOutFlow = false; numOutFlowBC = 0; for (int idir = 0; idir < BL_SPACEDIM; idir++) { if (_phys_bc->lo(idir) == Outflow) { haveOutFlow = true; outFaces[numOutFlowBC] = Orientation(idir,Orientation::low); numOutFlowBC++; } if (_phys_bc->hi(idir) == Outflow) { haveOutFlow = true; outFaces[numOutFlowBC] = Orientation(idir,Orientation::high); numOutFlowBC++; } } #if 0 // We used to constrain our outflow bc to only one wall. We are now // in the process of fixing that (10/2/02) if (numOutFlowBC > 1) // // True signals low-D solve for outflow. // False will enforce Div(U) == 0. // haveOutFlow = false; #endif } bool OutFlowBC::HasOutFlowBC (BCRec* _phys_bc) { bool has_out_flow = false; int numOutFlowBC = 0; for (int idir = 0; idir < BL_SPACEDIM; idir++) { if (_phys_bc->lo(idir) == Outflow) { has_out_flow = true; numOutFlowBC++; } if (_phys_bc->hi(idir) == Outflow) { has_out_flow = true; numOutFlowBC++; } } #if 0 // We used to constrain our outflow bc to only one wall. We are now // in the process of fixing that (10/2/02) if (numOutFlowBC > 1) // // True signals low-D solve for outflow. // False will enforce Div(U) == 0. // has_out_flow = false; #endif return has_out_flow; } ccseapps-2.5/CCSEApps/iamrlib/PROJOUTFLOWBC_2D.F0000644000175000017500000013756311634153073022010 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "PROJOUTFLOWBC_F.H" #include "ArrayLim.H" #define SDIM 2 #if defined(BL_USE_FLOAT) || defined(BL_T3E) || defined(BL_CRAY) #define SMALL 1.0e-10 #else #define SMALL 1.0d-10 #endif c ************************************************************************* c ** EXTRAP_PROJ ** c ************************************************************************* subroutine FORT_EXTRAP_PROJ(DIMS(u),u,DIMS(divu),divu,DIMS(rho),rho, & r_len,redge,DIMS(uExt),uExt,DIMS(divuExt),divuExt, & DIMS(rhoExt),rhoExt,lo,hi,face,zeroIt,hx) implicit none c subtract divu_ave twice due to precision problems integer DIMDEC(u) integer DIMDEC(divu) integer DIMDEC(rho) integer DIMDEC(uExt) integer DIMDEC(divuExt) integer DIMDEC(rhoExt) integer r_len integer lo(SDIM),hi(SDIM) integer face REAL_T u(DIMV(u),SDIM) REAL_T divu(DIMV(divu)) REAL_T rho(DIMV(rho)) REAL_T uExt(DIMV(uExt),SDIM-1) REAL_T divuExt(DIMV(divuExt)) REAL_T r hoExt(DIMV(rhoExt)) REAL_T redge(0:r_len-1) REAL_T hx integer zeroIt c local variables integer ics,ice,jcs,jce integer ife,jfe integer if,jf REAL_T divu_ave1,divu_ave2 REAL_T max_divu, min_divu REAL_T max_pert, small_pert parameter ( small_pert = SMALL) integer i,j #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 ics = ARG_L1(u) ice = ARG_H1(u) jcs = ARG_L2(u) jce = ARG_H2(u) ife = hi(1) jfe = hi(2) zeroIt = 0 if (face .eq. XLO) then if=ife max_divu = half*(three*divu(ice-1,jcs) - divu(ice,jcs)) min_divu = max_divu do j = jcs, jce uExt(j,if,1) = half*(three*u(ice-1,j,2) - u(ice,j,2)) end do do j = jcs+1, jce-1 divuExt(j,if) = half*(three*divu(ice-1,j) - divu(ice,j)) rhoExt(j,if) = half*(three*rho(ice-1,j) - rho(ice,j)) max_divu = max(max_divu,divuExt(j,if)) min_divu = min(min_divu,divuExt(j,if)) end do call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(jcs,if)) do j = jcs+1, jce-1 max_pert = MAX(max_pert,ABS(divuExt(j,if))) end do else if (face .eq. YLO) then jf = jfe max_divu = half*(three*divu(ics,jce-1) - divu(ics,jce)) min_divu = max_divu do i = ics, ice uExt(i,jf,1) = half*(three*u(i,jce-1,1) - u(i,jce,1)) end do do i = ics+1, ice-1 divuExt(i,jf) = half*(three*divu(i,jce-1) - divu(i,jce)) rhoExt(i,jf) = half*(three*rho(i,jce-1) - rho(i,jce)) max_divu = max(max_divu,divuExt(i,jf)) min_divu = min(min_divu,divuExt(i,jf)) end do call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,jf)) do i = ics+1, ice-1 max_pert = MAX(max_pert,ABS(divuExt(i,jf))) end do else if (face .eq. XHI) then if = ife max_divu = half*(three*divu(ics+1,jcs) - divu(ics,jcs)) min_divu = max_divu do j = jcs, jce uExt(j,if,1) = half*(three*u(ics+1,j,2) - u(ics,j,2)) end do do j = jcs+1, jce-1 divuExt(j,if) = half*(three*divu(ics+1,j) - divu(ics,j)) c $ -(u(ics+1,j,1) - u(ics,j,1)) / hx rhoExt(j,if) = half*(three*rho(ics+1,j) - rho(ics,j)) max_divu = max(max_divu,divuExt(j,if)) min_divu = min(min_divu,divuExt(j,if)) end do call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(jcs,if)) do j = jcs+1, jce-1 max_pert = MAX(max_pert,ABS(divuExt(j,if))) end do else if (face .eq. YHI) then jf = jfe max_divu = half*(three*divu(ics,jcs+1) - divu(ics,jcs)) min_divu = max_divu do i = ics, ice uExt(i,jf,1) = half*(three*u(i,jcs+1,1) - u(i,jcs,1)) end do do i = ics+1, ice-1 divuExt(i,jf) = half*(three*divu(i,jcs+1) - divu(i,jcs)) rhoExt(i,jf) = half*(three*rho(i,jcs+1) - rho(i,jcs)) max_divu = max(max_divu,divuExt(i,jf)) min_divu = min(min_divu,divuExt(i,jf)) end do call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,redge,r_len,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,jf)) do i = ics+1, ice-1 max_pert = MAX(max_pert,ABS(divuExt(i,jf))) end do endif c check to see if we should zero phi max_pert = max_pert/(ABS(divu_ave1+divu_ave2)+small_pert) if ((max_divu.eq.zero.and.min_divu.eq.zero) & .or.(max_pert.le.small_pert)) then zeroIt = 1 end if #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** HGRELAX ** c ************************************************************************* #define DGX (beta(i-1)*phi(i-1) - (beta(i)+beta(i-1))*phi(i) \ +beta(i)*phi(i+1))*(hxsqinv) subroutine FORT_HGRELAX(DIMS(rhs),rhs,DIMS(beta),beta,DIMS(phi),phi, & DIMS(dgphi),dgphi,lo,hi,h,isPeriodic,niter) implicit none integer DIMDEC(beta) integer DIMDEC(rhs) integer DIMDEC(phi) integer DIMDEC(dgphi) REAL_T beta(DIM1(beta)) REAL_T rhs(DIM1(rhs)) REAL_T phi(DIM1(phi)) REAL_T dgphi(DIM1(dgphi)) integer isPeriodic(SDIM) REAL_T h(SDIM) integer lo(SDIM),hi(SDIM) integer niter integer ins, ine integer i,iter REAL_T lam logical setSingularPoint REAL_T hxsqinv integer redblack hxsqinv = 1.0D0/(h(1)*h(1)) ins = lo(1) ine = hi(1)+1 setSingularPoint = .false. do iter = 1,niter call setprojbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) do redblack = 0, 1 do i=ins+redblack,ine,2 dgphi(i) = DGX lam = hxsqinv*(beta(i)+beta(i-1)) c double dgphi at edges if ((i .eq. lo(1) .or. i .eq. hi(1)+1) & .and. isPeriodic(1) .ne. 1) then dgphi(i) = dgphi(i) * two lam = lam* two endif lam = -one/lam phi(i) = phi(i) + lam*(rhs(i)-dgphi(i)) enddo end do end do call setprojbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) end c ************************************************************************* c ** HGSUBTRACTAVGPHI ** c ************************************************************************* subroutine FORT_HGSUBTRACTAVGPHI(DIMS(phi),phi,r_lo,r_hi,r,lo,hi, & isPeriodic) implicit none integer DIMDEC(phi) REAL_T phi(DIM1(phi)) integer r_lo,r_hi REAL_T r(r_lo:r_hi) integer lo(SDIM),hi(SDIM) integer isPeriodic(SDIM) REAL_T phitot,vtot REAL_T hdr,rnode integer ics,ins,ine integer i logical setSingularPoint ics = lo(1) ins = lo(1) ine = hi(1)+1 hdr = half *(r(ics+1)-r(ics)) setSingularPoint = .false. phitot = zero vtot = zero do i = ins,ine-ins-2 rnode = r(i+ins-ics) - hdr phitot = phitot + phi(i) * rnode vtot = vtot + rnode enddo do i = ine-ins-1,ine rnode = r(i+ins-ics-1) + hdr phitot = phitot + phi(i) * rnode vtot = vtot + rnode enddo phitot = phitot/vtot do i = ins,ine phi(i) = phi(i) - phitot enddo call setprojbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) end c ************************************************************************* c ** HGRESID ** c ************************************************************************* subroutine FORT_HGRESID(DIMS(rhs),rhs,DIMS(beta),beta,DIMS(phi),phi, & DIMS(resid),resid,DIMS(dgphi),dgphi, & lo,hi,h,isPeriodic,maxnorm) integer DIMDEC(beta) integer DIMDEC(rhs) integer DIMDEC(phi) integer DIMDEC(resid) integer DIMDEC(dgphi) REAL_T beta(DIM1(beta)) REAL_T rhs(DIM1(rhs)) REAL_T phi(DIM1(phi)) REAL_T resid(DIM1(resid)) REAL_T dgphi(DIM1(dgphi)) integer isPeriodic(SDIM) REAL_T h(SDIM) integer lo(SDIM),hi(SDIM) REAL_T hxsqinv,hysqinv integer i,j REAL_T maxnorm logical setSingularPoint hxsqinv = one/(h(1)*h(1)) setSingularPoint = .false. maxnorm = zero call makeprojdgphi(phi,DIMS(phi),dgphi,DIMS(dgphi),beta,DIMS(beta), & lo,hi,h,isPeriodic,setSingularPoint) do i=lo(1),hi(1)+1 resid(i) = rhs(i)-dgphi(i) maxnorm = max(maxnorm,ABS(resid(i))) enddo end c ************************************************************************* c ** SETPROJBC ** c ************************************************************************* subroutine setprojbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) implicit none integer DIMDEC(phi) REAL_T phi(DIM1(phi)) integer lo(SDIM),hi(SDIM) integer isPeriodic(SDIM) logical setSingularPoint integer ins,ine ins = lo(1) ine = hi(1)+1 if (isPeriodic(1) .NE. 1 .AND. setSingularPoint) then phi(ine) = zero endif if (isPeriodic(1).eq.1) then phi(ins-1) = phi(ine-1) phi(ine) = phi(ins) phi(ine+1) = phi(ins+1) else phi(ins-1) = phi(ins+1) phi(ine+1) = phi(ine-1) endif end c ************************************************************************* c ** HG_SHIFT_PHI ** c ************************************************************************* subroutine FORT_HG_SHIFT_PHI(DIMS(out),out,DIMS(in),in,face) implicit none integer face integer DIMDEC(in) integer DIMDEC(out) REAL_T in(DIMV(in)) REAL_T out(DIMV(out)) integer i,j #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 if (face .eq. XLO .or. face .eq. XHI) then do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j) = in(j,i) enddo enddo else if (face .eq. YLO .or. face .eq. YHI) then do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j) = in(i,j) enddo enddo endif #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** HG_RESHIFT_PHI ** c ************************************************************************* subroutine FORT_HG_RESHIFT_PHI(DIMS(out),out,DIMS(in),in,face) implicit none integer face integer DIMDEC(in) integer DIMDEC(out) REAL_T in(DIMV(in)) REAL_T out(DIMV(out)) integer i,j #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 if (face .eq. XLO .or. face .eq. XHI) then do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j) = in(j,i) enddo enddo else if (face .eq. YLO .or. face .eq. YHI) then do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j) = in(i,j) enddo enddo endif #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** HG_SOLVEHG ** c ************************************************************************* subroutine FORT_SOLVEHG(p,DIMS(p),dest0,DIMS(dest0), & source,DIMS(source),sigma,DIMS(sigma), & cen,DIMS(cen),r,DIMS(r),w,DIMS(w), & z,DIMS(z),x,DIMS(x), $ lo,hi,h,isPeriodic,maxiter,tol,abs_tol,max_jump,norm) implicit none integer lo(SDIM),hi(SDIM) integer DIMDEC(p) integer DIMDEC(dest0) integer DIMDEC(source) integer DIMDEC(sigma) integer DIMDEC(r) integer DIMDEC(w) integer DIMDEC(z) integer DIMDEC(x) integer DIMDEC(cen) REAL_T p(DIM1(p)) REAL_T dest0(DIM1(dest0)) REAL_T source(DIM1(source)) REAL_T sigma(DIM1(sigma)) REAL_T r(DIM1(r)) REAL_T w(DIM1(w)) REAL_T z(DIM1(z)) REAL_T x(DIM1(x)) REAL_T cen(DIM1(cen)) REAL_T h(SDIM) integer isPeriodic(SDIM) integer maxiter REAL_T norm REAL_T tol REAL_T abs_tol,max_jump c Local variables REAL_T factor REAL_T alpha,beta, rho, rho_old logical testx integer i,iter integer istart,iend REAL_T norm0,goal logical setSingularPoint istart = lo(1) iend = hi(1)+1 setSingularPoint = .false. do i = lo(1)-1,hi(1)+2 dest0(i) = p(i) p(i) = zero enddo do i=ARG_L1(w),ARG_H1(w) w(i) = zero enddo call setprojbc(DIMS(dest0),dest0,lo,hi,isPeriodic,setSingularPoint) call makeprojdgphi(dest0,DIMS(dest0),w,DIMS(w),sigma,DIMS(sigma), & lo,hi,h,isPeriodic,setSingularPoint) do i = istart, iend r(i) = source(i) - w(i) enddo c note that all of this factor stuff is due to the problem being doubled c at edges -- both the rhs and the operator. rho = zero norm0 = zero do i = istart, iend factor = one testx = (i .eq. lo(1) .or. i .eq. hi(1)+1) factor = cvmgt(factor*half,factor,testx) z(i) = r(i) rho = rho + factor * z(i) * r(i) norm0 = max(norm0,abs(r(i))) enddo norm = norm0 goal = max(tol * norm0,abs_tol) if (norm0 .le. goal) then do i = istart, iend p(i) = dest0(i) enddo return endif do i = istart, iend x(i) = zero p(i) = z(i) enddo iter = 0 100 continue do i=ARG_L1(w),ARG_H1(w) w(i) = zero enddo call setprojbc(DIMS(p),p,lo,hi,isPeriodic,setSingularPoint) call makeprojdgphi(p,DIMS(p),w,DIMS(w),sigma,DIMS(sigma), & lo,hi,h,isPeriodic,setSingularPoint) alpha = zero do i = istart, iend factor = one testx = (i .eq. lo(1) .or. i .eq. hi(1)+1) factor = cvmgt(factor*half,factor,testx) alpha = alpha + factor*p(i)*w(i) enddo if (alpha .ne. zero) then alpha = rho / alpha else print *, "divide by zero" goto 101 endif rho_old = rho rho = zero norm = zero do i = istart, iend factor = one testx = (i .eq. lo(1) .or. i .eq. hi(1)+1) factor = cvmgt(factor*half,factor,testx) x(i) = x(i) + alpha * p(i) r(i) = r(i) - alpha * w(i) z(i) = r(i) rho = rho + factor * z(i) * r(i) norm = max(norm,abs(r(i))) enddo iter = iter+1 c write(6,*) iter,norm if (iter .gt. maxiter .or. norm .gt. max_jump*norm0) then goto 101 else if (norm .lt. goal) then do i = istart, iend p(i) = x(i) + dest0(i) enddo return else beta = rho / rho_old do i = istart, iend p(i) = z(i) + beta * p(i) enddo goto 100 endif 101 print *, "cg solve in proj failed to coverge" do i = istart, iend p(i) = dest0(i) enddo return end c ************************************************************************* c ** makeprojdgphi ** c ************************************************************************* subroutine makeprojdgphi(phi,DIMS(phi),dgphi,DIMS(dgphi), & beta,DIMS(beta), & lo,hi,h,isPeriodic,setSingularPoint) implicit none integer lo(SDIM),hi(SDIM) integer DIMDEC(phi) integer DIMDEC(dgphi) integer DIMDEC(beta) REAL_T phi(DIM1(phi)) REAL_T dgphi(DIM1(dgphi)) REAL_T beta(DIM1(beta)) integer isPeriodic(SDIM) REAL_T h(SDIM) logical setSingularPoint c Local variables REAL_T hxsqinv integer is,ie integer i is = lo(1) ie = hi(1) hxsqinv = one/(h(1)*h(1)) if (isPeriodic(1).eq.1 ) then phi(ie+2) = phi(is+1) phi(is-1) = phi(ie ) endif do i = is,ie+1 dgphi(i) = DGX enddo c double dgphi at edges if (isPeriodic(1) .ne. 1) then dgphi(is) = dgphi(is) * two dgphi(ie+1) = dgphi(ie+1) * two endif if (setSingularPoint .and. isPeriodic(1) .NE. 1) then dgphi(hi(1)+1) = zero endif return end c ************************************************************************* c ** COARSIG ** c ** Coarsening of the sig coefficients c ************************************************************************* subroutine FORT_COARSIG(sigma,DIMS(sigma),sigmac,DIMS(sigmac), & lo,hi,loc,hic,isPeriodic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(sigma) integer DIMDEC(sigmac) REAL_T sigma(DIM1(sigma)) REAL_T sigmac(DIM1(sigmac)) integer isPeriodic(SDIM) c Local variables integer i,i2 do i = loc(1),hic(1) i2 = 2*(i-loc(1))+lo(1) sigmac(i) = half*(sigma(i2) +sigma(i2+1)) enddo if (isPeriodic(1).eq.1) then sigmac(loc(1)-1) = sigmac(hic(1)) sigmac(hic(1)+1) = sigmac(loc(1)) else sigmac(loc(1)-1) = zero sigmac(hic(1)+1) = zero endif return end c ************************************************************************* c ** RESTRICT ** c ** Conservative restriction of the residual c ************************************************************************* subroutine FORT_RESTRICT(res,DIMS(res),resc,DIMS(resc), & lo,hi,loc,hic,isPeriodic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(res) integer DIMDEC(resc) REAL_T res(DIM1(res)) REAL_T resc(DIM1(resc)) integer isPeriodic(SDIM) c Local variables integer i,ii integer istart,iend istart = loc(1) iend = hic(1)+1 if (isPeriodic(1).eq.1) then res(hi(1)+1) = res(lo(1) ) res(hi(1)+2) = res(lo(1)+1) res(lo(1)-1) = res(hi(1) ) endif do i = istart,iend ii = 2*(i-loc(1))+lo(1) resc(i) = half*res(ii) + fourth*(res(ii+1)+res(ii-1)) enddo c the top version is what we use when we double the problem at edges c the bottom version (commented out) is what we would use if we did not c double the problem at edges. if (isPeriodic(1) .NE. 1) then i = loc(1) ii = 2*(i-loc(1))+lo(1) resc(i) = half*(res(ii) + res(ii+1)) c resc(i) = half*res(ii) + fourth*res(ii+1) i = hic(1)+1 ii = 2*(i-loc(1))+lo(1) resc(i) = half*(res(ii) + res(ii-1)) c resc(i) = half*res(ii) + fourth*res(ii-1) endif return end c ************************************************************************* c ** INTERP ** c ** Simple bilinear interpolation c ************************************************************************* subroutine FORT_INTERP(phi,DIMS(phi),temp,DIMS(temp),deltac,DIMS(deltac), & sigma,DIMS(sigma),lo,hi,loc,hic,isPeriodic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(phi) integer DIMDEC(deltac) integer DIMDEC(sigma) integer DIMDEC(temp) REAL_T phi(DIM1(phi)) REAL_T deltac(DIM1(deltac)) REAL_T sigma(DIM1(sigma)) REAL_T temp(DIM1(temp)) integer isPeriodic(SDIM) c Local variables integer ii,ic integer is,ie,isc,iec logical setSingularPoint is = lo(1) ie = hi(1) isc = loc(1) iec = hic(1) do ic = isc, iec+1 ii = 2*(ic-isc)+is temp(ii) = deltac(ic) enddo do ic = isc, iec ii = 2*(ic-isc)+is temp(ii+1) = half*(deltac(ic) + deltac(ic+1)) enddo do ii = is,ie+1 phi(ii) = phi(ii) + temp(ii) enddo return end c ************************************************************************* c ** HGPHIBC ** c ** Solution by back substitution c ************************************************************************* subroutine FORT_HGPHIBC(hx,sigExt,s,x,length,per) c c Compute the value of phi for hgproj to be used at an outflow face, c assuming that the tangential velocity on the edges of the outflow boundary c are either zero or periodic. c implicit none integer length integer per REAL_T s( length+1) REAL_T x( length+1) REAL_T r( 0:length-1) REAL_T sigExt(0:length-1) REAL_T hx c Local variables integer NstripMAX parameter (NstripMAX = 2000) integer ics, ice integer i, j, icL, icR, neq REAL_T a(NstripMAX), b(NstripMAX), c(NstripMAX) REAL_T alpha, beta, sVal logical rNormed REAL_T vtot, rnode, hdr REAL_T phitot #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 ics = 0 ice = length-1 c This description assumes outflow at yhi; however, code works for c outflow at any face. c Solve d/dx( 1/rho d/dx( phi ) ) = dU/dx - (S - S_ave) [S = divu if U is c zero, S = d/dt(divu) if U = (ustar - uold)/dt] with periodic or Neumann c boundary conditions, using a tridiagonal solve which detects, and deals c with the singular equations. In the Neumann case, arbitrarily set the c upper right corner to zero to pin the solution. Note that the RHS of c this equation satisfies the solvability constraint that c Int[RHS.dV] = 0 by construction. c This implies that the normal component takes up the slack: c c d/dy( 1/rho d/dy( phi ) ) = dV/dy - S_ave c c This information should be used to construct the normal gradient of the c normal velocity, for the advective/diffusive step, for example. do i = 2,length icR = ics + i - 1 icL = ics + i - 2 a(i) = sigExt(icL) c(i) = sigExt(icR) b(i) = - a(i) - c(i) end do if (per .eq. 1) then hdr = 0.0d0 c Do left-side periodic BC (since first/last node coincide, use first c node only (retain r-stuff here, just to be sure scaling is not destroyed) neq = length if ( neq .gt. NStripMax ) then call bl_abort('HGPHIBC: NstripMax too small') end if icL = ice icR = ics beta = sigExt(icL) c(1) = sigExt(icR) b(1) = - beta - c(1) c Do right-side periodic on penultimate node icL = ice - 1 icR = ice a(neq) = sigExt(icL) alpha = sigExt(icR) b(neq) = - a(neq) - alpha call cyclic(a,b,c,alpha,beta,s,x,neq) else c Solid walls, Neumann conditions hdr = half*(r(ics+1) - r(ics)) neq = length + 1 if ( neq .gt. NStripMax ) then call bl_abort('HGPHIBC: NstripMax too small') end if icR = ics c(1) = sigExt(icR) b(1) = - c(1) icL = ice a(neq) = sigExt(icL) b(neq) = - a(neq) c Solve the equations (we know they're singular, pass the arbitrary value, c and a flag that we've already normalized the rhs, in the sense that c Int[dU/dx - (S-S_ave)] == 0 sVal = zero rNormed = .true. call tridag_sing(a,b,c,s,x,neq,sVal,rNormed) end if #if 1 c Try normalizing phi to average to zero phitot = zero vtot = zero C do i = 1, length-1 do i = 2, length-1 c rnode = r(ics+i-1) - hdr c phitot = phitot + x(i)*rnode c vtot = vtot + rnode phitot = phitot + x(i) vtot = vtot + one end do do i = length,neq c rnode = r(ics+i-2) + hdr c phitot = phitot + x(i)*rnode c vtot = vtot + rnode phitot = phitot + x(i) vtot = vtot + one end do phitot = phitot / vtot do i = 1,neq x(i) = x(i) - phitot end do #endif #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** OLDHGPHIBC ** c ** Solution by back substitution c ************************************************************************* subroutine FORT_OLDHGPHIBC(hx,r,uExt, divuExt,rhoExt,x,flag,length,per) c c Compute the value of phi for hgproj to be used at an outflow face, c assuming that the tangential velocity on the edges of the outflow boundary c are either zero or periodic. c implicit none integer length integer per REAL_T x( length+1) REAL_T r( 0:length-1) REAL_T uExt(0:length-1) REAL_T divuExt(0:length-1) REAL_T rhoExt(0:length-1) REAL_T flag(0:length-1) REAL_T hx c Local variables integer NstripMAX parameter (NstripMAX = 2000) integer ics, ice integer i, j, icL, icR, neq REAL_T a(NstripMAX), b(NstripMAX), c(NstripMAX), s(NstripMAX) REAL_T alpha, beta, sVal logical rNormed REAL_T vtot, rnode, hdr REAL_T phitot #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 ics = 0 ice = length-1 c This description assumes outflow at yhi; however, code works for c outflow at any face. c Solve d/dx( 1/rho d/dx( phi ) ) = dU/dx - (S - S_ave) [S = divu if U is c zero, S = d/dt(divu) if U = (ustar - uold)/dt] with periodic or Neumann c boundary conditions, using a tridiagonal solve which detects, and deals c with the singular equations. In the Neumann case, arbitrarily set the c upper right corner to zero to pin the solution. Note that the RHS of c this equation satisfies the solvability constraint that c Int[RHS.dV] = 0 by construction. c This implies that the normal component takes up the slack: c c d/dy( 1/rho d/dy( phi ) ) = dV/dy - S_ave c c This information should be used to construct the normal gradient of the c normal velocity, for the advective/diffusive step, for example. do i = 2,length icR = ics + i - 1 icL = ics + i - 2 a(i) = r(icL) / rhoExt(icL) c(i) = r(icR) / rhoExt(icR) b(i) = - a(i) - c(i) rnode = half*(r(icL)+r(icR)) s(i) = (r(icR)*flag(icR)*uExt(icR)-r(icL)*flag(icL)*uExt(icL))*hx & - rnode*half*(divuExt(icL)+divuExt(icR))*hx*hx end do if (per .eq. 1) then hdr = 0.0D0 ! FIXME: This wasn't set before, used below c Do left-side periodic BC (since first/last node coincide, use first c node only (retain r-stuff here, just to be sure scaling is not destroyed) neq = length if ( neq .gt. NStripMax ) then call bl_abort('HGPHIBC: NstripMax too small') end if icL = ice icR = ics beta = r(icL) / rhoExt(icL) c(1) = r(icR) / rhoExt(icR) b(1) = - beta - c(1) rnode = half*(r(icL)+r(icR)) s(1) = (flag(icR)*r(icR)*uExt(icR)-flag(icL)*r(icL)*uExt(icL))*hx & - rnode*half*(divuExt(icL)+divuExt(icR))*hx*hx c Do right-side periodic on penultimate node icL = ice - 1 icR = ice a(neq) = r(icL) / rhoExt(icL) alpha = r(icR) / rhoExt(icR) b(neq) = - a(neq) - alpha s(neq) = (flag(icR)*r(icR)*uExt(icR)-flag(icL)*r(icL)*uExt(icL))*hx & - rnode*half*(divuExt(icL)+divuExt(icR))*hx*hx c Solve the equations call cyclic(a,b,c,alpha,beta,s,x,neq) else c Solid walls, Neumann conditions hdr = half*(r(ics+1) - r(ics)) neq = length + 1 if ( neq .gt. NStripMax ) then call bl_abort('HGPHIBC: NstripMax too small') end if icR = ics c(1) = r(icR) / rhoExt(icR-ics) b(1) = - c(1) rnode = r(ics) - hdr s(1) = flag(icR)*r(icR)*uExt(icR)*hx & - rnode*half*divuExt(icR)*hx*hx icL = ice a(neq) = r(icL) / rhoExt(icL) b(neq) = - a(neq) rnode = r(ice) + hdr s(neq) = -flag(icL)*r(icL)*uExt(icL)*hx & - rnode*half*divuExt(icL)*hx*hx c Solve the equations (we know they're singular, pass the arbitrary value, c and a flag that we've already normalized the rhs, in the sense that c Int[dU/dx - (S-S_ave)] == 0 sVal = zero rNormed = .true. call tridag_sing(a,b,c,s,x,neq,sVal,rNormed) end if #if 1 c Try normalizing phi to average to zero phitot = zero vtot = zero C do i = 1, length-1 do i = 2, length-1 rnode = r(ics+i-1) - hdr phitot = phitot + x(i)*rnode vtot = vtot + rnode end do do i = length,neq rnode = r(ics+i-2) + hdr phitot = phitot + x(i)*rnode vtot = vtot + rnode end do phitot = phitot / vtot do i = 1,neq x(i) = x(i) - phitot end do #endif #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** RHOGBC ** c ************************************************************************* subroutine FORT_RHOGBC(rho,DIMS(rho),phi,DIMS(phi), & face,gravity,dx) c c Compute the contribution of gravity to the boundary conditions c for phi at outflow faces only. c implicit none integer DIMDEC(rho) integer DIMDEC(phi) integer face REAL_T rho(DIMV(rho)) REAL_T phi(DIMV(phi)) REAL_T dx(2) REAL_T gravity c Local variables integer i,j REAL_T rhog REAL_T rhoExt #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 if (face .eq. YLO .or. face .eq. YHI) $ call bl_abort('SHOULDNT BE IN RHOGBC WITH FACE IN Y-DIR') c Ok to only use low index of phi because phi is only one c node wide in i-direction. i = ARG_L1(phi) if (face .eq. XLO) then rhog = zero do j = ARG_H2(phi)-1,ARG_L2(phi),-1 rhoExt = half*(three*rho(i,j)-rho(i+1,j)) rhog = rhog + gravity * rhoExt * dx(2) phi(i,j) = phi(i,j) + rhog end do else if (face .eq. XHI) then rhog = zero do j = ARG_H2(phi)-1,ARG_L2(phi),-1 rhoExt = half*(three*rho(i-1,j)-rho(i-2,j)) rhog = rhog + gravity * rhoExt * dx(2) phi(i,j) = phi(i,j) + rhog end do endif #undef XLO #undef YLO #undef XHI #undef YHI end SUBROUTINE tridag_sing(a,b,c,r,u,n,sVal,rNormed) INTEGER n,NMAX REAL_T a(n),b(n),c(n),r(n),u(n), sVal REAL_T eps PARAMETER (NMAX=2000) PARAMETER (eps=1.D-12) INTEGER j REAL_T bet,gam(NMAX) logical rNormed, singular singular = .false. if(n.gt.NMAX)then call bl_abort('TRIDAG_SING: NMAX too small in tridag') end if if((b(1).eq.zero).or.(ABS(b(n)).le.eps))then call bl_abort('TRIDAG_SING: rewrite equations') end if bet=b(1) u(1)=r(1)/bet do 11 j=2,n gam(j)=c(j-1)/bet bet=b(j)-a(j)*gam(j) if(ABS(bet).le.eps) then if (rNormed .and. (j .eq. n)) then singular = .true. else call bl_abort('tridag failed') end if end if if (singular) then u(j) = sVal else u(j)=(r(j)-a(j)*u(j-1))/bet end if 11 continue do 12 j=n-1,1,-1 u(j)=u(j)-gam(j+1)*u(j+1) 12 continue return END SUBROUTINE tridag(a,b,c,r,u,n) INTEGER n,NMAX REAL_T a(n),b(n),c(n),r(n),u(n) PARAMETER (NMAX=2000) INTEGER j REAL_T bet,gam(NMAX) if(n.gt.NMAX)then call bl_abort('TRIDAG: NMAX too small in tridag') end if if(b(1) .eq. 0.0D0) then call bl_abort('TRIDAG: rewrite equations') end if bet=b(1) u(1)=r(1)/bet do 11 j=2,n gam(j)=c(j-1)/bet bet=b(j)-a(j)*gam(j) if(bet .eq. 0.0D0) call bl_abort('tridag failed') u(j)=(r(j)-a(j)*u(j-1))/bet 11 continue do 12 j=n-1,1,-1 u(j)=u(j)-gam(j+1)*u(j+1) 12 continue return END SUBROUTINE cyclic(a,b,c,alpha,beta,r,x,n) INTEGER n,NMAX REAL_T alpha,beta,a(n),b(n),c(n),r(n),x(n) PARAMETER (NMAX=2000) INTEGER i REAL_T fact,gamma,bb(NMAX),u(NMAX),z(NMAX),den if(n.le.2)then call bl_abort('CYCLIC: n too small in cyclic') end if if(n.gt.NMAX)then call bl_abort('CYCLIC: NMAX too small in cyclic') end if gamma=-b(1) bb(1)=b(1)-gamma bb(n)=b(n)-alpha*beta/gamma do 11 i=2,n-1 bb(i)=b(i) 11 continue call tridag(a,bb,c,r,x,n) u(1)=gamma u(n)=alpha do 12 i=2,n-1 u(i)=0.0D0 12 continue call tridag(a,bb,c,u,z,n) den=one+z(1)+beta*z(n)/gamma fact=cvmgt(zero,(x(1)+beta*x(n)/gamma)/den,den.eq.zero) do 13 i=1,n x(i)=x(i)-fact*z(i) 13 continue return END c ************************************************************************* c ** FILL_ONED ** c ************************************************************************* subroutine FORT_FILL_ONED(lenx,leny,length,faces,numOutFlowFaces, $ cc0,cc1,cc2,cc3,r0,r1,r2,r3,cc_conn,nodal_conn,per,hx,hy) integer lenx,leny,length integer faces(4) integer numOutFlowFaces integer per REAL_T cc0(0:leny+1,3) REAL_T cc1(0:lenx+1,3) REAL_T cc2(0:leny+1,3) REAL_T cc3(0:lenx+1,3) REAL_T r0(leny) REAL_T r1(lenx) REAL_T r2(leny) REAL_T r3(lenx) REAL_T cc_conn(length) REAL_T nodal_conn(length+1) REAL_T hx,hy integer xlo_outflow,ylo_outflow integer xhi_outflow,yhi_outflow integer i,ifinal,n REAL_T rnode,vol,sum #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 c Want to find the single non-outflow face. xlo_outflow = 0 ylo_outflow = 0 xhi_outflow = 0 yhi_outflow = 0 do i = 1, numOutFlowFaces if (faces(i) .eq. XLO) xlo_outflow = 1 if (faces(i) .eq. YLO) ylo_outflow = 1 if (faces(i) .eq. XHI) xhi_outflow = 1 if (faces(i) .eq. YHI) yhi_outflow = 1 enddo c Possible combinations of faces to come in here: c cc0 cc1 cc2 cc3 c XLO c YLO c XHI c YHI c XLO YLO c XLO YHI c YLO XHI c YLO YHI c XLO YLO XHI c XLO XHI YHI c XLO YLO YHI c YLO XHI YHI c XLO YLO XHI YHI c We must remember here that the cc* arrays have already been c ordered so that the 2nd spatial dimension is one cell wide. c cc*(i,1) = rho c cc*(i,2) = divu c cc*(i,3) = tangential vel. vol = hx*hy ifinal = 0 if (numOutFlowFaces .eq. 4 .or. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 0) ) then rnode = r0(1) do i = 1,leny cc_conn(i) = rnode/cc0(i,1) enddo do i = 2,leny nodal_conn(i) = rnode*( (cc0(i,3) - cc0(i-1,3))*hx & -half*(cc0(i,2)+cc0(i-1,2))*vol ) enddo i = 1 nodal_conn(i) = rnode*( (cc0(i,3) - cc0(i-1,3))*hx & -half*cc0(i,2)*vol ) if (per .eq. 1) then nodal_conn(i) = nodal_conn(i) - half*rnode*cc0(leny,2)*vol endif i = leny+1 nodal_conn(i) = rnode*( (cc0(i,3) - cc0(i-1,3))*hx & -half*cc0(i-1,2)*vol ) ifinal = leny endif if (yhi_outflow .eq. 1 .and. $ .not. (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do i = 1,lenx cc_conn(ifinal+i) = r3(i)/cc3(i,1) enddo do i = 2,lenx rnode = half*(r3(i)+r3(i-1)) nodal_conn(ifinal+i) = rnode*( (cc3(i,3) - cc3(i-1,3))*hy & -half*(cc3(i,2)+cc3(i-1,2))*vol ) enddo i = 1 rnode = 1.5d0*r3(1) - 0.5d0*r3(2) c Note: we get away with using r3(i) in place of r3(i-1), which isnt c defined, because if this is r-z, then the vel. at i-1 is zero, c and if not, then r is identically 1. nodal_conn(ifinal+i) = nodal_conn(ifinal+i) + & r3(i)*(cc3(i,3) - cc3(i-1,3))*hy & -half*rnode*cc3(i,2)*vol if (per .eq. 1) then nodal_conn(ifinal+i) = nodal_conn(ifinal+i) - half*rnode*cc3(lenx,2)*vol endif i = lenx+1 rnode = 1.5d0*r3(lenx) - 0.5d0*r3(lenx-1) c Note: same reasoning as above for using r3(i-1) nodal_conn(ifinal+i) = & r3(i-1)*(cc3(i,3) - cc3(i-1,3))*hy & -half*rnode*cc3(i-1,2)*vol ifinal = ifinal + lenx endif if (xhi_outflow .eq. 1) then rnode = r2(1) do i = 1,leny cc_conn(ifinal+i) = rnode/cc2(leny+1-i,1) enddo do i = 2,leny nodal_conn(ifinal+i) = rnode*( (cc2(leny+2-i,3)-cc2(leny+1-i,3))*hx & -half*(cc2(leny+2-i,2)+cc2(leny+1-i,2))*vol ) enddo i = 1 nodal_conn(ifinal+i) = nodal_conn(ifinal+i) + & rnode*( (cc2(leny+2-i,3) - cc2(leny+1-i,3))*hx & -half*cc2(leny+1-i,2)*vol ) if (per .eq. 1) then nodal_conn(ifinal+i) = nodal_conn(ifinal+i) - half*rnode*cc2(1,2)*vol endif i = leny+1 nodal_conn(ifinal+i) = & rnode*( (cc2(leny+2-i,3) - cc2(leny+1-i,3))*hx & -half*cc2(leny+2-i,2)*vol ) do i = 1,leny+1 nodal_conn(ifinal+i) = -nodal_conn(ifinal+i) enddo ifinal = ifinal + leny endif if (ylo_outflow .eq. 1) then do i = 1,lenx cc_conn(ifinal+i) = r1(lenx+1-i)/cc1(lenx+1-i,1) enddo do i = 2,lenx rnode = half*(r1(lenx+2-i)+r1(lenx+1-i)) nodal_conn(ifinal+i) = rnode*( (cc1(lenx+2-i,3)-cc1(lenx+1-i,3))*hy & -half*(cc1(lenx+2-i,2)+cc1(lenx+1-i,2))*vol ) enddo i = 1 rnode = 1.5d0*r1(lenx) - 0.5d0*r1(lenx-1) c Note: we get away with using r1(lenx) c because if this is r-z, then the outside vel. c and if not, then r is identically 1. nodal_conn(ifinal+i) = nodal_conn(ifinal+i) + & r1(lenx)*(cc1(lenx+2-i,3) - cc1(lenx+1-i,3))*hy & -half*rnode*cc1(lenx+1-i,2)*vol if (per .eq. 1) then nodal_conn(ifinal+i) = nodal_conn(ifinal+i) - half*rnode*cc1(1,2)*vol endif i = lenx+1 rnode = 1.5d0*r1(2) - 0.5d0*r1(1) c Note: same reasoning as above for using r1(1) nodal_conn(ifinal+i) = & r1(1)*(cc1(lenx+2-i,3) - cc1(lenx+1-i,3))*hy & -half*rnode*cc1(lenx+2-i,2)*vol do i = 1,lenx+1 nodal_conn(ifinal+i) = -nodal_conn(ifinal+i) enddo ifinal = ifinal + lenx endif if (numOutFlowFaces .lt. 4 .and. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 1) ) then rnode = r0(1) do i = 1,leny cc_conn(ifinal+i) = rnode/cc0(i,1) enddo do i = 2,leny nodal_conn(ifinal+i) = rnode*( (cc0(i,3) - cc0(i-1,3))*hx & -half*(cc0(i,2)+cc0(i-1,2))*vol ) enddo i = 1 nodal_conn(ifinal+i) = nodal_conn(ifinal+i) + & rnode*( (cc0(i,3) - cc0(i-1,3))*hx & -half*cc0(i,2)*vol ) i = leny+1 nodal_conn(ifinal+i) = rnode*( (cc0(i,3) - cc0(i-1,3))*hx & -half*cc0(i-1,2)*vol ) ifinal = ifinal + leny endif if (yhi_outflow .eq. 1 .and. $ (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do i = 1,lenx cc_conn(ifinal+i) = r3(i)/cc3(i,1) enddo do i = 2,lenx rnode = half*(r3(i)+r3(i-1)) nodal_conn(ifinal+i) = rnode*( (cc3(i,3) - cc3(i-1,3))*hy & -half*(cc3(i,2)+cc3(i-1,2))*vol ) enddo i = 1 rnode = 1.5d0*r3(1) - 0.5d0*r3(2) c Note: we get away with using r3(i) in place of r3(i-1), which isnt c defined, because if this is r-z, then the vel. at i-1 is zero, c and if not, then r is identically 1. nodal_conn(ifinal+i) = nodal_conn(ifinal+i) + & r3(i)*(cc3(i,3) - cc3(i-1,3))*hy & -half*rnode*cc3(i,2)*vol i = lenx+1 rnode = 1.5d0*r3(lenx) - 0.5d0*r3(lenx-1) c Note: same reasoning as above for using r3(i-1) nodal_conn(ifinal+i) = & r3(i-1)*(cc3(i,3) - cc3(i-1,3))*hy & -half*rnode*cc3(i-1,2)*vol ifinal = ifinal + lenx endif length = ifinal #undef XLO #undef YLO #undef XHI #undef YHI end c ************************************************************************* c ** ALLPHI_FROM_X ** c ************************************************************************* subroutine FORT_ALLPHI_FROM_X(lenx,leny,length,faces,numOutFlowFaces, $ phi0,phi1,phi2,phi3,x) integer lenx,leny,length integer numOutFlowFaces integer faces(4) REAL_T phi0(0:leny) REAL_T phi1(0:lenx) REAL_T phi2(0:leny) REAL_T phi3(0:lenx) REAL_T x(0:length) integer xlo_outflow,ylo_outflow integer xhi_outflow,yhi_outflow integer i,j,ifinal,n #define XLO 0 #define YLO 1 #define XHI 2 #define YHI 3 c Possible combinations of faces to come in here: c phi0 phi1 phi2 phi3 c XLO YLO c XLO YHI c YLO XHI c YLO YHI c XLO YLO XHI c XLO XHI YHI c XLO YLO YHI c YLO XHI YHI c XLO YLO XHI YHI c Want to find which are outflow faces. xlo_outflow = 0 ylo_outflow = 0 xhi_outflow = 0 yhi_outflow = 0 do i = 1, numOutFlowFaces if (faces(i) .eq. XLO) xlo_outflow = 1 if (faces(i) .eq. YLO) ylo_outflow = 1 if (faces(i) .eq. XHI) xhi_outflow = 1 if (faces(i) .eq. YHI) yhi_outflow = 1 enddo c We know that the faces are ordered: XLO,XHI,YLO,YHI ifinal = 0 if (numOutFlowFaces .eq. 4 .or. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 0) ) then do j = 0,leny phi0(j) = x(j) enddo ifinal = leny endif if (yhi_outflow .eq. 1 .and. $ .not. (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do i = 0,lenx phi3(i) = x(i+ifinal) enddo ifinal = ifinal+lenx endif if (xhi_outflow .eq. 1) then do j = 0,leny phi2(leny-j) = x(ifinal+j) enddo ifinal = ifinal+leny endif if (ylo_outflow .eq. 1) then if (numOutFlowFaces .eq. 4) then do i = 0,lenx-1 phi1(lenx-i) = x(ifinal+i) enddo phi1(0) = x(0) else do i = 0,lenx phi1(lenx-i) = x(ifinal+i) enddo endif ifinal = ifinal+lenx endif if (numOutFlowFaces .lt. 4 .and. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 1) ) then do j = 0,leny phi0(j) = x(j+ifinal) enddo ifinal = ifinal+leny endif if (yhi_outflow .eq. 1 .and. $ (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do i = 0,lenx phi3(i) = x(i+ifinal) enddo ifinal = ifinal+lenx endif end c ************************************************************************* c ** PHI_FROM_X ** c ************************************************************************* subroutine FORT_PHI_FROM_X(DIMS(phi),phi,length,x,per) integer DIMDEC(phi) integer length REAL_T phi(DIMV(phi)) REAL_T x(length+1) integer per integer lenx, leny integer i,j c We know that the faces are ordered: XLO,XHI,YLO,YHI lenx = ARG_H1(phi)-ARG_L1(phi) leny = ARG_H2(phi)-ARG_L2(phi) if (lenx .eq. 0) then do j = 1,length phi(ARG_L1(phi),j-1) = x(j) enddo if (per .eq. 1) then phi(ARG_L1(phi),ARG_H2(phi)) = phi(ARG_L1(phi),ARG_L2(phi)) else phi(ARG_L1(phi),ARG_H2(phi)) = x(length+1) endif elseif (leny .eq. 0) then do i = 1,length phi(i-1,ARG_L2(phi)) = x(i) enddo if (per .eq. 1) then phi(ARG_H1(phi),ARG_L2(phi)) = phi(ARG_L1(phi),ARG_L2(phi)) else phi(ARG_H1(phi),ARG_L2(phi)) = x(length+1) endif endif #undef XLO #undef YLO #undef XHI #undef YHI end ccseapps-2.5/CCSEApps/iamrlib/MACOUTFLOWBC_3D.F0000644000175000017500000010567311634153073021634 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "MACOUTFLOWBC_F.H" #include "ArrayLim.H" #define SDIM 3 #if defined(BL_USE_FLOAT) || defined(BL_T3E) || defined(BL_CRAY) #define SMALL 1.0e-10 #else #define SMALL 1.0d-10 #endif subroutine FORT_EXTRAP_MAC(DIMS(u0),u0,DIMS(u1),u1,DIMS(u2),u2,DIMS(div), & divu,DIMS(rho),rho, & DIMS(divuExt),divuExt,DIMS(rhoExt),rhoExt, & dx,lo,hi,face,per,zeroIt) c c Compute the value of phi for macproj c assuming that the tangential velocity on the edges of the outflow boundary c are either zero or periodic. c note that u is edge centered c compute divu_ave twice due to precision problems implicit none integer DIMDEC(u0) integer DIMDEC(u1) integer DIMDEC(u2) integer DIMDEC(div) integer DIMDEC(rho) integer lo(SDIM),hi(SDIM) integer DIMDEC(divuExt) integer DIMDEC(rhoExt) REAL_T u0(DIMV(u0)) REAL_T u1(DIMV(u1)) REAL_T u2(DIMV(u2)) REAL_T divu(DIMV(div)) REAL_T rho(DIMV(rho)) REAL_T divuExt(DIMV(divuExt)) REAL_T rhoExt(DIMV(rhoExt)) REAL_T dx(3) integer per(2) integer zeroIt integer face c Local variables REAL_T small_pert REAL_T small_udiff parameter ( small_pert = SMALL) parameter (small_udiff = SMALL) REAL_T max_divu, min_divu, max_pert REAL_T divu_ave1,divu_ave2 REAL_T hx,hy,hz REAL_T diff integer i,j,k,neq,n integer ics,ice,jcs,jce,kcs,kce integer ifs,ife,jfs,jfe,kfs,kfe integer if,jf,kf,ic,jc,kc c NOTE: Assumes that rho at edge between i, i-1 = half*(rho(i)+rho(i-1)) c (1) Linear fit of rho between nodes c (2) rho, divu on same boxes (box) c (3) phi is on box, shifted up one c (4) u is edge-based, on surroundingNodes(box) c Compute average of divu over outflow bc. Set trivial solution if average c is zero, or if divu is constant #define XLO 0 #define YLO 1 #define ZLO 2 #define XHI 3 #define YHI 4 #define ZHI 5 ics = ARG_L1(rho) ice = ARG_H1(rho) jcs = ARG_L2(rho) jce = ARG_H2(rho) kcs = ARG_L3(rho) kce = ARG_H3(rho) ifs = lo(1) ife = hi(1) jfs = lo(2) jfe = hi(2) kfs = lo(3) kfe = hi(3) hx = dx(1) hy = dx(2) hz = dx(3) zeroIt = 0 if (face .eq. XLO) then if = ifs max_divu = divu(ics,jcs,kcs) min_divu = max_divu do k = kcs, kce do j = jcs, jce divuExt(j,k,if) = divu(ics,j,k) rhoExt(j,k,if) = rho(ics,j,k) max_divu = max(max_divu,divuExt(j,k,if)) min_divu = min(min_divu,divuExt(j,k,if)) end do end do c Here we modify divuExt to include the velocity terms. do k = kcs, kce do j = jcs, jce divuExt(j,k,if) = divuExt(j,k,if) $ - (u1(ics,j+1,k)-u1(ics,j,k))/hy $ - (u2(ics,j,k+1)-u2(ics,j,k))/hz end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(jcs,kcs,if)) do k = kcs, kce do j = jcs, jce max_pert = MAX(max_pert,ABS(divuExt(j,k,if))) end do end do c Make sure u_mac is periodic if (per(1) .eq. 1) then diff = abs(u1(ics,jcs,kcs)-u1(ics,jce+1,kcs)) do k = kcs, kce diff = max(diff,abs(u1(ics,jcs,k)-u1(ics,jce+1,k))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE XLO : vmac not periodic' call bl_abort(" ") endif endif if (per(2) .eq. 1) then diff = abs(u2(ics,jcs,kcs)-u2(ics,jcs,kce+1)) do j = jcs, jce diff = max(diff,abs(u1(ics,j,kcs)-u1(ics,j,kce+1))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE XLO : wmac not periodic' call bl_abort(" ") endif endif else if (face .eq. YLO) then jf = jfs max_divu = divu(ics,jcs,kcs) min_divu = max_divu do k = kcs, kce do i = ics, ice divuExt(i,k,jf) = divu(i,jcs,k) rhoExt(i,k,jf) = rho(i,jcs,k) max_divu = max(max_divu,divuExt(i,k,jf)) min_divu = min(min_divu,divuExt(i,k,jf)) end do end do c Here we modify divuExt to include the velocity terms. do k = kcs, kce do i = ics, ice divuExt(i,k,jf) = divuExt(i,k,jf) $ - (u0(i+1,jcs,k)-u0(i,jcs,k))/hx $ - (u2(i,jcs,k+1)-u2(i,jcs,k))/hz end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,kcs,jf)) do k = kcs, kce do i = ics, ice max_pert = MAX(max_pert,ABS(divuExt(i,k,jf))) end do end do c Make sure u_mac is periodic if (per(1) .eq. 1) then diff = abs(u0(ics,jcs,kcs)-u0(ice+1,jcs,kcs)) do k = kcs, kce diff = max(diff,abs(u0(ics,jcs,k)-u1(ice+1,jcs,k))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE YLO : umac not periodic' call bl_abort(" ") endif endif if (per(2) .eq. 1) then diff = abs(u2(ics,jcs,kcs)-u2(ics,jcs,kce+1)) do i = ics, ice diff = max(diff,abs(u1(i,jcs,kcs)-u1(i,jcs,kce+1))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE YLO : wmac not periodic' call bl_abort(" ") endif endif else if (face .eq. ZLO) then kf = kfs max_divu = divu(ics,jcs,kcs) min_divu = max_divu do j = jcs, jce do i = ics, ice divuExt(i,j,kf) = divu(i,j,kcs) rhoExt(i,j,kf) = rho(i,j,kcs) max_divu = max(max_divu,divuExt(i,j,kf)) min_divu = min(min_divu,divuExt(i,j,kf)) end do end do c Here we modify divuExt to include the velocity terms. do j = jcs, jce do i = ics, ice divuExt(i,j,kf) = divuExt(i,j,kf) $ - (u0(i+1,j,kcs)-u0(i,j,kcs))/hx $ - (u1(i,j+1,kcs)-u1(i,j,kcs))/hy end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,jcs,kf)) do j = jcs, jce do i = ics, ice max_pert = MAX(max_pert,ABS(divuExt(i,j,kf))) end do end do c Make sure u_mac is periodic if (per(1) .eq. 1) then diff = abs(u0(ics,jcs,kcs)-u0(ice+1,jcs,kcs)) do j = jcs, jce diff = max(diff,abs(u0(ics,j,kcs)-u1(ice+1,j,kcs))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE ZLO : umac not periodic' call bl_abort(" ") endif endif if (per(2) .eq. 1) then diff = abs(u1(ics,jcs,kcs)-u1(ics,jce+1,kcs)) do i = ics, ice diff = max(diff,abs(u1(i,jcs,kcs)-u1(i,jce+1,kcs))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE ZLO : vmac not periodic' call bl_abort(" ") endif endif else if (face .eq. XHI) then if = ife max_divu = divu(ice,jcs,kcs) min_divu = max_divu do k = kcs, kce do j = jcs, jce divuExt(j,k,if) = divu(ice,j,k) rhoExt(j,k,if) = rho(ice,j,k) max_divu = max(max_divu,divuExt(j,k,if)) min_divu = min(min_divu,divuExt(j,k,if)) end do end do do k = kcs, kce do j = jcs, jce divuExt(j,k,if) = divuExt(j,k,if) $ - (u1(ice,j+1,k)-u1(ice,j,k))/hy $ - (u2(ice,j,k+1)-u2(ice,j,k))/hz end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(jcs,kcs,if)) do k = kcs, kce do j = jcs, jce max_pert = MAX(max_pert,ABS(divuExt(j,k,if))) end do end do c Make sure u_mac is periodic if (per(1) .eq. 1) then diff = abs(u1(ice,jcs,kcs)-u1(ice,jce+1,kcs)) do k = kcs, kce diff = max(diff,abs(u1(ice,jcs,k)-u1(ice,jce+1,k))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE XLO : umac not periodic' call bl_abort(" ") endif endif if (per(2) .eq. 1) then diff = abs(u2(ice,jcs,kcs)-u2(ice,jcs,kce+1)) do j = jcs, jce diff = max(diff,abs(u1(ice,j,kcs)-u1(ice,j,kce+1))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE XLO : umac not periodic' call bl_abort(" ") endif endif else if (face .eq. YHI) then jf = jfe max_divu = divu(ics,jce,kcs) min_divu = max_divu do k = kcs, kce do i = ics, ice divuExt(i,k,jf) = divu(i,jce,k) rhoExt(i,k,jf) = rho(i,jce,k) max_divu = max(max_divu,divuExt(i,k,jf)) min_divu = min(min_divu,divuExt(i,k,jf)) end do end do do k = kcs, kce do i = ics, ice divuExt(i,k,jf) = divuExt(i,k,jf) $ - (u0(i+1,jce,k)-u0(i,jce,k))/hx $ - (u2(i,jce,k+1)-u2(i,jce,k))/hz end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,kcs,jf)) do k = kcs, kce do i = ics, ice max_pert = MAX(max_pert,ABS(divuExt(i,k,jf))) end do end do c Make sure u_mac is periodic if (per(1) .eq. 1) then diff = abs(u0(ics,jce,kcs)-u0(ice+1,jce,kcs)) do k = kcs, kce diff = max(diff,abs(u0(ics,jce,k)-u1(ice+1,jce,k))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE YLO : umac not periodic' call bl_abort(" ") endif endif if (per(2) .eq. 1) then diff = abs(u2(ics,jce,kcs)-u2(ics,jce,kce+1)) do i = ics, ice diff = max(diff,abs(u1(i,jce,kcs)-u1(i,jce,kce+1))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE YLO : wmac not periodic' call bl_abort(" ") endif endif else if (face .eq. ZHI) then kf = kfe max_divu = divu(ics,jcs,kce) min_divu = max_divu do j = jcs, jce do i = ics, ice divuExt(i,j,kf) = divu(i,j,kce) rhoExt(i,j,kf) = rho(i,j,kce) max_divu = max(max_divu,divuExt(i,j,kf)) min_divu = min(min_divu,divuExt(i,j,kf)) end do end do c Here we modify divuExt to include the velocity terms. do j = jcs, jce do i = ics, ice divuExt(i,j,kf) = divuExt(i,j,kf) $ - (u0(i+1,j,kce)-u0(i,j,kce))/hx $ - (u1(i,j+1,kce)-u1(i,j,kce))/hy end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,jcs,kf)) do j = jcs, jce do i = ics, ice max_pert = MAX(max_pert,ABS(divuExt(i,j,kf))) end do end do c Make sure u_mac is periodic if (per(1) .eq. 1) then diff = abs(u0(ics,jcs,kce)-u0(ice+1,jcs,kce)) do j = jcs, jce diff = max(diff,abs(u0(ics,j,kce)-u1(ice+1,j,kce))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE ZHI : umac not periodic' call bl_abort(" ") endif endif if (per(2) .eq. 1) then diff = abs(u1(ics,jcs,kce)-u1(ics,jce+1,kce)) do i = ics, ice diff = max(diff,abs(u1(i,jcs,kce)-u1(i,jce+1,kce))) enddo if (diff .gt. small_udiff) then write(6,*) 'EXTRAPMAC: FACE ZHI : vmac not periodic' call bl_abort(" ") endif endif endif c check to see if we should zero phi max_pert = max_pert/(ABS(divu_ave1+divu_ave2)+small_pert) if ((max_divu.eq.zero.and.min_divu.eq.zero) & .or.(max_pert.le.small_pert)) then zeroIt = 1 end if end subroutine subtractavg(DIMS(divu),divu,lo,hi,divu_ave,face) implicit none integer DIMDEC(divu) integer lo(SDIM),hi(SDIM) REAL_T divu_ave REAL_T divu(DIMV(divu)) integer face integer i,j,k REAL_T vtot divu_ave = zero vtot = zero if (face .eq. XLO .or. face .eq. XHI) then i = lo(1) do k = lo(3),hi(3) do j=lo(2),hi(2) vtot = vtot+one divu_ave = divu_ave+divu(j,k,i) enddo enddo divu_ave = divu_ave/vtot do k = lo(3),hi(3) do j=lo(2),hi(2) divu(j,k,i) = divu(j,k,i) - divu_ave enddo enddo elseif (face .eq. YLO .or. face .eq. YHI) then j = lo(2) do k = lo(3),hi(3) do i=lo(1),hi(1) vtot = vtot+one divu_ave = divu_ave+divu(i,k,j) enddo enddo divu_ave = divu_ave/vtot do k = lo(3),hi(3) do i=lo(1),hi(1) divu(i,k,j) = divu(i,k,j) - divu_ave enddo enddo elseif(face .eq. ZLO .or. face .eq. ZHI) then k = lo(3) do j=lo(2),hi(2) do i=lo(1),hi(1) vtot = vtot+one divu_ave = divu_ave+divu(i,j,k) enddo enddo divu_ave = divu_ave/vtot do j=lo(2),hi(2) do i=lo(1),hi(1) divu(i,j,k) = divu(i,j,k) - divu_ave enddo enddo else print*, "bad length" endif end #undef XLO #undef YLO #undef ZLO #undef XHI #undef YHI #undef ZHI subroutine FORT_COMPUTE_MACCOEFF(DIMS(rhs),rhs, & DIMS(beta0),beta0,DIMS(beta1),beta1, & DIMS(divuExt),divuExt, & DIMS(rhoExt),rhoExt,lo,hi,h,isPeriodic) implicit none integer DIMDEC(rhs) integer DIMDEC(beta0) integer DIMDEC(beta1) integer DIMDEC(divuExt) integer DIMDEC(rhoExt) integer lo(SDIM),hi(SDIM) REAL_T divuExt(DIM12(divuExt)) REAL_T rhoExt(DIM12(rhoExt)) REAL_T beta0(DIM12(beta0)) REAL_T beta1(DIM12(beta1)) REAL_T rhs(DIM12(rhs)) REAL_T h(SDIM) integer isPeriodic(SDIM) integer i,j integer ics,jcs,ice,jce ics = lo(1) ice = hi(1) jcs = lo(2) jce = hi(2) do j=jcs,jce do i=ics,ice rhs(i,j) = -divuExt(i,j) enddo enddo do j=jcs,jce do i=ics+1,ice beta0(i,j) = two/(rhoExt(i,j)+rhoExt(i-1,j)) enddo enddo do j=jcs+1,jce do i=ics,ice beta1(i,j) = two/(rhoExt(i,j)+rhoExt(i,j-1)) enddo enddo if (isPeriodic(1) .eq. 1) then do j=jcs,jce beta0(ics ,j) = two/(rhoExt(ics,j)+rhoExt(ice,j)) beta0(ice+1,j) = two/(rhoExt(ics,j)+rhoExt(ice,j)) enddo else do j=jcs,jce beta0(ics ,j) = zero beta0(ice+1,j) = zero enddo endif if (isPeriodic(2) .eq. 1) then do i=ics,ice beta1(i,jcs ) = two/(rhoExt(i,jcs)+rhoExt(i,jce)) beta1(i,jce+1) = two/(rhoExt(i,jcs)+rhoExt(i,jce)) enddo else do i=ics,ice beta1(i,jcs ) = zero beta1(i,jce+1) = zero enddo endif end #define DGXY (hxsqinv*(beta0(i+1,j)*(phi(i+1,j)-phi(i ,j)) \ -beta0(i ,j)*(phi(i ,j)-phi(i-1,j))) + \ hysqinv*(beta1(i,j+1)*(phi(i,j+1)-phi(i,j)) \ -beta1(i,j )*(phi(i,j )-phi(i,j-1)))) subroutine FORT_MACRELAX(DIMS(rhs),rhs,DIMS(beta0),beta0, & DIMS(beta1),beta1,DIMS(phi),phi, & lo,hi,h,isPeriodic,niter) implicit none integer DIMDEC(beta0) integer DIMDEC(beta1) integer DIMDEC(rhs) integer DIMDEC(phi) REAL_T beta0(DIM12(beta0)) REAL_T beta1(DIM12(beta1)) REAL_T rhs(DIM12(rhs)) REAL_T phi(DIM12(phi)) integer isPeriodic(SDIM) REAL_T h(SDIM) integer lo(SDIM),hi(SDIM) c Local variables integer ics,ice,jcs,jce logical setSingularPoint integer i,j,iter integer redblack REAL_T lam,dg REAL_T phitot, vtot REAL_T maxnorm REAL_T hxsqinv,hysqinv integer niter integer iinc hxsqinv = one/(h(1)*h(1)) hysqinv = one/(h(2)*h(2)) ics = lo(1) ice = hi(1) jcs = lo(2) jce = hi(2) if (h(2). gt. 1.5D0*h(1)) then call bl_abort("line solve for mac not yet implemented") else if (h(1) .gt. 1.5D0*h(2)) then call bl_abort("line solve for mac not yet implemented") endif setSingularPoint = .false. call setmacbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) do iter = 1,niter do redblack = 0,1 do j=jcs,jce iinc = mod(j+redblack,2) do i=ics+iinc,ice,2 dg = DGXY lam = -one/(hxsqinv*(beta0(i,j)+beta0(i+1,j)) & +hysqinv*(beta1(i,j)+beta1(i,j+1))) phi(i,j) = phi(i,j) + lam*(rhs(i,j)-dg) enddo end do call setmacbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) enddo end do end subroutine FORT_MACSUBTRACTAVGPHI(DIMS(phi),phi,lo,hi,isPeriodic) implicit none integer DIMDEC(phi) REAL_T phi(DIM12(phi)) integer lo(SDIM),hi(SDIM) integer isPeriodic(SDIM) REAL_T phitot,vtot integer ics,ice,jcs,jce integer i,j logical setSingularPoint ics = lo(1) ice = hi(1) jcs = lo(2) jce = hi(2) setSingularPoint = .false. phitot = zero vtot = zero do j=jcs,jce do i=ics,ice phitot = phitot+phi(i,j) vtot = vtot + one enddo enddo phitot = phitot/vtot do j=jcs,jce do i=ics,ice phi(i,j) = phi(i,j) - phitot enddo enddo call setmacbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) end subroutine FORT_MACRESID(DIMS(rhs),rhs,DIMS(beta0),beta0, & DIMS(beta1),beta1,DIMS(phi),phi, & DIMS(resid),resid,lo,hi,h,isPeriodic,maxnorm) implicit none integer DIMDEC(beta0) integer DIMDEC(beta1) integer DIMDEC(rhs) integer DIMDEC(phi) integer DIMDEC(resid) REAL_T beta0(DIM12(beta0)) REAL_T beta1(DIM12(beta1)) REAL_T rhs(DIM12(rhs)) REAL_T phi(DIM12(phi)) REAL_T resid(DIM12(resid)) integer isPeriodic(SDIM) REAL_T h(SDIM) integer lo(SDIM),hi(SDIM) REAL_T maxnorm integer i,j REAL_T hxsqinv,hysqinv hxsqinv = one/(h(1)*h(1)) hysqinv = one/(h(2)*h(2)) maxnorm = zero do j = lo(2),hi(2) do i = lo(1),hi(1) resid(i,j) = rhs(i,j) - (DGXY) maxnorm = max(maxnorm,ABS(resid(i,j))) enddo enddo end subroutine setmacbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) implicit none integer DIMDEC(phi) REAL_T phi(DIM12(phi)) integer lo(SDIM),hi(SDIM) integer isPeriodic(SDIM) logical setSingularPoint integer ics,ice,jcs,jce integer i,j ics = lo(1) ice = hi(1) jcs = lo(2) jce = hi(2) if (isPeriodic(1) .NE. 1 .AND. isPeriodic(2) .NE. 1 .AND. setSingularPoint) then phi(ice,jce) = zero endif if (isPeriodic(1) .eq. 1) then do j=jcs,jce phi(ics-1,j) = phi(ice,j) phi(ice+1,j) = phi(ics,j) enddo else do j=jcs,jce phi(ics-1,j) = phi(ics,j) phi(ice+1,j) = phi(ice,j) enddo endif if (isPeriodic(2) .eq. 1) then do i=ics,ice phi(i,jcs-1) = phi(i,jce) phi(i,jce+1) = phi(i,jcs) enddo else do i=ics,ice phi(i,jcs-1) = phi(i,jcs) phi(i,jce+1) = phi(i,jce) enddo endif end subroutine FORT_MAC_SHIFT_PHI(DIMS(out),out,DIMS(in),in,face) implicit none integer face integer DIMDEC(in) integer DIMDEC(out) REAL_T in(DIMV(in)) REAL_T out(DIMV(out)) integer i,j,k #define XLO 0 #define YLO 1 #define ZLO 2 #define XHI 3 #define YHI 4 #define ZHI 5 if (face .eq. XLO .or. face .eq. XHI) then do k = ARG_L3(out), ARG_H3(out) do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j,k) = in(k,i,j) enddo enddo enddo else if (face .eq. YLO .or. face .eq. YHI) then do k = ARG_L3(out), ARG_H3(out) do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j,k) = in(i,k,j) enddo enddo enddo else if (face .eq. ZLO .or. face .eq. ZHI) then do k = ARG_L3(out), ARG_H3(out) do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j,k) = in(i,j,k) enddo enddo enddo endif #undef XLO #undef YLO #undef ZLO #undef XHI #undef YHI #undef ZHI end subroutine FORT_MAC_RESHIFT_PHI(DIMS(out),out,DIMS(in),in,face) implicit none integer face integer DIMDEC(in) integer DIMDEC(out) REAL_T in(DIMV(in)) REAL_T out(DIMV(out)) integer i,j,k #define XLO 0 #define YLO 1 #define ZLO 2 #define XHI 3 #define YHI 4 #define ZHI 5 if (face .eq. XLO .or. face .eq. XHI) then do k = ARG_L3(out), ARG_H3(out) do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j,k) = in(j,k,i) enddo enddo enddo else if (face .eq. YLO .or. face .eq. YHI) then do k = ARG_L3(out), ARG_H3(out) do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j,k) = in(i,k,j) enddo enddo enddo else if (face .eq. ZLO .or. face .eq. ZHI) then do k = ARG_L3(out), ARG_H3(out) do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j,k) = in(i,j,k) enddo enddo enddo endif #undef XLO #undef YLO #undef ZLO #undef XHI #undef YHI #undef ZHI end subroutine FORT_SOLVEMAC(p, DIMS(p),dest0, DIMS(dest0), & source,DIMS(source), sigmax, DIMS(sigmax), & sigmay,DIMS(sigmay), cen, DIMS(cen), $ r,DIMS(r), w, DIMS(w),z, DIMS(z), & x, DIMS(x),lo, hi, h, $ isPeriodic, maxiter,tol, abs_tol,max_jump,norm) implicit none integer lo(SDIM),hi(SDIM) integer DIMDEC(p) integer DIMDEC(dest0) integer DIMDEC(source) integer DIMDEC(sigmax) integer DIMDEC(sigmay) integer DIMDEC(cen) integer DIMDEC(r) integer DIMDEC(w) integer DIMDEC(z) integer DIMDEC(x) REAL_T p(DIM12(p)) REAL_T dest0(DIM12(dest0)) REAL_T source(DIM12(source)) REAL_T sigmax(DIM12(sigmax)) REAL_T sigmay(DIM12(sigmay)) REAL_T cen(DIM12(cen)) REAL_T r(DIM12(r)) REAL_T w(DIM12(w)) REAL_T z(DIM12(z)) REAL_T x(DIM12(x)) REAL_T h(SDIM) integer isPeriodic(SDIM) REAL_T norm REAL_T tol integer maxiter REAL_T abs_tol,max_jump c Local variables integer i,j,iter integer istart,iend,jstart,jend REAL_T alpha, beta, rho, rho_old REAL_T goal REAL_T norm0 logical setSingularPoint istart = lo(1) iend = hi(1) jstart = lo(2) jend = hi(2) setSingularPoint = .false. do j = lo(2)-1,hi(2)+1 do i = lo(1)-1,hi(1)+1 dest0(i,j) = p(i,j) p(i,j) = zero enddo enddo do j=ARG_L2(w),ARG_H2(w) do i=ARG_L1(w),ARG_H1(w) w(i,j) = zero enddo enddo call setmacbc(DIMS(dest0),dest0,lo,hi,isPeriodic,setSingularPoint) call makemacdgphi(dest0,DIMS(dest0),w,DIMS(w),sigmax,DIMS(sigmax), & sigmay,DIMS(sigmay),lo,hi,h,isPeriodic,setSingularPoint) do j = jstart, jend do i = istart, iend r(i,j) = source(i,j) - w(i,j) enddo enddo rho = zero norm0 = zero do j = jstart, jend do i = istart, iend norm0 = max(norm0, abs(r(i,j))) z(i,j) = r(i,j) rho = rho + z(i,j) * r(i,j) enddo enddo norm = norm0 goal = max(tol*norm0,abs_tol) if (norm0 .le. goal) then do j = jstart, jend do i = istart, iend p(i,j) = dest0(i,j) enddo enddo return endif do j = jstart, jend do i = istart, iend x(i,j) = zero p(i,j) = z(i,j) enddo enddo iter = 0 100 continue do j=ARG_L2(w),ARG_H2(w) do i=ARG_L1(w),ARG_H1(w) w(i,j) = zero enddo enddo call setmacbc(DIMS(p),p,lo,hi,isPeriodic,setSingularPoint) call makemacdgphi(p,DIMS(p),w,DIMS(w),sigmax,DIMS(sigmax), & sigmay,DIMS(sigmay),lo,hi,h,isPeriodic,setSingularPoint) alpha = zero do j = jstart, jend do i = istart, iend alpha = alpha + p(i,j)*w(i,j) enddo enddo alpha = rho / alpha rho_old = rho rho = zero norm = zero do j = jstart, jend do i = istart, iend x(i,j) = x(i,j) + alpha * p(i,j) r(i,j) = r(i,j) - alpha * w(i,j) z(i,j) = r(i,j) rho = rho + z(i,j) * r(i,j) norm = max(norm,abs(r(i,j))) enddo enddo iter = iter+1 c write(6,*) iter,norm if (iter .gt. maxiter .or. norm .gt. max_jump*norm0) then print *, "cg solve in mac failed to converge" do j = jstart, jend do i = istart, iend p(i,j) = dest0(i,j) enddo enddo call setmacbc(DIMS(p),p,lo,hi,isPeriodic,setSingularPoint) else if (norm .lt. goal) then do j = jstart, jend do i = istart, iend p(i,j) = x(i,j) + dest0(i,j) enddo enddo call setmacbc(DIMS(p),p,lo,hi,isPeriodic,setSingularPoint) else beta = rho / rho_old do j = jstart, jend do i = istart, iend p(i,j) = z(i,j) + beta * p(i,j) enddo enddo goto 100 endif return end subroutine makemacdgphi(phi,DIMS(phi),dgphi,DIMS(dgphi), & beta0,DIMS(beta0),beta1,DIMS(beta1), & lo,hi,h,isPeriodic,setSingularPoint) implicit none integer DIMDEC(phi) integer DIMDEC(dgphi) integer DIMDEC(beta0) integer DIMDEC(beta1) REAL_T phi(DIM12(phi)) REAL_T dgphi(DIM12(dgphi)) REAL_T beta0(DIM12(beta0)) REAL_T beta1(DIM12(beta1)) integer lo(SDIM),hi(SDIM) REAL_T h(SDIM) integer isPeriodic(SDIM) logical setSingularPoint integer i,j REAL_T hxsqinv, hysqinv hxsqinv = one/(h(1)*h(1)) hysqinv = one/(h(2)*h(2)) do j = lo(2),hi(2) do i = lo(1),hi(1) dgphi(i,j) = DGXY enddo enddo end c ************************************************************************* c ** COARSIGMA ** c ** Coarsen the edge-based sigma coefficients c ************************************************************************* subroutine FORT_COARSIGMA(sigmax,DIMS(sigmax),sigmay,DIMS(sigmay), & sigmaxc,DIMS(sigmaxc),sigmayc,DIMS(sigmayc), & lo,hi,loc,hic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(sigmax) integer DIMDEC(sigmay) integer DIMDEC(sigmaxc) integer DIMDEC(sigmayc) REAL_T sigmax(DIM12(sigmax)) REAL_T sigmay(DIM12(sigmay)) REAL_T sigmaxc(DIM12(sigmaxc)) REAL_T sigmayc(DIM12(sigmayc)) c Local variables integer i,j,twoi,twoj do j = loc(2),hic(2) do i = loc(1),hic(1)+1 twoi = 2*(i-loc(1))+lo(1) twoj = 2*(j-loc(2))+lo(2) sigmaxc(i,j) = half*(sigmax(twoi,twoj) + sigmax(twoi,twoj+1)) enddo enddo do j = loc(2),hic(2)+1 do i = loc(1),hic(1) twoi = 2*(i-loc(1))+lo(1) twoj = 2*(j-loc(2))+lo(2) sigmayc(i,j) = half*(sigmay(twoi,twoj) + sigmay(twoi+1,twoj)) enddo enddo return end c ************************************************************************* c ** RESTRICT ** c ** Conservatively average the residual c ************************************************************************* subroutine FORT_RESTRICT(res,DIMS(res),resc,DIMS(resc), & lo,hi,loc,hic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(res) integer DIMDEC(resc) REAL_T res(DIM12(res)) REAL_T resc(DIM12(resc)) c Local variables integer i,j,twoi,twoj c ::: NOTE: dont need factor of r here for volume-weighting because c ::: what were calling the residual is really already r*residual do j = loc(2),hic(2) do i = loc(1),hic(1) twoi = 2*(i-loc(1))+lo(1) twoj = 2*(j-loc(2))+lo(2) resc(i,j) = ((res(twoi ,twoj) + res(twoi ,twoj+1)) + $ (res(twoi+1,twoj) + res(twoi+1,twoj+1)))*fourth enddo enddo return end c ************************************************************************* c ** INTERPOLATE ** c ** Piecewise constant interpolation c ************************************************************************* subroutine FORT_INTERPOLATE(phi,DIMS(phi),deltac,DIMS(deltac), & lo,hi,loc,hic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(phi) integer DIMDEC(deltac) REAL_T phi(DIM12(phi)) REAL_T deltac(DIM12(deltac)) c Local variables integer i,j,twoi,twoj do j = loc(2), hic(2) do i = loc(1), hic(1) twoi = 2*(i-loc(1))+lo(1) twoj = 2*(j-loc(2))+lo(2) phi(twoi ,twoj ) = phi(twoi ,twoj ) + deltac(i,j) phi(twoi+1,twoj ) = phi(twoi+1,twoj ) + deltac(i,j) phi(twoi ,twoj+1) = phi(twoi ,twoj+1) + deltac(i,j) phi(twoi+1,twoj+1) = phi(twoi+1,twoj+1) + deltac(i,j) enddo enddo return end c ************************************************************************* c ** MACFILL_TWOD ** c ************************************************************************* subroutine FORT_MACFILL_TWOD(lenx,leny,length,width,faces,numOutFlowFaces, $ cc0,cc1,cc2,cc3,cc4,cc5,conn) integer lenx,leny,length,width integer faces(4) integer numOutFlowFaces REAL_T cc0(lenx,leny,2) REAL_T cc1(lenx,leny,2) REAL_T cc2(lenx,leny,2) REAL_T cc3(lenx,leny,2) REAL_T cc4(lenx,leny,2) REAL_T cc5(lenx,leny,2) REAL_T conn(length,2) integer xlo_outflow,ylo_outflow,zlo_outflow integer xhi_outflow,yhi_outflow,zhi_outflow integer i,ifinal,n REAL_T sum #define XLO 0 #define YLO 1 #define ZLO 2 #define XHI 3 #define YHI 4 #define ZHI 5 c Want to find any non-outflow faces. xlo_outflow = 0 ylo_outflow = 0 zlo_outflow = 0 xhi_outflow = 0 yhi_outflow = 0 zhi_outflow = 0 do i = 1, numOutFlowFaces if (faces(i) .eq. XLO) xlo_outflow = 1 if (faces(i) .eq. YLO) ylo_outflow = 1 if (faces(i) .eq. ZLO) zlo_outflow = 1 if (faces(i) .eq. XHI) xhi_outflow = 1 if (faces(i) .eq. YHI) yhi_outflow = 1 if (faces(i) .eq. ZHI) zhi_outflow = 1 enddo c Possible combinations of faces to come in here: c cc0 cc1 cc2 cc3 c XLO YLO c XLO YHI c YLO XHI c YLO YHI c XLO YLO XHI c XLO XHI YHI c XLO YLO YHI c YLO XHI YHI c XLO YLO XHI YHI end ccseapps-2.5/CCSEApps/iamrlib/NAVIERSTOKES_F.H0000644000175000017500000001574311634153073021603 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _NAVIERSTOKES_F_H_ #define _NAVIERSTOKES_F_H_ /* ** $Id: NAVIERSTOKES_F.H,v 1.14 2003/03/04 17:51:36 car Exp $ */ #ifdef BL_LANG_FORT # define FORT_FILCC filcc # define FORT_GRADP gradp # define FORT_AVGDOWN avgdown # define FORT_PUTDOWN putdown # define FORT_TESTINJECT testinject # define FORT_INCRMULT incrmult # define FORT_SUMMASS summass # define FORT_SUMMASSSQ summasssq # define FORT_CEN2EDG cen2edg # define FORT_EDGE_INTERP edge_interp # define FORT_PC_CF_EDGE_INTERP pc_edge_interp #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_FILCC FILCC # define FORT_GRADP GRADP # define FORT_AVGDOWN AVGDOWN # define FORT_PUTDOWN PUTDOWN # define FORT_TESTINJECT TESTINJECT # define FORT_INCRMULT INCRMULT # define FORT_SUMMASS SUMMASS # define FORT_SUMMASSSQ SUMMASSSQ # define FORT_CEN2EDG CEN2EDG # define FORT_EDGE_INTERP EDGE_INTERP # define FORT_PC_CF_EDGE_INTERP PC_EDGE_INTERP # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_FILCC filcc # define FORT_GRADP gradp # define FORT_AVGDOWN avgdown # define FORT_PUTDOWN putdown # define FORT_TESTINJECT testinject # define FORT_INCRMULT incrmult # define FORT_SUMMASS summass # define FORT_SUMMASSSQ summasssq # define FORT_CEN2EDG cen2edg # define FORT_EDGE_INTERP edge_interp # define FORT_PC_CF_EDGE_INTERP pc_edge_interp # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_FILCC filcc_ # define FORT_GRADP gradp_ # define FORT_AVGDOWN avgdown_ # define FORT_PUTDOWN putdown_ # define FORT_TESTINJECT testinject_ # define FORT_INCRMULT incrmult_ # define FORT_SUMMASS summass_ # define FORT_SUMMASSSQ summasssq_ # define FORT_CEN2EDG cen2edg_ # define FORT_EDGE_INTERP edge_interp_ # define FORT_PC_CF_EDGE_INTERP pc_edge_interp_ # endif #include extern "C" { void FORT_FILCC (const Real * q, ARLIM_P(q_lo), ARLIM_P(q_hi), const int * domlo, const int * domhi, const Real * dx_crse, const Real * xlo, const int * bc); #if (BL_SPACEDIM == 2) void FORT_GRADP (const Real* p, ARLIM_P(p_lo), ARLIM_P(p_hi), const Real* gp, ARLIM_P(gp_lo), ARLIM_P(gp_hi), const int* lo, const int* hi, const Real* dx , const int* is_full); #else void FORT_GRADP (const Real* p, ARLIM_P(p_lo), ARLIM_P(p_hi), const Real* gp, ARLIM_P(gp_lo), ARLIM_P(gp_hi), const int* lo, const int* hi, const Real* dx); #endif void FORT_AVGDOWN (const Real* crse, ARLIM_P(clo), ARLIM_P(chi), const int* nvar, const Real* fine, ARLIM_P(fine_lo), ARLIM_P(fine_hi), const Real* cvol, ARLIM_P(cv_lo), ARLIM_P(cv_hi), const Real* fvol, ARLIM_P(fv_lo), ARLIM_P(fv_hi), const int* lo, const int* hi, const int* ratio); void FORT_PUTDOWN (Real* crse, ARLIM_P(crse_lo), ARLIM_P(crse_hi), const Real* fine, ARLIM_P(fine_lo), ARLIM_P(fine_hi), const int* lo, const int* hi, const int* ratio); void FORT_TESTINJECT (Real* crse, ARLIM_P(crse_lo), ARLIM_P(crse_hi), const Real* fine, ARLIM_P(fine_lo), ARLIM_P(fine_hi), const int* lo, const int* hi, const int* ratio); void FORT_INCRMULT (Real* a, ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* b, ARLIM_P(b_lo), ARLIM_P(b_hi), const int* lo, const int* hi, const Real* alpha); #if (BL_SPACEDIM == 2) void FORT_SUMMASS (const Real* dat, ARLIM_P(dat_lo), ARLIM_P(dat_hi), ARLIM_P(grid_lo), ARLIM_P(grid_hi), const Real* delta, Real* mass, const Real* radius, const int* irlo, const int* irhi, const int* rz_flag, Real* tmp); void FORT_SUMMASS (const Real* dat, ARLIM_P(dat_lo), ARLIM_P(dat_hi), ARLIM_P(grid_lo), ARLIM_P(grid_hi), const Real* delta, Real* mass, const Real* radius, const int* irlo, const int* irhi, const int* rz_flag, Real* tmp); #else void FORT_SUMMASS (const Real* dat, ARLIM_P(dat_lo), ARLIM_P(dat_hi), ARLIM_P(grid_lo), ARLIM_P(grid_hi), const Real* delta, Real* mass, Real* tmp); void FORT_SUMMASSSQ (const Real* dat, ARLIM_P(dat_lo), ARLIM_P(dat_hi), ARLIM_P(grid_lo), ARLIM_P(grid_hi), const Real* delta, Real* mass, Real* tmp); #endif void FORT_CEN2EDG(const int* lo, const int* hi, ARLIM_P(clo), ARLIM_P(chi), const Real* cfabdat, ARLIM_P(elo), ARLIM_P(ehi), Real* efabdat, const int* nc, const int* dir, const int* isharm); void FORT_EDGE_INTERP(const int* flo, const int* fhi, const int* nc, const int* refRatio, const int* dir, Real* fine, ARLIM_P(flo), ARLIM_P(fhi)); void FORT_PC_CF_EDGE_INTERP(const int* lo, const int* hi, const int* nc, const int* refRatio, const int* dir, const Real* crse, ARLIM_P(clo), ARLIM_P(chi), Real* fine, ARLIM_P(flo), ARLIM_P(fhi)); } #endif #endif /*_NAVIERSTOKES_F_H_*/ ccseapps-2.5/CCSEApps/iamrlib/MACOPERATOR_2D.F0000644000175000017500000002036311634153073021512 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: MACOPERATOR_2D.F,v 1.8 2003/02/05 22:11:42 almgren Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "MACOPERATOR_F.H" #include "ArrayLim.H" #define SDIM 2 c :: ---------------------------------------------------------- c :: MACCOEF c :: Compute the coefficents for MAC solve c :: c :: INPUTS / OUTPUTS: c :: cx,cy <= edge coef arrays c :: DIMS(cx) => index limits for cx c :: DIMS(cy) => index limits for cy c :: lo,hi => index limits for rhs c :: ax,ay => edge based area arrays c :: DIMS(ax) => index limits for ax c :: DIMS(ay) => index limits for ay c :: rho => cell centered density array c :: DIMS(rho) => index limits for rho c :: dx => cell size c :: ---------------------------------------------------------- c :: subroutine FORT_MACCOEF (cx,DIMS(cx),cy,DIMS(cy), & ax,DIMS(ax),ay,DIMS(ay), & rho,DIMS(rho),lo,hi,dx) integer DIMDEC(cx) integer DIMDEC(cy) integer DIMDEC(ax) integer DIMDEC(ay) integer DIMDEC(rho) integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM) REAL_T cx(DIMV(cx)) REAL_T cy(DIMV(cy)) REAL_T ax(DIMV(ax)) REAL_T ay(DIMV(ay)) REAL_T rho(DIMV(rho)) integer i, j REAL_T rhoavg do j = lo(2), hi(2) do i = lo(1), hi(1) if (rho(i,j) .lt. zero) then print *,' ' print *,'TESTING in MACCOEF ' print *,'RHO HAS GONE NEGATIVE AT ',i,j,rho(i,j) call bl_abort(" ") end if end do end do c c ::::: finish coef in X direction (part 2) c do j = lo(2), hi(2) do i = lo(1), hi(1)+1 rhoavg = half * (rho(i,j) + rho(i-1,j)) cx(i,j) = dx(1) * ax(i,j) / rhoavg end do end do c c ::::: finish coef in Y direction (part 2) c do j = lo(2), hi(2)+1 do i = lo(1), hi(1) rhoavg = half * (rho(i,j) + rho(i,j-1)) cy(i,j) = dx(2) * ay(i,j) / rhoavg end do end do end c :: ---------------------------------------------------------- c :: MACRHS c :: Compute the RHS for MAC solve c :: c :: INPUTS / OUTPUTS: c :: ux,uy <= edge velocity arrays c :: DIMS(ux) => index limits for ux c :: DIMS(uy) => index limits for uy c :: lo,hi => index limits for rhs c :: ax,ay => edge based area arrays c :: DIMS(ax) => index limits for ax c :: DIMS(ay) => index limits for ay c :: vol => cell centered volume array c :: vlo,vhi => index limits of vol array c :: DIMS(vol) => index limits for vol c :: rhs <=> cell centered rhs array c :: DIMS(rhs) => index limits for rhs c :: scale => scale factor c :: ---------------------------------------------------------- c :: subroutine FORT_MACRHS (ux,DIMS(ux),uy,DIMS(uy), & ax,DIMS(ax),ay,DIMS(ay), & vol,DIMS(vol),rhs,DIMS(rhs), & lo,hi,scale) integer DIMDEC(ux) integer DIMDEC(uy) integer DIMDEC(ax) integer DIMDEC(ay) integer DIMDEC(vol) integer DIMDEC(rhs) integer lo(SDIM), hi(SDIM) REAL_T scale REAL_T ux(DIMV(ux)) REAL_T uy(DIMV(uy)) REAL_T ax(DIMV(ax)) REAL_T ay(DIMV(ay)) REAL_T vol(DIMV(vol)) REAL_T rhs(DIMV(rhs)) integer i, j REAL_T divu c c ::::: rhs holds the divergence condition (possibly zero) c do j = lo(2), hi(2) do i = lo(1), hi(1) divu = ax(i+1,j)*ux(i+1,j) - ax(i,j)*ux(i,j) & + ay(i,j+1)*uy(i,j+1) - ay(i,j)*uy(i,j) rhs(i,j) = scale*(divu - vol(i,j)*rhs(i,j)) end do end do end c :: ---------------------------------------------------------- c :: MACUPDATE c :: Compute the update to velocity field to c :: make it divergence free c :: c :: INPUTS / OUTPUTS: c :: ux,uy <= edge based velocity arrays c :: DIMS(ux) => index limits for ux c :: DIMS(uy) => index limits for uy c :: phi => soln from MAC project c :: DIMS(phi) => index limits for phi c :: rho => density at time N c :: DIMS(rho) => index limits for rho c :: dx => cell size c :: mult => scalar multiplier c :: ---------------------------------------------------------- c :: subroutine FORT_MACUPDATE(init,ux,DIMS(ux),uy,DIMS(uy), & phi,DIMS(phi),rho,DIMS(rho), & lo,hi,dx,mult) integer DIMDEC(ux) integer DIMDEC(uy) integer DIMDEC(phi) integer DIMDEC(rho) integer lo(SDIM), hi(SDIM) REAL_T ux(DIMV(ux)) REAL_T uy(DIMV(uy)) REAL_T phi(DIMV(phi)) REAL_T rho(DIMV(rho)) REAL_T dx(SDIM), mult integer init integer i, j REAL_T rhoavg, gp c c set values to 0.0 if initializing c if ( init .eq. 1 ) then do j = ARG_L2(ux), ARG_H2(ux) do i = ARG_L1(ux), ARG_H1(ux) ux(i,j) = zero end do end do do j = ARG_L2(uy), ARG_H2(uy) do i = ARG_L1(uy), ARG_H1(uy) uy(i,j) = zero end do end do end if c c compute the x mac gradient c do j = lo(2),hi(2) do i = lo(1),hi(1)+1 rhoavg = half*(rho(i,j) + rho(i-1,j)) gp = (phi(i,j)-phi(i-1,j))/dx(1) ux(i,j) = ux(i,j) + mult * gp / rhoavg end do end do c c compute the y mac gradient c do j = lo(2),hi(2)+1 do i = lo(1),hi(1) rhoavg = half*(rho(i,j) + rho(i,j-1)) gp = (phi(i,j)-phi(i,j-1))/dx(2) uy(i,j) = uy(i,j) + mult * gp / rhoavg end do end do end c :: ---------------------------------------------------------- c :: MACSYNCRHS c :: Modify the RHS for MAC SYNC solve c :: c :: INPUTS / OUTPUTS: c :: rhs <= right hand side array c :: DIMS(rhs) => index limits for rhs c :: vol => cell centered volume array c :: DIMS(vol) => index limits of vol array c :: rhsscale => const multiplier to rhs c :: ---------------------------------------------------------- c :: subroutine FORT_MACSYNCRHS(rhs,DIMS(rhs),lo,hi, & vol,DIMS(vol),rhsscale) integer DIMDEC(rhs) integer DIMDEC(vol) integer lo(SDIM), hi(SDIM) REAL_T rhsscale REAL_T rhs(DIMV(rhs)) REAL_T vol(DIMV(vol)) integer i, j c c ::::: multiply by volume since reflux step (which computed rhs) c ::::: divided by volume. c do j = lo(2), hi(2) do i = lo(1), hi(1) rhs(i,j) = rhsscale*vol(i,j)*rhs(i,j) end do end do end ccseapps-2.5/CCSEApps/iamrlib/MACPROJ_F.H0000644000175000017500000000646511634153073020762 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MACPROJ_F_H #define _MACPROJ_F_H /* ** $Id: MACPROJ_F.H,v 1.9 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_MACDIV macdiv # define FORT_UCORUPDT ucorupdt #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_MACDIV MACDIV # define FORT_UCORUPDT UCORUPDT # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_MACDIV macdiv # define FORT_UCORUPDT ucorupdt # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_MACDIV macdiv_ # define FORT_UCORUPDT ucorupdt_ # endif #include extern "C" { #if (BL_SPACEDIM == 2) void FORT_MACDIV (Real* dmac, ARLIM_P(dlo), ARLIM_P(dhi), const int* lo, const int* hi, const Real* ux, ARLIM_P(ux_lo), ARLIM_P(ux_hi), const Real* uy, ARLIM_P(uy_lo), ARLIM_P(uy_hi), const Real* ax, ARLIM_P(ax_lo), ARLIM_P(ax_hi), const Real* ay, ARLIM_P(ay_lo), ARLIM_P(ay_hi), const Real* vol,ARLIM_P(vol_lo), ARLIM_P(vol_hi)); #endif #if (BL_SPACEDIM == 3) void FORT_MACDIV (Real* dmac, ARLIM_P(dlo), ARLIM_P(dhi), const int* lo, const int* hi, const Real* ux, ARLIM_P(ux_lo), ARLIM_P(ux_hi), const Real* uy, ARLIM_P(uy_lo), ARLIM_P(uy_hi), const Real* uz, ARLIM_P(uz_lo), ARLIM_P(uz_hi), const Real* ax, ARLIM_P(ax_lo), ARLIM_P(ax_hi), const Real* ay, ARLIM_P(ay_lo), ARLIM_P(ay_hi), const Real* az, ARLIM_P(az_lo), ARLIM_P(az_hi), const Real* vol,ARLIM_P(vol_lo), ARLIM_P(vol_hi)); #endif void FORT_UCORUPDT (Real* snew, const Real* sold, ARLIM_P(s_lo), ARLIM_P(s_hi), const int* nvar, const int* lo, const int* hi, const Real* dmac, ARLIM_P(dmac_lo), ARLIM_P(dmac_hi), const Real* mult); } #endif #endif /*_MACPROJ_F_H*/ ccseapps-2.5/CCSEApps/iamrlib/test2d/0000755000175000017500000000000011634153073020503 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/0000755000175000017500000000000011634153073022022 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/Header0000644000175000017500000000063711634153073023143 0ustar amckinstryamckinstryNavierStokes-V1.1 7 x_velocity y_velocity density tracer temp divu dsdt 2 0 2 0 0 1 1 2 2 ((0,0) (15,15) (0,0)) ((0,0) (31,31) (0,0)) ((0,0) (63,63) (0,0)) 0 0 0 0.0625 0.0625 0.03125 0.03125 0.015625 0.015625 0 0 0 4 0 0 0 0.5 0 0.5 0.5 1 0 0.5 0 0.5 0.5 1 0.5 1 0.5 1 Level_0/Cell 1 2 0 0 0.25 0.5 0.25 0.5 0.5 0.75 0.25 0.5 Level_1/Cell 2 2 0 0 0.375 0.5 0.375 0.4375 0.5 0.625 0.375 0.4375 Level_2/Cell ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/Level_1/0000755000175000017500000000000011634153073023311 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/Level_1/Cell_H0000644000175000017500000000107711634153073024367 0ustar amckinstryamckinstry1 0 7 0 (2 0 ((8,8) (15,15) (0,0)) ((16,8) (23,15) (0,0)) ) 2 FabOnDisk: Cell_D_0000 0 FabOnDisk: Cell_D_0000 3666 2,7 -0.00101214151922581,-0.00226000983235514,0.667320401680379,0,1.00000000302875,-3.53823065090415,-73.3750062793103, -0.061449121890955,-0.0022600098323545,0.667320401680379,0,1.00000000302875,-3.53823065090415,-73.3750064619999, 2,7 0.0614491218909539,0.0693108971518227,0.999999996971252,1,1.49853053717809,1.99452425361675,108.972672828069, 0.00101214151922607,0.0693108971518226,0.999999996971252,1,1.49853053717809,1.99452425361675,108.97267310512, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/Level_1/Cell_D_00000000644000175000017500000001624511634153073025025 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((8,8) (15,15) (0,0)) 7 ÚŠ”4Ûü¾€7¸Z ¿ÀH/N»'¿@Hd=/¿`U¸ªæî8¿@±Ý¤±­;¿€’þ¬V-4¿ ¢‹ëÖ;(¿k}»ôc?ZðS†ö¾ ŠãØž"¿°º*34¿@Q‚ŒúA¿Øø&ÖTG¿*(ûmD¿Àcš h'1¿ FÖ;Û!?ÀF}¡ur?‹"üc ¿Àz{ÜZ2¿È#Àðº·F¿TþU®:•P¿€»š¢’L¿ Í¶æŠ?p÷°sÚ0?1Rº–ß@?hS&2›KM?˜Çís`? ¼amñ«w?"äû)“?±)¥¼/§?•HUÓ±? ¦*-—}.?@\jŠjA?X HIæUS?àî•fZ†h?ô+Ñ¢—‘?†¬`£å¨?ø†ä[¾±?ÆÛU ¨±?ÀlŠ™qf¿òñÆè=?”bY. )e?9n°A:?Ô?)aT—?ÎõH|%r¡?|êÔâˆè›?Å‚ñ 7’?ÀQcâª=¿<ÐL2èU¿¶#’‹k?tUݼ¯*„?l‘Žì%›†?ÕÚó¹x?€2Š•ƒb¿$wK:7?j»_þÿÿï?„›÷ÿÿï?ÐPlÕÿÿï?½ÝUÿÿï?¾.%Ùýÿï?úòúÿï?Ôü£¨õÿï?d)¹žñÿï?„›÷ÿÿï?Dw4Èÿÿï?¸VÐþÿï?úòúÿï?âŒÊâëÿï?ÒÉÇÆÿï?`ƒUÞˆÿï?ú´øQÿï?ÐPlÕÿÿï?¸VÐþÿï?ìx…øÿï?vèFä×ÿï?ú´øQÿï?VæªßÁýï?ˆx5Àúï?l5>Ð÷ï?½ÝUÿÿï?úòúÿï?vèFä×ÿï?"»zÿþï?ˆx5Àúï?ÆCU2ëï?dƒ™¨“Çï?Šù § ï?¾.%Ùýÿï?âŒÊâëÿï?ú´øQÿï?ˆx5Àúï?ªádÎ×ï?Šy’?Dï?¼)õ^¾íí?fJ?(ù©ì?úòúÿï?ÒÉÇÆÿï?VæªßÁýï?ÆCU2ëï?Šy’?Dï?ë;¿¬ì?â3 é?ŵڨQç?Ôü£¨õÿï?`ƒUÞˆÿï?ˆx5Àúï?dƒ™¨“Çï?¬¸xÖî?pSkL‘Øè?IƒÐ÷ï?Šù § ï?*PðÇì?ŽQöç?ÂОq9„å?Iw¥P°Zå?Ð?è?ð?ð?ð?ð?ð?ð?ð?K"Ðð??²xð?´×Ið?D#Uð?&{mð?Â|ñ·ð?[­¯+ð?r¦¦0ð??²xð?Äåð?EþÔ—ð?Â|ñ·ð?â ¡ ð?*Äjœð?ͳ‘;ð?Ph˜Wð?´×Ið?EþÔ—ð?@#@½ð?˜®õ ð?Ph˜Wð?éIJ$ð?ÕÝ´f ð?‹øG ð?D#Uð?Â|ñ·ð?˜®õ ð?mº¦F€ð?ÕÝ´f ð?¢aæœm ð?ûÈTBhð?ÏÉÕ3<0ð?&{mð?â ¡ ð?Ph˜Wð?ÕÝ´f ð?2cÖ;ð?˜bP×`ð?ˆ‰Òe ñ?/7Eš%çñ?Â|ñ·ð?*Äjœð?éIJ$ð?¢aæœm ð?˜bP×`ð?TËoÃ$æñ?¶a¥xê€ô?§ u/ñýõ?[­¯+ð?ͳ‘;ð?ÕÝ´f ð?ûÈTBhð?!âî­ñ?$x b›ô?úÜTãC÷?PåV²Ë÷?r¦¦0ð?Ph˜Wð?‹øG ð?ÏÉÕ3<0ð?à.'Êñ?›–¢Îu-ö?PåV²Ë÷?¯Ë(ûù÷?R¸…F>ö(\Ÿ+«µ>¥p=ÂØ,Ú>†ëQ[Tû>âzTD§„?R¸>êœë/?¸mÃ2@?33ÛTŸfG?ö(\Ÿ+«µ>)\Óà>®ÇMªæ?HáÚšþÎ)?= 'õWI?*\“³xšc?q=ðÝv2v?]7‡7?¥p=ÂØ,Ú>®ÇMªæ?ffƒ@Û0?ffBS`¥V?gfy?]Ïל>—?efË—Zä­?5`»æ¸?†ëQ[Tû>HáÚšþÎ)?ffBS`¥V?\M§o?š¹—ŽuΦ?]_õê§Ç?¤Ö¶Ϫà?›È©N¬ë?âzTD§„?= 'õWI?gfy?š¹—ŽuΦ?2ï¼1êÒ? w2¢Jò?ÂÍ…C’éÿ?q°Ûæc,ü?R¸>êœë/?*\“³xšc?]Ïל>—?]_õê§Ç?3 Ê z5ò?Ímk»×ú?š†Û‹ÐÀü¿¾÷~Äð˜ À¸mÃ2@?q=ðÝv2v?efË—Zä­?¤Ö¶Ϫà?…sÒ™IDü?Ì‚˜±Kö¿…Þä°ÉÀ¸wP‚&ô¿]ʦrQ¿5³vè­|†?p]j웿 þdjÚsð?…„RÔù?€´ßKN Àq|LDcPÀvf~ý4Q@ ‘ˆE@>[@7<Ú²?RFˆvÓPå?»}ì¬r• @È´ S  @¼`4"(HÀù ÕDÉ@@êö*ú^PJ@7uJ C/ÀJb¤¡zŽ?Yõ/åè?‰·pJ«&@Sw¶ n/ÀSìçÕeOKÀ-lc¡ÔòZ@$áÕÝG¦À ¨nñ˜EÀFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((16,8) (23,15) (0,0)) 7 –‹ëÖ;(?°Œþ¬V-4?À½Ý¤±­;?€`¸ªæî8? ;d=/?à:/N»'?€I¸Z ?‹”4Ûü>`gš h'1?(*(ûmD?Hý&ÖTG?@Q‚ŒúA?pº*34?à{ãØž"?!ðS†ö>n}»ôc¿ Û¶æŠ?êT|œa‚?Möò¿Õs?T=¾ìg.c?äÃ(£ U?Èw3rH?0Ä㉠??ðU.ï‘C3?vHUÓ±?¸)¥¼/§?>"äû)“?/¹amñ«w? Çís`?8N&2›KM?4Rº–ß@?`‰÷°sÚ0?ãÅÛU ¨±?î†ä[¾±?{¬`£å¨?Ð+Ñ¢—‘?¢ó•fZ†h?„HIæUS? `jŠjA? Þ*-—}.?˜Å‚ñ 7’?¼êÔâˆè›?æõH|%r¡?@)aT—?Îm°A:?äbY. )e?ôñÆè=?€¸Š™qf¿9wK:7?Àú1Š•ƒb¿àÕÚó¹x?²‘Žì%›†?=Uݼ¯*„?Ì·#’‹k?ÜÍL2èU¿ ccâª=¿d)¹žñÿï?Ôü£¨õÿï?úòúÿï?¾.%Ùýÿï?½ÝUÿÿï?ÐPlÕÿÿï?„›÷ÿÿï?j»_þÿÿï?ú´øQÿï?`ƒUÞˆÿï?ÒÉÇÆÿï?âŒÊâëÿï?úòúÿï?¸VÐþÿï?Dw4Èÿÿï?„›÷ÿÿï?l5>Ð÷ï?ˆx5Àúï?VæªßÁýï?ú´øQÿï?vèFä×ÿï?ìx…øÿï?¸VÐþÿï?ÐPlÕÿÿï?Šù § ï?dƒ™¨“Çï?ÆCU2ëï?ˆx5Àúï?"»zÿþï?vèFä×ÿï?úòúÿï?½ÝUÿÿï?fJ?(ù©ì?¼)õ^¾íí?‰y’?Dï?ªádÎ×ï?ˆx5Àúï?ú´øQÿï?âŒÊâëÿï?¾.%Ùýÿï?ŵڨQç?â3 é?ì;¿¬ì?Šy’?Dï?ÆCU2ëï?VæªßÁýï?ÒÉÇÆÿï?úòúÿï?ÂОq9„å?IƒÐ÷ï?ú´øQÿï?d)¹žñÿï?ð?è?Ð?ð?ð?ð?ð?ð?ð?r¦¦0ð?[­¯+ð?Â|ñ·ð?&{mð?D#Uð?´×Ið??²xð?K"Ðð?Ph˜Wð?ͳ‘;ð?*Äjœð?â ¡ ð?Â|ñ·ð?EþÔ—ð?Äåð??²xð?‹øG ð?ÕÝ´f ð?éIJ$ð?Ph˜Wð?˜®õ ð?@#@½ð?EþÔ—ð?´×Ið?ÏÉÕ3<0ð?ûÈTBhð?¢aæœm ð?ÕÝ´f ð?mº¦F€ð?˜®õ ð?Â|ñ·ð?D#Uð?/7Eš%çñ?ˆ‰Òe ñ?˜bP×`ð?2cÖ;ð?ÕÝ´f ð?Ph˜Wð?â ¡ ð?&{mð?§ u/ñýõ?¶a¥xê€ô?TËoÃ$æñ?˜bP×`ð?¢aæœm ð?éIJ$ð?*Äjœð?Â|ñ·ð?PåV²Ë÷?úÜTãC÷?$x b›ô?!âî­ñ?ûÈTBhð?ÕÝ´f ð?ͳ‘;ð?[­¯+ð?¯Ë(ûù÷?PåV²Ë÷?›–¢Îu-ö?à.'Êñ?ÏÉÕ3<0ð?‹øG ð?Ph˜Wð?r¦¦0ð?33ÛTŸfG?¸mÃ2@?R¸>êœë/?âzTD§„?†ëQ[Tû>¥p=ÂØ,Ú>ö(\Ÿ+«µ>R¸…F>]7‡7?q=ðÝv2v?*\“³xšc?= 'õWI?HáÚšþÎ)?®ÇMªæ?)\Óà>ö(\Ÿ+«µ>5`»æ¸?efË—Zä­?]Ïל>—?gfy?ffBS`¥V?ffƒ@Û0?®ÇMªæ?¥p=ÂØ,Ú>›È©N¬ë?¤Ö¶Ϫà?]_õê§Ç?š¹—ŽuΦ?\M§o?ffBS`¥V?HáÚšþÎ)?†ëQ[Tû>r°Ûæc,ü?ÂÍ…C’éÿ? w2¢Jò?2ï¼1êÒ?š¹—ŽuΦ?gfy?= 'õWI?âzTD§„?¾÷~Äð˜ Àš†Û‹ÐÀü¿Îmk»×ú?3 Ê z5ò?]_õê§Ç?]Ïל>—?*\“³xšc?R¸>êœë/?¸wP‚&ô¿…Þä°ÉÀÌ‚˜±Kö¿…sÒ™IDü?¤Ö¶Ϫà?efË—Zä­?q=ðÝv2v?¸mÃ2@?ì±ì%¹¿qÞçrÎ{? Þ“®ô$U?ÖÕš–ä˜/?äE\§÷#@„ Ѐlƒ@£·IpïX@oU^Ü"è?õN­‰ìÇ?!Éòt£?Úq)_{?‡ïc R?ÊæEðÏ3!ÀÉjÑbóa @ùÄVÅ@:â|Ÿï @“!Ùvù©ï? laøãÇ?nÆ7T7Ÿ?^ä†×êxs?…XRÀm1*2XvQÀ~H×ðe2ÀÓ]èÌ\·@–Å´Øô´ @乿¡•óç?àÓ^éQm½?We„FÅ?. ²F@>[@zE}ý4Q@8­ÜKDcPÀ{ïŠS3Àct«²Àç@j¿rLò¸@;W¸iÌ'Õ? ²@š w¦?„9 C/Àh3Lü^PJ@ORäÓDÉ@@°ƒ;!(HÀÝ?ÖM  @;®r• @)ä¡sÓPå?äÞÙ²?°âUò˜EÀψñ H¦À¿°¢ÔòZ@•H$ÔeOKÀ¤èp!n/À*KÃkJ«&@=ï/åè?Œ)饥zŽ?ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/Level_0/0000755000175000017500000000000011634153073023310 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/Level_0/Cell_H0000644000175000017500000000175411634153073024370 0ustar amckinstryamckinstry1 0 7 0 (4 0 ((0,0) (7,7) (0,0)) ((8,0) (15,7) (0,0)) ((0,8) (7,15) (0,0)) ((8,8) (15,15) (0,0)) ) 4 FabOnDisk: Cell_D_0000 0 FabOnDisk: Cell_D_0000 3664 FabOnDisk: Cell_D_0000 7329 FabOnDisk: Cell_D_0000 10994 4,7 -0.000515868739177496,-0.000499603652128494,0.674956137837598,0,1,-1.4029701398958,-33.1066281197677, -0.0533939061018113,-0.000499603652128371,0.674956137837598,0,1,-1.4029701398958,-33.1066288011939, 4.34752190342043e-06,-0.0365143364181367,0.6704599494051,0,1,-1.43409920413226,-10.2021310938288, -0.0422047288667324,-0.0365143364181367,0.6704599494051,0,1,-1.43409920413226,-10.2021303974071, 4,7 0.0533939061018109,0.0625563849454135,1,1,1.48176650142808,1.0592071438577,9.97396025068332, 0.000515868739177622,0.0625563849454133,1,1,1.48176650142808,1.0592071438577,9.97395864002901, 0.042204728866732,-0.000304511996097596,1,1,1.49151340193743,0.844777470521823,6.73684612479014, -4.3475219034207e-06,-0.000304511996097627,1,1,1.49151340193743,0.844777470521823,6.73684774808615, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/Level_0/Cell_D_00000000644000175000017500000003450411634153073025022 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (7,7) (0,0)) 7 À—‡Ñ‰«¾‚ ä¯hоc½WÂæ¾/,ìPq÷¾ÀiÛãÏÔ¿€Ç²½Ê^¿€lÄÊ¿qJÀÓð¾ þ9¥>pëÏ q¾„`Ú¾yCk'Iõ¾€Ïjüf¿@Ø Bò©¿€¦­Ø-¿ÙÂÄú¾æEèÐ>[”q1Šã>ÒmÙ>úúššè¾ÃT—x ¿`ðýØè¿€ÁºÀr÷¿\ · ¿¤_«—hå>€ÆËÁü>€²Á=©F?€¶eú©ð>@çäµ ¿PÃ$¿¹É#¿¹§’»-¿°ªÄU^ ¿€È)T»ô>ÛhWМ ?`HwY¨? €‰@Ÿ?@³kjYð¾ÀÖznzB,¿ÚÞ®kç@¿¹, ¨“6¿€_4\Ý?H|Ã>?À¶œæÇ$?Qu_9 +?`•Ùj>´&?d–›­½>ØU€¸4¿H2n&)ú;?€‚[œw?€b "?*b00?¸, ï-9?4`(JÒC?/ïäf\?º|zEßB“?8ß2©Þý“?]4Ÿ0 ?€˜ÅÉ1Ï%?°èïЋ3?`z´¢„??Àñj ¹Q?ÙN”mƒ?Z¤1rV«?ÐÈIE8’?xLµ@Ѹ>\A›MWÆ>”è™$¾Ò>!¡ì×>ÒۈЫÓ>€ 8þ%>bÓ0 {ܾxQNê¾ØWÏ3KË>Öî<ÍçÞ>÷·™7Oí>€a‘ûKMô>žŽPaò>(³ô„ºÊ>€I} Ëö¾À˜úç‚¿Gf‚¥®>Ÿ†Âä>€àɦçù>ÀZ]Ž?@âÎÞz?€<"ñ>@#ìAÆ.¿ ö×vªÎ¿ÝW‡+å¾õœûbÖ>ƒ.˜]?€.çxf?À‚d;“n?À4IŒ–?àÿðoû¿ ÿŒ¿*¿Ú£Àš'¿ý¯VIšë¾Àôsqòæ?€uô´?àË ",?Na·’1?¢‹«Ÿ^ð>š¶e¬ú^@¿`®¢¿4…Çû%¿]ÓFóâ>ÏÛðÒ!?Ü¡<27?”]ÙI?î;Æ‹äš`?Ehs»*w?ð™aŸ %¿ë›(J"¿$~Ùš…¿@`s³‘u ?àwAtÐ<9?¿Óiü\?‚ų_A-—?û±°?˜Î9,/£1¿8ïXiÏÝ0¿ `_†/¿Ïñ$t-¿øN=ȸ>7¿ê„V÷'¦x?úí-ÿ.í’?¦Æ†?ð?ð?ð?ð?öÿÿÿÿÿï?Ãÿÿÿÿÿï?$ÿÿÿÿÿï?Vþÿÿÿÿï?ð?ð?þÿÿÿÿÿï?Ãÿÿÿÿÿï?¾üÿÿÿÿï?¢åÿÿÿÿï?²ÿÿÿÿï? ÿÿÿÿï?ð?þÿÿÿÿÿï?Œÿÿÿÿÿï? óÿÿÿÿï? ÿÿÿÿï?Òõÿÿÿï?6úÆÿÿÿï?ˆuÿÿÿï?ð?Ãÿÿÿÿÿï? óÿÿÿÿï?Ôíýÿÿÿï?6úÆÿÿÿï?Ház¦Ú%>{®GázÄ<433333+=\Âõ(Ü~=Ház®ëÌ=p= ×Ó^>ö(\rR>Ãõ(\kè€>Ðಘ> ×£p= =„ëQ¸…s=Ház®ëÌ=> ×£ ð >×£p=Õ0o>]Âq[Š´>¸…ùÄ|ì> ׃·ƒ ?R¸…ëQQ=43333›´=p= ×Ó^>×£p=Õ0o>Ház›ýÅ>âzD«MÂ?®#U«L?43´ýªn?[Âõ(ü€=ìQ¸…´ê=ö(\rR>]Âq[Š´>âzD«MÂ?)\6©ÙŸg?qS5Þ…°?¤Ëj©Ø?gffff.¢=4333Ã>Ãõ(\kè€>¸…ùÄ|ì>®#U«L?qS5Þ…°?+ï¨0ƒòð?â÷wê»ÜÓ¿ö(\ÂQ³=Ház¦Ú%>Ðಘ> ׃·ƒ ?÷(fMÊa°cÇŠù>Ät%µ»S?mÃ*úþª?û¸S”÷#ù?cÜA1×·ÿ?R¡×úÇá"@à“ëªò#@FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((8,0) (15,7) (0,0)) 7 €úpJÀÓð>lÄÊ?@ɲ½Ê^?lÛãÏÔ?2,ìPq÷>h½WÂæ>~ ä¯hÐ> —‡Ñ‰«>ÙÂÄú>@¨­Ø-?€Ù Bò©?€Òjüf?|Ck'Iõ>ˆ`Ú>pëÏ q>@þ9¥¾Àþ[ · ? ɺÀr÷? îýØè?@ËT—x ?Œúúššè>ÒmÙ¾[”q1Šã¾–æEèоœÄU^ ?ͧ’»-?à¹$¿¹É#?1çäµ ?Íeú©ð¾€µÁ=©F¿ÇËÁü¾¦_«—hå¾\·, ¨“6?jã®kç@?ÐÉznzB,?€ºkjYð>À†‰@Ÿ¿ HwY¨¿ÀÚhWМ ¿€Æ)T»ô¾T8n&)ú;¿Øg€¸4?XŸ›­½¾Ð«Ùj>´&¿Eu_9 +¿à³œæÇ$¿ÀF|Ã>¿^4\Ý¿,ß2©Þý“¿Ü|zEßB“¿+/ïäf\¿è^(JÒC¿¸, ï-9¿è*b00¿ðb "¿€‚[œw¿mÈIE8’¿¤1rV«¿„N”mƒ¿ëñj ¹Q¿@€´¢„?¿hêïЋ3¿@™ÅÉ1Ï%¿€]4Ÿ0 ¿{QNê¾`Ó0 {ܾ!8þ%>ÐۈЫÓ>!¡ì×>”è™$¾Ò>hA›MWÆ>ˆLµ@Ѹ>"˜úç‚¿€I} Ëö¾$³ô„ºÊ>ŸŽPaò>d‘ûKMô>û·™7Oí>Òî<ÍçÞ>ÔWÏ3KË> ú×vªÎ¿€(ìAÆ.¿€ <"ñ>€ãÎÞz?_]Ž?€ àɦçù>Ÿ†Âä>Gf‚¥®>p•ÿŒ¿*¿@ñoû¿ :IŒ–?`ƒd;“n? 4çxf?@„.˜]?þôœûbÖ>ÞW‡+å¾&²e¬ú^@¿@aŒ«Ÿ^ð>ˆTa·’1?(Î ",? uô´?@ísqòæ?°VIšë¾Û£Àš'¿“hs»*w?ª;Æ‹äš`?Ê]ÙI?d›<27?À¼ÛðÒ!?3ÓFóâ>À4…Çû%¿€®¢¿û±°?Tų_A-—?IÓiü\?„ˆAtÐ<9?À#t³‘u ? ~Ùš…¿ðë›(J"¿ ™aŸ %¿ð¦Æ†?Mî-ÿ.í’?Ü„V÷'¦x?LU=ȸ>7¿p6Ïñ$t-¿Ðg_†/¿ðXiÏÝ0¿°Î9,/£1¿Vþÿÿÿÿï?$ÿÿÿÿÿï?Ãÿÿÿÿÿï?öÿÿÿÿÿï?ð?ð?ð?ð? ÿÿÿÿï?²ÿÿÿÿï?¢åÿÿÿÿï?¾üÿÿÿÿï?Ãÿÿÿÿÿï?þÿÿÿÿÿï?ð?ð?ˆuÿÿÿï?6úÆÿÿÿï?Òõÿÿÿï? ÿÿÿÿï? óÿÿÿÿï?Œÿÿÿÿÿï?þÿÿÿÿÿï?ð?Žj±ÿÿï?"”Fåÿÿï?4333Ã>ìQ¸…´ê=43333›´=„ëQ¸…s=433333+={®GázÔ<Ðಘ>Ãõ(\kè€>ö(\rR>p= ×Ó^>Ház®ëÌ=\Âõ(Ü~=433333+={®GázÄ< ׃·ƒ ?¸…ùÄ|ì>]Âq[Š´>×£p=Õ0o>> ×£ ð >Ház®ëÌ=„ëQ¸…s= ×£p= =43´ýªn?®#U«L?âzD«MÂ?Ház›ýÅ>×£p=Õ0o>p= ×Ó^>43333›´=R¸…ëQQ=¥Ëj©Ø?qS5Þ…°?)\6©ÙŸg?ázD«MÂ?]Âq[Š´>ö(\rR>ìQ¸…´ê=[Âõ(ü€=â÷wê»ÜÓ¿,ï¨0ƒòð?qS5Þ…°?®#U«L?¸…ùÄ|ì>Ãõ(\kè€>4333Ã>gffff.¢=.ßAÑrö¿Ãó¨PûŒÙ¿/ƒÔLÙ?ö(fMHáz¦Ú%>ö(\ÂQ³=vÆ{úrÑ >Ìë²×3„>Ôú…·6T>À…»ý[>$>kË·ÚyÝ=¸v$N“À=&_Œ_bxl=iB·¹ÁX=ÛFùÉÕú>8 úhü=Ý>7ȰžÓ«>ôΧRH*p>ëVåQa4>xeY{/~å=‰LGÂ= »šœþi=6p‚ T?ì,²9d<5?È_AµwÎ?ç‡3÷ŒîÂ>%{O–“´|>ÞœQ©Å9>Ârä#ƒå=رڔ6hÁ=D«²NZ«?Ûõ›y1‹?D §Õ» T?z  ¾˜è?•¦ê€DÊ>ï1–B·|>ð1‘ý…4>Eÿ”C‚Û=׿¼=â£ù?~K»:Ú?-Á†óÊq¡?›×ê3®]?ð+ÑÊê?öŽØñÂ>Ê=sšò-p>Í«ý.Ü$>­Åäz¤L@q¼‘’”@ÿU(¶ä?r¨a)-s¡?q`qâT?ùßYÒ?íæBÀ›Õ«>B¡®¡åS>‘E•¸õ @;ø6¦@ÀãP“¹Ç@—w&Ï;Ú?5þ_Ò†1‹?cñ|75?ŒC¡|.Ý>k=³CÂ,„>–)õ´ªò#@ÎÜûÈá"@¼|’·Ö·ÿ?’Ýw¶÷#ù?Äñ ½ùþª? Ú"¨»S?&™`°ù>Í„õg >FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,8) (7,15) (0,0)) 7 èKê‘Ø ? ÎÒYÕ'?Û×Öb>4?Èø©F>? KÌCeE?ãMۘƊ?ã5p´Û›¥?Lú¢=rž’?èYÝU ?׌M&?xÊíá`q3?8à«ïB=?ðà*ÒÝÆF?öÅD˜°Ty?†E¶ô|•?f²¿8‹?® ®ì= ?11î $?È?2±U1?( M3·9?0[ò·_B?Hsû*ËT?ä[ÈÙÒv?ì–~qép?U(‘ö?H€ª Z§ ?°„»ªT,?èþ:ä‘^4?Ú^Ïá:?ìú&›©@?ü·fKB? S­Z9-?€)9õ?ð:µX~?öôÊ$C%?0V|`j-?DŸGªA2?Ðnõª¤ð3?À(õ$@1?ð¾ßF_¦?À5Ì…°÷>Àla¤©?ÐÕ½ò«ò?œTê8¤z#?øÃ>¶ ú&?àj`Šl`'?0‚¬\m"?@ÙM“¸ ?à‚vªÂë>ZæwÔ’?°q4z¥?´†Ã•ï?Pd»+?ð9‰Îy?ðm‘½u?€zÖ6†û>×ê ¸<Ò>¸sÂAòê>ý¼òað¨õ>¯ôë!¤=ü>\‚;æÌÿ>ów'#rþ>/L愆ö>$ÄŸkê®à>ÈÑq]n;9¿%é.ð.9¿ðÖ#•A9¿xŽŽ§æ9¿¨¯Ýô3¿ bžD g¿ÏoóH¶¿šNö™ýš¿ÜP$åp@¿äÄh{°@¿Ìqñ÷;;A¿¤*°Mk B¿lWƒY`D¿"úN¥ Rt¿–bc°”¿*ˆ€Ñ²¢¿ ˆ–wD¿ÜIP(D¿üâ™·¦’E¿nÿ W~G¿îÝX—@K¿hך— CY¿?cnuØ{¿Î K ¨1¿dÝ5ðG¿ä br·G¿àŽ&¬ÆI¿Ü k÷iK¿  »öôAO¿:·ÄêëR¿ì‡Ê,X¿\NZÇóÉ]¿òZy O‹I¿âu–é4J¿[ø˜K¿`悃ÕM¿¶2z ŽP¿ bqÏÃR¿Ú¨F×ÔIU¿ªÏÔ9vW¿n>/VVK¿ ß/<ãøK¿xž,ÕBM¿Jí˜Ñø8O¿at×)îêP¿àÇ€ÍuvR¿g=µ~ùùS¿©]BõfñT¿äÊåº~L¿Á*æºM¿öÌ{vAN¿ý¦;\¯õO¿•Á“¿ Q¿ š&§1R¿©ç/½Ú8S¿®uº_×S¿doWôHM¿GmÊ%ŠžM¿ZŒÞŽš·N¿„g#P¿U¬‹‘Q¿Ø7·‰ R¿^FpàR¿™ Íç[S¿Vþÿÿÿÿï? ÿÿÿÿï?ˆuÿÿÿï?Žj±ÿÿï?´Gð1Ôÿï?ÊDZP…èï?¨ÙºUjê?€ lhtå?$ÿÿÿÿÿï?²ÿÿÿÿï?6úÆÿÿÿï?"”Fåÿÿï?@ºÆôÿï?¤ú¡4üï? 4è\Dï?¨ÙºUjê?Ãÿÿÿÿÿï?¢åÿÿÿÿï?Òõÿÿÿï?Ðಘ> ׃·ƒ ?fæ³iVŠ}?H%®¹§à?7¬ÃíÓ¿²{Ïòö¿gffff.¢=4333Ã>Ãõ(\kè€>¸…ùÄ|ì>¸‡ oS?Ö¿ò‹ °?> Ãjë?7¬ÃíÓ¿[Âõ(ü€=ìQ¸…´ê=ö(\rR>]Âq[Š´>ìQˆ0ýg?áz˜•´a?Ö¿ò‹ °?H%®¹§à?R¸…ëQQ=43333›´=p= ×Ó^>×£p=Õ0o>? ×cèÂ>ìQˆ0ýg?¸‡ oS?fæ³iVŠ}? ×£p= =„ëQ¸…s=Ház®ëÌ=> ×£ ð >×£p=Õ0o>]Âq[Š´>¸…ùÄ|ì> ׃·ƒ ?{®GázÄ<433333+=\Âõ(Ü~=Ház®ëÌ=p= ×Ó^>ö(\rR>Ãõ(\kè€>Ðಘ>{®GázÔ<433333+=„ëQ¸…s=43333›´=ìQ¸…´ê=4333Ã>Ház¦Ú%>{®GázÄ< ×£p= =R¸…ëQQ=[Âõ(ü€=gffff.¢=ö(\ÂQ³=”Îê Þ¬™>Mhœ1ŒÆó>³¡\ŠVëM?g¯õ¾v¤?†¶Hò?ËŠã¢À_5ºÝ@Æ¡`ʇò@>ñ(qàz>J 1žÎÒ>ŒÂ 9*? óB}½€?‘‹r¼nÌ?ù;]”@³ÿ º}g$ÀmòC ˜þ?~w¯ÀrJH>¹TÌtÑ.¡>¡“‹rÍô>šÛLnx4F?üTã„!“?,¾þŽ×?ÓfÓî@'QAôRSÀ ?œ‰ >^æ¢òžDc>3y“†øµ>„2Ýѧ?“kçAP?ÒZ“?!nhcnÌ?U÷^Síñ?ã§QDž¡Ó=ZŒŸÊ->tU±3Ép>Ñ“ÜmŽ>Hü cB¤?‚‚_¬Â-F?u¤ßØ €?ßï«Ñ´&¤?ñ‘7ðm»=“tHhË|ß=ÇMîáê2>Îêƒ3ÐÆp>•Á­Îðµ>§ Ž“Áô>ó’„ö*?ŠÂXkM?× 5,.Îc=‚¸«‹ù¼=Wg½Ü×wß=vm€À¸->8…|¥ã‰Š;¸ ¡>²Ÿg–»³Ò>Ø}as˜\ó>Ò 5,.ÎS=óÄ»ñóGf=Hßø—Škº=5 ÏôޤÕ=­™è²¤>'byØH>§Ø •z>Ó]ÙG™>FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((8,8) (15,15) (0,0)) 7 âù¢=rž’¿"6p´Û›¥¿ãMۘƊ¿LSÌCeE¿Hõ©F>¿ˆÚ×Öb>4¿ÐÍÒYÕ'¿ÀæKê‘Ø ¿Ãe²¿8‹¿žE¶ô|•¿ÝÅD˜°Ty¿$ã*ÒÝÆF¿à«ïB=¿pÊíá`q3¿p׌M&¿€æYÝU ¿º–~qép¿î[ÈÙÒv¿`sû*ËT¿ì[ò·_B¿¸ M3·9¿à?2±U1¿ð01î $¿€­ ®ì= ¿pP­Z9-¿ø·fKB¿û&›©@¿¨Ú^Ïá:¿@ÿ:ä‘^4¿à„»ªT,¿h€ª Z§ ¿@U(‘ö¿À¼ßF_¦¿¬(õ$@1¿ènõª¤ð3¿xŸGªA2¿hV|`j-¿@öôÊ$C%¿ ;µX~¿ *9õ¿`×M“¸ ¿ ‚¬\m"¿èj`Šl`'¿Ä>¶ ú&¿ÀTê8¤z#¿Ö½ò«ò¿àla¤©¿@5Ì…°÷¾àxÖ6†û¾Øm‘½u¿ð9‰Îy¿Pd»+¿È†Ã•ï¿´q4z¥¿XZæwÔ’¿€„vªÂë¾ÃŸkê®à¾L愆ö¾ñw'#rþ¾M‚;æÌÿ¾´ôë!¤=ü¾1½òað¨õ¾tÂAòê¾ì ¸<Ò¾ÒNö™ýš¿ìoóH¶¿bžD g¿è±Ýô3¿pŠŽ§æ9¿ÐÖ#•A9¿ %é.ð.9¿àÑq]n;9¿3ˆ€Ñ²¢¿¦bc°”¿6úN¥ Rt¿ôWƒY`D¿8*°Mk B¿ qñ÷;;A¿ÐÄh{°@¿ÌP$åp@¿× K ¨1¿]cnuØ{¿¾×š— CY¿èîÝX—@K¿€nÿ W~G¿äâ™·¦’E¿ÌIP(D¿œˆ–wD¿€NZÇóÉ]¿2ˆÊ,X¿P:·ÄêëR¿à »öôAO¿è k÷iK¿ØŽ&¬ÆI¿à br·G¿dÝ5ðG¿ºÏÔ9vW¿ú¨F×ÔIU¿>bqÏÃR¿Æ2z ŽP¿d悃ÕM¿[ø˜K¿Þu–é4J¿ðZy O‹I¿¯]BõfñT¿u=µ~ùùS¿ìÇ€ÍuvR¿it×)îêP¿Rí˜Ñø8O¿zž,ÕBM¿ ß/<ãøK¿p>/VVK¿±uº_×S¿®ç/½Ú8S¿š&§1R¿šÁ“¿ Q¿§;\¯õO¿öÌ{vAN¿Á*æºM¿æÊåº~L¿™ Íç[S¿aFpàR¿Ü7·‰ R¿Z¬‹‘Q¿ „g#P¿bŒÞŽš·N¿MmÊ%ŠžM¿goWôHM¿€ lhtå?¨ÙºUjê?ÊDZP…èï?´Gð1Ôÿï?Žj±ÿÿï?ˆuÿÿÿï? ÿÿÿÿï?Vþÿÿÿÿï?¨ÙºUjê? 4è\Dï?¤ú¡4üï?@ºÆôÿï?"”Fåÿÿï?6úÆÿÿÿï?²ÿÿÿÿï?$ÿÿÿÿÿï?ÊDZP…èï?¤ú¡4üï?´Gð1Ôÿï?i ÿÿï?Ház¦Ú%>ö(\ÂQ³=7¬ÃíÓ¿> Ãjë?Ö¿ò‹ °?¸‡ oS?¸…ùÄ|ì>Ãõ(\kè€>4333Ã>gffff.¢=H%®¹§à?Ö¿ò‹ °?áz˜•´a?ìQˆ0ýg?]Âq[Š´>ö(\rR>ìQ¸…´ê=[Âõ(ü€=fæ³iVŠ}?¸‡ oS?ìQˆ0ýg?? ×cèÂ>×£p=Õ0o>p= ×Ó^>43333›´=R¸…ëQQ= ׃·ƒ ?¸…ùÄ|ì>]Âq[Š´>×£p=Õ0o>> ×£ ð >Ház®ëÌ=„ëQ¸…s= ×£p= =Ðಘ>Ãõ(\kè€>ö(\rR>p= ×Ó^>Ház®ëÌ=\Âõ(Ü~=433333+={®GázÄ4333Ã>ìQ¸…´ê=43333›´=„ëQ¸…s=433333+={®GázÔ<ö(\ÂQ³=gffff.¢=[Âõ(ü€=R¸…ëQQ= ×£p= ={®GázÄ< ¥P7ˆò@‡2¬.Ý@`˜–Ä¢ÀãQ]¶Hò?ÜT.‘v¤?Š*ä¸oëM?X–pÆCÄó>¸ñþ³ô™>ÝYY*˜þ?0Ȭ¢}g$Àïu6”@`°&½nÌ?€?÷Œ½€?/3ó­¤8*?¾ïðWÖÒ>…¯ýGèy>/ÕRSÀîE¡ñÒî@çšÛþŽ×?ÏÔƒ!“?Ï‹„‡^4F?\mPÑ‘Ðô>øÂÚe ÷ >×Çå”—L>ëV7­†·BËd>eºÆ:2à >Ð'WJµ&¤?†ÜèàØ €?±ý„©-F?aÍzt†¦?çtÀšÓ’½>|—Ñíèëq>ÌV€llø>#à œë=lÁ…pkM?¦c®#¶*?á¡­2­Äô>wŸÚrøÅµ>g# ¡~éq>™ß1Ùä$>zó0ø ìñ=꺚œþ™=ýtȆlZó>ÈçšM»Ò>_Èvvê >Ñ]òBÂd>üÂ/ÿð>2æ¥lçñ=_Œ_bxœ=Ó 5,.΃=˜rßÀ†@™>ý°rîÜy>oÙZ\JÆK>ù³ÿ–t&>†³«§ê=_Œ_bxœ=BúÀB‚=Ý 5,.Î3=ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/Level_2/0000755000175000017500000000000011634153073023312 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/Level_2/Cell_H0000644000175000017500000000107711634153073024370 0ustar amckinstryamckinstry1 0 7 0 (2 0 ((24,24) (31,27) (0,0)) ((32,24) (39,27) (0,0)) ) 2 FabOnDisk: Cell_D_0000 0 FabOnDisk: Cell_D_0000 1876 2,7 0.00106651637544972,0.00336517546815918,0.695944373778238,0,1.00172879952716,-3.92553468301437,-141.990195727195, -0.0555030514851603,0.00336517546815836,0.695944373778238,0,1.00172879952716,-3.92553468301437,-141.989929434734, 2,7 0.0555030514851592,0.0870354142350782,0.998274184062618,1,1.43689644988588,2.7311737743106,150.61374688033, -0.00106651637545011,0.087035414235078,0.998274184062618,1,1.43689644988588,2.7311737743106,150.613314295791, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_1/Level_2/Cell_D_00000000644000175000017500000000725011634153073025022 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((24,24) (31,27) (0,0)) 7 O=KyQ?p“îÍ›`?bc¼œ r?Ìá¿—±z?šKdx¤Þƒ?¤ª„c3Ä„? ÁÉÄÕ®}?`i ¹n8n?è:ƒxü'l?HÒËüš:z?¶Š”°£‰?êƒùª ”?¬ubÙù˜?HzÆ^˜?lD´…Ë?@èbçòx?NASSgä‚?ÈÃÂÏ4Ž?XSð–±?¼ûâ0ÿ%¤?¾™7ؤ?Êk|µ¢? ¡x¥„E•?`2‰Eǯ~?F¬Íqþ–?¾Pâæ…š?m©m­EW©?÷é]åj¬?à$òkf¦?œ$ßm³3¤?påü Ÿ–Ž?‰‹å6?ì—ÒH‘k?@’C'-Su?öz± ‚?–Õ§þŽ¥?ˆŠøƒî³™?)Ö?É¢?oæ<ˆäǧ?¸Ì"÷¨¨ª?(™ 0˜s?Šguú˜ýƒ?‡Ô!“?°G$bÿ ?çM’OqBª?¸ãËu±?Ô·´£ô?ìÄ»ñóG¶?҉ð€?iëר‘?{•"úÁ ?Çó‹“«?þàŠ‹f²?%¼ ”„µ?Êݾ#,¶?¤œß´õµ?hÈz’mŒ?’ÀE¢?š­Ú£§?~ÏK{eÁ¯?‡­uõh-°?hŠØí‘®?0Ч‚â«?$±ùr©?Q®Ÿ³Üñï?–ØÙßï?Žù´]*¹ï? Æ×úuï?¦” -Kï?®w7`'—î?š]p‹&î?2¹[)âí?–ØÙßï?('F*7¯ï?Ìh—´¯Jï?®w7`'—î?I‰§l•í?QGyì?ì,6*˜ë?ßåúÁ2ë?Žù´]*¹ï?Ìh—´¯Jï?ðÌòâ>bî?²‡xáì?ßåúÁ2ë?.<ͶÈ}é?µ¢²[yè?RX!iè? Æ×úuï?®w7`'—î?²‡xáì?¡¾2*ë‹ê?µ¢²[yè?K§Lu-ç?Xó,‡æ?´Î¦"-Eæ?ð?ð?ð?ð?ð?ð?ð?ð?EãÇð?Ü\‡•‡ð?éçOæ¹#ð?±×'T1Fð?4#uïzð?–Š0—¼¼ð?I:Ævûð? ôGt1"ñ?Ü\‡•‡ð?r+ggË(ð?0@™pµ\ð?–Š0—¼¼ð? ˜…­ŒNñ?áÙQ^ûñ?; ÁW¸“ò?+¡E&+ëò?éçOæ¹#ð?0@™pµ\ð?r¨·ºáÙð?ñt€ ºñ?+¡E&+ëò?lú²çÒô?œÞ7ƒŒëô?Aî°pTõ?±×'T1Fð?–Š0—¼¼ð?ñt€ ºñ?ýšâRpIó?œÞ7ƒŒëô?¦ eQö?‡`+‰@ºö?8ù¿!‡ýö?ö(cî~н?ÍL¯qÐ?\ï[×±á?IYí»Éï?zÌ¿à]ù?\Õð`Çó@I‡lek¹@qSøa¨@ÍL¯qÐ?3³ùì²á?Ì8¹oú÷ñ? à6ùžý?¸ªÜ¯=@gj{W{åÿ?>>æ‡!Fô?)œù°¦Oç?\ï[×±á?Ì8¹oú÷ñ?H I<ôÜÿ?4Ë›.9ú@(gA= î?\WÍÚ!ñ¿Î ¥A­ÀŠ:ÄÀöÞKYní?ØóÑj™ÿ?öÚ¢qÙ@™ybuv•пg@SÀ ÎÀ*âVº~gÀ¥xŒ;À{oã¶ ÀJ¼pûÔ@eášï˜¢$@§zºÍIÎ$@Ê*àÿŒD7\P:À¹D?åLÀªÙ šRUÀ-+óÕêßWÀ,‚Ox$@¶Ù! —Z%@ZrÓmvÀÂ7ƒ½VFÀrl§ u/UÀå6ÇXEVÀ¸‚‰‚jÀNÀÒ‚º¤Ÿ¤BÀ¯‚Q`Ï#@ÛY0„9;ÀÙ5ßcJðJÀ)ýE¸Z¥YÀvC¤–èOÀPTÊï>k@@`ùf— ‘W@U ‚¼z\@r'õ¦D@ùgñLÀ󮯿aÀ:Ôòä—÷0@7aУÓb@+/(èŒÀb@ÿÒºÚŒ`@ß0°‹š¨U@FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((32,24) (39,27) (0,0)) 7 d ¹n8n¿¿ÉÄÕ®}¿­„c3Ä„¿ðMdx¤Þƒ¿ÀÝ¿—±z¿È]c¼œ r¿@–îÍ›`¿V=KyQ¿€çbçòx¿DD´…Ë¿xzÆ^˜¿ÖubÙù˜¿µƒùª ”¿ÀµŠ”°£‰¿¬ÓËüš:z¿ Aƒxü'l¿€3‰Eǯ~¿¤¡x¥„E•¿æÉk|µ¢¿Š™7ؤ¿Øûâ0ÿ%¤¿ÀS𖱿ÄÂÏ4Ž¿pBSSgä‚¿@‹‹å6¿°æü Ÿ–Ž¿ò#ßm³3¤¿*$òkf¦¿¦÷é]åj¬¿ªm­EW©¿ Pâæ…š¿¥«Íqþ–¿“Ì"÷¨¨ª?øå<ˆäǧ?áÕ?É¢?g‹øƒî³™?|×§þŽ¥?ƒz± ‚? C'-Su?¨ä—ÒH‘k?àÄ»ñóG¶?´·´£ô?¢ãËu±? N’OqBª?K°G$bÿ ?`Ô!“?šfuú˜ýƒ?,– 0˜s?•œß´õµ?¨Ý¾#,¶? ¼ ”„µ?ኋf²?+Çó‹“«?X•"úÁ ?Åhëר‘?À ¶Ò‰ð€?ü°ùr©?¢‰§‚â«?ö‰Øí‘®?¬­uõh-°?ÑÏK{eÁ¯?™™­Ú£§?™‘ÀE¢?Éz’mŒ?2¹[)âí?š]p‹&î?®w7`'—î?¦” -Kï? Æ×úuï?Žù´]*¹ï?–ØÙßï?Q®Ÿ³Üñï?ßåúÁ2ë?ì,6*˜ë?QGyì?I‰§l•í?®w7`'—î?Ìh—´¯Jï?('F*7¯ï?–ØÙßï?RX!iè?µ¢²[yè?.<ͶÈ}é?ßåúÁ2ë?²‡xáì?ðÌòâ>bî?Ìh—´¯Jï?Žù´]*¹ï?´Î¦"-Eæ?Xó,‡æ?K§Lu-ç?µ¢²[yè?¡¾2*ë‹ê?²‡xáì?®w7`'—î? Æ×úuï?ð?ð?ð?ð?ð?ð?ð?ð? ôGt1"ñ?I:Ævûð?–Š0—¼¼ð?4#uïzð?±×'T1Fð?éçOæ¹#ð?Ü\‡•‡ð?EãÇð?+¡E&+ëò?; ÁW¸“ò?áÙQ^ûñ? ˜…­ŒNñ?–Š0—¼¼ð?0@™pµ\ð?r+ggË(ð?Ü\‡•‡ð?Aî°pTõ?œÞ7ƒŒëô?lú²çÒô?+¡E&+ëò?ñt€ ºñ?r¨·ºáÙð?0@™pµ\ð?éçOæ¹#ð?8ù¿!‡ýö?‡`+‰@ºö?¦ eQö?œÞ7ƒŒëô?ýšâRpIó?ñt€ ºñ?–Š0—¼¼ð?±×'T1Fð?qSøa¨@I‡lek¹@\Õð`Çó@zÌ¿à]ù?IYí»Éï?\ï[×±á?ÍL¯qÐ?ö(cî~н?)œù°¦Oç?>>æ‡!Fô?gj{W{åÿ?¸ªÜ¯=@ à6ùžý?Ì8¹oú÷ñ?3³ùì²á?ÍL¯qÐ?Š:ÄÀÎ ¥A­À\WÍÚ!ñ¿(gA= î?4Ë›.9ú@H I<ôÜÿ?Ì8¹oú÷ñ?\ï[×±á?{oã¶ À¥xŒ;À*âVº~gÀg@SÀ ÎÀ™ybuv•пöÚ¢qÙ@ØóÑj™ÿ?öÞKYní?»I¿ôßWÀ¬ 0 # (this one is optional) amr.regrid_file = fixed_grids_6 # file name for specifying fixed grids # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 2 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 0 proj.v = 1 diffuse.v = 0 amr.v = 1 mg.v = 0 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) #ns.sum_interval = - 1# interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 20 # (integer) number of timesteps between checkpoint files amr.check_int = 2 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 2 # (integer) number of timesteps between plot files #amr.plot_vars = x_velocity y_velocity density tracer amr.derive_plot_vars = avg_pressure #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt #ns.fixed_dt = 0.9 # Time step # (this one is optional) #ns.init_shrink = 1.0 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.0 ns.scal_diff_coefs = 0.01 ns.variable_vel_visc = 0 ns.variable_scal_diff = 0 # (this one is optional) #ns.gravity = 0.0 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** # # NOTE: The domain size must be a multiple of 2 for the BCs to work # properly for the viscous benchmark. # geometry.coord_sys = 0 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 2. 2. # physical dimensions of the high end of the domain geometry.is_periodic = 1 0 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 0 4 # boundary conditions on the low end of the domain ns.hi_bc = 0 4 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING & SOLVER CONTROLS (these are optional) #********************************** amr.blocking_factor = 4 # factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for convergence with this problem mg.usecg = 0 mg.nu_f = 100 # USE THIS ONLY FOR TESTING #amr.max_grid_size = 64 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/inputs_1_rz0000644000175000017500000001370311634153073022707 0ustar amckinstryamckinstry# NOTE: all the values here must be set unless specifically # marked as optional #********************************** #ALGORITHM CONTROLS (defaults shown; these are both optional) #********************************** proj.proj_2 = 1 proj.filter_factor = 0. ns.init_iter = 2 ns.do_MLsync_proj = 1 #********************************** #RUN CONTROLS #********************************** # MUST SET ONE OR BOTH OF THESE. max_step = 1 # maximum (integer) number of time steps stop_time = 2.0 # maximum (real) time (in same units as dt) amr.n_cell = 16 16 # indices of the domain at level 0 # (this one is optional) #amr.restart = # set if starting from a restart file, else comment out # This will default to file "probin" if not set amr.probin_file = probin_1 #********************************** #ADAPTIVITY CONTROLS #********************************** amr.max_level = 2 # maximum number of levels of refinement amr.regrid_int = 2 # how often to regrid if max_level > 0 # (this one is optional) amr.regrid_file = fixed_grids_1 # file name for specifying fixed grids # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 2 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio # # Only call LinOp::ApplyBC() on alternate calls to LinOp::Fsmooth() # from within LinOp::smooth(). This is not theoretically correct but # can cut down fairly significantly on communication overhead when # running in Parallel; especially so for periodic problems. # # 0 is false and 1 is true # Lp.alternateApplyBC = 0 #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 1 proj.v = 1 diffuse.v = 1 amr.v = 1 mg.v = 1 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) ns.sum_interval = 5 # interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 50 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 1 # (integer) number of timesteps between plot files #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt # (this is optional) ns.init_shrink = 0.1 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.01 ns.scal_diff_coefs = 0.0 ns.do_temp = 1 # (this is optional) ns.gravity = 9.8 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** geometry.coord_sys = 1 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 1. 1. # physical dimensions of the high end of the domain geometry.is_periodic = 0 0 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 5 5 # boundary conditions on the low end of the domain ns.hi_bc = 5 2 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING CONTROLS (these are optional) #********************************** amr.blocking_factor = 1 # the factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for multigrid convergence mg.usecg = 1 # USE THESE ONLY FOR TESTING #amr.grid_eff = 0.9 # grid efficiency in the grid creation algorithm amr.max_grid_size = 8 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/probin_40000644000175000017500000000021511634153073022140 0ustar amckinstryamckinstry $fortin probtype = 7 xblob = 1.0 yblob = 1.0 radblob = 0.4 denfact = 1.0 velfact = 1.0 adverr = 0.5 vorterr = 10.0 $end ccseapps-2.5/CCSEApps/iamrlib/test2d/probin_20000644000175000017500000000023311634153073022136 0ustar amckinstryamckinstry $fortin probtype = 6 xblob = 0.5 yblob = 0.5 radblob = 0.1 denfact = 1.5 adv_dir = 1 adv_vel = 0.0 adverr = 0.1 vorterr = 5.0 $end ccseapps-2.5/CCSEApps/iamrlib/test2d/README0000644000175000017500000000704011634153073021364 0ustar amckinstryamckinstry In this directory are six sets of inputs, probin and fixed_grids files which are used to test different grid configurations and problem set-ups. The grid configurations are in files fixed_grids_1 through fixed_grids_6. Associated with each is a set of inputs files, inputs_1_... through inputs_6. and probin files, probin_1 through probin_6. There is also a plot file (plt0000_1 through plt0000_6) for each grid configuration so you can see the grid configurations. ****************************************************************************** fixed_grids_1/{inputs_1_xy_xper, inputs_1_xy_xsolid, inputs_1_rz}/probin_1 : 4 level 0 grids, 2 level 1 grids, 2 level 2 grids. This is the only case with multiple level 0 grids. It also has level 2 grid boundaries overlaying level 1 grid boundaries overlaying level 0 grid boundaries. None of the fine grids touch the physical boundaries. Refinement ratio: 2 and 2. The problem is based on inputs.2d.hotspot, and has nonzero divu. This can be run with x-y with solid wall or periodic in the x-direction, or r-z with solid in the r-direction. It uses solid wall in the low-y direction and outflow in the high-y direction (must use outflow because divu != 0). ****************************************************************************** fixed_grids_2/{inputs_2_xy_ysolid, inputs_2_xy_yinflow, inputs_2_rz_zsolid, inputs_2_rz_zinflow}/probin_2 : 1 level 0 grid, 2 level 1 grids, 3 level 2 grids This is the only case set up to test inflow. One of the level 1 grids and two of the level 2 grids touch the low-y inflow face. This has a level 2 grid spanning a level 1 grid interface. Refinement ratio: 4 and 2. The problem is based on inputs.2d.hotspot, and has nonzero divu. This can be run with x-y or r-z, with solid wall in the x-direction. It uses solid wall or inflow in the low-y direction and outflow in the high-y direction (must use outflow because divu != 0). ****************************************************************************** fixed_grids_3/{inputs_3}/probin_3 : 1 level 0 grid, 3 level 1 grids, 3 level 2 grids Refinement ratio: 4 and 2. The problem is based on inputs.2d.hotspot, and has nonzero divu. This should be run with x-y and periodic in the x-direction, solid wall in the low-y direction and outflow in the high-y direction (must use outflow because divu != 0). This is especially useful for the periodic grid interfaces. ****************************************************************************** fixed_grids_4/{inputs_4}/probin_4 : 1 level 0 grid, 5 level 1 grids Refinement ratio: 2 The problem is based on inputs.2d.viscbench, and has divu=0. This is doubly periodic, and is useful for testing periodic interfaces as well as different types of corners (inside, outside, diagonal). ****************************************************************************** fixed_grids_5/{inputs_5}/probin_5 : 1 level 0 grid, 7 level 1 grids Refinement ratio: 2 The problem is based on inputs.2d.viscbench, and has divu=0. This is doubly periodic, and is useful for testing periodic grid interfaces. ****************************************************************************** fixed_grids_6/{inputs_6}/probin_6 : 1 level 0 grid, 4 level 1 grid, 3 level 2 grids Refinement ratio: 2 2 This problem is based on inputs.2d.viscbench, and has divu=0. It is periodic in the x-direction and has some nasty level 1/2 and level 0/1 interfaces. It is useful for testing periodic grid interfaces. ****************************************************************************** ccseapps-2.5/CCSEApps/iamrlib/test2d/probin_30000644000175000017500000000023311634153073022137 0ustar amckinstryamckinstry $fortin probtype = 6 xblob = 0.5 yblob = 0.5 radblob = 0.1 denfact = 1.5 adv_dir = 1 adv_vel = 0.0 adverr = 0.1 vorterr = 5.0 $end ccseapps-2.5/CCSEApps/iamrlib/test2d/probin_60000644000175000017500000000021511634153073022142 0ustar amckinstryamckinstry $fortin probtype = 7 xblob = 1.0 yblob = 1.0 radblob = 0.4 denfact = 1.0 velfact = 1.0 adverr = 0.5 vorterr = 10.0 $end ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_6/0000755000175000017500000000000011634153073022027 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_6/Header0000644000175000017500000000067511634153073023152 0ustar amckinstryamckinstryNavierStokes-V1.1 5 x_velocity y_velocity density tracer avg_pressure 2 0 2 0 0 2 2 2 2 ((0,0) (63,63) (0,0)) ((0,0) (127,127) (0,0)) ((0,0) (255,255) (0,0)) 0 0 0 0.03125 0.03125 0.015625 0.015625 0.0078125 0.0078125 0 0 0 1 0 0 0 2 0 2 Level_0/Cell 1 4 0 0 0 0.625 0.5 1.3125 0 0.625 1.3125 1.875 0.625 2 0.5 1.25 0.625 2 1.25 1.875 Level_1/Cell 2 3 0 0 0 0.0625 1.03125 1.25 1.6875 2 0.84375 1.5 1.9375 2 0.65625 0.84375 Level_2/Cell ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_6/Level_1/0000755000175000017500000000000011634153073023316 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_6/Level_1/Cell_H0000644000175000017500000000152711634153073024374 0ustar amckinstryamckinstry1 0 5 0 (4 0 ((0,32) (39,83) (0,0)) ((0,84) (39,119) (0,0)) ((40,32) (127,79) (0,0)) ((40,80) (127,119) (0,0)) ) 4 FabOnDisk: Cell_D_0000 0 FabOnDisk: Cell_D_0000 83283 FabOnDisk: Cell_D_0000 140967 FabOnDisk: Cell_D_0000 310012 4,5 -0.820745752384455,-1.08568156818227,1,-0.999397728102586,-0.647695982131901, -0.295546378255923,-0.668514744352368,1,-0.534836488606416,-0.247881108718458, -0.820741934087456,-0.992840405029409,1,-0.999247228147206,-0.647888758213826, -0.82094550196596,-0.736541803734664,1,-0.913934412817363,-0.360381236409654, 4,5 0.721498028738397,-0.0057449324832142,1,0.359786642878653,0.316529354315427, 0.820857747863581,0.274337623343143,1,0.913934412817363,0.306125090658241, 0.820758681654585,1.08569133589331,1,0.999397728102586,0.279130601597899, 0.820906871975203,0.805428944386376,1,0.913934412817363,0.313446770952945, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_6/Level_1/Cell_D_00000000644000175000017500000156052211634153073025035 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,32) (39,83) (0,0)) 5 @ŸZËé¿‚µ~âä¸é¿4¹é¿TÀÄKgé¿[x21é¿´=á!×è¿€7Ž†è¿ƒ·¼$• è¿}sâRqŸç¿dèèÆÕç¿j _~æ¿¥œÿ;_¿å¿ Ô{VF%å¿©`žgJHä¿Cˆ]T˜ã¿ÛXß74Ÿâ¿Ÿ…ðÛῳwÞÉ4Èà¿ê´’±—ãß¿`r‘ºªÝ¿,Í×ÅjÂÛ¿‘zjY FÙ¿Í\׿CQnŽ¾Ô¿iîÿ–½Ò¿¹åпú£¢ÀXà˿ٛüxó@ƿֳnSɿղ¢ö‰¸¿zã ç\Ó¯¿ ô­øV‘¿jó}ÞÄU‘?*K‹q2Ó¯?޾ቸ?ûÏ”ò¾Â?ßtµlé@Æ?h•“ÐNàË?^2LZÐ?÷Þ/X’½Ò?Yî†-( ê¿ðô¹±·ùé¿b ¬ÚpÚé¿z›U@©é¿Zð/§újé¿á|î‚é¿áÚu×¼è¿h¦Ä áKè¿C÷RµÑç¿ÔÚ/uWBç¿ôeËØ«æ¿Ý¨4;uÿå¿H çNå¿IÀÁÍV†ä¿¸úû7λ㿎°üžÚâ¿”ø§Þøá¿OÿÁiá¿@&H  à¿l‡Í¸•øÝ¿(å~®åÛ¿çÈÃs¦Ù¿ÖØÇ¸Us׿rŠ·Õ¿åß^,,ÇÒ¿ ‘»OпjüaÅmÙË¿ßÛVÄÆ¿”%ÚßÁ¿e Ag*b¹¿ú­šÓ访<ÚñðHô“¿\8‰žëó“?Êv%¥è®?Ï lb¹?êI¼ÎßÁ?ÈÂKÄÆ?Ø)ëbÙË?™_O¶OÐ?s>›'ÇÒ?]ƒlÈR2ê¿*"à"ê¿Ã¢Ôê¿þÐHZÑ鿚ºŽùŒ‘é¿@®…/8Aé¿À.Ÿ âè¿Îû¹h¨rè¿ùçeë.õç¿U¥ÚÐgç¿ü¡ùu@Íæ¿ÿ ßXD#æ¿‚pŸamå¿ûw#¨ä¿è0ß$!Øã¿××Áú⿽BøC;â¿vË„=á¿‚ÏÇà¿W¿¾h,Þ¿É(O' Ü¿ž[NŽòÓÙ¿BÆÍ_›‘׿–¬Ü Ï;Õ¿+ªô ôÝÒ¿7ÝiRoп(´âŸ‘÷Ë¿‡ž~ƒ ôÆ¿eÇg¼GîÁ¿Ð¼´¤¹¿0ɼ/#㮿ˆùT~d~”¿ìp}Šþ}”? yrðâ®?k>™“?ÊCïX;îÁ?.­\”ôÆ?h¼3Á…÷Ë?íÆZLoÐ?µ®évîÝÒ? Oš˜ŒCê¿NÔŸ_3ê¿\{ °ê¿SpÿGžâé¿pð'ìF¢é¿7¾uRé¿rH«Còè¿K ±ù‚è¿[_šú¼è¿#ë~wç¿Ô<8þÛæ¿ =½(2æ¿X—±ãzå¿$R¦¶ä¿“ "*Ôä㿳Ì¿ú㿘K„Ÿâ¿ñ•íò(á¿r¾…ó)à¿Ò}îe9AÞ¿œ‡[ ©Ü¿ým’ÂõåÙ¿Ð}ÁF ×¿ö Ž}ØJÕ¿Â/^PéÒ¿¹ð’<{п¬Œ–ÉÌ¿ÕSœÙüÇ¿ ÀÖ÷Á¿_¹¹?©Ü¨‘È÷Á? Ù‚™ïÇ?$á|)¼Ì?wOTG6{Ð?2dFJéÒ?ü§¤´>ê¿ÐU4eø-ê¿;¬¯ ê¿Ø ‚ NÝé¿V>1úœé¿Ö"ÔLé¿{Ñíè¿ôœ õ}è¿G€Í¾ÿç¿l´ñõ²rç¿ÙµJr:׿¿Îº™¡-æ¿\>Òcfvå¿NH½â±ä¿Žœ”•¨àã¿3/¬˜ã¿ü›Ké⿪«–{%á¿3Wv—‰&à¿HËd£#;Þ¿$”Ð(±Ü¿¢ÄãÈàÙ¿Ê”‘›×¿{“¢G¡FÕ¿cñ\:åÒ¿M,©jxп 8G”ŸÌ¿ÁYˆžÇ¿ÞT5¾óÁ¿»ÌM^󴹿FÂg;i殿òÓT#”¿%ÿŽZªœ”?«ö+-æ®?™)Õ´¹?µK‰¯óÁ?[$Ç??"‘Ì?+>[’þwÐ?Î*(¼3åÒ?šÛ‡ÜX"ê¿g³P꿈Hž1+òé¿6>ZéþÁé¿îYiìé¿•6ÿÃ2鿈!9!ÁÒè¿Ò¿‹ãdè¿¡>Áaæç¿áñÈpíYç¿{lá¿æ¿ó‹Êx3æ¿,“Zµ_å¿dÑ~œä¿¥:¹‘£Ëã¿øœ¸t ï⿼çÄâ¿ò‹ü_á¿„.btà¿ò}”7Þ¿´­ÝúøÛ¿Eƒ‹£vÅÙ¿0õ¾˜‚׿!ÐЫ,0Õ¿J(J:ÑÒ¿@š*Ï¥fпîqlÞõãË¿± Ïð^éÆ¿ò0±“´àÁ¿Qá:뙹¿€¹~Å®¿ï”ï燔¿.¿´e‡”?‚+š=Å®?óÊõØÊ™¹?“Úߪ¤àÁ?+ÔµROéÆ? ò›æãË?#8‹cžfÐ?ºb5Ø2ÑÒ?F|(z±ðé¿’Y,ŽÓà鿺àÓ£íÀé¿æ ñ‘é¿Ú°ÿù~Q鿞"—ÚC鿞z&$œ£è¿Ü€´gÂ5è¿ÒA÷ú¸ç¿«ioO’-ç¿fãÞ“æ¿8CNÙ>ìå¿€¶#7å¿m –¾ßtä¿I:ú"¦ã¿³À:Ëâ¿÷$b…äΌ“_ïòà¿„~žÙËíß¿d‡I âÝ¿"š”FÕÃÛ¿$¨ç‚”Ù¿Ž'YöjU׿®°õíÕ¿,1y¦y­Ò¿«—SGпÒIõã÷®Ë¿¡x=ܽƿ«UÁ¼¾Á¿ nÜOi¹¿v+Ž‹®¿b!ô”a”¿.!9öv`”?~âŒºŠ®? ˆãñ,i¹?þ pʪ¾Á?ù…˽Æ?–\‰bç®Ë?×i¹MwGÐ?½Fãq­Ò?æÅ'£©é¿ˆ£h¢þ™é¿ƒ¯a‘jzé¿ÃI Ké¿ÄA^ é¿É$ ¹½è¿ÔªDø`è¿ÀÙeó翚&Éòwç¿NÉ#òîæ¿ˆ€ùUæ¿fEGü$°å¿g Œªðüä¿qæÛÝÊ<ä¿4ü˜'*p㿺ŒZŒ—â¿§Âw³á¿ÓDxÄ࿜\º9C–ß¿mhÇÝ¿½2Ô·wÛ¿–nbNÙ¿üŸÖr׿"¬gFÎÔ¿`‚KEzҿç°Þп© +cË¿œw™„Æ¿ŠÎ°[ŽÁ¿Ïƨ#¹¿fO†gF7®¿/7“0)”¿*Y6‡—(”?ïÎ<ú6®?«Y]‚#¹?—Â9ÂŽÁ?ápYrÆ?§KYcË?;P¸ÖÐ?µêƒíé¿3Ó5|é¿úHe®^ðè¿ÐÚ¦†C²è¿Htnòdè¿Ç„â|™è¿åoínpç¿_ò‘¸#ç¿ݾl¼›æ¿–xdÏ濞çZ,Nb忯—þœ±ä¿×³Ý(ôã¿Â¨K’f*ã¿3QyÒTâ¿Úñ3Gðsá¿Ï7ºŸJˆà¿Àá…²å$ß¿’&Ý¿ ä'r"Û¿ºVJõóØ¿ù¦TšÂÖ¿Ø.ÙÍšƒÔ¿4^4´ô7Ò¿yÛS$ÂÏ¿¦2ÉË¿= ¨Æ.Æ¿øåzäOÁ¿ÞG€pɸ¿òôuÇ×Ê­¿„g$ðÜà“¿1§KÀ7à“?ê]“…Ê­?KœiÉGɸ?·/-ÓOÁ?Õ.òø².Æ?BÜìüµË?®Qß­ÂÏ?ûU†³ë7Ò?óÃ\WÐÞ迸Dâ†Îè¿ï[F¯è¿2?xè¿Ü°É~hDè¿ØŒªløç¿@ãŬ習Ýw`4ç¿Ø=þˆÅ¼æ¿%«‘f&7æ¿ÿÛԣ忇Á*å¿{»rÄ‹Uä¿fƒY›b›ã¿Þ¼"Õ⿹/3Dâ¿æª‘J&á¿7ã \½>à¿$-éÀVšÞ¿VaY'S¤Ü¿Î4…¥œÚ¿£ÇfUŽ„Ø¿"¾6X]Ö¿qñÈW(Ô¿{ʳnçæÑ¿‚C"®Ú4Ï¿n΢ƒ§ˆÊ¿èÊÑÌÅ¿øÆ4Á¿kÂ,[¸¿˜‚ MPF­¿éðõêtˆ“¿i³Ї“?š·¬÷E­?\’€[¸?ªS “ÿÁ?Á4ÝÌÅ?虥ӒˆÊ?xü$Æ4Ï?CJÞÁÝæÑ?Óeµ8Zè¿^Òíz>Jè¿+°½ôé+è¿rÍ¿vÛþç¿Ü…cÃç¿jÞT/®xç¿lm8xÓç¿(Ñ^¸¸æ¿œç í›Cæ¿Ù­4ÅÀå¿8¨¹„0å¿OnÖ73“ä¿£’1éã¿þp^ˆè2ã¿aUõuÈpâ¿Q²<I£á¿ËœäóèÊ࿸¡õI[Ðß¿V]eÙE÷Ý¿¸aÅSµ Ü¿zÝ!ߨÚ¿s̹LêØ¿}íX-æÕ¿,Äyáî¼Ó¿rŽê„‡Ñ¿Ø&n“ŽÎ¿h+Î3Fûɿà _äòWÅ¿ žÃu§À¿³2cfÙ·¿6ê™Wª¬¿Hª i “¿ÞHx%©“?Bt:ø©¬?'|Ø7Ù·?§Šx^§À?°F9ÜWÅ?5[-ð/ûÉ?ØFÕÙ}ŽÎ?Õi‡µy‡Ñ?s™¢ô‡Àç¿]‹²4²ç¿£ ,÷”ç¿S®Þ|!iç¿l kÀÛ.ç¿GŸÞKææ¿ce[žæ¿ÔjÐ)+æ¿ê鯏å¿&ýÅ 9å¿®ÞyFd¬ä¿¤VŽèä¿Ï. Ä mã¿4ãŒ2»â¿9–_Íýá¿ííO5á¿™*/M4bà¿H¾ëý ß¿:‹>n<Ý¿btü¶Ö\Û¿Š~ù5_lÙ¿M*Æ9l׿׮ÜA¢]Õ¿WklÝAÓ¿ÂÙ *8Ñ¿æéñd ÐÍ¿Ï$#}GYÉ¿Dk×eßÒÄ¿7hÍŒŸ?À¿gN4–´D·¿h#h¡ ÷«¿j¬æÄ0©’¿˜°T7b¨’? µVÙ9÷«?Ô˜ ±D·?nÅy†?À? R ÒÆÒÄ?O²‰/YÉ?ŠJ1öÏÍ?†C‰-Ñ?ïVæ§¾ç¿þÉ ‰Óç¿X•|øƒëæ¿ÐeÏwüÀæ¿x€ÏJdˆæ¿õ¬Â¤ãAæ¿°¶â¨íå¿ÖOæ‹å¿ê.`Úå¿PÄ*pÉ ä¿ô€©Èÿä¿Ò,IÀÑ‚ã¿ä‹žQ›áâ¿qç¸ã¿4⿼V8 ª|á¿’–‰R˹à¿ì¶Š¿7Ùß¿â Æ|4+Þ¿ –jÜ¿¬ÄWq˜Ú¿ ,嵨¿ ÙúÍÄÖ¿ÆTHÄÔ¿Õ”d{¥·Ò¿@§¿¿wŸÐ¿2Ä:úÌ¿ã¾Ï}W£È¿Š€–üi=Ä¿¾xÈ–¿¿®eš´¶¿Œ’ALé.«¿9ÁuëJ#’¿_ ‹±l"’?‘¸Ý¶z.«?¹rž×}¶?ª3úÑË•¿?‰ ØŠO=Ä?Æ|ݸ=£È?Ü¥O úùÌ?ü:ÊÀkŸÐ?ŠñÈž7Yæ¿éi%ö§Kæ¿z0˜A0æ¿ã³Eæ¿à˜}ËXÐå¿!iŒå¿.}7²“:å¿[¶øòÛä¿ ¾çrpä¿þS=®Wøã¿Vo¬ësã¿à.DG€ãâ¿ÔËušnGâ¿Å9Ðê á¿s˜oàíà¿èã)91à¿jcüU*ÕÞ¿Œ~Þ4Ý¿œuÃY‚Û¿ÕäPÄH¿Ù¿À€Í!ì׿>äzY8 Ö¿‘Ø·Ô¿•Z]$ÑÒ¿ÇÒ|½пl {z Ì¿M¢¾ø+ÚÇ¿µ–Nù'˜Ã¿ÈˆÞ–”¾¿ÐJH 嵿}ì$úPª¿y4™K=‘¿ÛÄ2VNŽ‘?o“!9ƒPª?ºdcÒäµ?*Cv‹â“¾?Ȇ ˜Ã?Ë®>ÚÇ?áàŠ/_ Ì?úh§•°Ð?ßYÚDn‹å¿‹aRàJ~å¿R¶Ž Ücå¿Û„¢2<å¿NV¸iå¿K'ÏA¤Å俆ϔ wä¿rŽÔä¿ÒŸ®3´ã¿âíöÌk@㿆éÄÀâ¿* 7&‹5â¿ ÍÊ-Ÿá¿ÏÿåíÄýà¿›T1ì÷Qà¿<͈D48ß¿2sÅz7¹Ý¿s»Ù³å'Ü¿¤Çu6…Ú¿\™Œû+ÒØ¿õw–Ò׿a.ÿ@?Õ¿SÕ’aӿʇï›ñwÑ¿²2,¬Ï¿Q—³E# Ë¿Öèô„þÆ¿2I`_¶ã¿ Q!Ž„z½¿å@nµ¿\? ¦^©¿³[×”í¿²s…Í“ì?}†Ö8&^©?†Á.µ?òÀ-"Fz½?©Ä—ãÂ?H§Î8fþÆ?j%A^ Ë?šAâøÏ?Ô­ä¿'ÛðÉj ä¿Èž¹l‡ä¿È¡½õ`ä¿xæÏìM.ä¿ã_0ïã¿#w Å£ã¿vyÀE;L㿪Éèâ¿bû\Ÿ­yâ¿ð»)4,ÿá¿`~c‘yá¿pœlŒ.éà¿w áë]Nà¿Þ;¥OýRß¿”ö·íìõÝ¿Fh=b†Ü¿­¯8L?Û¿2îƒPrsÙ¿8+ÜåòÑ׿p`Â!Ö¿‚þ÷ÖëcÔ¿? ½™Ò¿¤ûžÃп2Àp¾ÊÆÍ¿YE/úóÉ¿5Ú÷'Æ¿ìÅ쥹 ¿W8çV:J¼¿žÖ/¾ŽA´¿üf½áÉX¨¿uGä>¿7@YnÐ=?œƒ™‘@X¨?¢V³JA´?`y`:÷I¼?>Ḙ Â?ž-ØÆ?5} ÛóÉ?iȬÆÍ?:˜Èà¾ã¿!JvŲã¿m^ ‚šã¿Ao\š$vã¿Qù9‘ÃEã¿&Ýò9} ã¿P›»MwÁâ¿@ǶÞmâ¿£}¥dç⿼3̤á¿oa^ÇÎ/á¿'aj7°à¿p‘æT&à¿ÎN.¯ø$ß¿ àÈñêÝ¿ú!Þ·œÜ¿úü¸=Û¿RF@*ëÍÙ¿#Nî3NØ¿§¿Ö¿ü7U‰Â"Õ¿ö€ÞüxÓ¿×a¯4ÃÑ¿c·“ÿwп=ì«$·oÌ¿‚ „„ôÈÈ¿˜€£èÅ¿àMsÝOÁ¿.ŒÐI»¿°l´/X³¿ùKø2L@§¿Äëj5Œ¿€ /<?)ÌâŸ?§?HFæW³?Ÿ¦ã®»?fš?ºOÁ?~ç‚ ÆÅ?"œ›òÒÈÈ?ÎÍ–oÌ?æK‘¨Áâ¿tˆ\®#¶â¿1Ý@­Ÿâ¿oW5†|⿨H$bNâ¿üþ, Nâ¿3Ó9uäÐá¿”Û’Q|á¿WÃûgG'á¿Þ[eŠ}Âà¿7ø"]Sà¿2$U´ß¿\ÂÊ«a®Þ¿wæÍ¨•Ý¿tiµRbjÜ¿ùÃ8¼-Û¿IjpµRàÙ¿D²ævó‚Ø¿ºæÛv׿èï(»›Õ¿•;ˆ¬Ô¿»ó;Ò¿ßbßп|GYŽCjοsxæ%ÿË¿¤dRã‹Ç¿úA3jŸÄ¿i$ªQÔqÀ¿!P~šÉ©¹¿Ès¢`²¿µ¸Ç¦¿^@/´y¿–']û8w?;Þ‘›~¦?é³1.È_²?Rq|©¹?’"ü:®qÀ?û’·*zÄ?œZ ®íŠÇ?̹2ÜË?Ož÷Ó;¶á¿†ì‰óV«á¿¸“tŒ•῵Obétá¿Z5WŒIá¿:(Ìoá¿´îß¾ÔÒà¿+Ïhþ؇à¿]S¢ª2à¿9Âù”ü¦ß¿··~ÕÞ¿æ&ã•9ðÝ¿‚½'ÞøÜ¿fO¨Ý£ïÛ¿ Uéb.ÕÚ¿Þ“Áÿ+ªÙ¿°dƒ.UoØ¿èC*l%׿Í4lw<ÍÕ¿ò¶‹fšgÔ¿Pøž‘bõÒ¿+=TywÑ¿=à}”ÝÏ¿gÜ) ¸Ì¿ƒ>ÙÒÉ¿ 5V[;Æ¿°\˜¦-ç¿4TDî¿¿.~œÚ;¸¿„F85Z±¿$ä3@4Û¤¿<VAŒÕ‹¿B§ƒ‰ãÒ‹?Vb±ŠÚ¤?~"€ÀY±?0‡¹j‡;¸?@T‚ß\¿?J]‡‹çÂ?™êýE4;Æ? G1 ­É?8?¡tà¿‘šV8“à¿ÊÈ–üÃ~࿬ãF$`à¿æ*ÊVk7à¿(½ ñ±࿎M/P.ß¿¾Á„€ß¿“ˆj/±cÞ¿¤‘Då"±Ý¿µKuÓCìܿީ$yÜ¿~_X„-Û¿ÀÑ^¢·4Ú¿…IÞÀ+Ù¿|úïˆCØ¿l=§±ìëÖ¿2„r¶Õ¿¯Ï”sÔ¿¨Á2M$Ó¿~öOÎÈÑ¿ÑÚéEŒbпÀinY^äÍ¿«‘aq4ñÊ¿úôšlíÇ¿……;ÛâÚÄ¿Œ2½O|»Á¿° ûL"½¿Vù.~§»¶¿ôŸT©ýF°¿³\¡“£¿cvô`kŠ¿rª¦¨’Š?õ3¢ Þ£?÷{£F°?o¤>N»¶?t¡5 ô!½?² %Q»Á?‰æ®¶¸ÚÄ?tH¶CíÇ?qxÖeðÞ¿às…ÕLÝÞ¿Y›ÑG1·Þ¿Wû¢£'~Þ¿¼{Q2Þ¿@~ÜÓÝ¿èÂ:cÝ¿è lÛàÜ¿®Tâè=KÜ¿‰“¥Û¿BÅ ¹´íÚ¿> Í%Ú¿ WTVÄMÙ¿ ðèfØ¿E²no׿f)çêHjÖ¿¸™¥´OWÕ¿º/úµ,7Ô¿6²‘ Ó¿Ï6ë8ÒÑ¿¸¯õžàŽÐ¿„~íd¥‚οú N)¸ÔË¿ôçù¡ É¿ÓݾyGÆ¿¥µ%äÂjÿeˆaŒ{‚À¿Vküý »¿hÚòd*µ¿~6ÖÛ^O®¿31àÜC7¢¿ªžq³Oˆ¿fŸDð§Lˆ?£K†¦6¢?¶ºiÍN®?]9(y*µ?lV“¬»?ò*!M‚À?‡q•jÃ?†œ;äFÆ?ám_´ŽÜ¿CÃP}Ü¿•›FÞYÜ¿8ù·¶6%Ü¿,âÃ6ßÛ¿†{PˆÛ¿îÈ};ÜÛ¿/ï†÷¦Ú¿úÿ¯d¢Ú¿ÆyS1„Ù¿l­ÜÛØ¿ÒT"Ø¿–Hû[׿ÖD˜I…Ö¿¿‰È]–¡Õ¿ùãÇb‹°Ô¿yö|c½²Ó¿å·ˆùȨҿ‰¶ù:R“Ñ¿»ýTsпND½D"‘οf ï{a)Ì¿°D²"B°É¿¦s·¿J'Ç¿‚¸Äœ Ä¿¦ /ÐìÁ¿˜ä¸Dz¾¿fæÔJ ¹¿ê.þL‰³¿RîDDú«¿jr2SUР¿ÝÊÀÎp†¿hkøëŽm†?µ}ä…Ï ?&=-æIù«?„C. æˆ³?þmA  ¹? ¸¼¸ày¾?$ãÖìëÁ?—Õ¸ÄÛÄ?Z… ЬÚ¿?EÀ׋Ú¿œò9ÇdçÙ¿W½ÃŽH·Ù¿ ê¹SwÙ¿UkQª'Ù¿ž)-®~ÈØ¿ž‘=' ZØ¿”ú©oÜ׿ž"üª^P׿N2i2˵ֿÊDU5 Ö¿þ¡WÕ¿$=¬áª“Ô¿³€»IŸÃÓ¿e‹³bçÒ¿¢dŸ}ÿÑ¿M3Ü\} Ñ¿Z“‹¤ùпøοweŠ»íË¿Ö{± »É¿ ¯§xÇ¿Åqu³'Å¿êàÙ¢³É¿жë_`À¿©í/ÛØ»¿Ñ¡ZßNà¶¿Ö™Ž¬¦Ù±¿§ÑÅNø©¿0Œ% ¾¹ž¿üò 3„¿˜€l¼}„?n©Æ=¸ž?€2Š©?nïõF9Ù±?3¨rzâß¶?t¹'pØ»?D<ç¨è_À?¯±pòÉÂ?È;8¾4׿ÈKýï©~׿ŸxEŸ¦a׿9ýÜX;6׿ŽÍ•´üÖ¿í Aœ´Ö¿Ìã0w¶^Ö¿ú}©ûÕ¿õ=íâÉտ’8E¿9 Õ¿ÂÛÏ/´Կ윘A‰çÓ¿7,“ÝCÓ¿†‡Â’Ò¿(*ùÖÑ¿‹-n{.Ñ¿¼ŒìbÝ>пnŠ€÷ Çο^{`¼êÁ¿~Qï(¥À¿ÔÑ cZ¬¾¿n8'gÇú»¿ï#ýò7¹¿á¬!fe¶¿Ê—]ó]…³¿{fz!™°¿¹ !õPE«¿ÂÞ‚G¥¿¸|Å*Uyž¿yérÄP’¿µŽ¦*¢sx¿-µ¶ßjx?ñZ›”N’?È!%wž?cë[ÏuF¥?Ï7B¹9D«?øÊ0–˜°?¢‹Ó„³?Ÿ±„,e¶?!ïëÀ‘É¿U>Õ]É¿Ìôi'õaÉ¿’¼tð2É¿cõBÛgôÈ¿}?™Ï{¦È¿JšýšVIÈ¿€m‚„/ÝÇ¿»´s`IbÇ¿B©ß$ñØÆ¿BåÌè|AÆ¿ä5¹OKœÅ¿.¹3ÃéÄ¿@ÒóhS*Ä¿@Ûß…r^ÿºÖ_§ž†Â¿"Ô-]£Á¿É)är:µÀ¿ø=ñ’y¿¿ ´y%Gu½¿ìQƒÐ^»¿Æ5w7¹¿¢†v‚‘·¿lBÑ{»´¿ñ%OÙœi²¿äïçb °¿œ<µ‘†J«¿»ýúÀrk¦¿BþÀ„‹~¡¿ °(µ ™¿«luÀŽ¿Hø¯ t¿ÄÛ[÷Ît?d‘>}"Ž?ñ“Êüe ™?iïìc}¡?×}¾Kj¦?èFó^I«?’s%Ï °?D™$6 i²? :ˆõÿ.Óª;éÿ÷ѼÐÿ•Œ%c¬Ã¿Á’•d{ÿ|è ¨>ÿÕpÊ„ö¿"©Äë¡Â¿Ò^oÓ°A¿-ÚPFyÖÁ¿û{êã;`Á¿Qo÷oCßÀ¿¹¦·àSÀ¿i…úÕ|¿¿Ÿ˜g2{>¾¿«èxí¼¿Iºq„žŠ»¿U&3Ǻ¿h¥ÑØ’¸¿k£bÙÁÿ¶¿±oð{^µ¿e°½3°³¿õ²c-põ±¿&süÞÄ/°¿¶EK8<À¬¿?Ö¼3©¿îÇ)·N¥¿ùœæã¡¿ùô/ÏVQ›¿aO(°§“¿ òH$Òƒ‡¿BÞmVXgo¿Š~^ËîSo?Nb7#÷~‡?«~ž“9“?»àÎçN›?×ÑÞ¡?¯=i~M¥?æ‰ :ú ©?Æ,j迬?æ+¢}Œ–¼¿Hö6óÁ„¼¿&{(E¶a¼¿ž1D-¼¿tþ#/#軿Œ³•óv‘»¿t/З)»¿’SÞ˰º¿P/Dk'º¿tµvKÖ¹¿âhRss丿€Þó¯+¸¿êòÖŠd·¿\Cßýá¶¿ *¤LÙ©µ¿ÕÜ©s¸´¿úøWJFº³¿’óo(¿£¹¨š±¿d0@Vy°¿Ô3H蜮¿iâB4¬¿]·,9º©¿«~ã R0§¿Ã©ñX˜¤¿qì­¶7ó¡¿œ>†ž¿ûå¼¼™¿Š.„‘“¿©ÇÃvŒ¿HârwØ€¿Å¸?f¿²m4mf?62†Ó€?¯2£[\Œ?R`?‡õŽ“?ûw+ê+™?f®å¡ëƒž?7:‹Aìñ¡?âªÿЖ¤?М vÔ,±¿Zš?aÁ!±¿®µ9Á ±¿OUaáí°¿œ ¥Ű¿¡¶º‘°¿jäR¯cS°¿[™Svà °¿£<ò¦p¯¿èµÔ¬¸®¿•ÿJ\ì­¿„pê:­¿\°¾Z)¬¿¬àâŠÀ«¿l0áSŸ ª¿¨„š=o訿îEÝtã¶§¿ß43¸v¦¿Ê׳(¥¿¤_z£Í£¿Ì*æn]f¢¿ì¥Õ@¿ó ¿ †ÈõZíž¿µ?Ó3&à›¿ú½aøÁÁ˜¿æÖš”•¿wOéÙ%Y’¿z;\Ã%Ž¿Ä ¦†‡¿ \! Ù€¿ ÃBt¿œo€[¿Õ“yš÷ëZ?y{Ž?þti¹›IŒ?ºÞ,Ë}yŠ?}çÍ™ˆ?ÉÛ¢W©†?ëqèë©«„?µ•¸q7¡‚? QB‹€?8[(Ö|?m‰˜úƒx?×vn—¥"t?Ò¯D»io?F Ö¼zf?õ–†J¦ûZ?å|²Á'âA?Ê'ÉÕ7>B¿©(° Ä)[¿Ñf¨á‘f¿Ndx6o¿žöæ^.t¿¬u³@Ðx¿š+:à â|¿R÷*S‘€¿›Ë?áG±?'pSH¢6±?ÜF­9 !±?—˜Úgt±?ëgœ«Â°?â\²D…’°?wñ$`ŠU°?jÜ4qˆ °?‹Yá|tv¯?OÛ૾®?5X¥ª„ò­?Ú¤ìLc­?Îå-o@$¬?°ª0%¶"«?àQÐÇfª?Xn`µýí¨?’‡z/¼§?nî<°¹{¦?mc›±b-¥?TÈ;:ùÑ£?:/“õSj¢?ÖƒãQ÷ ?ÖS®îªóž?Zx¼•™å›?àï·§PƘ?VIÓ^½—•?àV˜WÖ[’?0º4)Ž?^–2aˆ‡?ž“¸“€Ø€?H0±\ö'ÍÀY˜¼?˜ÝlÁt¼?B\O6ŠB¼?e!ýëœå»?¸\’»?î\Ñ<ô+»?³±a¶¦³º?ªg è{*º?o–êeý¹?ˆž©k ç¸?3‘.Ø.¸?¼”BÉg·?ûùÔÒé¶?,†Ȭµ?°j‡D»´?ûDßÍô¼³?Á™}Wv²²?31Sèmœ±?â~¾H‡{°?ÈõFÆé ®?霛µÞ7¬?yÚ»:j½©?ÚFß3§?O6 ílš¤?©^yõ¡?²HNÐ:‰ž?êlhÞ~™?¶_€H’“?½„ZúŒ?ùÇ;Ö€?ºñ„¤8of?*ÛkúЇf¿}Rû@Ü€¿++k5+ Œ¿Ž-"Af•“¿Hr’¤™¿Fl$jŒž¿·] ­ö¡¿¢³—œ¤¿õ›^ÕùûÃ?°Yº¡ðÃ?N*5ù×Ã?Óyœ"²Ã?ü ö]ó}Ã?Å/ô¦r@Ã?T¾º…®÷Â??ÍI£Â?>Âp…]CÂ?Ì[:-%ØÁ?E˜‘ äaÁ?å—6<åàÀ?¦ ?vyUÀ?×\†ï¿?s/¬zA¾?A„ÑWð¼?ïóU‚Y»?1¯“Zº?}ë]Û@•¸?+ ü·?¦£e…`µ?[Pݱ³?m½:x÷±?×8Ú+1°?U‘Vœ•¬? ƒ‘©?*;P¥?¤í‡ÿ¡?ÆH&R›?G§ªs“?òÖ Z‡?š *Uo?`Fqwno¿  xz±‡‡¿:¬Øã¢’“¿É%•\U›¿zÒØ;žƒ¡¿»kÌÁQ¥¿³¿Ù,À©¿_IªHĬ¿EyÇÙC–É?X‡ œ‡É?€­#”‰gÉ?Åcžú¸7É?o¥ÿOŠ÷È?‡¯‘ݨÈ?npNcKÈ?|÷¹ßÇ?€4ÅdÇ?Š?£D¸ÚÆ?f¬9CÆ?ñ ÎvýÅ?m§ô†iëÄ?"ü‚Cì+Ä?ǬÀü_Ã?¹"9 ˆÂ?9/ äÁ?ÚÆp‹¶À?¾£“‰|¿?„-Ñ[w½?l‰"ä`»?ÃcÒV9¹?‘cÂ9·?ž%Øê¼´?£¼!·Ðj²?™qõßY °?½hÈ¢÷K«?³ºDdl¦?¶úõ0û~¡?T]¿ìŒ ™?Nä![Ž? DRà t?Ñ(øùt¿ž2Ü!Ž¿)¾‰ÞÑ™¿yÒf ¡€¡¿ú-°n¦¿9 Ná§M«¿Í”“5°¿•ú¶°k²¿ð¿šGÏ?Ʊb Ï?Í ýÄ åÎ?ÛãX«Î?õÍ^Î?ÚÈ l¿þÍ?óñ’Í?`\‘I Í?L-ø^§sÌ?:ï§mÌË?¦+ê²3Ë?„´€¿3KÊ? ðß¹úqÉ?N†e‰È?ÍE°wþÇ?€%bdŠÆ?¼VÑpáuÅ?t5ð6!TÄ?L?JÖ%Ã?úˆ?»ëÁ?êºøî‘¦À?ÀùQúE®¾?oÒ=Àzü»?޶Àk9¹?ºÅ|,Íf¶?`?!È\†³?æ}õÙà™°?¹i6%NF«?”ʶáH¥?ä)ø…ÑÏ?}AE¢åÎ?Vîk¸ÑåÍ?"=ËË!ÔÌ?P»dœ¨°Ë?Ý |Ê?á)Œ{47É?€Î1†ÀâÇ?He EÆ?{Áé~Å?Ö#0pÃ?&.ÄÒOÂ?n«ùqÀ?ÖJ[£½?Ž÷'LRº?Ø’Iñ¶?2hp³?©‹°?Vth©?ß÷·ª>ç¡?úy‹„•?´ á±|?dû½¿|¿7JÔµu‡•¿>Ë¿òè¡¿F‘¥ö©¿Š­Sð°¿Ž¡¥1o‚³¿'zò æñ¶¿RÃÖ³6Sº¿*xžûòÔ?_`TæÔ?®…·kMÌÔ?ïinA§¥Ô?òÈ6$ñqÔ?Y;æèï1Ô?YÅË~åÓ?GgœÌŒÓ?÷Ć(Ó?: Ý+·Ò?µêöæh;Ò?8|Ô£´Ñ?¶hÈÎ!Ñ? >VÆù„Ð? è»Ï?¾NªHZÎ?YÔ¹ïåÌ?^´³þÂ_Ë?:ß?³ÈÉ?ºWª»!È?6ákÆ?FÅ2¨Ä?:¯º½Ä×Â?ˆXß·ûÀ?¬}!b*¾?ý\]ܸJº?ådœ×Z¶?Þ‚9 ,]²?¹ð¦X¨¬?Ï91«„¤?¦6Á©¨˜?¡Ý¯Šq€?£o—gx€¿vŒ¬˜¿Ú>Í-f†¤¿‡d´ª¬¿˜c&^²¿{ž¶½[¶¿Ö½w¢Kº¿R‚u®P+¾¿7ìõ(¸Ž×?´y4€×?&ÙdH3c×?vz$¡Æ7×?­0»¬ýÖ?‚šÁµÖ?>AÕ_Ö?|c„üÕ?SƹªÖŠÕ?–GfF Õ?*¢¢Z¹€Ô?Z{—†èÓ?ëB·œ DÓ?*UDì­“Ò?cÚ×Ñ? ¨`ðÑ?-¦ L¨?Ð?. åR‹ÈÎ?’"“ÏÈþÌ?a•~}##Ë?:hÏÀ6É?›|#‡Ð:Ç?D.ßú‹0Å?u¹kT5Ã?Á;üÊöÀ?d„µ¯‘½?¼’#Íœ#¹?é_´¦´?L~ð °?à ê&î§?/쀻›?\v'.~‚?iu‚ …‚¿—ˆ胾›¿`líµ®§¿Ë™9ð°¿”;¡™§´¿3`~<…$¹¿0‚'U𑽿ß~„¡öÀ¿ŽRâúÚ?¸Í]ÊæÚ?ÈÛëåÅèÙ?TN$S²¸Ù?0HíA^xÙ?.áø¿½(Ù?Ô²Óy—ÉØ? ƒÏ$[Ø?^²©Ý×?‚ÄâsQ×?C‚×UÚ¶Ö?ºìÙ<Ö?  ÇXÕ?Ô1¼ÅŸ”Ô?-ç·‰ÄÓ?ÒJ¶ˆAèÒ?*RY¿OÒ?©Ú MC Ñ?8¸*²Ð?ƒ¨‰qÎ?-N7OóîË?ƒä$:¼É?Üw;(¡yÇ?¯Î>(Å?ß@€:lÊÂ?“§1ø³`À?œ{ÓòÂÙ»?&àóïà¶?—U:þÿÙ±?2𝧩?$oGòÛ¸ž?„‡å}„?¿¹”å!„„¿tm)`¼ž¿B«©lÞ‘©¿W½@häÚ±¿ÔðÕ×á¶¿Už“’­Ú»¿ñ%0g+aÀ¿JÏÎ0æÊ¿i…ÚwâÜ?ÿÏ-;;~Ü?ìU[Ü?™DSÚ}&Ü?vn³ƒ"àÛ?*à* ‰Û?LQã‰ò Û?²=¨Ú?8rÍÇÄÚ?Þ>$Q…Ù?ŽæƒÜØ?h_$<’#Ø?t§0"\×?ñÆBÓH†Ö? qtQŠ¢Õ?™×Ms±Ô?\,Í–˜³Ó?ŽЖ©Ò?^†”Ñ?H[-¢µsÐ?Z¿·œf’Î?ÆwÖ}†*Ì?‹sTÊF±É?†h.(Ç?²ÉÉÌÄ?')ú¼ìÁ?XsŠ9{¾?åRF´- ¹?è·¯‰³?—û“Hú«?n»òïÏ ?ó˜ç×l†?xŽX6æs†¿*LV ´Ñ ¿Áâ.ü«¿÷ð;•г¿}/ G ¹¿X#•%|¾¿ýƒ '4íÁ¿+ñpG‘ĿїèqñÞ?/óCÞÞ?ô…Áá,¸Þ?˜öÄ*EÞ?ÉñX 3Þ?¨cÌÃÙÔÝ?ù¾dÝ?èëqZ3áÜ?–¾NnLÜ?-’‚.¦Û?F3ÝîÚ?DˆÜì&Ú?ÿÛzÚNÙ?!Z­\*gØ?U$’mp×?8tš:kÖ?v 4XÕ?D©’8Ô?áIÍ~Y Ó? p´ÇðÒÑ?Ÿd^ž‰Ð?ö…ùÖƒÎ?f$ÿQÈÕË?w-mŽÉ?ÐOýÛGÆ?óÔiikÃ?àæ5Sý‚À? UÎà »?Ý; Ñ*µ?–gfƒŸO®?ªÿeÉé6¢?ýÃâñÛKˆ?™ 4ðRˆ¿Á2l.°8¢¿®Á+”hQ®¿ªï¬·+µ¿žû­!»¿olª¬sƒÀ¿å…Úákÿ×x¶óUHÆ¿ÆTOæà?`·‰‹“à?3›¯à?U8½—•`à?×ß ¤Æ7à?¶ãW±4à?cg+±^‘ß?³+‡Âß?VYÆmödÞ?-Éc²Ý?†|Kt|íÜ?†/ÂÆ»Ü?øšr#§.Û?aê(!Î5Ú?˜úpÊ,Ù?ò!Ÿ?Ø?-w¿½ÚìÖ?,µR·Õ?½âUdtÔ?× çØ$Ó?#™©~ÉÑ?dûcÚ+cÐ?ô2ÅôzåÍ?dÜŒ-òÊ?}mVAîÇ?ÒÆi’ÛÄ?f¾ù¼Á?¼…ûN#½?~ ß©¼¶?îØ&G°?¹)G¨F£?e©I¶Š?)z-ËŠ¿Íó¨0 ’£¿¹îl H°¿9ªã:½¶¿rP‹û#½¿ôrØF|¼Á¿-à ÜÄ¿'‡¯¼îÇ¿%¨à{‰¶á?ú™ Úc«á?¦Í>ú“•á?F§68)uá?Ö³ÜIá?EÖ#pá?ˆŽÐƒÓà?œË‰uŒˆà?(wªx[3à?"ôÍÍS¨ß?Ò,þkhÖÞ?8Á%wñÝ?§Ð{ÛúÜ?iݺÇðÛ?«Ÿë®CÖÚ?(  3«Ù?Gè‚MpØ?ÚývFU&×?«+ÔÎÕ?À  xchÔ?5*+ÎöÒ?êë3 xÑ?ìJ~¾ÞÏ?ÊZxX”¹Ì?jdñ²‚É?¨D¥£<Æ?йôÒ¿çÂ?ö¶”ƒ¿?0Ê;Ò^<¸? f2íFZ±?ïð¶WõÚ¤?µ3âmûÑ‹?ü½”µ Ù‹¿Q¬„±ºÜ¤¿ÚRã*[±¿+0e¸D=¸¿2E¨l¿¿Z0¸5è¿|󅇌<Æ¿T1Í,ƒÉ¿ÆÏIÍ Áâ?³ãYÊ®µâ?2ª”žâ?\âÝ¿V|â?tøÝŸ"Oâ?Êã(%â?ý3¼Ñá?:!}DI‚á? .Ÿ (á?¸2â<5Ãà?êcƒù Tà?DÆý¢µß?¸[ ¯Þ?Ÿlα–Ý??‰¼ƒkÜ?aó«Î.Û?ŸÑNÑUáÙ?’+ÃæƒØ?!²÷X×?ÇO=œÕ?è“f.mÔ?* êÒ? 6_ ÿßÐ?Ô*ïUkÎ?Ÿdâ£êË?Áh&ªÕ‹Ç?w8¼:Ä?ÖR‰FrÀ?|Y¼Zª¹?íÆ¾‘S`²?¶(Ããì¦?àÀÆIv?âÐRP}¿ÇÐßį¦¿†­fA6a²¿–M"M?«¹¿àú»ºrÀ¿½ôޯĿE¸©ºLŒÇ¿i1ûúcË¿p·Ÿ%J½ã?؈±ã?=šñ@™ã?._RFtã?53JÊGã?œöÔ ã?(c{»ƒÂâ?ÏÈ9¥Ånâ?Òñtƒ¸â?üAÈŽ¥á?äî‹l†0á?3öå°à?(áBû&à?ÿ µÑ5&ß?K'´?ëÝ?$ÎëÖÜ?‘:gvÆ>Û?õ.k,éÎÙ?Âp !OØ?ñæ[ºZÀÖ?‚Iã#Œ#Õ?æ"/ݳyÓ?#ÇØÃÑ?àqÍ.Ð?C@¯pÌ?@"c‚ÃÉÈ?~“»ÀÅ?>ßXPÁ?»8ÊÂè»?n3—ïvX³?VF`F,@§?½*NJ?¼˜5&B ¿G^±nëA§¿Æ»ù¶WY³¿¤pHYË»¿ÈÓˆÊPÁ¿`!ƒÊÅ¿„ܺf9ÊÈ¿”s T'qÌ¿Ïvts”«ä?(oFÚÜŸä?îà¦{†ä?eX4ÐÇ_ä?»Þt£”0ä?Oå¯Ç£ðã?v[ŽÐà¤ã?þÊ‚,Mã?v žá¢éâ? Óøzwzâ?>¶êÿá?öÃ6Fzá?‚zªlÛéà?o^áOà?°˜ù7Tß?â2êN÷Ý?Ú|‡Ü?+`HÛ?µÁU&jtÙ?èå̯ØÒ×?y® ­•"Ö?Iµ²«dÔ?Ýp{Â-šÒ?¤¡6ÄÐ? –€RÐÇÍ?'ÕôÉ?6í‰×Æ?ID„#=!Â?PÕþèJ¼?Ïô§-âA´?-[]ߺX¨?º( ˜X=?WAoÅÊ@¿}K½uZ¨¿kãpÀB´¿©q°ÈK¼¿Ÿ‹KK®!¿˜ê'JÆ¿Ý4fŠIõÉ¿jÿ#ÌFÈÍ¿®)‡ª ‹å?xRϰB~å?L¿çjÇcå?ØCý‹9<å?€óõ5oå?Ìä†$¸Æä?‡›‰z xä?8n ô¼ä?<±bº µã?ö•ØÓ8Aã?¶ÇU‡Áâ?Sj§F6â?7d*ÊŸá?•ç.2pþà?楔e›Rà?27Z5k9ß?¸0°Õ]ºÝ?OkÐú(Ü?Ö "£9†Ú?ÉšˆÓØ?Èì Ô¯×?ÿ7ÑQ @Õ?U¬oGbÓ??Qu7‘xÑ?,Jä›(Ï?^I Ë?ýršÅ>ÿÆ?ÕpªZCäÂ?œý(áA{½?°.VÎ͵?ÐÐíå¨^©?ÕY1ì?TU…V…ï¿€ò ]`©¿¡ìø¨µ¿þ1§®|½¿óJäڲ俛‡²¨¯ÿÆ¿=’} ˿ֵ|(Ï¿‹·>\ØYæ?×À½a÷Kæ?U«O%|0æ?1¨›6uæ?'(? Ñå?|yÍõŒå?t×=ÿr;å?~Ó–šÍÜä?^ƒ|xGqä?¡É¥%ùã?q1L”²tã?¼#ä@@äâ?/þãˆ'Hâ?ý!zÈ á?yÅwŠîà?éZÛ1à?ªék]ÖÞ?Ô 7%6Ý?âÉ9žƒÛ?ÊËÈÀDÀÙ? Ñ í×?%²?¯ Ö?ç °ÙuÔ?4R²8yÒ?? OÐ?Ó›XoÌ??¢†òÚÇ?…V¶ ¿˜Ã?¾3;„ꔾ?íˆKzåµ?¢EiÓQª?ÙMß‘?¿T% 7‘‘¿åѼRª¿ö}6ŒQ浿ºöä‘Õ¾¿×Hÿ˜,™Ã¿u»—caÛÇ¿pYrÊßÌ¿:i&AˆпŽê±ƒç?èóG>ç?–,S¬Úëæ?,żbiÁæ?‹d×:ÿˆæ?˜Ü °žBæ?;Á¼sîå?Åûô¶Œå? ø”«å?[k˜¡ä?@Ýc<Êä?¤Á¯ð–ƒã?©'toZââ?.ô÷>x5â?œÿ¿[}á?G»{Vtºà?¶ÕÆxÚß?êdê~c,Þ?Ê’÷²kÜ?z€+Ky™Ú? ^§Ø¶Ø?k˜ÕùÄÖ?ï¼cæÅÔ?RZ“V¸Ò?¾w_| Ð?(|ÀûÌ?l†2Ÿ*¤È?%Y¾ >Ä?pxIá–¿?µ#R/ž¶?%dçÆ/«?Ÿ4aæ"’?f)žL%’¿ºZD”·0«¿x VrŸ¶¿,vI¶—¿¿÷xw>Ä¿ãÏ.—¤È¿jŠ É„ûÌ¿øhM`I Ð¿&P!’ÿ‡w¿XÆ#Ø‘¿c'5,”¿É6´¤¿â "êRzª¿rê–1º$°¿P5¥Õõ²¿¶’Äç‘ǵ¿* ˆÃ¸¿™Ò^޶4»¿Ø¤Iͽ¿´4F b/À¿IÏ-©hÁ¿jÈ.QœÂ¿»E—ÉÀ¿Ã¿ŸK^¼ÛÄ¿ý 5ÿ&æÅ¿ìÀœí‰çÆ¿âb=ÖÇ¿,Ù޺ȿ2Z:1ŒÉ¿B”n;QÊ¿ÔNOÄÖ˿Ňü´¦Ë¿|Ç€ ä6Ì¿E‡m¸Ì¿½ç¤a%Í¿äv+:‚‚Í¿ÔÞç“ÌÍ¿%Éx–@ο °< /)ο%Ú«Óý;ο·*=Ñ¿àK’ôÑ¿ý`b¾ÆÐ¿V6è\Ü{пHý?“¾¿[…vp Ï—¿0Ø?Ï£¿TïVà™««¿1v2»±¿Ld?¼Ó•µ¿*éó°áb¹¿ ±âþ¢ ½¿n8£fÀ¿”†weÍ1¿4¿q-òÿ jY1j¦Å¿¤qùÉ"MÇ¿àÿ¿ ¤åȿ„«ˆ£nÊ¿¦ [žzçË¿þy+oøNÍ¿9¦\Œ„¤Î¿0½ž çÏ¿êIAî‹Ð¿Šî1’:Ñ¿ZƒTUöšÑ¿pÿenÊÒ¿Ø"´œŸEÓ¿j¢çíûØÓ¿ˆ1‘`Ô¿Çùf)¦ÚÔ¿pKXŠUHÕ¿tôEæ¨Õ¿C²ùüÕ¿€—¿Å¿AÖ¿¢@«ªyÖ¿t%Eѹ£Ö¿@ƪ Ò¿Ö¿ö9uÙâÍÖ¿JVE$ãÍÖ¿¨ÌëÒ¿Ö¿ßÜE»£Ö¿¸‡Ù²¬yÖ¿ž¢`^ÂAÖ¿6LÙ üÕ¿ ΰøé¨Õ¿¤VÅYHÕ¿ p†‡èƒ¿û‚jÞ¿ÒZIUÛ¨¿ Ï7#\±¿“sÆå?¶¿D¤>Ãí»¿‰0‘Ô7Û¿¿$ý'BlF¿=Ó2ó“Ä¿¯ÀoÈÔÆ¿N)†É¿ KÔ*Ë¿†e&_=Í¿óÚ“+â=Ï¿HYÀ•пÀ/iôÑ¿vªÜ‹cÒ¿lmÇÌ9Ó¿¬ Ä1Ô¿ÂÔ¿Xþ5~sÕ¿îƒÖ¿aj³ç­Ö¿øóO6׿\n¶g°×¿ !ÉhâØ¿B<xØ¿&g/{ÆØ¿øµ{bBÙ¿Ôµ3Ù¿'aN]XRÙ¿Ìm6bÙ¿ G…bÙ¿0,.JYRÙ¿Ã8©>3Ù¿jÂ/‡DÙ¿Õõ8ÆØ¿Ö»Bm‚xØ¿žÉÐMæØ¿z‹Œk°×¿ä[Ì^“é…¿µ…Roõq ¿&ÇsžÇ_«¿øí«Hg³¿7C ¸¿„:TœÔ½¿žÀ׊Á¿3¯Rr‰ Ä¿‰çΩƿ$ž¤%É¿¸ÛŒ:ÚË¿…)x/ëÍ¿¯Ìƒõпª£µX.4Ñ¿$Q/ ÊCÒ¿†À2#HÓ¿XÞY—@Ô¿[¾|Ž,Õ¿Z†(©u Ö¿àêòÕÄÜÖ¿~KT\úŸ×¿²¡&üTØ¿ŸS-@úØ¿+çzÙ¿–²QgñÚ¿¦ÇÁØPÚ¿¼€—$PóÚ¿á09u°HÛ¿T;q=Û¿0‚ÄËÀÛ¿7ìȲ<ãÛ¿("‹¦zôÛ¿y9úzôÛ¿<ùm­=ãÛ¿|/ìdÍÀÛ¿t¡W?Û¿ˆœcZ³HÛ¿Ð\"§SóÚ¿ÙGôTÚ¿œa§öÚ¿”¦‚¦w䇿°®áïò¡¿æ¦Þfà­¿Ï#aQÞ´¿ÐKñþ¾º¿ÀC¤GÀ¿Osl³%ÿ¶ˆ¸ì÷Å¿ØtÞý”¼È¿ùøqË¿Á'H nο¾Ï²ß)TпæÊ[ “Ñ¿Šž ûÇÒ¿ÂLЈïÓ¿”ÕÕ² Õ¿ÌzàÖ¿Ö+Á"m׿’špиØ¿–¢ƒ¢-ôØ¿ ù–­>ÉÙ¿›E hŽÚ¿›%«1CÛ¿‹Åy„*çÛ¿9¤\öíyÜ¿bÝ€!ûÜ¿*ÎþpujÝ¿› ¥ÇÝ¿üÍÔwÞ¿Þ̪'½JÞ¿<@d¥TpÞ¿òY ^&ƒÞ¿Ê%P·&ƒÞ¿ S¯UpÞ¿™ Øà¾JÞ¿³9MzyÞ¿›1¨ÇÝ¿ë s'yjÝ¿K" Ø%ûÜ¿Ë èòyÜ¿œÏ5ÇeÔ‰¿€>œÔ2n£¿ò`T¸¨-°¿ôlM—Ü™¶¿x}œ»Ï÷¼¿.öoÙ¡Á¿%KæÜ¼Ä¿g’&ËÇ¿OmûoŽÊÊ¿Mym†¹Í¿Ãºˆ KпÎ!X¯Ñ¿<@ôÒ³Ó¿..ZRVÔ¿˜âåøe—Õ¿*˳(ËÖ¿Dg,¿Üð׿¶e&ûÌÙ¿5q_MÚ¿FÏüh»Û¿c®õ}~íÛ¿FbLÃÜ¿íûՆݿz!ç6l8Þ¿¢S»`×Þ¿îS@Ncß¿ ÔváÛß¿z•)3g à¿‘;:ëHà¿·Š(Òdgà¿U•J0À{à¿Ü<€ñ…࿜…’Jñ…࿬¤A½À{à¿,óC¼egà¿AÇ5ÕìHà¿ë!8Óh à¿ʘeåÛß¿ÙçI&Scß¿%nDe×Þ¿|±k-°‹¿ÚC,˜å¤¿†:g±¿7`êrP¸¿û÷49Ê)¿¿Â¨šÕ÷¿mŸÏ§OÆ¿§Ëtm˜É¿—¶ªy ÒÌ¿øR‹ÞùÏ¿·]ðü†Ñ¿2©«‹;Ó¿ÊÁ ˜¾yÔ¿öæò¡àÕ¿‹uOq:׿­žíå…ؿ詉. ÁÙ¿Šþ níÚ¿Ži®’ŽÜ¿qÌiȹÝ¿–÷ëäö Þ¿G|AͬðÞ¿×§ÓMÃß¿%ÖË,Aà¿È£Öª–à¿z(l›îá࿊0uêÈ"ῺÄYá¿+hO­§„á¿5IÄo¥á¿Z)ÑU»á¿¹DRLÆá¿O»„LÆá¿"¬ñfV»á¿’-½p¥á¿-lש„á¿`Q~Yá¿Z¨¹Ë"á¿"¿u ñáà¿~d­–à¿Sé¬ÁLa¿âžïg.Z¦¿2Ó@F¯²¿0ÅC´º¿€‘ߘ©À¿TN¨HÄ¿ 6ãâäÚÇ¿ܙՑ^˿ָµx^Ñο:º+>•Ñ¿”¥PŠð½Ò¿š×´4½WԿϧpqþäÕ¿ôÆ2¿d׿Ý?}ÀÖØ¿ô|úI8Ú¿ Zrì‰Û¿¹g×ÇÊÜ¿»ËèáùÝ¿üÌZ©~ß¿`¶žË÷à¿°¨šPÈŠà¿k¶#eûà¿"µЈaá¿úbSVô¼á¿ÐµTo ⿺…÷%ÈRâ¿H´Ԍ⿈8)o»â¿èäÏÎ|Þâ¿´RÒXçõâ¿^ùùU ã¿´~E‹ ã¿ýzløçõâ¿:iÝ×}Þâ¿lEšp»â¿ ¨ÝÕŒâ¿Ã­`ÊRâ¿Üç¬íq â¿íH K÷¼á¿°ŽX¹r8¿•©]ŒÚ§¿<  oг¿Õ×E–7©»¿heì¹Á¿ík­}Ä’Å¿‡\š6_É¿†Ôh Í¿&À¡öwcп':èÐ.Ò¿î?r:ôîÓ¿W0N:Í¢Õ¿íûäNI׿2䜂táØ¿ßè@BjÚ¿¥ÂïÊÅâÛ¿ðBbÜJÝ¿,'qÏWŸÞ¿¬Î–$¶áß¿fâé5ˆà¿ HoÛ]á¿€Gý—Ῠ֢ˆÂâ¿êÑkd|â¿ ÿ¶ŸÝâ¿$ZÝq83ã¿¶NIÑù|ã¿èÉÔW¶ºã¿¢˜ËñGìã¿4ª ä¿"¼ñ©w*ä¿‚úSmï6ä¿Pö&¦ï6ä¿ÕÐ Tx*ä¿nU'‘ä¿&Št{Iì㿤±RN¸ºã¿.·µ1ü|ã¿Æ}{8;3ã¿Î"ߢÝâ¿R¾PV÷õ¿]ùj§â<©¿’ú°gÇø´¿}‚–ÞcG½¿ MÁüM¿°-ÍƒÕÆ¿ªk»j»ÚÊ¿JóCpÏοW¾í•XÑ¿9¦Ã>Ó¿§ðýƒÕ¿ìขcæÖ¿q¢`Г¥Ø¿T´k‘UÚ¿3½ÀÀQõÛ¿ îNԃݿüÄÝ8#ß¿ü!¶ò©4à¿Þ… ÃCßà¿n&ÏÑuá¿$OÝâ¿äØ´Ÿâ¿Š!VÙâã¿g,…oÝã¿YÆëÆ÷ã¿*rÔ_Rä¿A?iHp ä¿"ŠÀ"Èáä¿Uê?å¿GF'Æ´=忾£ÝXå¿MÚµCeå¿M+ZUCeå¿9È»’Xå¿ äíóµ=å¿”aXº@å¿4A¯;Êáä¿Ë­îÒr ä¿ùEeÌbRä¿FKØLÊ÷㿪ݽýÉ‘¿¹úøæ˜“ª¿ š¶¿3ZóÚ¾¿Oê{kÄÿš ĺȿ—ÍÕçDLÌ¿#Üд;п›>¿FGÒ¿Ë=J-–GÔ¿íŒYše;Ö¿)?€!Ø¿öqRö¹øÙ¿\öãï¿Û¿qÔ vÝ¿ç™PW÷ß¿@[(½[Uà¿•xH'©á¿H Ã…nÇá¿»hŒô#譚翉O¿Â‡}ç¿£–âäQç¿ðY§/àç¿Ý“ŒsÏæ¿E“>Iyæ¿ÕÀ§Îæ¿É™ûÅr“¿¹ Sù"­¿=/Äõ<¸¿ü¬×«¬ìÀ¿ŠÁ|Ük°Å¿dxÜvÎfÊ¿{w(î Ï¿mZp]öÏÑ¿>`µ”{Ô¿3Ûöô£@Ö¿'×KheØ¿×`bzzÚ¿-\:¯ŒÜ¿|º: sÞ¿’_iâ)࿲³½ïFá¿â0J%ìá¿}ïd¥ö¼â¿%¨¢b9‚ã¿(c‡t;ä¿sxC‰4èä¿ó¦î#ˆå¿§úP¤æ¿X¦M¥–Ÿæ¿Óø$•ç¿dÞgVç¿Ñ0ÛÔ™Ùç¿‹>¿'%è¿0NÅÑaè¿_ë`Öq迈=uì­è¿)‡ž.½è¿ßyÒç.½è¿×t8Rí­è¿ Fsè¿!qùŽÓaè¿èKpP*%è¿]{ÔóœÙç¿@£Zç¿ËÙ©T™ç¿¢H?µU?”¿KÁB±Y®¿¿O¨àA@¹¿ÎLâîù¡Á¿,ËËê˜Æ¿PºåÃé˿ơ)Rù,п–hóïÒ¿/¯Ò£ŸåÔ¿]È /X/׿»@1ÅjÙ¿< †–Û¿ëm#úC±Ý¿®w²¹ß¿¨H1=H×à¿YOƒTÇá¿ûìøi¬â¿°£îMû…ã¿€;êM‚Sä¿@ø§2€å¿R¬ò}È忲÷•‡ oæ¿ï)8Åç¿ÙîÏÑI’ç¿Å:uåD迆(Œûi{è¿·#'ÃuÙè¿Õm;.(é¿S×bgé¿R̓›ì–é¿ àa6®¶é¿zp”Æé¿*ØŸ`”Æé¿£UÙ!¯¶é¿AŸw#î–é¿Ï=úúdgé¿£K•ù0(é¿úòyÙè¿[¾ïèm{è¿,~fIè¿NÛbCA•¿]_h8”ƒ¯¿+}&ž8º¿>Ž~«’O¿ ɺVwÇ¿5†?ôñÌ¿ÇÞFaÌпnx WíEÓ¿f\|á–³Õ¿X‹÷­ÞØ¿)Ñ> MeÚ¿Û±u¦Ü¿D?ÞòÕÞ¿<÷6yà¿ÀnÞI}á¿}ñ””vâ¿YÔ `|dã¿…¬ÁnFä¿_êЕßå¿"ûKäå¿Í޵8Ÿæ¿ZŒ0Lç¿–p¾Êêç¿qû8Ô¤zè¿ä+Âfûè¿Ú „¿l鿚U1÷iÎé¿Í°Wr* ê¿Ö„zÎaê¿úû!ƒ,“ê¿0ÏÊ*'´ê¿œ'§¿©Äê¿ÅÅ$ªÄê¿0%(´ê¿“3$.“ê¿/äÆfÐaê¿#H+_- ê¿q{ˆmÎ鿞u¶MÃlé¿$„¥êjû迾`p|À•¿.Ü0ƒÎO°¿‰ÞÀH%»¿:ÅrÛóô¿”HqMˆKÈ¿Q2ßѓͿÍÝY6dÑ¿ð£Â$ôÓ¿Š‹¨ÄwÖ¿Åœi‰íØ¿;÷ÃîSÛ¿Ù¦Øy©Ý¿m·ºìß¿ 1)%á¿å·¥h⿬ï5oã¿ÙbÝRÐ俚¢Åc½ýä¿'×¶X¸Úå¿Sk$å8ªæ¿Ò¸, ¿kç¿ÇâqtÓè¿B¶Ÿ§Ãè¿´¤s`öWé¿UÄCÝé¿ýÖ›Rê¿bƒ‡»·ê¿XïI*_ ë¿p¢QTP뿚Wqƒë¿ñÁ¢è•¥ë¿e±NÅ­¶ë¿—°Ó®¶ë¿8b3ò–¥ë¿TçõÌrƒë¿£[§¼VP뿲ÙFb ë¿hó±T¿·ê¿«†¢R꿯ÔXðHÝé¿RùKs–¿TU…ã¿Ùçh nPä¿U¨œ=0V忌:Q¿ÉNæ¿&€’:¡9ç¿• Ø%迾þS–Ïãè¿£OÉ¢é¿±Ô³Ž Pê¿[,œÉæîê¿ËG›±|ë¿n€èFùë¿˧„¼dì¿áE`@¯¾ì¿'$âçí¿~ä!9=í¿~rD>‚aí¿Dþw—¬sí¿<.ïù¬sí¿ëWÝeƒaí¿×ò6;=í¿Û¡ÇVêí¿7d¼²¾ì¿‡#AÊÀdì¿zùKùë¿pÛ–|ë¿Õ%Jºº—¿àÇaö˱¿{Y£(ž½¿ôW#o¯Ä¿øÄþ(‚Ê¿D¶Y1y"п~ÆPBéùÒ¿#]K’¤ÅÕ¿ê‹–òƒØ¿x^žË 3Û¿wL&‰ÑÝ¿¯¶ÇÆ.à¿í, Îjá¿€¦kœâ¿ÑÑ¢æÁã¿ #Ìy†Ûä¿ñ[®>Ièå¿,%Þ.‰ç濾ƒ^ݨØç¿¬9æ“»è¿"úŠ®=Žé¿¢ÃÏñ¤Qê¿À'åÚÐ뿪øëéR§ë¿£g æÆ8ì¿}Ì>Ó¸ì¿ô⊑('í¿Á$¾=ƒƒí¿ïW+ªÍí¿¥N¦Ÿoî¿Q~ö5±*î¿fÈôW=î¿<Úø[X=î¿ìˆÖk²*î¿u"¥qî¿å‡ö­Íí¿"¿™ç†ƒí¿ë”I-'í¿íÐtظ쿡pÍ8ì¿Ò†.kwN˜¿uÅhÊ:²¿|qJU¾¿Ií÷ß.Å¿ÂTEâ&Ë¿žß"D6†Ð¿Î„x8oÓ¿‚uM=LÖ¿<ãÙ¿Š’ñ_JÛÛ¿cÀä‰Þ¿aáãÈԒ࿃4Q}~Öá¿‹§ÃÝ'ã¿t¦~<ä¿€½ˆ}\å¿+%X¾oæ¿Ìú™À(u翚üˆlè¿T>šaþSé¿„:ŽJB,ê¿@Ÿðâaôê¿Vºp¿á«ë¿&ýµPRì¿^T!Hçì¿\Ã×#ljí¿«ñÝkÛí¿­LºŸ:î¿(NÅó…tÔg¿î¿l¸_9åî¿ÖuSøî¿rY¡àSøî¿áò¢:åî¿J•óƒ¿î¿ûpã ö…zÇt:î¿|°”pÛí¿ØØÀqjí¿h@«©Nçì¿2»ŽŠÖ˜¿PCÅNŸ²¿/A ‡ý¾¿¨½ÒÆR¤Å¿]Àkˉ¼Ë¿‚ÏŸÓáп֤e øÚÓ¿&iÞÇÖ¿R¯tB¸¦Ù¿B¡SÀuÜ¿/Àe;3ß¿›òî»îà¿ ácèh9â¿ìb¿„Øxã¿ .½E¬ä¿ÂìñöòÒå¿úñMs*ìæ¿$ÅÃ>÷ç¿ ¤/‹óè¿ÜÃ3 tà鿘zg½ê¿ŠƒRú܉ë¿ð ó‰VEì¿¶[g‹`ïì¿"‚ï!’‡í¿ Þ8r î¿<Üÿ€î¿ÿc/.¢áî¿x=nÐ8/ï¿Ó9ê“iï¿¥7ï¿;–«…¤ï¿ÂÓCõ¤ï¿{‰Îï¿#là–iï¿Ôáå;/ï¿Å«*¦áî¿ôWjÅî¿@oN“ î¿Ü®÷˜‡í¿?Åê èQ™¿³·í8û²¿à›c5W–¿¿pþ÷œƿƮõ\BEÌ¿  ¯™ 5Ñ¿„ƒ¦IØ<Ô¿‹¤›‹+8׿o}_-%Ú¿ÒZ2Ý¿æÍß¿ˆ³G×7Bá¿Ö#·C“â¿1®¶ÃÚØã¿TÓ*4忈˥©Ž>æ¿4Q&1]ç¿qã£qjm迃H“né¿!ªFQ `ê¿Ì|oAAAë¿5Þ§ì¿X‰½Ðì¿óLu ~í¿Ã[¦-î¿v†¦½¡î¿ùDZiï¿”.&0èyï¿JEÄkýÈï¿Ê2$<ð¿LP6 ð¿K!Ý- ð¿W­cg ð¿òÀ¹ð¿õrE=ð¿Ú"9šÉï¿ì³-Oìyï¿‹ö›onï¿H 0ºÃ¡î¿úÉòÀ4î¿Dz'>å¿™¿7PÛ@‡M³¿Ã]á³ À¿Í2œœnÆ¿Æà ûǿ̿C¹NžÑ¿àr£”Ô¿òË\ýМ׿¼ô0,ƒ–Ú¿7¤¾ÐÝ¿ê-‰Êu+à¿`J-— á¿|ì¥EÌãâ¿tösgç.ä¿KZcÃmå¿ø¨ÑŸæ¿#æ$3~Âç¿4w%T×è¿J›7ð×Üé¿êUGNhÒê¿ ÕéÐm·ë¿.#=[‹ì¿¾Xâ­Mí¿þPêêíýí¿Å%Q§®›î¿ªïJÏŽ&ï¿`–ý¾8žï¿€IÆU1ð¿N4Phg)ð¿<±AË¥Gð¿^ó]ØÙ[ð¿Z´ˆ÷eð¿,ávU÷eð¿Æ½ˆ‰Ú[ð¿Ö"Ëó¦Gð¿gÙ i)ð¿ºws3ð¿“ù=žï¿NÁ³•&ï¿$y:üµ›î¿ž\¸\R š¿êèò3ý•³¿ž§”ìîKÀ¿$.¸AØÂÆ¿˜ 3$¾+Í¿{0VÁÑ¿’±”ÜáÔ¿cƒ߃õ׿74ä“eúÚ¿fÞVm¤îÝ¿È6hà¿#²ÕüÎá¿ùˆ½Ç*ã¿`°4̾zä¿ !õ¾å¿ëèeôæ¿;­Ç迊Ðô‚­4é¿Î@0>ê¿öx37ë¿[#¶•ì¿‚;œŸöì¿ :Ì»í¿aç¡ø¢nî¿ýae´│Î^¡ž›ï¿F#… ð¿'„ŠOV=ð¿ˆÛ#fð¿‹Ó„ð¿¦#…S™ð¿&ÌÝÉ–£ð¿ÊUÓ—£ð¿0>_9T™ð¿ÍÖ¹Ô„ð¿R‰Œ)%fð¿ìxX=ð¿ëç|· ð¿EÐ㥛￉…õ¼ï¿(mK“3sš¿¨H±ŸlÔ³¿öÈGêÀ¿*¸4v Ç¿O‘SӈͿòc¾ÝúÑ¿Ø*j…$Õ¿¦´ÒWBØ¿¦Œ(³ŠPÛ¿AÁ-ý:NÞ¿ð`k2œà¿ŽFïïÝâ¿Wnšÿgã¿—ï†ÿ(¼ä¿lHúVˆæ¿Â ÀS=ç¿w{»Éhè¿õ©¡1…é¿@‘Ü‘ê¿aˆ²f#Žë¿°{ lyì¿F=ë$Sí¿¬ú¢ÅÇî¿cŽœÙÏî¿ÀþUqêqï¿å4`UKð¿P¢Ã=ð¿àæ ›6qð¿˜Mz"†šð¿#¸5˜¹ð¿W|#¬YÎð¿|¹½Øð¿Tpö½Øð¿¸¼KbZÎð¿*]ßf™¹ð¿"NþЇšð¿L¼IÊ8qð¿AÍÅ=ð¿à×”Nð¿8¹áòqï¿ÄmSÓ”¸š¿j¬l°´¿8 ûTm«À¿HHŽ]?HÇ¿ÐOwjÀÖÍ¿Âzs)Ò¿Þ}VX\Õ¿¦ž#Ăؿ¡©&³˜Û¿þ¬lMžÞ¿¬þ…‚Èà¿{¸„7â¿ó©ÐþH›ã¿Ì­ÒÝõò俎@£Ç¶=æ¿('ªÌ¿zç¿GáOsM©è¿4a„/¥Èé¿Ü¹kÕØê¿Q”øÖë¿àØE™®Äì¿do’ù¦ í¿Ü ãƒYjî¿Ò˜ÂØI!ï¿‚²)Åï¿rk?–*ð¿TÓ©z°hð¿aûû«œð¿öزhÆð¿GKhåÌåð¿ “’7Åúð¿‘'`»Dñ¿ÄiøDñ¿#Ì.îÅúð¿¼HmÎåð¿ðWÐbjÆð¿ð¢,®œð¿×‡‹2³h𿳃­ƒ™*ð¿{ÆÉÙÅï¿Pú_b‡ðš¿4=µÒ«2´¿˜Ž’XÎÀ¿‹߀yÇ¿aêšGο~á}‰OÒ¿×êµ+‰Õ¿m§õˆµØ¿Äîùâ©ÒÛ¿ý(9¡ÞÞ¿Éý´§Æëà¿ 4]Ì]â¿ü¯”}Äã¿’Xý*ýå¿NG_‡ulæ¿J ¬ç¿³šÈ"Ýè¿:FöŽÖþé¿0óšËë¿'Ý)Â{ì¿rùÞÿ%í¿úßž½ìÞí¿Úea;Gªî¿yzÁ¸bï¿»5@Çæð¿_}gîLð¿i±-‹ð¿Óˆqs–¿ð¿Æ‚=äªéð¿¿FóQ ñ¿Ï&¸uuñ¿® ð¿óÆB9›¿§í. ‚g´¿†:]øùÀ¿ÄRá ͵ǿ–8ÃLcο4žU,Ò¿–UVÁÕ¿ž8#öØ¿ ±GgÜ¿˜Ú,-_/ß¿f¨r á¿ÒŽCºÚâ¿ ‡ßR7øã¿®±ÃBVå¿´øQ#§æ¿l‰Sv êç¿Ü®x3é¿ö*cÝBê¿¶á¢ÈTWë¿MŽ|5ïZì¿W)Ä™ Mí¿^í—¬-î¿ö ´H†úÕýÁÙ´ï¿Lâñ™Ï-ð¿=Ô4ä7wð¿éÐÜ{x¶ð¿9 `jëð¿Ïëìñ¿eæå5ñ¿ B›AKñ¿LÙgÞòUñ¿‡ØuóUñ¿¸õIBKñ¿˜õZ ç5ñ¿<úˆîñ¿ çzlëð¿~ÄÌ{¶ð¿ Ç ;wð¿Íâ>PÓ-𿘌öŒPK›¿óÐ(]r´¿"Ôœ~Á¿ ×ämÁÇ¿ð?Éo[rο]Að¿ˆÒ¿ÙwEJ‰ÌÕ¿-™‡ÇÙ¿µàÚ+ý)Ü¿ ¬J‘?ß¿ºS†ì á¿>‘¾~—â¿®OЖä¿÷@ÝEWaå¿óFaç²æ¿›!Y wöç¿nµâ?+é¿K´é€Pê¿FcðЇeë¿°¡Oÿ¨iì¿#“D\í¿x…(qÃ<î¿åõé°œ ï¿‘ÕâPÅï¿åóJs66ð¿æYØÄð¿ÀE&¿ð¿˜w¤3ôð¿ãÙ¬?Ìñ¿eû´ÒÕ>ñ¿²™hœñ¿ö÷ÙÏÍñ¿mÌ{­5ô𿎒 Ì(¿ð¿uŸãÇð¿)¾Ô :6ð¿†É,U›¿VMdèr´¿«eÁ¿•)‰5ÀÇ¿ô;ÖˆýpοÝ]rOSˆÒ¿ÖV |ÌÕ¿ 8¬Ù¿„J *Ü¿¯?‰¢“?ß¿Z·8í á¿ó„'ð}—â¿O£_!–ä¿nxkVaå¿óV·Ö岿¿¢ùN@uöç¿ÿ†ë<+é¿§Ç}~Pê¿ôp‹*…e뿨Új$¦iì¿A\A\í¿ X><À<î¿q)„U™ ï¿Ó€àdMÅï¿iþâ¤46ð¿ØHüÂð¿®B]$¿ð¿œa)²1ôð¿r{²DÊñ¿ôà¤ÐÓ>ñ¿rGÒ”:Tñ¿`ì$_ñ^ñ¿=Ç”ñ^ñ¿3-:6;Tñ¿kÜWßÔ>ñ¿þ§BÃËñ¿Ë@C¤3ôð¿LÜšÇ&¿ð¿ÇQåÅð¿?l86ð¿?ÉÏpÙe›¿ò&¨¾—h´¿>]|ûøÀ¿²ˆʰǿ¯dÐóM^ﳑTµ~Ò¿¡á&«PÁÕ¿*^Ux"öØ¿˜¯†tÜ¿¸ïj]g/ß¿Oœ ῪZCÚ⿉&8-5øã¿Ým Œ>Vå¿B˜¦£§æ¿ö Ëêç¿eÛð,é¿CHÖBê¿ 8|ÏLWë¿{s ŸæZì¿ï€vMí¿¡¯¡ -î¿ÍL–2|úî¿Ï;jDÏ´ï¿ÈÝô,Ê-ð¿/ ON2wð¿lÓ)Âr¶ð¿Ó‡dëð¿q{€øæñ¿E¥Þß5ñ¿ý¿õ‚;Kñ¿_²*ºìUñ¿ÓììUñ¿L•g¢Ç¿1Ï.{JοkŸa mÒ¿±¨v×<«Õ¿ÛôÊ£mÜØ¿Ò.9z`þÛ¿ƒ¿A¨ß¿òsI=Rá¿Ì p¬™z⿬ããN{ãã¿/Ÿõ„@å¿-SºOšæ¿­mzË1Ñç¿Ç4«é¿´=8±‘'ê¿’^+#é:ë¿eWª8u=ì¿Ô¼öƒ–.í¿K˜ZT¸ î¿öÔóQÚͨ’â“ï¿­Y4ýð¿»Yfð¿ÁÑ¥ð¿me•ÒÙð¿aÒdÜ(ñ¿÷,?Š$ñ¿÷ɉüE9ñ¿Ö œìCñ¿|šÑDìCñ¿©¥˜ŠF9ñ¿U¥tx$ñ¿âÈò,*ñ¿HZ”KÔÙ𿹉³ð¥ð¿ 7j¡f𿇮„7ð¿Güámך¿”m¹/¬/´¿3¹U~ÎÀ¿ÿ Xí½zÇ¿ÓM¨½ÇοuÂÆ(KPÒ¿Mè‘–‰Õ¿Õ )cĵؿÆL‘2ÊÒÛ¿n=M~°ÞÞ¿ZÎdÈëà¿HÉ ¯É]â¿¢ólewÄã¿Çà’ôå¿Ø99úilæ¿7a ¬ç¿€×Ý*Ý迤À–;Åþ鿱T¤ín뿱|ú~gì¿ ÙÂxí¿ìýèÖÞí¿Ÿ1…/ªî¿QoŸbï¿í¹Â Úð¿ŸÜ'ÒƒLð¿*bÛA ‹ð¿`›®¼ˆ¿ð¿ÇŽ3ñœéð¿óÓ®ìB ñ¿lM+gñ¿ì5£ü(ñ¿éŠÎü(ñ¿ãôy­gñ¿Ž¢?ÇC ñ¿Bè%žéð¿.|JNŠ¿ð¿´üý3"‹ð¿Æ,[)†Lð¿KËÜð¿$·Mp;©š¿±bú4´¿Â<æù «À¿vûbvHÇ¿<{lÙ×Í¿îC”è)Ò¿j÷¨\Õ¿Ïö¥#E‚Ø¿öͅΘۿ…*ÒõXžÞ¿ø‚A‚È࿤jÛ7⿔ءð?›ã¿4b{héòä¿Ôh Y§=æ¿=¦¯º­zç¿›÷x9©è¿§NÞ¿´†°™œà¿Ê®Å¥Õâ¿o*šógã¿âE»¼ä¿Ãf±tæ¿°—i ==ç¿uE?°hè¿N©œ…鿾Ãì¼½‘ê¿f+òŽë¿Ð¿š§Iyì¿1ØÄSí¿ë§ã¢\3N²Ïî¿InôÁqï¿̃6ð¿©àÆ­=ð¿ð Ù q𿤶Àpšð¿Rìjɹð¿<¢HCÎð¿",øæ¦Øð¿ifq §Øð¿ÆùkCÎð¿6Ñ$w‚¹ð¿Eùà÷pšð¿qB“"qð¿7“FP¯=ð¿Çóõ\8ð¿êØöKÆqï¿T$'¦’š¿HÉ÷WÍ“³¿/w2ºûJÀ¿~q}ÑèÁÆ¿(IØ›ª+Í¿ ØkÎaÁÑ¿,A=äìáÔ¿{” õ׿‚?Y±iúÚ¿²)ËŸîÝ¿K´~U/h࿽ۘÃðÎá¿Mš¶*㿤wïWªzä¿ P4Æü½å¿xê÷xæóæ¿™{ÜJ¨è¿ü¹´Ò‹4鿵"¾Óã=ê¿ ª9¨ 7ë¿çT&¦lì¿ÇÞ}töì¿‘g]’Ÿ»í¿ƒ½îJtnî¿D^„ï¿P­m›ï¿mbµÅk ð¿‘´bo<=ð¿ëjy1 fð¿itÊ⸄ð¿1à–8™ð¿hš©©{£ð¿þÃEÇ{£ð¿¡ßêï8™ð¿>:æw¹„ð¿›.µ fð¿èh9€==ð¿BC m ð¿ZÑþ=p›ï¿Z™~ˆï¿ÈðÙxж™¿EŒ[K³¿Ïi_µ’À¿àåÍŸ{mÆ¿Îú{éx¿Ì¿  ŽÑ¿E_ñ±‹”Ô¿¶!›YΜ׿da1*|–Ú¿a»£ÁÝ¿¡êâ:j+à¿ÀPAvúŒá¿X©û¢·ãâ¿[DtÎ.ä¿®4÷¿rmå¿Ts3àžæ¿žx ßYÂç¿%¸kŽ,×è¿ä®ÐU­Ü鿽Úì:Òê¿”lÛá=·ë¿¥õ9÷(‹ì¿ÎtzyMí¿†×ª”·ýí¿Š}o”v›î¿J«Â0U&ï¿ ãÅýï¿"ÚBð¿ ÅýÖH)ð¿'5ØÒ†Gð¿ˆÃ÷º[ð¿¢L ™×eð¿44•±×eð¿Šh¹Ùº[ð¿ÕõFN‡Gð¿þÚ„I)ð¿â.$ð¿ÜL9ñÿï¿UÃ¥ÉW&ï¿ØLŠy›î¿\¡þÅcI™¿Ïù²¿¡iŠý-”¿¿éBª*Ñ Æ¿jõPáÙDÌ¿«húuï4Ñ¿ÛL¾—É<Ô¿z2Å8׿µÏ@%Ú¿×ýùÝ¿’Ùô"ïÌß¿¾š˜#Bá¿î-G«*“â¿OËR½Øã¿ ¸œ 忇†%fh>æ¿@âõß]ç¿…d7´ï¿ €To£ï¿J^M‹Â£ï¿# J?ᅩ>›´Diï¿PÝþÔê.ï¿ —ÿ§Uáî¿„¨µ€î¿¤oÔˆD î¿.íl`K‡í¿B•Q8G˜¿²y.8²¿Þ¥õ.cS¾¿{(Þ^Ú-Å¿nÌdÓ¿%Ë¿MÓà­(†Ð¿¸îÕ¦0oÓ¿¶ÝYý1LÖ¿*E¿SmÙ¿ Aº#*Ûۿ̖ฉ޿¢ÚåP¸’à¿ü/!\Öá¿à=jñÿ㿈Äïâ;俼êK\å¿,*k‡o濌—™éítç¿{Ì@ºÜkè¿7‚ä»Sé¿Æ"£cü+ê¿ 8 Öôê¿ ÏYÏ•«ë¿ ö@$Rì¿:ò<0÷æì¿ü·jí¿ºœñÛí¿W!«90›…î¿8ƒúh¸¾î¿!F„†ßäî¿„“¦ù÷î¿êÒæù÷î¿F?ºßäî¿ R¿¸¾î¿KÁ©›…î¿(èl±«9î¿çS­Ûí¿×´ñjí¿CÐ+øæì¿Ôø;˲—¿ ·ccʱ¿›½J·‡œ½¿¼ù´A®Ä¿¼Î8¬'‚ʿʚ7ˆ"пᎩ1ôùÒ¿óÊ9¢ÅÕ¿ªó•ñރؿ¶X½ý2Û¿ÅÚÀUÑݿ׭dí¥.à¿|já¿‚Zèé›â¿;„O³Áã¿@¢aNÛä¿_öü èå¿·Ú2]Gçæ¿Ï=?ÉbØç¿Îl®‡Éºè¿¯–£òïé¿5í~ÍSQê¿‚Ø”|뿇jÈû¦ë¿áïÂ/m8ì¿–pyw¸ì¿þÙ„Ê&í¿"«Ëo#ƒí¿4ÝâHÍí¿žö[# î¿6 |ÌM*î¿ò‹äó<•ëó<î¿NBàM*î¿2%‰C î¿r£ IÍí¿Ò°§#ƒí¿úÈÆÅÊ&í¿I‰8_w¸ì¿›?È}m8쿦Ïò×—¿*E7ò S±¿™Ñ  z×¼¿"„ÀÚ$Ä¿ç,_¶íÑÉ¿E_]ÙLnÏ¿öv{=Š{Ò¿0æX4‚4Õ¿nëÏxhà׿¹\/ò˜}Ú¿§Hæwv Ý¿þs‡m…ß¿ ‘Aázöà¿ âu~Éâ¿ý ë=㿘/&÷.Pä¿3{zýëUå¿Á¶{¥€Næ¿Þ¯Ñ•S9ç¿–¥JôÓè¿,*¾yãè¿ÔÎ]ơ鿘ëC¬CPê¿æ€Àцîê¿ò´fï-|ë¿×!†§áøë¿?ŸñUdì¿yíZæE¾ì¿Â#¯|í¿Z‰áÌ<í¿¸jþaí¿Ç?¤>sí¿±„8 >sí¿¯±Ìñaí¿}!dÌÌ<í¿ñ|í¿Ã@à»E¾ì¿ßòØTd쿽±B_áøë¿”œM“-|ë¿‚1Ê—`–¿CöàqÓ°¿îæcR𼿉hb5I’ÿpy:ÝÉÉ¿a_A³ˆÎ¿“z%VMôÑ¿å¼Ô½9™Ô¿¸Bl3€1׿ç{Bƒ»Ù¿êòš¾­5Ü¿ zð‰vžÞ¿rÙ"Æ/zà¿YÞŽûšá¿L>ì°â¿ÎÄ@V»ã¿ü?.•¹ä¿þ&D) «å¿.¸ç;&æ¿-бVeç¿ôƒRl-è¿àqã5óåè¿Ö4Ý ré¿+ùß`-)ê¿‘ÒfƲê¿ÒÄ7?è+ë¿”=s4H”ë¿5]Çæ¥ë뿸îÿsË1쿇¤˜fì¿â Êˉì¿+—QMp›ì¿ì`è>p›ì¿ˆiŸË‰ì¿#?7Ofì¿ÚR? Ë1ì¿^ ­\¥ëë¿dI†G”ë¿;Ä‚iç+뿵¤/eŲê¿i39Μ•¿„ÚÙpK°¿ü¸Œ%»¿:'£7÷¿…É.ÑNÈ¿ /Oé”Í¿ªaGH’dÑ¿pÄ„1ôÓ¿UHŠ[£wÖ¿?›ØlJíØ¿¿>9šSÛ¿Ó‘ö©Ý¿C>:Eìß¿ŒÉ-èã á¿u2 !â¿åS¿à3ã¿ tµ}ä¿,˜‚Îdýä¿QAæ®ZÚå¿!eJqÖ©æ¿•©Xkç¿u ÏShè¿Q “¨˜Âè¿E¶ÕƒWé¿kï1ÎÜé¿3÷Æø$R꿟Z@·ê¿L8åËá ë¿QN3ÕOë¿#u½\ð‚뿲¦&¥ë¿ýî+¶ë¿±h+¶ë¿Lú?Ä¥ë¿?Æoàï‚ë¿§ÅiÔOë¿°ßàäà ë¿ÞjÆ9?·ê¿wš#Rê¿)Åy`ÌÜé¿ò‹Í»…¶”¿$ê©Øy¯¿ì 8³8º¿j*¼ûYU¿‰.ƒr€Ç¿µƒÝ‘“Ì¿zY•ÌпÆsÓEÓ¿³e6$X³Õ¿§ç ìˆØ¿’ÑœBædÚ¿gjE$ÿ¥Ü¿nÛ ]nÕÞ¿u&íxà¿öÛþ¬ú|á¿Û&K?vâ¿ó:Ü9!dã¿ÀÎu¼ Fä¿·ùxyå¿cfäÌàãå¿Ñ·Èžæ¿ðÂß$¼K翦š6Rêç¿M÷¨ƒ(zè¿ ‘Uæúè¿G1MEläÍ鿇D¢ê¿!AãCDaê¿—ŠU¡’ê¿0 „š³ê¿!Ê=Äê¿_`Äê¿e×=š³ê¿òàa ’ê¿Ó)=NCaê¿dK”N¡ê¿ ÎÜâÍ鿎ÿ€b:lé¿â¸Ùäúè¿ìuœ«ö:ä¿Ë8 Ÿ±çä¿%$˜/ˆ‡å¿êÏ®濃d ·Ÿæ¿Dß…Nç¿no(¾~ç¿©sXkþØç¿õý(­‰$迨.·@1a连…ë¼ÏŽè¿ÞWþH­è¿ZѨ9мè¿aBмè¿þãL`H­è¿ü¸v³ÎŽè¿Z´†É/a迲կć$è¿·u üØç¿šƒr9»~ç¿÷èòüç¿&…âsI’¿ ÿ™ÍpÛ«¿ãx_ó?+·¿g,©Î`-À¿¿_Jà»Ä¿‹dž&<>ɿ乷cü°Í¿2 6”ŸÑ¿nþ0a-.Ó¿XÂdtÛGÕ¿N,’øbT׿\©CLƒRÙ¿ºà¡xAÛ¿>+¾v³Ý¿s9mêÞ¿¾"ÇŠQà¿c°ýqÎ#á¿Öñ¿ÿëá¿)C¸Q$¨â¿øpCGYã¿+þë{þã¿ Y¦cZ—ä¿o@4Ć#å¿ÿ‘¦À©¢å¿¿hëïtæ¿c†R#¢xæ¿4ñ‘óÎæ¿vÎþ3ç¿‘&ÄÙ6Qç¿Çï[Ø|ç¿0h*™ý™ç¿€"Ü™”¨ç¿uÝ\”¨ç¿PÆáü™ç¿Ò<'×|ç¿õ&5Qç¿ÄiÉ1ç¿(:GÔðÎæ¿æ–­×žx濈>qæ¿´Wùº†¹‘¿Uwé#‹ª¿ò[´QV¶¿ll¥ö«Õ¾¿ƒÏ&NÂÿ"8šFá È¿áE°JÌ¿œÐ´‡;пü¯úFÒ¿ãFêÌîFÔ¿Ÿ® ¹:Ö¿âÜMzÊ Ø¿áÖnQø÷Ù¿cQá ¿Û¿5;íû+uÝ¿¯¼KÐ ß¿çî0ÑÞTà¿x²ü:%á¿ÚØ×ãÆá¿S}ŠÑ«oâ¿ø«[ ã¿”¤“¾žã¿ñ×rN$ä¿~¸Vrä¿ßvSˆß 忺ïK(Siå¿—HŸW’»å¿¡Ä\jæ¿$ S¿°7濳šiCaæ¿UP¶}æ¿Y„ïŠæ¿²7?ïŠæ¿ã>'ç}æ¿·;KBaæ¿ä±ÍÔ®7濪…Þg濎±ª@»å¿Ü=ÅqOiå¿)ù†*Û å¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?*Ö ñe™¿[ŽE‡ç™¿ªæAôð˜¿_m7ŸÂ˜¿bâÞú…˜¿ëy'ŠK8˜¿ê¬6¢Ü—¿fJˆAr—¿-™•kù–¿$Ê,qir–¿XKøÑÝ•¿Œ¶:;•¿9u03Ì‹”¿”Øz‚²Ï“¿*ë<ø`“¿pñ$S3’¿×<·¾ T‘¿âw¦Šj¿®ýÍ›û뎿!Jc#¼ðŒ¿S‘Y£ãŠ¿“ìéŒõň¿™6W™†¿ê¸¸^^„¿ƒ2¸¦‚¿ »ésˆ¿N½3iÏz¿·ôJ5v¿wRÄk/q¿î@dœh¿¸VH¨?”]¿% 9¼C¿7% 9¼C?LUH¨?”]?8@dœh?RÄk/q?]ôJ5v?ô¼3iÏz?ɺésˆ?Y2¸¦‚?¥OXÚ¬Ó²¿Å`ŽnȲ¿‘/&ÀÞ°²¿‘„ &޲¿^Üïû_²¿>™ì®|&²¿<ó;ÒË᱿{¶’±¿R¬·„…7±¿‰¬.YÒ°¿<éöÒÌb°¿ø§ïKÒ¯¿‡î0_\Ë®¿ôÖo±­¿\îL3…¬¿!Ž ë_G«¿lTA´¹ø©¿[¢ š¨¿58,§¿h·"а¥¿ ³iL•&¤¿.qY¦¢¿å÷ÈPDï ¿˜’\7ᆞ¿æe–(f›¿”8úÅ2¡—¿U\ °l”¿xs'„B¿j‰ÞÕÁ‰¿BpBq‚¿SºÖ= *v¿”YH¨?”]¿LUH¨?”]?B¹Ö= *v?÷BpBq‚?ãˆÞÕÁ‰?5s'„B?\ °l”?S8úÅ2¡—?§e–(f›?Î:£ÌãS¿¿Ž­¸‘@¿¿™^!{ù¿¿†Çgá2྿%eAa“¾¿ñÎÞ´3¾¿ûY×gÁ½¿ãŒìôÀ<½¿6Á়¿õbcû·ý»¿Ÿm(¦D»¿m½a€¬yº¿¡Å%bêž¹¿ïp5[´¸¿<ñ¢º·¿Ö›Î¸!²¶¿V¥©‹´›µ¿¾ÓÒów´¿zÉhz“G³¿Ä7XC×½OÄ¿À ÖVÿњ>éuQ¿SgžAÁ¿,AK5&À¿',Ýy ¾¿{ømш¥»¿,fôAú7¹¿™U Þº¶¿° èW½/´¿‡ÛÞz)˜±¿I~Åwë­¿UÄ^(”¨¿½7¢°-£¿$ä©íÉv›¿t'„B¿÷J5v¿]ôJ5v?5s'„B?Yã©íÉv›?X7¢°-£?ñÃ^(”¨?æ}Åwë­?WÛÞz)˜±? èW½/´?('3vÑ¿PùïIûÑ¿ßìúnõðпÅäuÜ|Ñп~Xû¤§Ð¿Îÿ"™‡sп(‹ÚD5п!s¸JÚÏ¿Õ ËÞ5Ï¿åJv~οÔÇm@´Í¿#Àÿ¸×Ì¿q`féË¿îd8éÝéÊ¿Yæ;H¼ÙÉ¿æ+R©¹È¿^{»°VŠÇ¿0½uLÆ¿:¢¤çÅ¿ÿÑÚ¿[¨Ã¿[‚rD°C¿þé%*ÁÓÀ¿Ü³2¶â²¾¿87ÎOT«»¿zwvoµ’¸¿W/«éîjµ¿ÿFšëò5²¿_~Åwë­¿Ÿí¢|•X§¿™¾°~M· ¿ ] °l”¿ÕÀ3iÏz¿ô¼3iÏz?\ °l”?¾°~M· ?$í¢|•X§?æ}Åwë­?ÃFšëò5²?/«éîjµ?Awvoµ’¸?N_@RÐÔ¿U¬²oÔ¿À ¶ìÓ¿I§·²ÇÓ¿Q6¨p|–Ó¿(F¿˜1YÓ¿páü÷Ó¿4@øÅüºÒ¿ûµ]tZÒ¿`£ÛJšîÑ¿FP±wÑ¿^¿L öп£·ˆ0Ýiп6#rÜ1§Ï¿é2„ã#gοt ÙUÍ¿˜r°˜¯Ë¿‹lÈ9Ê¿<–˳ȿ,{ɳ’Ç¿ç%­{Å¿ àÔ6]Êÿ€Ò1n ¿ÞêÌ]EÀ¿ÝX‘á…æ¼¿êâ1à~0¹¿d/«éîjµ¿žÛÞz)˜±¿?;?lu«¿ªÔÝæ¨£¿v9úÅ2¡—¿Y¿ésˆ¿Éºésˆ?S8úÅ2¡—?v©ÔÝæ¨£?¯:?lu«?WÛÞz)˜±?/«éîjµ?¥â1à~0¹?™X‘á…æ¼?ä,޾׿Â}[‹øÖ¿ÄÒËú,ÜÖ¿Pi=¨µ±Ö¿÷RU?yÖ¿›¦fÔì2Ö¿9û„éÞÕ¿‚ìŒ4i}Õ¿/^n¨Õ¿yåJê’Ô¿×~qO| Ô¿¥Ù8²uÓ¿ÄIFÊçÔÒ¿¤ž®-€(Ò¿­-«¶åpÑ¿­rå ‰®Ð¿¦½ƒ”ÇÃÏ¿læÑäοº[F{sWÌ¿ǃ‡†Ê¿àØ+¦?¥È¿nÿ³Ä´Æ¿ûpˆÞH¶Ä¿Wcôù«Â¿š *»A”À¿èX‘á…æ¼¿“wvoµ’¸¿Ó èW½/´¿²sïV¤€¯¿[™‹P`ަ¿õf–(f›¿÷4¸¦‚¿Y2¸¦‚?§e–(f›?µ˜‹P`ަ? sïV¤€¯? èW½/´?Awvoµ’¸?™X‘á…æ¼?s *»A”À?òHXyíÙ¿ì ÙÖ{ÝÙ¿PÏ°Š½Ù¿oÀv˜¹Ù¿˜Ùû &NÙ¿¶¬@÷þØ¿# ^ Ø¿0Å”2Ø¿“¯j"ߵ׿¤9 Š*׿¡PnpëÖ¿< k béÕ¿£ÿ5U4Õ¿Ôe¸’4rÔ¿Ü÷ÑÜw£Ó¿Dý\”žÈÒ¿!2Ÿ±/âÑ¿jÕQ¹ðпUk¿ éÏ¿l¹¨m ÞÍ¿ˆx´Š4ÀË¿ÐißM+‘É¿AŸà|]RÇ¿¸&æ–-Å¿]côù«Â¿éêÌ]EÀ¿\7ÎOT«»¿ÇU Þº¶¿ä<Jc¼±¿ýeðe©¿Ò“\7ᆞ¿³»¸^^„¿Á¸¸^^„?Z’\7ᆞ?]üeðe©?‡<Jc¼±?kU Þº¶?ÿ6ÎOT«»?½êÌ]EÀ?1côù«Â?\)ô 6ÄÜ¿}Tzìx²Ü¿•øƒtÜ¿–?LûYÜ¿|uуqÜ¿V§C—»Û¿üÓ"‚¢RÛ¿æïùÓØÚ¿¥ô%ÊvNÚ¿$‡óGà³Ù¿ÄýÉo Ù¿ž7”mŽOØ¿I%ÝÕ®†×¿Ù]"åL¯Ö¿j5jpíÉÕ¿M·‹í×Ô¿Ùðt×Ó¿Ü:¨ËÒ¿@®Ë´Ñ¿ì)㦑п[J\ ÊοZ –SÍ]Ì¿ˆ=àÉ¿GŸà|]RÇ¿qˆÞH¶Ä¿Ò1n ¿ ´2¶â²¾¿efôAú7¹¿~šJ;„­³¿G*?ßÖ-¬¿—øÈPDï ¿¶9W™†¿p6W™†?Ç÷ÈPDï ?w)?ßÖ-¬?šJ;„­³?ÿeôAú7¹?¥³2¶â²¾?_Ò1n Â?ÖpˆÞH¶Ä?çz&56‰ß¿Ÿ>Ãuß¿ÂÄ8PéNß¿¡­Þ_Àß¿¼÷KlÇÞ¿q“GÅgÞ¿…1 ôÝ¿n¯¸†„nÝ¿¨½xÕÖÜ¿ˆ\-Ü¿!nEƒrÛ¿ào’¼¦Ú¿Ó·†ÊÙ¿ßô޳gÞØ¿LÜõòâ׿þÕý÷ÂØÖ¿Aa'ä{ÀÕ¿°Ì!•ÊšÔ¿UP±+dhÓ¿¸vàž*Ò¿UòuGsàпºÍðÏ¿\ –SÍ]Ì¿ÙißM+‘É¿|ÿ³Ä´Æ¿àÔ6]Êÿê%*ÁÓÀ¿¼ømш¥»¿ª¾…g‚’µ¿l0ø9\䮿Û.qY¦¢¿ÿïéŒõň¿iìéŒõň?ö-qY¦¢?ˆ/ø9\ä®?9¾…g‚’µ?Kømш¥»?áé%*ÁÓÀ?èßÔ6]ÊÃ?Gÿ³Ä´Æ?M´hiaá¿›urLÓá¿ æü”½ý࿚ òC-Þà¿ÏeªÐ5´à¿‹¿êñà¿v·îdAà¿©ð Wòß¿Ù9²DjMß¿«¤žx•Þ¿›‘P©ÊÝ¿^Ç<ôzíÜ¿±¯!puþÛ¿LPq-,þÚ¿{•";=íÙ¿EÇwìPÌØ¿Û/qœ×¿‡ÕgR]Ö¿+•ûhÀÕ¿Ä"0·Ó¿™QûwQÒ¿\òuGsàпiJ\ Êο›x´Š4ÀË¿øØ+¦?¥È¿&­{Å¿‚rD°C¿y,Ýy ¾¿v³2j·¿ñÀž$êð¿ê³iL•&¤¿•Y£ãŠ¿/‘Y£ãŠ?ò²iL•&¤?uÀž$êð?v³2j·?ÿ+Ýy ¾?B‚rD°CÂ?Ê%­{Å?¿Ø+¦?¥È?oìG›™kâ¿Ò_=`â¿Ï3Hè‹Iâ¿õ·5“'â¿!á:húΈSõÒ&Âá¿T+¯¯ñ~á¿§|ëCò0á¿ÓëªXØà¿ó*’†[uà¿ðþàå7࿱jC.b"߿φö!!Þ¿EPµ÷J Ý¿@ú $ŠçÛ¿PÄS´“°Ú¿„;îo'iÙ¿QÍEØ¿îֿ̬p*Å28Õ¿Å"0·Ó¿Àvàž*Ò¿õ)㦑п„¹¨m ÞÍ¿ǃ‡†Ê¿N{ɳ’Ç¿(ÒÚ¿[¨Ã¿ZAK5&À¿À.ö6r3¹¿38XéuQ¿ÊAA€@–¼¿?ÔÒów´¿"\¢ š¨¿0z¦Šj¿Ðw¦Šj?óZ¢ š¨?¨ÓÒów´?4AA€@–¼?½š>éuQÂ?½uLÆ?nlÈ9Ê?KæÑäÎ?'†Íæ¿´æ¹#i濬Cû3<æå¿ö÷ÐÀ½å¿ºÐáv‡å¿ tŽðDå¿ûµ8{óä¿Ê#6–俎…,ä¿(«0’µã¿ÅBÇÚß2ã¿#MV…V¤â¿uzÍõM â¿ÅíF+%eá¿LqBµà¿omyã!öß¿q"ï  nÞ¿í6ô -Óܿ͌-ˆ‰&Û¿;îo'iÙ¿å/qœ×¿Ra'ä{ÀÕ¿ëðt×Ó¿62Ÿ±/âѿԽƒ”ÇÃÏ¿³˜r°˜¯Ë¿—{»°VŠÇ¿ý ÖVÿëÅ´°¸-¾¿á¥©‹´›µ¿•UA´¹ø©¿I?·¾ T‘¿Ç<·¾ T‘?UTA´¹ø©?B¥©‹´›µ?MÅ´°¸-¾?® ÖVÃ?I{»°VŠÇ?g˜r°˜¯Ë?нƒ”ÇÃÏ?¯õtÄ>+ç¿áÑÏôç¿|R~¶iç¿Ýø¯Õæ¿tëc?ßœæ¿ÁÞQEVæ¿;! È”æ¿ÅêyŸå¿¿í&, 0å¿ØÞÍH‡³ä¿!€~ A*ä¿1Ú_‹”ã¿B‡ÇÁò⿱^ºßHEâ¿úQ]‹Œá¿¹nˆ/ûÈà¿pmyã!öß¿™GÀD—FÞ¿‡nƒ§`„Ü¿[ÄS´“°Ú¿PÇwìPÌØ¿Öý÷ÂØÖ¿a·‹í×Ô¿Zý\”žÈÒ¿Ærå ‰®Ð¿« ÙUÍ¿Ræ+R©¹È¿C×½OÄ¿z9”²¿¿iœÎ¸!²¶¿Z ë_G«¿ô$S3’¿`ñ$S3’? Ž ë_G«?›θ!²¶?qy9”²¿?,C×½OÄ?ÿå+R©¹È?[ ÙUÍ?Ÿrå ‰®Ð?iã¿Æ/9è¿xa9W?*è¿ÇÍ®g è¿ûE5»ßç¿å1wU¤ç¿˜õ[Zç¿Æ*´ùç¿ô}Ðg›æ¿nÛ­ä&濹Ât'¸¤å¿Dvf…2å¿Cº9K¬xä¿l¾L†Ïã¿wëIù'ã¿ ÌÑ Yâ¿ûQ]‹Œá¿MqBµà¿ ¥U§ß¿%æp¡ÐÝ¿Lú $ŠçÛ¿‰•";=íÙ¿aÜõòâ׿€5jpíÉÕ¿ô÷ÑÜw£Ó¿È-«¶åpÑ¿$3„ã#gοšæ;H¼ÙÉ¿\àWc<Å¿Ã.ä£ñ‘À¿Øñ¢º·¿Y]îL3…¬¿Ûí<ø`“¿ë<ø`“?ú[îL3…¬?)ñ¢º·?l.ä£ñ‘À?àWc<Å?Cæ;H¼ÙÉ?Ð2„ã#gÎ?Ÿ-«¶åpÑ?2O„Y08鿚¨¼¥¢(é¿öTÌÕ é¿ÕÛè¿–ò¢ 7迯þ æ1Pè¿ÉwR.ôç¿Ö–ôwd‰ç¿îÕÊËç¿|têˆæ¿Ùü/i#óå¿€ZSo-På¿vr} ä¿Ú+d/?ãã¿yëIù'㿳^ºßHEâ¿ÈíF+%eá¿„Gzà¿Í0’û~ ß¿SPµ÷J Ý¿\Pq-,þÚ¿÷ô޳gÞØ¿ñ]"åL¯Ö¿îe¸’4rÔ¿Áž®-€(Ò¿u#rÜ1§Ï¿3e8éÝéÊ¿ØÑHÌðÆ¿AiÎ a@Á¿¼ïp5[´¸¿\ôÖo±­¿cÛz‚²Ï“¿…Øz‚²Ï“?îôÖo±­?ïp5[´¸?æhÎ a@Á?~ÑHÌðÆ?Úd8éÝéÊ?#rÜ1§Ï?–ž®-€(Ò?e8£'꿲BØê¿£¶õ I÷é¿“^­ Çé¿ç¼ßê†é¿RÒÿ 7é¿üÎÓ©œ×è¿ÄL Ýhè¿E.´ë翆 ‚^翺é`ÔŠÃæ¿ah›‰æ¿ïÇjæcå¿yr} ä¿q¾L†Ïã¿G‡ÇÁòâ¿{zÍõM â¿«³‹é¹á¿«…ëÚ›à¿â†ö!!޿ů!puþÛ¿ð·†ÊÙ¿e%ÝÕ®†×¿Áÿ5U4Õ¿åIFÊçÔÒ¿Æ·ˆ0Ýiп½`féË¿¶&žÛíÆ¿úÃ,äÁ¿NÆ%bêž¹¿ðï0_\Ë®¿&x03Ì‹”¿-u03Ì‹”?tî0_\Ë®?‘Å%bêž¹?œÃ,äÁ?¸µ&žÛíÆ?``féË?™·ˆ0ÝiÐ?¸IFÊçÔÒ?ä·ôë¿l"ºœIöê¿M隷ýÔê¿nžÎx%£ê¿Mẵß`ê¿1©EUê¿L§M¹«é¿gflæG9é¿æ†[\H·è¿€zž &è¿Et¾?è…ç¿(WxD׿¿ah›‰濃ZSo-På¿Hº9K¬xä¿6Ú_‹”ã¿)MV…V¤â¿ã4¹¢¨á¿²Þ=î ¢à¿ÅjC.b"ß¿tÇ<ôzíÜ¿2ào’¼¦Ú¿¼7”mŽOØ¿\ k béÕ¿ÇÙ8²uÓ¿ƒ¿L öпsÀÿ¸×Ì¿ØWSW¢±Ç¿ÿ/kÂï|¿!¾a€¬yº¿m©ïKÒ¯¿¶:;•¿Œ¶:;•?å§ïKÒ¯?^½a€¬yº?ž/kÂï|Â?xWSW¢±Ç?Àÿ¸×Ì?T¿L öÐ?™Ù8²uÓ?ìM›Õë¿´¥ŽpÄë¿8 “ &¢ë¿Ï¸Ðn뿹n˜<*ë¿G¶±ŽÕ꿞$B‚pê¿láR$úé¿¥JYÐBté¿듎®Þè¿ï‘ÌÃ9è¿Gt¾?è…翼é`ÔŠÃæ¿Þü/i#óå¿Kvf…2å¿)€~ A*ä¿ÍBÇÚß2ã¿1xЧ/â¿Èkõ7!á¿üþàå7à¿4›‘P©ÊÝ¿BnEƒrÛ¿'ÄýÉo Ù¿ÄPnpëÖ¿ü~qO| Ô¿6FP±wÑ¿(Èm@´Í¿W:D:ÌfÈ¿ôgÔK ÿZn(¦D»¿þéöÒÌb°¿wNøÑÝ•¿MKøÑÝ•?4éöÒÌb°?‘m(¦D»?gÔK Ã?ô9D:ÌfÈ?ÅÇm@´Í?FP±wÑ?Í~qO| Ô?†ÂÞò“ì¿¶ý%Šwì¿8”—C^ì¿‚Ú\Ï)쿤S³ãë¿%1y;Œë¿gðÃòù#ë¿Ø/lûªê¿¡EA„Š!꿸pþû‡é¿듎®Þ迃zž &迆 ‚^ç¿‚têˆæ¿ÀÂt'¸¤å¿àÞÍH‡³ä¿0«0’µã¿„rýu«â¿y˜«Ô•á¿ÿ*’†[uà¿Å¤žx•Þ¿)ˆ\-Ü¿F‡óGà³Ù¿È9 Š*׿4yåJê’Ô¿ˆ£ÛJšîÑ¿WåJv~ο=ŒŒé É¿ŠAíÊé‹Ã¿¶ccû·ý»¿P­.YÒ°¿XÍ,qir–¿Ê,qir–?€¬.YÒ°?èbcû·ý»?#AíÊé‹Ã?Ø‹Œé É?òåJv~Î?W£ÛJšîÑ?yåJê’Ô?Sª·aó>í¿A¢;ûé,í¿ÎïMâí¿3iP’òÒì¿ïqõ <‹ì¿#Þõê1ì¿bêc6Çë¿Tü$`Kë¿IvFš´¾ê¿£EA„Š!ê¿§JYÐBté¿ê†[\H·è¿J.´ëç¿öÕÊËç¿nÛ­ä&æ¿Èí&, 0忘…,ä¿zËÓ¿ã¿»Š$¨˜ÿá¿áëªXØà¿÷9²DjM߿ͽxÕÖÜ¿Êô%ÊvNÚ¿º¯j"ߵ׿X^n¨Õ¿&¶]tZÒ¿0 ËÞ5Ï¿† ŽÛ“£É¿,"̵yÄ¿þÁ়¿­·„…7±¿vœ•kù–¿#™•kù–?K¬·„…7±?+Á়?Ã!̵yÄ? ŽÛ“£É?È ËÞ5Ï?ôµ]tZÒ?&^n¨Õ? ŠjÆØí¿z%^Æí¿:w‰ö˜¡í¿meˆŠjí¿T£ Ô]!í¿+Vâõ6Æì¿WBG'QYì¿ÏW5‘ïÚ뿟Tü$`Kë¿Ü/lûªê¿páR$úé¿nflæG9é¿ËL Ýhè¿à–ôwd‰ç¿ÿ}Ðg›æ¿ÑêyŸå¿Ê#6–ä¿Ï&+@€ã¿àB.C^â¿¶|ëCò0á¿Éð Wòß¿—¯¸†„nÝ¿=æïùÓØÚ¿ZÅ”2Ø¿­ìŒ4i}Õ¿a@øÅüºÒ¿s¸JÚÏ¿¡Ãuß¿¯Tzìx²Ü¿ ÙÖ{ÝÙ¿÷}[‹øÖ¿Š¬²oÔ¿ˆùïIûÑ¿ÏÏføË¿Ê›læÒÅ¿r­¸‘@¿¿«aŽnȲ¿ú‘E‡ç™¿ZŽE‡ç™?Ã`ŽnȲ?Œ­¸‘@¿?X›læÒÅ?]ÏføË?OùïIûÑ?T¬²oÔ?Á}[‹øÖ?¾¶¼ñûï¿QI¥ÃWçï¿ål‘ñ¿ï¿â€§ö„ï¿ÃÆÄe‹6ï¿Y/,)àÔî¿`ZÞ-1`jÆØí¿^ª·aó>í¿“ÂÞò“ì¿ùM›Õë¿ó·ôë¿t8£'ê¿DO„Y08é¿|ã¿Æ/9è¿ÂõtÄ>+ç¿;†Íæ¿@Ë,.åä¿ Gõu®ã¿†ìG›™kâ¿c´hiaá¿{&56‰ß¿)ô 6ÄÜ¿&HXyíÙ¿µä,޾׿…_@RÐÔ¿a'3vÑ¿À‚ÅÛX Ì¿Ö|UdàÅ¿´;£ÌãS¿¿PXÚ¬Ó²¿ÌÙ ñe™¿*Ö ñe™?¥OXÚ¬Ó²?Í:£ÌãS¿?c|UdàÅ?N‚ÅÛX Ì?('3vÑ?N_@RÐÔ?ä,޾×?À¶¼ñûï¿SI¥ÃWçï¿ål‘ñ¿ï¿ä€§ö„ï¿ÅÆÄe‹6ï¿[/,)àÔî¿bZÞ-1`jÆØí¿`ª·aó>í¿•ÂÞò“ì¿ûM›Õë¿õ·ôë¿v8£'ê¿EO„Y08é¿~ã¿Æ/9è¿ÃõtÄ>+ç¿<†Íæ¿BË,.åä¿ Gõu®ã¿‡ìG›™kâ¿d´hiaá¿{&56‰ß¿‘)ô 6ÄÜ¿'HXyíÙ¿¶ä,޾׿†_@RÐÔ¿b'3vѿ‚ÅÛX Ì¿×|UdàÅ¿¶;£ÌãS¿¿ŽPXÚ¬Ó²¿ÎÙ ñe™¿+Ö ñe™?¦OXÚ¬Ó²?Ï:£ÌãS¿?d|UdàÅ?P‚ÅÛX Ì?)'3vÑ?O_@RÐÔ?€ä,޾×?TI¥ÃWçï¿R„¿ªÓï¿e¸Ù\¬ï¿«±O†qï¿{içjK#ï¿ÍñvjÜÁî¿_beuMî¿©z%^Æí¿O¢;ûé,í¿Æý%Šwì¿´¥ŽpÄë¿~"ºœIöê¿ÄBØê¿®¨¼¥¢(é¿a9W?*è¿öÑÏôç¿Éæ¹#iæ¿V°1KØä¿»ª7R¢ã¿ê_=`⿳urLÓá¿<Ÿ>Ãuß¿³Tzìx²Ü¿" ÙÖ{ÝÙ¿ú}[‹øÖ¿¬²oÔ¿ŠùïIûÑ¿ÒÏføË¿Í›læÒÅ¿v­¸‘@¿¿­aŽnȲ¿ý‘E‡ç™¿]ŽE‡ç™?Æ`ŽnȲ?­¸‘@¿?Z›læÒÅ?aÏføË?QùïIûÑ?V¬²oÔ?Ä}[‹øÖ?5Ý9¸¾ï¿^ÃgC$«ï¿Yei„ï¿ÑÖ¶Ê|Iï¿ ÖcT×üî¿3™§à›î¿b (î¿Hw‰ö˜¡í¿ÎïMâí¿I”—C^ì¿I “ &¢ë¿`隷ýÔê¿¶¶õ I÷é¿ UÌÕ é¿)ÇÍ®g è¿“R~¶iç¿ÂCû3<æå¿DŒ .¾ä¿åÑÿŠã¿è3Hè‹Iâ¿%æü”½ýà¿üÄ8PéNß¿ÌøƒtÜ¿ˆÏ°Š½Ù¿üÒËú,ÜÖ¿ù ¶ìÓ¿íúnõðпµ$„ÕË¿>Z÷ìò·Å¿‚_!{ù¿¿y0&ÀÞ°²¿IæAô𘿭æAôð˜?“/&ÀÞ°²?^!{ù¿?ÌY÷ìò·Å?¨Œµ$„ÕË?áìúnõðÐ? ¶ìÓ?ÆÒËú,ÜÖ?$–¿ƒï¿dàþOpï¿ÓÖ¶Ê|Iï¿l‰Áí]ï¿gýUÙFÃî¿RöLcî¿i±D8ðí¿|eˆŠjí¿DiP’òÒì¿”Ú\Ï)ì¿Ï¸Ðnë¿‚žÎx%£ê¿§^­ Çé¿0ÕÛè¿F5»ßç¿ôø¯Õæ¿ øÐÀ½å¿  ˜ä¿o7߯eã¿ õ·5“'⿳ òC-Þà¿Û­Þ_Àß¿Î?LûYÜ¿§Àv˜¹Ù¿‰i=¨µ±Ö¿ƒ§·²ÇÓ¿ÿäuÜ|Ñп—dÐdϡ˿ «ušÅ¿nÈgá2྿x… &޲¿ùm7ŸÂ˜¿cm7ŸÂ˜?“„ &޲?‹Çgá2à¾?¢«ušÅ?'dÐdÏ¡Ë?ÇäuÜ|ÑÐ?L§·²ÇÓ?Ti=¨µ±Ö?mÏ6ZW5ï¿‚7T"ï¿uQ‚¥ûî¿Ð_?Âî¿Ácz½v}jjIutˆ¥í¿d£ Ô]!í¿rõ <‹ì¿¤S³ãë¿Ín˜<*ë¿bẵß`ê¿ü¼ßê†é¿®ò¢ 7è¿ý1wU¤ç¿ëc?ßœæ¿ÒÐáv‡å¿:ûqÇdä¿Úâ8„5ã¿;á:húá¿êeªÐ5´à¿;¼÷KlÇÞ¿µuуqÜ¿ÒÙû &NÙ¿1RU?yÖ¿‹6¨p|–Ó¿ºXû¤§Ð¿ó\á ]Ë¿˜îŒèõYÅ¿ fAa“¾¿EÝïû_²¿ôåÞú…˜¿hâÞú…˜?cÜïû_²?,eAa“¾?'îŒèõYÅ?„\á ]Ë?‚Xû¤§Ð?U6¨p|–Ó?üRU?yÖ?áâ…á¯Óî¿~óxÞ¬Àî¿}{ü‘²šî¿•hØaî¿ }jjî¿(·Œ¢A¹í¿šDÄHí¿¥U§ß¿Tæp¡ÐÝ¿wú $ŠçÛ¿±•";=íÙ¿‡Üõòâ׿¢5jpíÉÕ¿øÑÜw£Ó¿ã-«¶åpÑ¿S3„ã#gÎ¿Âæ;H¼ÙÉ¿}àWc<Å¿Ý.ä£ñ‘À¿ýñ¢º·¿†]îL3…¬¿ùí<ø`“¿8ë<ø`“?&\îL3…¬?Nñ¢º·?†.ä£ñ‘À?'àWc<Å?læ;H¼ÙÉ?3„ã#gÎ?º-«¶åpÑ?hZZ*ç¿Øâº´ç¿£Áµ†ÿæ¿3G·ÍÔæ¿›ëc?ßœæ¿èÞQEVæ¿a! È”æ¿ëêyŸå¿ãí&, 0å¿üÞÍH‡³ä¿D€~ A*ä¿SÚ_‹”ã¿c‡ÇÁòâ¿Ð^ºßHEâ¿R]‹Œá¿Önˆ/ûÈà¿§myã!öß¿ÍGÀD—FÞ¿¸nƒ§`„Ü¿‰ÄS´“°Ú¿{ÇwìPÌØ¿9Öý÷ÂØÖ¿…·‹í×Ô¿{ý\”žÈÒ¿ãrå ‰®Ð¿Ý ÙUÍ¿}æ+R©¹È¿¢C×½OÄ¿Nz9”²¿¿‘œÎ¸!²¶¿‰ ë_G«¿"ô$S3’¿ñ$S3’?9Ž ë_G«?é›Î¸!²¶?§y9”²¿?OC×½OÄ?*æ+R©¹È? ÙUÍ?¼rå ‰®Ð?R†Íæ¿Þæ¹#iæ¿×Cû3<æå¿ øÐÀ½å¿äÐáv‡å¿ÉtŽðDå¿$¶8{óä¿-Ê#6–ä¿¶…,ä¿N«0’µã¿ëBÇÚß2ã¿GMV…V¤â¿™zÍõM â¿çíF+%eá¿lqBµà¿­myã!öß¿­"ï  nÞ¿%7ô -ÓÜ¿-ˆ‰&Û¿¾;îo'iÙ¿/qœ×¿}a'ä{ÀÕ¿žðt×Ó¿Y2Ÿ±/âÑ¿¾ƒ”ÇÃÏ¿é˜r°˜¯Ë¿Å{»°VŠÇ¿# ÖVÿ&Æ´°¸-¾¿ ¦©‹´›µ¿ÇUA´¹ø©¿k?·¾ T‘¿é<·¾ T‘?‡TA´¹ø©?l¥©‹´›µ?ˆÅ´°¸-¾?Ô ÖVÃ?v{»°VŠÇ?˜r°˜¯Ë?Ƚƒ”ÇÃÏ?VË,.åä¿V°1KØä¿VŒ .¾ä¿² ˜ä¿JûqÇd俨ÿ÷$ä¿’a8LºØã¿é&+@€ã¿•ËÓ¿ã¿ rýu«â¿MxЧ/â¿-ã4¹¢¨á¿Æ³‹é¹á¿0„Gzà¿F¥U§ß¿ÒGÀD—FÞ¿$7ô -ÓÜ¿Üg\äûMÛ¿$_Ôó·Ù¿ˆÍEØ¿¼ÕgR]Ö¿èÌ!•ÊšÔ¿JÜ:¨ËÒ¿žÕQ¹ðпÑæÑäοílÈ9Ê¿‘½uLÆ¿.›>éuQ¿BA€@–¼¿jÔÒów´¿V\¢ š¨¿Sz¦Šj¿ów¦Šj?'[¢ š¨?ÓÓÒów´?pAA€@–¼?ãš>éuQÂ?F½uLÆ?¥lÈ9Ê?ŠæÑäÎ?"Gõu®ã¿Ñª7R¢ã¿ùÑÿŠã¿‚7߯eã¿íâ8„5ã¿n¥Íhùâ¿åò±™±â¿ûB.C^â¿×Š$¨˜ÿá¿–˜«Ô•á¿åkõ7!á¿ÐÞ=î ¢à¿Ç…ëڛ࿠1’û~ ß¿aæp¡ÐÝ¿Ánƒ§`„Ü¿-ˆ‰&Û¿(_Ôó·Ù¿d¨7¡9Ø¿%žÌ¬Ö¿`•ûhÀÕ¿P±+dhÓ¿u®Ë´Ñ¿»k¿ éÏ¿\F{sWÌ¿u<–˳ȿ^:¢¤çÅ¿oSgžAÁ¿¬DÏó&íº¿Êhz“G³¿P58,§¿LΛû뎿ÒýÍ›ûëŽ?258,§?Éhz“G³?DÏó&íº?)SgžAÁ?:¢¤çÅ?1<–˳È?Û[F{sWÌ?ŸìG›™kâ¿_=`â¿ÿ3Hè‹Iâ¿6õ·5“'â¿Pá:húá¿·SõÒ&Âá¿+¯¯ñ~á¿Ó|ëCò0á¿ÿëªXØà¿+’†[uà¿ÿàå7à¿kC.b"ß¿‡ö!!Þ¿Pµ÷J Ý¿‰ú $ŠçÛ¿–ÄS´“°Ú¿Æ;îo'iÙ¿ÍEØ¿)žÌ¬Ö¿?p*Å28Õ¿ù"0·Ó¿ðvàž*Ò¿ *㦑пҹ¨m ÞÍ¿eǃ‡†Ê¿Š{ɳ’Ç¿[ÒÚ¿[¨Ã¿„AK5&À¿/ö6r3¹¿b8X—²nZæ¾?çT^¬l†Á?û³Ä<›Ã?R@krˆ«Å?’Å®µc³Ç?–‰ö=Œ­É?X(¤€•Ë?â»_ŸfÍ? U³À”Ï?`c`m¿YÐ?,dhH§Ñ? Œá%—ºÑ?Šré^£LÒ?,ÚÿDºÈÒ?tŒõ^-Ó?úESúqyÓ?MÈq$j¬Ó?@÷3ÆÓ?ί2¿ÆÓ?V-,›¬Ó?˜ñÒÖîxÓ?P' û],Ó?gõjÈÇÒ?í‰vKÒ?_Ó2Œ.¹Ñ? $Ñ?8ñ"œý¦¿Ü˜[?Á¤¿º:Â',¥¢¿( GŠŸ¿Ñ‹kÏŒH˜¿T¡t˜Þ1¿ W¶°ƒ6v¿ÓêÔµŽw?k(wÓÀ8’? r™[­¼Ÿ?ÿj-„§?Ì©]Ö³®?^¤r R³?´ž­[cj·?Þüè?6Yo¨!Ô¿?TÌ2p±Â?ûµøÀ›#Ä?Á`¦Wq5Æ?â_ ­9È?P¬Ø|+Ê?%ŸzÌ?0Ù"üÃÍ?ÿ‹£—ýbÏ?z˜1ŒoÐ??–`)Ñ?.Œxmø­Ñ?#`"b,Ò?7zJ³’Ò?ž¥{®xàÒ?ÈHÓvÓ?–;ä̺.Ó?*kÛÖ¡.Ó?œ¬=¹'Ó?~Ì.FïßÒ?Ù _,ï‘Ò?Sós%b+Ò?2 lˆ»¬Ñ?˜¨ G®Ñ?WÆ NmÐ?~žê4z¼®¿3Ü-Rz­¿ê1XY«¿}F.­zp¨¿öSm-Ĥ¿Ê(Œžy\ ¿óÀ*冖¿x6¿Œ5gš½6Z?|{>ÆŽ?|ÁT(‡ž?nÆþJ›Ê¦?ÉWdéß®?ÔLê@ ›³?;k¨{0Þ·?Œ=Qˆ²-¼?dÄÏÁÏ?À?\ödÂ?yÚ›Ä?ëÌ‚–'Æ?·Ï(AŠÈ?&îb@ÊmÊ?{|G„5Ì?ÛÐû’ ÜÍ?˦/F”^Ï?Ëvö¤\Ð?¨.¦TôÐ?nݹuÑ?ð°2mfÝÑ?.ZSk,Ò?x©"´¨aÒ?lbu`|Ò?”ÕFK|Ò?¼¢±ý[aÒ?gT!,Ò?lg¬™ÜÑ?`ÁºRüsÑ?ŽEK¸óÐ?ÌM¶Õ[Ð?:ÊüùZÏ?B ±$´¿¿X:©qƒ³¿Ò B½p²¿ÅÆO•ø°¿ÎPñºr9®¿J¦ E©¿ 7Þ•¤¿œç…äo€¿À˜Šž¿ö>0Õe¿8uH¦!Ÿˆ?Àå±s!œ? ó2zE¦?t(¤ðvî?tUÏvQ¸³?-g•.¸?äТ肼?¿[4õÌpÀ?Û™Lx—Â?FR±$¯Ä?þÍùKë³Æ?3ú¤¢ È?ððÄפpÊ?ø!©Ì?ÞŠp8›©Í?ÒLÅØ Ï?C¡)Š Ð?%ÔÌ5£Ð?ûûÔôv Ñ?ˆ´^Ñ?¾Æÿ9”Ñ?ï(xl¯Ñ?ò 1X¯Ñ?·‰™í“Ñ?iŒtê‡]Ñ?T,F³¡ Ñ?N©µ¢Ð?¢öìæÐ?0Ǥ˟Ï? ;ЉۥÍ?OKÒ­O¹¿?‘e¦¶®¸¿7y)ö•š·¿<³ó¢ ¶¿ºõ*³=´¿+ÇeÕ•ú±¿&1¦³µ®¿¤/”s4ɨ¿^ò‚¾¦=¢¿ãMå¦"E–¿·iËB-G|¿1²Ráô?@¢&¹™?ÆÄ8@$¥?ßr³´1V®?êó½K£³?‘züp¸?0Ï‘¼?}Š\yÀ?59ŽY›Â?•••À©Ä?Ù6;²§ŸÆ?bª¹—YxÈ?ðä–ðk/Ê?î;Ì:¿ÀË?7ñøR’(Í?Ϭ¤€cÎ?QiI“nÏ?û„¦Œ¡#Ð?h óÃuÐ?¦É?2½œù¤Ë?u¹SUÌ?Es“QFeÍ?ìO„@ëAÎ?ú«· .éÎ?à@RÔxYÏ?`²‚ß‘Ï?) ž¸‘Ï?üöÇmÝXÏ?Ì kxüçÎ?Ç)•Q&@Î?dM¨ñbÍ?Ï3kJoRÌ?¾1D1Ë?;¢É? À±½¥[¿Ék¹Ð ¿2¢oØÏ‚Á¿¾ÿªª¬ÂÀ¿4‡ÛÇjš¿¿g­÷˜#I½¿ J…Êú–º¿Ìb®dŠ·¿2æ•®¶*´¿„«ÿq€°¿÷TœÑ”&©¿ ¬Û ¿u…1®Äf¿¤£8;ì­W?ŠcƒÂ“?÷²Vq"£?9 W£¡i¬?•Ý®Êв?¾®ÊàY·?Ý€*Å»?f†dÀ?^ä\< Â?æPüÓùõÃ?æƒdê½Å? )™Rõ\Ç?Ž$ÝáÑÈ?î0¤©FÊ?u;-Ë?^7Åž¤ Ì?䩸²â·Ì?Ï-*Í?¥€®”cÍ?«¬—DlcÍ?oiÔº)Í?cªN¨¶Ì?ücÏÒ Ì?Å}ª*Ë?TŸ5LÊ?\¹ |SÎÈ?ÖoªÇÒXÇ?Õd ‰rpÅ¿¹xVÊ$Å¿úMkǛĿ®á0Ûÿg‡_F­ã¿"Òê ±·Á¿„®•"%ZÀ¿dëZóÉœ½¿hê0m0º¿²…w¶¿ÎIì{²¿TT‹ã‰¬¿Ê—Ï«…½£¿üQS¦N•¿$|ïÃAÎe¿@CAÞº?FtØÁz¡?^UŠŠÚª?R ²?JÇСˆ¶?«!'1)Þº?Ûâ§j4¿?ƒ PgrÁ?ö÷bKAÃ?¬§ÞjèÄ?R² ÉcÆ?hg¯fÔ¯Ç?St`iÉÈ?=úK¢à­É?¤‰[Ê?¶FX¥VÏÊ?Dfâ¼ Ë?EDƒr‘ Ë?‡Ž±ÎÊ?â¦UÍYÊ?:UØ(¬É?t;OŒñÆÈ?{ŬÇ?¡lYï"`Æ?B[Ëó+äÄ?m,àm¨È¿¼ÏÞùð_È¿©ëH.\ÙÇ¿ÏÕ`âPÇ¿‚¤Î÷¶Æ¿Ö;ÄìZïÄ¿ ±¨ZÿDmï¹2üÁ¿ÕgkÂ?À¿ï£†;’¸¼¿¼‘­*¿¬¸¿Š–â‘Ýe´¿ã:îY”ܯ¿xPÊS©¡¦¿€ÿþ˜bš¿õ÷q}¿|–9 çЇ?×1ϘGöž?Å‚ù³oÛ¨?¡í^>ÿ°?¤,_gµ?xèYl·š¹?ç¨{)æ½?:Ü‘žÀ? F.Í¿LÂ?þÈ wÎÃ?hì: Å?šŠ“^>Æ?~pɳª&Ç?¿Í¢ÃÖÇ?€VJüLÈ?¾&dËZˆÈ?Þ,ˆÈ?HKÒ¯LLÈ?bÄsrÕÇ?R1D¼$Ç?§~6Õ;Æ? Ýg×íÅ?À§m¹ÊÃ? XÖfHÂ?Ç®ÙÔ•Ì¿ü9Ù¿Ë¿”MyN8Ë¿3)½uÊ¿K®9¦†yÉ¿¸ó ‘FÈ¿*F” àÆ¿þˆÈƒIÅ¿Ämçæ†Ã¿Zÿ<‡œÁ¿Ív "¿¿Ö£h\Ǻ¿ÞÓö¨>>¶¿¯ü[ÏŽ±¿lÔYW ˆ©¿6IÏwl¦Ÿ¿Vä‘âuYˆ¿A‡dyá¶|?¾I‡¯!:š?ê~®:e¦?!O)ëX¯?Øßi@ñ³?“3ö‰­ö·?fdz»?= RB¿?¯Ê+‘Á?DRufŸmÂ?2U€ŽÃ?Á³8(|Ä?„óð/Å?ìL°oµ§Å?¢A? äÅ?4ÜI`ÏãÅ?Ô—fŸô¦Å?«h/.Å?æ† =žzÄ?Zz‘JóÃ?»tîhjÂ?DpU`¾Á?N0…a¿?ófùÌ¿…Ï¿“¬ï„¦<Ï¿bmBN0³Î¿‡»gµßíÍ¿p´~îÌ¿¸ØÓ¶·Ë¿´ð6âžLÊ¿ÏúlŽ¿°È¿‡t³èÆ¿ìâÙíöÄ¿„¾]÷â¿TëžÞ™®À¿¿D’¥Ã¼¿”Ÿ-j¬¸¿x›°«Ð%³¿w9H¹q¬¿7…‚¢¿@óìËy‘¿8'ûT|É]?wõo(Zµ”?ÞùÜoq£?„nœS–¬?hÀªÌ“#²?dI±îµ?“ñ¢™uf¹? /ÉY}‚¼?ÖáÚA;¿?Ò·c!ÅÀ?1ùøœÒ´Á?äÿ`‘jÂ?@ks˜äÂ?¯‚ãtÖ!Ã?;‚Åa‘!Ã?0P‚ë¿ãÂ?.DºiÂ?æf[D²Á?(&3%jÂÀ?'^£+±4¿?Ê'oK±z¼?ÜìæNj]¹?xÞȯѿ¬a*†wgÑ¿ÿO;!Ñ¿>ʃÍð¼Ð¿¸1D)ž;пkú»š<Ï¿è g®ùÌÍ¿(jðmÛ+Ì¿€oæ;]Ê¿z}àzeÈ¿šp¥CzIÆ¿(Ÿ«HÄ¿š;vX¹Á¿ó\$ª ¾¿0ò83²¹¿:aD³´¿¼X¥|ù_¯¿àtÛ· i¥¿Æ0ÀèÄ3—¿’&üSRp¿&©žMºŒ?’â9¾ôŸ?(¹£ÊC¨?n`˜Áö¯?kïfïO€³?þöm,¨¶?¿rlþOk¹?Øè û?v´¬©½?hEËg›¿?°‚=Ë* À?¼^݇NGÀ?Þ;ÆCûFÀ?¾LOW9À?*/–Š¿?þ÷IÒi¥½?·[ö’½»?”>èùžd¹?O§ö> ¶?‚ ®+ w³?@]íý\Ó¿caþ6Ó¿_1`k¾îÒ¿NONˆ^‰Ò¿nyu„Ò¿9›nêWgÑ¿ŠÃT¼S­Ð¿í}J³p´Ï¿z`Yy àÍ¿M$YîáË¿ç ð¾É¿q7uCE|Ç¿%yámÅ¿6o£&)®Â¿ðEEg.À¿¶¯ ýuL»¿rDÌ•7¶¿pîÂñ„*±¿õœ"Æ c¨¿ÆÄíÀ­b¿^³/µ]…¿dˆ¦¿ |?²‘¤ö—?º56%Ê£?6úŸÎŠíª?\ï–ʪ°?æb«Lw³?Ž_Q’×µ?2"„Ù&Å·?ÇÔŽ\;¹?èi}[¦6º?Èâ#¬´º?âò쳺?ú׹͖4º?wLj½(8¹?dØòÅÀ·?ñ—­þѵ?YÕÌÛp³?èÊæ"¢°?\¤Y‰îÚª?cÚ,'.Õ¿ÛçÇÕ¿â…w&¿Ô¿eÞî1ÂXÔ¿Ï»'„ÔÓ¿Ú º—3Ó¿)ÑOXxwÒ¿— –é¡Ñ¿äãGð´Ð¿á—q ˜eÏ¿{38üá;Í¿¦NòÊ¿.¹ÐŠÈ¿\ýNÆ¿…8@‘SŒÃ¿ŽFßÀûÀ¿”Š%§Ñ¼¿½T ›³·¿˜âŒ=Í©²¿ì3(°ö€«¿¼ú¯·&¢¿c;J[ú‘¿HÇaRm?N¿ÀìïÂ?E´D5’Y?€¼–š)¥?–DÙ_nת?|½*Ë{¨¯?I±¼‡È±?ß?–LÕC³?ÉLïŒB´?œ„!D´?Ë>tÁ´?™XÉ_@´?cá¶i‡@³?ˆı?ú×V&¯?^C¸8¨Éª?´%a7W¥?ùqiFú3?d«=(+þÖ¿ƒÖÖz/×Ö¿[ràŽÖ¿‰{h‘¤'Ö¿}5÷ò%¢Õ¿_—ÿÔ¿8)’xAÔ¿Ûh1à’iÓ¿\ ¶cðyÒ¿Û¸Ç&×tÑ¿è¢3†Â\п*P A¹hοÊÊ:ïüË¿žß2 |É¿J!›®)ìÆ¿@^:‡„SÄ¿»³m¡n¸Á¿µå7¯~B¾¿aäˆ(¹¿øSoàa/´¿£HNqGÆ®¿†3ÅC¿fÌ1oöý™¿¼¨Bk†íƒ¿KÿgÃr?°‰++ Õ‘?ð3<V? @>wû‹£?®…w§?ÔHÚëܪ?¼^‡åß…¬?ûs•ˆ­?ë«‹ꆭ?yn…Aj¬?nI!{ª?6yex§?¢ô´…€£?¾‚EK:?ÑäÇC´‘?‚2bG¬+r?“°“ÒÉØ¿_n}^£Ø¿ Ã@|ZØ¿o$i#Šò׿9e†žék׿º6³‚ÕÇÖ¿SwùÔÖ¿Z6¥¶-Õ¿/!.‹;Ô¿^ÑjaŸ3Ó¿Ù•ýuÒ¿, $Áìп°×±·fÏ¿ýŒN‚ÞÌ¿´Ú€?GÊ¿¼zø¼±¦Ç¿<ì¿ÿÌſݑ1öÍd¿›ÜÄD- ¿¿Sʲ0ß—º¿êÍS€ñ¼µ¿Å‚öþ4±¿༴Ý{©¿G§yÂz_¡¿# …bùé“¿†ÚAHrsz¿ZH t?â}3¥Ð?%ž™vì–?¯ á’ÿœ?BØDŠ ?C<1€ö¡?çOêGŽ¡?VW÷˜… ?œEçùñœ?LmlûºÙ–?ùÅ9€¢?öô¥à?°s?uA¯.÷z¿ýÕµý”¿íË{…ÆÚ¿OÜ˦5gÚ¿À­¡…Ú¿’Gï¬õµÙ¿>'ÞM.Ù¿Œ ÖΈؿ]Gï& Ç×¿Þ AÑêÖ¿v??b>öÕ¿’ƒ 8¤ëÔ¿áfÓŒÍÓ¿4º&²žÒ¿ªPa/÷aÑ¿î…Â`пÞ7¶.–Í¿¬Rý3bîÊ¿îÆ0 DÈ¿üOf°œÅ¿6`n_†ÿ9¿M&vÀ¿œ| þ^¼¿áÙÔÃ9T·¿\ÊÊŸE겿C<2÷„ ­¿¬,)æZ ¦¿6ѧ¢Ìž¿ ²–Ò”“¿#·(Iz‚¿¸ÛtMtžM¿=bñât?qN²‚?ú4Œ3×Õ†? ™?Æ!φ?ò7³“K ‚?Ì22ªx«t?4ËܼVéO¿R§š¼>‚¿üFý9—!“¿¾òrúžíž¿ˆ¸9c3¦¿ê"E·¥FÜ¿ìn T Ü¿´²‰Š×Û¿ÊnnÛ¿ôUP³ÒåÚ¿[õ?Ú¿r¸ ”{Ù¿3£ÀÁaØ¿÷´ó䉦׿}õ,ãf™Ö¿çåÍä‰xÕ¿lJ”a´FÔ¿XHÑÓ¿öÞ‡Çí»Ñ¿úÌ1iп&pİ#ο) FNrË¿1ΈÏÄÈ¿îuG»!Æ¿y†gÿ€®`¤fÁ¿˜%Ö¿˜[Ÿ^¯ÔÔ¿VlnÙ¹{Ó¿Œ³¤Ò¿î!Z§á¾Ð¿PýuÉ_ÃοÞö7ñ…̿Œß?ÆtÉ¿ïzí-‡íÆ¿€PõƒÄ¿—äÑõ=¿¡Ö"!À¿h$Ríød¼¿”!¨‰Çí¸¿ˆz‚2 嵿 Â7£3R³¿Z£8…;±¿­_lÕ=L¯¿]*QSº+­¿ù[Ìy±¬¿tÞåýK¬¿ ùt0­¿ø£ÆëR¯¿É€Ì@±¿R­+fæW³¿€iµ&õ뵿HXeêõ¸¿Ðœü ]n¼¿â?-ì܆à¿nþºm÷sà¿Óâ`qlOà¿uyc›"à¿X*iÚ(©ß¿¾ü’àþÞ¿`¶ö;7Þ¿6$Õ`ªSÝ¿¬ÝSƒ×VÜ¿è¿ñCÛ¿Ä O3ØÚ¿rP½Œ$áØ¿Ä_gê˜×¿ç ìLEÖ¿Ø£Œ‹éÔ¿ÖÚáU÷ˆÓ¿^ÑDð&Ò¿zŠÎ—×ÆÐ¿ú¡º„ØÎ¿Bj¦V°3Ì¿.ò¡/ø¦É¿ú2—'8Ç¿m€Šã0íÄ¿6CÀ®Ë¿u?<‹ÖØÀ¿fUZ×2¾¿ºÂŠh#»¿²ÁòÚŠ¸¿,ä|ð‰o¶¿0õvµžÖ´¿móž–þó¿Äý4'H:³¿p»Žk;³¿!/¦Ä!Ƴ¿Ì¦RŽèÙ´¿9ÖI©ýs¶¿U¯¡|¸¿”™^<*»¿à©êcä:¾¿ºÍ~|ÝÀ¿ç8R6Þ<῎[Üô)á¿Ç–:ÖOá¿:Á„$ÇÏà¿,öfª×‰à¿¾Z714࿼Ñ}îPŸß¿rw¤ÅjºÞ¿Jæ}â»Ý¿ÜMf(¦Ü¿îBå{Û¿›»9ºò?Ú¿[ WõØ¿ÂûV{;Ÿ×¿£éF3å@Ö¿Twf¹­ÝÔ¿0rë_úxÓ¿ÂB4Ò¿â}Ýľ¸Ð¿¸¦l3ãÇοiâ6Ì¿GÇQ¼rÂÉ¿~.Ë!årÇ¿NKÕÎMÅ¿Âì¶TVÿxŽ\ç`“Á¿“#VÕŽÀ¿!§N¿Is½¿w!µ8®S»¿L5²€·¹¿Mөή¢¸¿r¥‹Ü¸¿’J Ÿ¸¿Eí Ť¸¿?¶Àºº¹¿ÔÜé2X»¿ÈÚž¤Õx½¿lOá©ì À¿šš¤pY—Á¿« (ëZÿâmËËråá¿ú}Á¹rÒῚÉ{¿¬­á¿Â¼˜ãwá¿:Ê–1á¿{%ÀvÛà¿×3Yvà¿z¨7à¿Z•¶ÛVß¿À;àîÝ¿¯307¶ÂÜ¿R[{¸„Û¿ºyîlñ7Ú¿Ž>ÕÝߨ¿šï ß~׿J3š˜>Ö¿À(“,²Ô¿`œz(áLÓ¿žO,.þìÑ¿P¯PÄΕп¼€46•οçÌ¿H.•aZÉÉ¿¢Í£ŸÇ¿åÛçC¥Å¿ùªòŽßÿ`!hQ¿ñ»)¡Á¿ì¨â™Ü¿¿æÓǦn=¾¿º}è˜&½¿jëÞ­Áš¼¿ø´Œ§}›¼¿´‘Ò: (½¿‡ê–âÿÁ¿ù×›Tñ.Á¿dLœ¢À¿<*?¾9\À¿X¹Ñ”\À¿ô)Y—£À¿ÂK7z0Á¿F Åœú¿' 2Éÿv«T×5jÄ¿à­h ûÅ¿<3 ÆÄÇ¿öÛ©¼¹ã¿>.dWrõâ¿Î"SqZÐ⿚ë3šâ¿µ\JSâ¿$üšv#üá¿°‡*Ô–á¿ÑžáPº!á¿úsæø\ à¿Äv½)à¿"ÆbbóöÞ¿æùN§µÝ¿†òœ eÜ¿äJ—†ÍÛ¿ü:;7¤Ù¿Ôš¿6a:Ø¿`b½ÏÖ¿Qät¬eÕ¿JG]-£Ô¿Ô„`¦Ò¿À8Dz6WÑ¿xäû\п,úÒÁÓÍ¿^~݆P£Ë¿Œƒ“`¢ɿ#* U×Ç¿9¸–rDÆ¿ÈHÁóîÄ¿;oÎËÊÙÿ¸¨÷¡ÿ²+ƒzz¿öó?p­3¿'—LÚ4¿äil{¿.O·  ÿu>µ·ÓÛÿ„æÉ®ŠñĿⲚGÆ¿[6¼ÚÇ¿@`7§É¿º@ ê€ã¿Å«µ |m㿈‹Ëò8H㿯nõʲã¿ÌÜ»VoÊâ¿9YÏs⿘ô¥È™ â¿eÏåuÖ—á¿ãôêñá¿*Íš@'ˆà¿.CÙÔ¢ßß¿¶Ò€ÈœÞ¿~Ï—ÕJÝ¿p.”íÛ¿–: »±†Ú¿ D#€HÙ¿8ž] E®×¿1/„”&CÖ¿«ÕÊgÝÔ¿[yL9v€Ó¿ ‰gÞ©/Ò¿{°ö<îпÅ' ˆ~Ï¿ÌMKÍ¿>þ°.HË¿lHmEzÉ¿` m ‡åÇ¿càÕƒMŽÆ¿€.dó»wÅ¿&²2l€¤Ä¿¼fŸÄ¿EâsÏÿÆâŸÆÏÿZ؇ĿÁ)‡jï¥Ä¿¬©Ò³yÅ¿gqSKÐÆ¿SG—èÇ¿²zA¾}ɿܜJ‡cLË¿6N«»æã¿“’!"%Ó㿈à Nµ­ã¿l­Õ@ôvã¿.3èÜl/㿚63Ñ×â¿ö±õpâ¿7=çÉÏûῌ¹×²{y῾DÁ½4ëà¿ù^s7URà¿b ¦¤`ß¿<_%»p Þ¿wúHM®Ü¿5-—À—FÛ¿yh½ÁÙÙ¿<2A™JkØ¿Òÿ¥µþÖ¿P8Ú±—Õ¿% hj 9Ô¿fßâíæÒ¿/ä8S(¤Ñ¿ÖG#èsпuÁ–¥0²Î¿¡¾´«Þ¬Ì¿m‰ ÜÐÜÊ¿1#2{FÉ¿-³q=ÄíÇ¿™SV˜ûÕÆ¿¶CÈöÒÆ¿Ü(}QsÅ¿(BƒÔ+Å¿r!v…!,Å¿·•Gæ-tÅ¿"AÃÔ2Æ¿å²màׯ¿ÿ*ê0ðÇ¿£é²pIÉ¿àCª(SàÊ¿(ÜÉzñ°Ì¿¾~U9ä¿Ð›™˜“%ä¿ Oòÿã¿rŽ1ºõÈã¿Tú 2ã¿×ÕO6Z)㿃Ì)k=Ââ¿ AÂÎLâ¿ïˆ‘«%Ê῞›z ~;á¿>Þ}#2¢à¿ÄKÿoÿß¿æ¡47:«Þ¿8å–KÝ¿R·/âÛ¿¼¾’/tÚ¿«æP‡Ù¿âcˆ‹¾–׿HŽW.Ö¿#$ÆÎÔ¿k€=k{Ó¿LÚþ‡7Ò¿&÷,8Ñ¿ WË>ÓÔÏ¿Ôþ«ÍÍ¿pòòUöûË¿i9*+dÊ¿-ðÒ`5 É¿õªÄOhñÇ¿ ùïÍxÇ¿Ò (bpÆ¿¥Ð€¤­EÆ¿W\1öEÆ¿`3xª@ŽÆ¿ˆM…ÈÇ¿Óè8óÇ¿ gûº‡ É¿^í¾ÈgÊ¿¡¿º{VÿË¿¨ý…˜ÑÍ¿&l#ûx俜‘Ódä¿!™½8>俎¢Gûùä¿Æ@g°ÿ¾ã¿Šåýf㿃+¸ÿ⿚ÊE=Šâ¿„×¢þ5â¿XéçµHxá¿…éíB¬Þà¿îObž×;à¿E+Iû²"ß¿.Çš¨ÁÝ¿4кBñWÜ¿ güðéÚ¿*Ú9—nxÙ¿+Rî± Ø¿N 3V Ö¿6ÌRyÓ?Õ¿‘&$ŒëÓ¿ñâó”Ħҿ¬j¬&›tѿݰP†Xпš,qù`§Î¿.×tVÔÌ¿ ±£l^;Ë¿£?]gàÉ¿ÑùÖ²ÇÆÈ¿î¤Gß6ñÇ¿œ ˆÀaÇ¿î'²íÄÇ¿»s8Ç¿¬0NăbÇ¿¨btòÇ¿°ÕåN€ÈÈ¿ºõ2âÉ¿&Òë>Ë¿tlßœ×Ì¿ÿ’µÇ"«Î¿êøEáx¢ä¿äàÜ}:Žä¿jQïhä¿QÄ”Î}0ä¿6·ƒe^èã¿® Ë]㿺×`!)ã¿ÎÜÆûƒ³â¿<ù>.—0â¿Ð‚(•¡á¿á•›Ùá¿›ÂʼnÜdà¿=ÌLŒ[tß¿2sé3áÞ¿“Ö讨ܿªüA3?9Û¿ÕýœÈÙ¿ó“ê÷ÉXؿɡ×îÖ¿þgÀÖ¼Õ¿0þØ%Þ8Ô¿²›\‚óÒ¿è 5ÉÀÑ¿ÿdÂ3¦£Ð¿Ä•躭=Ï¿Y¯¶‚ºiÍ¿öÁ’óÏ˿ዃ#ItÊ¿çO©²ZÉ¿ôq„È¿Þ7;;MôÇ¿màË4(¬Ç¿ƒÄ[êe¬Ç¿¤+KvõÇ¿Nüöë;…È¿S/ªö´[ɿɠ­U`vÊ¿VY1…ÒË¿ìÅé‡ÊlÍ¿œìù?AÏ¿âÏAJV¸ä¿Û"ž£ä¿°I™Ý|ä¿nPoÕD俯y P†üã¿TxÉࡤã¿1þ£Ö†=ã¿­ù÷Çâ¿ £úôEâ¿ÂÁÈ¿ë­,s˜É¿ÙÛ Ž¹³Ê¿þõ]´›Ì¿“>¢¾«Í¿(õZƒ.Ï¿‹Žšý¥ä¿Gm‹dä¿$ëdè–gä¿»€Øó.ä¿fÊ »åã¿ÆÙÌ×áŽã¿ „Ã4Ó(ã¿Âݪà³â¿ªP#ZT1â¿5æžþ„¢á¿¢p•YÞá¿ óêYáeà¿:yFvß¿o…œ޿p6=XªÜ¿¨FÉÐH:Û¿ÈýšÀ¸ÈÙ¿”hhÂóXØ¿¡‰KàƒîÖ¿Ø¢SöåŒÕ¿Äd,7Ô¿xÀ•ŸžñÒ¿ÿ…€Qa¾Ñ¿Œœr¾ Ð¿ ²î6ì6Ï¿fÖbÍ¿¸xćÇË¿8² n-kÊ¿ä°*fPÉ¿Y/ÖìyÈ¿SnÐtÓéÇ¿ÊÕ|¡Ç¿,¶_ê§¡Ç¿<™*3YêÇ¿LhAGÒzÈ¿»£¶¬QÉ¿Qe%×lÊ¿òq·_—ÉË¿Õv¡þ‘dÍ¿_ÞL«Ò9Ï¿¯ØØ{ä¿SµiPfä¿ú± ©=ä¿âRF¥ä¿£4̼ã¿HN~/$fã¿Ã³>;㿤÷%u‹â¿ö^¾Ä â¿iÈb€zá¿8Z‚dáà¿z÷åJ>à¿?£-«ˆ'ß¿<ðTˆEÆÝ¿Â§·ñ4\Ü¿s2ÔìÚ¿{!­{Ù¿À]y«M Ø¿è6j9?¢Ö¿‡Å?þ@Õ¿<¾¸ÑðëÓ¿>8P`¦Ò¿ÖxCnsÑ¿d…_ÉVпÎJóp ¢Î¿Â´kp¨ÍÌ¿`ÛZv3Ë¿šKÊk×É¿SÖ!iä¼È¿À®šæÇ¿fŠt VÇ¿ÅQ†UÇ¿[ÖéçyÇ¿ÔS¼WÇ¿*„fçǿ敩( ¾È¿º´#pëØÉ¿ùåŒS5Ë¿G衇æÏÌ¿èÅΆ°¤Î¿„®hŸ{<ä¿f6Kœ7'ä¿å掞Èÿã¿ÃAý%Èã¿9šäõ€ã¿Z4Tö*ã¿#‰ÖÿÃâ¿­^½îLOâ¿¿p'Íá¿H "Ó>á¿`ŸÀ¡³¥à¿¤µávDà¿"qò]/²Þ¿v±•£QÝ¿X5ÖÉKèÛ¿»AçP£yÚ¿ìbúG2 Ù¿=.…š×¿ü{7#1Ö¿Þ†¹˜ˆÐÔ¿,Å­|Ó¿Ë@‡/7Ò¿Lkœ·Ñ¿ª‘Fƒ³ÏÏ¿êòÆô†ÆÍ¿jþaËïòË¿8}ÜhpYÊ¿2eú/üýÈ¿2|ŒÄíãÇ¿$³çÆþ Ç¿‚CVo@~Æ¿æŠB*6Æ¿0¢—›,6Æ¿ô­£y¢~Æ¿Qã8ž¯Ç¿Z;‚°îäÇ¿¢¨àOÿÈ¿öÁŠË[Ê¿‰C¸áîôË¿±Ôs¯áÈÍ¿â¿Íq+éã¿ìkÔ¾ÞÔã¿ ÝÙR ®ã¿ƒMNxã¿j1[1ã¿vªùà\Úâ¿ÓÖŽy?t⿎SŸ¼ÿá¿Ò‡?ã}`1ïïà¿Üþmñ;Wà¿”ËÚ‚jß¿¨·åÞ¿›ò·Ü¿¶{Üå5OÛ¿¼9Õ:ŽáÙ¿ÚŸñvrØ¿èÙòŠj׿̭í%þ›Õ¿­—P<Ô¿J ¥ÃèÒ¿jMmxž¤Ñ¿¨´Jsп¬k¤¶­Î¿±Í ê٥̿‰Òú nÓÊ¿½°”ó:É¿ÄAB{ZàǿܵÜ%ýÆÆ¿`“QX“ñÅ¿‰>2-bÅ¿æ]5”#Å¿Ãx'Ý9Å¿”šÆE|bÅ¿úxgâ'òÅ¿~7CTØÇÆ¿îç«~áÇ¿&Úqa<É¿—'L(*ÕÊ¿Úwƒç§Ì¿¶ãÕ*Bƒã¿Ü%B%“oã¿”ÉM8Jã¿Ø¤Ò¥Lã¿Ë ©Îâ¿ É:^wâ¿hôšÒ†â¿%n<_á¿ø¦ÌõῬ‰€Žà¿ú{>œ±ìß¿)‹jæ©Þ¿ÀÊV¹WÝ¿P÷kùÛ¿À$¦ƒZ’Ú¿ª•ëÀü%Ù¿÷³±íӷ׿Žû,ÑfKÖ¿:d“8äÔ¿¦Æj¬½…Ó¿¼òi3X3Ò¿è^´Jðп¸±£eÏ¿Êÿ|ÿHÍ¿?U_[ÛBË¿Á~F¶øqÉ¿}PˆkÔÚÇ¿ å—]Æ¿„dQéhÅ¿)éri/”Ä¿T`!ú=Ä¿nI7j½Ã¿·°Ò&y½Ã¿²("pyÄ¿`UØq¦”Ä¿ åúœiÅ¿QªŒùN‚Æ¿·Õ°ÜÇ¿äàÉ nsÉ¿ ô@T—DË¿`‰I ã¿Cû’øâ¿|^Åg-Ó⿦€I ú⿲ÊqOX⿞_v€ â¿ðGJ²®œá¿w×Ùå )á¿.g3¨à¿¡"žR^à¿„TX7Åß¿÷’ˆfÆÝ¿¶Ü:¶uÜ¿Aä ðÛ¿&£&yo³Ù¿mRÔ¥HØ¿!ý**ÜÖ¿&‡$‰0qÕ¿\FŠ)ˆ Ô¿NË4aˆ®Ò¿£?iŽ]ѿۊÚп(¼V©˜RοKâǨòöË¿Ïãpå­ÅÉ¿&-¤¼5ÄÇ¿©=ß÷Å¿½}þÿcÄ¿ ™ò¸œ ÿa2â¥÷Á¿ˆä!;Ì$Á¿ics(—À¿„ÙÖÝOÀ¿¥8íÜOÀ¿qóÇ,—À¿ÂD€'%Á¿ÕºòÞøÁ¿»jµ÷$ÿ|M+$²dĿθø ^øÅ¿DBÅÇ¿Q`ŽÁèá¿aA úIÖá¿Æ9íýi²á¿$Á9Z~ῼò÷Þå9á¿ÎRìä࿈g«ã€à¿^Q˜Í©à¿“ö s¬ß¿|Ž&õ@Þ¿äÏØ‡¼ÜÜ¿”JÿžÛ¿ìTñÃRÚ¿c&J6ùØ¿Œ’ ¯—׿$âõè0Ö¿ŠÓ@ŒUÈÔ¿wË•paÓ¿´ሮÿÑ¿†™Xrx¦Ð¿¤DFE²Î¿`Ù áÈ5Ì¿Ô(Ås ÝÉ¿ÑJ—¯Ç¿°¬†4±Å¿¤ÃaÿæÃ¿ûÐúÓÌU¿ñß÷[Á¿qÄ£pðÙ¿¿.€.‚6¾¿$‚‹Î½¿)DT¼¿.w+‚¼¿B ^»É½¿øòõÂÎ6¾¿ˆ/ñXÚ¿¿–!ÈͬÁ¿¼v^˜;V¿îWdÓçÿ”bw±ſ Þîw@á¿@á e.á¿ù~x á¿ •íœ×à¿äŒûiÙ“à¿=<{®¤?à¿2žPڸ߿ܖgÀÖÞ¿dËDPÙÝ¿téÜ*ÜÄÜ¿ø9MKn›Û¿þÖS€ã_Ú¿Ú‡pàDÙ¿ÆåˆÀ¾×¿^Né¡_Ö¿h|ÞJûÔ¿¤™Z'•Ó¿̬0Ò¿³‘³ìIÑп„.Ñ.Äôοä!|Gˆ^Ì¿ 3œ]DæÉ¿ùžUV’Ç¿>!v’·gÅ¿à+¨—Œlÿ¤·p¶y¥Á¿P½‡ÎåÀ¿ß  X‰½¿°$)'d»¿u½‘P‰Ã¹¿Rç3Vˆ«¸¿rùÙ™®¸¿ôƒZD¸¿ß.úôX«¸¿Jk~Æxù¿ò¨èI6d»¿N" Úˆ‰½¿]¨¹~À¿ÀÔ—R¶¥Á¿ø*ÎÝlÿ‚.—4Šà¿"r4]ðxà¿æDƒ+5Và¿Nñø×v#à¿.NÕFòÀß¿!ÇŸ8ß¿6¼¢ŽUÞ¿¸â¶tݿݯ|pìyÜ¿–e0Ÿ¤gÛ¿F“L‡@Ú¿VIC{mÙ¿S¾)êZ¿×¿Ø<ï’wkÖ¿þÔuÕ¿¨¯Áßg­Ó¿ugÍWýIÒ¿¨âL5èп(þ™UñÏ¿vvÈ×HnÌ¿°ŒÂƒÝÉ¿JŸ;ÙviÇ¿þa騵Å¿û•ùvó¿hß9Ä üÀ¿²§V«p¾¿ª=îaY»¿Y„)¸å¹¸¿Á›–丘¶¿¾ËÉð#û´¿(äô-)峿2¸“RJY³¿„8\xY³¿¢]óÎ䳿äØMÇÐú´¿aBm˜¶¿~O‰¢¹¸¿}“¬F(Y»¿íçè´}p¾¿Ÿ&qúüûÀ¿ôœ/i‘5Ö¿:ê{P²-Õ¿?ü?ëÔ¿¾w©ØèäÒ¿˜Â5÷„©Ñ¿ÚCâ²Ábп„)L'ο0[âjË¿¨ô¿®ÐÓÈ¿+ÇE+Æ¿™¢ZŒÃ¿ÜΤt‡ýÀ¿†ù|,C ½¿w‹–ËR¸¿BGc˜ß³¿iΣzàx¯¿€uJ’¬æ§¿°{í^¡¿å£/¬O–¿Õ€9kkˆ¿)g•äÕp¿Þ ms¹a?šoè˜y?2‡”t?hÈ@Ï?“Õð#©y?dí~?åa?´¥ÁkØo¿‰Y/еZˆ¿–hÃÚE–¿´§Ñ’·¡¿FPØCà§¿¸Õ´ KÈØ¿XÕÆM£®Ø¿ ­ÛÍwØ¿ŒÎÒ!Ø¿ |ÂÜ<¦×¿N Ã*׿D物˜HÖ¿Þ:3ºqÕ¿:/Tã‚Ô¿(Þõ~Ó¿€¨'¼eÒ¿a$-X<Ñ¿›Ž“ппf>ÆÏƒÍ¿š(S–ÍíÊ¿’? ÒMÈ¿æý¦ñTªÅ¿îÄñ9Ö Ã¿ 4ýÓrÀ¿ ù1Re×»¿.žŒlõ¶¿º¸¤ÓK²¿{HæQÌ«¿¾›³œ¨ž£¿ï3pîE˜¿ë—%J¯…¿È;wY™…M?HRô€‘Ð…?ÙÙ“?7FI³*™?‚À(ïƒM?ð¢hÿbŸ?º߀ådŸ? ÆÒ5R?º3á]11™?œèA) “?”º²çÞä…?xÖ(6O?žNæs“…¿_= ¸6˜¿g9oúþÖ¿æû;ÅgæÖ¿na¨k°Ö¿äˆ hZÖ¿è·*ŒáàÕ¿Vå,itCÕ¿C§9}´ˆÔ¿Sh¦ZÔ´Ó¿èØq9ÉÒ¿¢±óììÇÑ¿VxüP>³Ð¿šžg¢|Ï¿”“Þ]b´Ì¿¶è%¾7Ê¿µ^aI…©Ç¿xc © Å¿¤RaÀ;w¿!Óûˆ¾¿¿µNíôC¡º¿óÊðQ£µ¿¡´:Ѱ¿.ŸûÖl¨¿™qÃøR{Ÿ¿à —„¨Ž¿ôN½1“A¿p•yhåm‰?ˆ=eU˜?ˆÑgì¡?`’nùá¥? è-›#¨?ˆµs4†.ª?Ÿ N=6«?Y‘4,7«?§’|„.1ª?ã0ÐY'¨?¦¦¯º¥?ºE^Îá¡?žæPb“c˜?²ˆ+KÞŽ‰?hã9ëOp>¿*­ÙV4Õ¿ìÙ \ÍÕ¿4Þ¶ï¯ãÔ¿X¶ƒiŒÔ¿îLXðÔ¿^Ö1åˆzÓ¿¾«mÄÒ¿¥–ò‚ìóѿכT’ Ñ¿öde8–п¡~GåÄûÍ¿þZ¶­ ¹Ë¿j,â„ZÉ¿¬#‚öåÆ¿ ³jaÄ¿]cÖÓÁ¿6ysÌx‚¾¿G F€d¹¿²oê©âX´¿ö8V <Ø®¿Öa–ðËT¥¿”¾Ã~˜¿ZGl}¿›Ö%Ý)?#šKÈN*—?‚ïof ¢?`LÔ>íÛ§?Ë×xw¹¬?_L1ÔsV°?P"<ï2Ö±?¯1<ز?âÜPZ³?د2ÞäZ³?q\‡Æ¶Ù²?üÅÊePر?\Ÿr6Y°?’SçæIÀ¬?–'ä§?äl(>æ)¢?ÑÜ2&@—?œ¬S3ãiÓ¿T´è†PÓ¿¦®¦Ó¿zk2¿Ò¿ð•€·GÒ¿Õã%”§±Ñ¿ÿhÀt<ÿпõ°£µ3п¼TõAžÎ¿[8Ñ:«Ì¿áŠ5’Ê¿”ºö1XÈ¿+Ö'¨Æ¿>èßT—ÿñß¡-Á¿k{es¡.½¿ÿú8dí¸¿xÓCų¿£™ÝI3¬¿lìÞ7½}¢¿fê,Âï9’¿ ~j¾À4¿‹&Æ»\”?QmwGT% ?Är糩U§?ï²ÍELÉ­?ö Zt¸±?ãØ¹/´?ðÍl½¶?R«‹·?T,©‘‰¸?i|–®Ý ¹? ›x. ¹?Ô‡›0‹¸?+{Åx·?\GªOÓ¶?ùŸ©éð!´?Œ.ð/­¼±?É{8Ô­?bûÕÏöa§?jMÔfÊ Ñ¿Øc›Y‡Ñ¿Tà5F3MÑ¿sdÐ"öпšiO\X€Ð¿Œ½›GÚÏ¿¬”œ¥~|οŽÁÿíë̿ޱ/z+Ë¿R'Ü’æ@É¿KÆ_µ‘0Ç¿›¤|âšÿÄ¿†¦©Mm³Â¿ ÖµQÀ¿…€J­À»¿´Êzê²Ê¶¿¢×þÁͱ¿P”á°g¬©¿ìèŽd\ÁŸ¿Ø’H8ˆB‰¿4\Øt `w?¶üŒ˜|—?ÚAR¤?:¦‹bÍ«?d¾=q±?è§‘Ÿž´?”éFKg·?¤+o¯0Ĺ?Üt„tl¯»?>ú)ñ4$½?:¹Gç¾?¹ä±óW¾?‘Úõ†ž¾?.à˜Dª ¾?"zð£È&½?›à7Ó²»?©[0wmȹ?zÚ fal·?ó? Å“¤´?„j›+õw±?FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,84) (39,119) (0,0)) 5 D(sÁç?ë‚í~t²ç?ôû ð?•ç?$¼_ÏŠiç?{}©k/ç?œ¡5bùææ?ŽžZ_æ?¦¦ãäÓ+æ?ÍfN—¹å?:V/Õñ9å?èQÑV3­ä?ù¼øK³ä?õÉNÁÐmã?PØ<ò»â?FŽ›‘…þá?ÁÍW¦ÿ5á?ÐÔ3Übà?–@,ï: ß?îJNÚ—=Ý?}ó¦åë]Û?â ¹ì^mÙ?”ö}2#m×?Ülå¤t^Õ?ÿ}=˜BÓ? %‰ÚÑ?Âþ‚u ÑÍ?ù3ô'ZÉ?`xJzŒÓÄ?æ˜@À?èú’=E·?";cáÞ÷«?(2Ú¨’?>-øs9«’¿ú†B‹zù«¿WÄE F·¿À9û˜€@À¿`9Ž\õÓÄ¿é:•ó‘ZÉ¿:kЋÑÍ¿}*~Ñ¿ ³¹ôXè?IX€EûIè?¥Hý1 ,è?wÙ™»;ÿç?³>”ŸÃç?®zíÜXyç?ñx™(“ ç?*=.5…¹æ?¹mî‚oDæ?ÛzµW›Áå?oY¤@Z1å?odÓ”ä?øì‚ÿéã?uétq°3ã?ÀÑý<‰qâ?«¾àÁ¤á?I —Ö˜Ëà?È?¨Ñß? ÑÙL~øÝ?HTÌlØ Ü? ·Ô£åÚ?¿Û£Üߨ?vÛé çÕ?YÝܾ³½Ó?²9Í¢/ˆÑ?x'·¼¶Î?wÒ¦É4üÉ?HN ò«XÅ?Î-ø§À?ñZÆ þÙ·?’š«ª¬?ptV“?†ÜÜw"“¿ÞÝ¿A=¬¬¿¸9<ÈÚ·¿êt³^¨À¿Dû·!YÅ¿,Ù²ú›üÉ¿¢Žß'ο»l“dˆÑ¿ŠÏz|Ýè?@P†q7Îè?ÓÙ5¨¯è?( áè?䔂üDè?;ùç?Ä:Æ2sžç?(À`¡35ç?@ C° ½æ?Ŷ™Å8æ?”óé겤å?—u_å?bCÆcVä?_~à×3œã?…1ÉþëÕâ?o¬÷çâ?B³[ 'á?á Íl?à?š«‡þž›Þ?8_£$…¥Ü?ê š8ÀÚ?þPÓ…Ø?Ø ªA^Ö?ߊ²Å&)Ô?³‚«®œçÑ?ø³706Ï?è7·¥‰Ê?GÊ«ÅÜÌÅ?¥?c¢Á?E¢GÔ[¸?8÷Æ »F­?“£æ|‡“?“|îB‰Š“¿˜‰¿çAH­¿A}Áe˜\¸¿g÷Á¿D„ @ÍÅ¿¢ ±1 ŠÊ¿.óot6Ï¿‡ôdôÏçÑ¿-ç?Né?ÃüØ»”>é?ÀÓ}é?¢ sçðè?öURí²è? &!µeè?Nö“òm è?&1™ªPžç?¯`›Ÿ$ç?—MkO¦œæ?D1#¹æ?Jç™ÿ4cå?W±²ä?¾*£©õã?R‡ÿÆ:+ã?§nìžUâ?zÕæA²tá?Ï—NB‰à?¶îèá>&ß?€ÅùùB'Ý?¥ÛâþKÛ?ؘ±5 ôØ?5‚Q.ÃÖ?’ÅÂôu„Ô?øA<<´8Ò?^@œ kÃÏ?K0xÖË?åJ³™/Æ?ùï­OÁ? Öež)ʸ?˜¢³3ZË­?rûD¿à“?ŸtjXöâ“¿P‰•ÕÌ­¿¶ÞLåçʸ¿˜3ムPÁ¿™Û3áù/Æ¿"wh7Ë¿‚ôçÌÃÏ¿ä¹å8Ò¿|Ò;@ªé?šÛƒ.‡šé?f ð{é?¾˜#ãÂKé?3Z¿æ é?üsN'”¾è?8n…û`è?KuçáVôç?[™¬éxç?ð±]}ïæ? &ÔðVæ?,Ë%Û±å?Œ°Ø)ßýä?Õ„¡†²=ä?u!¥ qã?óößb˜â?PÔéíC´á?Jö“‘9Åà?¦¡‰®—ß?.,Ÿ»m‘Ý?°HÖgðxÛ?¾EvOÙ?’à?v×?Š®H¼-ÏÔ?½ñß©{Ò?ÞEQ°‹Ð?¼Ú0ü0dË?:ÙAÃe€Æ?¬K½¹ŽÁ?Ü*0ÿr$¹?n¥ô6á7®?ÿЯ“q(”?Z*?O+”¿>¿ð†P9®¿Ôð"+%¹¿AJl+Á¿À‹æ®Â€Æ¿©}‡ŽdË¿ ¼X׺пk ÜE?{Ò¿ï¯ ÷iñé?Þª±0Œáé?­žo´³Áé?$’‰?ó‘é?ÿïO„hRé?'¿«h;é?⋤è?\¯þÉ6è?d¬—ºç?«\šbœ.ç?ÊÖ—1æ”æ?†LŸ®Aíå?E8+8å?«VW˜Ôuä?}ëìèó¦ã?å2&ôËâ?ßâ†u\åá?ÝZ÷»óà?øYJïß?hx]KlãÝ?þŽy/ÅÛ?ŸæÄ‚±•Ù?¥÷tO|V×?³°XYâÕ?_‘†CO®Ò?€ão°6HÐ?n_Ù¹&°Ë?A©m̾Æ?¿brßj¿Á?*`c1.j¹?ÀZùг‹®?T#Íàf`”? >ª+c”¿ˆ¶¯M®¿.e3ñßj¹¿2¸Ä¿Á¿UH#õ%¿Æ¿BÙh»€°Ë¿x!ôûcHпT”‹è|®Ò¿ÚW»4#ê?äÝ,s+ê?ì ê#óé?O®Ãé?¢_+Uû‚é?Þƒ43é?.®h ßÓè?{Oà6eè?a¡çç?Ꙍ¼ [ç?ÎCÞ-Àæ?䡉CGæ?‘ÎKÀ`å?ýýV¯ ä?ÜÌã?¼õ£˜øïâ?ÅxÖà¦â? Ÿ:i6á?ØúÄ\=à?ŒönưÞ? ¸>‚TúÛ?šÌç¶ÆÙ?ÝÜx”3ƒ×?œOò/1Õ?Óøð[ÒÒ?~Sä:igÐ?ìQ¼A4åË?«*¹aêÆ?·› máÁ?‚’Œâš¹?Ž*ô#@Æ®?#»‡Í‡”?¡”ø*Š”¿îèˆú•Ç®¿³]“¸›¹¿HŠÜÂáÁ¿5œŒÂ·êÆ¿n蔞ŠåË¿=!œ”gпST¸ùEÒÒ¿ìÚí>ê?Õ4:ø.ê?xBŠËê?Õ¶ó}Þé?ÎjcÑ1žé?P凞Né?¤CRTîè?¦&ƒ3è?Ø|âžõè? 6Îésç?8JMeØæ?D «É.æ?¡4–¾wå?ù®¯Zø²ä?qnìáã?ß®þã?W¦]Õâ?óÒÀja&á?cúZ'à?tÍ+¥¸<Þ?θTÜ?+Kë!âÙ?žþ%6œ×?-嬺GÕ?Á¾F`æÒ?Ý|h6ÜxÐ?Ò¦à«àÌ?™—RÂÇ?EA(ÝrôÁ?žÉ”!¶¹?–Áô“ç®?çiu@c”?›ÐKôŸ”¿Ÿ=J访̤ºˆÅ¶¹¿Ý×3ÅôÁ¿ •ÌÇ¿ ’ËQ3Ì¿Ÿ££yпõÝ)ìHæÒ¿ÝÀ·wwDê?¶{Ù“4ê?±o>dê?ÔP“üäé?C(Pý§£é?(üÍrSé?Ž2Èšóè?‚¯Êë^„è?:Êc¾è?†¨I{×xç?£ºþR1Ýæ?žÁ¼Oq3æ?&|å?øHùN·ä?³Ë×åã?_ÒÞ°ã? 5<…Ÿâ?pcº’ø)á?…Üy»»*à?òŒ¤Ñ CÞ?¤dyTøÜ?Îìë ŒçÙ?‚, '¡×?Qp·½.LÕ?ÜåêÒ?fg²ÆN|Ð?ø„¬½Ì?{ž“Ç?2Ñnƒ5øÁ?ÒŒa}„»¹?@(x!~í®?îÇ1ï¿¡”?Ùì ’6¤”¿öuy¹î®¿Ž/"¼¹¿YH°`„øÁ¿› €âÇ¿ÀÏ}’ ̿ę‰;v|п"ÞC[;êÒ¿/7̾p3ê?œšZð²#ê?ò „ê?œ^ÖDÓé?:g(Y“é?ÜQG¦÷Bé?ß~ø¨Xãè?ÿdwatè?$/!^Uöç?‘í..ƒiç?úëæ0AÎæ?,+jï$æ?ÌÏòômå?è]Åéä?ôi iÔØã?J>Y¯§ûâ?þ@ÞõÅâ?¹•×¾á?n,Î( à?8xÞ´A/Þ?”Š <” Ü?ú7aòšÖÙ?ûÛèC²‘×?ˆY(q@>Õ?)¬²´ÝÒ?*?S†qÐ?p¥göË?pÈ;ÀƒøÆ?/1!(uìÁ?~X±ª¹?î7ÔGÙ®?‚BgL””?æq'•¨–”¿º°XÕuÚ®¿#sBH«¹¿ s‹ÀìÁ¿ïU ÏøÆ¿d›Å²öË¿üPÊЫqпSS ÚÝÒ¿#eüÕ ê?M‰)Ø%üé?»ÎüCÜé?¤[´)à«é?Ì9ï!ìké?¤Ð³aPé?³××<½è?ªçÔêNè? ~Ó^Ñç?+Re¡Eç?ÀºŸK«æ?ÄÀ£üæ?Ì¡yÀMå?8ãÚŠä?M4]weºã?sG ˜‹Þâ?‰©ùÄ÷á?/Öë´}á?Žùmà?:]f:÷Þ?à=$Ž‘àÛ?×¼¤ú®Ù?¶ kÑŒm×?.Ça-¬Õ?ެܻÅÀÒ?NÉÒˆNXÐ?îI|……ËË?n— IÕÆ?Ú-JÁøÐÁ?±ÕÜñUƒ¹?´mxü©®?¹µZÇt”?™Qðôw”¿ÆFr9«®¿Û–à 惹¿w§-²@ÑÁ¿4.?[‘ÕÆ¿4ÆùÌËË¿ Å’rXп<“éÀÒ¿Aƒr2Ïé?]iølɽé?¾¯½eé?øWµƒmé?`çßk.é?yyÝ0ßè?E0 ÿ€è?o“°7¶è?/Ç@µ——ç?dØ®Ôî ç?`ZtVtæ?à-ZÍå?ºkïV2å?ŽtÍ2Xä?¬ URŠã?|Šs-°â?U\—DGËá?ØÏu-Ûà?¶ûm¼Àß? ðÉØ·Ý?fÉd³¡œÛ?«AQcpÙ?·‚¬¨t4×?~^m6êÔ?Mî¹'“Ò? óˆUy0Ð?2Ï É‡Ë?Øý¾á¤Æ?þ̃Ž¥Á?m3]*E¹?Z¹y•E_®?Lðá'öB”?*¥á$E”¿Š øIY`®¿]:>ì³E¹¿Cà¤Ò¥Á¿vÁ6éÆ¿ ºPà ˆË¿šb(ýš0п'¢V|3“Ò¿°ˆ³nxé?˜ûçã'gé?@ޏGé?°CÓÒé?}75Ùè?íž· W‹è??>Ǫ`.è?½;DÁ†Âç?!"Øœ Hç?:d/p3¿æ?y3—ÉW(æ?Q.ü'Óƒå?u¤ Òä?u*M£kä?j÷¨†kHã?ç’ù_‡qâ?âžCá?ްç¼+¢à?¬GË£Uß?ŠçÁ6SÝ?¨¡c°€?Û?²•*W–Ù?Ù&³©0æÖ?¯ÝÓ´«£Ô?JÊ€\æ?nóÇå?ÑÅú9&å?gìÇ®vwä?¡Û¹Ç¼ã?¼û¨‡ôâ?ƒÏŸCJ!â?˜OwÆÞBá?ùömKÎYà?¾QÍÞ?NѤ¤ÔÜ?JEd õÈÚ?eCÄ^­Ø?‹û-‰‚Ö?ß|àIÔ?ÂjdR­Ò?\zøêºhÏ?¤o‰Z¼´Ê?ƒuEðÅ?nF|çFÁ?—xZjsƒ¸?ÜŽ¤›uv­?þóéx±§“?ÞúD§©“¿LS¡2pw­¿ñö™?ðƒ¸¿+‡s÷„Á¿AsÔƒðÅ¿ÂNËKù´Ê¿¾§8÷hÏ¿|—çÊÒ¿oVË€è?lñ”`#qè?ãÚ“êöRè?ÙœÆ/¸%è?X ’‚’éç?/ʯžç?†º"?Eç?ì&°nwÝæ?ÎÔ#˜gæ?9ˆméãå?!¼Rå? CjMi´ä?V†~yR ä?Íì…ëàQã?o …Žâ?¨Óµõ¸¿á?(z`úåà?#XçÐà?pÞ^Ž'Þ?¢…>bâ8Ü?ZCH®Ï8Ú?Vº‘4‘(Ø?Ήé²l Ö?ú„]±ÜÓ?&9»µ£Ñ?tÓãõ²¿Î?Jã%Ê?ÛpA#5zÅ?oŠ'ÂÀ?¤ª3Vˆÿ·?´[Œré׬?˧êÏð=“?/R•>Ï?“¿¨ú\$ØØ¬¿?™ñ'ÿÿ·¿ ÊxbÂÀ¿êÿ¸–ozÅ¿tpž=%Ê¿fÚmÊë¿Î¿øbŠ—Ñ£Ñ¿²ÒDEáç?ˆµÈ;Òç?<—y4µç?¬Ž3¾)‰ç?˜©©ˆ”Nç? ÕiÛç?=±×t®æ?¬GÉýOIæ?¿q£ÕmÖå?C¾e Vå?HE Ú”Èä?¨p{D.ä?«Uá‡ã?R‰ç´Ôâ?g¥SKâ?a¨~ºLá?ç6¥~xà?Ä$¼854ß?N¸yÿ.dÝ?d”¤¸‚Û?‚°—¯ëŽÙ?wê¨ Œ×?(2$¦zÕ?ZÈÜ–\Ó?;Æ2¤l1Ñ?˜»æ™zøÍ?R…: {É?é v¨ïÄ?E­”UÀ?Q;±^ d·?´PjG ¬?û –JÁ’?fÔ gÃ’¿*Óޜ®¨°t~d·¿Dål0ÌUÀ¿™ç*&FïÄ¿ò%ŽîÖ{É¿ -¼R°øÍ¿î ~æ†1Ñ¿Ø#å¼-*ç?ïk¤ç? äÀ/ˆÿæ?Wå>ªÔÔæ?Iµ#>œæ?ƒzð6CUæ?)Y,¹æ?3tËFžå?YÇW,/å?,À‘»«²ä?Õ‡mÉg)ä?½¶°Dµ“ã?“ zmðñâ?µ¨˜ô|Dâ?ÊÇoÀÅ‹á?|Íô«<Èà? –[´ôß?¬Ë{Ø:EÞ?:¡¾cƒÜ?„’'°\¯Ú?Г%.ËØ?_Š`Tµ×Ö?0Ýá<&ÖÔ?%ô‘½ÇÒ?´íñ¿­Ð?§ÓDòÍ?øòz‡v¸È?÷ÍV÷»NÄ?t%Ç“ö°¿?ñ(ÏÝé°¶?Nn]w½E«?w¦Lüª1’?k&ÄU]3’¿J#Þ–F«¿>®†U±¶¿´@'Ja±¿¿øÔã¬ðNÄ¿øbogª¸È¿Œ%Í¿{¹Ø­Ð¿ß7y[æ?þ…Ö ZMæ?Hî·Ü1æ?Së´¨æ?»bâ-ÙÑå? PÉ‘å?×ûÕþ;å?z—Z"QÝä?8>GÆqä?…$éHŸùã?Õ²$+'uã?ó§dh¯äâ?ûÛ…‘Hâ?c"ù|,¡á?êÕÈèîà?scã32à?RæSG×Þ?€—«œ6Ý?Te8ú/„Û?ä‡TÊËÀÙ?øûNà…í×?±É`~ Ö?W­ŠÞÔ?³ÃäØÒ?ðDn¤Ð?ºÅ4ÌÌ?ÆŸo¥uÛÇ?`rlù.™Ã?ÀA R¤•¾?™h}æµ? YDíQª?vUßY‘?ô°@v£‘¿J¿X}»Rª¿ÛÙÙ£t浿Bîä –¾¿R5Ça™Ã¿O€å¦ÛÇ¿03fù5Ì¿¤ €»пá’¶så?ÈSHÖ‰få?7‹Á&Lå?QÌI5$å?½žú.ðä?ÞÄ߃®ä? ðc=`ä?T"žUeä?›µl04žã?ñ é*ã?œÄiëÌ«â?¨6¢Ž,!â?‚g§^‹á?±ô²Ý½êà?…µ¾ý®?à?Ò#Û5ß?Æø©â—Ý?üx‰OÜ?žSËÜrgÚ?E9±M¶Ø?VyÒëõÖ?A㽨_'Õ?¡5©ˆÈKÓ?¤ÝËKdÑ?,»Þ“'äÎ?€®ß¬ìÊ?ZäQÖ•äÆ?X­‰RaÎÂ?2æ’{'Y½?ƒ6pærµ?€îÇ‘A©?h•`õSÙ?t]äßÚ¿ÆA¯yVB©¿¨Ù³Ôµ¿8=¤FˆY½¿¬•æ‘ο¾¬ÄäÆ¿¸¨¤ÕÙìÊ¿T5UTäο)ÏÆ‡"tä?y¹zgä?È¿ódNä?ð ’ü±(ä?+Òõöã?1à;¸ã?ŠbkÜwmã?Ëž_UÛã?¾@Zox´â?‚8ŒFâ?ºÔèPZÍá?›Pë-Iá?ñ˜³}Xºà?@ß(2!à?l5Â2üÞ?Φ€}å¢Ý?œKsQ7Ü?¦m[ÙVºÚ?>€Pžà,Ù?b¥üÛã×?ìäT?_äÕ?6ØkZ+Ô?[$YåeÒ?2㪕Ð?Îk% tÍ?2íë´æ«É?ü!pØÓÅ?ŒX¦TîÁ?¢ ]Æû»?éDߌ ´?’_{^¬¨?VøÎÆ—?rJ*I¿`óvh¨¿ñ^ïv ´¿Š`&Þû»¿ÒntœîÁ¿ÑUÔÅ¿,Ò•A¬É¿ˆ¥2JJtÍ¿X–Þá[\ã?òŠÁrPã?ò°;Ÿ8ã?—p,?ïã?ÞT¥yåâ?4=7.Zªâ?å2·câ?@„̼â?X›;ƒ›´á?JÛILá?j ¯×Ùà?Û`ƒŽ»\à?°'F«ß?nCÍ´!‰Þ?BhÇC^TÝ?B¬e„ Ü?¡°]µÚ?×î`¾LÙ?Š1hÝ„Ô×?¬bÜ(™MÖ?ÆÍ“Vì¸Ô?ZÛUõwÓ?´ì±u=jÑ?¡¬‹dÏ?J¤¾?áË?0{ÁLÈ?¿ÓB€G©Ä??Êž•ùÀ?€…[À|º?š˜3@ ÷²? -šH˦?ÚAd°iŽ?tFÁ‚lŽ¿øñaŠü˦¿oAd÷²¿®$}d}º¿‡Ó¢;ùÀ¿W;` r©Ä¿ì ëLÈ¿æèìagáË¿køh…s,â?ª²eÿC!â?WÑcå â?°‰Ç/eéá?ošÿò×¼á?’&7Y…á?‰  ] Cá?à(R{öà?2¹M5­žà?zc'ž=à? €z%¨¢ß?–Á0*È·Þ?ÎhñHö¹Ý?Bú#Ï©Ü?Ô`Z£ú‡Û?ªÑ¬+UÚ?pR°%Ù?¤%ø¢œ¿×?t“Ìt^Ö?& lïÔ?ZWXѤsÓ?"ã=ÉëÑ?j9XàXÐ?øpÅ8ÅwÍ?(qu+Ê?šµ\þQÏÆ?¬î_õdÃ?Ö¼´§EÝ¿?‡8éùܸ?w[§ØXͱ?ê°ze¥?æ”uEŒŒ?f'ÚÆùŽŒ¿h6 ñ&f¥¿©Xm®Í±¿V ¦…Nݸ¿jlÜô˜Ý¿¿æNŠ1eÿ˜'eËyÏÆ¿t‘ Ä+Ê¿z´üÓäà?ëý=Úà?RÎ×™OÅà?%ËY€+¦à?W*8 Â|à?Šu.Å,Ià? ²›‘‹ à?`F¹ ˆß?¸Pxù‡åÞ?ª–=%ø/Þ?¬ ^ÐÉgÝ?z´ç™xÜ?£F‹¡Û?o“¤Ú?¤C\'-—Ù?ÎÔ" þyØ?œÀÁ·M×?úS¯ÀÖ?Ä‚?¬ÎÊÔ?:žŽ÷¸uÓ?»3ý¢Ò?}JÚ}f¨Ð?Îí†4ÈcÎ?BgÇ‘dË?lI7^SÈ? hˆ·3Å?ÏFüÂ?®_½½Fž½?:lâP·?}«ÝeŒ°?fÑaû^ã£?&2]‰Š?ÒN/®‹Š¿’±’䣿”'w“lŒ°¿²mI!¢·¿È®º–ž½¿Ì/Óx#¿j îMÝ3Å¿NDÀ¢ƒSÈ¿ÎV€YL ß?ÿhÇ;/öÞ?ˬƒHùÏÞ?þ¿ž¹Á–Þ?â;(¨«JÞ?^i£ôåëÝ?@†¼!«zÝ?‚÷%A÷Ü?‚Ð÷5ùaÜ?¼óÜ/»Û?p5–1KÛ? ÜB¬½:Ú?’¢IÉbÙ?ÆH yØ?Ô^Š%‚×?Fƒ„<+|Ö?8ÆaøRhÕ?†žJâFGÔ?Ìõ@¹Ó?¼îdàÑ?¢}œÐ?ÄoH‡ÝšÎ?°À]ÊêË?H{ä,)É?øŸŠµ¯XÆ?ì<zÃ?­y-Ê}À?–ó¬Y5»?Ö‹ð:µ?ÐózÝf®?ܯ¼E¢?n>Ú˜Q`ˆ?Jã¥aÑbˆ¿BÄyºE¢¿Ê'–©{g®¿”KƒC>;µ¿vÿ ¦5»¿}­Š£À¿Š@ß=zÿ;wÓXÆ¿åìË Ü?ð+B†½Ü?‚vÔÑ#æÛ?òÏ5ÄT²Û?žø'pmÛ?±!i Û?ÞJw±Ú?tö²ž:Ú?xæ[ó²Ù?úŠ?'ïÙ?Îé°AnuØ?Øu׿×?„;ÖšûÖ?¾>z}1)Ö?*0‚>IÕ?\ºpVè[Ô?Hå—%bÓ?¦*Í“m\Ò?"¿É4cKÑ?Bb®/Ð?áF+üÎ?ÄÙß¶Ë?¸“ GÉ?ø0?€oÈÆ?”}Ç;Ä?r* ¥¢Á?–9¾Dý½?6y!¼À¢¸?ð‡/K 9³?° iö†«?b2æˆÛŠ ?‡À5†?œ²×ž†¿ç2ß@u‹ ¿¶XÊœŽ‡«¿”’ÂV9³¿\;8 £¸¿\䯬ý½¿˜¨ȢÁ¿.ŠPê;Ä¿üÐ-…œûØ?®¡ˆ8ìØ?N}zuÍØ?,µÑ!fŸØ?ôÚÄ&bØ?ZÇpÝØ?$By#¸º×?È£»&ðP×?I…nÆØÖ?TGh)…RÖ?¬Ýƒ9¾Õ?(¼QüÕ?bK”›nÔ?8œ‡(Œ³Ó?*gh£VìÒ?\újuÒ?ÒÉ“j;Ñ?Ë¿RÐ?ÄåêÀÎ?ÊíXÌ”ÇÌ?¤|¹ód½Ê?ré†k·¢È?~a¯oØxÆ?òÉŒ“AÄ?^·qüäüÁ?¶GHù([¿?"FÒˆ1©º?¼%ÊæÈæµ?¼©Z„Þ±?Ì`ˆ1Ôx¨?€ê¦§i? ›®Ÿƒ?NîL[¡ƒ¿Bú ìÐj¿àz¬Égy¨¿ý$ˆ'±¿hö»Þ絿ÝË0x©º¿¤ n[¿¿ ?R™ýÁ¿Z-Â]®Õ?ZÈó+¡Õ?WZ¢O†Õ?Øê?uV^Õ?40Y1/)Õ?8ÜÓ‹úæÔ?tÕUá—Ô?¦ W<Ô?Ê­9ÌÓÓ?ÈŠ£VI_Ó?˜"BœÓÞÒ?áÿMºRÒ?\¿¬æS»Ñ?ˆHvÌýÑ?¦¤Á.lÐ?Àj¤]3jÏ?´º}rÎèÍ? yyG÷TÌ?Ì8–§¯Ê?bRÆuáùÈ?ÔÌE­´4Ç?|¹°8aÅ?B<'Œ€Ã?R¡SÙ“Á?$©¥ô8¿?:„.zH6»?VEÞ*#·?ˆÙ®Gȳ?ŒG}øY©­?ŠñaQØ<¥?[È{†™?þ[]“?|ÒiÌS ¿`Çy훇™¿¬%llg=¥¿°) ç©­¿œn›#³¿*¶G„o#·¿”c¬‹6»¿Àî©uß8¿¿àžD¼2Ò?Ð ß…'Ò?t(Ò?è¶ëÎïÑ?Ò¸ vòÂÑ?<s†`‹Ñ?zímMüHÑ?V.)ªîûÐ?´i;g¤Ð?(˜ì›BÐ?ÀÏd’­Ï?Î{óbÂÎ?¼W¢æ:ÄÍ?¼à̶³Ì?\„Ø‘Ë?0þ¯tF^Ê?xTÎÊÉ?<‘QÓÇÇ?†µ,p1fÆ?–Ö è¾öÄ?]vÁ^zÃ?„4!-ûñÁ?zÞO˜†^À?ˆðÒò½?dË:¦4º?Ðr®Ö/×¶?ÌÇÚ£k³?($Ú:è¯?´må¨?²«ÉØkÓ¡?&÷ ®²l•?¤ÔI>U•|?¾uø™|¿†¹^«Êm•¿äd¹òöÓ¡¿hí¡È 樿\ЙÂ诿¨o¼æk³¿2eq×¶¿Ãr?æ4º¿xíÓ XÍ?2é ¡nÍ?ÚWQ¢ÜÌ?´ÏrϧÌ?0UînÃ_Ì?p|ýÌ?@‚¦WîœË?|ø’Ö!Ë?@°ü–Ê?Xˆ%üÈùÉ?8v‘÷‰MÉ?|±õ®‘È?@„QU­ÆÇ?hôèÇíÆ?<54K1Æ?„RHÌÅ?‚y tj Ä?ââ;Æ©þÂ?ºE*3äÁ?ªh¨²¾À?´—³ ¿¿?ÔMZÔ媼?¨Fîç`&º?@ ܸ‘·?~¥ÎFŠî´?ª›ƒRp>²?<©ñm1¯?,Á§Z|©?fZ9¾Ñâ£?PðÏRÿyœ?¤Ô\Ö‘?È‘° SÔv?ÀS$Ë™Øv¿$7 Vç‘¿ÔŒ²¿ªƒšÉî´¿¢Z4PdÅ?8ðT$"WÅ?ü•hË<Å?Äž?{ZÅ?0VýéàÄ?tE:ö–ŸÄ?¨ÔT¤QÄ?|–ÇTùöÃ?ñuÃ?<ƒ',!Ã? 0xdžÂ?ÀåÂ'Â?ÔCÌÙÈ~Á? 9‡¸šÞÀ?ÔÔ 4À?ЊW1ëþ¾?x:·¯‚½?T+ Ü4ô»?0p’ïˆTº?œTÉ’¤¸?(œrhwå¶?”ð /µ?”®Ö­ò=³?`e‡ÉW±?…ý¸úÍ®?tCDÙª?ø~æÔ¦?d!¨­ÃÀ¢?` (òC?Øüíô”?”£‰/‰?téý¹Ëp?ôdžæÏp¿Øó1‰¿€¿íâõ”¿3‘øD¿¸]ûwEÁ¢¿Ð’VÚÔ¦¿TlÔÁÙª¿ô7½ýuή¿H\&Ãøº?€ÃL¨º?8ŠÞj‡º?²+!Vº?HRe~©º?Ó.yù?§ö(™a¹? Ó§eð¸?¸›À§òo¸?HüªEà·?€·{µ B·?p· œE•¶?ÇÚµ?˜æ£–µ?ôŒã =´?ìéÑð[³?K£p’n²?Äš×ùu±?Ð'Êr°? Î™FÈ®?ðàô š¬?HÓi,‡Yª?}¯Îk ¨?Ä•DÑ©¥?ÀšŠ=£?Êj²Ä ?`Is„œ?ØÝxxl—?ômûDƒG’?Xµ½Ä˜+Š?øÊû‡v?€á !îöd?œïW)ÿd¿ÂðÐz¿èÌ-0Ÿ-Š¿ÀõÐr„H’¿ ×ðövm—¿0cþºn…œ¿Ù.Å ¿´ƒjø>£¿ é\î£?€}”nÿá£?à:±É£?ÀÈv䥤£?;ËM=j‰¿k&×:¹Œ¿`Û%õÞç¿Àó%Ÿ Ö¿Ï[Š8¯¿ ÏoYÃ{¿àóЇc-¿#·‡8Øœ¿QÓ¤cœ¿Ð‹”–훿0ÜFÃíS›¿@õ¦!¾š¿ð¥rpßš¿€Ÿò–ÅL™¿€ï’Œ¼m˜¿>e£—¿P{iåež–¿€J¹)³•¿àù*uP—”¿pvÕNÇ““¿pÄL°z]’¿@ÿ½×#D‘¿`ÂO¹Àì¿ÀV$ôá“¿`†E3ÚÏŠ¿ð›V“Vˆ¿Ð"sŠÛp…¿À–ÚÞDÝ‚¿À_S¨º¿%|ôêjz¿þÕˆDt¿@Š;°W´m¿ÀÊr8a¿ hŒG{&I¿à}ÐI?@ÌFª™0a? Ic‹‡¬m?@†º8@t?0õXgz?`Â×5¶?p6ZWdÛ‚?pì·=o…?Ø»Û&L˜¹¿ Ö„Tй¿hZÐí!g¹¿€Øka=¹¿àŒ¥½V÷¸¿@q2$5²¸¿Œ]ÿI¸¿<åÈ'ê·¿Àœ6ÆÆ`·¿éqî$ç¶¿0á|í=¶¿P~A­«µ¿àê\?ä´¿I—»É:´¿œ$^ÖW³¿äš˜²¿ìOA5š±¿€LÂoǰ¿€²s¹éc¯¿ˆ± Iòš­¿ÈõôUF«¿ÐãßY ^©¿TOq<æä¦¿ èᢘ⤿¬YC-UK¢¿TàXÒ©3 ¿(æ;IT ›¿`ôr5“¹–¿‡ÃV9‘¿pÜݘ§‰¿è²AÓŠû|¿„Þð/sf¿Üé鹿z¾Œ:e·¿bÐÙ@¶¿ ¬cây•³¿d–eSa²¿xo„wâ*¯¿€Èñ;û¨¬¿ZÄZVúݦ¿Ö¨U"§H¤¿¬× d±œ¿xw–{¢l—¿xhÇ,À†¿ÎÓ!qÛ8x¿XRÛ 5x?¼åâÔD¾†?ÎÑ‚¯k—?LÁQr°œ?¤Z@/H¤?¨XåuƒÝ¦?DÌÃ…¨¬?g‰Ï¿\$výH«Ï¿„YPn²áοò<¸%ÎÏ¿<ýûÚíÍ¿~ü÷d¦;οÎíH:°Ì¿ð¨ŸõÍ¿¾¢‡ß+Ë¿®ÑFd—¢Ë¿VZß3ˆdÉ¿zäîÉ¿DpLà–^Ç¿\à§:«ùÇ¿Œ~mmÅ¿„fÏ#ÊÅ¿ìÛÃg«Â¿VjÞâdÿν§)À À¿p;½hÒÏÀ¿–h.̺¿@:îáž"¼¿Ìw~wa­´¿LñÖÉ;`¶¿6³÷WM­¿ˆlBn®f°¿Ìh¯÷ ¿i´°vc‰¤¿,‡ÕgÈà¿ôyI‘%¿mëfÞŸ$?ªððåÞ?$‡B€ëˆ¤?Â5Þ·7÷ ?¤¦9sf°?ng’þáL­?¤ж`¶?dÜ'¯'­´?衚]Ñ¿!®ë0©¿š'šô´¿ÔtæC½¿Ž½†¶µÀ¿R×3‚ ÔÆ¿Œ[ww]ÙÊ¿¶•[5!Îο$Kp£ïWÑ¿¸<;Ã>Ó¿ÚØº­`Õ¿.>d²£åÖ¿ÕE2Ƥؿ*ÛU¥´TÚ¿M{heôÛ¿ª’šG؂ݿOîµÿÞ¿`0ѧ4à¿ôÐØ7¯Þà¿Û¬v^Ú~á¿?"W;â¿62)vžâ¿jF#5ã¿io¤‹*ã¿ @BV÷ã¿lï ¤Q俎rƒÑ°Ÿä¿ë*5€áä¿£!XÍyå¿ú¶>^í<å¿]-3ÝGWå¿ d|ydå¿(¶e¼xd忸LDøFW忹&wÞë<å¿õb¯wå¿Òf¿áä¿LÕâg­Ÿä¿å¨:óŸQä¿çªÿƒ ÷ã¿÷.f™É¿j³v¾±Í§¿&FÕͳ¿y‘+§»¿qegq¸Á¿ŸznV²‘Å¿ý(^É¿6ŠÞàÍ¿&[GÛÙbп€P¿Ý&.Ò¿ í@<îÓ¿ùÌHO¢Õ¿‘-3vH׿ŽêŠàØ¿¢ìÎFiÚ¿ÆI$¹áÛ¿å‚ÞDùHÝ¿78ê)žÞ¿–dº¤xàß¿PÞ¿Z‡à¿†-Ǽ°á¿”ÔoI—á¿¦ã¶æâ¿-ÚÉH¥{⿎w•˜ÛÜâ¿tŸÔào2ã¿'ÑX-|ã¿ì{…æ¹ã¿Ç¯Suëã¿®mª1»ä¿£Â"¡)ä¿>[Ê6ä¿Tø±w6ä¿mu* )ä¿¶•À¹ä¿r®bsëã¿c`‡ã¹ã¿eÆ£)|ã¿Xwklk2ã¿bq[ÖÜâ¿ t\¶âæ¿ìqç»}b¦¿< Òמ²¿jz#yº¿oBÕ;*©À¿M¤¡ÓÙGÄ¿|ezØÚÇ¿Ôh¯ž’]Ë¿ýÐ7Ðο$§>îÑ¿¬N¥5½Ò¿9›ó6îVÔ¿ÝOQäÕ¿»nyÈc׿·ÅR ÕØ¿»/Íz÷6Ú¿‘?4¼ˆÛ¿7ñMï…ÉÜ¿f¶kÚŽøÝ¿·?èß¿Ü?࿼‘,¦Šà¿6Ç1Ÿúà¿6Qè¼`á¿Ò›&#¼á¿Þƒòm™ â¿?¼ØîQâ¿·uö‹â¿oÙí¤Žºâ¿òç”ð™Ý⿦åò¹õâ¿”ôºã¿¦4q7ºã¿ˆ ¤¯õâ¿^G&2˜Ýâ¿;3{.Œºâ¿ù&Aó‹â¿tðX&êQâ¿ÍO1¨” â¿>+­ˆ¼á¿:YY8ü‹¿×ë{mð¤¿l-t‘Uj±¿µ‡×ˆ§Q¸¿îG ù)¿¿%}÷¿‘º“upNÆ¿$3€Ô–—É¿¹rGøÐÌ¿EøÏ¿¾jÌ…?†Ñ¿”l…eÓ¿"£/àÐxÔ¿LjðsœßÕ¿6þïê8׿9MIVçƒØ¿Êk‰„ſٿQK¨ÂëÚ¿ ‚ù%Ü¿ê’ï?Ý¿ÑL(m Þ¿¾ÁOïÞ¿GÀ§Áß¿”‹ËR@à¿Ê̕࿬lË áà¿‘,.¾à!á¿uãÛ%Xá¿Ú©ª¸ƒá¿ø‡I~¤á¿órbºá¿â9—ÏWÅá¿<çrWÅῨ¹mgaºá¿øêwq|¤á¿øÌù¶ƒá¿Že¸x"Xá¿l±êŠÜ!á¿B@¥¾áà¿ìc4Æ•à¿NÚŒÔ Š¿Â¼¤Ú±x£¿Gt¢<01°¿*£tö›¶¿7h­Äø¼¿°%¨$Ý¡Á¿Ú‘ZF}¼Ä¿V®ßAYÊÇ¿ÏþEdŽÉÊ¿¢ÎžB¸Í¿fß«SJпf;5z®Ñ¿ÆÖ/¥ºÓ¿±zz?UÔ¿ˆMåÃ:–Õ¿ Ì›pæÉÖ¿ác«„ï׿÷4iM`Ù¿CLÈOÍ Ú¿¯,â0)Û¿ ÙÓYÛëÛ¿ÊÇ{UÁÜ¿*»tç…Ý¿!b%Þ6Þ¿G’Ü…ÕÞ¿õÓÀÛiaß¿Ýʈ’óÙß¿.®ËRlà¿ìÚçkíGà¿ä#df࿾R Œ½z࿼ƒõ9í„à¿®|Øì„à¿TĽe¼zà¿ †*bfà¿(Ø×²êGà¿âÈhà¿óQÉêÙß¿JºJ_aß¿..ÔjyÕÞ¿ë 3E݈¿jŠ:ÿ‹ü¡¿"-älfè­¿+ö¹ýÍà´¿æÛ-ƒÀº¿5¶Ç4àGÀ¿Ã¿÷_{%ÿ²’-qO÷Å¿ZƒKµž»È¿7®JD³pË¿b:¹‚àο·f0BSпp'7’Ñ¿"LujñÅÒ¿ÇÛÅ¡KîÓ¿ð²æç[ Õ¿ qÃçrÖ¿RDLUé׿µÁ:R Ø¿ùÂPÎòØ¿S;«â€ÇÙ¿ûÌ'šŒÚ¿• TAÛ¿Tv?åÛ¿Õœ÷õwÜ¿ÏÓkùÜ¿åÿ«­hhÝ¿Ÿ">ÅÝ¿Å)}3[Þ¿Ñ]Û›HÞ¿KØu[/nÞ¿á=]„þ€Þ¿y¹è¹ý€Þ¿XMú,nÞ¿³ÈÞ—HÞ¿4P‘UÞ¿h1ÈÅÝ¿²ìï•_hÝ¿í2øzùÜ¿ï¾<éwÜ¿ü ÈSi†¿¨¨Ã°M} ¿]ÃfÑh«¿Î-w†œ!³¿VÐ,öƒ¸¿yÊÔ~bÕ½¿·ægž·ŠÁ¿T`<÷Ä¿üóóרƿ:xêÆ#É¿C~k;;Ë¿²ü·xµéÍ¿ ëŸxàпá™Iú2Ñ¿úÁšßyBҿԺω·FÓ¿ß÷˜?Ô¿L…S¼ñ*Õ¿ï7aà ֿ¥cþÚÖ¿=G;‘ ž×¿´2Û²RØ¿B…¾DøØ¿Þû6ÒpŽÙ¿Å%3ÚÚ¿Mò&õ-‹Ú¿urí#ñÚ¿Þc¸zFÛ¿·T-‹Û¿®AÄ1‰¾Û¿´ŸôùõàÛ¿IøéG1òÛ¿U0zx0òÛ¿I“ЉóàÛ¿XÅe…¾Û¿fåjgúŠÛ¿/ž«5sFÛ¿­ïÇñÚ¿b"ã¿"‹Ú¿4G£þÌÚ¿ÆöõÄ5$„¿WKäµø¿|€ºå¨¿ê£Ä‡Ï_±¿ ìÚ!B¶¿ÐàyÞ»¿lêv£ Û¿¿_õ—×E¿áA&ò’Ä¿ä7IlfÓÆ¿NZ­žÎÉ¿žžÎ(Ë¿Eƒ;Í¿øLÕžR;Ï¿HË_t)”пü*-q€Ñ¿ÀÃðˆîaÒ¿„H)M8Ó¿ z4FdÔ¿P…—[ÀÔ¿f_‡qÕ¿Ô,:yÖ¿ֿͫ<’–Ç%4׿j‹1@/®×¿úÿ/žØ¿¸ÁVO0vØ¿|Gð¬ÃØ¿¹ñùâÙ¿JRKU­0Ù¿P¯JµîOÙ¿…wUГ_Ù¿ ¿ý’_Ù¿é±;ìOÙ¿¸Ü#/©0Ù¿†ÙßÝÙ¿PÆ—â¤ÃØ¿›%Û&vØ¿ÒRŠÐ’Ø¿n¬Ú!®×¿‰]ÕÎ0‚¿Ò‚wfQöš¿Â`í-a¦¿ Ñ9¯¿\RµL«ÿ³¿(aÒ…vV¸¿hÁavž¼¿*ݹÂ|jÀ¿¤•“ú­{¿³­ºo„Ä¿W¶WÔ½zÆ¿Q¦Ûq fÈ¿¦Ù¯{BÊ¿Š©T¥¨Ì¿–ƒq°ŠÉÍ¿:UœrÏ¿@@™ƒÐ¿lCŒåûCÑ¿ˆ6á0¹ùÑ¿–SÄò`¤Ò¿îĞ׉CÓ¿‚x §ÑÖÓ¿>K^Ý]Ô¿ü»ß ZØÔ¿Ç0©¼ûEÕ¿ù†Ðê~¦Õ¿ÂÐ ¨ùÕ¿D«ÑC?Ö¿˜h-H'wÖ¿J¹®õ/¡Ö¿ëÃÖéC½Ö¿c¹ÐQËÖ¿Ð¥ÒüPËÖ¿(çSlA½Ö¿PlÉ+¡Ö¿†þNc!wÖ¿b±&¿OÓÑ¿ªÞ¸ï§˜Ñ¿†›X-oÒ¿á G£}Ò¿‡‚,IOÞÒ¿[¶1 é3Ó¿é²W«}Ó¿m˜mh»Ó¿;JúìÓ¿¸îÂWBÔ¿šhå”)+Ô¿³Ã£ 7Ô¿gEÏŸ7Ô¿-î'+Ô¿Iwú->Ô¿ÜZ¾iôìÓ¿«±É`»Ó¿,‘ß¡}Ó¿™\…¾Ý3Ó¿–ãAÞÒ¿Ûýið í|¿;r:ú”¿É ©[KZ¡¿}uJ‰Â0¨¿ÂØyƒú®¿`S)Ù²¿MB³Á)¶¿e<¹.ßl¹¿½oãâl ¼¿.B£ug¿¿Ä¬D%mhÁ¿‹|yïä¿ku¨»ÎUÄ¿Fš€&ºÅ¿^Ü^XÇ¿U±“AÖYÈ¿ªÝ “É¿=Q,ƒ½Ê¿™5oúÖË¿0ð$GßÌ¿r C*ÆÕͿؓÑ]߹ο›ÙJü‹Ï¿&Œþz\$п^tÀžAyпݒ›þÃп' ¯˜cѿЋE–J:Ñ¿f /¾‘eÑ¿o%\†Ñ¿9]+Zܛѿ5îßL¾¦Ñ¿uo³{½¦Ñ¿…Aåٛѿàû >†Ñ¿[Èî‹eÑ¿–6 C:Ñ¿¤0ö>ZÑ¿6lÌÌòÃп#g!j4yпG\3ÀVøy¿Ìc®´ñû‘¿oïrÒB±¿+‚Ëßk²¤¿nÝÍÇ窿jºÇú °¿”ÍölD÷²¿ø\ûÁµ¿aNmLZ¸¿ÔC«-»¿òæÊC˽¿ì_‡éA+À¿Ây!ìfÁ¿|…YAݗ¿ÎDÁX½Ã¿M7F©ÖÄ¿À~ !ãÅ¿ÛÎCâÆ¿#âå…÷ÒÇ¿F‹ò $µÈ¿¿ÉJ{ˆÉ¿]ÿeFKʿĿükAþÊ¿"Vq— Ë¿N ;Iã1Ì¿ê\&Ṉ̿îÖÏ= Í¿?¿þD|Í¿qîUíUÆÍ¿üÊ< þÍ¿û¼çA#οÎal á5οv¢Ònß5οô˜@<#Î¿ÄØ#øþÍ¿êRŸˆJÆÍ¿˜ÉK5|Í¿^À;ïðͿ㦵W¶±Ì¿/£~É1Ì¿?,1Ü›ar¿`”/åׇ¿÷'EÃß«˜¿Áïu½;¡¿-á‘V¦¿ ë¨íëિI¨õ Ù›¯¿°ã>‡¤!²¿}—ÕÊ1j´¿ÙÛ?,¦¶¿›–¾3Ô¸¿ìÐöîòº¿;Mô½¿Ò‹aÄNý¾¿4÷B:sÀ¿ôœ©]Á¿*óc=¿.ÃÏ>Þÿd?M—ÚÿzÝf—Ä¿‚å8ÛFÅ¿ŒaH…éÅ¿e†„4¬~Æ¿vïôóÇ¿ñËÕ Ç¿b\’Ë éÇ¿* hyEÈ¿VÑ?7Z’È¿wÏ8ÉÐÈ¿FÞ$€þÈ¿1B¹J‚É¿g9Åo-É¿Gžìß-É¿qš˜}É¿öy*xþÈ¿Vvy´ÐÈ¿e“×K’È¿‹]Ò¢gEÈ¿)N<‹éÇ¿(<ð~Ç¿twd·Yn¿e+7~£‡¿¢òÛ· Æ“¿|, ‰Ô§›¿:‘¢,º¡¿âà¿®”¥¿&h·â‚a©¿äuÆS…­¿8’ÆÃ¿d°¿î^<å0²¿CM‰Að³¿ÎÌý©¤µ¿¨âyœJ·¿ªR”Á⸿'eìgkº¿àÙ6N仿®úlüdK½¿=t©½¦ ¾¿úÝ•ÿã¿¿@¥+ë݈À¿&¼Á¿YgžX¦˜Á¿¶OO'l¿ A}¿˜ožIÞ¿Â/Aâ3ÿ¢¦;X£}ÿ“ÛÆa_»Ã¿Úè­EðìÿÜ«m7Ä¿²þø×+Ä¿ò´t%”7Ä¿¢ £’7Ä¿±ãmN+Ä¿zã Ö/Ä¿¹"L”åìÿ¡/†Q»Ã¿@×{<’}ÿ¿ ÊÍ3ÿ·eq«1Þ¿Ĺ}EIKg¿ò˜Š_ð¿pY“bÞŽ¿uÏ=Ô¿ü”¿e‘Ñâéš¿’«„â‚b ¿îP²P‘E£¿7„-*‚¦¿µþگ娿Ÿ… ênŸ«¿õQÚH®¿ Ÿy o°¿=b寱¿Ÿ®ú•Ö岿Ce ´¿óÞ .µ¿Û!—|æ>¶¿ü}ßT B·¿œ¡ÑÖ6¸¿tÛQô´¹¿~gCðó¹¿1æèƒx¹º¿`ïxK_o»¿ä› [¼¿:< þ¨¼¿¤ì¥*½¿´+åš½¿PeˆÉ÷½¿`çÅC¾¿Nw# ­{¾¿šˆR‰}¡¾¿Yì¦-j´¾¿™NHg´¾¿}zÕt¡¾¿jÏ[ž{¾¿[ýã–ûB¾¿ø—]¯÷½¿ RÜ6白¿ûÛ”ýÝ)½¿P³-nا¼¿ÒÍœ\`¿Ä Àx¿FÁ"‡¿ »û}ˆ‡¿`>qQ„Ç¿ zóäëçwƒ ˆ¿à5ñ†Mˆ¿à7Vë9ˆ¿Àp’šH ˆ¿à䴂–óú‡¿ {Â[ˇ‡¿ ì±>‡¿ _Hß憿ðE톿à_ùÃN`B?€Hñã/¸Z?°tQZf?P´¹Ý{½n? âdßÛ©s?ÀBŠ¿Téw?àm¤·|?05É•¸€?àÓyq$‚?@ßk†9 „?³jrʆ?0Fäçñ‡?ÐN)d\ʼn?@èI¨‰‹?`”Il½;? ¤ß|ÜŽ?C`.5? b-ò?øc q¤‘?p¥oËL’?àÖKè’?x’ìx“?§Ý‰ý“?°”ýlÓu”?@Æ»b~á”?À×gCH@•?pØö‘•?€tyÙVÖ•?ÆAû> –?ð@6–?@ý†·'R–?`(Üý_–?à> `–?`‘ñ.CR–?7Aåº6–?ÀèÖ) –?@¬Ýs©Ö•?@Ñž[’•? bÄÑ¿@•?°;Ôlâ”?àq5û€V?´Ä.èZp?ЃÁ9({?dX¢Üò‚?x·tQMDˆ?XÄ5¦‡?°ÒaÔz\‘?Ð"Ú¼ˆê“?Ð4–-il–?˜«l—à˜?¬énE›?ø‘5b™?ð?ç{ÛŸ?,ž|Œæ¡?ˆ°}”¢?ñKí£?ÈÌÏlê¤?8¦‹h[ò¤?(ÂñqâÎ¥? 1%-÷¦?` Ÿ_§?pRTwÒ¨?XKQV³µ¨?ØÜï WJ©?ð±×ÝaÏ©?°O1ªDª?¸Xæ,n©ª?˜Ö"!éýª?`øéh¾A«?€˜,Ät«?8(6ôÚ–«?àÏ}ºí§«?àþ‰ùñ§«?é±ç–«?P7`fÙt«?½mÜA«?éLþª?(E}Æœ©ª? º2¥¸Dª?°} %¡Ï©?ø¿1#6 a?LÚüÕŒy?ðèòu<…?Hè« ¥?ÔÕ¯ý’?ð„ÐE—? b6¹J.›?ÈÔíÉ.Ÿ?X’採?¸±Hðy£?¸ÄŸÕY¥?èÍLõ–,§?0i‘Gñ¨?ˆ-£s2¦ª?x! ñåJ¬?èg¶|)Þ­?ðêY¸_¯?ð°K`Cf°?ì”]è±?ÄVÊ.µ±?„ÃI¶8L²?T ó™"ز?œó={mX³?9+Ê̳?ìÞcÚð4´?h‰&D¡´?€ŸÑբߴ?È–ÿÐÄ!µ?ÄÝ=iÞVµ?(+åÜÎ~µ?xF ‰}™µ?”LŒøÙ¦µ?\õíÛ¦µ?@0Žhƒ™µ?”Ù6¤Ø~µ?Ô8BìVµ?`UAYÖ!µ?ØûÆ1¸ß´?`,fº´?Ì·b¯ 5´?hyö»êäf?x»PŠ…?DXI´ïtŒ?˜®áÈÝ“?È`ÇÈt™?ààÁxüž?¤xÜÐ8¢?Ä*uLÿæ¤?l¶Þu‰§?(Ä®„ª?x¤T*óŸ¬?pÒâmÀ¯?üHÉš4¸°?øLQ;ݱ?ÄèAI?÷²?µE’´?\‡^Iµ?H‘³þüµ?`²Bä¶?€'ä±]½·?Ì¥žˆ¸?ì¬1¿¤C¹?Ñ&S£ï¹?|XB6£‹º? ü(&D»?ÜHü/’»?еQáü»?»}ÃT¼?$ø~ó›¼?Ü®žÜ}Ѽ?@qÆ­Bõ¼?àçw‚+½? 3~N-½?húHõ¼?,G|҆Ѽ?”»¡ÿ›¼?tÆN‚ÓT¼?0Z.ü»?|¸²ÕF’»?]ÜF^»?8¦Ù®ÅIl?ÀF(dó)…?ŒÉìš‘?ü†j=”˜?LÈ3".Ÿ?è0áxU+£?8ÅáA‹¦?ø©{GÝ©?´è’Ó]­?̤Ü8Á'°?ž÷Fßµ±?xÄÊì9³?¶¡¼m°´?¬¶-ж?TO¼Ix·?Ðmµ‚Ƹ? ¦ÿ޽º?0­®Æì4»?Üô6US¼?èFÇF`½?ÈÏ®t[¾?So~4C¿?öNçþ À?¦JžPˆlÀ?Öªš§ëÂÀ?jD–·øÁ?*'k•€PÁ?H¢ÑÓZ‡Á?\Ÿ%œe³Á?®ž"Ã…ÔÁ?Ä׈٦êÁ?: 8»õÁ?ªt ¼õÁ?(ƒ…N©êÁ?Ö$«Ø‰ÔÁ?6EãMk³Á?ÖóWb‡Á?*oÚi‰PÁ?U Á?š[Ón÷ÂÀ?ŽïQžy£p?EŠéˆ?è$Žo¸”?ð-µzïœ?œ½ePŠ¢?(l(Öo‘¦?\žù%£Šª?ÌÎmšxs®?PÞ$Ä$±?f"À«:³?ÈÚÂ÷Ù´?˜‹Ý]Ú¡¶?<¾÷EÉ[¸?4ž8γº?\ò&…’¡»?H­#Üg+½?„Š,Ç@£¾? þ[ªÀ?^Äâž´¬À?ôÝ 7KÁ?|ú7­ÞÁ?F$y%PgÂ?T–€™äÂ?¾Ðp@;VÃ?Ž}S‘ð»Ã?^#GzÄ?H“R%¡bÄ?, ³“5£Ä?DV¯»×Ä? ™½ þÄ?Ë4Å?D=c(%Å?$£»!)%Å? ¼oÅ?8”6UþÄ?ðyä×Ä?8ÜU)<£Ä?˜¡©bÄ?¼pÆ”ƒÄ?ôÞ4#û»Ã?¾)– gêr?<‡½ƒUTŒ?¤£Sí—? J"¸‹t ? ™ô8u¥?(Þ>¬Y«©?Üó>‘g0®?äžçlkQ±?€³4Iõ³?cJy¢µ?XV¯ž¦··?(ý4¾¹?ŒÃ\Mã´»?ä1ÜË|š½?$¥úwÕm¿?ø1z~æ–À?œœó{§lÁ?ÈJ/Ò©7Â?`Æ1@p÷Â?’öÓs„«Ã?pìRwSÄ?.Õ?áîÄ?lCKYb}Å?xkqµ¢þÅ?<:î—RrÆ?Àjó¢*ØÆ?„™%ì/Ç?„™9–`yÇ?ŒU? [´Ç?Lõx·àÇ?Ì÷·YþÇ?p)/ È?@)ŽÂ/ È?¯Ð"[þÇ?ºû[ºàÇ?øºŒ³_´Ç?¤û%„fyÇ?įª,ó/Ç?´·Èù2ØÆ?Ð \rÆ?<_ÅTêõt?„˜V3f?LäT¯ûš?æk©Z=¢?„´ïò_§?4B˜[t¬?z¹·¼\»°?ܸ¼X2³?È«~µ?ì<Oû·?P‹VJº?,E@ (‰¼?ð€$a¶¾?¼eHUhÀ?¬¦[kÁ?~læ9¤cÂ?ÌdÝè•PÃ?tJøqž1Ä?Þ•D3Å?{VuÐÍÅ?À^—¦û‡Æ?pó2½A4Ç?ü„s8ÒÇ?°ÞiV~aÈ? „‘»áÈ?4EªeŸRÉ? CÓå³É?y(MRÊ?Ðe™²FÊ?0ÐdÞwÊ?¼¥[X·˜Ê?ôêÂ2)©Ê?$ØóÍ)©Ê? 1È(¹˜Ê?ÌGfáwÊ?€ŽbǶFÊ?@ÊdžWÊ?” G<ì³É?ȿצRÉ?ÈRnÃáÈ?”ò¯¯PÂv?þâl› ‘?ðkH|^œ?8¥>eÏ£?lü‹½b©?€ÜD·Îæ®?:t‹ç+²?ƒ·@2Ù´?p%‚>¡y·?¿h– º?ƒ S{¼?\Y»!Åý¾?ž¡BNy­À?0áEHÇÑÁ?X– 9ëÂ?àü¸¾øÃ?Rû×#úÄ?th²zîÅ?´nöŸYÕÆ?¨_)j$®Ç?\t¾³TxÈ?4IßÃm3É?ÜbE1üÞÉ?L¯(–zÊ?\àÖ®ÛË?\ÿûÚv€Ë?Tªd êË?ˆguŠBÌ?ÈOBsЉÌ?¸ùÈPñ¾Ì?_0ÀâÌ?ܽտyôÌ?ü8ùJzôÌ?4íl`ŸâÌ?DÙŒô¾Ì?T—0މÌ?¼kyØŽBÌ?ˆüžÃ!êË?$µz}€Ë?ØTÖ$ãË?ðMÃŽôKx?ð9|¨û3’?¤¼’·Iž?îÔt1^&¥?)g:Ò«?òwÜF°?þóÐõf³?¢Ï¿,­B¶?TÓSª¹?˜Ýçˆ1Ï»?,®œ­’|¾?úèJq“‹À?˜’S•©ÎÁ?(›†ÄÃ?ö§îË#3Ä?>ûë$SÅ?ÖUÿÑeÆ?4ÌßßÅjÇ?8½÷ÓHaÈ?,ç¦ÌÂHÉ?¬÷¬¥ Ê?„QNjèÊ? wt—ŸË?xF>x»EÌ?8ãÍßoÚÌ?p‹ÚðX]Í?¤Ö‚ì%ÎÍ?lµ+>‘,Î?à¿ä¨`xÎ?x°/ie±Î?xL~S|×Î?Èù”èêÎ?ˆæØdŽêÎ?ÜÇ}×Î? ]™Ðg±Î? <þcxÎ?`Ú‡x•,Î?˜óª+ÎÍ?Ì$pÐ^]Í?Ô.yvÚÌ?øjèzÆ4ì^º?ÐópBB½?´C9’ À?ÐY :hÁ?¢u%¼Â?\´ƒÄ?Îxvˆ@Å?ìo=ároÆ?Œ½öF‡Ç?ŒÄÙm£È?8Ôæn¦É?¸ß÷™Ê?h>o}Ë? ÈíEOÌ?YõýÍ?œd™£É¾Í?,=[Î?T*V øäÎ?,[EP¥[Ï?|0@Äû¾Ï?Ð6C_Ð?]%Ð?>8g9Ð?FÅâínCÐ?f¯+%oCÐ?\Ì«g9Ð?Ô¾¤¯^%Ð?V¢"`Ð?ð'T„ÿ¾Ï?Ľ¹Ï©[Ï? 2k<ýäÎ?x¯„þB[Î?ĺL6›ˆz?Lžc$ªá“?ĵÓrŠ ?Xƒ»Ù§?L"ˆÿš­?ÔlJð²?Ü/bC1µ?hs¾ƒP¸?<³D1Å`»?ìQ¾·#`¾?.ó]c¦À?¢ÚŠpÂ?˜OkÂWsÃ?Zê;@ÈÄ?J}XÆ?·üÔJÇ?dÅOôvÈ?èÿÊ)ý“É?ØõÊñ?¡Ê?ü`lfžË?ôzèÁä‰Ì?X,´jdÍ?4›ð-,Î?,ÎȦáÎ?X¥•$„Ï?ºb܈ Ð?Zÿµ#GÐ?pä •´zÐ?NY(´¤Ð?,6‰‚?ÃÐ?ØbiÐ ØÐ?¬ÛLÅvâÐ?<éOövâÐ?<†åb ØÐ?²tÕt@ÃÐ?vÉy¤Ð?:$m=¶zÐ?r‘?²%GÐ?Ü &‹ Ð?¸FC„Ï?pü(+’4{?v7¤³b”?x*¬ãØõ ?<šs¤Ü¯§?˜ÖãE[®?fž¢°øy²?~ý€?꺵?Ø årî¸?$e†œ¼?P–*>t%¿?ð±{ø‹Á?úER­Õ‡Â?Öj€²ñÃ?lßéAOÅ?ŒìQ°­ŸÆ?œk‚%âÇ?íœqâÉ?œ©ŸÑ&:Ê?´?c?NË?Ä¡oÜQÌ?ÈHAIJCÍ?¬¾SJ#Î?˜dT¼0ðÎ?€ZELDªÏ?bÀKvh(Ð?ÚÕ  ·qÐ?†Ñ-´â°Ð?„‡~~ÂåÐ?|[9–6Ñ?”Æ4¢$0Ñ?ÚyEÑ? U}¢&PÑ?‹ÇÍ&PÑ?\‘yEÑ?j)x%0Ñ?D2ó½7Ñ?.ãcôÃåÐ?rõjsä°Ð?˜m¢¢¹qÐ?rèµj(Ð?d-‡ŒÀ{?Î忏 §”?„:‰¸È.¡?óWz\ÿ§?@x(í4Á®?DÉÚŸ¸²?èõø3ä¶?Ä~I?*B¹? 0.åp¼?6ª Ž¿?nkeãKÁ?¶²ÈjÆÂ? ¸Ÿ¯4Ä?¸ßõ¡Ó–Å?$}l«ëÆ?ÔŠ5\2È?T¸»$jÉ?h }=’Ê?lOPiö©Ë?„éGΜ°Ì?Äy4|”¥Í?LS@ô@ˆÎ?Hƒ³jXÏ?ÜxùŠO Ð?,ˆí­^Ð?Ž£±öò¨Ð?ØBµ{òèÐ?”Ʊ™ƒÑ?þ;u†IÑ?¬ý¸”ßiÑ?Ì4Mº{Ñ?Äz¿MŠÑ?äÇÕ=MŠÑ?ðD,|Ñ?Á¾PàiÑ?fhgy‡IÑ?ûïá„Ñ?v§ëôèÐ?mi¹ô¨Ð?Þ³;ä¯^Ð?SEæ;—{? ÃÊ? ¬”?&ßÉm23¡?l™5çQ¨?ÌÅ3QÉ®?ît#°¼²?LŸá|€ ¶?zZEƒH¹?øÔDê"x¼?<4Ó¨ÿ•¿?7¥JPÁ?˜“pÎÊÂ?š˜îÓ9Ä?ÈB«GœÅ?dÏìÂ~ñÆ?Ð .z8È?hšpÉ?Èïg ö˜Ê?XI'fý°Ë?,¸Rgß·Ì?ÌÝß¼­Í? ~*¡ûÎ?ì"VS`Ï?‚I__Ð?fb«bÕbÐ?MaA+­Ð?¼l±<íÐ?’||ñÙ"Ñ?Ö‘ÖèMÑ?vùFInÑ?4—ÚuëƒÑ?æQ¶B¿ŽÑ?öd¿ŽÑ?ÈÙëƒÑ?<‰˜ëInÑ?ðta¹éMÑ?ža‚Û"Ñ?xݹ>íÐ?0ð½Ê,­Ð?Tä×bÐ?œÒ]”J{?ÚNgn”?\(®Z¡?„…ïøq¾§?T"L„oo®?€àì¾…²?ð ·;ɵ?°a&¯<þ¸?¤Š„é%¼?(NI9¿?Šè·Á?¼L­“Â?È .ï¸þÃ?±Íè\Å?l):n®Æ?ŒO‚‡yñÇ?$Ïm8&É? OmÄKÊ?`mú`Ë?MÓƒ¹cÌ?ÿ~ NVÍ?´¯ß‹r6Î?¤§†|FÏ?ŒËe+¯¾Ï?ØKô{ã2Ð?¼Wÿ(T|Ð?¾^´»Ð?TÑ3ñ«ðÐ?¢ÂyCÑ?âÏ)@;Ñ?òƒH¦PÑ?.ïX[Ñ?tÝÌX[Ñ?Ö¼eŸ¦PÑ?ˆdœ£@;Ñ?*Ï?DÑ?°Üë¬ðÐ?¬5‘*µ»Ð?,¶Ú~U|Ð?Ppøä2Ð?üò*Ä”·z?|>[aç“?2äÁM™ ?\þ߆»%§?°÷–ö²­?ðEƒmX²? xurAµ?ð¹‹ýJ_¸?xÙí» u»?Txÿ%s¾?lB+9޲À?„˜`÷Â?=ûVaÃ?àdCˆ°ÕÄ? »/² Æ? ЦM ZÇ?ܦÒÄMˆÈ?ÜMÛÕ¤É?dψv´Ê?, sŽf°Ë?h*ÁáÌ?L•Éš³wÍ?䣖å3AÎ?ÄWzZöÎ?ä‚4ï™Ï? LàUÐ?üª`RÐ?¦FÚ…Ð?ÚBšiŒ¯Ð?¦™¢ÎÐ?sÍ•ãÐ?ÆxJ4úíÐ?FîšMúíÐ?ãîY•ãÐ?9k‚¢ÎÐ?òð¯Ð?"¬dñÚ…Ð?LÍ«aRÐ?RœàWÐ?¨|w¢ñ™Ï?ŒÂû!¸>z?¬~S, û’?ªn´©` ?Üpýú,¦?ˆ­¢g›¬?Ü—QÉQ±?àfˈqu´?œðIÚb·?à½jº?¼­¸ÚA:½?¢Ü÷=tÀ?äT)ÍdÁ?¼‘ÏêðÁÂ?(O•—Ä?àÙ¶Ç.FÅ?\OeSmÆ?| ù•Ç?@ho;¡È?Ðûvž«É?jí¯˜Ê?¾Ç³ùË?˜y²6’NÌ?ÈAQ´ƒÍ?€ت¾Í?ô>2\_Î?ÌD´InåÎ?0µ¹úR_Ï?dÒ+ÎÀÏ?,u¼øÐ?X ·9+&Ð?˜£›Ž¿:Ð?\"ƒDÐ?ÎÕq8ƒDÐ?,¥Î¿:Ð?@j'¥+&Ð?” HOùÐ?†ÎBÀÏ? Og´T_Ï?LhÿEpåÎ?8%~:^_Î?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?~´hiaá¿ÌurLÓá¿=æü”½ýà¿Ê òC-Þà¿ÿeªÐ5´à¿º¿êñà¿¥·îdAà¿ñ Wòß¿3:²DjMß¿¥žx•Þ¿q›‘P©ÊÝ¿±Ç<ôzíÜ¿°!puþÛ¿šPq-,þÚ¿Æ•";=íÙ¿ŒÇwìPÌØ¿/qœ×¿ÇÕgR]Ö¿h•ûhÀÕ¿ü"0·Ó¿ÎQûwQÒ¿ŒòuGsàпÁJ\ Êοëx´Š4ÀË¿?Ù+¦?¥È¿C&­{Å¿´‚rD°C¿Î,Ýy ¾¿Äv³2j·¿!Áž$êð¿$´iL•&¤¿`•Y£ãŠ¿|‘Y£ãŠ?+³iL•&¤?¥Àž$êð?Iv³2j·?T,Ýy ¾?w‚rD°CÂ?&­{Å?Ù+¦?¥È?T{&56‰ß¿qŸ>Ãuß¿.Å8PéNß¿ ®Þ_Àß¿j¼÷KlÇÞ¿Ú“GÅgÞ¿x…1 ôݿԯ¸†„nÝ¿ ¾xÕÖÜ¿gˆ\-Ü¿nEƒrÛ¿qào’¼¦Ú¿,‘·†ÊÙ¿5õ޳gÞØ¿žÜõòâ׿MÖý÷ÂØÖ¿Œa'ä{ÀÕ¿÷Ì!•ÊšÔ¿˜P±+dhÓ¿÷vàž*Ò¿òuGsàпºÍðÏ¿¾ –SÍ]Ì¿1jßM+‘É¿Ëÿ³Ä´Æ¿bàÔ6]ÊÿSê%*ÁÓÀ¿ùmш¥»¿õ¾…g‚’µ¿×0ø9\䮿/qY¦¢¿TðéŒõň¿¾ìéŒõň?6.qY¦¢?ó/ø9\ä®?„¾…g‚’µ?«ømш¥»?ê%*ÁÓÀ?,àÔ6]ÊÃ?•ÿ³Ä´Æ?Ë)ô 6ÄÜ¿ìTzìx²Ü¿ùƒtÜ¿@LûYÜ¿èuуqÜ¿mV§C—»Û¿eÔ"‚¢RÛ¿}æïùÓØÚ¿ õ%ÊvNÚ¿‡‡óGà³Ù¿gÄýÉo Ù¿ü7”mŽOØ¿¤%ÝÕ®†×¿0^"åL¯Ö¿¾5jpíÉÕ¿ž·‹í×Ô¿&žðt×Ó¿]Ü:¨ËÒ¿…®Ë´Ñ¿,*㦑пÒJ\ ÊÎ¿Ç –SÍ]Ì¿ì=àÉ¿¡Ÿà|]RÇ¿VqˆÞH¶Ä¿ÖÒ1n ¿‚´2¶â²¾¿ÇfôAú7¹¿ÊšJ;„­³¿´*?ßÖ-¬¿ÙøÈPDï ¿ :W™†¿È6W™†?øÈPDï ?ä)?ßÖ-¬?bšJ;„­³?`fôAú7¹?´2¶â²¾?¥Ò1n Â?&qˆÞH¶Ä?UHXyíÙ¿O ÙÖ{ÝÙ¿³Ï°Š½Ù¿ÑÀv˜¹Ù¿ùÙû &NÙ¿f¶¬@÷þØ¿e# ^ Ø¿Å”2Ø¿î¯j"ߵ׿ý9 Š*׿÷PnpëÖ¿ k béÕ¿ôÿ5U4Õ¿"f¸’4rÔ¿'øÑÜw£Ó¿Œý\”žÈÒ¿f2Ÿ±/âÑ¿«ÕQ¹ðпÏk¿ éϿ޹¨m ÞÍ¿òx´Š4ÀË¿2jßM+‘É¿šŸà|]RÇ¿'æ–-Å¿¤côù«Â¿'ëÌ]EÀ¿Å7ÎOT«»¿V Þº¶¿(=Jc¼±¿zýeðe©¿G”\7ᆞ¿¼¸^^„¿¹¸^^„?Ï’\7ᆞ?¾üeðe©?Ë<Jc¼±?ÁU Þº¶?i7ÎOT«»?ûêÌ]EÀ?xcôù«Â?çä,޾׿*~[‹øÖ¿+ÓËú,ÜÖ¿¶i=¨µ±Ö¿]RU?yÖ¿§fÔì2Ö¿œû„éÞÕ¿ãìŒ4i}Õ¿Ž^n¨Õ¿kyåJê’Ô¿2qO| Ô¿ýÙ8²uÓ¿JFÊçÔÒ¿öž®-€(Ò¿ü-«¶åpÑ¿ùrå ‰®Ð¿6¾ƒ”ÇÃÏ¿ôæÑäο:\F{sWÌ¿zǃ‡†Ê¿OÙ+¦?¥È¿Ôÿ³Ä´Æ¿YqˆÞH¶Ä¿«côù«Â¿å *»A”À¿kY‘á…æ¼¿xvoµ’¸¿.èW½/´¿AtïV¤€¯¿Á™‹P`ަ¿og–(f›¿H5¸¦‚¿ª2¸¦‚?!f–(f›?™‹P`ަ?›sïV¤€¯?Ü èW½/´?°wvoµ’¸?Y‘á…æ¼?¾ *»A”À?½_@RÐԿĬ²oÔ¿. ¶ìÓ¿·§·²ÇÓ¿½6¨p|–Ó¿“F¿˜1YÓ¿}páü÷Ó¿œ@øÅüºÒ¿a¶]tZҿãÛJšîÑ¿pFP±wÑ¿¼¿L öпþ·ˆ0Ýiпå#rÜ1§Ï¿’3„ã#gο ÙUÍ¿™r°˜¯Ë¿lÈ9Ê¿<–˳ȿ«{ɳ’Ç¿^&­{Å¿wàÔ6]ÊÿãÒ1n ¿8ëÌ]EÀ¿}Y‘á…æ¼¿uã1à~0¹¿Ú/«éîjµ¿ÿÛÞz)˜±¿×;?lu«¿sªÔÝæ¨£¿ù9úÅ2¡—¿Àésˆ¿x»ésˆ?Õ8úÅ2¡—?â©ÔÝæ¨£?G;?lu«?¸ÛÞz)˜±?’/«éîjµ?0ã1à~0¹?9Y‘á…æ¼?™'3vÑ¿ÁùïIûÑ¿Oíúnõðп4åuÜ|ÑпíXû¤§Ð¿;#™‡sп“‹ÚD5пôs¸JÚÏ¿£ ËÞ5Ï¿ÊåJv~ο™Èm@´Í¿âÀÿ¸×Ì¿*`féË¿ e8éÝéÊ¿ç;H¼ÙÉ¿¸æ+R©¹È¿ú{»°VŠÇ¿Ã½uLÆ¿‹:¢¤çÅ¿ÒÚ¿[¨Ã¿Ô‚rD°C¿mê%*ÁÓÀ¿¨´2¶â²¾¿ï7ÎOT«»¿xvoµ’¸¿ä/«éîjµ¿xGšëò5²¿%Åwë­¿9î¢|•X§¿¿°~M· ¿Ž] °l”¿‡Á3iÏz¿¦½3iÏz?—\ °l”?Œ¾°~M· ?¿í¢|•X§?¬~Åwë­?;Gšëò5²?ª/«éîjµ?ãwvoµ’¸?:ƒÅÛX Ì¿IÐføË¿µ$„ÕË¿ eÐdϡ˿c]á ]Ë¿Ú;åypË¿p“;ƒ%¡Ê¿¡éuQ¿¥SgžAÁ¿´AK5&À¿"-Ýy ¾¿bùmш¥»¿gôAú7¹¿WV Þº¶¿YèW½/´¿ÜÞz)˜±¿DÅwë­¿#Å^(”¨¿]7¢°-£¿ å©íÉv›¿‹t'„B¿FøJ5v¿õJ5v?¿s'„B??ä©íÉv›?ù7¢°-£?¿Ä^(”¨?à~Åwë­?êÛÞz)˜±?*èW½/´?Q|UdàÅ¿F›læÒÅ¿µZ÷ìò·Å¿‰ «ušÅ¿ ïŒèõYÅ¿^ðÖZ&Å¿EÆ¿UÇÄ¿y-³jÄ¿¥"̵yÄ¿BíÊé‹Ã¿igÔK ÿr0kÂï|¿jÃ,äÁ¿¯iÎ a@Á¿./ä£ñ‘À¿åz9”²¿¿°Æ´°¸-¾¿ŠBA€@–¼¿$EÏó&íº¿m/ö6r3¹¿$w³2j·¿I¿…g‚’µ¿›J;„­³¿l=Jc¼±¿­tïV¤€¯¿%éuQÂ?ÊRgžAÁ?ç@K5&À?¥+Ýy ¾?ømш¥»?ÀeôAú7¹?7U Þº¶?Y èW½/´?;ÛÞz)˜±?È}Åwë­?ëÃ^(”¨?j7¢°-£?­ã©íÉv›?¹s'„B?.÷J5v?þóJ5v¿îr'„B¿ãâ©íÉv›¿7¢°-£¿‡Ã^(”¨¿d}Åwë­¿ ÛÞz)˜±¿* èW½/´¿é&3vÑ?ùïIûÑ? ìúnõðÐ?‡äuÜ|ÑÐ?AXû¤§Ð?‘ÿ"™‡sÐ?ìŠÚD5Ð?¬r¸JÚÏ?a ËÞ5Ï?åJv~Î?gÇm@´Í?¹¿ÿ¸×Ì? `féË?‹d8éÝéÊ?ùå;H¼ÙÉ?¹å+R©¹È?{»°VŠÇ?ݼuLÆ?²9¢¤çÅ?¶ÑÚ¿[¨Ã?‚rD°CÂ?Àé%*ÁÓÀ?k³2¶â²¾?Ò6ÎOT«»? wvoµ’¸?/«éîjµ?¼Fšëò5²?ñ}Åwë­?Ií¢|•X§?[¾°~M· ?¿\ °l”?rÀ3iÏz?‘¼3iÏz¿È[ °l”¿à½°~M· ¿Îì¢|•X§¿w}Åwë­¿Fšëò5²¿Í.«éîjµ¿ævvoµ’¸¿_@RÐÔ?%¬²oÔ? ¶ìÓ?§·²ÇÓ?"6¨p|–Ó?úE¿˜1YÓ?æoáü÷Ó?@øÅüºÒ?ϵ]tZÒ?5£ÛJšîÑ?åEP±wÑ?6¿L öÐ?|·ˆ0ÝiÐ?ê"rÜ1§Ï?¡2„ã#gÎ?/ ÙUÍ?>˜r°˜¯Ë?LlÈ9Ê?Ù;–˳È?ôzɳ’Ç?´%­{Å?ÚßÔ6]ÊÃ?TÒ1n Â?·êÌ]EÀ?˜X‘á…æ¼?­â1à~0¹?0/«éîjµ?tÛÞz)˜±?ý:?lu«?Ø©ÔÝæ¨£?=9úÅ2¡—?¿ésˆ?~ºésˆ¿8úÅ2¡—¿G©ÔÝæ¨£¿m:?lu«¿-ÛÞz)˜±¿é.«éîjµ¿hâ1à~0¹¿TX‘á…æ¼¿Lä,޾×?}[‹øÖ?‘ÒËú,ÜÖ?i=¨µ±Ö?ÅRU?yÖ?j¦fÔì2Ö? û„éÞÕ?RìŒ4i}Õ?^n¨Õ?àxåJê’Ô?«~qO| Ô?zÙ8²uÓ?šIFÊçÔÒ?{ž®-€(Ò?‡-«¶åpÑ?ˆrå ‰®Ð?`½ƒ”ÇÃÏ?*æÑäÎ?{[F{sWÌ?Èǃ‡†Ê?©Ø+¦?¥È?<ÿ³Ä´Æ?ÎpˆÞH¶Ä?.côù«Â?u *»A”À?¨X‘á…æ¼?\wvoµ’¸?¦ èW½/´?msïV¤€¯?)™‹P`ަ?¹f–(f›?Ï4¸¦‚?02¸¦‚¿ke–(f›¿ƒ˜‹P`ަ¿ÇrïV¤€¯¿T èW½/´¿ wvoµ’¸¿YX‘á…æ¼¿O *»A”À¿½HXyíÙ?· ÙÖ{ÝÙ?Ï°Š½Ù?;Àv˜¹Ù?eÙû &NÙ?Óµ¬@÷þØ?Õ" ^ Ø?ÿÅ”2Ø?c¯j"ßµ×?u9 Š*×?sPnpëÖ? k béÕ?xÿ5U4Õ?ªe¸’4rÔ?´÷ÑÜw£Ó?ý\”žÈÒ?ý1Ÿ±/âÑ?GÕQ¹ðÐ?k¿ éÏ?/¹¨m ÞÍ?Ox´Š4ÀË?œißM+‘É?Ÿà|]RÇ?&æ–-Å?7côù«Â?ÈêÌ]EÀ?#7ÎOT«»?™U Þº¶?À<Jc¼±?åüeðe©?”“\7ᆞ?Š»¸^^„?—¸¸^^„¿’\7ᆞ¿)üeðe©¿c<Jc¼±¿Ò1n ¿±pˆÞH¶Ä¿µz&56‰ß?ÓŸ>Ãuß?‘Ä8PéNß?p­Þ_Àß?Ï»÷KlÇÞ?A“GÅgÞ?á…1 ôÝ?@¯¸†„nÝ?z½xÕÖÜ?Ù~ˆ\-Ü?õmEƒrÛ?êßo’¼¦Ú?ª·†ÊÙ?·ô޳gÞØ?&Üõòâ×?ÚÕý÷ÂØÖ?a'ä{ÀÕ?Ì!•ÊšÔ?6P±+dhÓ?›vàž*Ò?;òuGsàÐ?âÿ¹ÍðÏ?/ –SÍ]Ì?°ißM+‘É?Xÿ³Ä´Æ?ÿßÔ6]ÊÃ?ÿé%*ÁÓÀ?ømш¥»?ˆ¾…g‚’µ?;0ø9\ä®?½.qY¦¢?×ïéŒõň?BìéŒõň¿Ù-qY¦¢¿W/ø9\䮿¾…g‚’µ¿ ømш¥»¿Æé%*ÁÓÀ¿ÈßÔ6]Êÿ#ÿ³Ä´Æ¿1´hiaá?urLÓá?ñåü”½ýà? òC-Þà?´eªÐ5´à?p¿êñà?\·îdAà?uð Wòß?¦9²DjMß?y¤žx•Þ?ëš‘P©ÊÝ?/Ç<ôzíÜ?ƒ¯!puþÛ? Pq-,þÚ?Q•";=íÙ?ÇwìPÌØ?´/qœ×?cÕgR]Ö? •ûhÀÕ?£"0·Ó?|QûwQÒ?@òuGsàÐ?7J\ ÊÎ?nx´Š4ÀË?ÐØ+¦?¥È?â%­{Å?a‚rD°CÂ?G,Ýy ¾?Zv³2j·?ÕÀž$êð?ɳiL•&¤?ç”Y£ãŠ?‘Y£ãŠ¿Ñ²iL•&¤¿ZÀž$êð¿ßu³2j·¿Í+Ýy ¾¿$‚rD°C¿§%­{Å¿–Ø+¦?¥È¿TìG›™kâ?·_=`â?´3Hè‹Iâ?ìô·5“'â?á:húá?oSõÒ&Âá?:+¯¯ñ~á?|ëCò0á?ºëªXØà?Û*’†[uà?Øþàå7à?ƒjC.b"ß?£†ö!!Þ?Pµ÷J Ý?ú $ŠçÛ?)ÄS´“°Ú?_;îo'iÙ?.ÍEØ?Í̬Ö?éo*Å28Õ?©"0·Ó?¦vàž*Ò?Ý)㦑Ð?X¹¨m ÞÍ?ùǃ‡†Ê?,{ɳ’Ç? ÒÚ¿[¨Ã?BAK5&À?›.ö6r3¹?8XéuQÂ?°AA€@–¼?,ÔÒów´? \¢ š¨?!z¦Šj?Áw¦Šj¿ÝZ¢ š¨¿•ÓÒów´¿AA€@–¼¿¬š>éuQ¿½uLÆ¿VlÈ9Ê¿0æÑäο†Íæ?Ÿæ¹#iæ?—Cû3<æå?á÷ÐÀ½å?¥Ðáv‡å?ŒtŽðDå?çµ8{óä?ñ Ê#6–ä?{…,ä?«0’µã?³BÇÚß2ã?MV…V¤â?dzÍõM â?´íF+%eá?<qBµà?Pmyã!öß?T"ï  nÞ?Ò6ô -ÓÜ?³Œ-ˆ‰&Û?u;îo'iÙ?Ï/qœ×?=a'ä{ÀÕ?Øðt×Ó?%2Ÿ±/âÑ?¶½ƒ”ÇÃÏ?™˜r°˜¯Ë?{»°VŠÇ?ë ÖVÃ?ÏÅ´°¸-¾?Í¥©‹´›µ?|UA´¹ø©?9?·¾ T‘?·<·¾ T‘¿+ç?ÍÑÏôç?hR~¶iç?Éø¯Õæ?aëc?ßœæ?®ÞQEVæ?(! È”æ?³êyŸå?­í&, 0å?ÆÞÍH‡³ä?€~ A*ä? Ú_‹”ã?2‡ÇÁòâ?¡^ºßHEâ?ëQ]‹Œá?«nˆ/ûÈà?Umyã!öß?GÀD—FÞ?nnƒ§`„Ü?DÄS´“°Ú?;ÇwìPÌØ?þÕý÷ÂØÖ?O·‹í×Ô?Jý\”žÈÒ?¸rå ‰®Ð?’ ÙUÍ?=æ+R©¹È?mC×½OÄ?üy9”²¿?VœÎ¸!²¶?B ë_G«?óó$S3’?Pñ$S3’¿ò ë_G«¿®›Î¸!²¶¿Uy9”²¿¿C×½OÄ¿êå+R©¹È¿B ÙUÍ¿rå ‰®Ð¿Vã¿Æ/9è?ea9W?*è?ÇÍ®g è?èE5»ßç?Ò1wU¤ç?þ—õ[Zç?{Æ*´ùç?â}Ðg›æ?nÛ­ä&æ?¨Ât'¸¤å?4vf…2å?3º9K¬xä?]¾L†Ïã?hëIù'ã?ÌÑ Yâ?íQ]‹Œá?@qBµà?ó¤U§ß?æp¡ÐÝ?6ú $ŠçÛ?t•";=íÙ?NÜõòâ×?o5jpíÉÕ?ä÷ÑÜw£Ó?º-«¶åpÑ? 3„ã#gÎ?†æ;H¼ÙÉ?KàWc<Å?¶.ä£ñ‘À?Åñ¢º·?C]îL3…¬?Ìí<ø`“? ë<ø`“¿ã[îL3…¬¿ñ¢º·¿_.ä£ñ‘À¿õàWc<Å¿/æ;H¼ÙÉ¿¸2„ã#gο‘-«¶åpÑ¿ O„Y08é?ˆ¨¼¥¢(é?äTÌÕ é?ÕÛè?„ò¢ 7è?žþ æ1Pè?¸wR.ôç?Å–ôwd‰ç?ÞÕÊËç?ltêˆæ?Éü/i#óå?qZSo-På?hr} ä?Ì+d/?ãã?këIù'ã?¦^ºßHEâ?»íF+%eá?„Gzà?·0’û~ ß?>Pµ÷J Ý?IPq-,þÚ?åô޳gÞØ?à]"åL¯Ö?àe¸’4rÔ?´ž®-€(Ò?^#rÜ1§Ï? e8éÝéÊ?ÈÑHÌðÆ?5iÎ a@Á?«ïp5[´¸?GôÖo±­?UÛz‚²Ï“?wØz‚²Ï“¿ÙôÖo±­¿õîp5[´¸¿ÚhÎ a@Á¿nÑHÌðÆ¿Æd8éÝéÊ¿#rÜ1§Ï¿‰ž®-€(Ò¿R8£'ê?ŸBØê?¶õ I÷é?€^­ Çé?Ô¼ßê†é??Òÿ 7é?êÎÓ©œ×è?³L Ýhè?4.´ëç?ÿ† ‚^ç?©é`ÔŠÃæ?ah›‰æ?àÇjæcå?jr} ä?b¾L†Ïã?9‡ÇÁòâ?nzÍõM â?ž³‹é¹á?Ÿ…ëÚ›à?̆ö!!Þ?±¯!puþÛ?Ý·†ÊÙ?T%ÝÕ®†×?²ÿ5U4Õ?×IFÊçÔÒ?º·ˆ0ÝiÐ?©`féË?¶&žÛíÆ?íÃ,äÁ?<Æ%bêž¹?Ùï0_\Ë®?x03Ì‹”?u03Ì‹”¿^î0_\Ë®¿Å%bêž¹¿Ã,äÁ¿§µ&žÛíÆ¿L`féË¿·ˆ0Ýiп«IFÊçÔÒ¿Ó·ôë?["ºœIöê?<隷ýÔê?]žÎx%£ê?<ẵß`ê?!©EUê?;§M¹«é?WflæG9é?Ö†[\H·è?qzž &è?6t¾?è…ç?WxD׿?ah›‰æ?vZSo-På?;º9K¬xä?*Ú_‹”ã?MV…V¤â?ã4¹¢¨á?¨Þ=î ¢à?²jC.b"ß?bÇ<ôzíÜ?"ào’¼¦Ú?­7”mŽOØ?N k béÕ?»Ù8²uÓ?x¿L öÐ?`Àÿ¸×Ì?ÉWSW¢±Ç?ô/kÂï|Â?¾a€¬yº?Y©ïKÒ¯? ¶:;•?ø‹¶:;•¿Ñ§ïKÒ¯¿M½a€¬yº¿“/kÂï|¿iWSW¢±Ç¿Àÿ¸×Ì¿J¿L öпÙ8²uÓ¿ßM›Õë?r´¥ŽpÄë?+ “ &¢ë?úθÐnë?­n˜<*ë?;¶±ŽÕê?‘$B‚pê?`áR$úé?™JYÐBté?듎®Þè?ã‘ÌÃ9è?í?5¢;ûé,í?öÍïMâí?(iP’òÒì?ãqõ <‹ì?Þõê1ì?Wêc6Çë?’Tü$`Kë?>vFš´¾ê?˜EA„Š!ê?JYÐBté?à†[\H·è?@.´ëç?íÕÊËç?nÛ­ä&æ?Àí&, 0å?…,ä?rËÓ¿ã?´Š$¨˜ÿá?ÚëªXØà?ê9²DjMß?Á½xÕÖÜ?¿ô%ÊvNÚ?°¯j"ßµ×?O^n¨Õ?¶]tZÒ?# ËÞ5Ï?{ ŽÛ“£É?$"̵yÄ?òÁ়?­·„…7±?mœ•kù–?™•kù–¿D¬·„…7±¿Á়¿»!̵yÄ¿ ŽÛ“£É¿» ËÞ5Ï¿ìµ]tZÒ¿^n¨Õ¿Åùžs‘ºÏ¿ñœ÷æ`ˆÏ¿ˆXÏòõÏ¿ý¤œ·Ñhο=¸E‚ü€Í¿‘•Yí_Ì¿DU´Ë¿·]1óÉ¿ ®êäèÆÇ¿r! ÈäÅ¿¶ðs^Ýÿ†<€Ò»µÁ¿iK€[t澿Tõy¡æ6º¿âi‚Bihµ¿H8jŽã†°¿W×’Ú<§¿ÁÚ–±Àìš¿õ_:õÅ”~¿ðE?Z†?M„¢es[?Ö½æ~M\§?>°ì´Œ¯?&¬lF•³?^Á‘ºp·?6ÐO‰*2º?n¤:¨ï¼?zþ»¥C¿?bg3Q“À?LtDÍJÁ?H94ÆÁ?m…tÄtÂ? ã>ÑÂ?˜+]&ÇÁ?Øê¹è2LÁ?éêp+•À?lQÚ™µG¿?½ 9õ¼?”ƒÏ±8º?vdzÕñ·?¶'/T FÌ¿Ì[Ì¿”t7£Ë¿~ÄîÏùÊ¿9îʿ⮪ƒ$úÈ¿ykñaK©Ç¿ßÕª!×&Æ¿ð{/¯vÄ¿`a^1¿B–€ÏžÀ¿N<Bw½¿Òh<R¸¿ß_øå7õ³¿{|,w®¿§¤èJÞ¤¿‚ÍÒU2o–¿: se¡°i¿X ±Ý~?ýŠšŠ ¡?j~ùWª?èôZ»[M±?èB{p2Tµ?JYšÿ¹?„nQ—n€¼?Êq>[ô“¿?ô¸~ò"Á?¸¿ ŒÃGÂ?Ë—Œl’5Ã?²óû6 êÃ?ž‚þ¡pcÄ?û° Ä? À¤Ç¡Ä?I_ÝrdÄ?¦&ýPëÃ?D‘ìÊ‘7Ã?§MøCJÂ?Í>ç%ö%Á?6å¾I›¿?dðÊ“ˆ¼?Z¡ý8‘êÈ¿ܦ_éºÈ¿âUêÝ+KÈ¿J’wÄ٤ǿ¹Å?ð½Ä¶¡jÆ?Õ ¡òáÆ?²S÷²*Ç?›ö±m‘Ç?G‹EÃãÆ?nnXÕ:lÆ?€_Á¿°úø•¿¿¯€•µT¼¿]…¼Šcĸ¿Á5¤ýì´¿FŽÄذ¿”Áà©¿|ÌMU7> ¿yR|ýQ…Œ¿áê!q?\ظgÞ–?sdL)¸´¤?Í;M¤Ù­?\_õΜc³?1$3 ³·? d¡­Ò»?û…M”Õ´¿?Šä‡ ©Á?}š?·lPÃ?¤È÷ÖpÌÄ?ÒgÚ)bÆ?¹Åä4Ç?º‰üc‹È?Ïþ[5ÃÇÈ?äÛtcô<É?mÕ¦=xÉ?»@²}ˆxÉ? ë£[>É?”pBÌsÉÈ?v'3ÏÈ?uÃY3Ú6Ç?zŒ"ÓÆ?1jç¶|ÐÄ?*Ó‘UÃ?\ –/4–¿ª´‹€›i¿®.½ÌsþÁ¿Ý Nð¯^Á¿2úõ'‡À¿5­ÒN)÷¾¿Œ}ì >{¼¿m¨Lº¡¹¿ÇÛɰXq¶¿½ìHœò²¿szëÂ9\®¿z¹©·„Z¦¿ø\ýç蛿¬@V®Æö„¿>¥ïù–}?v«É àŽ™?¿pÙšoé¥?Ô åK)¯?Vz†~ý³?ª…^›Ë^¸?£ºüš¼?€ýåqfRÀ?˜åˆq:Â?8þÇ jÄ?˜Ñ(&ãŸÅ?—ü’ÏÇ?‚1Ô‹[È?—ålçpÉ?Þú"ö,RÊ?Ò;Ãþ(ýÊ?ƒ§e>/pË?Ì)°÷BªË?3ÂO²ªË?á2îZqË?—¾>gïþÊ?bR ÊTÊ?ÃãåèsÉ?9¦°._È?ŠR Ç? ^­,Ó¤Å?_7Éì˜O¿¿ÕxG&mù¾¿ôÃت'¾¿žª1 ’òç3”H»¿m¡m½,;¹¿”‡ûH°Ë¶¿\@NRW´¿lÜñ1à°¿`™ñ™1檿îOÇ7ƒ£¿ôà“½S—¿9P[lm{¿gÝs„?â÷&9Á›?5ìnµÇ¦?¥ :¿ ¼¯?B£"À¯S´?šW¾¹¸?0çá?½?2%>•¿•À?£5’©‘Â?•Ä–›ªoÄ?p@FÚ,Æ?jaçEKÄÇ?(‹Öî2É?IÙ[rrÊ?Èpxu‚Ë?ÙU6òd_Ì?„ÔlùÍ?oŽOêwÍ? }ä°Í?² W±Í?0E•‰!yÍ??s¢ròÍ? ©uäaÌ? ûaœ…Ë?ø–œCvÊ?Ô ƒ6É?N·ƒ]|ÉÇ?þfLjÇι¿ùï‡V{¹¿ÕÃÿ·­¸¿Š³‡œ z·¿ ·Cӭܵ¿ "a¤pÙ³¿‡­3v±¿¤Õy$r­¿ùFÀ‡åQ§¿ŠÑŠþš ¿Õ*ÄN¼’¿Áœñ¾×Õj¿~ø,‘‰?,*÷šw…?~«¸‚–³¿!Õµ¯h²¿esVh9Ò°¿‡¦ÙÍ„±­¿zDLË©¿(zTRפ£¿¶³®ñäH›¿Ç6‘úBŒ¿3õ ØÞ?zlB¿Œ8Ž?vtmž9êž?UÇïO§§? ¸Ã4°?°ÎJðÄM´?þu¼™¸?ª¦©ká¼?ŽÌR¦À?A^hÿ¾œÂ?¿»bû‹šÄ?XøY†Æ? â©öîLÈ?±ÆËJøÉ?ÿ`‰½Ð­¿Œ½êR}«¿–ÃÖ Î]¨¿så>g}¤¿@îsùfÌŸ¿~ ¥n_G•¿˜éM` ƒ¿\ÜMâÝj?n £§5=‘?T×eC‰üŸ?ö—bµ¨º§?ÉJAô¦À¯?6ÚÙ²0þ³?ýä¶,¸?M:kX„a¼?U–rhIÀ?ˆ"äZÂ?­àLU§^Ä?· `¿QÆ?1¯{D.È?ÚJ&GðÉ?Î{ëÊ­’Ë?ËEñ·ŸÍ?ÖâÉ_iÎ?ã©Qr‘–Ï?Ò†rà!KÐ?ÒHo/û²Ð?ò!µ–ÐÑ? ¡[Ü6Ñ?dãɬ©QÑ?z™™=çQÑ?ïó…7Ñ? Ñ2ÖÑ?öf D^´Ð?àÏÌãLÐ?–îAnÖšÏ?Ù}AÜinÎ?óGdZtÍ?ÀÑJìzˆ§¿(-'Dž㦿¢É •O¥¿Òx¾0£¿´'fÚŸ¿ >b)<˜¿Þ£ižsñÑ?ž¶¹­±ñÑ?]®ÕÐâ×Ñ?Dà‹[V¤Ñ?Ì~ºsŽWÑ?ÎèRMòÐ?ØçDüuÐ?ómë (ÅÏ?7û¡ÕŽuÎ?ŒŽ]à ¿ã%Zc¢ž¿¦Ò:r^›¿åœù¾Á–¿rõg×ì¿äÎçu`‚¿HÄÈ“ø6¿OC4ávÒ?„\½A wÒ?¼Àžã]Ò?p"Wjw+Ò?rC\àÑ?ò}=$P}Ñ?ì“RÉKÑ?¾~”^‚sÐ?hε€ºžÏ?h']¿ÐÕ’¿2:7‘¿p±ú†•¨‹¿ÏYÿ1k‚¿€*æ¡i¿HOª:Ñ—p?Žuk§é™‰?¤kB¯–?ïÓŽ›Û ?f ×Tä¦?1â½d­?ꜙ±L&²?Hµ«„ŵ?aË ‡¹?¢\8nÝa½?—ïü¦À?O©Sæ4žÂ?žýˆ§^”Ä?>µƒÆ?-x73hgÈ?ñsX;Á:Ê?ÂG)Ï2ùË? nâjbžÍ?Ô°ß3&Ï? /âiFÐ?Vĉ–`çÐ?üKktÑ? zÎñ(ìÑ?Óz’´mMÒ?}  ñE—Ò?ÚkkøÈÒ?¨ÈVéâÒ? íÈQVâÒ?Œò—õ¨ÉÒ? »ÃeZ˜Ò?Uù×2çNÒ?kú{üîÑ?xŠÇ³vÑ?ø¥|ÒêÐ? /Ë›ŠIÐ?L,½I‡äz¿Ú1Šbé™t¿ëwÂ01&]¿tá^Ζ«e?Œ§<š?.?ŠÐ‹‹’? Ðg@˜?ºf l³õ ?å–ÝaZ¦?¦Ú‹°¬A¬?èøô(ÀN±?$j­T<¯´?`Q¾l :¸?é¢À}æ»?¨!CŸ«¿?‰·µÒâ¿Á?ÿæ¬Ã?8\^{˜Å?>Ár|Ç?WЀUÉ?&­ó«‘Ë?Rú+1ÓÌ?:j5LoÎ?0~rþPîÏ?Úød0‡¦Ð?"µ ôCÑ?¬*ygåÍÑ? ¾¹¼CÒ?{%dâ#¢Ò?È(s“]êÒ?Œ3§ùÓ?jJçð‹3Ó?jwmnË3Ó?®+U+«Ó?ÊÌ©tëÒ?Ö˜ý·¡£Ò?c½ÞçDÒ?xì{Á5ÐÑ?´g˜±FÑ?Î_³©Ð?“˜ÔÅòöp?¾AWžUNv?œ‘†X?¼‡ðëŠ?òÌÌ÷¸¹’?¦\Ê!¾™?Ñ5A“€¡?l#컥?´èg«?6ÊÞ_{c°?ˆÖEœs³?ö›¾jè̶?˜\‡ÇCº?lŒ۽?0Ù»ƒ­ÅÀ?y¼Ÿ ¥Â?në9‡Ä?æ˜Oƒ‹gÆ?àötWAÈ?áèOAÊ?Nz ÐÏË? ÇzÍ?PŽÞÎï Ï?¢_&cÜAÐ?,`aíÐ? ñâúX‡Ñ?¦PWîBÒ?NÑ·<Í€Ò?,a ÙÝÒ?¬)”}$Ó?Ðn^n TÓ?<•ÁslÓ?ÀN<¹QlÓ?»TÓ?\Ñ –%Ó?YI§YßÒ?¾£*k·‚Ò?üRö¯˜Ò?Øqf›ŠÑ?ÕóaG•ðÐ?:cýnñŠ?¥>õÅE?–ò‘‚‘?{zy†~«•?¾–øQr4›?_ím9#¡?~fc×Y¥?¦9öIX¬©?ÚMì%Ô®?0ØT±<²?0ïÎ41Gµ?ó& (‚¸?j<Òpªå»?GNÁai¿?«ƒ›%O‚Á?¨\Q”:WÃ?ÎVíç.Å?3/œÃÇ?2+¼=ÔÈ?€½¸Ò˜Ê?êØãNÌ?ÍÅÌÔïÍ?iû^ìyÏ?ôU·ôDtÐ?íˆ;u Ñ?¢1-)©²Ñ?öð¼M¢6Ò?!÷¡­¦Ò?s»ƒ­²Ó?鲯ˆÍFÓ?TäKçPuÓ?D€JXÔŒÓ?MROÓ?¤ìs¿vÓ?$…æGÓ?öa"34Ó?Ê?Ï™¨Ò?oû8Ò?œà¢pµÑ?¼=TEÑ?dˆÒß”?&s_Ïð•?8+ÃÁ«˜?&£“œ¯œ?R =•Š¡?å&2®8\¤?Ò›Ÿ( M¨?æ‘ËÇBЬ?Ô`¨>pí°?DhÙÎJ°³?,Ïœð©¶?=êk]Ó¹?Ú¶'?ò#½?"R[Ž,JÀ?xPo‰ä Â?¿¡ÂØÃ?*Å™]R¦Å?Ôó¿rÇ?ˆòå_£7É?â\Ú‚òÊ?Wé]ižÌ?Êh–+7Î?¹º=͸Ï?#6™ÅÐ?¸T·ƒò3Ñ?ÀlëðRÇÑ?̨NvHÒ?‹Š¶Ò?¼ïIJ*Ó?˜ìÄ™ÉRÓ?>ušãM€Ó?pw“-P—Ó?ü-7±—Ó?¦f¢ü€Ó?¾IM–àSÓ?37¿«Ó?ÇŽÿ¯¸Ò?b¯–ÏJÒ?fHtÊÑ?‰Aø½,7Ñ?˜¤Q¹“š?ã3˜ý˜›?ó•ý {9ž?n(šß¹¡?l+ ¬£?#=¥ì¦?ÒéÊJpƪ?¶ÛV60¯?v Ä˲?RðÜNô? ¯úéÞ¬·?@¸èHź?º ¾?ó2&±À?ÆSJ§IkÂ?<Û†Î,Ä?ØmvðÅ?`ŒZ=Ÿ²Ç?úyÇ©nÉ?y33çA Ë?óaŠë0ÃÌ?€™ÔMaSÎ?~oËSìÌÏ?ÒÉq¢–Ð?ï›°^Ì6Ñ?Iª®ÇÑ?JngÞEÒ?ÿÈ×°Ò?.Çbô Ó?ÊU?>JÓ?ôi²ÄÎvÓ?ÊÒ”UÓ?xù76Ó?ƺ[ywÓ?®ÕRKÓ?þ"¤Kˆ Ó?ÂZçöÁ²Ò?€Ü~tÙGÒ?ºYÛÉÑ?½ÌÐ:Ñ?x×Í©·ž?AîµÝBµŸ?²ÊS™Q!¡?ÿ/Ã^k£?³ª˜&A”¥?dG²šÁ¨?ªl°½†¬?l‚|l°?.MQWXÖ²?ee¤Çû{µ?³‡=:`V¸?ð\HŸt^»?R&`ݶŒ¾?¦Zs›¢ìÀ?—Ù§•øÂ?¼«‡¹)VÄ? ¡èaðÆ?¢OŠÿÉÇ?èg }É?(ò…óÞ%Ë?mNüPÀÌ?-Q¯#dHÎ?Š]*FºÏ?K¤„ß-‰Ð?)gYΤ&Ñ?Êu„þ³Ñ?ÖªïÍÙ/Ò?™§Ü™Ò?ì“£mîÒ?'±ÚI/Ó?üü…óZÓ?T%IâqÓ?F’¥;qÓ?²™x9˜[Ó?Å,MY0Ó?½Â®èïÒ?ð†úšçšÒ?˜÷\-2Ò?ZvGÁ¶Ñ?<78ŠØ)Ñ?¦%pçÿµ ?ŒáŠøÓ2¡?Æ2`ðÅq¢? Œ2”4L¤?JØ(¤̦?dr>Ÿè©?Äæ£¥™­?sÌuÛê°?)UžI³?8OÞHŠáµ?-F¸”έ¸?á#í×ꦻ?ù_ו}ž?7¾›DäÁ?Ó-Ÿ†á©Â?‡X–Ê–YÄ?‚RnôÒ Æ?© ñ]¼Ç?äXb5gÉ?º?œË?þšßýšÌ?f~bü“Î?îÈ¿CH…Ï?<ÅdWkÐ?XFb®¾Ñ?x«ÿzXÑ?âÁªÊ Ò?†6àíåpÒ?¬ÑxŨÄÒ?º˜ÜBÓ?Êo”/Ó?Æ1δDÓ?xÜèDÓ?làð‡±/Ó?gòP LÓ?6pé.ÆÒ?Z+´DÇrÒ?»#êÞ Ò?ÛSìã“Ñ?MÁ ëÑ?—9;êÀi¡?ÿï…s§å¡?^–þT£?ÎJzìï¤?ÈÝæ¼c§?6ºgqª?i.ÚÙ÷®? IŠ–±?$^çÐÃo³?ÒzÍÝ/üµ?Ú‘ƒa~»¸?ð&Rئ»?¥½iOû¶¾?;3@%òÀ?ýü]Vp“Â?`ƒ¨Q;Ä?¸P4«åÅ?©Æ`XŽÇ?e” ;81É?kÇ7ÊÊ?îPï&\UÌ?([—“ÌÎÍ?E5Ü2Ï?¾è? ?Ð?î,«ÙšÖÐ?’°@Ÿ¨^Ñ?ÐY? ßÕÑ?>Ï€Ÿ;Ò?ÖLÒ?_Q¦ºËÒ?AñlÂõÒ?\?°ý Ó?VùC‰. Ó?¹ËvT[öÒ? 6´5¿ÌÒ?¢¥‡¼ŽÒ? %|¬ï<Ò?Dˆ_&ØÑ?z‘}¶\aÑ?Cçr½ÙÐ?a!^ˆ‰¡?&{`½R¢?¡4íí8£?Žs¾þL¥?äLF.Ül§?ìÃ-ôœmª?9-âTÏý­?/3¸&0 ±?} ÌwS³?Ò?ñÊᕞÒ?¿ °z³Ñ?žðhéöQÑ?-xé\ßÐ?™)Ù›Ë[Ð? ¿h1\ ?$¾b¶Ù ?Tõ°H¢?þ%ÙýªÆ£?¿ztÿ ¦?ÙŽ‡é ©?ÅÓƒšø…¬?Z‡«r4@°?„¾y²?÷z?¤é´?²ŒU3Š·?ƒxžÊ½Tº?í2¡ªPB½?N¼§Ñ%À?êi|”´Á?ü=š’‘IÃ?‡¿*?ÚàÄ?ðƒ)zvÆ?ðÚ €È?ѶÖ0 É?5‹7qNË?$æâŸnÌ?ŒÈëÂÍ?êN žþÎ?çÚ² õÐ?af›ÙÉ‘Ð?¸"Ï!ŠÑ?Eš+dÑ?$p iŒ²Ñ? éÅjîÑ?ak=#4Ò?rñ¼?s*Ò?2P(¡*Ò?Â3qÃÒ?¸¶­‘ïÑ?N-e<é³Ñ?ª/uŠÞeÑ?½fo›´Ñ?kiÁ[”Ð?ý…Ž*ïÐ?IŸoŽmpž?þLôãÅoŸ?o 4eqâ ?6ÇüŸ¢?*ã¬ñVõ¤?&;bOhÛ§?štžÖÛJ«?î!m ;¯?û"`: ѱ?¶7=}:´?ë[[×Ó¶?îE=Ÿ–¹?r(wûö{¼?‹9«|¿?H¦'{¢HÁ?Ëu²ÅÙÂ?žö¨·kÄ?{šÐà´üÅ?/ Ù="ˆÇ?›²B) É?Ø+˦ Ê?,i^¦'ãË?»êÄ 3Í?|™ÆqkÎ?lWz5S‰Ï?˜4³WôDÐ?¦¿SEZµÐ?nû00ÄÑ?Œâ?EbÑ?Ff|?Ñ?žseºÄÑ?uǺØÑ?ïâkèØÑ?½¦VGÅÑ?0–SžÑ?”÷)>›cÑ?þJ±~Ñ?oÅ2uy·Ð?(ø`‹xGÐ?“ÔŸ&Ï?³H `Ú¥›?Bï²vªœ?¼rñ–ýž?$tÁð:¡?J½zv£?@švrn¦?–JÍ۴ש?ÊöË.SÀ­?8¶éÇB±?`ið&²s³?ëq7n¶?€ÁdFĸ?¤S)3£»?àÑ;9%¾?½Xi\ÕÀ?yÄiË,bÂ?ùºRÓ*ñÃ?Ó]8x~Å?|/Þ:Ç?™CüV¦„È?;–(FöÉ?Ë,ä•ÂVË?“Õ `r£Ì?'êyÚØÍ?z0ÐŒúóÎ?æ–¥òÏ?‚á‘WhÐ?××avÒÆÐ?éËînÑ?üeòœÓMÑ?~sr uÑ?ΔAÙˆÑ?œûaõ‰Ñ?Ã#fž–uÑ?îйRÀNÑ?ŸÏHßÑ?£B¤uƒÈÐ? UÍÎjjÐ?â§€ÿöÏ?l&_«ùÎ?¡ÛÊgiƒ˜?p`KÛ›Ž™? ~_àá›?ÆaÖ‹KZŸ?]ÍÉöý¡?J9\Ͽܤ?ô߆OB¨?T¦˜G%&¬?®ù$eE?°?ĵ1àU ²?žÉÝdX0µ?‚ˆÏIîè·?­~Uú?‚õ”iy¸½?ö¶»Æ`À? ´Ö·êÁ?|þM5 wÃ?ö¿Ø†§Å?fM6·¹†Æ?"ûÅ }È?¢÷ÉDqÉ?ØÿmÏÊ?…1iÏÌ?Á@{ËûLÍ?Øp ] fÎ?s•å(HbÏ?,D ŸÐ?;Ç…e}Ð?Ó¢ö»ÉÐ?æìÍaÑ?~¦€M*Ñ?ȱsaó=Ñ?08m>Ñ?v‚ÊxÕ*Ñ? €IÑ?;àZ×ÊÐ?z°Œ• Ð?Ñ |Ê¥!Ð?bZ/gÏ?’èÂ"™kÎ?<›1¢3•?˜5³—¼F–?P¡£`œ˜?²óõçœ?>Î0—I] ?ͳÁ;£?,f„‰/ ¦?Å^×Í‚ª?ÿÏùzÚ×®?¸…ärQ˱?¶“}jUY´?ódƵ¡·?´ÃK|ç¹? ñuïØÙ¼?¯Ei’jß¿?÷ÆZxÁ?2[¤÷Ã?ur)ŒÄ?¿{F4jÆ?¬…)Þ‚‰Ç?ÒZKä¥öÈ?ïÁÝ÷JSÊ?üR0†œË?ÞYÎÍÌ?l5?ˆåÍ?`rY=ŒàÎ?Æ?tÓl¼Ï?Ó½ñL…;Ð?ô#^¼L‡Ð?k±í…ÒÀÐ?YA9ü‰çÐ?QszÒûÐ?DEš&@ûÐ?[™–>èÐ?•kÊù´ÁÐ?R?#[ŒˆÐ?CÑ9 "=Ð?ŽM0`ÀÏ?”1çú9åÎ?ÄìõïêÍ?cY–³ß‘?”‹!×ü’?ð§@¢eV•?I¨-ؘ?aHûš?`:‰< ¡?ö©_(¥?´ÞR°é¨?ð§ño?­?İz.ÿ°?„;&=³?<Ã?•C¶?û£“ùZ¹?­$Øõ ¼?YQ÷À¿?üшÁ?«) Õ²šÂ?…¨šê#Ä?hLÖ¥Å?C³§IÇ?©½³Ã‹È?Oü†ÀçÉ?˜ àâ/Ë?Žàþ`Ì?ðš!xÍ?$ño˜rÎ?eøí;øMÏ? oÚÐ?o+˜¨OÐ?´”_ЉÐ?lµ£¯Ð?¾—^¡ÃÐ?2­a+JÃÐ?&Û-ê%°Ð?Ä(•|ä‰Ð?d@$àPÐ?fk¼ö£Ð?´h‹eÑQÏ?"ë=&wÎ?9jÅ«c}Í?c¤6O]?t>Xˆ«?3š7’?Bl–¨ûÁ•?'ŽSHrš?¶4 “Ú ?pâí‰ñ‡£?ÅÍ«ìn§?ÕéÈNÉ«?g:·[ßE°?¿©}Õ²?Š v6µ?õ”,Af¸?rA$´Y»?¢Ò(ï+_¾?ê•‘óY¸À?;€¸wCÂ?Ò¬cïíËÃ?ôŽ`&OÅ?‹Ýy´ýÈÆ?°Z¢Ð5È?ÂòÔ’É?¨E\}ÚÊ?0øÏ Ì?«× #Í?ªçÔ¶Î?|”©,ùÎ?‚9¬d³Ï?à¬4âJ%Ð?‹¹rN¨^Ð?ºà}EA…Ð?ö°º˜Ð?C¬)ä˜Ð?2¥À…Ð?ðop_Ð?”) z&Ð?¹,s¶Ï?Ì€ÒêüÎ?,…ž#"Î?Þa‹U:(Í?õc5‰‡?zrÏC“î‰?s0ÀîgÅŽ?DÁ®ŠÞù’?Ûb(”ܶ—? ö¶…?îÎÊ·7¢?`­Ä”¾%¦?&RÚè#‡ª?x$Ü Q¯?xÍHÒ;²?QXÖã÷´?Ñ]ÅžÓ·?rÄåQʺ?$µµäÓ½?ù-_âltÀ?A–rÍÂ?¦?óB‹Ã?cþYÅ?VõXI‹Æ?òŸ ÓwùÇ?$¤d7WÉ?ÞcË‘ Ê?[úQcòÒË?V÷~S2ëÌ?vµyê›æÍ?]óëÂÂÎ?r,wa†}Ï?\ZŸ Ð?%¸F«DÐ?Døe¼jÐ?†,Î=~Ð?á‡-rf~Ð?nú¯]8kÐ?k;Â’àDÐ?Cg•¶ Ð?GlJ~€Ï?#h—UeÆÎ?qÀ?éêÍ?fsî(ðÌ?¾¨]Ƀ‚?ï…4…?xaÚ&ó‰?¨í¨½õŸ?\? oŠm•?µO¬kýU›?úêô¡{%¡?KÑ*?¥?<3Q\‰©?têJ^®?²ÒåýÛDZ?¯Oqº¿ˆ´?Zˆõj·?ÌI“Ugº?MIáo”v½?J‘îŽHÀ?áé=®×Á?⛣ÌdÃ?Pµf´ìÄ?>ú«ËßiÆ?jÅgÚÇ?Pj+(:É?±yUÄ…Ê?÷ªû±ºË?ºœ óúÓÌ?ŒvSŠãÐÍ?ºnYƒQ®Î?âpjÏ?Ö?ñ¢>Ð?Qœî;Ð?êí€ÖaÐ?Œ7~ˆguÐ?ýÚêæŽuÐ?j¢[/NbÐ?þ†®ùË;Ð?0ÞÀ[Ð?lìöýlÏ?²ýÚØ±Î?ã8P–ÕÍ?ä×’ÌØÌ?ŠD+5 }?•(¾ ?öôëzë/†?âŒ×覡?ü0J‘³“?¦¥—é²™?eZ»=–` ?WèÓ7èe¤?Êu U à¨?”Ì‘lí?l‚îíD‚±?‡dóûJ´?Äï2?5·?,躪9º?Jûp† Q½?ð JeÍ9À?_ˆDPêÌÁ?ýÂÛ–ç]Ã?œj‘ƒéÄ?³[udjÆ?W®$ hÞÇ?°NlAÉ?¦ (HÊ?€Ë//ÇË?é[ø·ãÌ?7ËÿäâÍ?$:JJÂÎ?jû‹ªÏ?>Z@cž Ð?8¬;èÅFÐ?ƒbuÆÔmÐ?a-K-yÐ?ÚŠ®žÐ?]3GnÐ?q·ˆGÐ?bQ–£± Ð?…§‹?’gš•äš’?Â<´˜?ö9Ø„EàŸ? äÉˤ?\šר?´Åí`„­?Å5¬ók±?õÃıÝ=´?€–uüÉ1·?tcX*¼?º?ÏÅð±ï`½?Xô‡Z„FÀ?]4©vÞÁ?Ò×YßtÃ?1‘£§ÐÅ?f¶Ëªˆ‰Æ?<ÈÄÎÈ?À4WÔÁhÉ?¼› K9»Ê?$ÞÒÙµõË?*Ç›¥pÍ?2g$ eÎ?  ¿CùÎ?ô/i“¸Ï?‰c÷Í)Ð?V*®¤adÐ?*A®‹Ð?Ðc€ÔSŸÐ?x”ÞuŸÐ?p~8ŠŒÐ?;)8eÐ?Ž¡ì‹Ö*Ð?m I/E»Ï?…ªØ“”üÎ?k‰!®TÎ?Mq‰üÍ?IÊ6Ù±ƒt?†ÔUÂ'-z?š­lq‚?ÀhÐF:Š?T=@yð4’?`x‹FÊl˜?í?*}»Ÿ?ÝåL䕤?NéZ1y£¨?Oš/¿ƒ¬­?’Äò኱?§¬ÇßÜg´?Ü{M¾?g·?xk5k´€º?BvΗ›­½?BËÍ£rÀ?´^Iš_Â?É'Z «Ã?Tº†æ@Å?øˆ"êËÆ? ˜G RIÈ?~¿ùµÉ?‚4 Ë?Ÿ×¤iÅJÌ? ?¤¼jnÍ?aãÏsÎ?åU3ËXÏ?É«XG Ð?°8¯[Ð?Jâk±–Ð?$V'ô9¾Ð?ܼ–ÑÐ? Ã6İÑÐ?Ôè—¾Ð?˜7è&^—Ð?ħì\Ð?N¼ÿ÷”Ð?ƒ<}ã\Ï?[jè¢wÎ?¨UëF×rÍ?óóü³ÔJt?<ë0êcz?镧昂?bWÐøzµŠ?êN A…’?š–à¦ýî˜?†Âu+#, ?,ä‹‚/o¤?èÓq;Ñ©?Ã’J•F®?ÌAÓ©á±?Z´ÿÓδ?8鿤ðØ·?ÿ*€ð»?ÃLæ;¾?X‚ë›ÁÀ?v eÂ?6nm7Ä?–ŸT< £Å?ðàÛ•s5Ç?.eXÕ¸È?üø{z*Ê?š¼û.8†Ë?Ú£ÊÌ?î9Ëf[òÍ?ì~l\’üÎ?ú×øåÏ?èÖôdUÐ?+'¿¤Ð?Î/àÐ?¼ì* Ñ? Ý¬/Ñ?ЕWx>Ñ?Ë  VÑ?vï¬$¨àÐ?|·¥£³¥Ð?zR8©VÐ?P>O®=èÏ?J É\×?‡øÝrFÙ?&<´øfÂÛ?ÂÜ U§Ý?ðyg”ãß?‰­]3Èà?Ìä‘Ûá?™œ'3Ÿâ?уOS˜ã?…í¨IHä?µ!'«E%å?О_¿å?Cº~æ? Ï lÖç?5æŠ3rŸç?øŒ®T— è?2éŠÜ†è?p×è?zs“,81é?ä'ÔTgé?ÖFgÃé?÷É'ó¸é?Ð}¿ð&Ëé?§ÛþÂ&Ëé?F}Váò¸é?p\ÅÂé?bÛŠTgé?¿{Ÿ71é?¼¹aÓ×è?\ÑR†è?S„P²• è?Í)…6pŸç?,ÆxVÔç?¸œ‘~æ?Rî§{\¿å?«Æ|ÊB%å?‚:#°FHä?çèRÿO˜ã?ãÀ²/Ÿâ?–¨AÖ Ûá?fk‹/Èà?€–u!Œãß?j‚ÉãžÝ?lÙmò]ÂÛ?èy@DýEÙ?Ó—»Š¿\×?EØÝ] ¾Ô?+À}ˆ½Ò?íª®÷÷Ð?rD j9àË?ÚšÞÓ@Æ?aôÙ©Â? ªÓݵ‰¸?j€Ô÷ÚÒ¯?°JÅgU‘?ˆƒ|ÄV‘¿ R±Ó¯¿'- Џ¿Ù­àÜ¿®¢JAÆ¿ªÒÔÿiàË¿’Ì…пü“7ž½Ò¿ & ¾Ô¿ Ö¥Ò\׿!=Î FÙ¿ºâï¹mÂÛ¿Hœâ«Ý¿JÑ·U˜ãß¿íz54Èà¿^óÛῗ׃2Ÿâ¿z©lR˜ã¿²$’GH俨AC%å¿çË»[¿å¿G£¢¢~æ¿c:áèÏç¿%½ðjŸç¿-ÉŒüŒ è¿FŸ«b…†è¿klOà×连B»Ð'1é¿«=¦ÏAgé¿Ð£òدé¿;æ!Ù߸é¿NËé¿)„ÖØÕ?µ Qs×?~e·Wo¦Ù?–¦ JªåÛ?ú ÙÉ‘øÝ?+Pp%ž à?Fì. há?È)’ Ýøá?v c¨œÚâ?å[ßÌ»ã?òù£U†ä?#ŽåØNå?©£Æetÿå?>îÞ,Ø«æ?//0=WBç?ƒ6HŒµÑç?Ø+âKè?©¡$vÙ¼è?¼è#C†é?j¹U1ké?êqtÅH©é?nÞa|Úé?Nœ.Çùé?âøp+; ê?P—øÝ¿$;],  à¿o'>iá¿ç–Ýøá¿f.‡hœÚâ¿bpÌ»ã¿Â¼%ùS†ä¿*½.ŒNå¿Êwp&qÿå¿HïúÓ«æ¿‘Âc†QBç¿,Íþ%®Ñç¿2 ØKè¿SˆË­Ì¼è¿¬…Öu鿸v|ìjé¿|ôx2©é¿OZgdÚé¿K4 ¯ùé¿I¶Ù$ ê¿>! ÃÉ;Õ?‡uh:–‘×? e,¦íÓÙ?<ì£" Ü?¬jýRd,Þ?Ýå0·Åà?òxùŠ;á?+öìd9â?cœrQúâ?v³'uØã?iÝ!¨ä?z•Ùmå?'ØVèB#æ?(š"?Íæ?¶ºÏgç?w®.õç?Tb{,¨rè?å2- âè?D¡ÉY:Aé?3«ÞX‘‘é?‚ïøˆÑé?^·¬ã ê?™B0"ê?´{i2ê?6\i2ê?ЉÞä/"ê?ÃG ê?$áˆÑé?VÂO?‘é?nè¢9Aé?zÛp– âè?(X¦rè?%ë‚,õç?(pÀhÍgç?Xuß<Íæ?ŸCÞ@#æ?ÑÊmå?ikŨä?úQéØã?U7œˆúâ?¸vÃ]5â?SíG7á?org7Áà?xIßZ,Þ?øQ¼ Ü?0YQãÓÙ?=MŠy‹‘×?|䦞¾;Õ?Ìë_óâÝÒ?G{\‚@oÐ?(yiwm÷Ë?—l"”{ôÆ?§b+"îÁ?%Iб¼£¹?^ù7Šâ®?d{âw2}”?Ç”.”¿X°q†ã®¿Öòëì8¤¹¿YF½ê^îÁ¿~oðu¶ôÆ¿Š ¦÷Ë¿AÄ/t[oпšî…]üÝÒ¿ÙqÒGÖ;Õ¿w~«F¡‘׿G7÷ÓÙ¿˜ñ¾o* Ü¿†Yihj,Þ¿°ƒîÇ࿯ûï<á¿B«É :⿈´)?úâ¿ýF¢ÁØã¿­&‚ ¨ä¿º2²ômå¿@ryR@#æ¿Ú²o¯;Íæ¿ÎpêúÊgç¿qÿì{'õç¿/n»žrè¿Ï¢Zðþáè¿ :;F(Aé¿Æ”Ò z‘é¿bÙþlÑé¿\0îê¿ÿ쉥"ê¿Ú­GÓM2ê¿6pžÒJÕ?àÜ£ ×?4¾^ðåÙ?(&æ£Ü?–šÄ€4AÞ?Ñ!@0ñ)à?¼­ÿ³ð(á?:HÞ¢¶â?û…ë®øã?¥é$Òäã?Ûo™£¶ä?;ªázå?ÐâÜ«&2æ?âaüÛæ?õ“fÅ|wç?UÈ–âºè?³Zâ×÷‚è?dÉGkBòè?wvnRé?@7WI¢é?»™¤âé?ÌIoèê?’ד1r3ê? ªóµ§Cê?ö–•§Cê?(šÐÐq3ê?˰äFê?àMŒ/£âé?ŒªZóG¢é?B\à Ré?õ‰fÆ@òè?©¬òõ‚è?%ó=»¸è?Ê|Á\zwç?åsõnùÛæ?¹¾Þ¿#2æ?8eÅ|Þzå?¯ëä3¶ä?ÝerÎäã?(~›»ôã?Œµâm²â?mÕ>ì(á?äË•yì)à?¼¬?”*AÞ?„?|™Ü?W´zååÙ?2™*I  ×?c xÒÆJÕ?i"í>éÒ?s¬){Ð?œ–ê?ݱùÃ:>ê?p)aÌ .ê?Ƚó· ê?x@HOÝé?¯»w‹÷œé?tØÂaÏLé?f5nRíè?ã¬nYï}è?“8¹ÿç?^"K7­rç?Ô•¾4׿?£oâ›-æ?,ú—`vå?­;fÈܱä?˜´}h¢àã?‡m%ã?ßT‡ââ?f¥]t%á?½’‚&à?´Áá;Þ?–äCœ Ü?Š6O·àÙ?ámýüš×?˜áYjŽFÕ?€¯È&åÒ?|b°+ñwÐ?ŽVÔÞuÌ?·%ì¶sÇ?¦ÿ„’óÁ?Áøš´¹?Ìjš£µå®??êÛó¹›”?׳¨ž”¿üéîýßæ®¿èZøŒ-µ¹¿–É`ÚóÁ¿ …a¹Ç¿®¯e˸Ì¿pöOýxп ·R³DåÒ¿˜•0ªFÕ¿ù@Žh›×¿trÎàÙ¿h²Yß´Ü¿žÐÍv%;Þ¿N듉&à¿ùo9z%ῲ–Jœçâ¿|5 @ã¿',¼¥àã¿QJTŽß±ä¿tý£cvå¿âÔï%ž-æ¿éÖ6׿¿´žNÔ®rç¿/nL¹ÿç¿l?Šªì}è¿ßA@í íè¿Hªð•½Lé¿j qÐØœé¿PžÝ"Ýé¿ÖÐÈ ê¿±“ÆÕ-ê¿æd >ê¿ÙÈ¿%0Õ?N\Ãò ‚×?m,áFpÅÙ? ¬ÌüóøÛ?O1Þ?í¡œqà?8$¦i\á?[ëèøÁâ?¢B–åïâ?£Gû Ëã?“1¿bœä?>ûÖ²_å?˜K">0æ?öCm-¿æ?»éYç?*©á[æç?+zÙdè?Ê-¯4ºÒè?E-M2é? o fåé?P1í‰úÁé?„Nd—-òé?ˆÈ_ê?Hq@õ}"ê?ÔÚàÒ}"ê? /za_ê?Reë,òé?|¸ñ˜ùÁé?RÂÞ/äé?ê•Ñ2é?t]s¸Òè?I(·Ñ dè?ÎPÓ“Yæç?kÖi…æYç?ÊcQ¿æ?.[I-æ?Rö­±®_å?„1É­ÿ›ä?“ýœËã?ɵ™ïâ?ÌËf½â?¥Wá?Ô€ulà?h 'l&Þ?Ƭ¸„èøÛ?¾žD;dÅÙ?1*…U‚×?y *“0Õ?‹Å!%ÑÒ?ª¤`(fÐ?"§ˆ+ÉãË?6‘Pü0éÆ?!Ö0ˆ…àÁ?¯KÈ;‹™¹?'¾P¼Ä®?3†Aï_†”?ê·Ò툔¿BSGïÆ®¿$D-5+š¹¿æ„6ÁÓàÁ¿¯¹ÓÕ|éÆ¿¾–xäË¿nCȲfпÝýþ¥EÑÒ¿æ„X²60Õ¿Xõ9΂׿•H Ø|ÅÙ¿P!!þøÛ¿R(ù8Þ¿ñ¼:tà¿ ä{æ]á¿ ¿E{Ââ¿u·ˆ¦ïâ¿M»cF Ëã¿ÑM”œä¿hÖ±_å¿ÛZt0æ¿ÊÑi¿æ¿ΰaëY翬š^æç¿¶g3d迱5€Z¶Ò迟c„·2é¿–›¶ÄÁé¿ØM.¾Áé¿aYxáñé¿„wŽØê¿  4Ã?"ê¿Wv'{æÕ?`ËcU×?µ– |”Ù?:ˆš¿ÎÃÛ?\ÆqÒâÝ?<÷hìÅíß?Ûð‡ìòà?‡AK ‚äá?YxÆXËâ?bÑ"_¦ã? KÂÖÜtä?hȱõ7å?õ,)8;ìå?ÅK•Ú“æ?‰%¨ -ç?ŽÛkbô¸ç?Cîº5è?ßÕ¥¾‘£è?;¿7é?tg'×ß}äá?Û4xçòà?@Å&-»íß?¡orõáÝ?œA¾ÂÃÛ?ÕÉ`ko”Ù?âXƒ‡VU×?¹7m˜ØÕ?o¸dc­Ò?) _6hGÐ?´ûëÈ®Ë?”A¹ª½Æ?èJ¶i‰¾Á?õÙ`vèh¹?2K+¾.Š®?Ù64[_”?÷òÄ‘"b”¿„óÉù‹®¿.¥›–i¹¿j—¨›Þ¾Á¿Z³¿_ý½Æ¿®¥Ñy¯Ë¿ê¬òGп@«Jˆ­Ò¿Õ«ŽRùÕ¿ïBCtU׿ê(䉔ٿ¢n¯ÂÙÃÛ¿¶*ëâÝ¿@Û#Ëíß¿O•7Ëíòà¿ï1º‚äá¿UÌ.’Ëâ¿,“ˆ¦ã¿Å°kžÛtä¿åÄtj7å¿:ù<ì忪ÎÝ±Ý“æ¿ Ó“-ç¿,½“ý¸ç¿ÐMÅ5迨w¢©š£è¿Âp9€3é¿òsÊMQé¿r»j‘·é¿É÷ÚãqÀé¿C®feàé¿aÿÍ×~ðé¿dHg[>ÎÔ?b4¸"k×?Kªê8[NÙ?ž;\°wÛ?îx=,Ý?änö<–ß?Ñ©IuÄà?í²[ãt³á?öÿ[¼‰—â?ÞöôO'pã? ­(âÇ<ä?„°õaíüä?ž®.!°å?†59áôUæ?v­¯îæ?9í(ëwç? D êZóç?Ž˜jT`è?´øÏN§½è?L¤]* é?š±ôƒôJé?\à–Hzé?íéË*æ™é?TßTŹ©é?Zžú ¹©é?"J²½å™é?"zæàGzé?Íðã„óJé?Òdéá é?H야¥½è?Xˆòw`è?Ô\ÃXóç?«;\µèwç?œùÕYÿíæ?[ÙkÕñUæ?ÒŒ Õ°å?2m޹éüä?ZøéÃ<ä?2‚ê#pã?Ã[!…—â?A°Cõo³á?"Ù¼pÄà?¬kÏÆ1–ß?„ü8PÝ?‚|ΣwÛ?!µeþMNÙ?õ_]7]×?}Õ ¿/ÎÔ?¦ÒL¡-zÒ? ÷ÆÐ?‰-8àbË?ÅåÎOÆ?ívàÁ?ÄKµ8#¹?zÈB#c6®?wLÞ@c'”?A#}ÿh*”¿¤[äyã7®¿ÀûCOö#¹¿õ°ªÚ<ŽÁ¿¨C¸ò©Æ¿ù~íÀ6cË¿ÓÕAïпÖDTzÒ¿†eSÎԿѺz}׿飄jNÙ¿rÇ›¼wÛ¿l¨ªÝ¿Ø`gøA–ß¿Ãã·#vÄà¿` æKt³á¿ìU¿ˆ—â¿,^ý$pã¿ØåœÅ<ä¿È ìüä¿jÃ,î!°å¿Âød+ùUæ¿“N€± îæ¿ $öûwç¿À©5tóç¿íúI%`è¿0pÂ'½è¿S ø é¿+ãÃosJé¿«ôï —yé¿§ÊS0™é¿´Ï|y-©é¿Ìò(’ƒÔ?eºXÜ‘ÂÖ?)’ŽˆóØ?÷Ñ• Û?XêÔú%Ý?ÊŽó#ß$ß?¨ÞL‰Gˆà?o1 Yísá?Ž„ ¥ÏTâ?yÂDÄc*ã?À^ö%ôã?ùuŽÓ™±ä?(Jbå?›—‚Ëæ?@¶Œ¶›æ?¼VW¡°#ç?ÄQËdeç?:¢¦Ê‰è?g Õ»Ûdè?Ti1K"²è?!ŸêÍ-ðè?J÷àØé?¼ >é?V¡éžMé?­“XÄžMé?ö$®>é?ƒ6G×é?5r;È,ðè?d#ú ²è?\!óÚdè?Hèsá?@ Bˆà?¸Ñ­†Ó$ß?<àž¾í%Ý?D3A÷ Û?Ø#MzóØ?G•=IƒÂÖ?,%Ò‚ƒÔ?Z§à—Û7Ò?Ða íïÁÏ?9¶’Ë?<'4Ž.Æ?þyžÛNÁ?¯‹Þ«øÈ¸?@5ìnâÉ­?œVLéÞ“?XBW92â“¿b˜“z„Ë­¿È¥äÇɸ¿ç{Ñ@OÁ¿þçÅœð.Æ¿¯`¬xñË¿îïè¿à3Dbº鿈AÈÝ<鿨³ “Lé¿ÒÀÒM(Ô?F^XbO]Ö?ax.û…„Ø?éÒ'¬œÚ?v´ÒK¤Ü?2¬ÖðOšÞ?ÂÜ"4º>à?·çÄ¡G&á?`úqAâ?Ó[•]Õâ?q"õ_›ã?þúôˆUä?þÊ«Œ'å?¹…©Ð£å?†¨#5!7æ?ÁÇU¾¼æ?ôxf£U4ç?(Q.]ç?pa—”Tøç?l‘WCDè?aE,Ñ:è?§h¯è?ë>Ô¶Íè?xlÓ1 Ýè?ϧ© Ýè?ß²a¶Íè?†ì¨¯è?´9Å9è? L]þADè?}œíRøç?þÆg›ç?fÕÍ^S4ç?¦»Á»¼æ?nJXO7æ?¦hvqÍ£å?£œ$å?Ÿc…Uä?^Kÿ½[›ã? W4ÎÕâ?þµ„ˆ<â? —B\B&á?²Œ|´>à?öAÜèCšÞ?\¿z?¤Ü?´•œÚ?`u•w„Ø?³)@]Ö?®…ÓÁ=(Ô?8@¶ÖÌæÑ?®Ìy £4Ï?r•üƒmˆÊ?ÄŽçÐÚËÅ?Æv–ÑÖÁ?aáJ«Z¸?>æËGE­?ïª ÈW†“?cÏ@…鉓¿ÜTP3G­¿œ+õ‹[¸¿M„U)EÁ¿.YFÌſϥ§KՈʿgÆÿ5Ï¿U&NûæÑ¿°j‘h(Կ즛¨f]Ö¿Œà"™„Ø¿‰Â•%¬œÚ¿:5 4U¤Ü¿À§ËTšÞ¿E-öŸ¹>à¿Á™9žD&á¿°¨7\<â¿¡ÈÕâ¿.-v¶X›ã¿ØÀ^:‚Uä¿Ã¼#忹XÊÅУ忱¤xÂ)7æ¿Z¤Õ¼æ¿ 7D‡4翸p^-žç¿âõ¬õ"ù翚„RíFè¿jøÅMÏ~è¿PO:f­è¿;ßyÂüË迤Å+PÚ迨‚ðä¼Ó?MÚPè#æÕ?¤yQháØ? 4‘ÐÚ?Ø'W¤­ Ü?J OÍ>÷Ý?ª'¢áTÐß?&ÀæÊà?µkF£á?’¥Æpâ?­=¿Kæ2ã?¤SZ/éã?ùvÓ0“ä?³ÁJÞ0å?õò uÁÀå?S÷w¡–Cæ?~È&³°¸æ?c$ÅqÇç?4I›xç?ÓžqõÂç?K¶g¨þç?2ÔÉOŽ+è?x5A„ŒIè?“R,Xè?e6VXè?†Œ;ŒIè?݉Œ+è?]‚˜ü¦þç?´IôÂç?ìšÅ˜™xç?ÅÿpÅç?4ß*a®¸æ?€G@ý“Cæ?]l}¾Àå? Ëî‘~0å?2à0-“ä?=Ø_+éã?¾j‡÷á2ã?âÒªcÁpâ?g]A£á?tØl àÊà?†/ ?IÐß?¢1_2÷Ý?ì˜Åd  Ü?gîyÂÚ?%uÔrÒØ?Ê¥ñ æÕ?,”*Ô¼Ó?RÑýg‡Ñ?BõyXŽÎ?9iX–ûÉ?|r‚³²WÅ?93§À?¥Ú cÜØ·?’9'ì:©¬?û»Ç “?ìžOÿ!“¿. ûJ(«¬¿Niû¼ÐÙ·¿5™Èh«§À¿±“L(XÅ¿ÇCÛuzûÉ¿äA‹hŎοµ™ŸF›‡Ñ¿ˆK'y½Ó¿”]:ˆ>æÕ¿G@÷Ø¿åG ÖàÚ¿ìêµ· Ü¿¢Ä$JB÷Ý¿(:·QÐß¿>óJIáÊ࿜âHÊ>£á¿%G#¼pâ¿ëª×Ú2ã¿Î£ÿ#éã¿+«,#&“ä¿ÿŽü—z0å¿ý±;ÁÀå¿\Jˆ¢Cæ¿ð©áÒ¸æ¿4}Õè ç¿ëo‡C@yç¿CÝaRnÄç¿ ëÛTû翞ä(9)è¿ÞoÃGè¿îOÜkU迦ÞTÃÒAÓ?—V/)˜]Õ?ƒKM0l×?‚pkVlÙ?Gí§Î\Û?Èw¹Òf<Ý?Š"ù#÷ ß?ŒgYy1bà?N ²L5á?õŠ Ëýá?ƒ±Ú0»â?„™vU mã?µ|Ëæä?Ç ñb¬ä?SÏ9å?IϹ‡Ä¸å?æ s+æ?Öø¥j˜æ?ê˜éfBææ?LÙõÌ.ç?ŠÖËW iç?œ‚£Ù”ç?ÚñÒÓ²ç?"±ÜÂÀç?QOÒ´ÂÀç?|…\²ç?8oÜØ”ç?‹ë•@ iç?ȶ&Ë.ç?­@ææ?´:b_–æ?:ó°+æ?&”%ÕÁ¸å?º°9å?•òV’_¬ä?Zb–ãä?h‹îBmã?Wjk,»â?<£;Æýá?Õ…‚G5á?ûÍä+bà?y¦+ë ß?ŽzfZ<Ý?þDüÀ\Û?p5ŠÚGlÙ?ø¸µÎ l×?\Ëö³‡]Õ? ™NÁAÓ?Ö%¹Ñ?"ßÿ ÏÏÍ?Žyÿ+YÉ?Æ)+›ÒÄ?·èY{X?À?6Ѱõ D·?Úžånö«?Çï)º¹¦’?;Í|æêª’¿öÆ©…ø«¿QÚ›f*E·¿+îÏ—Û?À¿­ÙÓÄ¿4ã¸ZƒYɿԃkaGÐÍ¿†ÆhSÑ¿…É}õõAÓ¿1ª&·]Õ¿ã\õŸIl׿¨filÙ¿³5ËÙ\Û¿ \&Êi<Ý¿Àwï¯ñ ß¿*bà¿í:»úA5á¿È†hò¼ýá¿*‚T »â¿ž³;Ëölã¿T¿ƒ´Óä¿EáP¬ä¿ž^µ9å¿ô1%»¸å¿ï-å-+æ¿0 NŸæ¿á¼Ë–Bææ¿Âãíõq.ç¿ZµbúÔgç¿y­PA?“ç¿8`쉰翚ƒF¨¿ç¿¾F š·Ò?15=ÄÔ?ëÓ²ÄÖ?IGÇ×ÛµØ? ¸–¥h˜Ú?BŽjÜ?€²í-+Þ?B½Ý<2Ùß?OÑmɹà?óA!h¨|á?‹¼„Ͼ4â?ÏÖNËšáâ?önð¿Ñ‚ã?»X@ä?UBKÊ ä?ìâóƒÛå?žÊEfç‹å?ó‰Óu©íå?òQ6håAæ?ô(6Jgˆæ?ðUÑŸÁæ?W˜—ëæ?h©ˆ¥ç?X%—ˆEç?À)`Eç?Ùv*,ç?èV…´–ëæ?Jš¶ƒÁæ?uKýÛeˆæ?GX'§ãAæ?º a§íå?¢á±üä‹å?]êSÄØå?Ï"4Ç ä?hÐüä?ú& ôÍ‚ã?Q×¢–áâ?˜¥†Gº4â?v÷}£|á?¥&Îùà?à.Í&Ùß?¤Ú7¦!+Þ?ÔÊéYjÜ?¦!½•Z˜Ú?‹v´Õ̵Ø?‚ëc³ÄÖ?½)z.,ÄÔ?mçdÒ? f¿„XŸÐ?Ö"–7ÑùÌ?¬Vi£È?Å#S¥!=Ä?®n¥j•¿?uJ¶?&YС-«?ݘӣ ’?섘*%’¿%’) ä/«¿$è6ž¶¿âeÞˆ–¿¿ž³Âx®=Ä¿ÄaBœ£È¿ÞÙÚVúÌ¿ì R˜ŸÐ¿Ö/ ÷ҿîRtaÄÔ¿@™w›/ÄÖ¿MºCßñµØ¿jO(yu˜Ú¿Âìº2‘jÜ¿­ &+Þ¿èeÈÙß¿WÄÔº¹à¿C¹Êx•|á¿úïȧ4â¿?È [€áâ¿z§ô®´‚ã¿Æi.]áä¿Áý¡8ª ä¿ ó1ºå¿n—…¬Â‹å¿Àþ’¡yíå¿uI•Aæ¿åخƇ濵.v9XÀæ¿ŸÖ ¦êæ¿*XDÕç¿P®­ç¿ ¥ØÄÒ?cÁ&=¬Ô?rÙZ‡- Ö? åËì×?eØ¡Í?¿Ù?6-`w‡‚Û?.5’Ê×4Ý?Êèqì$ÕÞ?G+ 71à?¾@f-ßíà?¼W˜w á?‘uYoGâ?zS“žãâ?Š„îsã?’S°%[øã?Ý¥Twpä?èž…~øÛä?£Vœ:å?xÊM}(Œå?ÓÖ ©jÐå?² fÀ8æ?êsuöp0æ?\9ßùKæ?´ˆFÂYæ?¬em‰tpä?V¢9Xøã?`È……êsã?<*÷Á}ãâ?`ËQÈjGâ?®{ˆÙ á? `*Úíà?‘Ç£11à?`Ó>ÕÞ?"[H<Ë4Ý?Šc z‚Û?ãœ)c1¿Ù?5üµì×?X»Ê Ö?€ž!±šÔ?k@†$²Ò?Ë ªœÐ?àºTÄ4 Ì?žæãÙÇ?ôˆá|Û—Ã?z(›]|“¾?‰HÅeäµ?HLj~œOª?¥ü©ÕdŒ‘?0É|„C‘‘¿{”¡ Rª¿ ž—øœåµ¿ÈK–²”¾¿o¥Á†u˜Ã¿¸¯¤{ÚÇ¿–ŠË,É Ì¿\fyüãп…šmõÒ¿H†‘x×Ô¿l›r“Q Ö¿€ CÏ1ì׿¦=„?O¿Ù¿ PWŠ‚Û¿5©oÍ4Ý¿PÚH ÕÞ¿îÝEÍ$1࿸°¾×Æíà¿OÊ€øŸá¿BµøåKG⿦‹ ÅYãâ¿ø]¬Ásã¿8+Y*øã¿õB@pä¿YиÛ俊é’úJ:å¿JÈž@¸‹å¿YÕ#ÇÏå¿'™Éæ¿—`EÞ/æ¿òE€.mKæ¿´üˆTdYæ¿h ^äwÑ?ÀþW†aÓ?œsDf4?Õ?Œæ.ïÇ×?#Wöm"ÒØ?³àb#.…Ú?[<ÁÞ'Ü?Û2¹Ý?²¼¯Š08ß?E¥éÿöQà?‹P Åýà?ç‘wŸá?v±ñÀ5â?$|TÈÀâ?öfö±q@ã?ÃÀ;´ã?fÿußÞä? «€%wä?zÆ™M¸Åä?g¤ÞÛ…å?Ð ;[<å?м{Õdå?RP)£~å?Ò‚}×ì‹å?ØFí­ì‹å?} ˆ¬¢~å?Ãè8då?›aÙZ<å?OPc„å? sw¶Åä?[J÷wä?Ø\KcÜä?ß2Õê8´ã?Rön@ã?„£‘ÄÀâ?ݺ[Õ‰5â?pÉ–*Ÿá?ÅÐ[Àýà?ÊNçñQà?·‚ƒ%8ß?:#Õ)&¹Ý?!‹ßôÑ'Ü?f …Ú?2§´ÒØ?&› ,¸×?ò㔋#?Õ?’ÀUtaÓ?]H"ÑwÑ?9ÇÏÏÏ?né#„Ú Ë?shŸe7þÆ?¦ÀiÁeãÂ?êtâGÛy½?Öq“¼µ?ëX02]©?ck§WŠê?¡œÞXÁï¿NØ(ÅÎ_©¿§^¬Ç µ¿ ®Çi+{½¿à£cý ä¿° 8 ßþÆ¿…‹€ Ë¿@ÑqÏ¿H¯ZÎxÑ¿@¶ºaÓ¿tÌiÁ`?Õ¿Èß”+é׿µT‡Ñ5ÒØ¿YŠÚ1…Ú¿ˆ4ýÑ'Ü¿HuӹݿvÅ¿\8ß¿ÙC5ÑØQà¿ÇJE­Ÿýà¿çĨ>ìžá¿m¦ÑâZ5â¿GŒµ‹ŽÀ⿳@ƒâ0@ã¿Õ‰Vò³ã¿‰ÎˆŠä¿¶%ýB¶vä¿ûBºZ<Åä¿ktÔëå¿£ï… <å¿.+㬹cå¿"mSK~å¿R vÔ°‹å¿}ïµ±ÃÐ?\ABt™Ò?ín2JßcÔ?Ãü·!Ö?ýƒŸèÑ×?'°iisÙ?ÈoÎò7Û?ù^l\†Ü?pâNéõÝ?¦ß^ìûRß?PÅ~^Nà?~vÌ0éà?|̯”yá?zt$Ñ1ÿá?& rŒµyâ?°Š±RÔèâ?4™Ö›ILã?Ñ騣ã?…Z›²Iïã?ÿ7ùo.ä?U ò#aä?Í}XF‡ä?_#C§¿ ä?ƒ2e(€­ä?Heþ­ä?wœ+)¿ ä?G݆E‡ä?O5ÒÊ"aä?Ø“D|n.ä?e&oßGïã? ûsæÕ£ã?6¥€GLã?"¼uÑèâ?ÀÕÖR²yâ?º‘y9.ÿá?ô¼·yá?2,±4,éà?Tlê¼YNà?¤i(—ñRß?†©ÞõÝ?òþZYP†Ü?uËò*Û?D £q[sÙ?ò‡ô¢ÙÑ×?k²Í§!Ö?PÇfÎcÔ?Þ ·Ûa™Ò?±ÀØ}ÃÐ?&J§‚ÆÍ?ìèó­óÉ?®óâׯ?ôŸô÷d Â?ñvê1ˆI¼? ÷*yÓ@´?Í•†@@W¨?ínã¨;?ƒKŸ6A¿lÂŽ‡ Z¨¿/kxª:B´¿7m ÔòJ¼¿¦»p)!¿; ’IÆ¿nú¸gôÉ¿V!uï9ÇÍ¿aÞ½ÕÃп–sÁ³´™Ò¿ñÎ/dÔ¿œ,g“á!Ö¿8_XÈÒ׿. UÆnsÙ¿¶€ßÃ(Û¿]I¡9†Ü¿Ö‰³²õÝ¿ ÷x³Rß¿~:‚]1Nà¿æ¾gûèà¿6=^ÜVyá¿ÄræŒëþá¿4%^fyâ¿$ŠQ{èâ¿nŸäVåKã¿–³X˜f£ã¿!eº Éîã¿·¢§ˆß-ä¿ÇÑ6¦è`ä¿2ng‡ä¿¥´$‡ ä¿yýwZ­ä¿{ÎhÐ?[ô£&ÃÑ?ÑWCïxÓ?%ÑѶ"Õ?U0ìs¿Ö?Ï %E*NØ?:7ãÍÙ?ýt€²=Û?jpÈ´œÜ?ë2±·êÝ?4,_ú$ß?Ôò®kW&à?ŠGðà;°à?°-`„Õ/á?Ú"¤Õ¤á?æIôâ?Ê—jlïmâ?‘|“Áâ?* ql™ ã?*í¶èEã?'ÉÉÛSvã?=°Þ¾šã?±N|©³ã?5ô&;@¿ã?Ñ"Ï@¿ã?â4\*³ã? †} ¾šã?òZ²Rvã?ÊĶ–æEã?m5M•— ã?fJ/ߊÁâ?°'oãìmâ?ø„e3ñâ?2MãbÒ¤á?œjäÑ/á?@ý ß7°à?ÀÛtS&à?×…—Ãð$ß??6&FêÝ?z3 ɨœÜ?èÂnã¥=Û?ñFÖÍÙ?i9ãNØ?5õºd¿Ö?Üö”Æ¥"Õ?)"‘ÌÝxÓ?CÖbaÃÑ?^9-TÐ?ÊAPÒkoÌ?+¼Ù¤ÈÈ?yðN”Å?¼ÈŸÕ„OÁ?gŽ[#»?-VyjW³?]wâí>§?nµîi·?Ô:‡Ns ¿©ÝþR¡A§¿i‘ÈÃèX³¿Ç‚ø»¿š¬‹RKPÁ¿_Õ'_Å¿”¹*ÚsÉÈ¿<%=pÌ¿Æ/I¼пe_e­vÃÑ¿9t< 7yÓ¿¼Cðí"Õ¿°LÅL•¿Ö¿9Œ¬2NØ¿\ó:ÑÍÙ¿üÀH½‡=Û¿c²ösœÜ¿ç‚ü}ºéÝ¿ß8¯$ß¿»{&à¿ÂÂù<ó¯à¿!?ƒ/á¿Ûn´ÿx¤á¿NÒ·ïŒâ¿U”n•}mâ¿< øÁ⿟™ï´ 㿆ö‚^Eã¿Öe­,#vã¿»óÓ•‘šã¿Ã¯9™î²ã¿N ùŸ*¿ã¿®iŽ"jÎ?•ÛóSßÐ?5ëU#-Ò?‘_NêžÔ?zÖì®›Õ?HúÐ^k×?–,¬ê‚Ø?V ìLàÙ?“‘Êû·-Û?×ã`jÜ?sަsƒ•Ý?P1g®Þ?hkß^´ß?`½MwdSà?²ÿ°î‡Âà?jïJU'á?vPaŽá?Ü}0ŒûÐá?P÷GÐkâ?œ)é÷´Nâ?ÐU„®³|â?ò[%–KŸâ?È"òXg¶â?çÑR¶øÁâ?5¿»‹øÁâ?õ¢Ùf¶â?Z³ÀJŸâ?4ÿ‚²|â?2…œu³Nâ?ÛHöiâ?ÉþZYùÐá?&{øÓ‹á?ü bR'á?~e¨„Âà?¾³ÇÐ`Sà?,ŒÍV´ß?-šT^®Þ?ÔÑ;Æy•Ý?š=R]VjÜ?¿B•¬-Û? §*¸?àÙ?]JgfÝ‚Ø?Ì…¼]×?¿}g–Ÿ›Õ?ß,otŽÔ?„´‡{Ò?£à@ßÐ?½r|ùiÎ?œS3›°Ë?íŠÚ¾ŠÇ?3 ËGÄ?@\aôwqÀ?q;穹?,á©LI_²?ŸnÑk¦?‚ãOшr?èREìÓ~¿C’…„¦¿ª2&ªÜ`²¿[zR¤ª¹¿qeZMrÀ¿!¨ùY%Ä¿Bhy¥‹Ç¿q]éåŸË¿´9¼bîjο]Qh¹ßпĦº ŒÒ¿)¸êÔ¿gÀ̦ۛտcw³£u׿H `†Ô‚ؿ̱¶òàÙ¿'Ék-ۿаY<üiÜ¿ýDvj•Ý¿’y·[Ö­Þ¿Å%A¸³ß¿ =eSà¿l0Âà¿p(à&á¿[bˆá¿Ä¬K9sÐá¿‚-ÝÁßâ¿Ä,ó‘,Nâ¿./Üψ|â¿Á“,Ÿâ¿¸ÃÆGS¶â¿5ªŸ…ðÁ⿦ Äj¸Ì?Œ#rÝÏ?8Šè#iwÑ?s˜SõÒ?IûáŒgÔ?ý„jž0ÍÕ?š$Ab%×?¡ƒMoØ?ŽPí&ªÙ?wxÃP,ÕÚ?f`”C¥ïÛ?I ãøÜ?5'Ú CðÝ?ò¼eå,ÕÞ?Ö‚u0§ß?XÔ{¹2à?pÐò‹ë‡à?ÜJVìÒà?ç:þpŒá?œÎj´¤Iá?õ؇uá?3tÕ!¾•á?ÙÁ\«á?÷AÃ|¶á?´„˜|¶á?¡qÜ«á?Èœ£K½•á?T„D[uá?좼0£Iá?ØG•Šá?SroåéÒà?Ðivüè‡à? Ķ2à?n¸œ §ß?b‘í%ÕÞ?a”†;ðÝ?|M=ªÚøÜ?Ò–Š‹›ïÛ?ž¿!ÕÚ?¦yyªÙ?Rú#AoØ?³â£êT%×?äoŽD"ÍÕ?ºÁSv}gÔ?\hCõÒ?gh`WwÑ?h•ÃâKÝÏ?‹‡ÚA¸Ì?Ä™èÉ?e¸o;Æ?µjû¦ÒæÂ?êOvï ¿?Ó‹;¸?nÊ+?Y±?jâóqÙ¤?g¡•)΋?XÚúÔÚ‹¿éÏ$ªÜ¤¿ð’–äZ±¿¢Ãñ:Ã<¸¿Tl§²´¿¿àÎ9éÁç¿â„©<Æ¿¢êfx‘‚É¿ý¢Nøc¹Ì¿´’ÅyÞÏ¿ÍrÑêwÑ¿_gR¿õÒ¿ ’{VÈgÔ¿ÑàB\;ÍÕ¿ÂÁWwD%׿gÑ¢oØ¿,áà˩ٿS™í·ÔÚ¿×à7ôïÛ¿^[ÀÃ?øÜ¿ž#ʈïݿ֩øÊXÔÞ¿ˆ¡V•$¦ß¿-n?;52à¿ún"v[‡à¿ºlVÌRÒà¿(h¯§ñá¿Á…Ó×IῈndítá¿=ÑØ¿AO(8+Ù¿0áA4Ú¿€ž‡Ò,Û¿´sµBÇÜ¿X­DwhëÜ¿/Ú·1°Ý¿u™Ã†§bÞ¿](m‡^߿˅øŽß¿ì¿ Öà¿ÿ}‘né6à¿>çÝ(.`à¿{LÕ7÷~à¿%ÀëËy“࿤Ù#ݺà¿ýšÇØuÉ?ZO¶ÔË?´Ï¨m~‚Î?\í]ÎŽÐ?ˆ³0M'ÒÑ?¿³v™‚ Ó?ȧܞ7Ô?Þ±“÷DWÕ?U-6î@jÖ?À˜_ëio×?kCÞfØ?«ÓÿŸÇMÙ?•ŽvQÕ%Ú? †e³ÂíÚ?ÊK•x¥Û?RJã‘YKÜ?ü?ûs+àÜ?m§”V.cÝ?Z mÔÝ?VT<2Þ?mhdm~Þ?ž|!Ž|·Þ?4E]šÝÞ?¾§‰ü®ðÞ?Óþ§®ðÞ?Õ˜ª\™ÝÞ?ªVÉáz·Þ?©øJ¸j~Þ?ÔóŒ2Þ?î·µ ÔÝ?©âì)cÝ?îŽ%U&àÜ?Û¢ºSKÜ?Ìå ¥Û?TfN_»íÚ?ÚŠ¿7Í%Ú?“rôº¾MÙ?Wmi'fØ?›Ÿ_[_o×?6»|5jÖ?n '›8WÕ?ÁÔ·L7Ô?”çIEt Ó? XÜèÒÑ?ôW)Ù½ŽÐ?XÒ…ýZ‚Î?£IöiÔË?K²ÃMÉ?äºEo¸FÆ?ùÖ"YfjÃ?Zb‚À?ÃÁ®ý>»?°ÓHÊ)µ?ðï÷¶›M®?¹… ºg5¢?‰ß,)ÑGˆ?FO´ Uˆ¿›„Þ·Á8¢¿hÛ· Q®¿+qàX+µ¿fZµ›%!»¿(æsr!ƒÀ¿¹ k’‰kÿ}IÛHÆ¿¾™ÁçÒÉ¿1&*•AÖË¿Tþ1›„οè9d÷пѺmÒÑ¿254f Ó¿ñŸ±}Ö6Ô¿–›wZÞVÕ¿´¡ +ÁiÖ¿Ip*Òn׿1©ª oeØ¿t$~9ÿLÙ¿ý½"äò$Ú¿\GtúÃìÚ¿áÓÚêõ£Û¿ÑÆ‘ÙJÜ¿RÖîݺÞÜ¿ôñc‡aÝ¿`ä1ÒÝ¿Fœ rµ0Þ¿ðA`O–~Þ¿©‡}¡ô·Þ¿¬o<úÝÞ¿*òX\öðÞ¿å´žG'Ç?͈¡R°É?Ae˜§6)Ì?’Ž·ÍùÎ?Ea.ñrÐ?Ìt A“Ñ?hU¿È¹¨Ò?Úåp†°²Ó?½|C°Ô?  °v¡Õ?GòpuF…Ö?ó}`Ï[×?¥…"Ø?þ“ùÛØ?{!üC„Ù? US¼Ú?äa)X§Ú?ŽÅS Û?!ré¯8ˆÛ?îwo+pßÛ?è,jûv%Ü?E’ï!ZÜ?ôBŒP}Ü?ñÓ}íŽÜ?8±TÉìŽÜ?XÔ“ŒO}Ü?ÚÇÅD ZÜ?¤t%Ü?‚ü&mßÛ?Èü4ˆÛ? ¢¨í Û?RS>§Ú?Šìç¶Ú?î bo=„Ù?”¨¬ÛØ?ôÌ)”}"Ø?.‚ô[×?ËüCÊ<…Ö?¼Mô„¡Õ?`ƒyáu°Ô?[¬è;¤²Ó??P^‹¬¨Ò?ŒÀ¢Õ2“Ñ?Ù9ârÐ?‡qÙÎ?"YU…)Ì?¸)Ÿ«ï¯É?Û#àêó&Ç?9ŒTx°Ä?ù’U¾ëÁ?v9§|y¾?}™Õ!°¹?:иåqˆ³?•áolLø«?¯ç"eqΠ?00’Ñh†?±Hj- v†¿\É«ÊÑ ¿S–r†¼û«¿è+Zˆ<г¿â›¶ª– ¹¿l{¹Œ{¾¿;’[AäìÁ¿¦R”c‘Ä¿kåˆç‘(ǿʉw™²É¿¹R¯Ë4,Ì¿$  M–οã›/³rпɦ‹cÏ’Ñ¿Q~á$E¨Ò¿³WaŒ.²Ó¿E‚7‘ì¯Ô¿/2I{å Õ¿üw¬«…„Ö¿ºüøÜ@Z׿VÊ’!Ø¿ßIÿ‚ÿÙØ¿l~ºrƒÙ¿ÞJëbÚ¿ h²sˆ¥Ú¿°D¾Û¿+Ñt©…Û¿–óx¦ÛÚÛ¿(íß(Ü¿ãCA[Ü¿ªnbå}Ü¿Ó5WÃGÜ¿‘b'Å?hs%vxÇ?¬‰{žñºÉ?'ZU¬ŽíË?вSòÎ?D®\æÐ?›ƒ9·k Ñ?ÀJ–ŸmÿÑ?Ö¨öUçÒ?õ¶•ÃÓ?t#[¥“Ô?dƒ0œWÕ?X1 ô8 Ö?8°ÔµÖ?â>ÔnP×?ÄØó¨Ü×?´bOÍ)ZØ?D¼¿¿¦ÈØ? Ýå¹Ú'Ù?|~›‹wÙ?%Ù(z†·Ù?D“¤¥çÙ?ÑvõÕÊÚ?È:âÚ?V æáÚ?»bÌ×ÉÚ?–NSü£çÙ?8áÕ&„·Ù?º ÔˆwÙ?ˆªÞ ×'Ù?Oè@a¢ÈØ?ó°»$ZØ?bß?¢Ü×?¾ƒRhP×?Ìp͵Ö?øãŸñ0 Ö?HâÅÑúVÕ?Þ’óo›“Ô?µ7ýH‹ÃÓ?s‚5­JçÒ?¶}EqaÿÑ?Å/`š^ Ñ?F6ØÐ?ðgÔÎ?¡¨*KníË?&½ÚóκÉ?¤Ž+ QxÇ?u¯uOY'Å?7ŽkUÉÂ?TÊ*»_À?øú78Ø»?ž  .yß¶?H J³Çر?¬¤K3&Ž©?æ‘G¼íµž?‚h€6,y„?Åp 8†„¿ÜÀ4ô†¼ž¿Ô‰‡‘©¿¡îÄ‘ˆÚ±¿¢°ü Rá¶¿3‚y Ú»¿{›ˆäÓ`À¿ãý–•Ê¿ҧ‘×(Å¿2wV9zÇ¿qRå½É¿S^Ó¹ØñË¿¨¡0Pt οÎ.nPŸ пsµ¶‰C Ñ¿#ê‘ó;þÑ¿adCæÒ¿*c’V3ÂÓ¿é./&’Ô¿„ØfUÕ¿ÁÊ5} Ö¿ÚÞÄý÷³Ö¿ï!ŽmN×¿Æ ={Ú׿ÉynmÃWØ¿˜gÙ¼çÅØ¿Äø«-{$Ù¿ôãâ7sÙ¿÷¨ÈÓ¾¹Ù¿\N &¨èÙ¿È×GQÚ¿(å»°2Ú¿¤_›Ž-Ã?Cþ£&f/Å?–­gé9Ç?Ša?Ïb5É?L„¦«!Ë?q§IÒ8ýÌ?¶Ïm åÆÎ?hÑË>Ð?5Œõ£Ñ?!È{FìÖÑ?(F±Q¹’Ò?“ÐôòCÓ?òƒ$h‰çÓ?Ü9°BºÔ?¤K'¦F Õ?‚؉Õ?ÀŒ2Ç!ûÕ?þN—Ü^Ö?'žpË´Ö?!‘S¹üÖ?°Ôƒãy6×?À¹‚éa×?ÛÛ>eí~×?Ñõ˜§s×?2ФSs×?à1iì~×?UtbÝça×?Eí*•w6×?ÝÚ@Z¶üÖ?i)™ÊÇ´Ö?WboBØ^Ö?çFéÀûÕ?ãÀfÇÒ‰Õ?¬H’3@ Õ?I³Ô?ú»uyçÓ?zú> CÓ?¬rÌÒ¯’Ò?eÐböáÖÑ?Hš {Ñ?ŸGbý¾>Ð?bŵ'ËÆÎ?–Þ ýÌ?ºÕ|á!Ë?A‡õB5É?ŒšÜk9Ç?Qw·ÅA/Å?!ͲÃ?pRê³õÀ?Ô–Ý5½?x‡Vï!¹? çSˆC¥´?ür&Û°?¨…Æ-§?7ó*¸›?®/J\z‚?¾Ò"¢‡‚¿û\©•¾›¿5.Ð'I§¿u а¿3¹©§´¿²ìãÓÉ#¹¿ÄòW‘½¿¤döÀ¿#6•9ÿÕy†‘’0ſӗIò»:Ç¿ÊY5Åâ5É¿ËåÒ-` Ë¿X.ÐXjû֢̿nïóÄοá*Fœ¿=пúT_üÑ¿f®Dç°ÕÑ¿.ÁxÉc‘Ò¿¬ªK²¡AÓ¿45EáýåÓ¿ .„‡~Ô¿•‹ Õ¿†#('ò‡Õ¿øQ¿½ùÕ¿ \M«\Ö¿²zŒ²Ö¿tNîãûÖ¿Kªø#N6׿ØÿÌN*b׿²êO)׿sF­Ÿ×¿;óg³úÀ?Ù'"Ó¢ÖÂ?=Uìèó¦Ä?ƒ^vMˆjÆ?yjçI È?d°(†)ÇÉ?dc“#^Ë?„$Ö¨<äÌ?v­ž0„XÎ?÷I’ºÏ?0¾¹ß „Ð?dÀÞÙ Ñ?¦Y޳Ñ?¾a½n:Ò?c4õ…¶Ò?´œ­'Ó?,æÊ|Ï‹Ó?%ÙA~äÓ?µKè0Ô?vµÞwÞpÔ?æîqU9¤Ô?²Í€7ÙÊÔ?çÁ˜K¦äÔ?qÚ§ñÔ?éÉTñÔ?'8R¥äÔ?ëB—×ÊÔ?ÇÔj 7¤Ô?œÐ†ÛpÔ?ß>¯ä0Ô?C+ùyäÓ?ç؄ʋÓ?þ{ˆ 'Ó?££¶•¶Ò?à¤g:Ò?‰ý!¸³Ñ?Ê¢,FÑ Ñ?O¡€„Ð?gÇ:ºÏ?4[ì1nXÎ?V©`õ$äÌ?» ^Ë?éùl8ÇÉ?6:èH, È?†ðrijÆ?Ée›Ò¦Ä?¿SRÖÂ?¤u.”úÀ?¸ÉöÄE(¾?&?9fÖHº?ân0Y¶?}’ê:Á[²?â™ÈNý¥¬?`’ã Ë‚¤?tžFक़?Æä’Tãm€?Èås#(z€¿¸þgG ¬˜¿þpÍê…¤¿õÉ,©¬¿ÍWdÖb]²¿lëáÞZ¶¿õhŸj“Jº¿Æ¸ *¾¿°=Ã_tûÀ¿?yLŽW׿Ådq§Ä¿ÛÛ×pjƿܛ؜¥È¿Ù,lìÅÉ¿¾É±’\Ë¿¨ÇT^pâÌ¿ü\ü’ƒVοԒVèá·Ï¿wg ؂п좲8ѿۄ„¸±Ñ¿^8£Öö8Ò¿Ùì÷´Ò¿x&@p%Ó¿°ÕÛŠÓ¿\ùìÇÈâÓ¿š¯S/Ô¿†ÿ€²oÔ¿,O‰ù¨£Ô¿l©*ªÊÔ¿ ñ"0œäÔ¿\h¹ËñÔ¿ ü·V¡½?HUʶñoÀ?{ÓÂ?32¤ÔÃ?Ù?¼¹ Å?}+Pñ ~Æ?ÄÀì%áÇ?U³©†5É?ŒË)<[zÊ?ŸENPÛ®Ë?ƒt¢HÒÌ?QÕ*wïãÍ?½ýd 'ãÎ?i‘òQÏÏ?‘ÔEïSÐ?ƒƒ£#¶Ð?Üd` Ñ?„®©j[Ñ?îWcžÑ?(Ê[æÕÑ?öe*µÒ?POßXi$Ò?jdLŠì:Ò?+VËs1FÒ?u´Í!1FÒ?Ú;&”ë:Ò?4¿¾g$Ò?[¬À³Ò?®Ï ¨ãÕÑ?0±ÓžÑ?Yå¥of[Ñ?hv šÑ?ì¾W ¶Ð?Õ'ýèSÐ?®\?õCÏÏ?BH\˜ãÎ?ü+Ö‰ÞãÍ?oa/6ÒÌ?K[!MÇ®Ë?dEzÊ?Ã¥bo5É?ÐXwð áÇ?¡Â¯1ð}Æ?àQ &ô Å?8Ã>[üŽÃ?óŸ`ôÂ?É5ÏoÀ?¸Ndi ¡½?õ‘ï5Pº?‹Lu#ï¶?—4vë³?ž"$¬°? e6ÿ¨?y ÷hå¡?„Á]•?¢£Ú‘ª|?’œÂ|¿§ A‡•¿"Šfl]è¡¿õLRU©¿“ëA+°¿nïŒ$l³¿Êª«¡ð¶¿Ô} ©Qº¿œ †Bc¢½¿=èÄYpÀ¿¨«t?¿Æì+܎ÿD;Yrš Å¿j-(­}Æ¿ÀØÚ¤áßÇ¿¼ô84É¿ ‘µxÊ¿C%¶ì¬Ë¿NaÔ,ÐÌ¿zæt“©áÍ¿"À)ºàοàÿJÃÁÌÏ¿€ü4˜Rп¯ÛªÁ´Ð¿4Yqv¤ Ñ¿x‰ôZÑ¿$ U‡áœÑ¿jBê²óÔÑ¿vÀú¤Ò¿EÙwD $Ò¿î% µ:Ò¿&\ FÒ¿3"-Ti7¹?ïÇ?ú»?üÿ"rÓ«¾?-Î4™>¥À?}4YOêÁ?8Ï~S$Ã?ÿA`‰RÄ?s,²›6tÅ?»¤ ЍˆÆ?Œ5–­4Ç?z,H9‡È?gÚsÚpÉ?¸g³LPIÊ?BÈ‘|MË? *'u˜ÊË?€éŠ¿qÌ?îâë®[Í?þä#”‹Í?¢ ŸüÍ?ŠñsüŠ[Î?ܼëϧÎ?ÅŠÍÅ,áÎ?Î *~Ï?lÑîu¬Ï?}ásÔ«Ï?Æ"EE|Ï?v“´œ)áÎ?i9q|˧Î?RüóD…[Î?Œ)®ÿ…üÍ?1B‹Í?pÃ: RÍ?XÍ/´qÌ?ýA_ŒÊË?zEíº?Ë?™AIÊ?À99 pÉ?pN®ü&‡È?BŠŸ !Ç?ëóûW“ˆÆ?ôßÏtÅ?½!’ïpRÄ?ö `]9$Ã?¶^qz3êÁ?:öÑï ¥À?h•n”«¾?Õ¤í<üù»?L2™“"7¹?:²è]»d¶?Îf„„³?]9ÊàB˜°?"¾¡0ŠC«?‰‚‘½E¥?0ã‹ì už?~÷;ªüL’?QÁG55dx?Ö¡æ˜zx¿2ø^û“R’¿ÈýK4{ž¿A³¼“‚H¥¿î×GGF«¿zû@x™™°¿²Y %Ì…³¿:ƒ€ée¶¿òZ¨$$8¹¿/ö=´ú»¿ˆ.·Ú«¾¿ÛV^õ¤À¿åÀìéÁ¿¿g>•#ÿÊ4-t~QÄ¿¤ù/ÄìrÅ¿„–¯)‡Æ¿Óøþ¼‡Ç¿Nc…È¿${¿"nÉ¿®U^ƒ6GʿɾtË¿*Ñ\QÈË¿ù¨¹¹ooÌ¿.õÍ¿²`×åˆÍ¿*\¬šœúÍ¿¸‡©òYοfùå±›¦Î¿U‚&Oàο¾C_ÜÏ¿yc›Ë.Ï¿ýT…h躴?Y6¤zþÿ¶?ÈŸ å6¹?8ÍA€>^»?nIœË¶t½?¦º¹Oy¿?OM²Pô´À?¸³§£Á?†OL\†Â?¼z3^Ã?Ìt6ë*Ä?~éÄ?Œª=ZœÅ?ÙùíÁWAÆ?Âa´WÙØÆ?öY «CbÇ?TijüAÝÇ?œ(¸pˆIÈ?2ä@Ô¦È?Ä6¬âëôÈ?’š.,Ÿ3É?ñqÇbÉ?ê˜G‚É?z2—@ ’É?†qó¡ ’É?$ØÀE‚É?°„ÊVÄbÉ?„ì(Ñš3É?\½/EæôÈ?‹é ^ͦÈ?Y-øD€IÈ?<³ƒ8ÝÇ?y„à8bÇ?×^ï5ÍØÆ?)KCJAÆ?ìHÔw œÅ?âã&»|éÄ?Œ\9,*Ä?ˆ‹Þ^Ã?¼W‘G†Â?¾ï`£Á?rNÙvÜ´À?ZîjbÑx¿?…’€t½?µµ‹é^»?”ÿx¨6¹?’âáõ½ÿ¶?PCV¤º´?Ñ%¬ŠÁh²?oÙƒ °?žÏßÁH«?ѻɦi¦?5¸¨»·|¡?òööÿ ™?ØÂ6=Ž?kÙ/× t?̶0Ô%!t¿,vÖaØ Ž¿þ(r‘@™¿²‡ó¶L¡¿)ÜÆ(l¦¿¾óP'K«¿&F#¡ °¿Û¤½_½i²¿ÿq»n»´¿£›A·¿`Ûø&Ê6¹¿ØGà ®]»¿ѽ„t½¿æÏÇw¿¿Âô8ß´À¿ A§¢Á¿†?o…¿È‘ÔÃ\ÿòHÈÖ„(Ä¿ +“_ÛçÄ¿Oòð”QšÅ¿>¥P)z?Æ¿zQ·ðÖÆ¿Œ çZ`Ç¿N¡ê¢dÛÇ¿®-ŽÇGÈ¿ÊÑö^A¥È¿`™Äì”óÈ¿ñÜ]ä‡2É¿JÍªÙæaÉ¿îË­ýŒÉ¿„çXÚg‘É¿€óšP'/°?ùL@Òô±?I¾`ùi¯³?aôu†Ý]µ? o#ÿ¶?Âm4[:’¸?÷êO²)º?b«T4Š»?­Ì^Þì¼?ûüãã=¾?[_È[B|¿?FÃ)ÏšSÀ?š¹À¥ßÀ?§ñÌ·`Á?ëg:vKÖÁ?Ñ×Íí“AÂ?lü!ô™¡Â?±uP"öÂ?Ç1àø>Ã?ø ·ð{Ã?r¥Ï:ä¬Ã?òÁe:µÑÃ?•0œMêÃ?.ˆbœöÃ?&(™Æ›öÃ?ÕWà-KêÃ?£x/²ÑÃ?Sx$ö߬Ã?Jï}6ë{Ã?%„ö ò>Ã?‚o9OöÂ?¤ü¬¡Â?Œ)K\‰AÂ?àÓd•?ÖÁ?05‚õ_Á?݉ôÞÀ?\+ÞŠSÀ?Þª|¿?VëU¾=¾?Ê,¶ì¼?M oÅÖ‰»?»]>ûº?Ð,—Õ’¸?òMZÌîþ¶?Ъ½¥]µ?^O/¯³?úK”ô±?íËbøå.°?”ã_çx¾¬?«²k ©?§ ™>éL¥?ø—ŽD¡?éæ§M›?ý„Íð‹“?ˆ'ãW|‡?${³ÂQIo?¨…mõqo¿#V2n†‡¿Ýï{5è“¿…Á´~R›¿õ Óµ–¡¿KmÎíO¥¿\—Ž^f©¿n™¡i,À¬¿ôCh¤Ž/°¿ŒÝêÞûô±¿;;%E¯³¿ X„ƒ[]µ¿;”#Ù‰þ¶¿#"‹½/‘¸¿¶†ãµº¿Ðü0ˆ»¿§*½¹ê¼¿xЋw;¾¿èÍž6™y¿¿àt3-RÀ¿zðô·ÝÀ¿Ô•ìt^Á¿lþc¸ÔÁ¿±ï¢@¿ÿÇEÿ Â¿u»ô¿*Àص=ÿû©#Øzÿ(;àÍô«Ã¿$– ÆäÐÿ͇[]‹éÿ#pO›ÚõÿŠ=`•/§?&#e縩?p&» î2¬?¬UHC‘›®?¨ꀩx°?®Äîša™±?œUà>¯²?’îvó•¹³?ÉÇ’·´?ðr˜ú'©µ?0íÕL1¶?ܳÇåQc·?œiT¶+¸?=¾”Ñã¸?Õ—ˆC¹?½ê ó&º?à6Ze°º?Võ7¯™)»?ññ5?ñ‘»?ŸÜźGé»?SìCg/¼?8_zš$d¼?{P¸6_‡¼?ÖŽw]™¼?ûy-™¼?Òq#¦[‡¼?΄§d¼?|çœë^/¼?ëÑúø<é»?Íâ¬ä‘»?˜ Š)»?`œBCo°º?ö'jÞ&º?÷=ªS,¹?òßÍÇ·ã¸?ûÃFé*¸?·KÈ2c·?Má{v¶?²@Í_©µ?æ¿'›·´?ð–,¯k¹³?Ï%Á¸¯²?7‹kˆ1™±?–0~vx°?(*OY%›®?ËüÂÖ|2¬?[öËo¸©?ºI….§?›¨3N–¤?ÒØ@dñ¡?·G Ò‚ž?­ä"ç ™?×öœ­Ì“?SäDÿ‹?DQ5P'Ñ€?v1–Écf?IJ&¾Šf¿zððrÍÚ€¿MfwŒ¿~£ a’“¿éÖJÔe™¿TÃiúÞ†ž¿  «5ó¡¿ø—¥ä×—¤¿xQë ³/§¿ ݇*¹©¿OÔ«­2¬¿ü¿”’¹š®¿DÙ$x°¿B—3‚˜±¿%2ú, ®²¿À‹ W¸³¿8ìŠÝúµ´¿¶åó˜$§µ¿^Œ‹üж¿ó.¬õ`·¿ö½ZVŒ(¸¿ÎZ¬%Hḿ‹ŒJ¸Š¹¿iÒ‡~u$º¿fÞaÃ"®º¿J^á¿j'»¿ø_<ÿ»¿qVJh—绿¶Çï-¼¿{è€ Èb¼¿ÐÌð…¼¿–[Y™O—¼¿ÂÉô^Ý›?ÔH-ß‹êž?ÓKØPSò ?9‚žìd¢?ÍOtI-Ì£?{!ÄÄ7'¥?’ P 6u¦?xGZµ§?Z°Þæ¨?@…-ò ª?®g2W «?i^±¬?f¿DŒ ­?…¸¶¬ê­?®\FùW¶®?:”o¯?Lw Õ4 °?SúvÁûR°?¶“o ±‘°?ºÇGîã²§¿®0ønøã¨¿øV¥Àª¿%à’1‹«¿EóË›°¬¿;` ”­¿^¥&»£æ­¿³£s=Y²®¿Ö L9k¯¿ðŒÍ˜i°¿Dõi½_Q°¿¹¶uðN°¿V09 Ű¿á â&_ï°¿ef’í±¿A‡Á $±¿qÎZü-±¿bÉ_µƒ‚?pxµÕ(™„?€ÿ½¦•†?þY¸ïƒˆ? ýöaŠ?êµ0Œ?/8 ŸÀí?¸ª>|˜?l%¦´Ü—?¡TÕ}>Y‘?Îæÿ7ì’?eø9u»’?² }¹o[“?T»v yï“?ÜÔå5w”?/ØÜRò”?ÝÓ̃`•?¸±†ƒÁ•?ÊTO –?d [–?Â$Ã{7“–? ¦O˜t½–?©ãZªÙ–?ª.³VÇç–?ztÕÂç–?¦Ԝٖ?QïØ^½–?% ®Ó“–?ÔÎíFäZ–?åœæ–?›) .HÁ•?oíEQ>`•?ò’m?ò”?WÙìÝv”?TGTFï“?Œo[“?p nÿº’?ßéF4l’?Âà!´X‘?lSäG—?ôæ|‰=—?bi¨½lì?¸þ§$/Œ?;…òõw`Š?l˜„ˆ?Ž‹I”p“†?±¬¦Rn—„??-Ýä¶Ž‚?â܆ɋz€?¹Ö?Wk¸|?è.>jx? ˜¶” t?*tÑEo?2Ù~Q²^f?Å ©5ÔZ?í}ìºUµA?"½©"HB¿”NMÌ[¿ð€ñ¨(‚f¿¾Œò·go¿À«Àt¿£]±Ýýxx¿DJÖÅ|¿a.àK€€¿üðúM“‚¿µ;XÔ©š„¿ ó‚"•†¿àAx‰ˆ¿ \FÂ_Š¿«Vó½ñ+Œ¿PB×{ç¿æÓ£Ö¬¿ŒùüÆE“¿B¢T‘¿tS–I ’¿ùcŸª}µ’¿"ÁìüHU“¿üfl(Mé“¿ÑZ3q”¿Q˜c¬ì”¿š„n[•¿À”À5½•¿ò1õÁ–¿D°]iÏX–¿ú&‡Ä ’–¿m)ß¼–¿'«WØ–¿#å)Bá–¿P!©—`§‚¿JbJﱄ¿&ÉO†¿y„§Ÿˆ¿“½â3€Š¿¦ÎIç‚PŒ¿@ðË¿]Ž¿„s“ϰ»¿ÄVô9ª¿ÑÜ_wUl‘¿Ä«C9³#’¿¤Ê¶"âÏ’¿C‰‚xp“¿uìþΔ¿<$ãS”¿T³ 7ê•¿fÊ“ˆw•¿ R\ÂêØ•¿„‹ÈµÔ,–¿l{°s–¿¿A_by«–¿¸n1æÕ–¿}zPx>ò–¿\šª>q—¿öÓ"u—¿Äsð•Kò–¿T˜êûÕ–¿^¨˜«–¿ÈGD:s–¿>­Á<-–¿l )S$Ù•¿ð£žHËw•¿6f-6 •¿0€±9©”¿yÆ3§p”¿6R/~àp“¿:*TcTÐ’¿Á^/$’¿!ñÛl‘¿ÛK3ʪ¿žK弿BW榎¿V;ySàQŒ¿};›[¥Š¿Ó/¡ˆ¿¨BGU±†¿•!ƒj™³„¿1Äai©‚¿ÓuÞÞ“€¿ð9/@Íå|¿ÅÄšW“x¿nñI§(2t¿”íú•ˆo¿3ýÈ\™f¿¡«ÜF8[¿Îì–©³YB¿a2kÿÈA?|µÕT·ðZ?k@ùcvf?žáM0Ûfo?ßiN7("t?q˜I殄x?Þ°e#VØ|?RØ×=€?Š&âY?¤‚?- —範?“Œﮆ?IçP ˆ?ðÉ\m‚Š?@ˆÁ‹ TŒ?  X%Ž?Ôç#¡Á?»yC+µ­?\:îî=p‘?¾–©%ï'’?á ÍåSÔ’?¾ Nþt“?ÐQ?•† ”?»Â¢Y‘”?{]Òɹ •?1¿kܺz•?ðÆCåFÛ•?/[ê–.–?ÂîM&÷r–?áGDÆ¢©–?¬¾ö´Ò–?^+·(îì–?Ë´‡£ß—?LRä!Ò蛿há…xôöž¿2ºy¡ÿø ¿­öÀñ l¢¿¿þðRÀÓ£¿þ¬ì8/¥¿­9)q¡}¦¿hGY¡+¾§¿¶Ìð¨¿cwH—ª¿s¦óç%«¿©5Wi½&¬¿>e¤Ü­¿p“X~õ­¿‘æ`¿lÁ®¿àc°?dz¯¿Ržç:ù°¿§·¤ØX°¿§›j£—°¿_„CÕ2̰¿Ž}qzfö°¿_ž T$±¿2ÛŽÏX+±¿„nÚö5±¿ uè÷5±¿ÿÚ7û[+±¿¾¥ž)±¿œ±³æmö°¿ZÉñf<̰¿¦’u&¯—°¿È3ÉæX°¿Jé\ °¿f·þˆz¯¿rDç–Á®¿ö”ë«õ­¿}lH­¿7Ò´ô&¬¿Õ«2ýD%«¿Çó5ت¿a½*›W𨿂êžXv¾§¿È’ìñ}¦¿6v†m/¥¿SEu£Ô£¿ªh«ókl¢¿†ŽG&bù ¿ZN%Â÷ž¿™Js§é›¿ûÚrÅVʘ¿ˆ¿®¼›•¿’Îá@Ï_’¿¶Pb1Ž¿ÞË=3ô‡¿áálkDà€¿#L~lPLt¿Á³Oÿ.[¿@({æZ?ö2Í¿y:t?¦™«K‰×€?%’ð‚‡‡?Ôü¨I )Ž?Óƒ¢Z \’?;SH˜•?Ñy„ÖBǘ?b°ç›?öúèõž?¡Ñ^•ø ?t¹§^ék¢?ªá+á$Ô£?ó÷°Ø/¥?˜«ŠQz~¦?d9é9¿§?ÚÎ|ßLñ¨?°Z$÷ª?Ž¿‚&«?$„y•D(¬?ÒÂv×›­?päGRòö­? jɳ¼Â®?‰Ù·z{¯?S+)‹[°?ÖU‹nY°? ªþ¸ƒ—°?cS£¬Ë°?Ï?š²Hõ°?”‹Âw±?}Zœ:&'±?Z;ë ,±?‡¶ëÀ4§¿°l"!¿©¿–U‘ð 9¬¿†?0/¹¢®¿ª˜—›v|°¿LÈç f±¿štrµx³²¿îhM¾³¿Ý|Ñ`¼´¿o½Nõ­µ¿ §*’¶¿Ø›6uh·¿Ê´÷O0¸¿"`6@鸿„»µÓ’¹¿Lç²Þ¡,º¿DICØK¶º¿nàd»|/»¿²wžÊé—»¿HxŸRÄ2R5¼¿”Ñ›Jj¼¿¾¼Ç켿–O‰5Ÿ¼¿P©6Ÿ¼¿x û¼¿íb¢´Oj¼¿¹Zëyˆ5¼¿tÙÙ[‚êõ—»¿ÎM(Š/»¿wÌàg[¶º¿úk~˜³,º¿oëÞ ç’¹¿ÉQ\V鸿eù_h0¸¿½>ºh·¿Ÿ½f¬G’¶¿±Þ€^®µ¿~¼Ç‚¼´¿å£º5'¾³¿ëÀ4Ÿ³²¿KÍò玱¿2"Ì¡|°¿²}£®¿?÷î6:¬¿Ï/õp„¿©¿@k(5§¿ìepî{œ¤¿,Hýþ÷¡¿‚ûÆ¡Gž¿‰¯©—ƒ™¿Ï[18D–“¿/°‚žÞ Œ¿d ùäÝ€¿ Šü<õf¿ÙjJªif?Š…m×æÔ€?ù¾B Œ?~0D™ü‘“?(=î i™?ŽÖ"f‰ž?p’Ë•Lõ¡?êÖÄØš¤?Äì³3§?A kÂE¾©? 6œû8¬?Ä}#ÛL¢®?&(ÁE”|°?®´™’–±?ç®z»³²?‹ÊrV¾³?ÏÈ#¼´?¥CHÅ`®µ?8øÔ{œ’¶?^æC¯çh·?ÀuZ½0¸?ý:bT¡é¸?† “¹?^¢GÑ,º?àUÌ S¶º?[Ã}N/»?âkt—»?NQ¦_{î»?Òt_4¼?Ÿ×Âïg¼?N»†VQ‰¼?—ž#Úµ–¼?9`F 2°¿Ý³/#ó÷±¿5ÃȣDz³¿K]Íqvaµ¿"0îõ·¿súY›D–¸¿ç’ ½iº¿J¹žðuŽ»¿ÂÿDÁƒñ¼¿ì¬W5¸B¾¿AkUC¿¿¤FV0VÀ¿¨©µà«áÀ¿6, D¾bÁ¿’!æÙÁ¿š [ÉoD¿ޙgºƒ¤Â¿{\Uxù¿r5}ÙùAÿ`šëú~ÿvö¯Ã¿—TÍÔÿ‹]%6iíÿ4ÂôS»ùÿÄRÑ»ùÿ.žÀ­jíÿ’^HƒÏÔÿó3ù¯Ã¿ÙüYÿ~ÿòIÿAÿ*åçëù¿?ud5‹¤Â¿Ü}OxD¿T^{!ÙÁ¿.­ÆìÈbÁ¿Z2¡·áÀ¿ÔÍ2=VÀ¿^§¬N_¿¿œ¯ vÖB¾¿d"IO¤ñ¼¿¨æ¿Ï˜Ž»¿¬×D¿ú"él–¸¿Ý]J¶·¿Bu¸s¢aµ¿¯VÉõ²³¿OÉM#ø±¿ l^<2°¿µŠæè¯Ä¬¿ë·g *©¿†-Û†-R¥¿ µ× „¡¿ÆEy5V›¿cG×¹w““¿¯ïnlL‰‡¿n©È?zû›w÷È?*Õ*6É?|®òDeÉ?¼)’ò„É?yÛKN•É?ó¡¾ÙV:¹¿ßà&+lý»¿ú5º>¯¾¿@¸¿Š§À¿(ƒº»@ìÁ¿$lÇba&ÿÙ,ÒòTÄ¿­ÁnkzvÅ¿¶^Ô¡‹Æ¿ÍÙ©‘Ç¿'.Eʼnȿò>lU¾rÉ¿¢xÕçLÊ¿]Ö±Ì˿֔ºrÍË¿^ï©Ù¨tÌ¿º¬Y.S Í¿¼8\´ŽÍ¿¶ é)œÿÍ¿”NùŠ£^ο¶¥u<ðªÎ¿ÃZ0Säο.*¾© Ï¿bf¡ÚÏ¿m'†ÚÏ¿¸CºXª Ï¿ÆWkUäοÄ2ô]óªÎ¿eÚ•§^ο®3D¡ÿÍ¿À™,˜ŽÍ¿jàRZ Í¿S½ô¥°tÌ¿,ÝåÊzÍË¿#mŸ“Ë¿3¢³LÊ¿Ê?Q+ÊrÉ¿?Msûщȿ.­„Ò·‘Ç¿M‡´‹Æ¿Ñ»KšŠvÅ¿IMÄTÄ¿¶pÊÑs&ÿÉáJTìÁ¿uì6'§À¿:í?j¯¾¿ŸwÉ™ý»¿ç?Úq†:¹¿Iõ¹Cäg¶¿ð‰·ßp‡³¿ZbBiòš°¿b“QÜlH«¿˜G:“!J¥¿n¼¤ j}ž¿:É<°ÂS’¿BWói3{x¿&õ:ïÂgx?Æ•´íN’?x[öx¡xž?ˆ­‡ÇG¥?§—F«? ì Ô™°?¼Ö°u\†³?‚–ÅdÛf¶?ZŒ˜Š9¹? ýª>¬ü»?ªuŒ®¾? À¦À?¨ºÇ@2ìÁ?N/ŽÿN&Ã?¼ŒÕœTÄ? «ÿ`vÅ?Ä…„èŠÆ?íj`”ˆ‘Ç?H"òž‰È? X’rÉ?6¨4×ÒKÊ?€‚Ú1ÚË?Ö¶3,ÍË?b–{WtÌ?(9†‰ó Í?›òÉ¥Í?_«€ÿÍ?fz<^Î?F]ªÎ?9~˜sÊãÎ?0µûëK Ï?ɸ<ÖÏ?²ÚV~K¤½¿Åú_ŒqÀ¿ K Ï¿íCÍóÿ{ÓU“Å¿ -¸€Æ¿2ãû™UãÇ¿f/Ü%Ñ7É¿„)é^¿|Ê¿Ð7¾ßW±Ë¿x VÜÔÌ¿±¦÷÷˜æÍ¿iÏùòäåο(qüÓ"ÒÏ¿”ä9t`UпšMÌœ·Ð¿xÏõۉѿâ¯×iñ\Ñ¿¾:¹£ŸÑ¿id§w×Ñ¿šèÛÆJÒ¿¶ÜŽr&Ò¿¼>é߆<Ò¿üVr+ÍGÒ¿Úc]aÍGÒ¿^#Ó‡<Ò¿Õ–ñ€&Ò¿*üBLÒ¿'g‘y×Ñ¿í¶Ì¦ŸÑ¿ [5ô\Ñ¿]Ţѿ5t€ ·Ð¿êá´ dUп*N’",ÒÏ¿'çÞ<ïåοíC¤æÍ¿(²p¨èÔÌ¿X@f?e±Ë¿¥™ÑÍ|Ê¿jÅá°à7ɿέäAfãÇ¿1¶l€0€Æ¿D'Ù}Å¿^!îÙ‘ÿHÖZ6ä¿ÑL¥¢qÀ¿î²È&z¤½¿•’ïZgSº¿JµÒ„ò¶¿p/C£‚³¿yVüë%°¿Q‘É|Œ©¿T¤¬`é¡¿å¬íÁOˆ•¿´.e¸]Â|¿$ÛäB®|?S¼¶øMƒ•?e Q)äæ¡?…§–ú©?Ât‚¨ð°?çòBt³?úÁŽ ñð¶?VÔØ™HRº?±¹=e£½?mîH™qÀ?EG„õdÂ?س‰¥ŽÃ?×õïÅ?B¨ÄjÿÆ?&Ëw9/ãÇ?ëÁ­ ¤7É?7¯0¶‹|Ê?µ&ž±Ë?&ÕØ>›ÔÌ?±1ÞšPæÍ?JÃU­”åÎ?2ÄÔÉÑÏ?}ô/UÐ?ëp™f·Ð?ÆÀé[MÑ?.{à®\Ñ?S¦Ÿv[ŸÑ?Bê¾+×Ñ?âÚT@ýÒ?úYöB¹%Ò?"¢ÙmM<Ò?$ L7¬GÒ?^?l2üÀ¿ %ÖOBØÂ¿%@̳¨Ä¿¯j¡-glÆ¿äJÄF"È¿l˜+6DÉÉ¿wO£Z`Ë¿*ÿÐûŽæÌ¿ý¢—ðZοچΙ¼Ï¿ZÌ@X…пÜüžS3"Ñ¿zÔb}´Ñ¿Øø4Ü;Ò¿H,1Nü·Ò¿äyõ ‘(Ó¿Jµ§>UÓ¿Tå‚ æÓ¿Lú5z2Ô¿T³_6urÔ¿´Ø Ô¥Ô¿: ªwÌÔ¿èî\dFæÔ¿1 p$2óÔ¿\›+W2óÔ¿²­¸üFæÔ¿ Ð& xÌÔ¿>ò~sÕ¥Ô¿ê­òwrÔ¿Ðý)m|2Ô¿bï¸$ æÓ¿``ÉNXÓ¿ª½¡”(Ó¿v§ä@¸Ò¿€=@à;Ò¿z§–C‚´Ñ¿ÿ0Ȱ8"Ñ¿¸š^…пEަ¼Ï¿vâweþZοW§qÞæÌ¿L-¶¡j`Ë¿κUUÉÉ¿4ÓF Y"È¿)1ŒzlÆ¿z1ȨĿý•­XØÂ¿4ÍcúHüÀ¿œúºÁ€+¾¿î 8«ÔKº¿ØAñ[¶¿ºÃ`D^²¿ån`†ª¬¿õÒE9׆¤¿øeGÿ¬˜¿ÊŽf1z€¿òi ùÄo€?˜ÿ«_̧˜?Û ýA„¤??ϤGõ§¬?íÿêþ\²?P[°Z¶?™Äpé˜Jº?8U§K*¾?à/{±ûÀ?ïfe`Ä×Â?—cút8¨Ä?úÐË;ïkÆ?¦zíQ&"È?`ä(ˆÉÉ?'¥ˆ™$`Ë?7û>OæÌ?èÿ2¯§ZÎ?¶pfH¼Ï?]ûb#+…Ð?äÁü"Ñ?Ç!fÊG´Ñ?ôQA¢;Ò?È— Ô½·Ò? ƒíM(Ó?Gg'% Ó?zÙØy½åÓ?¹7(2Ô?`^îrÔ?Š ¢;}¥Ô?&×B6"ÌÔ?À/ý4øåÔ? åHøîòÔ?Ä? ±ÿjë2 1Å¿Ù*Ú°S;Ç¿òÁ|H7É¿ÞâÎM°#Ë¿ îÚv[ÿÌ¿(˜xš$ÉοÓA½±ø?п¼p+™YÑ¿ÐÖâ3ØÑ¿¶È±è ”Ò¿Æ”ÓpDÓ¿æ¯-ØòèÓ¿ùXÝ‚-Ô¿jPÆðÂ Õ¿È ]‹Õ¿@§qÀ­üÕ¿3ê€+o`Ö¿¹‡£Çc¶Ö¿1(’VþÖ¿Þ¾+8׿ª³óc׿÷Ió”€×¿ Ò$Ç׿8î„ö׿éž@­”€×¿ÑŽtáŽc׿zP¦y8׿pFºAXþÖ¿ømÚe¶Ö¿£=Z£q`Ö¿àŸŸ°üÕ¿ (U`‹Õ¿––¿¦Æ Õ¿²ó¨1Ô¿{Öíq÷èÓ¿ÀtZäuDÓ¿”Ò€u”Ò¿ïá®î9ØÑ¿´’*`Ñ¿“å„Ëÿ?пgÃè3ÉοaaÃèkÿÌ¿|OÁëÁ#Ë¿ލM[7É¿u*œ¼g;Ç¿š} 1Å¿ä]4«ÇÿðôÍn§öÀ¿˜†Ìi"’½¿¢*ù¹$¹¿Ã“³Éϧ´¿¨[ñ#)°¿xW$§¿#'+Žu¿›¿Zm¥w ‡‚¿êQh;|‚?ÿ÷Í/º›?µ3oWr§?“émѰ?Ž>×y¦´?ùN f#¹?Öø¿…ѽ?FKþ¦öÀ?këÑ"Ã?p9œÓ}0Å?.i {Ç:Ç?}6†¤½6É?$) I‡#Ë?–ó…Ú#ÿÌ?K /‹ßÈÎ?Pµ¸íÏ?Ð?jã +Ñ?¶ÍVôÿ×Ñ?d$ðöÓ“Ò?õót,3DÓ?p½°èÓ?v9µ#ç€Ô?äæ•lx Õ?ë:p‹Õ?Qй [üÕ?¤½P`Ö?‚ÜeöÖ? PMƒ÷ýÖ?ò? ¸7×?‘K‘(c×?{¨Ûz-€×?n/©°µŽ×?ÙŒZ+ )Å¿ Žû!zÇ¿3Ul¾¼É¿Êó|ïË¿ˆÙ ]ÿοò3•ñûп­¡ýP Ñ¿ÄûŒh Ò¿®Š‡P–èÒ¿0EúâÄÓ¿—™‡þ”Ô¿:©> hXÕ¿ƒ]¿¨Ö¿ÆÎ­~N·Ö¿~ËŸÛñQ׿ö €w3Þ׿73KÒ¼[ؿԦ€@ÊØ¿d®gXz)Ù¿j-¡/yÙ¿C¤1/¹Ù¿e’QéÙ¿Øßy Ú¿ÊÌß‘Ú¿Ž¼¤ ’Ú¿ÄÉ—–y Ú¿¾Ô,nRéÙ¿…Ê#g0¹Ù¿ô :11yÙ¿-£ÞD|)Ù¿©ÕÊBÊØ¿ØÕé}¿[Ø¿¼³·†6Þ׿¤ŸQõQ׿³`_R·Ö¿Q­Ö¿‰Ä}amXÕ¿¢R À•Ô¿°æî®èÄÓ¿þðü†œèÒ¿?­A&§Ò¿?óÊ›— Ñ¿ âÏпb]SKοXñö<ŽïË¿§û¨ãѼɿϹôN6zǿВX )Å¿KÔÅýÊ¿yÎÐjDaÀ¿áúÍ}âÚ»¿K–4èâ¶¿ÕE^Û±¿¿ÿ?Y’©¿ì)2=`½ž¿Pši5†„¿Ô=aeúz„?rRc³Â·ž?ò4{Š©?NÃS¶·Ù±?©°¬§à¶?n£€{Ù»?ï¼"‘`À?Ò°nÒJÊÂ?òa©Ým(Å?¤Nˆv„yÇ?”YÙ ¼É?ô°i,ÞîË?‚jþúÍÎ?Ò¥æWÚÐ?J‰G…f Ñ?(óWoÒ?!Y¥^èÒ?ؤs¤ÄÓ?`°VTº”Ô?oIºSXÕ?ó7>ãZÖ?…"àŽü¶Ö?ÇAx@œQ×?è­|ÚÝ×? ú™`[Ø?@Ž(ëàÉØ?œC¹ñ)Ù?”4×|ÇxÙ? ¹àÀ¸Ù?gÁ!HÛèÙ?Ý'p9ùÚ?N¼ç5Ú?H:Ÿ±«(Ç¿ØLLÅDZɿoNBW +Ì¿l±¿Øï’οó’è¸üsпFÈõ[”Ñ¿Ê2›Éã©Ò¿:0¼ é³Ó¿TBѨDZԿF÷ùã¢Õ¿=É]“¦†Ö¿Jà´…\׿>ØÀü#Ø¿õÜØ¿ÂÎ…Ù¿8‚:OÚ¿´Ö B´¨Ú¿¼÷q¨!Û¿z˜0và‰Û¿GñÕáÛ¿~˜^('Ü¿T·c?Ö[Ü¿v#¿3Ü¿±î”0¥Ü¿«¶X¥Ü¿ÄèS¬Ü¿¦u ×[Ü¿©Aû")'Ü¿æ$ÏwáÛ¿þI:â‰Û¿9”Ô7ª!Û¿üƒM·¶¨Ú¿2æ\QRÚ¿JäwÂÑ…Ù¿:ž¶“ÜØ¿®=÷Ž$Ø¿8Ïs!Š\׿· ™r«†Ö¿ÍÉ¢iè¢Õ¿¢f*ͱԿ‡š„fï³Ó¿ÿ± ²ê©Ò¿‹ˆŽrc”Ñ¿w·ÒtпBoU“οiÇö.+̿Ξq ܱɿ}ŒevÁ(Ç¿õ`Ç^‘Ä¿èù™ MíÁ¿rÔïZ|¾¿)ˆ%O ¹¿ÓPÒŠ³¿âúØ|ü«¿ü)"À;Ò ¿%V‘"v†¿¢Nͨ~j†?•3ŸáQÏ ?"à¤ù«?7Ã0÷Z‰³?8àÖ ¹?Ð(­tàz¾?Á£KäŽìÁ?”F„ŸÄ?YÁË1(Ç?©Ã×±É?ê«.\*Ì?ØT5³>’Î?®¯xéßsÐ?œ™ ­4”Ñ?rr3㲩Ò?L¥ˆW¯³Ó?3þ…±Ô?Â*dHš¢Õ?rU…W†Ö?îÜ@<1\×?Ф‚£#Ø?ÁÀ¢J3ÜØ?Œ#p¬n…Ù?H<$íÚ?vñÇO¨Ú?Ì—ÅmA!Û?"ûÒÈv‰Û?ès.x®àÛ?ûo)±&Ü?Ly.R[Ü?ø‚ØÑo~Ü?ªeSÞöÜ?œl‘< É¿ Ë.sIÖË¿Äà[„οúR2Îп„À½7ÓÑ¿æÀF£ Ó¿h  O8Ô¿c™ÙƒXÕ¿Cü ŽkÖ¿á¬F‘Äp׿“ïU†gØ¿eB);OÙ¿:H³$T'Ú¿8 LïÚ¿÷æm§¦Û¿ö4'SõLÜ¿YP!ÏáÜ¿iêv ÙdÝ¿Û&î@ÂÕÝ¿âø E4Þ¿WÁ‚\'€Þ¿‰2‚,:¹Þ¿û2f\ZßÞ¿?ipòÞ¿åæ;pòÞ¿ð&Ú?aè/ºäîÚ?ånÞ=¦Û?¹RxŠLÜ?”„g¶cáÜ?ÌÏJmdÝ?²8%rUÕÝ? ÙÔ3Þ?`Ö±n®Þ??F¯¸Þ?¡¿¯(±ÞÞ?| uÇœñÞ?ž˜ÿ%«òÊ¿¬ÿèÇûåÍ¿‹Lencп‚-¦òÂÉÑ¿¶Ñv%Ó¿HNi­tÔ¿ ·Ö·Õ¿Ñ.ë”)íÖ¿ o»‘Ø¿¤b -Ù¿1¼šª'6Ú¿Ê\ø/Û¿€»"ˆÜ¿OŒL5åíÜ¿[Û_ŠÔ²Ý¿”à»seÞ¿:€¥Rß¿~|©’ß¿5Lÿ(«à¿®.jl8à¿¶ Ë,aà¿y£³)Óà¿°y+ŸL”à¿‚|þŠŒžà¿ií ›Œžà¿ã%Ã,Ù?¡Óù\Ã5Ú?¢οš.Û?´úÇà¯Ü?=K¦síÜ?È2NŸa²Ý?¨Q¨MeÞ?Neaáß?´r±Ý¡‘ß?vJ uà?ª¡"¨68à?òÏŽô`à?bG>ú‘à?{]‘ƒö“à?×2L¿žà?-QÕRºÌ¿LU–>ßÏ¿?-ebxÑ¿Mob‘^öÒ¿Üd†e©hÔ¿ý]š^ÎÕ¿%"£  &׿‰Ëí›pØ¿ÃMÿŠƒ«Ù¿¢ä:—ÖÚ¿Úï´ñÛ¿Ù‡½húÜ¿Ma’¶Ôñݿڃ\ÉÖÞ¿ =ë~¸¨ß¿ÎчÐ3à¿o €Çˆà¿ŒM‚ÀËÓà¿[säMoá¿?ÂöJŠJῪ½yYûuá¿`}Ò®§–ῲ${¬á¿*0ÜDh·á¿eNÂRh·á¿• ^N{¬á¿`OØô§–á¿Nz@¼ûuá¿À?ËŠJá¿‹R«ìoá¿0ÌÓà¿|¥Ñ_Ȉà¿ë-Ó‘3࿾4κ¨ß¿]¦ËÖÞ¿U5´¨×ñÝ¿fõ lúÜ¿6¦b!ñÛ¿€âþP›ÖÚ¿‚ˆ«Ù¿ðÜ  pØ¿`¤+­¥&׿Zö%?dÎÕ¿ñ7(°hÔ¿Tföҿ9jxÑ¿xnµPßÏ¿wô–K%ºÌ¿à8(ÐBƒÉ¿) ßɤ<Æ¿*:tPèÂ¿Š…+§¿¿ø¢ž…=¸¿RäWr[±¿5D:îWݤ¿ Ó.ü¾Û‹¿AÌ·Ï‹?䨋%Ú¤?Œãè^ÕY±?ˆéã;¸?,YX5ý¿?àG+.wçÂ?u+7}Æ;Æ?ÝÈ@ø^‚É?°W‹;¹Ì?ÈšÛ`ÞÏ?úÚ¬?ïwÑ?Ï&ÕèõÒ? åa*€hÔ?¾ÈÁÅ%ÎÕ?À§øY&×?úBÓwHpØ?¥UêÚ%«Ù?^(Ý0ÖÚ?DK|›®ðÛ?p{ÍyóùÜ?šƒ[ñÝ?µWCMÖÞ?®U<¨ß?Z>À€S3à?ç=Œ+Œˆà?úÞ{“Óà?zû;á?„U^PZJá?ÈTIPÎuá?ÖY¨vw–á?€c±5¬á?\•¼Äæ¶á?ŠgèÑkοÝýJˆ>àп¾áÊ+€Ò¿t…‰7°Ô¿U·wSҜտ±E-G ׿­›s0„Ø¿$A8¢áÙ¿“Û¤o/Û¿]˜ÕkÜ¿-ßµ—Ý¿r™kö¯Þ¿ûØ­[úµß¿‘•zå7Tà¿ÔQa˜`Ã࿸ët¸2(á¿ÊæÚp‚á¿5`MáÑῸ°m Tâ¿_¥û“ Oâ¿Á¬Þ“¡}â¿™êð@; â¿¹Á~DX·â¿š p]êÂâ¿ÆÙiêÂâ¿pk‚gX·â¿ø~§{; â¿%$Òæ¡}⿳ïÿ Oâ¿ ]b&U⿳w‚°áÑá¿ OÔÕp‚á¿Øóÿ”3(á¿”›•aÃà¿Ä£×9Tà¿KOXèüµß¿ÃÔJù¯Þ¿ð-­É—Ý¿O䫨kÜ¿Yæv!/Û¿_€¦áÙ¿¿äu5„Ø¿ËNÚ¥׿t~—‡ØœÕ¿°óø·Ô¿éÊûy3€Ò¿X¹GàпðCtôäkοݡ€2yË¿R”J^dŒÇ¿¨R17ÊÄ¿å¬ûq×rÀ¿=Á€«¹¿éŒ3a²¿Ì½DR¦¿~;ð#€¿¤zؽ%s?h‚øØ ¦?7LoØ_²?ßüpÒ©¹?Ýîc’ûqÀ?Šr€ èÄ?VÐ0|‹Ç?NvAµ‰Ë?BœŸ¡íjÎ?ÛãõZÇßÐ?Oõ¥¯Ò?%>[L/Ô?¦G)äœÕ?{?+ýa×?1æÄåâƒØ?.n±FáÙ?rùýµ.Û?FÁ@ckÜ?ÃE‹–Ý?Xø|©u¯Þ?ÝS³Luµß?ÿÔõ`ôSà?€|XZÃà?WI‡%ñ'á?^Á1‚á?ÿc]çÑá?¢¤I„"â?1B‡:xOâ?[Ô…}â?~˜[- â?£ô¹L·â?)  F”Ââ?éaÕ{Eпè,"DÄÑ¿åyw5ôyÓ¿›HDÎ#Õ¿+xÍžÀÖ¿è­U8gOØ¿&åš“1ÏÙ¿ƒ2-?Û¿™ù»##žÜ¿cÍ_óŽëÝ¿1’mú†&ß¿æ›P|$'à¿zêkC±à¿m ÆÃ®0á¿ÆäâG´¥á¿3©¤×â¿výôb×n⿌³ÞíxÂâ¿6oò°ˆ ã¿:Øô:ÚFã¿ÞQ´XHwã¿ÌPú+µ›ã¿*÷= ´ã¿O8Àã¿6Da–8Àã¿XßY ´ã¿.¯×Zµ›ã¿¾Ð›Hw㿦”‘ÚFã¿*Õ‰ ã¿QJFpyÂâ¿Åéhý×n⿚heXØâ¿~=µ¥á¿8’«²¯0á¿4ÁÅS±à¿ƒi}±%'࿚}-¶‰&߿ǵl ’ëÝ¿]Jž&žÜ¿+Û?Û¿Úaìû5ÏÙ¿Ú;…-lOØ¿ a¤ÀÖ¿R*ŠÔ#Õ¿"DûyÓ¿'éX6ÄÑ¿RÕÛnNпXK;qÌ¿š"#PÊÈ¿ðTnÅ¿úOÇtçPÁ¿=}✠»¿ȈU¡Y³¿ºs‘B§¿lÏœQ.¿ ¼i?G“Ø??§?÷LròW³?üN6¶T»?PîØ›PÁ?ù8›g2Å?&lË^ÉÈ?Úxã@pÌ?Ÿ?+#ÌÐ?DÌ”´—ÃÑ?{q|nyÓ?œ0•B#Õ?ÔÝk·lÀÖ?/%¹"OØ?Z» JÜÎÙ?ڈǬ>Û?hª­x±Ü?&iëÝ?Áâ&ß?ËÒCÞ&à?“p”™Æ°à?¬Dx@e0á?Ø;õek¥á?!ù‘â?󲈕nâ?‰¦L#æË?\oáR¦Ë?Ój<ï6Ì?ä§Ï˜ ¸Ì?\/WIh%Í?ËJ¦†‚Í?ceUÌÍ?õ%ôÐ?Î?[扙+)Î?5£Ø½÷;Î? Øxõ;Î?Œâö$)Î?6a¶4Î?¥¿,ÿõËÍ?E7¯èr‚Í?–õ¾P%Í?ž¯(ð·Ì?. *AÐ6Ì?Ï-oòŸ¦Ë?Vë%¿ÀË?õ=BJ$QÊ?]‹ÞÜŒÉ?2[¹*ǺÈ?EHƒFwÖÇ?8îÓQrçÆ?9o µæÅ?^šŠ¥ÛÄ?ˆ)僪¿Ã?F¬ôžkœÂ?6Fœ ”hÁ?q€œ5N/À?9lu"ͽ?2À§ö‘4»?µ˜¼D£¸?pΑ•xǵ?"X“Æõ²?²M5w¼$°?©bЗ€zª?VEgš´¤?&™ F¾?ð-wªÙ‘?©J øØŽw?õ-™%'пö¸™ÝóÏ¿¸ma…ê¾Î¿ðP†Q^ÚÍ¿\ͤmäÌ¿üì.ÛË¿—ŸáÝÁÊ¿»…ùQ—É¿ŽbõXÂ]È¿OÄ]Ç¿JâÆò“½Å¿õðrXÄ¿#ËæçËç¿•R¸|jÁ¿T(N/ÏÆ¿¿%ˆY£¼¿’T‰—®o¹¿~•¨(Š*¶¿¸6Ã×Ù²¿m¼}¾ö®¿\b+¨¿Oò„£L¡¿îœe­Í”¿ÄIüµ{¿jQ».¸{?j«[¼9Δ?2»‰WL¡?€‘S+¨?j‡Íp÷®?kôTãùÙ²?î'³Ý«*¶?"•ÎÏo¹?ÞGf/£¼?=úà+ïÆ¿?ø[ŒjÁ?ÜX—ÛçÂ?WM¸1XÄ?ôã/¢½Å?’~,ÄjÇ?2C/hÏ]È?‡ßK[^—É?ü®æ†éÁÊ?ùZYÄ9ÛË?³ig äÌ?>LŸYgÚÍ?àþˆò¾Î?>çƒÇúÏ?êΈ'Ð?HLE˜Þ{Ð?Œ~ð¿ÆÐ?¦ @ÉÑ?&Õ:=Ñ?[(µ©]hÑ?·nô úˆÑ?AŒ™p´žÑ?=Édb›©Ñ?*Åè)š©Ñ?þpḭ́žÑ?ÍâëôˆÑ?-ê¾FUhÑ?ÝÆå=Ñ?}ØëÑ?iïTû°ÆÐ?Hë®Í{Ð?0,Ió&Ð?Ò;¶ÒÏ?¤¤ÖƾÎ?Ýæ9ÚÍ?BÊ#äÚãÌ?1[ÛË?¤()~µÁÊ?ºç(—É?äw©Ÿ˜]È?žw 2Ç?Øðmh½Å?=n…©TXÄ?79æLçÂ?Ї8¬KjÁ?`ìÂyhÆ¿?„\œ£¢¼?¶ºAo¹?Þ *¶?G:|©vÙ²?‹ü6X$ö®?h³ ²*¨?|àéL¡?j<>Δ?w[¯·º{?sÁ„‘ˆÒ¿O†9sÏÒ¿†ÈÕûšÑ¿νŒ@Ñ¿"®œb‹Ð¿¡ì»|çÏ¿›"öi“¤Î¿ßqRZOÍ¿p”?°‹çË¿lJXçµnÊ¿ƒËñ·åÈ¿€Sm8MÇ¿Ô#‚¦Å¿Bà)Hòÿj‘’ë1¿Zˆá*fÀ¿ÂÆ Lò ½¿6­]+=c¹¿zÏ8¹<–µ¿„I­»±¿~G¾óœ¬«¿¬à>LУ¿®ˆeJ Ñ—¿{-ϛſˆÌ¹mÇ?sÀÄLŸÑ—?»Læú•У?=7…G欫?ì0²»±?|ßÄ`–µ?GkóË`c¹?•>%n!½?t+’Õ;fÀ?Є_†ü1Â?éí½XòÃ?P ZM’¦Å?0²ì2HMÇ?eÝÛ ÇåÈ?ŸŠ…ÄnÊ?óšU®™çË?]µ¨OÍ?83)øŸ¤Î?'U9$çÏ?âIÎ ‹Ð?±Z|EÑ?®ì™>›Ñ?ìoJÓÒ?~«–Ê‹Ò?…ucÄÑàÒ?†Rô{6Ó?iÃE€Ó?O\k¯ ¾Ó?D[î£ïÓ?e6°ºòÔ?·äøãÛ-Ô?wŠ?ÚT:Ô?üÒÿ…S:Ô?° Rê×-Ô?ˆB©"ìÔ?° (ÅšïÓ?$ˇ¾Ó?—Üø6€Ó?Æ?~žk6Ó?øRùK¿àÒ?Ž*ZwÒ?ÊH½Ò?õo tèšÑ?Ñ,mV,Ñ??¦'„òŠÐ?8ˆÃíæÏ?Ke¯øg¤Î?#Ÿ^ÜNÍ?úo 4_çË?èb_ƈnÊ?V+í͉åÈ?t2Ç¿MÇ?®žðO¦Å?,áŽòÃ?ò‘§±1Â?Ó¶÷èëeÀ?”§÷Ól ½?0‡´b¹?ʸ‰ìº•µ?Ð߆Ë!»±?ÎŽ6¬«?Ij/У?$¸lÂÑ—?4Ræ+iË?ÈôéªÚÔ¿Q íÑ`Ô¿œU4¬ÙÓ¿.”Õ¥EÓ¿2Hi¦Ò¿8ø8ªûÑ¿dðLÖEÑ¿¾‰}‰X…п¬Wà™ZuÏ¿éÌðF—ÌÍ¿H&|„yÌ¿]×ÍEÊ¿Ú!Õ ehÈ¿4ð6ɯ|Æ¿g­€#ƒÄ¿BO@(é|¿s>ØOkÀ¿óŒ“Ÿ¼¿>dq V¸¿Xî8Ôý³¿ BCÀÆ2¯¿‰z¥4†V¦¿´B f@Ùš¿'ϵ¤Dé¿àK }ê?wýéXÜÙš?ߊ‘éÓV¦?ì°Þ 3¯?h Xšúý³?Y+L*'V¸?ï*©2AŸ¼?æ ÄbkÀ?g2pû|Â?TT~t5ƒÄ?&ªä^Á|Æ?Ñé 7vhÈ?@®REÊ?|¢´‰Ì?ËNÑä¦ÌÍ?¦Pi–iuÏ?Ð'¯_…Ð?`+ÝEÑ?œšv’°ûÑ?w.2fo¦Ò?d–B;«EÓ?)QF‡ÙÓ?Lh8"`Ô?T0³‰®ÚÔ?xµ´\HÕ?A»)(ì¨Õ? å‹üÕ?ÊߨàÂAÖ?PLRG¬yÖ?Ö=¦Ü¹£Ö?ØvuпÖ?f™¥’ßÍÖ?æâ‰ÞÍÖ?BÑæÌ¿Ö?ò'ª²£Ö?B%|F¢yÖ?yª%¶AÖ?| %üÕ?:WSLÚ¨Õ?2ö‚HHÕ?ð¿Q2˜ÚÔ?.ó¿Ñ `Ô?tÅ ”ìØÓ?Ý=ÜEÓ?•SZßR¦Ò?Rq%%“ûÑ?ÆŠ õ¾EÑ?ÁBÞA…Ð?Òæ +uÏ?)@uÙgÌÍ?ÀŸ­KIÌ?œb½ÓDÊ?¶9Ü70hÈ?‚üMv|Æ?†¨Önã‚Ä? 7¢Î |Â?ŽèYþjÀ?|=¸dkž¼?Ê;OU¸?^X ñ7ý³?œþYGô1¯?½õíTNV¦?'ŒWt2Úš?€!S¤í?æŠýîT6׿‰k‡3í­Ö¿²‰Ö¿bMÄ®„sÕ¿¢îöÜEÂÔ¿,·˜%9Ô¿ ^7šÔ9Ó¿wé#”cÒ¿ ¡ÚüÑ¿ñøݘ•п,¬ ö=Ï¿R{ t=Í¿¾ëƒÝë*Ë¿á¤7 É¿L­h·æÔÆ¿J£ÐהĿçÊH—F¿Cþߡۿ¿N>´r»¿´ù]ÆŠ@¶¿&¸Ÿ í\±¿,SŒ>.ݨ¿,“ñúdâ¿þ2¯NçKäP%0ñƒ?yg # ã?I+€Ý¨?“ÍÀ]±?Üžw7³@¶?<$€,š»?èð‘ÉÛ¿?”ú´ãªFÂ?ðêš**”Ä?Ö·ùÔÆ?,ûw1³É?ûDþ*Ë?YþÓb†=Í?ÉýYJ>Ï?â*X3¡•Ð?–1à‚Ñ?€Ï›cÒ?ðl®äÛ9Ó?¬¨Y@Ô?,¢ELÂÔ? «å•ŠsÕ?ö’ŽqŽÖ?Øj>òñ­Ö?H"ÔY6×?Ðhên°×?"]¡ãèØ?žÈ*„xØ?Ÿ#‚ ÆØ?Áá[DÙ?@†^3Ù?æC6ìVRÙ?Oš\òüaÙ?üfº]ûaÙ?íÔ0RRÙ?1é( 3Ù?€Â¿o9Ù?è⎠úÅØ?9ç ]sxØ?¶®™XÕØ?…üÎX°×? AŽ@6×?Ždb×­Ö?‚ærÖ?†¨¹¹lsÕ?#”Þ@-ÂÔ?.šv+ Ô?C ·„»9Ó?-&{cÒ?ÊÊnäÑ?ïÎ^<€•Ð?¸^Š™Ä=Ï?ÎÃ;ëA=Í?¶°¶*Ë?@Ø•"eÉ?o¼(2¢ÔÆ?.qL\Å“Ä?ÀÞ“¢5FÂ?»'aǽڿ?;Óz»?,k:X ?¶?îO_¯D\±?óªæâÄܨ?ÛtÛµã?žùKöƒ?acF$€Ù¿(€ðñEúØ¿F)A¤TØ¿‚§8 ×¿MU…ÌÜÖ¿ˆ©±C} Ö¿ Ì–,Õ¿+Mµ¼Ÿ@Ô¿‰îôø+HÓ¿ððÒÓCÒ¿g¼ 84Ñ¿M»6îÿп„ëÑ‚³ëÍ¿¤«°÷òË¿VAd2%É¿¼qŒï©Æ¿0Š¡¸² Ä¿é×Î ‹Á¿ñ‰O´&Õ½¿‚þ9ϸ¿2Ï9õZ³¿WG 6b«¿BŸSÜÓt ¿$§1Š)õ…¿Š•‡Oƒö…?@Ô,*u ?e°.Œb«?•šgÇ Ä?‘ÀøªÆ?žN {F%É?U²‘Ë?SYÕÆëÍ?k] Ð?;É[7A4Ñ?ÐZ¸ÜCÒ?¾g!Ž4HÓ?þê#ù§@Ô?Šë,Õ?À#)²„ Ö?ÄýÒÜÖ?€!üŽ ×?.T&ªTØ?5½-9KúØ?aýq¾„Ù?˜49óùÚ?}¤nXÚ?75ÆÑUóÚ?* 8Ž´HÛ?ä.J?Û?Oð=jÌÀÛ?vèÏy;ãÛ?üq3wwôÛ?Ñ~…¾uôÛ?Á\ R6ãÛ?‚lÚÃÀÛ?‘“”3Û?„¿Z¥HÛ?ìzqCóÚ?ƒ6ó™BÚ?L•AµáÚ?ÜIçiÙ?·Ñ=.úØ?æ6ì ‹TØ?Vb‰àæŸ×?»w>&±ÜÖ?˜€” b Ö?žá÷{,Õ?ÚÍ·…@Ô?HÿHÓ?ÂÉL‰ºCÒ?‡rü<4Ñ?lcè çÐ?·\qëÍ?G©w¹Ë?š~Hí$É?xº'˜©Æ?D£\Ü@ Ä?8Êõ_yŠÁ?Q¦ÆÓ½?—Àu.b€¸?¸2£àA³?á»u×pa«?EáÌu ?Ž4ØGÿ…?s„‹ 0çÛ¿ÏO»7CÛ¿Ô"oŽÚ¿ (s·EÉÙ¿°n5ôØ¿€øT©ÀØ¿»YÅRu׿@&áéÖ¿y|^ߺ Õ¿ØÖYבïÓ¿ô¸ôJÇÒ¿¸Ã“Ñ¿Q‡î 4Tпjí&ÿƒο"ÞWˆrË¿ ºÓ±¼È¿^ã”øÅ¿…lQÀâ%ÿ$GÎåGÀ¿j_¬¼¿º¿D³n•.ß´¿IÊ‘)‚ã­¿Èõ:[8ö¡¿X·ƒßi÷‡¿NáÕø‡?"@? “ö¡?‡ƒ²—Üã­?`KGœ[ß´?_›\r鿺?šÕFüGÀ?–6pÈø%Ã?3ýÛa&øÅ?f2Ð[ǼÈ?é­BÁ&rË?'èùݘÎ?nAwJ>TÐ?Rj “Ñ?fÅ{'ÇÒ?Z"·S›ïÓ?"3¨ Ä Õ?:JyðñÖ?Û@CÇ}×?޽l²ÈØ? 1Ö«<ôØ?¿ÈÆLÉÙ?‰ uŽÚ?ÿXš=CÛ?ñD”85çÛ?§h1U÷yÜ?¢o)ûÜ?¡$AÔ{jÝ? .Ü©ÇÝ?Àö zÞ?h,_=¾JÞ?k>4¼SpÞ?®j•Y#ƒÞ?Ëi—z!ƒÞ?‹2ÿ NpÞ??ç›ë´JÞ?RN^ mÞ?Ðë¯C™ÇÝ?xxúºgjÝ?4aÜúûÜ?J¸ÜyÜ?ª |¶çÛ?D(OˆCÛ?q÷ìeSŽÚ?Iˆ.Û(ÉÙ? p7•ôØ?â9ïþ¢Ø?©ÈX×?ì¹F¦ÌÖ?Pê§Ÿ Õ?<éxïÓ?ÁˆªûÇÒ?Öõ·µü’Ñ?îàX¤TÐ?e¤í×PÎ?§‰}øÒqË?Î(£\¼È?-¡ä¡”÷Å?ZJ#ô,%Ã?'5ìêFÀ?ûÔƒl½º?J>-NBÝ´?Âõ†â­?e=õ—¿÷¡?~¤R̈?³Ã r8Þ¿ é„ۆݿ%”¥5ÃÜ¿"׉ޅíÛ¿NÄS2ÃÛ¿æ UÚ¿åWËdÕÙ¿*b^åð׿;¤v1ËÖ¿€5èÎn—Õ¿rª­6[VÔ¿ó~±¼Ó¿zü3a¯Ñ¿üFÖ Kd™™¹Í¿œø£Ù£ÊÊ¿ts‰)(ËÇ¿ãÚÿ¼Ä¿R .P ¢Á¿Hœ™uø¼¿w™lšòš¶¿™ÆŸ“~/°¿ÔÐÔ;t£¿1YþYÿô‰¿º°‚|ö‰?”:mg}t£?C¹ ®/°?úÑ+ã!›¶?ðÁû£¤ø¼?&ë­$¢Á?/†Ñ½Ä?{ý=?ËÇ?ãß䋺ÊÊ?2š/ÿ¯¹Í?´á+((KÐ?%CÖk¯Ñ?ÈC¦OÇÓ?õ9—eVÔ?–#êx—Õ?4©D;ËÖ?ƒXŒÖîð×?åGœ}ÞÙ?l¼!0^Ú?.íøkËÛ?·ø –íÛ?o—Ú\ÃÜ?OO! â†Ý?ÓÝáw8Þ?;cGUj×Þ?_]Wcß?Kt„«èÛß?Ìq©ði à??a)_íHà?2Ö©£egà?v[ò¿{à?L• ¼ï…à? ¸î…à?ˆ¬ëç¼{à?d’ƒ”`gà?Ù{NæHà?RÒéä` à?,NÖ³ÒÛß?öU¨=cß?8”·M×Þ?{ „_W8Þ?È4×¥¾†Ý?££YŠðÂÜ?2U‹çeíÛ?¯Ij‡¢Û?©ÙË4Ú?èª~XµÙ?Þ;¦­Æð×?Æ:ÂÅËÖ?¦’Æ¡T—Õ?þÕÔÖCVÔ?àu¨Ó?Po€GN¯Ñ?´| KÐ?­;ZÍl¹Í?^°0aÊÊ?.“6µÊÇ?BKÈ,2¼Ä?Vøì® Á?)¸‚ô¼?|Q'd—¶?}tš›$.°?ž€u œv£?صKø(Š?ç_/Aà¿1Ó˜TÃß¿ ¿´ðÞ¿¶öŪþ Þ¿îP-ôÁÝ¿/Ó4—Ü¿¶Pa#"íÚ¿‘Ò{ÁÙ¿X‘¸…Ø¿1ó":׿G,ön©àÕ¿Í¥ ÆyÔ¿P‘u CÓ¿v••Ӈѿñ¼®£êùÏ¿Po|ÒÌ¿e RFy˜É¿5?QOÆ¿|S&í÷¿A1…U&*¿¿q„ù9Q¸¿¾§‚KNi±¿x)ƒBKí¤¿ÞÒ0kGì‹¿”š†ÿÖí‹?¨ƒ ¯í¤?p L€i±?ñõ/”kQ¸?Œ¿Ì´W*¿?|G"°øÂ?cèU­,OÆ?ä/5l‘˜É?HKê-ÒÌ?%7AúÏ?¦Íx‡Ñ?À2‚NÓ?#·”àÑyÔ?h›Ãs´àÕ?MQðä:×?×õ/*…Ø?·%ÁÙ?µ5ûê+íÚ?Rs­o Ü?3 ×áÊÝ?$`› Þ?#23ú»ðÞ?³ÞÙ[Ãß?!iRg2Aà?”­‚°–à?€f©ƒóáà?âcþÌ"á?¸3£ñYá?¼Biâ©„á?jG½íp¥á?êž¼ÚU»á?üÊú&KÆá?íðJÆá?›/l’R»á?ZÚtk¥á?›¸t9¢„á?l©h Yá?Bµ¹Á"á?Ø4oåáà?~Çäm –à?Ö~™v Aà?ó9×?¢¶ÿ“àÕ?ù°ãYµyÔ?hLä6Ó?†èòû†Ñ?ÂÆy#ÞùÏ?‡}A±þÑÌ?$5@ñ9˜É?d¿dNÆ?ÍÕ5öÂ?ÒlNö"¿?·JRµ:J¸?¦©°ãîf±?î %ñ¤?¦]šæ|$Œ? mŒaῳB½hûà¿ÜUq1̊࿦hêûà¿&±L‡ß¿ãïä~êùÝ¿ó+ìòÐÊÜ¿òO —õ‰Û¿Y0M8Ú¿ç/cpÖØ¿nAUÇd׿°ËNÂåÕ¿¾?dÃWÔ¿Dc ;õ½Ò¿†¾[˜Ñ¿¯f^<_Ñοm¡ÆÎŒ^Ë¿mçB6ÙÚÇ¿µ'YRoHÄ¿æz$ƒ©À¿( éO º¿l›£1ž²¿…Õ·Œ`¦¿tÕ\í¨Û¿R³aKÝ?,EŽ9õ`¦?1:ež²?ïîÆKÔº?Z$÷œ©À?–î‰HÄ?_ö±ÉòÚÇ?9$ë.¦^Ë?˜Pœ`xÑÎ?êÿñs¤Ñ?Ãc-ƒ¾Ò?^ïÏWÔ?²T7«åÕ?¼QhÓd×?#…êà&ÖØ?bov)8Ú?ÄqÍpŠÛ?WäÎsÛÊÜ?ª‚œôùÝ?«‹eûß?]Ãà?·o…Њà?† Ãlûà?ÛEÉaá?6os˜ú¼á?¨û2Ít â?ÎKûÃÌRâ?ºy¶×Œâ?˜V·Öq»â?‚’Yd~Þâ?7ÊK¿çõâ?°ÄtŸã?Þ®lHžã?.‡9äõâ?›9xÞâ?v°’i»â?Á(¶ÍŒâ?Pü¹¿Râ?þç!ge â?†ÜEêè¼á?þ8Ñõ{aá?cÍWûà?ɲ²¹Šà?ŽçôÝçà?ÆÁï'^ß?´Õ‘_ÁùÝ?ÀÕ ©ÊÜ?8V/ЉÛ? £»ü7Ú?E6ÿÕØ? ǃ±d×?ú»úÔ÷äÕ?úZb¢¾WÔ?ȯ|Äú½Ò?x €¨Ñ?E´,?”ÑÎ?—û­iÈ^Ë?Ù”¿AßÚÇ?àÄ8GÄ?Z¤.kS¢À?x-ÇÀñ¹?â9s›²?/}ý¼'d¦?Ò¢½/DRŽ?ñœïg|â¿Ftÿ`Æâ¿Û>G2˜á¿æÆ%Abá¿n:ˆà¿@}Ƥ¿áß¿ôsvaŸÞ¿?Ú*} JÝ¿ì10ÏâÛ¿«tB)KjÚ¿ÖpÁ|áØ¿í6#ÏUI׿'‹uÒ¢Õ¿†P…$÷îÓ¿ˆn[ªÐ.Ò¿‚ØCjscпÕKìcõÍ¿)áÓ_É¿‡Œž…’Å¿f(¬¸Á¿ì®0}ʧ»¿òÔd.ͳ¿¦O߷̧¿¾àE•Á¿/ô©KÃ?:x[6%ͧ?_ödͳ?!٥註?R¬Ø8ǸÁ?{  ’Å?‰è*_É?©9îÍ?;àŸ€cÐ?–ÁÆ¿Ý.Ò?>)!ïÓ?dzX<ߢÕ?µY³fbI×?›$!‰áØ?|åOWjÚ?ûVÙÛâÛ?œpÇ,JÝ?Ø!¤ºlŸÞ?`Í+‹Êáß?8f×Z?ˆà?¶_PDgá?h Üò˜á?ŽÜŸÖÊâ?ˆ"·l|â?ºã¸ ¦Ýâ?FaŽ>3ã?bó¹ ÿ|ã?f»<žººã?FúF-Kìã?Ä„d%’ä?¹]Ø…x*ä?Ï1ãïî6ä?°_f°í6ä?¢œçÄt*ä?æµúÛ‹ä?dËQBìã?Í1ý#¯ºã?¾È_ëð|ã?xÂKÃ-3ã?†¨6“Ýâ?&?æ#V|â?ÓUgœ²â?]-d¾ë—á?¼‡8‰Ká?Owœ¬"ˆà?S˜§áß?ÌÕÛ3ŸÞ?•ØèõIÝ?Béb_©âÛ?+ó+jÚ?NöûeáØ?Ð2óII×?-|èúÓ¢Õ?b¸Sq ïÓ?æ\Îø.Ò?}ãÙ[ºcÐ?ÂPèÍ?r_q…Ó`É?ÕÔˆ–Å?ôä§®´ÄÁ?’½"Ú¹»?ö MÔϳ?g“^µƧ?nÚÁƒæ'?JÌÑ3áã¿Ü*ùæã¿>íâ…"Ÿâ¿Âîjââ¿®AfÄzá¿Û÷ÞHßà¿l¶Ž!¯4à¿´]k‹-ß¿WóâVރݿÓuÝ1[õÛ¿ÍKžâ™UÚ¿yB¾Ñš¥Ø¿žy lhæÖ¿W3~Õ¿Ä)¶ŠÁ>Ó¿jÞdŽXÑ¿¯UûPÏοy5xŽƒÚÊ¿u·O'ÕÆ¿äò)¶Á¿´REgE½¿Ö”oÃTõ´¿¥oa€ª0©¿VˆN™Dοj]ºS)Ï?©½`Æ1©?`‚Ïõ´?ßÄÁ- E½?$Âj†ÒÁÂ?JŽCÕÆ?=娟ÚÊ?3éýkÏÎ?·+Ë÷›XÑ?Óø”JÏ>Ó?¸¹E$Õ?¯ãuæÖ?;ä訥Ø?m°Âý¦UÚ?ÐÛhõÛ?=ëüêƒÝ? }âë9ß?Ì»*µ4à?¢Ùb»Nßà?õ?Tp€á?vï»|çâ?‚Um»'Ÿâ?‚Ò¯çëã?7ÍÑåã?¶@Î÷ã?Ãe¦fRä?C˜5v ä?GO˜Íáä?Þw6÷Bå?«c%|·=å?¯ïJXå?H“Ceå?‘ÚÍAeå?\ç@VXå?»Ö°=å?<õ5Ž9å?eÓúÑÀáä?„àg ä?åãúlTRä?̱¶L¹÷ã?çšž–Íã?$KãÐã?ð§šE Ÿâ?~ÑÝÈâ?FÎ_á?xúU°-ßà?Ê{¿©”4à?,Ãã üÿÞ?}œo²ƒÝ?êÆ”+7õÛ?p8=€UÚ?z¼2lŽ¥Ø?^1\ÒlæÖ?o½š~0Õ?69§`ø>Ó?J"âíXÑ?÷vÛëÐÎ?ƬÖÉ”ÜÊ?I`ö­¡ØÆ?–üfÇÂ? pŠÌN½?¾rÞ±Pø´?üÏ% D*©?‡¨?˜úä¿4Íú%õ$ä¿Q¡gS`Ÿã¿Hvn± ã¿AÃPBpâ¿@MitÇá¿ åË®á¿ü)£^aUà¿c3€Qß¿tzvÝ¿÷­4ù¿Û¿xº°ÁøÙ¿« ­…!Ø¿dŒ*Ëg;Ö¿ËÌÖ“GÔ¿»þº>GÒ¿yÎw¢;пU¬NåLÌ¿U 9WÈ¿áŸàÏÃÿlÅ>ñ/ؾ¿~¯PDº¶¿Ð0pK‹ª¿±Û†µ‘¿£œ;…u¶‘?ÏI¼Â‹ª?s—Õõ¶?œ4èbkؾ?;R%„íÃÃ?ðoÁtÈ?cÄ×L%LÌ?ìið±;Ð?’â›LGÒ?¿dE¢GÔ?ûgTv;Ö?!‚)Û“!Ø?>p ·ÏøÙ?ð ·ÀÛ?‰·"!vÝ?G{„Áß?¤÷gUà?¹Îì?µá?±!G]zÇá?ɈÅoHpâ?º„[· ã?t¿%fŸã?†lë–ú$ä?FõÕ©"žä?s8ˆ„“ å?ËâC jå?¼ƒ/L¼å?f &æ?’G[Ùm8æ?‘áUbæ?\(½ÖÆ}æ?øp5­‹æ?’ÔØ«‹æ?z1‡ºÂ}æ? BRgúaæ?d»Œúc8æ?o·æ?i>uÍ;¼å?¼Ì¡öiå?щ Y| å?0Q–ðžä?‚£qÜ$ä?•‹QËDŸã?³Øž“ ã?ò®#pâ?¹ê(FTÇá?Zuï¥á?—É/DUà?ÉÄ Îß?йG$èuÝ?üO(­Ù¿Û?tJ‘5±øÙ?,Ÿ­&ˆ!Ø?õö¶C‚;Ö?ÿjBÍGÔ?"‚9| GÒ?Xòïp<<Ð?2› )ÑMÌ?MhtÓÈ?‘SêÅÆÃ?–¯Â¶ØÜ¾?ª‰–¶?^û½þ‡ª?ìÛ±Q½£‘?O1îI£å¿È¦Í"$å¿\.×ñ—ä¿a&‚ ÿã¿*ªÔYã¿Çt ‚«¨â¿ìˆoÿìá¿ê¦cìH$á¿úÜ#uþQà¿JL –FëÞ¿‡uù¨~Ý¿N§•²ÀAÛ¿CV3SÙ¿Å£Ö”U׿{xìxHÕ¿úHlPÈ.Ó¿æø¼ëC Ñ¿ÉR:–{²Í¿yA¡@É¿ô^/¾Ä¿œvt/À¿—0*ñ|-·¿·?Ú‹Û«¿j3[íÛ•’¿m-PáÔ–’?(;œ€Ü«?Òf¼»-·?>y“/À?1ʧøM¾Ä?Òày=@É?Ô¿òQš²Í?k-b8S Ñ?îPéˆ×.Ó?¾’3‡HÕ?Ð K›U×?Í$>BSÙ?çxÏAÛ?ŠGƒGÝ?µ;œUëÞ?!÷¥•Rà?ÖhûðO$á?Ötäìá?$6 C²¨â?ên²ÚYã?‡Šèíÿã?è{ ø—ä?T¯É($å?ñ˜ª¦O£å?´þ 9æ?ËoNNyæ?Ó(¢Ïæ?wìK[äç?b}èQç?ßÁ³Š}ç?·{°šç?MÌF©ç?c÷-E©ç?#ƒ}Þ«šç?¯Ãô™ƒ}ç?üÞeOÞQç?§w·ÞÖç?êV ‘Ïæ?ßy‹_9yæ?>“È)æ?i žM2£å?ÖÂ,$å?žx{Ò—ä?•,¶ëþã?~¸Àw¯Yã?ˆ)Hø…¨â?^Å”ôÛëá?&š¯Ö%$á?ûeÌÞQà?,ˆ4ëÞ?j.¼VÝ?+ô9¨AÛ?itŸÖ.SÙ?öiõ‘U×?èKhªHÕ?d}éÉ/Ó?¾ÒõÖÅ Ñ?\#.<ß³Í?Öà ãÕAÉ?¹·ˆ™ø¿Ä?ƒ-øŸ¡0À?rþN©Ÿ.·?°/òÌ`Ú«?[¨æø_Ž’?ͦ¯W›Ÿæ¿jg}©æ¿p3:Ĉ忿š‘:èä¿ ç\|z;ä¿¥{á@‚ã¿lÃ…ý¼â¿«:eˆ,ìá¿ fíßMá¿0-Õ%é)à¿•÷“âsÞ¿~o°þ—Ü¿¡3þ®ƒzÚ¿–ŒdÙeØ¿”|v¦@Ö¿i•eÄxÔ¿,è¼zìÏÑ¿•ZoàÇ Ï¿É„fÊ¿Ìwí°Å¿×A.1ìÀ¿É´ç:Ã;¸¿¬Býc ­¿ A£•n“¿¶<í˜o“?#§Ë’å ­?ËJ%ö<¸?À#€QìÀ?¢/1°Å?·{À²°fÊ?R‹Þõç Ï?àŠÖvüÏÑ?“F`¯ˆÔ?y>3M¶@Ö?-XÙ™*eØ? |‘U“zÚ?aÍ臧Ü?r}šJ(sÞ?_zÇð)à?qlUá?¤dµü3ìá?¤öÞ½â?Ï€ÖIG‚ã?t6Í”;ä?€õÆ‚Aèä?Mô’ˆˆå?ý©°æ?_a­¡Ÿæ?ð)¶eŸç?(û­Ò_ç?5P W¢Ùç?µ:ìD/%è?¡˜êÿ×aè?ÜÞ­wè?¨é¸hð­è?©ƒ{1½è?-¶š¹/½è?ô>v=ì­è?Tspè?ý0*½Íaè?ü!‡!%è?¯·÷¶Ùç?ýSÚIç?mtœ„ç?%a¢®Ÿæ?õŸ%­Šæ?°Mªöñ‡å?8„átèä?SqµGO;ä?nf;^‚ã?~}´Ѽâ?û ¡,ìá?t†S8'á?èM¨ÅÇ)à? YœÉãrÞ?¤Ã¾sÜ?Ù$x³szÚ?6VÞ"eØ?Û¼mÊ@Ö?c6'_¼Ô?†¹âQÐÑ?õ¦FÒ Ï?TOrÄgÊ?Ô“Ù;±Å?n¸ƒ¨ÍìÀ?nóA“<¸?®Q„Œ ­?ŒB>Æl“?k-táN’ç¿ãÙ7ÑÊ翟!Æ¢oæ¿ãRÿ…„Èå¿<§*3‡å¿cgœ«‰Sä¿@õ†ã¿g0Ñq¬â¿¸”‹m\Çá¿X²P×à¿&ùI˜Á¹ß¿!ipR±Ý¿=m££’–Û¿ÇàvÏjÙ¿ºjU_/׿Ûyk«¢åÔ¿¤O—¶Ò¿Œ·d§ð,п“r¹zÉË¿bM ¾º˜Æ¿Byƒ\¼¡Á¿¥tYc¼?¹¿ÍŸö8ÛX®¿d ?”¿xì?@”?mâ bY®?Ý]6Àÿ?¹?rkÞ¡Á?‚/VܘÆ?¢§|ëË?|Qa-Ð?d\¦dÒ?øÑ“K³åÔ?Gð|åo/×?ºÌôßjÙ?= £–Û?˜Ò1kb±Ý?WFÎѹß?j‡]X×à?/ hdÇá?ÇþL¸y¬â?í÷uÆ †ã?(d‘Sä?«kÏŽå?)ì'ŒÈå?9€/úoæ?W½UþÑç?ê™ÝU’ç?„ ()Pè?4¿ùht{è?:]×JÙè?õw·Ë6(é?i5N[jgé?L¬¸ùò–é?3‡,O³¶é?Zؽ—Æé?CÀ)l–Æé?¬L¯¶é?í+Ûì–é?!<ÉU`gé?ŠÌ3)(é?û£Å‘mÙè?·Á1ß]{è?H. 4è?ƒÔ¶f3’ç?mJ¦¨ç?cdѵénæ?´ðÄUÈå?ÇS;ÏSå?qKTSä?×ôqÍ…ã?žâH†>¬â?ÄÓ3-Çá?!¬ÿ‡&×à?‚0£Ü|¹ß?Êâ ¥±Ý?(¹ps–Û?„žX‘ÇjÙ?~Ýžq/×?™ô=ÑåÔ?tܯMÒ?ŽúyT-Ð?©—æ(¬‚Ë?ug)F“™Æ?ÖC¼¢Á?€0óy@¹?Ò˸bïY®?Œ"Z¹@”?õîµFªzè¿!§ÛÉÐêç¿Ä ˜+7Lç¿×ÇB' ê?bljscÎé?BôŒC´lé?af´Uûè?›Ò¥Œzè?àVNV«êç?4*}fLç?^ÌõПæ?_,áäå?.÷þÛ¦å?–ZE6Fä? Îu$Gdã?V]?6dvâ?úfÉ}á?Úoyeyà?ÉÇ»¾ÕÞ?˜Œu¼T¦Ü?»#äáAeÚ?>÷éØ?6 ¦Pº³Õ?m¥o(FÓ?ÜÞÎ{°ÌÐ?Á ®Ú§‘Ì? ô´ 2xÇ?"×5ÐOÂ?ï#ý½x9º?`óY×…¯? ò° •?h¥:üWé¿C(ü+Ãè¿ÝŸÚè¿$ß]ÚÆkç¿OÔLAªæ¿TRQÁÚå¿5°í߯ýä¿*œ BÚä¿®ó#¼‹ã¿>öÐ5sâ¿ñUûÛ/á¿ÿËJ}Ïìß¿õâÕŽ©Ý¿jÅýTÛ¿&¸Ä{œíØ¿¹c"<ÖwÖ¿÷´£¤4ôÓ¿LÈq§DdÑ¿ù4G›5“Í¿Vñ‚{¤KÈ¿Šh|õ¿ø íв%»¿¦G2€xP°¿è]k¹Ä•¿†bDYÜÅ•?¾ó}8ÁP°?_-Õ‚û%»?fw†Ð;õÂ?.ÉÈKÈ?3‘šàY“Í?ö¨ ÅVdÑ?@ç9¼FôÓ?ò†«LèwÖ?ÿ$'„®íØ?l*üTÛ?׬tÉ ©Ý?BG¶eáìß?ÌckÉ8á?—°¢|â?:ée™”ã?ø°ãä?­¼»¨Ïýä? ¯ ÊÚå?MÌ’ûIªæ?.ÛYyÏkç?‡È,ãè?¼±¤Ãè?šn¶™Xé?VŸO3QÝé?†º9ªRê?ïuÞKÇ·ê?G j ë?Ñ<•A^Pë?¤öåzƒë?"·¥À¥ë?½g´¶ë?ôh_³¶ë?Që—š¥ë?mN¬„tƒë?óVPë?o•^ ë?:g­³··ê?¯U­E•Rê?1,75Ýé?åú£vßWé?¦°ßæÂè?¿’@W¥è?ò\ °„kç?Ö»oÚõ©æ?ÈýarÚå?9fLxýä?"±Jpä?¸å,”Fã?^ï[5â?ˆjWªù á?q/Quìß?öY5ŠH©Ý?¸öÍÓSÛ?Õüm…íØ?ähiÚwÖ?Üÿ†ÀUôÓ?|Y‚dÑ?¯¾Rà“Í?ÖßÕdLÈ?6#™_oõÂ? Mà/Í&»?0.1&¿Q°?–ÏĤŒÊ•?Îx½œ)ê¿MãÔÞé¿ÄME]æè¿øÕ!€-è¿ôÔ÷â¹eç¿Lü1˜…æ¿aRô[g«å¿½>Þë¹ä¿8³ ¨»ã¿ºâd¸8±â¿šØ1B›á¿¾nôæoz࿤HïçžÞ¿2¦ 6Ü¿cd ͻٿ UÕÇ­1׿Vmüy@™Ô¿¢}HüôÑ¿Óþ¸ÓՇοÝd™É¿žÿÛ$å‘ÿތn7>¼¿²ÓIi×°¿˜,¹àÆx–¿s´T|ôy–?@Sœä´×°?±÷“™‰¼?Љ‡Ó ’Ã?ŸCt¿É?†ø{û‡Î?ÉmÍ1ôÑ?RÐ"HS™Ô?Ó|’À1×?Çaçß»Ù?å©R 6Ü?‘¬úžÞ? oByzà?â%ŠK›á?›ö B±â?¸ñ]±»ã?ÁsJ*õ¹ä?š £p«å?d£ÁÙŽæ?Õ™^Ãeç?oº}U‰-è?ƒåIfæè?MØ{øçé?„ÚÖ¥)ê?“Ö=A³ê?hŒìÌd,ë?4xOÆ”ë?-8%ìë?¦|E¢K2ì?àTØFgì?æÔ—LŠì?˜—Ïð›ì?OvÍð›ì?ä'JŠì?³ gì?oè‹3E2ì?ä ìë?nkJ{¹”ë?”áˆæR,ë?}tfî'³ê?êTG‚)ê?Õ›üõé?4_!æè?/Ùþ/-è?À†ûV[eç?!œÈK#æ?Î:Üì«å?zTªd’¹ä?ØÜÛU»ã?æ<{î°â?>T(u›á?î‚;I7zà?JŽˆƒŠžÞ?÷yËÆ5Ü?wh$ž»Ù?äe]›1×?Ö} ’N™Ô? ÅîRôÑ?— L=ˆÎ?ÒìÉð‹É?rç˜U|’Ã?>¦½mǼ?(žXYÙ°?Nñ‚[ß–?‰wíîê¿÷©î ¨Pê¿Y!î'¢é¿¬"g¹Øãè¿TÅ|Í/è¿þÛ©¬9ç¿xõˆRÕNæ¿êÐ'˜ã¿Úé¦{ â¿fIHí¶ö࿟ÿP*Ø…ß¿ !¹ŒÑ Ý¿à£V¥á}Ú¿¿’#›à׿¢XÊš4Õ¿<ˆq†{Ò¿öC™nÏ¿ÔÙíÖÀÑÉ¿é¯2}%Ä¿ÐÄ4x™Ù¼¿Æ=‹mV±¿lŽ£ã@"—¿\­E3y#—?CŸ»V±?ÃO9ŒçÙ¼?Ó^"<¤%Ä?|ÉáçÑÉ?›SÏ ?nÏ?V…°ö™{Ò?»µO®4Õ?ôëߨ®à×?È©Á*õ}Ú?ؾNå Ý?½ð$°ë…ß?jæ_°Àöà?|»? â?-<«$<>ã?>òæ„Pä?rî]FVå?É­qßNæ? 1×ǵ9ç?ÐN–9è?سO„âãè?[ߢ»1¢é? יݱPê?ƒ-mK÷îê?”•h |ë?L_õÖUùë? š«¬Êdì?‘¢l£¼¾ì?€>Aôí?á²xúD=í?êÙäLaí?B®ÛÓ¶sí?z *U¶sí?SyrÆ‹aí?ä9ˆJB=í?G0Õ%ðí?Rª¨¶¾ì?èZŸÂdì?£œx)Iùë? ùøJ|ë?^íî‰Ùîê?J…r‚Pê?-•æ¡é?“Žrsãè?®|]ß³è?¤Ð09ç?—R­ïaNæ?×À©$ÓUå?²Û9Pä?4ïlÛ=ã?xîj•½â?¹ñröà?o¨m‘a…ß?žtZ›o Ý?T6‚—}Ú?] WÀlà×?Öü´â4Õ?M÷•¼®{Ò?‘t²€ðnÏ?X{?ú&ÓÉ?oT<Ÿ&Ä?œßà½Û¼?÷îCNX±?…‚ö²ö)—?„ÕÿY§ë¿hexÕØë¿VŽBÕ­Q꿳ñ~GŽé¿!ôT»è¿¶K’´Øç¿X(2Ù•çæ¿ÿkßVèå¿É·•Ûä¿€ºM(öÁ㿼çÚ'œâ¿‹úhYßjá¿•‹ÃêØ.à¿.¶ë®ÑÝ¿j£H3Û¿¬7¿„Ø¿4MA¾ÎÅÕ¿¬v0úÒ¿†~§"пx¢Œ‚Ê¿dJe¢p¯Ä¿6+¾œ%Ÿ½¿dW%ͱ¿­·~ü§À—¿WwëÁ—?$çßßuͱ? ‰™bvŸ½?¼FÕ™¯Ä?ôªrù´‚Ê?Iµ»"Ð?kqÅi)úÒ?Òæ…úâÅÕ? üþ.„Ø?M0ÎV\3Û?üáÉ4ÃÑÝ?)‹!ã.à? „éjá?ÿ|I 2œâ?†¼[Âã?š¬xFŸÛä?»Ý«aèå?Ë⟠çæ?Æ5Þ¾Øç?Р¿ª(»è?¤DÅßQŽé?\ C¸Qê?ÄfŸRãë?òpd§ë?†´ö¿×8ì?ÚĘ1ã¸ì?³<ì7'í?ÈØä‘ƒí?±D'¸Íí?<½ú÷|î?༼ò½*î?¢õd=î?Ÿð¸ôc=î?.'Äv½*î?ä8Ù|î??ÕmÓ¶Íí??îÇäƒí?À‡Õ4'í?:?²$Þ¸ì?­VÜÎ8ì?Ò¢¡S§ë?„"ÝÈÀë?.%IoQê?YZÂ3Àé?&Znºè?~„Øç?ÚŠ3 çæ?QÕ¬ÖÝçå?àm ã'Ûä?\†¾æ’Áã?Þ”„¤Í›â?/Luàjá?ŽÎâ9.à?jàÍÚ/ÑÝ?cç3Ý2Û?ú³lȃØ?\¯ÏŸÅÕ?j`m úÒ?¯6Cg!#Ð?’ „}ú„Ê?-”¤»±Ä?2ÓPË¡½?E¿#Jîα?*g­£æÇ—?º†È/XRì¿&÷&2ê«ë¿°jUkôê¿‚H•ÄL,꿟Aë Té¿Ö)(l迉t—6uç¿®“Ô?Ío濚›œ\å¿òPùX!<ä¿P÷U:ã¿|â&’Öá¿þXÛžé’à¿@Þ׳ŠÞ¿,hÔƒxÛÛ¿òuø²Ù¿ÿ oLÖ¿—gšjloÓ¿åNtÃl†Ð¿û•œx&Ë¿vÝX/Å¿ê_·§NV¾¿Hê/E7;²¿mˆr€…S˜¿ñ›61ÓT˜?À㣴Š;²?tз¢V¾?„úÎÝ/Å?ðŠ6æ¡&Ë?“ øª†Ð?XBWoÓ?¶ƒÐ„LÖ?ЮêÇÙ?„†ÛÛ?ª¿%ŠÞ??r?*ô’à?*õЏœÖá?ø$ËîDã?ÊWú+<ä?ÓNG˜\å?"Ÿõ×oæ?6J`CAuç?ïÄù2lè?Þ_ÌTé?”k\¹W,ê?ìø9avôê?_ Yõ«ë?4Q™vcRì?óÊ=Zçì?åH0Z}jí?w>c|Ûí?7 º‚:î?ºæ„e†î?ÿ!8 ¿î?j¥¯ÃGåî?ØGσaøî?B¨Lµaøî?–^]Håî?ÀqK!¿î?%Î †î?¶ƒ”è:î? søÛí?uuÒÎjí? œN _çì?ФBíhRì?2Q…ô«ë?–¨ÐÛQôê?¦Sœeƒ+ê?RúZGëRé?2•dkè?Ìàžtç?¸AV{Hoæ? ÆU!\å?ñò<ˆ²;ä?ŽH)Ôã?íü3Öá?¨å1)“’à?}Š¢r‰Þ?·µŸøèÚÛ?´"k³1Ù?ÞÆmLÖ?^¢‹`%oÓ?¿EqN¦†Ð?\xE,Ë?›Œã<«3Å?ÉíŨW¾?§3_Î<²?rã*âX˜?T?Ochïì¿Ñvm_Eì¿Æôæ‰ë¿rÊ¢•r½ê¿ÈwVj€àé¿ÇÅÞµ˜óè¿ß`š“M÷ç¿*Äoœ:ìæ¿.¦×†Óå¿Æ0HÁX¬ä¿üª?íxã¿ñ‹0ñ~9⿚”Óîà¿{6×Bm3ß¿všölõuÜ¿|ð¦Ù¿¹ ¾ÈÖ¿è†]ˆ4ÛÓ¿ï8áVâп‡£' ½Ë¿Çäª*Ԥſhóà‹þ¾¿JŸÙQ ²¿æÛ§ÍkÚ˜¿ëp¡ÄÛ˜?žŒò§ ²?)jìâþ¾?k£hCÿ¤Å?ôQAJ4½Ë?ñ¿oî&âÐ?äç‰'JÛÓ?éœFf.ÈÖ?8QíͧÙ?D, vÜ?ø ƒ3ß?s~4nÞîà?.õûè‰9â?"m| øxã?<ùkÏc¬ä?L}’¢Óå?Lw¹ÇEìæ?³ØÂÐX÷ç?ñ¡¤óè?PŸôÓ‹àé?"[þ~½ê?´7Ê™ò‰ë?´<9kEì?Râ[tïì?ý5J%¥‡í?(¹ÆºŸ î?Õe}î?‚=³áî?ÇùudI/ï?Ȩ_¤iï?8ú:sŸï??óü_#¤ï?G¾å#¤ï?r§u¡ï?¢è'§iï?X]àM/ï?0سֹáî?Ô˜î?w$ º­ î?ââEº‡í?špzn–ïì?Ù½æ©Eì?pŽË¥~Šë?¬ÙLp¿ê?ˆiÞ¡àé?¬ó¿âfóè?ó˜g,÷ç?ßbt*ìæ?<éÙÚÔÒå?P¯¦,¬ä?ÞÝRÄxã?,¿X9â?p!qê®îà?„÷0Š%3ß?ÇSÜ«uÜ?ŸF<Ÿ¦Ù?”XUàµÇÖ?‹,ý£ÚÓ?^Ã(èàÐ?þk³©›´Ë?rõý žÅ?è@ë~Aû¾? Œ:žŸ²?ðÝÇ­4ݘ?R4‰¼~í¿ì€DXÆÐì¿6„"w±ì¿ ãñLA뿟ZN`ê¿ø÷/p¡né¿ÈB4Czmè¿NÖ‹_B]ç¿4~ß§¡>æ¿@ÞÒáHå¿ÁÿHñØã¿n¹\“â¿Øeß(RBá¿x ”FÍ߿ףÚKÝ¿öm%Ú¿âÕGn8׿îá0W=Ô¿PQ5Ñ¿2Ž" ÏEÌ¿ˆÍ]Æ¿—Öé`—¿¿“!ž)ü²¿a{ ƒöT™¿­qñ`YV™?hØ[‚ü²?x֑ḗ¿?<‚Í̹Æ?Pø$üEÌ?ÿ+‹Ng5Ñ?ìžp§3=Ô?¤Œü£„8×?À ‚ƒ%Ú?å«TbÝ?Ú ]Íß?‚ œy]Bá?¸ayg“â?Bz/³üØã?ÿ_a[Tå?Ò+ê2­>æ?xH‡þM]ç?ìmù…mè?í0@­né?Ú—<%`ê?GÖ)YAë?j¿9±½ì?|¢#ÂÒÐì?N‘¢^"~í?:„¥Aî?íêíСî?õ|ï?NËWSúyï?€@$(Éï?ÛTàDð? /»"ð?ÝÜè ð?õ'äN ð? ã>÷#ð?Ç´×Gð?äñÉï?(öEzï?ÖÆ]Šï?Þ_Åå¡î?m‹`î?vÉÉQ~í?X((šÑì?^â¯È9ì?Äúè¯Bë?îg`ê?Üκ‹yné?AÆÁ2@mè?`…9@]ç?‡“`d>æ?‹`û å?üuP¹Øã?Ä÷ì&“â?ÎjjBá?‹#¥ÜÌß?¶›{sÜÝ?kØ¥†ï$Ú?*“-!Ò7×?”rFÁ@<Ô?ýZšï3Ñ?ŽVsÓ€AÌ?æÊýƦ Æ?ŒS†S“¿?ˆmú¸ú²?‘k£¹V™?l¢ÿ^öýí¿ýä)„·Mí¿˜è.f‹ì¿Ëz·ë¿@ ëuÒ꿤øçÜé¿ «ðád×è¿VÏ«Âç¿8Ö,'Ÿæ¿¿ &¦må¿4/|Ýÿ.ä¿Ö*jüæãâ¿>Ëq§'á¿ÿl@•+à¿6wa¬€Ý¿2½#<Ë–Ú¿>Ó׿OüÈ1Þ”Ô¿F$îÑ¿,o fÀÌ¿-À‡4oÆ¿ …ó,À¿ŠúnzN³¿XÁ´Ê™¿ø 8Ä™?ä#ËÕN³?Kb‚©ZÀ?^Ö«IboÆ?¬Ùdß“ÀÌ?v8A€Ñ?fÊ91õ”Ô?\>Oá3×?sOD[â–Ú?"¯+ß*€Ý?ÔVå +à?rÎÛX3á?Ö™P¼òãâ?ôAÈ­ /ä?nåû±må?­Á!Ÿæ?Sœ»œÂç?xü q×è?-0YóÜé?dÁ$Y‚Òê?î 7œ†·ë?°»£år‹ì?sð¯ƒÄMí?‹aU þí?jËA‹Ã›î?Öþü¢&ï?þ SLžï?@“â:ð?'RÉp)ð?0_µ¯Gð?ëv"ã[ð?ª›ƒfð?´fð?…5«ä[ð?>ܵ˱Gð?Í9ñt)ð?ÑÒÐç@ð?dâøe]žï?ËìJ»&ï?ôA1Àå›î?(É´y4þí?£+ Ní?mF·²Ò‹ì?42+ü·ë?%Q!¼3Òê? ¥Üé?˜HÖt×è?²4·DÂç?š²úÉžæ?j@ð1]må?Æ蜹.ä?Ëå½£ãâ?z¿W åŒá?è¤ßVR+à?UgˆÝ?rß…1–Ú?à`Uhœ×?³‰û“Ô?xõèÈ~Ñ?ûâh°½Ì?õ¥ñÀlÆ?•“²–À?Âñ>e#M³?ÊÝ®ú¼Ã™?f襫nЂxÖ»í¿á‘·Õªöì¿XË¡W¢ì¿4‡œA7ë¿_öõ>ê¿ÐŸß ¿4鿦¨Ú†Úè¿‘0¢ôæ¿úˆÅ,¾å¿ºŽ…Ùzä¿)]åóã*㿨d„˜Ïá¿›¥—}Yh࿇vÊÊïîÝ¿ÝÆŸŸ¶úÚ¿ iÜÙõ׿x‚%6âÔ¿o¯U>±ÁÑ¿”<δq,Í¿{¸Ý‚ÃÆ¿K‘Â÷‰LÀ¿=¯g_—³¿`î2—#š¿Ø»%š?kùóQe—³?âcú¸LÀ?/·Íí±ÃÆ?³ã|Ø ,Í?„¹"ÜÈÁÑ?_×ÑMâÔ?»SŸ™ñõ×?†8qÎúÚ?6Óq³ïÝ?@ehà? ç¨(Ïá?ît!ð*ã?ÎÙÃGåzä?Àð69¾å?Wó$ôæ?p"çè?ÉY=¨Ë4é?7ÍÖ´$>ê?1‹Õ„N7ë?"ŸŠn¯ì?Ê‹"¸öì?ÆJñä»í?Ú§˜z¹nî?¾ùÔ=Êï?pǘ³›ï?Ôu¯S ð?ÆF`=ð?Ö¬qO-fð?jѯIÝ„ð?Ó%«L]™ð?#=>º £ð?ºíªF¡£ð?ÆÖ`ý^™ð?td@Bà„ð?çøÏ1fð?"R°f=ð?þ²&8˜ ð?[´êË›ï?l 6ëï?å4«ånî?МhÛ¼í?îº÷ì?Â<ÑŽ ì?| îÕ6ë?nº1?¹=ê?¦›ñ°a4é?†j·Ÿ~è?Qò=¾óæ?à‚‘Ö½å?ž“Í+†zä?Œ³ßï“*ã?xÅ™ÎÎá?Œ@ñ hà?V‚úÑ?-ñJj%Õ?ÉdC|BØ?´½øýPÛ?¸¿ãñ¦NÞ?¯Í‹}Ïœà?¶³ â? P+hã? võ|Q¼ä?2(v®æ?Ï×±w=ç?è•âæêhè?¤È9ÙP…é?ÄnË‹ù‘ê??ÁN?Žë?¦£‘†yì?~&/>Sí?^c«îßî?Mµå¯ðÏî?âÃÄÉrï?qÆ &Vð?ÌžžÍ=ð?õÍEè@qð?üгJšð?`O¢¹ð?)¦{ÑcÎð?J ÈØð?˜óv˜ÈØð?º§–†eÎð?6ÒÝI¥¹ð?6$ò¿”šð?`o'Gqð?'=ÙÖ=ð?LŸ.[að?í- órï?ÌèJÉÐî?œŒÞ î?­hxLsSí?÷/—W¿yì?g,P2©ë?ô/´ u‘ê?dñ˜üÒ„é?l¦rhè?ó¯¤=ç?kÅçÜ>æ?+[»æ»ä?”ìTÄgã?8µ´©â?üÉ6ßmœà?ðüë„äMÞ?Ÿ3é¦8PÛ?ôŠ4w°AØ? Ø0$Õ?d^öªùÑ?md·/4ˆÍ?¯VPÿ Ç?%ËÉÐÀ?؇…Õ³?V‘÷n yš?ÊÍPÂR!ï¿hŒA¼cjî¿‹Ç š² í¿ønª¿»Ä쿉ÎíÕ×뿇rÒv&Øê¿ì\Ó·Èé¿ RRQb©è¿× ©&×zç¿êó‘éÐ=æ¿ñ÷¼óä¿ù+€Ài›ã¿à Á¨7â¿0–´‡«Èà¿&GÓ¨žÞ¿O#‚<™Û¿Ìæ^_‚‚Ø¿R¨[ÏÎ\Õ¿¶µ}rî)Ò¿Îì¼´×Í¿´Qk¦$IÇ¿¢A68¬À¿Œ<ª¿ ´¿½‰ki½š¿‡c@¾š?v•rÁi ´??y7Ãi¬À?TNŽEVIÇ?ó?Uæ×Í?–,™]*Ò?*Íç\Õ?(ø s›‚Ø?¾F¦i1™Û?&“žÞ?Tªc=¸Èà?û…]‰µ7â?˜G»v›ã?¬Å` óä?b‡cøÝ=æ?·èÃRäzç? å<žo©è?¼ÝDÅÈé?úý4Øê?à59 ×ë?#¤d¿ÉÄì?¼TØÖÀ í?(w@?rjî?-Fy–a!ï?EF[ Åï?Æh5T¡*ð?ÅÔ D»hð?GG‹¶œð?:‹DsÆð?Ÿmã?×åð?Ÿ (›Ïúð?£wEOñ?[±ÍËOñ?Eç6Ñúð?.ÎðÚåð?‡xˆ8wÆð??D83¼œð?ÚAHÀÂhð?—%Þõª*ð?”ë56Åï?®Cã!ï?bT¹­”jî?Ãxêêæ í?ÅfR£ðÄì?œ-ÚPhÖë?ô›qG›×ê?EÑ5Èé?~œÃç¨è?²ÞÑAczç?—…3c=æ?Dz+(«òä?´H›ã?( žƒJ7â?ž€§ëPÈà?÷ ×øÞ?)óik˜Û? vž×Ø?Äú¶¾&\Õ?Xê•hM)Ò? »Aü’ÖÍ?Kî>HÇ?¥J‘©«À?u<Ì ´?IĺúOÀš?lOXýÀbï¿v …vQªî¿¯YføÞí¿ˆFB63í¿@3¬Šì¿CI–’뿚§oéþé¿Ö©¹þ7Ýè¿Þ¼í0¬ç¿²trYlæ¿>è[cå¿ð豟Äã¿Ü¿ôò]â¿÷µ[`òëà¿©5KßÞ¿Ò” ÊÓÛ¿mé4<¶Ø¿çXý5µ‰Õ¿3“˱PÒ¿Y¦^¶mο«ü·©zÇ¿M±ôBÏÀ¿ êžx$4´¿ß†þR4õš¿¨jýÉöš?Ã’‰ð‰4´?߸ü½uÏÀ?¾|‡HzÇ?úú¡® Î?Ìê×>5PÒ?U ×ΉÕ?é>×õ¶Ø?7Þ”Ÿ3ÓÛ?°Vœ@ßÞ?*“mÿëà?p4±^â?7 vé¬Äã?M´(å?f©<Ælæ?åôy>¬ç?:t­EÝè?É/(E÷þé?À0— ë?TèÜݘì?U4ôžAí?â`v ßí?¦Òd`ªî?ålL=Ðbï?¯“µlòð?QŠ6œLð?=†¬8‹ð?°†3¡¿ð?ÿ {µéð?YØ6“[ ñ?çØ#úñ?Bèñ©)ñ?¢yj )ñ?§?cñ?ˆÁÑþ] ñ?sêܹéð?Á’7ü¥¿ð?¨âÊÝ>‹ð?üYªö£Lð?´™IÓûð?å–†=æbï?È9ÿxªî?ôáí ßí?ã–UžZí?Õ?Ûì?d·oM÷ë?QV ìXþé?4æ\®°Üè?™6籫ç?<<éûlæ?´K(«å?Aü6Äã?€=ûc]â?„½V>”ëà?gÎ0«QÞÞ?f%ÛoÒÛ?$(3ÌdµØ?Ë”‘ƒ‰Õ?ƒP<*‘OÒ?µ»=Î?ÆÔ^yÇ?ËYpoÖÎÀ?è©4´?9ŽCò¿øš?ÊÓëü“ï¿ÀEZlÚî¿÷æÐÔ î¿²º_î².í¿´…p’=ì¿c ;?;ë¿ d<ΰ'ê¿C.´ì8é¿ ‚\SÑç¿@&_c½æ¿$É#V=@å¿tNw¢ãã¿·«4»Âzâ¿ÄÓ»}á¿;zGnqß¿íu{¿þÛ¿fÓ²ÉÜØ¿œcE~«Õ¿°âÊ¥ÕlÒ¿@ËZøŸEο¯Á)éžÇ¿£-ü éÀ¿ÉÕS´¿KFS™z›¿× õá!›?‰Ÿ³ïŸÇ?½çm*ÔEÎ?yl;ÑïlÒ?jD‡˜«Õ?#‚ìãÜØ? ìqõÙþÛ?Óž Œß? hZ‹á?°Âd2Ðzâ?ˆûÁ­¯ãã?Ãe)K@å?ºÈù*Ëæ?.rÓDaÑç?¡¯6ùFé?lØ¿'ê?žk_ ;ë? I¡=ì?u ¦¸Á.í?— z ã î?~`{Úî?r‹ ”ï?‰:n ð?ŽŸ{Ñ-fð?^õQ|,¥ð?5¦¡5çÙð?æ¥$z=ñ?öZ·/$ñ?õ {µZ9ñ?÷äóïDñ?_·QDñ?ÁT Ü[9ñ?î`^%$ñ?'!aM@ñ?£xÔ÷êÙð?5Ž=1¥ð?ø¾¼™3fð?OGÒð?É…&¸”ï?Ló0z‹Úî?&¨}ßò î?g/U–Ï.í?®8´Õ<ì?ôé _:ë?º·‡['ê?Akié¦é?õÇ’òÊÐç?þåñ=æ?È3äZÆ?å?ì×}%3ãã?pµBV[zâ?œ½‚á?‚"b¤¾ß?ü[öþÛ?¥y1ÜØ?¤ >™ôªÕ?0­Œp\lÒ?æÒØÂÔDÎ?>L‚˜MžÇ?T—Á@éÀ?){p±S´?2”™}k"›?àõ¸câ´ï¿º:7úî¿èf;#-î¿äS|Mí¿|X\ËýZì¿Ã“6BeWë¿ÖǸúïBê¿bñtHé¿ií.#êç¿_ÙÊ0>§æ¿[ÐÁ `Vå¿}æ?Zøã¿bžêŽâ¿e#¤:ῆ”IªÌ/ß¿F-;AéÜ¿l¿ã¯öØ¿ªGt,ÂÕ¿ ¯4€Ò¿ í¹¸(eο÷=’„·Ç¿àëî>ûÀ¿¨œ;i´¿àL.¸;›¿1»Ú`=›?ð~vki´? þ?tûÀ?/\[^¹·Ç?Rý^eÎ?„—°ú!€Ò?ð[ ,ÂÕ?®³ÝÊöØ?Ñõz[Ü?±¥2éç/ß? w¯ÎGá?÷›µŽâ?íò~#høã?tŽ2¡nVå?Ò3PL§æ? -o1êç?=åSÛVé?@QŠþBê?º#‚þsWë?gU¹ [ì?HN¡(Mí?ôZf2-î?;ž¢ÝŸúî?šBÂVò´ï?ÄŸütÛ-ð?M°ˆ_Cwð?1¿k¦ƒ¶ð?±1~Huëð?…Ö ÷ñ?’áLwð5ñ?[RâLKñ?>fšWýUñ?ª ýUñ?l.ÌòLKñ?4Nlèñ5ñ?°b¬ùñ?@Ë ówëð?Lð?®ßå9Gwð?@—ûÂß-ð?7K¬gû´ï?Å©¨úî?"MšÞ9-î?é.…h-Mí? me—6Zì?âÇÚвVë?85^ðIBê?¸=QÁ­é?ã “éç?áÄ3>¸¦æ?ÞÝìZäUå?ÀX÷Jç÷ã?$íû˜â?9i/ôØá?ð%Wœ/ß? µÂ[IÜ?Òzs\!öØ?‚Å6„”ÁÕ?téw Ò?¸ïzdÎ?®üú¶Ç? §ÙúÀ?‹„é†h´?8Á¨™˜<›?hõ·=YÅï¿0üÆN¦ ï¿Ô„·mÎ<î¿òzéP\í¿©×ñ"·iì¿@È8Ë—eë¿ï“´ó’Pê¿À-útS+é¿÷zà)Žöç¿eL÷³æ¿`×uaå¿ZPݸ俯0Š`¥—â¿.qw!ῲUb=þ?ß¿Ì?µ±*Ü¿tß1¦Ù¿·TX]ÍÕ¿ V¼F¢‰Ò¿PqÐðtο8_1hÔÃÇ¿M™WÛÁ¿îr™s´¿ýJÎSØI›¿PLÒ%ŠK›?(Ù÷t´?z£Ü.FÁ?/¼Õ ÄÇ?¿bÀ^'uÎ?Ò—:£½‰Ò?åXÎxÍÕ?QÇøÄÁÙ? >Ûg*Ü?ö‡Y@ß?ë+P{(!á?{MÚ|³—â?÷?4Çä??Ì#Vƒaå?ë8åó³æ? ²“Àœöç?ÌŽ1b+é?²ðˆÙ¡Pê?ÚÞ¦eë?…æÌfÆiì?&[s`\í?«è)"Þ<î?ÃøD¶ ï?Ô‚ÉziÅï?ú~5QB6ð?qrVÐð?\ ²p1¿ð?®T(Š>ôð?ÀëÖñ?Ì5BQà>ñ?úü{ùFTñ?ÃÀV²ý^ñ?ŸeÓàý^ñ?òuÝ„GTñ?#Éé8á>ñ?¸ŒV-Øñ?8V‡@ôð?mÃL3¿ð?‰Âó`Òð?vÓ…aD6ð?2ß)mÅï??ϸ ï?¿{œÞ<î?´þeO]\í?ˆÑÖçhì?÷§CfÝdë? ìjåOê?flƒñ±*é?Qªc$øõç?ªˆ€v²æ?'9çÏô`å?v·x-Cä?ÂÙã:—â?˜ÈZ]¹ á?U­ûP?ß?̲Œè)Ü?Á0ä!Ù?òPmîÌÕ?ØÃý G‰Ò?¸î"ñ`tÎ?—{‡“_ÃÇ?êðð,¡Á?U³ˆø“r´?fEÞÊíE›?W¾aUÅï¿Þ2‡¢ ï¿nr£¼Ê<î¿HàôõL\í¿’u¦³iì¿sÔvl”e뿎ٴPê¿f^XP+é¿c)÷0‹öç¿k§å¬þ²æ¿Áé¢Vra忤Ï#[¶ä¿ÐS2 £—â¿èáL!á¿Tö_Bú?߿¬:~*Ü¿¼¯Ló¢Ù¿ºoÌ{ZÍÕ¿â”ÍŸ‰Ò¿ gȦìtο8fú ÑÃÇ¿½ßI Á¿Ñû4ë•s´¿Mãq©ÐI›¿6.g]‹K›?¡æ$ªt´? K»DÁ??ÀX–ÄÇ?ú;W$uÎ?×á>¼»‰Ò?ˆ…vÍÕ?9¿Ù?bÃÁaš*Ü?l:ĸ@ß?LÞ&!á?°E]t±—â?þ7ðáÄä?þð“û€aå?Ó“r ³æ?wšöç?›Ûg_+é?üI†ížPê?Jû Ñ£eë?—#•;Ãiì?/»Ô¾\\í?Ηp½Ú<î?´O`IJ ï?ÙÁæàeÅï?How@6ð?ÝoÎð?ÿf }/¿ð?ߟӈ<ôð?"¯ªÛÔñ?_Ë0Þ>ñ?8´SÆDTñ?ÇÌYiû^ñ??Hæ}û^ñ?ÕƒËETñ?¤SR‘Þ>ñ?ò©¸XÕñ?š6…=ôð?dI¾0¿ð?­î#ÓÎð?W¥ˆ@6ð?l+ÆàdÅï?µ‹8û¯ ï?;Í–[Õ<î?ÂÏS\í?xL•KÞhì?È}±Ôdë?6¤kŽÜOê?lƽ©*é?+%Âðõç?¢Ò6!p²æ?¨/zï`å?êöa?ä?ª{A7—â? 2†¸ á?Ù…s.Q?ß?è¬~Áì)Ü?WãbÖ)Ù?}àßùÌÕ?t;BW‰Ò?² ·Ç†tÎ?ЇÃÇ?ÑÍŸµÁ?÷lÚûq´? ŽfŽ;›?ˆK:ÍÖ´ï¿|fÝ„úî¿än’î-î¿>©²Mí¿€N£SóZì¿ÊŽÄ#[Wë¿\m<æBê¿Ú¬V?é¿ÞÉcAêç¿­ßϵ5§æ¿ò¼œXVå¿n'·Røã¿¡ï'ãûâ¿—c˜3á¿Diá¶À/ß¿,ݪfÞÜ¿‡õi(¦öØ¿`r÷•ÂÕ¿u3àÇÿÒ¿ˆšŒ:eοÏOýy·Ç¿6r™87ûÀ¿4££¤öh´¿„ñû.¡;›¿¸%}d=›?‘ˆ6‹gi´?Šî¾oûÀ?¨5 ²·Ç?\£ˆUeÎ?]u+D€Ò?P(Ò.%ÂÕ?®‹–âÂöØ?äkìFûÜ?úmüÁÝ/ß?{t5Bá?™P»š Žâ?®7‹aøã?ù³øgVå?¤¬ŠÊD§æ?/¢z)êç?–{Né?q\bÄõBê?!××jWë?øM>6[ì?B &ÆMí?Ѩ7(-î?Êbž]•úî?&ðšˆç´ï?¬ê¢çÕ-ð?ÞN ¬=wð?%Ì}¶ð?`·‘Eoëð?)N}qññ?=c8ê5ñ?>±ŒEKñ?t¿€öUñ?Týˆ|öUñ?¸÷rEKñ?Ÿ×&ùé5ñ?î:æ6ññ?39Þnëð?¹U×}¶ð?p\¼•.‡ú“ï?ƒÕ]Ìð?íJËQ$fð? ½"¥ð?<”64ÝÙð?zç¼13ñ?Îaј $ñ?a®<ÅO9ñ?±¯k—õCñ?§f|õCñ?l˵qO9ñ?ü0 $ñ?,¯¼P2ñ?ÕÐûñÛÙð?qbþ ¥ð?Õf4ñ!fð?°0›ð?c›ò“ï?#¿ÒÂ^Úî?{™‹®Ã î?âYÄìž.í?&0 »¤<ì?!‚ F/:ë?“É ç&ê?ñ_þ}é?I¡Z¥Ðç?ö-7æ?fo«?å?„‡íàãã?¢ÄsÀLzâ?M,.Vá?³UØ©Àß?MÄÛ-þÛ?(XÜØ?À “/«Õ?[¼0Á«lÒ?Q3½EÎ?Œg@ãDŸÇ?Õ¨ú~êÀ?vw=qïµØ¿Å¦`¡‰Õ¿~eÛN PÒ¿ÿÑÂvPο)¤‰ÿýyÇ¿8˜Në0ÏÀ¿2%¶ 4´¿;¤u«þôš¿?íêDÒöš?n›/²€4´?®6^~kÏÀ?ìÕn²8zÇ?@T‹Î?të×'PÒ?NÔ¾‰Õ?9±> ¶Ø?¢ó+UÓÛ?=EñrßÞ?®iWMòëà?pÛxÆñ]â?0YÅtÄã?× $å?̶&Œlæ?ÕÚÿÔ+¬ç?$W2Ýè?a©ºâþé?XjØ*‹ë?ÊÄçš‚ì?й*í?T+|<ïÞí?W'fÚGªî?‡£r·bï?ìzwåð?çëŽLð?‘á +‹ð?â`ë7“¿ð?̬[ §éð?YÏL ñ?#*î¾pñ?Çà—ã)ñ?¤;´)ñ?§¶ .pñ?è¡pÔK ñ?xͬ¥éð?ø¸i6‘¿ð?²P^(‹ð?ÁRo‹Lð?÷°?þàð?QåÓ¤«bï?ÅM•9ªî?öQ |ÝÞí?+^Tµí?ÎöÿÄ”ì?øp§¯²ë?a‚øþé?yt©uÜè?¾ªÇd|«ç?‡»|[êkæ?‚À„å?OåúbÄã?—‹Môy]â?vì^‰ëà?>Ç–hRÞÞ?j ¬Äì?7vr)¢ í?Ë{N¦Rjî?¾íA!ï?Y–·üÄï?ðº>*ð?îójéhð?çŸqœ¤œð?ïì¹`Æð?—Z8]Äåð?çÇ(¼úð?^¯û+;ñ?Ÿûë:ñ?×Ac»úð? ¤ Ãåð?ýWÉ^Æð?r˜cø¡œð?® O¦hð?b3ŒÕ‹*ð?I°,£ñÄï?@¹«]3!ï?GÐÇAjî?4¸z§ í?Š”³V“Äì?nX¹ Öë?:T^ê?×ê?‚ZyàÇé?dWZ]™¨è?†²Ïzç?ØTþ%=æ?b¸o™wòä?‚Ý‚úÝšã?p)*-7â?é°ª@Èà?ßZÐÞõÞ?Þü‰³‰˜Û?ÙU‚Ø?Èý\Õ?B ÷¡Ü)Ò?¬‡°Eö×Í?øœ¯)ÝIÇ?2Á‚­À?Z±*òö ´?ÎVõ\ÃÑš?l(_S·Ïî¿ns§î¿´Å DSí¿&I”õPyì¿ . Žë¿’>dÑÆ‘ê¿ÌU©…é¿äT»hè¿smF7I=ç¿aþ濈n-'¼ä¿äC¹¨hã¿t6æâ¿Â˜­þªœà¿ˆ> bNÞ¿Í1 >½PÛ¿™ *Ê?BØ¿{r¶CÌ$Õ¿tÎãyNúÑ¿Öø]t‰Í¿ “.µ Ç¿´D~€À¿0ˆ¢ÏsÕ³¿Ã;ÞÞ¿vš¿÷T\o¢xš?þBZ‹ìÕ³?ÿ÷±}º€À?ȤäMQ Ç?F°þT±‰Í?e[ëúlúÑ?ª £çê$Õ?ìÈ–^BØ?­ò_8ÜPÛ?ýîË7NÞ?ïxž±ºœà?1Sþöâ?í?'›hã?9AÞB7¼ä?<w8’æ?LŸ1˜Y=ç?­ÔºÝËhè?‚[0…é?›¬×‘ê?níå Žë?n@9#byì?›BP™Sí?.eA=¹î?’ÅEðÈÏî?UZžØqï?“Ý3FAð?xà˜A¸=ð?dW +qð?méyšð?ItJ^‹¹ð?[S?LÎð?áž½¯Øð?ùû)n¯Øð?áþØMKÎð?JÿgÁ‰¹ð?ùÞr‘wšð?@îâ'qð?²¼)´=ð?Ê+Ø<ð?)8Ëqï?BÏÆE¹Ïî?\ŽÕH¦î?öãSí?ŒB,Gyì?ú "u/ë?ÜS¸S‘ê?ØŸKÕf„é?5œ‡hè?~ú`««<ç?êž bòæ?¤,NÉ¥»ä?BÇØgã?€,8m‚â?Ê !ÊVœà?}Ó#ÚMÞ?c|‚}WPÛ?åýù.þAØ?³çF±$Õ??ý&:]úÑ?'ò¸uí‰Í?WÜÿ˜ò Ç?b±ÉàÉÀ?{<+¬æØ³?‘]¼(‡š?æÀŒxnî¿h‚o¤»í¿ìÊ,úyöì¿ÚìÉrì¿í’{7뿺®^ë=꿟M¼”4鿬cZ±è¿%ŒRðóæ¿^¼†k¾å¿ÿÝÆµzä¿Ò®ôÉÂ*ã¿¶¦ýÎá¿Ê´‹ÕÞ9È$7ë?@o¯>„ì?(<攋öì?!Œ,¶»í?y5kŠnî?FRšï?¨í&B‚›ï?éRv ð?þKw‚F=ð?E%@ûfð?{_[„ð?Lbú³A™ð?DK^„£ð?ñ5g„£ð?^£ @™ð?ø´ò„À„ð?‹øBRfð?wðB=ð?ŽÙo„q ð?uQAÀv›ï?à?ÑÞ‹ï?n oBynî?]0š¡»í?OÐŒ)söì?=Ù†gì?|;‡:6ë?jÉ„ƒ'=ê?l‡8ËÝ3é?8Æ…è?x7Õ0Uóæ?UZBz½å?ð\fë6zä?„Uý¦R*ã? H©»œÎá?&*½ëgà?Êu7:îÝ?¨Ø@m(úÚ?/ˆ0uõ×?øù6ýáÔ?ÆMúh¦ÁÑ?¾’gç¼,Í?âö'f2ÄÆ?_±wMÀ?` ×㙳?–¸sü 1š?d{Û»ýí¿ÀfÈo}Mí¿¬c»h-‹ì¿J¼QÓB·ë¿Œ¿sa@Ò꿤ººO³Üé¿õ‘V3×迱¨ã`Âç¿YëÍˆçžæ¿¥TÀzmå¿Ð3`çÖ.ä¿iÖ}Àãâ¿óér¿á¿ROt+à¿s ¨ÖÝ¿êFPÖ“–Ú¿Q>o,ëœ×¿4§f²”Ô¿>W<ÈÑ¿ °q&ÀÌ¿á«ÙoÆ¿Ú*ÖÀ¿ŸìDN³¿îé›ÇW™¿iÕGÄ™?í« ÁN³?–©ÿCÀ?k±Ðn?oÆ?Ì%”õdÀÌ?H™žçÑ?/yïÑ”Ô?û¢ïá ×?:r¾³–Ú?úà ÈöÝ?ÃÁ{0„+à?ìºá?®² öÐãâ? Öñç.ä?ÛÁ‚‹må?€tøžæ?øºÍùqÂç?D½dOD×è?Ý&˜»ÄÜé?9HF÷QÒê?0¬Y‘T·ë?·º'L?‹ì?úŃtMí?p·P2Íýí? š_Ò‹›î?Ànm j&ï?õ0žï?øÐÎ;ð?(³®‹R)ð?rÞk9Gð?gœÃ[ð? ï±;àeð?Ø»ŽØßeð?RsoÂ[ð?þ$v9ŽGð?@5¨O)ð?®6^ð?¾ïýFžï?¤€Ó¬]&ï? ˱|›î?1®¯òºýí?¼²+³yMí?œÑ %‹ì?iæÂ6·ë?‚HßDkÑê?†TŠ0óÛé?m¼E€Öè?5òm»Áç?JÃÀ£Ožæ?NT¼ðlå?UÛý$[.ä?ì uSãâ?LÉŠó¥Œá?Òï9&+à?à×\Ý?vQC<–Ú?4x’¸œ×?+BSº¥”Ô?ž­šãÑ?¥«Ja¯ÀÌ?¹ÌâíÛoÆ?ÜÆ‡¿-À?š¨ÏïQ³?")üQÏ™?ïçeÒ}í¿7‚À„Ðì¿„ù¹Âpì¿àsÌø Aë¿ ap9Ü_ê¿%Úffné¿îóRkAmè¿$AbÝ ]ç¿+ƒÿm>æ¿ww qå¿FABÂØã¿ÂÈ90“â¿tÈb5)Bá¿Èt¿úÌß¿ÂS4FÝ¿æzí-%Ú¿@ <¬58׿B%:kë<Ô¿¶è%5Ñ¿ôS*&‡EÌ¿V<åÏRƿ鱂 —¿¿¶6CÈìû²¿çÈVKtT™¿©‚“}jV™?ödTpjü²?è°…ê„—¿?fæ„è‘Æ?zCpuÆEÌ?ÀO¾±E5Ñ?þVv] =Ô?RŽÍU8×?B DN%Ú?ï4Ø&Ý?€Sd’Íß?8œÂ9Bá?Š‘ë@“â?tf¡jÓØã?]i?u(å?ªŒÍ~>æ?ÏsL9]ç?&á ôRmè?Äÿ xné?7.î_ê?Qê Aë?\•îò‚ì?pÍXd–Ðì?êr~ä}í?· \î?:*R¡î?‹&É%:ï?8~ºB·yï?EˆçÊÈï?PŸy%"ð?HQý\ÿð?‘Ô;×ðð?`hoðð?äÏF!þð?|>4 ð?´aÓØÄÈï?&y*¯yï?†úóÈ/ï?ØHkƒ¡î?zŒ ›òî?YjŠÑ}í?oc3ÝÐì?Ì5³rhì?N¾š!Aë?9Ñ _ê?Û<«mé?F³$“lè? ó¤j\ç?3™ã¹Ù=æ?Îñ27‘å?Æ7PhJØã?¨XížÆ’â?¹•e»ÎAá?=c`eÌß?ßþ‘Ý?ž·fÜ$Ú?H=¥8×?tu·ä<Ô?äÈœ‰F5Ñ?°·ÁdFÌ? ëÍ2Æ?²«‹\T™¿?› ƒ°þ²?–îÌ`™?‚Ó-ïì¿ý+TËEì¿Éúsž‰ë¿Hެ+½ê¿†4¿¢;àé¿TM«´ÛÓ?vq½“ùÇÖ?ò•’ÅɦÙ?܆lÈuÜ?jÃ%,93ß?LÓ-¶îà?»0Õw^9â?  ‡Éxã?ê|]2¬ä?d‚ûbÛÒå?eËîÞìæ?Ò"Óc÷ç?ô W½ê?x:$˜°‰ë?ÖÒ)p'Eì?i‘î.ïì?üÌ4^‡í?ÙVòdW î?ºÖÜÇ€î?hãdháî?õŸcý.ï?¨êÊúViï?ZÏ¢(Qï?ÌAQÝÓ£ï?>rÀ Ó£ï?õ§Nï?L‡­¶Riï?˜ëþ:÷.ï?îKÆ(`áî?tx(Q½€î?²×wDJ î?zïÍ-N‡í?¦2ˆ§ïì?2s¾ˆEì?WRÌ«•‰ë?ä« ®½ê?‘<¹sqßé?± òè?[(»döç??Šaëæ?8Ÿ­Æ:Òå?!§#BŸ«ä?9sUWDxã?î)αç8â?è{gNîà?žÞÖüˆ2ß?W ÚÚ8uÜ?ßk.]¦Ù?* ~±ÇÖ?u/ùêúÚÓ?†sGõâÐ?ºTT½Ë?Ž"^}¥Å?Øü¿¿?ðZ2y梲?v’mæ˜?>¸=Rì¿¢à—«ë¿ 3ôê¿HBž¼ý+ê¿™„«D½S鿱ĞÞkè¿×/ïtç¿£L݈oæ¿v^8UL\å¿„´€Uã;ä¿A0½ÿ㿎1[Öá¿­5+F¶’à¿JÉ1£±‰Þ¿’aM!ÛÛ¿,©ÎöbÙ¿bš¼£(LÖ¿ªå-oÓ¿w/Ç6†Ð¿°*±s&Ë¿Íî/Å¿ž]”†ßU¾¿àË.‘ë:²¿¡¿äR˜¿U"HêåT˜?¸Åtúk;²?è³µ,`V¾?Ò~ nO/Å?Êôå0^&Ë?v·XKW†Ð?ª‰–NoÓ?f9b‰ILÖ?Y»„Ù?çá`°BÛÛ?-VÆNÓ‰Þ?#NSCÇ’à?32‘DlÖá?†÷Yã?Œ¸­Øô;ä?H 6 ^\å?ït³Ãšoæ?ŒûªHuç?}]aðkè?U¬ÁÏSé?ähÿh,ê?zn÷,ôê?:3tª«ë?9W¹[Rì?¢ŸÎ` çì?Ò#Ù?àÍSÈLÖ?ˆŽö?1oÓ?¬Êwb†Ð?<)®È&Ë?$äÒ 0Å?½xayX¾?Ü €>²?ú—Þm`˜? kü¦ë¿òfëá|뿤!—TQê¿jØp%ðé¿> žÉºè¿hý6´bØç¿£´Gçæ¿îN èå¿U½ íLÛ俤5K£±Áã¿PÇaç›â¿R[Ž‹¢já¿|2 .à¿Î©ÂéEÑÝ¿@¬¿ç2Û¿îÛœTÃؿeéÂo€ÅÕ¿ödP+ÐùÒ¿³Ý_ék"пÌ.|‡(‚Ê¿Ö`€î¯Ä¿o·C-«ž½¿˜ˆÙṈ̃¿}Òÿ÷¿—¿0ŠóýÁ—?@%“vSͱ?}S -Ÿ½?'ù a¯Ä?s=½åi‚Ê?Ï>ÀŒ"Ð?¥¯1ñùÒ?nÃE­¡ÅÕ?>ö¼ÐäƒØ?ä¾­ 3Û?Ï¥øgÑÝ?Ëô=c±.à?A¦é³já?ê‰3«ø›â?à*YcÃÁã?Àjlá^Ûä?q_xèå?ÓØiYçæ?²£aLuØç?ìêylܺè? 9>(Žé?ZEgQê?„Bë?gÙ§ë?T/Y8ì?û‹¸ì?GÉxÞ&í?ã‡ìG7ƒí?§ʆ\Íí?çòâu î?™«`*î?òé«&=î?¬%ba=î? è³S^*î?báuî?¸&¹VÍí?9¿y/ƒí?†–hÔ&í?(«r~¸ì?èmšq8ì? >žÒü¦ë?ŽøÉyë?NÃï´LQê?æÆäé?އ¹ƒºè?;²»×ç?´ºÁ«ææ?÷q’¶{çå?nÇEÉÚä?u @:Áã?àŠmf|›â?"/Ejá?}qpP.à?`󓀃Ø?¨¯5aÅÕ?v€Á×ùÒ?2üqRœ"Ð?*êœíâ‚Ê?¦(™Ý8°Ä?êÇ8Œ˜¡½?ÆÕA~^б?å.ô¡ˆÏ—?²£<]†îê¿Æ:uCPê¿Z)¸bš鿈9ïÕxã迤ÍÎÏÒè¿?Ht$R9ç¿Fè-Ñ~Næ¿¶Tœ¨éUå¿8aù+Pä¿Ýh”/ç=ã¿'³2qÄâ¿9µÏ5töà¿60~³[…ß¿‹úþY^ Ý¿ÔìTüw}Ú¿Ì"dC;à׿ïälëD4Õ¿’ €Å:{Ò¿ýA´f•mÏ¿½õ‡Ó$%Ä¿ —‡Ù¼¿¯™*ŸV±¿êB­±!—¿³”Kî‹#—?ì`þO•V±?A'{–Ù¼?º/ºf%Ä?´!,•ÑÉ?´ª×mÏ?Å7\{Ò?¹SSyf4Õ?6ƒs]à×?ÄúXš}Ú?(ò†Å€ Ý?Þ6Ëw~…ß?k[ÇÇ…öà?¤*6Öâ?»Ék*ù=ã?´G“,>Pä?Ðp&üUå?R×sz‘Næ?-ù e9ç?´«‘ñåè?Øl2Œãè?W5÷Ø¡é?•áVPê?ög¬Ršîê?\eb­A|ë?£dˆ’õøë?íߪidì? oñY¾ì?åd¦í?=Ü$§à<í?åÆÉn(aí?J‹‡–Qsí?êÁ}ãPsí?ü‹ªM&aí?þÝ<í? !´Q‹í?å¸R¾ì?=ø¸´_dì?¬m‡µéøë? Î÷2|ë?3¸w]ˆîê?—'œ>APê?S4¿¡é?ÐÍÐÛmãè?kˆ¥È è?I.7ܳ8ç?=³¦ëMæ?B5æ„aUå?Ú¯Oä?=#Ôu=ã?u?Y_â?níh)öà?̧’Äß?†W§á Ý?’„k…}Ú?ÐcDûß×?'`Z1'4Õ?YààB{Ò?\ÅUmúmÏ?ÚhÚ¾ÒÉ?M™X&Ä?T#’oܼ?àð\Z±?Í nÒð4—?ð¬Ü-,)ê¿Ø¦¸Ÿpé¿ÏJ>Šñåè¿Ôõºu-è¿ÜÖbTeç¿„D„#æ¿Î²Æò«å¿(º[‘¹ä¿ìQOªQ»ã¿\µ«æ°â¿½¾d®ôšá¿ª[Ê'zà¿r«'`žÞ¿ò‰…ç5Ü¿½ë<âY»Ù¿©|9E1׿x¸Ùâ˜Ô¿ÄÚÑ~ÌóÑ¿&ý|G‡Î¿†‡Nÿ!É¿@‹lð„‘ÿ"š=Œ¬¼¿ÙÏ1Ï×°¿[䂸w–¿<|mz–?Õ-rŠ×°? :æu0¼?<9Ç‘Ã?œh©odÉ?ƒSiEЇÎ?¬„ÄîóÑ?½”R¯™Ô?³“¯Ug1×?”L´L|»Ù?Îàq¨²5Ü?t¹pFƒžÞ?;Ärß8zà?츣§›á?ÝAÛÞø°â?|Sd»ã?ã‡! ¤¹ä?7+Šã«å?ÖP«·6æ?óÑNÙgeç?™¤.+-è?뜭ƒæè?1Ö„é?â·ø›@)ê?é`<Ú²ê?y; -ü+ë?;“Ša\”ë?²}ÿ=ºëë?iodÜß1ì?Ab–ô¡fì?I¦ñö߉ì?W „›ì?U'‡ƒ›ì?*ò$Þ‰ì?·àÍžfì?®‘l7Û1ì?+ûß³ëë?^"T”ë?ƒ oñ+ë?„á „Ì²ê?­qîê/)ê?1Š{pé?Ïeíåè?UÇ-è?*9Žw¬dç?^GñŽŽæ?IîÏÉ~ªå?€`av¹ä?NE3ܺã?êÊâ{°â?ã¼甚á?å ÆÒyà?ür%tÏÞ?GD–‘5Ü?®î¨ýºÙ?ø÷¯X1×?Íy`=ĘÔ?Ä| !ÒóÑ?Ðér‰¦‡Î?ˆž«åÉ?j€}úÆ’Ã?ôÓw ¼?›æ=7dܰ?+jÅ’–?s¥óêWé¿røwm–Âè¿Ç1œ¿e追Þ#Ukç¿JÖ2 ө濘éåÆVÚå¿1S`ýä¿è>nów俪ƒÍé-ã¿ÒŽœâ¿ï¸y¯Û á¿ü üi1ìß¿q…©hû¨Ý¿Ê¦‘zSÛ¿Í¡cíØ¿þ>ÂdwÖ¿oíw ÏóÓ¿¸Z÷)ëcÑ¿1oâ<›’Í¿‚Ì2#KÈ¿.mÏC¯ô¿VðN.%»¿^Ýî P°¿_ÆyëÛÕ¿†íÅ•?Âh®`’P°?;ê™%»?;)WÙñôÂ?©dÌíeKÈ?ß}yÞ’Í?èj„ÿ dÑ?,[«!ñóÓ?üK"‡wÖ?\BíØ?àSÛ?ØŽcÛ©Ý?¶IUìß?Tb¯Ùí á?`ƒ,â?ìD”@ã?½µºâŠä?dý‰sýä?u± GjÚå?ˆÚÕæ©æ?”;ikç?¦Èz!zè?¼’®«Âè?ÚnÙ–Wé?kôŒáÜé?áŒû8Rê?Õ8ÄT·ê?LD5ˆö ë?€[êOë? >4rƒë?æþ½)¥ë?¶Ä@¶ë?…ÒŽ?¶ë? ¬´'¥ë?•o`öƒë?m2æVæOë?ïìbOñ ë?ƒ8¼M·ê?n Ã/Rê?ó>Z´ÕÜé?¹ƒÇä‡Wé?P‡˜Âè?j&p^cè?qyã½Mkç?]G¥H6©æ?•bÅêÌÙå?G€aàüä? {ä?ËY‚’Àã?zãq¶â?þYú á?¬!¡’ëß?þŒ8r¨Ý?^‚4SÛ?B ¤kÅìØ?ôÛ8%wÖ?1ƒ¿£¬óÓ?â-tªécÑ?ëÍßYå’Í?4‚¦ÏÌKÈ?Ò—…ÚõÂ?ظZY÷(»?G&„‘V°?E»¦1ií•?\úuè%zè¿z!H4Oê翟²¸Kç¿jùo1Äžæ¿»¡[Üãå¿M2ttå¿5AFä¿>µÝdã¿Ó2#8vâ¿EÚ,›ò|á¿´10äx࿆½œnYÕÞ¿Á,Çæ¥Ü¿D¿pÉdÚ¿p?HéuQÂ?® ÖVÃ?,C×½OÄ?àWc<Å?~ÑHÌðÆ?¸µ&žÛíÆ?xWSW¢±Ç?ô9D:ÌfÈ?Ø‹Œé É? ŽÛ“£É?¬ éuQÂ?)SgžAÁ?BAK5&À?T,Ýy ¾?«ømш¥»?`fôAú7¹?ÁU Þº¶?Ü èW½/´?¸ÛÞz)˜±?¬~Åwë­?¿Ä^(”¨?(7¢°-£? å©íÉv›?°t'„B?…úJ5v?eñJ5v¿jr'„B¿â©íÉv›¿í7¢°-£¿‡Ã^(”¨¿w}Åwë­¿-ÛÞz)˜±¿T èW½/´¿éuQ¿œ ÖVÿC×½OÄ¿õàWc<Å¿nÑHÌðÆ¿§µ&žÛíÆ¿iWSW¢±Ç¿é9D:Ìfȿ΋Œé É¿ ŽÛ“£É¿¢ Ò1n ¿ÈßÔ6]Êÿ§%­{Å¿ízɳ’Ç¿à;–˳ȿVlÈ9Ê¿M˜r°˜¯Ë¿B ÙUÍ¿¸2„ã#gο#rÜ1§Ï¿·ˆ0ÝiпJ¿L öпþEP±wÑ¿P£ÛJšîÑ¿ìµ]tZÒ¿'@øÅüºÒ¿páü÷Ó¿F¿˜1YÓ¿I6¨p|–Ó¿D§·²ÇÓ¿» ¶ìÓ¿R¬²oÔ¿N_@RÐÔ¿1côù«Â?ÖpˆÞH¶Ä?Gÿ³Ä´Æ?¿Ø+¦?¥È?áǃ‡†Ê?™[F{sWÌ?KæÑäÎ?нƒ”ÇÃÏ?Ÿrå ‰®Ð?Ÿ-«¶åpÑ?–ž®-€(Ò?¸IFÊçÔÒ?™Ù8²uÓ?Í~qO| Ô?yåJê’Ô?&^n¨Õ?zìŒ4i}Õ?2û„éÞÕ?–¦fÔì2Ö?óRU?yÖ?Li=¨µ±Ö?ÁÒËú,ÜÖ?Á}[‹øÖ?ä,޾×?€ä,޾×?Ä}[‹øÖ?ÆÒËú,ÜÖ?Ti=¨µ±Ö?üRU?yÖ?¡¦fÔì2Ö?@û„éÞÕ?ŠìŒ4i}Õ?8^n¨Õ?yåJê’Ô?â~qO| Ô?°Ù8²uÓ?ÑIFÊçÔÒ?°ž®-€(Ò?º-«¶åpÑ?¼rå ‰®Ð?Ƚƒ”ÇÃÏ?ŠæÑäÎ?Û[F{sWÌ?&ǃ‡†Ê?Ù+¦?¥È?•ÿ³Ä´Æ?&qˆÞH¶Ä?xcôù«Â?¾ *»A”À?9Y‘á…æ¼?ãwvoµ’¸?*èW½/´?dtïV¤€¯?š‹P`ަ?h–(f›?g7¸¦‚?è/¸¦‚¿Yd–(f›¿˜‹P`ަ¿]rïV¤€¯¿* èW½/´¿ævvoµ’¸¿TX‘á…æ¼¿O *»A”À¿ côù«Â¿±pˆÞH¶Ä¿#ÿ³Ä´Æ¿–Ø+¦?¥È¿ºÇƒ‡†Ê¿}[F{sWÌ¿0æÑäοk½ƒ”ÇÃÏ¿rå ‰®Ð¿‘-«¶åpÑ¿‰ž®-€(Ò¿«IFÊçÔÒ¿Ù8²uÓ¿Ä~qO| Ô¿üxåJê’Ô¿^n¨Õ¿rìŒ4i}Õ¿+û„éÞÕ¿¦fÔì2Ö¿îRU?yÖ¿Ii=¨µ±Ö¿¿ÒËú,ÜÖ¿¿}[‹øÖ¿ä,޾׿&æ–-Å?Ÿà|]RÇ?¥ißM+‘É?bx´Š4ÀË?G¹¨m ÞÍ?0k¿ éÏ?WÕQ¹ðÐ?2Ÿ±/âÑ?4ý\”žÈÒ?Ì÷ÑÜw£Ó?Äe¸’4rÔ?–ÿ5U4Õ?/ k béÕ?–PnpëÖ?™9 Š*×?Нj"ßµ×?(Å”2Ø?ÿ" ^ Ø?¶¬@÷þØ?“Ùû &NÙ?kÀv˜¹Ù?MÏ°Š½Ù?ê ÙÖ{ÝÙ?ñHXyíÙ?òHXyíÙ?î ÙÖ{ÝÙ?SÏ°Š½Ù?sÀv˜¹Ù?žÙû &NÙ? ¶¬@÷þØ?# ^ Ø?9Å”2Ø?¯j"ßµ×?®9 Š*×?¬PnpëÖ?H k béÕ?²ÿ5U4Õ?âe¸’4rÔ?ë÷ÑÜw£Ó?Tý\”žÈÒ?42Ÿ±/âÑ?{ÕQ¹ðÐ?zk¿ éÏ?•¹¨m ÞÍ?²x´Š4ÀË?ýißM+‘É?qŸà|]RÇ?Ý&æ–-Å?…côù«Â?ëÌ]EÀ?¶7ÎOT«»?)V Þº¶?H=Jc¼±?îýeðe©?•\7ᆞ?r¾¸^^„?¶¸^^„¿â\7ᆞ¿¢ûeðe©¿$<Jc¼±¿U Þº¶¿™6ÎOT«»¿–êÌ]EÀ¿côù«Â¿b&æ–-Å¿ížà|]RÇ¿|ißM+‘É¿5x´Š4ÀË¿¹¨m ÞÍ¿k¿ éÏ¿HÕQ¹ðп2Ÿ±/âÑ¿$ý\”žÈÒ¿¼÷ÑÜw£Ó¿¶e¸’4rÔ¿‡ÿ5U4Õ¿! k béÕ¿‹PnpëÖ¿9 Š*׿€¯j"ߵ׿Å”2Ø¿ø" ^ Ø¿ùµ¬@÷þØ¿ŽÙû &NÙ¿hÀv˜¹Ù¿KÏ°Š½Ù¿é ÙÖ{ÝÙ¿ñHXyíÙ¿Ÿà|]RÇ?Y=àÉ?) –SÍ]Ì?1J\ ÊÎ?×)㦑Ð?,®Ë´Ñ?Ü:¨ËÒ?Çðt×Ó?<·‹í×Ô?X5jpíÉÕ?È]"åL¯Ö?;%ÝÕ®†×?7”mŽOØ?úÃýÉo Ù?‡óGà³Ù?šô%ÊvNÚ? æïùÓØÚ?óÓ"‚¢RÛ?ûU§C—»Û?vuуqÜ?‘?LûYÜ?‘øƒtÜ?{Tzìx²Ü?[)ô 6ÄÜ?])ô 6ÄÜ?Tzìx²Ü?˜øƒtÜ?š?LûYÜ?‚uуqÜ? V§C—»Û?Ô"‚¢RÛ?æïùÓØÚ?°ô%ÊvNÚ?/‡óGà³Ù?ÄýÉo Ù?¬7”mŽOØ?Y%ÝÕ®†×?è]"åL¯Ö?{5jpíÉÕ?_·‹í×Ô?îðt×Ó?(Ü:¨ËÒ?U®Ë´Ñ?*㦑Ð?ŠJ\ ÊÎ?‹ –SÍ]Ì?½=àÉ?pŸà|]RÇ?4qˆÞH¶Ä?ÃÒ1n Â?p´2¶â²¾?ÒfôAú7¹?ìšJ;„­³?4+?ßÖ-¬?KùÈPDï ?ÁP±+dhÓ?™Ì!•ÊšÔ?-a'ä{ÀÕ?ëÕý÷ÂØÖ?8Üõòâ×?Ìô޳gÞØ?÷†ÊÙ?ào’¼¦Ú?nEƒrÛ?ø~ˆ\-Ü?œ½xÕÖÜ?d¯¸†„nÝ?…1 ôÝ?i“GÅgÞ?ú»÷KlÇÞ?œ­Þ_Àß?¾Ä8PéNß?Ÿ>Ãuß?æz&56‰ß?èz&56‰ß?Ÿ>Ãuß?ÆÄ8PéNß?¦­Þ_Àß?¼÷KlÇÞ?y“GÅgÞ?…1 ôÝ?y¯¸†„nÝ?³½xÕÖÜ?ˆ\-Ü?.nEƒrÛ?#ào’¼¦Ú?å·†ÊÙ?ðô޳gÞØ?^Üõòâ×?Öý÷ÂØÖ?Wa'ä{ÀÕ?ÅÌ!•ÊšÔ?kP±+dhÓ?Ñvàž*Ò?oòuGsàÐ?IºÍðÏ?– –SÍ]Ì?jßM+‘É?­ÿ³Ä´Æ?UàÔ6]ÊÃ?Pê%*ÁÓÀ?3ùmш¥»?$¿…g‚’µ?o1ø9\ä®? /qY¦¢?UóéŒõň?ééŒõň¿-qY¦¢¿¤.ø9\䮿Á½…g‚’µ¿Ô÷mш¥»¿£é%*ÁÓÀ¿¸ßÔ6]Êÿÿ³Ä´Æ¿pißM+‘É¿ö–SÍ]Ì¿­ÿ¹ÍðÏ¿#òuGsàп‡vàž*Ò¿+P±+dhÓ¿‡Ì!•ÊšÔ¿a'ä{ÀÕ¿×Õý÷ÂØÖ¿%Üõòâ׿ºô޳gÞØ¿±·†ÊÙ¿ôßo’¼¦Ú¿nEƒrÛ¿í~ˆ\-Ü¿½xÕÖÜ¿Z¯¸†„nÝ¿þ…1 ôÝ¿b“GÅgÞ¿ó»÷KlÇÞ¿Ò™Ò¡ß¿”!0T´Mß¿*ù(ÃŒtß¿do¾ùþ‡ß¿bx´Š4ÀË?1J\ ÊÎ??òuGsàÐ?QûwQÒ?«"0·Ó?•ûhÀÕ?oÕgR]Ö?Æ/qœ×?/ÇwìPÌØ?f•";=íÙ?8Pq-,þÚ?Ÿ¯!puþÛ?MÇ<ôzíÜ? ›‘P©ÊÝ?œ¤žx•Þ?Í9²DjMß?žð Wòß?q·îdAà?‡¿êñà?ÌeªÐ5´à?— òC-Þà? æü”½ýà?šurLÓá?L´hiaá?M´hiaá?œurLÓá?æü”½ýà? òC-Þà?ÓeªÐ5´à?¿êñà?{·îdAà?µð Wòß?æ9²DjMß?¸¤žx•Þ?*›‘P©ÊÝ?nÇ<ôzíÜ?į!puþÛ?_Pq-,þÚ?•";=íÙ?ZÇwìPÌØ?ô/qœ×?žÕgR]Ö?D•ûhÀÕ?Þ"0·Ó?µQûwQÒ?yòuGsàÐ?¨J\ ÊÎ?Ìx´Š4ÀË?.Ù+¦?¥È?A&­{Å?»‚rD°CÂ?ú,Ýy ¾?w³2j·?}Áž$êð?À´iL•&¤?²˜Y£ãŠ?Y£ãŠ¿ú±iL•&¤¿ù¿ž$êð¿ƒu³2j·¿}+Ýy ¾¿ÿrD°C¿—%­{Å¿ˆØ+¦?¥È¿*x´Š4ÀË¿úI\ Êο$òuGsàпcQûwQÒ¿Ž"0·Ó¿þ”ûhÀÕ¿ZÕgR]Ö¿¯/qœ×¿ÇwìPÌØ¿R•";=íÙ¿%Pq-,þÚ¿‹¯!puþÛ¿;Ç<ôzíÜ¿þš‘P©ÊÝ¿‘¤žx•Þ¿À9²DjMß¿’ð Wòß¿l·îdA࿃¿êñà¿ÉeªÐ5´à¿ËecˆÝà¿í¤ìäýà¿&KÌ*á¿ìX¸á¿G¹¨m ÞÍ?×)㦑Ð?¡vàž*Ò?«"0·Ó?ío*Å28Õ?Ô̬Ö?7ÍEØ?m;îo'iÙ?9ÄS´“°Ú?)ú $ŠçÛ?/Pµ÷J Ý?¼†ö!!Þ?žjC.b"ß?èþàå7à?ë*’†[uà?ÌëªXØà?¡|ëCò0á?N+¯¯ñ~á?„SõÒ&Âá?á:húá?õ·5“'â?Í3Hè‹Iâ?Ñ_=`â?oìG›™kâ?pìG›™kâ?Ó_=`â?Ñ3Hè‹Iâ? õ·5“'â?%á:húá?ŽSõÒ&Âá?Y+¯¯ñ~á?­|ëCò0á?ÚëªXØà?ú*’†[uà?øþàå7à?ÂjC.b"ß?ã†ö!!Þ?XPµ÷J Ý?Uú $ŠçÛ?gÄS´“°Ú?Ÿ;îo'iÙ?iÍEØ? žÌ¬Ö?%p*Å28Õ?ã"0·Ó?àvàž*Ò?*㦑Ð?¹¹¨m ÞÍ?Yǃ‡†Ê?{ɳ’Ç?hÒÚ¿[¨Ã?ŸAK5&À?M/ö6r3¹?Ê8X¹"а¥?Rc#¼ðŒ?Fc#¼ðŒ¿B¶"а¥¿(7XP±+dhÓ?•ûhÀÕ?Ô̬Ö?¨7¡9Ø?Ð_Ôó·Ù?­Œ-ˆ‰&Û?enƒ§`„Ü?æp¡ÐÝ?©0’û~ ß?˜…ëÚ›à?ŸÞ=î ¢à?´kõ7!á?d˜«Ô•á?¦Š$¨˜ÿá?ÊB.C^â?³ò±™±â?äm¥Íhùâ?¼â8„5ã?R7߯eã?ÉÑÿŠã?¢ª7R¢ã?ôFõu®ã?õFõu®ã?¤ª7R¢ã?ÎÑÿŠã?X7߯eã?Äâ8„5ã?îm¥Íhùâ?¿ò±™±â?×B.C^â?µŠ$¨˜ÿá?t˜«Ô•á?Åkõ7!á?²Þ=î ¢à?­…ëÚ›à?Õ0’û~ ß?1æp¡ÐÝ?—nƒ§`„Ü?âŒ-ˆ‰&Û?_Ôó·Ù?H¨7¡9Ø?žÌ¬Ö?O•ûhÀÕ?P±+dhÓ?p®Ë´Ñ?©k¿ éÏ?\F{sWÌ?€<–˳È?r:¢¤çÅ?‘SgžAÁ?EÏó&íº?“Êhz“G³?‘58,§?.ΛûëŽ?_ùÍ›û뎿Þ58,§¿ÕÈhz“G³¿ICÏó&íº¿¶RgžAÁ¿š9¢¤çÅ¿½;–˳ȿZ[F{sWÌ¿îj¿ éÏ¿ ®Ë´Ñ¿P±+dhÓ¿ð”ûhÀÕ¿³Ì¬Ö¿ø§7¡9Ø¿¸_Ôó·Ù¿“Œ-ˆ‰&Û¿Mnƒ§`„Ü¿ë~æp¡ÐÝ¿“0’û~ ß¿Œ…ëڛ࿔Þ=î ¢à¿¬kõ7!á¿]˜«Ô•῟Š$¨˜ÿá¿ÄB.C^â¿­ò±™±â¿ßm¥Íhù⿸â8„5ã¿o#loeã¿y'Í)R‰ã¿`Îq¡ã¿¸ÖÚS³­ã¿WÕQ¹ðÐ?Ü:¨ËÒ?™Ì!•ÊšÔ?oÕgR]Ö?7ÍEØ?Ð_Ôó·Ù?…g\äûMÛ?Í6ô -ÓÜ?xGÀD—FÞ?é¤U§ß?„Gzà?˜³‹é¹á?þâ4¹¢¨á?xЧ/â?orýu«â?eËÓ¿ã?º&+@€ã?aa8LºØã?ì§ÿ÷$ä?ûqÇdä?ƒ ˜ä?(Œ .¾ä?îU°1KØä?)Ë,.åä?+Ë,.åä?ñU°1KØä?-Œ .¾ä?‰ ˜ä?#ûqÇdä?÷§ÿ÷$ä?na8LºØã?Ç&+@€ã?uËÓ¿ã?€rýu«â?0xЧ/â?ã4¹¢¨á?®³‹é¹á?„Gzà?¥U§ß?¬GÀD—FÞ?7ô -ÓÜ?¾g\äûMÛ? _Ôó·Ù?vÍEØ?¯ÕgR]Ö?áÌ!•ÊšÔ?IÜ:¨ËÒ?˜ÕQ¹ðÐ?ÓæÑäÎ?ÿlÈ9Ê?«½uLÆ?V›>éuQÂ?kBA€@–¼?êÔÒów´?']¢ š¨?f|¦Šj?šu¦Šj¿ÄY¢ š¨¿ÓÒów´¿”@A€@–¼¿mš>éuQ¿żuLÆ¿/lÈ9Ê¿æÑäο5ÕQ¹ðпÞÛ:¨ËÒ¿yÌ!•ÊšÔ¿JÕgR]Ö¿ÍEØ¿·_Ôó·Ù¿lg\äûMÛ¿²6ô -ÓÜ¿^GÀD—F޿ѤU§ß¿õ„Gz࿌³‹é¹á¿óâ4¹¢¨á¿xЧ/â¿hrýu«â¿]ËÓ¿㿲&+@€ã¿\a8LºØã¿ç§ÿ÷$ä¿ûqÇdä¿28Ä8—俪D£sÀ½ä¿î|9y}×俹+&õ_ää¿2Ÿ±/âÑ?Çðt×Ó?-a'ä{ÀÕ?Æ/qœ×?m;îo'iÙ?­Œ-ˆ‰&Û?Í6ô -ÓÜ?V"ï  nÞ?Smyã!öß?>qBµà?¸íF+%eá?jzÍõM â?MV…V¤â?¼BÇÚß2ã?«0’µã?†…,ä?þ Ê#6–ä?ôµ8{óä?štŽðDå?¶Ðáv‡å?ò÷ÐÀ½å?©Cû3<æå?²æ¹#iæ?'†Íæ?(†Íæ?µæ¹#iæ?¯Cû3<æå?ù÷ÐÀ½å?¿Ðáv‡å?¥tŽðDå?¶8{óä? Ê#6–ä?—…,ä?0«0’µã?ÏBÇÚß2ã?-MV…V¤â?‚zÍõM â?ÑíF+%eá?XqBµà?Šmyã!öß?‘"ï  nÞ? 7ô -ÓÜ?ìŒ-ˆ‰&Û?¯;îo'iÙ? /qœ×?xa'ä{ÀÕ?žðt×Ó?U2Ÿ±/âÑ?¾ƒ”ÇÃÏ?™r°˜¯Ë?ä{»°VŠÇ?P ÖVÃ?•Æ´°¸-¾?—¦©‹´›µ?¨VA´¹ø©?ŸA·¾ T‘?q:·¾ T‘¿SA´¹ø©¿£¤©‹´›µ¿¥Ä´°¸-¾¿[ ÖVÿòz»°VŠÇ¿%˜r°˜¯Ë¿C½ƒ”ÇÃÏ¿í1Ÿ±/âÑ¿£ðt×Ó¿ a'ä{ÀÕ¿Ÿ/qœ×¿H;îo'iÙ¿“Œ-ˆ‰&Û¿³6ô -ÓÜ¿9"ï  nÞ¿8myã!öß¿1qBµà¿«íF+%eá¿]zÍõM â¿ MV…V¤â¿³BÇÚß2ã¿«0’µã¿~…,ä¿ö Ê#6–ä¿îµ8{óä¿•tŽðD忱Ðáv‡å¿™Â1·¼å¿ªodåå¿mûöæ¿óÑ„*æ¿4ý\”žÈÒ?<·‹í×Ô?ëÕý÷ÂØÖ?/ÇwìPÌØ?9ÄS´“°Ú?enƒ§`„Ü?xGÀD—FÞ?Smyã!öß?«nˆ/ûÈà?ëQ]‹Œá?£^ºßHEâ?7‡ÇÁòâ?%Ú_‹”ã?€~ A*ä?ÎÞÍH‡³ä?¶í&, 0å?¾êyŸå?3! È”æ?»ÞQEVæ?pëc?ßœæ?Ùø¯Õæ?yR~¶iç?ßÑÏôç?®õtÄ>+ç?¯õtÄ>+ç?âÑÏôç?R~¶iç?àø¯Õæ?yëc?ßœæ?ÇÞQEVæ?A! È”æ?ÍêyŸå?Èí&, 0å?áÞÍH‡³ä?,€~ A*ä?<Ú_‹”ã?O‡ÇÁòâ?½^ºßHEâ?R]‹Œá?Çnˆ/ûÈà?’myã!öß?·GÀD—FÞ?¨nƒ§`„Ü?ÄS´“°Ú?vÇwìPÌØ?:Öý÷ÂØÖ?Œ·‹í×Ô?|ý\”žÈÒ?êrå ‰®Ð?ü ÙUÍ?£æ+R©¹È?ÖC×½OÄ?Éz9”²¿?(θ!²¶?{ ë_G«?vö$S3’?ìî$S3’¿ºŒ ë_G«¿›Î¸!²¶¿Àx9”²¿¿ÕB×½OÄ¿¤å+R©¹È¿ ÙUÍ¿zrå ‰®Ð¿ý\”žÈÒ¿·‹í×Ô¿ÆÕý÷ÂØÖ¿ÇwìPÌØ¿ÄS´“°Ú¿Jnƒ§`„Ü¿\GÀD—FÞ¿5myã!öß¿œnˆ/ûÈà¿ÞQ]‹Œá¿–^ºßHEâ¿)‡ÇÁòâ¿Ú_‹”ã¿€~ A*ä¿ÆÞÍH‡³ä¿­í&, 0å¿¶êyŸå¿-! È”濵ÞQEVæ¿këc?ßœæ¿G·ÍÔæ¿vÁµ†ÿ濬⺴ç¿>ZZ*ç¿Ì÷ÑÜw£Ó?X5jpíÉÕ?8Üõòâ×?f•";=íÙ?)ú $ŠçÛ?æp¡ÐÝ?é¤U§ß?>qBµà?ëQ]‹Œá?ÌÑ Yâ?iëIù'ã?`¾L†Ïã?7º9K¬xä?:vf…2å?®Ât'¸¤å?nÛ­ä&æ?ì}Ðg›æ?…Æ*´ùç? ˜õ[Zç?à1wU¤ç?÷E5»ßç?ÇÍ®g è?va9W?*è?hã¿Æ/9è?jã¿Æ/9è?ya9W?*è?ÇÍ®g è?ÿE5»ßç?ê1wU¤ç?˜õ[Zç?“Æ*´ùç?ü}Ðg›æ?nÛ­ä&æ?ÂÂt'¸¤å?Ovf…2å?Nº9K¬xä?z¾L†Ïã?„ëIù'ã?.ÌÑ Yâ? R]‹Œá?_qBµà?,¥U§ß?Hæp¡ÐÝ?rú $ŠçÛ?°•";=íÙ?‹Üõòâ×?¬5jpíÉÕ?øÑÜw£Ó?î-«¶åpÑ?x3„ã#gÎ?ïæ;H¼ÙÉ?¸àWc<Å? /ä£ñ‘À?Ÿñ¢º·?ˆ^îL3…¬?kð<ø`“?Šè<ø`“¿šZîL3…¬¿zñ¢º·¿.ä£ñ‘À¿ªàWc<Å¿äå;H¼ÙÉ¿ˆ2„ã#gοx-«¶åpÑ¿¤÷ÑÜw£Ó¿15jpíÉÕ¿Üõòâ׿<•";=íÙ¿ú $ŠçÛ¿æ~æp¡ÐݿͤU§ß¿.qBµà¿ÜQ]‹Œá¿ÌÑ Yâ¿[ëIù'ã¿R¾L†Ïã¿*º9K¬xä¿0vf…2忦Ât'¸¤å¿ÿmÛ­ä&æ¿ä}Ðg›æ¿~Æ*´ù翘õ[Zç¿Û1wU¤ç¿¨¼¹—ÏÞç¿k’Xz è¿°gyÚP)è¿ú#¶@8è¿Äe¸’4rÔ?È]"åL¯Ö?Ìô޳gÞØ?8Pq-,þÚ?/Pµ÷J Ý?©0’û~ ß?„Gzà?¸íF+%eá?£^ºßHEâ?iëIù'ã?Ë+d/?ãã?jr} ä?sZSo-På?Îü/i#óå?qtêˆæ?åÕÊËç?Ζôwd‰ç?ÁwR.ôç?©þ æ1Pè?‘ò¢ 7è?ÕÛè?òTÌÕ é?˜¨¼¥¢(é?1O„Y08é?2O„Y08é?›¨¼¥¢(é?ùTÌÕ é?ÕÛè?›ò¢ 7è?¶þ æ1Pè?ÐwR.ôç?ß–ôwd‰ç?øÕÊËç?†têˆæ?äü/i#óå?ŒZSo-På?…r} ä?è+d/?ãã?‡ëIù'ã?Â^ºßHEâ?ÚíF+%eá?$„Gzà?ò0’û~ ß?zPµ÷J Ý?…Pq-,þÚ?"õ޳gÞØ?^"åL¯Ö?f¸’4rÔ?èž®-€(Ò?Í#rÜ1§Ï?Œe8éÝéÊ?7ÒHÌðÆ?¢iÎ a@Á?Œðp5[´¸?— ôÖo±­?Þz‚²Ï“?ÚÕz‚²Ï“¿€ôÖo±­¿Pîp5[´¸¿†hÎ a@Á¿ÑHÌðÆ¿vd8éÝéÊ¿Ó"rÜ1§Ï¿nž®-€(Ò¿›e¸’4rÔ¿Ÿ]"åL¯Ö¿¥ô޳gÞØ¿ Pq-,þÚ¿Pµ÷J Ý¿‹0’û~ ß¿ò„Gzà¿§íF+%eá¿“^ºßHEâ¿ZëIù'㿽+d/?ãã¿[r} ä¿fZSo-På¿Ãü/i#óå¿htêˆæ¿ÛÕÊËç¿Æ–ôwd‰ç¿ºwR.ôç¿£þ æ1P迌ò¢ 7è¿»XÅÚè¿âb½™é¿R¬gZª'é¿lx¯t77é¿–ÿ5U4Õ?;%ÝÕ®†×?÷†ÊÙ?Ÿ¯!puþÛ?¼†ö!!Þ?˜…ëÚ›à?˜³‹é¹á?jzÍõM â?7‡ÇÁòâ?`¾L†Ïã?jr} ä?âÇjæcå?ah›‰æ?®é`ÔŠÃæ?† ‚^ç?;.´ëç?¼L Ýhè?ôÎÓ©œ×è?KÒÿ 7é?â¼ßê†é?^­ Çé? ¶õ I÷é?±BØê?d8£'ê?f8£'ê?´BØê?¦¶õ I÷é?—^­ Çé?ì¼ßê†é?XÒÿ 7é?ÏÓ©œ×è?ÍL Ýhè?O.´ëç?† ‚^ç?Åé`ÔŠÃæ?ah›‰æ?þÇjæcå?‡r} ä?¾L†Ïã?X‡ÇÁòâ?zÍõM â?¼³‹é¹á?½…ëÚ›à? ‡ö!!Þ?ð¯!puþÛ?‘·†ÊÙ?–%ÝÕ®†×?çÿ5U4Õ? JFÊçÔÒ?ô·ˆ0ÝiÐ?`féË?x¶&žÛíÆ?_Ã,äÁ?%Ç%bêž¹?7ñ0_\Ë®?ëz03Ì‹”?hr03Ì‹”¿ùì0_\Ë®¿ÔÄ%bêž¹¿9Ã,äÁ¿Uµ&žÛíÆ¿ù `féË¿r·ˆ0ÝiпIFÊçÔÒ¿kÿ5U4Õ¿%ÝÕ®†×¿š·†ÊÙ¿r¯!puþÛ¿†ö!!Þ¿ˆ…ëÚ›࿈³‹é¹á¿YzÍõM â¿'‡ÇÁòâ¿Q¾L†Ïã¿[r} ä¿ÓÇjæcå¿õ`h›‰濤é`ÔŠÃæ¿ü† ‚^ç¿1.´ë翳L Ýhè¿íÎÓ©œ×è¿EÒÿ 7é¿Ü¼ßê†é¿°á FÆé¿ C-ÇHöé¿¡sNW€ê¿Ë‡¡&ê¿/ k béÕ?7”mŽOØ?ào’¼¦Ú?MÇ<ôzíÜ?žjC.b"ß?ŸÞ=î ¢à?þâ4¹¢¨á?MV…V¤â?%Ú_‹”ã?7º9K¬xä?sZSo-På?ah›‰æ?WxD׿?9t¾?è…ç?tzž &è?܆[\H·è?_flæG9é?C§M¹«é?+©EUê?Gẵß`ê?jžÎx%£ê?J隷ýÔê?j"ºœIöê?ã·ôë?å·ôë?n"ºœIöê?P隷ýÔê?ržÎx%£ê?Rẵß`ê?8©EUê?S§M¹«é?qflæG9é?ð†[\H·è?Šzž &è?Qt¾?è…ç?5WxD׿?ah›‰æ?’ZSo-På?Wº9K¬xä?GÚ_‹”ã?XSW¢±Ç?g0kÂï|Â?ÿ¾a€¬yº?¿ªïKÒ¯?õ‘¶:;•?)‰¶:;•¿]¦ïKÒ¯¿›¼a€¬yº¿7/kÂï|¿WSW¢±Ç¿¨¿ÿ¸×Ì¿,¿L öпnÙ8²uÓ¿ k béÕ¿d7”mŽOØ¿Ûßo’¼¦Ú¿Ç<ôzíÜ¿qjC.b"ß¿Þ=î ¢à¿îâ4¹¢¨á¿MV…V¤â¿Ú_‹”ã¿'º9K¬xä¿dZSo-På¿ò`h›‰æ¿ WxD׿¿.t¾?è…ç¿kzž &è¿Ò†[\H·è¿VflæG9é¿<§M¹«é¿$©EUê¿Bẵß`ê¿x“è•¢ê¿nòÖàôÓê¿—L…?õê¿ü%ûéë¿–PnpëÖ?úÃýÉo Ù?nEƒrÛ? ›‘P©ÊÝ?èþàå7à?´kõ7!á?xЧ/â?¼BÇÚß2ã?€~ A*ä?:vf…2å?Îü/i#óå?®é`ÔŠÃæ?9t¾?è…ç?ã‘ÌÃ9è?듎®Þè?šJYÐBté?cáR$úé?•$B‚pê?@¶±ŽÕê?´n˜<*ë?ϸÐnë?4 “ &¢ë?~´¥ŽpÄë?ëM›Õë?íM›Õë?´¥ŽpÄë?; “ &¢ë? ϸÐnë?Àn˜<*ë?N¶±ŽÕê?¦$B‚pê?váR$úé?¯JYÐBté?%듎®Þè?û‘ÌÃ9è?Tt¾?è…ç?Ìé`ÔŠÃæ?íü/i#óå?[vf…2å?:€~ A*ä?áBÇÚß2ã?DxЧ/â?Ükõ7!á?ÿàå7à?b›‘P©ÊÝ?rnEƒrÛ?ZÄýÉo Ù?ìPnpëÖ?(qO| Ô?gFP±wÑ?ŠÈm@´Í?Á:D:ÌfÈ?_gÔK Ã??o(¦D»?¬êöÒÌb°?iQøÑÝ•?[HøÑÝ•¿jèöÒÌb°¿Èl(¦D»¿&gÔK ÿ‹9D:ÌfÈ¿XÇm@´Í¿ÜEP±wÑ¿¡~qO| Ô¿hPnpëÖ¿ÌÃýÉo Ù¿çmEƒrÛ¿Üš‘P©ÊÝ¿Ðþàå7࿤kõ7!á¿ xЧ/â¿©BÇÚß2ã¿€~ A*ä¿)vf…2忾ü/i#ó忞é`ÔŠÃæ¿*t¾?è…ç¿×‘ÌÃ9è¿듎®Þè¿JYÐBté¿ZáR$úé¿$B‚pê¿9¶±ŽÕê¿®n˜<*ë¿LÛûÁmë¿îçT¡ë¿Ìz®„^Ãë¿·’ëgˆÔë¿™9 Š*×?‡óGà³Ù?ø~ˆ\-Ü?œ¤žx•Þ?ë*’†[uà?d˜«Ô•á?orýu«â?«0’µã?ÎÞÍH‡³ä?®Ât'¸¤å?qtêˆæ?† ‚^ç?tzž &è?듎®Þè?¸pþû‡é?–EA„Š!ê?Ï/lûªê?^ðÃòù#ë?1y;Œë?û£S³ãë?}Ú\Ï)ì?4”—C^ì?´ý%Šwì?…ÂÞò“ì?‡ÂÞò“ì?¸ý%Šwì?;”—C^ì?†Ú\Ï)ì?¤S³ãë?,1y;Œë?oðÃòù#ë?â/lûªê?¬EA„Š!ê?¸pþû‡é?'듎®Þè?zž &è?#† ‚^ç?‘têˆæ?ÐÂt'¸¤å?òÞÍH‡³ä?E«0’µã?—rýu«â?˜«Ô•á?+’†[uà?ô¤žx•Þ?Zˆ\-Ü?{‡óGà³Ù?ñ9 Š*×?`yåJê’Ô?º£ÛJšîÑ?»åJv~Î?ªŒŒé É?øAíÊé‹Ã?¡dcû·ý»?®.YÒ°?_Ð,qir–?Ç,qir–¿±«.YÒ°¿bcû·ý»¿¶@íÊé‹Ã¿l‹Œé É¿åJv~ο,£ÛJšîÑ¿ÖxåJê’Ô¿j9 Š*׿é†óGà³Ù¿Ì~ˆ\-Ü¿j¤žx•Þ¿Š|¹tà¿òSžô&•á¿kÖ¼ªâ¿ ŸçŠÏ´ã¿R/.ûº²ä¿O:~â£å¿ås⇱‡æ¿K €k›]ç¿5avFš´¾ê?”Tü$`Kë?Yêc6Çë?Þõê1ì?êqõ <‹ì?/iP’òÒì?þÍïMâí??¢;ûé,í?Rª·aó>í?Tª·aó>í?C¢;ûé,í?ÎïMâí?8iP’òÒì?öqõ <‹ì?*Þõê1ì?jêc6Çë?§Tü$`Kë?TvFš´¾ê?®EA„Š!ê?´JYÐBté?ø†[\H·è?Z.´ëç?ÖÊËç?+nÛ­ä&æ?Ûí&, 0å?­…,ä?ËÓ¿ã?Њ$¨˜ÿá?øëªXØà?&:²DjMß?ÿ½xÕÖÜ?õ%ÊvNÚ?ä¯j"ßµ×?†^n¨Õ?Y¶]tZÒ?– ËÞ5Ï?õ ŽÛ“£É?"̵yÄ?îÂ়?Ö­·„…7±?Ÿ•kù–? –•kù–¿w«·„…7±¿WÀ়¿S!̵yÄ¿¯ ŽÛ“£É¿U ËÞ5Ͽȵ]tZÒ¿ø]n¨Õ¿Y¯j"ߵ׿kô%ÊvNÚ¿n½xÕÖÜ¿™9²DjMß¿$Õk²×à¿úËEçþá¿Á¶¦pã¿KsÖoU+ä¿Y^À8/å¿X‡1 &æ¿©¶±/3ç¿;Pd§#êç¿…,·oT¶è¿ª¶¨šGsé¿2ôq ˆ 꿦d§¬½ê¿ošÐÅRJë¿þLÉ=$Æë¿Ü ¤²Ô0ì¿}X"Šì¿š?­ÖÑì¿*ŸþÁÃí¿eú´ Ê+í¿÷a/ÀÒ=í¿(Å”2Ø? æïùÓØÚ?d¯¸†„nÝ?žð Wòß?¡|ëCò0á?ÊB.C^â?º&+@€ã?þ Ê#6–ä?¾êyŸå?ì}Ðg›æ?Ζôwd‰ç?¼L Ýhè?_flæG9é?cáR$úé?Ï/lûªê?”Tü$`Kë?ÆW5‘ïÚë?NBG'QYì?#Vâõ6Æì?N£ Ô]!í?ieˆŠjí?7w‰ö˜¡í?›z%^Æí? ŠjÆØí? ŠjÆØí?Ÿz%^Æí?>w‰ö˜¡í?reˆŠjí?Z£ Ô]!í?2Vâõ6Æì?`BG'QYì?ÚW5‘ïÚë?ªTü$`Kë?ç/lûªê?}áR$úé?|flæG9é?ÜL Ýhè?ð–ôwd‰ç?}Ðg›æ?ãêyŸå?&Ê#6–ä?ã&+@€ã?õB.C^â?Î|ëCò0á?úð Wòß?ʯ¸†„nÝ?tæïùÓØÚ?…Å”2Ø?ÛìŒ4i}Õ?–@øÅüºÒ?és¸JÚÏ?‡¡ í¿µ‹¯:kií¿TÖr‡t í¿û‡K8Åí¿ÚJpÚŸ×í¿ÿ" ^ Ø?óÓ"‚¢RÛ?…1 ôÝ?q·îdAà?N+¯¯ñ~á?³ò±™±â?aa8LºØã?ôµ8{óä?3! È”æ?…Æ*´ùç?ÁwR.ôç?ôÎÓ©œ×è?C§M¹«é?•$B‚pê?^ðÃòù#ë?Yêc6Çë?NBG'QYì?Ãù#ðÙì?DÄHí?£Iutˆ¥í?V±D8ðí?b (î?_beuMî?VZÞ-1`î?XZÞ-1`î?_beuMî? b (î?_±D8ðí?°Iutˆ¥í?DÄHí?¡Ãù#ðÙì?bBG'QYì?pêc6Çë?wðÃòù#ë?°$B‚pê?a§M¹«é?ÏÓ©œ×è?ãwR.ôç?©Æ*´ùç?Y! È”æ?¶8{óä?‹a8LºØã?ßò±™±â?{+¯¯ñ~á? ·îdAà?n…1 ôÝ?\Ô"‚¢RÛ?]# ^ Ø?•û„éÞÕ?wpáü÷Ó?Ž‹ÚD5Ð?g“;ƒ%¡Ê?>Æ¿UÇÄ?ÆY×gÁ½?Ðô;ÒËá±?Ž ¬6¢Ü—?«¬6¢Ü—¿Zò;ÒË᱿Y×gÁ½¿èÄ¿UÇÄ¿’;ƒ%¡Ê¿çŠÚD5пàoáü÷Ó¿û„éÞÕ¿Í" ^ Ø¿ÁÓ"‚¢RÛ¿×…1 ôÝ¿W·îdA࿾<E~á¿$ŒU4á°â¿ªöömö×ã¿ÜzµÎòä¿Òñ²™»æ¿¨§[£ç¿òû*¸Aóç¿"¹~§Öè¿;A·»ªé¿³ú˜ûnê¿ûmî"ë¿ùLÉ=$Æë¿+«`9Xì¿l&YgÓØì¿Š3Þ£Gí¿«œ‡Þc¤í¿ô*AÃÜîí¿† 8Äß&î¿Æ&.VJLî¿ÞÈe_î¿¶¬@÷þØ?ûU§C—»Û?i“GÅgÞ?‡¿êñà?„SõÒ&Âá?äm¥Íhùâ?ì§ÿ÷$ä?štŽðDå?»ÞQEVæ? ˜õ[Zç?©þ æ1Pè?KÒÿ 7é?+©EUê?@¶±ŽÕê?1y;Œë?Þõê1ì?#Vâõ6Æì?DÄHí?·Œ¢A¹í?‹}jjî?@öLcî?#™§à›î?ÁñvjÜÁî?Q/,)àÔî?S/,)àÔî?ÅñvjÜÁî?+™§à›î?JöLcî?—}jjî? ·Œ¢A¹í?“DÄHí?8Vâõ6Æì?3Þõê1ì?71y;Œë?[¶±ŽÕê?I©EUê?lÒÿ 7é?Ìþ æ1Pè?/˜õ[Zç?âÞQEVæ?ÄtŽðDå?¨ÿ÷$ä?n¥Íhùâ?³SõÒ&Âá?¶¿êñà?Ò“GÅgÞ?fV§C—»Û?_¶¬@÷þØ?ú¦fÔì2Ö?ŽF¿˜1YÓ?6#™‡sÐ?Ó;åypË?YðÖZ&Å?ãòÎÞ´3¾?Úšì®|&²?©€'ŠK8˜?¡v'ŠK8˜¿Z˜ì®|&²¿(ðÎÞ´3¾¿þîÖZ&Å¿|:åypË¿ÿ"™‡sпõE¿˜1YÓ¿e¦fÔì2ֿ͵¬@÷þØ¿ÉU§C—»Û¿9“GÅgÞ¿l¿êñà¿È~wÁá¿tûW‹­øâ¿&äXH0$ä¿s*GCå¿2W Ô@Uæ¿êtYç¿ýÇòAOè¿J$ƒ;6é¿%kT ê¿u¦ŸÜ…Ôê¿ÿ;ñ™+‹ë¿Õ ¤²Ô0ì¿q¡èûÅ쿊3Þ£Gí¿¢!øI¸í¿FÊ£pAî¿}hØaî¿h{ü‘²šî¿jóxÞ¬Àî¿Ðâ…á¯Óî¿“Ùû &NÙ?vuуqÜ?ú»÷KlÇÞ?ÌeªÐ5´à?á:húá?¼â8„5ã?ûqÇdä?¶Ðáv‡å?pëc?ßœæ?à1wU¤ç?‘ò¢ 7è?â¼ßê†é?Gẵß`ê?´n˜<*ë?û£S³ãë?êqõ <‹ì?N£ Ô]!í?£Iutˆ¥í?‹}jjî?®cz½vî?WýUÙFÃî?ûÕcT×üî?qiçjK#ï?½ÆÄe‹6ï?¿ÆÄe‹6ï?uiçjK#ï?ÖcT×üî?aýUÙFÃî?»cz½vî?š}jjî?¶Iutˆ¥í?c£ Ô]!í?rõ <‹ì?¤S³ãë?Ðn˜<*ë?fẵß`ê?½ßê†é?´ò¢ 7è?1wU¤ç?—ëc?ßœæ?àÐáv‡å?FûqÇdä?éâ8„5ã?Lá:húá?üeªÐ5´à?d¼÷KlÇÞ?ãuуqÜ?ôÙû &NÙ?XRU?yÖ?¹6¨p|–Ó?éXû¤§Ð?^]á ]Ë?ïŒèõYÅ?gAa“¾?Þïû_²?8éÞú…˜?ßÞú…˜¿xÛïû_²¿>dAa“¾¿¨íŒèõYÅ¿\á ]Ë¿>Xû¤§Ð¿6¨p|–Ó¿ÁRU?yÖ¿`Ùû &NÙ¿Duуqܿɻ÷KlÇÞ¿±eªÐ5´à¿§8Ͷùá¿Ê[¤Æ4ã¿Ïw‹-þcä¿zÀÚg¢†å¿>”aœæ¿®¬ $l£ç¿j;B!Dœè¿ R”î…é¿„Êá`Û_ê¿rO@!„)ë¿3·Õvlâë¿vX"Šì¿6”{V> í¿«œ‡Þc¤í¿DÊ£pAî¿u €Óu_?Âî¿bQ‚¥ûî¿q7T"ï¿^Ï6ZW5ï¿kÀv˜¹Ù?‘?LûYÜ?œ­Þ_Àß?— òC-Þà?õ·5“'â?R7߯eã?ƒ ˜ä?ò÷ÐÀ½å?Ùø¯Õæ?÷E5»ßç?ÕÛè?^­ Çé?jžÎx%£ê?ϸÐnë?}Ú\Ï)ì?/iP’òÒì?ieˆŠjí?V±D8ðí?@öLcî?WýUÙFÃî?hC{‚ï?£Í±Jï?÷ª±O†qï?Ý€§ö„ï?߀§ö„ï?ûª±O†qï?«Í±Jï?rC{‚ï?dýUÙFÃî?PöLcî?i±D8ðí?}eˆŠjí?FiP’òÒì?—Ú\Ï)ì?ϸÐnë?ˆžÎx%£ê?°^­ Çé?9ÕÛè?F5»ßç? ø¯Õæ?øÐÀ½å?® ˜ä?7߯eã?3õ·5“'â?È òC-Þà?®Þ_Àß?ÿ?LûYÜ?ÍÀv˜¹Ù?³i=¨µ±Ö?³§·²ÇÓ?1åuÜ|ÑÐ?eÐdÏ¡Ë?† «ušÅ?hÉgá2à¾?7† &޲?Gm7ŸÂ˜?m7ŸÂ˜¿©ƒ &޲¿Ægá2྿#«ušÅ¿§cÐdϡ˿„äuÜ|Ñп§·²ÇÓ¿i=¨µ±Ö¿7Àv˜¹Ù¿^?LûYÜ¿k­Þ_Àß¿| òC-Þà¿KK à&â¿[#loeã¿8Ä8—ä¿ ™Â1·¼å¿òG·ÍÔæ¿œ¼¹—ÏÞç¿°XÅÚè¿£á FÆé¿m“è•¢ê¿BÛûÁmë¿è£_ßz(ì¿’?­ÖÑ쿯‹¯:kií¿ñ*AÃÜîí¿zhØa_?Âî¿X‰Áí]ï¿ÂÖ¶Ê|Iï¿VàþOpï¿$–¿ƒï¿MÏ°Š½Ù?‘øƒtÜ?¾Ä8PéNß? æü”½ýà?Í3Hè‹Iâ?ÉÑÿŠã?(Œ .¾ä?©Cû3<æå?yR~¶iç?ÇÍ®g è?òTÌÕ é? ¶õ I÷é?J隷ýÔê?4 “ &¢ë?4”—C^ì?þÍïMâí?7w‰ö˜¡í?b (î?#™§à›î?ûÕcT×üî?£Í±Jï?cÉ}?…ï?e¸Ù\¬ï?ål‘ñ¿ï?ål‘ñ¿ï?e¸Ù\¬ï?kÉ}?…ï?­Í±Jï?ÖcT×üî?3™§à›î?b (î?Lw‰ö˜¡í?ÎïMâí?N”—C^ì?P “ &¢ë?h隷ýÔê?Á¶õ I÷é?UÌÕ é?5ÇÍ®g è?¡R~¶iç?ÔCû3<æå?TŒ .¾ä?÷ÑÿŠã?ü3Hè‹Iâ?;æü”½ýà?+Å8PéNß?ÿøƒtÜ?¯Ï°Š½Ù?(ÓËú,ÜÖ?+ ¶ìÓ?MíúnõðÐ?е$„ÕË?³Z÷ìò·Å?€`!{ù¿?;1&ÀÞ°²? !æAôð˜?KæAô𘿨.&ÀÞ°²¿°]!{ù¿¿MY÷ìò·Å¿)Œµ$„ÕË¿žìúnõðп ¶ìÓ¿ŽÒËú,ÜÖ¿Ï°Š½Ù¿^øƒtÜ¿Ä8PéNß¿ïåü”½ýà¿â–m×Hâ¿d'Í)R‰ã¿–D£sÀ½ä¿”odåå¿bÁµ†ÿæ¿øj’Xz è¿Öb½™é¿üB-ÇHöé¿`òÖàôÓê¿ãçT¡ë¿ cïž+]쿟þÁÃí¿LÖr‡t í¿ 8Äß&î¿d{ü‘²šî¿^Q‚¥ûî¿ÀÖ¶Ê|Iï¿Lei„ï¿SÃgC$«ï¿û4Ý9¸¾ï¿ê ÙÖ{ÝÙ?{Tzìx²Ü?Ÿ>Ãuß?šurLÓá?Ñ_=`â?¢ª7R¢ã?îU°1KØä?²æ¹#iæ?ßÑÏôç?va9W?*è?˜¨¼¥¢(é?±BØê?j"ºœIöê?~´¥ŽpÄë?´ý%Šwì??¢;ûé,í?›z%^Æí?_beuMî?ÁñvjÜÁî?qiçjK#ï?÷ª±O†qï?e¸Ù\¬ï?‡R„¿ªÓï?OI¥ÃWçï?QI¥ÃWçï?‹R„¿ªÓï?e¸Ù\¬ï?«±O†qï?~içjK#ï?ÑñvjÜÁî?_beuMî?°z%^Æí?W¢;ûé,í?Îý%Šwì?™´¥ŽpÄë?‰"ºœIöê?ÓBØê?¼¨¼¥¢(é?œa9W?*è?ÑÏôç?Ýæ¹#iæ?V°1KØä?Ϫ7R¢ã?_=`â?ÊurLÓá?oŸ>Ãuß?êTzìx²Ü?M ÙÖ{ÝÙ?)~[‹øÖ?¬²oÔ?¿ùïIûÑ?GÐføË?E›læÒÅ?x­¸‘@¿?rbŽnȲ?[•E‡ç™?ùŠE‡ç™¿Ü_ŽnȲ¿¥­¸‘@¿¿Þ›læÒÅ¿äÎføË¿ùïIûÑ¿$¬²oÔ¿Ž}[‹øÖ¿µ ÙÖ{ÝÙ¿GTzìx²Ü¿ÑŸ>Ãuß¿~urLÓá¿-nˆ_â¿KÎq¡ã¿Ú|9y}×ä¿îlûö濗⺴ç¿¡gyÚP)è¿E¬gZª'é¿’sNW€ê¿r—L…?õê¿¿z®„^Ãë¿ã¦6^€ì¿Zú´ Ê+í¿ò‡K8Åí¿Á&.VJLî¿dóxÞ¬Àî¿m7T"ï¿SàþOpï¿RÃgC$«ï¿ñ¹M¥pÒï¿OÔ?çæï¿ñHXyíÙ?[)ô 6ÄÜ?æz&56‰ß?L´hiaá?oìG›™kâ?ôFõu®ã?)Ë,.åä?'†Íæ?®õtÄ>+ç?hã¿Æ/9è?1O„Y08é?d8£'ê?ã·ôë?ëM›Õë?…ÂÞò“ì?Rª·aó>í? ŠjÆØí?VZÞ-1`î?Q/,)àÔî?½ÆÄe‹6ï?Ý€§ö„ï?ål‘ñ¿ï?OI¥ÃWçï?½¶¼ñûï?¿¶¼ñûï?SI¥ÃWçï?!ål‘ñ¿ï?瀧ö„ï?ÊÆÄe‹6ï?a/,)àÔî?iZÞ-1`î? ŠjÆØí?jª·aó>í?ŸÂÞò“ì?M›Õë?·ôë?†8£'ê?UO„Y08é?Žã¿Æ/9è?ÖõtÄ>+ç?R†Íæ?UË,.åä?"Gõu®ã?ŸìG›™kâ?}´hiaá?S{&56‰ß?Ê)ô 6ÄÜ?THXyíÙ?çä,޾×?½_@RÐÔ?™'3vÑ?9ƒÅÛX Ì?Q|UdàÅ?»<£ÌãS¿?UQXÚ¬Ó²?/Ý ñe™?ÇÒ ñe™¿½NXÚ¬Ó²¿æ9£ÌãS¿¿é|UdàÅ¿ÕÅÛX Ì¿é&3vÑ¿_@RÐÔ¿Lä,޾׿¼HXyíÙ¿')ô 6ÄÜ¿´z&56‰ß¿0´hiaá¿J®‚Ðãjâ¿¢ÖÚS³­ã¿£+&õ_ää¿ÜÑ„*æ¿(ZZ*ç¿ê#¶@8è¿_x¯t77é¿»‡¡&ê¿ñû%ûé뿪’ëgˆÔë¿xtñü‘ì¿êa/ÀÒ=í¿ÐJpÚŸ×í¿ØÈe_î¿Êâ…á¯Óî¿YÏ6ZW5ï¿þ#–¿ƒï¿ø4Ý9¸¾ï¿NÔ?çæï¿IY°RÕùï¿òHXyíÙ?])ô 6ÄÜ?èz&56‰ß?M´hiaá?pìG›™kâ?õFõu®ã?+Ë,.åä?(†Íæ?¯õtÄ>+ç?jã¿Æ/9è?2O„Y08é?f8£'ê?å·ôë?íM›Õë?‡ÂÞò“ì?Tª·aó>í? ŠjÆØí?XZÞ-1`î?S/,)àÔî?¿ÆÄe‹6ï?߀§ö„ï?ål‘ñ¿ï?QI¥ÃWçï?¿¶¼ñûï?Á¶¼ñûï?UI¥ÃWçï?#ål‘ñ¿ï?逧ö„ï?ÌÆÄe‹6ï?c/,)àÔî?kZÞ-1`î?"ŠjÆØí?lª·aó>í?¡ÂÞò“ì? M›Õë?·ôë?ˆ8£'ê?VO„Y08é?ã¿Æ/9è?×õtÄ>+ç?S†Íæ?WË,.åä?#Gõu®ã? ìG›™kâ?~´hiaá?U{&56‰ß?Ì)ô 6ÄÜ?UHXyíÙ?èä,޾×?¾_@RÐÔ?š'3vÑ?;ƒÅÛX Ì?R|UdàÅ?½<£ÌãS¿?VQXÚ¬Ó²?1Ý ñe™?ÈÒ ñe™¿¾NXÚ¬Ó²¿è9£ÌãS¿¿ê|UdàÅ¿×ÅÛX Ì¿ê&3vÑ¿_@RÐÔ¿Mä,޾׿½HXyíÙ¿))ô 6ÄÜ¿¶z&56‰ß¿1´hiaá¿L®‚Ðãjâ¿£ÖÚS³­ã¿¤+&õ_ää¿ÜÑ„*æ¿(ZZ*ç¿ë#¶@8è¿_x¯t77é¿»‡¡&ê¿òû%ûé뿪’ëgˆÔë¿ytñü‘ì¿ìa/ÀÒ=í¿ÐJpÚŸ×í¿ØÈe_î¿Êâ…á¯Óî¿ZÏ6ZW5ï¿ÿ#–¿ƒï¿ú4Ý9¸¾ï¿NÔ?çæï¿JY°RÕùï¿î ÙÖ{ÝÙ?Tzìx²Ü?Ÿ>Ãuß?œurLÓá?Ó_=`â?¤ª7R¢ã?ñU°1KØä?µæ¹#iæ?âÑÏôç?ya9W?*è?›¨¼¥¢(é?´BØê?n"ºœIöê?´¥ŽpÄë?¸ý%Šwì?C¢;ûé,í?Ÿz%^Æí?_beuMî?ÅñvjÜÁî?uiçjK#ï?ûª±O†qï?e¸Ù\¬ï?‹R„¿ªÓï?SI¥ÃWçï?UI¥ÃWçï?R„¿ªÓï?e¸Ù\¬ï?«±O†qï?‚içjK#ï?ÕñvjÜÁî?_beuMî?´z%^Æí?[¢;ûé,í?Òý%Šwì?´¥ŽpÄë?"ºœIöê?ÖBØê?¿¨¼¥¢(é?Ÿa9W?*è? ÑÏôç?àæ¹#iæ?V°1KØä?Òª7R¢ã?_=`â?ÍurLÓá?sŸ>Ãuß?íTzìx²Ü?P ÙÖ{ÝÙ?+~[‹øÖ?Ŭ²oÔ?ÂùïIûÑ?KÐføË?H›læÒÅ?|­¸‘@¿?ubŽnȲ?^•E‡ç™?üŠE‡ç™¿Þ_ŽnȲ¿©­¸‘@¿¿á›læÒÅ¿èÎføË¿ùïIûÑ¿&¬²oÔ¿‘}[‹øÖ¿¹ ÙÖ{ÝÙ¿KTzìx²Ü¿ÕŸ>Ãuß¿€urLÓá¿/nˆ_â¿NÎq¡ã¿Ü|9y}×ä¿òlûö濛⺴ç¿¥gyÚP)è¿I¬gZª'é¿—sNW€ê¿v—L…?õê¿Äz®„^Ãë¿ã¦6^€ì¿]ú´ Ê+í¿ö‡K8Åí¿Å&.VJLî¿ióxÞ¬Àî¿p7T"ï¿WàþOpï¿VÃgC$«ï¿ö¹M¥pÒï¿TÔ?çæï¿SÏ°Š½Ù?˜øƒtÜ?ÆÄ8PéNß?æü”½ýà?Ñ3Hè‹Iâ?ÎÑÿŠã?-Œ .¾ä?¯Cû3<æå?R~¶iç?ÇÍ®g è?ùTÌÕ é?¦¶õ I÷é?P隷ýÔê?; “ &¢ë?;”—C^ì?ÎïMâí?>w‰ö˜¡í? b (î?+™§à›î?ÖcT×üî?«Í±Jï?kÉ}?…ï?e¸Ù\¬ï?!ål‘ñ¿ï?#ål‘ñ¿ï?e¸Ù\¬ï?sÉ}?…ï?µÍ±Jï?ÖcT×üî?;™§à›î?b (î?Sw‰ö˜¡í?ÎïMâí?U”—C^ì?W “ &¢ë?o隷ýÔê?ȶõ I÷é?UÌÕ é?;ÇÍ®g è?§R~¶iç?ÙCû3<æå?YŒ .¾ä?üÑÿŠã?4Hè‹Iâ??æü”½ýà?2Å8PéNß?ùƒtÜ?¶Ï°Š½Ù?.ÓËú,ÜÖ?0 ¶ìÓ?QíúnõðÐ?‘µ$„ÕË?¸Z÷ìò·Å?‡`!{ù¿?@1&ÀÞ°²?¦!æAôð˜?QæAô𘿭.&ÀÞ°²¿¸]!{ù¿¿SY÷ìò·Å¿0Œµ$„ÕË¿¢ìúnõðп’ ¶ìÓ¿”ÒËú,ÜÖ¿Ï°Š½Ù¿eøƒtÜ¿•Ä8PéNß¿óåü”½ýà¿â–m×Hâ¿h'Í)R‰ã¿šD£sÀ½ä¿™odåå¿hÁµ†ÿæ¿ýj’Xz è¿Ûb½™é¿C-ÇHöé¿gòÖàôÓê¿éçT¡ë¿¥cïž+]ì¿%ŸþÁÃí¿SÖr‡t í¿ˆ 8Äß&î¿j{ü‘²šî¿eQ‚¥ûî¿ÈÖ¶Ê|Iï¿Sei„ï¿YÃgC$«ï¿5Ý9¸¾ï¿sÀv˜¹Ù?š?LûYÜ?¦­Þ_Àß? òC-Þà? õ·5“'â?X7߯eã?‰ ˜ä?ù÷ÐÀ½å?àø¯Õæ?ÿE5»ßç?ÕÛè?—^­ Çé?ržÎx%£ê? ϸÐnë?†Ú\Ï)ì?8iP’òÒì?reˆŠjí?_±D8ðí?JöLcî?aýUÙFÃî?rC{‚ï?­Í±Jï?«±O†qï?瀧ö„ï?逧ö„ï?«±O†qï?µÍ±Jï?|C{‚ï?nýUÙFÃî?ZöLcî?r±D8ðí?‡eˆŠjí?PiP’òÒì? Ú\Ï)ì?'ϸÐnë?‘žÎx%£ê?¸^­ Çé?@ÕÛè?$F5»ßç? ø¯Õæ?$øÐÀ½å?µ ˜ä?†7߯eã?9õ·5“'â?Í òC-Þà?®Þ_Àß?@LûYÜ?ÕÀv˜¹Ù?ºi=¨µ±Ö?º§·²ÇÓ?7åuÜ|ÑÐ?eÐdÏ¡Ë?Œ «ušÅ?qÉgá2à¾?=† &޲?Om7ŸÂ˜? m7ŸÂ˜¿¯ƒ &޲¿§Ægá2྿*«ušÅ¿¯cÐdϡ˿‰äuÜ|Ñп§·²ÇÓ¿!i=¨µ±Ö¿?Àv˜¹Ù¿g?LûYÜ¿u­Þ_Àß¿ òC-Þà¿KK à&â¿b#loeã¿&8Ä8—ä¿™Â1·¼å¿øG·ÍÔæ¿¤¼¹—ÏÞ翸XÅÚ迬á FÆé¿v“è•¢ê¿KÛûÁmë¿ð£_ßz(쿚?­ÖÑ쿹‹¯:kií¿ú*AÃÜîí¿„hØaî¿Â_?Âî¿b‰Áí]ï¿ÌÖ¶Ê|Iï¿_àþOpï¿ $–¿ƒï¿žÙû &NÙ?‚uуqÜ?¼÷KlÇÞ?ÓeªÐ5´à?%á:húá?Äâ8„5ã?#ûqÇdä?¿Ðáv‡å?yëc?ßœæ?ê1wU¤ç?›ò¢ 7è?ì¼ßê†é?Rẵß`ê?Àn˜<*ë?¤S³ãë?öqõ <‹ì?Z£ Ô]!í?°Iutˆ¥í?—}jjî?»cz½vî?dýUÙFÃî?ÖcT×üî?~içjK#ï?ÊÆÄe‹6ï?ÌÆÄe‹6ï?‚içjK#ï?ÖcT×üî?nýUÙFÃî?Ècz½vî?§}jjî?ÂIutˆ¥í?o£ Ô]!í? rõ <‹ì? ¤S³ãë?Ûn˜<*ë?qẵß`ê? ½ßê†é?¾ò¢ 7è?1wU¤ç? ëc?ßœæ?éÐáv‡å?NûqÇdä?ñâ8„5ã?Tá:húá?fªÐ5´à?q¼÷KlÇÞ?îuуqÜ?ÿÙû &NÙ?bRU?yÖ?Â6¨p|–Ó?ðXû¤§Ð?i]á ]Ë?ïŒèõYÅ?gAa“¾?Þïû_²?BéÞú…˜?ßÞú…˜¿€Ûïû_²¿KdAa“¾¿°íŒèõYÅ¿\á ]Ë¿EXû¤§Ð¿&6¨p|–Ó¿ËRU?yÖ¿jÙû &NÙ¿Ouуqֻܿ÷KlÇÞ¿¸eªÐ5´à¿§8Ͷùá¿Ò[¤Æ4ã¿Øw‹-þcä¿„ÀÚg¢†å¿H”aœæ¿·¬ $l£ç¿t;B!Dœè¿*R”î…é¿Êá`Û_ê¿~O@!„)ë¿?·Õvlâë¿‚X"Šì¿B”{V> í¿¶œ‡Þc¤í¿QÊ£pAî¿ €Óuî¿Ç_?Âî¿nQ‚¥ûî¿}7T"ï¿lÏ6ZW5ï¿ ¶¬@÷þØ? V§C—»Û?y“GÅgÞ?¿êñà?ŽSõÒ&Âá?îm¥Íhùâ?÷§ÿ÷$ä?¥tŽðDå?ÇÞQEVæ?˜õ[Zç?¶þ æ1Pè?XÒÿ 7é?8©EUê?N¶±ŽÕê?,1y;Œë?*Þõê1ì?2Vâõ6Æì?DÄHí? ·Œ¢A¹í?š}jjî?PöLcî?3™§à›î?ÑñvjÜÁî?a/,)àÔî?c/,)àÔî?ÕñvjÜÁî?;™§à›î?ZöLcî?§}jjî?0·Œ¢A¹í?¢DÄHí?GVâõ6Æì?AÞõê1ì?E1y;Œë?i¶±ŽÕê?V©EUê?yÒÿ 7é?Øþ æ1Pè?;˜õ[Zç?íÞQEVæ?ÏtŽðDå?!¨ÿ÷$ä?n¥Íhùâ?¼SõÒ&Âá?¿¿êñà?â“GÅgÞ?tV§C—»Û?l¶¬@÷þØ?§fÔì2Ö?˜F¿˜1YÓ??#™‡sÐ?á;åypË?dðÖZ&Å?óòÎÞ´3¾?ãšì®|&²?¶€'ŠK8˜?®v'ŠK8˜¿c˜ì®|&²¿8ðÎÞ´3¾¿ ïÖZ&Å¿Š:åypË¿•ÿ"™‡sпÿE¿˜1YÓ¿p¦fÔì2Ö¿Úµ¬@÷þØ¿×U§C—»Û¿I“GÅgÞ¿u¿êñà¿Ñ~wÁá¿~ûW‹­øâ¿/äXH0$ä¿s*GCå¿=W Ô@Uæ¿êtYç¿*ýÇòAOè¿W$ƒ;6é¿2kT ê¿‚¦ŸÜ…Ôê¿ <ñ™+‹ë¿ã ¤²Ô0ì¿¡èûÅì¿™3Þ£Gí¿±!øI¸í¿TÊ£pAî¿hØaî¿v{ü‘²šî¿xóxÞ¬Àî¿ßâ…á¯Óî¿# ^ Ø?Ô"‚¢RÛ?…1 ôÝ?{·îdAà?Y+¯¯ñ~á?¿ò±™±â?na8LºØã?¶8{óä?A! È”æ?“Æ*´ùç?ÐwR.ôç?ÏÓ©œ×è?S§M¹«é?¦$B‚pê?oðÃòù#ë?jêc6Çë?`BG'QYì?¡Ãù#ðÙì?“DÄHí?¶Iutˆ¥í?i±D8ðí?b (î?_beuMî?iZÞ-1`î?kZÞ-1`î?_beuMî?b (î?r±D8ðí?ÂIutˆ¥í?¢DÄHí?³Ãù#ðÙì?tBG'QYì?êc6Çë?ˆðÃòù#ë?À$B‚pê?q§M¹«é?$ÏÓ©œ×è?òwR.ôç?¸Æ*´ùç?g! È”æ?*¶8{óä?˜a8LºØã?êò±™±â?†+¯¯ñ~á?ª·îdAà?…1 ôÝ?mÔ"‚¢RÛ?m# ^ Ø?¢û„éÞÕ?ƒpáü÷Ó?˜‹ÚD5Ð?x“;ƒ%¡Ê?KÆ¿UÇÄ?ÙY×gÁ½?Ûô;ÒËá±? ¬6¢Ü—?º¬6¢Ü—¿eò;ÒË᱿)Y×gÁ½¿õÄ¿UÇÄ¿&’;ƒ%¡Ê¿ñŠÚD5пìoáü÷Ó¿û„éÞÕ¿Ü" ^ Ø¿ÒÓ"‚¢RÛ¿ê…1 ôÝ¿a·îdAà¿È<E~á¿.ŒU4á°â¿µöömö×ã¿èzµÎòä¿ßñ²™»æ¿µ§[£ç¿ü*¸Aóç¿1¹~§Öè¿JA·»ªé¿Âú˜ûnê¿'ûmî"ë¿ MÉ=$Æë¿<«`9Xì¿|&YgÓØì¿œ3Þ£Gí¿¾œ‡Þc¤í¿+AÃÜîí¿˜ 8Äß&î¿Ø&.VJLî¿ðÈe_î¿9Å”2Ø?æïùÓØÚ?y¯¸†„nÝ?µð Wòß?­|ëCò0á?×B.C^â?Ç&+@€ã? Ê#6–ä?ÍêyŸå?ü}Ðg›æ?ß–ôwd‰ç?ÍL Ýhè?qflæG9é?váR$úé?â/lûªê?§Tü$`Kë?ÚW5‘ïÚë?bBG'QYì?8Vâõ6Æì?c£ Ô]!í?}eˆŠjí?Lw‰ö˜¡í?°z%^Æí? ŠjÆØí?"ŠjÆØí?´z%^Æí?Sw‰ö˜¡í?‡eˆŠjí?o£ Ô]!í?GVâõ6Æì?tBG'QYì?íW5‘ïÚë?½Tü$`Kë?ú/lûªê?áR$úé?ŽflæG9é?íL Ýhè?—ôwd‰ç? }Ðg›æ?óêyŸå?4Ê#6–ä?ð&+@€ã?B.C^â?Ú|ëCò0á?ñ Wòß?߯¸†„nÝ?‡æïùÓØÚ?–Å”2Ø?ëìŒ4i}Õ?£@øÅüºÒ?t¸JÚÏ?š¡ í¿Ê‹¯:kií¿hÖr‡t í¿‡K8Åí¿íJpÚŸ×í¿¯j"ßµ×?°ô%ÊvNÚ?³½xÕÖÜ?æ9²DjMß?ÚëªXØà?µŠ$¨˜ÿá?uËÓ¿ã?—…,ä?Èí&, 0å?nÛ­ä&æ?øÕÊËç?O.´ëç?ð†[\H·è?¯JYÐBté?¬EA„Š!ê?TvFš´¾ê?ªTü$`Kë?pêc6Çë?3Þõê1ì?rõ <‹ì?FiP’òÒì?ÎïMâí?W¢;ûé,í?jª·aó>í?lª·aó>í?[¢;ûé,í?ÎïMâí?PiP’òÒì? rõ <‹ì?AÞõê1ì?êc6Çë?½Tü$`Kë?jvFš´¾ê?ÄEA„Š!ê?ÉJYÐBté? ‡[\H·è?n.´ëç?ÖÊËç?=nÛ­ä&æ?ìí&, 0å?¾…,ä?ËÓ¿ã?ߊ$¨˜ÿá?ìªXØà?@:²DjMß?¾xÕÖÜ?õ%ÊvNÚ?ø¯j"ßµ×?—^n¨Õ?h¶]tZÒ?° ËÞ5Ï? ŽÛ“£É?­"̵yÄ?Ã়?ä­·„…7±?¢Ÿ•kù–?–•kù–¿…«·„…7±¿oÀ়¿d!̵yÄ¿Ä ŽÛ“£É¿n ËÞ5Ͽ׵]tZÒ¿ ^n¨Õ¿m¯j"ߵ׿€ô%ÊvNÚ¿†½xÕÖÜ¿³9²DjMß¿2Õk²×à¿ ÌEçþá¿Ð¶¦pã¿\sÖoU+ä¿j^À8/å¿j‡1 &æ¿»¶±/3ç¿MPd§#ê翚,·oT¶è¿¾¶¨šGsé¿Gôq ˆ 꿼d§¬½ê¿…šÐÅRJë¿MÉ=$Æë¿ò ¤²Ô0ì¿”X"Šì¿±?­ÖÑì¿AŸþÁÃí¿|ú´ Ê+í¿b/ÀÒ=í¿®9 Š*×?/‡óGà³Ù?ˆ\-Ü?¸¤žx•Þ?ú*’†[uà?t˜«Ô•á?€rýu«â?0«0’µã?áÞÍH‡³ä?ÂÂt'¸¤å?†têˆæ?† ‚^ç?Šzž &è?%듎®Þè?¸pþû‡é?®EA„Š!ê?ç/lûªê?wðÃòù#ë?71y;Œë?¤S³ãë?—Ú\Ï)ì?N”—C^ì?Îý%Šwì?ŸÂÞò“ì?¡ÂÞò“ì?Òý%Šwì?U”—C^ì? Ú\Ï)ì? ¤S³ãë?E1y;Œë?ˆðÃòù#ë?ú/lûªê?ÄEA„Š!ê?4¸pþû‡é?>듎®Þè?¦zž &è?8† ‚^ç?¦têˆæ?äÂt'¸¤å?ßÍH‡³ä?W«0’µã?¨rýu«â?˜«Ô•á?%+’†[uà?¥žx•Þ?sˆ\-Ü?’‡óGà³Ù?: Š*×?syåJê’Ô?Ê£ÛJšîÑ?×åJv~Î?ÀŒŒé É? BíÊé‹Ã?ºdcû·ý»?®.YÒ°?sÐ,qir–?'Ç,qir–¿Á«.YÒ°¿3bcû·ý»¿È@íÊé‹Ã¿‚‹Œé É¿åJv~ο<£ÛJšîÑ¿éxåJê’Ô¿9 Š*׿‡óGà³Ù¿å~ˆ\-Ü¿†¤žx•Þ¿Š|¹tà¿Tžô&•á¿|Ö¼ªâ¿³ŸçŠÏ´ã¿e/.ûº²ä¿a:~â£å¿ús⇱‡æ¿` €k›]ç¿Ja듎®Þè?€‘ÌÃ9è?lt¾?è…ç?ãé`ÔŠÃæ?ý/i#óå?pvf…2å?N€~ A*ä?ôBÇÚß2ã?VxЧ/â?íkõ7!á?"ÿàå7à?€›‘P©ÊÝ?nEƒrÛ?sÄýÉo Ù?QnpëÖ?<qO| Ô?xFP±wÑ?¨Èm@´Í?Ù:D:ÌfÈ?rgÔK Ã?Zo(¦D»?¼êöÒÌb°?QøÑÝ•?qHøÑÝ•¿{èöÒÌb°¿äl(¦D»¿9gÔK ÿ¤9D:ÌfÈ¿vÇm@´Í¿îEP±wÑ¿µ~qO| Ô¿~PnpëÖ¿æÃýÉo Ù¿nEƒrÛ¿úš‘P©ÊÝ¿ÿ˜æ¬™࿆Ú7çŽ á¿æ<ßô.⿃ØXa"2㿦{¥z)ä¿ùßsbå¿LÉJòå¿ö„º+ªÂæ¿·ªâ…ç¿E欶Ô8è¿ò˹Ýè¿Æ¶¨šGsé¿ýTó#ùé¿Ôú˜ûnê¿™¦ŸÜ…Ôê¿–O@!„)ë¿hÛûÁmë¿ èT¡ë¿èz®„^Ãë¿Ô’ëgˆÔë¿H k béÕ?¬7”mŽOØ?#ào’¼¦Ú?nÇ<ôzíÜ?ÂjC.b"ß?²Þ=î ¢à?ã4¹¢¨á?-MV…V¤â?<Ú_‹”ã?Nº9K¬xä?ŒZSo-På?ah›‰æ?5WxD׿?Tt¾?è…ç?zž &è?ø†[\H·è?|flæG9é?a§M¹«é?I©EUê?fẵß`ê?ˆžÎx%£ê?h隷ýÔê?‰"ºœIöê?·ôë?·ôë?"ºœIöê?o隷ýÔê?‘žÎx%£ê?qẵß`ê?V©EUê?q§M¹«é?ŽflæG9é? ‡[\H·è?¦zž &è?lt¾?è…ç?OWxD׿?9ah›‰æ?ªZSo-På?nº9K¬xä?^Ú_‹”ã?QMV…V¤â?7ã4¹¢¨á?ÙÞ=î ¢à?kC.b"ß?ÁÇ<ôzíÜ?ào’¼¦Ú? 8”mŽOØ?œ k béÕ?Ù8²uÓ?Æ¿L öÐ?òÀÿ¸×Ì?YXSW¢±Ç?}0kÂï|Â?¿a€¬yº?ãªïKÒ¯? ’¶:;•?A‰¶:;•¿¦ïKÒ¯¿¹¼a€¬yº¿L/kÂï|¿-WSW¢±Ç¿É¿ÿ¸×Ì¿?¿L öп…Ù8²uÓ¿ k béÕ¿€7”mŽOØ¿ùßo’¼¦Ú¿?Ç<ôzíÜ¿°®é.!ß¿ã'Çf¡à¿–rô§á¿ÚŠž£â¿Å ÚÉ“ã¿QÐsBâwä¿ö,·[Oå¿^.¯v¯æ¿ò +—bÖæ¿»ªâ…ç¿Qa‘·†ÊÙ?´%ÝÕ®†×?ÿ5U4Õ?&JFÊçÔÒ? ¸ˆ0ÝiÐ?=`féË?–¶&žÛíÆ?vÃ,äÁ?FÇ%bêž¹?_ñ0_\Ë®?{03Ì‹”?‚r03Ì‹”¿!í0_\Ë®¿öÄ%bêž¹¿PÃ,äÁ¿sµ&žÛíÆ¿`féË¿‡·ˆ0Ýiп§IFÊçÔÒ¿†ÿ5U4Õ¿/%ÝÕ®†×¿¼·†ÊÙ¿–¯!puþÛ¿¬@«÷Þ¿àÃ.ýà¿Ö]åBῃ@ë› â¿mkÆòâ¿Öá}ÂÎ㿨oÖïFŸä¿ò±'ƒcå¿a.¯v¯æ¿þ„º+ªÂæ¿l €k›]ç¿]Pd§#êç¿ Øè3ìgè¿J¹~§Öè¿t$ƒ;6é¿LR”î…é¿Ðá FÆé¿+C-ÇHöé¿ÂsNW€ê¿ì‡¡&ê¿âe¸’4rÔ?è]"åL¯Ö?ðô޳gÞØ?_Pq-,þÚ?XPµ÷J Ý?Õ0’û~ ß?„Gzà?ÑíF+%eá?½^ºßHEâ?„ëIù'ã?è+d/?ãã?‡r} ä?’ZSo-På?íü/i#óå?‘têˆæ?ÖÊËç?ð–ôwd‰ç?ãwR.ôç?Ìþ æ1Pè?´ò¢ 7è?9ÕÛè?UÌÕ é?¼¨¼¥¢(é?UO„Y08é?VO„Y08é?¿¨¼¥¢(é?UÌÕ é?@ÕÛè?¾ò¢ 7è?Øþ æ1Pè?òwR.ôç?—ôwd‰ç?ÖÊËç?¦têˆæ?ý/i#óå?ªZSo-På?¢r} ä?,d/?ãã?¢ëIù'ã?Ý^ºßHEâ?óíF+%eá?;„Gzà?1’û~ ß?¤Pµ÷J Ý?¬Pq-,þÚ?Fõ޳gÞØ?@^"åL¯Ö?0f¸’4rÔ?Ÿ®-€(Ò?ú#rÜ1§Ï?²e8éÝéÊ?WÒHÌðÆ?ºiÎ a@Á?¯ðp5[´¸?Á ôÖo±­?+Þz‚²Ï“?öÕz‚²Ï“¿«ôÖo±­¿sîp5[´¸¿ŸhÎ a@Á¿>ÑHÌðÆ¿d8éÝéÊ¿#rÜ1§Ï¿ˆž®-€(Ò¿¸e¸’4rÔ¿¿]"åL¯Ö¿Èô޳gÞØ¿2Pq-,þÚ¿;A@, Ý¿d¼¢L ß¿o°ßx¤yà¿z²³~ydá¿””Dâ¿Ù Îskã¿[Rézâ㿪oÖïFŸä¿ü,·[Oå¿LÉJòå¿t⇱‡æ¿Ì¶±/3ç¿Ôc³.|ˆç¿ü*¸Aóç¿IýÇòAOè¿–;B!Dœè¿ßXÅÚè¿c½™é¿v¬gZª'é¿x¯t77é¿ë÷ÑÜw£Ó?{5jpíÉÕ?^Üõòâ×?•";=íÙ?Uú $ŠçÛ?1æp¡ÐÝ?¥U§ß?XqBµà?R]‹Œá?.ÌÑ Yâ?‡ëIù'ã?¾L†Ïã?Wº9K¬xä?[vf…2å?ÐÂt'¸¤å?+nÛ­ä&æ?}Ðg›æ?©Æ*´ùç?/˜õ[Zç?1wU¤ç?F5»ßç?5ÇÍ®g è?œa9W?*è?Žã¿Æ/9è?ã¿Æ/9è?Ÿa9W?*è?;ÇÍ®g è?$F5»ßç?1wU¤ç?;˜õ[Zç?¸Æ*´ùç? }Ðg›æ?=nÛ­ä&æ?äÂt'¸¤å?pvf…2å?nº9K¬xä?™¾L†Ïã?¢ëIù'ã?JÌÑ Yâ?%R]‹Œá?yqBµà?^¥U§ß?wæp¡ÐÝ?ú $ŠçÛ?Ù•";=íÙ?°Üõòâ×?Ï5jpíÉÕ?5øÑÜw£Ó? .«¶åpÑ?¨3„ã#gÎ?ç;H¼ÙÉ?ÙàWc<Å?:/ä£ñ‘À?Äñ¢º·?µ^îL3…¬?‰ð<ø`“?§è<ø`“¿ÇZîL3…¬¿Ÿñ¢º·¿*.ä£ñ‘À¿ËàWc<Å¿ æ;H¼ÙÉ¿·2„ã#gο”-«¶åpÑ¿Â÷ÑÜw£Ó¿S5jpíÉÕ¿8Üõòâ׿d•";=íÙ¿[ ®¿væÛ¿(£1{ÏÝ¿N Y¦ß¿lÁ·´à¿ÓQ,ދΈúLXâ¿Þ Îskã¿Öá}ÂÎã¿\ÐsBâwä¿ßsbå¿s:~â£å¿€‡1 &æ¿ãÚ󳈚æ¿Ö§[£ç¿@êtYç¿Þ¬ $l£ç¿Î¼¹—ÏÞç¿+k’Xz è¿ÕgyÚP)è¿ $¶@8è¿Tý\”žÈÒ?_·‹í×Ô?Öý÷ÂØÖ?ZÇwìPÌØ?gÄS´“°Ú?—nƒ§`„Ü?¬GÀD—FÞ?Šmyã!öß?Çnˆ/ûÈà? R]‹Œá?Â^ºßHEâ?X‡ÇÁòâ?GÚ_‹”ã?:€~ A*ä?òÞÍH‡³ä?Ûí&, 0å?ãêyŸå?Y! È”æ?âÞQEVæ?—ëc?ßœæ? ø¯Õæ?¡R~¶iç?ÑÏôç?ÖõtÄ>+ç?×õtÄ>+ç? ÑÏôç?§R~¶iç? ø¯Õæ? ëc?ßœæ?íÞQEVæ?g! È”æ?óêyŸå?ìí&, 0å?ßÍH‡³ä?N€~ A*ä?^Ú_‹”ã?p‡ÇÁòâ?Ý^ºßHEâ?%R]‹Œá?änˆ/ûÈà?Émyã!öß?ìGÀD—FÞ?Ùnƒ§`„Ü?­ÄS´“°Ú?¡ÇwìPÌØ?aÖý÷ÂØÖ?°·‹í×Ô?œý\”žÈÒ?så ‰®Ð?. ÙUÍ?Îæ+R©¹È?ùC×½OÄ?{9”²¿?Oθ!²¶?ª ë_G«?–ö$S3’? ï$S3’¿éŒ ë_G«¿B›Î¸!²¶¿öx9”²¿¿øB×½OÄ¿Ïå+R©¹È¿H ÙUÍ¿—rå ‰®Ð¿.ý\”žÈÒ¿:·‹í×Ô¿îÕý÷ÂØÖ¿1ÇwìPÌØ¿ÌnáLŒ¯Ú¿¦µJ7GƒÜ¿#6SylEÞ¿ýKuæôß¿jF(ˆUÈà¿ÚQ,Þ‹á¿(””Dâ¿mkÆòâ¿(Å Úɓ㿿{¥z)ä¿/.ûº²ä¿‰^À8/å¿€ËÙƒ¤žå¿ò²™»æ¿iW Ô@Uæ¿w”aœæ¿,G·ÍÔæ¿žÁµ†ÿæ¿Ô⺴ç¿gZZ*ç¿–ü“]wäÐ?€„‡õÐ?H"ùA¥‹Î?ýžÖ³ÂÌ? fI‰=äÊ?îÕ-ØòòÈ?s¯Ýc,õÆ?‰BßnÍíÄ?^ÛûsãÂ?¦Hlñ@ÙÀ?Z½ÁK«½?¿íq í·¹?9À¬LIäµ?àƒ¸¤H7²?5ÂÓ¨Œv­?8íçÁ‚î¦?\4“ˆç ?BôÙvÜ–?Þ>|>Š?q»½¹År?-ðRù7c¿P¾ 50€¿epG¶ò$ˆ¿dMæ°¡Œ¿’d‰…c!¿Î»JÍ/C¿¼&7¡Ov‹¿œß³ív߃¿‰ªJôps¿H’×;]X?ÌèõÙh‚?Šÿz.É=’?ŒÍbœ?\îïÕ£?©¾€Ûë©?© ¸à:°?Ü5S¨³?úâúõ>·?ß{ù·Eêº?WÿXvw¬¾?hwš'9Á?ÄFøÃ?ñïßùÄ?nˆÚ’ÌÆ?À}–žþŽÈ?B›8Ín?Ê?Náa=ÖË?|™o&3RÍ?Pûð”­Î? PœåÏ?¦ ŠözÐ?Y E1ïÐ?6YµPMÑ?ÜhËN•Ñ?P ½3ÅÑ?Q¸ã?ÝÑ?ý?K™FÝÑ?ûïŠcÅÑ?:¼Ž•Ñ?¿Ç{$MÑ?\]úèîÐ?Ø_Ü@“zÐ? Èã$äÏ?¨…„á«Î?Ô¡–½ïPÍ?-C·óÚÔË?cQèÁò=Ê?ò®dnÈ?€³öóÊÆ?¶Á†ßj÷Ä?u‚øLÃ?:ßVoW7Á?nÓz„8©¾?‰Ã5'çº?~"tž";·?¦B«Ñp¥³?¸Úkš8°?ç–ØLè©?°,&÷³Ó£?¼aœ?°B’jA’?÷6êÁiz‚?„ Œ,TY?8Ûv­äs¿6³f€Ÿƒ¿àý©9ž#‹¿k#W¯ÞŽ¿‹h(j«Ž¿U˜ƒ;ÝWÐ?¢˜tUÏ?7Ç4‡äaÍ?8| IË?çSÆØ§É?¼Ü¢`3­Ç?¤@(Û¤Å?éÍ…êÚ“Ã?äì5ÍÅ~Á?waGAÖ¾?l| ÷?Ñ‹ŽŒq´¶?â™>¹<Ͳ?£Ãϵ®?c55˜Ò§?ú%i…¶` ?VŸeµÂx”?B܈´´µ‚? [)iÕÂA¿Ĝˀ4‚¿yÒK®¦H¿³ú¸÷ñ•¿`IOõ6š¿m>”©^~œ¿MZ´D´¿Ì;S‰½i¿áÍxÚÃ?姪è¸Å?Ø?U‡Ç?K¶>nAÉ?ëØÑâÊ?ŒYhgÌ?<¹, DËÍ?67uî Ï?Ó… 6åÐ?üBÉ.~‡Ð?åûYPèÐ?ŸTì ;1Ñ?ãA&•ƒbÑ?Çø¦ {Ñ?Ói{Ñ?ý\ˆbÑ?|p“š$1Ñ?²'o¨ÐçÐ?bæ¢(‡Ð?| ërÐ?¼j9z Ï?EYÃûúÉÍ?©§ ÏôeÌ?6>9áÊ?!¼ÜV·?É?Ë)}K7…Ç?Û¡®ö·Å?t)t†ØÃ?GŸúÏìïÁ?*T½cÀ?ê+?"¼? ‚Ñ.I¸?nÅzÁ)„´?% …ذ?}¿ßЧª? ™/˜7ô£?“ @¢i›?´jŠœ²°?J=“óµu?.ëI"تn¿Þ%”Óz‡¿ÁÁá ×R’¿ý‡Ot—¿Æ‘8ž ›¿=ÚKþ2¿J–±Ws¿ràå _Ï?ñ–Š¿Í?V5 ˆÌ?»©ú›%Ê?Îìtµ3È?‹Üû§õ.Æ?è·³ûšÄ?>vÕ³*Â?¬cÒÜÄ¿?çp@øÅ‡»?$1ac,X·?“A0xÅ>³?ÔœÉ4=‹®?§†Äåë¦?®ÝnÐcŸ?µuÎÜ‘?O1yÀ‚u?š‰óÀw¿(&ÁçÈú¿á¾_¼­˜¿ù»]ƫäÍî¤ûÕ¢¿;·ŒF錄ÁqRE+¦¿¨Z{J¼¦¿›9/’/ƒ¦¿•~`nÇ]¥¿øÒ¹z£¿}ïûTÏ ¿ÖFX`/К¿¼¿nt’¿*&7€³,‚¿(É帾„Z?† @­ ‹?Õ3§ÂÁbš?·'µE¤?úÜýËçI«?æÂo‚h±?`<À¿¼Fµ?8T²‚7¹?XÖ&0½?PK¨:“À?ŽÙZèJˆÂ?¯ý¦rÄ?è8Ñ#ÞKÆ?oè½²È?Œläs¼É?ë赦>JË?˜ŸîÚ¶Ì?`@õtýÍ?àŒkÛúÏ?’ÞÄ…FÐ?¨” 6jÐ?˜{mù´Ð??ìÁl—çÐ?«ÊÑ?†ëÆÑ?2þ …çÐ?¸è δÐ?œÐ™«íiÐ?E2i•ÞÐ?L-ÃgîÏ?(%G/üÍ?2èGˆ`µÌ?æï}Ù”HË?š£T ºÉ?ß !:»È?—.ÞÈIÆ?<Äg ãoÄ?p²Ôà †Â?ä{ÓëÀ?Ñ[\Ÿv+½?ÆÚ>ÐÊ2¹?‡™¬7Bµ?tàÈa]c±?›)ÍYÈ@«?‡ÀÐë¤?mßLbRš?rÄL‹ðŠ?²I²ªÇY?ý—p&+<‚¿2:ÉNŸ’¿ˆŽÔ[àÉš¿¢ì-«ÏÆ ¿ƒj¤ìj£¿ŠÍ&i[G¥¿ÂG*9Ie¦¿Ü c«—¦¿Ú:áí×Í?¸`Wòn0Ì?p#YJ¡hÊ?,ˆÒ7„È?®.DÿìˆÆ?ý»˜™BzÄ?µëÌ¢]Â?‚ XQí7À?ï}T˼?üAêŸ#Ì·?¼ÎçBjˆ³?¾Œ&·®?ëüø}Ÿ¦?J¹Œœ¹?‹Øt)Ž?ÆY*_|öS?MÒeÉ䆿ÓÀþÛò–¿vuž÷“ ¿ß³ãŸü¤¿ÅÊ7f©¨¿së’«¿‰üS¯­¿²•–XÛ쮿À¶W[w¯¿FæåÈ"0¯¿c“¦v-ú­¿’ät-¬¿N\™ÐiF©¿Ž—´˜Å¥¿ªNºUt¡¿ úãP™¿"[[xMŽŒ¿èqV‡¢Ê`¿ÖŽ_ 1†?Ìo",V-™?5¤?$Íu®'¶«?†}çPYÒ±?ìtN¸ÑÛµ?\äÞÕ9í¹?ååü½?Sn:Ò$ÿÀ?d{"à§ôÂ?û]æ¹ÙÄ?ÁMÿ]©Æ?pΆQ!_È?þmzƒpöÉ?Í›[wkË?°§É©"ºÌ?æ¾ZÓlßÍ?á*#ÏØÎ?ÅAªr¢Ï?\Ï/¥ÜÐ?p¼&‰QÐ?Z`÷¼dkÐ?Á‡XXSkÐ?j»öÖ\QÐ?Ücå„™Ð?ž‚¬½²¡Ï?Ïçl-×Î?h\K0ÞÍ?šÁ}ܨ¸Ì?<Ý÷óÃiË?VÂ.9‰ôÉ?Ás ]È?Gjm¡§Æ?7GÝÕX×Ä?̼Æ*òÂ?a †üÀ?L[•Îö½?°Qõ†Ìç¹?DCÇÁMÖµ?ŽQ9aÄ̱?îj窫?}2´Hìô£?HGSøâ™?••àŸ†?Þ‰;ÅÏra¿–: †´Œ¿nŸ¹P `™¿ÑÝü#‰’¡¿<ÀßZÆ¥¿œK—½ê@©¿u­-azø«¿c¬ö¦òâ­¿ÀaF ¯¿˜4éhM¯¿²ÏaÌ?ý*fÓkÊ?‹¡ýD›È?û‚Þ¿ÿ­Æ?Çuæ÷¨¨Ä?¤ÿàÂ?>Z$)iÀ?¼†Jr¼?š& ¸?× õd¥³?|@h›®?¶ÝnË|¦?°•R£Úº›?î¿’ Ë݇?áØ%SÖHh¿ %© ‘¿ÒÑXlfñ¿w¡b7èФ¿ªƒµšÿ©¿Lkx®¿ˆdÈ3²±¿HCØf°²¿&V·O¢³¿¬U–—A´¿n{;Ž-ƒ´¿„€öòùY´¿=Óœèq·³¿ñâ©r´²¿ ”ìÕ•I±¿t:«=ø®¿Þ$-Ä¡ª¿ÇæjÛúš¥¿bPЂÁ៿>Éróc“¿“Ï#ñYrw¿3£š†#?Ö׈rF—? —IÇ£?U`©¤æ«?ЬZˆ²?ÊûÒá³?¶? ƆE,gº?jSI3r¾?×B þAÁ?LxtkÈ?^/ÒHÊÆ?WU¨= Å?àfX³¦/Ã?j“+?Á?|äâÇ•{¾?TŸA"aº?•š+y‚9¶?®d>ê2²?s€Ø²Ù«?2•Â,Ù¹£?4ºÞº/§—?wÐ%ì€?¼ÇáÆTãw¿LÕsf€“¿HÄSb«ýŸ¿±Ñé󧥿ÆÐn{€¬ª¿³õ»û¸þ®¿„cÍ.?I±¿NùV殲¿ýgŒ…«³¿Üz›]G´¿Š±½àj´¿ˆÍûû*Ê?›<¶ZsÈ?´úÜ­šÆ?±jp朣Ä?–êÄèž”Â?°s»rÀ?Žì¼?Ÿü.˜K ¸?$x{Ú³?y¸~ù£.®?ŸrNòÔV¥?Ò7KDÔ^™?Ëñ‹k4?…*‰ëšà}¿’«?¨×±–¿€ p×Hw¢¿§~Ü2©¿°X© ö®¿ÉŠEm²¿é:Ö| a´¿Ò:–C¶¿¢h𥭿·¿µ êFÓ¸¿6ž”Çq¹¿wº|±¹¿*ý§W£‚¹¿Þ¼ xÚØ¸¿šúOæ¦Ì·¿ à­çžV¶¿B(x„ü{´¿„z¤£A²¿ÌË?ŒÅ>ÈŸÌ?âHfD@Í?¬GÏ£¬Í?ÀÈ^ò=âÍ?ùÃüÿáÍ?0„ÛX„«Í?~?j?Í?ÔkV—©žÌ?èUÜ'ØÊË?WtÕÆÊ?Ì-Îí’É?ôœ`n4È?8Êúk ®Æ?Â=èÅ?•¬âó9Ã?Ó‡{©'TÁ?†tºÎ°¾?JkO\œ–º?µnÊ0d¶?Æß±—ö#²?_‚òÀáÁ«?jµÓa·K£?ߪ+µõ•?‡ÇdŠ:#w?žçPOuŒƒ¿ä_3ɘ¿Z’ 7£¿Ä³¹q°ž©¿ªÆn¯¿,(û*ÕJ²¿w£>ètƒ´¿0…î%,Z¶¿ èK9vÉ·¿Wz¥Õ̸¿õof¹$m¹¿ Ñ´Ù“¹¿˜['MÿÈ?†2êSIÆ? .AjgÄ?þÌo"ÆgÂ?«' -2OÀ? è­ÃgE¼?´ÅDÏ·?)L2èE³?¸õíi­?œÝÁ,BN¤?Øç‡ÁH–?,‘yö$t?Þú-ˆŠˆ¿ˆâøŠeœ¿Íàíh3𥿠༄k,­¿mCM뱿PCMÁî´¿SJ69š·¿$Û ¾æ¹¿ÜUðSÏ»¿ dO½¿jÝqÍd¾¿ÎO§Ëö¿¿ Gþs?¿¿Åã'ìæ ¿¿ Éüº[¾¿Ìé­œE½¿œPê@bÄ»¿˜f,{˜Ü¹¿Tb§C7“·¿Ìàb%î´¿ .ð+ô±¿K¬GÊY­¿î¯ÉùWA¦¿ˆ`–b¿C}‘å‚ðŠ¿Ãàö#ž“h?Í¥z ”?©I£øµ°¢?ÅÅdWg«?0^¶`é ²?_#±V¶?!¨³>‡º?|]±Ñ”¾?€_ÜŸ@:Á?R4k<Ã?¨¼—†·ÁÄ?¤Ë!aPÆ? ãE¶Ç?=ƒGçÙïÈ?ÿlªAúÉ?'}i$+ÒÊ?˜Yy¨$vË?ö˜áSäË?D•dÌ?”ª²VÌ?™,¡ãË?¾¶4Ž&uË?H߸ÝÐÊ?áxqÁgøÉ?›w›êíÈ?W h´Ç?¡Ö«ÙMÆ?âÝíOì¾Ä?Ú3…º4 Ã?óËd7Á?-ù37޾?òµ•"€º?&KM=·N¶?JÌcú[²?$B@ŸÚW«?]¯ñР¢?(èFó“?Ô’æ‚g?)+D8‹¿è{~ˆeˆ¿`M|­V¦¿§s#v~p­¿‚ÿΦ²¿d¨®»û´¿! Žg€¡·¿¾c`[깿9Û¬~Tλ¿>-Aœ¤F½¿‹u±MZO¾¿  ¯k'ò¾¿;fÄ¿¿ad’UL¸Å?ÊÅ©ðÃ?!ze/Â?ðÕŒqòú¿?lЇ¼Ñ¶»?0ïù¡:J·?ÊhËÌ¿²?©MšÞD¬?­&4¬nú¢?ÜgÊÐ2m“?T\IçóQ?Ø+ªî É¿Z­wíV¡¿v«[—_©¿šUøèPž°¿¦**K´¿$ÃÐ C­·¿îeÔ„¼º¿Ê³ƒÊ¤q½¿ùô4Æ¿¿rÅaZÚÀ¿ã5ÔOœÁ¿2ÔñvÝ'¿UÁv¿å Ò¡•“¿,Ao]Iw¿T˜ê\¿tš'ŒÁ¿Û7yõçÅÀ¿ZŒT÷–¿¿Ã¼(!°>½¿‹ìÿˆº¿ LãcÓ|·¿k#άí!´¿à̱„Õ€°¿ð.5E©¿ªcIù"¡¿3kÔ]]‘¿b ®Õaï>D? 챑?XÚ®Wñ¿¡?ñ… +_ ª?@"°Ðã±±?Æ7’ýùµ?—œ¤º?#hâ-\¾?¢ ½'çÀ?t¿à½£Â?ð;í‹Î:Ä?±Ç@=¨Å?RX~ÌlèÆ?ë§a3øÇ?­VmâÔÈ?³uayK|É?IÁëMÆìÉ?Œ†„—5%Ê?RªQLè$Ê?¶ RÿëÉ?‘«Jù*{É?îe?ùeÓÈ?°ø•wZöÇ?gøFö8æÆ?¿çK)²¥Å?í|ÀÞñ7Ä?Ô“%>– Â?§0̧ãÀ?`üå} ¾?ü'®º?>J±Gòµ?Zq³ßÀ©±?ô6dD¸ª?Jñ®¡?ž²û%‘?€-<é-à¿ oõ§‚‘¿/Ùsº6¡¿Ë]•‘áZ©¿D’¬k­Œ°¿æÝê‡[/´¿¹{ÛUŒ·¿ùD§›º¿l!Ü„S½¿F¿oA$®¿¿Fš>¬@ÐÀ¿H~.bÁ¿š¤nI0¿?®g¿¾ÉéE{¿ѧ·‹r<Ã?9EP'òlÁ?I•¶g ô¾?Ĥ©/ºÐº?Š „9äy¶?ŽÕaëøù±?ã,Ër•·ª?/ÌçêT¡?f©= Š?º1ªQŽh¿VqL­•¿Ïëø]ð£¿ý%Ìy)À¬¿ön“7l˜²¿"Éÿà—¶¿^ôjRº¿ÛÏòD…Á½¿ÌçHhnÀ¿±:âqÍÁ¿Tßë˜û¿_ñ';¼õÿÞÎî¹Ä¿\ ³GêEÅ¿Ãñä$”Å¿¥ú9°Å¿Pò/±=‘Å¿ðËØ¥æ1Å¿òtLžÄ¿Ñg‘÷kÒÿk( ŒÑ¿&1âµ žÁ¿“µ”;À¿HöªÛçW½¿n’Ÿ«é¹¿¯˜×k4¶¿"dAgS@²¿g!51¬¿ þ /´Ž£¿~™§®ì]•¿{ëi¡~†j¿F×v¤¸?] †ÅÅ} ?‘çlˆo©?‘Õ§!j±?³µ“ÉOµ?†Q6=2Y¹?ôÔp(½?>•o³ïYÀ?0ƒõ‚DùÁ?Às:õnÃ?yZðqÇ´Ä? ¬E ÊÅ?>ê7È0«Æ?|žËøUÇ?Ýÿì-µÈÇ?¦¿žDÈ?4nîãñÈ?¾ø<ÜÇÇ?ø‘¼,·TÇ?ZíŽ|„©Æ?ŠD¨çöÇÅ?À·¤ëI²Ä?4‰i„•¿&Zgב¢£¿ÕM>F¬¿·u¨ˆÇK²¿±hÇè@¶¿–gëw¶ø¹¿ˆ“"™j½¿ìËÿ0SFÀ¿Ä •»a¬Á¿LLÎ\6ä¿.¬øêåÿ˜ä 4©Ä¿Éi„ür.Å¿—[Øa{Å¿¬9„¼Å¿ ¯ÈƘ™À?©ˆ§ö¹„½?±èwëD޹?[]Yµ?~ZMê%ð°?D½Øzº¨?qZ‹±¢®ž?Ò°¿Š²5‡?9÷~ç¿a~¿Hë{õ¼š¿Æ7°AKÒ¦¿A#Gq°¿PÅR0ý´¿À˸¿ªxÑ3-Ù¼¿ý)ëv^QÀ¿™!à»J¿£Á,¢Ã¿v ™>ſƣp,8Æ¿*¤Ry5Ç¿›„EÁúÇ¿:iRއȿjÐy6`ÖȿȔÞöaðÈ¿wèÏȿë³Zlл? ê/ÍC¿?!ý$]¹ Á?¢°ö¼XÂ?s­š)bsÃ?°toaàXÄ?yH^KóÅ?º‚~¼â{Å?Þ‰‡Œ¶Å?ÁD8¶Å?ïÈ"îüzÅ? ʹّÅ?jMÊ«WÄ?˜þÛQ qÃ?¶‘ ïUÂ?œž@#}Á?ð3æ¿?ª¿‹êsÈ»?Ê¿ÝÇ´*¸?Ö^ßRæG´?Çò“>Ù)°?Úaãµ§?à[Öá1˜?ª:E곆?z£Á ‰|¿‚¥ž§Ê¬™¿H·¢ŠÂ ¦¿Ì‘ƒ)¯¿•ÒÉ|õ³¿€QXn"4¸¿R£¿‡>¼¿ðÕ;7gÀ¿x.—³òÇÁ¿äÒÖâbÿ4hSÀÒÄ¿loî~ƿ๷˜~!Ç¿¥ųåçÇ¿xžúWËjÈ¿Æ+ÇŒù²È¿d›]èƒÂÈ¿<÷–䨻?GE¡Fë·?«»¿Œä³?î PÙ<¯?ò®4kF¦?ô®QvÙö™?ÑûÏH’{?⺺*ø÷ˆ¿­ˆ™üŸ¿¦D‰L¶©¿l-_«§±¿ÔÝþX¶¿² ;¿Ê㺿¹R•f=¿¿=¤œû8­Á¿˜2o#ñ˜Ã¿:aê6]Å¿œƒEÒdõÆ¿Î:­ ^È¿`ò(¦“É¿ÂÓBÄS“ʿڨâ\´ZË¿­é1‰èË¿°ÑÕÚ6Ì¿¢ ÏtOÌ¿ÎÜ´Â+Ì¿·ÀçôÑÅË¿$Qp3)Ë¿/ja3ÏRÊ¿“GuÂ_EÉ¿²±—“È¿>&œ™Æ¿2DcðÄ¿`¦Ä8&ÿ©~ˆ4q7Á¿t6’IQ¾¿@Jþ¹¿¨Búµ¿Š?‡‡xâ°¿tƒŽ½>b¨¿Å+cß¿_³ì †¿T\ÕT8~?~œy><·™?ôXOÕq¢¥?§hö‡[®?ªŒ@§š÷²?Uùµ¦¶?!é~¢º?ù†n‹ó ½?3ìU±¿?‹ò빌øÀ?U½SEHâÁ?Dò7“Â?»Ø*¡ Ã?þ¤ b^FÃ?Òa FÃ?àc5á² Ã?`'&’Â?˜ÔßC6àÁ?^ÎØîõÀ?VKºÂ «¿?®ù­½?bkGôwü¹?–(÷϶?y¨Ýýí²?:£ñ­?àQ&ês¥?É­0½dŒ™?.fT?x‹}?>’F“ýg†¿óöþ8€ ž¿*¢çl3w¨¿RT8ƒ×ì°¿ð1£½]е¿­@…©º¿-"*7‘\¾¿lBÿ^³=Á¿f^a -ÿhãø†>ùÄ¿¸>Õ®œÆ¿d ßWdȿ֋áèt^É¿›°ÀCqÊ¿,’™5<Ë¿Û$„xÂ˿͋³® Ì¿ÜzT Ì¿pˆJ€aäµ?ƒ¸î°ù²?žl¾¬?CzªâT£?Ѽ²Ìªv”?…ñ[‚Y?ªu?³5Ä‘¿ÖäC1з¢¿fÃFI¬¿—–.=M=³¿¿|mö¸¿X£nÙÞ¼¿ÃåIP:½À¿Í½ÁÒñ¿®†àwßÅ¿Ûü¼!XúÆ¿‰iˆÄÈ¿b^šçbÊ¿ Ç¡+7ÏË¿õÂ¥mcÍ¿«ÿv!µ οvÞéTÄÓο€¿¹FbÏ¿l[1–i°Ï¿bÊ?ŒœÇÏ¿ ¹#†¡Ï¿7/Äk8Ï¿Yª!ù‰—獵ù»Í¿qo+Úz¨Ì¿ ip)È_Ë¿Sçy åÉ¿ñ¬þ><È¿ µRiƿēÓóðpÄ¿ŠÃ›VX¿DRCö#À¿ ¨ßîY´»¿1«kJê·¿ˆ¸±?‰°ù…t¬´?Bú}À·?Ë=j5ßrº?Äfã8˼¼?*Óx·{˜¾?ª6ìÈŸÀ?ßüÛÃyÀ?‚´%‹¶À?h;¶À?rÚ`ØËxÀ?îŸ.™øý¿?µLŸå“¾?aÎò¶¼?$•Ókº?ÝðCžS¸·?x²R¸F£´?D@[Nu4±?i“+ìéª?dý„ùÙ¢?¨`jyÕŸ”?µµÏʨf?°5ü5x¿(uÌ´ET¡¿ª™v‚꪿{}˜°_D²¿V®¦Êu ·¿×Û¦“¾»¿mÖàM)À¿…ÙÂ-]¿*0ï­\vÄ¿ªT·boÆ¿HmR.oCÈ¿½ÆîÉ¿ ’KBjkË¿4ÙW¸Ì¿¢<ø¨9ÍÍ¿$ùa‡ŸÎ¿x#Ö[1Ï¿ÈÈ ˆÏ¿n•”ÖäžÏ¿«¶-Óá¯?n^?,¨?ä²àOÀŸ?ºº*ÖwFŒ?X…‘¨–Pq¿&$ð-+y—¿ébî‡ÂŽ¥¿Ï(WÍÖˆ¯¿kñ%ñVÉ´¿NÛVþɹ¿þLŽDº¾¿ÂЕäÇÁ¿&ŒQ¡Ä¿ô¦õµ[YÆ¿Ñ €¡’vȿϰõo—oÊ¿ädyQ¤?Ì¿PKÅbWâÍ¿¥&v‰½SÏ¿Ó@$.Hпež9ÊпѥÔó/Ñ¿ ;3Ù†wÑ¿"ØÎ ‚žÑ¿20™Pj©Ñ¿¦Öþè2•Ñ¿e­5¢_Ñ¿kX¡6› Ñ¿´£íPœÐ¿/Ý™Ÿп›È›ÚÏοà ù¸¿MÍ¿%pкœË¿Re>' ÁÉ¿øq“»Z¿Ç¿8¢9•µœÅ¿Š!þçv^ÿ;@ Á¿ðí‹aÓK½¿#óîén¸¿¨U†ªù‰³¿µ¬©—šR­¿fÍLK²£¿ÕÄK¹k–”¿ö*“;ËOc¿Øe óæ? ¡#UŸ?F|LRI§?ʤŠÏB®?ßpA×´B²?ôÖ²7®µ?þ_ò9kT·?þkLâ 8¹?d†ŒÑ¦º?Ø}D»?¤ž"ا¼?À¼?„¸é ›»?Í{¢È;£º?•õñ|ø2¹?ÀݱåM·?xÆÉø´?>öfÔ‰9²?À%s¨).®?,èÙΩ2§?ÕvÃ_i$Ÿ?˜J£¹#€?4oxúód¿GóGô3Ë”¿nªcÎ^Ì£¿;ïjŽék­¿8u®Ú–³¿óÐMz¸¿'G$tV½¿h‹Ù‰/Á¿x¾+cÿᱡſGøÍ-–ÃÇ¿H’F WÅÉ¿(Q¡Ë¿j´¥ ×RÍ¿En@‡Õο@w(šп¢GÁ‚žÐ¿€¡!¶» Ñ¿ÏOœ:ZÑ¿N;g:‹Ñ¿d‰…Ô0šÑ¿Ü('^õ´£?ÆÖ Ç—?&³G÷éË{?ÊÌÉÖÒ…¿&„¤Qñ¢¿Ä½q†¨¿YI·ù“=±¿ºåLz9L¶¿2o9¿b»¿ãô?h:À¿Ttíe»Â¿¦cרI-Å¿Q s5#‹Ç¿idÓeàÎÉ¿üÕd¬óË¿–\òÍ¿½”7cÈÏ¿vÎÕZڷпd(Ôì rѿԨ™Ò¿gKÆŒB–Ò¿Ö‚³_üÒ¿ãÏxÈ?DÓ¿ÅéšV&kÓ¿³45`uÓ¿Â,#`Ó¿|ÒÏów(Ó¿£Èu óÓÒ¿X„BK:aÒ¿r›é÷±ÑÑ¿¶ÖR®Ã&Ñ¿•L$bпhÓX Ï¿aÜ(Æ2'Í¿¼ˆ*ˆË¿tBµ-vðÈ¿t“â•n¨Æ¿{V )JÄ¿ zÊ$•ÛÁ¿¡ÏF—ž¿ïî»kþ˹¿ ÷2 ÚÖ´¿ÜHm4寿6ÅŠ) W¦¿¡[öSj6š¿¸_[OŠ#¿µÂ'€?óW쥗?9Óy0ÕÝ¢?rv^ø9©?#oN<Ì®?yu>aMñ?¡ ŒY•®³?NÞ° #µ?ôQ®<¶?gØ Ž¸š¶?äÆi¹š¶?ªF¿p ¶?_‚Üç+µ?¢Ö‰žð¨³?vnñ~¼±?Š—º®?Gtú4a%©?k‡¸•Æ¢?ÿºEp†\—?¬Ú<žr?†\ £–¿¨õÍEdqš¿Ð„`V’t¦¿ö*M7 °¿ ô™®ä´¿p±ƒóع¿L"{Ѿ¿ü=ýtíàÁ¿$g>|ÞNÄ¿^k~^¬Æ¿‡ÛÎ}çóÈ¿Á,veË¿ÖãzN‰)Í¿Ìé3›2 Ï¿Åx§RÈbп*Y¸>'Ñ¿a:JHÑÑ¿®è Y¨_Ò¿%@ ÐÒ¿úOªY"Ó¿Tx·ðWÓ¿”d–ð¸hÓ¿¯p{Ùdm? ¡ ¸ R¿>ën×/’¿àdw|­$¢¿.B†ºZ¡«¿ŽÐŸfy»²¿,’^*ÎÆ·¿¢ oo漿—.ˆ÷Á¿‚\Íe˜Ã¿t®v&F!Æ¿M1r›È¿Ow(•åË¿ß[ÏKÍ¿dÄ-HvÏ¿ìx“‰¾Ð¿‰[7"›«Ñ¿Å8çËÒ¿„³Lt‘>Ó¿ú–"àÓ¿bá¿ødÔ¿Ú´GàÓËÔ¿ÂužzüÕ¿ß`4jÐ:տ̘ š_DÕ¿>Ô@œç-Õ¿€V£ôôÔ¿©Þv‹€žÔ¿Œ\.¬q)Ô¿ƒ\É1-—Ó¿24w "éÒ¿’Oç~!Ò¿Ïâ#,Î@ѿո«JпB©e‰ ‚ο?ÆÚëLÌ¿|ý~ûÉ¿Y£Œ“Ç¿½1LH(Å¿ PMŒt˜Â¿ê.DÒ¾À¿šNR(¶»¿Ò ø/#¶¿éj8^I±¿ÆÆTHÕ2©¿–5œ.> ¿Š©Búý,¿¨è×ÎLÁ ?[`?lÂçÖem›?‡„ÞuX^£?©ý Ð*¨?# ó¬?EšZ²)¯?ø¦eaã°?‹°åØ0ÿ°?ÐxHvþ°?¤?®s}°?ÐyAjû®?®|¬?AUY—¨?jMp”J£?þÓèE(?›?Œ½ýŸŒ? `eŸÃN¿œÅ¥So©¿e E×^ ¿b!ij@T©¿ic# Z±¿3‘Ï£T3¶¿ˆÌÓhó)»¿âÄ0¿À¿IïQ,µžÂ¿¸ÓÍÁ Å¿Œ…R ˜Ç¿K6ÿÉ¿¢utiOÌ¿£S‘Î|ƒÎ¿ýܬÙJп;,Çùg@Ñ¿wRœ†ùÒ¿V”¨JJçÒ¿Æúƒú7”Ó¿ÎØ±F%Ô¿S&¶ÿv˜Ô¿«ª¹Ê¦íÔ¿Iµí\ú$Õ¿ÁP»Ý8Õ¿ßµÜΟC„¿ˆ}>R.š¿kä·vÕ¹¥¿ž1/\øã®¿öpÝÔ©?´¿üº[µJ:¹¿Ô¼=ÈU¾¿+RbtÝÂÁ¿/T>ÃÄ^Ä¿ÖcèICøÆ¿ „]Ӊɿ<÷Ö Ì¿ø7T¢•wοÄï©°dпÇpšJ}Ñ¿v§|Nî‚Ò¿ÚMû sÓ¿Zäk¾–KÔ¿h88ËE Õ¿Áó¾ÿ]­Õ¿h²>-T3Ö¿­$: äšÖ¿ÌCžqQãÖ¿4gÊ- ׿@¼Kþ׿]mMtûÖ¿Åwï;+ÁÖ¿„’¦ÝhÖ¿¶@ÿ$’ñÕ¿niöz¯\Õ¿Ç᪫Կgò~p?àÓ¿ix(éiüÒ¿ A¨ÓcÒ¿žEÐ žôпòðfu«Ï¿ªâ‹ QÍ¿ $,æßÊ¿Vü ^È¿¾kÊ*îÑÅ¿6Ù”•ÁAÿžÅþ³À¿šw1à^¼¿ö½Ã[r·¿jF+Õ2±²¿‚LJCýL¬¿Ú$ºB»£¿c‚'e…—¿žÉ±-Ý¿þà=Ù"¥p?øèͲB?ùb”Ê\™?lÉèà‘¡ ?dQ›@A £?¨0K”梥?ªsqÀò¤¦?ø¬O£¦?bP~?z¥?R¿–£?ÿ}ઓ ?r(ý´8™?Bß gêŽ?sü«=«o?ñ‚ÒŸ_S‚¿-D0˜ðÆ—¿è<²Þ£¿/Ô¥õNr¬¿Ý}÷KIJ¿tá‡vN…·¿l¥hEp¼¿Eü`dx¼À¿+iqfIÿÐqF{”ØÅ¿ä‘|¡cÈ¿LzÑ3äÊ¿ì⣠TÍ¿Û ­Ï¿<ÐxЧôпΨ0ŸÒ¿$䈼ÅúÒ¿e ¢¤ÝÓ¿g†l«÷§Ô¿72Eâ­WÕ¿¸…ifëÕ¿ÈiÝ÷aÖ¿ÒRó@¡¸Ö¿xówCòÖ¿´sOÐ׿œ€€Îu¡¿wgƒ!”©¿jbH³(±¿¼ž>2Õ˵¿J^‰T2¨º¿Ëˆú±¿¿%uswn¿x.¥‹?Å¿|¥cýó±Ç¿|~šH)SÊ¿y‹ý›yëÌ¿RVpj”tϿڶé&ôпÙo™ÜV Ò¿Ö"0ÿ;Ó¿m:mDÔ¿cØö'7Õ¿±=j4ÀÖ¿îKR^BÒÖ¿é¼Ê“Ïv׿åf®CØý׿B9JJfØ¿^q»>®ؿM£j‡xÕØ¿í•˜ ÁÝØ¿è;®0ÅØ¿’+g¤‰Ø¿(ùÖé’/Ø¿†Ï&¶×¿k6×FÅ׿˜ ˆ5ëjÖ¿¼^©HYœÕ¿¦ŒQµÔ¿,cÝ›Z·Ó¿Š‰¾c¨¥Ò¿6ˆw¾§‚Ñ¿Çî/QпR1¡šq(οyà%¹Ë¿¼Ü¡ÐÉ¿ÜcoÆ¿srä¸ØÃ¿$TÞYKÁ¿:œþ±]™½¿Ô–ÔÞǸ¿r³/HŸ-´¿#tM3J¬¯¿ø8– ˜§¿ôtO4 ¿>4,~Ú$“¿œy v~¿”¨Ýo°b?w•ãÒÅ­„?R/‚@h?Z“Þz”?ç7t…–?ò¸çÆ–?ÞoCÕn”?*Ù-íÝR?erÈB\p„?À¥•¡pa?¸žS_Ý~¿ÌàÍ­ï^“¿0Y½FÎU ¿¥à!Ù½§¿UÖÔ¯¿½ÙC´¿´Æ~êݸ¿Î¸*¯½¿4ëgUÁ¿ \Ìî?âÿ]‡ýÒwÆ¿-ô¹·É¿¤¦(y£Ë¿zËz§,οHYïtRп€ðTÃѿV(è¥Ò¿2ÿçË´µÓ¿¤)»êH²Ô¿¥ÈãÝP˜Õ¿Ê ‹ŒeÖ¿9K³ó׿¦·3®×¿º—R(&Ø¿ ×T ¾Ø¿•!÷ºØ¿£Ú ehÒØ¿jš©%¶­¿°ºÔiö²¿HAºa·¿nX{hD¼¿ûÙVP~À¿¼¶¦Ûl ÿ ;¬E§Å¿0ö.}NÈ¿ä¡ÔŸùÊ¿òXÓª-¢Í¿34 Ö пB”TeÝhÑ¿­ßšá ¦Ò¿6)¦]ÕÓ¿ÖЬíóÔ¿^ÑZÿÕ¿(Ú0ôÖ¿~#¤¬ÅÐ׿ž¢S¶“Ø¿Z6>ó8Ù¿ n€’ÁÙ¿r#ZUá)Ú¿ÿŒÊrÚ¿°_ø^v™Ú¿”á„—$¡Ú¿¨Ài³˜‡Ú¿äè&BÞJÚ¿~†n ïÙ¿÷ò|7¯sÙ¿ýÈÓ0òÙØ¿4¹ñPi#Ø¿ÅÌÜQ׿6:8ÝTgÖ¿.‹…fÕ¿û0õ1´PÔ¿¹pÏ)Ó¿‹ßü}MôÑ¿J402³Ð¿õqÏô<Óο-›øW‘5Ì¿ó”éè“É¿®õ‡ÕôÆ¿Ýï4ã^Ä¿cÁEº‡ØÁ¿Týj%о¿:•ßÒ9'º¿”- …õÁµ¿ÕOUãW«±¿Â”::Û«¿‚ª¾G$¥¿ÎM# X…ž¿VâoÏNŠ”¿(è]ÙሿŠz"1y¿È xçha¿€ 7)n¿è|-XB ¿šÄ'ïÒa¿0r3TáŽy¿Ñ¨º¬_$‰¿¾+]!R¶”¿ ¿Ÿ‚¾»ž¿H[Çó©D¥¿lJ3³¬¿vòUÃ~À±¿¦oÁAÙµ¿*ôÁû+@º¿ojÕðå龿vópÀ:åÁ¿þ2?W×jÄ¿xæâ¢ÿÆ¿hébzMÉ¿â5æ`=Ì¿*†ÁTÙο3ÓfPPµÐ¿ÕX+[kõÑ¿Kg¾x×)Ó¿D†>ŸOÔ¿ÌZ`†«cÕ¿7¿¶¹{cÖ¿Ñþ ý}L׿¶ØªöqØ¿¤pßjZÑØ¿¡Vö¡íiÙ¿˜íÑöãÙ¿¸ï„l?Ú¿¯¡I|Ú¿\jC›Q•Ú¿•¡ÍªƒÜ´¿‚-:i¹¿*¾ iz½¿±³sžÕÁ¿x ¥§—ÿԀ#uœ*Æ¿#ó€òpÎÈ¿×W¶|Ë¿Æà|·ã.ο*ŽšÓ3oпJàåíZÂÑ¿¡Œ×)¬ Ó¿óŸépÿMÔ¿ä PG€Õ¿Ù"s˜¡Ö¿ Î¤Ð0¯×¿*Ö¤s~¦Ø¿ºB³Ó%…Ù¿²ŠÎªIÚ¿§–ä:FðڿѰõIyÛ¿’í3{ÅâÛ¿èŠ:ç+Ü¿„ B¶‹RÜ¿¼K©¦YÜ¿ÁÍÓ,?Ü¿D‚-8XÜ¿¼"£Þ¤Û¿´'À©¯&Û¿©Üý¹ŠÚ¿`·¶ÓªÑÙ¿PKžROýØ¿Cdk¸ؿԫ‡É5 ׿2I¹&PòÕ¿ÒhÃÇÔ¿:æ… vŽÓ¿´ÙñãuIÒ¿ØJ:ìûп0ór1RÏ¿Œ|yD¨Ì¿ˆ´%9—Ê¿BšçcÇ¿R“±%ÖÄ¿ˆ¯—JU^¿¯7(MþÀ¿y‚õ¤É“»¿Ì¹/q·¿W'5Š„¨³¿z”‹ðAC°¿°xˆ‡Ï“ª¿Ñê7fÓ‡¥¿ à{Í7o¡¿ã×JŒ¨œ¿L,ˆŒœ}˜¿ü¤«5:g–¿t­{¨·k–¿8k“ Œ˜¿²¾¡ÝûÁœ¿òbÚÙ…¡¿-)Aן¥¿üƒLo®±ª¿Î@SN1U°¿ ?¿î½³¿ä,®1‰·¿âp Ô¦®»¿Á_ªÉžÀ¿JWí›m¿°z§6 åÄ¿+Hð ÎqÇ¿Ÿ\‘Zè Ê¿!Íû±³Ì¿ÎíÞÇZÏ¿hº£·3ÿпžQÒ;©KÒ¿iǸ¤€Ó¿”,£×ŠÇÔ¿^ܵðÕ¿Ú×Þ׿øö…»é Ø¿[ÿEY¬öØ¿ ¤gXÉÙ¿ 9€Ú¿]ïÄ{ÛÛ¿à¦ÎÒ–Û¿íÎ ôÛ¿^©Œë’2Ü¿šÔ.Û)MÜ¿ä|ÁËx±º¿”Ɯ⾿ŒñΦ²Á¿i}‹÷GÄ¿Vë{\™Æ¿} ÎUÇ2É¿rƒŒP2ÝË¿½-­n’ο` h\w¥Ð¿‚ê(Ò¿{v±NÝVÓ¿Œåm;H¥Ô¿R- Š‘èÕ¿*îdÕ£׿ȘGŒAØ¿‹hPÕQÙ¿ÙRäìJÚ¿ÃHæÑi+Û¿{®ÖðÛ¿­>P™Ü¿*”°¸;#Ý¿œÙp×HÝ¿Ó|ŸÖÝ¿€g¾?ýÝ¿¥Å.ÏÞ¿z5ÿ uèÝ¿Ú:|›©Ý¿¿ŒèÐJÝ¿W¬rî²ËÜ¿Éß§Ÿ©-Ü¿ÖRM>rÛ¿\a†C›Ú¿ðX³AЪٿlн:£Ø¿bZ±Ä‡×¿i@¾`YÖ¿ýÿí DÕ¿0xøk¡ÓÓ¿P‘¶¼e‚Ò¿=tÚØ+Ñ¿+È5E ¦Ï¿Ø7TLøÌ¿zqEÉdSÊ¿fMC¥¾Ç¿V@Å¿ªÃÂSÞÂ¿Û z‚4ŸÀ¿!v¤½¿S¢|ñÊ=¹¿šßªkϵ¿à­dúβ¿¿h•ßaA°¿ƒ4æ4B_¬¿iÚ*M<©¿îÉój#!§¿æl{”J¦¿œy籸¦¿”®‚,ç(§¿”hoH¸I©¿-Yér¬¿ ’>LTN°¿ÔÌ’RÞ²¿æÀ2§㵿qÑgU¹¿NPEÁ+½¿c¸,µ®À¿Þ'äF®ï¿øk. •RÅ¿b•)ã–ÐÇ¿nÙl»­cÊ¿+ĶaVÍ¿ÖnL¾`²Ï¿?2?!•0Ñ¿ñ&Ûø…Ò¿V¾ìýýÕÓ¿ ÄÎPTÕ¿ÓîØ;ÁXֿ¹ŒŠ'…׿âA+ŸØ¿ÀØa-¥Ù¿™>!gn“Ú¿T§+hÛ¿–ù„ë Ü¿ùi|Œ4½Ü¿pÎÀà;Ý¿j{_ƒBšÝ¿£ËËoÚÝ¿·¾O²˜öÝ¿øqTSk&À¿Ì‰—ìóC¿nÆ·­ŸŠÄ¿ð¿ü|áôÆ¿Ö8)FÕ|É¿ þqINÌ¿ARæÌο׌¿ÄпÔwß‹#Ò¿ä 0‡§Ó¿¦Òš›ÛÔ¿n°Ø¨V,Ö¿ÀiR‡er׿îÆHfªØ¿;niÐÙ¿¬½Õ•âÚ¿|-®ðøÝÛ¿È2n_.ÀÜ¿uÈD ‡Ý¿º€;¬0Þ¿xSp»Þ¿N*Fê&ß¿´³ŒÒoß¿˜ÖÁÒ,–ß¿âñlÝ8œß¿ç 7 €ß¿Rû.üC@ß¿|ÿ(àÞ¿møCÝV_Þ¿çf"`¿Ý¿Ú|'ÄÝ¿{ænZ(Ü¿ð1I÷?5Û¿º÷¿Ð*Ú¿—@³I£ Ù¿Ï«èšÚ׿wIÐwbšÖ¿âׯbNÕ¿8ÀEiºùÓ¿°³9(»ŸÒ¿X\š“ÁCÑ¿#uw9`ÒÏ¿RÜ|öË&Í¿È?w‘m‹Ê¿ò‡”nÄÈ¿þ^ŠïŸÅ¿’b—ÈgZÿä¢]>Á¿œßÊw ¾¿ u]­)»¿®—^A!¸¿S®:޵¿2å­SFw³¿×­ºâ᱿\`µ àѰ¿ZÄoˆ¸I°¿z+ë¼K°¿vZstüÕ°¿æ½ç€鱿#‡ª³¿ ‡°Î›µ¿Ó±[_U2¸¿‹Qتà>»¿?ò—ñ¹¾¿ËåVÄ|MÁ¿;‡Íá2lÿ’-e[ï³Å¿}¬VÒÈ¿þBš§¡Ê¿Œò%Ü9Í¿ŒÂ@^.âÏ¿JLf?JÑ¿B‡n]ì¤Ò¿Iftå¤ýÓ¿¸-E×ûPÕ¿f®à”›Ö¿# €*Ú׿`MÁ~” Ù¿ð½vÎ&Ú¿WÐÌBþ.Û¿8]D=zܿȱ?£ÙõÜ¿¡>Vν¯Ý¿NÓx˜MÞ¿¤I4ÚÌÞ¿_§‰….ß¿ J§pß¿¿odŽß¿-à&¢÷пGéXƒ óÄ¿~O}Â>Ç¿áæ•¼A®É¿ÃE\w­;Ì¿±¶ÈÉàοe>Q“Ëп}õºÓ ,Ò¿Q9K’sŽÓ¿’J„ÑkïÔ¿Õˆ™ë“KÖ¿af|ΘŸ×¿%6;èØ¿hÈ»(W"Ú¿¤· ›ìJÛ¿loß%_Ü¿ø-_\ݿԪ͡,@Þ¿Vlaß¿‡”~³ß¿Æ~×Oà¿{UƳÙT࿢غm´yà¿•&ï à¿ç°MVÍà¿?4Và¿ÌžÕ‘aà¿÷èæøM0à¿î|cTÞß¿Ãdk—<ß¿òÐ,g÷|Þ¿á¸P¡Ý¿úœÄ4ūܿ#}ó¶žÛ¿Ô,ÑoÂ|Ú¿™ö÷¸HÙ¿_¢€•Ø¿Êù¼}¶Ö¿€P’ä±^Õ¿ÙÄáˆÔ¿û¸.g¢Ò¿#sŸq¶DÑ¿zµBö¹×Ï¿–£¬j6Í¿¢gÛ ¬Ê¿¼“+Ìñ>È¿hÖAp(õÅ¿Š-OdÔÿæîHôáÁ¿XL V´"À¿p‡©Ç6½¿ênÜ\º¿X Âàõ¸¿”Ö’é¶¿hïÒŽ¾Öµ¿å *`tMµ¿½•ÍÎNµ¿0’ÎÛµ¿â«Žð¶¿Û0ÁŒ¸¿–$Ò¬«º¿¿y—M!H½¿yµi9à-À¿ÏB±ŠïÁ¿2VNƒÕäÿ+¶!i Æ¿sŒrnWÈ¿ i0ÛÈÊ¿¢›îœQÍ¿ætX[ýìÏ¿Áo,MÑ¿£ –±H©Ò¿ÆÙà2 Ô¿=PÏ ÝbÕ¿fçñK¹Ö¿‚*Ú îØ¿å° vuHÙ¿zƒý­°zÚ¿ã|šÛ¿Vcy`)¥Ü¿ X¶—Ý¿`Yœ—oÞ¿rÝe*ß¿t´_ÀÈß¿Xr†]%à¿k¦51Wà¿z)0yà¿Ü.2²¿ˆà¿¾´D´RRÅ¿ZwvYÂxÇ¿¬5xkùÈÉ¿2IQ=Ì¿ÊS¸ÊÏο&cU¶ ½Ð¿ì_ ÁàÒ¿j÷~Ó¿¨3ÀwãÔ¿òA]¿·FÖ¿Ê­;s¥×¿} ÇúôûØ¿ @!ÿöFÚ¿Á(EOƒÛ¿íùȆ÷­Ü¿*gð©ÄÝ¿ F¾ÇýÂÞ¿\«"»B¨ß¿ƒUÙ8à¿H¡Dq¯Žà¿(K¡bÒÔà¿®Y|]– á¿„×è…/á¿ ýÈæ×BῈçKÑgEá¿–žž—6á¿“fP,ãá¿Ùþƒá˜äà¿Þ¡þÿâà¿´¢[Qà¿î-ñ)¶àß¿à'Šß¿žá„2@ Þ¿²|ÈÎûÜ¿™6îR×Û¿Ï›‚ÿ¢ Ú¿Uú ÂZÙ¿ÓÒÿPÛØ¿ÄÏ—4®Ö¿®W^ê+NÕ¿4ðœT,ìÓ¿L•¯ÿ¥‹Ò¿žŒS©0Ñ¿´àŒCX¹Ï¿²"ËË)Í¿õuÐÅ·Ê¿ì#×I]iÈ¿…ìQDƿّùMÄ¿t~‚s;‹Â¿|%,k{Á¿ÔDÜ}&c¿¿þöè[C½¿ÃÆ…§»¿ÃP‚·“º¿šîË,»º¿1~Cí º¿ÈIä°o—º¿:p„#¯»¿&ÂÒÅŽN½¿à`_ »q¿¿÷B/š¸ Á¿À{²P¦–¿Yþvê[Ä¿´ƒä‚QUÆ¿Ðw8{E~È¿¦gfÒÊ¿çWŠ` IÍ¿V’3äŽÖϿԕóV};Ñ¿-²•a •Ò¿Xª3ÂõóÓ¿Ê#O?~TÕ¿–uq³Ö¿«¼2¯< Ø¿ŒÎï^Š\Ù¿"Þ:Cª Ú¿ó¥BeÕÛ¿_õ»¥÷Ü¿8BÊ0xÞ¿â鞘ùÞ¿Å'ɱÒß¿ k,b[Gà¿–xw V—࿤M ßQÙà¿Æv— ῌ/ƒ.á¿D(c*>á¿¡¢+öƤǿrÀ-!ÏÉ¿ A·Š#Ì¿Û XQœÎ¿épg洙пFú­C?ñÑ¿’xQÓ¿˜Ã*·Ô¿Sæ?žÖ¿‹rZ!¢„׿Ã8S¬·åØ¿²¹¨~>Ú¿„£¦«‹Û¿Z8- ÊÜ¿ã|f"™öÝ¿ %@ oß¿ošW±pà¿Sâlú½zà¿âlôíàà¿pîö\Ò¿:ÔJZ2Ñ¿]°º4zÏ¿ “<}ÆÍ¿æ{°¸:±Ê¿–ppkYˆÈ¿è8¼qƒŽÆ¿k6S!¥ÈÄ¿ †*;ÿvµgáñéÁ¿Ã§xþFØÀ¿4é»ÖÀ¿»`·ŒMû¾¿ “¾!p¾¿ò‰ úmq¾¿ Rg²ÿ¾¿L tµ¥ À¿‚ÀMÄÝÀ¿˜×–à4ñÁ¿€°KØVDÿÚ-mæîÓÄ¿k5d.3œÆ¿Éw›óؘȿX³bÛ"ÅÊ¿©’Ôí$Í¿þÌ# w–Ï¿Š•°Ñ¿‡½‚‡{hÒ¿­ y8ÅÓ¿'΃ß&Õ¿6J8}û‰Ö¿éY±ë׿„&¥ˆ­FÙ¿áD™Va™Ú¿ŸI¡ØßÛ¿w'G`ÚÝ¿r¿KzP;Þ¿Z9-kMJß¿ðd„¯ˆ à¿Jø$'ˆŽà¿±Ó†îà¿„8¾Ü>á¿Ôó}émῬr_š´á¿±˜~FÕÖá¿}б¯õæá¿&‚Þ|ÃÉ¿& –†íðË¿L5±#IοL^Ú®öbп¶ ,š°Ñ¿¨ §ØK Ó¿¨ñ‘¨½lÔ¿uûJ ŒÔÕ¿¬Â=F>׿FÑŸv¦Ø¿òÞ>« Ú¿ôû+;~dÛ¿¸¦9ž³Ü¿ÛïøÕóÝ¿*†´L"ß¿ŠëĻ࿒N\—¥žà¿Ä¥B8Œá¿D/A¥Sxá¿ì}¹~Ïá¿tÆqÄâ¿ÿÛÒCìKâ¿xCMìþp⿲ûŸjV„⿺ ¬‚†â¿“+`‰wâ¿åôjZ½U⿎+v#â¿Lã/Óràá¿SH¹¬cá¿YTC+á¿®\4˺࿮3 ͺ<à¿ÓË¥òôeß¿r3T-=Þ¿*¤¹4ÿÝ¿⊶x·Û¿íýªÎ`Ú¿nÓ·ðQÙ¿ê&í®lœ×¿z,žu”5Ö¿T,dDÐÔ¿áFýóoÓ¿¾:£ŽÒ¿qdï³êËпÀè „Ï¿R>0uRÇÌ¿…iåk›Ê¿»zv.&žÈ¿#/t¸†ÕÆ¿­XX£EÅ¿º®Ínaòÿ|C#ß¿¢»ÂÁ\¿kn­T‚Á¿ª¨E<Á¿.tg÷<Á¿ a¿`€„Á¿¨¹@Æ¿3d³pä¿õ¤¾LxùÿnËÌ‹NÅ¿d7=càÆ¿à^»Ý&«È¿&%qmªÊ¿îžJIÙÌ¿ÜÍá6a2Ï¿lKjXÀ×п‡½ìAh#Ò¿Û{¸ØyÓ¿uÈZÙÔ¿`4Ùîž=Ö¿W»Æ:£×¿ê„¹ÀÙ¿˜EIf¼dÚ¿fribƹۿÎ"xˆÝ¿ YÍÉ;Þ¿­ ì–vbß¿miéTÔ9à¿§;Y¶à¿2^é–%á¿iÇ8“†á¿IÿŠ-¸Øá¿Ð­u â¿EÅÕ¯„Nâ¿¢#âzpâ¿RVGµ¥€â¿²”òl>¨Ë¿2ðOÙÍ¿)2µtпJµ£ZÑ¿Ê÷ †$ªÒ¿pz›”ÁÔ¿Ño —'jÕ¿Þ3¾®íÓÖ¿@G¿?Ø¿”iZ弩ٿäjÁþÓÛ¿Bçã$xkÜ¿b¬âS¼Ý¿è›ý@+þÞ¿ô›–ûõà¿´ [V¤à¿4Óð;Ü%á¿Ð"w%Jšá¿—kO½‚â¿læ6…‹Wâ¿XGžâ¿É#7%àÔâ¿@"¡úâ¿QߺóZ ã¿ å)]\ã¿ÈÞr®ÿâ¿?µ¯Þâ¿òÅaWa«â¿;”a¶àg⿞Psf?â¿W2ÅiM±á¿¿×”@á¿Öoª5rÁà¿ôzbÜ6à¿ÚiYí-Cß¿¿<ŒŠ(Þ¿fO#»¹Ü¿>¢n6aÛ¿Š8ó¨ÿÙ¿ª¾MȘؿ[üNÜö/׿šš*´ÈÕ¿¸Ø|fÔ¿Gðï ¾ ӿϼÊԾѿ¬1¿ýп>ŽcZ¢¦Î¿,±ØÝtwÌ¿ÖÓÿnáwÊ¿VS³§à¬È¿iÝûèÇ¿Æg£ãÅÅ¿ân¦ß"±Ä¿ÆRºYßÿ٬®”Rÿ•Æú% ÿPÁyºÓ ÿd:²Tÿˆ º¸üâÿe«U¶Ä¿Xn/ô²ÌÅ¿šiÿog#Ç¿¦­,$·È¿êj€„Ê¿²øyM‹…Ì¿þn:t¾¶Î¿FiL, ‰Ð¿)Q.L±ÈÑ¿yÙ3ÙÏÓ¿>£¼;nÔ¿ì‚ÑýôÏÕ¿þ3Áy6׿áQžØ¿¥:þA Ú¿•’ð6dÛ¿ZtÐÏe»Ü¿r ®rEÞ¿Sö`œAß¿¾êC,5à¿ÐÇ*̾࿺ HZ<ῲÖl쨬á¿þ=vê¸â¿„õŘÁaâ¿aŸœ¥â¿V# Øâ¿ê5£åïùâ¿£*™Y- 㿨ÿàPÍ¿ † ÐñƒÏ¿>u¦Bñпk‘ú3Ò¿áðç%„Ó¿QèXïpáÔ¿pK@KŒGÖ¿% n ³×¿î£tŒp Ù¿ŒR"?ŒÚ¿Žà „úòÛ¿JÈCk3QÝ¿îÅ{]£Þ¿aS€ìÐæß¿ÎI Ôï‹à¿ð4ÏÜçá¿*yq‰ô›á¿!€~×â¿*åbòpwâ¿,ÚÅÆÎâ¿ÆÂšã¿•?bvLã¿“j {¡q㿳zùý„ã¿¶,ëÙ†ã¿às*Oñvã¿Ib…kUã¿^5û"ã¿%b=C"Þâ¿®êl$Šâ¿Žøì‚&â¿,_Jߘ´á¿£PÕ_5ῌw‹ªà¿»~|— à¿dx4„éÞ¿(_šOx›Ý¿ô—,÷3AÜ¿R ôÞÚ¿¬–¾ƒuÙ¿pîÀ Ø¿îåå-¢Ö¿{tÕH>Õ¿"bá¸ûâÓ¿M,}Ù““Ò¿µì&àQSÑ¿Øó£ Q%п”õÿοƒü°ø-Ì¿^l˜.,JÊ¿ ºt&t¶È¿ð“U—ò_Ç¿Ìä®üIÆ¿w”ÈGwÅ¿ýQ âéÄ¿e㔯 £Ä¿PŸ0IɣĿ×o&…ëëÄ¿cˆ´;ÄzÅ¿1òNÆ¿»+ifÇ¿àÆ&u¾È¿³Qù‚ÁSÊ¿‡>ç,_"Ì¿ýĤçÌ%ο„ã,пÂR>.[Ñ¿@I3ï›Ò¿z¸z_êÓ¿´Ä{þcDÕ¿ê¡‚¢â§Ö¿v²?œ?Ø¿K%‹Q÷yÙ¿8êL/’áÚ¿>iIšCÜ¿ú$M¤œÝ¿¨C–HYéÞ¿bß@à¿"#,žƒ¨à¿É°¶3á¿"@pHv±á¿g²9ë¡"⿎œž€…â¿é-w91Ùâ¿Ei© ñã¿=ëZƒPã¿MŽÀrã¿èôùX‚ã¿nT'9ضοÚHµˆvпöáÞX§Ñ¿ôOG0êÒ¿ ëÝV¸<Ô¿wïQ„r›Õ¿·#›æ׿ÀX5è÷oØ¿Ü ®·ÒÞÙ¿‘âóØLÛ¿oˆÄÂ/´Ü¿hÕ+s¿Þ¿¬æ`gß¿¼c£¬éUà¿_¬¦¤ýîà¿ u}Ῥö–òÿá¿ ›ãk6uâ¿e¼"!Üâ¿Éè®’¶3ã¿‘Â= {ã¿’ÑPb¯±ã¿öc5yâÖã¿uÝùÜ?êã¿ï: #ùëã¿cÎ7ßÛã¿'Tî×¹ã¿"’,y~†ã¿ð³Ä¬6B㿚ëÍô­í⿆Ÿ‡¿¶‰â¿zßý‰Iâ¿YÆ‚—á¿ZôÁž á¿L;\ùtà¿öڪܪ߿LKS,®ZÞ¿Ö8 ÿÜ¿CWr芚ۿ÷ô¼&›0Ú¿oÇ»]¿ÄØ¿~FRÌ}Z׿LMxÏXõÕ¿)?Ü3ƘԿ°„¥&HÓ¿G0ÃR½Ò¿ÖÃR×§×пXÒ¤­{Ï¿â) xÍ¿ä-Ùg©Ë¿W|:¼CÊ¿ÌÕƒ:¼È¿òL»›¥Ç¿R³U\&ÒÆ¿ƒœX‡[Þ¿2¿%‡½©ß¿sëÈ)5t࿟ãÏr9 ῲòõkz•á¿ä?e£â¿BdP#€†â¿É¤-¬ÿé⿸›]t4>㿆PÍcQ‚ã¿"ë9’§µã¿¤+§¬×㿼ºº¶$è㿚æaPÙÏ¿Nx¹ÁÑ¿~å¶o_:Ò¿R 4£“~Ó¿q7õBÒÔ¿æ {,2Ö¿o`>¿ïš×¿ys-ü Ù¿« %yÚ¿ãÁãŽçÛ¿`— ÒPÝ¿w¦ y±Þ¿pØzyà¿TéŽ*ƥ࿊T‘šK?á¿çl\)Îá¿w0{0Qâ¿m†ra’Æâ¿Ùò騼-ã¿àÔヅ㿀$ Íã¿ Ì ´俈fÂ%ë(ä¿§„ú{G<ä¿ Tã=ä¿ûÕ ž-ä¿Ã”Ç©m 俦”|mÕ×ã¿8O˜MC“ã¿/ùd>ã¿ÓL¼Ñ Ú⿦ÙëZ7g⿽Ö×þæá¿&=§Š¢Zá¿añm®~Ãà¿‚ïd #à¿|NG.¥õÞ¿®áNcò˜Ý¿¿?Œ\3Ü¿dD¯XÈÚ¿g~ÐÕk[Ù¿Êð׿£Qbûó‰Ö¿­„ie,Õ¿4QÕÚÓ¿g‘DÛ‡˜Ò¿d‚Ë=hÑ¿8yNпD6—ο.ñØ"ÇÌ¿^äæ0Ë¿hMefBØÉ¿Ø‡ ìŽÀÈ¿ò‡„ìÇ¿ l®m3^Ç¿¶z›~÷Ç¿6n’Ç¿Nwª“ `Ç¿þ¸¦ïÇ¿8oàøÄÈ¿Žˆ#ôÝɿ⿮Ý7Ë¿fKYÏÌ¿Œç×6o Î¿ÒÏA)KSпÄ`¥Ü]nÑ¿„݈h§žÒ¿¯ksT.áÓ¿Fù¯1Õ¿úïãÖ¿÷üæÚó׿ÉÞÚÓ^Ù¿4?ËÚ¿–÷A]š5Ü¿+@5™hšÝ¿î¿9öÞ¿z`ÃÙ"࿨}i#ÍÂà¿"á‡ÒlYá¿È¦'yFåá¿w›6ueâ¿«ƒ(l×â¿v3MBj;ã¿«™é‹ ã¿ÎŠ–swÔ㿺¾ä¿Nÿç(#*ä¿'x«œ»:俟Ö“'ZпîÈ™ wÑ¿b3‰K€©Ò¿ø”x—îÓ¿¶öp1CÕ¿^3É[ ¤Ö¿ùÚÛ ؿȺÕBà|Ù¿ÈO3³ÞíÚ¿˜8¿Ã4]Ü¿z .]ÇÝ¿|Ž¥uß(ß¿(I±4,?à¿Ñ kã¿È/|Ãã¿uE" ä¿E`4ÓAä¿P‹W gä¿@wü5dz俈¯y0æ{ä¿€ýu~kä¿{ÿc,Iä¿÷f1åaä¿^zíá•Ðã¿ÄËf£u{ã¿ Ý QÕã¿VNÇ@¯£â¿ý?1!#⿦']ek–á¿£ôýÝéþà¿ X´^࿬jjDõjß¿ßj{ Þ¿L?Üè§Ü¿Víy»R;Û¿‹1ë¡ÍÙ¿º˜Ý†”aØ¿ ý‘°úÖ¿h“OoœÕ¿Ê†Ñ®4JÔ¿\ÇkëFÓ¿‹ž rÆÖÑ¿c2'¦»Ð¿Hµ6HqÏ¿ÕyMƒ… Í¿ŸZ˜s… Ì¿£µZy:°Ê¿eVÁsþ—É¿óÌeeŠÃÈ¿Z#eï4È¿#O)=‹íÇ¿Óz&iîÇ¿2yH%¯6È¿…#p}ÆÈ¿CHŒ"œÉ¿×´9ŒµÊ¿n¹ÜõþÌ¿XüB÷¨Í¿¼TÓÝíyÏ¿YPÔsÀпQ9³UüÛÑ¿b–ÁÉ Ó¿c ºâOÔ¿Æ•ªõ Õ¿w{áñïýÖ¿Cˆ‡¹¨dØ¿¡ËUîpÐÙ¿#º}¶=Û¿ §öó¨Ü¿•`ëݩ޿Î[š;fkß¿,8±—æ]à¿ ¥nÈPþà¿T`D¬f•á¿kÖ Í´!â¿ ;¦äâ¡â¿d'­î¶ã¿À jyã¿£~• Î㿬¨“ÉÀä¿l¯_­€Fä¿9"gÀhä¿8›üåxyä¿ì6¾Ø²¥Ð¿ÖŸÏ(ÃÑ¿ÜØ9ŽöÒ¿ònw¶Ç;Ô¿Òe™š÷Õ¿nÂ.hòÖ¿ú ônµ\Ø¿ñBTµeÌÙ¿‹>hEò=Û¿RÅ=÷Ï­Ü¿{4íwÞ¿Xý>pzß¿q”?B*hà¿-Òo á¿>CBv¥á¿Ês8Æ4⿨huÏÿ·â¿Ê!0¦á-ã¿"¶*4K•ã¿P‡WŽ?íã¿"ÎÐç4ä¿óµ˜(•kä¿FŸm Ãä¿@Òõ¤ä¿|9…|¥ä¿È¨—Éø”ä¿.© |rä¿tT°þž>ä¿@ö¨Êªùã¿¿Cüã]¤ã¿b5þŒ?ã¿ú+èÿ2Ì⿲Þ%šnKâ¿)“ß…¾á¿äôqÃ&á¿ç‰€¦²…à¿2 ͸¹ß¿¾[21Æ[Þ¿~y<€ðôÜ¿&‘²¡°ˆÛ¿>xΌڿô°Ô߮ؿyh’ÀF׿%››ÒèÕ¿Z¢(}•Ô¿mþU4RÓ¿­¨=?_!Ò¿Fê4ñÑ¿EÀk¢¨пS´Æ“4ο<‘ꢜ̿NP˜¾øBË¿Ròb¶n*Ê¿éaP½UÉ¿`²MBõÆÈ¿‡üÂHxÈ¿þñÖo€È¿ÌufÈÈ¿ùñƒXÉ¿z.ö¢P.Ê¿¦ñÍðGË¿æ™Y¨¢Ì¿~Bœ,;οõÄ“¥п†ÕDÒZ Ñ¿XÏ÷$&Ò¿žö±…>WÓ¿±«{ šÔ¿ØÖMççëÕ¿VöD!1I׿–¥M¤b°Ø¿*H¦«Ú¿2c+yŠÛ¿Õô‰¯FöÜ¿Ù+ ì’\Þ¿ìi£ê¹ß¿ÕLôax…à¿C z3&ῊùØéš½á¿ÊÇc:Jâ¿dÊâ¿àÃÄÚ=ã¿VÿXÚƒ¢ã¿×Vp ½÷ã¿/ï ¯<ä¿NkEþ¤pä¿ÚóØî “ä¿ ¸tì£ä¿¢ÇÛÃ’ÈпÈ~ï*bæÑ¿Bkx ÑÓ¿oVfÃë_Ô¿'ïïµÕ¿ö)w!y׿&Îì>‚Ø¿v=ÙEgòÙ¿n_jdÛ¿n¾ãȺÔÜ¿ðn0KÑ?Þ¿¾¢t2¢ß¿•$[<|à¿Þª8®á¿tD˜Þ¹á¿îO·QIâ¿"ÝשÌâ¿ö+¹²¤Bã¿ ¾æ‚!ªã¿K‚”1#ä¿áÝüÀÒIä¿q@$S€ä¿§9PGª¥ä¿bƒð¸ä¿lY¯¼Gºä¿ ›Œ ¬©ä¿0-Ö5(‡ä¿Ã›qSä¿"|hä¿Ê¼x¸ã¿ÙøË“Sã¿àzsØ àâ¿ ¹)_â¿»ÊldÒá¿«¤ãÎ:á¿EÈ­9ܘà¿þFÄ¿¶ßß¿šzÉrÞ¿*e7>NÝ¿„Z÷ŽÄ­Û¿@ð`¬[?Ú¿¸`ѱžÒØ¿Š+è~k׿š ä7 Ö¿ -ˆ¿j¹Ô¿F•DöuÓ¿T­ƒDúDÒ¿Ñ3RÊi)Ñ¿ G÷&п֧R€zοàØctôâÌ¿Í-$‰Ë¿ÝÈ>ypÊ¿J𠭛ɿH›=oÏ É¿9”DÅÈ¿'k÷ÉÅÈ¿x‰ÞaɿݭÕOKžÉ¿3NitÊ¿BRñÌË¿Ñ+T•èÌ¿¶kÁοhÕU·)п”4­,-Ñ¿j»zÕhIÒ¿²HܵzÓ¿ÄÀ$•¾Ô¿„‘ÕÅÖ¿:ñx3»n׿ »â"ÖØ¿â±Ö9™BÚ¿’æ»Tœ°Û¿Ž0\S§Ý¿lÜþ8ƒÞ¿šm(fÝàß¿¯Åƒ_™à¿¥oõ:ῤ¸?Y™Ñá¿63à·i^â¿mßâ¿lõ ŽnR㿼vL·ã¿·aº ä¿0·}ôäQä¿çJ”ˆ†ä¿ p€™Å¨ä¿L´(óá¹ä¿ T24ÆÐ¿ÂDŸ§2äÑ¿d}SÓÓ¿0HjÙ!^Ô¿9õëü³Õ¿|±“Û׿˜ÏIõØ¿8ç}—qñÙ¿äÑ€è¦cÛ¿ ´'ÔÜ¿ôLÁ)k?Þ¿6&Љõ¡ß¿…ˆ:\0|à¿ÛF€L²á¿'ñï¹á¿ "ùmIâ¿¿açÍÌ⿾’ÍBã¿Ñ~)Lªã¿z¦·•Lä¿ñ7$è÷Iä¿çÏ DŸ€ä¿ -6{¿¥ä¿]äÿÍù¸ä¿D9¨ñAºä¿¢ˆDš©ä¿¨Hˆ ‡ä¿«ZxQ÷Rä¿‹™¼Ú ä¿ x'e¸ã¿ö_WlS㿬”,$ëßâ¿V¼¼¬_â¿OðõïÑá¿,È«%:á¿pGñáæ˜à¿¸ŠPcïßß¿“üIÒÞ¿»¾®ÙÝ¿,y2~®Û¿¤þE@Ú¿ÓÝvj»ÓØ¿¨=ždl׿å5ͺ Ö¿~„«!»Ô¿`¦ßwÓ¿ nõGÒ¿HÔÕ¡¯+Ñ¿ólÙŠr(п0ö#þºο`aú`èÌ¿Ì8mPÈŽË¿jÛIvÊ¿ä´)žž¡É¿’ ¼ûÔɿǣDPËÈ¿à±WIÐËÈ¿:¢~SÉ¿èèg¥¤É¿lY-¹yÊ¿¿ßx'“Ë¿ÔTeȦíÌ¿¾ßÞڅοDÐÉ)ç+пÂŒ&~/Ñ¿ÙÅÑ-KÒ¿Àé 6|Ó¿I™µ:Ÿ¿Ô¿MÒÇÖ¿WRIƒn׿ªîk‚µÕØ¿ïÈJ BÚ¿Ý'yõ¯Û¿oÕ¥ñÝ¿Fæý}‚Þ¿L¤´î"àß¿àÌó´Â˜à¿Z K²9á¿o[®¿TÑá¿7ÓM4^â¿$ßÔ÷Þâ¿ãókaR㿜DyY·ã¿ƒÃ¼rè ä¿Ø..Ñ@Rä¿©©} ¼†ä¿?¹Ãß©ä¿.4»ä¿\ïîïj¢Ð¿H,ÓJÀÑ¿ÁqãþÆóÒ¿ƒè^;í9Ô¿g"q_šÕ¿Enº†ñÖ¿83ðJ\Ø¿v£…wjÌÙ¿lSŸ«^>Û¿p~«™®Ü¿´¹“Þ¿,~¥vÏ{ß¿RÞÇôhà¿ÈÀíüL á¿d«°È_¦á¿Ø<ý‰³5â¿Wš/é¸â¿e,À•¿.ã¿’«™–ã¿ÓæÛñíã¿Çþ"+{5ä¿™˜lä¿øB_ ‘ä¿Ü“Z1¤ä¿ûQ›°g¥ä¿o¸çȸ”ä¿Øƒ½}(rä¿y. É>ä¿Î¯±ùã¿àü‰™£ã¿jC º´>㿪áâ¶MËâ¿F5b™ƒJâ¿ [9\–½á¿7”nÈã%á¿ÅhGä„à¿l4²L¸ß¿~ö’(™ZÞ¿2æ –ôÜ¿LUi–'ˆÛ¿ zkÖeÚ¿+ÝjS®Ø¿Õ!uG׿}¥°BéÕ¿/©!€—Ô¿H‹ÿLTÓ¿7òÍÂì#Ò¿QwÌîÑ¿aÎ4NпÖ©×;οÐó"٤̿‰óSÓ¿KË¿Žæ©3Ê¿n>aÕL_É¿ÞÞp·ÐÈ¿ Ÿ©ºI‰È¿’:Þʼnȿý§&€$ÒÈ¿ Ì… ¥aÉ¿“Jà;è6Ê¿¾$ÍšßOË¿¤Éã®Ð©Ì¿(®q6aAοĎ€ûN п~aºâ Ñ¿jØÄ'Ò¿ó1ÞGNXÓ¿¾wΛԿÄ4Y¯“ëÕ¿ïOÕEH׿ú—”¯Ø¿>ìììڿʨ{tyˆÛ¿FÖYôÜ¿ýHp›YZÞ¿®»ðT··ß¿!Q ùl„à¿L8;A%á¿Þ-®M̼Ῐ‘^M™Iâ¿åÒ˜SNÊâ¿Ñ˶°=ã¿x‘»v¥¢ã¿!6x;øã¿ÜK(Fª=ä¿HÃÖ]rä¿>&z&–ä¿NÖ’«—§ä¿zUI—WпìŸÞ,uÑ¿n!ÅY¨Ò¿Úü½Æ)îÓ¿ÖßßüzCÕ¿Ž¦8¥Ö¿ÂÍüÌcØ¿l‰'Ù¿ZiÕΡðÚ¿¬cZm`Ü¿g»É“õÊÝ¿D¸"À,ß¿Î`øA4Aà¿ÔDú1Täà¿Æ–ˆÕ/~á¿Æ0N â¿¥ ÒpPâ¿2¥Qö㿈Å& mã¿ÒOÜÒÄã¿F³þ6 俦[«žBä¿ú’gä¿‚íP$zä¿wi!¿{ä¿ÂT kä¿:|˜qHä¿ Ó5î\ä¿óiŸ­MÏã¿ öH}ñyã¿êÁ¯ã¿ï%ŽìΡâ¿hæ¿T#!â¿Lø‡.[”á¿p&Ôüà¿íIs\à¿ËCÿfß¿¥BßáÄ Þ¿Èwg²½£Ü¿ÃÖæ_8Û¿“x”.ËÙ¿RRݱ_ؿ֗:DjùÖ¿f™ЛտÔ1èŸBJÔ¿5üvÓ¿÷Ž}2ØÑ¿¨G»pº½Ð¿棯vÏ¿«–Á§Í¿Û.Ì¿ö6ëQ©¸Ê¿t`•û¡É¿'Ô:-ÍÈ¿p¾m:Þ>È¿¿•íð÷Ç¿8Å_øÇ¿ µß<@È¿™7ñiÏȿ޷§ë5¤É¿Çw7¿”¼Ê¿`þ»{ÎÌ¿–i匬Ϳ&Úï4Þ|Ï¿)Ò>#ÁпIQcÏâÛÑ¿èTºjó Ó¿_î2oNÔ¿yV¦5ŸÕ¿Ð@ÿ6àûÖ¿4µëmbØ¿‡5€AÍÙ¿LYS#:Û¿eK¨$¥Ü¿+ºUà ޿‰Ü¹Žgß¿å1HÝ\à¿“Ø’$«üà¿Zwjþ“á¿x02 š ⿵vR$¡â¿¡€ bã¿ènZ6:yã¿n³Ü ºÎ㿉\ßTä¿öd8¸ÈH俤Åøulä¿eÌŵ¿}ä¿â& nÒÏ¿‚³P-HÑ¿î‘#å8Ò¿hæ—Ë~Ó¿H•Q~ÈÒÔ¿0y§3Ö¿ÏnafS׿ü­™aR Ù¿}’Û}Ú¿Á)&+ìÛ¿¦šC9ôUÝ¿¾kÅa·Þ¿Õ›göà¿f4Þtº¨à¿(Fô-=Bá¿48‘^Ñá¿(F—d¸S⿯:½‰Éâ¿ûgÍù/㿽½øüm‡ã¿k”mbÎã¿hïŠ Øä¿£† ¯)俨 /˜›<ä¿—ÍБ¨=俉Ã>Áó,ä¿"2'‘a 俌bâ^Öã¿ãd2m‘ã¿Áæý9<ã¿Ah¦š×â¿õŽfŠdâ¿Ø|Vâ'äá¿U8ød²Wá¿ÚÞ͆Àà¿ ’0 à¿–ÏdðÞ¿éí¦“Ý¿Ï‰›#Š.Ü¿Z*AèÄÚ¿K[ÑÃâWÙ¿Ù>½h]í׿¶Ú2 ˆÖ¿»ÑßÐg+Õ¿çUCÈÚÓ¿{OÉo™Ò¿u]RvjÑ¿`V‚ZÊPп²u :FžÎ¿Ÿ1çnúÏÌ¿4{hÊ';Ë¿î ·ãÉ¿‰Ó  ùÌÈ¿ä¾(¸¢ùÇ¿T*jºkÇ¿Ô}ž$Ç¿-;8%Ç¿0ö¼ mÇ¿ˆ;ŠÖ¿%Uvsï׿õP [»YÙ¿ÄR~©ÅÚ¿²âL»/Ü¿™Lž;u”Ý¿aÚËeð޿З¸D à¿‚ìtOÀà¿DœøGJWá¿}ÿ†•ãá¿ B ×câ¿M¥µ2ÕÖâ¿”¯[t;ã¿÷ŸÑî¿ã¿æi¨wêÕã¿hùÞUP ä¿À[z¢s-ä¿XGþ‰>ä¿’ƒ¸2°Î¿IyŸ¶_tп£ó®.¦Ñ¿‘ŠŒUˆêÒ¿ò¾)M>Ô¿eÉ,ƒ9žÕ¿Èœà¶é׿Ö\kkætØ¿$L0«äÙ¿õ|’¯RÛ¿öAÖo»Ü¿œ]΢uÞ¿@xŠ`oß¿-÷Yà¿x7‘óà¿|š/kXῌČAŸâ¿^¹W|—x⿤°r#ßâ¿ä°Õ!I6㿎i!”4}ã¿xL°6³ã¿\Elqê×ã¿þF¡²²êã¿«ÍÚ-¨ëã¿7døÚã¿“ß-p¸ã¿T- ¡‡„ã¿ÝЏ¾?ã¿,®Âêâ¿K­Ð|h†â¿¸|bѪâ¿‚}Ìœ§“á¿»–ßQῃnêÒçpà¿~6/ú¡ß¿ÎC™&ÓR޿ǾEɘ÷Ü¿_ø¬¯¦“Û¿2’‹m*Ú¿p_°j¿Ø¿1²C„V׿´ÕÿàòÕ¿Sµãƒ––Կ΄8Ÿ"GÓ¿Ò`' éÒ¿Õtk>ÙпOÙÓÑ«€Ï¿ ËWC3Í¿Ÿ"WµŽ²Ë¿NÖ^Ç/Ê¿‰ðúÈÈ¿”ªDò=³Ç¿É•4é¨àÆ¿cqòšASÆ¿‘ïT»c Æ¿ã@Õ Æ¿ðÜ¥L‰TÆ¿òŽ»é¸âÆ¿õÜi¥¶Ç¿ºty’ÌÈ¿(;tëƒ#Ê¿P b½˜·Ë¿þý›óê„Í¿”ý­ˆ‡Ï¿äÈ5Ì|ÜпÕf›i« Ò¿©I‚KÓ¿q0Ù¸™Ô¿$n®âHôÕ¿>çÊÃMX׿‰´OVÁØ¿®Æ79,Ú¿Z×Yã”Û¿¥ªŸmoøÜ¿( €>SÞ¿>Æ<ø¡ß¿4Kºì°pà¿·Nb‡3ῦoMG“ῼéíâ¿Î¨{Ô…â¿|Áh Þéâ¿ók$™Ý>ã¿ìކ³»ƒã¿žª>5Ç·ã¿ üÔfhÚã¿"L·ë㿘#KÍ¿}(#V»Ï¿bQž„ ñп]&lÜ4Ò¿N,Z¬s‡Ó¿à›×Ö$æÔ¿è™ÃMÖ¿”?u?º×¿fW²(Ù¿; @éb•Ú¿Æ sÐüÛ¿iOq¨‡[Ý¿,ËÈ,+®Þ¿`Ý{ñß¿^åg0‘à¿ 8t÷á¿jNã¿§/æZõr㿳lP“…ã¿66®n†ã¿ÑrßoÇuã¿n˜mNSã¿ï`ôˆ㿯ZšõÚ⿹„ÕÂ?†â¿¶rƒF="⿦´‡–ç¯á¿Xãž¶[0á¿éèפà¿ìí¡´à¿\Ÿ7ÏÞÞ¿tupcøÝ¿ -v$7Ü¿¶Æ›R›ÔÚ¿œÕëàÙlÙ¿ÞÛ BTØ¿¨yAà‡›Ö¿Õ¸‹í8Õ¿Ù[ËöðÞÓ¿.9RèÒ¿°®_ RÑ¿®8ÛKo%пƒÇ•Sïοö®­Ì¿= HIRÊ¿ÛÓhÀÈ¿Èý€¢¯kÇ¿·Ä'Y'WÆ¿ÂC;Í{…Å¿c0y.°øÄ¿tI[p²Ä¿V.ÒղĿ—†ïùÄ¿Ôûy‡Å¿}à´ãYÆ¿Ë11&oÇ¿Óú¤Ð•ÄÈ¿´BkçVÊ¿¸F%~:"Ì¿r[o!""ο|a3û×(п†ÓÎ!ÀUÑ¿îabSؔҿý©pâÓ¿8ó”J;Õ¿â>BèÙÖ¿'F›“\Ø¿\ˉnÙ¿<ÔÍUèÕÚ¿Yì58Ü¿ˆ9™j‘Ý¿«zÊÍÞÞ¿IáCPzà¿´E"f¤à¿¸$«·/á¿\€Œ@¯á¿˜!škF!â¿F _®,…â¿ÌŠ“ÏÙ⿸KÁ§Xã¿–<ªRã¿§â!yktã¿”8g±á„ã¿<0Z£¡¦Ë¿lUA%óÚÍ¿êdòпjãÍ^Ñ¿ÞÍß7ò¯Ò¿Ì™|Ô Ô¿nóSÜürÕ¿véÚÅÞÖ¿óŽuŽêJØ¿Ìr†^üµÙ¿a"5ÍÛ¿°3Ó…íxÜ¿û ³ÊÝ¿¤þ,PÔ ß¿ "x ¥à¿êݾ¾ªà¿Q•ØèÝ+á¿r¬­ñÆŸá¿}ųÿ^â¿C…­®[⿎¼cä¡â¿µ±óìN×â¿ïƒb©ûâ¿„Òà㿎NÕ㿺¢ox9þâ¿9¬Á€ÔÛ⿨]y”:¨â¿EN˜›çc⿸á‡â¿ú#Ñï«á¿Ò-Á!:á¿ÿ[Ðñ»à¿v:ƒ30à¿o6ß}5ß¿åóÇ&\øÝ¿ \²÷¬Ü¿"|<ÜSÛ¿>ðPÇóÙ¿ˆ%¸#Ø¿×O7=%׿wæÑÅ2¿Õ¿ëpíV^Ô¿[“þ­Ó¿üÒK–±¹Ñ¿ï™ m|п…’qº¦¢Î¿ ?ïˆvÌ¿› ‘SÝyÊ¿JP1`Š±È¿a –õ!Ç¿^'2¾øÎÅ¿Â?|ػĿšl8T=ëÿhÒ(—'_ÿèRKWïÿ :™õ\ÿú£ÿ£^`ÿ@c¨+íÿ’e%#}¾Ä¿Æ8RÒÅ¿0¢Ë&Ç¿+Ô¯–F¶È¿Zn+.FÊ¿.Òõwš|Ì¿®u@z\©Î¿&\“#€Ð¿6lbœ½Ñ¿5/ÜqB Ó¿æ-ÓfØ`Ô¿Áú«ƒ±ÁÕ¿-ÂMÜi'׿o(PÎŽØ¿*C!jôÙ¿£=hòËTÛ¿„Gò심ܿ&XYøÝ¿V„ÿ4ß¿Ý{¿2·/࿳¨*bºà¿ÇÓI»(9á¿Mñ Ъá¿Yo×==â¿ã=Ávbâ¿#2!Œ¦¦â¿®èaJÚâ¿RiHÊCü⿘õÀ©² ã¿ iìÆÉ¿º¬ÓõføË¿ÀwGTοÎ'Â]jп–d³É¹Ñ¿`4+.Ó¿J¹ß1yÔ¿^ymgâÕ¿B6UM׿‰úä`}¶Ø¿‹šŠ·gÚ¿\·Öý¨uÛ¿mQRìÄÜ¿95y±ùÞ¿²Uí Á2ß¿’Q¯%à¿b¹»Ý¦à¿Ì•ÚnNá¿4œÂèK~á¿ÉŽG~Ôá¿HÐgØâ¿R„äNâ¿(žô|sâ¿Ð¯Õ==…â¿ZrÂÈÛ…â¿ÎúŸMuâ¿ÀR81Sâ¿UY‡Ûšâ¿óS> ”Ûá¿Å¾Hc˜‡á¿³ôÚ¡z$á¿óØ0œ2³à¿¹÷ÐÚ4à¿°¯ÛX[Uß¿b¶ü,Þ¿‹iP”ðÜ¿Á_Ž$¦Û¿I`Ë¿OÚ¿Ë–=ÝðØ¿ÿþOøÒŒ×¿ Ž­'Ö¿ŒInÒ ÃÔ¿6“,-dÓ¿)öÊfÜ Ò¿Öé4ÏcÃпü±úäÏ¿`6Q½"½Ì¿Ð†J<”Ê¿”@¯ÛƒšÈ¿WqðÚ×ÔÆ¿³V †–GÅ¿ÐÄaE“öÿôåzJ å¿bÿÒ™¨¿‹@7\bŠÁ¿Üqž›DÁ¿°½¿üDÁ¿.½–;’‹Á¿P O3ˆ¿6ñ§œç¿è/ûÑùÿ¤R4„KÅ¿'ëÃsÙÆ¿•ÊøÌŸÈ¿­w~F1šÊ¿6ØñüÁÃÌ¿0<,Ï¿•§TLÇп=ˆ†Ò¿·H0ØfÓ¿&¬¼ÅÔ¿mùmg)Ö¿lgßö¿Ž×¿Æ@WòØ¿²àªÂ¾PÚ¿Fñ:•¦Û¿ôb¡NðÜ¿Pd·™v+Þ¿T¡ÕWETß¿Hƒ£ð 4à¿2L´Õ#²à¿ïï×-#ῦÎf †á¿½_¢vÕÙá¿b1íû¦â¿·ë ÃÖPâ¿®0¶Ürâ¿ÃR­ÌNƒâ¿!UUl°Ç¿ï“ûÑœÞÉ¿µã’ð6Ì¿VÊÍjœ³Î¿è£¥<>§Ð¿¢êja‘Ò¿u¹‘ÀsbÓ¿ZçùË|ÉÔ¿® ¿72Ö¿¶ot/,™×¿dÔ¤æúØ¿°°!TÚ¿M—¥ˆ+¡Û¿náÈ3ßÜ¿û¤½ Þ¿An­Ú!ß¿º +xà¿™öäºï‚à¿~¸Þ<çà¿aÞ‘k<á¿@7"C­á¿vóQ+O¶á¿×<¼e0Úá¿£ S*ìá¿ÍktÁ¥ìῼ'Üá¿Øè-S÷¹á¿ÕWÝ:̆á¿MÚ”qCá¿Ø8þÈ’ï࿯”©ïà¿‹‰nd]à¿íx ‚=ß¿qZÂÉ*Þ¿rè;8:Ý¿ æþÁ²ÉÛ¿b¬\¤;Ú¿„Êþ-Ù¿ý~xQOÐ×¿ÂÆÀinÖ¿i_ Õ¿)صô>©Ó¿ÑÉ<´ LÒ¿CÔуøÐ¿OÔ˜Y`Ï¿üÃoŒíÌ¿A[/ލžÊ¿{Ã3]yÈ¿o,*Åò‚Æ¿ð§`R?ÀÄ¿éªÇܘ5ÿPPí¹ËæÁ¿ˆŒ×À¿âxú  À¿¹ „ŽTý¾¿P?—r¾¿•u—ls¾¿„= ¦ÿ¾¿uh%Ù À¿DÞèp‹ÙÀ¿¼Q ^ðéÁ¿àÊÿh9ÿ@¾9¼ÄÄ¿“⽈ƿ·IöT7È¿{)t3¥Ê¿ê8FËÈôÌ¿ N 5(hÏ¿ª½ÞÈÐûп—…zNxOÒ¿'[)¬Ó¿X€®‡ Õ¿ÎcÎz’pÖ¿ö_mãÑ׿%µêi.Ù¿²IÙ¿Ú¿dòG}¦ÉÛ¿=㑈™Ý¿Þ+r‘)Þ¿J€q²;ß¿¸Ó¾Å)à¿ÚDj‘‚‹à¿NEgsËíà¿4ò?‹Aá¿äÈ z„ῚÚbZd·á¿…e#IÙá¿àmôøÁéá¿ï ¡khÅ¿~èt9”’Ç¿®–áæÉ¿55D_Ì¿Gè ´¢õο|0¤¥ÌÑпCò»ZE1Ò¿‚º¦oؕӿEŒ‚ÈüÔ¿ë—û»`Ö¿xø<žÏ¿×¿DSû<|Ù¿yt7IaÚ¿{r§ Û¿š®¤B¸ÆÜ¿:n¤.zÛݿञªØÞ¿r§Òÿ޻߿´S¬vAà¿i;Çø•à¿a–×þ¨Úà¿hYÊÓá¿r)¯k2á¿8Wq"Dá¿°±)ØwDá¿uiìÔ 4á¿ÚGØúá¿ýk+Nßà¿k¦Ä›à¿g¨Ó¹Hà¿Ö6ÝnˆÍß¿ ØL°íÞ¿.|{ôÝ¿ ±"1ãÜ¿.@÷œ½Û¿Tçâg5†Ú¿Ð69Þý?Ù¿çøØ®î׿i¦ÞDֿؓhæ…4Õ¿.Þl—‡ÓÓ¿¼Z’¡FtÒ¿¨—]k$Ñ¿ª_j9ìÏ¿-Ôd÷Í¿Oã °–Ê¿BížLÈ¿Û2Ã*Æ¿ô˜rØÿ7Ä¿Bav”x¿C[,›ÎðÀ¿¤cV6åH¿¿YþYf-½¿ß·ÈéS”»¿sÌgØ™º¿ªPj Û÷¹¿å¸ ¬ø¹¿ â¢܃º¿lWú­×—»¿M^p/2½¿ð=pøN¿¿Az/€ôÀ¿úVlñ|¿͋~® =Ä¿ûL¸Õ0Æ¿(£ÛZˆRÈ¿*}ã¦àÊ¿ùã)%Ä Í¿9”®·£—Ï¿ñXï·)Ñ¿ö`63lwÒ¿Ì¢ÖS=ÖÓ¿Ö­‡I¼6Õ¿÷V!ˆ•Ö¿¸:pn>ï׿T•jmˆ@Ù¿@ì³f#†Ú¿9ê¹è¼Û¿ÊqéÕáÜ¿ÄZÙòÝ¿‹îvlûêÞ¿®*ö¾#Êß¿ìs°Ô¯F࿱õk#d™à¿,¸¼‘`Ü࿱5Jþá¿,f[¿0á¿úà~Ì?Aá¿Êe¡oó¿Nzk¸Å¿:‚zž…iÇ¿>¹ rÝÉ¿Àà+SvnÌ¿£/ÿ1Ï¿²²¨`èп–5.I5JÒ¿ ã®­Ó¿2ì^Õ¿¦‹àkÖ¿=Tٿ׿1YyÇÙ¿a'ƒH=AÚ¿ão”‚hÛ¿i-OÿzÜ¿‡CjvÝ¿"ãGç^WÞ¿q–䊶ß¿0%Ì„<Äß¿Üt~-&à¿ý|#ÀÔYà¿€“Ó|}à¿Àv‚f‡Žà¿Ýhb´Žà¿ •=X~à¿Ó^Œm\à¿×d2™Î)࿦¦šË×Íß¿à“íƒÜ(ß¿¶ÀxIf޿̶5ˆÝ¿ÖÞ­ñ9Ü¿>ë©1PÛ¿èàÈè]Ú¿(í[Ö(Ù¿hßcå׿¤£ÎØÉ•Ö¿à˜\w->Õ¿þ˜ýÑ‘áÓ¿Ìe/SƒÒ¿¬ÞOÑ&Ñ¿8YΞϿ´. ŠÅÍ¿)¡vúyÊ¿õ|)¤È¿PÆ/Û²ÊÅ¿ûåMュÿˆ…ø¾Á¿zÄz"À¿ÈiǨý¼¿͂ƞiº¿¶Õ-RsR¸¿f8o㦼¶¿–Î$W¬µ¿ÍæRqt#µ¿‡îÜþ@$µ¿n ñM®µ¿L4—ßÀ¶¿q‹n W¸¿}43voº¿ÖNP!½¿—ë[À¿ÄLR.áÃÁ¿¸vK]³Ã¿Ù´»˜ÑÅ¿ô$ÅÈ¿ êÇîÀÊ¿¿÷¸ ”Í¿ Ù»2¥Ï¿’ò03*Ñ¿Ø?º­:†Ò¿ŸðêïãÓ¿‚®Äù?Õ¿ (:ƒü–Ö¿²¥Ï§å׿{% ¿(Ù¿æ P!]Ú¿à'`(ÑÛ¿ìƒüÜ¿¬¸ ¢…Ý¿PXezbÞ¿m5n>$ß¿”ïN©kÈß¿–Ÿöµ&࿦á×3ýXà¿õqš“zà¿ttTY‹à¿p‘E#XÀ¿Üi —Ñy¿Ñ'ÕM¨ÄÄ¿*yðú2Ç¿\Süžɿ=£æ½aÌ¿®ZUÍ^Ï¿äïW~éпzþ®êIÒ¿¼ªJ¨Ó¿IûaÕ¿2.ôÔSÖ¿øýyO˜×¿jÓ|³¿ÎØ¿¿ø“ƒ^óÙ¿’˜G™^Û¿,:“2&üÛ¿nì|UÛÜ¿îM^̞ݿ–È嫯DÞ¿ŒS$¢mËÞ¿ƒá(žœ1ß¿K]£âqwß¿ÑѬ™ß¿•‹N¯¯™ß¿”êxšyß¿T;|—5ß¿0pJíùÐÞ¿b\VLÞ¿ÈÙÓ~V¨Ý¿ÔKm:çÜ¿òOè­ Ü¿@HyÀÖÛ¿€çdtÚ¿)‘¥CçØ¿Nwк„´×¿*‚)ÊrsÖ¿äš½wò&Õ¿.gÖ>9Òӿ܃k/xÒ¿¥¾ÀàKÑ¿®|•ˆ‡Ï¿âÆx3™ÞÌ¿¾À!VFÊ¿Èçï"ÅÇ¿?‘w&aÅ¿`gùDD ÿ &ÞÁ¿.æÒ#;¾¿Ñ_™9˺¿„ŸÂÈ·¿VôRH$;µ¿ÑŠ\}¦(³¿:ó_5d–±¿Èuã¢8ˆ°¿[œ6¼°¿³cáÉ‚°¿`>‚2Tа¿ÎÌ1Ÿ™±¿ z-m-³¿R#‘Ù·@µ¿`lÃ̔Ϸ¿´ÊâYÓº¿"É¢D¾¿ìÄ" Á¿‰Ïž &ÿ G0ç0hÅ¿ž‰°=ÜÌÇ¿Ì4GÃ4MÊ¿§j2ÎQå̿ÃårÃŽÏ¿ëö}d Ñ¿ìx¿¿{Ò¿zSëÑ!ÔÓ¿0yJ7(Õ¿/ü™Ó tÖ¿* wi´×¿ÆÔZ†5æØ¿,˲HxÚ¿ÐÜ"fdÛ¿"Äc ^Ü¿ÀüjÏãÜ¿|w+£Ý¿ =ÇÍüEÞ¿CÂÝäÉÞ¿’ו§-ß¿¢ž]ˆdpß¿R·8s‘ß¿›lÁš8»¿‡Õ3/êq¿¿Î÷™aþÁ¿\l­ñfÄ¿’V¯ìÆ¿æÀR]‰É¿%¼ˆ†6Ì¿Àr9¯íοEUÙHßÓп½*://Ò¿áðàc^…Ó¿KA;á!ÓÔ¿ÅÁkUDÖ¿ ‰nÚ­H׿‘„‹¢kjØ¿vdÓ:·wÙ¿ŽY”\ýmÚ¿êÖ=äJÛ¿ÂQ_€«¿lÆ•¯¿NIk1kW²¿Ô®Š}ÝSµ¿´±t Ѽ¸¿†!x뉼¿z•ØíXÀ¿<å÷7•¿´á ?-ôÄ¿,h“2žnÇ¿:}ž¦ÍÊ¿V8¤Ì¿¼õ šOÏ¿!ñÐ(?ÿп¨ºÖÐUÒ¿Ö}G¦Ó¿/QwÏîÔ¿õqyï?,Ö¿WȬôD[׿ƒ’EóìxØ¿Í5ÿp‚Ù¿žrø6uÚ¿aQ( âNÛ¿ÑÞœO Ü¿üó8£®Ü¿@g"ÄM1Ý¿¶$|Ž”Ý¿I­x4ÖÝ¿?±–”!÷Ý¿~‚±EzŒµ¿îv¹Ì麹¿çw :¾¿.Å ZÁ¿£A!þÿJ¹W`o”Æ¿®­JD›:É¿W$ „êË¿µf†Î¿+hÄ{¦Ð¿50‚GùÑ¿VT7bCÓ¿ü*5ø‚Ô¿nL0 F²Õ¿ŒvtéÐÖ¿ÔÖáJÛ׿4ÿ:ÞÎØ¿à¿uµO©Ù¿t ‹hÚ¿§ZŽ\¿ Û¿ïRͰcŽÛ¿ƒpà òÛ¿4aÁ0@6Ü¿°€ÀWÜ¿îY0³aVÜ¿÷åt6Ü¿H­~KóÛ¿{ ˜‡Û¿©q«iK Û¿êÊÙ0lÚ¿P¢]Ë[®Ù¿úÆ2u¦ÕØ¿a)ª,ä׿ö+–FÜÖ¿v©3ë‚ÀÕ¿=ekŠ “Ô¿L鼇XÓ¿GCÒ¿J_t·÷Ãп#dC¼áοc¬és8Ì¿õ`D¯¢’É¿Z¢çfÍöÆ¿L<ó]kÄ¿rs•öÁ¿æÍ†`ù<¿¿ ‡ãìªÑº¿åEß4¶¶¿ÊI‹£Yô²¿…tÔéI+¯¿mнD©¿ózôØB¤¿d”-ü˜2 ¿}•†;š¿,˜žhΖ¿±Ð‰9”¿úÓ<”¿ò‚§U–¿±'¯½ÕFš¿(Y‘;=: ¿AÒŽšL¤¿tq¸ŸŒP©¿Z<‘tÏ9¯¿Ž45›öü²¿ÛûR‚0À¶¿B°ãZ_ݺ¿ÒPÐnJ¿¿É"ÇßþÁ¿È«Ü3rÄ¿}H°6 þÆ¿„ˆV¶šÉ¿B‡‰V?Ì¿J1zVPçοø¤füÆÐ¿½7§ªÒ¿žŒmŒ2YÓ¿‘J<§„“Ô¿›Õ=?”¿Õ¿ÌöêXvÚÖ¿ç´>Öhá׿ˆä8;ÙÑØ¿ ¬Zk©Ù¿Ê“uþeÚ¿¬Dj´Û¿‡š2ú†Û¿‹HJ’èÛ¿Å)R²²)Ü¿ÉJÜ¿â?•²q¯¿°†€ÕœÛ³¿`lÉ(N¸¿æäOu½¿Y$,ØèúÀ¿Â;#×€‰Ã¿N:ò .(Æ¿uV3uÐÈ¿Û\‡Ä{Ë¿˜Ý „#οAo#“`п1ä=í§Ñ¿J,8âÒ¿Š›„MàÔ¿:€·Á1*Õ¿¨Ue·Ø¿Ä^)8û׿‰©\ $׿®‚™5Ö¿XÓ}ÄQ0Õ¿:¡tÔ¿"Dx­íÒ¿ÈdZ‹ÜµÑ¿úã¿ÕsпÉw‚yPοØ7ÈÔ~±Ë¿"xBzÉ¿ð›¤|ëpÆ¿[*«DÜÿ»AÆJÛWÁ¿ó½u׿ӽ¿ f%ò‘0¹¿QBrŽÑ´¿¸¦ÒnÁ°¿¼TêüTª¿êË/o½i£¿Kâ&›¿’ıƒ?‘¿­ÆIb]k‚¿~«À‘$éh¿ þN|dO?R÷¿ÆªHh?ìâñr}3h?ˆ[ÛP‡N?Ƭ5L;i¿ºØþˆö†‚¿ÚÂËû/Q‘¿³6ÌÌÓ<›¿(` w£¿–¥4ØS$ª¿QÍ»ãèʰ¿æŽÀ<®Ü´¿¼û‡Tƒ=¹¿§ON⽿¹:è^Á¿Ž“ØÂªãÿž¿ÛáVyÆ¿…íÜŠ£É¿¡wMI·Ë¿¨UõõàTοcoD7ztпgAõï¶Ñ¿óáòí•íÒ¿à@B„Ô¿Æx.Õ¿4w €µ2Ö¿p÷,¯ ׿^-ã ö׿l?×¢¬°Ø¿¢bq,¯NÙ¿À§9?sÎÙ¿žË5É.Ú¿Õ/* (nÚ¿œÐZþ!Ú¿1%Ãu£¿”ê|Vc«¿"‡tuVF²¿µ @dï¶¿ÿyŸÌл¿´Á@‘:oÀ¿êM5 ìÿò¾Aå¦Å¿ò?«£1IÈ¿'-1(ÁèÊ¿k"›H~Ϳۉ} ³пŸ,¶ò8Ñ¿‚—¯ÏäaÒ¿t±mF¯yÓ¿ ñÍ8£}Ô¿„K‹CkÕ¿ÆÏuK@Ö¿”‰Ñ±úÖ¿WŸ•„²˜×¿E¦7TÎØ¿QÈ™yØ¿C]¸Jæ»Ø¿!CUØ:ÛØ¿3ÒQŠ´ÙØ¿~ö»¹Ø¿hh RÁwØ¿~½ *Ø¿d⢵•׿äöfY§÷Ö¿ŒïŠ=Ö¿[{‚¸0iÕ¿Úaý©|Ô¿´¸º0?zÓ¿£æxsdÒ¿6d<õ=Ñ¿U ”%œ пZyâ[”Ϳ¬-¨®Ë¿dÏ#HoÈ¿$›ÖOïÔÅ¿™¯ >ÿR`&÷°À¿#€›üðg¼¿ÒwƒZTš·¿ÐJò᳿’c¦a©e­¿"xöŽ]¥¿ÄáŠu? œ¿0TÉÁ|¹¿Þ¦5Ð(—j¿ï‹{  Üy?tu#ûðÑŒ?ÍäŒxo”?€´y¸{˜?µ®í@¿ƒš?ú  Wš?‘É‘u˜?Õ3ȱ†f”?È?]MtëPžy?FÏ1k¿z¬/Òé¿ÄX*'œ¿âýZòn¥¿Æ|Û7ez­¿‚ê ‹ ³¿L>ÅE¨·¿‚¾ât¼¿Ç‹¹‘k¸À¿®SÖ¸Fÿž±ÆKÜÅ¿(‹l8uÈ¿ ÷Â, Ë¿6őŗͿí£?jY пP–­å=ѿƿØÔˆcÒ¿~Û“¶hxÓ¿D~<ÇÏyÔ¿`ÍÅŒ6eÕ¿ZiH8Ö¿ ÝçðÖ¿ðóÄ0׿X¶s}v Ø¿(läù8jØ¿­”ڨؿj¥>£ÆØ¿FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((40,80) (127,119) (0,0)) 5 žsÄпJ‰»’kšÒ¿î­3 ëdÔ¿96ºÖ"Ö¿Sm˘Ó׿Ž%¯tÙ¿'‰Ç—Û¿(iüUŇܿ<ŸŒ¸b÷Ý¿ü±C…Tß¿ òàw*Oà¿F{#…êà¿Ç‘+nzá¿hBZ⿨í%¦šzâ¿þß|¾éâ¿IZS8M㿯.Ðʤã¿F»ñð?ðã¿·Œ,i/ä¿£ºçŽbä¿A‹uÑCˆä¿xªan¾¡ä¿f-¯®ä¿„Åݵ®ä¿aÜ‚¾¡ä¿PðóCˆä¿õ˜é¿bä¿ìtÖli/ä¿ä€A@ðã¿Ù&2ˤã¿ötÈ8Mã¿Î~Ô¿éâ¿ÛG›zâ¿GKÄâ¿b'’ozá¿Ç|êà¿Gà±’+Oà¿Æm݇Tß¿=¸še÷Ý¿œ7õŸÈ‡Ü¿}Ö¨W“Û¿\Ð2V³tÙ¿ÔëÅw Ó׿–-šGÜ"Ö¿O…'añdÔ¿@£ÊËršÒ¿QÕ8Q{Äп@SUžYÈÍ¿ÂO _õÉ¿ƒy½¶bÆ¿öZÊ!¿ү‰!L¼¿åÍ.³ C´¿že[¨¿î×GrHB¿cúØÅ¥;?M ΤÃW¨?à\‚óUA´?¡$žnIJ¼?ûÑã Â?ðo§bsÆ?d>5zeôÉ?°„±šTÇÍ?uد›òÃÐ?ŒKû“ã™Ò?ÎLí‰[dÔ?)7Çé?"Ö?˜•«¼äÒ×?†_pdtÙ?Úi€2Û?ab“PW‡Ü?XÉG3æöÝ?jOŠ9üSß?ÂàNáNà?.8õ|¶éà?§nDÔzá?}áM0Áÿá?`ĬMKzâ?i¢Òqéâ?RŠ)‡ðLã?+8'Фã?¤Òý ðã?Ÿ E/ä?KÔB¿bä? zFßgˆä?0[B¢ä?•þu°ä?ì£ÌxÑ¿¡u J„bÓ¿|#•‚G@Õ¿£ÆÕ¥ï׿ܚ!"^ÓØ¿›Æ+}†Ú¿K\Zh@)Ü¿Þ>”¥ºÝ¿"ã!µ9ß¿Ž8iÁRà¿Ùä¿#—þà¿Nì¸ÆñŸá¿æYÏm6â¿&ëm®Áâ¿Ø §Á]Aã¿ä -µã¿áxÇÝÔä¿È¼lLxä¿Ö\ô¶Æä¿'hª†å¿&ÕÌ„^=å¿©B+eå¿ñO©±©å¿´]¨!ôŒå¿}­Þ%ôŒå¿-åe¾©å¿H‰»eå¿Iq³£^=å¿ñW_Ó†忉ÆñC¶Æä¿(³¥Œx俾=·+Õä¿°}h-µã¿Œ„´0^Aã¿ú ñ®Áâ¿roOin6â¿l{òŸá¿„{êö—þà¿ÆÔ~_ÂR࿟p_·9ß¿üKU/¨ºÝ¿®‰‡oC)Ü¿¡ñ¯€†Ú¿œëî6bÓØ¿xMbô׿ÇÇM@Õ¿‡ø¨ŠbÓ¿’€ÔxÑ¿ÄÕK®Ï¿Ò6tp‘ Ë¿Ú b±ÆÿÆ¿ÑÙŸÍä¿V±ÐŒ\|½¿wÄ𵿮ø×a©¿eINñ¿c-†üdê?aVGª]©?š¼²”;µ?$O.{šz½?3´³ìããÂ?xï€ÒþÆ?ÞµÙã Ë?&G¸ÒŸÏ?9s®5ExÑ?úBØóaÓ?4ä®?Õ?•—ÆJM×?:‚<."ÓØ?Ïš+†Ú?dl@*Ú(Ü?^¦=-ºÝ?Š´¢÷,9ß?xx£vRà?Zv—ûFþà?ŇŸŸá?ÏÒ#6â?#&OÖVÁâ?v$ÔúAã?»Ê#Ù´ã?:ebÑ…ä?Êf ÝÍwä?†ÑkˆyÆä?ñ[ñVYå?PA=*F=å?ÕÀ:ƒ eå?¸|¼äÈå?é&íïŒå?š(ýu³Ò¿H’nS±Ô¿BÄéH Ö¿'ÿÑGí׿pýå„ÀÙ¿ÍU—àƒÛ¿”q 5D6Ý¿|%HÙ£ÖÞ¿‚0°\ÿ1à¿þ9Úâ¯îà¿­B ï á¿êH¾&OHâ¿£¼häâ¿Y–— á?,aË<óGâ?p{ äâ?Ž»À{tã?Vªêwïøã?Ò¤ä¢qä?FŸYžÜä?䙂M;å?8sðæŒå?*=ý[8Ñå?ËÓfòæ?.7¥]1æ?ç›o™èLæ?å‚4Zæ?}{¸Ò¿­$Î÷IÅÔ¿âä¼85ÅÖ¿èJN†·Ø¿B‘+Ò·™Ú¿¼¿„tòkÜ¿â¢ã¥,Þ¿f8e½Úß¿t"‰Ü—ºà¿SÞ}á¿l3™ƒž5â¿ú-?‚ââ¿(>pÀƒã¿£>Ó¥õä¿j¡gÚš俞醭Üå¿ðœª—íŒå¿ÒÄl´îå¿@ÆåóBæ¿Ù{@y‰æ¿ÈvþÿÂæ¿aï‘ä­ìæ¿ÿƒq ç¿Ì†^ç¿BFH^翨‘àm ç¿ÍÞ­ìæ¿½u‰øÂæ¿W_¾þx‰æ¿. ÝóBæ¿ë€‘´îå¿ý‘íŒå¿‹¹ «Ü忞4Þš俸öš±õä¿V×µ†Àƒã¿…Zc‚ââ¿Ùž—¹ž5â¿¿jd*€}á¿€ãC˜ºà¿XÏÁv¾Úß¿²nF§,Þ¿šÌ9ôkÜ¿hw| º™Ú¿®G~O·Ø¿ÒU¤«8ÅÖ¿òýJ5NÅÔ¿âÝâ©”¸Ò¿ýed®O Ð¿\œÑ”ûÌ¿«$ÅŸ©¤È¿àVâH>Ä¿¢1Uë—¿¿Ü 7BŸ¶¿l‚4âO1«¿ä©·&’¿a±˜´U ’?~þÛP.«?Ì †=˜¶?”?lÊ/–¿?i_Ì£=Ä?¤`¤Š±£È?œm­¡ŠúÌ?h} ÁŸÐ?ÄD û·Ò?ÎåÕ¨ÄÔ?Þð #‡ÄÖ?¡‚¤Z¶Ø?"dp™Ú?ù“üukÜ?Θ¼+,Þ?ôã¨-Úß?~Èf˜Fºà?ò1…®&}á?2tñ>5â?:’ßââ?ÄúèXƒã?aÅ7ªŒä?,×\6]¡ä?;‚xDvå?'ùc‹Œå?šåXîå?6h[  Bæ?»ëñ¹.‰æ?OõMN×Áæ?áñGÕsìæ?7: ©äç?öQ‡1ç?4‡:†ÏBÓ¿Ö”&­^Õ¿BÆ ð\m׿å&TšmÙ¿%õŸ(^Û¿¨ü]Ö=Ý¿fGFv{ ß¿€w™ýbà¿úwsV"6á¿ßÍ#º©þá¿ä¡t¼â¿Üòxømã¿w•Ýä¿l0°`­ä¿ÆÚA#:忲ÁyÎ¹å¿øç•›,æ¿Åò.¬æ¿Kè&Zçæ¿·Ýè/翊ké,)jç¿ÔÖ¹ù•ç¿á->³ç¿r\åÁ翆2eüäÁç¿€l¦!>³ç¿©°šyù•ç¿ïgK)jç¿›Rîç/ç¿×1þYçæ¿vÕ)¬æ¿üM¥i,æ¿K,@Eιå¿Á^‡ #:å¿Æ3„|`­ä¿ñµ/eÝä¿àÕësømã¿O€#ù¼â¿=Â5©©þá¿ñ ÓX"6Ὺrö´ýbà¿„WOí{ ß¿¼Ði%×=Ý¿»-Ë)^Û¿¦“a·›mÙ¿T,_m׿ַ°^Õ¿ƒõVÓBÓ¿}áÑ¿øu\˜ÑÍ¿àE<¡ZɿθJKÔÄ¿© (è—@À¿–¶Ó_EF·¿ôp°Ïú«¿­º¡Æ‹¬’¿bÈlj¦’?’Ïï èö«?R"U©D·?§“ð¿?À?B1Vô"ÓÄ?î’–«YÉ?ØP(¯ÐÍ?Τþ„Ñ?ǽü]5BÓ?Äpšû^Õ?@ÜQ¤l×?Ò¼|ÒlÙ?=Š•Ú]Û?ËIG!k=Ý?à™©Áõ ß?|Âeù®bà?Ëß?‚É5á?ruRHþá?:g!ů»â?DoÚ ‹mã?ô«Öulä?8^ç¿í¬ä?ä0µI°9å?2õpR]¹å?6Lw&¦+æ?¸šBDæ?™(dùææ?‹ÞuŠ/ç?v³îÙØiç?ƒړ¯•ç?jòQ™ö²ç?^³d›Áç?«Æ”Šé½Ó¿lÕ]³AçÕ¿ôõÊØ¿ƒÝsßÚ¿¼’»& Ü¿༺øÝ¿–Æ5iæÑß¿<Åy-¹Ëà¿‚Jm#¤á¿ôšÓ{¬qâ¿`“–Õ3㿊Öìþ&êã¿,D0”ä¿h}ˆˆ1å¿’7úÀÎÁå¿æÈnô©Dæ¿ð vnɹæ¿>bóä 翎ßQì¼yç¿|iŽÄç¿êМüÏÿç¿Ð°øc¸,è¿¶ðX¸Jè¿vX}‡¼Yè¿öïr€¼Yè¿Ü¡Jý·Jè¿2±A¸,è¿·DÌÏÿç¿\ÙQÄç¿Ö¥¢¼yç¿34žä ç¿ÔÜÎÉ¹æ¿ !’‹©D濬ÅpPÎÁå¿ëÅ©ˆ1å¿ÕDÊ/”ä¿V{÷ƒ&êã¿â–ËÕ3ã¿N“û¬qâ¿ÈÝ#¤á¿8rÎÔ¸Ëà¿2&"äåÑß¿T{sºøÝ¿ºÁÏ* Ü¿NPúFÚ¿‘X¯Ø¿n3C5CçÕ¿9êÎë½Ó¿êlÇgˆÑ¿Š7$Ü'ο p‚~§üÉ¿çc!YÅ¿¡Ü. q¨À¿&õ/ŸøÚ·¿ŽÙ¨¶¬¬¿bJ¼O¦#“¿ÔøÀ”ß“?Jû¸ìÄ©¬?kú>qÙ·?ˆ±Œc¢§À?WUCXÅ?¤¶ûÉ?þô¹Î?CJâÖ‡Ñ?he%‹J½Ó?d7¸óæÕ?6Ð!‹TØ?ÜyIIÚ?°Z”®½ Ü?HÉEøÝ?8Ô—±SÑß?µà)cËà?ûýî8£á? õ3Bqâ?¿Ëtºc3ã?Çãs¯éã?âüÅ´“ä?£F¹Ô 1å?Pé>žPÁå?iJ½3-Dæ?m¯›éO¹æ?€‡}p ç?V_1Oyç?ä|’Ù´Ãç?ú`iðrÿç?ÜÑɾc,è?[›tÜjJè?`;YvYè?‡âsÎZ)Ô¿qö•v^Ö¿QdÞÅÆ…Ø¿#2/[÷Ú¿äñ®¦½¥Ü¿xÅÖÙ›Þ¿~Š?࿇{6"'á¿Í¡ÊO&⿹ÜÖâ¿K9çÕWœã¿w/ÿƒ‰Vä¿ãöƒ60å¿w9ñÔà¤å¿õ|E88æ¿’‡]¨Û½æ¿z…“x5翨ÅAÅžç¿gç%€ùç¿iØ”sEè¿agƒm‚è¿ú>RJ°è¿Ë6CíÎè¿äa[qCÞè¿&ÐOgCÞè¿è %íÎè¿»JH J°è¿"ÚÖ=m‚è¿R>ÎÆrEè¿`û¯V€ùç¿áLÄÄžç¿î)ãx5ç¿0$ ۽濟¹…—78æ¿h˜ à¤å¿b/p/å¿wz´ˆVä¿,™æÿVœã¿3øÒ' Öâ¿6Ô8w%â¿Ö Fc!'á¿(;Ž;‰?à¿{¬×›Þ¿@µÙm¼¥Ü¿àþjöÚ¿#Åh4Æ…Ø¿|« v^Ö¿Ÿ)Y[)Ô¿wÄSIÑçÑ¿L}÷y6Ï¿ ORŠÊ¿su,BJÍÅ¿³ã«þÁ¿mç½\¸¿¼C=¤H­¿Y4Îh‡‹“¿ ¨k8†“?Z‚1íE­?ÓÇ9ÈR[¸?ŠÝÞqQÁ?%ã8xÌÅ?ZºLó(‰Ê?4 Aw5Ï?UVm‡@çÑ?x™#C¸(Ô?Ÿ¤¿]Ö?¹%ìø„Ø?KÈÞÚ?€~›¨_¥Ü? ޤ]W›Þ?Õ½29?à?Ò†{Ã&á?—»â?V §™Õâ?>Ö¯šÛ›ã?èÌé7Vä?ªUÏ—©å?®-¤›W¤å?'å.®7æ?dãÕR½æ?(Eo<ò4ç?Åc ©Cžç?úïjÖùç?T²Þ²Eè?†H'‚è?"T‚@í¯è?jèpwœÎè?ÍQÞè?w€¨„Ô¿ ÿ¢ÃÃÖ¿SùÔôØ¿¬ÈØ€Û¿®T y'Ý¿ðøjav&ß¿)ðJۉ࿻ßÏtá¿7hâ¼U⿦ºj+[+ã¿‘ ü&õã¿á¦hࣲä¿Á jû\cå¿\Ý Oåæ¿n|Øœæ¿D5ž˜Ø$ç¿i»É2“žç¿á÷½¼ è¿<×V"fè¿xÎ)n]³è¿"Øfökñè¿á]]u é¿<ª"F?é¿‹ÁøÁáNé¿}Þ´áNé¿1šËúE?é¿ 4 é¿3à9›kñ迲{kù\³è¿Rj”fè¿Fˆ¼ è¿P"t’žç¿d÷³Â×$ç¿qåäלæ¿r¬UNäæ¿€Ñ|æ[cå¿E™ ¹¢²ä¿î¦Å%õã¿ÞáçY+ã¿j•»Uâ¿É£VŒÎtá¿oÍ †‰à¿¶÷Ás&ß¿ºìÑv'Ý¿ H0w~Û¿màÑôØ¿3kÚIÁÃÖ¿¬¦ûÀ¦„Ô¿zŸæûä8Ò¿ÔFÍÃÏ¿™Ns‹9Ë¿°`ñþ/Æ¿±1OPÁ¿ÙNO˸¿ÆpþnÍ­¿ •Éó¶ã“¿x!¥ýÞ“?(œèé®Ê­? óѹɸ?s°eOÁ?“Ô"=/Æ?'J\È`Ë?ŠI¼µÖÂÏ?@1 ³W8Ò?……ï„Ô?R]ÖåÃÖ?Y%ÆûóØ?<ï(þŒÛ?$3‡û'Ý?¨N5Yæ%ß?šéÉIňà?Ø<Ngtá?eú‚ÎGUâ?ЃÞÛ*ã?> aŸôã?Wè-²ä?f¿b…Êbå?ÂÓ_ÛOæ?ÄéÚ:Aœæ?sëï@B$ç?ýŠ;3ÿç?ê®o/- è?¡,ISŠeè?·úÛݲè?¨‰=øðè?,6h5³é?nÞñ>é?ÊÇ Né?ðÄ„â]ÏÔ¿PÈJ§׿ÿ¢hü²OÙ¿µÝ5Ì"yÛ¿˜ë–%¡‘Ý¿â4})ã—߿ȳú›TÅà¿0£Ú_´á¿0ìÒã˜â¿#͈(qã¿ahk¤Ò=ä¿UX1„þ俊y>±å¿I"äëWæ¿tÍ>Ÿ.ïæ¿þpšnyç¿äT#H”ôç¿*˜Daè¿D#?¥ê¾è¿y=_N é¿>®5Ý>Lé¿ËN•{é¿]Ý€4›é¿Òl ò«é¿:¸mâ«é¿*T„O4›é¿v7ý”{é¿ðî"l>Lé¿ÞŽ$ÎM é¿üa[ôé¾è¿[å77Caè¿€þ«X“ôç¿ý `yç¿¢£>s-ïæ¿çн¢Wæ¿"¸,º<±å¿î.üþä¿ÉØ Ñ=ä¿×ÏU&qã¿n´~˜â¿’]X^´á¿§_µRÅà¿ c‡Gß—ß¿Òý`:‘ݿРTåyÛ¿-¢§*¯OÙ¿Wõ{`£׿xØ~ZÏÔ¿œdÓE<{Ò¿vëxc¸пԖU‹dË¿£±Ì?Á€Æ¿G/äWÁ¿QxÏG4%¹¿¤ø vt9®¿h{¸¹Ä+”¿1YN8Á'”? [c7®?¬¸n$¹?—ëÖ.~ŽÁ?ÿÕ¡î€Æ?T9ÇcË? ú`FÐ?·|ÛµzÒ?o=ûºÎÔ?·¶Æ<æ×?)j<èÐNÙ?ÑŠÅ,xÛ?ª–°¸,‘Ý?ºîû‹A—ß?8a±~ðÄà?öÚ9Äë³á?b™ÑÞþ—â?ÐH¦œpã?­—! ?=ä?¾G¾vgýä?Rp3Ÿ°å?¾çÕŸwVæ?›yŠîæ?òÜUzxç?¿§ñóç?‚=ßY¥`è?pû)œR¾è?7„K4À é?IŒS¾Ké?Vdn‹&{é?%ˆ˜¨Ûšé?ÚhŒÉªé?y%h Õ¿$³lÚªV׿À‚AŸà•Ù¿ËööNÅÛ¿l‚ÝœãÝ¿ªGÝ{ïß¿ñé©pÔóà¿LÿT|våá¿jÿ Ìâ¿ÃŠ’è§ã¿³;òuä¿d¸¾58å¿ÁdRcíå¿ ­Jþ •æ¿Ìn²]Å.ç¿AÛ@¡3ºç¿ªÛBËÿ6è¿=Xäܤè¿R•ì*‡é¿ú-þ<ÄRé¿4<"Ê Ìâ¿ÇU‰tåá¿u`(óÑóà¿ÖpÅ®vïß¿XŸ‚—ãÝ¿(ÒþyIÅÛ¿; Ô Û•Ù¿uè½?¥V׿£¡uÙ Õ¿â/I~w®Ò¿µÈ3Õ^HпØùNDw°Ë¿\\Dº¿Æ¿¤9`‹½¿Á¿ƒ¬ Î×j¹¿éÐ'®¿ Ó\¿Hc”¿©Ä×W`”?ð?¨ƒm‹®?sù}ìõi¹?F~¯@¿Á?b=v¾Æ?úˆÑϯË?ræÑLúGÐ?ãrH£ü­Ò?/ã*-sÕ?ëÎJÚéU×?xTYøõ”Ù?fÓ´ä7ÄÛ?NåŸwãÝ?Vžù¡Ãîß?žHý0cóà?Ô?î¨ôäá?8€Þe€Ëâ?Ƭ7Ew¦ã?níTwQuä?ôPæŽ7å?Úã}·ìå?YÓIg[”æ?„?3K.ç?Ö"¾‡€¹ç?&êËqM6è?–²~‘-¤è?ïxÜÝé?pæ£â$Ré?ò©zãÒ‘é?~~Ñ£ÁÁé?ÞÏäúÓáé?h+,7õñé?Á'H×[1Õ¿?¡¤Ì_ƒ×¿E &ãÆÙ¿m˜úÛ¿Œ§XÞÞ¿@.žvTà¿*}(åMá¿Y½ÕÕ¾â¿0¦‰%ðâ¿XÀŒµÌ㿜—ë÷#ä¿'Ï^ÛÛ`å¿–‚dæ¿C[§ZMÀæ¿ÎÁ¯7.[翌m•§çç¿ÜaÐbeè¿&÷É^Ôè¿2êüq3é¿€¸èØFƒé¿¼à¹¶_Ãé¿,½•óé¿ Êé$Éê¿Gb‹è#ê¿–ƒè#ê¿ü£–áÈê¿üÑ>ž”óé¿Û z_Ãé¿+“Fƒé¿Ô:cq3é¿Üjñ9Ôè¿®Ë~aeè¿AL3¦çç¿­ÊŠ,[ç¿&KMKÀæ¿ÒÜfybæ¿],_¤Ù`å¿®(8“!ä¿,n–ú²Ìã¿‘eRfðâ¿/%4ê»â¿Â+ ÎJá¿<üU5Qà¿Ìò`…×Þ¿C…nzúÛ¿ñ×ÜÆÙ¿ê'Õ+Xƒ×¿¨~T1Õ¿ï)'>ÒÒ¿àÖΚŒgпïJµzåË¿ˆùœ8¨êÆ¿.'´áÁ¿ßr›¹¿n v/gÇ®¿&8ȕ㉔¿Þô(§‡”?†äü<Æ®?ttÈК¹?#ö¼XáÁ?i€=êÆ?–¢Ä—øäË?:*;gÐ?‚¾$9ÕÑÒ?ýºË0Õ?yuƒy¤‚×?Éf óÅÙ? ÛΤUùÛ?)8èCÞ?­{öèà?ùÈ‘®Ëá?‡ ¾[,â?èÕôrïâ?Eþ>‡Ìã?.Êççuœä?>Q&í'`å?"Úó™«æ?xp'I¿æ?MÌ™âmZç?ñø´åæç?Âh¶¥Ÿdè?»ë?PÓè?AÑ®´2é?œFt’‚é?ö..£ºÂé?ò |åóé?¶GÜø]ê?,r¨#ê?%Â\äGÕ¿ÄÙý_œ×¿WøôðKâÙ¿6<¬TAÜ¿È7Aã<Þ¿ˆ^­wo'à¿]Dí÷v&á¿° ¹Æêâ¿·Q!4㿆òÚ'Ãáã¿¢]6³ä¿œÍ¨7—wå¿C§µ÷á.æ¿I5Ÿk~Øæ¿×ß½øtç¿^Gã´迺y¡Sè¿´ÆQáxîè¿ Zè=Né¿•V3¦gžé¿lUvªÄÞ鿌9C-ê¿$'Œ•ƒ/꿃߯³?ê¿üT–³?ê¿ dáHƒ/ê¿VÃ,꿾”1÷ÃÞé¿NüR¿fžé¿"5”ÍøF|Øæ¿@=œß.æ¿Çº¤”w忞jk ³ä¿Sµÿ#Àáã¿ ä0ã¿”èROçâ¿lRãEs&῱Ҋk'à¿î•IÌÚ<Þ¿8ÎëŒ8Ü¿¬ ³BâÙ¿„X‹JVœ×¿ªÍñ7ÚGÕ¿WC[>æÒ¿k%Q­úxQ°Ì¿ãep–ýÇ¿¥‘–—­ôÁ¿~è^ –¶¹¿>íé8ì箿µ6Cœ>Ÿ”¿MWq" ž”?Ž$/ÙJç®?kÔ€‹<¶¹?ɃRyôÁ?ÀZ½Ç?¨×ÞÛÉÌ?ئåæÂxÐ?ߪ£zðåÒ?å‰~¬jGÕ?»>å´›×?R…ÿ[áÙ? B0ýÜ?‡R‹x'<Þ?Ï¢'í&à?nÞ%á?~ªDâ?hCK{„ã?@Dh÷ áã?úyS²ä?ÐFÜZÖvå?{ÚT;.æ?Ú,t´×æ?<'g5sç?&ƒ@è?sY$Ã~~è?#Ýä¢íè?Í‚¯hiMé?9=¯™é?ÏètiÞé?ªf…ê?Ì1°´/ê?ì!Ð o?ê?±¯2VLÕ¿“` {N¡×¿=Rl ´çÙ¿´¥µÜ¿Ü$4CÞ¿ç6[Ï*à¿…Šo& *á¿®+ ³â¿EY-$-ã¿K½Œvêåã¿ü@b·ä¿‘µR|å¿°Uý^„3æ¿€BCDÝæ¿3r’Nêxç¿K$ƒè¿Ù°Ðq„è¿t×ÝG®óè¿zÜ+P‡Sé¿ÒÅ@ÌÁ£é¿È _A,äé¿zOõžê¿”Sáü4ê¿P¿W€/E꿟þ¸c/Eê¿Ëé÷°û4ê¿Qßóež꿦&Ox+äé¿T“ÉÀ£é¿Ðÿ€†Sé¿"ýϬóè¿®Ó~p„è¿‘¦î‘è¿s5Òèxç¿]TÅÕAÝæ¿¾ß±3æ¿^d|å¿ê—Á_·ä¿þ\©çåã¿ci)ã¿åÀޝâ¿$ÅêÙ*Ὶ¬†ÂÊ*à¿~kU*CÞ¿xôCÜ¿ð+Qò¨çÙ¿0û³B¡×¿¢eѶILÕ¿ [£%.êÒ¿®k5Eh|п8Ü©ïÌ¿-"oÃÇ¿ãªq²cøÁ¿õb$™Ý»¹¿ê;O*…­# £”¿CUcâó¢”?K›öî®?š•¬ŸÒ»¹?© ›ìZøÁ?<"²´Ç?Ô+­ÕÌ?DR|Ð?<ØÂêÒ?%(µ¼LÕ?DðÇ ×?@vþ ÔæÙ?8Û¹¬¾Ü?öS?ñ?BÞ?ºø/**à?yS@T)á?öø› ôâ? àMÆjã?ÀóG'%åã?À!/q™¶ä?÷ˆRF{å?æo#œ²2æ?½~ÀZmÜæ? ýxç?ÑlÃÔ4è?¶¹Ö犃è?ü«¼Âòè?Œ˜Ré?+oÓ¢é?Ô´ødDãé?Ü•LÌê?Œ¡¨X4ê?µ>}ÞDê?÷ è¬e>Õ¿o„6Qב׿\•”Å¿ÖÙ¿rVúƸ Ü¿þõBæe/Þ¿èpˆ¯: à¿k×tÐá¿4¦:>×â¿5ޏûâ¿^QcÅäØã¿?ùj{ө俼áÕnå¿é}úÕü$濔…£MÎæ¿šƒÒiç¿Û匣]öç¿Nôß>ftè¿ÅûîéYãè¿\;P7ôBé¿jUñ0ú’é¿ &t|:Ó鿞žžyê¿îÞÊZÕ#ê¿0|H7þ3꿞œ£þ3ê¿WVÊûÔ#ê¿æ… ی꿄ö9Ó鿆¨ù’鿾T×òBé¿ôpHXãè¿(,Zdtè¿ÈêÛz[öç¿”=d‹iç¿[ÕªîJÎæ¿×fˆØù$æ¿XñÜn忯t—æÏ©ä¿ž¬9áàØã¿ï²7X´ûâ¿¶€~²Òâ¿ARËá¿ E¸m5 à¿òDFŸZ/Þ¿ØC4²¬ Ü¿¥3/ײÖÙ¿jH¸{ɑ׿º¨íàV>Õ¿F‰>ÊÝÒ¿&VàšqпX°V}ŽöË¿0 é$¨øÆ¿Ì×Ê–ìÁ¿^N|¿4pêx´Ù®¿ž–_•”¿ÉÉJ9–”?®=[¥;Ú®?..Ô)5«¹?Ü í1¼ìÁ?‚©ŸÏøÆ?zèÏè¶öË?äP^¯­qÐ?õKÿÎÖÝÒ?Sžs‹Q>Õ?dEÛ2—‘×?{Œ(ÖÙ?p»bE; Ü?ü!BÎü-Þ?ó^ÏýYà? óÒ‡ïá?‰¹·Çýâ?fà0äúâ?üÐíØã?z~äJÿ¨ä?¦’ E,må?Ç‹z $æ?¨h ukÍæ?æÊÕÿ¤hç?2¥Bomõç?BcPémsè?n2¬Xâè?Ê héAé?ß²?æå‘é?£·—Òé?L@Û¬wê?n§è"ê?d[¾‰3ê?é 0:ÏÕ¿¢Sφ¯m׿šžÍî¯Ù¿*QºT³àÛ¿$4ó_Þ¿Ñ’)~à¿NNoká¿N'Iå÷á¿ÓNþ™Þâ¿„Œcòrºã¿s#=,!Šä¿6}–$Må¿&ˆóëæ¿{˜†R«æ¿Wƒd ¤Eç¿ÕÝ›Ñç¿ì!Û#ãNè¿•À“œ,½è¿;+ºB4é¿ÿ£«z¿ké¿ä=¼5«é¿,ÿw¦Ûé¿ tíj¼ûé¿ÚµòzÌ ê¿D¡YXÌ ê¿Æ³ ¼ûé¿DÊ c¥Ûé¿0¿OBœ«é¿àªŸ@¾ké¿4J<Á2é¿%ÍÒ*½è¿^0áN迸‘,~™Ñç¿C`§_¡Eç¿Ü:çO«æ¿"Û' æ¿Æ9æö Må¿mDÛ5Šä¿q`Ì¡nºã¿ßK\O•Þ⿆ü Ô÷á¿® Žò‡á¿ ÊBxà¿ø³ÿª ޿̹¨¥àÛ¿®Œ—8¯Ù¿õuF²Ÿm׿ /¾Õ¿˜@±ÖÀÒ¿ÞRQB^XпÖÎÚ¢ËË¿?¯WßbÕÆ¿,‚Œ&ÑÁ¿ç|“Íwƒ¹¿Dc-`+ª®¿šR ôt”¿ø:tw”?–¾ÛE«®?$¼À„¹?-“4·aÑÁ?Ü)l´ÁÕÆ?pnÌË?›ßmüžXÐ?aë'Ý"ÁÒ?M§‹Õ?>ÆÕ6òm×?H ¯Ù?Ž^t"cßÛ?æ½{4dþÝ?æÉ2¾;à?ò hsá?ÞAŒ¯-öá?²"WÚ·Ýâ?\Ã핹ã?ÙLED‰ä?­HWaDLå?±J³…æ?jJyëeªæ?Jðû¯Dç?zžÐç?’ÇÚMè? ([¼è?!SÈ,é?5öª„jé?<] Fªé?¾(·-Úé?Юa4úé?´– Ð ê?©«Â[WêÔ¿ƒ•4׿~cZ*ƒpÙ¿ø×0ÓÀœÛ¿6n ÷·Ý¿Ø!F=ÙÀß¿›r3Û࿽n‡aTËá¿4ÛžHœ°â¿~=h]Šã¿ÇWtX俾u9忱ß`œ^Íå¿!f~tæ¿ÝÆ­gë ç¿Ð0§Ž—ç¿Ò*¤è¿2¬à€è¿àÖ³ßè¿!eú Ê-é¿hÒ mé¿×"ߟœé¿äN*h¼é¿WXùèPÌé¿D‘‚ÃPÌé¿à«‘g¼é¿æ–I#Ÿœé¿?] mé¿DžµÈ-é¿°¼ÿÞ迸Ñ^»Þ€è¿†¶ÿÀ¡è¿__€‹—翇-3€è ç¿üHL@t濺õÚ[Íå¿taIœ5å¿»¨Ñ Xä¿êö®XŠã¿t¨&—°â¿ª.ÚÏNËá¿Ý®ÿ Ûà¿@Qð4ÌÀß¿ZÁ¡ôè·Ý¿>‚ ±œÛ¿“òÁrpÙ¿šìÄ^ƒ4׿äq.DêÔ¿Óøœµ“Ò¿-‰Yo„0пš»RÇۇ˿C‘³Æ¿™³Û—¥Á¿Ëè¤i2E¹¿jp%V:_®¿/U‚žB”¿Gç¥ÅE”?ú1èÆÝ`®?–^»‰F¹?ñ“<¦Á?-çÉEžÆ?*tÚ‹ˆË?þF’\ñ0Ð?(ྫ“Ò?ŽrEëÔ?ó’Ïz›5×? ]œú4rÙ?ôŽîðŸÛ?pà“.M°Ý?jqš½ß?+\GæÙà?ȵ¯PÊá?uC]§¯â?êÛl‰ã?èmWä?táá/Cå?þ4—˜aÌå?¼¥¢@ sæ?D¤©xÜ ç?dÈŠÊs–ç?ÐÔÛ)|è?P<éþ§è?’Èéñ±Ýè?Àq)\,é?¶nké?S ¡®šé?©¿EìϹé?$ ótÈé?ÿ•›Ê£Ô¿‰A`òNæÖ¿¯âæ¿þSÛ [ç¿6» Åç¿Î¡«nS è¿òˆ¼Àlè¿<‡’Ϊ迶ÙîÍDØè¿R°KC÷è¿NÏ÷*ˆé¿R0ˆ鿨eÂ÷è¿ÞîöCØè¿„Ä ªè¿ˆÚ%6¿lè¿O<šQ è¿Ï"DÏÅç¿RnRå?èÓ}Ðãå?hGp0gæ?ëãFýÜæ?ý]És®Dç?Ës¤žç?͵ÔÃèç?¢jMÃ$è?^ÇÑ·àQè?£Gpè?¹Ëœ–^è?ŽôÜ\Ó¿=۷̾zÕ¿4JG#Œ×¿t1Ù¿vË¡‚Û¿xé)BdÝ¿öµJMF4ß¿1ø_ñ…xà¿ã/óMÀLῃ[YOâ¿1ø ŶÔâ¿ó9’#‡ã¿ÕZ1@.ä¿ðß5Èä¿¡¬Vå¿a£¯[Öå¿_ü6Iæ¿ÑÕ»S®æ¿‰'“sç¿nÅVÆ`Nç¿ÂU†[îˆç¿;¿6ø´ç¿Bp°,cÒ翇 Ìáç¿2äëáç¿§VbÒç¿L›F÷´ç¿yŽ2 íˆç¿ó£ÿ_Nç¿þEI}q翤¨@Q®æ¿Àn@4Iæ¿Fâ—bXÖ忞#òVå¿**“ëˆÈ俵[;.ä¿Kµ|‡ã¿¶s)±Ôâ¿3Ë 7Iâ¿“U¹Lá¿ø¯©~x࿊”…{64ß¿kuý0dÝ¿ÞÛ< ‚Û¿.ºÜíŽÙ¿¼|‘X Œ×¿Z)ù¦zÕ¿7­G3\Ó¿t¸|¦j1Ñ¿Øð™røÍ¿ V«P“{É¿¡v¨ÓûîÄ¿~þ±-zUÀ¿Ô­‘¨Èc·¿þA‘Y¬¿ÑøT̆¿’¿Ñ9ìIÅ’?âÙ/?P¬?ªuN¶Ye·?ÌM´½SVÀ?^€íïÄ?VL¥|É?ÞNþ%®ùÍ?3qð!2Ñ?±ÕzjÕ\Ó?â­§–{Õ?€Þ>þ ×?}ùZÖÙ?ê[©‚Û?f30dÝ?jÌãG4ß?¥¿ sxà?QYº‹ Lá?œ à°&â?ªrI‡Ôâ?³*•ÀK‡ã?Z æ!.ä?¹‘q%LÈä?ìOèQÁUå?`4' Öå?¥¾PàHæ?†_áó­æ?ÓÍ¡ ç?MÔ-ŽìMç?ðg¬qˆç?ÖÈýzy´ç?@Í’ÕñÑç?/ªr¡Õàç?Ù¼–ÕÇÒ¿éX=ÖÔ¿‚©0\Ë×Ö¿r&çBËØ¿vÿãðo¯Ú¿\Ëß'ƒÜ¿x2=JEÞ¿@QoÁôß¿t™Y®AÈà¿Á¾ ɋῆ”[4~Dâ¿ðªCïñâ¿»Û>±“ã¿Õùd`)ä¿ØÚãd ²ä¿ŸU.™/å¿ÍŠÀ;ˆžå¿-•žæ¿@†'#Uæ¿–ÇsÑá›æ¿BËÄò®Ôæ¿î$î‚gÿæ¿JÙ(ñç¿\²J:*ç¿ìÎÂ:*ç¿™já’ðç¿’=oˆfÿæ¿ö]é’­Ôæ¿ò à›æ¿ñd–ø Uæ¿n¥ü›æ¿R4Ó6…žå¿ß %/忸:~œ²ä¿òëê\)ä¿rÿêf¬“ã¿Ï>ëéñâ¿`½PVxDâ¿:|#ŸÂ‹á¿{ž–®:È࿌×ú3²ôß¿úR±9EÞ¿.’ôéƒÜ¿l{ãv\¯Ú¿ªñ´Ç-ËØ¿ý'²q´×Ö¿ª Cw$ÖÔ¿*и‰ºÇÒ¿­E»­Ð¿ÛÚÔäÍ¿ÔB¿d¸È¿qÏŒ£NÄ¿äb〷°¿¿²I]î™°¶¿TK¼õD«¿ÅT$H½/’¿6b•º5’?„îJÃH«?ï 5²¶?FXû\o²¿?âšÌ “OÄ?Îl¹È?’Ë Í?Í¥_®Ð?ž¾ zoÈÒ?Ã+ TåÖÔ?R;SuØÖ?Ìûý ÚËØ?GçäܯÚ?0ÊØcƒÜ?6A³qYEÞ?v?®ôß?}Íd3+Èà?öèžÆ¨‹á?ã4-#VDâ?QÚý†Àñâ?}%¯d|“ã?ða"”%)ä?t€¶_²ä?*¯C`Õ.å?‹N”_:žå?›/\êIæ?¡ñÇTæ?œIIN›æ?Nˆï=LÔæ?ú2âÿæ?¯°<¡ç?H‘¹$*ç?쌩îÒ¿åAEôÔ¿•\æ“ Ö¿d¥2<™í׿ÈV§ÝÀÙ¿0(S@„Û¿|¹-ª6Ý¿ÔJVý×Þ¿ø ¸\82à¿”§ëîà¿uÍÏ~-¡á¿cÖÁòHâ¿~ãSÈ«äâ¿J.­¸ uã¿iâ’¬•ùã¿hõYó¸qä¿…Hu@Ýä¿KªGáé;å¿Y‘ÉÕzå¿sžÊÁÑå¿¶h×R’æ¿hñÌ1æ¿GTÇqWMæ¿M¥Ø [æ¿ñ.¬¤ [æ¿аÕVMæ¿ MìË1æ¿Ã7£äæ¿5øà+¿Ñå¿&òxå¿ Æ¿-ç;å¿nÂQ=Ýä¿p[µqä¿¶º›‘ùã¿/Ñ®.uã¿bI³¾¦äâ¿L=/dŠH⿚a/e'¡á¿X*âûäîà¿J è12à¿Îò+×Þ¿hwÿ˜6Ý¿2¾u-„Û¿4ŸTtÉÀÙ¿»VXƒí׿.¸¬I{ Ö¿@b)‰ÚÔ¿ç}¹ÒÒ¿øg п¸¸ÐóÌ¿26h²^ÛÇ¿…'J™Ã¿ -Î\•¾¿÷cBýµåµ¿ŒB–Qª¿¹äµÿŒ‘¿± ‹Â“‘?Œ<4/Tª?¼Ï JQçµ?¶L‚——¾?žì:ú™Ã?˜ÞýXÜÇ?ÒSNªÌ?úoè.Ð?…{ôm Ò?»ˆ|xÔ?uy(  Ö?öA7— î×?D l%3ÁÙ?$dóús„Û?.½…Z½6Ý?ü¨Æ×Þ? Ú½(2à?SáRÎÑîà?Ùz™µ ¡á?[˜ÂPgHâ?m!»û|äâ?ÅŸm$ìtã?ÒX„[ùã?ˆTxWyqä?¥0š“ûÜä?qGZ" ;å?‹ t-å?ÔL“qÑå?© ´RCæ?VAfɃ1æ?p¾#ßMæ?k #øZæ?:æ3x`dÑ¿ïÐò ÝKÓ¿ågÐs'Õ¿Rq†MýõÖ¿®³„j^¶Ø¿J¾ßçgÚ¿ð³Ü¤\Ü¿ô°‹í—Ý¿°0>ß¿‚ “³±?à¿ë‘Pì¾êà¿!Ì7D]‹á¿Ÿªo¬)!â¿·kfÂÇ«â¿M›Ëâ*ã¿”XI*žã¿~\ÜãXä¿ò¬¼.`ä¿3ÔM¡s®ä¿¡¼HL÷ïä¿îTãU‘$å¿Ç+ M!Lå¿ ORËŽfå¿Á2„És忚-NÉså¿“PŸ)Žfå¿8Œö> Lå¿2Ú$å¿bÉubõïä¿"\Gq®ä¿Eò“ð+`ä¿Êf$£Uä¿‘d&žã¿ ÕÝ*ã¿L¢Ã«â¿øónv$!â¿ñÙ/…W‹á¿];ž¸êà¿å/Ϫ?à¿„ºÏ*/ß¿¢”7Ý—Ý¿THÙìJÜ¿zSà³ngÚ¿ºYðžI¶Ø¿ð³ÊæõÖ¿­÷[¹Z'Õ¿1‚þ§ÂKÓ¿x~}ÞCdÑ¿*&ýôäο¼g¥k–ìÊ¿”FŽQ{äÆ¿ÛÑ®AοüðùÙX½¿Ý@¶kµ¿üºÛ«²@©¿ $2«C׿½M·MÝ?ÎSýTÃC©?,ñÕC©µ?ЃrL~Z½?)K$9ÏÂ?6¡ŸðdåÆ?n(§ÿŒíÊ?T?µåÎ? ³jÈdÑ?þ<_‰FLÓ?<7¤×'Õ?YUöÖ?‚Y41¢¶Ø?Ž|«‡­gÚ?Üð%xoÜ?`2CNé—Ý?*äŸ%ß?þ¡6©œ?à?ÌæS¢êà?W¹:‹á?vxŠ!â?5w7™«â?îã1{®*ã?Kà•ïñã?»J”ä?_¬Ìï_ä?·ë¦1®ä?ú¿Ý´ïä?ƒðQ$å?¹^@âæKå?ÓÅ k^få?÷e §så?dSÖ,•пÛ)ÍøeÒ¿]"ÎÓl+Ô¿Y(ãqpäÕ¿Fk`«ó׿œÖ××î,Ù¿ÜÐEcºÚ¿–#Ô[7Ü¿â…í¢Ý¿2A3A8üÞ¿tíZy3!à¿×N=Xºà¿.ÙÁù+Iá¿—×˘VÍá¿ß"œ—†Fâ¿1Â8q´â¿ÍôD²Òã¿ÛrqWnmã¿ F¾¸ã¿vcà…öã¿“ôn7­(ä¿2{ÔÔeNä¿æÙt˜gä¿®÷Œ5tä¿LÁmU5tä¿îΗgä¿°«D¾dNä¿ay8°«(ä¿%pGçƒöã¿[£Q ¸ã¿j?ukmã¿% XÏã¿Q~‘cm´â¿âD‚Fâ¿÷VÊÂQÍá¿=Tºœ&Iá¿jýóSRºà¿Ü÷ý,!à¿ÞØ*üÞ¿lo $Þ¢Ý¿Ž¿BK7Ü¿VÔaQºÚ¿².Û,Ù¿€>ãfÞ׿‡ztYäÕ¿û©ýúS+Ô¿ªXšñÝeÒ¿éx§ú•пúÖ+n tÍ¿ê$+Ϋɿ”6;»ÓÅ¿MNmp1îÁ¿÷§Ì/û»¿þÁ¹´¿FXnʨ¿ÿûÁM‰¿ÉÁfs?ð@~òǨ?ZwØ@ ´?è€Ë™Âü»?áÉ„ïÁ?üå°“ÔÅ?’Ìó­¬É?ú·ækðtÍ?{îÎô•Ð?BJ' NfÒ?–[è½¼+Ô?=L×µäÕ?tÄjã)×?¨°mÚ-Ù?‡ tºÚ?&ƒ‚ÒY7Ü?<Úð=Ú¢Ý?2HÓaüÞ?éÐ[!!à?4OÁ9ºà?æ èÿIá?™ñL¯-Íá?ÂvAYFâ?ñ¹-ÿ?´â?1ÀŽ:žã?ü¸X}7mã?Q1±ַã?ý!RBNöã?¨t *x(ä?Ö[së5Nä?Ñð(gpgä?àìzœtä?âž8ç±dÏ¿¬ÉÞÿOjÑ¿èât‰Ó¿D1¿»ü¸Ô¿Úq A¨MÖ¿èöW}’Ô׿èIZÊLÙ¿‰ÏÑgµÚ¿¾hF}Œ Ü¿tù›dTÝ¿@G7#%‰Þ¿úgI «ß¿z…¤º\à¿_O~lÕÙà¿"0eÁ‹Lá¿õ㖴á¿o¡µ¨¶â¿* ¡±câ¿àé?Uªâ¿â7ðuåâ¿+©=ï㿘Éìߣ8ã¿@HÑ}Pã¿Ì}k\n\ã¿ü¿[#n\ã¿ÿ$&}Pã¿:žÁÁ¢8ã¿åcÏ«í㿘 sésåâ¿aMÇÁRªâ¿dYÌ«®câ¿aé7³â¿3 õ’´á¿ä¸}Q‡Lá¿CªkwÐÙà¿_Ë\%µ\à¿.«ß¿²ôÞ‰Þ¿jÃü¢UTÝ¿p¸†»| Ü¿êE®¸VµÚ¿Ø³;Ö·LÙ¿¼{@x~Ô׿ò}ã¡’MÖ¿m¦=få¸Ô¿\ÀžSpÓ¿‚¶—Ù4jÑ¿¸ÂRTwdÏ¿Ä2ù,(áË¿xlϦLÈ¿µ¨?f(©Ä¿Žña[ëøÀ¿À°åk|º¿«A=Ì©ö²¿N3ègʦ¿LÕñ+©eŽ¿Bb™˜qŽ?Øü n’ä࿺„r2’äà¿þmsá&Úà¿^è¹çVÅà¿7¯Ð/¦à¿H‰6±Â|à¿chƒ6+Ià¿ÂG§{ˆ à¿6‘ˆß¿@¨Ô~åÞ¿Îdˆ™î/Þ¿Ü—tMÀgÝ¿¸‡écoÜ¿:îz‚¡Û¿ŸÂ‹¤Ú¿¯¦B%—Ù¿x;÷yØ¿„æ£_°M׿fDæd Ö¿åc(ÇÊÔ¿tæÍ±uÓ¿™.‘šÒ¿å'M]¨Ð¿pdÙ³cοBY-ÉîcË¿¤4&âDSÈ¿Š²Öš3Å¿¥Å^Û¿à}9ü½¿0«ø¨ü·¿2‡z»‹°¿ECމ⣿ ¤øö\…Š¿î:“%Њ?~Há^(å£?K­8 °?TâO·?6f&ßOŸ½?.žm…Â?†´-gB4Å?¦¸ øéSÈ?*NmûdË?ªçþõIdÎ?ÃÀ“¢¨Ð?r=#+×Ò?K{øãuÓ?Ô:ïÊÔ?0\›&Ö?\6¼¡ÀM×?p¸z…ûyØ?¨Ÿi—Ù?œG¤y¤Ú?îŒ5g¡Û?¢s 3KÜ?®¯»0”gÝ?&§d¡»/Þ? *K.FåÞ?ʾ¤ćß??´ h à?ì"» Ià?â˜f›¢|à?G#no¦à?Xø¿©:Åà?0XD÷ Úà?PÌ}F}äà?¾f®¡)É¿¨g×-ëêË¿(ÃþüšÎ¿0Ÿ¾cœÐ¿4e8éqàÑ¿~(ZÆÓ¿´5~RGÔ¿68½W]hÕ¿ü¼JP4|Ö¿b°¹I-‚׿¶›*³¦yØ¿vôÌìbÙ¿6ÍÜ¥Á:Ú¿°å&5NÛ¿lžXë1»Û¿,d_ûaÜ¿ôHW´C÷Ü¿ž$䨮zÝ¿Ž¡ÀëëÝ¿»O“´JÞ¿'oÝΖ޿ÖÃÅ® ÐÞ¿5¢ºGöÞ¿æBjk ß¿D€ñj ß¿¼£NFöÞ¿tZO ÐÞ¿uqˆË–Þ¿¨ ÕF°JÞ¿@Ó8yæëÝ¿¦m”¨zÝ¿4/Em<÷Ü¿RöóaÜ¿x`¥(»Û¿fxaÅCÛ¿ÒÀE¶:Ú¿¸Õž<ûaÙ¿²Ä„Ô˜yØ¿ºýˆ1‚׿N0ò#|Ö¿‰ó¥KhÕ¿Ú—ti?GÔ¿”}º}±Ó¿ÆÎÚ[àÑ¿“3«¹ÿ›Ð¿@—HʚοT6ïã´êË¿Æþ¥œg)É¿,ÁZf•XÆ¿¦¨‡Çúyÿë‰Ç\À¿‚X°®5»¿F¥Wm:µ¿ÌUÈR%f®¿îøÊºND¢¿(v«»Ê\ˆ¿#2„°fˆ? ˆƒ‹ÈF¢?„ŠôƒŸh®?†ÞZÚ;µ?hR@ˆK6»?¢y¦[ùÀ?𦙯”zÃ?†·±+YÆ?VæAâö)É?Ðÿ¤1;ëË?D°náD›Î?ØžfÑ5œÐ?'(7‡‰àÑ?V@–ÍÕÓ?°;˾YGÔ?l»½[hÕ?*úøØ)|Ö?Ê(9‚×?Àöe‹yØ?Æå9åaÙ?@¹T-˜:Ú?.RÑÎÛ?öÇ»‡ýºÛ?¼èV ÃaÜ?&Gðœ÷Ü?~"lNrzÝ?Ry\5¯ëÝ?0+ˆ–yJÞ?X­¹—–Þ?°^‰ØÏÞ?cº°šöÞ?YìLE ß?b]ßóÈÆ¿ÄŽ·*GÉ¿¼`¨Œ-¶Ë¿úcÔ9οö h¼/邏‰æoKÑ¿h‰By\Ò¿ÀŒ+¸/bÓ¿|z`ßñ[Ô¿ý¯%IÕ¿h£¶ß8)Ö¿z4;=¡ûÖ¿æxžݿ׿$"0suØ¿B%ÂóÙ¿²—Ý ø²Ù¿¤(ç":Ú¿Þ&ú ±Ú¿J¦à¨Û¿„üÈ^{mÛ¿œ@6†c²Û¿65i×6æÛ¿Þ}[ÕÜ¿Çbs¸)Ü¿µ|=)Ü¿˜¡aêÓÜ¿G !o4æÛ¿Î_[%`²Û¿ÖsFwmÛ¿®¼Æ‡£Û¿¤¸w ±Ú¿&··ˆ:Ú¿ÌУï²Ù¿üoLKêÙ¿ä,ü£huØ¿ˆÉ\ѿ׿R¡!p”ûÖ¿‚9å*)Ö¿ 5Ç}IÕ¿Âljá[Ô¿¾ã%ôbÓ¿h«ç!f\Ò¿ dZ[KÑ¿“ÿ¥/п &¯êοŽ:"ûµË¿H»yäôFÉ¿tµ}WÈÆ¿8^-ó¬;Ä¿ž?a•‡¢Á¿n¼¹Pý½¿Íé+x¢¸¿Âÿº8³¿ÞÃÞD†«¿)N´ùŠ ¿ª_ㆿNÁG:†?줪nŒ ?~Éð|˜ˆ«?,êõPã9³?–ˆ×£¸?nHš¢$þ½? ±Þç£Á?ìÍóq5<Ä?ìž mÙÈÆ?^i®nGÉ?:ýå•i¶Ë?`kø¥KÎ?ÚÔÇmÏ/Ð?þν­|KÑ?¢YÜÙ~\Ò?F ?Ò-bÓ?ôöyoè[Ô?:˜.âIÕ?Ú|N!)Ö?DÑë‚ûÖ?rÕFÓ¸¿×?NOÛIuØ?p–ùÆÙ?B" DzÙ?Øš“ï9Ú?õ vì°Ú?ŒetÛ?xøF2HmÛ?úá=ï2²Û?Øòk æÛ?§C[­Ü?¯ùIÜ?Þ"!>AÄ¿ÌÊË÷xÆ¿Nútբȿ̷Š½Ê¿PÇÒ¯ÇÌ¿l}(EÀοj´ÙãÊRп¢ {u;Ñ¿¼GëhÒ¿tÝ˾_ìÒ¿òàÄm”³Ó¿âÞ›¢nÔ¿àŒ+ëÕ¿vÕOÅ…¾Õ¿:ÓÅ™‹RÖ¿à™ ÍØÖ¿Ì)~‡÷P׿XC„·Àº×¿0}pçØ¿\Oq{3bØ¿(kÉuŸØ¿z®?“ˆÍØ¿ÊÓumOìØ¿o×\·ûØ¿äpà¶ûØ¿Ä:û÷MìØ¿2%à#†ÍØ¿Nú^rŸØ¿rœ/bØ¿òóâØ¿ž,Mºº×¿Â²žðP׿òH£ÄØÖ¿4A‚RÖ¿Fxï#{¾Õ¿HUŸ- Õ¿ kߺ•nÔ¿p8a†³Ó¿Ø€¹}PìÒ¿üIrénÒ¿V°X²c;Ñ¿€~&Æ·Rп>½5Fõ¿Î¿ÕôƒÇÌ¿Vް¯R½Ê¿ˆRý~£¢È¿<­0šÂxÆ¿ÊT?’AÄ¿Žeh‹ÊüÁ¿Æ@‰°îZ¿¿´ïVñ¨º¿ºSoN‚浿~Y}‘±¿l£œö*x¨¿”ó·h7h¿`Ø.·é›ƒ¿öw+´¤ƒ?fƒ“šl?ô¦T{Yz¨?Þ½÷¥±?ªÂŠ“çµ?HÙ¾$ý©º?dãöò[¿?ÚÒŠGýÁ?jõ3|AÄ? 5å0yÆ?Þ<Áâ£È?TªI‰«½Ê?l‹ÎÏÇÌ?°øøô2ÀÎ?²/ÏRÐ?²@§Vs;Ñ?äå]ÔvÒ?fÆqØPìÒ?Îq!}³Ó?„çº ˆnÔ?$&’D÷Õ?ê)Ý«a¾Õ?ª>AÉcRÖ?ÎÍi¢ØÖ?èœÍÔÊP×?VÃÿ“º×?X [½¹Ø?|"ÀØbØ?°ð>KŸØ? Q(aÍØ?5~1É+ìØ?ÖhÝ.˜ûØ?²‰ áø“Á¿4ÀÇѪ€Ã¿ÜýHžUaÅ¿n‚ûèÐ4Ç¿‰™?N^pâB>¥?¼¨¼ ˪­?fêú‚³?*¡Óä#·?ÁÚÿ6»?$}ÅP9¿?"ò¥.”Á?Ô´cpÛ€Ã? (-4€aÅ?úhô4Ç?Z?½ÆúÈ?Œâ)ѯÊ?â»sUÌ?(½%/àèÍ?誎8jÏ? øC lÐ? eÙ`ôÑ?€´E»Ñ?*KW§¦RÒ?ˆ¿ïã»ÞÒ?ÖV¬o._Ó?.ÛN)¯ÓÓ?–UŸAö;Ô?ür/y×Ô?5%6ÞæÔ?àú˜³)Õ?Úâ"A^Õ?Úq¾t?†Õ?G ø Õ?ÀÛTZ®Õ?°Dz1‚½¿Peä^À¿ö2øHòÁ¿¶n¹zzÿt6~«ÙöÄ¿f/ñJfÆ¿@)͉ëÇÇ¿þàK¾áÉ¿xa5&\^Ê¿0S-š“‘Ë¿xENʳ̿ÈÏ•MÄÍ¿|ßTuÂοÞYS¤­Ï¿DN÷¥BпêÇH±p¤Ð¿$S‰Ìøûп8ažoIÑ¿Dÿl‹Ñ¿pdšÃÑ¿`[ìêŸïÑ¿zÀw/Ò¿ƒ†„š'Ò¿TÀBÓ2Ò¿„CÄÒ2Ò¿*j™'Ò¿·þ,Ò¿gZrœïÑ¿ö8!üÂÑ¿0Moƒg‹Ñ¿Ö–îIÑ¿æ!JCñûпÜWMh¤Ð¿žõ8]›BпHp?ᎭϿup]Âοð€î²3ÄÍ¿Ð@!®³Ì¿à)9u‘Ë¿ è;;^Ê¿:6_]¾ɿΛ©¢ÅÇÇ¿(Å„r"fÆ¿þ®Qƒ®öÄ¿¶õYÕLzÿ$#‚–çñÁ¿Gy0q^À¿Ìn—Ľ¿tm5s4º¿ôœŠ@øÖ¶¿nVmgk³¿„©ž·ç¯¿W*†ó䨿°üFªÓÒ¡¿j¾?ûlk•¿t>ZRë|¿LcqŸ|?æÕeWJo•?ÁT(¾Ô¡?÷’m׿¨? Í0’é¯?p›¥xNl³?æggC××¶?ôûà/H5º?ÔZÆÙŒ‚½?D-£]Î^À?®^ym<òÁ?åýG˜zÃ?¦hÛ¢ïöÄ?:}XfÆ?HdðÇÇ?`­ïÝÜÉ?@`ÄM^Ê?ì Ú{‘Ë?dÏ펩³Ì?²m$ÄÍ?˜hLJDÂÎ?$èÈØl­Ï?„ý’y†BÐ?¼[ûO¤Ð?6b“ÖûÐ?ž­mhäHÑ?6{3äI‹Ñ?rî$ÞÂÑ?øµ´Ì~ïÑ?±_RÒ?W Íá}'Ò?ºî>޹2Ò?l…Jö‘·¿˜ÄIWœ&º¿’Æa«¼¿´6¢«ö¿¿""ê_;À¿:²}ËLäÁ¿":úNÂþ¿ª¼±è Ä¿n\çƒâÅ¿TÉFÆ¿ô8õxíÆ¿‹'jÁÆÇ¿ r­Â‘È¿ÔÊ¢MÉ¿Tª[øÜùÉ¿pÜË–Ê¿0ŸJ‰ì!Ë¿X³– Ë¿ËdqÌ¿4r´"à_Ì¿œÍà¬(§Ì¿dD‚¦ÅÜÌ¿PÙ™“•Í¿L^¤‚Í¿¼ò¦Í¿®6!˜’Ϳ̞·¬ÀÜÌ¿´$²!§Ì¿±n%×_Ì¿<ºTm Ì¿d=DüøœË¿ÌQiiÝ!Ë¿°ƒ”–Ê¿\·¤ÉùÉ¿C(ˆMÉ¿ô›ü«‘È¿P!LЧÆÇ¿oóVùìÆ¿0²Y(Æ¿¬Qg»ÁÅ¿ÒQxº^ Ä¿üÆ÷­œþ¿8ìCª$äÁ¿v.è°¢¾À¿Dl;œ¿¿lñG}¿ª¼¿H 7&º¿€žF?‹‘·¿ˆŠª°Xî´¿D´¥:>²¿ðC¤*½¯¿xÀ2dÝ{©¿¸¹TK⣿( 70àxœ¿Ì²¥‘¿ ÿõAKÏv¿h&³ŽàÝv?¤ïMƒF‘?XÏ%3x|œ?X$¾iä£?$ ܘ}©?¤kV l¯?Î"0 ?²?Ü衃ï´?ܬ_†E’·?H ´áã&º?øm]«¼?ÜÕ„›(¿?h£Æ¬ß¾À?ÖÅüÁWäÁ?^SœpÅþÂ?ò¾Mé| Ä?ƃ3LÕÅ?àq}v1Æ?¾[øìÆ?¼ÆÇ? "£—‘È?ðƒWÇlMÉ?4 §>§ùÉ?”Éw@Þ•Ê?üùQ°!Ë?ìôüZÈœË?´©›ÙÌ?¾*£_Ì?xUÔí¦Ì?XVàúÜÌ?H§žûaÍ?®4JÖSÍ?LlÁX±¿ †v\->³¿çÄhµ¿02ͧ®å¶¿ Ý·1Ȥ¸¿¸Óx¼Tº¿Ü¬z…fô»¿Pò­ß‚½¿H÷ZVÿ¾¿`( ^ 4À¿˜Vëg°ÞÀ¿èÜÞ~Á¿(­çÁ<¿LÆZyžÂ¿È= ‹6ÿ”xÀ‡-ÿ¤Š­z÷ÿ8V§C¦QÄ¿ðcr±ŸÄ¿8b2±áÄ¿äì°yÅ¿@¤Oí<Å¿æç¿ËFWſؔûƒwdÅ¿X¡£„vdÅ¿0`bÍCWÅ¿êÒ›Pè<Å¿`˜¾¯rÅ¿”¢¬ýàÄ¿àKff¦ŸÄ¿Àò],™QÄ¿@ëŽS÷ÿ´¢‰Kÿ<›f4#ÿ$€džÂ¿8/ %¿”)dBÄ~Á¿(UE\”ÞÀ¿b=A4À¿ü^Ê#Øþ¾¿PìÀ²™‚½¿d”êô»¿È² mTº¿œ¦Ûàs¤¸¿ðÞ`Uå¶¿dKÌ µ¿ðÚþÉ=³¿˜5]IW±¿”à¨ÖšÍ®¿Qï‚ÜØª¿ ›‘®Ó¦¿  COLÀ¢¿ä.[óB¿ˆÒ}Ï󔿬ñ ÿÈ,‰¿L Pd Çp¿ÑÃÔp?¦`/›3‰?$®4Á`ö”?ˆÓÌEEF?|Ðà¦ëÁ¢?ˆŽžoAÕ¦?ØEè`Úª?l½yã Ï®?L%òJX±?DÖç+k>³?Ä´ðœµ?\ÊÙ Ùå¶?T½Í椸?Têå6ÎTº?x '›jô»?„êiÕ‚½?Ù7ÿ¾?þ³) 4À?x€m–ÞÀ?E½~Á?¬–£¨Â?È“RNžÂ?ü÷Ã?D¡¶ºúÃ?HQòJÛöÃ?`ö»¶oQÄ?èè-’zŸÄ?8¿§ƒÐàÄ?Dµ.EÅ?üq[»<Å?ÖP"*WÅ?ØôÖÑLdÅ?¼ QHª¥¿ˆ~×èß ¨¿À&dSøYª¿Žxš¬¿ÀC.í°È®¿`È—Er°¿4Ö-Âu±¿X¶ Ãn²¿ÌF» \³¿P[ÝåÎ=´¿8âõ¿ ± YóÚµ¿¨WŸq•¶¿ ¯Ý5B·¿è*|rà·¿  F³ p¸¿¨ne‡•ð¸¿x‹wËa¹¿è£ëÉ;ù¿0‡£Q⺿À"áâ]Vº¿#¯«‡º¿¸q#‘¨º¿¢­„ ¹º¿˜G°„ ¹º¿ÐÀ‹¨º¿°úa¬¡‡º¿p.ôÚOVº¿€ 4@к¿ø%Ò©%ù¿XkB±a¹¿@€35w𸿘ðk;þo¸¿¨ëÕKà·¿(eü B·¿ m^xB•¶¿ˆ{¹ß¿Úµ¿ˆ¾u/‹µ¿ ’  ’=´¿0ØùPß[³¿Œ)VÑ}n²¿ mäLxu±¿&„÷q°¿ä‰ È®¿p:-È™¬¿Øþ)?Yª¿¨~_ ¨¿$h®Ñ{©¥¿´”C.=£¿(X\OÄ ¿ˆ "µžƒœ¿(·hƒ•k—¿Tv’F’¿hÐf†œ)Š¿¨Ú5Þq¿,‚Ÿ¹?îd¿ðþDëe? Q®¹µ~?xþ«ö/Š?híÌT±I’?PüÄ„¡n—?È#ù¤’†œ?œMHºÅ ?¼é£ð‡>£?8ö> Áª¥?ˆ#Ê?K ¨?È»q]SZª?ø²’LÀš¬?8âRäÈ®?À¼¯ôSr°?ôçÄu±?TQO!¹n²?hpç  \³?4 ‹-¬=´?“>”µ?À »¹Úµ?PK#è-•¶?®@éA·?0¿ó]à·?hÚ¡Æo¸?(4,7ð¸?xF‘ja¹?0³¹Ú¹?ØTö™º? |ñÆÿUº?Ø„°Q‡º?È›³v<¨º?Àjs¾¸º?Päå[{'¿à‚Ë—gð‘¿àÔøm¦“¿ÀO“¡÷W•¿@˜â†îô–¿ð‹ëÁ芘¿pXêÖ š¿FæèW›¿ 'öÿˆàœ¿Pì//÷3ž¿p\ô9 oŸ¿€—þëN ¿¨$Ø ¿Pßt[ñY¡¿PTñ×ÿΡ¿€v¨h ;¢¿ ›­š¢¿ ‡„ 3P´ÈF7£¿0Û ¬t£¿` "‚¥£¿Þ$=-Ê£¿–Ûû€â£¿Ð¿ãÀã°ã$¿ß°´÷t⣿0³ˆ1Ê£¿Ð½5lÿ¤£¿hcà‡t£¿ ™…7£¿0­Ó¡þ UšÕ™¢¿ `FÆ:¢¿€eP®²Î¡¿P*¶Ð›Y¡¿È·T¨× ¿xWj©M ¿(F ,nŸ¿ûô¥3ž¿ó–ü‡ßœ¿0ðÐCE€›¿ýp¥± š¿@C„²‰˜¿°§¡_¦ó–¿PJ†V•¿ÀÇ"󥓿àç8¿éî‘¿à{¥ãë%¿á:ùµŒ¿°¡wÚþˆ¿&ëØQG…¿P‘9¾”r¿õÔdH{¿`D«útGt? X×y[»m?`‡Öòº?a?°ÎÌ\€DI?àà6oQèH¿À‹¤Ñ(a¿ i·¤m¿pò$WzìÑ᤿ð¤{),䦿èÓ&ö^]©¿Ø…ó¯jE«¿ €hš­¿È¿nqc¯¿ä’|a<ǰ¿ÌLt š±¿€ªréç—²¿ôì.úV³¿tÎ"Ü»:´¿ÌsŸ9ä´¿0ic|®«µ¿y-[ô=¶¿ôÔ”/1ç¶¿€ùô¥Ö`·¿Ð‚ a9ê·¿(hÁMJ¸¿°„—H²¸¿R+h÷¸¿LÆ<5p=¹¿lT‰4-g¹¿4èñ$[й¿,|¦N˜¹¿\FNa²?jKl|A•³?ô8V¨¡@¶?ŽÌ£e·?€¼iLé¹?üûº?ôXLR½?z]G©N¾?²¸FJ9À?Nö°À«À?8}4PŠ¡Á?: —µÂ?ú¸ÃšRÞÂ?(Êò5Ã?ÞÔÖ(–ìÃ?ôÙ²v5Ä?Zyœ­ºÉÄ?š$º&Å?Nõ}÷žsÅ?<,ÒŽ Å?b®=0 èÅ?¾;?8£Æ?X§Œå'Æ?ôšt¶û/Æ?pg$Ðü/Æ?f¬Ì 'Æ?èêŠR¨Æ?<§!§èÅ?ÄÏ«Å?Èq—ã©sÅ?p©½Ý3Å?¦#â¡ÉÉÄ?ˆœBI‡5Ä?àcÇ)©ìÃ?Þ²Ô6Ã?²¿p¬iÞÂ?Ž÷è,Â?8Òät¥¡Á?*apñÝ«À?ªË|i9À?lKš$ìN¾?TŸˆÌ[R½?4Ãâöcûº?Y´Úšé¹?Íë³Ve·?0«0Ì÷@¶?b¬È«›•³?©€½wa²?D¨¸ª0+¯?´°èþM©¬?bLARÞ¦?~}I¤?ôÉ$²œ? ÿLlim—?¨âÇÁ†?¶…KK ÝÍ?pæ³Õ!°Ì?^ñ]¶;Î?ì­¶+ÂíÍ?ØÈ´µÏ?–øA!™áÎ?ŒÔVn/«Ï?2JM‰Ï?’'àY–îÏ?pª•BãÏ?ætÛ›CãÏ?ü¢6ØîÏ?ŒãQ$S‰Ï?´ÌõÖ5«Ï?h3ε¢áÎ?Ž/j¿Ï?ærzÂÏíÍ?¼ºÈ"œ;Î?Џ™p3°Ì?^ÚïïÍ?&*ÐÜ+Ë?Æá©‚•¢Ë?Ú¼ñO‰dÉ?2×ÖÃîÉ?(ʆ„›^Ç?œºõ’°ùÇ?ÆÝ XÅ?è;©+ÊÅ?-@½r«Â?7<êvîdÃ?¤[7Î À?¤€aÙàÏÀ?võÚä=º?6"Á"¼?ü°†‡­´?p"‚Ûb`¶?€ñÖÛ¬M­?¦ˆ3ÁÙf°?@ä®z ø ?—~çÀ‰¤?¤ð¡Lâ?”: U&?Ì”¿0ƒÉ¶&@”?ÃñX®?=æÈó‹?¹?ëH´†¡Á?V’Ýôg˜Æ?Ž(ÏóYË? ¬Àª,Ð?¾—éñ®ŽÒ?¬t­WAåÔ?DTèÊð.×?ò™TjÙ?n=Ù –Û?éû"X¾°Ý?o§ÐY"¹ß?‡(÷úÖà?œsTÇá?)¸‹‘¬â?]xÒŸ…ã?,z!Sä?CDSå?•ܬÈå?“5’wŸnæ?[ìÛ¬Tç?Ó8Ö‘ç?„$O^Î è?pcj÷ðzè?­½¡˜úØè?·>.@±'é?‡ZÚ^äfé?d/Éõl–é?YS®-¶é?k…ìëÆé?”8 ØÆé?ÿü h-¶é?é~]l–é?˜Š9>ãfé?’èBL¯'é?™Hp÷Øè?t}($ìzè?.zˆUÇ è?Ê{=CÌ‘ç?7UGç?»}"înæ?9WÞ8þÇå?=Ïùzƒå?D²$œRä?+ãÜ!…ã?ÛûB«â?Yï«(”Æá?2ú‹œ”Öà?Æ}~e¸ß?ü>q²°Ý?+ÿ@km•Û?†Ûä’ÇiÙ?õKjv.×?&ˆ_vÙäÔ?)ƒ''[ŽÒ?ú¿²ml,Ð?˜$þ Ë?áÎvH˜Æ?9ªîü“¡Á?â9Ó?¹?î„aö¼W®?G©†ð”?“5!ÒŸæ¿„™¸7æ¿°ñƒ‡å¿¸$ë«çä¿3ý/ð:ä¿g÷³tºã¿DŠUò|¼â¿4öRM±ëá¿dŽ{JØá¿@7’y)à¿Ø]ÿErÞ¿Á;Ò~Ü¿€ ïËyÚ¿õqHpdØ¿@&÷ @Ö¿äS!àê Ô¿ç„mÏÑ¿ä­ùdè Ï¿Q‰bøÏeʿ癲¹o¯Å¿.Œó¨¯ëÀ¿¶sm ;¸¿M}—ü]­¿]øÝ‹m“¿KÖÕ<¢o“?êùÉîi ­?KLÐX†;¸?´ÊóóëÀ?ŸzGt³¯Å?„öõfÊ?ˆ! - Ï?¡Ø¨!ÏÑ?¿ðŽÒ Ô?`ECJ-@Ö?—|Ü“dØ?]?tSïyÚ?éØyÀö~Ü?ô‘ÍFkrÞ?Zê!pŒ)à?Èiœëá?ÄE¯èÄëá?pzë¼â?](ýÐÎã?S~ô;ä?ö†Áçä?—ºLÁ˜‡å?‰ðXN)æ?Ù†E_Ÿæ?ÊQi÷ç?@qP´Ò~ç?¶àúÙç?@(  $è?@=ÿ…Haè? ÂçŽè?¿”o¬a­è?Ôïp£¼è?¾r]£¼è?Åæm'b­è?ræièŽè?YŒJ Iaè?»~[ $è?$mnÙç?eENÜÐ~ç?ëQa8ç?·˜rŸæ?Uc™æ?*,ÍÝŠ‡å?¹3®çä?CÙÖ¼{:ä?©ü¾8Wã? rHg ¼â?.4ÐçZëá?ŒßC߇á?Q;Qà?°îlÒÕéÞ? 9{Ù#Ý?eWöe|@Û?‚60RÙ?WaCòS×?Î9z<{GÕ?~áÌ‚ä-Ó?©ÍkyÑ?ÎF”±Í?Æ”­Ÿê>É?º¦vK"½Ä?PÍ]=~.À?²:/Í~+·?d¸ílÄÖ«?¨Ü˜R0‹’? !ýHm俯K«H$ä¿ú¿¸žã¿×C¿ ã¿Âb¤£o⿞ö,ÍÚÆá¿m¢5Qá¿}~( ÔTà¿MΊ¨ôß¿-´ÿwuÝ¿ú•w¿Û¿zÎÞ÷Ù¿S%‹1² Ø¿fü16¤:Ö¿Õ0/ŸàFÔ¿º£›FÒ¿nðl1;пÛAÏRKÌ¿ØÉf2{È¿b ßÃÿtdʽ×¾¿É|Æqܶ¿uÊûN#Šª¿TCaE^´‘¿Î‡Hv¶‘?‘ߪ/‹ª?ÔÖ&úb¶?R(Î×¾?:ÓÉÂ[ÃÃ?Å͇¿È?ÏÀ 2MKÌ?½úñ3;Ð?O`uÁ¾FÒ?ðž&GÔ?Þ*4È:Ö?àz;³Ö Ø?ÔÿnáøÙ?‹zÂ)-¿Û?à‡Æ×9uÝ?˜ó¼Äß?A·ÿçTà?7)Ú²/á?@7$ˆæ?œoÀ-¯»å?¾Ñjlniå?[]áuø å?Æ(fˆä?¯/Ö_$ä?ŽˆÊžã? l»m ã?’‹~Poâ?=bp—Æá?ÌÅ9&Üá?Öx@>˜Tà?ßó´ƒß?Ò1N§tÝ?’èt{ ¾Û?ãÝÝ|÷Ù?ú*DU Ø?¿'NL:Ö?[¹FÔ?u¸Í¡MFÒ?C“¹Ç:Ð?©­‘á|JÌ?’åô È?…ÜÇ„ÂÃ?¡%'îãÕ¾?D8Â`¶?8‘bI6‡ª?*ö›5 ¯‘?°@?÷$ã¿ì Â.ã¿P…cÊnžâ¿S³`;3â¿À«UÑ~á¿åü7¥Þ࿾0 ¬4࿊ÂÇÿþÞ¿°Ž¶w¾‚Ý¿‰®ÊêIôÛ¿àôTÝ—TÚ¿Üôš­¨¤Ø¿‡ç´½†åÖ¿˜©CÏEÕ¿Šé^Y>Ó¿„f$ÙàWÑ¿èá¨:ÎοSÕÕsÙʿޚMÙ<ÔÆ¿~‚é2òÀ¿lÎ&-D½¿Z†+iô´¿X×{Äp/©¿:)ô> Í¿å­Ë™$Ï?¸ñÜÎ|0©?Äg|sïô´?,:;´D½?Eí6ÁÂ?¿5$ÔÆ?Ð$&ô·ÙÊ?Tm»_ÎÎ?NÍúXÑ?4Ûè%>Ó?(QÙiÕ?J0Q«åÖ?£ÙͤØ?m °½TÚ?¼x„tpôÛ?~ƒùÈå‚Ý?fsÕñ'ÿÞ?‡!ˆ6&4à?âðfAºÞà?Ø[çæ~á?<òÜ`Iâ?;óé…žâ?¨•×.Fã?YÚ=ã?Vá.f#÷ã?¡‡À¡¹Qä? Õ0îÇŸä?2¸$(áä?lB¾”å?|±+% =å?J 64eWå?GÆÀê—då?xT™då?ÇÚKÃhWå?ïUëí=å?]Ó;Ê›å?D’'áä?” +}ÒŸä?G#X­ÄQä?ñ.÷ã?`VQfFã? ‡ŽâLã?KWMˆžâ?ò½Fâ?âù‘~á?•‰ñsÞà?íã3à?N¶Ñ'¦þÞ?­8ÏYg‚Ý?ÒIø¬ôóÛ?{ösDTÚ?0V¤Ø?h%_5åÖ?ÀmýnõÕ?8TH˲=Ó?ç&Ø‘WÑ?¼hy|ÍÎ?¶¡cTÔØÊ?¤½œD›ÓÆ?Àä©KÀÂ?èSÓB½?øìÍ ó´?¸ƒtÊ,©?›ÚPÉ?Ùk:8Ÿ{â¿,,Ùö⿱“A—á¿n&ç§á¿2Ç ~…‡à¿èÊÄbàß¿ÜÅyÍžÞ¿lT°ßÞHÝ¿™Y1gœáÛ¿Z`ýó'iÚ¿·ê°iàØ¿ˆNuÔSH׿2ª\ â¡Õ¿ýkÝîÓ¿¬-Ì .Ò¿ªÔBðºbпË݈‘«Í¿vµ…%î]É¿q¸G§‹‘Å¿€‚›ÇÛ·Á¿ÌféÖ|¦»¿Š8 j4̳¿…p£"l˧¿éºé¿¿$åÚ4Ã?¸7~w̧?D²NwºÌ³?—¥çs§»?Úªbv¸Á?‡®*ÏÏ‘Å?fÜß2^É?ÖbMøðÍ?Ü9ÞbÐ?æ-&•(.Ò?ðŒ{å<îÓ?¿ ¢¢Õ?‰”V yH×?FSV”àØ?%%—NiÚ?rT>ÜÃáÛ?%°Ü9IÝ?Ï=1!;žÞ?®J'àß?O ÉB›‡à?· }K¾á?z†D¤X—á?¤øÂâ?¤øTη{â?dxËïÜâ?„~'Ç…2ã?¸p°úD|ã?ˆ\Vìÿ¹ã?ú>+‹ëã?&;@FØä?]ÿÀ)ä?¬¯/·86ä?NÈX:6ä?ÄtúÄ)ä?‚¨Ê=àä?,Çi›ëã?J…¶[ ºã?·ç T|ã?¤²–2ã?¬­2Ýâ?ʧ…È{â?põ \(â?h|c—á? žÃá?J*ÚÿY‡à?±§ª¦'àß?^KêÈØÞ?…}¤¥HÝ?¨ïÓaáÛ?žªíVëhÚ?°¶ê¢*àØ?Ò9#H×?Š»^q¡Õ?ZÏ)0ÑíÓ?O.º-Ò?:¥-lbÐ?¬Ýš¸Í?}÷t?]É?ä¦êÒÅ?Œœ¹Ú·Á?o-Óc줻?å~¦Ê³?Ô¦U·’ȧ?$RBH¶?VeFg¶`á¿çÔW¢—úà¿@X4Šà¿îd5à¿íTÍß¿ –-wøÝ¿!·À¹kÉÜ¿âLcVŸˆÛ¿?ãÛ×6Ú¿³ò8˜åÔØ¿°}"×¢c×¿Ž¿RóãÕ¿Ò™«ÃVÔ¿Í`QÕ½Ò¿ŒR€¿Ñ¿'YüÖÏο…Û>.]Ë¿ãÚf#¥ÙÇ¿–0mfGÄ¿½½ñ¥¨À¿€oTz>ÿ¹¿ö‡Jc(²¿ï\1Œ._¦¿–‚h÷þØ¿!µé¦&Ý?yIÙ8`¦?œ†Gë­²?ƒ{ •Äÿ¹?\†taé¨À?À‚¶XªGÄ? @ʤéÙÇ?! åps]Ë?ø=³úÐÎ?Æ$@ôâÑ?vzÌ,½Ò?î´Ë5èVÔ?2G©€äÕ?ZHºÈc×?Ž„§B ÕØ?YAŸ`ÿ6Ú? `=ÌLjÛ?íÙx6•ÉÜ?L}{É¡øÝ?ø„¬¢2ß?§=ý"Là?Ïd…Šà?þ¨Ä¾¯úà?ž4ïaÏ`á? ¯Âu7¼á?\®ª¯ â?íÀ<Râ?VÓŒâ?NGËÒªºâ?ç7¡G¸Ýâ?úƒÎR#õâ?〙ƒÝã?nâÕœßã?%•˜)õâ?B¹Ó£ÂÝâ? AŹºâ?9ëï"Œâ?ƒ9dRâ?jƒëQÇ â?S¦¿P¼á?Í_æðè`á?ªQâÇúà?¶Ö8,Šà?,.[à?îÓSÝß?n¬C(gøÝ?îx&ÜYÉÜ? ©ýˆˆÛ?,HJÓ»6Ú?•m@ÃÔØ?sAÅäyc×?.ïŸÃãÕ? "„VÔ?¯K˼Ò?§·:zÑ?= 6g<ÏÎ?ô3 —‚\Ë?,_¥çØÇ?)ÑÇ2—FÄ?§|s߯§À?Tñ¬jý¹?_i¬iR›²?ÂJ¤½[¦?í4ðŒÍ?O­qçK@࿆ÖGö—Áß¿ª¡ö`ïÞ¿M›{íX Þ¿ûs>)Ý¿“¿2c Ü¿GˆYy¦ëÚ¿  G¦¿Ù¿.£Òăؿ^1ÄçÄ8׿ˆ «rßÕ¿\Ó;£xÔ¿4–xi3Ó¿ðð6À†Ñ¿ï"çËøÏ¿Jcë¦tÐÌ¿xê+—É¿¿QkÍMÆ¿lÑ0Ôö¿28+…Q(¿¿AâŸAÃO¸¿8¢“k6h±¿ðáÍ0Ú뤿¦ÒKãé‹¿¥žFÌ¡í‹?ª¾ ãì¤?ÉBþ<»h±?IB¨HP¸?—_޳×(¿?”9%Å÷Â?;©˜NÆ?>oŽ J—É?„BýXºÐÌ?ª,leøÏ?lVΖ,†Ñ?w|èÖWÓ?"ŠÅ(ÈxÔ?tU{˜ßÕ?<Ê…ë8×?º{$SìƒØ?~‡ÂοÙ?6¡¬ÐëÚ?”‰Å7Ü?dš¢CUÝ?OQŠ]† Þ?‘¹~_1ïÞ?ì!²ªÈÁß?"x2e@à?âsadà•à?Š^7!áà?¾®½Eù!á?3“m—@Xá?áÁ·Õƒá?|iʤá?ÄÐm„ºá?”³|Åá?‚ŠiJÅá? +°aŒºá?H k´ª¤á?^‡ ´çƒá?[{WXá?~S¤¼"á?~'«@áà?êRƒá–à?¢›RI‰@à?iË?Âß?Y¬YðrïÞ?×âCW¼ Þ?¬Ai2Ý?üíRš+Ü?~ô[¿ëÚ?ù_ùHµ¿Ù?àLÏ.ɃØ?”ºG¾8×?ÓlCaßÕ?¤‚² Ú¿ƒµ[BÙ¿Á)Hcï׿CÁÉÖ¿þïÈd–Õ¿8¥&mUÔ¿3ˆ+T‡Ó¿Ü,Í@®Ñ¿lôÇJпE+ݱ·Í¿¤+”9êÈÊ¿VuªÉÇ¿˜k2e¥»Ä¿6õg«ã Á¿ïrûB…ö¼¿4ô·@f™¶¿ ÷ûW.°¿\"{™r£¿~ÍóCò‰¿£ÞŸÛ4ö‰?ò¥Ì s£?ª¶¹îÚ.°?L Àê™¶?ŸMjŒ ÷¼?µzÏ&¡Á?Xª#é»Ä?œÈBâÉÇ?ˆš¾/ÉÊ?Èø·Í?“ñ©m6JÐ?“Ža e®Ñ?s€ý>¬Ó?˜Q”7UÔ?&ÉZá7–Õ?(M‰©èÉÖ?Ú}¯‹ï×? ŠÏÞkÙ?.Ï >Ý Ú?WÕØX=Û?Ÿû;¤óëÛ?¹ìÆÜqÁÜ?Ÿ‹q^4…Ý?‚êuÂ6Þ?ø¸,«®ÕÞ?šd(—aß?Ã1WF%Úß?Ì‘‡à?üØ05 Hà?‹R=›„fà?ÌæŠázà?ހ߅à?ü ™ö…à?®?ýJêzà?*æQ&”fà?í:!Hà?’5ù»£à?°K&ýiÚß?­úûTçaß?e«¥êÖÞ?v“ÿ®#7Þ?yÀ€î—…Ý?BÚZYÑÁÜ?úUíOGìÛ?ÈÛURÛ?–êʵÚ?Îéø¼ˆÙ?Ï`â™ï×?…£~{çÉÖ?™Ê߉'–Õ?¯ì¯UÔ?œÓ?ø1ÄÃ)®Ñ?Â5ÁìIÐ?pXKˆF·Í?À\•]ÈÊ?iÑ8íÈÇ?dJa¯ÎºÄ?€åŸÁ?4³-q9ô¼?øºÌ‡Ô–¶?‹Ä ¦“+°?÷ ºôl£?yóéG‘܉?´žt 0åÛ¿oøcÜBAÛ¿AŒ †ŒÚ¿ÁRMÄjÇÙ¿×£,áhòØ¿ CÔPؿϊíÉ׿2ï·OÖ¿H;=z4 Õ¿9“fîÓ¿(ûº¯¿ÅÒ¿ò̑ѿHšSпcÔXOοè Á pË¿ŽEY޺ȿÉÜóÇnöÅ¿>“ös$ÿVsѪFÀ¿_àvů½º¿"RÅʋݴ¿ŽR©á­¿OÅSèŸô¡¿o•Mgô‡¿t@yø‡?4ˆZº¤õ¡?2æCâ­?T€/Þ´?øQõ3¾º?†“riíFÀ?­­ë)·$Ã?Ç]ã²²öÅ?×GÃ"»È?]ìÈtRpË?ØþTI–Î?†8e™&SÐ?¬Êð‘Ñ?D—åÅÒ?']«EîÓ?/—Ѭ[ Õ??a[ñwÖ?¿IƒIó×?Èéí.Ø?žAoá”òØ?¼õÐM˜ÇÙ?¤¦ÚµŒÚ?*XŒþsAÛ?ŠyGJcåÛ?Âú¹­xÜ?Ù#z¶KùÜ?àÊèÇšhÝ?£r¢LÇÅÝ? )á—Þ?ŽŸ¢wÞHÞ?"KƒtxnÞ?ŒéÃNÞ?îáVçUÞ?y:7ûnÞ?&HK³IÞ?ì$rLËÞ?l†wq ÆÝ?óŸîhÝ?ÚÝf¯ùÜ?qzq(‘xÜ?<ý]1âåÛ?°ž’#úAÛ?IØZ;Ú?³¿œ–ÈÙ?`C{©éòØ?¿þØ?wËÂkA×?‹ØwŒ¯Ö?nl?} Õ?†è½®RîÓ?ùÞßÅÒ?aÃ{ÁØ‘Ñ?AuäüüRÐ?O^Î?è«úµoË?ª{§]ºÈ?ØÌ{éÀõÅ?C®”#Ã?±«”EÀ? >,²»º?˜i;”~Ú´?Èôe;Ú­?Ø£ÿ‹Uí¡?Õpõ—Qׇ?ìÉì}aŽÙ¿‘S#3øØ¿=ŒžRØ¿‰ŒÐÕ ž×¿a´^äÚÖ¿õ~¦ Ö¿(£R@Ñ*Õ¿~î>Ô¿„(kŽFÓ¿ ]PzKBÒ¿ø›ÚÀÅ2Ñ¿Ô%”²¤пãÕ›,éÍ¿¯ÖM—‘§Æ?‘'¶õRÄ?úñv6¤ˆÁ?ËCç{8н?ètDÒ³|¸?°Mj0 ³?r· Ô5W«?$äf(Ái ?¼ ŸË…?ÆQˆ94׿î†2»«Ö¿jÀÜdÖ¿mCÌìoqÕ¿r´ˆAÀÔ¿àc*ßFÔ¿l!/õ7Ó¿$K-7ÉaÒ¿¾h G€Ñ¿$VÏÁù“п!ü$æ:Ï¿]$•–:Í¿ Ô7?(Ë¿0'ò¬(É¿éža×£ÒÆ¿^”  ’Ä¿`¶¡ÃD¿ʵڈnØ¿¿7¡ðѱ»¿þãûöA>¶¿Ì, [±¿¦½Æ{Ú¨¿&ç2ïÝÞ¿J¸&Á®ìƒ¿'âªðƒ?ÝYÜà?äÿÂ{Û¨?ìÐ"²š[±?ÆÇšTÃ>¶?q%×-4»?âkòØ¿?YãêEÂ?ÓkóN’Ä?ôç0èÒÆ?dGunÉ?ØõÇ…(Ë?‡€ûÝ:Í?Ù5•/;Ï?úÖµQ”Ð?; Œm€Ñ?–íÌÀðaÒ?Ì÷Æß8Ó?dc4×pÔ? ŒHålÀÔ?{ôGåœqÕ?‰ö—“Ö?š3çë«Ö?”{™$I4×?ž) CW®×?rqø ËØ?ÌphIbvØ?ªŽ‰ùãÃØ?²Ìáh Ù?àVñ0Ù?,ŽØ :PÙ?Dpkkç_Ù?–Í]ð_Ù?‚¥¾;TPÙ?Ö]æô1Ù?ÌÁöî`Ù?F°–ƒ:ÄØ?î¥øŽÑvØ?šp$*VØ?®tá ¯×??Fÿð5×?ÔW7/Ò¬Ö?rÕ‰Ö?\»b-ŠrÕ?wøÐdÁÔ?—ºÓYÔ? ÆaÔ8Ó?o—#kybÒ?<`r“ЀÑ?¢|Á®c”Ð?Œ€Ìm„;Ï?Ú,¸@;Í?…˜”o(Ë??&IV:É?1GýƒÒÆ?7Ù&µ‘Ä?ÀèS}.DÂ?³ç¤&²Ö¿?Ê W'H»?dZŽ‘ ;¶?þg^JôV±?¥½y.Ш?ve¨¹¥Æ?Ð!!Md¸ƒ?ÎmJØÔ¿c-ŽË]Ô¿'ÛW4½ÖÓ¿M„©rCÓ¿ˆ3fÃF¤Ò¿¤m«›ùÑ¿ÞD;¢ÚCÑ¿8µ¾sƒÐ¿˜tÉQ»qÏ¿Ô!Ž¡*ÉÍ¿¦Ë}B;Ì¿6%«^þAÊ¿bDüËeÈ¿Qô]zÆ¿NDB,¾€Ä¿¶DàÁz¿ÜÈ\ì_iÀ¿¼êQ–½›¼¿xõ•jS¸¿~}l¨nû³¿Û|Æç.¯¿†ÞC¶S¦¿LäTÉÕš¿¶5…à æ¿­Ø0š÷é? ~ñiwך?¨Ôó$³T¦?W¨Eƒå/¯?¤‘§Mîû³?dÌ· —S¸?dhg?œ¼?_®çˆ¡iÀ?šN{Â?rýþ‰Ä?Ƶ$ËYzÆ?$¼ÑlÕeÈ?Î(KWEBÊ?ÌÍÔºƒÌ?¾ŽüÄtÉÍ?bÁOrÏ?:ýÅšƒÐ?Ž#øÌDÑ?¶ÝÅùÑ?x_â›q¤Ò? 4ŸCÓ?T%`ëÖÓ?&Cø°û]Ô?tã-Å|ØÔ?Ä7J#FÕ?J0ì%«¦Õ?Ó¤,lÙùÕ?2«8¹z?Ö?6'8dwÖ?4š‘s¡Ö?ò诽Ö?¬/Ek¥ËÖ?Ñ*Ýk®ËÖ? ]Ÿ_ª½Ö?$%n¢¡Ö?àùލwÖ? \X‹×?Ö?lêöRúÕ?¯Ã G§Õ?ŠË³DèFÕ?8'b rÙÔ?$‡KÐ#_Ô?ØNÿ;ØÓ?ŠôÁfîDÓ?{EeÙ¥Ò? cøùúÑ?p+èDÑ?Ï\éB„Ð?Ü8¿|ÿrÏ?Ømë*ÊÍ?hÔ÷IÌ?IÏP–BÊ?Lc“–øeÈ?lÂÈáMzÆ?½Â€Ä?Z±8ŒzÂ?™¬”«æhÀ?ݪ{ó(š¼?¤N¨q¹P¸?¤Ò¹;ø³?à_b—­%¯?Ö5«9dG¦?¾Ê¦>¶š?¡JLJž?LÏÀ}Ò¿^rY]Ò¿I{ ¢“˜Ñ¿&¹4Ôïѿ狀ˆп´VžlÅâÏ¿î&r¢[ Î¿2[cwKÍ¿eIg°ãË¿^!TkÊ¿ µZ´BâÈ¿ª½Ÿ• JÇ¿d$cu{£Å¿µîïÿµ3F×Z/¿ΠƒšícÀ¿|›]ɽ¿´X1ˆÂ_¹¿F.Ù®“µ¿abm¹±¿~/«a¨«¿ñPñmÍ£¿Ô?*ŽÌÌ—¿õêw¯¿¿ê7`lÇ?4óz ¼Î—?€Í‘7xΣ?&â—[©«?,‘)&˜¹±?às‚]”“µ?ZaB`¹?.£VJ½?Z¹/dÀ?$Ÿ‹,/Â?ªi«NÔïÃ?œÀ£Å?.ïsSJÇ?…1¢ ŠâÈ?°Æñ hkÊ?š¯/ûãË?>w¸C[KÍ?|žm«ª Î?*·“ñãÏ?c8/¤ìˆÐ?ú.‚Ñ?¶˜ýÁ˜Ñ?>H³«ŒÒ?nÁA–4}Ò?´/nÑuÞÒ?…ªq4Ó?°Ä»Û}Ó?üumFž»Ó?åΙ6íÓ?òÕ½„Ô?:pÈes+Ô?sS;ìò7Ô?[iQíû7Ô?{µùÑŽ+Ô?nAlݳÔ?V¡={íÓ?°¦N#ý»Ó?úò3çY~Ó?Ï'´>º4Ó?œ1eOßÒ?+.ð¢R~Ò?¼ îàÒ?(‡j8’šÑ?Þ ÿz Ñ?ZÇ™ìŠÐ?¦jDÄæÏ?"W訢Î?kÉLÍ?Ž=MåË?”ÉAlÊ?hnQè1ãÈ?ÂŲ¿ÎJÇ?=2(¤Å?m6X õïÃ?ßÓ·‹/Â?Þ·¹ ãcÀ?ì"}*½?/ã ¸|^¹?õuÛbûµ?®Üh:äµ±?áÙJ¡Øž«?Gÿ!@}¿£?jI¬½¤—?(>Ù|ó~?øœ}.M$пø+ëâŠÏ¿4(}·¹Î¿æØ«™ÕÍ¿ePŸVßÌ¿ŽÖ%SÁÖË¿‹´­ C½Ê¿·ùdG“É¿ëÇ&5…YÈ¿ä#î¾Ç¿.¢†¿¹Å¿‚môXUÄ¿©i•h俌­÷jÑgÁ¿VnKXüÀ¿¿Äû¤]Àž¼¿M⨥Ýj¹¿F²ÏÒM'¶¿T(ƒ2Ö²¿²Nšþxò®¿wH¨;³%¨¿½QتJ¡¿æ1hÇ”¿.“«Tµ·{¿ÔÄNuQ¿{? §×OÉ”?y'°GýJ¡?|Ò÷ò¨&¨??K91pó®?Ö»Ö²?mÉ}Ë'¶?M+¨\k¹?JÜî@Ÿ¼?Ou²~Á¿?ÕZA›hÁ? ,šé«äÂ?4`‡UÄ?áºGºÅ?χ}‹Ç?ÎÏÔ”ÎYÈ?3–f’“É?ÐX׆½Ê?ܪý6×Ë?32LåfßÌ?µñ9˜îÕÍ?Ô#SSºÎ?Opmu?‹Ï?áþ‡}$Ð?8³gyÐ?\B&(ÄÐ?JšJž’Ñ?P9ùß~:Ñ?Ù7ÆÄËeÑ?òȺ^†Ñ?¤Ã•×#œÑ?5“è §Ñ?b8§Ñ?±þ¾>œÑ?ä÷ÙÉ‹†Ñ?X*š fÑ?Âìæ/Ú:Ñ?^Ü` Ñ?ð7,³ËÄÐ?)~žhDzÐ?Î-†©±%Ð?ã=ffºŽÏ?˜±ï .¿Î?lJ¤¯{ÜÍ?§ðшåÌ?D¢¯çÚË?Æå\¿Ê?&7=aê”É?©£:ÒêZÈ?„cÝkøÇ?0pg=ѺÅ?ѤÚDVÄ?©Ò_*åÂ?Ö™ígfhÁ?ÛPÖÃÁ¿?»n4žŸ¼?TÑ„B±j¹?v° „&¶?Ð7Ì߂Բ?p¬K=6í®?IŠ Ÿ<¨?æJ[I<¡?ž>œ ?—”?ò§®Ì™|z?ÄþDy Ë¿^»ûHþÊ¿‡ûj¨KÊ¿)GÆè‡É¿Øn1ó´È¿µ…Ç~ÀÒÇ¿ðÔ˱ÜáÆ¿BYç,ÜâÅ¿GÐß2\ÖÄ¿ØÎ˜Y½Ã¿Nªò#|—¿Ý*Æ–~fÁ¿Gÿ>ÉÅ*À¿¢³á(ʽ¿À‚šÒf,»¿!Qqâ}¸¿e?æCÀµ¿29‘9õ²¿¾~°¿¡˜£ª¥{ª¿®biNø©¤¿ÇÜ»5—¿"jÓ>ÿÇ‘¿JOa`¸·w¿jøµl0¿w?$€öÝÉ‘?I¥Wø˜?øë^p骤?£Ò;˜|ª? †síø°??RøØ´õ²?Â6³¿Àµ?[“-…`~¸?f‡ìžæ,»?AªZ¡ªÊ½?:þÁ+À?`”ÕÉÁfÁ?2Ì:µÀ—Â?œäõoH½Ã?s ¦ø£ÖÄ?nvÐ%ãÅ?íàmf(âÆ?‰ðZ}ÓÇ?ä¯[CµÈ?Ví‹<ˆÉ?´©b$vKÊ?K‡ODyþÊ?!¨v*× Ë?ýôfÉ+2Ì?‘Æ®™²Ì?½@=Ò] Í?OŸŒš¨|Í? ­¥6ÅÆÍ?Ôº*-†þÍ?SŒÈgÉ#Î?¾Æ¼Nx6Î?–ç±à‡6Î?D”AÉø#Î?…p“z×þÍ?Bà6S<ÇÍ?ypcäK}Í?Pø‰7!Í?ôè†Ü>³Ì?è­ð«³3Ì?¦„’£Ë?‡£ôË?±Ý—™BRÊ?"¨t‰šÉ?}MΖm¸È?ºxVöÓÇ? 8Â(ãÆ?)rŠ]9äÅ?fùH6¸×Ä?E;vôO¾Ã?¼ÿ€/²˜Â? ïÞR–gÁ?³\%·¹+À?·.¿Ë½?§r¢˜¡-»?Ò<þµ¶~¸?è,‰«£Àµ?Üùõ²?¾Z¤¤»°?û.ÍŽxª? î“nª¤¤?½F_¥µ„?ø]RÚH¡‘? Ößõã¯u?Wˆ!×Ç¿<¼ÑM‹~Æ¿J‰æ `éÅ¿qÃV±FÅ¿¹¼t‚ã–Ä¿zè˜úbÚÿ=þ£ÿPW·Y"=¿ïŒïa]Á¿¢B?êrÀ¿]*¾œü¾¿†Œ¨H½¿çFK»òº¿Æ!ˆ{<Ó¸¿ËøA®¥¶¿0„‰ûh´¿C¸QáH ²¿®S3—И¯¿­_ˆ’ݪ¿*Æ…’¦¿m-éU8¡¿´ªJ”¨˜¿ýa²¢¿cЍTÃs¿Ìˆ2Î¥Ês? ¶ÞŸ7¦?Ýújª˜?<8GB9¡?1B!°¦?g0ÒÞª?tÐ!úÁ™¯?f–Р²?“xèvi´?ŽžÜ±”¥¶?`÷À[»Ó¸?á³’òº?€XÄö˽?† õ¥"ý¾?¶†M¤.sÀ?Ë:e§]Á?¤L~j=Â?¸@O±íÃ?rBÔ®ÚÃ?,Îo¼1—Ä?,T&1GÅ?~¾ØÏ³éÅ?înDOâ~Æ?·Ú­½1Ç?újºNÇ?£N5¨îéÇ?LesßÏEÈ?–ÎRÔ¹’È?¡Í<}ÐÈ?gHf/ôþÈ?‘])=É?W+à†”-É?ÇlæÍ¡-É? 0]*É?~øÚÈ8ÿÈ?Î+ŽàÐÈ?Ti†‡?“È?Ò,„?}FÈ?À#ÿÊêÇ?7n|ÿb€Ç?ôõŠÙƒÇ?úŸüX€Æ?‰¹e$ƒêÅ?W°+ô³BÅ?ÎWÙyÄ?yöèlmÕÃ?¢Èn±Ã?î3J<;Â?mßIœ­[Á?¯oIñnqÀ?ˆöøÜêù¾?‘Õ¹$Äý¼?‚yq¬ïº?:ÒhSíи?7 n°×¢¶?£ûúPÅf´?¦9¼%²?3ï ¥t”¯?™¥æÂ=Ùª?vjëÈŠ ¦?ü‹ûà‘4¡?LÒ^ˆ¤˜??Ý8]å·?@–ÏÚþu?ØÍ»ªò|¿AA¿L¿$úÀ邘Á¿¢–ßÁ¿‹¹´ª±ˆÀ¿ÀlÚ£⿿1Æ : ¾¿bQíJ½¿4››)㻿ŠGþjº¿œ" "⸿‹p±EíI·¿~X4‹[£µ¿ ûsqﳿŬúÑ;/²¿™€Ïc°¿´N1 ­¿Õv+€‡_©¿ƒqK²Û’¥¿!x•|ḡ¿Hÿ~Ûñ§›¿+ƒQ¤Í“¿*¢âôˇ¿B©àA_¼o¿Bo1U®Êo?å±ñ‰Ï‡?cëvÝΓ?¯Ò ¿©›?¼[º­É¹¡?°ÌˆÅ“¥?–,Us`©?¤× ;{­?øƒ†Gd°?¬ê$Õµ/²?μí8íï³?,jŒJÙ£µ?·Ô»8mJ·?†ºm¤â¸?´G0ƒkº?Ü¢>ä»?_5cxK½?H̉É ¾?4º£¸6ã¿?ü£ÆUýˆÀ?„ìÕ-Á?FÝ¥Ó˜Á?j‡îh Â?pb‘I}Â?]Ký(ŒÞÂ?µeD,4Ã?„:¹'õ}Ã?$ã‡g¹»Ã?L ]SíÃ?Ìͽ‡£Ä?ò@| ”+Ä?R.&\8Ä?áé8Ä?”Wܳ+Ä?I¤– ÙÄ?h™ážíÃ?¯T9¼Ã?íØ-æn~Ã?Œ’·º4Ã?Ô®^é&ßÂ?lª¦×}Â?¾¨úLÞÂ?HD˜Á?ÞIPÁ?MßçÓª„À?FQS˜|Û¿?XÙs+Ú¾?Ö£,þªF½?wVcoà»?ÌÑõûgº?N…ƒs߸?œLX yG·?Ž©?¡µ?£æ+Lí³?à©ë¥4-²?úн‰äa°?d+Špö­?Ôp­A\©?l좥?³ Pç¶¡?^/(§›?˜Ä ÔÒ“?d³žó‡?_#¯‘p?Õµ&¼¿â‡:å#o»¿¢²}¿5¹º¿OUJtÌò¹¿Ð2^b¹¿$š€¶{6¸¿Iì¤C¦A·¿ ¡Åy>¶¿¯3œÅ“-µ¿nEàÙž´¿¨mz—J岿6V¿øN¯±¿ä/ö'kn°¿­íàÊF®¿Xm÷‚ž«¿£#ñlP䨿"SÉ5¦¿¶vN^wD£¿ÎƒäY×a ¿zÞ.(9êš¿ÃÁP•)•¿ƒ" gKŽ¿4ž#p¶‚¿ÿÅ”‚ìh¿elû4ã%h?²ÚT5‚?­g½ÌŽ?”†ì•?É}Í!þëš?¬ëd»b ?ÃÐqI]E£?Í É@¦?k=Š;å¨?·B ÿž«?P±èûºG®?Ô{ªtån°?¤ R˯±?äG™6Éå²?Y(Øù´?y.¦.µ?ß çÿ>¶?¾¢‹w0B·?(⻈ 7¸?D„%ô¹?ÎHdbó¹?Q(–йº?ÍHRéÃo»?N‰2d̼?dæ«R„¨¼?-¤=°*½?|ž`¡š½?*î]qø½?¦ mèÆC¾?ò<Ò¢s|¾?Ù¯T¢¾?tÓ½Rµ¾?دbµ¾?övØ}‚¢¾?à€0¿|¾?VxÎ~.D¾?Q:qNñø½?¤P 2›½?ô15ž"+½?¦¹-ºø¨¼?Lç¼?%(d«o»?ueÄ3³·º?.P¸œ,ï¹?±f¢C¹?¶±¶N1¸?u›=·?Õc0ºš:¶?Jå™D*µ?w^…™º ´?‘ 0 ·â²?|ê6Íù¬±?™4§Hl°?ÃC”ÝB®?¼ƒ¼wš«?°à'” á¨?(]W¦?Pë‚aB£?`™Æ¶8` ?ËÂç9éš?c"­i½•?@bìÝî"Ž?9Z"‰3‚?“ý×Q.íh?‚¢~fc³¿ÖCª4 ñ²¿önr‚s²¿²46”ƒê±¿þšˆxV±¿>:æ@»·°¿¸|ù®°¿²¶üv·®¿VTž>­¿:°2^¼³«¿LZžÄª¿+Z"µk¨¿:úä•°¦¿P\K)x礿™VÖu£¿:Ű/¡¿¨ôÚ¤†ž¿F u²›š¿¾ó (Ÿ–¿,bóƒ)•’¿¦¦£ÃˆÿŒ¿üÙWâÚ„¿Ž'a“»òx¿8ÁN· `¿ÂX…P®`?"ë •Šùx?Tv­DÆ„?<ì ö?ÔŽqâ–’?°a<ýÓ –?6J. Òœš?RÁ€–gˆž? Çêâ”0¡? ©ª\£?º4 bè¤?€×µ.ƒ±¦?Æ…©3¦l¨?f“.Ú¹ª?Rª-¶´«?ø‰§$?­?^xZC{¸®?üS 4°?~Ò˜C¸°?ügTïW±?þ¨0;ë±? Ë›6t²?|‘™l¸ñ²? :êl¬c³?‚`ƒû«É³?ñc;x#´?j ‹ÔÙp´?”ÆÊ¡±´?>Ÿ ¦å´?¨’·œÈ µ?flœ“ð&µ?ÎJ:¤ 4µ? ˆÅh4µ?Þ€­M 'µ?ØüŠhö µ?È?ï-áå´?Ú™Kóâ±´?Jù…!q´?PÔOû#´?XÇó›É³?²Wl¼3c³?„üBæ‘ð²?B‚„ñq²?:HMûÂç±?t—ª¬×R±?š”WÚ³°?b<Zü °?úýȶ°®?(e”È¢8­?œPv:e®«? ÞÊùª?|üáT`g¨?ÎnñÆ©¬¦?´å–íã¤?Àä&æL£?¶¡ª¹ñ,¡?4„ñõ‚ž?På(âÇ—š?ðÝMAÇ•’?šžp?Ü,U‘éÒ„?’8¹×1'y?hÎæ“Ú,a?È×s8ŽÞ¥¿ ‡^¥¿ÈS-[QФ¿¨/ŽÆ5¤¿Ø?«ýÃŽ£¿D ²Û¢¿0¡‘¹þ¢¿¨ó­ŽS¡¿¨B† ‘~ ¿( ¨„¬?Ÿ¿PÈñn¿@ñaŒ›¿˜d+.˜™¿XDÛ³„”—¿XŒ2øO‚•¿4€íÖb“¿xj·h7‘¿ÈOײ·Ž¿8¨!Ç„‰¿,/R6Àõ„¿Lã?wZ€¿œ 9.jw¿,-öô!l¿X«AD\¼R¿äÍËÖR?°Ó0/l?ÕÂhÐpw?´4ΊË]€?lÜHÉù„?È´“ºx‡‰?t‘#Ž?|Þy¿9‘?HÖvY‘d“?„ î_„•?ø¤l³I–—?ìS›cù™™?HÜíxà›?ÐÜǸÊp?Ø?œcŽAŸ? éGv† ?ô2ÕT¡?”^Ò?þ¢?`þ1?·Ü¢?̇š?Ï£?X˜mÙ×6¤?ôÉÁjѤ?,V¨&_¥?”Š3¶ß¥?ärÚrÉR¦?¸ÞBo¸¦?\ó¦g§?@ôö/~X§?ðÁ\Ó/“§?$Â÷X¿§?pÒsÛܧ?ì¼nô¦ë§?$Æ‚°ë§?ë0…öܧ?ã?Ï|•?*—M;^“?à`šý×3‘?aN!þ?´2ý–·‚‰?è}‚uoø„?4"]Ÿ?b€?Dó%É…w? ¼†þql?(¥?}S?õ'Fç †¿‰ôâHŠ…¿̦Êaû„¿åF Š_„¿Ð7P®!·ƒ¿ÀSo}ƒ¿@úvÂEB‚¿P´¸v¿Ð˵d €¿àø—ðŸ¿ZZt«}¿À¾Ò#Ä{¿€¼Z1Ìy¿@KF.Äw¿P†t˜”­u¿`ÖÁ¹š‰s¿@"È{’Yq¿Àá¬>ª=n¿@ Ýþ„µi¿ Vp€e¿B1”qx`¿ÀÀ(êj’W¿À‚‹½JL¿€ö°T9¾2¿ðéù¥Å$3? òZ~L? À–{%¬W?ð ì¡Z…`?`w9y*e?@"_‚‘Âi? ³A†ÎJn?€ìÙŒ2`q?pm¾ÊJs?@RUÄV´u?7±Ëw?*X Óy?&+P)Ë{?NÚ(²}?ÀÜ¥‹Ý†?0 I¤€?€¡ŒŠwz?@ö¡oF‚? 6€uƒ?/¯2»ƒ? ÛZ3™c„? ¡¦‡ÿ„?`‘¡e†Ž…?p¢4=†?@³®ò[„†?`¥aÁšê†? ¿¡#ºB‡?€}ƒŒ‡?À. þÆÇ‡?`óÍÏ_ô‡? ÂAº/ˆ?àvá!!ˆ?ÀÜ·¨%!ˆ? à¯6ˆ? ß¨iSô‡? ÀK€Ç‡? ¡&¢Å‹‡?`ñh.A‡? ÏÈç†?@€n~¥†?À½ýè†?°KHÔƒ…? Š=ñð„?àˈ%Q„?ðú隥ƒ?À[MAï‚?0j|Ë~.‚?ÀX8lc?p¦Z!Ž€?ÀÒ~ï±]?à?ÞÖç‹}? •æá§{?À§G¥Ç²y?`#€3Þ­w?PŠ šu?ÐnÞzs? ×…Ë6Nq?€¬­0n?ÀëTõ%´i?¬•»ï)e?qÊ”`?€Þ[OíW?àŽPðƒ@M?p"ûÒ5?0fˆâov”?à€—8þ“? .¾¸¬y“? tß é’?®±ÆåL’?0ã.Dd¥‘?hèÝó?О)6?@Z" ¦ÞŽ? ÆŸ|ï=? Ge0‹‹? y#ulj?0ú $Õó‡?02 ¨o†?ð¬Ìºn!„?`‘gR%‚?I˜ j€?à€×ÚÀ|?àÂ63\ãw?RG> s?àÜ=:¢n? †Ù}Âðe?0ÀnUåcZ?hPç ¬A?°“ÕtzA¿PÈKZ¿€¢Ì;Päe¿`×@’•n¿‘vø™s¿ Ÿq› Ýw¿ óôg|¿÷7€¿0BÔ&Ê!‚¿`cvp,„¿° CS$†¿PQ®Øð‡¿ð8oĉ¿µ¡Ä‡‹¿ Ô—Êv:¿à–L¿ÛŽ¿À|h;_4¿p ŠÔ.ñ¿H5Ã3Š£‘¿@¡?WK’¿`@£÷2ç’¿pøQɸw“¿x÷¹;ü“¿P\*jt”¿`8­$úß”¿`o©>•¿ tŽ]>•¿À¼†Ô•¿Ð(Ž>Y –¿À Å •4–¿°6"P–¿à 1ñ]–¿pÒü]–¿ð[–]FP–¿Àóß Ý4–¿ðîÔåÖ –¿æNÊTÕ•¿íu‘•¿p†NÀ@•¿Ù«½â”¿ ¡~Fx”¿Ëï±f”¿0²9P~“¿Ð²ßm(ï’¿PîëÔT’¿À`/©M­‘¿ˆ7;8û¿FÜT>¿ðHl¨c`CAÄL¿ðì¯'옋¿À=SùÓ‰¿à©:èÿ‡¿à‚¬Å9†¿@³æB®)„¿ðL)5+‚¿¨øG½"€¿°°³Pƒ|¿pJˆî ãw¿“µ:šs¿úU°‰n¿p’·#úËe¿à±ŠPuZ¿¦ÏÍmÏ@¿ µ·€žJ©?hë&͍?ˆPó™)¨?x¤Ðx_§?€Y6g\ž¦?-d³MÏ¥?pïë­Ëò¤?x íX^ ¤? b6®•£?DÙuF ¢?X®ÀûW¡?À‘3OÜŸ?C}9Hš?°TëùÿE›?Øy@æà˜?p±§³tl–?h(m/ê“?xZYf¢[‘?¸];§Â„?øªJ @ˆ? xOËcì‚?@Þòü{?¤ŒÌÃJp?ÆjawÅU?áEbƒ­U¿´ëD0ÅDp¿ @){¿T­µw`é‚¿¾b~=ˆ¿°þݸ¿8T+¶Z‘¿[ï¤è“¿Ðü»çj–¿€Ó¸ÌTߘ¿°õµjD›¿`#š®˜¿ J ¶°ÚŸ¿×ÊD†¡¿h%ñÙ4¢¿& d¾£¿i „¤¿XœµAîñ¤¿ô9mÎ¥¿€ð½|x¦¿@YÌß^§¿˜fü+?¨¿ˆe‹=µ¨¿`ÜÖ®I©¿¸§ªH®Î©¿øcÝÃCª¿çñÞ¦¨ª¿¸ðå_ýª¿À¹¦¯ç@«¿(ª$‚ès«¿hÿBý•«¿à+F§«¿¨nhÀ§«¿Ð:ìÿ–«¿(|}i$t«¿Ø%JFA«¿(ÔÁ¥ýª¿ØÏo©ª¿Ð²âEÚDª¿(&`÷%Щ¿èze;šK©¿ðdOÇ„·¨¿Ø“kø7¨¿¸† b§¿°'ð\¡¦¿¨c¹ï™Ò¥¿•Þ>ö¤¿h‚Ú/Ö ¤¿¸§Ê÷£¿ìXQB¢¿œ­µSY¡¿pзXÎ៿ØÑ53Ÿ¿èå[ŠFJ›¿`IÈv䘿èXñe;o–¿à øÓì“¿´éíŒ\‘¿˜«/Ól„¿àÈma=ˆ¿´i‹ËNç‚¿À°ÓÃS {¿|yh8p¿tŒRM°oU¿æà˜ê̳?ls¿]‘X³?hÁIز?ôÁábL²?x$ 3µ±?DOÍw±?°íX(tf°?(–¯*g_¯?ðƒ¹ëŒÞ­?@¸§ðFK¬?ÄE¡ò¦ª?Ä™·meñ¨?(úÞÛ,§?$ç¦ÇZ¥?Ä®z£?œ'¿Ž¡? \4ÜX.Ÿ?0騶q-›?+È—?|Ä®«Þû’?8¿Ðꀠ?¾2úÿ6…?ØíìfÕ€y?¨•Våa?ø5ð\ü`¿˜ŽZ{y¿XЄ4…¿¨£„Oš¿8Hðiú’¿Ÿæ§Q—¿Àðù+›¿ …/ÀÝ,Ÿ¿*6ÊC¡¿x(Ey£¿¼¼\‰CY¥¿ -‘ã,§¿TTMŸð¨¿ÀPήťª¿¨÷9l|J¬¿Øï›ÀÝ­¿(ñâ—^¯¿´6J f°¿°$ë^­±¿P¼Ç´±¿ "möK²¿€7Õ=Üײ¿P¢Öï"X³¿´Ø¨t{̳¿L ž4´¿ŒÉJ´¿$&Ñ Iß´¿t;yYh!µ¿Ô¤¼€Vµ¿|<-Øo~µ¿”„ÞB™µ¿²hR~¦µ¿´ÓôM…¦µ¿ÇÕ4™µ¿„]Dã•~µ¿X¦Â¹Vµ¿¸B’ú¹!µ¿ôtÔ#¸ß´¿€¦Ý´¿Ìò™V[5´¿Dxühͳ¿4§áÐDY³¿”tº-3Ù²¿,±~M²¿¨y¶±¿ôáÎè{±¿Äïég°¿(½\b¯¿x9¡duá­¿X ‡6N¬¿øùD,©ª¿tŸ‰=Ì󨿄ê/§¿PªVŠâ[¥¿¸2ÆŽ{£¿È.ÊÞ2¡¿@Ý$ñ/Ÿ¿X›º/.›¿è2ÏÚ›—¿\‰¶½ú’¿Xu®]Vœ¿dï Ð 1…¿ø1ë×õqy¿ CRüå`¿ˆ/ý{À‹º?Ãu‘Ãï¹? F{¼ÇC¹?ä¾7ˆ¸?8Cþ9…½·? ›¬>/ä¶?@Ô(»üµ? 'l¸·µ?üòL ¼´?tfþ:g÷²?P–`ݱ?`óãWT¸°?äWXâñ¯?8U`Ñ ¬?Px—~Šª?äìÚÎ舧?dg•Ãæ¤?„4ñ˜º7¢?œêx&ëúž?̉WFs™?hs`ÜïÛ“?,žô´pŒ?Óµ?˜- Óf?T¾ø÷Çf¿dæªþ:¿,ÇË©ímŒ¿ ­E‹Ú“¿X/4€àq™¿XeÅÀƒùž¿Dnôø7¢¿‘vã æ¤¿h‚˜ç1ˆ§¿ys@Òª¿ÌX XŸ¬¿$´B›6¯¿øšiÞõ·°¿·ªÝ±¿ÔƒÝø÷²¿`‰>ÛZ´¿°F´›Uµ¿¨ö‘"Xüµ¿œÑýXËã¶¿€Mj† ½·¿0#ù¨Ñ‡¸¿ðò•ÈaC¹¿l.›D]ﹿã×Z‹º¿|Ò.ø»¿œž$|á‘»¿éÝVÊû»¿äD–qT¼¿°þY ›¼¿ðب2,Ѽ¿˜†`0óô¼¿æÀÇúž¿ü0àçYr™¿l6L?Ú“¿Ø"œ¼ìkŒ¿lÞô” ¿ÌÆr&å·f¿Žë¾u•lÀ? <Âh À?4iœSC¿?Ä}SŒ:[¾?(ñÇh`½?`‘'yS¼? £¬5»?ÌÅR£áº?d9¯¥Æ¸?(YÏ"x·?Œ”º/%¶?ø¿E0†°´?œ6L¿$9³?v«*`èµ±?Ú“öå¿'°?<ÄhÀA­?¬;ÊÝ©?(–犦?È]…QÙ*£?@Ró}Ÿ?4ÊÈ’˜?úã+¯u˜‘?€,¨“&…?0—פÆÙµ±¿X¬m“Ë8³¿NÛW,°´¿X]åʶ¿pÛÆw·¿EÀIƸ¿Ð4£ …º¿ßQÚ³4»¿ÔÕ$<S¼¿H€’“ `½¿Èúø ÜZ¾¿¸øOõB¿¿Ê0ã À¿ÒzflÀ¿",‰äÈÂÀ¿È+6ÕÁ¿šCv˜\PÁ¿Ì¢nµ6‡Á¿`×ÑA³Á¿¶\ØÞbÔÁ¿Ð*ê’…êÁ¿xÿoœõÁ¿LË õÁ¿󙨒êÁ¿~Ç|ŸyÔÁ¿0A‘÷b³Á¿´ëÆxc‡Á¿ê¯De–PÁ¿ì‹ŒÁ¿l=%!ÃÀ¿v*Ö«ÏlÀ¿š¹] À¿LúóÓ D¿¿¨ê!¦\¾¿´ŠKZa½¿œ+!~T¼¿àA(‡"6»¿|ñü÷º¿Xs<³¹Ç¸¿$¦6-y·¿äÉÂ!¶¿´ò¡án±´¿8[DDõ9³¿¼Ëœ¶±¿²´ŒT(°¿¬dÒ!% ­¿`†Å¥Ý©¿°æ¹±.‹¦¿kOþÍ*£¿|ÿ~H6}Ÿ¿ÈÅÈ“k‘˜¿2¿žˆ–‘¿´HþÇ!…¿TÕÎ&l¿(KGVÃ?b¥Úç¥äÂ?†?Mì]gÂ?üï’R¼ÞÁ?vPä^KÁ?4 !ĬÀ?h;„>*À?ø¦Yc_£¾? Õt…+½?øñv­¡»?¼=5·”?0§Cç—æˆ?º—ÌÕžp?‚þH™p¿pýѬ 䈿t¼=©ïµ”¿Èí휿°„î„.‰¢¿,ËV9e¦¿ôrž,±‰ª¿ §øžr®¿ºîð§b$±¿b =㳿Рå¨Ù´¿°ˆ…’¡¶¿´=ó†[¸¿Üžuº¿\ƒ;W¡»¿h«Ig.+½¿L#€@£¾¿–þÈþÀ¿Æ¤¯B˜¬À¿ ¾ŸqéJÁ¿¨"ÉmÞÁ¿´»C-2g¿¶yoszä¿È,*Vÿ:§¿ØÐ»Ã¿ßrAZÄ¿¸‡bÄ¿ÌqªÕ£Ä¿Èô§ÀðÖÄ¿èð?öñýÄ¿ôQ†Å¿€ %Å¿tK@ù%Å¿ dÅ¿`× þÄ¿Œ-…×Ä¿èªÎ$B£Ä¿ü@Íi¹bÄ¿Lm€“ŸÄ¿*fÆÿ#¼Ã¿ F‡}Vÿž•ÒYêä¿‚ºÞ¯g¿`ÜšßÁ¿){~KÁ¿ô¥Ø4­À¿ ¯ À¿,! YO¤¾¿«Zâr¿”æ€PŒ¿È1IÍŽ—¿z|±zs ¿5"µv¥¿¸kPéjª©¿¤Ìô±Š/®¿‰¤6Q±¿pm±ú˜³¿(÷“(%¢µ¿Ü½®Y··¿ø6x¶í½¹¿œ>ßn¡´»¿`½Ò>š½¿ îÁdšm¿¿´xM÷É–À¿ÜI–‹lÁ¿®›=Ž7¿6ýɼT÷¿ÜÓçÑh«Ã¿Œƒ«r[SÄ¿<-ÅîÄ¿œbcÛE}Å¿ôF—÷…þÅ¿d‚§¹5rÆ¿øìûÔ ØÆ¿à¿¥ˆÏ/Ç¿»LÆDyÇ¿0î¹S@´Ç¿$qÑæàǿ؈á;BþÇ¿à& È¿d¨ç™ È¿”óS±OþÇ¿U§©´àÇ¿¤G´Ú`´Ç¿äõa§oyÇ¿X-¾g0Ç¿ÄÉ MOØÆ¿øAå@ƒrÆ¿ÐrÉÀßþÅ¿dH¸«}Å¿;"[6ïÄ¿>•×SÄ¿T…úì«Ã¿œ¼¸oß÷¿ w"8¿VEÔ2mÁ¿ØVàÑY—À¿Zسn¿¿¼8?M›½¿”ü\‘¡µ»¿ì j›Û¾¹¿ÈLg,2¸·¿ð£å¢µ¿/»å>€³¿ïQ±¿ xuc0®¿ð°/?«©¿ )·Ù¥¿Ü˜`­s ¿\qÍÁŽ—¿½o`OŒ¿’Ûµ×ßr¿œÁ?Ÿ‡aÈ?Ш£€BÒÇ?¤¢“nL4Ç?ô¨ºÔˆÆ?¼#òÛÍÅ?,З>Å?¶-Èá©1Ä?¼µNë PÃ?UÝ}®cÂ?¢J·»dkÁ?¸ƒšÅ\hÀ?€Aþ¸l¶¾?hN¼ý.‰¼?ÄÉ XJº?„ôÒTJû·?ÌÖ srµ?Bz€F2³?6=ÐæB»°?(ÔèˆÜs¬?ä,oJ§_§?dsó=¢?páÁ“Rš?xY‰ôd?ÂÔ¤GÎót?àJ‚Ì5ït¿lwGx§b¿Ù¡ù+š¿Ž"áit<¢¿Ä“q_§¿4¤ÌOHs¬¿´O‹’øº°¿!rû1³¿h ž'µ¿´ñ+9ÿú·¿˜º¢ Jº¿Ô.òT㈼¿˜}ÃÎ ¶¾¿¸à¸³6hÀ¿Fx“>kÁ¿ˆyçFˆc¿È>J±zPÿ¨˜L³ƒ1Ä¿R÷X‡Å¿¼Å¸¶ÍÅ¿t§´Já‡Æ¿x&yX'4Ç¿¬C,ÒÇ¿¸‰vöcaÈ¿ØÜРáÈ¿_CŒ…RÉ¿Ìqó•̳ɿ ï‚þ9Ê¿ôöëž›FÊ¿d>W7ÉwÊ¿•º‡¤˜Ê¿ÄDôa©Ê¿è•eµ©Ê¿˜Ð“±˜Ê¿#i/ßwÊ¿, ÒºFÊ¿0Ú ÍbÊ¿øççeÿ³É¿ü'´ÂRÉ¿@Tˆ…èáÈ¿\ 5¶aÈ¿àó‚zÒÇ¿øƒe4ǿ̽…àOˆÆ¿œ[þÏ+ÎÅ¿°¯9°“Å¿\+`2Ä¿LËÁ×úPÿË/×d¿ê Å‹»kÁ¿`üŸ0¯hÀ¿„bÅU·¾¿0ÒF¸‰¼¿lâF9ÏJº¿$Ò„­û·¿ 0\×¾µ¿VŸ§—z2³¿.ÜÊÈ^»°¿¤„¡~âs¬¿„Ù&Š|_§¿6ÌØ<¯<¢¿ÊZNš¿à·jÚ\b¿Âä&½ít¿ Ó^žzÊ?ॠßÉ?Lºã%w3É?$e3w^xÈ?`cQd.®Ç?4«ŸcÕÆ?ø݃îÅ?$›öúÄ?h*CÇøÃ?`œÚÛëÂ?>)˜ÍÑÁ?ÚšTø}­À? Ry†Êý¾?Ì ƒ0|¼?tGÞõ‘ º?˜f»—y·?dDK#Ù´?î´`Ó+²?rJDæ®?åB…b©?è#d›ÅΣ? ʶ]œ?d†z%2 ‘?Ò•pÎ Áv?$»1â³¼v¿Hq‰ ‘¿ðôÙ†\œ¿."Òü9Σ¿œ)Xeùa©¿hÂÐ殿\ÛM"+²¿¦_2ÞÜØ´¿°3ßQy·¿ÔUø%K º¿dÇŒ05¼¿ k¸Zƒý¾¿€i=PZ­À¿3Yã©ÑÁ¿ÎCí!üê¿èŽ£øÃ¿œàÜùùÄ¿ª\`îÅ¿$%ùT@ÕÆ¿ümh ®Ç¿0Ìç;xÈ¿\&U3É¿(`!ÈãÞÉ¿pŽ_~zÊ¿”6¢óÃË¿´Ú\µ_€Ë¿\¶²¹êË¿X†•åtBÌ¿xoJ½v‰Ì¿y…߾̿,Ä^ŽâÌ¿Ø%ÞUmôÌ¿€-wqôÌ¿ÜÕwÍšâÌ¿PÓ³cô¾Ì¿¤¤;”‰Ì¿Œsâ=›BÌ¿~j#5êË¿09X˜€Ë¿0…§ØË¿Õ½ÉzÊ¿t«Õ‡7ßÉ¿@°ìþ°3É¿[ÚëžxÈ¿”V4ft®Ç¿Hß­ÕÆ¿ÒŸÌÚÐîÅ¿(­0kúÄ¿>buÕùÿœ´=k뿚Þ15ÒÁ¿"çWÀ­À¿”óBþ¾¿œ®#?伿xrbyè º¿¨ìÛy·¿`ãKRÙ´¿®ÉÅ\í+²¿à©2ý¦æ®¿@£ÑÃeb©¿Ú;Σ¿h~qÊ\œ¿´ü/ã! ‘¿ ʼv¿\Š2¶ÂEÌ?èß=ŸŸË?ÐdÇ…rèÊ?Xû0‡­ Ê?ØÒPuËHÉ?\ ÁuQaÈ?lQ“IÎjÇ?z®lúÙeÆ?Ø"CwSÅ?²“ë6*3Ä?JVwÉÉÃ?¨…q­ÎÁ?þ:©•‹À?¼…Qm“|¾?tXK.Ï»?À¦*¤¢¹?Ö$ü¡B¶?zR©iæf³?Yõî3°?H#ô©«?>B‘ì4&¥? JûiIž?Lݯ¯¼3’?,ƒïøWKx?xvz=Gx¿|¶÷ßµ2’¿d©¦ùbHž¿D]NG±%¥¿ôe+ &«¿^.Réñ~°¿¸Ú#E¤f³¿Êøtw_B¶¿ÌUË=`¹¿” VÅëλ¿ècÌP|¾¿¸®/Nt‹À¿z‹ŒÎÁ¿îòj¨ÿø÷¡á3Ä¿0X7ôRÅ¿§Þ¸eÆ¿T+b­jÇ¿hPFØ0aÈ¿ÜàB;«HÉ¿ÐÒÎ Ê¿ ÖàrSèʿ̕uú€ŸË¿¼,Ls¥EÌ¿ÎÍ¿|Vx]Ϳ̶ͩ–ÚÌ¿|–™éEÌ¿¬)Ÿ¤ÌŸË¿8` ¦èÊ¿Õsæ Ê¿üKxêIÉ¿d38]’aÈ¿gJekÇ¿@°òfÆ¿þ‘èXSÅ¿rÄ;k3Ä¿:3€ÿb|Þ7çÎÁ¿<Á{ÉÉ‹À¿ô›Zî|¾¿@.zÏ»¿„+(Þ¹¿lþ)×ËB¶¿Zâšþf³¿ôáö(:°¿Hb“«¿L„Fý%¥¿$ád¾Hž¿„@ oÜ2’¿Æ£”.(Gx¿€Ä~оÍ?l¶ÆÉÍ?øVíMOÌ?¤h¹Ù}Ë?Pœþ™Ê?¼úù}u¦É?è‹$ª£È?tÓ^ŽÇ?ªœéyoÆ?n>êŽ@Å?RŒË“‡Ä?èvd¿(¼Â?ؾÆkCп¶IVmCпžöÀgg9пëz`%пÎHáždп¤ƒÐž ¿Ï¿ïê8¼[Ï¿$àÖ3åοÿÖ£`[ο„„pNó¾Í¿tÜkˆ-Í¿@hGézOÌ¿äd…z¿VRª½à“¿–œOõ‰ ¿ÀrdW§¿¨á5{š­¿Ð§;®²¿¨«úL1µ¿ 6÷FDP¸¿ØŠvȇ`»¿<'Öè_¾¿Îªuâп>$j ØÐ¿¸ôô®BÃпœuE!¤Ð¿TÉR®¼zпNè]r.GпH¯›J– пô{ed4„Ï¿T¨ŠHÌáο¼Ý¥eX,οpÄñ`HdÍ¿ôí¥›ŠÌ¿Ô¦²^LžË¿,ã !x¡Ê¿`›Œ6”É¿œJGÎ-wÈ¿à°Áu KÇ¿®_XÎŽÆ¿J}„œsÈÄ¿^gB†sÿR‰Q™¿¦žÒȆ¦À¿ÜËA ]`¾¿XÍEð`»¿üÖ¯§?FUºØõ ?àˆÏÀb”?¸#gõ5{?€ÚÖJ¹1{¿À×éa”¿.ÒÓ“lõ ¿T‘sk¯§¿+ÒZ®¿L uY¾y²¿ôI‘H°ºµ¿ ùé9x„tód¼¿XõÁ^>%¿¿”zöqÁ¿Î ÉŸ¼‡Â¿¬)cšñÿZv1³*OÅ¿(ÂUR—ŸÆ¿ØÔÉ|âÇ¿”ÑØ‘ÍÉ¿”7‰š:Ê¿ü…-y+NË¿°#ñÚlQÌ¿ôáãÞ7CÍ¿üÖÑ|ö"οL´N˜ðο`Ô³å3ªÏ¿³¯`(пü[“W°qпjC®ÿÛ°Ð¿ŠŸ†w¼åпB$Z1Ñ¿ŽpˆQ 0Ñ¿šõpÎuEÑ¿.'å•$PѿЎb&PÑ¿$dzEÑ¿2³÷ô'0ѿܪ<Ñ¿ªFÿ(Êåп~fÖ©ì°Ð¿äÕfèÃqп@/ w(п,†ëeªÏ¿$r‡Vðο(b@Ø1#οé´wCÍ¿´÷1¯QÌ¿ %)2pNË¿à½ÃàX:Ê¿¤å´…É¿€óá9VâÇ¿Ha¶õÜŸÆ¿À¡YanOÅ¿„–NÛñÿ ú‡Â¿Öâ¾:«Á¿Ð+X„§%¿¿¼ Ûü¿ì kù  ‚.ùºµ¿Æøs üy²¿,«Šw7[®¿‰¼¯§¿ðE¤Ñ©õ ¿dOSTAb”¿~p 2{¿Ð´®Q Ð?ÔÄaøXÏ?Àa¶EˆÎ?ô[ª\™¥Í?x*>¶¡°Ì?èû@û©Ë?SÐ(B’Ê?Ôª!)jÉ?ܸñ<`2È?ü=*§®ëÆ?è 4¤Ö–Å?Ñð±4Ä?¨ {#ÆÂ?„<_päKÁ?t»r Ž¿?ôøCÑäp¼?„E)B¹?Pßc|â¶?`JI÷þ·²?,þ3Á®?€È¶]ÿ§?nÒ ãÎ.¡?6ºô'§”?Øàr{?Ä|ýuV{¿¬‰‹ a¦”¿lEçkk.¡¿dîÍ<úþ§¿„ %˜ÏÀ®¿Â·½9Í·²¿tQ™Á°¶¿°°¨M÷A¹¿Øš(³p¼¿ ùÜÜÛ¿¿n x³ËKÁ¿ˆn|zúÅ¿þc™4Ä¿ô‚:¾–Å¿Œll–ëÆ¿¬úë=H2È¿ ç}mjÉ¿ì’.Ñ*’Ê¿pfƒYä©Ë¿ìZdX‹°Ì¿¬ü¢ƒ¥Í¿Øs_¾0ˆÎ¿ø$Õå XÏ¿|æ»*H п,$bü¦^пð7Ì„ì¨Ð¿Ìâ|œìèпúx¸c~Ñ¿„¥]‚IÑ¿¶vpÜiÑ¿ÚÀ9#yÑ¿²‰¦KŠÑ¿†6(MŠÑ¿DúØL}Ñ¿* [íâiÑ¿ne­‹IѿʌUÊÑ¿âH£ûèпš`þ¨Ð¿Žì0 »^п”*Ž^ п@òôZ`Ï¿ÀùøÄXп¦Mô6ÏbпР’%­Ð¿î37íпˆ$úrÕ"Ñ¿¬C£åMÑ¿Î_ÉPFnÑ¿b$€iéƒÑ¿DÁ«:¾ŽÑ¿H€{¿ŽÑ¿¼¹q)íƒÑ¿òq£ŒLnÑ¿H¨ˆÀíMÑ¿:§•Žà"Ñ¿Æ2°Eíпœa±P5­Ð¿hK‹ ábп;k·lпh¸ïú-`Ï¿d%ðëο8°^A>­Í¿ã|¨¸Ì¿¨ô…Õ"±Ë¿dEù™Ê¿¸OWþ¿pÉ¿@3dIŸ8È¿Œ›÷¢ñÆ¿XÜ'miœÅ¿§˜;ò9Ä¿êt… êÊ¿xGtbPÁ¿Ð!{š(–¿¿ø{ØCx¼¿œã’‰›H¹¿¨þ{ ¶¿ÊNºE¸¼²¿8¯”rÉ®¿ cVãG¨¿ðØ'Ñ3¡¿DÃ~½Õ«”¿êÜ‘²N–{¿ÔRÚe²¾Ï?tŠëIÏ?ˆÂèv6Î?(<,ÊQVÍ?à(m2½cÌ?B¨œ`Ë?È«ÊHKÊ?¼åXÃ;&É?H3ž|ñÇ?˜{*q®Æ?à²3?ë\Å?ˆ¶¨»þÃ?V5BÁ®“Â?h›§?¹Á?4Èû&K9¿?ÔÙŠ %¼?ˆ( >þ¸?XËK=ɵ?qTå’…²?˜2£øuo®?Ø<Á{¾§?€Ks}h¡?䚤&n”?î ãDsK{?¸¤ä×H{¿H_ùQém”¿¼Þ¡¿8@7a(¾§¿\¢£"o®¿B„…Bi…²¿T  ´ɵ¿ø—þ¸¿D84à$¼¿¬œÒÕ!9¿¿ˆb[«¤Á¿ìyAGš“¿äš:ª¦þÿÍý×\Å¿ …p ]®Æ¿`=åähñǿЎkX(&É¿¤¡.<óJÊ¿ÐÁó_Ë¿~å«cÌ¿˜ ‘P@VÍ¿¼†E]e6οÔM¶ü9Ï¿¨`¤k£¾Ï¿ÖÞ2п\á,O|п`ÿþН»Ð¿E¨ðп4†G@Ñ¿)m¢=;Ñ¿°xt¬¤PÑ¿,A ÿW[Ñ¿À¹°Y[Ñ¿zÃU¨PÑ¿ ä4C;Ñ¿‚qäHÑ¿ÌØÑú±ðпj24‡»»Ð¿*]|пŠ)!ìí2п@«zÄÆ¾Ï¿€h4•`Ï¿œMúÚŽ6οdxíIlVÍ¿¤ŠÙcÌ¿ähŠ"`Ë¿à§Ç#KÊ¿DåºXY&É¿ £Ì™ñÇ¿x›!M®Æ¿@RW&]Å¿EÇÔþÿ˜ÔCœ¿RýdhÍÁ¿0ã—m9¿¿„ȇ%%¼¿4ñ#VSþ¸¿h¯JŒKɵ¿ø…Š!š…²¿˜z@¨vo®¿|~q*o¾§¿Ê/™qO¡¿|̽-Gn”¿,m¼ýI{¿Ð÷C]öÎ?¸´ Û6AÎ?š±¶wÍ?|‘ûéäÌ?¤&¼i°Ë?ä ¨š´Ê? ˜[çØ¤É?À0¬PˆÈ?¨l%ZÇ? wf, Æ?t2ß¾²ÕÄ?<úXGcÃ?,wºøÂ?*¥²À?üé:s(s¾?ðË>ù"u»?°B¨=M_¸?HÚuAµ?ì¹®[²?«Ê¿²­?X2YƒÇ%§?b÷›Q]™ ?ü6ëìŒç“?ÜS‚ýw¸z?D"Ϫ¶z¿°¾µöæ“¿xÃï™ ¿dK+|%§¿ ×Ð7t²­¿|ŽQ6²¿l«0zOAµ¿,J¡Ä'_¸¿”»šýt»¿ˆ·5s¾¿–Mû}²À¿ ?þLæ¿$¥€üPÿä³Ïž ÕĿ܊þ@ Æ¿° nWýYÇ¿‘bM?ˆÈ¿ÜNäǤɿä Dõ³Ê¿0Wõ¤Y°Ë¿¬xQhÕÌ¿ôùžÛ§wÍ¿t”ÈÍ(AοàÁ Pöο‹A{å™Ï¿B!î…Qп^>nÎ\Rп,\ÊօпЏ‰¯Ð¿~T Îп0.Í“ãпd‹¶Äùíп˜Ü®Ãúíп¼’sÄ–ãпԧ‡ò¤ÎпÌË¢”¯Ð¿à·Œß…пºV_cgRп…~Þ]пìi{šÏ¿x5ï4oöο(“„¸JAοt-RJÌwÍ¿ÜaúûÌ¿hTùø°Ë¿|®§©´Ê¿\¿iò¤É¿ÈC\:jˆÈ¿”b3(ZÇ¿|‰Ÿ”8 Æ¿ØçôÉÕÄ¿œYxëxÿbr>m ¿F®¡²À¿\¡³OFs¾¿ìÍ7g;u»¿ðtÆá__¸¿üü¡ÂAµ¿’¶)hb²¿¨+J;Á²­¿hºçн%§¿v•½ñH™ ¿ø# MPç“¿°Ÿô“>·z¿¬‡Ó<­¾Í?œ› >†Í?ÍÜ”NÌ?\úÓiüË?<‘7¨²˜Ê?Ôt$+¡«É?,m£0>¡È?ÀYà"ü•Ç?¨Ô0±mÆ?·uú0FÅ? M™Ä?ðz¸òÁÂ?ЭZ¬ÎdÁ?r”±uÀ?d”„D:½?”ˆ€Àjº? “ËàÜb·?p¸tu´?Îaê<ÍQ±?@N¤q›¬?”à‡,¦?¶g7¨q ?Œ¡ù4Ìû’? ëñ•?z?DIæ–z=z¿Ìz-eEû’¿ïIG. ¿ÜÏGÆÑ+¦¿|ÌîÐ-›¬¿T¹b¦«Q±¿xq51Su´¿0o»b·¿°¸þ)Ÿjº¿ŒÉöP#:½¿:¾.eÀ¿œ¾UD¾dÁ¿T­®râÁ¿ø6…þˆÄ¿°ÇV!FÅ¿lÂmÆ¿ŒÉäÁì•Ç¿ÞR%/¡È¿0ýÖ‡’«É¿Djz¤˜Ê¿D5OÉîË¿àö3Ù‡NÌ¿´L^õyÍ¿|4nÀ¡¾Í¿p(¯S_οl±Ü½fåοt:#[L_Ï¿l‹Ë)ÀÏ¿pPÛ{öпr-ó‘)&пtÖÜ–¾:п,Ìà‚Dпà†ýăDп0p—+Á:пXëê-&п¾jyüп8 ŠÀÏ¿ˆ"Õ^_Ï¿l~1\|åο|7€l_οØÚ 켾Ϳ̅:}—Í¿„Ù™§NÌ¿˜>T‚Ë¿duD’ǘʿl¬xº¶«É¿D™¢T¡È¿È¹4–Ç¿”uîK&mÆ¿¤qìEFÅ¿D“ðþ¬Ä¿$=©O¿F©‘ßdÁ¿ðо„À¿Ì¢†6^:½¿ø!ºÕjº¿„oÃíb·¿èÂR €u´¿8\PÓQ±¿¸†&Šs›¬¿ ƒëŽ ,¦¿ýù6a ¿¬T|È™û’¿pÝqm>z¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?42Ÿ±/âÑ?îðt×Ó?Wa'ä{ÀÕ?ô/qœ×?Ÿ;îo'iÙ?âŒ-ˆ‰&Û?7ô -ÓÜ?‘"ï  nÞ?’myã!öß?_qBµà?ÚíF+%eá?zÍõM â?s*GCå¿·ÀÚg¢†å¿F™Â1·¼å¿Ôodåå¿.mûöæ¿Ò„*æ¿{ÕQ¹ðÐ?(Ü:¨ËÒ?ÅÌ!•ÊšÔ?žÕgR]Ö?iÍEØ?_Ôó·Ù?¾g\äûMÛ? 7ô -ÓÜ?·GÀD—FÞ?,¥U§ß?$„Gzà?¼³‹é¹á?#ã4¹¢¨á?DxЧ/â?—rýu«â?ËÓ¿ã?ã&+@€ã?‹a8LºØã?¨ÿ÷$ä?FûqÇdä?® ˜ä?TŒ .¾ä?V°1KØä?UË,.åä?WË,.åä?V°1KØä?YŒ .¾ä?µ ˜ä?NûqÇdä?!¨ÿ÷$ä?˜a8LºØã?ð&+@€ã?ËÓ¿ã?¨rýu«â?VxЧ/â?7ã4¹¢¨á?Ò³‹é¹á?;„Gzà?^¥U§ß?ìGÀD—FÞ?B7ô -ÓÜ?øg\äûMÛ?B_Ôó·Ù?¨ÍEØ?ÞÕgR]Ö? Í!•ÊšÔ?pÜ:¨ËÒ?¼ÕQ¹ðÐ?æÑäÎ?6lÈ9Ê?Ú½uLÆ?}›>éuQÂ?§BA€@–¼?ÕÒów´?[]¢ š¨?‰|¦Šj?¼u¦Šj¿øY¢ š¨¿<ÓÒów´¿Ñ@A€@–¼¿”š>éuQ¿ô¼uLÆ¿flÈ9Ê¿HæÑäοXÕQ¹ðпÜ:¨ËÒ¿¤Ì!•ÊšÔ¿yÕgR]Ö¿Û ÿ¶!Ø¿M~ ö¶Ù¿¾šrkîLÛ¿[ô’ÒÜ¿26SylEÞ¿n Y¦ß¿„°ßx¤yà¿í]åBá¿©–rô§á¿=ßô.⿞Ö¼ªâ¿ö¶¦pã¿#¡ã¿äöömö×ã¿bäXH0$ä¿ x‹-þcä¿_8Ä8—ä¿ÖD£sÀ½ä¿}9y}×ä¿æ+&õ_ää¿zk¿ éÏ?U®Ë´Ñ?kP±+dhÓ?D•ûhÀÕ? žÌ¬Ö?H¨7¡9Ø? _Ôó·Ù?ìŒ-ˆ‰&Û?¨nƒ§`„Ü?Hæp¡ÐÝ?ò0’û~ ß?½…ëÚ›à?ÆÞ=î ¢à?Ükõ7!á?˜«Ô•á?Њ$¨˜ÿá?õB.C^â?ßò±™±â?n¥Íhùâ?éâ8„5ã?7߯eã?÷ÑÿŠã?Ϫ7R¢ã?"Gõu®ã?#Gõu®ã?Òª7R¢ã?üÑÿŠã?†7߯eã?ñâ8„5ã?n¥Íhùâ?êò±™±â?B.C^â?ߊ$¨˜ÿá?˜«Ô•á?íkõ7!á?ÙÞ=î ¢à?Ò…ëÚ›à?1’û~ ß?wæp¡ÐÝ?Ùnƒ§`„Ü?!-ˆ‰&Û?B_Ôó·Ù?€¨7¡9Ø?DžÌ¬Ö?€•ûhÀÕ?®P±+dhÓ?™®Ë´Ñ?ôk¿ éÏ?[\F{sWÌ?º<–˳È?£:¢¤çÅ?ºSgžAÁ?CEÏó&íº?ÀÊhz“G³?F‘58,§?wΛûëŽ?§ùÍ›û뎿Ž58,§¿Éhz“G³¿ˆCÏó&íº¿ßRgžAÁ¿Ë9¢¤çÅ¿ö;–˳ȿœ[F{sWÌ¿9k¿ éÏ¿5®Ë´Ñ¿MP±+dhÓ¿"•ûhÀÕ¿µ¸ ?«Ö¿Õà’8Ø¿W~ ö¶Ù¿×‘”}%Û¿ÁµJ7GƒÜ¿R£1{ÏÝ¿5d¼¢L ß¿üÃ.ýà¿‚'Çf¡à¿ªÚ7çŽ á¿*Tžô&•á¿3ÌEçþá¿/8ç]â¿dŒU4á°â¿¶ûW‹­øâ¿ \¤Æ4ã¿ #loeã¿©'Í)R‰ã¿‘Îq¡ã¿êÖÚS³­ã¿•¹¨m ÞÍ?*㦑Ð?Ñvàž*Ò?Þ"0·Ó?%p*Å28Õ?žÌ¬Ö?vÍEØ?¯;îo'iÙ?ÄS´“°Ú?rú $ŠçÛ?zPµ÷J Ý? ‡ö!!Þ?ðjC.b"ß?ÿàå7à?+’†[uà?øëªXØà?Î|ëCò0á?{+¯¯ñ~á?³SõÒ&Âá?Lá:húá?3õ·5“'â?ü3Hè‹Iâ?_=`â?ŸìG›™kâ? ìG›™kâ?_=`â?4Hè‹Iâ?9õ·5“'â?Tá:húá?¼SõÒ&Âá?†+¯¯ñ~á?Ú|ëCò0á?ìªXØà?%+’†[uà?"ÿàå7à?kC.b"ß?2‡ö!!Þ?¤Pµ÷J Ý?ú $ŠçÛ?­ÄS´“°Ú?á;îo'iÙ?¨ÍEØ?DžÌ¬Ö?\p*Å28Õ?"0·Ó?wàž*Ò?B*㦑Ð?º¨m ÞÍ?žÇƒ‡†Ê?Ë{ɳ’Ç?œÒÚ¿[¨Ã?ÊAK5&À?/ö6r3¹?ù8X0\ËØ¿Ü•[=ìÙ¿¬T2È!ýÚ¿6Ñ)aýÛ¿œÚ¾v]ìÜ¿o7LƒÉÝ¿°4¼FJ”Þ¿çmW5Lß¿Z´íÓðß¿&­¨öÞ@࿊è_FNà¿OóGö³à¿ùecˆÝà¿¥ìäýà¿VKÌ*á¿Y¸á¿ýißM+‘É?‹ –SÍ]Ì?IºÍðÏ?yòuGsàÐ?àvàž*Ò?P±+dhÓ?áÌ!•ÊšÔ?xa'ä{ÀÕ?:Öý÷ÂØÖ?‹Üõòâ×?"õ޳gÞØ?‘·†ÊÙ?aào’¼¦Ú?rnEƒrÛ?Zˆ\-Ü?ÿ½xÕÖÜ?ʯ¸†„nÝ?n…1 ôÝ?Ò“GÅgÞ?d¼÷KlÇÞ?®Þ_Àß?+Å8PéNß?oŸ>Ãuß?S{&56‰ß?U{&56‰ß?sŸ>Ãuß?2Å8PéNß?®Þ_Àß?q¼÷KlÇÞ?â“GÅgÞ?…1 ôÝ?߯¸†„nÝ?¾xÕÖÜ?sˆ\-Ü?nEƒrÛ?ào’¼¦Ú?>‘·†ÊÙ?Fõ޳gÞØ?°Üõòâ×?aÖý÷ÂØÖ?¢a'ä{ÀÕ? Í!•ÊšÔ?®P±+dhÓ?wàž*Ò?©òuGsàÐ?µºÍðÏ?ø –SÍ]Ì?_jßM+‘É?üÿ³Ä´Æ?šàÔ6]ÊÃ?‹ê%*ÁÓÀ?“ùmш¥»?n¿…g‚’µ?Ú1ø9\ä®?à/qY¦¢?«óéŒõň?hééŒõň¿R-qY¦¢¿/ø9\䮿 ¾…g‚’µ¿4ømш¥»¿Ýé%*ÁÓÀ¿ýßÔ6]Êÿcÿ³Ä´Æ¿ÉißM+‘É¿X –SÍ]Ì¿ºÍðÏ¿]òuGsàп(¯M[R)Ò¿®ü¢¤gÓ¿>=¤;ÿ™Ô¿ÞÐ-8¥¿Õ¿íí}á×Ö¿¥ÞÂ8â׿ÛÐDrÝØ¿ó‚°“‡ÉÙ¿_"Œµ¥Ú¿Ý­ctqÛ¿±A¬rF,Ü¿P>~¸ÕÜ¿aÖ¾bmÝ¿z ¯”åòÝ¿Ý8å¸ðeÞ¿‡N‰<ÆÞ¿6šÒ¡ß¿ø!0T´Mß¿ù(ÃŒtß¿Éo¾ùþ‡ß¿qŸà|]RÇ?½=àÉ?– –SÍ]Ì?¨J\ ÊÎ?*㦑Ð?p®Ë´Ñ?IÜ:¨ËÒ?žðt×Ó?Œ·‹í×Ô?¬5jpíÉÕ?^"åL¯Ö?–%ÝÕ®†×?î7”mŽOØ?ZÄýÉo Ù?{‡óGà³Ù?õ%ÊvNÚ?tæïùÓØÚ?\Ô"‚¢RÛ?fV§C—»Û?ãuуqÜ?ÿ?LûYÜ?ÿøƒtÜ?êTzìx²Ü?Ê)ô 6ÄÜ?Ì)ô 6ÄÜ?íTzìx²Ü?ùƒtÜ?@LûYÜ?îuуqÜ?tV§C—»Û?mÔ"‚¢RÛ?‡æïùÓØÚ?õ%ÊvNÚ?’‡óGà³Ù?sÄýÉo Ù? 8”mŽOØ?´%ÝÕ®†×?@^"åL¯Ö?Ï5jpíÉÕ?°·‹í×Ô?:žðt×Ó?pÜ:¨ËÒ?™®Ë´Ñ?B*㦑Ð?K\ ÊÎ?ø –SÍ]Ì?! =àÉ?ÊŸà|]RÇ?ƒqˆÞH¶Ä?Ó1n Â?æ´2¶â²¾?3gôAú7¹?8›J;„­³? +?ßÖ-¬?ùÈPDï ?=W™†?¼3W™†¿7÷ÈPDï ¿)?ßÖ-¬¿õ™J;„­³¿óeôAú7¹¿ª³2¶â²¾¿zÒ1n ¿øpˆÞH¶Ä¿AŸà|]RÇ¿Ž=àÉ¿i –SÍ]Ì¿vJ\ Êοþ²]‘п?a³Ñ¿tS|*ÔÊÒ¿,dBJ°ÖÓ¿²@PÖÔ¿ò™=gÉÕ¿í Am®Ö¿}Y§Æ…׿`…Ÿ€žNØ¿úô²xÙ¿§æožâ²Ù¿1ý*sMÚ¿s•?Ë×Ú¿ô´RÛ”Qۿ숑…ºÛ¿uì'n\Ü¿Ž¤~FãXÜ¿I"›îÜ¿wWµ]±Ü¿#·ººÃÜ¿Ý&æ–-Å?pŸà|]RÇ?jßM+‘É?Ìx´Š4ÀË?¹¹¨m ÞÍ?©k¿ éÏ?˜ÕQ¹ðÐ?U2Ÿ±/âÑ?|ý\”žÈÒ?øÑÜw£Ó?f¸’4rÔ?çÿ5U4Õ?ƒ k béÕ?ìPnpëÖ?ñ9 Š*×?ä¯j"ßµ×?…Å”2Ø?]# ^ Ø?_¶¬@÷þØ?ôÙû &NÙ?ÍÀv˜¹Ù?¯Ï°Š½Ù?M ÙÖ{ÝÙ?THXyíÙ?UHXyíÙ?P ÙÖ{ÝÙ?¶Ï°Š½Ù?ÕÀv˜¹Ù?ÿÙû &NÙ?l¶¬@÷þØ?m# ^ Ø?–Å”2Ø?ø¯j"ßµ×?: Š*×?QnpëÖ?œ k béÕ?ÿ5U4Õ?0f¸’4rÔ?5øÑÜw£Ó?œý\”žÈÒ?x2Ÿ±/âÑ?¼ÕQ¹ðÐ?ôk¿ éÏ?º¨m ÞÍ?y´Š4ÀË?_jßM+‘É?ÊŸà|]RÇ?-'æ–-Å?Ícôù«Â?UëÌ]EÀ? 8ÎOT«»?€V Þº¶?Œ=Jc¼±?Oþeðe©?‹•\7ᆞ?À¾¸^^„?P¶¸^^„¿V‘\7ᆞ¿üeðe©¿h<Jc¼±¿_U Þº¶¿7ÎOT«»¿ÔêÌ]EÀ¿Ocôù«Â¿²&æ–-Å¿FŸà|]RÇ¿ÞißM+‘É¿Ÿx´Š4ÀË¿1©3©ùÜÍ¿…µ*ÌeèÏ¿/´;"ðпœ›3áÑ¿-ì’3åÇÒ¿TG0 ¶¢Ó¿ùÆÉjqÔ¿Z0ñƒ3Õ¿žOÎ͉èÕ¿a» Ö¿Käàj¥)׿Ê=1"õ´×¿–‘ö¥1Ø¿æ•kŸØ¿Œh•þØ¿òÞmN,MÙ¿Ï›wg½ŒÙ¿¬ù¥§Œ¼Ù¿$´’|ÜÙ¿t¾SvyìÙ¿…côù«Â?4qˆÞH¶Ä?­ÿ³Ä´Æ?.Ù+¦?¥È?Yǃ‡†Ê?\F{sWÌ?ÓæÑäÎ?¾ƒ”ÇÃÏ?êrå ‰®Ð?î-«¶åpÑ?èž®-€(Ò? JFÊçÔÒ?ñÙ8²uÓ?(qO| Ô?`yåJê’Ô?†^n¨Õ?ÛìŒ4i}Õ?•û„éÞÕ?ú¦fÔì2Ö?XRU?yÖ?³i=¨µ±Ö?(ÓËú,ÜÖ?)~[‹øÖ?çä,޾×?èä,޾×?+~[‹øÖ?.ÓËú,ÜÖ?ºi=¨µ±Ö?bRU?yÖ?§fÔì2Ö?¢û„éÞÕ?ëìŒ4i}Õ?—^n¨Õ?syåJê’Ô?<qO| Ô?Ù8²uÓ?&JFÊçÔÒ?Ÿ®-€(Ò? .«¶åpÑ?så ‰®Ð?W¾ƒ”ÇÃÏ?æÑäÎ?[\F{sWÌ?žÇƒ‡†Ê?uÙ+¦?¥È?üÿ³Ä´Æ?ƒqˆÞH¶Ä?Ícôù«Â? ¡*»A”À?»Y‘á…æ¼?Rxvoµ’¸?…èW½/´?òtïV¤€¯?~š‹P`ަ?h–(f›?¸7¸¦‚?:0¸¦‚¿Ód–(f›¿u˜‹P`ަ¿ìrïV¤€¯¿… èW½/´¿Uwvoµ’¸¿ÖX‘á…æ¼¿™ *»A”À¿_côù«Â¿qˆÞH¶Ä¿‰ÿ³Ä´Æ¿Ù+¦?¥È¿¦0N»…Ê¿÷oÆ[VÌ¿×E3Ý»ο\xŽÂÏ¿åÉ~þä­Ð¿ZK–9pÑ¿ÂIùÌ'Ò¿µË;ð-ÔÒ¿úò+òtÓ¿ð>†¶ Ô¿!æ"?’Ô¿ÝÂt6Ø Õ¿>»†•|Õ¿0ÃÓ«ÞÕ¿ìhþ¾2Ö¿åå‰axÖ¿4•¯Õ°Ö¿cY _KÛÖ¿ A¢h¨÷Ö¿wMNÛ׿ëÌ]EÀ?ÃÒ1n Â?UàÔ6]ÊÃ?A&­{Å?{ɳ’Ç?€<–˳È?ÿlÈ9Ê?™r°˜¯Ë?ü ÙUÍ?x3„ã#gÎ?Í#rÜ1§Ï?ô·ˆ0ÝiÐ?²¿L öÐ?gFP±wÑ?º£ÛJšîÑ?Y¶]tZÒ?–@øÅüºÒ?wpáü÷Ó?ŽF¿˜1YÓ?¹6¨p|–Ó?³§·²ÇÓ?+ ¶ìÓ?¬²oÔ?½_@RÐÔ?¾_@RÐÔ?Ŭ²oÔ?0 ¶ìÓ?º§·²ÇÓ?Â6¨p|–Ó?˜F¿˜1YÓ?ƒpáü÷Ó?£@øÅüºÒ?h¶]tZÒ?Ê£ÛJšîÑ?xFP±wÑ?Æ¿L öÐ? ¸ˆ0ÝiÐ?ú#rÜ1§Ï?¨3„ã#gÎ?. ÙUÍ?7™r°˜¯Ë?6lÈ9Ê?º<–˳È?Ë{ɳ’Ç?~&­{Å?šàÔ6]ÊÃ?Ó1n Â?UëÌ]EÀ?»Y‘á…æ¼?»ã1à~0¹? 0«éîjµ?KÜÞz)˜±?qéuQÂ?P ÖVÃ?ÖC×½OÄ?¸àWc<Å?7ÒHÌðÆ?x¶&žÛíÆ?>XSW¢±Ç?Á:D:ÌfÈ?ªŒŒé É?õ ŽÛ“£É?‡¡éuQÂ?ºSgžAÁ?ÊAK5&À?P-Ýy ¾?“ùmш¥»?3gôAú7¹?€V Þº¶?…èW½/´?KÜÞz)˜±?¦Åwë­?Å^(”¨?É7¢°-£?ðå©íÉv›?:u'„B?>ûJ5v?òJ5v¿ôr'„B¿uã©íÉv›¿Ž7¢°-£¿UÄ^(”¨¿r~Åwë­¿ÀÛÞz)˜±¿ý èW½/´¿ûU Þº¶¿¥fôAú7¹¿ùmш¥»¿É,Ýy ¾¿2]2Öe%À¿|òUe@Á¿€or ÁP¿P"1=ÑUÿ„j «ôNÄ¿sº‘Ñ;Å¿xº¶™Æ¿ZâSùìÆ¿˜×뀸°Ç¿ÏOðgÛeÈ¿HšÆRò É¿‡äÒ–¢É¿Ì‹l)Ê¿Y´ Ê¿®Æ1¹eË¿d['ü\Ë¿Änœ°¾ Ë¿¼ª6rqÔË¿¬¾¼^úöË¿O;À)DÌ¿H=Jc¼±?ìšJ;„­³?$¿…g‚’µ?w³2j·?M/ö6r3¹?EÏó&íº?kBA€@–¼?•Æ´°¸-¾?Éz9”²¿? /ä£ñ‘À?¢iÎ a@Á?_Ã,äÁ?g0kÂï|Â?_gÔK Ã?øAíÊé‹Ã?"̵yÄ?r-³jÄ?>Æ¿UÇÄ?YðÖZ&Å?ïŒèõYÅ?† «ušÅ?³Z÷ìò·Å?E›læÒÅ?Q|UdàÅ?R|UdàÅ?H›læÒÅ?¸Z÷ìò·Å?Œ «ušÅ?ïŒèõYÅ?dðÖZ&Å?KÆ¿UÇÄ?-³jÄ?­"̵yÄ? BíÊé‹Ã?rgÔK Ã?}0kÂï|Â?vÃ,äÁ?ºiÎ a@Á?:/ä£ñ‘À?{9”²¿?ÐÆ´°¸-¾?§BA€@–¼?CEÏó&íº?/ö6r3¹?Gw³2j·?n¿…g‚’µ?8›J;„­³?Œ=Jc¼±?òtïV¤€¯?qqë ÿÜûÂâ(‹Ã¿ùøeE´Ä¿L13•éiÄ¿ö{®ï‡ÆÄ¿¬ 6VÅ¿TÕc0#YÅ¿mû¬ÅŽÅ¿ôs9•·Å¿BOá ÒÅ¿~3›nŒßÅ¿îýeðe©?4+?ßÖ-¬?o1ø9\ä®?}Áž$êð?Ê8X1ø9\䮿bÁž$êð¿·,à' ²¿<Ы4ÕF³¿s]Ð)w´¿p(©Jßšµ¿µæû»A±¶¿­Çot¥¹·¿œ ®eg³¸¿2Ç~‡í¹¿˜½Ç6§xº¿ÀŽ C»¿õ:!¼£ü»¿1L#J÷¤¼¿Hèi ;½¿€W.BÀ½¿8ÁÍŠ2¾¿;˜úË3’¾¿ µ*ß¾¿å?‰‰Æ¿¿ŒÑ/J]?¿¿æŽxŸ®R¿¿•\7ᆞ?KùÈPDï ? /qY¦¢?À´iL•&¤?>¹"а¥?‘58,§?']¢ š¨?¨VA´¹ø©?{ ë_G«?ˆ^îL3…¬?— ôÖo±­?7ñ0_\Ë®?¿ªïKÒ¯?¬êöÒÌb°?®.YÒ°?Ö­·„…7±?•|¶’±?Ðô;ÒËá±?Úšì®|&²?Þïû_²?7† &޲?;1&ÀÞ°²?rbŽnȲ?UQXÚ¬Ó²?VQXÚ¬Ó²?ubŽnȲ?@1&ÀÞ°²?=† &޲?Þïû_²?ãšì®|&²?Ûô;ÒËá±?¡|¶’±?ä­·„…7±?®.YÒ°?¼êöÒÌb°?ãªïKÒ¯?_ñ0_\Ë®?Á ôÖo±­?µ^îL3…¬?ª ë_G«?ÛVA´¹ø©?[]¢ š¨?F‘58,§?w¹"а¥?ú´iL•&¤?à/qY¦¢?ùÈPDï ?‹•\7ᆞ?h–(f›?ó:úÅ2¡—?d^ °l”?:u'„B?JŒÞÕÁ‰?ÁBpBq‚?;½Ö= *v?7`H¨?”]?öSH¨?”]¿.ºÖ= *v¿BpBq‚¿¢ŠÞÕÁ‰¿ht'„B¿”] °l”¿8:úÅ2¡—¿Ùg–(f›¿Ø”\7ᆞ¿-ùÈPDï ¿ƒ/qY¦¢¿Ÿ´iL•&¤¿Ô”öÅ@¯¥¿HîfƒS+§¿xíg?™¨¿w}Bc¹÷©¿ð ]³RF«¿–Ô„¬¿èz‹ËJ°­¿üµqu,Ê®¿>Húѯ¿ûz+b°¿ŠV]³Ñ°¿I1hšÛ6±¿ªiNf‘±¿”wW᱿#À<ŽÉ%²¿œû–F_²¿FáOýn²¿®ž¾I&°²¿H0?WDz¿zùq óÒ²¿r¾¸^^„?ÁûJ5v?¥RÄk/q? @dœh?7`H¨?”]?? % 9¼C?% 9¼C¿$\H¨?”]¿d @dœh¿‹RÄk/q¿&úJ5v¿Ä3iÏz¿NÃésˆ¿?7¸¦‚¿H¾¸^^„¿˜¶ésˆ?À/¸¦‚?ص¸^^„?<3W™†?ëèéŒõň?cY£ãŠ?ìEc#¼ðŒ?AùÍ›ûëŽ?‹u¦Šj?a:·¾ T‘?Üî$S3’?{è<ø`“?ÌÕz‚²Ï“?Yr03Ì‹”?‰¶:;•?PHøÑÝ•? Ç,qir–?–•kù–?-GˆAr—?¤¬6¢Ü—?›v'ŠK8˜? ßÞú…˜?m7ŸÂ˜?HæAôð˜?÷ŠE‡ç™?ÇÒ ñe™?â\7ᆞ¿ööÈPDï ¿-qY¦¢¿ú±iL•&¤¿B¶"а¥¿Þ58,§¿ÄY¢ š¨¿SA´¹ø©¿ºŒ ë_G«¿šZîL3…¬¿€ôÖo±­¿ùì0_\Ë®¿]¦ïKÒ¯¿jèöÒÌb°¿±«.YÒ°¿w«·„…7±¿)z¶’±¿Zò;ÒË᱿Z˜ì®|&²¿xÛïû_²¿©ƒ &޲¿¨.&ÀÞ°²¿Ü_ŽnȲ¿½NXÚ¬Ó²¿¾NXÚ¬Ó²¿Þ_ŽnȲ¿­.&ÀÞ°²¿¯ƒ &޲¿€Ûïû_²¿c˜ì®|&²¿eò;ÒË᱿5z¶’±¿…«·„…7±¿Á«.YÒ°¿{èöÒÌb°¿¦ïKÒ¯¿!í0_\Ë®¿«ôÖo±­¿ÇZîL3…¬¿éŒ ë_G«¿GSA´¹ø©¿øY¢ š¨¿Ž58,§¿z¶"а¥¿3²iL•&¤¿R-qY¦¢¿7÷ÈPDï ¿V‘\7ᆞ¿Ód–(f›¿²7úÅ2¡—¿Ÿ[ °l”¿ôr'„B¿¾ˆÞÕÁ‰¿7BpBq‚¿.ºÖ= *v¿$\H¨?”]¿ãOH¨?”]? ·Ö= *v?ŒBpBq‚?‡ÞÕÁ‰?"r'„B?ÐZ °l”?÷6úÅ2¡—?d–(f›?¤\7ᆞ?ØöÈPDï ?ô,qY¦¢?Ù±iL•&¤?"¶"а¥?È58,§?®Y¢ š¨?üRA´¹ø©?¢Œ ë_G«?„ZîL3…¬?kôÖo±­?ãì0_\Ë®?I¦ïKÒ¯?cèöÒÌb°?««.YÒ°?p«·„…7±?#z¶’±?Tò;ÒËá±?U˜ì®|&²?tÛïû_²?§ƒ &޲?¦.&ÀÞ°²?Û_ŽnȲ?½NXÚ¬Ó²?¢ûeðe©¿¨(?ßÖ-¬¿¤.ø9\䮿ù¿ž$êð¿(7XdAa“¾¿Ægá2྿°]!{ù¿¿¥­¸‘@¿¿æ9£ÌãS¿¿è9£ÌãS¿¿©­¸‘@¿¿¸]!{ù¿¿§Ægá2྿KdAa“¾¿8ðÎÞ´3¾¿)Y×gÁ½¿ŒìôÀ<½¿oÀ়¿3bcû·ý»¿äl(¦D»¿¹¼a€¬yº¿öÄ%bêž¹¿sîp5[´¸¿Ÿñ¢º·¿B›Î¸!²¶¿Í¤©‹´›µ¿<ÓÒów´¿Éhz“G³¿X7XéuQ¿[ ÖVÿÕB×½OÄ¿ªàWc<Å¿ÑHÌðÆ¿Uµ&žÛíÆ¿WSW¢±Ç¿‹9D:ÌfÈ¿l‹Œé É¿¯ ŽÛ“£É¿; ÑHÌðÆ¿ËàWc<Å¿øB×½OÄ¿ ÖVÿ”š>éuQ¿ßRgžAÁ¿ý@K5&À¿Ó+Ýy ¾¿4ømш¥»¿óeôAú7¹¿_U Þº¶¿… èW½/´¿lÛÞz)˜±¿*~Åwë­¿UÄ^(”¨¿Ö7¢°-£¿”ä©íÉv›¿ht'„B¿&úJ5v¿ñJ5v?"r'„B?â©íÉv›?š7¢°-£?Ã^(”¨?ö|Åwë­?áÚÞz)˜±?ý èW½/´?ÚT Þº¶?deôAú7¹?¨÷mш¥»?L+Ýy ¾?»@K5&À?¦RgžAÁ?]š>éuQÂ?I ÖVÃ?ÃB×½OÄ?šàWc<Å?ÑHÌðÆ?Dµ&žÛíÆ?WSW¢±Ç?€9D:ÌfÈ?b‹Œé É?¥ ŽÛ“£É?2 Xû¤§Ð¿„äuÜ|ÑпžìúnõðпùïIûÑ¿é&3vÑ¿ê&3vÑ¿ùïIûÑ¿¢ìúnõðп‰äuÜ|ÑпEXû¤§Ð¿•ÿ"™‡sпñŠÚD5п·r¸JÚÏ¿n ËÞ5Ï¿åJv~οvÇm@´Í¿É¿ÿ¸×Ì¿`féË¿d8éÝéÊ¿ æ;H¼ÙÉ¿Ïå+R©¹È¿ {»°VŠÇ¿ô¼uLÆ¿Ë9¢¤çÅ¿ÑÑÚ¿[¨Ã¿3‚rD°C¿Ýé%*ÁÓÀ¿ª³2¶â²¾¿7ÎOT«»¿Uwvoµ’¸¿C/«éîjµ¿øFšëò5²¿r~Åwë­¿Ìí¢|•X§¿ç¾°~M· ¿”] °l”¿Ä3iÏz¿ô¸3iÏz?ÐZ °l”?e½°~M· ?Lì¢|•X§?ö|Åwë­?¶ésˆ?÷6úÅ2¡—?¶¨ÔÝæ¨£?Ô9?lu«?áÚÞz)˜±?š.«éîjµ?,â1à~0¹?X‘á…æ¼?uêÌ]EÀ?Ò1n Â?™ßÔ6]ÊÃ?t%­{Å?¶zɳ’Ç?¥;–˳È?lÈ9Ê? ˜r°˜¯Ë?ý ÙUÍ?p2„ã#gÎ?¼"rÜ1§Ï?f·ˆ0ÝiÐ?!¿L öÐ?ÔEP±wÑ?%£ÛJšîÑ?Àµ]tZÒ?ú?øÅüºÒ?Ûoáü÷Ó?ðE¿˜1YÓ?6¨p|–Ó?§·²ÇÓ?Œ ¶ìÓ?"¬²oÔ?_@RÐÔ?côù«Â¿¨pˆÞH¶Ä¿ÿ³Ä´Æ¿ˆØ+¦?¥È¿§Çƒ‡†Ê¿Z[F{sWÌ¿æÑäοC½ƒ”ÇÃÏ¿zrå ‰®Ð¿x-«¶åpÑ¿nž®-€(Ò¿IFÊçÔÒ¿nÙ8²uÓ¿¡~qO| Ô¿ÖxåJê’Ô¿ø]n¨Õ¿KìŒ4i}Õ¿û„éÞÕ¿e¦fÔì2Ö¿ÁRU?yÖ¿i=¨µ±Ö¿ŽÒËú,ÜÖ¿Ž}[‹øÖ¿Lä,޾׿Mä,޾׿‘}[‹øÖ¿”ÒËú,ÜÖ¿!i=¨µ±Ö¿ËRU?yÖ¿p¦fÔì2Ö¿û„éÞÕ¿ZìŒ4i}Õ¿ ^n¨Õ¿éxåJê’Ô¿µ~qO| Ô¿…Ù8²uÓ¿§IFÊçÔÒ¿ˆž®-€(Ò¿”-«¶åpÑ¿—rå ‰®Ð¿½ƒ”ÇÃÏ¿HæÑäοœ[F{sWÌ¿ìǃ‡†Ê¿ÏØ+¦?¥È¿cÿ³Ä´Æ¿øpˆÞH¶Ä¿Ocôù«Â¿™ *»A”À¿ùX‘á…æ¼¿­wvoµ’¸¿ý èW½/´¿tïV¤€¯¿ç™‹P`ަ¿Ùg–(f›¿?7¸¦‚¿À/¸¦‚?d–(f›?Ý—‹P`ަ?rïV¤€¯?ý èW½/´?°vvoµ’¸?X‘á…æ¼?* *»A”À?âbôù«Â?ƒpˆÞH¶Ä?ñ ÿ³Ä´Æ?`Ø+¦?¥È?€Çƒ‡†Ê?>[F{sWÌ?íæÑäÎ?%½ƒ”ÇÃÏ?lrå ‰®Ð?k-«¶åpÑ?až®-€(Ò?IFÊçÔÒ?bÙ8²uÓ?˜~qO| Ô?ÎxåJê’Ô?ï]n¨Õ?CìŒ4i}Õ?ûú„éÞÕ?_¦fÔì2Ö?¼RU?yÖ?i=¨µ±Ö?ŒÒËú,ÜÖ?}[‹øÖ?Lä,޾×?b&æ–-Å¿çžà|]RÇ¿pißM+‘É¿*x´Š4ÀË¿ ¹¨m ÞÍ¿îj¿ éÏ¿5ÕQ¹ðпí1Ÿ±/âÑ¿ý\”žÈÒ¿¤÷ÑÜw£Ó¿›e¸’4rÔ¿kÿ5U4Õ¿ k béÕ¿hPnpëÖ¿j9 Š*׿Y¯j"ߵ׿÷Å”2Ø¿Í" ^ Ø¿Íµ¬@÷þØ¿`Ùû &NÙ¿7Àv˜¹Ù¿Ï°Š½Ù¿µ ÙÖ{ÝÙ¿¼HXyíÙ¿½HXyíÙ¿¹ ÙÖ{ÝÙ¿Ï°Š½Ù¿?Àv˜¹Ù¿jÙû &NÙ¿Úµ¬@÷þØ¿Ü" ^ Ø¿Å”2Ø¿m¯j"ߵ׿9 Š*׿~PnpëÖ¿ k béÕ¿†ÿ5U4Õ¿¸e¸’4rÔ¿Â÷ÑÜw£Ó¿.ý\”žÈÒ¿2Ÿ±/âÑ¿XÕQ¹ðп9k¿ éÏ¿W¹¨m ÞÍ¿yx´Š4ÀË¿ÉißM+‘É¿AŸà|]RÇ¿²&æ–-Å¿_côù«Â¿õêÌ]EÀ¿~7ÎOT«»¿ûU Þº¶¿$=Jc¼±¿ºýeðe©¿Ø”\7ᆞ¿H¾¸^^„¿Øµ¸^^„?¤\7ᆞ?nûeðe©?<Jc¼±?ÚT Þº¶?a6ÎOT«»?uêÌ]EÀ?âbôù«Â?7&æ–-Å?½žà|]RÇ?HißM+‘É?üw´Š4ÀË?Þ¸¨m ÞÍ?Ðj¿ éÏ?%ÕQ¹ðÐ?Ü1Ÿ±/âÑ?ýü\”žÈÒ?”÷ÑÜw£Ó?Œe¸’4rÔ?[ÿ5U4Õ?õk béÕ?]PnpëÖ?a9 Š*×?O¯j"ßµ×?îÅ”2Ø?Æ" ^ Ø?Ƶ¬@÷þØ?ZÙû &NÙ?4Àv˜¹Ù?Ï°Š½Ù?´ ÙÖ{ÝÙ?¼HXyíÙ?ížà|]RÇ¿*=àÉ¿ö–SÍ]Ì¿úI\ Êο¹)㦑п ®Ë´Ñ¿ÞÛ:¨ËÒ¿£ðt×Ó¿·‹í×Ô¿15jpíÉÕ¿Ÿ]"åL¯Ö¿%ÝÕ®†×¿d7”mŽOØ¿ÌÃýÉo Ù¿é†óGà³Ù¿kô%ÊvNÚ¿ÜåïùÓØÚ¿ÁÓ"‚¢RÛ¿ÉU§C—»Û¿DuуqÜ¿^?LûYÜ¿^øƒtÜ¿GTzìx²Ü¿')ô 6ÄÜ¿))ô 6ÄÜ¿KTzìx²Ü¿eøƒtÜ¿g?LûYÜ¿OuуqÜ¿×U§C—»Û¿ÒÓ"‚¢RÛ¿îåïùÓØÚ¿€ô%ÊvNÚ¿‡óGà³Ù¿æÃýÉo Ù¿€7”mŽOØ¿/%ÝÕ®†×¿¿]"åL¯Ö¿S5jpíÉÕ¿:·‹í×Ô¿Êðt×Ó¿Ü:¨ËÒ¿5®Ë´Ñ¿å)㦑пRJ\ ÊοX –SÍ]Ì¿Ž=àÉ¿FŸà|]RÇ¿qˆÞH¶Ä¿¢Ò1n ¿9´2¶â²¾¿¥fôAú7¹¿ÉšJ;„­³¿+?ßÖ-¬¿-ùÈPDï ¿˜Ãuß¿´z&56‰ß¿¶z&56‰ß¿ÕŸ>Ãuß¿•Ä8PéNß¿u­Þ_À߿ֻ÷KlÇÞ¿I“GÅgÞ¿ê…1 ôÝ¿J¯¸†„nÝ¿†½xÕÖÜ¿å~ˆ\-Ü¿nEƒrÛ¿ùßo’¼¦Ú¿¼·†ÊÙ¿Èô޳gÞØ¿8Üõòâ׿îÕý÷ÂØÖ¿5a'ä{ÀÕ¿¤Ì!•ÊšÔ¿MP±+dhÓ¿´vàž*Ò¿TòuGsàпºÍðÏ¿i –SÍ]Ì¿ÞißM+‘É¿‰ÿ³Ä´Æ¿6àÔ6]Êÿ6ê%*ÁÓÀ¿ùmш¥»¿¿…g‚’µ¿>1ø9\䮿ƒ/qY¦¢¿.óéŒõň¿ëèéŒõň?ô,qY¦¢?s.ø9\ä®?Ÿ½…g‚’µ?¨÷mш¥»?ˆé%*ÁÓÀ?™ßÔ6]ÊÃ?ñ ÿ³Ä´Æ?HißM+‘É?É–SÍ]Ì?{ÿ¹ÍðÏ?òuGsàÐ?jvàž*Ò? P±+dhÓ?fÌ!•ÊšÔ?ö`'ä{ÀÕ?³Õý÷ÂØÖ?Üõòâ×?“ô޳gÞØ?ˆ·†ÊÙ?Êßo’¼¦Ú?ÚmEƒrÛ?Á~ˆ\-Ü?b½xÕÖÜ?+¯¸†„nÝ?Î…1 ôÝ?1“GÅgÞ?»÷KlÇÞ?g­Þ_Àß?ŠÄ8PéNß?ÏŸ>Ãuß?´z&56‰ß?5x´Š4ÀË¿ÿI\ Êο#òuGsàпcQûwQÒ¿‹"0·Ó¿ð”ûhÀÕ¿JÕgR]Ö¿Ÿ/qœ×¿ÇwìPÌØ¿<•";=íÙ¿ Pq-,þÚ¿r¯!puþÛ¿Ç<ôzíܿܚ‘P©ÊÝ¿j¤žx•Þ¿™9²DjMß¿jð Wòß¿W·îdAà¿l¿êñ࿱eªÐ5´à¿| òC-Þà¿ïåü”½ýà¿~urLÓá¿0´hiaá¿1´hiaá¿€urLÓá¿óåü”½ýà¿ òC-Þ࿸eªÐ5´à¿u¿êñà¿a·îdAà¿€ð Wòß¿³9²DjMß¿†¤žx•Þ¿úš‘P©ÊÝ¿?Ç<ôzíÜ¿–¯!puþÛ¿2Pq-,þÚ¿d•";=íÙ¿1ÇwìPÌØ¿Í/qœ×¿yÕgR]Ö¿"•ûhÀÕ¿¾"0·Ó¿—QûwQÒ¿]òuGsàпvJ\ ÊοŸx´Š4ÀË¿Ù+¦?¥È¿&­{Å¿‚rD°C¿É,Ýy ¾¿Þv³2j·¿bÁž$ê𿟴iL•&¤¿‡˜Y£ãŠ¿cY£ãŠ?Ù±iL•&¤?Þ¿ž$êð?]u³2j·?L+Ýy ¾?árD°CÂ?t%­{Å?`Ø+¦?¥È?üw´Š4ÀË?ÇI\ ÊÎ?òuGsàÐ?EQûwQÒ?n"0·Ó?Ü”ûhÀÕ?6ÕgR]Ö?ˆ/qœ×?ñÆwìPÌØ?'•";=íÙ?ùOq-,þÚ?]¯!puþÛ? Ç<ôzíÜ?Κ‘P©ÊÝ?_¤žx•Þ?9²DjMß?^ð Wòß?R·îdAà?h¿êñà?­eªÐ5´à?z òC-Þà?íåü”½ýà?}urLÓá?0´hiaá?¹¨m ÞÍ¿¿)㦑п‡vàž*Ò¿Ž"0·Ó¿Îo*Å28Õ¿³Ì¬Ö¿ÍEØ¿H;îo'iÙ¿ÄS´“°Ú¿ú $ŠçÛ¿Pµ÷J Ý¿†ö!!Þ¿qjC.b"ß¿Ðþàå7à¿Ó*’†[uà¿´ëªXØà¿ˆ|ëCò0á¿4+¯¯ñ~á¿jSõÒ&Âá¿á:húá¿éô·5“'⿲3Hè‹Iâ¿¶_=`â¿TìG›™kâ¿UìG›™k⿸_=`â¿¶3Hè‹Iâ¿ïô·5“'â¿ á:húá¿tSõÒ&Âá¿?+¯¯ñ~á¿”|ëCò0á¿ÁëªXØà¿â*’†[uà¿áþàå7à¿•jC.b"ß¿·†ö!!Þ¿.Pµ÷J Ý¿,ú $ŠçÛ¿@ÄS´“°Ú¿z;îo'iÙ¿FÍEØ¿èֿ̬p*Å28Õ¿Ç"0·Ó¿Ævàž*Ò¿ÿ)㦑п¹¨m ÞÍ¿2ǃ‡†Ê¿m{ɳ’Ç¿KÒÚ¿[¨Ã¿ˆAK5&À¿(/ö6r3¹¿°8X[F{sWÌ?Ðj¿ éÏ?û­Ë´Ñ? P±+dhÓ?Ü”ûhÀÕ?̬Ö?à§7¡9Ø?Ÿ_Ôó·Ù?yŒ-ˆ‰&Û?1nƒ§`„Ü?Î~æp¡ÐÝ?u0’û~ ß?}…ëÚ›à?„Þ=î ¢à?œkõ7!á?L˜«Ô•á?Š$¨˜ÿá?²B.C^â?›ò±™±â?Ím¥Íhùâ?¥â8„5ã?=7߯eã?µÑÿŠã?ª7R¢ã?áFõu®ã?HÕQ¹ðпïÛ:¨ËÒ¿‡Ì!•ÊšÔ¿ZÕgR]Ö¿!ÍEØ¿¸_Ôó·Ù¿lg\äûMÛ¿³6ô -ÓÜ¿\GÀD—F޿ͤU§ß¿ò„Gz࿈³‹é¹á¿îâ4¹¢¨á¿ xЧ/â¿^rýu«â¿TËÓ¿㿨&+@€ã¿Oa8LºØã¿Ú§ÿ÷$ä¿ûqÇdä¿p ˜ä¿Œ .¾ä¿ÛU°1KØä¿Ë,.åä¿Ë,.åä¿ÞU°1KØä¿Œ .¾ä¿w ˜ä¿ûqÇdä¿å§ÿ÷$ä¿\a8LºØã¿¶&+@€ã¿cËÓ¿ã¿orýu«â¿xЧ/â¿ã4¹¢¨á¿Ÿ³‹é¹á¿ „Gzà¿þ¤U§ß¿GÀD—FÞ¿ë6ô -ÓÜ¿¦g\äûMÛ¿ô_Ôó·Ù¿`ÍEØ¿šÕgR]Ö¿ÎÌ!•ÊšÔ¿8Ü:¨ËÒ¿‰ÕQ¹ðп¸æÑäοçlÈ9Ê¿—½uLÆ¿E›>éuQ¿QBA€@–¼¿ØÔÒów´¿]¢ š¨¿W|¦Šj¿‹u¦Šj?®Y¢ š¨?þÒÒów´?z@A€@–¼?]š>éuQÂ?±¼uLÆ?lÈ9Ê?íæÑäÎ?%ÕQ¹ðÐ?ÍÛ:¨ËÒ?fÌ!•ÊšÔ?6ÕgR]Ö?þÌEØ?Ÿ_Ôó·Ù?Sg\äûMÛ?˜6ô -ÓÜ?BGÀD—FÞ?´¤U§ß?ç„Gzà?|³‹é¹á?ãâ4¹¢¨á?xЧ/â?Wrýu«â?LËÓ¿ã?¡&+@€ã?Ja8LºØã?Õ§ÿ÷$ä?ûqÇdä?n ˜ä?Œ .¾ä?ÚU°1KØä?Ë,.åä?2Ÿ±/âÑ¿´ðt×Ó¿a'ä{ÀÕ¿¯/qœ×¿U;îo'iÙ¿“Œ-ˆ‰&Û¿²6ô -ÓÜ¿9"ï  nÞ¿5myã!öß¿.qBµà¿§íF+%eá¿YzÍõM â¿MV…V¤â¿©BÇÚß2ã¿ «0’µã¿s…,ä¿ê Ê#6–ä¿àµ8{ó俆tŽðDå¿¡Ðáv‡å¿Þ÷ÐÀ½å¿”Cû3<æå¿æ¹#iæ¿†Íæ¿†Íæ¿ æ¹#i濚Cû3<æå¿å÷ÐÀ½å¿ªÐáv‡å¿‘tŽðDå¿íµ8{óä¿ù Ê#6–促…,ä¿«0’µã¿½BÇÚß2ã¿MV…V¤â¿qzÍõM â¿ÀíF+%eá¿HqBµà¿lmyã!öß¿t"ï  nÞ¿ï6ô -Óܿӌ-ˆ‰&Û¿—;îo'iÙ¿ó/qœ×¿ca'ä{ÀÕ¿žðt×Ó¿D2Ÿ±/âÑ¿û½ƒ”ÇÃÏ¿æ˜r°˜¯Ë¿Î{»°VŠÇ¿> ÖVÿxÆ´°¸-¾¿‚¦©‹´›µ¿VA´¹ø©¿A·¾ T‘¿a:·¾ T‘?üRA´¹ø©?ޤ©‹´›µ?ˆÄ´°¸-¾?I ÖVÃ?Ûz»°VŠÇ? ˜r°˜¯Ë?%½ƒ”ÇÃÏ?Ü1Ÿ±/âÑ?ðt×Ó?ö`'ä{ÀÕ?ˆ/qœ×?0;îo'iÙ?yŒ-ˆ‰&Û?˜6ô -ÓÜ?"ï  nÞ?myã!öß?!qBµà?›íF+%eá?LzÍõM â?úLV…V¤â? BÇÚß2ã?«0’µã?k…,ä?ã Ê#6–ä?Úµ8{óä?€tŽðDå?Ðáv‡å?Û÷ÐÀ½å?’Cû3<æå?œæ¹#iæ?†Íæ?$ý\”žÈÒ¿*·‹í×Ô¿×Õý÷ÂØÖ¿ÇwìPÌØ¿"ÄS´“°Ú¿Mnƒ§`„Ü¿^GÀD—FÞ¿8myã!öß¿œnˆ/ûÈà¿ÜQ]‹Œá¿“^ºßHEâ¿'‡ÇÁòâ¿Ú_‹”ã¿€~ A*俼ÞÍH‡³ä¿¤í&, 0å¿«êyŸå¿ ! È”濨ÞQEVæ¿\ëc?ßœæ¿Åø¯Õæ¿eR~¶iç¿ËÑÏô翚õtÄ>+ç¿›õtÄ>+ç¿ÎÑÏôç¿kR~¶iç¿Íø¯Õæ¿fëc?ߜ濴ÞQEVæ¿.! Ȕ濻êyŸå¿µí&, 0å¿ÏÞÍH‡³ä¿€~ A*ä¿+Ú_‹”ã¿?‡ÇÁòâ¿­^ºßHEâ¿øQ]‹Œá¿¹nˆ/ûÈà¿vmyã!öß¿GÀD—FÞ¿nƒ§`„Ü¿hÄS´“°Ú¿aÇwìPÌØ¿&Öý÷ÂØÖ¿z·‹í×Ô¿ký\”žÈÒ¿Ürå ‰®Ð¿ã ÙUÍ¿Žæ+R©¹È¿ÅC×½OÄ¿®z9”²¿¿θ!²¶¿d ë_G«¿gö$S3’¿Üî$S3’?¢Œ ë_G«?›Î¸!²¶?¤x9”²¿?ÃB×½OÄ?å+R©¹È?ý ÙUÍ?lrå ‰®Ð?ýü\”žÈÒ?·‹í×Ô?³Õý÷ÂØÖ?ñÆwìPÌØ?ûÃS´“°Ú?1nƒ§`„Ü?BGÀD—FÞ?myã!öß?Žnˆ/ûÈà?ÎQ]‹Œá?†^ºßHEâ?‡ÇÁòâ?Ú_‹”ã?ü~ A*ä?´ÞÍH‡³ä?›í&, 0å?£êyŸå?! È”æ?¢ÞQEVæ?Wëc?ßœæ?Ãø¯Õæ?cR~¶iç?ÊÑÏôç?šõtÄ>+ç?¼÷ÑÜw£Ó¿G5jpíÉÕ¿%Üõòâ׿R•";=íÙ¿ú $ŠçÛ¿ë~æp¡ÐݿѤU§ß¿1qBµà¿ÞQ]‹Œá¿ÌÑ Yâ¿ZëIù'ã¿Q¾L†Ïã¿'º9K¬xä¿)vf…2å¿Ât'¸¤å¿÷mÛ­ä&æ¿Ú}Ðg›æ¿sÆ*´ùç¿ø—õ[Zç¿Í1wU¤ç¿åE5»ßç¿ýÆÍ®g è¿ca9W?*è¿Uã¿Æ/9è¿Wã¿Æ/9è¿fa9W?*è¿ÇÍ®g è¿ìE5»ßç¿×1wU¤ç¿˜õ[Zç¿Æ*´ùç¿ê}Ðg›æ¿ nÛ­ä&濱Ât'¸¤å¿>vf…2å¿>º9K¬xä¿j¾L†Ïã¿uëIù'ã¿ÌÑ Yâ¿üQ]‹Œá¿QqBµà¿¥U§ß¿1æp¡ÐÝ¿\ú $ŠçÛ¿œ•";=íÙ¿xÜõòâ׿›5jpíÉÕ¿øÑÜw£Ó¿à-«¶åpÑ¿a3„ã#gÎ¿Úæ;H¼ÙÉ¿§àWc<Å¿/ä£ñ‘À¿Œñ¢º·¿r^îL3…¬¿]ð<ø`“¿{è<ø`“?„ZîL3…¬?gñ¢º·?.ä£ñ‘À?šàWc<Å?Ðå;H¼ÙÉ?p2„ã#gÎ?k-«¶åpÑ?”÷ÑÜw£Ó? 5jpíÉÕ?Üõòâ×?'•";=íÙ?êù $ŠçÛ?Î~æp¡ÐÝ?´¤U§ß?!qBµà?ÎQ]‹Œá?ôËÑ Yâ?LëIù'ã?B¾L†Ïã?º9K¬xä?vf…2å?•Ât'¸¤å?îmÛ­ä&æ?Ò}Ðg›æ?lÆ*´ùç?ò—õ[Zç?È1wU¤ç?âE5»ßç?úÆÍ®g è?ba9W?*è?Uã¿Æ/9è?¶e¸’4rÔ¿·]"åL¯Ö¿ºô޳gÞØ¿%Pq-,þÚ¿Pµ÷J Ý¿“0’û~ ß¿õ„Gzà¿«íF+%eá¿–^ºßHEâ¿[ëIù'㿽+d/?ãã¿[r} ä¿dZSo-P忾ü/i#óå¿atêˆæ¿ÔÕÊË翾–ôwd‰ç¿°wR.ô翘þ æ1Pè¿ò¢ 7è¿ÕÛè¿áTÌÕ é¿†¨¼¥¢(é¿O„Y08é¿ O„Y08鿉¨¼¥¢(é¿çTÌÕ é¿ ÕÛ迊ò¢ 7迤þ æ1Pè¿¿wR.ôç¿Î–ôwd‰ç¿çÕÊËç¿utêˆæ¿Ôü/i#óå¿|ZSo-På¿vr} ä¿Ù+d/?ãã¿yëIù'㿵^ºßHEâ¿ÍíF+%eá¿„Gzà¿Ü0’û~ ß¿fPµ÷J Ý¿rPq-,þÚ¿õ޳gÞØ¿^"åL¯Ö¿f¸’4rÔ¿Ûž®-€(Ò¿·#rÜ1§Ï¿ye8éÝéÊ¿(ÒHÌðÆ¿–iÎ a@Á¿zðp5[´¸¿‚ ôÖo±­¿Þz‚²Ï“¿ÌÕz‚²Ï“?kôÖo±­??îp5[´¸?zhÎ a@Á?ÑHÌðÆ?cd8éÝéÊ?¼"rÜ1§Ï?až®-€(Ò?Œe¸’4rÔ?Ž]"åL¯Ö?“ô޳gÞØ?ùOq-,þÚ?ðOµ÷J Ý?u0’û~ ß?ç„Gzà?›íF+%eá?†^ºßHEâ?LëIù'ã?¯+d/?ãã?Lr} ä?WZSo-På?´ü/i#óå?Xtêˆæ?ËÕÊËç?µ–ôwd‰ç?©wR.ôç?‘þ æ1Pè?zò¢ 7è?ÕÛè?ÞTÌÕ é?…¨¼¥¢(é?O„Y08é?‡ÿ5U4Õ¿*%ÝÕ®†×¿±·†ÊÙ¿‹¯!puþÛ¿¦†ö!!Þ¿Œ…ëÚ›࿌³‹é¹á¿]zÍõM â¿)‡ÇÁòâ¿R¾L†Ïã¿[r} ä¿ÓÇjæcå¿ò`h›‰濞é`ÔŠÃæ¿ô† ‚^ç¿*.´ë翪L Ýhè¿âÎÓ©œ×è¿9Òÿ 7é¿Ï¼ßê†é¿|^­ Çé¿¶õ I÷鿞BØê¿Q8£'ê¿S8£'ê¿¡BØê¿“¶õ I÷é¿„^­ Çé¿Ú¼ßê†é¿FÒÿ 7é¿òÎÓ©œ×迼L Ýhè¿=.´ëç¿ † ‚^翵é`ÔŠÃæ¿ ah›‰æ¿îÇjæcå¿xr} ä¿q¾L†Ïã¿J‡ÇÁòâ¿€zÍõM â¿°³‹é¹ῲ…ëÚ›à¿õ†ö!!Þ¿Û¯!puþÛ¿ ‘·†ÊÙ¿…%ÝÕ®†×¿Øÿ5U4Õ¿JFÊçÔÒ¿è·ˆ0Ýiп`féË¿h¶&žÛíÆ¿RÃ,äÁ¿Ç%bêž¹¿ ñ0_\Ë®¿Üz03Ì‹”¿Yr03Ì‹”?ãì0_\Ë®?ÂÄ%bêž¹?,Ã,äÁ?Dµ&žÛíÆ?å `féË?f·ˆ0ÝiÐ?IFÊçÔÒ?[ÿ5U4Õ?ÿ$ÝÕ®†×?ˆ·†ÊÙ?]¯!puþÛ?z†ö!!Þ?}…ëÚ›à?|³‹é¹á?LzÍõM â?‡ÇÁòâ?B¾L†Ïã?Lr} ä?ÃÇjæcå?å`h›‰æ?“é`ÔŠÃæ?ë† ‚^ç? .´ëç?¡L Ýhè?ÛÎÓ©œ×è?2Òÿ 7é?ɼßê†é?y^­ Çé?жõ I÷é?œBØê?Q8£'ê?! k béÕ¿7”mŽOØ¿ôßo’¼¦Ú¿;Ç<ôzíÜ¿‹jC.b"ß¿”Þ=î ¢à¿óâ4¹¢¨á¿ MV…V¤â¿Ú_‹”ã¿*º9K¬xä¿fZSo-På¿õ`h›‰æ¿ WxD׿¿*t¾?è…ç¿ezž &è¿Ì†[\H·è¿OflæG9é¿3§M¹«é¿©EUê¿7ẵß`ê¿YžÎx%£ê¿9隷ýÔê¿Y"ºœIöê¿Ò·ôë¿Ô·ôë¿]"ºœIöê¿@隷ýÔê¿ažÎx%£ê¿Bẵß`ê¿(©EUê¿C§M¹«é¿aflæG9é¿á†[\H·è¿{zž &è¿Bt¾?è…ç¿'WxD׿¿ah›‰æ¿„ZSo-På¿Jº9K¬xä¿;Ú_‹”ã¿0MV…V¤â¿ã4¹¢¨á¿»Þ=î ¢à¿ÜjC.b"ß¿ŽÇ<ôzíÜ¿Pào’¼¦Ú¿Þ7”mŽOØ¿u k béÕ¿åÙ8²uÓ¿§¿L öп¿Àÿ¸×Ì¿/XSW¢±Ç¿\0kÂï|¿î¾a€¬yº¿«ªïKÒ¯¿ç‘¶:;•¿‰¶:;•?I¦ïKÒ¯?мa€¬yº?,/kÂï|Â?WSW¢±Ç?–¿ÿ¸×Ì?!¿L öÐ?bÙ8²uÓ?õk béÕ?U7”mŽOØ?Êßo’¼¦Ú? Ç<ôzíÜ?]jC.b"ß?„Þ=î ¢à?ãâ4¹¢¨á?úLV…V¤â?Ú_‹”ã?º9K¬xä?WZSo-På?å`h›‰æ?þVxD׿?t¾?è…ç?\zž &è?†[\H·è?FflæG9é?+§M¹«é?©EUê?1ẵß`ê?VžÎx%£ê?6隷ýÔê?X"ºœIöê?Ò·ôë?‹PnpëÖ¿îÃýÉo Ù¿nEƒrÛ¿þš‘P©ÊÝ¿àþàå7࿬kõ7!á¿xЧ/⿳BÇÚß2ã¿€~ A*ä¿0vf…2å¿Ãü/i#ó忤é`ÔŠÃæ¿.t¾?è…ç¿×‘ÌÃ9è¿듎®Þ迎JYÐBté¿WáR$ú鿉$B‚pê¿4¶±ŽÕ꿨n˜<*ë¿öθÐnë¿' “ &¢ë¿q´¥ŽpÄë¿ÞM›Õë¿àM›Õë¿t´¥ŽpÄë¿. “ &¢ë¿ÿθÐn뿳n˜<*ë¿B¶±ŽÕê¿™$B‚pê¿jáR$úé¿£JYÐBté¿듎®Þè¿ð‘ÌÃ9è¿It¾?è…ç¿Áé`ÔŠÃæ¿ãü/i#óå¿Qvf…2å¿1€~ A*ä¿ØBÇÚß2ã¿;xЧ/â¿Ôkõ7!á¿ ÿàå7à¿T›‘P©ÊÝ¿enEƒrÛ¿OÄýÉo Ù¿áPnpëÖ¿qO| Ô¿_FP±wÑ¿|Èm@´Í¿µ:D:ÌfÈ¿VgÔK ÿ2o(¦D»¿¤êöÒÌb°¿_QøÑÝ•¿PHøÑÝ•?cèöÒÌb°?»l(¦D»?gÔK Ã?€9D:ÌfÈ?JÇm@´Í?ÔEP±wÑ?˜~qO| Ô?]PnpëÖ?ÁÃýÉo Ù?ÚmEƒrÛ?Κ‘P©ÊÝ?Éþàå7à?œkõ7!á?xЧ/â? BÇÚß2ã?ü~ A*ä?vf…2å?´ü/i#óå?“é`ÔŠÃæ?t¾?è…ç?Ì‘ÌÃ9è?ù꓎®Þè?„JYÐBté?NáR$úé?$B‚pê?-¶±ŽÕê?¡n˜<*ë?òθÐnë?% “ &¢ë?o´¥ŽpÄë?ÞM›Õë?9 Š*׿‡óGà³Ù¿í~ˆ\-Ü¿‘¤žx•Þ¿ä*’†[uà¿]˜«Ô•á¿hrýu«â¿«0’µã¿ÆÞÍH‡³ä¿¦Ât'¸¤å¿htêˆæ¿ü† ‚^ç¿kzž &è¿듎®Þè¿û·pþû‡é¿ŒEA„Š!ê¿Å/lûªê¿TðÃòù#ë¿1y;Œë¿ð£S³ãë¿rÚ\Ï)ì¿)”—C^ì¿©ý%Šwì¿zÂÞò“ì¿|ÂÞò“ì¿­ý%Šwì¿0”—C^ì¿{Ú\Ï)ì¿ü£S³ãë¿!1y;Œë¿eðÃòù#ë¿Ø/lûªê¿¢EA„Š!꿸pþû‡é¿듎®Þ过zž &迆 ‚^翉têˆæ¿ÈÂt'¸¤å¿êÞÍH‡³ä¿=«0’µã¿rýu«â¿†˜«Ô•á¿+’†[uà¿è¤žx•Þ¿Oˆ\-Ü¿q‡óGà³Ù¿é9 Š*׿YyåJê’Ô¿³£ÛJšîÑ¿°åJv~ο ŒŒé É¿ðAíÊé‹Ã¿–dcû·ý»¿ü­.YÒ°¿VÐ,qir–¿ Ç,qir–?««.YÒ°?bcû·ý»?¯@íÊé‹Ã?b‹Œé É?uåJv~Î?%£ÛJšîÑ?ÎxåJê’Ô?a9 Š*×?߆óGà³Ù?Á~ˆ\-Ü?_¤žx•Þ?Ì*’†[uà?L˜«Ô•á?Wrýu«â?«0’µã?´ÞÍH‡³ä?•Ât'¸¤å?Xtêˆæ?ë† ‚^ç?\zž &è?ù꓎®Þè?ñ·pþû‡é?‚EA„Š!ê?»/lûªê?LðÃòù#ë? 1y;Œë?ê£S³ãë?oÚ\Ï)ì?'”—C^ì?§ý%Šwì?zÂÞò“ì?€¯j"ߵ׿ô%ÊvNÚ¿½xÕÖÜ¿À9²DjMß¿ÅëªXØà¿ŸŠ$¨˜ÿá¿]ËÓ¿ã¿~…,ä¿­í&, 0å¿ÿmÛ­ä&æ¿ÛÕÊËç¿1.´ëç¿Ò†[\H·è¿JYÐBt鿌EA„Š!ê¿3vFš´¾ê¿ˆTü$`Kë¿Mêc6Çë¿Þõê1ì¿Þqõ <‹ì¿#iP’òÒì¿óÍïMâí¿3¢;ûé,í¿Fª·aó>í¿Hª·aó>í¿7¢;ûé,í¿úÍïMâí¿,iP’òÒì¿êqõ <‹ì¿Þõê1ì¿_êc6Ç뿜Tü$`Kë¿IvFš´¾ê¿£EA„Š!ê¿©JYÐBté¿î†[\H·è¿P.´ëç¿üÕÊËç¿"nÛ­ä&æ¿Òí&, 0å¿¥…,ä¿…ËÓ¿ã¿ÉŠ$¨˜ÿá¿ñëªXØà¿:²DjMß¿ô½xÕÖÜ¿õô%ÊvNÚ¿Ú¯j"ߵ׿}^n¨Õ¿R¶]tZÒ¿Š ËÞ5Ï¿ê ŽÛ“£É¿”"̵yÄ¿âÂ়¿Ï­·„…7±¿†Ÿ•kù–¿–•kù–?p«·„…7±?LÀ়?K!̵yÄ?¥ ŽÛ“£É?H ËÞ5Ï?Àµ]tZÒ?ï]n¨Õ?O¯j"ßµ×?`ô%ÊvNÚ?b½xÕÖÜ?9²DjMß?­ëªXØà?Š$¨˜ÿá?LËÓ¿ã?k…,ä?›í&, 0å?îmÛ­ä&æ?ËÕÊËç? .´ëç?†[\H·è?„JYÐBté?‚EA„Š!ê?(vFš´¾ê?~Tü$`Kë?Eêc6Çë? Þõê1ì?Øqõ <‹ì?iP’òÒì?ðÍïMâí?1¢;ûé,í?Fª·aó>í?‡¾óG~Ž¿òË5¢™cŸ¿u¥ƒ³_¨¿è}½(Óɰ¿ÊyHdf›µ¿“°{/Ÿ˜º¿]«*µ¿¿¿dcr¿ÉÖt‘ Å¿æ¥ösx£Ç¿ŠAKm0Ê¿1" $­Ì¿Ú2KzÏ¿¬HÍîпr7QÇÔÂÑ¿žIGJÃÒ¿†áæ®­Ó¿Ž¨ŸŽÅÔ¿Gj-7Õ¿S²zFÓÕ¿ –xQÖ¿ð Á¶°Ö¿²(Ø÷ñÖ¿8-v|׿ô¯ÎJŒ׿ ˜Î”»îÖ¿ì¹²°7­Ö¿ ÀëLÖ¿ˆíTÍÕ¿[%½áí0Õ¿È]vÖxÔ¿¬,Ù¦Ó¿_óþgÿ¼Ò¿;s¼Û½Ñ¿*5MûüªÐ¿Z,CZçÏ¿¬?|/®Ì¿Ko¦7Ê¿³¡1Qi±Ç¿¹Kl"Å¿k ƒ·Â¿á]&àÀ¿¯a „÷º¿6q$8 ¶¿‚¾ëƒN±¿T'Ü ©¿ f6]+¡¿™±ÊË.’¿;./“bm¿Ë´Í<¯‚?§/4ó¼”?BCÑrõgž?æ9q £?€¢…Å=¦? v9-¨?^²[$þ©?Þø^ð©?[Îgcs¨?øÁ¤Œ¦?FRõ›…£?šÎ@;[ž?Ðqyˬ”?íNÐPž†‚?À>g+n¿\à´¤M’¿ëêBô¡¿’ÍP¬³¥©¿'G ©[±¿…²¨R¶¿ÀÊË1F»¿w8 …² À¿Ákýg,—¿If§¤ÿ'Å¿èînñµÇ¿.´¡³:Ê¿ÕÆ©°Ì¿[Ÿ’ÙÏ¿ UMªÐ¿@KÙ8ȻѿZ<™s:ºÒ¿/ˆÅ‘õ¢Ó¿"w¥%«sÔ¿jœÝB*Õ¿z'1ŠÜÄÕ¿4Xv ÎAÖ¿oó˜ŸÖ¿¹„H²ÐÜÖ¿ûÈ)`ÍûÖ¿ŠÎº [?>øµMþ|¿à_äÀš_˜¿•À ÀÿC¥¿7˜SàÒÅ®¿èœ´CÖN´¿¼Ùy¥Y¹¿×7|Ö˜v¾¿¾ª%¢ÌÁ¿@Ðc nZÄ¿b·I8aÞÆ¿L'£6CRÉ¿^ïé?°Ë¿¶Ê…PØñÍ¿2 п5šŸyÞÑ¿©uüßìÑ¿ºsáMà»Ò¿IÞ0fèpÓ¿L>߃> Ô¿-ç¿n†Ô¿*h8ðäÔ¿ûê^û5$Õ¿2aâéãAÕ¿f5®¤ˆ?Õ¿÷ä\/âÕ¿Ü úп ©Úú{ûÏ¿ƒÞÝÍ¿nØRKžË¿b¿O¶‰DÉ¿ì×Ï¥ÕÆ¿æc'WÄ¿ƒò‘ÐÁ¿r 9o¾¿„Ñ€—˜€¹¿×]÷‡´¿•úÇÂY¯¿ÀϾ/ü¥¿´#š |š¿ÒbýJ?‚¿(Šy'ã£y?f~ ¯?Ø÷æuû)«?ìõft0c¦?ÙY°ð¹Á ?t!Šæ’¦”?ý£?R&¤õóÆ¿þ¼0„É¿¯+MócìÊ¿ûòãÚɬ̿þ°›N?οr&š+úŸÏ¿rHY»¨eпI¦—2ßпŒ}šHp;Ñ¿\0uâ–yÑ¿}qý{šÑ¿•„ü@ȳ?Í­(íÆŸ¯?÷ß~q§?"Q4Š?Tÿ’ÄÀ†?Ž#„¸µ}¿eÎèö°š¿D’§§¿kl1u°¿=k£âhUµ¿vR ”’"º¿oÏîËо¿¾úAªÁ¿Äfq3GÑÿ°¿fV)ØÅ¿òŠYé¹Ç¿fº)’æqÉ¿òøÕéûÊ¿ô%²,TÌ¿\2ñÈfwÍ¿ˆâÔbο÷øêK¬Ï¿©2ÀëɌϿ=áß"çÂÏ¿áL•7´»Ï¿âzø|€}Ï¿Ê|L´ÒþοØ¤ÿsEοJÊl¥RÍ¿¦ùÍßÅ(Ì¿W'»ÊÊ¿š^òé;É¿’6†–.€Ç¿Æ6Kқſ‘éü“ÿ4vÉè:lÁ¿T±æÜŸV¾¿4<¯K“¬¹¿žêWÅå´¿9Iî °¿ùú1Üa¦¿+êdq¼j™¿>}ó=Špy¿¢·àgìrˆ?[Ãv(ž?VŸÚ¿¢§?%u (³¯?²8šd똳?T‚¯L@·?„ãͪ?8R3zü¡?A"ipò™‘?œkÔî¢ãS¿-`u…Q>”¿ÄñdIÞ¬£¿=ØíC1­¿ædpJ³¿«õ²?à·¿Kå‹ñµN¼¿{cÛ kEÀ¿îØ „ E¿¼È± H!Ä¿V’áwÕÅ¿Tr³âW]Ç¿Â&QîµÈ¿»=dbGÙÉ¿hÐ øÇÊ¿þÆIE|Ë¿!ÉÂ,÷Ë¿"&ÉT8Ì¿SÈG“"_¾?þÀÁ ²º?}Ž Ûc¾¶?ÝþûNȲ?b~E5U¬?WâBv@£?Ñ?Wæ“?FèÛnP?]ÜTVè‘¿Ó£ö*®^¢¿ 4F=¤«¿À݈•ÙV²¿ÚëEW²¶¿)ïQÐÙº¿Ž×™Gþ¿R9>ü!2Á¿|ä›SÚ¿kËi_VÄ¿,è告¡Å¿)kоÀ¹Æ¿4ð%aù›Ç¿œ &}uEÈ¿÷Á5m¹È¿¬Ð¼ÉúëÈ¿ð…ÿ:ãÈ¿ÃFDôå¥È¿ZÉÎIÖ)È¿;êTuÇ¿éK^ֈƿ_¯Œê[gÅ¿CmôÁxÄ¿à{ç_v¿À®è]âÀ¿¦qJ~ß¾¿¾†í5-(º¿xpнûµ¿ 7 Ó±¿\TccJ2ª¿ Qï·‘ñ ¿l1ÛRž@Ž¿|´ׯm?j…%–§q–?ÿÊAƒvr¤? WŽ$]q­?Ÿy] ɳ?jÐ5Óó3·?À—¤»?ÄyÚ«»¾?£ÿºnÁ?qÑñLƒÂ?¸SzÎÐÃ?Ñ“mÈëÄ?š/¾ŠÑÅ?x>è~ãÆ?8-ÊÖ)õÆ?ÇZÎU<0Ç?…ød0Ç?!«âÈõÆ?å¦b/Æ?:ÖEÓÅ?ù%÷íÄ?±k¤?Š-×±,J–?ðн&Ël?~í¿‰òeŽ¿f"âö ¿ÿ ¿b4ª¿¹÷H“±¿ûÆ&ekúµ¿Fy'mê%º¿ãv·¾¿äW{àÀ¿»¸\@Þ¿öo²6Ä¿gèðEcÅ¿^Þ Ž´ƒÆ¿²æäÉ­nÇ¿¢¹Š‡ß!È¿‹¥^›È¿ÀžÀUÜÈ¿2-”AW®Á?}ÛÃżÀ¿?ÛãV]ß»?2^>‘@·?ZtÕ2ªs³?ˆ×$¯ü­?©Î‡ƒÈÚ¤?2,d»0—?Œ8Œ$¼cr?&gí :Ç‹¿nô•€  ¿"XD ꨿hyÙ_·»°¿È)¸&BÏ´¿Yxœ¥¸¿«¬%)5¼¿¸†J¡Cu¿¿öÂþ ð.Á¿–› Šìs¿)®Óz†Ã¿7KE"ücÄ¿þ)A1¸ Å¿Lb´Ÿ {ſچˆÖ«Å¿Å1_¢Å¿xµ°Á‡eÅ¿ùÃèuåêÄ¿t§E»8Ä¿AüŸÏOÿLFî ¾2¿MŒ=Ì+äÀ¿Ž1Yï¨Î¾¿‚SX´È»¿î\VnÞã·¿TÉØGÌ´¿Ú[^2Ò¯¿†‚2±;§¿ÿûT¦L²œ¿êóŒg[…¿ =…½ÀÃ?Mÿöæouš?t™t£Ço¦?$Ï}*¯?ò•c_,´?#'yp¸?K¶Œ–}‚¼?ÎÍç,@,À?„¯(•ôÁ?ÀdŠ£æ•Ã?‰®@= Å?œÞ9Æ TÆ?•>j5/jÇ?ß”æLÈ?"uŽr÷È?\*v„ÇjÉ?“ìâí¤É?ºM5Œ2¥É?{³@ºkÉ? ´#Ï1ùÈ?&‡®Æ‡NÈ? 7ZZmÇ? p\ÆÇWÆ?wÏ­£kÅ?¸ˆg]WšÃ?ks‹? ùÁ?oÊóÝh0À?TÁ‘m‰¼?6é¾[µu¸?]ÀÕÜ&3´?ÿYp³%ƒ¯?ÍÕ bd¦?)ùS]hš?åšG²?/W…0}ý„¿Avq3¬œ¿A»¥>7§¿é0~%ͯ¿÷ѳ¬ ´¿éHá·¿ÔÇ5öö|»¿,×&²¾Ë¾¿~(w“âÀ¿^°Â•Ü0¿Á[‘nMÿp?Ét5Ä¿(Xž®™æÄ¿²}:ð_Å¿Y€ \ŸÅ¿o|ÃæÄ?|”ÕÀ@Â?‹ÓlYÀ?±ó»˜©¼?Vg3'Öo¸?ýÅ{´?wL5¡*¯?UNðn=¦? G FQí™?¼ç÷xŽ,?Äq°û„¿ÔÁN¿t›¿àN€}¦¿²È!}®¿°Ï‹è'Ѳ¿’ÕßAÑN¶¿4Î’˜f~¹¿l­Ö"X¼¿ Ør(ÅÔ¾¿°ïÏ„8wÀ¿‚'ŽýöOÁ¿Jæf/íñÁ¿H#2¢˜`¿$Vø½¥Â¿ËSÍ–ƒ…¿’×§³4I¿H8YÐÁ¿-|óJ[ Á¿3[“$;À¿jÇ×+E¾¿ÊA”Eò²»¿z?À·éŸ¿ü·ckI…µ¿J¶ð¡ù±¿š¥+`T¬¿JÝ¿ÜB¤¿?Ñ»mû¤—¿(8Îv¥¼x¿j',úa‡?ó1Ó ¾Ï?l£‹üg¨?­æ Zñ…°?ñ¤ö4ú´?žYäçÝQ¹?âÍÌš‚½?6÷¾åÁÀ?nµdX£Â?@íH‘cÄ?õ;ÏxýÅ?çÓ‹)mÇ?(‘&¯È?WÅÁæ_ÀÉ?x/‚?žÊ?ÖøéÖªFË?øŒÉñ¸Ë?Ö¿áQ>ñË?ˆö.ì¡ñË?¾ÙU¹Ë?f0½IË?%k Q”¡Ê?ÐnìÏ¡ÄÉ?¤ÒË’?´È?'\aürÇ?._]˜ÙÆ?ÎËοBjÄ?0':NªÂ?RèhEÇÀ?·4ÐÝž½?gƒ7Qè^¹?pW¢nµ?7 Èl…°?¨Ì€®ú¨?¸ {äÝ?BòÉ`†‡?H“ÄËcmx¿æ*G…}‘—¿vU¤¸:¤¿X·ƒ¤L¬¿Ècë"Pö±¿M™‹ƒµ¿’ûÓ2Ÿ¿îèEæ&³»¿„¯.< F¾¿T.TŒ¯;À¿”!µÖ» Á¿ÚùغÐÏÁ¿€’5 G¿úð!Ïä†Â¿2ÀÂ2Æ?íÓR`NvÄ?üò¬Jy˜Â?׫û{íÀ?Òýþ%9½?®zøMe͸?¶¶®ƒi´?¢‰+µgê¯?ºŠñÖÁù¦?S4/è,œ?]_[êcZ…?ÏdÂ0’€y¿üµ§ÇЖ¿Öº5Ãù=£¿á' ‰lª¿ T¹n?º°¿f;L%Ù³¿zQ¾µ£¶¿´¡÷¹¿o°¼7!»¿vN#ɼ¿­Å”‚¾¿O,ùùƒÝ¾¿[}’Ú68¿¿×Õ³·"¿¿ÄUA«¾¿>QY­-¼½¿©'ûb¼¿¿¯9^垺¿K»©#w¸¿{qÜ𵿧ã|û³¿¬’Īͻ¯¿ Ÿ~jè¿zÆáíG¡¿ºš3c·’¿2áÌõ7"a¿üÓ7ÉŽ?ñ¦@ôG ?lM©>W,©?âèÊ< ±?ñsÙ}µ?Ì`­ü-ݹ?ðáy’ ¾?žÉsÒÁ?ö1Ã?&¸£ÊžîÄ?jèù˜œ¦Æ?b†ý8È?ró§î¡É?Ì%‚áÞÊ?Tfd‡@êË?mÛóÄÌ?&˜:yiÍ?…ú†cÔØÍ?ÂETÎ?ìðžŸÎ?£\ú…ÚÍ? ­¶slÍ?ÜHŽ5QÈÌ? ²”è¯ïË?xB{ÕšäÊ?E~Úš”©É?n2:AÈ?Œ5æâ¯Æ?dccCøÄ?zŒÙ·Ã?¢'¤Jç'Á?á.Çžm5¾?}O~Òë¹?„~..„µ?óîly±?Ÿ‚ê‹!?©?pP¥rZ ?$$ûåKŽ?¬k«`¿ô@XqÊ›’¿0›©®›=¡¿]ÌD6½¨¿MIզݹ¯¿Isž_M³¿¢­¦°óµ¿"W•Ý|¸¿«ä©`¦º¿C¤™j¼¿ŽæPÆÄ½¿Uz€ý°¾¿e— Pß/¿¿.ú -51È?Ê_I­}Æ?iŒ9Öq©Ä?“g¶•¹Â? Åwªq±À?ØŸ0/½?®–Á”á¸?¶ål¿„´?¼’\#°?žA«C$’§?Š†ÐˆÐÿ?ÊH?óW—Š?Và'8uf¿‡öuª2'’¿ÐAÏ9öK ¿ƒ=i‚‰þ¦¿…¸¶ í¿£ÃNîÅH±¿¬Óqµª³¿ÞýßR­µ¿ü'¶~®K·¿—ÕË ‰€¸¿Ðä˜4;S¹¿_Ó+ ¥ª¹¿|<`Q”¹¿p’`È๿ˆfƒ$2¸¿ÔÐñWxݶ¿­«¿ÿÞ!µ¿g ‰ð¡³¿aéÍû‡°¿f­j«¿P¹.-…#¥¿õº )a—œ¿ qávÍ‹¿„óæ ékZ?ÄÀÊÙë‘?pX'@_¡?Mg¢Øæû©?™ðs<[±?…|Ô¼µ?Àêàx º?\`”´Fb¾?<_ˆHÁ?B!FHMÃ?×[¢–ü9Å?lMˆ#u Ç?ÌN(gºÈ?tnãDÊ?ÆÄÄò§Ë?þüß ÝÌ?²Z èOäÍ?ìwrlºÎ?8Oßa\Ï?Öz^IµÉÏ?SÓ:µƒÐ?Ɖ‰RØÐ?Lé‘ÎËÏ?Øýã»`Ï?$àzó:¿Î?r3ýêÍ?òw6‘MåÌ?R‰²¤°Ë?æl§äOÊ?å ñVÆÈ?&ï,”Ç?¤nü-…GÅ?])È™©ZÃ?`÷ˆãWÁ?þ^S™z¾?±!N†'º?îo¼(͵?×ê‚ãk±?Nl±Wãª?‰kói|¡?‘©*žs’?lï´HÄó\?ÕÎü“j“‹¿M²‹Ý‡œ¿&õtúK"¥¿A˜ˆÃ=p«¿0&,&⎰¿ LæIY³¿eó’Ð+0µ¿ÔÊNÇÂî¶¿¨²¥TIE¸¿F6¢/¹¿áËyº÷­¹¿]%¬÷¶þÉ?˜¶pÅ)TÈ?žãÑ–‰Æ?^Ž|úy£Ä?Ò)s<“¦Â?󯦸ڗÀ?lZ]]èø¼?¬bÀD³¸?ب pi´?°@ÜÐ&°?g'Óç§?ùºÄuŸ?lÈÊLÂb?8ŒscUwE?Ÿ2å9튿º‘ž’š¿¬gëC£¿F›xÃZœ¨¿1vìýjE­¿íżϙ°¿M¶Ò˜¦.²¿ä[Àœ\³¿ƒA€)´¿š8çÈ}´¿‹êK„Rf´¿\ŠÉà…ñ³¿ç»±H ³¿ 6†â=º±¿l?xðW°¿—ö¤Ò—ã«¿T}«u§¿hé*žIx¡¿:öÒÆgŸ–¿UùäJc‚¿/ƬFßt?N§=Žy”?`{â.7¢?Lq˘wª?³…•ît±??ç…]¯¼µ?»€žº?Cê ˆCN¾?E¤*–›AÁ?ƒJCžNÃ?!ò7é,IÅ?Ú´Bx,Ç?Âù·=êóÈ?<ßë 1›Ê?6ú²ŒIÌ?¤HïãˆyÍ?ú@[a¥©Î?Úò½d¾«Ï?7\2¯±>Ð?l§‰_MŽÐ?lSš ñÃÐ?ŽìƒeßÐ?Œ,²…ßÐ?f”T1ÅÐ?rê sÐ?Bé}ǾAÐ?XxÖ¯³Ï?þüåw³Î?./D…Í?w:½Õí+Ì?ašr’­ªÊ?@‰°¬ É?žyÜQÌ>Ç?1%Ÿd9\Å?ÝF&dÃ?å6(ÛSÁ?¨w Hh¾?ÙC%è"º?ó€îúÖµ?DE€Œ±?j @‹¡ª?¢M‰EÐZ¢?öP²”?˜±W/]u?«Å>çº5‚¿ h=øó›–¿Á"Yö€¡¿¡î £0§¿÷€PÝØ¬¿ËÕŰ¿½Ýls"Õ±¿E.ù“¡(³¿æÊ)7Û´¿½h¸9´¿®éü‡R™Ë?E¸l¦Â÷É?[6÷Û6È? Ž7&[Æ? ›6­ØhÄ?ÇÁšBeÂ?¾Í4‰FUÀ?áDPF|¼?T¼XI¸?ߺâr´?Ô;^#°?Œßzl¶¨?à½mšM ?\¬/Iç‘?*©Z7nLp?½i:£€¿^/HRKr”¿„jËæž¿Kà&Õ¤¿ÿ'€*6Ù§¿$gLðª¿'jŒ—5<­¿»®W¼Ì®¿ò+±Go¯¿Pß¹!Í>¯¿­ëØ#X®¿fѾ‰ìެ¿ò‹â`ü©¿Þ¡NøD¤¦¿3ÌjÙŽ¢¿ŒìuVŒ›¿¯/)ý«¿Ñ!ÊÀh]r¿)eÙ9ã'?¯™Æ]£µ–?Oý“ž’Õ¢?ЇÞñ§ª?_ryài_±?æY¸<ƒµ?È鮕Xµ¹?l·ƒë½?’àŠ-¾ Á?\ψÃ?ÜF‚ Å?0“ƒA›Ç?D?±AJêÈ?¨­¨Ê?PÏu°ˆGÌ?W%NïÂÍ?qŒ*—HÏ?ÕWù”® Ð?èN®¶-ŸÐ?šÉÛïïÑ?n,ÁýSÑ?˜jÚ'šˆÑ?Þê[K£Ñ?Ì÷vãÑ?ÿj ŠÑ?Ñn¨sVÑ?’·Ëˆq Ñ?ÊØ‹¥Å£Ð?¼ãkj&Ð?4Âvb'%Ï?­¡ðTÓÍ?ÌÐÕŽZÌ?Œ‹N4S¾Ê?æz±KÉ?w-Qz*Ç?ϯey=Å?³…ÿ7˜7Ã?ðø~!Á?¤™KÚ¾?‚„à*Ù¹?›¹V«£µ?ÔF¥Þ{±?*¬zêûת?bÏh‰äû¢?,yóÿí–? ÿæh?Â(»D?r¿ˆ¢ë•¿¿²ácþ]½›¿¾á\6;·¢¿ªkí‚ݦ¿fóìèFª¿âu¾òÑ鬿]7MÚ¼®¿óœïµú#*⣿Ä÷Òûi[¡¿ø°Ã{&œ¿"½5v#”¿?”–Ží‚…¿`‘8Áú‡¿–µªº\€‡?$jd;¨¨˜?¾S‡§&A£?~01€Ÿ•ª?=çóê±?"*;ˉµ?êËQL%¹?°¯:nA½?¦—˜æ°À?ĆP| ¾Â?6ù#s"ÃÄ?¼Ê¼ƒH»Æ?Öz¸ð²¡È?WcÂÆÄqÊ?Ý0ìý'Ì?’øiˆ½Í?‹o+ <1Ï?î’ ÓW?Ð? ð.ø]ÑÐ?ÝJ¤dOMÑ?ÖIJÑ? Åê¬þÑ?F™}22Ò?hÊ»'FLÒ?ˆAdÑLÒ?<O–´3Ò?ØXou@Ò?P¿v\îµÑ?jsjþ{RÑ?¿Lá×Ð?Ä.àPGÐ?È`Ú`DÏ?ò—Fö5ÔÍ?x§—#ªAÌ?–Û"oÊ?¼­Q’ÄÈ?Ì9ÕqãÆ?öooçÄ?Î5AÏ[ÚÂ?¤ «ËÀ?ž( q½?~55]O¹?b¦"lc;µ?‚øäÆú>±?À2¨ä~Ǫ?œõïñe£?ý  Ù Ö˜?+ö“õï‡?°;‹æ%¿¯„gx/ò…¿³¦Nì„”¿<´´œ¿APÞ»¡¿ƒ×ÑJ]¤¿A_¼5¦¿Rø#‡<>§¿”vvHñ0Î?Tøä?¡Ì?œœ‰%ŽóÊ?ß ~’,É?g( (DOÇ?œkÉaÅ?ëd|ÆuhÃ?»dÊn8hÁ?+Dõ!̾?‚[Ó¶κ?(è¤à¶?‚æ ³?;Éê·®?lÄPèd¯§? Ëc€¡?T¶oç±á•?¯4{&šf…?l£ÒV”±F?uC8û¿d1v÷l¨Ž¿^Ayˆ8•¿±È9¸˜™¿³þ8‘œ¿Ä`¶è¿¿Pƒw\‚Z¿4S½ø™›¿²…ó(&˜¿|Þ—Ý¥0“¿ä¡T‰¿ ˜^Q–s¿þZÎJj3q?ÐÞÁu€?õÎ#ñZš?ÐL¬J€£?Ñ6™Iª?àèÚ%­»°?pÓ¶½|´?±H¾G—^¸?ÝðDóÂW¼?“"õaI/À?½ô¤œ4Â?– ³ð6Ä?é>éc1Æ?çÛj_%È?(냈ûÉ?ì`óvÂË?eâéVnÍ?ÆùK¶eüÎ?Ê|>R84Ð?:‘–?ƒ×Ð?†°¯ˆfÑ?œ²˜ïßÑ? ]G‘BÒ?™Û ‚Ò?ª{® ÀÒ?Ê ÎEÁÙÒ?ü•Èb]ÚÒ?¹áØÁÒ?bwh „Ò?ïø°³ÛFÒ?ÒX r›åÑ?<úkG¹mÑ?ÞßfàÐ?üû ?Ð?Š«±ø‘Ï?ÑZ‘øÍ?ˆâû׫èË?ÏKâ¶)Ê? 9UÈ?ìH~`bÆ?ŒTÕ=Æ[Ä?g¨ŸA=UÂ?l($.LÀ?²âм?GI¨ìsЏ?<+Ú©¡´?Rä$ùjÙ°?DnÑ“ouª?«ãº\œ£?Ù±dÚÁoš?˜*ñºS\?¶’- ¨=p?Ý…–Å‹Pu¿ØiôFUÏŠ¿–ÙC”¿¶“Zþ^™¿`tNË+¿ðåð„mŸ¿â`ÂV-Ï? ޾Cn¦Í?ìÔ§X0Ì?g?ºDÊ?³äZõhrÈ?ë+ËÆ?Ma|Ô˜¡Ä?;¡¿¼¥¬Â?í᣼յÀ?p`7è „½?7š¿ j¬¹?‚}ÑÜîµ?–½å+ŠR²?q½î`Å­?9 3]7N§?zT3ªO¡?I™òg:±—?÷‰¼ƒÚ‹?0!‹LŽ®u?è³à½¦è[¿3‡Úžþ}¿ÔG2~ ˆ‡¿Rþºq¼S¿í”9𿃪“%ÑŽ¿àT¼ô#^‹¿ç/t–„¿‰÷¸u¿#”šf7L?½0àý(?‰ƒ“d—‘?I…8…WÔ›?%wå#™£? ´Ê©?ª=G·Ü7°?ŽTåý»³?yîX±&i·?‹:¯b6»?_p m¿?¦\ç…Á?ŸLev€Ã?r5õxÅ?ŒºµÆøgÇ?WdmpKÉ?‚‡ÖuäË?ON®6êÚÌ?cUdpJ~Î?ÄÐá~Ð?‘ñô A´Ð?‰Înœ%TÑ?#tœ1àÑ?¶ÛƒÈWÒ?/ÊVª·Ò?»[×Ó?N& ’2Ó?ÈZeÉKÓ?l qLÓ?XCÖh4Ó?»úÄlCÓ?×Ýv:¼Ò?cMÝ`]Ò?˜ltãçÑ?ê9MO¸]Ñ?£ï± ÀÐ?sÖmƒÐ?Ê&ÆÃ*¢Î? Î?ÈøÍ?ûKÈ¢¦TË?ipA_É?‘è÷XS¥Ç?ðð>Ê^¦Å?Ò®y6A¨Ã?éÈs€–¨Á?L˜â\ÓV¿?ÍU‹Zj»?hϵOÏ”·?·‹µà,ß³?H‡¡3R°?á.ì©?þ[}e«¦£?&ÿ9ŸÎ›?„±_Ë T‘?y>pÒA1€?Û}ßV×!?\æx…ñy¿ž ÊM‚€‡¿uJ™éS¿:_Qµ'’¿ŠmäoŽõÏ?R¾;hGwÎ?©Ï)ÇPÜÌ?6Ûã±(Ë?fÏË«`É?ÎýÜ'·ˆÇ?ˆBŠZp¥Å?žn2»Ã?ÁkT4ßÏÁ?%ë :Sο?Ò?šuž³Ò?LJ n¬Ó?* ŒYÓ?„i¬ ŠÓ?ÌßL&Á¢Ó?Í‘o£Ó?°gß? ŒÓ?ÎݲhÜ\Ó?0ªh‰dÓ?€?@•X¹Ò?DWFd¨FÒ?deÿ~¿Ñ?'î²KC%Ñ?ÿ6D›yÐ?¨òyTà|Ï? Öæ:³ëÍ?9=ÿÃBÌ?ŒŒ! ß‚Ê?µ‚aë<¦È?^ðÆTx´Æ?ÂõÎ:ÀÄ?H­§œÊÂ?òAX×À?Ðí|qqÖ½?âý tWº?äzq¶?’NB±fö²?jÙd.¢V¯?\3Ü›í/©?#$ùo‡£?QXËEØÑœ?J‰Ó‡ùÁ“?ÖŒZæ¥â‡?? e’,·u? &òºW/? &m¥m¿0ú†“>Hx¿} h„EÐ?Lˆ™ô.Ï?ø[œGƒÍ?bâ@ÙË?§«18HÊ?‡KjºMÈ?BSÆÔuÆ?¡ì²Ú–Ä?1vCè+µÂ?˜Xk=×À?¦29Ǿ?ÈZeimº?ä ö²Lú¶?–“÷ ±³?XÅÖÝÒ™°?Àé&õªx«?l±0f?¦?PϕӔ¡?æºê¡ ›?—Z*nK1”?y,ú;f?$ì!ìC…?ÍqÕO¶}?lò¸Y•,{?È ÙtQÅ|?NÚ»·?Ðé÷q{=ˆ?Í|ãýÊ?êˆ!¶Ú–?Œž±ö<ž?ì¦máp£?câ{€¢Y¨?ñIÄ_¿Ì­?Jq1ptÞ±?Àçn[Ð µ?*²a—®l¸?¦ùæ¯×ò»?f念—¿?mc¸4©Á?zYôÔïŒÃ?èUVÕsrÅ?Æ<±$UÇ?°%ém0É?t›Þ ÍÿÊ?"s±‡ß¾Ì?~ZïugiÎ?Þ@é§[ûÏ?ÔÏt>w¸Ð? ÒKcÑ?vøpQŽüÑ?ý4 OÌ‚Ò?¤­ÁôÒ?çÓ¯[QÓ?©ë§ ¼—Ó?0þ8ÇÓ?ùÉÕ pßÓ?ávàÓ?‘@Õ=ÉÓ?(ƒ¸N›Ó?k?-VÓ?¦O›%ûÒ?ÏœmÀŠÒ?=«G5hÒ?“Œ ýUoÑ?tùéòÇÐ?矨gÐ?€¢Få”Î?a'`ÍñÌ?˜^HÐA7Ë?ÍÊÎx7eÉ?žÏèÅ(ƒÇ?·ÏÍj¤šÅ?PÀ+°Ã?“‰¦ÇÁ?~ÏzO’Ë¿?c âµ¼?’OƒÝ[ޏ?ùÿ(ì%µ?¬ rì±?Àõ£ Ó­?hB~¾gH¨?8Ú~¿E£?þYØË¬?ð„Tú–?_ÚS_Y?„§}vÛJ…?OÙYÚ{?2¶6pTFs?‡ªSòwÐ?šÒe7‚Ï?[œcùÍ?:çjaXÌ?½]”Ü&¤Ê?êFI`­àÈ?¾ë²'_Ç?)(ÔÀ=Å?ƒ[fgÃ?zå…cæ“Á?ãc›@¢¿?Õ/õ2E¼?ù}•Xq¯¸?Ž%üîxµ?}¨°â¢r²?ÄPübJ¯?½nUg.ª?þ#zµ ž¥?Л@9¥¤¡?ìã¼0˜œ?n¶Fem9—?¹Aì ?“?·¬j?˳ü?bÒ¶oàÉ?qÐUB¤‡‘?4ÄøÌÀ¹”?ú„²“M™?¨ÝIž<Ÿ?Ÿ˜îs-<£?u¼C·w§?¼ÄÐF¬?ˆ±çD ΰ?ú¶!:¶³?ÔÚ9¤‡Ô¶?EÊï[W!º?IŒž”½?`Võú’À?¨WWfÂ?ÙBü¥ò?Ä?ÄšŽ NÆ?¡ÒC æóÇ?ü×É>ÅÉ?ÃJ˜îŠË?ନ@Í?˜Ç{†GâÎ?Lç5yë5Ð?V8¨ËÎìÐ?ø‚ù”Ñ?Š%:Z#*Ò?ä4¬/•­Ò?Ú-ˆ+Ó?,2~ØwÓ?ª+ôA¼Ó?bÛ§†CëÓ?î»múÔ?kž¢²¦Ô?¯^k?íÓ?4uó ÀÓ?~#‹€|Ó?Ø{fÀJ#Ó?7ìU¢LµÒ?¾î/U›3Ò?N0>}ŸÑ?eyÇQdúÐ?•¬ËƒåEÐ?%ߎQÏ?ÚÕ²NmjÍ?ŠÂl F·Ë? 5xî]ðÉ?’‹íJÈ?*¾’ú…>Æ?§žl_Ä?j7$ÀFÂ? 83É©À?®hß+ѹ½?~ÈŠÙ=º?×t½ôðç¶?8˜À³?ʱÿm‰Í°?€vžç.¬?Î2²3H§?H<4ûNò¢?3ËìÝFnž?ugŠÌW>˜?iÌÒUc“?@…È”vÎ?B¤kM4ö‹?WX{t“Ð?܆¦;ÁÏ?¶ð%çq@Î?ˆåÓl±¨Ì?Zèú—×ýÊ?ÂÈ*{DÉ?­Dí°Ç?<œ.­!µÅ?ÜxðKÞèÃ?2 ódÂ?I¢q*,]À?îÔ k/M½?§ÛVMÛÿ¹?öთڶ?4 ñ—:å³?ýš¹"'±?~n;?GN­?˜²ƒëÖ¨?J÷èNó¤?d¼ný­¡?Ëÿpaþž?Àpåˆ4š?汃´9’—?wñŒj“Š–?p –yí–?²„ 7ˆ˜?3öÔ©›?a ?qiÓYú¢?ˆº'6…¦?H<ß©ª?è;É\Ù^¯?]Å 9L²?º]Á-õ$µ?bÒÕ°2¸?c:øm»?uˆÊßíξ?9M‚«&Á?å¡ZKYðÂ?™Ø¥æ&ÀÄ?Qõuœ¬‘Æ?žgb`È?œD×.:(Ê?f>Fo‹äË?&…¦¯<‘Í?ºx§2>*Ï?’b=ØUÐ?$¢¸ÒöÑ?Õ!`ɬÑ?rÝÀ®Â?Ò?À~°$€ÀÒ?bG‡Ê-Ó?Ô>š†Ó?¸!žôÊÓ?\È ¯¦÷Ó?6»ª¾ÞÔ?¦æ‘ ƒÔ?w‡À-ùÓ?`XnßAÍÓ?‹o‹Ó?T¥‡¢3Ó?”þÕÄÎÇÒ?ãÈüp¢HÒ?N;ÎîU·Ñ?ècÌ7JÑ?v7/ãdÐ?’H¤!JÏ?]×¼!´Í?x§:öÌ?׺¡ÙLÊ?íZ¦pþÈ?|Tà °Æ?`z9ÛÄ?¼¬ÛÃ?šDÂ=x:Á?å«ÒÍî¾? ðXgÃ…»?Öš£TúA¸?N†ì•>+µ?xúÞhìH²?|›>½C¯?šs]µ¼xª?²ÜY/<¦?C=rÿ$˜¢?!tFß*Ÿ?óðN³¨wš?‰„É6» —?8…"åV•?ŠÉ²]¾™Ð?hÚsÈ4ÕÏ?l½#F \Î?¥7(oÍÌ?¦Êž‹‰+Ë?ÎÎÅÞ{É?ß°ä˜ÀÇ?^<Êš'ÿÅ?°cTƒ<Ä?£í¯Ê—|Â?† šÃÃÀ?¿?Æ0àlk¼?P^˜ÝE9¹? ÇA93¶?ƒ•_œ`³?[`Nø2Ȱ?sˆL¢kà¬?z'ø¼¨?Tʰ'â.¥?«UÆt=@¢?Âé“ÀðŸ?…—õ·œ?I¢èA›?ݔՌÐ?ï¿* ÂÏ?ÿÌ”’QÎ?ôØzÊÌ?ê­„b 1Ë?†.K‰É?¼}à-X×Ç?t¾}×qÆ?ú<”ãeÄ?û1Îxü®Â?6¡åkÿÀ?Ð>Áñb´¾?G5w­:‰»?’²‚tv„¸?››¬œ­µ?lëÒM¾ ³?âÓk¥°?T©ð7­?¢~æME©?ð¸œÐc ¦?RtòƒNš£?º×M¡h»¡?T3·?Ïw ?&µyÊïŸ?Ò¸”:,& ?oj¡)”ë ?|þ,2‰k¢?>erÒ‘¤?°k¢×K[§?¢ÄBp-Áª?D!Ë!0»®?êàªCÑŸ±?c›À!´?ä½eIݶ?tÐÍÁ˹?*Tß0æ¼?Ø»yŠBÀ?\$e­¿Á? ]eÚ-wÃ?¸>µ–4Å?™¼å¬óÆ?0u}/°È?|=ΦèeÊ?‹aŒ=°Ì?΃jþy¬Í?‚«x^5Ï?Æw>ÒSÐ?ÔåÿÐ?VU¡FÑ?@º©y*Ò?ú®òQ(¦Ò?ÛHqp'Ó?ƒª[_ydÓ?ö_ÀP¥Ó?vµ¨×ÑÓ?¾y­ùTçÓ?é¼ÓßçÓ?¶8¤h´ÒÓ?â¢`¦¨Ó?|Ê&Á[hÓ?:œÜ0Ó?¼_kš^¬Ò?fU8á1Ò?ºÓðýߥÑ?ˆ B© Ñ?ª®­^Ð?âJ¹ÒõLÏ?YùõlÅÍ?´sß:*Ì? þÊ?Ø{#à9ÈÈ?(F¨âã Ç?rÊÔkƒHÅ?‹›IîvˆÃ?ÇJw ÎÁ?pÐÐ|{À?cí¼õ¼??ˆ RÔ¹?•ºÁXHÞ¶?(ñâô?Îæ˜þo±?»™⊮?W/R•³~ª?z°ÓÜG§?µ`EPZ*¤?2Ü({pò¡?œ‰U"Õb ?4æ.N"Ÿ?v:ÖõnÐ? 2ÇvnÏ?Ky+Š©#Î?Iˆè&¤Ì?ES”¦Ë?~Û)!sÉ?ð>ö×ÉÇ?HćÆ?' PiÄ?#·Â‡ºÂ?¦Û7ÓÁ?[þCì¾?ñHƒWл?oKy;Ú¸?ˆå7¶?Sɘí{³?Åù‚!±?4»¾©þ ®?üåIˆ¶bª?,ªà1zL§?:Yÿ øÑ¤?×ê6IPû¢?† ô„½¡?Íæ×6§>¡?T¸±žÊj¡?fTA;,¢?U.¼¤£?'1¸q¿¥?Àg’'z¨?ºˆ†d¿Î«?µ”xë´´¯?4…tD²?eVïí·†´?&B_ƒ¶4·?fO¾¸º?näùº½?T’*'À?`%>cÌÁ?d¥€ä…{Ã?ÝH7'y0Å?7aDççÆ?ïMb1›È?…çU§HÊ?8 dëË?Z >=nÍ?=#z¼ðÏ?ÜÓ<×!6Ð?|D|µúÞÐ?X.«giyÑ?Þ†~÷Ò?ZWe8U}Ò?J›w±\äÒ?–²8Ó?´Hÿ[³wÓ?8eˆ¶ž¢Ó?Deq¸Ó?æ{Ëí¸Ó?³¹Õ¤Ó?œn’¢7zÓ?ä°½ ;Ó?ŒñŽñèÒ?”i,%ó‚Ò?ˆâùTœ Ò?0žQ†Ñ?~ö>’çÐ?c£È?“?Ð?d4ù8Ï?ô¬y©”Í?<ŽûÌ?v…fÉï]Ê?ÚX²…¯È?¶±îËéùÆ?ô,·T\AÅ?rñÆŠÃ?]{_SiØÁ?üçnX_0À?`Ôa,½?Å9ì☺?²ÐâÀ3·? L²“~´?ÍVߢ²?8i÷…¯?lWºû5«?r¨¤:Ë+¨?Çên@a¥?:¯k–Ó7£?ÎÔ}R}³¡?¾`_Ì#è ?åKí.œBÐ?¡/½ûæ:Ï?àä)ÏÁ×Í?„Ù"®A_Ì?¶6;xÕÊ?£›×=É?f¾“;›Ç?ŽA›ŸóÅ?/ÉaJÄ?sH‰–§£Â?_¿Á?Ò|lPܾ?‚f¸ÆÎ»?‹Í~kæ¸?žâB•)¶?<¶ŠýŸ³?\¤N¨O±?ËŸ¯|®?bcâª?‰ð@bÙ§?ÇÔîÏ:i¥?ªÄáÍ™£?&föºa¢?£ §ôÄâ¡?_ï¼h ¢?+a :ÚÉ¢?mI 9¤?MýÍI¦? 5xa=÷¨?N˜—Vp;¬?H"å­:°?˜Cœ~3²?šh{Ý6´?ÞF#ƒ>·?šžÙ‘ùº?èá¼¹ ½?ÐfZ½À?C—ÔO´Á?±á§¥[Ã?A¦·Å?ížZq·Æ? pi¡ºcÈ?K#¢ Ê?f]¯Ä¤Ë?üÜ“œ1Í?Oì¯0C¬Î?O½(‘Ð?¢«Tk®Ð?,‹oFÑ?µL7ÎÑ?Š8¸nEÒ?s뽟¢ªÒ?¡+^ÍÝüÒ?ð7 ‚Y;Ó?\s2-~eÓ?º·éæzÓ?Q’»U{Ó?~°¯—ÕfÓ?™o4 =Ó?ÇW3Ó?¨:ŠV®Ò?ñ‘;vJÒ?lUå% ÔÑ?ÇÓç¶ÜLÑ?…ì ¶ïµÐ?+2°ÀÐ?ð÷ͯ½Î?*çuQ³CÍ?tNIå·Ë?:•Ì|Ê?b"¬ŒãtÈ?ät¬RÇÆ?æÖíÅ?Î^ø ÛgÃ?º†U>¾Á?VJ×'À?MH "½?/Àªº?8î"Æó;·?d1>Ê;”´?¦g­åÜ#²?Ñ)`å–á¯?c ġ٬?\Ç…¦¯¨?0Z˜ì¨ô¥?ü®ÃØ£?ãÑ’-c^¢?d§Ð뺘¡?Ñ$Zùƒ Ð?zp ¢UÐÎ?g½~8sÍ?¬©Ý‘Ì?6{á–}Ê?¯ÞLHvìÈ?hJf¤QÇ?Ó°1!±Å?³‹ ýÄ?Æ%¶ÂJoÂ?îS¨ñÖÀ?:b;»Ž¾?¶«{¢Ž»?¡tøx±¸?9g³aD¶?wƒ­³?ožÇ&:±? Í>b®?j­%"Öª?EËØ§?¶p ”ªq¥?(Ð×Úc¨£?j ùVt¢?Òœ±Ã¯õ¡?c—ýy¢?I TýéÕ¢?Wfñˆå=¤?àg& ÀC¦?nÄCGä¨?έ¬?g5xÚ¯?ÂÇј²?Õv(§qn´?Ø0Äÿ·?²)ð·óɹ?dlu¦Œ¹¼?ª”ÐU¡Ë¿?¥ÝÌZ|Á?IU*ö…Ã?Æý 0\ÂÄ?@1#ýÙiÆ?€"#øÈ?"|µ­É?Øóæ± BË?FªºÑaÈÌ?+ø¡Ã<Î?%õœ¼›Ï?ëwÁûpÐ?j_³-Ñ?Ý£<š ŒÑ?rBJÒ?7™¦åÒdÒ?¼Änß±µÒ?(­C,#óÒ?l(I‘Ó?/þq—1Ó?àßBWû1Ó?®¶½ÅÓ?äo‹´-õÒ?·"2¸Ò?O,™Õ€hÒ?7eê¬ÁÒ?ðlA‘Ñ?Lÿã¼ Ñ?¨˜ Z‡wÐ?ãÆLýá©Ï?¢8Jr´KÎ?‰QçÊ×Ì?&ÉùÀ QË?e‡šã¼É?noRßiÈ?WÌ^-wÆ?|¼^9ÎÄ?˜ñz &Ã?ÂQ8¤p„Á?6s£ŽQ׿?a¯J^À¼?®7¶‘˹?”<€ ·?úÖµÛd´?Q­Y~ ²?†ðo””¯¯?®IâLâ«?ZõNÍ¡¨?V%Ð}4ö¥?cLp?æ£?r,Šu¢?T¦]œµ¡? Ïͺ“Ï?Òç´‹kSÎ?z5±ûÌ?jÁW²DË?P*÷ï²Ê?ubxð´†È?ýùßp$òÆ?˜E ¯òWÅ?“Q‘¼Ã?hà°ª"Â?)ÐZ“À?e7uX‰ ¾?Ô˪!»?Š“¼;MF¸?Ò' ”Ÿµ?"Ü)³?’ŽLê°?Xô$¼ôЭ?F ÚQª?bù`ô¿]§?U);þ¤?L~Ðwô9£?3ã ’E ¢?Y\^°9Š¡?[^ûÜÔ­¡?âO#¼Lc¢?^BaÃã?¦ù˜à¿¥?OÍNê_T¨?89{«?`®Â½,¯?jÊ’ñX¯±?Ò1¢D´?Ì"¼u¶?¼bGT·I¹?õiäjc-¼?ÈšX3¿?>ô[ü¹)Á?îмlÃÂ?5¾E½bÄ?ÑüÊr¶Æ?ºÎ#Ù`¢Ç?º3æÉ:É?*/ôÁÉÊ?.Qr‚eIÌ?¬ùÃ]&¸Í?ñ“ñˆÔÏ?ÝnU“)Ð?u°2h‡¼Ð?Ì·ç`@Ñ?¿Ÿ1ß³Ñ?äý»èÒ?¶Ÿ5†eÒ?ê`•½¢Ò?PE¤·ÛÊÒ?’ðBЉßÒ?ø¨QºâßÒ?ˆÁ ÉíËÒ?´†Çâ£Ò?R…ÂÅhÒ?iöÏÃ*Ò?Í v:Ï·Ñ?܉ÖôDÑ?:æ‡ë°ÁÐ?$¤¦»?/Ð?*nšÏ?nÕ½ÁîÄÍ?s®€VÌ?J\¢+ÖÊ?¤¼î‘GÉ?`ÔŒ}®Ç?K ÐÓÆ?, 6lÄ?Þî÷¢¯ËÂ?Š3®10Á?;B<¿?irA`û1¼?Žvã@ªI¹?èçî®.ж?Ɇ1”?ú³?&wðQ! ±?ñÞ.¯?lû¾Æ®G«?;ìßø¨?b‚Røx¥?‚½Aª8t£?ºº\L ¢?OíYÓÄP¡?‰®7dÏ?r°ˆÊÍ?#ÄewÌ?6SÚë™Ë?©'ð3—É?¸Þ/ŠÈ?db&h‚Æ?#ö°íÄ?߯@»SWÃ?äÛ{¹EÃÁ?ŽËX‰t5À?‘hï«|c½?:\¾Ïwº?µ H&¯·?’oÌlµ?*¬E7'¢²?¸ê_Ç`j°?c¶I:ݬ?…•g©?¯ïkm|¦?V>$#¤?Ú,dtˆb¢?ú“º¢4¡?lpsèV´ ?&7ÀpÔ ?K— †¡?ô|Gߢ?=…öåOÒ¤?¬­í¿[§?mK Equª?³E›³Ù®?ªïS3±?lK‡1i³?(“ƒêcêµ?<|ÿÝš¸?b šÃòs»? ×go®n¾?à&ÈåÁÀ?jeQáUÂ?ÞåcqïÃ?‚¯­ŠÅ?6íôU«#Ç?ž"Ù„¶È?<É|âc?Ê?Ý ŠºË?®‘eÎ\$Í?W K›hyÎ?øHÖán¶Ï?õ›Š5lÐ?ŸJDMîÐ?E‘ŒA`Ñ?+•üÀÑ?иÓt’Ò?ì7WCKÒ?‹Z¥¦}sÒ?~Ì¥DÞ‡Ò?`&í,ˆÒ?Êò®ptÒ?&nó|ÞLÒ?â©X¸ÑÒ?àöZþÙÃÑ?\ԽĴcÑ?â‡IKòÐ?‘…"°pÐ?_QV>9ÀÏ?—jÂÛƒÎ?ÿÏ•C/Í?¼b·‹§ÅË?ÚwÈrJÊ?· =ÁÈ?¡‘:ÅÄ-Ç?€nIá“Å?x˜T/}÷Ã?NР™‰\Â?NÚÄSôÆÀ?óë3¥;u¾?^ð@Ÿv»?Ô4hf™¸?4þ#{’äµ?“üCÀÂ^³?¢/Ü$±?ÓÑÌð­?ê¨tûMEª?çq“Ù"§?¥¹è0‘¤?KÁÁµ±–¢?lÎô6¡?Í?R€ ?® )~rÎ?È‚à£x:Í?.%ìûdëË?ÖfHňÊ?²ú` É?øéµ¢Û’Ç?xÎÐÌFÆ?q8y.$xÄ?³ÝBšWæÂ?˜¡¹ÈVÁ?Ö©ºµ²š¿?… ]¡·›¼?¨òLõ¸¹?`áøóö¶?¥#©i0_´?æEþ3<÷±?oæÕ!Н?Á¯Fœ«?ȯg[ª.¨? EýÑI¥?Õ\T„ïô¢?^»âø6¡?æ»÷  ?PøP±™Ÿ?o¢,JŸ? Ä2I×R ?&ñ­L¥¡?líÑyú£?ós¾dj¦?v¤*£Œ©?Ufpñ²¬?¿ùmc°?¤x&¬§²?H™‰Bª µ?ë\ ^È·?9ª›ëJ˜º?ûûUú‘‰½?9èÍpJÀ?ï6iÑ?TÜ5æ¶Ñ?2þ!iæñÑ?ð]’·¦Ò?˜óMÅ-Ò?/Áùu .Ò? ò>Í{Ò?µ9OóÑ?“X6Þ¸Ñ?´»î«·kÑ?ØE¶˜— Ñ?FsC^eœÐ?9ïj1Ð?VJeÏ?П%‡áÍ?¥Ãƒ¾Ì?&ÓQõ;+Ë?ƾ·lc´É?ÞwyÄ/È?”“§¡Æ?aJÿ Å?]¯ÜÆ»tÃ?íÜCÒÙÞÁ?ޱVNÀ?¤î™Ï ޽?rµ„ÞP™º?¯x2³Å·?‰ÙÕ© µ?øLvÌ#²?n¾ -ÖT°?é<1™£¬?5kWGð¨?jŠ&G}Ú¥?ŒÁ-sâS£?׶γb¡?»½£”“  ?èîO›6°ž?÷– ŒQßÍ?ìÙé©°ªÌ?A¥y1É^Ë? †dÕþÉ?Á—-AŽÈ?qŸ¡Ç?õ Á´«‰Å?‘¨³+ýÃ?;}ûnÂ?BËz÷âÀ?«)Eñ¹¾?Úz²”ŽÁ»?þþ>'ä¸?xŠ:VØ(¶?Œj–³?èŠd ?3±?™½‰ ®?"fvŠÇ#ª?p„黦?ª©=“dÛ£?•Pï^‰¡?¢•º¤ŽÏ?$éy3sÎ?~ “(=Í?þ«¥uïË?°Yn7FÊ?‰hâvøÉ?rÔ·f™Ç?¤,vHÆ?Êjê†V}Ä?rKƒêÂ?ô?±]XÁ?öK{ù˜¿?âùª¯È‘¼?èØ^³B¥¹?^Q¸R¬Ù¶?bÖh’ß5´?ïÐ?™UÀ±?”¬è.þ®?-qàZïª?ÞCý+^§?ºµOëeS¤?2¹Iu‰Ö¡?Pw\ÞlÛŸ?s¨F9?ªÀµNËÜ›?ܱ £HSÍ?ðf±·Ü Ì?l#IO×Ê?Lá™ÓyÉ?ˆÄ‹6Î È?v"ÌÆ?\~É{ Å?ÎaA ‚Ã?¾“ ÷Á?nÐÕw“mÀ?W ¹lÔ½?ºárVàº?¸c4ˆK¸? à%ÛÿOµ?žÆ/Á²?!;š<3a°?Fƒ·4Ük¬?æyåPƒ‰¨?¼û§þ$¥?͘¸¹F¢?Ü>¨ëŸ?¤ë9¹qœ?ðòwuš?5ž‡Æ ™?LßKV3™?ú(€"€š?‰m ?Þ^J­™b ?Q¥C…Ñ¢?Ñ„N Í¥?U$âæM©?>¬N¼„K­?_2cÞ°?¤°¦¼qJ³?2(ëÚôäµ?a>ï;§¸?Ì- ƒŠ»?8“ ͺ‡¾?I®'OÈËÀ?6 ÍžBYÂ?jìèÃ?mÉb,¬uÅ?ÈEiýüÆ?g<Ö´´zÈ?ßÅ›+ëÉ?¨p¾ÛJË?‚% rh–Ì?šKˆò¥ÊÍ?Ü2˜•¡äÎ?àžWΨáÏ?MJÿ˧_Ð?nÑF»½Ð?*]ý' Ñ?e9»/DÑ?WVÇÀCkÑ?ÞŠÃÑ?'mRB8Ñ?®0DåkÑ?Èà+È?EÑ?t¾>¢ Ñ?¤Q‚š¿Ð?ˆíFMãaÐ?dD‘ýÃæÏ?rσãHêÎ?š ½ÐÍ?п¯ÎœÌ?õlºYlQË?í»R¾ñÉ?ƒ93È?D’Ç?TÎÆ;{Å?_M‡^íÃ?M²;G]Â?ýyŒOÊÎÀ? HêKq‹¾?«d/¬‹»?^±ŒQ ¥¸?KNæ÷iàµ?*: OÕB³?ý…dÖMÓ°?Ž[¶/­?lm¨è¨+©?reô…¤¥?Zbb…)£¢?5›ô². ?ßpz·šœ?úDÿ Yš?·4Oc±˜?0—‚ªïÓÌ?¨Ñ‚Þí¢Ë?f —áßZÊ?FÖúôþÈ?ó9Ðȉ’Ç?áT)Æ?Øã“·y–Ä?¸Ao:Ã?²¾g7„Á?P€& ‚ø¿?«¨_×Dô¼?»t:T0º??­Mõ,·?^Li£ew´?æü9Klê±?x1àæ¯?® vö²Ãª?Õº|Áöâ¦?.’N£?nÁc·!¡ ?"µ˜XŸœ?c{©Œé!™?!t`iTÉ–?­¦ŽS²•?´®;Е?ƯìÂä—?¨‰®O—™?]è,cD?Š<²±· ¡?(ñYÿ£?ƉšÚx§?)Ñ4>ºn«?ÿ|¦Dׯ?©‘HÕS²?Ý“V¦ê´?ŽÝBçü§·?ŠhLJᆺ?ˆç(´½?•yÏ–EÀ?hÅJäèÐÁ?®×CA ^Ã? ¸H)éÄ?¨6ÑønÆ?Ü=`„RêÇ?ŸS­gýXÉ?YÆ”mý¶Ê?®+c<øÌ?Íê¡Ä3Í?HN7rLÎ?âI‹PHÏ?oyÁ¶zÐ?jînH!pÐ?ÎW!5¼Ð?=ZÀùõÐ?¥4„0Ñ?½&±0Ñ?TbÁ‡jÑ?‰]ˆAäöÐ?’¸–sz½Ð?N"þa»qÐ?ø§ybÐ?´Çj§LÏ?7‚š©:QÎ?¸«|å8Í?²ˆ‘_TÌ?€9Wbt¼Ê?/ýTÖk^É?I¦ã’ïÇ?¨!kksÆ?Ý@(—˜íÄ?ìø[ÚÕaÃ?) ÌíÓÁ?‰GQª°GÀ?UQÛìÕ½?FµTê·†º?rï–Y¥·?ΚÌä´?Þ§xÓK²?1Ö q¢Á¯?ì"î£mS«?‚·3ÇíW§?ˆúÏ¡ïØ£?‹ªßß ?Öjì¾=ãœ?4΋2-™?â!|Ö£–?çsg˜`W•?,â`¹ôfÌ?Æë‹6Ë?1>wïÉ?mù¶Ð“È?Uøyc(Ç?)H—B¯Å?NZr(-Ä?h •2u¥Â?DŸ€ñÁ?ø 3úÕ(¿?â:ÕAT%¼?nò¿VÒ4¹?ÍÛyg•^¶?¤p£ð¡©³?äi°ê©±?Nt²ù{­?ÒÖWï&©?â™Ü¼íD¥?1¬UD‘ß¡?œ3·r†þ?ŒN£GV™?•Á6ÇÝÒ•?U©F ¦u“?¬\ˆW_U’?BÝY¹i’?ªQY€M¨“?&5y Ú–? ɤdÙ?ç9 ߉ž?=¤ZW4¢? ¡Äm‡¨¥?[-`™©?N‡£Ï(ü­?¹Î©c•c±?JßÉ8$÷³?A8n²¶?§d~’¾Ž¹?€°¡•…¼?—?Ž¿?N®6QÁ?:ÝÂ?åjdîLgÄ?“1’¥ëÅ?þCPnŠfÇ?€ÙxXÔÈ?µæÀúŒ1Ê?ô ÚÍzË?ÒÚHBò¬Ì?œþ ÅÍ? ~OeÀÎ?}°Î>šœÏ?¦"‡}Å+Ð?ú0Ì´wÐ?&+uï]±Ð?*¸u0ØÐ?"^(VÈëÐ?6Úæ%ïëÐ?J¿ï §ØÐ?<ÁˆÏ%²Ð?ƒX7RÉxÐ?kIm!-Ð?¢kªÑŸÏ?ˆÑù9 ÄÎ?h­k­ ÉÍ?5”¬9±Ì?óŒ¨'@Ë?’× € 6Ê?ɱ–5ÈØÈ?Ëm£ÈjÇ?Þ¹ÖwïÅ?·Yê~ÂjÄ?„RÍIàÂ?±½ð^^SÁ?¦%áÀ¿?ñ1±Ô…¼?Ïñ•r¹?50“è®¶?°bªèBñ³?f3|½@[±?„˜¼V{æ­?Æ:3K~©?ŠËõãɈ¥?öƒ=¸¢? 4oJ7ž?úO»õ²g™?6â·ðƒ¼•?2d5þÖ=“?Ûæd¢ù‘?x¹½™Ì?dú^ôàÊ?UcÅ~<™É?7M p=È?Lf_ÈrÑÆ? ú¡ AXÅ?Œ.άÕÃ?ƒ23>oMÂ?ÃëµSÃÀ?Å9hJv¾?Š“]×Zq»?á~;ØM¸?pÊh§µ?´]]'±ð²?3Ú Ûa°?[Q£ûp¬?RùrQ©§? 4ã?ʤðugY ? ì9åcéš?*Øw1=8–?Ë• ã–«’?ª¤ FG?ê-Mr9Ž?ï°éWMŽ?æsG^?>[SêÊÌ’?ä|ª/âg–?TÍ™#'›?°j)r ?\‡_ð£?+&Ôãݧ?ÑýýS>¬?Û´çÃxƒ°? Bâû³?c`,²aе?Û.6Cô«¸?ÖO§É­¡»?(f°ËEª¾?P³û…#ßÀ?¥óêkÂ?ÞòôRõÃ?KàtryÅ?ÄÇ•ÑdôÆ?:bûHbÈ?ói‚…š¿É?ÖDbçüË?º^Ò¯E;Ì?`Ķ‚SÍ?Æ¿OÎ?ÒP\+Ï?ò~Z­oæÏ?"ûit7?Ð?ïü±îxÐ?LWÑŠÊŸÐ?X‹®¢e³Ð?)T»‰†³Ð?ÒY{/ Ð?‹ÍI—yÐ?(³@Ð?9ĶèÏ?ÖX[ .Ï?N\P› RÎ?ÚæLÖVÍ?RÉMsÍ>Ì? Øj¢ Ë?-dÊ CÃÉ?›Þ¬ÌÚeÈ?KÞªÂ÷Æ?TݬÚ~|Å?`Èš£´÷Ã?<‚= mÂ?£>0„ŒàÀ?”H46“«¾?ûRÖùF¡»?¬šå-¯©¸?®éÌ¿̵?·T=©–³?‹=€ªàz°?䊨‹¥(¬?f¯„¯Ã§?à‚= ±Ñ£?,¸ª¿h\ ?Š…Æ^¹Øš?ÐÀÝ£¤–?»Èû_o’?ö×ĉô?Üç4½z?CªXN‘ØË?•°é ×¦Ê?Ÿ˜£Gï]É?œI»È?¢¤gx“Æ?ÞJÍÅ?j©”Ã?÷o&Ë Â?Nõ³û~À?2õÿê½?²›ùáº?¾ðrÓë·?ußU2µ?[ž¹U²?µmìç@†¯?þêJ…½ª?l…1]¦?¬Ç?›o¢?)Σ=Ùý?´ýÕD'˜?äã’‚i“?Ù¹´áO ?C//GÄŠ?/2²GXˆ?ÄH’Vˆ?פŒ9¶Š?Áß!ê׃?üeŽ„ÇV“?)¢TÛ˜?Ëšý¹Kå?ÃTFhb¢?aû(eO¦?Muu篪?¶º1y¯?ZÚ&@¹O²?º{!ð µ?â[är·ç·?)^÷ÎÞº?Ce,×öè½?Ué!%[À?Š~7 Â?D_ ?—Ã?¶“~¡¢Å?(“À‡£˜Æ?œ@Âô•È?&òeÉ?Vô(mV°Ê?«qÁ}”ãË?·'µüÌ?Î&òùÍ?~V ÖÎ?9 w;Ñ‘Ï?·ÇÁ /Ð?šÀ¦‰ OÐ?å æ%vÐ?YR:dÕ‰Ð?/™÷Êð‰Ð?÷&KyvÐ?j­î¿«OÐ?õìáãîÐ?ú»²Í±“Ï?˜eÁ¾OØÎ?WȆ…ûÍ?ªvlÅmÿÌ?®ë[ØsæË?úo#öG³Ê?×Ñ µßhÉ?[ñ?¼f È?Û³…«>›Æ?@óãLîÅ?þà‚Y!™Ã?×P™– Â?vL×€À?Œ%×Õé½?à’§fݺ?°!nKä·?¢•eµ?€õ¦CåH²?Im Q”g¯?…l];@šª?¹? 3¯5¦?š½ï®D¢?Bú+ä¢?xÉ`P^Æ—?ò{³Aÿ“?kÊWÓŽ?î#ßú‰?øxjÀ‡?‚|9o{¿Ë?`f?kÚ‹Ê?Œ‹#Ý@É?°.®Û¹áÇ?ÖÊ ºËqÆ?2]¢ôÄ?Ét¢eámÃ?Xmú±PáÁ?šbÕ¹RÀ?,¬ÓQ틽?uj{,£}º? *‰&‚·?÷©XÀ ´?86‹•à±?ˆI½¹®?¾g ½©?%)qtøQ¥?=ºpZ¡?¦™OCÀ›?Øú^ƒ×•?ÆcÙ}ï‘?}žø`šÁŠ?ÓXŠèÅÌ…?ÞöË®ïFƒ?Û+¿p¥-ƒ?"<4~…?Ìx# =Š?Æ>Ň®?ÊF·¢÷e•?ûýN9›?ì´c$Þ ¡?êЃÃFû¤?W|{^©?Ã.0:t*®?9Û³nJª±?ò ¸@êg´?7 ‡CG·?Êy SAº?'ŠÒb­N½?ú™<—î3À?ô*pã“ÂÁ?»Õ”wOÃ?q“³»ÖÄ?1½ª¯ TÆ?vnÅÇ?.ä+%É?¶Ì!Z¼qÊ?—O•Êž¦Ë?ØÛŽq@ÁÌ?J§ýð¾Í?TÄû†7Î?/©ÒúÿYÏ?°äwóÏ?Ì…ÃB4Ð?§ƒ`^[Ð?¬g6oÐ?G×øKoÐ?ÏÚÒ¡[Ð?Ac«Þ4Ð?О¬ôÏ?¼=K„[Ï?" ÒŸÎ?tØ®qôÀÍ?â÷¬pÃÌ?«OF[ê¨Ë?èi©ÑtÊ?2þ[xæ'É?CÔ4>—ÇÇ?õƒw³’VÆ?NÌ¢_ØÄ?è´>ô·PÃ?õœ›ÞYÃÁ?4"è$4À?Ó-íÒM½?Úáú[ ?º?8ú,nrC·?ØeÄÙsb´?š6£±?N/±-~®?Wž0dkH©?ò%°$â¤?€mØþï ?4áo¡„øš?EIaLo•?Ð~«õ¦`?ÛÁa0’•‰?üñ˜vÌ„?ðLR_r‚?Œ­|{ÌË?•wÊ–Ê?:ûù:îGÉ?v0&åÇ?TäÓ’rÆ?UÔ~’AñÄ?ÆàîfÃ?KÐtt7ÖÁ?‚\˜šCÀ?£Í«zše½?º1¤ÀOº?x™f€K·?Ëo¬éúa´?“Iæê™±?EW`8Ôó­?ݪŸÓT©?¨ * Ú—¤?4œ‰Yë’ ?˜ =ÈÉš?pzˆ ”?@Ì’`”hŽ?ý¼)€ó†?BŸä˜¦ß?—΢ |~?½•lF`~?ÌåŸcZK?r­1˜Àý…?>õß?jQ2¼@D“?­>üG!™?¶•}¦ ?¡tÂ÷só£?¯ƒýž[¨?ŒF®Ìß.­?Ž.‹Z0±?âKK°pò³?@x—Ö¶?Œ Ô÷òÕ¹?¾ÈûÐè¼?ê~;ðÀ?Ô›þq•Á?öŽá/ˆ%Ã?fJäÏׯÄ?=]?ÚÐ0Æ?¡¨|•¤Ç?¨-Ó×®É?*£.ñˆVÊ?2G‰tŽË?WÌ"3ÿªÌ?« ^ÓªÍ?r™Š¨ñŠÎ?RÊîòZIÏ?•ÝÐ6äÏ?ZÆÄ-Ð?8H&¿ÔTÐ?RÒˆùhÐ?z®Om iÐ?’XNUÐ?Ó²•We-Ð?·Cç'åÏ?[÷EJÏ?ò±ØÊ\ŒÎ?xf]l¬Í?mç[í¸¬Ì? ´ëÐË?¬8t‡UXÊ?·’™j É?f;±-¦Ç?(5³D12Æ?Þ]è¯ì°Ä?ü€=&Ã?i ÑÑ•Á?t8âø¬À?’nmç¼?&6bÔðÒ¹?Ž›(¶+Ò¶?$Iß„ì³?WÀÐÜ(±?ìÊkû£­?Æ`Ü#F¨?Ôý†ã›Ú£?˜˜IÉŸ?û©3JˆÜ˜?Çk—\ÿ’?ëF¾02„Œ?cÄ]8^…?Ž"Œ³2¢€?Žu‰´|?®ÊÛúË?M¼öÀÊ?ÂëçoÉ?ÀEw‹±È?>·Ç³ùÆ?îó Ë Å?EŒàÆ”|Ã?±vž”tçÁ?Ì,ûOÀ?î~&–Àt½?P,¬©`Tº?ƒD0G·?厳ØñS´?Pu¸eŸ‚±?a/ÂJ·²­?q|îrö¾¨?ó¨²öx4¤?š¢Ž|  ?Â'ÙþP™?œY …ú’?4_/€3ü‹?)Çg?¹^„?áSaØM~?Ø"㓃Òx?Ãß´´h5x?;OáOª|?>™>¯í‚? ÛÕÆŠ?X·Lv¾‘?Í,>œ—?`!†/Y‹ž?b’‚?£?åD,dâ®§?öÂ㊵‹¬?D·”ÿã°?”¬Š$¬³?t•l¬–¶?þG3¹?o˜â¦-·¼?–b÷Ý¿?Av áv„Á?[¶ðtÃ?4S'a°¦Ä?ì½µ§+Æ?§àÅ6£Ç? q{c É?øÝyàh\Ê?W*B—Ë?[Á 42·Ì?ˆÀÆYŹÍ?µ×'Š$œÎ?8÷¶\Ï?rÙ*M ùÏ?<Ån^8Ð?(»ê'Ê`Ð?ùŒ£ùuÐ?ˆjSè—uÐ?tR­Tè`Ð?»ßëVš8Ð?"LÔùÏ?$^{]Ï?±U§*=Î?¥ò’h»Í?jóAk…¸Ì?’nÚž˜Ë?ÿ‰ìÀ]Ê?L)wèV É?(w´¼Q¤Ç?zIlŠ,Æ?ºâM™I§Ä?é×¼Ô²Ã?«bwHH„Á?˜Ñ+ Ü¿?ùK‘¾´¼?Hà~@s™¹?ãc6¥½‘¶?ÃN½°Õ¥³?ófè@ܰ?Y‹°«By¬?zë 6n™§?ò÷ÅÌ&£?ÜÒyTž?<„gz”_—?¦qÈz?|‘?¢Â¢½ßy‰?xægÞU‚?ïÍ£ÓL{?Ò$ ñâv?8²Å ÈOÌ?ð/UƳË?^Ýëµ7»É?ÕN-PÈ?‘…¨v$ÓÆ?༈¤HÅ?žm`êܳÃ?•v”îÂ?Çï‰oË{À?ž´«ýÀÀ½?u0 ÙŸ”º?ödÇTß{·?u_à}´?9#­¬ ±?ôdÒ@ÿØ­?â°¨Z§Ð¨?ô­]?2¤?ÑãV¨  ?h”c ¡È˜?' ©\I’?L¦áîîŠ?µ3#ƒ?yu_šå‡{?üìÝ4øÓu?ÜÛ9Àõt?غ7¼y?º.-¤k'?`ãz¨Fˆ? EÝßá?‚cÓŸ×Ç–?ÿ‡‘1Á?²‡Vâ¢?§•Å{‚Z§?ÊÈèáÂB¬?ë»BrŰ?‘jÅ”³?$üß¹~†¶?š… *=•¹?dæÂPq·¼?fb&Xç¿? КGxÁ?FסU5&Ã?Áß6θÄ?:?p}BÆ?¸ë¢@¾Ç?´•ycš)É?FÍC&ÂÊ?,ê–]¢¾Ë?-ÐáÌ?Êý?v­çÍ?dº¼û:ÌÎ?8çQ¢ŽÏ?£a©ÌXÐ?·7"ŒSÐ?XØÉÚp}Ð?„ö“Å’Ð?>aw‰Á’Ð?5µßöx}Ð? ¶°±SÐ?á‚uµ˜Ð?²­ %PÏ?›°J ÍÎ?Ç’Y™èÍ?&\Ã~ÊâÌ?„ÏúŸ¿Ë?a€g†³€Ê?@ãÎr*É?Àé¬{ï¾Ç?¸À£ôBÆ?Ø)®ü¸Ä?Ò©ì3 &Ã?FÕndèŒÁ?ð¢‰Nå¿?L4üb´¼?¢uÀ±‘¹?jäÒÒ¶?B(·<"޳?òÅ}½°?Šv­û#0¬?þ'†È#E§?×þÐqáÉ¢?q …‹?CN=጖?¤šk: ¡?T8Sþ¼‡?ÈdÂÚ”€?R´ªådêw?xùWú±s?üh}ô†ÏÌ?tÞŠª‹Ë?Lmx0Ê?™Àv—¾È?L®«’|<Ç?÷HÁ“ªÅ?ë Å7Ä?úxåI€mÂ?`x†@|ÊÀ?Æ…¸ëªM¾?Z”«5»?K ÅÞì·?¯in7Vã´?wêG°«ö±?S7Ojq®?L$óbFJ©?ó§a›¤?h·!Æ7X ?þe;G™?QÌsØÜ’?ÐŒ¨b‹?\7ÎCƒ? CôÎb°{?d!zu?¡±ƒÚ¢t?nk·èGx?S¼)òÌÉ€?XxÏ8Ù‡? ßZ‰øÀ?uóÁÛ‹¤–?5„äº?ùKÎxá¢?¨k\Gl§?˜‘•eÝ[¬?fCˆeÚܰ?y·«œµ±³?™É8Zš¯¶?:ÚOÂbŹ? ï1Äô¼?4ÍQlRÀ??GϺ϶Á?è`ã%íSÃ?A6ˆb!íÄ?ðMTñC{Æ?õÔÁ#IýÇ?Ïú{ìlÉ?ªì+½ÈÊ?õBªA… Ì?‰ÈDŠ3Í?ðÚÒ¹<Î?8V%Ï?ÚÒ,c¿éÏ?T ¨ÈâDÐ?O¬¾1ƒÐ?³Ex˜®Ð?‹ñ–w]ÃÐ?²X(ƒMÃÐ?|òŽŽŽ®Ð?ã­E·FƒÐ?‡sË¢ EÐ?ž%j&:êÏ?À ¿Y—%Ï?’ÔÿÉ`=Î?'¿3`84Í?‰HÒŒ/ Ì?«Ày%WÉÊ?ü“imÉ?;·p™›ýÇ? àó]{Æ?ë!èôìÄ?T‚‡elSÃ?IS):íµÁ?ðÎyÀ?_F^3ñ¼?¾ûVÂÀ¹?UìhÝ©¶?‰¿ì̪³?ooÈù¹Ô°?ý<4EI¬?¢×‹ÿV§?'½©É¢?5w´‚…?ìÙÜ´k–?Ë@¥Õ‚?´Ü§2ùS‡?~«l„}<€?°å0†Mw?‹Ñ”Üks?w¨äŠÃlÍ?ˆ¯…û"Ì?ë’™(`ÂÊ?ùÐz»IÉ?S »ûÁÇ?/o ;(Æ?ô“bSR‡Ä?gvmÇÜÂ?ît-yñ2Á?žÒ蛿?†_þïkÉ»?E!ÃM¸?–é•zjyµ?c¹l6¯}²?jåí£^f¯?n –Lƒ#ª?Õ ×Ϲ]¥?•cp~¡?TÚ#Yuš?æŠåžaâ“?…Å-?–ÂVË Ë„?ä÷h,~?’I*—Mx?ÎÃc®Þ w?YuÎ3z?Ed{?¯? ¸|Õâˆ?¶á~—S‘?p’Xïs@—?‡xB¼dž?°”ºV&B£?zsœÙ§?Ĥf zج?VZx•#±?+Íx™¨´?tŸªxç·?`².{Ü)º?£ÎÓœ„c½?áåí»ÌSÀ?Íj†ÏùÁ?™ÜY¯Ã?C½ñøæ;Å?¾‡žÑÐÆ?ƒ€…WÈ?gÑÐÌÉ?ît[Ÿ-Ë?v6äjuÌ?·öFÞ¡Í?—õÃT]¯Î?&…ª›Ï?Bô)2Ð?úp†ÑeƒÐ?A6‹ÙÁÐ?óꯌìÐ?§®£Ò÷Ñ?aôÛ¨éÑ?-†ÌxìÐ?+Çù×ÁÐ?þ³é(yƒÐ?Æ-ñ:2Ð?Ý<ØóœÏ?´Ñ'rƯÎ?iƒ±I¢Í?$;‰ÍuÌ?ŠÌAî-Ë?:¸$ÍÉ?à}å÷ˆWÈ?:-°ÙãÏÆ?ðSm;Å?ÉGªrQœÃ?Â"Þ¦øÁ?ZÀ7…;RÀ?”F†{_½?bÀ€Ú$º?7ùVÛ·?Ô:pó…ú³?«- ñ? ”ð#¡Å¬? Áϵßç?pLš%Ÿ*£?J0‡1ž?¨k*¾I—?E8¬˜‘?þ` ²aˆ?‘¯Ãcz&?cÙ:–¨y?Ý4¹îôu?ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_6/Level_0/0000755000175000017500000000000011634153073023315 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_6/Level_0/Cell_H0000644000175000017500000000034311634153073024366 0ustar amckinstryamckinstry1 0 5 0 (1 0 ((0,0) (63,63) (0,0)) ) 1 FabOnDisk: Cell_D_0000 0 1,5 -0.898681522596304,-1.08327634120147,1,-0.997592363336099,-0.644344346053278, 1,5 0.898679402123172,1.08328627850534,1,0.997592363336098,0.395915882882807, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_6/Level_0/Cell_D_00000000644000175000017500000050012211634153073025021 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (63,63) (0,0)) 5 ïÔ¿ì?.á¨0xì?-Ù!ëë?Oëp´<ë? Ä’-‰ê?[ ‹¡°¯è?½Reûç?- ¼ÚGSå?vR³æTã?ï+ %á?º]šÀ—Ý?š·eœØ?û‹º]dÓ?òó` ùË?»—¬gäÀ?¢ß3ƒs˜¦?8øKl˜¦¿˜‰äeäÀ¿˜Ä±% ùË¿žrg³\dÓ¿]Ìv•dœØ¿ô3oY¿—Ý¿X©®[%á¿KRs#T㿺ÚãGSå¿ Ì<€ú翬sÇ®¯¯è¿ gö0ˆê¿6,³;ë¿= ë뿪>±/xì¿"ÞGî¿ì¿û6s¿ì¿Ä—zí/xì¿×ôˆi ëë¿_ás<<ë¿"6TÞˆ꿚º¿}°¯è¿Ð.ímûç¿Ì>õHSå¿e $DT㿦ß%á¿4÷ßÁ—Ý¿ Ô0gœØ¿hÍþY_dÓ¿mRìuùË¿­ö£$käÀ¿Ž!Z˜¦¿O¥Ü_˜¦?®pcäÀ?¾;1µùË?Àúå½[dÓ?ÏLdìcœØ?—|Ò¿—Ý?=¯ž\%á?š„PTã?[4Å]GSå?3“åÿúç?(׆Q°¯è?WX—ðˆê?˜Ãˆ<ë?Í›õç ëë?u5ð–0xì?ªpvοì?Vq~öÀÇæ?äé›>—æ?ï¥zAÎæ?Dcê˜yyå?–à$Y3žä?žË´ã?ÕÔÁQâ?|~=TAæà?+2¬™-¢Þ?{ MR,Û?Bï˜Åxs×?jŒ0΀Ó?üp3‹¼Î?»H¿Ö*Æ?›<2ŠÓź?2ÒÙùðç¡?víDNêç¡¿ü/,Ðź¿LĸÔ*Æ¿ìXAˆ¼Î¿E‚Í€Ó¿9É"ˆws׿Z0²ëP,Û¿ú”¯,¢Þ¿_á ~@æà¿ êìÀQâ¿xL'ã¿p"nW2žä¿TA‘xyå¿ê(T:Íæ¿NF?–æ¿åO ÀÇæ¿ŠÅ|ÀÇæ¿óþ|–æ¿8­*ŸÍæ¿Àìyyå¿–“13žä¿Tïöøã¿z‡ñÝÁQâ¿‘ÜÝŠAæà¿ ¨O\.¢Þ¿|€î\S,Û¿|ûzs׿¸åz¸Ï€Ó¿MCØè¼Î¿êÁmÚ*Æ¿wÄQ»Úź¿w°t ÿç¡¿;“×Ýç¡?!Ñî"Êź?žj¡/Ò*Æ?<Þ‰¼Î?ÆõhcÌ€Ó?È.ws×?Ê{ÌìP,Û?W„to,¢Þ?ZßôØ@æà?~¢CqÁQâ?v¾Ðã?rûŽ3žä?@ÊÀnyyå?5"V%Îæ?c÷Ž.—æ?þ£IñÀÇæ?ù9¥»á?ê¼æƒõà?œ—Û{|¡à? ‡Ut$à?`ΛÌ@ÿÞ?éÉn¼,iÝ? ¤´–ŠÛ?”¶?ÒhÙ?п ;ø×?‡ðrmÔ?›ÀРÑ?»ÕGc0RÍ?ÓÙ;±vÇ?ˆ™‚jÇ©À?*"ƒ ´?2¤˜†ëš?Huëš¿¢ßFH ´¿SÖH­Å©À¿¾–†ÅtÇ¿³ <.RÍ¿7ëæÎ Ñ¿r$Y¸mÔ¿ÊjU³ö׿Ý£ hÙ¿špF@”ŠÛ¿Ø“ë¿*iÝ¿þ³¡´>ÿÞ¿uDé{s$à¿e'Áe{¡à¿6×ׂõà¿!& ¥ºá¿Ü` ººá¿Ò¹ƒõà¿”/RÍ{¡à¿‚üó t$à¿ù'Ë@ÿÞ¿Ò?:o,iÝ¿êYÆ/–ŠÛ¿êàiIhÙ¿Ô‘ ù׿¬¥o;mÔ¿ó‘‰Ñ Ñ¿&¿Ë¬3RÍ¿úL\MzÇ¿<Š|7Ë©À¿ÎfC8 ´¿oAÊ«Ÿëš¿v˜¿Xëš?>jåü´?¢í1ô©À?†d•ŸrÇ?Žâ¿,RÍ?Ù(ø„ΠÑ?˜ Á·mÔ?TQX÷×?Žù¸âhÙ?ŒÅ\•ŠÛ?>z+,iÝ?çÈ~a@ÿÞ?‡³Ájt$à?†cc|¡à?¸ÂÙƒõà?‡× »á?fü$r×?¹NâœYV×?¡´Å÷âÖ?gÞD±©6Ö?}4K˜×SÕ?máù°p<Ô?ÆÌ»Õ%óÒ?ªäÐà"{Ñ?›Xµ °Ï?JÓ¶Ì?®BÈ?Ç5ºŸ,Ä?íÿèàÊ¿?º®¼ î¶?BÊQ¯°±«? @0²…’?YŸ§…’¿‰몱«¿fΓî¶¿Vë(ZÝÊ¿¿ù’±°,Ä¿ç`ÀBÈ¿ÙÞÉg³Ì¿x¥ °Ï¿—Aê'!{Ñ¿Í!ní#óÒ¿PU†n<Ô¿‘,aÕSÕ¿Ýâca§6Ö¿–#ƒiµâÖ¿¢VÚIWV׿²|ío׿ç$p׿u68ÌWV׿“öâ@¶âÖ¿‚í슨6Ö¿,ÔæØÖSÕ¿+bb^p<Ô¿†Jñ%óÒ¿Í g#{ѿӒü‹°Ï¿ À@¤¸Ì¿ÂIï>BÈ¿‡§\£,Ä¿'I½áèÊ¿¿mø)î¶¿Nl°Á±«¿9âXÓ…’¿’jêȇ…’?ÉÊœ±«?\®‹î¶?ûY‰“ØÊ¿?½=М,Ä?à:âBÈ?}À´`³Ì?Ë¥x °Ï?œ{©ü!{Ñ?2Bo&%óÒ?¡Á/p<Ô?‰ß}=×SÕ?ä›u©6Ö?iuÏž·âÖ?'ÐJ‰YV×?îÔær×?öm÷j Ë?½´ã¼ÈÊ?üÜqÛDÊ?&aA8~É?zƒeز?þ)ëÖQª?` »ÍÈŸ?È6X/B…?âoL4õA…¿lxÄÈŸ¿€i0lQª¿>pvv>²¿Ñãf'·¿Øòù@×»¿P·J9;!À¿Öƒt"/¿NM\Ä¿65‘ ¿Å¿`J…,9Ç¿8 8zÈ¿"®-Š~É¿ ü˜§DÊ¿”.Ê­·ÈÊ¿$ÐYe Ë¿žLle Ë¿ Ç⿸ÈÊ¿Ÿ…lDÊ¿Ü@–ŸŒ~É¿®Â,;zÈ¿nÀšÝ9Ç¿ª’MC¤¿Å¿Œg›Ä¿L¬ÁM/¿⼀¿@!À¿bÕüªK×»¿Ø©Zr'·¿èn¢‚>²¿|žÈ0Qª¿<€u ôÈŸ¿‘±PRB…¿þçà`®A…?( ¤ÈŸ?šåÑ· Qª?”š]q>²?šgº6b'·?ŽÛ‚ >×»?¾'¹(;!À?6«R /Â?2QU8Ä?0ƒ(Ç¢¿Å?LàY½9Ç?ºì!S°¿PÍß Ù2¯¿˜LõyJô­¿8žÎâk¬¿ðŸg…hª¿è ´P¨¿Ùù°@¦¿HMk4½£¿è‹¯ ¡¿H²œÛÍUœ¿¨GÍX¤S–¿  ôn¿À’‹ sƒ¿°pÁ!j¿pŸúf;j?XDÝËZrƒ?PO8?05|WS–? ‹ÆÈˆUœ?è;}ð¡? ðÑo½£?`Òzðž@¦?è_ÁõD¨?PS cª?éÝGãk¬?ˆRö Qô­?¸]uÅä2¯? ™xF°?x>Øzc°?p­ÚIGŒ°?bM]NM²¿`$£/ ²¿ ™&aƱ¿0Õ6À@±¿ Â£,–°¿0^Á‰*o¯¿*¥Û¨o­¿pá+I”'«¿`Ð,ÃŒœ¨¿ÀΆQ×Ô¥¿ˆ0œN×¢¿ …÷¤VŸ¿@„Þâf±˜¿HY0"HÏ‘¿hÄ\m€‚…¿ØµK®žÅl¿ˆ@O·Ål? ° (ˆ‚…?°&ØMÏ‘?8V£n±˜?0ÖTÕ®VŸ?áOâU×¢? ·ŠÆàÔ¥?¨t«˜œ¨?p,/Ù¢'«?xY"1ºo­?tW¤>o¯?H@·ˆ¡°? µÌ@±?(P{€nƱ?°Át= ²? h\$\M²?¸ZèS[M²?p!; ²?X¢…zjƱ?XËX$Ç@±?ài¶~š°?À­ˆÊ-o¯?(ҡȦo­?À„[#'«? mó󀜨?˜r¢bÇÔ¥?Rù0;×¢?К§¦wVŸ?(p†6±˜?è>|lÏ‘?ø¥½²‚…?È : Äl?8›n¼3Çl¿ˆ†‹zÞ‚…¿P‡ŠÊrÏ‘¿ÐÂAŠŒ±˜¿°€ï3ÄVŸ¿à,~Ñ[×¢¿ ÿëáÔ¥¿PYº=”œ¨¿0Ÿù(™'«¿HQ9w«o­¿°ºêS+o¯¿àHEí•°¿"웿@±¿ ä y`Ʊ¿@.Ø/ ²¿€›¶,NM²¿:š5ÿ{2É¿$»‚?]ôÈ¿(y§¸xÈ¿ ¿Ùø¾ÀÇ¿`°¶5ÎÆ¿€êÅr£Å¿LÙ®VCÄ¿ nDE±Â¿zˆgñÀ¿lõTe¾¿Ðeûrð¹¿I"&’µ¿ôS¯wÿ°¿¸¯‰§ó„¨¿àaŠ¿üF~€M΃¿ÔazK΃?t‚™i? Ðxô„¨?`MjÀxÿ°?œÞ0’µ?D3ÿuð¹?ð‹è\i¾?ÔWè]!ñÀ?ÖÞá,I±Â?Lâì4[CÄ?80F.x£Å?PrÍû;ÎÆ?ÈOÆÀÇ?Øl‰YÀxÈ?8`o\eôÈ?:­v9„2É?$á+Ƀ2É?¢pÏ dôÈ?PªX.¾xÈ?`GÞÃÀÇ?ô//8ÎÆ?Àá¿ s£Å?pæøôUCÄ?®1 KC±Â?`³QïñÀ?„µ’[¾?ÐS1{gð¹?„ÕÚ€’µ?üðviÿ°?èâ¥ßÕ„¨?ôÓ€9Ìœ?0D×̓?8í_o»Îƒ¿`ì\;¿ð“߉ …¨¿Ö„°«ÿ°¿Œ/ ˆ•’µ¿¡ô«y𹿠 V j¾¿$‡& ñÀ¿cF±Â¿¨ÈxæVCÄ¿0r8yr£Å¿€5ÎÆ¿HI`.¾ÀÇ¿Üp é·xÈ¿Vëh¹\ôȿȆôÎ{2ɿ‡RŒêÓ¿¦Ò8Qr¹Ó¿˜@x§·WÓ¿ÒJùLÆÒ¿„Ãѽ˜Ò¿íêŒsÑ¿ªõŽ’#蠟žæ­ŒÍ¿:<-`:ÈʿΪ•3¿ÁÇ¿604ϱ€Ä¿$Ú€  Á¿2\ɱèÞº¿†q±aa³¿š@”7%h§¿ˆ8MFO¿$¡ T:O?ÄO™·"h§?°èYï`a³?‚²R­èÞº?® `… Á?zxwè²€Ä?â ÁÁÇ?|±=ÈÊ?¨¿º‹±ŒÍ? ž’ë%Ð?ÊUtvÑ?vOž5œÒ?Ö©°úPÆÒ?úy ¼WÓ?š¯ƒ w¹Ó?Œì~ ‘êÓ?wé°ÌêÓ?ÔA»jv¹Ó?àÁ'óºWÓ?ZõYOÆÒ?$‘%šÒ?8%àúsÑ? µ#Ð?T•³"«ŒÍ?\5˜ 6ÈÊ?Œ?~¹ÁÇ?Žôª€Ä?ÀGG Á?ܶ¤à×Þº?>ß[Pa³?†¢w›h§?,IºN?ÄS¥é¾O¿HPû@h§¿Ò[°na³¿jø9fóÞº¿Þgq Á¿à‚€5µ€Ä¿Z"“ÁÁÇ¿¼©<¿;ÈÊ¿\ùSX®ŒÍ¿Î™e#пî*gsÑ¿f1ä˜Ò¿Òú;Â¿Ä ƒ¾²¶¿,!ÕH0y¿dã‘ y?tÿPA¬¶?Ñ~×X`>Â?þyÁ%pKÉ?f7Š£ Ð?H’"žØLÓ?LêŸR ]Ö?ø˜a6Ù?B¨öWÑÛ? @6S'Þ?èÀ"#§à?»ê›#ó÷à?":Ñti¬á? ,M5â?ýžGËL‘â?}r°…¿â?ö,kZ…¿â?ÓÁUL‘â?psiL5â?üa fh¬á?8£!Ëñ÷à?l߃¥à?ê‘¡?O'Þ?P¢ÃüÐÛ?²Ï®6Ù?ºx=]Ö?_ú×6ÓLÓ?«Ièý Ð?ö鼋dKÉ?.>k¤T>Â?²€ˆ•¶?‚;·f»x?á¥×„y¿Ô™Æ¶¿Ö§Æk>¿Êé!°yKÉ¿“÷G пʶÄ÷ÚLÓ¿3ƒ= ]Ö¿f“¿6Ù¿òCþÐÛ¿V϶ O'Þ¿“:N¤à¿´Xï÷à¿ÈFëe¬á¿ûû@SH5â¿Æå»G‘â¿X=“”€¿â¿L×u’†îä¿p3Yìºä¿Ð®p6Tä¿ôÏYéa»ã¿H8xçñâ¿eÂηùá¿zPYÐ6Õ࿈ÕÄOkß¿4,µ¤×%ܿƓÊ]Þ÷Ø¿?³”NVŒÕ¿:_G ®ëÑ¿¸ËÆH®=Ì¿2ò!`^Ä¿îƒÿv´™¸¿”;™þt ¿æ:žñs ?¶iî«™¸?ŸŸà \^Ä?Úó7·ª=Ì?¸q6œ¬ëÑ?VñOUŒÕ?¬uÏêÝ÷Ø?ÊÐ$Ý×%Ü?òP‘Ylß?g&CÕ7Õà?NÇÙo¹ùá?Õ7Õéñâ?™àÏ e»ã?D p•:Tä?Éïeñºä?Øÿ)VŒîä?–W+Œîä?Ÿ ¹åðºä?}Æ£À9Tä?fÏÌøc»ã?i\èñâ?„ -¨·ùá?èÝ·Â5Õà?öhë§gß?ÔºvªÒ%Ü?Ö`EØ÷Ø?ö¸ÓHOŒÕ?ð;I¦ëÑ?‚sÔª=Ì?¤S†ÓN^Ä?Ö[‘™¸?ù“ž¾s ?¶ˆ54t ¿t=†Ê™¸¿ûXÏi^Ä¿ò…ôO¶=Ì¿ê=ã±ëÑ¿#ûNXŒÕ¿”Á?ß÷Ø¿fóqa×%Ü¿|ü)íiß¿Dö1˜5Õà¿`¬i!¶ùá¿«³œuåñâ¿=ÚÇ_»ã¿&$}4Tä¿J¼Aõêºä¿ÿ&š†î俺vá”ļæ¿M‘J2·„æ¿\v%æ¿0²s1"oå¿⊒F”ä¿ÒùP*®†ã¿bl­ñHâ¿ bÔƒ Þ࿪6mqr“Þ¿„Ç0·AÛ¿ m‘Ì2h׿½á‰|nwÓ¿Š–É«W­Î¿ÑÌTq0 Æ¿†þø¸º¿(]n^ß¡¿Å/—GFß¡?x—¦qí¸º?‹û+ Æ?v>ËR­Î?"ƒhlwÓ?ŽU-1h×?Œ¨@Û?,r“Þ?8W2 Þà?l_œuòHâ?[c¢¯†ã?•‘ìH”ä?$b̤%oå? aÍ5*æ?4«ÄP½„æ?Áh0á˼æ?*˜Œ²Ë¼æ?4ż„æ?ÚºM)æ?ï ‰a$oå?dR]OG”ä?Ú7à®­†ã?RC9.ðHâ?±]b+Þà?v¿Ql“Þ? £æ`:Û?¥¡r*h×?‰÷(OewÓ?èSD­Î?Î=Ð Æ?6Ôϸº?-ô’Ø ß¡?¡Ž•ß¡¿øKn¹º¿÷1Ìš; Æ¿†Zþâ`­Î¿BšjóqwÓ¿.úÐü4h׿\F·ŠBÛ¿¤%Þq“޿ʨ†Þà¿n;ðHâ¿waÚ«†ã¿ÜcºC”俱A} oå¿§©Òw"æ¿K+Kû´„æ¿H*Áüæ¿ãon1*è¿ÔåJ—Ÿîç¿€{"a xç¿Ø^¶fžÇæ¿…Ü:Šßå¿¢èGO€Àä¿‘07Ñnã¿üš;ä8íá¿`jŠn?à¿è†@Í(ÓÜ¿úndàØ¿M'‘K°Ô¿µ{Ù0Mп@_Íʃǿføtf¼¿ö ”Üžþ¢¿ŠÉQã€þ¢?r}g\ff¼?¾ÅôßÃÇ?kà_ª-MÐ?!ÜŽÀH°Ô?"b¦BbàØ?¾?'ÓÜ?mm?à?a‰½¿8íá?œÖkœÑnã?Ü nmÀä?Mô´§ßå?ÑXSã¡Çæ?¸l©xç? D\ø¦îç?²‡Œw:*è?¤éÞD:*è?H¢~`¦îç?_ެxç?uß ƒ Çæ?êKåßå?ëˆzJÀä?¿ÓçÏnã?¤yjå5íá?6MäQj?à?vn© ÓÜ?^ìö¼ZàØ?pZúÅ@°Ô?\ß W%MÐ?n‚ðͲƒÇ?šk‰ Df¼?" d=þ¢?^Ò˜/ßþ¢¿ ð_š’f¼¿àhÓÕ׃ǿ}F±86Mп¥;$’O°Ô¿TÆ gàØ¿bØE)ÓÜ¿†èÊžm?࿜Ȼ–7í῎® Ïnã¿ ûA}Àä¿¡kŸßå¿ÃÊÏ™Çæ¿l@¶xç¿X²ð›îç¿ô±/*è¿—jL7é¿'óé$ù迺0¾Bk}è¿L¾ðíOÅç¿„hxÜ˜Òæ¿‹6©´œ§å¿¬á/Ô>×0:æ¿f¿œÐä¿Ø:}3ã¿ÍM÷$gá¿Í~` ÆßÞ¿Y|Ø%¥Ú¿jtñŸÔ(Ö¿Çç0táuÑ¿ÐF†6Ä/É¿³¶õYk¾¿&^{}XX¤¿6Xaõ+X¤?Þ{ù!Dk¾?:¨¡º¹/É?ØëÅ…ÜuÑ?0Ð(Ö?0PUÃ!¥Ú?&7tÂßÞ?ÎÚ‚"gá?qb'ü{3ã?¹‹§²~Ðä?¾úÔe0:æ?½FDZmç?ê]ï8fè?ˆ!Äè4#é?»-°X7¢é?~‰¥âé?’cwáâé?*§6¢é?%„öÀ3#é?¹qQ7fè?½LŽFmç?î×÷Ü-:æ?hÁµ{Ðä?°–x3ã?µÃ£gá?І!â¹ßÞ?ú34i¥Ú?€®<Æ(Ö?D@ÂÝÑuÑ?êñ“ƒ£/É?Zy°k¾?ÎÈ„ÑW¤?v [İX¤¿(zïEƒk¾¿·¨‚™Ö/É¿¼¿õéuÑ¿Æ9„BÚ(Ö¿FŸ 2)¥Ú¿ÂœÅóÆßÞ¿©ŒSI#gá¿vm,V{3ã¿’ê–|Ðä¿á‹¯w,:æ¿Ñ!Q¡m翃CÉ-fè¿Ûx$#é¿Lò!¢é¿ùú\òáé¿8²=†×2ê¿Ü— •Lòé¿à¯"Äqé¿R«Q|²è¿sXéêN¶ç¿ÑnÖ¿ŠÎ‡Æt¬Ñ¿Ì %~~É¿?)¼oʾ¿ß’{󗤿\Z¾—¤?~íê©Uʾ?ò@8xq~É?÷Ï×n¬Ñ?[kðOnÖ?é%¿#iøÚ?(©¨A@ß?D±‡á?Þ/ifoã?~sVå?€U 4©æ?wØ_M¶ç?û6§{²è?³~ÝMÆqé?Z)©µUòé?ÒMOéì2ê?õÓÑ©ì2ê?¹÷Tòé?d,Åqé?ŠÎ·éy²è?βP"K¶ç?åz$v¦æ?Zcü‰å?+ãû§{oã?AgÔ‚á?·œr58@ß?ŒÁ^øÚ?Óõô nÖ?&BGÌb¬Ñ? þHX~É?.ñ"!ʾ?ä÷úS—¤?°|0\˜¤¿§F6^¡Ê¾¿rO]\”~É¿ñ5t~¬Ñ¿˜j1µnÖ¿Œ£.røÚ¿ Ã&G@ß¿q=n#ˆá¿¢Óøoã¿¢2›‹å¿Ï4ˆ°¦濨¶H¶ç¿,ˆ—×p²è¿L^D°qé¿€D4òé¿0Ø “Ë2ê¿ô&Eþ.(ê¿ôÏ¥ËÉçé¿K`.˜ugé¿ò ˜ýx¨è¿ ÿ °¬ç¿é]€‰væ¿Îúo å¿×¨, gã¿UoŒb–á¿*‚¬•3߿șÿ¯zíÚ¿eû°iüdÖ¿šÔƒçG¥Ñ¿@é¸$tÉ¿ëÆ$ñ½¾¿~\›¤¿œ-¨Ÿ\¤?Ç…7Ò½¾?½ ûátÉ?ö‘â@¥Ñ?r³7ãõdÖ?*­ä´tíÚ?¼›f83ß?úæ}_–á?E "™šgã?dVéoþå?¢uö…væ?.R6û«¬ç?–ÇçØs¨è?‡U7Ïpgé?oÿËçé?È3åôH(ê?py-±H(ê?3‚4Ëçé?Ø›«{ogé?G<üq¨è?+70”©¬ç?ÆN,ƒvæ?l¸ïúå?á"Š–gã?­DÓÞZ–á?¡ÕÚ…3ß?ªd:iíÚ?ô½TédÖ?ÌH¡O3¥Ñ?(mfïøsÉ?®“x•½¾?‚Òy¹ßޤ?ȼÄU¤¿'A-¾¾¿ŽÂB@tÉ¿aF¹‡S¥Ñ¿4IeÖ¿[Á’íÚ¿r,ƒ–3ß¿pªÊ`–á¿5B:šgã¿8 ²ý忪gYö…væ¿EaF‡¬¬ç¿@›l‰o¨è¿ú,§8Wg鿘ô"‘çé¿/Ÿ) (ê¿ÒOù¯IÅé¿ú8Ћá…é¿o·ôfé¿ M¥5K迸Cu"Sç¿òa!æ¿ñ#­Zm¹ä¿ú Š:4ã¿sF2ÙSá¿è³9Œ½Þ¿þ‰tœ‡Ú¿ bŠDÖ¿?\Ž=‡bÑ¿äÞ-ëÚÉ¿Æ+§I¾¿Æˆ ØA¤¿oKA¤?85$ƒI¾?¡òŒÉÉ?wÏ bÑ? Äñ<Ö?6€ˆ•‡Ú?[éLø…½Þ?Èn)UÖSá?$q1ã?Fœ$Dj¹ä?J÷Š!æ?ò¦t«Sç?n®§+Kè?ìEuUé?.eÕ Ë…é?ïÃTÅé?®ÁSÅé?‰¢D6Ê…é?Äùô Té?6 )Kè?ñ…hSç?Ãч!æ?èp—ƒf¹ä?öh’-ã?BùUÑSá?œ³§­z½Þ?â¥5Ú?ƒ±›/Ö?’ª®ÒobÑ?Ç( ª¨É?™ûI=I¾?uþFü@¤?‘ÖOnB¤¿ îãõðI¾¿êÆMcýÉ¿ôþΖbÑ¿Io„OÖ¿:ú¢‡Ú¿".…¬Œ½Þ¿˜§A½ÖSá¿a8uí/ã¿¢ ìh¹ä¿61Z9!濵y5&S翼7j]>Kè¿jôÒNé¿Åb~M…é¿ oÐÄé¿J:ó eé¿ÔÈ•Ðè¿3£‹¤Uè¿”ÄJ­žç¿®Z;ج濞ÂEǃå¿$à­%ä¿£æ±Ðç•â¿ñí*µPØà¿T¡V*dâÝ¿Í –yÊÙ¿U:mùrÕ¿¼Áùè–æÐ¿* NœaÈ¿K#­¼q½¿ðèƒ@t±£¿´°Ö¡±£?ZM!­’q½?„Y®iÿ`È?Ô±¹fæÐ?ƒ©iNðrÕ?Ú«Þ³qÊÙ?2Í?]âÝ?$µ®MØà?Þ@]å•â?^-ª%ä?îЭnÃå?¤Ý®Ñ¬æ?†¯Œøç?æ¼Ë|åTè?¸ ?‚ÕÏè?äœoƒ™ é?(„ö7™ é?ÃeŸÔÏè?œDäTè?F…œuöç?tH½ùάæ?¥ÑVÀƒå?¨.´/¦%ä?ä+dà•â?ľ+PHØà?Ñìè QâÝ?¹‘·ûcÊÙ?†~­árÕ?´_¶z|æÐ?kWÈOÚ`È?Ø5¸5Bq½?Ñο¨r°£?‡ýK#(²£¿V¬Àr½¿æ’n?aÈ¿i:7OªæÐ¿b÷ûÜsÕ¿dð£ÊÙ¿<ŸýcâÝ¿¡ÐÚoLØà¿“]vXà•⿾büΤ%ä¿ÓR\ Ãå¿Ü!>â¬æ¿A³«ç8žç¿[g¸Uè¿©½ŒKÎè¿^¶tï 鿬K´Äè¿Âs…7Êç¿r­ðs:Tç¿C³¢Ì¤æ¿ª¸4’½å¿öÒ=Á ä¿äÙÚQã¿¶­ßkËÑá¿ÙAm’&࿪oÙÿ§Ü¿qÏÿ WºØ¿ÂÑ+ú¦Ô¿%Øe+C4п÷Éþ×_Ç¿{tf;¼¿=n»G±á¢¿‡é½éMá¢?I­ ¬à:¼?µia–À_Ç?‚=á.84Ð?çíUñœÔ?®K,NºØ? ,{§Ü?®Ì¹b&à?×~¬ÉÑá?¤ŽõQã?(䯿 ä?$CCå?ö2§@Ťæ?CËŽ(Tç?Iÿ_ÖÊç?âÚ=?è?’czÉ>è?¿Ÿ‰éÊç?ú1þx&Tç?¨täæ?¸Ž Œ½å? /š» ä?ÞnÁQã?ÖÀ—ÄÑá?󩤮‰&à?†I(qû¦Ü?½Ÿ€e?ºØ?ׯ¦NŒÔ?7h±%4Ð?Âü@(—_Ç?Ú¨ø …:¼?S…¯®…à¢?VNðÈ⢿˜2I‚;¼¿Ka}`Ç¿«`E]4п4‡A¾»Ô¿ T†´bºØ¿Ó»Ze§Ü¿N9wf‹&à¿[ò¬v¾Ñá¿ !ˆMQã¿§Ï2T± ä¿;X°‹½å¿W‘Qâ¤æ¿t»¨È˜T翤ÌüSÛÇç¿h‘‡t(è¿_}qœ°æ¿áwf¢÷x濘2 I¯ æ¿„Î ùdå¿P•ƒ›‰ä¿ÿ_|ã¿;^§.x?â¿jÚÿ·cÕà¿1QDƒÞ¿ áÒ7Û¿JÕ˜\׿ƑIŸ]mÓ¿«{¶à}οÞ[ÅÆ¿Hd8«º¿x~ùâIÖ¡¿'÷ÜÖÕ¡?’“¦ÿªº?üBªÆ?ªsozdÎ?_ -RmÓ?’vŒ \×? 5íš/Û?ncX8—ƒÞ?Ò€ðaÕà?*X±Åw?â?¢@ùh|ã?8 cž‰ä?/l då? Ç1ö· æ?¸@o5yæ?4ö'£±æ?ª­¥Q±æ?àhB@yæ?c[¶ æ?îqe(då?>pÇ ›‰ä?À­ ÃŒ|ã?jcs?â?³2‘Æ\Õà?Ί;‹ƒÞ?:û¶Ô!Û?fÉ·Ôü[×?¼á<@mÓ?öÏ_<Î?]V©|Æ?ȉOø˜ªº?çÙ¨ðÔ¡?º®Iס¿Dùq¥Ã«º¿3³¢ÕÆ¿ASôÅοdš˜D|mÓ¿^>\7)\׿¶à­8Û¿ø^}"ˆƒÞ¿ÐÕ¤üNÕà¿"ïx"[?â¿?¥b_l|㿃H„¯s‰ä¿DáÓÏcå¿tí×6 æ¿|~¯ˆix濺ú>g°æ¿¥Z‹BÍå¿~³Ûõâä¿}Ì£z俜þö5¸àã¿F§ÁªÅã¿&x«Ãâ¿ÿ$õà¿9*’–CIß¿¥Q /[Ü¿ôìé1'Ù¿V]@0µÕ¿ KJ© Ò¿Óxå7?sÌ¿JG…Ä¿þ^ínȸ¿ð÷œk“ ¿Ù:æ’ ?8½=´-ȸ?Éæt£ç„Ä?«;Å!sÌ?Ñó}ê› Ò?£(¬$µÕ?DN£¦('Ù?J¦ÑK)[Ü?Ôqñ@Iß?Ü\$õà?dÌ Çâ?ä^KÔÍã?cKwìÆàã?Y¿Iõ½zä?°ßÈV7âä?‚wô3å?ö² 3å?=×:[6âä?‹_’O¼zä?ÞÑ͘Äàã?Dx/ÍÊã?,q VÃâ?ÂÉžõà?—B6Iß?q«¶Ú[Ü?Û«K'Ù?5þt4µÕ?Ûf‰ Ò?çNÇ»örÌ?./8k¶„Ä?;nšá¼Ç¸?xYšã‘ ?³£•” ¿L9#,ɸ¿Èg^f…Ä¿Øy‡Œ¤sÌ¿ ã„½Ø Ò¿òi%¤PµÕ¿Þ´¯6'Ù¿ùœ'*[ܿȋ°Iß¿Dvîô࿬øòõŠâ¿û/:ã¿ÑѰcàã¿d14zä¿ò‚Cpíáä¿%q÷å¿lr¢Ÿ\:ã¿ÔîE" 㿇‡_óǬâ¿VD¨²m â¿<˰"^gá¿°9ocƒà¿êu:taíÞ¿DÖØº‡Ü¿¶ß$\ºÛÙ¿ò€û ùïÖ¿ª/óø©ËÓ¿^UŒvпv5š,¯ñÉ¿“œtN¶Â¿2/WI–™¶¿Åéí‰\;ž¿”ÛkP*:ž?È)gÿJ™¶?Ü*¶Â?ÖãèŒñÉ?ö_k®|vÐ?ïL³XœËÓ?º8îïÖ?èÆ©³ÛÙ?ü‚Øk·‡Ü?¨éÂödíÞ?ªùSiƒà?·!O½igá?¬¸ š â?KÖ’è¬â? äÈD ã?å ú¼¬:ã?w®þg¬:ã?æ€C ã?œVú忬â?{ü; â?©”¨fgá? «~eƒà?ËUº[íÞ?·r€¬‡Ü?XéD¦ÛÙ?JÿaßïÖ?š>Ç`‹ËÓ?K„*.ivÐ?øRW`ñÉ?"D#(]¶Ý¿; 2zmÝ¿2Ê™ZÛÜ¿¼Ü&vwÜ¿~´Mj„äÚ¿2wý@„Ù¿†‹È™å׿·^Wö Ö¿ô]é±€úÓ¿k°=ȸѿªKᘺ–οRplkypÉ¿h¶2 Ä¿ÈQÓø1꼿ÛÕ +v±¿€ÆpÒÜ[—¿†R ¡JZ—?4~ȼ·u±?¼ô4äÐé¼?œ ’P Ä?Šo¤MpÉ?±´ç’–Î?V]·¸Ñ?:%h¹súÓ?÷šðäî Ö?Űå×?lo·(K„Ù?¨°{–›äÚ?¶v]žÜ?0’(X’ÛÜ?Å• ¢`mÝ?vª#Á¡¶Ý?NGi¡¶Ý?ÐLÖ ^mÝ?µ€oúŽÛÜ?, ›™Ü?èçAd•äÚ?­ô÷uC„Ù?­Ihå×?µ)lëã Ö?s|ÉëfúÓ?”v9O¨¸Ñ? ØçÎp–Î?aRŽp&pÉ?Ï“e# Ä?“~Ü"hé¼?+cmð‰÷j)Ä?Œ!G¬£\Ç?-?W4CVÊ?&ÂËÓóÍ?c•PåÿÏ?ð…[2±ÑÐ?‰. ãê¹Ñ?¹lzpvÒ?V¡k-qÓ?xÿiŒeÓ?f»b<Õ•Ó? €=—Ô•Ó?ÛÊyŠeÓ?$uìmÓ?ooâkvÒ?|ïèä¹Ñ?x—ìÈ©ÑÐ?¸ß´îÏ?~x©ÕÞÍ?0ÿØ*VÊ?(ÒC¶‡\Ç?c¯­K)Ä?]?´XÄÀ?v ãclº?f9ÓPb³?g®ªQ§?,lŠjÄŽ?C ½rÐŽ¿Lç'a§¿Ž‡R^ö³¿×i¡‹»mº¿o¾ÕÅÀ¿N'w)Ŀ؂!ŠÒ[Ç¿¹×;¹TÊ¿‡)ºùû Í¿$×:Æ©}Ï¿_}cT[Ðп´;Ysp¸Ñ¿´V¯ÃætÒ¿ zÏ6Ó¿•¤ÉeÓ¿>ÊØ»•Ó¿ðQؽLÌ¿`›¼¨#Ì¿gd5ëˆ|Ë¿ªj%®Ê¿à›´jãÉ¿I®ï™fNÈ¿ZàùðÂÆ¿”eä¹VÿÄ¿‡vÛ@ôÿ™&ÉI¤áÀ¿0£hi#½¿äÓ(Þ±;¸¿`\¯†;³¿„'Oc‹«¿Ùˆe‰g¢ ¿\Í#ò§A†¿ìrßw(=†?1JÞÒG¡ ?2*w DŠ«?Föpi¬³?"§ÇÑ#;¸?V‚{ Ý"½?#’k`áÀ?&Kê<³Ã?¶Ià&ÿÄ? ãº¾ÂÆ?5\yDNÈ?Ò³aAÝÉ?w– ¬M®Ê?IѨö|Ë?H½ÉÓØÌ?¸ZjŸŸMÌ?x&!_žMÌ?…OFÕÌ?1óö¹ï|Ë?îõÄD®Ê?ѹ€¯ÑÉ?©œ:%6NÈ?'rH‡­ÂÆ?—‘ôÿÄ?,ŽÎå›Ã?WŽ“tEáÀ?ÉͮϠ"½?À+Gà:¸?æ C8a³?ï÷‰«?ói R‘  ?LÈ":†?¸¨â÷D†¿à ZnB£ ¿²§i“2Œ«¿®…³¿gD}¢;¸¿Öìi"½¿SùJÚàÀ¿™¦ï ÿý{ì¢ýÄ¿MÂßùÀÆ¿Bƒ—íFLÈ¿ ébú›ɿ¸9ôH¬Ê¿Ã·ûcY{Ë¿>.œeÖÌ¿_u¹MÌ¿P¾àÁ¿$iŽñÀ¿Ÿ „‰¶À¿Óô‘4!À¿±¾peù¾¿þ½ƒÈc½¿m‹¿Až…»¿Ë/(Dc¹¿Jó•Šæ·¿Ôš€i´¿¿hƱ¿Ê–T=M­¿Š,"±§¿"“Í;§ ¿® zho”¿ =€Tëz¿FRñbáz?DÖËEñ”?Ç—@ú¥ ?ò&ÆXn§?.ÊG÷K­?.vÜ!±?Œ3†9Úh´?¢"œ.@·?ÁI?ëb¹?½a.Ëþ„»?H‹8c½?ÑmXýø¾?ã0¸s2!À?Pî…!žÀ?ª5ÙòÀ?ª1kFÁ?yî‘7EÁ?æuË;òÀ?sÒvžÀ?7»¨è)!À?2UL(çø¾?W½ƒc½?’g‚éÝ„»? é¼Äb¹?ˆ îÚ·?þf#ê§h´?j4Üu霱?kŽdMzK­? î$™å§?<—Îf¥ ?9&퀹”?|‚ØcÜz?ÓðHB4ðz¿"÷I¿˜ñ¾B”§ ¿3Z`ð§§¿aœ$¦|L­¿ }· Õœ±¿<ÏÇ÷h´¿5œ‰àÀ·¿ÞcÞ/Ô`¹¿?­ï(y‚»¿X‰qp`½¿ö}kê)ö¾¿·æÀ¿l§SÀ¿#È£HMñÀ¿ C8sÁ¿ÖX–lÛ¦¿f7Ä}E£¦¿#‚?Q9¦¿)«Â ˆ”¥¿ÿ„‚¸¤¿„ÈÖ…©£¿ ðZi¢¿1ìL@Êû ¿‘ÏDKAÉž¿ÊÑÏO›¿ b»àš‘—¿95ïš“¿‡œ<r䎿ÆS‹W¨H†¿m˜Ìõëz¿±<†c¥b¿Ø4ëòa?-že áz?ZÌË,"C†?Óâî½ÓÞŽ?àl4F0—“?62;Ê¥Ž—?¹ÿL›?b®p®Æž?èÑFÆú ?4Ac°Tg¢?†œ++§£?Ã2«¬‹¶¤?£uÙ’¥?ÑäáVô9¦?©ƒKAª¦?ÓŠ*«â¦?¨Ó~¦â¦?1<Œ3ª¦?CYnOÝ9¦?Åü£¸’¥?svÛƒa¶¤?16÷¦£?ê¯Wg¢? ˆ”èÓù ?ÚÃwhÅž?›{ FK›?Ê÷DÓ—?…HPÎI–“?W¨É6ãÜŽ?°<-A†?ŸÓÙÝÜz?GgôÔêa?¼TàáËb¿ð9i<ƒîz¿4õZüH†¿bÃÐ-㎿‡=ü&3˜“¿ËÆ“.Ž—¿ ÁS8êI›¿“头ž¿Câ5RY÷ ¿ÚvÛd¢¿j¦ùµ ££¿2Ž ³¤¿ôæN&ù¥¿Ðg)&þ7¦¿°#n¦©¦¿ŽG!%.ি\,šž*§?¸?)ʦ?Øë³/Ò<¦?gÙ›™¥?ý  e¾¤?œ›ºb,¯£?JPo¢?ÃÛgìo¡??¨ö\†Óž?X`~&X›?ñqC×™—?ÔÎLퟓ?fÆ5©œìŽ?„Ò`` M†?yÏ}Þìz?²h>ãFúa?­;×"¹b¿:ʽ¯øz¿ ã¾] S†¿FT¹ÃòŽ¿ òÛ¢£“¿Âm Jpœ—¿vy“[›¿--[Hמ¿É|2|¡¿ÔÒ?dq¢¿âl/3Ö±£¿‰ ¼Á¤¿‚EZwž¥¿–v¬ èE¦¿$qTq¶¦¿v²ËýþÛ8樂Z·ÏB~¶¦¿¡L϶ýE¦¿”Ò镞¥¿l‡¾®ãÁ¤¿së”:²£¿¢‘äžq¢¿5B3®À¡¿ái4Eåמ¿ l`>D\›¿ïÆü34—¿õÊ÷𣓿ô~Ö™ŠôŽ¿”«áøäT†¿òZ´˜Züz¿ˆÿW,b¿Xh—{¤ôa? Ãçõ-ëz?hnc#M†?¨ìœîŽ?º—0­¡“?” «œ—?TAï¥Í\›?ʹ{’Ùž?æí;d¡?¡¹°6:s¢?BU! ´³£?ö`W¿Vä?X1µoŸ¥?ÌÐeºE¦?ƒÆ•d´¦?ð¦KßRç¦?TÚiBÊ#Á?ãUpùÀ?Ô¸%ŸžÀ?¹DYE±"À?‹NجŸü¾?$šÍg½?BŸ¼ºˆ»?yÊŸwf¹?·vØÎ‡·?ïÎà„Ìk´?Òiº±Ÿ±?Zwº/=P­?Vê=Âɧ?ÀUF^¨ ?ˆ$Ú²·”?¡4aúDäz?ÀŠ[HÂðz¿Êb5ÕÞ ”¿LâØù© ¿[_¥Þq§¿ØÉ÷Q­¿Äº]Éš ±¿ãb;ÌÅl´¿n ÚÞ–·¿ár¤g¹¿ÆÏ슻¿¦`Ü™h½¿Ê §<¡þ¾¿ÍB$ $À¿t¦ˆ¾$¡À¿ªœE*õÀ¿ziB‘aÁ¿næÊbÁ¿ÌpF-õÀ¿v;?Ç)¡À¿ã¹Q:'$À¿ÖGų³þ¾¿Å%ö¯h½¿˜îºF,Š»¿LÛglÄg¹¿ÉÈõ‰»·¿U’!ïl´¿Úò~™È ±¿¦6QËZR­¿.ü®øÛ§¿¦~gª ¿DÐp¸!”¿¿zçóz¿±q ±áz?*šÑS”? ºòY_¨ ?Uðsæ§?jQV8ëP­?")_yE ±?` neàl´?o3j5Ì·?p +aíg¹?±î‰_Š»?ˆÄÙh½?û±2·þ¾?4z„ï$À?q*½Å À?P¨ª NôÀ?n®ù vÁ?µ­HÀQÌ?ŒŠæé Ì?ÔDçšQË?­mó4°Ê?$×õ¾ŸÉ?¡„S¥'PÈ?z†Zº—ÄÆ?³ÃrÝÅ?~¥ä6T Ã?­«×âÀ?1;W3i%½?ª¹ÆÆB=¸?ÖLí"U³?R )𚌫?:"³™¢ ?7;Ó“?>†?:­ÍÐD†¿pN B¤ ¿ÒJXMŽ«¿îÂ5³¿ûajî->¸¿j‘¢§b&½¿íÒ…b]ãÀ¿ñêž&ç ÿsa—JÅ¿6E82RÅÆ¿+P{ïÿPÈ¿pŸ±üº É¿ 'y¡G±Ê¿i*Uë€Ë¿¨@&ø Ì¿®~DÅÇPÌ¿Ôûô®ÈPÌ¿µø±åú Ì¿ŽÈ‡ €Ë¿<îã%N±Ê¿±„xàɿ­Òt QÈ¿ôÏšÔ^ÅÆ¿í¦¬Å¿bµ6ø ÿüëbµpãÀ¿¬™.º&½¿6ð]>¸¿n0Ýeh³¿6Þ7·Ž«¿ÁZ\­¤ ¿ÿ‚XˆhF†¿CÔ¦¤Û<†?¦ÔDÀX¢ ?šô 0€Œ«?Þ¡9c³?!z6?u=¸?.”î`È%½?B­²RãÀ?TáV Ù Ã?yäÓnÅ?™o8ÅÆ?#ø«ØPÈ?FÏÙ~ É?äevwí°Ê?Îv ®†Ë? Qœeb Ì?K”nÁ˜PÌ?.ž7„\—Ó?ûv:¹gÓ?I`Þ\‰Ó?º,pwÒ?î¼¾äºÑ?º.Ëe¨ÒÐ?> áÏ?À}wÔ¼Í?F‘îéWÊ?(*F†^Ç?Ê÷~Ï´*Ä?ÇWáÎŽÅÀ?CûŸÛnº?hÃKÊè³?}½¦j§?ÞzÔòðÈŽ?Lc^`ÂÏŽ¿¹‘ü$§¿K”p¿Ê³¿èð>ùoº¿áùYŸ ÆÀ¿5:?a7+Ä¿\~Q¬^Ç¿N˜Ñ„XÊ¿RyihÍ¿¥r¶£‚Ï¿5sÀ^Óп6ß«b»Ñ¿~¥ÁöwÒ¿žõ0³Ó¿*ˆÕ%gÓ¿4I %s—Ó¿4Ås—Ó¿xU'gÓ¿ô?TÅÓ¿ œÎ°ùwÒ¿ _Å€f»Ñ¿èß#$Óп«A¢®‚Ï¿ _%vÍ¿÷‘»Ü“XÊ¿«ß‘W¾^Ç¿‘A²K+Ä¿žo02 ÆÀ¿T-S5oº¿0–T¡ÿ³¿Ÿ¢ ’§¿×*Z•ÑŽ¿jÇFÇŽ?c"¡ §?y¨) ų?ì_cnº?—†‘ÅÀ?ì õÒÆ*Ä?©¬Ž‹^Ç?\MªÇQXÊ?<5(»Ñ?.ŸÞ¶±wÒ?«ð<³Ó?cL}ÕfÓ?…ðš48—Ó? Ëô5ÌØ?n_¦ˆØ?$½‹m"Ø?×5‚Ã+`×?ÌŽ‘ŽqÖ?`oxÈ•KÕ?ýò•EñÓ?Šwû˜jeÒ?fž@`¬Ð?Þj½Šp”Í?Ô©²/‡É?Q;•íû:Å?™9b5nºÀ?šSIí@!¸?.§ëH$­?–ù£b|“?hãNá“¿ “™ &­¿¼Jbº("¸¿LÍYæºÀ¿EžÒÿy;Å¿ò¼Sªµ‡É¿•„8Á•Í¿Ö !пÚu±ÁeÒ¿Ô…é8yñÓ¿ª–EæLÕ¿ê±üSrÖ¿àšÆ`׿î"ÍÙØ¿©›»xŠØ¿ú1¶®Ìؿ݄€¯ÌØ¿£ßŒ‹Ø¿â"äÚØ¿ î"É`׿E™µrÖ¿ >ú! LÕ¿ WÞ^~ñÓ¿“®ÓÇeÒ¿hÎ| ¶¬Ð¿”ôµo•Í¿^)¹Êȇɿáö³;Å¿qTµþºÀ¿äS^º^"¸¿Å‹ƒ&­¿9õïÎÝ€“¿4œ‚òZ{“?™E»ÆÃ#­?,éáÃ!¸?äyÂWQºÀ?BUn¾ä:Å?jh !‡É?¸t¼sË”Í?ºí{R…¬Ð?FÊka‹eÒ?Š„Ý28ñÓ?»Ô»KÕ?ô¾}f¿qÖ?ÐÅë7m`×?/éP­wØ?cÈKNØ?/·&9ÌØ?kÍÇãt·Ý?MëüŽ@nÝ?=FÔòIÜÜ?À±FΖÜ?6‘ÌŬåÚ?®“qn^…Ù?!é Øæ×?Ñk”Ué Ö?©xÁŸYûÓ?ä&S€„¹Ñ?V4Ôõ—Î?äçèrqÉ?@kåO3 Ä?mÉl ë¼?FÎÚ8]v±?nÔ[ï‚Z—?Xµ/é ^—¿´ìfBw±¿Ô‰Ùô뼿tqŽÙ¬ Ä¿²ïªIòqÉ¿v*xÝ|˜Î¿(á-â̹ѿô_¨ûÓ¿¯8ŠU? Ö¿ õÛq{æ×¿nð 5Ë…Ù¿.ä´.æÚ¿ŒUÑ"AÜ¿`jÅ7AÝÜ¿ìÐñóoÝ¿aoÊ]¸Ý¿¤Uâ^¸Ý¿f|ÞÚoÝ¿7ð½BÝÜ¿$JPCÜ¿Ç!a”1æÚ¿Ysÿ×Î…Ù¿Žéæ×¿¡ù¹D Ö¿ÌäÑ€®ûÓ¿fCyԹѿªŽ˜Î¿’6  rÉ¿þïæÄ Ä¿™_<€+켿vülÕw±¿.8½,_—¿bÖR@Y—?ùäã v±?m1Ѩê¼?”¬V Ä?ìþù÷>qÉ?¬Ðä^×Î?‹Û g¨¹Ñ?.2RônûÓ?ª×–Cõ Ö?­BL$æ×?Üvñj…Ù?ËEÛ ÉåÚ?髨Ü?s¬ ãÓÜÜ?ÊG˜nÝ?0R(­·Ý?ÒÃË×$á?xs^šúà?ª-(¸¦à?9ø8È)à?~Ïz=™ ß?†fŒ sÝ?ÚŒ´ÉÒ“Û?~MB2 pÙ?Zbâ³×?ÿl¢ísÔ?j¨qa¹¦Ñ?0O Öþ[Í?X·-¼&"Ç?Äs/D¯À?ðV{&´?n€ð6ôòš?tªxÍ~öš¿~ÍÓP`'´¿(>ás¹¯À¿Áë€  "Ç¿qºÄµ}\Í¿¦Å4gü¦Ñ¿¶H5tÔ¿ÿÉÌ©׿F¹&ópÙ¿{k[Å,”Û¿>‹_hsÝ¿&§Eo ß¿v:*à¿ùKKD§à¿"¥B¿hûà¿8¶å$¯%á¿] çB¯%á¿0(iûà¿XlFåD§à¿ä¾*࿈¿ ß¿é+óTksÝ¿Ö^9w0”Û¿ÄL±÷pÙ¿ž/1׿_5Ê;tÔ¿’Qây§Ñ¿Þº}&‘\Í¿€µÔn·"Ç¿9ÑoŠÕ¯À¿@Ù³¯£'´¿.HóÀ÷š¿uþfAuñš?úoùD &´?¼ˆ*¡¯À?„ÁÇöÛ!Ç? ”ý°«[Í?nýߢŒ¦Ñ?Ú£ÌtÔ?l‹Ž)¸×?0 ¼ •pÙ?>g„ À“Û?ÇêòrÝ?Ñ+³B‘ ß?üèÂQØ)à?„9A§à?<Âÿ3ûà?mi?.I%á?»Xvˆ9ã?4•ÏK ã?~”º¤ù­â?“óK¶S!â?¬Îe!há?øéÃv„à?Býp¬ŸîÞ?.Ûã ÚˆÜ?P3Ó »ÜÙ?fj³~ØðÖ?šÊäóeÌÓ?6¡®"wÐ?ÌÛ+ÄŒòÉ?¨ÃÙ¶Â?Æk€š¶?(+¯_:ž?ðféèß=ž¿âɲ'æš¶¿±ƒ’‘M·Â¿q\óÉ¿Ðawп³ Ÿ§ÌÓ¿|µ(ñÖ¿¤¢MÝÙ¿{HÖ%)‰Ü¿§±ûòîÞ¿=¡Æ<„à¿á²2ÏGhá¿þþ]h!â¿b'֭⿎_–6 ã¿°½@[¡;ã¿ñg5p¡;ã¿ÂˆÖ6 ã¿øÒ.uÖ­â¿´~ýh!â¿É|ϦHhá¿¶Gà=„à¿ÔT<ËõîÞ¿ÝJ ²,‰Ü¿¸ÛM ÝÙ¿IJ¼#ñÖ¿üç™®ÌÓ¿rf]ÍiwпˆDÁLóÉ¿i #i·Â¿˜'.z+›¶¿ ãá¶Õ¿Ö¶}i(Ù¿.K—ºŽ\Ü¿– íÇJß¿ÄOß¹íõà¿XRµð¦â¿e€îû¸ã¿è™hS»á㿾¯öu¹{ä¿mWU»7ãä¿a¡1ü6å¿ã™?7å¿5&RÝ7ãä¿ýj±¹{ä¿0¾¬»á㿈øÈy¹ã¿;oœ§â¿\ F îõà¿âüÀQÊJß¿ð¸žå‘\Ü¿8R6­m(Ù¿÷±çÂC¶Õ¿H3“Ò¿fŸÇ¾tÌ¿s|-T0†Ä¿â<¨¿ʸ¿½Ê6oq• ¿ä UÓ’ ?Oc€\]ȸ?îåYhC…Ä?0Þ²ºsÌ?LçfÏÒ?ðÿ°¥µÕ?ŠÄ%(Ù?€•¾5$\Ü?4Ù*?Jß?6ÕX Ÿõà?V­Sâ?~îGgã? ãÔ´sáã?ëç:¼ˆ{ä?T9ãä?äd¼èÀå?¶•½8$±æ?RѾZMyæ?p8¶h æ?KL#¨Údå?–M,lŠä?ýU}ã?ò±0@â?¾í< Öà?ˆœ‚΄Þ?6¢i†Û¿D‰€X:]׿{ö7ÚTnÓ¿©ÞÂ&ŸÎ¿±WíªüÆ¿ç•?a𬺿hùJiXØ¡¿Ä‘ºÄÕ¡?w‚×+:«º?wãTç?ƒ?Ç×Êç?!ŸÌ¼è?hÒÕ¹é?æûJr{Ðè?;JL/¯Uè?˜U\Ùžç?+*غ­æ?nàÜã©„å?v»~§†&ä?û4+­²–â?[ëÙà?ÂoéãÝ?4PËÙ? ¼¹¤ÛsÕ?¶oôCçÐ?ä€7~üaÈ? ‘£¢§r½?ô§[u±£?à@½Òõ²£¿~w>Pis½¿ø.ø¡^bÈ¿|:–uçпrã%tÕ¿d峿ÄËÙ¿>P‹áãÝ¿³Q½&Ùà¿P«Ó–â¿ Æ› «&ä¿^ ÕÔ„å¿­ "ñ­æ¿ërq#Ÿç¿aÙŽVè¿ÿgZÑè¿^¸&&Öé¿Þ³Öé¿ YËÑè¿nïÔªVè¿f¨Õ"Ÿç¿©în^ð­æ¿/MÃïÓ„å¿ë%ê ª&俬~ûÒ–â¿îr¬%Ùà¿0Å-—ßãÝ¿Hq=ÃËÙ¿WCytÕ¿ÀH6Tvçпp x¯dbȿӃs½¿Í|£¶W³£¿£+Œ¼Í°£?ò\»·r½?o³ÄaÈ?™1‰ÍïæÐ?¼®%F`sÕ?¸œ.åÊÙ?–#¿–kãÝ?F{ZQÊØà?þí„E^–â?ï*Š&&ä? … åF„å?ìw! a­æ?´8 ’˜žç?}a#®›Uè?Ÿã®v§Ðè?ܳïÊ‹é?8ŸWïÅé?}õæñš†é?V_Ù´Gé?1CA|.Lè?‡EÊê"Tç?d¾àcŒ"æ?12_ºä?]D %ã?D¥Tá?ƒºô¾Þ?Cv¤ÐˆÚ?]º=©@Ö?ë‰SHcÑ?iJ½yâÉ?ö¹mšºJ¾?– ?B¤?¡'QiC¤¿:AàÝoK¾¿ÀŠ¡ù=É¿mÀvcÑ¿7RX pÖ¿Ÿ³µW‰Ú¿dð]B'¿Þ¿-çØ¿Tá¿‹k»·1ã¿ê@$ú~ºä¿Šïë–±"æ¿ "3ƒQTç¿}²Õ?mLè¿äסé¿ÒöŇ鿽LV©Æé¿(Œ•2©Æé¿\ª‡é¿ì±$j é¿É% IlLè¿s‡ÔGPTç¿Í;°"æ¿¶A=}ºä¿»kIÁ/ã¿Ýб½Tá¿h9Ó¬"¿Þ¿˜¢s¥üˆÚ¿úU ~kÖ¿*R2¿rcÑ¿«g­V8É¿«=wmK¾¿>bš–ƒC¤¿z*°–¯A¤?v´¯cJ¾?.}þŽÉ?ú$ËübÑ?éò¿Ö?6„<ˆÚ?B‚‘—’¾Þ?(±5MTá?  ̤ã?tGT·á¹ä?lêm "æ?V8¦Sç?@<ÄKè?Â7Îcé?–µ‘Yž†é?aÄ™[Æé?»ï )ê?d} TÙèé?71=hé?¼9p§©è?ŒûÝÚ­ç?ÿœ>ó¨wæ?JÜ… å?ô“Bì—hã?GäËíD—á?1Æ&5ß?§µûÑîÚ?‘âRfÖ?û!a˦Ñ?¯T>NuÉ?†EMà0¿¾?«ß¹Ïì¤?Yö;‘¤¿²„ØØ¿¾¿±àŸ¢uÉ¿¨¹iIJ¦Ñ¿:Ù=ÿ?fÖ¿:ë•üîÚ¿ùÚŸTR5ß¿$#iž[—ῪÝ~¯hã¿€dB) å¿”“$Äw濤՘û­ç¿\’lЩè¿y+™×h鿸`º¬9éé¿¢5ø!º)ê¿'åùñ¹)ê¿.E9éé¿Ôe7¨Öhé¿¶ Ï©è¿Omiù­ç¿*[úvÂwæ¿\4Ö' å¿Gb:š¬hã¿üb]SX—ῦ‰\ôJ5ß¿ÓkÕrôîÚ¿†=ô,7fÖ¿OŸbê@¦Ñ¿~*MuÉ¿×öù²¿¾¿G‘Y ù¤¿í¥ñ^¤?Ìq+\,¿¾?ÆJ;/uÉ? ¶êð¥Ñ?›¶¾È£eÖ?œu&sèíÚ?̆‚†4ß?›ßx†Æ–á?õ–„»hã?<êq å?|y wæ?h;92­ç?Å"®z©è?øughé?£+Á’èé?á±so^)ê?˜eÀ 4ê? W:Ðóé?aw£Esé?<*[Ûì³è?Ýcñ¬·ç?Ù$ƒµô€æ?ÁùàõÁå?”þh8›pã?ÍÛ99‡žá?ÔæsæBß?ÅôíùÚ?/=RoÖ?2ulg­Ñ?¿6*ÏÉ?kë?Ëâ˾? :s˜¤?Œõ™¸§™¤¿(Ë™}̾¿Už8€É¿ ŽÞ­Ñ¿«èÊjxoÖ¿ðx?úÚ¿¦`ñ‡+Bß¿õ¹¸™žá¿>g«;­pã¿äI 9Óå¿+¶æÆæ¿=Áñ»·ç¿Þ0ø³è¿ÄŒ+áMsé¿æR0Ëäóé¿€SÆ4ê¿Ø¶Š4ê¿ÙiÑäóé¿k>?±Lsé¿{Õ4cö³è¿G丷翥¶æ¿×-úÏå¿©vi©pã¿ö‘ÒH•žá¿¸ÊKU!Bß¿9*êoúÚ¿þšÜ1koÖ¿ÿ&nâ~­Ñ¿·ð‚JúÉ¿ÈZD0̾¿Ì"³ú˜¤¿fs 6™¤?´;¤M̾?k :€É?K.ZPw­Ñ??Æâ,oÖ?ÙÄi‰ùøÚ?T FÑ@ß?F>KgÍá? °ã‚áoã?öîÈÔå?Åøù*€æ?>?6SÕ¶ç?ؾR³è?.F.·Nré?ƒË‚ýéòé?…E ê3ê?Ã6å\7åé?¬4 8³¤é?¹?³`%é?ı§;7hè?Š;ñnç?z-Õ~ì;æ?SÙIÒä?z„1óô4ã?ùªü:vhá?ˆÈ>âÞ?N­áM$§Ú?Fö5y*Ö?à•|ð'wÑ?š|ÆD1É?«cm¾?„g*HY¤?,Ó„bZ¤¿*¸e.ðm¾¿€/#Õ1É¿B×§gJwÑ¿.‡´Íš*Ö¿ÎÊDE§Ú¿u:æ=9âÞ¿½Õ³„há¿}I¨5㿌´á1$Ò俜@Âñ;æ¿”ïXîn翘ò%hè¿ÎBœž/%é¿ÔÊÏ;¤é¿Hô@tä鿌Á$,äé¿fß®ö:¤é¿ÂO$2.%é¿pË#h迨Ÿ™·ënç¿,• {î;æ¿"7: Òä¿,‰ñü4ã¿oy\*há¿4x‰V,âÞ¿‘6§Ú¿#·†[‰*Ö¿]÷!6wÑ¿2ŸE¥1É¿OæíŽ}m¾¿äif³KY¤¿L÷O¤Z¤?>Ò‚âDn¾?'«(2É?ˆ¼ ½—wÑ?$À¯ )+Ö?õXŒI)¨Ú?¢°¹½0ÞÞ?±WðÛxgá?ÜÞ4ã?8y&Ó:Ñä?õ›™Òü:æ?Ø®çmç?R•l}gè?ê Wè#é?ycˆ÷£¢é?T^Òáé?ªxC´7é?!p2Ó›øè?d%׋|è?íÚ§åOÄç?7\:`Ñæ?n–¦å?ä‘o@Fä?¤ZÏ4ñ³â?lÂk‡óà?¨[*¦Þ?f ¶ôÙ?%Y“•Õ?ÒåóxÕÑ??ÂM…SˆÈ?^ zB¡½?ÈrФžÐ£?¦ŸŸÑ£¿p+ü倡½¿ÚKÙp’ˆÈ¿O²1ôÑ¿æT*ô°•Õ¿b©ø­6ôÙ¿Ôóó¾¿Þ¿&ÌÅ#’óà¿öÆX™ù³â¿íôˆ¾DFä¿9(À“¦å¿Ã‹‚Ñæ¿Ìd‚“.Äç¿)ÑC|迲ÖÅù÷迺7®!6é¿.§†=!6é¿7Ëø÷è¿»æÙuA|è¿D=£>,Äç¿Ñ.¹ù~Ñæ¿³J+ð¦å¿@Ÿs@Fä¿ÿ1ô³â¿÷áÑš‹óà¿%Äd°Þ¿A#²ª$ôÙ¿ûoÛ•Õ¿!¶ÛÑ¿¤—QVˆÈ¿+*zî ½¿À°2У¿g”p%tÒ£?Ro±ú<¢½?ŽYÐ5‰È?2F’>ˆÑ?Þ$‹Þ–Õ?EÚì4÷Ù?ÕÜy¶Þ?_Bw6Cóà?=Á?Ÿ³³â?òàÿEä?ÒX:I¦å?¸K`Y+Ñæ?hÏDVÂÃç?g%Iµ®{è?ªØ'á÷è?7Ÿr¬44é?F%>«5)è?içjTÃíç?Kc/,wç?w©ÙžÆæ?CcÊ!Þå?Lƒ‚•¿ä?àé[‹Úmã?ä°Qìá?&aî˜>à?1ì.ê©ÑÜ?P ×ߨ?R‚Êa1¯Ô?:EÔINLÐ?“2úy‚Ç?WUN@Ãd¼?SC<›$ý¢?HXå þ¢¿$h›Ç6e¼¿:‡x’²‚Ç¿è'£iLпV RK¯Ô¿4ø-ߨ¿‡Yð¾ÑÜ¿Kxa¡>à¿Z÷~‘Vìá¿Ï‹âžÛmã¿§9z¿ä¿ÛžbˆñÝå¿Á²ÀÆæ¿²C-`çvç¿'×|uíç¿Ü2 É)迵_Þk)è¿§»Mctíç¿(Ȉåvç¿~Ä×"}Ææ¿ä­%îÝ応´AÇu¿ä¿~©/fÖmã¿'hRPìá¿"¤lû™>࿤¸­ÑÜ¿›Œ¦sߨ¿ÌÝ 3¯Ô¿¹ ÛLLпÖ+flm‚Ç¿%Žd¼¿ÿˆñiü¢¿üÝÕX=ÿ¢?™Ø%f¼?¸`v»mƒÇ?™;Þ¦üLÐ?ŠÔ¸P,°Ô?¼3È¿@àØ?`èM(ÒÜ?†>à?Ú¾wn,ìá?´Õ*a¥mã?âw*9¿ä?в‚“£Ýå?„íïúÆæ?îr!Govç?2-Ëãìç?ÏQQ(è?ªÆåV¦»æ?€tŸ‘¸ƒæ?¤8-æ?ìFUg)nå?zbO“ä?Wæiè¼…ã?êlä½ Hâ?¶øÆGÝà?â·uîã‘Þ?=ȶÛÛ?v»´îùf×?˜+¢–fvÓ?†4ý°«Î?ÆtkÇõÆ?/>¶d·º?Tñm­Þ¡?‘SŽzÔÞ¡¿8]gVÍ·º¿¯&Ä(Æ¿*(¿áà«Î¿wPuw}vÓ¿{ô× g׿2ÃäcíÛ¿ã»äuñ‘Þ¿L/¯KÝà¿Ô8@º Hâ¿~¨5‰·…ã¿ÂçB“ä¿Ë•ßInå¿i_Ç4æ¿^°cnƒæ¿Âî}層濢<€‰¨»æ¿Ö6;œƒæ¿TP0濾ʎln忚='?“ä¿~ײ…ã¿Æf°Hâ¿V!ØDÝà¿ïKâCá‘Þ¿À¬ºRÚÛ¿:£Ú6øf׿ÿîÉcvÓ¿aE\¢«Î¿‰DÞÆ¿fO”·º¿(¾žÝ¡¿þrÝû&à¡?ª Á¸º?¤Ë9ÂÔÆ?¢”äʬÎ?¨{E”wÓ?¢|—›g×?'àÉ9Û?Y‡Uôò‘Þ?zÅu3Ýà?šÈ!lâGâ?'’>Æ‚…ã?Õro“ä?=ùÿÇmå?n|Þ¹æ?RGƒæ? C¬Ðn»æ?a¯j|íä?d‹¬¹ö¹ä?´YµÛKSä?íD³i}ºã?dZÄ–ñâ?&Hmàøá?u‹¥iÔà?Œ•ë ß?BY v$Ü?oB¡öØ?ç]ïA‹Õ?lZZ%ÄêÑ?ªð3š6<Ì?C@íH]Ä?ÛOmM˜¸?<Å–òÌr ?†lêÈs ¿Ö#΃¬˜¸¿Ã±w]Ä¿p•0™b<Ì¿„É•ØêÑ¿ûÂjS‹Õ¿÷,gµ°öØ¿çnR‚$Ü¿@Ñ;Úñ ß¿ÖZÌùiÔà¿ÇñXÝøá¿÷Ñ\ýñâ¿‘í*rºã¿þã?Sä¿<Ìkñ¹ä¿`AJ”‰íä¿¢¦Ò&‰í俟­"ð¹ä¿ð%¯¸=Sä¿>§@oºã¿òëEøüðâ¿^Ðù×øá¿¥8ÝcÔ࿦ÃAã ß¿¶|Äq$Ü¿š¿îyœöØ¿'Ñá¼;‹Õ¿t¯Ü¼êÑ¿ò|~!<Ì¿TçÍC*]Ä¿¸j†÷õ—¸¿dt«åØq ¿€ò¨õÚt ?P{Š™¸?ÏnË:^Ä?”ÉÃØ=Ì?´ ‚½7ëÑ?ý¸âÒ§‹Õ?Ë®ãöØ?XËý¦‰$Ü?d[…¤Ó ß?C5,QLÔà?ËÝ/ܳøá?*ÛjÎðâ?œôS8ºã?¿ÿìÝSä?îGð„¹¹ä?_‚/_cíä?Õ Š¡¾â?@¦Âÿî4Ù¿š€¹;þ[Ö¿Ë÷6ÜìKÓ¿éUËG п¸*on"JÉ¿?é¦Y=¿ê,¶¿¤æTmDu¿€Oäz?^Ê6¶?jÊ}>Â?WÑ;/äJÉ?Åt”©¤ Ð?Nø °;LÓ?9Q4\Ö? ÎîÉ5Ù?¨þ$i´ÏÛ?„3þƒÔ%Þ?–|ÜoÒà?æø ÷à?—=L[v«á?ƒ8îR4â?2ÖUâRâ?ÓP”¾â?Ól'·–/à?÷³Ð&¶à?@9fÏ›pß?X=™"C„Þ?誢8ªLÝ?©¹ÒÒÌÛ?¤:ÇqpÚ?äg˜#ߨ?–G×ÄÕ?Hª,=©NÓ?ªð 3 ©Ð?B$d÷Ë?^Ï6ewÖÅ?Yÿ%€¿?þè[…²³?´Këiq™?–cx¯r™¿0½C³³¿4vdØr€¿¿W-²^œÖÅ¿¸¥Ø#(·Ë¿ÓÝ´¯©Ð¿rÃŒ©¶NÓ¿v­È#ÄÕ¿p,ƒEçØ¿¤ÐËŸuÚ¿NÓuOÕÌÛ¿x˜q«LÝ¿*ô`xD„Þ¿ž©c¡pß¿6¹…½à¿f·&å¤/à¿.!Ül¤/à¿×Ÿ’¼à¿Ppࣜpß¿%ïο=„Þ¿ö4³C¢LÝ¿2VAdÊÌÛ¿îIØkhÚ¿˜Mר¿ô’ütÄÕ¿ôEf¡NÓ¿ˆ­/—©Ð¿˜¿ÉÈï¶Ë¿@Ô÷Å[ÖÅ¿f%3 ß¿¿XëŽZ³¿?¢ÛB±o™¿kŠÈt™?Ì=([¡³?ºã&¿?Ô²¡ûÖÅ?þÆT‚·Ë?L=5]Ô©Ð?š;Ó—ÌNÓ?b×:.'ÄÕ?G,€×Ø?DìüdTÚ?°Kû—¥ÌÛ?y °˜pLÝ?<¤„Þ?ƒ=Þ`pß?¥’n¸ à?8"dÌŽ/à?êxÿ×§‚Ú?;b– UAÚ?$YE¿Ù?Ð} ¸ýØ?w@¯†‹þ×?ÞÀ(;5ÄÖ?w˜+ä¼QÕ?—h´ªÓ?27/ÓÑ?võ 9oŸÏ?¸˜Ú‰JË?ˆÂ\²Æ?lª€9âÁ?«vúÿ˹?õstç'¯? ë<ÿÕ”?bZ .×”¿´7ù¾|(¯¿ìütH̹¿5Ìm\âÁ¿t`f|²Æ¿ôOq§JË¿|¡È|‰ŸÏ¿M¶gV:ÓÑ¿r(Å­½ªÓ¿.N¥IÄQÕ¿˜ûN9;ÄÖ¿eu!‘þ׿*o¿ýØ¿\×ÊO¿Ù¿Ü#Ÿ.fAÚ¿8/”wÁ‚Ú¿–f€À‚Ú¿6·ÕEcAÚ¿:4çéJ¿Ù¿ Š>#¸ýØ¿{Dë'ˆþ׿þ0d0ÄÖ¿„íSܶQÕ¿žð×Ó­ªÓ¿/£ã'ÓÑ¿ìpû^ŸÏ¿žá%ØvJË¿°Ü™'E²Æ¿òè›âÁ¿>sHȻ˹¿Þ›B'¯¿hAãùsÔ”¿ìT^ûØ”?6@k")¯?>þšÇÔ̹?öÀ³Ü¢âÁ?°Œ€!½²Æ?óSú)ÚJË?³Ð£¾¦ŸÏ?h–|È;ÓÑ?Þž?±ªÓ?œûþàªQÕ?tPÁçÄÖ?Š{Š×dþ×?XKÝwŽýØ?vu\K¿Ù?­µ°R:AÚ?I'ž‚Ú?„Mt„hêÓ?wž¾ÃT¹Ó?^vj.ŸWÓ?úp)8ÆÒ?Ø•.†Ò?HÛ™%bÑ?‰ £Ð?¦ lPŒŒÍ?x wöÈÊ?Ò…Ê4žÁÇ?û…#­‘€Ä? 6Mù Á?¤o ¯Þº?ðó½-a³?žÔêÉÇg§?6ÕHN?ÕlõW?P¿j¨ò1Th§¿gh4lqa³¿dU§±ðÞº¿dá@ Á¿VÚjb®€Ä¿‹eV¸ÁÇ¿Œq¯R0ÈÊ¿ÓÍâò ŒÍ¿.ÍÉÍпHö;¦jÑ¿FßÛŽÒ¿LE¯Ò€Ä?*n-ÌÁÇ?\]Í£0ÈÊ? §gÛŒŒÍ?wnäÐ?Äl4ÇNÑ?Ñ"gmÒ?«§-ÆÒ?J¸ü†WÓ?o=éC¹Ó?À¼vbêÓ?a9¤FŽ3É?“œ'AtõÈ?ѲwÐyÈ?x9ØøÒÁÇ?:¯N+AÏÆ?%ÛâIq¤Å?b}ãkDDÄ?ÿA²Â?ÒÃö áñÀ?)m×¹¾?‘£Ü’ñ¹?·^;~u“µ?ji4&±?±B.jÛ…¨?+Vüè?žBªä-΃?>Ã7¬IЃ¿k…´¾óž¿þÄŸ°]†¨¿ÖXe±¿ Ç_±“µ¿{¸~3Ëñ¹¿„"@˜ÐùñÀ¿2€ˆ•5²Â¿¯@ùWYDÄ¿:줅¤Å¿HOµ5VÏÆ¿ÙŒÍTêÁÇ¿àãëíëyÈ¿ÉèT•õÈ¿Võ졵3É¿¼Š ¤³3É¿² õWõÈ¿óîréáyÈ¿L›f9ÜÁÇ¿ÿÄ!îCÏÆ¿Œ½ûo¤Å¿ÅCú_>DÄ¿/ñÏ ²Â¿ªµÆÕñÀ¿°#±è›¾¿k°nñ¹¿”ovdJ“µ¿èǺóÿ°¿êkWe…¨¿AšÄÀÚœ¿~EäÐ˃¿ jw™ÞÒƒ?mæhÃO ?3µÜ ‡¨?SÃࣷ±?m­á÷“µ?}Úvçþñ¹?‰^[ø¾?t£ šøñÀ?‰eô%²Â?,¨;c:DÄ?.kYZ¤Å?Â&3Õ!ÏÆ?¤2©ë°ÁÇ?ûÃ|ð±yÈ?D0_õÈ?iˆx³†3É?Ä'WƒOR²?eñ-%²?X¡O˱?ä¦VbE±?ˆrÑ8•°?\²ŠÖ÷w¯?²ö ·åw­?ZŸ6)/«?"áîd£¨?!ÓàÚ¥?vísyÜ¢?¤ñ9#_Ÿ?ßÁfú·˜?~JºmàÓ‘?RÕ¥‡…?éÌ^}ÓÉl?œÇp’æÑl¿Š¾Óª¤‰…¿»^ÛÔ‘¿Fg.£í¸˜¿né€À `Ÿ¿ÈÑUÈèÜ¢¿¦¹ìïIÛ¥¿Ú7bÈ£¨¿|±‡/«¿{Òr@x­¿"O¡•Qx¯¿übï3f•°¿Ð„ÐÖÀE±¿öi,á…˱¿’j|k%²¿º/Ìú“R²¿&/÷ùR²¿hXu_%²¿dAÇq˱¿0ûa”¤E±¿ÄÏ‘«A•°¿*~ä¯÷w¯¿æwdcÕw­¿ð²Óì /«¿‰Eì9£¨¿dI}H©Ú¥¿”°5»5Ü¢¿VŒ>Ý^Ÿ¿Æ™¬>·˜¿èLá Ó‘¿’ÈuzÄ……¿jÀ55œÁl¿ælͺ¢Úl?žPÆÙá‹…?T¹ÝZóÕ‘?ðFx…?z7ñâ`Ÿ?ªÈ6Ò4Ý¢?ÊÅžnÛ¥?ØÎ:À£¨?"ÎÕÐP/«? «Ýw­?$Éw¯?nFbà•°?šocfE±?¾ÅºÃ)˱?4 çî%²?™2FR²?kᜠ„°¿œq”Ð[°¿ö j¹¼ °¿þ¼ah:$¯¿VýñÂ7æ­¿nêÏ^¬¿ ùÞª¿º,¾¨¿ÀÂ56¦¿xñ Ñê³£¿øwÌV¡¿ú=Hœ¿2Ô÷ŒCI–¿÷®xÉ¿”½!EZjƒ¿ÏlÖÌûi¿¹GpîIói?Ç>khƒ?Ì]›?ôÁÜeVH–?h.ø…§Gœ?J„埡?Ô ö€³£?®¢OªÏ5¦?pFÖy\¨?tŒ/Þ~ª?8ÑEF#^¬?²dgš×å­?àz-2Ö#¯?"mž‡ °?Ó@ùá—[°? ¯4>X„°?_nRé£[°?ðÔÿ¥› °?dû@“$¯?¢±T æ­?F, €|^¬?2£vÀèª?¾µ'ר?êÈ 8[6¦?ƒÓ^´£?ÛdtöL¡?Ht "Iœ?¾¢ˆ›ïI–?Yb~·Ê?Slƒ?m¡›<j?#>¸`Ùëi¿™zPOŽfƒ¿Æ R”1¿§//ŠG–¿š¥âaGœ¿ 1â½f¡¿°Z…lg³£¿æãcÙ5¦¿}kЍ¿Œ›¯ Ϫ¿de™Þ^¬¿¢Éjr[æ­¿$"Uxg$¯¿ë[%Ò °¿¼²¶Êß[°¿P䇕„°¿¬ÖÌãv Ë¿â ;ÊÇÊ¿"Öó)CÊ¿G¼)¥}É¿TŸZ8[yÈ¿xŠU'»8Ç¿ÎJzr۾ſ¾|ª_Ä¿Øå”ƒo.¿1¶œ¬ À¿V0NÖ»¿RyùC¢&·¿E!Äã=²¿Þ:“UPª¿@ ö ÈŸ¿Ý/°^!B…¿÷ Ü;@…?Ì5ÇŸ?Ú°ÉÞOª?ƒdܨ=²?ü$ ¡i&·?økÕHÖ»?¨æ’ À?LÞPÓU.Â?AʵFÄ?е¿þ¾Å?õûJè¢8Ç?Þk.ÖByÈ?O“RŒ}É?¾¸ªýBÊ?8B¹°ÇÊ?Å\ Ë?îJÏ~^ Ë?™}¶ÇÊ?`íØ«CÊ?®¾8Yš}É?ÔäÙäTyÈ?˜^†¹8Ç?t—%#ݾÅ?¦þmádÄ?ÊNvþw.Â?è}='¸ À?8ŒÓkÖ»?™Ñ˜Ä&·?úŸšm >²?—Âl­Pª?0N°ÉÈŸ? {|³C…?ö'…¡>…¿aäËPÆŸ¿TÑ€Oª¿v‘P=²¿ù5H&·¿2·ï4Ö»¿pö… À¿~–XfX.¿’(ÿƒPÄ¿ŒÂٞӾſ÷­hj¹8Ç¿÷ŒÛÛ]yÈ¿`/ª}É¿D³ÛŽCÊ¿LšYBÎÇÊ¿ƒ³K_x Ë¿Q2hª–׿åx‚\׿šÊ$ÁèÖ¿:Çß?…<Ö¿ù…üwYÕ¿bˆnÆAÔ¿©óê$øÒ¿X=n2¿ѿ٠Rsj¸Ï¿õ "#Ì¿5òXV|HÈ¿7Òbø1Ä¿˜dé†SÓ¿¿®¡™®@ô¶¿€5:-¹«¿H¢PÂÿŠ’¿“ÑŠ’?Û¿vþ¶¸«?0Hô¶?€üc'Ó¿?ê^AûÛ1Ä?¨m„aHÈ?ÔY #Ì?(Qt“P¸Ï?möq’²Ñ?\-ˆøÒ?Äÿ€1ºAÔ?åCòájYÕ?9¹‰ y<Ö?¸~Ùì´èÖ?áu\×?“ÓŠž–×?9qÁ‰Ÿ–×?õùçÝx\×?%D­ç¹èÖ?ŸÈ?€<Ö?@+è×sYÕ?È@#ÅAÔ?|´Åq%øÒ?J“çmÁÑ?Γ¹r¸Ï?FÁ>?-#Ì?`‰HÈ?Žšó2Ä?reqåwÓ¿?¡ømåhô¶?ÚÝÿƒ¹«?:¯—³‹’?;«ñš\‰’¿Áíp._¸«¿P/,ÃÝó¶¿C4'÷Ò¿¿®Ã»MÎ1Ä¿‰¹›XHÈ¿‰¯ ©#Ì¿R˜-(S¸Ï¿ré„ݶѿ޷¥øÒ¿,,ËÀÃAÔ¿y‹WvYÕ¿ÐÀ…<Ö¿NÐy$ÂèÖ¿ƒü’è‚\׿C9˜¿ª–׿JÚ«Á"á¿‹é=‚øà¿µî{Øk¤à¿#þi¼M'à¿¥Z)ָ߿F5$]nÝ¿ìÞ¤ArÛ¿duœë”lÙ¿ÈÆ!` ׿ Žc®pÔ¿¬_ÍÈî£Ñ¿V @cWÍ¿$Qe’ǿΥŽìÁ¬À¿%æ-•ª#´¿Öò&xªðš¿·¦BÀïš?ÚIp#´?zqd¥¬À?¾ÅSþuÇ?À›odGWÍ?ð·k)á£Ñ?”ï4¡pÔ?t†æbü ×?>°^7ˆlÙ?¬é\ËeÛ?ûI…ßPnÝ?Zc¹¬ß?Õ3ÁG'à?"ùìöe¤à?“ýû†|øà?Ps"¼"á? (o¡¼"á?5‰×~øà?ÖµVqh¤à?.Tƒ8K'à?FèmŸµß?œ&ù¸[nÝ?êÓ‘rÛ?Š@á–lÙ?Nêƒá ×?¾\U³pÔ?¾! õ£Ñ?€é=)rWÍ?úÞG^£Ç?3Û/“Ô¬À?)ïÏIÒ#´?<”DNñš?™_RÁïš¿ØpM1I#´¿ùb=D“¬À¿æ¯VÎfÇ¿úõÛ³;WÍ¿„yrݣѿ‘± ÉŸpÔ¿ô¨ý ׿xY©ŒlÙ¿½ÀÁ lÛ¿è—;YnÝ¿d}!»¶ß¿ôÑ¢OM'࿽:Çk¤à¿¡ ¿M‚øà¿%‡šÁ"á¿•bæ1¸Êæ¿JSò‡’æ¿ U€¯"æ¿®‡ E|å¿›ïOâ ä¿p‘»õ£’ã¿ÞMCY$Tâ¿ä®¤·tèà¿òÄ“h+¦Þ¿"ɲmÝ/Û¿BÜ~—ˆv׿(Ðø=[ƒÓ¿”ÞŽ¬$Àοf&ËáÂ-Æ¿ìèLfɺ¿ˆb:Uyê¡¿Le5ê¡?=qÔ…,ɺ?7 ëD¦-Æ?£WtÀÎ?È`MƒÓ?J{v×?ùr Ð/Û?y,e¦Þ?ãâèXnèà?\ETâ?Ò~fÔ’ã? ŠvKÜ ä?‚äÊNÔ-Æ?7ý µ‹Éº?ͼÿùÅê¡?n*d¹é¡¿!ä“ɺ¿Š°×þ•-Æ¿2B5¶ú¿Î¿8c%HƒÓ¿»»wv׿1ä Ï/Û¿&ŒR¤¦Þ¿ . pèà¿ë ¬ö Tâ¿P\°¡¡’ã¿Jaî×à ä¿ø˜LD|å¿'fM¯"æ¿`I!ô†’æ¿âê'¸Êæ¿mB¢ÀÿÁì¿1;T{ì¿Y®=ûíë¿…,që¿×R¤1ê¿ÊñDR6²è¿p‘¹(X ç¿iƒïuUå¿,j;þúUã¿ÅJuWÔ&á¿ç3†ɚݿvÒ›ìžØ¿õäìì\fÓ¿™ÍMòûË¿ñ6À,æÀ¿õ»¡Ùõš¦¿ŒäæÀ?á¼Õä?›¦?"óL9š¦¿½Ó‹ºþåÀ¿Ç%UFÆûË¿j$óUHfÓ¿®<ÎÕٞؿ<µ]f¸šÝ¿ó¹m5Í&á¿ÆP õUã¿ôIZDqUå¿©ðÏ£T ç¿kpHÑ3²è¿ì(Rú/ê¿46(lë¿hT­úíë¿¶¨N{ì¿Ú¿Ý¬ÿÁì¿Ð‚ÅAœšc?`膦ÂO}? oˆùDˆ?`çöÓ?p¯@\DZ•?à‡žÿŬ™?@rGïú¿?åÉëÄ ?àbÓ䀢?O#­z¤?PJÍk¥?ðùÔ¹’¦?пÙ?Ê‚§? T6¤ä8¨?ÖÔ;G³¨? ƒQLÄð¨?@"ß=Äð¨?Ð6G³¨?Ì«^ä8¨?ð€JâÉ‚§?@à’¸’¦?Ðø*Lk¥? 8#z¤?ðþ-Y€¢?°–¿ëÄ ?¢Ôú¿?€ŠoHŬ™?PgìCZ•? ÖðïÓ? „v7úDˆ? 5ñÅO}?€÷0§šc?@ÅÔù’šc¿àÝñ¼O}¿P¼›iõDˆ¿€6ê¢Ó¿ÀŸÁAZ•¿À¾»G왿 ÁÇ5ø¿¿ð®„MêÄ ¿¹Y­€€¢¿pâr™y¤¿Ð;“æÿj¥¿Px+R¸’¦¿@¥ÆÈÉ‚§¿0¥‚kä8¨¿À,ECG³¨¿ýŸ“Äð¨¿Ð´»ÂÄ𨿠/ÏG³¨¿9ºOå8¨¿ˆ3þÊ‚§¿€wϹ’¦¿À}õžk¥¿`Di{¤¿@i±‚€¢¿@ªÇ_ìÄ ¿`Í€Uü¿¿ -§BǬ™¿`szEZ•¿ýþÓ¿ ¸4?ûDˆ¿@³tºÅO}¿ 9 ¢šc¿Ø e E¢y?¨]é)“?ð7g±¼Ÿ?ø.éîÿ¥?‡=Ÿë«?€–Â<ɰ?@=¦zGs³? a&^íµ?À@µze1¸?ðtÇvÇ9º?X¿ó%¼?’*ü.„½?h²•§¾¾?Çá>5¬¿?PÆžZ&À?HXÖÀQNÀ?ð/ÞµQNÀ?ù:&À?ã5Õ4¬¿?8gR¾¾?øO.„½?øœ„a€¼?ظA¤Æ9º?è‹¥d1¸?ÐìY]íµ?0ŸçÅFs³?ˆõ°3<ɰ?H¸Nžë«?õ„Yîÿ¥?€wT©¼Ÿ?ÞæŠë)“?Ðþ-U¢y?°Ë¸é6¢y¿0ÍKä)“¿Hîlû»Ÿ¿ÐÖáêÿ¥¿èœz ›ë«¿ÀJI±:ɰ¿àíáhEs³¿Ð†'\íµ¿ðèÿ¡c1¸¿hÁŠÔÅ9º¿øcȼ¿€ßËî-„½¿àˆó¾¾¿ õñè4¬¿¿<D`&À¿¤7åöQNÀ¿”I˜RNÀ¿t/@Ê&À¿qÙB6¬¿¿øÈ¾¾¿ØK(00„½¿Ð‡éc‚¼¿˜;&µÈ9º¿ôk°f1¸¿Xô#K_íµ¿(㬈Hs³¿°]ä´=ɰ¿( ¬ ë«¿€³eöïÿ¥¿8ßS;¼Ÿ¿Øm}aë)“¿¸­ì‰M¢y¿Ìçß»ñ‚?'JGRœ?Ð+4½s§?ÄäëÞA°?Hé¼ðœ¡´?Äޤ½Î¸?ÈEŒµ¾¼?PdZç3À?Ô§0àÁ?ÈYoSaÃ?pè?lȱÄ?@¬ó@ƒÏÅ?„üOax·Æ?¸ç'ïkgÇ?t > ¬ÝÇ?”º¾kÈ?|UYÈ?¤V¸è«ÝÇ?ô3Ö”kgÇ?Lfçw·Æ?t±Š¬‚ÏÅ?\”jÃDZÄ?<œçaÃ?t¤w€àÁ?äxTæ3À?ð€Àɳ¾¼?H¥<¦¼Î¸?øBLœ¡´?li,“žA°?ÅÌrs§?à"23KRœ?ð ¬û ñ‚? nÉ™ñ‚¿¸?®>Rœ¿D(\s§¿Zƒ¨›A°¿@Ó»Œ™¡´¿¤PïºÎ¸¿¨†:~±¾¼¿œù‡Rå3À¿ŒßðœàÁ¿„ïaÿ°ŒBDZĿü’©[‚ÏſIJ¹Çw·Æ¿¼ ¦kgÇ¿ àá)¬ÝÇ¿ÆÆÇÈ¿ ‚ƒÈ¿XQ3Þ¬ÝÇ¿´7UÌlgÇ¿pc½Vy·Æ¿tùäF„ÏÅ¿Èk„zɱĿ8,Åa aÿ ž6‚àÁ¿økþç3À¿ ,?ζ¾¼¿¬’;¿Î¸¿;Tž¡´¿PxøõŸA°¿€°Ìs§¿@f íJRœ¿°Šž~ñ‚¿üRp _‡?øEu$çx¡?Ì)$?öî¬?äbí×´?,ÔÁt¹?8?µç›¾?,E±‘Ë»Á?Xù^ÐêýÃ?ˆ,ô4ÀÆ?èøõ3éÇ?ë—\´ˆÉ?h¥ZAéÊ?hÌtÌ?<¬(ŽàÌ? KN”urÍ?„Òú¥Ã»Í?,´ÔŠÃ»Í?fÅCurÍ?4þ‹àÌ?ŒjtÌ?hâØ/@éÊ?<äje³ˆÉ?ÈCõê2éÇ?H·#¿Æ?ø ØÆéýÃ?=ƒ¡Ê»Á?4曾?lÔ÷Àt¹?øåDˆ×´?ôgƒ÷î¬?¤Z3ºéx¡?Ôh¹M#_‡?äh±Iÿ^‡¿0û8Øàx¡¿pÐabî¨DPdÓ´¿3ô¼t¹¿<ƒ\i⛾¿°´É»Á¿”,Xèýÿ4kôì½Æ¿åFò1éÇ¿4E®²ˆÉ¿€Æ+½?éÊ¿xyÙîsÌ¿ ”³¥àÌ¿ÜÀG¢urÍ¿0é*ĻͿ G”‚ĻͿäé¦vrÍ¿ThNàÌ¿qç.vÌ¿Ôo‚BéÊ¿dôgⵈɿÔnS{5éÇ¿ØÙ%®ÁÆ¿¨âê2ìýÿsÕÌ»Á¿¤jÌÊ雾¿ð9®ÿÂt¹¿ëSÙ´¿¤âŠùà¾þ‡éx¡¿ìƒÏ_‡¿”®pü#4Š?‰À®ö–£? × L8°?LåÕq}¶?LÝèñ€Š¼?@ÓeWÂ(Á?D$öáÃ?Øbyü$jÆ?Ìm娻È?ðôðÏÊ?´$ÝÊÞ Ì?@("å$,Î?`섽mÏ?|é80Ð?~l¼‚Ð?Іƒ=«Ð?ößE+«Ð?ÖÔ•ç‚Ð?t£”Ã70Ð?tÆYÎmÏ?#׿#,Î?<à‚zÝ Ì?ð-™‚ÏÊ?ØH_»È?Ø®BŠ#jÆ?øgÐôáÃ?:š:Á(Á?07¸[м?p툴}¶?–1@[L8°?`Ú{¹ù–£?ìþä:4Š?„6²Â 4Š¿zм¿ž1ݾ(Á¿ð÷¡¬òáÿøŸ©!jÆ¿/ðÇ »È¿°Y<ÏÊ¿H¯%ŠÜ Ì¿ì7º)#,ο½ä”mÏ¿âÍiÕ70п^Ò '‚–«Ð¿Ž)ѫп¦íLÕ‚пzϳñ80пôÉ ˜ mÏ¿|,[ß&,οDîhÔà Ì¿0øÏÊ¿ÔÖ<ϻȿ4%PÒ&jÆ¿áOÍ÷áÿ„ŸËÃ(Á¿&iƒŠ¼¿¼Ï>{!}¶¿TÑh·M8°¿@¯Awù–£¿pòÆô-4Š¿ì¦à.䉋?ȉ‹t–¤?”ÌxvÖ ±?$Îzók¢·?tŒa¼þ½?âZÒ£ŒÂ?»BEåÄ?XÈ€šyŽÇ?Lñ‚;šýÉ?ÄÀJå¦,Ì?„ñ³Q=Î?”·Âz¦µÏ?Ý0qƒÐ?–J«“XÑ?ɉKNYÑ?ˆmQX~„Ñ?ZÓÖ@~„Ñ?À\ÆNYÑ?²Z©!XÑ?nïg‚pƒÐ?Ïý¤µÏ?ì²Cš;Î?pÎl¥,Ì?4MïE˜ýÉ?\¾ô¨wŽÇ? :íqCåÄ?h‹Â? jI ºþ½?$od«j¢·?ÞæyƒÖ ±? ¨6]w–¤?ôHË2ÿ‰‹?Tú!Qĉ‹¿X±Öh–¤¿šôÉqÏ ±¿ˆ&Öãc¢·¿ä3룳þ½¿ì\#ˆ¿˜ Ä@åÄ¿4¸MuŽÇ¿ G–ýÉ¿˜&Šj£,Ì¿|}˜l:οÐy©A¤µÏ¿Lsÿ^pƒÐ¿ÊÍR9XÑ¿¸G¢WNYÑ¿.î‚Ê~„Ñ¿Œ‚Єѿh*;7OYÑ¿0HV¦YÑ¿¾(NrƒÐ¿h³©µÏ¿@èÃï?οT¬d€©,Ì¿P½œýÉ¿¬ºÀï{ŽÇ¿ ZGåÄ¿àž_qŽ¿äÿE]¿þ½¿Pd§Tn¢·¿ÊÛPØ ±¿L"? w–¤¿BË2¿(z‹?XU€høŠ¤?žº/FT±?€ÙÐÉ<•·?zzªî½?$Ÿ}þÁ?¤6JМÙÄ?\B®øTÇ?±mÎïÉ?àù,lîÌ?,oiŽsÎ?HqæÑô£Ï?ò\|&:zÐ?枃3ÚùÐ?’ÿøêŸOÑ?˜ÒÖ·zÑ?”-n¹·zÑ?øoŽ“ŸOÑ?Ð]¤ÙùÐ?Üœ‚c9zÐ?ðŸïò£Ï?À“_qÎ?øÙ9ìÌ?hBQDïÉ?<ÈkRÇ?|ógbšÙÄ?dÜîózþÁ?\¢?Iýí½?l]‰±:•·?ì˜ÄÔS±?ª¢t}ûФ?`l¶î¦z‹?<@¢†_z‹¿”ïÞ銤¿™å@K±¿plsv2•·¿˜îƒõí½¿¬‚TZwþÁ¿LŽ—ÙÄ¿˜BŒOÇ¿èãÕïÉ¿|ÁêÌ¿8ìŒîoο²g ò£Ï¿$éë89zпÊEºÂÙùп"úŸOÑ¿hå‰e¸zÑ¿†tËøzÑ¿8ñ¡OÑ¿¶¨¼‹ÛùпêT ¥;zпÈôªø£Ï¿à˜D×vο¸|/°ñ̲̿¸ðïÉ¿HÅ3ÞWÇ¿b×aŸÙÄ¿èÃFþÁ¿äàà',ÅÜn?•·¿šì,V±¿àÌÄûФ¿V/Š‘z‹¿|Lâï Š?èø)°™ˆ£?R‡U g,°? ÷ú l¶?€fïo‘u¼? ÄiÄ+Á?Ì0–²_ÓÃ?²b”²YÆ?Œ¬™ýê¨È?t¬‹[W»Ê?L.1þÛ‹Ì?üg°ÿÎ?°ÔȽöUÏ?^Hè(V$Ð?øZÃåuÐ?î\HæÞžÐ?bÖ9ÂÞžÐ?Ög›äuÐ?xW´xU$Ð?ÜH ÜôUÏ?ð¨tYýÎ?èŸKCÙ‹Ì?\iRT»Ê?à/FÁç¨È?,…G¯YÆ?<(#\ÓÃ?²úóÛ(Á?d r¦Œu¼?8_ ³l¶?Ê;uÄe,°?¼xtœˆ£?˜€Æ3!Š?¸„GW» Š¿¬@Ê#‡ˆ£¿”¦‘[,°¿úíè“l¶¿t¿Ödƒu¼¿†œð$Á¿jÃEšXÓÿ:gŒØ«YÆ¿ÑàÖä¨È¿œŸËùQ»Ê¿<ÔĈ׋̿L.Füο${¹vôUÏ¿ôC‡žU$пүNåuпÔ#t•ߞпRú‡ àžÐ¿._ ræuп4ˆ†ÑW$пŒ#oúUÏ¿„`j¢οtØÆà‹Ì¿ ¡Ue[»Ê¿l›þÚî¨È¿Âü`!¶YÆ¿4»cÏbÓÿàN‹X.Á¿Ð:Ok•u¼¿ŠÈáÈ£l¶¿4ГÌh,°¿†´ç¢›ˆ£¿¨¢!Gô Š¿„JÒ¬Ÿ˜‡?øÐ'룡?…»q/6­?T§òè6@´?ä.›Dh³¹?¬"<ç¾?(‹¤‹oçÁ?¢ñÊ/Ä?ʽÓÖEÆ?Ìòwj $È?äЗ‡ÇÉ?ÜéÝ+w+Ë?TÊ£jLÌ?0f© ™'Í?¸wÄçºÍ?Œû±äéÎ?PF¡éÎ?0ÕŽÀæºÍ?/¸õ—'Í?\ò ZhLÌ?`ˆ;Pt+Ë?(½©;„ÇÉ?Hë¤$È?ª©ãÅEÆ?Ä=”/Ä?,¢akçÁ?ĘZ4ç¾?(Í-—a³¹?bhö1@´?8U*6­?&¡¿ý룡?¦]î"À˜‡?Øv.¼\˜‡¿Ô¸¢sÓ£¡¿j6­¿ºwÐw&@´¿øÌ±·V³¹¿4rŒ@*羿,gnÊfçÁ¿n\†/Ä¿Pt×RÿDÆ¿¼rÝ$È¿à”Ÿ-‚ÇÉ¿€ Gs+Ë¿<àSágLÌ¿°¤,Q˜'Í¿y“ðçºÍ¿ˆ±íŒëο䔷§ìο`ü…8ëºÍ¿˜‘>­'Í¿ôv€(oLÌ¿Àæˆ|+Ë¿Pª)•ŒÇÉ¿h©¢_$È¿8T“ EÆ¿ž B!/Ä¿D.LsçÁ¿4!5B羿2‘½l³¹¿^äÇÀ9@´¿Ð¬¶-26­¿$u(‚룡¿˜@¿«œ˜‡¿ÐÛí¼ýƒ?L¯²ìã?(¨4S£¿¨?¼hS%(±?Hs¾+Ƶ?üPÈÛ‚.º?àü½þLV¾?ÖrÏ¥Á?¾¯JüÝÂ?€ ’ÊÎsÄ?”]Ô4×Å? æÂ9ÂÇ?D3ÕŒùÇ?ÐòÐFA³È?¼ É™ 0É?ÈkÙÀnÉ?L5½qÀnÉ?(¯ad 0É?©¥H?³È?|mÎŒùÇ?¼‰¦Ç¾Ç?ä¿—¿0×Å?hÍã*ÊsÄ?qŸ>÷ÝÂ?’]€ Á?x§dDBV¾?¼/¹x.º?PŽ"Ƶ?*µ (±?ˆIRZš¿¨?hÈ1“éã?úD®Úýƒ?Ä-Ò~gýƒ¿˜¯°ã¿pÒ›~¿¨¿,+ž±(±¿äò‚èƵ¿”È%Ìl.º¿˜rŽ7V¾¿z2çÁ›Á¿´Çl2óÝ¿fzÁäÆsÄ¿HÍQ.×Å¿|^òA½Ç¿àª=ŒùÇ¿(š³?³È¿àäÍ 0É¿Ä pÕÂnÉ¿ JG+ÄnÉ¿°åXÅ0É¿$&Ä.F³È¿4* •ùÇ¿ØÙ ÈÇ¿Fí:×Å¿@z™ÛÔsÄ¿JÄÁÞ¿ärn«Á¿H½Ò VV¾¿h?äŠ.º¿\ûû»0Ƶ¿æé ((±¿P—ù’¤¿¨¿8_Ì¥èã¿Ø'­ýƒ¿ êåùÙ~?è]wáa—?Þ×U²£?„†8zª? O³Ͱ?º”lÂ3´?tß3 —h·?Ò}µcº?̤™Gý?¤u7Ï¿?î Ü>ÚÀ?~·'òìÂÁ?v¶IÑÂ?°ÑˆlÃ?lMãdoÃ?¼. ÆŸÃ?H‘³ŠÅŸÃ?„wcoÃ?ìœÃ?œšÇÍÂ?H\EØèÂÁ?!ò÷9ÚÀ?œXÆý¿?¤Èúç¶½?HâáÓ§cº?ÀÇÌ_‰h·?¤yð´3´?8v0Ͱ? à·.zª?ì<÷r££?xj’‰V—? lf&Ú~?ÌKܨÙ~¿,T´!—¿âŸê†ƒ£¿øðToèyª¿Èä™Ͱ¿`)ÁU§3´¿`Ï(õ|h·¿ÔÃÌœcº¿$ä*u­½¿Àsðõ¿¿$é§7ÚÀ¿`WçÂÁ¿ÔñÍ¿Ò=ÅŠÿ”šleoÿ@äÓ^ȟÿ`gÉùɟÿ¸:ª?$’/ïÏ¥?¸¯·Ù/¡?hBÍËÇʘ?ÀP¥F|ñ?$•#-t? xøèþt¿(qßæð¿ôÞ Ï~ʘ¿ 6èµ/¡¿\uœÍÏ¥¿HÛ!:ª¿Xz-Èc®¿ìÊTzB!±¿8Wlºe沿üø_œð|´¿df,Úøàµ¿8g8³·¿øe³_O¸¿?E>)¬Ÿ?ð“[i=é ?à„“aµÒ¡? ’mò<¢?ˆZËÖ £?h–€œž€£?‡1(±£?XµÁƒ%±£?@d'ÿ–€£?Ç6ô£?˜~te+¢?`ÆŸÒ¡?èìg"é ? øøH꫟?¨BJ{7?m{š?H†EšF}—?ÀŸE”?HA ŒþÛ?Pæ—¡š‘Š?ؼC.¸)ƒ?ü”N/%w?@$”R{÷^?062Æò^¿¸ôÞÛ#w¿°>.)ƒ¿0µß>úŠ¿° "²Û¿]éìWE”¿p•ùÄ}—¿Xìê"Êzš¿ ý?H7¿0ª]BÀ«Ÿ¿¸ né ¿ˆ29š”Ò¡¿°/ú&¢¿ P2-ö£¿°a›Ÿ€£¿ˆŸkÞ4±£¿€W– >±£¿ØCõ຀£¿xàt¾" £¿¨Ü±c¢¿@›¬wßÒ¡¿Ø< ié ¿@©U‚¬Ÿ¿`èm„8¿ðk,£{š¿0ýYžß}—¿J‰Å,F”¿h‹g]wÜ¿à ŒlO’Š¿ÈÉÓø*ƒ¿°—à6%w¿XÊÿôwô^¿ðb7¸W¿ ü_o·Dq¿ð“£a™|¿ðx•ááÓƒ¿8õkËC*‰¿ R ~¤BŽ¿Ø{IÅ6ˆ‘¿°1•áÓ¿È]ÐΕ¿0¤é‡ù£—¿°¹Ù\Ø>™¿n öw›š¿ð7Éê|¶›¿8¨àŒ-œ¿q%žx¿ úiúe¿ 4f¿0ßÛò‰¿„cQJœ¿è¿÷¤¶›¿`ü«›š¿pðWy?™¿¨qHyB¤—¿@7 $Ï•¿h|cÖ?Ä“¿HF埈‘¿˜CS†CŽ¿° È(0+‰¿X.ŸËÔƒ¿¨Ž›`›|¿((°ÏçEq¿¸«@ÖW¿Ü<åW?Hª€›gGq?!5:{œ|?ðׇՃ?¨ã~ñÝ+‰?è^ÜÊ)DŽ?8 ‚ꈑ?xä<ƃē?v?_Ï•?ø9°¨s¤—?è#‘Y™?x࿌£—?@ì ofΕ?@Hj,Ó?˜Tᇑ?˜öMBŽ?XLló)‰?pÔ©ÕÓƒ?H•ç™|?ˆK»¹ÐEq?èîØáÕW?=ŠòHHt¿æÈ’×TŽ¿èö¼R~™¿úÍó‰]i¡¿¸®H¦¿|Å•ÉQ’ª¿¦­Úe Ê®¿@ãšîZ±¿{ûñ• &³¿áÖÝCôÁ´¿$Íí5®*¶¿ÌÄè)Á\·¿2$G–:U¸¿*qîµ¹¿š2ˆb¹¿‚âKй¿@ëü» й¿öº–jg¹¿òpÎ ¾¹¿6\áEU¸¿ìîS›Ï\·¿Y°Ê¿*¶¿ý· ´¿¹¨ž$&³¿f [±¿Äþ¸JÊ®¿2ÚŸ—’ª¿ÖKëÝ`¦¿‡ó­i¡¿ªCçg™¿BJw1ÓUŽ¿¡qQRIt¿K‹]Kt?nõD«VŽ?¢´Zƒ™?š• Vái¡?ú^ˆ’¦?–BÌÆ’ª?â×`ÕuÊ®?ª]¢[±?HyÇ5&³?®n´?HèË*¶?xE=W×\·?L×ë¯IU¸?B«í½¹?y¦Ub¹?Ô‘œ×ÿϹ?`šTùϹ?Ð4ÍýN¹?èø¿ø¹?Ü9ÑU¸?æpq¢\·?à‘¬œ*¶?vCGÿÒÁ´?ÇbHéë%³?Þ1íÏÏZ±?´„hlÕÉ®?àÑO+%’ª?Håƒ÷¦?€TAXi¡?œNS½¯™?Ò\`·UŽ?3ÆåÍ®Jt?yOÁæÆ¿Œ‹V夕š¿‰ãº=?¦¿øMßæu…®¿Q0á49^³¿äA*(÷I·¿1Ì´ Iüº¿øšyšl¾¿h~lÈÀ¿ ¼J8n1¿xö탕mÿJB§†ÖyÄ¿‹5(ò›SÅ¿>˜‘èÌøÅ¿²êþ)ÒgÆ¿?šŸÆ¿FÚ뚟ƿ2Ï{åÔgÆ¿¥r¸pÑøÅ¿Õ @¢SÅ¿ìp”ÞyÄ¿ÌÁŒPŸmÿÞÿåÍy1¿dðî}yÈÀ¿(äÐ0l¾¿X ~2müº¿ v¬$!J·¿ÿÀB´i^³¿*ãýâ…®¿x%¢¼±¦¿Bi¯Âs–š¿­É¾èíÇ¿|ìkâÈ?¸{ñðì–š?PÑb>í¦?U÷fÙ†®?¼Â‚…^³?>Mׂ;J·?S}$É…üº?Jm«AGl¾?cx7pƒÈÀ?Yc¹B‚1Â?{L ¦mÃ?èä YãyÄ?Ý ͤSÅ?ðQ‡ÑøÅ?Äk×KÒgÆ?ã±t•ŸÆ?YGÔ“‘ŸÆ?ák[ÈÆgÆ?Ãf¸½¾øÅ?×=`U‹SÅ?R«(ýÃyÄ?â”è¸mÃ?Š$ëY1Â?,/EîWÈÀ?@J42ëk¾?Né6œ%üº?ZÌzØI·?%ɳÔ"^³?T`OÞf…®?w†ð^¦?¥í¤S–š?ÓWëäÈ?·_¹‰¿‡)çåa<£¿ )L/Û¯¿6L‚Á¶¿…>‰w¼¿¦Íü£ÚÀ¿?€&Ìņÿñž‚^Æ¿ß@»°IÈ¿òßÖ!TÊ¿™/šË§Ì¿<Õ?ìܡͿݩ&tÝοh®IpÌÏ¿ä/A^6п\=Ⱥ^пš™°J»^п »Ç_6п{·`|ÌÏ¿n…ƒs Ýο2}êÑå¡Í¿ê뎲Ì¿ó1;À-TÊ¿œ³Hb¿IÈ¿Øâ7{oÆ¿œ T³Ù†Ã¿þH‹ÚÀ¿#î²¼¿pà ¶¿­x£¾ÛÛ¯¿ÊëŸÓ=£¿rœä•»‰¿+ õ«¦¼‰?ëKS¬[=£?žÇ¿~ܯ?À»ùi*¶?™WLѼ?´t™w.ÚÀ?Œ‘¾ç†Ã?¡h|Æ?è@ùÊIÈ?ä3ÔÁ7TÊ?#~µºÌ?ÐÌ0Ñë¡Í?Ò0œù ÝÎ?äAJ4ÌÏ?0W«’^6Ð?‘æ«_¸^Ð?Þ  ¶^Ð?Z—©W6Ð?(m¦ÌÏ?Î…–oïÜÎ?Hí(SÆ¡Í?5UÔƒÌ?.$,TÊ? ИIÈ?ÆÓFÆ?d¡4¯†Ã?å}=òÙÀ?Yò`TP¼?.¯Ð§¶?É›ZÌBÛ¯?Ôȧßë<£?ñ1`&½‰?¸8è\×á¿à0È?_@©¿[A}½îè´¿X.q¨!þ¼¿¢-‰åçe¿Â÷\X^Æ¿<bG¢É¿@•‡ûåÌ¿ïÈÔÅnâÏ¿ÝÜ#HÑ¿£ˆstÒ¿¦qÜLCsÓ¿‘ÚeBÔ¿Bß‹j ßÔ¿F‘ì~~HÕ¿âüÿ¢z}Õ¿šjƒ4{}Õ¿§9V1€HÕ¿Ð.¤7 ßÔ¿O…èC#BÔ¿7×ð/HsÓ¿K¸ùxtÒ¿÷´ÎÖ)HÑ¿/âÓ[~âÏ¿Ü@Þ æÌ¿*‡µä[¢É¿¸qIÈwÆ¿4²f¿uŸ‰zþ¼¿høïgé´¿oÆá‰A©¿•ŸoJ ä¿¿õ^g¥ä?ñïvÙA©?Jÿ¬&é´?&{’êžþ¼?èš(PfÂ?LhN¨ˆÆ?z®¡Ök¢É?|¶Æ«æÌ?hÏÇ‹âÏ?boì¸/HÑ?{6_ß}tÒ?-!íKsÓ?Û[¥%BÔ?HÊ$ ßÔ?ôÆ/3HÕ?Û_›1x}Õ?5¤°ku}Õ?fövHÕ?,¤ ’ÿÞÔ? 8VnBÔ?Þœ5sÓ?ZµNdtÒ?Ð ŒÚHÑ?Ú“QâÏ?w>»ÔÞåÌ?†&±å+¢É?ºÒABÆ?b¢€sÈeÂ? õ\âý¼?¾®• Ùè´?-óò—!A©?&Ð ]hå?õ´Øê”¿þfÒe L¯¿Gmu¹á깿«ø`.Ú÷Á¿¿ôçÍÆ¿Yeœw´kË¿KöšOâÅÏ¿¬æÝ^ÜèÑ¿•K]ƒŸÂÓ¿H,K̪kÕ¿(Þ½iæßÖ¿‰²®¼Ø¿h¤ð"Ù¿AÏ ¡ÞÙ¿€½Ü{WaÚ¿Uw)û£Ú¿^ùº£Ú¿°§™`YaÚ¿ÁjÖ)¤ÞÙ¿šßR9'Ù¿~ö.ÂØ¿tˆÈìßÖ¿)©ñ²kÕ¿3Ø¢¢§ÂÓ¿ ¡ã`åèÑ¿úí¦öÅÏ¿ò‰Ï¹ÌkË¿êöàÎÆ¿¹è° øÁ¿^˜±|빿M*•ýM¯¿°OH¥ï”¿ ‰ÈÍMð”?SæçÔPN¯?NÓ¦ë¹?äQ»óøÁ? “y•ÎÆ?,гßkË?(‰µÆÏ?0ÖíèÑ?Þ¹f¯ÂÓ?« Iþ¸kÕ?ì,#¯òßÖ?푬»ÆØ?AN¬p*Ù?(K"¥¥ÞÙ?¢2ÒXaÚ?)Žå³£Ú?ãËÇgþ¢Ú?0ÅOaÚ?¤£’•ÞÙ?Ã]tÙ?e*û«Ø?J .ÔßÖ?© Ê,˜kÕ?õó¤´ÂÓ?p`‹5ÌèÑ?›ó£ÆÄÅÏ?ó”Æí”kË?l¡?»ÍÆ?¸¥°“÷Á?M]QÍPê¹?[˜¶ÐL¯?¨Â™bò”?^ö=瘿*„t¥²¿\°mr⾿á,:ÌbiÅ¿¢£µ¨,Ë¿ °>AsVп1Dþ IîÒ¿[â4frWÕ¿X±£Þý‹×¿hß½Î{†Ù¿Tÿ BÛ¿¤C agºÜ¿ WMƒïëÝ¿1µ{›²ÓÞ¿ÚI‘?uoß¿¤æf·½ß¿Y3~¸½ß¿Ê3†_woß¿œŠ%¶ÓÞ¿Å`¡JôëÝ¿ð-sUmºÜ¿Jeo{BÛ¿Ú½ƒ†Ù¿÷4LŒ×¿Ã%?{WÕ¿„©jNRîÒ¿_£ }Vп›Æ3À,Ë¿»‘6Ö†iÅ¿n„¹ 㾿þ6ئ²¿_%¸r¸ò˜¿Õgˆkró˜?X\u§²?´¯à3ã¾?ÝíTiÅ?šÖ *Ö,Ë?Ïø­‡VÐ?.”ñ\îÒ?RÝÊã„WÕ?ßJùBŒ×? f—¾‹†Ù?œï›–BÛ?L ;0sºÜ?ÏêøëÝ?)¢Q¸ÓÞ?ƒd‡“woß?§â€œµ½ß?ª·±½ß?¾ïkoß?Æ_¥ÓÞ?ëE@\ÞëÝ?Ì ÑRºÜ?$À¬ôAÛ?J§Úyd†Ù?t,è‹×?¾$ÇI`WÕ?ž²Nc;îÒ?IÊôtgVÐ? ! [,Ë?þðX>êhÅ?‡~Hà¾?ÉcšËô¤²?L*)lú˜?8­Àœ¿â'»«™•µ¿%A‘OµßÁ¿n3u:ÈÈ¿·Í"œsÏ¿†Ã޹èÒ¿!šrOéÕ¿B4mQ³Ø¿ŽDƒ¹µ@Û¿®ó%êŠÝ¿ ¨úHŒß¿eV9ðŸà¿×G¿Pῼ϶ÝÖá¿îGhÚ1⿊îwtJ^â¿H˜¬ÛJ^â¿¶áÉ 1â¿Ð°n¯ßÖá¿Z¼¤øÁPá¿­QÞóŸà¿µöM¿PŒß¿I%¾³òŠÝ¿Ì§´«¾@Û¿g%@æY³Ø¿Ìk¥IéÕ¿r2Ìß¿èÒ¿ÿCÁ£sÏ¿Ýôç<ÈÈ¿®ã®¼ßÁ¿|ïdjV–µ¿ˆ >êßœ¿§/n¶àœ?›K‰–µ?Ì–¥äÕßÁ?¸ ŠÄUÈÈ?¶´Û"¼sÏ?¢Î[¿ËèÒ??þ=ÁéÕ?´òÛd³Ø?tªSýÈ@Û?÷[:üŠÝ?¶àLIYŒß?·S8÷Ÿà?\YÿÚÄPá?H‘šáÖá?ÐÜÍÂ1â?³Ñq J^â?«Ô¹ÈG^â?Ü(Žðû0â?ðà:9ÖÖá?1I  µPá?ሠpãŸà?bÛ˜¾+Œß?:ãçËŠÝ?FÍùš@Û?÷ôv<³Ø?¨M©rüèÕ?ìc»èÒ?_ …°sÏ?k ð–ÈÈ?ÐOÜÁ?–騈‚µ?¦5«‘~ùœ??M:©k ¿‡W ÓXn¸¿Â3¢Òê8Ä¿dkúZ ̿άœhÊÑ¿vÐÝ^NdÕ¿ŠÀ(zÉØ¿¶"­†‹ñÛ¿Ä\‡r¹ÔÞ¿‚=DŠòµà¿‚z“UØá¿¡ÉSϹÎâ¿’dº¿–ã¿€ø%z.ä¿Ý¿¡ör”ä¿,ÍDîÇ俪n—8¯Çä¿òúCTt”ä¿ô•©c|.ä¿tL5Ì–ã¿`fŸ½Îâ¿p¸nZØá¿RãSd÷µà¿0rpÃÔÞ¿™2ø”ñÛ¿‚MPÈÉØ¿Š!RdտΓnîdÊÑ¿ î F6 Ì¿œª—©ƒ8Ä¿4³‚:ík¸¿* t:U ¿iø ZªU ?ðççö$l¸? NõUŸ8Ä? 1a¥Q Ì?lÈhrÊÑ?ïÅ[T_dÕ?¾  ŽÉØ?CA¡]¡ñÛ?EeqDÏÔÞ?  óüµà?ÆkÕ_Øá?,5(ÂÎâ?ð™Æ–ã?Uĉ=.ä?¥Öñu”ä? J«7¯Çä?P`Z¦¬Çä?¦Á$n”ä?+Zøq.ä?‹w鬳–ã?ÁޞΩÎâ?¢K…iBØá?næ°Þµà?'DÉ“ÔÞ?î7j»oñÛ?Ôä¦oÉØ?ØÈL¯^dÕ?4@[¦ÊÑ?¼]”· Ì?5þf»>Ä?8Ìߨüs¸?Aˆ–C ?‚"((M*¢¿mئ“£ »¿ ÅàïÒtÆ¿ž UA"Ï¿w>>‰ÁÓ¿íÁ„‹EÁ׿ʹçUu†Û¿;|‘Ëß¿·o˜Pá¿9q¹Ë‡Žâ¿n†³ÿÐã¿qˆˆp›âä¿yAºÀå¿™ ð}7iæ¿èš"tÚæ¿ÃEñÚXç¿!Ь`Yç¿Ôì´±uÚæ¿õ÷:iæ¿äí ¦½Àå¿ù§AÙŸâä¿„¤ÌFÑã¿ÜKæ~Žâ¿ÜO_…Vá¿ÆÎSÖß¿´È=~†Û¿=âïJÁ׿ð"ø’„ÁÓ¿¼ø§"Ï¿®kÒ0]tÆ¿.õµ”»¿€ Iø!#¢¿€šÜ›#¢?×oOÏл? Çn{tÆ?ºìÛ2"Ï?¿ARg“ÁÓ?nCû³XÁ×?îoXጆÛ?òðFäß?‚ë!C]á?­òÆð“Žâ?§ŒW Ñã?ÒÓFl¥âä?þÅù“ÂÀå?¶˜B!>iæ?P˜xÚæ?t}ݪZç?¥²¼çWç?hÎpÚæ?ÍÃŽ2/iæ?êXØ`¬Àå?<¤&w‡âä?ùø<{åÐã?´/x.kŽâ?çb5á?hÿR6¡ß?}šGb†Û? ]¾4UÁ×?Ì‚=¤ÍÁÓ?/RA=m#Ï?^îÓö™vÆ?®ä„i!»?L›Ñ‹Û¢? òøýmÕ£¿¤Ü‡6¡¦½¿}¸ƒŒÈ¿Â9òìšÑ¿¿,#×™Õ¿Xi¾„6øÙ¿¸ÈÖcÞ¿QºS†1öà¿Æ¯â^à¶â¿Ã/ÿkIä¿Úp¸Éó©å¿²éÕÕæ¿ð9›æÇç¿ú_«d€è¿ÜH¿µäûè¿ì—óV:é¿!!ï:é¿´÷Ú|æûè¿xAýU€è¿•UU­êÇç¿bEþ¡Õæ¿-j¦ßù©å¿S\ÚrIä¿ÓZµç¶â¿€á8öà¿V²ÿ$qÞ¿¹(@øÙ¿åÂÐN™Õ¿*'<òÑ¿¶S©jIŒÈ¿†òò¬Ö¥½¿Â¼Ô£¿~‚PMˆÔ£?’+^®¦½?âÑžNjŒÈ?šnïM¡Ñ?Ói‹™Õ? ÑÝ BIä?|˜­Ð·¶â?P¡s®öà?þ WÂ<Þ?'ÿ÷d4øÙ?b:j2™Õ?æ^ .÷Ñ?‘ø§OÈ?«¬ÿ´¦½?ÝôNÔ£?ðá*da¥¿égý¼ù¿¿Ž²’šÅyÊ¿B¬ynªZÒ¿ƒÁfè0K׿Öä­ûJÜ¿Jçˆj,:à¿>8ý!2Kâ¿”¡›%/俸S±3Gáå¿ášÇ~]ç¿¿q“f è¿hÒΣ¦é¿H‚ÕÆ«lê¿Wo}0ò꿈Ú&E5ë¿ëÒE5뿯Ë%2òê¿l“Ì ¯lê¿GqP¦é¿ñؤ]! è¿±p…ø…]ç¿·ÊOáå¿îIÔW'/ä¿Æf–ã;Kâ¿p¦56:à¿xV %]Ü¿Þ Å?K׿éTX´ZÒ¿Jv­ ÑyÊ¿neæù¿¿¶¦d½§b¥¿Ýõ!ˆ6c¥?OÃÊV-ú¿?¤ôyÊ?>¸æÆZÒ?.‰ÿsQK×?Ÿ3½nÜ?ùê]ò>:à?Œ4DKâ?ó¢é//ä?ÔåîñWáå?ˆ¢sBŽ]ç?âJ?r) è?L€î¦é?\Â˃¶lê?cˆË8òê?¥Ÿœ¡K5ë?3÷š\I5ë?¸½r1òê?„Í>¨lê?uøõ¥é?Bõ]˜ÿŸè?9¯N]ç?D?' áå?þJ Iá.ä?ZŽËåÿJâ?©U—¾ :à?@@×,Ü?ÓÁÃAK×?º]AìZÒ?” é‡zÊ?>/F±ú¿?'®pýd¥?©³âtÌǦ¿I‹a¼w Á¿üSg¼Ï6Ì¿C»]sBÓ¿‹ÞÈàÒØ¿}‰Ù,KÙÝ¿®4qKá¿O«ðåÖ~ã¿9’üå‚å¿—(Ïáê¿9ÄHXUë¿“ ŽŽ)쿲&CY·ì¿Öþì¿+]×þì¿a•ù„[·ì¿=…T)ì¿ÓF³—]Uë¿gN•ED>ê¿ptywæè¿¤TÒFQç¿àÉ8I™‚å¿açD’ã~ã¿o Ká¿y7¾ÍgÙÝ¿o·HìýÒØ¿ŽŠ‰,`Ó¿i¾‘7Ì¿°‹Ó Á¿ ø}Lʦ¿iøåʦ?#¤èù Á?OÖV^87Ì?ËDôVsÓ?HÓØ?¥IMðzÙÝ?ts÷®&Ká?vˆí~ã?¦¸Ð¢‚å?”‘UPQç?ÉvÕ÷€æè?Ø-¾M>ê?™U­gUë?´_ïµ)ì?zD5Éd·ì?*œÚaàþì?Éßþì?jAÿi`·ì?*•)ì?ð:XRTUë?Ú(ñ%>ê?ï~«*æè?Mmü¥ØPç?®hwÙ3‚å?iÑRÇŽ~ã?°°ÛÙJá?T GlÙÝ?åÌç?ÏÒØ?Â^HxÓ?úA* 8Ì?íNŽ· Á?qÙræÍ¦?`^ÂÌ-¨¿Œ×·æõÁ¿_ÑÐrc¾Í¿|GKÐÀžÔ¿<ŸXÇw+Ú¿êM¯>©wß¿6ô";â¿  ®~ä¿EhŽa.­æ¿>¾–õ”è¿âev³!@ê¿úupŽ•ªë¿÷‘ÓÐì¿ø?=S°í¿Eæ‘F‹ße‘î¿mçØRf‘î¿Ñ¼ Fî¿ÎÒ–€ °í¿@‚~~ÙÐì¿t=ÏMªë¿jäŒ[+@ê¿xøò>•è¿$çk<­æ¿|&‹Žä¿—qJì4;â¿^õ²,Ñwß¿L ]£+Ú¿¥Ê úïžÔ¿—M˾ͿDŸ¸`öÁ¿(Ïá೨¿ÛçhX¨?€;sɉöÁ?Êvôgô¾Í?’zWŸÔ?-Â2ý·+Ú?8wMÛåwß?)*M?;â?ï¤ø˜ä?x*²œF­æ?d7ÙÓ •è?`R\6@ê?ÿ¡T,¨ªë?Nc˜äÐì?‘#Ãí°í?j»(ïFî?q1ÌÕr‘î?ªÇ™ßr‘î?>iKFî?1ϰí?t œãÐì?Än wœªë?,!•/Á?ê?(ç«.5”è?ì©\´¬æ?NkÜœ ä?G;´çØ:â?ÕtÂP:wß?Þ;0+Ú?@^7À¹žÔ?³-<Ø3ÁÍ?Q¾G%ˆøÁ?Êb¦™ ¨?Â,R©¿¨R!Q¿Â¿@ßá Ï¿¿âþså¿ðúÍ*«ç¿¨ ­§¨é¿‚’ë-‹fë¿}5mààì¿p*E¸î¿¸$åüüî¿Ë(´›™ï¿¢‡BÞ;èï¿ÙŠ3Á<èï¿®cFI“™ï¿ ä·kýˆ;0 î¿…ñdùèà쿬ü•fë¿Iõ¯÷´¨é¿ˆ²4‘«ç¿ÚŒtôtå¿ØaŠW®ã¿ÛWùä_là¿쩞'QÛ¿ÊÓ[96†Õ¿T*Šag Ï¿sÿàտ¿Xkœ*©¿V#ìÖØ©?~Q ÀÂ?Š8“ Ï?lO6L†Õ?U’/´=QÛ?`"klà?’>‡¹ã?–€@tå?™¤œ«ç?’¡–À¨é?" KÚ¡fë?@y-õàì?ãÜî?ú´îÃýî?2{èš¡™ï?n¿†Lèï?"áMèï?Û{Ž>¦™ï?À‰âýî?âÈS”+î?ˆè,áì?OQ¬£xgë?ÎÔ-¦¨é?ÝÑu²X«ç?hmW÷Üså?²Â¤ë~ã?A¿0[3là?b¦®ÄÅPÛ?…zý/›…Õ?ˆ¾ØóÏ?¤"UÄ>¼Â?¤0V•©?mÃ-Éí©¿Ô˜Acÿ¤*i㭠пS}$E0BÖ¿äª M×?Ü¿Úçßÿìû࿃_®ã¿P½^è©/æ¿ú~»‘zè¿„Aíù‰ê¿Ž§-˜?Vì¿Oª7Õ‚Ýí¿…*$ï¿Ç&ûI ð¿ˆz¢Wð¿á¥uЮ𿻌ŒG¯ð¿ xWð¿À¹­ ð¿ä1 +ᅫ/eŒÝí¿{ÑTKVì¿Óé¢-‰ê¿v‚È£zè¿`¿Âé¿/æ¿{QTø(®ã¿&µ~¿ üà¿sÜ»T!@Ü¿{Þ¦Á‚BÖ¿q*¦ÌпZ”ÛcÿZÕw ï©¿øÂ’fFð©?îß×ö dÃ?*4•Ð?çîšBÖ?ô•Æ×8@Ü?Úx™üà?¢Š¿ñ4®ã?ÍâW Ì/æ?%>°zè?µQ;:‰ê?¢¼¹DXVì?(Ñ£h™Ýí?ù¶9ï?ˆOy)ð?&9Ê Wð?ããk¸ð?¢V|¹ð?Úܽ3Wð?H„Ñ ð?⌎þUï?‚{_†ÐÝí?\çá³Vì?Úˆê?Þ`&Pzè?›+ìþn/æ?.Ͱݭã?zmxÄûà?Vé3n†?Ü?‡eÏ=ºAÖ?Åvë Ð?5f“&bÃ?š¢Î»î©?çÕb«”ª¿0˜ÂKÃßÿ‘Ù§Ïtп€™'÷<ÑÖ¿¢BŠ‹qõÜ¿nJDo iῚ'¦Ý™,ä¿y¯ÓªT¾æ¿úþûé¿ ìUÃ3ë¿¡K¢y í¿ðKy(‘î¿<¬'1-ãᅩ\Šmð¿ÂéüÀð¿œÏ(VÈé𿽫ÏÈéð¿þÒ†lÀð¿`’¡ýmð¿·HG4ãï¿S­šî¿ë‘sï… í¿a ¥æÒ3ë¿@Õýé¿ ¼ôl¾æ¿"°%¸,ä¿?uìEiá¿"M…7ÍõÜ¿¬ùF¨ÑÖ¿ŽñíAuпiFÏ^Œàÿ9ÝÚßS–ª¿ËÞÏU—ª?‘¿#S½àÃ?J±-™YuÐ?ûÀÑÖ?h´væõÜ?'Æ~Riá?á4(ÑÄ,ä?Üáy¾æ?•˜Í(é?ø(9cà3ë?Áð³Ô“ í?€µ©î?%©rCãï?B"“ mð?|òÎ=Àð?]„ ¯Òéð?ü 7ÈÓéð?HORÒ"Àð?¨4² 'mð?Q.É2[ãï?^ƒñÁÍî? “ŒÂ í?{ ÔzH3ë?XŽ£«˜é?*Ù¸¾æ?)Ê.NW,ä?~BÌšìhá?, ”` õÜ?ó4aÕ÷ÐÖ?06"À–tÐ?,°ßÃ?Û¬B®–ª?p]X—ò«¿ô9?`3Ä¿“E½ºÐ¿žšr°s1׿Q‹¦oÝ¿ãºxŸ²á¿¨é^'Æä¿µ&[ç¿Ì;Y¼îé¿“Íé¦ë¿ê-X? ‡í¿+bVÕï¿¢²šè4ð¿„~Éwp²ð¿31WÎñ¿brÀ11ñ¿ÑE+821ñ¿&3°ÃÏñ¿oèÚår²ð¿xÔnŸë4ð¿°ÚBÜÞ￸þr£,‡í¿—<¼­¦ë¿ÕTÊ‚é¿öœt翲Åw¢æä¿½sɲá¿mi¿¿pÝ¿Õ(Ò2׿¬Ë¼ ¾ºÐ¿“ ±x4Ä¿*“[¡’«¿d ì_«?!䣬4Ä?(Ò&ß׺Ð?³*:Ð2×?—Oø-pÝ?•¼ ´Ö²á?enßôä?N¶È+‚ç?„Ī»‚é?ôZ-¼¦ë?QÐ"\;‡í?„#h#îï?þm ó4ð? *?d{²ð? ;îØñ?-aR<1ñ?Z±),=1ñ?„‹[Ûñ?CÙC€²ð?¾~ û4ð?p¹›ï?Z_‚€O‡í?Fw\Ó¦ë?àÖ7qé?rÈåñôç?*ÆK¯vä?DqÔg²á?SÄDˆfoÝ?Žõ€j1×?@àEºÐ?Ú€x¶ð3Ä?VF±E«?¾ á³|=«¿CN^Cì\Ä¿ÌÅÃK¤Üп½a׿™Ú@/­Ý¿ŒN0”×á¿ ôÞ™¬ä¿‹{R£Nç¿óäÛ64·é¿>Ý—3]àë¿ÔìEòÊÄí¿ªZœgÓ_ï¿T°r²ÀVð¿ Ì_1OÕð¿G<ó8]*ñ¿ ¨2 Uñ¿”ÚŸ’Uñ¿Æ„”^*ñ¿$KOƒQÕð¿ÄVð¿_¨Ü‰Ü_ï¿° ßÖÄí¿ cï~làë¿è:¶G·é¿‰ã(B¼Nç¿$+Ð/º¬ä¿Ð :7¿×á¿Ó§v­Ý¿úyZ&qb׿ö­Ýп—ˆÌÒ©^Ä¿ßöHgÿ>«¿PC=Ö?«?x._Ÿß^Ä?Øö–ÈÝÐ?uÇ^Œb×?f˜¸ñ¨­Ý?Ú=Í×á?fcÂKȬä?9ŠîœÊNç?~Î\V·é? ){àë?Ï“QLæÄí?Ò|ì_ï?P _ÌVð?ûq:ZÕð?ÙÕg*ñ?•ÝÓ†#Uñ?-&þ#Uñ?ð­Ã>i*ñ?±¨Â“\Õð?<ÃÖoÏVð? ši‚ò_ï?` ÀÌèÄí?›+%©«ßë?šº‡Ã£¶é?°Å „.Nç?Î Ñè@¬ä?nÈVUY×á?2ç¬Ý?‚0 uña×?!ç!ŒTÝÐ?è©à95^Ä?ÄüIŒâ=«?}¬Ó E«¿a}cÉúZÄ¿sØ•˜«Ûпª“7¼a׿acë­Ý¿tÍU•”×á¿lƒþ—¬ä¿4?náŸNç¿ÿiœœ/·é¿É½„¯Wàë¿Nï°ÄÄí¿¸LYŒÌ_ï¿`ð½Vð¿®Rwpâ£^Ä¿ ú‚ô>«¿¢ýÔ?«?Dá1ìÛ^Ä?¸1o+ÅÝÐ?h»ál‡b×?êµÛˆ¢­Ý?Ý£8É×á?Ä"-¾Ã¬ä?ZNStÅNç?(e=¥P·é?šãÒFuàë?Ä`žßÄí? àbå_ï?¼ø¾žÈVð?Ô¸âEVÕð?èc*ñ?¬N~ Uñ?t Uñ?†Æc*ñ?RÕEVÕð?ÀÅž ÈVð?L›òZá_ï?Û*òÕÄí?—m®˜ßë?ªþP›’¶é?䞬¤ Nç?úÜhc7¬ä?×`Ý2U×á?½6Eì¬Ý?¤0ƒ/b×?Q¨wÝÐ?ÞOòÙ…^Ä?©<#8«?ÚÙ°ø8÷ª¿‘ãT5Ä¿üdѻпßÂ\Á1׿"^Ö4¼oÝ¿X3Ÿ²á¿ÑUöÓ¿ä¿qL¡]Pç¿=g¸°àé¿Ö!2¦ë¿KX ‡í¿5=W¦Àï¿}’¾Ý4ð¿®\KÙd²ð¿…˜!QÂñ¿.Éx%1ñ¿¼”ÛÒ%1ñ¿¹Ô£dÃñ¿8¤¯f²ð¿nÉu³ß4ð¿#ÒèØÇï¿Ñ–«±‡í¿Ì¿™¦ë¿®¤Õ£ïé¿€ÏL cç¿trO ×ä¿XfµÞ»²á¿ý“ÛàüoÝ¿wv.sî1׿Ó~½V°ºÐ¿¡š/Õf4Ä¿rìq«¿.”ÎY«?|7÷ 4Ä?Ò™øÍºÐ?8'ë 2×?±\ˆªpÝ? Â:öʲá?Lâú]æä?œp¥rç?L,Šÿé?J Q©¦ë?'tuH'‡í?”ÛÏØï?¾ 2`è4ð?¬øíŒo²ð?‰ánÌñ??šËÿ.1ñ?Ns´.1ñ?FÕÊuËñ?–ç.¡m²ð?$¸}þä4ð?gþÔ‚Íï?ßè+3‡í?„•ÝÆ¥ë?–zQ<é?Q·TÊç?Yä?@š“ŠY²á?ßÌ˸roÝ?-Ó©„¤1×?ÚKÀt±ºÐ?G7‡?5Ä?šYivõ«?6úd UŽª¿]×M:fßÿÜö»(uпmOpÑÖ¿Òõ¸n€õÜ¿ÆHN&iá¿ÕQ?K,ä¿(´A¾æ¿Âˆ¶^ãé¿ÈKêï¦3뿬•1±Y í¿ ²ÃJn„Qöãï¿s‰mð¿^4ÈÀð¿Šðµ³éð¿nAÿ³é𿌯§À𿤻"~mð¿ØíÂB ãï¿t·štz«a í¿F÷ö?°3ë¿-ÜÛî鿬 ÿªO¾æ¿Õã‰î,ä¿Eóa%/iá¿oø ݦõÜ¿Í8=z‰ÑÖ¿Oê)*uпê«þvnàÿ}¥r@–ª¿¶üÌ —ª?RYчªàÃ?öNEHuÐ?y tô§ÑÖ?jfô°ÅõÜ?Û…kÆ>iá?é‰Э,ä?9e-Õ_¾æ?æ‹Uÿé?Œ" Á3ë?ŽÙ;r í?±ð{…î?¢“òãï?ìòck mð?O¼— Àð? 4mÔ¼éð?ŠB¼éð?”ÕfÉÀð?`|ä mð?íå‚/ãï?|-uî?¤UƒZ í?Ÿƒ|oÞ2ë?}»i<é?òšäI¸½æ?r¢pÍ",ä?¨èÂÑhá?MìL,õÜ?„”rVÑÖ?±tîJuÐ?ø:¾ê†áÃ?v-Έžª?Ð)èÕ@é©¿N7¸íP2là¿Ê­Y8zã¿f8_ë×så¿×R«ç¿¼"lœq¨é¿¼-¿ Ofë¿ÂWŸàì¿ÀEõ„½qx´üî¿Ðˆ”ÕE™ï¿ôêœïçï¿ýP’ßïç￵G”žF™ï¿|$Qʵüî¿ìÞ@d¿î¿i?Ç¡à쿽ƒRfë¿§€æu¨é¿@eV«ç¿&Üså¿k°z0~ã¿Ðˆlü5là¿{EQáPÛ¿É’ù ý…Õ¿Yçî Ï¿ø\)(Ÿ¿Â¿ücƒÇ©¿˜(v©Ã©?»?‰Þ¿Â?¯" äR Ï?2¥×܆Õ?Ü…¿QÛ?þðË“Flà?V Eã?ª¶@íså?Êœg«ç?Țɇ¨é?Mãddfë?&iHP´àì?ñBÒî?ä¸^jÈüî?c«9äX™ï?5—™[èï?ôue´ÿçï?dº¸S™ï?Î9¿üî? §]žÃî?¨)ùeŸàì?•<‰{Gfë?odP²§é?;ycç°ªç?Vôy>Qså?fKDã?¬gSåkà?¸$„PÛ?Â…ƒgæ…Õ?¦úÂí Ï?xxô¨ÀÂ?ggŠ}²©?²Ÿ<àZ¨¿ý aõÁ¿ÖÔ¤RR¾Í¿‘ÉÄ5¾žÔ¿¦43Þ\+Ú¿T–rwß¿˜Æè$û:â¿Âi­Lä¿á~‹Aò¬æ¿Ô#ì;±”è¿­·t>Ö?ê¿H’@Dªë¿°SÌ"}Ðì¿0²Xÿ«¯í¿DûgªEî¿<¶LŽ‘î¿«¦‘î¿þ6±®ªEî¿D’ãr¬¯í¿€Ãu¾}Ð쿸Â|ÎDªë¿W¶×?ê¿<#뱔迪Å™ò¬æ¿}ÁÃŽKä¿\Ô ù:â¿Ú¿Viwß¿¬QÖK+Ú¿´dûÈ©žÔ¿ô\ýÖb¾Í¿N› öÁ¿‚M:¨¿ «/4<¨?›¥ÇÅ]öÁ?2ht ¤¾Í?àJ¶¿ÊžÔ?¼¡Fm+Ú?6~#%‹wß?¸2±z ;â?ÝVªI]ä?Ù~¥»­æ?œûåvÄ”è?ð«Šóé?ê?jCXªë?ó‡d0‘Ðì?žWaß¿¯í?ŒˆÁ½Eî?¸Nä‘î?À K‘î?öÉB¼¸Eî?\kïÁ¶¯í?XÃè‚Ðì?†tú6Cªë?ô‰óÌ?ê?Acéü“è?9z°Y¬æ?.”Ý#ËŒä?4'ðµ’:â?/0!ÆÔvß?iÉ[ö*Ú?"cË›žÔ?ÈÏðCê¾Í?GË“éS÷Á?-t:Ç/ ¨?>Û}uÁ¦¿·YÇ[V Á¿¨™•ë­7Ì¿'¥sádÓ¿²+-ÁÒØ¿lJáÙÝ¿f).íÛJá¿$Ù !—~ã¿B•ž~C‚忨ŽãéPç¿*|ïæè¿ fpzÚ=ê¿ ©=ïTë¿àÉ¡D¢(ì¿nT§è¶ì¿Þê‘îcþì¿5@Ücþì¿Zt¼mè¶ì¿'nòÝ¡(ì¿Ð­PðîTë¿Ì‘Ù=ê¿á((Îæè¿f×6çPç¿üÁ²@‚å¿Ä©¾ß’~㿲`ŒÕJῘ‡êØÝ¿©Ü–”ÒØ¿/f0 ӿVùᇔ6Ì¿b?Ss‚ Á¿’hÀý»É¦¿= /Âʦ?Ú“žDÄ Á?üÍâÖ6Ì?ŠŒhV-Ó? ³¶ÒØ?Ò0 K ÙÝ?,BáæJá?2V ¥~ã?Ï~Ñ_S‚å?ë±)cúPç?çóüv%æè?<Öš©í=ê?˜Y \Uë?zéi¶(ì?3ì Çü¶ì?àƒ&‡wþì?ÚY/7vþì? ûÀ•ø¶ì?ª­Y“®(ì?-™8¨öTë?ê¶…€Ú=ê?Xý æè?PƒlDPç?¡òZ·å?þc?~ã?«B¶uxJá?&wîOcØÝ?BEÛòEÒØ?ÄMòÓ?¤-LØ'7Ì?«˜Ñ Á? RUWÔ¦?¶_h™N¥¿Ð´ôý¿¿ÖP–àµ}Ê¿–vR3ËZÒ¿< )¶óJ׿cZ¬åäÜ¿½\¶ê9à¿XO!ºãJâ¿{…"8Ä.ä¿÷°ƒÙâà忆ìƒ,]ç¿Y,#Î¥Ÿè¿üÌue…¥é¿¾H*lê¿Ëcвªñê¿~¶Øz½4ë¿ÌxÙ?½4뿎À”þ©ñê¿~m‚)lê¿&½µƒ¥é¿nnJ]£Ÿè¿üsâñ ]翺ÙÓ§Þàå¿®IZξ.ä¿å‡­°ÜJ⿹“=Gá9à¿PûtÉÜ¿ª² §ÃJ׿¤W›óPZÒ¿ ù¸y=yÊ¿pj–Í'ù¿¿ M†èÿa¥¿Ì¾P c¥?k_­ù¿?;e·€yÊ?òn sZÒ?HOæJ×?úvÙìÜ?ü;Åió9à?PãOTïJâ?º–ÒÒ.ä?…³Vvòàå?‘Áè`"]ç?`Î@i¸Ÿè?2j5™¥é? ÿÛ?lê?’„™Àñê?{9 Ó4ë?™ÈšEÒ4ë?1I5€½ñê?%x‚º9lê?_AV²¥é?¦eȨŸè?hHa ]ç?0jÊZQàå?UjvH.ä? ^UxJâ?{:ª9à?²ÉÈNÜ?Z á±vJ×?C§n:ZÒ?Ú*9 yÊ?ëÑa’Ûû¿?ø@Qÿvv¥?€]‰†áÜ£¿ÈÔ]Ì¥ž½¿H迉“ˆÈ¿ä|Ñ¿´Ÿ¢ˆ˜Õ¿¯Ëx ª÷Ù¿OnpµÀÞ¿l™^Óõà¿ @Öu¶â¿>>ãõHä¿ob@s©å¿y/æˆÔæ¿zÒ}qUÇç¿bB‚è¿ê8D?Iû迨ï$9y9é¿ö«§Øx9é¿dwóHûè¿`vOL€è¿Z˜RÇç¿Ü™…Ôæ¿T_Hn©å¿ioì¥ïHä¿éé0n¶â¿™/ÿ?Êõà¿Ñwϫ޿I+§”÷Ù¿Ó‰Ax˜Õ¿À­O¯Ñ¿frŠž‹È¿ ô?û¤½¿n2ìmDÓ£¿ïIWÜOÔ£?ˆ§Ät¥½?‹z^â‹È?‘À3@Ñ?ÄÿÙO›˜Õ?눸÷Ù?ÃN®ÐÞ?´ÓDÝõà?®â¡Þ¶â? ´¾Iä?󞀃©å?$§ ›Ôæ?ÀÒ\€iÇç?®v¯ü—è?Q²Pg`ûè?ÇXÓm‘9é?Åã7‘9é?RmaI`ûè? €¡–è?½#˜#eÇç?»ÖKN‘Ôæ?Œî÷Mq©å?ÛU(¥|Hä?d³ÏŒ¶â?ÕÍ'èwõà?>&QØ!Þ?öÖ Ý&÷Ù?h”£E)˜Õ?ÐZTÖðÑ?YzŒ‹È?Š<Ø¥½?ƒ§Q=êÊ£?3Y|ú~$¢¿ƒæBö»¿ü²$“rƿ؞t.» Ï¿ëLgåÀÓ¿ŠtôwšÀ׿ú‡´…Û¿M€ü¤îß¿æÐzŸÔá¿“‚)Äþâ¿ði½GjÐ㿜šSüáä¿nU÷pÀ忸Œ‰hæ¿ÿtm×ÀÙæ¿¦üY›¢ç¿+o6¢翜¢RL¿Ùæ¿Êvo†hæ¿ùÍ Àå¿—*6÷áä¿úwe¸cÐã¿ÄžŸöâ¿F×ÓÊá¿c`& Øß¿>OéÚ›…Û¿¸1«%…À׿¼šÖ?ßÀÓ¿´Ë¼ !Ï¿v)›™sÆ¿½ºw™»¿¾ÌKôI"¢¿[v=V#¢?Ú. ? »?FÅU¦ÝsÆ?¾hâP!Ï?—øu‰ÁÓ?®=YW©À×?×6 (Á…Û?Õ.ܨþß?5ì*èÞá?ÅÓ)– Žâ?"jÇ®yÐã?«ÿIâä?–7ûè&Àå?l»›üŸhæ?ª…ÚÙæ?šÁƒ ¾ç?ß|M¿ç?ê‡ÝÙæ?3çø_¤hæ?»‰j)*Àå?©­TE âä?I»àlpÐã?*ù×ߢâ?|˜†á?æt²]ß?ºþ0f/…Û?Vs`&À×?öø›ÆŽÀÓ?JŽ$ð… Ï?e?ý"$sÆ?Î µ¥{»?Á¬šÆ¢?NìRÕrV ¿ânTŽ#k¸¿<$Ÿ7Ä¿"ªmÌ¿àŒìGÂÉÑ¿H4jo‘cÕ¿#èÛžÈØ¿v¦‰dðÛ¿?Î) ÓÞ¿›#ÛPUµà¿ÜŒáª×á¿êœŽwÎâ¿ðð&·ÿ•ã¿Ð⋲-ä¿„=쥓ä¿tT³tÞÆä¿(œšÕÝÆä¿ö? ¤“ä¿tœT¯-ä¿âÖÅû•ã¿Q1:ýÍ⿊à¢×á¿ZïI[Kµà¿‘Á@ó„ÓÞ¿Êýk/sðÛ¿Ñû„ÈØ¿NpÝqcÕ¿™”ä˨ÉÑ¿ R#à Ì¿–Æž¥7Ä¿Æ;ÞÑj¸¿¸BpIT ¿‹Ã,ôTU ?s~û\Xk¸?Žîkœé7Ä?HWïáNÌ?–¡ÌÉÑ?Qì,–cÕ?Ôè´ ¥ÈØ?t{8,šðÛ?é|®­ÓÞ?bþÿ`µà?*C¢w¹×á?Ôâ?6Îâ?äÒ£¦–ã? W¿Ê-ä?‚[•~Á“ä?fO}ýÆä?”Ò)MÇä?>f½—É“ä?lÔúÖ-ä?¦ø=ª"–ã?j%Ê !Îâ?Tý‰½×á?çH¹µà?6XÙ´:ÓÞ?P5iL*ðÛ?ÄúãÁ5ÈØ?¿ê[&cÕ?WøHµZÉÑ?§â¶heÌ?5DÓìô6Ä?ê@[i¸?çu2ÙÛQ ?ŠèM¹Õ圿òðeÅ–µ¿vÞElcßÁ¿oO0jÇÈ¿õÎhrÏ¿¤Ä9òçÒ¿³­/èÕ¿8ar4²Ø¿x®”r?Û¿eê%„‰Ý¿ 8ÄŠß¿)iØ© Ÿà¿·ºJØäOá¿:E€ËúÕá¿L·lâ0â¿i æ]]â¿„ø 0]]⿢̄¸0â¿ÀÈ÷Õá¿ÎîßOá¿´ô {Ÿà¿U‚J´±Šß¿mi çl‰Ý¿–fGôU?Û¿ *B˲ؿI| úêçÕ¿q  *ÂçÒ¿¸\úqÏ¿¨ÏK~éÆÈ¿ŠcTÂÞÁ¿üž´"•µ¿*Ö9ÔÝœ¿5âéçßœ?ÌaZ™•µ?ŸÜEÖßÁ?½ù..ÇÈ?¬½ ª@rÏ?R(ÿ[æçÒ?É¢wèÕ?8U ß8²Ø?N–úò~?Û? d3˜‰Ý?óHÃߊß?íf£0㾿ªäWVèhÅ¿À¿ú¾ˆ+Ë¿ß)åŸUп­8ð;íÒ¿j‹/2VÕ¿’_MŠ×¿hM(æ„Ù¿›¹øR@Û¿*Šð2‘¸Ü¿æƒŸêÝ¿o’‚?±ÑÞ¿²…fm߿ȰÿÚ »ß¿õ”ûKŸ»ß¿–7uÊamß¿’˜¸,©ÑÞ¿„ÚpQõéÝ¿nS·l¸Ü¿-ðc‡>@Û¿~ )>̄ٿv²WÒoŠ×¿Í?O¢ VÕ¿".‹# íÒ¿0Æð{_Uп°§É¶á*Ë¿¬­‹s hÅ¿r:Š€Ô྿¯Ù€™t¥²¿ô˜mð˜¿z¡Rxò˜?@ø¥²?¶µå¼Yá¾? ïGMhÅ?íž54'+Ë?ÎNƒUÐ?X…pO.íÒ?©ÂÍx0VÕ?ÅK²˜Š×?k™÷„Ù?‰ ^êl@Û?´þK‡³¸Ü? O",êÝ?Ý<ŸåÑÞ?êÿi~¥mß?Zð >ì»ß?î¬n™ù»ß?éĵÎmß?Mï‹}*ÒÞ?—ÞŒêÝ?÷;œü%¹Ü?òPÙ@Û?—¬4…Ù?hääåÄŠ×?.1â¼7VÕ?¼Íé¿íÒ?"PAÌHUÐ?Œ3Ðïm*Ë?:^:DgÅ?ßH²ªÞ¾?YÓh¢²?qÅØb¡ã˜?pjŒ4è•¿< èXT¯¿êY¤Z칿ñFæ‚÷Á¿Ml#Ü½ÌÆ¿ÔÜ›ZãiË¿¤ 3†ÃÏ¿ÄܲsçÑ¿\â¾JÁÓ¿ü,5QàiÕ¿‹AÃÚôÝÖ¿Ûʪؿ²QfõÙ¿k¦¨^ÜÙ¿ðS•k_Ú¿´¯ßqª Ú¿‰ÙîΨ Ú¿@õs_Ú¿2ãÑ.VÜÙ¿6šIéÙ¿ aEƒ™Ø¿{s­JßÝÖ¿m°3ÏÄiÕ¿ZÞnßÀÓ¿<ì¬FçÑ¿…°ÛFÃÏ¿G-BxLiË¿Dª&ÓïËÆ¿W‰Ú^öÁ¿fM÷D 鹿_¬¶åJ¯¿•Æí!픿D%éô"ï”?*ÈtÊçK¯?Æûã‹é¹?: :`¡öÁ?š#Ó4ÌÆ?â5­Ñ’iË?¥˜Z]ÃÏ?~âçlçÑ?Lã¾ÁÓ?ôQº®ïiÕ?]MS ÞÖ?Gd{ËØ?. } Ù?ºs³u“ÜÙ?BÀ\G_Ú?3<Ôpù Ú?Ê Ï. ¡Ú?¬^.{_Ú?b/ÉÄðÜÙ?¨˜ò{®Ù?3‰á.ŒØ?Žœ5ÞÞÖ?;—Û¸jÕ?`12gÁÓ?ì‘/ ²çÑ?ÈÖB„ÃÏ?ØšciË?:¯ü¦ËÆ?‰Ý4¯ŸõÁ?yGÄÁOæ¹?ú1ÖÐWB¯?ÁA#`ùÖ”?IÞ2¾ø ‘¿FÕH4éJ©¿V?‚ê´¿ƒç5ý¼¿@Pãˆd¿È7¢fGÆ¿hw«ß–ŸÉ¿ú%ÇâÌ¿b€õÈÞÏ¿Ì>¥¢FÑ¿ÖölBrÒ¿¨k7WîpÓ¿)ü5Ĭ?Ô¿ñˆèÜÔ¿†§ö÷äEÕ¿ÏÔžü×zÕ¿ÚlTÖzÕ¿?ñßEÕ¿¨Y¢VwÜÔ¿/I@Y ?Ô¿JK‡›ÝpÓ¿*W Õ,rÒ¿¸#PéFÑ¿Ÿí¶ÞÏ¿8G=[mâÌ¿äØÈz"ŸÉ¿ŒDFc¬Æ¿â䓲c¿)œæDÂú¼¿³€ÏK­æ´¿!HøÛ>©¿nîWCOá¿„§ä»Bã?* ³?©?ÅØw,ç´?Ö6ÌCû¼?‘]W‚ôcÂ? þ(âðÆ?Ó…²£iŸÉ?¼Û—Ó·âÌ?Ó•ÐDÐÞÏ?Š!î´+FÑ?„S¡¿YrÒ?ÌnqÓ?§S!Ö?Ô?l¸å‰³ÜÔ?Qd«§$FÕ?7~¯&{Õ?Òé±â8{Õ?.# †^FÕ?nX1c ÝÔ?éD—=Ž@Ô?‘ùb˜:rÓ?¶Š òsÒ?X½T±GÑ?äp  ràÏ?ôE.ŸãÌ?hÔ²ÐæŸÉ?P¦9«Æ?Œý@¯cÂ?Ëú_§ù¼?úœ©Rëã´?¸›žìÙ2©?ØCù²Ç¹?«ú#¿ÂWŠ¿ D~ˆE£¿ñY_h,ܯ¿Ð‰ø¶¿õ ‰ö¼¿Òán×À¿pPŧ¯ƒÃ¿³‡[¨¼ÿÅ¿ ÿif“EÈ¿Œ]¿N—OÊ¿±WÀÌ¿ômÞ¥œÍ¿,]¹‹×οð­ìhÆÏ¿¢aÇ%x3пµVMíÊ[п¬Ó NÉ[пŇM;s3Ð¿Ø 3XÆÏ¿1|äs×οÂ}u…œÍ¿rKW?–Ì¿à†oKbOÊ¿wñ¾PEÈ¿üð«hÿÅ¿w"ë«DƒÃ¿‡ž×À¿xw~¼¿Šøe ê¶¿€ž"ÑÕ¯¿ÑúñP9£¿Sê`¡µ‰¿¾ô#g¹‰?„Z¶õB:£?jZïÆÖ¯?ns{,g¶?8íZ±¼?½á%G×À?êÞ·E‰ƒÃ?«‘;b°ÿÅ?ϸIœEÈ?_À‰²OÊ?%ëÞKìÌ?{X ½âœÍ?-¦ùÙ×Î?ÐaTZÊÆÏ?n›] ´3Ð?‹èÚ¦\Ð?¬G¼7%\Ð?¨R–îè3Ð?ÒÔ:”ÇÏ?Ã@°DÙÎ?éTÂ;ÆŸÍ?v hwü!Ì?HÖXÚRÊ?ínù&êFÈ?õÎ5ÚºÆ?¨qW„Ã?è…Ê×À?ÄÛê{L¼?0,}»¶?"€þtÒ¯?§j 0£? É«Ó!‰?0áx¤|¿¥IÒûs¤š¿šÃOG¦¿mS¼“Ê—®¿ƼNi³¿M'ºßV·¿ØÆžÚî »¿ÐãRZZ|¾¿t{»ÎQÑÀ¿GÎħ;¿ß,€eÃwÿ§>¤†„Ä¿ ¼7nµ^Å¿h_S–5Æ¿¦íànsƿΠûíN«Æ¿BÌyÚK«Æ¿ ¥R’esÆ¿ôýÏ%Æ¿rþvÞ^Å¿œHivh„Ä¿`w·ÔœwÿHåK‚Ò:¿ ¨'xÑÀ¿ø‘QýÈ{¾¿Ã¶S-= »¿oIÍV·¿–*à†Gh³¿o⌹]•®¿ßz’Ħ¿ „5磚¿v"p.ÑÏ¿/V}pÓ?šÝTùb¥š?C­uJ°¦?ß|ÇŠM–®?ñe=Âh³?–$…V·?ÐÓËÀ »?d[åyQ|¾?ÃHK ^ÑÀ?T°²P;Â?w{°íwÃ?KÐп„Ä?ƒ®êsý^Å?cÔÁŽÆ?"°SþÙsÆ? þj ЫÆ?Öì-è«Æ??kÍP$tÆ?ðp’ùÆ?V—àçÃ_Å?F:J²¤…Ä?”úÜ(vÃ?>“”Ô5Â?Šø/œÎÀ?Ÿ1ä_‘x¾?§£È¦»?»YÚS¾S·?m DŒ-f³?®?¯w‘®?5¢Co ¦?LÀÿ顚?Ýy¿>ó ‚?¢OKt¿ Œ5–ØhŽ¿@p_’I8™¿Ð6 ‚ }¡¿5Üj” 2¦¿ž9Þ°ª¿ÂÁØç7쮿P,I! n±¿Ä6”5;³¿IbQ¹—Ø´¿@Õ\>ÆB¶¿ ái·v·¿žpÈGo¸¿ h¥È,¹¿’E ô«¹¿:¬ÁÕ빿ØE‘Ð빿ô«õ⫹¿î}Ï«,¹¿|F)do¸¿Ô`Þu·¿æj‚B¶¿ÞÈZDØ´¿9ePo¢:³¿.50þ—m±¿DðI8+뮿©)œë®ª¿™Ð"â0¦¿Tòoù!|¡¿#bŠ8™¿« ê@uŽ¿å‰Æž\t¿F5úƃct?0齿·xŽ?©n0ÖJ:™?•˜„Ö}¡?YMóÊ1¦?L­ÂÇÚ¯ª?HüH"ì®?>\4Rn±?žÄ™…(;³?ù›™MÑØ´?pùÒ%C¶?Ž'ÂI}v·? 7tNp¸?Ÿ&Óic-¹?àCÃLª¬¹?+i©ì¹?nÃþQÂì¹??erQñ¬¹?†ÇX[Ç-¹?СiUp¸?©¥Èvñu·? Óó$@¶?QÑÓ´?¥O`Ä6³?¨'©§ j±?¨±Ânæ®?öè4q«ª?¸úü°-¦?,R»Úy¡?ŽÁÏ87™?Ÿœ¬¬š€Ž?Á*Ó#Ò¦t?¢êó—GèV¿Þñ*÷zq¿ÜÆã}¿ÄÛE®+„¿lÙ ¯”›‰¿ÒP2ËŽ¿Uëå)ב¿Ì’‹”¿äW $n0–¿R6b † ˜¿ÄazQ¯™¿ÐYÌ›¿·ÿj1œ¿~vUÏ ¿ª&ÁÊwž¿†F-àè¿:„¦Ÿè¿ä8ËÒ:ž¿¤°Ši ¿îóÑ×ü0œ¿Ìãd›¿Úw›2i®™¿€aÏLq ˜¿¾,ÅÜ./–¿¦°<:”¿:¯¢²Õ‘¿PZ”þbÈŽ¿\X ]y™‰¿dâÎ;o+„¿>O ,N}¿«}\üq¿¢äÒLuW¿DÑòZW?Æ¿Ž‹‡–q?Îiê}? ¥ ¢É.„?Ü蔎䜉?2âÕ‚ãËŽ?†Uïב?¸£è”?¼›¹é1–?šéÂUu˜?.@W…°™?ŽP4áF›?â³GP3œ?Ú’Ú ?NxÓÈ ?Î.ÃK«ê?¬Ô­¿ê?Â2¥ç ?$ýêq ?ÈÌ4…Ò1œ?Êïî›?â.—©§™?*†ù„˜?µ¹fp$–?*!ÞÊ”?üD1ÖÍ‘?Œ°*Ô¹»Ž?®F‰?^^ üE&„?X+]G€ê‰2Ÿ?Ȫåb¨ ?TîdBnŽ¡?(´Æ¶1I¢?rµT€ßÖ¢?ؾ«'6£?ºâÞöe£?ôê°ÿe£?Ö¢46£?:Û⦠ע?¾ábzoI¢?êÐx`½Ž¡?¨±ÄÁ¨ ?Øgg3Ÿ?B4¢_Èœ?bn+bš?ÄSþˆ$—?~ ]¦ºø“?œ’ %œ?ÎCnˆ;-Š?ÈDÑ5§á‚?P`çÏv?BØ$[Š^?¢hzi8r^¿nK¿ôÈv¿È…ÐgÞ‚¿Z·Ô‡*Š¿Æˆ†Æš¿Ä+„Ù÷“¿Òå’j"—¿(³9p¬š¿€¥_«œÆœ¿â§¼(–1Ÿ¿×{ѧ ¿d£“Å¡¿$øqH¢¿'ë²Ö¢¿,BÕ15£¿„uè÷e£¿*j¼e£¿ÖAÿ*q5£¿—$ Ö¢¿þ©ÕÜ©I¢¿œa¿fý¡¿œ¿ÿÎ?« ¿pnÏS:Ÿ¿ k‹íÏœ¿ü*2ãš¿@Ðaï<*—¿ˆS•Ŧý“¿X–ú“Ÿ¿ŠoFÚa0Š¿Îx„„à‚¿š’á¥1Áv¿ÔѪ‰ü.^¿{[-`òs?«¡M‚…Ä?ð%袘?ÇO\j¡??q‰3a«¥?b‚H ª?¨pÀd‰0®?¡ðuQV±?ï"áxƲ?dMá•TZ´?¤mCk¼µ?ø‹è¶?të0ÁÛ·?Lžw‘”¸?û+ǹ? ûul1O¹?—îg-5O¹? ,ËÒ¹?·ÌÚ¤”¸?T‹‡LÛÛ·?(Ó@è¶?¸ºÄÛ*¼µ?…Ô}¾Z´?H¼§¦Æ²?âýÞLƒ±?::S×0®?š£9ª?6‹¬î^«¥?¤¶÷Ý¡?;Ô0v¡˜?@qdÀ?ll9”çs?¢Ñ¨Øëás¿6¶^‚.½¿~Jö ˜¿”.Ñ_¡¿ÿŒ´F£ª¥¿®}NIz ª¿ÉA§ƒ0®¿=Àa ±¿èÿs>AƲ¿ÇV•>Z´¿ëÛ8‡Á»µ¿"£{ú3ÜN¹¿kJv‘ëN¹¿ Ï¡¹¿I)ÜKž”¸¿3ÎßÏÜ·¿û [Ôè¶¿íöŽ“½µ¿áa*¼[´¿r¹xgȲ¿m7ïÖ±¿ýoàœ/3®¿;ï+]ª¿eþÌȤ¬¥¿/n#£¡¿ŻÎÞ ˜¿›ã°às»¿Ýmg@Ùs¿ŽöHÙš»~?X»½&õ–?´O¢«£?–°|©Yª?wѼ[¸°?žH\ ±´?Nò?¨|K·?2—˜ßBº?{¶dˆù¼?š#%?Äh¿? P8IÅÀ?,ÀÝ(جÁ?¶òéÍÓhÂ?:Ÿˆl÷Â?\Kí®BWÃ?Ö8Nêi‡Ã?ÀUxzk‡Ã?MXGWÃ?tW 3t÷Â?ûLÞhÂ?†×1å¬Á?ÀÈÂTXÅÀ?7×82åh¿?­a˜¥©ù¼?iVœ–þBº?kßæ¶”K·?vÉ!X¼´?tRÜcS¸°?„±ìcYª?Œ-˜+£?¸E:Ó2ô–?l£äµ~?ªo÷ð±°~¿;4Håò–¿Z~?Óƒ£¿uÌù²ºXª¿¸ ÛØý·°¿Ê͵e´¿úþªãj¡ÉÂ?y3è ¾]Ä?ü¢}¥¿Å?¤DöîëÆ?”[‡éµßÇ?Q«r.¡˜È?ÇzNÃèÉ?{0ZSÉ?e¸w[SÉ?é³LìÉ?%ßb§˜È?ÅxR¾ßÇ?·jlAùëÆ?.31±¿Å?²FLwÊ]Ä?P²Á›­ÉÂ?°%Ðñ>Á?õ\Òþ©5¾?e–[º?SC¾VÆ®µ?ê¦[d¼±? ÒQ\'¥¨?-‚ë'Ä?bγ?éƒ?¯wCÍãæƒ¿:’Cù¿¬¸ôW¤¨¿Xåo±¿m؃>y®µ¿Ž× º¿ÁÎË[5¾¿t˜ê€Á¿>¹†É¿ˆã0 £]Ä¿­ºIŠ¿Å¿½]gtÓëÆ¿ÔºðzšßÇ¿ø6Ú¸†˜È¿+¥3ÄÐÉ¿©éÒFSÉ¿Þl¥OSÉ¿9qtáëÉ¿Y9ªÐµ˜È¿¾èqßßǿɚ /ìÆ¿…D/¨ú¿Å¿tú"^Ä¿ÂE£ Ê¿X‹@ÈÁ¿%dh¹T6¾¿”CÈQ庿1ÐÏ$¯µ¿¬†Â汿ÇKÈ?¥¨¿¦Ã«G2ÿ‰¦"Û!惿~2‚‡?œCˆ8Q’¡?9?X­º­?¸/"¯+´?W¥‰ºD™¹?×=¾Ç¾?$¬~¬+ÕÁ?›ç1‚Ä?t¡œ„I.Æ?°œ¯jb È?Qgr4­É?ð–ªQ¹Ë?˜ÓžÖ†/Ì?{'âS× Í?vî‡uœÍ?ëXoHæÍ?¥êÖuIæÍ?‘Ân€“œÍ?ÍREÜ Í?ggJz/Ì?ŒüWÁË?æßƒj=­É?ò‘ûk È?«?hR.Æ?T_D³‰Ä?‚ãò0ÕÁ?é„°]ÁǾ?P+¨>™¹?¨+™´Ÿ+´?%­?þÞ?˜’¡?ø4#„‡?rêÔf‡¿§³n ˜‘¡¿­+>­¿¡CFo[+´¿9:~ú˜¹¿=í||Ǿ¿d+ÕÁ¿ø™=2gÄ¿„C0.Æ¿YÖ;ôI È¿ž”­É¿H¬¢Ë¿w’–p/Ì¿¿Y3è ͿÁmN#œÍ¿@ó;æÍ¿ƒD«üCæÍ¿µ*ƒ—œÍ¿Ý%:ì Í¿EœJL«/Ì¿.­³íË¿(yw­É¿}\c¯ È¿”óýóš.Æ¿TO¢.ÑÄ¿Vˆ5qÕÁ¿'V**Ⱦ¿£!žö†™¹¿ßN­†Â+´¿I–A…­¿šC;Б¡¿÷©òd‡¿L! Š?ÊD®q×t£?«Óýò°?PO…)¿U¶?ØØxX¼?Šið¨ Á?T_V9¿Ã?t:Ö:ÊBÆ?Ùl £È?ÃxÞîŸÊ?p!8"—nÌ?µó–'÷Í?²˜OÅÖ5Ï?ÁS5ÊÐ?NàÃùeÐ?tPtbÖÐ?Î:xÊÖÐ?Ô§E-eÐ?"êl&ÌÐ?}KˆòÛ5Ï?<2ÛE-÷Í?±ŒôönÌ?M¦vÚõŸÊ? #)—©È?t,˜©ÏBÆ?ß(ÀØ¿Ã?ÿT°:© Á?/Œ4×uX¼?\ôõ9·U¶?ºpÇJè°?7mzïÄt£? 1a¿Š?WKÐï*Š¿âîÇ]Mt£¿¼ewg¬°¿º0‹7{U¶¿¹Ú¼9X¼¿,Í+‹ Á¿’¡Þõ¾Ã¿o¡gè±BÆ¿ïñyFŒÈ¿×øIJÙŸÊ¿³¥„–‚nÌ¿RI«÷Í¿?ãÄ5Ï¿„Õ=bÂпbÏHÈÿdпR,Ê|Òп°èÓøÕп'AC eпÀš#ãÓпp®R´õ5Ï¿Â9CaQ÷Í¿â߯AËnÌ¿â‘Ù) Ê¿:dºàÈ¿¾„{ÇCÆ¿h]½½D¿Ã¿¼Ô&Ñ Á¿¬›På­X¼¿}‰ñéÓU¶¿hÜÁÄè°¿®óþ·‘t£¿f§ê‘Š¿Ý“;új]‹?”<À®öt¤?&9?® ð°?ÁæÚ{·?gاÀͽ?Dq€ëÁ?†x'æÃÄ?H½2„ögÇ?XÙØÞÓÉ?šÆš‰”þË?!u åÍ? PâËÏ?zÙ£>phÐ?žØÒ†çÐ?îÖ­Pð<Ñ?Ð7#!ÚgÑ?Y‰CrÚgÑ?Já @ñ<Ñ?ÉžjSˆçÐ?ÁÝU=rhÐ?è:ÑžÐÏ?ª“ž.åÍ?A–È™þË?ßQÁÓÉ?wx–úgÇ?Í@¾ ÃÄ?f®ìóëÁ?lÇ"KÀͽ?Ò?wUØ{·?¿ñ Ý ð°?üÎsêöt¤?ÏÅÍ¥]‹?À/ÌD\‹¿Ôeâkt¤¿u¿×ï°¿I5¤{·¿’d때ͽ¿61ýêÁ¿CÈ-ÃÄ¿Žæ]^ágǿ͠ÃÓɿš‚þË¿]Š)¯øäÍ¿§ÞSî»Ï¿ËÚ"ihп®ÚÝ€çпB¬™ëë<ѿՙMÉ×gÑ¿0ñü³ÚgÑ¿ªÇ¥ô<Ñ¿µ QNçп(ç }hп©º¡íϿĪ:™2åÍ¿´àŸ¿ÁþË¿âÑ ¸IÓÉ¿„?š#hÇ¿2¬§ÑEÃÄ¿Ýæšf5ëÁ¿}ïÿ¼ëͽ¿±-ËÃï{·¿ªç¥ ð°¿ÖºøîÕt¤¿‚²ú  \‹¿2¼vÏri‹?œIç~¤?`´ ÷°?ß‚ _†·?û®zäÛ½?ŽÅEóÁ?f\ oÌÄ?K‘1'xrÇ?ûéÓ²ÞÉ?Ç«î& Ì?ÍBšvòÍ?HJY.ñÏ?â@ÎoÐ?X¥ïÐ?ô‘j­DÑ?Î9lªoÑ?¬4vªªoÑ?x í!®DÑ?\TuËïÐ?ŸR»–ÏoÐ?¤è-ÄôÏ?aˆ<éyòÍ?Z,Ò* Ì?𳂶ÞÉ? J{rÇ?3šý|qÌÄ?Š×–à óÁ?* ³bÛ½? uFè_†·?²¦'ì¡÷°?+xý~~¤?6†‹¡Îi‹?„Ý£ìph‹¿\MãÇ}¤¿†‘I@v÷°¿ó|P4†·¿j˜ªôòÚ½¿¸7*3 óÁ¿Ô9.\ÌÄ¿LðcfrÇ¿p3ö8¢ÞÉ¿l\Pž Ì¿%EýÃgòÍ¿þ¿"SäÏ¿jó1Èoп<ç£(ïп+˜RªDÑ¿àgê©oÑ¿Ðí#r«oÑ¿‰b±DÑ¿NùÆ$ïп*vÜaØoп—Pݰ Ï¿ç¦T•òͿͲA‰H Ì¿ˆIKÖÞÉ¿™"H<šrÇ¿¨ÆwxÌÄ¿·o]Ý7óÁ¿BÁ'Ò?Û½¿¸ Æ¹r†·¿jÚ+¥÷°¿–:"T ~¤¿"1qi‹¿E5½`JŠ?…ð”L|£?Úö * "°?I†FB^¶?éƒtQc¼?C«¦1Á?·à¨y¦ÆÃ?𛼯YKÆ?]3™È?YŽHÚ-ªÊ?Ô=–QˆyÌ?<;¯Î? ­HÙAÏ?›"ëÉùÐ?ü|™TkÐ?äºó|4”Ð?/¨«4”Ð?íò"UkÐ?&3¦úÐ?´­ŒÛAÏ?ô;æ±Î?úÉj8‹yÌ?¦Ž„Ê0ªÊ?ó£¾ù™È?Û›Ì6\KÆ?0¬'v¨ÆÃ?žÖY/3Á?¢ªeTc¼?âoF÷D^¶?æ¨M"°?-æ*|£?àN®Š?/J¨©Š¿4 Šã{£¿e…¯ì!°¿ÐYÂw!^¶¿–«Ò0c¼¿cÕ¶!Á¿U!C—ÆÃ¿*]!lKKÆ¿þá,ƙȿ"žÞj!ªÊ¿±çœù|yÌ¿áu('¥ο¤½ÐAÏ¿^½vöп—UrRkп¥—4Â3”п™Ù-ž5”пn¾åúWkп^XÁ‡ÿпu “kéAÏ¿Q ®•Ãο۸’  yÌ¿-‰×»GªÊ¿ŒÉ¼µ0™È¿R™@sKÆ¿·P¾K½ÆÃ¿ø.vDÁ¿ƒÅäimc¼¿©_¯S^¶¿þšÜ"°¿ÿ³"b|£¿ö ðê.Š¿lCx¹?Ô/x§ ¾?L+s8;¾Á? ˆî©Ä?Ì`ÄnÆÆ?"_ÒzìÇ?<æJî3ŒÉ?Ì:DÕðìÊ?Ü­ÇßK Ì?|V‹ ƒäÌ?S$Ó~vÍ?tC׿Í?|¥¡…׿Í?°,Ú–vÍ?˜ÆÃF„äÌ?É{M Ì? `!ºòìÊ?؇ëý5ŒÉ?¸ì|ìÇ?lÔ_sÈÆ?´OíªÄ?È‚Ø<¾Á?°Ý.‘  ¾?Ä}[TFx¹?”’'ú ´?ô¡Ô£ó¬?lÕÌLd{¡?‚Äå±b‡?ˆZE-Ôa‡¿ÿáï,{¡¿€w²mËò¬¿t¶…´¿L§›+x¹¿ž© ¾¿ þ©¦/¾Á¿¼ ОĿHñ´&¼Æ¿ô *VqìÇ¿G[+ŒÉ¿x­MSéìÊ¿ì@Ÿ¤E Ì¿Ä2R]~äÌ¿¯®ý{vÍ¿°ÚÚÖ¿Í¿Á²‡àÇ?x¶æ9jÇ?tA0 1ºÆ?¼ƒX ÒÅ?ÙcƒC´Ä?,CŸT[cÃ?X€ái¦âÁ?ð‚8:Ù5À?h_Yæ)¼?¸@ž”ºÑ¸?”8¹·¤´?´kËc—C°?¸NþEöu§?ˆŸZjÍUœ?|ôá¥ó‚?°hÃó‚¿ z~Uœ¿ˆfðÎu§¿h5•ÖƒC°¿l×Y¤´¿dÈz~§Ñ¸¿ W 9¼¿ÄZ.Ð5À¿ÀÖeÄâÁ¿”jU9Scÿì7ˆ<´Ä¿²¬ÚÒÅ¿|»ˆ²+ºÆ¿TX|‡5jÇ¿„¬]…àÇ¿ô¤O‡÷È¿D£rùÈ¿D§‹àÇ¿¨opÐ>jÇ¿hÐGD8ºÆ¿½C)ÒÅ¿ÄâÊM´Ä¿ìÀzfcÿ¸<4Õ±âÁ¿p”²Aä5À¿˜ ÀÛ=¼¿ ·½?ËѸ¿$CÉ&'¤´¿dŽúžC°¿¸wðMûu§¿ÈäÌÃUœ¿=•.oó‚¿hÌ•ù¤y?à?ò+“?0 ¼í`¿Ÿ?È®mD¦?Hˆ3”î«?AfU˰?`ƒŽUu³?¸°Ð¥®ïµ?pôN½ò3¸?À§lG‹<º?Û_Ît¼?X™UQK‡½?PªUÁ¾?ØðA拯¿?°‹š5Ò'À?ˆÍ6ø PÀ?PZ PÀ?à¾Ò'À?ÜàÙŒ¯¿?2ýXVÁ¾?àl;ËL‡½?€ˆâkv¼?Èý6òŒ<º?¦bô3¸?¨xÄ8°ïµ?h)kWu³?ØrÙ˰?P.©‘—î«?èµ—PH¦?¨Ë™Žl¿Ÿ?hËÎ(,“?0Èó‘V¥y?€A§ ™¤y¿h¸µÜÓ+“¿OÞp=¿Ÿ¿@pé0¦¿p@Ëh€î«¿à–4sùʰ¿ØcÀíKu³¿È„at¥ïµ¿ ‰ê3¸¿ðñdZƒ<º¿H¼™³m¼¿è‘ /E‡½¿e"PÁ¾¿à–äGˆ¯¿¿¼[3Ñ'À¿D—Èà PÀ¿t PÀ¿ô¹vŠÔ'À¿ªª,“¯¿¿€2‰Ø^Á¾¿Àp':W‡½¿¸ƒÇa‚¼¿ˆñÞ™<º¿€Ü–4¸¿.ö¼ïµ¿ •×bu³¿Àµf~˰¿X ¦î«¿X=&=Q¦¿¸lÃÊr¿Ÿ¿Éþ+“¿0ô./¥y¿0WY¤fœc?@yåwR}?(uÛ6Gˆ?À«™«Ô?Àwâu;\•?@²"¯™? Ò$¶Â?0A\uÆ ?ÀûC4‚¢?°´«Q¤?0Füöl¥?ÀE:Ê”¦? ,vñ„§?piªš;¨?`z*‡Šµ¨?p‹šb ó¨?Ôt„ ó¨? ü±êе¨?`™ç9;¨?ÀÇtGò„§?à[1Ë”¦?ð ø øl¥?@”;)R¤?ë‡5‚¢?P~qivÆ ?à²)¸Â?`nP5$¯™?à+XÒ=\•?@ãú­Ô?0$Àü>Gˆ? Õ6åR}?ðÝÜ…¦œc?iA(œc¿ÀqÚàNR}¿ o@›Gˆ¿ söežÔ¿ÐßÇh.\•¿ ~' ¯™¿ ý\©Â¿—CoÆ ¿à\dN.‚¢¿=ƒÏK¤¿°û%Hòl¥¿ „‹-Æ”¦¿½–/î„§¿€U>;¨¿Ç¿1¬Ö0¯™¿pwÝNG\•¿pôXÞ³Ô¿ðÃ4CGˆ¿€8‡R}¿pÄ;õ~œc¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?“’èÑFìï?ë@ä¹’ï?FÅ^“ìï?’]ü’Öî?~¥Y`äì?¬¯G jë?uÜJó«é?Œ)Êh®ç?Ø,ÄÅÈvå?VÃ[/ ã?ûñØêtnà?ãÏZïŸTÛ?J$ÂjôˆÕ?=r MbÏ?G@?ÍEÂÂ?µ)¼¦©?K³)¼¦©¿Ô??ÍE¿Íq MbÏ¿$ÂjôˆÕ¿®ÏZïŸTÛ¿áñØêtnà¿?Ã[/ ã¿Á,ÄÅÈvå¿x)Êh®ç¿eÜJó«é¿¯G jë¿r¥Y`ä쿈]ü’Öî¿?Å^“ìï¿ç@ä¹’ï¿’’èÑFìï¿•’èÑFìï¿ï@ä¹’ï¿MÅ^“ìᅵ]ü’Öî¿‹¥Y`äì¿»¯G j뿈ÜJó«é¿Ÿ)Êh®ç¿ì,ÄÅÈvå¿mÃ[/ ã¿òØêtnà¿ÐZïŸTÛ¿~$ÂjôˆÕ¿®r MbÏ¿Â@?ÍE¿¬¶)¼¦©¿{±)¼¦©?Y??ÍEÂÂ?Mq MbÏ?á#ÂjôˆÕ?yÏZïŸTÛ?ÉñØêtnà?$Ã[/ ã?®,ÄÅÈvå?d)Êh®ç?RÜJó«é?‘¯G jë?f¥Y`äì?~]ü’Öî?7Å^“ìï?ã@ä¹’ï?’èÑFìï?ë@ä¹’ï?îc« Oï?7Ù¹|´î?2 ¼`¥Íí?Ágê¿Sì?FÒ#v&ë?Âüÿ«¨lé?Âß §,tç? ÀaÒÝAå?|[A&Ûâ?L90<òEà?_8Q>Û?¶ä«ÜSÕ? ¹UÌÃÎ?<ŸÕ.”Â?ט©¼ÉÙ¨? —©¼ÉÙ¨¿ÊžÕ.”¿0¹UÌÃοä«ÜSÕ¿+8Q>Û¿390<òEà¿f[A&Ûâ¿ô¿aÒÝAå¿®ß §,t翲üÿ«¨lé¿7Ò#v&뿵gê¿Sì¿( ¼`¥Íí¿0Ù¹|´î¿êc« Oï¿ê@ä¹’ï¿í@ä¹’ï¿òc« Oï¿>Ù¹|´î¿< ¼`¥Íí¿Îgê¿Sì¿UÒ#v&ë¿Õüÿ«¨lé¿Õß §,tç¿ÀaÒÝAå¿“[A&Ûâ¿g90<òE࿌8Q>Û¿êä«ÜSÕ¿¹UÌÃο¶ŸÕ.”¿dš©¼ÉÙ¨¿?•©¼ÉÙ¨?QžÕ.”Â?²¹UÌÃÎ?Nä«ÜSÕ?ö7Q>Û?90<òEà?K[A&Ûâ?â¿aÒÝAå?šß §,tç? üÿ«¨lé?+Ò#v&ë?©gê¿Sì? ¼`¥Íí?(Ù¹|´î?æc« Oï?è@ä¹’ï?FÅ^“ìï?7Ù¹|´î?Ú^ÀxYî?fãoæù9í?û9†Œì?×´¢ÞïŸê?’Õz¯îè?B“—÷ÿæ?g‰bŠØä?66߸}â?a ê}¡êß?m‡#4!‹Ú?dŸ30êÔ?mö8]+Î?Ž<¤÷ø7Â?ë0ƒB¨^¨?(/ƒB¨^¨¿<¤÷ø7¿ÿõ8]+ο/Ÿ30êÔ¿9‡#4!‹Ú¿. ê}¡êß¿ê56߸}â¿Q‰bŠØä¿/“—÷ÿæ¿‚Õz¯îè¿È´¢ÞïŸê¿ð9†Œì¿]ãoæù9í¿Ó^ÀxYî¿3Ù¹|´î¿EÅ^“ìï¿HÅ^“ìï¿;Ù¹|´î¿á^ÀxYî¿pãoæù9í¿:†Œì¿å´¢ÞïŸê¿¤Õz¯îè¿U“—÷ÿæ¿z‰bŠØä¿66߸}â¿• ê}¡êß¿˜‡#4!‹Ú¿–Ÿ30êÔ¿Úö8]+ο=¤÷ø7¿p2ƒB¨^¨¿e-ƒB¨^¨?§;¤÷ø7Â?ƒõ8]+Î?þž30êÔ?‡#4!‹Ú?þ ê}¡êß?Ð56߸}â?>‰bŠØä?“—÷ÿæ?pÕz¯îè?¼´¢ÞïŸê?ä9†Œì?Sãoæù9í?Ë^ÀxYî?/Ù¹|´î?CÅ^“ìï?’]ü’Öî?2 ¼`¥Íí?fãoæù9í?£‹Š5@^ì?|0(–<ë?F=€zÅ×é?VK:H>3è?8›5 Sæ?8 l"Ò;ä?š¸< ´òá?Õ€/z®úÞ?fr>“ÃÙ?ì %óLÔ?¶dRÄŒHÍ?j#Ò¯Á?X*dßq§§?¢(dßq§§¿þ"Ò¯Á¿LdRÄŒHÍ¿¹ %óLÔ¿4r>“ÃÙ¿¤€/z®úÞ¿…¸< ´òá¿" l"Ò;ä¿%›5 Sæ¿FK:H>3è¿8=€zÅ×é¿q0(–<ë¿™‹Š5@^ì¿`ãoæù9í¿. ¼`¥Íí¿‘]ü’Öî¿“]ü’Öî¿6 ¼`¥Íí¿mãoæù9í¿¬‹Š5@^쿈0(–<ë¿U=€zÅ×é¿gK:H>3è¿J›5 Sæ¿K l"Ò;ä¿°¸< ´òá¿/z®úÞ¿r>“ÃÙ¿ %óLÔ¿!eRÄŒHÍ¿Þ#Ò¯Á¿Ñ+dßq§§¿ì&dßq§§?Š"Ò¯Á?ÔcRÄŒHÍ?‰ %óLÔ?r>“ÃÙ?t€/z®úÞ?k¸< ´òá? l"Ò;ä?›5 Sæ?5K:H>3è?-=€zÅ×é?f0(–<ë?‹Š5@^ì?Xãoæù9í?+ ¼`¥Íí?]ü’Öî?~¥Y`äì?Ágê¿Sì?û9†Œì?|0(–<ë?’y&ê?ûÆ¿näÏè?ëký5#<ç?LÁUoå?l®Ns7mã?¡“M€p;á?:Ø“[¾Ý?Tk€¼Ø?\úŽ©}Ó?ÖhÝ+ŠÌ?¾2‡DpúÀ?<4aE굦?˜2aE굦¿V2‡DpúÀ¿phÝ+ŠÌ¿,úŽ©}Ó¿$k€¼Ø¿ Ø“[¾Ý¿“M€p;á¿W®Ns7mã¿:ÁUoå¿Ýký5#<ç¿íÆ¿näÏè¿äŽ„’y&ê¿s0(–<ë¿õ9†Œ쿽gê¿Sì¿}¥Y`äì¿¥Y`äì¿Ågê¿Sì¿:†Œì¿…0(–<ë¿ûŽ„’y&ê¿ Ç¿näÏè¿ýký5#<ç¿]ÁUoå¿~®Ns7mã¿¶“M€p;á¿kØ“[¾Ý¿}k€¼Ø¿‹úŽ©}Ó¿=€zÅ×é¿Ñ´¢ÞïŸê¿CÒ#v&뿬¯G jë¿®¯G jë¿JÒ#v&ë¿Ý´¢ÞïŸê¿O=€zÅ×é¿Ç¿näÏè¿ ½N׊ç¿=”{¿ æ¿0±sMVä¿ÇKð²·nâ¿â[S°Yà¿ð½€ñ²8Ü¿Wk‰Qqx׿ÿ­ú[R~Ò¿"Ù(ž6­Ê¿ã’c£À¿oWídŒ¥¿ kWídŒ¥?®‘c£À?ò×(ž6­Ê?x­ú[R~Ò?Öj‰Qqx×?j½€ñ²8Ü?Âá[S°Yà?’Kð²·nâ?ý±sMVä?Ò<”{¿ æ?|½N׊ç?æÆ¿näÏè?5=€zÅ×é?Ê´¢ÞïŸê??Ò#v&ë?ª¯G jë?uÜJó«é?Âüÿ«¨lé?’Õz¯îè?VK:H>3è?ëký5#<ç?ð<”{¿ æ?Çgµ‹¥ä?[ÇuÙ] ã?¢I¾SÆBá?ê-ÆVAŸÞ?ÒV­÷vmÚ?ATfâ„úÕ?4Ò£cQÑ?J…{/ûÈ?ï)¿+¾?1©ÕZ¿-¤?»§ÕZ¿-¤¿_ï)¿+¾¿ï„{/ûÈ¿ Ò£cQÑ¿Tfâ„úÕ¿¨V­÷vmÚ¿Å-ÆVAŸÞ¿I¾SÆBá¿KÇuÙ] 㿺gµ‹¥ä¿ä<”{¿ æ¿âký5#<ç¿MK:H>3迌Õz¯îè¿¿üÿ«¨lé¿tÜJó«é¿wÜJó«é¿Åüÿ«¨l鿘Õz¯îè¿^K:H>3è¿öký5#<ç¿ü<”{¿ æ¿Ögµ‹¥ä¿jÇuÙ] 㿲I¾SÆBá¿.ÆVAŸÞ¿ýV­÷vmÚ¿eTfâ„úÕ¿^Ò£cQÑ¿¥…{/ûÈ¿Þï)¿+¾¿sªÕZ¿-¤¿F¦ÕZ¿-¤?šï)¿+¾?‰„{/ûÈ?àÑ£cQÑ?ìSfâ„úÕ?€V­÷vmÚ?™-ÆVAŸÞ?€I¾SÆBá?;ÇuÙ] ã?«gµ‹¥ä?Û<”{¿ æ?Øký5#<ç?EK:H>3è?†Õz¯îè?¼üÿ«¨lé?sÜJó«é?Œ)Êh®ç?Âß §,tç?B“—÷ÿæ?8›5 Sæ?LÁUoå? ±sMVä?[ÇuÙ] ã?J›Âkz‘á?6%Ñ£Øß?;&rø¢?Ü?iÄ«GaØ?ֽǷhFÔ?&ÒR<ƒóÏ?5Mo Ç?8ºšÅÕ»?jð° Z¢?ï° Z¢¿Ž¹šÅÕ»¿áLo Ç¿ÖÑR<ƒóÏ¿¯½Ç·hFÔ¿CÄ«GaØ¿&rø¢?Ü¿%Ñ£Øß¿<›Âkz‘á¿OÇuÙ] 㿱sMVä¿CÁUoå¿0›5 Sæ¿=“—÷ÿæ¿¿ß §,tç¿‹)Êh®ç¿)Êh®ç¿Åß §,tç¿G“—÷ÿæ¿?›5 Sæ¿VÁUoå¿+±sMVä¿iÇuÙ] ã¿X›Âkz‘á¿T%Ñ£Øß¿]&rø¢?Ü¿‘Ä«GaØ¿ø½Ç·hFÔ¿sÒR<ƒóÏ¿‰Mo ǿﺚÅÕ»¿“ñ° Z¢¿¹í° Z¢?ظšÅÕ»?ƒLo Ç?‹ÑR<ƒóÏ?ˆ½Ç·hFÔ?Ä«GaØ?ñ%rø¢?Ü?ø$Ñ£Øß?-›Âkz‘á?AÇuÙ] ã? ±sMVä?:ÁUoå?)›5 Sæ?7“—÷ÿæ?¼ß §,tç?Š)Êh®ç?Ø,ÄÅÈvå? ÀaÒÝAå?g‰bŠØä?8 l"Ò;ä?l®Ns7mã?¶Kð²·nâ?¢I¾SÆBá?6%Ñ£Øß?ŒÉz( ÝÜ?´»¶”_šÙ??Œ¸”Ö?<ÙnP`Ò?w$^fzõÌ?ù©¤oïâÄ?…Ì9¹?GÜ®$ß ?Û®$ß ¿êÌ9¹¿­©¤oïâÄ¿/$^fzõÌ¿ÙnP`Ò¿Œ¸”Ö¿•»¶”_šÙ¿mÉz( ÝÜ¿%Ñ£Øß¿—I¾SÆBῬKð²·nâ¿d®Ns7mã¿1 l"Ò;ä¿b‰bŠØä¿ÀaÒÝAå¿×,ÄÅÈvå¿Ù,ÄÅÈvå¿ÀaÒÝAå¿l‰bŠØä¿? l"Ò;ä¿t®Ns7mã¿ÀKð²·n⿯I¾SÆBá¿O%Ñ£Øß¿¦Éz( Ýܿӻ¶”_šÙ¿cŒ¸”Ö¿ZÙnP`Ò¿½$^fzõÌ¿Eª¤oïâÄ¿*Ì9¹¿UÝ®$ß ¿×Ù®$ß ?EÌ9¹?W©¤oïâÄ?ê#^fzõÌ?õØnP`Ò?ûŒŒ¸”Ö?q»¶”_šÙ?SÉz( ÝÜ?%Ñ£Øß?‹I¾SÆBá?£Kð²·nâ?\®Ns7mã?+ l"Ò;ä?]‰bŠØä?ÀaÒÝAå?Ö,ÄÅÈvå?VÃ[/ ã?|[A&Ûâ?66߸}â?š¸< ´òá?¡“M€p;á?íá[S°Yà?ê-ÆVAŸÞ?;&rø¢?Ü?´»¶”_šÙ?Ž0•èüµÖ?†ÐyPœ™Ó?¥áó3éLÐ?HŠ/: °É?ßRTñ†Â?Û,R`¶?N§˜ß[î?$¥˜ß[î¿R,R`¶¿ÂÞRTñ†Â¿Š/: °É¿…áó3éLпgÐyPœ™Ó¿s0•èüµÖ¿™»¶”_šÙ¿$&rø¢?Ü¿×-ÆVAŸÞ¿äá[S°Y࿚“M€p;á¿”¸< ´òá¿ü56߸}â¿z[A&Ûâ¿VÃ[/ ã¿XÃ[/ ã¿[A&Ûâ¿66߸}â¿ ¸< ´òá¿©“M€p;á¿öá[S°Yà¿.ÆVAŸÞ¿R&rø¢?̻ܿ¶”_šÙ¿ª0•èüµÖ¿¦ÐyPœ™Ó¿¿áó3éLп†Š/: °É¿HßRTñ†Â¿m,R`¶¿,©˜ß[î¿ú¢˜ß[î?¿,R`¶?uÞRTñ†Â?ˉ/: °É?eáó3éLÐ?IÐyPœ™Ó?S0•èüµÖ?‚»¶”_šÙ? &rø¢?Ü?À-ÆVAŸÞ?Ýá[S°Yà?““M€p;á?ޏ< ´òá?ø56߸}â?x[A&Ûâ?UÃ[/ ã?ûñØêtnà?L90<òEà?a ê}¡êß?Õ€/z®úÞ?:Ø“[¾Ý?½€ñ²8Ü?ÒV­÷vmÚ?iÄ«GaØ??Œ¸”Ö?†ÐyPœ™Ó?ô„ücQêÐ?ÝxEÔ¤"Ì?Ö}ÜUI+Æ?{ÈÁ‹ú¿?XØu­O³?áÁ!‡ÌÔ™?À!‡ÌÔ™¿â×u­O³¿ÈÁ‹ú¿¿Ÿ}ÜUI+Æ¿§xEÔ¤"̿لücQêпnÐyPœ™Ó¿(Œ¸”Ö¿UÄ«GaØ¿ÁV­÷vmÚ¿²½€ñ²8Ü¿-Ø“[¾Ý¿Ê€/z®úÞ¿Y ê}¡êß¿J90<òEà¿ûñØêtnà¿üñØêtnà¿N90<òEà¿h ê}¡ê߿߀/z®úÞ¿GØ“[¾Ý¿Ñ½€ñ²8Ü¿åV­÷vmÚ¿}Ä«GaØ¿TŒ¸”Ö¿ÐyPœ™Ó¿…ücQêп yEÔ¤"Ì¿ ~ÜUI+Æ¿ïÈÁ‹ú¿¿×Øu­O³¿}Ã!‡ÌÔ™¿%¾!‡ÌÔ™?c×u­O³?ƒÇÁ‹ú¿?j}ÜUI+Æ?pxEÔ¤"Ì?¿„ücQêÐ?RÐyPœ™Ó?Œ¸”Ö?@Ä«GaØ?®V­÷vmÚ?¦½€ñ²8Ü?!Ø“[¾Ý?À€/z®úÞ?Q ê}¡êß?H90<òEà?úñØêtnà?ãÏZïŸTÛ?_8Q>Û?m‡#4!‹Ú?fr>“ÃÙ?Tk€¼Ø?1k‰Qqx×?ATfâ„úÕ?ֽǷhFÔ?<ÙnP`Ò?¥áó3éLÐ?ÝxEÔ¤"Ì?vÄíµfÇ?ÒÒ£zÞoÂ?ü‰“]˜º?1Þ¶l°?2úÛ{•?¥øÛ{•¿¶0Þ¶l°¿œ‰“]˜º¿¤Ò£zÞo¿HÄíµfÇ¿±xEÔ¤"Ì¿‘áó3éLп(ÙnP`ҿŽǷhFÔ¿3Tfâ„úÕ¿$k‰Qqx׿Jk€¼Ø¿]r>“ÃÙ¿g‡#4!‹Ú¿\8Q>Û¿âÏZïŸTÛ¿åÏZïŸTÛ¿c8Q>Û¿s‡#4!‹Ú¿nr>“ÃÙ¿`k€¼Ø¿=k‰Qqx׿QTfâ„úÕ¿ç½Ç·hFÔ¿MÙnP`Ò¿¸áó3éLп yEÔ¤"Ì¿œÄíµfÇ¿ÿÒ£zÞo¿]‰“]˜º¿1Þ¶l°¿‰ûÛ{•¿÷Û{•?L0Þ¶l°?.‰“]˜º?xÒ£zÞoÂ?ÄíµfÇ?†xEÔ¤"Ì?záó3éLÐ?ÙnP`Ò?´½Ç·hFÔ?#Tfâ„úÕ?k‰Qqx×?@k€¼Ø?Ur>“ÃÙ?`‡#4!‹Ú?X8Q>Û?àÏZïŸTÛ?J$ÂjôˆÕ?¶ä«ÜSÕ?dŸ30êÔ?ì %óLÔ?\úŽ©}Ó?Ó­ú[R~Ò?4Ò£cQÑ?&ÒR<ƒóÏ?w$^fzõÌ?HŠ/: °É?Ö}ÜUI+Æ?ÒÒ£zÞoÂ?8£«Sþ ½?B ëô´?_ø´ó&O©?ö :yXí?½:yXí¿Ä÷´ó&O©¿ö ëô´¿ð¢«Sþ ½¿¯Ò£zÞo¿³}ÜUI+Æ¿)Š/: °É¿X$^fzõÌ¿ ÒR<ƒóÏ¿)Ò£cQѿȭú[R~Ò¿TúŽ©}Ó¿å %óLÔ¿_Ÿ30êÔ¿´ä«ÜSÕ¿J$ÂjôˆÕ¿L$ÂjôˆÕ¿¹ä«ÜSÕ¿iŸ30êÔ¿ò %óLÔ¿eúŽ©}Ó¿Ý­ú[R~Ò¿AÒ£cQÑ¿@ÒR<ƒóÏ¿’$^fzõÌ¿gŠ/: °É¿ú}ÜUI+Æ¿ñÒ£zÞo¿£«Sþ ½¿Ž ëô´¿ù´ó&O©¿ :yXí¿„:yXí?÷´ó&O©?Ÿ ëô´?«¢«Sþ ½?‹Ò£zÞoÂ?‘}ÜUI+Æ?Š/: °É??$^fzõÌ?ðÑR<ƒóÏ?Ò£cQÑ?À­ú[R~Ò?LúŽ©}Ó?Þ %óLÔ?ZŸ30êÔ?±ä«ÜSÕ?H$ÂjôˆÕ?=r MbÏ? ¹UÌÃÎ?mö8]+Î?¶dRÄŒHÍ?ÖhÝ+ŠÌ?ÁØ(ž6­Ê?J…{/ûÈ?5Mo Ç?ù©¤oïâÄ?ßRTñ†Â?{ÈÁ‹ú¿?ü‰“]˜º?B ëô´?Ûúsh:®?O¿ô¤A¢?ËÛ%&Ïjˆ?Ú%&Ïjˆ¿ß¾ô¤A¢¿músh:®¿  ëô´¿É‰“]˜º¿IÈÁ‹ú¿¿ïÞRTñ†Â¿â©¤oïâÄ¿"Mo Ç¿;…{/ûÈ¿²Ø(ž6­Ê¿ËhÝ+ŠÌ¿­dRÄŒHÍ¿fö8]+οœ¹UÌÃοŸÕ.”¿’<¤÷ø7¿p#Ò¯Á¿Æ2‡DpúÀ¿ƒ’c£À¿.ï)¿+¾¿OºšÅÕ»¿œÌ9¹¿ö,R`¶¿xØu­O³¿21Þ¶l°¿œø´ó&O©¿‘¿ô¤A¢¿k#“ê –¿¤ röt}}¿‰röt}}?Ä!“ê –?Á¾ô¤A¢?ã÷´ó&O©?Ú0Þ¶l°?Øu­O³? ,R`¶?TÌ9¹? ºšÅÕ»?ïï)¿+¾?j’c£À?°2‡DpúÀ?^#Ò¯Á?…<¤÷ø7Â?7ŸÕ.”Â?E@?ÍEÂÂ?µ)¼¦©?ט©¼ÉÙ¨?ë0ƒB¨^¨?X*dßq§§?<4aE굦?'nWídŒ¥?1©ÕZ¿-¤?jð° Z¢?GÜ®$ß ?N§˜ß[î?áÁ!‡ÌÔ™?2úÛ{•?ö :yXí?ËÛ%&Ïjˆ?Íröt}}?ªnm.¹c?=mm.¹c¿röt}}¿rÛ%&Ïjˆ¿Ì :yXí¿ úÛ{•¿¸Á!‡ÌÔ™¿*§˜ß[î¿5Ü®$ß ¿Zð° Z¢¿$©ÕZ¿-¤¿nWídŒ¥¿24aE굦¿P*dßq§§¿å0ƒB¨^¨¿Ô˜©¼ÉÙ¨¿µ)¼¦©¿µ)¼¦©¿Ú˜©¼ÉÙ¨¿ð0ƒB¨^¨¿`*dßq§§¿F4aE굦¿3nWídŒ¥¿@©ÕZ¿-¤¿yð° Z¢¿WÜ®$ß ¿r§˜ß[î¿ Â!‡ÌÔ™¿VúÛ{•¿ :yXí¿#Ü%&Ïjˆ¿Žröt}}¿åom.¹c¿Ðkm.¹c?Wröt}}? Û%&Ïjˆ?¤ :yXí?ßùÛ{•?‘Á!‡ÌÔ™?§˜ß[î?&Ü®$ß ?Jð° Z¢?©ÕZ¿-¤?nWídŒ¥?)4aE굦?H*dßq§§?ß0ƒB¨^¨?ј©¼ÉÙ¨?µ)¼¦©?ÆÄ}SÈ©¿’¿ÃÝôÕ¨¿X†¥_æZ¨¿ Á<Ì£§¿ØxKßi²¦¿‰9f‰¥¿Ü¬>ä¢*¤¿ öêP{š¢¿v¢$9vÜ ¿:L‡z¾é¿NàµôÐЙ¿‰Þí=x•¿¡©òY¼ê¿'Þ£c gˆ¿Pجùèx}¿tÃÏ™#¶c¿ÂÏ™#¶c?œ×¬ùèx}?ÎÝ£c gˆ?v©òY¼ê?`Þí=x•?'àµôÐЙ?L‡z¾é?e¢$9vÜ ?öêP{š¢?Ϭ>ä¢*¤?~9f‰¥?ÍxKßi²¦?Á<Ì£§?R†¥_æZ¨?Ž¿ÃÝôÕ¨?ÄÄ}SÈ©?ÇÄ}SÈ©?•¿ÃÝôÕ¨?^†¥_æZ¨?Á<Ì£§?áxKßi²¦?”9f‰¥?ê¬>ä¢*¤?/öêP{š¢?‡¢$9vÜ ?^L‡z¾é?xàµôÐЙ?³Þí=x•?Ê©òY¼ê?‚Þ£c gˆ?Ù¬ùèx}?¼ÄÏ™#¶c?¨ÀÏ™#¶c¿àÖ¬ùèx}¿mÝ£c gˆ¿O©òY¼ê¿7Þí=x•¿þßµôÐЙ¿ñK‡z¾é¿U¢$9vÜ ¿öêP{š¢¿À¬>ä¢*¤¿r9f‰¥¿ÄxKßi²¦¿üÀ<Ì£§¿L†¥_æZ¨¿Œ¿ÃÝôÕ¨¿ÄÄ}SÈ©¿ºÒ/aa¿Â¿Ã9ä(‘¿-[Þ)5¿{ð¼G¬Á¿CÝv Ò÷À¿2؅ʇÀ¿ünÛM'¾¿e#'7Êл¿ôŸ©cè5¹¿æœaøÞ\¶¿<W³L³¿ÚêÎò °¿:¼cü?K©¿Ôç%>>¢¿wc„–¿¼Ù¬ùèx}¿œ×¬ùèx}?–wc„–?’ç%>>¢?ú»cü?K©?bÚêÎò °?W³L³?ËœaøÞ\¶?ÛŸ©cè5¹?M#'7Êл?çnÛM'¾?*؅ʇÀ?<Ýv Ò÷À?uð¼G¬Á?)[Þ)5Â?Ã9ä(‘Â?ºÒ/aa¿Â?¼Ò/aa¿Â? Ã9ä(‘Â?2[Þ)5Â?ð¼G¬Á?JÝv Ò÷À?;؅ʇÀ?oÛM'¾?{#'7Êл? ©cè5¹?aøÞ\¶?[W³L³? ÚêÎò °?x¼cü?K©?è%>>¢?³wc„–?¦Û¬ùèx}?ŒÕ¬ùèx}¿ wc„–¿Jç%>>¢¿À»cü?K©¿CÚêÎò °¿ÿW³L³¿°œaøÞ\¶¿ÄŸ©cè5¹¿6#'7Êл¿ÒnÛM'¾¿!؅ʇÀ¿5Ýv Ò÷À¿pð¼G¬Á¿%[Þ)5¿Ã9ä(‘¿¹Ò/aa¿Â¿¨$Š0˜ Ï¿å¿Î¿R k¶&ο./ÑïDÍ¿xêoq4Ì¿`FÁ­©Ê¿¬¾ -D÷È¿ðɇ„áÇ¿ˆ7{ ·ßÄ¿è „¿UÿŠõ¿¿¶)ÚC”º¿$úÊbñ´¿¿S6U¿5®¿è%>>¢¿‘ߣc gˆ¿ÎÝ£c gˆ?’ç%>>¢?RS6U¿5®?Í#úÊbñ´?ƒ)ÚC”º?$ÿŠõ¿?ùç „Â?s7{ ·ßÄ?Ýɇ„áÇ?œ¾ -D÷È?QFÁ­©Ê?lêoq4Ì?$/ÑïDÍ?þQ k¶&Î?å¿Î?¦$Š0˜ Ï?¨$Š0˜ Ï?å¿Î? R k¶&Î?7/ÑïDÍ?ƒêoq4Ì?nFÁ­©Ê?¾¾ -D÷È?ʇ„áÇ?7{ ·ßÄ?'è „Â?ŠÿŠõ¿?é)ÚC”º?6$úÊbñ´?0T6U¿5®?}è%>>¢?&á£c gˆ?Ü£c gˆ¿ç%>>¢¿ØR6U¿5®¿œ#úÊbñ´¿P)ÚC”º¿ðþŠõ¿¿ãç „¿`7{ ·ßÄ¿Êɇ„áÇ¿‰¾ -D÷È¿BFÁ­©Ê¿aêoq4Ì¿/ÑïDÍ¿öQ k¶&οüä¿Î¿¥$Š0˜ Ï¿zºk¢…Õ¿ÇÙ®Û’PÕ¿ ÈŒöæÔ¿&àÞÑIÔ¿&Ì>¨zÓ¿zèùix{Ò¿j¬­…·NÑ¿„dñ–îÏ¿â¾`ñÌ¿¾èYR¬É¿P{„OÞ'Æ¿l$Ãm¿yuj†ƒ ½¿$úÊbñ´¿•¼cü?K©¿¯ªòY¼ê¿v©òY¼ê?ù»cü?K©?Í#úÊbñ´?0uj†ƒ ½?H$ÃmÂ?.{„OÞ'Æ? èYR¬É?êá¾`ñÌ?jdñ–îÏ?^¬­…·NÑ?pèùix{Ò?Ì>¨zÓ?ú%àÞÑIÔ?þÈŒöæÔ?ÄÙ®Û’PÕ?yºk¢…Õ?zºk¢…Õ?ÊÙ®Û’PÕ? ÈŒöæÔ?&àÞÑIÔ?.Ì>¨zÓ?„èùix{Ò?u¬­…·NÑ?ždñ–îÏ?$â¾`ñÌ?àèYR¬É?s{„OÞ'Æ?$ÃmÂ?Àuj†ƒ ½?h$úÊbñ´?@½cü?K©?È«òY¼ê?H¨òY¼ê¿Z»cü?K©¿z#úÊbñ´¿ìtj†ƒ ½¿%$Ãm¿ {„OÞ'Æ¿èYR¬É¿Ðá¾`ñÌ¿Ndñ–îÏ¿Q¬­…·NÑ¿fèùix{Ò¿Ì>¨zÓ¿ó%àÞÑIÔ¿úÈŒöæÔ¿ÂÙ®Û’PÕ¿xºk¢…Õ¿íâ#/iPÛ¿ú1uô Û¿ÆV… ‡Ú¿’=mSš¿Ù¿@"°¸Ø¿`ÕZíÒt׿f»í`!÷Õ¿v8ÉsHCÔ¿Þ è±z]Ò¿£ºÑeJп„aPNÌ¿2!¹%~bÇ¿w$Ãm¿å)ÚC”º¿ÄÚêÎò °¿íßí=x•¿`Þí=x•?bÚêÎò °?ƒ)ÚC”º?H$ÃmÂ?!¹%~bÇ?XaPNÌ?ºÑeJÐ?Ì è±z]Ò?e8ÉsHCÔ?W»í`!÷Õ?TÕZíÒt×?6"°¸Ø?Š=mSš¿Ù?ÂV… ‡Ú?ö1uô Û?íâ#/iPÛ?ïâ#/iPÛ?þ1uô Û?ÎV… ‡Ú?›=mSš¿Ù?K"°¸Ø?mÕZíÒt×?u»í`!÷Õ?‡8ÉsHCÔ?ò è±z]Ò?¸ºÑeJÐ?±aPNÌ?_!¹%~bÇ?¥$ÃmÂ?H*ÚC”º?2ÛêÎò °?Ráí=x•?àÜí=x•¿üÙêÎò °¿)ÚC”º¿$ÃmÂ¿Ø ¹%~bÇ¿+aPNÌ¿|ºÑeJп» è±z]Ò¿T8ÉsHCÔ¿H»í`!÷Õ¿FÕZíÒt׿,"°¸Ø¿=mSš¿Ù¿»V… ‡Ú¿ô1uô Û¿ìâ#/iPÛ¿¸|ï[ìkà¿ö¯>ìoC࿊f»µåß¿JJ¶çõÞ¿ÍF:Źݿ,ìY4Ü¿lavÛciÚ¿]Q]Ø¿‚…”,Ö¿?Ýë°––Ó¿• 6¼µçпŽaPNÌ¿e{„OÞ'Æ¿™ÿŠõ¿¿”W³L³¿âµôÐЙ¿'àµôÐЙ?W³L³?$ÿŠõ¿?.{„OÞ'Æ?XaPNÌ?{ 6¼µçÐ?(Ýë°––Ó?þ…”,Ö?î]Q]Ø?ZavÛciÚ?ìY4Ü?¿F:ŹÝ?úIJ¶çõÞ?‚f»µåß?ô¯>ìoCà?¶|ï[ìkà?¸|ï[ìkà?ø¯>ìoCà?’f»µåß?JJ¶çõÞ?ØF:ŹÝ?:ìY4Ü?~avÛciÚ?]Q]Ø?,‚…”,Ö?XÝë°––Ó?° 6¼µçÐ?ÄaPNÌ?œ{„OÞ'Æ?Šõ¿?W³L³?°ãµôÐЙ?ZÞµôÐЙ¿¤W³L³¿¦þŠõ¿¿ûz„OÞ'Æ¿"aPNÌ¿` 6¼µçпÝë°––Ó¿ê…”,Ö¿Ú]Q]Ø¿GavÛciÚ¿ ìY4Ü¿³F:ŹݿðIJ¶çõÞ¿zf»µåß¿ZÔjÏBà¿–fõJJkà¿6;œ°'ã¿þB?>Øâ¿•©ßßzâ¿á·ó4ðïá¿xŸVÈ8á¿ké*ø*Wà¿ÆD…«ˆšÞ¿ «2üG;Ü¿aæ`m–Ù¿ÕŸ|²Ö¿EÝë°––Ó¿¯ºÑeJпáèYR¬É¿>è „¿TaøÞ\¶¿>N‡z¾é¿L‡z¾é?ËœaøÞ\¶?úç „Â? èYR¬É?ºÑeJÐ?'Ýë°––Ó?éÔŸ|²Ö?Hæ`m–Ù?óª2üG;Ü?±D…«ˆšÞ?bé*ø*Wà?pŸVÈ8á?Û·ó4ðïá?©ßßzâ?ûB?>Øâ?6;œ°'ã?7;œ°'ã?B?>Øâ?š©ßßzâ?ç·ó4ðïá?ŸVÈ8á?té*ø*Wà?ÛD…«ˆšÞ?!«2üG;Ü?|æ`m–Ù?"ÕŸ|²Ö?eÝë°––Ó?κÑeJÐ? éYR¬É?ƒè „Â?ìaøÞ\¶?/P‡z¾é?ÿI‡z¾é¿=œaøÞ\¶¿°ç „¿fèYR¬É¿pºÑeJпÝë°––Ó¿ÎÔŸ|²Ö¿1æ`m–Ù¿Ûª2üG;Ü¿›D…«ˆšÞ¿Zé*ø*Wà¿iŸVÈ8á¿Õ·ó4ðïῌ©ßßzâ¿ ÞFD„×â¿o‚¦ækã¿}Õî“yså¿Ô4=É–>忚›¨–SÕä¿ “Y€³8ä¿æ}¬8jã¿ÆºÖ(àkâ¿:‰@á¿(‰ª¤Óß¿úýLç—ØÜ¿gæ`m–Ù¿ ‚…”,Ö¿ð è±z]Ò¿4â¾`ñÌ¿¿7{ ·ßÄ¿u ©cè5¹¿£$9vÜ ¿e¢$9vÜ ?ÛŸ©cè5¹?s7{ ·ßÄ?êá¾`ñÌ?Ì è±z]Ò?þ…”,Ö?Hæ`m–Ù?ÞýLç—ØÜ? ‰ª¤Óß?.‰@á?¼ºÖ(àkâ?Þ}¬8jã?“Y€³8ä?–›¨–SÕä?Ò4=É–>å?|Õî“yså?~Õî“yså?×4=É–>å?Ÿ›¨–SÕä?“Y€³8ä?ï}¬8jã?ϺÖ(àkâ?G‰@á?@‰ª¤Óß?þLç—ØÜ?ˆæ`m–Ù?D‚…”,Ö? è±z]Ò?{â¾`ñÌ? 8{ ·ßÄ? ¡©cè5¹?´¤$9vÜ ?7¡$9vÜ ¿;Ÿ©cè5¹¿ 7{ ·ßÄ¿¨á¾`ñÌ¿© è±z]Ò¿Ü…”,Ö¿*æ`m–Ù¿ÂýLç—ØÜ¿ò‰ª¤Óß¿"‰@ῲºÖ(àkâ¿Ö}¬8jã¿ü’Y€³8ä¿›¨–SÕä¿é(6Å=å¿èù÷ߥrå¿Ϭèªç¿ZUëŽpç¿J·Dküæ¿ a¶ œOæ¿X?‘RËkå¿¶¢_¼*Sä¿ö£X(nã¿´7þÄŽá¿+‰ª¤Óß¿«2üG;Ü¿]Q]Ø¿Œ8ÉsHCÔ¿»dñ–îÏ¿1ʇ„áÇ¿ø#'7Êл¿h÷êP{š¢¿öêP{š¢?M#'7Êл?Ýɇ„áÇ?jdñ–îÏ?e8ÉsHCÔ?î]Q]Ø?óª2üG;Ü? ‰ª¤Óß?¤7þÄŽá?é£X(nã?¬¢_¼*Sä?N?‘RËkå?˜a¶ œOæ?F·Dküæ?ZUëŽpç?Ϭèªç?Ϭèªç?ZUëŽpç?P·Dküæ?§a¶ œOæ?b?‘RËkå?¢_¼*Sä?¤X(nã?Â7þÄŽá?M‰ª¤Óß?8«2üG;Ü?;]Q]Ø?³8ÉsHCÔ? eñ–îÏ?ˆÊ‡„áÇ?´$'7Êл?øêP{š¢?ÄôêP{š¢¿ž"'7Êл¿É‡„áÇ¿ dñ–îÏ¿>8ÉsHCÔ¿Ç]Q]ؿЪ2üG;ܿ¤Óß¿–7þÄŽá¿Ü£X(nã¿ ¢_¼*Sä¿F?‘RËkå¿’a¶ œOæ¿@·Dküæ¿Ê+—§oç¿d ‡ÿ©ç¿¸Söþ§é¿’¸ (½hé¿ cb×ê还Êîƒ/è¿p†Ž8翈(RYæ¿.Ìì±Ò¡ä¿ù£X(nã¿A‰@á¿ÖD…«ˆšÞ¿‚avÛciÚ¿»í`!÷Õ¿Š¬­…·NÑ¿÷¾ -D÷È¿ oÛM'¾¿E®>ä¢*¤¿Î¬>ä¢*¤?çnÛM'¾?œ¾ -D÷È?]¬­…·NÑ?W»í`!÷Õ?ZavÛciÚ?±D…«ˆšÞ?.‰@á?é£X(nã? Ìì±Ò¡ä?|(RYæ?f†Ž8ç?Êîƒ/è? cb×êè?ޏ (½hé?·Söþ§é?¹Söþ§é?•¸ (½hé?% cb×êè? Êîƒ/è?z†Ž8ç?”(RYæ?<Ìì±Ò¡ä?¤X(nã?R‰@á?ýD…«ˆšÞ?­avÛciÚ?¬»í`!÷Õ?´¬­…·NÑ?U¿ -D÷È?mpÛM'¾?’¯>ä¢*¤?f«>ä¢*¤¿(nÛM'¾¿8¾ -D÷È¿6¬­…·NÑ¿-»í`!÷Õ¿.avÛciÚ¿ŒD…«ˆšÞ¿‰@á¿Ù£X(nã¿Ìì±Ò¡ä¿p(RYæ¿\†Ž8翈Êîƒ/è¿ cb×êè¿V¢dÂgé¿K&»Ï§é¿/=pÒeë¿¿{F"ë¿àdAúÔ›ê¿ïDÁrÉÓé¿Ê³pÌè¿é¯¡6‡ç¿Œ(RY濼¢_¼*Sä¿ÎºÖ(àkâ¿vé*ø*Wà¿FìY4Ü¿ÕZíÒt׿Ÿèùix{Ò¿³FÁ­©Ê¿ŒØ…ʇÀ¿ ;f‰¥¿~9f‰¥?*؅ʇÀ?QFÁ­©Ê?pèùix{Ò?TÕZíÒt×?ìY4Ü?bé*ø*Wà?¼ºÖ(àkâ?¬¢_¼*Sä?|(RYæ?ܯ¡6‡ç?¾³pÌè?æDÁrÉÓé?ÙdAúÔ›ê?»{F"ë?-=pÒeë?0=pÒeë?Â{F"ë?ædAúÔ›ê?øDÁrÉÓé?Ó³pÌè?õ¯¡6‡ç?š(RYæ?Ì¢_¼*Sä?áºÖ(àkâ?‹é*ø*Wà?tìY4Ü?­ÕZíÒt×?Íèùix{Ò?GÁ­©Ê?ù؅ʇÀ?qb‹8 ì¿NÃùb8ë¿hnNhq"ê¿Ì³pÌè¿v†Ž8ç¿a?‘RËkå¿ò}¬8jã¿…ŸVÈ8á¿ìF:Źݿd"°¸Ø¿NÌ>¨zÓ¿Òêoq4Ì¿¤Ýv Ò÷À¿qzKßi²¦¿ÍxKßi²¦?<Ýv Ò÷À?lêoq4Ì?Ì>¨zÓ?4"°¸Ø?¿F:ŹÝ?pŸVÈ8á?Þ}¬8jã?N?‘RËkå?f†Ž8ç?¾³pÌè?\nNhq"ê?NÃùb8ë?ˆ>b‹8 ì?xé§Qê˜ì?2~öàì?6~öàì?€é§Qê˜ì?”>b‹8 ì?NÃùb8ë?rnNhq"ê?Ù³pÌè?††Ž8ç?r?‘RËkå?~¬8jã?›ŸVÈ8á?G:ŹÝ?”"°¸Ø?~Ì>¨zÓ?;ëoq4Ì?Þv Ò÷À?ê{Kßi²¦?8wKßi²¦¿ÐÜv Ò÷À¿üéoq4Ì¿ðË>¨zÓ¿"°¸Ø¿F:ŹݿşÝ_8ῆyYyiã¿Ô“gê÷jå¿…!žò¨7ç¿„­\Ëè¿,m˜{o!꿎ûþUV7ë¿æãÞÆ# 쿘¹¾Зì¿BÔÿüýÞì¿‚¯µÈ2î¿(Ü Éí¿¬Ò)Qx5í¿hï€àYì¿NÃùb8ë¿ôDÁrÉÓé¿¡Êîƒ/迬a¶ œOæ¿“Y€³8ä¿ñ·ó4ðïá¿*JJ¶çõÞ¿¼=mSš¿Ù¿.&àÞÑIÔ¿/ÑïDÍ¿âð¼G¬Á¿¹Â<Ì£§¿Á<Ì£§?uð¼G¬Á?$/ÑïDÍ?ú%àÞÑIÔ?Š=mSš¿Ù?úIJ¶çõÞ?Û·ó4ðïá?“Y€³8ä?˜a¶ œOæ?Êîƒ/è?æDÁrÉÓé?NÃùb8ë?ügï€àYì?¥Ò)Qx5í?ÿ'Ü Éí?€¯µÈ2î?ƒ¯µÈ2î?(Ü Éí?³Ò)Qx5í?hï€àYì?NÃùb8ë?EÁrÉÓé?±Êîƒ/è?½a¶ œOæ?,“Y€³8ä?¸ó4ðïá?\JJ¶çõÞ?ì=mSš¿Ù?_&àÞÑIÔ?ý/ÑïDÍ?Yñ¼G¬Á?BÄ<Ì£§?^¿<Ì£§¿ð¼G¬Á¿°.ÑïDÍ¿Ë%àÞÑIÔ¿X=mSš¿Ù¿ÊIJ¶çõÞ¿†Íœ.?ïá¿vìîë7ä¿à7Ý¿Næ¿(¼9f”.è¿`=OŽÊÒ鿊ûþUV7ë¿®(´ÈXì¿y2 X4í¿àåfçÇí¿že{ø î¿QÔÙ$ü˜7ÈÀ¯î¿}Qiü´Ò)Qx5í¿”>b‹8 ì¿èdAúÔ›ê¿+ cb×êè¿Y·Dkü濪›¨–SÕ俦©ßßzâ¿´f»µåß¿ôV… ‡Ú¿3 ÈŒöæÔ¿lR k¶&ο™[Þ)5¿ˆ¥_æZ¨¿R†¥_æZ¨?)[Þ)5Â?üQ k¶&Î?þÈŒöæÔ?ÂV… ‡Ú?‚f»µåß?©ßßzâ?–›¨–SÕä?E·Dküæ? cb×êè?ÚdAúÔ›ê?ˆ>b‹8 ì?¥Ò)Qx5í?vQiü´î?®˜7ÈÀ¯î?PÔÙ$üî?SÔÙ$üî?¶˜7ÈÀ¯î?„Qiü´î?¹Ò)Qx5í? >b‹8 ì?ödAúÔ›ê?< cb×êè?k·Dküæ?À›¨–SÕä?¾©ßßzâ?çf»µåß?'W… ‡Ú?f ÈŒöæÔ?ÜR k¶&Î?[Þ)5Â?©‰¥_æZ¨?Ÿ„¥_æZ¨¿¶[Þ)5¿…Q k¶&οÎÈŒöæÔ¿V… ‡Ú¿Nf»µåß¿‚d£(zâ¿Üczû…Ôä¿Ì*¾jˆû濼+èxáé迤3‹_Κê¿àãÞÆ# ì¿w2 X4í¿¨°ÿ‹î¿€-ïî‘®î¿Bwâ óú•ز˜ï¿Éý ÎÌJï¿´˜7ÈÀ¯î¿ (Ü Éí¿„é§Qê˜ì¿Ê{F"뿟¸ (½hé¿*ZUëŽpç¿ç4=É–>å¿B?>Øâ¿ °>ìoCà¿*2uô Û¿úÙ®Û’PÕ¿på¿Î¿Ã9ä(‘¿ZÁÃÝôÕ¨¿Ž¿ÃÝôÕ¨?Ã9ä(‘Â?å¿Î?ÄÙ®Û’PÕ?ö1uô Û?ô¯>ìoCà?ûB?>Øâ?Ñ4=É–>å?ZUëŽpç?ޏ (½hé?»{F"ë?xé§Qê˜ì?ÿ'Ü Éí?®˜7ÈÀ¯î?Åý ÎÌJï?½•ز˜ï?‚½•ز˜ï?Íý ÎÌJï?¼˜7ÈÀ¯î?(Ü Éí?é§Qê˜ì?Ø{F"ë?°¸ (½hé?=ZUëŽpç?ý4=É–>å?)B?>Øâ?'°>ìoCà?_2uô Û?/Ú®Û’PÕ?âå¿Î? Ä9ä(‘Â?öÂÃÝôÕ¨?Ò½ÃÝôÕ¨¿¦Â9ä(‘¿…ä¿Î¿’Ù®Û’PÕ¿Â1uô Û¿Ú¯>ìoCà¿÷ÝFD„×â¿Ô(6Å=忺+—§oç¿I¢dÂgé¿=Òw±:!뿎¹¾Зì¿ÛåfçÇí¿~-ïî‘®î¿ §+û—Iï¿*?V{—ï¿úæ"ÎZçï¿„½•ز˜ï¿WÔÙ$ü¯µÈ2î¿?~öàì¿==pÒeë¿ÉSöþ§é¿.Ϭèªç¿’Õî“yså¿L;œ°'ã¿Ð|ï[ìkà¿ ã#/iPÛ¿®ºk¢…Õ¿%Š0˜ Ï¿-Ó/aa¿Â¿–Æ}SÈ©¿ÄÄ}SÈ©?ºÒ/aa¿Â?¦$Š0˜ Ï?xºk¢…Õ?ìâ#/iPÛ?·|ï[ìkà?6;œ°'ã?|Õî“yså?Ϭèªç?·Söþ§é?.=pÒeë?2~öàì?€¯µÈ2î?PÔÙ$üî?½•ز˜ï?øæ"ÎZçï?üæ"ÎZçï?‰½•ز˜ï?^ÔÙ$üî?”¯µÈ2î?L~öàì?J=pÒeë?ÛSöþ§é?BϬèªç?§Õî“yså?d;œ°'ã?ê|ï[ìkà?Uã#/iPÛ?äºk¢…Õ?Œ%Š0˜ Ï?«Ó/aa¿Â?5È}SÈ©?Ã}SÈ©¿CÒ/aa¿Â¿*$Š0˜ Ï¿Gºk¢…Õ¿¸â#/iPÛ¿œ|ï[ìkà¿Y‚¦ækã¿Òù÷ߥrå¿R ‡ÿ©ç¿=&»Ï§é¿2(CÄdë¿6ÔÿüýÞì¿—e{ø î¿å¿B?>Øâ¿°>ìoCà¿22uô Û¿Ú®Û’PÕ¿xå¿Î¿“Ã9ä(‘¿aÁÃÝôÕ¨¿•¿ÃÝôÕ¨? Ã9ä(‘Â?å¿Î?ÊÙ®Û’PÕ?þ1uô Û?ø¯>ìoCà?B?>Øâ?×4=É–>å?ZUëŽpç?•¸ (½hé?Ã{F"ë?€é§Qê˜ì?(Ü Éí?¶˜7ÈÀ¯î?Íý ÎÌJï?‰½•ز˜ï?‹½•ز˜ï?Öý ÎÌJï?Ę7ÈÀ¯î?(Ü Éí?™é§Qê˜ì?ß{F"ë?·¸ (½hé?DZUëŽpç?5=É–>å?/B?>Øâ?+°>ìoCà?f2uô Û?4Ú®Û’PÕ?ìå¿Î?Ä9ä(‘Â?þÂÃÝôÕ¨?Ú½ÃÝôÕ¨¿¬Â9ä(‘¿Žä¿Î¿™Ù®Û’PÕ¿Ë1uô Û¿Þ¯>ìoCà¿üÝFD„×â¿Ú(6Å=å¿À+—§oç¿P¢dÂgé¿EÒw±:!ë¿”¹¾Зì¿äåfçÇí¿†-ï+û—Iï¿2?V{—ï¿Twâ óúî¿•-ïQiü´Ò)Qx5í¿ >b‹8 ì¿õdAúÔ›ê¿6 cb×êè¿d·Dküæ¿´›¨–SÕ俯©ßßzâ¿Âf»µåß¿W… ‡Ú¿< ÈŒöæÔ¿yR k¶&ο¢[Þ)5¿ ˆ¥_æZ¨¿^†¥_æZ¨?2[Þ)5Â? R k¶&Î? ÈŒöæÔ?ÍV… ‡Ú?‘f»µåß?™©ßßzâ?Ÿ›¨–SÕä?P·Dküæ?& cb×êè?ædAúÔ›ê?”>b‹8 ì?³Ò)Qx5í?‚Qiü´î?¼˜7ÈÀ¯î?^ÔÙ$üî?aÔÙ$üî?Ę7ÈÀ¯î?’Qiü´î?ÆÒ)Qx5í?¬>b‹8 ì?eAúÔ›ê?G cb×êè?v·Dküæ?Ê›¨–SÕä?Æ©ßßzâ?öf»µåß?3W… ‡Ú?p ÈŒöæÔ?êR k¶&Î?[Þ)5Â?µ‰¥_æZ¨?ª„¥_æZ¨¿¿[Þ)5¿’Q k¶&οØÈŒöæÔ¿šV… ‡Ú¿^f»µåß¿Šd£(zâ¿æczû…Ôä¿Ö*¾jˆûæ¿È+èxáéè¿°3‹_Κê¿ìãÞÆ# ì¿„2 X4í¿¶°ÿ‹-ïî‘®î¿Pwâ óúî¿´e{ø î¿üåfçÇí¿ÀÒ)Qx5í¿hï€àYì¿&NÃùb8ë¿EÁrÉÓé¿°Êîƒ/迺a¶ œOæ¿%“Y€³8ä¿ü·ó4ðïá¿?JJ¶çõÞ¿Í=mSš¿Ù¿;&àÞÑIÔ¿£/ÑïDÍ¿îð¼G¬Á¿ÈÂ<Ì£§¿Á<Ì£§?ð¼G¬Á?7/ÑïDÍ?&àÞÑIÔ?›=mSš¿Ù?JJ¶çõÞ?ç·ó4ðïá?“Y€³8ä?§a¶ œOæ? Êîƒ/è?øDÁrÉÓé?NÃùb8ë?hï€àYì?¹Ò)Qx5í?(Ü Éí?”¯µÈ2î?—¯µÈ2î?(Ü Éí?ÇÒ)Qx5í?"hï€àYì?0NÃùb8ë?EÁrÉÓé?ÁÊîƒ/è?Ía¶ œOæ?:“Y€³8ä?¸ó4ðïá?qJJ¶çõÞ?þ=mSš¿Ù?m&àÞÑIÔ?0ÑïDÍ?eñ¼G¬Á?RÄ<Ì£§?n¿<Ì£§¿ð¼G¬Á¿Ä.ÑïDÍ¿Ù%àÞÑIÔ¿j=mSš¿Ù¿ÞIJ¶çõÞ¿‘Íœ.?ïῃìîë7ä¿î7Ý¿Næ¿9¼9f”.è¿p=OŽÊÒ鿜ûþUV7ë¿À(´ÈX쿌2 X4í¿ôåfçÇí¿±e{ø î¿]ÔÿüýÞì¿·¹¾З쿦>b‹8 ì¿'NÃùb8ë¿~nNhq"ê¿á³pÌ迊†Ž8ç¿t?‘RËkå¿~¬8jã¿”ŸVÈ8á¿G:Źݿy"°¸Ø¿_Ì>¨zÓ¿ëêoq4Ì¿³Ýv Ò÷À¿…zKßi²¦¿àxKßi²¦?JÝv Ò÷À?ƒêoq4Ì?.Ì>¨zÓ?J"°¸Ø?ØF:ŹÝ?€ŸVÈ8á?ï}¬8jã?b?‘RËkå?z†Ž8ç?Ó³pÌè?rnNhq"ê?NÃùb8ë? >b‹8 ì?é§Qê˜ì?L~öàì?N~öàì?™é§Qê˜ì?­>b‹8 ì?0NÃùb8ë?‰nNhq"ê?î³pÌè?š†Ž8ç?„?‘RËkå?~¬8jã?©ŸVÈ8á?7G:ŹÝ?ª"°¸Ø?Ì>¨zÓ?Tëoq4Ì?&Þv Ò÷À?ý{Kßi²¦?LwKßi²¦¿àÜv Ò÷À¿êoq4Ì¿Ì>¨zÓ¿"°¸Ø¿¨F:ŹݿԟÝ_8á¿—yYyiã¿æ“gê÷j忘!žò¨7ç¿$„­\Ëè¿Bm˜{o!꿦ûþUV7ë¿þãÞÆ# ì¿°¹¾Зì¿[ÔÿüýÞì¿`(CÄdë¿mÒw±:!ë¿ýdAúÔ›ê¿ EÁrÉÓé¿ä³pÌè¿°¡6‡ç¿£(RYæ¿Ò¢_¼*Sä¿âºÖ(àk⿇é*ø*Wà¿eìY4Ü¿šÕZíÒt׿²èùix{Ò¿ÏFÁ­©Ê¿žØ…ʇÀ¿#;f‰¥¿”9f‰¥?;؅ʇÀ?nFÁ­©Ê?„èùix{Ò?mÕZíÒt×?:ìY4Ü?té*ø*Wà?кÖ(àkâ?¢_¼*Sä?”(RYæ?õ¯¡6‡ç?Ù³pÌè?EÁrÉÓé?ödAúÔ›ê?Ø{F"ë?J=pÒeë?M=pÒeë?ß{F"ë?eAúÔ›ê?EÁrÉÓé?î³pÌè?°¡6‡ç?²(RYæ?â¢_¼*Sä?õºÖ(àkâ?œé*ø*Wà?“ìY4Ü?ÇÕZíÒt×?àèùix{Ò?2GÁ­©Ê? مʇÀ?‰ä¢*¤¿ê¬>ä¢*¤?oÛM'¾?¾¾ -D÷È?v¬­…·NÑ?v»í`!÷Õ?~avÛciÚ?ÚD…«ˆšÞ?F‰@á?¤X(nã?=Ìì±Ò¡ä?›(RYæ?„†Ž8ç?±Êîƒ/è?< cb×êè?°¸ (½hé?ÚSöþ§é?ÝSöþ§é?·¸ (½hé?G cb×êè?ÀÊîƒ/è?š†Ž8ç?²(RYæ?XÌì±Ò¡ä?"¤X(nã?j‰@á?&E…«ˆšÞ?ÒavÛciÚ?Ê»í`!÷Õ?̬­…·NÑ?x¿ -D÷È?–pÛM'¾?®¯>ä¢*¤?‚«>ä¢*¤¿RnÛM'¾¿[¾ -D÷È¿N¬­…·NÑ¿K»í`!÷Õ¿RavÛciÚ¿ºô¦£Z™Þ¿øPnÉr?á¿"ùÌQ²ã¿» ¡ä¿Û[Ûàæ¿§!žò¨7ç¿Q¼9f”.è¿è+èxáéè¿x¢dÂgé¿m&»Ï§é¿Ž ‡ÿ©ç¿÷+—§oç¿q·Dküæ¿Åa¶ œOæ¿|?‘RËkå¿Ø¢_¼*S俤X(nã¿Ð7þÄŽá¿`‰ª¤Óß¿C«2üG;Ü¿;]Q]Ø¿­8ÉsHCÔ¿ïdñ–îÏ¿Xʇ„áÇ¿&$'7Êл¿‡÷êP{š¢¿/öêP{š¢?{#'7Êл?ʇ„áÇ?ždñ–îÏ?†8ÉsHCÔ?]Q]Ø?!«2üG;Ü?@‰ª¤Óß?Â7þÄŽá?¤X(nã?Ì¢_¼*Sä?s?‘RËkå?½a¶ œOæ?l·Dküæ?=ZUëŽpç?BϬèªç?DϬèªç?DZUëŽpç?u·Dküæ?Ía¶ œOæ?„?‘RËkå?â¢_¼*Sä?"¤X(nã?Þ7þÄŽá?‰ª¤Óß?f«2üG;Ü?b]Q]Ø?Ô8ÉsHCÔ?>eñ–îÏ?®Ê‡„áÇ?â$'7Êл?¼øêP{š¢?âôêP{š¢¿Ì"'7Êл¿¨É‡„áÇ¿Vdñ–îÏ¿_8ÉsHCÔ¿î]Q]Ø¿>Q_]1:Ü¿’„ŽjÒ߿̀·¶Žá¿,ùÌQ²ã¿S‹À%bRä¿ÿ“gê÷jå¿7Ý¿Næ¿+¾jˆûæ¿ð+—§o翌 ‡ÿ©ç¿©Õî“yså¿5=É–>å¿Ä›¨–SÕä¿3“Y€³8ä¿~¬8jã¿ëºÖ(àkâ¿^‰@á¿f‰ª¤Óß¿5þLç—ØÜ¿›æ`m–Ù¿M‚…”,Ö¿ è±z]Ò¿nâ¾`ñÌ¿ê7{ ·ßÄ¿¨ ©cè5¹¿¿£$9vÜ ¿‡¢$9vÜ ? ©cè5¹?œ7{ ·ßÄ?$â¾`ñÌ?ñ è±z]Ò?,‚…”,Ö?|æ`m–Ù?þLç—ØÜ?M‰ª¤Óß?R‰@á?áºÖ(àkâ?~¬8jã?-“Y€³8ä?À›¨–SÕä?ý4=É–>å?§Õî“yså?ªÕî“yså?5=É–>å?Ê›¨–SÕä?:“Y€³8ä?~¬8jã?ôºÖ(àkâ?i‰@á?‰ª¤Óß?RþLç—ØÜ?»æ`m–Ù?q‚…”,Ö?8 è±z]Ò?¶â¾`ñÌ?78{ ·ßÄ?S¡©cè5¹?פ$9vÜ ?Z¡$9vÜ ¿nŸ©cè5¹¿J7{ ·ßÄ¿âá¾`ñ̿Πè±z]Ò¿‚…”,Ö¿ãƒ}p•Ù¿â°ñ7{×Ü¿¦„ŽjÒß¿ QnÉr?á¿O1Y[*k⿹yYyiã¿®ìîë7ä¿dzû…Ôä¿)6Å=å¿ú÷ߥrå¿f;œ°'ã¿,B?>Øâ¿Â©ßßzâ¿ ¸ó4ðïá¿¢ŸVÈ8á¿”é*ø*Wà¿E…«ˆšÞ¿P«2üG;Ü¿ æ`m–Ù¿<ÕŸ|²Ö¿uÝë°––ӿ׺ÑeJп éYR¬É¿kè „¿ŒaøÞ\¶¿‰N‡z¾é¿^L‡z¾é?aøÞ\¶?'è „Â?àèYR¬É?¸ºÑeJÐ?XÝë°––Ó?!ÕŸ|²Ö?ˆæ`m–Ù?8«2üG;Ü?ýD…«ˆšÞ?‹é*ø*Wà?šŸVÈ8á?¸ó4ðïá?¾©ßßzâ?)B?>Øâ?d;œ°'ã?f;œ°'ã?/B?>Øâ?Ç©ßßzâ?¸ó4ðïá?ªŸVÈ8á?œé*ø*Wà?&E…«ˆšÞ?f«2üG;Ü?»æ`m–Ù?YÕŸ|²Ö?•Ýë°––Ó?öºÑeJÐ?_éYR¬É?°è „Â?#žaøÞ\¶?zP‡z¾é?IJ‡z¾é¿tœaøÞ\¶¿Þç „¿¥èYR¬É¿™ºÑeJп8Ýë°––Ó¿TìoCà¿ìf»µåß¿gJJ¶çõÞ¿*G:Źݿ„ìY4Ü¿¿avÛciÚ¿O]Q]Ø¿Z‚…”,Ö¿}Ýë°––Ó¿Ê 6¼µçпæaPNÌ¿¬{„OÞ'Æ¿ÿÿŠõ¿¿ÑW³L³¿VâµôÐЙ¿xàµôÐЙ?[W³L³?ˆÿŠõ¿?s{„OÞ'Æ?±aPNÌ?° 6¼µçÐ?eÝë°––Ó?D‚…”,Ö?;]Q]Ø?­avÛciÚ?vìY4Ü?G:ŹÝ?\JJ¶çõÞ?çf»µåß?'°>ìoCà?ê|ï[ìkà?ì|ï[ìkà?+°>ìoCà?öf»µåß?qJJ¶çõÞ?7G:ŹÝ?“ìY4Ü?ÒavÛciÚ?b]Q]Ø?q‚…”,Ö?•Ýë°––Ó?æ 6¼µçÐ?ŽaPNÌ?â{„OÞ'Æ?wŠõ¿?TW³L³?äµôÐЙ?«ÞµôÐЙ¿áW³L³¿ ÿŠõ¿¿A{„OÞ'Æ¿{aPNÌ¿• 6¼µçп’Qf_Õ•Ó¿Îܺ¤RÖ¿9‡›`\Ø¿,.‘2_hÚ¿FÒ¯¬B3Ü¿ð&•¤Ÿ¸Ý¿ <«(¶ôÞ¿ÅÒîzäß¿KZÔjÏBà¿ÈfõJJkà¿Wã#/iPÛ¿b2uô Û¿,W… ‡Ú¿õ=mSš¿Ù¿Ÿ"°¸Ø¿»ÕZíÒt׿º»í`!÷Õ¿Ä8ÉsHCÔ¿% è±z]Ò¿âºÑeJпîaPNÌ¿Œ!¹%~bÇ¿¾$Ãm¿J*ÚC”º¿ÛêÎò °¿@àí=x•¿³Þí=x•? ÚêÎò °?é)ÚC”º?$ÃmÂ?_!¹%~bÇ?ÄaPNÌ?κÑeJÐ? è±z]Ò?³8ÉsHCÔ?¬»í`!÷Õ?®ÕZíÒt×?”"°¸Ø?ì=mSš¿Ù?'W… ‡Ú?_2uô Û?Uã#/iPÛ?Wã#/iPÛ?g2uô Û?3W… ‡Ú?þ=mSš¿Ù?ª"°¸Ø?ÇÕZíÒt×?Ê»í`!÷Õ?Ô8ÉsHCÔ?8 è±z]Ò?öºÑeJÐ?ŽaPNÌ?¹!¹%~bÇ?ë$ÃmÂ?®*ÚC”º?oÛêÎò °?¤áí=x•?2Ýí=x•¿:ÚêÎò °¿€)ÚC”º¿e$Ãm¿2!¹%~bÇ¿˜aPNÌ¿&°ÿ ÅIпÛÁ~rÅ\Ò¿ž¹ìy€BÔ¿˜d¤™HöÕ¿>Öoës׿pΟ¼·Ø¿:.6œ¾Ù¿8ï‹·†Ú¿æ /ü Û¿ô|Fž[OÛ¿äºk¢…Õ¿2Ú®Û’PÕ¿k ÈŒöæÔ¿f&àÞÑIÔ¿‡Ì>¨zÓ¿×èùix{Ò¿À¬­…·NÑ¿#eñ–îÏ¿˜â¾`ñÌ¿?éYR¬É¿¾{„OÞ'Æ¿È$Ãm¿ vj†ƒ ½¿‚$úÊbñ´¿½cü?K©¿«òY¼ê¿Ê©òY¼ê?x¼cü?K©?6$úÊbñ´?Àuj†ƒ ½?¥$ÃmÂ?œ{„OÞ'Æ? éYR¬É?{â¾`ñÌ? eñ–îÏ?´¬­…·NÑ?Ìèùix{Ò?~Ì>¨zÓ?_&àÞÑIÔ?f ÈŒöæÔ?/Ú®Û’PÕ?ãºk¢…Õ?åºk¢…Õ?4Ú®Û’PÕ?p ÈŒöæÔ?m&àÞÑIÔ?Ì>¨zÓ?àèùix{Ò?ˬ­…·NÑ?>eñ–îÏ?¶â¾`ñÌ?_éYR¬É?â{„OÞ'Æ?ë$ÃmÂ?Qvj†ƒ ½?Ñ$úÊbñ´?¾½cü?K©?¬òY¼ê?œ¨òY¼ê¿Ø»cü?K©¿â#úÊbñ´¿}uj†ƒ ½¿€$Ãm¿z{„OÞ'Æ¿|â´õ«É¿ëcÀåïÌ¿w>÷ZíÏ¿³as¶ NÑ¿Ã`”ÂzÒ¿…ʰèyÓ¿Š€¤ IÔ¿Y,‹C(æÔ¿˜·)€ÀOÕ¿RP‹΄տŽ%Š0˜ Ï¿èå¿Î¿äR k¶&ο0ÑïDÍ¿Hëoq4Ì¿%GÁ­©Ê¿f¿ -D÷È¿›Ê‡„áÇ¿"8{ ·ßÄ¿™è „¿@Šõ¿¿|*ÚC”º¿œ$úÊbñ´¿ŸT6U¿5®¿ˆè%>>¢¿Gà£c gˆ¿‚Þ£c gˆ?è%>>¢?0T6U¿5®?h$úÊbñ´?H*ÚC”º?Šõ¿?‚è „Â?8{ ·ßÄ?ˆÊ‡„áÇ?U¿ -D÷È?GÁ­©Ê?;ëoq4Ì?ý/ÑïDÍ?ÜR k¶&Î?âå¿Î?Œ%Š0˜ Ï?%Š0˜ Ï?ìå¿Î?êR k¶&Î?0ÑïDÍ?Tëoq4Ì?3GÁ­©Ê?x¿ -D÷È?­Ê‡„áÇ?78{ ·ßÄ?±è „Â?vŠõ¿?®*ÚC”º?Ñ$úÊbñ´?U6U¿5®?é%>>¢?Üá£c gˆ?ÎÜ£c gˆ¿¦ç%>>¢¿¸S6U¿5®¿8$úÊbñ´¿*ÚC”º¿ÞÿŠõ¿¿‡ªžQ_ƒÂ¿*ÆéÞÄ¿jp9þÇ¿¼6ïÈMöȿ᫨ʿ¤'ê"Ì¿9·èBÍ¿½“<ÚŒ%οr·Í—޽οÙÝÌe Ï¿­Ó/aa¿Â¿Ä9ä(‘¿[Þ)5¿`ñ¼G¬Á¿Þv Ò÷À¿مʇÀ¿€pÛM'¾¿Ë$'7Êл¿9¡©cè5¹¿žaøÞ\¶¿4W³L³¿PÛêÎò °¿€½cü?K©¿Àè%>>¢¿:wc„–¿:Û¬ùèx}¿Ù¬ùèx}?²wc„–?}è%>>¢?@½cü?K©?2ÛêÎò °?W³L³?ëaøÞ\¶? ¡©cè5¹?´$'7Êл?lpÛM'¾?ù؅ʇÀ?Þv Ò÷À?Zñ¼G¬Á?[Þ)5Â? Ä9ä(‘Â?¬Ó/aa¿Â?®Ó/aa¿Â?Ä9ä(‘Â?[Þ)5Â?eñ¼G¬Á?&Þv Ò÷À? مʇÀ?–pÛM'¾?â$'7Êл?S¡©cè5¹?"žaøÞ\¶?SW³L³?oÛêÎò °?¾½cü?K©?é%>>¢?Îwc„–?"ݬùèx}? ׬ùèx}¿'wc„–¿5è%>>¢¿½cü?K©¿ÛêÎò °¿øW³L³¿ ~E\¶¿PõW•ï4¹¿ö*M³·Ï»¿¥D¹î%¾¿æœ°æèÀ¿ÎÒª*÷À¿\¸%´˜«Á¿Ó,v4¿v:Ʀq¿¾,”[¨¾Â¿6È}SÈ©¿ùÂÃÝôÕ¨¿°‰¥_æZ¨¿IÄ<Ì£§¿ô{Kßi²¦¿|ä¢*¤¿­øêP{š¢¿Æ¤$9vÜ ¿SP‡z¾é¿ÙãµôÐЙ¿záí=x•¿ò«òY¼ê¿€á£c gˆ¿[ܬùèx}¿(ÆÏ™#¶c¿¼ÄÏ™#¶c?¦Û¬ùèx}?'á£c gˆ?È«òY¼ê?Qáí=x•?±ãµôÐЙ?.P‡z¾é?µ¤$9vÜ ?øêP{š¢?’¯>ä¢*¤?rä¢*¤?¼øêP{š¢?פ$9vÜ ?yP‡z¾é?äµôÐЙ?¤áí=x•?¬òY¼ê?Üá£c gˆ?#ݬùèx}?oÇÏ™#¶c?\ÃÏ™#¶c¿ëÚ¬ùèx}¿Åà£c gˆ¿¡«òY¼ê¿(áí=x•¿ˆãµôÐЙ¿kC—è¿”Þ‚ÑÏÛ ¿ßŒw·Ã™¢¿²îŸÝÛ)¤¿9ÓqÝ=ˆ¥¿‘¶°ß‰±¦¿È³(î⢧¿s|½öY¨¿n-fÂÿÔ¨¿EõÕЩ¿Ã}SÈ©?Ö½ÃÝôÕ¨?¥„¥_æZ¨?e¿<Ì£§?BwKßi²¦?8f‰¥?t«>ä¢*¤?ÓôêP{š¢?H¡$9vÜ ?$J‡z¾é?€ÞµôÐЙ? Ýí=x•?r¨òY¼ê?rÜ£c gˆ?BÖ¬ùèx}?ÂÏ™#¶c?¨ÀÏ™#¶c¿ŒÕ¬ùèx}¿Ü£c gˆ¿H¨òY¼ê¿àÜí=x•¿ZÞµôÐЙ¿ÿI‡z¾é¿8¡$9vÜ ¿ÄôêP{š¢¿f«>ä¢*¤¿ý7f‰¥¿8wKßi²¦¿^¿<Ì£§¿Ÿ„¥_æZ¨¿Ò½ÃÝôÕ¨¿Ã}SÈ©¿Ã}SÈ©¿Ú½ÃÝôÕ¨¿ª„¥_æZ¨¿m¿<Ì£§¿LwKßi²¦¿8f‰¥¿‚«>ä¢*¤¿âôêP{š¢¿Z¡$9vÜ ¿IJ‡z¾é¿«ÞµôÐЙ¿2Ýí=x•¿œ¨òY¼ê¿ÎÜ£c gˆ¿ ׬ùèx}¿\ÃÏ™#¶c¿G¿Ï™#¶c?ÒÔ¬ùèx}?¸Û£c gˆ?!¨òY¼ê?¸Üí=x•?0ÞµôÐЙ?ÚI‡z¾é?(¡$9vÜ ?´ôêP{š¢?X«>ä¢*¤?ò7f‰¥?/wKßi²¦?V¿<Ì£§?™„¥_æZ¨?нÃÝôÕ¨?Ã}SÈ©?DÒ/aa¿Â?¨Â9ä(‘Â?º[Þ)5Â? ð¼G¬Á?ØÜv Ò÷À?ÌׅʇÀ?>nÛM'¾?µ"'7Êл?TŸ©cè5¹?XœaøÞ\¶?ÁW³L³?ÚêÎò °?š»cü?K©?aç%>>¢?’wc„–?Ù¬ùèx}?àÖ¬ùèx}¿ wc„–¿ç%>>¢¿Y»cü?K©¿üÙêÎò °¿¤W³L³¿=œaøÞ\¶¿;Ÿ©cè5¹¿"'7Êл¿(nÛM'¾¿ÄׅʇÀ¿ÐÜv Ò÷À¿ð¼G¬Á¿¶[Þ)5¿¥Â9ä(‘¿CÒ/aa¿Â¿EÒ/aa¿Â¿¬Â9ä(‘¿¿[Þ)5¿ð¼G¬Á¿ßÜv Ò÷À¿ÕׅʇÀ¿RnÛM'¾¿Ê"'7Êл¿nŸ©cè5¹¿tœaøÞ\¶¿àW³L³¿:ÚêÎò °¿Ø»cü?K©¿¦ç%>>¢¿'wc„–¿ëÚ¬ùèx}¿ÒÔ¬ùèx}?wc„–?Öæ%>>¢? »cü?K©?ÞÙêÎò °?…W³L³?"œaøÞ\¶?$Ÿ©cè5¹?†"'7Êл?nÛM'¾?»×…ʇÀ?ÊÜv Ò÷À?ð¼G¬Á?²[Þ)5Â?¤Â9ä(‘Â?BÒ/aa¿Â?,$Š0˜ Ï?Šä¿Î?ŒQ k¶&Î?¹.ÑïDÍ? êoq4Ì?õEÁ­©Ê?J¾ -D÷È?•ɇ„áÇ?47{ ·ßÄ?Æç „Â?ÖþŠõ¿?N)ÚC”º?¯#úÊbñ´?GS6U¿5®?¹ç%>>¢?0ߣc gˆ?mÝ£c gˆ¿Iç%>>¢¿ØR6U¿5®¿z#úÊbñ´¿)ÚC”º¿¦þŠõ¿¿°ç „¿ 7{ ·ßÄ¿‚ɇ„áÇ¿8¾ -D÷È¿çEÁ­©Ê¿üéoq4Ì¿°.ÑïDÍ¿…Q k¶&ο…ä¿Î¿*$Š0˜ Ï¿.$Š0˜ Ï¿Žä¿Î¿’Q k¶&οÄ.ÑïDÍ¿êoq4Ì¿FÁ­©Ê¿Z¾ -D÷È¿¨É‡„áÇ¿J7{ ·ßÄ¿Þç „¿ ÿŠõ¿¿€)ÚC”º¿â#úÊbñ´¿¸S6U¿5®¿5è%>>¢¿Åà£c gˆ¿¸Û£c gˆ?Öæ%>>¢?`R6U¿5®?J#úÊbñ´?ç(ÚC”º?rþŠõ¿?™ç „Â? 7{ ·ßÄ?oɇ„áÇ?'¾ -D÷È?ØEÁ­©Ê?ñéoq4Ì?¦.ÑïDÍ?~Q k¶&Î?ä¿Î?*$Š0˜ Ï?Hºk¢…Õ?–Ù®Û’PÕ?ÒÈŒöæÔ?Ò%àÞÑIÔ?ùË>¨zÓ?Pèùix{Ò?A¬­…·NÑ?¨zÓ¿Ë%àÞÑIÔ¿ÎÈŒöæÔ¿“Ù®Û’PÕ¿Gºk¢…Õ¿Hºk¢…Õ¿™Ù®Û’PÕ¿ØÈŒöæÔ¿Ø%àÞÑIÔ¿Ì>¨zÓ¿Yèùix{Ò¿N¬­…·NÑ¿Vdñ–îÏ¿âá¾`ñÌ¿¥èYR¬É¿A{„OÞ'Æ¿e$Ãm¿}uj†ƒ ½¿8$úÊbñ´¿½cü?K©¿¡«òY¼ê¿!¨òY¼ê? »cü?K©?J#úÊbñ´?ªtj†ƒ ½?û#ÃmÂ?×z„OÞ'Æ?FèYR¬É?á¾`ñÌ?dñ–îÏ?)¬­…·NÑ?<èùix{Ò?èË>¨zÓ?Å%àÞÑIÔ?ÉÈŒöæÔ?‘Ù®Û’PÕ?Fºk¢…Õ?¹â#/iPÛ?Ç1uô Û?”V… ‡Ú?a=mSš¿Ù?"°¸Ø?4ÕZíÒt×?<»í`!÷Õ?O8ÉsHCÔ?» è±z]Ò?„ºÑeJÐ?NaPNÌ?!¹%~bÇ?T$ÃmÂ?²)ÚC”º?¦ÚêÎò °?Äßí=x•?7Þí=x•¿CÚêÎò °¿P)ÚC”º¿%$ÃmÂ¿Ø ¹%~bÇ¿"aPNÌ¿pºÑeJп© è±z]Ò¿>8ÉsHCÔ¿-»í`!÷Õ¿'ÕZíÒt׿"°¸Ø¿X=mSš¿Ù¿ŽV… ‡Ú¿Ä1uô Û¿¸â#/iPÛ¿»â#/iPÛ¿Ë1uô Û¿›V… ‡Ú¿j=mSš¿Ù¿"°¸Ø¿@ÕZíÒt׿K»í`!÷Õ¿`8ÉsHCÔ¿Î è±z]Ò¿˜ºÑeJп{aPNÌ¿2!¹%~bÇ¿$Ãm¿*ÚC”º¿ÛêÎò °¿)áí=x•¿¸Üí=x•?ÞÙêÎò °?ç(ÚC”º?ü#ÃmÂ?« ¹%~bÇ?õŒaPNÌ?]ºÑeJÐ?— è±z]Ò?-8ÉsHCÔ?»í`!÷Õ?ÕZíÒt×?ü"°¸Ø?P=mSš¿Ù?‡V… ‡Ú?À1uô Û?·â#/iPÛ?|ï[ìkà?ܯ>ìoCà?Vf»µåß?ÓIJ¶çõÞ?œF:ŹÝ?ÿëY4Ü?AavÛciÚ?Û]Q]Ø?ñ…”,Ö?Ýë°––Ó?z 6¼µçÐ?baPNÌ?B{„OÞ'Æ?fÿŠõ¿?uW³L³?ÛáµôÐЙ?þßµôÐЙ¿ÿW³L³¿ðþŠõ¿¿ {„OÞ'Æ¿+aPNÌ¿` 6¼µçпÝë°––Ó¿Ü…”,Ö¿Ç]Q]Ø¿0avÛciÚ¿ïëY4Ü¿F:ŹݿÊIJ¶çõÞ¿Nf»µå߿گ>ìoC࿜|ï[ìk࿞|ï[ìkà¿Þ¯>ìoCà¿^f»µåß¿ÞIJ¶çõÞ¿ªF:ŹݿìY4Ü¿RavÛciÚ¿î]Q]Ø¿‚…”,Ö¿8Ýë°––Ó¿• 6¼µçп˜aPNÌ¿z{„OÞ'Æ¿ÞÿŠõ¿¿øW³L³¿‡ãµôÐЙ¿0ÞµôÐЙ?…W³L³?rþŠõ¿?Øz„OÞ'Æ?õŒaPNÌ?E 6¼µçÐ?ðÜë°––Ó?Æ…”,Ö?³]Q]Ø?avÛciÚ?àëY4Ü?„F:ŹÝ?¿IJ¶çõÞ?Hf»µåß?د>ìoCà?œ|ï[ìkà?;œ°'ã?æB?>Øâ?©ßßzâ?Ì·ó4ðïá?cŸVÈ8á?Xé*ø*Wà?¡D…«ˆšÞ?èª2üG;Ü?Cæ`m–Ù?èÔŸ|²Ö?.Ýë°––Ó?›ºÑeJÐ?ÂèYR¬É?&è „Â?:aøÞ\¶?N‡z¾é?ñK‡z¾é¿¯œaøÞ\¶¿ãç „¿èYR¬É¿|ºÑeJпÝë°––Ó¿ÎÔŸ|²Ö¿*æ`m–ٿЪ2üG;Ü¿ŒD…«ˆšÞ¿Oé*ø*Wà¿\ŸVÈ8á¿Å·ó4ðïá¿z©ßßzâ¿äB?>Øâ¿;œ°'ã¿ ;œ°'ã¿éB?>Øâ¿ƒ©ßßzâ¿Ò·ó4ðïá¿kŸVÈ8á¿`é*ø*Wà¿¶D…«ˆšÞ¿ÿª2üG;Ü¿]æ`m–Ù¿ÕŸ|²Ö¿NÝë°––Ó¿ººÑeJпéYR¬É¿mè „¿ÐaøÞ\¶¿ P‡z¾é¿ÛI‡z¾é?"œaøÞ\¶?šç „Â?FèYR¬É?]ºÑeJÐ?ðÜë°––Ó?²ÔŸ|²Ö?æ`m–Ù?¸ª2üG;Ü?vD…«ˆšÞ?Fé*ø*Wà?TŸVÈ8á?¿·ó4ðïá?u©ßßzâ?âB?>Øâ?;œ°'ã?iÕî“yså?Á4=É–>å?‡›¨–SÕä?÷’Y€³8ä?Õ}¬8jã?´ºÖ(àkâ?*‰@á? ‰ª¤Óß?àýLç—ØÜ?Oæ`m–Ù? ‚…”,Ö?Þ è±z]Ò?â¾`ñÌ?¬7{ ·ßÄ?^ ©cè5¹?£$9vÜ ?V¢$9vÜ ¿ÄŸ©cè5¹¿`7{ ·ßÄ¿Ðá¾`ñÌ¿» è±z]Ò¿ê…”,Ö¿0æ`m–Ù¿ÂýLç—ØÜ¿î‰ª¤Óß¿‰@á¿«ºÖ(àkâ¿Ì}¬8jã¿ð’Y€³8ä¿‚›¨–SÕ俾4=É–>å¿hÕî“yså¿jÕî“yså¿Ä4=É–>忌›¨–SÕä¿þ’Y€³8ä¿Ü}¬8j㿾ºÖ(àkâ¿6‰@á¿#‰ª¤Óß¿ýýLç—ØÜ¿pæ`m–Ù¿0‚…”,Ö¿ è±z]Ò¿`â¾`ñÌ¿ú7{ ·ßÄ¿¡©cè5¹¿¥¤$9vÜ ¿(¡$9vÜ ?$Ÿ©cè5¹? 7{ ·ßÄ?á¾`ñÌ?˜ è±z]Ò?Æ…”,Ö?æ`m–Ù?¨ýLç—ØÜ?Ô‰ª¤Óß?‰@á? ºÖ(àkâ?Å}¬8jã?ê’Y€³8ä?}›¨–SÕä?¼4=É–>å?hÕî“yså? Ϭèªç?ZUëŽpç?8·Dküæ?Ža¶ œOæ?G?‘RËkå?¦¢_¼*Sä?æ£X(nã?¥7þÄŽá?‰ª¤Óß?þª2üG;Ü?þ]Q]Ø?{8ÉsHCÔ?¡dñ–îÏ?ʇ„áÇ?á#'7Êл?Z÷êP{š¢?öêP{š¢¿6#'7Êл¿Êɇ„áÇ¿Ndñ–îÏ¿T8ÉsHCÔ¿Ú]Q]ؿܪ2üG;Ü¿ò‰ª¤Óß¿–7þÄŽá¿Ù£X(n㿚¢_¼*Sä¿=?‘RËk忇a¶ œOæ¿2·Dküæ¿ZUëŽpç¿Ϭèªç¿ Ϭèªç¿ ZUëŽpç¿=·Dküæ¿”a¶ œOæ¿O?‘RËkå¿°¢_¼*Sä¿ó£X(n㿳7þÄŽá¿3‰ª¤Óß¿!«2üG;Ü¿']Q]Ø¿¢8ÉsHCÔ¿ïdñ–îÏ¿vʇ„áÇ¿$'7Êл¿ŽøêP{š¢¿´ôêP{š¢?†"'7Êл?oɇ„áÇ?dñ–îÏ?-8ÉsHCÔ?³]Q]Ø?ºª2üG;Ü?Ô‰ª¤Óß?ˆ7þÄŽá?Ì£X(nã?¢_¼*Sä?4?‘RËkå?a¶ œOæ?,·Dküæ?ZUëŽpç?Ϭèªç?¦Söþ§é?¸ (½hé? cb×êè?‡Êîƒ/è?`†Ž8ç?y(RYæ? Ìì±Ò¡ä?ë£X(nã?4‰@á?¿D…«ˆšÞ?oavÛciÚ?r»í`!÷Õ?~¬­…·NÑ?å¾ -D÷È?‹oÛM'¾?6®>ä¢*¤?À¬>ä¢*¤¿ÒnÛM'¾¿Š¾ -D÷È¿Q¬­…·NÑ¿H»í`!÷Õ¿GavÛciÚ¿šD…«ˆšÞ¿"‰@á¿Ú£X(nã¿Ìì±Ò¡ä¿l(RYæ¿T†Ž8ç¿~Êîƒ/è¿ cb×êè¿{¸ (½h鿤Söþ§é¿§Söþ§é¿‚¸ (½hé¿ cb×êè¿Êîƒ/è¿h†Ž8ç¿„(RYæ¿.Ìì±Ò¡ä¿ú£X(nã¿E‰@á¿çD…«ˆšÞ¿šavÛciÚ¿œ»í`!÷Õ¿¨¬­…·NÑ¿C¿ -D÷È¿WpÛM'¾¿„¯>ä¢*¤¿X«>ä¢*¤?nÛM'¾?'¾ -D÷È?*¬­…·NÑ?»í`!÷Õ?avÛciÚ?vD…«ˆšÞ?‰@á?Ì£X(nã?Ìì±Ò¡ä?a(RYæ?L†Ž8ç?wÊîƒ/è? cb×êè?x¸ (½hé?¤Söþ§é? =pÒeë?°{F"ë?ÑdAúÔ›ê?áDÁrÉÓé?¼³pÌè?ܯ¡6‡ç?(RYæ?±¢_¼*Sä?ĺÖ(àkâ?mé*ø*Wà?7ìY4Ü?tÕZíÒt×?–èùix{Ò?¤FÁ­©Ê?„؅ʇÀ?;f‰¥?r9f‰¥¿!؅ʇÀ¿BFÁ­©Ê¿fèùix{Ò¿FÕZíÒt׿ìY4Ü¿Zé*ø*W࿲ºÖ(àkâ¿ ¢_¼*Sä¿q(RYæ¿Ï¯¡6‡ç¿°³pÌè¿ØDÁrÉÓé¿ËdAúԛ꿬{F"ë¿=pÒeë¿!=pÒeë¿´{F"ë¿ØdAúÔ›ê¿êDÁrÉÓé¿Æ³pÌè¿è¯¡6‡ç¿Ž(RYæ¿Á¢_¼*Sä¿×ºÖ(àkâ¿‚é*ø*Wà¿eìY4Ü¿¡ÕZíÒt׿Ãèùix{Ò¿GÁ­©Ê¿ð؅ʇÀ¿fb‹8 ì?NÃùb8ë?^nNhq"ê?³pÌè?l†Ž8ç?X?‘RËkå?ê}¬8jã?~ŸVÈ8á?àF:ŹÝ?["°¸Ø?GÌ>¨zÓ?Èêoq4Ì?Ýv Ò÷À?hzKßi²¦?ÄxKßi²¦¿5Ýv Ò÷À¿aêoq4Ì¿Ì>¨zÓ¿,"°¸Ø¿´F:ŹݿiŸVÈ8á¿Ö}¬8jã¿F?‘RËkå¿\†Ž8ç¿´³pÌè¿RnNhq"ê¿ûMÃùb8ë¿|>b‹8 ì¿mé§Qê˜ì¿(~öàì¿*~öàì¿ué§Qê˜ì¿Š>b‹8 ì¿NÃùb8ë¿hnNhq"ê¿Î³pÌè¿|†Ž8ç¿j?‘RËkå¿ý}¬8jã¿“ŸVÈ8á¿G:ŹݿŠ"°¸Ø¿vÌ>¨zÓ¿0ëoq4Ì¿Þv Ò÷À¿á{Kßi²¦¿.wKßi²¦?ÊÜv Ò÷À?ñéoq4Ì?éË>¨zÓ?ü"°¸Ø?ƒF:ŹÝ?TŸVÈ8á?Å}¬8jã?4?‘RËkå?L†Ž8ç?§³pÌè?HnNhq"ê?óMÃùb8ë?v>b‹8 ì?ié§Qê˜ì?&~öàì?~]ü’Öî? ¼`¥Íí?Sãoæù9í?‹Š5@^ì?j0(–<ë?5=€zÅ×é?EK:H>3è?)›5 Sæ?+ l"Ò;ä?ޏ< ´òá?À€/z®úÞ?Ur>“ÃÙ?Þ %óLÔ?£dRÄŒHÍ?^#Ò¯Á?H*dßq§§?’(dßq§§¿ò"Ò¯Á¿9dRÄŒHÍ¿« %óLÔ¿#r>“ÃÙ¿€/z®úÞ¿y¸< ´òá¿ l"Ò;ä¿›5 Sæ¿6K:H>3è¿'=€zÅ×é¿_0(–<뿆‹Š5@^ì¿Lãoæù9í¿ ¼`¥Íí¿}]ü’Öî¿€]ü’Öî¿" ¼`¥Íí¿Zãoæù9í¿™‹Š5@^ì¿v0(–<ë¿C=€zÅ×é¿WK:H>3è¿;›5 Sæ¿= l"Ò;俤¸< ´òá¿ó€/z®úÞ¿r>“ÃÙ¿ %óLÔ¿ eRÄŒHÍ¿Ò#Ò¯Á¿Â+dßq§§¿Ü&dßq§§?~"Ò¯Á?ÀcRÄŒHÍ?{ %óLÔ?ñq>“ÃÙ?`€/z®úÞ?_¸< ´òá? l"Ò;ä?›5 Sæ?$K:H>3è?=€zÅ×é?S0(–<ë?}‹Š5@^ì?Eãoæù9í? ¼`¥Íí?{]ü’Öî?7Å^“ìï?(Ù¹|´î?Ë^ÀxYî?Xãoæù9í?î9†Œì?Ê´¢ÞïŸê?†Õz¯îè?7“—÷ÿæ?]‰bŠØä?ø56߸}â?Q ê}¡êß?`‡#4!‹Ú?ZŸ30êÔ?^ö8]+Î?…<¤÷ø7Â?ß0ƒB¨^¨?/ƒB¨^¨¿<¤÷ø7¿ñõ8]+ο%Ÿ30êÔ¿,‡#4!‹Ú¿ ê}¡êß¿á56߸}â¿G‰bŠØä¿$“—÷ÿæ¿vÕz¯îè¿»´¢ÞïŸê¿â9†Œì¿Nãoæù9í¿Å^ÀxYî¿$Ù¹|´î¿6Å^“ìï¿9Å^“ìï¿,Ù¹|´î¿Ò^ÀxYî¿bãoæù9í¿ú9†Œì¿Ø´¢ÞïŸê¿˜Õz¯îè¿J“—÷ÿæ¿p‰bŠØä¿66߸}⿆ ê}¡êß¿Œ‡#4!‹Ú¿ŒŸ30êÔ¿Ìö8]+οü<¤÷ø7¿d2ƒB¨^¨¿Y-ƒB¨^¨?ž;¤÷ø7Â?tõ8]+Î?ôž30êÔ?ù†#4!‹Ú?î ê}¡êß?Ç56߸}â?4‰bŠØä?“—÷ÿæ?dÕz¯îè?¯´¢ÞïŸê?Ö9†Œì?Eãoæù9í?½^ÀxYî? Ù¹|´î?4Å^“ìï?ã@ä¹’ï?æc« Oï?/Ù¹|´î?+ ¼`¥Íí?ºgê¿Sì??Ò#v&ë?¼üÿ«¨lé?¼ß §,tç?ÀaÒÝAå?x[A&Ûâ?H90<òEà?X8Q>Û?±ä«ÜSÕ?˜¹UÌÃÎ?7ŸÕ.”Â?ј©¼ÉÙ¨?—©¼ÉÙ¨¿ÆžÕ.”¿(¹UÌÃο{ä«ÜSÕ¿$8Q>Û¿.90<òEà¿a[A&Ûâ¿ï¿aÒÝAå¿¨ß §,t翬üÿ«¨lé¿0Ò#v&ë¿®gê¿Sì¿! ¼`¥Íí¿(Ù¹|´î¿âc« Oï¿â@ä¹’ï¿å@ä¹’ï¿êc« Oï¿6Ù¹|´î¿4 ¼`¥Íí¿Çgê¿Sì¿NÒ#v&ë¿Ïüÿ«¨lé¿Ïß §,tç¿ÀaÒÝA忎[A&Ûâ¿c90<òEà¿…8Q>Û¿ää«ÜSÕ¿¹UÌÃο±ŸÕ.”¿^š©¼ÉÙ¨¿9•©¼ÉÙ¨?LžÕ.”Â?ª¹UÌÃÎ?Iä«ÜSÕ?ï7Q>Û?90<òEà?F[A&Ûâ?Ü¿aÒÝAå?”ß §,tç?™üÿ«¨lé?%Ò#v&ë?¢gê¿Sì? ¼`¥Íí? Ù¹|´î?Þc« Oï?à@ä¹’ï?’èÑFìï?è@ä¹’ï?CÅ^“ìï?]ü’Öî?{¥Y`äì?ª¯G jë?sÜJó«é?Š)Êh®ç?Ö,ÄÅÈvå?UÃ[/ ã?úñØêtnà?àÏZïŸTÛ?H$ÂjôˆÕ?:r MbÏ?E@?ÍEÂÂ?µ)¼¦©?I³)¼¦©¿Ó??ÍE¿Êq MbÏ¿$ÂjôˆÕ¿«ÏZïŸTÛ¿àñØêtnà¿>Ã[/ ã¿¿,ÄÅÈvå¿v)Êh®ç¿cÜJó«é¿›¯G jë¿o¥Y`äì¿…]ü’Öî¿<Å^“ìï¿ä@ä¹’ï¿’èÑFìï¿’’èÑFìï¿ì@ä¹’ï¿JÅ^“ìï¿™]ü’Ö¥Y`ä쿹¯G j뿆ÜJó«é¿)Êh®ç¿ê,ÄÅÈvå¿lÃ[/ ã¿òØêtnà¿ ÐZïŸTÛ¿|$ÂjôˆÕ¿«r MbÏ¿À@?ÍE¿ª¶)¼¦©¿y±)¼¦©?X??ÍEÂÂ?Jq MbÏ?ß#ÂjôˆÕ?vÏZïŸTÛ?ÇñØêtnà?#Ã[/ ã?¬,ÄÅÈvå?b)Êh®ç?PÜJó«é?¯G jë?c¥Y`äì?{]ü’Öî?4Å^“ìï?à@ä¹’ï?’èÑFìï?q Sôû’?ö–;áÒŽ?Jzz·Ù©’?ö 6ßànš?w‘OŒ£?á+ÔÚé«?÷r ;®ñ²?:í+7'~¸?!ø¢QW¾?þŠÙªüÂ?óyBÆíÄ?“^–bs€Ç? }ù|¶É?s ŸœvË?‰è÷ϬÌ?RspzKÍ?¨²zUWKÍ?&ÈRQg¬Ì?ˆt¼#ðuË?îñµÉ?ÍÐ[AGÇ?mb€Ô_ìÄ?JjÀ`Â?ó»+ºS¾?zÔP=z¸?ƒ÷¬í²?éÃ+ á«?ÁÚæý‚£?¶ídk\š?Ⱦ›Q—’?›>Ü0'®Ž?ªb\Ô é’?æ{߬9œ?Ë‹P/xý¤?Yøˆ|ê®?²Õ™fŠ–µ?Žj´¼¼?¦ÇBç„WÂ?C†üZâ–Æ?žd^â-ùÊ?Ê9*´YÏ?~OMlÉÑ?Dð=õlÀÓ?%kʉـÕ?ŽT„ûÖ?*D¿ “#Ø?Ú êŸÏîØ?\ê0úVÙ?>¶<’¯VÙ?Ò"x‚"ïØ?hbß©Ú#Ø?xRºZÒûÖ?T!4Õ?Y> àÖÀÓ?_‹L$çÉÑ?îðm`©ZÏ?¼a/ûlúÊ?îÓ£G˜Æ?ºeMiYÂ?FÏøà¿¼?ÈØÏ3šµ?ó/dµSò®?¸7ÌÅ¥?K»|Jœ?0e„!(? ©¦J‹?F= ¹Åý‘?Õ¬'©‹ýš?êõ!×8\¤?¼Ê$~ 2­?pôê ”É³?¶ÆW¶ü¹?8ER;»¿?´|—í¿Â?Å9±žËœÅ?  å²8È?E|Å™¤uÊ?ˆñys«:Ì?–ë ‡ tÍ?'Õ6šWÎ?*ƒ2µ3Î?ƒŽõÌ¡sÍ?l¸e÷û9Ì?Z'®×²tÊ?üˆú7È?_m~_›Å?õ=2vz½Â?¸yF-|¿?A%ÖÄ~¹?ro*àTų? 6F.$)­?YöfwS¤?èY¸¢Óêš?àvwþê‘?<«Ö½ùŠ?҇ÈÉ?RÌ&,Ã)—?Á¦,Âñ¶¡?ˆ$óaǪ?TŸ¦@³?E̹?¨ÁÞ¨À?§NAD±Ä?L¥šc‡ßÈ?Ôó›ŽðÍ?öN~—Ð?G‡#ppÒ??¨DqÔ?5Ú ¾‹Õ?”Ý—Ž¾¨Ö?vÛ4dl×?˜ NÐ×?.>à1dÐ×?4'*ë±l×? áâü¨Ö?ÄØ‰ ŒÕ?œiqåÉÔ?xʦ°ØpÒ?ÿ³{ÑŽÐ?|ÚmÄÍ?ÚnJ¤ÅàÈ?Íøe©²Ä?ÌOù+¥©À?†4qCôϹ?®ï³?íîBMGϪ?±>ÑåP¿¡?\šÚO;—?!Ù^¶Ë³…?ßX×甄?¦Â7Ïsb?r¤_gu´™?ùª0¤?£4”‹±E­?rÚeNò³?. ~ÿ/À¹?(}%±þË¿?¿%ØO(éÂ?¬’IaÈÅ?$Úih1dÈ?Â)ùB Ê?Ï}›rÍcÌ?Ì`Ë| œÍ?T#¾’¯;Î?`áÒ‰;Î?ÞÉII››Í? {­øcÌ?â/ÃÞ#ŸÊ?ø~" ÷bÈ?„®EÙéÆÅ?E.„ÊxçÂ?®èÛ{;È¿?RõÇu¼¹?ØžKÑ­í³?¼ïȃ<­?¼¢¼D¤?¤ÄK¢7¡™?4ãgç;?Øà.ÞÎn„?ÚŠmY£Ž…?Å@,Ï?€Wr RŸ›?ÚW¤8 û¥?D :°?à(”Wv¶?¼Äœ/?~½?Æð>½ÁŠÂ?xu©  }Æ?ï¤àOsÊ?ªûù¦lJÎ?9%V„ðÐ?Þ+W¯5ŠÒ?Ârl…3åÓ?üð×`ÔôÔ?¨_"ã¯Õ?=2P ¢Ö?e\’¥Ö?$Š §–¯Õ? ˜âæõÔ?b“ñIwåÓ?ñ‹@/ŠŠÒ?òÃö(zðÐ? .ø[KÎ?Èî³etÊ?E³ƒ J~Æ?7l·s&ŒÂ?±ø2ÚY½?z”Ž…Ây¶?•ªöbÂ=°?vÿä®!¦?¼f_Y°›?+—9„á?B`qàP{?Š\äì}?PuâXÑI‹?àªoxh˜?ª³£°À½£? ;X³¯­? E7ßWæ³?\^÷¹¹?š‡¬Þf¿?%›€€àÂ?T¨­þ,ºÅ?rN5¥«OÈ?œÚÄ\…Ê?¦‚Éœ©CÌ?ÐZ*MùwÍ?óˆµÆÎ?…Ç<VÎ?\…<$‚wÍ?ª±NëBÌ?!ؽ6X„Ê?iEÕ>cNÈ?°›¤¸Å?îãBM½ÞÂ?N5‚“w¾¿?ðPÆ´¹?üV¾ÒÄá³?®à/ì ­?uR»‚à³£?‰_³nT˜?´¼¹—Â!‹?#$h!}?áÈà{?Èÿ]ÑFƆ?(‚å”?dML-—Ρ?¤dRG€l«?+ÕÀ®¶³?°y/ƺ?xi[uY™À?pJˆQÄ?º6ˆ È?ùÞ<¼³Ë?¦‘âÚ–Ï?€bfNÑ?¥ßrq(\Ò?ÒböŒˆ^Ó?Å`å.Ô?t[ºjÔ?¾ùe¹jÔ? R‰;Ô?œ°^Ó?ý•e\Ò?D•`,Ñ? µÀìYÏ?Nsì«û³Ë?èóñÈ?ŠøÕÆÁRÄ?GvmH½šÀ?—€k°ãº?Vù—*ƒ³?ÌIû t«?@*R}ÂÖ¡?¤ÅÇ.÷ö”?ô3yë†?LN ­Ã5s?WÎÐÞÖy?³Ä,ù‡Š?è‘B˜?^¦K8Ѥ?Qyy­?ˆÀ<¡›´?É¢ŒË¬ì¹?¸2£N ì¿?5žCÌîÂ?u3¹CQ¿Å?lyšLÈ?汊xyÊ?µ“š£Ú0Ì? nˆ4`Í?=­K6ûÍ?~•ëúÍ?YEÙ´_Í?³—1)0Ì?ë «ßexÊ?“ñ¼©JÈ?ö)¤,²½Å?;à @ìÂ?V ;Náç¿?z6a"è¹?~b÷Íô?9-~ƒUo­?r<@Ïbý£?çAQÄ…˜?r§äê\Š?6ý‚G„y?söÒ7Ÿår?Ë.‡–U€?â¨gÀ?ú»îM¸Å? P臢º§?t1±Zæ=±?­í‹c·?&ôޱû¾?Hš«Â?Î!ó-3Æ?APVƒŠÉ?t³áÆÄÌ?xCç¿©Ï?ÊM™&KÑ?H86Ò?q|^­Ò?£sè›Ó??ÀÙœÓ?ÆÙTIk­Ò?äÇàXÒ?ïO ËÑ?@Q· ª©Ï? CJ€ÅÌ?,Œòd‹É?Æy#=Æ?T²3àŽÂ?÷xÞ¿¾?ªx¬f·?º˜UdA±?Lµ#‹U§?ˆÁÏY}Ö?Ä4aÖ‘?ƒÇ?,L{€?†L°©“u?š¯0fð?Ó£E÷ Ž?οñý,›?Ç¿"€¥?”zÊn¯?âzY-ï´?O©Y?¶¾º?ðÈpAe\À?ï«€ÝOÃ?4w=Æ?À qA¬¡È?À¤ ¸ ÉÊ?„öe{Ì?z ÏY §Í?$÷Äü?Î?îÊ¢+Ð?Î?¯)‰¦Í?Éìýá“zÌ?SJ„ŠýÇÊ?èMdƒ: È?4"ºÆ?oˆþÝMÃ?Ýl¢)ZÀ?ÿ{(–عº?Q¥ Qê´?³v4支?²Žÿðüt¥?\B†x›?„kk0tŽ?"î»NNF?&û“=5?u?8‘ÄÑÒý~?”g°ÎÁŽ?2›RÕe ›?”tJ Ã¥?ã7èÛد? ¬äŸû¸µ?šÂÕîQ¼?ù»ç`Á?áEu‰°ÀÄ?ÍŸnØ È?`0²¤"Ë?e%7èÍ?ãû™ é Ð?:Zj£ê Ñ?p¦Ù×S¯Ñ?š%Ò?‘y2(Ò?V6©nb¯Ñ?àÝü` Ñ?ä`‡à!Ð?ÀÓ‹èÍ?Îï]„S#Ë?zǽo¯ È?'<²ÁÄ?*…gGaÁ?T÷å:¼?{>ß)¼µ?R‚ýN'߯?ÐM#€Ë¥?.Eí³1›?ÀD=Ž?~hÿ½N?Ãô€2?ÝÞÞƒ¢‡?˜7Ï–gÊ“?Qg©~  ?ZB¨Õ#¨?æ“7Äè°?Ò}wÈW¶?zz™¡0)¼?„£jÁ?W£BòÄ?rBn›HÈÆ?7ù2JÉ?mç""ÕÛÎ?ù\ŽƒDÎ?§H³ÑÍ?™Ôè‡lË?šÝm¥HÉ?êZ—°iÆÆ?nóyÉþÃ?lkáÿ Á?ÇÝùÃë#¼?M•l*R¶?XÎÿ6â°? Dʨ?RI } ?—Î)çY²“?B± ¦s‡?&Úí˜?Ru©|G2„?{¾@œ¶?¤0Ä(Œœ›?Êáµ ý{¥?"”Žâ¯?B;þz µ? F¯ß¿»?óI70ÃÀ?èINÄ?pÙ¼^Q0Ç?vàÞô+Ê?x”•ÿ»ÙÌ?‚\ï Ï?¶Fg¥„tÐ?È.ÝÕÑ?$ãÒ7bÑ?ê÷îbÑ?(hŸ¡âÑ?ŽÐ™ä tÐ?PÑžÝ` Ï?Ý—Š'9ÚÌ?Ìr—,Ê?0‚XH1Ç?À´ØáDÄ?©··VÄÀ?œÖ‘õs »?ÙðNõ› µ?³Ñc ¯?ܬñù„¥?<4Zp{®›?æ0ÜX“?ˆOÃÄ›\„?ÑG3Öµî‹?öÌ‘?ŸÀíUš?žì=ãx’£?jRÍ}Û«?XôÒuÆØ²?®ŠX¸?cíJת5¾?Âó$ƘÂ?Ö› èz Å?«¢ÊKïÕÇ?ŽOØÐXÊ?Èã sÓzÌ?ïq»(Î?Ч-QÏ?F˜4èÏ?††qµèÏ?j-—‰PÏ?’$!ÆÓ'Î?"Õq‚…yÌ?d†ÛàgVÊ?iüæÓÇ?àÏ­ Å?T×k(õÂ?,»H é/¾?®È+jR¸?'B ]Ò²?âýìYΫ?–5òA…£?yíÒDÓ;š?µ}¸Dz‘?šì“‹ˆ¾‹?w²â<þm? !’ÉT”?²&>y­ž?Vžh˜¦?'Þâ7´¯?Õ &»¸)µ?[ óÊ»?¯UdžÀ?ð¾p°ÆÃ?4&<ØšÜÆ?<Ôiß(ÄÉ?+´ðÇœ`Ì?´X냧˜Î?v„…Z`+Ð?a .MÿÄÐ?º~ÖlWÑ?¸ï}WÑ?pO4ÅÐ?[EÍw+Ð?J¥“ùõ˜Î?iDýT aÌ?àX¥I¼ÄÉ?¡ïVÝÆ?RÓ¸øÆÃ?œ9Ô9~ŸÀ?æïò—² »?ÜÿΨÔ,µ?΄6r»¯?~†èK ¦?&ˆÕB«¿ž?0ÍwLui”?é!›?‘ÊÔêC¯”?µjȆ5™?@Ìd ¡?àpc—Ņ̃?ê.+ÿ-°?Úù]€î9µ?ذݎغ?G TehÀ?"YttÃ?˜¾ÝrÆ?Z¦ÅðCÉ?']öýjÍË?o±¸(öÍ?ÈœIWˆ¨Ï?ÆÓœáiÐ?øŒ¤î1¶Ð?ijš!¶Ð?§)E¢iÐ?ò4ü6‘§Ï?”¯?y¾ôÍ?Z«K”ËË?Pn׊uAÉ?¼,ž}oÆ?,™ÛrqÃ?2*O:eÀ?FU ^TѺ?òv’ìÝ2µ?À Y5Ã&°?zÜ9ãJ¾§?ô²Å;T ¡?7w£Ž ö˜?×Áçf3•”?LFå“|Ô?šUbÛȺ™?í}Ô†íÄ¡?6Nåÿº¨?*>ŠȰ?ê&Ã)öµ?ï]aµ»?²¨R׿À?WÓ7fÄÄ?úHúw Ç?µul ëÉ?|G—ã~Ì?Ò$Õ&±Î?<¦vž<5Ð?"8hCÍÐ? º¬ôÍÑ?Ú¢ŒËÑ?Zb´ÝEÍÐ?ÄulŸN5Ð?b¾’Ûg±Î?—NÖÝÌ?²€9ž‹ëÉ? ÐüÁ Ç?&ì—Ä?½àÞçÀ?j†º±è·»?BŠ‘7ùµ?tz²Ë°?‰¹“ôxè?’4¦Î¡?NíôܨЙ?Aå…„œÛ”?ÊV«¡›?lM¼¹ÄA ?¨à5AP"¥?à”t3"¬?Bµn튀²?ïÑOF"´·?üë}by½?®~‘hËÁ?äI¥aÛèÄ?R8ÇÔföÇ?¾£ÂC0ÖÊ?pºÌlÍ?N~>ÎÕžÏ?Ýkôl¬Ð?r?¼ï›DÑ?\f 5’Ñ?~±¸%’Ñ?B%nZDÑ?" Pç«Ð?ìOMIÏ?ÞjÍ?®Äñ‡ºÓÊ?O]ê‹óÇ?lú)Q¥åÄ?‘¤—åÇÁ?Ä—…q½?Ò²ZëI¬·? ’lR‚x²?š·“W¬?ª7c€¥?¤s-˜˜2 ?¬6 ©9…›?R—S^›?s}õ’Ÿ?±;°T‚¤?2,ñ„H«?®`öuû±?n̾í·?šª«Ùͼ?¸heKnÁ?íÒp@†Ä?qÏ[ÎÇ?ô¼&˜âlÊ?7úª Í?¬*±5ø2Ï?ô8KRvÐ?ZEß‚Ñ?†Ã%\Ñ?z·DÏ \Ñ?2 1Ñ?’_vÐ?üt·)3Ï?„ÍâjÍ?&3¡ØImÊ?çhÐ%YÇ?Ìý¸ø†Ä?ÌG59oÁ?¬TÂrϼ?Uªéœà·?ÌÄó”ÿ±? Œ*Q«?ºÕqHyŒ¤?aصíÓ¤Ÿ?ÔÊN 8›?ÓüïÕÅ ?n³¬Ñr£?•8UäÜ£¨?ä#á–Oû¯?¨öÎø›´?ìß•oº?ÎçÞ÷¿?È·¥#Ã?ΛKBXÆ?ܘ¾!'|É?bsHpÌ?x½K Ï?1? ]ʬÐ?̱&iŠÑ?Ü也+Ò?,+lm/{Ò?°Âd {Ò?`9Z+Ò? å‰ð÷ŽÑ?OÉÂï«Ð?F|ÇÏ?ËÈÎ)mÌ?PŠ•àûxÉ?¿é~î°TÆ?ü‡Ã?Öb=¡î¿?¹Òª_©÷¹?Ì{½ú’´?bqþðGé¯?¶Ü¬5’¨?|ÊŒ4a£?†kùN-¶ ?€§5€@ ?d~ ÕB¢?«ë/Æ*è¦?0%OqK˜­?éCÖ¸#³?Ôì×>¸?›]̓õ÷½?ëV;û¡Â?h›h׿&Å?É‚[ 7È?Rbøl,Ë?s°Rœ ·Í?k=ƒlêïÏ? u[ýi×Ð?J7?ÍpqÑ?sÓ"ÀÑ?½ÑæÀÑ?ê…î.pqÑ?¶Ër×Ð?n$ ðÏ?ôøt£Ð·Í?ø÷sË?Ð;Ô8È?FFPx'Å? {ê5k Â?°ïŒú½?rú|6œA¸?7¥lw«"³?ük”Ù ¡­?}Á4…½ò¦?F¯e=O¢?@þ–ΤN ?ó;( ¢?¡Ê±°q¥?xÚ˜÷ª?7­¦PW±?Ÿœ®Ó*¶?aÏ,¤pÈ»?Sà‚AýÀ?‡xxÙBÄ?Ÿ0'–›•Ç?¡_q›ÕÊ?Ǿ™ãÍ?²ŽW«QÐ?<ãT®x{Ñ?äY*M°eÒ?lfœaÞÓ?«¹ðJYÓ?ü WpñXÓ?pö‘Ó?F¬WÝ eÒ?G£s†zÑ?áGVíÛOÐ?à/€•àÍ? Ô5ÒÊ? ͪ ¢‘Ç?Ãæz>Ä?[UøÀ?øk’¾»?V®”j¯ ¶?ªØJ#M±?„˜ŒÐ°ãª?‡´yÇ^¥?%ãØ¡{¢?`~í×Ì¡?ù¾N¦£?ì¥H¨?¨î€kxù®?†µµà%Ù³?¥qp)E ¹?0§ ›Ø¾?UüO,@†Â?Bãja6³Å? åO€2ÓÈ?UõSO¼ÆË?DÜ´@pÎ?7@ZÐ?t¬ƒçˆ>Ñ?i]ÓcèÛÑ?Ù1“Å;,Ò?%lJX@,Ò?sÿ«”ðÛÑ?^sª>Ñ?ñ(ÃEZÐ?*°w)pÎ?TГ[ØÆË?l|X~hÓÈ?º™•”³Å?Êé½ÈÖ†Â?æ8SÖ\Ú¾?Úf*¡Á ¹?€cöQƒÜ³?*‚U˜:¯?ó1óS¨?²!:—³£?ŽÉIÛ¡?;šO_¢?¿~!5‘œ¥?6ú/ƒðx«?ŽæÛhH˱?à ÷ ‚Ù¶?nú9¸·¼?ÈÑ‚ÌÕ–Á?£·DÿÄ?«QtÈ?Õ3'´ÕË?ã±ÎeÏ?´’¢##îÐ?P2c8$Ò?2^ÇÁ7Ó?ڎ˹¾Ó?J³Õ¡ÎÔ?j[ ¼Ô?´ðöÇ6¾Ó?+µ“‚Ó?*¬˜‡ö"Ò?ê2Þ–ÄìÐ?°GÖ ÿÎ?š7KËÑË?&1l!pÈ?[·S _úÄ?€ØbŒ‘Á?êç´W¬¼?îA‚ôüͶ?âQáɰ¿±?*×^Cb«?X‡¥?ì3ÂXÑm¢?ª”ŠGŒ¡?+ê·¿J£? ¦RO¬ø§?ºÎ¨dÇ¿®?Z‡R¯Ñ³?(y"޹?¯mÕ™\¿?€®´G¸Â?.Á£öFûÅ?˜åþ›1É?[(Ò¹:Ì?ŠM¸ˆá÷Î?*Û“Áª¦Ð?P:!K·‘Ñ?FïÅ_Ã3Ò?ŒÎ†Ò?è߀<†Ò?Иó¹Õ3Ò?|Ç“«¸‘Ñ?dܫ٠¦Ð?OÔ‹Ã÷Î?¼ûø‡:Ì?¯-˽‘1É?­…†NaûÅ?6†¢™¸Â?fû’œ¿?p¦Å1œ!¹?6JÂÀÔ³?Ö‘öXÈ®?úS¼¨?jxX1Y£?q’ß\¡?§1ޤ–  ?ÇŒÂdi]£?M‰¥ÂÛ‘©?VqRUÅ ±?Œ.„Ö [¶? >–äb¼?†(&V Á?ƒ~t߇/Å?øÔ¾7€ËÈ?V†­üñQÌ?èbaV¡Ï?Cµ0ÄMÑ?¼ÆíÒ?¤dK•ˆÓ?«t›í;Ô?{{á”Ô?<ª”Ô?ùv †;Ô?þñAD½ŒÓ?bk˜FæŽÒ?`¿~“KÑ?`ì;À¤Ï?Æ!›MÌ?ú:jÆÈ?8“¬ä *Å?q(yr^šÁ?6j5³r¼?Tý FôM¶?íËQr±?À)°gºw©?¦…@ï¼D£?ÄׄЭìŸ?e—€·Õ?ŽÓô<2™ ?€îðŸ_¥?Ì›à¤N¬?2ˆ*ì[¸²?6¦Y­K/¸?àbë—§S¾?$œ¨MsÂ?oôŠÒÅ?ƒœž†1%É?éQrIÌ?¾[!WÏ?w3ðQÅÐ?špîºu¸Ñ?=Ë¢òO`Ò?à št ¶Ò?k d¶Ò?½’$Zd`Ò?’úBÓk¸Ñ?·³ÜãÄÐ?㤃ýÏ?ð)gIÌ?RÉÜÏÖ$É?*›¨ÕLÒÅ?9jIDsÂ?Ýxý3T¾?¼²¿·0¸?¦ò7ﺲ?"·Q&V¬?Xrê%k¥?ö±‡ƒ¨ ?Æ;ŸÅû?f¹´4`•?z°ˆú¥?„?Žk+!™?Ÿ\À†?²[Jû±©n?Z’s ìU?°½š8Gs?téû0³?H!3j‡®?„(Iz訨?W¯c 8²?¾õ^x‰Ù¸?}ßá«ô¿?Ì%ÒE Ã?^µR.9Ç?ð3/S Ê?8’çXé²Í?Ð8Ëȵ(Ð?ÖËIž0Ñ?3|a)°æÑ?F¤:Á¹CÒ?àe×ÁÂCÒ?5˜¸O¥æÑ?ü(`0Ñ?{" P(Ð?Ž˜)ã±Í?íæÞÍ&ŸÊ?6äšÕð7Ç? ªfÿ ŸÃ?LnG4ò¿?̇M‡à׸?wý‘ÄB7²?>‹V媨?–ßõ¸?,c\Þ?yÝ"ôÜÓs?¤ß¦±^üX?¶5fôr)”¿xäÀ8Cˆ¿º\2l›¥`?äíD³¡¡•?…¨j+í¦?œÀtCõw²?J”ÂÏ9*º?¾]7þ|"Á?´#.…½=Å? rû‡ï?É?šÕq&Í?M"¬3í1Ð?,âêÃ,¡Ñ?»Þ½D¢ÁÒ?ž‘À$;ˆÓ?¡1Õ²‚íÓ?ÄýYPíÓ?‹ü¡‡Ó?yŸÇšÀÒ?‰™/Ô¯ŸÑ?Ë©„jø/Ð?â\ÄKþÌ? Ñ ‹!:É?ŒõQý6Å? ãYÍÁ?ý+0ò º?•Ü^(e²?(ÜĦ?Xþî L•?b­Ç²Ü[?î»E„ƒêˆ¿Ïx’"ds”¿Ú‡×‹T¹–¿@£7ÓÊä’¿Pøt¥s<¿äTâ9–|?ÊõP*”›?IYaQBª?ç Yúþ³?´À—+Vm»?kmA* ‡Á?ô;bCªIÅ?já@ØÈ?L|Ù¢÷ Ì?ð·H3 ÊÎ?Åé¿CxÐ?ãÓeg6Ñ?FÀ_Ùë–Ñ?3{þè–Ñ?¡Çráé5Ñ?dFgåwÐ?´!êÈÎ?”³Š Ì?“F¸¶xÖÈ?±IomâGÅ?X©Ìa9…Á?›eÍzÆi»?4˜è½û³?Ègõf"ª?ïñŽ›?"Œ´M |?f¨ðÕì¿A{À“Í¿’¿l5²Žà–¿¸ Z¼©¸©¿ô>B”¥¿@Áv³ ¡œ¿&Ѹ “ø€¿C^0áŠ?@['”Ŧ?߆wDö[³?Òú Yû?¤–Äg$Â? qeZ¥MÆ?èÓÙ\Ö5Ê?%ŒºsÙ·Í?av.0YÐ?ø8€¨È?WÅ)ö½ÜÆ?È=AÄ?oˆÎå©îÀ?\X#€£ º?›*ë¶JU±?ÒÝ‘Û! ?%ý3ó–v¿È¨äˆx}¥¿Ö3sO•³¿J‡`)G˜»¿@ƒ3ìd=Á¿X¸XzýÿΧs5òÅ¿âvÑ”†Ç¿¨J ’4Ç¿P%2î~Æ¿xÒ-,äÄ¿y¯i"y¿ZuûGV¬¾¿~æýœˆ6·¿2"ðéÌ·­¿?.=kŠÂ—¿ØÏ cE‹‰?»©ê´p\¨?†+]\9«´?öù”³×R¼?çoyRðkÁ?ð$JüÃ?«BS‚ŸÀÅ?ñù[ "§Æ?Êß*—¦Æ?@bèF¿Å?ÖW!£ÛùÃ?Ö×_3²hÁ?t…û‘K¼?ø“’at¢´?«O„ÑÒI¨?›·Äñ>‰?WÃQ{é—¿˜°ö ‹Ì­¿ô‰!nÐB·¿Þ;Ë«^½¾¿©l£ü†Â¿žˆý+ùÄ¿1)•7*„Æ¿ºWÚîöÇ¿žmԘͿ<— ŸÿŠÌ¿NnHZð‘Ê¿”ÙÃÇ¿…!èÒñ<Ä¿›ŒÍ0ÂÀ¿4¼8Î|(·¿oÔP+¢«¿«í·¼5KŽ¿nPé8Ë —?\rZ{­?ž˜ø¹?ζ?{=c§½?D œ üƒÁ?D§¾Ñ{]Ã?]“ù–NÄ? “]NÄ? ¥ÇsÂ[Ã?tɹ Á?&7žkŸ½?Œ· gcö?'6§Å`­?jLIÉÌ–?P[”ñî䎿}ªƒF«¿×±í¿‚B·¿NÙ²ñÐ.À¿MÝL{nNÄ¿¼†*6cØÇ¿ˆ‡˜š¨ªÊ¿ÕÛë8ªÌ¿ûro§ÀÍ¿À•žêÍ¿Rxaþf&Í¿T .gAwË¿“¿¥ãðÈ¿í8÷ªÅ¿+üÄëÛÈÁ¿å4u¦Šáº¿ü™‡B¥œ±¿°­wx2@ ¿žÑ01Ms?°ìÒ¹¤?' vòõ±?mPHR¯¹¸?éIƒ ¾?&äñÚÀ? Á1OÿÉÁ?>*#T]ÉÁ?Y ¬}ÙÀ?wªæg¾?$»}±¸?’׬Òì±?Êdâsåò£?†Ö¥Y~˜r?êÏZV ¿~¯”8§±¿ï° …Ü뺿æ%®sÎÁ¿Â±dm[²Å¿!@Ø»IüÈ¿êÒß(ŠË¿Ã7Õ*Í¿ ~ƒv^ÌÍ¿LlÌÝGZÒ¿µúdO4ÏÑ¿`”R–JÌп­äwO…¸Î¿ä‘\öË¿: qKàÆ¿³ô![4¿ÇB²}‡º¿\1Ê8x{°¿º ±ï«œš¿Û0¶¹…µ„?÷/-meÉ¥?El׈ò±?\Û•Bö{·?} ¼bkK»?ò—›Ý<½?RatäÐ:½?ñ˜±G»?HÄ“çÓu·?Çkt‹êé±?í±Æ³¥?Þ2 F„?Ò(„ßš¿—#V³7°¿ºó¢ªžº¿N“º<°A¿j½iŠ©ïÆ¿¨4ÂÆ¼+Ë¿7¼µÉûÌοT-ãL-ØÐ¿T~óÝÑ¿dâÀ®iÒ¿$ˆ §×{Ò¿d¡HÒ¿F?vÖú1Ñ¿>Gí+'ÂÏ¿,v9â­\Ì¿KÆ…ë’UÈ¿ÝN×(Õÿ%†…àû¾¿ÚÖ è;?´¿1†ÁÑ.¥¿|¯s@#¤w¿&|BaXóš?ð»®Wév«?P¸†`;³?œ†ãU·?ÇLMnó¸?géÏññ¸?TW[)Ä·?·½fú½3³?¢ú£3b«?ôœôÇ_Áš?\¤^óx¿î†J¥¿ÞŽ-L´¿¼,žø ¾¿v$Ê8¼Ùÿ×Ö·LYÈ¿ˆ1sû_Ì¿à*ýqÅÏ¿’rc²Ú2Ñ¿­,ß~=Ò¿ X|Ô€pÒ¿°AÇ$ùÕ¿"£sbkÕ¿ú³ÚåbÔ¿ÊX{ê|êÒ¿ívhÁ3Ñ¿ááµà÷ËÍ¿©#žQºÉ¿Y‘f9ðÿ\I"r\‘½¿–5}@z³¿Ûg¶[ú£¿ÑZÑZw¿n¸¾"Ï$—?N%1”~ò¦?[e€`ºÆ®?#dÅÒ•a±?ô Ú5`±?¼ƒ™õã¾®?=Äû×àå¦?éÛƒŸ—?ü´.C?x¿R)ûq8¤¿Ï&À:‹³¿à[Ì0e¥½¿ÄÛ–âûÿQÆ ¼*É¿&zZÛÍ¿¿ o¤öÑ¿oõȾiôÒ¿ED’snÔ¿;m]K‹wÕ¿ä(/e‹Ö¿¸ƒYÖ¿öïÿ¦Õ¿8‘÷ê¼Ô¿ðÛ:Ó^Ó¿Îc{Ñ¿¼Ï‹¤¶Ï¿P”µòïjÊ¿é•]y/wÅ¿ŽÀÐÀæfÀ¿Ö?Ê[VÙ¶¿š7Z¥÷調²`ߺÔô“¿@£Sö½?¦ö×%±ˆŸ?$§¤p€’§?øµÎŒ«?”'sˆ«?»Ã¹0G‡§?–Iù*ŸbŸ?:Âë U?aaÒþó4”¿r QSW «¿p?Ïê¶¿¬Š¹•nÀ¿ƒZzÁ$}Å¿ΧÈÁnÊ¿C›Ð.Ï¿‚íttiœÑ¿€\¢ˆ\Ó¿Õ'üͳ·Ô¿L†ù]U Õ¿2E2] Ö¿”"OËÙ¿zÅŒ4þØ¿Jr2x5ñ׿.(xOqÖ¿^/kòŒÔ¿kp{VÒ¿­9GžâÆÏ¿ÆÛœ T—Ê¿ý{dÐÀPÅ¿Ž¦jìt&À¿Z¼PeK•¶¿†…P³!²«¿R_1|T´™¿€êô.c¿»NŽ×þI‹?ïã;ÁõÏ•?ÓmSÊ•?P«¾ÿ*‹?¸‡Í´[úc¿îüNÔ×™¿x¤ó¦É«¿ý¨`}£¶¿»°,ý.À¿‹ëSÎZÅ¿!å\ÿ¢Ê¿r¯ñFÔÏ¿GÁ^Ò¿àã°†•Ô¿Â>§¾ãzÖ¿)½¢ Áû׿:#¦ë‡ Ù¿¼ÇEjƘٿ¤¾Bòl¦Ù¿öë[ €2Ù¿NˆÒ<?Ø¿-õÃvÖÖ¿†¸MpÕ¿TÀaéÍâÒ¿v„Ïð~пjx擤æË¿†f²ìš²Æ¿…ØÊ¡•Á¿ðÅâpr…¹¿©ÈšÔ°¿mÔ­ƒßÛ¢¿QœÕ{茿(áÒB1Y?ÑÃ3ÀØrƒ?ý޾Raƒ?°«0~-aW?ÈÄ4áLF¿ˆà¾Ëóü¢¿ª†Ôèè°¿¢?hïøœ¹¿+’ƒ¡Á¿ 7,Û%¼Æ¿ŒÃÈ&YíË¿¸´ ö—€Ð¿xJÔÒwâÒ¿ SÄmÕ¿û%9\ÑÖ¿ªÍ.ä7Ø¿……HÓÙ(Ù¿²t©Ã›Ù¿ÙFã¡ûÜ¿¤ lÜ¿¶ÆaO[Û¿è|f›ÎÔÙ¿Ôvlç׿ ¼’jð¥Õ¿@ÿ Z&Ó¿ ¨ëíпOX˜àlŸË¿f×SXYÆ¿…•_$cÁ¿AêL;Ú¹¿,7Ø>^E²¿¼ê…÷¢¨¿9ž†)q ¿æùÖqÀ‰˜¿ÛðRZ˜¿,ˆYNy ¿ÂæqI´¯¨¿U¯àf7N²¿ÖBªå¹¿êûf„6jÁ¿PçU×aÆ¿Bšy©k©Ë¿Ø“™͆п¾ç}ø,Ó¿ë"v‘k­Õ¿Q‡¼Êï׿ÀÔÞÙ¿&IÅ.ueÛ¿Žgî?wÜ¿G¨ØdsÝ¿6#ù*0Ý¿„¯¨;BšÜ¿†jÊ—DŸÛ¿ŸSR¯,Ú¿˜=Á#QØ¿;ÃW°áÖ¿ü§Zµî«Ó¿¸¬‚]Ñ¿Ì9Ó]ÍÌ¿MÐᙑǿßhì¡Â¿›ã@_¼¿jÑ© fÍ´¿"»á µ­¿]ž‹È«ƒ¥¿œEÍKX¡¿îwp]¡¿”/E À“¥¿Y#Ý—Ñ­¿HJ¡‘ãá´¿æ\2Xz¼¿ H3ÌO²Â¿ =€Sj¡Ç¿è=®$ŒÙÌ¿,ZPˆÑ¿Æ[žF™­Ó¿Þ÷1ÛÖ¿óÊNÀLØ¿S÷ßâU$Ú¿”Uî“Û¿‡gÇq¿ŒÜ¿(–_€tݿ̀C à¿êÞ~ܙ߿—ĺ›Ì…Þ¿,‚‚ùÜ¿u‚02Û¿,‘U¹Ø¿=Ù^.Ö¿™ÑÕ}Ó¿«‰zc¿Ð¿VCMê! Ì¿C° “Ç¿Tl…§_‡Â¿œ­tí¨U½¿D}!Ü0E·¿dÉﳿt×[šOø°¿l« #­ù°¿lâV²e³¿r’@'uK·¿àº&ù`^½¿qKßå¿¢oCÇ¿]…p„(Ì¿ºû¢RÄпª˜º–Ƃӿšð’.á4Ö¿DëÆXÀØ¿6üï\Z Û¿úû{Ý¿v‡²â˜Þ¿*Üh]Ž¤ß¿øTgZ࿦p—ñ à¿WþÙ/ÊÂß¿F^o¬5ÁÞ¿BýØ(êEÝ¿òOò°¾_Û¿ùÛŠd‰!Ù¿cšü·‰¡Ö¿HªøÓ¿ÂÔ ý@Ñ¿0úš…¨+Í¿¾:€1#È¿‡fUû¢šÃ¿XÒ‰ô7~¿¿ñ­ n¹¿‚1ß]Aµ¿F'åŒ!³¿Dh%³y$³¿Ò³ËSJµ¿ÒRIŽó}¹¿`=A–¿¿lhÇý«Ã¿^féH;;È¿¸ÚÉHBÍ¿…àðÚXHÑ¿—‡šþ.ýÓ¿«`Åw£Ö¿x/š,N Ù¿äí ›rZÛ¿Ä*æ:Ý¿&å`[°Þ¿Tb“ôþ°ß¿ÌÀ;Í࿹Dap‹á¿UÕeHé6á¿C _«à¿È‰ 8®Ë©º¿â%‰ì«º¿9 àxÖ¼¿… ¨¦D‹À¿p·T ¡Ã¿²;sŽÇ¿¦P5-Ì¿×Z ¨Ð¿G{¡±»bÓ¿ÀŸ¶Í+Ö¿2`˜$èØ¿t]¥ }Û¿r¾¦•IÑÝ¿4\¾VÎß¿`¨@Ͱà¿~@ÇTù;á¿nw¯¼)…á¿´«i—…‰á¿%º©Iá¿ÈøyõtÅà¿BIS#'à¿Lt4gIÞ¿€y¦ŒÑÛ¿nq ÄFÙ¿²œG Ä‘Ö¿‡^3ÙËÎÓ¿Ü"¨d–Ñ¿*\†ŸͿأÕ'yÈ¿F&zrŽÄ¿6°$âyÁ¿Éùee¶¾¿ÉÊÆª<޼¿7ò#s6‘¼¿„œh±¿¾¿µíóÝ‚Á¿Ž÷¤šÄ¿$龄‹È¿¨¹;ƒ.Í¿|u˜…b%Ñ¿3³µq×Ó¿²·ä“—Ö¿œx%/èHÙ¿—é2åEÐÛ¿VñµÞ¿Œ}Múüß¿2Ÿ³I·¼à¿8oÎàü?á¿dÏÀ+ƒ‚á¿ÜXl”±â¿J$Ú…6h⿲ŒGMÛá¿V$žŒá¿—#üµ࿪Þ{º+ÅÝ¿B²”oO)Û¿0º‹÷TeØ¿€Q#ÃE”Õ¿þí]¹¬ÑÒ¿~¨Ë‡8пlb dÄË¿ ón_ËÇ¿ˆ@Ѥ¬Ä¿DS»•†Â¿RuÖ÷|nÁ¿žùÿoÁ¿¶ñ‰4_ˆÂ¿þ[èv¯Ä¿qÎ sÏÇ¿¶…ìæËÉË¿ãÓ„<Ó;пÆÉŸV§ÕÒ¿6…5ú˜Õ¿ŠÂQµÌjØ¿ ÍÏ‘/Û¿”UU¡8ÌÝ¿úû|œ࿌µPÅá¿ÄI}pÃßá¿M^üâÖl⿟†}j¶â¿s»D8ºâ¿åÃÿÿ4xâ¿C§U¤iòá¿ÅQeæ+.á¿ÈÍ^÷3à¿wÑîìÞ¿ñˆŒ…S‚Û¿½ŽhÇòÄØ¿zZÝìøÕ¿³bwA÷9Ó¿ § ÝH£Ð¿€\Ì¿°r(îÆ¥È¿mö Ýü‡Å¿SàôÓ·bÿ¸îë¤HK¿a—ë»L¿+9=y5gÿ1ݽ@ÐÅ¿ØðÍ#Z±È¿ð"ë4­Ì¿©&8š­Ð¿LIï· DÓ¿r!¡©Ö¿1˜}ÊØ¿4bø:…Û¿¼mJYÞ¿¢9jÞ0à¿—|ìͪ)á¿ –}׿ëá¿L\*†bqâ¿ÊUë‘´â¿Ð~+ÍРã¿!VM¥ªVã¿`çj•Èâ¿ÀÕ]Ù4üá¿n1ÌjDùà¿qM%$“߿؜´ˆYñÜ¿¦jÜà&Ú¿j×õ•O׿âl5Ñ¥…Ô¿ržæÑ¿sF>/šÏ¿!Ÿ×»KË¿&cXhéÇ¿5ª׽ſh4ݢĿžÍË%o£Ä¿é«Eí¿Å¿rÃ% ’S׿©GÀ“0,Ú¿n‹¡z÷Ü¿ÃÕ8ñšß¿ˆ¿ß$ýà¿Ìñ²dâ¿´¢ˆ,åÌâ¿Â5GäÖZã¿û£Ôò²¤ã¿H”l¨ã¿mÃôãdã¿á5Ä„eÝâ¿LUŒñâ¿,ÊÇ<á¿\hD',Üß¿â#å¹ Bݿ݉ÅÑ~Ú¿ù0ÿf«×¿K²æÔ¿Ÿ›Y}eIÒ¿AF2¼ÞÏ¿‰ ùÔ|ÞË¿7{ ³¸¹È¿&ã4¤Æ¿È¦óá¹uÅ¿ñÍà wÅ¿ÿ¯2Á“Æ¿Üwk»ÀÈ¿JÏ«dzèË¿Æ× ¥ëÏ¿ ^ÕäýPÒ¿ê£ýÆìÔ¿™E¼]°×¿áƒMÕ«Ú¿x‡„²CÝ¿¥ücEÛß¿¿ÿÏfῨ‚¥¹â¿H¨RÙâ¿Ñ™fxF`ã¿Äöìê£ã¿aE.Eä¿à¶à-úã¿&:b%kã¿.^øS¼â¿î žw™á¿‚ø—§h࿽íµQ*Þ¿¤?veY[Û¿ÜE •¿~Ø¿MrÀò°Õ¿pF'KN Ó¿úC¼]ޫп:V>( MÍ¿òµÂÏl Ê¿DMz^ÎðÇ¿h(¾3»ÓÆ¿Šoã>ÔÆ¿(ø’SòÇ¿lè×zò"Ê¿=½R²PÍ¿§[L.6®Ð¿Ô²Œì?Ó¿„ ¨1*´Õ¿âVlúƒØ¿èäu`Û¿BÇÿ]M0Þ¿fˆæ©ˆkà¿frçigá¿Óø/¢â¿_„$”“oã¿ú¡f,þ㿸2É=Hä¿$q,Kä¿R¥Ò俵\Ñ¿†àœ‹¢Ó¿ü«@ÁJÖ¿ÔæêþÙ¿ ›3˜ýÛ¿ÀÞÉ[ÐÞ¿Ny±м࿆}«ïá¿+®.9õâ¿ç:ðÞåÂã¿OàøyqQ俘ƒ}4;›ä¿¨¨oØ»ä¿2pÕîXä¿+4;{TÏã¿|ÂŽ|Tã¿5ÅÀâ¿q1åˆ×࿘V¾ß¿ÓÒ ö}DÜ¿ASákÙ¿‹¹Üæ¡Ö¿ö1ŽsÿÓ¿@\ÚH)¡Ñ¿’ø ;Ï¿?oEºÔÌ¿dÓôâɿݸ†öÆÈ¿ÒªJïÇÈ¿šD ðÕåÉ¿^Õeõ…Ì¿¼ ˜¥aAÏ¿µ V\¥Ñ¿bM.¤%Ô¿‚Cš£¥Ö¿ôºÂÌ”oÙ¿ø"å`GÜ¿ºSq)ß¿N€g˜××à¿€4üÀâ¿»… ß­ã¿¢c´˜™Îã¿#õcµX俨)µxžä¿ÇÄvíWGä¿âr–ã úã¿ zרØjã¿ý7¡KŸâ¿ü)Š œá¿ÐcÉ$kà¿ 3#®90Þ¿©Ëšp`Û¿Uq¶ê‰‚Ø¿« [¹²Õ¿ Ý § Ó¿Ë@åœaªÐ¿Ld­J½FÍ¿ñ«9X(Ê¿˜ÐághåÇ¿|3ŽúÇÆ¿¦è…fÇÆ¿|ûPæÇ¿U¢¾Ê¿º:ý IÍ¿¾ÒWî«Ð¿ìAR®¥Ó¿·§;µÕ¿{ý®W¦…Ø¿Q¿`mHdÛ¿Ê$´£û4Þ¿vFd;nà¿ ^I^êŸá¿×ÌtLQ¤â¿œ »Zqã¿Ðº%8ÿã¿Æ–Hä¿d&+߯Jä¿| mjä¿Êè÷ö¹|ã¿:‘”)J´â¿ú’®…´á¿”-¨V‡à¿û·HKÆpÞ¿?“jD5©Û¿0*ímÓØ¿†Æc:k Ö¿XVšáœlÓ¿qbFÚÑ¿fþ8ÊοúO¶Ó øÊ¿SjÑ‹ÌÈ¿´ý“=ıǿPC=;§²Ç¿¼2þ«+ÏÈ¿xîâ¿CüÊ¿W†å»~$οž}ÝVÑ¿è)È pÓ¿p†8ÈÖ¿r“¤ÕØ¿¶yõ»ËªÛ¿atªqÞ¿±Ð2aK‡à¿=ú)ê´á¿ MÝ_—³â¿b2Ç |ã¿|gšÉêä¿ý”ÛGXKä¿%3u†£ã¿ÒvÂ,¾Xã¿x6j–µËâ¿31œ0Ÿâ¿• ¨þà¿Vf{ÿ§žß¿ôWØÞzüÜ¿KÔ9ö¬0Ú¿™Uz¿V׿¬r‹Ú¿ŠÔ¿*Í^4èÑ¿lHµÏ¿ž äP ˿Șa¤ÊÝÇ¿ a*øÌ®Å¿üͲڑĿ^ûk> ’Ä¿‚00s¯Å¿^êp&øÞǿڥk¦ Ë¿²†ž{Ï¿îZ¹ÀéÑ¿%úR¹¶ŒÔ¿ZÎÑÔ6Y׿ޒÂÂ3Ú¿ùÂ7VÝ¿õË (£ß¿„¥g·á¿4:Äjs⿘(ŠÐâ¿”(æÿã\ã¿OkÎOq¥ã¿äaÿ+x§ã¿BÐøb㿤}âNÚâ¿bn«”õ⿾/u.°á¿rb§×¿ø~û¢wÚ¿Oë¸9Ý¿}ð¸v|Òß¿vÛ¥Ÿ*á¿ò*â”â¿—Ò,PÙâ¿xNpAbã¿è“B¦ã¿ªúÕm‰´â¿®VK’lâ¿JŽ(|·áá¿>! ¯á¿lÙíÉà¿p.®CØÝ¿œqÔÿ<Û¿ØhìÿjvØ¿RØÜ\Á¢Õ¿ñðµãÓÜÒ¿äÙÏï?пߒÔ¥ËË¿Ô-þ÷VËÇ¿P$g‘m¦Ä¿#£Vˆó{¿ym?aÁ¿.{XXaÁ¿ù¯¸R|¿?Ö$‡(§Ä¿1ÚvÌÇ¿ªåÔû4ÍË¿–9Aù@пŌ%×*ÞÒ¿ ñ¥v¤Õ¿òHp+•xØ¿Ôv‚\¾>Û¿¸tež»ÛÝ¿Äßèù࿈Âùm3á¿fÚBƒÇä`X:Tp⿚5±B·â¿&ÑiNL¹â¿çnŸ¢9uâ¿  P‘íá¿ƦÛ'á¿¢^«Í+à¿ØìhÓXÞ¿úô…ÖårÛ¿%y£µ¶Ø¿]C>áÄìÕ¿láiŒ0Ó¿NvDп³³GÖ—Ì¿>J)»¥È¿²oðߌſãªCøjÿ¼€ŒóÿT¿­I©ÆU¿Z:Ç8mÿ-Єſ $¾¦½ªÈ¿*ÆeÌ¿ÃÜòõɠп’èLó3Ó¿(?ݽ.ïÕ¿aþkY¸Ø¿š§ºõsÛ¿­óX>Þ¿†±Ó)+à¿›È(¼Á&á¿ÕKsìῈq‹T_sâ¿“WVþ"·â¿Šo`á¿~þûÚ‡=á¿&ó˜õ8µà¿°ÔG½ÁÝß¿RÒ£)ÔäÝ¿ú×Þ’Û¿Jv÷ô¨þØ¿€ ‚ ŠAÖ¿½0¹ovÓ¿Õ1–ԸпE±Ë#nGÌ¿Þçåü¡Ç¿þ£ª†¬Ã¿<(¹WÆÀ¿† aW!Ù¼¿hfq2ü©º¿˜ ñ–ù©º¿69mGÙ¼¿üܳ‘À¿É³ÁAù¬Ã¿r9ÊzơǿÖ’ücHÌ¿õÀ#A{¹Ð¿²è ¾LwÓ¿)Ìdï«BÖ¿Êç 5!Ù¿ÑûGǔۿ؉‘bTçÝ¿JfTíáß¿œ‡`·à¿V”ü–@á¿Û¹ì²Ð†á¿¥[1ˆá¿Ô;Ðõ²Dá¿Ý2GTd¾à¿ƒ•k3µõß¿3ãæiÞ¿ØâèÔ:¹Û¿žú{£Ò-Ù¿P#USzÖ¿–b;_¹Ó¿ËôåÏÑ¿¼ã‰ËöÌ¿úÇÚ¡jbÈ¿¯ÝV9~Ä¿LÖ…š·oÁ¿"ÇÒÄ⩾¿àöC*…¼¿ŒÌüé †¼¿ÛFõÏ®¾¿Æº)«#sÁ¿9V„‘ý‚Ä¿ÏU§%‘hÈ¿¹¥¥€ýÌ¿õ­éž´ Ñ¿^É-¼Ó¿*â¢4|Ö¿œî .Ù¿ 1äܸۿ"¶/¸ÎÞ¿näGÕòß¿`„-uT¼à¿æº\Bá¿xâp¿L…á¿Ä§ç²à¿Fœ®š-¬ß¿¤ÑË)ʡ޿в©È&Ý¿ž\ÅC+Û¿>®m²€âØ¿'KïElXÖ¿ŠîÊBü¥Ó¿bk%ʲåп´ZšCeÌ¿¬)KlÃNÇ¿û^=DºÂ¿æâ}ñᨽ¿°%Ø×ºˆ·¿¶s+LP³¿Á¹Ëÿ,)±¿@Iâó(±¿îÌÕO³¿Œã/Ù;ˆ·¿˜ÊŸ`¨½¿#‚Ðäչ¿2ûNÇ¿xÊö eÌ¿£Ë8#ªåп)…©¦Ó¿"f;(†XÖ¿hË)ÖµâØ¿~f)«+Û¿`t Ý¿{93Áè£Þ¿—ñÄM±ß¿ÞwœFà¿ÛSF7à¿%€EÞ¶ß¿$:¢O˜­Þ¿F°}óÜ+Ý¿ï–j´@Û¿#·¼4*ÿØ¿bÏ~}Ö¿P•25¤ÔÓ¿`— EšÑ¿Ð6Àa>ìÌ¿¶Jº•¥êÇ¿†“@£“iÿ°p›õ{*¿¿&·ÝŒq&¹¿"þ}е¿›…™ë沿u1E­m粿P»ýäûµ¿v_É,¹¿ÊnÊku3¿¿À H€oÿ‡HàwýñÇ¿Ar¤MùóÌ¿Ø.€JÔ!Ñ¿lÕ‡ìÇÖÓ¿Ö ½!w~Ö¿eNo÷³þؿ‰¨C¿>Û¿ ? ôD(Ý¿ü’¨Û@¨Þ¿H,ׯ߿øbI€à¿H6þ¶Ý¿³›Bÿ„Ü¿ÍUN­w‚Û¿ÄZY©:Ú¿àV1ÉdØ¿™óir{ÞÕ¿¢§¸…`Ó¿å¾}ýéºÐ¿—Q§!IÌ¿à@NŠÂÆ¿–bí&ÒÃÁ¿Ö(PÞˆº¿h'̦ᲿyBitk»©¿~Ä©:q¡¿EÊd¦ålš¿3‹Ñg&kš¿¢1Co¡¿„žJe¸©¿[о©µß²¿¯9~†º¿ê^oóiÂÁ¿ bw6çÀÆ¿¡²‚ëe Ì¿„,Ùѹп_öTù9_Ó¿ºPhçÜտМ¡iØ¿\M,ÔڿĦT’•€Û¿b÷y|ˆÜ¿|-‘»~ Ý¿`ìÿWÝ¿†‚(…mŠÜ¿xRd …Û¿w½†•§ Ú¿WJ à&Ø¿ª$ fwïÕ¿ä²8WyÓ¿tL¸ÅÜпZ›M,ïfÌ¿ú|Îu)/Ç¿hE|ÁrE¿¦{ô³»¿&5 Â$0´¿ÊõO35’¬¿?ÃÔcq¤¿g²´_‹M ¿¡Òæ½÷O ¿:®)fMx¤¿;󅬿³2 ÌR8´¿|Ç‚¿»¿ü¥±ŽL¿£êÞH7Ç¿öAÔ,nÌ¿g°<Ú'ßпÌaæœWzÓ¿ §üñîÕ¿}ÏóE¢$Ø¿~÷;]jÚ¿|†ÝÞ~~Û¿Že‰‹Ü¿eMùÈÝ¿‚ÊÓ×Õ•Ù¿´_!Ù¿®ÝP§'Ø¿p‡¼¾¯¯Ö¿ÊNê²ÑÔ¿zª¸¦Q Ò¿–rFçq0пTck63˿ꥩ=4ëÅ¿[´\ó»À¿/Á¾±·¿H@ ~ÿÈ­¿kc";󜿎lö¹1Bx¿Ž^]yS„?Ceò2×q’?£D$-mt’?;¼|Ÿa„?ÒÕyŸÚx¿2ÏBz¿þe]€À­¿bò®‰‘¬·¿œãKaܸÀ¿œ›çÅ¿ÿÿ ./Ë¿½åmØ-п†Ï¿ëÒ¿%ùöcÍÔ¿¦= ×U©Ö¿’ÏOçÅØ¿HŽEÀVÙ¿šÕ=; Ù¿®œo{9 Ù¿e•²Ø-Ù¿e*úø]Ø¿—iq©Ö¿’Rô=áÏÔ¿ô.®¤Ò¿÷ñ¡“ë:п&Ï™µÁXË¿„kXU#Æ¿˜a!ÈËÁ¿ÓÅ=r¸¿^y`S˜¯¿F£5ä ¿Ë[Gæ]…¿ ˆ*–yât?’Ý0«¥Š?ÝÏ[æ´Š?~Àh{µt?µµx¸ƒ…¿²u³=õñ ¿Wg ú(¬¯¿8ÝÑÃ3—G4Ë¿_þù\ÆÈ¿oÉ…!à+Å¿e¼ †@+Á¿ÈÌ(IJk¹¿iò&[U߯¿?㥕䙿å¼AŠ?Ú8Àš8v¨?&"ˆÈO´?N<¦KŒ0»?&.7ƒLÀ?Äeß·²)Â?—j´¥fÃ?º§­¤Ã?ª‰b+Â?†ð®{*OÀ?®ã”ìÛ7»?à™×†1Y´?:´ºy¨?%cîx†Š?¬L@•󾘿©¯¹¹¯¿Â¢|ÄÞU¹¿Ê…  Á¿@ì'‚·Å¿âBBo›‚È¿hì€)Ë¿¦zžÅùøÌ¿rU:³2ÝÍ¿Ò÷ÎhoÔÍ¿& ·<ÞÌ¿D;»G@þÊ¿jeVJÈ¿®ÞÄ¿6üñØdÚÀ¿—×ÙOθ¿²ÀÄC¨¾®¿k |—¿qïKJˆ? êcĘû¨?f²òoås´?ç·ó‡08»?TóNµfDÀ?H/ž©ÿÂ?g3þW Ã?Ì9Ã?Pó8 Â?imi[EÀ?G…ˆ[Ì9»?$j½o¹s´?•À­ô¨?*Ï­ÅsÉŒ?Ã7=t•D—¿úÿYá§Ì®¿Œ îá£Ð¸¿Y¹­Š¿ÙÀ¿ÀÔÁ¹wÛÄ¿ˆFéÝ¥EÈ¿B™-öÊ¿ø^x,ÒÌ¿›*9£ÉÍ¿Œ/”þ)Ç¿>d7rVÆ¿9ïÓíÄ¿S@Ž_p¿½õ]’œ½¿:üae×䵿¤D@˜u•ª¿Ödzv˜Ž¿.Ô ±Ö”?‚]z!ɬ?òÜ^cà ·?îÔHûœÛ¾?`pó‘ÀÂ?^¸…TÇ?ÒŸ`õ|ØÉ?¹Í—a|”Ë?Ž!¿ÀVwÌ?cðÂÚxÌ?ër*–Ë?µ}ÃäÛÉ?Dž]—?YÇ?öÁXÊ'Ä?—Ï%!fgÀ?òE5úz¸?ŽZ>¦N¯?·ö§/«š?ÇRNЋ¿†zÊ?ÇǤ¿çñ®ípͱ¿Ÿ ¸¿ñBrµú¼¿ô@&¼'À¿ ˜áXõÀ¿Dí`NŒçÀ¿w¥é–Sú¿¿ ÐÛ`8q¼¿ÊŠ/\^·¿R3É~¹ó°¿Sy]r¦à¢¿¢¼bÑ*Üq¿pEïHtÊž? +Áïʪ°?~~¯ds¹?ÄC;ÇzÛÀ?ˆ_¦—’Ä?öä*¢÷ºÇ?›—Åù5Ê?NçÑ~”ëË?«±6ËÌ?œ›GCÌÌ?p©:úÌîË?[?=S;Ê?Æ&ØÂÇ?ìV¥«šÄ?³ÖXÓ8ãÀ?®¹ñ/°{¹?å H+ ¯°?¶¡•Qæž?Ôß…[Ôlq¿NÁÐ`Ö¢¿üVÿ|ñ°¿¶qgGg_·¿Zø–Büt¼¿±D>e¤þ¿¿£ÖÙäíÀ¿‡¯Ü\d ·¿•é2Ý#ˆµ¿ö4FÚüX²¿Qª¼¹H«¿ é‰nž¿êƒç9§^¿\fTZ+ß?Sá|²Ú¯?Zè¶õL‘¸?|n—p‡À?{E+³ˆÄ?…6]˜$È?ÏÃ9u-7Ë?—• ÁÏ¡Í?l*È”aLÏ?NXý¤/Ð?²!¼Í–Ð?ñÅL»®NÏ?Ul5²ƒ¥Í?×R'aV<Ë?Õ¸ÆóI+È?@<¿ç‘Ä?X8md…‘À?^ƒØ‹E©¸?®" °?Ñ>ï@až?¨ÞÆÉNU¿ö ߜĿ¼_ö;꪿S½‘ŠÎ%²¿Î¥užÕSµ¿µ,D¸ßÚ¶¿¤ªWJ»¶¿°;†fÿó´¿ 9Ȼш±¿eòÍgzF©¿ÈKÍ™¿²28^Di?`뜹¡?bBeºyK±?aar©[î¹?¶Åüõ1Á?GýÆŽÒ+Å?ŠóÓY¿È?äÃn|ÉË?j©Ë,Î?¤oé0ÒÏ?žXÛ”äTÐ?‰M”ä¬UÐ?ؘ¾üÖÏ?HÇÛîô4Î?Ü’â´ÕË?6à7ÐÝÍÈ?²  <Å?¸Cê?Á?ºÐhF™º?ض†Y `±?:=Çô@¾¡?‚»Ùp–j?ôea•ÍÁ™¿BXú¼`R©¿Î×¥ F˜±¿öC×m¡ µ¿Ï nâeß¶¿2Ÿùˆ&b«¿¯Sp4k¨¿D¬RA¢¿„Ï?Øh’¿14Çwtÿr?MIä  ?ÍÕ <‚F¯? J"[¾·?Ã"$“LÀ?ýÀXêîÄ?€‘¨ëÇ?ÛÍÛàDaË?‚—H’LSÎ?üéP®.RÐ?m8ßíªÑ?³9G?/‡Ñ?âãÕß›‡Ñ? Q ãÑ?‡4è˜'TÐ?Yv¸ÏXÎ?p,tohË?w‹H‰—ôÇ?3BÉÄ?+#›LÏ?’G5œ¼5Ì?ätƒ-ÍÈ??¯g¢iúÄ?PÔ£åÀ?Øß™2v¹?Ê&ÛqeD±?Ý žW £?ù—¸| „?vö* Œ¿pþðdt• ¿Iµ4/¿W§¿¬ùeIï«¿s8dxšv˜¿žˆÂÊW’¿°Ö7’?Dy¿ÇÃ3éb-†?õ$‡oN¤ ?#禌tº­?ü4õ’'¶?d)ì°é½?™ãëÂ?»ì€ÐÆ?¥¨A#}Ê?FÐ/8ÚÌÍ?tI ROÐ?>ð |/kÑ?nK3•ò.Ò?<8ò>“Ò?z™u“Ò?»'70Ò?”“?mÑ?2lÖ 5RÐ?ÌmA_ÔÍ?ò¹`݆†Ê?Š™-NíÛÆ?°õsÉ1ùÂ?œè#/ ¾?ïúx¢N¶?½4ï ®?0b s¡?üe HBˆ?+õžŠt¿ñz+~’¿0fHø–¿Î¬ðj;|•¿‰UM÷«¿Ü´<.a¿Ÿ>d4{ò?óÕˆúj£?1·)ÎFd°?cáô‡É·? CÅE¿?tË­¥¶ÉÃ?Rƒé“[¯Ç?²ÊYË?BUÖƒ¥Î?ZúgS¹Ð?äyPÓÑ? ¨ve•Ò?¬§ËùÒ?UÂK–AúÒ?½Ò{3)™Ò?›r†¹ÙÑ?ÔìëΖÃÐ?8t–.ÄÎ?ê­çêz†Ë?$ŠŒ]àÇ?ÌT˜`ÆñÃ?âøþy©Ú¿?¨‘_ëö·?°û—Ed°?A 7ü€£?q},Ÿ?tšŒZeÝe¿ òÇûü¿R,mО—¿0m« xÔ3¿zâ˜ÍUv?MÊ‹Œ‘?LZPdÑã ?ŽU\W‚«?»B‚´?n¡›a×üº?W¿!U]4Á?<^OàùþÄ?\ãù±¸È?ÎÕ$„<Ì?ôAÐugÏ?xçô ù Ñ?iåÖæˆÒ?i¼÷1Ò×Ò?~›R]’7Ó?Þr{o8Ó?!ú©¦ÙÒ?ÛÏIw¦Ò?¤ ;ñÑ?F"§”2oÏ?‡Á/FÌ?ÆzµxÄÈ?ä¥uc Å?Œ šŠ"EÁ?þ=ª´š$»?RcâkÑ2´?#Á¨çó«?…²–o¡? ÆÌÒÏ’?šoÑÌÛ}?Hx|b? ©6h®f?înH2y‚?ÍÏ’ l•?Ú÷ÒA°g£?PGom^®?æé­—µ?—_PØ®¼?ÑôŒþâÂ?ð×8>ËèÅ?ìgö£ ¥É?~Õ¯±(Í?–D-½(Ð?„åx€Ñ?òžE•ŽÒ?ûøÉüçHÓ?çŠA(¨Ó?©Ò©Ó?‰4<ïLÓ?:»H‹®•Ò? ,Îr‹Ñ?zë˜K%9Ð?è5ðWÍ?ÜÛ†QÚÉ?¦‰ø†;Æ?á©®€a9Â?þz gß¼?€¨¹µµ?ŒX_qÖq®??ʲŽK£?Xöx¦J½”?Ý5RÇ«?*°”ªÒÇ@?îØ§ÛøÙ‘?¶yš§—?üÁ)ö ?l:ïÿ'ç¨?"‚Ð놱?| ÷4„·?ŒèSŽ0¾?.´wØg¥Â?uç¶ETFÆ?dr?×É?:LÑÊ>4Í?B9_M+Ð?ES‰e“hÑ?'ª9ÕwlÒ?1Mø8¶Ó?®&10[{Ó?Hz±Ì{Ó?Ólèœ!Ó?NLÏ[šnÒ?-”kÑ?:„Ìm"Ð?V£Ô>Í?vÅ÷âÉ?nüŽŠTÆ?’"Ct?¶Â?ˬtSX¾?¨vƒx³·?°ÝèH×¾±?Òõ2i—m©?W_…,Ç™¡?Ä.#H¤˜?š™pbâ©“?E¶¹RÄ=”?–}à¨Edš?lGÈÕh £?~cç¸`«?ä­kêñ²?âºø±¹?íwÆ…ìâ¿?ŽbFŠÃ?{;yÝ2Ç? ûK^ÀÇÊ?ýõ4<&Î?<̆ŽÚ–Ð?Ò¾zqàÑ?v¶Ã"sãÒ?¡ó –Ó?ÿ)•ÑñÓ?œoóÓ?€fsšÓ?n·ÿ1êÒ?VK=™…êÑ?"Fÿoå¤Ð?v½;ó¶JÎ?Ö{ˆFïÊ?`Ò"UÇ?¦²ér¥Ã?®!²æÀÀ?èÕB‘r,¹?çÎícýô²?îÙÄ<«?ê–YÀO³¢?>zO Û>™?#}­‰—’?ÚýÖ”«I?2Éf¡?ÞN(u5¦?5giûÊ­?½|‚PÁ³?Þûj„ð~¹?vÌøÃÖä¿?ÈûblZÃ?½¤Â™¬ÔÆ?^ŸJÃ?Ê?HVå"[yÍ?ÏgŨ®0Ð?l1>gkmÑ?£$ÚEŽfÒ?ȃYbÓ?ðㄚ°?ž;‘.eµ?~<Ç»?½“çYÄÀ?bš·ëê7Ä?yTx»Ç?ßN+Ë?|P<ÒggÎ?® Y^¨Ð?SÜ‹Z}äÑ?xú.5ÝÒ?Œ-"pɈÓ?Ù ŽÌàÓ?@ÄýæïáÓ?üh,=ŒÓ?å¤ ¶ãÒ?drîìÑ?ŠoA ³Ð?^/X’ÀÎ?ò烧GË?§„ê<ÔÇ?à@âm"LÄ?ÂH~ ÒÀ?Ô»7G¨»?æ¾dµ?Íàû¯?ŸOaÔ§?:"i»¢?tž^´+ô?8Í¢žc¡?¬CJ¤¶£?ÞØMœª¢¨?¤ Q½íê¯?YZªÏŠ¡´?Ü¢¡xÕ&º?}ææB'À?¼,ÌmÃ?8žš‹ÆÆ?öœIÊ?tÄ-ÄZ*Í?‘s»åõÏ?`¦ÿEŒ+Ñ?¾< Ò?›;•w\ÀÒ?E¨ýgÖÓ?äï÷H?Ó?2B^™ÁÒ?<˜4Ò?Zíi|.Ñ?u •ŠýÏ?’yµÙ3Í?|Åq¦¾Ê?¨lùÎÔÆ?ª¯`~¢}Ã?–A‘D–9À? –ÏïPº?sûÙÑ´?²wÜS°+°?ÁzˆAû©?ÏÀ†[®7¤?WBgƒ¡å¡?šÒ¥BQ&¢?ÅA4xû¤?Q›Ó]ª?êU¿ÿ±?y—–¢àµ? åM¦Œ»?±cʼnðéÀ?€•ô€¥<Ä?{×)žÇ?Püdì©íÊ?È ^À Î?œÏÒ lÐ?ŠpæÓœÑ?VeM\ŒÒ?Bq=–1Ó?ü"šVH†Ó?ch <‡Ó?Ù~•8y4Ó?z`!Ë2‘Ò?Ì\’ö£Ñ?+\¢ytÐ?”àèýHÎ?ÈfoË?ÙÈú5°Ç?ÉÎ6˜ KÄ?ô–óÀ?Uû¹žs”»?§®¹RyÛµ?œJk|¹ó°?ÆÞâTäª?lVÒÿc›¤?5M­¯¡?ËpX’²¡?’Ô<é)ö£? ÅØÔ¹¨?Hk‡l#ů?²ªŒÝ†g´?½zዾ¹? Ç¨’{²¿?'‘O–Ã?Ý£}@Æ?³ºuø8nÉ?ùw¤ÂmÌ?ÎìF·O!Ï?½ ´·Ð?3æè‚žÑ?㊣Ü*>Ò?py˜¿ÈÒ?®+Ýú,Ò?QØŸ\?Ò?€ÃÝ´‡ Ñ?Õð…ÈܹÐ?²·c¸(Ï?•Ÿ4°ívÌ?ø¥–¿9yÉ?毽kMÆ?ŽãíbÃ?ŽÉ†p®Ô¿?® òü3å¹?EDRA¶’´?»oN@°?Zâxcò©?šÓy`¤?á#ËË%¢?­r{¿¼R¢?X÷X ¥?‰•O…:ª?†zÌ)SÒ°?©e£Ù€µ?Œw3äHûº?dŽ(†À?•w)t¼Ã?!OÿJÇ?GÇttå4Ê? ¢ù(8Í?4^MzÐíÏ?Ê7·šÈÑ?h¤S›‡Ò?LÜjK]¥Ò?à‰¢á:÷Ò?=@¸ÿ÷Ò?øJÙ®§Ò?Èž] Ò?ôáÝ#Ñ?ðƒõ’úÏ?6>6FÍ?¾±ó¦CÊ?Àï#8 Ç?WªwÆÃ?;f€`ŒÀ?DÁèˆþº?HE{ ¿yµ?r•ZO,À°?xÕ} ª?ÚëÖo¼¤?â&þÊó¡?ÑϽ­f* ?/肼“h¢?‹ ªé§?Vúážåñ­?µM†÷ a³?vRÇ;C•¸?%ãÑa¾? ÎÑ•”FÂ?Âe]ˆmÅ?>Ÿ»k…È?ª…:®pË?‡ë¥¿àÎ?RâF–Ê&Ð?æ/Ë÷Ñ?ô©>£Ñ?L=òÑ?©9‘ýòÑ?’ïk5e¤Ñ?HÛ£é Ñ?ÞŽ`ùˆ)Ð?[³òüÎ?ðxöïÇxË?.ÿGÈ?°J;?yÅ?ØCCTÂ?†¨ñà_¾?ú";äh¸¸? ¤x\œ‡³?š8ïíD®?µ—#ìi§?P„ËÁ¢?k>vè&€ ?á fr® ?´i$>-M£? ;U~P¨?@UŒ]€¯?J‰ÁÜsK´?ƒðZË˹?kÍÉZƒ¿?ËzÄVUáÂ?ìŽõnÆ?H³ -É?”JƒÁµÌ?’DÙ®¿Î?ƒGÄMœ~Ð?×9ÏB`Ñ?„NqÙÞûÑ?žLi‚KÒ?:çã¨LÒ?RGP­ýÑ?Û>æZ7cÑ?½{©Q¤?õ»86«?c¥ =ã±?½pC·?ôI³¼´¼?q’H(bÁ?l”y"zÄ?p%?®ƒÇ?޹|ó¹`Ê?ïæF;ìôÌ?ƒia»&Ï?r»ã6pÐ?¢e³AzÑ?œ°‡JVÑ?Êãê_§VÑ?¬H××” Ñ?´5BPrÐ?8‹Ô´ø+Ï?˜‰~ø¯ûÌ?xýƒõiÊ?Bh?_‡Ç?¿6Ó䉅Ä?×Ï?ø Jʶ‰Í?žX%SÐ]Ë?MôèÏÈ?”û‹®5ùÅ? …}…°õÂ?\_ÚwÆ¿?å9ï³ø¾¹?6%Œt´?o,Öê­?F"–`:¥?¬+k´UΜ?þTm/‚i“?0·¨›J?¬u*Ù±P?~öì>t“?hR\cÌãœ?½3DÐ3K¥?ÚxüÏ®?À_·‘!´?²L{°ÅÓ¹?6ê€@à¿? ’ˉÃ?ü"˜æ Æ?œ5ûƒÞåÈ?¸.…£êvË?˜é/÷¥Í?8Çü‘]Ï?EÒp;lFÐ?’ú!ö“Ð?0œ4”Ð?L¸Û"GÐ?;)a/Õ_Ï?áZ³Ü¨Í?…Û*zË?³Õ”ºéÈ?ÊÔàäÆ?|aü…Ã?ê2Fy‡á¿?Öúѹ?0 œ÷´?=B8ZGï­?è>~û/¥?¯pæ,›œ?fgÚk“?P±3y‰Œ?ÔÒmÿ­²‚?#ìt’È¡Œ?’m¤Äö—?¼£ªgªõ¢?a¾D_nÒ«?Œ§®Ë9³?ên‚P»ã¸?@X ¿?Û6åà ¡Â?$.TS°Å?å±å‘È?ãHˆiƒ)Ë?êÉó´]Í?B¯¥ÚµÏ?>þ,;¸$Ð?®{ªQrÐ?Äï rÐ?ï×bO§%Ð?ò¼œ6ÝÏ?öÌ#bÍ?û­f3/Ë?fÛlyΘÈ?W7Vêh¸Å?…'ä<ªÂ?VŒ¨€¿?$ëÛŒú¸?Сª¾5³?šCp)u¬?¶ÿ¸¼)£?Hf*^˜?qlú§„l?çA ÜÏsƒ?çÒŠ<•'ƒ? ÷МYŒ?ª/Sž[®—?Ô:ÈS´¢?šå„úLw«?Šçêä²?fž/"£¸?ALs¸½¾?üÔ>|Â?Bmë;üŠÅ?>2Ø7âlÈ?zö sË?p‹ûö;Í?,’b0Ù÷Î?¼Ÿ¹¨ŒÐ?î+%RdÐ?ö—ÛkydÐ?¥˜GÙÐ?>QÌíTùÎ?ëB@ˆæ<Í? +½Ë?ÃÜ9ÔnÈ?¶!—¶ŒÅ?Ý– Ôþ|Â?¸?4½¾?(CÀ÷ÁŸ¸?<Èo §xc«?ÚõÏŽŽ™¢?Nz Cuk—?íR·psñ‹?ú§¯ð‘u‚?©¾«óªz?+­’TwЇ?c3°:í•?³°½ö+¢?êÐ]J«?Þ ÒÊý²?[¡i¾ê¸?´eÒ32¿?C'9¶iËÂ?¡ijíÅ?†¨À©ßÈ?‹EÕ~R†Ë?¶]Á3ÇÍ?r™ hð‹Ï?4µMº+aÐ?êgßoa¯Ð?¨ÆmЦ¯Ð?Ú†¾bÐ?0fÁæŽÏ?Èà7LcËÍ?p= 뱋Ë?´_Ð{-æÈ?|4aµ¶ôÅ?oa<±ÔÂ?4GÓC@E¿?ØÐžGdÿ¸?i×½³?8‘Š«Xx«?hÅù÷æY¢?r–môJ–?SÌŒ¢Ï‡ˆ?”w!lœ|?æ*#O­z?b*#„ •†?òŠOq½”?&ím.„N¡?W6¯¹!0ª?jds”V²?æ—¨’•-¸?¾=Ú¾Éd¾?,Cå_Â? n”w}Å?ùRnÈ?ÇKŽh&Ë?û) 'ÇVÍ?›ûI<§Ï?cS„”Æ+Ð?ê-íól}Ð?; }Ð?Ÿý÷,Ð?¶\ˆH‰Ï?(G»)åWÍ?bHCOË?_ HˆoÈ?âþÁ ~Å?ói§Óï^Â?äÓ^’b¾?âŽW²)¸?²\c­ïN²?8¦)ª?¶rV­Í4¡?ø±´äù~”?ÇÙ—k†?/q2P¶iy?À‰˜èz?ZýA¦ðˆ?ê!ÐБ–?°î\³cË¢?ô?ñE¬?ò«\æv­³?†`¼EÂϹ?†1Xü&À?i#´}tÃ?ÎK‰öQ°Æ?b›v»É?*³ìäawÌ?§¡’ÉÊÎ?vMm¢AOÐ?ª5,1ŠîÐ?T ¬z­=Ñ?›œöÛê=Ñ?í4Á‚UïÐ?â)ò©PÐ?æn—UÆÎÎ?T˜L|Ì?VÈÖJÁÉ?øï.„·Æ?‡Ûfÿœ|Ã? ÈUï/À?.XYŸã¹?z°opåÁ³?×jüo¬?˜è×Xšö¢?úîè–?QƒÂˆ?Ä…™¡P{?ææ«søéx?HŸÒJz…?ØlÛW”?6LÕê8¡?r¶4 PHª?GÌЊÀ²?®Lµ|¸?p>çH–ܾ?ož„°Â?Nζ˜äÅ? Þ*›êÈ?2]Õ_¤Ë?‹òÙP¤öÍ?³/êßÉÏ?mmvΆÐ?ú¡o‰4ÚÐ?KÞç0ÚÐ?2‹¢d߆Ð?ꉜÄKÊÏ?…×!/÷Í?êø—mÞ¤Ë?é[]ÝêÈ?õÖÊiäÅ?ˆ¸K0°¯Â?öÔ¨Ÿ?Ù¾?šc"}\w¸?Ä:þ{(y²?ð–VðK4ª?e§ùº3¡?a<š>ù”?>Ð[j$ó„?\µ”½Ë¾w?bŸõ»ŽÃ‚?ýt×ög?(;ñPùJ›?»¨Óc„¾¥?£ ‡éÉÛ¯?Ú\ØQkε?uk®H¼?Øm—\Á?¨ÇÅ?²vt¼kÈ?z\{n›Ë?CØÚ¯/xÎ?|@I…]sÐ?¨ñ…ÈgÑ?”õn`Ò?T l³ºaÒ?n$WŒýaÒ?‰$7Ë-Ò?±ÿ°&&iÑ?bNÇ$IuÐ?pÐrH}Î?;˜2>\¡Ë?ZVlœrÈ?úÄTLÅ?œ?Û—Á?)|ÜñZ¼?_’½$­áµ?ÒrôÒ°?ñÉk·ç¥?ýr×E«››?Ü–N(É?%VO*Zƒ?JraN¡€? áN8ˆ?öÖRòír•?æþSØt©¡?±R·p.µª?εî{£¾²?k¹AÓSʸ?@õå΋@¿?oÆrcðÂ?2Ì/ã2Æ?K‰¨J÷GÉ?|Ü9xÌ?°&@)oÎ?XΨ¦&Ð?H¸8’ËÐ?.GE‚zÑ?™ðÂiÑ?®þ@åËÐ?´Æs~°&Ð?ðà HoÎ?œÇþÿÌ?+¸Õ¶GÉ?„-|ä12Æ?h!Æß³îÂ?Ô ZFl<¿?ͳ°ßiĸ?´–?Á¼¶²?>{[g.¡ª?K p:‘¡?VlcG[:•?†ØØb¸‡?øs& æ?ݤ—¹ÐÀ?È cÆŽ–?'çrué¡?L`*óäª?gò {xö²?œ–¶°}O¹?ØØz 8!À?Î}”`ÇÃ?pF”o1xÇ?xÊß.Ë? WIÛªpÎ?ÄÔn©‚»Ð?ÃC~5æÒ?jàÁJÓ?†x±ÊµÓ?æê+ùfÔ?^3X½°Ô?¦ºÈq¶Ó?ß?–%¡Ó?Š| ÝÄÒ?äëùä½Ð?œù½çgvÎ?ž·3²ÑË?WÙ•À£Ç?1È›“‡ÏÃ?âŽWö)À?Ð&dõáa¹?‘UGPv ³?„ u– «?–$ëÍ¢?à¢Aٖͩ?ñ2G"PŽ? dðŠˆ?DÙó*b´?øf=°\—?zÀMZ„5¢?´ ‹Êgóª?¾ )3!²?tölOt¼¸? ¿ú›7*¿?I4´DäÂ?¾ÃÐß^)Æ?u°ŠBÉ?Ä<…®·Ì?dªO†ìsÎ?`ld1+Ð?'L µÑÐ?þf–À°&Ñ?)ñ!›&Ñ?€º•ÑÐ?ªs]U+Ð?¶m€ÂsÎ?7•ŸfÌ?|wCïAÉ?îš„2T(Æ?¶½ÞN¦âÂ?tÑæ*%¿?"J·«)¶¸?bATñ º²?ôÕtrߪ?Ôê“Ä¢? tÂØ%—?a›Ž9?©¢Z´ˆ?róÒëI•?]ôzž?H¡œãÉ˦?<dýÛ\°?³ãÁ^¶?†¶âÏÏ6½?+¶±øSÂ?ÄúÕÚ‰7Æ?.Š—.Ó"Ê?BÀÖ;òÍ?VâüRFÁÐ?úžYµ¸YÒ?–•ñ´³Ó?è,”»ÂÔ?x‘ Gë|Õ?tsÐÛÕ?oÉ ÜÕ?–WŸà­}Õ?õ‰éÖ ÄÔ?‹GÆùŒµÓ?ÕRàÜ\Ò? m9?ÄÐ?bŒ›˜øÍ?LZá*Ê?nðëx?Æ?Úç-v\Â?ô˜yÅ£H½?ŽØL°#q¶?ê·m}zo°?{ê!Öð¦? Ôƒ‰RÞ?a˜±<•?í‰Û»Æý?÷[XcØ ’?ד&‰™?^€y¿Â¢?GZ›S«?°kâ–t¥²?þ§¨ÅÐ}¸?'¼’ÂÒ¾?0’³g°Â?Ê×CÆüïÅ?v¸á»{É?VzÄÒË?p¥vØ&7Î?˜5X7 Ð?æ*¤Ìô³Ð?@Óúr0 Ñ?±c  Ñ?h:cгÐ?Ó¹‰ü Ð?±ÔÚÐ6Î?Ux×>ÒË?¾*G¨É?LŒ“{ºîÅ?Óˆ:D®Â?­ŒHÇ;?ÑïZKw¸?ïC·@²?³¯$iþª?ÚhF=!«¢?V CXgS™?xÁûÒ‘?Ϧˆ´¼?¾´«N‹`š?ž‹'æA‹¢?bí²G©ùª?Z±é:ä²?BPÁfW¹?ÁúÅÈñOÀ?â‘.k?Ä?°ð(Æ«WÈ?L¬„tÌ?Bõ®8Ð?¾ÅÇ*EÒ?zГZO¿Ó?„ÚzÍ'Õ?è² ; BÖ?ɪX×? |€+ýf×?ϯFþ$g×?î€1¯×?/ÉWCÖ?ì gP£)Õ?Ç.àÔ£ÁÓ?Þn{ÀÒ?MÛ¬Lã;Ð?ÑÂøÙ¯{Ì?[—ÎA_È?Íû]»ÈGÄ?Yþ0H¸XÀ?I&{i¹?U¸º‰ö²?Œ—‰«?‚3<8Ó®¢?¾XÒη¤š?Ò(¸´c”?Ÿ« 7Ÿß“?ûÕWœ %š?1¦5+o¢?}Ñ8Î2ª?NÛÕî÷±?vFÄuÕš·?Wí;I½?ö#×Â?,´-EÅ?[äÒ?G-B¦®ØÒ?nàYPÊÒ?3Ò €•¸Ò?›5Ó2¤Ò?Îë"…’KÔ?=r_’xHÔ?^Jhç×?š–“ÚEÍ×?Ñ¿¼zÙ?rèÔÚÌvÙ?»þE”ñnÙ? ªí´+cÙ? )×)}SÙ? ÛqMè?Ù?ü©9o(Ù?\² d Ù?÷gUöN»Ú?º(Ÿý+·Ú?©§ÌLì®Ú?sæv“‘¢Ú?ò±ù’Ú?Vµ&”}Ú?ü‚Ñ™÷dÚ?úYxÁNHÚ?;Ø*ÇèöÛ?ÜcùS’òÛ?í·VïéÛ?b¸ëÎÝÛ?E]ÌËÛ?зGÍP¶Û?«¥f’œÛ?6bX&‘~Û?ž<º`L-Ý?휋cÂ(Ý?©{ ½Ý?á ˜½>Ý?Ö,JÝ?VÝ@BâéÜ?vT4† ÏÜ? °VɯÜ?ñ:™/=^Þ?]Q*YÞ?ã‚ÎPÞ?Vv:ô BÞ?DZ„»Z/Þ?¦LŸO Þ?¶L üÝ? ìêyÛÝ?¹=‰ß?+óä Œ„ß?•ƒúyÃzß?ð¿øF)lß?£¡!æÀXß?DÏÀ•@ß?ɉÒ#ß?Až†cÖß?,ˆv—kWà?UeƒQÖTà?­OÁOà?Xþ5.Hà?Ÿ®Ø¢>à?Öà6õ–1à?…÷çA•"à?Ž­Ð‘à?„cçà?‡™ò;Räà?ËÄk ßà?ݼq3×à?Ç(yQÌÌà?8äÔ׿à?.™1ôW°à?£ —Ožà?#LiØnsá?û0›pá?`=°!ká?ÕFcá?€]GXá?¶ŒéJá?êÏÀêí:á? *=S(á?X±ž+‹üá?rkÓùá?ë83äóá?Æk„ëá?üöÓqàá?blR,­Òá?d1‰<Âá?;·¾/'¯á?6É_:‚â?oÕ`â?;5Ñr1yâ?m`^ª‘pâ?öÊ.B-eâ?þ€ËqWâ?F:6Fâ?¼Ÿ¯¬}2â?Ö”§Rã?ùqJ•çã?Uê%éúâ?ÑÚMæòâ?%Ì``æâ?°'LÂ×â?³6dÆâ?ûƒþå_²â?ë I‚ã?xo†:Ë~ã?ɘ÷8öxã?ÁþÜoã?ùä¾§dã?oúBËÉTã?tÃÞáBã?ò0Ò4Þ-ã?ŠÇCžÄûã?¶»ªtøã?ï,S9“óã?š ºéã?ÊX@gZÞã?Á0„9ØÍã?½%V†Ö»ã?éurƒ¤ã?Q|×àkŠ¿'xE72I¤¿I”bã ó°¿N/×0º·¿Ÿ2ðx}¾¿<‰ëÝÙ¿ÜðššÝûÅ¿ƒËq…XÉ¿r€Pæ§Š¿Ex$ >¤¿Âú¾¬»æ°¿s¼c6ª·¿úÒG‹´i¾¿Úó*äY’¿؎3CÂíÅ¿ëYÕFÉ¿Î⊨¡¶Š¿­^;Ï1¤¿ÿÌø¶ÄÙ°¿uº‡Ë¯—·¿ds¦éÏQ¾¿"‘íw­ƒÂ¿Ö¾ÅÛÅ¿¤Ó­v0É¿4ELH,±Š¿âÏRM@"¤¿hww.øÊ°¿r·í D‚·¿‰OÜè5¾¿káû{or¿´y&ŠÿÆÅ¿/Ⱦ»É¿,TÍŽ‚ Š¿Ê:ó?¤¿¸\™Uõ¹°¿Ý„MŒÖi·¿îCW"¾¿Fƒhã^¿žÚSäâ¯Å¿îF«ËÑýÈ¿6#èFˆŠ¿¦r©ù£¿k@†ª¦°¿4¤ï]N·¿ŒÙ¢ò½¿Àü‚÷H¿Љð7´•Å¿zBL pÞÈ¿ðÈ/jŠ¿Œ£”¿Äߣ¿Œ±Bö‘°¿DŠ@à/·¿¶mð»˽¿ˆþÏRÛ0¿˜àkyÅ¿ƒÔ–=¿È¿]ç×I(GŠ¿xîžÎ©Ã£¿Ü ¥Xy°¿¦Q„a·¿ÄÌ*ÞŸ½¿'¶ãZ¿~˜køÑYÅ¿“wÞ›1™È¿Ú`ùÔ»Š¿ìmÒ¤£¿hØeÔh_°¿r$Ø|íé¶¿ÇÏ#ýíp½¿æðí´ùÁ¿éSJžI8ſ’|_tÈ¿ >§Bô‰¿DfÓ’Sƒ£¿„ÛÓ˜VC°¿ÀLÍuˆÂ¶¿.ø–©6>½¿Üa|§§ÚÁ¿(å¢EÅ¿"t—ˆ´GÈ¿-ù×÷ĉ¿†T¢_?_£¿ÄÀP+%°¿Þê«I?˜¶¿_µCÚ½¿¶`‡¡‚¹Á¿?Ȥ‚ìÄ¿..”o<È¿qZõÀ’‰¿!ø¬¢8£¿ò„1ñí°¿¨äk¶¿ÄÝV£Åͼ¿ôLp@ø•Á¿%ëæ %ÂĿﵻ` êÇ¿C#Úù‚[‰¿Æ$úˆ£¿Ú¦XMů¿Q°rŽ;¶¿øjœ!¼¿<|¿®gpÁ¿¢Ý&C<–Ä¿6'ºÇ¿† Cãˆ!‰¿Ò¦šû㢿ñ®‹·|¯¿«soN¶¿ÃâYGØN¼¿–érZwHÁ¿KÆŠœŸfÄ¿3SÁ£g€Ç¿t=lQ"䈿’'b¶¢¿9%´á(0¯¿Ñ”½¾ÃÒµ¿Gèé ¼¿]s•Á¿=m9™¯5Ä¿}НÌðJÇ¿ä –U£ˆ¿Ì?ØV§…¢¿À»Qè­ß®¿^T¸Å|šµ¿Å¦j©ÊÁ»¿|ë7!\òÀ¿òtÂÉõÄ¿ -– Ç¿xÿ¯w _ˆ¿HáîR¢¿rU‹®¿JOrŠ_µ¿ïÌá6#v»¿t[D³HÄÀ¿ÿt¿Î$ËÿmDÍ_ÐÆ¿ªqpzˆ¿µæ@ÓÛ¢¿`ä¿)3®¿r´MÌï!µ¿†¤Ú¢'»¿Œ·È½è“À¿ÃÉã{v‘ÿ½N‘cnŠÆ¿x–Ṁ¿Òˆë[sæ¡¿Ù’Õ`8×­¿—khþ¾á´¿å…I±Ôº¿XX©fÉaÀ¿˜söòVÿT|q_´JÆ¿üÎNfr}‡¿„&볬¡¿;*-ˆw­¿%Wúž´¿ßýmº¿|œòZk-À¿» {ЀÿIE¨«ÞþÅ¿7¯J§*‡¿ÝA?•p¡¿4ùsA"­¿Ý㯴Y´¿GL¥„B&º¿Z5ðBÚî¿¿™¹þ‘„Ù¿Bϰï¿Èr2Öyœï¿õ~ ®„ï¿tÛpe±fï¿ Ûã‡Dï¿x"õ÷Ü´ï¿l8!Où¯ï¿yr|¾2¦ï¿‡)ïÇŠ—ï¿ö~ ®„￵$´s kï¿x}¥ÛdNï¿K'ágU,ï¿eø¼<]—ï¿H~l ~’ï¿\¨Àˆï¿ŽÜIT&zï¿vÛpe±fï¿y}¥ÛdNï¿p$vD1ï¿þ©½²Tï¿2T4eþtï¿VŶ•$pï¿[è9¶qfï¿J·œEçWï¿Ûã‡Dï¿M'ágU,ï¿ÿ©½²Tï¿#afÛ‰íî¿#!.¾ÅMï¿H¾ûñHï¿Dw83K?ï¿ÞæÓãÒ0ï¿# H‹ï¿–üXwï¿å#Íšèî¿0­ÛúÆî¿7‹ûS¹!ï¿Ó¯[ìï¿É¼›(Sï¿è5ïï¿cìºÂñóN­ÐÙî¿È ¾½î¿c›cZ«›î¿%=}ñßð‰•ìî¿è ^âî¿Oé³ÿBÔ³êš4Áî¿” h©î¿8w:áŒî¿Þ'ŸP¤k;A»î¿ýˆíóƒ¶î¿>¶­X ­î¿~bÃÕžî¿€ìÑdè‹î¿07+(Etî¿«3²ïWî¿•›‚bì6‡!å€î¿.h/ö0|î¿“y/YÉrî¿q¹Ë½¯dî¿þ’¢PæQî¿— W÷o:î¿[PPî¿Ë.1±‹ýí¿´ŸøÔAî¿xɆ*=î¿^kM[Ö3î¿ýoæÙ%ÖPP7î¿\·•xñûí¿·ùõ àí¿)¼‹¿í¿œ¤á]þí¿8·½]zùí¿•û ;ðí¿vˆÒí]âí¿q!cåÏí¿¨ÑòNÓ¸í¿ùx3>,í¿þ\Åô|í¿Í§ÿ¿µí¿("ë*±í¿NÔBð¨í¿ôý;Fší¿–ƒtìù‡í¿ ãÔqí¿ð)¿x»Uí¿d/Ñ5í¿M+@PÐhí¿åÄ„UGdí¿zL6[í¿nÏäîMí¿áš;í¿ÝÛ@â$í¿y™Ó©Ä í¿£Ã¹ê,êì¿dHÅâWí¿¬O3xÛí¿À&Tã í¿³Øpüì¿¶'±†êì¿û—m×%Ôì¿‘u;ˆS¹ì¿:,ìMšì¿Âl¸ cÁì¿„Cgáó¼ì¿FÑ=´ì¿Ló}˦ì¿Ä…®•ì¿iÁ«Š÷~쿽*†{tdì¿`è­—Eì¿ágZ ÿfì¿].VÐbì¿Ê›3 ÜY쿲ǣ»Lì¿ÿ±íï<;ì¿BWžRd%ì¿84š4 ì¿ùH,бìë¿})øÎ9ì¿*À&3çì¿Éä(¦Bûë¿~5.}Mîë¿tZ¼· Ýë¿Î$`ÿyÇë¿€uD§¡­ë¿9ü®«„ë¿ÄÄø!¥ë¿éßʤޠë¿ÜY!¥X˜ë¿‹wAJ‘‹ë¿N¨ ŒŠz뿱xb Geë¿ÏìðÊKë¿9{ˆ.ë¿18—ÎÆ=ë¿y¿j“9뿬rãH-1ë¿­Ì“´•$ë¿Ê•çžÎë¿Op1žÚþê¿m™í¼å꿹›lyÈê¿äÑ‘@8Òê¿óʯrÎê¿HŽ1zÐÅê¿é‰j¹ê¿®”$Æå¨ê¿ƒ/€D”꿈<Üù‰{ê¿F‘º^꿦dªä†b꿵DPu^ê¿0éUÇRVê¿IV‹ J꿤*À~à9ê¿æ`Ï!•%ê¿™c–A ê¿—‚æ›éðé¿v×ôÃîé¿ä‚P9Äê鿵 •aÅâé¿ê‚Œ¨ÈÖé¿"mçÏÆé¿¸^¸”ݲé¿ö¦ÙÃôšé¿=ú¬$鿲õÂHwé¿vŸ­s鿜‡:ké¿ëØ?½t_é¿þ¶„¾ÅOé¿hw‰/<é¿\õN#µ$é¿^à*Z 鿳½SZQûè¿mù)w÷è¿­kXaÃï迲P07äè¿ûJ_ÔÔè¿£MMÁè¿ú@~ð”ªè¿áQ²Ö¾è¿mWŠ;Ç{è¿ì‰þµxè¿‚Ãñ?tp追±b#eè¿Wç¿Vè¿f÷PÆ9Cè¿*ª~§,è¿•Y¼èY迦#5—vøç¿„‹‚QÄôç¿üÏX`íç¿(ZˆÎKâç¿)ŠijˆÓç¿ÞCyrÁ翾þªç¿“ß·>‘ç¿»W-­sqç¿¶i?9Ömç¿("à›fç¿f¨¿Å[ç¿®¶ëUMç¿Ä¢§bM;ç¿Gy)°%ç¿29{* ç¿Ì7OÓææ¿bîÃ;Kãæ¿!BF ;Üæ¿¯~|“¥Ñæ¿ÁM·ŠÃæ¿ì‰8í±æ¿öË“ÎÏœæ¿[Úõº5„æ¿êÕ(õIŽä¿ Ga ˆä¿ò‹g}ä¿\œg.mä¿=XG´Xä¿|UÀ±?ä¿Ù*œ‹"ä¿àD[¤ªä¿ä¿ƒ¿C&ä¿8Zœ 俇E“˜¥èã¿8Â*xdTä¿"æfFXNä¿xbý“pCä¿Ø¹›Tõ3ä¿n‡K® ä¿ØÇªÄä¿ÃNè 2ëã¿Áæò?éÊã¿r¸6J/ä¿jy)ä¿"÷ íä¿&6cÐä¿ßÜ?üã¿r—¤Qäã¿’{+¯(Èã¿'±Ó(¨ã¿’Îʄ俺ç9ãÿã¿ä½Ú0—õã¿©äÛ¿žÂ±ÞÝÛ¿F,wÇÍÛ¿<À‹³¶Û¿•±oq—Û¿AM˜îoÛ¿0ô‹ª@ۿΣf¬ Û¿¸_ÉeÛ¿{“žþÚ¿:»ÎHCðÚ¿Èéc+ÚÚ¿‚&vlð»Ú¿×¼V¾}•Ú¿f å¾fÚ¿†OÒÔ0Ú¿B Š™©"Ú¿§fé·eÚ¿?G¥YÚ¿‡…z²ŒúÙ¿-êõŽÝÙ¿·ÿÛe¸Ù¿ZV?‘6‹Ù¿â ´®VÙ¿ä-â>"<Ù¿€ðøÏF6Ù¿Š£Õ´Q+Ù¿š{KýUÙ¿j"ý´üØ¿™¼Y æØØ¿*ïn­Ø¿ŒºÙyØ¿Ž%¾öõWØ¿])Ò½QØ¿ Iä˜FØ¿9üP`4Ø¿@ÛÀ–Ø¿@ô‹œö׿ZаË׿Bz)}˜׿FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((216,108) (255,191) (0,0)) 5 üdÆnp.οÔ{5Ö±UÏ¿ÍGqÒÖ)пœê‰¶Ð¿J›Åk0Ñ¿qEÒt·Ñ¿(¡¸+,Ò¿yDrõN­Ò¿¶–-¼¦Ó¿»Uêì——Ó¿Êß:RÔ¿ÁÂQÆuÔ¿‹P½6¤ÙÔ¿Ó¶,TGÕ¿HË­"¥Õ¿Óõ<%À Ö¿—½¿e0cÖ¿ø(‰ ‘ÂÖ¿ Œ ív׿ :g%Uk׿K½:@}µ×¿Z¢Ø¿UØïÛHØ¿»´;z‘Ø¿­äóV0ÍØ¿à*‚O Ù¿/ î`BÙ¿Î+ÚXìyÙ¿£°û„ú¦Ù¿ ;ydÖÙ¿ô,šÑ]úÙ¿‡sÄ"Ú¿Yäu¬KÚ¿â°šBfÚ¿ójOñ}Ú¿Z Dp’Ú¿¯Ã¿,¢Ú¿¢¼é¿Y®Ú¿_E¯y¶Ú¿ŽB…ºÚ¿|‹M›ÎÌ¿Vy`©×Í¿†jøákÖο§tàÎÕÏ¿3EÊ-OeпÛî/aÞßпfê!UÑ¿]BÎ5SÊÑ¿uµE!5:Ò¿â3CũҿR¡áKÓ¿Ê 7F°}Ó¿MÌÁ9 âÓ¿ù矃“EÔ¿ø¼áΣԿͶh8ôÕ¿êá|ÑÔXÕ¿å;e“^¯Õ¿±ðÈ­Ö¿¢¯fPÖ¿õòÆéðšÖ¿hÀK´¥ãÖ¿Ì‹¡u<'׿=êp¿h׿(­ê³4¥×¿4u°(Yß׿"R Ø¿TGK0GØ¿š`¨¢ÈtØ¿ÆÆÐÅŸØ¿oâîÅØ¿æ ÔjêØ¿ø‰ô•± Ù¿äD©Z(Ù¿®“5P§?Ù¿zˆSÙ¿…:ÕŒbٿ㸴™2nÙ¿Ö"ÅöuÙ¿â¬F ÕyÙ¿º?÷¥íaË¿¼¥Œ]Z̿ࣥž NÍ¿^ëò`M>ο {n`ð(Ï¿²‡z×пU7ÝëExпV€µ›æÐ¿^RæãQÑ¿¬Þ¾æëºÑ¿Yú¤Í Ò¿Qľ*J„Ò¿QR<‰†äÒ¿˜Åòñ:BÓ¿ ‘l—œÓ¿%s@{IôÓ¿£h NŽHÔ¿5BQÆšÔ¿@ªX°èÔ¿½œžï3Õ¿Iö›K‹zÕ¿íwWÿ¾Õ¿>XîÒÿÕ¿W2ç €=Ö¿äúŽ]€wÖ¿I·ñA®Ö¿hy¦IáÖ¿™§]çý׿zúH õ<׿ûkše׿j²q©Š×¿=ìaӬ׿(Mí¼Ë׿ö©÷Bæ×¿­±—µü׿3ŒOØ¿ÞqG )Ø¿¢j´¶I)Ø¿ê}Öì²0Ø¿Ví"üc4Ø¿OKG@íÉ¿PgD0ØÊ¿(¢Ëk+¿Ë¿ù‡Ü÷"¢Ì¿Ð¥úL‘€Í¿[*ŸZNÖ/Ï¿L"0[2пèBîeп\:U‘4Éп4 ¾©Ñ)Ñ¿¹ïð°Ú‡Ñ¿nöXøãÑ¿böZ²¯;Ò¿ÞØ®a‘Ò¿¨T®ÝDäÒ¿™‡½W/4Ó¿a¢ù2Ó¿‘Ã$G$ËÓ¿©­ô6Ô¿¿–p5âUÔ¿_ ¨A—–Ô¿ ººìÔÔ¿}IóbÕ¿C$±ihEÕ¿q!>0yÕ¿2jõŸ©Õ¿P£4±ÅÖÕ¿FŽ ñŽÖ¿öäë'Ö¿Š4^KJÖ¿(º[jÖ¿"¯w‡Ö¿Ïv<3! Ö¿ͪvwµÖ¿M]¡,ÇÖ¿Å“qNÕÖ¿„²€äßÖ¿|'LrðæÖ¿‡oótêÖ¿sûi¡sÈ¿Q>dQÉ¿QÀ0âá*Ê¿ß6ŸÉÉË¿´ßþ8ÒË¿ÀíW[ Ì¿è}¢3iÍ¿¦—ÐÍ-ο¤-KOºíοZ_9è¨Ï¿®Ëä–/пùœz¤=ˆÐ¿&—£TÞпȈzÔ1Ñ¿™P}•ª‚Ñ¿´÷ö¿Ô¿‹Èø5NäÔ¿Ä80k…Õ¿4Í`#Õ¿B2žÐ~>Õ¿ÜYóXVÕ¿(Q£µ%jÕ¿ù˜\âzÕ¿Åb•’@ˆÕ¿UR¯pD’Õ¿àçcð˜Õ¿TÁ\“EœÕ¿ ]°ÚÎôÆ¿ŸØª!ÅÇ¿ü¶“½›‘È¿7mLGjZÉ¿“™|tYÊ¿î¿?»IàÊ¿ ™±Ë¿ìzî§UÌ¿á²ÐgÙ Í¿4Ó[’¹Í¿ nÈ*µdο Gd) Ï¿lJÆ/ӬϿ¹X ËÍ$п3Äm6´pп§òºÐ¿/ž.ÛÑ¿|ôíwEÑ¿X}¯š…†Ñ¿ÑÖWRÅÑ¿\aHaÒ¿[D ª:Ò¿<K#qÒ¿ß2±Å¤Ò¿XðÃ=‰ÕÒ¿DT hÓ¿.†ü[.Ó¿ìòÂXaVÓ¿ØÁ…œt{Ó¿¤^‹<”Ó¿ï]Ó:½¼Ó¿Ö2{ùéØÓ¿ùÞY òÓ¿—Ñ9;Ô¿A¤yôÔ¿4·ì´­*Ô¿’ ´?7Ô¿{* ¬@Ô¿NÏ=ôFÔ¿ìócJÔ¿µÊ 0]rÅ¿{á°4Æ¿ÇN™¾óÆ¿;•çîQ¯Ç¿O.R–GgÈ¿×8~•€É¿riHšÞËÉ¿Õ`ñZExÊ¿ÈXNÛ˜ Ë¿{â¾ÄË¿ pWdÌ¿PX°Í¿âio!—Í¿ Ô5—)ο@¡og·Î¿`GÚlz@Ï¿*».¼ÄÏ¿y-\% "п<Öîs=_пͨÉè™Ð¿ÎÈWÒп¶âþ‰Ñ¿Xašlo:Ñ¿4ñ=®jѿ߿õ>˜Ñ¿Œ_ÏÃÑ¿$PŠ@ëÑ¿$M[Z¦Ò¿XNK3Ò¿ÚÐz*SÒ¿ªJ`@pÒ¿9š‰g†ŠÒ¿U:¨0ó¡Ò¿kKf|¶Ò¿æ\ ¶ÈÒ¿8¼ÏuÊÖÒ¿çoâoŠâÒ¿2%ú¥ZëÒ¿3ýŒ;ñÒ¿íP»ª-ôÒ¿‘غ÷IëÿÄ;"À Ä¿¯Z‚-•QÅ¿­þçþÐÿÅ¿Ë-^»­ªÆ¿Î<¬RÇ¿é–ÚÞõÇ¿ÁqËþ•È¿Ï!ÃT2É¿âgSÊÊÉ¿¯»ÖÈF_Ê¿ël· ³ïÊ¿s#•ø{˿֨?¾Ì¿Ô nn¹‡Ì¿v¥a Í¿þ íãÍ¿pŸ}?0øÍ¿Ü]Ú+Þiο”Ù"fÜÖοŒ6IZ?Ͽׯéfˆ¢Ï¿"m"ߋпXüsQ]-п‡sà(²Wп0²U„пèVÌpϤпîsõÇпˆüÕ»çп+ÚÌTÑ¿D^|T Ñ¿fXî³8ѿ€ënmNÑ¿VûÇyaÑ¿|³@¯ÒqÑ¿{˜.6uÑ¿½»°5_ŠÑ¿;g á’ѿΠø˜Ñ¿P¼Ê"Śѿš'ÜD*a¿yk’»ÿ<òûN{«Ã¿ê§п~ÀGØÓÀ¿üI(ÄkÁ¿¹J‡š¸¿ùwÎ[䔿J¶‚á4%ÿ´½|”²Ã¿Õ“œ-í<Ä¿!Q@)ÄÄ¿y4¢y3HÅ¿ž%L(÷ÈÅ¿©È-`FÆ¿CüþZÀÆ¿JªªÔ6Ç¿}Ê´Õº©Ç¿å è½ûÈ¿ÆBß<†„È¿v§ÑÈIìȿ׶dy6PÉ¿Œ@ =°É¿üO"àN Ê¿¨ð^dÊ¿¶¡¼^]¸Ê¿cêTQ@Ë¿‹v(ûSË¿fÀ䂛˿i~]FÍÞË¿ûMºÐÌ¿µñˆ>„XÌ¿,¬1ߎ̿ŽâÖÙÀÌ¿®]66iîÌ¿úv~º†Í¿žû¢(<Í¿:¯ pF\Í¿äD(ÏØwÍ¿P×Q ÚŽÍ¿D~'+F¡Í¿¨û°¯Í¿ñhcV¸Í¿½üø¼Í¿dÞ†¤Ï„¾¿¬˜yŽb™¿¿óÕ6ÿ¦TÀ¿*ñì}ÚÀ¿¥‰Ý¹ÿ\Á¿½>³ð5ÝÁ¿yûÏ$­Z¿»€ƒÄQÕ¿•>·©MÿµMJ$×ÁÿÛô‰“3Ä¿Ÿ„‘2¢Ä¿Qè詤 ſЬ¨ØuÅ¿üƒÑu¾ÚÅ¿[ç…F<Æ¿Ô=9ÜašÆ¿²Îï õÆ¿SA ELÇ¿0DšŸÇ¿ã‰/jxïÇ¿å‹Øµ§;È¿ÉٰȄȿ¾=|èÌÈÈ¿i3Hý­ É¿ÉýÒŠ¶FÉ¿°|0¢ÝÉ¿ „ʵɿv28àeæÉ¿´‘ð¶Ê¿ºêÙ=Ê¿àµ|‡KbÊ¿BØ ƒÊ¿2%|B› Ê¿"ãáJ˜¹Ê¿ÜFà½qÎÊ¿Ö_4ô#ßʿԮëÊ¿Q+K\ ôÊ¿±K=øÊ¿†Z_Z»\»¿ r—…4U¼¿ ÙbiI½¿À×”˜w8¾¿q}g,#¿¿R”ž‹À¿Loêp uÀ¿¥ÓAãÀ¿aÄý^NÁ¿mõÛñ·Á¿H ØÚ ¿ ì_ä<€Â¿°(°“à¿÷dX>ÿpø@rz˜Ã¿iŸRîïÿ@ÊìÄODÄ¿uò­¤’•Ä¿ñÝ IªãÄ¿°_üÒŠ.Å¿q€^í(vÅ¿°¯þÎyºÅ¿m"‹;sûÅ¿;øã‚ 9Æ¿à!¥}9sÆ¿&2ê…ô©Æ¿iÒ$k4ÝÆ¿š»Ú`ñ Ç¿ óŒé#9Ç¿óÂÄaÇ¿&š·Ô̆ǿ¿*>5¨Ç¿ÌÄ¿Ø[x„ÅéÄ¿ŽHÑÅ¿¶©ËnÅ¿L¹æ.Å¿-¤Ú×f?Å¿ïª.á›LÅ¿ÕCéòƒVÅ¿œò²E]Å¿tðn\k`Å¿ža”1Iÿ´¿38Üa¾µ¿b1Û81y¶¿ÅÛß0·¿ b%±ùä·¿‘ÈÚf•¸¿¡ýÙÌ B¹¿n´áÎ깿ÆÚ‹“º¿ÉH^ÌB0»¿i†ÃÌ»¿êÕ.üd¼¿ÂÊKrÖø¼¿k‚B;ˆ½¿®Eqz¾¿lÙ¼ÄL™¾¿&C ŽÏ¿¿~s‹‰—¿¿ŽY’³À¿Qðc*AÀ¿ì¬Â²!xÀ¿pkⳬÀ¿Ò8º|oÞÀ¿&ô †¶ Á¿ªa¨^:Á¿!UadÁ¿ÌèjN·‹Á¿.$"[°Á¿¸ÐgšFÒÁ¿b´°ùsñÁ¿ h·Ý ¿hÃÿ„~'¿AYÈ\Q>¿©[¤šQR¿ØüÖ{c¿>§_jÊq¿[qKÜ<}¿¿ ÅЅ¿›oÏ„…‹Â¿ámLF[ŽÂ¿ŒfhQ˱¿þl°«9l²¿Á‚vk¼ ³¿% USY¦³¿e“Îgñ>´¿á´•/lÔ´¿¼”˜ž²fµ¿Wh>®õµ¿¤“‹I¶¿3—–m ·¿ò“êÏŽ·¿'?,K¸¿ÐÏ'FŒ¸¿þ¸ŽÅ¹¿jö|j{¹¿–:9$í¹¿D~JéàZº¿”ßÉĺ¿:Í9½ *»¿- ’T„‹»¿L×ȫ軿È'ÍýˆA¼¿¡‡Þ~–¼¿2tz/漿œs³ºß1½¿ f›y½¿Í×>ý¿»½¿ìS7Úù½¿-?X3¾¿¼'j‹/h¾¿.?V0W˜¾¿t{˜ÀÅþ¿°æ¡nr꾿*©”õT ¿¿Ür«Ëe)¿¿G·µlžA¿¿ÔÐ|ÃùT¿¿t Ž¶tc¿¿fTÇÜm¿¿ˆ%Q±Ëq¿¿]sÔ$­¿Ü‘9°-®¿öd¶Æ|1¯¿´5¬4°¿@)à/•°¿ W¤œ±¿¯@©ëh‡±¿†Ø•ƒü±¿iõì Ún²¿¢eÁZÞ²¿3%õŒôJ³¿ŠžÃ»–´³¿­Qø1´¿ûØÂ³~´¿RKw’ß´¿{?»5<µ¿>¯ÿ–µ¿Àêò§¨ìµ¿<åLˆÚ?¶¿”˜ü ¶¿Å17ëïÛ¶¿T¾Nû$·¿ål"zùi·¿#ª†ž«·¿ÆÁÛ é·¿˜&QÜö#¸¿ìW—Z¸¿‚Žàsy¸¿$pê©”¼¸¿Ö¨“²à縿º÷~U¹¿i„C1ë2¹¿˜shšR¹¿¯ÔÎZn¹¿á÷¾.&†¹¿èã¾õ™¹¿ ñÝÄ©¹¿ÙÐa«µ¹¿€à…¶Q½¹¿æÇ Á¹¿¤5š‰†°¦¿ r2?Ê}§¿ïlÆÖG¨¿X›7©¿„q ÀЩ¿€ÎPª¿5TuÊI«¿³à¬¿i¸G’ ²¬¿ªÁH<_­¿†?^ò©®¿þ…ÏÆ­®¿B)+‚ÐL¯¿Püƪ¸ç¯¿¸›ÅÜ>°¿>óá^‡°¿ÃmIUͰ¿ý¹@¨·±¿€1JüzQ±¿{Ãßs•±¿©Ó¾#”¿ÑqŒ¶Ð”¿ÌäLœz•¿çêå:!–¿‹ÈºtÄ–¿Â>íp.d—¿;@® R˜¿XžäVǘ˜¿a¦ßIw-™¿{3kK¾™¿Š€IÏ-Kš¿n # Ôš¿9tÕ³ÈX›¿w]@vXÙ›¿w³Ö ¥Uœ¿_obǛ͜¿+QÚ¯*A¿ÕÁ@°¿Á½Ê®Ìž¿â–[¿€ž¿c [ âž¿Çí'œ>Ÿ¿ÃÀAÙi–Ÿ¿²j‡e響v߆À ¿T™ˆ¥X@ ¿ºm›×tb ¿êãò‚ ¿^‘k!Ÿ ¿ 4"s¥¹ ¿¾ÙúT”Ñ ¿5eææ ¿~LÈù ¿ºTB‡ ¡¿ô¹·¡¿òŒê8 !¡¿Z-´Ø^(¡¿î³€bž,¡¿œ:aÏ-¡¿Ü±D¨0Õy¿ÈÐ.R‹Âz¿·]ù‰¨{¿Žxxº‰|¿8Bsf}¿Ÿ oÁ©>~¿¿^ C¿,äQ±!ῇ†  ”U€¿k¼¾Õ¸€¿‘й¿=(â…u¿fÁòÄJп‚ßã?^(‚¿ ˆ¡³}‚¿ÑôD¯>Ђ¿þƽ©óƒ¿Á.OÇlƒ¿¤ê›Û®¶ƒ¿ª¯ ýƒ¿9¿)ÿA„¿0qÇcx‚„¿Û¢™9MÀ„¿™ÂÃßû„¿‡Þ†2…¿Ø g…¿Lòz`>˜…¿—™«9Æ…¿ƒìs6ñð…¿dÎIM\†¿tý q<†¿-|#]†¿žmØ\az†¿.´™L”†¿ù[†õª†¿3ëö»†¿¢ø'aɆ¿g#ëNyц¿Q@óÂ#Ó†¿©›H}6͆¿,öˆ-{z?˜]e {?Õ‰Ž(Yö{?ú3(O4Ü|?~tÒ}½}?4°y)$š~?¼CÕr?VÁ:€"€?ºEu x‰€?·JÜÙí€?Iþä!•O?­I_Ý™®?®\W‚Ø ‚?JÚ»òAd‚?>oU|Ǻ‚?í¯U×Zƒ?Èø&î^ƒ?ËÜös¬ƒ?_ÓBßöƒ?þ¼²u#>„?Å?úq4‚„?9!’Ä?ÅØ&±Ž…?!£‹.Â:…?–ܵñ–q…?Ás÷j¥…?Ô´‘þÔ…?Z©{à†?{ªgS*†?'ÃûtõO†?ŒÚH—Ûq†?@N},†?jIý 檆?Ý,EO †?|w<ž·Õ†?’ê™æ†?¢²7mÉó†?è´–×ÿ†?3vÊ2Y ‡?G„'¥Ä‡?Ü>꟎…“?Uyîô6”?’vy{.ä”?{ê>A•?æ£dÁ7–?Säo\Û–?Ç‘:s*|—?IöÀBV˜?é'Dz˜?M™ªdH™?HèÙ†Ú™?-Ý<µÈgš?ËSèañš?¯ktÍv›?±Qö÷›?<€^Ètœ?˜În/íœ?–m½8a?–ÙnqÐ?~¥³è';ž?4À¹+¡ž?8dc+lŸ?bÀ`œÙ^Ÿ?˜we¶Ÿ?„á{2€ ?ÈH0ïN+ ?PÛAB˜O ?ÅÀ¹ëUq ?݄ܠ?2*7­ ?Dú¹ Ç ?Í|_Þ ?5…aAó ?ûlVt¡?‡ûwÔB¡?ÎákÏ ¡?²h-ïµ*¡?[ÇE!>2¡?ŽñwZK8¡?jùšvl?¡?M”‹i;> ?òq RÒ ?‰¹Û¦?$h¡ºF§?+++ç›®§?Б QÓ¨?Ö‘e¥Ps¨?ËnÀШ?$‡)á(©?x­Ç•×}©?nasæÚΩ?‰«5+Þª?ä—eÕdª?£à ´©ª?xõäÄoêª?îXé“ý&«?½ÞÉ-S_«?ŒYŽf“«?äRÖÇ-ë?Cœ´žî«?x9z®¬?´üà¿P8¬?$Ó hvV¬?«VÌ“ p¬?_£sàô„¬?…öJÑ •¬?½`¢>4 ¬?=Au£¦¬?Ÿ6ºšª¬?›S]u¹¦?Ë,¦ô†§?Á‹øÂžQ¨?Њ›š©?m)eºÛ©?_9º<Ýšª? õ õäU«?¥÷Kb´ ¬?5 /¿¬?°h˜>9m­?(ØgÙ·®?êó7…»®?² ž©[¯?´3j;êö¯?²eâF°?ïXªA°?`(š­UÕ°?qKб?=Â¥Y±?­ü+Ì—±?„Ž:Ó±?I¾æ æ ²?Í|CÇA²?´ó!³Ôt²?öåtÁ¥²?ÈJM‚UÒ²?Uh޹ü²?jfëÊ+$³?ЉqU¥H³?à.qcj³?z.ê “ˆ³?íløéø£³?&©ïtH¼³?*n8Ávѳ?ø*ösã³?V£¿®%ò³?ÿjEDYý³?US5žž´?ⲋ״?𖻉¼´?Aèƒa-­?®‹4Bà6®?¦$…N;¯?œàFþl°?Ü “â´š°?œÄ8Âl±?¿´ɱ?Õº]á²?H½Jyu²?1h×Ç7å²?G`¼} R³?í6È㻳?ò!M{¯"´?ó"`_†´?  >¼ãæ´?V¸‘-Dµ?Nû`.žµ?Ì'+Øôµ?ë‚sH¶?¿Q†Añ—¶?w¾¬!Gä¶?Q ‡&-·?¾ëèIr·??ŸF‡à³·?ï£Ìñ·?„Ð;_,¸?ܦ-T~b¸?L€éˆ1•¸?ï=e]ĸ? z¨k!ï¸?ê²SM¹? 5pb9¹?+­‚óàX¹?ö§¡I3t¹?ˆ¬?Dw‹¹?ù €“ž¹?rJ>Z­¹?7¥^¬l·¹?*î_>ﻹ?¦ïú¤¸¹?û `[ϱ?&–,Õp²?Ù ©“«³?pçäuš«³?Ç“˜B‚D´?Ã6WJÚ´?‡±ØJÚlµ?»ð…Yüµ?ÐçÂúù‡¶?õ#È]·?ÇË1•·?]^ÚBb¸?Ç;ÿàÚ“¸?6`ù2ˆ ¹?Ï«[Wƒ¹?G8ü6õ¹?Sƒü²cº?SÄ*Ü̺?ýõ ‚2»?L"þŽô“»?¦z^†$ñ»?ÜÍ…oJ¼?,Îâkƒž¼?ŽLtB—î¼?à ­^2:½?-v¹ÍH½?M l9Ïý?÷۳ߺ¾?—åå„;¾?°ê'^™o¾?z¬¿ïxŸ¾?2H·Ø–ʾ?<;m‚éð¾?êBì©f¿?˜/°Ç/¿?cr³°F¿?ÞÈjucY¿?®4g¿?oJ¥o"p¿?R޳!v¿?ªË½…‘µ?VÝö‚¤Âµ?ù•ùV(~¶? O+6·?ƶI_˜ê·?å 0áT›¸?-ᓱEH¹?«×ýPñ¹?&–JâY–º?ôOI7»?™Þå+Ô»?^Ûywl¼?ñ«žÜ…½?¨Âf½?¨![Û¾?è?F±}¡¾? “H"#¿?¬£ ò÷Ÿ¿?Jˆ}ôõ À?!th¯uEÀ?/“„MÁ?²“ŽŸ>Á?äørÇ“hÁ?„éÝZ×Á?îh d´Á?'häû3ÖÁ?ÖǺ¤AõÁ?ÂoÖ‡Â?Z£ ³+Â?Q²–²ªAÂ?äœÚ½~UÂ?„qÇŒzfÂ?:{…¿œtÂ?" ˆçèÂ?ú†/goˆÂ?kt=´_ŽÂ? qs&’Â?­š¦5¸?tgê¹?´Ù¾Äè¹?b  ¾{¼º?IšoÎKŒ»?8ðëˆÜW¼?¶ºè9½?.¬mÂá½?ìò÷ÔÙŸ¾?\ˆ‰78Y¿?Ô”†AàÀ?¸Âd«^À?U~ ðï³À?Zjù± Á?ÿTÞ°VÁ?ôÒÓ¤Á?Ѓ‰N¾îÁ?ګĤ6Â?Pú{Â?y~QÐõ½Â?™OçLýÂ?ÓSŒµ9Ã?)?Î^&sÃ?ƒ)xs–©Ã?èIþRýÜÃ?ËþûR Ä?¥œã:Ä?¹Á ö¬dÄ?š¥˜£‹Ä?àém«m¯Ä?<¸‘ÐÄ?„ Ç;fíÄ?È&YM‹Å?º[qÅ?^o|‚2Å? Ž{BÅ?k‚ß=¦OÅ?¾x¥YÅ?h¬²j“`Å?ö}¾?•dÅ?’;$a»?þºqNáY¼?Šœ¼(N½?Úžæ^â=¾?üì0©ð(¿?Jç²G˜À?tÙhY?xÀ?§áŒ$\æÀ?D68¤ÝQÁ?Š2Ã9³ºÁ?sßè¯Ì Â?”ó]=„Â? ü?‡ŒäÂ?Æhn£BÃ?£îФœÃ?L&Œë,ôÃ?À$‹¡HÄ?äs‘èô™Ä?A°;nèÄ?D8ï3Å?m¹¬zÅ?Z—·|¿Å?kÞ²ûÿÅ?¡ë´¢=Æ?§‡#¶wÆ?¼'ae®Æ?®FB“áÆ?¾xFä8Ç?Ø +O=Ç?‚< *ÏeÇ?&š^ɲŠÇ?ÈЭô«Ç?JG`ÉÇ?6‘ “‚ãÇ?`¥Ð›ÉùÇ?E2f È?`Såx\È?ÍsÞ´&È?²ã{.È?yÀ)ù¶2È?ênyd‰¾?j›ž¿?ÒÕû_5WÀ?ÖŒjMÞÜÀ?¡Òä_î_Á?ÍNV²PàÁ?B]_Rñ]Â?ˆžåѼØÂ?‘¡6 PÃ?3õ·ùˆÅÃ?5 e7Ä?´¯âÎ"¦Ä?™´¨*±Å?½}ÿyÅ?Û´à§ýÞÅ?| œ@Æ?«;\•ËžÆ?Ðñ°}ùÆ?1Å£Y¤PÇ?™Qs2¤Ç?ϱøôÇ?ü 7¨O@È?à)™[LjÈ?ÖuzßuÍÈ?\k˜PÉ?tȃMKÉ?æw ?c„É?«Dщ¹É?¢g\ȶêÉ?äoqåÊ?4^P AÊ?v‹‚¤)fÊ?;ú?5‡Ê?ìM#y,¤Ê?³„x" ½Ê?¿q|×ÖÑÊ?0>‘=‹âÊ?”´-ïÊ?´Ò‹Á÷Ê?¡zŒEüÊ?¨/ÎV.ÕÀ?%•dî$nÁ?ÂËõéPÂ?6ºÏ/±—Â?™p¥Ç2(Ã?õ”ÀµÃ?ù‚V,C@Ä?‰Á䨦ÇÄ?Mm`#ÖKÅ?Ði± ¼ÌÅ?æÓCgFJÆ?˜@6`ÄÆ?vÒ]Äö:Ç?€2+ø­Ç?J¿£RÈ?¸iá’ôˆÈ?>ê½ÍðÈ?.ÐÉóÍTÉ?úúùÂå´É?¹œ QÊ?¹:ýa!iÊ?-Y)½Ê?‘F< Ë?Û¶ÌXË?©-GP Ë?QÀ iãË?=sNƒ"Ì?Òæ=/]Ì?«Øñ*[“Ì?dß&/ÅÌ?Õÿ.Û“òÌ?ˆøUå‚Í?&¬Óàö?Í?r†ë_Í? <ÎÊ]{Í?þ…õK’Í?°62}µ¤Í?ÊÄ}š²Í?àÃbVú»Í?]àyÑÀÍ?mǵRcÂ?f^6¥# Ã?.Õ‘ ®Ã?žROÄ?Ê“=ñìÄ?š(åJ‡Å?bLŸÛÆ?Cœy¾²Æ?ÉØÙa!CÇ?*»(ìíÏÇ?5t ZYÈ?#ü}mÞÈ?ñ¯¾ö_É?%PH–ÝÉ?¸”o)8WÊ?x~a"ÊÌÊ?E,áÛ9>Ë?'ºÐu«Ë?ÊmÌ?F¨¿“yÌ?ÊÑ¢MÙÌ?º¡Ôn5Í?ú7¶ÏaŒÍ?€ÄSOßÍ?ÿó[0;-Î?¦iq²vÎ?˜©vÑv»Î?ÄÆKÕ}ûÎ?Zv9ν6Ï?ZÉ¢â-mÏ?:$¼ÆžÏ?ͰcËÏ?dÆ‘²SóÏ?ÖFÿ Ð?7¨)Ð?,s/Þ¢&Ð?ªØ; ¯0Ð?÷ Í@8Ð?hîÎõV=Ð?®ò6šï?Ð?+ÔÆvíÃ?‚¥ä!†¢Ä?ˆXÞLTÅ?°ý:ÃÆ?0q\Õ­Æ?›£ÿågUÇ?ôŒ´[aùÇ?´ãq¨™È?x@õj$6É?ŒI½ÎÉ?j]üZcÊ?õ(zçóÊ?*%iK€Ë?/1ËHqÌ?NG‰³DŒÌ?Oö° Í?œ±Ác¢†Í?Z=¤ÿýÍ?ÔýîÉnÎ?ŒÕÜYÛÛÎ?ºö°*DÏ?e®&n§§Ï?àÝo!Ð? —6>ö/Ð?–½À5LZÐ?šA‚‚Ð?uT a§Ð?ËT*ÊÐ?,]8€0êÐ?Ñ’+]±Ñ?×ýZ’"Ñ?6ñ—Ï:Ñ?‡Mh¯ePÑ?λQcÑ?T‘sÑ?-€"Ñ?¯ ŒÑ?rÅõ?3”Ñ?õUݯ™Ñ?o@¯wœÑ?*2:ÆŒtÅ?˜È9)67Æ?Ü,ÐùöÆ?õ)#`²Ç?• rÊ‹jÈ?9WÙóÉ?©?¹Z|ÏÉ? ‡e |Ê?jME‚$Ë?äì6 ËÈË? á0ýÊhÌ?ôlbkiÍ?hfÜNŽ›Í?Ú—RR".Î?„H½Ô¼Î?ìãì=EÏ?,°ÌlšÉÏ?7’ò‡$Ð?GÉBTÅaÐ?"²_ç{œÐ?o œ¢ÔÐ?ýÒ9È0 Ñ?7ük)=Ñ?ŒRSæbmÑ?þª÷šÑ?V)'ÕÅÑ?Ì¡õíÑ?ª$bAQÒ?ø8Ó÷ã5Ò?XpG¨UÒ?ª„á­˜rÒ?ié+²±ŒÒ?yY²Pï£Ò?rªjEN¸Ò?ÍÅËÉÒ?×m–reØÒ?+ÇYKäÒ?=ÜŒåìÒ?z¶ ‘ÈòÒ?Ž¿ÀõÒ?²†õ÷Æ?Ћ4è±ÇÇ? =⎔È?ÿO^]É?,e),Á"Ê?lŽOœÝãÊ?>Š¤Ô Ë?¸Áà ‰YÌ?WíÇÞ Í?ì› ¹½Í?ŠýªýhÎ?²~‘Ï?^ÇÔ°[±Ï?:™œ>!'Ð?Õ©è÷sÐ?NAºJƒ¼Ð? ±¬áZÑ?™VÍ’GÑ?´Ë† ‰Ñ?áЇíùÇÑ?+ÃPÒ?ii=Ò?¦ `ísÒ?^ ͘§Ò?2!»cØÒ?^ü¨FÓ?ñÕ8‹:1Ó?§:ŒÎ8YÓ?ŸZ;~Ó?à¤9‘< Ó?b”V7¿Ó?Ï¦Ê 'ÛÓ?à‡—ôÓ?µŸZÕ Ô?€3Ô?Â!!t,,Ô?ÇÔ°8Ô?ço+bBÔ? SÃnaHÔ?J¸‘‰ŠKÔ?-uróuÈ?æÐ øäSÉ?ʹ‘ .Ê? O©+Ë?pF#ÖË?…9WУÌ?\ 'mÍ?Œªv4Ì1Î?Z/“’ÝñÎ?þFPy)­Ï?'ñ€É1Ð?ØŠÐ?Åë°’§àÐ?ÇÔã54Ñ?\“f…Ñ?þžPÓÑ?Jñ×zÄÒ?šá½ÿlgÒ?hÝö>­Ò?7C”™/ðÒ?â˜3“40Ó?üŸ¼DmÓ?9š|T§Ó?“¨[ ]ÞÓ? $u6UÔ?2ÿ ú4CÔ?VäÊÒôpÔ?üpÓº›Ô?J…£,ùÂÔ?¡‘þ$1çÔ? µŸ$0Õ?t¯y1ñ%Õ?h××o@Õ?~ÎÉ%¨WÕ?\5o¯–kÕ?øýa‚8|Õ?Ju’!‹‰Õ?ÊÒ? æ *æ“Ò?P4€ÒæÒ?©²Ç°Ô6Ó?•`ÞbàƒÓ?5Á²éÍÓ?ÌðŠ2åÔ? rîÇXÔ? òl‡™Ô?Ê­l­×Ô?BOF2uÕ?älðùHÕ?ÿVë„d|Õ?`›Öç¬Õ?§0üvÚÕ?ÒUXtàÖ?·QïdH*Ö?83hEMÖ?6g…)ÒlÖ?ˆÅÞéˆÖ?úñkGˆ¡Ö?)£±©¶Ö?¾ÿƒðJÈÖ?æS\iÖÖ?{¸ÍáÖ?Â@™èÖ?¢¨¶ ëÖ?žâxDeË?/¼êÙ]Ì?3 ,RÍ?°@/ÏýAÎ?ާ6&-Ï?¬QÑ$À Ð?S¯¿1tzÐ?<àŽÜèÐ?Òºb&,TÑ?c—w½Ñ?ê¢4#Ò?oa㎆Ò?ÍïÈç çÒ?õ?ûË¢DÓ?2´?ŸÓ?G±ßçÔöÓ?h¿ VKÔ?(Eü?·œÔ?Na¦6êêÔ?ŒÒ!sã5Õ?êBc—}Õ?æÕÎôúÁÕ?Õ\Ä™Ö?dRtG§@Ö?™ eyÜzÖ?ÇĤ2š±Ö?¨_Mÿ×äÖ?árö×?¯)³¹´@×?РœzEi×? )Nø9Ž×?¯|₌¯×?1qü7Í×?¨GÚ7ç×?~pÔ%ˆý×?Ûx0}%Ø?=Ð Ø?$3s®<*Ø?Ùœ`©²1Ø?&¶Lðm5Ø? ŠØÕÌ? ÛÍ?A)¢9ÜÎ?Ƹ’Q¤ØÏ?UÎ¥hÐ?`îÅŠKáÐ?œ u4êWÑ?¸@ªYÜËÑ?–LJ=Ò?]åûs«Ò?`))úöÓ?n©@€ˆÓ?DÀâkåÓ? 0—GÔ?4‡DAõ¦Ô?Ö‰B$Õ?ƒsôÜ\Õ?Ó+W¼±Õ?åVœy Ö?”róRÖ?K9mkžÖ?ÖjfæÖ?fÍbhÙ*×?bºÂÕ¹k×?Ô‹«ý¨×?¢@×p›â×?"ÞÒ;ŠØ?¸h ³ÁJØ?êUÆ:yØ?š˜Vì£Ø?1N©5ÑÊØ?hjWãíØ?$“  Ù?A¤y(Ù?štŠ|ô?Ù?ÇDgŠSÙ?nÛ†P8cÙ?¢WFïûnÙ?ªrL¤ÓvÙ?yPJy¾zÙ?jg_~G@Î?îŸÝuÈRÏ?&2ªI0Ð?Aha±´Ð?%½Ø†6Ñ?¬¼Ì µµÑ?~·ˆM(2Ò?ÎÆ·iÍ«Ò?•u‘"Ó?ûAü•b–Ó? –¹w.Ô?‡mÜãtÔ?˜ÆØqßÔ?4-ûÇFÕ?–´÷TÖªÕ?ê#v Ö?.NsÞhÖ?KÕåºÂÖ?’Dãð×?ƒZŽ@ßk×?©; »×?ß#’Ø?’õýÅbNØ?÷"”îs’Ø?f&»ÒØ?˜#·7.Ù?g½4ÄGÙ?Â4޶s|Ù?™cÂ5­Ù?T¼‰ÚÙ?Ô5*ÏÚ?âã‡Rš'Ú?‚×¶~\HÚ?ÊjsueÚ?‡eõº±}Ú?\dÂ<’Ú? î~²­¢Ú?X~tó¯Ú?h#›­:·Ú?® m T»Ú? ”Ê(¥Ï?FPãLbÐ?c̵pïÐ?²©bõyÑ?µ¾€ÈÒ?9„ýÓ†Ò?Þx}¹ Ó?üW£2FˆÓ?ºÌýÈ„Ô?VàtS­}Ô?“:£"­óÔ?£òÂrfÕ?•vzCêÕÕ?ù"’°BÖ?8*“ž°ªÖ?3êNèÝ×?5`Mò|q×?ó !­~Ï×? æž—Ô)Ø?ˆföÀp€Ø?°©ÊEÓØ?è_êF"Ù?ÆëgmÙ?­*þ0´Ù?Nm ¶Û÷Ù?©}Û7Ú?#30nKrÚ?ÜvCœi©Ú?KnkÜÚ?„eé¡G Û?;%Þø5Û?Xo#½u\Û?Ôs<^º~Û?H&DÀœÛ?º$|‹ƒ¶Û?¡ÍìGÿËÛ?N¹€0ÝÛ?œìRÇêÛ?ùJ²ªòÛ?¼‹)ñöÛ?íßàGg‚Ð?²NLl7Ñ?Ùx©s«Ñ?4ÉRù;Ò?9QòT¯ÉÒ?¢5G,€TÓ?c÷µ%VÜÓ?ôÌKLaÔ?ÙÀ%&¾âÔ?:^¼µ'aÕ?y¥|EÜÕ?¶…~TÖ?ôCRÈÖ?) SÝ9×?—›‡åR¦×?¶Ã™„ãØ?æcAr¾uØ?0®NøÓר?žõöô6Ù?;ÀþÜrÙ?ñ佽߿Ù?¥ù>N9Ú?³$‹¤±‡Ú?ª ØÏýÑÚ?¼$A'Û?%þÛ#ZÛ?ÏM’ç—Û?bg˜iÑÛ?v-¤¡Ü?ž ÇÛ†7Ü?î^ƒdÜ?Ü¥€:ŒÜ?õJ `û¯Ü?ÜÚóVNÏÜ?Ô}¤N.êÜ?ÿt¬ò–Ý?à˜œÅ„Ý?¹9õÝ?§‹èÇæ(Ý?N4˜úX-Ý?ý¾g¾Ð.Ñ?W†Ë_ãÊÑ?êËrì(dÒ?LU–úÒ?cð-ÜŽÓ?tÞÊ‘Ô?”È(±ó«Ô?z\ÿÄ%6Õ?@äз½Õ?úȳ»¥@Ö?Ÿ ì†ÊÀÖ?7òWm=×?ÌØ:ôz¶×?°£®³à+Ø?¯[üzŒØ?§¢šÂl Ù?9˜puÙ?‘Gø¢‡ÛÙ?£„e"¢=Ú?iƒ ô°›Ú?q<”¥õÚ?f8|rKÛ?dnU Û?ª”´—^êÛ?Wepïe3Ü?fÀ xÜ??ðH:^¸Ü?Dºz:ôÜ?Ê÷SjŸ+Ý?M»M„^Ý?Œ+À áŒÝ?0½x.®¶Ý?4ê¦çäÛÝ?R°&üÝ?P<,wÞ?!7È/Þ?ÇloBÞ?cîÇühPÞ?¿ð·³YÞ?"o¢jO^Þ?¢ÕSœ[ØÑ?·cP›KzÒ?°O~qÓ?ö@Ò9¨µÓ?U²Ã’ÕNÔ?³áöŒáäÔ?ùUÜõ´wÕ?ø½g'9Ö?øuX“Ö?MJæû×?ËÏ—Ç¡×?“*¨"Ø?$ø„ù5 Ø?HÐó Ù?’SÆ?-Ù?Öo¬HÚ?ŠàOŸapÚ?ÖtGgÚÚ?÷÷ÑH@Û?Ý¡A÷¡Û?µ³ÿ—bÿÛ?y.}XÜ?hx¾ÿ8­Ü?kÃÖôˆýÜ?¶3 `IÝ?2O@´Ý?ÔÔ-ÀxÓÝ?Ù´ ¶£Þ?jyŒb+KÞ?H¶¡®€Þ?a3Ò(-°Þ?$ 5—ÛÞ?m¡& =ß?ŠÓ¸$ß?Ã\"$Aß?›ÝuZYß?OD¹e¶lß?Ï'Ô5{ß?aï¾Ö„ß?®c@=™‰ß?qh%Ô7~Ò?Óè”Å/&Ó?ž*z¸$ËÓ?)ê mÔ?­&‘È Õ?YÞ“H§Õ?„U r?Ö?ãïÕ~-ÔÖ?¼µde×?:`É=ÿò×?E¹.Oé|Ø?—©¸÷ Ù?äè7‰U…Ù?Éa©í®Ú?ìŠJª~Ú?7|’âFôÚ?é [`fÛ?Yš|@ÔÛ?uL†TÖ=Ü?AË÷›£Ü?ܵ?µâÝ?Ü>f°:`Ý?P€L ¸Ý?0]6ùF Þ?/hé×àYÞ?R Z¼Ì£Þ?&«,ÿèÞ?\{Œ`m)ß?LÑO? eß?6Ó›\Õ›ß? $ó¼Íß?HFåß»úß?ÈwjKeà?È×ñ"à?¥g þ1à?‡yS‰>à?ÔÙPnHà?\tmPà?†D Uà?ošœ~Wà?˜*ÑÈõ Ó?mç‡YŒÎÓ?o°ÈÄ$yÔ?Bæ— Õ?oðf¹ÉÄÕ?ô%d eÖ?¦†ÿ…×?`ó]Úœ×?¾¹ Z 3Ø?¨W…ÅØ?ÑÁõ½+TÙ?Mhš‘êÞÙ?o"}n¬eÚ?hሎ\èÚ?ìÖKÌæfÛ?z,¦7áÛ?èÜÑ@_üÞ?%tý^ß?½™Éżß?éSÀÐÔ à?êm©Í4à?¼öóF\à?Nú–:à?ºüaÕ¢£à?6ƒ WzÃà?˜Ã¼àà?¨_ê€cûà?¥`n/lá?µPbÒ(á?ñ·h‘;á?úHL^¦Ká?¥v@ Yá?/I{EÂcá?œ}V·Áká?ú ®œqá?ñ9xQ–sá?—s¢1[Ô?<Â>ìÕ?{W*wÉÕ?^qP¸¨{Ö??Á>¨c*×?˜ïH~ŒÕ×?‘Â"Ç}Ø?è=¨®¾ Ù?*Ý#ø”ÀÙ?ƒà3s\Ú?Ô•CÀ@ôÚ?d¿6Òæ‡Û?º½ tNÜ?fM[‹a¢Ü?.@ݨ )Ý?F « 5«Ý?.…¤Ì(Þ?Ö~ð¾¡Þ?ðý7Æöß?Ä·OÄd…ß?¨Y–èöïß?; 9dÎ*à?Ÿ¥á]#[à?T!’ïòˆà? 9ó 6´à?ŠêÙæÜà?°Óšüá?coEés&á?†§ÚtFGá?–CÁ#oeá?Ù:é€á?FGV°™á?"6Æ[À¯á?Z¹EbÃá?H6wˆ«Óá?ûBg³~áá?·P 7Šìá?貑Èôá?ééÖ3úá?‚%âMÈüá?I@ظmòÔ?¥ÓÞ¤­°Õ?þ!o…kÖ?¾u¸±å"×?2 ˜u´Ö×?GrhÖ†Ø?CVuu03Ù?B¯¨ÛÙ?:™ =#€Ú?Åfa¦ˆ Û?ŒÄ‘¿¼Û?¥¸dë¯TÜ?äÆUHBèÜ?–¦7ê_wÝ?´ßÅÂòÞ?6xMwå‡Þ?¾ãd# ß?ú¶aŸ˜…ß?øý1ýß?¶ƒ§ˆî7à?’ ÀÄnà?Ó%©@£à?#ΫðÍÔà?N¯Ö‚òá?.Ñ=·w0á?wç$¶VZá?Xt ‰á?Úvæá?þ1p3ÐÇá?>q1Úæá?DÄàô!â?ØÇ:£â?ž8”Y3â?~j”AGâ?Ç¿VWXâ?$gO¸–fâ?H)ýoúqâ?°×>Æzzâ?ÂJm= €â?X©#N¡‚â?^iTD†Õ?M¡™jeIÖ?†¨6€Y ×?«½·SÃÅ×?äJ…ƒ~Ø?g'ð3}3Ù?cx»i”äÙ?ÏÚ×­‘Ú?®²Ï®:Û?«cÅD}ßÛ?5o^ÐÿÜ?>¥|µÝ?n<­ä¾³Ý?(rÑÿËFÞ?TÕË].ÕÞ?´Ð^ß?`³5Ü›ãß?®€–©¾1à?kŠ\`0oà?•IGœªà?kj½Kqâà?/T;Ã.á?ë:×¾IKá?ÿlÃcº{á?šÓAy©á?[% UÔá?¥;Æüá?ÄYº1G"â?Ž.ýDâ?4aiâdâ?’±¯òâ?Ëü+)œâ?­{ ‚³â?D¿ úÇâ?ÂQ€¯Ùâ?J¿­9èâ?­}Agùóâ?çSêFÄüâ? çù‡ã?i¥Ÿ ã??ÚBÖ?(7|ÓÝÖ?á÷Í¢×?\¾ dØ?œF£®!Ù??]ÛÙ?ÇæD‘Ú?ñ ­€ªBÛ?F^Å7ðÛ?æw÷y)™Ü?= 7Ù=Ý?~Á2ÞÝ?4/6QšyÞ?ü){ß?pÝKè‘¢ß?'©=äà?˳þ}\à?ÌóÎ6Ÿà?ƒæÀMªÜà?âÜ'á?•mª*ëRá?F'澊á?Õ-Q~¾á?hu½Ó1ðá?u§!â?–9ÍœFKâ?p’}ö™tâ?Mçùk›â?„S°,³¾â?=Tämßâ?íèÏÀ@ýâ?†”Èz'ã?<ëa0ã?Àá?fL¼o™øá? J¸šS.â?ü–Y€@aâ??±RX‘â?ôc/·“¾â?Å4Éëèâ?L[FZã?;ÙXÅØ4ã?…$óVbVã?îŠôñtã?€Ô±\ƒã?zË[©ã?LõGž¾ã?WÎSÆ#Ñã?Ö‰ì2¤àã?ø^K$íã?õêXаöã?fö\rkýã?ÆøR±ä?é«?õO'×?À#Êï˜ù×?%q™ÈØ?"÷½bÏ’Ù?kšŽYÚ?—ªaÀ=Û?§O‘0¿ÚÛ?öy,yõ”Ü?ÒñòçÃJÝ?˜xüÝ?Þ.¥Ö¹¨Þ?Øÿ‘g«Pß?ÄÙ;IÉóß?o,ýHà?CÊ?“•à?¡bl¤šßà?í…‘`'á?…hOÑká?C©–Ùê­á?6 |ÒJíá?MØóyç)â? A~·câ?ê\#ý±šâ?š'‡ÎÎâ?…ä< ã?±à±BN.ã?/ Áá¢Yã?hxölüã?‚ÌÂÔT§ã?¬/‘¦Éã?KÖ‚«ìèã?Á¥ñÏ"ä?JŽÄiEä?`‰ÚQ4ä?„•‚èFGä?¾G²%Wä?hA·þócä?ü¼}Âmä?÷ù@©¿tä?´ wyä?Úfrrõ©×?á2›´€Ø?öÐ[¾SÙ?Ö[­ã"Ú?¸i(îÚ?®sú´Û?™žG©¬wÜ?P!Hïû5Ý?–Æ"ÊïÝ?^Ràû¤Þ?$[BûsUß?éÙWÖ‹à?¥ìr@æSà?“»c¼¤à?®ƒËóà?´¥hª>á?)·s“ª‡á?ÿw¤ ÷Íá? é'…â?oæüJRâ?Íü<<â?!+¦RËâ?ï‚ìJ‚ã?»yÄ8ã?€‹½bkã?’ØùV^šã?îò§Æã?&4óäïã?ʼvÓä?˜‘¨Ú!9ä?î gýYä?Cöf¹ìuä? ZO;œä?wan}#¦ä?Þ+x€¹ä?ÍhÎi²Éä? Üà ºÖä?T â˜àä?âÆ6ŒJçä?Ɯ≠êä?hQP¬'Ø?}è Ù?¿œÌä€ÚÙ? 5‡õ­Ú?@†öÚL}Û?3‰¬[gHÜ?4šÒÏ%Ý?ÎèÝ™iÑÝ?€¢ÊÞ?z\% Hß?€çØ*-üß?á9” ±Uà?+¨õƪà?üÜA5Kýà?Zp1Má?ЉElšá?#yßðäá?çâöi³,â?7n¶×¨qâ?%$‹Æ³â?ÌÁWóâ?M‰êƒR/ã?ÆVŸÊ­hã?xAR] Ÿã? íÃåbÒã?2¸ý‡¬ä?l|äà/ä?´£ùYä?ÌZ£Ëî€ä?.L켤ä?£_`Á[Åä?C;ôÈâä?4܆ÿüä?mËGÝûå?—$­Ýº'å?æ˜lª98å?ÎÊM´tEå?× ŸàdOå?‰Æ?Q÷Uå?ccÚ÷Xå?p¿ô§&¡Ø?•𾨀Ù?)©˜N\Ú?`‡Ÿ[ç3Û?yüIâ?ü³‰ñ‡â?öÀ¦*AÎâ?;̺˪ã?$©Ö $Rã?J“Í£ã?¤ñ9Êã? ¡…³Œä?÷)íïå5ä?¢ÅÚç!gä?ªJ@9•ä?õ}!e$Àä?ÌÌ)WÝçä?TÒõà] å?$ÊŠ} -å?¹ ¿( Kå?^‹¹XXfå?DìÄ}å? '‹þá‘å?ÎF†«¢å?%ô*ƒ°å?&Úz-ºå?'› –ÒÀå?;ßÀòýÃå?†>ÿwÙ?Êì ÏGùÙ?—®Ý@ÙÚ?`{÷ š´Û?¤¸8ê‹Ü?¤?åÍÓ^Ý?¾ t6-Þ?@`òöÞ?ÒËØ|è»ß?ϼ7ý=à?À M…›à?[Î~öà?Ý3ŠŒÙNá?9„Фá?­Is‚÷á?ÃÂåµGâ?kq•â?é¬ußâ?½ípD9'ã?„@cÐákã?Ÿ+sŒ­ã?Ú ¥ò-ìã?š˽'ä?öZ¦u2`ä?€IDƒ•ä?‘_–¨Çä?üðé ™öä?¢oÈ$O"å?ÕÖ[™ÃJå?Àe8ðoå?NÐ¥JÏ‘å?v²è’[°å?Øpà?Ëå?’ðñ×hãå?ëá÷å?"|„ôæ?–OÂGžæ?œdŽdØ æ?Þ®Q¸›'æ?¬³û2á*æ?ú0êÆZ…Ù?z¿œ<ólÚ?ZuÙ´‹PÛ?Þ((”ñ/Ü?àÔµÄÿ Ý?LMà”áÝ?ËîS³Þ?`®Ô.Ë€ß?ÓC¼ÿ–$à?´,ªqK†à?—ÂúÝsåà?4ÉÜ™Bá?0¶>aæ›á?‹ Yóá?L0¢~Gâ?"Ÿˆ™â?}–Ð*Ñçâ?Ëž4ס3ã?âH¸ß||ã?w® WÂã?UFt™%ä?Œ+@ÞDä?Tè 1wä?cL_çºä?¨ÊN#%ñä?ÜÒG÷($å? ̼êSå?â”åc€å?QÝó7‹©å?übh¸\Ïå?¼—Á»Ññå?&Ú¤Öäæ?^ÿ]‘,æ?cîj©ÑDæ?Mù¼P¢Yæ?óA°þjæ? <’râxæ?aÛFIƒæ?&#ƒ/Šæ?äß—c”æ?RJAÜïÙ?ºªôjÛÚ?yÖÒÈÂÂÛ?`ƘîÏ¥Ü?ª•€"r„Ý?``‹Ž‡^Þ?Æú|¬î3ß?Ã&uNCà?Ó}7hà?F/˜dËà?²&Ú,á?ˆñj‘+Šá?ƒS6ˆåá?h †³">â?«K¦`í“â?¶!†Ûæâ?žèA×Þ6ã?ªkG„ìƒã?·šF,øÍã?€Ã göä?Á±:EÜXä?ŸPýQŸ™ä?™!”5×ä?'ÑR‘•å?÷ï£K¶Hå?Z°-F|å?n߃­å?L= ˆJÚå?u¹ïUæ?©7o*æ?ÄÑ‘Mæ?ü©aï%mæ?Ü^ĬD‰æ?½ÊP顿?pj8w·æ?PýS ³Èæ?È"°HÐÖæ? ¾èÜcáæ?@ ¥Ykèæ?/wH°åëæ?ÙJLÈ¿UÚ?è·F’ºDÛ?ÆO¥Ö”/Ü?DcáIÝ?€?¥$øÝ?Ö1œÕÞ?ìE[û;®ß?̀­Aà?­`Î f¨à?5ý'8 á?¾ú~wioá?ÐÁ×êÎá?b3­+â?å=M£…â?Ñb8¾Üâ?º<þàð0ã?ë—/M.‚ã?ÞþJ÷iÐã?æïЗä?;ÑD¬cä?ùrr7œ¨ä?WçÈ ]êä?gÔµä(å?ÃAZN)då?^û!œå?`èÆÐå?yZ‘gZæ?šìÞlæ?6šõù¤æ?ó[¿1 Åæ?L"f•áæ?Y‰GÖ™úæ?nj3ç?S_)žú!ç?wæÃ¶O0ç?!ØÇ;ç?^Ÿa6Bç? $ΟÅEç?éÀÚ ¶Ú?@ý桨Û?šyÚÃà–Ü?ô-´€Ý?B¸ÚïúeÞ?*‰5’Fß?è¼+à?”²xn”|à?kí£råà?ô1¶Ká?ZeRTO¯á?*'¸¯.â?ETEnâ?¶øú¿„Éâ?ENáÞ!ã?—bFwã? ÿE;­Éã?«¡÷•ä?Ó«cíHeä?Ck e®ä?z%Í Rôä?ú†mÊ7å?þ $spvå?e˜Þ@޲å?B‚^ïSëå?Í!½¸ æ?÷;»k´Ræ?L»|@?æ?‰æÇR¬æ?öTŠæÓæ?F-èõ÷æ?æH|Vyç?,¼{Äm5ç?‚pš’ÍNç?zGn„”dç?æ\Fâ¾vç?µÄ€‰I…ç?—Ó‡ 2ç?|³*Èv—ç?_ ò›ç?ß(RÛ?Ë·@/Ü?”¹Æz“øÜ? Õd„åÝ?ò£Ñ¾ÙÍÞ?|p"p±ß?¯%žHà?Ä,f¬é´à?9©#.á?Óiφá?‡Dáx¼ëá?1÷éÌæMâ?d˜è>­â?²v­¶ ã?Gç°>cã?ìw=ɹã?œb7ÇI ä?~¬å>³]ä?Æ›ïùªä?Æh86æ?:&*…Slæ?&:Öùžæ?yã†#Îæ?¦X±DÉùæ?ÒžGä!ç?=áInFç?Ã"l‡agç?2r~Ÿ„ç?ö.&Kožç?r4÷耴ç?86¾ÿéÆç?+þö§Õç?03HD·àç?-æ–¡èç?n*—"Èëç?Ë…œbCgÛ?@?²C"`Ü?t(÷ŒTÝ?Þæ1ìnDÞ?N¦/ß?¦i²j à?¨ƒÕÑÂ{à?n˜Èæóéà?;EÒ¬‰Uá?aïŒs¾á?eÅÜX¡$â?röàMˆâ?xŠèâ?%båÑ&Fã?’Ò© Ë ã? ÞÌhøã?•6pòLä?#DK[žä?x]6s–ìä?Ò|ø—7å?ÂJTå?Ö3ÞZÀÃå?þùýžÑæ?ƒ×é~Bæ?ìTr(¼|æ?Ôäªï‚³æ?S¸®ïÉææ?ªõ-;‰ç?õËÅl¹Bç?áV/§Skç?P b•Qç?†páj­±ç?:‚•äaÏç?°­¾Jjéç?J´ÅtÂÿç?+l°Ïfè?¨›gT!è?n#óˆ,è?ooJÛ4è?IïZ*Á7è?a)¸Û?¢DÙŒ³Ü?]À»ªÝ?Àqm—\Þ?ü¬@F‹ß?ÅdÍÈ):à?:OF0¬à?…¥á?OpµÌvˆá?\áDÝ”òá?ØêÑÔîYâ?}-@Át¾â?´ö ã? ªàÆ~ã?ÞguÚã?‚UôŽ3ä?ö/½¬–ˆä?‚îÚä?–ÆÛ‡*å?«yÑ_íuå?ȵ£f|¾å?‰ùvm±æ?´ÅÛÉEæ?q’1Wãƒæ?²¾áw̾æ?EÅo4öæ?-]¦*ç?éjâ$]Zç?’&ƒ‡ç?ñ3– °ç?¯;Ÿ9‹Õç?=g,I÷ç?¦à%Uè?â­plª/è?PÊIÙDFè?¬\gÝ Yè?lD"ˆ;hè?ÏeñŽ’sè?{µV${è?J‰ ð~è?np†ÉÜ?Àæ9,Ý?xëûÝ?¸ÐpU3ðÞ?в*  àß?Ï2A$fà? MÙà?¬3HïIá?M^Ñvç·á?ïn¡$#â?”Oƒ;–‹â?ÆØq&,ñâ?×½`´ÖSã? ñª†³ã?-ÐE-ä?Èt&9¼iä?{Þã³%Àä?ô•ìa\å?xž&nScå?Zi„þ¯å?¢OÓQùå?Zdç B?æ?6–JmÄæ?6¸ ²ÎÀæ?®Ó{%Wüæ?a$åšT4ç?ôoxp¾hç?Ȩ4Œ™ç?Ǧ¥p·Æç?5Е8ðç?÷vÈè?Áá‚!8è?Æê§Vè?|æ qè?w gô‡è?”B¬^›è?óN¦Iªè?‹Ñ1Àµè?JÓ4h½è?\Cxi?Áè?và'¦rHÜ?¶Ä›`IÝ?È¢3¦LEÞ?0CßÜ<ß?òý«sÎà?Om೎à?ûz4. á?Ž“¯jÅtá?†;< Îãá?S2†æPâ?÷V6K‰¹â?åÚï ã?#°û¹ƒã?ï½Wäã?Æ[AãAä?6–Pœä?Lý-·óä?íä>’”Gå?—»Q˜å?&®iÀºåå?Àß&²Ã/æ?’V7(avæ?€ÝšAˆ¹æ?¦ah¦.ùæ?ÓÏ-‰J5ç?¾L.¨Òmç?‡5~N¾¢ç?Ï@þTÔç?´_:# è?8é5°‡+è?Œ,5ƒµQè? œ´#tè? œïÌ’è?Èu‘p¬­è?T9ì ¾Äè?Š]f/þ×è?Ц¬Ýiçè? !Ÿºþòè?(Ç— »úè?di,Ãþè?ĸ[@ï‡Ü? Ä ‹Ý?¼å ‰Þ?"iØá?ƒß?k1Î…<à?6«v·´à?æz'a)á?ÿ l‚œá?tròL â?'Xyâ?2»ô2ºãâ?w‘3Kã?ŽXê’²¯ã?½ïáe)ä?Ñ­ñkˆoä?׋YÁÊä?üçGÅ"å?’ %u‡wå?WpˆúÈå?Sœèòæ?7ÏU«Áaæ?_¿ç/þ¨æ?çõ⇼ìæ?ÿÙ0Eò,ç?ñxÓ…•iç?¯µ:õœ¢ç? yÍÿ×ç?ÖRWص è?PGp·7è?XX:ýaè?NÄa‰ˆè?œFæ™=«è?z;¦W,Êè?è¤ üHåè?ÀsVüè?õzËûé?êèY‹é?GþÖ—;+é?Õ¬Ô² 3é?F$a`÷6é?˜}ès,ÂÜ?ÒÉ2ÇÝ?|Qœ3ÇÞ?HšU0HÃß?e³]à?²d/ÑòÕà?Áe?Lá?¼HTâ¿á?9ívÈ0â?MÕœNážâ?ÔÊ“ ã?VI³frã?8†{޲×ã?t²<~ï9ä?8†U™ä?°/æcõä?ùÅËw·Må?x²à%£å?a¹1q>õå?úÛô€ôCæ?Phî;æ?(°! ׿?„9° Qç?d¤û* \ç?>Í‹'™ç?0ÆÆ¢Òç?2ì rè?šdÏ:è?ôn'ìhè?›4ˆ“è?”ü­Zºè?=¦ž]Ýè?{ æ‹üè? ­ûßé?JÖ hV/é?Š™LëBé?ÜX…›Ré?¬Ï1éd^é?ÛUEfé?JªŒ³;jé?P$uùöÜ?j]~‚ýÝ?4¶Œ$]ÿÞ?hÁvÞüß?‰¡‰ã¸zà?q¹_¬xôà?抚؛ká?çuzàá?=$)ÃQâ?nŠóµ£Àâ?‚ ,ã?…žب•ã?¹ó“{¬ûã?fÉ夛^ä?:«• g¾ä?)oàÿå?HhÚWtå?ܾ.aÊå?ñ˜æ?A|WSlæ?ÃÓ4#¸æ?So„rç?’¨¨$6Eç?‘Ïc†ç?ÎoP—ðÃç?Ç·BñÓýç?å½Î­4è?BZu~zfè?xÃ%©-•è?æˆ Àè?E›i0çè?Î]PÃr é?IEÂÙ)é?~Ó~>`Eé?²±A]é?@Þb»pé?¦ÆT‰€é?ˆB[ViŒé?<$;wY”é?(JFX˜é?æ8Õ“$Ý?  ùQþ,Þ?¦cü€Û0ß?ÕÒ‰÷à? ¾}6•à?Úk^4‰á?ÆØeŠj‡á?D’l«˜üá?ɉ soâ?-@)“Þâ?ÎŒ†+íå?+K÷¥\@æ?›UYêæ?œ+KÁhÜæ?IÞk+%ç?Ú¸\jç?É1Æò«ç?§)9áéç?[Œ¯Ú $è?½ xú§Zè?&ÒÀ@nè?pìk¼è?O1OÒ™çè?€m÷`ñé?Hª|l2é?Z”$Ré?]³ )¹mé?œÙr…é?Èó—X[™é?ðˆÓÅC©é?tSm18µé?J¶¤6½é?·ÔdÏ=Áé?´Ð‹‘LÝ?P´£¢VÞ?ÐjàŽï[ß?õüg-2.à?q Õ‚î«à?ã) ¬'á?„+*¨ Ÿá?dÒkÌpâ?äÓwˆâ?Fcëæ£øâ?=¸6 ãeã??´Ç&Ðã?mbÃZ7ä?º…Á½q›ä?|É…[üä? æ¿ Zå?o›»l´å?Ktv æ?Š»]Ì_æ?SC,:L¯æ?¥Xcþûæ?Áí¶x%Eç?ÐZo:¶Šç?:í£÷¥Ìç?Vyj‘ê è?ùc|zEè?Ú²xÂL|è?UÃsY¯è?‹øh{—Þè?hÉù é?õ¯üëŽ1é?í0VX;Ué?~ê%Þué?´?ijÚé?Çû£Ä¨é?͈ª»¼é?óƺÌé?ÉKÁØé?D,«‡Ìàé?¾¥ñÕÚäé?dHè•oÝ?fä±zÞ?–Xn…Ž€ß?Þc Aà?—öçÒd¿à?Œá,Â;á?? 3´á?*ç’*â?4úõ:žâ?U¡´¡Êã?ÐEŠ|ã?Í>aIçã?ÅN öNä?Ë~`¼‚³ä?x:àäÝå?:§ ùrå?AÑ«ÅÍå?Ç£½5%æ? ¾Å;yæ?GßÐÊÉæ?ïubvÖç?»A”ÚR`ç?‡Ú“°4¦ç?ÈhQ)‘Ø'—Þ?´vžß?„Ýøñ˜Pà?röÚK`Ïà?š¤{‘Ká?”r:Åá?µFM–ä;â?Åø á¯â?¬L¨‚ü ã?ÊáTf%ã?¹3u—Júã?,7¶v[bä?ö4ÅäGÇä?½´C)å?—ö{xu‡å?Ýäkì˜âå?ÀCÛŽ\:æ?SqÒֲ޿?.¤éÄŽßæ?*#åã,ç?HVïP¦vç?'+±Ê¼ç?ÊæB@Fÿç?ÃJPÌ>è?¾¨Y¹yè?wÁ‡a°è?ÀÐkAÙãè?Úª¦{é?…/*A?é?³ñÉ"gé?~H, ‹é? ìz$«é?…c:Çé?i”©Xßé?µŒÐ½{óé?6Þë‘ ê?)ÆÕŠÄê?#mqåê?ö‹UPê?ô@õ¡Ý?1ìÎæ­Þ?Öph¶ß?.0:l²\à?ååé×Ûà?õ+IeXá?’mO»GÒá?AMãkIâ?„a¿½â?®°±+//ã?¬Znªã?åÅ×° ä?gIE~qä?/sÿµÖä?†„5·8å?=~äÂr—å?r%zÚòå?wæÞJæ?FrAÏsŸæ?: ¹‹ðæ?cHB(>ç?_},ˆç?⽨ekÎç?½è?qå<ÙPè?Êò7F‹è?lâµÂè?%°)Söè?—d‘X&é? f¸ýQé?NÛ£«üyé? C›Nžé?]À¯b0¾é?`Þ—K[Úé?hÊ;Œòé?>ØO&¿ê?—ñþ¯ñê?∰!#ê?â3l%K+ê?Xé™"n/ê?訿ŀ°Ý?˜„£¾¾Þ?æÝiÒÕÆß?¾$„ÏXeà?øºÁäà? ŒYñ‘aá?°YjǵÛá?+’þöSâ?¡sâ´«Çâ?õèºX9ã? {G¨ã?D|]¾ä?Óú­ŠT|ä?V™SVÂáä?©%åÑ÷Cå?“žÒå¢å?]Dœ¯}þå?Ó+˜J±Væ?øƒ s«æ?CÆßµüæ? O HmJç?Ψ×M”ç?\r-‹ Ûç?!Nñ,Úè?cpûóñ\è?8å9H˜è?ýÞjîÓÏè?Û¤X¤Œé?c¿Y‹j3é?sDýxf_é?®o®êy‡é?ÜÖ Ÿ«é?â˜ï¬ÐËé?®†W èé?f?0Hê?FI÷†ê?þ†UäÃ$ê?N¢“„ü0ê?`ç݃.9ê?éÚ1[W=ê?b± ¸2ºÝ?ôÂ’¯Ý?ÞØ`ä½Þ?T—JN¸Åß?¿w;3Ídà?VQ<äà?5bªaá?QO ?Ûá?“(Ü©Râ?›—?Çâ?ÿ$ìð8ã?^¯ø½¨§ã?°ò¼zYä?or‡èï{ä?½ÛÏ:^áä?™Og®’Cå?ˆŽL€¢å?µRïqþå?/¶–IVæ? •/ˆ«æ?#ײÈIüæ?H_`€þIç?ä½5d”ç?l<n–Úç?KòFcè?cÊ-1w\è?ê-íÑÉ—è?"$L¿PÏè?·7ê¥é?ɲŽÜ2é?&L¬Ò^é?åE½á݆é?ÀÄ™øúªé?ý¸xŸ#Ëé?>'Tçé? oOŸŠÿé?|øõÄê?^´‡“$ê?RfhªH0ê?y›•8ê?‹¤Ýç<ê?µiŸÝ?(`šÜñ«Þ?ø^ìÐ ´ß?éˆf´¹[à?"üºŸçÚà?ÑeÀÆ…Wá?—"[ oÑá?áL*ŸHâ?´Cyô¼â?hi› l.ã?Âsôþåœã?.¹|_ä?ÈMº’ºpä?õ]€uôÕä?Ö×7äð7å?Ÿ5­–å?|±Iìòå?¼tr†Jæ?zùÖ`¢žæ?øà?1+\MÔ¼à?BÎä*9á?Áùôʱá?ӹ焫(â?+èìÄ¿›â?ˆ#I*è ã?vùº.zã?>°×í[åã?«“=°“Lä?Ј#…±ä?oS÷oå?m†vÉçpå?Ƹ ®IËå?cÂFÏ#æ?ìq³°væ?Š9ÆŒÇæ?aÍï+;ç?ê”Uü]ç? _*㇣ç?[jT‡æç?þÒ^%>$è?{ÁQÿD_è?zÙ³å –è?oÔ~Éè?¶†ÇƯøè?^¬²h$é?­4ÍúäKé?Ùq¶VÊoé?]Vwé?ý¤AÓp«é?§§e8Ãé?ªU’5×é?Ÿ^[çé?”ó²Çóé?¤z==ûé?4ï~jê?¾1;MŠ=Ý?€H° QÞ?<äSQß?+“x’?,à?͠à??°EæY%á?²w _ôšá?[7]!­â?ˆš—R܃â?S´¤NÅöâ?ï=Ô%Kaã?ÙÔšA!Îã?Ó-rñ¾2ä?òœ °@™ä?ì=ý{¹÷ä?J/æj¨Wå?Îýœ°Â¯å?íO¨äæ?ß4AµiZæ?,_[™†¬æ?_ÿ€E÷æ? ÌO+Bç?ek9õ…ç?}þ—›uÉç?¨C:m è?7*cnBè?”Œš-wwè?5Ôt=³«è?–;ö±Ùè?€†õÇé?~G2‘,é?g.$UQé?~9eáÛoé?⼈¾?Œé?Y”â(\£é?0X }˜·é?V:Ø’ÙÆé? t¯àÒé?…5C8<Úé?é.déÞé?NÃè ¸ýÜ?2D{>æ4Þ?ý(ì8ß?üd|Hà?È:1U‡à?Ùä8®á?ëðz†Izá?&7ÙUâ?³œ[0bâ?D"mÍËáâ?2Šä³>ã?°EK “·ã?æÆUóRä?÷%™ß+ä?º”, Óä?áƒwÍ>å?ÈS¢PðŠå?v2u]ïíå?ê-5æ?ÒΆ:æ?>Y¨ÖgÑæ?æ3;™$ç?+û)¤´_ç?âÂý°¯ªç?°j‹?”ßç?®zFŒ*"è?Û¸’±¶Pè?›×ß¾Šè?ÒÌê+Ô²è?`“´Ý)äè?¨R¦;¬é?ÑÇóà/.é?e“KIé?ƒ—d™hé?ÞÜ83š|é?ä_HA)“é?jÖK  é?ÛͲ#z­é?˜n}§²é?bŸLˆŸ¶é?·³9Îõé?LgÞS…é?8vBÕé?V*C½$–è?o!<ð©è?N#Ñh—ç?‚ú9‚‘ç?ÞLÁŠæ?þœ1'<þå?/—çnå?ìÓVUÜä?¨lEzFä?Z©ü.­ã?ró*‹ã?ù€§râ?qƒ'ÄØÐá?K;r],á?"¿Ú¸(…à?ªæ;ö¶ß?ʈ¯°Ž^Þ?¯÷‚ŸÝ?éQ Û?ìb`a:Ú?ÁP©1ÐØ?f Q{ïb×?ô…üª™ñÕ?^Èo}Ô?(iÑçÓ?ôé}p1ŠÑ?2tOÿL Ð?ñ)K&NÍ?!RűÊ?ü{—'Ç?üéöXçþÃ? Dœg7òÀ?Š?Dh&û?$‰Ìœµ?@4/Ì«å®?§íZ»Œ¢?•ë$òñˆ?–\t>ê?«Œ¨ûðÈé?ïwß]Qé?£>§«CÖè?mƒ nWè?øG»âÛÔç?Ÿrÿ“¡Nç?|ÑÖÍÄæ?« r¤y7æ?â,¶¦å?Lñ㦞å?bÎpWD{ä?3ûõdÄàã?zCe‚0Cã?èO+§¢â?H0ÆÃ:ÿá?ÂD¸å Yá?Æ6ö˜*°à?øÀÓ|ºà?«ì0`œ­Þ?é×¼mMÝ?9 FkóçÛ?k•¨È~Ú?e´– Ù?–Ö¢Ó®Ÿ×?bùd‡Ÿ*Ö?£][t!²Ô?âŸ|)Z6Ó?Ôà`~·Ñ?#`Ò£5Ð?öC\˜aÍ?ânì^ÖRÊ?éiú{}CÇ?Æ… ˆ›2Ä?ÕXÚ¾“Á?YŠ{FI ¼?ˆBçKÔµ?‹?Ü&5¯?LÐ+Œ[¼¢? ÿEY‰?†]Dˆ'zê?Fpmê?fYœ¢^é?K2ª[1é?ï¶h%“è?ùnq/Rè?B$‰ìˇç?S#1­¥üæ?mä-õmæ?å"ÏÛå?‹%UØJFå?&‚ <~­ä?p±Íä?X%ñ~lrã?x`äÚWÐâ?Wx¼[+â?¡¹Ÿ’ƒá?¹¦”4Ùà?2×BÓþ+à?£Ê…ÑÑøÞ?Úk”ß”Ý?½¬+¡Y,Ü?ºŒ7Àz¿Ú?ròowNÙ?[—‰Ù×?Þúcæ`Ö?…š£vÅäÔ?ɧ'ZeÓ?°iVÙâÑ?Zö¯cr]Ð?D¶QЪÍ?Oo)ã8–Ê?S\Þ~Ç?ûxÍÒdÄ?¶!O&‘GÁ?!ÚÂ:¹N¼?… ìÍx ¶?évŽÍ¯?Ÿê•Îé¢? `!š=‰?;˜QªËºê?¯%ÔùøCê?U;‹ÔYÊé?lt\üLé?vPrÆËè?ÜDŽÀÂFè?ínPX¾ç?ÿ^Ûœ1ç?Öºv¢¡æ?6 +æ?äãÈMwå?\z<!Ýä?Öûȼ?ä?RŸô8Ÿã?¬&Dp®ûâ?–߃46Uâ?H¬@ ê«á?–WÊãÿà?:nz>Qà?°8tû&@ß?T•ÕþØÝ?&™;:mÜ?Ñ®ýÚ? ´TغˆÙ?Š«r$pØ?éOÐh”Ö?÷ýjÝÕ? ŠL£’Ó?‚׌ Ò?¿&#XƒÐ?ÓöêB ðÍ?Î=gWýÔÊ?W|Š^]¶Ç?ѳ—ÛŒ”Ä?®Ò¶ç¬oÁ?H‹J¼?!Œ‘4<¶?? T3dɯ? 柷-£?5-ÔuZw‰?°cü;Ñðê?úóúö{ê?[§yOÛê?9óõÓŠƒé?ácÊqDé?H®Ýo#{è?¡žS=ñç?Ï®§§cç?ùöHvÒæ?w¡¢÷À=æ?;#è¥å?Ä÷Wc$ å?ÅfNlkä?œŽÉã?œŽp¢$ã?³ÏæÂ|â?|4_= Òá?´DH¬$á?Õ\@âptà?ÐÑ¿ƒß?Œ^H&`Þ?ÐuXŠªÜ?Ò5ŸqF7Û?NÜèìÌ¿Ù?Mo†ÚVDØ?ÐíŒÅÖ?eÒéZBÕ?ðË|I¼Ó?¤¼³%3Ò?gòÖÐ.§Ð?çì­lV1Î?*ŸÑË?Ë®iêÇ?ÆPpË’ÁÄ?Ϩ•Á?md&μ?îyjVl¶?hj«é°?2aíU>£?*£bfï­‰?ðÏ‹=*ë?åÖÅ-ɱê?v¹Ë­F6ê?Hü̱ç¶é?Ñ£¾š3é?hlòÚk¬è?f: µp!è?òJ º½’ç?Ä‹‘°hç?·AŸù‡jæ?ÄšàŒ2Ñå?âneï4å?¼q^3ˆ”ä? |?ícñã?è¯3,Kã?óš«”ú¡â?æ{èéõá?ÔÏ)Gá?¾•ꯕà?J¤ÕÒÿÂß?¢ñŽòöUÞ?Ù3P°>äÜ?­›©nÛ?þÏs£óÙ?ØäD®2uØ?ŽAmìøòÖ?Bð0mÕ?‰óxçäÓ?ŸÙ¦«èWÒ?6y¢–æÈÐ?Ï“˜¨nÎ?Ë0C"ðFË?¾ÆÖN-È?„ñ¡¥ÚëÄ?Jïf¹Á? Ò‹‚½?'†åá¼™¶?Œ8ñ^q'°?Ö] Í6e£?ˆ b…Åá‰?} ìüYë?wð«3*ãê?€ âØ1gê?Þ+°Aúæé?Ž8ÇN¼bé?&Úè?¨iåß”Nè?Du¯m×¾ç? Mäp+ç?F`èw”æ?ú„/ªúå?Øn—ä+\å?^uéÚ»ä? fáS³ä?d–Doã?´¼åaÖÄâ?æ-]î‚â?H4’âdgá?ÿMR—´à?Ò¡ƒmkþß?FãþÙ·ŽÞ?ÞS•[LÝ?йb¡Û?eÇ+ß2$Ú?¾Ó§2ù¢Ø?£ßJð×?JË@9T•Õ?œÊÊb Ô?d(|tXzÒ?”Ž$owèÐ?s•æ¨Î?2¡+£ozË?|,Š»HÈ?]Û¿»bÅ?bšöõÜÚÁ?¶ÑB?½?Ën»OĶ?:u.ŠÚE°?j½0¾‰£? ºûÉŠ?1ÎùŒë?üUˆ!ë?AÛ&ñî”ê?Ö ñÉê?¶LdÀ¥Žé?2ûé?fýæ¡xè?ÇÆKJìçç?Žøs‡Sç?Œ°§‰»æ?ÙkCÀ æ?Õ«cõ å?¬Pª*çÞä?b"ÁUu9ä?»9˜ëäã?®sþÛOåâ?Ê`Ð6â?ç²Ø…á?èÅÑà?oKºãà?ÕÉ'˜ÃÞ?^Ì’©LÝ?ÛÖ^¸3ÑÛ?0N™—rQÚ?,SÖ½ ÍØ?"²7úE×?ØŠœ,»ºÕ?bû<×!,Ô?VŽÌlšÒ?ÈËžõÛÑ?Îÿr`ÝÎ?PPþÂUªË?)âLsÈ?œ6’±)8Å?àò‚ úÁ?pAr½?ê)¢ýë¶?šmÏÏ5b°?r»óΫ£?ÔaØz@Š?8ªrLµë?ýн<ë?:}“¨!¿ê?¦ 'e@=ê?dl:L·é?lY`_-é?• 9Ÿè?lCòçô è?¤ðóô£xç?RËÍi´ßæ?>žÃ×=Cæ? €ªWX£å?Y„ ˆå?å(4Š£Yä?:c¹þ°ã?>½Žaã?d¬õ%ÌSâ?@HDrc¡á?ˆœ¹[Bìà?‡]„4à?jNbÚôÞ?¶%“ K{Ý?;ÞŒ5{ýÛ?ÈÍé(Y{Ú?‘‰‰~ õØ?þöÊ’ k×?$_‘]ÝÕ?8pNLÔ?x K¸Ò?Lð‚¯!Ñ?N®+ÀÏ?æ V¢ÖË?Ü1 ÉFšÈ?¾@j<-ZÅ?šÔÃFÔÂ?¢×‘*t¡½?ÖÞfº·?UµKz|°?Òe3hË£?ÛJyvkŠ?Æí‚‹åßë?£HžÊµdë?æ:¬-æê?çiGccê?Šü°ªÜé?BÆñ¦õQé?õóèXÃè?ºOPkê0è?2öäÏÀšç?¤ ìCóç?ÜÉÜ™cæ?„-TÄËÂå?Öá½×¢å?™µn8wä?ŽùK¥Ìã?ÿ7Cã?˜R³Xpnâ?¥å»á?º¨¥_Üá?˜[ÿLà?ت0¬!ß?ÆÔ‰)¦Ý?EÇUô/&Ü?4[ØHÞ¡Ú?žð7|pÙ?¢ºEO#×?â×F4ýÕ?ð«áiÔ?êû„jÓÒ?àl;ˆ:Ñ?:æÚ<Ï?¾cRÿË?®ùM«A¾È?tî}LjyÅ?ú‚¯Å?×söö"_Â?àü¿ñç¾?1¢PÞñl·?·(æ1j¾°?äaq¯¤?•¹÷YÖŠ?ôÍâ”DAì?n#ŽsõÅë?ÚHÔÒEë?zN©–aÁê?d‰ê6Ì8ê?€mª‚*¬é?WÍÒ’é?ÚÀž‡è?÷\åÚÛîç?ZgëRç?—Ja³æ?€9a,Wæ?Þ½ºÚåiå?ÊÕ‰ÿ&Àä?©¢Æ4ä?ôØ)cã?-Þ-Z!°â?s³™ã6úá?"žü€†Aá?ü?¬¬,†à?FŸ°—Œß?«ÛUáÞ?êl/ô’ŠÜ?‚[¬“ÝÛ?q*-þrÙ?s:ô1á×?|íz·KÖ?Îï|ͲÔ?wád³Ó?U\]'©wÑ?hݪPÞ«Ï?X÷WŒcÌ?R`ŒˆÞÉ?š…ˆWÆÅ?¶|›pzrÂ?@ÆU˜•7¾?þØ!™…·? 5'а?Hšãª×/¤?dCfLlòŠ?V«bp–\ì?Žo€†œßë?'þ$Î^ë?>CbÛÙê?DHU­ÇPê??I¥Ãé?Œ¸Ë‡‰2é?XÈÙÀŠè?ˆ´õ¿è?Œ=#¾@hç?wÌOB%Èæ?åSã6†$æ?Lø†Ù|}å?Þ¶`í"Óä?Û­{·’%ä?l‡ûætã?ßéõ:Áâ?‚[<\ª â?¿"UQQá?ÕXvL•à?äcû‚q­ß?`‹;ÍŒòÈÏ?ëz‡ëž}Ì?Ƕ Pê-É?…{âWÚÅ?Gn`kƒÂ?2ëARS¾?}ám,›·?¸îúnß°?d§MB¤?¸s‹; ‹?vFqVqì?gývt2õë?Œ$Ôn-të?Ž”²¥Úîê?Î8/]eê?ô!ÆÌ×é?~{0¸?Fé?~ü–”̰è?‚ï´sŠè?Îíÿzç?¸¨*tøÙæ? ‚§˜Ù5æ?„0e¿MŽå?'…ŽÀnãä?uðÆöV5ä?Åg;!„ã?o±§âèÏâ?r!½·Éâ?óCçøß^á?ÔTxSH¢à?}¬©¿?Æß?q×:CÞ?F1DÝ%»Ü?îïP)Õ.Û?î°QVSžÙ?™6nGÞ Ø?’Ô´qÖ?Ãc"ÖÔ?ħÐ?7Ó?xݵt•Ñ?kìùÛèáÏ?'¨Wýÿ“Ì?Žø0ž±AÉ?.)%HëÅ?IÈV@ó‘Â?C¯>k¾?²-/×¥­·?” =x™ì°?†Uê¯R¤?î}g>%‹?ÉkÂ{…ì?3‰‘ì?Œ®ò†ë?(@Îbë?ÜJÝŠvê?FZpèé?Ò ¦É±Vé?4(8ÝÀè?ìõ¹à7'è?˜ïu؉ç?\â˜×èæ?!åß!NDæ?†G³sUœå?òÑéwñä?~ ›~Bä?hؾÈÕã?½ëg(Üâ?bEºV’$â?1·‘æ/já?xØ­à?ÊJ­òÚß?¶f½é¿VÞ?õ2OßÍÜ?¸U¤ƒ@Û?ÛË÷߯Ù?0‹LfŒØ?Fé´·Y€Ö?ƒGY ¯ãÔ? â(ÌCÓ?–„"ñ Ñ?\hd§½öÏ?©N­Š¬¦Ì?¡Íë1RÉ?œA”ÑùÅ?Wõ•žÂ?¼9æ~¾?´ÊF^½·?«;9„÷°?¢, û^¤?S ºC0‹?¯†¾ “ì?Üí±ùüì?bÉÁY”ë?g3ühë? –J„ê?á#öé?îðÖªÜcé?s¿¸ºÍè?æ[YÅ3è?È"îO–ç?Ô¯ó¿ôæ?šçç(áOæ?Ò½G`‘§å?\dþêûä?EwÏ5Mä?B…úH›ã?؆B@÷åâ?2hä.â?­é{?sá?ežÕÿʵà?íUWq†ëß?Ï?’žŠfÞ?x ŽÞÜÜ?%…¿NÛ?Îq»ki¼Ù?bÊkæ&Ø?ýk¸'ŒÖ?;Ëv”îÔ?¯ŠT ÙMÓ?&£ ë$ªÑ?í¨ ·Ð?–TL¢µÌ?³ Ïli_É?UkPQGÆ?鈸À§Â?ލ]ÿ¶Ž¾?¬~­Ã=É·?þûä'±?¯Û´š i¤?mÕ-Jþ:‹?–¸ÍÌžì?¬^!ì?A™·ïŸë?€‰.–ðë?!"‘›Žê?₦.ê?0§ð½mé?Øb±a×è?×v€‹0=è? †ðKBŸç?\ÈŠQ¯ýæ?¼³ÜŠXæ?ì¾òqÿ¯å?`–zå?±LÚÓîTä?È9Ù¤¢ã?W–w™Síâ?/Ó 5â?a˜  zá?p„f-N¼à?™ZQö÷÷ß?l§!kerÞ?nœ.Õ èÜ?¨1 gYÛ?q”uÆÙ?© Š/Ø?ÙªÐä”Ö?£ÃS¢ÃöÔ?ˆÉ½ÛfUÓ?u®¬Æ±Ñ?A|ü Ð?ç ©ÅßÀÌ?ÝÊS1WiÉ?]aâ Æ?Ñ6ðç¯Â?‡øŠš¾?ÙšïÜVÒ·?©ü#c‚±?ºÌæ3Wp¤?´’©H?D‹?Dï“ëÇ¥ì?Ålr<(ì?Ä1¶<¦ë?ÙI­Jôë?çÓñ{•ê?"©¸éê?ø„QÀSté? Cž¬ÐÝè?à Õ¸wCè?kĶ`¥ç?NÙ– ¤ç?í±¬Z^æ?Šàèžµå?™´ˆZˆ å?¿Ørý3Zä?„¼§ã? Iµ<òâ?e¢YÐ9â?Æ|w”~á?Oü¼)¦Àà?D`pu"à?ÞNzÞ?ZÈͤïÜ?˜ ««ƒ`Û?gê}*ÍÙ?‚ªs¼Ö5Ø?&£A4ÇšÖ?©[÷=;üÔ?nȤ°rZÓ?z ÅÓ­µÑ?&ÄÕP-Ð?KdÈÌ?Þáð1ûoÉ?'‘‰r¢Æ?ñÉjØÝ³Â? Ô²—d¢¾?€ wMØ·?÷…»éŠ ±?ÑQ…pt¤?8"”¾ùB‹?ò¶±™²©ì?)Œ‘`è+ì?øvÛÏ©ë?I­Â¼t#ë?êÐèNê˜ê?€e³E ê?ÀËæàœwé?Õ7xáè?bµ™Fè?ðü’ln¨ç?-¶ç?@€›x>aæ?‰Il¸å?ð0ƒ@ å?«Vš¶Õ\ä?X*ÂóFªã?E³—Ưôâ?SÈè2,<â?Æý¯Ø€á?ˆø4$ÒÂà? °Šà5à?ÛŒâ7C~Þ?$ÝfóÜ?ì?@™dÛ?ôXå‡ÐÙ?)·1Sÿ8Ø?8Z»Ö?÷ aqúþÔ?þ:nü\Ó?|˜R‘¸Ñ?'j«tJÐ?,Îyî/ÌÌ?•8(NVsÉ?ÄB{[ŠÆ?×Ë•N¶Â?¹ÿgóK¦¾?>·l‰*Û·?ï÷L ±?\;m¼Çu¤?v×a‘“C‹?œ «©ì?ÐE%ã+ì?/ÄiË©ë?ÛÆ>p#ë?òÁªÏå˜ê?§7XA ê?§J1°˜wé?¨wáè? dÉè•Fè?OE(Ùj¨ç?i~ȯ™ç?ôRGd;aæ?ûÏ_zi¸å?¸ ûý= å?]0Ó\ä? [4Eªã?=ð47®ôâ?ó!þ*<â?kZÚ×€á?¢3K²ÑÂà?`¿äÖ5à?û†éýC~Þ?媭„hóÜ?vŠâ)dÛ?©‚䂊ÐÙ?"KsÇ9Ø?Œ×¥ÅÀÖ?}#§ÔÿÔ?)J²Å]Ó?jqÒ ¸Ñ?#W_‡SÐ?&EPCÌÌ?PºÒjsÉ?pÌœÆ?Ù1Q2\¶Â? ÞO¦¾?Ö݈ÃýÚ·?&í=à ±?†.éÐ_s¤?¼æ¶3S.‹?JΡ_¼¥ì?›¤.(ì?¡à­­.¦ë?s‹osæë?ñ-4on•ê?âù—¢Üê?Ô¼(Gté?Eó¤ÄÝè?¯ÄmNlCè? >5øU¥ç?f±šç?ƶkQ^æ?G¬Á¨•µå?¥8,Ç€ å?UïS-Zä?24Y¶§ã?‘öb7òâ?éynÌ9â?Edþñ‘~á?ÖuϤÀà?ÉôT"à?(éePzÞ?v¶.©ïÜ?ÎÇ;W‹`Û?púù4ÍÙ? Å1ä5Ø?WovךÖ?”pSkNüÔ?3–ÁˆZÓ?3¯ÆµÑ? Øh¼HÐ?G‡.GŸÈÌ?AÆA8pÉ?ÜOWBÝÆ? B! ´Â?ã—ˆ¹‰¢¾?­ZÓió×·?·¶<ÿ: ±?i’ÐxÌn¤?Š2ÒÙn%‹?½ÀÐ0±žì?Ì1&î ì?¦X :Ÿë?qmcÙë?®~ö„Žê?¢÷¨2ê?ešá¨mé?÷2/’M×è?9£Šu=è?LjU0Ÿç?`sžýæ?˜?=Xæ?ˆ³iTñ¯å?yë³Z å?qlí©ãTä?uåèG›¢ã?ÒøQ¶Kíâ?›qî5â?¬cÚ\zá?mÜÝK¼à?Ö‚ži÷÷ß?ùµirÞ?°é²õ(èÜ?LY½sYÛ? q¯ö†ÆÙ?ê‹zÅ /Ø?ލæÿ”Ö?ÑÈ^¡ãöÔ?ÿœB¿‹UÓ?Z¾Âv8±Ñ?•¹–Y* Ð?tgCnDÁÌ?Æ$ÛÁiÉ?qÒN'NÆ?}Ô‹h¯Â?ÜQ¦P›¾? ê›6FÒ·?b§u‡ø±?]ú“{1f¤?}ÓÓHU׊?byÅë’ì?®n ÆÛì?ÅÆPÍ7”ë?€d!Hë?Ñ€F*„ê?΋G0õõé?3 ¿cé?m¡àjžÍè?;ì ª3è?(#q û•ç?9-a¨ôæ?í… cËOæ?Žã°}§å?Z ¶´Øûä?ê¾w÷Lä?—ÄÅôšã?'P9ìåâ?™ñ‚Wù-â?ñ$Rë8sá?l€¢Çµà?I®hm…ëß?Qh;“fÞ?§o¹éÜÜ?Ë|›ÐNÛ?¿R¤¼Ù?xšPå:&Ø?1yR ;ŒÖ?3jLÁîÔ?³þTn NÓ?@(kª_ªÑ?~¦øÐ?¶x]Ä2¶Ì?ZÙnE`É?Zy\îÆ?Ú,ãm¨Â?¢GÉš¾?Fû»ºSÊ·?ý's±?^ì<ýed¤?-)xÛŠ?gC‹â„ì?XQeì?Æ2yÙæ…ë?S_ì¨7ë?ÅcÌ`vê?)©‰uèé?©IAo‹Vé?ö>oð¸Àè?)ÜÅ''è?¥åÈ·‰ç?Og ¹èæ?o\óô1Dæ?‹¹;œå?nÿWQððä?ŽÄ®+jBä?íq5Äã?‚úƒ×Üâ? ò†$â?„m-Ø'já?$K¬K­à?nRñðÚß?¨ÛÇàÅVÞ?VdLíÍÜ?ÀÌÒ£@Û?G›äÂ&¯Ù?"°=´Ø?©!íSŠ€Ö?¨{œ¯èãÔ?ç*!ÙDÓ?6•$ =¡Ñ?2Ôéïg÷Ï?+ªÀ¹i§Ì?2$|ïSÉ? `±f¸úÅ?ñ9ÈŸÂ?Øt‹1¾?®:&GÍ¿·?{`Ÿ@zû°?ñv‡¤õm¤? Râ÷Ò‹?ú­ Nqì?¨¶Œöüôë?l3«1øsë?ÿB!d¦îê?ƒ”N*eê?ÒÖw“›×é? ñuFé?«zŸ°è?ÖYȳ_è? IÆhzç?c†éÒÙæ?¸mXã¶5æ? †Ç.Žå?–ð—,Rãä?ž€h±=5ä?Çë,q „ã?Øí ÃÖÏâ?. 2u»â?²¿„ÈÕ^á?Ú8ZlB¢à?e€(ô<Æß?P¨káCÞ?,Šà`6»Ü?°ª]ìï.Û?nÂT®xžÙ?~ò(y Ø?B ç¾ïqÖ?r„·‰[ÖÔ?I@¥u‘7Ó?ñ׬ѕÑ?DÕйâÏ?¥/uôè”Ì?< ÖÑ´BÉ?¶ùýd£ìÅ?ëY÷Ç=“Â?ªÊ¿%n¾? giŽz±·?§ï÷Ýñ°?n]H÷a¤?'ɪ ‚‹?$­^R\ì?µøÎ?[ßë?¼WO0Ž^ë?nÓœÙê?ÛTÚŠPê?q{¡ˆjÃé?jr{$Q2é?.øqúTè?Á•½è?ôÅÎhç? ç‚øÇæ?XLÒ\$æ?P¯ûV}å?lQÂÓä?iŽot%ä?.òuÊÌtã?À«%Áâ?¬p»™ â?*¦ËDQá?ºüD•à?Œgã8m­ß?ÇÆf'n+Þ?ª|¨WȤÜ?1¸Û?áP`zŠÙ? ðÛL÷×?9ˆnÏm`Ö?Ù¾ÆÔ?>'„9—(Ó?ƒ#n.ˆÑ?%¢2éÉÏ?Ûâip±~Ì?à¦á/É?äåÄ«ÛÅ?1¢6ì„Â?ÌÛÐTÐV¾?y"ábŸ·?ëàdF»ä°?¤B‘oèO¤?¬«©MoM‹?øl˜û@ì?^=eªÅë?'¿(X‡Eë?æ>cÁê?µâ½…8ê?…‘.éå«é?Ò7$Qé?}/”ô܆è?I¾„ îç?ûßÝ<³Rç?ø!~+-³æ? TAí&æ?¤¥*©¹iå?ßaÀ ÿ¿ä?öûHä?‰=Ï cã?`ôz°â?»Û:"úá? WìZwAá?"vXZ#†à?#Û£C†ß?mþçÞ?ëyB§ŠÜ?°T&Û?]Ä:q/sÙ?ÇÖ“rá×??U”œLÖ?$E49-³Ô?ÚT©"Ó?B—’¿'xÑ?ÎCƒÂù¬Ï?&™MÆdÌ?½&Ç7É?„:ÍŠÓÇÅ?Œ{LÆtÂ? rI I;¾?³O?Õ‰·?È!›]ðÔ°?iþ;¤?´&#‹??Á×%ì?”` <í¨ë?^Ãü)ë?VØ%¥ê?" Áê?cW2;‘é?è:‹té?&‡;mè?<Ú<žÕç?xùS:ç? £§°t›æ?¸Ý¥æùå?ºµ§YSå?<1‡†Pªä?eÏ×—þã?ÑhnÉNã?‡Êîœâ?žýìZçá?^õ‚Yp/á?«Í-Iàtà?àüÿZoß?þ(§kðÝ?Ò‘øã×lÜ?¸+œÌäÚ?МXÙ?¬FF“ƒÈ×?é hÒÀ4Ö?aDB’Ô?0ÓÞ6Ó?:š#2îeÑ?ïI¢ð‹Ï?^t'´+GÌ?nœîæþÈ?SìŽ ±Å?$°Øßá`Â?yµ Þ°¾?E“3Þq·?¾ìà°?/Õ®'$¤?küýûŠ?ɃoNì?¼jɈë?¬"6 ë?Øse¿…ê?¾ü­U[þé?Çxú'ôré?:¹í ãè?JXàauPè?‚p¿Š¹ç?®µñy÷ç?¶q—jÓ€æ?æŒk÷6ßå?Wˆ¦;:å?:%Ü'ù‘ä?•Œ6‹æã? Iº­ 8ã?ú­²{•†â?¤ÿDÒá?æ3á?•¹ñ~aà?™«?‡ˆJß?šZ-@ÍÝ?ü@{¯_KÜ?ðô±ž"ÅÚ?O¦ä:Å:Ù?Fwtj„¬×?À¬!²Ö?fE-O…Ô?þ.r†×ìÒ?¡LsðuQÑ?L¸¼>ÔfÏ?ì”è%Ì?ª]Ïá©àÈ?zÜOš—Å?¤î'MMÈï£?Ž$ÆA­Š? ©Ï´ë?Õ $=<ë?fY¿%¤¾ê?¢+îÆ<ê?ÐéüŸ×¶é?04Îð,é?TŠYc&Ÿè?´Ý¤ è?þW}MExç?Üøh[ßæ?<6ŽêBæ?D %à £å?˜g Õÿä?ªŠ8bYä?„²$̯ã?PþàÞ,ã?\”x#ŸSâ?s»™>¡á?å2¿ü$ìà?¦Jø p4à?hcFwôÞ?—ö5@H{Ý?Ì鵎ýÛ?åž1/ƒ{Ú?æ3­acõØ?|TØÐjk×?ƒ OÖÝÕ?^3 ?ãLÔ?\p¡ŠÏ¸Ò?¹T˜Ù!Ñ?ì#F€€Ï?Ø?ð{…ØË?Ô7AAœÈ?”Le3\Å?*‡¸ÛÂ?„!Xës¥½?Ž&’ך·?Žæâc)€°?ÎÕ>·6Ò£?‚ŽmcƒŠ?²8ÂSw‹ë? ÄR’ë?,Äâýa”ê?©x §Bê?‚齩$Žé?–Æñíé?Pªù -xè?¹þpU~çç?•\BVSç?…ʆ'»æ?wèV®æ?¼UÅË€å?ú3úT˜Þä?>H‰ -9ä?T1ñq£ã?l‰m†åâ? øƒÂ6â?ÊsïW…á?ã*zÏ\Ñà?CÉÆÀÊà?ô¡$zÃÞ?€Hg£ LÝ?ƒLØBÑÛ?ö¬xM›QÚ?¸ž8åÍØ?œå+o\F×?Áò]=»Õ?&¢DÿÄ,Ô?N|×Ð0›Ò? wáȾÑ?Ñæ)”ZßÎ?NØŸ+v¬Ë?ûpwNuÈ?òˆô b:Å?4R®Ã/üÁ?Ø€,mv½?€À9gêï¶?^Jï­Ôe°?JI–èQ²£? j 'WŠ?6…{f[Yë?þ³jÒ‡âê?ZÃiΔfê?x%¹šdæé?VÀK†.bé?>­æ Úè?:†`@Nè?Ò°Mà_¾ç?úác"+ç?ËÔ’Ä ”æ?Îê ùå?TîÚÎ[å? V|²ºä?z¡Ðcä?‘·Ã0ünã?¾ãÒr•Äâ?FL#áIâ?fh94gá?Ø 1¦o´à?3·l|/þß?üv!ùŽÞ?¹uA|<Ý?ö©’yk¡Û?.¿àX$Ú?X‰Ñ=£Ø?ž½„üU×?Pñ±Þ•Õ?¨*èÈ Ô?W2 L2{Ò?h½wéÐ?Zݺ DªÎ?‚®ÓÞ|Ë?îoZù*”ä?¸ë ñã?ÐM‹ÜJã?€¯i ²¡â?£sD©õá?2;ÛFá?SmÕb•à?ÇìÆ9¸Âß?9CÅUÞ?P»%äÜ?ðÌý¹nÛ?šª9æÁóÙ?îÜÈ÷ruØ?bÅ5è^óÖ?mõ¸CÁmÕ?û‡ÖäÓ? 0ò ÚXÒ?Z+Ó ÊÐ?²ô`:GqÎ?¹.þåÈIË?üxóPÈ?î¡#©îÄ?xËVi¼Á?P˜Dþ6 ½?Tê¶?>#—+°? ¥Lxk£?Ÿ¯.u¨ö‰?§ Yÿïê?i’×'{ê?RRŸê?r>Ø‚é?»p`žé?x†Î0ˆzè?fyC_«ðç?Œ5>ecç?n«Œ"ôÑæ?~‹þE=æ?BRè)¥å?.xY· å?öµdMkä?g~C@/Éã?†ã´*K$ã?Øßð}s|â?¢kÕÂÑá?\ÛàfQ$á?´%Ë?*~À^àíÇ?Й½äÐÄÄ?M][û‹˜Á? M•4Ó¼?ŽŒ ¨p¶?•¼¶ °?zF·‚D£?SUAá(‰?Ù8]Ú´¹ê?õ?œ} Cê?&Ó…Éé?N(·=Lé?wë·Ëè?Z1òÚFè?Y©fi½ç? *±6 1ç?œÅ¡æ?r Oü§ æ?*`b›Ñvå?[ è«Üä?æãªN?ä?ê;¶+Òžã?t ¸-Oûâ?‰±ëÞTâ?öº›«á?ÖþÄÿà?ƒ<(ˆQà?ì»pÂ?ß?X$Ú°ØÝ?Ÿž,mÜ?XÄ^°÷üÚ?¿^,ÁˆÙ?P† ›Ø?«àK¿”Ö?£ƒð‚hÕ?ç9ÅÑ’Ó?üÇ¢6 Ò?ˆûÖÓ„Ð?¹j!ÇóÍ?,êÿ€IÙÊ?ê:Sh§ºÇ?æxr[˜Ä?Œl&°àrÁ?§˜·5e•¼?Ð š@¶?о,±Ð¯?°„ð3£?¸#fÄŠ‰?ŒYdyê?‹rstiê?•g<·~Žé?cŽæ°jé?]0o’è?ꘒô§è?¬{{²*‡ç? ­: üæ? Ÿ¹cmæ?Mn DÛå?¬ÐiÆEå?\;Pð­ä?>[ŠH ä? 5‚ýqã?^¹'ðÏâ?Šù’:ü*â?H€.;ƒá?ÔæÆØà?˜ÝA®¹+à?ÔœÀu\øÞ?ò6 C”Ý?“íü­,Ü? L×ON¿Ú?ˆfInjNÙ?Þ39ïŸÙ×?d`ÂO(aÖ?PPš=åÔ?c\fÓ?§ÿ›ùãÑ?ýpÕÌ_Ð?…®lŠ[¯Í?/fõ›Ê?¤hó"t„Ç?’"x=QiÄ?ÆA+©KÁ?z¹Ó‰T¼?¦©ã«È ¶?#& ˆ¯?OÅoð“ï¢?Yã›-|P‰?Wµxð„<ê?iû¹YÙ?7 fü×?ÒÂÈšÖ?=ÆYûú5Õ?$[zÀèÍÓ?N«mÉbÒ?<· ÕôÐ?3‚Þû‡Ï?/4ž"Ì?½²é^8É?˜ûÇ{ëÃ?HxhÔ/À?¶ˆÎdy„º?¶Ü*¥´?VEOÁ<…­?ÿ>#i»¡?ûvº‡?2 ¿Ý4xè?­Ô« è?„ù!G›ç?5Ù±(ç?b±èS²æ?t•>{š8æ?6£W5t»å?†‚ô:å?“ŒGÍ-·ä?QÂ50ä?°1Á ¦ã?¤eXã?!ùŽõˆâ?¿¿g] öá?M*2\`á?ªä&ÿÇà?²Ý®¼ -à?AgØÀ3ß?(ǼƒßÝ?]ÊîÅ8›Ü?œ¦ì„RÛ?įŒîšÚ?Ë’4®´Ø?ëO¾Åò_×?ÐIBÖ? %JÛâ«Ô?{¹½JùLÓ?ç©LËëÑ?̵ur†Ð?<So„>Î?kcöŒ}kË?eá #?”È?²ØÚY9¹Å?.£’ÜÚÂ?Ôþ2ó¿?»…)¹¾+º?&ÕTž;`´?ˆ¿;Ì #­?ðÓ/Ê瀡? J o‡?Yxœ8è?\¸7µç?môoúüGç?gp£ûÖæ?C¯fbæ?9G,1Zêå?.ò´½ìnå?"½l1ðä?šÉÉ:nä?¦¤÷éã?,,¦#ï`ã?Ó[SÃÕâ?«_çÿ¯Gâ?Håõ˶á?†Ãñ*#á?¨J²[æŒà?6™¥ )èß?YÀš±Þ?ÎGcžOvÝ?ÉšB|z6Ü? ÜLòÚ?ß«.:ö©Ù?SåpÜ«]Ø?9`Ê:  ×?Û@ºÕ?`°½gcÔ?˜‡¶ÿÓ?jþ³û«Ñ?—z§`?LÐ?n¦ÉeÔÍ?5 Dð Ë?dQ%:¶=È?lô|êÃlÅ? ¤Iƒˆ˜Â?ÛÏ߳悿?ââ„=æÏ¹?++ ê´?ðyKf½¬?ö»žD¡?0š²b"‡? É‰ RÉç?ê…V”^ç?µlœ[Aòæ?7¹³6½‚æ? Z •Ïæ?WJò”}™å?<‡M×å?úèÎ$ï¢ä?@²?PØ"ä?§¦Ÿã?ùÏî#nã?UµÀCâ?“¼¨<â?e€.nuá?ÀÚf¦îãà?ªáÀkÔOà?U]H´lrß?à»ÆaW@Þ?>Ó ˜ Ý?iýïä^ÎÛ?Þy1^ÜŽÚ?ž4áAKÙ?Ý’hÁØ?À²>Œ¸Ö?\ä¹zÙiÕ?– ‡òØÔ?h«ì;ÀÂÒ?¯¼#ÄjÑ?#¤ÍòÐ?À@ÞîeÍ?y¡Ÿ%§Ê?ë¶sEäÇ?Ä¡d¼Å?•OX ùSÂ?±¾…_Ô¿?‹ñ©òûp¹?¹ó‘1Aϳ?[{S¹èT¬?äqêk²¡?ìlã9Õ†?M8ñQ}gç? ø7,Nç?æR»v™æ?ˆiywÆ+æ?9¶b›ºå?^ÊúFå?6 `BÎä?NPÏÉãõ—¾?Ná ¹?DJ,UFƒ³?‚=ó)é«?¯SŸ^TÇ ? Îâ.Óˆ†?Òù*<4ç?*…*§q§æ?$|Õc>æ?V„)ãFÒå?è$²Ýbå?°I€+ðä?Z•W5>zä?¨[N )ä?îày'þ„ã?À<—¬Ðã?‰`í:´ƒâ?d¡1æ¼þá?’u3ÿvá?E¤ìà?Rü>æ„_à?mÕÙÛæŸß?Åè§ã{Þ?ì@-SÝ?TšÁsñ%Ü?µ¡‘Â^ôÚ?/Z¤¾Ù?f¬ò„Ø?à¬àQxG×?î‹2hÖ?êQ*NóÁÔ?H{ÆÒKzÓ?´¡u¤/Ò?úpo0âÐ?k÷«ûF$Ï?Á¼ÆcÌ?IRˆÕ ÖÉ?q4ðè(Ç?¦©4(xÄ?úN”YLÄÁ?¶qyÖ‰¾?B~ª¸?nÇ4?ò4³?O÷I»Nz«?ø¡ö¨¶† ?žRϵd?†?²–îp§æ?Ã!QÂFæ?îæ´Zàå?ët0ô.vå?wã§¢å? ¹ÛúÔ—ä?nŸ?M¯ÐœIÇ…?üŒC¶ƒ{å?ÜYMa<å?–µN¶D¸ä?þå0ª‹Sä?œÐmÃëã?@+{þë€ã?OHã?~Z«>I¢â?òßźŸ.â?°¨Ie(¸á?ü k…õ>á?ÂäÑÎÃà?¾QI^¨Dà?¦rmi‡ß?E"C|¥€Þ?áîu-uÝ?VÙÀ*eÜ?™O±ïÆPÛ?\ÚV-8Ú?±OˆÙ?(Á­—û×?f“soÎÖÖ?æ•ï¯Õ?P=1¼ÿƒÔ?9GïýÂUÓ?«ÿîZ‹$Ò?0J‰ï‡ðÐ?"íÂÐsÏ?·´<¦¸Í?öþÉ(‹Ê?¶ê?D‚È?Áñ£ð&’Å?i¬êyÃ?2ëÜÛ‹À?¾k X] ¼?9S¦ö¶?pŸ{º:à±?°Þ©Î÷Œ©?}8ã[¢ž?Ø……mï„?mªñ·å?¯T¬â•¯ä?`¯™Pä?lÍE€îã?^arbLˆã?ËP¥‹ã?žªMM׳â?¢“u@Eâ? ”DØÓá?"¥ >°_á?RŠ=OÚèà?¸oµÎhoà?¿d¶óÜæß?ÊH>äüéÞ?ÑìtXèÝ?öý_dâÜ?ËNh,b×Û?ï„)óaÈÚ?”‰@µÙ?h{a(žØ?Ð$ŒDƒ×?4 c®ÀdÖ?ODüÈBÕ?âûr1ŠÔ?¯„Ú‰1õÒ?Aå¹ìÉÑ?¶¨+æé›Ð?ã,i4¯ÖÎ?.ÛC{ÉpÌ?Šn Ê?×€ãÌ4˜Ç?Ï&tÙC&Å? 6% ±Â?=„¼ªî8À?œ¶1j‡|»?],X²Á‚¶?¤û·É…±?áþt_©?+³=S«÷?íqU†ˆƒ?ö°%«$£ä?KžìWEä?˜—--çã?½Äi†ã?¯Dð;¸"ã?ÐÙ½¼â?„ñÛ+’Râ?„ƽL:æá?hÇgÂwá?bÞ9®Sá?@YŸçà?®%Œíà?D0Ë¡ï@ß?#QW2IÞ?æ=prÉLÝ?ÈÜ1åÛKÜ?¼ôÁS‘FÛ?ÎëH=Ú?xý¥ ‡/Ù?%LÞØ?Å7[¶ô×?’'”SBðÕ?ä´.ÔÔ?',Œã´Ó?ˆµ)B’Ò?Îî…à]mÑ?ý’–‘|EÐ?¦I°¿16Î?ï>gSÁÜË?_C="É?XFÉVÇ?L¹ù¸Ä?šÿÌžOÂ?×G+6”È¿?{1 õåìº?±¸=VÙ ¶?IŒ¶ø)±?D2{ç?× èfa?A"i"rƒ?ƃÃF+ä?¯…˜+Öã?EÅ­l%{ã?­Ø0… ã?Ô«6x»â?ÑF!+ŸVâ?Ëú4.Vïá?ærøH…á?ËÕÃþ‡á?›ª $©à?³þhV.7à?£vÞp…ß?‹[ ¨—Þ?k¸>¤(¥Ý?7“hT®Ü?¥˜’Ï—²Û?”œ¥âÓ²Ú?‰î®ò®Ù?£´F§Ø?I¬dau›×?¿÷˜š,ŒÖ?Ûõ§ÈiyÕ?øtIWcÔ?&Ï)ûJÓ?@—ƒ4ï-Ò?zÞt¼ðÑ?´a¿¡ÚÏ?`;Ì—w’Í?âz!n½EË? [6ÍôÈ?}Ä't Æ?ˆ`…ôGÄ?vL„€AìÁ?¡mðž¿?RK ™Zº?‰ûRýò”µ?œU$ºË°?RGU35ÿ§?Q3LÅœ?ìêh ƒ?˜{£iñÁã?~LDôÃgã?´Û®Þ ã?iSFré°â?‘µµNyQâ? Þêµ9ïá?ü…¦6Šá?¯0p,"á?âl®1#¸à?Ä_V3Kà?€Ò(w·ß?‘ãn„´ÓÞ?  ‡(ëÝ?;ÎÅ`ÿýÜ? ©] Ü?ݯ‰§hÛ?í¡MFÚ?uÞI1Ù?,]˜†Ø?Ç{§T×?©©5H Ö?”–ûMÕ?dDŸZðÓ?»äTÝÒ?YlÙdÇÑ?l­ß›·®Ð?°D.ï&Ï?A ¬ ëÌ?uídÛ«Ê?ûM¹ˆ÷gÈ?tv!ªM Æ?l´GŒ6ÕÃ?sµjö ‡Á?jžGl¾?M%–#±Å¹?vP?1µ?ØRT÷l°?»Äp¹Žx§?›ë7ëW'œ?U"½Ö·‚? m@OREã?þ¶weôâ?ú}ÂC|â?'¦C‰-Câ?²É¿¡öåá?ÂÆv ù…á?”úæäF#á?×A ôï½à?¹ñ÷Và?…µþ%×ß?GÚëîZýÞ?i*0_ÈÞ?ǰ^§;Ý?)Å¿ÖÖSÜ?Žì­¾gÛ?ƒC™lwÚ?LR>«ƒÙ?0ꯖ¯ŠØ?æ{Ù¨Ž×?„0`ÃÏŽÖ?aV”‹Õ?èEŒX…Ô?ÂòqCN{Ó?PÖ˜ •nÒ?Ž£_Ñ?ü3)ÅLÐ?m!÷ pÎ?ÿ£jÍAÌ?e¢ñ 9Ê?EuõpžØÇ?§‘ÖTžÅ?^Þšî°`Ã?T_l Á?í»|¹½?Õîn ;.¹?1†x? Ÿ´?Ý› °?S_*^ï¦? '‰G2„›?Ÿ‡XmK‚?Vj̘Øâ?HªL}+‚â?'é²,â?¤#Xj¯Óá?U£Y¨xá?ûbNîòá?ŽË‹›ºà?\R«Ö®Wà?½.Ý®zäß?Â/|¬ß?„™Ã&@Þ?cüæ}ÏfÝ?O’‰Ü?ÿÙþÿϦÛ?ôÛPJYÀÚ?ã,uÂÕÙ?Ñí7°/çØ?¥yzÇÅô×?Ь¤ªþÖ?߀/¦Ö?½@VßõÕ?’Râ˪Ô?¸¿ÁìHÓ?Øö^:øýÑ?f_®áôÐ?Q=ÊÑXÒÏ?›<›Ÿ¶Í?k¿•Ë?û´ îôoÉ?Hd‚yÝFÇ?É™/1-Å?ïÖY9êÂ?„dR«W·À?›¦Ä¼½?ÖˆSîH”¸?‡:•"!´?Ψ;EU¯?¯²b°½c¦?¦Ú«SôÝš?Ú£!,¹â?:b!/ŒWâ?pïñ3ò â?ÇwËÆI¸á?‰ÆlÜUbá?°|ÆÑš á?2”xÈ:®à?„·]GPà?Ó‚&ZŸßß?÷`kÅß?Ç})„OÞ?ÄUFíÌÝ?šWÕ¦í«Ü?y(c¢ÓÛ?ú3‚ ÷Ú?{eì NÚ?›â ¬‰1Ù?e¾»«âHØ? †¦ì|\×?3ÌRã|lÖ?ix‘yÕ?ØF0€B‚Ô?6fºSˆÓ?±ñÆÄa‹Ò?”9O›“‹Ñ? Ïí¦‰Ð?¾þyqÏ?ší|ùÌ?\xÃ!¶åÊ?ù\F„-ÎÈ? P„вÆ?a$,ò“Ä?üíåqÂ?ýКéþLÀ?dÊ%K¼?EZe¾í÷·?pú³¡³?%n)Ž®?Ž«­Õ¥?‘’Û÷3š? SB"Èq?7Q¨pÎçá?Ô' ö@•á?ZÑ×^Cá?LC ƒgïà? <>çì˜à?JH@Cç?à?QǪoÁÈß?N)‘Í ß?ähºLÞ?ÓΤ¥†Ý?_>´È­¼Ü? í~RGîÛ?%#‘’Û?,*ª®DÚ??Þ^"¾iÙ?IyKâŠØ?Œižƒ=¨×?bÝù¿òÁÖ?Õÿ‚%ØÕ? g*ÙùêÔ?ŠS”úÓ?¸[ÿÓ?Ø Ÿe°Ò?äxÂ}Ñ?0E´§Ð?ó˜ «:Î?Æ%P^9Ì?a Ë—µ3Ê?ß*È? ö´è“Æ?V’äå» Ä?˜õ§—Ë÷Á?ê]c2*¿?ªZÖ»?ÙD¯BY·?8 Ƴ?°ª¼ Ä­?H$‡VWE¥?‘‹ëT‡™?ðf}ð?äü¶Y­bá?˜ùd¿‡á?rj¾£@Ìà?;§lÆÈzà?‘DÍ«&à?ÐÖ— ß?2øíÞ?‡¶Š7Þ?Úæä{Ý?%‰_#f»Ü?® ¾ñÛöÛ?òï¦.Û?ñÕ¢Bö`Ú?«ÇqhÙÙ?°7[˺Ø?²÷ìá×?Eš°_×?n,kˆE%Ö?9' ÁAÕ? ¥RõZÔ?lpíqÓ?2Uí„Ò?ÚÎä×L”Ñ?Iڢ̡Ð?ªyý\wYÏ?ò€jÍ?¡‡â÷ývË?ÎÁ?É?Vö„’ƒÇ?!χD„Å?¢Td°¤Ã?rbŸy|Á?!eDò[ç¾?ï5‡ÊïѺ?÷Ac¸¶?‰Ù&‹Z›²?ð¬Vªöö¬?ö¾q0Ù²¤?=IKŽXט?ÈéÏÿŠ€?J³øZQðà?ˆ:Ñὡà?·Bwj4Tà?ÎaÄà?ÑpÅíeß?.é(„½Þ?ñéN9^Þ?<"Fh•^Ý?ËóD¨Ü?6WùˆíÛ?#O~.Û?^KsBkÚ?"$ ‡ó£Ù?auøK°ØØ?ÀÛ>˜ Ø?–‚ûëÊ6×?gN:i`Ö?k‰”†Õ?ËÔPm©Ô? ÁQÉÓ?ÜO±]²åÒ?còGdÿÑ?˜FºOÑ?¥û&˜*Ð?Lµ;½ÄxÎ?œò 襗Ì?Ë0Ùü²Ê?WéïÝwÈÈ?¨JƒÿÚÆ?¸Ó^×ÿéÄ?”O¯æÆõÂ?ȱɥ¡þÀ?Fü’¼ ¾?˜Y>•º?þž„ m¶?^¼Çßâ²?ßÚX.'¬?䣈V¤?z£ ‹ý$˜?Ô•¤Š€?ƒÍugà?F8õâ#à?>-ýž4´ß?ÜO³dxß?µœç±·{Þ?”Ö:„9ØÝ?‡ÔÚ0Ý?g3†ÔƒƒÜ?©2Y˜‚ÒÛ?ÓˆJË6Û?ÖÞÚo¼cÚ?¸\¹)0¦Ù?‡þ™:¯äØ?µB~WØ?æÏ,eGV×? ¹%ò‰Ö?¤Ä³z¹Õ?¨ÞÞÀýåÔ?ºa¬³GÔ?ÜE ¥y5Ó?X¡¶'µXÒ?n-_CyÑ?~‡ÍoÑ–Ð?X&ãïcÏ?fDùÙc•Í?_ŠcHÂË?MDÖÉäêÉ?…4ÍÈ?}q Ôh0Æ?¶ ^åãMÄ? =hÂ?È‚Ñ<ÁÀ?Ø{Zót)½?ƒ¥IëN¹?Qxpµ?È5wôÊŽ±?žÈ+sÔT«?îS…õñ‡£?‹­P§Qp—?b!àþï5?m9ËNÉåß?ÎnÅPß?TXZP˜¾Þ?R÷VBþ(Þ?9yCËöŽÝ?µ÷ÜiðÜ?d„áÆgMÜ?àåZ¦Û?úšÃy!É?ŒX‚TÇ?…&ØPñƒÅ?HîV°Ã?%+G$ÙÁ?(ˆéóþ¿?·uG²F¼?}v£Џ?¬(Ï‚¹É´?{ëi-±?ÁH|?€ª?æ’\3Éï¢?ø3èGN¹–?>º£?>~?ëh7hÐ?|¿Op'Ï?‡0?¤yÍ?²“‹6LÇË??#7«Ê?²2˜ôVÈ?5¤Ì—Æ?ÛÓ…¾ºÕÄ?ýÊÒd¡Ã?× oì—HÁ?g§Êû¾? –2 a»?Cñõ@÷?ˆF+=!´?Ëv˜%|°?ì@×@©©?rÜV¢?¼£y²j–?UŽßbAG}?¯©>d¥àÝ?Ê cëSÝ?ÐÙ!ÒÊÜ?*ž2®>Ü?Ëáñšk®Û?Ÿý gîÛ?í7³±DÚ?ò^Ö¤„äÙ?‘¼ÔDÆCÙ?<+êd"ŸØ?$:v²ö×?NÔ{J×?æÜךÖ?MAë2¡çÕ?´£  1Õ?Ñ›t/wÔ?,áQ,ºÓ??zWúÒ?‹p\#7Ò?MCî¦XqÑ?SÿÊrݨÐ?4Å »Ï?>ýÅ¡ Î?JÒuü€Ì?—=+¹ñÜÊ?¢ñÂ4É?øÉίˆÇ?ÖZg¾úØÅ?Ø„ùãç%Ä?îK×¹oÂ?à[®}´¶À?'”,‹8ö½?Ô¯œ4lzº?8Œ³³Žú¶?šê'Œ+w³?Æá¯?Cð‹ Ш?üˆªd¶º¡?™+?6mE•?³+ìRH|?!R;ÂÜ?90ñ¦üMÜ?Ožüƒ÷ÌÛ?ª¡Ã6FÛ?ŽÁ1»Ú?ذí +Ú?7C >5˜Ù?Ë¥OÖÙ?â6œ›œeØ?ÏâuŸÆ×?mSå´÷#×?rEx¾}Ö?hÛäe ÔÕ?°¹ ©þ&Õ?4ÆÒí¬vÔ?Ús^3ÃÓ?Y8 ž­ Ó?üaGË7SÒ?â,sî–Ñ?Ãð”î×Ð?žF¼šUÐ?´m›¬‚¤Î? UíùŸÍ?a$\G@†Ë?ß$dv¡ðÉ?ÜœŒWÈ?%¾%h¡¹Æ?ùÃFA¿Å?̽ùœtÃ?8úhyÍÁ?ÀR¿‰—#À?¤­ƒ¨sî¼?±£÷ñD‘¹?í€g)0¶?å˜Û¯¦Ë²?íº&âŠÈ®?O®{õ§?Á¯ÓM ¡?¸ã4¡ñˆ”?°dÆcYL{?WX“+ØÒÛ?þ7¯D‡NÛ?ž‹#¨ÎÚ?ˆ%h"LÚ?¹²è(ÎÅÙ?Fª¨w‹;Ù?Ïoi1f­Ø?üaÅ×rØ?d£CÊÇ…×?Ÿ/+|ìÖ?$¦Â¬§OÖ?î*s†b¯Õ?³¶5qÅ Õ?¯ÝÕ¤édÔ?9"PÕèºÓ?èô/Ý Ó?Q›HXá]Ò?g1®d«Ñ?¬¨×Ú…õÐ?nå¬]=Ð?ù­&chÏ?=¿èPL‹Í?M,\¡ Ì?,û+x¢‰Ê?ÖJ‹É?=&Ý ˜wÇ?ä÷©ïéÅ?ÕO•FWÄ?ÔªøLûÁÂ?c·^»ÿ)Á?¨§ª½¿?ôÈøÄ°ä»?L’eLY¦¸?¾Em©8dµ?_$| Ѳ?cÚhnJ­­?*­ü¸p§?„Z&䀠?à×ãê“Ê“?ä{.¥Gz?ˆ@ïg:¯Ú?DžÙ{¯DÚ?Y^¹*ÍÙ?Ú "PÙ?EÃOîÎØ?1ÛIØ?CÊÖ‘Á×?-szî‡4×?Ü ª4u¤Ö?5?ÝÃäÖ?AÝNoíyÕ?|ú„¦ßÔ?¢Ó–Í'BÔ?¸J‹‰¡Ó?²Z¿väýÒ?8:n¾QWÒ?ê ë­Ñ?@îPÊÑ?Lœ" SÐ?C3“¶ŠCÏ?õÖ.ÜÍ?’×Gí6pÌ?PmÜÿÊ?p½|V‹É?¬•¸ßÈ?{d“¾±–Æ?04[3Å?¨­êS”Ã?7ið)Â?öšYgo…À?8þÇAQô½?Ž]N&Ùº?4öƒÙ¹·?¢Üç–´?Ä¢áŒÍp±?®»á™¬?Ü©CC;:¦?¡ MŸ?˜\£ “? ‚aÝFy?"–jÓ¾Ù?$ ˆØ>BÙ?ç­ßa·ËØ? iïRØ?²ÞÐÓªÖ×?ÔtØÏÄV×?÷"MCGÓÖ?üÿuELÖ?ÂmœÎÒÁÕ?’‹24Õ?gÀ£ô¢Ô?À~†Ð´Ô?…À›]wÓ?Z]:ÝÒ?žBúgÆ?Ò?M5¨P¶ŸÑ?dîHŽîüÐ?Ï}‰%ˆWÐ?÷9_Ï?)IÞêŠ Î?:ÿ]:±Ì?Gn¯u|SË?Gjy‡ñÉ?d^ës‹È?|¤[êÏ!Ç?Œ“£}´Å?¾àdWÐCÄ?t¾€ÐÂ?!.¿MYÁ?`ƒÍÏÓ¿¿?Oà;Q'ȼ?ad¨ ̹?˜IÝïô˶?|I>^ȳ?þ *¿Á°?åM1%q«?b²¦+£Z¥?œ)ýëÙž?o¯ó+àI’?µ/MÓ¢;x?¦‚0–Ø?–çÉxQ5Ø?©þ×hÇ×?É>µ©4T×?;ë|RÝÖ?ïä¸vbÖ?5yQXäÕ?Æ—ÙbÕ?ìªÿÞÔ?ØÒ7+ VÔ?F;–éÊÓ?¬'7?¸<Ó?¨0£s«Ò?b»ˆÒ?šÂ°µ€Ñ?{û‰œ0çÐ?κìZKÐ?\¥ÉÙXÏ?ˆU³-½Î?¶¾Œ[üÏÌ?:s«…É„Ë?èÎW5Ê?FR¹ÚáÈ?rÐ …ŠÇ?ë|•¥/Æ?n~Zú(ÑÄ?î oÃ?ì–)pð Â?è¶Š£À?®zJ#s¾?1*_M~š»?R‰‚–½¸?ö=Þܵ?Y“ûåÈø²?úY¯íʰ?8GÒp³Pª?FU[×y¤?ÕåûÞ??ƒšI^⇑?(/iÃß7w?žÔ™@¤×?òüéÁ0×?GÖÉb§ÃÖ?~x÷³TÖ?²×>h—âÕ?“-Ž;'mÕ?º{£kôÔ?@¤ÊuxÔ?fù^¯XùÓ?`p ï'wÓ?Š…J–÷ñÒ?ÞðQÜiÒ?Â_êÞÑ?ò?ϰ7QÑ?Åñ«ÆÙÀÐ?(ÆÂæ-Ð?’êqZê0Ï?äã_ã7Î?hß·äÌÌ?‰L( ”Ë?b@6WÊ?éÛéŒÉ?΄y ÑÇ?Ô äiˆÆ?RNHK<Å?.Ù•Ñ?Š ¾k>ŠÐ?ÞU‰ZÐ?ÞY7–þçÎ? A\\„ÊÍ?:* r¨Ì?¿ÓyUôË?R/J"8WÊ?Ѫ”Uk(É?€‡ç_¼õÇ?;kKZ¿Æ?nþ;´t…Å?u:Á;HÄ?œ£|àÃ?ìjÓò’ÄÁ?XñÑå…~À?—w4(Ök¾?W9u+êÕ»?HbN®;¹?y1úˆ¶?;ƒM‚ãû³?Zø»p'W±?Êi¦6€_­?`êTë4 ¨?¾1Jµ¢?>ÈÖ)B·š?×àP®I?ÁT ºu?Ò“›rw†Õ?Î>ÑuËÕ?ý¦AY)¸Ô?Ä‚ð SÔ?"મ1ëÓ?4wG€Ó?ién^Ó?X‡¡Ò?‘ž•Ò-Ò?øœBQ·Ñ?[þ‹>Ñ?n™åm4ÂÐ?zªJýCÐ?g[ÏŸ‹…Ï?H·~À~Î?N´ABsÍ?®yËÍ9cÌ?›°BÀÐNË?·é–i16Ê?5IĆÉ?, wlüøÇ?èP—¾ÔÆ?(cÚ ú¬Å?€¸ÜÄ?\Pw‡’SÃ?¹P=©K"Â?"÷¤76îÀ?Bøó»o¿?Œlch¹ü¼?ÕŒð…º?œ+þ ¸?zÏ]ádŒµ?^º.hg ³?XÚ+Ru…°?€d/lêû«?JšŸè¦?,wæßÑ¡?œq0q™?„."^uŽ?0ƒÛÏ?&è-ÖëÎ?²iŸºïõÍ?Ⱦ#'üÌ? ßZçýË? 6zVûÊ?»+¶œôÉ?wÁâéÈ?+ƒ*OÛÇ?”O ÉÆ?úfSG³Å?ìzÏ&šÄ?=×}Ã?²܃^Â?;é¾3X<Á?bl”EÀ?ß,äVà½?Ðzƒ»?ù¶Ï0o5¹?þVˆ~éÙ¶?|/(èÒz´?–|ቲ?Y{¬Öf¯?4@Š6¶—ª?ªÛò©yÄ¥?‰-"Xñí ?лÊ8î)˜?$›µÝéŒ?ôXkÞrýr?špYåAgÓ?XC‚!Ó?:»ÎšöªÒ?1«£ñÈOÒ?ÄñÕ¸òÑ?K뽑Ñ?u4°.Ñ??µ§ÉÐ?ás¾`Ð? ¼ÌïëÏ? [•ë{Ï?86(A2Î?6<óaNÍ?ÿ€ªñýeÌ?†œ;yË?òÛQ<ˆÊ?&§ß&“É?F yšÈ?@¯ ÉLÇ?š'C ÕœÆ?êC[›ß˜Å?ç. =”‘Ä?"ž0‡Ã?¨|=(yÂ?Û3´FCiÁ?é$\ 7VÀ?âAÕ§D¾?R¶Š^Q¼?ö›¤º?ÂE~Z°ä·?Èš:¦“¨µ?SÙ‡)i³?ÉÄ‚€&±?1†¥u­?ìmzY73©?NŸ3° ¤?‹Â»b¦  ?˜â%_Þá–?r|.²Z‹?^ÚUÚq?š¦×å6Ò?°¦¤ôÑ?ÚÌÊùM£Ñ?ûLO[ÚMÑ?À +WlõÐ?6Ç)YšÐ?yôº<Ð?OÜw@¹Ï?SUv0ôÎ?J0c†a*Î?u ’ñ[Í?¨½V‡ýˆÌ?âW¦±Ë?‡v3Ö ÖÊ?ú˜‘8OöÉ?@)½n’É?ºfI(ø*È? ïã´£?Ç?Þó¤ ¹PÆ?÷>©\^Å?D†Ò¡³hÄ?PÂ{ãoÃ?D”<tÂ?X‹?KfuÁ?õÄytÀ?X)ƒÄ3à¾?ˆÏòìÓ¼?¸†p®pº?<€:¿%­¸?œØßÿ“¶?µYÄLw´?V!ËZ_W²?©¶É‡4°?~û 0¬?".ÉΧ?¨ÐÌ‹{£?,Ó.ýrJž?ðÎôY™•?^ ‡dÂˉ?¤LÍp?¬J¦MHÑ?ÌnE•îÐ?yê_ ËÐ?ê`|vsLÐ?¨?víõñÏ?ØTA›LFÏ?€Aqé•Î?v‘ óÝàÍ?¶}ÃB'Í?ýÏï0iÌ?„,)ÝÁ¦Ë?^ž’íàÊ?I' ÍCÊ?žoFÉ?LïÓ·sÈ?PIÁœ9Ç?ü•Ã$ÃÆ? ¤ûÓsåÅ?Rý nÅ?8VÁÒ* Ä?\QøkË8Ã?AlQªsNÂ?6ÏppGaÁ?ÒÖÉjqÀ?Û½ £þ¾?–³Ãce½?ìAÜB&»?C¸@Òä3¹?øZ˜=·?9ÃÕð¦Cµ?Ê$[F³?ä/´³þE±?Àa÷·…®?¥Ûvzª?ÁÀÐj¦? [%dW¢?‚%ª´¿œ?úîÆ´!P”?Óí þq7ˆ?"7w®*o?G¦? ØÐ?Šœœ ï»Ï?vliïp-Ï?V§ï5–Î?›iFѺùÍ?nr^G¦XÍ?­aCU ³Ì?˜ÑF> Ì?‘ÇF§[Ë?óà~켨Ê?ÔÕNgMòÉ?…±Ýà7É?pyÂV“yÈ?æ´¾€·Ç?ªÁ˜ñÆñÆ?À`ƒ(Æ?(Ô&LÕ[Å?¬åâ[Û‹Ä?p4öµ¸Ã?WÈ„âÂ?6ëÆ3i Â?ª¦Îă-Á?®ê¡±öNÀ?§ú}ÆÛ¾?ör*šØ½?H[SgI»? M¹y¹?|\¬¦·?ïÜ)IºÎµ?¥?k÷óó³?Gðí¤²?Œˆïl15°?ŠJu£¬?”š¢!Àר?ü'’Ã¥?SL‰ü3¡?®!Qü¹š?*{“ö“?pÝ}•õ£†?”ÿ>šm?Y¶Í¥WÎ?ü?äþé³Í?}qZ“$Í?nå\•Ì?:̤ÅÌ?ߺÀä.lË?–T?ƒÑÊ? (çÇ2Ê?t\‰üÉ?ºejéÈ?¢²ô>È?66{žÁÇ?ÂgíéïÞÆ?×îÎx–)Æ?‚ ÁÔpÅ?‚ây|Á´Ä?° ß~õÃ?¢„Æ&3Ã?IÜ 0ØmÂ?ž °¥Á?ÅDD×ÏÚÀ?"*ðR À?à_ë¸z¾?PªÖ¼?ú @»ô,»?º%ä͹?×eTη?5ܘyQ¶?¢öªÝ`´?ûO41¥²?‡×ºJ“æ°? 'rJ®?mgð˜Ëª?WŒÉ6§?äë:)¦£? Q*á ?F޹÷"ô˜?kñh˜(¾‘?  ë»…?|¤¢M¡&j?®øÖí°óË?œ„ÖhÁ”Ë?”&hãË?’aŒ=•Ê?bƒ2W9 Ê?¢ü“‹BÉ?éT’Ù{ñÈ?&û4â]È?Æu–ÆÇ?ä[Dr›+Ç?úzœÆ?>:Î[ëÅ?-èxn¶EÅ?þh$Ä?Þygs5ñÃ?bÈEBÃ?Ì?ÊÜeÂ?Ø«ÁžÛÁ?@Cä$ $Á?ÏD'AñiÀ?9s¾¼‡Z¿?dH½¿>ܽ?š¹4›mY¼?#f H#Òº?8îOñÇF¹?d$Ÿj··?>ð”Þt$¶?Žîsõ´?Sg ´Vô²?,†£ì¥W±?m©¾§˜p¯?"2ó§,¬?‡­/Þ=ä¨?-½y;[—¥?öö´ŸŸF¢?8ï+Cžã?n½~Q2—?Wù#_x?ªãñoƒ?“Ìã£5çg?\…Dz+Ê?U“w‘É?a $Û É?Èeõ™—È?ZnsÅÈ?¼€]ÚU˜Ç??¢ÚÇ?RSHóŠÆ?µgÿÅ?²ŽÒŒ®oÅ?ðæw %ÝÄ? iÉ-GÄ?{.K®Ã?Ôïçù&Ã?.*xIsÂ?YM,YÑÁ?ÏÍÇâ,Á? ë뉅À?¶ÿªÀ·¿?H*ÉO _¾?H®u6#½?îp€&@ »?XÖY—:º?¢yy˜^и?TUûÐb·?éñ;Ëñµ?* á‹|´?„rûpB³?™Z“ˆ‰±?T‹"”‡ °?lsÔT ­?ô täQª?5=Ðc§?›­‡Þwú£?á´MÝé ?i¥%‰©›? ÑEB|w•?ù¢pŽ?Æ8SÉ?A;éŠà_c?3œÁÚ·Ç?a¿„[—mÇ?újæ÷ü Ç?É$5›Æ?"þÐ(Æ?F¡³·±Å?•84í.8Å?šÒfBºÄ?„Òû¿5:Ä?žÎQ%àµÃ?ø¡Ð¨/Ã?¬zV-D¥Â?øÇ±´8Â?ªA<ú‰Á?N0ˆ–÷À?«IG bÀ?|zƒóî–¿?Z÷5^b¾?k 0œ++½?Ð¥_$í»?<9 b­º?,«ZüÀf¹?72Õ<¸?q©©Éж?…öZéµ?$ÝœŒ´,´?O ffײ?Dvb/|±?½Ô`2!°?¢ãòX­?+ÔÔßÁª?l|)ü÷§?ÆæGw0¥?ФÃV_¢?äƒvl'"Ÿ?l/wñs™?û…D4KÉ“?+%cìŒ?Åd1ÃÔl€?ãbë6ŸFa?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ßõ*^¾à¿÷Ôkž§£à¿ˆË¯3á¿44p±¿á¿eé4¦Iâ¿×ŒÊ ÉÐâ¿åÀ'Uã¿ ØÙFÖã¿DðhÐwTä¿ì‡Ïä¿®©Ê`Gå¿ùÞò»å¿–éå8*-æ¿áü°öšæ¿~ÃÐeFç¿Ur† l翹æ0Ïç¿ñC£ª.è¿-\Ê›jŠè¿ÉšÍaâè¿M‰n¦‚6é¿€³.À†é¿ûÞLÓé¿éRi`ê¿i…Ú/¬_ê¿F·ÒæŸê¿àèjÜê¿¡Cx°ë¿ ®óÐG뿃Êggiwë¿ äȃƢë¿<°>©àÉë¿ÖH,бìë¿4š4 ì¿ WžRd%ì¿Þ±íï<;ì¿’Ç£»L쿬›3 ÜYì¿A.VÐbì¿ÆgZ ÿfì¿“– dâDà¿§ÆQœØà¿’='˜¼iá¿|-nÇ-øá¿W ˜Ùƒâ¿ÄE€ª 㿵Èg‹’ã¿É§gä¿W8+•ä¿,¨¡÷Áå¿æÎ_‹å¿«S³Îæ¿Ñɪؽsæ¿MHŽçâæ¿@c:ˉNç¿y‚ö“¶ç¿¾Oöè¿8ö{ {è¿`øWs„Øè¿@+˜“1é¿€³.À†é¿=(ý×é¿SõÆÂ=%ê¿–©®Ovnê¿P:Çp›³ê¿é(w|¢ôê¿·m°k1ë¿?R|Û.jë¿•ým¢žë¿øyûíÒÎë¿Oþ¼ ºúë¿UJ’¢P"ì¿?è­—E쿜*†{tdì¿IÁ«Š÷~ì¿cÄ…®•ì¿.ó}˦ì¿*Ñ=´ì¿jCgáó¼ì¿©l¸ cÁì¿î+„uà¿,ÿÄ]÷ á¿›(ÆÉá¿´4þ¿ä-â¿.áÊ2»â¿4L\ô›Eã¿ùŸ Íã¿ì(ÑxpQ俱ԹαÒ俹нPå¿,RMü~Ë忾{,väBæ¿_‰$Û¶æ¿004$Q'ç¿ãÔù5”ç¿©%ÊIvýç¿ú÷‘icè¿,HÕÏÄè¿áWxÉ"é¿|ñÔâ|é¿ûÞLÓé¿RõÆÂ=%ê¿Öòñ]es꿸܈Êx½ê¿MKœlë¿êaÀ 6Eë¿E’àíʂ뿩'¦É!¼ë¿+„Å1ñë¿^1òò!ì¿@àÄ ]Nì¿P6,úivì¿,ìMšì¿ru;ˆS¹ì¿Ü—m×%Ôì¿™'±†êì¿ù ³Øpüì¿é¿&Tã í¿’O3xÛí¿KHÅâWí¿—µ—3œ£à¿á€Üï±:á¿Nö›…Ïá¿LÜlÎ`â¿’pO§ïâ¿=$Ÿ”{ã¿i¬ä¿á××3WŠä¿M … 忬~eÓnŒå¿•Çœxˆæ¿á‡¯Q<æ¿âµÁwöæ¿÷>Ç´(hç¿—òâ=Öç¿ÇS ’¥@è¿ÚP§è¿ÙÛòe- é¿â‡á6.ié¿ÏºxæCÄé¿çRi`ê¿”©®Ovn꿷܈Êx½ê¿R–Žª[ë¿P‚cOë¿q¶´ •‘ë¿Û¶gÖÏë¿2^è×Í ì¿s[ûmr?ì¿r„Mä»pì¿`i2¡¢ì¿Â¸Æì¿ƒÃ¹ê,êì¿Z™Ó©Ä í¿¿Û@â$í¿sáš;í¿SÏäîMí¿_L6[í¿ÌÄ„UGdí¿5+@PÐhí¿”×a#Ï࿹¬n[Ägá¿’49;¶ýá¿,2íááâ¿/8Æ0!ã¿ÈÐ.Œ®ã¿÷ô\ÆÞ8ä¿ÌŽRÀä¿Üƒ8Då¿%¸ÞÝÍÄå¿f´Ç(,Bæ¿õ-&ļæ¿x=aâ‰2翆¤E@d¥ç¿Ú½Ö'™è¿§ s€è¿¥7jŽÎçè¿Î]©{®Ké¿ÇzÔ§«é¿µ^õÊ«ê¿g…Ú/¬_ê¿N:Çp›³ê¿MKœlë¿O‚cO뿯ÿ÷„–ë¿E¾wÁ³Ùë¿]‚¼÷—쿦O 'Sì¿zıöW‰ì¿t“j\"»ì¿8f§~èì¿“ö¿‘eí¿F/Ñ5í¿Ó)¿x»Uí¿ðâÔqí¿|ƒtìù‡í¿Úý;Fší¿6ÔBð¨í¿("ë*±í¿·§ÿ¿µí¿z?‡ÿøà¿EÎ3­'’á¿—è¿·†)â¿u’Ǿâ¿b’¢óÆOã¿ðþÄzÞã¿(³E:jä¿òžË›òä¿£;kÞwå¿‘·åÑù忉h)axæ¿ýiy¹yóæ¿\ðµBkç¿\¼pUúÞç¿òX‹>O迹¡7$»追*£Ôu$é¿”Ö‹üH‰é¿Ÿ4½,êé¿`EvGê¿F·ÒæŸê¿ã(w|¢ôê¿åaÀ 6Eë¿m¶´ •‘ë¿A¾wÁ³Ù뿞Ëÿ‡ì¿òÌe]쿦è…"˜ì¿§‡zúÖÎì¿>¦ ¢í¿§ øLå.í¿xÓŽë/Xí¿á\Åô|í¿Üx3>,í¿ÑòNÓ¸í¿X!cåÏí¿^ˆÒí]âí¿}û ;ðí¿"·½]zùí¿‡¤á]þí¿A¦¼dá¿W{Ø[Õ¹á¿'*9ŠRâ¿ÌHuÉkèâ¿\HËîb{ã¿ÃtãÿX 俚ªÉ7˜ä¿`“é!å¿§Ôj Y¨å¿¢¨¶q+æ¿-m—«æ¿ñà÷§M'ç¿ßèˆ,êŸç¿Ê¤ûâè¿8 ÑQ#†è¿©Ü$rœóè¿¥@Y’<]é¿·hóÂé¿+¡íE±$ê¿g‚ê¿ÚèjÜê¿°m°k1ë¿?’àíÊ‚ë¿Ö¶gÖÏë¿Y‚¼÷—ì¿ òÌe]ì¿ä1É$ì¿* z\忤݊Ù*œå¿cJÉ"¤%æ¿AÎ"³«æ¿;=q-C.ç¿íŒ @­ç¿”œg–(è¿Þn)ü2 è¿çïêmé¿F6màõƒé¿¸æjùïé¿=­ñUüWê¿xÂó¦ï»ê¿Á™Ãë¿}Êggiwë¿ñyûíÒÎë¿X1òò!ì¿m„Mä»pì¿o“j\"»ì¿=¦ ¢í¿Øë™Bí¿©7Ç–í¿ÏÒ¸í¿Ê7Vàëí¿LÅ©¿V‚¶Eî¿Æ'ŸP¤kî¿!w:áŒî¿ h©î¿ž³êš4Áî¿<é³ÿBÔî¿× ^â‰•ìî¿=}ñßðî¿ésÝá¿åu«¯ÿ<â¿ÙÆt†Ú⿉A'Utã¿4FÊ‹ ä¿&Ñ$«Ÿä¿Vw…Kœ0å¿ÍœøH¾å¿‡\šL›Hæ¿Ñþó}Ïæ¿%è.ÜRç¿óÀ ¡Òç¿ô‹®ŽºNè¿fs+ûÇè¿v9‹E›;é¿M׬u>¬é¿ÁÙ -ìê¿Pd©“ê¿™[Ç$æê¿k|éFë¿äȃƢë¿Gþ¼ ºúë¿9àÄ ]Nì¿Zi2¡¢ì¿2f§~èì¿¥ øLå.í¿|óýËpí¿'{ y(®í¿?ôGñæí¿KÅ©î¿éš¥Jî¿/Ê`ªuî¿L›cZ«›î¿² ¾½î¿£óN­ÐÙî¿QìºÂñî¿ Ã¨5ï￸¼›(Sï¿Ó¯[ìï¿)‹ûS¹!ï¿ú©£Åüµá¿“âÍV⿽"xËô⿎üÖÛÛã¿cïÊrè'ä¿%ê÷Zټ俓´œ—Nå¿9ö”¾ Ýå¿;µáÈ"hæ¿e@ûHÄïæ¿Œ‚¨TÜs翇PVôç¿Ã—#q迌VØ"êè¿ÊZíO_é¿òÜ'’‘Ðé¿äþ¥Ù=ê¿Csž§ê¿AÈY4 뿆âb±'më¿3°>©àÉë¿KJ’¢P"ì¿H6,úivì¿ýÁ¸Æì¿‹ö¿‘eí¿tÓŽë/Xí¿ò†ýÚsší¿] ('Øí¿á"AO@¿V‚¶Eî¿.Ê`ªuä¦hš î¿­ÛúÆî¿Ï#Íšèî¿‚üXwï¿ H‹ï¿ÌæÓãÒ0ï¿3w83K?ï¿9¾ûñHï¿!.¾ÅMï¿Ù)„-Ìá¿ÑVpÈmâ¿ÅÈ7‹ 㿉T^¨ã¿%²ˆl)Aä¿Ë±ZñÔÖä¿iÎIiå¿üGúlqøå¿Úõº5„æ¿ò8{* ç¿Xß·>‘ç¿^Y¼èY迪Q²Ö¾è¿)à*Z é¿ú¬$é¿b‚æ›éðé¿NF‘º^ê¿Ö¸›lyÈê¿ {ˆ.ë¿ ü®«„ë¿ÌH,бìë¿4è­—Eì¿,ìMšì¿{ùê,êì¿=/Ñ5í¿Ý\Åô|í¿ ¼‹¿í¿­.1±‹ýí¿y›‚bì6î¿Ã'ŸP¤kî¿J›cZ«›î¿­ÛúÆî¿afÛ‰íî¿ë©½²Tï¿;'ágU,ï¿ÿÚã‡Dï¿:·œEçWï¿Lè9¶qfï¿IŶ•$pï¿&T4eþtï¿ví­Ÿßá¿ÔŒÙêâ¿1½ùi[!ã¿]~3ÈØ½ã¿…K‘ÒJWä¿ 1˜ß™íä¿9f Á®€å¿çLhÊræ¿´Ë“ÎÏœæ¿y)°%ç¿É¾þªç¿ò©~§,è¿Ã@~ð”ªè¿(õN#µ$é¿À¦ÙÃôšé¿ec–A ê¿U<Üù‰{ê¿<™í¼åê¿ ìðÊKë¿SuD§¡­ë¿ 4š4 ì¿’*†{tdì¿hu;ˆS¹ì¿R™Ó©Ä í¿Ê)¿x»Uí¿Øx3>,í¿˜ùõ àí¿s[PPî¿‘3²ïWî¿w:áŒî¿° ¾½î¿Î#Íšèî¿ë©½²Tï¿}p$vD1ï¿h}¥ÛdNï¿gÛpe±fï¿€ÜIT&zï¿O¨Àˆï¿=~l ~’ï¿[ø¼<]—ï¿>ç’@Pðá¿ÔSø2“â¿kÄ=j83㿘‰èGÐã¿@ýB;Ijä¿òÿÖ¢$å¿æùÛ”å¿ïé9# %æ¿Õë‰8í±æ¿„¢§bM;翤CyrÁç¿.÷PÆ9Cè¿lMMÁè¿Zhw‰/<é¿‚^¸”ݲ鿲`Ï!•%ê¿P/€D”ê¿p1žÚþê¿‚xb Geë¿¡$`ÿyÇë¿WžRd%ì¿>Á«Š÷~ì¿Ñ—m×%Ôì¿¶Û@â$í¿çâÔqí¿‡ÑòNÓ¸í¿=·•xñûí¿z W÷o:î¿7+(Etî¿{ h©î¿ óN­ÐÙî¿€üXwï¿:'ágU,ï¿g}¥ÛdNï¿¥$´s kï¿è~ ®„ï¿z)ïÇŠ—ï¿mr|¾2¦ï¿b8!Où¯ï¿o"õ÷Ü´ï¿Z°ó«<þá¿ÕœDÑ¡â¿= wBã¿OCMݨßã¿4ϸ!zä¿á£7r忨ƒpƒ¥å¿Õ³J=6æ¿ÁÀM·ŠÃæ¿n¶ëUMç¿ï‰ijˆÓç¿ ç¿Vè¿ÅJ_ÔÔè¿Ê¶„¾ÅOé¿L"mçÏÆé¿p*À~à9ê¿|”$Æå¨ê¿™•çžÎë¿ ¨ ŒŠzë¿HZ¼· Ýë¿Ó±íï<;ì¿WÄ…®•ì¿'±†êì¿iáš;í¿rƒtìù‡í¿R!cåÏí¿jÖPP7î¿ã’¢PæQî¿fìÑdè‹î¿™³êš4Áî¿MìºÂñî¿  H‹ï¿ýÚã‡Dï¿eÛpe±fï¿ç~ ®„r2Öyœï¿×>°ï¿Œ\õnþ¦–‘Èï¿xbY yÍï¿qµ‚Éb â¿Ârƒ*)­â¿¸TDNã¿«ÊeGùëã¿.'®Ùц俾·h€å¿ €Å¥ì²å¿zZ„˜Dæ¿n~|“¥Ñæ¿'¨¿Å[ç¿ïYˆÎKâ翇±b#eè¿|P07ä迸Ø?½t_é¿¶‚Œ¨ÈÖé¿V‹ J꿸‰j¹ê¿~Ì“´•$ë¿]wAJ‘‹ë¿S5.}Mî뿇ǣ»Lì¿"ó}˦ì¿í ³Øpüì¿IÏäîMí¿Ðý;Fší¿XˆÒí]âí¿õüoæÙ%î¿V¹Ë½¯dî¿ebÃÕžî¿7é³ÿBÔî¿è5ïï¿ÉæÓãÒ0ï¿8·œEçWï¿~ÜIT&zï¿y)ïÇŠ—ï¿×>°ï¿Í¥8}²Ãï¿ ¹ÆïnÒï¿¥†-*CÜ↓Vi¨-áï¿+¨!áÀâ¿S4’<Óµâ¿0'ÉúWã¿—ÿ´@7õã¿bNÿ¨Wä¿ÆÏGL(忎|®ý¼å¿¤J'ïTNæ¿àAF ;Üæ¿é!à›fç¿ÃÏX`íç¿KÃñ?tpè¿xkXaÃïè¿i‡:ké¿€ •aÅâé¿þèUÇRV꿎1zÐÅê¿|rãH-1뿯Y!¥X˜ë¿ä(¦Bûë¿ ›3 ÜYì¿Ñ=´ì¿Ý¿&Tã í¿TL6[í¿+ÔBð¨í¿vû ;ðí¿AkM[Ö3î¿xy/YÉrî¿%¶­X ­î¿Ñ ^â¼›(Sï¿/w83K?ï¿Iè9¶qfï¿L¨Àˆï¿kr|¾2¦ï¿‹\õnÃ¾ï¿ ¹ÆïnÒï¿ãÏp82áï¿ù* ëï¿Øz=È÷ïï¿„]~¨Uâ¿™\g±š»â¿2ó8ü\ã¿çªb\aûã¿…žÖ®±–ä¿3%=Õ.忳1‘´Ãå¿ôu>¶8Uæ¿!îÃ;Kãæ¿xi?9Ömç¿K‹‚QÄôç¿¶‰þµxè¿8ù)w÷è¿CŸ­sé¿°‚P9Äê鿃DPu^ê¿ÃʯrÎê¿J¿j“9뿼ßʤޠë¿ÿ¿&3çì¿4.VÐbì¿[Cgáó¼ì¿…O3xÛí¿ÀÄ„UGdí¿ù'"ë*±í¿·½]zùí¿ùwɆ*=î¿h/ö0|î¿åˆíóƒ¶î¿£‰•ìî¿üÒ¯[ìï¿4¾ûñHï¿EŶ•$pï¿9~l ~’ï¿_8!Où¯ï¿¢–‘Èï¿£†-*CÜï¿ù* ëï¿Ä€Öæôï¿Cÿ!Õù↓½EC â¿bAߤ~¾â¿Oàù_ã¿ ·§vþ㿹vðÞ™ä¿i8ø2忘 ÕDÇå¿/4ÎݪX濌7OÓææ¿}W-­sqç¿n#5—vøç¿8WŠ;Ç{追SZQûè¿€õÂHwé¿C×ôÃîé¿udªä†bê¿´Ñ‘@8Òê¿8—ÎÆ=ë¿˜Äø!¥ë¿S)øÎ9쿸gZ ÿf쿚l¸ cÁì¿>HÅâWí¿)+@PÐhí¿«§ÿ¿µí¿¤á]þí¿ê³ŸøÔAî¿f‡‡!å€î¿;A»î¿=}ñßðî¿#‹ûS¹!ï¿!.¾ÅMï¿"T4eþtï¿Wø¼<]—ï¿l"õ÷Ü´ï¿vbY yÍ↑Vi¨-áï¿×z=È÷ïï¿Cÿ!Õùï¿…fB0Äþ↓½EC â¿bAߤ~¾â¿Oàù_ã¿ ·§vþ㿹vðÞ™ä¿i8ø2忘 ÕDÇå¿/4ÎݪX濌7OÓææ¿}W-­sqç¿n#5—vøç¿8WŠ;Ç{追SZQûè¿€õÂHwé¿C×ôÃîé¿udªä†bê¿´Ñ‘@8Òê¿8—ÎÆ=ë¿˜Äø!¥ë¿S)øÎ9쿸gZ ÿf쿚l¸ cÁì¿>HÅâWí¿)+@PÐhí¿«§ÿ¿µí¿¤á]þí¿ê³ŸøÔAî¿f‡‡!å€î¿;A»î¿=}ñßðî¿#‹ûS¹!ï¿!.¾ÅMï¿"T4eþtï¿Wø¼<]—ï¿l"õ÷Ü´ï¿vbY yÍ↑Vi¨-áï¿×z=È÷ïï¿Cÿ!Õùï¿…fB0Äþï¿…]~¨U⿚\g±š»â¿4ó8ü\ã¿éªb\aû㿇žÖ®±–ä¿5%=Õ.念1‘´Ãå¿öu>¶8Uæ¿"îÃ;Kãæ¿yi?9Ömç¿M‹‚QÄôç¿·‰þµxè¿9ù)w÷è¿EŸ­s鿲‚P9Äêé¿…DPu^ê¿ÄʯrÎê¿L¿j“9뿾ßʤޠë¿À&3çì¿5.VÐbì¿]Cgáó¼ì¿‡O3xÛí¿ÂÄ„UGdí¿û'"ë*±í¿·½]zùí¿ûwɆ*=î¿h/ö0|î¿çˆíóƒ¶î¿¥‰•ìî¿þÒ¯[ìï¿6¾ûñHï¿GŶ•$pï¿;~l ~’ï¿a8!Où¯ï¿¤–‘Èï¿¥†-*CÜï¿ù* ëï¿Ä€Öæôï¿Eÿ!Õùï¿-¨!áÀâ¿U4’<Óµâ¿2'ÉúWã¿™ÿ´@7õã¿dNÿ¨Wä¿ÆÏGL(忎|®ý¼å¿§J'ïTNæ¿ãAF ;Üæ¿ì!à›fç¿ÆÏX`íç¿NÃñ?tpè¿{kXaÃïè¿l‡:k鿃 •aÅâé¿éUÇRV꿎1zÐÅê¿rãH-1뿲Y!¥X˜ë¿¡ä(¦Bûë¿£›3 ÜYì¿ Ñ=´ì¿à¿&Tã í¿XL6[í¿.ÔBð¨í¿zû ;ðí¿EkM[Ö3î¿|y/YÉrî¿)¶­X ­î¿Ô ^âî¿·¼›(Sï¿3w83K?ï¿Mè9¶qfï¿P¨Àˆï¿or|¾2¦ï¿\õnþÆïnÒï¿çÏp82áï¿ù* ëï¿Üz=È÷ïï¿tµ‚Éb â¿Årƒ*)­â¿»TDNã¿®ÊeGùëã¿1'®Ùцä¿Á·h€å¿€Å¥ì²å¿~Z„˜Dæ¿r~|“¥Ñæ¿+¨¿Å[ç¿òYˆÎKâç¿‹±b#eè¿€P07ä迼Ø?½t_鿺‚Œ¨ÈÖé¿V‹ J꿼‰j¹ê¿‚Ì“´•$ë¿bwAJ‘‹ë¿W5.}Mîë¿‹Ç£»Lì¿&ó}˦ì¿ò ³Øpüì¿MÏäîMí¿Õý;Fší¿\ˆÒí]âí¿úüoæÙ%î¿[¹Ë½¯dî¿jbÃÕžî¿;é³ÿBÔî¿ Ã¨5ïï¿ÎæÓãÒ0ï¿=·œEçWᅢÜIT&zï¿~)ïÇŠ—ï¿Ü>°ï¿Ò¥8}²ÃÆïnÒ↑†-*CÜ￱Vi¨-áï¿^°ó«<þá¿ØœDÑ¡â¿A wBã¿RCMݨßã¿ 4ϸ!zä¿"á£7r忬ƒpƒ¥å¿Ù³J=6æ¿ÆÀM·ŠÃæ¿r¶ëUMç¿ô‰ijˆÓç¿%ç¿Vè¿ÊJ_ÔÔè¿Ï¶„¾ÅOé¿Q"mçÏÆé¿u*À~à9ê¿”$Æå¨ê¿ž•çžÎë¿%¨ ŒŠzë¿MZ¼· Ýë¿Ù±íï<;ì¿\Ä…®•ì¿“'±†êì¿náš;í¿wƒtìù‡í¿W!cåÏí¿pÖPP7î¿è’¢PæQî¿lìÑdè‹î¿ž³êš4Áî¿RìºÂñî¿ H‹ï¿Ûã‡Dï¿kÛpe±fï¿í~ ®„ï¿Âr2Öyœï¿Ý>°ï¿’\õnþ↑–‘Èï¿~bY yÍï¿Bç’@Pðá¿ÙSø2“â¿pÄ=j83㿉èGÐã¿EýB;Ijä¿÷ÿÖ¢$å¿ëùÛ”å¿õé9# %æ¿Ûë‰8í±æ¿Š¢§bM;翪CyrÁç¿4÷PÆ9Cè¿sMMÁè¿ahw‰/<鿉^¸”ݲ鿹`Ï!•%ê¿W/€D”ê¿%p1žÚþ꿉xb Ge뿨$`ÿyÇë¿WžRd%ì¿EÁ«Š÷~ì¿Ù—m×%Ô쿽Û@â$í¿îâÔqí¿ÑòNÓ¸í¿E·•xñûí¿‚ W÷o:î¿7+(Etî¿‚ h©î¿¨óN­ÐÙüXwï¿A'ágU,ï¿o}¥ÛdNï¿­$´s kï¿ð~ ®„ï¿‚)ïÇŠ—ï¿ur|¾2¦ï¿j8!Où¯ï¿w"õ÷Ü´ï¿{í­Ÿßá¿ÚŒÙêâ¿6½ùi[!ã¿c~3ÈØ½ã¿‹K‘ÒJWä¿1˜ß™íä¿?f Á®€å¿îLhÊr濺˓ÎÏœæ¿ y)°%ç¿Ð¾þªç¿ù©~§,è¿Ê@~ð”ªè¿/õN#µ$é¿Ç¦ÙÃôšé¿mc–A ê¿]<Üù‰{ê¿C™í¼å꿨ìðÊKë¿[uD§¡­ë¿4š4 쿚*†{tdì¿pu;ˆS¹ì¿Z™Ó©Ä í¿Ó)¿x»Uí¿áx3>,í¿¡ùõ àí¿{[PPî¿™3²ïWî¿'w:áŒî¿¹ ¾½î¿×#Íšèî¿ô©½²Tᅥp$vD1ï¿q}¥ÛdNï¿pÛpe±f￉ÜIT&zï¿X¨Àˆï¿F~l ~’ï¿dø¼<]—ï¿%Ù)„-Ìá¿×VpÈmâ¿ËÈ7‹ ã¿#‰T^¨ã¿,²ˆl)Aä¿Ò±ZñÔÖä¿iÎIiå¿Húlqøå¿ Úõº5„æ¿ú8{* ç¿aß·>‘ç¿fY¼èY迳Q²Ö¾è¿2à*Z é¿ú¬$é¿k‚æ›éðé¿WF‘º^ê¿ß¸›lyÈê¿{ˆ.ë¿ü®«„ë¿ÖH,бìë¿>è­—Eì¿,ìMšì¿…ùê,êì¿H/Ñ5í¿ç\Åô|í¿¼‹¿í¿¸.1±‹ýí¿„›‚bì6î¿Î'ŸP¤kî¿U›cZ«›î¿#­ÛúÆî¿afÛ‰íî¿ö©½²Tï¿E'ágU,ï¿ Ûã‡Dï¿E·œEçWï¿Wè9¶qfï¿TŶ•$pï¿1T4eþt↑£Åüµá¿“âÍVâ¿Ä"xËôâ¿–üÖÛÛã¿kïÊrè'ä¿.ê÷Zټ俖“´œ—Nå¿Bö”¾ Ýå¿DµáÈ"hæ¿o@ûHÄïæ¿–‚¨TÜs翇PVôç¿Í—#qè¿—VØ"êè¿ÕZíO_é¿üÜ'’‘Ðé¿îþ¥Ù=ê¿)Csž§ê¿LÈY4 ë¿‘âb±'më¿?°>©àÉë¿WJ’¢P"ì¿T6,úivì¿ Â¸Æì¿—ö¿‘eí¿ÓŽë/Xí¿þ†ýÚsší¿] ('Øí¿í"AO@¿V‚¶Eî¿:Ê`ªuä¦hš î¿&­ÛúÆî¿Ü#Íšèî¿üXwï¿ H‹ï¿ÙæÓãÒ0ï¿@w83K?ï¿F¾ûñHï¿"!.¾ÅMï¿ésÝá¿íu«¯ÿ<â¿áÆt†Úâ¿ ‰A'Utã¿—4FÊ‹ ä¿/Ñ$«Ÿä¿_w…Kœ0å¿ÖœøH¾å¿‘\šL›Hæ¿Úþó}Ïæ¿.è.ÜRç¿ýÀ ¡Òç¿þ‹®ŽºNè¿qs+ûÇè¿€9‹E›;é¿X׬u>¬é¿ÌÙ -ìê¿[d©“꿤[Ç$æê¿v|éFë¿äȃƢë¿Sþ¼ ºúë¿EàÄ ]Nì¿fi2¡¢ì¿>f§~è쿱 øLå.í¿‰óýËpí¿3{ y(®í¿LôGñæí¿XÅ©î¿õš¥Jî¿;Ê`ªuî¿Y›cZ«›î¿¿ ¾½î¿°óN­ÐÙî¿^ìºÂñî¿è5ïï¿Å¼›(Sï¿Ó¯[ìï¿6‹ûS¹!ᅩ“j£má¿æÉa â¿5ÜtΉ¼â¿âþãtÎUã¿Ðj›Òìã¿ÉÁÓºNä¿n> z\å¿­ÝŠÙ*œå¿mJÉ"¤%æ¿KÎ"³«æ¿F=q-C.ç¿íŒ @­ç¿Ÿœg–(è¿én)ü2 è¿òïêmé¿Q6màõƒé¿Ãæjùïé¿I­ñUüWê¿„Âó¦ï»ê¿$Á™Ã뿉Êggiwë¿ýyûíÒÎë¿e1òò!ì¿z„Mä»pì¿|“j\"»ì¿J¦ ¢í¿åë™Bí¿·7Ç–í¿žÏÒ¸í¿ŽÊ7Vàëí¿ZÅ©¿V‚¶Eî¿Ô'ŸP¤kî¿/w:áŒî¿Œ h©î¿«³êš4Áî¿Jé³ÿBÔî¿å ^â‰•ìî¿$=}ñßðî¿ÿdZcá¿Óù3Â÷â¿çT8pœâ¿ù½ÎyL4㿌qe‘Éã¿Ø‚.É[ä¿(ÙHÝê俈9¤·vå¿h…¾¯Bÿå¿Óˆ+]i„æ¿2 ,$ç¿ê~8„ç¿ûÏޏþç¿"×Ù…u迸k —èè¿_ÿ¨¾Wé¿Í U Ãé¿îšú U*ê¿Ç®W(›ê¿˜r Éìê¿®óÐGë¿›ým¢žë¿2„Å1ñë¿{[ûmr?쿃ıöW‰ì¿´‡zúÖÎì¿wÊßÁäí¿P·ÉDwLí¿ù€ ,…„í¿ŸÏÒ¸í¿OôGñæí¿ò"AO@î¿‹›‚bì6î¿£3²ïWî¿(7+(Etî¿zìÑdè‹î¿ybÃÕžî¿:¶­X ­î¿ûˆíóƒ¶î¿¥;A»î¿ž™~°Bá¿ÿHÇÞῘÛmºxâ¿âÅ`Ôã¿:+¶Õý£ã¿bòvó5俦!°X$Ãä¿ÒÏ õMå¿lÆ›Þ|Õå¿Kб¦Yæ¿|d85^Úæ¿즑Wç¿l•=x'Ñç¿ÍÌé(G迎(•t@¹è¿6?ó¿'鿉³8’é¿N »Û¤øé¿éxp.[ê¿·DŠ’§¹ê¿ªCx°ë¿GR|Û.j뿳'¦É!¼ë¿=^è×Í ì¿±O 'Sì¿´è…"˜ì¿*Oè¿É¡7$»è¿Í*£Ôu$é¿¥Ö‹üH‰é¿°4½,êé¿qEvGê¿+F·ÒæŸê¿õ(w|¢ôê¿÷aÀ 6Eë¿¶´ •‘ë¿T¾wÁ³Ù뿱Ëÿ‡ì¿!òÌe]쿹è…"˜ì¿º‡zúÖÎì¿Q¦ ¢í¿º øLå.í¿‹ÓŽë/Xí¿õ\Åô|í¿ðx3>,í¿ ÑòNÓ¸í¿l!cåÏí¿rˆÒí]âí¿‘û ;ðí¿6·½]zùí¿›¤á]þí¿ ×a#Ïà¿Å¬n[Äg῟49;¶ýá¿92íááâ¿=8Æ0!ã¿ÖÐ.Œ®ã¿õ\ÆÞ8ä¿ÚŽRÀä¿ìƒ8Då¿5¸ÞÝÍÄå¿v´Ç(,Bæ¿.&ļ濉=aâ‰2ç¿—¤E@d¥ç¿ë½Ö'™è¿§ s€è¿·7jŽÎçè¿à]©{®Ké¿ÙzÔ§«é¿Ç^õÊ«ê¿z…Ú/¬_ê¿`:Çp›³ê¿#MKœlë¿c‚cOë¿Âÿ÷„–ë¿Y¾wÁ³Ùë¿q‚¼÷—쿺O 'S쿎ıöW‰ì¿ˆ“j\"»ì¿Lf§~èì¿§ö¿‘eí¿Z/Ñ5í¿ç)¿x»Uí¿ãÔqí¿‘ƒtìù‡í¿ïý;Fší¿KÔBð¨í¿("ë*±í¿Ì§ÿ¿µí¿¤µ—3œ£à¿î€Üï±:á¿\ö›…Ïá¿ZÜlÎ`â¿¡pO§ïâ¿=$Ÿ”{ã¿y¬ä¿ñ××3WŠä¿^ … 忼~eÓnŒå¿¦Çœxˆæ¿ó‡¯Q<æ¿.âµÁwöæ¿ ?Ç´(h翪òâ=Öç¿ÚS ’¥@è¿*ÚP§è¿íÛòe- é¿ö‡á6.ié¿ãºxæCÄé¿üRi`꿨©®Ovnê¿Ì܈Êx½ê¿g–Žª[ë¿e‚cO뿆¶´ •‘ë¿ñ¶gÖÏë¿H^è×Í ì¿‰[ûmr?쿉„Mä»pì¿vi2¡¢ì¿Â¸Æì¿™Ã¹ê,êì¿q™Ó©Ä í¿ÖÛ@â$í¿Šáš;í¿jÏäîMí¿vL6[í¿ãÄ„UGdí¿L+@PÐhí¿û+„uà¿:ÿÄ]÷ á¿©(ÆÉá¿Ã4þ¿ä-â¿=áÊ2»â¿DL\ô›Eã¿ Ÿ Íã¿ü(ÑxpQä¿ÂԹαÒä¿ÊнPå¿>RMü~Ëå¿Ð{,väBæ¿r‰$Û¶æ¿C04$Q'ç¿öÔù5”翽%ÊIvýç¿ø‘icè¿AHÕÏÄè¿õWxÉ"é¿,|ñÔâ|é¿ßLÓé¿gõÆÂ=%ê¿ìòñ]esê¿Î܈Êx½ê¿(MKœlë¿bÀ 6Eë¿[’àíÊ‚ë¿À'¦É!¼ë¿B„Å1ñë¿u1òò!ì¿XàÄ ]Nì¿h6,úivì¿1,ìMšì¿‰u;ˆS¹ì¿ó—m×%Ôì¿°'±†ê쿳Øpüì¿À&Tã í¿ªO3xÛí¿cHÅâWí¿¡– dâDà¿¶ÆQœØà¿¡='˜¼iῌ-nÇ-øá¿g ˜Ùƒâ¿(ÄE€ª ã¿ÆÈg‹’ã¿Ú§gä¿i8+•ä¿>¨¡÷Áå¿ùÎ_‹å¿¾S³Îæ¿äɪؽsæ¿aHŽçâæ¿Tc:ˉNç¿,y‚ö“¶ç¿ÓOöè¿8ö{ {è¿uøWs„Øè¿$@+˜“1é¿–³.À†é¿S(ý×é¿iõÆÂ=%ê¿­©®Ovnê¿g:Çp›³ê¿)w|¢ôê¿Îm°k1ë¿VR|Û.jë¿­ým¢žë¿zûíÒÎë¿hþ¼ ºúë¿mJ’¢P"ì¿Wè­—E쿵*†{tdì¿bÁ«Š÷~ì¿|Ä…®•ì¿Gó}˦ì¿CÑ=´ì¿ƒCgáó¼ì¿Âl¸ cÁì¿îõ*^¾à¿Õkž§£à¿˜Ë¯3á¿E4p±¿á¿wé4¦Iâ¿éŒÊ ÉÐâ¿øÀ'Uã¿3ØÙFÖã¿WðhÐwTä¿“ì‡Ïä¿Â©Ê`Gå¿ Þò»å¿«éå8*-æ¿öü°öšæ¿”ÃÐeFç¿kr† lç¿4¹æ0Ïç¿D£ª.è¿E\Ê›jŠè¿àšÍaâè¿e‰n¦‚6鿘³.À†é¿ßLÓé¿Si`ê¿‚…Ú/¬_ê¿8F·ÒæŸê¿ùèjÜê¿»Cx°ë¿$®óÐGë¿Êggiwë¿&äȃƢë¿V°>©àÉë¿ðH,бìë¿04š4 ì¿;WžRd%ì¿ù±íï<;ì¿­Ç£»Lì¿Ç›3 ÜYì¿\.VÐbì¿ágZ ÿfì¿GH¹ø?¸ß¿Ñúˆ_"là¿«°xvœù࿃®*px„á¿È•óâ  â¿G ËÏ’â¿Uœˆ¥ƒã¿t”D”ã¿^Œiÿ¡ä¿×ñ΢Šä¿¬:s`忱?:4mså¿Pä&+ãå¿án‰Oæ¿ 'é:v¸æ¿ž5xâç¿ ‚$¾ç¿cݺ(úÝç¿sæÓü‡8迈¥ ªYè¿âšÍaâè¿&@+˜“1é¿1|ñÔâ|é¿êºxæCÄé¿Ð^õÊ«ê¿EvGê¿$g‚ê¿ÉDŠ’§¹ê¿­r Éìê¿:Á™Ãë¿|éFë¿©âb±'më¿0ü®«„ë¿xuD§¡­ë¿Ç$`ÿyÇë¿oZ¼· Ýë¿z5.}Mîë¿Åä(¦Bûë¿(À&3çì¿|)øÎ9ì¿€Š–Hß¿ÇiÔ2࿼ÝÍš½à¿.-8é‹Fá¿T« ÓÌá¿4¥±}[Pâ¿Ãà²øÑâ¿P£ßNã¿õ•u´Éã¿rÚça{Aä¿Ê‡ #¶ä¿¾m£™'å¿åã ̕å¿6zâªæ¿éÍÒ"%hæ¿BùØ*Ìæ¿Ì' ˜¬,ç¿ $D~›‰ç¿¥&þ6éâç¿uæÓü‡8è¿H\Ê›jŠè¿zøWs„Øè¿ýWxÉ"鿈á6.ié¿åzÔ§«é¿À4½,êé¿M¡íE±$ê¿éxp.[ê¿Þ®W(›ê¿œÂó¦ï»ê¿¾[Ç$æê¿fÈY4 ë¿1{ˆ.ë¿ÈìðÊK뿪xb Geë¿I¨ ŒŠz뿇wAJ‘‹ë¿ÙY!¥X˜ë¿çßʤޠë¿ÃÄø!¥ë¿Œ¦^0+ÓÞ¿VPŒáëß¿Jü(Gà¿Úågõá¿›<öƒFŠá¿Ñ~ô3ã â¿^YA{·Šâ¿Dâ˯ã¿•ž–¹ã¿ä+¨€Àõ㿉 î´hä¿,ŠäØä¿Õ—ÛÕEå¿ð#'h®å¿kn,€_æ¿ò¦Bïvæ¿­½º2Öæ¿qL¦›1ç¿$D~›‰ç¿gݺ(úÝç¿D£ª.è¿8ö{ {è¿JHÕÏÄè¿øÛòe- é¿î]©{®Ké¿·Ö‹üH‰é¿²·hóÂé¿d »Û¤øé¿›ú U*ê¿b­ñUüWê¿vd©“ê¿FCsž§ê¿ÿ¸›lyÈê¿e™í¼åê¿Ip1žÚþê¿Å•çžÎë¿©Ì“´•$뿨rãH-1ë¿w¿j“9ë¿08—ÎÆ=ë¿M¨ï~vYÞ¿‘ŸÝ mß¿ü$¨‹â=à¿· çá¾Âà¿ ®ÍEá¿Åð…¢Äá¿Q€Z‚Aâ¿s§¿Ý»â¿3xK5¼2ã¿§Ñœ¬ñ¦ã¿Ð0Xä¿ 7&Ä3†ä¿lîöñä¿ ŒësÍXå¿Hû=2½å¿×îÙ<æ¿[;êPÞ{æ¿°½º2Öæ¿Ð' ˜¬,ç¿§‚$¾ç¿=¹æ0Ïç¿ÝOöè¿ø‘icè¿7ÚP§è¿Ç7jŽÎçè¿â*£Ôu$é¿Ì@Y’<]é¿¢³8’é¿è U Ãé¿ßæjùïé¿êÙ -ìê¿ ÿ¥Ù=ê¿yF‘º^ê¿€<Üù‰{ê¿}/€D”ê¿©”$Æå¨ê¿å‰j¹ê¿EŽ1zÐÅê¿òʯrÎê¿äÑ‘@8Òê¿Â̶Ûݿ´+êÞ¿j¾YKôß¿yø´ò|à¿á¿vßý࿊¯3c¤zá¿Ù>ä{õá¿?pŽmâ¿…ÚÅ„Éââ¿hÔ Uã¿ÂûÔgqÄã¿'•j»0ä¿Õ+6bè™ä¿7Âèÿä¿u.­Íªbå¿a‘>L!Âå¿ØîÙ<æ¿ò¦Bïvæ¿HùØ*Ìæ¿§5xâç¿ur† lç¿7y‚ö“¶ç¿Ê%ÊIvýç¿éS ’¥@è¿)§ s€è¿ß¡7$»è¿ÑÜ$rœóè¿P?ó¿'é¿{ÿ¨¾Wé¿o6màõƒé¿w׬u>¬é¿Ý'’‘Ð鿎‚æ›éðé¿’c–A ê¿ß`Ï!•%꿟*À~à9ê¿EV‹ Jê¿-éUÇRV꿳DPu^꿦dªä†b꿈k9UXÝ¿êàHìˆbÞ¿çHƒLhß¿_“<£›4à¿ùùõ†‘²à¿õ õAô-á¿wEfͰ¦á¿ëq ‹´â¿uºHí⿜þ?Iã¿u\8·mã¿÷ïä&Øã¿T4iŠ…?ä¿@Î÷»Å£ä¿yÙ%×å¿w.­Íªbå¿!Hû=2½å¿qn,€_æ¿ñÍÒ"%hæ¿'é:v¸æ¿ ÃÐeFç¿bc:ˉNç¿Õù5”翼òâ=Öç¿þ½Ö'™è¿Y‹>Oè¿b ÑQ#†è¿ª(•t@¹è¿×k —èè¿ðêmé¿¢9‹E›;é¿÷ZíO_é¿5ú¬$é¿î¦ÙÃôšé¿²^¸”ݲé¿|"mçÏÆé¿æ‚Œ¨ÈÖ鿱 •aÅâé¿ã‚P9Äêé¿u×ôÃîé¿h8’ÐÜ¿ §6ÖÝ¿=Ihç@×Þ¿æKO«‰Óß¿sáºueà¿æ(ñÞà¿Aûè,UῬéî¤É῜BF4:â¿}úyZ‰¨â¿Ôø Þýã¿¢€ ?|ã¿a’¦_âã¿–}¬˜tDä¿@Î÷»Å£ä¿9Âèÿ俌ësÍXå¿ö#'h®å¿>zâªæ¿ën‰Oæ¿ý°öšæ¿nHŽçâæ¿S04$Q'ç¿?Ç´(h翪¤E@d¥ç¿ƒ¼pUúÞç¿ò¤ûâè¿èÌé(Gè¿@×Ù…uè¿o)ü2 è¿‘s+ûÇ迸VØ"êè¿Và*Z é¿UõN#µ$鿉hw‰/<é¿ù¶„¾ÅOé¿çØ?½t_é¿™‡:ké¿tŸ­s鿱õÂHwé¿vjlDDÜ¿¼kWˆJEÝ¿ÕKtAÞ¿fåd¬ó8ß¿á;Ú?Ñà¿…Á¬­Œà¿4±Èüá¿k3¤¬r῵)S·«áá¿7RäèM⿯NzS·â¿@›Ï7Ûã¿åÉOMpã¿c’¦_âã¿V4iŠ…?ä¿Ù+6bè™ä¿lîöñä¿Ý—ÛÕEå¿ðã ̕å¿+Pä&+ã忹éå8*-æ¿ôɪؽsæ¿„‰$Û¶æ¿BâµÁwö濞=aâ‰2翆ðµBkç¿ éˆ,êŸç¿Š•=x'Ñç¿Ðޏþç¿Àœg–(è¿!Œ®ŽºNè¿ñ—#qè¿ÚQ²Ö¾è¿ó@~ð”ªè¿MMÁè¿öJ_ÔÔè¿®P07ä迪kXaÃïè¿kù)w÷迲½SZQû迺ãL´Û¿um8éگܿæTMý¦Ý¿\A: ™Þ¿‹Kqúd‡ß¿àb08à¿›>ùg-ªà¿$tÛ˜á¿S_CBa†á¿äM'×uðῦ2>ÆWâ¿òg‘ˆB¼â¿A›Ï7Û㿦€ ?|ã¿ûïä&Øã¿-•j»0俨7&Ä3†ä¿ ,ŠäØä¿Êm£™'å¿¿?:4mså¿Þò»å¿ÏS³Îæ¿ä{,väB濈¯Q<æ¿.&ļæ¿(jy¹yóæ¿á÷§M'ç¿>즑Wç¿ ~8„ç¿3íŒ @­ç¿!Á ¡Òç¿B‡PVô翎Y¼èYè¿#ª~§,è¿_÷PÆ9Cè¿Sç¿V迺±b#eè¿~Ãñ?tpè¿ê‰þµxè¿mWŠ;Ç{è¿V½0µÛ¿ä®ßÔþÜ¿S™½óÝ¿ n`›nõݿȉKÏJÞÞ¿¹ŸápdÂß¿ Ç)ÌPà¿Ò2 â½à¿T˜éúb(á¿¿œ>á¿+—jådõá¿©2>ÆWâ¿´NzS·â¿Üø Þýã¿|\8·mã¿ÌûÔgqÄã¿(Ð0Xä¿– î´hä¿Ù‡ #¶ä¿½:s`å¿Õ©Ê`Gå¿ Ï_‹å¿TRMü~Ë忾ǜxˆæ¿´Ç(,Bæ¿·h)axæ¿\m—«æ¿Ÿd85^Úæ¿W ,$ç¿l=q-C.ç¿Vè.ÜR翾‚¨TÜs翌ß·>‘ç¿ý¾þªç¿ØCyrÁç¿%ŠijˆÓç¿$ZˆÎKâç¿ùÏX`í翃‹‚QÄô翦#5—vøç¿MÁï†Ú¿1."ÎwÛ¿ì"pdÜ¿½á®l±LÝ¿9ÂÐn0Þ¿Ú ô‚ß¿"ˆ­Íéß¿ND›I–_à¿=ÕÊ_¿Çà¿–á, R-á¿Åœ>á¿ìM'×uðá¿ARäèM⿊úyZ‰¨â¿©þ?Iã¿wÔ U㿸ќ¬ñ¦ã¿÷+¨€Àõ㿇Úça{Aä¿ïñ΢Šä¿¬ì‡Ïä¿Y¨¡÷Áå¿çнPå¿Û~eÓnŒå¿U¸ÞÝÍÄå¿Å·åÑùå¿6¢¨¶q+æ¿tб¦Yæ¿þˆ+]i„æ¿wÎ"³«æ¿ÿó}Ïæ¿ž@ûHÄïæ¿+9{* ç¿@y)°%ç¿¿¢§bM;ç¿©¶ëUMç¿b¨¿Å[ç¿%"à›f翵i?9Öm翺W-­sq翤ŒÔ¾êÙ¿@³ÍÞ`ÕÚ¿œv3´‹¼Û¿7i\™oŸÜ¿Òaw‘é}Ý¿¤ªðM×WÞ¿6R¼3-ß¿ûÌ„`ˆýß¿’ÞW…dà¿@ÕÊ_¿Çà¿\˜éúb(á¿^_CBa†á¿Â)S·«á῜BF4:â¿„ºHíâ¿—ÚÅ„Éââ¿FxK5¼2ã¿«ž–¹ã¿ –u´Éã¿xŒiÿ¡ä¿rðhÐwT俆8+•ä¿áԹαÒä¿ … å¿‚ƒ8Då¿Ù;kÞwå¿ÞÔj Y¨å¿—Æ›Þ|Õå¿•…¾¯Bÿå¿›JÉ"¤%æ¿Á\šL›Hæ¿uµáÈ"hæ¿SÚõº5„æ¿ïË“ÎÏœæ¿ì‰8í±æ¿ÿÀM·ŠÃ濬~|“¥Ñæ¿BF ;Üæ¿`îÃ;Kãæ¿Ë7OÓææ¿ âVë6IÙ¿ ÕåmÐ.Ú¿m>U`Û¿®öûØÃíÛ¿¡Q|ÕØÆÜ¿,ªÑ}›Ý¿yïs’kÞ¿»äBPõ6ß¿þÌ„`ˆýß¿RD›I–_à¿Û2 â½à¿1tÛ˜á¿,k3¤¬r´éî¤Éá¿üq ‹´â¿SpŽm⿈§¿Ý»â¿[â˯ã¿™P£ßNã¿”D”ã¿PØÙFÖã¿ù§gä¿)ÑxpQä¿Ø×3WŠä¿ÿŽRÀä¿)ŸË›òä¿7`“é!å¿þÏ õMå¿2ˆ9¤·vå¿ÝÝŠÙ*œå¿œøH¾å¿uö”¾ Ýå¿8Húlqøå¿$MhÊræ¿-ê9# %æ¿´J=6濹Z„˜Dæ¿äJ'ïTNæ¿4v>¶8Uæ¿o4ÎݪXæ¿'iät¤Ø¿;6Ça6„Ù¿ U®’`Ú¿Ùï]‘É7Û¿ ?¤X Ü¿w–ÿˆ“ÚÜ¿²<¦í[¥Ý¿~ïs’kÞ¿?R¼3-ß¿0ˆ­Íéß¿, Ç)ÌPà¿«>ùg-ªà¿+4±Èüá¿Aûè,Uá¿‹EfͰ¦á¿ï>ä{õá¿h€Z‚Aâ¿xYA{·Šâ¿ßà²øÑâ¿sœˆ¥ƒã¿Á'Uã¿çÈg‹’ã¿, Ÿ Í㿞¬ä¿,õ\ÆÞ8ä¿a³E:jä¿IšªÉ7˜ä¿Õ!°X$Ãä¿G(ÙHÝêä¿ > z\å¿’w…Kœ0å¿Ë“´œ—Nå¿FiÎIiå¿wf Á®€å¿&ùÛ”å¿éƒpƒ¥å¿L€Å¥ì²å¿ÏŽ|®ý¼å¿õ1‘´Ãå¿Ú ÕDÇå¿öGæû׿7‘1 ­ÕØ¿£矫ٿyVÒœ}Ú¿­4áD„KÛ¿ŽÑ*56Ü¿w–ÿˆ“ÚÜ¿1ªÑ}›Ý¿­ªðM×WÞ¿ç ô‚߿џápdÂß¿%àb08à¿•Á¬­Œà¿ù(ñÞà¿õAô-῟¯3c¤zá¿Üð…¢Äá¿ê~ô3ã â¿O¥±}[Pâ¿d ËÏ’â¿Ê ÉÐâ¿HÄE€ª ã¿fL\ô›Eã¿C=$Ÿ”{ã¿üÐ.Œ®ã¿MðþÄzÞã¿ûtãÿX ä¿òvó5ä¿?Ø‚.É[ä¿ùÁÓºNä¿aÑ$«Ÿä¿aê÷Zټ俲ZñÔÖä¿F1˜ß™íä¿0×¢$å¿]á£7rå¿ü·h€å¿ZÆÏGL(å¿t%=Õ.å¿^i8ø2å¿Ú)xr¤O׿e09NO#Ø¿˜ÙÙHAóØ¿cjQZ¿Ù¿0Ýîz‡Ú¿¶4áD„KÛ¿?¤X Ü¿¯Q|ÕØÆÜ¿ãaw‘é}Ý¿PÂÐn0Þ¿é‰KÏJÞÞ¿²Kqúd‡ß¿÷;Ú?Ñà¿‹áºueà¿úõ†‘²à¿ü¿vßýà¿&®ÍEΌ<öƒFŠá¿u« ÓÌá¿ê•óâ  â¿šé4¦I⿌ ˜Ùƒâ¿dáÊ2»â¿ÊpO§ïâ¿h8Æ0!㿞’¢óÆOã¿™HËîb{ã¿l+¶Õý£ã¿HŒqe‘Éã¿k›Òìã¿Î4FÊ‹ ä¿£ïÊrè'ä¿g²ˆl)Aä¿ÇK‘ÒJWä¿‚ýB;Ijä¿K4ϸ!zä¿r'®Ùц俦Nÿ¨Wä¿ËžÖ®±–ä¿þvðޙ俪¸–•ÊŸÖ¿5r ²8m׿;u¼ 7Ø¿l`eýØ¿‚cjQZ¿Ù¿†VÒœ}Ú¿æï]‘É7Û¿ÀöûØÃíÛ¿Li\™oŸÜ¿Øá®l±LÝ¿0n`›nõÝ¿†A: ™Þ¿”åd¬ó8ß¿LO«‰Óß¿y“<£›4à¿•ø´ò|à¿Ô çá¾Âà¿­Úågõá¿P-8é‹Fá¿§®*px„á¿j4p±¿á¿³-nÇ-øá¿ì4þ¿ä-â¿…ÜlÎ`â¿f2íáá⿲’Ǿ⿠IuÉkèâ¿NâÅ`Ôã¿/¾ÎyL4ã¿ÿãtÎUã¿E‰A'Utã¿ÐüÖÛÛã¿^‰T^¨ã¿ ~3ÈØ½ã¿Ü‰èGÐã¿“CMݨßã¿ðÊeGùëã¿Üÿ´@7õã¿.«b\aûã¿g·§vþã¿sºm™sìÕ¿€ýI…³Ö¿½§Îw׿@u¼ 7Ø¿¡ÙÙHAóØ¿µ矫ٿ2U®’`Ú¿…>U`Û¿·v3´‹¼Û¿'ì"pdÜ¿}™½óÝ¿TMý¦Ý¿²ÕKtAÞ¿tIhç@×Þ¿ IƒLhß¿§¾YKôß¿%¨‹â=à¿mü(Gà¿àÝÍš½à¿Ñ°xvœùà¿À˯3á¿Ê='˜¼iá¿Õ(ÆÉΈö›…Ïá¿Î49;¶ýá¿Öè¿·†)â¿g*9ŠRâ¿ÎÛmºxâ¿U8pœâ¿nÜtΉ¼â¿Çt†Úâ¿#xËôâ¿ É7‹ ã¿v½ùi[!㿱Ä=j83ã¿„ wBã¿ÿTDNã¿w'ÉúWã¿{ó8ü\㿘àù_ã¿=¯%»5Õ¿ñLôµQöÕ¿}ýI…³Ö¿7r ²8m׿j09NO#Ø¿E‘1 ­ÕØ¿I6Ça6„Ù¿ÕåmÐ.Ú¿W³ÍÞ`ÕÚ¿L."ÎwÛ¿¯ßÔþÜ¿Ÿm8éگܿêkWˆJEÝ¿° §6ÖÝ¿áHìˆbÞ¿%¢³´+êÞ¿ËŸÝ mß¿”PŒáëß¿èiÔ2à¿ôúˆ_"là¿+Õkž§£à¿ÜÆQœØà¿bÿÄ]÷ á¿Üï±:á¿ð¬n[Ägá¿Î3­'’á¿“{Ø[Õ¹á¿2ÿHÇÞá¿ú3Â÷â¿Éa â¿#v«¯ÿ<â¿N“âÍVâ¿WpÈm⿌Ùêâ¿Tø2“â¿DÑ¡â¿sƒ*)­â¿–4’<Óµâ¿Ü\g±š»â¿¥Aߤ~¾â¿%Ý‚g½{Ô¿=¯%»5Õ¿tºm™sìÕ¿¯¸–•ÊŸÖ¿ä)xr¤O׿Hæû׿9iät¤Ø¿$âVë6IÙ¿¾ŒÔ¾êÙ¿;MÁï†Ú¿~½0µÛ¿èãL´Û¿¦jlDDÜ¿ž8’ÐÜ¿¾k9UXÝ¿LÂ̶ÛÝ¿‹¨ï~vY޿Φ^0+ÓÞ¿ÅŠ–Hß¿H¹ø?¸ß¿ö*^¾à¿È– dâDà¿%+„uà¿Ïµ—3œ£à¿Í×a#Ïà¿¶?‡ÿøà¿PA¦¼dá¿Ò™~°Bá¿4eZcá¿Â“j£má¿TésÝá¿:ª£Åüµá¿`Ù)„-ÌῸí­Ÿßá¿€ç’@Pðá¿°ó«<þá¿´µ‚Éb â¿n¨!áÀâ¿È]~¨Uâ¿ð½EC â¿Rx- —¾Ó¿§JüJßqÔ¿Eø+r"Õ¿ rÅYßÎÕ¿MÐvYaxÖ¿Ù©¯Ml׿á󍛿À׿ØÈW5·_Ø¿ |JÅúØ¿ê`oêù‘Ù¿ ±ÄË<%Ú¿†ÿð‹w´Ú¿šªÃ”?Û¿¶Ãœò|ÆÛ¿Ëä»WIÜ¿%ruaÇÜ¿MÉMÑ4AÝ¿½âù£…¶Ý¿ïD€A'Þ¿ÚW“Þ¿ÉËôƒµúÞ¿ºœîM]ß¿kš¸s»ß¿Ú¸õ à¿“H°×ê3à¿ Iq`[à¿ô]-TP€à¿S 7δ¢à¿3µ‘ˆÂà¿m1;¶Æßà¿ÙÇb¹júà¿e/~pá¿à@:TÔ'á¿Ì±0ë’:á¿>Jj`©Já¿Ñ8Xá¿æ‘bÔbá¿åÞn5åjá¿„ sFpá¿ÚäF÷rῳö¤AeþÒ¿„3ªYܪӿST KTÔ¿ã 6—úÔ¿òü4§Õ¿'|ãa=Ö¿važž®ÙÖ¿ÆœMur׿ò`žØ¿èßMؙؿ÷]£E¼&Ù¿ÓH¥Ð„°Ù¿”X!:W6Ú¿Ê‹Gß¸Ú¿ÊØ¼Ç5Û¿Îë¯Û¿V¬Dp$Ü¿4!K•Ü¿þØ=¡½Ý¿Çr€ ·iÝ¿™1sW'ÍÝ¿£8š/ÿ+Þ¿%Ðãó/†Þ¿ò¿é»«ÛÞ¿VWYe,ß¿¦Í¬XPxß¿C«´a¿ß¿°÷c5Æà¿‹Õá)dà¿£g­§…;à¿~wEX&Uà¿^ùGBlà¿Ñ…æÕ€à¿hÞ’à¿hÊnãW¢à¿©A¯à¿O)½¤—¹à¿GpôYÁà¿1[ÕÓ†Æà¿§%ŸvÉà¿ÖÙ¨E;Ò¿^®üÑàÒ¿!KŠsƒÓ¿H‚‹æ#Ô¿½»›¿—¿Ô¿³©ë…éXÕ¿ ú”ðîÕ¿¢59ʕֿ¥ñŸˆÂ׿ š&¼`œ×¿ w.ÝZ$Ø¿·Ó󛍨¿*)›)Ù¿ú^]¢¥Ù¿Ê’Èù?Ú¿LãáÖ’Ú¿4#ÂTÛ¿˜¢ÃA¨oÛ¿F•o¬À×Û¿‰Öô;Ü¿ ß%·›Ü¿eh; öÜ¿*^ËwœLݿǵȪžÝ¿pü5e&ìÝ¿]ç7|5Þ¿àÏ¿:¼9—3пÞ?7­tпˇþ²Ð¿N–Õ(Úîпl\U(ѿ͔y9³^Ñ¿|¾·iŸ’Ñ¿£¯^äÕÃÑ¿ØZ¯OòÑ¿|sÊÒ¿FU$MíFÒ¿&ÝLmÒ¿D„kéEÒ¿í(,³©°Ò¿wÃ|«+ÎÒ¿.„EÇèÒ¿Ì©ØfxÓ¿Ìz/óóÆ¿èøB@Ç¿X$"‡CÈ¿õàÁåÈ¿j4Ø $„É¿rñ—Ê¿§H¦µÊ¿VtSGË¿¦Ý™lÕË¿KÉì^;_Ì¿„¨yªäÌ¿îÈB¤eÍ¿G)éâÍ¿Zi#âëYοPO²ÍοbP¿—{;Ï¿4‡Œ¥Ï¿íj#äпÜM@ Æ4п·ï3Z)bпx›Qп=­‡êSµÐ¿¥5ÌíÛпÞMñ‰0þпmKT³Ñ¿màH’<Ñ¿++ ÍÈWÑ¿ª>]®RpÑ¿$,†Ñ¿ÝÅÏQ™Ñ¿dx½À©Ñ¿õ$zdv·Ñ¿¥Œ—§pÂÑ¿$uÕ­ÊÑ¿ Ô¨,ÐÑ¿ËÃHìÒÑ¿!B%’¬t¿ùH‡#AÿJy$LãÀÿ=²Ø¨ybÄ¿_i¿NëÅ¿’R ϜſXåÊ:ÿ3Æ¿·*™&rÈÆ¿B:®aYÇ¿ #x·æÇ¿5ë¸]pÈ¿”òª6?öÈ¿J!>LGxÉ¿êvìaöÉ¿:é/¥{pÊ¿ZT¢æÊ¿ºù½°aXË¿‡` A ÆË¿„Ljj/Ì¿–ª©ìq”Ì¿õ±Ú3õÌ¿6ù’Y9QÍ¿5œÌ'ܨͿDqùìûÍ¿„d\Jο)¹¯ê ”οŒK©N.Ùο¾ÛêyÏ¿ðÉËÒùTÏ¿9›øÛ¤‹Ï¿$-—r½Ï¿ãSW[êÏ¿áqJ, Ð¿Ž­Yy±пWƒ,»)пc» ´F6п&`øKR@пÊ&YÜGп¤c ²ãLпKS!gOпi«U»À¿íN&BSÁ¿ýV‰XƒèÁ¿­í8–{¿½C¥H¦ ÿäUGI[—ÿY‚å !Ä¿{Fü៧Ŀlä}+ſר$v'«Å¿Y…ò'Æ¿yJµöQ¡Æ¿kC‰4Ç¿SA’‡‰Ç¿Ö…Pq9øÇ¿ Û9cÈ¿²ß4úuÊÈ¿þç8à-É¿ »d{hÉ¿3ãgéÉ¿±7º˜@Ê¿jÓ%”Ê¿ßÎ 4˜ãÊ¿û@}×å.Ë¿—õrbvË¿Iu²Ýâ¸Ë¿·),ù|÷Ë¿Þy’ Ç1Ì¿9àÖ¸gÌ¿WÀŒØG™Ì¿äÄ1™nÆÌ¿°“[i%ïÌ¿©ÊfÍ¿l0bË*3Í¿6³ànNÍ¿0}U .eÍ¿/—^ËdwÍ¿z?Q…Í¿Êæ€.ŽÍ¿Ó×Ïò½’Í¿ ‚UèÑþ½¿Úrs.¿¿Pñp` À¿}èUø¯À¿2ÚÀqÁ¿/J_‘Á¿·xðû ¿º2Í<žƒÂ¿P­æ©eù¿zOF@lÿ tî³ÜÿÒ[çHÄ¿jø<’²Ä¿}Ò Å¿7r,E|Å¿0V1É-ÜÅ¿c2œ·8Æ¿M:4Ô‘Æ¿¬sÕuçÆ¿=-òH9Ç¿§E`çˆÇ¿Zò¯”÷ÒÇ¿0¹ƒÄ.È¿2S…{®]È¿*2QlÈ¿)fïp^ÙÈ¿š£›œ{É¿4.î,»EÉ¿DpSvÉ¿ä ۢɿã&gªúÊÉ¿î¨CyïÉ¿Yà(øÊ¿2ïq,Ê¿ì¦^šâDÊ¿ Ó!CFYÊ¿^üÄ™iÊ¿ª'ù™ÚuÊ¿PÖß~Ê¿OûsS‚Ê¿,6:«Y‚º¿Íj~|s»¿Ù•œ²‡_¼¿©_sÖ G½¿ßÝ™6+¾¿¨väo$ ¿¿ÇGÎlIä¿¿Úc¸Á\À¿È}/ÍØÄÀ¿”x°çY*Á¿zÈÞ`5Á¿)”1ú[íÁ¿9øß¾J¿g›£«O¥Â¿Õ¢þeý¿{ŠU‰ÃQÿɰ‹Œ£Ã¿”8Mòÿi¬û=Ä¿!Öúµ‰†Ä¿åk#îËÄ¿mê—Å¿­v)Ü MÅ¿_ª>µˆÅ¿ÁÊ ÁÅ¿~`öÅ¿¤j±¤œ'Æ¿š\¢ÉUÆ¿ÞW'ꄀƿÐÖ-åǧƿ3‡…ŒËÆ¿Œs4GÍëÆ¿1Fú0…Ç¿ÙV%Õ¯!Ç¿™!9RI7Ç¿&‰SNIÇ¿d¼¼WÇ¿ê ;SbÇ¿êX†lÉiÇ¿„sz@fmÇ¿÷3ñÊ·¿,YÓê²Ò·¿ÙCŽq¿¿¢Šß]i¹¿ð!Ö$â.º¿J‘/Ì\ðº¿QD¹ÿ¯­»¿äÝ’¾f¼¿?ÒYìk½¿ˆí?œË½¿B1ç[4w¾¿Ñ^rË¿¿йÑ2À¿¿_ Ù7³.À¿ª³Ì3ÎzÀ¿pýX ^ÄÀ¿*ìp%Y Á¿ç"ѲOÁ¿‡öa‘Á¿‚•ÜYÐÁ¿çz«e“ ¿8‡äjF¿۪¤|¿=ç¥êi°Â¿±ØýMá¿@ÈýHÿåVÁS:ÿQ”êafbÿŽ7t|‡Ã¿ž”©Ã¿z#ûšÈÿ2‹Ør˜äÿ ê0…ýÿ›f”\Ä¿ÖOŽ&Ä¿²Ó ¿5Ä¿¨6DâDBÄ¿[•IäªKÄ¿i0ß³ïQÄ¿!ÑŒYUÄ¿¨‰%û¯}³¿ùBæª.´¿fÁ‰Ü´¿ñ¿/‡µ¿*V Ž„.¶¿˜ïª´mÒ¶¿e'ôìÑr·¿ÚÚL{˜¸¿ÝÏÃ2©¨¸¿Qàxì=¹¿j»DIKϹ¿ “=9¯\º¿‚ÿ3{溿¤º â/k»¿ïÇfä"컿²*ПÇh¼¿ßÌÛ á¼¿>Ò ÚT½¿ñ#W#Ľ¿š6‘‘Õ.¾¿È Hà”¾¿+ØŠ¾3ö¾¿ïÁòÀR¿¿Ý(Ÿyª¿¿s×Ï0V4³¿^%’¼´³¿íÓ2´¿¹x:ì@t°¿©¤ˆfdΰ¿P»mð%±¿ñ†Æ×z±¿ï˜‹ ͱ¿ìB3Ü‚²¿{Ws4.i²¿)9"Á³²¿“±õù²¿(Ég_ú=³¿ãÚ³¿œu—½³¿âöšÌø³¿ !ßG0´¿áK¸ÔÐd´¿ÇÍ^N{–´¿2}0 ùÄ´¿ŸßâBð´¿ræŠ%Rµ¿6˦ =µ¿l ¹¨^µ¿Ì…V2å|µ¿#OgÑ—µ¿mSº1i¯µ¿­Ú:î¨Ãµ¿Œ:u}Ôµ¿A‹D⵿^Ï‚-;쵿â0˜§óµ¿gè{§cöµ¿wS8Üá¿jWÿgOd¢¿*SxèÀ£¿&ÀÛîCž£¿ð>€À6¤¿C™̤¿ÄT¿¯H^¥¿4X•»&í¥¿þO64£x¦¿Ý7—¨§¿‡Z÷ê!…§¿IçÝÁú¨¿ Ð~=ƒ¨¿ë«|ü¨¿¶—n‡þq©¿ˆê”ã©¿í)w,Qª¿AÀ̆µºª¿ 7¬h «¿^èTyZ«¿—KtºWÞ«¿¸Ç'Õ7¬¿ÖÄ2`‹¬¿q”ŽPÛ¬¿oÝ'×Í&­¿ã¯e'®¿†NŠ×\®¿&ÿ?2ð‹®¿ «­(·®¿ÌM™Ÿ¤Ý®¿DíÒ^ÿ®¿Ì4æO¯¿4–u4¯¿ˆë3_ËG¯¿Äu©VNV¯¿„:ü_¯¿¹U‹Ód¯¿å®¡R•¿ŽÝÃ÷=–¿BSsÒ–¿z?¿#—¿.H{r2D˜¿)~Q2ƒ÷˜¿¯½Xú¦™¿µ0ØÔ|Rš¿9316ðùš¿bµ©:›¿’ô@C<œ¿„ÂɶðÖœ¿v_'ð+m¿Á³À‚Ýþ¿kƒ÷¿šUbŒJŸ¿™3¡;Û—Ÿ¿©Ý]F  ¿‚¾À%H ¿UðPd‚‚ ¿Pú\HSº ¿5%xÑï ¿fn Ê/"¡¿_œc+R¡¿=9÷7{¡¿]Jª¡¿ûœ’üÑ¡¿4¨äK ÷¡¿rÜZ¢¿ùßYæ9¢¿uôÙU¢¿ZA,mÊo¢¿ßß÷ㆢ¿ÁÛ)""›¢¿Îì̬¢¿?«NJ»¢¿Ç‰"^›Æ¢¿PÝ@>QÏ¢¿¼Î’ Õ¢¿qÈovØ¢¿Ø”2¢o|¿M¨Öq}¿ÏÞH˜o~¿5£«²ß¿üPb`Íà¿?{3€2à¿ÿ«+l«Yà¿b¥ø€†~à¿ú0¹ü²Ÿà¿uqÌõ¼à¿V›SB×à¿¿«Ó”íà¿"}o>þà¿ÖÎöõü á¿qã‹é4á¿C 0Ôýá¿{ñMXÅÑÏ¿Œ]… ¤ŽÐ¿Â̸ÀÖ7Ñ¿L®¿ãÑ¿l9P¸Ò¿’ö‡?´?Ó¿á×Ä{ïÓ¿Ô p¨' Ô¿Òý·PÕ¿mO‘)KÖ¿¨ܪֿ߰f½6—_׿ùc¼¦q Ø¿L…’·Ø¿ÔŸÀRý_Ù¿ÂÝ ­ÖÚ¿”ò~'¨Ú¿rÕÏ8GÛ¿«fp°áÛ¿t7äÁxÜ¿¾¸Ó€w ݿȆ·nâ•Ý¿¸W L‚Þ¿°#Ë:zÞ¿:ÈM‡ùß¿Ì?6%Œß¿-*{$ù߿≠~Œ/à¿n}­¡^à¿‚Á¬ð¤‰à¿^MM´œ°à¿}X¹AÕà¿sûàËöà¿ÌnÈßá¿ü‡a€ß.á¿ý¼([Dá¿”~EAÚUá¿zjídbá¿ôaÐÝjá¿/®j Àmῇ Ô„{пöNqK#Ñ¿ÕVÛ]/ÍÑ¿¹}E›yÒ¿ª1ÎÄ'Ó¿*KÚÉp×Ó¿’K ˆÔ¿_¿èªS9Õ¿9åªêÕ¿ÊÅ–PÔ›Ö¿Peº*L׿¡'Ötû׿*« ©Ø¿k¤\¾TÙ¿Á‚qñãýÙ¿Î~3J¤Ú¿ô0}µQGÛ¿8ó@ÉæÛ¿7tfó‚Ü¿ŠiØ Ý¿m㵫ݿÙ0Gÿ7Þ¿¶I=H¿Þ¿ÜénÃ@ß¿ä!Ëì»ß¿}³µ¡N࿈élç-Oà¿–›€‚à¿ÔkI¯²à¿Ï¦¢ÓÝà¿^‚EÔ¿á¿üÞç~*á¿….=wÕKá¿R—iá¿:¦P¾lƒá¿á&îsù˜á¿s FÒ"ªá¿&É6aÞ¶á¿[‰¿á¿œf<‚ Âá¿î¨ßúÑ¿= Ç’P°Ñ¿rP0%s[Ò¿˜²Ó²Ó¿Êï )²·Ó¿ofÀ+hÔ¿Cl`[uÕ¿!±>ÞgËÕ¿#SÌkz}Ö¿öšVE/׿•g)Rà׿…ðp“9Ø¿'æ1g…>Ù¿ 5È/ÐêÙ¿¹Ùêx¥”Ú¿¹¸¬­¢;Û¿w9Ç=VßÛ¿=DKaÜ¿ÀdÛ6VÝ¿ch9˜Ú²Ý¿™Ò‘»…EÞ¿ƒŸ%[ÓÞ¿ÐîÛ¥íZß¿cì.øÜß¿ä“Õc,࿊þt¹gà¿šŠ€Ò@žà¿~{›SïÑà¿sÃü?óá¿ð)/:.á¿BRrÅVá¿æÌ zÃ{á¿ {ª^&á¿õëÙoÁºá¿dÖÒk^Ôá¿£o"Åéá¿«Š3Úúá¿>5IwŠâ¿ÖŽ rÄâ¿øHAeÁâ¿p717¬ŽÑ¿ŽŠsˆ}7Ò¿éíâQãÒ¿fà§«E‘Ó¿Lm û@Ô¿ õ£ÎòÔ¿jpð¤Õ¿çè¶VÖ¿ÀEçp ׿¦“rùܻ׿m¤mØ¿–¥™ÎÙ¿øq ßþÌÙ¿ ùúäyÚ¿NóįW$Û¿Ÿ5WJíËÛ¿F2UY;pÜ¿ª[-ÌÛÝ¿Ðä¸=h­Ý¿Cø£9EÞ¿JúÄf¿ØÞ¿^âäÌfß¿h7|xLïß¿¶×~ô8࿚I˜j'w࿾Ê*º²à¿ârñÔ£éà¿Öߨá¿ê ©0 NῆêÖ’ºzá¿B²•¬£á¿Ð$ZçÈá¿[?Ÿœ]êá¿£jIîâ¿4ߪÇq!â¿ :]BÃ6â¿çŽÈGâ¿<¡øJnTâ¿„ ­¢\â¿jXzÌ¢_⿼ø¸¾Ò¿8‰ ¸Ò¿ ×¶ÓsdÓ¿KƒÔ¿„“cXÃÔ¿–(â— uÕ¿Ô…ée·'Ö¿ŽUfÊíÚÖ¿ˆ#{ÝBŽ×¿îqÄHAØ¿¿ÆéóØ¿Ã Òæ¬¤Ù¿.Ü4x.TÚ¿ùΧ`¨Û¿ªÌ€-®¬Û¿R¤ÕTÜ¿H̬˳ùÜ¿Î+ãšÝ¿Ò®¼ºý7Þ¿d%O¡ÐÞ¿[b`Êmdß¿u+ ’óß¿Ìl/ >à¿ùØÔ_à¿z|¹¾à¿t6ŽpQù࿯fG˜'1á¿3v>Wzeá¿ú‹[W.–á¿ü!.Ãá¿t¶ØŠjìῈ¦;úØâ¿¶²¬ h3â¿ÌŽIýPâ¿6+cƒyj⿘Â4Áâ¿`ÔÔ[½â¿v‡¦d[â¿rï¶á‰¥â¿ØFºk˜¨â¿*4ÚÇɇҿN#,nŸ1Ó¿_ós …ÞÓ¿ìJN©œÔ¿OâÂ~>Õ¿ìè–ƒÂðÕ¿r†)‰ý£Ö¿^ŒÛÃW׿¼¦8¨ Ø¿t5½…<¿Ø¿e¯6rÙ¿2\ĺ#Ú¿øóÈÓÚ¿–ø¦˜ÌÛ¿@úµ$\-Ü¿ª)™¿ ÖÜ¿ô¤­"r{Ý¿çáÞ (Þ¿ÈéhȺ޿ЀÃðSß¿zðrgAèß¿ðY‘é®;࿼Êxv€à¿èÎLÂà¿[ z á¿Ý-ƒ‰†<á¿ü0Ò tá¿Lëíq8©á¿+ãÛC1Úá¿ø×Ssâ¿b%بê0â¿x V…Vâ¿SÍB/xâ¿éÿЕâ¿÷Û´ôO¯â¿RÛ»•Äâ¿¡‹6ÛÕâ¿–7Øï&ââ¿Ræ»éPêâ¿Ì÷Ñcíâ¿ÐœA\˜ùÒ¿Î’Ö£Ó¿®”÷0QÔ¿+Ò^&ÃÕ¿áÿÏ#²Õ¿Eæ‘ØèdÖ¿{ ª«¦׿çÕtðÌ׿u}rgXØ¿5‰¬p5Ù¿–2ö³ÈèÙ¿8û•§óšÚ¿Lȯ‚KÛ¿€jÍRúÛ¿<¶1¦Ü¿ ’ OGOÝ¿fæ‰e,õÝ¿æ)`—Þ¿TF–}5ß¿:ªÇ>"Ïß¿ì~ÆG÷1࿜•Ãyà¿J…‰Ⱦà¿pzòÐÛ῎©GñÕ?á¿e:Y†{á¿b7Fè³á¿‰wèÕ¼èá¿jsûñâ¿~ŒªâjGâ¿P‹7Nqâ¿O=AËÔ–â¿ ’§©™¸â¿-ú GKÖâ¿äö'Óïâ¿4thïã¿ôHÀÛã¿„o¼ª"ã¿.¡‡Ò*㿳\àò-ã¿Èø ÃcÓ¿JðqÔ¿‰n=„1¼Ô¿^è¼”/lÕ¿‰àèÖ¿à<Õ%:ÑÖ¿x˜n…׿ ®//:Ø¿fÎïØ¿˜Ý¡Ÿ£Ù¿r’äoWÚ¿Kf.Þ Û¿Ÿ3”»Û¿ EçrjÜ¿ÂîòÝ¿ö¨ø;BÀÝ¿î#ÞÆœfÞ¿D9SE ß¿è|ÂÜÖ§ß¿¡žØ{÷ à¿TIN—kà¿n¥Ëû›³à¿f=îÜÙøà¿Æ÷œ8&;á¿= αXzá¿cˆ+8K¶á¿ìt[8Úîá¿JrÇä#â¿xj9½LUâ¿}Àì£ö‚â¿,/‹bɬâ¿åÁ‰­Òâ¿ÜyŒôâ¿ñúPã¿R'ã+ã¿&µL2Aã¿‘§,Rã¿=}Ã^ã¿fPÛ]èfã¿XúIj㿘¾’mÆÓ¿\2¼¾qÔ¿'’=Õ¿^½KÏÕ¿Ü“ ÌÓÖ¿x|ìÂt5׿”èI½ê׿7co?ŸØ¿ Éñ‹TÙ¿r¹‰ Ú¿)¿à_ǽڿ°¥ è×pÛ¿;dL"Ü¿å„/¶ÑÜ¿z£Ó§©~Ý¿®«]»(Þ¿öeÉëÏÞ¿ï*úó•rß¿Ò t4Éà¿ 1l V࿨¾ ÛÞ à¿îO¯Séà¿AÆ3hŠ.á¿ðj‘ qá¿DG„Vp°á¿?ôs•ìá¿äåþU%â¿ ŸX€Zâ¿=ÿ%Œâ¿â¶(ìù¹â¿ánæñãâ¿q²£Võ ã¿؈ í+ã¿ú1 ÃIã¿’³êbcã¿èú'ºxã¿)V³¾¸‰ã¿C”{qP–ã¿Í)6užã¿ ˆ¶&ª¡ã¿ôh?éM Ô¿ìØ—â­ËÔ¿MœS2zÕ¿Yo¬Î*Ö¿ÍDtH^ÝÖ¿0Es[‘׿ìV!ëWFØ¿’â¿!nÑH1Ï⿇¦¬^¹ã¿·ež³>ã¿Ä¼gÕþpã¿ ¶pò{Ÿã¿º OÊã¿—?çMšðã¿ü½ä¿6¬ˆï@1ä¿"ˆƒb0Kä¿3J8Ä`ä¿,kiìqä¿€Ôš›~ä¿üÔÊņä¿ÈÒ4Šä¿_²™ØÈ‡Õ¿ð'ñ5Z4Ö¿t6 ÝãÖ¿ƒ“C#À•׿¬w‘øŽIØ¿“YÍØþØ¿œ›Û,µÙ¿é|€XlÚ¿‡“]]0#Û¿RnþýÙÛ¿û$ƒÜ¿|`#¥ýDÝ¿¾ùéÓOøÝ¿ÕGöyš©Þ¿ ÈOBpXß¿¾‘ì®2à¿"sä‡Và¿îAZÅ©à¿BðL€sùà¿§ó&‹¥Gá¿Zí—Äi“á¿åõ‘‘Üá¿ì'úûï"â¿ÄV¤ÉYfâ¿阥¦â¿ÐÆÈô«ãâ¿—chGã¿ûöŽTSã¿ R²…㿆5žð@´ã¿âÙäÞã¿ñh%Œ€ä¿•½Èý'ä¿Úu#EFä¿6!B`俚axâuä¿hiVx‡ä¿\hΦʓ俺¬XË÷›ä¿Þ$-pŸä¿Y¡Žã¤Õ¿o\»‰PÖ¿IL ׿ 2u²×¿ØÄ$þüeØ¿P`Ö˜\Ù¿Ÿ ñÆÑÙ¿´šT„ˈڿvзˆù?Û¿r÷àöÛ¿áµ·u­Ü¿éäóKbÝ¿Óâ;üÞ¿¶t”áèÆÞ¿%†«—Ûuß¿z# ÷à¿-ûåc[eà¿W”æ·à¿ü‰ÂÖe´˜§Vá¿À c¯{¢á¿›wu³ëῦÔè!2â¿hYÁ›uâ¿fMÏ‘÷µâ¿ÊÍ…Ö óâ¿@¥J ¹,㿇ï|ÅÕbã¿W2m­B•ã¿&¿›àÃã¿8+”’îã¿ÂÒ¹Æ=ä¿èÅ+ˆÉ7俼%ÏAV俪ð×V*pä¿x!§þ×…ä¿Àœ —ä¿ÌjQØ£ä¿@dÏß ¬ä¿ÃÃï¯ä¿{ãž‹m¶Õ¿øI?cÖ¿D·¨Só׿ù)¡®þÄ׿Ý\mñxØ¿®)ø®].Ù¿Òý]¥ÔäÙ¿3\²qæ›Ú¿˜'†"SÛ¿09Ÿ  Ü¿BNöFVÀÜ¿ŸŠÖluÝ¿Xiì(Þ¿43HIeÚÞ¿<¸ k‰ß¿û”Ÿ¹Èà¿p3/7oà¿,RÆÞÌÁà¿ìGÔçVá¿ú©±£`á¿Lÿ ƒ¬á¿ìU£CÆõῦFUT@<â¿CxïÅâ¿\ªœ-Àâ¿ÓhÓOýâ¿Ig 7ã¿X²Ù/mã¿à…g쨟㿨§*SÎã¿Z¯M®ùã¿J­ËÉä¿g¸NcBä¿Ä¼ èÆ`俦/ ázä¿Ô–ækžä¿P‰í¡ä¿## Y½®ä¿líZ]ü¶ä¿òûL¤ºä¿RÎÒûÞ¾Õ¿ü¾FLlÖ¿^˜Än.׿„œ«DÎ׿zŸ»Ï8‚Ø¿Š˜Τ7Ù¿J`ÕúîÙ¿.I‚/¥Ú¿é¥€¥m\Û¿Ò‹ÉçfÜ¿ >xªÉÜ¿|AJ¼Æ~Ý¿KžF9M2Þ¿˜?³ÏÎãÞ¿:¹Þ’ß¿%IÍy‡à¿8à´ûsà¿F²Ñ¨—Æà¿9p(á¿2 Km|eá¿ÐÅñic±á¿T¨‚´®úá¿°Å:1Aâ¿ôu.¤¿„⿨X¤t0Åâ¿ìL¢\ã¿OÔô<ã¿›QŽ÷Orã¿G¡}Ӥ㿒œ§ˆÓã¿G|—·Rþã¿ÛK<%ä¿áú¾Gä¿  1fä¿X_‹<\€ä¿vYé-–ä¿•Ô«’§ä¿”yy´ä¿Èþ?ϼ俳H¯qÀä¿( ~J3¿Õ¿JàÉŠlÖ¿PK¯<׿…ú,>Î׿n$Ò%‚Ø¿Ðaއ7Ù¿h¬Z÷íÙ¿;/„¥Ú¿C#M>\Û¿ ŒÅº3Ü¿Œ>kîsÉÜ¿òlxŽ~Ý¿LPŸ2Þ¿´À¥”ãÞ¿ë>¤’ß¿5تøjà¿;, àsà¿zhÕ8}Æà¿N€•á¿9Í|‚eeá¿3ÈN±á¿ ”a±œúá¿$@Ü+"Aâ¿â½ã³„â¿°ÅZ[(Åâ¿t~; X㿸.x<ã¿þb DUrã¿þôyLÞ¤ã¿î—ˆ¹™Ó㿼™Tkþã¿2+ß98%ä¿'áéGä¿ðdŠÄifä¿Ç”¸¥€ä¿K½ Œ–ä¿^Æ‚( ¨ä¿†»Üáµä¿¿îÍ"ˆ½ä¿v€íÌJÁä¿ á®ø/·Õ¿ÜóàÖwcÖ¿ôa¤ð×׿Ãß×°­Ä׿êìõyxØ¿ú–±¾Ç-Ù¿ÜgSp&äÙ¿Œ]áM$›Ú¿Wº PRÛ¿:†q8 Ü¿„~ ‡l¿Ü¿ 3¹Ò{tÝ¿À$ã”ö'Þ¿çZªnÙÞ¿±òÁÌtˆß¿ôËkO࿺4+Ánà¿R×”%[Áà¿âçêá¿|'™ª>`Ὲ•×5&¬á¿5ÌÓrõá¿ÍÚAs÷;â¿wrƒÄˆâ¿[û]Pý¿â¿">•-ý⿊öt!ô6ã¿”ó­-mã¿€y3¹Ÿã¿¶U_ xÎã¿ÿoNùã¿ W¿x! ä¿EiómÛBä¿ðg–œgaä¿Þq´{ä¿©.ôÛ²‘ä¿Û'|äU£ä¿l“8Ò‘°ä¿Pdb2Z¹ä¿î‹]F½ä¿ÂbëÙ‰¤Õ¿§y=›ŠPÖ¿¶ˆ¬ÿÖ¿4€ ]U±×¿öà:èýdؿǎ=é,Ù¿ÄŽÒËnÐÙ¿X‹ˆQ‡Ú¿3þsŒc>Û¿ÌÒ†3õÛ¿¤Ä£wP«Ü¿ºtråI`Ý¿Ž¸ý°Þ¿¹'üTÅÞ¿ üZ, tß¿lbXà¿Þ¬ˆ`{dà¿mÕ¢·à¿¶™:˜á¿“f‰æUá¿¿” WÉ¡á¿êÞ–ïë῞¬@“1⿃Ðaô!u⿆└µâ¿¸¼©¡Ãòâ¿Xxg®‰,ã¿xCp~Ãbã¿£õÏ!P•ã¿­ÑlÄ㿆 Ø`êîã¿V+&ÉÂä¿€pùƒ8ä¿FMÈÅWä¿-2€wqä¿N-cŽ‡ä¿¢¦ÞOX™ä¿.ñ2Õ¦ä¿Üšs¼°ä¿€G¸º³ä¿’\û±2‡Õ¿ tȽ3Ö¿n¥{ôñâÖ¿à…’Z‡”׿–váHØ¿H6ñƒýØ¿&Ÿ^š;³Ù¿ÔìÒüiÚ¿dâÕì Û¿T/âß›×Û¿ž˜™Ü¿ífÕÉsBÝ¿ 9¯K¼õÝ¿’X}ó§Þ¿(Þ3[ÝUß¿O2Qîà¿F#ÚKUà¿ÞWã¿j)Æ÷qã¿Ãz¿¿Ÿã¿lÙ é‘Êã¿j7=‰eñã¿®@µÖ$俯|O¥½2ä¿Ò…o%"Mä¿Ð£×¿JCÑô´ñ׿|Ê¿~b¦Ø¿·¾Ã!\Ù¿5¥Æ/‚Ú¿²ÎýÑÉڿ戜³eÛ¿XõU:5Ü¿¨!L<ˆéÜ¿ª5FyœÝ¿˜1àkMÞ¿EÑòûÞ¿Åwc¢§ß¿M ~R(à¿}ˆÖjzà¿mh§ìÅÊà¿u+¶èá¿ä¶¢ý dá¿0Ï &­á¿Üü,xôá¿nP¨Š7â¿çU–DÝwâ¿TŒÑî´â¿¾+­æ™îâ¿, hK»$㿺j2Wã¿¿V|Éß…ã¿\逨°ã¿ÛÉs×㿸̦b)úã¿DoЏä¿`v‰|3ä¿*0Ç)Iä¿ÅìÒ[ýZä¿Ù¬ דhä¿“‡x2rä¿S/õþ7vä¿FÉ…ÇÛùÔ¿è3GÁð¥Õ¿†²+3‘TÖ¿ŒÞçŽ׿\;}¸×¿6§ìlØ¿YåaÒm"Ù¿cÝÒØÙ¿†¯ HåŽÚ¿à¹r¥úDÛ¿GgÎ`úÛ¿‰¡åÖ¦®Ü¿ûÚ\^aݿ©˻Þ¿hƒXÚhÀÞ¿ÉjKãkß¿<.Ú ࿼dX\à¿iÓg›¬à¿$]ý_¦úà¿JåÖ,IFá¿ïò+Uá¿X…yYÕá¿ D{löâ¿}mTó6Yâ¿<`|o7–â¿Ü·æpÒÏâ¿›/±ä㿈ÿÞ.M8㿪¹4Iífã¿»R×ܨ‘ã¿q̾af¸ã¿˜Ü Û㿵?ßÝŽùã¿ßý>ÏÔ俪¤Ò)ä¿èøe|;ä¿ç¡ÒÅHä¿Lþ²w–Qä¿Ìs†U俾ßtÎo¸Ô¿94»GdÕ¿’™¾«Ö¿Ò6z‡gÃÖ¿¤¯¨v׿û=ì8*Ø¿öîù:rߨ¿8åwN•Ù¿Ä:Ó \KÚ¿i˜ÿ[,Û¿»=nM¶Û¿ÍÝ¿§ÿN‡N{Þ¿_‰¼±Š&ß¿ KëˆÎß¿4Å¿p9à¿ :i~—‰à¿ž<Í9‡×à¿Ò:7Ú#á¿Æ3Ælá¿ì3²á¿Î\LBuõῦ‚± 5â¿¤ÌØ Œr⿦¥G“¬â¿è°[`ââ¿ÕÅSjã¿´Ò~ùBã¿dÕ¤mã¿Úe;R”ã¿®ß{®é¶ã¿ÖýAÊVÕã¿.à§’†ïã¿(Ñhä¿ì1Šìê俼"Åü#ä¿ÄW8ƒ,ä¿ç ¹¢N0ä¿ÞâÚÙ6nÔ¿l{ ÍÕ¿-Q¯ëÕÇÕ¿„¡¶:xÖ¿ÞùÓ‘*׿Œ|¹êhÞ׿VçàR“Ø¿‚Ú£GßHÙ¿…ŠgžþÙ¿Àæ(´Ú¿Å|FoòhÛ¿0p¸H¨Ü¿à(Ç¿ÑÎÜ¿äaÞÑÝ¿Zžè³È,Þ¿Êãý¾×Þ¿‚çfwß¿ü)̈Æà¿V¾ëâÌaà¿<ô†W¯à¿ tÛûà¿6üÝÝCá¿è|jò‰á¿‘Æÿ?Íá¿Õ¬›î+ â¿^|ÚðÿIâ¿ëlCÄpƒâ¿ÚI:[¹â¿¯‹Àjëâ¿#D ã¿£÷3±Dã¿5lKkã¿… ´Ðã¿ËþUé(¬ã¿b@`CŠŒÕÝ¿v˜Á˜§Þ¿ Ñ·’'ß¿z[ÞÊß¿ îP5à¿ÿÔ©%þ‚à¿Ãò"¯FÎà¿òdçüá¿ôÍÅCñ\á¿PU-)ûŸá¿(È£Kðßá¿­ÙÏ$©â¿M”Ò+Vâ¿J3ŠêÑ‹â¿òŠ"ý½â¿}úþbìâ¿Öø{[åã¿},&k=ã¿Q]­Û_ã¿Óeå<~ã¿"#˜ã¿cýËöÓ­ã¿oR¢ü¿ã¿nåõË㿦(µ"EÔ㿎j]Æ÷×ã¿AH—Uy¿Ó¿4šMÌojÔ¿ÈÃÈ[ÁÕ¿5í*kÇÕ¿ˆ<yÖ¿¼ûõ#,׿ãxISà׿â¯t&%•Ø¿ÎgC•*JÙ¿%J¢óþÙ¿2²³Ú¿Gñ%fÛ¿ÅÅ­ŠÜ¿e©Åq ÇÜ¿"‘ÿq(tÝ¿.ûª»vÞ¿‚²ªÅÞ¿$&»<iß¿¤Ç®–;à¿ûî)¬ÁQà¿w?räœà¿ÚÈrtuåà¿<”ÛÒG+á¿$µt]0nῘ®®á¿ïé@ êá¿ÇAÝŠÚ#â¿´“ö ‘Yâ¿^F¡j¢‹â¿Fmï¹â¿¹lå[äâ¿¡ÿžÊ ã¿æŸ~l%-ã¿WµÌUKã¿HÎDàDeã¿Âü Mâzã¿Æ®u Œã¿âì—â˜ã¿þÎo(¡ã¿>=oÚ¤ã¿l_AO[Ó¿¢â$èÔ¿D#'±à²Ô¿å|¹Î)bÕ¿€O ]Ö¿K¦ÏÆÖ¿&8]ŒÔy׿ÊRd<.Ø¿ö¥?Øâؿ¶Âó7—Ù¿/©gÓìJÚ¿˜(ÿ«‡ýÚ¿\.š®Û¿·¯¢ø¶]Ü¿˜½Úq Ý¿Îû»`´Ý¿Ø¥[Þ¿Þjkx4þÞ¿8CĶNß¿- ~à¿5xìÊûfà¿*ÝÑÞd¯à¿Ú[æèõà¿U¿ÅÔ7Ὺ‡wῨۂe´á¿=é1#íá¿2XÓ³"â¿Lg©Tâ¿ÐιœÛ‚â¿Y™Ük.­â¿]ÒÔ¤†Ó⿸¡ Ëõâ¿@r àæã¿1ÔúÃ-ã¿>îЊPCã¿`Õ’|Tã¿Jp:8aã¿3ñàyiã¿l6^›.mã¿ÂƒRW&ïÒ¿–ukf]™Ó¿dàèT×EÔ¿sB÷±¥ôÔ¿9K™d¥Õ¿RÓX5¤WÖ¿¤¬oêõ ׿Ihïê¾×¿ ¡‡+sØ¿[Âe'Ù¿c‚÷„FÚÙ¿„–†ÓqŒÚ¿¾nC=Û¿*‡=²ÆëÛ¿ZZ},˜Ü¿Vhl0AÝ¿è¸Ëïïçݿ藨ŠÞ¿ñ¯|lb)ß¿µJÒN»Ãß¿RxØ©,࿈Mzçtà¿qb$Îiºà¿"ý}Àý࿦³ ’<á¿.~"çxá¿Æ¢¶ ß±á¿ÒÜß¿.^Þ6à¿™¸-r{à¿# ã½à¿ŽK?Fýà¿Jˆñat9á¿«‚ÍHrá¿~Ð׸§á¿˜ó,TÙá¿ù Æ.L⿚ÉÄh1â¿4¾è-Wâ¿Cô^ì¦y⿊ïFÉ™—⿬O¸ØS±â¿ø»÷€ÃÆâ¿¾sPŠÙ×â¿¥(b?‰äâ¿«)6Êìâ¿ò^qùˆðâ¿~›`ŽÿÑ¿ïo&h¨Ò¿š}ϽêSÓ¿ß÷%¹¼Ô¿º9ÿ}±Ô¿.x­¿bÕ¿±FÓ²Ö¿)ÂsàÈÖ¿›ËŒ 3{׿&pwš$.Ø¿¨lnàØ¿DÕŽ-¡‘Ù¿¶„–PAÚ¿êÃÖ«ïÚ¿L²ÛsšÛ¿þÞò¡CÜ¿Ûá7€èÜ¿Œ&f[ŠÝ¿†ñ û=(Þ¿à[0ÆÁÞ¿l—eç”Vß¿ÎCãMæß¿$Ô€L8à¿(¾¶Žzà¿U SìŹ࿺ÒïRÊõ࿪„Œv.á¿Cñ?§cá¿TCµ+;•á¿îÈ]6Ãá¿V¸©|íá¿„¼`]â¿»º1ƒ5â¿%`íüR⿊\¿ø¥l⿦4Þ¿ÐYuÈÉÞ¿4ˆ\§SXß¿ê{ôí6âß¿dÖEþ,3à¿W»,Z5rà¿–¶?T ®à¿.ææà¿Äm™á¿´IeMá¿%U)­¾zá¿£#Ÿ¤á¿›©rLÊá¿´kwìá¿Ô7‚@ â¿–DŠnØ#â¿Ì…‘æ-9â¿L ‘2Jâ¿ÀòèµÚVâ¿€ zI_â¿U‡êbâ¿b« tPñп˜8ˆ&¬™Ñ¿‹ úhDÒ¿Z]AÎðÒ¿÷¿qŸÓ¿x±<²“OÔ¿ !ž«ÆÕ¿ûñ+²Õ¿J5Íb©dÖ¿0¢a}׿ž¥ R«Ç׿ŠŒ¼ÅwØ¿ã€ËÊ_&Ù¿ÈÙ}Š ÓÙ¿l€Ò/d}Ú¿`>Wú$Û¿4«qFhÉÛ¿TxV,HjܿŲà_6Ý¿ŠŒ‘ÑŸÝ¿N{C»3޿Ъ›‹—ÂÞ¿ö7^Ä L߿އÈÏß¿ È öº&à¿Pí¨Þcbà¿$8íѹšà¿^.ꪙÏà¿Oþg_âΌñu.á¿nE(5Xá¿«8P~῱¥W™ÖŸá¿(ÁX{Š½á¿­_&ä×á¿‘Ž#DYìá¿|æ ›Uýá¿'#Šú â¿îµžƒAâ¿bþ‰vâ¿ÂŒÞ°ë_п {˜»Ñ¿FX…Å¥±Ñ¿ê Î]Ò¿N¸IÙ Ó¿”(êD`»Ó¿]7€÷kÔ¿ty(2Õ¿^ãÝ¢ÎÕ¿ÌÌÜÖ¿ÿAúHp0׿¬Ô€mòß׿vÀ—öØ¿¦€k:Ù¿Èû¹5ÔãÙ¿Bß–PÛŠÚ¿¸$þR½.Û¿fÜ>ºÏÛ¿&.Å(~kÜ¿®ÉŒ£˜Ý¿;|)ΗݿÖf?%j%Þ¿TbD7m®Þ¿+ícÛ¹1ß¿yƒ^fþ®ß¿s=žnöà¿:¿Õ’Kà¿dî™Ñà¿àÑÜšñ°à¿H.¢Ý^Þà¿6Lÿíü῞nš¬±-á¿ê¤^eOá¿ýP]»má¿èbùv†á¿QÆÄر›á¿M–­¥¬á¿GÏÔeG¹á¿ofçÁá¿ý+´ÜiÅá¿U×/‘Ï¿ÊVµ¥‰oп^÷ŽWÁÑ¿ÊÒ× <ÄÑ¿ŸáŒ¢qÒ¿Ô¨SÝ… Ó¿Ü#'[yÐÓ¿–… IÔ¿ðÝ1Õ¿ï½}+tâÕ¿!FÌÜf’Ö¿¡îì÷HA׿ÔÙŽ`®î׿¸ bÚ+šØ¿E‹ KWCÙ¿Ø}ûÇéÙ¿„ÁƒØÚ¿Ì~f²Þ,Û¿| Š{¼ÈÛ¿ƒÈ…O`Ü¿kž9óÜ¿¡j'éÝ¿’GRØ© ޿Ŧþ¤‚ŒÞ¿ äX ß¿”]ÚÞß¿ }®¬Êïß¿; Ik,à¿wG`]à¿Þg¦Šà¿fsภ´à¿Wn…µÙà¿ÚÓyKMûà¿ÄÊDÓá¿®rv042á¿ý’|á`Gá¿,D¿KXá¿V É êdῚcJ6má¿°]_`qá¿°ñçMgTοÚý¹´¡Ï¿¦´¢ú‚yп©ƒ…b$Ñ¿í É+!ÑÑ¿ô&pZÒ¿Ð#hU¢.Ó¿ô­ìÖÞÓ¿šõ°ŽÔ¿°AAœ>Õ¿(·»åíÕ¿>`Ë* œÖ¿ÔuuØßH׿ƒê¹ó׿¹%¥DœØ¿<ƒ±¯BÙ¿^%?QÌäÙ¿Ú¡g±ýƒÚ¿ ËIÛ¿¾O=$N¶Û¿.eίHÜ¿(vöÖÜ¿VMã^ݿȪ@9{àÝ¿-?2ÐÝ\Þ¿=x.öÒ޿ε»zBß¿díþñ%«ß¿¤/ŸF[à¿RïTÜw3à¿Þƒ Ì\à¿SnMÍ?‚࿺è%º£à¿Zúä&Áà¿®sŠÖsÚà¿îvse‘ïà¿È¯ü”rá¿Ø*æÿ ῤoàj[á¿Y0(hCá¿äc¶d* Í¿…DÚ'=YοKŒ©Ï¿VÛñ¥~пG}Wå°*Ñ¿]fî6ØÑ¿å‰ß̆ҿ…fåŽ6Ó¿Å–tåÓ¿2h²K®”Ô¿PV–ÿFCÕ¿âž‘CÒðÕ¿ íÜÈäœÖ¿¤älG׿ËYèöî׿9ß±4%”Ø¿¹¡‘§86Ù¿¶ñ_ÄÌÔÙ¿Ìd*oÚ¿$PAÐïÛ¿â¿FCÁ—Û¿9ÈÞ˜$Ü¿ë¦(¬Ü¿–1†aÿ-Ý¿ü·^ é©Ý¿r–ÜÊŽÞ¿ ×L§ŽÞ¿Ž›“MíöÞ¿RPÏXß¿w‰I²ß¿öåk.à¿Ñx:3~'à¿÷“¥×¿ÆóµØ=Ø¿í†gÒØ¿„ATfbÙ¿Ô™E|íÙ¿Fj ÕRsÚ¿Å%K–óÚ¿PP’ömÛ¿.ü4'âÛ¿ZÎ%“ßOÜ¿LâÛ¶Ü¿*±¶sÙÝ¿¢ÂŸÎžoÝ¿ð\< ôÀÝ¿d”›ý¦ Þ¿ªtM¹ŠLÞ¿–…[Îw†Þ¿R1y•L¸Þ¿¹é×míáÞ¿ªâDß¿ú5â”Cß¿,Vñå,ß¿æ " õ4ß¿,¤qS‰Ç¿2gÓdßÏÈ¿*ÓÔÚ¸Ê¿Ž‰E¢êgË¿ÙQÆ·ã¹Ì¿ŠNlbÊο…·ÿdÊeÏ¿ÝÜIä_пåÆdc Ñ¿úøôŒ·Ñ¿IœÉcÒ¿¼òY Ÿ Ó¿"äaµ¶Ó¿[E"ó]Ô¿[ÙŽ¸ðÕ¿“¨ßG¥Õ¿‰àã“DÖ¿ÛaàqàÖ¿6žžú€x׿ŒÔC¡b Ø¿Q¯ïú›Ø¿5äS0&Ù¿–“X l«Ù¿ÝݿƙT+€Ý¿Œhoѹݿ¢!@hëÝ¿šûŠ$ÕÞ¿d3N6Þ¿¬ÞäèNÞ¿’˜ è‚_Þ¿$Þ‘*ŸgÞ¿B-enÆ¿õ³ÁœoWÇ¿è^æØåŸÈ¿ÁÃÍìÉ¿ Q½Õå<Ë¿ëBrù Ì¿z=(såÍ¿8ZÆ7 <Ï¿<Á~e‰IпÁõ½‰Üôп⹯”ŸÑ¿ç)KHIÒ¿Þ£ncŽñÒ¿&A;Íþ—Ó¿àÚrm2<Ô¿”wÃÝÔ¿@œ ¬M|Õ¿tt£•nÖ¿^¥ÆÅ®Ö¿h õA׿¸êÿÆ Ð׿è‚íoZØ¿ï~Cw ߨ¿„z#^Ù¿9æ‚fe×Ù¿®k%8†JÚ¿ýôM®=·Ú¿ð¥~GÛ¿`âŒc|Û¿*Td VÔÛ¿¡DË,è$Ü¿¶Ay“çmÜ¿@EX'¯Ü¿b¹Ý€èÜ¿¿«×ÒÝ¿ÌZ“CÝ¿UðdÝ¿YO–.Á|Ý¿ì­ÇKIÝ¿ugýbl•Ý¿fúÌÝ:•Ä¿.A£ƒ²ØÅ¿Iê6ƒAÇ¿Êd¹jÈ¿\T»È®¸É¿Eº. Ë¿þÚ¾ÜÄ]Ì¿:£$ÛŸ²Í¿†!íÏ¿2ÓÚ÷l.пqmœÑIØÐ¿Î†½$Ñ¿Âí²]“(Ò¿2çWò/ÎÒ¿Lv'=“qÓ¿ƒGÛíWÔ¿7SI=°Ô¿ªƒ[*xJÕ¿*ÈþµáÕ¿0Ôé‰sֿЃ׿N!§Š×¿"+…&ŸØ¿!$¥èØ¿MuTøÄÙ¿vâò‡WxÙ¿ð–}ˆäÙ¿ˆý>¥JÚ¿BÈ7丨ڿñ¼o<Û¿Ú! gPÛ¿dÜK™Û¿˜GóíÙÛ¿RW¨óÜ¿­&Ž&ùCÜ¿ .ËãlÜ¿ *賢ܿàÛE†/¦Ü¿\‹2 –¶Ü¿Òºj¿´¾Ü¿“Á£öÿ’´çRÄ¿¥Ä+ƒþ—Å¿è¼é5áÆ¿v3WŒ .È¿ú"ýÝÆ}É¿Ó?·K”ÏÊ¿&è«å¥"Ì¿žt‡„*vÍ¿é+®‹PÉο‚ÊC:£ пð¨µÐ¿ $'£/\Ñ¿¦b‹ òÒ¿ ?ÂÆ~£Ò¿ý3qCÓ¿Ô†„eàÓ¿jþ³úyÔ¿EFÑÕ¿SÔ¼/‹¡Õ¿mEÎ.Ö¿e  B·Ö¿˜ù|!‘:׿‚ˆí8i¸×¿ãÒ!E{0ؿ匙­{¢Ø¿ÏŸ½|"Ù¿¾e Ž+sÙ¿œÀ,¼VÑÙ¿P-µh(Ú¿Ð}«ø'xÚ¿Ö›ƒcÀÚ¿¸è”·ìÛ¿rxá ›9Û¿ÅÂ~3LjÛ¿É!ª^å’Û¿"(zU³Û¿Jé$ŘËÛ¿ݱÃÛÛ¿ {@ÉãÛ¿AÕ²hXˆÁ¿øÄ†ˆÈ¿™Šð¢˜ Ä¿*¥´ÞRÅ¿|R;¬ÞÆ¿˜ïÆ,ÂëÇ¿A;6¹;É¿wc;ôŒÊ¿ÁöT£ÞË¿oèžTõ/Í¿ÂK‰€Î¿Ç<ÇçBÎÏ¿ywÚόп;œ¯â±0Ñ¿DŒ°ýaÒÑ¿ò.á{qÒ¿|CËÜ Ó¿Hg"šc¦Ó¿–ÕyPq;Ô¿W¡ÊiÌÔ¿$‡£>ðXÕ¿A¬~%¯àÕ¿´Õ@µPcÖ¿°<´ð‚àÖ¿3Ò÷W׿ºÝ±·aÉ׿°Æ{4Ø¿’v ÿ˜Ø¿¸ÿUi­öØ¿4„ÿIMÙ¿¬'‚ÅœœÙ¿Ç†P räÙ¿Èøªš$Ú¿bÓ^Zì\Ú¿h€åNBÚ¿wÌfm~µÚ¿ ¿¢û‹ÕÚ¿I<»²eíÚ¿TE¶o(ýÚ¿7ß-&ðÛ¿ôÏ€þ–ô¿¿ê<Õºº8Á¿ÖfÈ_?z¿”º£ßͿÿLXe³õÅ¿ð¢ÝøTÆ¿¿·… £Ç¿ëŽ…¼dòÈ¿Îï‹1BÊ¿»Ž‚Æ¢‘Ë¿.ï&¨êßÌ¿4ðü:,οÙ:gÃuÏ¿4ô^QÝ]пnp€ßªþпªpUæœÑ¿×N¾G.8Ò¿û˜T!ÐÒ¿:¤ù,adÓ¿tû f‘ôÓ¿ÛÆOøW€Ô¿†Äu]Õ¿*ì‡9M‰Õ¿â-f ÕÖ¿Â*œ/¨|Ö¿ ÙÃyíÖ¿Âè¸X׿Ð| ÿ»×¿vEis.Ø¿jqŒToØ¿þ¨sÓ8¾Ø¿'¼Ï»¦Ù¿l.ίmEٿͧia}Ù¿¡CŠ@X­Ù¿95ì.ÕÙ¿hf\AÆôÙ¿“âD Ú¿üùV¥Ú¿ñ*Æ\"Ú¿g°uOÇÒ¼¿²!Ay2L¿¿Tˆ,kyåÀ¿ùnÏü(¿.Џ2pÿj#À´FºÄ¿öò¤kÆ¿n»1ÐÒSÇ¿ÂU°¡È¿¨ÕÖ4ïÉ¿‡¾“;Ë¿^ОWý…Ì¿êÒ9§ÍÍ¿Îyû×ÅÏ¿ ¨Þ(È(пôû-! ÆÐ¿ta‰`Ñ¿}··£÷Ñ¿þöú‹Ò¿´¿©ÚsÓ¿:ŠÀ$u¥Ó¿vL-Ú¼+Ô¿;KÀö¬Ô¿XAŸÑ(Õ¿´Ô{%ÿžÕ¿Œþã¢4Ö¿|±Íš*yÖ¿l†+ÜÖ¿*¨gL9׿y*ÌúŽ×¿¬.–jpÝ׿Åmݤw$Ø¿D,a‹ÞcؿÆv›Ø¿Cp2‚ËØ¿ÕJ@c„òØ¿¸¥)ŸÙ¿—ت"(Ù¿ºØº5Ù¿Ò'BC<Ù¿–$³¬¨©¹¿m$_–_¼¿n‰}éâš¾¿©¯D&À¿‡·†‡kÔÁ¿¦>7e†ÿÉ®"¯fÄ¿nã5¬²Å¿zÚ¯üýÆ¿óÁA\ˆIÈ¿U¥Gðð“É¿5L 2jÜÊ¿»¾òî("Ì¿ƒªcvcdÍ¿þR¢Î¿C)úˆ/ÛÏ¿ÁJÁ‡Ð¿N ÷‡XÑ¿_ƒŠí¯Ñ¿b [€>Ò¿BX%æ·ÈÒ¿mæ“¢=NÓ¿®ÎŽÎÓ¿sGánçIÔ¿ùÖÙl¿Ô¿þÊ{/Õ¿®Ú0d˜Õ¿8äGNKûÕ¿öoi¸xWÖ¿ÚÌF毬ֿÚSBÒ·úÖ¿ÐÌZA׿Ž'f€×¿Yb‚@©·×¿tÆÂôæ×¿«ªÄØ¿Ñ_ÊÛ,Ø¿ºU}ÿüBؿݯM"(PØ¿·•¾©WØ¿¦ŽÃæU~¶¿^º“l𸿄hèkg»¿r>zˆŒæ½¿IçüS6À¿Râ Ë”|Á¿D ‘µÄ¿֕kÚÄ¿ZN"±óWÅ¿‹ !wz¡Æ¿t¬ü­áéÇ¿…Ó_^0É¿Ì瘖&tÊ¿(ø Þq´Ë¿Ü¶éµyðÌ¿÷Tê z'ο¹ôh»±XÏ¿èáv±Aп6¾ ÐiÓп²w'aÑ¿ÎÔ¼€êÑ¿úçd:PoÒ¿R+/ÝïÒ¿Öuû‡iÓ¿ÎïË8bÞÓ¿æœÍpWMÔ¿¸RœØ ¶Ô¿]{Õ¿+¦0a&tÕ¿¿¬fæÈÕ¿iX‚Ö¿è¼÷­Ä\Ö¿Ž MÈz›Ö¿YHtCtÒÖ¿DæÙÊ׿Ž1 ?s(׿ ïƒG׿’žù3]׿h=O¿j׿¼§s׿H0ëO³¿á–š6½µ¿y–µSÖ0¸¿ºéo®-¬º¿o¿ø«“.½¿K 6™¶¿¿6c}ìY!Á¿z{rƒ©h¿Vÿ}™q°Ã¿b&ä÷ç÷Ä¿)‰ênB>Æ¿~”¾R·‚Ç¿×Jjö}ÄÈ¿ÖÙ%ÏÊ¿hОå<Ë¿6|wˆþqÌ¿Éo3éY¡Í¿ÊQ;ÊοþÀ79éëÏ¿¨²ÎÊׂпм/o Ñ¿Bá.ßdÑ¿&ã`ifÒ¿ƒŒñ¹#ˆÒ¿ CâêOüÒ¿v~gJ¡jÓ¿qv}ÑÒÓ¿Ø#1œ4Ô¿úMGFÆÔ¿}zw¬äÔ¿øðŠA1Õ¿´j('wÕ¿³ _˜ŽµÕ¿ÇYIìÕ¿ûwð*Ö¿f¹«BÖ¿ð”ög°`Ö¿ŒÙ4òvÖ¿]m{¤{„Ö¿Zá_Þ Ö¿êUâ‹!°¿— f‹²¿ÕŒCHú´¿Ä^&q·¿`Í4ÌIﹿŽU[`s¼¿ptïú¾¿ <Åï§ÂÀ¿3š þQ¿¾sôƬMÿbn(oï‘Ä¿îæœQÔſ뉿ñ Ç¿ŒTæƒXPÈ¿ˆp~VsˆÉ¿Ñ£•К»Ê¿ ia2éË¿ê¨gÍ¿Žf3œú/ο4Õ1bHÏ¿äV&2Ã+пù‹eTë®Ð¿uÕxJ(-Ñ¿•a¥*¦Ñ¿–Œ¦Ò¿"Fž*Q‡Ò¿¿ÇTJæîÒ¿ýœÔþ"PÓ¿Ô‚fzȪӿ–›þÓ¿¨LTàdKÔ¿ÔçÚ›ðÔ¿\îá¿ÏÔ¿ "Mí’Õ¿Z´ÚnT4Õ¿´ˆ‹Z.[Õ¿½RýüÿyÕ¿ÚƒêË­Õ¿nÊã +ŸÕ¿Ä„Ù©§Õ¿¦”çÎä©¿®ãå.±®¿ÒÒŸúñ¿ ÎËÚä6´¿H®;›Ë°¶¿ŽqÔÑE0¹¿ÏL.ýγ»¿•ã`ªÛ9¾¿§ ïn`À¿|_K££Á¿JG€lÃå¿?ÁÎNU¨¿|îÚd)"­¿œ á™Xÿ°¿h«w)Ñt³¿ˆ® ãﵿ‰¾,žo¸¿€!N¬¥ðº¿ K²Å@s½¿E©@©Gõ¿¿üC—:Á¿ ùJr´x¿Ö Q7´Ã¿‹AÏm\ìÄ¿˜k?kb Æ¿ ã%HŠOÇ¿a˜ÅÐyÈ¿`ߺRœÉ¿Kȃ¸Ê¿}ïqÎûÌË¿w[^ˆ ÙÌ¿¸#(IÜÍ¿ôEt¸dÕοn/Û2kÄÏ¿ÖuGTп Á?·žÀпhàMÒ÷&Ñ¿³B<‡Ñ¿›—¾­àÑ¿“3Ò¿ª}:ŒÒ¿fÒgÄÒ¿ :yùÓ¿—õï8Ó¿ g§Q¢fÓ¿\’^|Ó¿¯cãE“¬Ó¿Ü²S½ÞÃÓ¿÷ÝmÓÓ¿Z7ÀG±ÜÓ¿‰¿§ÕWƒš¿®³˜Ùý¡¿€˜QEzæ¿@,RaË—«¿® az÷<°¿N~þº³²¿–€e·2.µ¿]䢧W«·¿b%Ä6w)º¿F¦§¼¿£;t¨€"¿¿škAX,ÍÀ¿â¦wÄ„¿Üd\¸‡<ÿÐ3unÄ¿öb‰›Å¿|ƒ×ÃÆ¿0$…vbäÇ¿QFñOÏ¿ËÝE¤½«Ï¿÷ê©»øÏ¿:[Zò`п}€Ù2пÜÿðÜÅBп°ÏmèzLп¨˜lÝݱ–?¹/;,þŠ?²1*Uðp?O‡l1‹t¿öŸ,}9¿q°¼¾q,˜¿1IÊa æ ¿PëË躥¿˜¢çÑ‘ª¿å´IÍg¯¿±é®ï²¿zwÖ#‡‚´¿¢(žä1ã¶¿1@™Šw=¹¿0`S㻿ºóLÙ½¿2¨Yî¸ À¿€3«â$Á¿\ž,Q7¿U»ŒtYBÿ©ñž“UEÄ¿BJ×û£?Å¿Ü o¨0Æ¿TFÌÇ¿ˆx…Ó~ôÇ¿ ú4Á5ÆÈ¿ã8XrmŒÉ¿~ôa©FÊ¿"H܃tôÊ¿—Yr§a•Ë¿\ÁYÝ )Ì¿ ¡“à¯Ì¿JH‚/'Ϳ ‘Í¿ÂRÒÝlìÍ¿‰ú:Q9οpÀUïvοCêÔúĥο^“~ΓÅο¸ýÂóØÎ¿×Ìò”¾G¡? WA/n™?.æÑKuA?×c*Ü{?LX• A{c¿Ê˽ôkׇ¿_N®ñöw•¿þ „ýHŸ¿k:abT¤¿ÿ1·‘¿ ©¿øž*]Fé­¿»®YcU±¿[@£2‚±³¿a]0¶¿[ FU¸¿(¿*RЙº¿¦ÿ5MíÓ¼¿"ÏFˆ¿¿(‚¸l‘À¿äŒg³}šÁ¿°mE•›Â¿6 íE”ÿ2m°¶\ƒÄ¿˜Q¯%ÜhÅ¿2v DÆ¿?³¤1EÇ¿ûñ­#ÙÇ¿—=Áì’È¿k@øÊÇ>É¿Z|0®ÞÉ¿ž½ÐnqÊ¿»öÛ­öÊ¿ëÄ\nË¿ÊëÒd×Ë¿–z?5R2Ì¿o !ɪ~Ì¿pG¸¡A¼Ì¿vsñóêÌ¿Uã"²· Í¿$µà0=Í¿±¶þ&µ§?ï8pT—˜¢?¥…‚”ýœ?óª*š¥Û’?~—›ƒ? øt¯Ê?d’¦Ö£±‚¿X,ÃÛ’¿ä9Vjbœ¿Z67Öó¢¿8&ñ6´²§¿ïò áj¬¿ò„󹌰¿¨´91Áݲ¿'¬÷é'µ¿p/OÇXg·¿|c¢³¹¿nÞÔúÆ»¿¸w*c§ã½¿;ÚìzÎñ¿¿ÆuøÀ¿Äy˜|¼îÁ¿(Ò…—EÜ¿š.²ˆÀÿ’±`ð¯™Ä¿ïù›¨zhÅ¿Rh ú+Æ¿û´³ãÆ¿d 4Ç¿d‰éb.È¿‚13üá¿È¿Õ-z[PDÉ¿um¥»É¿Ñöpè½#Ê¿¾Y\2~ʿޚŠ-ÊÊ¿ænË¿…çï 6Ë¿`8ŽäµUË¿@O‚D,iË¿´Õô)Õ¬?3…ý×W¨?j¿æ1ðÓ£?ÖäDº‚„ž?ÒT ƒ\E•?¡e^á‡?^AA^d?nÀÿÚ/Œ{¿ŒCeý(V¿vôrV»Ç™¿õ@ ‰÷˜¡¿,íÓyG¦¿Jƒ©Ù쪿ģÜP*…¯¿)êz“P²¿‡Üs¢ C´¿¯!%at¶¿*€Iø™¸¿³÷€œz²º¿€[›¼¼¿[÷I·¾¿é:óWPÀ¿ßm±<Á¿Ó@ÅXC¿ȿ˜®Aö¿âYמÃÿ<쓬…Ä¿3·:Ë<Å¿[’¬sæÅ¿Â-Þ@„Æ¿l~Á Ç¿%Òlº˜Ç¿¨irFºÈ¿@“ü$ÖvÈ¿0y¬¼ÌÐÈ¿x†pÍeÉ¿ôû‹;rYÉ¿ ›û(̇ɿ(˜ÜÒe§É¿L/‹†ûºÉ¿ÑؼæK7±?Ó¡Ø@Iú­?~‘6©?–³‚,®ö¤?Ì©÷kþ` ?NG2,—?e+Õ aŒ?&™PWs?t©–¡r%r¿ºÁ†*΋¿XÁ†=—¿s Ï ‚C ¿€üö°äÞ¤¿±ÞOn©¿Z7Ì5î­¿×4¯wD.±¿$†€&[³¿:¯#¶f|µ¿ËM6´·¿Ê’LÄ–¹¿RÆ9U»¿ýÃ_.s½¿ží!G¿¿háÚ„À¿|(ŠßiZÁ¿2¡7&¿<¢k£íæÂ¿$ ˜ÞœÃ¿#' Ô:EÄ¿hAjùôáÄ¿`YSdàqÅ¿t v¢ôÅ¿O›Ñ-çiÆ¿Ñ>KeÑÆ¿7ÌÄ Ú*Ç¿ýÇ/vÇ¿žÿiÛϲǿZÞRQøàÇ¿'ŒEvÈ¿zhjÖüÈ¿”.uð³?¦~ƒŸº±?oÝ̯?±¿ùˆª?ɺC%œü¥?N$Õ%Xf¡?§ÂwP™?ô8“ÇËI?ûMl&lû{?Ìþa0(Vb¿€0­Ô®‡¿í—U¸"Ô¿;pTØtæ¿"›ÛVÓx£¿=£Òï§¿Bàd•¬T¬¿ï“øR°¿”ÓÖi˜o²¿›ŽÃÓ¦´¿SÙñLœ¶¿<6á9t¸¿úÞkÖIVº¿ÕMÛd &¼¿lp)g使fNõ¨¿¿0b‚±‘À¿t ˜iPÁ¿ýý'ªB¿¹í¯¾6¬Â¿æ?¾ØÛGÿú”mÏÖÿ «Á§¶XÄ¿°¤ §>ÍÄ¿…Õ½4Å¿h†£Å¿þŒ´®Ú×Å¿ïÍùOÆ¿5©š£FBÆ¿ râ®aÆ¿$«þ”QuÆ¿À,d•˜¶?Ž›†?h´?ƒÑc k4²?™Ûe™ô¯?‚ïKÌ2s«?ŸË•"ç¦?ÆŒzÄ*S¢?§5Íy9t›?œ2Wž=’?~¥ÓÂk‚?€OV'#¿¶r½‡~‚¿õ6NF÷W’¿ÙLÚ§ÚO›¿ÐûY.¢¿-ö«bq¦¿HnáÒ³¸ª¿víÆXŸé®¿º6ù¿•€±¿Aúˆšg~³¿DÅ mµ¿HZøWGK·¿ä({!ù¹¿2¬<ÜÿѺ¿'Hx¼¿ÈéüÊ ¾¿loŠ…¿¿µ«„rMuÀ¿Òžâ@ Á¿Ö³1›¶Á¿Zk•D¿V6a9a°?Ýûy¯@¬?`Ú‚‰·§?Ê‹¬;:(£? ‘ÊP.? s¡_A ”? N ²Úå…?Ìí±{O^?/ä&J\|¿Š÷t;îö¿â€4Þߘ¿Z þè³ ¿ø’ihÀž?|úÖ)÷¹•? ©d1€‰?Ôô¦¿n?“]êOÁãs¿ûM`HDZ‹¿F,xI>?–¿"øøø©ž¿§ÒŸ· t£¿¢ïGz§¿¡(§-e«¿~˜rR2¯¿¸¬ê­o±¿ÌK5³¿ì~û è´¿:Z‚s¹‡¶¿`Ž ¸¿põû ‰¹¿§_NÍ躿ÿÙo;r1¼¿´Í]J*b½¿É4™2z¾¿? cÖx¿¿# ³·.À¿6+¾'³“À¿WB5šëÀ¿ƒ¯4Á¿DüÎ?pÁ¿í± Á¿ZãU¼¼Á¿,YÆ=cÐÁ¿>@èhü¾?ê¼üá&ð»?AÝQ‚Û̹?“â…¢·?)A·³^qµ?Æ‚îÌÜ:³?u_Gd±?K7b^°†­?í‘ÚÙ9 ©?¾9Ï0/ޤ?¬!ãY ?OeŒE—?yÿÖ¼˜áŒ?¤W@å1Îv?¯Èˆ‡¬jg¿~_RçÙ†¿ÊÓ §¾Ä“¿ xJRÞð›¿=^f‘ëõ¡¿âN_È]Ø¥¿ÖÃë‡_©¿Ž…îTœB­¿$î_éb°¿˜û\Ëj²¿æêQƒÆ®³¿~‚Õû6µ¿Özζ¿¦àz+¸¿i]´`M¹¿&Çóæ{º¿¼XÁ¨ù‘»¿öõÐçæŽ¼¿â7­[r½¿ þÖÂ:¾¿‚{6ò辿ë` £ôz¿¿"«‡ñ¿¿dÀRH÷%À¿°yfEÀ¿&×é*ÃXÀ¿pSY  2À?»Ï¢N»H¾?*쪬x)¼?„D0œº?HÐ6ÍØ·?ÚÎBµ¦µ?äA>©pq³?úP?9•9±?’OÜá ®?\Î$ºH©?'…ߨ ¥?ºhí· ?²°Ü£¯˜?rõËŽ?ãòuâ}?!Ë꥿qN¿mmfr‚¿4§X&8S‘¿ ž<™¿è#&Bx ¿Dc7Œ5¤¿„بñzÒ§¿']Âì6N«¿~Î3"¦®¿2± ì°¿húÑ^)q²¿àk9c[᳿QÍcÄ;µ¿7DŸé‰¶¿¤~Þ«·¿d4)Èÿ¿¸¿Zø ;»¹¿FÌ霺¿H=âpd»¿r«F'G¼¿:—ØK¿3Öü½¿åS°¶s½¿.Ö¯Iü°½¿×þ ayؽ¿J…q~Ža®? lGã%ý©?¨?¨âŠž¥?¹;v^tH¡?šå&á$û™?Hº‰‘?ÅIbûP‚?Ð-_© N?×lŠlEK|¿‚šun Õ¿f{d–¿Z ‚Lšö¿›ßlÑ¢¿ó•åK ¦¿D"­ÙÕU©¿X=“Ä'¬¿ZFR …¯¿ Zg4Í/±¿(*Ñ!‰‡²¿6_qàȳ¿Æ}¹§ó´¿å*%:¶¿¤Í3Êþ¶¿E}9ß·¿’²G’m¥¸¿h³1¸YQ¹¿,Ù>S⹿TaªèWº¿¤Yˆj¸±º¿ì‘7*Žïº¿âu%8G»¿S)¶[aÂ?"jOóWÁ?@:è[uMÀ?Á?Q(á¾?G@lP^¼?ŽŠ Gk7º?RÝiò‰ ¸?BIèÙ ßµ?òÆ®IN°³?JÀ´±?×5©®?®CdáºTª?€¸p몦?úãý®Ç¡? fh'Ð(›?˜3^YÚâ’?Èó01(……?—àgf?‘‰´*äs¿nþˆKu‰¿œênã“¿¿›‰<¥þš¿Âð€6ì ¿ž²UC¥5¤¿V¿Cj;Z§¿"jDØÑWª¿¨rò Ž,­¿ •m¬Ö¯¿£åSm@*±¿Òªl;R²¿ZÓ܈b³¿sá]>vZ´¿ÔcdÏ\9µ¿Hgn¡þµ¿¸W•´©¶¿|KH—:·¿¸V‰VD¯·¿<»¼à¸¿b½‚*©F¸¿Ôƒ6›dn¸¿AÃ’,eÃ?Û@ouu^Â?¢8.Ì3WÁ?DŸu$vLÀ?ÊLÍW˜|¾?ýläßZ¼?9§ã%5º?¨œk3Ë ¸?YB0ãµ?jo@D³¹³?z1û°‘±?Ž«ÔÞÙ®?«Î;xú–ª?<™Ðå_¦?¡ù¦Ï`6¢?ÍâfWö9œ?æ|*žr,”?ž€ÃL’ˆ?ÏñÊ™Sr?|ôZ!¶\g¿]¤Øsg„¿u¾žÞ?‘¿PÞrF ˜¿;â,ï6Žž¿á˜æðd¢¿&jÛ8\¥¿}˜Fó+¨¿·ÕìråϪ¿6Lk£åH­¿Õ-씯¿Û˭Եذ¿L¯xY ϱ¿LûP¢¬²¿÷$ñÞp³¿âÚvg/´¿Ò¯Gœ «´¿V@†õµ¿(#È‘zyµ¿ü™5YQ·µ¿¼mÔÿ[ßµ¿è+ È]Ä?¬âN<ÕYÃ? =ð7¯TÂ?DóaLÁ?MÍŠÅ@À?ÀàB¹îd¾?àð×MD¼??F5 !º?ˆV¿?‡ü·?+K  ص?Åt†/µ³?P4 •±?'/Þ­ò®?r#ýpáĪ?dîÍ«¥¦?~;ATR•¢?Êšh(ì/?'Þ,iö^•?ûÎy‹?Ëȵ.5y?¸„8¡#GM¿¹&m0~–¿`ÎLA¿®ì«³2•¿—õ?÷RE›¿€} ÞŸ“ ¿ gæ×®\£¿–H:Bü¥¿å†DÈPp¨¿¨<Ô¹·ª¿:`­,çЬ¿•Ëî{º®¿/=íÝ•9°¿Ü¢æàü°¿ÛŽO芦±¿^`N#6²¿òb,:Ϫ²¿Èàc³¿Ð_vØjB³¿Nž¤ØŸj³¿ò®æÇ=HÅ?L@«ÇFÄ?Žþd*øDÃ? )ˆ—h?Â?jª Y6Á?÷8v‘*À?³âu}9¾?À'ÿr@¼?NÞ¬Åû¹?™^ƒziÜ·?„ÏQƒ¾µ?çÌf£³?”“»å_Œ±?uz]uõ®?l‚§vߪ?FNCÙ¦?Ú™ÅOå¢?±î·¢ ž?3oF w{–?Péi ;Ž?\T§›©Ú?d¸lhå³P?Töðo1‚v¿™–è$Sˆ¿'u( 6)’¿ã¤Úîxþ—¿t¶Þ¨å„¿ä„§SŽ\¡¿r—iöË£¿¤¼(¦¿ò¤¸$¨¿áN ª¿®<3=¨Á«¿þó»cF­¿‹ÛÅÛ˜®¿jÉk·¯¿ùæ’RP°¿€NÍŸkª°¿`°H×è°¿]ÔmVš±¿ç1×Ë`'Æ?üʵìÊ(Å?ƒ™ŠÀ(Ä?ÊST€%Ã?®¼§ÛÂ?pMåR~Á?¦øX¥! À?õ[ÿóú½?È’BIpà»?)c (ƹ?%D²Z-­·?nbïQ—µ?ß­…³?ì—{Ox±?Ç~=bä®?Ÿ*BeÉçª?1Zä¨@ý¦?!Õ''£?ã n%£Ïž?ËÔプ?Óþ@Þl?‘_Eçî"ƒ?‚·¡Tž§g?3xz%k¿:§¶<ï‚¿ù¾ÌN]€Ž¿Ñ[ÜÀ五¿ì*âØp䙿kï²¹ž¿Þs@Ü›¡¿x…wÞ­£¿KL1‘‘¥¿8ˆºE§¿Ê$„g,ɨ¿©YÒÁª¿ˆC§ÎT9«¿~¼§Âµ#¬¿qF(¢ Ø¬¿0OüåôV­¿ð¯c)’©­¿GÊFøÆ?r)“-'üÅ?”²S2ÿÄ?°íø©rþÃ?DÐø0$úÂ?"—óÁ?˜¯ÆXêÀ?Ñf“«½¿¿?ßKAª½?Š€1®”»?àð`0Á€¹?î'ržo·?îi¢™‰bµ?ªß"€ÂZ³?NmÒ„Y±?¢Œz À®?":ÔíÞª?^ÍX- §?HÇ]?©[£?á`͇|Ÿ?¤ÑÜ¿¦v˜?“0Ž‘O«‘?;Ó:<†?­Ls?RÔN\$S¿` ºb¸{¿Î‚M:ºˆ¿šžöZé{‘¿;û0G–¿Æ• îJ½š¿ ºŠ(HÚž¿$æoGN¡¿”w¯i&£¿Œ•Æ«]‚¤¿T¥–Ó¥¿®f#²¯ò¦¿\qÞ§¿Ë–Ó÷n•¨¿Œ]™%©¿?7°[k©¿XÕ6è½Ç?ÿáN|ÄÆ?IW7(ÉÅ?*³Ý¿FÊÄ?–@¶ÖÈÃ?Š]‚EBÃÂ?RIþ7‰¼Á?çv­¡´À?ŒÛ¦nX¿?Ôû¡7ãG½?Æý¯~å8»?zGÒD¸,¹?ÄRÛ–$·?àÖœ¼!µ? jè5]%³?Ð]"*¬0±?µEöÚ§‰®?ô?öûŪ?[²2ñ‘§?t„Œ2£ƒ£? ‘°¬O  ?À(9ýbW™?˜BQ‹Ù’?’óÉ:‰?ˆCÀ•z?Ò3¥rÍN?éMcú²q¿„ þ¢¬ƒ¿Õ2å…Œ¿‰ \@°’¿;Í^–=Æ–¿ßûÌ)|‚š¿œ;zÚâ¿€Íu%œr ¿îŸÖ<Ôá¿ÞÀH7䢿“3± Ò£¿ϦhŒ¤¿8Žä^¥¿ /¦¾òi¥¿Š»;ÀÎtÈ?CO?˜~Ç?ƒq©œ’…Æ?6x UÛˆÅ?Ž*¤”ˆÄ?ö\oÉ…Ã?î}ÿÌ9Â?T[hË›{Á?ü¨–juÀ?1E´jß¾?VlÌSÕ¼?j«‡°κ?¬:Yéʸ?&œDËý̶?Î@PzÕ´?jÅÀ™å²?𦨠uþ°?”z•|B®?Ó¥Úžžª?¤ùЧ?†iÜŸ£?ù”ÕiUJ ?äï,&š?¤§]›Oø“?ГëŒ?]]¼Ø€?–@ÓK¨h?Ò+µwB_¿â@*"}²z¿vÌÌ"†¿€r$é¸@Ž¿+¨›dúÖ’¿™í)·–3–¿áùÒ4™¿¼pZ×›¿ 38Áž¿ÎíÒÚlýŸ¿,ã(c ¾ ¿Hs.I¡¿°Yÿüí¨¡¿É¹«è"É?Ì&U»©/È?ž%%$>6Ç?1/MÂQ:Æ?ÂåǶr;Å?°{2Š:Ä?ys–i8Ã?ùˆ€I®4Â?R™Pí0Á?:¢.‹-À?òxÒU¾?ù( £S¼?1AÐMUº?ÒBc\¸?TÊY©i¶?¼ *"«~´?Wë’(œ²?–%È"¢Ã°?ðQ·*Ÿë­?9Ë€0Ghª?:[N “þ¦?<³XG±£?GÛ+™ ?Ý´ã;Oäš?Uç± •?Hƒè›TæŽ?Nx£’O„?òFï|¦t? oö»­>?›!ÜÚo¿¿§xHJ¤¿Ë|3Ñ23‡¿vð×%å¿Y@²ÛÇð‘¿`\OØ””¿j-%?Ü–¿]U6>±Ç˜¿¡!´0Uš¿RkfÊÛ‚›¿<3ˆäVœ¿%=…âŸÅÉ?[Ì{yÒÈ?ØûJ‡ØÇ?ëNrš#ÞÆ?’€ÆQ2àÅ?¾¨²{cáÄ?ŸXÕàÃ?ÄÄ´©ÖßÂ?ò¹r!ÞÁ?~ïæÒ}ÝÀ?ƒ—Øä º¿?ÒWh½½?T#œÜvû?CÖOJй?Ó!Þäá·?ı—÷ûµ?Èå®7¬´?úH€¿FvY«Å3†¿6Åg¶È~‹¿dÍöÎM ¿&}v½oþ‘¿¤,¡x“¿AtÁˆs딿uiP¦kÉ•¿ìÞ˜3DÊ?2­h¤EUÉ?Œ| 4jÈ?qzBÂorÇ?ÞAGø³uÆ?ÈaÍßxÅ?ÂÇ‹“dzÄ?®ã¤é{Ã?Ò;÷gÂ|Â?±Ñ‹Ó~~Á?±ñ‡1¦€À?…t#u ¿? eµ¿½?%v  &»?oâSÔÍ<¹?Ä’/½[·?8á²h‚µ?X;Ù@e³³?W§ëTî±?W,”¤5°?üŠˆ­?‡$‡#lÕ©?Ô‚Êà´¦?*¨4®°´£?šHB)Ô ?H&^ʳ.œ?Ûð•+Üú–?fE%t’?êùo¼òŠ?>/".¥a‚?ˆäljàt?a™ƒ^[Y?‘þ>Ÿ[¿³"Ãr¿Žû‹)JQ}¿åÖêà>ƒ¿¶“¨äá2‡¿_=»0fƒŠ¿\À“³-¿°¦À¿FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((248,84) (255,107) (0,0)) 5 @ÓDaøè¿nXÉ,è¿YœÔAè¿j´ ^Vè¿hï,V"dè¿p"ð©_pè¿rEÀzvè¿“N¸*zè¿Â DÏ Ìç¿u )>æç¿p3?ñrü翌è’Lkè¿f'_qè¿9†šo)è¿ÜhRéŸ0è¿QþVß4è¿B–ìhÅ‚ç¿@™Ð¶ý›ç¿…^ܼڱç¿*i¾?EÄç¿•e­ÂùÒ翦­'¯Þ翈â¥åç¿öºQðé翼¡'ÞÃ3ç¿&¦ëÌLç¿aÓÞ«abç¿ÔÉ\{tç¿P6·§ƒç¿R¿ó—Žç¿ªZMWƒ•翺çRÀ‡™ç¿´¯Ÿt-àæ¿&ü®åøæ¿f´¸)1ç¿—& ç¿Ì›øñ^.ç¿D=Oé79ç¿G.Í’@ç¿•{øßsDç¿Nºì‡æ¿ëÀÏÏa æ¿\t7 fµæ¿%óÜñùÆæ¿ˆ£q‘Õæ¿äWèÅßæ¿À‘,úææ¿ðë~™³êæ¿J°×S+æ¿6[ôiCæ¿$MXæ¿_Çmiæ¿ßmkiSw濇öð7Ïæ¿ªìj'Þˆæ¿Û1È´}Œæ¿„¹áUÊ忘ضâ忈#Îsöå¿tâ9÷yæ¿’™P–#æ¿ÐT‚næ¿LŸ¼4X&æ¿þ44AÝ)æ¿·3-eå¿$:½{|å¿ü)¨å¿Æó:¡å¿²Î5¥®å¿aIâ5¾¸å¿ÉVq·ƒ¿å¿{¹X¡óÂå¿’s×jÒûä¿Eð¾¸忛ʾ‡`&å¿#É6å¿} òC忆O.Û×Må¿-ÇËðxTå¿ÙMBÓW忎ÒzŽä¿úÛà¤ç¤ä¿ îʯ*¸ä¿qb•–?Èä¿X¯-Æ#Õä¿n˜êÕÞä¿Àá¾ÀQåä¿Óž(˜è俞[JY#ä¿f¡È3ä¿T„^ÇøEä¿ä§ù¶U俲î#Tbä¿´ɉÏkä¿X¡5'rä¿ÌaöXuä¿•Åícÿ§ã¿¸¦¬ v½ã¿zc¯>åÏã¿.ØÙxHßã¿þ_ë㿌X}áôã¿u…Ù¯ûã¿úê‰ö0þã¿a à’/ã¿« ;²Dã¿eäöL Vã¿à®ÏReã¿/0.¶qã¿TÖ:œ#zã¿ÍVˆ.€ã¿þ]fQ8ƒã¿ZCaу²â¿+Pè,óÆâ¿¶Þ^ €Øâ¿ÿéúÀ%çâ¿Èÿq§áòâ¿a!å±ûâ¿î”Ë$•ã¿eB°ŽŠã¿è‹~s`2â¿K¨ÍKFâ¿Í€½™cWâ¿…;™¦eâ¿aóÁÖq⿨ºÅ»¦yâ¿##aâ¿g®ü?A‚â¿ ‰Ø®á¿IÐ2Âá¿Æ‹hÐÒῤ0z­àῨuy»Çëá¿óÄ9}ôῃ´ã­ùῘßV}xüá¿+^Iì'á¿äïk½:á¿–¹ØáJá¿îBé`VXá¿ÈH@>cá¿ÃIß1ká¿<ÌàÌ–pá¿´#ß±Jsá¿”BF¦Ôà¿lb±°à¿è›^R´¿à¿@C¾Ìà¿ÀZ×Ï,×à¿&`3ßà¿(ë÷7äà¿dâÇÔæà¿ª #‘à¿MLÅ(C"࿟u‡¿g1à¿\àVŠ>à¿[Yq+Hà¿Tì20¤Oà¿è6A­Tà¿‚;u1Wà¿°þ6 Ðß¿®ðþÈ#ß¿8Y™P9@ß¿ÂÔM¿‚Xß¿†2/êkß¿OÌØ^uzß¿O¯p&„ß¿jÓS¿üˆß¿à§y°ÚÝ¿~p­îÖûÝ¿¸)¾ÇæÞ¿ôÆP®//Þ¿‡ëÊAÞ¿É=Ux¾OÞ¿u‡x2 YÞ¿|¾&a¬]Þ¿ÅÂoN°Ü¿B]=›‰ÏÜ¿L7ƒêÜ¿ê,¯?ݿСj`Ý¿tºC£YÝ¿ÏKˆß>(Ý¿n•­,Ý¿†BiW‚Û¿¨;KnžÛ¿:ãöضۿØDá>ÓËÛ¿ß<‡F¾ÜÛ¿†¡‚?{éÛ¿uo£rûñÛ¿œ†+7öÛ¿ÉÃ|Š8½?ò=´›X¹?Þãû%vµ?Gî:¹‘±?Ш€Á4W«?vÿ ™ƒ£?ï»¶è0J—?B× ÅŸ}?i¹™0¾?$;XÕH"º?T[ëÁ¶?Èu;°²?/êýF¬'¬?)·ü+Ф?Åuò²ö—?aĈß›~?¥{Ô…ì¾?{ÜÛº?kÙ¿¶?Þ; Ÿ²?½ƒ*¡y÷¬?ü3 Á«¤?=¿…Y(¸˜?FòP–ä6€?D¶‡RØ¿?}Ötóš»?tÊ2þ_·?=®ÃA¨"³?2’=CÅ­?0o§)’@¥?ò±¶×àp™?—ï.¥·€?æÓ(…LÀ?3GÊP¼?Þ4ò ý·?J¥Õ5¤³?ÌËÔSM®?¹`•ŒÓ¥?Ìje (š?„;ú¾’R?ª£>v>¿À?’¢ž ½? c»Ù ™¸?séƒ$´?霳©QX¯? $ÝÏc¦?ò{Þ¬_Øš?¼ª}Ê?¦”…±KÁ?Š:0Kš¼½?žÆ[±Ã1¹?¨§;Ù¡´?@íÁ]†°?+D´Ã…ñ¦?ÈÇKŠÃ…›?§ÇÓL‚?ä#D;Á?9@>Édq¾?2Ä>R"ɹ?OPúe¿µ?¬GË{:o°?½ú¼{|§?gæÅG/.œ?z?J…F¾‚?f;FÔéÁ?´zà­‰¿?¬f´ý\º?ïβ}W—µ?(¨“¶*ΰ?ÓŸtªÏ¨?¢-Of›Óœ?É[¾Œ4ƒ?Çë!L™TÂ?`úÖqÌ¿?›ë|ïº?ýå7ÑÛ¶?.bÏŽT+±?9’ÛcЍ?¤é“¶Üt? ßз ƒ?zÙ¿|&®Â?v™Jý8À?ñû=„}»?ú}Uxヶ?à#? ÿE> ©?ö÷Ξ?p–C„?$êäyoÃ?.ýܯÌÀ?A!’Û ¼?©ïM„¤ö¶?yÑà±?¹¸„C©?û;í=­ž?•f¡Ev„?±Éø†jÃ?J<ÞSÜÀ?þ$½xR’¼?ìÖ\¾f·?`ÊiÝd7²?»þm l ª?òZÌ›.DŸ?îÆ,Þ„?FÅÑÀ ÌÃ?ºtã[,Á?㪊 o½?ÅÓÕcÔ·?ò•ÅŒ²?¨q„ª?¨‰­Ž<ן?ÜDÖ„~@…?Y¬ZÄ?R¤9ë=xÁ?‡–a}‡š½?XJ‘¦9?¸?üÃ(à²?†h0)Éûª?þ§ž b3 ?”P¯>~¢…?f­¤lÙzÄ?!âÙLÄÁ?hy¬¾?:Ünïo§¸?^ÍÈ7&1³?HbAGÕo«? ÚDà(y ?$éã¸ÿ…?våZZÉÄ?Ùw5„J Â?DØôÙ]•¾?ÖÞ´Ž³ ¹?þ®=€³?Ùcsí­à«?Üã ä ½ ?–’æÈ[†?n7{] Å? XZ,TÂ?ƒ¶Vnß ¿?Z+öß,o¹?ÉoÝP¦Ì³?ÜOeÁ7N¬?@„âØþ ?f×óÜ¢³†?t)erjÅ?årj˜Â?¨hÆ%‚¿?‡Xñ9ι?ªu0ä´?öš{×V¸¬?Èbn ˜>¡?‘û2V ‡?º>C¼Å?Tn¹ «ÛÂ?:süSó¿?"¼Ëð*º?Æp¶Y´^´?BV^4ê­?¨N%|¡?UÏÄíj[‡?ObÙ`Æ?€¥hÜvÃ?©„)G0À?^v@™„º?uÕ÷^ñ£´?¿sÇ3È­?¿÷]l·¡?-¦Ž¿ª‡?ÜwñF™NÆ?$~“}ZÃ?j¢ê«dÀ?CˆwE´Ùº?BOâ×~æ´?ú<¢¯Éà­?ìà&`ð¡?b•ïõ‡?u¸¶ªÑ’Æ?^ª©xã•Ã?Ä2pÆÁ–À?ŽÙf(‘+»?ɱ ‡,&µ?ŠŸMkÂ;®?ѤÛ&¢?r±ùb=ˆ?Æ.ûåׯ?ýÿÔÎÃ?t¢]ÆÀ?%3…[y»?I†„¨æbµ?†¨­’®?!¹¥zÿZ¢?cqotˆ‚ˆ?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?«Ðo¡VÞ¿}àõcÇwÞ¿Ú’^•:”Þ¿hg4 ö«Þ¿fß‚Û÷¾Þ¿\ù Y;ÍÞ¿ùá»å¾ÖÞ¿WÈÿ ÛÞ¿ªu¹ö—®ß¿z@†½5Ñß¿?¥w|ëîß¿hóZOÚà¿‹àæ¨Æ à¿h¥#C9à¿ cø0à¿“¦­à¿¡…æÕ€à¿7Þ’à¿8ÊnãW¢à¿xA¯à¿)½¤—¹à¿êFpôYÁà¿[ÕÓ†Æà¿v%ŸvÉà¿´@:TÔ'῟±0ë’:á¿Jj`©Já¿ñÿÐ8Xá¿Úå‘bÔbῸÞn5åjá¿W sFpá¿æÙäF÷rá¿4Ù)„-Ìá¿‹í­Ÿßá¿Sç’@Pðá¿p°ó«<þῇµ‚Éb â¿A¨!áÀâ¿›]~¨Uâ¿Ã½EC â¿åVpÈmâ¿éŒÙêâ¿êSø2“â¿ëœDÑ¡â¿Ørƒ*)­â¿j4’<ӵ⿰\g±š»â¿yAߤ~¾â¿ÙÈ7‹ ã¿E½ùi[!ã¿€Ä=j83ã¿S wBã¿ÎTDNã¿F'ÉúWã¿Jó8ü\ã¿gàù_ã¿.‰T^¨ã¿p~3ÈØ½ã¿¬‰èGÐã¿cCMݨßã¿¿ÊeGùëã¿«ÿ´@7õã¿ýªb\aûã¿6·§vþã¿8²ˆl)A俘K‘ÒJWä¿SýB;Ijä¿4ϸ!zä¿B'®Ùцä¿vNÿ¨Wä¿›žÖ®±–ä¿ÎvðÞ™ä¿Ý±ZñÔÖä¿1˜ß™íä¿×¢$å¿2á£7rå¿Ñ·h€å¿/ÆÏGL(å¿I%=Õ.å¿3i8ø2å¿iÎIiå¿Nf Á®€å¿üùÛ”忿ƒpƒ¥å¿"€Å¥ì²å¿¥Ž|®ý¼å¿Ë1‘´Ãå¿° ÕDÇå¿Húlqøå¿úLhÊræ¿ê9# %æ¿ê³J=6æ¿Z„˜D濺J'ïTNæ¿ v>¶8Uæ¿E4ÎݪXæ¿+Úõº5„æ¿ÇË“ÎÏœæ¿éë‰8í±æ¿ÖÀM·ŠÃ濃~|“¥Ñæ¿õAF ;Üæ¿7îÃ;Kãæ¿¢7OÓææ¿9{* ç¿y)°%ç¿—¢§bM;ç¿‚¶ëUMç¿;¨¿Å[ç¿þ!à›fç¿i?9Ömç¿’W-­sqç¿eß·>‘ç¿Ö¾þªç¿±CyrÁç¿þ‰ijˆÓç¿ýYˆÎKâç¿ÒÏX`íç¿\‹‚QÄôç¿#5—vøç¿iY¼èYè¿þ©~§,è¿;÷PÆ9Cè¿.ç¿Vè¿•±b#eè¿ZÃñ?tpè¿Å‰þµxè¿HWŠ;Ç{è¿¶Q²Ö¾è¿Ï@~ð”ªè¿yMMÁè¿ÓJ_ÔÔ迊P07ä迆kXaÃïè¿Gù)w÷迎½SZQûè¿4à*Z é¿3õN#µ$é¿fhw‰/<é¿×¶„¾ÅOé¿ÅØ?½t_é¿v‡:ké¿QŸ­s鿎õÂHwé¿ú¬$é¿Í¦ÙÃôšé¿^¸”ݲé¿Z"mçÏÆé¿Ä‚Œ¨ÈÖé¿ •aÅâé¿Á‚P9Äêé¿S×ôÃîé¿n‚æ›éðé¿qc–A ê¿¿`Ï!•%ê¿~*À~à9ê¿$V‹ Jê¿ éUÇRVê¿’DPu^ê¿…dªä†bê¿YF‘º^ê¿a<Üù‰{ê¿]/€D”꿉”$Æå¨ê¿Å‰j¹ê¿%Ž1zÐÅê¿ÒʯrÎê¿ÄÑ‘@8Òê¿à¸›lyÈê¿F™í¼åê¿*p1žÚþ꿦•çžÎ뿊̓´•$뿉rãH-1ë¿X¿j“9ë¿8—ÎÆ=ë¿{ˆ.ë¿«ìðÊKë¿xb Geë¿,¨ ŒŠzë¿jwAJ‘‹ë¿¼Y!¥X˜ë¿ÊßÊ¤Þ ë¿¦Äø!¥ë¿ü®«„ë¿]uD§¡­ë¿«$`ÿyÇë¿SZ¼· Ýë¿^5.}Mî뿪ä(¦Bûë¿ À&3çì¿`)øÎ9ì¿@[Wné>Ê¿?™ð0GŽÊ¿$LŒ'ßÏÊ¿ÚÍœüË¿™§üú&Ë¿0•ÙF…;Ë¿!êß¼AË¿¡0.«â=Ë¿ö  íË¿“[ƒã>Ì¿èÒ‚Ì¿Õ ´‡‹·Ì¿€0|ÞÌ¿0:ò¸×ôÌ¿D”½üÌ¿y£ÿ5øÌ¿2޼4œÍ¿šþU¨ñÍ¿,¨c#”8οÑTø¦’qο±èÝe¨›Î¿ýVÛÂڶοžÌÉÂοp%ÊzܼοBÝ`nYPÏ¿L¡ÄS«¨Ï¿JRÜÐGôÏ¿åÚ|Pп–ór!/пLtób]>пx|Ú1/Fп¸s CпºPÚ6‹…пވøõ/³Ð¿¢¹§ÞjÚп„C?üùпnâöÑ¿Âe›"Ñ¿tš`|h+Ñ¿M m90)Ñ¿ÜíC³ŽeÑ¿äŒJ>”Ñ¿¶ô#­¼Ñ¿ñ“œhÝÑ¿„þñ ˆöÑ¿ø„ú@$Ò¿®¨ßÎÒ¿üø(ßÒ¿ºÇò[GÒ¿8RÑÃwÒ¿f¢lñ{ Ò¿Ùîô.ÂÒ¿ÿNvç5ÜÒ¿$r¢œîÒ¿ã€äøÒ¿‡o>­÷Ò¿÷—v›*Ó¿–.KÆ[Ó¿†ÀT_…Ó¿ô¿2å§Ó¿†¶ê@±ÂÓ¿,~)3ÄÕÓ¿°ˆ ÒŸàÓ¿OZîßÓ¿äú ’Ô¿¢®æ?Ô¿pÅÙåjÔ¿Ë·ÜÎ"ŽÔ¿°†î{—©Ô¿yÿ)ë;½Ô¿öOsÈÔ¿ö=ˆKÈÔ¿wªqÚõòÔ¿Ä¡‰ì$Õ¿˜ŠoÕ™PÕ¿fÆÚztÕ¿Ï-°ÖƒÕ¿›”¹ª¤Õ¿°Ê€nr°Õ¿I ª°Õ¿i°ò½×Õ¿b*ú ֿ·p§ 6Ö¿\(‰Ô|ZÖ¿ÐàÖ{ wÖ¿$·—=§‹Ö¿lyðlÓ—Ö¿*Õ!k˜Ö¿)1zñ¬ºÖ¿ UøåíÖ¿UÄ}NÀ׿´îf»?×¿Š›2'Æ\׿HôW¶Ìq׿,¨¯^[~׿ÒêZg׿ÙŽ´׿|‰ÀëÐ׿$ýÍKþ׿¬n_cÅ#Ø¿dTÉÂBAØ¿y"í¬VØ¿#qäY”cØ¿é†i]ødؿLJ—€ø}Ø¿¯5hS²Ø¿Â–dE7àØ¿0.ñ)Ù¿16áÒ$Ù¿™ºäœÝ9Ù¿ ¬ùãGÙ¿ dßiñHÙ¿Œ}©¾\Ù¿¸î±‘Ù¿Vס†ÀÙ¿n£+vvæÙ¿C´aŒÉÚ¿ìXí¥îÚ¿ÔgL(Ú¿"”ªÊ¨*Ú¿FR.O9Ú¿„ÒUˆnÚ¿ú<9ïbÚ¿å)#Ë:ÄÚ¿»q$½ôâÚ¿FðÒß¿ SªÎà¿>‚ݛ࿰ì_ó4à¿®ßH~âE࿚yvLhRà¿¥ž„øqZà¿fkû\à¿…uÔFà¿d+Þ»bà¿ÛF,Í|à¿àÒfYg’à¿øLGœ‡£à¿þzHG1°à¿š©W¸à¿8ÿ© »à¿ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/0000755000175000017500000000000011634153073022024 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/Header0000644000175000017500000000064111634153073023140 0ustar amckinstryamckinstryNavierStokes-V1.1 7 x_velocity y_velocity density tracer temp divu dsdt 2 0 2 0 0 1 1 4 2 ((0,0) (15,15) (0,0)) ((0,0) (63,63) (0,0)) ((0,0) (127,127) (0,0)) 0 0 0 0.0625 0.0625 0.015625 0.015625 0.0078125 0.0078125 0 0 0 1 0 0 0 1 0 1 Level_0/Cell 1 3 0 0 0 0.5 0 0.75 0.5 0.75 0.25 0.5 0.75 1 0.5 0.75 Level_1/Cell 2 3 0 0 0.125 0.375 0.0625 0.25 0.125 0.375 0.25 0.625 0.375 0.5 0.3125 0.4375 Level_2/Cell ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/Level_1/0000755000175000017500000000000011634153073023313 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/Level_1/Cell_H0000644000175000017500000000145011634153073024364 0ustar amckinstryamckinstry1 0 7 0 (3 0 ((0,0) (31,47) (0,0)) ((32,16) (47,31) (0,0)) ((48,32) (63,47) (0,0)) ) 3 FabOnDisk: Cell_D_0000 0 FabOnDisk: Cell_D_0000 86098 FabOnDisk: Cell_D_0000 100518 3,7 -0.0111302573243619,-0.0767701868715931,0.6669370850051,0,1,-5.27117194654642,-206.110908688105, -0.0762711879385728,-0.0122532825064793,0.6669370850051,0,1.0000000012514,-5.27117194654642,-205.958113040741, -0.000867403768859847,-0.00125850508148039,0.999998914080072,0,1,-4.08136637815915e-06,-0.000903107752809111, 3,7 0.0847261804286211,0.0867770851243948,1,1,1.49939180543897,3.0924335071236,284.47336624379, 0.000233353795077215,0.0853318091894545,0.999999998748596,1,1.49939180543897,3.0924335071236,285.340445018927, -0.000117888863526044,-0.000557155573217501,1,0,1.00000108592111,0.000370429418726417,0.186593677923703, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/Level_1/Cell_D_00000000644000175000017500000034037211634153073025030 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (31,47) (0,0)) 7 ¯ÈïÇA¿l šël ¿îÞÒ4ß¿¾…ß…V¿¬±lû¾Ì¤§øñ¾„쳼ྀŒÜõ5µ>ÀžX2æ>¤ibñ¾ô>hg\ØSþ>¦R)¸Û?ÂÌék?€ÒÙÎ ?Iº¶y}?ËÖ×Ûs?ö§À+E?RÎnì?o {Äd?ïj}©?Ê4¶?ÆÂò†?]’±F?lŒ Rg?)[Šq?¾ðá÷3?Õm£™­?û•VzÞ??Õ/Æ?Æ_Œc?ax÷£?Â5‘??âä õ ¿ö±þã ¿¬ ÿ,Ú¿pY¿Yn¿Ðdãxžû¾úçHò¾XÔ1¿ëà¾@Ð4îµ´>xw‰õ)æ>†žâÛô>P'`'…þ>v÷c5þ?&AºL—?@665 ?Ôn_‰?G"î˜?Μ8o?²î-\?kd”a˜?­ë}á? ..ò?ß Ê\Æ?û²ŽZ?=„Ô&¬?5T¹?IÖ¦Ã|?űZö?08'?Œ¬K?`Ó}w¿?·#½F?Râ]ù?Pk·Žw¿ÚËDÖS ¿dDN'7¿â!­w¹¿,4áü¾|ö{=pò¾hrÑtJá¾Àœ9°³>è˜É ?æ>°Ëòvõ>ØÀ½wèþ>~6ü !°/æ>` ñuõ>”£«Æÿ>øHÁª? ÉWt ?4ØDY?Fwßµ=?klR?,’÷A?ßvˆî?ÊÓ+ë›?³>Œ™û?4ѥΠ?餔?t ™ ¨?!!ÿ?„ë0T-?,È€'î?Þ ûÒc?ß¿ãŒ?hFû·e?Çfçµì?±ð ?–«Õy?ù‡ˆ"¿ÎÁé΋ ¿Š~ÀO©¿ÔkJ+Ì¿„-¬ý¾p·\Šó¾P§÷r{â¾€˜rL¿²>Ä•†ä™Pö>ri„"?\d¨B0?œ¥äÿ ?³È|õã?€AµÎMº?8%’ã?€Y4”¬æ?øZCz¿?€ÃŽ»g?€²ÏŸÙ?€Sø Ò?µÓø‡?€Ñ?Z²?€ghí~?ç4áS?Bö_?`¤;>?åÓ‹ø°?ƒ-N7‚?¤*D«ý?à ?èr·þs?¹à#•¿«ãË ¿t´…"X ¿X`ºÙy¿,û¬"Èþ¾¨>±úTô¾¸±Û`]ã¾€–€ý±>¸io0Ôç>Üà?a—ö>=Ðñš?žÍ×?+÷ ?…)Œ(î?v)pY?¹,ã›?€ÅXß¼¹?€*³ð™¬?€¦©ØTn?·Ë»ø?òòæ®E?j “LO?€ÊÇâR?€?u…?†ÑJûÁ?¦ ­ö?a¾? ÌÂ[(?ènnô?°ÆÏ¶u?9GKÉÈ?(QŸZM?ÑÍ'ÈZ¿”Ã]οöG¸^r ¿pãÂ_¿ðõ·×¿8%óºRõ¾ÐT&Ëä¾€îÐÃr¬>ÜÄ‚)è>·Ri;÷>éŠÔ&?×ÚÈœ?uJKø ?슜;–?jµ•?€/.Ykz?ÿôS¢¸?€@²ÓË?€?¿AZ­?JÚâkV?Þ5¼?À?ÓwFä?ÀÎÒè<^ ?€Ö1Ü¡ ?€¸´E½Å ?PÙ° ?“½ól ?¤î ×ó?þ‡Ü»±?±*Då?ž N?®.ÕG«?‘ÎgMì¿Þ¿E$¿`Ä:‚ô ¿~ïàz¿äLèê¿Ì?\‚ö¾@e‚æ¾Iû·»£>h $•è>t9+ëò÷>%6æÄ?$èçx?£4có ?€üŽüN?h@íšô?X57Ž}?ö¹ò‹â?ôP̺?€£À¯Ü$?îaió?Àæc\@ ?‚µ{â ?ÀŸÞ\!?€Ò”¸Ñ«!?€7µŽwØ!?ù´7È!?€iãoû„!?æ[‘® !?€e&àXa ?îÐú?ç¡C4¨?“¸qf?iñvsοììb“¿XZÆRa ¿29É©¿‹ŽŒÚ¿ØÞÉ#ß÷¾Ètz@µç¾Åc·’>ôÜpºé>Nÿ—»ø>̀αs?Ê8Q{?>ž|¼k?Î…’…?Qã ï?å¹V˜¤? sØ77?€\—¥Ÿ?i &ðÕ?@:‡éÓh ?€sE!?Àó/é!û!?ÀB‚NÚ†"?¾Œ(%ä"?€ 3e#?™½â’#?ÔÏÒÑ"?€d‡zV"?½D/Ë¡!?èʰ ?F;4ò?§6¢š™?,Gi¿?Õk, ¿™ßÈÀ¿Xó®6ñ¿T&Ïîå¿ôê´yjù¾È×_ó¨é¾ìŽíæy¾˜–ª»ré>þO€ù>¯ã‡¨0?:A>Ž ?7­Ø?uyì?q³?…¦fî?Øf8¶?–D…£T?býÅ` ?@} œy!?€rKÇo"?ÀtAö>#?³œ‹Sß#?'ŸN$?¬›)¼•$?]a›”$?€¹f¿FV$?ºÅÜ\Ù#?¿–#?€7.S7+"?€·Ó ¬!?ÚdÑú ?²½ò›]¿qo•È&¿¶˜ M¿ÚÛÓYt ¿J¥$»¿ì“»k*û¾Hò¿Ëåë¾€I‘𢾠öipÎé>ˆèjkú>ç¦VWø? ï]´ ? £8±?€çD0ü?]j[@6?©T{0Y?€«]?Àyi«  ?À¡ †(t!?€•˜2 ­"?€„ãÎhÂ#?@ý­k®$?@„]÷Ôi%?©•šï%?Rß!‹I&?2íf×S&?¦~K&? ê¿#š%?™!àÓ$?F…‘ØÊ#?‡j^"?â@Gue!?‹û¡ß¿Ét^9å¿®s(s¿¼jJ4/ ¿®Ènk¿8Ùý¾ «ŸÂoî¾À6Kºœ²¾ÿέê>Ô;¬ Eû>ÌlótÆ?£Zݵè ?ÇbÜ^?ok—1?€Ê7&Ü}?€QOJâ?€_žˆ,?€Õ?o )!?@xÐ!¥"?À¾—Qñ$?j™ ¸>%?@ê´JN&?€Or¡d*'?@—D1Ì'?n1ê=(?€<0*W(?R$(?`LØE¡'?€w­øË&?€ôùíïœ%?€N‡¶ú#?€ ë>߉!?_Hù.¿uR¿X²­‚¿ ª\¸ö ¿HP\Ø¿~;Bÿ¾Ü€ªú£ð¾€…ÆSȽ¾d0ðn'ê>NÔE†ü>ÍǪؕ? ˜c% ?BtvÑY?qFH?¶t‰Ø?€Â£Ú…?À>ZŒíŽ ?À~*œK"?@òÕz5ó#?@‚xéÏ~%?Àý¦Þjæ&?ÀlK#!(?À í “%)?Ë’"^ê)?á“'z*?€~eåî¦*?fй˜}*?0Âû)?àPÛ)?€Ä€mâ'?06é74&?€„·ÒI½#?½ÅBßd¿øJ®iÖ¿ýD²ß€¿~ŠsõÍ¿¦ÕH-^¿ ¥õ¯Ê¿(0 I9ò¾ÀWÙ*‰Å¾´“B_ ê>äâèÔü>Xðo`?kŠ8b?{b*ð5?Ó¢k<?‡é~ò@?óÆ·z>?ÀTœ—!?€Êwƒ#?€ÿQ%]%?ÀÿË’'?ÀÜígòº(?¤‰ø€**?€†‹`+?€ßƒø+Q,?€]. -?€ÍCõL-?µiÄ—0-?R铯,?€:4ô5Î+?€o ßàš*?Õ4*ò6)?^z&tø'?ǽ;)¿ O•X¿–«®lÿ‘b˜ð¿â j³ ¿ˆà~п˜?¤úó¾`9 d_;TT¬é>$™·pvý>ãUÚA?‡J~–?€ÈòV?€Æ©àS]?€¸üv°?@Vÿf‚ ?@gظ¢ª"?l-Ì$?ék”à&?@)#í:ß(?À¤$Ò5½*?šUmm,?o.'(á-?€#\ /?ÜóSœï/?€GÂÞ*0?ÀùôCm$0?ø…52Å/?€¸¶£DÑ.?€ƒ.‘•„-?€ ¾m¯,?Lu8‘ð*?qj|<¾¿®oÚCŸ¿_PW¥C¿Â»j ¿Ê§ŸÐ ¿ôÜ{Œk¿ Àrºçõ¾ðTÜÏ?ӾĚ‹üè>Üð%ðý>m¤v‰Ê?+Dn\?Õý!‘â?€V7?x?õ‰?@ UÎ~g!?€®Xs»Ä#?€Ï,“2"&?Ty(?À l,WÁ*?>í#í,?€ -¢öì.?ºz W0?€bá†71?€#Ûâ,¡1?€T)O’é1?ÀƒFí1?À siͦ1?@ØJ Ý1?@êtñI0?€$›f§.?¢Oñµ,?€° ¿©úF˜"¿ªiiÄ—¿ê8cô3¿·û¦ ¿jfåÚ¿$Æ›8ý÷¾°7’¨{ؾøR|ïç>¦ €Þ6þ>1 §íY?üAvsÞ?€ô#¥?x­ŸÒƒ?”Ø |?€²aPH"?@ fÃRÞ$?–‰ª~'?À}gK‰!*?hžó;¿,?@ˆlÔI/?àýÒÕ0?¼lˆç1?`ÃÀ4Ì2?€j™Š‰3?ö­aöï3?À•–õã4?À^à,¸3?B³ÔÕ 3?ÀT>gþ1?€ìõcô 0?v?¸.?€zdÇ~ ¿èžVò¿W!¤ßÄ¿}+ÝnP¿ÎÛÞˆ¿|tèoZ¿ì\¡s8ú¾pÐá5f޾кڀzæ>æ •ó?þ>hh·ãÄ?€ˆM¤AK?€›Õƒ O?€4”+u?€(ßqŽ` ?@T‡E #?ÏÆî%?À¢fUþ>½«kM ?€Ê}8œ?G· ÿØ?Ñ ŒÆ??œÆ3í ?,KJ0Ù#?@ŽÙ¨êç&?À^f¦´*?@_ßíŽs-?à5¦t0?À½<ü72? º WJõ3?@?¢Àfœ5? åü7?©7Ì W8?À¾Hsµ79?%Óɤ9?ÀQ*ë0|9?€Zœnš8?¼ á6?œöŒžS4?Àþ˜ºpI1?@úw~î#¿€¹mT¬ ¿‘g鿺¦]WÉ¿Ói…Á¿ 9ƒ ¿0Œ™2 ÿ¾ôVùæ¾H‰ÅEDâ>Êpò xý>Q+[ ?€ÓqÌ?É=#8?€¿¼ïŸÖ?@uÐ-"[!?@G_{s$?@¥X¾‚¼'?Óy=+?€t¬­ßú.?`tèqáy1? °Õ/3? ¡]’†²5? kª…«Ò7?àv¬Ù9?@wvék;?9kLpñ?Àv† x=?2±çT;?@/pC̓7?@6¹XH÷1?€A~Ó·È$¿€ú«õ¬u!¿±kZ©J¿ÂƒÿÉõ¿–¤µB»¿¢4! ¿HŠ…YÇ¿Èýz˜àé¾`x2ß>>ißìŸü>3›r°á?\-Ö?ÇöÙÁd?€ô5ó“,?:Ó¥ !?€üAI3Ý$?@è‰ObY(?ÀTñ˜„#,?À’é‚„$0?ÐS;²i2?à©Ñ–Ôá4? ,°Ÿ‡7?«àÝ”L:? b?¥ý%=?À|¹Ž??pý@Qn A? "¶?$B?À×÷€€çB?ÐkuáfýB?]SÑ’×A?àJ¡O·=?@WðìÕ3?¨Ï\¿#¿ŠÚèR¼!¿É5ï`¿Ü2ä¿Ämá*©¿Äel£ ¿zŠ…¿†˜¥Ëí¾¨[‘4Ù>ä£1eû>•?–Ã|?€ºo·?€ß$£X?šLö;6?€A°«X´!?€þÍÊÙ%?€Îdh©(?ÀlÂhÙ°,?@`3ü±œ0?ÞþCÀ/3?À%oºq6?`i 0Žq9?àtï+=?€6!ʃ¥@?€ÇeæB?TÃÛ%pE?Ð],BH?¬¤H¦K?ÀÉ«‚M?ðç¶¹L?€ƒs›G?`¢Ú~ 7?€¦² ¹$¿àxæ4Œ"¿q4µ¿ühpƒ ¿˜ ο, +µ¿ =Êf8¿˜ð™û×ð¾èéÒêŽÒ>Byˆ}$ú>¬ì„cä?ªø­²o?Þü´A?%½ªì?E&”Ž!?MuÜå$?@ ¯]{–(?À¸‘Ä,?àö¬Ï0?ÀäJ-"±3?@zIWM07? Ê¥n¡;?`E¨º=q@?°º’òåÝC?`-, ‰XH?pQZ½_`N?P*9´.S?Ø~$xÒéW?@!:%é(\?˜ßñ캘]? f×7gY? O}XïF?uµa‘ß'¿B/þÚà#¿€Œjä ¿8 $'5¿ÜI/g¿äC\ew¿v“ŽbS¿œ$>)®ò¾Ð†r5È>\dÞ™§ø>O·-$?Ȇ}ÿ?€¸ˆÝª‘?€±k sM?Œ§g€+!?@ªµdm$?ÕaM (?@ˆ? ;,? žÀ$ç 0?áÌeXË3?`PºûEü7? ;b"Ò=?àú¢Y{*C?@’á]žI?È•W.”ÚQ?`V?ÆÓY?lû«aëb?è™ÆÅñÂj?,;2q?AÙ>êr?}òi¢p?T€Ç †b?€*1Ú‡(¿œýEÁy$¿v­‰!!¿˜Q!¿ZóF¿=:ŒO¿xP©F¿°õ’ÈIô¾€ÊÕ¡©¸>fÏ`,÷>f¹ŸO?uNèa?€m! Tä?>Á:fc?€QuÅ¡ ?À‚ä¯Wœ#?À…­ÜÊ'?€OA5ú*?€ù0J2ð/? v‰?2èÍîË3…?,ë‘jGy?€Ö¼Lß¿&¿€~á%!]$¿€ç5îe!¿Ž-b5°¿«îBu¨¿<¥‹!ÿâ‚?¿ˆØb‰õ¾vZ\¾•>(³†Yáõ>L?ð`‚?¤—,‡ê?Chfm?€È ¤C?;t Ѐ?@ù€L}"?Ö‹`4z%?@TÞp¨ú(?@¢Kð8‰-?€ãó›.2? _ûÞd+8?ðµfMB? 0S^2'O?0c†Û#ß]?^e6ÅÃm?ì!©Ç G}?é+IɳèŠ?I–år•?8ÃæjÓ›?³ø5œóË›?rqgÊu”?¸bzõ'‚?bæüZ'¿ëÚÎõÔ$¿zÐæóÀ!¿N¦Øb;¿€Ï‘Óh¿€>LÇá¿Û1{¿œÉÉHö¾ÏK꙾ŸŸ$þô>gâ}ß?€’äó­í?=±ÍV?@°o£?€/¹³?Àt–< *!?ÀïÛ¦”#?À&Û8 [&?» #*?`(ñp¬R0?@PÇ›`N7? µþ`þID?`§]P΃U?4Ù.§i?ÁœÀÔ}? Gwr ?YÍ­©Ö?L\Ìè%#¦?ÒjŸkI¨?ù=*ÎÄ7¤?&‹õrß‚˜?(¹½\Rûx?;¸–!|*¿ÀHÅÚ%¿€oû):+"¿+é]©¿rðféR¿€š@î;8¿|aiž ¿˜…gdö¾àPòé? ¾è;Àô>€kû@?€‹@e¤A?@CCµ?{ÅœLý?€;%¶Ÿô?À8ÛðKž?ÀêãÖ…Œ!?pl#?€0â¸N,&?€v+d€,?`~uW-06?à S ùG?p>¹Âik]?ì¾Ìg‡t?´ô?Ž@Œ?¹ƒ‡>ໟ?Ž˜@ÈXQ«?¸eëǾ°?8ÙÀ¦¬?N?ä»3¢?ˆè>L¶Ö‘?@6öW†h?@— ¢o*¿À8¢’Ãî%¿€~[ɬ<"¿€PsâT¿¿€£gvûW¿€ZÚBÕ*¿+üKd¿B>ɵ¹õ¾€âq: ‹>_ìu eõ>+~¹»?@Ü" ?@™Œp&a?À®ö´ƒ>?nÀ^Ž’?@K³½J?€û•:ðh?\³Qª ? TäÖ=f"?ɦõ (?`¶M6?°ØžÚ'L? ˜Ñ7>Ãd?®„ÓŽ®2€?@‹uí˜?ÝBIðËÝ©?’ȥݻҲ?*õÑØ1²?X“þ^¨?°ºÝ!W˜?°>%û&A„?@.J')qf?@×ZÉ6”'¿@Ó~–,%¿ÀÕM÷ ù!¿9Ï ù‚¿\›FÚ"¿CW‘÷è¿ÒR| ¾¿|{š‘-ô¾`û Š¾>?ÓMo%÷>€L¢„OŒ?€Sm9¶À?@mõ‚?ÀÄÈ^?€+IZäß?€68ì9Ð?2å„ Í?Àˆ½=Š8?ÀO[½<?€±±8A°%?p[¶9‘þ7?i«ø=R?0Í«\‰n? |ï5Éx‰?—ã?•¢?&&VÚªN±?½dÑ‚/µ?ìTíÙs—°?ÔXÉrŸÓ¡?ðíøžEMŽ?àN Mlv?€ˆ}ôDóS?€Ñw#'¿€œ­Ô$¿€¢ìÕÑ!¿€ZSiŸ7¿Hê|Ç¿1Àâ(w¿öCJ)«¿ü´Ò­ñ¾˜¸ÀÇÎÒ>äfG4-ú>Gªó ?€EÊÏ(?€ì‹79?Î[?@3S%?€ úòê›?€ÄÿF-â?À$ Âb?ÀX¦Q¿?Qk ^%? $(ˆ?0;?œ|+Ú©¼V?ˆV{ªs?ÞpEîô?õdÈô˱§?ÿ«nZL´??ÇÇ)­µ?”ßj·è–¬?†«'øê™?]ÇÍ)žƒ?@È Cñm?€P3 —P?€ðaš4â(¿À5Ás©S%¿í›ÿÏÝ!¿E®¾[ð¿Ò QL¿]a™4­¿;ù^)¿¨ÞŽÆ_쾿·ƒQá>IV —þ>€+Ô¿ ?ÀÚµÒx?À^ "Œ?ÀjþÉÉ ?À‹XÔ •?áÍ÷?@  ’u?Àêx‘g[?€¤àiÆ? íÀÁ&?0¢|# >?L#/¶ÇY?<ž«èN‘v?©R–mƒ“?çxQ•ª?øPn°µ?q[Võqµ?<=Sœ§©?@Û ÿ"•?`})ªj? &LÅ"™{?ÀGv”C*¿À4S.ô¹%¿@\V¾’Ù!¿€8ƒ‚Þ¿>ó5Ñ¢¿q]1€¿NÒö'5¿å’dbã¾è‰•ë>€rƒÎü3?çˆ*¤× ?YdÙET?@Eö$·?€:'°—m?@óOÐÞD? h‡HÄ ?À# a³D ?àœCýc) ?íå‰á.!? Å?1t)?0²%kè»?? SOv?Z?Rx”è¯v?RaK‡“?JkYy’ª?Vcda ©µ?Xâñ¬Jcµ?Ä6[cÄ€©?}ÜàÆ”? sxÅP+|?€…Fã[Wb? SGB?Àw¾8¸)¿€º¥nw%¿(ʉ—!¿ç+–'Á¿]‹&Õº¿úÜŠê ¿+Oœý¾@QÐåëо °Vç ô>†½”÷Å?ÀÍ€_Gy?@7“Õ´?@ðÜ©·}?€ÄÕrò?ÀŒ¹h!?àí,bX"?ÀoçC*#?à<„8 •#?à…u¶+%?€0­ÑW-?€­tåú??XúÊ„1X?õQàžt?¡ôž…‘?¼ˆ¤/•¯§?àíè›6´?ÂësÕÐ~µ?8¢öp ¬?ˆ2éÌó˜?ð&ʽ?€Fx1‚U?Ð…¾Í?ÀíØ|Û(¿À BD=Ü$¿€(¼.7!¿€—™»¬¿€{[’¿ ùÛ³_ ¿´×–î÷÷¾°:‚XÐÀ>ŸAQ£Dû>÷:©ë ? !û¸à?€×Œ™y‡?@ÅôÑÉØ?ài›uu^!?b­Š#?à)ÇÅ%a%? PˆÞfÞ&?@Îô=(?Àã<=¥*? "ðÜA1?0`Úø¾°??Dcx¨®T?LâÊzºo? êk´^þ‰?Ê×AçQ¬¢?þ$yµ.±?+K{ôÕ´?¹ _\)°?@Ë¢TF*¡?`À&ә݋?ws”5¾k?ð&=0µ€¿€: לô'¿€h¶TA$¿ÀƪT ¿€MgpýT¿€í\J2¿}c t¿ÜÌ žñ¾ðCØÒJâ>~-)£?üÙ^??÷œ›Œ?@Ó!33¯? Ob™ïÐ ?€ *¬#?€š¨Šb&?`¬ãì(?@g¿ù"S+?À(Mˆ´Í-? Ÿô£0?£Ãù7‚4?0’Mµ7ô??îtµ Q?„gòZg?1;7Œ?j"éo[Ô™?÷- ¨¥©?®0«ç(²?Åë§³c±?Dò ªe§?îdñ-˜?Pq¢Ó~ƒ?°vl\¾fƒ¿À c¥'¿€°?#¿€ûQ†b¿€ÿ&œäË¿Vw€œ¦¿O2eÄ=¿”w0Úzå¾vl‘K²ð>à Áfæ?ÀÀÈ@ ¯?E˜x_?ÀN`R?à=™¹Ô"?@·4*·!&?`½qšn)? l­µ_¾,?`›/ÓN0?Ð$„0Sí1?¨”ô$L4?™õàO8?`€ç`ĸ@?Øz*3M?˜˜mÈ*`?Ç­Z!'±u?>ÚçoŒ…?‚kÍ‘º_ ?ü¬iH¹¤ª?‚÷eL¨c¯?Bܹb»æª?p »W£¡?PÝöb飑?3¢Ùuˆ¿€cBò &¿@¤¯clU"¿kº OY¿€¦Ç÷• ¿CÆSû ¿¨”û®ÿ¾ sHs̾ ëTž„ø>€}¥ÖH ?À–IsÇ(?Àv2];?@KcV3!? Vó/¿Ú$?Àœ*3К(?À¶ø†},?ÀýÐvI0?€üHY"|2?"p+™õ4?p¢Ièÿ7?ÐØ,ˆÍ] “O,?€™;‡ª?€»4)”?@q»þ? y$8‰Ñ"?À¢‡³tÉ&? KÞu<ó*?-”m `/?@Ó¬¨2? ÉMÁóº4?0Žáä2Ä7?ày„™èo;? gáq#@?ð¥? ÂC?€Ê uýJ?ø·ßX‹jS?h’ûo a?ÜÝ­íqJs?œ¯ØÓÐ9‚?hæeÇ ? ê¶}˜? L¹$ž?Ø@‰Mƒ?¸¸í\Q —?˜€u2+L‹?QŸäÐð#¿À\/¶*^ ¿€V^ µ£¿=jô’¿F‡ò  ¿ƒ#Íñ¾D˜+ìCå>™´Váª?Oßf*„?À»œ‡Ð?`n];C ?ÀÜ+­_I$? tÉéš…(?à¿ävP-? ‹üô0?Ðl-}¢3?0–T?¦6?°½*8":?æ§fŽO>?09¡}LÊA?H?zz\E?(Ê×.Á¬J?d«FK³µQ?Ѱ ÄY?Pï½EOg?ÄÂe‘X's?lÚq$?Æ«‘ |‡?ë1‹ýŽ?XZ­§M‘?2 ,bð_?”ïE”š’?òâŒMÕ"¿€ÜłѮ¿€…i¿¹¿ý}MÐÿͿ†!’¿¨'Cœ澘2Û Rñ>¾vXÿ? RIî?A¤Mo»?ÀÈ7ÆÎY!?@ºñ¹o‡%?Àó›ˆö)?À[U]º.? …e [ö1?à¸G KØ4?@9 þ8?·Œ@‰à;?´’“ü-@?`±ïB?À<°@ïwF? 1iÃøCK?@|ßGPQ?àÄc²ì‹V?d2Gš`?HÇÔ‚¼g?èD÷6`q?0À !Wx?´qªÃÇ?Ô…¦ú:ƒ?šæeª§^…?Èó,Lx·Ž?¥zÁ´!¿€˜}Å5›¿€„Û#(ο&}T9ô ¿ÝBy]1¿Øñ—t?Ò¾lÛÔR³÷>Íu#+M ?õ0á ?"mBžj?pÆ¿ÐC"?@»^Ó&‹&?@¶] +?àíHC$0?ÀÐêW¸2? åhŠš¹5?@YãíD 9?žµ#‘ =?Àw=Ô@?üô-:›C?P $L G?Ш…ñvuK?ø à3®P?ø¤¼¦×T?¸è@™l[?\ªG4ša?@ µKg?€µ!á¹@n?°:Q,“s?ÇåÇÐy?ºZqEüD€?z¤Ô‰MŠ?¥‚O/ ¿¯W챇¿•,`.ê¿dIõ–{ ¿œéXîù¾¨b¼·>ü‡Çpý>¾6o ?ß8à´?€ÁÌ×ËÆ?˜•õ"?ÀZˆßTE'?·VRä+?à Wý$q0?@òuʧ,3?À:ø¾ 66?€ú¾ ¤9?Àš€÷xŽ=?Àq6` A?°Íæ÷f¾C?Ÿø¤!ýF?È‘–IúJ?@su¹ÿO?ȧ×>sW?0w8Çy²\?¨.-Ý@ a?ðÔßµe? ¬Ýó?Àj?àÜ%E’p?4ªh²c!u?€¸D_Äýx?€ cÃ׿֩ìy¿€Èõ¿œUK™.¿ô5z<Ûó¾È%¨ÕñÛ>Р•/?p^bÄ^?€vu2?€wsòÛÃ?€ª#xg#?·Íݰ'?€Æ~©M,?@Q†° 0?ï<ù´R3?@pÀ²P6? Ú«1¸¬9? õŸaÂs=?0œVá@?ÀèQÎwbC?@éx†”SF?ЕµWÌI?PYƒš‰ïM?x'H±ó(?éSK?PEß «õN?ðf£äuQ?(‡0°{S?ˆlýæEU?ÈRzóAV?Þs¨Ï=U?@¾yý…$O?î¿![ ¿°„hª¶õl¿Wú1%¿€t.¸_¿r ï ¿t ?ùª¿ðo¸€à¾,pɘð>‘µ®~v?€*Çœâ?²MëS?ÉÔQ*»?Ti<v#?>eÖþ|'?Ms|Š9,? RÒ Öb0? O`:Á»2?`Û1¥‘k5?`a7` 8?`ÀˆÍÎ;?@Ùô*t+??`_Dé‚A?@ËbÔ¥ÄC?0f­DÅF?À}<0oH?@e[>{ãJ?P#§åQM?@ô¥ IdO?ë9P?ÐÔý°3BO?Ð>ªŒÅI?à;m[-÷:? “¢zÆ4¿)l‘kmW¿¯Ïüõ(¿×\ñ3¿j$Ú²Y ¿97ïÉÆ¿Ú u²‚¾Ú&vtÁõ>×–™ÃŸ?€®–ì‹=?Õ¸¤±¼?À ŨÑ ?@Æœ7¸ç"?[£LV{&?@€ØjeC,?`õO·0?âãQÀó1?à0£ yE4?À@®±û7?@$£5V:?@¢X=µ=?ÐÆÎÜW@?p -ÂÝPB?`ÄUæ{þC?ÐID’Ç}E?ðà¤kGéF?à÷eÞ©.H?€óšŽsI?ð%ü_ãH?mš¨ªF? àóÞI@?@@¯¡‡A/?À(ÇÝ!Q!¿ U8ÅèhA¿¢ùŽ;|¿9üZn¿Jû†ªË ¿¦.É¿èÑ›Óvó>®YÇ›Sý> ÿ¤½¬?‰²÷þ ?€œöoC?á¾y w ?ÀÝ!Ç ¦!?@["ÿ?T5dŸ«¿8}éš æ¾Yd×¾`ˆ5 Ó¾p«Z …Ò¾àK¶«ºÒ¾ Ó¾°û³DӾЮÂ{cÓ¾ÐÖôfbÓ¾pÖç¥<Ó¾°Ï¹îÒ¾P²\xÒ¾`–ÖÚѾ°éMíѾ; U)о C‰¥)ξào¹õ°Ë¾à÷¾éȾ@^gÖžG9äz¾@ËÅй½¾@Èǯ¶¾€ÕP¨ß«¾ 2Fý•¾üت&Š> D‹¨>ž½È`µ>@1‘¯Ÿ¾>€eßOÄ>L*¶Ë>pÜÁùÔ>عâÒ ç>Pd} áì¾0)jßê¾RÏ‘Ì꾸ÂlAbë¾€§S¦ ì¾ÐþÖ–ì¾P]‚€õ쾈Ëc(%í¾PÖŽð%í¾ÐDl+ïì¾p¾yì¾xW•<Èë¾(ÿvóÛê¾à©g»´é¾ÈMÇôQè¾Pí&³æ¾x|CZØä¾ÀÀUVÂâ¾`äLØrà¾àÒ’ÙÛ¾@èæhÖ¾à~2ŸÐ¾€¯ºž«ð˜Ñ°¾€Ç´#£> KF[Â>ÀMÿÏ>ðÎVÛÇÖ>pˆµþŽÝ>x^9|Tâ>Ø’("Ÿæ>ð~ýì>`$_ä(ñ¾¤H(ºô¾(F˱õ¾d]ñ#·ö¾HK„l÷¾äÚíÙê÷¾ˆ†Ô;ø¾œQN¹cø¾Ànxiø¾ NÖ ‚Î>P˜é°Ú>ÿnôâ>8¶ÌQè>ÀÿØá#í>›®ÖVð>˜Trfºð><ñ#A¸ô¾€çƒðû¾,ý›þ¾îZ"Ç¿ˆ„B„¿6E Ü¿|_`ÿ¿ºµ¯+¿†N77¿b‹‡> ¿`´qÖ¿F«”m¿ˆáÎJÈÿ¾ÈÍXgqþ¾(§ ™Ôü¾HƒÍ¸ðú¾ˆ¶QbÅø¾P€XSö¾àÃ*w›ó¾ø¸”p¡ð¾PØ8Óê¾2XÇõã¾0{_-„Ù¾@t¢jÖž¯YX³>€ýã$^Õ>àí›Íâ>ø¤t‰Ãê>,Ñx±3ñ>Tq¡Èô>0æKr¿ö>˜•ÞŽãó>BÀÅ…¿t0¿¤u^¿î-Åí¿`|/x¿X·muã¿´¿§Z&¿ s±Í4¿<ǯ¿•ìÞC¿K¥rJæ¿L±ƒ(b¿H\¢³¿(~‚ר¿Ã•öƒÐ¿ýÇ™¿ïI}44¿J„ÓÍ?ý¾sV»ù¾Þ.í7Þõ¾^&gu­ñ¾”ÃCh_ê¾|N^[ÖྰÄC ¢Ê¾€ärq®½>àžæÙÛ>…Ç)iè>£rñ>è~GR¦ö>”ŠÝ òû>¶*eÍ?Êyqc?f±ð‚õ¿¬D7M¿–Ôª& ¿¼ØSÚ ¿¦ûr?‹ ¿ \ãB ¿üt(n ¿Rìí>ž ¿ GCc¬ ¿xª}j} ¿÷XD+ ¿Óq.@x ¿Ã2¯ý¥ ¿šyŽ×œ¿ÉÂL[¿ÿ[%à¿à­~œ*¿à)Y‘:¿³â貿äÎÏY]û¾H:ùˆ.ö¾œ(i¤œð¾ sb徘~è‚àѾ@rùá¿>ps€)äà> a~Åî>˜*™àõ>ä¢Èæü>€ñ@/?&s?vàQ´&?z‡£Ë{ ¿2[X, ¿VRžE¯ ¿Îd0Öá¿X={‹Ç¿A¤F8¿×ebp¿ _´¿€îgÖz’¿€¶™ñw¿3Œ®<¿á#ý¦Ã¿‰D$IÏ¿ŽÛO™ ¿ÀÕÊ ¿7D#a ¿ÎHx«[¿Š÷8¿|¿Í£¿¸~eùû¾Ê§ÑŒcô¾˜„qÀŒê¾(ÂGÎ2×¾@>W¿>¸á«w»ã>ü×ñ>p°Áù>n“^s¸?ŽØ–wP?ºý†c?:{Õ@v ?h‰âD ¿ª¹m4H¿`Ú¢öe¿eªC¿<&Þt ¿cÞè“¿€%T¨D¿¦åì:g¿2Ï|m¿ˆ·ú•N¿€Yl¢Ú ¿¸¼zd§¿€dö¿€qÞ¾«l¿4w£Î”¿Œ2€(¿4ŽƒöÓ ¿:ÄF¾* ¿Eã´,¿ñB0Û¿gmÞT9¿¼v Ì˜ø¾Ið¾`›h8ݾ—àý¼>ˆ+7Äpæ>œmPºô>xó.þ>pïX°?ªºÀ¤ö?ÈT¶NT ? Õ÷:l ? ¿F—Á¿ø™v"ó¿Kq¤¿\¿‹"¸õ¿n(6€¿~‰*í¿lxp8¿WŸ¸Õ`¿€3N®ôh¿€Ø-"ÆH¿€A‡K¿€ˆÔ{Ç‘¿ý:¥ø¿îc$4¿€K”pB¿«(_Â!¿oâŠÐ¿çrÙC›¿‘hê1 ¿<=¯-c¿LFµ4¿z€(}Uý¾Ò…œó¾peZ§â¾@ƒÆßý¶>0Àô@óè>˜P O«÷>\zo?¦Nïû?Á$w… ?®àbE?o"¡•¶?Ì5؂ۿæ}þe¿E.i-$¿ýŦÞ¿kGˆ}¿ Õ 2ù¿Úaª(O¿Èæj~¿ ¶sŠ¿•‚i¿€nfx»¿%^Ã¥¿€Ø¡_ÿ¿€.Š{Ñ(¿€Ð¿¿ÑãúÛß¿€§ÈÀÜh¿‡ò2¸¿*Hò[™¿; K>L ¿ïU‹¿7ëì!\¿š»a–÷¾ –mÉhç¾PzT8¨>P¿ò%ë>ìq¹#›ú>(®ðuÔ?âto'G ?ˆp¼L?8…r?È#£_È?ã"ÔÈ¿ŽùM'¥¿Ú̸Pï¿Ö[%ã¿,E3ž¿E!&ô*¿B*•Œ¿Cbp¨Ã¿}%åÔ¿OÖP–´¿þ\Mf¿€Çaóç¿ôË7þ6¿€9¤¬}P¿€b¨W61¿e&ÊÕ¿€3@ð:¿€í¥I¿]¿€j¨<¿ClÒ©¿Ð!‡ÛP ¿š9s¿F.¡3ü¾Lׯ Hí¾üÊk”¾ˆRõèêì>ây…ý> í7N?ü>hƳ ?8È žZ?n¹,îm?dýµû­? „5V¿”…Ûyv¿²¯É¿8`Ìi ¿Pƒ"í¿o(;Ö‡¿¬!hô¿€qÛü ¿:/w % ¿Âg> ¿€„ÍÜÞ¿€qdа\¿NÓB«ì°¿€E%€¿€Ó.§1 ¿€•ÜqO¿€uÛkõG¿€3.X&ñ¿Ú¦á¬H¿…Œ œ¿²Ÿ+3¿ÂÉ]Ù¿\fÛFGò¾€Mk5q¾¾¨"÷¬î>ü´ì¾4?@€´í?¡tyÂ?îŸsÖ?¤‡¡[=?އŸ€?2Î%*x ¿|ôjÐ ¿€ ùw^ ¿€™AKÐ ¿€ï¸y 7!¿€û†mY‰!¿€™‹BìÄ!¿€üæyé!¿€ëò+»÷!¿@´X¨­ë!¿@ÇèšiÅ!¿åŒùƒ!¿Ài¡&‰%!¿Àü/ܧ ¿@ÈT ¿€3SZˆ¿´š4Ư¿ÄâE¥¿€ó(ø¿¥P©¿€úœ>Ä¿ãzù0 ¿r¯•† ¿@6”1Ìö¾ìûо0ÌîÌŒî>øe?‰›?>[gí¯ ? à’žã?R^ºþ?˜!»Ì•?3 ¥hÈ"?€ 1Š)!¿å:Ÿb‘!¿€A¹­_"¿€G[«t›"¿€ç¡ö÷ #¿XBÜ‚e#¿I­nþ¦#¿#`Ð#¿@ƒù,÷â#¿€åšFÚ#¿,ð€¶#¿@Sý-Œv#¿€¬ªK#¿Àb2™"¿À†)ò§õ!¿À•ÓVT*!¿@™3 ¿€‰ÓõØ¿ë–o_¿“gŒ7¿€'ØÑ›¿€bZÁŠ¿ažVï¿À4¤¡lü¾`?Ñܾ5 âòí>Ô„Exè?~4®Er?ËÍ”J÷?‹ìoÊ­?€#·¨‰F ?€;ýõë†#?Ž ðd¿!¿€Á43Ðú"¿€¹Hs/Ö#¿€%ÿÇ/y$¿}0ÙÜ÷$¿–1ž»Y%¿[‚”s¡%¿GßÏ%¿ÀÂÆü›ç%¿@ý†¡aã%¿@ ä2³Ã%¿€–RY‡%¿€âðõ+%¿@)[j®$¿À¦©× $¿€—p»™<#¿Àµb>"¿@ ‘^n !¿€IuGÃ5¿€‰_(¬Ô¿€ÿÍ84é¿€£³î,o¿€ÓÏÏÐ ¿¼T%°¸¿`û.¡æ¾`ùIÄì>̾L˜?Âo‘'¦?é(ËY?LU³`<?€–Þýu!?€!Ôæu $?_ã Ý‘"¿ÔCÊIÄ$¿•5$^Ì%¿€¦'(>{&¿€"î'¿€àÍ.h'¿7!þ4µ'¿€OÂíè'¿€ø×v(¿£¡ŠZ(¿ÀÃOÛwí'¿ ¹z·'¿À U¬a'¿ÀëÆv±é&¿€É{œJ&¿£˜XÈ~%¿@’6º{$¿ÆE#¿€ršÊ\Ç!¿Jx̉ü¿¡:Ù‘Å¿€þ9žŒà¿ËöÙK¿xs¿È´¹ð¾ GÕè>JG­!W?·™ßÙG?Ã^f¢?zÕŒs- ?w¤WZ÷"?Ö(©¹$?€¹ o{W(¿€ŽÁŸ'¿€ò!+Á(¿{¬Ú¦(¿ï ')¿qðì)¿9`4Xâ)¿€ù޼.*¿€ô>*¿@r8 òE*¿™@c›3*¿€ü¡Æ*¿@âй)¿€·íáîK)¿@.<§ü¶(¿¥zOô'¿@.šû&¿€z!úÂ%¿€€¥¢B?$¿@彫d"¿€Œà( ¿QU“迈ǴÍÓ¿~å f˜ ¿èÕXe¼÷¾À°%ä>ŠœÆ??FÄÀc?ØÌ?¡æã"?€+ú’»¹%?VÁà'?€Än3¬9)¿‡–²è¨)¿€°C*¿€oaÝ*¿¢äòÐc+¿ç÷3Ò+¿¾ÿ(,¿^¿Böe,¿€p,ÎÇŽ,¿@áõ²7ž,¿À¸Lö•,¿€(qr,¿@0R¶3,¿€-Ò Õ+¿@Z¢ZáP+¿€öl¦Ÿ*¿@Ý9go·)¿öp(Ë‹(¿ÝÑüÙ '¿Õ: Þ,%¿ø)z×"¿€åæÌ´û¿õ¾$g*¿;o·8¿¢JEK¿0 ë:¢Ü>ïöì?HS·ƒ?zÊ“»3!?€óÌ¢Ù1&?€KAÊOV*?eGÁÍy-?mçÎö)¿€|»*n+¿€1Š µl,¿€ZÍ*'-¿€‰òc¥¸-¿€þ7þ+.¿{¥~Â….¿¨½ü9È.¿Oýöîö.¿@–2«v/¿ßé2/¿€7sìû.¿³ŒšVÍ.¿@š`šbƒ.¿@[ÃÀˆ.¿ÀìÚzž-¿ÀTøI¶,¿osm¦+¿ÀÎ>*¿€²Í;h(¿bÊ:…&¿À;da[#¿“ÀT·„¿W^ñÚh¿¢jJ±~¿ðÏ—`BÔ>€†e ?º®´\.?€Ø&•Bÿ%?Rù) õ,?À"æQ‡N1?Àföý"3?„ž +¿€aÃF>¬-¿Â0VÏÙ.¿€)¤<ì™/¿¨ê=Î0¿€ý–¾®O0¿@Û»q`}0¿‘Ö4A 0¿@´¾~8º0¿NÏhÊ0¿àkàz§Ð0¿ NáÎ0¿™¨V€Á0¿€Ü•¦©0¿`7AÂéƒ0¿ žÿ9L0¿€ð«mòø/¿Àl#VÆ/¿UUîÜ-¿œn_'),¿ÀÀ¢JýÕ)¿ÀŸˆ#̶&¿Ùwqë—"¿æp´PL¿t  ¿Ð8ŠÊRá>×ê½?€¶ È%?Àa“åöm0?€š9%vD6?€ ç¾k;?@”pgÖ.=?ÀT¹Ì71¿ÀÍ¡µú³0¿@Êçä.Ú0¿€äÛŒ1¿Àƒ¿hA^1¿r}=•1¿mÖ“°Â1¿€ŠôÐTæ1¿`·L L2¿†Qô2¿ È®q"2¿ nîdR(2¿¡ˆ›‡'2¿ÀŽ™lJ2¿à!ò_º 2¿ ¨{ Mï1¿¼×ä¾1¿½cXp1¿àÔÐä÷÷0¿à÷¨ÇO@0¿€ã=ÁZ.¿@ çA¢6+¿ÀéÂD À&¿€bÿ­µ ¿ D‰¿{JÖÝ÷>@Î6Ÿ*Ï!? ¿€Œ_2?à¡Q¾Mß=?À-QŸÚ@E?€Ê„d¢òJ?à“S=iM?@KÀÜYÅ1¿À„¶Ðç1¿Ó¦K*2¿rÇÏp2¿x¬š°2¿@ºœ:”å2¿@žÎ3¿½ {ù43¿7’( R3¿@üÍh3¿€3ÂÌÈz3¿@´vŒ4‰3¿@qFSÝ”3¿`5FÙž3¿Àí(t ¤3¿@œ¹q¦¤3¿`èÐìâš3¿`i¿Ì~}3¿ `~Ui<3¿àñÀ“<½2¿`ÂqlˆÖ1¿<J0¿Ý_SØ|+¿€¾e/Šh#¿=1.> ¿€n[þø?€ŽÀ(—4?PƒdÑ‹D?xˆë€JQ? ¶píY?H”ºD•u`?ìÒ™wub?@9 Q92¿{¥¡¢û2¿@¦?5_v3¿Ï1PIË3¿€xÏÿÌ 4¿€÷hC'?4¿±ðÀh4¿@܆øÅŠ4¿€@øR§§4¿€Ïƒ¿DÀ4¿€¬Â¦Ö4¿  ù²Èì4¿Ànuà5¿@ ‹´5¿`údê`?5¿À~ÿ˜Œc5¿~÷A¶‰5¿ ;Òšª5¿@^¶5¿à¨dŸ‹5¿€<Â*Ší4¿àG?W8k3¿ÛÒúû>0¿€½R[1$¿<m·ló>À~w$r35?ÂDƒK?Ü[?<øŒªg?ƒz{bq?Æãõ!Sw?<þë4{?€dÑBÅÛ2¿;² W4¿@ý=Eè4¿€ =D):5¿€$ÚЦt5¿€š¸âz¢5¿s³´–Ç5¿€BÿSæ5¿ “8=6¿@ª_á6¿€Á26¿`0f±N6¿ w_þÔp6¿À1TÜ¥œ6¿€­mäÀÕ6¿æ •c7¿À¦V‹5{7¿@n–.æ7¿¯›iT8¿`e_¶ìŸ8¿ ‚¢iCo8¿€€¿F÷6¿ w Õ7‡2¿€ÌEcí¿.Àa5/?À £Ö"ZO?ˆdíôþåb?TꞀçr?–5Üi؃€?·ó&›`üëŽ|¤I?<ËYc¥¨d?8˜ØIÞÆx?.`Í’P‰?SëWÜ[–?âëÕ|û ? =P;=¦? 1vŠFƒ©?@øYK!8¿À™ëï 8¿€7íŸÝ 8¿@×ÿ~èC8¿€b», e8¿€¨§«€8¿ÛøÞ–8¿€su©8¿:£ýU¹8¿`B6©FÊ8¿@‡æ ß8¿Œbãû8¿àÙU&9¿€Ö ƒe9¿@ï¨U¤Â9¿S7¯tI:¿à¨Z_,;¿ÀL¿Nµ <¿3‡³Åa=¿`KIª\é>¿ ìÏ<@¿àÇ)/³>¿ ì-à 54¿€Îî°Ï1?PÅÃCr_?Ò˜‰è²,x?¿t“ˆÚ2?‹ë’Š‚?¡]¿Õ(ͨ?…ÊæoU±?û_¹´?žͰé/¶?@EZ²¨8¿À¬“¨qI9¿@xƒ%œ9¿€ºƒ|IÉ9¿€(oå9¿Àkµ)<ø9¿ÀØCŠ:¿@0/â :¿àæZ=:¿`ý ˜:¿À°™µI*:¿@~zmð?:¿` q¼d:¿qº` ¡:¿ ¸Ñ9;¿ 9Q0œ‘;¿M€[i<¿`áÿ¤ÆŸ=¿b3:ÜI?¿PÃ0s¬@¿Å2P’A¿`µwKSì@¿@xÙ²%3¿`ŽørQF?dÂ1Á|¹o?ȳ>fãsˆ?_…w М?ůˆŠª?Æbc5C³?¬’lžòµ?¦Ç¦æ7¶?ÔtkÕ›µ?@,•åNd9¿@½ƒo ×:¿@øÑ<;¿àçé<È_;¿ÀÙo+o;¿€VuÕu;¿ ô©Ê w;¿@QЩ†t;¿°ˤXp;¿ rü²l;¿P2£éÅl;¿`ÃõJu;¿ Y¥ªî‹;¿`"3"º;¿°‡G‡ <¿`B[–‘<¿ K‰uc=¿€Ôoºaž>¿ ¼íp|.@¿ÀtqüFA¿€¹ä+B¿ÄÂSA¿€d>¹_.¿°“q¡ÌuI?ââ½éÔy?\ÿÇö>Û”?NZzà3¦?Bn pts°?‡éð;qè±?1£§ÏØ×¯?'_è!‰ª?’ÕèÝ5‡§? Ï¾ùÐ>¿`‡à^åq=¿€nr'=¿à7, =¿àséi¡=¿ 3­âø<¿ 6ÊîÉì<¿ –ˆ¥Ý<¿°^˜+Ë<¿‹T27¸<¿Ðü¸7§<¿T1U œ<¿ðîtüBœ<¿–Ž‰Þ¯<¿\²«Gâ<¿0r™©·C=¿P ¸}xê=¿xŒÔÚñ>¿XÒËâ6@¿ø9.Z'A¿»ke˜qA¿€¬Sµâ´<¿–a*? ÎÀÍ~)d?ák½‡?Û`覛?uE¢ J¦?¼šù©?XÄTGI0¥? IÌå1wž?pG|ñÖë•?HÏ©_Æ‘? ëöf>Œ?¿¡ÇÛj?¿à2va Ä>¿ ·Ã¨>¿ ;ÚSK”>¿@¤ðWJ>¿ÀÔIš#f>¿ B¤KH>¿Pâ·½&>¿`ªn÷>¿?ö¤Ü=¿ðÕ†ºØ·=¿@ø†S‘™=¿ðC”lL‡=¿y‘Hñ‰=¿ ˜4D®=¿Ði‹ >¿ ÛРɣ>¿ ‘1Bz?¿èƒ7Þ>@¿`œU Â?¿ Uä'‰U6¿@6ÑdZ6?Èx]afh?|=3V!Ÿ‡?è¬]\Èp™?ÀÕ7h庡?7!Þ»n ?À‰”VÈÁ•?PŸA³Uæ‡?€{ŽUã!{?€xÈes?—Ák@¿ Ë磽@¿€ülº?$@¿éý@¿°h å@¿ ±áë@¿ÀN".ä?¿`)Y®·?¿À¯¢it…?¿à–Þ‘éL?¿ cC?¿ 祥øÍ>¿ð=ù;'‹>¿€íÃJ>¿p¹g×Ç>¿ð¹“•ƒã=¿0`êÏ=¿À\‚ýSÜ=¿€ÀðÐ>¿`Õã’ >¿°fãA~<¿peÐÌ@À3¿®6Ä)1?¼c•äjZc?t·–A%²?¸Ä=c±g‘?hÆ zP•?˜åÎô®? x™û¾¼?@¢BÉl?1PP8W?/±¿@S?p¾®ú5W@¿@[ŒûÒ@¿ðÍ…=ð@¿à™ä¾•ï@¿ÐÈÐx4â@¿ Þ-âÍ@¿àÎ÷Aˆ´@¿ NÅ3¼–@¿@+¶÷u@¿ØësN@¿`¤–#@¿@].WÁå?¿@¼j'{?¿à³ëI?¿   8d‡>¿Psèö+ÿ=¿ØÉª©n=¿Ð¨jfêÕ<¿ wL½T.<¿áfZïT;¿N/L“¹9¿QÏç\55¿šÝé«¿P1+¤¹G?¹ªåð²h? ³yYw? é}ønz?ÀT_tŸÅq?ÈŽ˜´¶Y?„\áÉí!¿úÆ7"÷@¿ # ¡u?`'@=¸éA¿0 ŒÊÖàA¿É\ŸÛA¿ 7°mçÌA¿@ZI·A¿` èà›A¿°[^k{A¿Àº«‚þUA¿Àæû.É+A¿`Ÿòû@¿Ø±´o}Ã@¿@rñ؃@¿(íI¤¹:@¿ðƒ P‡Ì?¿Àmº@1?¿…n\">¿À¦ZðP=¿`ËßÒ;¿@Oô5iX:¿ÀhŒ‰Íµ8¿P^1øÞ^7¿@Ó5ôSa8¿uÑßA¿¸«CÊ~U¿ iÉ2m¿Ð¸¿ÐK„z¿€v-6¦×~¿àë\D·Ox¿@DOeú=o¿€ó¯M“bh¿`#þÿêp¿ÀIòŠÉ²‚¿ØÔ¥4C¿ÐŒR‚ìB¿Px(À~ÎB¿ð'G ±B¿pOD(’B¿ÐV"ÎénB¿àÜ1šFGB¿€Ó!©‘B¿`$ „{èA¿Å\›®A¿è«Ð%×kA¿0*.2@A¿(3lê'Ã@¿ÐØ{vW@¿àp²vª?¿€¯GaAo>¿`wµæÙì<¿°ŽìU%;¿@|QØ8¿à[!•v6¿0ê ¹“/5¿FÚ ]:¿äžÍË/M¿¯qF»g¿„)\¬£‚¿ J²óó‘¿X‹|:Æ:–¿h±±90’¿ð$o+Oá…¿ ®/ßvlx¿àÚRe™nq¿`¥;ÕÎc¿p$2¶¬D¿ð!•ëC¿PËȹÀC¿ðêò˜C¿0ƒéÍpC¿À}¨?XFC¿ð= ”3C¿PïT\åB¿XÍîP¬B¿8ÖÄ¡ËjB¿èÃó2ïB¿°Œ¨ÆA¿˜Æ“~\A¿0÷²]Ý@¿¨¹¨5B@¿@µ°Äò?¿@Ų-ƒ&=¿ÄߢÑ:¿|Dú7¿P¹qpyç4¿PÍU>43¿°Qh˜•9¿ÀueôGP¿”) YÞdl¿€Ñò‡¿HS}™¿ððå¤ü¡¿é‹Í!¡¿¨cÇ䌻—¿~2üÑ ‹¿@yÆl €¿ðÆ-´$vƒ¿Pt<½\E¿  ŽâD¿ „àö¯D¿¹Q²¢€D¿@EµwÄQD¿àvQ³u!D¿à HîC¿ðÃýSþµC¿øÇÌj!xC¿ðÜþ 1C¿ÈÒÏ)îÞB¿¸¡£?m~B¿0³ —9 B¿Àˆ-c‘A¿xÆ”ŠÔÓ@¿àvÿ‘åû?¿ïè"â=¿Ð®o=;¿@Ôw£ý7¿‰¦ã?]4¿¢RšðÜ1¿¸»ãzª6¿°q ¤L¿m—i¿:¯!Û^†¿2»“.Ížš¿ŠX'N&#¦¿^ƒ]Få©¿,#V±y¦¿ÔxRM ¿Ø Uía•¿@°SVBŽ¿p'a‚`F¿]Å{ÓE¿ eojœE¿°åöÝgE¿@Î+4E¿ û§ÿD¿ ¬`Ó ÈD¿à¬¬‰HD¿ø ¯wRLD¿xT}ND¿(Mòã ­C¿øÖ[TIC¿8¶:6ÒB¿¸mg©AB¿¸O¶­¦A¿‹åˆ§±@¿ ]‘½x4?¿*Ò`Ós<¿`¿W¾ 9¿ÐAÔ¶5¿À¿à«Ý,o0;¿`¢×öTO7¿@ÆLü‰3¿à•“õÃ2¿ §Ø‰É>¿°Æ­8»œU¿¨ 3‡s¿&OR…NΊ¿ÜØ?ñB¿ÆÍ›ãD=©¿Kt Å&O±¿dÚë6§³¿V´[î-™³¿&?;¦°¿P£u°OìG¿PØ&t«G¿P¹óȲmG¿ ý­Q3G¿@Xå5ÎúF¿°ñ‰ëéÂF¿ ó!Ò5ŠF¿ãJ}kNF¿Ð*AÀŸ F¿P.ÐxuÄE¿ðÞ¹ç7tE¿è-G»ÏE¿@¸Ì-êªD¿pk¢O(D¿øœãÌb‰C¿hob/µÅB¿p(·š»ÒA¿pE"¤@¿`KÈú\>¿°|šLÅã:¿ )ƨF:7¿ '+Grò4¿0§y09¿Ð“3*ˆ~I¿àã»ÛP\d¿,'¤’—{¿*hDÜÿu¿p ß8ý"ž¿eI_Õû§¿0•Sú¯¿#k¸+ö=²¿ÁÙÛ6žƒ°¿ êÓ¯ÔH¿«9Á&‘H¿Pª±RH¿ð*vFŠH¿p~Œz˜ÝG¿ÀœJÐE¦G¿`¨í1pG¿ÐGm,<xS2A¿àâÆÜ£?¿€¯g ¥<¿ÊÆ*>):¿@ù Îσ:¿`Ù:ZûA¿P½f‘U¿€çÔi¿8 ã/@|¿H.§«ý~‹¿,[r)P—¿ÄÄDc¡¿’éúÉ‚¦¿tL3eUª¿ÏZMÔ·I¿ Ú ÌrI¿€%eõÞ2I¿Ð‚Ô?.÷H¿0¤Ã¾H¿ z©“ˆH¿ÀfüùLSH¿PÑSçIH¿ÀD=Ž:âG¿`GO=V§G¿Prì+„iG¿À Í$G¿p±•ßÔF¿@ÀS6yF¿§KƒÝ F¿àv½µE¿àFd¡ÄøD¿€'cá7GD¿pDÎê±xC¿Ð+cs—‘B¿@&°‹Í¦A¿ c „°õ@¿pxëKA¿ZuÌxPC¿€2]æ^M¿ÀMWUã'[¿Pƒ1M‹i¿4XoCùv¿l¢-·è‚¿LŽûD·¤‹¿b^u…âV‘¿2$u­¦‘¿@oÉU•J¿H‚,VOJ¿4!ØpJ¿à)Ø%ŒÔI¿PÀÈ´I¿F>>øiI¿Àý&U8I¿°ûÎpI¿ \k)aÖH¿PcÄÈ¥H¿pr*}‰rH¿ îŠO‹’žJ¿àÿ¹ÃòI¿ X‡»ÊI¿%rU6¤I¿@½ëøø~I¿Àt ®ZI¿0}ÅC4I¿ô>I¿à<×¶çH¿ ½tÚçÁH¿@¸f@sžH¿Í]¬H¿êÜsH¿ÐV‚ª`‚H¿ WQÄH¿`Îö-cI¿@JÙ®J¿€˜÷*#6M¿ ÒDÏvþP¿Èß=Ë*U¿`x¬ú­ý[¿ð࡟’dc¿˜* •½k¿ŽV…¦Pt¿(RaQg“~¿R{q-f牿0hjY;L¿àú[4öK¿À5S¦­¸K¿ðv‡*_‚K¿€¡KQK¿0º.Añ$K¿0 þJ¿ÕF(AÜJ¿GŸ“½J¿ ‹0¢J¿ò‘‹J¿z)½]xJ¿ 3"¨hJ¿ ú¬»ë\J¿@…éù¦XJ¿`ëY f^J¿`æâ’…pJ¿Ð³,±[–J¿àÌ3bXÝJ¿0)|(”VK¿ ¼ÉYL¿4 ÃRM¿°2%BÕEO¿€Œ<8è/Q¿À{ 3>¡S¿Ð"æ»fW¿àÒŽc¯#]¿ÐC±ób¿ØäZqÌi¿p7M8…Œr¿tŒÎD}¿°Çh»ª‰¿à4[Ò¸M¿|²±]¾L¿0‹£!9ƒL¿P΄¦QL¿ ü_‰U$L¿ ˆYTûK¿PeL,§ÚK¿0íûôÂK¿°ÙµJ­K¿0žåïM›K¿0÷’Ž´’K¿0ÞÖ誓K¿`Òrк˜K¿¸$Ä$¤K¿Àeͦœ¿K¿°¨ÅñîK¿€"á+/L¿ðî6Ú³ŠL¿pà¶ÇM¿pÏDæM¿kÐ8® O¿xâOQÝUP¿˜Þ): …Q¿X †gÙ>S¿PžÊ&‹·U¿ð§³×6Y¿0XCî^¿€æ9Æub¿ðïɯ…!g¿Øñ2tz m¿ð3÷±–{q¿Ä¨¦VÒ1i¿à}:òÅM¿ Zožh|M¿ð'3DM¿p—‰HªM¿À~:MóL¿P™ZoÈL¿€u^×®L¿°ÿÇÊ ¦L¿¹R¹™L¿p’ìe1‹L¿À$tàÔL¿·ÞªL¿ðÈòtÂL¿0¿}QÛL¿‚ß– M¿ °^^VmM¿pìHlüÒM¿@9›´áNN¿0Ÿ)³ O¿Ã*XIP¿HgÞhÂP¿0Â/ehªQ¿€P#_OïR¿pF¤Š±T¿¸vÀSW¿`Ïbf'Z¿ Ý–ÖÉ^¿X¹‹ÌEya¿v¦wKd¿ ¨_Cäf¿(Å#º‹cg¿gÿ[¥Õa¿ÐM“9¨‡N¿°h÷f)N¿Ð3t“€ôM¿PÓ™¹‚éM¿ ’»ÅÃM¿&~„M¿àí†&:rM¿àžf†M¿pÐGc\ˆM¿°è?xéfM¿àÏôÞŽzM¿Àï+‡ÄM¿ÀóðHåêM¿ïn óM¿ð€r(ôCN¿àÞx×·àN¿°ˆ£ž`O¿šÿ×õÏO¿û2XP¿°õ$¾; Q¿0W>GÜÉQ¿¨>¼xå¤R¿Pƒ×áS¿ˆ©|j•U¿0©ù†éÅW¿fý³¶mZ¿ÈÈÒ‡Ft]¿¨ëg V`¿äÅf½b¿pŠ¸Ñ½9c¿Ü¸w’¡b¿o¸šž^¿Ðˆ$x_O¿ÐÔf0ì«N¿` ;-{N¿ ØNÑN¿Ü£|Å­N¿@™s»–N¿à·´7}N¿P16Ŧ“N¿ô=¼“N¿Ð­f:‰ N¿ ’ûõ-N¿pGÞÉO¿à5§­ù0O¿ ã1WÄN¿€\ÔÒk(O¿˜ÓÞ†|8P¿¸µ+íkP¿h€ÍÏpP¿ð:‘‰¥èP¿ðÚÌñQ¿(C¿Ùa·R¿P:”‘†>S¿@ÿPñ_T¿ %z¾V¿ÐYˆ,p X¿ø]åÔ'dZ¿H? ´¸\¿Èà((k]^¿˜Jˆ¢Db`¿È†°37{a¿°-Ö|å`¿xO©ðj ]¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?îÿÿÿÿÿï?èÿÿÿÿÿï?áÿÿÿÿÿï?Øÿÿÿÿÿï?Ðÿÿÿÿÿï?Èÿÿÿÿÿï?Âÿÿÿÿÿï?¼ÿÿÿÿÿï?ºÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?ùÿÿÿÿÿï?ôÿÿÿÿÿï?îÿÿÿÿÿï?äÿÿÿÿÿï?Øÿÿÿÿÿï?Æÿÿÿÿÿï?°ÿÿÿÿÿï?–ÿÿÿÿÿï?zÿÿÿÿÿï?\ÿÿÿÿÿï??ÿÿÿÿÿï?&ÿÿÿÿÿï?ÿÿÿÿÿï? ÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?êÿÿÿÿÿï?Üÿÿÿÿÿï?Æÿÿÿÿÿï?¦ÿÿÿÿÿï?zÿÿÿÿÿï??ÿÿÿÿÿï?ôþÿÿÿÿï?šþÿÿÿÿï?6þÿÿÿÿï?Ìýÿÿÿÿï?dýÿÿÿÿï? ýÿÿÿÿï?Æüÿÿÿÿï?¤üÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?ôÿÿÿÿÿï?êÿÿÿÿÿï?Øÿÿÿÿÿï?¼ÿÿÿÿÿï?Žÿÿÿÿÿï?Fÿÿÿÿÿï?Þþÿÿÿÿï?Hþÿÿÿÿï?€ýÿÿÿÿï?~üÿÿÿÿï?Fûÿÿÿÿï?âùÿÿÿÿï?jøÿÿÿÿï?øöÿÿÿÿï?¶õÿÿÿÿï?Äôÿÿÿÿï?Dôÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ýÿÿÿÿÿï?üÿÿÿÿÿï?öÿÿÿÿÿï?íÿÿÿÿÿï?Üÿÿÿÿÿï?»ÿÿÿÿÿï?„ÿÿÿÿÿï?$ÿÿÿÿÿï?‰þÿÿÿÿï?–ýÿÿÿÿï?*üÿÿÿÿï?úÿÿÿÿï?T÷ÿÿÿÿï?Dôÿÿÿÿï?ðÿÿÿÿï?'ëÿÿÿÿï?îåÿÿÿÿï?Êàÿÿÿÿï?BÜÿÿÿÿï?ÞØÿÿÿÿï? ×ÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?ýÿÿÿÿÿï?úÿÿÿÿÿï?óÿÿÿÿÿï?åÿÿÿÿÿï?Êÿÿÿÿÿï?•ÿÿÿÿÿï?6ÿÿÿÿÿï?Šþÿÿÿÿï?`ýÿÿÿÿï?tûÿÿÿÿï?bøÿÿÿÿï?´óÿÿÿÿï?âìÿÿÿÿï?lãÿÿÿÿï?ÞØÿÿÿÿï?(Êÿÿÿÿï? ¹ÿÿÿÿï?Цÿÿÿÿï?2”ÿÿÿÿï?ìƒÿÿÿÿï?®wÿÿÿÿï?qÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?ýÿÿÿÿÿï?úÿÿÿÿÿï?ðÿÿÿÿÿï?Ýÿÿÿÿÿï?¶ÿÿÿÿÿï?hÿÿÿÿÿï?Ðþÿÿÿÿï?¯ýÿÿÿÿï?¤ûÿÿÿÿï? øÿÿÿÿï?øñÿÿÿÿï?èÿÿÿÿï?ÎØÿÿÿÿï?'Âÿÿÿÿï?B¢ÿÿÿÿï?ó}ÿÿÿÿï?ôJÿÿÿÿï?òÿÿÿÿï?jÍþÿÿÿï?æ‹þÿÿÿï?fQþÿÿÿï?1%þÿÿÿï?\ þÿÿÿï?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?üÿÿÿÿÿï?øÿÿÿÿÿï?íÿÿÿÿÿï?Öÿÿÿÿÿï?¡ÿÿÿÿÿï?5ÿÿÿÿÿï?Xþÿÿÿÿï? üÿÿÿÿï?Oùÿÿÿÿï?&óÿÿÿÿï?èÿÿÿÿï?Õÿÿÿÿï?¢µÿÿÿÿï?îƒÿÿÿÿï? 9ÿÿÿÿï?áÍþÿÿÿï?fQþÿÿÿï?¡ýÿÿÿï?ÜÎüÿÿÿï?àæûÿÿÿï?Ôüúÿÿÿï?W*úÿÿÿï?xŠùÿÿÿï?4ùÿÿÿï?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?üÿÿÿÿÿï?÷ÿÿÿÿÿï?ìÿÿÿÿÿï?Ðÿÿÿÿÿï?‘ÿÿÿÿÿï?ÿÿÿÿÿï?Þýÿÿÿÿï?sûÿÿÿÿï?‰öÿÿÿÿï?áìÿÿÿÿï?ŠÚÿÿÿÿï?ü¸ÿÿÿÿï?÷}ÿÿÿÿï?qÿÿÿÿï?zþÿÿÿï?õƒýÿÿÿï?üÿÿÿï?4túÿÿÿï?‚øÿÿÿï?œ4õÿÿÿï?Èÿñÿÿÿï?Š»îÿÿÿï?”Åëÿÿÿï?¨‚éÿÿÿï?~Hèÿÿÿï?ð?ð?ð?ð?ð?þÿÿÿÿÿï?üÿÿÿÿÿï?øÿÿÿÿÿï?ìÿÿÿÿÿï?Îÿÿÿÿÿï?ˆÿÿÿÿÿï?èþÿÿÿÿï?|ýÿÿÿÿï?^úÿÿÿÿï?´óÿÿÿÿï?ßåÿÿÿÿï?Êÿÿÿÿï?+”ÿÿÿÿï?P/ÿÿÿÿï? zþÿÿÿï?ÞAýÿÿÿï?h@ûÿÿÿï?°øÿÿÿï?$tóÿÿÿï?†Ìíÿÿÿï?Öåÿÿÿï?ò—Ûÿÿÿï?˜AÐÿÿÿï?•Äÿÿÿï?jé¹ÿÿÿï?¶±ÿÿÿï?œ>­ÿÿÿï?ð?ð?ð?ð?ÿÿÿÿÿÿï?þÿÿÿÿÿï?ùÿÿÿÿÿï?îÿÿÿÿÿï?Ðÿÿÿÿÿï?ˆÿÿÿÿÿï?Üþÿÿÿÿï?Cýÿÿÿÿï?˜ùÿÿÿÿï?Vñÿÿÿÿï?Jßÿÿÿÿï?ú¸ÿÿÿÿï?:jÿÿÿÿï?ÐÍþÿÿÿï?t¢ýÿÿÿï?ô{ûÿÿÿï?b²÷ÿÿÿï?hTñÿÿÿï?˜&çÿÿÿï?ž½×ÿÿÿï?•Äÿÿÿï?hƒ¨ÿÿÿï?–…ÿÿÿï?<ˆ]ÿÿÿï?Ï3ÿÿÿï?Q ÿÿÿï?D‰ïþÿÿï?”?ßþÿÿï?ð?ð?ð?ð?þÿÿÿÿÿï?úÿÿÿÿÿï?ðÿÿÿÿÿï?Øÿÿÿÿÿï?‘ÿÿÿÿÿï?èþÿÿÿÿï?Cýÿÿÿÿï?Nùÿÿÿÿï?üïÿÿÿÿï?ŠÚÿÿÿÿï?Œªÿÿÿÿï?Çï?îÿÿÿÿÿï?Æÿÿÿÿÿï??ÿÿÿÿÿï?€ýÿÿÿÿï?º÷ÿÿÿÿï?¼äÿÿÿÿï?Цÿÿÿÿï?ÚÛþÿÿÿï?üÿÿÿï?$tóÿÿÿï?ž½×ÿÿÿï?¦Áÿÿÿï?LÛjþÿÿï?Þ ûÿÿï?2ªðÿÿï?rhÑÿÿï?Ü¥“rÿÿï?…~}\þÿï?D;ûÿï?PëEmòÿï?2ºû^Úÿï?Å–Þšÿï?BºN úþï?˜üeÅvýï?/~ÙÚ úï?¸ÍÐÚÙòï?~ ºn"åï?B4u ãÍï?N]}í«ï?¸[Ï‚ï?rá[b\ï?=QODï?èÿÿÿÿÿï?°ÿÿÿÿÿï?ôþÿÿÿÿï?~üÿÿÿÿï?Dôÿÿÿÿï?ÞØÿÿÿÿï?ó}ÿÿÿÿï?fQþÿÿÿï?p0úÿÿÿï?iîìÿÿÿï?ßÀÁÿÿÿï?6ÿÿÿï?uýÿÿï?*Þ÷ÿÿï?v68æÿÿï?T¦¯ÿÿï?ªî+ÿÿï?>­èýÿï?³›Îûöÿï?&ׂbåÿï?BQ€5³ÿï?¸Ómn(ÿï?Šc¶ ¶ýï?/~ÙÚ úï?v9–@9ñï?QÀ®8¡Ýï?(:¶ï?†{Â)Èpï?zͶ< ï?ºgZy„î?¿.\É´î?$AK—×í?áÿÿÿÿÿï?–ÿÿÿÿÿï?šþÿÿÿÿï?Fûÿÿÿÿï?ðÿÿÿÿï?(Êÿÿÿÿï?ôJÿÿÿÿï?¡ýÿÿÿï?в÷ÿÿÿï?A\äÿÿÿï?xZ¤ÿÿÿï?¸‰Ñþÿÿï?`üÿÿï?\KXóÿÿï?:sÿÖÿÿï?3^;|ÿÿï?j8‹\þÿï?åñ“×úÿï?æÚúïÿï?kOžÏÿï?ÊÍsmÿï?.Tš&Qþï?t‹®E5ûï?¸ÍÐÚÙòï?QÀ®8¡Ýï?Ö¼Tè«ï?Ú¸9¡CDï?{„î?Tô¹^‹í?E¾©rì?ªSs‘Žë?üµáÁë?Øÿÿÿÿÿï?zÿÿÿÿÿï?6þÿÿÿÿï?âùÿÿÿÿï?'ëÿÿÿÿï? ¹ÿÿÿÿï?òÿÿÿÿï?ÜÎüÿÿÿï?±ôÿÿÿï?´ÜÙÿÿÿï?ØÅÿÿÿï?V^Rþÿÿï?3fúÿÿï?ÐÊdíÿÿï?m‹ƒÂÿÿï?p26ÿÿï?E,ˆmýÿï?¥Ä2¯÷ÿï?Õ°cåÿï?’Ånâ«ÿï?üù[úþï?pÛ“âßüï?_B'´®öï?~ ºn"åï?(:¶ï?Ú¸9¡CDï?é”<)Xî?\%=µþØì?ÀN´ Úë?ÉÓÀîňé?‚è[’kˆè?¦;ôwõè?Ðÿÿÿÿÿï?\ÿÿÿÿÿï?Ìýÿÿÿÿï?jøÿÿÿÿï?îåÿÿÿÿï?Цÿÿÿÿï?jÍþÿÿÿï?àæûÿÿÿï?BUñÿÿÿï?ìüÍÿÿÿï?IÓUÿÿÿï?¨V¾ýÿÿï?|€\øÿÿï?ó99æÿÿï?œŒV©ÿÿï?¬OäÝþÿï?þãÄ9üÿï?$ÀVóÿï?Ö;ðÖÿï?¾±Azÿï?xyf;Qþï?1ö¬—¨úï?Ru¢bïï?B4u ãÍï?ˆ{Â)Èpï?{„î?\%=µþØì?bh¢Ôê?Z¢,Y_ˆè?*0}^Ç<ç?Ö­Ä$Ÿ“æ?7œ7çOæ?Èÿÿÿÿÿï??ÿÿÿÿÿï?dýÿÿÿÿï?øöÿÿÿÿï?Êàÿÿÿÿï?2”ÿÿÿÿï?æ‹þÿÿÿï?Ôüúÿÿÿï?déíÿÿÿï?ÃÁÿÿÿï?Ì!*ÿÿÿï?‚."ýÿÿï?þs.öÿÿï?ÖgoÞÿÿï?På…ÿÿï?‡äžzþÿï?¸±Ô×úÿï?[‚H•îÿï?=ÐÅsÅÿï?×U<ÿï?E@wýï?+)ü­÷ï?¸ ¼ó#åï?N]}í«ï?¦” -Kï?I‰§l•í?ßåúÁ2ë?µ¢²[yè?§ÝpÔæ?Ò_ëæ?Æ}¹{;¼å?¦K¥XŸå?Âÿÿÿÿÿï?&ÿÿÿÿÿï? ýÿÿÿÿï?¶õÿÿÿÿï?BÜÿÿÿÿï?ìƒÿÿÿÿï?fQþÿÿÿï?W*úÿÿÿï?ŽÏêÿÿÿï?L–¶ÿÿÿï?Óÿÿÿï?7©üÿÿï?ç– ôÿÿï?æI×ÿÿï?ÆŸrÿÿï?ç þÿï?¤=3vùÿï?°£‘éÿï?IÁü<³ÿï?š8,úþï?‚•%õ†üï?Œ«ZÛJôï?Ýva|Ùï?¸[Ï‚ï?®w7`'—î?QGyì?.<ͶÈ}é?K§Lu-ç?Ò_ëæ?¦K¥XŸå?ÔÜIïwå?Å%/¦Ukå?¼ÿÿÿÿÿï?ÿÿÿÿÿï?Æüÿÿÿÿï?Äôÿÿÿÿï?ÞØÿÿÿÿï?®wÿÿÿÿï?1%þÿÿÿï?xŠùÿÿÿï?>qèÿÿÿï?Úÿ­ÿÿÿï?ý£âþÿÿï?Ö>üÿÿï?xeƒòÿÿï?â-Ñÿÿï?ø¨]ÿÿï?ZZ*Êýÿï?JéTøÿï?j9(eåÿï?l†‹Ó£ÿï?»»JÁþï?h'âO³ûï?Æ/0;ñï?(ÄíÉæÍï?rá[b\ï?š]p‹&î?ì,6*˜ë?µ¢²[yè?Xó,‡æ?Æ}¹{;¼å?ÔÜIïwå?HÚFBbå?:èú¤í[å?ºÿÿÿÿÿï? ÿÿÿÿÿï?¤üÿÿÿÿï?Dôÿÿÿÿï? ×ÿÿÿÿï?qÿÿÿÿï?\ þÿÿÿï?4ùÿÿÿï?8(çÿÿÿï?`R©ÿÿÿï?ä•Ñþÿÿï?ðàûÿÿï?wEŸñÿÿï?Íô×Íÿÿï?Dí Qÿÿï?ƒùÀýÿï?0­­¯÷ÿï??ûãÿï?^Hàëšÿï?‚Ãa¿Ÿþï?[$aÝ5ûï?F{»cïï?`}>Çï?=QODï?2¹[)âí?ßåúÁ2ë?RX!iè?´Î¦"-Eæ?¦K¥XŸå?Å%/¦Ukå?:èú¤í[å?iÄqŒWå?ºÿÿÿÿÿï? ÿÿÿÿÿï?¤üÿÿÿÿï?Dôÿÿÿÿï? ×ÿÿÿÿï?qÿÿÿÿï?\ þÿÿÿï?4ùÿÿÿï?8(çÿÿÿï?bR©ÿÿÿï?æ•Ñþÿÿï?ðàûÿÿï?xEŸñÿÿï?Íô×Íÿÿï?Dí Qÿÿï?ƒùÀýÿï?0­­¯÷ÿï??ûãÿï?_Hàëšÿï?‚Ãa¿Ÿþï?[$aÝ5ûï?F{»cïï?`}>Çï?=QODï?2¹[)âí?ßåúÁ2ë?RX!iè?´Î¦"-Eæ?¦K¥XŸå?Å%/¦Ukå?:èú¤í[å?iÄqŒWå?¼ÿÿÿÿÿï?ÿÿÿÿÿï?Æüÿÿÿÿï?Äôÿÿÿÿï?ÞØÿÿÿÿï?®wÿÿÿÿï?1%þÿÿÿï?xŠùÿÿÿï?>qèÿÿÿï?Úÿ­ÿÿÿï?ü£âþÿÿï?Ö>üÿÿï?xeƒòÿÿï?á-Ñÿÿï?ù¨]ÿÿï?ZZ*Êýÿï?JéTøÿï?j9(eåÿï?l†‹Ó£ÿï?»»JÁþï?h'âO³ûï?Æ/0;ñï?)ÄíÉæÍï?sá[b\ï?š]p‹&î?ì,6*˜ë?µ¢²[yè?Xó,‡æ?Æ}¹{;¼å?ÔÜIïwå?HÚFBbå?:èú¤í[å?Âÿÿÿÿÿï?&ÿÿÿÿÿï? ýÿÿÿÿï?¶õÿÿÿÿï?BÜÿÿÿÿï?ìƒÿÿÿÿï?fQþÿÿÿï?W*úÿÿÿï?ŽÏêÿÿÿï?M–¶ÿÿÿï?Óÿÿÿï?7©üÿÿï?ç– ôÿÿï?åI×ÿÿï?ÆŸrÿÿï?ç þÿï?¤=3vùÿï?°£‘éÿï?IÁü<³ÿï?š8,úþï?‚•%õ†üï?«ZÛJôï?Þva|Ùï?¸[Ï‚ï?®w7`'—î?QGyì?.<ͶÈ}é?K§Lu-ç?Ò_ëæ?¦K¥XŸå?ÔÜIïwå?Å%/¦Ukå?Èÿÿÿÿÿï??ÿÿÿÿÿï?dýÿÿÿÿï?øöÿÿÿÿï?Êàÿÿÿÿï?2”ÿÿÿÿï?æ‹þÿÿÿï?Ôüúÿÿÿï?déíÿÿÿï?ÃÁÿÿÿï?Ì!*ÿÿÿï?ƒ."ýÿÿï?þs.öÿÿï?ÕgoÞÿÿï?Oå…ÿÿï?ˆäžzþÿï?¹±Ô×úÿï?Z‚H•îÿï?=ÐÅsÅÿï?×U<ÿï?E@wýï?+)ü­÷ï?¸ ¼ó#åï?O]}í«ï?¦” -Kï?I‰§l•í?ßåúÁ2ë?µ¢²[yè?§ÝpÔæ?Ò_ëæ?Æ}¹{;¼å?¦K¥XŸå?Ðÿÿÿÿÿï?\ÿÿÿÿÿï?Ìýÿÿÿÿï?jøÿÿÿÿï?îåÿÿÿÿï?Цÿÿÿÿï?jÍþÿÿÿï?àæûÿÿÿï?BUñÿÿÿï?ìüÍÿÿÿï?JÓUÿÿÿï?¨V¾ýÿÿï?}€\øÿÿï?ó99æÿÿï?œŒV©ÿÿï?¬OäÝþÿï?ÿãÄ9üÿï?$ÀVóÿï?Ö;ðÖÿï?¾±Azÿï?wyf;Qþï?0ö¬—¨úï?Ru¢bïï?B4u ãÍï? Æ×úuï?®w7`'—î?²‡xáì?¡¾2*ë‹ê?µ¢²[yè?K§Lu-ç?Xó,‡æ?´Î¦"-Eæ?Øÿÿÿÿÿï?zÿÿÿÿÿï?6þÿÿÿÿï?âùÿÿÿÿï?'ëÿÿÿÿï? ¹ÿÿÿÿï?òÿÿÿÿï?ÜÎüÿÿÿï?±ôÿÿÿï?µÜÙÿÿÿï?ØÅÿÿÿï?U^Rþÿÿï?3fúÿÿï?ÐÊdíÿÿï?n‹ƒÂÿÿï?p26ÿÿï?F,ˆmýÿï?¥Ä2¯÷ÿï?Õ°cåÿï?“Ånâ«ÿï?üù[úþï?pÛ“âßüï?^B'´®öï?} ºn"åï?Žù´]*¹ï?Ìh—´¯Jï?ðÌòâ>bî?²‡xáì?ßåúÁ2ë?.<ͶÈ}é?µ¢²[yè?RX!iè?áÿÿÿÿÿï?–ÿÿÿÿÿï?šþÿÿÿÿï?Fûÿÿÿÿï?ðÿÿÿÿï?(Êÿÿÿÿï?ôJÿÿÿÿï?¡ýÿÿÿï?ϲ÷ÿÿÿï?B\äÿÿÿï?xZ¤ÿÿÿï?¸‰Ñþÿÿï?`üÿÿï?\KXóÿÿï?:sÿÖÿÿï?4^;|ÿÿï?j8‹\þÿï?åñ“×úÿï?æÚúïÿï?lOžÏÿï?ÉÍsmÿï?.Tš&Qþï?t‹®E5ûï?¸ÍÐÚÙòï?–ØÙßï?('F*7¯ï?Ìh—´¯Jï?®w7`'—î?I‰§l•í?QGyì?ì,6*˜ë?ßåúÁ2ë?èÿÿÿÿÿï?°ÿÿÿÿÿï?ôþÿÿÿÿï?~üÿÿÿÿï?Dôÿÿÿÿï?ÞØÿÿÿÿï?ó}ÿÿÿÿï?fQþÿÿÿï?q0úÿÿÿï?hîìÿÿÿï?ÞÀÁÿÿÿï?6ÿÿÿï?uýÿÿï?+Þ÷ÿÿï?v68æÿÿï?U¦¯ÿÿï?ªî+ÿÿï?>­èýÿï?³›Îûöÿï?(ׂbåÿï?BQ€5³ÿï?¸Ómn(ÿï?‹c¶ ¶ýï?/~ÙÚ úï?Q®Ÿ³Üñï?–ØÙßï?Žù´]*¹ï? Æ×úuï?¦” -Kï?®w7`'—î?š]p‹&î?2¹[)âí?îÿÿÿÿÿï?Æÿÿÿÿÿï??ÿÿÿÿÿï?€ýÿÿÿÿï?º÷ÿÿÿÿï?¼äÿÿÿÿï?Цÿÿÿÿï?ÚÛþÿÿÿï?æJüÿÿÿï?xôÿÿÿï?¨’Ùÿÿÿï?–…ÿÿÿï?n@}þÿÿï?|ŽEûÿÿï?Pö[ñÿÿï?øB8Óÿÿï?æÚõxÿÿï? \doþÿï?Ú…rûÿï?„*, óÿï?”gÜÿï?Æ`ªaŸÿï?ŽO¦±ÿï?ÖL¼x“ýï?PŠÇLúï?L9fŒkóï?âJÕEæï?#,êäðÏï?('F*7¯ï?²ôäq‡ï?êÜaï?Ìh—´¯Jï?ôÿÿÿÿÿï?Øÿÿÿÿÿï?zÿÿÿÿÿï?Hþÿÿÿÿï?dúÿÿÿÿï?Âíÿÿÿÿï?üÄÿÿÿÿï?$Bÿÿÿÿï?¡ýÿÿÿï?Ìxøÿÿÿï?~Hèÿÿÿï?Ðíµÿÿÿï?°ëÿÿÿï?ÞSCýÿÿï?&¦»÷ÿÿï?bçÿÿï?ãå·ÿÿï?®Û¼0ÿÿï?4M¹ýÿï?ÚÕÐÀùÿï?ν¸[ïÿï?EÚ&Õÿï?Ž‚=ý•ÿï?ŽO¦±ÿï?®9øÐýï?:Ï\kûï?jaT]÷ï?,b7‚ðï?âJÕEæï?.þÒ°Úï?#,êäðÏï?ä ^¸]Éï?øÿÿÿÿÿï?äÿÿÿÿÿï?¦ÿÿÿÿÿï?Þþÿÿÿÿï?Wüÿÿÿÿï?Dôÿÿÿÿï?šÚÿÿÿÿï?œ‰ÿÿÿÿï?æ‹þÿÿÿï?îwûÿÿÿï?Èÿñÿÿÿï?-Õÿÿÿï?`|~ÿÿÿï?n@}þÿÿï?Žûÿÿï?°Ðóÿÿï?x¼ÿÿÿÿï?â8ÿÿÿÿï?0¾ýÿÿÿï?xŠùÿÿÿï?†Ìíÿÿÿï?ž”Íÿÿÿï?8õvÿÿÿï?®L“þÿÿï?”Lüÿÿï? ÆŸöÿÿï?xeòèÿÿï?(%Éÿÿï?vF*‚ÿÿï?rWçêþÿï?4M¹ýÿï?Ú…rûÿï?j9Rc÷ÿï?j0q±ðÿï?ÆþL“æÿï?ªÄlÃØÿï?àT Èÿï?= M¢¶ÿï?º ©å§ÿï?Æ`ªaŸÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?ôÿÿÿÿÿï?Øÿÿÿÿÿï?Šÿÿÿÿÿï?šþÿÿÿÿï?Øûÿÿÿÿï?¾óÿÿÿÿï?BÜÿÿÿÿï?™ÿÿÿÿï?ÚÛþÿÿÿï?ÜÎüÿÿÿï?8÷ÿÿÿï?~Hèÿÿÿï?è9Áÿÿÿï?<ˆ]ÿÿÿï?RÑeþÿÿï?΃üÿÿï? ÆŸöÿÿï?ëgêÿÿï?òlÐÿÿï? šÿÿï?®Û¼0ÿÿï? \doþÿï?%c#ýÿï?$–Æûÿï?¶~døÿï?Töôÿï?ν¸[ïÿï?¸4¥êÿï?ÆþL“æÿï?FU$Käÿï?ð?þÿÿÿÿÿï?øÿÿÿÿÿï?êÿÿÿÿÿï?¾ÿÿÿÿÿï??ÿÿÿÿÿï?Ìýÿÿÿÿï?žùÿÿÿÿï?Âíÿÿÿÿï?Ìÿÿÿÿï?qÿÿÿÿï?^yþÿÿÿï?àæûÿÿÿï?œ4õÿÿÿï?4+äÿÿÿï?jé¹ÿÿÿï?&Tÿÿÿï?RÑeþÿÿï?”Lüÿÿï?&¦»÷ÿÿï?s²;îÿÿï?xð?)Dð?sGð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?%ð?Lð?˜ð?(ð?.ð?úð?ð?ò ð?™ð?ìð?ß.ð?Að?†Zð?‡xð?K™ð? ºð?M×ð?híð?Rùð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?0ð?eð?Ôð?°ð?Yð?mð?ò ð?vð?/%ð? >ð?zcð?™ð?M×ð?€/ð?’˜ð? ð?–ð?Õêð?Ä:ð?ÿeð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?7ð?|ð?ð?Gð?¼ð? ð?»ð?‚#ð?Að?Èrð?öÂð?>ð?:ñð?æÅð??öð?²eð?ð?;¢ð?6 ð?¬> ð?ÁÛ ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?<ð?Œð?Bð?Ñð?'ð? ð?õð?ë5ð?Xhð?úÂð?_ð?Ì_ð?¨ñð?îEð?½ ð?1 ð?4ð?4ßð?rµð?K #ð?ó$'ð?²`)ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?<ð?’ð?^ð?5ð?Uð?[ð?ƒ#ð?ãJð?™ð?Æ.ð?Bð?Ï&ð?ÌUð?´l ð?1!ð?rµð?L¾+ð?÷4=ð?â;Qð?|fð?wWyð?^;ˆð?6`ð?ð?ð?ð?ð?ð?ð?ð?ð?8ð?Œð?^ð?Yð?ð?»ð?º*ð?á^ð?µÌð?0¬ð?kbð?ò›ð?ùl ð?Roð?MÍ&ð?-@ð?`h`ð?6`ð?WÍð?jÅð?V^ð?~Ó£ð?¶üÙð?¾÷ð?ð?ð?ð?ð?ð?ð?ð?-ð?|ð?Bð?4ð?ð?šð?ã.ð?rmð?Òøð?Ã%ð?â™ð?b‰ ð? ð?¸$ð?ÜØCð?ÿwð?Z’Êð?’½6ð?¶üÙð?©¬ð?æ¥ð?±°ð?–@«ð?«—pð?*ŒÝð?ð?ð?ð?ð?ð? ð?#ð?að?ð?Ñð?Vð?»ð?â.ð?Ìrð?rð?Rð?¨ð?Km ð?±jð?­06ð?Bøjð?Q—Êð?’oð?øyð?jÞáð?u¦ ð?Ë&âð?}¿N ð?dÿð?¾‚“ð?£Þcð?«Éóð?ð?ð?ð?ð? ð?ð?Ið?Êð?Fð?'ð?[ð?º*ð?rmð?rð?j ð?ZFð?:•ð?äã ð?nÌGð?†E—ð?D¬2ð?0RTð?§uTð?ùæªð?}¿N ð?¾‚“ð?@Ò[ð? b)ð?ÄG«6ð?ª…Cð?ªëÏMð?I¶Sð?ð?ð?ð?ð?ð?3ð?‘ð?ð?¼ð? ð?ƒ#ð?â^ð?Òøð?Rð?XFð?|bð? ¹$ð?ÜUð?¿ð? žð?Ò}_ð?Þø¾ð?\Aä ð?îKsð?©üž&ð?¼Ýê>ð?OÝn`ð?÷XŒŠð?uçø¹ð?ÙõŒèð?nGð?%î#ð?ð?ð?ð? ð?!ð?að?ð?1ð? ð?õð?ãJð?µÌð?Ã%ð?¨ð?:•ð? ¹$ð?SZð?käÖð?Q›ðð?N˜Tð?‡RN ð? ê-ð?üMÂ%ð?i.¶Fð?uÄwð?¼ÛMÈð?HSy:ð?vë€Íð?vð?*1˜ð?l9ªð?½Îøð?ð?ð?ð?ð?;ð?³ð?ð?!ð?»ð?ë5ð?™ð?0¬ð?â™ð?Lm ð?äã ð?ÜUð?käÖð?ÞÈð?‰Néð?bŽO ð?“ð?n“d5ð?8Sˆlð?ƒLÁÑð?:ŽNnð?vð?½Îøð?Ù¾ÿ÷ð?åô'Rð?~“´· ð?Išc¶ ð?ÔyÚ ð?ð?ð? ð?"ð?ið?@ð?Ëð?f ð?‚#ð?Whð?Æ.ð?kbð?c‰ ð?±jð?nÌGð?¿ð?R›ðð?ˆNéð?J8 ð?»ð?¦›æAð?Þ‘ð?îªB1ð?Ôrbð?ö XNð?K§ð?Išc¶ ð?Õ«ažð?Uáúð?ì”-¯$ð?kĤ ,ð?Þ­¼O0ð?ð?ð?ð?9ð?³ð?,ð?²ð?zð?Að?úÂð?Bð?ó›ð? ð?­06ð?†E—ð? žð?N˜Tð?bŽO ð?»ð? ˸Fð?§¨ð? ›ð?ÿÊBEð?Š2`Éð?Išc¶ ð?³(.hð? Á0(ð?òê?ð?ÑXî…]ð? êÿ*}ð?ågUw˜ð?,ÞÚm¨ð?ð? ð?ð?]ð?'ð?¢ð?f ð?{#ð?Èrð?_ð?Ï&ð?ùl ð?¸$ð?Bøjð?D¬2ð?Ò}_ð?‡RN ð?“ð?¥›æAð?§¨ð?W×1žð?«³nÖð?”ýB¶ð?^hšÐð?Yâ¤e&ð?Â*8Ið?Âäçö‚ð?†K²n×ð?ý}™Dð?1`'º¼ð?…ýÕ¨&ð?}…ueð?ð?ð?-ð?‘ð?Õð?Þð?³ð?2;ð?öÂð?Ë_ð?ÌUð?Roð?ÜØCð?Q—Êð?0RTð?Þø¾ð? ê-ð?n“d5ð?Þ‘ð? ›ð?«³nÖð?Dp¯y ð?pdºmð?‹úc‘2ð?ªåËkð?Jy×ð?ØH‰9ð?Æp)1¬ð?e 1*ð?œŽêÜð?H;ø!fð?lÂõRð?ð?ð?Cð?Üð?Îð? ð?‚ð?î^ð?>ð?¨ñð?´l ð?MÍ&ð?ÿwð?’oð?§uTð?\Aä ð?üMÂ%ð?8Sˆlð?îªB1ð?þÊBEð?”ýB¶ð?qdºmð?°Yù{7ð?ÿzñý‚ð?8;™Æ$ð?J'óÁeð?uýå"ªð?fg¬Sð?oCÒbz ð?4Eضð?Ú2Ÿ7ð?7Ðdn®ð? ð?ð?að?@ð?#ð?¢ ð?»,ð?’ð?:ñð?îEð?1!ð?-@ð?Z’Êð?øyð?úæªð?îKsð?j.¶Fð?ƒLÁÑð?Ôrbð?Š2`Éð?^hšÐð?‹úc‘2ð?ÿzñý‚ð?_È‹¹Dð?]@°®ûð?PæM –ð?0ïÝ-{ ð?f!v§9ð?Þ0£>ƒ*ð?Xª_î¦?ð?®ØEÃSð?Ô3OH;`ð? ð?(ð?†ð?Áð?Þð?‘ð?Að?M×ð?Èçð?̈ ð?‘ð?÷ýdð?ÿ~Eð?ìýð?Ðäã ð?F-r(ð?à j}ð?ºÐ‹ð?‚ð?•¶ÊN ð?Yâ¤e&ð?ªåËkð?8;™Æ$ð?]@°®ûð?j¤˜gð?ð«´Cð?å¦ý×@%ð?˜$¬hÿHð?ÉýÎ/^ð?T8.¾²Âð?&k˜ vñ??ohŽ)ñ?ð?5ð?³ð?]ð?üð?ìð?†Zð?€/ð?˜&ð?àÑ ð?ÄÒ-ð?$;—ð?Puðð?TÚSð?€F€ð?RâAð?ŒoºÑð?‘{6”ð?Zwð?•ñÙð?Â*8Ið?Jy×ð?K'óÁeð?PæM –ð?ð«´Cð?¨âñ…*ð?T"<½C`ð?é?â¶Âð?%\Áµ/Vñ?©Áfâò?¨)HƘò?aòaŠîò?ð?Cð?åð?ð?m ð?{#ð?‡xð?’˜ð?§ð?¦ð?@ð?ÖÐÖð?uæÌð?žšM ð?Š:¾ð?iødð?ÐXÜžô?¨ß¶îâô?2¥üIõ?ð?Rð?ð?Ëð? ð?»,ð?K™ð? ð?`Uð?Šð?\Uð?«Ô ð?¿Ñð?cã ð?2ºT+ð?ÈÝ ‘ð?MÌãð?ÌJW?ð?Ⲉð?¨=YàBð?†K²n×ð?Æp)1¬ð?fg¬Sð?g!v§9ð?˜$¬hÿHð?é?â¶Âð?h"ú/Âñ?¬b/–Jó?±KÁÏïâô?x’·Iõ ö?Ñ ×í®ö?õáþ]Wóö?ð?að?Nð?„ð?›ð?ç5ð? ºð?–ð?N ð?vð?ïjð?¿ènð?Æèð?(LÈð?8=9ð?Ø—°Âð?`”ð?ßì`µð?è¢WFð?ms¢×að?ý}™Dð?e 1*ð?oCÒbz ð?Þ0£>ƒ*ð?4#uïzð? ˜…­ŒNñ?+¡E&+ëò?œÞ7ƒŒëô?QØÖ‘Amö?×ô.7÷?B-<aŽ÷?BR½HÙ­÷?ð?mð?{ð?%ð?ßð? >ð?M×ð?Õêð?9˜ ð?Ú´$ð?uð?e«·ð?´ïð?*[ð?òv°Fð?>œoóð?ñçDð?‘ÄA7 ð?ª2æa&ð?Óvî‚ð?1`'º¼ð?œŽêÜð?5Eضð?Xª_î¦?ð?–Š0—¼¼ð?áÙQ^ûñ?lú²çÒô?¦ eQö?×ô.7÷?BR½HÙ­÷?˜TŠQÙ÷?yHŽYç÷?"ð?vð?ð?žð?‘ð?)Dð?híð?Ä:ð?aÇ ð?)ð?®Žð?•`ðð?GM¾ð?4iqð?H-vQð?)èêð?`ŒòÕð?ªöwM ð?Â0Ë.ð?Ñ¡xŸð?…ýÕ¨&ð?H;ø!fð?Ú2Ÿ7ð?®ØEÃSð?I:Ævûð?; ÁW¸“ò?œÞ7ƒŒëô?‡`+‰@ºö?B-<aŽ÷?˜TŠQÙ÷?aŸi:~ñ÷?Ý3Úð–ø÷?#ð?{ð?®ð?Þð?zð?sGð?Rùð?ÿeð?åk ð?ÐV+ð?5—ð?ø‡ð?H]0ð?Äð?h‹zWð?œ1ð?7W*(ð?“Xþ~ð?Ù!¾Š2ð?$Г(°ð?}…ueð?lÂõRð?7Ðdn®ð?Ô3OH;`ð? ôGt1"ñ?+¡E&+ëò?Aî°pTõ?8ù¿!‡ýö?BR½HÙ­÷?yHŽYç÷?Ý3Úð–ø÷?%C‚ý÷?#ð?{ð?®ð?Þð?zð?sGð?Rùð?ÿeð?åk ð?ÏV+ð?5—ð?÷‡ð?H]0ð?Äð?h‹zWð?œ1ð?7W*(ð?“Xþ~ð?Ù!¾Š2ð?$Г(°ð?}…ueð?lÂõRð?6Ðdn®ð?Ô3OH;`ð? ôGt1"ñ?+¡E&+ëò?Aî°pTõ?8ù¿!‡ýö?BR½HÙ­÷?yHŽYç÷?Ý3Úð–ø÷?%C‚ý÷?"ð?vð?ð?žð?‘ð?)Dð?híð?Ä:ð?aÇ ð?)ð?®Žð?•`ðð?GM¾ð?5iqð?H-vQð?)èêð?`ŒòÕð?ªöwM ð?Â0Ë.ð?Ñ¡xŸð?…ýÕ¨&ð?H;ø!fð?Ú2Ÿ7ð?®ØEÃSð?I:Ævûð?; ÁW¸“ò?œÞ7ƒŒëô?‡`+‰@ºö?B-<aŽ÷?˜TŠQÙ÷?aŸi:~ñ÷?Ý3Úð–ø÷?ð?mð?{ð?%ð?ßð? >ð?M×ð?Õêð?:˜ ð?Ú´$ð?uð?e«·ð?´ïð?*[ð?òv°Fð?>œoóð?ñçDð?’ÄA7 ð?ª2æa&ð?Óvî‚ð?1`'º¼ð?œŽêÜð?5Eضð?Xª_î¦?ð?–Š0—¼¼ð?áÙQ^ûñ?lú²çÒô?¦ eQö?×ô.7÷?BR½HÙ­÷?˜TŠQÙ÷?yHŽYç÷?ð?að?Nð?„ð?›ð?ç5ð? ºð?–ð?N ð?vð?ïjð?¾ènð?Æèð?(LÈð?8=9ð?Ø—°Âð?`”ð?ßì`µð?è¢WFð?ls¢×að?ý}™Dð?d 1*ð?oCÒbz ð?Þ0£>ƒ*ð?4#uïzð? ˜…­ŒNñ?+¡E&+ëò?œÞ7ƒŒëô?QØÖ‘Amö?×ô.7÷?B-<aŽ÷?BR½HÙ­÷?ð?Rð?ð?Ëð? ð?»,ð?K™ð? ð?_Uð?Šð?[Uð?«Ô ð?ÿÑð?cã ð?2ºT+ð?ÈÝ ‘ð?NÌãð?ÌJW?ð?ᲈð?¨=YàBð?†K²n×ð?Æp)1¬ð?fg¬Sð?g!v§9ð?±×'T1Fð?–Š0—¼¼ð?ñt€ ºñ?ýšâRpIó?œÞ7ƒŒëô?¦ eQö?‡`+‰@ºö?8ù¿!‡ýö?ð?Cð?åð?ð?m ð?{#ð?‡xð?’˜ð?~§ð?¦ð?@ð?ÖÐÖð?uæÌð?žšM ð?Š:¾ð?€iødð?Ðð?Ûºo ð?ƒ‹ð?l9ªð?åô'Rð?yü ùð?ì”-¯$ð?Âöð? ºð?•'ð?›Nð?4ð?§·3ð?6`ð?l2‹ð?î,"ð?x Ì ð?›qmð?ª…Cð?Ûºo ð?:ŽNnð?*1˜ð?‹l{ð?Išc¶ ð?³(.hð? Á0(ð?òê?ð?ÑXî…]ð? êÿ*}ð?ågUw˜ð?,ÞÚm¨ð?ð?ð? ð?"ð?ið?@ð?Ëð?f ð?á!ð?cð?è ð?Ä:ð?½ ð?±5ð?d…Dð?©Y¶ð?¶üÙð?±°ð?L͆ ð?›qmð?¼Ýê>ð?÷XŒŠð?%î#ð?ÿFð?ö XNð?K§ð?Išc¶ ð?Õ«ažð?Uáúð?ì”-¯$ð?kĤ ,ð?Þ­¼O0ð?ð?ð?ð?ð?;ð?³ð?ð?!ð?ßð?q3ð?’ð?’˜ð?ôcð?ÁÛ ð? cð?â;Qð?WÍð?¾÷ð?±°ð?x Ì ð?«Éóð?›ú2ð?È”¡gð?¼ÛMÈð?:ŽNnð?vð?½Îøð?Ù¾ÿ÷ð?åô'Rð?~“´· ð?Išc¶ ð?ÔyÚ ð?ð?ð?ð? ð?!ð?að?ð?1ð? ð?¸ð?sGð?QÃð? ð?²eð?fê ð?K #ð?íþUð?WÍð?¶üÙð?î,"ð?Ë&âð?ÙaOð?Ê $ð?ª…Cð?uÄwð?¼ÛMÈð?HSy:ð?vë€Íð?vð?*1˜ð?l9ªð?½Îøð?{®Gáz={®Gáz={®Gáz$={®Gáz$=¸…ëQ¸.=)\Âõ(<=433333C=š™™™™™I=Âõ(\R=­Gáz®W=®Gáz^=Âõ(\b=Ãõ(\Âe=ö(\Âõh== ×£p=j=¸…ëQxƽ{®Gáz={®Gáz={®Gáz½¸…ëQ¸={®Gáz$=z®Gáz$= ×£p= 7={®GázD=)\Âõ(L= ×£p= W=`=Ãõ(\Âe=ÍÌÌÌÌÌl=Âõ(\r=¸…ëQ¸v=efffffz== ×£p=~=Âõ(\€=Ãõ(\ª½{®Gáz={®Gáz½{®Gáz={®Gáz$={®Gáz$=¤p= ×£@= ×£p= G=×£p= ×S=\Âõ(\_=h=> ×£p=r=ëQ¸…ëy=R¸…ëQ‚=ffffffˆ=™™™™™™=…ëQ¸…“=…ëQ¸—=Gáz®Gš=…ëQ¸…œ=…ëQ¸¶={®Gáz={®Gáz={®Gáz=¸…ëQ¸.= ×£p= 7=R¸…ëQH=333333S== ×£p=b=¹…ëQ¸n=¤p= ×£x=Ãõ(\ƒ=š™™™™™=ÍÌÌÌÌÌ•=š™™™™™ž=43333³¤=×£p= ת== ×£p½°=¯Gázî³=ÍÌÌÌÌ̶=¤p= ×ã¸=š™™™™ÙÐ={®Gáz={®Gáz½¸…ëQ¸.=ìQ¸…ë1=ìQ¸…ëA=433333S=ìQ¸…ëa=®Gáz®o=(\Âõ(|=R¸…ëQˆ= ×£p= ”= ×£p=  =¤p= ×£¨=33333s²=Gáz®‡¹=ö(\ÂuÁ={®GáÚÆ=q= ×£°Ì=Ház®7Ñ=R¸…ëÁÓ=ëQ¸…«Õ=z®Ga–¾{®Gáz={®Gáz½{®Gáz$=¸…ëQ¸={®Gáz4=âz®GáJ=> ×£p=Z=ìQ¸…ëi=Ház®Gy=Ház®G‡=Ø£p= ×”=¤p= ×#¢=ÍÌÌÌÌL®== ×£p}¸=®GázÃ= ×£p=êÌ=ÍÌÌÌÌ<Õ={®GáZÝ=43333kã=Ãõ(\’è=ëQ¸…³í=R¸…ë!ñ=R¸…ëÙò=\Âõ(°¾{®Gáz=º…ëQ¸=ìQ¸…ë1=ìQ¸…ëA=Ház®GQ=> ×£p=b=áz®Gár=ö(\Âõ‚=R¸…ëQ’=ÍÌÌÌÌL¡= ×£p=Н=Ö£p= ×»=…ëQ¸¾Ç= ×£p=zÓ=fffffÆÞ=®Gáz¶ç=­Gázšñ=Ø£p= Ÿø=R¸…ëu>®Gáz>…ëQ¸— >q= ×£° >™™™™™e>ÌÌÌÌL—!>{®Gáz={®Gáz=¸…ëQ¸.=ìQ¸…ëA={®GázT=¸…ëQ¸f=Ház®Gy=> ×£p=Š=Âõ(\š=ö(\Âuª=¯Gázn¹=)\Âõ¨Ç=¤p= ×CÕ=Âõ(\oâ=š™™™™Éî=…ëQ¸µø=Ãõ(\X>¹…ëQ >R¸…ë•>®Gáz×>…ëQ8ò!>¸…ëÑ&>< ×£ðµ)>¸…ëQ„,> ×£pýM>>{®Gáz={®Gáz=ìQ¸…ë1=433333C=®Gáz®W=433333k= ×£p= =Âõ(\Â=ö(\Âõ¡=®Gáz®²=gffffæÂ=Ãõ(\‚Ò=ö(\Âá=)\Âõð=p= ×£hü=ìQ¸…%>fffff¶>z®Gág>ëQ¸…â'>q= ×ã&1>¸…ëQ{7>= ×£°—>>\ÂõèïB>Âõ(<@F>®Gá:ÊH>×£p=eF‘¾{®Gáz={®Gáz½{®Gáz=ìQ¸…ë1=433333C=š™™™™™Y= …ëQ¸m=q= ×£p=Ø£p= ד=Ház®G¦=Ãõ(\B¸=ìQ¸…ËÉ=fffff–Ú=)\Âõ˜ê=43333¿ù=ëQ¸…>…ëQ¸®>áz®ÇÈ">®Gáz”;/>š™™™X9>Âõ(ü‡C>R¸…KxL>{®GA¿S>š™™™‰Z>= ×£`B`>Âõ( >c>Âõ(ôŠe>Ház0v¾{®Gáz={®Gáz½š™™™™™)=z®Gáz$=333333C=®Gáz®W= …ëQ¸m=> ×£p=‚={®Gáz•=ÍÌÌÌÌL©=áz®Gá¼=Âõ(\Ð=ÍÌÌÌÌ|á=ÌÌÌÌÌpò=š™™™™Ù>¥>> ×£ðÍ!>…ëQ¸`0>q= ×cõ<>33333ŒH>R¸… RT>¯GázdÃ_>ÍÌÌÌì…g>¸…ëp>…ëQ¸âv>š™™™Éà{>q= ×a €>š™™™µ¶‚>HázŽ”>{®Gáz={®Gáz={®Gáz$=¹…ëQ¸>=ffffffV=Ø£p= ×k=q= ×£p={®Gáz•=q= ×£pª=ÍÌÌÌÌŒ¿=R¸…ëqÒ=†ëQ¸å=áz®GU÷=š™™™™) >R¸…ëP>= ×£p *>Ö£p=Š:>¸…ëQuH>*\ÂEV> ×£p…c>×£p=®,p>q= תy>®GáŒVƒ>Ãõ(\—£‹>áz®°’>âz®ÀÛ—>†ëQ¸Z´œ>4333·? >ÍÌÌŒn>±>{®Gáz=š™™™™™)=*\Âõ(<=¤p= ×£P= ×£p= g=®Gáz€=Ø£p= ד=ÌÌÌÌÌL©=ÍÌÌÌÌŒ¿= ×£p=JÓ=gffffç=¸…ëQäú=…ëQ¸Œ>ö(\BÞ >À2>×£p=ЏB>š™™™y¹R>R¸…kb>Âõ(\{ªp>3333¯}>ffffÚ‰‰>…ëQ¸G–”>š™™™×œŸ>Ö£p=ú¦>®Gaƒˆ¯>š™™Ù¦`´>ëQ¸À¸>·…+ï3¼>âzÎ +È>{®Gáz={®Gáz½{®Gáz=¹…ëQ¸.=š™™™™™I=433333c=¤p= ×£x=q= ×£p‘=Ház®G¦=áz®Gá¼=R¸…ëqÒ=gffffç=|®Gá2ü=Ház®Ö>ffffæ˜#>Âõ(Ü-6>q= ×CZH>)\Â…àY>âz®GŠj>Ø£p=3z>®GázÒˆ>Âõ(9–>z®Ç¨ù£>\Âuü`°>ázîN«¹>S¸elÃ>¸…kS‚Ê>¤p= 9]Ñ>…ëQ(PÕ>]ÂùuØ>°—äÜ>{®Gáz={®Gáz=¸…ëQ¸.=333333C=áz®GáZ=Âõ(\r={®GázŠ=®Gáz®¢=Âõ(\B¸=Âõ(\Ð=„ëQ¸å=¸…ëQäú=Ház®Ö>{®Gáš$>Âõ(\–8>ö(\â‹L>…ëQ¸¦`>> ×£Œq>Âõ(Úz‚>gfffM»’>…ëÑW7¢>> ×£uð°>q= WKë¾>)\Â$ÑÉ>ÍÌÌ,c¯Ô>®Gá*Bß>…ë±I1æ>š™™ +ƒí>š™™-Sò>> ××C3õ>433ï³Jô>{®Gáz={®Gáz½{®Gáz$= ×£p= 7=×£p= ×S=ëQ¸…ëi=…ëQ¸ƒ=¸…ëQ¸š=ö(\Âu³=ìQ¸…ËÉ=ÍÌÌÌÌ|á=áz®GU÷=…ëQ¸Œ>ffffæ˜#>Âõ(\–8>Ø£p=ÊN>z®GÑña>×£p=ÞÆt>Ház¼L‡>\Âõ{;™>3333˜Mª>p= —Mº>¯Gáš$É> ×£g¤×>ìQ¸Æ‚ ä>|®¸…ð>âz Ó‡ù>> ×Eè|?êQ¸8Øÿ?fffûs?(\:Ø[?ö(\4v ?{®Gáz=¸…ëQ¸={®Gáz$=R¸…ëQH=¤p= ×£`=…ëQ¸y=…ëQ¸…’=…ëQ¸žª=ö(\µÃ=fffff–Ú=ÌÌÌÌÌpò=š™™™™) >ö(\BÞ >Âõ(Ü-6>ö(\â‹L>z®GÑña>®Gáz<üu>ÍÌÌÌn.Š>\Âõú7ž>š™™‰Ù°>q= ·úÂ>fff†Ð£Ò>333 €Yâ>Ház DÔñ>Äõ(Pzýþ>˜™™Õ ?…ëQ¨¤¯?º…øóŸ?…ë¼n%?fffv-ï*?S¸ž-zÃ/?IázUüA1?{®Gáz={®Gáz$=¤p= ×£@=333333S=)\Âõ(p=\Âõ(\‡=ö(\Âu¡=)\Âõ¨¹=®GázTÓ=)\Âõ˜ê=š™™™™Ù>R¸…ëP>À2>q= ×CZH>…ëQ¸¦`>×£p=ÞÆt>ÍÌÌÌn.Š>\Âõ»  >Ãõ(Üѳ>êQ¸ ôÅ>ö(\SØ> ×£à\Ýé>333û¾Gú> ×£øøv ?r= »ƒ?®Ç­·g$?q=Êa:š0?…«VC09?Q¸¾Yö·A?33³˜¢G?Ø£ØDqK?¹E ^ÿM?¹…ëQ¸.=z®Gáz$= ×£p= G== ×£p=b=…ëQ¸…{=> ×£p=•=°= ×£p=êÇ=)\ÂõXâ=33333¿ù=¥>= ×£p *>×£p=ЏB>)\Â…àY>> ×£Œq>Ház¼L‡>\Âõú7ž>Ãõ(Üѳ> ×£0+lÇ>p= 7NÑÛ>¸…‹cÛï> ×£v%„?ázã@i?¹8 H#?…+ú>‰1?Ø£0!ml??®§Ñ0YJ?¸UQâŠT?(\?l˜]?®GÑu»“c?×£Ðvæªg?®G g j?{®Gáz4= ×£p= 7=×£p= ×S=¹…ëQ¸n=Ãõ(\‡=áz®Ga¢=Âõ(\O¼=Âõ(\’Õ=Âõ(\Óð=ëQ¸…>> ×£ðÍ!>Ö£p=Š:>š™™™y¹R>âz®GŠj>Âõ(Úz‚>\Âõ{;™>š™™‰Ù°>ëQ¸ ôÅ>p= 7NÑÛ> ×£@Ìñ> ×£ò`@?ö(\©Ê?ázï¼&)?¸?Ö9?®'#J£I?ìQXœdÉW?¥pÍ/ïžd?Ãõ@ ù“p?®;úˆx?ÍÌÐL•€?ìs[„?\±ª”†?)\Âõ(<={®GázD=\Âõ(\_=¤p= ×£x=£p= ×£“=†ëQ¸¯=ö(\Â5È=…ëQ¸Æâ=¤p= ׿ý=…ëQ¸®>…ëQ¸`0>¸…ëQuH>R¸…kb>Ö£p=3z>gfffM»’>4333˜Mª>q= ·úÂ>õ(\SØ>¸…‹cÛï> ×£ò`@?gffÐ#å?¤p=ÆFt-?gf& ¨®@?`TüQ?)\¥Úc?33÷Ÿ _r?\$«ãf€?ÎÌ,‰ ‹?…|0Qm”?gf“ÂE œ?)\lc€d¡?}žäQ£?R¸…ëQH=)\Âõ(L=h=Ãõ(\ƒ=[Âõ(\Ÿ=áz®G!¹=43333óÓ=43333{ï=Äõ(\N >áz®ÇÈ">q= ×cõ<>*\ÂEV>Âõ(\{ªp>®GázÒˆ>…ëÑW7¢>p= —Mº>fff†Ð£Ò> ×£à\Ýé> ×£v%„?ö(\©Ê?£p=ÆFt-?Äõ(à˜B?ìQ¸ëbU?ÿÿ_8å h?Há¶Ö8“y?43㜯„‰?33ìlV«—?¤p[–á5¤?33¾$v¯?™™ƒ†¶?šÙ é"â»?BFkv/¿?ìQ¸…ëQ= ×£p= W=> ×£p=r=š™™™™™=¸…ëQ8¨=…ëQ¸žÃ=ö(\Â¥ß=Âõ(\^ù=×£p= ­>®Gáz”;/>33333ŒH> ×£p…c>3333¯}>Âõ(9–>> ×£uð°>¯Gáš$É>333 €Yâ>333û¾Gú>ázã@i?âzï¼&)?ff& ¨®@?ìQ¸ëbU?Q¸®]VXj?Ø£LÓù~?\!o<‘?ÃõfÅ0ý¡?¸Þ5ÉOi±? Wªaá¾?®„ÔÙÈÈ?×ã‘eñÏÑ?3¥­ÁÖ?FQ™U™‹Ù?ö(\ÂõX=`=ëQ¸…ëy=ÍÌÌÌÌÌ•=q= ×£ð±=¹…ëQxÍ= ×£p=è=ž>Ãõ(\1 >®Gá:Ý8>= ×£ÐçS>Ãõ(\¢o>™™™™Mìˆ>ëQ¸ž¹r£>ÌÌÌ I¾>Âõ¸ŒáÖ>ö(\Cp0ñ>…ëQ¶f ?®Çlg"?zîEë:?`TüQ?ÿÿ_8å h?Ø£LÓù~?gf(–“? Wç‰xC¦?ÀÅpâS¸?>(n†È?G±lÖ?æ¸7ÆIâ?qµdÞvLê?gª(þò¢ð?ñ‚ ’iò?š™™™™™a=Ãõ(\Âe=R¸…ëQ‚=š™™™™™ž=Gáz®‡¹=ÍÌÌÌÌ<Õ=­Gázšñ=¹…ëQ >(\ÂõB(> ×£p]êB>*\Â…Ï^>z®Gaðx>š™™™± ”>R¸ø¯>\•±BÉ> ×£ 0Àã>R¸Mà‚þ> ×£<?®‡>ºf1?âz̰ŽI?†ëÙŽˆUb?Há¶Ö8“y?\!o<‘? Wç‰xC¦?š™á‹;»?¢n÷—Ï?Rœ‚4 à?×cÀxÀCí?¹>¡YNÙö?¸*ü`3þ?×dÜxH@×­¸rV“@gffffff=ÍÌÌÌÌÌl=ffffffˆ=43333³¤=ö(\ÂuÁ={®GáZÝ=Ø£p= Ÿø=R¸…ë•>{®Gá[1>¸…ë‘rK>q= ×µf>¸…ë˱‚>hfff„œž>> ×ãRç¸>Ãõ(lÂÔ>®Gið>\³^Š ?R¸žuf$?ö(‰©ò>?HáªæˆW?×£ørߊq?43㜯„‰?ÃõfÅ0ý¡?ÀÅpâS¸?¢n÷—Ï? ·¥¤Uâ?3ÑD¾Pò?Ã5÷öþ?l®Ëm@ÂU#@•@>Ær0˜9ö?™©í»¿ç?×£p= ×k=Âõ(\r=™™™™™™=×£p= ת={®GáÚÆ=43333kã=R¸…ëu>®Gáz×>áz®Ç®7>áz®çôR>âz®‡Îo>(\ –Š>âz® !¦>®GáÈTÂ>˜™™Ùa3Þ>¤p=Êu·ø>ÍÌ̃?…ëøQ(0?> ·ëȺI?p=ʘ8d?âz¨H„C?33ìlV«—?¸Þ5ÉOi±?>(n†È?Rœ‚4 à?3ÑD¾Pò?{çÉU2@ÃC³LP@qµ”‰Ô«í? +dEÇ$ò¿ £•^B@À3Å>¶w À…ëQ¸q=¸…ëQ¸v=…ëQ¸…“== ×£p½°=q= ×£°Ì=Ãõ(\’è=®Gáz>…ëQ8ò!>4333óÁ>>R¸…+âX>†ëQ¸Ö u>¤p= ·ä‘>…ëÑ¿7®>¤p=Ê‘mÉ> ×£õOå>×£pw“Ç?fff‚m€?R¸Þe¹P8?×£ 1¦áS?ëQÝŸp?Ãõ˜7Á»‰?£p[–á5¤? Wªaá¾?G±lÖ?>šˆ_!Bì?ÚrÂþ?SZ`RùG@„ëtÓWÏË?p½©­Ø6À{–EÀ‰À4Qq6¸í À>Þ¶ü`Ò À)\Âõ(t=efffffz=…ëQ¸—=¯Gázî³=Ház®7Ñ=ëQ¸…³í=…ëQ¸— >¸…ëÑ&>)\ÂõüB>áz®Gþ^>®Gázð“z>¯GázÞÀ–>…ëÑq³>®G!9“Ð>Ãõ(DR0ì>\Âm…å?…ëÑW-/$?¹ÆYù@? …;Ïe\?®ïÄ'–w?x˜/h“?33¾$v¯?®„ÔÙÈÈ?R*_¡ûå?™]å|Îö?¸ªÜ¯=@(gA= î?\–(åÀ?&©¡n À|&êê¬À†+·ýÉäþ¿¤œèì ø¿333333w== ×£p=~=Gáz®Gš=ÍÌÌÌÌ̶=R¸…ëÁÓ=R¸…ë!ñ=q= ×£° >< ×£ðµ)>Ø£p=jCF>Âõ(´Jb>= ×£`œ>š™™™·I›>ìQ¸Þ‡·>p= G¢CÔ>R¸Eâlñ>Uê ?¸…ºèŸ)?®GÁ‚‡äE?{Nù­¤b?®wö¯œ?Háòñžš?™™ƒ†¶?×ã‘eñÏÑ? Þ¡ï&ð?R°;m7þ?gj{W{åÿ?\WÍÚ!ñ¿>'»ò À|&êê¬Àáb'÷ø¿ g~‹cªé¿öÈ2C._á¿q= ×£py=Âõ(\€=…ëQ¸…œ=¤p= ×ã¸=ëQ¸…«Õ=R¸…ëÙò=™™™™™e>¸…ëQ„,>\ÂõhÄH>ÎÌÌÌqd>âz®Á>¯GázOÓž>íQ¸ž ¿º>ÍÌÌ\M1×>fff"¶ô>fffHf?\ÂQ[.? ×cHþI?\ªˆÞif?43oJfFƒ? ~3~ ?šÙ é"â»?3¥­ÁÖ?ͳ¨ó™ô?|$Zšj@>>æ‡!Fô?Î ¥A­ÀÀþâ¶ À†+·ýÉäþ¿ g~‹cªé¿ÖC;™ ÜÕ¿ÂÆ7Ûȿףp= ×{=…ëQ¸=ìQ¸…ë= ×£p= º=p= ×£°Ö=×£p= Çó=¸…ëQ<>®Gáz .>¸…ëq J>R¸…ëœe>úÑ‚>*\ÂŽb >fffæà…¼>p= GÊÑØ>)\—õ>ö(\PëÅ?R¸ž©çP0?×£PôßWL?…ë¹áa˜h?HáZrN…?€ø1ìa¢?…+5ïùX¿?Rhü€î»Ù? ÉeƧ)÷?ë[æ$ª@)œù°¦Oç?Š:ÄÀÖ?ç¦H À¤œèì ø¿öÈ2C._á¿ÂÆ7ÛÈ¿ìQü'¹/¹¿×£p= ×k=…ëQ¸=ìQ¸…ë= ×£p= º=p= ×£°Ö=×£p= Çó=¸…ëQ<>®Gáz .>¸…ëq J>S¸…ëœe>úÑ‚>*\ÂŽb >fffæà…¼>p= GÊÑØ>*\—õ>ö(\PëÅ?R¸ž©çP0?Ø£PôßWL?†ë¹áa˜h?HáZrN…?€ø1ìa¢?…+5ïùX¿?Rhü€î»Ù?ÉeƧ)÷?ë[æ$ª@)œù°¦Oç?Š:ÄÀÖ?ç¦H À¤œèì ø¿öÈ2C._á¿ÂÆ7ÛÈ¿ö\ å0å÷?= ×£p=j=Âõ(\€=…ëQ¸…œ=¤p= ×ã¸=ëQ¸…«Õ=R¸…ëÙò=™™™™™e>¸…ëQ„,>\ÂõhÄH>ÍÌÌÌqd>áz®Á>°GázOÓž>ìQ¸ž ¿º>ÎÌÌ\M1×>fff"¶ô>fffHf?\ÂQ[.? ×cHþI?\ªˆÞif?43oJfFƒ? ~3~ ?šÙ é"â»?3¥­ÁÖ?ͳ¨ó™ô?|$Zšj@>>æ‡!Fô?Î ¥A­ÀÀþâ¶ À†+·ýÉäþ¿ g~‹cªé¿ÖC;™ ÜÕ¿ÂjrHÑ?ö(\Âõh== ×£p=~=Gáz®Gš=ÍÌÌÌÌ̶=R¸…ëÁÓ=R¸…ë!ñ=q= ×£° >< ×£ðµ)>Ø£p=jCF>Âõ(´Jb>= ×£`œ>›™™™·I›>ìQ¸Þ‡·>p= G¢CÔ>R¸Eâlñ>Uê ?¸…ºèŸ)?®GÁ‚‡äE?{Nù­¤b?®wö¯œ?Háòñžš?™™ƒ†¶?×ã‘eñÏÑ? Þ¡ï&ð?R°;m7þ?gj{W{åÿ?\WÍÚ!ñ¿>'»ò À|&êê¬Àáb'÷ø¿ g~‹cªé¿šµ6GØ‚ò¿Ãõ(\Âe=efffffz=…ëQ¸—=¯Gázî³=Ház®7Ñ=ëQ¸…³í=…ëQ¸— >¸…ëÑ&>)\ÂõüB>âz®Gþ^>®Gázð“z>®GázÞÀ–>…ëÑq³>®G!9“Ð>Ãõ(DR0ì>]Âm…å?„ëÑW-/$?¹ÆYù@?…;Ïe\?®ïÄ'–w?x˜/h“?33¾$v¯?®„ÔÙÈÈ?¸þì(4(æ?™]å|Îö?¸ªÜ¯=@(gA= î?\–(åÀ?&©¡n À|&êê¬À†+·ýÉäþ¿ 7=[/FÀÂõ(\b=¸…ëQ¸v=…ëQ¸…“== ×£p½°=q= ×£°Ì=Ãõ(\’è=®Gáz>…ëQ8ò!>4333óÁ>>R¸…+âX>…ëQ¸Ö u>¤p= ·ä‘> …ëÑ¿7®>¤p=Ê‘mÉ> ×£õOå>×£pw“Ç?fff‚m€?Q¸Þe¹P8?×£ 1¦áS?ìQÝŸp?Äõ˜7Á»‰?£p[–á5¤? Wªaá¾?×ã↫Ú?Sðàd<í? à6ùžý?4Ë›.9ú@[ïÓ窳Ø?\–(åÀ>'»ò ÀÀþâ¶ À H®À®Gáz^=Âõ(\r=™™™™™™=×£p= ת={®GáÚÆ=43333kã=R¸…ëu>®Gáz×>áz®Ç®7>âz®çôR>âz®‡Îo>)\ –Š>âz® !¦>®GáÈTÂ>˜™™Ùa3Þ>¤p=Êu·ø>ÌÌ̃?…ëøQ(0?> ·ëȺI?p=ʘ8d?âz¨H„C?33ìlV«—?¹Þ5ÉOi±?zF‘Ì?>ªÛ²¢ß?Ì8¹oú÷ñ?H I<ôÜÿ?4Ë›.9ú@(gA= î?\WÍÚ!ñ¿Î ¥A­ÀÂmþaÒÀ­Gáz®W=ÍÌÌÌÌÌl=ffffffˆ=43333³¤=ö(\ÂuÁ={®GáZÝ=Ø£p= Ÿø=R¸…ë•>{®Gá[1>¸…ë‘rK>p= ×µf>¸…ë˱‚>hfff„œž>= ×ãRç¸>Ãõ(lÂÔ>®Gið>]³^Š ?R¸žuf$?ö(‰©ò>?HáªæˆW?×£ørߊq?33㜯„‰?ÃõfÅ0ý¡?zôZÁ»?öh#_6qÎ?3³ùì²á?Ì8¹oú÷ñ? à6ùžý?¸ªÜ¯=@gj{W{åÿ?>>æ‡!Fô?]ÿHp9Ìæ?Âõ(\R=Ãõ(\Âe=R¸…ëQ‚=š™™™™™ž=Gáz®‡¹=ÍÌÌÌÌ<Õ=­Gázšñ=¹…ëQ >„ëQ¸ž(>®GáÚC>Âõ(,*_>×£p=n>y>\Âõ¨N”>…ë@5°>†ëQØå£É>)\:8ä>z®K+ ÿ>®GáIÉ­? ×#/¯Ã1?q=J?$J?®ïÛpËb?> KFzHz?†ëWO}Ñ?¸ž¡`­©? c¯¹º?öh#_6qÎ?>ªÛ²¢ß?Sðàd<í?™]å|Îö?R°;m7þ?|$Zšj@4QÇM½@š™™™™™I=`=ëQ¸…ëy=ÍÌÌÌÌÌ•=q= ×£ð±=¹…ëQxÍ= ×£p=è=ž>R¸…ëÂ>®GázŽ9>ÍÌÌ̬kT>ffffJ1p>Gázüt‰>›™™qУ>¥p= ؾ>333£b,×>ÂõÀ]Yñ>…ëŠ ?…kˆ{n"?ìQ8ëÔ:?áz¤…`ÜQ?Ø£xç¢Èg?*\Oã+ˆ~?Ö£ÂÓÄ’?GáïÄRç¥?™™É™Þ¸?I= ˜_È?×3hÅÝ‚Ö?öswHâ?{l‘8ðê?3÷ùD?!ñ?âºðá”;ü?433333C= ×£p= W=> ×£p=r=š™™™™™=¸…ëQ8¨=…ëQ¸žÃ=ö(\Â¥ß=Âõ(\^ù=Ãõ(\4>)\Âõó/>4333óI>…ëQàzc>¤p= Ÿù}>Ãõ(\tÌ–>)\ÂÁ±>*\ÒRÉ>)\²kâ>? ×ûJú>ÍÌ̧ÖY?Âõ¡ìú(?[⼃@?ØqU?]BÏøi?*\Oã+ˆ~?Q¸×ö‘?…ëÆñqÞ¡?š™%þhq±?B‡jÂI¿?330\ÐnÉ?Íìy;žÒ?¾|ïÿØ×?·žnó­Nã?)\Âõ(<=)\Âõ(L=h=Ãõ(\ƒ=[Âõ(\Ÿ=áz®G!¹=43333óÓ=43333{ï=)\Âõ¤>)\Âõ!#>ÎÌÌÌLn=>Âõ(ìfV>áz®ËÚp>Ãõ(\‰>> ×£¾Q¢>Gáz”F_º>q= Çt¡Ò>¯GáòwÅé>ÌÌÌ Žf?)\BìÜ?¯Gáa-?¤p½w¬äA?ØqU?Ø£xç¢Èg?)\¿Ôey?âz¸Dg‚‰?Âõ>Ä1á—?®Xµ Ÿ¤?ÿ¿¼=\?°?®Çà+ø·?r}.˜gd½?˜™’³%§¿¸…ëQ¸.={®GázD=\Âõ(\_=¤p= ×£x=£p= ×£“=†ëQ¸¯=ö(\Â5È=…ëQ¸Æâ=\Âõ(àü=¯Gázþ>{®G!“0>Házn±H>…ëQø'b>> ×£”Pz>…ëQJÃ’>p= ×=Fª>ÎÌ̬]Â>®GáZv+Ø>‡ëQø•ï>š™™‹} ?> ×ÍJœ?¯Gáa-?[⼃@?áz¤…`ÜQ?zž©Mb?™™©°££q? ×›FŒº?…1iPeŠ?š™¿É› ”?ázÆž½â›?ÌÌÆë¼i¡? ·ñ.–ˆÕ¿{®Gáz$= ×£p= 7=×£p= ×S=¹…ëQ¸n=Ãõ(\‡=áz®Ga¢=Âõ(\O¼=Âõ(\’Õ=ÍÌÌÌÌHð=Ház®Q>š™™™ó!>*\Â5(:>¤p= ·ÉR>q= דj>\Âõ¢s‚>¹…ëG"™> ×£°*¿°>|®çÚÆÅ>R¸erÛ>×£pÍ]çð>š™™‹} ?)\BìÜ?Âõ¡ìú(?ìQ8ëÔ:?®'#J£I?ìQXœdÉW?¥pÍ/ïžd?Ãõ@ ù“p?®;úˆx?ÍÌÐL•€?ìs[„?…땜 ×£p=•=°= ×£p=êÇ=fffff¶á=âz®Gíù=)\Âõ»>)\Âõ±*>…ëQ8ºB>ëQ¸UÔY>…ëQhzq>)\½)‡>{®GÀý>ÎÌÌŒÖë²>†ëQ¸3Ç>R¸erÛ>‡ëQø•ï>ÌÌÌ Žf?ÍÌ̧ÖY?…kˆ{n"?…+ú>‰1?Ø£0!ml??®§Ñ0YJ?¸UQâŠT?(\?l˜]?®GÑu»“c?×£Ðvæªg?ìQ`íâßx?{®Gáz$=¤p= ×£@=333333S=)\Âõ(p=\Âõ(\‡=ö(\Âu¡=)\Âõ¨¹=> ×£pÒ=ÌÌÌÌÌ´ê=…ëQ¸â>\Âõ(P>333332>|®GÁAH>p= ×óü_>p= ×?¡t>Âõ(\³÷‰>…ëQDÑŸ>ÎÌÌŒÖë²>|®çÚÆÅ>®GáZv+Ø>¯GáòwÅé>? ×ûJú>…ëŠ ?r= »ƒ?®Ç­·g$?q=Êa:š0?…«VC09?Q¸¾Yö·A?33³˜¢G?Ø£ØDqK?¯G‘x8Y¿{®Gázô<{®Gáz=š™™™™™)=p= ×£pM=¼…ëQ¸>½efffffv=×£p= ו=ÍÌÌÌÌ̯=®Gáz”¬=Âõ(\rÚ=\Âõ(xõ={®Gáš >43333¯>Ãõ(\ϲ7>âz®§vP>)\•äd>Âõ(\§¤v>> ×£Ðk>{®G胡>Âõ(Xµ³>]Âõ­·Ä>HázÍÕ>q= 7¿å>Âõ4Åô>? ׌c?®GáÒÉ?áz½¡?®G'0@"?fff±G4)?)\Ï)Î0?Äõ(cŸø2?{º_]t¿&z Rƒg0:½+Ãi`ÿt=·+Ãi`ÿ„=&z RƒgP:©ö3„8?š=™Á¤ž=?ÆŠ\t_¢=3‘ûvLŸ§=¹+Ãi`ÿ´=1‘ûvLŸ·=\l‘$ß¼=?ÆŠ\t_Â=DÆŠ\t_²=CÝå€=—齑RIO¯î ¾0&—#®íR¾J½ù0~ƒƒ¾&z Rƒg0:·+Ãi`ÿt=·+Ãi`ÿ„=µ+Ãi`ÿt½º+Ãi`ÿ”=Á¤žŸ=@ÆŠ\t_¢= ö3„8?ª=ë×}Bï¸=ä¬0Ï@¾û íÓl¾¶+Ãi`ÿt=&z Rƒg@:¶+Ãi`ÿ„=—Á¤ž=>ÆŠ\t_¢=‘Á¤žŸ=@ÆŠ\t_²=—Á¤ž¿=DÝå€=—É=Mìál[Ó=suº”‡Ý=èb«ä= 6w ,ãë=!ütJò=J.pRS¸ö=½.CÚø=Š›¯ƒÞ=è×}Bï¾²•a¯ ¬;¾1BšˆJB>¸+Ãi`ÿt=¶+Ãi`ÿ„½·+Ãi`ÿ”=¶+Ãi`ÿ„=«+Ãi`ÿt=£ö3„8?ª=@ÆŠ\t_²=ƒ“îU~Á=µBŽ)7Ì=á×}BïØ=ª˜H'dä=/ÎK Óï=Õ0;Fqø=ݱ¹¥þ>¯G¾UN`>Ð!ƒÚ­> ‘òëz> ë—¯#‘>•OÅ'‹Ü½ ƒßí0‚F¾‰M2<‚s¾‘7j¸/䔾&z Rƒg@:‘Á¤ž=³+Ãi`ÿt½»+Ãi`ÿt=BÆŠ\t_¢=Á¤ž¯=¢ö3„8?º=DÝå€=—É=Ù¢øIó×=Em[§å=!ütJò=åì:Âþ=COèŠÆf>b2®>£ÿEëù>i{e -V#>+_0ŽÛØ)>¬©›×a™0>ˆàFE&2>Ç„TõNK׽ܔÜ¿g¾]õ÷Ùž¾1Ê8 ¶Ï¾&z Rƒg@:¶+Ãi`ÿ„=»+Ãi`ÿt=@ÆŠ\t_¢=¡ö3„8?ª=€“îU~±=/‘ûvLŸÇ=UufeWÔ=Lú#iÙã=·È}ržò==8fý.>g ,fÐ >çå÷çþg>IQ˜âµ$>ùâ Í÷/>ùTÓ¼Ì6>¥‹Ä  @>õqÜbºE>⩼¸RL>|'×}1¥P>nì\fÍG>æâ*NDb¾ê]ahß-•¾æÌd|bÀ¾&z Rƒg@:·+Ãi`ÿ„=9·ðûD›Xºµ+Ãi`ÿ”=>ÆŠ\t_¢=â×}Bï¸=ÑŽ˜/Î=\l‘$ßÜ=ÁûU±í=é+}s!Hý=•¯£K-¹ > Ýå€=—>®ìPÿñä&>:iA;ª´3>ý&QÊÃW@>²n6¡I>¾<—ˆW{R>f¸`¾îzZ>P±„'b>¸œúñg>÷8öië;l>±€Féb>Ì|(ß©¾®ÛË”4©¾DI °e°¾&z Rƒg@:·+Ãi`ÿ„=‘Á¤ž=¢ö3„8?š=\l‘$߬=%z RƒgÀ=íÒ1Þq³Ò=íÒ1Þq³â=Õ[²‡c–ô=·ÃºøáÊ>khY aê>‰þÆ?$>ðBÒi3>px2mÌOA>¦ ñbN>ë¸tj1šY>(Î8Ùdd>,G>ÝÕm>ï Ãª½u>(±Wð*E~>Á#s 4„>A+âY~æ‡>ÔúOw>î='õ7­¾Ják«Ý¾޵¢¿&z Rƒg@:¶+Ãi`ÿ„=¶+Ãi`ÿ„=¤ö3„8?š=‘Á¤ž¯=>ÆŠ\t_Â=d8jë]SÕ=tñÙ²RÍæ=¾&#¢;Öù=În›­® >ÕðÉcù>ûZxøÿy->‘¾ëNB+=>[ÚvÛöK>ˆ4ýâëY>‚ŠÅé/g>™»(Þ˜âs>«JŸÿ9€>µ:+LLè‡>j'­ É‘>Wüò!™>!g±Â¡>–GG È¥>˜õâ~~ך>H4&d•¸Ë¾%ƒä¿òc¿fL^s‰">ˆ,«›©É3>Ì ¯Œ»•D>º -þÃT>úoÈ©‰Nd>àC¢ÿÆ5s>IdséЂ>ie7Þ Ž>W"w ÆA™>@–£5Ç£>ú`¤"‚é¬>ãGx ÉÊ´>eÔ@Bé¼>ëåÃw.*Ã>QÍ@16{Ç>%ŒIK¥Â>u–¨ú$ç¾3JÊ36¡ ¿&z Rƒg0:‘Á¤ž=·+Ãi`ÿ”½@ÆŠ\t_¢=-‘ûvLŸ§=>ÆŠ\t_Â=k^_pVOÖ=R–UH2ë=â?c‡>å1(è.>$ÿhf™ë%>Ý16u8>Æ5_>u­J>qüÿÜI\>öøÍ{Z%m>̈́ǵ¹}>[ÞÎŒ>{s,š>ž•(ÀƒV§>eœ€¥^ ³>»sc ¾>m>(Äh^Ç>ܱFÑ>ÿs^fm,Ø>~$•mà> Žº»pæ>y”0H~ó>C6»?1\Öô8?·+Ãi`ÿt=¶+Ãi`ÿ”=§ö3„8?ª=ÕŽ˜/¾=¨ÎägÔ=ø|E7iê=…˜k¢]>qàK)Ô>¡OÜ#ëË'>º,ßñüÄ;>q4ÎݺO>Mrɵ¨a>=lB¿"s>“bÔ?'„>°k-óª”>¿ó°NäM¤>ð<à@àN³>Ñ»rÀ˜Á>«Ä·Z²-Î>Œ]ܤ×>XZˆöì½â>‹A±Šìë>"Ñ$î ô>Åqw¶¬•û>K_KÈ?# œ^d? < ¯Î*?]‡díüR?±+Ãi`ÿd½&z Rƒg@:’Á¤ž=@ÆŠ\t_¢=\l‘$ß¼=<ÆŠ\t_Ò=pËä-ZÑå=•Ëž7þ=°¢BÀn>¥OÜ#ëË'> ¢£þ<>ž˜£ƒØLQ>†øhšà.d>PiF~ìõv>κ³r‰>^9Ç…½e›>”òÊAÕ¬>¹}Œ»ã¼>ÿc¦ôÌ>a<ø}M1Ú>sE¨g6õæ>¯¤`31ò>/OärÎØý>[T·D9©?Eúš½#?ÝÃÚò?¼ð ×ð?»ñH7F'? §ƒËÉ>?|Ÿ‡\´d?9·ðûD›Hº¶+Ãi`ÿ„=µ+Ãi`ÿt=¡ö3„8?š=/‘ûvLŸ·=ä×}BïÈ=¤Îägä=2$v¹Hø=†+æäÿÚ>‡7vR9î%>eìÝœÇ;>¶æ¦~€MQ>KªJGe> Õ'y>GNžq`H>F™‡]š˜ >Ýaõ›•L²>ng4×MÃ> ô^ö;Ô>DÈÝY()ä>Ù2áî¶<ó>–n‰¿<?*?¢Ù ?­¯n}‹?®Žp‹E"?ö°|mE3+?‡µùË,3?àeBÄŸ9?_6ØÈŠ$A?ƒ¯ÒÇO?ògÉÎ{wo?²+Ãi`ÿ”=·+Ãi`ÿt=¶+Ãi`ÿt½¹+Ãi`ÿ”=\l‘$߬=߬3½xõ²Ž">¦h*'æs8>TæÊâv¹O>s«–^/d>µŒSÑ›'y>Á‚"C*°Ž>‘!ïâYE¢>hÂ.=Ä7µ>}ÈÊ%ôÇ>ã ñAÚ>½¨oH,Ôë>$õEûqü>!õ2¯Ï ?9’+ Á‰?œƒ\eZ%?íȸ»´f2?#û8àØ8=?TÓšZ8F?•R-Û}ÜO?èq2‰sU?êÑ;vr[?nüNì0¦b?‹‡©ux?Á¤ž=Á¤ž=—Á¤ž=?ÆŠ\t_¢=ì×}Bï¸=Lìál[Ó=ÉñN(aì=¶V5;ÞH>ƒCáp@>ëW—¹¹Å3>È5_>u­J>1›uÄ]©a>²ôjwÓöv>…sêQI>Á“À`£E¢> Tç K¶>QßUkƒÊ>$§„,´Þ>LäH@ñ>™ñÕMÆ?ä´àµ°?g‡¹§±Å#?5ˆî'ž2?™`:ŸR??fgúëuL?¥2¤1W?O¥<{ b?æÏ ê¢gj?ie=ˆ r?íò$ת÷v?A&Z~•{?¸<Ú©ïˆ?¡ö3„8?š½³+Ãi`ÿd½>ÆŠ\t_¢=/‘ûvLŸ§=‚‡3çÊ=ã?·›u5â=ÉñN(aü=v_G¢Ÿ>[]TÃm©+>œ”´{D>š÷ ç$M\>2r©…$$s>h_‹7t‰>È7÷n™ >Ý÷Ô&š8µ>‹*AÙ„Ê>y¡¤-à> ñúóý5ó>Òä$ËŸ,?ˆŸGÛiÇ?Êœûg±¸*?ûŒh¢&“;?ªO„³J?µ%è¦+øV?kÛ2Ñe?ŽÄ(cIr?ÑGpÂU0}?ºë»Ý×…?6Ðp kŽ?M”$ëSœ“?Jórwq—?0 Ò¤2›?…“îU~¡=£+Ãi`ÿt=¢ö3„8?š=ã¬!ÕÞÆdl$>Ûì³7ÀV;>™“4ÃT>Dã×lR'm>¯ùšGî(„>Ѓ;3.h›>òŠ N²>÷¦¸”èõÇ>b[¾¶Þ>t²•¶6ó>Æ7™q?͇­ sÊ?tzÆÅò/?‘RoHL¸A?Ë…CèÖR?ÖÙb²ÑÌb?0Ê<0 p?àðRª€?édÞéØŒ?˜îŠë&«—?·oèùÅ(¢?UÍ ¥yÒ©?¼YþçÆè°?àÖ²u E´?ÆŒ>?#¶?‰Á¤ž¿=\l‘$߬=‘Á¤ž¯=è×}BïÈ=±˜H'dä=/¨V›×þ='ùlÃÏ>FX‹RÞ*3>³7±P9J>5Y·»Ld>Y²YšU!}>–e”¤“”>_Âc÷¡¬>œ—Ëù’Ã>˜JªñÐDÚ>g¼V‘Bñ>•‘O"/?(ÓOЉÌ?ˆ‡•žDô0?‚f8«ç D?jü‘ÇHîV?®ýÛ‘Z'i?&z?ù l¸á‡?Cq0óÕ™?L™ûçk1§?šæS$°›³?‡–Ö½Ãà¾?D™ÐÎÒpÆ?šûT«üàÍ?‘ô“Ò?øÖËœ—Ó?\l‘$ßÌ=´+Ãi`ÿ´=`)Њ.»=r^_pVOÖ=ƒ“îU~ñ=rÁǰZ >„öVÿ×&>uÊõ‹_A>B·jH×MX>à¨õ7s>ãg¨Ü"Œ>=3€S¤>ü9Î1ì¼>õð•Û1BÔ>Ô[ùœ Ýë>jq`!YÌ?¶‰–€ Ï?ã[G%û/?!Û JD?\Ò‚twX?ž4ý%Úl?­»›©Í_€?]_G¤‘?«¯©ï¢?¦-·×³?(oðB¡ÉÁ?u\@PJåÎ?èOëpâØ?K«þ(jâ?ï'¸‘Õè?sî¦ù3î?wÁ][@ð?z RƒgÀ=r^_pVO¶=Em[§Å=˜L^s‰â=ð˜1%Êü=Ä«1¬>i]?3>‰ÝúeN>z j†´Åe>Š´«‹>EôNÎ=š>Û ¶î\³>R Wï4Ì>Òs·Ó:ä>ëb 2‹ü>5@zçÔÂ?OÍÈB Ñ*?…¥ ÇA?lÇØøýV?GÝÿðãl?ÇêtóS˜?;VzVo®”?Är~ ½X§?ßÈg"¹?6©’MOÈ?p¼Û¨$W×?þg×Xå?¼x8Õ´Šñ?šHYŸpÝ">¶žP›/¡?>žƒ³ ©¦Y>×$ÔI÷Ær>³MVkfÝŽ>ÉÐñ/,‹§>NtÃÁ>>ÞœItÚ>}Ú+ø qó>F•ôË ?Üy!$?†‚ý«ñæ;?±/¨4Û S?ìÌHàai?vñ»‚Öu€?+lšÈk³”?c|—Ò&©?<¹C“â^½?ëŸ9XbÐ?ˆ?äòRá?r:Àå=2ñ?1‰ †Ý£ÿ?5;°V @‚£œ9@¹ÂSÄë‡@A÷G¸×¢ @ñO‰rúå!@óø&cj¯ó=ïÒ1Þq³Ò=¯) 1;Û=Ø‹¯W%ö=ÐEÊ÷ë>q1ᾞ->µ+cÈwJI>‚®ª9M'>jÙ˜f—š>½ tK´>sK„•@Ï>@ñ¤„ŒÐç>GômÕÄé?Uqç}–?å€Jnöi3?áëð©ˆÜK?Ï&Çù•c?U!{ëz?ÄIÌ>Ø’?£îêEj§?ŽtÍ{Èb½?°‘)]Æ´Ñ?†õÀ÷×Qä?Å Ii÷õ?-8ޝ@ %i Ù@ij’¿l_ @'.k)>`'@ÀŠ‚ÀB#-@Ô¯@YŽì/@:MQ.0@u#þ>\l‘$ßÜ=¸+Ãi`ÿä=ã‹Ä  >â”îô·>g÷Š…m6>ðt6@fS>A]¯îK1p>7¡.E(Ĉ>ëÚýú¥> NÍCž¼À>C¶RÚ>`•î,}ô>ÿ laÕ?7(?ŸI xRB?Žºõ›E‘Z?¡JÅÛ>s?%|a² H‹?IÀÞqÀ¶.@`gÔ°à*$@ š+Põ·ã?}_…¶À¢G¾UN`>èb«ä=tâ?R# í=¨´CRâ>b„wpî&#>fÕBH@>,rÜì¾\>´¯Ï’^"x>L8Aq Û’>ª¡´•R°>îƒ6™`Ê>É 3f×"å>’ñ-¦êÎ?èðMŽWx?Â@H„v¡4?wú±î;ÀO?Oe }Áh?{Á ÿø?nŸB™Jš?—) :pŲ?kmMýÊ?}|ÿøZá?.Së™ÿ÷õ?>ó6Ñ @¡@«Õ2@Ó).áw¿'@…ýøübÉ-@FvÕŒð»@s¸…®æ4À5;^ŒncNÀŠâÀ ±ÑWÀÜ'1ݱYÀËÛCE3„>z›¯ƒî=)mFó=_ ” > Iƒ øN*>§ñÙ›¦F>´-„2Ýd>Là±ë5>rõpÛãb›>‚탸>ž»6'ÇÓ>¶–¼ì%ð>¿×cD- ?é­þ©·%?”eÛ°Ë@?%´¢éZ?öGáN¨t?Ð"H »?¦Œ­3í§?»?·h¡Á?YÀp~þ/Ù?z@a%>7ñ?ô<[É>@} ",@ýš¾˜'@µíWg,@Ö”ç”r À,;ÂLÀ¡¬Œ^À +™äå†aÀ1ܨR†[ÀäÛÜ;NÀ6Å\4ìÝ> ²–*_)õ=GÝå€=—ù=÷¿%Þ¥G>h/{ÿ;^1>^ûÖâB%N>IT 8Tk>º‚qg‡>›Üïõ¢>ÀSÏEZäÀ>qø~ .Ü>I%š‹”`÷>ô·AM?Çbqí©/?^ÛÅlÌI?â­=l½Õd?­·¯¢Ê¨€?•×ryYLš?½† ak´?Ï<ÑÎfþÎ?ñ—´w_¾æ?¢`ŸÙœÿ?êEþð³ø@UjjØŽ÷$@–8Aó+,@g¦fpdÀ•û˜¬r8RÀ­Ê·‡aÀü¢"äA¾TÀ¡ª‰.¸M@çŒS~Ãc@ÂËäiÕg@ˆàK)Ô#>>Öñ#ôü=åGx_©ÿ=’Ã7]>Íè‰Ú5>ˆ†7z.S>‡*gíœ`q>•GV’ƒ7ð¨>ÖìškÆ>#.àJûã>¦ö÷?usÍgŸÕ?JRŽLh6?ú:×E2šR?}P ²n?yÕÌhÛ‰?G8õ_MT¤?ZŽ5À?ù¶JkICÙ?ÜÙ=uöðò?Nìál[>õe¬ n1>)ÜXY>–7ÙŠ`:>LG ¯HW>KgPFu>±¢\¦³’>-Õ{ƒ&¯>2!âkZÌ>ã0eýŒ;è>¯«;z¤?ÇɪÐNŒ!?Aæº=?ú_JóY?ž{‚¨0u?÷K·Ì—‘?iO üh­?SӪ;¿Ç?®‚>ëâ?žÑ—÷Ìü?¼ìWÉ1ì@ôÍMÆ%@'©î½IHô¿VÌ.È—w0À¡™µéZÀçLÝÒUÀ ôûøâ`@OÌ÷5Æ7e@9rMæJ@\Vx¯îb3Àß5l­F CÀZ}AÔš…1>þ€4P!>˜ŽNŽYæ>™Ø¢Ãf!>a±âNiZ>>•WVï÷Z>h¡½ÆóÃx>[9¿¨Jë•>Ó\ j²>À±ƒÑæÐ>) Íí>ˆŠùÙ ?Æ«[e‚%?ʦ CpB?F&üd…_?Q _ÌÜz?øò¿Ç–?àlå3¾-³?^œñ2ÅßÏ?ÿhã´™Õé?‡ðTd5à@¡Aºa†,@¥!ƒ |ø*@ªâ{§0À܈R²ßJÀÄ ]5b^ÀYüUüÅI@šòÀF}Ef@©n ¥ÜÐH@-÷Ý$EÀã,ãlÈzKÀž¤¨HÀfK'W4>?Jk>A >C¼mHÊè>æK #> .±¯@>v„Dò»]><·×pêp{>BmÊ"\˜>r_̺fž´>÷ˆý' Ó>_jéo®zð>™™7† ?\Êñxk­(?µM½]PE? k…ú*cb?éÌÿ!F¥?9-/k$›?.fUêª ·?f ]ÑhwÓ?ñ‘ ’Þìï?Ø"1›µ@zhZ»© @aù$³y.@!ï…=c£@ÀÛ†­±¬ÒTÀ—(®¥VÀB•¦:˜¦`@ Úg˜' _@žrÅñÇ•2ÀãýùYJÀá‚Qî˜BÀ:œ4N"ï1À9ŽÿõÉ.>7¥$±>§G¾UN`>å`/Ôèã#>Û ${A>OnsbA_>L¤—gÞ|>2Jÿd,´™>Jè:/ϵ>4Ëö7 ,Ô>ƒ“-Ùs‡ñ>£E ïÙu?V ŽŸ2o*?¢Y¢N/ïF?bpLzÞc?ó>ÓþŽ0?§=Ž0a¦?S”gm¹?¦÷\™›ŠÕ?ÖK®ÄÂÄñ?gÿ]¸’ @§9z,„l"@Ô?mcG/@)×!ZìFÀ?b1nXÀ•—´B LÀ[zš•„Uc@cª)kÚT@†U]3CÀ.õö•üFÀJðüÄ›1À“ÍaÍMD@Ojö«L¾•]˜®!¾Ý?·›u5>ƒƒ×ÉÁ#>C" c~A>T®Î¢&;_>yþÙ|Ùá|>Õsf¾Ô°™>ê8*þPѵ>ÕUyÞ)Ô>#íæú͈ñ>sf±Ps?+FÇâ¡p*?$½xeðíF? (éßc?Juè»!0?¿±˜»ö¦?ƒ= `m¹?àÆÃ ‹Õ?ä§”$Åñ?N)›À“ @ß÷$Y´m"@¼ŒI{–L/@ÑR^}FÀ‰s4¯XÀüòi"LÀ ÅôX•Yc@ÿ/\§”èT@˼ù§ñBÀ‡·*?ÊEÀ7AQqµxý?ˆ`ŒÃiÀU´ÉÆ¿/'¾xuº”‡í½$™4èø>äaÐï">ZæôP«@>/§[à‰À]>´xcål{>S*GÜ^˜>éSyþÏ›´>Á2ðÊWÓ>ºxEÎ/yð>gù4º_ˆ ?4H‹• ¬(??&@E·QE?Émkåbb?<ÎÀ_cÕz¹UÀ8Gp¾wù½™Ð>ÿ?CÙ=žrS¢k…>¢¤‹ÜK!>ù…ö0Y^>>ºæ;0¯òZ>S_ˆ¶Æx>Kç^A è•>žÛ÷¢k²>Ô¶òÖäÐ>µ@i×" í>P½dãÀ ?`½Ò€¾ƒ%?‡Z<{‚oB?¢åÚM‡_?„œHòÝz?³+ ÀvÉ–?Лl¥/³?ÇÔ:›ãÏ?Î~ÖÒ²Øé?çq`íã@_À3@?$‰n”+@MU_ßú¡0À÷mraá KÀ—=§÷/¿^À¯šŒ­qH@íV:H0f@öÑÜV‹dI@õLvqEEÀzÌ].&RÀØ]K¡0À3‘ûvLŸ§½ôø&cj¯ã=Ý+w|N>úQrøD>cޱÆ'X:>xÝÒ÷úJW> Zöi·Bu>y;B‘%µ’>”žýä™!¯>{¾ŠŠ\Ì>Ü2*Ä9è>úöïî¥?‘_*‘E‹!?S®Ž_2¼=?ð1=¶ÞY?°Üü4u?øëX瘑?2H,Þ­?g]1¨gÂÇ?Õ~ŠÜôìâ?äû—ÜÌü?©Øq°èä@5-ðû¹—%@BЦ;ÙÀKjî‚÷R1À€ÖÃ8F[À¦þÁN8UÀ^Ôè“S£`@ ±îß¼d@çjï[F@þªlTÇNÀB95É{S@SufeWÄ=‹&i˜zá=ïæÓ ]ý=/²s¯¿M>4I Ô)Ý5>Û ˆW6*S>ºìå˜aq>@‚TŽ>ê˜ê,tñ¨>ˆuÂ^|Æ>öÏÆ ã>>ZÁíþÿ>A`…]V×?ý‡vtg6?k˜·›R?*ƒR$³n?ȹŠß¨‰?#+ÄAV¤?2üé)Ë6À?]Ñ4@Ù?T P‹aáò?åKòé  @ ÒrÚ2@Í!„îâ§@Û_‰`ìe @fžëôJHÀó±á(‘`ÀpŠS{•JÀ¨ZùÏ…`@f3[•;e@µ39IäQ@lþ‡Ô‹"q@=ÆŠ\t_Â=\l‘$ßÜ=[Te×K´÷=Ìü»}¦2>œ¾`'üX1>{IÚÝê%N>§s>kš k>„ì§Uf‡>åU.…ð¢>\>|½WãÀ>ξ:W(Ü>|¨kâ®_÷>Éù„ˆ*J?õ0¤M«©/?™øà8\ÊI?k{&zÖd? ´;㨀?M ¸éMš?b•ñ2¨j´?·(®QôÎ?yÔÉŸ.žæ?â<gýþ?à‘º¢ÏŠ@–VŒÈ¼Ì@ÛÎUèX;.@&|*dží?ÙQòMèOÀU°Á”`Àô’Šü³jUÀ›ÊÍE@!»dX@¹{è’Çq@ÏŽ˜/¾=!kòS£Ö=i‰ô¼stò=ZkÀûì>ÑŸ[HG*>ðÁÞ-t›F>NAÔzYd>0•e:õ#>[ÙXŒA›>„µÍÔö·>U'~á¼±Ó>ŒvÌð>Ì‹Í ?ä3ÿû$?ÔžT ç¼@?‡öèJkZ?&v©Ý±™t?Ó6ìªÊ¤?Í'Ösܧ?ªY….%Á?/óm“føØ?°w4ËáÌð?¬Jò‘M@òW ج)@p º@ì0'@}¿øv°.@SÒ€sê?ÖÎ6ØbHÀ8£-âd[ÀЦPÊ_Àëc4úŸWÀÓÙÞ«SÀo^_pVO¶=á¬fPó7¯ #>£=„ÿ/@>ºgàU,\>–£¢]ó€w>KIæb%’>ë+sx¯>Æý`pãfÉ>å2¢m\ä>:o’Næ,?h–\ÿx?ñ1äxÔ3?)ÄÙw}€N?×Í´3 g?æxæR7?¨Ѷõ™?L_fZܱ?·xÉ8ŒÈ?ƒv2) à?Èk3¨ó?@]&Ò‹pÿ?梑ßÜ@&}odÞñ&@Ãò¤%ƺ-@h7ž.µ]@³ë£ßEŸ1Àĉ³‚­yJÀb5øz=QÀWF±sÜgÀ¹+Ãi`ÿ´=Em[§Å=©Îägä=<ÎK Óÿ=(@q¥6~>eå&ÊyÞ5>ùæ8™É5R>ÓDZô¤©n>Î ÈGù²ˆ>ÓÇ£/Ü£>JPÑd>ÛC1FqôØ>\·?†ó>Šǯï7?Š>×f€'? |G„þrA?׆]¸ñY?šäå¦ïr? p‹?<²Ͻá¢?…:yÔæ‡¹?M©Þ»Ð?ÁùÇ´>ä?…pE¦hö?½ÊšQvS@GÎñ Ì@ UŽ lß#@‹{€¡&+@5²Fxž\+@:ÒHwz,"@DîV("º%@=0óǦÕHÀ-‘ûvLŸ§=†“îU~Á=SÛ6“Ú=—ŽNŽYæõ=ƒZíй§>Æ»V4¨,>%þ€4P!G>®ÎåPZ¤b>Id^K$Ô}>sž'Šƒƒ—>Ûè·¿Y²>dsÐÅvdÌ>4‚/á.¸å>“ü&kÂm?YV5{‚?Zo-xi2?Ÿ™s©J?ö…ü‘?ŠGP“¦?@JoØv¼?â¡4ÍÑ?~×2|!Sã?ÿ¹¸œ‡=ô?ü‹”Èì@I»¸þ/@~ìä£%@íïM³åh$@ë[å…™Ÿ)@„Q1¶Äë1@¡e×fÊ¿@?ÆŠ\t_¢=.‘ûvLŸ·=‘¹ãÚv Ò=²¯£K-¹ë=:–xÃÑì>¿|M;v ">)ÇŠU¾<>SíÊK„—V>Îuô £q>éƒv<‹>ì¸B>ÉÖ¤>ƒÙ,H;†¿>ÌÄü%S“×>s¹bÁ–bñ>”3fTíE ?cˆ4Ê "?#˜ÚuR9?ê»ö¹T`Q?6_ŒIg?Hß³öZ~?ŸÚkË,“?ó[–prY§?!Ðh;»?l‡”õL+Î?Þù8ÀÛ…ß?ø-[¦ï?×Ê à0ü?pJC{Ð ©ìG1>Óe4Å®J>·dÄî$gd>î—ÿüêë~>l=Hù)—>Â7ldÙ&±>-s6Z- É>ó€qR® â>iDg¿[‰ù>—®XQüÁ? ¤_/(?yg´À@?¥rzG©åT?¿"¾#[j?"̃¯Ò€?Ñ·Ú´í’?V¶ÙÅZ¥?»w'tH÷¶?ÖrjœdÇ?Ë€³VnÖ?Åt;å-ä?t‰Rˆkað?*ú„ýIª÷?@…Fðö?cžL5§FÀÜVÁvòB@§ö3„8?š=@ÆŠ\t_¢=`)Њ.»=ÃQ¸îXûÕ=XЄõ~úð=8Øh4¸I >Ú®õ¨G $>ôŸ8Íxk>>ó„ h*×V>hĶ µ÷p>ˆ-% êˆ>Š €¬% ¢>rµ¼/Á¹>­_LhÒ>÷Ni»úè>l_æ?ƒ~KR!b?%ÕÕßí,?·Í}I·4B?®’7¸Ô:V?NA¾i„Bj?ë$ˆêÜß}?ñO@œnL?€ŸC,ö ?¶ %~¾°?dv¨`‚%¿?.WàÖ{ Ë?vÒÎnó¦Õ?éx‡þââÞ?az ¥à?¨·òÞµ¿Ã|ÖŒ5YÀÁ¤žŸ=Á¤ž¯=è×}BïÈ=ߨ_oã=ý¾÷µÆý=)7‚¹‰>Ûl8a®0>y16uH>Ti3Ñÿa>&[´çy>ïöîNgP’>è[ã¾{©>˜'_FŽÁ>Fnûù£×>U#½“Ñ"ï>‘æáÑ|?ÒZ=ÄÈ1?ütiYÆ.?òٺ؋7B?h¯æÔT?š Uªóf?zb,{;x?¢s«sühˆ?$ƒŒüS—?ê¤=A¥?¶¿JT¿±?÷ZÂ-¿»?úä¯Ã?½Óå½ûÈ?/1`'ÈÉ?ýY`êôêª?‹Á¤ž=“Á¤ž=–ö3„8?š=¤ö3„8?º=xªIzGGÈ=ymùÐ…ð=Ÿh6ŽÁ >Ô†GÔ€» >û+=¶ò±4>òÛ€k|]R>B!ïâÚüj>ßóoñ§÷>ágÐ!¹¾–>MDD¥D¹°> ¼Pœ|Æ>Ê«#@mÜ>Ez®¿É<ñ>ÏŸ#eŸÎ?wzqÿ-?€‚‘\ñ-?×í—܈f@?]âí2¬Q?Zôxî'b?¤îý“œ´q?“É M~\€?M µ™Œ?Ö«Æq—?m¿{ Õ¡?ŒšªâŒ¨?C½8öœª?­OÊ¿d6á´Ä¿d?·+Ãi`ÿ”½¬+Ãi`ÿ„=>ÆŠ\t_¢=9‘ûvLŸ§½§Îägä½(3xáÑ=ž¾`'üX>C8jë]Sõ=Û;Åv6º.¾¾HæDÆÀ>>Mv³ ÷`>".¸ˆ0l>yõ˜j•ÝT¾ÂÃoŠ»>„,ñfƒOñpo³Ê>Š \%¸ Î>¤F Föò>@…—’¡ ?Öäî?›.ÿœï¬&?k*¡=? T3Ëž|O?—iÜi^?Ž™¥™ªãi?rÄdx4v?Ú?h¨Å?˜µÍþBŠ?€–%ÿé?±,G9[[p?½äé·6ÿÃsH¹¹bË¿FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((32,16) (47,31) (0,0)) 7 Å¥@ñ&?€d ñœ´%?€“-œÔ­$?k€½-#?¤›[ €?ªP8 Ô ?š‚nåe?ÔyÈ‚ù>ËpŠ>†¿ê÷Šð¿‡ï‚õM¿ÞlUá¿€ö+N#«)¿€öPòÏ+¿QUÎÝÖ+¿€[xâ*+,¿1zF´|+?€šÃX"¾(?€¹ÆælQ&?Üž¿r#?¢Iþá?œ®ÉG¨?Fm?€ƒ%i¾> `,±f ¿IÆ‘±¿€÷Ÿ;=á ¿€ÒÛ”ÕJ%¿€\Ôr7+¿©ýÝ0W.¿@¼”¬¯0¿,æ‘0¿€ëíªa.?ÿ,|!+?hr V(?€ÛÏÙ—Ò$?ïýb˜2 ?Z¿áŸ?H¾T×®?€±……þp¿7S² ¿Dî ¿Á% ò$¿ÖFQ¸µ)¿Õ!~>/¿.!Ÿz1¿¨­öÉ2¿÷°Šƒ3¿€g%Ö –.?ÚCð-,?€z#²dn)?Ý‘*ÿ%?Âdå½!?Lžw]?xrÐã— ? ÇN—˾ÇFVI”¿€^kè=2 ¿€fNO²'¿Jã€.¿@”r+|-2¿€9€×Îp4¿Àê ò 6¿€Lˆç/7¿æÙE(G,?€•5{1)?€ÿÍ/ü<%?>ÛICõ!?Û˜zý?à¬j?Îf¿ð?@+¨¡ã¾ôê‘ο’Ú½ 0#¿yOÜ9,¿€»«|V+2¿@ÇÁ%@‡5¿®Ðå8¿€î2ØÎ9¿@^ä°‚ø:¿€]Ä[.%?ðã÷¾( ?\»à%¿ˆçp÷N¿”-M&¿@±§´Ó¾`_ôª̾°7+®¿Ð\Ö•h¿W'\Z'¿€T‘X1¿@ó¨Eæ5¿À-_2­À9¿Ûy°¶}<¿À6îð&>¿¥ xJé>¿ÌM^‚Íÿ>À©I1’VB¿ ˆ Œk¥L¿`Oç+ĺK¿àDÀ‘>D¿À#*Gë7¿€ ]‰‘)¿€Ÿà§ÔŒ!¿5oØ$¿€éDîž.¿SópèH5¿€ªm{ Û:¿ÀºÃ˨4?¿àN^A¿€qjëµA¿€_ÂÏA¿Ù°Úö9¿ Îò 6ƒf¿87×H¹ o¿à†}Km¿p3•Že¿àÍJ{ÂAY¿`šØŸçØ@¿`°Yì6C¿@ƒ®"•“D¿€XJðD¿`V\GD¿ 9rr‚×`¿Ø#qn‡…¿–$›—Ó‡¿›:º·†¿@ªs9Ì€¿l†ó³ût¿_—ÈÓcd¿ðuÈlKS¿ æ"Ä‚D¿ òBÙº@¿€®ŸÖžB¿`µH N©¿E—9{οBó¦©·Š¿œŒÉö-u¿¸¼.n÷*d¿ÐGY†×]¿œò},\¿ o¼klxZ¿``Ä·±ØW¿Pol;øT¿¨jsR¿Ð©_û¾n¿ Æ(8œ…¿ø0ˆA‰}—¿ðïvëQ¦¿íK¦œ°¿”Š5³6±¿È L¹Ä§¿ÞV§\X×–¿ÌòÅ»—á¿Ø^{-p¿ˆ§Œ·òf¿c¤Žz¬d¿˜á€x¯a¿@ƒÙ¿]¿°ÑŠ-’ X¿p®åL+T¿@~€]™.b¿ ¥•ø/!v¿ Gè6”Š¿Ø&œZ̤Ÿ¿x\8:~®¿Ü¿Ò1‚†³¿cžx¶¯¿"8>ˆÈР¿üÿ.UJ|Š¿Üx8Å")x¿€õè‡CÁq¿ˆGØåFµo¿Ð8Õ og¿0)ÉðIï`¿`àw~N(Z¿Ð¶ÂyV¿€„l*`2i¿@=oC¾ýk¿@ÒÕð.}¿¨mt®ª”¿L˜âEÑQª¿è«[¦q³¿¡òáÇd²¿Ä)0úµ¥¿pSŽ×²¿dóÚÒ“Å€¿|GK’mÜ{¿X†[•8z¿(°a÷`ül¿H6²7$a¿ üvž‚X¿°C }6U¿àݾºx€¿ )'q3·~¿p.ˆ¤†„¿Pê>´:`Œ¿¨Ý, Oª¿–ƒ/My°¿•Æ CÝV°¿^P  û©¿Pr2®ò¿Ìâ”’‰¿Ô¡½1Jzˆ¿n£ðE8ˆ¿°´ QÌb¿¯èϘV¿€Œ™®pQ¿pÎOàßP¿ž^v‡+?€cWÖÆ 0?À`CÌ:01?Àáø ?1?ÿddr12?ÀùrÙ^h4?€cj%ì4?@UßV"3?€fÝà­k3?@‡ bÙ4?@ø%¦3?€, ¿1?šh‘Ч.?€YD³î’-?ÄöTRR*?€Ê[&?ÀB¹O :0?X>˜½1?1•!³î2?Àû¬¨UÏ3?@3C©yù4?@f›šJ6?ä?ðì6?À-&šÇ6?À1Ör¥£6?¨„éx6?….°@n5?À„ ÅŽ3?S_§1?'Üs+¿/?€ã¨[åa+?»™á¸V&?ù‡i4?€Ëée^5?À#·8?6?À°Ù}7?Àj&¹/8?€Ú«K=9?À¬ÒN7í9?ÀœÅÎ/ :?Èx—xô9?€ô~±X9?€¿²yp8?@YRY "6?À †-Ü3?ÀvÕè\1?¦g/ª-?€` äí&?À÷’==?QàˆXë?@ØŽ/O;>?>¿åJè=?¤:ý¦þ‚‰Á9?@ @ôÄ3?rv+^Á,?7»ð'!”?ùÕÈ3 ’?½€ã6Œ?À¹”q(ƒ?ròº‘´w?ÐuŽogÓk?ð±u»wÅ`?°g€0å¢V? ö‡Ýp”Q? LæRàM?@g7NõI?@Q7ååF?#Þ ·B?€”aÁôå;?@´¼¡¥O4?€¾óMu›,?>Û\‘첩?_^+K-ë¦?b]­©pó¡?иh©˜?ðaå`Ap?TmôgÔ?`…Ѥp?¸äl—öÊb? Ê Y?ð¨ºñ„_S? f -àO?€wAØþI? ^!IHD?€qi «=?€uÆwQ3?€E„™°}!?Û÷Æ1Nص?òýRë} ´?tQ5¾ç°?¸×§<»©?€¡²Ÿ? NeRŠ‘?V¡·˜}ª€?”ò·üFkp?°S&%ºÌb?àLäð Z?àô•½sþS?ÀÖOK^ÔN? äÒê©F?!•ëIë>?¸MÈ­2?€úAEZC ?‰¯Q«fµ?%ž¿ìDµ?ÇÿÚòŠ´?,ü²y3ݱ?EÛw‘ª?Å6´&íž?\/†Ž?Ì#¿© |?€õ²èÞ™l?@ZX+ðäa?€ˤ)Y?`nóµ«JR?ÀVŽx±H?Hço>?@ª6>Lt0?F>^¯?|úJ„×"¨?X­=´r:«?&`(Á•¯?¶º(Z±?¹Bή?`øuʼ¥¥?^øËŽ—?ž€½:Í…?Dõoþt?HZÅ"’h?˜°÷Ša`?°÷á`nU?`»qñ=I?@h _Œ9?€¨çK›æ#?æÂè» ?(u«õø‘?°)¶Så–?øuW ?"ƒ!²¦?8Ïi‹Iª?*›Ï$å¦?¾£™•(?Hg!W4?´…3Ï5‚|?Ìy‡Šp?˜çÇ® e?`ÈJ°5X? BÉuÿäE?c÷Q2"(?k 7п€tÔ¢]4¿àÔœïi«r?à’B¤ÖUz?+)PÇ‹ˆ?èó§…Á–?Èxß@”¡?¦c­¤ ‚¢?d4æ7L€œ?rï(gã`?ZCÆ<†?DV'UÓu?1×ûæ%k?ðÛ‡BY?€+k=»Ê2?€ ·…·-¿ÀRÈ:v98¿@‰œá6;¿æµÝ¯3?À%fD‰=¿³Y;^? û÷wº€?ÀÛ{ˆj? ÞžóØ–?|¼œcr–? 3V¨.ÝŽ?¼a,ªžƒ?T6îGB}?46Á¬zr? ŒTÈ}S?€¶ÉÏ‚I¿ ÆÿÕðO¿@-KÏžžH¿à6ù’°OA¿@ê¨\’Ù{?€|A;(¯X¿Ðƒ[S( ƒ¿€‚££Êý…¿°b½?‰¿°t|n)Ry¿ð«èê½@‰?¤[4ÊN§‘?€ô]×îòŒ?‚Ÿ€X£ˆ?Ð tí_Ñu?¸¬Ý±`¿ ý­4Agq¿@Ægëé-a¿þŽi—BS¿€£Î×cE¿¶~døÿï?ø «øÿï?ÚÕÐÀùÿï?$–Æûÿï?‘þdüÿï?º‰ ‹ýÿï? \doþÿï?èwÿÿï?æÚõxÿÿï?ãå·ÿÿï?xbî?Ìh—´¯Jï?Žù´]*¹ï?âJÕEæï?jaT]÷ï?š4ýï?ŽO¦±ÿï?¢ÀGŸ¯ÿï?ÆþL“æÿï?¶~døÿï?º‰ ‹ýÿï?´Î¦"-Eæ?Xó,‡æ?K§Lu-ç?µ¢²[yè?¡¾2*ë‹ê?²‡xáì?®w7`'—î? Æ×úuï?#,êäðÏï?,b7‚ðï?vž­Jäúï?г<4dþï?BrÂ-€ÿï?ªÄlÃØÿï?Töôÿï?‘þdüÿï?¦K¥XŸå?Æ}¹{;¼å?Ò_ëæ?§ÝpÔæ?µ¢²[yè?ßåúÁ2ë?I‰§l•í?¦” -Kï?('F*7¯ï?âJÕEæï?\—®C øï?ÖL¼x“ýï?ˆhøDÿï?àT Èÿï?ν¸[ïÿï?$–Æûÿï?Å%/¦Ukå?ÔÜIïwå?¦K¥XŸå?Ò_ëæ?K§Lu-ç?.<ͶÈ}é?QGyì?®w7`'—î?²ôäq‡ï?.þÒ°Úï?\ñÒµËôï?ÔŒ¾Ä­üï?ŽO¦±ÿï?= M¢¶ÿï?¸4¥êÿï?ÚÕÐÀùÿï?:èú¤í[å?HÚFBbå?ÔÜIïwå?Æ}¹{;¼å?Xó,‡æ?µ¢²[yè?ì,6*˜ë?š]p‹&î?êÜaï?#,êäðÏï?Q®Ÿ³Üñï?¨ÄN4ãûï?²®Ïþï?º ©å§ÿï?ÆþL“æÿï?ø «øÿï?iÄqŒWå?:èú¤í[å?Å%/¦Ukå?¦K¥XŸå?´Î¦"-Eæ?RX!iè?ßåúÁ2ë?2¹[)âí?Ìh—´¯Jï?ä ^¸]Éï?,b7‚ðï?:Ï\kûï?ª½#2¯þï?Æ`ªaŸÿï?FU$Käÿï?¶~døÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?½Îøð?l9ªð?*1˜ð?vð?vë€Íð?HSy:ð?¼ÛMÈð?uÄwð?ª…Cð?Ê $ð?ÙaOð?Ë&âð?î,"ð?¶üÙð?WÍð?íþUð?ÔyÚ ð?Išc¶ ð?~“´· ð?åô'Rð?Ù¾ÿ÷ð?½Îøð?vð?:ŽNnð?¼ÛMÈð?È”¡gð?›ú2ð?«Éóð?x Ì ð?±°ð?¾÷ð?WÍð?Þ­¼O0ð?kĤ ,ð?ì”-¯$ð?Uáúð?Õ«ažð?Išc¶ ð?K§ð?ö XNð?ÿFð?%î#ð?÷XŒŠð?¼Ýê>ð?›qmð?L͆ ð?±°ð?¶üÙð?,ÞÚm¨ð?ågUw˜ð? êÿ*}ð?ÑXî…]ð?òê?ð? Á0(ð?³(.hð?Išc¶ ð?‹l{ð?*1˜ð?:ŽNnð?Ûºo ð?ª…Cð?›qmð?x Ì ð?î,"ð?¦*ÔÄJð?c»‡©ð?„ÄI©ð?R$[6ð?íÊ;ðÍð? êÿ*}ð?Âöð?«Éóð?Ë&âð?m¤´÷ð?EãÇð?MÎêœð?°ˆØÛûð?»0CŽð?mù›~ð?íÊ;ðÍð?:V6gð?Þ­¼O0ð?~¯lð?’šÊ ð?l9ªð?:ŽNnð?÷XŒŠð?›ú2ð?ÙaOð??n€ð?¼Ú+ð?}lèo½ð?!"Auç ð?m¤´÷ð?.økvð?¦*ÔÄJð?ÝO Òð? êÿ*}ð?#Ú5ð?~¯lð?åô'Rð?*1˜ð?%î#ð?È”¡gð?Ê $ð?0@™pµ\ð?Äh, Pð?¨öº-=ð?r+ggË(ð?¼Ú+ð?!"Auç ð?zÐɳLð?«~Úð?R$[6ð? êÿ*}ð?Þ­¼O0ð?yü ùð?‹l{ð?ÿFð?¼ÛMÈð?ª…Cð? ôGt1"ñ?I:Ævûð?–Š0—¼¼ð?4#uïzð?±×'T1Fð?éçOæ¹#ð?Ü\‡•‡ð?EãÇð?«~Úð?ÝO Òð?:V6gð?ì”-¯$ð?Išc¶ ð?ö XNð?:ŽNnð?uÄwð?+¡E&+ëò?; ÁW¸“ò?áÙQ^ûñ? ˜…­ŒNñ?–Š0—¼¼ð?0@™pµ\ð?r+ggË(ð?Ü\‡•‡ð?zÐɳLð?¦*ÔÄJð?íÊ;ðÍð?Âöq= 7¿å>HázÍÕ>]Âõ­·Ä>Âõ(Xµ³>{®G胡>> ×£Ðk>×£p=úzw>¹E ^ÿM?Ø£ØDqK?33³˜¢G?Q¸¾Yö·A?…«VC09?q=Êa:š0?®Ç­·g$?r= »ƒ?…ëŠ ?? ×ûJú>¯GáòwÅé>®GáZv+Ø>|®çÚÆÅ>ÎÌÌŒÖë²>…ëQDÑŸ>> ×£Ðk>®G g j?×£Ðvæªg?®GÑu»“c?(\?l˜]?¸UQâŠT?®§Ñ0YJ?Ø£0!ml??…+ú>‰1?…kˆ{n"?ÍÌ̧ÖY?ÌÌÌ Žf?‡ëQø•ï>R¸erÛ>†ëQ¸3Ç>ÎÌÌŒÖë²>{®G胡>\±ª”†?ìs[„?ÍÌÐL•€?®;úˆx?Ãõ@ ù“p?¥pÍ/ïžd?ìQXœdÉW?®'#J£I?ìQ8ëÔ:?Âõ¡ìú(?)\BìÜ?š™™‹} ?×£pÍ]çð>R¸erÛ>|®çÚÆÅ>Âõ(Xµ³>ázñ d}£?ÌÌÆë¼i¡?ázÆž½â›?š™¿É› ”?…1iPeŠ? ×›FŒº?™™©°££q?zž©Mb?áz¤…`ÜQ?[⼃@?¯Gáa-?> ×ÍJœ?š™™‹} ?‡ëQø•ï>®GáZv+Ø>]Âõ­·Ä>ÙCMaDšÀ?r}.˜gd½?®Çà+ø·?ÿ¿¼=\?°?®Xµ Ÿ¤?Âõ>Ä1á—?âz¸Dg‚‰?)\¿Ôey?Ø£xç¢Èg?ØqU?¤p½w¬äA?¯Gáa-?)\BìÜ?ÌÌÌ Žf?¯GáòwÅé>HázÍÕ><*ûoÛ?¾|ïÿØ×?Íìy;žÒ?330\ÐnÉ?B‡jÂI¿?š™%þhq±?…ëÆñqÞ¡?Q¸×ö‘?*\Oã+ˆ~?]BÏøi?ØqU?[⼃@?Âõ¡ìú(?ÍÌ̧ÖY?? ×ûJú>q= 7¿å>•¬œ;ó?3÷ùD?!ñ?{l‘8ðê?öswHâ?×3hÅÝ‚Ö?I= ˜_È?™™É™Þ¸?GáïÄRç¥?Ö£ÂÓÄ’?*\Oã+ˆ~?Ø£xç¢Èg?áz¤…`ÜQ?ìQ8ëÔ:?…kˆ{n"?…ëŠ ?Âõ4Åô>ë[æ$ª@|$Zšj@R°;m7þ?™]å|Îö?Sðàd<í?>ªÛ²¢ß?öh#_6qÎ? c¯¹º?GáïÄRç¥?Q¸×ö‘?)\¿Ôey?zž©Mb?®'#J£I?…+ú>‰1?r= »ƒ?? ׌c?)œù°¦Oç?>>æ‡!Fô?gj{W{åÿ?¸ªÜ¯=@ à6ùžý?Ì8¹oú÷ñ?3³ùì²á?öh#_6qÎ?™™É™Þ¸?…ëÆñqÞ¡?âz¸Dg‚‰?™™©°££q?ìQXœdÉW?Ø£0!ml??®Ç­·g$?®GáÒÉ?Š:ÄÀÎ ¥A­À\WÍÚ!ñ¿(gA= î?4Ë›.9ú@H I<ôÜÿ?Ì8¹oú÷ñ?>ªÛ²¢ß?I= ˜_È?š™%þhq±?Âõ>Ä1á—? ×›FŒº?¥pÍ/ïžd?®§Ñ0YJ?q=Êa:š0?áz½¡?Ö?ç¦H ÀÀþâ¶ À>'»ò À\–(åÀ[ïÓ窳Ø?4Ë›.9ú@ à6ùžý?Sðàd<í?×3hÅÝ‚Ö?B‡jÂI¿?®Xµ Ÿ¤?…1iPeŠ?Ãõ@ ù“p?¸UQâŠT?…«VC09?®G'0@"?¤œèì ø¿†+·ýÉäþ¿|&êê¬À?&©¡n À\–(åÀ(gA= î?¸ªÜ¯=@™]å|Îö?öswHâ?330\ÐnÉ?ÿ¿¼=\?°?š™¿É› ”?®;úˆx?(\?l˜]?Q¸¾Yö·A?efæ€.)?öÈ2C._á¿ g~‹cªé¿áb'÷ø¿|&êê¬À>'»ò À\WÍÚ!ñ¿gj{W{åÿ?R°;m7þ?{l‘8ðê?Íìy;žÒ?®Çà+ø·?ázÆž½â›?ÍÌÐL•€?®GÑu»“c?33³˜¢G?q=JkZ0?ÂÆ7ÛÈ¿ÖC;™ ÜÕ¿ g~‹cªé¿†+·ýÉäþ¿Àþâ¶ ÀÎ ¥A­À>>æ‡!Fô?|$Zšj@3÷ùD?!ñ?¾|ïÿØ×?r}.˜gd½?ÌÌÆë¼i¡?ìs[„?×£Ðvæªg?Ø£ØDqK?ö(X}ú2?ö\ å0å÷?ÂjrHÑ?šµ6GØ‚ò¿ 7=[/FÀ H®ÀÂmþaÒÀ]ÿHp9Ìæ?4QÇM½@âºðá”;ü?·žnó­Nã?˜™’³%§¿ ·ñ.–ˆÕ¿â§þåš?ázL’¦¢?GáÚù«s¿S8ÔW‘¿bNH2´?)Ÿ-É|œ?j\ž#>˜?½i[¿’?/IÔ㤬Š?„V1SÍ?»xFj+v?«4¥OlÎi?”ÒÔJ^?ß/öŠmO?É»QÇ¡ =?VsGß›&?sÞÃTà?}ÓI ?ª0®9µò>ýX°ëiС¾Ô½JºD¶?KÜñ ´?´gŠŒ­°?¥ú-â{©?ÖFÆçÝï¡?¬¹Oàˆm—?‘&9¬ŠŒ?м#€R€?Ë8Þ©q?ðuÁá“b?,à*/q¢Q?R’¢I^@?7Š~5ëä-?Éa6e..?Óàñb?ä˜{Õ ¶ò>+ØðDK…Ò?Þú“‰ªwÐ?°ŽE-B?ý…;`œå-?=©¤?ä?zg&ãg@†ÁIÈ@3ÏÓÛ@€Ô¨(o±ø?3ïÿ׉kð?ù…j•ñã?n|)ÐTÖ?ÝÓ€¹qGÇ?c-x„϶?8±n•-¥?£ú*:Ã’?’„äá×å?Î>Ъ&j?8œâèŒÆT?i>—.+_@?JãÑgóŸ&?s˜\ú" @³¼Og>d@9啳n=@³oÞS@èz 5@íî,f5ü?ñ$Ð…Ñî?÷#òMß? ÏCà»Í?•XÛ£³±º?ú„ä¹ãצ?rºÂbÙÃ’?¼slÓ¾}?%I…!äf?Uo$죣Q?–æ®ËÈ=?›9b‰Ö$,@y锊y*@nVkó3(@½IŽë $@®0.=vÖ@Myòº¨@Ìi¶4ö@ D“>ô?j—ÔÄŠâ?±½¹Š"Ð?]"b²²º? ¶‚Q€.¥?°²Â˜˜:? sÈå*x?‘l b?¬”i¨qO?¤_PÔÄÀ½ýã/‘ø¿Ž(*ì4ÿ@¸/*e[*@‚övÒ±*@àçÛ£#@ÀWÓrúO@ïÂŽb0Í@ÈQÀLôÕõ?B¼»F‹â?ub]ݽÍ?½6ªp¥Ð¶?T*¼&ªå ?Ϊ˜Ý²Xˆ?wTIBƒ«q?;´d¶ß^?Úk0\Î9XÀS Zõ3ÔTÀû3ËÞKÀN¿g2ÀºŒHIe@Î쮼Y&-@þÀ›&@ÚyÅø5\@v뜊¬Î@½ÔÉ1ô?ÀL3üOß?RL ¨ÙHÇ?Ï?‘;P°°?zÉfæÃD—?nê4–S€?¬øv×i?sí êŒLÀZÇÜVÀ AôÀ^À¾#¤¨ãa[À¿è ¦HÀ áÒ7ZšÓ?(§ÜKY-@?ŽÓƇž&@^ò$pÞS@v”ÝCÊù@„ÚæpÒÓî?5VÏhVÖ?Z¬È7¡ ¿?ltcÄRú¤?úìAFSˆŒ?Ñÿ+B7%v?˜Œ¦âÒ¶c@mPÇr‰`@•‚â3I@~칄ÓëTÀl ‡-®‡`À*Ô(Q§NOÀ<] Ú#Õ?~8l 3-@%⤭ «#@†yþa @¸ l¾ƒü?2\“íVîã?6Ã?œ÷Ê??é2³³±?JP1#Ô[—?ÃR¹àž?­’ÉZÚU@ä5M ^@¤Ìœh;f@vvbÑqÍ`@sKû+×IÀ‰PXé!Š`À›û¾ä~ HÀËÖ¥ÁÝ·@ŽÖi4Ë*@ŸÖäZnê@[ÓüE~3@TËìÂOð?m™Øž—Õ?=¾ç°»?Lßß§¡?”_|V‰?ˆ×ÉþÞÁDÀáœ`ÿ@3Àùgf%Ê2I@I–Ê–Åd@©¹N´`@ßM—AUÀc(L^j[À6|þ'2ÀU˜ykÒÕ*@.B};$@Äó¢9@+Šßc%’÷?hš$ÀåÞ?ÇñXrH·Ã?xTL•V§?gÙY³ù‡?;J¿]JFÀ3P³KJÀ÷ÊßRŠEÀ>µÇ’ˆ2F@ÅëÑåÃVe@o`™lj™F@Œ/A_À•.@¯¯JÀµ^¦V³‰!@ã&Xmb)@k£IÜ @¦óKÛö?­òñÒ#á??~ÕP÷È?É9Rb> ¡?áhÙì—¤¿<ˆˆª›)ø?‰ÐÒy+>ÀÛT5–ERÀÃSå&ýNÀrr(ÜéCR@½ñšAš˜X@5ÂOhWÀ·µ(xÕKQÀ³E.,ù%@a¡¡¦ÎÊ1@¢Žvð9@Ä*íÀݨб™?½¥ùø´±Ñ?Ü«"œ–Å¿eðp9ÚÈá¿bû­Ü¨¾iÀ7éçØ®UÀ/Þiš´90Àž¼¾éÜ—S@ŒyÊ– ôp@æyvrÕq@8³ÌidªSÀžYjðgÀÅ2ÁíëHÀ~ð§À©{@kÕåYJí8@KI…ÛDC@/ÝÇÏmÀÎ7x ¹Ã?Êé\ŽïØ¿ßu±v¢ë¿FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((48,32) (63,47) (0,0)) 7 ÀGëhOlL¿ t¤sœ7L¿ ‡e_ÅÙK¿`IS‘kK¿`qùœ…D¿XñÆ}¶C¿QÃŒ,C¿ ¼LNŠB¿@ʨÛa€<¿@4û(ÖT;¿àèx¤‚:¿ jêî[„9¿@JDTÈ2¿€û#Ý1¿†c«=1¿ùÑ Œ0¿@Ñw‘ÈjK¿ ¤”Â`ØJ¿ào§«šíI¿`Ê¡³aH¿€á®5xrE¿@z»”(ÉC¿àk¦ºÍˆB¿'Ò.´,A¿àN3 S>¿lœ0¢;¿ ¿ß6 ±9¿`HãE>‹7¿@*¦qC44¿€Ü`ñ_<2¿m”£xº0¿ÀNRRÒJ.¿€¢ú¶<åJ¿`…ùHæI¿5Ñ9µ£H¿x±•¦ G¿Jã²…E¿À7¢èrC¿à_EÑB¿°£+y @¿},dO>¿ dR*c;¿ >Ðé9¿ yR€OÃ6¿`%¦7YA4¿€S¦%2¿àãŽÈ‹J0¿Àñ¡Ýä,¿ ¶U ÏKK¿à<¿ã/II¿ -e“T®G¿`¿•¼ùF¿ ¶Ô%sD¿ˆ)èB¿_°"…wA¿€!;J@¿àZ³»Db=¿`n©Ö¦Ö:¿ Æ{Ìnx8¿@¾â›,6¿`b+`+è3¿àÛ¤BUÎ1¿€üjAB¯/¿™…Ø+¿à?{ŽÚXJ¿žJÎÒQH¿à¥©ÝJµF¿à×3O1E¿@ƒƒö³C¿ðiÏÓCB¿Å³ã@¿@–K¥?¿àóŽd<¿ ¯8¼X:¿àÉgÛmÊ7¿`—BÄXŽ5¿`Yýjnd3¿€œÒüáS1¿€×i6³.¿Àn […×*¿€Ií:H¿@lþnùF¿ ƒËù¡¤E¿`dt[DD¿8ZÏäB¿0}wŽA¿ í?òyB@¿À»•ÎD>¿À1½'—;¿à4¯ê3C9¿ Àv%—7¿ *0öÝ4¿@¹‹SÇ2¿`EÛ)Ã0¿á¼Nž-¿1 )Í)¿—ÔBæF¿à$”kàE¿iœA D¿à-ø­UC¿àx¥'B¿€<ÅMÎ@¿ sHg.?¿À´þ”SÒ<¿@‡W( ‰:¿çϸR8¿ ýa£Ä.6¿ ÈîL•4¿È€À2¿àò6³G"0¿˜g›†r,¿@ĶÁÞ³(¿@rdq¸F¿PáÐÎE¿à;ÏX˜¦C¿ Ú×8fdB¿ i[P 0A¿ßŽ'@¿ VZåæÄ=¿ÀÎJ_æŽ;¿€]DVñg9¿±ŽáO7¿àÝN-F5¿ ›?àÙI3¿ BxÑY1¿À`/Ûãé.¿€©Ç4^3+¿€xÊ)=Œ'¿à(;¯«}E¿æŽ[$ÚC¿0¶jFB¿ßµ®WeA¿ uªªxH@¿àªPh>¿æ LL<¿àwnõm<:¿ }Xô78¿àë½Ð®>6¿ (O*5P4¿ Û²mÓk2¿@ú’¹0¿@Äiáþ{-¿@FÅ2Ñä)¿À¸ ÌæX&¿ R 'C¿`„m=†VB¿ÀõêÍyZA¿ÐîäúlX@¿Àr‘ ±>¿`sÑ’¸<¿@ ìîÖÇ:¿À8®Þ8¿ 5ìRÃü6¿€’5°"5¿ÀëV%P3¿ ˜¥…„1¿@ª`ãƒ~/¿@¢¼SÓÿ+¿@ÊÛè‹(¿@YÅF?%¿à߮信A¿Àêv°þ@¿à^3è*@¿ }æ½Ï’>¿@9ge¦É<¿ ºÝBk;¿à¼«²ì;9¿`‚ÔŸ:y7¿ 8Qع5¿@€C˜)ÿ3¿ ÊÂû)I2¿Àâ%îÙ–0¿€6žà¾Ï-¿€0Z¡Éy*¿ë+Ö*'¿²¤ÿÜ#¿ÞR³¾@¿ Þë⃯?¿À¡/>¿ ŸCôz<¿ ý˜Ž`á:¿ e}…ˆG9¿µU16­7¿ÀåX•6¿@Žà8r4¿À]EôÖ2¿ ÏáK>1¿ìd²K/¿€Ê!ú,¿À3ëztí(¿€TÊ)µÆ%¿ØT&pœ"¿`†ûÊ}Ù>¿Úò0=¿ *þ}È;¿àW×te:¿À7I&`ù8¿ Ú r Ž7¿BÁ•Î 6¿`¦«¶ª©4¿ÀÛò:‚'3¿€4óî«1¿`ÈËé40¿@Vûk-¿g©Æ[*¿@aþþX\'¿¿/Ðf$¿ÀÑ%é}0¿[ €6`.¿À  î²+¿` ÿš‹(¿@r©ŠÂ%¿@ ­õ#¿4ê³™? ¿`̈HñJ8¿€%»ô¶ì7¿‰Ÿ¾Q7¿ÀÕ¾«t6¿ ¶@7ÿ5¿ hã5F4¿€™%ö…33¿@°gù2¿ÀBKvUf0¿~/®p….¿€ÍÍÇž€,¿@Çj>Ý*¿¡À¼™s&¿1ˆ $¿êEPï!¿€Áí@cç¿`ÖH0ÓÁ5¿àԥܣ5¿@ô5l5¿ £Mî5¿`Õ‡·À2¿àFûÈU2¿ ÿ1Ÿø1¿ n;E|1¿À·ÆÃÚÎ,¿€ãüÍ+¿@á¶²öü*¿4‡‰í)¿ÀL6f#¿Àáép"¿À™“J)!¿€|Ÿ‰a ¿ÀðÌèJ¿`Èò¦ #I¿àCx 1G¿ÀÌCg"D¿€§ƒå5C¿€•ïŽ\D¿@cTè)D¿À•Ä™ËB¿ÿ:(ÆŠB¿i4æsC¿ðáÿ&^C¿öîÝ*`B¿àÍ{ÂAB¿ÐW• C¿€ÓÞ#C¿ð£É;toB¿àÍŠ$ŽªJ¿`°0Áª¨I¿€±‹­NH¿À-¢[dºF¿àCHxÜE¿@è=î µE¿àW9@VE¿€«” ³D¿€ï¸Û¾eD¿ãÑÄrD¿pñ\dFD¿à·³tßC¿ ?2‘ô¶C¿°ë[«ÙÑC¿~]bºC¿`8ÎQëgC¿À8ÉãýJ¿`àˆ#ˆJ¿½„#¦I¿ ³ÂÒzœH¿ ³`¯gÍG¿ 5ÿØ EG¿@ZÆF¿0ÖÒ¤¿DF¿Ð¥„ÐbæE¿ ÅÚO «E¿ðr&& iE¿„CŽE¿@“8§1éD¿ðŸà½zÉD¿p.BŸD¿ V"^¢^D¿àcQ¬–K¿€û)ÎåÕK¿÷½l%K¿`@HDJ¿ ôò³ wI¿€/sˆµÍH¿ú¦üð8H¿€Q%5³G¿à5rvDG¿  yaéF¿Ð¥@ꃖF¿ÐzÌbHF¿0-W ÉF¿ Âb@ÍE¿°/Xåý“E¿@-[.RVE¿0 Ó“£P¿À¼N¿€õËÏÕL¿à<ß±5×K¿@n˜ûýJ¿páMž7AJ¿@^ÒnœI¿PÅ»‘! I¿€“˜pH¿À+55õH¿à2=>«¾G¿Lø¯fG¿°eSOG¿‡zÝ¿ÑF¿BÂÅŽF¿À¶¸KMF¿}<ÒcpP¿ {"Ž+nO¿ ò)î EN¿ yk÷EM¿ó´‘àdL¿`\Ž”K¿àÕ Ù³ìJ¿ 4.WÁOJ¿@"èŠ(ÅI¿€ë®·JI¿¢ØáƒÝH¿`Çò‚b{H¿ …¯m#H¿p¯ý©ÒG¿ÀÑŒ ˆG¿´p¶AG¿à­ÁªP¿°˜ˆ›T?P¿@`_eŠO¿ £NÑÆ–N¿ ÿ‰’ã²M¿ ‡ãL¿`Z Tú(L¿`Åz‚K¿~ǺíJ¿¹=hJ¿àyJñI¿ÐGEÄQ†I¿° Àâµ%I¿€”ÃÖÍH¿  z}H¿»Z¬"2H¿Êß ñP¿5ÂÓœ×P¿0¤ƒ›gP¿  ‚Bä×O¿ áVmbìN¿€g~̪N¿Ð®Ü§QM¿`B•”I¢L¿PjÐõL¿0KèÙwK¿ÀÉO ùJ¿ ów“ä†J¿@-P:«J¿0›'—èÁI¿0†ùµ9lI¿ÉutI¿(¥ ÞàR¿Ø‘£4ÉÆQ¿0ùm¡·Q¿ðõµ›†P¿ˆ^:ˆ P¿€8Ç%1O¿à®ôÒ­fN¿€·®ý°M¿0ÝØ › M¿Àt|yL¿gÈíMôK¿å¯|K¿ 'èÛ)K¿`.“Mç­J¿pCϯyTJ¿p7cÆJ¿è n‚ S¿ð—Ä4tMR¿Ÿ©|å¡Q¿(JaÒºQ¿ ‹ÛSØŽP¿Xá‘©}P¿Ðÿ1sgO¿À¦‹u¬N¿P!´TÕN¿@sáz¹kM¿`pƒPƒâL¿P26_¢fL¿û¯8•öK¿ Yo‘K¿M»ÿ4K¿à1ívUáJ¿ÈWñŸ¥HS¿ÀÚÓãØ¬R¿è:Úê³R¿ÐìÂ9“‡Q¿xEEÀQ¿€rÇJ×’P¿èeŒ×)P¿‚³® –O¿ÊA‹êN¿ ¶p/nON¿e]zcÃM¿Ð· DñDM¿Ðv6”wÒL¿`ß- ÈjL¿Ð ³ L¿ð¨:Ê€¸K¿ˆñË6ìqS¿`³g»S¿@£Ì€|R¿˜r2LÂòQ¿`Iq0sQ¿ B»ÁëþP¿h·H¦Å•P¿(óã¿6P¿ÐúÕÒÝÀO¿(Þ‡$O¿€ê%«–N¿Ðã¤GN¿pS^Ç£M¿ Öx:M¿0Cv:2ÜL¿°î–˜Ñ‡L¿¼KgT¿HþÙp©‡S¿xÄ[ÓáR¿˜wÈ;ÅSR¿°…­!÷ÓQ¿èBp²á_Q¿(ŽFâ“÷P¿Øåw&Å™P¿(_žÞ­CP¿ #wøJéO¿PHíð[O¿ÐebòÝN¿àwzjN¿PmJYÿM¿0¸/È_¡M¿`}@\:OM¿pÂ;ûþ†T¿}ÄÜöÌS¿˜â¸]/S¿1°ˆ¦R¿è¯,?)R¿à µQ¿Ð† ãNQ¿Ð¬ÌöõP¿X· îÝŸP¿H\çWçNP¿XW€šíP¿ Ví牚O¿P_Æ@'O¿€bÀ{…·N¿@×ë?¹ZN¿À%à=ÿN¿püž@—T¿`è"nÚõS¿(eΧ$hS¿MDZúíR¿ˆžÈ+…tR¿ˆ¢]6vüQ¿À uNÕ™Q¿¯ºÅKQ¿ÐRYÏ÷P¿àNZ,žP¿@ô—§‘YP¿hs#¡Œ)P¿U§ìàO¿ÀtšžÂ\O¿P1ß}O¿€ÏD!ÐN¿èû¬ŠžT¿P¾SC T¿X¯ù_S¿Ø¬OV¸4S¿XF~Žž¾R¿ÀbUn.R¿í§=6ÐQ¿x)ò_¨Q¿à 2nUQ¿`ÅfÜhØP¿Èyp •P¿ÀªU•åŽP¿P ûJVP¿euÙ—ØO¿À¶±÷n€O¿°¡À´¦O¿4M¹ýÿï?Ö–àXÿÿï?òlÐÿÿï?²çDòÿÿï?΃üÿÿï?”?ßþÿÿï?œ>­ÿÿÿï?~Hèÿÿÿï?4ùÿÿÿï?\ þÿÿÿï?qÿÿÿÿï? ×ÿÿÿÿï?Dôÿÿÿÿï?¤üÿÿÿÿï? ÿÿÿÿÿï?ºÿÿÿÿÿï?~Gqãýÿï? +`dÿÿï?øB8Óÿÿï?°Ðóÿÿï?”Lüÿÿï?D‰ïþÿÿï?¶±ÿÿÿï?¨‚éÿÿÿï?xŠùÿÿÿï?1%þÿÿÿï?®wÿÿÿÿï?ÞØÿÿÿÿï?Äôÿÿÿÿï?Æüÿÿÿÿï?ÿÿÿÿÿï?¼ÿÿÿÿÿï?¶.æ.þÿï?æÚõxÿÿï?´úØØÿÿï?Ù~©ôÿÿï?Y¸üÿÿï?Q ÿÿÿï?jé¹ÿÿÿï?”Åëÿÿÿï?W*úÿÿÿï?fQþÿÿÿï?ìƒÿÿÿÿï?BÜÿÿÿÿï?¶õÿÿÿÿï? ýÿÿÿÿï?&ÿÿÿÿÿï?Âÿÿÿÿÿï?úAŒþÿï?îq©’ÿÿï?Xòßÿÿï? ÆŸöÿÿï?ÞSCýÿÿï?Ï3ÿÿÿï?•Äÿÿÿï?Š»îÿÿÿï?Ôüúÿÿÿï?æ‹þÿÿÿï?2”ÿÿÿÿï?Êàÿÿÿÿï?øöÿÿÿÿï?dýÿÿÿÿï??ÿÿÿÿÿï?Èÿÿÿÿÿï?rWçêþÿï?Àê;­ÿÿï?bçÿÿï?6Ä´øÿÿï?,uØýÿÿï?<ˆ]ÿÿÿï?˜AÐÿÿÿï?Èÿñÿÿÿï?àæûÿÿÿï?jÍþÿÿÿï?Цÿÿÿÿï?îåÿÿÿÿï?jøÿÿÿÿï?Ìýÿÿÿÿï?\ÿÿÿÿÿï?Ðÿÿÿÿÿï?ìI"?ÿÿï?ì[HÅÿÿï?s²;îÿÿï?¯§úÿÿï?RÑeþÿÿï?–…ÿÿÿï?ò—Ûÿÿÿï?œ4õÿÿÿï?ÜÎüÿÿÿï?òÿÿÿÿï? ¹ÿÿÿÿï?'ëÿÿÿÿï?âùÿÿÿÿï?6þÿÿÿÿï?zÿÿÿÿÿï?Øÿÿÿÿÿï?vF*‚ÿÿï?´úØØÿÿï?³êóÿÿï?”Lüÿÿï?”?ßþÿÿï?hƒ¨ÿÿÿï?Öåÿÿÿï?‚øÿÿÿï?¡ýÿÿÿï?ôJÿÿÿÿï?(Êÿÿÿÿï?ðÿÿÿÿï?Fûÿÿÿÿï?šþÿÿÿÿï?–ÿÿÿÿÿï?áÿÿÿÿÿï?h²ÿÿï?bçÿÿï?.C<øÿÿï?Ü„’ýÿÿï?@/?ÿÿÿï?•Äÿÿÿï?†Ìíÿÿÿï?4túÿÿÿï?fQþÿÿÿï?ó}ÿÿÿÿï?ÞØÿÿÿÿï?Dôÿÿÿÿï?~üÿÿÿÿï?ôþÿÿÿÿï?°ÿÿÿÿÿï?èÿÿÿÿÿï?øB8Óÿÿï?Pö[ñÿÿï?|ŽEûÿÿï?n@}þÿÿï?–…ÿÿÿï?¨’Ùÿÿÿï?xôÿÿÿï?æJüÿÿÿï?ÚÛþÿÿÿï?Цÿÿÿÿï?¼äÿÿÿÿï?º÷ÿÿÿÿï?€ýÿÿÿÿï??ÿÿÿÿÿï?Æÿÿÿÿÿï?îÿÿÿÿÿï?bçÿÿï?&¦»÷ÿÿï?ÞSCýÿÿï?°ëÿÿÿï?Ðíµÿÿÿï?~Hèÿÿÿï?Ìxøÿÿÿï?¡ýÿÿÿï?$Bÿÿÿÿï?üÄÿÿÿÿï?Âíÿÿÿÿï?dúÿÿÿÿï?Hþÿÿÿÿï?zÿÿÿÿÿï?Øÿÿÿÿÿï?ôÿÿÿÿÿï?°Ðóÿÿï?Žûÿÿï?n@}þÿÿï?`|~ÿÿÿï?-Õÿÿÿï?Èÿñÿÿÿï?îwûÿÿÿï?æ‹þÿÿÿï?œ‰ÿÿÿÿï?šÚÿÿÿÿï?Dôÿÿÿÿï?Wüÿÿÿÿï?Þþÿÿÿÿï?¦ÿÿÿÿÿï?äÿÿÿÿÿï?øÿÿÿÿÿï?0ˆùÿÿï?T’¶ýÿÿï?Ï3ÿÿÿï?jé¹ÿÿÿï?~Hèÿÿÿï?‚øÿÿÿï?úaýÿÿÿï?ò$ÿÿÿÿï? ¹ÿÿÿÿï?4éÿÿÿÿï?¼øÿÿÿÿï?³ýÿÿÿÿï?Fÿÿÿÿÿï?Æÿÿÿÿÿï?îÿÿÿÿÿï?úÿÿÿÿÿï?(›éüÿÿï?”?ßþÿÿï?²˜ÿÿÿï?ò—Ûÿÿÿï?Êbóÿÿÿï?Ö°ûÿÿÿï?æ‹þÿÿÿï?ìƒÿÿÿÿï? ×ÿÿÿÿï?œòÿÿÿÿï?©ûÿÿÿÿï?šþÿÿÿÿï?Žÿÿÿÿÿï?Üÿÿÿÿÿï?ôÿÿÿÿÿï?üÿÿÿÿÿï?®L“þÿÿï?8õvÿÿÿï?ž”Íÿÿÿï?†Ìíÿÿÿï?xŠùÿÿÿï?0¾ýÿÿÿï?â8ÿÿÿÿï?>¼ÿÿÿÿï?4éÿÿÿÿï?jøÿÿÿÿï?€ýÿÿÿÿï?.ÿÿÿÿÿï?¼ÿÿÿÿÿï?êÿÿÿÿÿï?ùÿÿÿÿÿï?þÿÿÿÿÿï?<ˆ]ÿÿÿï?è9Áÿÿÿï?~Hèÿÿÿï?8÷ÿÿÿï?ÜÎüÿÿÿï?ÚÛþÿÿÿï?™ÿÿÿÿï?BÜÿÿÿÿï?¾óÿÿÿÿï?Øûÿÿÿÿï?šþÿÿÿÿï?Šÿÿÿÿÿï?Øÿÿÿÿÿï?ôÿÿÿÿÿï?üÿÿÿÿÿï?þÿÿÿÿÿï?jé¹ÿÿÿï?4+äÿÿÿï?œ4õÿÿÿï?àæûÿÿÿï?^yþÿÿÿï?qÿÿÿÿï?Ìÿÿÿÿï?Âíÿÿÿÿï?žùÿÿÿÿï?Ìýÿÿÿÿï??ÿÿÿÿÿï?¾ÿÿÿÿÿï?êÿÿÿÿÿï?øÿÿÿÿÿï?þÿÿÿÿÿï?ð?%î#ð?I¶Sð?«Éóð?*ŒÝð?¾÷ð?6`ð?²`)ð?ÁÛ ð?ÿeð?Rùð?sGð?zð?Þð?®ð?{ð?#ð?nGð?ªëÏMð?£Þcð?«—pð?¶üÙð?^;ˆð?ó$'ð?¬> ð?Ä:ð?híð?)Dð?‘ð?žð?ð?vð?"ð?ÙõŒèð?ª…Cð?¾‚“ð?–@«ð?~Ó£ð?wWyð?K #ð?6 ð?Õêð?M×ð? >ð?ßð?%ð?{ð?mð?ð?uçø¹ð?ÄG«6ð?dÿð?±°ð?V^ð?|fð?rµð?;¢ð?–ð? ºð?ç5ð?›ð?„ð?Nð?að?ð?÷XŒŠð? b)ð?}¿N ð?æ¥ð?jÅð?â;Qð?4ßð?ð? ð?K™ð?»,ð? ð?Ëð?ð?Rð?ð?OÝn`ð?@Ò[ð?Ë&âð?©¬ð?WÍð?÷4=ð?4ð?²eð?’˜ð?‡xð?{#ð?m ð?ð?åð?Cð?ð?¼Ýê>ð?¾‚“ð?u¦ ð?¶üÙð?6`ð?L¾+ð?1 ð??öð?€/ð?†Zð?ìð?üð?]ð?³ð?5ð?ð?©üž&ð?}¿N ð?jÞáð?’½6ð?`h`ð?rµð?½ ð?æÅð?M×ð?Að?‘ð?Þð?Áð?†ð?(ð? ð?£Þcð?ÛRð?Â8]ð?É_Áð?÷4=ð?¬6ð?Äüð?Úð?’ð?»,ð?¢ ð?#ð?@ð?að?ð? ð?}¿N ð?î,"ð?V^ð?(Šrð? %ð?ÁÛ ð?šÃð?€/ð?î^ð?‚ð? ð?Îð?Üð?Cð?ð?ð?«—pð?ÿ89ð?É_Áð?ÐÁ@ð?}ið?ð? Dð? ºð?2;ð?³ð?Þð?Õð?‘ð?-ð?ð?ð?é;8ð?Ö¶$ð?|fð?K #ð?ÁÛ ð??öð?Oð?‡mð?{#ð?f ð?¢ð?'ð?]ð?ð? ð?ð?l2‹ð?6`ð?§·3ð?4ð?›Nð?•'ð? ºð? >ð?zð?²ð?,ð?³ð?9ð?ð?ð?ð?©Y¶ð?d…Dð?±5ð?½ ð?Ä:ð?è ð?cð?á!ð?f ð?Ëð?@ð?ið?"ð? ð?ð?ð?â;Qð? cð?ÁÛ ð?ôcð?’˜ð?’ð?q3ð?ßð?!ð?ð?³ð?;ð?ð?ð?ð?ð?K #ð?fê ð?²eð? ð?QÃð?sGð?¸ð? ð?1ð?ð?að?!ð? ð?ð?ð?ð?Áõ(=ÆF8?433ï³Jô>°—äÜ>âzÎ +È>ÍÌÌŒn>±>HázŽ”>Ház0v¾×£p=eF‘¾ ×£pýM>>ÌÌÌÌL—!>\Âõ(°¾z®Ga–¾š™™™™ÙÐ=…ëQ¸¶=Ãõ(\ª½¸…ëQxƽ[B¦ÍW5?> ××C3õ>]ÂùuØ>·…+ï3¼>4333·? >š™™™µ¶‚>Âõ(ôŠe>®Gá:ÊH>¸…ëQ„,>™™™™™e>R¸…ëÙò=ëQ¸…«Õ=¤p= ×ã¸=…ëQ¸…œ=Âõ(\€== ×£p=j=ö(Ý ¬1?š™™-Sò>…ëQ(PÕ>ëQ¸À¸>†ëQ¸Z´œ>q= ×a €>Âõ( >c>Âõ(<@F>< ×£ðµ)>q= ×£° >R¸…ë!ñ=R¸…ëÁÓ=ÍÌÌÌÌ̶=Gáz®Gš== ×£p=~=ö(\Âõh=Âõ¨®7,?š™™ +ƒí>¤p= 9]Ñ>š™™Ù¦`´>âz®ÀÛ—>š™™™Éà{>= ×£`B`>\ÂõèïB>¸…ëÑ&>…ëQ¸— >ëQ¸…³í=Ház®7Ñ=¯Gázî³=…ëQ¸—=efffffz=Ãõ(\Âe=…ë¿a"?…ë±I1æ>¸…kS‚Ê>®Gaƒˆ¯>áz®°’>…ëQ¸âv>š™™™‰Z>= ×£°—>>…ëQ8ò!>®Gáz>Ãõ(\’è=q= ×£°Ì== ×£p½°=…ëQ¸…“=¸…ëQ¸v=Âõ(\b=Ø£p%Qò?®Gá*Bß>S¸elÃ>Ö£p=ú¦>Ãõ(\—£‹>¸…ëp>{®GA¿S>¸…ëQ{7>®Gáz×>R¸…ëu>43333kã={®GáÚÆ=×£p= ת=™™™™™™=Âõ(\r=®Gáz^= …ë‡ù?ÍÌÌ,c¯Ô>ázîN«¹>š™™™×œŸ>®GáŒVƒ>ÍÌÌÌì…g>R¸…KxL>q= ×ã&1>R¸…ë•>Ø£p= Ÿø={®GáZÝ=ö(\ÂuÁ=43333³¤=ffffffˆ=ÍÌÌÌÌÌl=­Gáz®W=…ëQ„—Ê?)\Â$ÑÉ>\Âuü`°>…ëQ¸G–”>q= תy>¯GázdÃ_>Âõ(ü‡C>ëQ¸…â'>¹…ëQ >­Gázšñ=ÍÌÌÌÌ<Õ=Gáz®‡¹=š™™™™™ž=R¸…ëQ‚=Ãõ(\Âe=Âõ(\R=4/„û>¥p= ؾ>›™™qУ>Gázüt‰>ffffJ1p>ÍÌÌ̬kT>®GázŽ9>R¸…ëÂ>ž> ×£p=è=¹…ëQxÍ=q= ×£ð±=ÍÌÌÌÌÌ•=ëQ¸…ëy=`=š™™™™™I=š™™ÉÊké>)\ÂÁ±>Ãõ(\tÌ–>¤p= Ÿù}>…ëQàzc>4333óI>)\Âõó/>Ãõ(\4>Âõ(\^ù=ö(\Â¥ß=…ëQ¸žÃ=¸…ëQ8¨=š™™™™™=> ×£p=r= ×£p= W=433333C=Gázt¹À>> ×£¾Q¢>Ãõ(\‰>áz®ËÚp>Âõ(ìfV>ÎÌÌÌLn=>)\Âõ!#>)\Âõ¤>43333{ï=43333óÓ=áz®G!¹=[Âõ(\Ÿ=Ãõ(\ƒ=h=)\Âõ(L=)\Âõ(<=)\rUѾ…ëQJÃ’>> ×£”Pz>…ëQø'b>Házn±H>{®G!“0>¯Gázþ>\Âõ(àü=…ëQ¸Æâ=ö(\Â5È=†ëQ¸¯=£p= ×£“=¤p= ×£x=\Âõ(\_={®GázD=¸…ëQ¸.=Ãõ(ÜX9Á>\Âõ¢s‚>q= דj>¤p= ·ÉR>*\Â5(:>š™™™ó!>Ház®Q>ÍÌÌÌÌHð=Âõ(\’Õ=Âõ(\O¼=áz®Ga¢=Ãõ(\‡=¹…ëQ¸n=×£p= ×S= ×£p= 7={®Gáz$=×£p½s¦©>…ëQhzq>ëQ¸UÔY>…ëQ8ºB>)\Âõ±*>)\Âõ»>âz®Gíù=fffff¶á= ×£p=êÇ=°=> ×£p=•=…ëQ¸…{== ×£p=b= ×£p= G=z®Gáz$={®Gáz$=*\ÂÅ\‚¾p= ×óü_>|®GÁAH>333332>\Âõ(P>…ëQ¸â>ÌÌÌÌÌ´ê=> ×£pÒ=)\Âõ¨¹=ö(\Âu¡=\Âõ(\‡=)\Âõ(p=333333S=¤p= ×£@={®Gáz$=ìQ¸^¿Ò¤¾âz®§vP>Ãõ(\ϲ7>43333¯>{®Gáš >\Âõ(xõ=Âõ(\rÚ=®Gáz”¬=ÍÌÌÌÌ̯=×£p= ו=efffffv=¼…ëQ¸>½p= ×£pM=š™™™™™)={®Gáz={®Gázô<M)8MâÇ?m!$ù¡?ÚrÔë@}?Ý¡÷J›Ÿg?ݘ‰k_€S?Qn±}E*8?…%r!Î\ ¿œ]~™Þ5¿;cÊt{¿]#›.v°¾CN8f-À¾Œã-šGϾ‹™^äà«”¾õ.ÄŒ`ÒA>>ΫÁö‡k¾­"âý7¾ÝÒ‹:Å?û*M$âó? xè‹q?&`.H¾K?,f97Þ0?É“ÐàL^?/Lð¸Žå¾„fþ„$¿2´ƒÂYݾyrÔ4Ó¨¾t3w¨´î”¾X<ÚÞP¸¾¤üÖ—Fs¾Q°—äQ;¾(¹Iª*:?¾};K*¤O¾„GÂqNÁ?_èA“•v˜?bL;´&j?-pÈû@<@?ΗµL%´?ö½ÓW=ø>‚Ëî HVÇ>ŽÌÆc±Óʾ½8Üã>—¬¾lïÆYð~¾K4cý=åa¾'ˆØýÞkg¾Ö®EXÓ0F¾…Ä‹gT¾žÆ!ë•̾mº‘}\¹¾¡LºŸ5º?%å‘÷—®’?¾wþ¾ÜÝc?—NÝ€£Á7?z撚]?˜XÎÖÙí>§-¯fË>)f²P•ž>yvª?y> 9Ê+€c>©çYfÚäG>z²¤ž½y8jë]SÕ½ÐóÌ‘„=à=WÁ¤ž½J±4€Ðà½qÇ›{€£¯?›o‹Îȇ?'xwÍÌ>Z?ÍýžG0?`ØP?UùI—èvå>Ĩ=éŸÅ>h£T¦>¼¨)m„ˆ>qöF {‹l>é-ÉÑÔ»P>ç2–Íå.2> èb«>5·ðûD›ø=Êh"3Ý=\l‘$ß¼=CýˆYå¡?r{ºKWÆ|?¼þ¶¶ÒCP?©sžÀì%?¤¸,ñP?–z( aÞ>ÅAàj©ù¿>cð ¥Ý¡>gv¼¨ ’„>a%Éœ!h>X³û? cL>¬¶¼¥ñŸ0>A ¬u>yñÙ²RÍö=lOÅ'‹Ü=úø&cj¯Ã=Qb1>?\ŒUÒa—n?!ËÑö)B?É!çX*?{0ÊSÎô>Lm·„yÔ>„øj¢m¶>ù$:ß™>ìD×Ý÷Š~>Â0ðZ'b>œË!T£ªE>9j¹|±)>á!ƒÚ­>ç?·›u5ò=r^_pVOÖ=\l‘$ß¼=¾*21qt?à0™›¾Á[?áÙ¦¢m2?ÈÎOëÕ ?º‘ÚÿçQé>‚ägDLiÊ>'5`¬ˆ®>󑜔ìÈ‘>c¦xŠbu>¤—=z{ÛY>~–2Í’5?>L?ÃQÐ">󧜑TŽ>Z–UH2ë=㬨ªañžÊÀ>¬¾¶xi£>o³Äïg‡>ÑÕ6²§l>Tû|‘Q>‰Ô…¬ø9> ⿾ÿ=«Îägä=Em[§Å=¹+Ãi`ÿ´=. Z3èh?N4XÎ^±G?I>Uå0?/R ¯€bô>xWb¨¼ŒÒ>z/õÊÛ´>/uˆèä—>”U›x}>6l¹v\b>Ø]k×1êF>?Œ[¯'v,>!žHú—>—ŽNŽYæõ=UÛ6“Ú=ˆ“îU~Á=-‘ûvLŸ§=·6"ææ5?#÷~l?{áȈ/þ>YöÁ ñ•ß>À&YçÂ>·å<‡ö¦>ŠIâ Ç‹>Ð¥‚€N²q>Ñ¿8gè“V>ÈÈw–®<>'›‹ö">:–xÃÑì>²¯£K-¹ë=‘¹ãÚv Ò=.‘ûvLŸ·=?ÆŠ\t_¢=(”¬!Ñ—M¿ {a*Q=(¿ÁÒ×N}ïå¾QŒÁW¶>5®v. ²­>¦Z ~–>~¬ßNv¿~>/72 ‰cd>axAk§J>¤—ý¼LE1>ƒöVÿ×>ÉñN(aü=@ÆŠ\t_â=Em[§Å= ö3„8?ª=‘Á¤ž=pÓ—ÂÇÿÔ¾ËnAÅÍX?Iè¯ûïÓ>\£Ö]š¸>’;FV¡>*1¨™„†ˆ>K¨Î§ ãp>fJXµþÌV>[ØE¹n>>Ø®õ¨G $>8Øh4¸I >XЄõ~úð=ÃQ¸îXûÕ=d)Њ.»=@ÆŠ\t_¢=§ö3„8?š=°qü¾?Ëó_·£?SvyBûTÓ>€mU«™°>x§*¾p£“>j‚ãÛ]Uz>ÎV=´Œb>&O«d}H>=²3ò·0>Åä21Uy>WEËvðý=óe¬ n1ã=è×}BïÈ=‘Á¤ž¯=Á¤žŸ=•êBÁx«>šW“0x˾šÉÙ³Ÿš›>©r¬Ÿ“>«­~*“X>ø%òâÍ—j>qXçßnR>'ŠÅÚøý5>tÇr޽)!>/²s¯¿M >qmùÐ…ð=‚‡3çÊ=\l‘$ß¼=¢ö3„8?š=°+Ãi`ÿ”=‘Á¤ž='àп ¡½ù¾n¦SÆ0¾²;6,&ƒ¾ÓÂ̽`>"F9\Ó]>ê›IJdTA>ATˆRë¾SЄõ~ú>$ •å>YÛ6“Ú=Î (¶Mu×½>ÆŠ\t_¢½¬+Ãi`ÿ¤=¶+Ãi`ÿ„½‹Á¤ž½ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/Level_0/0000755000175000017500000000000011634153073023312 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/Level_0/Cell_H0000644000175000017500000000040611634153073024363 0ustar amckinstryamckinstry1 0 7 0 (1 0 ((0,0) (15,15) (0,0)) ) 1 FabOnDisk: Cell_D_0000 0 1,7 -0.0563860982167054,-0.0569398230921252,0.6704599494051,0,1,-1.43409920413226,-62.1461408419858, 1,7 0.0629711159556485,0.0620698289056,1,1,1.49151340193743,1.05221357407728,24.448174839829, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/Level_0/Cell_D_00000000644000175000017500000003412211634153073025020 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (15,15) (0,0)) 7 €Ž“¬P ¿€zç×ê¾€6jOÕù>€@zƒÈZ?°¥6 ?°¤“FýP?°*ñ‡‚?`Ov?€Ý.\”}?gXÅòLñ>à=,å-ÿ¾€:½V¿ÀRvª¸r¿@Cºž¿@æ¿ ¿f¿@Eý8'¿à—¤èps ¿YÄaÒî¾ÀÖ5¢eXü>ÐÖ—°?8sz»L%?Àq,€?W…y ?€ñø™ŠA?@ôß?O€z“ô>€³ó¿¿€žÿH$Ä¿@¶ˆnè¿@_O=²9 ¿ÀRÿ)wÿ¿À0 Κµ¿P/%c¿€v%û×ó¾P¡‰ áI?¨ë¦ê?ü¿NMG ?4yYDM$?P8ñNÇU%?¨[›ÆÌH"?@—X^Ÿ¶?ç!%ŠTú>K˜nê ¿—€>|r¿À°o¼û#¿À1Å¿æ$¿`ÝÒ*·"¿@WÁu0ó¿ YDi¿æ§ª3ûú¾°fISm©?Øh” ã?v%C›#%?lž½@‚ö+?@:hæÅ.?0f)†`@+? šÆ–3!?ûv â?@O?6tž¿à%úŒ%¿À'-§y[-¿ eK«,¿ÀÙœâ|(¿  u<^"¿ )öªçñ¿ P™l¿ƒÃèûù?ˆÍàT”?œQð’œ+?rÜÛæé3?Œ#ÐË8?€,Ö7`}4? WÞno*(?à×òM’? 7ém~Û¿äÐjãî0¿°Çv *6¿CŠj ø3¿pèP0¿`AoÈ_C'¿`<Åát!¿À‡†ƒä¿Ð¯½(–Ë?,y[ ?pŠè•~ /?þý¥ä É=?¾ù ×BäQ?€]mÚ5=Z?Æå ÃbH¿ØY#Çî”:¿¨Éû-â‡1¿°ûý*Ÿÿ?¿€ï¸üˆç@¿P"–›F;¿ÀÒíR4¿á?¶|x,¿¬V?ý¹N#¿€©|¤V ¿€n•éçÿ>\Lúܵ"?¸Àg&ïN*?˜®ì~0(T?‰£¥¦”?ðda1A“–?¹CR„ôÓ”¿?“¿/˜ËU'›X¿çÈáÌ"Q¿À”ÿÀàQH¿µó>,dA¿0HÞÃ,˜8¿@=|Rí_0¿¨•ôÀJž#¿ðóJœK ¿¨·RçõW?̯a¾¸?XzTSúí ?½u+žr8t?-DŸà°?Àx„-q΋?éÓI¬ŠŠ¿Ö_”£Þ¬¿ª»ãëY¿%o¢=Å[]¿¸buñ`“L¿€“˜Æ¸TC¿°vMn«:¿p.Ia1¿P[¦B\=#¿Ð´D°¿ø¿w#”› ?x‰_à[!?–Åÿ>?)?ŒDùÀOØt?bÿ¡ká¯?›8þӾއ?0¿üž}Å’¿LœÏ«šÃ¦¿‰a¹NF‹¿8!Ô½M¿žë(ðI¿ªªý‘cîB¿¾¿e2Co:¿à`‡¸àU1¿ ÷Í, ¿3¾|6/ì¾X0Øã ÿ?Е8m—Ú+?sž`ÂT8?6¹-/bX?òNBJ“Ö•?e±Xø¦–?HMÞæ’¿®l¢»ôW–¿k°¤ÎÛ¨z¿Ƙ dN¿³á™˜ÝàE¿wæ|[²@¿ DC€ñ²7¿d¯ŽN6÷.¿ ãñ6¿À!ê–ýè>\ƒ\fô’ ?nUžÛ•1?\nT*›??¶»€N?„…HSCd?ïöv y?¦ýÁNÝ_¿TêÙä‡t¿ÐkäýkºT¿*Oƒ7”E¿iV÷†GA¿¬ x¥‰ï:¿jŒ2IÕ®3¿H[GÕ¿‹)¿Oþé À¿à»¿þ>Ð’‡5'!?h/÷AI1?œçÝò­¿‡–žÈ”=¿j}S_äØ8¿¬BgþCs4¿Ìe?ÐŒ™.¿p†lµ#¿€ü²ÚÝê¿@Zn “¶?2ªCž?pÏàðš+?OÂd<ç4?H"ÉG;?Ø{
A:?Ðm*iÀ\"?@èÖRÉ¿ lôŠþE(¿èËa;°ó1¿èxáÖÕ–3¿¨Ø\¿LS1¿0^*ã@|-¿@Gf&¿pï„§:›¿‹bÐ 9ú¾@ {?Ž¢ü>ÐË-vÅ-?ð^j#?X+ÛÍ«*? §{Eè2/?Xˆ]íUx+?€ÂÐ>c?@΢fmYô¾pà,‰n¿@¦¬a2%¿èPX>4 (¿€Ðµt-Â&¿x4Yr:™#¿Ê›øP ¿ÐÙæ«ý¿Àq"`´të¾àrâ Ÿò>Сœï2— ?ˆÀ-;²ñ?p¡ä”1?Ü;ÑÝ ?¨’Y?€·ÂÄ ?UøÑ§éÔ¾0ï€«Žœ ¿@¨ÇtJ¿ˆ— %Ö¿¸?cc¿Ê1¦C¿HOQì”(¿ð²jÁ‡¿©3õÕŽÿоq“™mF–Ù>-²ŒÜ­œñ>ŸÕh{ü>žsÙ0Ç‚?šçÊæõí?ȃËН?2i$A›ñ>Í\¥Â$¬¾Nø¿ahÆð¾Qœwž¼Åû¾Ö•.3ÿu¿âeAíl_¿áÎ#S®Ðü¾S7çþïEö¾H 9íUÕë¾À¸HŸ#ñ¾@šêÉß:ó¾@úl3ó¾€FAZo½ð¾€²¼Pt—羨h×ÒGÒ¾»ân#ÂÐ>½o6º©é>Õì%ó>+¶œžö>ÍÒÇ•¯õ>«*Q~øð>ªt@Å ã> p¾—ü±>Œæ× _Ú¾êOuýhé¾ |èj¿ ¿@kûQ7ó ¿´_>ÿ ¿°©$9Al ¿à#2¿lõ¿ÀÚo…Fxî¾€B*ý"™é>@„?!O?€óàQ!x?€$×{\ê?@é/t=?Tº¦?Ò ?+ëV¥‡ý>@a €‚Å>›Ïbõ¾€SÎ ¿Ð×Á²_¿ðRÌFÀ¿À¯>kb迨¨¤ie2¿Ø…¢ªm¿Ào üÕÿ¾À;;oæ õ>ÀÏTzÚ?@wº<Ú‰?@jzy-È ?@¿ßUB ?À¤þÔÇ?Á²! ?04›À¾·>€–ôtÇ¿—Ayúc¿¨Tg]œ"¿€‚R· ‚$¿°^øñÍ$¿”/6R#¿6ÿǯ¿ Ñ¸6Ò0¿@à·LÔú> _S×à? ‰”m(?à-ç‹à+?ÀÇ"צ*? Ú+ú$6$?€€×Eƒ»?`DÍcÔݾÀ »c1¿@! G†¿(›HZûî*¿XW&+-¿èÌŠ¼ƒÔ-¿\T`š¬ð,¿pq4Z°_)¿ æo²I¿€Éƒ·A?˜'/Úw.?|ëSkk35?Tí«.P8?À¹EXÏ87?óáÀéŸ.?@]ƶŒ…?€ØAÇV¼¿€¼XÆ|þ¿€œš>Éo&¿À_,zŸ2¿È~Ó[ȧ3¿îÒKhœ4¿6q\”h4¿r8jL„4¿”<¦ÖÏ.¿¬_Rñ6I?› >îu?@¦Dw?E/.ÓX?j0|Ú}E?”«036?À)è €Æ?@6t“Î!¿|™‘gÅ)¿ð¿#Áx0¿R?ÎÂ8¿rÞ[&E9¿¦¾Ö|9¿‰µb—Q1:¿œqÀYs=¿HÞá†tA+¿Î5åh_“?WŒoÚǯ?%&*æRK¯?8pT‚(ó”?ä÷׳ê_?Lc£8?È/­#ì¿ÀðŽfÃ./¿ ‘ èöÉ4¿PQ#ö°b7¿^_5á”?¿¢Ás¯4?¿³²MŽZŽ>¿¬+¥¼Ù=¿:±Vf[>¿"JˆÑÝ38?ùV:=”?µ¬ž‘ìf†?} º9„?¦)É˱–•?êœÌåu?P̆G¿€ˆ¯3ƒA=¿0[éÛC‰>¿ð-ž? K?¿PN±@Ç?¿›ÏdXC¿­¸iñ3ÅB¿ÔYcê!éA¿éèäâ†S@¿Z5øÑGÙ9¿îOiDY2Q¿2ñ æöÕ”¿{Aºór‹¿+eµ֓¿ˆ¡#ß¿BÇ\§[Ôf¿¸§KG£HF¿þËjô8oI¿6× #'F¿ÿçP ÞD¿5L‡0u.D¿.+ëÀG¿X¹Ö8¤5F¿ÀØl,(E¿@ý&Y+TC¿ òÓ hx>¿~ _Hz>C¿Ï­á§Â`“¿¦™ l7'­¿ö)™_Z+§¿¦ô#0:—¿¬¹ìïŒýw¿$)™ÚS¿˜¢…pO¿ç5´åK¿F‚1N I¿¦¢=9)H¿Á–·›J¿su¦ÂI¿[jyEÌI¿ PfýêJH¿3…ú¹SG¿/QmùàV–W¿ŽËŸ­œV¿>3&T¿Ésù]S¿¦ˆÎ5_R¿™˜šF©ªQ¿ŠA¦^ìQ¿(#?_ÃîQ¿0xƒ6çMR¿q!TûS¿ÝP‡ 7T¿"TF8¦U¿YnC€W¿gÒØ»ýX¿€†c˜jUX¿1ÀkÒØðW¿‹ôd¬W¿Þâ’¼3ôU¿†¹0Æ6ÉT¿e¦RV‚¹S¿P‡sÛR¿ yÿ0>R¿¦ùîñž=R¿$÷‡¡5FR¿.ƒj>¦R¿Z6Òž^S¿¶½-¢dT¿*Q(˜U¿¦Ã-½V¿¢¢ÈüˆW¿<ˆR‘äËW¿ ú÷sF…W¿¤‹ÇÓV¿ëžCOàU¿©}¤ÙT¿µÁùeãS¿VÉv S¿aŸ,I†R¿ð?ð?ð?ÿÿÿÿÿÿï?ëÿÿÿÿÿï?vÿÿÿÿÿï?þÿÿÿÿï?Qüÿÿÿÿï?Vþÿÿÿÿï?$ÿÿÿÿÿï?Ãÿÿÿÿÿï?öÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?úÿÿÿÿÿï?hÿÿÿÿÿï?øÿÿÿÿï?×Àÿÿÿÿï?Vÿÿÿÿï?4æýÿÿÿï? ÿÿÿÿï?²ÿÿÿÿï?¢åÿÿÿÿï?¾üÿÿÿÿï?Ãÿÿÿÿÿï?þÿÿÿÿÿï?ð?ð?ð?úÿÿÿÿÿï?ßþÿÿÿÿï?®ßÿÿÿÿï?ߦýÿÿÿï?)úæÿÿÿï?Â^€ÿÿÿï?úÏþÿÿï?ˆuÿÿÿï?6úÆÿÿÿï?Òõÿÿÿï? ÿÿÿÿï? óÿÿÿÿï?Œÿÿÿÿÿï?þÿÿÿÿÿï?ð?ÿÿÿÿÿÿï?qÿÿÿÿÿï?¯ßÿÿÿÿï?‡Óúÿÿÿï?dŽrÿÿÿï?´>g÷ÿÿï?½R Äÿÿï?æëÐTÿÿï?Žj±ÿÿï?"”Fåÿÿï?s”¡ÿï?>s”¡ÿï?Œ¬æÿï?ï'•Äýÿï?héÿÿï?6úÆÿÿÿï? ÿÿÿÿï?¾üÿÿÿÿï?öÿÿÿÿÿï?uÿÿÿÿÿï?»Ãÿÿÿÿï?)úæÿÿÿï?´>g÷ÿÿï?£É©©ýÿï?´‹ÁD”ÿï?6}P8÷ï?“›önýÍï?èE×NÝÏï?º4÷²f÷ï? xG™ÿï?ï'•Äýÿï?Âõ(\7Ž>Ház¦Ú%>4333Ã>ìQ¸…´ê=43333›´=„ëQ¸…s=433333+={®GázÔ<¸…ëQ¸Þ<{®Gáz,=43333Ó=¤p= ×ÓÏ== ×£ ~>¸…ëñH>q= „5q> …ëÁS#‡>Ðಘ>Ãõ(\kè€>ö(\rR>p= ×Ó^>Ház®ëÌ=\Âõ(Ü~=433333+={®GázÄÌÌÌLâCq>š™™Y*±> ×£$9Ïß>> ×ÀB;ö> ׃·ƒ ?¸…ùÄ|ì>]Âq[Š´>×£p=Õ0o>> ×£ ð >Ház®ëÌ=„ëQ¸…s= ×£p= =ffffffH=Ö£p= ÿ¯=Ö£p=êƒ>ÍÌÌLâCq>> ×+qëÆ>™™9+­?š™áõì"J?€Sr«.i?®¤ñDi?q=jxe>J?âzĽ™ ?†ëQìÿÆ>×£p=Õ0o>p= ×Ó^>43333›´=R¸…ëQQ=…ëQ¸^s=> ×£ð!à=…ëQ¸Ú·H>Ãõ(¡Ê°>¸Å­?ìQ¶ŠTzi?×à ¯¥|°?(â›R;Õ?…bæ¢jûÕ?â¢nF{°?ef Y„i?ázĽ™ ?]Âq[Š´>ö(\rR>ìQ¸…´ê=[Âõ(ü€=ìQ¸…k‘=áz®‡k>âzn›’p>(\ŽÆÞ>ÌÌZcBI?=¢"rDw°?_‘æÝÕð?dÅ V¥Ö¿þšOL/}Ñ¿³´–kÂð?á¢nF{°?r=jxe>J?¸…ùÄ|ì>Ãõ(\kè€>4333Ã>gffff.¢=…ëQ¸Í =¤p= w‰>*\"—Úƒ>†ëÑàí ö>R¸¡,ƒêg?4½‰åFØ?›OL/}Ñ¿©N¬=õ¿q«2}ŒTõ¿ÖÔÿ­heÜ¿qÿV7ÁÖ?f¦øLûh? ׃·ƒ ?Ðಘ>Ház¦Ú%>ö(\ÂQ³=q= ×£p =¤p= w‰>)\"—Úƒ>…ëÑàí ö>R¸¡,ƒêg?Â>Ù¢Ø?›OL/}Ñ¿q«2}ŒTõ¿²{Ïòö¿7¬ÃíÓ¿H%®¹§à?fæ³iVŠ}?¶…ôjþ?…ëÁS#‡>Âõ(\7Ž>^Âõ(¤Ÿ=ÌÌÌÌÌ ‘=áz®‡k>fff&n™p>FázíóÔÞ>ËÌ «šI?â :Ú|]²?³´–kÂð?ÞÔÿ­heÜ¿7¬ÃíÓ¿> Ãjë?Ö¿ò‹ °?¸‡ oS?Âõ›>È÷>q= „5q>ãz®‡k>ÎÌÌÌÌ ‘=ëQ¸…ër=> ×£ð!à=ffffš1I>ÂõH÷õ°>›™™‘ò?gf Y„i?â¢nF{°?sÿV7ÁÖ?H%®¹§à?Ö¿ò‹ °?áz˜•´a?ìQˆ0ýg?®G9*¿Å>gfffš1I>> ×£ð!à=ëQ¸…ër= ×£p= H=áz®G)°= ×£p¾>)\BFTq>{®ÝÙÆ>âzĽ™ ?r=jxe>J? W•]tÎk?fæ³iVŠ}?¸‡ oS?ìQˆ0ýg?? ×cèÂ>𙙉c„> ×£p¾>àz®G)°= ×£p= H= ×£p= =„ëQ¸…s=Ház®ëÌ=> ×£ ð >×£p=Õ0o>]Âq[Š´>¸…ùÄ|ì> ׃·ƒ ? ׃·ƒ ?¸…ùÄ|ì>]Âq[Š´>×£p=Õ0o>> ×£ ð >Ház®ëÌ=„ëQ¸…s= ×£p= ={®GázÄ<433333+=\Âõ(Ü~=Ház®ëÌ=p= ×Ó^>ö(\rR>Ãõ(\kè€>Ðಘ>Ðಘ>Ãõ(\kè€>ö(\rR>p= ×Ó^>Ház®ëÌ=\Âõ(Ü~=433333+={®GázÄ<{®GázÔ<433333+=„ëQ¸…s=43333›´=ìQ¸…´ê=4333Ã>Ház¦Ú%>Ház¦Ú%>4333Ã>ìQ¸…´ê=43333›´=„ëQ¸…s=433333+={®GázÔ<{®GázÄ< ×£p= =R¸…ëQQ=[Âõ(ü€=gffff.¢=ö(\ÂQ³=ö(\ÂQ³=gffff.¢=[Âõ(ü€=R¸…ëQQ= ×£p= ={®GázÄ<@ÆŠ\t_r=ÕŽ˜/¾=JÁǰZû=¹"xVÎ3>?—)+a>>„î³{>Ê©Ò.Áv>H.áÐÔvX> d!%'>Ùm_§€ì=gËä-ZÑ¥=¥ö3„8?j=è×}Bïx=8ùàl+øË=þÆ?>¤ £ˆ>Y>bñÐiA–>|Å~&¤Æ>6î7ßã>) Gé}à>·ñî>"Á>Üa·'Œ>½’œlK>¶-ÜZ>ý‹¡¥f-´=’Á¤žo=„“îU~q=N‘Øû¬ÃË=k¬ ì|L>êÒPÿ‹aj>áÁɾ︳>)WÖHoiõ>+l¿§xB+?ß‚ég›µJ? ‹Y'îG?“'ŒÄ,'?¹¾xÙicð>ô&ïhÚ3«><­Ê{ƒ\>=Øh4¸I >ý‹¡¥f-´=¥ö3„8?j=¢8$õœ½=f»ÙPŽ8>­dDZdj>¤”Œe¼>ýϨ% ü?»‹(1¹P?OïèÚ.w‹?Þ§“CÚ®?©dPr/¬?¥_Œœ8-‰?§3kž™ûN?د¼çl ?F;›Aì´>úŒ¼„\>ߨ_o>Ø‹¯W%¦=x½2ÿs×ú=䯥(9FY>Ï,tòßų>_ ’c ?èiÁm¶òX?$¼!³õ¢?+Ôžͽâ?È•¹Ûm½@Ákƒ2–7@ ÁÚ?Üâ?ó}ÉW='¢?2 €¾Þ®W?IXÄw??Ô78ur6«>ÑzšoK> ª2fƒí=•~oÅ*Ä3>àŒÌ/–>N T  õ>$¬©•èP?ämEL£?Ûm—N ê?älH)Ž @9eH•bª0@aÕÛÑ/@ZÆÒ,I @¤8ÈSïé?!ÿ‚ý&¢?3SçßüýN?ɬ¬ˆÕdð>ê*[›Œ>O}ÙI-'>O#O‹Ÿa>¤ÿ@=[Ç>À¶‰TI,?«¨jµñ‹?/ç…£7Öâ?eÅ Š” @)x<¾´OÀeý§°*@¥:]/!s@ã‹&DNÀ)É @¶'“XÁ â?O Ê(‰?˲^î>''?ì†ì‹cÁ>Z&lŒX>î.|7#Š|>®ox†ä>F¤Ä77zK?vü¿=¯?ò*˜…îî@\+)Š(Ô#@‘ÄùJF@ Uð%š@æ}÷"qq@›ô–»r8@Q'[#Ÿ *@&«ŸFý@èRö™j¿«?)ßk1Ü‘G?WXhÂ×6à>öq a&­u>¯d§å`Š|>0GaòŠä>Ì¢þÎþK?—¼lF¯?bUvh–õ@šéhµÒ#@4|ó9`½ÿ?);IIí?@*1'ñç?´u<q2@9¡Ï!Àg±sÞó?Ìù·­š?4e ý` @?N!Ÿ‡âÚ>¯ÄÂAös>´äxÙϪa>HåÉÅYÇ>¿OqÝ,?Ѓü3Þ‹?Çžáx¯â?‘/e¿ }@æ æš7NÀšpÓ׈A8@› £þŠ¡@øí´å­%ÀR\K2…ò@ø5¶=@É?¡”ƒÝ¦€o?ÛU›JT~?$ôÀl|À½>W¢]ó¨µX>,hl'3>—Pâ‚Ty•>Øþ ¡ëô>é¯ÌûcP?‰™ö^j˜¢?É-nG‘é?³™³p¡ @kRíp0*@ FÄÙÿÀ‡!è>…ô@ùÙf@©—Õ?BÔÿ'õ‰?ˆ!x&?¡A¬}†uç>æXAcŽ>kDAd.>_þšßùû=R–fkX>XôÿªÞ²>UR55ì?[ÉA‡5ðW?PÎÍü.Q¢?[€A|â?ÀÌþ‰†@lë’§âó?šö rdEÉ?äeºËZò‰?öìw¹=A?©°ÞXÞ9Ø> Ð@%Qn§>ûeþ.çR>2^"J vö=€“îU~±=ùݶžÂ >3|'h|d>òáƒq1¥¸>vÒHÞ#?‚«“ÿ«O?úqTô )‰?‘ÊõVJ»«?| ue©ž?UxŒõ»t?9ObŲs6?®Ë…ÉÕ¯ð>+Ò7!Iª>íJÈÑ]>Ï>éÖh>Ý+w|N±=’Á¤žo=¼“¨_?X¹=cíÚ=á&>ÌUd˜X`>ÀFQ¦D«><zkð>S:¾;&'?=,pznG?yæcëÏA;?C­) 3?‰o4®–Þ>mý}6W=š>KêPfg—U>Èæ(§l¦>‰ªIzGG¸=µ+Ãi`ÿd=@ÆŠ\t_r=Ø‹¯W%¶=Cª/ÏI>_¸}7vxK>Ù/ÖÁŒ> ·ÝtÀÁ>9.ià>OjS$vÔ>44WCCF³>¹à)ûF€>Í9k¨HA>5JHá=ý=àî,Ê_µ=Ÿö3„8?j=¤ö3„8?j=þ€4P!§=Ùm_§€ì=Uö;ýæ'>Ö·ÃÅsgX>6J**Ëlu>òF«l>ðÒ •Í N>!KÉ1›¡>k•§¥Lcã=Éä21Uy¦=<ÆŠ\t_b=ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/Level_2/0000755000175000017500000000000011634153073023314 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/Level_2/Cell_H0000644000175000017500000000153011634153073024364 0ustar amckinstryamckinstry1 0 7 0 (3 0 ((16,8) (47,31) (0,0)) ((16,32) (47,79) (0,0)) ((48,40) (63,55) (0,0)) ) 3 FabOnDisk: Cell_D_0000 0 FabOnDisk: Cell_D_0000 43091 FabOnDisk: Cell_D_0000 129191 3,7 7.60809203586427e-06,-0.0001875156492376,0.999999872987951,0,1,-7.27595761418343e-14,-2.38714675307158e-11, -5.71913008699451e-06,-0.00456354117453939,0.970098103276923,0,1.00000000000034,2.35741026699543e-11,-96.3398305156724, -0.000345453187374334,-8.5390217347478e-05,0.688088341281648,0,1.00002269722224,-4.48920701857012,-217.987410093814, 3,7 0.000269043695453955,-1.84088793324377e-06,1,0,1.00000012701207,9.31748149014311e-06,0.000564123110987221, 0.0255510986564394,0.00416229715272845,0.999999999999664,0,1.03082358023593,2.02575873247442,32.4504324342012, 0.0700582389492742,0.0922744551167553,0.999977303292917,1,1.45330176374937,2.75749402097466,302.279272281068, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_3/Level_2/Cell_D_00000000644000175000017500000043037311634153073025032 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((16,8) (47,31) (0,0)) 7 à/oc'æ>sñ-é>¸°ÜåËô>˜êö>€ Qúýþ>d­>Ž?„ Óœ…?œÄ/s?ŒY’fm ?\÷²o ?Lÿå ,?L‚óµ$?âR\²[?ÚL•Ò?| 1?‚? vÇvñ?è=•9„?+Ø)ë?îÙ \?°e‚¹?x^O ?bîxÚV?ÒPn£v?„˜½?ìš‘I®?Rr;è?æ7ö’¥?f¨»\Ñ?ä‚‘ÙV?þÖŸNs?îåÙø¹?4ÞÒÐÅ?DÆUã>0˜MAì>XÑÍÐó>p§={ø>˜Ù"*þ>X»˜df?´™gñ2?œ&7 y?¸¯4 ?ЕËej ?ÿ?G ü?¦â÷[?¤R0ˆ_?²ó·-’?¦˜V†?Ι]¤?¢Î…¾†?šud?,iŸøZ?˜EÊØF?œ¨£.ý?ò´ìË?‚ºg?´†’]?\Møe”?œT ?ì$'~?ÈÿÕ¥ß?œ©ôš?2¶MbW?J'»Ïv?`îø…—â>`/eÛôì>hÈ ‡Øó> F•Ñù>hNabþ>Ô9«ˆÃ?`xûºf? Œ*?í?Œ©Õ. ?0ú\ö ?X)0u?Dï¢j?hžÉ¥œ?2([ö½?ÞQæ˜à?xƒ%ñ?¸=Ãò?¤ÝkÛý?L0ØÐ÷?úb#Þ?̪–/¿?¦¿^ï‹?ŽÄæýP?X(g1?!7§?‚ö%ö7?Å"¼?œ€ñ*?JÒ­û‰?B7Ô?Þ@­% ?J\°2?Pâ*{â>Ц4XIí>pqÂô>ø@jmù>p¦vtÎþ>´ h÷?°2·?Lê¡ T?DÍžì ?¬ Bx ?hÛü?fÃú¸?2€î? _Œ?ø´A?ü3̳\?> À9p?|=Žëw?Bë`àu?"Nk“f?êJÓK?>ñYa"?Ø‚è¾ë?¯õ¥?¨óøVO?˜Àv7è?Bhf€p?¼wÑæ?|¿à¢I?"Ví—™?ø6ünÖ?Šöÿ? ¯}Žâ>@¦ù—í>(¦kPô>€®Ö Ïù>À/iaJÿ> $ è]?`•¼?tΕ¿?•Êýd ?ð±Ñ1 ?H¢š“?fÑ ?8AˉI?– Ī~?žñˬ? œêUÐ?~âTë?)¬¸û?|ù±1?˜ªwú?¬Oñ'ç?JJ Æ?z¾k›–?¼;޼W?ðcqì?ßU©?„Ý.©7?€| ¿³?±X‹m ?æÆd9 ?0·Y ?â;ëÝo ?0È6»–â>`Œ8çí>ð¥ÂL—ô>°á¢L6ú>"E Ïÿ>´XKi°?Ìᢠt?¼%.D1?¨¬ç ?X…áì“ ?¢ÍY]?„y×òf?öRY¬?¤óìê?>Y~ ?ØÑ/FM?33 q?jùpŠ?Ì5 ¶˜?Š&\ïš?"ŠQ?æJ~ëw?l+îP?†Sfi?¤ÅèÓ?ÜÎ@t{?d yª ?@µ-J ?=ÊÑè ?gaု ?BŽòªÒ ?%ì:0ë ?@ÇǺâ>`w²’?î>JJßâô>˜­¤¢ú>ðâ8€.?PÌ^ã?tUjÜ?@àÓߪ?,àÕr ?\ÃT¶0? +Þ¾r?œ´ª€Ç?Z¡Õî?DH]?JµÍœ?,)#¯Ó?.,!?Ðf¸G$?:×äH<?¢Ã+>H?þË\CG?è6j8?6\\È?Ä‘÷lí?p ‹m¯?8Šéî/ ?‡í~ ?‹²mCÄ ?ËDK‡ÿ ?÷ ]S0!?€Š~CV!?ÜèÑÛp!?ð)^©Ãâ>õO7—î>H9`Â1õ>`QUfû>l¦ ûx?è‚¡9d?$C€ÜJ? ö¼+ ?„Ø‚¨ ?€VßZ×?lËIÂÏ?Þb.?}:Ö†?ðÛŒ^Ø?X‰4"?Öžˆc?´•£‚›?&[BDÉ?à(çë?€}?ˆº† ?𓤱?Da\ô?z8‘Ñ?̼nN ?Ô¼#]« ?M‚¤Ùþ ?©˜?kH!?­‡‘‡!?.ʼ!?,Ú3å!?Â×·ó"?0ùJÔçâ>pÂnöî>àO9(„õ>Я0<‹û>LŒ)ÿÆ?TW›+Å?p¿?,³ ?D'`v¡ ?¤.ˆ‡?Î˹:2?ØMOo›?úðg©þ?†¢W'[?–Eh°?X‚.ºü?Òõÿ@?žž_y?¶=’§?"À„»É?\“ÜÞ?¦½ìå?–HÐáÝ?ÓCÞÕb ?yÂÎ ?˜E=0!?ÓÝ’°ˆ!?B \òÖ!?dßò"?NEbâR"?mæi–"?…" "? 8\ãëâ>­Qï> ö”Øõ>hácü>tÝæ7? BŽd*?Ôv3­8?øvš÷A ?0rêE ?pØÊl ?HEõ™?Jöûv?Žh¾8}?6‘wå?½‘cF?b2%Ÿ?†×î?¶Ð3‹4?ŽßEo?bõž?˜ÁZ´¿? ÐwCÓ?‡lXÉk ?DH‡¿å ?Œ)ñV!?Kʾ!?€ë¹"?:Ö­+p"?aÓ~•¸"?øfoõ"?7ÒS?&#?ÏWȺJ#?€V ã>P±.±ï>@Â9/ö>XÀhO…ü>X&óIl?ü`ƒ“?´‘G·?ÜÏJˆÖ ?‡ ð ?Ðèl?ü“¶?F0>‡?ÚG”K?J§^w?\úªÓä?€zŸJ?|gا?®Ð¯ú?~½O÷B?„)V?’áö®®? h íg ?wË7Óð ?óÁ¾mq!?lðÁé!?‘µCW"?ŒE=»"?fIÙm#?Üoú8b#?ë‚j¤#?7à¾<Ù#?õ±$?ð×çã>Ј ð>Í,k†ö>PïX ý>üþ­ÆÂ?lû?ÈÈBg:?ø5æÁp ?PÈ`¢?~25€æ?T„9x?>Q?—ž?Â:Ë?®ÒA3‹?â.3ôþ?Žú•j?¨h°«Ë?p†‘"?<»&¯m? O©ëU ?3`Äçí ?Y¾(~!?†M}"?Ü"Õ„"?ñ…gæù"?4:‹d#?ÖûÄ#?Ð1Ú$?„¯—4_$?Þš™$?>4’Æ$?p÷ã>á ê2ð>8þÐYÞö>`:réŠý>D\:?¤xo?„Ú˜ƒÁ?8Žª ?`"/Z?¾[8XO?<ö-î?8Œîˆ?Þ(=â?Ž3±B¯?X»ï99?ÈÉ{á»?ÀCA6?æIäP§?|õó ?;¦Ö~4 ?Ô—Û ?Ùú {!?iOƒá"?ê!\®£"?€ÎèI*#?ÔäIö¦#?J"Èó$?0Ê‚$?stÈåÙ$?I,?b'%?âòú:g%?«sƒ˜%?€eã>K°{[ð>€(5÷>QdÊþ>\–u?¬ß®sá?ð'þL ?Ô+Ú³ ?Zôù ? E)›»?œÛ‘7h?¾o¬(?¯ ¹µ?ž^#U?;Qî?n’0?–E· ?Î0Qb?>/áw ?kû‘¸ ?ƒB5Wh!?+rm"?Ê®Y²"?9B‘‡J#?ßè­Ù#?ßZ µ^$?RèÊØ$?4G%?jo ب%?ëeÌ3ý%?ÿ£DwC&?È™5{&?p+ÊÛã>˜3•)„ð>¨Õ*‹÷> NîÚ”þ>¬ÛæÏ?|¯U?°àž:Ù ?¸€·][ ?¢©Hm?PÇæâ*?{ìå?Ä“sÃ?Öd;¶Q?ª X?ÚÇͪ?Dªv/N?’Þé#ê?:"‘}?ðj¢ƒ ?—túB!?DŸü!?S»O®"?®òÆX#?y¸°ú#?:ý1“$?¹6…e!%?éÿ«f¤%?rBFK&?[e›*…&?d»ñá&?ù¥Ž9.'?ß´Sk'?ÀÞâ>¥”¼¥ð>Ò#ÔÝ÷>pùsÓÿ> ø¯ò*?h“ÝÉ?¼mh ?hÒ? ””Ð?" 仜?è©Ôf?þàkB.?R[ò?X½^²?`óvm?Ìüµ"?Þ®“Ñ?þXÁ¼; ?e8O !?jS–Ó!?äÀÕ–"? 2QDS#?šJ= $?””^C´$?Ì×~W%?éY_Iï%?ÉèA|&?…¨öü&?ê~œio'?•)\àÓ'?Výý((?/Ñ9n(?€„4MÎâ>ø‘ íÅð>0õ[À-ø>È^¹šÿ>|c—œ…?tcØù>?"Êø ?àø)T²?ïUe5?ðd¤?š2@eê?~¶8Â?¾`—?„±±¥h?jqEö5?þ8îþ?ùï À?‡îyO½ ?¦k©G–!?çk9j"?$_8#?2ïÔáÿ#?W;{Ú¿$?Š;Rw%?‘JfD%&?.– È&?M`'?3T,ë'?ùøLh(?­àüÕ(?1Ta¥3)?"Fe)?P 8s‰â>臟Ýð>Øšã†xø>´Ü<Œ ?œk&)ß?¨ì£³?,xom‰ ?ÞÒé_?ôœ2›?zÔ †?ôª³p?¸…ØŸX?ž0š=??²j#-#?4#|¢?nÁ’´ß?ÝØ--[ ? ¥4C!?òÛ™F'"?Æû¨#?‚"]‹à#?ñĪ ´$?ÍÌã+€%?ÇO çC&?&ÛÅþ&?°G¸§­'??±JQ(?Y’§Èç(?ñžÉßo)?*oàôñð>È€2¾ø>üq¬gI?|à°Ø6? æû&?ìï´^ ?È·=À?ÔO]f? ‹ðJü?ˆä÷?„ß$ñ?²ê? ¨Î.á?TW²Õ?Ú˜ºÆ?ÏÞò Ù ?^ú Í!?˜Ïõ¼"?\´˜¨#?¹(ý$?Xêo%?«œÓäH&?; éÿ'?90Ǩá'?í‰ö•ž(?Z†cnO)? äÁÍò)?ÁBvI‡*?°ñs +?¤áôÒ}+?UÌx†Ü+?PØò0ùá>0·îùùð>˜Ü5]üø>¥· ƒ?t3 Ö‹?Ð/˜?,A‘§ ?‚ÄVö\?î´¬[g?ú®³r?ìʪ~?Tµ×Š?bŸ ¿–?þGÈ¡?‡;<«?D=!Y ?¼OìZ!?j‰¶iZ"?š›ëV#?ôáQ¨O$?Hz_¾C%?ßL¾-2&?ä]`Ú'?u÷Œù'?œ$ðïÏ(?±Øñš›)?æ"Å [*?E™÷¹ +?#¾Î¯+?™˜Ée@,?.°CY¿,?W±0ý*-?Pþ«á>xÝÝýð>›`3ù>€‰Œ¹?äó¦IÝ?¸§„ñ ?ȇ’ã2 ?&;ðô±?uR^Ì?~è?”ú?FŠæÐ$?ÎÊ\HD?̇Höc?àÿô4ƒ?tìqœÐ ?Niµ…Þ!?D¡¡Âê"?í´¤ô#?w£_û$?öÖþ%?ùC‘û&?›²2Ìò'?$˜ìgâ(?®†~òÈ)?Œ…‹Û¤*?Ëà_xt+?õI˜ 6,? õåÁç,?‰À=ˇ-?Ðdª;.?ÿ ‘¦Š.?À-° á>¨¬‘‘ôð>@¶_ù>  $lê?øµ€H*?ø½ƒo ? ä!º ?ôQ ?.úžª/?ÐMLÑ\?à¨[Œ?`y–¾?ø£R›ñ?Püã“&?R4. ?ß¾½0I!?$²Ëc"?çBÚv}#?’G²…•$?I*«%?úLr½&?£Í˜DË'?8 ~_Ó(?®!XÔ)? VîšÌ*?L0Pnº+? ˜ö›,?G3Æ ˆüZäð>èŠ9g‚ù>„Õuv?|À|èq?Ê ³Ó ?h£<?ØýÆ„U?Dn’m?‰…ÁÎ?þ—>w?&4sU?8F™‚?F ‹Uè?¨ªJ¼š ?A‘Ä&Â!?’¬àê"?¾åúÇ$?C¶èÑ8%?‹oÊR^&?IT'?€¯² (?±_æ»)?nö`Ï*?Ã!IºÚ+?4ÕmVÜ,?gøÎÄÑ-?ðæžÍ¸.?¶ùÇ/?€Î“Ò')0?%:ßï0? ÑòRÊ0?à&j éß>¸-Åð>‚㞘ù>¸…›Q<?‹ñ/³?,|^Z1 ?xæ8·?ä¼l•¢?ÝgÅí?ø"P=?ÓSM‘?6ã‰Äé?„ަF?Vfuǧ?ê•k!?Vü”¬:"?fx´Mp#?X=Ö¦$?>Ò˜¨Ý%?2»ý'?”WFÜH(?ïmó{)?ŠTU©*?‚NëÑ+?Ý ó,?$±â} .?ªt›/?€@°¿› 0?€k.‚¦0?Ó+éÎë0?KòiÍL1? ˆßÍ¡1?LÚ(¿ ¨ãc¿˜Ìý¿´R¬³é¿81×]º¿h:…†¿pjâE¿8%@ ÿ¿|Öbyª¿„­§´O¿èaÿÂ忬äZv¿¸Àalö¿æq¿4«”Û¿ÌÍ(£A¿ Æg)ÿ¾HÖ¢Êý¾èÀ:´Cü¾Àžæ{ºú¾Pu*Jù¾yÇT÷¾€çRévõ¾0’ ó¾­¯—ñ¾@ ‚1ï¾@÷žÛê¾XH™æ¾pUq‘â¾£oXÛ¾€.Ö’MѾ#°â¾¾–ztå¿t®äÄ•¿èðzû˜¿ b‹®x¿¤n¯aI¿èº¾V¿ÀÚêãÉ¿ÈEyÏy¿\ÜÆ±¿ÄH¨¶¿8ª%C¿ÔÝ@Ä¿`ãb8¿ØŽZ¡¿Ä½Íü¿|ÎyM¿„L ¿D…,Ç¿ð|¥‰áÿ¾4‡}þ¾ˆ³W£Aü¾Ðr£Oú¾xBô^Bø¾Pÿ_"ö¾h-Úcèó¾ð¹±«ñ¾àÈ4tî¾ õ@5é¾€…°‡|ä¾?PšÞ¾ aN¹ÇÓ¾âíEìÀ¾Ø¼–6# ¿йŸu ¿Læ}\A ¿|ÖV© ¿xlœ#ã ¿LgÛ¤ ¿Pê‡X ¿”:ó› ¿$D÷Õ›¿ŒŒ:*¿tWNU«¿½B¿¼Ò§„…¿œ!RSÞ¿<8d-)¿\ thf¿¬’¾ƒ•¿ ôšù¶¿lpPNÊ¿˜tœ&пî:"ÿ¾¸œÄeý¾ˆÓ«m û¾è¬£,Âø¾(ê¦]Jö¾ÐOJo»ó¾ð¾®Óñ¾ ˜‡²ì¾à>î/ç¾5ìIá¾`Ÿ'ßÀÖ¾À)îjðž°þÏ< ¿˜Öì&Ü ¿Hl-à ¿¥µv½ ¿èˆ ¿0‹ E ¿ˆ,jšó ¿àuSC” ¿øê–Ï& ¿d¢« ¿ìæpØ ¿ìêcî‡ ¿xiSà¿Téº@)¿Äž ,c¿ 3Ò¿tõ] ©¿T;Cè´¿h‰7T±¿9@|ž¿ ,j|¿T¥XnK¿`Tgþ¾ÀfÛe{û¾ØÃÒvÃø¾Pë àðõ¾øÆj…ó¾ð ŽñÿᅠרÈé¾p€ xfã¾ }ôm±Ù¾’/Ⱦ„¸-K¿¼‰½>Þ¿¾»¥¿Üpƒ‚v¿œväe<¿À“Púó¿@ÆB™œ¿ˆ„Y6¿pcnÀ ¿àSöw: ¿8Ên¥ ¿T›´„ÿ ¿´ú†µI ¿´u8iƒ ¿ÜÃão¬ ¿œ‹î§Ä¿kBóË¿xeÜF¿Ø# ž§¿Äž |¿`õù¬?¿ˆ´ª¹ò¿\ v•¿hÙáŒPþ¾¨ˆ¦7Wû¾H&ú@ø¾Ðûi õ¾(Уɽñ¾0(µ¬ì¾3ªp¯å¾À¼r_ ݾ@È5 Ï;´‘¾?ß¿¤1„^0¿¼ÚÊÿ0¿¢tñ8¿fè–Lÿ¿8ÃòØ¿®i{dª¿°¸0™s¿Rdiu4¿0’Y³Ù¿|OŸH9¿0¹xg‡¿ jÛÍà ¿Œ%¼>î ¿bZ‚ ¿`_`j ¿t«àÑÿ ¿L§á¡à¿€ÏÑ®¿ ä½hj¿´„¿`³KUª¿h¦‰$/¿”ÖõT¢¿ØéÅþ¾4 Ó«ú¾@ª;@/÷¾ðnUÀ”ó¾`AFv¼ï¾Ðu è¾PÏÏDྠÉQ«9оfòr±"¿4•(¿e퉣¿ÊV"V‰¿P.oÔh¿¸pè@¿JǺ¿âQ1‡Ô¿ºÜ[‘¿ªìþE¿œ€ï¿>ÄY¿FâØí'¿E‚Ak¿@)iðr¿(ÅW­f ¿þGF ¿µ ¿D9¥›È ¿œ§ÒAk¿å;¥ù¿<”éòs¿Då×qÚ¿·æ…-¿œû€±m¿h± 17ý¾ÐKtpù¾¨ÃJ¼‡õ¾ðRÁž€ñ¾€V’»ê¾YÜ$Kâ¾ hG¸½Ó¾ê™b½¿,˽Ò¿nÏŸ¶¿XR;Áû¿ä•Ú¿z 篿ðµâ{¿˜éðm>¿.Ω`÷¿€øŸŽ¦¿˜éÏÉK¿Tº³ãæ¿TäZ®w¿ªó˜ýý¿" 8¨y¿„G—Õ¿< ¡¿t£PñV ¿D]ø½ö ¿ÄÒª]€ ¿`?"Üó¿`[E_Q¿¨*™¿@IŸË¿ÒžDé¿§‰åÿ¾0!2äÑû¾Hª™÷¾ÓXº>ó¾ÐÜ§Ô†í¾§—UMä¾às4RÕ¾†2ºè¿ÈÝ”¶¿0º˜¼•¿þcy¿æ˜ª×U¿(»¢ )¿ª½{ò¿”2í±¿¬v…*g¿è8ÿ¿ZÛÍ4²¿HMJ•G¿jòEêÑ¿Ž¨ÿP¿üÝÆ¡Ä¿XsŤ,¿`Ð àˆ¿Xú‰f²¿ÜÍ? ;¿œ®¼š« ¿0[ ¿i„D ¿Ôs¤7m¿ 0˜ˆ~¿@×üx¿$ïD]¿0auXþ¾¿QÛÍù¾ø›šRõ¾èÔzJð¾àï8Bºæ¾`©œÎÙ¾ªi'ñ¼¿Ö¾Bâ¿8!¿üÁÁ6þ¿ž„Ü[Ú¿ZD ð«¿>Ñhs¿$è– /¿˜:2]á¿È‘)ˆ¿Äòu#¿æœaR³¿¶×bf7¿R»˜r¯¿:;¿2â‡z¿$eó&Í¿ Wªí¿ZGߺK¿pÀªñ¾†>, ¿pjÄjO ¿ ì§X ¿ø°“NH¿ŒÓâ¿@9ãÝ¿,W2ƃ¿H3ä(ü¾Ø®9÷¾œö ìñ¾ ã€né¾ |Ò¸Û¾ ^š7¿d’0¿Î¿^IÛ2­¿GüY¿Äqùpi¿(þHE9¿hCEþ¿œû#¸¿@ò‚›f¿@ÕVg ¿.¯þ> ¿ZAÃØ*¿FíJ꨿Tâ)¿Œ]öO~¿vWÁÕ¿”ŒF¿@¹¡Y¿ \þ†¿Ì’Ò;¦¿ XKn¿°l“@t ¿8»«®] ¿ÄG©'+ ¿0­ê(Ý¿@ 'ct¿\ÀO¾ñ¿PZ×½¬þ¾p ÕnGù¾XŒÇ·ó¾@WŒóì¾I¿ó»à¾ú¾á¿*â¢M@¿Ì)"ð@¿ÞZ(¿"ûÃÈ¿¬.ÛnÑ¿,qÌ—”¿dûÚ L¿±ô…÷¿Ì°´–¿Ü–ÊF)¿V¡a箿6H#@'¿rí­ú‘¿pa'Âî¿Òx E=¿Bš77}¿ˆBT®¿“+aпÚo0ã¿Br2£æ¿Ôv…Yµ¿(tª~ ¿Ècx) ¿LD§6¶¿^S‘%¿ÊÀpx¿@u·ù¯¿¸¢€ûšû¾èA¥'¤õ¾p…CÚðî¾p2'dçá¾Ô,n|¿†Æ>È¿„ܯ²í¿h ˆ"Ͽʪ൧¿þJ“u¿‚8ž6¿ÌÂòë¿ð³Äº”¿òÿ©ž0¿ÂÎ@¿¿’ Õ=@¿">24³¿J_о¿Øàëxm¿æE´¿`@•ý꿪mv¿ä/Ã)¿ÒK‰/¿|Âég%¿*äIš ¿,ì)¾¿¸´žØE ¿ ħ¬ ¿¿Ð>Ë׿>;Ýb¿Tf¦›ß¿òŠE”M¿,y\R¬¿d ì`û¿ò_±L:¿úš“¦h¿ú„a†¿dùÚ ’¿œ"ÿkŒ¿ŠL”àt¿2µÙ?K¿ÜõNv¿p$`ˆöTà ¿”²î6à ¿Ì¹B Ú¿4¢q¾³¿ØgR÷l¿¸ÏHÆú¾‡Jeó¾Àúj1ç¾–vYÇ쿞¥|¿¤Î\ÆZ¿8Òg<¿à}¿øõƇà¿èÌiÑŸ¿d|‘êQ¿P ähö¿ä7FÜŒ¿Ô›Í¿>a¿¿Êà.÷¿^´•P¿À'´k™¿ê2)Ñ¿2¡I÷¿Ð¥™N ¿ÂL=à ¿Ðƒô?û¿V‘xnÖ¿0’ž¿j0øQ¿|Uˆ$ò¿v’[ý¿ç,«ï ¿üº6¼¿\_°Çc¿4?ˆè¿­Sšü¾@:£P2õ¾ Ü+µë¾ã9  T ¿:ÇT+‹ ¿­RŽ ¿mØËã ¿Xˆ—n ¿m'žT ¿ö’ôü3 ¿G‘®† ¿æï`¼¿€oP¿Šë¦½Õ¿†aeK¿Ö#Ò°¿`RÞi¿4SúŽH¿p"¼¢y¿2˜¿6`'£¿pFzpš¿ÔVb}¿‹K¿6³‘¿¬„7¨¿Ö˜I_6¿>Çü¯¿ˆ&w%¿P"­/ ¿ BÄ6¿ÐžÅ4„¿ðZWÿ¾xÛ@çR÷¾Ðò6›zí¾Û>šÁÅ!¿™a,Œ!¿(@ Æ{!¿9t6m!¿Ì§…›Y!¿|ø|¢?!¿•Ñå!¿“VL$÷ ¿þáÈ ¿ðÎØ‘ ¿üõ*S ¿ y,£ ¿D‚kJ{¿Ü£°Ë¿Ö¦”à ¿¨ìÊ4¿´;ï L¿h‚$ÕN¿–Îpu<¿LóYL¿(*ûÉÕ¿<2½u€¿Éhô¿Nn¿D2¶ô¿`§6B¿8‡_Þð ¿Œ~ß0 ¿ä™òE¿èþÃ\3¿pÎú¾ ¹wºñ¾‚')"¿¸ìŒþc"¿µ¦ 'h"¿»æ’]"¿î›iþJ"¿çfÿi1"¿9NˆÓ"¿±ùÏé!¿ .Á¹!¿§©²·‚!¿â;b˜C!¿u» ü ¿,E°« ¿SÊS%R ¿®œ Þ¿¢)·¿†ŒÇ‹¿. ÷ª¿d†šCô¿ÊB²Á¿ÜŠUÚv¿Ž”J†¿b/"—¿ÜH¬.¿r›‰¨Q¿ì¢ˆ¿äÈÇGL¿äœàU ¿ +CN/¿ð¶|Ù¿€VŒ`Ÿü¾ÈX¼†Òò¾>p¬p­#¿g ¦r#¿^Gc#¿[}ïU#¿ED;aC#¿Ø–Ž3*#¿Z €÷ #¿Þ#¿mXÃõ"¿¬ &µ£"¿[()ôG"¿=ý¶Çá!¿Cd6£p!¿—9õó ¿6ý¥)k ¿|tÀX«¿ÈV Ùe¿Ð¦_À¿°V§‡¿®Kðë¿î$Ô©2¿RÛÉÂZ¿$‹øÿc¿ ‚qN¿úòVx¿˜¤7k‘ ¿qþ²¿ˆê "“¿Ø#bŸú÷¾Y;B®%¿¶½¡žr%¿MõÏd%¿‹ÛXYY%¿ýSžH%¿æaK"1%¿£‡am%¿‰gÎ+ì$¿à'ú¾$¿f[‰ž‡$¿Èyÿ†H$¿RÈ{I$¿â×c®#¿—¶IR#¿l…bë"¿Ñ²¾y"¿>vç§ú!¿²)o!¿~/ïëÖ ¿àä:0 ¿ìSŒõ¿ªú‡àk¿ÔdW¿øUø¿T, ¿j†iþ¿ö2¡Î¿ækÒ%}¿Ðz;®¿ “Ô ó¿LGÎ]¢¿ˆÌü¾gª&¿÷º¦†a&¿5§ìèj&¿èKtd&¿ 4šU&¿*"øq?&¿Hƒ¿ò!&¿æ×Øü%¿k ËÏ%¿(Õ¸cš%¿Ã¿£.\%¿ˆ¢Mª%¿×~ŸGÃ$¿K)jg$¿ €h$¿|¦#¿j;5#¿}ǽF"¿f«Fæ!¿eüK“ÿÿÿÿï?>{ÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?ûÿÿÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?îÿÿÿÿÿï?æÿÿÿÿÿï?Ùÿÿÿÿÿï?Æÿÿÿÿÿï?ªÿÿÿÿÿï?„ÿÿÿÿÿï?Jÿÿÿÿÿï?úþÿÿÿÿï?ˆþÿÿÿÿï?êýÿÿÿÿï? ýÿÿÿÿï?Úûÿÿÿÿï?8úÿÿÿÿï?øÿÿÿÿï? õÿÿÿÿï?ñÿÿÿÿï?äëÿÿÿÿï?åÿÿÿÿï?\Üÿÿÿÿï?0Ñÿÿÿÿï?Ãÿÿÿÿï?|±ÿÿÿÿï?È›ÿÿÿÿï?Xÿÿÿÿï?Œaÿÿÿÿï?Ò;ÿÿÿÿï?«ÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?îÿÿÿÿÿï?äÿÿÿÿÿï?Öÿÿÿÿÿï?Àÿÿÿÿÿï?¢ÿÿÿÿÿï?tÿÿÿÿÿï?4ÿÿÿÿÿï?Õþÿÿÿÿï?Nþÿÿÿÿï?Žýÿÿÿÿï?€üÿÿÿÿï?ûÿÿÿÿï?üøÿÿÿÿï?-öÿÿÿÿï?Zòÿÿÿÿï?1íÿÿÿÿï?Jæÿÿÿÿï?(Ýÿÿÿÿï?0Ñÿÿÿÿï?¬Áÿÿÿÿï?­ÿÿÿÿï?‚”ÿÿÿÿï?Øtÿÿÿÿï?žMÿÿÿÿï? ÿÿÿÿï?ªãþÿÿÿï?˜žþÿÿÿï?pMþÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?ìÿÿÿÿÿï?âÿÿÿÿÿï?Ôÿÿÿÿÿï?¼ÿÿÿÿÿï?šÿÿÿÿÿï?hÿÿÿÿÿï?ÿÿÿÿÿï?±þÿÿÿÿï?þÿÿÿÿï?2ýÿÿÿÿï?ðûÿÿÿÿï?(úÿÿÿÿï?¨÷ÿÿÿÿï?,ôÿÿÿÿï?Zïÿÿÿÿï?Âèÿÿÿÿï?Îßÿÿÿÿï?ÈÓÿÿÿÿï?ÈÃÿÿÿÿï?¶®ÿÿÿÿï?>“ÿÿÿÿï?Öoÿÿÿÿï?´Bÿÿÿÿï?Ö ÿÿÿÿï?Ãþÿÿÿï?lþÿÿÿï?Œþÿÿÿï?B„ýÿÿÿï?:ïüÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?ìÿÿÿÿÿï?âÿÿÿÿÿï?Òÿÿÿÿÿï?¸ÿÿÿÿÿï?”ÿÿÿÿÿï?\ÿÿÿÿÿï? ÿÿÿÿÿï?þÿÿÿÿï?Þýÿÿÿÿï?Úüÿÿÿÿï?bûÿÿÿÿï?Hùÿÿÿÿï?Höÿÿÿÿï? òÿÿÿÿï?ìÿÿÿÿï?àãÿÿÿÿï?ˆØÿÿÿÿï?Éÿÿÿÿï?*´ÿÿÿÿï?6˜ÿÿÿÿï?2sÿÿÿÿï?´Bÿÿÿÿï?Ýÿÿÿÿï?\³þÿÿÿï?pMþÿÿÿï?öÍýÿÿÿï?Š0ýÿÿÿï?­püÿÿÿï?Šûÿÿÿï?±xúÿÿÿï?ôÿÿÿÿÿï?ìÿÿÿÿÿï?âÿÿÿÿÿï?Ðÿÿÿÿÿï?¶ÿÿÿÿÿï?ÿÿÿÿÿï?Tÿÿÿÿÿï?úþÿÿÿÿï?tþÿÿÿÿï?®ýÿÿÿÿï?Šüÿÿÿÿï?Þúÿÿÿÿï?nøÿÿÿÿï?ìôÿÿÿÿï?æïÿÿÿÿï?Âèÿÿÿÿï?²Þÿÿÿÿï?¨Ðÿÿÿÿï?6½ÿÿÿÿï?Œ¢ÿÿÿÿï?T~ÿÿÿÿï?žMÿÿÿÿï?Æ ÿÿÿÿï?\·þÿÿÿï?Hþÿÿÿï?Ó¸ýÿÿÿï?~ýÿÿÿï?Lüÿÿÿï?àûÿÿÿï?’¤ùÿÿÿï?êÿ÷ÿÿÿï?& öÿÿÿï?ìÿÿÿÿÿï?âÿÿÿÿÿï?Ðÿÿÿÿÿï?¶ÿÿÿÿÿï?ÿÿÿÿÿï?Nÿÿÿÿÿï?ðþÿÿÿÿï?`þÿÿÿÿï?ˆýÿÿÿÿï?Füÿÿÿÿï?húÿÿÿÿï?¨÷ÿÿÿÿï?¤óÿÿÿÿï?Îíÿÿÿÿï?jåÿÿÿÿï?lÙÿÿÿÿï?nÈÿÿÿÿï?’°ÿÿÿÿï?\ÿÿÿÿï?Œaÿÿÿÿï?ú"ÿÿÿÿï?VÎþÿÿÿï? ]þÿÿÿï?Çýÿÿÿï?~ýÿÿÿï?üÿÿÿï?¾úÿÿÿï?J#ùÿÿÿï?N"÷ÿÿÿï?«ôÿÿÿï?â¬ñÿÿÿï?žîÿÿÿï?âÿÿÿÿÿï?Òÿÿÿÿÿï?¶ÿÿÿÿÿï?ÿÿÿÿÿï?Lÿÿÿÿÿï?êþÿÿÿÿï?Rþÿÿÿÿï?lýÿÿÿÿï?üÿÿÿÿï?úÿÿÿÿï?ÿöÿÿÿÿï?€òÿÿÿÿï?äëÿÿÿÿï?@âÿÿÿÿï?HÔÿÿÿÿï?8Àÿÿÿÿï?¢£ÿÿÿÿï?>{ÿÿÿÿï?´Bÿÿÿÿï?Dôþÿÿÿï?~ˆþÿÿÿï?æõýÿÿÿï?Š0ýÿÿÿï?®)üÿÿÿï?vÏúÿÿÿï?º ùÿÿÿï?òÈöÿÿÿï?rèóÿÿÿï?úLðÿÿÿï?¬Öëÿÿÿï?~eæÿÿÿï?6Ûßÿÿÿï?Ôÿÿÿÿÿï?¸ÿÿÿÿÿï?ÿÿÿÿÿï?Nÿÿÿÿÿï?êþÿÿÿÿï?Nþÿÿÿÿï?^ýÿÿÿÿï?ðûÿÿÿÿï?Äùÿÿÿÿï?~öÿÿÿÿï?”ñÿÿÿÿï?Cêÿÿÿÿï?rßÿÿÿÿï?Ïÿÿÿÿï?l¸ÿÿÿÿï?þ–ÿÿÿÿï?gÿÿÿÿï?ú"ÿÿÿÿï?Ãþÿÿÿï?:=þÿÿÿï?B„ýÿÿÿï?&‡üÿÿÿï?d0ûÿÿÿï?4eùÿÿÿï?ê÷ÿÿÿï?rèóÿÿÿï?&âïÿÿÿï?¾êÿÿÿï?øBäÿÿÿï?Â3Üÿÿÿï?dRÒÿÿÿï?`cÆÿÿÿï?¼ÿÿÿÿÿï?”ÿÿÿÿÿï?Tÿÿÿÿÿï?ðþÿÿÿÿï?Rþÿÿÿÿï?^ýÿÿÿÿï?æûÿÿÿÿï?¢ùÿÿÿÿï?-öÿÿÿÿï?îðÿÿÿÿï?éÿÿÿÿï?(Ýÿÿÿÿï?†Ëÿÿÿÿï?|±ÿÿÿÿï?T‹ÿÿÿÿï?ÚSÿÿÿÿï?Ýÿÿÿÿï?€‘þÿÿÿï?tïýÿÿÿï?ð ýÿÿÿï?”Ïûÿÿÿï?úÿÿÿï?²Ê÷ÿÿÿï?«ôÿÿÿï?Pðÿÿÿï?°ëÿÿÿï?fããÿÿÿï?0¹Úÿÿÿï?«Ïÿÿÿï?J“Àÿÿÿï?«®ÿÿÿï?.í˜ÿÿÿï?šÿÿÿÿÿï?\ÿÿÿÿÿï?úþÿÿÿÿï?`þÿÿÿÿï?lýÿÿÿÿï?ðûÿÿÿÿï?¢ùÿÿÿÿï?öÿÿÿÿï?˜ðÿÿÿÿï?:èÿÿÿÿï?ŒÛÿÿÿÿï?nÈÿÿÿÿï?Ô«ÿÿÿÿï?Xÿÿÿÿï?´Bÿÿÿÿï?çþÿÿÿï?bþÿÿÿï?Þ¢ýÿÿÿï?,’üÿÿÿï?ìûÿÿÿï?àõøÿÿÿï?& öÿÿÿï?x òÿÿÿï?BŸìÿÿÿï?äYåÿÿÿï?T·Ûÿÿÿï?«Ïÿÿÿï?.ξÿÿÿï?nªÿÿÿï?6âÿÿÿï?}oÿÿÿï?^ñGÿÿÿï?hÿÿÿÿÿï? ÿÿÿÿÿï?tþÿÿÿÿï?ˆýÿÿÿÿï?üÿÿÿÿï?Äùÿÿÿÿï?-öÿÿÿÿï?˜ðÿÿÿÿï?öçÿÿÿÿï?¶Úÿÿÿÿï?|Æÿÿÿÿï?Ô§ÿÿÿÿï?¬yÿÿÿÿï?°4ÿÿÿÿï?VÎþÿÿÿï?°7þÿÿÿï?¼[ýÿÿÿï?Lüÿÿÿï?\Túÿÿÿï?²Ê÷ÿÿÿï?Ö7ôÿÿÿï?`<ïÿÿÿï?¢\èÿÿÿï?ûÞÿÿÿï?dRÒÿÿÿï? qÁÿÿÿï?F5«ÿÿÿï?bLŽÿÿÿï? 5iÿÿÿï?lJ:ÿÿÿï?,Íÿþÿÿï?äÿ·þÿÿï?ÿÿÿÿÿï?þÿÿÿÿï?®ýÿÿÿÿï?Füÿÿÿÿï?úÿÿÿÿï?~öÿÿÿÿï?îðÿÿÿÿï?:èÿÿÿÿï?¶Úÿÿÿÿï?ÒÅÿÿÿÿï?Â¥ÿÿÿÿï?Øtÿÿÿÿï?À*ÿÿÿÿï?P»þÿÿÿï?ðþÿÿÿï?xýÿÿÿï?L´ûÿÿÿï?’¤ùÿÿÿï?Zªöÿÿÿï?†gòÿÿÿï?N]ìÿÿÿï?fããÿÿÿï?ÞØÿÿÿï?òÇÿÿÿï?jû±ÿÿÿï?怔ÿÿÿï?mmÿÿÿï?lJ:ÿÿÿï?ÆFøþÿÿï?d@¤þÿÿï?¼ß:þÿÿï?bÀ¸ýÿÿï?±þÿÿÿÿï?Þýÿÿÿÿï?Šüÿÿÿÿï?húÿÿÿÿï?ÿöÿÿÿÿï?”ñÿÿÿÿï?éÿÿÿÿï?ŒÛÿÿÿÿï?|Æÿÿÿÿï?Â¥ÿÿÿÿï?2sÿÿÿÿï?š%ÿÿÿÿï?P¯þÿÿÿï?Düýÿÿÿï?:ïüÿÿÿï?^ûÿÿÿï?º ùÿÿÿï?f¦õÿÿÿï?ò´ðÿÿÿï?º•éÿÿÿï?ækßÿÿÿï?ØÑÿÿÿï?øû¼ÿÿÿï?N7¡ÿÿÿï??{ÿÿÿï?^ñGÿÿÿï?êzÿÿÿï?)M©þÿÿï?0 4þÿÿï?Ôžýÿÿï?ªšàüÿÿï?>Eõûÿÿï?þÿÿÿÿï?Úüÿÿÿÿï?Þúÿÿÿÿï?¨÷ÿÿÿÿï?€òÿÿÿÿï?Cêÿÿÿÿï?(Ýÿÿÿÿï?nÈÿÿÿÿï?Ô§ÿÿÿÿï?Øtÿÿÿÿï?š%ÿÿÿÿï?6«þÿÿÿï?tïýÿÿÿï?fÑüÿÿÿï? ûÿÿÿï?^—øÿÿÿï?`Ðôÿÿÿï?`<ïÿÿÿï?Øçÿÿÿï?$9Ûÿÿÿï?Q3Êÿÿÿï?jû±ÿÿÿï?6âÿÿÿï?e`ÿÿÿï?þÿÿÿï?z Æþÿÿï?D‚Nþÿÿï?"û¯ýÿÿï?ªšàüÿÿï?Ä1Õûÿÿï? ‡úÿÿï?‚ØØøÿÿï?2ýÿÿÿÿï?bûÿÿÿÿï?nøÿÿÿÿï?¤óÿÿÿÿï?äëÿÿÿÿï?rßÿÿÿÿï?†Ëÿÿÿÿï?Ô«ÿÿÿÿï?¬yÿÿÿÿï?À*ÿÿÿÿï?P¯þÿÿÿï?tïýÿÿÿï?2Çüÿÿÿï?àûÿÿÿï?$Møÿÿÿï?Ö7ôÿÿÿï?žîÿÿÿï?3þäÿÿÿï?´’×ÿÿÿï?¶÷Ãÿÿÿï?p˜§ÿÿÿï?ñ~ÿÿÿï?ôJEÿÿÿï?¨môþÿÿï?TI„þÿÿï?žêýÿÿï?ªýÿÿï?^îüÿÿï?—úÿÿï?~ ¼øÿÿï?L\öÿÿï?ˆý_óÿÿï?ðûÿÿÿÿï?Hùÿÿÿÿï?ìôÿÿÿÿï?Îíÿÿÿÿï?@âÿÿÿÿï?Ïÿÿÿÿï?|±ÿÿÿÿï?Xÿÿÿÿï?°4ÿÿÿÿï?P»þÿÿÿï?Düýÿÿÿï?fÑüÿÿÿï?àûÿÿÿï?¾3øÿÿÿï?rèóÿÿÿï?Ì_íÿÿÿï?€‚ãÿÿÿï?â¼Ôÿÿÿï?.ξÿÿÿï?Lˆžÿÿÿï?}oÿÿÿï?–+ÿÿÿï?4–Êþÿÿï?ü„Aþÿÿï?:‚ýÿÿï?<¯yüÿÿï?BSûÿÿï?V‚,ùÿÿï?¶8©öÿÿï?ˆý_óÿÿï?žš$ïÿÿï?à Çéÿÿï?(úÿÿÿÿï?Höÿÿÿÿï?æïÿÿÿÿï?jåÿÿÿÿï?HÔÿÿÿÿï?l¸ÿÿÿÿï?T‹ÿÿÿÿï?´Bÿÿÿÿï?VÎþÿÿÿï?ðþÿÿÿï?:ïüÿÿÿï? ûÿÿÿï?$Møÿÿÿï?rèóÿÿÿï?~ íÿÿÿï?ž¼âÿÿÿï?JðÒÿÿÿï?D»ÿÿÿï?6y—ÿÿÿï?¿¥bÿÿÿï?¤ÿÿÿï?d@¤þÿÿï?ÁÞþÿÿï?ªýÿÿï?Ä1Õûÿÿï?òvúÿÿï?î•¢÷ÿÿï?R“Wôÿÿï?8”ðïÿÿï?†Î#êÿÿï?l’âÿÿï?fÕÙÿÿï?¨÷ÿÿÿÿï? òÿÿÿÿï?Âèÿÿÿÿï?lÙÿÿÿÿï?8Àÿÿÿÿï?þ–ÿÿÿÿï?ÚSÿÿÿÿï?çþÿÿÿï?°7þÿÿÿï?xýÿÿÿï?^ûÿÿÿï?^—øÿÿÿï?Ö7ôÿÿÿï?Ì_íÿÿÿï?ž¼âÿÿÿï?dRÒÿÿÿï?¨.¹ÿÿÿï?bü’ÿÿÿï?BoYÿÿÿï?êzÿÿÿï?TI„þÿÿï?èãÉýÿÿï?’„»üÿÿï?Љ7ûÿÿï?wùÿÿï?LV öÿÿï?‚çàñÿÿï?f(-ìÿÿï?Že~äÿÿï?0-KÚÿÿï?$¡õÌÿÿï?Θϻÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?ð?'ð?4ð?Eð?[ð?vð?™ð?Äð?ùð?9ð?†ð?âð?Oð?Ìð?\ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?ð?%ð?2ð?Dð?[ð?yð?Ÿð?Ðð?ð?\ð?»ð?0ð?½ð?eð?,ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?!ð?.ð??ð?Vð?uð?ð?Òð?ð?nð?Ýð?hð?ð?éð?êð?ð?‰ð?3 ð? ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?ð?(ð?8ð?Nð?lð?”ð?Êð?ð?nð?èð?ƒð?Jð?Dð?{ð?úð?Ìð?þ ð?™ ð?§ð?0ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?!ð?/ð?Cð?^ð?„ð?¸ð?þð?\ð?Øð?}ð?Sð?hð?Êð?‰ð?¹ ð?n ð?½ð?¼ð?€ð?ð? $ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?&ð?7ð?Oð?pð?Ÿð?àð?9ð?²ð?Uð?/ð?Oð?Êð?´ð?+ ð?K ð?:ð?ð?ð?`#ð?,ð?a6ð?aBð?ð?ð?ð?ð?ð? ð? ð?ð?ð?+ð?>ð?[ð?ƒð?¼ð? ð?zð?ð?äð?ÿð?{ð?tð? ð?r ð?Òð?hð?uð?B'ð?2ð?T?ð?:Oð?bð?+xð?ð?ð?ð?ð? ð?ð?ð? ð?/ð?Fð?fð?–ð?Ùð?9ð?Àð?}ð?‚ð?êð?Óð?h ð?Û ð?lð?hð?*ð?)ð?¿5ð?”Eð?1Yð?0qð?+Žð?´°ð?HÙð?ð?ð?ð? ð?ð?ð?"ð?3ð?Lð?qð?¨ð?öð?gð?ð?ìð?,ð?êð?Sð?Ÿ ð?ð?ð?ð?¥(ð?a6ð?Hð?¦^ð?{ð?xžð?öÉð?ºþð?ß=ð?cˆð?ð?ð? ð?ð?ð?$ð?6ð?Rð?{ð?¸ð?ð?“ð?Oð?\ð?Üð?úð?ñ ð?ð?¼ð?xð?ë%ð?å3ð?gFð?¦^ð?~ð?R¦ð?HÙð?ð?»gð?ªÇð?ü:ð?¨Ãð?ð? ð?ð?ð?%ð?8ð?Vð?ƒð?Æð?)ð?»ð?‘ð?Éð?Šð? ð?Ÿ ð?§ð?¬ð?e!ð?º.ð?Ö@ð?1Yð?yð?R¤ð?óÛð?—#ð?Á~ð?Zñð?ð?·-ð? ð?múð? ð?ð?ð?%ð?:ð?Yð?ˆð?Ðð?<ð?Ýð?Ìð?,ð?.ð? ð?K ð?Jð?Éð?·'ð?R8ð?:Oð?ƒnð?Õ˜ð?zÑð?ð?Á~ð?øýð?¸ ð?[nð?Ùnð?ªð?)ð?±óð?ð?ð?%ð?:ð?Zð?‹ð?×ð?Jð?÷ð?üð?ð?Àð? ð?àð?Üð?äð?/.ð?aBð?¦^ð?Þ…ð?Á»ð? ð?»gð?)ëð?E˜ð?£yð?‡›ð?Ç ð?ƒÙð?ª ð?AÍ ð?eð?ð?$ð?8ð?Yð?‹ð?Ùð?Qð?ð?ð?Áð?6ð?ß ð?Gð?8ð?Ê#ð?4ð?wLð?ƒnð?xžð?cáð?ß=ð?m¼ð?Îgð?fMð?‹}ð?Ç ð?íð?ô  ð?„Þ ð?æð?ÎÖð?PÎð?"ð?6ð?Vð?ˆð?×ð?Qð? ð?/ð?êð?‰ð?~ ð?lð?=ð?B'ð?V:ð?Vð?~ð?@·ð?Fð?zð?6ð?ùñð?§ð?ªð?X¿ð?(} ð?Mð?h£ð?«rð?[¶ð?|ª(ð?i‰3ð?3ð?Rð?ƒð?Ðð?Jð?ð?/ð?÷ð?´ð?ã ð?:ð?Éð?*ð?T?ð?¦^ð?wŒð?ñÎð?‘.ð?ê¶ð?Šwð?…ð?múð?Dúð?_° ð?S ð?V$ð?«rð?é˜ ð?Iý*ð?å8ð?AHð?Q\ð?Lð?{ð?Æð?<ð?÷ð?ð?êð?´ð? ð?¥ð?Âð?,ð?*Cð?¨eð?Õ˜ð?(äð?"Rð?Zñð?ÒÕð?§ð?äð?Ðað?¯Ñ ð?}‚ð?ÎÖð?zGð?]e*ð?ÏÙ8ð?0eKð?ÊÚbð?j€ð?¤ð?qð?¸ð?)ð?Ýð?üð?Áð?‰ð?ã ð?¥ð?ð?-ð?”Eð? jð?X¢ð?ˆõð?Äpð?Ú%ð?·-ð?Óªð?=Ìð?YÑ ð?Mð?ñð?÷ð?K'ð?¿5ð?xIIð?ÊÚbð?܃ð?Îß­ð?"âð?ÏŸ#ð?¨ð?ð?»ð?Ìð?ð?6ð?~ ð?:ð?Âð?-ð?gFð?3mð?X¨ð?Þð?cˆð?õPð?£yð?Í,ð?‡¥ð?#5 ð? Jð?xð?‚!ð?Yd/ð?r`Bð?Q\ð?‹B~ð?lY«ð?èïåð?–ü0ð?«²ð?a]ð?öð?“ð?‘ð?,ð?Àð?ß ð?lð?Éð?,ð?”Eð?3mð?eªð?Fð?M—ð?Ÿoð?Q´ð?Зð?Ðað?w ð?ncð?Xæð?K'ð?å8ð?tÍOð?pð?Cúœð?Þ¾Øð?o(ð?«²ð?gð?z<¿ð?À““ð?gð?Oð?Éð?.ð? ð?Gð?=ð?*ð?*Cð? jð?X¨ð?Fð?gœð?ð?nÙð?äð?±óð?ç€ ð?¦6ð?%ð?È3,ð?q‡@ð?†Z]ð?,É…ð?VÛ½ð?õ° ð?¸ªrð?шýð?öv´ð?Âú¡ð?[¸Ñð?>Pð?ð?\ð?Šð? ð?àð?8ð?B'ð?T?ð?¨eð?X¢ð?Þð?M—ð?ð?!æð?Ç ð?P ð?À>ð?¡ð?é˜ ð?Ú»0ð?AHð?5jð?æ´šð?‚=ßð?cü>ð?b(Ãð?_Vwð?Ö¾ið?¦c«ð?>Pð?µ²mð?˜/ ð?ìð?Üð? ð?K ð?Üð?Ê#ð?V:ð?¦^ð?Õ˜ð?ˆõð?cˆð?Ÿoð?nÙð?Ç ð?Áo ð?±¡ð?Û‡ð?Þq"ð?eC4ð?!­Nð?.wuð?Îß­ð? ÿð?¸ªrð?gð?ˆÄ÷ð? µ.ð?Y6Ôð?èµð?Äî ð?×6±ð?e•~ð?,ð?úð?Ÿ ð?Jð?äð?4ð?Vð?wŒð?(äð?Äpð?õPð?Q´ð?äð?P ð?±¡ð?ÎÖð?¬h#ð?Ï6ð?_HSð?‹B~ð?VÛ½ð? ð?·=¢ð?;dð?Åvwð?ÜTùð?BŒð?Óké ð?EÍÀ ð?~iÚð?—/…ð?â3"ð?{®Gáz4={®Gáz4½{®Gáz$½{®Gáz$={®Gáz$={®Gáz4={®Gáz$={®GázD=¸…ëQ¸N=š™™™™™I=)\Âõ(\=¹…ëQ¸^=Ãõ(\Âe=q= ×£pm=333333s=R¸…ëQx=¤p= ×£€=ÍÌÌÌÌÌ„=…ëQ¸…‹=Gáz®G‘=ìQ¸…ë•=×£p= ×›=333333¡=âz®Gá¤=…ëQ¸…©=™™™™™™©={®Gáz4={®Gáz4½{®Gáz4={®Gáz$½{®Gáz4=¸…ëQ¸>={®Gáz$=¸…ëQ¸>={®GázD=š™™™™™I= ×£p= W=š™™™™™Y=¤p= ×£`=š™™™™™i=p=Ãõ(\Âu=ÌÌÌÌÌÌ|=)\Âõ(„=ìQ¸…ë‰=ö(\Âõ=Fáz®G•=×£p= ×›=p= ×£p¡=×£p= ×¥=333333«=¤p= ×£°=R¸…ëQ´=ìQ¸…ë»={®Gáz4={®Gáz4½{®Gáz4={®Gáz$={®Gáz4={®Gáz$=š™™™™™I={®GázD=¸…ëQ¸N=z®GázT=¤p= ×£`=Ãõ(\Âe=p=Ãõ(\Âu=ÌÌÌÌÌÌ|=)\Âõ(„=Âõ(\Š=…ëQ¸‘=áz®Gá–=Ãõ(\Â=\Âõ(\£=Âõ(\¨=…ëQ¸¯=z®Gáz³=gfffff¸=…ëQ¸¾=R¸…ëQÂ= ×£p= Â={®Gáz4={®Gáz4½{®Gáz$={®Gáz4={®Gáz4={®Gáz4=·…ëQ¸>=š™™™™™I=ìQ¸…ëQ=¸…ëQ¸^=333333c=áz®Gáj=333333s=> ×£p=z=Âõ(\‚=ö(\Âõˆ=ÍÌÌÌÌÌ= ×£p= —=ìQ¸…ë=)\Âõ(¤=®Gázª=áz®Gá°=Âõ(\µ=Ãõ(\»=®Gáz”Á=âz®GáÅ=®GázË=š™™™™™Ð=ÍÌÌÌÌ ×={®Gáz4={®Gáz4½{®Gáz4=z®Gáz4½{®Gáz4={®Gáz4={®Gáz$=š™™™™™I={®GázD=¸…ëQ¸N= ×£p= W=¤p= ×£`=R¸…ëQh=p=R¸…ëQx=¤p= ×£€=¸…ëQ¸†=\Âõ(\=Gáz®G•=š™™™™™=…ëQ¸…£={®Gázª=p= ×£p±=ö(\Âõ¶=¾=\Âõ(\Ã=¸…ëQ¸È=ÍÌÌÌÌLÏ=áz®G¡Ó=£p= ×cØ=Þ=÷(\µÝ={®Gáz4½{®Gáz4={®Gáz$½{®GázD={®Gáz$½{®GázD=¸…ëQ¸>=š™™™™™I=¸…ëQ¸N=*\Âõ(\=ìQ¸…ëa=âz®Gáj=Âõ(\r=ÍÌÌÌÌÌ|=…ëQ¸…ƒ=…ëQ¸…‹=\Âõ(\“=áz®Gáš=Âõ(\¢=433333©=333333±=âz®Gá¶=®Gáz®¾=£p= ×#Ä=q= ×£pÊ=×£p= Ñ=¹…ëQøÕ=¯GázîÛ={®Gášá=Âõ(\ïå=R¸…ëë=ö(\Âõò={®Gáz$={®Gáz$={®Gáz4={®Gáz4=¸…ëQ¸N=·…ëQ¸N=¹…ëQ¸^=433333c=¤p= ×£p=Ãõ(\Âu=R¸…ëQ€=¸…ëQ¸†=ÍÌÌÌÌÌ=…ëQ¸…—=ffffff =âz®Gá¦=š™™™™™¯=®Gáz®µ=Âõ(\½=ìQ¸…ëÃ=¤p= ×£Ê=ìQ¸…«Ñ=ö(\Â5×={®Gá:Þ=\Âõ(|ã=¤p= ×ãè=¸…ëQxï=q= ×£°ó=†ëQ¸eø=Áõ(\bø={®Gáz4=¸…ëQ¸>=š™™™™™I=š™™™™™I= ×£p= W=*\Âõ(\=R¸…ëQh=p=âz®Gáz=ëQ¸…ë=433333‹=\Âõ(\“=®Gáz®›=…ëQ¸…£=Ø£p= ׫=\Âõ(\³= ×£p= »=š™™™™™Â=p= ×£pÉ=@Ñ=ëQ¸…+×=fffffæÞ=…ëQ¸^ä=gffff¦ê=R¸…ëAñ=áz®G!ö=¹…ëQü=Ház®§>ìQ¸…ó>{®Gá >{®Gáz4={®GázD={®Gáz4={®GázD=)\Âõ(\=¹…ëQ¸^=š™™™™™i=333333s=q= ×£p}=×£p= ׃=¸…ëQ¸Ž=®Gáz–= = ×£p= §=…ëQ¸…°=q= ×£p·=ö(\ÂuÀ=…ëQ¸Ç=R¸…ëÑÏ=…ëQ¸ÞÕ=Ház®ÇÝ=…ëQ¸ä=*\Âõèê=š™™™™Ùñ=Âõ(\r÷=…ëQ¸~þ=\Âõ(¤>¤p= × > ×£p=š>×£p= »>®Gázî>{®Gáz$={®GázD={®Gáz4=ìQ¸…ëQ=)\Âõ(\=)\Âõ(\=)\Âõ(l=×£p= ×s=¹…ëQ¸~=ffffff†=ö(\Âõ=ÌÌÌÌÌ̘=)\Âõ(¢=¤p= ×£ª=)\Âõ(³=…ëQ¸…»=)\Âõ¨Ã=Ãõ(\ÂË={®GázÓ=¤p= ×#Û=\Âõ(¼â=Ház®§é=×£p= gñ=)\Âõh÷=­Gáz.ÿ=\Âõ(”>> ×£på >Ãõ(\f>†ëQ¸I>= ×£p=>\Âõ(´!>×£p= G)>{®GázD={®Gáz4={®GázT={®GázT=¤p= ×£`=¸…ëQ¸n=…ëQ¸u=€=ˆ=> ×£p=’=\Âõ(\›=ffffff¤=Ãõ(\­=âz®Gáµ=×£p= ׿=ö(\ÂõÆ=)\ÂõhÐ=¤p= ×c×={®Gázà=p= ×£ç=q= ×£ð=ö(\Âö= ×£p= þ=¤p= ×K>¯Gáz. >= ×£p>×£p= «>Ä>q= ×£Ê#>âz®G1)>Âõ(\¸/>\Âõ(50>{®Gáz4=ìQ¸…ëQ={®GázT={®Gázd=âz®Gáj=…ëQ¸u=Ház®G=ìQ¸…ë‰=†ëQ¸…“=š™™™™™=*\Âõ(¦=q= ×£p°={®Gáz¸=fffffæÁ=> ×£p=Ê=Ház®Ó=¤p= ×cÛ=®Gáz”ã=Ház®Çë=¸…ëQˆó=¤p= ×Cû=âz®GÙ>¸…ëQØ >fffffŽ>®Gáz >R¸…ë}>áz®GÇ$>¸…ëQ$+>š™™™™Š1>™™™™™n6>…ëQ¸^<>…ëQ¸xD>{®GázD=)\Âõ(\=¤p= ×£`=âz®Gáj=Ãõ(\Âu=š™™™™™=> ×£p=Š=)\Âõ(”=\Âõ(\Ÿ=†ëQ¸…§=®Gáz®±=¤p= ×£º=Ház®ÇÃ=Ø£p= WÍ=Ház®‡Õ=ìQ¸…kß=¤p= ×Ãæ=)\ÂõXð=Ãõ(\R÷=…ëQ¸~>š™™™™!>®Gáz>¤p= ×+>¤p= ×G>33333{$>Âõ(\p+>Ház®22>…ëQ¸ã7>ö(\Â?> ×£p=ïC>TI>¸…ëÑ6J>)\Âõ(\=)\Âõ(\=¸…ëQ¸n=…ëQ¸u=š™™™™™=áz®GáŠ=¤p= ×£”= ={®Gáz¨=Âõ(\²=q= ×£p¼=àz®GaÅ=Âõ(\Ð=…ëQ¸Þ×== ×£pá=\Âõ(Üé=Âõ(\Òò=ö(\Â5û=q= ×£€>ö(\½ >…ëQ¸‘>\>ìQ¸…õ">gffff*>fffff´1>š™™™™Ø7>¸…ëQË?>R¸…ëùD>ö(\BbK>)\µ­Q>ÍÌÌÌÌ‘V>Âõ(|x`>¤p= ×£`=)\Âõ(l=…ëQ¸u=Ház®G=> ×£p=Š=¤p= ×£”=R¸…ëQ =…ëQ¸©=Gáz®G³=Ãõ(\½=)\Âõ¨Æ=fffff&Ñ=®GázÔÙ=q= ×£Pã=®Gáz´ì=ìQ¸…+õ=Q¸…ëÿ=)\Âõˆ>¸…ëQ@>z®Gá>>ÍÌÌÌÌ| >™™™™™/'> ×£p=(0>Ház®O6>¤p= ׃>>p= ×£©D>)\Âõ²K>@_R>z®GáX>¤p= —I_>)\Âd>\ÂõÈe>âz®Gáj=×£p= ×s=€=ìQ¸…ë‰=)\Âõ(”= =…ëQ¸©=š™™™™™³=q= ×£p¾=\Âõ(\Ç=ö(\ÂõÑ=Ø£p= WÛ=33333³ä=fffff&ï=fffffF÷=®GázD>®Gázn >43333—>ìQ¸…÷>®Gázf#> ×£p=®+>Âõ(\“3>Âõ(\q;>= ×£pC>)\Âu6J>{®G¡ÙQ>…ëQøX>¹…ë1 `>Ãõ(\/,e>Ø£p=*Ÿk>> ×£pÏq>\ÂõXQz>{®Gázt=¹…ëQ¸~=ˆ=†ëQ¸…“=\Âõ(\Ÿ={®Gáz¨=Gáz®G³=q= ×£p¾=¤p= ×£Ç=…ëQ¸^Ò=Ház®GÜ=Âõ(\¯å=Âõ(\‚ð=ÍÌÌÌÌüø=ö(\ÂÅ>ö(\ >Âõ(\Ã>¸…ëQˆ>{®GáF&>= ×£p0>¸…ëQ$7>w@>ÍÌÌÌÌ7G> ×£pý7P>z®GápV>¸…ëѽ^>×d>€ôk>R¸…[‹r>®GáJSx>R¸…{‰>ìQ¸mÑ€>R¸…ëQ€=ffffff†=> ×£p=’=š™™™™™=†ëQ¸…§=Âõ(\²=Ãõ(\½=\Âõ(\Ç=…ëQ¸^Ò=š™™™™™Ü=433333æ=š™™™™ñ=R¸…ë1ú=ð>†ëQ¸%>…ëQ¸¡>®GázÞ >†ëQ¸õ(>)\ÂõQ2>\Âõ(®:>DC>•K>gfff&‘S>Âõ(Ü€[>š™™™™$c>®Gáºaj> ×£p­ýq>€Fx>= ×£P2€>ö(\º]…>ÌÌÌ̜ڋ>\ÂõPÛ”>Ãõ(\Â…=ö(\Âõ=\Âõ(\›=*\Âõ(¦=®Gáz®±=q= ×£p¼=)\Âõ¨Æ=ö(\ÂõÑ=Ház®GÜ=433333æ=ÍÌÌÌÌLñ=®GázÔú=33333«>fffff¦>š™™™™>q= ×£.">…ëQ¸E+>Ház®L4> ×£p=ý=>¤p= WùE>†ëQ¸ïO>q= ×ãW>Âõ(\ïk`>š™™™9:g>…ëQ˜Dp>v>…ëQ¸õ~>¸…ë1…>43335Œ>R¸…ç¶’>š™™™•‰˜>ö(\B¤š>…ëQ¸‘=ÌÌÌÌÌ̘=ffffff¤=q= ×£p°=¤p= ×£º=àz®GaÅ=fffff&Ñ=Ø£p= WÛ=Âõ(\¯å=š™™™™ñ=®GázÔú={®Gáê>333337>…ëQ¸ú>Ház®#>®Gáz->q= ×£í5>âz®Gm@>Âõ(\lH>ìQ¸…R>ÿÿÿÿWZ>¸…ëc>R¸…‹qk>ìQ¸µˆs>…ëQè‰{>Âõ(d7ƒ>š™™™Á‰Š>R¸…S ’>= ×£Ì{˜> ×£p×W >HázfŽ¥>­Gáz¨`°>)\Âõ(˜=)\Âõ(¢=Ãõ(\­={®Gáz¸=Ház®ÇÃ=Âõ(\Ð=®GázÔÙ=33333³ä=Âõ(\‚ð=R¸…ë1ú=33333«>333337> ×£p=J>¤p= ×™#>š™™™™/.>q= ×£7>…ëQ¸‰A>[Âõ(qJ>Âõ(\ÏÈS>Âõ(\_]>®GáŸe>ëQ¸%o>hffffÓv>Âõ(ìZ€>\ÂõÐ5‡>…ëQ”M>4333Ÿ©–>ÍÌÌÌè(Ÿ>¯Gázì-¥>Âõ(6t¬>> ×£«á²>Âõ(êê´>×£p= ס=¤p= ×£ª=âz®Gáµ=fffffæÁ=Ø£p= WÍ=…ëQ¸Þ×=q= ×£Pã=fffff&ï=ÍÌÌÌÌüø=ð>fffff¦>…ëQ¸ú>¤p= ×™#>…ëQ¸’.>33333±7>ffffæ¤p= WâK>)\Âu)U>ÌÌÌÌÌà_>ìQ¸EÒg>¸…ë‘§q>> ×£°ñy>€ä‚>{®GIB‹>…ëQhy“>¯GázP‹›>¤p= 3F£>Ö£p=è­ª>ÍÌÌÌ6A²> ×£pޝ¸>R¸…•|À>*\B¶sÉ>\Âõ(\©=)\Âõ(³=×£p= ׿=> ×£p=Ê=Ház®‡Õ== ×£pá=®Gáz´ì=fffffF÷=ö(\ÂÅ>†ëQ¸%>š™™™™>Ház®#>š™™™™/.>33333±7>®GázzB>Ãõ(\¢L>Âõ( V>3333óÕ`>3333“ˆi>ÍÌÌÌ 6s>= ×£0¬|>Âõ(ì6…>\Âõ>š™™™yš–>\ÂõC >†ëQ¸Š)§>{®GKR°>×£p=Ù¿¶>¨X¿> ×£ðÎVÅ>533³³±Ì>×£pýØBÐ>{®Gáz²=…ëQ¸…»=ö(\ÂõÆ=Ház®Ó=ìQ¸…kß=\Âõ(Üé=ìQ¸…+õ=®GázD>ö(\ >…ëQ¸¡>q= ×£.">®Gáz->q= ×£7>ffffæÃõ(\¢L>áz®ÇUV>Âõ(\¯Ma>®GázŸj>ö(\ÂSt>`Í~> ×£p&‡>4333ë?‘>…ëQ¸êz™>R¸…¥¢> ×£p‹«>p= × b³>{®Gƃ»>{®ÇEPÃ>¹…ëaÍÊ>|®Çî_Ò>Áõ(\WáØ>{®çHŠã>¶+Ãi`ÿ¤½’Á¤ž¯=µ+Ãi`ÿ´=&z Rƒg`º¶+Ãi`ÿ”=9·ðûD›hº¯+Ãi`ÿ¤=·+Ãi`ÿ”=¯+Ãi`ÿ¤=‘Á¤ž¿=Ÿ+Ãi`ÿ¤=†Á¤ž¿=‘ûvLŸÇ=ƒ“îU~Ñ=åø&cj¯Ó=€“îU~á=ߨ_oã=FÝå€=—é=jÁ¤žï=WufeWô=Î×}Bïø=1¨V›×þ=%ÆŠ\t_>+‘ûvLŸ>Ø¢üÉ/e >jzZ\D°>¶+Ãi`ÿ¤½µ+Ãi`ÿ´=µ+Ãi`ÿ´½·+Ãi`ÿ´=‘Á¤ž¯½³+Ãi`ÿ”=·+Ãi`ÿ¤=‰Á¤ž¯=›Á¤ž¯=‰Á¤ž¯=‘Á¤ž¯=:ÆŠ\t_Â=•Á¤žÏ=‚“îU~Ñ=¤ö3„8?Ú=}“îU~á=Em[§å=Ü×}Bïè=â¬å0;Fq>ÜXY>ŸßØ_o>šÚ8˜JÞ>‚aÛ>Ñ5w ,ã>¶+Ãi`ÿ¤½¶+Ãi`ÿ´=¶+Ãi`ÿ¤½¶+Ãi`ÿ”=²+Ãi`ÿ”=¼+Ãi`ÿ¤=“Á¤ž¯=”Á¤ž¯½º+Ãi`ÿ´=¤ö3„8?º=/‘ûvLŸÇ=@ÆŠ\t_Â=\l‘$ßÌ=þø&cj¯Ó=d)Њ.Û=କÐ>ÿ?C >ÐóÌ‘„=>2â…HbÀ>žö3„8?>’˜k¢] >þ‹¡¥f-$>K Õž@.)>m%^ë‘ç6>¶+Ãi`ÿ¤½·+Ãi`ÿ´=¶+Ãi`ÿ”½¶+Ãi`ÿ¤½¶+Ãi`ÿ¤=¶+Ãi`ÿ”½·+Ãi`ÿ´=&z Rƒgpº¨ö3„8?º=ªö3„8?º=•Á¤ž¿=¢ö3„8?º=-‘ûvLŸÇ=¶+Ãi`ÿÔ=¨ö3„8?Ú=BÆŠ\t_â=1‘ûvLŸç=‚“îU~ñ=Õw­sQ÷ö=6w ,ãû=YufeW>c¹A<Á >Ý+w|N>œ!ÉÐUd>˜/p& >¥äU¬ôT">;–xÃÑì&>hâ?R# ->tUp„4Z2>›¯ÆÆÌ”7>÷oƒ>Ùð5>¶+Ãi`ÿ¤½¤ö3„8?º=¶+Ãi`ÿ¤½Á¤ž¯=&z Rƒgp:¹+Ãi`ÿ”=µ+Ãi`ÿ¤=&z Rƒg€:³+Ãi`ÿ¤=‘Á¤ž¯=FÆŠ\t_Â=Á¤ž¿=¦ö3„8?Ê=¨ö3„8?Ú=/‘ûvLŸ×=Em[§å=\l‘$ßì=½+Ãi`ÿô=jOÅ'‹ü=á?·›u5> ‚‡3ç >…“îU~>´CRâ>¦Ëž7>¥rS¢k…#>l Õž@.)>:˜á30>Ø[²‡c–4>è;z:>“~)äO@>q¡ZŽ%RD>¸Pm„A¿R>“Á¤ž¿=¤ö3„8?º½µ+Ãi`ÿ´=¤ö3„8?º½”Á¤ž¿=’Á¤ž¯½“Á¤ž¯=«+Ãi`ÿ”=“Á¤ž¿=‰Á¤ž¯=&‘ûvLŸÇ=þø&cj¯Ó=ÝŽ˜/Þ=ÏŽ˜/Þ=‚‡3çê=ôÒ1Þq³ò=è×}Bïø=2 •×{c>Ù¢øIó>t‚‘>•ŽNŽYæ>¢Ëž7>Xú#iÙ#>ǹä7T*>©§>=41>ûsYt6>&(èXåÄ<>Ô}pÔ\B>2m;G>DÌ’Ð?M>ùX‹RÞ*S>kx>Ô§êQ>Á¤ž¯½¶+Ãi`ÿ”=µ+Ãi`ÿ¤=¸+Ãi`ÿ¤=µ+Ãi`ÿ´=™Á¤ž¯=Á¤ž¿=EÆŠ\t_Â=þø&cj¯Ó=‘Á¤žÏ=׎˜/Þ=YufeWä=‘Á¤žï=j8jë]Sõ=Äh"3ý=kËä-ZÑ>ÎûU± >èb«>ÉñN(a>-Á ï#>¼Ž+º *>ÐMFO¼S1>Ò«1¬7>”3§¨™N>>_14O ²C>M©aHþ|I>~)äOP>̶™*RÄT>Ô¬|¨MZ>eæ1wb„`>7Mÿn>Á¤ž¯=µ+Ãi`ÿ”=º+Ãi`ÿ¤=·+Ãi`ÿ”½»+Ãi`ÿ”=‘Á¤ž¯=Á¤ž¿=:ÆŠ\t_Â=\l‘$ßÌ=k^_pVOÖ=Á¤žß=¦ö3„8?ê=Õ†GÔ€»ð=3·ðûD›ø=í?·›u5>óéŒ;ë >à¬| >‚>öD4èú‚!>.$v¹H(>â¨Ãœ0>Ò°®ø_6>kp=Hš9>>:ç•ç D>¼;èñÕ•J>1“t ì\Q>ÆþtÍt†V>¥d¬Sý\>ü„k Œb>Ka†¥Ûºg>¹ñ“¼o>£Ãt£m>º+Ãi`ÿ¤=µ+Ãi`ÿ”½AÆŠ\t_Â=Ÿö3„8?º=³+Ãi`ÿ”=¥ö3„8?Ê=DÆŠ\t_Ò=±+Ãi`ÿÔ=é¬ÙŽ˜/>9u‹^>>.ÜXY>úŸ›Ý]%>@Y¥ž¦->œQ˜âµ4>â9 'hf<>]š¹¬`C>®¨m¯ÙJ>¨-òªQ>O´ÉÆ¿/W>/pÃû‡^>ý®2Ïäc>¤Iw¥´i>r2«~}p>†¶Þ¿u>Öøa²z>MÕAÿ2Þˆ>“Á¤ž¯=&z Rƒgpº³+Ãi`ÿ´=«+Ãi`ÿ”=½+Ãi`ÿ´=Á¤žÏ=EÆŠ\t_Ò=ä×}BïØ=úø&cj¯ã=;¨V›×î=Em[§õ=*z Rƒg>Ï7KÉ>' •å>CJk>A>¤QÛiøÖ!>ðVÀ>m)>`*þ²¶2>)²s¯¿M9>ˆ@«4ššA>XdR‡LH>D~¯¹QP>Œ‰ÑAÔ˜V>)"ý&©_^>cëüµCd>!¿­|Àj>UÖ¿ÖF…q>2”#¾v>ãÝâ([}>!Œ6ôéó‚>o1|…ç‰>"’‹€[|‡>&z Rƒgpº¹+Ãi`ÿ´=»+Ãi`ÿ¤=?ÆŠ\t_Â= ö3„8?Ê=Á¤žÏ=¢ö3„8?Ú=µ+Ãi`ÿä=umùÐ…ð=Û¢øIó÷=⬟c¹A<Á >Ï5½kš>ÉñN(a>·wäv$>ÎûU±->4©„ÃX5> î¿Ú)>>b8jë]SE>,‚aÛM>Ñ©x\½T>7³¾׉\>ù5ú(´sc>¹kšéSj>lÿÈ‚ q>ö>éÖhw>è£ þÇ~>hB'^„>Tð~VÞŠ>ÝW‹Å>¶0ðkt•>õWm'¤>·+Ãi`ÿ´=£+Ãi`ÿ¤=?ÆŠ\t_Â=‘Á¤ž¿=÷ø&cj¯Ó=“Á¤žß=YufeWä=(z Rƒgð=ùéŒ;ëù=”L^s‰>ÉñN(a >Á¾=¬\}> xg}@>~„TõNK'>‹_j?õ0>¤Õ»KÅ8>VdY¿A>À“¨_?XI>löyzwöQ>ÈyfÃKY> Ç»âa>³á”veh>¸‘ÂÛ„ºp>G.pRS¸v>hÚ®Y[œ~>öOÝpi„>± ùÓÒþŠ>°°ý‡R±‘>]„½Y—>h'‹…Úž>|ô#cw¤>ð¢XJ½×¢><ÆŠ\t_Â=½+Ãi`ÿ´= ö3„8?Ê=÷ø&cj¯Ó=‡“îU~á=þø&cj¯ã=1 •×{cñ=d)Њ.û=£rS¢k…>’.*\>ô:ÔP >­VX¶}$!> ‚„‘¼¶)>noÿoò2>AÅ\4ìÝ;>Ä0@¶åLD>ïæÓ ]M>¥u\Ï"U>D ² ^>5B'~Ke>‚ÇÐLäm>‡Ù°êÈt>rÑLC¦|>Q®Y8]“ƒ>*@q¥6~Š>¾0ßô­Ä‘>unä™´š—>ýªJš–Ÿ>fufeW¤>$ðc!¿~ª>º®ƒÕc ±>ã/¦ñ¤À>¨ö3„8?º=€“îU~Ñ=Á¤žÏ=“Á¤žß=þø&cj¯ã=“îU~ñ=^)Њ.û=¬˜H'd>vmùÐ…>0$v¹H>?ÆŠ\t_">P‘Øû¬Ã+>Î6À¢°4>ØUVÇ>>PH²îrÅF>£ÐþA­P>˜·jH×MX>=<_§‚‹a>ÕDz +i>çU'÷æq>˸¢)¬=y>6pãßÁ¥>å¿*xˆ>C-MMÍ>˜“+ß–>âd·dÓž>ܧ«ù;˜¤>~La´XF«>¼bõ±>T8²\¨·>0û¯¬ò¿>»m©d¾>\l‘$ßÌ=\l‘$ßÌ=b)Њ.Û=YufeWä=1 •×{cñ=^)Њ.û= èb«>rmùÐ…>!| >‚>™ßØ_o#>dJHá=->Ø‹¯W%6>ªÃÝs¦@>Oü¤iâñH>b£6Y“R>|™_€Q[>{\¦ ˆûc>úhP9k m>9‹pæøît> Á`V`ô}>˜S<‘Œ=…>Ä@è.á>ýf{Ç\Ñ”>OÀdVÜ>,¸¨ø•¬£>±¡¿=Š­ª>±¹îé±>@À uÚ·>ág=¹ˆ¿>±ÍJvœ™#Ë>CùŸþ¤™Ù>þø&cj¯Ó=ÓŽ˜/Þ=µ+Ãi`ÿä=*z Rƒgð=\)Њ.û=®˜H'd>tmùÐ…>öVÀ>m>s¯éAlp#>[ØE¹n.>L„Ð7>å’ú¼YªA>æ”îô·J>sƒ ‹7T>ç&'œú]>déø ÿ:f>/m„ó`p>é7(íw>e.(vZ>ÀÛ3SÖôˆ>!|t¤BÏ‘>/™˜/™>aÕ/Í7¨¡>¡D”½…¨>Do<÷á°>©è•jï·>Y ŠË¿>ÑöÇþKÎÄ>«’–÷d³Ë>±=nHtÒ>}L E7Ù>kµ¿i·×>$‘ûvLŸ×=VufeWä=&z Rƒgð=ùéŒ;ëù=ù&cj¯>xmùÐ…>| >‚>w¯éAlp#>Ü!ƒÚ­.>g áž š7>!ütJB> P¹¨KðK>¡º.EŽGU>ª ÇÕ`>´ÄÈ<°-h>ô=Nû2r>¿½o%½°z>‰d¢ÊÌ¡ƒ>=4óiø Œ> ƒ¬¸”>ªmû$º>Co7»'¥>b:)ÓÓ­>’­ Ø´>¸÷Q…Pؼ>Š3'%ÈÃ>ÒxÕ°ÝÊ>·ÅCz-Ò>¤ìê1Ø> b¤0 à>ÊÕ7ãRå><¸[âÔ-ô>"\l‘$ßÜ=qmùÐ…ð=æÃ—}Bïø=ïÒ1Þq³>'ÜXY>açßH2>™ßØ_o#>_ØE¹n.>i áž š7>ÊÛCE3„B>χÒûÆL>ºkúŠxV>ÿcóПÝ`>_E+¥i>)·as>/¹ùúž}>[”gKÉ«…>E·°>> 18=7…—>¬¢µê™¡>a£c¸¨>÷‘°±>Ë@ð6=¹>Íð/¥£Á>âž’È>÷»‹™‹ñÐ>?K¹wO)×>$‰\×`ß>>ÂR9#å>™„m+@‚ì>P1.ƺó>ØšNµ‘ò>¾Ž˜/î=y^_pVOö=à¬lOÅ'‹ >!þ€4P!>AÆŠ\t_">hJHá=->L„Ð7>!ütJB>Ó‡ÒûÆL>&R„¶LV>B_ðЬBa>†Ÿáû…”j>WkóhWt>RÄ>þÀë~>‚P“–ÆW‡>3{› ~‘>þ@( š>­5¬ð¾7£>óãIu–)¬>5]B‘rs´>O—<Š©w½>׊ÝþÅ>˜-^ÓÀÍ>î•t»'×Ô>¡÷*ïÜ> p¥Rãã>+šS~ë>GøE%ŸZò>¡‹Áø>Él´‰™?âOqÆ}?BÆŠ\t_ò=ÔÂ}9>ªö3„8? >æ§ \’>±VX¶}$!>çr ¬,Î+>Ø‹¯W%6>é’ú¼YªA>lˆÆ”ëòK>øÈ V>Z­óËTCa>áÁ~Œ‹æj>¿ù™Y×t>j_…0 €>ƒÞŒ=ˆˆ>ß ´kÓ ’>Q°´]Ùœ>†üw ¥> ˆ’ÔqE¯>T_á ·>n¸£Î·ÙÀ>¢Ë}j kÈ>-è[Ó ŒÑ>+“ôÓòøØ>î g)#á>Òã ™è>r«Eñ>yyC‹^[÷>TôÎ[ßÿ>k#h¯jÇ?–ŸÛp?6¼2É ?ROÅ'‹ü=JÝå€=— >øø&cj¯>—Á¤ž>2Eîñ»Ë)>h=ç7ã 4>z4øKÁ«@>¯‰®Æ4½J>j(O>FU>ÿcóПÝ`>†Ÿáû…”j>¹ù™Y×t>©þG™ˆ<€>ûÞïÖÞ&‰>n‡3ôöX“>…);•>Õ­Üê¾q¦>¡~5m¿ê°>í+cÈwJ¹>]ºÒÄÂ>$g[凜Ë>ÈJÚúe&Ô>§eåG¨!Ý>åYðàä>dÇ 60¡í>˜nXûÖô>ÑZa´¥ý>èõf ?hì—P~ ?òJ§çË?“kŸe¹“?ÏÝUvI(?¶˜H'd>[öyzwö>˜/p& >¯G¾UN`'>¢«T'0í2>ÜUVÇ>>Kü¤iâñH>¡‡T>² ÇÕ`>p“.­¥i>‘ú^aXt>ô2FZ €>m /Ø´&‰>ä)ï¡—“>PU—Yž>&f‰¥ÎU§>|Û'»±Ô±>3ÂsGä»>/ئKìZÄ>–¢ˆcSdÎ>àŸJÊ„Ö>€yˆà> ìGÿè> 'ž@]ñ>„€ƒÒø>ÒŸ¦—¼?¤µ¦@¦¤?°1V«"?'j¶³Nµ?A÷6·Co ?€Fƒ·­i'?Ð¥·®0&?‚aÛ >&@q¥6~>2â…HbÀ$>‘_j?õ0>6w ,ã;>¹ÌƲÊF>10cC€R>û Œþ]>bÚ¾K¸+h>Xù ¯üas>NÄ>þÀë~>YÓˆ»ˆˆ>½ÄTò5Y“>KU—Yž>˜R#Ó¤§>ÂVÜ£N²>‰Ë­Ÿ$¼> /Í?}Å>Â}šôFÐ>± fKÃ{Ø>¦º¶«@â>) uÉë>,:uÉó>jE©È·Àü>+ò‘¯?ïÀ÷Ø«~ ?Ú$FfÓ?eu:K-?•Ë)ñ”ߨ_o#>ã&'œú->— @„«8>_ufeWD>¥ÐþA­P>|™_€Q[>}7ü§;f>&ÚTñ‚r>püîB}>ËÕ’DX‡>þX·f{¡’>ki$%Ε>OØZ#V§>`´f[ÃN²>¨ oý$…¼>$L íÀÆ>§÷õñÀöÐ>b\=˜*äÙ>Ñà\µ÷—ã>4R]ãoí>L)ïëéõ>s~’¸j.?‘çߋª?¹6L&P(?_~w„¡?ÔJÜAM‡!?òuq-Ò¼(?!*Ôè_1?Œ. 6qy8?E·é.aºA?Á0Þº@?FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((16,32) (47,79) (0,0)) 7 à\ã-¡Þ>ðéGúœð>8gb¢ù>܉—P[?ФS+í?\œkN‡ ?pM‡U*?05‚oë? ·¦ÂF?Zök§?†´£© ?æK«y?ʼû‹ë?Ã¥1 ?.)bp!?tðÒ±"?ÎH#³õ#?W7œ;%? Œÿ‚&?Ø<ÉË'?aÅ" )?{'ËY*?9)õ?+?°ÝbÜ,?þtö.?n j­D/?k¹Èx40?Qsu¿0?šUÆA1?€á܇ѹ1?3|ê%2?u&è„2?¼jÖÜ>ÈɈ,dð> ¦ëMù>ÄŠj”r?d`Þ?4,^Ô ?,ã§ð“?r:?;/?âÐiš?v «ó ? 1B„?nc^³?š,“Š?pyЊŒ ?2;¥×!?÷ÎìŠ&#?FSMy$?‚¤eêÎ%?HäM''?+ø~‚(?žVõ¤Þ)?}ZJæ:+?gmÂÉ•,?PE9ƒí-?¨uµì?/?€ƒ˜^AE0?€ø.2å0?ë§+~1?ÿG[l2?€uȶ”2?€¦NN| 3?ÇPcy3?ài„Á(Û>莘ã ð>ÕF€‰ù>L&Â{?xïK[G?ö—\ ?”3˜ò?µjm?j‘ϵç?Z é¶i?hÕk¸ó?"„M†?ü·áù!?ï@`—ã ?Qô;"?,Ý£—#?ùGHù$?.À¨b_&?òÇ-Ê'?àŸ8)?ЍË2ª*?-“‰®,?¼¿š‘-?žŒê/?RL™y90?€½~o±í0?F Ì1?€-×îE2?€÷Úgæ2?cºÑT{3?€Ÿ—U4?CZ6{4?€yòøØ>À[mb—ï>PØdù>Tx6?‡?d‚¶e?¨:w O ?1mn"?¸ÍŸ0¤?dJ›-?’@ z¿?jlœZ?ÞŠ.Ïÿ?ìV‰Ù¯??´±¸5!?6p™™"?ìÆµÉ$?û´Bit%?çsë&?g#·h(?ŠzjÆë)?œØGîs+?€e &-?ò’.?×6PhP™Õî>ð “°/ù>P5’^ƒ?¬ã"y?Äú’z ?fŽÙ¬D?j…‡Ó?r+ô k?˜K`ú ?Ê$Wo·?¸7N{n?`CÏ ?Ö½Æ!?å­¼Çñ"?1 -„i$?2iFNé%?q Vq'?Á!Û)?ºôë™*?£PÞ»9,?ó=-à-?$È;ò‹/?€%]Õž0?<¾Øu1?€×ê&M2?ê©É¯!3?*Ô‡5ñ3?€|EP¹4?€ þäu5?€*U÷#6?gÃ%¿6? ,·´KÔ>0>›<ïí>Òu`èø>ø|µCu?XŠÕ€?,½ú®˜ ?†ã’^_?Ôÿí‹ú?ÐkŸ?BúÑóM?èI²¬?ÚÜØ‚Ð?½ÅƒkS ?}l†Æ!?ÚIR>B#?À*í6Ç$?Ž5õþU&?ÀGï'?y\T•’)?‡v³@+?r0éù,?uà²3».?€0ëB0?€'Ò°+1?€™ôÏÄ2?ew§3?ksí3?€U¨ŸÐÔ4?€ÿø_Ùµ5?€`.TÖŒ6?z_É‘T7?€tjæ8?àhV=ÊÑ> Jñ½ðì>x¥«ø>Às”ª\?ŒþyD|?ˆWr—¨ ?Ø;êq?>ñ2?®:ðwÈ?¦¼$(„?–†ZÎL?Có$?…ZêÑ… ?Þ«"?&ü-z‰#?í<#%?§ ³}¸&?¾°vIb(?Ñ•† *?…>‰eÝ+?LÙ/¯-??+0Ž/?qÄ!ϼ0?€Óz ¸1?[N÷2?Œ¶€‰º3?€Ç×ç…¾4?dÚoÁ5? rkƒÀ6?€¶…9P¸7?úà£8?€ éN©{9?€{Ô¯Í>°¾ZEÏë>Ø+ š$ø>¬ÈmL9?\SŠúj?Ô¯5–© ?R¾øË{?ÎG'Þ+?Žáw„æ?BÔg­?†æW‚?¦¢ŠJg?ÊöÄ,¯ ?¨Øß4"?žXuäÅ#?¼œkc%?:ûÑ '?öý¢È(?h†¼t’*?Ž”él,? –ÚŽX.?~KÈ*0?€·jŽÍ11?€ÕcÝ@2?€œ… W3?')lRs4?ƱäÓ5?jˆ¢`¶6?€ï‚ŒØØ7?€þ.åù8?¯3É:?’غ /;?Àg,dïÇ>PUN.—ê> p‚¨÷>ôk±? ?ÀpRÃL?œUa/› ?<¶Ìœ|?¸"êõ4?²=Uø?˜­¾œÈ?Ƥ"â§?826o˜?tbaÎ ?IÖIÇ["?°ÿCÙõ#?Ëèž%?uJgV'?PÃ.a)?Ësyû*?ÃÉëÁë,?Š1cñ.?ñN—†0?@) ½Ÿ1?,øÿÃ2?€w¼×ò3? €@J+5?€˜zƒêk6?êµ×á²7?ý ã-þ8?€ }ÀDL:?€ƒ\æ÷;?E5ÀúS˜@é>à# U÷>ˆ|®Ò? ¤!?à“ +} ?¸d-t?ÀŒ3?ŒBé>ý?F­¤ÖÔ?„†L)¼?Pz'Õµ?nx[`â ?¦'Ev"?ßëA±$?˜ ·(É%?Ñk»qŒ'? ®ìžc)?éàËP+?ÜÇ$ V-?(ÎàMu/?€3?$®C—ˆ4?\Æ™à5?Í/8ûE7?c`ë>·8?ƒÐy2:?€ Ügµ;?€ 9,==?€´2ÂfÂ>?5Xï=¶>@0Á×ç>PR,ö>àü¬+?ˆuÞóé?Ø|>¥O ?àXš.b?Ò}Ô%?པÉô?ÒPmYÑ?$⻾?H¯V¾?ß>j0ê ?8 o‚"?yW‰Î)$?SѬâ%?±&L.¯'?ÝCP’)?¼ü¶ÇŽ+?1>€§-?©0kß/?€û²n±1?2ˆ\2?€%®3?€C5?€W´V‘6?anv!8?€HLÅ9?íñCP|;?Ö_DD=?c°|ù??@ÞìoF~@?ûð ¡>ÀpKXXæ>íñ#Õõ>¸I”vD?8ž/[¦?¼m  ?@Š&úF?øÀÿR ?-޼Þ?Èãÿ¬½?6HÙö¬?ÆXíÔ¯?ðTyûä ?ÿ+Ç"?Z¤[­*$?Ôj™Zè%?¾§¢Ì»'?î6ÏT¨)?w-^—±+?®O†Û-?+0?ë8Ë5Q1?€`ɤ2?àF4?€VAÜA—5?€ä4Ñp;7?€‡iBþ8?€t¬ôá:?Ë|»äP½J õ>Ðiþƒáÿ>°&éW?˜" uÈ ?8ÅYÛ"?1Ãé?ÞáÈ,»?4ÑR®™?Zb Hˆ?`Ö±tŠ?3HâÒ ?$á"m"?vqù$?'å"·Ø%?2´Bç¯'?ß’¢)?¦ nNµ+?oœ‰Cí-?€AYF(0?°Ò1Jr1?€‹-­®Ø2?€.A._4?«`ûŸ 6?€30›Ü7?G+„¦Ü9?2‡µ?@wriü@?Àmâ B?¹iµ§C?€ç˜™²¾Ð ¹:ã>МG cô>Ê-ÿ>xœ?ðÝUq ?¸–¸îì?ü¹Ð´»?ÖžŠŠ?9¡e?Í P?ÊîÞ–M?&È 7± ?—ëç×I"?K$¥ó#?4φ²%?éÿàU‰'?ût~)?lÍÓ–+?bìxÆ×-?€^ûÙu%0?€·²a>|1?;uzõ2?ÙdF—4?€ƒ 7Áh6?‡ú8r8? f½:?€<&¢ÃU=?#Ã$@?€‰ˆIDÔA?ÀÀÖjâÄC?@ZǧF?€@0Á½¿¾˜M©á>€xkÓ¡ó>PÐÓRoþ>ø~²Æ ?\âºü ?"û‚…?ŽçG„?¯M?æDA"?ìš‘ò?êåc‡ù?ô5÷>‚ ?]tš"?PÝ º#??uŒjs%?ÔŽ¢XF'?sÄíf8)?èÉ QP+?à\DC–-?f]É 0?€Ÿº}0k1?]ŽCëõ2?ù¢ ³4?€L ¤ê¯6?€ÏãEù8?–¹Ë¡;?HÔÖ(À>?€r§Žq8A?@¦&TlC?@Z9Ž8F?@…4«II?@¦þÀdƾp 0Zà>L§[àò>ü’å¬ý>¬ c<?è+b¤ ?ò?‚)')D?x_æç?n¸.ÓÐ?†ã7¨?jJJ?´M¨“E ?+¦ð”Ð!?Mm l#?e%?¸IÌå&?U¦[Ï(?@ Bá*?·–l$-?Ý ÷(¦/?€ZÐ<;1?æ•5/Õ2?Hlÿ¦®4?¹ƒµÙ6?€ÆUã1n9? á‹‹P $ò>€r|$ëü>xŒÎÄÕ?@ä4 ?<…€ª•?ve°ý?N‘µ?dêO1s?àÙ7;?:wfµ?fI #ø?F<1…{!?¼ ( #?–öK¬$?pÇeg&??¶°kB(?PSYF*?¡Âoì~,?xA´û.?€&vÌè0?€íu…‡Ž2?€{g+œ‚4?‡8^"à6?5EвÌ9?9È…N|=?@á®?#A?€F •‘-D?@;|?Î5H?@Ž –ˆM?`útiJR?'Ÿcüо W™ŽÚ>(.8rñ>Ý!0ü>Ðäí?@œhx1B?@ð!nö?F?€©Î@å×K? õß8ÚÈQ?à¼$ÐW?®ËódÓ¾à#¥""Ø>@’28Ñð>Ȯނû>œYfŽ?$,ñÑT?¬Q”è’ ?‚n´ f?F( ”?:f²Þ?ø ¤2=?B~ù|â?Hm΂‘?5®Q”§ ?$ÍTë"?[Îm‰#? H‘%?å³U¾&?û&Ž(?ÇäG”*?Yæ,?¥Ì{¥/?€¿D^9€1?€/19v 3?rÿþMj6?8‰Il1:?PŽ[t??mè9 xC?À*WÜH? -E¾ÁUP?@ÚE¤1øU? ˆËÏ^?€š"hÕ¾ ·×ŠÖ>ØðŠ„Gð>Àš~ êú>ÔStà·?œ#õBí?lp9_ ?ºß½`?8¥?„…Ì -?Ž‚Rœ³?ZPD;?\Œç#Ç?o=”¸- ?‰nò~!?ÝY/Û"?MuXíG$?gÁ-ýÌ%?è¯u'?t…ýR)?gü O^¸ï>$'ÓPnú>tìR°m?BÍg’?@„a¢¤ ?w$\"Ó?îüúþK?F¼ï®½? !gR)?~‚†?z¢—õ?lnÐ[?9ªz÷ã ?Vuj "?ºb2Sh#?nHÃ$? ÑÙ<&?üz‹òæ'?›M²ÐÝ)?lj™›N,?é¹;[‚/?€2Àø1?|XÁ¤-5?€Ä,é:?@˜0¬à½@?€XN†¢F? ºbÆ*P? ³!X{W?p^Q¢a?PD§‘¿²j?°#ôÉ×¾‚¿ Ó>¨lÆ,ï>èqM¯ú>œc°º5?®~ˆH?ÀµT÷C ?®‡°ì“?>7ú?­Í¢T?·]ßð£?¾ÀoÄè?Rƒl$? Y?b>ÅE ?ân=«^!?ͨ²}"?ÊCM©#?dL¼í$?/¤Ê±[&?^A…(?Ö™jK*?cM$xW-?ɲå0?€xlwO4?üXQº9?^Xµ¢CA?ÀÂÔïƒH?@P3E GR?à׫J\?ðûtnf?XCÊ6›ìq?°‚Þü×¾4±LaÓ>]”ûî>Rœîù>È”yâ?œ[x?^á›óú ?C¼k•`?Çk½ú³?•9Õ ÷?H^›)?çt6K?g¸B!\?D”:]?+¤†P?€}¡àþœ ?Á‰t!?+œM‰"?Ì|M’#?"˶¿$?ôI`‚3&?ãÚJë((?È B’+?f-~/?y`0za3?€eºPs9?}€ÙâÝA?€H.û8£J? 3]éGÒT?`ßH Ê×`?ð€‡2Šók?à v#%Îw?î)³o×¾À”PëÓ>x|–1ï>äI“ƒûù>ÀZº?ŠèГ?Âq^RÐ ?D›a=?¹šªP~?(ÎϨª?•ïÐÀ?qà ¿?M®Èâ¥?6ê8@s?M(?ɱF—Æ?¬Âõ'ª ?ÌoŽ]n!?€?Àf;"?€òO¿¹$#?å’YQ$?ÑÞ·&?HœÆTµ(?¹ï!í;-?€gx±Kˆ2?€³íÁžc9?€» 2>¶B?€¦‘*ऻTÞï>LŽç™Fú>"±",?´‡Ë…?>ÄÊ ?§jR-?½…ÝÉ]?%ÝqÍt?æ6p? ÄM?¥ÐN7 ?±YÀ˜¦?0°J±?FlJñs?ájNª?€!‡X¡e ?bg›±ö ?ÖNn#ž!?€B3ÕÃ…"?€)bû#?€a"äˆ&?jÛg^>+?€í/j}î1?hz‚)Ð9?[G¨³ D?q‰"jP?3mw²[?°Èdžg?À/Ö t?”B)"/Ï? f.ï±Ó¾ >¸¼×>'¢)‡ð>Ä)ð“×ú>즋m?’°c»E?L½ƒ»ð ?'Ä15?ˆ¾8úV?û:[?k‰¥]>?4³B¶ý?†gÓ¢•?Üo˜Æ?´ÀîUB?ðrS?^õ(7?léÁT÷?gÄ@ª?€-"c? ?Þ µé ?€¡.T."?€¥Š–Pµ$?³Öµž¶)?K’hµ1?9:ßÐè:?À;ÙéF?õ‰P¸ÜR?0÷ï ƒ`?@Ѓÿ—m?(ºuy?@$°+~>ˆ?À=TÀVо$«.Û>¬ÖFÏfñ>`ÚÅ‚µû>Ö/ôœØ?8b8©?ø8î6H ?©ÒmEX?Oh0n?I¥ó†b?Á⯂1?ÞðÖ?ÊhDN?e2®Ú’?Ù$v ?c‹~Qt?Œ87/? ?My?cÅýÖÉ?¨RÈ4?A¼£$?€3ã´ ?€™R߇H#?ÇGVÚÀ(?6ñõ³æ1?€x5í¬Xî’ò>˜”}æü>š7müp?¾éNl>?´¤LÖ ?(™çÄ™?L›%N§?ÑŽú?®Î•SO?Æ]2Sà?%£âv=?ZæVû`?]`hE?žç­·æ?Ñ管D?ìgîg? ½±f? ôé×|?¶(‰!?!´SC?D¶}8V"?€!v/ja(?@dÎÕ’w2?[ æï>?à&¶|K?À̓/Y?06Q®è g? n5u?äöh£²ü‚?ÀüL™w\’?½º¾@½Öعâ>Ø·/ô>øášoþ>h®¹9?–r9 ?¨(d<  ?Ìñiü?œhí¢?[¸iç?wµœ?kìÓ?;IWxj?a‰÷u?à/aÞ;?­'Í1·?5Ýëöæ? ß§'Ó?¾Pƒ5–?E¾#o?¶˜£ã?ïß¿Bý?[Þ)#â!?€áæÅ%Š(?€P¶äL3?@*Šß³@?ÀÍ2jjN? ”ÞÍÿ:\? t•>j?pv% .x?€—k‚>ã…?Þ7·´•?€Òh2K¾0থ-æ>6œ¨àõ>ÖH8D*?\5?Âk é ?´>ü¨?œl~U‚?ÉûÖÊ‹?ò"l?ˆ‘?‹ T;š?88W Û?ùÊìØ?Ç ýwŒ?.… #ð?;Ã?"ÅÌ?[«`Íh?5º$ô?T*Xˆy?jöŠz¢?`‹óŠè!?€§\N@#)?€Ò­–þB4?€tÈåA?°uMYó†P?ÀhŒ¥û^?ð Ϫm?èSÈiœÜz?`(I2hˆ?(±,œ’—?€ù¡ç¾>¨ÞBBê> £Kø>J ÙK?ä/¦d?¦&wÜH ?@¥å\ò?0ù,?ö“;?èS ?3®Ô?ù*PöR?‘:V¤“?û,hýŽ?9Fr=?§8 ™?ð çG ?ãAÝ[?¬«­é?)× É‘?!®î?þ«Èî4?€ÃË9Eb"?'Ô *?þÑ #=5? šw¥ éB? „mQ?PE™”Ї`?€´e,à o?`P“Î|?ààaF0Š?r\ ¾ 8™?@:ïæmÐ>@uøïî>¤).¼ƒú>&þ7Ýœ?Ž}³ÖÈ?úפ¥À ?E ¿?Œª™ý?ºÐ›ä?ãá¬?Þœ‘Ã?».”ñK?/ªm–?‡Ëè'›?ŸYrR?=–CE¶?%í±;Å?ÜGmuˆ?˜Ðñ?¾T)5Ó?émN8D?Šš¼f²?€QèG#?€zk¤ŒF+?€n…í"#6?ôU™§C? Œ8R?hï²,"a?@ÃÄØ—p?‹#—­Ü}?” ò~ª)‹?0Q:+²(š?ð¡Öõ€Ú>ÈÞ¡žò>|Í|øUý> ãZð?ÎùBa ?¶Èâßr?Tö+à¥?­³ˆ_ò?bÂG·?{'0ø?-.¸iê?îE¸ƒ…?Ư¼ä?§-S$þ?B¶iÌ?b.þH?ö,ƒÂr?^3S?4DïË ?‹n‘³á?ŒA[³z?€Öx¿ !?í•줓$?€Î¶d»¯,?PXl>è6?ÀÀ‰D?°_cÉ™rR?À€u*Ú@a?° Â%p?0}85êê}?„ ø/‹?ÖÓl4*š?0T¹³â>tbkMõ>d?X=?œ4a®Ê?e~v, ?ĺ§û.?GŸ½¬?äŸ ?’˜ I?â‘BÙ^?Л H?ÿŒJeþ?“D$õz?Í a¶?€q´ßÈT ?,P”§ ?€9Ø9Ó ?€’™Ü ?ßÈõYÓ ?5ì>vÜ ?€°9âF!?gDØ÷¬"?ìܱáA&?m%ù‚K.?@öM6‹7?ìct+D?à&¼{ž?R?8bÿPöä`? ;÷{io?Ø6qWæú|?8ö]~AŠ?¥J¦Ò:™?è¶KÝÔè>ÔLMø> “Ÿ”÷?l¹®¤?¬}–( ?ŒËì•??k¨Ò?ÓxH?ßcuêž?öÂÃÑ?X¸‹óÙ?Åny¶³?ZÆîþ+ ?€&ùóà ?S<¾r!?€¤—[Êû>ôVâsÖ?®R"Ò¥ ? buP?ÐǹKi?Ø¥#Ì?Ç6mó¤?¬s?Í [hm?¯È7Rœ?£3LjP ?€ÏÍM;!?ⵜ "?€wÜwœ¼"?€°OO#?€µËÞ^Â#?Eä£s$?€¥øÿh$?€æj+xÌ$?€’ŠF‹%?«…/¹.'?€ø–Å*¿*?@… ä”1?ÀF`æ–8?`z¡ÅÛŸC?pÚRXÔP?¢“óQ^?ˆ¯›h\:k?‘òx?œ<€Ì!†?j4*=/•?\°‘²1ó>PQ¸‰ÿ>¨–ž?×?Ì=|dÌ ?…a¼Ð?ó-9¡©?ÜëŒîn?ÚW,J?Ð*`æ´?Ñ€Ÿv/?€^qE ?§h•T`!?€tg"?|ÿV#?ÃØÅ-$?€ê‹˜ê$?ãǤŒ%?è^ÅŽ&?3Ë­º¡&?A'?€ØxKË7(?€/(©*?…SrüŠ-?©WùG2?@0JH%9? Å-Á*C?ÀˆI×±¢O?ƤAo[? MHbh?´u–Ñu? 8¸–Ædƒ?Êu)‹’?̸žËÚö>&‰+¾?P¿xNõ?X?%bê ?’‹œý?;yÉà?mvã°?+P׿l?€¤k8 ?œX´N!?ðw¸…"?¬Å9¬#?€u@9_À$?€îËå–À%?€ ì–&¬&?L¤C„'?€o®ø$N(?€›â)?€´;y¤ú)?¾èß1+?¾F— )-?ÚP"ðW0?õc ¢3?âccÔ9? ò/­û¹B?Ö=Þ‡M?0ù¬ù”³X?à&ȦP`e?ÈÕ¯3Âr?4üäèwn€?Xˆ¿?Ì®ÒÈú>0ÌéÑ?¤»Â, ?F2g`:?ªrÎS?rR)×a?ËToc?ë·”IW?°LÈÐ;?€S;W’!?†é÷g"?€¬Rz§¼#?@›%?E¶6A&?€‚öº™n'?€ ú½(?€,Æh )?Y~Òû«*?Øʼ+?€ð9ì,?€ö½®èk.?ÀÈiíM0?@Cj$ù2?À|-)5?@åýÙ‡µ:? î(zeB?@ qjéK?pT…ÄV?ˆš£C*õ?\Ãzßw ?öM;Íu?#I›¨?¿7ŽÒ?ñ6Еô?¦ú~ ?€†ò30Ž ?€ 5v"?"œtÊ‹#?€)Tª%?€™ÏÙ n&?€ŠÜmÓ'?€ÜàX®0)?G•Z††*?ýß2[×+?€ˆÌ(-?€ßañ‚†.?Ï»¥0?ÀÕpn#ë0?€èD·¶!2?ÀA+Šð3?€‡/Ü6?À[õ÷æÒ;?@•Ù½>B?`ÃpªVåI? 2ÝJ¤¶S?ð ’³Ÿ_? ã¨j1j?x1Áø³þu?D•ß%„?<œGz?¼OÞ¹)?ö†ØùÑ?ŽvOɸ?BÒRV?· þ·K?‰OeïŽ?C¾ùÜÍ?r‰'„!?\JÜþ#?€¹â‡P·$?ÚaÅüL&?*ë¦ÿß'?‚ÅjŠp)?€“$¢Cÿ*?€y§,?BpúÈ.?EG—¸/?€È;ý³0?’“Þ1?€¶1Bݯ2?€D z÷ 4?wxjè5?ÀÚáêµ8?@|Yô/=? mI>ŠOB?àQ5£H?ëFŒÁQ?pömÓþ[?ô÷úe?ಠìHŒq?àŠÈ7T?X>?¼½ŸÂe ?“»8_š?g­Ž?Õ3‰¾d?F)†É?þ£G¤-?€¸g»kÉ ?ÊFž|"?€_3¦0$?€rL»ßå%?×A ¯œ'?stlºU)?€Ö¡ëÝ+?oyÔÒ,?€‘çš.?2A 60?€—Åê€'1?À—ÙIÓ&2?¡g·D=3?€|_“óz4?€(µ‚Ëû5?EÝásð7?@µgHZ­:?€7X£ÛÄ>?€º{ùŒ™B?`ˆÓÓG?ŸþÙU?P?°åÎôM~W?Àÿ;UrÍa?¸èõnHÙk?…·™w÷w?ª /ö·?ŠNMw¨ ?!n˜Í?’Sž9H?‡A‹Å?–CF?Ä_÷ÃË?'3þ]«!?b/Yt#?•YÆJA%?€Š¾2.'?€ =ôÃê(?€k‡´yÉ*?Ø‚y¬°,?ñmÀ¢.?^.ƒ@Q0?€É¿ûRZ1?q<ýÕo2?€¾½=—3?À ’åØ4?ÀçúB6?ºT”ì7?Àå³ ý9?á„ä?¶Œ<² ?L݉"?é-‚3h$?€z/H%M&?TW»;(?tWê;2*?}Àëª5,?€B ÉJF.?@õñ8+40?@«<O1?@Á?Û%w2?@öç:¯3?€âÞrý4?€¹(Ïh6?@’›;¨þ7?À4OjÑ9?€M3Ü? c”û3A?à¹xÿ7¾C?@CŸˆCrG?À÷œ³>M?P¡7tÓR?´×’Y?ðó‡.b?ßµlhl?¢»o} ?zñ[Å’?ATgj.?¶‡:Ì?W[¹Þy?y{5-?€¬Yày!?€•[!°a#?¾Þ„U%?)_%P'?AåÎ÷Y)?3ÕÛm+?'QGp•-?ã¹vàË/?ÀVzW1?@ÆøäèA2?€”ýÀý‡3?€Aå ¦ß4?€ˆ4ÅGS6?ÀkNåãä7?€5‚¥9?>1Ÿ;?ýäÚò=?€úòA`@?àø®äƒ(B?ÀPZ‚D? ¶O*ú»G? )%ßUL?Ðs2¤«ŽQ?þ_†<œV?@TãÛ;^?` &õøàe?Ç/2 ?\Äbò¥?^—¢[?™_[ãú?×ú97Ë?ÎáD ?(é» ="?€zLª†-$?€w ¡<&?€,ôïD(?€¤,qýn*?’x!–,?€Ç°~úæ.?@qÊ<œ0?@ô“åYÞ1?À £n$3?À¼¶ÚoŠ4?À‘\»ù5?@«#ö•7?@™ßò…C9?€Ï42;?€$Ï'ÔH=?FÖsÇ??€g æOA?ÀûÎg}C?`ýÅWýHE?`ȉ¬÷:H?`,ß$L?°/8ÆÑP?`>´8­T?Ðz‚ï,bZ?¸TëÂb?Înç?ªVR§?¹X3?ð¤Æù?? xçxÂÄ@?€ŠaÒ B?`ªÆª— D?@­—ˆÝúE? ¡/ç êH? ŸšIZL?œ4öqƒP?à2{\7^S?à.OÅ6ãW?P¥ÜÌ,^?«Œ0Š€?Ša÷‹?=kF?‰ƒKâ?€—‡ ' ?€ƒVëö ?foæ3$?€ì·ƒ %?€@¶œòx(?€ha _)?©Gúè-?FHiý-?ÀÜÐ[dú0?„´Y“€1?@úÈ-4±3?ÀG‘Æ3F4?Àɘm¾6?{ð¹ýg7?@Þ²öcC:?@²Ã ˜ ;?ÀÊ"t>?@ÕÝ(ôh??€ *Õ…ÕA? ×ÖÛtB?€ú-ªQEE?«\\!'F? H9÷)J?@ÛLQ©‹K?P4iF5âP?`ª”îR?°pq'˜JW? '§ ;ÞY?] ´xü)¿"3:UÀ)¿+mNK·)¿ÑѬ±)¿ ¥d&§)¿ñ)¿ž(~)¿Ò7^)¿ ûF7)¿|“jº)¿6Ðr_Ï(¿æj‰•(¿ÃŸÒ¦A(¿aÓ>Æê'¿>gçˆ'¿•ýìƒ'¿/›&¿ùhØ‹&¿lq™¶q%¿w>»CÃ$¿TÛ$¿êã1",#¿”~ãÂ@"¿‹Úx>!¿á‰Á$ ¿LœErá¿ÚÅ+%G¿êK,‘x¿œX]ôu¿ê l¸A¿ÔÃÖ4Í ¿”l$6¿XUÔt*¿£ÕÛiÆ*¿Ã0×*¿ Í ×*¿öÛÅèÏ*¿t’¿CÁ*¿Úl¬«*¿òý¶ÙŽ*¿ä«bgj*¿6¢Û=*¿úy¦*¿Èe Ê)¿Âý†)¿ÓmŽþ-)¿,”Î(¿•ïb(¿¦ÅCzç'¿oÇS]'¿Ïšd<Â&¿8;C³&¿‘(š"S%¿ø„jê{$¿sli#¿YïL †"¿½\ÉMd!¿<}Ôæ& ¿†³öŠ™¿úþ`ª¿fòï‹¿4Æþ¿Å¤k¿dÛ‡¿W¨"I,¿úa*N ,¿ZÁÔj,¿R¿¦º,¿|Òà˜ÿ+¿€ò%_ó+¿ °à+¿|ÍÅÆ+¿rÔ ¢¥+¿"y-¦|+¿†*š>K+¿,æ½+¿'f#VÌ*¿äúÑ}*¿HÝd "*¿Ѱè¹)¿<©eC)¿—ñ½(¿^Ä.%(¿eX z'¿81–º&¿6J°äâ%¿ rÌò$¿+9äÀç#¿~a9Û¿"¿ŽQ[y!¿öíRà ¿:9ô¿è9Z#ÿ„R’8/¿ PQg¿C¼*_ ¿¹ÒmÆ,¿¸ÔÕS-¿î}r3-¿ëMÓF8-¿Ãî`5-¿$ìã,-¿†Øb-¿ÌV-¿dÀ´è,¿EjOÜÃ,¿CÝ~ð–,¿ÁR ?a,¿ò$õ!,¿l¨PØ+¿ø“‚+¿Œ@ +¿u`i'¯*¿±F@+.*¿~M›)¿—áô(¿³ó,Ë7(¿Sصb'¿ÒÎÒër&¿KSÿþe%¿Qؽ„9$¿¿T!-ë"¿ŸÜOÝx!¿2ÍÓÁ¿â™IC¿†Õž÷s¿nXŸ&I¿Èå±³¿­y‰*­.¿èw™!r.¿“4uÄo.¿"9r.¿\æ‘q.¿as(k.¿ÅºÝ^.¿Bjæ[L.¿Wn4F3.¿E#¦%.¿N©gë-¿t¦TY»-¿í 6#‚-¿òõóÄ>-¿ûÀÝð,¿KÖ›§”,¿æ¾Dô*,¿œ1)±+¿;>%+¿^ï„*¿¥—òÀÍ)¿†„lý(¿Ô×(¿\ZÌE'¿~ïAÔ%¿‰Ç$¿ñ}ò#¿*y¢'[!¿Jºà ¿Rù]a ¿Ð)$º¿¦•óp¿ìz(,//¿»ˆC/¿ïŃð¦/¿Ò­z˜°/¿¤K²-³/¿]!°/¿ÒŒ§/¿Jˆê=™/¿Ð&aâ„/¿`z. j/¿4åÄ.H/¿2¨¦š/¿ËnKxì.¿Ã°.¿!ÓÂ@j.¿L¯€.¿Ã+—ж-¿žÉÓ9F-¿Z7a|Ã,¿lA ,,¿­äé}+¿{Sïd³*¿y3¤Ë)¿]ób-Â(¿¥F$5“'¿JKGÖ:&¿4 þ"µ$¿g0þ"¿1©® !¿Nü„Ø¿–òŸ‘ ¿PîfÂn¿/ÜÞy“0¿€ñ§ýgv0¿,dÆw0¿›<Ûz0¿€rqæ5}0¿€†%$Q}0¿k›pûz0¿Ý9v0¿€Å™‚|n0¿€«KÌüc0¿€|VVV0¿HÌ 4E0¿€ …”/00¿}ÍÂÄ0¿ñzªð/¿ždbB¨/¿1 l‡R/¿‰B]í.¿¾zSMv.¿Wýc€ê-¿Ë1¿€îà—äÎ1¿€È½Ñ¿Ð1¿ ²ÃÐ1¿€ÉóÐÝÎ1¿€ììÄïÊ1¿Ö$€ËÄ1¿/‡­/¼1¿vÃzð1¿÷ü¥¢1¿¹ïº‚1¿L uVx1¿J÷Gœ[1¿Ü!+81¿µš”˜ 1¿€ ¶/×0¿¹,3è•0¿€ D^F0¿¿÷¾˜Ë/¿øÈ\â.¿54É-¿·Þ:Œx,¿8b'è*¿ÈlÄ)¿#S5ã&¿xó”]$¿Ý´JÍ}!¿È벃п(Ê2¿€+zÏS2¿Hw6d2¿ÁJ<êm2¿€xŽ%u2¿&ÿz2¿€äpø–~2¿€€/2¿ žÜU‚2¿Å£ûú2¿€‚süþ2¿€³Fˆ/|2¿;6ÂBv2¿€ßÑœÑm2¿€V@ Qb2¿G³ê S2¿€3;†?2¿€aP£4%2¿Sÿ2¿€æ¬&šÙ1¿€jµÇ£1¿€{ŒfÑ_1¿€DÕ z 1¿€?îñŸ0¿œÛÑÈ0¿jq†æñ.¿µõéŠc-¿¢PO€+¿iÓfO:)¿À!C…&¿éûuT#¿Jèºe8¿WŠÉ„(3¿€! 3¿ó93¿X+Ýo3¿€5ŸSŽ 3¿ ã8¶'3¿€#ÞÛ-3¿€÷†§ 33¿€D;O73¿€¡6¿¦:3¿€gð=3¿€ÂïüJ>3¿ÄÏoC>3¿Wà›<3¿¹ Ý83¿€v¬¢a23¿€>ãÃI(3¿€·³m3¿€sS¤L3¿€ãœ ùæ2¿¨=]¿2¿€ÜÉZ‰2¿€¨wW–Ѥ3¿Õ1`}·3¿YYÅ5Ã3¿€ÊÖÍ3¿Ã¯žÝÕ3¿6¯|Þ3¿€‹/Ôå3¿É<4í3¿þÕKô3¿€B§¸!û3¿¶¿±4¿€Mà4¿€†wav 4¿¿sò4¿€) A4¿€IÎ$4¿‘n¯4¿îVcf 4¿€`¶ Oþ3¿T?Íæ3¿pÁïzÂ3¿¿Ü øŒ3¿Õ|²@3¿)ЦÖ2¿€˜óNF2¿spä9„1¿€·áëƒ0¿r{‡ij.¿l nn +¿å Êuµ&¿ÂèW>3!¿€Á!°q}4¿€äÓ³î`4¿g¡Ýe4¿ jÈèo4¿BÀYbz4¿€½a¤¨„4¿òÜÌŽ4¿"Ü ú˜4¿–›åa£4¿€&©.®4¿€ï’dƒ¹4¿€ùwÅ4¿íušÒ4¿€DH:ß4¿(Ãì4¿€ßÌGú4¿€²ßz(5¿€ð%ƒq5¿éþ¿5¿åÉ15¿Êž8Ï5¿€¸•ù 5¿€x|Gûé4¿€¥å´²4¿îÖf[4¿€ÚõjnØ3¿ó^»3¿õÐð2¿€‚»¼`œ0¿mùá€G-¿&‚¯Êú'¿5I«ûí ¿(Ÿi¢Ä4¿4L~šû4¿~½<5¿PFñ-5¿9ùàö'5¿€yï_–35¿Q[w?5¿€Ò£åK5¿€òàî)Y5¿3‰g5¿}×Cw5¿ŠÐ“ˆ5¿€¡‡ë¥›5¿ÛQÛ“°5¿€ŽŒZÇ5¿>þÍß5¿±âU‚ù5¿¤õ³¼6¿€Tª;G-6¿þgÝFD6¿€IËùU6¿òÏF_^6¿€¶ûÀW6¿kD‡ :6¿€ R¼ ú5¿‰égFˆ5¿Ô }œÏ4¿€c¿Û™³3¿€i gH2¿“å« [/¿ë](¿¶)\±¿€,pÑÆ6¿€È¦NuU6¿€iì!Ìh6¿€^S)v6¿€œºlà‚6¿ç¾\,6¿€„9:™ž6¿£)œ®6¿Vv­À6¿€è÷™JÕ6¿ =túì6¿{]G7¿€ÔHC¾'7¿€Žé'éK7¿€ÄYGu7¿mæe?¤7¿€×Ù7¿š]þ§8¿€)ÔŒˆS8¿€ðkp—8¿3‹SøÜ8¿¢©Õî9¿€½‰5bY9¿vq/~9¿ á|9¿€Ý0™:9¿€Žª‘¶Ž8¿oظß<7¿òSZ'í4¿Ã ³"1¿-Û¨•W&¿po/Æ¿€ˆÞ‡u37¿:Á¦ˆ7¿€Q8¦º7¿€Þ>#7¿€eR_w/7¿AÀô<7¿sï]L7¿€ò÷‘.]7¿€ŽX¹õp7¿€ÊÚsú‡7¿Sü(ç¢7¿€¶åsÂ7¿ËaÔbç7¿€ƒJá€8¿€Š„›D8¿€¶Ýw~8¿"Uü¿À8¿€þ‘¡ä 9¿óàë_9¿€Çò !¼9¿?¦’“:¿€@ºGƒ:¿€ÒcYìâ:¿?œ¡Ñ0;¿€™~ÿ½W;¿÷ 5;¿¨§D¶‘:¿€_rÁ‹9¿€ôÁ vC6¿€Åv&§R1¿myt±V"¿ cS?P¯Ww{7¿IR}°7¿€àæVÂ7¿€WƒL Î7¿€Y|MÉÚ7¿€x~£&è7¿®ãpd÷7¿€Ã:' 8¿ó>ÿ8¿€¢ïf¿68¿€Q0é.T8¿€¼L÷2w8¿€~Ç 8¿€¥‹<üÑ8¿€Fàô 9¿ŠP5ÝO9¿&GIÛž9¿ Öbòù9¿€(ãlÐa:¿€=HvÖ:¿´-™£V;¿€H–!ØÞ;¿€¸6#¯g<¿€Cw2!ã<¿€}ˆB 8=¿˜|ð:=¿€°uÁ¢<¿L¯§÷:¿íÄKIz7¿€ê=‘ 1¿F;«L¿[e'ã*)?€KQ‘8¿+uo8¿€Ï„ƒq8¿ Q"z8¿€h|¼æ„8¿nÔÁw‘8¿Ó C 8¿€‹ÍTé±8¿Ð,Í&Ç8¿€Á‡‰Ñà8¿¡ˆÄÛÿ8¿_ç¹V%9¿úý@uR9¿xvˆ9¿#û[É9¿€üî~­:¿€Èx<÷o:¿€85¢™Ù:¿Í}jT;¿€á?Æà;¿h^8R}<¿€91Ø")=¿ ^Ü=¿”;S ˆ>¿€%¦&G?¿Æï‚9=?¿ª#3´>¿Ž<Ú²Ò<¿€ÖLÔ‰8¿ÿ5A«!0¿PÄR°…í¾ý½™9?ÅÂPEÙ8¿€T$ 9¿ ž÷9¿Yz}#9¿€Áoª7-9¿…ÙBŽ89¿#¸FF9¿€y½#W9¿¶hèÞk9¿Àì$€…9¿€hÆw¥9¿€ý!AÉË9¿€•žû9¿€~4:¿€»¦mÝy:¿qLt/Í:¿€ Ìd¢0;¿•ð9~¦;¿?Ùr÷0<¿€Ef—ÓÑ<¿BU¹‰=¿€è…hèV>¿ÑvJá2?¿À•rµ@¿À'<Ç]d@¿C©#U’@¿€ÉfW@¿€TÛ´Ê–>¿€¶Tm9¿I8ßWw-¿Àbß?À—†ªÑÈD?€ñ‹…ï9¿€âÞàµÉ9¿€þ-W¹Ç9¿€MÙ{¤Ì9¿€Ã¦úëÓ9¿¸8CÝ9¿lÞã*é9¿kE÷\ø9¿í· :¿€Q;$:¿€Z°.C:¿ri:¿ô»Ùh™:¿€CÓFÔ:¿€¥# M;¿Û[ÃÚs;¿€L,—Ý;¿‹Rºb\<¿€å9¸.ó<¿¢%£¤=¿€Fá¹fr>¿‚)—º[?¿€Bžk-@¿€*é °@¿€·¬ÎW$A¿e¯6pgA¿À/ö4Ê5A¿@Þk{^@¿€ÂÔ·Œ:¿'lÅú)¿ÿð$ì*?À²“=ØN?ÀÝzE7:¿À ëƒtd:¿Àz,Q“n:¿À.ðos:¿@'ÏQx:¿@ ÜQg:¿@ÖĈ:¿ÀðIu•:¿cb¦:¿t8µ›¼:¿€ä³.^Ù:¿hq³þ:¿ÌÁx,;¿¶ªf;¿û>›Ã®;¿k†X…<¿€©ƒÐøs<¿³K{÷<¿€ÿbœ˜•=¿€þ<)°Q>¿‚dž2.?¿À¯|Ž@¿Â/…¡@¿@ÇÕi×2A¿À*b]̶A¿Vh¬B¿€ñm)rÖA¿ÖT²”@¿€þZà?[:¿Aõ‰8K&¿€ö~;lk4?àe©í×T?íiï¨M;¿€ÎYC";¿îÚS°;¿À ˆÏó;¿‘2¸~;¿€”l·;¿ÀRúç %;¿€¶-wO.;¿Ô¥#¿;;¿€\æimN;¿@[•  g;¿€50Úˆ;¿€€¥’à³;¿ôú>Ìê;¿‚ž0<¿€/QI‘†<¿‡"“ñ<¿0Ô~Çt=¿~ºÙ>¿Ñ4÷]Ó>¿€äƒÌZµ?¿@åÈÄ]@¿@ò^ûí@¿q|L0„A¿€óö¦‡ B¿€‰&UB¿@jßò B¿Àà}×–@¿€×õâN9¿`Ž­· "¿€ÛZñ%9?€2©I¾Y?.}·6•;¿@y,“?¼;¿ÛÃö¿;¿ÀžL 1¾;¿€a}Æq¼;¿@Bpp"¼;¿ÀÖø ¾;¿€êØÓýÂ;¿PîÙË;¿æk.´Ù;¿ÀgÄ”Ñí;¿‘BA´ <¿À)¼á&/<¿€°¿jI`<¿@+EžŸ<¿À=SÜð<¿a%ÿU=¿€ ¹eÒ=¿<l>¿Ç¸÷%?¿€iAmW@¿€±j+Ô€@¿< Ì A¿À3{M8œA¿À~CB¿@ÑâœÙ*¬<¿€´Üny<¿€`=ºj<¿€›°gb<¿À=£ô[<¿@«ÉÌW<¿# É T<¿@.è/¾S<¿À®KFóV<¿À™>‘±^<¿@´£„1l<¿€@”\è€<¿k¿œ“ž<¿ÀoWÐEÇ<¿À\7‡sý<¿ÐG"þC=¿«Í%7ž=¿@ê$.Ñ>¿‡·Ï¨œ>¿ÀùBõ:H?¿@§ƒ; @¿åo“¨@¿ÀpØX÷þ@¿ÀŽ~£yA¿@|´ZÏA¿­Äî»A¿À`n´0º@¿0…kì;¿õ´ çË+¿Œu¸}.?àœ‹vÇR?EwfRl?€¨|(ó<¿€#Éì7=¿@7Ó'ü=¿¦é¾=¿€fôù<¿À£äØîï<¿Ài÷@aç<¿@—Ùùà<¿@à €Ý<¿°=çÝ<¿@I ®Nã<¿@õ–ï<¿€ï:æÎ=¿¨w[v =¿ÀŽTJ=¿@ŒX÷ƒ=¿€"óÚÍ=¿€yÞ¯þ->¿ª—ô¦>¿€·Ÿ…“;?¿}Û¿ì?¿€W˜G[@¿ t[XÅ@¿ÀûÁ5ª"A¿€…ëFÝKA¿€Ma/wï@¿€€]ŸÕ>¿@a:ü6¿Ì̲Í,¿€}4.’x>?€$âgpAY?@½ÐOn?€`[¥ >¿À©jêÆÐ=¿@Ú¯?¹=¿À·`¦£§=¿@,är-—=¿€c›Ö`‡=¿€:hax=¿7â/Ck=¿y†½)`=¿€G—X=¿€EOûT=¿Àñ¸_*U=¿€£Ú4ö\=¿€ø¬N!m=¿åÑ‘¶‡=¿‡Ìϯ=¿MžMþå=¿Àdõ­T/>¿1³Çò>¿À<úVä?¿@þÅíé?¿À<ø³@¿ÀW±#g@¿ÀP×u¢@¿€ âÜÙ@¿€_¥±þ?¿½Ù…Ð&<¿€;-Çö2¿0·ê>Iÿ:ÓŠD? ¥·¾Éä]?@xJ q?Àßð‹S>¿@ãôþj>¿€[iö—]>¿únbI>¿€éc ½3>¿ƒõ<×>¿@ýÄh7>¿é ðXó=¿€”Ëß=¿çä:Î=¿@ý`z¿=¿@ÛÈö‡´=¿À†½–®=¿€/8á¯=¿<Óä¼·=¿@‚î‹„Ê=¿ÀÜYä¨é=¿À@:„>¿@ÈÔÄ=V>¿€8ÁŸ§>¿@q ÈÎ?¿€Ÿ~bÈt?¿@]4™ÁØ?¿€v5C@¿á9³?¿Ã%]>¿*õ|uä9¿2•ÕÀT0¿P~oº ?À9osãE? {žuT8^? ñZ"| q?†ænn?¿À±$ú*?¿€b¸¾?¿@Fƒòì>¿€œãŒÐ>¿@wêC´>¿@cÙW—>¿F«z>¿@³nl]>¿À«Úl‹A>¿@raï'>¿€·ÌÑ>¿ËÂy¢ù=¿€­`ì¢è=¿€g \ Ý=¿e꬜Ø=¿€­q}ÄÜ=¿+ðéNë=¿Àaq¯>¿À5†dl,>¿€®ëN¿]>¿@Í‹úÓ’>¿€·RUº>¿4DÅ­>¿Àš¶Ñ>¿À.(Ve<¿À¢¸ŸzI8¿g4gÁÃ.¿Üö¦•?€iNI·0C?Æ*p[Z?Ëxk?qŽw:·?¿@ÁNÆ?¿€jóÀ®?¿@HZ©•?¿ÀnœÞm?¿AE›J?¿ÀEk&?¿€ãg(?¿ã:Ú>¿Àj³>¿@W!€Œ>¿5mLõe>¿Ú£Ä`@>¿@“×2y>¿@9=û=¿âU9Ý=¿@ÀUîÃ=¿èëE°=¿€)^×£=¿²³:,œ=¿ÀÕêb™=¿€°`—Á•=¿ÀL™g¾=¿@ã M>=¿À÷nä Œ<¿€ÙXôé:¿€!d¿\7¿<Aó/¿HDv]€ñ¾Nc…‰L¿@_]è¼>¿À‡ƒ±[…>¿@·öêM>¿€<æõ;>¿@"eê¢Ü=¿pÂ6F¤=¿Àw6øŠl=¿„›5=¿À-ŠE ÿ<¿ÀÙ¥hÇ<¿€¦ÏX‰<¿€sVÌá;<¿€ëˆZÊ;¿ÀëÄåC ;¿À寅Mª9¿ÀbWwQ 7¿€Â÷9ù1¿×‚[Œ ¿-$7de#?@ÿ(ÉþC?@ú"¬/áS?`÷q…¡@¿àø¸ôÑ“@¿ §Eùƒ@¿àÛ@õØm@¿ æ;²»V@¿@2»]">@¿ |ë $@¿ Í‘ð|@¿@à ©Ö?¿@OéÚ™?¿À-Îf X?¿@Wt)?¿@P:KË>¿@&¸ L>¿€}Ç[c/>¿ñŽŸmÛ=¿°™>ƒ=¿@Ȕޖ&=¿À ¨Å<¿ÀcŒ‘õ]<¿€`fäð;¿ÀýÙÝx;¿ÀF/{%ô:¿€ÞŒÇ¦Y:¿€ÃÑ—ò™9¿@¥v-É—8¿zT+7¿I©Û¼¶4¿€~tð@Š0¿ßõY!¿æjÜ{"?Ñmp†N? \@‹ý#A¿€¢ïêi÷@¿ ì²ðXÜ@¿`JàÃ@¿`ÍŠ,–¨@¿€QÌ…Œ@¿€ÒFp˜n@¿à4I!¨N@¿À8ðùŠ,@¿ù£Ñ@¿€µ!Â?¿€Ð$¤’n?¿£Eÿ?¿@W•Ú´>¿€-¿x£ýOÞ=¿ÀÌ•of=¿À“Ÿå<¿@¼Ñ&Y<¿€IŽÆêÁ;¿@ñxŸ;¿¢ ®2o:¿ÀÂŽåµ9¿À²JÃ"õ8¿B $;8¿ÀbÁ(S¡7¿@ÍpÛ^7¿€´Â¡å7¿€b%:¿(HðÜ"@¿ô ^@H¿ _ÔP§ÒX¿†/ >JA¿à;IA¿@$nÿä3A¿À"•o;A¿à*k ü@¿ }oÃÜ@¿ aò"»@¿€ûÖA—@¿ «7p@¿À×[(,F@¿ B*ß@¿€ ÷«Ï?¿Àd`Ie?¿æAÈ¡ñ>¿€Ý7Ùœs>¿ñþþé=¿ÀBî¸hS=¿À÷ÏXf®<¿€f}‹ù;¿@`N¿3;¿ÌȨÛ\:¿À݃j÷v9¿v÷C‰8¿€·`9÷£7¿€‹È<í6¿I.gê±6¿ÀíÓÑFŽ7¿€ŠÞ&Œ²:¿@”]^½+A¿@ð"Â$I¿þ®$­S¿À×z;[]¿ ‹ÊâA¿@(ûo°A¿€šd€A¿ÀûšÙðqA¿ %k(ÇQA¿€7¢¹N/A¿@”–Ì/ A¿€‡É›â@¿ PQ•·¶@¿À—-/£‡@¿zuukT@¿€" @¿@óåæ¾?¿€]¬á8?¿ÀÔÓ"€¥>¿À39}>¿À ðŒO=¿€WŸS ‰<¿€g¤(¢­;¿Ä¶ú»:¿À]«W´9¿À1P¦•š8¿€(V«;z7¿@µèDn6¿@ y²5¿/ÛØ½5¿€ÿÞï@„7¿À\ªôìâ<¿€šê¢÷¼D¿€tc¤Q¿ ó íRÐ^¿€kVt5\n¿ …2ƽ B¿€c¼„¤B¿ài£Â»ëA¿=r@ÌA¿àÆ©A¿ 9 ¡€„A¿@†%3\A¿À?;ƒ0A¿wÙÂA¿@mX"?Í@¿ Å’¡”@¿ ã°‡V@¿€³Œ#6@¿À‡„¦?¿°${Íæ>¿€íi°->¿€rÒÚå_=¿À [|çz<¿À¾p\X|;¿€Pæ¿ b:¿@ ã 4.9¿@2%ä7¿€`I“6¿@12ÿP^5¿Às•‚4¿ÀGvÞ¾4¿¬kÍ7¿À¶ëñ=¿ÀT™Õ/ÑF¿\å{ß…S¿0žiM…a¿9Ìrm£o¿ ó«§é¦B¿àÙ’¨pB¿ æ´‰LB¿«é#)B¿@ì *B¿ ø®ººÜA¿à& 9™±A¿ÀÃmþ¹‚A¿[?5žOA¿Ž”£´A¿À3“VÚ@¿@´j®Á–@¿àí†þL@¿kÙü·ò?¿sÑË:?¿Úl×m>¿À8kº‰=¿:§ëO‰<¿@mùôk;¿{Õn/:¿€µ‘ÐÞÒ8¿€©«L3]7¿€M“®Þ5¿À<¹Y~4¿À‹†™‹3¿À*¸¥+¼3¿€_3R7U6¿ÀÃös¸é=¿€T[5­G¿.3ÍîT¿ðq2!kc¿8ïÜç&°r¿Jb'ÐB¿`JkŠÉB¿¹b3¬B¿àé%LâˆB¿€ïÏ0bB¿@;‚A8B¿ Í²f½ B¿€²o.ÙA¿`ÕÆ£A¿ðp¯¡gA¿ lŠÊE&A¿ T>Þ@¿@tá!Ž@¿L|Ä?5@¿ÀÊ$ñR¤?¿@½_~ÕÆ>¿@<ïÒÎ=¿fÉÿè¸<¿@|%»å;¿À­ŠA{':¿€Ð]Ê©8¿ÀÀ½Úo7¿¾Ÿó†f5¿ÇäVÚ3¿À‚"Í¿2¿ØÒ–tÅ2¿€4:ýšC5¿ï<žsÓ<¿À¹îظ0G¿à¡©?ÎÂT¿ð¢1ß™ec¿€Ù“A8±r¿ÀãÑs)sC¿€Ðâ¥&9C¿@²“$×C¿@mŒê•ëB¿ÀÏÎÃB¿·9¥[—B¿à•ì°ígB¿€ï¢¬;4B¿ Dõ´ªûA¿ t†f‰½A¿`Ò¿› yA¿àUdÿE-A¿`ÌE)Ù@¿ÀF)U}{@¿ k5Ý@¿íxÁj;?¿€Ûvì4>¿€)Ïÿz =¿@¹ØžÂ;¿€Â'KQ:¿¸A.-¹8¿@£Ô«Qÿ6¿Óïÿ35¿î±~3¿P2J02¿ÀÇERò1¿ÀWç›G 4¿@Lvmõ:¿À»ñØ E¿à‡Â•ûMS¿`Äþ¼`Öa¿H´Ü]Ï·p¿`b™ø%žC¿@ 嘖C¿À¼¤¨lvC¿€—6|ŽPC¿°ÿø'C¿`ì:0úB¿`kø}bÉB¿ –#)”B¿ÀÞø–áYB¿@5¶©ÐB¿€Â‘ ÓA¿@8äÔ„A¿`|ãÈÔ-A¿`Š)ÇÖÌ@¿à”cüc`@¿€›ç"©Í?¿@§=‘¦¼>¿ü"Ú‰=¿€Ô=ùq1<¿èy`°:¿€m$ Æ9¿@ˆ¤ª½57¿;Û–ÉN5¿ù½V/t3¿€‹ÒAŠñ1¿â¢l_1¿ø>xDç2¿@||ò¿8¿ä\arˆC¿ ÇïלeQ¿`g(wP_`¿Ö;â†Jp¿@c¨Ç8GD¿à¢s!… D¿€ó,r=áC¿àË9v¹C¿À|ú¥ŽC¿ ±Sæ`C¿Û_C/C¿€RQ«%ùB¿Û`ƒã½B¿ uø¿»|B¿ íÅýÐ4B¿f‚ö$åA¿ ÑTr“ŒA¿ ¡Í-Í)A¿ÀjHSS»@¿€ŽG$u?@¿„1g¥h?¿ƒÌ[Õ/>¿Ào!k|Ð<¿À£è]@G;¿À–çò®’9¿€?ߺ¼µ7¿@ヾ¼5¿@ý7WŽÅ3¿Ào³F2¿@Ðí˜&1¿@ܪÿj2¿€]Ý4`6¿€Rl@ÐA¿@Tå-ÌNM¿`zu;ZZ¿0rRçBËg¿€Ix=ýsD¿@Ø'¸ŽkD¿ ¤È‘éJD¿àíE|ø#D¿à/Ò£xùC¿àÖ¨]ËC¿Ó¾Ÿ™C¿`p‡GcC¿À<`²Ì'C¿L™òlæB¿€$ JžB¿À>Ñ•eNB¿`ä±›õA¿ÀJÒdž’A¿@5‹Òð#A¿ ýzÙä§@¿€äºÌœ@¿€¤Ñ™.?¿@Ó»ö› =¿@Á‚Ãô<¿ÀøéBa:¿€¦³ÇJ8¿iRš€6¿À½˜è"x4¿À´Ð9ž2¿@¾P`1¿@t@ 1¿°îþ³·4¿@K!á­=¿@˜E×H×H¿ ß.޼V¿C /ì¸f¿@mY #E¿ <îôÎäD¿àÑÊ©áºD¿`1¯Ve’D¿Â#VÅgD¿àûFCÿ9D¿ ž)*uD¿ÀLâÚŒÒC¿àúdœ—C¿€MÉEäVC¿`a³cŠC¿@ï&-–ÀB¿€*ëhB¿ T¥EB¿àwA2šA¿€Õ³Ã A¿@ØL«—@¿@d%‰œú?¿€5àNp¡>¿À´ƒÜ =¿@†K`q;¿€ºòu@˜9¿@Æ/¯Ž›7¿¥£Ð†Ž5¿@ v…Cœ3¿€½ûZr2¿€æÄ’\±1¿@NšÌ&Ž3¿[®ÏÎ9¿à2â–*þC¿`úÎ  ÌP¿à#ÙÕó—\¿a©~{QE¿ XÂIE¿¬Òh)E¿Ú9ïõE¿@':8ÙD¿À¶ÊiC¬D¿àÔƒ9©{D¿`¡"ÛFD¿`~½A5 D¿`å²+ÎC¿`%-KjˆC¿Ð b‡;C¿ ÉÎHæB¿`²ˆ`z‡B¿`åvÀB¿@te½’§A¿@O• =#A¿à¶¹¶êŽ@¿@ÐèIgÑ?¿@[2\«]>¿€SÇ À<¿@qÇ[ø:¿€i Üh 9¿À´ê~Õ7¿JÚ1x5¿@çòÃa3¿€‹7ŸË2¿@—kM‡P3¿Â\­u7¿`­– ó@¿@·ê5L¿à ™ýÔóZ¿àqŵAF¿À\¼2UÇE¿@~íœ žE¿@’iÑvE¿ ZWVâME¿ÀéÙ&-"E¿ IB•óD¿70òÀD¿€D[µ^ˆD¿Àü´nKD¿ V›œD¿@À¸ÛݾC¿@,óÿCmC¿`ðéöºC¿àcû¶ù­B¿€– ¤=B¿@ÄŒ!ÀA¿@ÍŠ§Ñ3A¿ 5(ˆè–@¿€«mZ£Ï?¿€„øWJ>¿^ƹc<¿Bì‘Ë:¿og °ß8¿€WM…ñ6¿€$Å5”25¿€*dŠþ3¿€Ô¾É ý3¿À<Ø0ÜM6¿À[> È<¿€l0ƒÉòD¿(²às P¿€m*¹ 5F¿ oX_G/F¿ Žä —F¿ QÐcìE¿ fªRÅE¿ÀÑ­w}›E¿`>Ç^nnE¿ øâ½=E¿€Ã¹pÅE¿@Üh"ÏD¿`i»¿¬D¿îœéJD¿€a¡=ýC¿Àõ•›N¨C¿àó%ùIC¿`ÏrÈ=áB¿Àê= xlB¿€%‡³ƒêA¿€–yYA¿à:GÎU¸@¿@ðëO^@¿€jÞ¬s>¿0чÕ<¿À!³Ê;¿Àz…|=9¿À¯1›„‡7¿€Ž3A*6¿V€£5¿ (л6¿@úH/ð:¿€p$+zB¿@"UDrN¿À¡mÐÕñF¿ Ëgˆ¯F¿7ñm§ˆF¿ Ô#.ÔdF¿@Q»!‡?F¿€ÜbÛF¿@Q¹míE¿`¶yñ¾¿E¿À3üõE¿Àß¿î$XE¿ÀÙ*¥ýE¿ ?¸>žÜD¿@áÆŠX•D¿@På°_GD¿`bdˆðC¿`NG¶.‘C¿ÀÎÆ¸‰&C¿@±I¬J±B¿€QDñï-B¿€‰ØðA¿€Ôf8ý@¿€tãçßN@¿€Q¼?¿ÀK¡œ*Œ=¿@"l2å;¿@Nfn5U:¿€_uñ7ð8¿ð*gÅ(8¿@ œ[Y8¿€–\¾k›:¿€ Ð<Ð?¿`õp¢üD¿ dmpCG¿À7]‡}G¿`kú¡ýF¿àOd¾ÞF¿  èí»F¿@ÖÓA­—F¿àUšÿoF¿ ã׌ÛEF¿àBo‹/F¿à ¯œæE¿ ‹¼‰¯E¿ vE¿ mŸØ04E¿à´6õaïD¿€-|¼ŸD¿ ²ôº¨LD¿@ñ?é£ëC¿€öSKö†C¿àÉ^3pC¿ }?œã–B¿€Žn¦¼B¿`A“vA¿à—՜Ê@¿ÀÍ|þ'@¿@mI5äË>¿€Â¬Œå=¿Ýâ½€<¿Àû—”zq;¿Àð—9Õ:¿€E<¿€ßîU  >¿ ù³À¢¸C¿,ôÿÿÿÿï?ìÿÿÿÿï?²Þÿÿÿÿï?nÈÿÿÿÿï?¢£ÿÿÿÿï?gÿÿÿÿï?Ýÿÿÿÿï?bþÿÿÿï?¼[ýÿÿÿï?L´ûÿÿÿï?º ùÿÿÿï?`Ðôÿÿÿï?žîÿÿÿï?€‚ãÿÿÿï?JðÒÿÿÿï?¨.¹ÿÿÿï?.r‘ÿÿÿï?ÊžTÿÿÿï?ÆFøþÿÿï?ˆKmþÿÿï?Ôžýÿÿï?Zâküÿÿï?ZE¬úÿÿï? È$øÿÿï?b­†ôÿÿï?ܽiïÿÿï?¹ÌFèÿÿï? frÞÿÿï?NrÑÿÿï?Hí9¿ÿÿï?j ®§ÿÿï?)‰ÿÿï?Zïÿÿÿÿï?àãÿÿÿÿï?¨Ðÿÿÿÿï?’°ÿÿÿÿï?>{ÿÿÿÿï?ú"ÿÿÿÿï?€‘þÿÿÿï?Þ¢ýÿÿÿï?Lüÿÿÿï?’¤ùÿÿÿï?f¦õÿÿÿï?`<ïÿÿÿï?3þäÿÿÿï?â¼Ôÿÿÿï?D»ÿÿÿï?bü’ÿÿÿï?ÊžTÿÿÿï?¨môþÿÿï? Caþÿÿï?:‚ýÿÿï?Æs2üÿÿï?„È>úÿÿï?¨:^÷ÿÿï?tõ+óÿÿï?0›íÿÿï?Že~äÿÿï?”PZØÿÿï?x(}Çÿÿï?Pâc°ÿÿï?HQ7‘ÿÿï?øûËgÿÿï?÷k«1ÿÿï?Âèÿÿÿÿï?ˆØÿÿÿÿï?6½ÿÿÿÿï?\ÿÿÿÿï?´Bÿÿÿÿï?Ãþÿÿÿï?tïýÿÿÿï?,’üÿÿÿï?\Túÿÿÿï?Zªöÿÿÿï?ò´ðÿÿÿï?Øçÿÿÿï?´’×ÿÿÿï?.ξÿÿÿï?6y—ÿÿÿï?BoYÿÿÿï?ÆFøþÿÿï? Caþÿÿï?Ìfxýÿÿï?zXüÿÿï?r½øùÿÿï?|žÎöÿÿï?ªgòÿÿï?¦/ëÿÿï?,‘áÿÿï?¸‹¦Òÿÿï?ˆ­¾ÿÿï?È7S¡ÿÿï?THŽyÿÿï?$EjCÿÿï?úµÛúþÿï?O(:›þÿï?Îßÿÿÿÿï?Éÿÿÿÿï?Œ¢ÿÿÿÿï?Œaÿÿÿÿï?Dôþÿÿÿï?:=þÿÿÿï?ð ýÿÿÿï?ìûÿÿÿï?²Ê÷ÿÿÿï?†gòÿÿÿï?º•éÿÿÿï?$9Ûÿÿÿï?¶÷Ãÿÿÿï?Lˆžÿÿÿï?¿¥bÿÿÿï?êzÿÿÿï?ˆKmþÿÿï?:‚ýÿÿï?zXüÿÿï?N¡àùÿÿï?Ž4ƒöÿÿï?Jûjñÿÿï?à Çéÿÿï? frÞÿÿï?¾íÐÍÿÿï?Ò±µÿÿï?J²#“ÿÿï?ÓHbÿÿï?Úp+ÿÿï?,™Àþÿï?°®Bþÿï?mΙýÿï?ÈÓÿÿÿÿï?*´ÿÿÿÿï?T~ÿÿÿÿï?ú"ÿÿÿÿï?~ˆþÿÿÿï?B„ýÿÿÿï?”Ïûÿÿÿï?àõøÿÿÿï?Ö7ôÿÿÿï?N]ìÿÿÿï?ækßÿÿÿï?Q3Êÿÿÿï?p˜§ÿÿÿï?}oÿÿÿï?¤ÿÿÿï?TI„þÿÿï?Ôžýÿÿï?Æs2üÿÿï?r½øùÿÿï?Ž4ƒöÿÿï?u†.ñÿÿï? ~ éÿÿï?\…ºÜÿÿï?èüKÊÿÿï?€Õ¯ÿÿï?"g ‡ÿÿï?ÀJMÿÿï?úµÛúþÿï?FÙ†þÿï?œ2üåýÿï? ™h ýÿï?ôø­ãûÿï?ÈÃÿÿÿÿï?6˜ÿÿÿÿï?žMÿÿÿÿï?VÎþÿÿÿï?æõýÿÿÿï?&‡üÿÿÿï?úÿÿÿï?& öÿÿÿï?`<ïÿÿÿï?fããÿÿÿï?ØÑÿÿÿï?jû±ÿÿÿï?ñ~ÿÿÿï?–+ÿÿÿï?d@¤þÿÿï?èãÉýÿÿï?Zâküÿÿï?„È>úÿÿï?|žÎöÿÿï?Jûjñÿÿï? ~ éÿÿï?Mº"Üÿÿï?NqÈÿÿï?¾g°ªÿÿï?³8~ÿÿï?p<„<ÿÿï?>m›Üþÿï?<jRþÿï?¼tŽýÿï?I {üÿï?Fûÿï?| Nþøÿï?¶®ÿÿÿÿï?2sÿÿÿÿï?Æ ÿÿÿÿï? ]þÿÿÿï?Š0ýÿÿÿï?d0ûÿÿÿï?²Ê÷ÿÿÿï?x òÿÿÿï?¢\èÿÿÿï?ÞØÿÿÿï?øû¼ÿÿÿï?6âÿÿÿï?ôJEÿÿÿï?4–Êþÿÿï?ÁÞþÿÿï?’„»üÿÿï?ZE¬úÿÿï?¨:^÷ÿÿï?ªgòÿÿï?à Çéÿÿï?\…ºÜÿÿï?NqÈÿÿï?XÀ2©ÿÿï?THŽyÿÿï?÷k«1ÿÿï?¼&kÆþÿï?¦ Q(þÿï?h_=Býÿï?бú÷ûÿï?V9Ô$úÿï?À¼Yš÷ÿï?ܾ³ôÿï?>“ÿÿÿÿï?´Bÿÿÿÿï?\·þÿÿÿï?Çýÿÿÿï?®)üÿÿÿï?4eùÿÿÿï?«ôÿÿÿï?BŸìÿÿÿï?ûÞÿÿÿï?òÇÿÿÿï?N7¡ÿÿÿï?e`ÿÿÿï?¨môþÿÿï?ü„Aþÿÿï?ªýÿÿï?Љ7ûÿÿï? È$øÿÿï?tõ+óÿÿï?¦/ëÿÿï? frÞÿÿï?èüKÊÿÿï?¾g°ªÿÿï?THŽyÿÿï?daê-ÿÿï?x㪺þÿï?¦ þÿï? ™h ýÿï?A1Žûÿï?zÕ¶fùÿï?¼ÅiRöÿï?Jýñÿï?˜çõýëÿï?Öoÿÿÿÿï?Ýÿÿÿÿï?Hþÿÿÿï?~ýÿÿÿï?vÏúÿÿÿï?ê÷ÿÿÿï?Pðÿÿÿï?äYåÿÿÿï?dRÒÿÿÿï?jû±ÿÿÿï??{ÿÿÿï?þÿÿÿï?TI„þÿÿï?:‚ýÿÿï?Ä1Õûÿÿï?wùÿÿï?b­†ôÿÿï?0›íÿÿï?,‘áÿÿï?¾íÐÍÿÿï?€Õ¯ÿÿï?³8~ÿÿï?÷k«1ÿÿï?x㪺þÿï?„›‰þÿï? ‚Ãìüÿï?(™NIûÿï?ÂÕÚøÿï?Þ®1Hõÿï?†©¢ðÿï?êà¸Èèÿï?HµƒÞÿï?´Bÿÿÿÿï?\³þÿÿÿï?Ó¸ýÿÿÿï?üÿÿÿï?º ùÿÿÿï?rèóÿÿÿï?°ëÿÿÿï?T·Ûÿÿÿï? qÁÿÿÿï?怔ÿÿÿï?^ñGÿÿÿï?z Æþÿÿï?žêýÿÿï?<¯yüÿÿï?òvúÿÿï?LV öÿÿï?ܽiïÿÿï?Že~äÿÿï?¸‹¦Òÿÿï?Ò±µÿÿï?"g ‡ÿÿï?p<„<ÿÿï?¼&kÆþÿï?¦ þÿï? ‚Ãìüÿï?<b1ûÿï?¬Søÿï?Ú´'šôÿï?.y¼îÿï? ÞÃ)æÿï?@#.ÓÙÿï?VàR\Èÿï?Ö ÿÿÿÿï?pMþÿÿÿï?~ýÿÿÿï?¾úÿÿÿï?òÈöÿÿÿï?&âïÿÿÿï?fããÿÿÿï?«Ïÿÿÿï?F5«ÿÿÿï?mmÿÿÿï?êzÿÿÿï?D‚Nþÿÿï?ªýÿÿï?BSûÿÿï?î•¢÷ÿÿï?‚çàñÿÿï?¹ÌFèÿÿï?”PZØÿÿï?ˆ­¾ÿÿï?J²#“ÿÿï?ÀJMÿÿï?>m›Üþÿï?¦ Q(þÿï? ™h ýÿï?(™NIûÿï?¬Søÿï?¼H—]ôÿï?ÎaÄþíÿï?b«9qäÿï?ÖQÖÿï?~좾Áÿï?D!F¤ÿï?Ãþÿÿÿï?öÍýÿÿÿï?Lüÿÿÿï?J#ùÿÿÿï?rèóÿÿÿï?¾êÿÿÿï?0¹Úÿÿÿï?.ξÿÿÿï?bLŽÿÿÿï?lJ:ÿÿÿï?)M©þÿÿï?"û¯ýÿÿï?^îüÿÿï?V‚,ùÿÿï?R“Wôÿÿï?f(-ìÿÿï? frÞÿÿï?x(}Çÿÿï?È7S¡ÿÿï?ÓHbÿÿï?úµÛúþÿï?<jRþÿï?h_=Býÿï?A1Žûÿï?ÂÕÚøÿï?Ú´'šôÿï?ÎaÄþíÿï?6¶•×ãÿï?8/´oÔÿï?‚í?a½ÿï?<å»b›ÿï?^!íjÿï?lþÿÿÿï?Š0ýÿÿÿï?àûÿÿÿï?N"÷ÿÿÿï?úLðÿÿÿï?øBäÿÿÿï?«Ïÿÿÿï?nªÿÿÿï? 5iÿÿÿï?ÆFøþÿÿï?0 4þÿÿï?ªšàüÿÿï?—úÿÿï?¶8©öÿÿï?8”ðïÿÿï?Že~äÿÿï?NrÑÿÿï?Pâc°ÿÿï?THŽyÿÿï?Úp+ÿÿï?FÙ†þÿï?¼tŽýÿï?бú÷ûÿï?zÕ¶fùÿï?Þ®1Hõÿï?.y¼îÿï?b«9qäÿï?8/´oÔÿï?—XœÚ»ÿï?Œ@‹š–ÿï?Dè·ú^ÿï?Búî< ÿï?Œþÿÿÿï?­püÿÿÿï?’¤ùÿÿÿï?«ôÿÿÿï?¬Öëÿÿÿï?Â3Üÿÿÿï?J“Àÿÿÿï?6âÿÿÿï?lJ:ÿÿÿï?d@¤þÿÿï?Ôžýÿÿï?Ä1Õûÿÿï?~ ¼øÿÿï?ˆý_óÿÿï?†Î#êÿÿï?0-KÚÿÿï?Hí9¿ÿÿï?HQ7‘ÿÿï?$EjCÿÿï?,™Àþÿï?œ2üåýÿï?I {üÿï?V9Ô$úÿï?¼ÅiRöÿï?†©¢ðÿï? ÞÃ)æÿï?ÖQÖÿï?‚í?a½ÿï?Œ@‹š–ÿï? ³[ÿï?Ü[ ÿï?¦ì8ñzþï?B„ýÿÿÿï?Šûÿÿÿï?êÿ÷ÿÿÿï?â¬ñÿÿÿï?~eæÿÿÿï?dRÒÿÿÿï?«®ÿÿÿï?}oÿÿÿï?,Íÿþÿÿï?¼ß:þÿÿï?ªšàüÿÿï? ‡úÿÿï?L\öÿÿï?žš$ïÿÿï?l’âÿÿï?$¡õÌÿÿï?j ®§ÿÿï?øûËgÿÿï?úµÛúþÿï?°®Bþÿï? ™h ýÿï?Fûÿï?À¼Yš÷ÿï?Jýñÿï?êà¸Èèÿï?@#.ÓÙÿï?~좾Áÿï?<å»b›ÿï?Dè·ú^ÿï?Ü[ ÿï?Øâqþï?f®|—ýï?:ïüÿÿÿï?±xúÿÿÿï?& öÿÿÿï?žîÿÿÿï?6Ûßÿÿÿï?`cÆÿÿÿï?.í˜ÿÿÿï?^ñGÿÿÿï?äÿ·þÿÿï?bÀ¸ýÿÿï?>Eõûÿÿï?‚ØØøÿÿï?ˆý_óÿÿï?à Çéÿÿï?fÕÙÿÿï?Θϻÿÿï?)‰ÿÿï?÷k«1ÿÿï?O(:›þÿï?mΙýÿï?ôø­ãûÿï?| Nþøÿï?ܾ³ôÿï?˜çõýëÿï?HµƒÞÿï?VàR\Èÿï?D!F¤ÿï?^!íjÿï?Búî< ÿï?¦ì8ñzþï?f®|—ýï?¾ðº;üï?ôAüÿÿÿï?Œ9ùÿÿÿï?ð¿óÿÿÿï?Záéÿÿÿï?ÞØÿÿÿï?‚2¸ÿÿÿï?ñ~ÿÿÿï?vnÿÿÿï? Caþÿÿï?ªýÿÿï?hªÕúÿÿï?|žÎöÿÿï?º­ïÿÿï?^æãÿÿï?$¡õÌÿÿï?ãe"¦ÿÿï?ÓHbÿÿï?f›*ìþÿï?Λdþÿï?ˆ^þ½üÿï?ºÿ_úÿï?¼ÅiRöÿï?òùqïÿï?6¶•×ãÿï?ÎTÌfÐÿï?ÐôŸ°ÿï?Ö¢2Ízÿï?({Ì#ÿï?Âä4—þï?CØz¡¶ýï?fUŒTüï? júU.úï?’{ûÿÿÿï?²Ê÷ÿÿÿï?$ñÿÿÿï?3þäÿÿÿï?«Ïÿÿÿï?p˜§ÿÿÿï?e`ÿÿÿï?œKàþÿÿï? =úýÿÿï?LÝ]üÿÿï?t4|ùÿÿï?R“Wôÿÿï?¦/ëÿÿï?ÎëÚÿÿï?ˆ­¾ÿÿï?Âä:‹ÿÿï?÷k«1ÿÿï?<à”þÿï?ŽØ‚ýÿï?â9¤ûÿï?è£nhøÿï?lKÕòÿï?¢:Féÿï?ÒYhúØÿï?‚í?a½ÿï?è UùŽÿï?v‚ÏAÿï?lª9Áþï?ðUDðýï?4{ü¬œüï?’,û ~úï?¤]}&÷ï?œúÿÿÿï?Ø+öÿÿÿï?žîÿÿÿï?ækßÿÿÿï?4ÉÄÿÿÿï?怔ÿÿÿï?N=ÿÿÿï?ØŸþÿÿï?:‚ýÿÿï?ôf€ûÿÿï?Ô¾ä÷ÿÿï?Jûjñÿÿï? íÑåÿÿï?NrÑÿÿï?8'¬ÿÿï?&"zjÿÿï?ÊÞ öþÿï?¦ Q(þÿï?ˆ^þ½üÿï?TACBúÿï?@¹Wëõÿï?Ì«^îÿï?¸ÎLáÿï?jBˆËÊÿï?D!F¤ÿï?\¶tÅbÿï?¦Å4ôþï?òU;þï?jBýï?Чûï?HwØ¿Þ÷ï?6#+Ãòï?’¤ùÿÿÿï?¾^ôÿÿÿï?¾êÿÿÿï?h.Ùÿÿÿï?¨.¹ÿÿÿï?ñ~ÿÿÿï?¤ÿÿÿï?ÛTþÿÿï?F`øüÿÿï? ‡úÿÿï?LV öÿÿï?îÿÿï?¾0‹ßÿÿï?:<ˆÅÿÿï?‚Ùá–ÿÿï?$EjCÿÿï?Ò_t®þÿï?hY¥ýÿï? ÔõÎûÿï?¬Søÿï?lKÕòÿï?êà¸Èèÿï?Ћ{9×ÿï?¼_§°¸ÿï?ÖÐáàƒÿï?°Ži)ÿï?ðJ«Žþï?0ÛA‡ýï?>MźÍûï?V²(ïøï?r–•þ6ôï? ó±Žìï?^—øÿÿÿï?†gòÿÿÿï?Øçÿÿÿï?dRÒÿÿÿï?É`¬ÿÿÿï?â gÿÿÿï?â‡èþÿÿï?ÁÞþÿÿï?LÝ]üÿÿï?wbùÿÿï?šÿöóÿÿï?†Î#êÿÿï?”PZØÿÿï?æ5¸ÿÿï?³8~ÿÿï?’šÖÿÿï?¤¡YZþÿï? ™h ýÿï?b¶²úÿï?ÜÇP„öÿï?ðå9ïÿï?pÞõáÿï?jBˆËÊÿï?$ð!¢ÿï? ³[ÿï?0‰D£ßþï?”yi þï?4{ü¬œüï? júU.úï?ð¯Ï/öï?å£fú?ïï?ôè=Päï?.x÷ÿÿÿï?úLðÿÿÿï?> ãÿÿÿï?XîÊÿÿÿï?Lˆžÿÿÿï?j Mÿÿÿï?äÿ·þÿÿï?Χýÿÿï?x´ûÿÿï? È$øÿÿï?€o¦ñÿÿï? íÑåÿÿï?âLÐÿÿï?XÀ2©ÿÿï?ÓHbÿÿï?©äáþÿï?Žháùýÿï?D }Wüÿï?zÕ¶fùÿï?ܾ³ôÿï?´Û²­êÿï?@#.ÓÙÿï?—XœÚ»ÿï?,W¦Á†ÿï?°Ži)ÿï?¦„þï?¶ajeýï?¸Yx sûï?cøï?Lìo½^òï?.JDzèï?襁¨”Øï?Löÿÿÿï?žîÿÿÿï?ûÞÿÿÿï?6#Ãÿÿÿï?6âÿÿÿï?r™1ÿÿÿï?TI„þÿÿï?bôEýÿÿï?‚Áýúÿÿï?|žÎöÿÿï?žš$ïÿÿï?,‘áÿÿï?x(}Çÿÿï?Rõ³˜ÿÿï?$EjCÿÿï?ÚA+¨þÿï?¼tŽýÿï?A1Žûÿï?fÇiï÷ÿï?o§Ûdñÿï?¾<šåÿï?ÎTÌfÐÿï?Þodªÿï?Œúwfÿï?¸f‡íþï?ä•)þï?4{ü¬œüï?@Õ¿¯úï?8“D}õï?ôv’¯íï?ð²ÃäSàï?ÍÍÉï?¢õÿÿÿï?¬Öëÿÿÿï?0¹Úÿÿÿï?D»ÿÿÿï?Ú¿€ÿÿÿï?¤ÿÿÿï?D‚Nþÿÿï?ªšàüÿÿï?„È>úÿÿï?rÙfõÿÿï?¶ìÿÿï?Mº"Üÿÿï?ˆ­¾ÿÿï?"g ‡ÿÿï?ð7"ÿÿï?¬ÇÃiþÿï?Ø#Êýÿï?b¶²úÿï?¼ÅiRöÿï?Ì«^îÿï?Ø"mðßÿï?ö]ãÎÅÿï?Œ@‹š–ÿï?v‚ÏAÿï?Ü¿[Ó¨þï?f®|—ýï?Ê`¿]°ûï?„'8¤Pøï?Lìo½^òï?¨a^­úçï?Í~Öï?6’eg·ï?rèóÿÿÿï?º•éÿÿÿï?xvÖÿÿÿï?0³ÿÿÿï?B…qÿÿÿï?ÆFøþÿÿï?þÿÿï?<¯yüÿÿï?t4|ùÿÿï?šÿöóÿÿï?à Çéÿÿï?|P×ÿÿï?¶qg´ÿÿï?¼è¶tÿÿï?žQ’ÿþÿï?¦ Q(þÿï?0]3üÿï?ì¢ÀÈùÿï?Ú´'šôÿï?XÕL ëÿï?@#.ÓÙÿï?,H~Jºÿï?˜í€ÿï?ˆT|Ïÿï?‚PP\þï?jBýï?Ž.¤úï?¦øª\öï?ð{»¼¾îï?­OKáï?ÍÍÉï? ÷ bq¡ï?$Áòÿÿÿï?Bfçÿÿÿï?dRÒÿÿÿï?F5«ÿÿÿï?¿¥bÿÿÿï?hÜþÿÿï?ÖŸâýÿÿï?zXüÿÿï?~ ¼øÿÿï?l‘Šòÿÿï?ìnçÿÿï??áÑÿÿï?¾g°ªÿÿï?ÓHbÿÿï?>m›Üþÿï?œ2üåýÿï?ñZüÿï?ÂÕÚøÿï?lKÕòÿï?ÌybÅçÿï?DúvvÓÿï?DÛó:®ÿï?^!íjÿï?¸f‡íþï?”yi þï?F[õFmüï?ælˆ€ùï?r–•þ6ôï?âKŒ¸êï?öZû4ÍÙï?^'4[¼ï?Ò;¶{tˆï?â¬ñÿÿÿï?äYåÿÿÿï?ØnÎÿÿÿï?¼Ò£ÿÿÿï?ÊžTÿÿÿï? oÁþÿÿï?"û¯ýÿÿï?x´ûÿÿï?Føÿÿï?u†.ñÿÿï?Že~äÿÿï?$¡õÌÿÿï?È7S¡ÿÿï?„™uPÿÿï?x㪺þÿï?hY¥ýÿï?â9¤ûÿï?fÇiï÷ÿï?²Á5ñÿï?b«9qäÿï? ÞüÍÿï?$ð!¢ÿï?ÚçŠSÿï?lª9Áþï?CØz¡¶ýï?>MźÍûï?„'8¤Pøï?œéX÷ñï?¾sØøwæï?<)€ÑÑï?jë´0­ï?Xúoù†mï?ò´ðÿÿÿï?€‚ãÿÿÿï?XîÊÿÿÿï?F)ÿÿÿï?^ñGÿÿÿï?)M©þÿÿï?:‚ýÿÿï?\ûÿÿï?¨:^÷ÿÿï?8”ðïÿÿï?” âÿÿï?NqÈÿÿï?Rõ³˜ÿÿï?yŒÿ?ÿÿï?O(:›þÿï?JŽEiýÿï?<b1ûÿï?Ö8Ç÷ÿï?òùqïÿï?¸ÎLáÿï?ZÂzÇÿï?Œ@‹š–ÿï?ñÿé<ÿï?Âä4—þï?¶ajeýï?Î+õ 2ûï?¤]}&÷ï?n?¾-½ïï?±„«:âï?ÍÍÉï?ö&:=žï?ªø~†HRï?&âïÿÿÿï?0ñáÿÿÿï?òÇÿÿÿï?6y—ÿÿÿï?N=ÿÿÿï?*¢”þÿÿï?.›Zýÿÿï?BSûÿÿï?|žÎöÿÿï?KÞîÿÿï?=ûàÿÿï?˜‡Äÿÿï?HQ7‘ÿÿï?÷k«1ÿÿï?Êþÿï?³4ýÿï?¸#—Ìúÿï?¼ÅiRöÿï?ÎaÄþíÿï?HµƒÞÿï?~좾Áÿï?ÚniMŒÿï?°Ži)ÿï?Øâqþï?B–Îýï?Ž.¤úï?ð¯Ï/öï?ôv’¯íï?:îk·KÞï?éB¦SÂï?q.ú;ï?¨>Æ¿8ï?`<ïÿÿÿï?Bµàÿÿÿï?¾—Åÿÿÿï?bü’ÿÿÿï?(Š4ÿÿÿï?TI„þÿÿï?~b;ýÿÿï?hªÕúÿÿï?L\öÿÿï?îÿÿï? frÞÿÿï?¦QgÁÿÿï?Âä:‹ÿÿï?â1&ÿÿï?¬ÇÃiþÿï? ™h ýÿï?XÐR{úÿï?\ë¶õÿï?œJóÑìÿï?ö44@Üÿï?‚í?a½ÿï?ÖÐáàƒÿï?ˆT|Ïÿï?Ü(ÅŠQþï?0šéìÞüï? júU.úï?êr1õï?" Þöëï?ÔnûÚï?^'4[¼ï?®VµZ„ï?ZdÂ#ï? Êîÿÿÿï?6Ûßÿÿÿï?¶÷Ãÿÿÿï?6âÿÿÿï?t.ÿÿÿï?N÷xþÿÿï?H¾%ýÿÿï?ZE¬úÿÿï?LV öÿÿï?†glíÿÿï?³OÝÿÿï?Hí9¿ÿÿï?"g ‡ÿÿï?Úp+ÿÿï?¤¡YZþÿï? ‚Ãìüÿï?TACBúÿï?Þ®1Hõÿï?˜çõýëÿï?ô»ý¦Úÿï?,H~Jºÿï?¼Ö(ç}ÿï?Búî< ÿï?òU;þï?Ïb³üï?[MÊÙùï?:qõŒôï?âKŒ¸êï?襁¨”Øï?6’eg·ï?‚As´{ï?\WLWï?µîÿÿÿï?ækßÿÿÿï?6#Ãÿÿÿï?bLŽÿÿÿï?–+ÿÿÿï?Ò,sþÿÿï?ªýÿÿï?—úÿÿï?Ú¼äõÿÿï?0›íÿÿï?\…ºÜÿÿï?ˆ­¾ÿÿï?4¼ç„ÿÿï?â ÿÿï?<jRþÿï?Œ»|Ýüÿï?V9Ô$úÿï?:‹mõÿï?0&^ëÿï?@#.ÓÙÿï?¼_§°¸ÿï?Ö¢2Ízÿï?:cò8ÿï?šZˆl/þï?4{ü¬œüï?ü9k›­ùï?r–•þ6ôï?®ÐZ…êï?TŠRjQ×ï?6¢Xû´ï?¨[>,%wï?lo- ï?µîÿÿÿï?ækßÿÿÿï?6#Ãÿÿÿï?bLŽÿÿÿï?–+ÿÿÿï?Ò,sþÿÿï?ªýÿÿï?—úÿÿï?Ú¼äõÿÿï?0›íÿÿï?\…ºÜÿÿï?ˆ­¾ÿÿï?4¼ç„ÿÿï?â ÿÿï?<jRþÿï?Œ»|Ýüÿï?V9Ô$úÿï?:‹mõÿï?0&^ëÿï?@#.ÓÙÿï?¼_§°¸ÿï?Ö¢2Ízÿï?:cò8ÿï?šZˆl/þï?4{ü¬œüï?ü9k›­ùï?r–•þ6ôï?®ÐZ…êï?TŠRjQ×ï?6¢Xû´ï?¨[>,%wï?lo- ï? Êîÿÿÿï?6Ûßÿÿÿï?¶÷Ãÿÿÿï?6âÿÿÿï?t.ÿÿÿï?N÷xþÿÿï?H¾%ýÿÿï?ZE¬úÿÿï?LV öÿÿï?†glíÿÿï?³OÝÿÿï?Hí9¿ÿÿï?"g ‡ÿÿï?Úp+ÿÿï?¤¡YZþÿï? ‚Ãìüÿï?TACBúÿï?Þ®1Hõÿï?˜çõýëÿï?ô»ý¦Úÿï?,H~Jºÿï?¼Ö(ç}ÿï?Búî< ÿï?òU;þï?Ïb³üï?[MÊÙùï?:qõŒôï?âKŒ¸êï?襁¨”Øï?6’eg·ï?‚As´{ï?\WLWï?`<ïÿÿÿï?Bµàÿÿÿï?¾—Åÿÿÿï?bü’ÿÿÿï?(Š4ÿÿÿï?TI„þÿÿï?~b;ýÿÿï?hªÕúÿÿï?L\öÿÿï?îÿÿï? frÞÿÿï?¦QgÁÿÿï?Âä:‹ÿÿï?â1&ÿÿï?¬ÇÃiþÿï? ™h ýÿï?XÐR{úÿï?\ë¶õÿï?œJóÑìÿï?ö44@Üÿï?‚í?a½ÿï?ÖÐáàƒÿï?ˆT|Ïÿï?Ü(ÅŠQþï?0šéìÞüï? júU.úï?êr1õï?" Þöëï?ÔnûÚï?^'4[¼ï?®VµZ„ï?ZdÂ#ï?&âïÿÿÿï?0ñáÿÿÿï?òÇÿÿÿï?6y—ÿÿÿï?N=ÿÿÿï?*¢”þÿÿï?.›Zýÿÿï?BSûÿÿï?|žÎöÿÿï?KÞîÿÿï?=ûàÿÿï?˜‡Äÿÿï?HQ7‘ÿÿï?÷k«1ÿÿï?Êþÿï?³4ýÿï?¸#—Ìúÿï?¼ÅiRöÿï?ÎaÄþíÿï?HµƒÞÿï?~좾Áÿï?ÚniMŒÿï?°Ži)ÿï?Øâqþï?B–Îýï?Ž.¤úï?ð¯Ï/öï?ôv’¯íï?:îk·KÞï?éB¦SÂï?q.ú;ï?¨>Æ¿8ï?ò´ðÿÿÿï?€‚ãÿÿÿï?XîÊÿÿÿï?F)ÿÿÿï?^ñGÿÿÿï?)M©þÿÿï?:‚ýÿÿï?\ûÿÿï?¨:^÷ÿÿï?8”ðïÿÿï?” âÿÿï?NqÈÿÿï?Rõ³˜ÿÿï?yŒÿ?ÿÿï?O(:›þÿï?JŽEiýÿï?<b1ûÿï?Ö8Ç÷ÿï?òùqïÿï?¸ÎLáÿï?ZÂzÇÿï?Œ@‹š–ÿï?ñÿé<ÿï?Âä4—þï?¶ajeýï?Î+õ 2ûï?¤]}&÷ï?n?¾-½ïï?±„«:âï?ÍÍÉï?ö&:=žï?ªø~†HRï?â¬ñÿÿÿï?äYåÿÿÿï?ØnÎÿÿÿï?¼Ò£ÿÿÿï?ÊžTÿÿÿï? oÁþÿÿï?"û¯ýÿÿï?x´ûÿÿï?Føÿÿï?u†.ñÿÿï?Že~äÿÿï?$¡õÌÿÿï?È7S¡ÿÿï?„™uPÿÿï?x㪺þÿï?hY¥ýÿï?â9¤ûÿï?fÇiï÷ÿï?²Á5ñÿï?b«9qäÿï? ÞüÍÿï?$ð!¢ÿï?ÚçŠSÿï?lª9Áþï?CØz¡¶ýï?>MźÍûï?„'8¤Pøï?œéX÷ñï?¾sØøwæï?<)€ÑÑï?jë´0­ï?Xúoù†mï?$Áòÿÿÿï?Bfçÿÿÿï?dRÒÿÿÿï?F5«ÿÿÿï?¿¥bÿÿÿï?hÜþÿÿï?ÖŸâýÿÿï?zXüÿÿï?~ ¼øÿÿï?l‘Šòÿÿï?ìnçÿÿï??áÑÿÿï?¾g°ªÿÿï?ÓHbÿÿï?>m›Üþÿï?œ2üåýÿï?ñZüÿï?ÂÕÚøÿï?lKÕòÿï?ÌybÅçÿï?DúvvÓÿï?DÛó:®ÿï?^!íjÿï?¸f‡íþï?”yi þï?F[õFmüï?ælˆ€ùï?r–•þ6ôï?âKŒ¸êï?öZû4ÍÙï?^'4[¼ï?Ò;¶{tˆï?rèóÿÿÿï?º•éÿÿÿï?xvÖÿÿÿï?0³ÿÿÿï?B…qÿÿÿï?ÆFøþÿÿï?þÿÿï?<¯yüÿÿï?t4|ùÿÿï?šÿöóÿÿï?à Çéÿÿï?|P×ÿÿï?¶qg´ÿÿï?¼è¶tÿÿï?žQ’ÿþÿï?¦ Q(þÿï?0]3üÿï?ì¢ÀÈùÿï?Ú´'šôÿï?XÕL ëÿï?@#.ÓÙÿï?,H~Jºÿï?˜í€ÿï?ˆT|Ïÿï?‚PP\þï?jBýï?Ž.¤úï?¦øª\öï?ð{»¼¾îï?­OKáï?ÍÍÉï? ÷ bq¡ï?¢õÿÿÿï?¬Öëÿÿÿï?0¹Úÿÿÿï?D»ÿÿÿï?Ú¿€ÿÿÿï?¤ÿÿÿï?D‚Nþÿÿï?ªšàüÿÿï?„È>úÿÿï?rÙfõÿÿï?¶ìÿÿï?Mº"Üÿÿï?ˆ­¾ÿÿï?"g ‡ÿÿï?ð7"ÿÿï?¬ÇÃiþÿï?Ø#Êýÿï?b¶²úÿï?¼ÅiRöÿï?Ì«^îÿï?Ø"mðßÿï?ö]ãÎÅÿï?Œ@‹š–ÿï?v‚ÏAÿï?Ü¿[Ó¨þï?f®|—ýï?Ê`¿]°ûï?„'8¤Pøï?Lìo½^òï?¨a^­úçï?Í~Öï?6’eg·ï?Löÿÿÿï?žîÿÿÿï?ûÞÿÿÿï?6#Ãÿÿÿï?6âÿÿÿï?r™1ÿÿÿï?TI„þÿÿï?bôEýÿÿï?‚Áýúÿÿï?|žÎöÿÿï?žš$ïÿÿï?,‘áÿÿï?x(}Çÿÿï?Rõ³˜ÿÿï?$EjCÿÿï?ÚA+¨þÿï?¼tŽýÿï?A1Žûÿï?fÇiï÷ÿï?o§Ûdñÿï?¾<šåÿï?ÎTÌfÐÿï?Þodªÿï?Œúwfÿï?¸f‡íþï?ä•)þï?4{ü¬œüï?@Õ¿¯úï?8“D}õï?ôv’¯íï?ð²ÃäSàï?ÍÍÉï?.x÷ÿÿÿï?úLðÿÿÿï?> ãÿÿÿï?XîÊÿÿÿï?Lˆžÿÿÿï?j Mÿÿÿï?äÿ·þÿÿï?Χýÿÿï?x´ûÿÿï? È$øÿÿï?€o¦ñÿÿï? íÑåÿÿï?âLÐÿÿï?XÀ2©ÿÿï?ÓHbÿÿï?©äáþÿï?Žháùýÿï?D }Wüÿï?zÕ¶fùÿï?ܾ³ôÿï?´Û²­êÿï?@#.ÓÙÿï?—XœÚ»ÿï?,W¦Á†ÿï?°Ži)ÿï?¦„þï?¶ajeýï?¸Yx sûï?cøï?Lìo½^òï?.JDzèï?襁¨”Øï?^—øÿÿÿï?†gòÿÿÿï?Øçÿÿÿï?dRÒÿÿÿï?É`¬ÿÿÿï?â gÿÿÿï?â‡èþÿÿï?ÁÞþÿÿï?LÝ]üÿÿï?wbùÿÿï?šÿöóÿÿï?†Î#êÿÿï?”PZØÿÿï?æ5¸ÿÿï?³8~ÿÿï?’šÖÿÿï?¤¡YZþÿï? ™h ýÿï?b¶²úÿï?ÜÇP„öÿï?ðå9ïÿï?pÞõáÿï?jBˆËÊÿï?$ð!¢ÿï? ³[ÿï?0‰D£ßþï?”yi þï?4{ü¬œüï? júU.úï?ð¯Ï/öï?å£fú?ïï?ôè=Päï?’¤ùÿÿÿï?¾^ôÿÿÿï?¾êÿÿÿï?h.Ùÿÿÿï?¨.¹ÿÿÿï?ñ~ÿÿÿï?¤ÿÿÿï?ÛTþÿÿï?F`øüÿÿï? ‡úÿÿï?LV öÿÿï?îÿÿï?¾0‹ßÿÿï?:<ˆÅÿÿï?‚Ùá–ÿÿï?$EjCÿÿï?Ò_t®þÿï?hY¥ýÿï? ÔõÎûÿï?¬Søÿï?lKÕòÿï?êà¸Èèÿï?Ћ{9×ÿï?¼_§°¸ÿï?ÖÐáàƒÿï?°Ži)ÿï?ðJ«Žþï?0ÛA‡ýï?>MźÍûï?V²(ïøï?r–•þ6ôï? ó±Žìï?œúÿÿÿï?Ø+öÿÿÿï?žîÿÿÿï?ækßÿÿÿï?4ÉÄÿÿÿï?怔ÿÿÿï?N=ÿÿÿï?ØŸþÿÿï?:‚ýÿÿï?ôf€ûÿÿï?Ô¾ä÷ÿÿï?Jûjñÿÿï? íÑåÿÿï?NrÑÿÿï?8'¬ÿÿï?&"zjÿÿï?ÊÞ öþÿï?¦ Q(þÿï?ˆ^þ½üÿï?TACBúÿï?@¹Wëõÿï?Ì«^îÿï?¸ÎLáÿï?jBˆËÊÿï?D!F¤ÿï?\¶tÅbÿï?¦Å4ôþï?òU;þï?jBýï?Чûï?HwØ¿Þ÷ï?6#+Ãòï?’{ûÿÿÿï?²Ê÷ÿÿÿï?$ñÿÿÿï?3þäÿÿÿï?«Ïÿÿÿï?p˜§ÿÿÿï?e`ÿÿÿï?œKàþÿÿï? =úýÿÿï?LÝ]üÿÿï?t4|ùÿÿï?R“Wôÿÿï?¦/ëÿÿï?ÎëÚÿÿï?ˆ­¾ÿÿï?Âä:‹ÿÿï?÷k«1ÿÿï?<à”þÿï?ŽØ‚ýÿï?â9¤ûÿï?è£nhøÿï?lKÕòÿï?¢:Féÿï?ÒYhúØÿï?‚í?a½ÿï?è UùŽÿï?v‚ÏAÿï?lª9Áþï?ðUDðýï?4{ü¬œüï?’,û ~úï?¤]}&÷ï?ôAüÿÿÿï?Œ9ùÿÿÿï?ð¿óÿÿÿï?Záéÿÿÿï?ÞØÿÿÿï?‚2¸ÿÿÿï?ñ~ÿÿÿï?vnÿÿÿï? Caþÿÿï?ªýÿÿï?hªÕúÿÿï?|žÎöÿÿï?º­ïÿÿï?^æãÿÿï?$¡õÌÿÿï?ãe"¦ÿÿï?ÓHbÿÿï?f›*ìþÿï?Λdþÿï?ˆ^þ½üÿï?ºÿ_úÿï?¼ÅiRöÿï?òùqïÿï?6¶•×ãÿï?ÎTÌfÐÿï?ÐôŸ°ÿï?Ö¢2Ízÿï?({Ì#ÿï?Âä4—þï?CØz¡¶ýï?fUŒTüï? júU.úï?êð?ñ ð?§ð?Éð?/.ð?wLð?~ð?ñÎð?"Rð?Ú%ð?£yð?Зð?±óð?À>ð?Û‡ð?¬h#ð?éF7ð?›°Uð?܃ð?ð?Ææð?¿›àð?­âPð?Ijð?n²p ð?EÍÀ ð?Ï×Òð?ökAð?;Î'ð?Xd7ð?nLð?žL*gð?Ÿ ð?¼ð?e!ð?R8ð?¦^ð?xžð?Fð?ê¶ð?ÒÕð?Óªð?‡¥ð?w ð?¦6ð?é˜ ð?eC4ð?_HSð?܃ð?p^Ïð?šÌCð?ÃÓõð?H¡ð?ð˜ð?.Ìòð?´ph ð?y·pð?Dº¬ð?€)ò ð?¨dV/ð?ðÜ8Cð?šßJ^ð?-)’‚ð?ób²ð?ð?xð?º.ð?:Oð?Þ…ð?cáð?zð?Šwð?§ð?=Ìð?#5 ð?ncð?%ð?Ú»0ð?!­Nð?‹B~ð?ð?ÃÓõð?Z¯ð?ºe¾ð?^‚Jð?˜/ ð? ÍÆð?H‰ð?I'%ð?”'n6ð?þ—ÛNð?°Jêpð?¤E³Ÿð?Ë4÷Þð?xà3ð?ð?ë%ð?Ö@ð?ƒnð?Á»ð?ß=ð?6ð?…ð?äð?YÑ ð? Jð?Xæð?È3,ð?AHð?.wuð?VÛ½ð?–ü0ð?Ææð?H¡ð?ºe¾ð?ɼhð?¸Àz ð?e½¢ð?¹Úð?§•(ð?TMy<ð?“÷ZYð?-)’‚ð? I“¼ð?]ø ð?8ÖËzð?G)ð?ð?å3ð?1Yð?Õ˜ð? ð?m¼ð?ùñð?múð?Ðað?Mð?xð?K'ð?q‡@ð?5jð?Îß­ð? ð?ÓÊð?¿›àð?ð˜ð?^‚Jð?¸Àz ð?î¢îð?‰|Çð?“̧*ð?~§ã@ð?ä½að?N²‘ð?&ËÖð?ŒÝû8ð?ÃŒyÂð?ÿÀüð?!tÙ€ð?¥(ð?gFð?yð?zÑð?»gð?Îgð?§ð?Dúð?¯Ñ ð?ñð?‚!ð?å8ð?†Z]ð?æ´šð? ÿð?·=¢ð?SÝ©ð?­âPð?.Ìòð?˜/ ð?e½¢ð?‰|Çð?J f+ð?ðÜ8Cð?žL*gð?¢rÊœð?A=×ëð?[ná^ð?=èð?‚l–íð?«;Ô2ð?¿T(ðð?a6ð?¦^ð?R¤ð?ð?)ëð?fMð?ªð?_° ð?}‚ð?÷ð?Yd/ð?tÍOð?,É…ð?‚=ßð?¸ªrð?;dð?ñ›íð?Ijð?´ph ð? ÍÆð?¹Úð?“̧*ð?ðÜ8Cð?Ò ið?º”ª¢ð?`Hùð?8ÖËzð?‚®ç8ð?pC¥Lð?Ì“ÌÖð?Bìxð?~M  ð?Hð?~ð?óÛð?Á~ð?E˜ð?‹}ð?X¿ð?S ð?ÎÖð?K'ð?r`Bð?pð?VÛ½ð?cü>ð?gð?Åvwð?Q©¼ð?n²p ð?y·pð?H‰ð?§•(ð?~§ã@ð?žL*gð?º”ª¢ð?B;þð?ƒdž‰ð?L Y[ð?…áþ’ð?ôè[ð?}›2ðð?|û«› ð? 7¾ð?¦^ð?R¦ð?—#ð?øýð?£yð?Ç ð?(} ð?V$ð?zGð?¿5ð?Q\ð?Cúœð?õ° ð?b(Ãð?ˆÄ÷ð?ÜTùð?!Kð?EÍÀ ð?Dº¬ð?I'%ð?TMy<ð?ä½að?¢rÊœð?`Hùð?ƒdž‰ð?QROgð?¤³t¸ð?8-î²ð?’çÇ¡ð?/(ë ð?Ô³ð?ïÒð?{ð?HÙð?Á~ð?¸ ð?‡›ð?íð?Mð?«rð?]e*ð?xIIð?‹B~ð?Þ¾Øð?¸ªrð?_Vwð? µ.ð?BŒð?¬™Ü ð?Ï×Òð?€)ò ð?”'n6ð?“÷ZYð?N²‘ð?A=×ëð?8ÖËzð?L Y[ð?¤³t¸ð?y6Ñð?Íߢ ð?oÇ ð?6—‘×ð?ë ð?¸ç{Ý-ð?xžð?ð?Zñð?[nð?Ç ð?ô  ð?h£ð?é˜ ð?ÏÙ8ð?ÊÚbð?lY«ð?o(ð?шýð?Ö¾ið?Y6Ôð?Óké ð? ÍÆð?ökAð?¨dV/ð?þ—ÛNð?-)’‚ð?&ËÖð?[ná^ð?‚®ç8ð?…áþ’ð?8-î²ð?Íߢ ð?fˆAð?¸CÈð?Åb¥O!ð?K<@O2ð? ­è÷Jð?öÉð?»gð?ð?Ùnð?ƒÙð?„Þ ð?«rð?Iý*ð?0eKð?܃ð?èïåð?«²ð?öv´ð?¦c«ð?èµð?EÍÀ ð?ûÆsð?;Î'ð?ðÜ8Cð?°Jêpð? I“¼ð?ŒÝû8ð?=èð?pC¥Lð?ôè[ð?’çÇ¡ð?oÇ ð?¸CÈð?Ùcú"ð?~óg³4ð?h29„Pð?­s!eyð?ºþð?ªÇð?·-ð?ªð?ª ð?æð?[¶ð?å8ð?ÊÚbð?Îß­ð?–ü0ð?gð?Âú¡ð?>Pð?Äî ð?~iÚð?ž c ð?Xd7ð?šßJ^ð?¤E³Ÿð?]ø ð?ÃŒyÂð?‚l–íð?Ì“ÌÖð?}›2ðð?/(ë ð?6—‘×ð?Åb¥O!ð?~óg³4ð?êvRð?;4Ê}ð?­¡Âð?ß=ð?ü:ð? ð?)ð?AÍ ð?ÎÖð?|ª(ð?AHð?j€ð?"âð?«²ð?z<¿ð?[¸Ñð?µ²mð?×6±ð?—/…ð?Eð(,ð?nLð?-)’‚ð?Ë4÷Þð?8ÖËzð?ÿÀüð?«;Ô2ð?Bìxð?|û«› ð?Ô³ð?ë ð?K<@O2ð?h29„Pð?;4Ê}ð?ù÷ˆÇð?NXÝX4ð?cˆð?¨Ãð?múð?±óð?eð?PÎð?i‰3ð?Q\ð?¤ð?ÏŸ#ð?a]ð?À““ð?>Pð?˜/ ð?e•~ð?â3"ð?Syk;ð?žL*gð?ób²ð?xà3ð?G)ð?!tÙ€ð?¿T(ðð?~M  ð? 7¾ð?ïÒð?¸ç{Ý-ð? ­è÷Jð?­s!eyð?­¡Âð?NXÝX4ð?Ów|«âð?ßð?:cð? ð?S ð?ñð?¿æ#ð?q‡@ð?ÅÈsð?p^Ïð?¸ªrð?Ì*•ð?ð˜ð?#)ð?ÞŒsð?—/…ð?Íî,ð?þ—ÛNð?ò¶ê‰ð?2ÀMðð?0û¡ð?ÜþtÐð?Ì“ÌÖð?H¿Gð?fˆAð?@<½Ìð?Óö'ð?eê{šBð?"÷·nð?q_ãm´ð? .Ä$ð?æÒ¹ïÕð?¨ÝŒ\éð?7Bð?§ð?îrð?ç€ ð?«rð?È3,ð?tÍOð?2Úð?záð?ZÑð?ÇåAð?Y6Ôð?´ph ð?®rŠð?€)ò ð?tŽb:ð?žL*gð?ò—·µð?‘,ý>ð?òZã-ð?›”ÉËð?Á2]•ð?£ôý\ ð?žã‚ð?Åb¥O!ð?Y„8ð?ÖöN:_ð?éÏ>Ÿð?téâð?îŒp×±ð?—OmsÁð?Q ûmð?ö±ð?êð?±óð? Jð?f›ð?¿5ð?Ùrað?p°ð?cü>ð?†Ì?ð?—  ð?^‚Jð?;  ð?ûÆsð?mdì)ð?JðÂJð?ìù„ð?A=×ëð?0û¡ð?.ãÞÞð?ܹU ð?Nõ®Ðð?'²§Yð?&hšð?¸ç{Ý-ð?­ïÇžNð?Üýé…ð?têö~âð?T!|ð?¢ð Rxð?ÇP¸¨ð?Â(¡ð?·-ð?¡Ðð?ô  ð?Ìhð?¬h#ð?q‡@ð?.wuð?t’Õð?Ýσð?z<¿ð?ÜTùð?ñýð?±g:ð?â;ð?ì4ð?šßJ^ð? ×Ũð?÷”S-ð?A\…ð?¤³t¸ð?Á2]•ð?|û«› ð?Æ4\cð?BÅû§#ð?ßÓ>ð?Âÿxkð?çf¹ð?Ê„w<ð?»ið?øœ†3‰ð?Ûä­æð?ÜD쪾 ð?Q´ð?=Ìð?w ð?ÎÖð?œÏ)ð?yLð?¼‹ð? ÿð?ZÑð?E÷Nð?5€ð?Äî ð?Ï×Òð?^|å#ð?~§ã@ð?¶uð?:ÓÒð?8ÖËzð?\•ø¦ð?ËÙ½ð?5„çsð? +€ð?&hšð?曑ï.ð?êvRð?C,q3ð?½@ŸÚúð?îŒp×±ð?¨ÝŒ\éð?ˆLúñöð??@\gdð?ó¨™ ð?éCð?ƒÙð?áoð?Ôˆð?Ú»0ð?ËoYð?¤ð?™v,ð?Dõ%ð?ñ›íð?CÈ,ð?;  ð?³õÙð?J f+ð?þ—ÛNð?w° ð?\ð?æ®AÔð?pC¥Lð?¿T(ðð?—¬-© ð?Ô³ð?Ùcú"ð?Ї <ð?Âÿxkð?Kö¹½ð?nðeMð?šç$ÎFð?þYr³ôð?¥qž‰Óð?­I¯ ð?ß¶8Îð?òÙð?±óð?}‚ð?enð?å8ð?G3gð?VÛ½ð?Ï]ð??ð?ð˜ð?µ²mð?y·pð?ökAð?þ¦3ð?šßJ^ð?Jfê«ð?ŒÝû8ð?‚®ç8ð?w Lð?¢•Mð?{Öì2 ð?@<½Ìð?öû:Î*ð?WsÅLð?Ÿ@æ@‰ð?`ƒƒôð?îŒp×±ð?1?Z7þð?¡•ûAð?”Åhw- ð?7ºÉåð?-œLGð?/sð?ª ð?h£ð?Þq"ð? ?ð?.wuð?Þ¾Øð?«²ð?¿›àð?I“Lð?+À ð?î¢îð?€)ò ð?TMy<ð?þ änð?=&Ëð?Ë›sð?\•ø¦ð?Ì“ÌÖð?Nõ®Ðð?;~Ùð?:Ãð?~óg³4ð?ÖöN:_ð?Ë‚«ð?NXÝX4ð? ³(ð?ÙCYšØð?¥qž‰Óð?Àд ð?Ëê%ð?•HzbŸ$ð?Ç ð?#5 ð?ÄÄð?èx&ð?_=Gð?܃ð?Àöóð?b(Ãð?ÇåAð?5€ð?˜/ ð?Ü×ð?~GÌ%ð?ÑŒ¤Eð?4Û6€ð?A=×ëð?Df±ð?I ð?8-î²ð?6dào ð?Ô³ð?òÉ Û"ð?\Ð5Š?ð?ª…›sð?¬˜âÑð?T!|ð?б¨[®ð?’w„Óð?ÊK¥ð?n_½!ið?-œLGð?„KʤÔ/ð?nŸð?ßL ð?ÎÖð?]e*ð?!­Nð?Lõ‘ð?°ð?ÃÓõð?Âú¡ð?M·ºð?”Èu ð?š`ð?“̧*ð?þ—ÛNð?N²‘ð?]ø ð?¡ÃRðð?…áþ’ð?Á2]•ð?MïW ð?MãDð?ŽŒîâ(ð? ­è÷Jð?Ÿ@æ@‰ð?½@ŸÚúð?(¾œÉð?V'Ùœ@ð?Ûä­æð?ý@$Ѫ ð?‡[SM0ð?n©r¬H"ð?Y³³\¨<ð?)ð?S ð?”Èð?¢.ð?›°Uð?{HŸð?o(ð?Dõ%ð?Þ|ýð?ɼhð?EÍÀ ð?—/…ð?¨dV/ð?5ÅWð?º”ª¢ð?÷”S-ð?òZã-ð?w Lð?ǘètð?oÇ ð?s*qð?曑ï.ð?4,Ž€Vð?éÏ>Ÿð? .Ä$ð?»ið?ÙCYšØð? ¦†ð?fP!;Î ð?MoBÃ8ð?)vãÓ)ð?%O²Ö‘Jð?‡¥ð?À>ð?Ôˆð?]k1ð?Q\ð?lY«ð?cü>ð?|¹Qð?­âPð?èµð?Dóïð?‰|Çð?þ¦3ð?<`ð?ób²ð?ªS]Kð?QROgð? ¢vð?H¿Gð?'²§Yð?Ô5usð?~óg³4ð?À¿Rað?q_ãm´ð?nðeMð?‹@hUgð?Q ûmð?>OêŒ%ð?ò9aðð?-œLGð?jn…x1ð?Íèy½Xð?íð?hð?÷ð?eC4ð?Ùrað?뮵ð?i²Rð?_Vwð?ð˜ð?|Úð?qöð?ë}¼ð?Xd7ð?žL*gð?Àð?-¦eð?VÚ´™ð?Ì“ÌÖð?Íߢ ð? 7¾ð?ë ð?GsÚ9ð?Âÿxkð?ù÷ˆÇð?}h:rð?б¨[®ð?ˆLúñöð?”Åhw- ð?^eööëð?ÿ¡¢ð?½zWä§8ð?sôúBfð?Ðað?_¥ð?!4ð?Ï6ð?ìºeð?VÛ½ð?ÁNbð?Ì*•ð?[¸Ñð?ñýð? ÍÆð?jWLð?tŽb:ð?ôçlð?=&Ëð?8ÖËzð?¢WÂð?¾±ñ$ð?. — ð?¡Ýùßð?Åb¥O!ð?ßÓ>ð?ª…›sð?Ù;íE×ð?—é¹°ð?¨ÝŒ\éð?žß'Dið?eûUÚ ð?V·¿Ê—ð?n©r¬H"ð?瑟/Å>ð?¢unÀƒqð?úšð?eð?%ð?å8ð?F±hð?Y„Ãð?Ü mð?SÝ©ð?ÜTùð?BÌI ð?&Xð?ž c ð?TMy<ð?°Jêpð?:ÓÒð?ƒdž‰ð?.ãÞÞð?ôè[ð?~M  ð?†í–¬ð?òÉ Û"ð?É t Að?­s!eyð?têö~âð?‚0'z¦ð?>J7²ð?[­]’»ð?ý@$Ѫ ð?ß¶8Îð?•HzbŸ$ð?P¡€»;Cð?’H€Ùyð?&¸ð? Jð?enð?ÏÙ8ð?5jð?—iÆð?¸ªrð?öv´ð?•¡ ð?n²p ð?e½¢ð?€)ò ð?Ó"Œ=ð?Érúrð?&ËÖð?‰ÉA‘ð?‚l–íð?Kxð?ts×7 ð?Ô³ð?BÅû§#ð?eê{šBð?×ôMg|ð?˜íèVèð?îŒp×±ð?ŠìFÒ)ð?Ûä­æð?%ÝuÆþ ð?ËFøGqð?›úçýÚ%ð?{ª¢—Eð?lñÐÝ@~ð?&¸ð? Jð?enð?ÏÙ8ð?5jð?—iÆð?¸ªrð?öv´ð?•¡ ð?n²p ð?e½¢ð?€)ò ð?Ó"Œ=ð?Érúrð?&ËÖð?‰ÉA‘ð?‚l–íð?Kxð?ts×7 ð?Ô³ð?BÅû§#ð?eê{šBð?×ôMg|ð?˜íèVèð?îŒp×±ð?ŠìFÒ)ð?Ûä­æð?%ÝuÆþ ð?ËFøGqð?›úçýÚ%ð?{ª¢—Eð?lñÐÝ@~ð?úšð?eð?%ð?å8ð?F±hð?Y„Ãð?Ü mð?SÝ©ð?ÜTùð?BÌI ð?&Xð?ž c ð?TMy<ð?°Jêpð?:ÓÒð?ƒdž‰ð?.ãÞÞð?ôè[ð?~M  ð?†í–¬ð?òÉ Û"ð?É t Að?­s!eyð?têö~âð?‚0'z¦ð?>J7²ð?[­]’»ð?ý@$Ѫ ð?ß¶8Îð?•HzbŸ$ð?P¡€»;Cð?’H€Ùyð?Ðað?_¥ð?!4ð?Ï6ð?ìºeð?VÛ½ð?ÁNbð?Ì*•ð?[¸Ñð?ñýð? ÍÆð?jWLð?tŽb:ð?ôçlð?=&Ëð?8ÖËzð?¢WÂð?¾±ñ$ð?. — ð?¡Ýùßð?Åb¥O!ð?ßÓ>ð?ª…›sð?Ù;íE×ð?—é¹°ð?¨ÝŒ\éð?žß'Dið?eûUÚ ð?V·¿Ê—ð?n©r¬H"ð?瑟/Å>ð?¢unÀƒqð?íð?hð?÷ð?eC4ð?Ùrað?뮵ð?i²Rð?_Vwð?ð˜ð?|Úð?qöð?ë}¼ð?Xd7ð?žL*gð?Àð?-¦eð?VÚ´™ð?Ì“ÌÖð?Íߢ ð? 7¾ð?ë ð?GsÚ9ð?Âÿxkð?ù÷ˆÇð?}h:rð?б¨[®ð?ˆLúñöð?”Åhw- ð?^eööëð?ÿ¡¢ð?½zWä§8ð?sôúBfð?‡¥ð?À>ð?Ôˆð?]k1ð?Q\ð?lY«ð?cü>ð?|¹Qð?­âPð?èµð?Dóïð?‰|Çð?þ¦3ð?<`ð?ób²ð?ªS]Kð?QROgð? ¢vð?H¿Gð?'²§Yð?Ô5usð?~óg³4ð?À¿Rað?q_ãm´ð?nðeMð?‹@hUgð?Q ûmð?>OêŒ%ð?ò9aðð?-œLGð?jn…x1ð?Íèy½Xð?)ð?S ð?”Èð?¢.ð?›°Uð?{HŸð?o(ð?Dõ%ð?Þ|ýð?ɼhð?EÍÀ ð?—/…ð?¨dV/ð?5ÅWð?º”ª¢ð?÷”S-ð?òZã-ð?w Lð?ǘètð?oÇ ð?s*qð?曑ï.ð?4,Ž€Vð?éÏ>Ÿð? .Ä$ð?»ið?ÙCYšØð? ¦†ð?fP!;Î ð?MoBÃ8ð?)vãÓ)ð?%O²Ö‘Jð?nŸð?ßL ð?ÎÖð?]e*ð?!­Nð?Lõ‘ð?°ð?ÃÓõð?Âú¡ð?M·ºð?”Èu ð?š`ð?“̧*ð?þ—ÛNð?N²‘ð?]ø ð?¡ÃRðð?…áþ’ð?Á2]•ð?MïW ð?MãDð?ŽŒîâ(ð? ­è÷Jð?Ÿ@æ@‰ð?½@ŸÚúð?(¾œÉð?V'Ùœ@ð?Ûä­æð?ý@$Ѫ ð?‡[SM0ð?n©r¬H"ð?Y³³\¨<ð?Ç ð?#5 ð?ÄÄð?èx&ð?_=Gð?܃ð?Àöóð?b(Ãð?ÇåAð?5€ð?˜/ ð?Ü×ð?~GÌ%ð?ÑŒ¤Eð?4Û6€ð?A=×ëð?Df±ð?I ð?8-î²ð?6dào ð?Ô³ð?òÉ Û"ð?\Ð5Š?ð?ª…›sð?¬˜âÑð?T!|ð?б¨[®ð?’w„Óð?ÊK¥ð?n_½!ið?-œLGð?„KʤÔ/ð?/sð?ª ð?h£ð?Þq"ð? ?ð?.wuð?Þ¾Øð?«²ð?¿›àð?I“Lð?+À ð?î¢îð?€)ò ð?TMy<ð?þ änð?=&Ëð?Ë›sð?\•ø¦ð?Ì“ÌÖð?Nõ®Ðð?;~Ùð?:Ãð?~óg³4ð?ÖöN:_ð?Ë‚«ð?NXÝX4ð? ³(ð?ÙCYšØð?¥qž‰Óð?Àд ð?Ëê%ð?•HzbŸ$ð?òÙð?±óð?}‚ð?enð?å8ð?G3gð?VÛ½ð?Ï]ð??ð?ð˜ð?µ²mð?y·pð?ökAð?þ¦3ð?šßJ^ð?Jfê«ð?ŒÝû8ð?‚®ç8ð?w Lð?¢•Mð?{Öì2 ð?@<½Ìð?öû:Î*ð?WsÅLð?Ÿ@æ@‰ð?`ƒƒôð?îŒp×±ð?1?Z7þð?¡•ûAð?”Åhw- ð?7ºÉåð?-œLGð?éCð?ƒÙð?áoð?Ôˆð?Ú»0ð?ËoYð?¤ð?™v,ð?Dõ%ð?ñ›íð?CÈ,ð?;  ð?³õÙð?J f+ð?þ—ÛNð?w° ð?\ð?æ®AÔð?pC¥Lð?¿T(ðð?—¬-© ð?Ô³ð?Ùcú"ð?Ї <ð?Âÿxkð?Kö¹½ð?nðeMð?šç$ÎFð?þYr³ôð?¥qž‰Óð?­I¯ ð?ß¶8Îð?Q´ð?=Ìð?w ð?ÎÖð?œÏ)ð?yLð?¼‹ð? ÿð?ZÑð?E÷Nð?5€ð?Äî ð?Ï×Òð?^|å#ð?~§ã@ð?¶uð?:ÓÒð?8ÖËzð?\•ø¦ð?ËÙ½ð?5„çsð? +€ð?&hšð?曑ï.ð?êvRð?C,q3ð?½@ŸÚúð?îŒp×±ð?¨ÝŒ\éð?ˆLúñöð??@\gdð?ó¨™ ð?·-ð?¡Ðð?ô  ð?Ìhð?¬h#ð?q‡@ð?.wuð?t’Õð?Ýσð?z<¿ð?ÜTùð?ñýð?±g:ð?â;ð?ì4ð?šßJ^ð? ×Ũð?÷”S-ð?A\…ð?¤³t¸ð?Á2]•ð?|û«› ð?Æ4\cð?BÅû§#ð?ßÓ>ð?Âÿxkð?çf¹ð?Ê„w<ð?»ið?øœ†3‰ð?Ûä­æð?ÜD쪾 ð?ö±ð?êð?±óð? Jð?f›ð?¿5ð?Ùrað?p°ð?cü>ð?†Ì?ð?—  ð?^‚Jð?;  ð?ûÆsð?mdì)ð?JðÂJð?ìù„ð?A=×ëð?0û¡ð?.ãÞÞð?ܹU ð?Nõ®Ðð?'²§Yð?&hšð?¸ç{Ý-ð?­ïÇžNð?Üýé…ð?têö~âð?T!|ð?¢ð Rxð?ÇP¸¨ð?Â(¡ð?7Bð?§ð?îrð?ç€ ð?«rð?È3,ð?tÍOð?2Úð?záð?ZÑð?ÇåAð?Y6Ôð?´ph ð?®rŠð?€)ò ð?tŽb:ð?žL*gð?ò—·µð?‘,ý>ð?òZã-ð?›”ÉËð?Á2]•ð?£ôý\ ð?žã‚ð?Åb¥O!ð?Y„8ð?ÖöN:_ð?éÏ>Ÿð?téâð?îŒp×±ð?—OmsÁð?Q ûmð?ßð?:cð? ð?S ð?ñð?¿æ#ð?q‡@ð?ÅÈsð?p^Ïð?¸ªrð?Ì*•ð?ð˜ð?#)ð?ÞŒsð?—/…ð?Íî,ð?þ—ÛNð?ò¶ê‰ð?2ÀMðð?0û¡ð?ÜþtÐð?Ì“ÌÖð?H¿Gð?fˆAð?@<½Ìð?Óö'ð?eê{šBð?"÷·nð?q_ãm´ð? .Ä$ð?æÒ¹ïÕð?¨ÝŒ\éð?ìQ¸…ë¹=)\Âõ¨Ã=)\ÂõhÐ=¤p= ×cÛ=¤p= ×Ãæ=Âõ(\Òò=Q¸…ëÿ=®Gázn >Âõ(\Ã>®GázÞ >…ëQ¸E+>q= ×£í5>…ëQ¸‰A>¤p= WâK>Âõ( V>Âõ(\¯Ma>Âõ(œþj>4333ét>\Âõ8€>4333û‰ˆ>¹…ë9“’> â›> …ëQ0¿¤>ìQ¸W–®>†ëQ¸„T¶>Âõ(7#À>Ç>Ãõ(\öQÐ>š™™YßÐÖ>(\Bbƒß>Âõhb}å>Ö£p]oÿè>ö(\ÂuÂ=Ãõ(\ÂË=¤p= ×c×=®Gáz”ã=)\ÂõXð=ö(\Â5û=)\Âõˆ>43333—>¸…ëQˆ>†ëQ¸õ(>Ház®L4>âz®Gm@>[Âõ(qJ>)\Âu)U>3333óÕ`>®GázŸj>4333ét>…ëQ¸ÎO€>®Gá*D‰>Ház®k“>q= ×Sž>£p= ße¦>…ëQ¸;ʰ>\Âõ$ñ¸>¤p= 'YÂ>ÍÌÌLJ¹Ê>š™™Y’AÓ>< ×c°qÛ>®G²Tã>Ø£p]-çê>ÍÌÌ ö{ò> …둱–ý>®Gáz”É={®GázÓ={®Gázà=Ház®Çë=Ãõ(\R÷=q= ×£€>¸…ëQ@>ìQ¸…÷>{®GáF&>)\ÂõQ2> ×£p=ý=>Âõ(\lH>Âõ(\ÏÈS>ÌÌÌÌÌà_>3333“ˆi>ö(\ÂSt>\Âõ8€>®Gá*D‰>Âõ(¶“>p= ×φž>Âõ(\t§>= ף߱>®Gá»>Ö£p½$6Ä>¹…ë~øÍ>{®¥ÿÕ> ×£0gôß>€Ìóæ>]ÂE Kð>z®Ûö>GázÔï§ÿ>hl÷?)\ÂõèÑ=¤p= ×#Û=p= ×£ç=¸…ëQˆó=…ëQ¸~>ö(\½ >z®Gá>>®Gázf#>= ×£p0>\Âõ(®:>¤p= WùE>ìQ¸…R>Âõ(\_]>ìQ¸EÒg>ÍÌÌÌ 6s>`Í~>4333û‰ˆ>Ház®k“>p= ×φž>·…ëѧ>¹…ëZp²>5333ÐQ¼> ×£päÅ>ázîEÐ>š™™ RØ>2333-ÿá>HázT![ê>®Gá )ó>z®'Sû>> ×3RR?\ÂÝú ?®GÙ< ?ìQ¸…kØ=\Âõ(¼â=q= ×£ð=¤p= ×Cû=š™™™™!>…ëQ¸‘>ÍÌÌÌÌ| > ×£p=®+>¸…ëQ$7>DC>†ëQ¸ïO>ÿÿÿÿWZ>®GáŸe>¸…ë‘§q>= ×£0¬|> ×£p&‡>¹…ë9“’>q= ×Sž>Âõ(\t§>¹…ëZp²>gfff&Ƽ>‘Âõ(±EÆ>®Gáú?Ñ>Ø£p=LÚ>­GáZΙã>= ×£j@í>…ëQÈ¢™õ>ÎÌÌ<óŒÿ>ÂõXÄÆ?q= >?ö(\Ÿ²Þ?…ëQôkZ? ×£p=Êà=Ház®§é=ö(\Âö=âz®GÙ>®Gáz>\>™™™™™/'>Âõ(\“3>w@>•K>q= ×ãW>¸…ëc>ëQ¸%o>> ×£°ñy>Âõ(ì6…>4333ë?‘> â›>£p= ße¦>= ף߱>5333ÐQ¼>‘Âõ(±EÆ>ìQ¸žaÑ>ÍÌÌÌæÚ>·…kR¢ä>¹…‹b]ï>…ëQùš÷>333«•?ÌÌÌ,4è ?¥p=RøÝ?)\ú‘%?Ø£pC¯G#?gff)û0?Âõ(\æ=×£p= gñ= ×£p= þ=¸…ëQØ >¤p= ×+>ìQ¸…õ"> ×£p=(0>Âõ(\q;>ÍÌÌÌÌ7G>gfff&‘S>Âõ(\ïk`>R¸…‹qk>hffffÓv>€ä‚>\Âõ>…ëQ¸êz™> …ëQ0¿¤>…ëQ¸;ʰ>®Gá»> ×£päÅ>®Gáú?Ñ>ÍÌÌÌæÚ>ìQ¸^°ýä>= ×Ó=ð> ×£Ÿæø>¹…‹ùç? ×£¸”j ? ×£˜Ü?*\v` ?¤p=˜†Š&?? ×éÑ'0? ×£f Ê>?ìQ¸…kî=)\Âõh÷=¤p= ×K>fffffŽ>¤p= ×G>gffff*>Ház®O6>= ×£pC> ×£pý7P>Âõ(Ü€[>š™™™9:g>ìQ¸µˆs>Âõ(ìZ€>{®GIB‹>š™™™yš–>R¸…¥¢>ìQ¸W–®>\Âõ$ñ¸>Ö£p½$6Ä>ázîEÐ>Ø£p=LÚ>·…kR¢ä>= ×Ó=ð>·…+YYù>®GÁN›?Ö£pµë ?Ø£pÙñÈ?¹…ëˆ!?ÍÌÌ– ])?©˜–2?o= ¨ïå:?)\S1=?š™™™™ô=­Gáz.ÿ=¯Gáz. >®Gáz >33333{$>fffff´1>¤p= ׃>>)\Âu6J>z®GápV>š™™™™$c>…ëQ˜Dp>…ëQè‰{>\ÂõÐ5‡>…ëQhy“>\ÂõC > ×£p‹«>†ëQ¸„T¶>¤p= 'YÂ>¹…ë~øÍ>š™™ RØ>­GáZΙã>¹…‹b]ï> ×£Ÿæø>®GÁN›?„ëQH,›?IázPtª?ÿÿÿ§5"?®G)èr+?×£pY'4? …ë.n>?ÍÌÌäâ;F?gf&ͶP?Âõ(\ú=\Âõ(”>= ×£p>R¸…ë}>Âõ(\p+>š™™™™Ø7>p= ×£©D>{®G¡ÙQ>¸…ëѽ^>®Gáºaj>v>Âõ(d7ƒ>…ëQ”M>¯GázP‹›>†ëQ¸Š)§>p= × b³>Âõ(7#À>ÍÌÌLJ¹Ê>{®¥ÿÕ>2333-ÿá>= ×£j@í>…ëQùš÷>¹…‹ùç?Ö£pµë ?IázPtª?¤p=>y"? ×£ åŽ,?¸…Ó‹Ø5?{®g³†@?¤p½üPµH?(\„à> ×£på >×£p= «>áz®GÇ$>Ház®22>¸…ëQË?>)\Âõ²K>…ëQøX>×d> ×£p­ýq>…ëQ¸õ~>š™™™Á‰Š>4333Ÿ©–>¤p= 3F£>{®GKR°>{®Gƃ»>Ç>š™™Y’AÓ> ×£0gôß>HázT![ê>…ëQÈ¢™õ>333«•? ×£¸”j ?Ø£pÙñÈ?ÿÿÿ§5"? ×£ åŽ,?ìQ¸$K6?? ×YË9A?€\ŽTJ?¸ÅW‰ãS?×£°´Ù«]?ÍÌlgFÖe?¤p= ×K>Ãõ(\f>Ä>¸…ëQ$+>…ëQ¸ã7>R¸…ëùD>@_R>¹…ë1 `>€ôk>€Fx>¸…ë1…>R¸…S ’>ÍÌÌÌè(Ÿ>Ö£p=è­ª>×£p=Ù¿¶>{®ÇEPÃ>Ãõ(\öQÐ>< ×c°qÛ>€Ìóæ>®Gá )ó>ÎÌÌ<óŒÿ>ÌÌÌ,4è ? ×£˜Ü?¹…ëˆ!?®G)èr+?¸…Ó‹Ø5?? ×YË9A?š™™:AåJ?®ìÇÅT?ãzÔô¸_?efæ‡ ëg?p=ê‹ Ìq?h >†ëQ¸I>q= ×£Ê#>š™™™™Š1>ö(\Â?>ö(\BbK>z®GáX>Ãõ(\/,e>R¸…[‹r>= ×£P2€>43335Œ>= ×£Ì{˜>¯Gázì-¥>ÍÌÌÌ6A²>¨X¿>¹…ëaÍÊ>š™™YßÐÖ>®G²Tã>]ÂE Kð>z®'Sû>ÂõXÄÆ?¥p=RøÝ?*\v` ?ÍÌÌ– ])?×£pY'4?{®g³†@?€\ŽTJ?®ìÇÅT?…ëZ–7`?·…¢a i?­GqFzs?†ëÁÃ=¼|?š™™™™ù>= ×£p=>âz®G1)>™™™™™n6> ×£p=ïC>)\µ­Q>¤p= —I_>Ø£p=*Ÿk>®GáJSx>ö(\º]…>R¸…ç¶’> ×£p×W >Âõ(6t¬> ×£pޝ¸> ×£ðÎVÅ>|®Çî_Ò>(\Bbƒß>Ø£p]-çê>z®Ûö>> ×3RR?q= >?)\ú‘%?¤p=˜†Š&?©˜–2? …ë.n>?¤p½üPµH?¸ÅW‰ãS?ãzÔô¸_?·…¢a i?\bë‹s?›™).ä&~?GájŠñô†?Ãõ(\r>\Âõ(´!>Âõ(\¸/>…ëQ¸^<>TI>ÍÌÌÌÌ‘V>)\Âd>> ×£pÏq>R¸…{‰>ÌÌÌ̜ڋ>š™™™•‰˜>HázfŽ¥>> ×£«á²>R¸…•|À>533³³±Ì>Áõ(\WáØ>Âõhb}å>ÍÌÌ ö{ò>GázÔï§ÿ>\ÂÝú ?ö(\Ÿ²Þ?Ø£pC¯G#?? ×éÑ'0?o= ¨ïå:?ÍÌÌäâ;F?(\„àGáz®ó%>Ház®¿3>…ëQ¸½A>…ëQ¸žÐO>ffff&{\>¤p= si>âz®7²v> ×£pÍ2„>3333‡ï‘>HázöÆŸ>õ(\:¬>Âõ(x¾¸>áz®ê½Å>×£p=g Ó>…ëQ8M à>…ë1úìì>433³œù>R¸Í ¡?âz" ”?fffêÎÄ?ÏÌÌ@+?®GçKØ6?®GÏÏ2C?gf&ͶP? ×ã}ÉZ?ÍÌlgFÖe?p=ê‹ Ìq?†ëÁÃ=¼|?GájŠñô†?…[!’?hfæ|.Gœ? ×£p=ú >q= ×£ê*>Ház®O8>×£p=ŠíE>]Âõ¨¿S>¹…ëÂa>< ×£âo>†ëQ¸’|>> ף؉>¯GázHÏ–>¯GázêP¤>…ëQ¢ ²>ö(\¶À>{®GŒKÌ>áz®ŒñØ>effFðëå>(\BÉ3ó>> ×c®Â?R¸Åa% ?Âõ¦<?®G©þÀ%?™™™ß©2?®Guå×??€µyK?q= gºÅV?HáÚšµc?= W<ê®o?ìQølÔz?Âõ@V·Q…?®¬;‘?ff »Œ›?®%8µ¾¥?fffff†$>áz®GP0>¯Gáz•=>×£p=ŠÉJ>×£p=Š9X>`àe>q= ×ã¹s>ëQ¸=Â>3333«ë>¼¢œ>= ×£„£©>Âõ(Tè¶>Ház”ãkÄ>]Â5P)Ò>= ×cà>®Gøì>[ÂuR"ù>¤p=Z?®GáÂeZ?âzÒKã ?Ãõ( ÿY-?ÍÌÌ@id9?33³;ÜE?¥p=Bª·R? ×#•ÍÝ_?‘Âu¢¨ój?×£ r2¢v?…Ë®³Û‚?ö(d~·&?¤Ä]z™?âz42ð›¤?ÿÿÞo~v°?õ(\‰(>®Gáz‹3>> ×£ðÈA>)\Âu*P> ×£p}Z]>âz®Çj>…ëQ(x>¸…ëaË…>ÍÌÌÌ€­“>Ãõ(\Û¼¡>¸…ëì¯>ìQ¸Ù«¼>¸…ë"³É>¤p=Š‹üÖ> ×£ƒä>÷(\ÿBò>ÍÌÌì5?›™™áº° ?S¸)P?ö(\ƒ‰A&?…ëù ~3?ázÒ~A?[B*T‰M?gfæ†Y?š™y?Þïe?Há*nϽr? ׃ðmÏ?ÃõhQËËŠ?ÔPb–?R¸Jâ|…¢?Âõ¼GKQ®?¤pާé¸?áz®G÷,>ìQ¸…#7>Gáz® E>…ëQ¸ÞES>3333a>(\Â5ùo>\Âõø}>ìQ¸½eŠ>)\Â1ð—>‘Âõ(T­¥>®Gái™³>ÍÌÌLþ°Á>‘Âõ¨·áÏ>Ãõ(ܬÜ>q= w‚»é>…ëaí ÷>âz¶‘•?®G%W?…ë‡;K ? ×£¶ÅÜ,?¸… ÷y9?…ë2ˆgF?hf&amŸS?R¸>‡a?HẠ>°m?£p8 y?33û5÷…?)\óy´’?? cÉ™Ÿ?š™“d›qª?q=¨'œãµ?…ë(¯áÁ?Âõ(\ê0>33333;>Ãõ(\ÊH>{®Gá°V>Âõ(\ï¿d>…ëQèôr>ÍÌÌÌM>·…ë‹>¹…뉹œ>¯GázÀª>q= ׺·>4333Ë„Å>q= WZ|Ó>Q¸e…á>q= ×Êï>®GÑ©¡ü>]Â-&» ?ÂõL2?£p=ÒT¢$?ëQ¸&gg2? ×£N]@?q=ŠÞsM?Ãõ¨Þ(žY?¤p}-ˆf?™™¹0^ºs?¥pµò°/?ëQ¸ˆßÅ?×£T`’ž™?ö(dÖLà¥?ëQ¼(I‚²?¥p\õVø¾?›óL?ŒÉ? ×£p=|3>¸…ëQD?>¹…ëQºL>ÍÌÌÌL`Z>¤p= ×2h>q= ×Ã.v>Âõ($Q„>GázB—’>®Gáþ >gfffl ¯>ffffO¼>š™™ÉÉÉ>> ×#üu×> ×£På>¤p=šÇTó>Âõè?(\ +¤?áz&wŠ?{®7"°)?8¥7?†ëÑ7˧D?{qR?…kižj`?…ë\}m?„ë ²¸y?Âý€Ï†?33OØÈ“?ffX[ã1¡?„ëqn¦«­?¹°Yü\¹?BÈû,mÅ?á:ÇnÒÑ? ×£p=66> ×£p=ÖA>gfff&oP>¤p= ×C^> Ùk>…ëQ8œy>…ëQˆˆ‡>×£p=ž›•>÷(\ÄÒ£>r+²>]ÂõK£À>Ø£p=BpÎ>gffæÎÏÛ> ×£0raé>> ×c¤!÷>] ?÷(\{Î ?fffðáY!?ö(\×fk/?®Gð›c ×§Ï—I?…ëQõ¼W?ÍÌŒ½d£d?š™ %sr?š™Ù) o€?Âݶ (?¤p±O5½™?[ž‹Ù–¦?Âyž®³?™™K=žûÀ?£ðQ.ðÌ?{”ácZ7Ø?¸…ëQô8>{®GaD>ìQ¸ÅR>)\Âõ"a>ìQ¸ o>P*}>)\ÂmáŠ>®GáB˜>Áõ(\ëɦ>áz®µõ´>¸…ëCÃ>Q¸…ͯÑ>¹…«–9à>233Óã¼í>Ãõ(L÷8û>ÿÿÿÿâã?ëQ¸2`º?õ(\½a¹$?ŽÂõ¹Þ2?®Ç@Ã%A?×£pÝO?ÍÌŒò(\?efF™ïmi?{Î#Ñæv?33+­„?Ø£@(1d’?®G;¯©` ?33»vh­?? Ç2I¹?®hÝw0Æ?z¯75 Ó?ÕcJ‘3úß?p= ×£½;>ö(\ÂYF>{®G!±T>¹…ë&c> ×£p¶q>áz®¯`€>ŽÂõ(lEŽ>]Âõüõ›>áz®ÿÏ©>¸…ëšÐ·>Ház&õÅ>Ãõ(Ü&;Ô>ÍÌÌÌM â>âz®s"ñ>…ëQ-ÿ> ×£`¯ë ? ×£ð†?eff®M(?ÍÌÌ­Þ<6? ×#ªQD? ×£Èd‰R?®çjŠá`?Âõ†j¯n?23C(Ó{?…Cº)‰?®Ïo®–?\$óD\¤?Háp{š-²?ºgÐÀ?¸À“Í=Ì?ÿ¿CžZØ?­gc=Ñé?p= ×£b>>> ×£ð‰H>®GázÃV>Âõ(\/e>Áõ(\ÿ‘s>®Gáê"‚>3333Í>ãz®«Ÿ>™™™™ͬ>…ëQ¸>¥º>áz®‘£È>|®ÇaÅÖ>…ë‘@å>®Gáªéió>p= _?è?433'H?ëQ¸îWf?333Ycø+?]ÂÊxµ9?Ãõ¨W‘šG?ëQ8fÒ¤U?¯G!œ…Ñc?43C"r?†ë™ˆÙ‡€?¤pup“Ž? ×3(Q›?·mÌ$³¨?®BÌø6¶?…’éÓÃ?ö¨‚6U{Ñ?‘BÐ/g@Þ?)lKÙâgñ?33333u@> ×£p=—J>âz®ÇµX>¤p= ÷ôf>)\Â¥Ru>Âõ(\¿Ìƒ>Âõ(\[a’>*\­¡>ÍÌÌ̦¯>> ×£ÄY½>†ëQ¸€5Ë>ŽÂõ(‘6Ù>¯GáZlZç>|®Ç³žõ>®Gá1? ×£,Ó?ÍÌÌ|«!?|®1Ö“/?Ø£p¨¿#=?{®èáÝJ?Ø£ðs6¿X?IáÚ^×Äf?*\O½ðët?®§«1ƒ?áz܉ “‘?0F¼  ?= ¡­’5­?= ‡›Ipº?q=ùg ¼Ç?H¡c»ÕÕ?ì­C¡8â?YC6õ?ìQ¸…‘A>4333³oL>q= ×£vZ>q= ×£Ÿh> ×£pMèv>…ëQˆN…>×£p=ZГ>> ×£æk¢>®Gás±>÷(\ÈÒ¿>­GáúkÍ>š™™™uÛ> è}é>õ(\«¨÷>ö(\ÿò?¤p=ò¾Z?p= éÝ"?®Gœz1?…ëQƒ/@?ÍÌÌÊHóM?Ø£ðrp±[?ÍÌì•i?Ø£@¸–œw?®qÃ…?> k„½”?’–‘b¢?™™oÒ°?p=[‰¾?+X¤Ë?ÍÌÑz ŒØ?€F¹Eå? ×$[Ö÷?{®Ga‰B>®GáúN>€õ[>×£p= j> ×£pMCx>¹…뙆>T¸…S •>…ëQ(˜£>‘Âõ(Ë=²>…ëÑ’úÀ>Âõ(æ™Ï>*\ÂòfÝ>Áõ(¼—Yë>£p=zNoù>…ëQÀº¥?[Âq§ú?Ház|l$?õ(\«Þ÷2? ×#fœA?®÷ßWP?)\ÏñKQ^? ×Ãù:l?Ãõ1Wz?×£x‹Dˆ?¤pQD@–?> × Ñƒ¤?{Ù¹Ú²?)Üpœ:Á?S8ŒtN3Ï?Ãu›8ÇËÛ?¯'†Nòè?Ha¾E&©û?ìQ¸…GC>ö(\Â>O>ö(\B#]>âz®§+k> ×£p}Uy>Âõ(\—ž‡>> ףܖ>ö(\^†¤>ÎÌÌÌL!³> ×£pöÓÁ>333óÆœÐ>‘Âõ¨ˆôÞ>ìQ¸ÞÖì>…ëÁ°Ûú>R¸]á ?Q¸¡kI?š™™3­%?R¸«<,4?)\£ªÄB?ffæ:¸tQ?> W?³:`?®§ðå)n?Ö£à”|?+\Gßþ‰?ÃõXг˜?ÍÌ%I¦?Gá²»ñ‹´?)Ü[§®ÖÂ?®e‡™Ñ?Í M¼j„Þ?o]"d`ê?\ߊ$}†ý?Ház.ÎC>)\µ P>ÎÌÌÌÌó]>{®Gòk>…ëQ¸>z>q= ×»Sˆ>R¸…ß±–>*\±+¥>]¿³>›™™™*kÂ>„ëQ8€-Ñ>Q¸%ßà>{®çÂßí> ×£€qÚû>˜™™ÉX÷ ?|®Ó/4?fff¸ÒŽ&?ö(\+?5?†ëQ•C?¤p}¿ú=R?š™YÑÃü`?HáZçr o?33Ó¬Bm}?õ(Üq>\‹?®cÓi™?HáØQGާ?…sçHĵ?> ÿÿÃ?„«…ާ0Ò?áúĈX=à?®g°iæì?T8ÐBìÆÿ?×£p= D>¹…ë‘DP>ö(\B^^>ìQ¸%Xl>ëQ¸Etz>Ø£p=j°ˆ>ÎÌÌÌp —>ìQ¸a€¥>…ëQa´>£p= ¸¸Â>\ÂuÈwÑ>…ëLà>®GaShî>S¸eƒ]ü>Q¸ÅŠÒj‰ÂÒ?⺇üëÀà?Øc«I{äì?3ƒŒþÀ4@×£p= D>¹…ë‘DP>ö(\B^^>ìQ¸%Xl>ëQ¸Etz>Ø£p=j°ˆ>ÎÌÌÌp —>ìQ¸a€¥>…ëQa´>£p= ¸¸Â>\ÂuÈwÑ>…ëLà>®GaShî>S¸eƒ]ü>Q¸ÅŠÒj‰ÂÒ?⺇üëÀà?Øc«I{äì?3ƒŒþÀ4@Ház.ÎC>)\µ P>ÎÌÌÌÌó]>{®Gòk>…ëQ¸>z>q= ×»Sˆ>R¸…ß±–>*\±+¥>]¿³>›™™™*kÂ>„ëQ8€-Ñ>Q¸%ßà>{®çÂßí> ×£€qÚû>˜™™ÉX÷ ?|®Ó/4?fff¸ÒŽ&?ö(\+?5?†ëQ•C?¤p}¿ú=R?š™YÑÃü`?HáZçr o?33Ó¬Bm}?õ(Üq>\‹?®cÓi™?HáØQGާ?…sçHĵ?> ÿÿÃ?„«…ާ0Ò?áúĈX=à?®g°iæì?T8ÐBìÆÿ?ìQ¸…GC>ö(\Â>O>ö(\B#]>âz®§+k> ×£p}Uy>Âõ(\—ž‡>> ףܖ>ö(\^†¤>ÎÌÌÌL!³> ×£pöÓÁ>333óÆœÐ>‘Âõ¨ˆôÞ>ìQ¸ÞÖì>…ëÁ°Ûú>R¸]á ?Q¸¡kI?š™™3­%?R¸«<,4?)\£ªÄB?ffæ:¸tQ?> W?³:`?®§ðå)n?Ö£à”|?+\Gßþ‰?ÃõXг˜?ÍÌ%I¦?Gá²»ñ‹´?)Ü[§®ÖÂ?®e‡™Ñ?Í M¼j„Þ?o]"d`ê?\ߊ$}†ý?{®Ga‰B>®GáúN>€õ[>×£p= j> ×£pMCx>¹…뙆>T¸…S •>…ëQ(˜£>‘Âõ(Ë=²>…ëÑ’úÀ>Âõ(æ™Ï>*\ÂòfÝ>Áõ(¼—Yë>£p=zNoù>…ëQÀº¥?[Âq§ú?Ház|l$?õ(\«Þ÷2? ×#fœA?®÷ßWP?)\ÏñKQ^? ×Ãù:l?Ãõ1Wz?×£x‹Dˆ?¤pQD@–?> × Ñƒ¤?{Ù¹Ú²?)Üpœ:Á?S8ŒtN3Ï?Ãu›8ÇËÛ?¯'†Nòè?Ha¾E&©û?ìQ¸…‘A>4333³oL>q= ×£vZ>q= ×£Ÿh> ×£pMèv>…ëQˆN…>×£p=ZГ>> ×£æk¢>®Gás±>÷(\ÈÒ¿>­GáúkÍ>š™™™uÛ> è}é>õ(\«¨÷>ö(\ÿò?¤p=ò¾Z?p= éÝ"?®Gœz1?…ëQƒ/@?ÍÌÌÊHóM?Ø£ðrp±[?ÍÌì•i?Ø£@¸–œw?®qÃ…?> k„½”?’–‘b¢?™™oÒ°?p=[‰¾?+X¤Ë?ÍÌÑz ŒØ?€F¹Eå? ×$[Ö÷?33333u@> ×£p=—J>âz®ÇµX>¤p= ÷ôf>)\Â¥Ru>Âõ(\¿Ìƒ>Âõ(\[a’>*\­¡>ÍÌÌ̦¯>> ×£ÄY½>†ëQ¸€5Ë>ŽÂõ(‘6Ù>¯GáZlZç>|®Ç³žõ>®Gá1? ×£,Ó?ÍÌÌ|«!?|®1Ö“/?Ø£p¨¿#=?{®èáÝJ?Ø£ðs6¿X?IáÚ^×Äf?*\O½ðët?®§«1ƒ?áz܉ “‘?0F¼  ?= ¡­’5­?= ‡›Ipº?q=ùg ¼Ç?H¡c»ÕÕ?ì­C¡8â?YC6õ?p= ×£b>>> ×£ð‰H>®GázÃV>Âõ(\/e>Áõ(\ÿ‘s>®Gáê"‚>3333Í>ãz®«Ÿ>™™™™ͬ>…ëQ¸>¥º>áz®‘£È>|®ÇaÅÖ>…ë‘@å>®Gáªéió>p= _?è?433'H?ëQ¸îWf?333Ycø+?]ÂÊxµ9?Ãõ¨W‘šG?ëQ8fÒ¤U?¯G!œ…Ñc?43C"r?†ë™ˆÙ‡€?¤pup“Ž? ×3(Q›?·mÌ$³¨?®BÌø6¶?…’éÓÃ?ö¨‚6U{Ñ?‘BÐ/g@Þ?¤ |*âð?p= ×£½;>ö(\ÂYF>{®G!±T>¹…ë&c> ×£p¶q>áz®¯`€>ŽÂõ(lEŽ>]Âõüõ›>áz®ÿÏ©>¸…ëšÐ·>Ház&õÅ>Ãõ(Ü&;Ô>ÍÌÌÌM â>âz®s"ñ>…ëQ-ÿ> ×£`¯ë ? ×£ð†?eff®M(?ÍÌÌ­Þ<6? ×#ªQD? ×£Èd‰R?®çjŠá`?Âõ†j¯n?23C(Ó{?…Cº)‰?®Ïo®–?\$óD\¤?Háp{š-²?ºgÐÀ?¸À“Í=Ì?ÿ¿CžZØ?R¸¤DùŽë?¸…ëQô8>{®GaD>ìQ¸ÅR>)\Âõ"a>ìQ¸ o>P*}>)\ÂmáŠ>®GáB˜>Áõ(\ëɦ>áz®µõ´>¸…ëCÃ>Q¸…ͯÑ>¹…«–9à>233Óã¼í>Ãõ(L÷8û>ÿÿÿÿâã?ëQ¸2`º?õ(\½a¹$?ŽÂõ¹Þ2?®Ç@Ã%A?×£pÝO?ÍÌŒò(\?efF™ïmi?{Î#Ñæv?33+­„?Ø£@(1d’?®G;¯©` ?33»vh­?? Ç2I¹?®hÝw0Æ?z¯75 Ó?®Çï+±ôä? ×£p=66> ×£p=ÖA>gfff&oP>¤p= ×C^> Ùk>…ëQ8œy>…ëQˆˆ‡>×£p=ž›•>÷(\ÄÒ£>r+²>]ÂõK£À>Ø£p=BpÎ>gffæÎÏÛ> ×£0raé>> ×c¤!÷>] ?÷(\{Î ?fffðáY!?ö(\×fk/?®Gð›c ×§Ï—I?…ëQõ¼W?ÍÌŒ½d£d?š™ %sr?š™Ù) o€?Âݶ (?¤p±O5½™?[ž‹Ù–¦?Âyž®³?™™K=žûÀ?£ðQ.ðÌ?3ó³á‚Cß? ×£p=|3>¸…ëQD?>¹…ëQºL>ÍÌÌÌL`Z>¤p= ×2h>q= ×Ã.v>Âõ($Q„>GázB—’>®Gáþ >gfffl ¯>ffffO¼>š™™ÉÉÉ>> ×#üu×> ×£På>¤p=šÇTó>Âõè?(\ +¤?áz&wŠ?{®7"°)?8¥7?†ëÑ7˧D?{qR?…kižj`?…ë\}m?„ë ²¸y?Âý€Ï†?33OØÈ“?ffX[ã1¡?„ëqn¦«­?¹°Yü\¹?BÈû,mÅ?)œ´â5×?Âõ(\ê0>33333;>Ãõ(\ÊH>{®Gá°V>Âõ(\ï¿d>…ëQèôr>ÍÌÌÌM>·…ë‹>¹…뉹œ>¯GázÀª>q= ׺·>4333Ë„Å>q= WZ|Ó>Q¸e…á>q= ×Êï>®GÑ©¡ü>]Â-&» ?ÂõL2?£p=ÒT¢$?ëQ¸&gg2? ×£N]@?q=ŠÞsM?Ãõ¨Þ(žY?¤p}-ˆf?™™¹0^ºs?¥pµò°/?ëQ¸ˆßÅ?×£T`’ž™?ö(dÖLà¥?ëQ¼(I‚²?¥p\õVø¾? WÞHLÏ?áz®G÷,>ìQ¸…#7>Gáz® E>…ëQ¸ÞES>3333a>(\Â5ùo>\Âõø}>ìQ¸½eŠ>)\Â1ð—>‘Âõ(T­¥>®Gái™³>ÍÌÌLþ°Á>‘Âõ¨·áÏ>Ãõ(ܬÜ>q= w‚»é>…ëaí ÷>âz¶‘•?®G%W?…ë‡;K ? ×£¶ÅÜ,?¸… ÷y9?…ë2ˆgF?hf&amŸS?R¸>‡a?HẠ>°m?£p8 y?33û5÷…?)\óy´’?? cÉ™Ÿ?š™“d›qª?q=¨'œãµ? ×N­ºÌÆ?õ(\‰(>®Gáz‹3>> ×£ðÈA>)\Âu*P> ×£p}Z]>âz®Çj>…ëQ(x>¸…ëaË…>ÍÌÌÌ€­“>Ãõ(\Û¼¡>¸…ëì¯>ìQ¸Ù«¼>¸…ë"³É>¤p=Š‹üÖ> ×£ƒä>÷(\ÿBò>ÍÌÌì5?›™™áº° ?S¸)P?ö(\ƒ‰A&?…ëù ~3?ázÒ~A?[B*T‰M?gfæ†Y?š™y?Þïe?Há*nϽr? ׃ðmÏ?ÃõhQËËŠ?ÔPb–?R¸Jâ|…¢?Âõ¼GKQ®?…무_¼?fffff†$>áz®GP0>¯Gáz•=>×£p=ŠÉJ>×£p=Š9X>`àe>q= ×ã¹s>ëQ¸=Â>3333«ë>¼¢œ>= ×£„£©>Âõ(Tè¶>Ház”ãkÄ>]Â5P)Ò>= ×cà>®Gøì>[ÂuR"ù>¤p=Z?®GáÂeZ?âzÒKã ?Ãõ( ÿY-?ÍÌÌ@id9?33³;ÜE?¥p=Bª·R? ×#•ÍÝ_?‘Âu¢¨ój?×£ r2¢v?…Ë®³Û‚?ö(d~·&?¤Ä]z™?âz42ð›¤?ÁõßA7º´?®GázH>áz®G3->…ëQ¸=6>®GázÈG>)\µ*R>…ëQØAc>ŽÂõ(|m>ÍÌÌÌœú~>ö(\Ò͇>]Âõ(»˜>ö(\z£>R¸…,“³>¹…ëXC¾>¸…ëf¯Î>¸…+ÂÉ×>ö(\ïóÇç>™™™©+|ò>×£p-1?ÎÌÌô£X ?ázÆÕi?†ëQÐ)e%?·…¿J4?(\ô³??53³­kM?{®6~ùV?`çtÎd?¸U€t6p?+\ÉÚ‘|?33ƒoÊ'†?ÈVì’?,ÅÛ?{ü鄪?n5×>‚‡3ç*>Em[§5>Aÿ‹á8ÇA>ïæÓ ]M>ùïw4wPX>ÇF°€ýc>/m„ó`p> øa²z>–0nA­…>VÉž·~‘>±;ÙVÀœ> Ç/f\r¦>o·Y8Õ±>ÌögÜp$¼>juLèÆ>5#þf$3Ñ>½¯K1q Ú>’Sàrrä>RöŠÃy/ï>ùè Ø“÷>BÔ"áa°?Ü;lcôK ?»0Ùb?ªNE«K?žPùÏy$?ÉuË¥X-?êÇãv-à4?7n×…=?l˃÷ÖD?IÍ¿·ÂXM?¥wEU¾[?‡ÕÞÆdl$>õ‘H.,3>"}äÉ—>>ZuÝ¿bI>Ü4(U>;<_§‚‹a>–=d[m>†#¶íw>6-èÁò¢ƒ>ìØt8è>äŸ # š>c´y4 ¥>P²`(bë°>z”¯¦ »>øœo)»}Å>B÷Ð>³¾²ÿ¦ Ú>Р 6½ä>ˆ;ãçÒ ð>úðË-r£ø>JÓL²`Æ?§ä—áU\ ?ÿ‰~@?‰úüŠ?ÛÚc6'?Ÿ‹Çh6ê0?Sä×ys8?² þÖˆA?x¶z±I?5ÓDamúQ?t íÜ©Z?ŒöØÙ,Y?AJHá=->¢ñ¶7³ñ:>Gº´øû”E>ù×®*÷R>ÝtÆûú!^>v Õž@.i>uz×ððt>÷mœ[>ø£º^r¢Œ>±ù}4]†—>ž”‘èÏ8£>[øYÉëF¯>fpp€ƒK¹>(Ò¦e¶[Ä>YähGÐ>O‰rÌäÙ> ̧μrä>[Ýîó ð>*—Ÿÿâù>ÙO)‰ X?ÒÒ{® ?ã䊨B™?þ bú !?Œzx¾„)?Â1 žÅé2?ï­bÌ;?]ÍzÛ>D?yx^ŸÕKM?þiÇ·áU?b¡àütj^?Èñìe?NJÊÅB”t?ÃiA;ª´3>äÒ1Þq³B>dp=Hš9N>ü/¯UYY>]ÿ½Pe>K¬ï çq>”Gq=¨÷}>¼Fzöˆ>pÕdzÒ¹”>{6Kbµ¡>\‚èD+¬>ùÈEV ·>rèA³¹ÅÂ>óáúeÎ>U±b„¯|Ø>ªn¡y˜ã>Ù{9æ,0ï> êO½£ø>ãhA +X?[Ý}ëG"?åhHyN?ŒÁÈÏÞ!?Ó™ó1+?‰š€Ò²~4?ºd¬5£>?Ò°£g¯F?ך¨«P?Kn ûôTX?¿WDn‰½a?OéâÏj?I`=š.Ós?ƒ7Þw51s?É>‰sí³;>’—=z{ÛI>ˆ¼sþT>´öóÆ ©a>m†­£4êm>C˜1 @y>ËïB‡Ü>…>ÑDº›hБ>†+ÆF¼>Ѥ+º¨>L@`Èt´>•­(dzÚÀ>Íõu;ÕË>ù÷ òÙ…Ö>¯ã»yLAâ>ýF&Öpí>y9‰"N”÷>R¬Æ?Ì“ÝÙ.® ?á濾N?g|'"?L›NG;,?òÌ@ă5?åíË^QZ@?Rp È H?„Óm‰dR?|ÀW,Ñ<[?m‘{À‘d?t¡d©„m?Ë A· æu?ûkú:t€?h—-‡ŸåŽ?9ú•³yB>¦6c)¶Q>\l‘$ß\>{16uh> `Áî1Ìt>r³kÓe§>½yŒÕ¤ã><ËŸŽb0™>?)¥>YJ±±>Ç^ý¼gy½>²»‡A8lÈ>;Z73g'Ô>°YÑ ‰à>y«ÿý¶ë>,”!øQêõ>ßú‘©°?üeq\\ ?·}»B<™?&K•F£Þ!?øgG² ,?`Ü·Ü5?5vúå@?ó¼úpâI?FH”×B©S?Œ¾ò}~–]?a¶?Çþf?4›üŠep?=SNÛ‡cx?¦w¦>ÿ‚?µ5áI×?ÒŸ>Óè›?kꀛ_PI>p™Eé X>ûø&cj¯c>3%ô\Äp>/ôc ¦ª|>`ÏÉ÷!zˆ>v™!¾—Ò”>÷Ò%Dh©¡>n àHxÔ­>ŸÂ퇹>õ\ÊÀÅ>¦P7·ŒÑ>Î4¦S7"Ý>Ørv›™è>ñI%sÉó>¦ÒZb.?Õ2 SK ?Àç¾­t??¡xÍC !?œXvú÷/+? TË×0‚5?­b2Ešå@?eˆø{QJ?‡e¾ÓUT?ú¾'!_?lD+½Ÿg?›goÉÂq?ëMx &†z?ŠWÏ"5Áƒ?A™ÃbÜ?žìƒ¯^ ˜?’è°…Œ?¦Ý¡³P>·sÍ+`>@4í¤j>Rï3ìÆÅv>´?å&©•ƒ>[{HõÍ>®¥\gÄœ>϶e†¨>v$uØ´>²ðŸ£Á>ñí\ýÀÍ>6 Æ7røØ>§ì3‘àä>\põª2\ñ>XÎæ+=¿ü>ééÁ¨?QµVP`?–£)‡?q. )?÷}ÓÌý{4?ƒºJ’†X@?óù±*>àI?Ë_gûTT?Ìeluiª_?uïëo¨th?wØuŒÝ³r?ŽLÈ"Y|?éEhdD…?«°ÒÁ†œ?éÇ!ɘ9—?…I­Y© ?)å(Mϳ?Mx¡ v\V>Rº´øû”e> }LJÓq>¹Þúær«~>Ù¯8š°Š>œQ/¡Þ–>ÝPR‚P«£>¯Mxý/à°>€ÇµåÕ¼>¹n[L°È>ߺV]ÍÔÔ>fOh4›á>p7¤ˆ¶œí>]VÛ5˜Îø>Bs“z̪?Xb™.u$?%j,ÁC?îŠ±Ï /'?Ðá@Zã2?^:€C ™>?î]ù :™H?s¿Ê¤S?üÑGÝÁ_?¼¼…ñdsh?T<ü<ƒ s?~|-Ic}?ŸÉÑúms†?Ðç{V³ü?ø‘øm™?°#öÏÜ¢?&ÂÒÌ«?º¥Ò04Æ´?DSZ*c]> Ky‚|l>7«w>†/°¬Öo„>ȃöõ‘>ÚCéÔÌž>“²éÁ§ª>(!Óú¶>0ÅnÃÃ>ëËñ?ìÐ>É žë8æÜ>˜$jíè>‚2Îô>û!OnÁˆ?¼ëB-lp ?€Ã=áU“?E‡Û=l$?'' ÂåÝ0?ðâ­ø¶;?L"ëœF?exœ2ãVR?\:à§„]?Ûê ö?—g?å+`õ°r?zèÍa}?}Ä çÞ†?9_[꣑?F[àêš?…aî|T¤?­˜Þñ[®?<¹¦×[u¶?Ô€¥M"À?•:ý(§c>5HÕi¡r>vþÜÏ>Ò²zÑ&ÿŠ> èôºŽ—>¶ý0R–Œ¤>w“¬·’ݱ>º*Ãf¯ÿ¾>z¸#:ÊÊ>@ùøI,×>”½æóÓã>–AvÄ÷ð>× Ú¨7éü>øɟË?3¶kÔÊ»?›ŒE¯‰q!?pÕzY/-?ÝH¸˜FM8?^èGηD?ùŽƒŒP?ÌC [?óövËòöe?±‚À,,²q?ƒî¨¶žN|?9" 1p†?ÛÏœ4좑?ç¢^®q›?™n–%¥?—Kºï°?&_ËÞ“B¸?¡$¡r& Â?…•뙃Ê?í ºÐ–]h>(Ë÷¶œx>¥ÆTX’7„>ÄŠíi¡‘>ÅׯÁµóž>—Di´«>Üu¾“··>ªùÈ Y¬Ä> ^-wûÑ>c¸–(ß>®…œ†¢íê>+ÙºV™,÷>f—kâ?7ÿR|û?Ñù2&è?ËÕý¶y(?äDl§£4?UÇ1mèMA?»Ï ÍôàL?ƒŠÖ_]ñW?ãžr•½c?M¦uØa(p?è2 ^Gz?i$¦ñí1…?éŽÝ£åö?#ÇcJRçš?b€±5M$¥?OïR¼o°?ˆ™ŒömI¹?<Üžo-6Ã?d¢+pÙÓÌ?H™´(RÕ?Û]%áò2o>-¶ ê~>LIýXŠŠ>jg1Ж>³A6_¤>ú2ú\û¶±>,Go? ¿> æHLË>¯°œÛ×>Xv™bËÍä>2KxàŸò>Ú嬣1Rÿ>ÏÏg>© ?¨€ÇÐ@?Gïè#?^¦Å’»ü0?ûÇ"d©Ö¿šs> ç¹Ùƒ>$Ô4¬‘>qÑFS,>¡vy€©Ú©>áŒ$à¶>?¼í|÷6Ä>¿•ˆ·ÎÑ>ʧcØ’Qß>—މàqë>tßP¡Ôÿ÷>­sIÿç?6wt q*?Á­èÇ¢o?¼"!ÉP+?„µAÉH7?_X‘Ó¸ëC?^Ææ£8ôP?¹WÆôJ¼\?õ9ÿi5h?s*ˆY½Jt?û¢KX*å€?0ogzôö‹?øN@÷–?mØ5p¹¢?&BšÎ£B®?@¬¼è<¸?6€ûNª5Ã?0LsÖJÎ?gÙ?7Q×?ÆùÀ%òÎá?ƒ–^±Çê?¡W€¥õ„x>s«"{˜ˆ>"ØkkÝ”>šqô$œw¢>>ˆFåzm°>K ä”P;½>t%÷ZpðÉ>2©°ýPüÖ>/"ÊáMä>F|™çñ>À‹‰Pùwÿ>Š: ¡˜ ?ç×ZÉ?~YèÈ/%?ͺpó:2?(oêþ‹??ˆ£§Ü*)K?î«À¤qMW?ÉÿŒãc?_®é©éåp?äÙÀ­Š‹|?þ9%Çû‡?ò7,”?+f²½— ?Oc&BOK«?}‡ F¶?_§a«ÓÂ?ã] >áÑÌ?_-_´@ÌÖ?©Š¼Ë}Ïá?:ÏH)kë?PåªrPÃô? EQ*Š=~>íò–ƒŽ>v_¥fôç§>ðš‚æ§´>Wr«Ê¥rÂ>qv33vÐ>Kã=çØKÝ>°[#Œ~ê>RN‘5Î÷>ZðX(e?ÁzÍŸù?&¸‹@†ž?géG¤´+?Äœ«78?j_U ˆE?Nb.?ÉIR?Ì=>Ö–_?Õ 0\.k?Ö”|¶‹Cw?HÎÖYÒƒ?²8Ý %É?ÿ‚EEèEœ?áóö ¤§?ÅüU 㡳?ÕÜHí)À?Vö ‡bÊ?7I/NÕ?¥…—l1á?Ãc°˜Èê?à+sÄô?ƒ6¸gãšÿ?©hƒ¦gw‚>‡Ô©Uº’>o´Ñ• >|q%Gµ”¬>:°¦¹>.1âÙWÇ>¶NNù³ Ô>Â>âíauâ>æp' ®xð>j#Ø—Ž[ý>L'nõ7 ?‡.„¨ "?zé4¶·s$?è­í/ 2?(ý}º·??ÐøÏàÎK?Öïò‰GX?l>6"e?ÊÇÒëNr?öQŒ•'š?Zãö:´ ‹?l³Ã-—?¬Ý…Ëš­£?øÌCvÀ›°?è`™ÓoÒ»?+Ž_÷, Ç?˜÷÷zÓ Ó?±ìéRÎß?34göè?­?î(Ìó?ä dÒýÙþ?Són›¨Š@€#j(P†>ò‹gžµ–>ÈùÇK÷£>°$É9v±>,?l_ö~¿>)W¥•F`Ì>Æ ¬XÙ>"zÐf¿óæ>ÉÈᾘô>´¢8·n?#`e’y?î…@­Ñ\?Õ]v¢½*?ÿñü*7?ßD•Œ€D?Eø{ýR?©I“‹-Í_?Ñn0Ûk?Š:qÆSx?½½Ú¬ë#…?É ãÚM’?e(§?ƒŸ?1CÉþª?§èI¿ø¶?æ·‰`kÃ?ÍHF GÐ?Ä?[Ìç Û?•)`á4æ?ÐÎöu[ÿñ?áæBšm±ü?cŸâl@4Å/Y@ÝÁøØ™Š>q“ù==›>¿ÏAÞs§>;Gô&µ>OÅVPÃ>ËYëGÑ> ™7…:ß>’Óˆ®å2ì>\Ö fù>J±¥Ü?bçxß§„?^öÉÉòd"?HX̆Bq0?2(Ïõ…Y=?‚¯~ZHJ?žõà¡Ï.W?¬Ÿ›®q‚d?ϵ߮[r?¥Å¢3Ð?,œ³ ÒÞ‹?k<‰ÕL˜?G=ìð‡¥?ø)æ¼67²?Šîž(G¿?ßvy¥¨Ê? áœá‘ŠÖ?»t;´WÞâ?äDi78ï?}¡HWþoù?ÛR;ÉW@-Q£Â@D $ @þ…žq>lù ëî  >\| ‰Ÿã«>  Š}(¹>î‚J9QÝÆ>Z²ÃÔ>èÞå¼Úâ>B¦O@øñ>KtûNWïþ>ýòf°êñ ?x\9?âdØ µ&?ßêÛUk4?4neÂgOB?à !ñdP?²ä÷×D]?ÙâD*j?å’½$w?7.ƒ¶Ó}„?CNnGì’?q)'Ñaß?ÍËóv£Ç«?×Mý /¸?Ÿ/ãõìÄ?£ëG(¢üÑ?üœÞè¦Þ?skQ|Úé?TX &ƒõ?O”ꕘ@¹ÒBñ! @éEeÍÒ@@` æÆC @\Ðz:I’><¦Qôã¢>2b6^‘]°>$Ê#Ó¦½>c}„DË>j´ýø.¦Ø>Í-eqræ> }‘Z—oô>,QÓ?/'=âœÛ?øÈVÐm‹?'%醦+?6>¼Ÿý÷8?QáØ…F?ZÔvçBT? ÉU3b?TÈ µµLp?â`Z#}?úº((2ô‰?wÖ·—?¯xʽRf¤?•b‰â·û±?Ì`RŠ¿?®¸¿XVƒË?¿GY'Ó×?’O7uä?b|l2]ñ?ùµ‚ ý?fWçkÑÈ@¾ Ú*î@=›ùCÌð@cm¿€\î$@q/Grð•>Ï:¬"ÔÒ¥>ã5^¸Éû²> æé> <Á>ÙÏߊ‹Ï>j‡ ¼ÙÜ>5@ÎÊcê>ÆëüXø>VèAß+þ?JcÒQÌ?£¦ï¡û="?”c Ìù’0?Å·°¥>?‰Šh¹½BK?­Ì¬ÛªX?>Ü5Cf? NÛÝSt?T¯^öa‚?ôŸê*(+?/òˆsæœ?¸,õÆÁ©?ŽL!Ê;Û¶?^‚[ïâ2Ä??U‡¥n¾Ñ?²ÞÕBˆ÷Þ?VÇë°±Äê?µ ÁD„Üö?À‘Fœï/@ ½êj@s5/r+Å@=…Îl"@÷À )@æÊ4Ýåö—>¡ûQ†î¨>™hɸµ>?¾±ÅÌÃ>ýóÛ'Ò>A%q ¬à>Ë>°“î>£¨x˜ ü>ÚÇb¤3© ?ÌQˆ;Õ{?§9z3s%?‰í_¤Ë•3?J»ÛJsØA?˜`Ís@P?¥0–W‡]?kGì{•Íj?üžeÍ¢Dx?fæS´9ñ…?U‹ d6È“?DRÔKÌ¡?$­6£é¯?+uYg…¼?®ÁcC^É?÷¨ÇbârÖ?”¶05¸ã?*•Cq)ñ?ÆÕzý?e×§?d×@É1•ä®T@1ãÚâ%·@ó¤i¥&@@¡žÖ°*@(ìÚ Œ›>6)e¬>œŠšÒޏ>±“_lÆ>6Što£Ô>›kõ³kýâ>LïHýzñ>ÎØ-’»?.}LŠ;ˆ ?Y4î?‰‹‘sÜ(?ô4kS¡Ä6?»Ê5.[ØD?}W„*$ S?×\i#ea?¯TÐýP´o?Ó·±Ý|?¹Èæ7Š?upŸ§“Ç—?•wlc¥?2Jîv—g³?y™ŽDqÁ?‘õ* =Ï?𷋨-ÐÛ?ë»{ìP˜è?›‰jaíˆõ?—cñɉ›@,³qèÕ‰@nnx2÷@6µ€%òX$@`{\ ,@¿ÎØ×*@žÝØÂæ>)Ö•ÏF¯>éEì¬`»>Çü`ÓÉ>›„Í… ×>9ÐH½oYå>+ úd:°ó>$ÊJºŠ)?Ÿ¾8ü–º?Ýn7.]Ò?ªM Y,?2ÕA4r:?¹ß½Ï.ðG?ñ Bû^ùU?ÂTÜL^"d?ôÉ#npr?š]GÚ€?ö~!"ÿÆŽ?Bškª“ œ?l´=l€©?ðå ·?T“w¹éÄ?eÑUµ!ÔÒ?d ÞƒóÝà?°òÆ…þí?ûÂ9 jú?ÙpBÍÔò@ÒEï —@av™ãw\ @TUÓQBÅ*@¦ cL—û5@c–eŒ¾ÀB.Cgn >ß@Eó*±>ÅK_¢R%¾> Bš8¡¦Ë>3\é¸ù‘Ù>L@-̤ç>Û0»qàõ>®WÏËÙ6?¿VãZF¯?f¼D“ò>!?,Þ£@¿×/?‘W³YZ=?¾®Kå)K? eĶçX?G¥‹â2ëf?‘ˆ}Sù u?Ba¹·4Uƒ?ü.ÆÌ¦·‘?Ú”^Àœ8 ?ÄeD’¡­?žðà"b»?nU§ÑŠÈ?ßÇÁíu7Ö?w¡Y ÿã?òá?Þñ?dîâr˜ÿ?}zp‹ @c,™’@ÿS¸¦¼#@AJª|J0@–ÎŇ;@CH9¥YE8À³À{Âwº¡>¯Š zðž²>l<|Y\À>ÌüçÁÀÎ>„MŸâ ÜÛ>aXóÖé>–R³èï÷>~GŽû.?Ý.+Cƈ?zôýîí#?—¢aÁ•1?h/ìDGD@?i²Ö–e N?¥*V8sÃ[?Öhœi?âÚNŸw?4ÁMƒ¬À…?) ÿY”?œ-Ñû8d¢?b¿fà°?×>«†ªâ¾?°óf•1Ì?Á£1 Ù?á ­Ê*ç?æ¶ïZàÅô?©¤F×ìj@`*§@Òó ªk@»k*ÇÇ&@iÀ¹#±2@Ã=VØ…>@Ý»ù"ºöBÀQ»¼6û¢> ã°mùè³>Wžç4‰Á>“„†¢#Ð>›‚TŸôÝ>׿^|Íë>™µœ¼Òù>Í¥!õ?sTê9=?'ŠWpTž$?Õžßžç3?«ò•p·A?CNãjP?ÛÌn×@c^?†çïÍw l?¶‚_ä|ÿy?Ÿá(4îˆ?.tí§+–?¤ïÅÛÛq¤?ýÔy“в?×ÏöŠIÁ?‰D7AªÏ?;†çœÉäÜ?5 €Ø4ê? ÐU¥—÷?¿²žë@Ÿ_[Ñ;@ÏYGô@¾ò]a)@DQ 4@I U„?@¸¨?m¶ÐFÀ½³Ñ?n÷£>TçQïµ>¢xñ…Â>ùŸ”õÚÑ>ÍN+Õ&¹ß>…‘Ó°_‚í>6Òˆ–{lû>„2ì€ ?­< ɰ?¦ëø/ü&?iî1~@q4?´YýÒüB?¨Ðx8ŽQ?\›Ä%Y`?â+ƒ¤Nn??oo_¼|?——ýÑ:Š?†îi˜?E§é½e@¦?jæ‹§‹‹´?F‰I>ˆìÂ?«!çåšcÑ?”.$JÚÐß? h£ïì?“m™C›ú?—~Î*@¸Tu÷'@¶…¥‚!@VŒ å§†+@is—Ôó:5@ö1éz§)@@°Rè…EÜQÀs‚U„Ϥ>¦¶0#šãµ>“ôhNNQÃ>.>5äeÑÑ>Èç yà’à>èRÎÁ;Öî>²ÚSv·ü>t]—ŽÙµ ?.hµ«ôÜ?ì¿lG;'?;æ@‚5?mšªJýC?`£-8–R?¦Z§eCa?÷2Ém$ p?ŽÎçHBÅ}?ŸHgr¡‹?6AÕú=œ™?YóÛ€º§?•¸0Wèñµ?®*§;DÄ?«”¤/K¨Ò?‰•”8á?r‹A¼,ï?zÏéú1!ü?ZŸà¦©ÿ@%ÓOŒ·@O>Ù¸K9"@€Naœ-@ÖqY…ìà5@¬g&‘Ê?@bi„>SÀ¾µ TqV¥>Ù7æ{X€¶>RȪÙÃ>#J¬/ŸVÒ>þ¤äd† á>Üš§N±Çï>"_K½O–ý>ö ÎÀI‘ ?&Âÿ•¨?Œ7”ìæ'?ÿºÛM<6?Ò/d†y³D?š¤Êw‰@S?è#¤Ôéa?ð´[¦p?}(l°Óõ~?àIVsÀŒ?‡úa)³š?È Í,¨?ð¸éÔöð¶?ÁÃ'³{5Å?”;"Ó?wjæ³~õá?Q/QŠbð?‚Ä–ý?䜱”ÁL @]¸|?fÏ@àH°#@LÌ甞0.@ëÝŽbçM6@b RæaŒ?@úøöQ¨uWÀn«Û¤¥>eµ¹k̶> É:’R#Ä>ëÂ…±£—Ò>‰ã>®Oá>•a|±ð>*8àvþ>Jü¨vý ?ï í?.’¶ªI(?Õp÷ûŸ6?ÿóvÌaE?*t›•›S?¬Wt=b?\ŽËN­ùp?Ðbð?Á#ߌ0Y?Dò<Û‰A›?fÌïì:N©? ‚jJt·?ÓnEwµÅ? аbÀÔ?Ì0¶hâ?›‰gÍð?`<Ï€\þ?Æ¢ò3 ü @{ýÏìÊc@ômѧ]#@ÂhÞ瘻.@ñο/w6@ñ’¶«H\?@ñ>·n.XÀ¢žF¢¥>í{yçÑζ>Ï1¹F  Ä>ÎÑ]2¢™Ò>eúßSMá>wb·Ð¶ ð>bŠšu þ>ZKmSA ?hY­ò?Íçç·WK(?å‘¶+6?¤¤®3E?CÌXF™S?è' IÜ>b?Øsì Ò÷p?t¹ù’?óª9OV?¨L0÷B›?òoXµL©?"L/Þ)u·?xCCóò³Å?¤Þ¯+0Ô?=ï¨gâ?¡S,êvÍð?>2Ä[þ?|N5¶û @¹¸ì~Ãb@¦æÏ÷€#@ÐÂ娒».@)®Ó ñy6@Ôªzp>?@½¿}È¿XÀ˜'¿0Y¥>ÿýظ}¶>†ÏÜÃ> Z'tTÒ>lªü¨á>sRÂÄï>Ä4ñšý>>Ûé[Ž ?ô2ڞū?p“²_°ã'?§{– ?6?@D·±D?#o±ãBS?Œáü•èa?zÓÂOb¨p?¦Š¸4\ô~?¿B“:þÃŒ?nôÊm›²š?zÏ–ýBŨ?ÞA–9-ñ¶?zª¬8Å?úüötÓ?òª±ú÷á?ëd¢dð?3D/Úx›ý?oxŠ=ìP @ÝÒ1”Ô@”-¢#@q„FÖ:.@ Õ%Ý!W6@Ð…˜Cõ¿?@ž…}ÊeWÀLâtiä̤>­.äÑàåµ>wXláÍNÃ>.•ŸÔrÓÑ>y¶èÐà>*˜VöØÙî>¹Bà㩳ü> \¿¶ü¸ ?bó LGÚ?úº-%ö '?.¤­ä2€5?~5w «ÿC?•qíw½”R?Ùƒ´’zEa?O¯‡P+ p?Åœ9ÆÈ}?{D{´Q ‹?òsÚFŸ™?í¼ ¼Fº§?bj‹è«ôµ?¨3+åDÄ?졸-öªÒ?™>n@­á?Óâ42ï?Hºe´%ü?tœöj¯ @—EÕ/Û¼@ד¥ë@"@O^:--@¥|‘îò5@úz?@å?@5€«Ã:SÀ×i+±[ù£>ÅCä\µ>·Â¾èó‡Â>‹ti¤Ñ>-P :¸¼ß>[‘L¹~í>É=©ºŸoû>']®¢~ ?Éd#oг?®ì‡€½&?N¼v¯s4?øŠY0ûB?BB=“·ŸQ?F>ýX`?.ÈóŽRn?t@/Ùº|?b’œëáŠ?¬’¼Ü˜?Ëî^bÏC¦?56¨[xŒ´?‡+’ûÍïÂ?`? `eÑ?É6ׇ×ß?ýÿôì?$í$á0ú?bl9f1@D“O0@jº˜U !@´ÅV¬á˜+@gÜžºXK5@Ôùŧ9@@Ö."ÍpÎQÀ’ðÌù¢>´³âìê³>«ýoŠå†Á>?j1Yc%Ð>±ÚV1ÔðÝ>rî@Ô@Ðë>nÇ›G¹Ïù>Pæ1·ó÷?Ç …ë:?bí§ºÚ $?¯¹&=3?‚‰º¹A?À`H«ÑiP?l÷éõwg^?¼s nl?¼²|ahz?Ë6dìˆ?Ejœ ^/–?æ»*Ïr¤?tæ5Ô²?D–îlKÁ?Mf¹±Ï?¨W&3sêÜ?VQ`U<ê?°ˆ¬˜÷?ü«/¹êõ@>$ÂÀF@ú » @½ÐyÛy)@ìNE%4@U–¦Ü¤?@ ÒðÍFÀF²™¼¡>¾ï pœ²>H¨ÈÚ^À>îùÉÎ>Ñ>KßÛ>)iS3ëÒé>XØ¡×ñ÷>´hŽæ“,?AÀzI‹?x&ª'2#?ÝãΘ1?XÛut'C@?É·¿/§N?T¤ÃhIÂ[?¿z¡æc i?ÂQW*Ÿw?Ÿ¾0~Ä…?@FH2”?ýafZh¢?EHmÐá°?ÌJ1¦ê¾?ì/ýáE7Ì?õV»Ó¨Ù?b,í3ç?•®ÜõÐô?bèîê]w@,DNïÃ@-ÄÖ¥Ž@™Ö´©ñí&@ñ\4P£2@k-›¿Œ«>@߇u_«CÀíox.El >ù¸h9‚,±>A ŠÁ8!¾>‡ Qâ©Ë>D¡½ŽÙ>»àXx§ç>Vé%ûÝõ>XíNÿH9?4µŽây­?"NKY.A!?%ØrSVÕ/?t6KÏ}^=?Þ°µ× K?C&6ižëX?ïœêáêf?qÂ.кu?Ñc×Uƒ?Q)¡Ž_»‘?ÑS–1: ?`S2M©­?>»5œ»?¢%ˆ“È?j½i]t?Ö?O[Ý` ä?¡D”ëñ?ç–«»ÿ?Ë=í®,¹ @ÔÿjÉuÍ@7ÒØï’ $@c=ã@¡0@ÂàÀ« <@ÓS¡¥ ¨0ÀÖ½g¬é>çîŸðÀA¯>ÜqÛ—\c»>²I@™ƒÉ>¾Ô¢ˆ!×>óù‘ æVå> …²ó>¨4ƒ¸«'?•.C³¼?nµŽ™ÑÏ?=ß8÷ù\,?ѺÛ÷:?*À÷IçóG?(ÙéœÜøU?g8ò%d?÷Óô—Ñpr?ê=¦ÝÍÝ€?T‡¸„ÉŽ?%@ôÒœ?£àvÖ„©?Çœ¯X(·?4r³ðÄ?ÍmÞÒ?e#Q±éà?ÔOuÍ[ î?ðp…«S˜ú?BGmùß8@ÔÜš¢@H>”!@Aãâ•8Ð,@l³‰ï9@¯ ºO†#À L·˜›>0:†sú¬>î´u‹¸>ÅA»nÆ>éLÉ'ç Ô>“J“‹“ÿâ>‡˜“ yñ>‡xô^¼?ìŸÎaª… ?³=ß§?ÚTVæÚ(?ì}úb$È6?qßOµ×D?nˆgÂ~S?iº1Oea?™ÅE=ܺo?×-N •ß|?@hÝæ>Š?ýÌUË—?sÒ/¿„ˆ¥?8*,m³?cHzÁ?ÛÕÀOÏ?Ÿ&ÎÆëÛ?öj¨éX½è?ZBhé@Âõ?È[h˜£õ@†Î®r\@oø_@~*HÎ(@š$¡…85@ ÐB’ÄbË?$èäÄú—>! ៿ê¨>ÄÕÔÖ»µ>-N—<ÊÃ>z¸…² *Ò>¹~fmªà>D —î>“§FÚ¸ü>ÇÓôÞ¬ ?×YQàiz?¿CÔv%?Ä}.•3?V뿬ÛA?Bx'î*@P?§¹è±]?©.JÏj?†¥§²Jx?γô…?¦;Ô„{Γ?'Ì6ù¡Ð¡?yö'¯ø¯?GGb-“¼?³ÉϺrÉ?„ØdáIŒÖ?WÅä÷}Þã?”Ê5dùbñ?ñ$ru14þ?Ô¤Hû± @oJDAø^@QòïbM[#@”nÕøiT1@Á¶"I@›»ƒ¤•>Ë°Ú ³Õ¥> ñÕÄ%ú²>“÷*@?Á>MÊPf‰Ï>žìšvÞÜ>ƒpRwbê>SïŒYø>K¸ JŠý?Ë pª ?hN»•ñ="?茾¦€–0?pnï{š>?VN#½AIK?ß²³»¬X?xû[UIf?‡d t?|+U5Y ‚?c¡TÉä.?ãz*9úòœ?CB«EÌ©?[Šm¥ê¶?£˜ÎCÄ?)ljJ ×Ñ?d#8ùÀ:ß?Fí¿ð,ë?isy)ð|÷?ë ”g*3@å—¿ü½[@Æ™¹J+@É+ŒÖ:+@ è¿¡@4¥Žç)M’>.ëãp‚ã¢>—´üùa°>At4਽>¯à”Ç Ë>Ø•‚Z¨Ø>¹6¶˜eyæ>¶ñÜÊqô>4•u¹Û–?˜ÖC“ØÝ?aZWdô•?—œ‰¯ «+?Pœ*Â59?§F"mŠF?(õÎ[KT?í°¹9ÿ7b?]fî Tp?÷[­ -}?£¹²çŠ?­ƒ©_c—?0 ékht¤?4Oɬ ²?ŸÆŽŸ­¿?¿…[¯ ­Ë?'ÅüGGØ?ŒTïÈÈä?{1ÅtÜñ?êDy\“þ?ò?Þn3 @×o3®¼@:…>ýj$@!ÿð·4@Ä|ÉǦy>ƒ<1O+ >K¶‘ñ«>gÕ„ò€<¹> 9ZÓéÆ>dØM¼ÔÔ>½C¿Ò^åâ>\ÖdëL#ñ>0$éÿ>Œ¨†…ú ?ÿ—æ"I?ðñ\;É&?ýÞ±Gy4?žá`ÐT`B?×Ô~ qP?jCòñ†`]?¯«Ç(P'j?¤ñpPžª±Ã^Ks›>¦•«Æ§¥§>M’ÛMµ>úÆd»AÃ>šØ}œsÑ>KA« îƒß>oÞ n—{ì>ΈLï¤ù>n¤Y?¨îë"é·?µ|ô"º–"?NrjÖ›0?bçuzp«=?íUÉ´³bJ?²ÊÑïqW?+a~Œk¼d?䨎4Pr?—Øäõ¿€?Cò7{®8Œ?´·û䛘?ÍUfÒd¥?<>sÝ{²?ms п?J¢¿Mï0Ë?®òÓÿ>#×?ô3Q‡Ó‘ã?±vIQ’…ð?çK’Föïû?Çû ‰ó@4DЩ-#@³FAÞô\@~Ö¾ÿn†>µ½wžkx—>·.xþ/ï£>,¬…æ+²>qç‘ý´"À>"£ ËŒÍ>_sg_6Ú>gWïlMêç>579ù'õ>‡†¥.8?½Jo{ò?Lȕ⼣?dêÕÔê*?˜Îl28?irju&*E?Æ6_{uçR?—<]9s`?i²´s+m?€ï±Am:y?2|9E-†?¦“¡…" “?ÖC¬k§‘ ?ÁMWÕ´3¬?H-"VïA¸?ô4É61oÄ?'ס•}ZÑ?'Š¢pòÜ?7‚Ü–Xè?f§U0Mô?3,]JO@ÆQPie@•yÒ@ÊÊ&#‡>¾¥R‘>+Uª©qĤ>¨ÄViª>[™>Ÿ`˜À>ÃÄ'»KQÅ>Át°rx|Ú>kVá>jOá[­öô>v‚âF@û>&ûv&p?ù%=’÷?¿Z¤Œ€)?5ZÂ$Í0?Î…’ªZŠC?‹ Î-ðI?aˆ m>…]?‹fC¿c?šV9Hïu?–¨¥äì–}?JІyù?!e½Í¿•?õ—~1ɦ?Y}æfC¯?ÓÅì¢ê¢¿?>3WÒåÅ?AÓBË‘XÕ?Ólî:ïÝ?ó(Êå÷1ì?§L»QÃjô?–{Âõ@rýðwÞ@FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((48,40) (63,55) (0,0)) 7 €ÚŠ¥œ>?€ü³wšŠ>?@áàøÙ@? ÆÀC]@?@ì-Qÿ@?"àµ3A?»!cëŠA?€¬©~¥A?@IµdA?@¥ë jA?ߘ´¢}@?@!Ú‘E@?€/šÝ,K?Þφ???mã,¦H?€y iŸÀK?b‚˜ÖmO?@£«²™âQ? ­ŸŒžiT? rþ•FW?€«•C{aZ? |Q‘‰]? §„“r9`? à8˜Ï\a?Pªû¯õa?оœ-Êa?à¡×œs£`? ^¨\?@ÌSZ‚T?¨-ÂÒn/?ÄÁ†7M? [õm&Q?€TI®`T?@,4Î"¨W?@Ëtõ \?¼›¹ì‘`?@g·©éfc?çqGŽWf?`öL|i?PÀÿ³çWk?€œ‘`À l?Š}z•l?0p’7/îj?ÀWŽÅÖ‹g?`©M¤žb?`/ !õX?àT*J÷Q? §\ÐÐU?À” t¸Z?¢ïÉt`?P$#ðÑEd?€@ÉKÍÐh?Qѱ9óm?(äº ­q?˜œ\]4>t?p¸±ŠRv?XJ©›*‡w?ðÞ­ðÐ…w?x„v$ev?РÄ•3s?` F–Qsm?Àåeå@[? ’vºõV?à ‚¿M#]?0«P&¡b? r‚Kâg?­´n?¸gÂBs?`3V•·×w?€ð3 ¯|?éºB΢€?èKÈx›u‚?Ø õÐjtƒ?(™Ã¸Uƒ?@̧\Þù?IYbäý~?0µIc¬x?€ù ô}¼q?¿¬Týd^?0Ây)d? à°øQÛj?ðŸ:dÙq?HlרPƒw?€$†¾¼o~?Ð ä/ƒ? ëÁ«Y‡? W+°3‹?ཱི9öŽ?°'è¼n?P(Q—YÂŽ?˜n¬Ñðø‹?pÁ¶[n]‡?x¥Ÿ‰N¦?`Hõ)hw?€¾#廯d?DµÙòšl? ™d¶ Âs?ð_¿PÈ{?|Þ¨²qA‚?ä/€8Àˆ?Æ¡õQ”Ž?Àxo$ä ’?<“V‹•?¨tÃ+~—?0@Ž_¡˜?”€Â®fß–?À/W#”?ñÏK5?`‘Yhè’†? –ö…øu?sÏ, «l?Ðöv¬Œt?Àᨖ?¼K6Äž?rm ÉÊ£?ÑÅp÷ô§?Ѐr+Ôª?¬?ÝÕ«?4ÒìÆ…4ª?<;!Îní¦?i”<Õ¢?@kõÛmœ?ÐMŸŒ°€“?À ázó]…?´WG‘P?hõx^?Д[ZŒ?H쾡ñ–?(ºÛÌž?„Ìõ‘׌¥?‚Þ¥çPª?8ÅQš3v®?’¤#Ê&°?ЂË]u®?°6&]銫?I¥1ª¦?ÐqZ¨~\¡?`Á [36˜?`wÊÿ†7?`4|©Ž€?ÄzÆ 2¿¦Ãu#,Ž? PŠg‘?töµ‘F¡?F™yžÝR£?v?Š­?¼wòÕݯ?(%­‡å©±?ˆ<5Vï±?ÐÔM¦ 3­?ðQýþg«?ÈT S«Ý¡? ÚñÅ6$Ÿ?À»ï.Î?‘?@[gN¡Z‹?×w€†s?Ð^$¾£6¿Œ@È‘õ¿x¤qíæ¿°Îêtà¾ðZÁ=a?2‘D ?ØÄ= "?€@ñp *?KuŽM1?€;R„6?ÐÃÁë:?@xFÕ @?IcnvB?€M-†zÊD?Àc²ÓÛ¡F?À‰ªÃMWH?@dŽR­J?Ì|Ãpb¿0ùY¿€î»uwÑ>üЇH?&´aõ> ?¢¡”é)?q¼2{2?€Fù“¸®8?€0lY??@4"¥ËxC?€)ᛢVG?@Ìr,×*K?@þ^ä½N?Àmšl'ÐP? B< L‡Q?@ݬZ½‘O?”Ñ=Q¿lM­Ð¿ ¨† 0ý>S2í¹?_íiö(?€‚êXY3?½*èf;?À#R¤VB?%{ˆÝ“G?À÷ŽBTM? ¾Pô6¸Q?`p9ê€ÑT?àFQ)ÏÈW?ÀH¢ÅiZ?०8 º\?P-g9ºY`?FÎÛo¿ ( _—澆::9?¯ÕrP'?€}]¿É4?€Š¾!vl>?³„RjE?Y GM»L? ,)“R?àû rÃEW?@ÚGíÞS\? høtnÃ`?P5®[Gc?ø ÿ®ue?Û…:ܸf?`ðÖ÷ed?¶e‡¿,ü;"?)s~R$? º*ÃP4?€-æöž@?Oñ¢Á»H? Ps‚d]Q?€$|XaW?@ˆØ5j^?°ÑìÝ.c?à´a&Ù€g?Ð\-“ýk?8Ä”ƒx5p?0ÐPþïIr? å[âpWt?È£ŒLx? .žÇÏò¾~i S?^kAY3?À?[}A?€ˆswºK? ÍantT? Á&ÓíÀ\?@óXÑâuc?àE²Bá|i? BNè.p?èf%Ãñs?€y·Ùw?0tÜ'¯{?€Þ})´?xEøÏe¬€?å.ß’_~? Ýíh ?€¶ÑÉg‰0?sT§GA?€ûëR˜M?ô{W?ÀˆvHñü`?/Rûg?h«„ø‚Wp?¾ óõŽu?È5ó}™{?4}`ŠJ?¤µ’Šx„? @¿%XÓ‡?¤œ·–‹?l+UKŽ??€Jïå1vM?9®Ý{‰X?PB‚dc?ÍY…èl?pJÿŠÅís?øëÕm[{?¼ .H•*‚?¸Îx¦„V‡?¤›$·üŒ?°Â†3f‘?$–š$0”?î!ÄLÌ–?´1ŸA.˜?vÒ“µ‡–?€hÇ/–7?ÀÑÃ}m£J?Àã²ã0X?ggîãc?) ìÏn?ÛÛiÚv?ÀdÑjV€?œG¤L¨†?TiЬÙŽ?¤Ùmú]“?P ”+w ˜?–²ŒŽrÜ?fªŠ¿œ ?ÆAယ¢?ˆ€/牤?‚á&þðõ§?À1ݯßD?àœ{9¢U?PyÝw„3c?0Zâ#±ro?¨r‚Tnx?\ÿ¯¹5‚?¨R&A,'Š?ÚÀL)µ’?¬yú ¤˜?tÄOææž?œ"äÃ_£?x㳂¦? ÞA¢©?,ÖŠô§¬?öf¶çw­?&ûqsZ¬?Ó×óëÞP?àGX¡ÔÄ`?qP¨|m?p@Ò†‚)x?XÍmËaÕ‚?HM~Z&Œ?âë`Ü›4”?(âÂÔ›?ÞØWU×Z¢?¨/ÈE5(§?LPók‚ô«?çMÿ@.°?Ê÷섲?p¸Õ{p³?1 J¸|´?ëW…Uî³µ? Ct6ä‹Y?p7±ÏJêh?Ø®<<ÐÞu?¼7iö?´ÒOžŒ?Ôr@Èã”?\:J ¸?âDgï$¤?žàR;ñ©?`Š¥[À¯?» Mß‚²?LE«o©´?¦©·ƒ:¶?zó¤Ù1·?âfæ‹·?z¾þœÃ·? Ø*ÒLb?X„ˆÑ¸¼q?x?2˜¼<?8¥m™°‰?’Š&‚ ø“?4ä ’l?Þ&¦i}¤?NŒ(»ëª? <Œ³¿¥°?pÐlüôm³?R¿ “‡µ? ôS‚Û¶?`\UH€·?.‘ûvLŸ·?Ʀ‚~ŽP·?ÊvßG¶?Ðd5Fëh?¸aM4x?xöu6®a…?Ú ÿt‘?<´ªÍûš?¾#èyåo£?’ÜM§Ðª?Xؘ¤V°?Ìêt±â³?:“tuá´?š¾55´µ?Fø6½.³µ?8àþ3µ?ΦD½òˆ´?äÇCƒ´?t÷¡d¾´?pQÏwŸEp?¸‚hé~?tŠé‹?@}¡Í–?l¢N|Ô!¡?€ˆ1ìÉà§?`4Q†9C®?ž®`ñ@Ó±?fÂßïÆP³?ÆíH™¥³?Ê{ ³?˜Mµ4u×±?Œ?Np猰?è1¢t ®®?HOàÅ‘•¬?xàÕÕK©?p¸‚üor?x¸‘zCÚ‚?¨,8­’?¨Öb/o£œ?–sÞú€¤?¸™ béK«?$ âm@S¯?(j³ÔS/±?Xµë‹WÙ°?0^µE¥¯?‹Ÿ<—¬?pnñ# ©?øOÑ›X¦?pèîz|¤?¨LbF£?àÙëMTõ¤?ÎTÌfÐÿï?‚í?a½ÿï?D!F¤ÿï?ÖÐáàƒÿï? ³[ÿï?°Ži)ÿï?¸f‡íþï?Ü¿[Ó¨þï?‚PP\þï?”yi þï?CØz¡¶ýï?¶ajeýï?B–Îýï?0šéìÞüï?Ïb³üï?4{ü¬œüï?ÐôŸ°ÿï?è UùŽÿï?\¶tÅbÿï?°Ži)ÿï?0‰D£ßþï?¦„þï?ä•)þï?f®|—ýï?jBýï?F[õFmüï?>MźÍûï?Î+õ 2ûï?Ž.¤úï? júU.úï?[MÊÙùï?ü9k›­ùï?Ö¢2Ízÿï?v‚ÏAÿï?¦Å4ôþï?ðJ«Žþï?”yi þï?¶ajeýï?4{ü¬œüï?Ê`¿]°ûï?Ž.¤úï?ælˆ€ùï?„'8¤Pøï?¤]}&÷ï?ð¯Ï/öï?êr1õï?:qõŒôï?r–•þ6ôï?({Ì#ÿï?lª9Áþï?òU;þï?0ÛA‡ýï?4{ü¬œüï?¸Yx sûï?@Õ¿¯úï?„'8¤Pøï?¦øª\öï?r–•þ6ôï?œéX÷ñï?n?¾-½ïï?ôv’¯íï?" Þöëï?âKŒ¸êï?®ÐZ…êï?Âä4—þï?ðUDðýï?jBýï?>MźÍûï? júU.úï?cøï?8“D}õï?Lìo½^òï?ð{»¼¾îï?âKŒ¸êï?¾sØøwæï?±„«:âï?:îk·KÞï?ÔnûÚï?襁¨”Øï?TŠRjQ×ï?CØz¡¶ýï?4{ü¬œüï?Чûï?V²(ïøï?ð¯Ï/öï?Lìo½^òï?ôv’¯íï?¨a^­úçï?­OKáï?öZû4ÍÙï?<)€ÑÑï?ÍÍÉï?éB¦SÂï?^'4[¼ï?6’eg·ï?6¢Xû´ï?fUŒTüï?’,û ~úï?HwØ¿Þ÷ï?r–•þ6ôï?å£fú?ïï?.JDzèï?ð²ÃäSàï?Í~Öï?ÍÍÉï?^'4[¼ï?jë´0­ï?ö&:=žï?q.ú;ï?®VµZ„ï?‚As´{ï?¨[>,%wï? júU.úï?¤]}&÷ï?6#+Ãòï? ó±Žìï?ôè=Päï?襁¨”Øï?ÍÍÉï?6’eg·ï? ÷ bq¡ï?Ò;¶{tˆï?Xúoù†mï?ªø~†HRï?¨>Æ¿8ï?ZdÂ#ï?\WLWï?lo- ï?îAL@åöï?œéX÷ñï?âKŒ¸êï?ð²ÃäSàï?<)€ÑÑï?Œ@Øç.¾ï?\@M8‰¤ï?®VµZ„ï?þ.“ Ã]ï?vÜÓÁÇ1ï?4wHùsï?h,ÉÝÂÒî?.šO¦î?ûâ¢Ú€î?”÷·óÁeî?(íìŠWî?œéX÷ñï?®ÐZ…êï?:îk·KÞï?8ÿ¸,Íï?6¢Xû´ï?Ø%â8ì“ï?›zÒ÷thï?vÜÓÁÇ1ï?F²‰Zðî?.šO¦î?(íìŠWî?"k Q î?Ì”@_•Áí?Œˆ†í?ªÝœ –[í?)NÂ*{Eí?âKŒ¸êï?:îk·KÞï?<2Ƥ„Ëï?6݉üà¯ï?Ò;¶{tˆï?ªø~†HRï?lo- ï?ž«\„ý±î?ØKøÛHî?´Ÿ QÔí?ªÝœ –[í?Éx¬|Fçì?^~ð?êvRð?Âÿxkð?Ÿ@æ@‰ð?Ë‚«ð?¬˜âÑð?½@ŸÚúð? .Ä$ð?nðeMð?}h:rð?—é¹°ð?‚0'z¦ð?îŒp×±ð?Óö'ð?Y„8ð?­ïÇžNð?Âÿxkð?C,q3ð?Kö¹½ð?`ƒƒôð?NXÝX4ð?T!|ð?(¾œÉð?»ið?‹@hUgð?б¨[®ð?¨ÝŒ\éð?>J7²ð?ŠìFÒ)ð?eê{šBð?ÖöN:_ð?Üýé…ð?çf¹ð?½@ŸÚúð?nðeMð?îŒp×±ð? ³(ð?б¨[®ð?V'Ùœ@ð?ÙCYšØð?Q ûmð?ˆLúñöð?žß'Dið?[­]’»ð?Ûä­æð?"÷·nð?éÏ>Ÿð?têö~âð?Ê„w<ð?îŒp×±ð?šç$ÎFð?1?Z7þð?ÙCYšØð?’w„Óð?Ûä­æð? ¦†ð?>OêŒ%ð?”Åhw- ð?eûUÚ ð?ý@$Ѫ ð?%ÝuÆþ ð?q_ãm´ð?téâð?T!|ð?»ið?¨ÝŒ\éð?þYr³ôð?¡•ûAð?¥qž‰Óð?ÊK¥ð?ý@$Ѫ ð?fP!;Î ð?ò9aðð?^eööëð?V·¿Ê—ð?ß¶8Îð?ËFøGqð? .Ä$ð?îŒp×±ð?¢ð Rxð?øœ†3‰ð?ˆLúñöð?¥qž‰Óð?”Åhw- ð?Àд ð?n_½!ið?‡[SM0ð?MoBÃ8ð?-œLGð?ÿ¡¢ð?n©r¬H"ð?•HzbŸ$ð?›úçýÚ%ð?æÒ¹ïÕð?—OmsÁð?ÇP¸¨ð?Ûä­æð??@\gdð?­I¯ ð?7ºÉåð?Ëê%ð?-œLGð?n©r¬H"ð?)vãÓ)ð?jn…x1ð?½zWä§8ð?瑟/Å>ð?P¡€»;Cð?{ª¢—Eð?¨ÝŒ\éð?Q ûmð?Â(¡ð?ÜD쪾 ð?ó¨™ ð?ß¶8Îð?-œLGð?•HzbŸ$ð?„KʤÔ/ð?Y³³\¨<ð?%O²Ö‘Jð?Íèy½Xð?sôúBfð?¢unÀƒqð?’H€Ùyð?lñÐÝ@~ð?mhÉ«Žð? ¦†ð?ý@$Ѫ ð?7ºÉåð?MoBÃ8ð?‚@ÏÇ,!ð?P:R”?.ð?瑟/Å>ð?é[½ ÂRð?WæÂÅið?¢¡—Ò‚ð?fU…•^œð?É@ñ©u´ð?ÄzOýøÈð?êq0Sï×ð?cãŒðÓßð? ¦†ð?%ÝuÆþ ð?^eööëð?ÉäÚ@’ð?›úçýÚ%ð?'ñüÖÂ6ð?Ï߯3Mð?WæÂÅið?t~E{Œð?É@ñ©u´ð?cãŒðÓßð?åâÅ ñ?K†¸œÝ4ñ?Âjhî‹Wñ?ë'd¥pñ?ŸÔÖùÐ}ñ?ý@$Ѫ ð?^eööëð?ƒþhð?›òðÌt(ð?Y³³\¨<ð?Íèy½Xð?lñÐÝ@~ð?'ë®ð?`öâèð?”áP*ñ?ë'd¥pñ?¶¤,¨Ó¶ñ?ÅßC÷ñ?Ï\PÕF,ò?‰Y\!Rò?ôŒÆeò?7ºÉåð?ÉäÚ@’ð?›òðÌt(ð?瑟/Å>ð?LÖØ-_ð?t~E{Œð?ÄzOýøÈð?al}ä…ñ?ë'd¥pñ?c?Öñ?ZMRö>ò?‡)¹*£ò?[œYüò?)j•S]Có?;lpz“tó?…ÊÜ€®ó?MoBÃ8ð?›úçýÚ%ð?Y³³\¨<ð?LÖØ-_ð?˜ÞH•‘ð?êq0Sï×ð?K†¸œÝ4ñ?’·Ìè§ñ?Ï\PÕF,ò?ØŸ*¹ò?)j•S]Có?>K˜ÆÀó?zÞlÆ·)ô?·/jÞyô?ë——{¯ô?Fİ‘;Êô?‚@ÏÇ,!ð?'ñüÖÂ6ð?Íèy½Xð?t~E{Œð?êq0Sï×ð?p´Gà @ñ?­ó2Æñ?ôŒÆeò?æ±®Ÿó?>K˜ÆÀó?Gn·_ô?GÕQæäô? z\*ýMõ?~…€'šõ?GX++Ëõ?Nˆópãõ?P:R”?.ð?Ï߯3Mð?lñÐÝ@~ð?ÄzOýøÈð?K†¸œÝ4ñ?­ó2Æñ?°ýòOæyò?)j•S]Có?Qœÿù5ô?Fİ‘;Êô?e6ñ¯gõ?Nˆópãõ?RAâÞ=ö?b?Ðòi|ö?+Jsâ7£ö?Tͤ¸µö?瑟/Å>ð?WæÂÅið?'ë®ð?al}ä…ñ?’·Ìè§ñ?ôŒÆeò?)j•S]Có?zÞlÆ·)ô?òlœõqÿô?:a¸½Û²õ?RAâÞ=ö?+Jsâ7£ö?¿.åéö?ûÃ]¢Þ÷?ÇŒ—³3÷?á\¨Y¹@÷?×£pÛ,X?áz4ë Mb?Ø£PXϨh?ö(l-_Ìp? ׃Šc\v?q=:ç¸?}?|öGi‚?{^Õt}‡?ffγZãŒ?)\ÉÿC‘?ÂaO¹B”? ×g—?{šö)¸™?¸Á4Ò›?ð^'g?Âñ|ÿ˜?HáÚšµc?‘Âu¢¨ój?Há*nϽr?£p8 y?¥pµò°/?Âý€Ï†?Âݶ (?Ø£@(1d’?®Ïo®–? ×3(Q›?0F¼  ?’–‘b¢?> × Ñƒ¤?ÍÌ%I¦?HáØQGާ?r=*kù…ª?= W<ê®o?×£ r2¢v? ׃ðmÏ?33û5÷…?ëQ¸ˆßÅ?33OØÈ“?¤p±O5½™?®G;¯©` ?\$óD\¤?·mÌ$³¨?= ¡­’5­?™™oÒ°?{Ù¹Ú²?Gá²»ñ‹´?…sçHĵ?®›SLõ±?ìQølÔz?…Ë®³Û‚?ÃõhQËËŠ?)\óy´’?×£T`’ž™?ffX[ã1¡?[ž‹Ù–¦?33»vh­?Háp{š-²?®BÌø6¶?= ‡›Ipº?p=[‰¾?)Üpœ:Á?)Ü[§®ÖÂ?> ÿÿÃ?Iá…(#‚Æ?Âõ@V·Q…?ö(d~·&?ÔPb–?? cÉ™Ÿ?ö(dÖLà¥?„ëqn¦«­?Âyž®³?? Ç2I¹?ºgÐÀ?…’éÓÃ?q=ùg ¼Ç?+X¤Ë?S8ŒtN3Ï?®e‡™Ñ?„«…ާ0Ò?Habf“SÎ?®¬;‘?¤Ä]z™?R¸Jâ|…¢?š™“d›qª?ëQ¼(I‚²?¹°Yü\¹?™™K=žûÀ?®hÝw0Æ?¸À“Í=Ì?ö¨‚6U{Ñ?H¡c»ÕÕ?ÍÌÑz ŒØ?Ãu›8ÇËÛ?Í M¼j„Þ?áúĈX=à?™9’¡,â?ff »Œ›?âz42ð›¤?Âõ¼GKQ®?q=¨'œãµ?¥p\õVø¾?BÈû,mÅ?£ðQ.ðÌ?z¯75 Ó?ÿ¿CžZØ?‘BÐ/g@Þ?ì­C¡8â?€F¹Eå?¯'†Nòè?o]"d`ê?®g°iæì?ÍìÔ☠è?®%8µ¾¥?ÿÿÞo~v°?¤pާé¸?…ë(¯áÁ?›óL?ŒÉ?á:ÇnÒÑ?{”ácZ7Ø?ÕcJ‘3úß?Néýxä?ë‘‹Ž˜`é?®ge)¸lî?î{d£ñ?Hñs ZËó?Ãõ«³Fˆõ?{|o‚¾ö?ÂM†Óø?ÌÌüUgì°?ffÞê í¹?¸w›Ú€Ã?ÿ'³9¿Ì?š8"E²Ô? —˜ rÝ?¤ûÄÀã? ÷»™ê?Íü#Іð?Ù3€Á¡:ô?×ó~óÖ÷?3XòGû?|T”:¿ý?r-ÜÝÆ¸ÿ? Óä†@‘bŒÃ |þ?ffÞê í¹?hf4,ØÄ?™™LäÎ?ö¨ç3¥Ö?Í dx _à?)ü#úëñæ?‘‚kÖáï?‚ F9#ô?ÐÃñtù?=ú²R¢ý?q•hÂÃ@{Ds'â,@R€z?@2›à·Eb@†«„Æ6x@…ÃÄ=•@¸w›Ú€Ã?™™LäÎ?]8¯êU×?×£ô6Qcá?·¾›)é?Uí„Qgñ?Ëœ£¡ ÷?r=u`äü? ¿¢- @I¡´a“Ù@Ú1űŒ@ÁuV2ü @H¡~€ ä@R {xÜT@b¯Ûôìý?¥ð8ÜMþ?ÿ'³9¿Ì?ö¨ç3¥Ö?×£ô6Qcá?ÍŒ;×é?öxð×ßjò?]_˜!yåø?i6Õ²[‚ÿ?4c¾’¢i@¯g½’š@è>˜òÂ@ ÇóÛ7Øÿ?gF>Mmv÷?׃<ôþšì?\OåV=œØ?@\¿/÷ÍŒ?pýH˜Í†é¿š8"E²Ô?Í dx _à?·¾›)é?öxð×ßjò?ázN¿‡ù?öhÄS e@ö®¼˜@Røâ-u@f>; /±@£Ð"ÒŒÐõ?qýŒt ÀÚ?®'Õ×-Xá¿Í|ãh°õ¿…k=t4ÿ¿¥ÈƒN®•ÀŽZ.–À —˜ rÝ?)ü#úëñæ?Uí„Qgñ?]_˜!yåø?öhÄS e@² Ù6;@QL§Æ!@¥ÞA¹oý?®§Ã+„é?Íl£* ºà¿>ª)$çû¿¸Ö•ŽòWÀ OU’- ÀöÈa‰ Àe¶ ôG¯ ÀšA><À¤ûÄÀã?‘‚kÖáï?Ëœ£¡ ÷?i6Õ²[‚ÿ?ö®¼˜@QL§Æ!@õEº¶Ûû?®z-vˆÜ?)¬‡XŽò¿®ß¤ËÖ÷À]g??î À®šÛƒAÀͶuÞÀ3C±ì@À…ƒØÑe À?*³è:ÀÂŒÈO}Ê?RLøÑû?q]ôèX­ý?׸¹g@‡xY@¸®¾YÀù?âZaÓ#à?ö˜šæ(ý¿·f5µ À£,וÀìíF¯òôÀR4×Ã×wÀ÷˜ŸqÀ×câg” ÀÂm\Sëö Àq].ÄÞ±Àº3k¯¼?§2¦û+.Á?¨çWY±nÉ?ື£ãÐ?ù€Û§VÖ?"ˆhãÜ?fEipŠ:â?'~˃t½æ?þ¿[æ¯[ë?‘wµ[ð?}•ýŠÁò?nÃ_õ?ÜŸ2¬ÔW÷?Òèüšýù?ä[ñIZ:ù?.þ ¹£Æ@ȬÕØ7È?Lz/]Ñ?ÄWÆ Ø?×EÒý›_à?1!%SÈÚå?Å…ÁmÓì?}ÎÔåîKò?ð³I!Àäö?èþ¶x…ü?Ík`þ´@¾¥‰!v@ÿGGMï@2“Àô u@úÿ©h @‘áuå" @Û6Æ!®@ˆ˜ëà<4Ó?À,ëhYÛ?•Û7—“ã?¿¤¨˜v#ê?‚á]$‰ñ?G$:.k ÷? <ó¾D–ý?œ dø@§˜5®¶³@fwÊ @˜8tî}@½V¨LcÖ@°”mb¯@vRº·@+)GPkÅ@Íd/a:Â"@´j|uß?­è¥‰â<æ? ¶.™ŸBï?Î<ÿé‡õ?©ÜN ý?j«â ¹ @A!Â}™@õ $YÓ@¾^1à¿Ï@UžŸMªW@™aËa#Ô@Ä®có@FílãœÞ@¸:ô1!@•üa"@X¹”r@$ö甑õè?åÇÁ¼þñ?\^ó>?où?šXž ˜@Oˆ°agÄ@á(l>M@Å]邊 @€ÍÙŸ÷@šÃJ)Ÿ+@Ækû°!@g4œã#$@œë=6J&@ÛAî2(@—id+\()@‚«[ª8)@ÕŽYPÿ8@^s©¸WËó?ø¨*¦°ü?÷±‹µ-Y@æ£/Ç) @¦þ&ãø@þf§©›Î@Ð¥ »h@ ]óh5#@ñ°ÖН«&@Ï)½Î)@Bö],@ž²q[„0.@b££Ða?/@Ë£Z­/@N .I¡ 0@ ¹HÑE@ ›¨ŒúÙþ?aœçóm@]‰Šî…É@„b)ä@d *Rò+@iŠïº"@%·Àx'@âY ˜ˆ!+@êtwÜÏ\.@@\ÆèÐ0@¸œ®Ñ70@Ü<¤ú.@ØÄ ܽ,,@u‹-³yz(@ßÏ¥I#@pÍTy(D@al©‹@UaÃÊ@táÚß1@fÐm¯U @Ö¿F\·=%@ƒj<™N;*@ñ)ØÔ–u.@X&jÊIg0@Š=›1ð0@`Ô„in°+@j†ža)[#@ìÁÿ‰Qç@<ûÐhuÖÀ0] …!Àà¥~¼+À¬nÝòøBÀfžz‚@JÇ<{9@ê ÓÊv!@â´„ù-'@¨ tþy,@§É|äã60@<Ú,öÂm0@´5Ô®Š+@S¼á˜É@Ù’”¹’À¥¤‰¿t0ÀD$›Â˜?ÀWUšµ‚=GÀ2ð\ÇÐMÀÓãpwÂQÀ_5vY6ÙCÀDÜÉD9@pÄZÍÛ!@,Oßï'@Ðl˜ÒIÇ-@‚YK¶×¤0@Â0+¥ 0 # (this one is optional) amr.regrid_file = fixed_grids_1 # file name for specifying fixed grids # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 2 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio # # Only call LinOp::ApplyBC() on alternate calls to LinOp::Fsmooth() # from within LinOp::smooth(). This is not theoretically correct but # can cut down fairly significantly on communication overhead when # running in Parallel; especially so for periodic problems. # # 0 is false and 1 is true # Lp.alternateApplyBC = 0 #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 1 proj.v = 1 diffuse.v = 1 amr.v = 1 mg.v = 1 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) ns.sum_interval = 5 # interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 50 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 1 # (integer) number of timesteps between plot files #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt # (this is optional) ns.init_shrink = 0.1 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.01 ns.scal_diff_coefs = 0.0 ns.do_temp = 1 # (this is optional) ns.gravity = 9.8 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** geometry.coord_sys = 0 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 1. 1. # physical dimensions of the high end of the domain geometry.is_periodic = 0 0 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 5 5 # boundary conditions on the low end of the domain ns.hi_bc = 5 2 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING CONTROLS (these are optional) #********************************** amr.blocking_factor = 1 # the factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for multigrid convergence mg.usecg = 1 # USE THESE ONLY FOR TESTING #amr.grid_eff = 0.9 # grid efficiency in the grid creation algorithm amr.max_grid_size = 8 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/fixed_grids_20000644000175000017500000000016511634153073023140 0ustar amckinstryamckinstry2 2 ((0,0) (7,7) (0,0)) ((0,8) (7,11) (0,0)) 3 ((8,0) (23,15) (0,0)) ((8,16) (23,39) (0,0)) ((0,0) (7,7) (0,0)) ccseapps-2.5/CCSEApps/iamrlib/test2d/inputs_40000644000175000017500000001371311634153073022200 0ustar amckinstryamckinstry# NOTE: all the values here must be set unless specifically # marked as optional #********************************** #ALGORITHM CONTROLS (defaults shown; these are both optional) #********************************** proj.proj_2 = 1 proj.filter_factor = .1 ns.do_MLsync_proj = 1 #********************************** #RUN CONTROLS #********************************** # MUST SET ONE OR BOTH OF THESE. max_step = 1 # maximum (integer) number of time steps #stop_time = 2.0 # maximum (real) time (in same units as dt) amr.n_cell = 16 16 # indices of the domain at level 0 # (this one is optional) #amr.restart = # set if starting from a restart file, else comment out # This will default to file "probin" if not set amr.probin_file = probin_4 #********************************** #ADAPTIVITY CONTROLS #********************************** amr.max_level = 1 # maximum number of levels of refinement amr.regrid_int = 2 # how often to regrid if max_level > 0 # (this one is optional) amr.regrid_file = fixed_grids_4 # file name for specifying fixed grids # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 2 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 0 proj.v = 1 diffuse.v = 0 amr.v = 1 mg.v = 0 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) #ns.sum_interval = - 1# interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 20 # (integer) number of timesteps between checkpoint files amr.check_int = 2 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 2 # (integer) number of timesteps between plot files #amr.plot_vars = x_velocity y_velocity density tracer amr.derive_plot_vars = avg_pressure #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt #ns.fixed_dt = 0.9 # Time step # (this one is optional) #ns.init_shrink = 1.0 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.0 ns.scal_diff_coefs = 0.01 ns.variable_vel_visc = 0 ns.variable_scal_diff = 0 # (this one is optional) #ns.gravity = 0.0 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** # # NOTE: The domain size must be a multiple of 2 for the BCs to work # properly for the viscous benchmark. # geometry.coord_sys = 0 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 2. 2. # physical dimensions of the high end of the domain geometry.is_periodic = 1 1 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 0 0 # boundary conditions on the low end of the domain ns.hi_bc = 0 0 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING & SOLVER CONTROLS (these are optional) #********************************** amr.blocking_factor = 4 # factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for convergence with this problem mg.usecg = 0 mg.nu_f = 100 # USE THIS ONLY FOR TESTING #amr.max_grid_size = 64 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/fixed_grids_60000644000175000017500000000025611634153073023145 0ustar amckinstryamckinstry2 4 ((0,16) (19,41) (0,0)) ((0,42) (19,59) (0,0)) ((20,16) (63,39) (0,0)) ((20,40) (63,59) (0,0)) 3 ((0,66) (3,79) (0,0)) ((108,54) (127,95) (0,0)) ((124,42) (127,53) (0,0)) ccseapps-2.5/CCSEApps/iamrlib/test2d/probin_50000644000175000017500000000021511634153073022141 0ustar amckinstryamckinstry $fortin probtype = 7 xblob = 1.0 yblob = 1.0 radblob = 0.4 denfact = 1.0 velfact = 1.0 adverr = 0.5 vorterr = 10.0 $end ccseapps-2.5/CCSEApps/iamrlib/test2d/inputs_2_xy_ysolid0000644000175000017500000001370511634153073024302 0ustar amckinstryamckinstry# NOTE: all the values here must be set unless specifically # marked as optional #********************************** #ALGORITHM CONTROLS (defaults shown; these are both optional) #********************************** proj.proj_2 = 1 proj.filter_factor = 0. ns.init_iter = 2 ns.do_MLsync_proj = 1 #********************************** #RUN CONTROLS #********************************** # MUST SET ONE OR BOTH OF THESE. max_step = 1 # maximum (integer) number of time steps stop_time = 2.0 # maximum (real) time (in same units as dt) amr.n_cell = 16 16 # indices of the domain at level 0 # (this one is optional) #amr.restart = # set if starting from a restart file, else comment out # This will default to file "probin" if not set amr.probin_file = probin_2 #********************************** #ADAPTIVITY CONTROLS #********************************** amr.max_level = 2 # maximum number of levels of refinement amr.regrid_int = 2 # how often to regrid if max_level > 0 # (this one is optional) amr.regrid_file = fixed_grids_2 # file name for specifying fixed grids # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 4 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio # # Only call LinOp::ApplyBC() on alternate calls to LinOp::Fsmooth() # from within LinOp::smooth(). This is not theoretically correct but # can cut down fairly significantly on communication overhead when # running in Parallel; especially so for periodic problems. # # 0 is false and 1 is true # Lp.alternateApplyBC = 0 #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 1 proj.v = 1 diffuse.v = 1 amr.v = 1 mg.v = 1 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) ns.sum_interval = 5 # interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 50 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 1 # (integer) number of timesteps between plot files #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt # (this is optional) ns.init_shrink = 0.1 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.01 ns.scal_diff_coefs = 0.0 ns.do_temp = 1 # (this is optional) ns.gravity = 9.8 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** geometry.coord_sys = 0 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 1. 1. # physical dimensions of the high end of the domain geometry.is_periodic = 0 0 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 5 5 # boundary conditions on the low end of the domain ns.hi_bc = 5 2 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING CONTROLS (these are optional) #********************************** amr.blocking_factor = 1 # the factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for multigrid convergence mg.usecg = 1 # USE THESE ONLY FOR TESTING #amr.grid_eff = 0.9 # grid efficiency in the grid creation algorithm # amr.max_grid_size = 16 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/inputs_30000644000175000017500000001370511634153073022200 0ustar amckinstryamckinstry# NOTE: all the values here must be set unless specifically # marked as optional #********************************** #ALGORITHM CONTROLS (defaults shown; these are both optional) #********************************** proj.proj_2 = 1 proj.filter_factor = 0. ns.init_iter = 2 ns.do_MLsync_proj = 1 #********************************** #RUN CONTROLS #********************************** # MUST SET ONE OR BOTH OF THESE. max_step = 1 # maximum (integer) number of time steps stop_time = 2.0 # maximum (real) time (in same units as dt) amr.n_cell = 16 16 # indices of the domain at level 0 # (this one is optional) #amr.restart = # set if starting from a restart file, else comment out # This will default to file "probin" if not set amr.probin_file = probin_3 #********************************** #ADAPTIVITY CONTROLS #********************************** amr.max_level = 2 # maximum number of levels of refinement amr.regrid_int = 2 # how often to regrid if max_level > 0 # (this one is optional) amr.regrid_file = fixed_grids_3 # file name for specifying fixed grids # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 4 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio # # Only call LinOp::ApplyBC() on alternate calls to LinOp::Fsmooth() # from within LinOp::smooth(). This is not theoretically correct but # can cut down fairly significantly on communication overhead when # running in Parallel; especially so for periodic problems. # # 0 is false and 1 is true # Lp.alternateApplyBC = 0 #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 1 proj.v = 1 diffuse.v = 1 amr.v = 1 mg.v = 1 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) ns.sum_interval = 5 # interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 50 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 1 # (integer) number of timesteps between plot files #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt # (this is optional) ns.init_shrink = 0.1 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.01 ns.scal_diff_coefs = 0.0 ns.do_temp = 1 # (this is optional) ns.gravity = 9.8 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** geometry.coord_sys = 0 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 1. 1. # physical dimensions of the high end of the domain geometry.is_periodic = 1 0 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 0 5 # boundary conditions on the low end of the domain ns.hi_bc = 0 2 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING CONTROLS (these are optional) #********************************** amr.blocking_factor = 1 # the factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for multigrid convergence mg.usecg = 1 # USE THESE ONLY FOR TESTING #amr.grid_eff = 0.9 # grid efficiency in the grid creation algorithm # amr.max_grid_size = 16 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/fixed_grids_10000644000175000017500000000014111634153073023131 0ustar amckinstryamckinstry2 2 ((4,4) (7,7) (0,0)) ((8,4) (11,7) (0,0)) 2 ((12,12) (15,13) (0,0)) ((16,12) (19,13) (0,0)) ccseapps-2.5/CCSEApps/iamrlib/test2d/fixed_grids_50000644000175000017500000000025411634153073023142 0ustar amckinstryamckinstry1 7 (( 0, 0) ( 4, 4) (0,0)) (( 0,21) ( 4,23) (0,0)) ((25,20) (31,24) (0,0)) (( 0,15) ( 4,18) (0,0)) ((25,16) (31,17) (0,0)) ((25,11) (31,14) (0,0)) (( 0, 7) ( 4,10) (0,0)) ccseapps-2.5/CCSEApps/iamrlib/test2d/inputs_2_rz_zinflow0000644000175000017500000001370511634153073024462 0ustar amckinstryamckinstry# NOTE: all the values here must be set unless specifically # marked as optional #********************************** #ALGORITHM CONTROLS (defaults shown; these are both optional) #********************************** proj.proj_2 = 1 proj.filter_factor = 0. ns.init_iter = 2 ns.do_MLsync_proj = 1 #********************************** #RUN CONTROLS #********************************** # MUST SET ONE OR BOTH OF THESE. max_step = 1 # maximum (integer) number of time steps stop_time = 2.0 # maximum (real) time (in same units as dt) amr.n_cell = 16 16 # indices of the domain at level 0 # (this one is optional) #amr.restart = # set if starting from a restart file, else comment out # This will default to file "probin" if not set amr.probin_file = probin_2 #********************************** #ADAPTIVITY CONTROLS #********************************** amr.max_level = 2 # maximum number of levels of refinement amr.regrid_int = 2 # how often to regrid if max_level > 0 # (this one is optional) amr.regrid_file = fixed_grids_2 # file name for specifying fixed grids # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 4 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio # # Only call LinOp::ApplyBC() on alternate calls to LinOp::Fsmooth() # from within LinOp::smooth(). This is not theoretically correct but # can cut down fairly significantly on communication overhead when # running in Parallel; especially so for periodic problems. # # 0 is false and 1 is true # Lp.alternateApplyBC = 0 #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 1 proj.v = 1 diffuse.v = 1 amr.v = 1 mg.v = 1 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) ns.sum_interval = 5 # interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 50 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 1 # (integer) number of timesteps between plot files #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt # (this is optional) ns.init_shrink = 0.1 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.01 ns.scal_diff_coefs = 0.0 ns.do_temp = 1 # (this is optional) ns.gravity = 9.8 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** geometry.coord_sys = 1 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 1. 1. # physical dimensions of the high end of the domain geometry.is_periodic = 0 0 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 5 1 # boundary conditions on the low end of the domain ns.hi_bc = 5 2 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING CONTROLS (these are optional) #********************************** amr.blocking_factor = 1 # the factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for multigrid convergence mg.usecg = 1 # USE THESE ONLY FOR TESTING #amr.grid_eff = 0.9 # grid efficiency in the grid creation algorithm # amr.max_grid_size = 16 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/0000755000175000017500000000000011634153073022023 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/Header0000644000175000017500000000060011634153073023132 0ustar amckinstryamckinstryNavierStokes-V1.1 7 x_velocity y_velocity density tracer temp divu dsdt 2 0 2 0 0 1 1 4 2 ((0,0) (15,15) (0,0)) ((0,0) (63,63) (0,0)) ((0,0) (127,127) (0,0)) 0 0 0 0.0625 0.0625 0.015625 0.015625 0.0078125 0.0078125 0 0 0 1 0 0 0 1 0 1 Level_0/Cell 1 2 0 0 0 0.5 0 0.5 0 0.5 0.5 0.75 Level_1/Cell 2 3 0 0 0.125 0.375 0 0.25 0.125 0.375 0.25 0.625 0 0.125 0 0.125 Level_2/Cell ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/Level_1/0000755000175000017500000000000011634153073023312 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/Level_1/Cell_H0000644000175000017500000000077611634153073024375 0ustar amckinstryamckinstry1 0 7 0 (2 0 ((0,0) (31,31) (0,0)) ((0,32) (31,47) (0,0)) ) 2 FabOnDisk: Cell_D_0000 0 FabOnDisk: Cell_D_0000 57426 2,7 -0.012053608389312,-0.000815229613043811,0.6669370850051,0,1,-5.27117194654642,-145.936375196044, -0.0120644022030026,-0.0768569572513312,0.6669370850051,0,1,-5.27117194654642,-143.639476641104, 2,7 0.084419118974831,0.0755989034782787,1,1,1.49939180543897,3.0924335071236,211.337780896052, 0.0844174452854948,-0.000412952843895716,1,1,1.49939180543897,3.0924335071236,211.232170327364, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/Level_1/Cell_D_00000000644000175000017500000025024511634153073025026 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (31,31) (0,0)) 7 ˆà™±dà>ÀRɶø>2¹»}k?1îNƒ| ?Iäˆ9?=*Yt#?%z¶¢÷?m³hb±?€Ì¸†Ð¥ ?€—õn`"?À1HYŒ$?@Yd¼ñ‘%?À–ã·-'?ãõ R(?Àrè ‰)?Àr‚…*?@HAMd_+?€^6Ï ,?A¬eÛƒ,?@?²HyÇ,?ÀÝßW*Ó,?€’?e-¥,?À÷™©<,?€˜£¥Î™+?€¬FàË*?€³Nܸ)?0ed¯r(?ìïÝøý&?¾z]_%?€UzÓš˜#?u@§ž!?ogò^?;0Qsà> ½Ä¥ø>%S3~?Xó¤í– ?·¬ÜJ?€†2p'9?€*°D?€ÆhYÕÐ?Àî¢J¸ ?Ï;ååu"?9cE>$?€úÇ=®%?ÀóPò!'?­î§)v(?€§Üé¦)?€G¹ÑG°*?À· UŽ+?Àe€§:=,?€d1Í[¹,?@F*Î}ÿ,?@6\mõ -?À,bhÖß,?@Ÿ"w,?ÀwsÙîÒ+?†±-Á+?€EuYì)?€òM9¡(?€§­ºÝ''?øÐ¾„‡%?€TqXrÌ#?G{î"?€Æë3© ? /ýRà>‚‚…Ñø> L•í¢? “+\Ë ?€ÕCm?€ëÛ=d?}ËjiF?”‡sI?‚<Ý ?À £t˜ "?@k-JjO$?À»d§,æ%?K hVa'?€´5¥&½(?À7\¬õ)?À¨µ½Ò+?BÊptì+?À¿ŠÊv¢,?e‡<í$-?€´ê—Dp-?€6žît-?À⤽7V-?ÇT¶>í,?@ExSdF,?€H¯q+?˜åè:S*?EC¿Sþ(?€«Àx'?¯imeÊ%?€°»ÿ#?“þ’4"?€xŸ4º ?¸ U:»à>x}7@ù>á+7|Ù?¤) ?€XN< ?€àœÂ¤?Š ”?4ž«Ók?ÃÜXr!?í¦Qà"?€àô˜$?ìî²Õ9&?Àä=À'?@/±‘i')?€Ò^ÿËk*?À9âŒãˆ+?ÀÏŒÙ8z,?À~ æI;-?Ù•¯Ç-?€—GJ.?€¶›2.?@Ýi^z .?Õ×e¡-?ô9¶µö,?ý¢Ÿ7,?LŸtäð*?€J9ÆŒ)?€½Êiò'?ì×F•)&?€Å2g4$?€®BÝg"?º¿°¢?h^øFóà>¤nó×fù>òôÎÕ ?Ûn6©~ ?ˆìÏ ã?€»ã]Ý÷?€ ç'×ù?«¸Týä?@ô^ÇZ!?€e?1j3#?@Ïä(ù$?€þý:v¨&?€Mq›=(?Àkütž´)?@ky®1 +?€Õ µ6,?€—I¥D8-?@”ÍëÑ.?ϸäJ£.?À\]ÒÍ/?LÛFë"/?@Ò’­ôÿ.?ÀJsUS—.?€qÓ«Þç-?€"tÀp-?€±ÜƒÉ+?€ï\ÌÉN*?€9V4›(?€ö.µ&?~ÌÈ\¢$?sp0X"?Qm¡'?(Úcn7á>úÕàÀÍù>k ‚¸w?ÌïÒ¤ú ?Íc³4?€ÿãÈv^?ÇðO‚v?}g*¡x?÷Ð(¡±!?€¡Å„ª™#?€ 7´ p%?Àm“+61'?€ò @Ù(?€0é£8d*?=sžÍ+?Àéù'u-?ÀFR'.?€ dt /?€eXÒê¹/?õ?Bç0?À$=AF+0? ¨¢ì£0?€®€ÇJÔ/?xp/?€` à0.?€ðvóà,?"§‘ÓJ+?€É'Fv)??SÞn'?cÛz¼G%?€TÅÝ*&#?ûˆÍMp!?ŒbyU†á>à óóDú>Ø\’xÜ?n³¡²Š?@r!ç“?èÏO»Ö?€M]~j ?@ß'W ?@ÅÆ(h"?†—òž$?iÌ{ü%?@…õÐôÒ'?€ÙŒsæ‘)?À‰ÃùU5+?@õ”ZŒ¸,?@ï< $.?À°\íH/?€uf$á#0? Y‡0?ÀŸ*­Ê0?`ì—’*é0?€fÔCá0?Àü1Ú¨¯0?`Wøc›R0?€6Ì" ©/?¤äEÚ?.?˜0íÊú>-±†M?G?Òû+?€ïœU×þ?iqå^?;˜³?@튴Îz ?qÌm³‚"?À†ªíŒ›$?6²¾ &?€=1f Œ(?øŽ÷e*?À“&,?À)¯[É-?ÈÁlhG/?€¨­„M0?àS‰)Þ0?ÀØ—ûuQ1?À !ú¢1?À Ü#-Î1?À÷MµÎ1? ô4VÆ 1?ÀnÎŒ•A1?ÀQÜA|¼0?‡gÄöï/?‘çì“.?^¸‹Ê+?€)\€F)?\>çã…&?€³*»}#?ÊŸ˜?Àt6>â>ŒÀÖâZû>~øU¦Ç?šÃèšÛ?÷®¬Qs?|ZÞó?sAqµl?€×ŽB\ó ?ÀÚTÍ#?€!ò8%?À¹K1×O'?@•£NZ)?¼Ï“$S+?€t`í5-?¦»¤iý.?×÷ªQ0? ¨f1?lŒ¿µ1?€âía=2?À/º'E¢2? ø:âëÝ2? í6ô½ê2?@ž€nUÃ2?àèOÛXc2?ÀK%×1?Àñ7ºÿ0?€ ›%YÞ/?€¬}ЋX-?€¸ßˆs*?ÿz¥cl'?€¼qN$?(8n; ?ÀuJa¢â>`€ªSòû>ˆ©¸ÖG?GO²¢I?Fí?má“??-’)?ƒ¦$N`!?nòVq¡#?À uyWÜ%?@Ž¿+,(?1y:*?À÷”DV,?‹Wn`.?ÄÒÈ)0?`n/… 1?à‰—zë1?€°¬“«2? _íbïL3? p…‡Ê3?mR[Œ4?à¸A";4?À"qѱ4?`ît<’À3?n.3?@¨˜‡›@2?ÀåP\è 1?~ /×7/?€Lê¢^ú+?ÍH(?€+…ÝC%?:éÆÓµ"?8× ã>ü²¼ü>òÎREË?@kѧ?«8BÎi?3ʶP+?þüe·ë?€îªºÔ!?L€8b/$?À¬l¡‡&?€à¥teÚ(?Àé&†n'+?@ûšPk-?€þy¾#¢/?ê fã0?`KÅŸTé1?@‰ÿ™Þ2?ÀÛ(©Ø½3?@¹Ë9q€4?à8To5?`Ê:—Ž5? à—ªÆ5?àN¯Lÿ»5?@83R†d5?€g!ÿRÎ4?Àˆ`¯Ç3?ÀÅGîg2?Àö\Q¹0?zÑÛ -?€·ÀœÑ•)?€¦ç[e¯%?€º’š¢"? Xh°oã>BÔ(ý>Ü·ÝÔN?£2? ’Yç?.Ÿ}Ê?÷¹˜…°?À…âcL"?×K±/Á$?@™ ì6'?€Àõܾª)?€Pz Õ,?J(C.?à{4Céz0? áR2x©1?@aé»!Ï2?€¯Ηç3?€ñ…¾$í4?àì¼ÏcØ5?àCòÔ 6? u6œ§87?ÀSè•7?@LRÂ_¦7?€äÈ÷È]7?ÀY}(kÉ6?@Û<â§5?€6ãÑ4?€ú©6c2?ÓŽ„}/?-Å£³w*?€ <­YA%?7–sÞ?`ÄÀÓã>(¹Ì@Àý>nÊö?Ï?0œvb? ëuÛa?y3Ó g?€ëgÌŒ9 ?€Î.ºvÃ"?À ¶R%?ÀpEfZå'?Õª„|*?&gûÃ-?ºèµ/?€b_B]*1?m†Kx2?@ÎjõÁ3?`®RÃH5?€¬Ê€66?à_!1³S7?`@úfUP8?€äÊPÑ9?àI¬ŸN®9?à]ôrïê9?`îê¾9?ô_—K79?€`ãСü7?€_S&6?@MŠ¢®»3?@ÙþÈÝ0?€bét+Š+?€ C¬uY%?-Þ!#!?`Ô‘2ä>ÞÄÎOþ>òÜ…I ?5¢*º?DK¢×Ö?úŸ´ü?€}Áô– ?€6ÍQ6#?€gL ¼ß%?ìgŠ(?ìhªJ+?¼Š7¬.?@®ÙBÚn0?À{Á¹-Û1? |Œ8K3?`!S9ê¼4?²…Ð,6?@Z{Ž•7? fý1ï8?x{.d.:?ÀÀÜa—C;?@EÅ5¬úPtÓþ>*zý¸ ?…cšÍ ?v2Ò£B?Ä—ƒ‡?¹Úší ?z^Q¡#?@+€Óc&?Àì0ÏÄ0)?æ|e3 ,?H—Âþú.?@:åÛý0?€•Ž7(ˆ2?Í1xS4? +ìÂm¹5?`¿–¯.]7? ÿnL9?`*hÔ—¤:?Õ°Ó5?@ ¥¤Ä¼??£û- @?@À;‘Kô??@9L³²>?FÍÎËL©JGÿ> X‚ ??8éQ?††ˆâ¡?r}c‘?€’ž:!?€ÖÒ’Ò$?@ÄËmÚ&?ÀÀ‘i Â)?À-pÅâ¾,?@§‹^PÔ/?`µ÷îÜ‚1? ÛU‡(+3?ìe.Uä4? çdÇ ¯6?€yCÕŠ8?@cüé]u:? y=ci?à qF @?ÀˆîWý@? ªÆÎ±A?0‘”Û#B? §yP±OB?`](IšÎA?€þ:·/‡@?@Ô³N”(9Fº§ÿ>øï“m ?mj»3?1´kñ?Å]h?øæD{!?€B“çPQ$?€_5ä?'?@!AG>*?À²ú·þW-?€S¯ÐH0? HþÐ=ø1?àYr4½3?à¬Jªš5?@?v]“7?À㎳b©9? ÐÕkkÝ;?@n*£->?€Òæ½÷I@?0ÜYT©A?°ÌRã ²B?à*à0@ÇC?°5ðý¡D?À4"ñ7E?@öV‘‹ E?§kßC? Ú›"HA?À—Ë¡Æ9?€¸N©¡*?ˆ.Q¼ç¾BáÜÖÝ&¿ÀŸkYFå>hþ²ñÿ>(yÌ…¬ ?YÅs°º?S/z.?s™‘ò¶?IŒó­!?ÞÙΑ$?ŸÙ~W'?€ÞÆ7|Ÿ*?Àaå(kÑ-?À,á”0?à/M¹X2?€§î4»64?`êö½®56?ÀT•í4Z8?`&u£©:?`ÁLøÐ(=?€Îé Û??`#ˆGA`A? šéB?ÐvŠQD?ÐkÔEF?À+ ó/‰G? µØ®!ÉH?`^XwÁLI?ÀÑ2¤©H?@nëømF?@¬ßhCœ@? HçÑ`,?€+Föœ*¿ *NŸÜsD¿¸e“Ífå>T²l?¾:°IÖ ?«[þÐØ?.ðÚV?…±Òë?€-öÏÎ!?(yëØ¸$?€¼÷¶¬Á'?@Åo 4á*?€`¸l‘$.?€,ò®øÉ0?I"ž•œ2?à«UDÿ4?À^e &«6? âÞö8?àÕz;?@?5ß@>?@.7oª@?°¸$¼•_B?Â@ùÀBD?—iðRF?PÆ®r‡H?1=‘ƒÉJ?@H<3M?@ ä;ÄN?àAÊtúqO? ¼7–lûM?@ßïF“xH?€4)xs7?À¾ÆŒU9¿ÀÍ Û}¨X¿0¬÷uå>Î 5Ü?oE’é ?©ª”æ?ßÁ i?PËK?d3xÜ!?0vR Ë$?ÀØCÓ"Ù'?@²{Gÿ*?€ÏU-êK.?À‹Bä0?@€¼¯iÀ2?¾Ïd¬Á4?€Š *÷ð6?À§ÄŠ4Y9?àW¿œòhñó?|3Ûùå ?‰å}£ã?Oéjšd?,Ôû?€õF4,Ø!?€¨OÅ$?€·ìÝýÑ'?µ J÷*?€Ý­³“C.? n²^Ýà0?€Iê]Y¿2?`ñµ”Å4?]i)þ6?€ Ô v9?álÓÞ?F>¸ ?DB:Ì ?LôaÐ?uG•ÜI?<ÞKØ?‘vlÙÀ!?hð l§$?Ày‘ï«'?€ÍT±âÇ*?@‚tTæ .? ^«dI¾0?@†;Ô–2?À½â†—4?`ˆ§üÌ6?@* tËC9?ÀÞ4´ç€¸?iâÿ>žl— ?-*¢ú­?©„ªa? t6í˜?€šnM×!?rÄOºr$?À&jNh'?w¸úér*?€?üŸôŸ-?@Ï)+Ä|0?W(ƒF2? §”–64?@@2šŠW6?@*°iåº8?@dö.-v;?`¾'Á§>?ðbu4=A?°t¾Z–C?`‹KfûŒF?àî„zjJ?Àç µ ¢O?è@LÀõ}S?a³†äŠY?8·ÛZ>¡`?Ó‹Êâe?øáp]³Ól?øuÌ“µÀr?Œ`œI­x?Háá7”?ÈuîøÒ‰?pôb3 å>@CIÉ—ÿ>";”] ? 3[~?ZS=ÂØ?úGL¸A?€7>ä_!?€ œæÌ)$?Àà@Ÿ3 '?ÀC*Ôû)?€@åÂâ -?@ž¼”’0?@ãùâ¼Ð1?À±þ¹‡£3?Àü û¢5? Š¨öÛ7?@y/µ)g:?`í·c=?PùCr@?@º ŽÇB?DæJØÆE?À‹÷ÇóI?ÀQ(S™P?@ÂýÜw U?§,’Na_?°ò?ð%”f?œ÷ã€cp?¨ì~ÙÍ0w?à *VI¿~?ªa­v¤‚?Ô6¾Ç⼄?41ºAƒŽ?D„cÐä>ž’ o<ÿ>ݼØ3 ?€m%#D?€Ç—Ì“ˆ?€´|ú+×?ƒ÷?Ÿ!? ÊyxÐ#?À¨þþt–&?@ªó˜›h)?e 2O,?€ŒS¶@P/?à'BÄ:1?`C’+àå2? Âkƒ¨²4?€ßúh‚®6?à¹*m…í8? +YJ;?à8OË É>?`!3~A?ÀÜøÏíuD?0«É-«I?{ÌŽP?˜ü*,+WX?€úceuJf?ð󫙀r?H¦ë9—Q~?¼Rïnø†?`^„¹¥[Ž?½Géí?HôÏf8ê?Ð1,>æ-’? TàŒä>@¬qYÕþ>+†þ7µ ?äÚ©ƒ?€H˜×=.?€:PY%_?²kË ?õ‚«k#? bˆ5w&?€+Õ`Á(?€¹×šy+?ƒ~(×?.?€vX®ÀŒ0?ÀðɉW2?ù´Û•3?@FnB5?ÀQþY;7?à€ióA9?ÀÁºí–î;?@¾ð¥??àýq 6ÑB?ºPHuH?øÇ]™Ô6R?xƒí"G@`?pX«ƒeÃr?Ƶô‘ñà?ÒÊÂÌÎ?ò.IÀ3˜?ÀsqÄÛÄ?P[¥ë# ?x¯°uÌ{–?°rJ#Š?¸,!JEä>~¾°hþ>ohøV ?€’$¬½?ù’ºÎ?€EU:Tà?ÀO_Ñx ?€%")#?àõ¼3Õˆ%?à41¡ü(?à[…n–*?ÀÍJh-?À¥ë Á¢/? þÁ1? %G—]2?@þw­3? Ù½wS5?€éÔ‡'£6?À‰©8?@H«á;?Py$Μ0A?°‹‡ù÷H?‘ÃWʉV?€Ôª`¸\i?æÜ/MvK?_ø?Ú‘?°ào0%­Ÿ?²-Vlúý>X8§yø?€ûQkŒw?€QgŽFo?8†NÎa?ÀJnÁ†& ?/¦l(—"?€ïí‚àþ$?€/;Y_'?À•ùÎÕ³)?`@‹ÃÝø+?À 9¢F*.?ðQÒe°!0? Vß1?à¬Vó2?À~#ûó2?@iתç3?ÀпËé@5? ­8?c!•žï??þâˆÀ¡K?€>óài/_?z)°öõJu?º€æ®öB?©«‹c‹J ?C.ÜÑˉª?héÐ-æ?¯?â´ÍÁ²ª? Î@$EO¡?€çb£~?°§¥î¯ˆ¿Ø~€×¸ã>ZÆó‘ý>«ž¦Ÿž?€”àœ5?«bó?€Sº‘ê?€@´ft²?@O3óâ3"?€}O~$?Àq°>žº&?_q§à(?`;· é*?€ˆ®¿ªÊ,?¡ë˜ z.?Jô'öé/?pܢǛ†0? & Jñ0?À3'§ÑK1?` ôz2?:°9N¾4? Ä¿Ÿ¯Þ>?¨Öéõ¥{P?&ùEß|f?¥ |¥_?$GÁ/Yµ™?¨˜‹#ô’©?Á!T"²?0&´LkV±?œ¨ 3‘B§?¿0‚Ì­—?°úΕ·4?A²݃¿¼SÍèzã>ø$õ·3ý>¢ÓÏÑM?€ŸS‘ú?€~j£ŸÄ?€˜ uü€?€n%€m*?€ÃXçÝ!?nZ$$? {Ñ3B,&? ×Ç;ï*(? 5äòàÿ)? Š%Ũ+?`Â)Açò,? F½ ê-?à|e«õk.?rmKl.?ÇCÅ.?`à¹Vß’.?@OF2? 't5??î¦b¼,T?Œé øAo?´Üø‘щ?@GÃ7¥¢?íº_0m&±?‹ïd¸Vδ?¦tÓÈÄ$°?X’¾U+¡?àÚ‹®9Œ?.$¾ÁZk? c7”åõ}¿!˜DFã>FåÔãü>Õgù¨ ?€µ)" É?€.pÙë?€Ó5ÌS*?€k³¼?€™dñ—!?À+ Ÿµ#?@Ö Ý½%?1 Ÿž'?@Ë^.£M)?”ó£¹*? ÇÄÀeÌ+?å舴j,?`i&zqu,?Àç:ýÁØ+?à èÆ*?`ÈúÌJ*? ý,mN0?ÐYË–C)@?ˆ!å—áW?ÆÈ˜âs?G³ó[Þò?¦l4ÕI §?ªøÉ-´?·ƒ*2xµ?àÜŸ©ë"¬?0UB™?PFM&É‚?€RH9i?ä‘@?ÕÆã>Xð#¥ü>woΧÔ?€Ç÷á.£?…Ü›O?¸€LOê?€­m‚l?€ºA³f!?Àç*¼ay#? Z1ˆs%? ^\“aD'?@R2-Þ(? -Í.*?`®›V+?À†8¡‹+? ñŽÕJV+?pÚýwe*?€6ŒåTí(? ´—š°^(?€+ZÁ.?² _oš@?Xþ?—9Z?:Ÿâxk‹v?·ŒÂŸr“?H[ã‹€ª?¦n'Ë}œµ?«Õ\’Wµ?$5Ì{©?nÍO"•?àŒ«j€?À쎠…t?qŒT…?,HØaྀËhPRà¾Ð[§4à¾èŒ.“à¾ÐuøÈ”ß¾ÀLKeøÞ¾8³.¶7Þ¾˜xÅ÷Oݾ¨`½æ=ܾ ±JßýÚ¾]¬ŒÙ¾n å×¾¸:}Ö¾Ø@ßêÓ¾ÈÒ}‚“Ѿp„hÃý;P¸dý[ȾP߆G¾€Ÿ:n•·¾À^XÔ£¾áŽP%‘>Àbв>^²¯µÀ>ðÂc÷èÇ>à1d ÚÎ>`ÐpºÒ>Z<íÈÕ>@Œ(ŸØ>`¡ØÈ‡Û>°87Ëãß>H¼°Ñå>\‚¯3ö>LÅ°á˜ø¾VTdî‚ø¾t;¬Vø¾òj»fø¾6̯¸÷¾T`×ZC÷¾ÄKWˆ³ö¾ÌO‹ö¾¦±©é9õ¾VZ/×Jô¾ {n6ó¾öLÂîùñ¾¢Ö:è’ð¾ÂãÀþí¾8Ï%þ{ê¾Ø~0’œæ¾Ô^¶Îaâ¾@øÇŸÛ¾¨fÜÜѾ …ôwG¾¾@¼LЩ> §˜%-Ì>¨NUÉÙ>´Þñ3þá>¸ö…÷;ç>Èñâ 6ì>(2ÌÝdð>X}*Årò>|úþHô>ø£Îóö>€¢…6`ø>P½ÞBƒü>qKâ“‹¿¬L&|y¿-âÚþT¿ƒ"ƒ¿pØ1*ҿЯoÔq¿ã™ û¿¼^+Yl¿’S¥cÿòüÜÈý¿—ÅHû¿ºåw/%þ¾ŠûlÑû¾>C$þ1ù¾žÂŠ–Eö¾H u³ ó¾dŸÛ3ï¾àí]ç¾`}g|]Þ¾ uo&ʾ »½³>81£Èf×>8wõ,å>pZé0î>؉¦†ó>”Øš¿º÷>h+Fp“û>Ü1nõþ>@¡¤¦Þ?NîäÓÒ?2»µe?8)p¼?m‚âÄÜ ¿ )>Ýà ¿3lE‘ ¿Ri(E ¿”RÚ>Ý ¿c¶PX ¿h怴 ¿zÀÏŽï ¿Ç‡ u ¿ ³ø^õ¿Ö m^¸¿äÏRôK¿‰y­¿¥Ù¿¾¾å›ÿ¾ìÁE!û¾âöÓ3ö¾LJÏں𾠲>æå¾ÄóíMÓ¾€õ)¶¹>wΞHà>¦„hí>¢7ÚµXõ>„å”i°û>*è•ðÚ?ªýŠZœ?ÔbÞ ?¾#Q?xVSIb ?Ì`ˆ7F ? ¨?)?„÷¯g£¿€sã†Ä“¿€(–C2t¿mD¿ã²E¨¿€­Ю¿LßuG¿€éq‚fË¿š×ºÀ8¿Ëð¿2UÂ8‡ ¿ï?dÖ· ¿y£vͦ ¿‘EhP¿å¶„±¿üsÈ¿nî’?'ý¾Ô}ÁÚ+ö¾DÙ3 Ní¾X(L¦¡Ú¾àµ”D»>xíy[»ä>öµÀUó>Τ˜|Îû>B*?äÆ6Ó?Ž5—¥Ã ?RRÍ ?ð r5Ø? ²ÉÄ3?r¼Þ Æ?D ?€ª‘è¿ÿKF€Õ¿€¹-°¿þѾøv¿Þ¾¼)¿e¢úÄ¿€€’MI¿€ýL gµ¿€x‚Ùö¿€ã~Äì:¿€ò6‡åI¿èÌ˲2¿îÚ˜÷å¿§N] ¿ÞÙß ¿U¶ïÚP¿î_¾a¿2hµ 'ü¾ vA»Õò¾µóÁá¾`Ö4n¸¹>€jg§òè>Jì&ú†÷>|EwC?Ⱦ֙?@ÁrŒ­ ?/ò¨Í)?›ò57?I¶O÷õ?xíÆk?2ÚÐ3À?öTZ?óá}?¿€ ¿¸*¿áÿ¿é ã—¾¿'Jä²e¿Ÿ2<Ðò¿’rLuc¿Ž®Ð·¿)Hùn÷¿¸Jò™ ¿€­ÎKö¿€_ÏÛö±¿€ß¿³­=¿€”† ±•¿h¢¬äl¿bÚ: ¿* l^¿&A­Al¿&’©÷¾ìϺKEç¾`I¢¸±>Ðí–Çì>Æô³ùû>ºr›Æ?B…e@c ?!'Mv×?*ûw~·?hPIQ:?ý zÜH?w,å+Å?CUYêt? ŽCÙì?€¼ö/«¿÷s”¿€‡æ±oe¿€z~L¿Û7D;¼¿ÎVhD=¿€þuÈ.ØÄ¿€)Ð\M¿Sì ¿¼g2MÏ¿€'ÛOa¿•¾‚¼¿2“ŠÚ¿€—DvB·¿ ~ØÒM¿<é5 ¿9Œþ<:¿8×éñTý¾Üü,Þ;î¾·1o>ô¥þï>[c4?~D‘Et?FÒ¶C?cvô?˵Ód¢?cø>˱?ÈVºý-?8ª1"ë?›+ùpa?‡l_=?\Zÿ"¿£ñRÂ"¿€ÜÄ[¾î!¿l«Î{È!¿€È”!¿€Šæ¿JP!¿€ÿ9Yâû ¿€Ç[V™ ¿€â•]+ ¿€!¥3¿ÞaK³Ø¿ÐÐò.G¿³ˆ$w¿pƒÚ2a¿€ |z^þ¿Õ¸?H¿€Ë˜Ê9¿WIv ¿:¦- ¿ôk’ó¾€›¨ ¼¾Îæ_"ñ>ùÀ<ú\??‚2L ? ;ºÝ ?Af@º?Ó0ÎU?T”z¼?€´p i!?€Ç¹¸÷«"?Á|¦Kô#?€P¥j’&?€d®3ía$¿_U$¿€gÖ";$¿Þ«n$¿.A£Ý#¿¢Qàó–#¿€áMŽÛ?#¿a¼K×"¿‡øŽ["¿ê ÄðÂ!¿ÀQÿÙP !¿§=œí5 ¿»šy x¿ F*Ï4¿% 昿ÜPú…›¿€oÌw4¿Š »¿Z¨ P%¿äØZãQù¾°ŸàÓ–Ò¾æñe³€ñ>G|É`?€R®ØÃ#?1Ð8Ü ?Ï#@Û½?€u x ?Itö͵"?#åg*ƒ$?ttIíÜ%?€· â&?⃙‰è'?€ÁQ‰¼&¿¨t쑯&¿qœ?E•&¿€$gm&¿€þÎ8á5&¿€ÚГî%¿€Eﳕ%¿h ñå(%¿À%ƒÀ§$¿Qj3e $¿€Õ™ŸÖK#¿€SЪ­k"¿6¾çSd!¿Àžúkƒ0 ¿€T/îû”¿a·#”X¿€òØm ¿®1yÑ`¿¸»Ö’% ¿é3S„d¿¸¸_2â¾0õ;Âð>ð×%?ýN7*?Äé´ñQ?€h/Ë ?ÓÓ‘J#?€é~^¸ý%?€íÖ°Ý(?€´¦ˆ†b)?Öb Î)?€¨j2v )?€8Ò{/$)¿Z…ÖY)¿uqÔYý(¿€’Fx„Õ(¿€ÙIÕž(¿Q3rèW(¿l’Àíþ'¿€ú<ˆ‘'¿éòáî'¿@þÞä‡n&¿@߂٭%¿À§Î´ˆÈ$¿€N,ÿ¸#¿@ˆ÷uÌx"¿@¦Ð¹!¿ë:ƒã‘¿å D’’¿ ö³ró¿š›?¦¿*‰ aA¿ÃsZüî¾Ü7Åäªì>U€ÇºL?¿¶ë&?ñ.‚×?€zéÛÇ«"?QÃð”&?5É!µå)?O5#`,?€UšÌÍ-?7׋Õ-?Ͻ{õ*?Ÿ¥˜+¿€]LŒ+¿€l]ÃCs+¿ä~\ÜL+¿€UÎ+¿€¸c/KÓ*¿€鯵|*¿}Šš¾*¿@×lUˆ‘)¿ÀÍê^ó(¿À½ R`4(¿Àö|§O'¿@¨¡o:>&¿@NÚáø$¿…Ÿ–Ÿv#¿€Õâs}­!¿€„CY%¿!£4¿úÞÆîr¿fð¿"˜ ¿`È"Êø¾,t½ÈÛâ>_>ºš?Dµ8Îö?€‹'¥¸I ?ÉÝ÷Ž%?÷ò²Þw*?Iõ B¤.?€Ù¹<Þ0?a˜NªÏ1?ž_Va2?€)Ž;¤3?€[¯¡s.¿çñÇí .¿L(¿Œö-¿€1‰5¢Ò-¿€ P.¡-¿€_£ƒ‡`-¿€5!‘ß-¿Vcµ“©,¿@¨ª€§/,¿@˜«i˜+¿€R‘¤à*¿À9Ô÷¾*¿ÀæÍía÷(¿ìø¸µ'¿€õØyF3&¿ÀÓèÃc$¿@¿Õ¦9"¿€â+xaG¿€Aí‹%¿€=ŒT‡ë¿Uú‹ø¿À„¢e`­>¬`Tp? Œ[?€^x,·1"?£/åÞÎ(?€§“ Ý/?€}¢nß;2?$1C’'4?€2Gg 5?Ñ®¼%5?Ââó-¿@6‡=R—,¿éüœè*¿@SÄ“dÒ(¿‰Ž£q;&¿@ˆYpp#¿€+Ù(Ú¿€`={T¿…´²Ð¿Øš9€Ó÷>Sjþ©ú?€Œ‰¢`%?À×7TŸ0?@¥äcŸ5?uý¸¶:?@é$ië\>?@Cû„¯W??izAÐÓùI5ã2¿€Ú‹§Ø2¿À¯o È2¿À<¹¶@´2¿@â¶’[š2¿ÀØ—Šßy2¿ ;?R2¿ÀL*) 2¿`‘Áá¶á1¿@}ÎË6”1¿RT‘31¿%Û‚º0¿@ÞÑ#)"0¿@>${.Ã.¿@JþNÚ,¿€yºSµl*¿BÔXT'¿@óÊ¥Ùb#¿,ý½‘¿¿@4¿€cR’¨¾4u&â?€$_Ô‘Í%?€¦ÝÎ1?Ãsl9?•-šÆ€@?€!{ÞÝ…C?€_Xû~D?à‘9×ï·A?ÀÂ(™h`3?ÀLídA4¿€˜˜ÃÐ>4¿ƒ“Ë“94¿@¹é‚14¿À"ºX&4¿@( b¯4¿€RÎr÷4¿Àøÿkí3¿ 'úÎŽÐ3¿Àú¬Xº«3¿`Ú¦ûo}3¿ ð¥C3¿€P ) ù2¿ ×8+š2¿ qð6Ž 2¿`š»ù:‚1¿@’úO[³0¿@ç ÕIG/¿ÀJgåz,¿¿Š©–È(¿ÈìA‚æ#¿€új­Áí¿cûqÆ¿–^ þ?€|3nWX$?âxäè2?@翉 a=?ÀÊgë‚D?@2± J?@®i¹B:M?Àz3OJ?ù¸oñ:?@2ÈÿU—5¿€øÙ!Ô•5¿ÀÙ7Æ’5¿@¿yŽ5¿@hÙ‘ ‡5¿€ç–¤,5¿€ÆXÕgt5¿‰¢JÙf5¿ÀHt“'V5¿€9l›@5¿`¡¾µ%5¿€Þ†vŠ5¿ ä¹ÙÓ4¿`ƒ1C‰•4¿€æ×ÆîB4¿ @®ÏãÒ3¿à§²q–93¿€¥ Ärf2¿`@ TB1¿@µä-Z/¿@aœÊô*¿@¤¸M;Û$¿€ÍÛx›Ò¿vv#Ö¾õ'jS?@íó7ƒ2? ÐÊéE@?€úz–hI? ŠŸ:ȨQ?°®ì•›OV?`âÜžäW?`ùq{ìÐG?À÷1ðÈî6¿cî6¿@ÑÝtší6¿€8g4pì6¿oæê6¿> Éúè6¿ÀP&ó¡æ6¿o?ö¿ã6¿ê ¸,à6¿ A¨uSÛ6¿à~ Ô6¿@ 0D»Ê6¿ T™Ñó»6¿@l{N¥6¿ ö!P‚6¿à×µü.L6¿@ØQ¾ø5¿@ŠQÅÙx5¿ @Ò¶4¿€¯%§™3¿ ­RÝÔ1¿€sÓ}.¿€Á‡ñÊ&¿€‰QüŽ¿ P£Ðà?‡(í@ò.? ±ï¶Œ¤@? à  MM? 5PY#tW?€›¥8þsa?ø'µsg?@À>Kš˜Z?ˆÉC¡F8¿ÀM&­VG8¿@BÛÏH8¿À-÷s)K8¿@Ì¿,ŽN8¿€ V6S8¿@›7eY8¿€¿¦+ha8¿€»*ùUk8¿¼œ âw8¿àɹ ‡8¿ Oq½˜8¿@{ÎÙ{¬8¿ æ¡æ!Á8¿@ÃybÔ8¿@œ/â8¿`ñ‚€=ã8¿ Ü­­2Ì8¿ 2ùÌ@Š8¿`ò2,„ÿ7¿q ¹vü6¿ÀuÜ}55¿À“!ÌÆ12¿À½ÏÅîI*¿õ W&Á¿€ƒÓ6ž5"?€ïè"ÎE>?`0Þ¸² O?P]l<è\?8ɼki?0K¢Ü^w?Ô7—?q…†?€'.Ä9¿€ò†Ÿ9¿€z$Ö$£9¿ÀE©“ר9¿À­ž²ò°9¿CÄGê»9¿Àðº¡TÊ9¿Ð«ÞìÜ9¿€Ì^ô9¿àk¿ÊÖ:¿@Ñvø6:¿hmÑ™d:¿ ;‚ˆ÷›:¿ÀçÉõÞ:¿`ų•+;¿àõ”Œäƒ;¿€K#œœä;¿@ÈÄ ÚG<¿@0¯U¡¡<¿ÀyÜAÛ<¿ Œ‹XË<¿`?¼E%<¿ qøTqa:¿`)ٗʇ6¿€Ö38Þÿ+¿Ì×Iô>†.XöÐ:?@4«½óP?ˆ 6^R~`?Hþ¿Æ@þl?œþ,ˆx?ÖÞ.(gÀ†?@¿=%ó:¿@K¼qØõ:¿™áeû:¿€ªäQ;¿€=9Âz;¿â­+!;¿À¶(7;¿€Î¯ÙaS;¿ y˜¼v;¿À)ï’¤;¿àZ"ûbÞ;¿@<Ün´&<¿`ƒ Й€<¿ ‘0ï<¿à¬”;Ÿw=¿ºìW’>¿ ¸Øâá>¿ æÑ±8É?¿plïg@¿°A='¤ô@¿@ÐæÓ¬yA¿0¬±KÙÎA¿ÐÙxµò›A¿`ŒÐç÷-@¿b R î5¿¸[¼¦ôã>€Ö_4w¢D?°Ô³eöZ?¸azQé·i? N*>ßÓt?{DÅ'~?<]pd7Õ‡?@„¾ÓE<¿€’ŸPI<¿€u¦ê|P<¿Œ½[<¿@<&W¯k<¿Àó‚3<¿ZSvv<¿@œÖ­Â<¿@,ݰÌï<¿`@@{+=¿ /÷°aw=¿@mãSH×=¿ ó½s%P>¿@‡b%è>¿ y²:€¦?¿0׎J@¿ oÈàŒÝ@¿¶i~À’A¿@9Ž¢“mB¿°Òj|ØlC¿¬ž–m€D¿ ÏpE¿ ­|è!§E¿ äÛXÂC¿ÀÚâ÷¢ž3¿€Ù6YüÃ$«Íˆ?€ø•¯?4mîƒÙ?@O)m•=¿€@& ™=¿À¼\€¡=¿Ås®ª®=¿€f•RÁ=¿eE|Ú=¿€* Žû=¿ÀM©P_&>¿µr%\>¿@Ÿ[—„¢>¿ ­h€ü>¿K lo?¿°Hôa@¿)Ã]@¿PÒÓ@¿pžzÒåhA¿@Ðâú&B¿0ÉsU¡C¿Ð¤´«@D¿@ƒY|‘¦E¿°iµö»0G¿Àz?yH¿ o®B*GH¿ Š÷ Ï_C¿¼3Õæ<"?h¡CV`?(ùŒRw?œº]êvøˆ?@ãdÑt–?4ÎV\4f ?òƱ¿G¥?o kYÆ…©? ´–%à>¿@¤þ“ä>¿Àc.þí>¿À¾Bˆü>¿À‰E‹q?¿`‰ +Þ+?¿€dÿ§çO?¿N—~?¿`l½\N¹?¿0/Í-@¿ö×4¡4@¿Ð Gçs@¿pQ(øÄ@¿h­-A¿@1lN˲A¿À ë£_B¿ ¿Ÿ$ºI¿P¶^J¿`rõ¬@H¿àwáxä6¿@ÞŸ³k V?„—ÏjKêv?wœ?d{ÛJþïœ?Žoz;+]§?f„\.SQ¯?ºZj/;á±?0ˆèLn°?°S`@¿0é­@¿0ÓJ¶e@¿°K ’É!@¿šñ8=,@¿Àb–uQ:@¿€1¹oÍL@¿ Î?ñ¼d@¿ÐÔ©{Ù‚@¿_ˆiiª@¿ J¦MÝ@¿ÐQJZ¤A¿ð–¥ÀrA¿mðæ`ßA¿0f6ý#lB¿`ˆ„#C¿ÐjÙD¿°²Ÿ$EE¿0vœb˜ÌF¿=¬EΠH¿€uXùÆiJ¿¬lC¤¶J¿²fa£D¿Àýè Çë,?`ÿd–n?öH¢Óˆ?ÚXR¼÷$œ?9v+Œ®¨?3X "б?ž{ "sZ³?p«×~ A³?‡ÄXdï?°? mÓpd´@¿°æ X¤¶@¿ÐAá@»@¿ ¾”uÂ@¿Wc¡Ì@¿¥«LÚ@¿Pçz‚3ì@¿ÀwËÎVA¿8ørjh A¿X,}I‘FA¿pubÆ©wA¿ðo´Æ¶A¿ˆ* 9B¿ÀóœëÎqB¿€\CÜUûB¿à?Nß5¯C¿`*=ãšD¿ \M¹ÎE¿P‡Ö‰TG¿ ÃmòoI¿0àS ˜J¿÷­ä{I¿ +…}Z;¿øÄâmR?°¾ X|?¾™8žÄF”?¶lã¢E¤?¶YûŒ(˜­?)—u°?‰xB®?˯Iª?4a·ðëÜ©? Çá÷(SA¿P@Ï ?UA¿`…æâƒYA¿@É*`A¿ 9t…iA¿ýÁO vA¿ B²]†A¿t¢ç^›A¿¨@RÓ¨µA¿ˆ¡£ñØA¿Ø÷¸Š$B¿ØóšNÀu÷×D¿à°íüïE¿°»# ›PG¿Ð bƒCßH¿°H'#ÃÝI¿©r8G¿À•Ú/7¿&¿Mq$\‡`?¼|¢I¤@„?Ž VâC”™?0ç¼¢¥?fr{Ä™o©?¤ÕÐS¦?R´Zⲟ?Ør›º¡^•?À (ü-?cm×ïA¿piôªñA¿F×dõA¿p‹N8,ûA¿Çø ?B¿ð@Éú B¿` Ï ÚB¿X·Œ-B¿@ÈÖ…CB¿0þ@<þ_B¿xÃ$œ?„B¿p¨È¤z²B¿€."ÍíB¿ OÐz:C¿`àUžC¿H†Z­F!D¿¾až’ÍD¿¿@$»®E¿!WçÉF¿¦À×üG¿ðšË °|H¿p‹$hÁôD¿þT¼‘ü¾°IZ‘Þd?€š;¤ à…?ÔÆÎÐu˜?H˜ß1£|¡?ŒEÈ!謠?ØC@1K—?ðYbÆÓl‹?†xŠî^‚?@ìêÇYD‡?à¼Z²ŠB¿Ð$Œƒ0ŒB¿°ðwM8B¿PñŸá“B¿Pò ÖRšB¿=Ä¢B¿Phȃ­B¿èñþºB¿oÃsËB¿hvÔŽXàB¿`YÃU{úB¿à)<£?C¿€ì¥DC¿ÈÎ —kyC¿X{{Y[½C¿ ±±›D¿8¾W߈D¿  s‡E¿ bBÞØE¿ØÓÊ›F¿èGÒ°®ÇF¿°[qX%·C¿Mò¦cj¿èÁßEP_?ø¸Ú6›€?¨gñ‡ê?˜‚ò/+•?à_M)$‘?ó8‰|„? CVìÊÏv?àP™fªWu?0½³S:…?p¥$C¿Ð“q,%C¿:;j'C¿PçW#Ï*C¿°Kf/C¿p{Cu?5C¿ BørÁ¼y{C¿p[¯ï7C¿hÌצM©C¿ð·­ÈC¿hV >îC¿áÆßD¿°È¹7ÔYD¿È¼s†¢D¿Àk2íD¿ˆ"9ø[üD¿`ÂïÛXÌC¿@kbÜã:¿à‚ú8?ð.æbÀe?÷ˆ ÙYv?à mº3z?Àv9Rs?€‘úF®kc?â(ªTW?€À2þ±e?À­–­êü‚?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?ýÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?÷ÿÿÿÿÿï?ôÿÿÿÿÿï?îÿÿÿÿÿï?èÿÿÿÿÿï?áÿÿÿÿÿï?Øÿÿÿÿÿï?Ðÿÿÿÿÿï?Èÿÿÿÿÿï?Âÿÿÿÿÿï?¼ÿÿÿÿÿï?ºÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?ýÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?ôÿÿÿÿÿï?íÿÿÿÿÿï?äÿÿÿÿÿï?Õÿÿÿÿÿï?Âÿÿÿÿÿï?°ÿÿÿÿÿï?–ÿÿÿÿÿï?zÿÿÿÿÿï?\ÿÿÿÿÿï??ÿÿÿÿÿï?&ÿÿÿÿÿï?ÿÿÿÿÿï? ÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ýÿÿÿÿÿï?üÿÿÿÿÿï?ùÿÿÿÿÿï?óÿÿÿÿÿï?êÿÿÿÿÿï?Úÿÿÿÿÿï?Äÿÿÿÿÿï?¢ÿÿÿÿÿï?tÿÿÿÿÿï?5ÿÿÿÿÿï?ôþÿÿÿÿï?šþÿÿÿÿï?6þÿÿÿÿï?Ìýÿÿÿÿï?dýÿÿÿÿï? ýÿÿÿÿï?Æüÿÿÿÿï?¤üÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?ýÿÿÿÿÿï?úÿÿÿÿÿï?ôÿÿÿÿÿï?êÿÿÿÿÿï?×ÿÿÿÿÿï?¹ÿÿÿÿÿï?‰ÿÿÿÿÿï?>ÿÿÿÿÿï?Ðþÿÿÿÿï?3þÿÿÿÿï?aýÿÿÿÿï?~üÿÿÿÿï?Fûÿÿÿÿï?âùÿÿÿÿï?jøÿÿÿÿï?øöÿÿÿÿï?¶õÿÿÿÿï?Äôÿÿÿÿï?Dôÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ýÿÿÿÿÿï?üÿÿÿÿÿï?öÿÿÿÿÿï?íÿÿÿÿÿï?Üÿÿÿÿÿï?»ÿÿÿÿÿï?„ÿÿÿÿÿï?$ÿÿÿÿÿï?‰þÿÿÿÿï?–ýÿÿÿÿï?*üÿÿÿÿï?úÿÿÿÿï?T÷ÿÿÿÿï?Dôÿÿÿÿï?ðÿÿÿÿï?'ëÿÿÿÿï?îåÿÿÿÿï?Êàÿÿÿÿï?BÜÿÿÿÿï?ÞØÿÿÿÿï? ×ÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?ýÿÿÿÿÿï?úÿÿÿÿÿï?óÿÿÿÿÿï?åÿÿÿÿÿï?Êÿÿÿÿÿï?•ÿÿÿÿÿï?6ÿÿÿÿÿï?Šþÿÿÿÿï?`ýÿÿÿÿï?tûÿÿÿÿï?bøÿÿÿÿï?´óÿÿÿÿï?âìÿÿÿÿï?lãÿÿÿÿï?ÞØÿÿÿÿï?(Êÿÿÿÿï? ¹ÿÿÿÿï?Цÿÿÿÿï?2”ÿÿÿÿï?ìƒÿÿÿÿï?®wÿÿÿÿï?qÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?ýÿÿÿÿÿï?úÿÿÿÿÿï?ðÿÿÿÿÿï?Ýÿÿÿÿÿï?¶ÿÿÿÿÿï?hÿÿÿÿÿï?Ðþÿÿÿÿï?¯ýÿÿÿÿï?¤ûÿÿÿÿï? øÿÿÿÿï?øñÿÿÿÿï?èÿÿÿÿï?ÎØÿÿÿÿï?'Âÿÿÿÿï?B¢ÿÿÿÿï?ó}ÿÿÿÿï?ôJÿÿÿÿï?òÿÿÿÿï?jÍþÿÿÿï?æ‹þÿÿÿï?fQþÿÿÿï?1%þÿÿÿï?\ þÿÿÿï?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?üÿÿÿÿÿï?øÿÿÿÿÿï?íÿÿÿÿÿï?Öÿÿÿÿÿï?¡ÿÿÿÿÿï?5ÿÿÿÿÿï?Xþÿÿÿÿï? üÿÿÿÿï?Oùÿÿÿÿï?&óÿÿÿÿï?èÿÿÿÿï?Õÿÿÿÿï?¢µÿÿÿÿï?îƒÿÿÿÿï? 9ÿÿÿÿï?áÍþÿÿÿï?fQþÿÿÿï?¡ýÿÿÿï?ÜÎüÿÿÿï?àæûÿÿÿï?Ôüúÿÿÿï?W*úÿÿÿï?xŠùÿÿÿï?4ùÿÿÿï?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?üÿÿÿÿÿï?÷ÿÿÿÿÿï?ìÿÿÿÿÿï?Ðÿÿÿÿÿï?‘ÿÿÿÿÿï?ÿÿÿÿÿï?Þýÿÿÿÿï?sûÿÿÿÿï?‰öÿÿÿÿï?áìÿÿÿÿï?ŠÚÿÿÿÿï?ü¸ÿÿÿÿï?÷}ÿÿÿÿï?qÿÿÿÿï?zþÿÿÿï?õƒýÿÿÿï?üÿÿÿï?4túÿÿÿï?‚øÿÿÿï?œ4õÿÿÿï?Èÿñÿÿÿï?Š»îÿÿÿï?”Åëÿÿÿï?¨‚éÿÿÿï?~Hèÿÿÿï?ð?ð?ð?ð?ð?þÿÿÿÿÿï?üÿÿÿÿÿï?øÿÿÿÿÿï?ìÿÿÿÿÿï?Îÿÿÿÿÿï?ˆÿÿÿÿÿï?èþÿÿÿÿï?|ýÿÿÿÿï?^úÿÿÿÿï?´óÿÿÿÿï?ßåÿÿÿÿï?Êÿÿÿÿï?+”ÿÿÿÿï?P/ÿÿÿÿï? zþÿÿÿï?ÞAýÿÿÿï?h@ûÿÿÿï?°øÿÿÿï?$tóÿÿÿï?†Ìíÿÿÿï?Öåÿÿÿï?ò—Ûÿÿÿï?˜AÐÿÿÿï?•Äÿÿÿï?jé¹ÿÿÿï?¶±ÿÿÿï?œ>­ÿÿÿï?ð?ð?ð?ð?ÿÿÿÿÿÿï?þÿÿÿÿÿï?ùÿÿÿÿÿï?îÿÿÿÿÿï?Ðÿÿÿÿÿï?ˆÿÿÿÿÿï?Üþÿÿÿÿï?Cýÿÿÿÿï?˜ùÿÿÿÿï?Vñÿÿÿÿï?Jßÿÿÿÿï?ú¸ÿÿÿÿï?:jÿÿÿÿï?ÐÍþÿÿÿï?t¢ýÿÿÿï?ô{ûÿÿÿï?b²÷ÿÿÿï?hTñÿÿÿï?˜&çÿÿÿï?ž½×ÿÿÿï?•Äÿÿÿï?hƒ¨ÿÿÿï?–…ÿÿÿï?<ˆ]ÿÿÿï?Ï3ÿÿÿï?Q ÿÿÿï?D‰ïþÿÿï?”?ßþÿÿï?ð?ð?ð?ð?þÿÿÿÿÿï?úÿÿÿÿÿï?ðÿÿÿÿÿï?Øÿÿÿÿÿï?‘ÿÿÿÿÿï?èþÿÿÿÿï?Cýÿÿÿÿï?Nùÿÿÿÿï?üïÿÿÿÿï?ŠÚÿÿÿÿï?Œªÿÿÿÿï?­èýÿï?³›Îûöÿï?&ׂbåÿï?BQ€5³ÿï?¸Ómn(ÿï?Šc¶ ¶ýï?/~ÙÚ úï?Q®Ÿ³Üñï?–ØÙßï?Žù´]*¹ï? Æ×úuï?¦” -Kï?®w7`'—î?š]p‹&î?2¹[)âí?áÿÿÿÿÿï?–ÿÿÿÿÿï?šþÿÿÿÿï?Fûÿÿÿÿï?ðÿÿÿÿï?(Êÿÿÿÿï?ôJÿÿÿÿï?¡ýÿÿÿï?в÷ÿÿÿï?A\äÿÿÿï?xZ¤ÿÿÿï?¸‰Ñþÿÿï?`üÿÿï?\KXóÿÿï?:sÿÖÿÿï?3^;|ÿÿï?j8‹\þÿï?åñ“×úÿï?æÚúïÿï?kOžÏÿï?ÊÍsmÿï?.Tš&Qþï?t‹®E5ûï?¸ÍÐÚÙòï?–ØÙßï?('F*7¯ï?Ìh—´¯Jï?®w7`'—î?I‰§l•í?QGyì?ì,6*˜ë?ßåúÁ2ë?Øÿÿÿÿÿï?zÿÿÿÿÿï?6þÿÿÿÿï?âùÿÿÿÿï?'ëÿÿÿÿï? ¹ÿÿÿÿï?òÿÿÿÿï?ÜÎüÿÿÿï?±ôÿÿÿï?´ÜÙÿÿÿï?ØÅÿÿÿï?V^Rþÿÿï?3fúÿÿï?ÐÊdíÿÿï?m‹ƒÂÿÿï?p26ÿÿï?E,ˆmýÿï?¥Ä2¯÷ÿï?Õ°cåÿï?’Ånâ«ÿï?üù[úþï?pÛ“âßüï?_B'´®öï?~ ºn"åï?Žù´]*¹ï?Ìh—´¯Jï?ðÌòâ>bî?²‡xáì?ßåúÁ2ë?.<ͶÈ}é?µ¢²[yè?RX!iè?Ðÿÿÿÿÿï?\ÿÿÿÿÿï?Ìýÿÿÿÿï?jøÿÿÿÿï?îåÿÿÿÿï?Цÿÿÿÿï?jÍþÿÿÿï?àæûÿÿÿï?BUñÿÿÿï?ìüÍÿÿÿï?IÓUÿÿÿï?¨V¾ýÿÿï?|€\øÿÿï?ó99æÿÿï?œŒV©ÿÿï?¬OäÝþÿï?þãÄ9üÿï?$ÀVóÿï?Ö;ðÖÿï?¾±Azÿï?xyf;Qþï?1ö¬—¨úï?Ru¢bïï?B4u ãÍï? Æ×úuï?®w7`'—î?²‡xáì?¡¾2*ë‹ê?µ¢²[yè?K§Lu-ç?Xó,‡æ?´Î¦"-Eæ?Èÿÿÿÿÿï??ÿÿÿÿÿï?dýÿÿÿÿï?øöÿÿÿÿï?Êàÿÿÿÿï?2”ÿÿÿÿï?æ‹þÿÿÿï?Ôüúÿÿÿï?déíÿÿÿï?ÃÁÿÿÿï?Ì!*ÿÿÿï?‚."ýÿÿï?þs.öÿÿï?ÖgoÞÿÿï?På…ÿÿï?‡äžzþÿï?¸±Ô×úÿï?[‚H•îÿï?=ÐÅsÅÿï?×U<ÿï?E@wýï?+)ü­÷ï?¸ ¼ó#åï?N]}í«ï?¦” -Kï?I‰§l•í?ßåúÁ2ë?µ¢²[yè?§ÝpÔæ?Ò_ëæ?Æ}¹{;¼å?¦K¥XŸå?Âÿÿÿÿÿï?&ÿÿÿÿÿï? ýÿÿÿÿï?¶õÿÿÿÿï?BÜÿÿÿÿï?ìƒÿÿÿÿï?fQþÿÿÿï?W*úÿÿÿï?ŽÏêÿÿÿï?L–¶ÿÿÿï?Óÿÿÿï?7©üÿÿï?ç– ôÿÿï?æI×ÿÿï?ÆŸrÿÿï?ç þÿï?¤=3vùÿï?°£‘éÿï?IÁü<³ÿï?š8,úþï?‚•%õ†üï?Œ«ZÛJôï?Ýva|Ùï?¸[Ï‚ï?®w7`'—î?QGyì?.<ͶÈ}é?K§Lu-ç?Ò_ëæ?¦K¥XŸå?ÔÜIïwå?Å%/¦Ukå?¼ÿÿÿÿÿï?ÿÿÿÿÿï?Æüÿÿÿÿï?Äôÿÿÿÿï?ÞØÿÿÿÿï?®wÿÿÿÿï?1%þÿÿÿï?xŠùÿÿÿï?>qèÿÿÿï?Úÿ­ÿÿÿï?ý£âþÿÿï?Ö>üÿÿï?xeƒòÿÿï?â-Ñÿÿï?ø¨]ÿÿï?ZZ*Êýÿï?JéTøÿï?j9(eåÿï?l†‹Ó£ÿï?»»JÁþï?h'âO³ûï?Æ/0;ñï?(ÄíÉæÍï?rá[b\ï?š]p‹&î?ì,6*˜ë?µ¢²[yè?Xó,‡æ?Æ}¹{;¼å?ÔÜIïwå?HÚFBbå?:èú¤í[å?ºÿÿÿÿÿï? ÿÿÿÿÿï?¤üÿÿÿÿï?Dôÿÿÿÿï? ×ÿÿÿÿï?qÿÿÿÿï?\ þÿÿÿï?4ùÿÿÿï?8(çÿÿÿï?`R©ÿÿÿï?ä•Ñþÿÿï?ðàûÿÿï?wEŸñÿÿï?Íô×Íÿÿï?Dí Qÿÿï?ƒùÀýÿï?0­­¯÷ÿï??ûãÿï?^Hàëšÿï?‚Ãa¿Ÿþï?[$aÝ5ûï?F{»cïï?`}>Çï?=QODï?2¹[)âí?ßåúÁ2ë?RX!iè?´Î¦"-Eæ?¦K¥XŸå?Å%/¦Ukå?:èú¤í[å?iÄqŒWå?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð? ð?ð?ð?ð?ð?ð?"ð?#ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?ð?(ð?5ð?Cð?Rð?að?mð?vð?{ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?/ð?Fð?fð?†ð?³ð?åð?ð?Nð?{ð?ð?®ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?$ð?<ð?að?˜ð?æð?Pð?Áð?]ð?ð?Ëð?„ð?%ð?žð?Þð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?"ð??ð?nð?¼ð?5ð?ëð?ðð?Vð?Þð?üð?m ð? ð?›ð?ßð?‘ð?zð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?6ð?eð?»ð?Pð?Fð?Ïð?&ð? ð?Jð?‘ð?ìð?{#ð?»,ð?ç5ð? >ð?)Dð?sGð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?%ð?Lð?˜ð?(ð?.ð?úð?ð?ò ð?™ð?ìð?ß.ð?Að?†Zð?‡xð?K™ð? ºð?M×ð?híð?Rùð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?0ð?eð?Ôð?°ð?Yð?mð?ò ð?vð?/%ð? >ð?zcð?™ð?M×ð?€/ð?’˜ð? ð?–ð?Õêð?Ä:ð?ÿeð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?7ð?|ð?ð?Gð?¼ð? ð?»ð?‚#ð?Að?Èrð?öÂð?>ð?:ñð?æÅð??öð?²eð?ð?;¢ð?6 ð?¬> ð?ÁÛ ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?<ð?Œð?Bð?Ñð?'ð? ð?õð?ë5ð?Xhð?úÂð?_ð?Ì_ð?¨ñð?îEð?½ ð?1 ð?4ð?4ßð?rµð?K #ð?ó$'ð?²`)ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?<ð?’ð?^ð?5ð?Uð?[ð?ƒ#ð?ãJð?™ð?Æ.ð?Bð?Ï&ð?ÌUð?´l ð?1!ð?rµð?L¾+ð?÷4=ð?â;Qð?|fð?wWyð?^;ˆð?6`ð?ð?ð?ð?ð?ð?ð?ð?ð?8ð?Œð?^ð?Yð?ð?»ð?º*ð?á^ð?µÌð?0¬ð?kbð?ò›ð?ùl ð?Roð?MÍ&ð?-@ð?`h`ð?6`ð?WÍð?jÅð?V^ð?~Ó£ð?¶üÙð?¾÷ð?ð?ð?ð?ð?ð?ð?ð?-ð?|ð?Bð?4ð?ð?šð?ã.ð?rmð?Òøð?Ã%ð?â™ð?b‰ ð? ð?¸$ð?ÜØCð?ÿwð?Z’Êð?’½6ð?¶üÙð?©¬ð?æ¥ð?±°ð?–@«ð?«—pð?*ŒÝð?ð?ð?ð?ð?ð? ð?#ð?að?ð?Ñð?Vð?»ð?â.ð?Ìrð?rð?Rð?¨ð?Km ð?±jð?­06ð?Bøjð?Q—Êð?’oð?øyð?jÞáð?u¦ ð?Ë&âð?}¿N ð?dÿð?¾‚“ð?£Þcð?«Éóð?ð?ð?ð?ð? ð?ð?Ið?Êð?Fð?'ð?[ð?º*ð?rmð?rð?j ð?ZFð?:•ð?äã ð?nÌGð?†E—ð?D¬2ð?0RTð?§uTð?ùæªð?}¿N ð?¾‚“ð?@Ò[ð? b)ð?ÄG«6ð?ª…Cð?ªëÏMð?I¶Sð?ð?ð?ð?ð?ð?3ð?‘ð?ð?¼ð? ð?ƒ#ð?â^ð?Òøð?Rð?XFð?|bð? ¹$ð?ÜUð?¿ð? žð?Ò}_ð?Þø¾ð?\Aä ð?îKsð?©üž&ð?¼Ýê>ð?OÝn`ð?÷XŒŠð?uçø¹ð?ÙõŒèð?nGð?%î#ð?ð?ð?ð? ð?!ð?að?ð?1ð? ð?õð?ãJð?µÌð?Ã%ð?¨ð?:•ð? ¹$ð?SZð?käÖð?Q›ðð?N˜Tð?‡RN ð? ê-ð?üMÂ%ð?i.¶Fð?uÄwð?¼ÛMÈð?HSy:ð?vë€Íð?vð?*1˜ð?l9ªð?½Îøð?ð?ð?ð?ð?;ð?³ð?ð?!ð?»ð?ë5ð?™ð?0¬ð?â™ð?Lm ð?äã ð?ÜUð?käÖð?ÞÈð?‰Néð?bŽO ð?“ð?n“d5ð?8Sˆlð?ƒLÁÑð?:ŽNnð?vð?½Îøð?Ù¾ÿ÷ð?åô'Rð?~“´· ð?Išc¶ ð?ÔyÚ ð?ð?ð? ð?"ð?ið?@ð?Ëð?f ð?‚#ð?Whð?Æ.ð?kbð?c‰ ð?±jð?nÌGð?¿ð?R›ðð?ˆNéð?J8 ð?»ð?¦›æAð?Þ‘ð?îªB1ð?Ôrbð?ö XNð?K§ð?Išc¶ ð?Õ«ažð?Uáúð?ì”-¯$ð?kĤ ,ð?Þ­¼O0ð?ð?ð?ð?9ð?³ð?,ð?²ð?zð?Að?úÂð?Bð?ó›ð? ð?­06ð?†E—ð? žð?N˜Tð?bŽO ð?»ð? ˸Fð?§¨ð? ›ð?ÿÊBEð?Š2`Éð?Išc¶ ð?³(.hð? Á0(ð?òê?ð?ÑXî…]ð? êÿ*}ð?ågUw˜ð?,ÞÚm¨ð?ð? ð?ð?]ð?'ð?¢ð?f ð?{#ð?Èrð?_ð?Ï&ð?ùl ð?¸$ð?Bøjð?D¬2ð?Ò}_ð?‡RN ð?“ð?¥›æAð?§¨ð?W×1žð?«³nÖð?”ýB¶ð?^hšÐð?ì”-¯$ð?Âöð?¨ñð?´l ð?MÍ&ð?ÿwð?’oð?§uTð?\Aä ð?üMÂ%ð?8Sˆlð?îªB1ð?þÊBEð?”ýB¶ð?qdºmð?°Yù{7ð?ÿzñý‚ð?ÝO Òð?¦*ÔÄJð?.økvð?m¤´÷ð?!"Auç ð?}lèo½ð?¼Ú+ð??n€ð? ð?ð?að?@ð?#ð?¢ ð?»,ð?’ð?:ñð?îEð?1!ð?-@ð?Z’Êð?øyð?úæªð?îKsð?j.¶Fð?ƒLÁÑð?Ôrbð?Š2`Éð?^hšÐð?‹úc‘2ð?ÿzñý‚ð?_È‹¹Dð?«~Úð?zÐɳLð?!"Auç ð?¼Ú+ð?r+ggË(ð?¨öº-=ð?Äh, Pð?0@™pµ\ð? ð?(ð?†ð?Áð?Þð?‘ð?Að?M×ð?Èçð?̈ ð?‘ð?÷ýdð?ÿ~Eð?ìýð?Ðäã ð?F-r(ð?à j}ð?ºÐ‹ð?‚ð?•¶ÊN ð?Yâ¤e&ð?ªåËkð?8;™Æ$ð?]@°®ûð?EãÇð?Ü\‡•‡ð?éçOæ¹#ð?±×'T1Fð?4#uïzð?–Š0—¼¼ð?I:Ævûð? ôGt1"ñ?ð?5ð?³ð?]ð?üð?ìð?†Zð?€/ð?˜&ð?àÑ ð?ÄÒ-ð?$;—ð?Puðð?TÚSð?€F€ð?RâAð?ŒoºÑð?‘{6”ð?Zwð?•ñÙð?Â*8Ið?Jy×ð?K'óÁeð?PæM –ð?Ü\‡•‡ð?r+ggË(ð?0@™pµ\ð?–Š0—¼¼ð? ˜…­ŒNñ?áÙQ^ûñ?; ÁW¸“ò?+¡E&+ëò?ð?Cð?åð?ð?m ð?{#ð?‡xð?’˜ð?§ð?¦ð?@ð?ÖÐÖð?uæÌð?žšM ð?Š:¾ð?iødð?Ѓ*ð?4#uïzð? ˜…­ŒNñ?+¡E&+ëò?œÞ7ƒŒëô?QØÖ‘Amö?×ô.7÷?B-<aŽ÷?BR½HÙ­÷?ð?mð?{ð?%ð?ßð? >ð?M×ð?Õêð?9˜ ð?Ú´$ð?uð?e«·ð?´ïð?*[ð?òv°Fð?>œoóð?ñçDð?‘ÄA7 ð?ª2æa&ð?Óvî‚ð?1`'º¼ð?œŽêÜð?5Eضð?Xª_î¦?ð?–Š0—¼¼ð?áÙQ^ûñ?lú²çÒô?¦ eQö?×ô.7÷?BR½HÙ­÷?˜TŠQÙ÷?yHŽYç÷?"ð?vð?ð?žð?‘ð?)Dð?híð?Ä:ð?aÇ ð?)ð?®Žð?•`ðð?GM¾ð?4iqð?H-vQð?)èêð?`ŒòÕð?ªöwM ð?Â0Ë.ð?Ñ¡xŸð?…ýÕ¨&ð?H;ø!fð?Ú2Ÿ7ð?®ØEÃSð?I:Ævûð?; ÁW¸“ò?œÞ7ƒŒëô?‡`+‰@ºö?B-<aŽ÷?˜TŠQÙ÷?aŸi:~ñ÷?Ý3Úð–ø÷?#ð?{ð?®ð?Þð?zð?sGð?Rùð?ÿeð?åk ð?ÐV+ð?5—ð?ø‡ð?H]0ð?Äð?h‹zWð?œ1ð?7W*(ð?“Xþ~ð?Ù!¾Š2ð?$Г(°ð?}…ueð?lÂõRð?7Ðdn®ð?Ô3OH;`ð? ôGt1"ñ?+¡E&+ëò?Aî°pTõ?8ù¿!‡ýö?BR½HÙ­÷?yHŽYç÷?Ý3Úð–ø÷?%C‚ý÷?{®Gáz=z®Gáz={®Gáz=z®Gáz={®Gáz$= ×£p= 7=š™™™™™9=ìQ¸…ëA= ×£p= G=Âõ(\R=­Gáz®W=®Gáz^=Âõ(\b=Ãõ(\Âe=ö(\Âõh== ×£p=j=¸…ëQxƽ{®Gáz=z®Gáz={®Gáz=š™™™™™)=ìQ¸…ë1=ìQ¸…ë1=¸…ëQ¸>=q= ×£pM=…ëQ¸U=]Âõ(\_=Ãõ(\Âe=ÍÌÌÌÌÌl=Âõ(\r=¸…ëQ¸v=efffffz== ×£p=~=Âõ(\€=Ãõ(\ª½¸…ëQ¸={®Gáz½{®Gáz={®Gáz$=¸…ëQ¸.=š™™™™™9=Ãõ(\ÂE=…ëQ¸U=\Âõ(\_=®Gáz®g=š™™™™™q=š™™™™™y=R¸…ëQ‚=ffffffˆ=™™™™™™=…ëQ¸…“=…ëQ¸—=Gáz®Gš=…ëQ¸…œ=…ëQ¸¶={®Gáz={®Gáz=z®Gáz½Ð9ëQ¸…ë1= ×£p= 7=Âõ(\ÂE=z®GázT=Âõ(\b=p= ×£pm=R¸…ëQx=áz®Gá‚=âz®GáŒ=> ×£p=•=š™™™™™ž=43333³¤=×£p= ת== ×£p½°=¯Gázî³=ÍÌÌÌÌ̶=¤p= ×ã¸=š™™™™ÙÐ={®Gáz={®Gáz½{®Gáz=ìQ¸…ë1={®Gáz4=ìQ¸…ëA=Âõ(\R=Ház®Ga=ffffffn= ×£p= {=\Âõ(\‡=…ëQ¸“=¤p= ×£ž=ö(\Âu§=®Gáz”±=Gáz®‡¹=ö(\ÂuÁ={®GáÚÆ=q= ×£°Ì=Ház®7Ñ=R¸…ëÁÓ=ëQ¸…«Õ=z®Ga–¾{®Gáz={®Gáz½{®Gáz$=¸…ëQ¸={®Gáz4=âz®GáJ=> ×£p=Z=ìQ¸…ëi=Ház®Gy=Ház®G‡=Ø£p= ×”=¤p= ×#¢=ÍÌÌÌÌL®== ×£p}¸=®GázÃ= ×£p=êÌ=ÍÌÌÌÌ<Õ={®GáZÝ=43333kã=Ãõ(\’è=ëQ¸…³í=R¸…ë!ñ=R¸…ëÙò=\Âõ(°¾{®Gáz=º…ëQ¸=ìQ¸…ë1=ìQ¸…ëA=Ház®GQ=> ×£p=b=áz®Gár=ö(\Âõ‚=R¸…ëQ’=ÍÌÌÌÌL¡= ×£p=Н=Ö£p= ×»=…ëQ¸¾Ç= ×£p=zÓ=fffffÆÞ=®Gáz¶ç=­Gázšñ=Ø£p= Ÿø=R¸…ëu>®Gáz>…ëQ¸— >q= ×£° >™™™™™e>ÌÌÌÌL—!>{®Gáz={®Gáz={®Gáz=¸…ëQ¸.=ìQ¸…ëA={®GázT=¸…ëQ¸f=Ház®Gy=> ×£p=Š=Âõ(\š=ö(\Âuª=¯Gázn¹=)\Âõ¨Ç=¤p= ×CÕ=Âõ(\oâ=š™™™™Éî=…ëQ¸µø=Ãõ(\X>¹…ëQ >R¸…ë•>®Gáz×>…ëQ8ò!>¸…ëÑ&>< ×£ðµ)>¸…ëQ„,> ×£pýM>>{®Gáz={®Gáz=ìQ¸…ë1=433333C=®Gáz®W=433333k= ×£p= =Âõ(\Â=ö(\Âõ¡=®Gáz®²=gffffæÂ=Ãõ(\‚Ò=ö(\Âá=)\Âõð=p= ×£hü=ìQ¸…%>fffff¶>z®Gág>ëQ¸…â'>q= ×ã&1>¸…ëQ{7>= ×£°—>>\ÂõèïB>Âõ(<@F>®Gá:ÊH>×£p=eF‘¾{®Gáz={®Gáz½{®Gáz=ìQ¸…ë1=433333C=š™™™™™Y= …ëQ¸m=q= ×£p=Ø£p= ד=Ház®G¦=Ãõ(\B¸=ìQ¸…ËÉ=fffff–Ú=)\Âõ˜ê=43333¿ù=ëQ¸…>…ëQ¸®>áz®ÇÈ">®Gáz”;/>š™™™X9>Âõ(ü‡C>R¸…KxL>{®GA¿S>š™™™‰Z>= ×£`B`>Âõ( >c>Âõ(ôŠe>Ház0v¾{®Gáz={®Gáz½š™™™™™)=z®Gáz$=333333C=®Gáz®W= …ëQ¸m=> ×£p=‚={®Gáz•=ÍÌÌÌÌL©=áz®Gá¼=Âõ(\Ð=ÍÌÌÌÌ|á=ÌÌÌÌÌpò=š™™™™Ù>¥>> ×£ðÍ!>…ëQ¸`0>q= ×cõ<>33333ŒH>R¸… RT>¯GázdÃ_>ÍÌÌÌì…g>¸…ëp>…ëQ¸âv>š™™™Éà{>q= ×a €>š™™™µ¶‚>HázŽ”>{®Gáz={®Gáz={®Gáz$=¹…ëQ¸>=ffffffV=Ø£p= ×k=q= ×£p={®Gáz•=q= ×£pª=ÍÌÌÌÌŒ¿=R¸…ëqÒ=†ëQ¸å=áz®GU÷=š™™™™) >R¸…ëP>= ×£p *>Ö£p=Š:>¸…ëQuH>*\ÂEV> ×£p…c>×£p=®,p>q= תy>®GáŒVƒ>Ãõ(\—£‹>áz®°’>âz®ÀÛ—>†ëQ¸Z´œ>4333·? >ÍÌÌŒn>±>{®Gáz=š™™™™™)=*\Âõ(<=¤p= ×£P= ×£p= g=®Gáz€=Ø£p= ד=ÌÌÌÌÌL©=ÍÌÌÌÌŒ¿= ×£p=JÓ=gffffç=¸…ëQäú=…ëQ¸Œ>ö(\BÞ >À2>×£p=ЏB>š™™™y¹R>R¸…kb>Âõ(\{ªp>3333¯}>ffffÚ‰‰>…ëQ¸G–”>š™™™×œŸ>Ö£p=ú¦>®Gaƒˆ¯>š™™Ù¦`´>ëQ¸À¸>·…+ï3¼>q= 9ý8¿{®Gáz={®Gáz½{®Gáz=¹…ëQ¸.=š™™™™™I=433333c=¤p= ×£x=q= ×£p‘=Ház®G¦=áz®Gá¼=R¸…ëqÒ=gffffç=|®Gá2ü=Ház®Ö>ffffæ˜#>Âõ(Ü-6>q= ×CZH>)\Â…àY>âz®GŠj>Ø£p=3z>®GázÒˆ>Âõ(9–>z®Ç¨ù£>\Âuü`°>ázîN«¹>S¸elÃ>¸…kS‚Ê>¤p= 9]Ñ>…ëQ(PÕ>]ÂùuØ>Âõ(„_Aè¾{®Gáz={®Gáz=¸…ëQ¸.=333333C=áz®GáZ=Âõ(\r={®GázŠ=®Gáz®¢=Âõ(\B¸=Âõ(\Ð=„ëQ¸å=¸…ëQäú=Ház®Ö>{®Gáš$>Âõ(\–8>ö(\â‹L>…ëQ¸¦`>> ×£Œq>Âõ(Úz‚>gfffM»’>…ëÑW7¢>> ×£uð°>q= WKë¾>)\Â$ÑÉ>ÍÌÌ,c¯Ô>®Gá*Bß>…ë±I1æ>š™™ +ƒí>š™™-Sò>> ××C3õ>†ëQžõ•?{®Gáz={®Gáz½{®Gáz$= ×£p= 7=×£p= ×S=ëQ¸…ëi=…ëQ¸ƒ=¸…ëQ¸š=ö(\Âu³=ìQ¸…ËÉ=ÍÌÌÌÌ|á=áz®GU÷=…ëQ¸Œ>ffffæ˜#>Âõ(\–8>Ø£p=ÊN>z®GÑña>×£p=ÞÆt>Ház¼L‡>\Âõ{;™>3333˜Mª>p= —Mº>¯Gáš$É> ×£g¤×>ìQ¸Æ‚ ä>|®¸…ð>âz Ó‡ù>> ×Eè|?êQ¸8Øÿ?fffûs?(\:Ø[?¸sôl#?{®Gáz=¸…ëQ¸={®Gáz$=R¸…ëQH=¤p= ×£`=…ëQ¸y=…ëQ¸…’=…ëQ¸žª=ö(\µÃ=fffff–Ú=ÌÌÌÌÌpò=š™™™™) >ö(\BÞ >Âõ(Ü-6>ö(\â‹L>z®GÑña>®Gáz<üu>ÍÌÌÌn.Š>\Âõú7ž>š™™‰Ù°>q= ·úÂ>fff†Ð£Ò>333 €Yâ>Ház DÔñ>Äõ(Pzýþ>˜™™Õ ?…ëQ¨¤¯?º…øóŸ?…ë¼n%?fffv-ï*?S¸ž-zÃ/?HáÒ+Á’t¿{®Gáz$=¤p= ×£@=333333S=)\Âõ(p=\Âõ(\‡=ö(\Âu¡=)\Âõ¨¹=®GázTÓ=)\Âõ˜ê=š™™™™Ù>R¸…ëP>À2>q= ×CZH>…ëQ¸¦`>×£p=ÞÆt>ÍÌÌÌn.Š>\Âõ»  >Ãõ(Üѳ>êQ¸ ôÅ>ö(\SØ> ×£à\Ýé>333û¾Gú> ×£øøv ?r= »ƒ?®Ç­·g$?q=Êa:š0?…«VC09?Q¸¾Yö·A?33³˜¢G?Ø£ØDqK?¯G‘x8Y¿{®Gáz$=z®Gáz$= ×£p= G== ×£p=b=…ëQ¸…{=> ×£p=•=°= ×£p=êÇ=)\ÂõXâ=33333¿ù=¥>= ×£p *>×£p=ЏB>)\Â…àY>> ×£Œq>Ház¼L‡>\Âõú7ž>Ãõ(Üѳ> ×£0+lÇ>p= 7NÑÛ>¸…‹cÛï> ×£v%„?ázã@i?¹8 H#?…+ú>‰1?Ø£0!ml??®§Ñ0YJ?¸UQâŠT?(\?l˜]?®GÑu»“c?×£Ðvæªg?ìQ`íâßx?{®Gáz$= ×£p= 7=×£p= ×S=¹…ëQ¸n=Ãõ(\‡=áz®Ga¢=Âõ(\O¼=Âõ(\’Õ=Âõ(\Óð=ëQ¸…>> ×£ðÍ!>Ö£p=Š:>š™™™y¹R>âz®GŠj>Âõ(Úz‚>\Âõ{;™>š™™‰Ù°>ëQ¸ ôÅ>p= 7NÑÛ> ×£@Ìñ> ×£ò`@?ö(\©Ê?ázï¼&)? ×c%I;?®'#J£I?ìQXœdÉW?¥pÍ/ïžd?Ãõ@ ù“p?®;úˆx?ÍÌÐL•€?ìs[„?…땜…ëQ¸`0>¸…ëQuH>R¸…kb>Ö£p=3z>gfffM»’>4333˜Mª>q= ·úÂ>õ(\SØ>¸…‹cÛï> ×£ò`@?gffÐ#å?¤p=ÆFt-?gf& ¨®@?q=êdS?zž©Mb?™™©°££q? ×›FŒº?…1iPeŠ?š™¿É› ”?ázÆž½â›?ÌÌÆë¼i¡? ·ñ.–ˆÕ¿)\Âõ(<=)\Âõ(L=h=Ãõ(\ƒ=[Âõ(\Ÿ=áz®G!¹=43333óÓ=43333{ï=Äõ(\N >áz®ÇÈ">q= ×cõ<>*\ÂEV>Âõ(\{ªp>®GázÒˆ>…ëÑW7¢>p= —Mº>fff†Ð£Ò> ×£à\Ýé> ×£v%„?ö(\©Ê?£p=ÆFt-?Äõ(à˜B?ìQ¸ëbU?­G)KïÎi?)\¿Ôey?âz¸Dg‚‰?Âõ>Ä1á—?®Xµ Ÿ¤?ÿ¿¼=\?°?®Çà+ø·?r}.˜gd½?˜™’³%§¿433333C= ×£p= W=> ×£p=r=š™™™™™=¸…ëQ8¨=…ëQ¸žÃ=ö(\Â¥ß=Âõ(\^ù=×£p= ­>®Gáz”;/>33333ŒH> ×£p…c>3333¯}>Âõ(9–>> ×£uð°>¯Gáš$É>333 €Yâ>333û¾Gú>ázã@i?âzï¼&)?ff& ¨®@?ìQ¸ëbU?Q¸®]VXj?ÃõôµÐЀ?Q¸×ö‘?…ëÆñqÞ¡?š™%þhq±?B‡jÂI¿?330\ÐnÉ?Íìy;žÒ?¾|ïÿØ×?·žnó­Nã?š™™™™™I=`=ëQ¸…ëy=ÍÌÌÌÌÌ•=q= ×£ð±=¹…ëQxÍ= ×£p=è=ž>Ãõ(\1 >®Gá:Ý8>= ×£ÐçS>Ãõ(\¢o>™™™™Mìˆ>ëQ¸ž¹r£>ÌÌÌ I¾>Âõ¸ŒáÖ>ö(\Cp0ñ>…ëQ¶f ?®Çlg"?zîEë:?`TüQ?ÿÿ_8å h?Ø£LÓù~? ×/H•?GáïÄRç¥?™™É™Þ¸?I= ˜_È?×3hÅÝ‚Ö?öswHâ?{l‘8ðê?3÷ùD?!ñ?âºðá”;ü?Âõ(\R=Ãõ(\Âe=R¸…ëQ‚=š™™™™™ž=Gáz®‡¹=ÍÌÌÌÌ<Õ=­Gázšñ=¹…ëQ >(\ÂõB(> ×£p]êB>*\Â…Ï^>z®Gaðx>š™™™± ”>R¸ø¯>\•±BÉ> ×£ 0Àã>R¸Mà‚þ> ×£<?®‡>ºf1?âz̰ŽI?†ëÙŽˆUb?Há¶Ö8“y?\!o<‘?=ì¨? c¯¹º?öh#_6qÎ?>ªÛ²¢ß?Sðàd<í?™]å|Îö?R°;m7þ?|$Zšj@4QÇM½@­Gáz®W=ÍÌÌÌÌÌl=ffffffˆ=43333³¤=ö(\ÂuÁ={®GáZÝ=Ø£p= Ÿø=R¸…ë•>{®Gá[1>¸…ë‘rK>q= ×µf>¸…ë˱‚>hfff„œž>> ×ãRç¸>Ãõ(lÂÔ>®Gið>\³^Š ?R¸žuf$?ö(‰©ò>?HáªæˆW?×£ørߊq?43㜯„‰?ÃõfÅ0ý¡?{ôZÁ»?öh#_6qÎ?3³ùì²á?Ì8¹oú÷ñ? à6ùžý?¸ªÜ¯=@gj{W{åÿ?>>æ‡!Fô?]ÿHp9Ìæ?®Gáz^=Âõ(\r=™™™™™™=×£p= ת={®GáÚÆ=43333kã=R¸…ëu>®Gáz×>áz®Ç®7>áz®çôR>âz®‡Îo>(\ –Š>âz® !¦>®GáÈTÂ>˜™™Ùa3Þ>¤p=Êu·ø>ÍÌ̃?…ëøQ(0?> ·ëȺI?p=ʘ8d?âz¨H„C?33ìlV«—?¸Þ5ÉOi±?zF‘Ì?>ªÛ²¢ß?Ì8¹oú÷ñ?H I<ôÜÿ?4Ë›.9ú@(gA= î?\WÍÚ!ñ¿Î ¥A­ÀÂmþaÒÀÂõ(\b=¸…ëQ¸v=…ëQ¸…“== ×£p½°=q= ×£°Ì=Ãõ(\’è=®Gáz>…ëQ8ò!>4333óÁ>>R¸…+âX>†ëQ¸Ö u>¤p= ·ä‘>…ëÑ¿7®>¤p=Ê‘mÉ> ×£õOå>×£pw“Ç?fff‚m€?R¸Þe¹P8?×£ 1¦áS?ëQÝŸp?Ãõ˜7Á»‰?£p[–á5¤? Wªaá¾?×ã↫Ú?Sðàd<í? à6ùžý?4Ë›.9ú@[ïÓ窳Ø?\–(åÀ>'»ò ÀÀþâ¶ À H®ÀÃõ(\Âe=efffffz=…ëQ¸—=¯Gázî³=Ház®7Ñ=ëQ¸…³í=…ëQ¸— >¸…ëÑ&>)\ÂõüB>áz®Gþ^>®Gázð“z>¯GázÞÀ–>…ëÑq³>®G!9“Ð>Ãõ(DR0ì>\Âm…å?…ëÑW-/$?¹ÆYù@? …;Ïe\?®ïÄ'–w?x˜/h“?33¾$v¯?®„ÔÙÈÈ?¸þì(4(æ?™]å|Îö?¸ªÜ¯=@(gA= î?\–(åÀ?&©¡n À|&êê¬À†+·ýÉäþ¿ìOæúËøÀö(\Âõh== ×£p=~=Gáz®Gš=ÍÌÌÌÌ̶=R¸…ëÁÓ=R¸…ë!ñ=q= ×£° >< ×£ðµ)>Ø£p=jCF>Âõ(´Jb>= ×£`œ>š™™™·I›>ìQ¸Þ‡·>p= G¢CÔ>R¸Eâlñ>Uê ?¸…ºèŸ)?®GÁ‚‡äE?{Nù­¤b?®wö¯œ?Háòñžš?™™ƒ†¶?×ã‘eñÏÑ? Þ¡ï&ð?R°;m7þ?gj{W{åÿ?\WÍÚ!ñ¿>'»ò À|&êê¬Àáb'÷ø¿ g~‹cªé¿R˜ÚÃýì¿= ×£p=j=Âõ(\€=…ëQ¸…œ=¤p= ×ã¸=ëQ¸…«Õ=R¸…ëÙò=™™™™™e>¸…ëQ„,>\ÂõhÄH>ÎÌÌÌqd>âz®Á>¯GázOÓž>íQ¸ž ¿º>ÍÌÌ\M1×>fff"¶ô>fffHf?\ÂQ[.? ×cHþI?\ªˆÞif?43oJfFƒ? ~3~ ?šÙ é"â»?3¥­ÁÖ?ͳ¨ó™ô?|$Zšj@>>æ‡!Fô?Î ¥A­ÀÀþâ¶ À†+·ýÉäþ¿ g~‹cªé¿ÖC;™ ÜÕ¿ÎLï»ñª¿×£p= ×k=…ëQ¸=ìQ¸…ë= ×£p= º=p= ×£°Ö=×£p= Çó=¸…ëQ<>®Gáz .>¸…ëq J>R¸…ëœe>úÑ‚>*\ÂŽb >fffæà…¼>p= GÊÑØ>)\—õ>ö(\PëÅ?R¸ž©çP0?×£PôßWL?…ë¹áa˜h?HáZrN…?€ø1ìa¢?…+5ïùX¿?Rhü€î»Ù? ÉeƧ)÷?ë[æ$ª@)œù°¦Oç?Š:ÄÀÖ?ç¦H À¤œèì ø¿öÈ2C._á¿ÂÆ7ÛÈ¿‡[–ôTÜÓ?•ð[&Å5c=“ð[&Å5s=ð[&Å5c=ºìòo6ˆ=¤n'Ë}œ•=Êj¾ïiš=†1öÓh¢=æ§ï ®=žn'Ë}œµ=ä§ï ¾=Ö艹§Ð¼=¨ìòo6ˆ½SUs¼Cç½`*cY¾t!ð°+ö3¾R ƒ%¶`X¾,­×¸ñ½~¾ ÛÚó㣾•ð[&Å5s=“ð[&Å5s½–ð[&Å5s=·ìòo6ˆ=–ð[&Å5“=”ð[&Å5“=‡1öÓh¢=Rêºh±=V Wù6¼=ô¡ÏÅ=j‡"5²Î=Û?(dJÔ=0 ÀFˆi×=b*Ý xõÐ= ºC÷ ¨à½ÖD<¨¾½iØ4=1¾×íÙ DÀP¾+ôе¡o¾Üv–7l޾•ð[&Å5s=“ð[&Å5s½·ìòo6ˆ=ºìòo6ˆ=¨n'Ë}œ•=©n'Ë}œ¥=)ýœ²=á§ï ¾=‡òÖiƒÉ=»÷tîµBÔ=NþÔz÷ß=Å Ñóç=­^2k•ð=‹ è=W|ô=ü‡ÛÙÞõó=œ™½{"ê˽Œ2Ä ¾šÆu‡>¾„ki°’X¾øxIók¾ß…î¨Ób>•ð[&Å5c=“ð[&Å5s=˜ð[&Å5c=·ìòo6ˆ=¸ìòo6˜=Íj¾ïiš=‚r ϰ=ä§ï ¾=û$Ê=Å Ñó×=,µ©âã=Þ/Rð=F/e& ½ù=lzΕR> Ôªåm >0RÞË`Æ>Æéx  ä>ŠmŠàÿö=VÀrž0¾ŒÝ1«¾V¾š¸•gXw¾ÖÓ×çWu”¾Æ^OîA §¾•ð[&Å5s=”ð[&Å5s½Ý艹§Ð|=¸ìòo6ˆ=…r Ï=¯-ÚϦ=0 ÀFˆi·=­-ÚÏÆ=¶Ú@vÕ=¨S›³ëUä=°ƒ„ÇÈñ=Sâ¿ýþ=PwœŸ– >[g>?ŠàÃ!>F â27Š&>†>9}Ñ.> 3$€1>£3½÷%>R“.Ë@¾8o€?{[l¾ 0 (R‘¾ëi·ÅïÆµ¾ÚÌ"[‰Ý¾•ð[&Å5s=”ð[&Å5s½”ð[&Å5ƒ=—ð[&Å5“=Êj¾ïiš=)ýœ²=ý’]X^5À=€r ÏÐ=»÷l5‚à=NþÔz÷ï= Ã’­ý=!Ôªåm >]±‰Z’>æ«B%|$>QafCÄ10>§ya­ø29>v˾˜Û^B>¿’jȘcI>¸¾üÏðòN>ÌK¶ö¢J>c³¬ôZB¾P0 ¢¹x¾=ÇÕ-”˜¾V˜ZEÙÞ³¾r£ýÓϾ•ð[&Å5s=”ð[&Å5s½ºìòo6ˆ=•ð[&Å5“=µìòo6˜=ÐŽOsϳ=ô¡ÏÅ=è½óƒÖ=2 ÀFˆiç=󟳎™÷={N6xñ>::礊ü>Åž²[)$>€]W2>ù|ˆä>>–¤DKºžI>2Ä<¯ˆT>>pb+k ^>->Y$e>–~ß -êj>Z%k( Ìi>¡žÅA¾µ<0þß-‘¾O¿„³±¾ÔìE{Ǿi{G1‰b¾¾•ð[&Å5s=”ð[&Å5c½»ìòo6ˆ=€r Ï=“ð[&Å5£=Æ«XÂ’6¹=½«XÂ’6É=½ ÖC÷Ü=¢‰ ÛPî=ÿdÊuÃ+>·¦Ð§ÿn>Û3îÏ… >ÅÜÑøÛÕ/>tÆ]j>>Ô“!K>¬Ï¯ÑW> ¢Òbjìc> Òœýo>òÆ  ù2x> '¸{>i†ÕÉ;‡>¾ûluˆ>»©ŸüR/a>Ç0P)Ü©¾x•½ÎãѾß2˜Û'oð¾0˜£ÛMŽ¿•ð[&Å5s=”ð[&Å5s½ß艹§ÐŒ=€r Ï=‹1öÓh¢=E‹‹ë@й=™½{"êË=»÷l5‚à=8ýµ­ubò=‡tžÌ‰w>܈bÊ> Qôhwë&>ØÅ#IM/7>ÑGažùûF>Óõ!áèU>z§YKSd>žHg r>f¤  ó~>üqXðü"‰>ŠÝ> [z“>×£Ñî_¢œ>ñYÐú˜£>È,ù˽¦>/Lv6ƒš>.v‰„çyº¾²+šóÂç¾²¯.Öï0¿ÝÌí÷1ï4¿”ð[&Å5s=”ð[&Å5s½Þ艹§ÐŒ=‘ð[&Å5ƒ=”ð[&Å5£=E‹‹ë@й=Ü艹§ÐÌ=‰1öÓhâ=QMîo“¿ô=¶Ìªð>게«)¡>Õ:Ÿ†S->tÁ\?>>C 3P>˜"þ,C`>Ñ||á®Óo>ªU\Zí}>Í.œ?u?‹>ëèªHZ®—>ÊQØ‚°£>ü»Tò®>w6vìïZ·>ü LØdÀ>{Šëä jÄ>ûE™7ùÁ>Î"ÆäG±¾ãúá…Éë¾µí·ÛÀ ¿Ÿ¥g#O^%¿”ð[&Å5c=•ð[&Å5s½·ìòo6ˆ=‘ð[&Å5c=­-ÚϦ=4 ÀFˆi·=Ó)$gKË=z™žâ=½¶Ú@võ=¬Žßñ >Ϻ‰ >ÜÇ êK1>Ø!ìß7C>šÝâ?õüT>áøe}&f>ï/&0áÔv>Á쌿5¯†>—ŽÔGià•>ê~Ä <¤>D]6á˲>ù7DÎl¾>BAhWuÈ>‹LWÎÐÒ>lÞ¸á%Û>vÁ;á>¥‘!¿á>ílŘp¦¾ÎKÍjìj¿^¥(¡¤»¿¶Ðy¥©¿•ð[&Å5s=–ð[&Å5s=Þ艹§Ð|=‹1öÓh¢=)ýœ²=ý;¿­»éÈ=±^2k•à=sgô=CØu¬ö >¼³¾—V>aÅUƒÈ2>R‚3çžÔE>«Í¤ì‰ôX>Ó‘Ý<†¦k>kT”8\ù}>vþ¤Œh>òV€ >7€\il¯>³×æƒ:ʽ>:Z¦W£ýÊ>ˆXØÜ?U×>ö!²ñDã>â »Ü î>¡Ùà=ö>–xSÛÊý>ÿ@‰ÍõWÿ>ÿcèÃ>¨oK"¿¿Dâ%GF¿uÀŒ@±_¿•ð[&Å5s=”ð[&Å5c½“ð[&Å5ƒ=”ð[&Å5“=æ§ï ®=áþ¶¦OÅ=yð¤ÐƒÜ=kéB^Ô(ò=¸Ìªð>1©³Ô >eÅUƒÈ2>º0ŠYÈF>ñª¹^ä8[>ÓÎÇ šo>©N†û>ßM?ôÀÕ“>NÚÿO U¥>·rÕL)¶>µ°DNÆ>ñš Õ>UöòÞä>Q …¤ñ>“¿E®Áˆý>7 þJ×?ð5ì¦?oþáSû)?Qõ3ùi?|×ÍúŠ9 ?\%ðt ¡7¿a\|‘f¿§‰âëy󇿕ð[&Å5c=”ð[&Å5c½¹ìòo6ˆ=Û艹§ÐŒ=Ìj¾ïiª=ìfU^`7¿= §~—\Ö=@?o¿Äî=ݨÞò|>i{Õ]¨>|`… ·M1>ÐMØŸ×E> ª ’d:[>$©o_L†p>2øüIa´ƒ>©ï,ÉÔ–>B/3Û©>ó­ærû\¼>Á¦ _<Î>×Y¼ß>âr¯6dÍî>úÎþâ4ý>XØî] ?™ûû¤õ†?‹‰ãÏúª"?ýGvi-?•VÖZPè4?±Ú—¼Z¦:?÷E²Z9?>"`¶÷„ù¾ZŸL§ºÒZ¿¢šJÕÕu¿à艹§Ð|=Ý艹§Ð|½“ð[&Å5ƒ=ðfU^`7Ÿ=¯-Ú϶=ÞJªâÉ[Ð="iæ ¾|ç= rZ?À>:ÉjF}>l– W->õ… ËÑJ ÊùX>*MÝnŸo>ý#[ï7¶ƒ>Í?¼šˆï—>laÆSz¬>vtÀ>¥©qò‡Ò>2ÃA0ä> V\’óJõ>¡mG¨Í–?—êRŠý?à+0b#?Rìæ¥.ô0?¾/Y"¿Óc¿!ë‘4°yR¿‚r Ï=•ð[&Å5“=ü’]X^5°=¨n'Ë}œÅ=ÝJªâÉ[à=*;S)#s÷=!7R´Î>¦è"¹ž’&>ÇÄs“äBU>yó2š:¯k>jµ“ˆ‚>šüù ÕÙ–>gê-ä/~¬>ä -i§LÁ>Òð'ŽG‡Ô>è•Ï£ç>w ’"Ðqú>xx¿~Ž ?À¥ *˜¸?Öó0´Œ™-?d\f"©Λ%œ„ > {G×6>ºu15R:P>OÙÕ¸q1f>mŒÀ-þ~>È(/òÞ“>Dñ{Öæ©>W…a»zÀ>fƒ„û—‹Ô>™µ[ïè>q±5ø~ý>§396æ?ÇÎPϾ"?Ä@a`T4?åãš$uD?Øù j¡ÝS?‰ ¸@7b?6gp?$/?z{?{À`Žy…?Ý®š´|Ž?ݳkŽ¿‘?k6¹ý/Dv?*ÒÂr¶¿#š±oA ¿ƒr Ï=“ð[&Å5“=Ô)$gK«=‹ÚW)ƶÊ=³8œYã=„âÜuO:ý=ÖœÕξ>¾vœ¨Ô/>´¨iAªF>&ÐWú‡M`>/€Iæv>éw“å€>¡Ä œe¥>`÷Hq¼>ÎÓuE”Ò>Sÿ“‹°ç>­ Owþ‡ý>…õ_sJå?ñØ0¤Ì%?1s/ü7?ÀÆ«éMJ?VžyÈœ[?8FŽ~ˆk?ñ¯ÕâÛy?F¶DŒ^ˆ?§L×X£”?ó¡Ãž[” ?s[†½ˆ¨?x޲4&*°?ÓþU}J±?.Já9±º˜?–ß­Jûµ?Û艹§Ð|=¹ìòo6¨=ç§ï ¾= §~—\Ö=öœå„Uñ=¸].Kò >x¡…³0$>õÞ58 >>m¸æÐ$¡U>ÄD0`õo>ÏÁéÍ É†>¯r´àx >oÌúļC¶>&$«‚m`Î>‘+‘Gä>O•ªŽú>xâå-õ?Ì_BI %?ä×DN‚†9?ôÅõõñÝM?Nÿ¹úÒ`?fSPO¹&r?{uR%]•‚?C²Uà‘?0pœ#¡?ÙwéF2®?p; àÒ¸?+ò&®rÊÂ?ìvÅ?„É?¡mÑB%–Í?˜¸aÉ~~Í? /ì|P—Æ?·ìòo6˜=ìfU^`7¯={\Œ„ PÈ=Þ$œL¸Õâ=å§ï þ=P–h´4>²ì¦Ó"2>ÊI´ï-K>ƒ‹ñd>Ì9 qa ~>¿ ãÑ–>ŸŸÒ姯>mH”" zÆ>ñî¢æHPß>ßuµ‘Auõ>Zn5³Å ?µRoMà"?Qnä£ 8?Ÿ´“úM?ë2’¿b?¨š@Q át?4ÊY‘”%‡?¦DZmV˜?I« mNñ§?…Y <Ä··?x¿yªïbÅ?ÌIz‡¡ñÑ?L¢ßÖŸÛ?|T¨9Üâ? ’+qÿ`ä?‹6“@Ð?¯r¬ùäü¿¨n'Ë}œ¥=Îj¾ïiº=r¨¨°0\Ó=i¢®LDäï=ý ,Ë à>šê– Í#>spõ]%?>ªq9TtóW>ïËk9ðñq>Ý_öe΋>7r’&*z¤>ây‘Æ(¾>‘ß‘=ÖÕ>gáþ¥l4ï>Ó®G8à?2ÎgJ?Á—F D4?ÔèׯŸJ?ìz.1æþ`?_¬¼d-u?)g‡‰?¿0Áý‚œ?Þà]{Á®?NÜÉy?ܾ? ©E€õ’Ï?l›ed& Ý?{–Ô¿è? ÀžQÄKó?ò `Éu´ú?#˜Ô»vü?kgóÏž6Û¿û–¶éI<@Ý艹§Ð¬=U`õ:œ‚Ã=yFˆ‡Ñß=&(L^°ø=Â`+}è=>4Ñä6õ 0>j£óH J>ɤ™.d>Kñžj >_nͦ/*˜>‘aµ-d²>|âÿ[’Ë>9³kv5uä>é¶•‡Ýý>d.D—5z?œv¼·L.?_w‹_åðD?<ü@@\?øE‹»1‹r?ø¨©†J’‡?fÚœ?Z—Žo½Þ°?=ÒPì¢Â?}Yg.÷Ò?ëÌMÚþã?Ô-Í(¦™ò? qôjOÇÿ?a“ŽAõ¯@3?bÒ3C@œe#mT@PXËzÖ†@6–‰x £3@,NZô+6¶=cȼâUjÍ=!iæ ¾|ç=‚ãË\ÈM>P2úÇ9>2t´i œ9>Œ0ÂL‡ÄT>Á+R‹|p>U&F㣪‰>À`gs¤>ìCRVËœ¿>`wOlAØ>%ŽÀÚYò>°›Omr ?3êy»1$?Q¨·Q­:=?ü*p.™¹T?xë”Økºl?Cè£`ƒ?R1õ7P™?éÎ㗙Я?Ãx¶¼±Ã?Ò"k®+{Õ?KÏ+æôõå?ísšªÀµ÷?rºÏáè@s˜÷Hý.@ùAyó©@Iuk!@µ5ªÉëÚ#@1’t(@g ³ºÄü?¿÷l5‚À=GA,;)Õ=È êKñ=F  Ç; >`1'’%…'>wÃqbQC>9N`o,`>mLVó«y>ÅŒ°6x”>x—Ò®!„°>é<;zîÊ>Œš§Ós_ä>=9õÛˆÿ>±i{o#?2«±*&2?ˆòV{çJ?;ŽÒ…“c?EJt\Ú{?H) ÇK“?Ьœû°á©?õë뼬À?2Q³”ÐhÔ?…wŸ˜Rç?XoÆZ÷?ý0'¢®® @Ç…æx±@:é„Kð @ Éža¶ä#@ë·¾ð‹@µ*ää!Þ@Ab˜Dë¿X< GÀ][øµÄ=‰ÏÕªFwÞ=Æb9Èeæ÷=¾÷tîµB>¾Ùw?Í0>*/ðt–OL>½$Éa(šg>ázA«Gƒ>I†d炟>³el`Üš¹>Â(xþ†Ô>wi Ñ[ð>ØS±âÉ ?Z3<Ü"$?1ÍeÞÞ??DH;æ ŒW?Õ;ÕCŽq?ŽîŸ‰?ºd»6¢?ƒQ/ø ¹?ã{àÐ?Ùqp‡ä?²€:íôŒ÷?¢—Ž_BÍ@NÓ}™e@fpë…'É"@½*3C2#@®™å¨Â™×?0•±ßé«5ÀËJ£f’HÀ£xqëÚnOÀtyÉö=bÀ&8V÷,·Í=%thŠ=¼ã=ϦЧÿn>à¬úˆwh>€â–ìY7>Öf—–­¤S>'ûÖeJ¿p> k個>y•_$³¤¦>M |îðÛÂ>)xÍbÑÞ>|þ9añø>Fÿ=,~?èrãDÝé/?¹_ÐlmI?¹:P~c?.øGÌÀÁ}?jÚ˜°=–?16¹Ü0°?uÀr ÆÆ?aw÷>“Þ?œÑy5ó?â—/ÎÊ@/™Û ´(@âhC¿Ñ"@;)÷¹\"@š~½À±Àü¹yw{ñFÀƒÄduq“UÀBÏâËXçVÀ•î˵¤PÀ!Â$îHÀ‡1öÓhÒ=9ç±°vãé=ô¡Ï>õï ÃÒ">³t€¨>>n"GîcZ>Õ´(@„v>w¤ûýiÖ’>(–À‡I¯>ÃüªØÕƒÊ>/¦ø>¬ìå>n““%6?©pŸƒw€?2alsë7?ã"jß.S?ïäm\xen?d]ð^ ³‡?› ;ÒÓ¢?b©Á#*ñº?ð¬Í'SÓ?š·{h!Pê?û™MMaŠ@—ð%ró(@™…H@øÈ;,\#@s‘$jh À…Fì‹êÃKÀ”gB“ª·XÀR9§µ7KMÀ`>“´@@{¦Y1(T@ž³\ïi@¯-ÚÏÖ=ó /™*$ï=¼ÆäÙ$} >‹õ²‚›z&>ƒö¥ßéˆC>i®åÆ£½`>M¸Cîn}>Áîvâ³m˜>Ý0Ƶ·£´>—¬ç‚¢Ñ>d4¼œí>°Àý2b°?³UF}$?¨ä´WèÝ@?™NÀQ8ˆ[?GŸ_>Ñ4v?­j¿GÐ¥‘?é;t’®~«?¼»P’z×Ä?M3ÔaÞ?~Þ™6jÝô?§e©œÑ÷ @Þ¼–YQÊ@ðï‡û<@2ÈÂ(*yß?¼Fl“‚ÌFÀ¥Dk ³XÀQ/Än‘lAÀêCëíçW@M˜ˆyŠ`@ #y9˜S@<¸áÏjj@Êj¾ïiÚ=ÂÜèÖ#üò=Ò”è@û@>ÙñIÌ H+>‹Ö2fïnG>Ï#bä~d>ÊÍ_L!Ê>IßM³ªMž>«C®QQ»¹>Lc‰8GÖ>€ )åRÜò>8B³³Ü?%w"¿*?Ãñ9Æ×SF?IŸ,uÏzb?9‘_“=F~?Ê x«±q˜? “‘‚Z³?΀¤"ËÍ?òTbuøúå?@À“Iþ?¯çŠijv@Ñ9KgH!@»|Ù±|bð?šrk•O¯5Àƒ¶‰¿wUÀÕ7 n¢MÀ…ÚUæX@,›ë ò_@u°R¬-H@“ªyœ›3ÀãH5*?@Ë_<–o*Þ=üFA,;)õ=_‰¶ >’!ëù$ú.>t*¢%>K>^'ðÉ¥g>t@^¦–ׄ>Ø DS_¾¡>üèT·ƒ¾>€lz{ׇÚ>G¯ 4=²ö>ÜÇ€©P? ¿GÊb0?˜ÜRm¡K?çmØíñ!g?P÷g(,ƒ?ö<ÂïôYŸ?æér¬i‡>ø YF+1>Ë;6ûÁM>L¯jDj>]•L‡>¤He”Ñ£>6Ìå Á>„z™ÁåÝ>8 û:–ªù>Œ O»‹?BqªŽàÆ2?˜@Jœ^çO?št^éj?Ò0úÍ~}†?WÏeEc‹¢?_•š;`ý½?½DHw;ˆ×?Ë›ýÓ–ñ?ËvA "@+Í]àÙ@ªö—Ùt$@ð¢õ+^N4À L¾`¡aQÀç ÀDbPÀR¼b ÅIX@gb«‰–Y@’‰CÕú¿ÖCN¥güCÀò‰F}ªŽCÀˆ)n¸ÆKÀDâ)–ãá=¼Ìªð÷=lZ~9§>é'=.Ë1>«ëNtO>=®.Fvk>ã翵öXˆ>³¢å_ݤ>ßÐþÓÂ>ÐNü¯ß>Ý"5ÃDVû>k_ÇQ{?czÉ'q4?ízÃ~%Q?8=} m?•ƒuó_ˆ?®êÊr#0¤?iW›eÀ?…s DLÔÙ?bŕκYó?M ¨~ @ÝçÖ¦Ã@ VmÀ#@ª‚ yü>†´…°?d‹¤«‰?t#s/?¨¤ËÂ?€þ…V;>?€SXDL!? ßÔÆ[#?€â5²ÔR%?À\4…¶ '?€ š°·(?ÀgAn*?uõ€¾ñ*?@Š%ºÇ]+?೉f&+?`ŽûÕ¿3*?@G+Eý¹(?˜øç)(?¡IG‹.?pcn Œ@?(Ô˜·2Z?JVÒ££‰v?Ö}ÿ’q“?~9ÔµR€ª?¸‹¶¶aœµ?w³UúVµ?üî¹—{©?àfrë!•?zj¶îi€?Òi9„t?М¤fS…?lÄòÁíâ>Æ>J_ü>˜y–›?€ÙÊüv|?Ž[° ?Ó{™ž³?€ßº1?@¬#±*H!?€2­±\#? Ö-àZ%?À\¶Õw3'?€ó¶Ú(? ‡/{é=*? ¹iI+?l:ñà+?@ êAå+? ¢>°dC+? —Þf²,*? ™Êñ)? μuËù/?@%•µšÿ??@AˆxÌW?}È—-»Üs?Rƒ3]…ñ?¶q’ŽŸ§?§R‰t-´?ÐÔÛ;°wµ?$Ú#N"¬?àišoÝ@™?à—eÊðÆ‚?€ ÿÛi?Ô×–pm@?äî7ãæâ>fòVü>æÎFÀ•?×7dbz?€q’Àï ?€×€•º?€Ç„-B?€—#VzX!?`´TÔy#?ày¥ ˆ%?à¬snÙw'?ÀÓί–>)?@²‡mÏ*?€U\Êç,?@ŠwÁ-?`ÿÈ‹h{-? ñX¯¦r-?À[Ö÷^-?€a6Š-?À¸ðË1?ðž¦n«>?ÌÝÅq T? t~É0o?§™úd ͉?T™Cqƒœ¢?ÖSß%±??ÙCÍÍ´?¾HA$°?(g(H\*¡?Peá•ÿ‹?Àá=ÌøLk?À¥›Xhü}¿XH#Šèâ>.&œ Zü>͙ڜ›?¿Y²B?¢ÿáÄ.?€ÿÛŠ˜Ó?JP’l?À1c©¢y!?€é¡¸S­#?@UƒtùÓ%?@Ðe–âä'?àz%{7Ù)?€Lôº ¨+?à2vÌF-?@0ñÏö¥.?`qƒ«Ýº/?ðƒçÏ‚A0?`¬Ú°Ë–0?0†6êRM1? ýÑ*P4?êý÷§>?¤ÊÒbJP?ˆ€ñø“cf?I&°;Y?pËŠ4!²™? Ka‘©?´&<ä\²?Œi|²U±?$.Ö2A§?ø)9;«—?0™qó/?N.ëiჿ¼l@¸ïâ>êp©fü>âôñ'©?€âØŽ?dûHE?€«óºòø?óÙ7K§?@EÆÝƦ!?kP{ñ#?€sD2\5&?àå­Ln(? ƒ}aB™*?@'‚F²,?`l‡YÈ´.?ðA>N0?N Ò41?ðÍïEì2?šªÆý2?p·ÇÚ"Q4? PGý&7?öö=,ö>?Ø=fÞ,"K?Èׯ?8:<þü°ª? T³ÄœM¡?ȉH.{?@ñB§8µˆ¿+ÌÓøâ>Ê?vü>3Ä鉹?€ª·$5?€ñ¿”U_?€öW«ž#?ØI—ê?€†<Ÿ>Ú!?ÀbCoK>$?àâ ”¡&? ˆI-Ÿ)?ûPÚSk+?@-z¸”Ó-?ÀÑYë9 0?Ð ÿùG[1? {ЏõŸ2? ©œVù3?°˜žû‚5?@›ÐZ‚7?°¬t(¶:?`Ì% «˜@?€£Ž Ù\H?øüþ$9V?°RGW2i?®Æý~¬@?L³‚cøÔ‘?û†aÉA¨Ÿ?m\0×9¦?™ %EØ9§?¸Ñ `Å¢?’{Öñp–?°a·É x¿”ˆ°ìÿâ>ì{µà‚ü>RnéuÇ?‡³ò¤ª?Ojö9w?€Ì‚T›K?€I¯rõ*?@è2ÐÑ "?@0xSŒ$?ÜböÐ '?@µùNO›)?@f‡ ;,?àèCïð.?^Oºdâ0? îÈa2?àßÏÞÿ3?€mTÏèÍ5?ö-Ä©é7?—$^:?g‰÷cB>?¨C*.ÄB?è/¡&AÁG?€SªšØQ?hoƒ¯ª `?Z¨Zr¨r?Î1¯‘Ô?øU‡!Ã?ìêf´?.˜?䨏{³¿?àåÓ U?Κ±Rw–?8”Š?Xª; ã>®¥a†ü>”h|“Í?vö»i²?±R‡?û÷HŸh?ò™ãÿY?%—ò/"?àÁá+<×$?àÿ]tÊh'?€ù±]*? ïUô,?`¤0äï/? n¾‚f1?ðaŒ£ÉI3? ¬’¨45?ð¿S1]d7?ÀOcúöø9?À„mߌ(=?Зn «@?ë>§¢C?€y9úFGH?ôk–š6#P?LãÿÈW?HJÅ#f?ü`†å{dr?oðOŒ6~?*…T¦ë†?`¼³OŽ?~nâaè?·gà?p]ÊÓX)’?¨§/ƒøâ>B™Èùzü>)¾ÓÆ?¯™>æ°?€St ‹?±Ùòu?P˜Ê†t?€ùŒy$E"?€Â,LiÞ$?\1óº¨'?€0ùp™ƒ*?Q°q…„-?€Ogõ'\0?€ ¶~€2? T¡Tcÿ3?`“(âT#6? ckš4™8?€0^[Ò€;?À–´º ??ðÎxJ€ÂA?€í鬦ºD?Àõ"açH? ç½)œ-O?Þ æC¡T?€h4P Ý^?L‰¶†Sf?Xø‚S[Dp?`m§ww?X×)¤~?6Ñmð—‚?*ÏÓs±„?Lƃa2 Ž?°|!’ãâ>üNiœ[ü>• r®?€mTÀ¢?€âÿüK~?Ѳn?€m.sBx?L í¡R"?À°kˆÃ%?@+2&÷Ñ'?@.™Å*?±ßnç-?ÀLú]¦¢0? ¥Å%x2?@Ô± €4?À‰ÚÐÊ6? uÎÞëm9?€On'û†të•Ê$ü>¿Ð¥?Eï–„?€ÀAãU]?€Ýºh4L?¹û*Y?@$«‹~H"?€"½þ %?ÀœaØÅØ'?œ‹æfÙ*?;vW.? {–:ŸÂ0?  Ž"u¦2?à´Ë0x¾4?À‚©7? ì²åÏ9?À¶«—õÀZú2×û>_@Ë“4?€ÎéoR?€£A&?€ýŽ< ?€ð$6?À ·""?À¼ó2(Þ$?ÀÅ–Æ­·'?ÀÑ_ æ¸*?ÀN(¬Mó-?€®»;º0?`:C#© 2? ÍÉö}¸4?€5ùjx7? ©¢Â9?`Œ.0ëÓ AP? r«å¹R?XßxãU?Hn ø"rY?Ø1ü4à3]?H{/=G`?ðÍòÇ9ö`?°wi+Â]?ð×3*˜W¿¬µ¢â>â¨Æ €û>æX×1Â?Q"›?€­­Ý?€&’•F¯?€bÑI’?À«pšÜ!?À¨ù 0ž$?@Ù~®ân'?€ù#ç8_*?@oVƒ‘-? ïŒ0?`«éæ~i2? ³Vówo4? B†Ô¸6?™R«ÿS9?€îîæ±5€žî‘Sû>˜*í ?Ì·"Â?î-hé™?€{›w×A?Ï–[Ð?¼h!?‰ñO$?€e!t'?Hû\—Ã)?쎂Û,?2»‘C0?€%"Ü 2?Àp,ëã3?`›@ 6?ÀšüðýŸ8?€#£ý :;?À]}˜>?0kò%JŸ@?0Öa_ŠB?Üâ„D?@‚?“•F?ðÔ%ã¹¼H?À×)wHÝJ?ð6°j¯L?Ð*S?M? ¦SÙAL?Àííò€ÅF?wñ,T'5?`…`j‚+:¿°)JJ¢X¿d’PS…è>À©Ìaðû>Û ¹÷»?hÀ‹Ç ?U;êÆ?÷YJÒí?€æ‘œ?@‰ìì Ž ?€“H—F/$?@Σ™;˜&?€„s‘.Í(?€§úË‘+?`æ†ò¤ 0?à3’/w–1?àDåH 3?àÂ$é4?õE~Óè7?@ˆš’=:?à,ªXð ?PgxK›4A?p–kÖ¡B?0;!:êC?°„¬õjE?€qH÷UF? N•lÀËF?Ài«DF?àE†ãOD?à6£Óez«)\³þ>€ƒ†G®%?ÈÓ2¼Î?À›Hc0?¼Çö?€u ‚Ö—?€¾¥Ÿæ¤?À·Iè¢G%?ÀÿI&^&?ÀÓoG'?@×Õª5‰(?À¾j0? Te=81?GîøÐ1? )‰c¥2? ")þ 8?`ƒçAOù8?Àr/‘)É9? %ñwØ:?ÀôRJûR@?ÀÛ™¡å@? )»ã`WA?Рú$ݸA?@1Bؘ¿A?àtXâA? ( ­¡A?° š–î|@?À– Üd.?@ßq¾V:"?–ÞJþ>€[ïGñF¿`v¡’N¼C¿àIÿç½C¿€ u¾C¿@žŠÀC¿ìá6ÃC¿Q-Ã`ÆC¿0šøŠæÉC¿Ðz=å›ÍC¿È( FÑC¿Xô{¿àé’ö~z¿ ìŽZQχ¿€6^ìÿêD¿Ð…¸G ëD¿`у— ëD¿0 ó‹ÑêD¿ÐŠ“ÓêD¿@ŽàIƒèD¿`›²L}åD¿vEõPàD¿Àõy.UØD¿0÷1W•ËD¿È‘à ¢¸D¿'!41D¿X+±/vD¿È –qà>D¿ Î-ܵñC¿¨ËCŒ†C¿ÉiTþòB¿€`Bj+B¿x(¯P‰*A¿Àc}ƒ@¿ÀI©ŸQ\?¿V4RC¿Dgh™¿S¿ŒïÚ@)5n¿\êš'øiˆ¿¢‡º³»™¿ø¡ë ¢¿ìÄ2¹P¡¿ 4Ðë»Y˜¿0>/Š8ÿ¿C ¨¸ò„¿Póô™fÙ‰¿À»"Í ‚E¿`hA ðE¿Ð_#sE¿àªï[q€E¿PH]f~E¿ 9÷ÜM{E¿—riöuE¿¥Hª›mE¿@&F³oaE¿¨þßðNE¿˜«½´W4E¿¨Øž3ÅE¿ Or&8ÚD¿€æŽsG‘D¿È­¢,D¿ð÷wçw¢C¿Ôñ æB¿p€Õ ÐèA¿0¶Bá¡@¿ðçkÒ˜\>¿ðÕ£ö²–<¿8I+à9 A¿HƒeóMYQ¿¤ ¬hЧj¿2I¢Ê†¿2¶E=9Úš¿x§wf-F¦¿¤ ºgzª¿äB\s½¦¿¬Š4~ ¿ðŠë ª¨–¿ˆà´h“x‘¿°ØÈqrF¿àDËì!F¿ÖÌaF¿ eZðF¿€kfF¿ žZ-F¿ „nÓr F¿°|ÎÐÿE¿¸ÍýKðE¿èÕç¨4ÚE¿X¦õÅåºE¿(ÆÀ)E¿ÀS¸»RE¿`gÞS0ÿD¿(ì—±D¿¸6¬êØñC¿×*ÃC¿8TxýB¿¨œ+~›@¿°«(/ÆÝ=¿0`|„w;¿°r†+ Ž=¿µÝr²J¿ØM$ü"c¿–É!¶€¿wÇЌ֌•¿°õ3'餿ÌT¦<®¿ˆÖy<Èǰ¿šPýG箿 –‹F§ª¿ôàÔÛ{‚ª¿pÑl›±F¿P½V§Ã°F¿ˆóذF¿P*F¿p¹xì«F¿`ýo-ާF¿0ÿ„º‰ F¿ z¹P—•F¿ˆ¥I‘Å…F¿Àœ¿>unF¿è/öº½MF¿@2? F¿ø7,¼yáE¿@“‹E¿(›êEÕE¿0§ByD¿(5vs¥C¿Ø¢ò×tŒB¿À}⟪ A¿°ì)YSÐ>¿À²ÐÅt;¿P%–õ2;¿ðó&t·C¿´4švÛW¿„xª·t¿:x‚Uœ‹¿.üLm8l¿E]Ûw¡R©¿ØÏY±¿TRÝÅ嬳¿2ű«“³¿p{ze½’°¿À''¹IG¿p0<×HG¿à=VHG¿ðFÆmBGG¿Ððè¼3EG¿—‡•AG¿ÐûšŽ;G¿@:Ql1G¿hY/ð!G¿89ÀˆÛ G¿HG~H>íF¿0^SrÂF¿H‘´ŠP‡F¿ÈJ²4™6F¿¨O¾~ÉE¿ÈnFy87E¿¸/s8°tD¿óz ÎtC¿¨E‚=#+B¿RP³†–@¿bÔ?ÀÈ=¿ªäe¸;¿°„7K‘@¿€äfýL¿ø{ hë:e¿¤[%™|¿ÒT19©¿ìDÉw8ž¿'tçèÓ¨¿ Œz ^ö¯¿ãØ¡²ë3²¿q\5¤Bo°¿°ÊØS+áG¿Ð8&S;áG¿@”Œq>áG¿0R‹Î÷àG¿ Þêä àG¿0¶XšÞG¿0Æ3»ŠÚG¿`#|ŠÖG¿8×AÁG¿p±m¦¶±G¿¨æ'â˜G¿=ÜtG¿pŸž-•BG¿à–SïÜýF¿¸cúóU¡F¿xÎBB&F¿ðXåÖe„E¿ ²ÐU²D¿0u¯ã §C¿H‡Õ<`B¿ØÍ#çuò@¿ ¨{y?¿°“w‰Ì?¿([äž|‹D¿( vb‘»V¿e•ñ‘Wj¿0¡VóMr|¿È,õÅ&Š‹¿ŒpŒ)J—¿Ì>SÍp ¡¿iÔ'ë”쥿À!­¬ƒ+ª¿€9=ï>yH¿ K¬yH¿€ÉegpzH¿pœöuS{H¿Õömú{H¿°ñBë{H¿Pß /wzH¿0AäèDvH¿ õÚL«lH¿@r¹Î _H¿`ú;ÊMH¿0F°P2H¿@=ù—8 H¿@¢Á@Ì×G¿€I „`‘G¿Ð{É›4G¿ ” ¾¡¼F¿ò"š³$F¿ð–-ŠÇiE¿/>ª¤ŽD¿V3¦C¿À//WëB¿0†%©èñB¿P¥VœCýD¿ ¢üÀª¾N¿°1̯ž[¿°aÿÖ‡œi¿, [7Jâv¿ô»1á“Æ‚¿èe­¥c‹¿†_ÞE#‘¿@Ðúw_‘¿ðÛ.åI¿FG‚ÆI¿@˜kƒI¿ ø3ëI¿°  I¿ðTëÐ5I¿êÖ!I¿PK}I¿À@8û I¿ÀÔ‰ÝÚI¿@™Ãðý I¿UµÊŒþH¿€ô8S«èH¿ðà¯Ò…ÉH¿ ÊfBŸH¿Ö‚óìgH¿pÀÔ`Í!H¿ÀɃ|KÌG¿`9Í›2iG¿Ð ¼ÿF¿­cNŸF¿Àx ®ŽrF¿°?ËÊäÕF¿£gÊ: H¿P]W(DçM¿8„à)¢T¿ÀÝöZñÜ^¿MǺÉg¿Ô3§¿r¿ØÅ/.&z¿â‰ðî«¿t@9ÎÜnŠ¿0Ó ª§I¿ Ï,$©I¿ q¢Žë«I¿@}ÐÓ5°I¿`dùdµI¿Šå*»I¿`´5]ÁI¿ O€smÇI¿)~€ÌI¿@´·Ñ@ÐI¿ð÷™vÒI¿°› :ÒI¿('eÎI¿àSígfÆI¿@ª4éSºI¿€17VaªI¿`7j—I¿€ÙD¡„I¿bš ÈxI¿ÐÆJNyI¿`ð_z­I¿€eO**J¿€"ê»6@K¿PûOo5|M¿°ÿ“ÃíP¿ØÝ¥$ÒT¿pGY—ºH[¿8E¸lÙÍb¿È@ØŸÚj¿Ü]mÞO°s¿XÞ¾ »}¿¦Ÿ!åjZ‰¿`¸þ=J¿ ü¼d¸>J¿ÀË{×ïBJ¿PZF“›IJ¿`UØæ“QJ¿P?2d°ZJ¿jóêºeJ¿P.çôZrJ¿pÛ³¼2J¿·Š`1ŒJ¿/¯ašJ¿@Z´«€©J¿Ðë)úI¸J¿€Ù…U`ÇJ¿0*åðUÙJ¿p½»õ ðJ¿Ðp1æj K¿@ò¿’«7K¿p;ôozK¿à ̯åK¿ð\` `ŽL¿@9å6ÂM¿Pn\±UO¿P–¢[<Q¿˜œzÒÔJS¿(~8a¯ÊV¿˜ ¹uÔ/\¿˜ËÒsCb¿3ÄØh¿lw?ëq¿@‡! 7|¿‡eÚ‰¿°n’zÙÐJ¿ðÏ,™ØÑJ¿`J××J¿ðßöº´áJ¿€s‹ªžìJ¿0Ã-¯HøJ¿0¥ÅAƒK¿ÐX¹K¿ð$"¾1K¿0ÉtMðFK¿V%3^aK¿FU:K¿Àôˆçâ¡K¿×œ~ÅK¿ÀÚ#• óK¿àM@Ý'/L¿°R¯iÔvL¿ßk“ÓL¿`_š§^VM¿€pæTüN¿¤}ÒÛO¿¸à]ÙkFP¿FørWQ¿¸@èQœçR¿ðŽ{çÖ+U¿¼‡áiX¿Ðèè¡ý\¿tôßõ¶a¿@AsÂ*f¿àiQa¨ìk¿¨jL2ÄÄp¿8¥æcW©g¿PÏkØŸcK¿Àñ®P`K¿ ‰1‚gK¿ÀÁÖyK¿`85Yé†K¿ÐµAlP‘K¿Ðñȳø¦K¿¦:¦ÇK¿° MÆÄãK¿`gU…süK¿À㈥ #L¿Ð@ãR³WL¿Àè]禈L¿@†Z¹L¿ íJ!‹M¿P»©+bM¿PÕ–áËM¿€-”>‰GN¿0  ûN¿p¢Ìá÷O¿h„û•6œP¿´ØFºnQ¿°QzW•R¿Á¸$/T¿Ìßu<[V¿€|w‚¡7Y¿xÕ»¯'à\¿HÁaE´`¿€¥åYIVc¿`yÒï»e¿l6D5º f¿ ~?qZ`¿p—`µùK¿€,FHäK¿à‚ÿiíK¿€ÐOCL¿0hIw$L¿ nãôL¿0Jü“h:L¿ðˆÍÌvL¿S–å:™L¿€ÿú^¤L¿àY†“¡ÖL¿°> žÿ1M¿  &ïoM¿  ü¨•M¿¨‰†LóM¿Àða N¿ÐéÊî O¿2–µa„O¿°¢ÆrÌ+P¿ø+¨- ÌP¿`>U^ä{Q¿X¼¤ÈER¿xo¶H:fS¿È”‡®ñT¿å }&óV¿ð¸7ÒgY¿À‘m9Ü0\¿Põõ´e!_¿ƒ1ºEa¿d³®@b¿P DAySa¿Ðåv!²[¿\48¥L¿p4hÜúIL¿%ßKpTL¿€÷56ÆL¿$¿y2ØL¿P_ \ŒL¿Py…¥Æ¬L¿@S›æ?M¿`ªØoKfM¿0( í#M¿ ­í¯maM¿)ôº)N¿ bØooN¿€G!R:N¿pñ0©Þ©N¿Û-CþÏO¿j»m/P¿èpx¨´1P¿WˆV†£P¿ø¿g0"Q¿€ª/ãBR¿8†‚VÇR¿HvîÝÎS¿ÐKKœQ@U¿˜ ¡Eî W¿ðó Š6QY¿ÀÕ\òˆr[¿h°ÁyEá\¿ ¸°Ø×ö^¿l²ØK'``¿ S=U6_¿Àö¡ Z¿ºÿÿÿÿÿï? ÿÿÿÿÿï?¤üÿÿÿÿï?Dôÿÿÿÿï? ×ÿÿÿÿï?qÿÿÿÿï?\ þÿÿÿï?4ùÿÿÿï?8(çÿÿÿï?bR©ÿÿÿï?æ•Ñþÿÿï?ðàûÿÿï?xEŸñÿÿï?Íô×Íÿÿï?Dí Qÿÿï?ƒùÀýÿï?0­­¯÷ÿï??ûãÿï?_Hàëšÿï?‚Ãa¿Ÿþï?[$aÝ5ûï?F{»cïï?`}>Çï?=QODï?2¹[)âí?ßåúÁ2ë?RX!iè?´Î¦"-Eæ?¦K¥XŸå?Å%/¦Ukå?:èú¤í[å?iÄqŒWå?¼ÿÿÿÿÿï?ÿÿÿÿÿï?Æüÿÿÿÿï?Äôÿÿÿÿï?ÞØÿÿÿÿï?®wÿÿÿÿï?1%þÿÿÿï?xŠùÿÿÿï?>qèÿÿÿï?Úÿ­ÿÿÿï?ü£âþÿÿï?Ö>üÿÿï?xeƒòÿÿï?á-Ñÿÿï?ù¨]ÿÿï?ZZ*Êýÿï?JéTøÿï?j9(eåÿï?l†‹Ó£ÿï?»»JÁþï?h'âO³ûï?Æ/0;ñï?)ÄíÉæÍï?sá[b\ï?š]p‹&î?ì,6*˜ë?µ¢²[yè?Xó,‡æ?Æ}¹{;¼å?ÔÜIïwå?HÚFBbå?:èú¤í[å?Âÿÿÿÿÿï?&ÿÿÿÿÿï? ýÿÿÿÿï?¶õÿÿÿÿï?BÜÿÿÿÿï?ìƒÿÿÿÿï?fQþÿÿÿï?W*úÿÿÿï?ŽÏêÿÿÿï?M–¶ÿÿÿï?Óÿÿÿï?7©üÿÿï?ç– ôÿÿï?åI×ÿÿï?ÆŸrÿÿï?ç þÿï?¤=3vùÿï?°£‘éÿï?IÁü<³ÿï?š8,úþï?‚•%õ†üï?«ZÛJôï?Þva|Ùï?¸[Ï‚ï?®w7`'—î?QGyì?.<ͶÈ}é?K§Lu-ç?Ò_ëæ?¦K¥XŸå?ÔÜIïwå?Å%/¦Ukå?Èÿÿÿÿÿï??ÿÿÿÿÿï?dýÿÿÿÿï?øöÿÿÿÿï?Êàÿÿÿÿï?2”ÿÿÿÿï?æ‹þÿÿÿï?Ôüúÿÿÿï?déíÿÿÿï?ÃÁÿÿÿï?Ì!*ÿÿÿï?ƒ."ýÿÿï?þs.öÿÿï?ÕgoÞÿÿï?Oå…ÿÿï?ˆäžzþÿï?¹±Ô×úÿï?Z‚H•îÿï?=ÐÅsÅÿï?×U<ÿï?E@wýï?+)ü­÷ï?¸ ¼ó#åï?O]}í«ï?¦” -Kï?I‰§l•í?ßåúÁ2ë?µ¢²[yè?§ÝpÔæ?Ò_ëæ?Æ}¹{;¼å?¦K¥XŸå?Ðÿÿÿÿÿï?\ÿÿÿÿÿï?Ìýÿÿÿÿï?jøÿÿÿÿï?îåÿÿÿÿï?Цÿÿÿÿï?jÍþÿÿÿï?àæûÿÿÿï?BUñÿÿÿï?ìüÍÿÿÿï?JÓUÿÿÿï?¨V¾ýÿÿï?}€\øÿÿï?ó99æÿÿï?œŒV©ÿÿï?¬OäÝþÿï?ÿãÄ9üÿï?$ÀVóÿï?Ö;ðÖÿï?¾±Azÿï?wyf;Qþï?0ö¬—¨úï?Ru¢bïï?B4u ãÍï? Æ×úuï?®w7`'—î?²‡xáì?¡¾2*ë‹ê?µ¢²[yè?K§Lu-ç?Xó,‡æ?´Î¦"-Eæ?Øÿÿÿÿÿï?zÿÿÿÿÿï?6þÿÿÿÿï?âùÿÿÿÿï?'ëÿÿÿÿï? ¹ÿÿÿÿï?òÿÿÿÿï?ÜÎüÿÿÿï?±ôÿÿÿï?µÜÙÿÿÿï?ØÅÿÿÿï?U^Rþÿÿï?3fúÿÿï?ÐÊdíÿÿï?n‹ƒÂÿÿï?p26ÿÿï?F,ˆmýÿï?¥Ä2¯÷ÿï?Õ°cåÿï?“Ånâ«ÿï?üù[úþï?pÛ“âßüï?^B'´®öï?} ºn"åï?Žù´]*¹ï?Ìh—´¯Jï?ðÌòâ>bî?²‡xáì?ßåúÁ2ë?.<ͶÈ}é?µ¢²[yè?RX!iè?áÿÿÿÿÿï?–ÿÿÿÿÿï?šþÿÿÿÿï?Fûÿÿÿÿï?ðÿÿÿÿï?(Êÿÿÿÿï?ôJÿÿÿÿï?¡ýÿÿÿï?ϲ÷ÿÿÿï?B\äÿÿÿï?xZ¤ÿÿÿï?¸‰Ñþÿÿï?`üÿÿï?\KXóÿÿï?:sÿÖÿÿï?4^;|ÿÿï?j8‹\þÿï?åñ“×úÿï?æÚúïÿï?lOžÏÿï?ÉÍsmÿï?.Tš&Qþï?t‹®E5ûï?¸ÍÐÚÙòï?–ØÙßï?('F*7¯ï?Ìh—´¯Jï?®w7`'—î?I‰§l•í?QGyì?ì,6*˜ë?ßåúÁ2ë?èÿÿÿÿÿï?°ÿÿÿÿÿï?ôþÿÿÿÿï?~üÿÿÿÿï?Dôÿÿÿÿï?ÞØÿÿÿÿï?ó}ÿÿÿÿï?fQþÿÿÿï?q0úÿÿÿï?hîìÿÿÿï?ÞÀÁÿÿÿï?6ÿÿÿï?uýÿÿï?+Þ÷ÿÿï?v68æÿÿï?U¦¯ÿÿï?ªî+ÿÿï?>­èýÿï?³›Îûöÿï?(ׂbåÿï?BQ€5³ÿï?¸Ómn(ÿï?‹c¶ ¶ýï?/~ÙÚ úï?Q®Ÿ³Üñï?–ØÙßï?Žù´]*¹ï? Æ×úuï?¦” -Kï?®w7`'—î?š]p‹&î?2¹[)âí?îÿÿÿÿÿï?Æÿÿÿÿÿï??ÿÿÿÿÿï?€ýÿÿÿÿï?º÷ÿÿÿÿï?¼äÿÿÿÿï?Цÿÿÿÿï?ÚÛþÿÿÿï?æJüÿÿÿï?xôÿÿÿï?¨’Ùÿÿÿï?–…ÿÿÿï?n@}þÿÿï?|ŽEûÿÿï?Pö[ñÿÿï?øB8Óÿÿï?æÚõxÿÿï? \doþÿï?Ú…rûÿï?„*, óÿï?”gÜÿï?Æ`ªaŸÿï?ŽO¦±ÿï?ÖL¼x“ýï?PŠÇLúï?L9fŒkóï?âJÕEæï?#,êäðÏï?('F*7¯ï?²ôäq‡ï?êÜaï?Ìh—´¯Jï?ôÿÿÿÿÿï?Øÿÿÿÿÿï?zÿÿÿÿÿï?Hþÿÿÿÿï?dúÿÿÿÿï?Âíÿÿÿÿï?üÄÿÿÿÿï?$Bÿÿÿÿï?¡ýÿÿÿï?Ìxøÿÿÿï?~Hèÿÿÿï?Ðíµÿÿÿï?°ëÿÿÿï?ÞSCýÿÿï?&¦»÷ÿÿï?bçÿÿï?ãå·ÿÿï?®Û¼0ÿÿï?4M¹ýÿï?ÚÕÐÀùÿï?ν¸[ïÿï?EÚ&Õÿï?Ž‚=ý•ÿï?ŽO¦±ÿï?®9øÐýï?:Ï\kûï?jaT]÷ï?,b7‚ðï?âJÕEæï?.þÒ°Úï?#,êäðÏï?ä ^¸]Éï?øÿÿÿÿÿï?äÿÿÿÿÿï?¦ÿÿÿÿÿï?Þþÿÿÿÿï?Wüÿÿÿÿï?Dôÿÿÿÿï?šÚÿÿÿÿï?œ‰ÿÿÿÿï?æ‹þÿÿÿï?îwûÿÿÿï?Èÿñÿÿÿï?-Õÿÿÿï?`|~ÿÿÿï?n@}þÿÿï?Žûÿÿï?°Ðóÿÿï?x¼ÿÿÿÿï?â8ÿÿÿÿï?0¾ýÿÿÿï?xŠùÿÿÿï?†Ìíÿÿÿï?ž”Íÿÿÿï?8õvÿÿÿï?®L“þÿÿï?”Lüÿÿï? ÆŸöÿÿï?xeòèÿÿï?(%Éÿÿï?vF*‚ÿÿï?rWçêþÿï?4M¹ýÿï?Ú…rûÿï?j9Rc÷ÿï?j0q±ðÿï?ÆþL“æÿï?ªÄlÃØÿï?àT Èÿï?= M¢¶ÿï?º ©å§ÿï?Æ`ªaŸÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?ôÿÿÿÿÿï?Øÿÿÿÿÿï?Šÿÿÿÿÿï?šþÿÿÿÿï?Øûÿÿÿÿï?¾óÿÿÿÿï?BÜÿÿÿÿï?™ÿÿÿÿï?ÚÛþÿÿÿï?ÜÎüÿÿÿï?8÷ÿÿÿï?~Hèÿÿÿï?è9Áÿÿÿï?<ˆ]ÿÿÿï?RÑeþÿÿï?΃üÿÿï? ÆŸöÿÿï?ëgêÿÿï?òlÐÿÿï? šÿÿï?®Û¼0ÿÿï? \doþÿï?%c#ýÿï?$–Æûÿï?¶~døÿï?Töôÿï?ν¸[ïÿï?¸4¥êÿï?ÆþL“æÿï?FU$Käÿï?ð?þÿÿÿÿÿï?øÿÿÿÿÿï?êÿÿÿÿÿï?¾ÿÿÿÿÿï??ÿÿÿÿÿï?Ìýÿÿÿÿï?žùÿÿÿÿï?Âíÿÿÿÿï?Ìÿÿÿÿï?qÿÿÿÿï?^yþÿÿÿï?àæûÿÿÿï?œ4õÿÿÿï?4+äÿÿÿï?jé¹ÿÿÿï?&Tÿÿÿï?RÑeþÿÿï?”Lüÿÿï?&¦»÷ÿÿï?s²;îÿÿï?xð?M×ð?Õêð?:˜ ð?Ú´$ð?uð?e«·ð?´ïð?*[ð?òv°Fð?>œoóð?ñçDð?’ÄA7 ð?ª2æa&ð?Óvî‚ð?1`'º¼ð?œŽêÜð?5Eضð?Xª_î¦?ð?–Š0—¼¼ð?áÙQ^ûñ?lú²çÒô?¦ eQö?×ô.7÷?BR½HÙ­÷?˜TŠQÙ÷?yHŽYç÷?ð?að?Nð?„ð?›ð?ç5ð? ºð?–ð?N ð?vð?ïjð?¾ènð?Æèð?(LÈð?8=9ð?Ø—°Âð?`”ð?ßì`µð?è¢WFð?ls¢×að?ý}™Dð?d 1*ð?oCÒbz ð?Þ0£>ƒ*ð?4#uïzð? ˜…­ŒNñ?+¡E&+ëò?œÞ7ƒŒëô?QØÖ‘Amö?×ô.7÷?B-<aŽ÷?BR½HÙ­÷?ð?Rð?ð?Ëð? ð?»,ð?K™ð? ð?_Uð?Šð?[Uð?«Ô ð?ÿÑð?cã ð?2ºT+ð?ÈÝ ‘ð?NÌãð?ÌJW?ð?ᲈð?¨=YàBð?†K²n×ð?Æp)1¬ð?fg¬Sð?g!v§9ð?±×'T1Fð?–Š0—¼¼ð?ñt€ ºñ?ýšâRpIó?œÞ7ƒŒëô?¦ eQö?‡`+‰@ºö?8ù¿!‡ýö?ð?Cð?åð?ð?m ð?{#ð?‡xð?’˜ð?~§ð?¦ð?@ð?ÖÐÖð?uæÌð?žšM ð?Š:¾ð?€iødð?Ðð?Ûºo ð?ƒ‹ð?l9ªð?åô'Rð?yü ùð?ì”-¯$ð?Âöð? ºð?•'ð?›Nð?4ð?§·3ð?6`ð?l2‹ð?î,"ð?x Ì ð?›qmð?ª…Cð?Ûºo ð?:ŽNnð?*1˜ð?‹l{ð?Išc¶ ð?³(.hð? Á0(ð?òê?ð?ÑXî…]ð? êÿ*}ð?ågUw˜ð?,ÞÚm¨ð?ð?ð? ð?"ð?ið?@ð?Ëð?f ð?á!ð?cð?è ð?Ä:ð?½ ð?±5ð?d…Dð?©Y¶ð?¶üÙð?±°ð?L͆ ð?›qmð?¼Ýê>ð?÷XŒŠð?%î#ð?ÿFð?ö XNð?K§ð?Išc¶ ð?Õ«ažð?Uáúð?ì”-¯$ð?kĤ ,ð?Þ­¼O0ð?ð?ð?ð?ð?;ð?³ð?ð?!ð?ßð?q3ð?’ð?’˜ð?ôcð?ÁÛ ð? cð?â;Qð?WÍð?¾÷ð?±°ð?x Ì ð?«Éóð?›ú2ð?È”¡gð?¼ÛMÈð?:ŽNnð?vð?½Îøð?Ù¾ÿ÷ð?åô'Rð?~“´· ð?Išc¶ ð?ÔyÚ ð?ð?ð?ð? ð?!ð?að?ð?1ð? ð?¸ð?sGð?QÃð? ð?²eð?fê ð?K #ð?íþUð?WÍð?¶üÙð?î,"ð?Ë&âð?ÙaOð?Ê $ð?ª…Cð?uÄwð?¼ÛMÈð?HSy:ð?vë€Íð?vð?*1˜ð?l9ªð?½Îøð?×£p= ×k=…ëQ¸=ìQ¸…ë= ×£p= º=p= ×£°Ö=×£p= Çó=¸…ëQ<>®Gáz .>¸…ëq J>S¸…ëœe>úÑ‚>*\ÂŽb >fffæà…¼>p= GÊÑØ>*\—õ>ö(\PëÅ?R¸ž©çP0?Ø£PôßWL?†ë¹áa˜h?HáZrN…?€ø1ìa¢?…+5ïùX¿?Rhü€î»Ù?ÉeƧ)÷?ë[æ$ª@)œù°¦Oç?Š:ÄÀÖ?ç¦H À¤œèì ø¿öÈ2C._á¿ÂÆ7ÛÈ¿‡[–ôTÜÓ?= ×£p=j=Âõ(\€=…ëQ¸…œ=¤p= ×ã¸=ëQ¸…«Õ=R¸…ëÙò=™™™™™e>¸…ëQ„,>\ÂõhÄH>ÍÌÌÌqd>áz®Á>°GázOÓž>ìQ¸ž ¿º>ÎÌÌ\M1×>fff"¶ô>fffHf?\ÂQ[.? ×cHþI?\ªˆÞif?43oJfFƒ? ~3~ ?šÙ é"â»?3¥­ÁÖ?ͳ¨ó™ô?|$Zšj@>>æ‡!Fô?Î ¥A­ÀÀþâ¶ À†+·ýÉäþ¿ g~‹cªé¿ÖC;™ ÜÕ¿ÎLï»ñª¿ö(\Âõh== ×£p=~=Gáz®Gš=ÍÌÌÌÌ̶=R¸…ëÁÓ=R¸…ë!ñ=q= ×£° >< ×£ðµ)>Ø£p=jCF>Âõ(´Jb>= ×£`œ>›™™™·I›>ìQ¸Þ‡·>p= G¢CÔ>R¸Eâlñ>Uê ?¸…ºèŸ)?®GÁ‚‡äE?{Nù­¤b?®wö¯œ?Háòñžš?™™ƒ†¶?×ã‘eñÏÑ? Þ¡ï&ð?R°;m7þ?gj{W{åÿ?\WÍÚ!ñ¿>'»ò À|&êê¬Àáb'÷ø¿ g~‹cªé¿R˜ÚÃýì¿Ãõ(\Âe=efffffz=…ëQ¸—=¯Gázî³=Ház®7Ñ=ëQ¸…³í=…ëQ¸— >¸…ëÑ&>)\ÂõüB>âz®Gþ^>®Gázð“z>®GázÞÀ–>…ëÑq³>®G!9“Ð>Ãõ(DR0ì>]Âm…å?„ëÑW-/$?¹ÆYù@?…;Ïe\?®ïÄ'–w?x˜/h“?33¾$v¯?®„ÔÙÈÈ?¸þì(4(æ?™]å|Îö?¸ªÜ¯=@(gA= î?\–(åÀ?&©¡n À|&êê¬À†+·ýÉäþ¿ìOæúËøÀÂõ(\b=¸…ëQ¸v=…ëQ¸…“== ×£p½°=q= ×£°Ì=Ãõ(\’è=®Gáz>…ëQ8ò!>4333óÁ>>R¸…+âX>…ëQ¸Ö u>¤p= ·ä‘> …ëÑ¿7®>¤p=Ê‘mÉ> ×£õOå>×£pw“Ç?fff‚m€?Q¸Þe¹P8?×£ 1¦áS?ìQÝŸp?Äõ˜7Á»‰?£p[–á5¤? Wªaá¾?×ã↫Ú?Sðàd<í? à6ùžý?4Ë›.9ú@[ïÓ窳Ø?\–(åÀ>'»ò ÀÀþâ¶ À H®À®Gáz^=Âõ(\r=™™™™™™=×£p= ת={®GáÚÆ=43333kã=R¸…ëu>®Gáz×>áz®Ç®7>âz®çôR>âz®‡Îo>)\ –Š>âz® !¦>®GáÈTÂ>˜™™Ùa3Þ>¤p=Êu·ø>ÌÌ̃?…ëøQ(0?> ·ëȺI?p=ʘ8d?âz¨H„C?33ìlV«—?¹Þ5ÉOi±?zF‘Ì?>ªÛ²¢ß?Ì8¹oú÷ñ?H I<ôÜÿ?4Ë›.9ú@(gA= î?\WÍÚ!ñ¿Î ¥A­ÀÂmþaÒÀ­Gáz®W=ÍÌÌÌÌÌl=ffffffˆ=43333³¤=ö(\ÂuÁ={®GáZÝ=Ø£p= Ÿø=R¸…ë•>{®Gá[1>¸…ë‘rK>p= ×µf>¸…ë˱‚>hfff„œž>= ×ãRç¸>Ãõ(lÂÔ>®Gið>]³^Š ?R¸žuf$?ö(‰©ò>?HáªæˆW?×£ørߊq?33㜯„‰?ÃõfÅ0ý¡?zôZÁ»?öh#_6qÎ?3³ùì²á?Ì8¹oú÷ñ? à6ùžý?¸ªÜ¯=@gj{W{åÿ?>>æ‡!Fô?]ÿHp9Ìæ?Âõ(\R=Ãõ(\Âe=R¸…ëQ‚=š™™™™™ž=Gáz®‡¹=ÍÌÌÌÌ<Õ=­Gázšñ=¹…ëQ >„ëQ¸ž(>®GáÚC>Âõ(,*_>×£p=n>y>\Âõ¨N”>…ë@5°>†ëQØå£É>)\:8ä>z®K+ ÿ>®GáIÉ­? ×#/¯Ã1?q=J?$J?®ïÛpËb?> KFzHz?†ëWO}Ñ?¸ž¡`­©? c¯¹º?öh#_6qÎ?>ªÛ²¢ß?Sðàd<í?™]å|Îö?R°;m7þ?|$Zšj@4QÇM½@š™™™™™I=`=ëQ¸…ëy=ÍÌÌÌÌÌ•=q= ×£ð±=¹…ëQxÍ= ×£p=è=ž>R¸…ëÂ>®GázŽ9>ÍÌÌ̬kT>ffffJ1p>Gázüt‰>›™™qУ>¥p= ؾ>333£b,×>ÂõÀ]Yñ>…ëŠ ?…kˆ{n"?ìQ8ëÔ:?áz¤…`ÜQ?Ø£xç¢Èg?*\Oã+ˆ~?Ö£ÂÓÄ’?GáïÄRç¥?™™É™Þ¸?I= ˜_È?×3hÅÝ‚Ö?öswHâ?{l‘8ðê?3÷ùD?!ñ?âºðá”;ü?433333C= ×£p= W=> ×£p=r=š™™™™™=¸…ëQ8¨=…ëQ¸žÃ=ö(\Â¥ß=Âõ(\^ù=Ãõ(\4>)\Âõó/>4333óI>…ëQàzc>¤p= Ÿù}>Ãõ(\tÌ–>)\ÂÁ±>*\ÒRÉ>)\²kâ>? ×ûJú>ÍÌ̧ÖY?Âõ¡ìú(?[⼃@?ØqU?]BÏøi?*\Oã+ˆ~?Q¸×ö‘?…ëÆñqÞ¡?š™%þhq±?B‡jÂI¿?330\ÐnÉ?Íìy;žÒ?¾|ïÿØ×?·žnó­Nã?)\Âõ(<=)\Âõ(L=h=Ãõ(\ƒ=[Âõ(\Ÿ=áz®G!¹=43333óÓ=43333{ï=)\Âõ¤>)\Âõ!#>ÎÌÌÌLn=>Âõ(ìfV>áz®ËÚp>Ãõ(\‰>> ×£¾Q¢>Gáz”F_º>q= Çt¡Ò>¯GáòwÅé>ÌÌÌ Žf?)\BìÜ?¯Gáa-?¤p½w¬äA?ØqU?Ø£xç¢Èg?)\¿Ôey?âz¸Dg‚‰?Âõ>Ä1á—?®Xµ Ÿ¤?ÿ¿¼=\?°?®Çà+ø·?r}.˜gd½?˜™’³%§¿¸…ëQ¸.={®GázD=\Âõ(\_=¤p= ×£x=£p= ×£“=†ëQ¸¯=ö(\Â5È=…ëQ¸Æâ=\Âõ(àü=¯Gázþ>{®G!“0>Házn±H>…ëQø'b>> ×£”Pz>…ëQJÃ’>p= ×=Fª>ÎÌ̬]Â>®GáZv+Ø>‡ëQø•ï>š™™‹} ?> ×ÍJœ?¯Gáa-?[⼃@?áz¤…`ÜQ?zž©Mb?™™©°££q? ×›FŒº?…1iPeŠ?š™¿É› ”?ázÆž½â›?ÌÌÆë¼i¡? ·ñ.–ˆÕ¿{®Gáz$= ×£p= 7=×£p= ×S=¹…ëQ¸n=Ãõ(\‡=áz®Ga¢=Âõ(\O¼=Âõ(\’Õ=ÍÌÌÌÌHð=Ház®Q>š™™™ó!>*\Â5(:>¤p= ·ÉR>q= דj>\Âõ¢s‚>¹…ëG"™> ×£°*¿°>|®çÚÆÅ>R¸erÛ>×£pÍ]çð>š™™‹} ?)\BìÜ?Âõ¡ìú(?ìQ8ëÔ:?®'#J£I?ìQXœdÉW?¥pÍ/ïžd?Ãõ@ ù“p?®;úˆx?ÍÌÐL•€?ìs[„?…땜 ×£p=•=°= ×£p=êÇ=fffff¶á=âz®Gíù=)\Âõ»>)\Âõ±*>…ëQ8ºB>ëQ¸UÔY>…ëQhzq>)\½)‡>{®GÀý>ÎÌÌŒÖë²>†ëQ¸3Ç>R¸erÛ>‡ëQø•ï>ÌÌÌ Žf?ÍÌ̧ÖY?…kˆ{n"?…+ú>‰1?Ø£0!ml??®§Ñ0YJ?¸UQâŠT?(\?l˜]?®GÑu»“c?×£Ðvæªg?ìQ`íâßx?{®Gáz$=¤p= ×£@=333333S=)\Âõ(p=\Âõ(\‡=ö(\Âu¡=)\Âõ¨¹=> ×£pÒ=ÌÌÌÌÌ´ê=…ëQ¸â>\Âõ(P>333332>|®GÁAH>p= ×óü_>p= ×?¡t>Âõ(\³÷‰>…ëQDÑŸ>ÎÌÌŒÖë²>|®çÚÆÅ>®GáZv+Ø>¯GáòwÅé>? ×ûJú>…ëŠ ?r= »ƒ?®Ç­·g$?q=Êa:š0?…«VC09?Q¸¾Yö·A?33³˜¢G?Ø£ØDqK?¯G‘x8Y¿š™™™™™½{®Gáz=¸…ëQ¸.=¸…ëQ¸N=¼…ëQ¸>½efffffv=×£p= ו=ÍÌÌÌÌ̯=®Gáz”¬=Âõ(\rÚ=\Âõ(xõ={®Gáš >43333¯>Ãõ(\ϲ7>âz®§vP>)\•äd>Âõ(\§¤v>> ×£Ðk>{®G胡>Âõ(Xµ³>]Âõ­·Ä>HázÍÕ>q= 7¿å>Âõ4Åô>? ׌c?®GáÒÉ?áz½¡?®G'0@"?fff±G4)?)\Ï)Î0?Äõ(cŸø2?{º_]t¿oζFBâà=]Ùyvø= MÓNía>“cñÍø1>¬þÐh-9O>à\v>œk>¼†K¸Aˆ>»Æ7…Œë¤>æulÒ Â>´ôÈL ºß>y;ÌPû>c8!=~?³ö’;4?ñç¨&Q?có€Ud m?Ï`aˆ?ë½ÂJF1>ÃzõõèøM>ûw?MXj>´c2{T‡>EÂÜzã>úÓxÁ>ÁYv˜ÄÜÝ>Q«êé°ù>CÓ ðÿ?¿ûJÛÉ2?7œæMWéO?KùÒpíj?;OFèA†?wpê“·¢?þ¾ŽPÔ¾?¼ÅèÜ×?OŸM¦Ÿñ?¤òô4@\r&L²ý@ùÛUæÀC$@ÙÕÊû3Àì…]QÀZiñŽ¢EPÀû![:Z%X@¨–[ç{Y@Å…*Bcÿ¿ß?6¯CÀñW.ïCÀW9§6Z~KÀ]ȼâUjÝ=¿äm#­õ=»ÉÔ>e÷Öj/H/>Óß¡âê K>Éج4Æg>ºkhn…„>aŸ#9Ë¡>kÀçt¾>¸Ô±‰™‘Ú>XW´®ö>Ö×3–U?|Ðý>c0? îk B§K?C)F¤£&g?¿%.2ƒ?ò1%êXeŸ?žB: .¹?Ì¥óE¯Ó?†îŒ3í?néÄ{Q@í`;&Žî@|U:dÛ#@3äk- !À§œ{Wƒ~HÀô‰|Í»êVÀ¹î‹%y¦A@i®`%´`@Q,‰eæÝI@¼ƒÈãô6ÀEb/*HÀiw.À’?Ào’¤³1ÝÚ=ùlOÂL¯ò=¨›ËÆŸ’>Öú(+>]¿Ý8ušG>à¿»¼¦`d>Sà”r°Û>àÈ<¨ë6ž>œ:Å'ɹ>V‰ÏÍ¡@Ö>É^‚®câò> euhÜ?HG`°Æ*?MºÙkXF?þJ¦[šb?¹nưÏR~?{>Åá6˜?,hÕŒg³?Fv‰äÍ?—úÉ”¢æ?‰°¸1uþ?© yΠ@Ç]‹’!@»¶Îòö?B)OIÍ*5ÀýÝ+®2UÀ‰)‚BýMÀ]΋+ÑW@©–Ü÷öÜ_@Š5%‚ÄôG@…ÆìI3Àë¿(|=@E– jÀÖ=êaÂØ½ï=ð¿T€+ >Hox.pµ&>?ò!þ`C>>k`Ô`>Æß1twþ|>þCyF’˜>çªZÒ—˜´>ì5ÚFÔ©Ñ>S¾ªPV˜í>š‘M¸?qÆIÑü$?[¶CYTä@?»ãbë’[?øÆ[ömAv?Ü|¼‡÷±‘?Ô™@P—«?é]‹¬ îÄ?®LþQÓŒÞ?áÙ¨ñõ?°º‹Â7< @ÎÁ$™L7@6rȶTu@£e1ú2jñ? Â×!˜FÀ0—_¿@úXÀàæ0*Ô’BÀ0a‰ôŠW@Z³å›`@E §uYS@dwðmgj@ñÈu‡‚ÂÒ=«‡ÈIé=ð9±b>A> +VÌì!>e¤ºÜ>>-ÄZ¨7Z>»ò»Ë¥—v>Q ÜºÄ’>„Ÿ_V‰V¯>ÏZwÊ>Œû'}òå>ï¡Xj ?^’³—þˆ?¸'‘š3ð7?ºû¸/º7S?j?µÊGvn?Àå|Ň?/it·-¢?~Ìz)¬»?8²l ÛrÓ?ï䵿Hˆê?ɱ'÷º@oAIr@²·‹0þ@ÌgÈ[X$@)ÁhÀW‚¬¡ˆšKÀI jC YÀß'F™NÀ` Æ ¤>@Æ©4€æaS@X€Æ «i@bȼâUjÍ=ù‡ÛÙÞõã=úûç0>T^®äš>kÎGK 7>Õ÷£|µS>$,Ó p>'0ùñu€‹>‡HÐÐ\„¦>Ž® ’@ÖÂ>ì¡iGµÞ>SÔî êø>!~¼?]K¨¼0æ/?çYË©I?û›–Å[‚c?K¥ËˆýÍ}?noìAÊM–?8œÔøA°?v ¼ÿçÆ?C…[Ô`ÑÞ?D;ÖPÃjó?¹·ÎìS@éñoû£§@¨€Jümu#@ç¹ #@…U¬˜A1À«:#¥U§FÀ"›r•³UÀ8 ¥]WÀ£Fd6buQÀá096KÀô¡ÏÅ=@€ mÁÝ=”ÒÒÜ<3ø=ä%K¬ú>;o,O Õ0>jÉÄ<ïK>å7ïö#yg>±ëK–ö‚>—í[3Äž>Páõi>¹>@<Ã'NÔ>Ú#Ò(ð>ñ÷,}/… ?°ÚWñé#?ÄÏÅ0„¶>?ûÐ ‹8RW?KbŠÉÑfq?¸fIfi‰?&ž=¦¢?J7uMÞ¸?ù÷oAeÐ?à±Z¢Zkä? °xSq÷?CZz¼@žÑˆxÀ@ “m|#@F+ÜŽv$@Õ†ì³(µô?à)³w­4À›muh׸GÀ[KP³Ê*OÀ(ƒ·—vôaÀ¿÷l5‚À=GA,;)Õ=>â)–ãñ=Z Wù6 >Õå«I'> È+ C>*a~hÎ_>˜­Î)êmy>˜ïùÝG3”>O†“ù¦#°>Z–#5uÉ>湉ôã>˜”ïö°åþ>µÃÆJ¬?÷LéŽïß1?rÊÑÈQ–J?Ä(Ó,gc?S‰0s·{?í®j„øH“?jâG:ª?O-öÞÀ?•4²MÙÔ?—¬JÜ2è?ömÒ©Þù?SÕ‹Sb @ –äQøR@sˆÝÕ’!@óø+h÷$@éXÔÉøN!@¥è„Þ(p @÷áNP¹Ì?2WMiFÀ+NZô+6¶=Ü艹§ÐÌ=5 ÀFˆiç=Ë€Âîè>ÀÏðËìÔ>…îZK‚»8>ö‡ÛÙÞõS>ÙÇË$D³o>æÌ±(‰>RÃ0É'¦£>ðˆûо>ï)ø»uk×>EÑÜËñ>ùO†µ¦ ?`A+#Ó¯#?‹X§]â’"])ÇbI/>of/‹H>ð½Ÿó4Lc> hq$×}>wý½7õþ–>NGÍ —t±>'l®ÊLÊ>XñÍ*ƒ‚ã>Ë›·´¤˜ü>Œûy‘=˜?i l¬)-?LùÚ6D?+hËÑZc[?:’RlÆr?w–¦‡?ßÝX“}œ?#Þ'߆ܰ?œ><Ã?EøýHÔ?'ë³ÕOä?e©ÝaFòò?ÆÏ?M>@~®XäM @çPs<»@’þuö@0¥¥uA@|ÄiÕ¹3@œ¯Áx!i¤=@Ì%™äœ¸=V`õ:œ‚Ó=H?o¿Äî=sóÕõÚT>„&Díâ">øŽËϽu=> 츋V>RCS¢!=q>°[O-–ë‰>¹vf¹^£>˜ÃÆJµy¼>4¡€ú*¶Ô>1Š—í™í>ÕÍRyÔ?Ÿ MßÛ¸?x&.ÿe3?˜~…1I?¯šiVÙc`?*1 _t?š8èèqˆ?ÿr`@,œ?<6vÎx¯?@ðÙØ·5À?`%H£°õÏ?E˜ÍKŽ}Ý?–›4é? K¬®ó?į7}"Fû?ï©é‚‰+ý?‘©ü;Ë׿iQ± V<@¿ìòo6˜=‚r ϰ=·ìòo6È=J¡è?Oâ=-ï6ýÿfü=ØœüR>òý{ÂÜè0>™¤²º¡I>¢™dù c>+7ÁÅâc|>…{x¯”>!Ë–u>Ý­>E9b­¿-Å>/©ïŠŽ¦Ý>ÕˆvHSô>T)vtX ?Ž|kø!?/»™‹ë 7?|»É_½L?c¶ÔÇh]a?9{¤‹p@t?[cÑ Á´†?z6b?X˜?Ic.¸KÔ¨?žûµJ›ð·?J¦fuªÅ?fÏØ•9Ò?È.d DÜ?²g¼o£2ã?}gWGÉä?†öK™7£Ð?YÉ{æÓü¿¹ìòo6x½ ¯Áx!i¤=ç§ï ¾=•ð[&Å5Ó=$8V÷,·í=Vß@µ¹>|Ù„¤$#>Ì‹‚®„;>Âë<Ç¥)T>O樃šìm>§/ÆõÓ‚…>ž¬V(Ož>Úˆ´òÝ´>›ý`ŒhºÌ>­jHã>fðÎU1ù>²EgñÉ?qÑÁßÀ+$?&Ä]L|8?´Á»ž»L?9›ZóŸG`?6"DLÁq?+I$ð†‚?Å..f’?c»€‘L¡?1xžËb—®?gËðï4¹?Š«ì¦Ã?C¾ AòÉ? ¸Â]AÎ?Œý~ïÍ?†Ö?›i=Ç?ð艹§Ð¬½Õ)$gK›=T‹‹ë@й=?Ì%™äœ¸=“Ž;ý¢ªÏ½²ëÌø=6Ëžó¥È>wÀ§%ƒ*>»1ñb=>gÆž+_>¹©Àv>G€l÷ôÓŒ>ð2¦.à¡>È[åœkŽ»>¹jKûÀ€Ò>{þ8~Uÿæ>-8$ãqªû> Ä™Ö?Žå"ÀC %?¡-cÈÖ7?’·àq™äI?’Z<Æ[?Žø”ìŒQl?yô½Y{?ÕfmÏ÷ˆ?¨Út+΄•?÷áfO¡?ÅŽ‹—Ïœ©?½eÒ•Îß°?"¦åX¹±? l‰;r˜?ë¶ôr´??Ì%™äœØ½ØÁ\¿‘µ±=¯Ôôß=ÑÖîr7„¿=¶öíHwn¾e¨¨°0\ýnÄoŽž– >ãp^è Ò >ò½Ê6ñõN¾ò7=Û±7P>òæàØ(™s>q{“jY}>É™éÿ•…¾Æ½ÔÊ” ª>‡¦”HÊÈ>[w2ÁÏyØ>ƒ¾¯I¹HÚ>#/*³ßÆ?AÆÈ?tÍ™\ä'?´¸—å[4?{Ík_¹H?4’}:,CZ?öÃ'Ëh?œá¼uGu?ûyó*Xí?BSqîD"Œ?÷&áê#”?,=ò8†Œ˜?Jå!Íû„?Z´õá=¹¸¿‰Y <·¿ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/Level_0/0000755000175000017500000000000011634153073023311 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/Level_0/Cell_H0000644000175000017500000000041111634153073024356 0ustar amckinstryamckinstry1 0 7 0 (1 0 ((0,0) (15,15) (0,0)) ) 1 FabOnDisk: Cell_D_0000 0 1,7 -0.0360610976223246,-0.0568850165998844,0.6704599494051,0,1,-1.43409920413226,-31.651356264397, 1,7 0.0621460507482347,0.0556250858670073,1,1,1.49151340193743,1.04738084818682,12.1880020306236, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/Level_0/Cell_D_00000000644000175000017500000003412211634153073025017 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (15,15) (0,0)) 7 ଴Ê4w?˜IMÑ„=?8AMéa#?Œ[‘ý3)?˜ü¯h¯,?ÌïK#aæ,?˜¯³ì=w)?økGÕä"?@rQ…åÞ?G;êhÞú>qsä«Nõ¾€`Ü•9 ¿Ö¤í)5¿€×ŸéN÷ ¿€ï:–íÈ¿6Í·›í¾`i³q|W?hù©´­?àm©¾¦Å$?ÀLõN ˆ+? …"¡‡0?¤Û“üe0?0h¤ˆV»,?x$ЛXO$?ÀÉôäx?^Üì>€3¸ +¿¢ê‹Í¿ÀBÇf ‡¿€Í·¥UY¿€š^å—ü¿œ$q4¥ñ¾-=îÉÔ?Ày›^74?ï]éóS'?HaW¸0?–r™Ã3?*S¡WÞö4?4—ë,Z]2?X=`w€'?€õÖ÷ª»?¬§csdé¾€ìe¯Ñ¿€TTQ‹ü¿@øžG"À¿¼zÊWd¿À¯=Ò¿•ƒs÷¾ |$æd?`|hã-ã? …åQF*?ÌoÓŠîò2?ì>÷ 9?€Æ¾³Ô=?•Lª¥;?ÈÕõË’(?°[uâ ±>€Ùûbê ¿ þ@†G!¿ H.¼É&¿`&\QŒ&¿à!£èR"¿ëššðˆ¿€ •ç(¿à­F*c?ÐlÇ7ßR ?çäo],?6ĆÄi5?ÊSA'??S,J>jbF?ð¸üäÅ;L?°…YÓw !¿@²Yž\~?Àw­Ÿ7¿ÀÎE u®/¿Àûˆ`î²2¿0Wª“1¿€29(±H*¿ ô*¤³K ¿€sés¿æeãY?x¿ 6D ?0–§8,?öësB”{5?ÒŒøXv@?5+}G>M?%± í Ic?¦}1{ø;x?@ÆF}ñta¿o”~ r¿0ÄO¿à Úº± ?¿ w(_¤U9¿€Ú6Œ­'2¿ çŽ_¡%¿ -Ó­ ¿§à›¸j?¡ð{ï±?bm(3¸)?Aê°8_D2?D²ûÄj9?ö¥ëjW?|h)i£•?.·¤ì7–?¼¨ïpÅ¿Ôj<Ƚ=”¿jeÅOˆy¿ííç@gK¿È±}ÎâA¿ ÙkR%V7¿@z=Š¿*¿À}èKCo¿°/„ Y?pw¸ãô¤?€ñÁ^í&?¤ö˜JgË,?ì#HÃâØ.?Â!)YØ®t?>o›Ñ¯?¹ÒÒZÍ’ˆ?ŒôYÕµ™¿v`μ6v¢¿ödé$™ Ž¿(×YuùéR¿½æ¦–úD¿PfñÌ8¼:¿€”õö-¿À)u\W¿Pµ´%>ã?ë(àø?šüg8d&?ò]…ã,?¤&<%.?¨&öj¼§t?Øuf¼Ð¯?d¯Þdõˆ?6'dÎà¶™¿þ8䥙v¢¿þËѶª Ž¿„¬Òî8ïR¿ ©ºHE¿€V€À:¿`{aqù-¿àRî¢W¿´Õ]ÿ?x‡P† ?îäR‹+(?o 5Ò/1?EWÛ.*8?ޱɼ¯V?@Oo•ï•?É·ªñ–?ï÷èË¿øž²¥@”¿ lQ˜Žy¿ØåKæ6…K¿à @ZžA¿p LŒ­_7¿°å’‘À*¿ ›êãËl¿Pí pÛ?°T!øAâ?èeÕQ)?$|wiX–3?H7Á>Ÿ>?"•iëL?§•Ý'ûb?ÏZn x?’½Ç=Ý™a¿Z7=r¿0j%Z˜QO¿˜”5$ìù?¿¯æqy9¿xYeÒ+2¿8[Ž®“%¿{¥àmŽ ¿Ø¬Ù[˜?Ä1¼h$?ùÜÕî(?Þ­ndS¢2?R6ôçÛ;?„²´ŠuD?jó†ù'&J?H± (lÁ$¿€‘‹Õx?פj!¿("»ù¯0¿€U Œ®3¿¨Â…1.1¿ûH•*¿póûþó ¿@ì,ÅÓŸ¿ÀéT˜Œwý> t)$3¢?˜æÒÄÈ#?htœ±|¦-?œÑõHÔ‚4?àB×W9?H²y62þ7?°D*c ?@aŽüi¿àãÿmO¿oÇ 3#¿°3®=å\'¿ðnUø D&¿ôœÎ °!¿à01e¿@Cʉþ¾ÀÛBi.ôõ>`«ô.º?ÐdjΉ¦?èSÓ$?ø!kBŒ*?k²Å¡Õ-?ÀklÒã)? oè˜?÷À¶=Õ>à‡h`+M¿ðNsN¿ð ÙI ¾¿€úA—>T¿@Ñý>ÁV¿ànôU¨Ø ¿@0zÛ†Üó¾ÀÒ tuÊê>Ðô·a°D? /"w?HRâF›â?H¨ˆL~p?P_N`Â^? '"*‘?ÀÂ7.ϼ ?@‡-è>ŠÏ´ Ÿõ¾ðL]T`ê¿@¬ßêZ9 ¿°Úÿ½e ¿€”¼Ç¹t¿à®”¿òøÿ¾€iÁ'æ¾ah„ÛYòÑ>ý•B– ë>ýÖ}™ö>6ÂD'ÿ>ÖÐO3Ð?‹½]œ?™¦¶;€?TLð¶]ƒó>p±`¨%\Ô>®_ PsؾízöE쾊[î"2ò¾¡QuäÌ€ò¾~ìXµ ï¾am¢þjä¾ Â³®_a̾p®˜öÜN¿ÀîqN´þ¾ús¢kú¾€µ‹ þìò¾€á‡€’þrô>êJ‚|ý>¬'ߎKþ>^†7ikú>çu`¦nó>PWÄеå>h¿È€fÁ>Üï›ç%Õ¾ZËñ½Eå¾xÌÍê¾pÅonãë¿(¬"tò—¿h$L¯…¢¿@ùþIÐa¿À翟]ú¾ ¢ËœÂ˜ó>ðS„A£?@UB¨?€ŸOFµ!?DjÚ¶—?€l‡wñ ?€_|ȉU?„ˆ:Õ>Oô¢Rùñ¾€ºxyý>¿€§ˆ\|¿ˆ^ €Xu%¿°Û’ê–$¿  &‰"¿ØB$ççð¿4™è/ ¿ :Óßä×ý>À^_2Œo ?ð%ïŒò'?¥Œ&?ÀJ«ÊòT"?€ö€eßD?¾º©ïO ?\üÞoÑ>Ô¦×;¶¿Ú–GÀ˜¿ÀO›RA¿ÀÅlÓ§I/¿ˆÙÓ»ãˆ.¿<Úžao¢,¿Ä<ëþ¤v(¿ÐMc½+¿À…ͽåñ> åIÏI.?(=MIâ6?°ÈÚÞ1?êÖë&y+?À¥™ì©è#?@uú@ñ?Xåg%HÔ¾À^g`l¿[Nä'¿@}n‘„¶ ¿,9ŒhDè4¿|—c~Ä4¿\rR^Ôc4¿PŸ5ge3¿lp„ëc0¿¸+¬85É¿üÏü+^c9?‹;*±ûóQ?¶Ã]Ð1?à·A¼å6?@.Ö–fÒ.?@TlV?bMÀ¡Uÿ¾yrZÇê¿ è¶Ê•&¿€0z[ï)¿ä9dgñL:¿„i™’w:¿b4×íò:¿Ä,áºO<¿0=PBÄ]>¿¨:qÌÈc>¿ÞËuüÙF?y8Ê^ß^?~Ïé8O‰?f²`¡Í‘w?°~Á’Î…L?€å9€?@Æñ„VZ¿ · 'GŸ*¿ÕIòøm1¿ð£9‡?A3¿¶:›¬ŒŒ?¿†ëC¿Zâ?¿ë4¯_Áo@¿dÒ³ƒ1ÊA¿ÆTe,{xE¿~?³”.A¿‚‹Ã»u;’?? E)äz¬?\'jò¥?Ö±Ãè8•?&Ñ1“Pt?û`Kp? xñ é{-¿ ½,¢=6¿€wSuÜ9¿péTÝ^;¿]zŸ½™@B¿cµc|^B¿?¢®¯B¿”ÞZWƒC¿ 6ÖÔÅE¿``Èšø?+•$ûqË“?8RX‹?;>•™?Cæ2¬x†‰?ÂíPÑ¿¬l?à8¨·at8¿€kZå˜$@¿°<,ò‚A¿¸ìÞ4B¿ ŠmzI~B¿+¾ËŸD¿¢ ,ŸD¿ 0Õ® †D¿7P¬s}D¿€ ¸*"B¿@¢9¬«ÊT¿öžiÀ•¿^ä ë¿;˜~ûä‘¿ZÉ ×!Œ¿]ÏÿW’s¿Â^˜ ÁM¿è ž#£æI¿øÁ1}:H¿PgrmVáG¿X-‚›´—G¿d±½…üF¿Mß.–ñF¿1사O­F¿š&abF©E¿42²ÇOeB¿DûÐïG¿%LZu‚“¿x›Ûk ­¿¸ ô’«˜¦¿Š}rž‡–¿„êxÈQŽy¿ìÀ(=JV¿ÄŽwNZQ¿0Ó(ôøN¿Ô‰ÛR)M¿t§1ñ}gL¿»AqŸ^I¿z©ì¨LmI¿—À †qI¿aJë^:I¿Wsû‘ŽH¿ûÄT Ñ3I¿÷X´ÉTÓ_¿Ú¶°ÐG‚¿2¨ Åê‹¿e:@£dÎ|¿|3yi+¤a¿<#÷4gáV¿üè㌑œS¿Âçž ‡¼Q¿úDgnıP¿’Â¥3¹:P¿3Ô8š®K¿ÆB“ríK¿c»~³qL¿5I „]M¿ãºV¸çUO¿Çû &qR¿¨Á1é[¿êT ä|šc¿²0¶pY¿zÅ“ÌýZ¿–1že%÷X¿”:Eßw¨V¿ì)6‘º¡T¿nú¨«¿'S¿¿:);R¿d”46¨ÊQ¿rWqàªÝM¿Váf¤NN¿Xçðï}HO¿P֭P¿@1þ1ÊR¿ÂßµG{¸T¿ÞIªH7-X¿Lå)Ö Z¿ˆ}G œY¿°l²»ªX¿®p-SoÃW¿†<)qrV¿~û“VBU¿ü¥~žT¿ÐóBNxHS¿2˜*QêR¿¬Ü/…O¿*ËÅ%«P¿>ÛDŒØ–P¿ðë=„Q¿ù]ô;åR¿òBº:Y¾T¿H;–Q¹V¿˜À+´>üW¿Žã-*X¿ÖMš1ÉW¿ n¬e$W¿ö˜¿‘ DV¿d¦ÓAWU¿4%A/ŠT¿OfÇL÷S¿îo"«S¿O̬FRP¿•ä‘ê™P¿¸ÚX,Q¿|d£ Ä R¿Éx®h¸LW¿lzV†.W¿xè‰ölÁV¿9úò$"V¿BˆP¼·rU¿%;Ž!ÔT¿Ý°¤Fr^T¿äqG¯M T¿ˆå.RšP¿:hþ¬]âP¿ …½ÜrQ¿W™Ú¬ßIR¿¾Ó~:þ\S¿°xñ–bT¿²¦ÜøE±U¿ÒÿõSƒV¿´!™‘½åV¿N’rЦáV¿ìþj‘V¿ZgIy2V¿„LáÙf}U¿Pk!TJõT¿î´öüZŽT¿½XTWT¿ð?ð?ð?ÿÿÿÿÿÿï?ëÿÿÿÿÿï?nÿÿÿÿÿï?þÿÿÿÿï?Qüÿÿÿÿï?Vþÿÿÿÿï?$ÿÿÿÿÿï?Ãÿÿÿÿÿï?öÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?úÿÿÿÿÿï?hÿÿÿÿÿï?øÿÿÿÿï?×Àÿÿÿÿï?Vÿÿÿÿï?4æýÿÿÿï? ÿÿÿÿï?²ÿÿÿÿï?¢åÿÿÿÿï?¾üÿÿÿÿï?Ãÿÿÿÿÿï?þÿÿÿÿÿï?ð?ð?ð?úÿÿÿÿÿï?ßþÿÿÿÿï?®ßÿÿÿÿï?ߦýÿÿÿï?)úæÿÿÿï?Â^€ÿÿÿï?úÏþÿÿï?ˆuÿÿÿï?6úÆÿÿÿï?Òõÿÿÿï? ÿÿÿÿï? óÿÿÿÿï?Œÿÿÿÿÿï?þÿÿÿÿÿï?ð?ÿÿÿÿÿÿï?qÿÿÿÿÿï?¯ßÿÿÿÿï?‡Óúÿÿÿï?dŽrÿÿÿï?´>g÷ÿÿï?½R Äÿÿï?æëÐTÿÿï?Žj±ÿÿï?"”Fåÿÿï?s”¡ÿï?´Gð1Ôÿï?@ºÆôÿï?i ÿÿï?tšyöÿÿï?6úÆÿÿÿï? ÿÿÿÿï?¾üÿÿÿÿï?öÿÿÿÿÿï?uÿÿÿÿÿï?»Ãÿÿÿÿï?)úæÿÿÿï?´>g÷ÿÿï?£É©©ýÿï?´‹ÁD”ÿï?º4÷²f÷ï?çE×NÝÏï?ÊDZP…èï?¤ú¡4üï?´Gð1Ôÿï?i ÿÿï? ×£p½r=˜¯=ö(\žß=âz®‡k>Âõ(\7Ž>Ház¦Ú%>4333Ã>ìQ¸…´ê=43333›´=„ëQ¸…s=433333+={®GázÔ<¸…ëQ¸Þ<{®Gáz,=43333Ó=¤p= ×ÓÏ== ×£ ~>¸…ëñH>q= „5q> …ëÁS#‡>Ðಘ>Ãõ(\kè€>ö(\rR>p= ×Ó^>Ház®ëÌ=\Âõ(Ü~=433333+={®GázÄÌÌÌLâCq>š™™Y*±> ×£$9Ïß>GázÄ߯ù> ׃·ƒ ?¸…ùÄ|ì>]Âq[Š´>×£p=Õ0o>> ×£ ð >Ház®ëÌ=„ëQ¸…s= ×£p= =×£p= ×G=Ö£p= ÿ¯=Ö£p=êƒ>ÍÌÌLâCq>> ×+qëÆ>®Gѯïƒ?š™áõì"J? ×§w6¸k?fæ³iVŠ}?¸‡ oS?ìQˆ0ýg?? ×cèÂ>×£p=Õ0o>p= ×Ó^>43333›´=R¸…ëQQ=ìQ¸…ër=> ×£ð!à=…ëQ¸Ú·H>Ãõ(¡Ê°>¸Å­?™™v‚ëj?á¢nF{°?pÿV7ÁÖ?H%®¹§à?Ö¿ò‹ °?áz˜•´a?ìQˆ0ýg?]Âq[Š´>ö(\rR>ìQ¸…´ê=[Âõ(ü€=ÍÌÌÌÌ ‘=áz®‡k>âzn›’p>(\ŽÆÞ>ÌÌZcBI?q…:6jT²?³´–kÂð?ÖÔÿ­heÜ¿7¬ÃíÓ¿> Ãjë?Ö¿ò‹ °?¸‡ oS?¸…ùÄ|ì>Ãõ(\kè€>4333Ã>gffff.¢=q= ×£p =¤p= w‰>*\"—Úƒ>†ëÑàí ö>R¸¡,ƒêg?Â>Ù¢Ø?›OL/}Ñ¿T'A  ö¿²{Ïòö¿7¬ÃíÓ¿H%®¹§à?fæ³iVŠ}? ׃·ƒ ?Ðಘ>Ház¦Ú%>ö(\ÂQ³=q= ×£p =¤p= w‰>)\"—Úƒ>…ëÑàí ö>R¸¡,ƒêg?Â>Ù¢Ø?›OL/}Ñ¿V'A  ö¿²{Ïòö¿7¬ÃíÓ¿H%®¹§à?fæ³iVŠ}? ׃·ƒ ?Ðಘ>Ház¦Ú%>ö(\ÂQ³=ÌÌÌÌÌ ‘=áz®‡k>fff&n™p>FázíóÔÞ>ËÌ «šI?â :Ú|]²?³´–kÂð?ÞÔÿ­heÜ¿7¬ÃíÓ¿> Ãjë?Ö¿ò‹ °?¸‡ oS?¸…ùÄ|ì>Ãõ(\kè€>4333Ã>gffff.¢=ëQ¸…ër=> ×£ð!à=ffffš1I>ÂõH÷õ°>›™™‘ò?gf Y„i?â¢nF{°?sÿV7ÁÖ?H%®¹§à?Ö¿ò‹ °?áz˜•´a?ìQˆ0ýg?]Âq[Š´>ö(\rR>ìQ¸…´ê=[Âõ(ü€=àz®GáG=áz®G)°= ×£p¾>)\BFTq>{®ÝÙÆ>âzĽ™ ?r=jxe>J? W•]tÎk?fæ³iVŠ}?¸‡ oS?ìQˆ0ýg?? ×cèÂ>×£p=Õ0o>p= ×Ó^>43333›´=R¸…ëQQ= ×£p= =„ëQ¸…s=Ház®ëÌ=> ×£ ð >×£p=Õ0o>]Âq[Š´>¸…ùÄ|ì> ׃·ƒ ? ׃·ƒ ?¸…ùÄ|ì>]Âq[Š´>×£p=Õ0o>> ×£ ð >Ház®ëÌ=„ëQ¸…s= ×£p= ={®GázÄ<433333+=\Âõ(Ü~=Ház®ëÌ=p= ×Ó^>ö(\rR>Ãõ(\kè€>Ðಘ>Ðಘ>Ãõ(\kè€>ö(\rR>p= ×Ó^>Ház®ëÌ=\Âõ(Ü~=433333+={®GázÄ<{®GázÔ<433333+=„ëQ¸…s=43333›´=ìQ¸…´ê=4333Ã>Ház¦Ú%>Ház¦Ú%>4333Ã>ìQ¸…´ê=43333›´=„ëQ¸…s=433333+={®GázÔ<{®GázÄ< ×£p= =R¸…ëQQ=[Âõ(ü€=gffff.¢=ö(\ÂQ³=ö(\ÂQ³=gffff.¢=[Âõ(ü€=R¸…ëQQ= ×£p= ={®GázÄ<“ð[&Å5C=jéB^Ô(’=‡"5²®=µØ o \ú=ÁÁ¤¸">4ךy\Ý]>‹¨…be‰>ÂQ ¦Î‹¤> }—!Âwœ>`§l¤yt}>ÜRFsxK>ËR ×­!>Æñ 8'Ù=uFˆ‡Ñ¿=Ì)$gKk=¹ìòo6X=jéB^Ô(’=X¢èË]¯=2¹ÿ6`>‚B™m4>V[>ãÝw>òŸÓÞS²>õfl|Ýâ>tð‰l Ãþ>29Mù8õ>[ƒÔܾ Ô>HJåðñ¢>x¤–öWód>xVÑÙ ë0>qþþ¾Îþá= »y9ícÁ=Ë)$gKk=øâHúç°®=ÜU”Š>·£; Z:>çñÂ%5…>e<;ÔQúÈ>iÕz0m?Ú‘ZǤ9?deYpÅÙV?ÒIRÕ,O?aËÔÞ9+?;»ªòçÚõ>¢¤™¯v·>‰ž'r> º>sp5>´˜¬b›ýá=¼Îß=´¿=Ù*Xú=ªøÌ¿ô!4>ÃL)eG…>^ÑP¸{0Ñ>™“¨KOG?«Y¤ÔàW?®CczQ?ê»÷ž®?”y²téŤ?]Èæ`/W€?KçÆÞF?*Ûƒ¶ž?]ø÷Ö컿>‘²»3)r>êv%â0>Ù•årñüØ=Ö¹„õ">ÑæD‘– x>aWÓœ4É>„E„‚i?P11%´a?Ð|®¥Ð£?½DâùÜ?ôUŽÕª­ú?aîJPAò?HèŒ[7vÌ?A¼á Ka“?ÙFܧºP?v'ܺŸ?s¬é‰w·>4.Z@öd>˜=Ò¯?Ž!>˜ˆY×^>w µÖ¶²>p…ÀÚ?È>d¢íJX?Á99;¤?ЬB¸ä?—éžž-@u>XÏÈž @Î|ˆ‡ZÀ’(É%¼¢@'e,顆×?Y_ʯ`“?‰4ðBáF?'Œ"Ùõ>((®¤y¢>m+»šùkK>èä®`¥mŠ>ëéþñ0Óâ>@‡µr :?$£½%”?ÁøÎy(ÃÜ? •@ç@G¡½H¿¦?ÀO8ZÍA`(@Ì͈ŠÅ‹@Úå Å?à$Àí~Ó¶ƒ@·RufÌ?Œ\á£eK€?2Ëø×Ò+?[“^u[ãÓ>sÍ <8}>YŽ.HÏî¥>äm:ùYV?¬hŸÕ—%X?ÖMmÁ°?ß·Fý9ü?È_ø6Í!@çcþ^ :@G#À¡ó"@E‘®@Y¥¹J@Ö¦€Æ#ðÀÆÝxfAÀñ?¥Â2À²/¤?ÐÒº ïN?õ—¿±ÖTô>Ú¦Óôî›>ݽطà¥>j-Ì”e?TÌÂî%;X?llQŒˆ+°?écU³Pü?«ñ ¸Å@Ý+üNÅù?4û–-Ó0#@Š×”÷ªw@À__^*–ÿ?l väŒÀ‘¿¸ifÑñ?2øQEB¤?‚íƒ7N?Ñ®¯Ôdô>Ö"M]`›>3ú°ˆ‹>™»»yRèâ>³€y£H1:?pFú|$?M²ÌÜ?ú ¥Ðty@IêÉ…?À¨tô¥¦J'@ò¨–5dZ@Îݳð(R$À5#x Ó@³›OsÅ{Ì?ü#‰å^€?ᜊ=n;+?'F?Œ9Ô>Ô…f§úh|>¡¼T¹V\>æm•ƒ¢³²>,”<ª?ö±„¼ X?ÚQr¤?H\ÁRÜDå?É/uÐ^m@iŒ€cI@?[®òÀÔ‚ùø@ë di-§×?b—4”Æ|“?Ççž¡üF?? ^æ÷õ>’»šn,P¢>/ ¿y\O>ú«æ´âÓ+>íýI¼v>è“4¿äÈ>°ñëÕ?cþeêÿ…a?<¦À¤‘Ü£?-˜Ö“2Ü?€i3Ò.ßú?åÄŽ‰ùgò?ìO5æ±¼Ì?K]‡Ó—‚“?ýíMaÑP?O{A¯¼?AW_·>ÁVçØf>$w½ÀÕs>¾ë¶iå=N­ü;ú:>RüGt«\ƒ>vÓ‹ÌO—Ð>àB‰fÂ?6¼{‹wW?»×@'±Ž?ÐÂ7´®?'@$&K¥? »á$}€?ìB!FñG?,-ÿ¨X¾?Ý Ú)~¥¿>£6oæ’s>¯Yx‰§!>©¸JL¡î=žœº­¦Å=1ïë’ñyí=²úG‹@>ôdíRd‚>ÇI»ãÇ> ²uš/?}€°uv8?ý%’V?6ëuí!ªO?5»õÑu+?l¨ÀÞö>[b™<šb·>_ƒùm “s>«ÈFÝÇ'>³g)$3íô=@*Ý xõ =°¯Áx!it=úåꑱÇ=Ë)¾Û–Rì=i/ ÛÑ/9>ŒS’¼ét>Ü¿w½ïÕ°>dïhGš4á>v,U\åý>:äûö€õ>¥±ÞP?Ô>Ðì_¢>-8;lÛf>3chÙâ¥!>¯þr•òô=_r Ï =gÞÀßTé…=Þ艹§Ð\=*ÐŽOsÏs=á•×'tTÅ=X³Y‡æâ=»v#„æ )>Ly({Y>•’XG^ˆ>²{­·»£>ñŠüë >­ë ÂäÓ|>VŒ_àÇO>1©M¢ïu>Yz’kµµî=H*Ý xõ =gÞÀßTé…=—ð[&Å5C=ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/Level_2/0000755000175000017500000000000011634153073023313 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/Level_2/Cell_H0000644000175000017500000000144711634153073024372 0ustar amckinstryamckinstry1 0 7 0 (3 0 ((16,0) (47,31) (0,0)) ((16,32) (47,79) (0,0)) ((0,0) (15,15) (0,0)) ) 3 FabOnDisk: Cell_D_0000 0 FabOnDisk: Cell_D_0000 57427 FabOnDisk: Cell_D_0000 143527 3,7 0.000123574951404949,-0.000261496071620161,0.999999872987951,0,1,-7.27595761418343e-14,-8.73571458115667e-12, 0.000143709885486915,-0.00478884312328285,0.970098103276923,0,1.00000000000034,2.35741026699543e-11,-69.8068507474696, 3.90762097082775e-06,-0.000125109249088338,1,0,1,-7.27595761418343e-14,-8.73571458115665e-12, 3,7 0.000573975627946068,0.000106206355961681,1,0,1.00000012701207,9.31748149014311e-06,0.00103413668989589, 0.025455072597842,0.00355185409053659,0.999999999999664,0,1.03082358023593,2.02575873247442,16.2168929191, 0.000128260274768373,-3.46368442564332e-06,1,0,1,7.27595761418343e-14,1.3103571871735e-11, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_2/Level_2/Cell_D_00000000644000175000017500000046437111634153073025036 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((16,0) (47,31) (0,0)) 7 uñ¿|2 ?Õï‚!?0X͹ñ!?u'§ÁÉ"?º—þ6œ#?üò¢²h$?æWØÉ.%?}"î%?Êꛦ&?ßSYV'?# ¶tþ'?$"ê(?šY–?4)?O®dúÀ)?Ïm£ŸC*?e´ð´»*?ðMÁ(+?`6NŠ+?ñ¹èß+?* X ),?XõŽe,?t+_Ï”,?f¨ˆŠ¶,?TLÈoÊ,?©ép:Ð,?ýI[²Ç,?WÏ<­°,?&¸ë‹,?oN‰ÏV,?îò,??Ýé‘Â+?)Ûb+? ø+ð6 ?ßè?R!?CÐÑèö!?v†)TÏ"?¼¬±0¢#?Uéo$?;òXœ5%?Ç$3Rõ%?J,Ç­&?®ý†^'?dÅå(?±³ §(?ZV<Ú=)?ˆCôË)?¸æ”/N*?S¿à½Æ*?„åä@4+?%ùí@–+?6î•Iì+?)léê5,?|«¢ºr,?¼ävU¢,?fr`Ä,?ÝR_ŠØ,?ã&/Þ,?î$d/Ö,?ükoE¿,?Ñ ý²™,?C- le,??æC%?e4ºÖ&?Ìå3½&?t³Çàn'?QÊe(?Þª"I¹(?—MQ)?Ì"›;ß)?3*ÛPc*?­|ÒÜ*?{ívCK+?vÚ(+®+?¢™,?á ‡O,?°g ,?Ÿ:gk½,?¡%kà,?âVÌô,?<:ˆ@û,?Û¶–8ó,?ÿ°†Ü,?éÙx ·,?™u½·‚,?Èý0’?,?ü½£²í+?öIzO+?yÂzM ?$qµK1!?ÖáÀ"?0*'ë"?xkÿ¿#?úUƒüŽ$?Ql©W%?!7Š–&?NæPÔ&?Adrb‡'?ž YR2(?%žY¥Ô(?Uþ9Þm)?æP~ý)?Š"$ƒ*?´/öý*?HyµÏm+?¦é¾Ò+?*N*,?ÊÞv,?Ôªô,?ox®$æ,?©ƒ¿Å -?í¨úM-?b´Gp&-?`ËNì-?vÇÿ-?U6 9ã,?Ñ+Ö®,?ŒÝ%hk,?KHÑ,?¢}v¸·+?Ó=Æ^ ?¡afbD!?CšV%"?#åÓB#?Ý´vÂ×#?àz›l¨$? V]Ôr%?Q=‰6&? ·¶ó&?´£Â¨'?ö.ÎÛT(?Ë®°ù(?«=ñE”)?âGÙ%*?b/6S­*?_VÊ0*+?Xòpï›+?äÂò ,?µòŒ \,?˜ß(s©,?Q±Èé,?x€ž-?«ÇéŒA-?ÿÐ5X-?#MF`-?ùú\xY-?jk‡”C-?´f€s-?½Âÿé,?å^i7¦,?a0S,?!³À&ñ+?¦¾¸ºt ?þ= !\!?–ñLô>"?áqÔ#?UûÿZõ#?›ŠÈ$?wNQ²”%?±Ò¢Z&?Øá{'?—DÂÐ'?¦Hlû(?k°©§&)?«9“DÄ)?§½¤MX*?Â4£<â*? SŠa+?ã6Q¯Õ+?é<%>,?d˜ífš,?NÀ†óé,?pN,-?6¡¸ÿ`-?¢ —™‡-?†À¶Ÿ-?iÈ¿ú¨-?[’P£-?å„@Ö-?ˆ<®i-?í]õ}4-?+Ù·Eð,?íÇaœ,?¦]oÙ8,?½ZçŽ ?æÄrx!?ÜÒu…]"?uõ<¾=#?ý;[¶$?Äemî$?)¨þ2½%?ÈVÇÔ…&?§ÚºpG'?'DŒ(?þ%¨³(?§öB])?ì: ×ý)?axÜ”*?ñÉ^Ç!+?‹® ¤+?'r,?¤ap†,?Ìq”uå,?ê†ü¥7-?.§/||-?{üÂx³-? «#Ü-?cö-?;¬RÔ.?îåü-?ùÙ{©ç-?|©;Ã-?¦¬±Ž-?8ágJ-?Áá65õ,?•‚X,?f 2­ ?Ïi7=™!?K~ˆð€"?U éc#?i™Â½A$?X(E%?¥•tBì%?'‘ ¸&?Üíç|'?éò,U:(?·Ü,Öï(?ÐXýäœ)?©•ø@*?éE„Û*?LÌ4øk+?DÂñ+?‹ùãMl,?éGÛ,?F`Y=-?¶B§²’-?R÷ƒÚ-?iœxC.?r>n?.?ùãCŠ[.?<Б(h.?uðtçd.?ò8ÇtQ.?ë3-.?ȱR ù-?C&Õ³-?Ø]ã]-?¢%G.÷,?«ËÜyÏ ?v=ƒ_¾!?igi©"?…/?E2]Fº.?¾œÙa.?=È`÷-?‡£ÜG!?rsü"?öø#?‰+Ê·ô#?É®K¾Ý$?ç[•Á%?Ô@>ÉŸ&?Ø…läw'?âµlI(?ò?³á)?®î ¼Ö)?§·*m‘*?Ó8[_C+?:žòõë+?‰æÁŠ,?š±§}-?ÞaS§-?¨=¨#.?Rñ×z“.?ÿØõ.?ñAÐJ/?SiX/?y:{Å/?PáÀ™ê/?ƒèBÿ/?€¡ÚÚ?0?ö}bÎó/?_g&ÁÒ/?âîýŸ/?,’EWX/?ݾ-­þ.?Šäé;’.?cX ?L!?ÙÕIF"?÷Ÿ-Z<#?ðT .$?G¸fJ%?7aÃä&?úQ#è&?5à*Å'?N$¾ì›(?nYÅk)?óŸ+4*?zö»ô*?VJ:Q¬+?‘7DÓZ,?ñ/iÿ,?“1`™-?»¾¹ÿ'.?&ôºˆª.?_6§7 /?hi¼Eˆ/?ªàÈêá/?€ïu£/0?€hÄio30?‡-UH0?ôéF‡T0?<&o°W0?€Í—î„Q0?€*€ÿÂA0?€&5(0?€ÍÁƳ0?CåêG®/?6™½Ì>/?vz”ê{!?ìì|oz"?æ^QÏu#?Ю#m$?D|ˆæ_%?µf(³M&?Íp«'6'?BØ2Ú(?¾` Võ(?ÕùSË)?‹!]Ÿ™*?|ÐëL`+?Ä,?¢ÆÞœÓ,?lƒÝâ~-?³ß]š.?º‡§þ´.?ðÚMC>/?ÒŽM•º/?€’Ê=Ž0?Dù§~D0?"þŠ­l0?€îÖD­Œ0? žs¤0?ÌS·u²0?€UH¬u·0?€Kˆ¹²0?œÇUñ£0?€¡×ÔÜŠ0?€8e\Jg0?v90??Ãm0?>¯ÍC­!?uIJ"?žìO³#?uÞ8°$?äx¨%?‘LªÙ›&?h2/Š'?žZ6Àr(?ÆŒàuU)? L²1*?t´•é+?¬g‚Ô+?,2×™,? žË8V-?¡94ë.?ýVÁ'±.?˜©8N/?f‡ðÞ/?€Îâ^10?Å9ÊLl0?X²rÉŸ0?€¬º›ZË0?*«…î0?€Æ/QÑ1?€\vÇ1?€34p÷ 1?“yø1?€"^hl1?ÑØzø0?H²¼yÔ0?€)÷P ¥0?•4b@k0?Ë¥Þ!? WÙí"?Ľ4õ#?Qùö÷$?4/êõ%?H—m)ï&?Ò±0ƒã'?TÓ–ŸÒ(?,²¼)?ÓõvOŸ*?{ý`Ò{+?üîmúP,?[éf-?Néƒâ-?Âqfi.?ž:üM/?hò]ó/?€dÁèQF0?HŠÖkŒ0?—¤•|Ë0?€Ëæ¼ÿ1?©CÆm21?€fz=Y1?€¤¯åv1?8¤aߊ1?ª‹$¨”1?ÓbóÄ“1?D~WŇ1?€ÑÀñFp1?€ÊæÊùL1?S× ¨1?ÌTåPâ0?À‰ùÝ"?,LGB.#?zT5„<$?ÖýʃD%?{Ò±H&?á/\^G'?*2B(?CB,8)?V[ÚÕ(*?Ôb8ª+?@^ ø+?˜oçwÕ,?? «-?¦E Px.?§A:&?–ÉT'?˘“šh(?÷}y)?AÞõ†*?¶€+?¢s’•,?[a<•-?v×·Ñ.?Ù¿¦šƒ/?€3äŒ 80?€7§©6ª0?v>#Ê1?€C7(=€1?Qøâ1?:†VV?2?€2¦”2?©›{(â2?­ôö'3?ÄI³b3?c¾Ä¿“3?}Q’½¹3?€ó  Ó3?ߦCà3?ê+Æxß3?€×ǰ¶Ï3?€`µw°3?RùY3?€Ê­c9A3?.F'2#?ØéÖVU$?áàzv%? À–&?já¡Ë³'?è€ã€Ï(?iá ½è)?Wê×ÿ*?î¿hþ,?ÀÅ)!-?ÃD+.?àî%Ö0/?Ž •!0?bæ­z”0?—(ª 1?u¯01?€‰èxyð1?€Ií>;Z2?€¯iƽ2?ØxŒ[3?€ÎÅM+o3?Z_ËV»3?€íà‹ðý3?¬,þ54?€ºÖnzb4?ý-KY‚4?€P2¨‹”4?VÛT˜4?€ziÆÃ‹4?€ØÝ°Õn4?onÄ`@4?.¾o–ÿ3?ý$1!w#?¾o $?f=:È%?ç¦6=ï&?°Bá(?«ªKà8)?|ÁåZ*?›÷ Žz+?àIëg—,?·ëòò°-?b„Æ.?†ºqÂ×/?€Y@Óq0?Šëºô0?9³ t1?;«0~ï1?J$߇^,Y4?€‡ß˜Ý£4?€!¬Íã4?CtÇÔ5?°—ù¾>5?-IÃPW5?€m&M`5?µËl}X5?õ¹&»>5?$p¤þ5?€‚µ•~Ñ4?cqŒÌº#?À¬´‹ë$?Èq‚ &?ž\ÊÖI'?Úüšw(?¨Ï9¤)?eðŸkÏ*?+˜«Úø+?r’E -?ä£2ÅD.?ëµg?f/?€“3Î÷A0?€€þGÎ0?Š }X1?q*Iß1?€H¯’jb2?€ ØFá2?IÃK/[3?€Öß5`Ï3?€G²pÿ<4?€Úîo£4?€ºÜ³ª5?vÈЋT5?€;†5?€¾èLÚ5?x} 6?€åöO«)6?€l¶"a96?€ž±)76?ó3îš!6?é +`÷5?€Q™ã;·5?ù€ÿº$?ÞT28%?‚ˆån&?ñsb¥'?:ÿžzÛ(?lÏÿ*?H‘´E+?'õ¼Py,?ŒÚLy«-?¦}*ÂÛ.?Ž÷¥Õ0?s=Oš0?€3õ-1?€“Æö`¿1?ÁVÎN2?#v:œÙ2?-Í£Da3?€í÷&aä3?‘,˜%b4?€+L¦«Ù4?iï9ñI5?À#5×±5?:öÁ 6?(jhsc6?ç¹/Xª6?Ì>ã6?€klT~ 7?€of|b$7?í¢e-)7?€¶Ü&7?€‡~b«ò6?€êD¡C´6?0þ]4F$?U„%?nØàÂ&?ó-ÜR(?m×ìí?)?ï0É“~*? zɽ+?x1j:û,?‰²8.?Ý¿Þu/?°ÊX0?€Üì—yô0?€^ÅÑ”1?_¤ûõ(2?€¨·)À2?€ø æ¥T3?€6BWÎå3?mgër4?€Â`)û4?ôÜZ˜}5?Ë’¢&ù5?€¿M- l6? ¥¬Ö6?€“\„Î57?€7 Acˆ7?êæ¤Ì7?ùŽ­8?{_A}"8?—Ä08?€CY('8?€Œï7ã8?€“p£QÊ7?jbÄ,Ñ%?Èç­'?n`8](?Š oV¤)?ó±OKì*?yXaØ4,?nòÐ}-?‘„õÆ.?€ôwÚü0?€ò½}<¬0?€¶c¿ûO1?ý®îò1?€ÿ(&¹”2?}Tì43?€7éÓ3?×Y¿cn4?,n~S5?€ý~ü™5?1kÉe(6?€âÆÒp°6?€ÀGÖ07?€ú~4#¨7?~Ûݶ8?€üÁt8?€É-ÞDÆ8?€5Qú9?€#¸…â49?»šÍ8M9?ô­“M9?€,œkh39?'¸–'ü8?=·?CÐ$?Jê»m&?&aÊi'?°‹®¸(?ÈKG*? M¥jY+?ÛhP/¬,?Öè8.?6;ZU/?€Y¾º¬U0?€…Õ’ò1?€[†9J¬1?6‘qW2?€yb›3?€óV#Ë«3?‘*)T4?O2$iú4?€gP«ž5?€àg\>6?à…‘Ù6? ª`o7?€¼¢%þ7?96?“”Ьæ6?›3]p7?€”`m[58?€C© Ô8?²àOÜj9?€Ë¬Kð÷9?€y:?O‘Kîë:?&^¢M;?€$š‡*›;?€GœA/Ñ;?SÔì;?€üåWè;?ñJÈÕÀ;?[_ÜT%?鎮&?>‡j (?g˜àïh)?>GSÊ*?·³.,?VЖ(–-?!S¿/?{ü¼<70?€q4¥ï0?íR戩1?fj—Íd2?€™MœJ!3?I߯Þ3?-ÄGõœ4?€‚9Ëp[5?6–å·6?€‘@t'×6?‘$éô’7?ªÕ'L8?ZïÏ’9?€füÐ˱9?«c$[:?€·ü û:?€lïËî;?5âgcô&?9½dW(?è„ l½)?"R9b'+?Í_+)•,?­ÚOí.?ÄfÔ|/?€fã\}{0?€'¸:1?[Q%ü1?€#;N™¿2?\Ÿj…3?€}‚L4?öR‹5?¦v²åß5?€lf#«6? f²v7?5L´×A8?€¸Kz§ 9?tj‚üÒ9?4ü¿n–:?âÂùHT;?€ƒÁ} ?¡A`bÁ>?pÄý??V<ˆ'??R¬;??z,¼Ï%?æO6'?dâI (?.Ÿ³F*?Qo© €+?XÒ‡¡÷,?Rõs.?]t<ªô/?€š}v–½0?€?€ä¤ÅwN??€ä× æ??@2ð(2@?À]1?húü„'??@3Î2@?À¶[æe@?@=S–Â@?îÝŠA?€2 ׋UA?z@˜Å„A?€’LœA?),‘<&?ÅÞ®'?ô.†Ï%)?¿Ì½¢*? ßèM$,?ßÈ׬-?3¨a8?€î&m??À5&©»7@?€ŽRhµ@?Hª/›-A?çúíA?@zàvsB?€™ÞʱZB?ëC'³ŸB?@M~FÛÎB?€vE,…̾€êhâð˾ÀVÖÞP˾w—¨¤Ê¾À’fÈëɾÝÊ%ɾ€òWBRȾ€·¦ÈpǾÀ¡«Æ¾À»˜‚ž®È\AŸ>ÄnYXž>‹bÌ~¦>ïêî­>Ç6ªþ²>p„¸á¸>€{:÷ßÄ>ø’±få¾1<˜÷ä¾ Ô˳ä¾°î¨þã¾°£tã¾À¼äºßâ¾Pû .Aâ¾P€*˜á¾€-¨häà¾V«%ྠ1X|·Þ¾@¬Sí ݾà¸pKÛ¾àvërÙ¾ ”ùbƒ×¾ G}Õ¾ 1.`Ó¾`w’c-Ѿ€8ÉÊ;ÀUšNɾ@Ôº¼3ľä®íc¾¾Æ ´¾9<²K£¾xO^?p>ÆÃc¥§>€–m!»¶>Õǹ×À>\gœKÆ>À<ÁË>€8õÕÏ>À ~Î>@u2DÚñ¾øÞ{á}ñ¾˜·'+ñ¾¸ÒÔ®ð¾PéO;ð¾À+-€ï¾°³©Bxî¾@*_ß^í¾ÀöÈŒ3ì¾ðdœáõê¾€ „¥é¾p Ä,Bè¾ÐQw©Ëæ¾PŒÙàAå¾ÀQ Ö¤ã¾@‹„¬ôá¾À ¬1à¾ÀÒ爸ܾ –]#êØ¾Àãñ½ùÔ¾ æ5Téо€©Ê—vɾÀŠ`ñäÀ¾€êTyH°¾ ;ãƒx>k È—³>˜ô$êÂ>•èÌ>ÀtGu¥Ò>€€F,P×>€-Ú…jÜ>€#«Iâ><6ù¾`6wJ‡ø¾ B+ü÷¾hœX@f÷¾àyÆGÅö¾ @Ëö¾ˆ…h`õ¾X?ýÁ›ô¾ À„Êó¾ødìò¾ˆÇí!ò¾€¦j‡ñ¾°Åñoð¾`ÓbŽÝí¾àfR›ë¾€·ß¬=é¾Ðô ¨Åæ¾`üS¢3ä¾€Áqˆá¾ ãæXŠÝ¾Àõ¢hÖ×¾€iCgøÑ¾€ü ŽèǾ€¨g:·¾øUCÛ|>ü&æ/»>Z.iÊ>ÀŠ+©¥Ó>àl/×Ú>@ìKV4à>ඨkã>°‰†×‹ä>LB$þ¿ø{´ôšÿ¾èµ¾èþ¾˜â^È(þ¾G1ƒZý¾šœf}ü¾ã‹ñû¾€Ó}«”ú¾Xä¥%ˆù¾ˆlfüjø¾ ÔFÙ<÷¾0ýhuýõ¾(^oœ¬ô¾ç½/Jó¾0ßý)Öñ¾ÀúÌ¢Pð¾p|¥sí¾ PÅ+$ê¾ÀË¬ã³æ¾ð—z-$ã¾à+ŽíÞ¾U€¡[×¾€slD/Ͼºl½¾¾3B‘{>€_öCÁ>`3-{ëÐ>``ó=BÙ>~ÙÈÏà>ÐÌkå>cã=pé>€éä©7ï>dsh/¿œZ®æ]¿T¯Kñ¿4žÏ|¿Ô“Kÿ¿¼‘:­x¿˜Ì¦è¿#dêN¿€AóiVÿ¾È[´úý¾˜^щü¾ƒØû¾ Τ\hù¾ öX1·÷¾èeÃHðõ¾HñE¸ô¾h[J½!ò¾ý Âð¾0ƒjÄþë¾ P´Þ ç¾0üÊéã¾@ \îðܾÀSø0gÓ¾€^ªŒKþ<ÜÆr>ÀD‚dÄÄ> :ª'•Ô>÷ÁAØÞ>°—-Žä>P°'R¡é>P4vjî>ð,£Øð>Ì Yl¿¼ «`ö¿ˆ‡+w¿D˜ûþí¿¬•mZ¿Œ™“¼¿X‹¶‡¿ä6Ñx]¿¬?Õœ¿ÑŒÏ¿8ýö¿hBPß¿àÆGÌ9þ¾¨¾=ð9ü¾Ðp ú¾Ð=8ì÷¾(@Y¨žõ¾€®ÅÒ7ó¾èxše¸ð¾ $!ŸBì¾ðÂ3Šçæ¾À¹°‰bá¾@Ãùln×¾Àä(§Ç¾~òÌ>ÀÄÒ È>@ßx¯.Ø>б¬£6â>g@x[è>PQ–9‡î>06sò>ðw]qTö>ˆØ ¿ /_˜ ¿´ì+¾ ¿¬·3“i ¿UÃ[À¿ BÈŸ ¿ nïG¿HíTáw¿lVýš¿@½†$®¿hAhij¿ü~Þ§ª¿¬Î’’¿ ¶òYk¿ˆ…Ìiþ¾PäpÞû¾@ìÙ4ù¾ {mö¾è]Þ‰ó¾PÀ3¤ˆð¾à"2Ûê¾ð*äîrä¾ Û¹Û¾Àd¶w̾`ÕªÇ}¾€9Ë>àóöñÛ> @Õûä>`¶Ö!ì>ðÀÂŒœñ>€ã•»õ>ès?)š÷>„«_Ü¿Lí˜ZE¿<×Ú¡ ¿ä3ñ ¿dS|Î2 ¿ Š[#f ¿è…æ´Š ¿¨—   ¿ÐnD²¥¿À‹(<›¿°>B€¿ÔróhT¿ ùBc¿ˆi›öÈ¿¸ùìþh¿€g¶åîÿ¾0P Ðèü¾p¨.Àù¾°6’Âuö¾ðöF¤ ó¾ÐI—ï¾ + .±ç¾€É0£+à¾@îçÞêо^•ž’¾@Y}ºÍ>à†œ—ß>@÷½ç>Pÿ>+÷ï>H.Oïô>À·Xø>ÀO¸ÌJý>Cg½R¿Ï§hÿ¿Î Z¥¿8e„IC¿0j¿( Cjпèe¹µÜ ¿D|Úã× ¿ä@ÕoÁ ¿pR˜×˜ ¿°vŸ] ¿Ô¡mV¿à¯š­¿ŒûJ8¿¤½ú«®¿Ô ,¿qW©_¿øë¬4ý¾Àv{%ƒù¾ðR±Þ«õ¾hÛ!h°ñ¾Ð{"%ë¾ 4¡«â¾à¶¤pîÓ¾d_¡¾€E&«ùÏ>(°.á> qúÖtê>€·Xîáñ>hr»ã‚ö>xâdúú>põ§ œþ>\J¯Ò=¿xx‘(ã¿ TЀ¿ÜSN¹¿ø¾ø'¢¿ðl„¤%¿àÃð響NYb¯¿ðÅQï¿øüì© ¿¨Y• N ¿¶Ý ¿T{À’W ¿€Àæ;»¿â©f¿t ÷ç>¿;Úº^¿€Ímh¿ˆ»¾G¶ü¾pçàHqø¾Ø4 ®ô¾Àx„<Ùî¾p´Þ›cå¾¥z4V×¾-tZy«¾•¬ÛÐ>`³ºâ>p´#í>pËÔÎó>§dLù>Бïqþ>0 ŠåG?0Ó0¿ÞsÉοr|†d¿ ÖëÕ𿸙~s¿*ªKì¿L–ÿøZ¿&€Ü8¿¿¤x²¿Ä@t g¿ÔYTÍS¿IJãÁ ¿h–ν ¿Ü¥å×T ¿\ùÎÊx¿tñNRƒ¿ˆ—¬St¿¨Ï‡äK¿8iáQ ¿`+sN`û¾p•;k|ö¾ØÑç4kñ¾@ö_è¾ ®7þ3Û¾€#ò©}´¾àOSfkÑ>Ðj%™*ä>`!NÁï> f=µõ>ˆ3EŠ…û>ì埕?ì¯"`÷?\nD*¿bÚ^ÿÈRCÛQ¿b„À™Õ¿ôÖx±N¿ŒŸý½¿Æj*v ¿äü—ˆx¿$ªÀÝÄ¿ZC8¿8c—8¿êF…&_¿Lpá¨ð¿|A› ¿Ôc]š ¿DÉBῬR]£¿l[#æH¿äÄäÒ¿`íá~þ¾ˆ¸òz#ù¾j•>”ó¾°*W¨ë¾ ¬µ+œß¾€Tèš½¾ÀÙ3œÑ>paxå>€¯˜Ö&ñ>@®#ÈŸ÷>ˆM„_#þ>èöÌbc?üýÒ¶?H†-¿ž<˜’¿¶BkîI¿ZÅ¿2Œ4¿’L͘¿ðwGñ¿ä]˜•=¿ÚSº4}¿&¾¯¿ ÔÙIÔ¿&œ:¼ê¿ž*Í~ò¿œ‚$QÖ¿è)ËÀ¨ ¿ˆºvÁ[ ¿| l÷î¿b?b¿è”—¶µ¿#BÇ鿸 `þû¾@ ²îõ¾@k!´Kï¾°Ó^ Sâ¾" qðþÀ¦°ZÑ>€§$›æ>¨L“^ò>PÉ­ù> ³P?˜¤¾„Ì?„NlÏÐ?–°sQ=¿øåwÏ¿hjwGN¿²J°ë¿¿@Nó%¿šþ“@€¿„„BCοL®úQ¿4ˆtÂB¿¤‹¢îg¿"€6~¿Z'¾…¿¤÷Á{¿Jõa¿Tø+7¿cÚ ö ¿æ€Z ¿¼9Vh›¿,´¼¸¿ÔísŲ¿àXÿ¾HI€ø¾—«ñ¾ðó5O6å¾i‚ܞʾ (cóÐ>ð>‰ç>ð£6†ó>pó^û>I)Á¤?ÔP¾-­?ä©¥! ?Òi¼h¿F@ذï¿&6«Ì_¿Ô`ÞoÆ¿½t#¿þ”¯þs¿tìf3¸¿ZM›¬î¿,‘z”¿PUy$/¿HµÇŸ7¿P[FR/¿\ÆÃ‘¿‘Àé¿4ëQ«¿"ãÒÉY¿Ì’Æ•é ¿Ø&ø ¿Œ‚ü ß¿X rfž¿´ö†¹6¿PúQû¾¨˜Xíó¾ÈJ‡è¾üYÕhѾ@‚‹SBÎ>ðë~7è>ˆds–ô>0Z f,ý>eªå?4² Ì!? eewà ?½Ãà# ¿ÚzŽÃ&¿®Ì~Êz¿E©×¿À¯3¨+¿ÒªN„t¿I߯¿d‘˜Ü¿”a¾ù¿|~o¿ÄÞÑ¿nÀÏë¿Ú€@rÁ¿J˜ë)„¿Ô“¡Ž2¿„úòÌ¿ O©P¿pŽ| ¿Ð^ç, ¿rϱ¿8aeV ¿0ä<mþ¾X’³+tö¾°Y½Wì¾ç{|fÖ¾*}ÝÉ>Ю`º–è>x'äq‹õ>ëoÝðþ>HRé9?Üá ?ä\·’c? «ÝÈ ¿T«%… ¿-ŒÊF ¿<60ï¿*b@¿¼I‹‚¿‚…ò+¶¿Êl9Ú¿N>x]í¿ùHï¿ö7â"Þ¿˜‡ÙÀ¹¿„Ì‚÷€¿Ž ;æ2¿žžŸ¹Î¿^Ú­°S¿ ŽÊ"Á¿¶²†¿¤¡¥ô¦ ¿ŒA—ï¿È~¿ÐºöÎí¿À©@[Jù¾à¬À ^ð¾€—Ë.pܾœÀ&¤Ã>e]A•è>i¼[ö>ôfªåK?’>«u?È‚W< ?t©+)?rv¦wB"¿ƒ¦¡¸!¿¡KVa!¿¸¢– !¿Á ûx± ¿š•À³O ¿z@9-Ì¿îâé>è¿Luý—ò¿ÊãÈ-꿤¿‡ñÍ¿?1Óœ¿øµÄU¿\íݽ÷¿Ð­óÀ¿ØÈYàò¿bÞEJ¿äª§6‡¿P¯ÊFR¿l“~U_ ¿7P5¿0÷|Ô¿8‡Œ˜{ü¾è«Fååò¾£=Úá¾™e´}¶> Pnè>Ðü^‰þö>d² ð? Aì¡À?¸Ã3MŽ ?Æêmo?Ƙ@¹"¿a,¹ß¹"¿ŸÆ$©x"¿°‚þ &"¿AæÊ!¿Ö…Åùe!¿o´Cqù ¿y°„ ¿ÓaåJ ¿0NU&ù¿B‡B¢Ò¿0’­Õ•¿Ö§EŠA¿P§’‹Ô¿ªØö«M¿ô¤Ê«¿|U²Úí¿üReë¿zGÙ1¿x˜(¿èl jš ¿P̓ñ¿«Ì“ ¿HÚþçÐõ¾`ø!4æ¾ð¨þÕ`> Éõ/ç>è½¥g÷>\³IôÃ?u¯Ÿê?ŒßT, ?â|0½Ó?ÆæF$¿$««ôü#¿*…³¡#¿J_XYI#¿XYÙöê"¿‰+¥„"¿÷¥"¿¶³Ð`!¿%kP=!¿ùu¿™Ž ¿´O›í¿8–üV¦¿* F¿Ø–/:Ë¿B8¯˜4¿,À¿¸Oo®¿PN_j¼¿EŒ¤©¿2å:>u¿Ê)= ¿t;•¦J¿¸)K¿€žA‚.ù¾Ð¹ve뾜cb“»¾Ð}ì’iå>€î4 ‹÷>“o]?8ó½ ?š»Œ%?¢’ž–Ã? ðÍ %¿œAŠø %¿…ªëÖÇ$¿K€±r$¿¹8û¿$¿¸K~þ«#¿Jä;#¿5²E‘À"¿¦̯;"¿ÃÈ«!¿zvŸ !¿ Òóg ¿8¢ ñd¿}[ÁÝ¿ s¹8¿ £J;t¿:óеŽ¿ˆÒ驆¿Ø··Z¿’|f« ¿l‹d%¿ìš–aé ¿h¹v_¿ˆ:ÔXý¾øU"Éð¾€&ЇzϾXtèâ>ØÌüàT÷>$&‰ˆÐ?H„j› ?4ßè º?„)'?ìTNò&¿¬¦¡H]&¿WÇšþÿ%¿ô»ÒÓ¥%¿z¹YE%¿ùÎuÜ$¿’ºFj$¿zvî#¿ô ×'g#¿­ôà¸Ô"¿Tq(ø5"¿Ó¥ Š!¿Ÿ| Ð ¿¦Ü” ¿Ô¾N\¿$#Áºˆ¿ ól‚‘¿²|¸Ït¿à)õä0¿ª2æ*Ä¿¶ÿ›A-¿P³«(Ö ¿„î7áù¿tƒPAſЦ$rô¾ @oŽ¼Ú¾€8VFÚÞ>X$§0³ö>M»¨?Àùò ?~ªÝ§­?ìqé!?½”„Gt'¿O;#x'¿Ó 5'¿ÛêFß&¿ i¦\&¿êfp8&¿Ä¡p£%¿_ÖV&%¿ ð8!ž$¿Áú $¿ªå{üh#¿PmŽ2º"¿[Whœü!¿eç:./!¿¾6ÓP ¿8;‰ÞÀ¿Îë`ɹ¿Љ-Š¿Êmá/¿Ðl‡Ù¨¿Ï\:ó¿ ¿n ¿EÙ|ì ¿¬mÈäY¿ÀJÅÅø¾ÿÛO#ä¾À³é ˆÕ>PPŠõ>LVÁr*?@d®¼Ò ?¢UߣM?Ô†©y~?rKW&q)¿¼¡õÙ(¿@Fc´|(¿­rçà"(¿Î}šÂ'¿ãÞªžY'¿.$[íæ&¿Âq²°i&¿vŽJ á%¿>0nL%¿UwÌ©$¿8ƒ¯&ù#¿.<Ì9#¿–3ê8h"¿TA'‡…!¿N°ú§ ¿Œ0ö– ¿ÒÒŒ;Ê¿™[¿ü C¼¿lžò_鿊Ù+á¿HN,PC ¿D—õðR¿¨îÊ{ßý¾àGªigì¾€‹D2ÉÂ>pœx¾ó>(ƒïiö?pi§-k ?â®È!?|Nš«m?¬B/ù)¿ƒ¶ Ö*¿Qñ~ôÀ)¿ù¢îl)¿Yv½)¿íIbº¦(¿%Ymõ4(¿Æ#s¸'¿cMÐJ0'¿Šz5~›&¿ÚAúø%¿-÷ê–G%¿‰Ð,†$¿Ç=w)³#¿)±hÍ"¿‹ü]Ó!¿òåoƒÃ ¿Ð>8¿–PÕ)¸¿îT»©¿üÓ¼ú¿ö/d5ì¿b1˜½…¿Hy­Î¾ ¿Ô°VFï¿@­õÌ6ó¾˜z¸¾hË9(ñ>*2e?äâu¡ ?ˆ˜òv“?*?¹?ß|2½ ,¿_2¦As+¿k¿UX+¿‹dWÁ*¿¤ésóc*¿+W³Çý)¿àºÔº)¿x£›Û)¿,-Œ(¿&·TŸø'¿OŒnW'¿.–‹#¦&¿X‘—ä%¿_Ùí%¿‚¶!”)$¿}²Êã,#¿9L5"¿ž5Éiì ¿,ð¸ÓI¿òê¤b¿òÏ8«{¿ @ñ4¿¢Ê1°©¿‡V„­ ¿ Õ s¿ÈÔ—9Aù¾àð4ú£Ù¾ÜTä?ë>ì•ærh?tLrÀŽ ?,†ï#? `Çp?,º„˜,¿TÏo¨,¿’±ÍÓk,¿Ù´$#,¿ú Â+¿^;"¶^+¿“E–Rñ*¿ü¬Øy*¿Áù´ðô)¿ˆéÊc)¿?ø•`Ä(¿ôPX(¿fô86U'¿¹_‚&¿þï›%¿RÂÄ€$¿ÄDµŸ‡#¿bçXW"¿Ú(,w !¿¸‚*a=¿bÎ,]#¿® ž2¿¤ó|M¿$/x]¿^  ¿Ôþ§_?¿ÀÀ¼Êõè¾Ðýêüßá>"–B¼ÿ>P­ë ?ºtì@?Øf¬a™?]4<¾.¿Ñ"‘Ï(.¿‹qL¹Ò-¿ÈKf@-¿l/·)-¿ãgDÉ,¿DøˆÆ_,¿ã {,ë+¿¦tL¸j+¿ÿ7Ý*¿›<†XA*¿‘‘ক)¿]í‰Ø(¿¹è/B(¿Só¥ç"'¿%µ†h&&¿û¹Æˆ%¿Ó½¯âÞ#¿ö#ñèŽ"¿V§ê!¿Ø§í3¿ðö+›¿êæñп`÷x×­¿L’ÿX¿`£ŸF¿Xïç˜óó¾ó€÷÷Æ>ÈAxZû>\qáÕ½ ?hi*ÞQ?v×i¾Ê?nÕ‹Q/¿úÝS.j/¿l5/¿jsømì.¿›Þ™.¿6A>.¿‰rÍýØ-¿®é< i-¿èïaŒí,¿\b’e,¿œšÿ"Î+¿ö·`'+¿¦ð_o*¿PRü7£)¿qrÔÜÁ(¿²u»°È'¿>zè7µ&¿|³¿„%¿[~^4$¿×³)öÀ"¿ Ê27'!¿˜n)SÇ¿éspå¿€2¶…¡¿Œƒnô¿ÌrñÉ® ¿¨8ˆý¾à(oFiÓ¾ l¹Sõ>ŒD/Õ»?„VIBÝ?¨)+´?ñ&®Å0¿€V >®|0¿¸¦ XU0¿€°NûË00¿ò͉ 0¿A§¯‹¼/¿L8Ï\/¿"ƒGÊò.¿46iU}.¿~E'û-¿7ˆ'Ïj-¿ÜS°Ê,¿O˜Ìþ,¿óÇo¸S+¿ä'Æ¢x*¿ÎŽbE…)¿”,ýåv(¿ûTí„J'¿Áª¢Úü%¿‰Ö£VŠ$¿wúà ï"¿P`v'!¿¾o×ì[¿$°ïQþ¿\ÆG8,¿<¹¿A¯ù ¿ðèí¾0rѰê>ˆÕçÎ?à˜ÏÓ?ZKMc×?€DbNS1¿€6]-#1¿¦áBe 1¿€|aãî0¿<À##Ê0¿ÿ›&¢0¿€Í…tu0¿€]ŽòC0¿åØë 0¿R#ìtŸ/¿lؽA/¿F­„“.¿ŒN¶‰Ö-¿ n-¿‘;+°G,¿auœÛ\+¿r•V*¿L|U’1)¿Úü¾.ê'¿¼ˆf|&¿› Ôã$¿¿ý}¯#¿,û¶Ò!¿tNn„Ï¿ÚiÝ{á¿§¸g¿ÄJÖˬ ¿àY‰ˆú¾@ëä íÇ>èt˜õ­?CƬ?úÕªT?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?ýÿÿÿÿÿï?üÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?öÿÿÿÿÿï?ôÿÿÿÿÿï?òÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?öÿÿÿÿÿï?ôÿÿÿÿÿï?ðÿÿÿÿÿï?îÿÿÿÿÿï?êÿÿÿÿÿï?æÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?öÿÿÿÿÿï?ôÿÿÿÿÿï?ñÿÿÿÿÿï?îÿÿÿÿÿï?êÿÿÿÿÿï?äÿÿÿÿÿï?Þÿÿÿÿÿï?Øÿÿÿÿÿï?Òÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?öÿÿÿÿÿï?òÿÿÿÿÿï?îÿÿÿÿÿï?êÿÿÿÿÿï?åÿÿÿÿÿï?Þÿÿÿÿÿï?×ÿÿÿÿÿï?Îÿÿÿÿÿï?Äÿÿÿÿÿï?¸ÿÿÿÿÿï?ªÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ÿÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?õÿÿÿÿÿï?òÿÿÿÿÿï?îÿÿÿÿÿï?èÿÿÿÿÿï?âÿÿÿÿÿï?Úÿÿÿÿÿï?Ðÿÿÿÿÿï?Äÿÿÿÿÿï?¶ÿÿÿÿÿï?¦ÿÿÿÿÿï?’ÿÿÿÿÿï?}ÿÿÿÿÿï?dÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?õÿÿÿÿÿï?òÿÿÿÿÿï?ìÿÿÿÿÿï?æÿÿÿÿÿï?Þÿÿÿÿÿï?Öÿÿÿÿÿï?Êÿÿÿÿÿï?ºÿÿÿÿÿï?ªÿÿÿÿÿï?”ÿÿÿÿÿï?zÿÿÿÿÿï?\ÿÿÿÿÿï?:ÿÿÿÿÿï?ÿÿÿÿÿï?äþÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ÿÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?ýÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?öÿÿÿÿÿï?òÿÿÿÿÿï?ìÿÿÿÿÿï?æÿÿÿÿÿï?Þÿÿÿÿÿï?Ôÿÿÿÿÿï?Æÿÿÿÿÿï?´ÿÿÿÿÿï?Ÿÿÿÿÿÿï?„ÿÿÿÿÿï?dÿÿÿÿÿï?>ÿÿÿÿÿï?ÿÿÿÿÿï?Øþÿÿÿÿï?˜þÿÿÿÿï?Nþÿÿÿÿï?úýÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?ûÿÿÿÿÿï?úÿÿÿÿÿï?öÿÿÿÿÿï?òÿÿÿÿÿï?îÿÿÿÿÿï?èÿÿÿÿÿï?Þÿÿÿÿÿï?Ôÿÿÿÿÿï?Äÿÿÿÿÿï?²ÿÿÿÿÿï?™ÿÿÿÿÿï?zÿÿÿÿÿï?Tÿÿÿÿÿï?$ÿÿÿÿÿï?êþÿÿÿÿï?¢þÿÿÿÿï?Nþÿÿÿÿï?êýÿÿÿÿï?týÿÿÿÿï?ìüÿÿÿÿï?Püÿÿÿÿï?ð?ð?ð?ð?ð?ÿÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?ðÿÿÿÿÿï?êÿÿÿÿÿï?àÿÿÿÿÿï?Öÿÿÿÿÿï?Æÿÿÿÿÿï?²ÿÿÿÿÿï?˜ÿÿÿÿÿï?vÿÿÿÿÿï?Jÿÿÿÿÿï?ÿÿÿÿÿï?Îþÿÿÿÿï?xþÿÿÿÿï?þÿÿÿÿï?Žýÿÿÿÿï?ôüÿÿÿÿï?<üÿÿÿÿï?bûÿÿÿÿï?húÿÿÿÿï?Hùÿÿÿÿï?ð?ð?ð?ð?ÿÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?öÿÿÿÿÿï?òÿÿÿÿÿï?ìÿÿÿÿÿï?äÿÿÿÿÿï?Úÿÿÿÿÿï?Êÿÿÿÿÿï?¶ÿÿÿÿÿï?œÿÿÿÿÿï?yÿÿÿÿÿï?Jÿÿÿÿÿï?ÿÿÿÿÿï?Âþÿÿÿÿï?`þÿÿÿÿï?äýÿÿÿÿï?Iýÿÿÿÿï?Šüÿÿÿÿï? ûÿÿÿÿï?†úÿÿÿÿï?6ùÿÿÿÿï?¨÷ÿÿÿÿï?Úõÿÿÿÿï?Æóÿÿÿÿï?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?ðÿÿÿÿÿï?èÿÿÿÿÿï?Þÿÿÿÿÿï?Ñÿÿÿÿÿï?¾ÿÿÿÿÿï?¤ÿÿÿÿÿï?‚ÿÿÿÿÿï?Tÿÿÿÿÿï?ÿÿÿÿÿï?Æþÿÿÿÿï?\þÿÿÿÿï?Òýÿÿÿÿï?$ýÿÿÿÿï?Füÿÿÿÿï?0ûÿÿÿÿï?Öùÿÿÿÿï?.øÿÿÿÿï?-öÿÿÿÿï?Æóÿÿÿÿï?îðÿÿÿÿï?šíÿÿÿÿï?Æéÿÿÿÿï?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?÷ÿÿÿÿÿï?òÿÿÿÿÿï?íÿÿÿÿÿï?äÿÿÿÿÿï?Øÿÿÿÿÿï?Èÿÿÿÿÿï?°ÿÿÿÿÿï?ÿÿÿÿÿï?dÿÿÿÿÿï?(ÿÿÿÿÿï?Øþÿÿÿÿï?lþÿÿÿÿï?Þýÿÿÿÿï?$ýÿÿÿÿï?0üÿÿÿÿï?úúÿÿÿÿï?lùÿÿÿÿï?y÷ÿÿÿÿï? õÿÿÿÿï? òÿÿÿÿï?hîÿÿÿÿï?êÿÿÿÿï?Ïäÿÿÿÿï?²Þÿÿÿÿï? ×ÿÿÿÿï?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?ýÿÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?öÿÿÿÿÿï?òÿÿÿÿÿï?êÿÿÿÿÿï?àÿÿÿÿÿï?Òÿÿÿÿÿï?¾ÿÿÿÿÿï?¢ÿÿÿÿÿï?zÿÿÿÿÿï?Dÿÿÿÿÿï?øþÿÿÿÿï?þÿÿÿÿï?þÿÿÿÿï?Iýÿÿÿÿï?Püÿÿÿÿï?ûÿÿÿÿï?Zùÿÿÿÿï?0÷ÿÿÿÿï?lôÿÿÿÿï?îðÿÿÿÿï?Žìÿÿÿÿï?$çÿÿÿÿï?†àÿÿÿÿï?ˆØÿÿÿÿï?Ïÿÿÿÿï?ÈÃÿÿÿÿï?À¶ÿÿÿÿï?þÿÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?üÿÿÿÿÿï?øÿÿÿÿÿï?öÿÿÿÿÿï?ðÿÿÿÿÿï?èÿÿÿÿÿï?Üÿÿÿÿÿï?Ìÿÿÿÿÿï?´ÿÿÿÿÿï?’ÿÿÿÿÿï?bÿÿÿÿÿï? ÿÿÿÿÿï?Âþÿÿÿÿï?@þÿÿÿÿï?Žýÿÿÿÿï?œüÿÿÿÿï?Vûÿÿÿÿï?¢ùÿÿÿÿï?b÷ÿÿÿÿï?lôÿÿÿÿï?˜ðÿÿÿÿï?«ëÿÿÿÿï?jåÿÿÿÿï?ŒÝÿÿÿÿï?ÈÓÿÿÿÿï?ÊÇÿÿÿÿï?@¹ÿÿÿÿï?Ô§ÿÿÿÿï?>“ÿÿÿÿï?>{ÿÿÿÿï?þÿÿÿÿÿï?üÿÿÿÿÿï?ûÿÿÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?îÿÿÿÿÿï?æÿÿÿÿÿï?Ùÿÿÿÿÿï?Æÿÿÿÿÿï?ªÿÿÿÿÿï?„ÿÿÿÿÿï?Jÿÿÿÿÿï?úþÿÿÿÿï?ˆþÿÿÿÿï?êýÿÿÿÿï? ýÿÿÿÿï?Úûÿÿÿÿï?8úÿÿÿÿï?øÿÿÿÿï? õÿÿÿÿï?ñÿÿÿÿï?äëÿÿÿÿï?åÿÿÿÿï?\Üÿÿÿÿï?0Ñÿÿÿÿï?Ãÿÿÿÿï?|±ÿÿÿÿï?È›ÿÿÿÿï?Xÿÿÿÿï?Œaÿÿÿÿï?Ò;ÿÿÿÿï?«ÿÿÿÿï?üÿÿÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?îÿÿÿÿÿï?äÿÿÿÿÿï?Öÿÿÿÿÿï?Àÿÿÿÿÿï?¢ÿÿÿÿÿï?tÿÿÿÿÿï?4ÿÿÿÿÿï?Õþÿÿÿÿï?Nþÿÿÿÿï?Žýÿÿÿÿï?€üÿÿÿÿï?ûÿÿÿÿï?üøÿÿÿÿï?-öÿÿÿÿï?Zòÿÿÿÿï?1íÿÿÿÿï?Jæÿÿÿÿï?(Ýÿÿÿÿï?0Ñÿÿÿÿï?¬Áÿÿÿÿï?­ÿÿÿÿï?‚”ÿÿÿÿï?Øtÿÿÿÿï?žMÿÿÿÿï? ÿÿÿÿï?ªãþÿÿÿï?˜žþÿÿÿï?pMþÿÿÿï?úÿÿÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?ìÿÿÿÿÿï?âÿÿÿÿÿï?Ôÿÿÿÿÿï?¼ÿÿÿÿÿï?šÿÿÿÿÿï?hÿÿÿÿÿï?ÿÿÿÿÿï?±þÿÿÿÿï?þÿÿÿÿï?2ýÿÿÿÿï?ðûÿÿÿÿï?(úÿÿÿÿï?¨÷ÿÿÿÿï?,ôÿÿÿÿï?Zïÿÿÿÿï?Âèÿÿÿÿï?Îßÿÿÿÿï?ÈÓÿÿÿÿï?ÈÃÿÿÿÿï?¶®ÿÿÿÿï?>“ÿÿÿÿï?Öoÿÿÿÿï?´Bÿÿÿÿï?Ö ÿÿÿÿï?Ãþÿÿÿï?lþÿÿÿï?Œþÿÿÿï?B„ýÿÿÿï?:ïüÿÿÿï?øÿÿÿÿÿï?ôÿÿÿÿÿï?ìÿÿÿÿÿï?âÿÿÿÿÿï?Òÿÿÿÿÿï?¸ÿÿÿÿÿï?”ÿÿÿÿÿï?\ÿÿÿÿÿï? ÿÿÿÿÿï?þÿÿÿÿï?Þýÿÿÿÿï?Úüÿÿÿÿï?bûÿÿÿÿï?Hùÿÿÿÿï?Höÿÿÿÿï? òÿÿÿÿï?ìÿÿÿÿï?àãÿÿÿÿï?ˆØÿÿÿÿï?Éÿÿÿÿï?*´ÿÿÿÿï?6˜ÿÿÿÿï?2sÿÿÿÿï?´Bÿÿÿÿï?Ýÿÿÿÿï?\³þÿÿÿï?pMþÿÿÿï?öÍýÿÿÿï?Š0ýÿÿÿï?­püÿÿÿï?Šûÿÿÿï?±xúÿÿÿï?ôÿÿÿÿÿï?ìÿÿÿÿÿï?âÿÿÿÿÿï?Ðÿÿÿÿÿï?¶ÿÿÿÿÿï?ÿÿÿÿÿï?Tÿÿÿÿÿï?úþÿÿÿÿï?tþÿÿÿÿï?®ýÿÿÿÿï?Šüÿÿÿÿï?Þúÿÿÿÿï?nøÿÿÿÿï?ìôÿÿÿÿï?æïÿÿÿÿï?Âèÿÿÿÿï?²Þÿÿÿÿï?¨Ðÿÿÿÿï?6½ÿÿÿÿï?Œ¢ÿÿÿÿï?T~ÿÿÿÿï?žMÿÿÿÿï?Æ ÿÿÿÿï?\·þÿÿÿï?Hþÿÿÿï?Ó¸ýÿÿÿï?~ýÿÿÿï?Lüÿÿÿï?àûÿÿÿï?’¤ùÿÿÿï?êÿ÷ÿÿÿï?& öÿÿÿï?ìÿÿÿÿÿï?âÿÿÿÿÿï?Ðÿÿÿÿÿï?¶ÿÿÿÿÿï?ÿÿÿÿÿï?Nÿÿÿÿÿï?ðþÿÿÿÿï?`þÿÿÿÿï?ˆýÿÿÿÿï?Füÿÿÿÿï?húÿÿÿÿï?¨÷ÿÿÿÿï?¤óÿÿÿÿï?Îíÿÿÿÿï?jåÿÿÿÿï?lÙÿÿÿÿï?nÈÿÿÿÿï?’°ÿÿÿÿï?\ÿÿÿÿï?Œaÿÿÿÿï?ú"ÿÿÿÿï?VÎþÿÿÿï? ]þÿÿÿï?Çýÿÿÿï?~ýÿÿÿï?üÿÿÿï?¾úÿÿÿï?J#ùÿÿÿï?N"÷ÿÿÿï?«ôÿÿÿï?â¬ñÿÿÿï?žîÿÿÿï?âÿÿÿÿÿï?Òÿÿÿÿÿï?¶ÿÿÿÿÿï?ÿÿÿÿÿï?Lÿÿÿÿÿï?êþÿÿÿÿï?Rþÿÿÿÿï?lýÿÿÿÿï?üÿÿÿÿï?úÿÿÿÿï?ÿöÿÿÿÿï?€òÿÿÿÿï?äëÿÿÿÿï?@âÿÿÿÿï?HÔÿÿÿÿï?8Àÿÿÿÿï?¢£ÿÿÿÿï?>{ÿÿÿÿï?´Bÿÿÿÿï?Dôþÿÿÿï?~ˆþÿÿÿï?æõýÿÿÿï?Š0ýÿÿÿï?®)üÿÿÿï?vÏúÿÿÿï?º ùÿÿÿï?òÈöÿÿÿï?rèóÿÿÿï?úLðÿÿÿï?¬Öëÿÿÿï?~eæÿÿÿï?6Ûßÿÿÿï?Ôÿÿÿÿÿï?¸ÿÿÿÿÿï?ÿÿÿÿÿï?Nÿÿÿÿÿï?êþÿÿÿÿï?Nþÿÿÿÿï?^ýÿÿÿÿï?ðûÿÿÿÿï?Äùÿÿÿÿï?~öÿÿÿÿï?”ñÿÿÿÿï?Cêÿÿÿÿï?rßÿÿÿÿï?Ïÿÿÿÿï?l¸ÿÿÿÿï?þ–ÿÿÿÿï?gÿÿÿÿï?ú"ÿÿÿÿï?Ãþÿÿÿï?:=þÿÿÿï?B„ýÿÿÿï?&‡üÿÿÿï?d0ûÿÿÿï?4eùÿÿÿï?ê÷ÿÿÿï?rèóÿÿÿï?&âïÿÿÿï?¾êÿÿÿï?øBäÿÿÿï?Â3Üÿÿÿï?dRÒÿÿÿï?`cÆÿÿÿï?¼ÿÿÿÿÿï?”ÿÿÿÿÿï?Tÿÿÿÿÿï?ðþÿÿÿÿï?Rþÿÿÿÿï?^ýÿÿÿÿï?æûÿÿÿÿï?¢ùÿÿÿÿï?-öÿÿÿÿï?îðÿÿÿÿï?éÿÿÿÿï?(Ýÿÿÿÿï?†Ëÿÿÿÿï?|±ÿÿÿÿï?T‹ÿÿÿÿï?ÚSÿÿÿÿï?Ýÿÿÿÿï?€‘þÿÿÿï?tïýÿÿÿï?ð ýÿÿÿï?”Ïûÿÿÿï?úÿÿÿï?²Ê÷ÿÿÿï?«ôÿÿÿï?Pðÿÿÿï?°ëÿÿÿï?fããÿÿÿï?0¹Úÿÿÿï?«Ïÿÿÿï?J“Àÿÿÿï?«®ÿÿÿï?.í˜ÿÿÿï?šÿÿÿÿÿï?\ÿÿÿÿÿï?úþÿÿÿÿï?`þÿÿÿÿï?lýÿÿÿÿï?ðûÿÿÿÿï?¢ùÿÿÿÿï?öÿÿÿÿï?˜ðÿÿÿÿï?:èÿÿÿÿï?ŒÛÿÿÿÿï?nÈÿÿÿÿï?Ô«ÿÿÿÿï?Xÿÿÿÿï?´Bÿÿÿÿï?çþÿÿÿï?bþÿÿÿï?Þ¢ýÿÿÿï?,’üÿÿÿï?ìûÿÿÿï?àõøÿÿÿï?& öÿÿÿï?x òÿÿÿï?BŸìÿÿÿï?äYåÿÿÿï?T·Ûÿÿÿï?«Ïÿÿÿï?.ξÿÿÿï?nªÿÿÿï?6âÿÿÿï?}oÿÿÿï?^ñGÿÿÿï?hÿÿÿÿÿï? ÿÿÿÿÿï?tþÿÿÿÿï?ˆýÿÿÿÿï?üÿÿÿÿï?Äùÿÿÿÿï?-öÿÿÿÿï?˜ðÿÿÿÿï?öçÿÿÿÿï?¶Úÿÿÿÿï?|Æÿÿÿÿï?Ô§ÿÿÿÿï?¬yÿÿÿÿï?°4ÿÿÿÿï?VÎþÿÿÿï?°7þÿÿÿï?¼[ýÿÿÿï?Lüÿÿÿï?\Túÿÿÿï?²Ê÷ÿÿÿï?Ö7ôÿÿÿï?`<ïÿÿÿï?¢\èÿÿÿï?ûÞÿÿÿï?dRÒÿÿÿï? qÁÿÿÿï?F5«ÿÿÿï?bLŽÿÿÿï? 5iÿÿÿï?lJ:ÿÿÿï?,Íÿþÿÿï?äÿ·þÿÿï?ÿÿÿÿÿï?þÿÿÿÿï?®ýÿÿÿÿï?Füÿÿÿÿï?úÿÿÿÿï?~öÿÿÿÿï?îðÿÿÿÿï?:èÿÿÿÿï?¶Úÿÿÿÿï?ÒÅÿÿÿÿï?Â¥ÿÿÿÿï?Øtÿÿÿÿï?À*ÿÿÿÿï?P»þÿÿÿï?ðþÿÿÿï?xýÿÿÿï?L´ûÿÿÿï?’¤ùÿÿÿï?Zªöÿÿÿï?†gòÿÿÿï?N]ìÿÿÿï?fããÿÿÿï?ÞØÿÿÿï?òÇÿÿÿï?jû±ÿÿÿï?怔ÿÿÿï?mmÿÿÿï?lJ:ÿÿÿï?ÆFøþÿÿï?d@¤þÿÿï?¼ß:þÿÿï?bÀ¸ýÿÿï?±þÿÿÿÿï?Þýÿÿÿÿï?Šüÿÿÿÿï?húÿÿÿÿï?ÿöÿÿÿÿï?”ñÿÿÿÿï?éÿÿÿÿï?ŒÛÿÿÿÿï?|Æÿÿÿÿï?Â¥ÿÿÿÿï?2sÿÿÿÿï?š%ÿÿÿÿï?P¯þÿÿÿï?Düýÿÿÿï?:ïüÿÿÿï?^ûÿÿÿï?º ùÿÿÿï?f¦õÿÿÿï?ò´ðÿÿÿï?º•éÿÿÿï?ækßÿÿÿï?ØÑÿÿÿï?øû¼ÿÿÿï?N7¡ÿÿÿï??{ÿÿÿï?^ñGÿÿÿï?êzÿÿÿï?)M©þÿÿï?0 4þÿÿï?Ôžýÿÿï?ªšàüÿÿï?>Eõûÿÿï?þÿÿÿÿï?Úüÿÿÿÿï?Þúÿÿÿÿï?¨÷ÿÿÿÿï?€òÿÿÿÿï?Cêÿÿÿÿï?(Ýÿÿÿÿï?nÈÿÿÿÿï?Ô§ÿÿÿÿï?Øtÿÿÿÿï?š%ÿÿÿÿï?6«þÿÿÿï?tïýÿÿÿï?fÑüÿÿÿï? ûÿÿÿï?^—øÿÿÿï?`Ðôÿÿÿï?`<ïÿÿÿï?Øçÿÿÿï?$9Ûÿÿÿï?Q3Êÿÿÿï?jû±ÿÿÿï?6âÿÿÿï?e`ÿÿÿï?þÿÿÿï?z Æþÿÿï?D‚Nþÿÿï?"û¯ýÿÿï?ªšàüÿÿï?Ä1Õûÿÿï? ‡úÿÿï?‚ØØøÿÿï?2ýÿÿÿÿï?bûÿÿÿÿï?nøÿÿÿÿï?¤óÿÿÿÿï?äëÿÿÿÿï?rßÿÿÿÿï?†Ëÿÿÿÿï?Ô«ÿÿÿÿï?¬yÿÿÿÿï?À*ÿÿÿÿï?P¯þÿÿÿï?tïýÿÿÿï?2Çüÿÿÿï?àûÿÿÿï?$Møÿÿÿï?Ö7ôÿÿÿï?žîÿÿÿï?3þäÿÿÿï?´’×ÿÿÿï?¶÷Ãÿÿÿï?p˜§ÿÿÿï?ñ~ÿÿÿï?ôJEÿÿÿï?¨môþÿÿï?TI„þÿÿï?žêýÿÿï?ªýÿÿï?^îüÿÿï?—úÿÿï?~ ¼øÿÿï?L\öÿÿï?ˆý_óÿÿï?ðûÿÿÿÿï?Hùÿÿÿÿï?ìôÿÿÿÿï?Îíÿÿÿÿï?@âÿÿÿÿï?Ïÿÿÿÿï?|±ÿÿÿÿï?Xÿÿÿÿï?°4ÿÿÿÿï?P»þÿÿÿï?Düýÿÿÿï?fÑüÿÿÿï?àûÿÿÿï?¾3øÿÿÿï?rèóÿÿÿï?Ì_íÿÿÿï?€‚ãÿÿÿï?â¼Ôÿÿÿï?.ξÿÿÿï?Lˆžÿÿÿï?}oÿÿÿï?–+ÿÿÿï?4–Êþÿÿï?ü„Aþÿÿï?:‚ýÿÿï?<¯yüÿÿï?BSûÿÿï?V‚,ùÿÿï?¶8©öÿÿï?ˆý_óÿÿï?žš$ïÿÿï?à Çéÿÿï?(úÿÿÿÿï?Höÿÿÿÿï?æïÿÿÿÿï?jåÿÿÿÿï?HÔÿÿÿÿï?l¸ÿÿÿÿï?T‹ÿÿÿÿï?´Bÿÿÿÿï?VÎþÿÿÿï?ðþÿÿÿï?:ïüÿÿÿï? ûÿÿÿï?$Møÿÿÿï?rèóÿÿÿï?~ íÿÿÿï?ž¼âÿÿÿï?JðÒÿÿÿï?D»ÿÿÿï?6y—ÿÿÿï?¿¥bÿÿÿï?¤ÿÿÿï?d@¤þÿÿï?ÁÞþÿÿï?ªýÿÿï?Ä1Õûÿÿï?òvúÿÿï?î•¢÷ÿÿï?R“Wôÿÿï?8”ðïÿÿï?†Î#êÿÿï?l’âÿÿï?fÕÙÿÿï?¨÷ÿÿÿÿï? òÿÿÿÿï?Âèÿÿÿÿï?lÙÿÿÿÿï?8Àÿÿÿÿï?þ–ÿÿÿÿï?ÚSÿÿÿÿï?çþÿÿÿï?°7þÿÿÿï?xýÿÿÿï?^ûÿÿÿï?^—øÿÿÿï?Ö7ôÿÿÿï?Ì_íÿÿÿï?ž¼âÿÿÿï?dRÒÿÿÿï?¨.¹ÿÿÿï?bü’ÿÿÿï?BoYÿÿÿï?êzÿÿÿï?TI„þÿÿï?èãÉýÿÿï?’„»üÿÿï?Љ7ûÿÿï?wùÿÿï?LV öÿÿï?‚çàñÿÿï?f(-ìÿÿï?Že~äÿÿï?0-KÚÿÿï?$¡õÌÿÿï?Θϻÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð? ð? ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð? ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð? ð?ð?ð?ð?ð?ð?$ð?+ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð? ð?ð?ð?ð?ð?%ð?-ð?7ð?Bð?Nð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð? ð?ð?ð?ð?#ð?+ð?6ð?Cð?Rð?cð?wð?Žð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð? ð?ð?ð?ð?&ð?1ð?>ð?Nð?að?yð?”ð?´ð?Ùð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð? ð?ð?ð?ð?'ð?4ð?Cð?Vð?nð?‹ð?¯ð?Ùð? ð?Fð?Šð?Øð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?ð?'ð?4ð?Eð?[ð?vð?™ð?Äð?ùð?9ð?†ð?âð?Oð?Ìð?\ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?ð?%ð?2ð?Dð?[ð?yð?Ÿð?Ðð?ð?\ð?»ð?0ð?½ð?eð?,ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?!ð?.ð??ð?Vð?uð?ð?Òð?ð?nð?Ýð?hð?ð?éð?êð?ð?‰ð?3 ð? ð?ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?ð?(ð?8ð?Nð?lð?”ð?Êð?ð?nð?èð?ƒð?Jð?Dð?{ð?úð?Ìð?þ ð?™ ð?§ð?0ð?ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?!ð?/ð?Cð?^ð?„ð?¸ð?þð?\ð?Øð?}ð?Sð?hð?Êð?‰ð?¹ ð?n ð?½ð?¼ð?€ð?ð? $ð?ð?ð?ð?ð?ð?ð?ð? ð?ð?ð?&ð?7ð?Oð?pð?Ÿð?àð?9ð?²ð?Uð?/ð?Oð?Êð?´ð?+ ð?K ð?:ð?ð?ð?`#ð?,ð?a6ð?aBð?ð?ð?ð?ð?ð? ð? ð?ð?ð?+ð?>ð?[ð?ƒð?¼ð? ð?zð?ð?äð?ÿð?{ð?tð? ð?r ð?Òð?hð?uð?B'ð?2ð?T?ð?:Oð?bð?+xð?ð?ð?ð?ð? ð?ð?ð? ð?/ð?Fð?fð?–ð?Ùð?9ð?Àð?}ð?‚ð?êð?Óð?h ð?Û ð?lð?hð?*ð?)ð?¿5ð?”Eð?1Yð?0qð?+Žð?´°ð?HÙð?ð?ð?ð? ð?ð?ð?"ð?3ð?Lð?qð?¨ð?öð?gð?ð?ìð?,ð?êð?Sð?Ÿ ð?ð?ð?ð?¥(ð?a6ð?Hð?¦^ð?{ð?xžð?öÉð?ºþð?ß=ð?cˆð?ð?ð? ð?ð?ð?$ð?6ð?Rð?{ð?¸ð?ð?“ð?Oð?\ð?Üð?úð?ñ ð?ð?¼ð?xð?ë%ð?å3ð?gFð?¦^ð?~ð?R¦ð?HÙð?ð?»gð?ªÇð?ü:ð?¨Ãð?ð? ð?ð?ð?%ð?8ð?Vð?ƒð?Æð?)ð?»ð?‘ð?Éð?Šð? ð?Ÿ ð?§ð?¬ð?e!ð?º.ð?Ö@ð?1Yð?yð?R¤ð?óÛð?—#ð?Á~ð?Zñð?ð?·-ð? ð?múð? ð?ð?ð?%ð?:ð?Yð?ˆð?Ðð?<ð?Ýð?Ìð?,ð?.ð? ð?K ð?Jð?Éð?·'ð?R8ð?:Oð?ƒnð?Õ˜ð?zÑð?ð?Á~ð?øýð?¸ ð?[nð?Ùnð?ªð?)ð?±óð?ð?ð?%ð?:ð?Zð?‹ð?×ð?Jð?÷ð?üð?ð?Àð? ð?àð?Üð?äð?/.ð?aBð?¦^ð?Þ…ð?Á»ð? ð?»gð?)ëð?E˜ð?£yð?‡›ð?Ç ð?ƒÙð?ª ð?AÍ ð?eð?ð?$ð?8ð?Yð?‹ð?Ùð?Qð?ð?ð?Áð?6ð?ß ð?Gð?8ð?Ê#ð?4ð?wLð?ƒnð?xžð?cáð?ß=ð?m¼ð?Îgð?fMð?‹}ð?Ç ð?íð?ô  ð?„Þ ð?æð?ÎÖð?PÎð?"ð?6ð?Vð?ˆð?×ð?Qð? ð?/ð?êð?‰ð?~ ð?lð?=ð?B'ð?V:ð?Vð?~ð?@·ð?Fð?zð?6ð?ùñð?§ð?ªð?X¿ð?(} ð?Mð?h£ð?«rð?[¶ð?|ª(ð?i‰3ð?3ð?Rð?ƒð?Ðð?Jð?ð?/ð?÷ð?´ð?ã ð?:ð?Éð?*ð?T?ð?¦^ð?wŒð?ñÎð?‘.ð?ê¶ð?Šwð?…ð?múð?Dúð?_° ð?S ð?V$ð?«rð?é˜ ð?Iý*ð?å8ð?AHð?Q\ð?Lð?{ð?Æð?<ð?÷ð?ð?êð?´ð? ð?¥ð?Âð?,ð?*Cð?¨eð?Õ˜ð?(äð?"Rð?Zñð?ÒÕð?§ð?äð?Ðað?¯Ñ ð?}‚ð?ÎÖð?zGð?]e*ð?ÏÙ8ð?0eKð?ÊÚbð?j€ð?¤ð?qð?¸ð?)ð?Ýð?üð?Áð?‰ð?ã ð?¥ð?ð?-ð?”Eð? jð?X¢ð?ˆõð?Äpð?Ú%ð?·-ð?Óªð?=Ìð?YÑ ð?Mð?ñð?÷ð?K'ð?¿5ð?xIIð?ÊÚbð?܃ð?Îß­ð?"âð?ÏŸ#ð?¨ð?ð?»ð?Ìð?ð?6ð?~ ð?:ð?Âð?-ð?gFð?3mð?X¨ð?Þð?cˆð?õPð?£yð?Í,ð?‡¥ð?#5 ð? Jð?xð?‚!ð?Yd/ð?r`Bð?Q\ð?‹B~ð?lY«ð?èïåð?–ü0ð?«²ð?a]ð?öð?“ð?‘ð?,ð?Àð?ß ð?lð?Éð?,ð?”Eð?3mð?eªð?Fð?M—ð?Ÿoð?Q´ð?Зð?Ðað?w ð?ncð?Xæð?K'ð?å8ð?tÍOð?pð?Cúœð?Þ¾Øð?o(ð?«²ð?gð?z<¿ð?À““ð?gð?Oð?Éð?.ð? ð?Gð?=ð?*ð?*Cð? jð?X¨ð?Fð?gœð?ð?nÙð?äð?±óð?ç€ ð?¦6ð?%ð?È3,ð?q‡@ð?†Z]ð?,É…ð?VÛ½ð?õ° ð?¸ªrð?шýð?öv´ð?Âú¡ð?[¸Ñð?>Pð?ð?\ð?Šð? ð?àð?8ð?B'ð?T?ð?¨eð?X¢ð?Þð?M—ð?ð?!æð?Ç ð?P ð?À>ð?¡ð?é˜ ð?Ú»0ð?AHð?5jð?æ´šð?‚=ßð?cü>ð?b(Ãð?_Vwð?Ö¾ið?¦c«ð?>Pð?µ²mð?˜/ ð?ìð?Üð? ð?K ð?Üð?Ê#ð?V:ð?¦^ð?Õ˜ð?ˆõð?cˆð?Ÿoð?nÙð?Ç ð?Áo ð?±¡ð?Û‡ð?Þq"ð?eC4ð?!­Nð?.wuð?Îß­ð? ÿð?¸ªrð?gð?ˆÄ÷ð? µ.ð?Y6Ôð?èµð?Äî ð?×6±ð?e•~ð?,ð?úð?Ÿ ð?Jð?äð?4ð?Vð?wŒð?(äð?Äpð?õPð?Q´ð?äð?P ð?±¡ð?ÎÖð?¬h#ð?Ï6ð?_HSð?‹B~ð?VÛ½ð? ð?·=¢ð?;dð?Åvwð?ÜTùð?BŒð?Óké ð?EÍÀ ð?~iÚð?—/…ð?â3"ð?{®Gáz$={®Gáz4={®Gáz$½{®Gáz$={®Gáz4={®Gáz$=¸…ëQ¸>={®Gáz$={®GázD={®GázD={®GázD=š™™™™™I=z®GázD={®Gáz$={®Gáz4={®Gáz4½{®Gáz$½{®Gáz$={®Gáz4={®Gáz$½{®Gáz4=¸…ëQ¸>={®Gáz4={®Gáz4=¸…ëQ¸>={®Gáz$=š™™™™™I={®GázD=š™™™™™I={®Gáz$={®Gáz4={®Gáz4½{®Gáz$½{®Gáz$={®Gáz4={®Gáz$½{®Gáz4={®Gáz$={®Gáz$={®Gáz4=¸…ëQ¸>={®Gáz$=š™™™™™I=¹…ëQ¸N=š™™™™™I=š™™™™™I=ìQ¸…ëQ=š™™™™™Y={®Gáz$={®Gáz4={®Gáz4½{®Gáz$½{®Gáz$={®Gáz4={®Gáz$½{®Gáz4={®Gáz4={®Gáz$=¸…ëQ¸>={®Gáz4={®Gáz4={®GázD=z®GázD=¹…ëQ¸N=·…ëQ¸N=™™™™™™Y=¤p= ×£`=433333c=Âõ(\Âe={®Gáz4={®Gáz4½{®Gáz$½{®Gáz$={®Gáz4={®Gáz$½{®Gáz4={®Gáz4={®Gáz4={®GázD=š™™™™™I={®GázD=ëQ¸…ëQ= ×£p= W=™™™™™™Y=¸…ëQ¸^=433333c=R¸…ëQh=š™™™™™i=¸…ëQ¸n=p={®Gáz$={®Gáz4={®Gáz4½{®Gáz$={®Gáz4={®Gáz$½{®Gáz4={®Gáz$={®Gáz4=š™™™™™I=¸…ëQ¸>={®GázD={®GázD=š™™™™™Y=¹…ëQ¸^=)\Âõ(\=R¸…ëQh=áz®Gáj=¤p= ×£p=×£p= ×s=š™™™™™y=¸…ëQ¸~=)\Âõ(„={®Gáz4={®Gáz4½{®Gáz$½{®Gáz4=z®Gáz$½{®Gáz$={®Gáz$={®Gáz$=¸…ëQ¸>=¸…ëQ¸>=¸…ëQ¸>={®GázD=ëQ¸…ëQ=š™™™™™Y=¤p= ×£`=ëQ¸…ëa=Áõ(\Âe=¸…ëQ¸n=Âõ(\r=š™™™™™y=ËÌÌÌÌÌ|=Âõ(\‚=gfffff†=âz®GáŠ=ëQ¸…ë‰={®Gáz$={®Gáz4={®Gáz4½{®Gáz4=z®Gáz$½{®GázD={®Gáz$={®Gáz$={®GázD=¸…ëQ¸N=š™™™™™I=)\Âõ(\=™™™™™™Y=Ãõ(\Âe= ×£p= g=¤p= ×£p=ffffffv=…ëQ¸…{=ìQ¸…ë=…ëQ¸…=333333‹=ÍÌÌÌÌÌ={®Gáz”=ÍÌÌÌÌ̘=áz®Gá ={®Gáz4={®Gáz4½{®Gáz$½{®Gáz$={®Gáz4={®Gáz$=¸…ëQ¸>={®Gáz$={®GázD=¸…ëQ¸N={®GázD=š™™™™™Y=)\Âõ(\=333333c=âz®Gáj=Ház®Gq=Âõ(\Âu=®Gáz~=Âõ(\‚=R¸…ëQˆ=efffffŽ=†ëQ¸…“={®Gáz˜== ×£p=ž=> ×£p=¢=ffffff¦=Âõ(\Â¥={®Gáz4={®Gáz4½{®Gáz4={®Gáz$½{®Gáz4=¸…ëQ¸>={®Gáz$=¸…ëQ¸>={®GázD=š™™™™™I= ×£p= W=š™™™™™Y=¤p= ×£`=š™™™™™i=p=Ãõ(\Âu=ÌÌÌÌÌÌ|=)\Âõ(„=ìQ¸…ë‰=ö(\Âõ=Fáz®G•=×£p= ×›=p= ×£p¡=×£p= ×¥=333333«=¤p= ×£°=R¸…ëQ´=ìQ¸…ë»={®Gáz4={®Gáz4½{®Gáz4={®Gáz$={®Gáz4={®Gáz$=š™™™™™I={®GázD=¸…ëQ¸N=z®GázT=¤p= ×£`=Ãõ(\Âe=p=Ãõ(\Âu=ÌÌÌÌÌÌ|=)\Âõ(„=Âõ(\Š=…ëQ¸‘=áz®Gá–=Ãõ(\Â=\Âõ(\£=Âõ(\¨=…ëQ¸¯=z®Gáz³=gfffff¸=…ëQ¸¾=R¸…ëQÂ= ×£p= Â={®Gáz4={®Gáz4½{®Gáz$={®Gáz4={®Gáz4={®Gáz4=·…ëQ¸>=š™™™™™I=ìQ¸…ëQ=¸…ëQ¸^=333333c=áz®Gáj=333333s=> ×£p=z=Âõ(\‚=ö(\Âõˆ=ÍÌÌÌÌÌ= ×£p= —=ìQ¸…ë=)\Âõ(¤=®Gázª=áz®Gá°=Âõ(\µ=Ãõ(\»=®Gáz”Á=âz®GáÅ=®GázË=š™™™™™Ð=ÍÌÌÌÌ ×={®Gáz4={®Gáz4½{®Gáz4=z®Gáz4½{®Gáz4={®Gáz4={®Gáz$=š™™™™™I={®GázD=¸…ëQ¸N= ×£p= W=¤p= ×£`=R¸…ëQh=p=R¸…ëQx=¤p= ×£€=¸…ëQ¸†=\Âõ(\=Gáz®G•=š™™™™™=…ëQ¸…£={®Gázª=p= ×£p±=ö(\Âõ¶=¾=\Âõ(\Ã=¸…ëQ¸È=ÍÌÌÌÌLÏ=áz®G¡Ó=£p= ×cØ=Þ=÷(\µÝ={®Gáz4½{®Gáz4={®Gáz$½{®GázD={®Gáz$½{®GázD=¸…ëQ¸>=š™™™™™I=¸…ëQ¸N=*\Âõ(\=ìQ¸…ëa=âz®Gáj=Âõ(\r=ÍÌÌÌÌÌ|=…ëQ¸…ƒ=…ëQ¸…‹=\Âõ(\“=áz®Gáš=Âõ(\¢=433333©=333333±=âz®Gá¶=®Gáz®¾=£p= ×#Ä=q= ×£pÊ=×£p= Ñ=¹…ëQøÕ=¯GázîÛ={®Gášá=Âõ(\ïå=R¸…ëë=ö(\Âõò={®Gáz4={®Gáz$={®Gáz4={®Gáz4=¸…ëQ¸N=·…ëQ¸N=¹…ëQ¸^=433333c=¤p= ×£p=Ãõ(\Âu=R¸…ëQ€=¸…ëQ¸†=ÍÌÌÌÌÌ=…ëQ¸…—=ffffff =âz®Gá¦=š™™™™™¯=®Gáz®µ=Âõ(\½=ìQ¸…ëÃ=¤p= ×£Ê=ìQ¸…«Ñ=ö(\Â5×={®Gá:Þ=\Âõ(|ã=¤p= ×ãè=¸…ëQxï=q= ×£°ó=†ëQ¸eø=Áõ(\bø={®Gáz4=¸…ëQ¸>=š™™™™™I=š™™™™™I= ×£p= W=*\Âõ(\=R¸…ëQh=p=âz®Gáz=ëQ¸…ë=433333‹=\Âõ(\“=®Gáz®›=…ëQ¸…£=Ø£p= ׫=\Âõ(\³= ×£p= »=š™™™™™Â=p= ×£pÉ=@Ñ=ëQ¸…+×=fffffæÞ=…ëQ¸^ä=gffff¦ê=R¸…ëAñ=áz®G!ö=¹…ëQü=Ház®§>ìQ¸…ó>{®Gá >{®Gáz4={®GázD={®Gáz4={®GázD=)\Âõ(\=¹…ëQ¸^=š™™™™™i=333333s=q= ×£p}=×£p= ׃=¸…ëQ¸Ž=®Gáz–= = ×£p= §=…ëQ¸…°=q= ×£p·=ö(\ÂuÀ=…ëQ¸Ç=R¸…ëÑÏ=…ëQ¸ÞÕ=Ház®ÇÝ=…ëQ¸ä=*\Âõèê=š™™™™Ùñ=Âõ(\r÷=…ëQ¸~þ=\Âõ(¤>¤p= × > ×£p=š>×£p= »>®Gázî>{®Gáz$={®GázD={®Gáz4=ìQ¸…ëQ=)\Âõ(\=)\Âõ(\=)\Âõ(l=×£p= ×s=¹…ëQ¸~=ffffff†=ö(\Âõ=ÌÌÌÌÌ̘=)\Âõ(¢=¤p= ×£ª=)\Âõ(³=…ëQ¸…»=)\Âõ¨Ã=Ãõ(\ÂË={®GázÓ=¤p= ×#Û=\Âõ(¼â=Ház®§é=×£p= gñ=)\Âõh÷=­Gáz.ÿ=\Âõ(”>> ×£på >Ãõ(\f>†ëQ¸I>= ×£p=>\Âõ(´!>×£p= G)>{®GázD={®Gáz4={®GázT={®GázT=¤p= ×£`=¸…ëQ¸n=…ëQ¸u=€=ˆ=> ×£p=’=\Âõ(\›=ffffff¤=Ãõ(\­=âz®Gáµ=×£p= ׿=ö(\ÂõÆ=)\ÂõhÐ=¤p= ×c×={®Gázà=p= ×£ç=q= ×£ð=ö(\Âö= ×£p= þ=¤p= ×K>¯Gáz. >= ×£p>×£p= «>Ä>q= ×£Ê#>âz®G1)>Âõ(\¸/>\Âõ(50>{®Gáz4=ìQ¸…ëQ={®GázT={®Gázd=âz®Gáj=…ëQ¸u=Ház®G=ìQ¸…ë‰=†ëQ¸…“=š™™™™™=*\Âõ(¦=q= ×£p°={®Gáz¸=fffffæÁ=> ×£p=Ê=Ház®Ó=¤p= ×cÛ=®Gáz”ã=Ház®Çë=¸…ëQˆó=¤p= ×Cû=âz®GÙ>¸…ëQØ >fffffŽ>®Gáz >R¸…ë}>áz®GÇ$>¸…ëQ$+>š™™™™Š1>™™™™™n6>…ëQ¸^<>…ëQ¸xD>{®GázD=)\Âõ(\=¤p= ×£`=âz®Gáj=Ãõ(\Âu=š™™™™™=> ×£p=Š=)\Âõ(”=\Âõ(\Ÿ=†ëQ¸…§=®Gáz®±=¤p= ×£º=Ház®ÇÃ=Ø£p= WÍ=Ház®‡Õ=ìQ¸…kß=¤p= ×Ãæ=)\ÂõXð=Ãõ(\R÷=…ëQ¸~>š™™™™!>®Gáz>¤p= ×+>¤p= ×G>33333{$>Âõ(\p+>Ház®22>…ëQ¸ã7>ö(\Â?> ×£p=ïC>TI>¸…ëÑ6J>)\Âõ(\=)\Âõ(\=¸…ëQ¸n=…ëQ¸u=š™™™™™=áz®GáŠ=¤p= ×£”= ={®Gáz¨=Âõ(\²=q= ×£p¼=àz®GaÅ=Âõ(\Ð=…ëQ¸Þ×== ×£pá=\Âõ(Üé=Âõ(\Òò=ö(\Â5û=q= ×£€>ö(\½ >…ëQ¸‘>\>ìQ¸…õ">gffff*>fffff´1>š™™™™Ø7>¸…ëQË?>R¸…ëùD>ö(\BbK>)\µ­Q>ÍÌÌÌÌ‘V>Âõ(|x`>¤p= ×£`=)\Âõ(l=…ëQ¸u=Ház®G=> ×£p=Š=¤p= ×£”=R¸…ëQ =…ëQ¸©=Gáz®G³=Ãõ(\½=)\Âõ¨Æ=fffff&Ñ=®GázÔÙ=q= ×£Pã=®Gáz´ì=ìQ¸…+õ=Q¸…ëÿ=)\Âõˆ>¸…ëQ@>z®Gá>>ÍÌÌÌÌ| >™™™™™/'> ×£p=(0>Ház®O6>¤p= ׃>>p= ×£©D>)\Âõ²K>@_R>z®GáX>¤p= —I_>)\Âd>\ÂõÈe>âz®Gáj=×£p= ×s=€=ìQ¸…ë‰=)\Âõ(”= =…ëQ¸©=š™™™™™³=q= ×£p¾=\Âõ(\Ç=ö(\ÂõÑ=Ø£p= WÛ=33333³ä=fffff&ï=fffffF÷=®GázD>®Gázn >43333—>ìQ¸…÷>®Gázf#> ×£p=®+>Âõ(\“3>Âõ(\q;>= ×£pC>)\Âu6J>{®G¡ÙQ>…ëQøX>¹…ë1 `>Ãõ(\/,e>Ø£p=*Ÿk>> ×£pÏq>\ÂõXQz>{®Gázt=¹…ëQ¸~=ˆ=†ëQ¸…“=\Âõ(\Ÿ={®Gáz¨=Gáz®G³=q= ×£p¾=¤p= ×£Ç=…ëQ¸^Ò=Ház®GÜ=Âõ(\¯å=Âõ(\‚ð=ÍÌÌÌÌüø=ö(\ÂÅ>ö(\ >Âõ(\Ã>¸…ëQˆ>{®GáF&>= ×£p0>¸…ëQ$7>w@>ÍÌÌÌÌ7G> ×£pý7P>z®GápV>¸…ëѽ^>×d>€ôk>R¸…[‹r>®GáJSx>R¸…{‰>ìQ¸mÑ€>R¸…ëQ€=ffffff†=> ×£p=’=š™™™™™=†ëQ¸…§=Âõ(\²=Ãõ(\½=\Âõ(\Ç=…ëQ¸^Ò=š™™™™™Ü=433333æ=š™™™™ñ=R¸…ë1ú=ð>†ëQ¸%>…ëQ¸¡>®GázÞ >†ëQ¸õ(>)\ÂõQ2>\Âõ(®:>DC>•K>gfff&‘S>Âõ(Ü€[>š™™™™$c>®Gáºaj> ×£p­ýq>€Fx>= ×£P2€>ö(\º]…>ÌÌÌ̜ڋ>\ÂõPÛ”>Ãõ(\Â…=ö(\Âõ=\Âõ(\›=*\Âõ(¦=®Gáz®±=q= ×£p¼=)\Âõ¨Æ=ö(\ÂõÑ=Ház®GÜ=433333æ=ÍÌÌÌÌLñ=®GázÔú=33333«>fffff¦>š™™™™>q= ×£.">…ëQ¸E+>Ház®L4> ×£p=ý=>¤p= WùE>†ëQ¸ïO>q= ×ãW>Âõ(\ïk`>š™™™9:g>…ëQ˜Dp>v>…ëQ¸õ~>¸…ë1…>43335Œ>R¸…ç¶’>š™™™•‰˜>ö(\B¤š>…ëQ¸‘=ÌÌÌÌÌ̘=ffffff¤=q= ×£p°=¤p= ×£º=àz®GaÅ=fffff&Ñ=Ø£p= WÛ=Âõ(\¯å=š™™™™ñ=®GázÔú={®Gáê>333337>…ëQ¸ú>Ház®#>®Gáz->q= ×£í5>âz®Gm@>Âõ(\lH>ìQ¸…R>ÿÿÿÿWZ>¸…ëc>R¸…‹qk>ìQ¸µˆs>…ëQè‰{>Âõ(d7ƒ>š™™™Á‰Š>R¸…S ’>= ×£Ì{˜> ×£p×W >HázfŽ¥>­Gáz¨`°>)\Âõ(˜=)\Âõ(¢=Ãõ(\­={®Gáz¸=Ház®ÇÃ=Âõ(\Ð=®GázÔÙ=33333³ä=Âõ(\‚ð=R¸…ë1ú=33333«>333337> ×£p=J>¤p= ×™#>š™™™™/.>q= ×£7>…ëQ¸‰A>[Âõ(qJ>Âõ(\ÏÈS>Âõ(\_]>®GáŸe>ëQ¸%o>hffffÓv>Âõ(ìZ€>\ÂõÐ5‡>…ëQ”M>4333Ÿ©–>ÍÌÌÌè(Ÿ>¯Gázì-¥>Âõ(6t¬>> ×£«á²>Âõ(êê´>×£p= ס=¤p= ×£ª=âz®Gáµ=fffffæÁ=Ø£p= WÍ=…ëQ¸Þ×=q= ×£Pã=fffff&ï=ÍÌÌÌÌüø=ð>fffff¦>…ëQ¸ú>¤p= ×™#>…ëQ¸’.>33333±7>ffffæ¤p= WâK>)\Âu)U>ÌÌÌÌÌà_>ìQ¸EÒg>¸…ë‘§q>> ×£°ñy>€ä‚>{®GIB‹>…ëQhy“>¯GázP‹›>¤p= 3F£>Ö£p=è­ª>ÍÌÌÌ6A²> ×£pޝ¸>R¸…•|À>*\B¶sÉ>\Âõ(\©=)\Âõ(³=×£p= ׿=> ×£p=Ê=Ház®‡Õ== ×£pá=®Gáz´ì=fffffF÷=ö(\ÂÅ>†ëQ¸%>š™™™™>Ház®#>š™™™™/.>33333±7>®GázzB>Ãõ(\¢L>Âõ( V>3333óÕ`>3333“ˆi>ÍÌÌÌ 6s>= ×£0¬|>Âõ(ì6…>\Âõ>š™™™yš–>\ÂõC >†ëQ¸Š)§>{®GKR°>×£p=Ù¿¶>¨X¿> ×£ðÎVÅ>533³³±Ì>×£pýØBÐ>{®Gáz²=…ëQ¸…»=ö(\ÂõÆ=Ház®Ó=ìQ¸…kß=\Âõ(Üé=ìQ¸…+õ=®GázD>ö(\ >…ëQ¸¡>q= ×£.">®Gáz->q= ×£7>ffffæÃõ(\¢L>áz®ÇUV>Âõ(\¯Ma>®GázŸj>ö(\ÂSt>`Í~> ×£p&‡>4333ë?‘>…ëQ¸êz™>R¸…¥¢> ×£p‹«>p= × b³>{®Gƃ»>{®ÇEPÃ>¹…ëaÍÊ>|®Çî_Ò>Áõ(\WáØ>{®çHŠã>—ð[&Å5“=‡ð[&Å5ƒ½Šð[&Å5“=“ð[&Å5“½ê²qŠƒCzº’ð[&Å5“=Šð[&Å5ƒ=ç§ï N:ê²qŠƒCŠº”ð[&Å5£=Å艹§Ðœ=œð[&Å5“=|ð[&Å5£=“ð[&Å5“=‡ìòo6¨=Þ艹§Ð¬=6ìòo6¨=’ð[&Å5³=‘ð[&Å5ƒ=—ð[&Å5“=‹ð[&Å5“½•ð[&Å5ƒ=”ð[&Å5ƒ=Ý艹§Ðœ½³ìòo6¨=“ð[&Å5“=ðÈu‡‚Âbº²ìòo6¨=—ð[&Å5ƒ=‹ð[&Å5£=ç§ï NºÈ艹§Ð¬=á艹§Ð¬=‰ð[&Å5³=Æj¾ïiº=tð[&Å5³=‚r ÏÀ=Wn'Ë}œÅ=šð[&Å5“=ð[&Å5“½™ð[&Å5ƒ=•ð[&Å5£½‘ð[&Å5£=—ð[&Å5“=”ð[&Å5ƒ½’ð[&Å5ƒ½“ð[&Å5£= ð[&Å5ƒ=–ð[&Å5£=Ý艹§Ðœ=å艹§Ð¬=×艹§Ðœ=ä艹§Ð¼=Ý艹§Ð¬=“ð[&Å5³=‘1öÓhÂ=¢n'Ë}œÅ=–j¾ïiÊ=¼«XÂ’6É=–ð[&Å5ƒ=šð[&Å5“=ð[&Å5ƒ½£ð[&Å5ƒ=’ð[&Å5£½”ð[&Å5“=ß艹§Ð¬=—ð[&Å5“½—ð[&Å5ƒ½•ð[&Å5£=˜ð[&Å5ƒ=žð[&Å5£=Ö艹§Ðœ=•ð[&Å5“=ªn'Ë}œµ=Ñj¾ïiº=·ìòo6¸=ìfU^`7¿=‡1öÓhÂ=ß艹§ÐÌ=Äj¾ïiÊ=“]X^5Ð=ÐŽOsÏÓ=oj¾ïiÚ=—ð[&Å5“=ð[&Å5“½“ð[&Å5ƒ=—ð[&Å5£½”ð[&Å5“=—ð[&Å5£=’ð[&Å5ƒ=á艹§Ðœ½ð[&Å5£=žð[&Å5ƒ=ð[&Å5£=—ð[&Å5“=’ð[&Å5³=¾ìòo6¨=ƒr ϰ=³ìòo6¸=Çj¾ïiº=›ð[&Å5Ã=Ù)$gKË=ìfU^`7Ï=ž¯Áx!iÔ=BÌ%™äœØ=mFˆ‡Ñß=2`õ:œ‚ã=òÖiƒé=“ð[&Å5ƒ=—ð[&Å5“=ð[&Å5ƒ½™ð[&Å5ƒ=“ð[&Å5£½·ìòo6¨=í½óƒV:“ð[&Å5ƒ½¿ìòo6¨=—ð[&Å5ƒ½—ð[&Å5£=œð[&Å5ƒ=‚r ϰ=Äìòo6¨=©n'Ë}œµ=×艹§Ð¼=³-ÚÏÆ=«n'Ë}œÅ=Ðj¾ïiÊ=™¯Áx!iÔ=›¯Áx!iÔ=q‡"5²Þ=†1öÓhâ=n&2±ç= ºŠRtPë=@â)–ãñ=´‡ÛÙÞõó=‘ð[&Å5“=—ð[&Å5“½ð[&Å5ƒ=•ð[&Å5£½”ð[&Å5“=ºìòo6¨=Ý艹§Ðœ½Û艹§Ðœ=—ð[&Å5ƒ=—ð[&Å5£=Ù艹§Ðœ=¿ìòo6¨=›ð[&Å5³=»ìòo6¸=ôfU^`7¿=‚r ÏÀ=¯Áx!iÄ=Ô)$gKË=ž¯Áx!iÔ=Z Wù6Ü=ý’]X^5à=.NZô+6æ=9Ì%™äœè=&šv OBñ=œ¯Áx!iô=K‹‹ë@Ðù=iÖîr7„ÿ=X:礊ü>‘ð[&Å5“=ð[&Å5“½ç§ï Nº“ð[&Å5£½µìòo6¨=‘ð[&Å5ƒ=ç§ï n:’ð[&Å5“=á艹§Ð¬=•ð[&Å5“½µìòo6¨=„r ϰ=‚r ϰ=|r ϰ=·-ÚÏÆ=ÝfU^`7¿=)ýœÒ= )ýœÒ=î§ï Þ=‹1öÓhâ=£n'Ë}œå=(8V÷,·í=léB^Ô(ò=²ìòo6ø=tpXêCý=mOÂL¯>†åÙ§Eö>Ù艹§Ð >kºC÷ ¨>ð[&Å5“=ð[&Å5“½—ð[&Å5ƒ½¸ìòo6¨=’ð[&Å5£=ß艹§Ðœ½Ü艹§Ðœ=‘ð[&Å5“=•ð[&Å5ƒ=—ð[&Å5³=¶ìòo6¨=«n'Ë}œµ=ð[&Å5Ã=Œ1öÓhÂ=ÿ’]X^5Ð=%ô¡ÏÕ=A‹‹ë@ÐÙ=P¡è?Oâ==Ì%™äœè=ݧï î=_[øµô=[Ó>aÕ©ù=U†Ñ­>ô¡Ï>ŒÚW)ƶ >¼÷l5‚> ëg>óæ±°vã>M FwrJ">ð[&Å5“=ð[&Å5“½í½óƒvº”ð[&Å5“=ð[&Å5ƒ½”ð[&Å5“½Ü艹§Ð¬=—ð[&Å5ƒ=˜ð[&Å5ƒ½ƒr ϰ=¹ìòo6¨=ªn'Ë}œµ=ôfU^`7¿=Œ1öÓhÂ=Õ)$gKË=«n'Ë}œÕ=9Ì%™äœØ=M¡è?Oâ=AÌ%™äœè=ÝJªâÉ[ð=³÷tîµBô=™½{"êû=Òe6ú[¢>#iæ ¾|>‚´I“´0 >ÖR//Sß>Ð0Ó>ÏÑ9>ÑR//Sß">É'Îô'>e)$gK+>ð[&Å5“=ð[&Å5ƒ½ðÈu‡‚‚º”ð[&Å5“=ˆð[&Å5ƒ=šð[&Å5ƒ=Ö艹§Ðœ=Žð[&Å5ƒ=Øè‰¹§Ðœ=Ú艹§Ð¬=½ìòo6¨=á艹§Ð¼=—ð[&Å5Ã=Ö)$gKË=ü’]X^5Ð=K‹‹ë@ÐÙ=ëfU^`7ß=µ-ÚÏæ=ß§ï î=¼÷tîµBô=DJñ=û=3YÜr«u>ÖØ •É>¯Öîr7„>Æm»Få%>Ò<+2T`>zDýžqÅ >ȶÚ@v%>?îÊxgð*>JMB{ 1>™Ãj ^5>zwJX>>†ð[&Å5£½Û艹§Ðœ=pð[&Å5ƒ=”ð[&Å5“½ˆð[&Å5“=‘ð[&Å5ƒ=ð[&Å5³=ƒr ϰ=žn'Ë}œµ=Ãj¾ïiº=¯-ÚÏÆ=°ìòo6È=!ô¡ÏÕ=o‡"5²Þ=ÐŽOsÏã=yð¤Ðƒì=±8œYó=Éj¾ïiú=¢y©IýÛ>åØ •É>­}ëW>½‡„j >¹W·Iæ¦>eÖ@o2"><–h´4'>î§ï .>™ÜèÖ#ü2>}óÕõÚT8>!ÜÜ‚º>>÷O?  C>ú))ëÚÕF>‹ð[&Å5£½µìòo6¨=Q FwrJ¢ºÝ艹§Ðœ=xð[&Å5“=”ð[&Å5“=Ï艹§Ð¬=Ý艹§Ðœ=›n'Ë}œµ=‚r ÏÀ=ëXÂ’6É=ý’]X^5Ð=ºìòo6Ø=Š1öÓhâ=¥-ÚÏæ='šv OBñ= Å Ñó÷=”j¼Ö»>¶ÑfX¤¼>ÏÕªFw><{R.É>ª=—¶ìÖ>(fl<¨]">aæE,Þl(>x‚UÒ/>ã¼lcÄ®4>|ÆäÙ$}:>MKà$A>–dû3€®E>}TSç¬K>â°M¢ïuQ>C–³ÙñÿX>Û艹§Ð¬=€ð[&Å5£½’ð[&Å5£=ñ艹§Ðœ½ªn'Ë}œµ=e¢®LD䟺¬n'Ë}œµ=˜n'Ë}œµ=ªn'Ë}œÅ=Åj¾ïiÊ= )ýœÒ=VȼâUjÝ=\[øµä=’™½{"êë=ëþ¶¦Oõ=Ô艹§Ðü=ªS›³ëU>­…J,° >nÖ;“Ëe>ÄàmM>ž>†eê!>ƒ<á(>“=ÿ÷&0>À €£75>|Œ-²%<>èN•º*B>€ì×N¥G>›Q…ÙDN>c2bXyS>¼&ÉÑX>M•ƒGü_>{0“I5¿b>@ð[&Å5£½–ð[&Å5£=™è‰¹§Ðœ=æè‰¹§Ð¬=ˆè‰¹§Ðœ=Ñj¾ïiº=€ð[&Å5³=¹ìòo6È=Æ)$gKË=¬-ÚÏÖ=ðfU^`7ß=\Œ„ Pè=º÷l5‚ð=æó 8'ù=xr Ï>x\Œ„ P><â)–ã>°H5l>¿x=Åde >³ÄÖŽ§Ô&>Lÿˆ¬.>­•¼Îö4>IÔà'ºÛ;>€ a˜¨B>¨K˜ˆnH>L:›Å'P>>Ýo|bÐT>ɬßgÑ [>û÷gKQa>³lâIf>†X%2_l>ŒÝT[¼rt>—ð[&Å5£=ñï[&Å5£=”ð[&Å5“=˜è‰¹§Ðœ=è艹§Ð¬=z1öÓhÂ=‰1öÓhÂ=)ýœÒ=$NZô+6Ö=Y`õ:œ‚ã=3Ì%™äœè=o¨¨°0\ó=˜™½{"êû=ÐŽOsÏ>ªX#Î~ >p9{ ò…>ÂrCaxí>°›N)€/$>KÎ3äaE,>IãË\ÈM3>xiÿ‘¯:>MÕÏ3ïA>ëUÄ\H>}i`AÂ"P>Ðv!É{U>2v£ê*)\>׺1Ð_~b>wbÒ”åäg>>·Òòo>"X¯*Äís>mÿàÔæy>^¥KW=‘~>ï[&Å5£=ä艹§Ðœ=…ìòo6¨=ºìòo6¸=Ÿn'Ë}œÅ=ƒr ÏÀ=‰1öÓhÒ=Íj¾ïiÚ=—ð[&Å5ã=”™½{"êë=,NZô+6ö=oFˆ‡Ñÿ=¦-ÚÏ>hüI)Ýë>ÑØ •É>4lã=´8!>zv¬ (>7§êK*1> HþƸ7>ç½§) ¢@>OÞö!¡¤F>ü8Â{Å-O>-jV2çT>ðýø_üK\>;F׿²b>®^d Ýh>É(§É+:p>¬†;ÎdAu>óTÝRÓx{>[%Q1OÒ>b…Iæ†>l–j  >…r ϰ=±î[&Å5“=¶ìòo6¸=gU^`7¿=‰1öÓhÂ=#ô¡ÏÕ=Ù)$gKÛ=œ¯Áx!iä=ü’]X^5ð=5 ÀFˆi÷=é 5&>U/e& ½ >µ |¹¾> ^d>=>╯$>ëÊßšp,>”ÝT[¼r4> üá碬<>óVÿåêOD>EWÒjŒL>õº¶6‰S>pŠÁ-‹Z>Ú°ê¼2b>œíØö[\h>õÕ—‹hp>´À# ¨u>…“+Yp±|>—3)4¶‚>(uÜy|ˆ>8áËöÙÆ>Ä¿ÕД>½ˆ’’½˜>©å‰¹§Ðœ=Þ艹§Ð¼=’ìòo6¸=Èj¾ïiÊ=ƒð[&Å5Ó=b Wù6Ü=1NZô+6æ=(šv OBñ=Ä«XÂ’6ù=o¨¨°0\>f­0ËÃ# > ëg>%›•„S×>µ–C¬ Ë&>¼³`qüV0>_Ò·»–Õ7>Þaœ…í@>„—¯0¥AH>îýΫùP>æ‹6ßùW>¨4 Ï‚`> ·FŪìf>òÚ4ƒo> ‹Ñ™c8u>Üפq[|>š±Õƒ>°-’lj>Ÿ‡­Íý>–èA¾ž•>#Ìh~âIœ>}7ÙüPW¢>*¹þoЪ>Þ艹§Ð¼=iëòo6¸=Ô)$gKË=„1öÓhÒ=h‡"5²Þ=¨-ÚÏæ= Rêºhñ=ì²qŠƒCú= è=W|>Õ§ï >Am{ >\e¸ç >±žÈø•N)>üXÜr«u2>³ûuc 6;>'‘ìO6†C>.†€nÍkL>˜ ͱT>îºöÖ Ç\>Ê0d>Pœ£HCl>‘›ãL³os>T¿rßz>›ÔHO1‚>/p@þA¹ˆ>‚ æD~>]h¶ –>$dƒ >£[DN÷-£>¸n)Ìo ©>f¦Pš°>jÜG/Û³>‹m'Ë}œÅ=­-ÚÏÆ=ñÏŽOsÏÓ=h‡"5²Þ=›-ÚÏæ=‘1öÓhò=ñq×Üßvû=î¢gñp<>vêaÂØ½>VBlñ€>0¡è?O">ÒÀmØ¢+>bxTd4>Ÿs¯åd>>»Ã L[F>ÒŠcZ`DP>á±ËRSW>†—™)é`>H,Þ€Ìèg>åjpz! q>祺¤úÂw>cÕ=­¦€>⢪k›Ù†>ºiÎi|y>/=ãAÅD•>½å"ããËœ>c”ê9/£>W² Sü•©>‰´nrݰ>œq×–âC¶>a9´{%½>ƒ‘®×~tÅ>‘ð[&Å5Ã=eMZô+6Ö=QJñ=Û= ÀFˆiç=‡1öÓhò=:Jñ=û=|‚šÖ>µ÷l5‚>q¥«~: >gL‚ëúH#>S™6¾x->Ñ0X6>oÄoŽž–@>Œ´NDiH> rp8R>±1ÿšVrZ>¥lì7lc>iÙ<;—t>îiêÀg|>rv"Àì-„>XHq9Œ>Ô±Wß™“>ThÜáØš>ü8€˜k¢>ô+…™Ù¨>7@qšÅ°>á,æÉÑU¶>ƈ #iĽ>Ûì¼î±Ã>ïÜÖK.CÊ>Óe#yS™Ï>ÏŽOsÏÓ=Q Wù6Ü=~-ÚÏæ=Bâ)–ãñ=µ)$gKû=pÞÀßTé>ž^2k•>Í‘}>еn¼yÿ#>NÜÜ‚º.>–Äñ¯M27>B»”Z“ÁA>Š5cÍUlJ>ÀVäÄDòS>+ÒSU]>R<ÒÑe>Ǿýw¼©o>à„Ú.w>"Ú7«—€>üMŸ²æ‡>Î,m21Ú>Òäj±Ý—>“\ é‘ >) ¢ ,§>Št‰„¯>O/°ûvµ>Âô ½>ãJ÷•<ŽÃ>ªþ±÷å Ê> /Ü·\Ñ>ì‡éQÃóÖ>:‚#è_á>HJñ=Û=iMZô+6æ=&šv OBñ=¦j¾ïiú=ǶÚ@v>Áx=Åde>þ(¸â²&>·?(dJ$>Ú¢èË]/>Öå* 88>àU”ŠB>,’õ$öK>bøÅQ¨[U>¨zh§Ë_>ÃÃõXšðg>ÖBZ4™q>üG¯k>z>yë´¨ð‚>ˆ±¥-“§‹>Ú Æu›Ä“>ßÒá5cœ>B¾ºoü£>5¢Ç4¬>é±|Ô“‹³>ÃYI\»>ìºkß~Â>`³ßRL9É>UˆžF«ûÐ>Ëœ¹¢µÜÖ>k¯“©%’Þ>]­?b‡çè>^[øµä=ÞJªâÉ[ð=)Ó>aÕ©ù=›¯Áx!i>FFˆ‡Ñ>iÓ>aÕ©>Ó%K¬ú#>Éã~<4l/>¢ç˦M8>ލP¼óB>ÜÒEòL>o] ÊWV>gŸ#d§Ø`>ÜÑ ÈÕ¬i>¬zŸ ‚s>u4Ðäº|>…nÎÆL…>m– {?>™ÍÄå]¤–>ø™=:>| >‰$§ Ч>x8ÒØ°>~ S®·>V[ 9§À>ø¾ ( Ç>)›Ü›žÚÏ>FªÜËìµÕ> •K㻌Ý>n-¡Ñmçã>®ÊLàÏËê>–¼%S<åñ>ÆÄS•n¸ú>Ù艹§Ðì=6;¿­»éø=q¨¨°0\>fÏÕªFw>KpÿÓ®‰>^L‚ëúH#>I¨%NP¿.>[†RÑ 8>ÇEŸeV÷B>ÛQFM>iÁr\¨ÚV>1"qa>Y³ ™èj>ª¾ç Ht>0ä"ñúÞ~>%ë ü†>>qãà÷;‘>9#ÇP™>½}ÌØô¯¢> £Cƒ›«>Ãf~ø‹¤³>i…K‰¼>×IoºûÃ>åhëJ Ì>8{ ú©Ó>A½)w))Û>x"’º‰¹â>RGÏ‚é>JÁ4´ÍZñ>Iå_v÷>¦ÜûÐaçÿ>¡‰_j?STs¼C÷=\Ei# <>ßxð¤Ðƒ >‡mŠàÿ>¡è?O">Ké¿ûó‹->‹Äñ¯M27>×±žâŽB>‘ו½«îL>îŒÝV>‰Éa>™¢Z|Œk>j>Ñi)u>H†72€>¡E1U‘lˆ>sßÁ’>Ùýs«›>B=ÒD⪤>F†‰åV®>càö!W¶>óps¯w'À>Ï à]:dÇ>&_çSÙ¦Ð>œö;õ°×>[JÐóÔ˜à>ý Þ²4ç>x+»Ïð>¤¶_ ö>%ä=Å­þ>íŽÚo?x,3hi– ?@Á¥½?ù’]X^5>Ê}1d£ >ÕZ´{Üb>+†Ñ­!>ÈW·Iæ¦+>øgz‡%6>„ì‹o-ÅA>Z,£ºðôK>õ8Ð,1]V>¶LÆ«;pa>XÌËk>jΓ ‹Du>ò­…—€>mŸƒT‰>9ÐÝ~“>¹K°^d>„·KehK¦>¹.c¿–°>!¿Û‹\Ƹ>µ\+Â>úÞ×´à±Ê>raðGÓ> Ýì]S×Û>>Œ2ÌÊã>v ÷Úì>ÿ=ü¶€¤ó>Ú¯|˜fû>þˆ [å?šìù×s ? Æz§Ç?ì“Çøo?dÞt….å?¨G5l>þ!2Ù>Œ”è@û@> ‘8/™f)>CF êîm4>¯õf£8š@>b̬>#qJ>BÂ8qaU>llúµ Ø`>7½ÓcÍìj>Ó¤¼’Üu>qŒ ˜€>•(®£‰>Ðx/Yû“>+GðàQƒž> S|t§>x§ŽµM¯±> î âǺ>:›Ðð”êÃ>c¸ôŸ¯Í>²5ÁÕ>8ê3Èäáß>¡ßCš—ÿæ>fñûº²ð>6ï¤Dâ‚÷>7N£?ŠÃ¡,È@?â¬_ă1?•ˆÐ0„W?¥²uB¿?ËëÄ îý$?¢Ç5týÇ/?ôÛ|R‹…>FÊßšp>€ØIÞH'>ÐKL©®2>1òßt>>±êäDoH>c†©@ßøS>azh§Ë_>uÒCp³i> ò©ˆ6Gt>ÎSÐ1>4€>`;ýS‰>ˆZBéû“>Á}4SÕäž>fµ]ž¨>þ¥<¦`²>¤ž`¤6¼>5†IûDÅ> N2Ð>üM¹\¾ç×>(˜MÏ9Çá>Õþ¢ÛØê>À[¾ÙÎó>ó"§lû>jX@M›²?:¬6éí ?´½³ ¹?–8Ž?sì  *0#?YÐé•Ú*?­¼ß…üt2?-Z…Û ±6?ï–årñü>F@^¦–×$>ôdå–i‰0>è5Z;>Ìô—aõF>7ÜBqAR>ÚÑSU]>:&ä‚Î÷g>{8Ös>ð྾ûä~>_’T7kˆ>uB”ÚË“>H1~îž>–+jœù¨>ë.„çóœ²>ƒ_áô¼>ÄQLg Æ> ؾ5öÐ>7ºg]L“Ù>¯RPŠÞLã>Qø\}C­ì>˜9(áHõ>dð<{‹"ÿ>ʓýµ?þÄŸW?+FRSm?lzl\ê— ?Aplû„g'?.ÂßZÄZ0?ùæ"—Ç6?hùbJz??d}“‹üG?ž>†eê!>>SÞŽ•->&ÙšA;'8>0‡À¸8˜C>ŠI™.OP>ûÉz¥#tZ>8M¦Úe>Ê‚ÆOg—q> WÖÙÂ|>Ȩå“,ú†>9‹@O’>©$pKa>‹•¨@Pu§>ú¼"b_²>q=«`íô¼>óÔ¼]jÆ>(¨}ákÑ>Cú-û¡Ú>ñMW«cä>Ê…18n¼î>iá>¨\(÷> þXqœ1?:!•ßÓx ?¦d}œ?.${bí?³cö=&z#?wÇ  6ß+?úåÛu9¼3?<é`«tÖ;?x¥óƒC?½â¼ýqK?+ÐÐ{ñP?FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((16,32) (47,79) (0,0)) 7 }.Wm&?*m¤ä'?‚m4Ê`)?¶×‡˜ã*?ô(ím,?¦e¤«ý-?™1–/?€§Ü x›0?€‰Û´ip1?€/Ïd4J2?€âÌ +)3?€Á÷Ÿ 4?€¤‡æÝ÷4?€TkÄ.è5?€bè{ÎÞ6?n?/ëÛ7?5ăžß8?€°ñvæé9?€ËÂ|œú:?j?€Wdòs??@#_[L@?€Ù–Õ?ß@?€oxpA?€w;ýA?ÅP„B?æ[·C?@Ý;‡-rC?€QŒ±šÐC?€ãËD?n\T#—&?ÛŽiz(?NÓ¢•)?ÿë@p+?¡‘®,?oH­´F.?í¨ç/?€ãÉKóÈ0?€šra@£1?ÍÛȃ2?€G×Þèh3?\ÈÝU4?€¶Ã)H5?`ksB6?€"–HdD7? BXN8?ýáÀœ`9?€¬£i{:?ü¥Õž;?itýÐÊ@?€a+êèâ@?€PI ˆA?@"¦.B?ÀG³$ÓB?€¤j©´sC?M> D?@gòÏÝ›D?@- PûE?€DÃÚ•†E?c”a½&?eŽ=(?85¡ÓÃ)?"L¼ôQ+?1«è,?fÀʇ.?€ÇÇ0?€Ó†pLñ0?éhÄ‹Ð1?R~‹¶2?Cß@¢3?€ë~¦Ê•4?€eM4‘5?€l.ä•6?ð6÷¡7?€¤)¡u¸8?€š`oÙ9?©`M;?€XÝþ‚:?xŠN@?ÀMB”ŽÁ@?@ÌÝa¡wA?@Mƒ~Á1B?gÆÙÉîB?Às©­C?€Î=qzjD? ¢)ç#E?@¦j\ÕE?@ñßÖFyF?À¹…60?’' ë1?€Û)Àœ÷1?©#Õ0â2?šR‹JÔ3?€ÕË–Î4?\ ëËÑ5?€Þ:Û¨Þ6?¯oýòõ7?€…˜s9?fÙõóF:?hV8‚;?€7\÷Ê?€«:J‡??€¦tÚÓ}@?ÀÆ3w?A?À¬Ì^B?ׂÆØB?@¥§éÈ­C?Ë'Œ6ˆD?ÎVzeE?Àÿ}‹éBF?@‰0êG?€e¿à ïG?€žL±õµH??:ãô&?PJ‡{(?0Ê *?ò:[ +?+`m@-?ÈÏ÷é.?pt†O0?€> @01?þØÊ2?€jbšÖ3?€¨Bå!þ3?€a¥:zþ4?Sÿ;¼6?,íeÓ7?nê=¹>8?N¤Àsl9?€'»Ð¨:?€ÃŠS¬ò;?/7’VM=?€o2W ¹>?ÆÏ ƒ@?éɪñã@?Àk@w/¶A?@f‘h’B?ô“xC?À.ðóKhD?ÀܶCÒ`E?@[vÓÆ`F?߬—fG?@¨>mH?Àí«ôEqI?€áN@hJ?ÕÐŒ'?»z†»(?SéÖ• *?Ïž{º+? +3]-?ïZK /?™Ø˜Xb0?€Ås’ÃE1?:ìx02?€¸=#3?€ÙÙyì4?Ì”wt$5?•!Ø46?g‡k0Q7?€9–°¬z8?•VT’²9?€×î;ú:?u8DS??@Äùòi@?ÀˆÞ*U@A?@Íë #B?€CÌü²C?ÀJ®ò¾D?À€pjhE?€ºG2F?€i1™WG?ÀT:ˆH?@ERÍOÂI?0_K?Çš÷¨IL? úÚá'?­›)Dœ(?+‹¿¼.*?¿ç·-Ê+?Jo-?&"1 /?€¹éÖn0?€nô¥ýS1?€å®ÌA2?Å®&¹63?(®îÞ54?Ž©³“?5?½aU6?Ç·5kw7?€n9¨8?öoñè9?^~:;;?€Ò^Þ ?€É@M®?? wŸ×¬@?ÀµD…A?Ìfh*ƒB?úö5ä…C?€ÕóZÀ™D?W!¬¿E?À®ü`\øF?@o> +DH?ÀÖújã¢I?ÀñNfK?@k¹’L?@%ÝúN?¨¦À®'?Ó‡¶ (?"Jë3*?×Ý*HÐ+?”äv-?:ö(/?€f¹Zìs0?€ â“‡Z1?€u•$I2?P6´@3?€ï3øBB4?€R³øûN5?ðñ ,h6?¶¼E7?€X áÅ8?ÉñÆ :?€ý°éh;?€Ù§qÙ?ÀjHñ*@?Àa­]â@?€^ÜòÑA?€½¹N„ÓB?À‰l“lèC?@Í?@– è@?Àe ]A?@ß¼ B?TË[C?<¤¢6D?ÀQk`uE?ÀFº@óÏF?@à°,>IH?@@¦-CäI?ÀÑ= ¤K?°f‹M?@5VóœO?€ ‹ý ëP?²´'? ˜Ñ‘(?À@*¼"*?wZ­Ÿ½+?O¾aáb-?¿WFÎ/?¡aïh0?eI ^O1??"p#>2?€§^O63? ÞW94?€bMfÑG5?'~ d6?€=’‡7?°øh8Ì8?€FA[:?€1ˆmv‚;?DÓúd=?€æá‡aœ>?@ (=‰+@?À SÞËA?@dMB?@£GŠ®8C?)èlD?@žcT¾E?@m¼H·0G?€à(LÈH?7±öʉJ?@ÀOozL?>) N? &“š€P? +7ŒÖQ?åõ^Jõ&?K#ß|(?s•xL *?¥½¤+?˜ÚßbG-?}ÚŽõ.?WÓ_`X0?2ÇÅU=1?÷Þž*2?ÿŽU!3?€{¥¸"4?¤ú605?€MH†pK6?€x5œ@v7?ÝúŲ8?ŠÃºl:?€—¼Øùj;?ªS”˜ì?ÀÔB(Œ&@?@EůuA?€!­Rr$B?@-K ¯GC?Àî÷²Ø‡D?À“ö2éE?Àp–ª¯pG?€”Îõ$I?Àóªœ K?À(ì…ƒ*M?Ä”6ŽO?À«ªñ‚Q? M¥©§R?Êo‘ÁÜ&?íÌêÒ`(?j»ýØì)?Sr©§+?¤œÉ] -?PFÎIÊ.?€”,u@0?Þ~@ú"1?€W´® 2?€Ë|®3?€üó~C4?Oÿ(å 5?Rp€C#6?€ °OOK7?€-ÝŠD…8?€„¶Ó9?ø>µž9;?€A„®mº?À‹"y­@?À=ˆÃA?€…Ô’|B?w"µ•;C?ÀXÞky„D?€”ˆÊiòE?Ã÷5±‹G?¨“XÞWI?€ZD± `K?ˆ7)¯M? þ ¨*)P? +¹„¬Q? áTúËqS?’뛼&?…êÒ<(?!ÑüœÄ)?!ÉYªT+?Í‘#î,?Á&¡P’.?/Ö‚U!0?€må¥p1?ÚËxqç1?€á7u×2?€ÜÅÄÑ3?€qAòÛ×4?Brë5?€rìƒ7?€äŠD`C8?C\ûµŒ9?€È¥ó¥í:?é¿Øi?€7ÑßøÅ??Àv)~{Ø@?@yöÈÞæA?€Õ2YtC?—s`D?@Ñ <×E?€* Q¦~G?ÀÜ„¾j`I?À·ú­ŸˆK?€Ç™PN?` ùñvP?à×{ï(R?€â/Z:T?JÊt–&?¦ù”Å(?¥±”)?õ-ãA+?˜I©3±,?Øî,+N.?ÍŒ¹ö/?:%'Ö0?+¹f3¸1?€5ÕŠò¢2?€ü”™‚—3?R\ [—4?…¨#1¤5?€ùkQÀ6?«·Ò&í7?€Ö!”X.9?^rÒ†:?€UØìcú;?€Ì`—=?€Ó†²ÚE??@° §Ý”@?€ë<æ™ A?ÀN⟠ËB?€‘ãÚJD?À-&4–E?å HG?€‰B¶j,?U®\˜þ-?j6–i/?€`J?¤0?®NFi€1?5*¢d2?€à>¦ýQ3?€ö 0æI4?€‹wN5?zzmN`6?(Lƒ7?€ó–³¹8?€O5'w:?оPCl;?€ùî?#ò?Ò´9@?€œöDY?A?%8ÖëdB?@Ó ´’±C?@óxr™.E?@O:Ù9èF?Y€ü«îH?€È…@WK?Â’é¯?N?@EÉÿÃæP?À ÿ*ÁS?Àš|V?]B{8&?à–8Ÿ§'?;Bå™)?SvEÕ—*?BÊ %,?8ËŸŽ¤-?KvND8/?¾Q!Vk0?€°´@1?€WTk32?€¼²ó3?€3ÿHð3?êãÄé4?€B˜Gð5?€1ñ 7?dû¶-8?^S ‡j9?€­vReÀ:?Xbf#4N?@¼êcM$Q?@¬~§>¸S?@¡üŒÜIW?­cž&?™Ñi'?ÅåÙ×(?M£X‹I*?ŸNòÁ+?Ç2Î9A-?„K¹nÈ.?€J¿.f,0?³éãù0?ø-B‰Í1?€0ÂÖ\¨2?ɨö’‹3?€Õœx4?¦‹h5q5?€§Gsw6?€ßÛYà7?7Oš·8?.æ}ø9?q*iU;?€…ï–Ô?€,Üsn.@?€Ïí·?A?˜©}B? þ×ôC?ÀW1X»E?ÀJµYÖíG?!ÁdR¶J?ÀºùPN?@ºÎщQ? A”Ý8½T?¨éÚH§Y?Y+ñwÇ%?‰›ì''?ÏãÍ|Œ(?ÈacIõ)?Çä¶ßb+?gõøÕ,?‹UçrO.?Ž.ÛTÐ/?€Lôë¬0?ïʸv1?„ß“pF2?þL 3?õe" ü3?€í®­Âä4?€Í$&Ù5?€)ZûÛ6?Ñòî7?€ÀÆ 9?në<ºX:?Joº;?x:çD=?€EÑC??£>qÞ„@?÷Ž|·A?ÀïiÅ5+C?€ J¿QüD?ÀÚ3ˆüRG?@f|p‡kJ?à@9ážN?`¶”g½6R? ëaäCV? ÌõF´\?QÄEˆ%?˜+ êá&?±6¡=(?ݯ7>œ)?+À)Kþ*?̉ Yd,?â,Ï-?\YÏA?/?€BÎîZ0?€+*H1?Þ]KœÝ1?™ZÜŒ¦2?€E çu3?ËFûL4?€êÙ–o-5?€ê «\6?€_0†x7?ŸSàV8?€ëFGÌA9?Ó1‰:?€\¡*è;?à8ž6ƒ=?×ÅÜšg??@¿±H8Ú@?(RËÆLB? 7b0D?@m-e¾F?ÁÂ+¦MJ?€é> eO?€©‡ý‚gS?Óø%zÞX? 9ãJ¢3a?P»¾×I%?€O!JÕ™&?y¾&àë'?¸Œ¿Ã?)?²7¶•*?±bRî+?¢æ«>I-? Øùɧ.?T-D-0?<Ÿà¸0?Ò†no1?zè³)2?€<ÑFè2? Ô«E¬3?²ºÏ w4?’`aJ5?€ßà‰¶(6?i”wg7?€|ûö=8?€È5:/9?W™Ûm:?€³¹T:á;?>õt¢=?€$ÙAÙ??Àè4sbA?ÀÆ; 8ºq?€êàÿd„$?€á‡7ñ»%?ÅÍKñ&?€au(ø#(?€d_whT)?à\û‚*?€è25©¬+?€:âÄÓ,?€r•÷-?€ž/? /?nßê=0?€$©£0? Î>+1?€œ"äù°1?¨m­x42?€Î}Rd¶2?¸I?83?€eM‹E¼3?Ƨ´G4?öÄî"ã4?Ø!Ož5?c ê“6?€Ÿ„ʾô7?€M,”:?€çXL^…=?ÀgІ¡A?Úñÿ~~F?@|ƒ‚ÇN? Ö6.·nV? /¹|k*a?óP§yk?è/D¶7ˆw?€sª3—F$?€~¤ ”t%?€}Ñ &?–§^BÈ'?€ ±,†ì(? yœR *?€¤f: '+?:± ÿ;,?šRrJ-?€L–”Q.?'¦X‹P/?À¡m€;#0?ý@íA™0?!× 1?€B¸E^u1?€ú¶÷Û1?€P-´=2?ɵí2?€©®³|3?€?BFîq3?€fê¥B4?€¡è4gÐ4?€›©È6?볘J8?çP Å) L1?Ypȉ1?€‘ØDfÆ1?šÁt\ 2?€2Ss2?r„‹“3?VUyšZ4?¢a[¨6?€ KÕö:?@ ãvA?€ „ÙR¾H?l!béðR? z P¥^?@®ÚHŒ˜i?йŒN¤u?ŒbNTqñƒ?:üm“Ð#?€ˆdô[ï$?]°eŒ &?ÌE'?€ŽÇÕ+(?àí[2)?€¸•f/*?€?¾"+?€.u• ,?€KÄKå,?€sNë±-?€ Õ0ék.?€‹RBº/?€Uå-j¦/?ìÀ(0?ÀI-ËâB0?€’¢Ðüh0?qLeo…0?€¯R·0?‰S̽0?€hм¹ý0?€$»ŸÅ‹1?è^}Ó¾2?‹jŽo75?€9CÙ:?€å;œÄ½A?ÀÛµçæ‡J?€°è”‘ZU?0D1sÍÿa?PhLV{o?@k†ãûàz?€AÈ›J‰?€Ö“…š#?€ë³$?€Öm_Æ%?€L?4;Ò&?€ ÈÞ6Ö'?- 7&Ñ(?ªš¯Á)?‰slE¦*?iÇÑ%}+?€ûcjPD,?æåÎ…ù,?±Hš-?Ïzé#.?€ýAº¥“.?aêªíæ.?€ÙKÒñ/?€Uê[·2/?€èö{&//?€Ãj<æ/?0Â2ˆ/?{•ÄR/?3‰‚b0?€y¨CP1?»Þ¾¾ý3?€éy"‡9?Àû Z8B?u`L?€ÒaÓ X?pHE×÷ñd?ŠI^§|r?ûŽ D€?üæù\ߎ?ànýñk#?§9é3~$?¢ì Š%?€áC"TŽ&?D]ʧ‰'?äì¸z(?€'3ö_)?Š[™7*?€èÙŠ•ÿ*?€ÝM—µ+?/!îûV,?€Ú˜–Òà,?¹wnæO-?FlƒÞ -?àeÇÐ-?ÙùloÜ-?€ßj\Ä-?€J|:‹-?Îé?>-?€ZR¼Xú,?Æ+½Êü,?€Ú)¿-?Ó„ãª0?€10—mý2?Ÿq¦\29?Àù¬•äÕB?@·ú‡êN?À4•ÝZ?ÞÍÖüg?Hób‘áu?TM<ƒ?¶J¼)s’?U„ç(A#?€ˆ¯'O$?eçÉU%?€¥‰‡US&?€;©à_G'?€š #0(?€4¡å )?Ø+u«Ø)?€ªH-”*?€“DÏ;+?€¤Eš›Ì+?€îÕ@C,?n¿œ,?CÞ0HÓ,?€W”vå,?€‚w†Î,?€ .©©Ž,?€¼©*),?Å~Þ«+?€émq*4+?ï@™+?€¥g·;¬+?€ 3'.?2À×J52?À¨‡Þ` 9?@^ï–C?`WrŽ‘P?€BúeY]?à¥Á`0ßj?¨{‡wux?CTŒú…?àõþJ•?€ºn#?Á6E¾'$?€×Rªq)%?wkx""&?¼Š%c'?oö–ò'?i”µßÆ(?€ä†í‹)?€?³OÔ<*?€Ò6Ù*?€: ]+?u½L±Ä+?n¸0. ,?uM±D/,?€eþéË),?ft]ø+?¼À¸™+? ûz+?Æf|Wm*?ëô_ÿÎ)?€"ÂýÆ~)?€j€`*?€cÓÛš,?ÀP…|С1?¯øÌ®9? Ý}ðD?àF™„‰Q?`ýÝïÝ_?€Æ:\Zm?@q] töz?DÂñypeˆ?ŽTÅ 0„—?ü¸ô+#?€™—Öò$?€A€Ve%?€7óÉaû%?€'hQxå&?èñ[úÂ'?€I&¼õ‘(?€m«b+P)?€ôÅû)?€ä&/‰*?€Ý1«T +?€l”g+?™ž £+?zÃ?¸+?eM8·¢+?€µx6Æ^+?€æ}óê*?Çã×J*?sÜ‚˜Œ)?~‰dÓ(?Xi/k(?€.þ Òí(?€‚ Ôvˆ+?€kŠmw>1?ÀœÁ³9? «ÂI’D? YªVz@R?°–L È`?ЊÒ3—*o?h˜¿Ç|?,ó¤ÂŠ?Vß¶|"™?€N»ëë"?»Ëi|ð#?ßËLÐì$?€À(X‰ß%?õK&Ç&?O"Tí¡'?€¢ˆ„àm(?€ïÞ$³()?€²Å¾Ï)?nÓ½ö_*?€EFáÕ*?€žÔh-+?€{ü«b+?€ŒÿÄp+?€œÿ R+?€vÈ +?€=i B†*?ÕSÓÙ)?þh&)?fmì/G(?€{X:ÉÒ'?€Îº÷N(?€nêl¡ñ*?¡O”01?@˜BSƒ9?Àj冰'?€ ÎU‡(?ÀJMO)?V>(*?È2tM©*?€u’ÞÈ5+?€G ÃI¨+?€!ƒ,ý+?€L>¸˜0,?€=£•Ó>,?3îEá$,? <=Ôá+?€›ÒåTy+?¦wø*?€«yÝ~*?X+±ÍO*?¤GŠò*?€¡ «k-?‰Z]Ö1?@Éò¹­8? ‚ qõNC? ¤úyP?°µkï—t]?ÐMñ=¸Òj?çê<¿nx?L;$Õf÷…?8ÇÞ·•?2 ù»é"?€ü³¸õ#?‹X™ðù$?€¸N÷%?ve}éë&?“§jÖ'?€tÇ–Fµ(?€9e–·†)?<ΊµH*?€;kñîø*?€È!ÕÔ+?€ß%E,?]…pAƒ,?€ßš`Ï,? Y¿oú,?€ŒŸ|þ-?€Œ)Œå,?€ø‹¹Ø¨,?€ìÚýBX,?8Žiú,?€¤ºz?,?xy£žÏ,?{81ò8/?€œálÞ‚2?¥J|¶8?€å¸\Q—B?€úŽ`X«N?¬à@´½Z?wfÌÅìg?èW5éˇu?\†-Í=8ƒ?æ‘›\!q’?R=¡…û"?QXþÁ $?ûúgê%?9’Y&?U}é'?€×X«ú(?9^¯ð(?hq3­Í)?€û4*?Nê¹H]+?€4|­ ,?€”õ:è¥,?^†îK)-?€Ž›m“-?ÒÓÝ¿à-?•Wt.?€L«´:".?f %û.?€e$Z.?åËpäø-?E«K1.?€% <°/?ÀÚ!„¼0?@.¿¶Ög3?Œ‚Ëžï8?`‡€õÍëA?@Z™7WL?@t…ÙÊæW?ôÁGÞd?Ð[Íâ¼rr?¼,_I”?€?¸&ÄÚŽ?€40$ý#?€»”($?€½¤zž8%?€@À×C&?çIm!G'?‚¾@ÀC(?€:Û7)?åÇÂ/"*?b„P+?€½ŸÓ+?ØàO—,?€ü0jJ-?ÞÙÑÖê-?O|Æ~v.?€&Ï*Œë.?b9êH/?€rJ9/?€´œÂ/?€hFÔ î/?Ài”»¶0?@ï öiR0?À«(6_Þ0?À*Цq2?À(Ê#†4?s«g9? ˆÌ;cA?`¿Hj,J?D½Y,U?HþXwèa?`¸<éñðn?€Èxé#Õz?Ž ÍŽD‰?%;Ç.#?4DÈõI$?€a ßâ`%?€õš Ks&?3阀'?¥|ˆ(?Jf ؈)?­-û*?€iÞÈbr+?©eÙX,?€°–Ž 4-?€Á3’‡.?|GÝÂ.?'—¨s/?¡/í 0?€‹a“Q0?@XÂñl‘0?€'ȳË0?€p}ì™1?£51ÙI1?Ú•L­1?Àf6æ5W2?@ìuÐ3?ÀÅÙi¤Û5?@ì½':?ಲ©_A? Ï#0«TH?Fñ}»R?ðèPJo^?×ΚA}i?¨ Œ–u?ì«uø‡êƒ?âÆO#?€ò¹˜o$?€èˆq¬%?€ä™s›¨&?HQ¹é¿'?€xª0Ó(?€±š$„á)?æýÀ“ê*?þù¡ˆí+?øXÊ–é,?l”øçÝ-?€ïñŸÉ.?´Ùï«/?ÀA¨-B0?@]¬©0?ÉÞ' 1?Õ8+\i1?ÀöøõÆ1?€3)^&2?¾XÓÉ“2?@vý›Y 3?oN ñì3?€Ãyð45?qtb7?@^y™1;?`Ü•Ýö@?ã ,³êF?à\ªä²P?ÐZæÓbÙY?`9–ŒÒd? ´$q?ÞV3Ø~?P-w“o#?€ÈÅ€«—$?€"a{›½%?€Þhá&?€£Hëa(?€33áÓ")?€}ŽTš?*?€÷ÎKWY+?€µªÄ²o,?€ñv×G‚-?€¨‰Ã.?€U2Öš/?€Ó¾/P0?€ÌÊ·Ð0?êïªMO1?î˵šÌ1?€>9,J2?€-TÊ3Ê2?@# #ÿQ3?@SDûê3?€ã¢4?µ‘0•5?€ÚncŒó6?€ç*&9?ˆ±pI(?íl:Du)?€#)žÁ *?€óKLŠË+?€³úã¼õ,?€ÉäA.?ý·Å]H/?€"òe™80?€·2Í0?À£gzLb1?@©Ö|©ø1?@ÀI¾G‘2?@RX.3?ºÓdªÑ3?À;R*!4?@¶Ö.HD5?F8‰³(6?€FÂùD7?€šë¥Ú¿8?/B”°Ú:?À#Üß>?àlÞ³ý|A? [ÖÆzE? $%™‹L?àG5¨]_S?Àßdu}1\?¨m6â/Ge?àY ¦q?¦Êà¶#?€‡û/Qì$?‰¥_"&?wKˆ#X'?€wá|¹(?1—@È)?€Wä'¤+?€}êV_>,?>r4‹|-?ú–®É¼.?À›WD0?@ŠA^Û£0?ÀáA*J1?@êhwó1?€ëûÑK¡2?€™ Õ™T3?½¿4?@EÝCÖ4?Àz­W ¬5?ö;Çä™6?@êös©ª7?@†|§ñ8?ÀvoØ!:?€r5›°? ì¯‹·@?`m—w¸B?`â;Ïf™E?H®+ãÒI? ÷ …ÃP?­\†æðT?`²iIúU\?èri/—Îd?öuM$?Âþ~<%?`vÙ°…&?€ÛÊËHÇ'?€ñû¬È)?Îd*?€ÔëÊÂ+?€­nÌQ-?€út{'ƒ.?€Ñl¸Hè/?ò6»²0?À¶¡R|o1?€cÂÙ:2?€æ 3?Àjλã3?€ú¶U Ä4?À—„ð¼5?Æb•j½6?@±¥g¼à7?@ïäíF9?@%¨„:?À€òb…$?€ú¤…S%?€+îã¾&?€D!xë'?€ñôÇe)?€ ÏH ž*?}YÆ',?å§Sm-?åý¶ /?€Ï]æÓ00?0Ÿ  1?@¢ÚãÃ1?€çˆ¼˜±2?À÷¶i?€|¬%LÀ@? OAA?”æË]™C?€ÐoÎ:YD?€ªÔF×G?@²õôâI?à:@c·N? …@.}wP?@fZÿb[U?0-mÁÞW?€4$G*62¿Á~Mñ1¿€÷üøÎ1¿_X+ °1¿€/σåŽ1¿•«;j1¿€0«SrA1¿€Á7î1¿€ãSXá0¿¦Ãxɨ0¿s§—i0¿€•úè"0¿ÿRZŒ§/¿°½x-ö.¿‹Û9/.¿YO*ãO-¿œÚ@ÿT,¿Ñ¡÷þ:+¿9îñäý)¿l Ñ<™(¿6¢g'¿¯ÁÄðD%¿ìCÕI#¿p C;!¿ü´r?"¿¬Ã‚)Š¿v¬ÅH¿TäHùœ¿€qðÛbä¾Ð°C<(ø>Ô!¼î?rËs:Ž?1„2¿¦•æœ2¿€&v3"2¿¶Ý=7t2¿€Yç®,W2¿€'¤CŽ62¿€ý«À2¿€«,Oé1¿€— ¨»1¿'÷¦{ˆ1¿¹0@ O1¿€5Á=|1¿€’ÔÅ0¿„,¢ós0¿'^ý’0¿Çoìv^/¿½ñ5„r.¿ÿŠÍ‚g-¿@”¢Íw7 ?*'44^?€UEÏ“°3¿€+ÔâŒp3¿æòrT3¿€PHé‚<3¿ðµ#3¿€{øŒº3¿€Øp< ç2¿€ñæzÃ2¿?Þr}›2¿€ÜX¿qn2¿€É6c;2¿Â©œ(2¿€ÒÁ1¿€åvPw1¿€ Öt#1¿€èLf&Ä0¿´þ³ŠW0¿ôžØ^·/¿ ™œ.¿ñ¦ÁŠY-¿I=è+¿Åq~çA*¿ïA¯Ø^(¿ë›d6&¿{¹hÒ¾#¿fQí ¿<-áñk¿n¥_Á¿X/憿Уڨ⾰1ÿúk?Ê ¨ýd?€´´UÔ4¿g4F 4¿@OÈ™4¿€t ¿Y4¿gº¯´ñ3¿—hüHÚ3¿€ú¹à¿3¿idº¢3¿‡a€3¿€Ÿ4q0Z3¿|×Ï.3¿Ë†Õný2¿ÉºåÅ2¿—¤´„2¿=k9ó:2¿€6`ÒRæ1¿€5Ú…1¿€åÁ"1¿[!ò%”0¿ôº¡·þ/¿à0)§.¿p¤G-¿E”ŸO+¿9iS~=)¿¤áÊÔØ&¿çùm$¿ Þþã ¿*Ó¸Uk¿B¹û¢ÕR¿àBX°é>.Âý0?€»ê"25¿€ÕBÏø4¿©€;Tã4¿€ ö™•Ó4¿€’kL(Ã4¿îSøÓ°4¿€ 0ðœ4¿€ƒø=’„4¿€• aÂi4¿€™TK4¿€fÞ(4¿€ À¨ÿ3¿€… ç)Ñ3¿€tMt›3¿€ÂˆìD]3¿Ëùê3¿€Ì~³AÁ2¿ÿ€‚_2¿€í.Æí1¿Ô¼úãh1¿¾é4¢Í0¿€d…{0¿Y ò†‡.¿î0#œ–,¿½ S(Q*¿v!Qí¨'¿å¹Ùƒ$¿â˜ð5ì ¿FØ—`¿xPEƒ¿ðòÅÀZñ¾0Ë;‰Eý>€ˆ±£ƒ5¿€Žõ⹪5¿€ÂÅ»ª5¿È§€¡5¿—Ží‚–5¿n¬¤Ã‰5¿·EÊ${5¿3­áWj5¿^É÷V5¿€¿Ô†@5¿€îG_r&5¿²•]5¿€…ƒpä4¿€Àͬº4¿€Æ¶‹‰4¿€¬3±ŸO4¿€´'75 4¿€£YEº3¿U}fZ3¿€˜ƒkºè2¿¼ŸPÙa2¿_ñ/¹Á1¿€¿J‘1¿€Ë ô¸!0¿^+.¿l,=®+¿;Oк(¿@œ 9%¿J^Çâ!¿ 20O<¿LRÂu¿ØqY»í>€úÈV'¸6¿€~¸N"…6¿€æ°€x6¿€|¯9äq6¿€àŸ¢Ÿk6¿€šÝ’d6¿€ ª\\6¿€ÍT±R6¿€P³>;G6¿€»˜’96¿@±r8)6¿lzÑ6¿€­}†áý5¿‘ÃAá5¿O1›¾5¿¹Ä:›”5¿±¼ ¨a5¿€a>Ò#5¿€(²ÙÃØ4¿€ÖjÕ«}4¿Á¨µ%4¿²«X‰3¿¦Ó§æ2¿„kúß!2¿c²31¿€tªN 0¿+ÄÃÿn-¿ðÊÄx&*¿äuÊ1&¿ïC‡u!¿2À7æ¿| 5^À ¿€ÖCêA 7¿€XbP'97¿€Ù¬zø@7¿Ê=rðA7¿€´Ó„A7¿Oh~‹@7¿€´  ?7¿€ƒïqÕ<7¿®šÐ±97¿€–ŸO57¿Ào«J/7¿  %'7¿€Ï3XA7¿€Ê¿žÛ 7¿€3ÅÝû6¿$1©„â6¿€ÒôÂ6¿|õ#‰š6¿1Fïg6¿ùâvä%6¿€Tè„¶Ó5¿€dõ†l5¿:@në4¿ZqJ4¿±x±=‚3¿pšùã‰2¿€á‹æsV1¿ð¦®í´/¿Ô‰ÇÁ ,¿™}ž²z'¿…ËŠ£!¿¬/¿'ƒ™‹?8¿kíŒ@8¿ogvI8¿€Ÿâ`8¿€Ùõnö8¿€ñžð 8¿€xñØh"8¿€Írçè'8¿€hÄf-8¿™»¯28¿„r}78¿€¢|u;8¿€Ð›!>8¿ˆ0Óç>8¿ u=8¿€ðOz78¿€Zâá-8¿€z~—58¿€1L÷8¿N,&ãÞ7¿”›ë¬7¿€{DBi7¿€wã6(7¿ÿIlµ˜6¿€tìŽþ5¿€)Ö…75¿ÇŒ<484¿2Bü}ò2¿€*}“U1¿‡Ç .¿[MèÍ)¿$±·_L%¿€÷ ì…‘8¿€d/ÒÈ8¿€ðþ?ŒØ8¿ñ)äQã8¿€äÚ²çí8¿xwðHù8¿¶vÖ£9¿€@êjþ9¿áçQ!9¿€ ‚‰ˆ09¿”„@9¿ààþQ9¿vJ–åa9¿€Nâšr9¿€áü{¤‚9¿0ã|F‘9¿;¥àˆ9¿€µ¨'¦9¿@à~©9¿ÔIdq¥9¿2 ÒH—9¿‡Ñ±Œ{9¿€Ÿë,ÎM9¿€³²àd9¿€à×H¤8¿€E‹Œ¯8¿Yà]W7¿% èS6¿?4^ ù4¿"ɳ)(3¿dÑ„¦ž0¿°mÑ(¿H:ÄõÄ9¿€¡6ŽÄ¡9¿(Ц9¿ s³9¿€(5 Ã9¿€¬8‹Ô9¿%œ ßç9¿€~x¼ý9¿€WüU:¿ð`-:¿€B=ÝøH:¿€º cf:¿€»ŠãÅ…:¿‚H…ô¦:¿‡ Q¤É:¿Ç`Ecí:¿€»ü‹;¿Ë¥065;¿Ý)¿"W;¿o)Å¡u;¿0NÞpŽ;¿\뎞;¿ø_Ó¢;¿õó‰“;¿€yb:l;¿­Yùö";¿+¾Ä«:¿€ ÷9¿€ˆñ8¿€áàðk…7¿ë•â¶5¿€»7K:+4¿3 :¿€úφS:¿€ÁAg{l:¿¿-êÜ€:¿r5ýO–:¿™ÄT÷­:¿àú;1È:¿€¦B;å:¿€5ÍcM;¿€AIa(;¿]„’]O;¿E[Pºy;¿€”ÐZÖ§;¿€7p ÆÙ;¿Rcûˆ<¿€7‚ I<¿å6ê…<¿€OG ÆÅ<¿)[çÍ=¿¬dÃÕJ=¿€Œú`)=¿€¨`,\Ì=¿¯š>¿KBq2>¿€h‘N>¿€ÊuàN>¿€ÎÑÔ~(>¿€c˜$ÌÉ=¿`⎌=¿€j\K²ô;¿€Ôó‘ù:¿€ Nì66¿€‚#ûóD;¿ñì0Ð);¿Ÿ ú6;¿€_i35M;¿²»(^g;¿€½AÈЄ;¿€#Y!³¥;¿;_RÊ;¿€`bó;¿€mX4, <¿€^}$R<¿t85O‰<¿Õ®Ú Æ<¿€ {»=¿>À§Q=¿rsö¡=¿€©Ñ¶$÷=¿€·£‘ÖS>¿bkœê¶>¿ÊË?¿Ÿ±Ii?¿€)Åþ?¿À>Uýi7@¿@Î)ZÜm@¿À¾1É@Ÿ@¿ÀÂòüÇ@¿ÀJkLÀÞ@¿@nàAøÜ@¿À„Ë­Û´@¿@­yÙÀV@¿€’-¸Ëu?¿‚«þÊ2>¿çÈR`”;¿ŒˆçË×;¿ >ggø;¿€ £Ÿ<¿ü¨˜"5<¿ãb:X<¿W÷éw<¿€;QT«<¿I“ÞLÜ<¿€FÚÊç=¿€ßlÔ´O=¿€È!¶L“=¿€‚*ÝOÞ=¿€Rþ/d1>¿€b:ƒ1>¿€Õì%\ò>¿vü¤|a?¿€‘nuÛ?¿@%E»/@¿€>ëZw@¿A9Ä@¿€ÐVéÏA¿@;nkA¿€¾/5ÂA¿€üQ-B¿Ãf84hB¿@µUèܪB¿€B%¸ÏÔB¿¨©ÄÔB¿@¥iB¿N ŸMÒA¿@YʤF@¿5nÀ2¼<¿€¿ˆ¯—¨<¿ñ×ý7½<¿2M¿Û<¿Í•Rÿ<¿€=ø~'=¿€Y¯ŒT=¿€Ÿ9‡=¿€ÈÞð¿=¿€þ¡®oÿ=¿7ùwF>¿€ÅøãÙ•>¿`s¶wî>¿ÂgDQ?¿ùâÈA¿?¿€u“k¾@¿@žo–ƒ`@¿@ýaöu«@¿@ Êþ@¿€çÀR¬XA¿À[ïhz»A¿ÀÉK_M&B¿€Ø$g˜B¿@>øtC¿Àø_;MŠC¿€!aG~D¿@ßѨlD¿@IDl\½D¿@ªI;BÝD¿ÀÀú¬a«D¿€Ø<üC¿@YŒdB¿€;…?@ =¿ø(Q=¿€¶Á‹!x=¿(afÓœ=¿¾`èÄ=¿¥*Îñ=¿'+:F$>¿µ¡é]>¿€µ #Éœ>¿Pjãlä>¿dtïÝ4?¿€¼É$?¿€†Deô?¿{<Äï2@¿ÀÑÕxr@¿µä†¹@¿ÍV¤âA¿VùQWaA¿8j­ÃA¿€` r™0B¿@lìùŸ¨B¿@SÈæ+C¿@IkÏç¹C¿Àê"ôPD¿À¦ö;kíD¿@ñ›ˆE¿ÀñlàKF¿@Åçáê‚F¿Àª+ù.®F¿Àž‚À´eF¿€‚ªo‰^E¿@Þ¯]BC¿€ëe¹'>¿€½ïϦ>¿€©•­R5>¿€ö O„Z>¿ãs´­…>¿€ÖƼ‹¶>¿€ðà¨í>¿€9?îÅ+?¿€ŒOÂq?¿z`šÀ?¿wÃÚ´ @¿€F·>@¿L¹_w@¿€w`\e¶@¿|r†±ý@¿€4NÙMA¿ÀDþaß§A¿@‚íÔ B¿€¥Ï}B¿@…m¹ÕûB¿á$m¼‡C¿€L‹é!D¿€ÑýëÉD¿ÿT˜Ì}E¿€ïÎÙí8F¿@¹ž7òF¿@"»i+™G¿ÀüïJJH¿@$Î*H¿@æÌ[>–G¿€ÜllÈE¿ÀHvæBA¿GïÎq>¿ä8g¼>¿€¶Ðþç>¿€&ú_=?¿iÎ@¾@?¿«ð u?¿%u" °?¿Ýæ¾§ò?¿@ã/ï@¿@3žÖfI@¿À¢Ÿ‰]y@¿F”ÊŠ¯@¿¢©½ì@¿À5ãÞ1A¿]ǶòA¿@™|¾ØA¿@jÚ;B¿Àz·^§«B¿@]~½)C¿ÀÜŸ"·C¿À«×¤íTD¿ºJ «E¿ˆ¦ÎÂE¿€nÀ´¾F¿@:^ø5dG¿Àjïi”3H¿VNæH¿Rç2TI¿•)f7I¿˜Wt6$H¿@WçÚŠE¿¬9^é@¿äno'…?¿Dfõ(}?¿ÓÖœ?¿ÁhØ´Å?¿ÄÿÓö?¿Ûy*i@¿ÀÙPµh5@¿À-ªXwX@¿€ç!•€@¿@ÛÝËÿ¬@¿@ ~Ìß@¿€Ë¦SA¿Àäƒþ|ZA¿@’ê‚R¤A¿€gïšý÷A¿€<‡sËVB¿€C¿+ÂB¿€ü7l«;C¿@,JºæÄC¿Àiòˆk_D¿Àc„ E¿³†¹´ÌE¿€ì³»(ŸF¿Àõ+ä0€G¿)ƒÎgH¿€ÁýBI¿€˜ÏáûïI¿ÀZþd@5J¿@b­ƒ©I¿s1é”G¿@ýÅJ—B¿¶ä3Éx*¿€âñ˜ÔË?¿€S—:Š @¿À¿ù½“"@¿³ÚžH9@¿ÀúØdR@¿€ìå´n@¿À£Ýn¼Ž@¿|#¡³@¿ÜþÜ@¿hAª A¿ÀäÒ}?A¿ÀO¦Jq{A¿(å(„¿A¿&]Ù B¿¶c¨»dB¿)ÔØÈB¿@Žô0:C¿@0K6õºC¿S¾ÄøLD¿€Ò?œâñD¿€Wì«E¿k¹ŸòxF¿@s¶ZG¿C‰Ý1IH¿€{¯æ=:I¿@{`[·J¿À»ŠtªJ¿@nrR¨J¿ÀšØ«~I¿€µZýíDF¿€[=mN‡?¿}AÒ+>#¿`mÑTvi@¿`6ag@¿Às°«{w@¿@éiO@¿€)mÚ“¦@¿Àó³óHÃ@¿@&Ê"Óã@¿€…È·A¿€RÕE2A¿³‡bA¿@•û ˜A¿€&˜4hÕA¿ÀM=:B¿€°Û¹jB¿€Qß0HÅB¿À78y,C¿€w7 ¢C¿Bwã'D¿€äxšö¿D¿@NZlE¿ÀÌåIJ-F¿@YYáG¿˜âRïG¿€UnVÍåH¿ |±ì×I¿@q5—¤J¿€8=Ó K¿@§>¢ñœJ¿€Z´cP„H¿@Ø–°GC¿ÃâAuþ/¿€"Åÿ‹ÑA? ºwôûŠ@¿`õ\Dݯ@¿@§õÆ@¿RsåÝ@¿ÀzæR÷@¿€t µA¿Ñ°4A¿€ÊƒwYA¿Àåtˆ_ƒA¿€pÄX³A¿À¼d/éA¿À=Eiá&B¿€Ç}3mB¿3¥i½B¿€Ï úC¿Àî}šŠC¿@ЕXòøC¿€‰á­/D¿ÀeƬNE¿@}­Ú/ÌE¿û3Ð’F¿À÷þ›¹mG¿üìµ[H¿ÀŒ®ðbRI¿À9å”OD¿@úÐÆD¿7«Úî`E¿ÀeÅF¿ÀÚô•ÖF¿À%ö•±G¿¯nh H¿<=áŒI¿ÀÀ!ØeJ¿@ö2…‘ñJ¿Àa¿³w—ã>€vö_ O?0y¨ œ h?àh—‘*½A¿`3g<ŠÝA¿ l1&ñA¿]ª!cB¿ÀŠt ¢B¿`D+!–1B¿z:µLB¿@ö¶ðxkB¿ hOlŽB¿ ÀW1¶B¿ ,\âƒãB¿–¡õ@C¿ÀO¾îhRC¿ ¬ø%–C¿@þi5ÐãC¿€hºëïF¿6<Ø'§F¿@]MŠMG¿@h‰ùG¿€ÂBŽÍ•H¿ùBWùH¿˜W)ÍH¿@YÉk„eG¿ÀÅ7wC¿Þ¤M·5¿ñ;àóŸ/?`¢4Û÷ V?àû_"èm?€í&Ž”KB¿@þ<€hB¿ ±ÆÌxB¿ N kWˆB¿€ØßY™B¿ÌGÁn¬B¿€ªóòÁB¿`v<ìCÚB¿à‰î\ÌõB¿'z·C¿ |P«Š8C¿€UÖü`C¿ ÎNÇ&C¿ 0>ñÃC¿€ìÑhD¿àjàÿÀED¿µÅN•D¿@€FRzðD¿àÐv˜XE¿€e˜U’ÎE¿@%x3RF¿€ìÝo¶àF¿º$AëqG¿@3âšòG¿€Þˆ«œ9H¿@üÍÇòG¿Àù<¿vF¿ÖìâŠB¿€¾©¬Í=3¿€¤.õc1?€W° žKV?ð­%Çm?ÉÀ ¹B¿€ø”²B¿ë?I1»B¿À~×[ŒÇB¿@D$ˆÛÕB¿ LváýåB¿ Žå#øB¿Ð¨‘ C¿`øY¾ž#C¿ ½®=C¿]¹¼6[C¿àr\EÁ|C¿ vÊï¢C¿`§£ê~ÎC¿ÎµID¿€GnG9D¿@zÉ zD¿àÕ;iBÅD¿ÀjÞpE¿ 4`zÊzE¿àgGRæE¿ B4†YF¿€‹ØÅÎF¿9‚©X2G¿@kÙ#æaG¿@åF­‡G¿¸H«E¿@|ÎÂ_ B¿€^9*4¿˜àIÎ)? ’ŸÌ¨ÃR?`Kn¦ãˆg?`|µÕ–ÔB¿ &—î•íB¿ ª’n×ùB¿Àŧ'ÍC¿,êí‰C¿ ¨ˆÿ‰C¿€3*„ ,C¿àÅL@¯.*7¿òªp~?þeËP”M? ï'ð½Pf?âù˜?C¿ÀFÀåT5C¿À1aVÉ9C¿@ËÞÝFAC¿CøôIC¿ dî‹–SC¿ ‚éu8^C¿ aNøiC¿`=·WûvC¿à{YÒm…C¿ Qx惕C¿€°(øz§C¿ ˆ`)›»C¿à¹…ã8ÒC¿`ï¶ëC¿@ÑçÊ‚D¿À )D¿ÀõÈ‹ND¿ MÑø©wD¿`&Il]¦D¿Ó’áÙD¿m£öÛE¿h’¦‹GE¿ @©AuE¿@IËMc‡E¿`Ö)ªWE¿@ÔŠl™D¿B ª·B¿¡§­]1=¿â¿›”)¿H&Eæ0?Ë}Íï—K?àÐâZúYC¿@Ï™·ãnC¿€ô˜$²vC¿€ûû|C¿ $fl‚C¿„ ¯¢ˆC¿ µëTIC¿ ¼ÎÙl–C¿à=÷pžC¿ vµ#]¦C¿²&…H¯C¿~—7ï¸C¿ &nshÃC¿ wbŽÏÎC¿€¯lDÛC¿€é¢ëèC¿ „kÞí÷C¿ÀÿŧuD¿ ÁQ¦©D¿ ízÓŸ.D¿à3`BDD¿@”x[D¿`¶[ÔqD¿ ?Éw…D¿`æšÊD¿ Ù§žÑ‚D¿ÀœÍ-DD¿€VN%¹œC¿ LyB¿Å#§`=¿•$zi)¿T¼…›àB?@wˆîÃC¿@b­xµC¿à¸‡‹µC¿àÒKlÚ·C¿àjòVŠºC¿ ÇU>½C¿`P¤HÝ¿C¿`ø{;XÂC¿À ²A ÄC¿À Sp¤ÆC¿Àû÷-QÈC¿@þ‡±ÉC¿àrçEÊC¿`TêSÊC¿À2L£—ÉC¿À£—¤èÇC¿·ØÐÅC¿€•ã?ÁC¿à_Eo»C¿ÀWLN´C¿`|f*°«C¿€ Hü ¢C¿@™M½«˜C¿ò‰5’C¿€‡öæ–C¿¨Ñb«°C¿P=«?ýC¿ÜÞ£Á²D¿Àwó€DF¿@V’pŒ»I¿Àê‹?æQ¿€Ÿ Œ´]¿q“ÄÝC¿ XµÂîC¿ À`òC¿€¥‚ØÃòC¿`dò¤òC¿ çÐ ïñC¿îH•ðC¿À³E¡vîC¿à¦ñkëC¿ÀøƒCçC¿à¸»µÈáC¿ }ÁºÚC¿€ûÿNÌÑC¿@.Kƒ§ÆC¿^ÅOæ¸C¿@¹‰J¨C¿€„ñØ´“C¿àlXÒ?{C¿>ƒD<^C¿ êÛæ`wîá§C¿ÀPœõO˜E¿À ZßÄI¿@ŠéyUQ¿Àx¡Ð AX¿ ÎÂa¿ào]†úFD¿Àà2¥5D¿``©B>1D¿©ŸÇ|.D¿à€rDS+D¿@«ÙD'D¿  @P"D¿€# /‚D¿vlyRD¿ ¸£Ð6 D¿€<îÕüC¿ `ÇíC¿`Øî‘ÛC¿º9ç¤ÅC¿ ­‚^«C¿Àã[ÃŒC¿ åxÂfC¿@¶ÈÎÄ:C¿ à¬AC¿ ]:™¼ËB¿ {Ô€ˆB¿ Ÿž¿ž?B¿À³ŠpèöA¿àŽÄã»A¿H ‹«A¿`Mk˜‚B¿%W‚5C¿ÀÆ9¿Ì3F¿“.cÈL¿àm€\Ò6U¿0Ì⩚ƒa¿Hïu‘p9p¿à²— bD¿€k L™oD¿ ×þÿÂnD¿àLÇjD¿À.o®çdD¿àÉŒ³½]D¿ÀιuíTD¿@!Á-JD¿`TÕ¤&=D¿  ³ïp-D¿ ¤”à“D¿@ä¤8D¿`ÓnõéC¿àÉ€gB¿€Q]åB¿6ym ¢A¿€úÈ};A¿€“l”Æä@¿Æ¿FïÂ@¿À<{†)!A¿àÆòmi•B¿€¾!¢wDF¿7çÎ [N¿ a¼eW¿`:JµT€c¿(¢É¨‚Õp¿ Ž»÷ÌD¿€™,jó·D¿@å诖¯D¿@Wk²O¨D¿ \òðŸD¿Àj/EÝ•D¿à%<`¸‰D¿€lÍO!{D¿ óé…ªiD¿€&‹ˆÔTD¿ ›·z ªTïD¿ Y5PçD¿ |ʳ«ÜD¿ –"ÐD¿ f¢ÔõÀD¿ £ØKõ®D¿ß-ñŽ™D¿À´!¿.€D¿ æñ'bD¿`Ÿì°>D¿Ào°ÞD¿ÀÇ- ãC¿ëÏ4º©C¿À“²ÅeC¿kÏi3C¿€–Øä[¹B¿ &Ÿš¨MB¿@ñg¹ïÑA¿ ¾&Ï3FA¿à¸%&­@¿ ÍøÁ!@¿ÀtÎôÿ>¿€Ý˜eT>¿@#²=ÙÈ>¿ ¯Æ ÿÙ@¿€W%æ‹ÖD¿àÞÁéWÏM¿Ào3'i)X¿P×vd$e¿ÐŒp…˜s¿À›à ÁVE¿àÎ %Œ>E¿ ¨þ»û2E¿àcî?(E¿@Z÷i•E¿@Cßô½ E¿ @’îûD¿@/Ÿä/æD¿ ü‘µnÍD¿ 3to2°D¿àõE»D¿@Ë)eD¿àx5D¿ ?s:zýC¿€3‰Ó»C¿ %¼{÷nC¿à ’¢,C¿àFœ¬B¿èý`{3B¿€`U f¨A¿€%€¥ A¿` ^²^@¿ÀCiñR?¿†Ïp®þ=¿ÀXQæä=¿ŠGLj8=¿@wá"´?¿€ae!4}C¿ _;ü‹ÐK¿àW9{V¿@ŽËÞ}vc¿8:S^Šq¿@Ò+À£sE¿ \ÝÍ|E¿ §éôuE¿@fš¹jE¿ÀÊ4ßÒ\E¿ Fë”8LE¿±ý~ˆ8E¿ÀAL|A!E¿).ËE¿À™FtåD¿@Z϶n¿D¿ 7[Ë’D¿ %s^D¿€¹ß$!D¿àoüŽmÙC¿@4ô §…C¿`Zw·ú#C¿àè;$p²B¿@ö«¾/B¿ÃVVM˜A¿€Í¾3“í@¿`u=Î0@¿ÀC˜Ò>¿@’\OxO=¿~V®$<¿qxÖ¯é;¿À¬0LÇ=¿àÿ5ÖûùA¿ ׫“¦KI¿àX#.å[T¿àKlñåa¿‘yÍØq¿ÀÛ ¹åE¿€)-ªËE¿à~|P½E¿à `r°E¿ÀAÂÄ E¿ Œp?ÉŽE¿€’syE¿`Ù5@ƒ`E¿ ¦]é CE¿àà)êg E¿@Ñ÷nÆ÷D¿@y,ÈD¿ Å*²yD¿õÇ`OD¿à>‰¹bD¿`Øé˪C¿@ùe7¶CC¿ ÄÍÌB¿@îÝAB¿@2I£A¿àêxd„ï@¿ Üøä'@¿@š´t¢¤>¿À|ædû<¿€!+ˆ¯•;¿€"zrö:¿IÀe<¿ æˆõs@¿`—~Z^F¿À§—ªmdQ¿@^Ætx']¿Ð ñƒ4i¿à×ÁøðF¿@§;s F¿`+õ4F¿€–¿G÷E¿ y£nçE¿`½*0›ÔE¿ •vDa¾E¿ •5¤E¿àÖ ôr…E¿ ðL'^aE¿àœòz7E¿ ¶†æ±E¿ÀS0AûËD¿@¢ò ©ˆD¿€Ì z::D¿ ¶.úÞC¿ ,ŸSuC¿@‰?úB¿€S"œšlB¿àÌ&5ÊA¿@,oõA¿`å„á™D@¿@ÞûäÍ>¿€¹ þe =¿t/ßr;¿ÀÈ àÜv:¿€ÃØiç:¿'æóMN>¿€–v2ÁC¿ V¾ÅïáM¿ Ý섹TY¿ {³h¿£ÑÅzF¿]…[”^F¿ .4fÈOF¿MÀvAF¿ c%º1F¿àJçÖÓF¿ [æÙ'F¿ ñAƒ}ìE¿àòÖO0ÍE¿ cçC„¨E¿ Bb¡}E¿@nXïKE¿€¢“/,E¿€öÎ2ÍD¿@¸)~D¿àNxžd"D¿àH¼½¸C¿ v…=C¿a Ai¯B¿*˜­' B¿¼€ÿTA¿ åOÒ$‡@¿@Å#4æM?¿€áj|=¿€NR pÃ;¿@ÈÕz:¿@l@1F:¿Žß^eW<¿ 1ÔÈÃdA¿ EzÓ“H¿p?!h)!S¿ÀJŠúé^¿àx‘lšF¿@P£F¿@ÙFLâšF¿ ÃC´F¿ bÀˆ–}F¿¯ ÒxjF¿ AÓ6íSF¿ ;a¨i9F¿ ´NF¿ÀÔëWäõE¿ ›ÆÔZËE¿íêg™E¿àï`E¿ÀãïE¿@Ç:ÏD¿`¸…ÜtD¿ÀŒ·&ˆ D¿TÛä+”C¿€L`Ç C¿àûÜ{kB¿@³&üÙ·A¿ ÝV0¬î@¿ ÒuÊ,@¿Àg1S>¿Vnê‰<¿@^ËW) ;¿@ %¤T:¿À‘AAN;¿@^+ˆš?¿à©X7E¿àÀ³âŽ8P¿À×p#+]¿€™-áPG¿àtMD]ùF¿€{¼êF¿@ŠèDâÜF¿kDpÍF¿`Ô?苺F¿ iÂ쪤F¿€^7 îŠF¿ pª%»lF¿`ø—ÔfIF¿`A;L( F¿€1¯"ðE¿ ðÜ-O¸E¿ ¾-ªŽwE¿À0Ä,E¿àÁ‡ÜÕD¿`g×qÑqD¿€¢¤¼´þC¿àôËŸzC¿ÀUÌÜãB¿€ŒÒé8B¿`?ªXyA¿@noþf¦@¿€¹ÊE™Š?¿:Û ‰Ã=¿î­Á(<¿@J1¨;¿@%Ãtš1;¿@³U«›=¿àÕ>f¾B¿@£|j¦H¿pÜ—¬°ÙQ¿€M.óú6G¿`F¼¤AG¿ 6$pÐ9G¿€yÞþ-G¿ ŠÝ%aG¿ S—£ò G¿ @ PDùF¿€ppqëàF¿ÃZJÄF¿ ÃÌÕÕ¢F¿ JFÁ{F¿ †¼XNF¿à%ÑÙ’F¿jiFŠÜE¿ ÿ"~è•E¿àȪIDE¿@9®ˆÓæD¿À{¢*g{D¿@K….TD¿@r `gtC¿»ÐÕB¿À>sz$B¿Àytžh`A¿€xþ@¿€ä+’i?¿€{0´³Í=¿v¥;”‡<¿ÀÄ“®À<¿i`8Ç8=¿À.ÄœM»@¿Àpµ¸eÃE¿â'B3ìP¿«Öž ¹G¿ …"ï5šG¿€vÖ´nG¿€Ãã«çG¿À`½ytG¿ÀÒ‰\™dG¿`ýiˆQG¿@[1;G¿@ä® G¿ÀKØçG¿óØE±ÝF¿@¢å ó³F¿`"gÂ%ƒF¿ ‚(6KF¿WÔz$ F¿€­'ãõ¿E¿àêMjE¿ ž=Ù¾E¿€#D°˜D¿€è-ßD¿À#‰T‹C¿`"©|åìB¿ ò9o¡;B¿@\Ÿ^A¿` °ò¶@¿cwSGï?¿€_Rô†—>¿@(bf^×=¿ÀúƼ >¿À»W"@¿@}’Ô°B¿àû%ð “G¿à鬀ÐG¿`–Ç0áG¿@»EÎÌßG¿€Ð¶j·×G¿6©ÚÌG¿ 1¨p¾G¿à³±È­G¿À/Ò´¢™G¿LÿÅVG¿À‹ÉhfG¿ ?ýÞ,EG¿ †’w¢ G¿€ú5åóF¿àÒ_ÀÃF¿@<¸=Ÿ‡F¿ ùªlOGF¿Àuˆe+ùE¿9åΛ¥E¿ U±$3@E¿à@Ø”ÕD¿ Ë6š0TD¿ÃTÚÐC¿À=YÐ/C¿Ç? ••B¿ Á7:CÛA¿à£ þ?A¿€SNu ‰@¿À›—-w2@¿@OÈ:]Â?¿ ¾†2è@¿ÀÒµ¤)»A¿À #/F¿,ôÿÿÿÿï?ìÿÿÿÿï?²Þÿÿÿÿï?nÈÿÿÿÿï?¢£ÿÿÿÿï?gÿÿÿÿï?Ýÿÿÿÿï?bþÿÿÿï?¼[ýÿÿÿï?L´ûÿÿÿï?º ùÿÿÿï?`Ðôÿÿÿï?žîÿÿÿï?€‚ãÿÿÿï?JðÒÿÿÿï?¨.¹ÿÿÿï?.r‘ÿÿÿï?ÊžTÿÿÿï?ÆFøþÿÿï?ˆKmþÿÿï?Ôžýÿÿï?Zâküÿÿï?ZE¬úÿÿï? È$øÿÿï?b­†ôÿÿï?ܽiïÿÿï?¹ÌFèÿÿï? frÞÿÿï?NrÑÿÿï?Hí9¿ÿÿï?j ®§ÿÿï?)‰ÿÿï?Zïÿÿÿÿï?àãÿÿÿÿï?¨Ðÿÿÿÿï?’°ÿÿÿÿï?>{ÿÿÿÿï?ú"ÿÿÿÿï?€‘þÿÿÿï?Þ¢ýÿÿÿï?Lüÿÿÿï?’¤ùÿÿÿï?f¦õÿÿÿï?`<ïÿÿÿï?3þäÿÿÿï?â¼Ôÿÿÿï?D»ÿÿÿï?bü’ÿÿÿï?ÊžTÿÿÿï?¨môþÿÿï? Caþÿÿï?:‚ýÿÿï?Æs2üÿÿï?„È>úÿÿï?¨:^÷ÿÿï?tõ+óÿÿï?0›íÿÿï?Že~äÿÿï?”PZØÿÿï?x(}Çÿÿï?Pâc°ÿÿï?HQ7‘ÿÿï?øûËgÿÿï?÷k«1ÿÿï?Âèÿÿÿÿï?ˆØÿÿÿÿï?6½ÿÿÿÿï?\ÿÿÿÿï?´Bÿÿÿÿï?Ãþÿÿÿï?tïýÿÿÿï?,’üÿÿÿï?\Túÿÿÿï?Zªöÿÿÿï?ò´ðÿÿÿï?Øçÿÿÿï?´’×ÿÿÿï?.ξÿÿÿï?6y—ÿÿÿï?BoYÿÿÿï?ÆFøþÿÿï? Caþÿÿï?Ìfxýÿÿï?zXüÿÿï?r½øùÿÿï?|žÎöÿÿï?ªgòÿÿï?¦/ëÿÿï?,‘áÿÿï?¸‹¦Òÿÿï?ˆ­¾ÿÿï?È7S¡ÿÿï?THŽyÿÿï?$EjCÿÿï?úµÛúþÿï?O(:›þÿï?Îßÿÿÿÿï?Éÿÿÿÿï?Œ¢ÿÿÿÿï?Œaÿÿÿÿï?Dôþÿÿÿï?:=þÿÿÿï?ð ýÿÿÿï?ìûÿÿÿï?²Ê÷ÿÿÿï?†gòÿÿÿï?º•éÿÿÿï?$9Ûÿÿÿï?¶÷Ãÿÿÿï?Lˆžÿÿÿï?¿¥bÿÿÿï?êzÿÿÿï?ˆKmþÿÿï?:‚ýÿÿï?zXüÿÿï?N¡àùÿÿï?Ž4ƒöÿÿï?Jûjñÿÿï?à Çéÿÿï? frÞÿÿï?¾íÐÍÿÿï?Ò±µÿÿï?J²#“ÿÿï?ÓHbÿÿï?Úp+ÿÿï?,™Àþÿï?°®Bþÿï?mΙýÿï?ÈÓÿÿÿÿï?*´ÿÿÿÿï?T~ÿÿÿÿï?ú"ÿÿÿÿï?~ˆþÿÿÿï?B„ýÿÿÿï?”Ïûÿÿÿï?àõøÿÿÿï?Ö7ôÿÿÿï?N]ìÿÿÿï?ækßÿÿÿï?Q3Êÿÿÿï?p˜§ÿÿÿï?}oÿÿÿï?¤ÿÿÿï?TI„þÿÿï?Ôžýÿÿï?Æs2üÿÿï?r½øùÿÿï?Ž4ƒöÿÿï?u†.ñÿÿï? ~ éÿÿï?\…ºÜÿÿï?èüKÊÿÿï?€Õ¯ÿÿï?"g ‡ÿÿï?ÀJMÿÿï?úµÛúþÿï?FÙ†þÿï?œ2üåýÿï? ™h ýÿï?ôø­ãûÿï?ÈÃÿÿÿÿï?6˜ÿÿÿÿï?žMÿÿÿÿï?VÎþÿÿÿï?æõýÿÿÿï?&‡üÿÿÿï?úÿÿÿï?& öÿÿÿï?`<ïÿÿÿï?fããÿÿÿï?ØÑÿÿÿï?jû±ÿÿÿï?ñ~ÿÿÿï?–+ÿÿÿï?d@¤þÿÿï?èãÉýÿÿï?Zâküÿÿï?„È>úÿÿï?|žÎöÿÿï?Jûjñÿÿï? ~ éÿÿï?Mº"Üÿÿï?NqÈÿÿï?¾g°ªÿÿï?³8~ÿÿï?p<„<ÿÿï?>m›Üþÿï?<jRþÿï?¼tŽýÿï?I {üÿï?Fûÿï?| Nþøÿï?¶®ÿÿÿÿï?2sÿÿÿÿï?Æ ÿÿÿÿï? ]þÿÿÿï?Š0ýÿÿÿï?d0ûÿÿÿï?²Ê÷ÿÿÿï?x òÿÿÿï?¢\èÿÿÿï?ÞØÿÿÿï?øû¼ÿÿÿï?6âÿÿÿï?ôJEÿÿÿï?4–Êþÿÿï?ÁÞþÿÿï?’„»üÿÿï?ZE¬úÿÿï?¨:^÷ÿÿï?ªgòÿÿï?à Çéÿÿï?\…ºÜÿÿï?NqÈÿÿï?XÀ2©ÿÿï?THŽyÿÿï?÷k«1ÿÿï?¼&kÆþÿï?¦ Q(þÿï?h_=Býÿï?бú÷ûÿï?V9Ô$úÿï?À¼Yš÷ÿï?ܾ³ôÿï?>“ÿÿÿÿï?´Bÿÿÿÿï?\·þÿÿÿï?Çýÿÿÿï?®)üÿÿÿï?4eùÿÿÿï?«ôÿÿÿï?BŸìÿÿÿï?ûÞÿÿÿï?òÇÿÿÿï?N7¡ÿÿÿï?e`ÿÿÿï?¨môþÿÿï?ü„Aþÿÿï?ªýÿÿï?Љ7ûÿÿï? È$øÿÿï?tõ+óÿÿï?¦/ëÿÿï? frÞÿÿï?èüKÊÿÿï?¾g°ªÿÿï?THŽyÿÿï?daê-ÿÿï?x㪺þÿï?¦ þÿï? ™h ýÿï?A1Žûÿï?zÕ¶fùÿï?¼ÅiRöÿï?Jýñÿï?˜çõýëÿï?Öoÿÿÿÿï?Ýÿÿÿÿï?Hþÿÿÿï?~ýÿÿÿï?vÏúÿÿÿï?ê÷ÿÿÿï?Pðÿÿÿï?äYåÿÿÿï?dRÒÿÿÿï?jû±ÿÿÿï??{ÿÿÿï?þÿÿÿï?TI„þÿÿï?:‚ýÿÿï?Ä1Õûÿÿï?wùÿÿï?b­†ôÿÿï?0›íÿÿï?,‘áÿÿï?¾íÐÍÿÿï?€Õ¯ÿÿï?³8~ÿÿï?÷k«1ÿÿï?x㪺þÿï?„›‰þÿï? ‚Ãìüÿï?(™NIûÿï?ÂÕÚøÿï?Þ®1Hõÿï?†©¢ðÿï?êà¸Èèÿï?HµƒÞÿï?´Bÿÿÿÿï?\³þÿÿÿï?Ó¸ýÿÿÿï?üÿÿÿï?º ùÿÿÿï?rèóÿÿÿï?°ëÿÿÿï?T·Ûÿÿÿï? qÁÿÿÿï?怔ÿÿÿï?^ñGÿÿÿï?z Æþÿÿï?žêýÿÿï?<¯yüÿÿï?òvúÿÿï?LV öÿÿï?ܽiïÿÿï?Že~äÿÿï?¸‹¦Òÿÿï?Ò±µÿÿï?"g ‡ÿÿï?p<„<ÿÿï?¼&kÆþÿï?¦ þÿï? ‚Ãìüÿï?<b1ûÿï?¬Søÿï?Ú´'šôÿï?.y¼îÿï? ÞÃ)æÿï?@#.ÓÙÿï?VàR\Èÿï?Ö ÿÿÿÿï?pMþÿÿÿï?~ýÿÿÿï?¾úÿÿÿï?òÈöÿÿÿï?&âïÿÿÿï?fããÿÿÿï?«Ïÿÿÿï?F5«ÿÿÿï?mmÿÿÿï?êzÿÿÿï?D‚Nþÿÿï?ªýÿÿï?BSûÿÿï?î•¢÷ÿÿï?‚çàñÿÿï?¹ÌFèÿÿï?”PZØÿÿï?ˆ­¾ÿÿï?J²#“ÿÿï?ÀJMÿÿï?>m›Üþÿï?¦ Q(þÿï? ™h ýÿï?(™NIûÿï?¬Søÿï?¼H—]ôÿï?ÎaÄþíÿï?b«9qäÿï?ÖQÖÿï?~좾Áÿï?D!F¤ÿï?Ãþÿÿÿï?öÍýÿÿÿï?Lüÿÿÿï?J#ùÿÿÿï?rèóÿÿÿï?¾êÿÿÿï?0¹Úÿÿÿï?.ξÿÿÿï?bLŽÿÿÿï?lJ:ÿÿÿï?)M©þÿÿï?"û¯ýÿÿï?^îüÿÿï?V‚,ùÿÿï?R“Wôÿÿï?f(-ìÿÿï? frÞÿÿï?x(}Çÿÿï?È7S¡ÿÿï?ÓHbÿÿï?úµÛúþÿï?<jRþÿï?h_=Býÿï?A1Žûÿï?ÂÕÚøÿï?Ú´'šôÿï?ÎaÄþíÿï?6¶•×ãÿï?8/´oÔÿï?‚í?a½ÿï?<å»b›ÿï?^!íjÿï?lþÿÿÿï?Š0ýÿÿÿï?àûÿÿÿï?N"÷ÿÿÿï?úLðÿÿÿï?øBäÿÿÿï?«Ïÿÿÿï?nªÿÿÿï? 5iÿÿÿï?ÆFøþÿÿï?0 4þÿÿï?ªšàüÿÿï?—úÿÿï?¶8©öÿÿï?8”ðïÿÿï?Že~äÿÿï?NrÑÿÿï?Pâc°ÿÿï?THŽyÿÿï?Úp+ÿÿï?FÙ†þÿï?¼tŽýÿï?бú÷ûÿï?zÕ¶fùÿï?Þ®1Hõÿï?.y¼îÿï?b«9qäÿï?8/´oÔÿï?—XœÚ»ÿï?Œ@‹š–ÿï?Dè·ú^ÿï?Búî< ÿï?Œþÿÿÿï?­püÿÿÿï?’¤ùÿÿÿï?«ôÿÿÿï?¬Öëÿÿÿï?Â3Üÿÿÿï?J“Àÿÿÿï?6âÿÿÿï?lJ:ÿÿÿï?d@¤þÿÿï?Ôžýÿÿï?Ä1Õûÿÿï?~ ¼øÿÿï?ˆý_óÿÿï?†Î#êÿÿï?0-KÚÿÿï?Hí9¿ÿÿï?HQ7‘ÿÿï?$EjCÿÿï?,™Àþÿï?œ2üåýÿï?I {üÿï?V9Ô$úÿï?¼ÅiRöÿï?†©¢ðÿï? ÞÃ)æÿï?ÖQÖÿï?‚í?a½ÿï?Œ@‹š–ÿï? ³[ÿï?Ü[ ÿï?¦ì8ñzþï?B„ýÿÿÿï?Šûÿÿÿï?êÿ÷ÿÿÿï?â¬ñÿÿÿï?~eæÿÿÿï?dRÒÿÿÿï?«®ÿÿÿï?}oÿÿÿï?,Íÿþÿÿï?¼ß:þÿÿï?ªšàüÿÿï? ‡úÿÿï?L\öÿÿï?žš$ïÿÿï?l’âÿÿï?$¡õÌÿÿï?j ®§ÿÿï?øûËgÿÿï?úµÛúþÿï?°®Bþÿï? ™h ýÿï?Fûÿï?À¼Yš÷ÿï?Jýñÿï?êà¸Èèÿï?@#.ÓÙÿï?~좾Áÿï?<å»b›ÿï?Dè·ú^ÿï?Ü[ ÿï?Øâqþï?f®|—ýï?:ïüÿÿÿï?±xúÿÿÿï?& öÿÿÿï?žîÿÿÿï?6Ûßÿÿÿï?`cÆÿÿÿï?.í˜ÿÿÿï?^ñGÿÿÿï?äÿ·þÿÿï?bÀ¸ýÿÿï?>Eõûÿÿï?‚ØØøÿÿï?ˆý_óÿÿï?à Çéÿÿï?fÕÙÿÿï?Θϻÿÿï?)‰ÿÿï?÷k«1ÿÿï?O(:›þÿï?mΙýÿï?ôø­ãûÿï?| Nþøÿï?ܾ³ôÿï?˜çõýëÿï?HµƒÞÿï?VàR\Èÿï?D!F¤ÿï?^!íjÿï?Búî< ÿï?¦ì8ñzþï?f®|—ýï?¾ðº;üï?ôAüÿÿÿï?Œ9ùÿÿÿï?ð¿óÿÿÿï?Záéÿÿÿï?ÞØÿÿÿï?‚2¸ÿÿÿï?ñ~ÿÿÿï?vnÿÿÿï? Caþÿÿï?ªýÿÿï?hªÕúÿÿï?|žÎöÿÿï?º­ïÿÿï?^æãÿÿï?$¡õÌÿÿï?ãe"¦ÿÿï?ÓHbÿÿï?f›*ìþÿï?Λdþÿï?ˆ^þ½üÿï?ºÿ_úÿï?¼ÅiRöÿï?òùqïÿï?6¶•×ãÿï?ÎTÌfÐÿï?ÐôŸ°ÿï?Ö¢2Ízÿï?({Ì#ÿï?Âä4—þï?CØz¡¶ýï?fUŒTüï? júU.úï?’{ûÿÿÿï?²Ê÷ÿÿÿï?$ñÿÿÿï?3þäÿÿÿï?«Ïÿÿÿï?p˜§ÿÿÿï?e`ÿÿÿï?œKàþÿÿï? =úýÿÿï?LÝ]üÿÿï?t4|ùÿÿï?R“Wôÿÿï?¦/ëÿÿï?ÎëÚÿÿï?ˆ­¾ÿÿï?Âä:‹ÿÿï?÷k«1ÿÿï?<à”þÿï?ŽØ‚ýÿï?â9¤ûÿï?è£nhøÿï?lKÕòÿï?¢:Féÿï?ÒYhúØÿï?‚í?a½ÿï?è UùŽÿï?v‚ÏAÿï?lª9Áþï?ðUDðýï?4{ü¬œüï?’,û ~úï?¤]}&÷ï?œúÿÿÿï?Ø+öÿÿÿï?žîÿÿÿï?ækßÿÿÿï?4ÉÄÿÿÿï?怔ÿÿÿï?N=ÿÿÿï?ØŸþÿÿï?:‚ýÿÿï?ôf€ûÿÿï?Ô¾ä÷ÿÿï?Jûjñÿÿï? íÑåÿÿï?NrÑÿÿï?8'¬ÿÿï?&"zjÿÿï?ÊÞ öþÿï?¦ Q(þÿï?ˆ^þ½üÿï?TACBúÿï?@¹Wëõÿï?Ì«^îÿï?¸ÎLáÿï?jBˆËÊÿï?D!F¤ÿï?\¶tÅbÿï?¦Å4ôþï?òU;þï?jBýï?Чûï?HwØ¿Þ÷ï?6#+Ãòï?’¤ùÿÿÿï?¾^ôÿÿÿï?¾êÿÿÿï?h.Ùÿÿÿï?¨.¹ÿÿÿï?ñ~ÿÿÿï?¤ÿÿÿï?ÛTþÿÿï?F`øüÿÿï? ‡úÿÿï?LV öÿÿï?îÿÿï?¾0‹ßÿÿï?:<ˆÅÿÿï?‚Ùá–ÿÿï?$EjCÿÿï?Ò_t®þÿï?hY¥ýÿï? ÔõÎûÿï?¬Søÿï?lKÕòÿï?êà¸Èèÿï?Ћ{9×ÿï?¼_§°¸ÿï?ÖÐáàƒÿï?°Ži)ÿï?ðJ«Žþï?0ÛA‡ýï?>MźÍûï?V²(ïøï?r–•þ6ôï? ó±Žìï?^—øÿÿÿï?†gòÿÿÿï?Øçÿÿÿï?dRÒÿÿÿï?É`¬ÿÿÿï?â gÿÿÿï?â‡èþÿÿï?ÁÞþÿÿï?LÝ]üÿÿï?wbùÿÿï?šÿöóÿÿï?†Î#êÿÿï?”PZØÿÿï?æ5¸ÿÿï?³8~ÿÿï?’šÖÿÿï?¤¡YZþÿï? ™h ýÿï?b¶²úÿï?ÜÇP„öÿï?ðå9ïÿï?pÞõáÿï?jBˆËÊÿï?$ð!¢ÿï? ³[ÿï?0‰D£ßþï?”yi þï?4{ü¬œüï? júU.úï?ð¯Ï/öï?å£fú?ïï?ôè=Päï?.x÷ÿÿÿï?úLðÿÿÿï?> ãÿÿÿï?XîÊÿÿÿï?Lˆžÿÿÿï?j Mÿÿÿï?äÿ·þÿÿï?Χýÿÿï?x´ûÿÿï? È$øÿÿï?€o¦ñÿÿï? íÑåÿÿï?âLÐÿÿï?XÀ2©ÿÿï?ÓHbÿÿï?©äáþÿï?Žháùýÿï?D }Wüÿï?zÕ¶fùÿï?ܾ³ôÿï?´Û²­êÿï?@#.ÓÙÿï?—XœÚ»ÿï?,W¦Á†ÿï?°Ži)ÿï?¦„þï?¶ajeýï?¸Yx sûï?cøï?Lìo½^òï?.JDzèï?襁¨”Øï?Löÿÿÿï?žîÿÿÿï?ûÞÿÿÿï?6#Ãÿÿÿï?6âÿÿÿï?r™1ÿÿÿï?TI„þÿÿï?bôEýÿÿï?‚Áýúÿÿï?|žÎöÿÿï?žš$ïÿÿï?,‘áÿÿï?x(}Çÿÿï?Rõ³˜ÿÿï?$EjCÿÿï?ÚA+¨þÿï?¼tŽýÿï?A1Žûÿï?fÇiï÷ÿï?o§Ûdñÿï?¾<šåÿï?ÎTÌfÐÿï?Þodªÿï?Œúwfÿï?¸f‡íþï?ä•)þï?4{ü¬œüï?@Õ¿¯úï?8“D}õï?ôv’¯íï?ð²ÃäSàï?ÍÍÉï?¢õÿÿÿï?¬Öëÿÿÿï?0¹Úÿÿÿï?D»ÿÿÿï?Ú¿€ÿÿÿï?¤ÿÿÿï?D‚Nþÿÿï?ªšàüÿÿï?„È>úÿÿï?rÙfõÿÿï?¶ìÿÿï?Mº"Üÿÿï?ˆ­¾ÿÿï?"g ‡ÿÿï?ð7"ÿÿï?¬ÇÃiþÿï?Ø#Êýÿï?b¶²úÿï?¼ÅiRöÿï?Ì«^îÿï?Ø"mðßÿï?ö]ãÎÅÿï?Œ@‹š–ÿï?v‚ÏAÿï?Ü¿[Ó¨þï?f®|—ýï?Ê`¿]°ûï?„'8¤Pøï?Lìo½^òï?¨a^­úçï?Í~Öï?6’eg·ï?rèóÿÿÿï?º•éÿÿÿï?xvÖÿÿÿï?0³ÿÿÿï?B…qÿÿÿï?ÆFøþÿÿï?þÿÿï?<¯yüÿÿï?t4|ùÿÿï?šÿöóÿÿï?à Çéÿÿï?|P×ÿÿï?¶qg´ÿÿï?¼è¶tÿÿï?žQ’ÿþÿï?¦ Q(þÿï?0]3üÿï?ì¢ÀÈùÿï?Ú´'šôÿï?XÕL ëÿï?@#.ÓÙÿï?,H~Jºÿï?˜í€ÿï?ˆT|Ïÿï?‚PP\þï?jBýï?Ž.¤úï?¦øª\öï?ð{»¼¾îï?­OKáï?ÍÍÉï? ÷ bq¡ï?$Áòÿÿÿï?Bfçÿÿÿï?dRÒÿÿÿï?F5«ÿÿÿï?¿¥bÿÿÿï?hÜþÿÿï?ÖŸâýÿÿï?zXüÿÿï?~ ¼øÿÿï?l‘Šòÿÿï?ìnçÿÿï??áÑÿÿï?¾g°ªÿÿï?ÓHbÿÿï?>m›Üþÿï?œ2üåýÿï?ñZüÿï?ÂÕÚøÿï?lKÕòÿï?ÌybÅçÿï?DúvvÓÿï?DÛó:®ÿï?^!íjÿï?¸f‡íþï?”yi þï?F[õFmüï?ælˆ€ùï?r–•þ6ôï?âKŒ¸êï?öZû4ÍÙï?^'4[¼ï?Ò;¶{tˆï?â¬ñÿÿÿï?äYåÿÿÿï?ØnÎÿÿÿï?¼Ò£ÿÿÿï?ÊžTÿÿÿï? oÁþÿÿï?"û¯ýÿÿï?x´ûÿÿï?Føÿÿï?u†.ñÿÿï?Že~äÿÿï?$¡õÌÿÿï?È7S¡ÿÿï?„™uPÿÿï?x㪺þÿï?hY¥ýÿï?â9¤ûÿï?fÇiï÷ÿï?²Á5ñÿï?b«9qäÿï? ÞüÍÿï?$ð!¢ÿï?ÚçŠSÿï?lª9Áþï?CØz¡¶ýï?>MźÍûï?„'8¤Pøï?œéX÷ñï?¾sØøwæï?<)€ÑÑï?jë´0­ï?Xúoù†mï?ò´ðÿÿÿï?€‚ãÿÿÿï?XîÊÿÿÿï?F)ÿÿÿï?^ñGÿÿÿï?)M©þÿÿï?:‚ýÿÿï?\ûÿÿï?¨:^÷ÿÿï?8”ðïÿÿï?” âÿÿï?NqÈÿÿï?Rõ³˜ÿÿï?yŒÿ?ÿÿï?O(:›þÿï?JŽEiýÿï?<b1ûÿï?Ö8Ç÷ÿï?òùqïÿï?¸ÎLáÿï?ZÂzÇÿï?Œ@‹š–ÿï?ñÿé<ÿï?Âä4—þï?¶ajeýï?Î+õ 2ûï?¤]}&÷ï?n?¾-½ïï?±„«:âï?ÍÍÉï?ö&:=žï?ªø~†HRï?&âïÿÿÿï?0ñáÿÿÿï?òÇÿÿÿï?6y—ÿÿÿï?N=ÿÿÿï?*¢”þÿÿï?.›Zýÿÿï?BSûÿÿï?|žÎöÿÿï?KÞîÿÿï?=ûàÿÿï?˜‡Äÿÿï?HQ7‘ÿÿï?÷k«1ÿÿï?Êþÿï?³4ýÿï?¸#—Ìúÿï?¼ÅiRöÿï?ÎaÄþíÿï?HµƒÞÿï?~좾Áÿï?ÚniMŒÿï?°Ži)ÿï?Øâqþï?B–Îýï?Ž.¤úï?ð¯Ï/öï?ôv’¯íï?:îk·KÞï?éB¦SÂï?q.ú;ï?¨>Æ¿8ï?`<ïÿÿÿï?Bµàÿÿÿï?¾—Åÿÿÿï?bü’ÿÿÿï?(Š4ÿÿÿï?TI„þÿÿï?~b;ýÿÿï?hªÕúÿÿï?L\öÿÿï?îÿÿï? frÞÿÿï?¦QgÁÿÿï?Âä:‹ÿÿï?â1&ÿÿï?¬ÇÃiþÿï? ™h ýÿï?XÐR{úÿï?\ë¶õÿï?œJóÑìÿï?ö44@Üÿï?‚í?a½ÿï?ÖÐáàƒÿï?ˆT|Ïÿï?Ü(ÅŠQþï?0šéìÞüï? júU.úï?êr1õï?" Þöëï?ÔnûÚï?^'4[¼ï?®VµZ„ï?ZdÂ#ï? Êîÿÿÿï?6Ûßÿÿÿï?¶÷Ãÿÿÿï?6âÿÿÿï?t.ÿÿÿï?N÷xþÿÿï?H¾%ýÿÿï?ZE¬úÿÿï?LV öÿÿï?†glíÿÿï?³OÝÿÿï?Hí9¿ÿÿï?"g ‡ÿÿï?Úp+ÿÿï?¤¡YZþÿï? ‚Ãìüÿï?TACBúÿï?Þ®1Hõÿï?˜çõýëÿï?ô»ý¦Úÿï?,H~Jºÿï?¼Ö(ç}ÿï?Búî< ÿï?òU;þï?Ïb³üï?[MÊÙùï?:qõŒôï?âKŒ¸êï?襁¨”Øï?6’eg·ï?‚As´{ï?\WLWï?µîÿÿÿï?ækßÿÿÿï?6#Ãÿÿÿï?bLŽÿÿÿï?–+ÿÿÿï?Ò,sþÿÿï?ªýÿÿï?—úÿÿï?Ú¼äõÿÿï?0›íÿÿï?\…ºÜÿÿï?ˆ­¾ÿÿï?4¼ç„ÿÿï?â ÿÿï?<jRþÿï?Œ»|Ýüÿï?V9Ô$úÿï?:‹mõÿï?0&^ëÿï?@#.ÓÙÿï?¼_§°¸ÿï?Ö¢2Ízÿï?:cò8ÿï?šZˆl/þï?4{ü¬œüï?ü9k›­ùï?r–•þ6ôï?®ÐZ…êï?TŠRjQ×ï?6¢Xû´ï?¨[>,%wï?lo- ï?µîÿÿÿï?ækßÿÿÿï?6#Ãÿÿÿï?bLŽÿÿÿï?–+ÿÿÿï?Ò,sþÿÿï?ªýÿÿï?—úÿÿï?Ú¼äõÿÿï?0›íÿÿï?\…ºÜÿÿï?ˆ­¾ÿÿï?4¼ç„ÿÿï?â ÿÿï?<jRþÿï?Œ»|Ýüÿï?V9Ô$úÿï?:‹mõÿï?0&^ëÿï?@#.ÓÙÿï?¼_§°¸ÿï?Ö¢2Ízÿï?:cò8ÿï?šZˆl/þï?4{ü¬œüï?ü9k›­ùï?r–•þ6ôï?®ÐZ…êï?TŠRjQ×ï?6¢Xû´ï?¨[>,%wï?lo- ï? Êîÿÿÿï?6Ûßÿÿÿï?¶÷Ãÿÿÿï?6âÿÿÿï?t.ÿÿÿï?N÷xþÿÿï?H¾%ýÿÿï?ZE¬úÿÿï?LV öÿÿï?†glíÿÿï?³OÝÿÿï?Hí9¿ÿÿï?"g ‡ÿÿï?Úp+ÿÿï?¤¡YZþÿï? ‚Ãìüÿï?TACBúÿï?Þ®1Hõÿï?˜çõýëÿï?ô»ý¦Úÿï?,H~Jºÿï?¼Ö(ç}ÿï?Búî< ÿï?òU;þï?Ïb³üï?[MÊÙùï?:qõŒôï?âKŒ¸êï?襁¨”Øï?6’eg·ï?‚As´{ï?\WLWï?`<ïÿÿÿï?Bµàÿÿÿï?¾—Åÿÿÿï?bü’ÿÿÿï?(Š4ÿÿÿï?TI„þÿÿï?~b;ýÿÿï?hªÕúÿÿï?L\öÿÿï?îÿÿï? frÞÿÿï?¦QgÁÿÿï?Âä:‹ÿÿï?â1&ÿÿï?¬ÇÃiþÿï? ™h ýÿï?XÐR{úÿï?\ë¶õÿï?œJóÑìÿï?ö44@Üÿï?‚í?a½ÿï?ÖÐáàƒÿï?ˆT|Ïÿï?Ü(ÅŠQþï?0šéìÞüï? júU.úï?êr1õï?" Þöëï?ÔnûÚï?^'4[¼ï?®VµZ„ï?ZdÂ#ï?&âïÿÿÿï?0ñáÿÿÿï?òÇÿÿÿï?6y—ÿÿÿï?N=ÿÿÿï?*¢”þÿÿï?.›Zýÿÿï?BSûÿÿï?|žÎöÿÿï?KÞîÿÿï?=ûàÿÿï?˜‡Äÿÿï?HQ7‘ÿÿï?÷k«1ÿÿï?Êþÿï?³4ýÿï?¸#—Ìúÿï?¼ÅiRöÿï?ÎaÄþíÿï?HµƒÞÿï?~좾Áÿï?ÚniMŒÿï?°Ži)ÿï?Øâqþï?B–Îýï?Ž.¤úï?ð¯Ï/öï?ôv’¯íï?:îk·KÞï?éB¦SÂï?q.ú;ï?¨>Æ¿8ï?ò´ðÿÿÿï?€‚ãÿÿÿï?XîÊÿÿÿï?F)ÿÿÿï?^ñGÿÿÿï?)M©þÿÿï?:‚ýÿÿï?\ûÿÿï?¨:^÷ÿÿï?8”ðïÿÿï?” âÿÿï?NqÈÿÿï?Rõ³˜ÿÿï?yŒÿ?ÿÿï?O(:›þÿï?JŽEiýÿï?<b1ûÿï?Ö8Ç÷ÿï?òùqïÿï?¸ÎLáÿï?ZÂzÇÿï?Œ@‹š–ÿï?ñÿé<ÿï?Âä4—þï?¶ajeýï?Î+õ 2ûï?¤]}&÷ï?n?¾-½ïï?±„«:âï?ÍÍÉï?ö&:=žï?ªø~†HRï?â¬ñÿÿÿï?äYåÿÿÿï?ØnÎÿÿÿï?¼Ò£ÿÿÿï?ÊžTÿÿÿï? oÁþÿÿï?"û¯ýÿÿï?x´ûÿÿï?Føÿÿï?u†.ñÿÿï?Že~äÿÿï?$¡õÌÿÿï?È7S¡ÿÿï?„™uPÿÿï?x㪺þÿï?hY¥ýÿï?â9¤ûÿï?fÇiï÷ÿï?²Á5ñÿï?b«9qäÿï? ÞüÍÿï?$ð!¢ÿï?ÚçŠSÿï?lª9Áþï?CØz¡¶ýï?>MźÍûï?„'8¤Pøï?œéX÷ñï?¾sØøwæï?<)€ÑÑï?jë´0­ï?Xúoù†mï?$Áòÿÿÿï?Bfçÿÿÿï?dRÒÿÿÿï?F5«ÿÿÿï?¿¥bÿÿÿï?hÜþÿÿï?ÖŸâýÿÿï?zXüÿÿï?~ ¼øÿÿï?l‘Šòÿÿï?ìnçÿÿï??áÑÿÿï?¾g°ªÿÿï?ÓHbÿÿï?>m›Üþÿï?œ2üåýÿï?ñZüÿï?ÂÕÚøÿï?lKÕòÿï?ÌybÅçÿï?DúvvÓÿï?DÛó:®ÿï?^!íjÿï?¸f‡íþï?”yi þï?F[õFmüï?ælˆ€ùï?r–•þ6ôï?âKŒ¸êï?öZû4ÍÙï?^'4[¼ï?Ò;¶{tˆï?rèóÿÿÿï?º•éÿÿÿï?xvÖÿÿÿï?0³ÿÿÿï?B…qÿÿÿï?ÆFøþÿÿï?þÿÿï?<¯yüÿÿï?t4|ùÿÿï?šÿöóÿÿï?à Çéÿÿï?|P×ÿÿï?¶qg´ÿÿï?¼è¶tÿÿï?žQ’ÿþÿï?¦ Q(þÿï?0]3üÿï?ì¢ÀÈùÿï?Ú´'šôÿï?XÕL ëÿï?@#.ÓÙÿï?,H~Jºÿï?˜í€ÿï?ˆT|Ïÿï?‚PP\þï?jBýï?Ž.¤úï?¦øª\öï?ð{»¼¾îï?­OKáï?ÍÍÉï? ÷ bq¡ï?¢õÿÿÿï?¬Öëÿÿÿï?0¹Úÿÿÿï?D»ÿÿÿï?Ú¿€ÿÿÿï?¤ÿÿÿï?D‚Nþÿÿï?ªšàüÿÿï?„È>úÿÿï?rÙfõÿÿï?¶ìÿÿï?Mº"Üÿÿï?ˆ­¾ÿÿï?"g ‡ÿÿï?ð7"ÿÿï?¬ÇÃiþÿï?Ø#Êýÿï?b¶²úÿï?¼ÅiRöÿï?Ì«^îÿï?Ø"mðßÿï?ö]ãÎÅÿï?Œ@‹š–ÿï?v‚ÏAÿï?Ü¿[Ó¨þï?f®|—ýï?Ê`¿]°ûï?„'8¤Pøï?Lìo½^òï?¨a^­úçï?Í~Öï?6’eg·ï?Löÿÿÿï?žîÿÿÿï?ûÞÿÿÿï?6#Ãÿÿÿï?6âÿÿÿï?r™1ÿÿÿï?TI„þÿÿï?bôEýÿÿï?‚Áýúÿÿï?|žÎöÿÿï?žš$ïÿÿï?,‘áÿÿï?x(}Çÿÿï?Rõ³˜ÿÿï?$EjCÿÿï?ÚA+¨þÿï?¼tŽýÿï?A1Žûÿï?fÇiï÷ÿï?o§Ûdñÿï?¾<šåÿï?ÎTÌfÐÿï?Þodªÿï?Œúwfÿï?¸f‡íþï?ä•)þï?4{ü¬œüï?@Õ¿¯úï?8“D}õï?ôv’¯íï?ð²ÃäSàï?ÍÍÉï?.x÷ÿÿÿï?úLðÿÿÿï?> ãÿÿÿï?XîÊÿÿÿï?Lˆžÿÿÿï?j Mÿÿÿï?äÿ·þÿÿï?Χýÿÿï?x´ûÿÿï? È$øÿÿï?€o¦ñÿÿï? íÑåÿÿï?âLÐÿÿï?XÀ2©ÿÿï?ÓHbÿÿï?©äáþÿï?Žháùýÿï?D }Wüÿï?zÕ¶fùÿï?ܾ³ôÿï?´Û²­êÿï?@#.ÓÙÿï?—XœÚ»ÿï?,W¦Á†ÿï?°Ži)ÿï?¦„þï?¶ajeýï?¸Yx sûï?cøï?Lìo½^òï?.JDzèï?襁¨”Øï?^—øÿÿÿï?†gòÿÿÿï?Øçÿÿÿï?dRÒÿÿÿï?É`¬ÿÿÿï?â gÿÿÿï?â‡èþÿÿï?ÁÞþÿÿï?LÝ]üÿÿï?wbùÿÿï?šÿöóÿÿï?†Î#êÿÿï?”PZØÿÿï?æ5¸ÿÿï?³8~ÿÿï?’šÖÿÿï?¤¡YZþÿï? ™h ýÿï?b¶²úÿï?ÜÇP„öÿï?ðå9ïÿï?pÞõáÿï?jBˆËÊÿï?$ð!¢ÿï? ³[ÿï?0‰D£ßþï?”yi þï?4{ü¬œüï? júU.úï?ð¯Ï/öï?å£fú?ïï?ôè=Päï?’¤ùÿÿÿï?¾^ôÿÿÿï?¾êÿÿÿï?h.Ùÿÿÿï?¨.¹ÿÿÿï?ñ~ÿÿÿï?¤ÿÿÿï?ÛTþÿÿï?F`øüÿÿï? ‡úÿÿï?LV öÿÿï?îÿÿï?¾0‹ßÿÿï?:<ˆÅÿÿï?‚Ùá–ÿÿï?$EjCÿÿï?Ò_t®þÿï?hY¥ýÿï? ÔõÎûÿï?¬Søÿï?lKÕòÿï?êà¸Èèÿï?Ћ{9×ÿï?¼_§°¸ÿï?ÖÐáàƒÿï?°Ži)ÿï?ðJ«Žþï?0ÛA‡ýï?>MźÍûï?V²(ïøï?r–•þ6ôï? ó±Žìï?œúÿÿÿï?Ø+öÿÿÿï?žîÿÿÿï?ækßÿÿÿï?4ÉÄÿÿÿï?怔ÿÿÿï?N=ÿÿÿï?ØŸþÿÿï?:‚ýÿÿï?ôf€ûÿÿï?Ô¾ä÷ÿÿï?Jûjñÿÿï? íÑåÿÿï?NrÑÿÿï?8'¬ÿÿï?&"zjÿÿï?ÊÞ öþÿï?¦ Q(þÿï?ˆ^þ½üÿï?TACBúÿï?@¹Wëõÿï?Ì«^îÿï?¸ÎLáÿï?jBˆËÊÿï?D!F¤ÿï?\¶tÅbÿï?¦Å4ôþï?òU;þï?jBýï?Чûï?HwØ¿Þ÷ï?6#+Ãòï?’{ûÿÿÿï?²Ê÷ÿÿÿï?$ñÿÿÿï?3þäÿÿÿï?«Ïÿÿÿï?p˜§ÿÿÿï?e`ÿÿÿï?œKàþÿÿï? =úýÿÿï?LÝ]üÿÿï?t4|ùÿÿï?R“Wôÿÿï?¦/ëÿÿï?ÎëÚÿÿï?ˆ­¾ÿÿï?Âä:‹ÿÿï?÷k«1ÿÿï?<à”þÿï?ŽØ‚ýÿï?â9¤ûÿï?è£nhøÿï?lKÕòÿï?¢:Féÿï?ÒYhúØÿï?‚í?a½ÿï?è UùŽÿï?v‚ÏAÿï?lª9Áþï?ðUDðýï?4{ü¬œüï?’,û ~úï?¤]}&÷ï?ôAüÿÿÿï?Œ9ùÿÿÿï?ð¿óÿÿÿï?Záéÿÿÿï?ÞØÿÿÿï?‚2¸ÿÿÿï?ñ~ÿÿÿï?vnÿÿÿï? Caþÿÿï?ªýÿÿï?hªÕúÿÿï?|žÎöÿÿï?º­ïÿÿï?^æãÿÿï?$¡õÌÿÿï?ãe"¦ÿÿï?ÓHbÿÿï?f›*ìþÿï?Λdþÿï?ˆ^þ½üÿï?ºÿ_úÿï?¼ÅiRöÿï?òùqïÿï?6¶•×ãÿï?ÎTÌfÐÿï?ÐôŸ°ÿï?Ö¢2Ízÿï?({Ì#ÿï?Âä4—þï?CØz¡¶ýï?fUŒTüï? júU.úï?êð?ñ ð?§ð?Éð?/.ð?wLð?~ð?ñÎð?"Rð?Ú%ð?£yð?Зð?±óð?À>ð?Û‡ð?¬h#ð?éF7ð?›°Uð?܃ð?ð?Ææð?¿›àð?­âPð?Ijð?n²p ð?EÍÀ ð?Ï×Òð?ökAð?;Î'ð?Xd7ð?nLð?žL*gð?Ÿ ð?¼ð?e!ð?R8ð?¦^ð?xžð?Fð?ê¶ð?ÒÕð?Óªð?‡¥ð?w ð?¦6ð?é˜ ð?eC4ð?_HSð?܃ð?p^Ïð?šÌCð?ÃÓõð?H¡ð?ð˜ð?.Ìòð?´ph ð?y·pð?Dº¬ð?€)ò ð?¨dV/ð?ðÜ8Cð?šßJ^ð?-)’‚ð?ób²ð?ð?xð?º.ð?:Oð?Þ…ð?cáð?zð?Šwð?§ð?=Ìð?#5 ð?ncð?%ð?Ú»0ð?!­Nð?‹B~ð?ð?ÃÓõð?Z¯ð?ºe¾ð?^‚Jð?˜/ ð? ÍÆð?H‰ð?I'%ð?”'n6ð?þ—ÛNð?°Jêpð?¤E³Ÿð?Ë4÷Þð?xà3ð?ð?ë%ð?Ö@ð?ƒnð?Á»ð?ß=ð?6ð?…ð?äð?YÑ ð? Jð?Xæð?È3,ð?AHð?.wuð?VÛ½ð?–ü0ð?Ææð?H¡ð?ºe¾ð?ɼhð?¸Àz ð?e½¢ð?¹Úð?§•(ð?TMy<ð?“÷ZYð?-)’‚ð? I“¼ð?]ø ð?8ÖËzð?G)ð?ð?å3ð?1Yð?Õ˜ð? ð?m¼ð?ùñð?múð?Ðað?Mð?xð?K'ð?q‡@ð?5jð?Îß­ð? ð?ÓÊð?¿›àð?ð˜ð?^‚Jð?¸Àz ð?î¢îð?‰|Çð?“̧*ð?~§ã@ð?ä½að?N²‘ð?&ËÖð?ŒÝû8ð?ÃŒyÂð?ÿÀüð?!tÙ€ð?¥(ð?gFð?yð?zÑð?»gð?Îgð?§ð?Dúð?¯Ñ ð?ñð?‚!ð?å8ð?†Z]ð?æ´šð? ÿð?·=¢ð?SÝ©ð?­âPð?.Ìòð?˜/ ð?e½¢ð?‰|Çð?J f+ð?ðÜ8Cð?žL*gð?¢rÊœð?A=×ëð?[ná^ð?=èð?‚l–íð?«;Ô2ð?¿T(ðð?a6ð?¦^ð?R¤ð?ð?)ëð?fMð?ªð?_° ð?}‚ð?÷ð?Yd/ð?tÍOð?,É…ð?‚=ßð?¸ªrð?;dð?ñ›íð?Ijð?´ph ð? ÍÆð?¹Úð?“̧*ð?ðÜ8Cð?Ò ið?º”ª¢ð?`Hùð?8ÖËzð?‚®ç8ð?pC¥Lð?Ì“ÌÖð?Bìxð?~M  ð?Hð?~ð?óÛð?Á~ð?E˜ð?‹}ð?X¿ð?S ð?ÎÖð?K'ð?r`Bð?pð?VÛ½ð?cü>ð?gð?Åvwð?Q©¼ð?n²p ð?y·pð?H‰ð?§•(ð?~§ã@ð?žL*gð?º”ª¢ð?B;þð?ƒdž‰ð?L Y[ð?…áþ’ð?ôè[ð?}›2ðð?|û«› ð? 7¾ð?¦^ð?R¦ð?—#ð?øýð?£yð?Ç ð?(} ð?V$ð?zGð?¿5ð?Q\ð?Cúœð?õ° ð?b(Ãð?ˆÄ÷ð?ÜTùð?!Kð?EÍÀ ð?Dº¬ð?I'%ð?TMy<ð?ä½að?¢rÊœð?`Hùð?ƒdž‰ð?QROgð?¤³t¸ð?8-î²ð?’çÇ¡ð?/(ë ð?Ô³ð?ïÒð?{ð?HÙð?Á~ð?¸ ð?‡›ð?íð?Mð?«rð?]e*ð?xIIð?‹B~ð?Þ¾Øð?¸ªrð?_Vwð? µ.ð?BŒð?¬™Ü ð?Ï×Òð?€)ò ð?”'n6ð?“÷ZYð?N²‘ð?A=×ëð?8ÖËzð?L Y[ð?¤³t¸ð?y6Ñð?Íߢ ð?oÇ ð?6—‘×ð?ë ð?¸ç{Ý-ð?xžð?ð?Zñð?[nð?Ç ð?ô  ð?h£ð?é˜ ð?ÏÙ8ð?ÊÚbð?lY«ð?o(ð?шýð?Ö¾ið?Y6Ôð?Óké ð? ÍÆð?ökAð?¨dV/ð?þ—ÛNð?-)’‚ð?&ËÖð?[ná^ð?‚®ç8ð?…áþ’ð?8-î²ð?Íߢ ð?fˆAð?¸CÈð?Åb¥O!ð?K<@O2ð? ­è÷Jð?öÉð?»gð?ð?Ùnð?ƒÙð?„Þ ð?«rð?Iý*ð?0eKð?܃ð?èïåð?«²ð?öv´ð?¦c«ð?èµð?EÍÀ ð?ûÆsð?;Î'ð?ðÜ8Cð?°Jêpð? I“¼ð?ŒÝû8ð?=èð?pC¥Lð?ôè[ð?’çÇ¡ð?oÇ ð?¸CÈð?Ùcú"ð?~óg³4ð?h29„Pð?­s!eyð?ºþð?ªÇð?·-ð?ªð?ª ð?æð?[¶ð?å8ð?ÊÚbð?Îß­ð?–ü0ð?gð?Âú¡ð?>Pð?Äî ð?~iÚð?ž c ð?Xd7ð?šßJ^ð?¤E³Ÿð?]ø ð?ÃŒyÂð?‚l–íð?Ì“ÌÖð?}›2ðð?/(ë ð?6—‘×ð?Åb¥O!ð?~óg³4ð?êvRð?;4Ê}ð?­¡Âð?ß=ð?ü:ð? ð?)ð?AÍ ð?ÎÖð?|ª(ð?AHð?j€ð?"âð?«²ð?z<¿ð?[¸Ñð?µ²mð?×6±ð?—/…ð?Eð(,ð?nLð?-)’‚ð?Ë4÷Þð?8ÖËzð?ÿÀüð?«;Ô2ð?Bìxð?|û«› ð?Ô³ð?ë ð?K<@O2ð?h29„Pð?;4Ê}ð?ù÷ˆÇð?NXÝX4ð?cˆð?¨Ãð?múð?±óð?eð?PÎð?i‰3ð?Q\ð?¤ð?ÏŸ#ð?a]ð?À““ð?>Pð?˜/ ð?e•~ð?â3"ð?Syk;ð?žL*gð?ób²ð?xà3ð?G)ð?!tÙ€ð?¿T(ðð?~M  ð? 7¾ð?ïÒð?¸ç{Ý-ð? ­è÷Jð?­s!eyð?­¡Âð?NXÝX4ð?Ów|«âð?ßð?:cð? ð?S ð?ñð?¿æ#ð?q‡@ð?ÅÈsð?p^Ïð?¸ªrð?Ì*•ð?ð˜ð?#)ð?ÞŒsð?—/…ð?Íî,ð?þ—ÛNð?ò¶ê‰ð?2ÀMðð?0û¡ð?ÜþtÐð?Ì“ÌÖð?H¿Gð?fˆAð?@<½Ìð?Óö'ð?eê{šBð?"÷·nð?q_ãm´ð? .Ä$ð?æÒ¹ïÕð?¨ÝŒ\éð?7Bð?§ð?îrð?ç€ ð?«rð?È3,ð?tÍOð?2Úð?záð?ZÑð?ÇåAð?Y6Ôð?´ph ð?®rŠð?€)ò ð?tŽb:ð?žL*gð?ò—·µð?‘,ý>ð?òZã-ð?›”ÉËð?Á2]•ð?£ôý\ ð?žã‚ð?Åb¥O!ð?Y„8ð?ÖöN:_ð?éÏ>Ÿð?téâð?îŒp×±ð?—OmsÁð?Q ûmð?ö±ð?êð?±óð? Jð?f›ð?¿5ð?Ùrað?p°ð?cü>ð?†Ì?ð?—  ð?^‚Jð?;  ð?ûÆsð?mdì)ð?JðÂJð?ìù„ð?A=×ëð?0û¡ð?.ãÞÞð?ܹU ð?Nõ®Ðð?'²§Yð?&hšð?¸ç{Ý-ð?­ïÇžNð?Üýé…ð?têö~âð?T!|ð?¢ð Rxð?ÇP¸¨ð?Â(¡ð?·-ð?¡Ðð?ô  ð?Ìhð?¬h#ð?q‡@ð?.wuð?t’Õð?Ýσð?z<¿ð?ÜTùð?ñýð?±g:ð?â;ð?ì4ð?šßJ^ð? ×Ũð?÷”S-ð?A\…ð?¤³t¸ð?Á2]•ð?|û«› ð?Æ4\cð?BÅû§#ð?ßÓ>ð?Âÿxkð?çf¹ð?Ê„w<ð?»ið?øœ†3‰ð?Ûä­æð?ÜD쪾 ð?Q´ð?=Ìð?w ð?ÎÖð?œÏ)ð?yLð?¼‹ð? ÿð?ZÑð?E÷Nð?5€ð?Äî ð?Ï×Òð?^|å#ð?~§ã@ð?¶uð?:ÓÒð?8ÖËzð?\•ø¦ð?ËÙ½ð?5„çsð? +€ð?&hšð?曑ï.ð?êvRð?C,q3ð?½@ŸÚúð?îŒp×±ð?¨ÝŒ\éð?ˆLúñöð??@\gdð?ó¨™ ð?éCð?ƒÙð?áoð?Ôˆð?Ú»0ð?ËoYð?¤ð?™v,ð?Dõ%ð?ñ›íð?CÈ,ð?;  ð?³õÙð?J f+ð?þ—ÛNð?w° ð?\ð?æ®AÔð?pC¥Lð?¿T(ðð?—¬-© ð?Ô³ð?Ùcú"ð?Ї <ð?Âÿxkð?Kö¹½ð?nðeMð?šç$ÎFð?þYr³ôð?¥qž‰Óð?­I¯ ð?ß¶8Îð?òÙð?±óð?}‚ð?enð?å8ð?G3gð?VÛ½ð?Ï]ð??ð?ð˜ð?µ²mð?y·pð?ökAð?þ¦3ð?šßJ^ð?Jfê«ð?ŒÝû8ð?‚®ç8ð?w Lð?¢•Mð?{Öì2 ð?@<½Ìð?öû:Î*ð?WsÅLð?Ÿ@æ@‰ð?`ƒƒôð?îŒp×±ð?1?Z7þð?¡•ûAð?”Åhw- ð?7ºÉåð?-œLGð?/sð?ª ð?h£ð?Þq"ð? ?ð?.wuð?Þ¾Øð?«²ð?¿›àð?I“Lð?+À ð?î¢îð?€)ò ð?TMy<ð?þ änð?=&Ëð?Ë›sð?\•ø¦ð?Ì“ÌÖð?Nõ®Ðð?;~Ùð?:Ãð?~óg³4ð?ÖöN:_ð?Ë‚«ð?NXÝX4ð? ³(ð?ÙCYšØð?¥qž‰Óð?Àд ð?Ëê%ð?•HzbŸ$ð?Ç ð?#5 ð?ÄÄð?èx&ð?_=Gð?܃ð?Àöóð?b(Ãð?ÇåAð?5€ð?˜/ ð?Ü×ð?~GÌ%ð?ÑŒ¤Eð?4Û6€ð?A=×ëð?Df±ð?I ð?8-î²ð?6dào ð?Ô³ð?òÉ Û"ð?\Ð5Š?ð?ª…›sð?¬˜âÑð?T!|ð?б¨[®ð?’w„Óð?ÊK¥ð?n_½!ið?-œLGð?„KʤÔ/ð?nŸð?ßL ð?ÎÖð?]e*ð?!­Nð?Lõ‘ð?°ð?ÃÓõð?Âú¡ð?M·ºð?”Èu ð?š`ð?“̧*ð?þ—ÛNð?N²‘ð?]ø ð?¡ÃRðð?…áþ’ð?Á2]•ð?MïW ð?MãDð?ŽŒîâ(ð? ­è÷Jð?Ÿ@æ@‰ð?½@ŸÚúð?(¾œÉð?V'Ùœ@ð?Ûä­æð?ý@$Ѫ ð?‡[SM0ð?n©r¬H"ð?Y³³\¨<ð?)ð?S ð?”Èð?¢.ð?›°Uð?{HŸð?o(ð?Dõ%ð?Þ|ýð?ɼhð?EÍÀ ð?—/…ð?¨dV/ð?5ÅWð?º”ª¢ð?÷”S-ð?òZã-ð?w Lð?ǘètð?oÇ ð?s*qð?曑ï.ð?4,Ž€Vð?éÏ>Ÿð? .Ä$ð?»ið?ÙCYšØð? ¦†ð?fP!;Î ð?MoBÃ8ð?)vãÓ)ð?%O²Ö‘Jð?‡¥ð?À>ð?Ôˆð?]k1ð?Q\ð?lY«ð?cü>ð?|¹Qð?­âPð?èµð?Dóïð?‰|Çð?þ¦3ð?<`ð?ób²ð?ªS]Kð?QROgð? ¢vð?H¿Gð?'²§Yð?Ô5usð?~óg³4ð?À¿Rað?q_ãm´ð?nðeMð?‹@hUgð?Q ûmð?>OêŒ%ð?ò9aðð?-œLGð?jn…x1ð?Íèy½Xð?íð?hð?÷ð?eC4ð?Ùrað?뮵ð?i²Rð?_Vwð?ð˜ð?|Úð?qöð?ë}¼ð?Xd7ð?žL*gð?Àð?-¦eð?VÚ´™ð?Ì“ÌÖð?Íߢ ð? 7¾ð?ë ð?GsÚ9ð?Âÿxkð?ù÷ˆÇð?}h:rð?б¨[®ð?ˆLúñöð?”Åhw- ð?^eööëð?ÿ¡¢ð?½zWä§8ð?sôúBfð?Ðað?_¥ð?!4ð?Ï6ð?ìºeð?VÛ½ð?ÁNbð?Ì*•ð?[¸Ñð?ñýð? ÍÆð?jWLð?tŽb:ð?ôçlð?=&Ëð?8ÖËzð?¢WÂð?¾±ñ$ð?. — ð?¡Ýùßð?Åb¥O!ð?ßÓ>ð?ª…›sð?Ù;íE×ð?—é¹°ð?¨ÝŒ\éð?žß'Dið?eûUÚ ð?V·¿Ê—ð?n©r¬H"ð?瑟/Å>ð?¢unÀƒqð?úšð?eð?%ð?å8ð?F±hð?Y„Ãð?Ü mð?SÝ©ð?ÜTùð?BÌI ð?&Xð?ž c ð?TMy<ð?°Jêpð?:ÓÒð?ƒdž‰ð?.ãÞÞð?ôè[ð?~M  ð?†í–¬ð?òÉ Û"ð?É t Að?­s!eyð?têö~âð?‚0'z¦ð?>J7²ð?[­]’»ð?ý@$Ѫ ð?ß¶8Îð?•HzbŸ$ð?P¡€»;Cð?’H€Ùyð?&¸ð? Jð?enð?ÏÙ8ð?5jð?—iÆð?¸ªrð?öv´ð?•¡ ð?n²p ð?e½¢ð?€)ò ð?Ó"Œ=ð?Érúrð?&ËÖð?‰ÉA‘ð?‚l–íð?Kxð?ts×7 ð?Ô³ð?BÅû§#ð?eê{šBð?×ôMg|ð?˜íèVèð?îŒp×±ð?ŠìFÒ)ð?Ûä­æð?%ÝuÆþ ð?ËFøGqð?›úçýÚ%ð?{ª¢—Eð?lñÐÝ@~ð?&¸ð? Jð?enð?ÏÙ8ð?5jð?—iÆð?¸ªrð?öv´ð?•¡ ð?n²p ð?e½¢ð?€)ò ð?Ó"Œ=ð?Érúrð?&ËÖð?‰ÉA‘ð?‚l–íð?Kxð?ts×7 ð?Ô³ð?BÅû§#ð?eê{šBð?×ôMg|ð?˜íèVèð?îŒp×±ð?ŠìFÒ)ð?Ûä­æð?%ÝuÆþ ð?ËFøGqð?›úçýÚ%ð?{ª¢—Eð?lñÐÝ@~ð?úšð?eð?%ð?å8ð?F±hð?Y„Ãð?Ü mð?SÝ©ð?ÜTùð?BÌI ð?&Xð?ž c ð?TMy<ð?°Jêpð?:ÓÒð?ƒdž‰ð?.ãÞÞð?ôè[ð?~M  ð?†í–¬ð?òÉ Û"ð?É t Að?­s!eyð?têö~âð?‚0'z¦ð?>J7²ð?[­]’»ð?ý@$Ѫ ð?ß¶8Îð?•HzbŸ$ð?P¡€»;Cð?’H€Ùyð?Ðað?_¥ð?!4ð?Ï6ð?ìºeð?VÛ½ð?ÁNbð?Ì*•ð?[¸Ñð?ñýð? ÍÆð?jWLð?tŽb:ð?ôçlð?=&Ëð?8ÖËzð?¢WÂð?¾±ñ$ð?. — ð?¡Ýùßð?Åb¥O!ð?ßÓ>ð?ª…›sð?Ù;íE×ð?—é¹°ð?¨ÝŒ\éð?žß'Dið?eûUÚ ð?V·¿Ê—ð?n©r¬H"ð?瑟/Å>ð?¢unÀƒqð?íð?hð?÷ð?eC4ð?Ùrað?뮵ð?i²Rð?_Vwð?ð˜ð?|Úð?qöð?ë}¼ð?Xd7ð?žL*gð?Àð?-¦eð?VÚ´™ð?Ì“ÌÖð?Íߢ ð? 7¾ð?ë ð?GsÚ9ð?Âÿxkð?ù÷ˆÇð?}h:rð?б¨[®ð?ˆLúñöð?”Åhw- ð?^eööëð?ÿ¡¢ð?½zWä§8ð?sôúBfð?‡¥ð?À>ð?Ôˆð?]k1ð?Q\ð?lY«ð?cü>ð?|¹Qð?­âPð?èµð?Dóïð?‰|Çð?þ¦3ð?<`ð?ób²ð?ªS]Kð?QROgð? ¢vð?H¿Gð?'²§Yð?Ô5usð?~óg³4ð?À¿Rað?q_ãm´ð?nðeMð?‹@hUgð?Q ûmð?>OêŒ%ð?ò9aðð?-œLGð?jn…x1ð?Íèy½Xð?)ð?S ð?”Èð?¢.ð?›°Uð?{HŸð?o(ð?Dõ%ð?Þ|ýð?ɼhð?EÍÀ ð?—/…ð?¨dV/ð?5ÅWð?º”ª¢ð?÷”S-ð?òZã-ð?w Lð?ǘètð?oÇ ð?s*qð?曑ï.ð?4,Ž€Vð?éÏ>Ÿð? .Ä$ð?»ið?ÙCYšØð? ¦†ð?fP!;Î ð?MoBÃ8ð?)vãÓ)ð?%O²Ö‘Jð?nŸð?ßL ð?ÎÖð?]e*ð?!­Nð?Lõ‘ð?°ð?ÃÓõð?Âú¡ð?M·ºð?”Èu ð?š`ð?“̧*ð?þ—ÛNð?N²‘ð?]ø ð?¡ÃRðð?…áþ’ð?Á2]•ð?MïW ð?MãDð?ŽŒîâ(ð? ­è÷Jð?Ÿ@æ@‰ð?½@ŸÚúð?(¾œÉð?V'Ùœ@ð?Ûä­æð?ý@$Ѫ ð?‡[SM0ð?n©r¬H"ð?Y³³\¨<ð?Ç ð?#5 ð?ÄÄð?èx&ð?_=Gð?܃ð?Àöóð?b(Ãð?ÇåAð?5€ð?˜/ ð?Ü×ð?~GÌ%ð?ÑŒ¤Eð?4Û6€ð?A=×ëð?Df±ð?I ð?8-î²ð?6dào ð?Ô³ð?òÉ Û"ð?\Ð5Š?ð?ª…›sð?¬˜âÑð?T!|ð?б¨[®ð?’w„Óð?ÊK¥ð?n_½!ið?-œLGð?„KʤÔ/ð?/sð?ª ð?h£ð?Þq"ð? ?ð?.wuð?Þ¾Øð?«²ð?¿›àð?I“Lð?+À ð?î¢îð?€)ò ð?TMy<ð?þ änð?=&Ëð?Ë›sð?\•ø¦ð?Ì“ÌÖð?Nõ®Ðð?;~Ùð?:Ãð?~óg³4ð?ÖöN:_ð?Ë‚«ð?NXÝX4ð? ³(ð?ÙCYšØð?¥qž‰Óð?Àд ð?Ëê%ð?•HzbŸ$ð?òÙð?±óð?}‚ð?enð?å8ð?G3gð?VÛ½ð?Ï]ð??ð?ð˜ð?µ²mð?y·pð?ökAð?þ¦3ð?šßJ^ð?Jfê«ð?ŒÝû8ð?‚®ç8ð?w Lð?¢•Mð?{Öì2 ð?@<½Ìð?öû:Î*ð?WsÅLð?Ÿ@æ@‰ð?`ƒƒôð?îŒp×±ð?1?Z7þð?¡•ûAð?”Åhw- ð?7ºÉåð?-œLGð?éCð?ƒÙð?áoð?Ôˆð?Ú»0ð?ËoYð?¤ð?™v,ð?Dõ%ð?ñ›íð?CÈ,ð?;  ð?³õÙð?J f+ð?þ—ÛNð?w° ð?\ð?æ®AÔð?pC¥Lð?¿T(ðð?—¬-© ð?Ô³ð?Ùcú"ð?Ї <ð?Âÿxkð?Kö¹½ð?nðeMð?šç$ÎFð?þYr³ôð?¥qž‰Óð?­I¯ ð?ß¶8Îð?Q´ð?=Ìð?w ð?ÎÖð?œÏ)ð?yLð?¼‹ð? ÿð?ZÑð?E÷Nð?5€ð?Äî ð?Ï×Òð?^|å#ð?~§ã@ð?¶uð?:ÓÒð?8ÖËzð?\•ø¦ð?ËÙ½ð?5„çsð? +€ð?&hšð?曑ï.ð?êvRð?C,q3ð?½@ŸÚúð?îŒp×±ð?¨ÝŒ\éð?ˆLúñöð??@\gdð?ó¨™ ð?·-ð?¡Ðð?ô  ð?Ìhð?¬h#ð?q‡@ð?.wuð?t’Õð?Ýσð?z<¿ð?ÜTùð?ñýð?±g:ð?â;ð?ì4ð?šßJ^ð? ×Ũð?÷”S-ð?A\…ð?¤³t¸ð?Á2]•ð?|û«› ð?Æ4\cð?BÅû§#ð?ßÓ>ð?Âÿxkð?çf¹ð?Ê„w<ð?»ið?øœ†3‰ð?Ûä­æð?ÜD쪾 ð?ö±ð?êð?±óð? Jð?f›ð?¿5ð?Ùrað?p°ð?cü>ð?†Ì?ð?—  ð?^‚Jð?;  ð?ûÆsð?mdì)ð?JðÂJð?ìù„ð?A=×ëð?0û¡ð?.ãÞÞð?ܹU ð?Nõ®Ðð?'²§Yð?&hšð?¸ç{Ý-ð?­ïÇžNð?Üýé…ð?têö~âð?T!|ð?¢ð Rxð?ÇP¸¨ð?Â(¡ð?7Bð?§ð?îrð?ç€ ð?«rð?È3,ð?tÍOð?2Úð?záð?ZÑð?ÇåAð?Y6Ôð?´ph ð?®rŠð?€)ò ð?tŽb:ð?žL*gð?ò—·µð?‘,ý>ð?òZã-ð?›”ÉËð?Á2]•ð?£ôý\ ð?žã‚ð?Åb¥O!ð?Y„8ð?ÖöN:_ð?éÏ>Ÿð?téâð?îŒp×±ð?—OmsÁð?Q ûmð?ßð?:cð? ð?S ð?ñð?¿æ#ð?q‡@ð?ÅÈsð?p^Ïð?¸ªrð?Ì*•ð?ð˜ð?#)ð?ÞŒsð?—/…ð?Íî,ð?þ—ÛNð?ò¶ê‰ð?2ÀMðð?0û¡ð?ÜþtÐð?Ì“ÌÖð?H¿Gð?fˆAð?@<½Ìð?Óö'ð?eê{šBð?"÷·nð?q_ãm´ð? .Ä$ð?æÒ¹ïÕð?¨ÝŒ\éð?ìQ¸…ë¹=)\Âõ¨Ã=)\ÂõhÐ=¤p= ×cÛ=¤p= ×Ãæ=Âõ(\Òò=Q¸…ëÿ=®Gázn >Âõ(\Ã>®GázÞ >…ëQ¸E+>q= ×£í5>…ëQ¸‰A>¤p= WâK>Âõ( V>Âõ(\¯Ma>Âõ(œþj>4333ét>\Âõ8€>4333û‰ˆ>¹…ë9“’> â›> …ëQ0¿¤>ìQ¸W–®>†ëQ¸„T¶>Âõ(7#À>Ç>Ãõ(\öQÐ>š™™YßÐÖ>(\Bbƒß>Âõhb}å>Ö£p]oÿè>ö(\ÂuÂ=Ãõ(\ÂË=¤p= ×c×=®Gáz”ã=)\ÂõXð=ö(\Â5û=)\Âõˆ>43333—>¸…ëQˆ>†ëQ¸õ(>Ház®L4>âz®Gm@>[Âõ(qJ>)\Âu)U>3333óÕ`>®GázŸj>4333ét>…ëQ¸ÎO€>®Gá*D‰>Ház®k“>q= ×Sž>£p= ße¦>…ëQ¸;ʰ>\Âõ$ñ¸>¤p= 'YÂ>ÍÌÌLJ¹Ê>š™™Y’AÓ>< ×c°qÛ>®G²Tã>Ø£p]-çê>ÍÌÌ ö{ò> …둱–ý>®Gáz”É={®GázÓ={®Gázà=Ház®Çë=Ãõ(\R÷=q= ×£€>¸…ëQ@>ìQ¸…÷>{®GáF&>)\ÂõQ2> ×£p=ý=>Âõ(\lH>Âõ(\ÏÈS>ÌÌÌÌÌà_>3333“ˆi>ö(\ÂSt>\Âõ8€>®Gá*D‰>Âõ(¶“>p= ×φž>Âõ(\t§>= ף߱>®Gá»>Ö£p½$6Ä>¹…ë~øÍ>{®¥ÿÕ> ×£0gôß>€Ìóæ>]ÂE Kð>z®Ûö>GázÔï§ÿ>hl÷?)\ÂõèÑ=¤p= ×#Û=p= ×£ç=¸…ëQˆó=…ëQ¸~>ö(\½ >z®Gá>>®Gázf#>= ×£p0>\Âõ(®:>¤p= WùE>ìQ¸…R>Âõ(\_]>ìQ¸EÒg>ÍÌÌÌ 6s>`Í~>4333û‰ˆ>Ház®k“>p= ×φž>·…ëѧ>¹…ëZp²>5333ÐQ¼> ×£päÅ>ázîEÐ>š™™ RØ>2333-ÿá>HázT![ê>®Gá )ó>z®'Sû>> ×3RR?\ÂÝú ?®GÙ< ?ìQ¸…kØ=\Âõ(¼â=q= ×£ð=¤p= ×Cû=š™™™™!>…ëQ¸‘>ÍÌÌÌÌ| > ×£p=®+>¸…ëQ$7>DC>†ëQ¸ïO>ÿÿÿÿWZ>®GáŸe>¸…ë‘§q>= ×£0¬|> ×£p&‡>¹…ë9“’>q= ×Sž>Âõ(\t§>¹…ëZp²>gfff&Ƽ>‘Âõ(±EÆ>®Gáú?Ñ>Ø£p=LÚ>­GáZΙã>= ×£j@í>…ëQÈ¢™õ>ÎÌÌ<óŒÿ>ÂõXÄÆ?q= >?ö(\Ÿ²Þ?…ëQôkZ? ×£p=Êà=Ház®§é=ö(\Âö=âz®GÙ>®Gáz>\>™™™™™/'>Âõ(\“3>w@>•K>q= ×ãW>¸…ëc>ëQ¸%o>> ×£°ñy>Âõ(ì6…>4333ë?‘> â›>£p= ße¦>= ף߱>5333ÐQ¼>‘Âõ(±EÆ>ìQ¸žaÑ>ÍÌÌÌæÚ>·…kR¢ä>¹…‹b]ï>…ëQùš÷>333«•?ÌÌÌ,4è ?¥p=RøÝ?)\ú‘%?Ø£pC¯G#?gff)û0?Âõ(\æ=×£p= gñ= ×£p= þ=¸…ëQØ >¤p= ×+>ìQ¸…õ"> ×£p=(0>Âõ(\q;>ÍÌÌÌÌ7G>gfff&‘S>Âõ(\ïk`>R¸…‹qk>hffffÓv>€ä‚>\Âõ>…ëQ¸êz™> …ëQ0¿¤>…ëQ¸;ʰ>®Gá»> ×£päÅ>®Gáú?Ñ>ÍÌÌÌæÚ>ìQ¸^°ýä>= ×Ó=ð> ×£Ÿæø>¹…‹ùç? ×£¸”j ? ×£˜Ü?*\v` ?¤p=˜†Š&?? ×éÑ'0?†ëQøÌÓ4?ìQ¸…kî=)\Âõh÷=¤p= ×K>fffffŽ>¤p= ×G>gffff*>Ház®O6>= ×£pC> ×£pý7P>Âõ(Ü€[>š™™™9:g>ìQ¸µˆs>Âõ(ìZ€>{®GIB‹>š™™™yš–>R¸…¥¢>ìQ¸W–®>\Âõ$ñ¸>Ö£p½$6Ä>ázîEÐ>Ø£p=LÚ>·…kR¢ä>= ×Ó=ð>·…+YYù>®GÁN›?Ö£pµë ?Ø£pÙñÈ?¹…ëˆ!?ÍÌÌ– ])?©˜–2?o= ¨ïå:?{®Ë G?š™™™™ô=­Gáz.ÿ=¯Gáz. >®Gáz >33333{$>fffff´1>¤p= ׃>>)\Âu6J>z®GápV>š™™™™$c>…ëQ˜Dp>…ëQè‰{>\ÂõÐ5‡>…ëQhy“>\ÂõC > ×£p‹«>†ëQ¸„T¶>¤p= 'YÂ>¹…ë~øÍ>š™™ RØ>­GáZΙã>¹…‹b]ï> ×£Ÿæø>®GÁN›?„ëQH,›?IázPtª?ÿÿÿ§5"?®G)èr+?×£pY'4? …ë.n>?ÍÌÌäâ;F?43³ ûM?Âõ(\ú=\Âõ(”>= ×£p>R¸…ë}>Âõ(\p+>š™™™™Ø7>p= ×£©D>{®G¡ÙQ>¸…ëѽ^>®Gáºaj>v>Âõ(d7ƒ>…ëQ”M>¯GázP‹›>†ëQ¸Š)§>p= × b³>Âõ(7#À>ÍÌÌLJ¹Ê>{®¥ÿÕ>2333-ÿá>= ×£j@í>…ëQùš÷>¹…‹ùç?Ö£pµë ?IázPtª?¤p=>y"? ×£ åŽ,?¸…Ó‹Ø5?{®g³†@?¤p½üPµH?(\„à> ×£på >×£p= «>áz®GÇ$>Ház®22>¸…ëQË?>)\Âõ²K>…ëQøX>×d> ×£p­ýq>…ëQ¸õ~>š™™™Á‰Š>4333Ÿ©–>¤p= 3F£>{®GKR°>{®Gƃ»>Ç>š™™Y’AÓ> ×£0gôß>HázT![ê>…ëQÈ¢™õ>333«•? ×£¸”j ?Ø£pÙñÈ?ÿÿÿ§5"? ×£ åŽ,?ìQ¸$K6?? ×YË9A?€\ŽTJ?¸ÅW‰ãS?×£°´Ù«]?ÍÌLí&e?¤p= ×K>Ãõ(\f>Ä>¸…ëQ$+>…ëQ¸ã7>R¸…ëùD>@_R>¹…ë1 `>€ôk>€Fx>¸…ë1…>R¸…S ’>ÍÌÌÌè(Ÿ>Ö£p=è­ª>×£p=Ù¿¶>{®ÇEPÃ>Ãõ(\öQÐ>< ×c°qÛ>€Ìóæ>®Gá )ó>ÎÌÌ<óŒÿ>ÌÌÌ,4è ? ×£˜Ü?¹…ëˆ!?®G)èr+?¸…Ó‹Ø5?? ×YË9A?š™™:AåJ?®ìÇÅT?ãzÔô¸_?efæ‡ ëg?ÌÌŒnDµu?h >†ëQ¸I>q= ×£Ê#>š™™™™Š1>ö(\Â?>ö(\BbK>z®GáX>Ãõ(\/,e>R¸…[‹r>= ×£P2€>43335Œ>= ×£Ì{˜>¯Gázì-¥>ÍÌÌÌ6A²>¨X¿>¹…ëaÍÊ>š™™YßÐÖ>®G²Tã>]ÂE Kð>z®'Sû>ÂõXÄÆ?¥p=RøÝ?*\v` ?ÍÌÌ– ])?×£pY'4?{®g³†@?€\ŽTJ?®ìÇÅT?…ëZ–7`?·…¢a i?­GqFzs?…ÛË­¿|?š™™™™ù>= ×£p=>âz®G1)>™™™™™n6> ×£p=ïC>)\µ­Q>¤p= —I_>Ø£p=*Ÿk>®GáJSx>ö(\º]…>R¸…ç¶’> ×£p×W >Âõ(6t¬> ×£pޝ¸> ×£ðÎVÅ>|®Çî_Ò>(\Bbƒß>Ø£p]-çê>z®Ûö>> ×3RR?q= >?)\ú‘%?¤p=˜†Š&?©˜–2? …ë.n>?¤p½üPµH?¸ÅW‰ãS?ãzÔô¸_?·…¢a i?\bë‹s?›™).ä&~?×£˜·\Âõ(´!>Âõ(\¸/>…ëQ¸^<>TI>ÍÌÌÌÌ‘V>)\Âd>> ×£pÏq>R¸…{‰>ÌÌÌ̜ڋ>š™™™•‰˜>HázfŽ¥>> ×£«á²>R¸…•|À>533³³±Ì>Áõ(\WáØ>Âõhb}å>ÍÌÌ ö{ò>GázÔï§ÿ>\ÂÝú ?ö(\Ÿ²Þ?Ø£pC¯G#?? ×éÑ'0?o= ¨ïå:?ÍÌÌäâ;F?(\„àGáz®ó%>Ház®¿3>…ëQ¸½A>…ëQ¸žÐO>ffff&{\>¤p= si>âz®7²v> ×£pÍ2„>3333‡ï‘>HázöÆŸ>õ(\:¬>Âõ(x¾¸>áz®ê½Å>×£p=g Ó>…ëQ8M à>…ë1úìì>433³œù>R¸Í ¡?âz" ”?fffêÎÄ?ÏÌÌ@+?®GçKØ6?®GÏÏ2C?gf&ͶP? ×ã}ÉZ?ÍÌlgFÖe?p=ê‹ Ìq?†ëÁÃ=¼|?GájŠñô†?…[!’?{Nì9˜¡? ×£p=ú >q= ×£ê*>Ház®O8>×£p=ŠíE>]Âõ¨¿S>¹…ëÂa>< ×£âo>†ëQ¸’|>> ף؉>¯GázHÏ–>¯GázêP¤>…ëQ¢ ²>ö(\¶À>{®GŒKÌ>áz®ŒñØ>effFðëå>(\BÉ3ó>> ×c®Â?R¸Åa% ?Âõ¦<?®G©þÀ%?™™™ß©2?®Guå×??€µyK?q= gºÅV?HáÚšµc?= W<ê®o?ìQølÔz?Âõ@V·Q…?®¬;‘?ff »Œ›?gfÆzUÚ§?fffff†$>áz®GP0>¯Gáz•=>×£p=ŠÉJ>×£p=Š9X>`àe>q= ×ã¹s>ëQ¸=Â>3333«ë>¼¢œ>= ×£„£©>Âõ(Tè¶>Ház”ãkÄ>]Â5P)Ò>= ×cà>®Gøì>[ÂuR"ù>¤p=Z?®GáÂeZ?âzÒKã ?Ãõ( ÿY-?ÍÌÌ@id9?33³;ÜE?¥p=Bª·R? ×#•ÍÝ_?‘Âu¢¨ój?×£ r2¢v?…Ë®³Û‚?ö(d~·&?¤Ä]z™?âz42ð›¤?ÁõßA7º´?õ(\‰(>®Gáz‹3>> ×£ðÈA>)\Âu*P> ×£p}Z]>âz®Çj>…ëQ(x>¸…ëaË…>ÍÌÌÌ€­“>Ãõ(\Û¼¡>¸…ëì¯>ìQ¸Ù«¼>¸…ë"³É>¤p=Š‹üÖ> ×£ƒä>÷(\ÿBò>ÍÌÌì5?›™™áº° ?S¸)P?ö(\ƒ‰A&?…ëù ~3?ázÒ~A?[B*T‰M?gfæ†Y?š™y?Þïe?Há*nϽr? ׃ðmÏ?ÃõhQËËŠ?ÔPb–?R¸Jâ|…¢?Âõ¼GKQ®?…무_¼?áz®G÷,>ìQ¸…#7>Gáz® E>…ëQ¸ÞES>3333a>(\Â5ùo>\Âõø}>ìQ¸½eŠ>)\Â1ð—>‘Âõ(T­¥>®Gái™³>ÍÌÌLþ°Á>‘Âõ¨·áÏ>Ãõ(ܬÜ>q= w‚»é>…ëaí ÷>âz¶‘•?®G%W?…ë‡;K ? ×£¶ÅÜ,?¸… ÷y9?…ë2ˆgF?hf&amŸS?R¸>‡a?HẠ>°m?£p8 y?33û5÷…?)\óy´’?? cÉ™Ÿ?š™“d›qª?q=¨'œãµ? ×N­ºÌÆ?Âõ(\ê0>33333;>Ãõ(\ÊH>{®Gá°V>Âõ(\ï¿d>…ëQèôr>ÍÌÌÌM>·…ë‹>¹…뉹œ>¯GázÀª>q= ׺·>4333Ë„Å>q= WZ|Ó>Q¸e…á>q= ×Êï>®GÑ©¡ü>]Â-&» ?ÂõL2?£p=ÒT¢$?ëQ¸&gg2? ×£N]@?q=ŠÞsM?Ãõ¨Þ(žY?¤p}-ˆf?™™¹0^ºs?¥pµò°/?ëQ¸ˆßÅ?×£T`’ž™?ö(dÖLà¥?ëQ¼(I‚²?¥p\õVø¾? WÞHLÏ? ×£p=|3>¸…ëQD?>¹…ëQºL>ÍÌÌÌL`Z>¤p= ×2h>q= ×Ã.v>Âõ($Q„>GázB—’>®Gáþ >gfffl ¯>ffffO¼>š™™ÉÉÉ>> ×#üu×> ×£På>¤p=šÇTó>Âõè?(\ +¤?áz&wŠ?{®7"°)?8¥7?†ëÑ7˧D?{qR?…kižj`?…ë\}m?„ë ²¸y?Âý€Ï†?33OØÈ“?ffX[ã1¡?„ëqn¦«­?¹°Yü\¹?BÈû,mÅ?)œ´â5×? ×£p=66> ×£p=ÖA>gfff&oP>¤p= ×C^> Ùk>…ëQ8œy>…ëQˆˆ‡>×£p=ž›•>÷(\ÄÒ£>r+²>]ÂõK£À>Ø£p=BpÎ>gffæÎÏÛ> ×£0raé>> ×c¤!÷>] ?÷(\{Î ?fffðáY!?ö(\×fk/?®Gð›c ×§Ï—I?…ëQõ¼W?ÍÌŒ½d£d?š™ %sr?š™Ù) o€?Âݶ (?¤p±O5½™?[ž‹Ù–¦?Âyž®³?™™K=žûÀ?£ðQ.ðÌ?3ó³á‚Cß?¸…ëQô8>{®GaD>ìQ¸ÅR>)\Âõ"a>ìQ¸ o>P*}>)\ÂmáŠ>®GáB˜>Áõ(\ëɦ>áz®µõ´>¸…ëCÃ>Q¸…ͯÑ>¹…«–9à>233Óã¼í>Ãõ(L÷8û>ÿÿÿÿâã?ëQ¸2`º?õ(\½a¹$?ŽÂõ¹Þ2?®Ç@Ã%A?×£pÝO?ÍÌŒò(\?efF™ïmi?{Î#Ñæv?33+­„?Ø£@(1d’?®G;¯©` ?33»vh­?? Ç2I¹?®hÝw0Æ?z¯75 Ó?®Çï+±ôä?p= ×£½;>ö(\ÂYF>{®G!±T>¹…ë&c> ×£p¶q>áz®¯`€>ŽÂõ(lEŽ>]Âõüõ›>áz®ÿÏ©>¸…ëšÐ·>Ház&õÅ>Ãõ(Ü&;Ô>ÍÌÌÌM â>âz®s"ñ>…ëQ-ÿ> ×£`¯ë ? ×£ð†?eff®M(?ÍÌÌ­Þ<6? ×#ªQD? ×£Èd‰R?®çjŠá`?Âõ†j¯n?23C(Ó{?…Cº)‰?®Ïo®–?\$óD\¤?Háp{š-²?ºgÐÀ?¸À“Í=Ì?ÿ¿CžZØ?R¸¤DùŽë?p= ×£b>>> ×£ð‰H>®GázÃV>Âõ(\/e>Áõ(\ÿ‘s>®Gáê"‚>3333Í>ãz®«Ÿ>™™™™ͬ>…ëQ¸>¥º>áz®‘£È>|®ÇaÅÖ>…ë‘@å>®Gáªéió>p= _?è?433'H?ëQ¸îWf?333Ycø+?]ÂÊxµ9?Ãõ¨W‘šG?ëQ8fÒ¤U?¯G!œ…Ñc?43C"r?†ë™ˆÙ‡€?¤pup“Ž? ×3(Q›?·mÌ$³¨?®BÌø6¶?…’éÓÃ?ö¨‚6U{Ñ?‘BÐ/g@Þ?¤ |*âð?33333u@> ×£p=—J>âz®ÇµX>¤p= ÷ôf>)\Â¥Ru>Âõ(\¿Ìƒ>Âõ(\[a’>*\­¡>ÍÌÌ̦¯>> ×£ÄY½>†ëQ¸€5Ë>ŽÂõ(‘6Ù>¯GáZlZç>|®Ç³žõ>®Gá1? ×£,Ó?ÍÌÌ|«!?|®1Ö“/?Ø£p¨¿#=?{®èáÝJ?Ø£ðs6¿X?IáÚ^×Äf?*\O½ðët?®§«1ƒ?áz܉ “‘?0F¼  ?= ¡­’5­?= ‡›Ipº?q=ùg ¼Ç?H¡c»ÕÕ?ì­C¡8â?YC6õ?ìQ¸…‘A>4333³oL>q= ×£vZ>q= ×£Ÿh> ×£pMèv>…ëQˆN…>×£p=ZГ>> ×£æk¢>®Gás±>÷(\ÈÒ¿>­GáúkÍ>š™™™uÛ> è}é>õ(\«¨÷>ö(\ÿò?¤p=ò¾Z?p= éÝ"?®Gœz1?…ëQƒ/@?ÍÌÌÊHóM?Ø£ðrp±[?ÍÌì•i?Ø£@¸–œw?®qÃ…?> k„½”?’–‘b¢?™™oÒ°?p=[‰¾?+X¤Ë?ÍÌÑz ŒØ?€F¹Eå? ×$[Ö÷?{®Ga‰B>®GáúN>€õ[>×£p= j> ×£pMCx>¹…뙆>T¸…S •>…ëQ(˜£>‘Âõ(Ë=²>…ëÑ’úÀ>Âõ(æ™Ï>*\ÂòfÝ>Áõ(¼—Yë>£p=zNoù>…ëQÀº¥?[Âq§ú?Ház|l$?õ(\«Þ÷2? ×#fœA?®÷ßWP?)\ÏñKQ^? ×Ãù:l?Ãõ1Wz?×£x‹Dˆ?¤pQD@–?> × Ñƒ¤?{Ù¹Ú²?)Üpœ:Á?S8ŒtN3Ï?Ãu›8ÇËÛ?¯'†Nòè?Ha¾E&©û?ìQ¸…GC>ö(\Â>O>ö(\B#]>âz®§+k> ×£p}Uy>Âõ(\—ž‡>> ףܖ>ö(\^†¤>ÎÌÌÌL!³> ×£pöÓÁ>333óÆœÐ>‘Âõ¨ˆôÞ>ìQ¸ÞÖì>…ëÁ°Ûú>R¸]á ?Q¸¡kI?š™™3­%?R¸«<,4?)\£ªÄB?ffæ:¸tQ?> W?³:`?®§ðå)n?Ö£à”|?+\Gßþ‰?ÃõXг˜?ÍÌ%I¦?Gá²»ñ‹´?)Ü[§®ÖÂ?®e‡™Ñ?Í M¼j„Þ?o]"d`ê?\ߊ$}†ý?Ház.ÎC>)\µ P>ÎÌÌÌÌó]>{®Gòk>…ëQ¸>z>q= ×»Sˆ>R¸…ß±–>*\±+¥>]¿³>›™™™*kÂ>„ëQ8€-Ñ>Q¸%ßà>{®çÂßí> ×£€qÚû>˜™™ÉX÷ ?|®Ó/4?fff¸ÒŽ&?ö(\+?5?†ëQ•C?¤p}¿ú=R?š™YÑÃü`?HáZçr o?33Ó¬Bm}?õ(Üq>\‹?®cÓi™?HáØQGާ?…sçHĵ?> ÿÿÃ?„«…ާ0Ò?áúĈX=à?®g°iæì?T8ÐBìÆÿ?×£p= D>¹…ë‘DP>ö(\B^^>ìQ¸%Xl>ëQ¸Etz>Ø£p=j°ˆ>ÎÌÌÌp —>ìQ¸a€¥>…ëQa´>£p= ¸¸Â>\ÂuÈwÑ>…ëLà>®GaShî>S¸eƒ]ü>Q¸ÅŠÒj‰ÂÒ?⺇üëÀà?Øc«I{äì?3ƒŒþÀ4@×£p= D>¹…ë‘DP>ö(\B^^>ìQ¸%Xl>ëQ¸Etz>Ø£p=j°ˆ>ÎÌÌÌp —>ìQ¸a€¥>…ëQa´>£p= ¸¸Â>\ÂuÈwÑ>…ëLà>®GaShî>S¸eƒ]ü>Q¸ÅŠÒj‰ÂÒ?⺇üëÀà?Øc«I{äì?3ƒŒþÀ4@Ház.ÎC>)\µ P>ÎÌÌÌÌó]>{®Gòk>…ëQ¸>z>q= ×»Sˆ>R¸…ß±–>*\±+¥>]¿³>›™™™*kÂ>„ëQ8€-Ñ>Q¸%ßà>{®çÂßí> ×£€qÚû>˜™™ÉX÷ ?|®Ó/4?fff¸ÒŽ&?ö(\+?5?†ëQ•C?¤p}¿ú=R?š™YÑÃü`?HáZçr o?33Ó¬Bm}?õ(Üq>\‹?®cÓi™?HáØQGާ?…sçHĵ?> ÿÿÃ?„«…ާ0Ò?áúĈX=à?®g°iæì?T8ÐBìÆÿ?ìQ¸…GC>ö(\Â>O>ö(\B#]>âz®§+k> ×£p}Uy>Âõ(\—ž‡>> ףܖ>ö(\^†¤>ÎÌÌÌL!³> ×£pöÓÁ>333óÆœÐ>‘Âõ¨ˆôÞ>ìQ¸ÞÖì>…ëÁ°Ûú>R¸]á ?Q¸¡kI?š™™3­%?R¸«<,4?)\£ªÄB?ffæ:¸tQ?> W?³:`?®§ðå)n?Ö£à”|?+\Gßþ‰?ÃõXг˜?ÍÌ%I¦?Gá²»ñ‹´?)Ü[§®ÖÂ?®e‡™Ñ?Í M¼j„Þ?o]"d`ê?\ߊ$}†ý?{®Ga‰B>®GáúN>€õ[>×£p= j> ×£pMCx>¹…뙆>T¸…S •>…ëQ(˜£>‘Âõ(Ë=²>…ëÑ’úÀ>Âõ(æ™Ï>*\ÂòfÝ>Áõ(¼—Yë>£p=zNoù>…ëQÀº¥?[Âq§ú?Ház|l$?õ(\«Þ÷2? ×#fœA?®÷ßWP?)\ÏñKQ^? ×Ãù:l?Ãõ1Wz?×£x‹Dˆ?¤pQD@–?> × Ñƒ¤?{Ù¹Ú²?)Üpœ:Á?S8ŒtN3Ï?Ãu›8ÇËÛ?¯'†Nòè?Ha¾E&©û?ìQ¸…‘A>4333³oL>q= ×£vZ>q= ×£Ÿh> ×£pMèv>…ëQˆN…>×£p=ZГ>> ×£æk¢>®Gás±>÷(\ÈÒ¿>­GáúkÍ>š™™™uÛ> è}é>õ(\«¨÷>ö(\ÿò?¤p=ò¾Z?p= éÝ"?®Gœz1?…ëQƒ/@?ÍÌÌÊHóM?Ø£ðrp±[?ÍÌì•i?Ø£@¸–œw?®qÃ…?> k„½”?’–‘b¢?™™oÒ°?p=[‰¾?+X¤Ë?ÍÌÑz ŒØ?€F¹Eå? ×$[Ö÷?33333u@> ×£p=—J>âz®ÇµX>¤p= ÷ôf>)\Â¥Ru>Âõ(\¿Ìƒ>Âõ(\[a’>*\­¡>ÍÌÌ̦¯>> ×£ÄY½>†ëQ¸€5Ë>ŽÂõ(‘6Ù>¯GáZlZç>|®Ç³žõ>®Gá1? ×£,Ó?ÍÌÌ|«!?|®1Ö“/?Ø£p¨¿#=?{®èáÝJ?Ø£ðs6¿X?IáÚ^×Äf?*\O½ðët?®§«1ƒ?áz܉ “‘?0F¼  ?= ¡­’5­?= ‡›Ipº?q=ùg ¼Ç?H¡c»ÕÕ?ì­C¡8â?YC6õ?p= ×£b>>> ×£ð‰H>®GázÃV>Âõ(\/e>Áõ(\ÿ‘s>®Gáê"‚>3333Í>ãz®«Ÿ>™™™™ͬ>…ëQ¸>¥º>áz®‘£È>|®ÇaÅÖ>…ë‘@å>®Gáªéió>p= _?è?433'H?ëQ¸îWf?333Ycø+?]ÂÊxµ9?Ãõ¨W‘šG?ëQ8fÒ¤U?¯G!œ…Ñc?43C"r?†ë™ˆÙ‡€?¤pup“Ž? ×3(Q›?·mÌ$³¨?®BÌø6¶?…’éÓÃ?ö¨‚6U{Ñ?‘BÐ/g@Þ?¤ |*âð?p= ×£½;>ö(\ÂYF>{®G!±T>¹…ë&c> ×£p¶q>áz®¯`€>ŽÂõ(lEŽ>]Âõüõ›>áz®ÿÏ©>¸…ëšÐ·>Ház&õÅ>Ãõ(Ü&;Ô>ÍÌÌÌM â>âz®s"ñ>…ëQ-ÿ> ×£`¯ë ? ×£ð†?eff®M(?ÍÌÌ­Þ<6? ×#ªQD? ×£Èd‰R?®çjŠá`?Âõ†j¯n?23C(Ó{?…Cº)‰?®Ïo®–?\$óD\¤?Háp{š-²?ºgÐÀ?¸À“Í=Ì?ÿ¿CžZØ?R¸¤DùŽë?¸…ëQô8>{®GaD>ìQ¸ÅR>)\Âõ"a>ìQ¸ o>P*}>)\ÂmáŠ>®GáB˜>Áõ(\ëɦ>áz®µõ´>¸…ëCÃ>Q¸…ͯÑ>¹…«–9à>233Óã¼í>Ãõ(L÷8û>ÿÿÿÿâã?ëQ¸2`º?õ(\½a¹$?ŽÂõ¹Þ2?®Ç@Ã%A?×£pÝO?ÍÌŒò(\?efF™ïmi?{Î#Ñæv?33+­„?Ø£@(1d’?®G;¯©` ?33»vh­?? Ç2I¹?®hÝw0Æ?z¯75 Ó?®Çï+±ôä? ×£p=66> ×£p=ÖA>gfff&oP>¤p= ×C^> Ùk>…ëQ8œy>…ëQˆˆ‡>×£p=ž›•>÷(\ÄÒ£>r+²>]ÂõK£À>Ø£p=BpÎ>gffæÎÏÛ> ×£0raé>> ×c¤!÷>] ?÷(\{Î ?fffðáY!?ö(\×fk/?®Gð›c ×§Ï—I?…ëQõ¼W?ÍÌŒ½d£d?š™ %sr?š™Ù) o€?Âݶ (?¤p±O5½™?[ž‹Ù–¦?Âyž®³?™™K=žûÀ?£ðQ.ðÌ?3ó³á‚Cß? ×£p=|3>¸…ëQD?>¹…ëQºL>ÍÌÌÌL`Z>¤p= ×2h>q= ×Ã.v>Âõ($Q„>GázB—’>®Gáþ >gfffl ¯>ffffO¼>š™™ÉÉÉ>> ×#üu×> ×£På>¤p=šÇTó>Âõè?(\ +¤?áz&wŠ?{®7"°)?8¥7?†ëÑ7˧D?{qR?…kižj`?…ë\}m?„ë ²¸y?Âý€Ï†?33OØÈ“?ffX[ã1¡?„ëqn¦«­?¹°Yü\¹?BÈû,mÅ?)œ´â5×?Âõ(\ê0>33333;>Ãõ(\ÊH>{®Gá°V>Âõ(\ï¿d>…ëQèôr>ÍÌÌÌM>·…ë‹>¹…뉹œ>¯GázÀª>q= ׺·>4333Ë„Å>q= WZ|Ó>Q¸e…á>q= ×Êï>®GÑ©¡ü>]Â-&» ?ÂõL2?£p=ÒT¢$?ëQ¸&gg2? ×£N]@?q=ŠÞsM?Ãõ¨Þ(žY?¤p}-ˆf?™™¹0^ºs?¥pµò°/?ëQ¸ˆßÅ?×£T`’ž™?ö(dÖLà¥?ëQ¼(I‚²?¥p\õVø¾? WÞHLÏ?áz®G÷,>ìQ¸…#7>Gáz® E>…ëQ¸ÞES>3333a>(\Â5ùo>\Âõø}>ìQ¸½eŠ>)\Â1ð—>‘Âõ(T­¥>®Gái™³>ÍÌÌLþ°Á>‘Âõ¨·áÏ>Ãõ(ܬÜ>q= w‚»é>…ëaí ÷>âz¶‘•?®G%W?…ë‡;K ? ×£¶ÅÜ,?¸… ÷y9?…ë2ˆgF?hf&amŸS?R¸>‡a?HẠ>°m?£p8 y?33û5÷…?)\óy´’?? cÉ™Ÿ?š™“d›qª?q=¨'œãµ? ×N­ºÌÆ?õ(\‰(>®Gáz‹3>> ×£ðÈA>)\Âu*P> ×£p}Z]>âz®Çj>…ëQ(x>¸…ëaË…>ÍÌÌÌ€­“>Ãõ(\Û¼¡>¸…ëì¯>ìQ¸Ù«¼>¸…ë"³É>¤p=Š‹üÖ> ×£ƒä>÷(\ÿBò>ÍÌÌì5?›™™áº° ?S¸)P?ö(\ƒ‰A&?…ëù ~3?ázÒ~A?[B*T‰M?gfæ†Y?š™y?Þïe?Há*nϽr? ׃ðmÏ?ÃõhQËËŠ?ÔPb–?R¸Jâ|…¢?Âõ¼GKQ®?…무_¼?fffff†$>áz®GP0>¯Gáz•=>×£p=ŠÉJ>×£p=Š9X>`àe>q= ×ã¹s>ëQ¸=Â>3333«ë>¼¢œ>= ×£„£©>Âõ(Tè¶>Ház”ãkÄ>]Â5P)Ò>= ×cà>®Gøì>[ÂuR"ù>¤p=Z?®GáÂeZ?âzÒKã ?Ãõ( ÿY-?ÍÌÌ@id9?33³;ÜE?¥p=Bª·R? ×#•ÍÝ_?‘Âu¢¨ój?×£ r2¢v?…Ë®³Û‚?ö(d~·&?¤Ä]z™?âz42ð›¤?ÁõßA7º´?®GázH>áz®G3->…ëQ¸=6>®GázÈG>)\µ*R>…ëQØAc>ŽÂõ(|m>ÍÌÌÌœú~>ö(\Ò͇>]Âõ(»˜>ö(\z£>R¸…,“³>¹…ëXC¾>¸…ëf¯Î>¸…+ÂÉ×>ö(\ïóÇç>™™™©+|ò>×£p-1?ÎÌÌô£X ?ázÆÕi?†ëQÐ)e%?·…¿J4?(\ô³??53³­kM?{®6~ùV?`çtÎd?¸U€t6p?+\ÉÚ‘|?33ƒoÊ'†?ÈVì’?,ÅÛ?{ü鄪?¬Øë¤-@)>eÊ2o R5>!«}A>šr(@ÒL>ܯ™RVW>4”ñvc>‘Œc"¦o>Ãe†%z>~Õëˆÿ…>U¼;³?‘>Zø[Óú˜›>¡–ŸM¦>=wp'¦¬±>,èÑq6¼>¨Zâx£Æ> úÖƒkÑ>;;ÑqýÚ>€,å‹¶ôä>J6t9ð>zqZ{þø>ÒI\v?0‰AÎ<Æ ?ÛÏîUP›?{§¿¶¦x?—æ#\?>&?Õ—hX)0?«cK® 77?´òSTé—@?‚ž‰ŽG?OÇ×üÇ=>Éi7o°•H>Vœ€Â,T>P]ºö`>ë>-‚ëÍk>{õOøg7w>†ôðtì‚>ÎÑô;F>8£Âß^I™>ÊÒ4±¬¤>ùjûb\’°>·1exǺ> ß¡›ê?Å>ÊH–õÐ>»ó…¹Ú>¢óä>åžBT=ð>©nxŒ2ù>h‹&u7D?ö3L:m ?+ׄJÄ*?Ààçí¥ ? •…‚¶¯(?“cT82?”£¶æ ”:?Áw×THC?Âèõr@²K?ÕÂhý[ÌS?¬T ƒ@"\?ø6Y6d?à29Ñh?iå`M„Ê8>ÞŠ.E>EBæ&&Q>ÚrCaxí\>Dǽ½˜äg>‚Ô¦o˜%t>ó›u¾ ’€>³Ô1§­‹>M¨•{I›–>‹ã5(±¢>o_#VòJ®>³ÔcÂöĸ>inÁã¹âÃ>`âÞ4óÐ>V~˜g ŠÙ>c€*ÊK`ä>A¥Þ'€ð>PlÎM.0ù>{yä¿ëˆ?°°o˜•H?kÑ;ü(?â˲Ê©!?±øÀš*?7*BFäò3?;ÀÕÁZ=?ª…±¸ÈE?&ütú{ÂO?9&À!W?EJß”‰`?މ÷#¥g?úÒmÃp?kóñ½ÞÓy?¦eÙµDA>+ñÐqKM>+Çt¬?HX>&×<;—d>W24 q>‘Õ6qñY|>fà!|¦ë‡>"=£±æ¸“> t=V| ><ØšÔþª>^>MZT¶>çÎ@¦w Â>•4Ã5¨Í>š=’ZÚ×>°/ÖÜFã>¦…ƒeO­î>» Uµ·xø>Çþ¶1ó=?y‰áýC?(ü€#¨{?Ca]+ 0"?#$yëÂÐ+?ç~ÛéC15?Záé8ç?? oÓVäG?{ |˜ï°Q?ÐŽf5\ Z?'¸P‰¹ûb?‹ 1ÿ´†k?XûmÕs?.Îí ž|?dвçÂ?!&ûú'—G>RiìXT>M!a¹S¥`>òš/ÿ`l>”^‘jRµw>J›µ\1„>—×ßÌ>ˆš¬KR`œ>~e’](v§>0-ÕÕ Ÿ³>¹ÑbEÀ>¥âeš¦Ê>­ÀPž®Õ>RÔH¾á>¿Ç–ì>CìÖ6µ÷>çQp¡i?ÙNPl7_ ?¬Îñ¦d?DÐzµï+"?Æà6,?IÙ‘€Õ5?&²u±@?->/)ßhI?ÿï» 5S?^j€™\?y”ÐÅ+e?^§pk<$o?r77ZM´v?öôu€?ø4q³ ª‡?7 ¿ÿLJ’?D–ÁŠ]/P>u‹‚®„[>Ñ`Ñì.g>–7õ"hs>žz©€>ÅÇæoCñ‹>Ò¥'}ÀÖ—>EH)ä£>È#T«Dа>wzJ4Þ»> [r¢JTÇ>Ÿ>€Ç0Ó>o:œï"Èß>ŸÐ°óçé>ÁÌKõ>\JøÆ?A&èÔ#® ?ñC5è5?‹»WŒ !?\Cfþ¾+?|·IÞ¹Í5?–½Jaî@?Ñ{Ò«v/J?ÅJ¯ÍïT?cüÏüp^??X ,åf?q–µl q?K’üuŸSy? …D¢¢‚?1¼Rl™?‹?Ò)ÂÖ†í“?„7Pù»˜?0Ò…æ­U>¡æn!êb>VöÓi®@o>*ŒÜN3éz>.˜¡Ü ¶†>êÕ¦ºŽ“>Œå(ju >R„ºÊ¬>RDJÊ˃·>¹Hë÷MæÃ>D;N\2‰Ð>›øÆ_ÿ´Û> rRžÖæ>LtHÉIîò>N_âíþ>h`ô»U ?× ‚Tz?} —N- ?téñ·v*?Cߥ€à5?ʕҟž¢@?¾˜É•Á"J?H0Z’LT?ýä­Ÿ__?µÆ&Kûg?h¬V%Ÿ7r?î>æ6Þd{?Y©t`€u„?¢TÉJŽ?èbç6§H–? èŸa‹? ?&nòú±!©?@5Ô„J]>Aæß )"i>å\©µ_u>,/`Nñ‚>öùu8\>„ Û—š>íŽÏ$öí¦>ÒéžùÕY³>äÊ…ˆû‹À>‘UÐeÄË>°WæÁ …×>²b –—ã>¼“ìÍnð>q<¿cy'û>I •‘ †?n¬_R}o?¦ïÓ9?«ø¿³x(?‹.¡ÏÌ3?³;´›«??Œ}Ï6[BI?«)È;ìS?N*J_?n-ÉP&Nh?Ã0 År?É ÷2i°|?²Î­¿Æ…?þ&³¤Q_?ózÏÍSv˜?ø½¬ê['¢?žÇAíª?DÌÜ?§°?'V<à@c>`vΪ÷p>wDN1¢G|>çfÓ<±›ˆ>Š45œ(þ”>ƒe¼|C¢>Aô;¿V¯>ëoj)+Öº>r“öó6¸Æ>L/À„ÓrÓ>PZââŠ\à>¨/55Áë>¨ü^<Ž.÷>dJÁågv?"ZO?& ˆ"OÄ?Ùêd¡Tó%?À÷F¥2? ^•3=?é°=ï £G?*7á<ìR?©Ž›~·/^?ZcqUBÒg?땹jæ²r?¥r }?üåCk†?ã$!‘?J®•°âü™?€Ž (Ú‰£?öÕU§Ë-­?ôtîž–µ?0f4\¢À?^|®gži>?oK{µv>xÅž}ý‚> €ù‚8> ¿BŒ*nœ>FÀ¦º\¨>pÔ·<µ> ÓÜ Â>iÙ—ÀXÏ>›ùl'NÚ>ËêIÀÝÐæ>úü@J)@ó>d¶ºðX?8sÀìŠ` ?_b“h?Ùì9#?ØòÒàAÁ/?¦ÐH7):?{Êïq:kE?nöÔ’¸dQ?¥Bô;+\?ööãß=’f?™ZKh²r?}MÔˆol|?ª=ÝM†?ÜxÍHR‘? ju¤8·š?qÔümh¤?‚GžNö®?wö™ÒR·?gLOóœŠÁ?ùƒ¬ÂƒÅ? ŸÓ¨€vp>`YýÄ‘K}>’`¹¦ˆ>Ä£¾¨•>°?lM¨¢>²wKC”g°>…,ˆ8¼>%Ð~¢È> Cœ:¶Õ>%cÓ*Dâ>NF´{ï>ìf¡-ǵú>Úú')A™?Hyì7?N “" ?²¥rËÅ(+?s, €˜6?+„­\ÀÌB?#'²<óN? š7mY?x ' ߬d? K9H¿p?{ê9ÏÛz?œ“î0k…? K<È é?ŽÇ®‡Ê„š?‰Aœ—¤?\–D6»¯?”?UÏ2:¸?]ÓŒOÈ[Â?0ù BË?º™ù”ÕÕ?¥éï«vu>¡ø4º‚>Ïʆ©;9>•¦.ù›> ¢S²~Ĩ>´>˜Qrµ>¢ø\GãÂ>M'µ9dLÐ>õs(.€Ü>‹…G¦c|è>£ ¾E<õ>ÙÌ1Hã#?1àÎÖ¼1?œéO/x?x¸ûr¯Š&?™a2ù2?š+’ršú??,\”©J?ÿ³235V?o';H¼Ob?Ÿ…lÕ“n?×÷ˆ_‚x?àÍ^E3Ûƒ?3SìêÛ?á@oÍme™?!|Æ ¤?é–@gh¯?/þ49ý^¸?‘1§›¡ÄÂ?<¾Ú!½¯Ì?œD&9¬ÜÕ?-ël™í\Ú?Èj‡!¹{>ò)cÖsOˆ>„Xß°• ”>q#u›ÿL¢>GG.’ר¯>/">!*G¼>þ->Ã’È>ŠkÉ÷<®Õ>´KñXÆâ>oÎݶpð>Ûñ<Ý^Vü>¼ó}z=ž?‘„;òf?—sš*"?­‚S-ê.?µÈ¨Dp^:?…Iö@F?ä§’ÆR?¼g ®o__?¦¿X(j?Ÿüæ¼Þ™u?œ‹wÄ?¯’l&hóŒ?‹½í&Ñs—?Û#G·–Т?> 2Ùø­?!Èûv°£·?·Ž¤æM~Â?iW„+©Ì?™ˆàîÖ?wÊ‹SÀà?"+oüè?¶ÆM—O>×qá nŽ>~ÞNà»™š>;Mýlâ%§>0`s_%°´>–»ÛÂ>Ë7’a½Ð>T(•ã‰Ü>5¬Že6Îè>˜ñs õ>QqÝÃç?$¤@†ÏX?‡&õË3s?˜ME žs(?øÔ5?êQËaÿA?—G ¹¿N?eÜboàZ?sršƒùe?û‹D¾dr?ø'i€©²~?1ÆÖõua‰?í ¤Ç¤á”?ù’öµ¡?lÉUÖ…Ž«?‚X!ó¶?FÄ”p’Á?”¸ô8+­Ë?TbÄÓœÕ?µÏÃÌ#¼à?ã ÉøðÌé?Êã!!Û)î?‡¸׎\…>H¤¨ íX“>H“È >-Læcm¢­>…] Ÿº>ÿì:BTÇ>Zå¿^OzÔ>~B Á?â>Y„µçñï>Ч(¢Fü>yUǤ¦?T †X©?0£1;Ê"?8z@QZa0?äjÊ_°=šU¸±—>4¢7Ëá¤>8ä÷ÊÞR²>õVH#ˆ‡À>túÔ¤,Í>€ òï‰4Ú>%”<ç>í ô°›ô> tBê{?w©¯À ?j½ýê€?’ØPÝ·(?ýØ8‚5?¨Ü—*èÈB?Vh­ŒL=P?v€I0è\?%à]ä4h?‘ŒÐËþ§t?äÚ2qñŠ?¡ïé1Ž´?gøç3î˜?QõÞh>Ѥ?à6‹ß=9±?²õ>UM¼?ag3dþÇ?¼{ËëîÒ?2"c°a Ý?»80ƒhç?Ú0VpOò?}ÈÄ<ùrü?ϯIÙFvÿ?ˆWV\&>¢”Ëry>üêÊ¢f©>“@S7ÿï¶>xŒÏÁPÄ>(œyì`Ò>Y-IœËGà>‹uvÿLí>'g…›Tçù>;œ?*?4óæ¡Ýi?Ø­!ç""?Á÷ÀÊÔ/?À!¶NfYd°U ¢¡>v»"T¯>iaF1¡¶»>kdS5É>£•3oÖ>;ê§‚üUä><ðõò>íiOüL?t—‹ê ?_îœF¿ç?S¦ê¢ùç&?¿ÙWc4?]GjO§òA?ª©¼óp¸O?NJlOíÃ[?wnö¯Uh?ßå³òZ%u?Ž és[‚?N䊱±œ?r><"›?+þAA§?NAˆ¬³?/{1žYgÀ?2ñw8ÍPË?¢8ñ{Ö?žò-ö[â?Å‹j›—í?‰\„V÷?˜bm±…@Ó>ØÝ˜Ì @çˆ5úxÉ @(Av¦hT—>²þÕtq¥>Hô{ß·œ²>ËBw~ØïÀ>mÄçÃ;Î>˜¦<ɱ•Û> “{¶ø¥è>~¢P1P`ö>ö‡!þö?dà¹I°?x7× Î ?å¡ÄtªÍ,?º£CÇôŒ9?'Ÿê›éÈF?˜‹éºST?9IAhGÏa?.yƒBo?7)Òlp{?Væsä‡?D’Îøå”?˰üJaå¡?½m…Ât¸®?;«æ£#º?ºöÖ÷óÆ?ðBÍ;È|Ò?jm+`à¦Þ?N‹Üé?ˆ–"Ì Oô?òõoÃ0@h[¡þ˜k @f¸—ñŸ@üoh_@Õ# L®ú›>ÊÓ…ð ©>ÛRB ²i¶>o±W-ÐöÃ>¿—RéÆMÒ>.ºôvTkà>ÝIî>×~vèú>E£ Ôw?)·#ðPè?9›Ð#?áðH®—±1?¢‚ ¨Ñ???Óÿ"=PL?ò6ÒûJY?ôtLef?Zv,AÛs?%*Ov6w?µGéµq²Ž?!S¨©„Äš?Õ¼’ëBD§?Ø´á´?ö@Ĉç1Á?)WBÊ 4Í?;¨¼s—Ø?ͽ[ÒIwä?TÏÎÐÕÔð?óaè[ Gû?}Ô ÄÉÀ@uÑ€å“@“Ü]G/@Íþ£{@¡ ÐvÝ >ï”<À­>k²Ï´ù¹>(¦Y¼ÏÇ>ªéóÖgÕ>J«e÷¬ã>tá*·ñ>g8«6?Jz|+}- ?î„ì}H’?à:ô *Þ'?¹³gŸ5?ˆÖQEì^C?%‘õ>mrQ?@.ÚÎ4#_?"þ-pjÜk?ësíÓeºx?ˆ^Ù ô…?ƒÄ£¥ÍW“?B¹¯L¡?õMâ{­­?K±-ʬƹ? Ûn§Ö0Æ?žv»¦·öÒ?³•ymà?/q“µ0Íê?m¬h7¸ö?“à Éè@¤3&ÿo{ @;‡'&@óa*§BÍ @’4Ê`ï@{„]µ×¢>3µi¹ó°>\àÊc†¾>â f]Ë>bH,"WBÙ>²ÖËíóÏæ>y_;õ>DHš?Çù?ÛÖeÌc? {+e?ú›H!–¢,?œjXdÍ9?¸¥DvfiG?’7xW—U?ˆqM'sùb?¢Qétùp?Aºj®–j~?^\Sè, ‹?-"±Õ˜?[‚>1¥?âÄc±~ ²?HV  =À?µ$kÙq#Ì?éñá‡"Ø?p0‚ý˜ä? ®èø,ñ?Ä/¨bJZü?Uýy=ô@ð}ù³Œ*@Ñé$sö@¿ÙH€Ô$@,Ôî”~@óWÉÛ!¥>brâp¥³>VOôÜ×>Á>iø’äIÏÏ>¬ÍGjÄÜ>û‚ ÝÞžê>Å~…!ø>¨@ájŽ=?Ï3or(?IMˆL‡"?ȯó¿0?<^kgɘ>?ÒÜ,žð¥K?„U3’Y?“f­¡f?½ÀœËžpt?7ãÚ–R‚?2MiW'n?U€;rA?Ó˜0§ý©? ³E™*ê¶?×ÿÎ!µÄ? ç*N#zÑ?Æå&ÌÊ!Þ?:¬‘lß§é?Zó­ÂñŒõ?Õ' Ç@¨Ü©5³ @Ü¢–.p†@‰UU¼ü!@¼„ûÔÓ(@-?I‡ä@%•Âãù(¨>‰g$ãÓµ>k%ÄÀÃ>ðèúvÞÌÑ>‰#t¦‡à>9ºß N î>ƒXqè%Óû>G''"M ?»5ZXX?1u39%?RŸJ3?Ñ’6[´A?âSõ0P?2³?V]?¿„Ì‹T°j?–„jãx?.àCÇ…?å¬L”©Œ“?d»ÖE}ˆ¡?’´ÿa9¯?Çr–›G´»?Fnu_`È?3¢£©MÕ?¦·hâ?ä¡ÂÙõrï?Réø5žmú?-íª3PÇ@¹ò¢k¡{@K´gÎ$@òYöZ&$@ªðq6,@äïØ¼:€?àãâû³jª>.²®áú§¸>˜v±¡¼Å>4ÌL‘'Ô>A3ïmRâ>CN ñ>ÇÄ|¥ÿ>Ú?>kÐ ?!r=?G?Îí˜D(?kËêÓ'6?‚mý`XD?£\Gqû„R?ͽWR+ô`?â$Íq>Èn?Œ|î |?ÑÐ!ïU‰?šœ(Lé–? ê3“¤?ú(íup²?¼@{åneÀ?\—º4xÍ?¯ÂiûögÙ?˜½Á æ?sºÜ#TØò?†ž[ó°ÿ?‡WbF @T¾ƒiÂ@¬yçÉÄ@Χufè÷&@Ôm>gìº.@qY?+å¶ÀmÛBq­>N¯˜I®º>.±žš¿AÈ>¯“=˜²ôÕ>6ÒF6|ä>Å Ä—ê²ò>˜ JÛ•i?+gÛÆµÕ?xî£ZÖˆ?ÌÛc’-+?C’&×aõ8?têøÔ@ÎF?$DŠŒ¨ýT?Å"Úi%c?¹Q˜'Šq?-> 6(å?mwJG‰ ?bEé'÷Fš?j„±q˜¿§?%æôÃOµ?‡vŠ£= Ã?‚ þvâÐ?XĶ*…²Ý?ÛzÚÙôËé?ÖY ö?A#-µýŽ@-¹êPd@Rý£­ô@BºZk9"@eÀ·`G)@$A©¥¼/@ÕG§ B,À/š$Ò#]¯>X™PyÈ_½>ñßÂüÉ>d)6,1Ø>ÖôH’êæ>´X”F÷¡ô>–.£ä?ˆæßó¤˜?T0Ý0ý ?'I€†ï-?ÐØMý¥n;?þîxgÞ]I?êülZ4P@·M€­E@³9.Ø"þ#@Ñ ļö*@µNó®»x/@’lÈ ú‡<Àc&Jä= ±>φ÷ó¾>;×IÞ¾:Ì>šl°z›¡Ù>rK çµè>ÖÙø÷xýõ>•UëÃŽ?u]@Ý?%PŽƒû’!?´³É²˜#0?Mß"|P÷=?Žúâ•Ü‚K?žVÃórY? ?z:XTg?Ÿí!zõ{u?]Ì3g¤ƒ?78ŽOý‘?øŽ•]^ ?ưyZÁ­?ž[1oÛº?N⛞Z$È?xˆzªÕ?á ß±þâ?øÈäÀ¹Œð?œ5e Å_ü?]?%ÅÂ@qÓ}%F@ЇuÒÙÚ@ÔRàýI”%@v?©ï]ç+@àÜ…•-@)@òÐtÙAÀ¼ ^ S­±>tð­Ö;—À>Úœ`^slÍ>¤·"êxÛ>;ý5þ$é>—Ive«‘÷>_jƒ :¥?u—yÌ:?Oo)5š"?NO/ˆéS1?R}ÒÒà??©šC•¸—M?q¥¼Ñ=4[?mhèo(i? %ÞÁw?RQŸ(¼>…?ãD­vYl“?\˜~säá?å<±6?$°?åÓßï†B½?í0üôOÊ?øOž4@ƒ×?5ì&áÆä?ʇE à!ò?žaÔÿ?(òv«*ú @‰hø@*kzd @¤_«Ì&@³ƒ²FžL,@ä{†P¯+@Ut¦TföIÀZ;tLU³²>ÔÓ‹êqÁ>B🺭Ï>P¡œa‡MÜ>¯B#zê>M*/"Zdø>9 Ó:»Û?TåÀ0? Ýgr}¥#? Ñ zº2?AåýŸØ@?ÖzÄî0O?Ê×âÊ\?PœNÌ{j?bÖå¿ïxx?ƒ/btpt†?âڊ䣔?K÷šÙ¢?’WËÓ´2±?örÃæ?áÙœ6ýhó?]’5f%¢@­¾øf»Â @‰–¡EPS@dd÷ù @,õo쉤'@jCÝFÚ5,@¡ç ¨í?(@(©ˆ]“ŸLÀ»…{[å²>ƒ3ý™îÁÁ>¯ËÕ&x‰Ï>7ãÏLà}Ý>7¨q¶ ë><ïµÎ¨bù> ýXRìZ?„ÕC†Þ?…ýÃFª%$?¿+[Î2?HS¯¿UA?{R† P?úL?¸]?u“ÿVŒk?z]Þ])Wy?ð4õûa‡?b•cCo•?¹lgÒ=¨£?$Ìè±?,¬¤hFÀ?éð_‚XÍ?T ãFHÚ?Þae&Dç?jë"nßRô?º] ‘g@™ÚKF^ @†±0õC@AÙÔ\H•!@(«ãñ+(@¿“å,@*ÉÈi¨%@®=5çHâPÀTŽQw³>lA.*°¸Á>àÍ_ê6Ð>¡_r~KˆÝ>¶Œ”³¿ë>ż濞ù>µ ~Ž~í?™m`: ?Ïä]Þœ$?ÿÓPé›3?¤ïä¸A?:ÒÂô WP?ô.D]^?ð¡Cùk?>5WÄVãy?]þÆÍ—ʇ?–bÒ!Wç•?àZ ¤?¥õŠ$¦O²?ÁßÀ?[½IaÎ?ðsóSõÞÚ?34?½Ñç?IOöËô?õ*”–Ñ@°g¢ û® @(#¬ÁiÄ@’×!Çç!@£Œpqt(@^UpOŽä+@úï „æÌ$@oj½µÃfQÀ(ŽXÊ&³>ä'$DÂ>]]VžúÏ>„¸-êÝ>ÌKÉYnë>Xo:XÄù>b¨7'è¶?ABê‡6?jÑOzWy$?ÀÀ!3?ôì|ö‡¡A? ÜS€iP?€²­E—A^?×E23l?»-´ Óy?[­ué™×‡?~(;„GÞ•?ŽV>¦ü¤?Þt² K²?+ ¢À?¾†]SDÎ?\…¹Â×ãÚ?ÄUÈ>oÐç?è=æÎô?ÞMü4Ñ@*åµɲ @(B†HëÅ@aIšê!@üÝ-Mýx(@;Vÿ"ûî+@Ý×5p$@§HQq£sQÀ2*ôP4³>PÍú‹C{Á>Ûºñ“FûÏ>KÍK»pÝ>‰mžeYë>D¢×DX!ù>™†§¶<‘?7ܼio³?&¡Šv I$?rñ•õ²2?sá% mA?MOP?³"èÖ]?m-ÅR‘yk?ÈB÷ý*jy?xŽ`X‡?Õ×#‡{•?OÓ'rM¸l  õ¬Î>8åÎ1«Ü>ÓY3À–Cê>o×'QA¥ø>ÁüWɨ?] Ãúv3?Ç–Ï-Ø„#?r\wT42?tá!™Ä@?«¤ hl,O?¡Ù-Ýë²\?оÜûú“j?&Ñëlx?yò.k„†?'NŸ”?V–™pªä¢?õçªh2±?b{:¿?Ã-÷!Ì?;ÝšÛþ,Ù?^r…CÕFæ? È3 ‘uó?kN׋X¬@ìò}`Ú @ZóèZh@eðCv¸!@.%EvÌ'@|Zßs,@4mô' r(@»i_ÌLÀ^E"±íö±>ZæÊB UÀ>ja«×Í>¸aaLp Û>ÄȰqpé>qIáV÷>Ä…;ÏgØ?DRäí?lc2’0¼"?[3¬ƒã;1?D¹ö@? T‘½ž{M?½–*ÙR[?µ!\1ai?+M)w?0AŽÁ8…?S úz“?$äLilá?èM3Þó.°?aBXH½?ЋaÊ?èx¶X×?ïˆ+’œÖä?2í!7".ò?ÆPhý2/ÿ?ž$£a @5‚œ].@¹«Ÿ:’0 @áG—„~þ&@oݰ¬#£,@¤‚ì/äº+@˜”X+ÝËIÀV«È«Ã°>»nÏÿn¿>‚ÐHJ?ØË>1è÷Ù>µY™xu¼ç>0Ùâ,28ö>Š´69a?ÍHçî?šŠ‹Ðv!?…¡¶³'>0?[á£ÖÕ=?¸Á¡}¦K?;Ú… `Y?î¢Gù†lg?*íŠtu?&@¹µƒ?È^Îoü‘?^îj ?U5Ÿ€ÿÆ­?TË„¹\ðº?Hô.È?î'—”Õ?¶ÕK ã?]o”JØð?H˜€W¤}ü?à=×¢yã@æ4že@:ï¥î\@]l¢ÀÍ%@"PPä'O,@Hjã1.@½‚ç#ÆAÀó¼ÁÑ.߯>´Gó¿>í¼>%©ˆâYÊ>ê“Èéä×>À 0Væ>qq Ãnô>œQ-a.?uo$Îx?|m¶Ø”> ?Ïbœ£Ç-?<`MÚ»—;?Ï °¯ðGI?JÎ>±^UW?=JÀšXe?,¢H5s? ¹òã?¸Ù~Ÿ·X?úË™¡¬?>=ØÍèª?šÙ-s;¸?h¤A¼Å?Ò§å’eSÓ?ã•þT á?­šé®í?©Dauù?¤ÌÏÙi_@<…P0.r@p }Y@Â6„;$@´d°?d+@ÂѯÔ0@$ö°‹V)<ÀÜûýˆü¬>oë}°å»>|:½ ïÇ>O=Wï=Ö>Ë…¸€>Cä>ƒÑ?Êåò>ä6|ÇÁD?UĦ¸3 ?™¹\'†[?Dfçâ/+?UþØ®sÛ8?P ·ŸîF?X︒ÉðT?‹RcÌ;c?Íævà…q?†ð< €?ZuEÙ?ÎöhŒç`š?ú,èîȧ?\5µeµ?;Gæ·•Ã?èYÀ#öÐ?°á£¥OÑÝ?ŽíBpðé?ÁP ùZ9ö?Q3œ‹'±@þn§7¤@>¥þjD@f(Úw–I"@ü+(‹·±)@»DZK†70@ yk¡¶+ÀùÜ`ת>¸è:‘qJ¸>BŒ¢h Æ>ø—qÛéÓ>?Rþ‰â>s|ÉwQãð>F46 M`ÿ>X";,q ?‰úTg{?ñŽÀmË&(?´9ÜÇB6?@Ɉ ÏHD?#¸÷IÈR?úù î`?ÖPbuSìn?¼Âü„|?vhÚ¯q‰?p6~åð–?ϸ¨Æ`ª¤?ãAN ?|²?›ÜRxyÀ?ü[¸’Í?ïø<ȆŒÙ?á}‡ ¿(æ?çA0 úò?$( oîÿ?-wó„aG @¥0`€ü@¹ # @åkùœ_'@-t' b/@äÃ2wÀÍ-û*b˧>‰‡W*¶>8*u,±€Ã>]>†ÈŒ Ò>Nºƒp1\à>=%÷]î>3U_cœû>©¬Ù† ?ö-fss7?®Ój[„`%?FyÿŽÇm3?gšàƒÇÏA?¦É_‘.)P?¬OÝJ}]?‚vÿYέj?´[ýg4x?Û€ÅÒçÌ…?mO?¤“?è5ƒÉ“¡?ÉÌÁ‚a¯?ùâΚ·Î»?äìHù"„È?åíÍTÓiÕ? bSP‰â?¨Ô鈬ï?Óæ¨ú?q=Ü%¨ý@xï*¹j°@W㾚…@à„K4Ö$@^pÏßÖÒ,@W `[Õ?yäë {¥>^ë› `³>öixE/Á>Rü¶ãwÏ>çãÖŠ‚!Ý>²A¡Ðeê>ðÔÔHaø>(S$(H?ÃA»FœT?ÒÅ;©l"?y„@ŸqÞ0?ßÃWJŒ‡>?rd‘4TÑK?ÐJÇ$‘Y?•Ï®$âÀf?ç§ãtt?×™„¢Hk‚?]ÙbWZw? “yØçi?Iôogª?(aY ·?òy É4Ä?A£b(™Ñ?S¾öžgVÞ?Lö.£„ßé?É×xé¾õ?е—!Cø@8±õ @è%tïÚ@öö:Ü_!@WžÐL)@Ry_+œ@n‘l²i˜¢>PpJx=±>  ±3¾>ÙZ9¥zÄË>ÒB,Á® Ù>µZž%Vç>yô#2‡àô>˯1u,?WT…R?@mp6¬?òÛsŒ“,?êö¬öbÿ9?`«‡¬·fG?ú5“â,U?‚d]+Gþb? ¯q?V[–‡ã|~?)£ÑÁ7‹?ÉKmÑŒ˜?‡{=E„T¥?QCòา?ÄN•K-[À?‚·M=àSÌ?M;ûVØ?êyå,­ä?³÷¢OZñ?eÀZÊç«ü?ŒÛ<ÿdA@ÍÝ*Oo@$í3¢&r@=ó÷ÇsI%@œC¢ò^©@fLFSe >qLz"©v­>$ Ð sº>ï¢-¯á¦Ç>Œï‰õ¿Õ><¾x0|–ã>‚s÷Ãûõñ>g`>“,? ¦Î&† ?û?ËVß?”D{×(? ÖV#M¤5?Í:ïÕoŒC?Åžºz|Q?«ðƒõGf_?@]÷hõk?QÊŸíx?F€a³“†?ð÷Lr“?#«¡?=L¡ hí­?«¥q±S÷¹?*€òÿ•eÆ?'z2“"Ó?'“³Zz3à?÷E/‚ë?tɆ&ì]ö?BÖ«d(@Q)WÛî @‚Bÿrð‹@@HÒå!@x ÇG@…ŠãV¥Ï›>"æ1ò©©>7˜Àa¶>XÊúçlÄ>Š%îÖ:PÒ>BmM‘Áà>nˆuŠî>MW°@fû>¥Í>¡<?p¾êÄ,C?„Z_zê#?Ã¥âÕó1?ë2ï…@?3‰s±L?„yì7zY?q¬Â³Ÿ¬f?®SÞIùt?奼}Ѭ?@‰lDúŽ?öëyQ ›?žìò›Ë€§?/ñá¯M´?ƒÌyücÁ?ì*6y•Í?f¾Û§0èØ?èJ£þ€Âä?,9Ö¸ñ?x{uݸû?³iº1!@Þ+\×[@I‡»”d±@YÚò©ˆ@@Œ±˜>ÊÁŒ££¥>mêoI:J³>'Íò*Á>iFÁJ¾HÏ>ºü\Ü>¡I€2né>XGtµ¼ö>L9¶b-Œ?ŸMÿñÙT?f¼"dz ?{‹ÏÆN-?GÇÓŽç/:?S%‡1G?SšH!D–T?2wÃ…"b?·ˆA¦ óo?è à2Úò{? (£ºfˆ?Aó;yz'•?rWšVD¢?ÐÓÌøQ¯?Ãc¿8ý­º?Y½•UމÆ?qñU EàÒ?yº"‹|Kß?<„8­X¦é?ðŽ~z\Áô?\¶_Ž@ªZkà @–³Ü¡Ù@¥üÖø)@€þ Â=”>{K÷ª†É¢>Õ°Q›ÉA°>î—{LB½>˜0Ð;Ê> Ûað‘ç×>g‘ü49-å>1ßYä2ó>y,Ö |ú?4vrö^š?––Cl~ý?9<þÁ+(?ËKBFa=5?+G ‰nãB?ÜÐhò¤„P?÷-X&]?_Ç µÖUi?Lrhû€'v?Ns”ãƒ?„ú³hë‡?f ×Bæ:œ?Á­‘»Æ¨?:äq"¥V´?×ýž£éÁ?SEó&ÍgÌ?aÜIQt×?ËœÝÖã?sãIëËî?ð×àrø?\iÕ•%5@þlÚþ.± @ÒÐ_;Þ@<,¸’>‘±½#©ž>ç6ýÖC>®>}#w •(¸>¸jèÍ["È>â3-V[Ó>³½e5v5ã>koYÐî>¡õ•aUþ>?th­O?'6¹Íï·?v*¯û"?Ó.øW2?Àc¥ñäJ=?¾¡X%'þK?|п×HV?ß‘Wô e?Qö¡ ¬p? uúÌ ?àlùÌuˆ?¬*‹qf–?”ùʃ¡?^;/Í®x¯?y+GX[¸?4uƒeÅ?¾Ë°£UÐ?g¤¨üîÛ?ò\…Â!ôä?°ÿYRöXñ?\à9Ÿqù?aˆƒC.@OC&ò°@FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (15,15) (0,0)) 7 €p¬ÆcÐ>€ðÕ“è>(˜"#xô>xh³Â¡ü>d_çub?˜º6Ýo?ä´!x ?<-Fz?ô¤¥:?¬Z,4?ú@Íæ(?äk]‘?öï‚?Ò™P%æ?؇ÜÂ?ö–I˜? áypgÐ>h¸U™è>Ðg&¼|ô>â(9¨ü>`¯%£f?l«u?èOÑ?~ ?¼Ÿ+f?d÷«¹>?Û°8?XüÝ.?¾ÿ[J?&Ò?¦H{í?ÆTüiÊ? `Õ< ?&DÀnÐ>ñ;Q¤è>ðqé…ô>`[~µü>LÑoùn?ä³~B?„Ï\wŠ ?,XŸ?˜>âÝF?ž•ãA?¦Õ;Z8?¢“·)?BÁµj?â0àú?v(~Ù?ª¤·¢°?Àùb®yÐ> j1¼´è>H…¡“ô>xø~hÈü>(´[p{?<ƒ˜Ž?TË»œ ?ˆÃä¤?fÏ› S?@‡#¦O?ú¨f¿G?Ø·Í:?V=!A(?0‘ºˆ?Šw/ ð?p^e)É? åG/ˆÐ>`3N…Êè>0s Ö¥ô>èAâü>ðo<û‹?Öfó¢?“8û´ ?5ôÁ?ø•_4c?ö†öêa?420\?re…|Q?ë DA?ì^ö*?Æ„ü ?ظºé?h3šÐ>ŠN•åè>À”¼s¼ô>0Ìý>¨‰ ?ðC£>¼?D2¼Ó ?ÈQÅ7ä?öæñKw?ro$¡x?f§ç™u?¢cΰm?žªp\`?V9M?hi63?:~8?@„#§¯Ð>ð¾¾Îé>˜~>b×ô>rí©'ý>0ÞY¹?_[`Ú?4 O÷ ?ø ?‚í`>?€¨Á³“?F;yå“?×[P?p"Òm…?fr½³u?ú0”_?š™»{B?€ÿËrÈÐ>² +é>”ðƒöô>8qÁpSý>”¸SÕ?À¹ 9ý?ˆÝ¥ ?Üz-l>?’õª?Î  ³?Æß÷¶?›U=¶?¨•¾V°?ÒÝܽ¤?xÊ6ë’?Ä„‹Sz? {äÐ>páp&Ué>8‡óµõ>ØMï„ý>È‘?Võ?Ôñz£$?\¡ù‹O ?ÐÀo/u?‚Á¾UÊ? o‡Ö?N8¨²Þ?J9\Vâ?H»õñà?ȤÀÚ?T7BÍ?2¤!ƒ¹?€¥cªÑ> ;pâƒé>(ÊŠÑ@õ>X5é»ý>Àuïê?lÚ‘rP?LõUσ ?ôc²?ülÄBí?˜hM þ?ÎÆõô ?ˆV}w?dyû?ºÂíO?ÒÉï¬ ?T=ÿ½ÿ? °t&Ñ> £ë¶é>Àhʵkõ>¨iPøý>8ÝQî??Ì ‡l€?|õ±$½ ?Äÿäô?ÞWøœ?€S n)?Æ#dž;?®à§yI?öªR?ü" xV?ÜïžT?ö©£O& ? †ÒàLÑ> )cTíé>pÊšõ>hž½8þ>ˆ½¨Zj? ††,´?ìÓÏrû ?{׋?Q=?Ði‡qX?”æœp?n÷0&„?ÐÆ…Ÿ“?ZÈ!G?¸~ýµ¡?ºmjÈO ?àšá§Ñ>à„†ò"ê>øŽéÎõ>@ž ±{þ>°^ûð˜?Xzxê?ðÝWb? ?,cå²D??µ©j?’ 'jŠ?tË}=ª?¢¯âÂ?ˆJ7fÚ?䏸Né?4goaõ?Aõý·{ ?@vˆëÑ>Àü©Î@ê>¨Aúö> C;µþ>Às£Ñ?˜&`?cª8Ž ?*ãÜäi?lÛÄ8ž?r äO¼?W9 ë? {ØÀ?J¯Ç)?€i-8?¼zËS?D9A|¨ ?àºtB˜Ó> ¯"“Âé>À´~\«ö>GÛ£þ>è§xs3?(Iظ+?¬ÁV ?€t‹}?|=è?ÔbjÝ?«âB?´êÉL3? ò‘Ê‘?"jöŒz?Χ!¼Í?(ƒÓlÏ ?€Ñy¤ˆÜ>ú¨£¦å>òpù>ÔéÀÄü>(?yt?|”P¹U?\!´Ol?ŠpR ?,›Ñ½¦?B8} ?è{>¡?ˆ5Åõ?dk؈o?F¥ €R?ýÙŽ¿Ä4+%¿ì]å¶¿E4¹å¿ G¿¿°kJ“¿L3c¿lN§-¿ÜÈÒÈò¿"a²¿Ä¹3l¿`‡ÃŸ¿,ÕÑš¿Ðèé¿lµAþ¿TYvn¿xþgÝT¿<0ïw6¿ K4²¿Ì¤ïhé¿Ä/žtº¿T “©…¿ð9Å×J¿L¸7Ê ¿øÐíE¿d|–t¿À"vÇ¿L1@’È ¿à@Ç ¿ åR*· ¿œxÞ®¥ ¿¬óhAŽ ¿TýsÈp ¿˜B¡$M ¿”ù 1# ¿¬Ò·Ãò ¿tÈð­» ¿Tž¼} ¿À.¸8 ¿ÔÀÝcì¿lF|˜¿ÈÛâ³<¿ŒáK²Ø¿¨9,÷¿à]Žð¿$òJJã¿LT|QÏ¿LÿÚŒ´¿€À]Þ’¿,ã!j¿ð…¦):¿ØãñÆ¿XËÎÂà ¿ˆgÇâ| ¿@wè- ¿èîúÖ ¿ ¬ª’v ¿ÐÊ’˜ ¿Äy}<› ¿ÚŽ2–¿v…^}’¿ ¦‹¿šsöß¿\záp¿ ‘‰^¿Ô×+G¿”+ÃF,¿´5Í5 ¿ÆŒÈÙé¿<»œÂ¿lÚõº•¿2#v²d¿XƒÒ.¿°)@ßç¿4b¤g¿NŠ•‚´¿r?Ël°¿Xð<¨¿<a替ed\‹¿ è Šv¿Ù„V]¿Æ3•¤?¿”,0S¿~ÜP>ö¿üÑP@Ê¿‰3™¿òâáób¿Ò¡^'¿ÎdªMæ¿æ¶ŠŸ¿–ÐôèÖ¿¬ýwÒ¿X¥É¿î{ !¼¿Ä  ª¿äмs“¿žF›ÿw¿èÜ¡W¿Pl 42¿”æù‹¿.©Ì}׿þŒûÞ¡¿dæŠf¿t¨wf%¿l±]Þ¿´š½M‘¿Ìé-Áý¿œŽùø¿RöPb↓eðà¿ÑÍ¿$ô;%µ¿ŠÒN’—¿è4¯t¿./OL¿f¨¼?¿&_ìKê¿Bô±?°¿:%Eòo¿ð°¤R)¿À•ætÜ¿tß{‰¿*^Ža)¿¤\€I$¿âŒ€¿XSí­ ¿ÊÉëö¿\ÐÿÛ¿Ž~/u¼¿Ów9—¿[½l¿¦[Ý×:¿Ì6v2¿¬¿šáÄ¿P`׫¿V`ï|3¿ˆ¢d§à¿¬ÌÒˆ¿ÔüZ¿êøë¸T¿@CðI¿‘1®9¿¶¦ÝÞ#¿Æ3ê]¿’ø& 翀ὧ¿¿’=q’¿H4…Ó]¿°`tÄ"¿Tskhà¿<Ž^–¿žÍÜMD¿JÇé•ê¿’™ï‹¿$%|3¿¬%6pG¿Ì¼·;n¿2 ohW¿ÀÓÓ:¿jNÄ©¿Þ|çUî¿d…Ä„¾¿<×Q«‡¿\¤j£I¿ôp¿ÆNµ¿²Ò Æ\¿R«Ìrù¿*°¢Œ¿Û:Døe ¿6-òc ¿‰ë0] ¿ägHT ¿Ã|©{H ¿Sà˜g9 ¿>x\' ¿Ÿ«À ¿äƒg ò¿èþ’±¸¿èÓ€x¿X]RP/¿l»ºžÝ¿ƒl?€¿,cšâ¿,c±~{¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?þÿÿÿÿÿï?þÿÿÿÿÿï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?{®Gáz4={®Gáz4={®Gáz4½{®Gáz$={®Gáz$½{®Gáz4=–ð[&Å5“=¦ð[&Å5“=ˆð[&Å5“=‰ð[&Å5£½õï[&Å5ƒ=ð[&Å5ƒ½Bð[&Å5£½ß艹§Ð¬=–ð[&Å5ƒ=Gé¿û󋽺–ð[&Å5£=`艹§Ðœ½ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_4/0000755000175000017500000000000011634153073022025 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_4/Header0000644000175000017500000000043511634153073023142 0ustar amckinstryamckinstryNavierStokes-V1.1 5 x_velocity y_velocity density tracer avg_pressure 2 0 1 0 0 2 2 2 ((0,0) (15,15) (0,0)) ((0,0) (31,31) (0,0)) 0 0 0.125 0.125 0.0625 0.0625 0 0 0 1 0 0 0 2 0 2 Level_0/Cell 1 5 0 0 0 0.5 0 0.5 0 0.5 1.5 2 1.5 2 0 0.5 1.5 2 1.5 2 0.5 1.5 0.5 1.5 Level_1/Cell ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_4/Level_1/0000755000175000017500000000000011634153073023314 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_4/Level_1/Cell_H0000644000175000017500000000204511634153073024366 0ustar amckinstryamckinstry1 0 5 0 (5 0 ((0,0) (7,7) (0,0)) ((0,24) (7,31) (0,0)) ((24,0) (31,7) (0,0)) ((24,24) (31,31) (0,0)) ((8,8) (23,23) (0,0)) ) 5 FabOnDisk: Cell_D_0000 0 FabOnDisk: Cell_D_0000 2640 FabOnDisk: Cell_D_0000 5282 FabOnDisk: Cell_D_0000 7924 FabOnDisk: Cell_D_0000 10568 5,5 -0.990392640201615,0.00960735979838489,1,0.00960735979838507,-0.477718492258605, 0.00960735979838552,0.0096073597983843,1,0.00960735979838444,-0.477718492258604, -0.990392640201614,-0.990392640201616,1,0.00960735979838444,-0.477718492258604, 0.00960735979838486,-0.990392640201615,1,0.00960735979838381,-0.477718492258603, -0.990392640201615,-0.990392640201616,1,0.00960735979838444,-0.477718492258603, 5,5 -0.00960735979838491,0.990392640201615,1,0.990392640201615,0.4767060677245, 0.990392640201616,0.990392640201614,1,0.990392640201615,0.476706067724258, -0.0096073597983843,-0.00960735979838553,1,0.990392640201615,0.476706067724258, 0.990392640201615,-0.00960735979838487,1,0.990392640201614,0.476706067724501, 0.990392640201616,0.990392640201615,1,0.990392640201616,0.4767060677245, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_4/Level_1/Cell_D_00000000644000175000017500000005063211634153073025026 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (7,7) (0,0)) 5 ¦i<¸ø¸¿µ¬ó ¸¿XP\™'!¶¿LC³Œe³¿µ.{>Ö¯¿]1-¨§¿ºöL À"¿Hj­ƒ¿0¾qb}Ò¿Äh®9;ÇÑ¿GÒdWpbпá™n«é¸Ì¿ýH+a’Ç¿ÍAðÒòƒÁ¿‰yÅ[g’µ¿÷L À"¿r½,Þ¿H¥™uÌÞÜ¿ž¡)f›Ú¿Á#À=R׿ÿ |¦#Ó¿x.£Œ‰qÌ¿ØAðÒòƒÁ¿|]1-¨§¿FÒÐì3ä¿&û2¾+mã¿a{&ïLçá¿­\÷Ï—bß¿–åðÑÁÙ¿ |¦#Ó¿I+a’Ç¿6/{>Ö¯¿²îÆGžè¿{p„Ó«ç¿­X§‘ÄÐå¿À4㿳\÷Ï—bß¿Ì#À=R׿ÿ™n«é¸Ì¿]LC³Œe³¿p— üèì¿:L;›ë¿b4לã迱X§‘ÄÐå¿f{&ïLçá¿®¡)f›Ú¿[ÒdWpbпµP\™'!¶¿øô”Ïyî¿ÏP‡³Mí¿=L;›ë¿ {p„Ó«ç¿.û2¾+mã¿]¥™uÌÞÜ¿Üh®9;ÇÑ¿­ó ¸¿W®ûçK±ï¿úô”Ïyî¿u— üèì¿»îÆGžè¿PÒÐì3俉½,Þ¿I¾qb}Ò¿t¦i<¸ø¸¿¦i<¸ø¸?0¾qb}Ò?r½,Þ?FÒÐì3ä?²îÆGžè?p— üèì?øô”Ïyî?W®ûçK±ï?µ¬ó ¸?Äh®9;ÇÑ?H¥™uÌÞÜ?&û2¾+mã?{p„Ó«ç?:L;›ë?ÏP‡³Mí?úô”Ïyî?XP\™'!¶?GÒdWpbÐ?ž¡)f›Ú?a{&ïLçá?­X§‘ÄÐå?b4לãè?=L;›ë?u— üèì?LC³Œe³?á™n«é¸Ì?Á#À=R×?­\÷Ï—bß?À4ã?±X§‘ÄÐå? {p„Ó«ç?»îÆGžè?µ.{>Ö¯?ýH+a’Ç?ÿ |¦#Ó?–åðÑÁÙ?³\÷Ï—bß?f{&ïLçá?.û2¾+mã?PÒÐì3ä?]1-¨§?ÍAðÒòƒÁ?w.£Œ‰qÌ? |¦#Ó?Ì#À=R×?®¡)f›Ú?]¥™uÌÞÜ?‰½,Þ?¸öL À"?ˆyÅ[g’µ?ØAðÒòƒÁ?I+a’Ç?ÿ™n«é¸Ì?[ÒdWpbÐ?Üh®9;ÇÑ?I¾qb}Ò??j­ƒ?÷L À"?|]1-¨§?6/{>Ö¯?]LC³Œe³?µP\™'!¶?­ó ¸?t¦i<¸ø¸?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?Y®ûçK±ï?üô”Ïyî?w— üèì?¼îÆGžè?RÒÐì3ä?‹½,Þ?K¾qb}Ò?w¦i<¸ø¸?üô”Ïyî?ÓP‡³Mí?AL;›ë? {p„Ó«ç?1û2¾+mã?`¥™uÌÞÜ?Þh®9;ÇÑ?#­ó ¸?w— üèì?AL;›ë?h4לãè?¶X§‘ÄÐå?l{&ïLçá?´¡)f›Ú?_ÒdWpbÐ?½P\™'!¶?¼îÆGžè? {p„Ó«ç?¶X§‘ÄÐå?È4ã?À\÷Ï—bß?Õ#À=R×? šn«é¸Ì?hLC³Œe³?RÒÐì3ä?1û2¾+mã?l{&ïLçá?À\÷Ï—bß?–åðÑÁÙ? |¦#Ó? I+a’Ç?H/{>Ö¯?‹½,Þ?`¥™uÌÞÜ?´¡)f›Ú?Õ#À=R×? |¦#Ó?.£Œ‰qÌ?æAðÒòƒÁ?Œ]1-¨§?K¾qb}Ò?Þh®9;ÇÑ?_ÒdWpbÐ? šn«é¸Ì? I+a’Ç?æAðÒòƒÁ?¨yÅ[g’µ?A÷L À"?w¦i<¸ø¸?#­ó ¸?½P\™'!¶?hLC³Œe³?H/{>Ö¯?Œ]1-¨§?A÷L À"?¤j­ƒ?}<•ð’Þ¿wy¥-EÜ¿È(:p÷׿g¸F_çYÒ¿¸=¤àÈ¿–½÷Æ–¦º¿œÛî_àw¢¿ÞwFïùp?]t“N?Ü¿Òý'ÔLõÙ¿ù¼ªÕ¿@ðÐ+п°S“µà Ä¿ öÇ(ØÙ±¿|˜+êp¿²@¬]»™ž?|‡™žç׿†è"ˆã˜Õ¿ œEvÎCÑ¿–PÒ÷LÇ¿ƒØ lr¶¿hãt†,W¿Œ ·H#°?þ÷Æ]ë·?` Õ á@Ò¿½ê¾õÞÏ¿|Ÿ„Ô†+Ç¿â²JÚ·¿´§Ë²R?ߤ|žg¶?lL‡^’Ã?N ŒÌÙ=È?òéaGÈ¿>JúÜ?שŸ˜m_‚?˜2Ú ô¥?œ‹|ô†»?Òê‹MeoÉ?ä2›¾Ø§Ò?æî´±EØ?'ÊIÁ]Ü?‚«*Z‚Þ?FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,24) (7,31) (0,0)) 5 ^®ûçK±ï?õ”Ïyî?{— üèì?¿îÆGžè?TÒÐì3ä?½,Þ?L¾qb}Ò?p¦i<¸ø¸?õ”Ïyî?ßP‡³Mí?LL;›ë?{p„Ó«ç?9û2¾+mã?k¥™uÌÞÜ?äh®9;ÇÑ?&­ó ¸?Œ— üèì?UL;›ë?{4לãè?ÆX§‘ÄÐå?x{&ïLçá?È¡)f›Ú?jÒdWpbÐ?ËP\™'!¶?ÕîÆGžè?${p„Ó«ç?ÌX§‘ÄÐå?Û4ã?ß\÷Ï—bß?ì#À=R×?'šn«é¸Ì?yLC³Œe³?sÒÐì3ä?Rû2¾+mã?Š{&ïLçá?õ\÷Ï—bß?¹–åðÑÁÙ?0 |¦#Ó?GI+a’Ç?{/{>Ö¯?Ô½,Þ?¦¥™uÌÞÜ?ô¡)f›Ú? $À=R×?> |¦#Ó?Õ.£Œ‰qÌ?BðÒòƒÁ?Á]1-¨§?¡¾qb}Ò?1i®9;ÇÑ?¬ÒdWpbÐ?‘šn«é¸Ì?I+a’Ç?8BðÒòƒÁ?zÅ[g’µ?Ë÷L À"?À§i<¸ø¸?`®ó ¸?áQ\™'!¶?gMC³Œe³?ë0{>Ö¯?Å^1-¨§?ÃøL À"?§k­ƒ?çh­ƒ?õL À"?Ç[1-¨§?ì,{>Ö¯?úJC³Œe³?O\™'!¶?g«ó ¸?§¤i<¸ø¸?öL À"? yÅ[g’µ?pAðÒòƒÁ?†H+a’Ç?U™n«é¸Ì?úÑdWpbÐ?sh®9;ÇÑ?ß½qb}Ò?Ñ\1-¨§?’AðÒòƒÁ?.£Œ‰qÌ?Å |¦#Ó?~#À=R×?U¡)f›Ú?ü¤™uÌÞÜ?$½,Þ?o.{>Ö¯?ÉH+a’Ç?Ö |¦#Ó?G–åðÑÁÙ?n\÷Ï—bß?@{&ïLçá?û2¾+mã?%ÒÐì3ä?òKC³Œe³?¶™n«é¸Ì?ž#À=R×?\÷Ï—bß?¤4ã?X§‘ÄÐå?æzp„Ó«ç?–îÆGžè?CP\™'!¶?7ÒdWpbÐ?„¡)f›Ú?P{&ïLçá?˜X§‘ÄÐå?J4לãè?$L;›ë?[— üèì?©¬ó ¸?»h®9;ÇÑ?9¥™uÌÞÜ?û2¾+mã?özp„Ó«ç?,L;›ë?ÀP‡³Mí?éô”Ïyî?¦i<¸ø¸?,¾qb}Ò?l½,Þ?BÒÐì3ä?®îÆGžè?k— üèì?òô”Ïyî?Q®ûçK±ï?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?©¤i<¸ø¸?g«ó ¸?$O\™'!¶?KC³Œe³?û,{>Ö¯?×[1-¨§?&õL À"?8i­ƒ?ã½qb}Ò?{h®9;ÇÑ?ÒdWpbÐ?j™n«é¸Ì?œH+a’Ç?„AðÒòƒÁ?/yÅ[g’µ?žöL À"?$½,Þ?ý¤™uÌÞÜ?Y¡)f›Ú?…#À=R×?Ï |¦#Ó?..£Œ‰qÌ?ªAðÒòƒÁ?<]1-¨§?'ÒÐì3ä?û2¾+mã?F{&ïLçá?~\÷Ï—bß?X–åðÑÁÙ?ç |¦#Ó?îH+a’Ç?/{>Ö¯?—îÆGžè?èzp„Ó«ç?•X§‘ÄÐå?«4ã?\÷Ï—bß?±#À=R×?ß™n«é¸Ì?JLC³Œe³?]— üèì?(L;›ë?Q4לãè?¢X§‘ÄÐå?[{&ïLçá?›¡)f›Ú?PÒdWpbÐ?©P\™'!¶?ëô”Ïyî?ÂP‡³Mí?2L;›ë?ÿzp„Ó«ç?&û2¾+mã?P¥™uÌÞÜ?Ôh®9;ÇÑ?­ó ¸?S®ûçK±ï?öô”Ïyî?r— üèì?¸îÆGžè?NÒÐì3ä?…½,Þ?G¾qb}Ò?r¦i<¸ø¸?V¿ACïùp?¼™N^»™ž?÷]ë·?¬§|ÌÙ=È?xCæ@ÒJÒ?ÂÖâµTØ?óŠ7>Ü?~Œ«*Z‚Þ?Sˆ`àw¢¿bÛ}ép¿+·H#°?ÌWG‡^’Ã?Hð#®æÐ?‡Ø“8s¼Õ?Ô¥/×ÖÚ?HÂÄIÁ]Ü?`ýÆ–¦º¿Î…Å(ØÙ±¿ }-s†,W¿™Çyžg¶?ãµqñ’ŸÇ?Gü²ÃˆÑ?ìA©œÐæÕ?ÿí´±EØ?n2¥àÈ¿]&“µà Ä¿˜× lr¶¿`*ü¦Ë²R?ì"N¹?&Üœ¶øÇ?»™9,sZÐ?æ¾Ø§Ò?néF_çYÒ¿ùôÐ+пÚ5Ò÷LÇ¿¼JÚ·¿H•F¤'l? 3•P¹·?· ‹ÿ›Ä?Ü›MeoÉ?g((:p÷׿¼ªÕ¿ÈœEvÎCÑ¿*¿„Ô†+Ç¿d«Ù¬µ¿¤«F% r?`èCL-в?‘cLô†»?Jy¥-EÜ¿åý'ÔLõÙ¿”â"ˆã˜Õ¿Hã¾õÞÏ¿”zúþéaGÈ¿&í9±q乿Za`Žs ¿Ü—:šm_‚?FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((24,0) (31,7) (0,0)) 5 èh­ƒ¿öL À"¿Ò\1-¨§¿o.{>Ö¯¿òKC³Œe³¿CP\™'!¶¿©¬ó ¸¿¦i<¸ø¸¿õL À"¿ yÅ[g’µ¿’AðÒòƒÁ¿ÉH+a’Ç¿¶™n«é¸Ì¿7ÒdWpbп»h®9;ÇÑ¿,¾qb}Ò¿Ç[1-¨§¿pAðÒòƒÁ¿.£Œ‰q̿֠|¦#Ó¿ž#À=R׿„¡)f›Ú¿9¥™uÌÞÜ¿l½,Þ¿ì,{>Ö¯¿†H+a’ǿŠ|¦#Ó¿G–åðÑÁÙ¿\÷Ï—bß¿P{&ïLçá¿û2¾+mã¿BÒÐì3ä¿úJC³Œe³¿U™n«é¸Ì¿~#À=R׿n\÷Ï—bß¿¤4㿘X§‘ÄÐå¿özp„Ó«ç¿®îÆGžè¿O\™'!¶¿úÑdWpbпU¡)f›Ú¿@{&ïLçá¿X§‘ÄÐå¿J4לãè¿,L;›ë¿k— üèì¿g«ó ¸¿sh®9;ÇÑ¿ü¤™uÌÞÜ¿û2¾+mã¿æzp„Ó«ç¿$L;›ë¿ÀP‡³Mí¿òô”Ïyî¿§¤i<¸ø¸¿ß½qb}Ò¿$½,Þ¿%ÒÐì3ä¿–îÆGžè¿[— üèì¿éô”Ïyî¿Q®ûçK±ï¿^®ûçK±ï¿õ”Ïy— üèì¿ÕîÆGžè¿sÒÐì3ä¿Ô½,Þ¿¡¾qb}Ò¿À§i<¸ø¸¿õ”Ïyî¿ßP‡³Mí¿UL;›ë¿${p„Ó«ç¿Rû2¾+m㿦¥™uÌÞÜ¿1i®9;ÇÑ¿`®ó ¸¿{— üèì¿LL;›ë¿{4לãè¿ÌX§‘ÄÐ忊{&ïLçá¿ô¡)f›Ú¿¬ÒdWpbпáQ\™'!¶¿¿îÆGžè¿{p„Ó«ç¿ÆX§‘ÄÐå¿Û4ã¿õ\÷Ï—bß¿ $À=R׿‘šn«é¸Ì¿gMC³Œe³¿TÒÐì3ä¿9û2¾+mã¿x{&ïLçá¿ß\÷Ï—bß¿¹–åðÑÁÙ¿> |¦#Ó¿I+a’Ç¿ì0{>Ö¯¿½,Þ¿k¥™uÌÞܿȡ)f›Ú¿ì#À=R׿0 |¦#Ó¿Õ.£Œ‰qÌ¿8BðÒòƒÁ¿Å^1-¨§¿L¾qb}Ò¿äh®9;ÇÑ¿jÒdWpbп'šn«é¸Ì¿GI+a’Ç¿BðÒòƒÁ¿zÅ[g’µ¿ÅøL À"¿p¦i<¸ø¸¿&­ó ¸¿ËP\™'!¶¿yLC³Œe³¿|/{>Ö¯¿Â]1-¨§¿Í÷L À"¿¯k­ƒ¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?©¤i<¸ø¸?ã½qb}Ò?$½,Þ?'ÒÐì3ä?—îÆGžè?]— üèì?ëô”Ïyî?S®ûçK±ï?g«ó ¸?{h®9;ÇÑ?ý¤™uÌÞÜ?û2¾+mã?èzp„Ó«ç?(L;›ë?ÂP‡³Mí?öô”Ïyî?$O\™'!¶?ÒdWpbÐ?Y¡)f›Ú?F{&ïLçá?•X§‘ÄÐå?Q4לãè?2L;›ë?r— üèì?KC³Œe³?j™n«é¸Ì?…#À=R×?~\÷Ï—bß?«4ã?¢X§‘ÄÐå?ÿzp„Ó«ç?¸îÆGžè?û,{>Ö¯?œH+a’Ç?Ï |¦#Ó?X–åðÑÁÙ?\÷Ï—bß?[{&ïLçá?&û2¾+mã?NÒÐì3ä?×[1-¨§?„AðÒòƒÁ?..£Œ‰qÌ?ç |¦#Ó?±#À=R×?›¡)f›Ú?P¥™uÌÞÜ?…½,Þ?&õL À"?/yÅ[g’µ?ªAðÒòƒÁ?îH+a’Ç?ß™n«é¸Ì?PÒdWpbÐ?Ôh®9;ÇÑ?G¾qb}Ò?8i­ƒ?žöL À"?<]1-¨§?/{>Ö¯?JLC³Œe³?©P\™'!¶?­ó ¸?r¦i<¸ø¸?j—:šm_‚?Â``Žs ¿—ì9±q乿æýéaGÈ¿EïÔ á@Ò¿Ng‡™žç׿i†t“N?Ü¿}<•ð’Þ¿ÌáÙ ô¥?®y *™Ês?Gß_a°¿ezúÜ?âÖâµTØ?Cæ@ÒJÒ?ü§|ÌÙ=È?ª÷]ë·? ›N^»™ž?ó½ACïùp?FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((24,24) (31,31) (0,0)) 5 ¡¤i<¸ø¸?à½qb}Ò?(½,Þ?(ÒÐì3ä?›îÆGžè?a— üèì?ðô”Ïyî?X®ûçK±ï?l«ó ¸?|h®9;ÇÑ? ¥™uÌÞÜ?û2¾+mã?òzp„Ó«ç?2L;›ë?ÏP‡³Mí?õ”Ïyî?2O\™'!¶? ÒdWpbÐ?n¡)f›Ú?Q{&ïLçá?¦X§‘ÄÐå?c4לãè?GL;›ë?‡— üèì?KC³Œe³?|™n«é¸Ì?ž#À=R×?›\÷Ï—bß?¿4ã?·X§‘ÄÐå?{p„Ó«ç?ÑîÆGžè?,-{>Ö¯?ºH+a’Ç?ð |¦#Ó?€–åðÑÁÙ?Æ\÷Ï—bß?x{&ïLçá?Gû2¾+mã?pÒÐì3ä? \1-¨§?§AðÒòƒÁ?s.£Œ‰qÌ? |¦#Ó?ê#À=R×?Û¡)f›Ú?–¥™uÌÞÜ?ν,Þ?«õL À"?‹yÅ[g’µ?üAðÒòƒÁ?YI+a’Ç?fšn«é¸Ì?›ÒdWpbÐ?(i®9;ÇÑ?ž¾qb}Ò?.j­ƒ?øL À"?t^1-¨§?¤0{>Ö¯?JMC³Œe³?ÌQ\™'!¶?R®ó ¸?º§i<¸ø¸?¡¤i<¸ø¸¿l«ó ¸¿2O\™'!¶¿KC³Œe³¿--{>Ö¯¿ \1-¨§¿«õL À"¿/j­ƒ¿à½qb}Ò¿|h®9;ÇÑ¿ ÒdWpbп|™n«é¸Ì¿ºH+a’Ç¿§AðÒòƒÁ¿‹yÅ[g’µ¿øL À"¿(½,Þ¿ ¥™uÌÞÜ¿n¡)f›Ú¿ž#À=R׿ð |¦#Ó¿s.£Œ‰qÌ¿üAðÒòƒÁ¿t^1-¨§¿(ÒÐì3ä¿û2¾+mã¿Q{&ïLçá¿›\÷Ï—bß¿€–åðÑÁÙ¿ |¦#Ó¿YI+a’Ç¿¤0{>Ö¯¿›îÆGžè¿òzp„ӫ翦X§‘ÄÐå¿¿4ã¿Æ\÷Ï—bß¿ê#À=R׿fšn«é¸Ì¿JMC³Œe³¿a— üèì¿2L;›ë¿c4לãè¿·X§‘ÄÐå¿x{&ïLçá¿Û¡)f›Ú¿›ÒdWpbпÌQ\™'!¶¿ðô”Ïyî¿ÏP‡³Mí¿GL;›ë¿{p„Ó«ç¿Gû2¾+mã¿–¥™uÌÞÜ¿(i®9;ÇÑ¿R®ó ¸¿X®ûçK±ï¿õ”Ïy— üèì¿ÑîÆGžè¿pÒÐì3ä¿Î½,Þ¿ž¾qb}Ò¿º§i<¸ø¸¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?Íg­ƒ?ƒôL À"?†[1-¨§?·,{>Ö¯?ãJC³Œe³?O\™'!¶?Z«ó ¸?¤¤i<¸ø¸?ƒôL À"?¶xÅ[g’µ?HAðÒòƒÁ?jH+a’Ç?>™n«é¸Ì?ôÑdWpbÐ?qh®9;ÇÑ?à½qb}Ò?†[1-¨§?HAðÒòƒÁ?Í-£Œ‰qÌ?¦ |¦#Ó?a#À=R×?A¡)f›Ú?í¤™uÌÞÜ?½,Þ?·,{>Ö¯?jH+a’Ç?¦ |¦#Ó?"–åðÑÁÙ?N\÷Ï—bß?5{&ïLçá?ýú2¾+mã?#ÒÐì3ä?ãJC³Œe³?>™n«é¸Ì?a#À=R×?N\÷Ï—bß?4ã?X§‘ÄÐå?Úzp„Ó«ç?’îÆGžè?O\™'!¶?ôÑdWpbÐ?A¡)f›Ú?5{&ïLçá?X§‘ÄÐå?:4לãè?L;›ë?X— üèì?Z«ó ¸?qh®9;ÇÑ?í¤™uÌÞÜ?ýú2¾+mã?Úzp„Ó«ç?L;›ë?²P‡³Mí?æô”Ïyî?¤¤i<¸ø¸?à½qb}Ò?½,Þ?#ÒÐì3ä?’îÆGžè?X— üèì?æô”Ïyî?M®ûçK±ï?œ«*Z‚Þ?UÊIÁ]Ü?Bæî´±EØ?)3›¾Ø§Ò?`ë‹MeoÉ?˜Œ|ô†»?#2Ú ô¥?­Ÿ˜m_‚?·ç„7>Ü?X±/×ÖÚ?üw¨œÐæÕ?Qs5,sZÐ?L†ÿ›Ä?à RL-в?LM·*™Ês?Žs ¿šâµTØ?£¸”8s¼Õ?‹Pü²ÃˆÑ?&§Ùœ¶øÇ?Jƒ•P¹·?|ƒ% r?±Ïß_a°¿ˆ??±q乿4öñ@ÒJÒ?`-(®æÐ?F=tñ’ŸÇ?Ñ"N¹?J¶ˆF¤'l?§Ù¬µ¿†IúÖ¯?çH+a’Ç?û |¦#Ó?–åðÑÁÙ?»\÷Ï—bß?n{&ïLçá?7û2¾+mã?\ÒÐì3ä?_ÒÐì3ä?Bû2¾+mã?{&ïLçá?ê\÷Ï—bß?º–åðÑÁÙ?= |¦#Ó?xI+a’Ç?’0{>Ö¯?Ì\1-¨§?ÂAðÒòƒÁ?z.£Œ‰qÌ?  |¦#Ó?Ù#À=R×?À¡)f›Ú?t¥™uÌÞÜ?¥½,Þ?«½,Þ?„¥™uÌÞÜ?Û¡)f›Ú?ü#À=R×?7 |¦#Ó?Ý.£Œ‰qÌ?.BðÒòƒÁ?^1-¨§?jöL À"?ŒyÅ[g’µ?æAðÒòƒÁ?,I+a’Ç?%šn«é¸Ì?rÒdWpbÐ?øh®9;ÇÑ?h¾qb}Ò?k¾qb}Ò?i®9;ÇÑ?‚ÒdWpbÐ?Pšn«é¸Ì?bI+a’Ç?#BðÒòƒÁ?zÅ[g’µ?øL À"?[j­ƒ?…÷L À"?â]1-¨§?Ë/{>Ö¯?¿LC³Œe³?'Q\™'!¶?›­ó ¸?ø¦i<¸ø¸?ü¦i<¸ø¸?©­ó ¸?Ö¯?2^1-¨§?5øL À"?¾k­ƒ?äh­ƒ¿fõL À"¿)\1-¨§¿z-{>Ö¯¿VKC³Œe³¿‹O\™'!¶¿Ý«ó ¸¿(¥i<¸ø¸¿-¥i<¸ø¸¿ê«ó ¸¿¢O\™'!¶¿tKC³Œe³¿Ä-{>Ö¯¿|\1-¨§¿öL À"¿kj­ƒ¿µõL À"¿ yÅ[g’µ¿{AðÒòƒÁ¿H+a’Ç¿x™n«é¸Ì¿ÒdWpbпŒh®9;ÇÑ¿ø½qb}Ò¿ü½qb}Ò¿–h®9;ÇÑ¿ ÒdWpb酪n«é¸Ì¿ÔH+a’Ç¿¹AðÒòƒÁ¿yÅ[g’µ¿æ÷L À"¿w\1-¨§¿†AðÒòƒÁ¿.£Œ‰q̿ʠ|¦#Ó¿ˆ#À=R׿d¡)f›Ú¿¥™uÌÞÜ¿>½,Þ¿C½,Þ¿!¥™uÌÞÜ¿¡)f›Ú¿¬#À=R׿ö |¦#Ó¿|.£Œ‰qÌ¿òAðÒòƒÁ¿;^1-¨§¿î-{>Ö¯¿²H+a’ǿР|¦#Ó¿G–åðÑÁÙ¿t\÷Ï—bß¿E{&ïLçá¿ û2¾+mã¿.ÒÐì3ä¿2ÒÐì3ä¿û2¾+mã¿W{&ïLçῤ\÷Ï—bß¿–åðÑÁÙ¿ |¦#Ó¿DI+a’Ç¿R0{>Ö¯¿¦KC³Œe³¿–™n«é¸Ì¿“#À=R׿y\÷Ï—bß¿¤4ã¿“X§‘ÄÐå¿ëzp„ӫ翞îÆGžè¿£îÆGžè¿øzp„ӫ翨X§‘ÄÐå¿À4ã¿À\÷Ï—bß¿å#À=R׿Gšn«é¸Ì¿MC³Œe³¿äO\™'!¶¿"ÒdWpbпq¡)f›Ú¿I{&ïLçá¿”X§‘ÄÐå¿G4לãè¿$L;›ë¿^— üèì¿c— üèì¿3L;›ë¿`4לã迵X§‘ÄÐå¿q{&ïLçá¿Î¡)f›Ú¿‡ÒdWpbпŒQ\™'!¶¿B¬ó ¸¿£h®9;ÇÑ¿#¥™uÌÞÜ¿û2¾+mã¿ðzp„Ó«ç¿(L;›ë¿¿P‡³Mí¿ìô”Ïyî¿òô”Ïyî¿ÏP‡³Mí¿CL;›ë¿{p„Ó«ç¿?û2¾+m㿈¥™uÌÞÜ¿i®9;ÇÑ¿®ó ¸¿™¥i<¸ø¸¿¾qb}Ò¿S½,Þ¿7ÒÐì3俦îÆGžè¿e— üèì¿îô”Ïyî¿P®ûçK±ï¿V®ûçK±ï¿ÿô”Ïyî¿€— üèì¿ÉîÆGžè¿cÒÐì3俾½,Þ¿€¾qb}Ò¿x§i<¸ø¸¿–¥i<¸ø¸¿O¬ó ¸¿üO\™'!¶¿½KC³Œe³¿4.{>Ö¯¿Ì\1-¨§¿jöL À"¿Zj­ƒ¿äh­ƒ?µõL À"?w\1-¨§?î-{>Ö¯?¦KC³Œe³?äO\™'!¶?B¬ó ¸?™¥i<¸ø¸?¾qb}Ò¿¬h®9;ÇÑ¿3ÒdWpbпÁ™n«é¸Ì¿çH+a’Ç¿ÂAðÒòƒÁ¿ŒyÅ[g’µ¿…÷L À"¿fõL À"? yÅ[g’µ?†AðÒòƒÁ?²H+a’Ç?–™n«é¸Ì?"ÒdWpbÐ?£h®9;ÇÑ?¾qb}Ò?X½,Þ¿4¥™uÌÞÜ¿Ž¡)f›Ú¿·#À=R׿û |¦#Ó¿z.£Œ‰qÌ¿æAðÒòƒÁ¿â]1-¨§¿)\1-¨§?{AðÒòƒÁ?.£Œ‰qÌ?Р|¦#Ó?“#À=R×?q¡)f›Ú?#¥™uÌÞÜ?S½,Þ?:ÒÐì3ä¿û2¾+mã¿\{&ïLçá¿©\÷Ï—bß¿–åðÑÁÙ¿  |¦#Ó¿,I+a’Ç¿Ë/{>Ö¯¿z-{>Ö¯?H+a’Ç?Ê |¦#Ó?G–åðÑÁÙ?y\÷Ï—bß?I{&ïLçá?û2¾+mã?7ÒÐì3ä?ªîÆGžè¿þzp„Ó«ç¿«X§‘ÄÐå¿Á4ã¿»\÷Ï—bß¿Ù#À=R׿%šn«é¸Ì¿¿LC³Œe³¿VKC³Œe³?x™n«é¸Ì?ˆ#À=R×?t\÷Ï—bß?¤4ã?”X§‘ÄÐå?ðzp„Ó«ç?¦îÆGžè?j— üèì¿8L;›ë¿b4לãè¿´X§‘ÄÐå¿n{&ïLçá¿À¡)f›Ú¿rÒdWpbп'Q\™'!¶¿‹O\™'!¶?ÒdWpbÐ?d¡)f›Ú?E{&ïLçá?“X§‘ÄÐå?G4לãè?(L;›ë?e— üèì?ôô”Ïyî¿ÏP‡³Mí¿@L;›ë¿{p„Ó«ç¿7û2¾+mã¿t¥™uÌÞÜ¿øh®9;ÇÑ¿›­ó ¸¿Ý«ó ¸?Œh®9;ÇÑ?¥™uÌÞÜ? û2¾+mã?ëzp„Ó«ç?$L;›ë?¿P‡³Mí?îô”Ïyî?W®ûçK±ï¿þô”Ïyî¿{— üèì¿ÄîÆGžè¿\ÒÐì3ä¿¥½,Þ¿h¾qb}Ò¿ø¦i<¸ø¸¿(¥i<¸ø¸?ø½qb}Ò?>½,Þ?.ÒÐì3ä?žîÆGžè?^— üèì?ìô”Ïyî?P®ûçK±ï?\®ûçK±ï¿õ”Ïyî¿€— üèì¿ÉîÆGžè¿_ÒÐì3ä¿«½,Þ¿k¾qb}Ò¿ü¦i<¸ø¸¿-¥i<¸ø¸?ü½qb}Ò?C½,Þ?2ÒÐì3ä?£îÆGžè?c— üèì?òô”Ïyî?V®ûçK±ï?õ”Ïyî¿ßP‡³Mí¿OL;›ë¿{p„Ó«ç¿Bû2¾+mã¿„¥™uÌÞÜ¿i®9;ÇÑ¿©­ó ¸¿ê«ó ¸?–h®9;ÇÑ?!¥™uÌÞÜ?û2¾+mã?øzp„Ó«ç?3L;›ë?ÏP‡³Mí?ÿô”Ïyî?…— üèì¿RL;›ë¿z4לãè¿ÉX§‘ÄÐå¿{&ïLçá¿Û¡)f›Ú¿‚ÒdWpbп֯¿Ä-{>Ö¯?ÔH+a’Ç?ö |¦#Ó?–åðÑÁÙ?À\÷Ï—bß?q{&ïLçá??û2¾+mã?cÒÐì3ä?Ľ,Þ¿˜¥™uÌÞÜ¿ê¡)f›Ú¿$À=R׿= |¦#Ó¿Ý.£Œ‰qÌ¿#BðÒòƒÁ¿2^1-¨§¿|\1-¨§?¹AðÒòƒÁ?|.£Œ‰qÌ? |¦#Ó?å#À=R×?Ρ)f›Ú?ˆ¥™uÌÞÜ?¾½,Þ?‚¾qb}Ò¿i®9;ÇÑ¿–ÒdWpbпpšn«é¸Ì¿xI+a’Ç¿.BðÒòƒÁ¿zÅ[g’µ¿5øL À"¿öL À"?yÅ[g’µ?òAðÒòƒÁ?DI+a’Ç?Gšn«é¸Ì?‡ÒdWpbÐ?i®9;ÇÑ?€¾qb}Ò?r§i<¸ø¸¿®ó ¸¿ Q\™'!¶¿.MC³Œe³¿’0{>Ö¯¿^1-¨§¿øL À"¿¾k­ƒ¿jj­ƒ?æ÷L À"?;^1-¨§?R0{>Ö¯?MC³Œe³?ŒQ\™'!¶?®ó ¸?x§i<¸ø¸?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?8i­ƒ?ÛõL À"?‰\1-¨§?ü-{>Ö¯?¥KC³Œe³?æO\™'!¶?>¬ó ¸?¥i<¸ø¸?‘¥i<¸ø¸?K¬ó ¸?ûO\™'!¶?ÁKC³Œe³?B.{>Ö¯?ß\1-¨§?ŠöL À"?½j­ƒ?ÛõL À"?&yÅ[g’µ?“AðÒòƒÁ?½H+a’Ç?ž™n«é¸Ì?%ÒdWpbÐ?£h®9;ÇÑ?¾qb}Ò?¾qb}Ò?­h®9;ÇÑ?5ÒdWpbÐ?È™n«é¸Ì?ñH+a’Ç?ÓAðÒòƒÁ?§yÅ[g’µ?øL À"?‰\1-¨§?“AðÒòƒÁ?-.£Œ‰qÌ?Ø |¦#Ó?š#À=R×?y¡)f›Ú?&¥™uÌÞÜ?T½,Þ?Y½,Þ?6¥™uÌÞÜ?’¡)f›Ú?¼#À=R×? |¦#Ó?•.£Œ‰qÌ?üAðÒòƒÁ?\^1-¨§?ü-{>Ö¯?½H+a’Ç?Ø |¦#Ó?R–åðÑÁÙ?ƒ\÷Ï—bß?N{&ïLçá?û2¾+mã?8ÒÐì3ä?;ÒÐì3ä?û2¾+mã?_{&ïLçá?±\÷Ï—bß?‹–åðÑÁÙ? |¦#Ó?JI+a’Ç?p0{>Ö¯?¥KC³Œe³?ž™n«é¸Ì?š#À=R×?ƒ\÷Ï—bß?«4ã?›X§‘ÄÐå?ózp„Ó«ç?§îÆGžè?«îÆGžè?{p„Ó«ç?°X§‘ÄÐå?Æ4ã?É\÷Ï—bß?ð#À=R×?Jšn«é¸Ì?$MC³Œe³?æO\™'!¶?%ÒdWpbÐ?y¡)f›Ú?N{&ïLçá?›X§‘ÄÐå?O4לãè?,L;›ë?g— üèì?k— üèì?;L;›ë?g4לãè?ºX§‘ÄÐå?v{&ïLçá?Ú¡)f›Ú?‡ÒdWpbÐ?šQ\™'!¶?>¬ó ¸?£h®9;ÇÑ?&¥™uÌÞÜ?û2¾+mã?ózp„Ó«ç?,L;›ë?ÁP‡³Mí?ðô”Ïyî?õô”Ïyî?ÒP‡³Mí?FL;›ë?{p„Ó«ç?@û2¾+mã?¥™uÌÞÜ?i®9;ÇÑ?®ó ¸?¥i<¸ø¸?¾qb}Ò?T½,Þ?8ÒÐì3ä?§îÆGžè?g— üèì?ðô”Ïyî?S®ûçK±ï?X®ûçK±ï?õ”Ïyî?— üèì?ËîÆGžè?eÒÐì3ä?½,Þ?€¾qb}Ò?z§i<¸ø¸?‘¥i<¸ø¸?¾qb}Ò?Y½,Þ?;ÒÐì3ä?«îÆGžè?k— üèì?õô”Ïyî?X®ûçK±ï?]®ûçK±ï?õ”Ïyî?†— üèì?ÏîÆGžè?hÒÐì3ä?ǽ,Þ?‚¾qb}Ò?~§i<¸ø¸?K¬ó ¸?­h®9;ÇÑ?6¥™uÌÞÜ?û2¾+mã?{p„Ó«ç?;L;›ë?ÒP‡³Mí?õ”Ïyî?õ”Ïyî?âP‡³Mí?UL;›ë?"{p„Ó«ç?Jû2¾+mã?Ÿ¥™uÌÞÜ?i®9;ÇÑ?%®ó ¸?ûO\™'!¶?5ÒdWpbÐ?’¡)f›Ú?_{&ïLçá?°X§‘ÄÐå?g4לãè?FL;›ë?— üèì?†— üèì?UL;›ë?4לãè?ÏX§‘ÄÐå?‡{&ïLçá?ó¡)f›Ú?—ÒdWpbÐ?¯Q\™'!¶?ÁKC³Œe³?È™n«é¸Ì?¼#À=R×?±\÷Ï—bß?Æ4ã?ºX§‘ÄÐå?{p„Ó«ç?ËîÆGžè?ÏîÆGžè?"{p„Ó«ç?ÏX§‘ÄÐå?â4ã?ö\÷Ï—bß?$À=R×?tšn«é¸Ì?@MC³Œe³?B.{>Ö¯?ñH+a’Ç? |¦#Ó?‹–åðÑÁÙ?É\÷Ï—bß?v{&ïLçá?@û2¾+mã?eÒÐì3ä?hÒÐì3ä?Jû2¾+mã?‡{&ïLçá?ö\÷Ï—bß?Ä–åðÑÁÙ?I |¦#Ó?~I+a’Ç?¶0{>Ö¯?ß\1-¨§?ÓAðÒòƒÁ?•.£Œ‰qÌ? |¦#Ó?ð#À=R×?Ú¡)f›Ú?¥™uÌÞÜ?½,Þ?ǽ,Þ?Ÿ¥™uÌÞÜ?ó¡)f›Ú?$À=R×?I |¦#Ó?ü.£Œ‰qÌ?Ö¯?$MC³Œe³?šQ\™'!¶?®ó ¸?z§i<¸ø¸?~§i<¸ø¸?%®ó ¸?¯Q\™'!¶?@MC³Œe³?¶0{>Ö¯?²^1-¨§?ÈøL À"?Al­ƒ?‰«*Z‚Þ?6ÊIÁ]Ü?æî´±EØ?3›¾Ø§Ò?ë‹MeoÉ?Ñ‹|ô†»?ª2Ú ô¥?»¨Ÿ˜m_‚?[¶ACïùp?;—N^»™ž?r ÷]ë·?\§|ÌÙ=È?PCæ@ÒJÒ?œÖâµTØ?ÖŠ7>Ü?nŒ«*Z‚Þ?˜ç„7>Ü?-±/×ÖÚ?Êw¨œÐæÕ?s5,sZÐ?Ü~†ÿ›Ä? RL-в?”@·*™Ês?ŒŽs ¿´‰`àw¢¿,ç}ép¿@*·H#°?bWG‡^’Ã?ð#®æÐ?WØ“8s¼Õ?¬¥/×ÖÚ?*ÂÄIÁ]Ü?râµTØ?r¸”8s¼Õ?RPü²ÃˆÑ?ª¦Ùœ¶øÇ?U‚•P¹·?Îmƒ% r?…Ðß_a°¿H@?±q乿ýÆ–¦º¿•†Å(ØÙ±¿¶-s†,W¿¦Æyžg¶?jµqñ’ŸÇ?ÊFü²ÃˆÑ?¼A©œÐæÕ?Ûþí´±EØ? öñ@ÒJÒ?(-(®æÐ?ȤàÈ¿H¾÷Æ–¦º¿úÜî_àw¢¿WüvFïùp?‚áÙ ô¥?¸m *™Ês?YHß_a°¿Äzú¬]»™ž?IbLô†»?LçCL-в?xF% r?!¬Ù¬µ¿}¿„Ô†+Ç¿ïœEvÎCÑ¿8¼ªÕ¿–((:p÷׿ |‡™žç׿¢è"ˆã˜Õ¿HœEvÎCÑ¿÷PÒ÷LÇ¿ØƒØ lr¶¿èt†,W¿Æ ·H#°?Z÷Æ]ë·?4›MeoÉ? ‹ÿ›Ä?ù1•P¹·? ù”F¤'l?ÿ¼JÚ·¿N6Ò÷LÇ¿6õÐ+п¶éF_çYÒ¿| Õ á@Ò¿ ë¾õÞÏ¿àŸ„Ô†+ǿƳJÚ·¿œy§Ë²R?ú£|žg¶?L‡^’Ã? ŒÌÙ=È?˦¾Ø§Ò?q™9,sZÐ?ž Üœ¶øÇ?ó"N¹? íû¦Ë²R?š‘× lr¶¿é&“µà Ä¿3¥àÈ¿ÜòéaGÈ¿žJúÜ?qŒ«*Z‚Þ?îŠ7>Ü?ÂÖâµTØ?~Cæ@ÒJÒ?´§|ÌÙ=È?ô ÷]ë·?>˜N^»™ž?|µACïùp?®¥Ÿ˜m_‚?D2Ú ô¥?íŠ|ô†»?Œê‹MeoÉ?Å2›¾Ø§Ò?çåî´±EØ?ÊIÁ]Ü?x«*Z‚Þ?ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_4/Level_0/0000755000175000017500000000000011634153073023313 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_4/Level_0/Cell_H0000644000175000017500000000034511634153073024366 0ustar amckinstryamckinstry1 0 5 0 (1 0 ((0,0) (15,15) (0,0)) ) 1 FabOnDisk: Cell_D_0000 0 1,5 -0.961939766255645,-0.961939766255644,1,-0.961939766255644,-0.441515650552359, 1,5 0.961939766255644,0.961939766255645,1,0.952698064816852,0.432150840144369, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_4/Level_0/Cell_D_00000000644000175000017500000002412211634153073025020 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (15,15) (0,0)) 5 ѽ»÷¥AÈ¿)" IÄ¿à–¯g÷z»¿#A´L£¿š•k†¡|£?ÆEÍ¢5¿»?'ÎO&ZÃÄ?X©®¦â}È?a©®¦â}È?@ÎO&ZÃÄ?FÍ¢5¿»?J–k†¡|£?v@´L£¿––¯g÷z»¿" IĿȽ»÷¥AÈ¿²_æCåDá¿3ÆÚeµGÝ¿pÏìxÓ¿ —¯g÷z»¿šEÍ¢5¿»?8«¨¬ÁÓ?02ÏkÝ?8HëÜÇoá?>HëÜÇoá?U2ÏkÝ?m«¨¬ÁÓ?—FÍ¢5¿»?–¯g÷z»¿<ÏìxÓ¿ÆÚeµGÝ¿¬_æCåDá¿XÓäxVØé¿ Æìqéå¿>ÆÚeµGÝ¿P" IÄ¿ÿÍO&ZÃÄ?&2ÏkÝ?Jª«©xæ?€äØ…ê?‰äØ…ê?eª«©xæ?v2ÏkÝ?¼ÎO&ZÃÄ?–" IÄ¿ðÅÚeµGÝ¿†Æìqéå¿OÓäxVØé¿F:릀|î¿^ÓäxVØé¿¼_æCåD῾»÷¥AÈ¿$©®¦â}È?/HëÜÇoá?{䨅ê?œF™ç5Èî?§F™ç5Èî?›äØ…ê?^HëÜÇoá?ª®¦â}È?+½»÷¥AÈ¿Ž_æCåDá¿?ÓäxVØé¿;:릀|î¿§F™ç5Èî¿äØ…ê¿HHëÜÇoá¿”©®¦â}È¿½»÷¥AÈ?¨_æCåDá?RÓäxVØé?F:릀|î?Q:릀|î?rÓäxVØé?×_æCåDá?¾»÷¥AÈ?¬¨®¦â}È¿HëÜÇoá¿mäØ…ê¿›F™ç5Èî¿”äØ…ê¿dª«©xæ¿^2ÏkÝ¿fÎO&ZÃÄ¿" IÄ?)ÆÚeµGÝ? Æìqéå?dÓäxVØé?mÓäxVØé?¼Æìqéå?zÆÚeµGÝ?Á" IÄ?£ÍO&ZÃÄ¿ 2ÏkÝ¿Gª«©x濊䨅ê¿RHëÜÇoá¿i2ÏkÝ¿l«¨¬ÁÓ¿:FÍ¢5¿»¿µ–¯g÷z»?qÏìxÓ?LÆÚeµGÝ?È_æCåDá?Î_æCåDá?pÆÚeµGÝ?¨ÏìxÓ?·—¯g÷z»?5EÍ¢5¿»¿3«¨¬ÁÓ¿C2ÏkÝ¿KHëÜÇoá¿Ì©®¦â}È¿’ÎO&ZÃÄ¿hFÍ¢5¿»¿H–k†¡|£¿)A´L£?>—¯g÷z»?" IÄ?B¾»÷¥AÈ?K¾»÷¥AÈ?˜" IÄ?Š—¯g÷z»?ÝA´L£?‘•k†¡|£¿FÍ¢5¿»¿wÎO&ZÃĿ鮦â}ȿꨮ¦â}È?ÒÍO&ZÃÄ?iEÍ¢5¿»?••k†¡|£?v@´L£¿@–¯g÷z»¿Â" IÄ¿b½»÷¥AÈ¿l½»÷¥AÈ¿Ü" IÄ¿Ž–¯g÷z»¿.A´L£¿Ú”k†¡|£?EÍ¢5¿»?·ÍO&ZÃÄ?ᨮ¦â}È?#HëÜÇoá?2ÏkÝ?6«¨¬ÁÓ?íEÍ¢5¿»?i–¯g÷z»¿;ÏìxÓ¿úÅÚeµGÝ¿˜_æCåD῟_æCåDá¿ÆÚeµGÝ¿rÏìxÓ¿l—¯g÷z»¿æDÍ¢5¿»?þª¨¬ÁÓ?òŒ2ÏkÝ?HëÜÇoá?t䨅ê?Iª«©xæ?:2ÏkÝ?LÎO&ZÃÄ?è" IÄ¿ÆÚeµGÝ¿…Æìqéå¿BÓäxVØé¿MÓäxVØé¿ŸÆìqéå¿VÆÚeµGÝ¿ª" IÄ¿‡ÍO&ZÃÄ?åŒ2ÏkÝ?-ª«©xæ?j䨅ê?œF™ç5Èî?†äØ…ê?BHëÜÇoá?Š©®¦â}È?–½»÷¥AÈ¿¡_æCåDá¿IÓäxVØé¿::릀|î¿F:릀|î¿hÓäxVØé¿Ò_æCåDá¿y¾»÷¥AÈ¿ ¨®¦â}È?HëÜÇoá?d䨅ê?F™ç5Èî?R:릀|î?gÓäxVØé?Â_æCåDá? ¾»÷¥AÈ?.©®¦â}È¿4HëÜÇoá¿„äØ…ê¿§F™ç5ÈF™ç5È䨅ê¿dHëÜÇoῪ®¦â}È¿0½»÷¥AÈ?”_æCåDá?HÓäxVØé?G:릀|î?vÓäxVØé?ºÆìqéå?aÆÚeµGÝ?g" IÄ?ÎO&ZÃÄ¿L2ÏkÝ¿fª«©xæ¿¡äØ…ê¿«äØ…꿪«©x濜2ÏkÝ¿ØÎO&ZÃÄ¿¬" IÄ?ÆÚeµGÝ? Æìqéå?mÓäxVØé?à_æCåDá?‚ÆÚeµGÝ?¥ÏìxÓ?S—¯g÷z»?êEÍ¢5¿»¿p«¨¬ÁÓ¿…2ÏkÝ¿jHëÜÇoá¿pHëÜÇoῪ2ÏkÝ¿¦«¨¬ÁÓ¿çFÍ¢5¿»¿X–¯g÷z»?pÏìxÓ?_ÆÚeµGÝ?Û_æCåDá?­¾»÷¥AÈ?ã" IÄ?Ø—¯g÷z»?ÓA´L£?U–k†¡|£¿ÔFÍ¢5¿»¿ñÎO&ZÃÄ¿Fª®¦â}È¿Oª®¦â}È¿ ÏO&ZÃÄ¿GÍ¢5¿»¿—k†¡|£¿ A´L£?Œ—¯g÷z»?Ê" IÄ?¤¾»÷¥AÈ?ѽ»÷¥AÈ?²_æCåDá?XÓäxVØé?F:릀|î?§F™ç5Èî?”䨅ê?RHëÜÇoá?Ì©®¦â}È?ꨮ¦â}È¿#HëÜÇoá¿t䨅꿜F™ç5Èî¿R:릀|î¿vÓäxVØé¿à_æCåDá¿­¾»÷¥AÈ¿)" IÄ?3ÆÚeµGÝ? Æìqéå?^ÓäxVØé?䨅ê?dª«©xæ?i2ÏkÝ?’ÎO&ZÃÄ?ÒÍO&ZÃÄ¿2ÏkÝ¿Iª«©x濆䨅ê¿gÓäxVØé¿»Æìqéå¿‚ÆÚeµGÝ¿ã" IÄ¿à–¯g÷z»?pÏìxÓ?>ÆÚeµGÝ?¼_æCåDá?HHëÜÇoá?^2ÏkÝ?l«¨¬ÁÓ?hFÍ¢5¿»?iEÍ¢5¿»¿6«¨¬ÁÓ¿:2ÏkÝ¿BHëÜÇoá¿Â_æCåDá¿aÆÚeµGÝ¿¥ÏìxÓ¿Ù—¯g÷z»¿"A´L£? —¯g÷z»?P" IÄ?¾»÷¥AÈ?”©®¦â}È?fÎO&ZÃÄ?:FÍ¢5¿»?H–k†¡|£?”•k†¡|£¿íEÍ¢5¿»¿LÎO&ZÃÄ¿Š©®¦â}È¿ ¾»÷¥AÈ¿g" IÄ¿T—¯g÷z»¿ÔA´L£¿™•k†¡|£¿šEÍ¢5¿»¿ÿÍO&ZÃÄ¿$©®¦â}È¿œ½»÷¥AÈ¿" IÄ¿µ–¯g÷z»¿*A´L£¿w@´L£?h–¯g÷z»?è" IÄ?–½»÷¥AÈ?.©®¦â}È?ÎO&ZÃÄ?êEÍ¢5¿»?V–k†¡|£?ÆEÍ¢5¿»¿8«¨¬ÁÓ¿&2ÏkÝ¿/HëÜÇoῨ_æCåDá¿)ÆÚeµGÝ¿qÏìxÓ¿>—¯g÷z»¿@–¯g÷z»?;ÏìxÓ?ÆÚeµGÝ?¡_æCåDá?4HëÜÇoá?L2ÏkÝ?p«¨¬ÁÓ?ÔFÍ¢5¿»?'ÎO&ZÃÄ¿02ÏkÝ¿Jª«©xæ¿{䨅ê¿RÓäxVØé¿¡Æìqéå¿LÆÚeµGÝ¿" IÄ¿Â" IÄ?úÅÚeµGÝ?…Æìqéå?IÓäxVØé?„䨅ê?fª«©xæ?…2ÏkÝ?ñÎO&ZÃÄ?X©®¦â}È¿8HëÜÇoá¿€äØ…꿜F™ç5Èî¿F:릀|î¿dÓäxVØé¿È_æCåDá¿C¾»÷¥AÈ¿b½»÷¥AÈ?˜_æCåDá?DÓäxVØé?::릀|î?§F™ç5Èî?¡äØ…ê?jHëÜÇoá?Fª®¦â}È?a©®¦â}È¿>HëÜÇoΈäØ…ê¿§F™ç5Èî¿Q:릀|î¿mÓäxVØé¿Î_æCåDá¿K¾»÷¥AÈ¿l½»÷¥AÈ?Ÿ_æCåDá?MÓäxVØé?F:릀|î?±F™ç5Èî?«äØ…ê?pHëÜÇoá?Oª®¦â}È?@ÎO&ZÃÄ¿U2ÏkÝ¿eª«©xæ¿›äØ…ê¿rÓäxVØé¿¼Æìqéå¿oÆÚeµGÝ¿˜" IÄ¿Ü" IÄ?ÆÚeµGÝ?ŸÆìqéå?hÓäxVØé?¤äØ…ê?ª«©xæ?ª2ÏkÝ? ÏO&ZÃÄ?FÍ¢5¿»¿m«¨¬ÁÓ¿v2ÏkÝ¿^HëÜÇoá¿Ø_æCåDá¿zÆÚeµGÝ¿§ÏìxÓ¿Š—¯g÷z»¿Ž–¯g÷z»?rÏìxÓ?TÆÚeµGÝ?Ñ_æCåDá?dHëÜÇoá?œ2ÏkÝ?¦«¨¬ÁÓ?GÍ¢5¿»?J–k†¡|£¿—FÍ¢5¿»¿¼ÎO&ZÃÄ¿ª®¦â}È¿¾»÷¥AÈ¿Á" IÄ¿·—¯g÷z»¿ÜA´L£¿.A´L£?l—¯g÷z»?ª" IÄ?y¾»÷¥AÈ?ª®¦â}È?ØÎO&ZÃÄ?çFÍ¢5¿»?—k†¡|£?u@´L£?–¯g÷z»?•" IÄ?*½»÷¥AÈ?¬¨®¦â}È?£ÍO&ZÃÄ?5EÍ¢5¿»?•k†¡|£?Û”k†¡|£¿æDÍ¢5¿»¿‡ÍO&ZÃÄ¿ ¨®¦â}È¿0½»÷¥AÈ¿¬" IÄ¿X–¯g÷z»¿ A´L£¿––¯g÷z»?;ÏìxÓ?ðÅÚeµGÝ?Ž_æCåDá?HëÜÇoá? 2ÏkÝ?3«¨¬ÁÓ?FÍ¢5¿»?EÍ¢5¿»¿þª¨¬ÁÓ¿åŒ2ÏkÝ¿HëÜÇoá¿”_æCåDá¿ÆÚeµGÝ¿pÏìxÓ¿Ž—¯g÷z»¿" IÄ?ÆÚeµGÝ?†Æìqéå??ÓäxVØé?m䨅ê?Gª«©xæ?C2ÏkÝ?wÎO&ZÃÄ?·ÍO&ZÃÄ¿óŒ2ÏkÝ¿-ª«©xæ¿d䨅ê¿HÓäxVØé¿ Æìqéå¿_ÆÚeµGÝ¿Ê" IĿȽ»÷¥AÈ?¬_æCåDá?OÓäxVØé?::릀|î?›F™ç5Èî?ŠäØ…ê?KHëÜÇoá?鮦â}È?ᨮ¦â}È¿HëÜÇoá¿j䨅ê¿F™ç5Èî¿G:릀|î¿mÓäxVØé¿Ú_æCåDῤ¾»÷¥AÈ¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?I:릀|î?`ÓäxVØé?¾_æCåDá?¾»÷¥AÈ?#©®¦â}È¿0HëÜÇoá¿}䨅꿟F™ç5ÈF™ç5È䨅ê¿_HëÜÇoá¿ ª®¦â}È¿1½»÷¥AÈ?_æCåDá?AÓäxVØé?>:릀|î?`ÓäxVØé?§Æìqéå?HÆÚeµGÝ?W" IÄ?ÎO&ZÃÄ¿02ÏkÝ¿Pª«©x濈äØ…ê¿‘äØ…ê¿lª«©xæ¿€2ÏkÝ¿ÇÎO&ZÃÄ¿ " IÄ?úÅÚeµGÝ?ŒÆìqéå?WÓäxVØé?¾_æCåDá?HÆÚeµGÝ?~ÏìxÓ?—¯g÷z»?©EÍ¢5¿»¿F«¨¬ÁÓ¿D2ÏkÝ¿DHëÜÇoá¿JHëÜÇoá¿i2ÏkÝ¿{«¨¬ÁÓ¿±FÍ¢5¿»¿*–¯g÷z»?JÏìxÓ?%ÆÚeµGÝ?¸_æCåDá?¾»÷¥AÈ?W" IÄ?—¯g÷z»?NA´L£?•k†¡|£¿FÍ¢5¿»¿UÎO&ZÃÄ¿©®¦â}È¿˜©®¦â}È¿oÎO&ZÃÄ¿PFÍ¢5¿»¿{–k†¡|£¿£@´L£?Ô–¯g÷z»?>" IÄ?ÿ½»÷¥AÈ?#©®¦â}È¿ÎO&ZÃÄ¿©EÍ¢5¿»¿Â•k†¡|£¿ž@´L£?x–¯g÷z»?ì" IÄ?”½»÷¥AÈ?œ½»÷¥AÈ?" IÄ?Æ–¯g÷z»?TA´L£? •k†¡|£¿ZEÍ¢5¿»¿çÍO&ZÃÄ¿©®¦â}È¿0HëÜÇoá¿02ÏkÝ¿F«¨¬ÁÓ¿FÍ¢5¿»¿x–¯g÷z»?FÏìxÓ? ÆÚeµGÝ?¢_æCåDá?©_æCåDá?/ÆÚeµGÝ?~ÏìxÓ?|—¯g÷z»?þDÍ¢5¿»¿ «¨¬ÁÓ¿ 2ÏkÝ¿)HëÜÇoá¿}䨅ê¿Pª«©xæ¿D2ÏkÝ¿UÎO&ZÃÄ¿ì" IÄ? ÆÚeµGÝ?ŒÆìqéå?LÓäxVØé?UÓäxVØé?¦Æìqéå?`ÆÚeµGÝ?­" IÄ?ÍO&ZÃÄ¿ïŒ2ÏkÝ¿4ª«©xæ¿r䨅꿟F™ç5È䨅ê¿DHëÜÇoá¿©®¦â}È¿“½»÷¥AÈ?¢_æCåDá?LÓäxVØé?=:릀|î?H:릀|î?jÓäxVØé?Ó_æCåDá?y¾»÷¥AÈ?§¨®¦â}È¿HëÜÇoá¿gäØ…ê¿’F™ç5ÈF™ç5Èî¿‘äØ…ê¿JHëÜÇoῘ©®¦â}È¿œ½»÷¥AÈ?©_æCåDá?UÓäxVØé?H:릀|î?R:릀|î?rÓäxVØé?Ù_æCåDá?¾»÷¥AÈ?¯¨®¦â}È¿HëÜÇoá¿p䨅ê¿F™ç5È䨅ê¿lª«©xæ¿i2ÏkÝ¿oÎO&ZÃÄ¿" IÄ?/ÆÚeµGÝ?¦Æìqéå?jÓäxVØé?tÓäxVØé?ÀÆìqéå?‚ÆÚeµGÝ?Æ" IÄ?ªÍO&ZÃÄ¿2ÏkÝ¿Pª«©xæ¿“äØ…ê¿_HëÜÇoá¿€2ÏkÝ¿{«¨¬ÁÓ¿PFÍ¢5¿»¿Æ–¯g÷z»?~ÏìxÓ?`ÆÚeµGÝ?Ó_æCåDá?Ù_æCåDá?‚ÆÚeµGÝ?´ÏìxÓ?Ê—¯g÷z»?IEÍ¢5¿»¿C«¨¬ÁÓ¿Z2ÏkÝ¿XHëÜÇoá¿ ª®¦â}È¿ÇÎO&ZÃÄ¿±FÍ¢5¿»¿{–k†¡|£¿TA´L£?|—¯g÷z»?­" IÄ?y¾»÷¥AÈ?¾»÷¥AÈ?Æ" IÄ?Ê—¯g÷z»? B´L£?•k†¡|£¿aFÍ¢5¿»¿­ÎO&ZÃÄ¿ª®¦â}È¿1½»÷¥AÈ? " IÄ?*–¯g÷z»?¤@´L£? •k†¡|£¿þDÍ¢5¿»¿ÍO&ZÃÄ¿§¨®¦â}È¿¯¨®¦â}È¿ªÍO&ZÃÄ¿IEÍ¢5¿»¿Â•k†¡|£¿ø?´L£?à•¯g÷z»?ˆ" IÄ?(½»÷¥AÈ?_æCåDá?úÅÚeµGÝ?IÏìxÓ?Ô–¯g÷z»?ZEÍ¢5¿»¿ «¨¬ÁÓ¿ïŒ2ÏkÝ¿HëÜÇoá¿HëÜÇoá¿2ÏkÝ¿C«¨¬ÁÓ¿aFÍ¢5¿»¿á•¯g÷z»?ÏìxÓ?ÖÅÚeµGÝ?Š_æCåDá?AÓäxVØé?ŒÆìqéå?%ÆÚeµGÝ?>" IÄ?çÍO&ZÃÄ¿ 2ÏkÝ¿4ª«©xæ¿g䨅ê¿p䨅ê¿Pª«©xæ¿Z2ÏkÝ¿­ÎO&ZÃÄ¿ˆ" IÄ?ÖÅÚeµGÝ?rÆìqéå?7ÓäxVØé?>:릀|î?VÓäxVØé?¸_æCåDá?þ½»÷¥AÈ?©®¦â}È¿)HëÜÇoá¿räØ…ê¿’F™ç5Èî¿F™ç5Èî¿“äØ…ê¿XHëÜÇoῪ®¦â}È¿(½»÷¥AÈ?Š_æCåDá?8ÓäxVØé?3:릀|î?£GœßÛ¿¥o˜Ó¿‹â¤býŸ¿¿žU|ø]îr¿¨É³—‚8…¿Cýƶ±Á¿ŠÜؘÇ`Ô¿0ØòÛÊAÜ¿ÎÙòÛÊAÜ¿nÏ"Ô¿Œ¦» ¿TÀ¿ áÊ7DO?¨n-"c?SàC¿ ¿¿±$nWÕÓ¿§GœßÛ¿ó8nWÕÓ¿Ø DLÆ¿Ð'Tí.ˆ?e5 ,¾?Nýb­M¼?Ц' p‘¿xÊC%îìÈ¿â"Ô¿ç÷ؘÇ`Ô¿eáC%îìȿŽëbŠ&x¿¼gÇì ©¿?lËT_¾SÀ?0xª9}n?½ DLÆ¿f„˜Ó¿üD¿ ¿¿!·®9}n?šÏsÖÆ?6ÜžzÚ^Ó?]õ¡2éoÓ?ýòG}«Æ?(®ÏbŠ&x¿,¼ ¿TÀ¿k¶ýƶ±Á¿œ" p‘¿íËG}«Æ?8Ñ„šÓ?å&n˜Ó?tÀsÖÆ?ôií.ˆ?²¦býŸ¿¿°5ž!c?J2X_¾SÀ?é©&n˜Ó?´šÞœÛ?¤ùVÿ[¨Û?$öšÓ? ºÎì ©¿?À½w7DO?‡ Ù—‚8…¿`öc­M¼?möœ2éoÓ?óëVÿ[¨Û?ð´šÞœÛ?V‡šzÚ^Ó?äù; ,¾?þ;Ãø]îr¿@ãw7DO?ƒºÎì ©¿?öšÓ?¤ùVÿ[¨Û?´šÞœÛ?ª&n˜Ó?2X_¾SÀ?A7ž!c? EÃø]îr¿Âø; ,¾?‡šzÚ^Ó?Õ´šÞœÛ?ìVÿ[¨Û?Ãöœ2éoÓ?Ñ÷c­M¼?Ù—‚8…¿Ñ+¼ ¿TÀ¿­ÏbŠ&x¿øòG}«Æ?eõ¡2éoÓ?RÜžzÚ^Ó?ðÏsÖÆ?ÄÍ®9}n?°ûD¿ ¿¿ä¦býŸ¿¿ fí.ˆ?ÀsÖÆ?òä&n˜Ó?fÑ„šÓ?±ÌG}«Æ?B{" p‘¿éµýƶ±Á¿â"Ô¿tÊC%îìȿ֦' p‘¿^ýb­M¼?te5 ,¾?ãVí.ˆ?p DLÆ¿È8nWÕÓ¿c„˜Ó¿ DLÆ¿€[ª9}n?FËT_¾SÀ?ihÇì ©¿?2wëbŠ&x¿¢àC%îìÈ¿¯÷ؘÇ`Ô¿.ØòÛÊAÜ¿œÜؘÇ`Ô¿~ýƶ±Á¿Ô̳—‚8…¿‹V|ø]îr¿0â¤býŸ¿¿|o˜Ó¿vGœßÛ¿¤GœßÛ¿ì$nWÕÓ¿‚áC¿ ¿¿PY-"c?˜Ë7DO?ø¥» ¿TÀ¿Ï"Ô¿¦ÙòÛÊAÜ¿ÒÙòÛÊAÜ¿fÏ"Ô¿¦» ¿TÀ¿²Ê7DO?,Y-"c? áC¿ ¿¿Î$nWÕÓ¿£GœßÛ¿ŸGœßÛ¿Ào˜Ó¿@ã¤býŸ¿¿5`|ø]îr¿R̳—‚8…¿9ýƶ±Á¿yÜØ˜Ç`Ô¿.ØòÛÊAÜ¿ö÷ؘÇ`Ô¿oáC%îìÈ¿`ëbŠ&x¿`gÇì ©¿?ËT_¾SÀ?ð\ª9}n? DLÆ¿~„˜Ó¿9nWÕÓ¿8 DLÆ¿À·Pí.ˆ?fd5 ,¾?ýb­M¼?h¦' p‘¿iÊC%îìÈ¿#â"Ô¿v¶ýƶ±Á¿Ž" p‘¿îËG}«Æ?'Ñ„šÓ?Ûä&n˜Ó?ÀsÖÆ?¤fí.ˆ?Y¦býŸ¿¿ÌüD¿ ¿¿P›®9}n?,ÏsÖÆ?ÜžzÚ^Ó?Oõ¡2éoÓ?óG}«Æ?«ÏbŠ&x¿,¼ ¿TÀ¿Ù—‚8…¿·öc­M¼?€öœ2éoÓ?ôëVÿ[¨Û?Ø´šÞœÛ?2‡šzÚ^Ó?5ù; ,¾?´šÞœÛ?3ª&n˜Ó?â2X_¾SÀ?Nž!c?(¦býŸ¿¿*jí.ˆ?wÀsÖÆ?å&n˜Ó?}Ñ„šÓ?ºÌG}«Æ?F{" p‘¿Üµýƶ±Á¿Æ+¼ ¿TÀ¿€­ÏbŠ&x¿óG}«Æ?}õ¡2éoÓ?€ÜžzÚ^Ó?hÐsÖÆ?²ê®9}n?îúD¿ ¿¿F„˜Ó¿¸ DLÆ¿Àxª9}n?©ËT_¾SÀ?âhÇì ©¿?uëbŠ&x¿˜àC%îìÈ¿÷ؘÇ`Ô¿úá"Ô¿rÊC%îìÈ¿T¦' p‘¿Òýb­M¼?9f5 ,¾?Zí.ˆ?  DLÆ¿ª8nWÕÓ¿¦GœßÛ¿Î$nWÕÓ¿ÄàC¿ ¿¿ˆp-"c?p>Ë7DO?÷¥» ¿TÀ¿%Ï"Ô¿¢ÙòÛÊAÜ¿-ØòÛÊAÜ¿¦ÜؘÇ`Ô¿~ýƶ±Á¿ŽÉ³—‚8…¿!K|ø]îr¿pá¤býŸ¿¿^o˜Ó¿xGœßÛ¿ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_5/0000755000175000017500000000000011634153073022026 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_5/Header0000644000175000017500000000056211634153073023144 0ustar amckinstryamckinstryNavierStokes-V1.1 5 x_velocity y_velocity density tracer avg_pressure 2 0 1 0 0 2 2 2 ((0,0) (31,31) (0,0)) ((0,0) (63,63) (0,0)) 0 0 0.0625 0.0625 0.03125 0.03125 0 0 0 1 0 0 0 2 0 2 Level_0/Cell 1 7 0 0 0 0.3125 0 0.3125 0 0.3125 1.3125 1.5 1.5625 2 1.25 1.5625 0 0.3125 0.9375 1.1875 1.5625 2 1 1.125 1.5625 2 0.6875 0.9375 0 0.3125 0.4375 0.6875 Level_1/Cell ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_5/Level_1/0000755000175000017500000000000011634153073023315 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_5/Level_1/Cell_H0000644000175000017500000000267211634153073024375 0ustar amckinstryamckinstry1 0 5 0 (7 0 ((0,0) (9,9) (0,0)) ((0,42) (9,47) (0,0)) ((50,40) (63,49) (0,0)) ((0,30) (9,37) (0,0)) ((50,32) (63,35) (0,0)) ((50,22) (63,29) (0,0)) ((0,14) (9,21) (0,0)) ) 7 FabOnDisk: Cell_D_0000 0 FabOnDisk: Cell_D_0000 4080 FabOnDisk: Cell_D_0000 6562 FabOnDisk: Cell_D_0000 12246 FabOnDisk: Cell_D_0000 15528 FabOnDisk: Cell_D_0000 17852 FabOnDisk: Cell_D_0000 22416 7,5 -0.802777023299683,0.0291531675598444,1,0.35485766137277,-0.488054044881715, 0.511102509723158,-0.412770792584818,1,-0.513483484922804,-0.127612863359537, 0.179909223082852,-0.142251428514524,1,-0.670750032675099,-0.218881780265963, -0.146240833102376,-0.802425045572202,1,-0.997592363336099,-0.489950069939765, 0.0118033210639287,0.0460988332433731,1,-0.997592363336098,-0.488179307394783, -0.80229126875991,0.0284334464525982,1,-0.968862808067719,-0.46098356160295, -0.998785008553438,-0.41272960090631,1,-0.513483484922798,-0.125453018374298, 7,5 -0.0290673731864873,0.80253261432199,1,0.997592363336098,0.143140321839065, 0.997537192466015,-0.0020214868738456,1,-0.0292295794699068,0.30835040063579, 0.998339059063367,0.65144105948018,1,0.146553731172839,0.463721902041923, 0.51356429521175,-0.0420748630146441,1,-0.510948336420425,-0.0404379872178309, 0.336296481886526,0.96920141691415,1,-0.228776546345016,0.0198561533153852, -0.0587576496109283,0.941233688160005,1,-0.144743124173817,0.293946470148138, -0.511211179266157,0.117521236894592,1,0.146553731172846,0.325307791714851, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_5/Level_1/Cell_D_00000000644000175000017500000006214211634153073025026 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (9,9) (0,0)) 5 ¾‰ßÙY©¿¶T1Ü©¿´z—©¨¿yz¶4Öñ§¿óè‡Ðšø¦¿\Žñ¥œË¥¿l:S¥ŠV¤¿¶fY¿¢¿ v`“Π¿ÏÉÝdÖÿµ#KïÒ¿ÙÊ.Y¥Â¿¯+]ÑI¿•¦onsÀÁ¿Ø04;’ Á¿Ï\y”g*À¿Á‚ 0B¾¿§afþ<廿ü<Ðk?¹¿îí¼<ð`¶¿NOìç"Ï¿!®ÑÕοäÊ=>=οð ÂYÍ¿Žfž-Ì¿¼! ž»Ê¿>‚‹UÉ¿p xc7Ç¿3‡=üêéÄ¿™{*ó‹Â¿]2ÔÜç’Õ¿Ð_ w]Õ¿–¹KhóÔ¿ ™8²UÔ¿`J·âÔ…Ó¿>Ñ…Ò¿çQÉXÑ¿1!ËÒ]ÿÏ¿V8uÀÎÿÌ¿ÃüBxZ¹É¿ÿõ¨†_Û¿ÔkU}yÛ¿‡šê&¸”Ú¿££‘ÌÙ¿-\6íÄØ¿¢ü/lS€×¿Øì“KäÖ¿«©NÛUMÔ¿™± ‡æfÒ¿ý^QSп=½$;vtà¿÷ûÖ\Kà¿v~¥Œôß¿nÿN/ãß¿}ä©ÜÇÝ¿äÁ£pð@Ü¿6óˆ¦kuÚ¿CÛÁähØ¿„]>Lo Ö¿,ÙÚý´¡Ó¿Ú~Å‚o㿟Ç »à⿨¿½‚â¿É]CêU÷á¿]HÕ¸Ð?á¿$ÍÕþë]à¿äëÍÓ¥§Þ¿!)¶ê+HÜ¿ék\I£Ù¿ðé:!w¿Ö¿viÜam}å¿ÀÂÈjGå¿'®Ä7rÝä¿EO’×W@ä¿Õêáq‡qã¿Çâ:*õr⿼ ÄÑGá¿ÇÒ‘áß¿Õa°ˆÔæÜ¿#!ò·>¥Ù¿[jΘ´ç¿öeð>yç¿Ý™"ß~ç¿›^ìJWæ¿!cê5s忬‰È(iZä¿ë^Ÿ¦ã¿»çû –á¿)êy æâß¿pìKÜ¿ÿ¬¡pY°é¿7ÆÜ«Ópé¿£ðÊ–òè¿GúB 7è¿H¤à ì?ç¿·|)Œæ¿íDP'©ä¿N>8ªã¿–åCDHá¿vL¼É›ªÞ¿W‘Kÿ W©?·Ú”€’ÑÂ?bô· Ï?™.Í‘‘Õ?)ªÊkØ]Û?ÞÖ‹usà? õ>ã?³çè£|å?7Y¬õ²ç?àX®é?OU×P ©?ÕÁAZø£Â?Tñ¾«»ÓÎ?4íÚ+\Õ?âP.­Û?ú1RBJà?è9Šhßâ?1Ù–IÚEå?ÞÞãhwç?"]ëâÁné?!ƒ?2ò¦¨?°âí¶tHÂ?Ó=Nø ;Î?.±í)òñÔ?F…Ï~Ò’Ú?Sý-òß?‡¸¯Lâ?šÚO·Ûä?¡$lç?Mi éðè?Š{WXï§?k=V¯'¿Á?åÝ«~¬WÍ? »dÜ6TÔ?à6šóšÊÙ?à`gß?ýÍðßÎõá?nZCÃ>ä?¨zËUæ?I t4è?>T?T÷¦?!§·”u Á?ï±ÀP—+Ì?øæëÀ^„Ó?=tYñÂØ?‡äìãuÄÝ?]FÌš;>á?<›Ägœoã?†ÿ=ëpå?Ss)53=ç?ô×D×Ê¥?z>A«Š)À?^LHÃÛ¹Ê?°|•ëk„Ò?p&@]~×?‹˜u^>Ü?$€P\à?μþàqâ?]¤oŒXä?tô3Ï æ?AzÚX¤?2^ßRiA¾?ïÀxëÉ?ÿLðœÕVÑ?³OÉšþÿÕ?@óË­ÞrÚ?¦¶bk¤Þ?dPŸ:Eá?{~ŽmS ã?ÌE‰ w¦ä?¸{ª(ºÂ¢?a ï8‡å»?¥ìDÇ?8Ø3¾#ýÏ?'oKi‰KÔ?µm»×bfØ?Û× ôDÜ?¢’šJ¥Ýß?Ų'»“á?aŒSü ã?𾨠?¿ƒ!A¹?ÿžC³ŸéÄ?±ŒU"þÌ?¹v@9eÒ?3mùÖ?QóOà Ù?$ífZçâÜ?Q ÁSÞß?—Xª8¶Eá?<4úôSÚ?®±¾·d¶?÷8åÛtŒÂ?õ5ëÿ·É?_LâÅQÐ?\é3 CŸÓ?ù“q 8¼Ö?ö¾ÕL?¡Ù?1ªŠù}FÜ?£ÑE³¥Þ?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?“’èÑFìï?ë@ä¹’ï?FÅ^“ìï?’]ü’Öî?~¥Y`äì?¬¯G jë?uÜJó«é?‹)Êh®ç?×,ÄÅÈvå?VÃ[/ ã?ë@ä¹’ï?îc« Oï?7Ù¹|´î?2 ¼`¥Íí?Ágê¿Sì?FÒ#v&ë?Âüÿ«¨lé?Áß §,tç? ÀaÒÝAå?|[A&Ûâ?FÅ^“ìï?7Ù¹|´î?Ú^ÀxYî?fãoæù9í?û9†Œì?×´¢ÞïŸê?’Õz¯îè?A“—÷ÿæ?f‰bŠØä?66߸}â?’]ü’Öî?2 ¼`¥Íí?fãoæù9í?£‹Š5@^ì?|0(–<ë?F=€zÅ×é?VK:H>3è?7›5 Sæ?7 l"Ò;ä?š¸< ´òá?~¥Y`äì?Ágê¿Sì?û9†Œì?|0(–<ë?’y&ê?ûÆ¿näÏè?ëký5#<ç?KÁUoå?k®Ns7mã?¡“M€p;á?¬¯G jë?FÒ#v&ë?×´¢ÞïŸê?F=€zÅ×é?ûÆ¿näÏè?“½N׊ç?ð<”{¿ æ?±sMVä?µKð²·nâ?íá[S°Yà?uÜJó«é?Âüÿ«¨lé?’Õz¯îè?VK:H>3è?ëký5#<ç?ð<”{¿ æ?Çgµ‹¥ä?ZÇuÙ] ã?¡I¾SÆBá?ê-ÆVAŸÞ?‹)Êh®ç?Áß §,tç?A“—÷ÿæ?7›5 Sæ?KÁUoå?±sMVä?ZÇuÙ] ã?I›Âkz‘á?3%Ñ£Øß?:&rø¢?Ü?×,ÄÅÈvå? ÀaÒÝAå?f‰bŠØä?7 l"Ò;ä?k®Ns7mã?µKð²·nâ?¡I¾SÆBá?3%Ñ£Øß?‰Éz( ÝÜ?³»¶”_šÙ?VÃ[/ ã?|[A&Ûâ?66߸}â?š¸< ´òá?¡“M€p;á?íá[S°Yà?ê-ÆVAŸÞ?:&rø¢?Ü?³»¶”_šÙ?Ž0•èüµÖ?†£\G<ß¿?C‘µn®Þ¿V ¶‹…Ý¿²^§^ÝËÛ¿ÿ~²ZŸÙ¿ÜcPŸŸ ׿Ñ@+Q21Ô¿Âg‘ ý!Ñ¿Œ24ÁœÌ¿jïÆ½­ÜÅ¿Kbim°Þ¿ÕÁ ›Þ¿ê†O€òÜ¿’wa½¸?Û¿emåÈÙ¿”t7'‰Ö¿šägG´Ó¿xÄüŒ±Ð¿ˆ!]ÚJ>Ë¿Ž¥`û/Å¿ÍÜ nˆÝ¿t¹íBïÜ¿€·0«"ÄÛ¿ía"OøÚ¿:kϰç׿BÌ/î[Õ¿Q¹Í ‰Ò¿ŠJàÏ¿©øp ÉýÈ¿V 1?Èÿ£¤·ÖÉÐÛ¿ˆ(vú7Û¿¤ïvÉ Ú¿ E0NXØ¿ør¯H¼.Ö¿F9O‹Á¤Ó¿Èò×A˜ÓпêÒ¼±­Ë¿»Lf~Ì–Å¿ˆb$Ãô*¿¿.# ¥Ù¿ûGNŒÙ¿ÎÙK,!Ù׿ä8:Æ$Ö¿ R&ºúÓ¿yP_VqÑ¿¢YéCÍ¿ú•øEMÇ¿²µ}÷z:Á¿­õªÚíx¶¿þtàÈ׿4lˆ”qÖ¿hftGAÕ¿«ªN‡.‹Ó¿“l‘`Ñ¿º÷9•ˆ®Í¿´ xáÈ¿¡‘Qî¿ê:b#¸¿~(½­b¨¿,ó³ø6Ô¿vmÏˑӿõ0 ý]Ò¿@5l;‰¥Ð¿"ÌÚ óòÌ¿$‹àb[ßÇ¿’jAçB¿[rxQ©¸¿’"p&E8©¿VbêLÏh¿™ã½¨G&Ñ¿äÉÇŽ›Ð¿,¨Ì¯d–ο3É$ ¿Ë¿L2š†ÃÆ¿N#Ñ…‰­Á¿ ʲus"¸¿ˆô:Z’¨¿vmaº}P¿ÿ´_x6§?H¹ÂŒ×Ì¿+›hPÃÊ¿‹ìùJPÈ¿¤=—ÑÄ¿¹CÒoÀ¿ˆQx Öª¶¿Sç’WÅ䦿._4”œY?†AdMǨ?›Œúß(¸?À1·£ãÅ¿Ö;¤Œ²›Ä¿bb}³«.¿w­0dõ>½¿þ,o÷®x´¿ªu“CÜa¤¿§ò€Å”—o?…·ªÊµÄ©?—gÓDÔ¸?[Ó„ lRÂ?FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,42) (9,47) (0,0)) 5 ª$PKñjë?§p]Ô'ë?Hƒs{¡ê?KÇ|Í`Ùé?QÓËÑè?ä–ì·ÊŒç?E£Á´ æ?I&½FXä?Ç` áoâ?vC…¦óZà?—[c|æì?wÚG€µžì?½ÝOæì?ð"¯!>ë?\S0-(ê?tUÄ·Ñè?Èžs>ç?¥¦Iº-qå?Q¼ƒ'eoã?‹D‡9>á?…@'Yãî?È-ß+Ïí?Ï>R\;í?ë?Œ.qŠyÙé?šÂ>*5è?¬Ð¤3FUæ?y•.‚>ä?’-¼@öá?3%àÉï?€bÛöŵî?ŠBC`|î?~+ë×%;í?rÎjTßì?ÀQRïw¡ê?²¡€ðè?5‚Y¦*ç?ðTvXÛä?b)±aƒâ?n}Ökâžï?Þé²í>Pï?2;Öò0µî?ÐÝu_vÎí?- ¶cžì?±ãˆŠ¾'ë?—NCné?ìºI#vç?DرhDå?ÓlÀ ‹Þâ?íEÓëï?ædƒš¾œï?ôÅ#P+ï?Q÷l*î?®ÀÈ•båì?.Ÿù™ûjë?·Ó3N­é?2ÒZ°ç?‰i EÈxå? ygŸN ã?/ ÇÖûš¿IÆÒ1T³¿fÇ“V?û¿¿[zK,Æ¿¦?ç#Ì¿F¬5pUëп^eƒÞÌšÓ¿†h%ÎÖ¿/ûþaØ¿¤T¹/ÖjÚ¿Ù r┕¿“ÇDž°¿ìNgšžšº¿‡ûŽ4q¿ÏLêîgÇ¿æøøš%Ì¿ä@‹Î0NпÁ¾lN]aÒ¿xýlFÔ¿üêvøÕ¿-êå¦ï¿ünñ’jQ©¿7 ÎA ö´¿±¡Š~R½¿µË‡§?r¿7fªîK.Æ¿(–q³É¿3g±ÛøÌ¿ÎÕD1[öÏ¿¼r8¶RÑ¿»sÈj…Fˆ¿Ås9o«=¢¿c' =®¿È#ž~ø´¿£øo5cžº¿›‡5ô-À¿E åA”‹Â¿û` ZèÄ¿§cXXÀÇ¿U,ÿÈ¿îB‹ÌÃ|¿íˆ&%ù•¿M¦˜”>C¢¿ÛŽ?ÔX©¿yÉH °¿Zé Y³¿­¢‰äxl¶¿¼¾ü¢yH¹¿åF=|绿ɣ)6ûE¾¿Àf€]`¿€ªùž}¿ÇPI‚ˆ¿T?©ÞR‘¿¢ž 8’¢•¿(ꌣbš¿ùMõ9)ž¿µîé±´¡¿ MÇ‘}É¢¿ëƒ’¶e¤¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?òØêtnà¿g90<òEà¿• ê}¡êß¿/z®úÞ¿kØ“[¾Ý¿ð½€ñ²8Ü¿ýV­÷vmÚ¿Ä«GaØ¿bŒ¸”Ö¿¦ÐyPœ™Ó¿ÐZïŸTÛ¿Œ8Q>Û¿˜‡#4!‹Ú¿r>“ÃÙ¿}k€¼Ø¿Wk‰Qqx׿eTfâ„úÕ¿÷½Ç·hFÔ¿YÙnP`Ò¿¿áó3éLп}$ÂjôˆÕ¿éä«ÜSÕ¿•Ÿ30êÔ¿ %óLÔ¿ŠúŽ©}Ó¿þ­ú[R~Ò¿]Ò£cQÑ¿qÒR<ƒóÏ¿º$^fzõÌ¿„Š/: °É¿®r MbÏ¿¹UÌÃοÚö8]+ο!eRÄŒHÍ¿¤?\Œãs?l¶?¶›VètÁ?åuP‚.¦Ç?)-Zžÿˆ¶¿ Å/¿Y´´¿ÓE˜Îo°¿2¾ŸÌ£¿©L¬ÿ'Qv¿'‡hƒ~¡?Ȉ¬± ´?_ÈåNñ,À?êÓóxÈrÆ?;ˆ²¸Y¢Ì?èoÁg®§«¿ÎØïJà ¨¿glŒQ€!Ÿ¿<ÍÒîÉ[u¿N70¤Inœ?ÕòÞ}64±?7zp¼?_ʦ7+`Ä?fá0¤Ê?›kÌeÐ?/fó}¸›¿ðÌ=ÌÁ¾”¿Wëë0p¿‡ÅG*Ï’•?ˆØÇÕ‘˜«?G4–wÛ·?˲`—Á?­·ñj¬Ç?&$ƒ[îÍ?E"ú<œ Ò?x_{­ÍЀ¿“í+|fy^¿³ÑyâmÞŒ?:Žù¼ì¤?h~º’m²?d‹…h»t¼?¶f[ÞÃ?·é—„NñÉ?ÌlÐ?ÈiË)Ó?ÐB'|›la?WtÏø÷<}?DŸñЪ6—?"*éúµà¨?ŒMÛ·®Ø´?v¶Ä…Û¾?fr¿ôÅ?ÊU4‘QË?èr©z©Ð?œQ¼Ó?FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((50,40) (63,49) (0,0)) 5 ß±òCÇ?árî«äïÏ?To#OcHÔ?„z& ‹cØ?ÿW_²´CÜ?Ð@õ;ðÜß?-LÍ )”á?Gëö*ã?W}ËûzYä?¥·I±brå?ܿډ¶Væ??<ñ˜Éç?F3|÷¤xç?—&P³ç?ɧáEûÈ?Ç@³çÖQÑ?aÒo·güÕ?áêÊH?pÚ?Bbu£Þ?öAÚÜøDá?ŒÑ©äç ã?«^Ȩ́ä?]´%2Òæ?õ`ö§r?ç?ê ªëÜ6è?iŒ·K©òè?_–ÕmGqé?öÅG³±±é?,›g8&°Ê?âPKNúÒ?•¯&çÅz×?n¥ê¹;Ü?aïj[à?Úúíðæpâ?ΞFOÉXä?®©èæ?H ›Úç?Åkg€'Óè?ÜlpMÛé?Œj<Ç£ê?ÛD:™À*ë?½’V9oë?mUCl"Ì?t}p €Ó? –A¿Ø?’ƒ" œÁÝ?N ïX=á?Ü„Xgoã?ôP qå?ÉȈ.Û>ç?;ûëmÛÒè?¹$«)ê?*nûÉü?ë?‚ÎQì?>Þ—äõ ì?5ÃÎ'ðçì?è…ÕNÍ?,\Þ½ÂOÔ?‰-fÒŸÆÙ?rLÄ‹þÞ? Fø¦ôá?E rR>ä?)/‚\€Uæ?"!ñ5è?²ìŸ´Úé?ëìêu»?ë?8ÚÍaì?'ª1m^=í?NÂc|ñÐí?Áݸî?æþä„1Î?–ÔG9íÔ?aa¿DUŽÚ?ƒ0:à&îß?+œÅ—°â?hz¾½Úä?ˆØA iç?+0²,`ñè?‚ÁˆFÝ¢ê?óFѰì?Þ\%‹J=í?¤áYì½î?9Íš2Ä·î?9œq¼ï?cÁÊÎ?¶rêVÕ?½ŠøfsÛ?žÊ(7´Gà?v6\þÝâ?gzçcDå?œHHvç?h?äZYoé?ÿ{ú0g)ë?ƒ ƒ ì?hôsÑí?&°Wã¸î?Ør>Sï?˜¥Ý¥É ï?[R|û^Ï?7Aã^Ë‹Õ?pd²x®WÛ?Œ ˆ)pà?c}¹Þ ã?¾«’‘ôxå?­¾¦·ý°ç?ã¬û£®é?~c3tmë?NvÌÍçì?Õ­¿eî?‚ÔÝÕï?;ƒö¡ï?P¹zeñï?KœÏ? [“5‹Õ?®UY¥eWÛ?™–•Æ pà?£9qû ã?é>eéxå?äøGãû°ç?‘’ µž®é?ú3sUmë?¥#ªÓçì?SQ|‚î?•W ï?xYé|¢ï?ëãÁdòï?¦?ÍÒ×ÅÎ?0"ÆòTÕ?;ç¿ÓÛ?†ú•[ZGà?Ò‰$^Ýâ?NZÈãCå?×ß±7¤vç?±WÁ=oé?i"¢~)ë?¿íÌÉ~ ì?Ü'œ…dÑí?CM•Qr¸î?ä‚ðX§Tï?M¬D–ë¢ï?š¥·ëšØä?ѧ~­==ä? çIJ;oã?/®pâ?ðžpÓ°Dá?I$÷!Üß?àf:qàÜ?ØõA,”Ù?ãß©Ö?UÊûiScÒ?MÌF³’ûÌ?Nu£©ƒéÄ?{^ï!¨H¹?ñp‘ˆ™¡?zɤB¦}â?¾LG}óá?5 ñ ¶<á?šuí[à?÷lóª5¢Þ?nèEׇBÜ?Zgn +Ù?jßAª¸Ö?mFUa.œÓ? ŽcOÐ?é7Ý´É?Až¥¸‹Â?'m¸,›j¶?ÚßìÉc.ž?„UÈêß?¦a”¶ûÞ?ú#rÀÝ??σjÃ:Ü?Ô¤÷5¯oÚ?rãØ¢RcØ?u-\„ÊÖ?80J‘¿›Ó? ‰Í\ìÐ?s2æí{&Ì?yB$¸.Æ?öžêA³ÿ¿?’mådP³?ÜU°–¥ ™?.”Q1‹Ú?}E¥ÃGÄÙ?ß¿¦¬½Ø?Ö:¿çy×?¯2³!üÕ?•‰Ž;HÔ?²/øùaÒ?ÆŒ]©‡NÐ?8±c¾%Ì?AºÓÆûhÇ?æœ*^rÂ?DöØ›º?k7XEã°?D6ýØDi•?¹à|,oêÔ?J“ìÈ€MÔ?ÜÀƒ{~Ó?¶ÖóRÒ?Lo%}RÑ?L´„ÍÌõÏ?ý©¨°Å÷Ì?R·]ŸM²É?@'¹Äy-Æ?·f¨}öqÂ?¦æ5áÞ½?Smê÷´? Ù{^œS©?T*H¾Õï?iÚCGÔ+Î?е ¸nIÍ?5ŸY°¥Ì?ß)Bs®Ê?+©$4küÈ?£~,æÀ Ç?ñ\m?äÄ?í E>ˆÂ?µÄH)ý¿?G3ž›º?íOj¤÷´?!kÝ¡A®?7›ŒJ¢?ÎÝ–ˆ?gqð»9Â?¸b? Û¯Á?Þƒ/ÕûÀ?ƒÿOFÀ?O>W!¢,¾?·…'ÿÕÕ»?Š“ïw:¹?Ï&„dù`¶?\3ÌdnP³?’òkÖ‚°?ì<ìR©?â6·b:H¢?n_ús'–?˜ªô€<~?V53éUc¨?ÝÂxó_ª§?Z»Žä¦¶¦?ªj¨Z˜‹¥?'¨§ú+¤?2ôùþš¢?¢¿£E^Ü ?ç¢;µè?‘ǶMnÏ™?UI;xw•?F«ho·ì?ЫÙzˆ?ˆpÝ!õ}?T$Æ _´f?ïr¯boS¨¿5O¤¢‹¤§¿‘ﱌǷ¦¿®´Ä µ¥¿‹6òýr3¤¿$ …Ñ£¢¿4ëiçæ ¿èþƒÿÑü¿ä_è0Œã™¿ïhž>Š•¿â¡‡*û¿‘csXGƒˆ¿ÂeŠþ©}¿r%]M™d¿¨»£xK5¿‹/8H-¯Á¿wõ÷:"üÀ¿dƉc<À¿tnðòß0¾¿1ªx„Ú»¿q½¡[{?¹¿úïÊL6f¶¿»†FÌU³¿Ž&"0ó°¿:`“{]©¿&û‰SùP¢¿Ú€’°.–¿Â/»œ~¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?i©¤oïâÄ¿$^fzõÌ¿ÙnP`Ò¿ Œ¸”Ö¿ˆ»¶”_šÙ¿mÉz( ÝÜ¿%Ñ£Øß¿™I¾SÆBῳKð²·nâ¿l®Ns7mã¿< l"Ò;ä¿o‰bŠØä¿ÀaÒÝAå¿é,ÄÅÈv忌ÞRTñ†Â¿ê‰/: °É¿záó3éLп_ÐyPœ™Ó¿n0•èüµÖ¿¡»¶”_šÙ¿.&rø¢?Ü¿ä-ÆVAŸÞ¿ðá[S°Yà¿§“M€p;ῤ¸< ´òá¿66߸}⿎[A&Ûâ¿lÃ[/ 㿸ÇÁ‹ú¿¿}ÜUI+Æ¿ŸxEÔ¤"̿ڄücQêпrÐyPœ™Ó¿8Œ¸”Ö¿hÄ«GaØ¿ØV­÷vmÚ¿Ó½€ñ²8Ü¿QØ“[¾Ý¿ó€/z®úÞ¿† ê}¡êß¿c90<òEà¿òØêtnà¿Z‰“]˜º¿—Ò£zÞo¿BÄíµfÇ¿²xEÔ¤"Ì¿•áó3éLп6ÙnP`ҿֽǷhFÔ¿FTfâ„úÕ¿?k‰Qqx׿hk€¼Ø¿r>“ÃÙ¿Œ‡#4!‹Ú¿…8Q>Û¿ ÐZïŸTÛ¿Ñ ëô´¿ð¢«Sþ ½¿·Ò£zÞo¿Ä}ÜUI+Æ¿AŠ/: °É¿ƒ$^fzõÌ¿<ÒR<ƒóÏ¿EÒ£cQÑ¿ë­ú[R~Ò¿zúŽ©}Ó¿ %óLÔ¿‹Ÿ30êÔ¿ãä«ÜSÕ¿{$ÂjôˆÕ¿_úsh:®¿( ëô´¿÷‰“]˜º¿ŠÈÁ‹ú¿¿ßRTñ†Â¿ª¤oïâÄ¿bMo Ç¿‚…{/ûÈ¿Ù(ž6­Ê¿$iÝ+ŠÌ¿ eRÄŒHÍ¿Ìö8]+ο¹UÌÃο«r MbÏ¿:¿ô¤A¢¿Šø´ó&O©¿D1Þ¶l°¿›Øu­O³¿4,R`¶¿úÌ9¹¿ÁºšÅÕ»¿µï)¿+¾¿Ô’c£À¿3‡DpúÀ¿Ó#Ò¯Á¿ý<¤÷ø7¿²ŸÕ.”¿Á@?ÍE¿“Ü%&Ïjˆ¿² :yXí¿7ûÛ{•¿,Ã!‡ÌÔ™¿Ý¨˜ß[î¿4Ý®$ß ¿sñ° Z¢¿WªÕZ¿-¤¿ioWídŒ¥¿“5aE굦¿Â+dßq§§¿d2ƒB¨^¨¿^š©¼ÉÙ¨¿ª¶)¼¦©¿…×%&Ïjˆ?1:yXí?ÅöÛ{•?Ó½!‡ÌÔ™?¬¢˜ß[î?¶Ù®$ß ?™í° Z¢?*¦ÕZ¿-¤?ójWídŒ¥?à0aE굦?Ü&dßq§§?Y-ƒB¨^¨?9•©¼ÉÙ¨?y±)¼¦©?Ú½ô¤A¢?£ö´ó&O©?0Þ¶l°?&×u­O³?…,R`¶?Ì9¹?©¸šÅÕ»?oï)¿+¾?‘c£À?Ø1‡DpúÀ?~"Ò¯Á?ž;¤÷ø7Â?LžÕ.”Â?X??ÍEÂÂ?WW¸/æÍ? ¦åc¦Ê?B¯·ÒtÆ?J¸1\S|Á?åºÝT«¸?'Õz•™w¨?­!x@ÙR?MU3ñ#6§¿(Ž?é¶¿UP”CÀ¿ŽQ&-ØÄ¿˜ôn·pZÈ¿¼e ¢Ù¿Ê¿o^÷sQÌ¿D}éJ Ò?’Ç;ÅoÐ?pû2”Ú®Ì?¶ùU¿Ç?†ä3²i@Â? Ƹ?E l‹©?¨¼b±*m?ïÛô”÷§¤¿°¶ïq´¿Ê åJU½¿Å°E Þ-¿Ñ-œ@¨Ä¿ ÿV'Æ¿+)ZÇÕ?xµÎ$lbÓ?qó8Ô8MÑ?Ì|Î_®Í?·JÃ]t0È?À3êìSÂ?:™ý×¢¢¸?X0ö3„©?̤§\‰©w?ç‘h\\¡¿è }GŸ±¿vt:–³¸¿*”Ü Ú½½¿ ü´ù=À¿)â00˜µ×?¯)®Ö?B0/RüÓ?õP±E‡Ñ?ÆE?gÍ?šoT³Ç?k \‡®Á?FÛ ðiv·?J*;Q¼J¨?b’Gw}? okº6œ¿•€ÌzWb¬¿%јIzK³¿Õ›ª"¶¿âaYûÙ?AÖªÖ%ZØ?¬0½ÔœFÖ?Xœ è×ÑÓ?’êw©Ñ?*ÒÕãHÌ?x1#”\AÆ?’­oÒKÀ?jÑá<µ?¹ÌÖŸ„É¥?Æ‚>Dª6?¸J#N÷”¿ù{i)Τ¿VËÆn Šª¿fŽ‘Ë¯ËÛ?ìç#×u(Ú?€±Õ¸Ø?Ôq;¡ Õ? $IÒáÒ?Œ¥M{`ãÏ?ý‚öäþÚÉ?E9’ÚGâÃ?ŠíÀd¼?*ˆåv²?>Õ<ùü¢?VE®žÙ|?óÕ’úþ5‹¿;¸ÙaE™¿ñ½¨°äÝ?‘”šE±fÛ?Ïê JSÙ?Pø~Y¯ÞÖ?ª§¿œÔ?Lœ‡Ü/Ñ?P X,QVÌ?±G¦?û[Æ?WLò©À?Ç8íqî¶?Ä o-CÙ«?´Q?“p§š?;òõ‹w? ‘QÜäw¿Ñ_í ž­Ý?Lk¯Š Ü?0<Âñ”öÙ?Ö[¾×?°ôòªÂÔ?À1?9®ÒÑ?®dW­›Í?Vfì] Ç?gýK cíÁ?(òß\q¹?ÓWÂûk°?k´(0šH¢?5HÂ^t??k@¤?~éo?õ Ã}x¬Ý?8f¶K¼ Ü?²R»=~öÙ?ÂØ2"×?ÌfïyÂÔ?\ª 0ÒÑ?èÓtsœÍ?;îÝvøŸÇ?ÓP(štîÁ?Ö¢*Zq¹?ºËs·k°?R¬w$<¢? NÞ@éŽ?¦sO#YIg?ÑMœjîÿÜ?Ä}芒dÛ?gN'´SÙ?©²µÛÖ?Îb÷—Ô?¾ZˆŠW,Ñ?ûáëYÌ?дÁ»ôWÆ?6ÐZDy¯À?°Í-Ã\ì¶?Ü“ç{›ä«?d"Šô®Yš?Z÷wb§Êw?Z¼*1[ w¿FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,30) (9,37) (0,0)) 5 +ÛÁ¸Â¿ã°âŒ‰Â¿±¿Ë2³+¿&¤ðТÁ¿ÇgýaðÀ¿ –WžÚÀ¿KÊ”)$¾¿ö"™—л¿‹éL¹¿”ÿ ¦±u¶¿«AÇuø¨¿é+×Ôî·¨¿òØœe:¨¿ :\oƒ§¿½¯«`i–¦¿)œr­r¥¿ ˜?¤¿¤û-¿ X¹úî ¿G‰Ø—£!ž¿œ¦÷-©?™MÎYó¨?>àö2z¨?ÿ×/‰›Â§?V#_pΦ?Q¡®Ýœ ¥?ØSa0p;¤?sr ÿy£¢?ßŲ×Û ?vZvk‚Ù?ÏéaT#ÆÂ?M¼v*ΘÂ?š› ã#=Â?Ç ß%´Á?Ë;“¾=ÿÀ?}. @ À?^0µ2¾? n2‹bÚ»?Ì¥ÊÙv=¹?CçPäc¶?î÷“yÏ?UjjvÇÎ?Ý+ªw9/Î?›ªs ]LÍ?%’^=!Ì?I(ãѰÊ?3¦]ºþÈ?2‹W2Ç?0Ì–`çÄ?"±[iŽ‹Â?¿ÞÖPôŠÕ?‹u™ †UÕ?œÝí•ëÔ?/‡“9NÔ?ÆJró~Ó?NÕ¤ÃÒ?KF»¶.SÑ?‰a=0+øÏ?˪ÎrÌûÌ?Ró c-¸É?´P«"ÞVÛ?ȨðY«Û?w×#Ú‹Ú?ÙñSÄÙ?ÛK½Ø?ÓéJ¹Py×?u0Á üÕ?¬²’UâHÔ?Øh•~dÒ?£ž6RÐ?û|Šcoà?KéÂ{Fà?ƒâ¢|0êß? ÅN™úÞ?µÑJa ¾Ý?i´m,8Ü?à¬ÇÁnÚ?‘t?TÛbØ?0Âñ^Ö?E5¨ØŸÓ?ᄬ0&Ó¨¿ TÙÌ`”¿àÎ3ÞÆÎ¿Ì`á)BWÕ¿öª³h Û¿Û½l)Ià¿Ù@á»ÇÞâ¿6õ ÜßEå¿ü-L›wç¿()ýtné¿>ÍBå©¿'bi Iÿ·4ó©ÎÏ¿¢ûb¬ô‹Õ¿Eîè¨ÃXÛ¿b‚ßþpà¿ÛO[å ã¿~ÕÀ™yå¿ à1»ç°ç¿U*Jw­é¿Ì*5I©¿;nR%üÿX¿,"þÏ¿ó… ¶‹Õ¿³ÞГ8XÛ¿ˆïÅpà¿âZ7µS ã¿}p*äx忎G@-°ç¿_~²±¦¬é¿ßNçÖܨ¿¤JŸÞW–¿Q—˵•Çο¥^kY|VÕ¿oÇxÓƒÛ¿=b0ÜÎGà¿-Èe-Ýâ¿PÇû8 C忹»œ.|uç¿æÃfÙ¹|´î¿á^ÀxYî¿mãoæù9í¿:†Œì¿Ý´¢ÞïŸê¿˜Õz¯îè¿F“—÷ÿæ¿k‰bŠØä¿66߸}â¿›]ü’Öî¿; ¼`¥Íí¿oãoæù9í¿«‹Š5@^ì¿„0(–<ë¿N=€zÅ×é¿]K:H>3è¿=›5 Sæ¿= l"Ò;ä¿ ¸< ´òá¿‹¥Y`äì¿Îgê¿Sì¿:†Œ쿈0(–<ë¿ûŽ„’y&ê¿Ç¿näÏè¿öký5#<ç¿UÁUoå¿s®Ns7mã¿©“M€p;á¿»¯G jë¿UÒ#v&ë¿å´¢ÞïŸê¿U=€zÅ×é¿ Ç¿näÏè¿ ½N׊ç¿ü<”{¿ æ¿*±sMVä¿¿Kð²·nâ¿öá[S°Yà¿n j¤¨©Þ¿†BšÞ¿vÛ¤cQôÜ¿ ˆ0ÎCÛ¿ v!Ù¿ ,©:–Ö¿ˆáCàoÊÓ¿rg{þÈп m¬„Ë¿ÓÄú(qÅ¿¼<¡ÔCHß¿¤I)iM¿Þ¿Ø}¹]×Ý¿ †orÜÛ¿f+ïè!²Ù¿‰8TR$׿ËGÎ(ÖMÔ¿•2ž‚„FѿҩMzØXÌ¿ çJÀ-%Æ¿àĉW[ß¿yÓéåÆÞ¿4÷¬q”Ý¿’CÄÜÛ¿Òi®Ù¿Dþ\÷÷׿©¿=?Ô¿ò_}Eù1Ñ¿†>aûÌ¿kžÏÔäÅ¿ŸQE½Þ¿3HÔ±¼*Þ¿x.†AýÜ¿ä ä÷EÛ¿c"!½hÙ¿ ö“€Ö¿ô³¼9( Ó¿ÖmÛônпRº¹ £×Ê¿¦9ŒfªÄ¿f!€,Ý¿oH ‰ýܿғ3©ÐÛ¿Ç7³#&Ú¿Ék°Öç׿®ò%žøOÕ¿6Áé^ÛlÒ¿.Aªâ ³Î¿º9YiÈ¿Ñp¶ÐB¿\ð+ÈMÝÛ¿º7J—ïIÛ¿lsètÚ¿DéR;eØ¿' G]2Ö¿$3ÃxšÓ¿ ñæBfµÐ¿ë9Τ?Ë¿ ؈ŽïÄ¿ñf†›fs½¿.K!œý¡Ù¿F»å­¸Ù¿¼ßé,ô׿ýú’ú:Ö¿ª{¶£¾Ô¿Z»žÂnÑ¿Bt‡Í¿;ÇÝåÆ¿y›u’À¿ûÁ…²«´¿8¤D°”׿LF¸dòŽÖ¿Úu¦ïmÕ¿t°•…«Ó¿FÑk7xÑ¿n1”óºÍ¿I¤KˆøÇ¿ÞÑJé¿Á¿óXHéë¶¿~¹;±I´¤¿FAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((50,32) (63,35) (0,0)) 5 ãM¡ïV,ˆ?a NĪÏ?Fµ'öhŒ•?á¢÷³\ç™?Jô(7¶ž?Eöû[ê ?žkäTا¢?&Ž¡GÌ7¤?-þ –¥?¦î¦x¿¦?­{Íä²§?;æ]Ãj¨?hFÝs³ì¨?Eb¡,©?* ßI¢?Ï‘waV©?w |°?ð{ŒÝlT³?”-íUkd¶?õ[Î*=¹?~›­e‚×»?àé.æ„-¾?\)?ŸÀ?ºcãçúÀ?J]ø„¯Á?.Tˆ´8Â?>ÝKz•Â?Ú‰'‡¯ÄÂ?™5ÇX®?+)Åðrµ?äor† º?êr-n¼ÿ¿?̨G©2ˆÂ?eFJqãÄ?MsÜ! Ç?vùTúÈ?!i á«Ê?_d“åÌ?:{öfŒFÍ?¶†W·L)Î? E³½ÁÎ?-,3—›Ï?Ï&¯Rµ?LŒ" 0'½?úݧsÂ?9 »4.Æ?8ŽäÇê¯É?W7¬çôÌ? ÞœÉ_ñÏ?U7A­.PÑ?Î|Ò?/U†Ï{Ó?£ñŸ‹JÔ?¹N¹çÔ?ÍѯoPÕ?X™Ý­á…Õ?§Bœ°²ï?ïÿû.î?ÓFÏv¦éì?:Ìåêoë?e #¦Ò°é?ð™Â¼&³ç?9B&ä {å?°r+êû ã?ŠöYªîqà?7ÎÍ}±ZÛ?4ÔÙÊŽÕ?CY5?ZÏ?¤t²ÇÂ?OiÖÊ ©?¬ŸŒc6·î?ˆŽF:§Ñí?ÊEp¢ì?x*¢g+ë?`.Pí‰qé?>Ä×Óxç? ·ÿ1Få?“²Éßâ?~äŽîrIà?\YµDÛ?¢&ÝÛÅXÕ?ú€Ã„ËÎ?…(§ãp˜Â?GÉÖəߨ?d/¯ÏTî?á¡êç/>í?FÔ–ò~ì?iuI¥ê?dÎz<½óè?3ŒÊÚÃç?|0ºLÿÜä?ÈägÄâ?®õ»œÊñß?¿ˆ3¡>‘Ú?ûÛSxïÔ?«µëd2Î?ùÚ_³•;Â?ÑŸV´&^¨?àyD³=í?e™ë5(cì?“<ÃâIBë?Añ¦è[Ýé?uC„(¥8è?žè <Xæ?ÑòhQy@ä?^œ´ýçöá?Òtèß?ÏjïÉÙ?vrãIRÔ?'·ÚêOÍ?ƒË"²Á?ºýS*Dš§?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?Nq MbÏ¿â#ÂjôˆÕ¿{ÏZïŸTÛ¿ÈñØêtnà¿%Ã[/ ã¿®,ÄÅÈvå¿e)Êh®ç¿RÜJó«é¿‘¯G jë¿f¥Y`äì¿]ü’Öî¿8Å^“ìï¿ä@ä¹’ï¿‘’èÑFì￵¹UÌÃοQä«ÜSÕ¿û7Q>Û¿90<òEà¿M[A&Ûâ¿ä¿aÒÝAå¿ß §,tç¿¢üÿ«¨lé¿.Ò#v&뿬gê¿Sì¿" ¼`¥Íí¿,Ù¹|´î¿êc« Oï¿ì@乒ᅧõ8]+οŸ30êÔ¿ ‡#4!‹Ú¿ ê}¡êß¿Ô56߸}â¿C‰bŠØä¿!“—÷ÿæ¿uÕz¯îè¿Á´¢ÞïŸê¿é9†Œì¿Zãoæù9í¿Ò^ÀxYî¿6Ù¹|´î¿JÅ^“ìï¿ÜcRÄŒHÍ¿ %óLÔ¿ r>“ÃÙ¿|€/z®úÞ¿q¸< ´òá¿ l"Ò;ä¿›5 Sæ¿;K:H>3è¿4=€zÅ×é¿m0(–<뿘‹Š5@^ì¿aãoæù9í¿3 ¼`¥Íí¿˜]ü’Öî¿@ô;dÆ›™¿Ò6˜ÐE$«¿Ê˜¼”@P¶¿üî-ZÀ¿–®C Æ¿Gù$bP'Ì¿ “-P'Ñ¿²{Žb‘3Ô¿é¯ó ( ׿­*V}žÙ¿ŒŸ©aˆÉÛ¿¬ã=b’Ý¿"*²tѩ޿° ökT>ß¿¤Áˉ‘¸•¿Ö?³ .¿¨¿8Æôõ\µ¿GRèJ¿¿ÇÆ<|‡MÅ¿%æÆ|´OË¿_…À»¶Ð¿$š0s·Ó¿Ý¨EªÔ‰Ö¿P’aØ¿j‡?Ü¿‚ô´_s×ß¿íÖ“Z¬á¿Þñ4¬} ã¿çvÜpUä¿\oFJpnå¿.Ûi³ÐRæ¿Kaqç¿Ô€oÿòuç¿;™ Z²ç¿â¹MMKéÄ¿NÓSàúÌ¿JѾ¨aÒ¿] ­§1Ö¿kYGcbšÙ¿ÍOŠà­ÜÜ¿áGèÈù×ß¿ÊAÃ#Bá¿Î™¾‘nâ¿¡¬ü]mã¿Ì¾á‰<俯7}¶Úä¿¶çÈDå¿”I÷¶ñ{å¿ÿ݊¿pƒg`ï²É¿Þàý¤àMп»¸$Ç5šÓ¿F¬¯ìS¶Ö¿ EiÅ•šÙ¿ÃWÛ?Ü¿Ióõ§ŸÞ¿2Ø¿Zà¿»ªn=,<á¿wŸòâ÷óá¿rNsHÇâ¿­À9[Þâ¿Ðu#×㿘¹s¶ý¿¿:yÿÏa,Æ¿¹ÃÓ˜#Ì¿Á,cÚËêп$°õê%šÓ¿ÕŒ`;Ö¿pÆ$ÎëaØ¿à> ™œnÚ¿+ÇŽ%L:Ü¿D|xšÀÝ¿ƒí6tÙýÞ¿Fäñ*ïß¿°© Ià¿Sqx¼rà¿åGY÷•º¿„~äÓn¿{âjíeÇ¿rç®e>#Ì¿üµb{—MпˆÅQRaÒ¿lº¯)ÆGÔ¿¥#CüÕ¿œ„/¦z׿‘$_¢B¿Ø¿Æ{ÇÙ¿Ù_BqÚ¿¦Lé1ŸÛ¿ Mob[Û¿ uýbë´¿ô~7½¿ÍÄ´Sªn¿ՈâjŠ+Æ¿” —ͱɿ"ðf(øÌ¿iµ¡È<÷Ï¿CúÓ£SÑ¿U‹æ; Ò¿`ý|ØÊ€Ó¿`JÉÜ‚PÔ¿>tm})îÔ¿µòÇXÕ¿J/JaùÕ¿áðŽ{®¿í“Zþ:ã´¿á¨6Y–º¿®2‡ãGú¿¿Ò¸b©‰Â¿a€c.'æÄ¿AŰ4kÇ¿¥ˆ$•zÉ¿Ý"ÃË׳ʿ€úÚ|$Ì¿(ïV›îOÍ¿swwÖì2ο<že®þÈοÐê0`ØÏ¿[Tekâ?K†QY÷á?¤Ûa c@á?‡òNå\^à?'âÓë§Þ?[)|;GÜ?g[ÒhÆ Ù?[\ ÞºÖ?Û/w¿ÈœÓ?¾ãxóMÐ?©ªá8­É?éÞ¹}Â?Â!m•û>¶?ƒJ¨?°:1½Üä?BÒ´³?ä?z®¿XVqã?-â¡Êrâ?œÌÚ£ Fá?ÀR;æßß? óå;ÿâÜ?o'ŸÙ?r±lSÕÖ?ûð’ÒÔaÒ?Yy†·wôÌ?_5öóÜÄ?ðGŸ£¼ ¹?!,MÙ~ ?ì`£ç?X½ÐSVæ?ÖÈà­rå?`ÜnfóYä?áKœ1æã?]îT¾”á?¡J‡aNÞß??{"gDÜ?Ø*šû­dØ?Ì^ɲHÔ?eJlµ=õÏ?¢¤C Ç?iC.ï?λ?¹Wd—•¢?¬s‰ä6ñè?o‡@56è?T?4j?ç?>&t'æ?ÔnIÀ^¨ä?› ã?iqѧEá?ÂBrÂ?¤Þ?i?“qÚ?õR#i°ýÕ?ÉpdO¥SÑ?¥†cmþÈ?×o§´/¾?„¹1¤?8•G¢ê?'ŽšŒÚé?ƒQAì Óè?ÂG -Žç? ’¾0æ?€è ‚Yä?oü‘H°qâ?(`›[\à?q^=Ü?ওw|×?¡l¿ðÔÒ?yùfгÊ?.¿b_#À?« Ü·¥?6ll•¸ì?|§§d?ë?f÷²­·)ê?¥4TÓè?^â]ƒ–?ç?Á«…—nrå?mXpã?¿!î P>á?Ün²äÃÝ?NyË·=ÁØ?qÚ‚Ó?ók)•&Ì?Kèµ{¢Á?’õá@pæ¦? †<í?-ã Iaì?¿‡Œ'@ë?/~@m}Ûé?vœ5Àï6è?¹jFa™Væ?ùÉ6§(?ä?û~JžËõá?ðÁ^ß?åÕ[×ÈÙ?é§xRÔ?™y?ÓSÍ?‘™Ý»A»Á?ܸ¹ç§?FM‘–î?ª6TÜ¢=í?–™XÓì?Ç]ä¤ê?1ü>î½òè?õ0…Êç?ê™Q Üä?ú¸øâ?ùq'ê·ðß?X8®X´Ú?P‡Ê¦}ïÔ?œ¼¥ýÄ5Î?c^oCBDÂ?ˆ¦†ÿŸ¨?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?_ÞRTñ†Â¿¬‰/: °É¿Ráó3éLп0ÐyPœ™Ó¿70•èüµÖ¿c»¶”_šÙ¿ê%rø¢?Ü¿š-ÆVAŸÞ¿Éá[S°Yà¿~“M€p;á¿y¸< ´òá¿á56߸}â¿a[A&Ûâ¿>Ã[/ ã¿@©¤oïâÄ¿Ê#^fzõÌ¿áØnP`ҿጌ¸”Ö¿T»¶”_šÙ¿3Éz( ÝÜ¿Ý$Ñ£Øß¿wI¾SÆB῎Kð²·nâ¿E®Ns7mã¿ l"Ò;ä¿F‰bŠØä¿î¿aÒÝA忾,ÄÅÈvå¿oLo Ç¿pÑR<ƒóÏ¿x½Ç·hFÔ¿Ä«GaØ¿Ù%rø¢?Ü¿Ý$Ñ£Øß¿›Âkz‘á¿0ÇuÙ] ã¿ú±sMVä¿'ÁUoå¿›5 Sæ¿$“—÷ÿæ¿¨ß §,tç¿v)Êh®ç¿y„{/ûÈ¿ÕÑ£cQÑ¿ßSfâ„úÕ¿nV­÷vmÚ¿†-ÆVAŸÞ¿vI¾SÆBá¿/ÇuÙ] ã¿gµ‹¥ä¿Ì<”{¿ æ¿Éký5#<ç¿6K:H>3è¿vÕz¯î迬üÿ«¨lé¿cÜJó«é¿ä×(ž6­Ê¿n­ú[R~Ò¿Êj‰Qqx׿Y½€ñ²8Ü¿ºá[S°Y࿈Kð²·nâ¿ò±sMVä¿Å<”{¿ æ¿n½N×Šç¿ØÆ¿näÏè¿'=€zÅ×é¿»´¢ÞïŸê¿0Ò#v&ë¿›¯G jë¿ñgÝ+ŠÌ¿õúŽ©}Ó¿ëk€¼Ø¿Ïד[¾Ý¿m“M€p;á¿>®Ns7mã¿ÁUoå¿Áký5#<ç¿×Æ¿näÏè¿ÍŽ„’y&ê¿_0(–<ë¿â9†Œì¿®gê¿Sì¿o¥Y`äì¿ÊcRÄŒHÍ¿‚ %óLÔ¿úq>“ÃÙ¿h€/z®úÞ¿e¸< ´òá¿ l"Ò;ä¿ ›5 Sæ¿,K:H>3è¿$=€zÅ×é¿\0(–<뿆‹Š5@^ì¿Nãoæù9í¿! ¼`¥Íí¿…]ü’Öî¿|õ8]+οùž30êÔ¿‡#4!‹Ú¿ô ê}¡êß¿Ì56߸}â¿:‰bŠØä¿“—÷ÿæ¿iÕz¯î迵´¢ÞïŸê¿Ý9†Œì¿Lãoæù9í¿Å^ÀxYî¿(Ù¹|´î¿<Å^“ì￲åÛÐÒ?ë*CÞÑ?&'W`}Í?s]¢ ëÈ?ˆ„åç·:Â?Çq(Áiæ·?=g> »¦¦?€~É:ëp¿BŸéf9ò¨¿¨›åv¿¶¿†Rõ©ám¿¿¦QF‡.ÿžJí³NÅ¿u™ƒñ8ƿȠOŸ¿Ï?)ΊG´$Ì?ík·“Ç?à„ºÖ)9Â?c[G·¡¸?D“ÞôÎ@¨?<8H¹«`¿>µS¼©¿ÖÚJÊþb¸¿}•¿YÁ¿F‰éÈa³Å¿{ϪÈÉ¿Ô+¡ÄTË¿b§Þ"/Ì¿Xwz OÂÉ?ßkUñ%Æ?m+!”Á?ÐuŽ#ãu¸?˜7¢(YE©?¬S 8³A?âVŠ©¿£ÜÏÉ丿|U¨û:¿\§yCgÇ¿Q°¾Å=ÅË¿¶Õ41)Ï¿ýXÈŽ¥¹Ð¿œjáll)Ñ¿nvÒÈÃ?oìú›4À?MBÏK·?\Îß»:©?Z­ÖP¡i?§‘»ª_§¿Ä]@\¸¿s÷PÃ…]¿€&;E)È¿t³ý†©XÍ¿ìÌßÝпL˜¿œÔÒ¿Ws †;ºÓ¿µâyU5Ô¿W»ÂáL¼?‘¶ß•µ?sä"†þ§?0-jn‰u?ê„= ᤿ˆåtç¶¿â»÷ÇÁ¿Ü›°I¨öÇ¿ñ¦ÈÔÂÍ¿Ð"ìÙ zÑ¿}Éö«Ó¿9#FaÕ¿e" Yیֿ”×Ëy> ׿ëÈÐÏ+ã±?6 ©|¥?¾øºšþz?Bø ”DÖ¡¿18)0¨´¿!ó´—ŠÀ¿†èI–ƒÚÆ¿°¹ ŸÍ¿ªx1›hÑ¿R·¥ SÔ¿Y£õÊ3Ö¿ŠøYŽÂê׿«ª§ÀÙ¿)¾ŠF:ŸÙ¿^p‚à¡?š?0Ôï6|?›¹KÍW윿Äwü£Ç±¿‚&€úq½¿.¥Þ¦éÄ¿þxr2Ë¿+„íSŒ-Çcì¿^¶A뿞bà Üé¿ÄLa¬ë7è¿ éçëWæ¿i,ÑŠ@俾E¶<ê÷Ὶ‚žöŠëì¿»í+Âó¢ì¿B Ý˨ì¿̼VAë¿ ®àÛ+ê¿?Ýt9Ôè¿é›’v@@ç¿Ittså¿bgµ~îpã¿Lš·Ø{?á¿=~øšmë¿?³~¼)뿨9rEܣ꿑^±šÛ鿯¬ûnÌÓè¿6¢°=¬Žç¿72÷ô<æ¿¶“¯Y俹R±‰Ûp⿇ Œ×[à¿0 ÿæÁ~?¤$ £¾-–?‹ÌC¢?˜ý8I©?¦›>C °?]p呬H³?¸À¨µëW¶?¾Ò›Q¸/¹?·ÏF?ÖÆ»?Î8 -ß¾?Ú©°~«òe?Á»§•§»}?øBò.Vˆ?eká«êÕ?¾Zô]•?Þ³ß!²™?+¤ÆæþÇ?Ý|{É ?º‰¼0瀢?èó¨8¤?º'Cöd¿†ƒyÿ}¿×`ôHʵˆ¿Û°f‘¿þÓy˜º¥•¿v5 qšþ™¿Žè˜ïkž¿óõ$õ…ó ¿@Ʋ¢¿v¼ðï?¤¿‘ƒøqi~¿Eø9™`P–¿’‹ûjb¢¿béY¶m©¿ÖÜš¢C°¿)ZÁ\³¿.÷šk¶¿6£^ÖC¹¿Î²y-øÜ»¿Æ¥ñ?3¾¿‹ríÉ¿]¤Ô89{¢¿óFî–k®¿²t µ¿-”q’©º¿å7~cÀ¿ÅújF˜ŒÂ¿ûB°œçÄ¿ûZ¢¥ Ç¿û…ã3ÀúÈ¿mBQ”‘¿"#s›©¿Z·kæÐµ¿?,/F''½¿xrz¿²0!®T3Æ¿ø€î¶É¿'L½GùÌ¿Cóÿv¶ôÏ¿Ê]ÜoÚPÑ¿M­ªI÷¢–¿>œíþA°¿lle‡½º¿t½ÍL6~¿˜ 3eqÇ¿MZK+Ì¿_o&Ë4Pп3bx£DbÒ¿AupßUFÔ¿5/>÷Õ¿Ì'm&›¿Ô‡çÊ„³¿`bò@_À¿_ c3:Æ¿²-úir.Ì¿š¼¬!+ïпj’Ú÷^Ó¿¡s`ÎGÖ¿š­Cr€aØ¿õ~j)jÚ¿ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?ð?H@?ÍEÂÂ?=ŸÕ.”Â?<¤÷ø7Â?k#Ò¯Á?¿2‡DpúÀ?{’c£À?ï)¿+¾?9ºšÅÕ»?…Ì9¹?Ü,R`¶?µ)¼¦©?ט©¼ÉÙ¨?ë0ƒB¨^¨?X*dßq§§?<4aE굦?'nWídŒ¥?1©ÕZ¿-¤?ið° Z¢?GÜ®$ß ?N§˜ß[î?K³)¼¦©¿ —©¼ÉÙ¨¿(/ƒB¨^¨¿¢(dßq§§¿˜2aE굦¿˜lWídŒ¥¿»§ÕZ¿-¤¿ï° Z¢¿Û®$ß ¿$¥˜ß[î¿Ô??ÍE¿ʞÕ.”¿<¤÷ø7¿þ"Ò¯Á¿V2‡DpúÀ¿’c£À¿_ï)¿+¾¿¹šÅÕ»¿éÌ9¹¿R,R`¶¿Íq MbÏ¿0¹UÌÃοÿõ8]+οLdRÄŒHÍ¿phÝ+ŠÌ¿`Ø(ž6­Ê¿ï„{/ûÈ¿àLo Ç¿¬©¤oïâÄ¿ÂÞRTñ†Â¿$ÂjôˆÕ¿ä«ÜSÕ¿/Ÿ30êÔ¿¹ %óLÔ¿,úŽ©}Ó¿¤­ú[R~Ò¿ Ò£cQÑ¿ÕÑR<ƒóÏ¿-$^fzõÌ¿Š/: °É¿®ÏZïŸTÛ¿+8Q>Û¿9‡#4!‹Ú¿4r>“ÃÙ¿$k€¼Ø¿k‰Qqx׿Tfâ„úÕ¿®½Ç·hFÔ¿ÙnP`Ò¿…áó3éLпàñØêtnà¿290<òEà¿, ê}¡êß¿¢€/z®úÞ¿ Ø“[¾Ý¿“½€ñ²8Ü¿¦V­÷vmÚ¿@Ä«GaØ¿Œ¸”Ö¿eÐyPœ™Ó¿g4ga;u¿'Š=ç y?æÂ&HÍš?Þ¾Æ ¬?À®°U ·?ÿéö§t¿À?½en3hÆ?v-5¦hÌ?+¤3A—5Ñ?ó)0{'Ô?eʼ'¤n?¼žõ?ŽŸ&t~¢?í…¨‹°?×µ …ι?¨³d ýÁ?8º²â­Ç?0ñ÷ÉÕ§Í?åã_¦§ÖÑ?©–ÏÔ?ž/¥Õâ¾m?r”e¶«?")—!*†¢?Í&·+Œ°?D°*‘¹?ƒDº:üÁ?òN«JX­Ç?¥5‹ú¦Í?9K* ¤ÖÑ?,'£Å×ÑÔ?f‡¶–x¿·æ¼ÆŸx?JðGÙƒ(›?ÄU°%k¬?ééê×u·?‘`Xÿt¹À?áåm¶€iÆ?#@{BaÌ?˜ió§5Ñ?ÅÝ¥£&.Ô?X& Ÿ#™¿uû¾˜Š¿³þ×\*5?›2ßO»_¢?í¯>Š)²?bø[Ï0‡¼?éç*´lñÃ?€©gϦçÉ?;µ^¹¨ðÏ?"#kÆÉðÒ?óC©yª¿$MÆXîy¤¿hr¶Q@H”¿\\BÚ,ù€?ãï6;¦?³7gsdµ?¡51»«\À?2¨¶ƒ¹PÆ?îÔ_Þ9VÌ?´¹±[ Ñ?.&Aëñµ¿`L6 ß³¿È±£´þ«¿`€3qÚi›¿Ý>Ö?€?áÂÓ,ݬ¨?Z#_s¢·?Jþ"ÔYÄÁ?ao½™ÈÇ?¦öÒеÍ?‡1ØÀ¿xt¡»m½¿¡­ÇËu¸¿]¯:ÞZ±¿œá§¡¿RF±8,|?éðyôÀò©?z}¾ãè¸?„±ÆoÂ?2PdQÈ?ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_5/Level_0/0000755000175000017500000000000011634153073023314 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_5/Level_0/Cell_H0000644000175000017500000000034211634153073024364 0ustar amckinstryamckinstry1 0 5 0 (1 0 ((0,0) (31,31) (0,0)) ) 1 FabOnDisk: Cell_D_0000 0 1,5 -0.990457978284096,-0.99034027886684,1,-0.990392640201616,-0.47780288776548, 1,5 0.990431310460936,0.990501734369748,1,0.990392640201616,0.47989181859321, ccseapps-2.5/CCSEApps/iamrlib/test2d/plt0000_5/Level_0/Cell_D_00000000644000175000017500000012012211634153073025016 0ustar amckinstryamckinstryFAB ((8, (64 11 52 0 1 12 0 1023)),(8, (8 7 6 5 4 3 2 1)))((0,0) (31,31) (0,0)) 5 öÓ þú ¹¿2»Ó-¸¿¾õ¥Ö3¶¿¾#GÄ—l³¿5å5«M¼¯¿ X›1y§¿ERè眿bÉ7Ž–\ƒ¿^Œç„çƒ?@ÊwÈt8?¸Ñ½„|°§?ëz¶Ü¯?% ü†h³?èÿy3#¶?6§– ¹¸?››õn"ú¸?üØ;úù¸?^­I—?¸?¤?I~d"¶?ߢâïf³?äycƋٯ?çd³]D¬§?8[à–-?ÙŸšÆÆƒ?«’›­`ƒ¿Ôó¾è¿NŸØr§¿zg¿Ê¯¿LQ&ó_³¿ò³úçʯ¿Ö¥SÕŽÇ¿“lô©p!Ó¿ ߿ٿPÕªì3_ß¿æn©Y+åá¿„óËà[jã¿àcwÊÔ/俱Ó6Á“è¿‘4méZ¡ç¿ñr ÓEÇå¿ø¤w« ã¿°ôGJZß¿u[õR׿×e;öÔ·Ì¿~/õ­a³¿c™Z=Ãj³?9PŒë‚»Ì?ñÖdrS×?y¹ß¬cß?ôÌ™ã?']t/Ñå?dÒ1¬ç?&×öˆVžè?ñ¼ØÒOžè?ÙŠ¤x¬ç?ÖÕß9Ñå?`„Ëdã?ÄC±ð@cß?*{á‰S×?ƒK{©½ºÌ?0E’ûj³?‘øÅ_³¿ÏþÅ2µÌ¿Z[ÜO׿Ú@êï’_ß¿È×3ã¿/jôcmÎå¿ èËä¨ç¿§O¢šè¿pûÉRHì¿dÙö{ë¿:›@¤žç迃üÿùÔå¿® ˜7ìá¿{˜Ÿ0ËÚ¿äí›CIbп˜º’aà¶¿·{iÛ†&¶?5‰ûîÉcÐ?÷d˦œÚ?³ÈÀ Ûçá?`(sÈAÑå?šA äè?ÓOqyûë?¤3Û?ì?©R¿Â7ì?úJBråë?êkŠtæãè?¢—HÑå?‹ ?Ñœçá?* iœÚ?F­ÎFcÐ?äKýY%¶?” ½ô¬¶¿„¾@ œ`пγõ˜Ú¿É»µåá¿êd:_ÃÎå¿×„d4áè¿„]óéîþê¿AÀ…ì¿ç©ë÷}î¿vûª¸Rí¿c€ê.ë¿Üõ‘°ç¿¶–ZŽ6qã¿ÑEüFQÞÜ¿Ðß… ÖÅÑ¿*/LÈ^ü·¿o›ìø¥ ¸?"[º0½ÈÑ?í­Y± àÜ?¨Ðý/¿mã?˜œR¬ç?[©$öë?e^ÌöNí?„¾zÜÖyî?¨x<ëÎyî?6IÞúMí?ƒo'úßë?_ëϬç? EŽrmã?„pdßÜ?ˆh«>êÇÑ?ëѨ×v¸?Ô‹uÄmþ·¿˜š”ÅÑ¿Æ&/ùnÜÜ¿ sñÍŠkã¿ÀkàV²©ç¿ŸVËúþ꿨«£,¾Jí¿cê±'ævî¿Yt4Ú-¥ï¿€À®Ímî¿Õ.eFF ì¿Â*Ê÷)”è¿GY R¬,ä¿^ÌžŸÞ¿—½_~ØyÒ¿X0òs“îhu¹?hŒL1Ó~Ò?L§ª”Þ?™ÒŸ¯‚4ä?œüæ$€žè?í*îSì?¤Þyî? §ë±ï?ì?¹”±ï?ß0R¤Äyî?! ‹'ì?…Ôɾ=žè?Ôn&4ä?H*N…œÞ?±Él’’}Ò?E›’Ñú¸?€:€ò¹õ¸¿Ä•dÞ{Ò¿+Þ¿ùs3.P2俞ÚÀ›è¿¿¶T çì¿ÖY–uî¿÷je #¬ï¿åWܫ¦ï¿f‰ÍåmCÄ] ì¿çÁDàL”è¿ÚœÝp-ä¿ï#·‹ZÿÝ¿P¸‡xÒ¿×6s%¿ë¸¿ÆRɲD¹?ºpïúð~Ò?Víß9™Þ??ð~4ä?RÌ‹Òyžè?Þv1ÉLì?rÉ‘îÖyî?÷)C*–±ï?d<µ$ޱï?èáƒø½yî?35& ì?ö&4žè?rsôÎ4ä?^ÿxÞnÞ?G!ŒÏF}Ò?*̤Äèø¸?ß3¨;{ø¸¿Ú\ Ÿ|Ò¿R×i<Þ¿g>³úk2ä¿¢ìQú¸›è¿Ä?¯쿬ßótî¿6¤_‡xªï¿‡qÊ/oî¿° öÈAí¿Ä!cg,öê¿J½>¢ç¿(Û&Ïvfã¿=¢v6×Ü¿-‡lß0ÂÑ¿!ûZõ·¿ÞÝ…8± ¸?¦IXþÈÑ?‚v2!àÜ?(ù°mã?1Çêä=¬ç?6²³òë?;>ýMí?Aˆ dÂyî? 3Á…»yî?؜ƕçMí?_%*ØÊë?P7»:ý«ç?ŤKKmã?ªšHXèÞÜ?(ÞšJÇÑ?m̓&Û¸?`f8I¸¿bE4S&ÈÑ¿˜ª|0úÝÜ¿ÿJ€Ükã¿îË$«©ç¿ÆÐ¶Žþê¿C_éÅpIí¿KäX'sî¿th3u ì¿"Jt]õ꿌6C¿lØè¿ˆ•M½Çå¿ßöI[Gß῜Q”Ú¿v%Ôá]п±Ìié%¶¿&:½ˆn)¶?ÂE1ìcÐ?¼Ù¡#€œÚ?¦Ÿ¹çá?É7n/Ñå?ñõ§ããè?‚uÖë? @ÿ+ì?]"a‚ì?:x.„Çë?ÚòHÇãè?׎~ êÐå?³I içá?l9¯w›Ú?%GéÅ)bÐ?/"Kû¶?Ï_çv,¶¿(ÑN`fпz¸€Çl›Ú¿X)O"æá¿–žöšÈÎå¿d˜&áè¿:>žþê¿Xýrì¿*†õFè¿“ë‡nd­ç¿INÓå¿æ³­šP!ã¿Ð‚Lùedß¿ã!UN׿{MÑÌ8³Ì¿ º¹]³¿”pŠk³?ÒŽ§ËêºÌ?þ²-áüR×?|œÒ;*cß?.îîPã?“<@,ôÐå?#[N‰ü«ç?ô¥E’'žè?¤Ë&žè?’•‘u÷«ç?EœéÐå?KÄ÷<ã?¶DŸàbß?ŸHÊKuR×?ÂЀð¸Ì?çQ¼øvc³?ƒ1ìm³¿»bD°Ì¿ÈýcDµD׿ʃCé÷Mß¿:×aã¿Q’,ÃÂå¿—½¹¨¥œç¿†ôlOè¿´Z¹Ý/0ä¿›ðå"l㿽ȑçῸ] 0dß¿ t“¨ÃÙ¿SwûùE#Ó¿@XÍc‘Ç¿™¸%0uѯ¿-,;Ú¯?…Áv,“Ç?Rk ö#Ó?)ˆgÂÙ?UÚg.Êbß?Ü„bbçá?3O’?mã?‰ Qû4ä?MÙF64ä?×aÊDFmã?, ­Žmçá?|nsébß?V–…8ÂÙ?ͨ'$Ó?n'È£“Ç?&Àÿ·Ü¯?è\剺̯¿èÊCéJˆÇ¿x4¼Ó¿£¦z}þ±Ù¿tà!×Oß¿B#nŒÜá¿9ñZ”bã¿Ë$±>{+ä¿ 7d€‡þÝ¿ÒvåTÚÜ¿«mcù`™Ú¿–Pÿ\R׿ è‘€³%Ó¿KâS¥¸uÌ¿JÓ†Á¿nÄxÅ­§¿©_¥§?fh‡€ƒÁ?0Ô?qÌ?cJÿ‹#Ó?ô«¹ *R×?ÞW ˆX›Ú?÷#ÏÅÞÜ?ØêAÝ.Þ?ÙÚÆ:Þ? t¥¼êÞÜ?:²^š›Ú?ÇÌ-šR×??®×¹%$Ó?ÐhÇsÌ?½wW†Á?ál0T²·§?™¥AÇ4§¿ß›ª&CyÁ¿`ÝF—`Ì¿¡€*Æ’Ó¿Ø8ûg$E׿³ûÛ3Ú¿îÐAWÙÐÜ¿!·yLdúÝ¿bÎb¿«vÒ¿‡)¯“ÁÑ¿® +^пH¦v”£¶Ì¿‚Dқǿj3ÉŽÁ¿5‚-È0žµ¿§r!C‰>¿fòΧ ?ÂæBhZµ?ET ËÒ‚Á?ÊQé‘Ç?ßî˜7¸Ì?p™YE)bÐ?½OþIÇÑ?)¼#¹ø|Ò?½æ }Ò?{6Ù<ÇÑ?¬šÄÍŽbÐ?xOv¹Ì?o×üa“Ç?hÙlµ§…Á?è xO5˜µ?{jSFâL?KUà*AÊœ¿<ðuÐäwµ¿Ú޽_¡xÁ¿z2Znq†Ç¿õ½!ŽÚ«Ì¿ØeÒY€[п{|Ç„ÀÑ¿¢Yëë_uÒ¿¹ćÕÖ¸¿K ×ñÞ·¿eHŽä϶¿”Š&VT³¿w¬u@᯿¶žø`Õ§¿·šrX¿f^8óƒ¿í¥$/Œ{ƒ?ÓpÖ9?4®mì §?š øécЯ?ë¤2þ%c³? ¤ßà,¶?è ›o¸?6­r÷¸?UQÞ¶Ë÷¸?*w†¸?`A—b!¶?}Úî*f³?Ø5˜-KÙ¯?Œ,Â@í§?"Oų4?7ë•ä•àƒ?#ó=ènƒ¿Eá‘çP¿ûÜ2е¢§¿³(‰’;Ö¯¿Ú€œpøg³¿œ3P,%¶¿ï¹_¸¿ÁKøšõ¸¿C0gŸ§ó¸?qÕ±>¸?ìz ¶?dÀ:)#_³?– .™e¯?5­'ÂÒŽ§?½mväøœ?XizY¯hƒ?ßB䃿77Ü¥f9¿N¯æÙ’±§¿DkyðÞ¯¿aT ”Ûh³¿rמò#¶¿9¬ÄIf¸¿sg%3¬ú¸¿vQ­/Kú¸¿—h(:¸¿Üî|Ý!¶¿coÁeªe³¿Á˜•|ßÔ¯¿›$r¯¤§¿¾ô¿”ë@•ƒ¿ˆªSlAƒ?ó?Xº) ?~d(í¢§?’t@†̯?à‡f6]³?–žt¶?é.¼Ñ÷·?]U*,.ð¸?³ÞÛØosÒ?Ââz°æ½Ñ?ÒÎò„ïYÐ?øk¹T«Ì?܆øg¦‰Ç?" ‰eÄÁ?,«øãbе?Ttîr?w;Z©?¿|î8Ò˜µ¿Ò©@¼†Á¿ÌcСƔǿ>„Ó£÷ºÌ¿U,"Rcп/.£{ýÇÑ¿ÿ8¹ÄÆ}Ò¿uVú®}Ò¿Â~72´ÇÑ¿îÜ ¿z a×c?ÅhÌlñ˜µ?*?Õ¤o|Á?É|ꙄÇ?„öbÀÌ¥Ì?xéWÐ?AÅ+ŒºÑ?ħˆl¿oÒ?‚1ðq/õÝ?=Ü’ÓÍÜ?à¡·$@‹Ú?ò£ ¨E×?y3;Ó?»óéirÌ?„ÊsWÁ?¤ÓÊ5&™§? ½>δ·§¿tj4ÓŒ‡Á¿{ÇÕ»tÌ¿ˆ8¡ %Ó¿öÎŽ‚qS׿|- :qœÚ¿9¦3¶ßÜ¿<›>ûÞ¿÷ÔåÞ¿j\˜–tßܿ˽#Ðÿ›Ú¿ÐjE1ÉR׿AØ[X$Ó¿”Å)"7rÌ¿wq ØþƒÁ¿_€ÇV¡§¿èåc8ŸÄ§?á6{oúÁ?ȰåçütÌ?%î`ìU$Ó?.t¿iR×?|cbà$›Ú?¡Ž«4ÖÝÜ?”a±M0Þ?ffqH4ä?nD#mã?•¾" {çá?ÍFõ"Adß?–³°2_ÆÙ?t¯ë-$Ó?&0UãÕŽÇ?œ¸&9¿Ã¯?Nb¶åx诿Àän€–Ç¿à,t%Ó¿‰Sv1aÃÙ¿ò× -ñcß¿:„ãçá¿#õ°mã¿aØe4俽*\4ä¿N h –mã¿+×Àýµçá¿r@vocß¿–Ÿs¸ÂÙ¿h¢¬ã¨$Ó¿"F͔ǿÍMÞï—㯿QÌKñޝ?ç -@âÇ?6"ô»%Ó?ëý®’óÄÙ?™aÒºYfß?¢rÅbéá?jÃÚºQoã?ÛØeØ5ä?t Úè?æ;yÿѬç?Ã$ò*Òå?¶¼æF  ã?s¦v½d¬ç¿’l\‡žè¿1p€€žè¿v‡CP¬ç¿²¢×EÑå¿møDE¤ã¿¥2Ï(ßcß¿§[ÚÕÓS׿3VXº3½Ì¿²ãÅà–r³¿†ü%ïjN³?Žz뇥Ì?Æ)á{%F×?¿ßIÇeSß?ýðÊ&ã?“RÌ¡ˆÆå?\e‹–¡ç? å/Š»“è?Ø#Ô€Íì?Ð’1€òê?Áóó¯Öè?¿áíOÅå?FiOØÞá?emºu’Ú?;íK”\Ð?$äÂ@¶?ˆØ¨5!.¶¿už‚eп¡D]…Ú¿ñË0èá¿U ]†Ñ忬ÂFäè¿`qÌ2ë¿Ti¬uì¿»«c°pì¿hYK$뿊©ã¦/äè¿„@qÃhÑå¿#Cöèá¿§2¾¸OÚ¿ö¨õdпWÄí.¶¿˜ ‰d„¶?¨QpHZÐ?*~¾\×Ú?Æ4|ŽMÞá?γåÜìÅå?¶¬d+b×è?0éö±‹ôê?CÞ½7±ì?9ìÃghî?ĵÌé<í?êQ¨í{òê?bˆXÈFŸç?"7´ƒgdã?Ñô/ÕÜ?üaèäÀÑ?Þ¼³Åñ·?³¢‘)}¸¿ †¹6ÜÉÑ¿™ïð~ìàÜ¿}³™ nã¿¶Ó“¬ç¿“øþOC뿽ì×JNí¿<éÜzî¿£N– zî¿£™WANí¿EÓ'œ4ë¿Çã¬ç¿Ù~d›ûmã¿Cdd ÑàÜ¿âî6oÐÉÑ¿5òöb¸¿¤õhò·?ÊœŠ\3¿Ñ?øÉ NÐÜ?%>hFcã?@V£¦ÎŸç?Õi‹ÿóê?¹°ŸÜý>í? Ë §Êiî?R®”Äìï?!ÌÙC?gî?î“ ì?\ÿ–qè?Jù|*ä?ý0s´œþÝ?®—)±ºwÒ?ñ—Ö°è¸?ã(à ¹¿OŸŽÒ¿¾µI )Þ¿ç?¤ÓÀ4ä¿iÃ6§·žè¿–c—ˆì¿ðòëzî¿è[îÔ±ï¿@ÖÿÒ±ï¿Pzd zî¿wM T€ì¿*w-2®žè¿ ”z¸4ä¿Ëš•d Þ¿„ˆö•Ò¿ (M¹¿·ƒS¤è¸?é3.V»tÒ?`qC"÷öÝ?€ö£´‰)ä?%°3þe‘è?TX¶à®ì?Þ›3ýVjî?9Q Ù¡ï?)”Æ€œ¯ï?ÅNog]yî?''Æaì?¶”®×žè?çŠõ_ç4ä?)ãÁv*Þ?èÇ•ÕtyÒ?nâ<ílì¸?ÿÈôV͹¿er²r1Ò¿ñ—NåÞ¿—ÿZd§4ä¿Ã!Ø£žè¿õl¹xì¿8—÷Øzî¿}JYÁɱï¿kúãȱï¿6Ú{ozÚF\uì¿sP žè¿|ú«Æ¥4ä¿øûMêÞ¿C«_äGÒ¿¡ÊH̹¿í… <é¸?>]ÑesÒ?½ìej‚öÝ?‰é.ÿu)ä?‡W$_‘è?2PáZ¶ì?O—6¼˜jî?%›ñ£ï?—¶Øxî?6Dbg…Mí?ל›á¹ë?Eán¬ç?Aoä6mã?îã-c ÝÜ?VÁ•¡ ÅÑ?|¨Î[§ú·?]¹1dy ¸¿BµpGÔÈÑ¿ ÄÁ+àÜ¿|"áÄmã¿©ç¨Z¬ç¿ vyÛë¿â݇$Ní¿®Ér*ïyî¿þ{”+ïyî¿Ñ^¤$Ní¿¨9d[ë¿R˜te[¬ç¿¥!ÅÆmã¿ôÆ25àÜ¿k¹ÓÊäÈÑ¿ja/Ný ¸¿ÊATbù·?ÝeŠ.“ÇÑ?8Î\ûàÜ?k$Þnã?ºØêß®ç?éÅG?ë?£äç ÌPí?vóÇ0-}î?ö®œš/ì?ÕRì!“ë?*)¯ãè?$ãè¸Ðå?L©^•#çá?¶5BvšÚ?=-“5aÐ?c­•Ç ¶?Û)›ßù%¶¿j3ˆcпW·‹Ñ`œÚ¿WMM—½çῇN%+Ñå¿€ôÜüãè¿·ðÄõë¿Ð5ä¾Aì¿uQ†B쿯ó‰øë¿= yÌäè¿«52†0Ñå¿<(CÔÃçá¿Iæ¾kœÚ¿fëM‰cпÁ£€ƒ%¶¿‚Æ$ò¶?à[sÜbÐ?%þÀþœÚ?:¿ŽfŽèá?ƒ·Ùœ^Òå?wÖ<1tåè? UˆÝ†ë?¾£x½ì?6.&žè?³•—›§«ç? r¶…Ðå?WEÁáã?¿Ð“î=bß?¨~÷=ÏQ×?³éìsÞ·Ì?2Ó¶>c³?†£ÿíg³¿ª&EJºÌ¿ÜÅÿÏR׿#+ˆ$cß¿d­ÝZã¿ÙŠ[•Ñ忉‘§±¬ç¿õsëÄCžè¿æ wNEžè¿¨HH¬ç¿;:,Ñå¿« öãdã¿Òw,m;cß¿XtW–äR׿ëÞð%ºÌ¿r>±rg³¿Ó‚ e³?”,6ºÌ?³Ù-‚S×?³Brdß?plÍ5 ã?®ÿãéôÑå? \†«ê¬ç? +‹Ãžè?ÆG¬ 3ä?Vtì#Ÿlã?"Mäž¿æá?uN‰Üaß?áŽ-–ÁÙ?‹C=Ø»#Ó?)÷®’Ç?JlöÖ¯?bÐ¥ùMÖ¯¿5° -“’Ç¿ê¾_KÑ#Ó¿‰å” ÂÙ¿FG3šØbß¿“²‚ºpçá¿WùZIRmã¿7þÍ4ä¿,ñ4俆‰ò;Ymã¿.Šž9|çá¿Õkéøbß¿ô®o 0ÂÙ¿Ȳêú#Ó¿zö>YÜ’Ç¿W:ŽÈÖ¯¿é–Üq د?z¡í:ª“Ç?šD@¸$Ó?ʧ° 6ÃÙ?“( ôdß?š\Ïèá?#½œüªmã?ÆÿÑ)4ä?ø¾ùSÞ?Öªp¬sÜÜ?l«ØM™Ú?ÊÖ•Q×? !—9·#Ó?›ƒt);sÌ?µ¬mÜ…Á?ÅF=ƒ®§?Ÿ}Ï[›£§¿Ÿ;]¥3ƒÁ¿µC9qÌ¿/”“»Œ#Ó¿"‚:R׿Çü›r›Ú¿myäáäÞÜ¿7`ñËMÞ¿W-TÞ¿ˆϧ÷ÞÜ¿ë(T$’›Ú¿k€”–fR׿~ŽÆ#Ó¿ò®oë§qÌ¿h³ŸØƒÁ¿Íc¬Àk¦§¿ïVRÂÈ«§?Êd/ÿe…Á?³x¦,|sÌ?«^òÃ$Ó?/®èNS×?v ]×&œÚ?ÕY§éÞÜ?¯•îWÞ?{û,€yÒ?L ãÂÑ?ª©®^Ð?_U© µÌ?·~.R”Ç?a+QzƒˆÁ?˜¨ãYŠšµ?{ªÎ;;?5¼Ö·¿ý¦Ž|1µ¿ÚFœ—Ò‚Á¿rªš‘Ç¿ÃïÂd¸Ì¿ êÞEbп ¬°""ÇÑ¿3Yß{}Ò¿¡É9:}Ò¿¯›—‘9ÇÑ¿üÙ¦mbпSc£×¸Ì¿>š¢5’Ç¿®\ƒÁ¿âÏ`C‘µ¿,™ƒQ¨¿xêB˜å,?2ÏS•»•µ?S!½ ì…Á?´¸E«o”Ç?Žà˜`¨ºÌ?y¢\öÚbÐ?bztÅÆÑ?J’’rD{Ò?µÁ1&þÞ¸?*Ê`oä·?ÛÌ¿ó…¶?ŒÃ&×W³?E-·x&í¯?zl›šÓ§?KØÈ­NX?Ôs¸{ýôƒ?´\+Szƒ¿êŽPf¿ø·’‹l¡§¿7k8ѯ¿»1eN«c³¿(´Lf¼¶¿6ÅIo÷¸¿åkÔÝ÷¸¿Í¼ð ø¸¿e!À)e¸¿œ?¸Tw ¶¿Tg/»d³¿t¯Ÿ6 Ô¯¿‚-²!U¥§¿G"_B¿'—⸘ƒ¿m¸òÙòƃ?èIÜøz2?(Â͹±§?©Ûr¹Z߯?I¯ã=vi³?N1z(#¶?’îO:ý¸?ê«ä­î¸?«owè¹?`±­JàyÒ?´¾zU½üÝ?8C)[$,ä?ÆÀ»TÞ‘è?Ü4I•ì?v2ü yî?ÌÁm¨·°ï?˜·/`·°ï?D6Óúxî?¦J+Òsì?б  è?z.'˜3ä?ùäS¹²Þ?y˜pÈ|Ò?²x&ïâ÷¸?~ñ® ù¸¿·vÕ}Ò¿éÞ¿aæìjÇ3ä¿dÿÅ6Ìè¿9è"x¡ì¿Ô|§Ó'yî¿ ´Þ°ï¿?ˆ CȰï¿sÿ¬ôäxî¿õIÉ×,ì¿ £3ã迚7BÇÈ2ä¿ÙTùå$Þ¿?ÜÊÚxÒ¿bS Þ¸¿âït{—¸?…ÞsðãÃÑ?‚÷³@ÔÜ?†"Ï›Tdã?8ƒ“÷Ÿç?ßþû`ë?ÒÈd¼Mí? £ù@Kyî?~èi0yî?ËÛ—[Mí?=X§hHë?‘™‹«ç?cÙÜïlã?ã(˜oÞÜ?}Jð\ùÆÑ?â¦zco¸?rAÖC¸¿µå­Ê/ÇÑ¿ŸhÞ=¨ÞÜ¿K½ = mã¿Æc¨«ç¿À,RÎbë¿þ3ŽlMí¿¦Lñ)+yî¿HõÕ¶yî¿ÎcõÑ/Mí¿@¹ õë¿HÆl‘úªç¿Q± Ælã¿«½p„ÛÜ¿0Ç,PÂÑ¿ ì»ä·¿Œ5iÅ1¶?´x¡ á^Ð?0ȼ‘Ú?ºðÃ>ÊÞá?ªÉÃÌÀÄå?.¤(L#äè?„r{xÜë?*ñ¬ëì?†yHùÅì?ÄÇ:hë?zÆùgãè?.N“Ðå?=â,#çá?úÔ÷'&›Ú? ‚<DbÐ? tÞhÄ ¶?/^Jè>!¶¿¥îcbпNiIAH›Ú¿lt¸Œ5çá¿] Ví¤Ðå¿Âèm”uãè¿ê ðië¿s Ô¬ì¿TH&žì¿©™;뿼ò»¼ãè¿x'À0Ðå¿~ # Ræá¿ÉVü¹†˜Ú¿íée^пö Šx¶¿ÿqL·.m³? v×?±Ì?ôgb2I×?X¬¦OPTß?[:‚ ã?Æ©ßV²Ñå?¡ˆRßG¬ç?+Ÿ+æ"žè?«±høè?þ "#¸«ç?/hµÜ¤Ðå?u1~ùã?ù¥ gbß?h5I´R×?þÛF¼¸Ì?;/TJfe³?qÇßœe³¿ƒŸij͸̿aº}†%R׿¬qïvbß¿P¼òã¿SÉjŒ­Ðå¿1©Ž¹«ç¿¹1÷Mä迈 b9Ýè¿¿"{\¡«ç¿Bˆ{Ðå¿3A9©ã¿mÆåàNaß¿À¯[P׿èI“l³Ì¿…KïLaT³¿AެžÄ¯?r-'‹Ç?áwÿæÓ?ØŒÿd¸Ù?NÉwoUß?EÖŸ ?éá?Ä Þh­mã?ÕQ³4ä?ŸAã3ä? Þ+®mã?œ;-©<çá?SÜÜ8~bß?ý.@ÆÀÁÙ?Ü]yÄ#Ó?]_’Ç?»î–pÖ¯?ѸõÚÕ¯¿*O!÷>’Ç¿b’#Ó¿¥Rw½ÁÙ¿;#×…bß¿ÝïþÝFçá¿}ÃQ*mã¿['"ð3ä¿1š Žó3ä¿pGÆ=1mã¿`®¢Hçá¿5æÉebß¿OmFbÁÙ¿Eå#Ó¿òÿ“e€‘Ç¿ ,Ì·3௿°^`ypާ?—dc`{}Á?ÜVªhÌ?誤ùÒÓ?Žæt$ N×?÷¦½ßª™Ú?èÆáÝÜ?åâªÞ?Z½ðèÞ?c±®ÞÜ??Q_›Ú?ô$-DR×?+øœä´#Ó? uWÓ¯qÌ?ô œ„Á?©µÉX稧?Êš4r§§¿†ǃÁ¿ÝZ—=eq̿ l›#Ó¿ ë/„>R׿£ôáüx›Ú¿‚0V’øÞÜ¿¿®†xÞ¿]‚à›Þ¿IÂàWßÜ¿®D™„ý›Ú¿0ôKÝÆR׿ç2ç$Ó¿yØ&LòqÌ¿´G·„Á¿|ÆR£)º§¿Ò^¥éóK?"Îd튵?8pÏzÁ?é‘ô-Š…Ç?ž4¤©Ì?°Õ'p®\Ð?³)¹ÇÄÑ?Ù¸+l|Ò?cK¢+Ä|Ò?¶fó0ÇÑ?oÔÿ‹bÐ?áƒA¹Ì?_znŸÃ’Ç?îúÄT„Á?¬)_9“µ?¿‚{X%?N&T ¿^h›|󑵿¦8Ý~˃Á¿Ñ#Õ`T’Ç¿Ïld7¹Ì¿éâ,èšbпկæ8ÇÑ¿LÌg®}Ò¿å"‘ô}Ò¿7Ü.XÈÑ¿ ê×ÁcпanÄ'¨»Ì¿¥§éɔǿ½§:ŸW…Á¿—”Hq{µ¿w§è|+휿(TÜ»„?_…yk?Öóæé=‹§?…UZÿ¯¯?õ³JV±G³?µp R$¶?,¸vžú·?™y‡à«õ¸?·YE5Pø¸?F)ò÷ݸ?Kã?¬w"¶?òþ2•þf³?&6z ٯ?ߪ¹ª§?×ú”8'?ÆE G ´ƒ?qÔ ;ɦƒ¿ôŽZ ¿.Ð>d§§¿À¦•ýÕ¯¿.ÎØSÍe³¿ILÃAü!¶¿àu^Ǹ¿CЗ[Ëû¸¿h×Ú£ý¸¿âù+` ¸¿ÜÙ× ò)¶¿Ý é¢Do³¿Øæp8鯿pcgÔ ·§¿É5ÔNM(¿®ìc½3ƒ¿Ò¯ð¬¤„¿Ë2Ž;D¿®\qA-±§¿Á;ç3åÖ¯¿ÜO›GNb³¿*þ2Ì&¶¿vý¢ë¸¿Š9¾þ÷¸¿2\Ù°ö¸¿W6šgˆ¸¿ §z¸˜¶¿“%’]+c³¿.¾÷jÒ¯¿©ÏçÇ‹¤§¿\˜šr¥¿$±Ø¯ù¢ƒ¿º>µõµƒ?ÜWØÛ×%? ã]@©§?/1ÇÖ¯?m!Mrse³?fî)z ¶?†ÊŸ_¸?0”ÂKõ¸?Àê¸Qyò¸?½;$ù·?za ¶?L qV³?Ô©F¶¯?‰$ØÒˆ§?¹4ôü¤åœ?AèÕèdAƒ?ÑŸkà‚¢¿ñÞ+àfžµ¿JI ^ Á¿ø´ #½ˆÇ¿ó£-K´§Ì¿ÿÖßÓ9†ƒzæá¿j%Oaß¿qÏÀÙ¿ÐÁéŽÛ"Ó¿ÂU“$‘Ç¿l«lÒ¯¿:Š=J+Ù¯?Nü‚ò’Ç?£nÙ-â#Ó?ù „O ÂÙ?"Ìzfâbß?dŸ ‰‰çá?Ó§Ùmã?šº¨#Ý4ä?²nuÞ;6ä?&k$Êeã?µ<:¸àá?ÞýxìùVß?$Oon·Ù?í;€Ó?šJ›Ç?B°)†Gs¯?„17¯yb³¿Ì“ºað²Ì¿øÞµL׿^²*ïYß¿Ú:^R㿱ò3©Ìå¿ü¬%Zרç¿ô€ß›è¿óÕJ5rœè¿½‘@~§ªç¿À“ûÿÞÏå¿Q”ë5e㿌f@3ƒaß¿™^ `gQ׿»Ð¡·Ì¿6P·c³¿6††öùf³?(†o¹Ì?Šº½qR×?/ÑÅ Êbß?#.ŒÎ9ã?¨¡xÑå? Ç‚P¬ç?pªnúžè?kÐÌŸè?˜´¸Ä ç?üõ»ÌÆå?Ž0»£ã?Ü‹?5‘Tß?ÁìÖ )G×?L49©Ì?x!X2gX³?h<2ºz¶¿#D['ë[п”F]Ǔڿ̭øŸaâá¿0±ÜDñËå¿âO2Áßè¿(ÂZ6Ðþê¿6Yõßßì¿F ö–cì¿2³„Üqë¿…ì™™·âè¿—‘’Ðå¿Ø$IïÁæá¿â …šÚ¿;Ä&{Ïaп/S¶¿ª"TYk"¶?hõQ¤bÐ?Õ*D…›Ú?¦ò£sWçá?L ]ÒÐå?áîËÙ¼ãè?eçèåë?íëP¾‘ì?D*k^Gì?ý³‹róê?ÄF8v‘×è?*‚pU§Æå?Qõ£-ßá?Ç` ©Ú?R¦®I\Ð?´Ž²¯'¶? ˜‡"á·¿FÞ·ž¾Ñ¿4vsÇ ÔÜ¿€ÅÁQÎfã¿Ìé´¦ç¿þ’{ÿâýê¿HC2iKí¿ ~µÝÐwî¿T¼H¨.xî¿ø§Dˆ¥Lí¿ØÞ¾ÝÄë¿€iÓ\*«ç¿º&Þ§lã¿Öâ!ÞÜ¿W› Ù¦ÆÑ¿¢¥}”q¸¿oaøx ¸?ÝÆo+XÇÑ?D12àËÞÜ?À.ÐXmã?Súá)¾«ç?ƒ‰€ë?rÚN™Mí? y|ƒyî? çn[zî?Êa"‡e>í?ÂX±Måôê?Í0e¡ç?C õã†dã?IÛl¨ÒÜ?•rí'yÁÑ?OLg¹¸?x“Zv踿>IQ#tÒ¿mÆ«ˆÇøÝ¿ò£­É*ä¿)¤Ó‘è¿-½ì¿Ñ9Žxî¿9F.°ï¿´u.C°ï¿° Bžxî¿äK½,ì¿>«ñÅjè¿;!v3ä¿/fÖyÞ¿óæðîž|ҿνŸm÷¸¿' ÙZù¸?L9Mj }Ò?ážzõÞ?dP[Æ3ä?sТÆè?%ɯŽì?j Äèxî?5ð–qê¯ï?ÏtcĬï?Ü?pî?  :g ì?$¤5=œ“è?e—¯ìƒ+ä?%ð”9CúÝ?¾d%ŸÀvÒ?òÄá‹ô¸?¥"ƒ®ë¸¿ûÃùÿsÒ¿®^âê^÷Ý¿·gÑz)ä¿b‘=ãè¿Ý{ÄÆ쿹IJ8îxÌG£‚°ï¿–W}°ï¿¡øbÆxî¿KߪMIì¿ÛÚ¾U€è¿Û-£;‡3ä¿›p6‰•Þ¿øÿ|&¸|Ò¿êÚ¯Í÷¸¿Õ ‹Šöø¸?ÚŠ€}Ò?nò¥âÞ?Ž“Ir®3ä?Ù2™S§è?Ì“¾£oì?¥ù*óxî?A¿žÀä°ï?¥úw±0²ï?2œbÒ/jî?”ù“EŒ ì?¼eC–•“è?âaÆ¥”+ä?©(>Y.úÝ?ýÙ,b vÒ?ŸŸ_ ð¸?+C&‡>û·¿*Y¼–Š¾Ñ¿¨š dÐÜ¿I!k cã¿·k “Ižç¿:î07™ë¿í?GÊCMí¿*_ɆÜxî¿Uª‚;Õxî¿3”·Mí¿%/sCë¿§Ëh«ç¿äX/Ùlã¿:ÐgUVÞÜ¿óBOdðÆÑ¿’—¹ˆ¸¿9( ¨è¸?¥fýÇÑ?”à`cÞÜ?Íü{£Ølã?8ì ®[«ç??ŠŸùë?hZ^ òLí?åù¤ƒðxî? ‰Ôü€zî?"y2¨r?í?áÒ¯Möê?ª¡õ^O¢ç?©»@‰eã?„—zVÅÓÜ?ó_E)•ÀÑ?µk7éõ·?1V¿~¶¿h=Ÿm8ZпI½væŽÚ¿4zœêÞá¿CWŠxÅå¿4XÕ$Käè¿Ã§[¶ë¿j}øû8ì¿¢×i}Gì¿Ý½Yë¿'ä]ç1ãè¿lnô|qÐ忤0Ûçῌ}ߛڿNóåsCbпWÎ µ!¶¿à7„@¬ ¶?ù¢ƒÊ%bÐ?§2¾äæšÚ?Ù±lëæá?± ¯Â4Ðå?MéäÉâè?òÓjXë?zü¦ÍÌì?V<¬§ì?÷ p-úê?ûã|BªÚè?µó!ׂÈå?aªÛN‰àá?ò°¦²·‘Ú?,3¤" ]Ð?OƒŒíʶ?³wJ%­D³¿G&8¨Ì¿e' ÃG׿D«¤fVß¿úr%—éã¿ÿ­1ÄÍå¿8ð[³;ªç¿°€ˆs è¿~âX£_è¿.¦§b«ç¿}­ojtÐå¿ Ö¼Þã¿Ô¼óÿKbß¿øøÂÅR׿Ùh€¿Ì¸Ì¿l;‰®Ée³¿Õ©Îd³?ß ”ñ=¸Ì?úî ©·Q×?0ÏÐaß?5¨ôÝ„ã?|_©éÏå?õîK±yªç?(ßÚ¦›è?æêŽT:™è?9쨤ç?3n§ÊÇå?óPf{Òã?¼ Uß?d.éH×? pp ±Ì?•ùkªêu³?ôžò2©¯¿¿‡*üåƒÇ¿nVò7çÓ¿% ÝRòµÙ¿æl³aVß¿ ňãá¿“;øFkã¿<ËÇôû2ä¿<nk3ä¿‘áØálã¿cê[j!çá¿Æ1Méeb߿Ĕ ß¹ÁÙ¿E²×"£#Ó¿° T¹€’Ç¿ù,{\ׯ¿\ JhÔ¯??2ᲑÇ?~2|B*#Ó?óT!^#ÁÙ?X{{ò¢aß?Kš˜¡æá?Å…ûw=lã?í¾@½2ä?{Þ‚53ä?©ÊÉ¿aã?ÚQõïÝá?ä- HRß?Þè¾ ö´Ù?øÈMΣÓ?q k‰Ç? Þµ‚Tà¯?Æ(1D©§¿CÖËzÁ¿Šü\àaÌ¿b3BH Ó¿°9Ê/œB׿Q[%8˜Ú¿ü8Æ%ÝÜ¿¬ quaÞ¿¢ ^GÜÞ¿£`)Ò¸ÞÜ¿vvp›Ú¿@Y}LVR׿•!¶EÇ#Ó¿ñnH×qÌ¿}} ,M„Á¿7Fó&ש§¿ë±±*¦§?mÒåKSƒÁ?Ð…Y¿pÌ?OöI$#Ó?6»9•Q×?nŽšÚ?/ûîDÅÝÜ?BÞ?ŽûV‚Þ?m4+î}ÍÜ?Hâµ™ŒÚ?¢Kä±ÍE×?‰?·ÂÓ? Nßì{cÌ?ALö¶{Á?D–Xca‘§?âégE ¿Ü‹ü½‡µ¿víGÉ:|Á¿}x2Óþ‡Ç¿|KÀ!íªÌ¿S¾†q¬cпÈ-tl&ÈÑ¿A%8PÛ}Ò¿± ÉÊ¿}Ò¿¤ ÐâÆÇÑ¿WU¤Ýébпw¿ð–¼¹Ì¿œZÓ“ǿ[Ìщ”„Á¿ .šŠ“µ¿”–û&¿ƒŽ¸I¦?öR,v]‘µ? ÇWefƒÁ?G`È‘Ç?ìY®HB¸Ì?X>;bÐ?¦î)—æÆÑ?l«hZã|Ò?)á ÷}Ò?D]¤¼Ñ?ìl½¢YÐ?­®}Ìü¨Ì?ËÜœ@¤…Ç?=¬„=äzÁ?ÂÒ‘ˆµ?rÕ@µ•?^àÿ@ƒ¿ΆC` ¿ƒ `U­§¿‘kç®M௿Q\_Dq³¿½AU<‹9¶¿aü\¹¸¿ <® u¹¿~aÞ|áþ¸¿Ûfsv®¸¿±T*Ä$¶¿4s+•lh³¿L»ì¾ÞÚ¯¿_L Ôì«§¿ÇÖä×(¿hí¶ƒ¿r9u륃?¡Gf›?vƒõ§§?ªÃzC’Õ¯?±¯W2‰e³?ƒâ#þœ!¶?åM!è2¸?½{ˆº¹ú¸?¿ø¼~;û¸?i- 0ö·?p¦¦u¶? 'ó'}Y³?q¼ÝæÁ¯?UºjU™§?¾qÏ8?`Õ\3„??µK!;Zƒ?q™Ïwc÷œ?‰‰¨Y‹§?Xš…Ñ®¯?ži cˆH³?ëË’aÛ¶?èt%)ñ·?—ZîFŠì¸?j’¸óï¸?†¾â{ü·?œ,Šî¶?dÅ­ÚŸa³?ˆ€Ÿ0Я?Ç;b£§?Ôyn`?²¶ZÑ ¢ƒ?IGì•´ƒ¿3Í_†ß$¿8q‰Y¨§¿ÈåŽ\Õ¯¿Vš¸mkd³¿×¼Ù?¶¿|§ šÿ·¿øJ=kó¸¿á ´8ñ¸¿ÞmÁ;ñ·¿v²oâ>¶¿.i“Á]³¿_QNó˯¿¿/…똣§¿›¿×1&¿ a½ÿ¶Øƒ¿b“vr¹œ?ˆcz€µ?˜)è|8{Á?Ž9Öð‚ˆÇ? SïÝ’­Ì?gM÷\Ð?)’3äàÂÑ?%k§èÊyÒ?¡ÊN”zÒ?ú‹¹ZFÅÑ?÷øNì`Ð?—y޶Ì?צŒ¤Ç?¼‚†ÎŒ‚Á?'6aFRµ?ÞVØÁê?2lóÅE&¿âkÏoµ’µ¿í;ðõɃÁ¿ìÏŒÅÙ‘Ç¿FÄ é·Ì¿Qoiœaп:ÀêÅѿέÀDýzÒ¿5H2AOyÒ¿§ÅOBÂÑ¿¬ÿ77Ù]пþÉQ€±Ì¿G¹„æ>Ç¿õk¨ÓÁ¿ËqLð$—µ¿Ð«G Cz¿qfIv…§?0ÆßÀg{Á?þ.$ªhÌ?جÛ+àÓ?˜ÁW“9M×?'ÐÝþ™–Ú? —ƒÓ©ÚÜ?TÆ]ŒËÞ?úƒRâzÞ?ªga¬ÜÜ?Þô)»™Ú?Œ89^ðP×?-—D§¤"Ó?•Û¢RpÌ?Í}§IÕ‚Á?³KÀ¯-¥§?»[QÜÍ©§¿ÿ1„Á¿£(^;qÌ¿¾ ޝH#Ó¿»bsœQ׿ù.mšÚ¿†b\ÝÜ¿õé6/Þ¿ãxiÐCÞ¿&˜­ [ÛÜ¿ë˜Ú¿[Šo‚O׿ä’Ø!Ó¿Ñ@…V}pÌ¿Q1+.V†Á¿%‡œŠÂ§¿ØÓ󒼯?ñH…°¸ŠÇ?-І°PÓ?‚諽Ù?¤ªþÄ]ß?=Æ» åá?C®0:*kã?l±2?2ä?ÿsñŽ2ä?mÖ¯?!.{>Ö¯¿ÙH+a’Ç¿ï |¦#Ó¿p–åðÑÁÙ¿¨\÷Ï—bß¿c{&ïLçá¿,û2¾+mã¿PÒÐì3ä¿SÒÐì3ä¿6û2¾+mã¿t{&ïLçá¿Ö\÷Ï—bß¿©–åðÑÁÙ¿5 |¦#Ó¿fI+a’Ç¿•0{>Ö¯¿û,{>Ö¯?œH+a’Ç?Ï |¦#Ó?X–åðÑÁÙ?\÷Ï—bß?[{&ïLçá?&û2¾+mã?NÒÐì3ä?‹½,Þ?`¥™uÌÞÜ?´¡)f›Ú?Õ#À=R×? |¦#Ó?.£Œ‰qÌ?æAðÒòƒÁ?Œ]1-¨§?²\1-¨§¿±AðÒòƒÁ¿^.£Œ‰qÌ¿ù |¦#Ó¿Ã#À=R׿§¡)f›Ú¿X¥™uÌÞÜ¿ˆ½,Þ¿½,Þ¿h¥™uÌÞÜ¿À¡)f›Ú¿å#À=R׿$ |¦#Ó¿Æ.£Œ‰qÌ¿BðÒòƒÁ¿„^1-¨§¿×[1-¨§?„AðÒòƒÁ?..£Œ‰qÌ?ç |¦#Ó?±#À=R×?›¡)f›Ú?P¥™uÌÞÜ?…½,Þ?K¾qb}Ò?Þh®9;ÇÑ?_ÒdWpbÐ? šn«é¸Ì? I+a’Ç?æAðÒòƒÁ?¨yÅ[g’µ?A÷L À"?3öL À"¿gyÅ[g’µ¿ÈAðÒòƒÁ¿I+a’Ç¿õ™n«é¸Ì¿WÒdWpbпÙh®9;ÇÑ¿I¾qb}Ò¿L¾qb}Ò¿ãh®9;ÇÑ¿fÒdWpbпšn«é¸Ì¿8I+a’Ç¿BðÒòƒÁ¿èyÅ[g’µ¿røL À"¿&õL À"?/yÅ[g’µ?ªAðÒòƒÁ?îH+a’Ç?ß™n«é¸Ì?PÒdWpbÐ?Ôh®9;ÇÑ?G¾qb}Ò?Ù$ Té¸?eøL@ô·?évLÚƒ¶?ˆB³(˜Y³?¬×,£žÂ¯?Œ]1-¨§?A÷L À"?¤j­ƒ?îi­ƒ¿éöL À"¿d]1-¨§¿"/{>Ö¯¿YLC³Œe³¿²P\™'!¶¿­ó ¸¿t¦i<¸ø¸¿x¦i<¸ø¸¿)­ó ¸¿ÇP\™'!¶¿uLC³Œe³¿i/{>Ö¯¿º]1-¨§¿—÷L À"¿rk­ƒ¿8i­ƒ?žöL À"?<]1-¨§?/{>Ö¯?JLC³Œe³?©P\™'!¶?­ó ¸?r¦i<¸ø¸?šØ$ T鸿‡øL@ô·¿vLÚƒ¶¿ÔA³(˜Y³¿…Ö,£žÂ¯¿²\1-¨§¿3öL À"¿îi­ƒ¿8i­ƒ?ÛõL À"?‰\1-¨§?ü-{>Ö¯?¥KC³Œe³?æO\™'!¶?>¬ó ¸?¥i<¸ø¸?‘¥i<¸ø¸?K¬ó ¸?ûO\™'!¶?ÁKC³Œe³?B.{>Ö¯?ß\1-¨§?ŠöL À"?½j­ƒ?‚h­ƒ¿õL À"¿a\1-¨§¿Þ-{>Ö¯¿–KC³Œe³¿ÜO\™'!¶¿8¬ó ¸¿‹¥i<¸ø¸¿%sкqÒ¿ƒZ F¼Ñ¿ÎôýWXпíKª5§Ì¿©M!Ùكǿ±AðÒòƒÁ¿gyÅ[g’µ¿éöL À"¿ÛõL À"?&yÅ[g’µ?“AðÒòƒÁ?½H+a’Ç?ž™n«é¸Ì?%ÒdWpbÐ?£h®9;ÇÑ?¾qb}Ò?¾qb}Ò?­h®9;ÇÑ?5ÒdWpbÐ?È™n«é¸Ì?ñH+a’Ç?ÓAðÒòƒÁ?§yÅ[g’µ?øL À"?ÎôL À"¿îxÅ[g’µ¿uAðÒòƒÁ¿§H+a’Ç¿ˆ™n«é¸Ì¿ÒdWpbпŸh®9;ÇÑ¿¾qb}Ò¿—¡#«óÝ¿NaÍÜ¿ñŬëÿŠÚ¿*ËaöÝC׿FÚÓ¿^.£Œ‰qÌ¿ÈAðÒòƒÁ¿d]1-¨§¿‰\1-¨§?“AðÒòƒÁ?-.£Œ‰qÌ?Ø |¦#Ó?š#À=R×?y¡)f›Ú?&¥™uÌÞÜ?T½,Þ?Y½,Þ?6¥™uÌÞÜ?’¡)f›Ú?¼#À=R×? |¦#Ó?•.£Œ‰qÌ?üAðÒòƒÁ?\^1-¨§?®[1-¨§¿fAðÒòƒÁ¿ý-£Œ‰q̿Ơ|¦#Ó¿‰#À=R׿n¡)f›Ú¿¥™uÌÞÜ¿R½,Þ¿:ÒÐì3ä¿û2¾+mã¿W{&ïLçá¿›\÷Ï—bß¿p–åðÑÁÙ¿ù |¦#Ó¿I+a’Ç¿"/{>Ö¯¿ü-{>Ö¯?½H+a’Ç?Ø |¦#Ó?R–åðÑÁÙ?ƒ\÷Ï—bß?N{&ïLçá?û2¾+mã?8ÒÐì3ä?;ÒÐì3ä?û2¾+mã?_{&ïLçá?±\÷Ï—bß?‹–åðÑÁÙ? |¦#Ó?JI+a’Ç?p0{>Ö¯?Õ,{>Ö¯¿FM!ÙكǿÑEÚÓ¿ \ŸÎñ±Ù¿Ô‚¡¦?Oß¿ÇzþCÜá¿m2aã¿ÓÂ0y'ä¿©îÆGžè¿úzp„ӫ翦X§‘ÄÐ忹4㿨\÷Ï—bß¿Ã#À=R׿õ™n«é¸Ì¿YLC³Œe³¿¥KC³Œe³?ž™n«é¸Ì?š#À=R×?ƒ\÷Ï—bß?«4ã?›X§‘ÄÐå?ózp„Ó«ç?§îÆGžè?«îÆGžè?{p„Ó«ç?°X§‘ÄÐå?Æ4ã?É\÷Ï—bß?ð#À=R×?Jšn«é¸Ì?$MC³Œe³?òJC³Œe³¿€Kª5§Ì¿ôÊaöÝC׿ʂ¡¦?Oß¿Fä˜êMã¿í_”^RÃå¿ú­bƒ<ç¿‹øyÖŽè¿i— üèì¿4L;›ë¿\4לãè¿«X§‘ÄÐå¿c{&ïLçá¿§¡)f›Ú¿WÒdWpbп²P\™'!¶¿æO\™'!¶?%ÒdWpbÐ?y¡)f›Ú?N{&ïLçá?›X§‘ÄÐå?O4לãè?,L;›ë?g— üèì?k— üèì?;L;›ë?g4לãè?ºX§‘ÄÐå?v{&ïLçá?Ú¡)f›Ú?‡ÒdWpbÐ?šQ\™'!¶?O\™'!¶¿“ôýWXп¸Å¬ëÿŠÚ¿¼zþCÜá¿æ_”^RÃå¿zvoFÔè¿WôÞõð꿺ã«r™ì¿óô”Ïyî¿ÊP‡³Mí¿9L;›ë¿{p„Ó«ç¿,û2¾+mã¿X¥™uÌÞÜ¿Ùh®9;ÇÑ¿­ó ¸¿>¬ó ¸?£h®9;ÇÑ?&¥™uÌÞÜ?û2¾+mã?ózp„Ó«ç?,L;›ë?ÁP‡³Mí?ðô”Ïyî?õô”Ïyî?ÒP‡³Mí?FL;›ë?{p„Ó«ç?@û2¾+mã?¥™uÌÞÜ?i®9;ÇÑ?®ó ¸?`«ó ¸¿HZ F¼Ñ¿aÍÜ¿^2aã¿î­bƒ<ç¿WôÞõðê¿9¬Ê^£;í¿CB&P¹fî¿Ò E<Ãï¿MB&P¹fî¿Êã«r™쿞øyÖŽè¿ëÂ0y'俈½,Þ¿I¾qb}Ò¿t¦i<¸ø¸¿¥i<¸ø¸?¾qb}Ò?T½,Þ?8ÒÐì3ä?§îÆGžè?g— üèì?ðô”Ïyî?S®ûçK±ï?X®ûçK±ï?õ”Ïyî?— üèì?ËîÆGžè?eÒÐì3ä?½,Þ?€¾qb}Ò?z§i<¸ø¸?¦¤i<¸ø¸¿á½qb}Ò¿"½,Þ¿%ÒÐì3ä¿”îÆGžè¿[— üèì¿èô”Ïyî¿P®ûçK±ï¿Ø E<Ãï¿RB&P¹fî¿Îã«r™ì¿£øyÖŽè¿ïÂ0y'俽,Þ¿L¾qb}Ò¿x¦i<¸ø¸¿‘¥i<¸ø¸?¾qb}Ò?Y½,Þ?;ÒÐì3ä?«îÆGžè?k— üèì?õô”Ïyî?X®ûçK±ï?]®ûçK±ï?õ”Ïyî?†— üèì?ÏîÆGžè?hÒÐì3ä?ǽ,Þ?‚¾qb}Ò?~§i<¸ø¸?ª¤i<¸ø¸¿írкqÒ¿P—¡#«óÝ¿ÁÂ0y'ä¿~øy֎迵ã«r™ì¿AB&P¹fî¿Ó E<Ãï¿YB&P¹fî¿Z¬Ê^£;í¿,WôÞõðê¿®bƒ<ç¿“2aã¿h¥™uÌÞÜ¿ãh®9;ÇÑ¿)­ó ¸¿K¬ó ¸?­h®9;ÇÑ?6¥™uÌÞÜ?û2¾+mã?{p„Ó«ç?;L;›ë?ÒP‡³Mí?õ”Ïyî?õ”Ïyî?âP‡³Mí?UL;›ë?"{p„Ó«ç?Jû2¾+mã?Ÿ¥™uÌÞÜ?i®9;ÇÑ?%®ó ¸?m«ó ¸¿QZ F¼Ñ¿&aÍÜ¿h2aã¿û­bƒ<ç¿WôÞõðê¿I¬Ê^£;í¿SB&P¹fî¿Úã«r™ì¿2WôÞõð꿪voFÔè¿`”^RÃå¿ôzþCÜá¿À¡)f›Ú¿fÒdWpbпÇP\™'!¶¿ûO\™'!¶?5ÒdWpbÐ?’¡)f›Ú?_{&ïLçá?°X§‘ÄÐå?g4לãè?FL;›ë?— üèì?†— üèì?UL;›ë?4לãè?ÏX§‘ÄÐå?‡{&ïLçá?ó¡)f›Ú?—ÒdWpbÐ?¯Q\™'!¶?.O\™'!¶¿ ÒdWpbпe¡)f›Ú¿N{&ïLç῟X§‘ÄÐå¿]4לãè¿>L;›ë¿— üèì¿ÍîÆGžè¿{p„Ó«ç¿ÅX§‘ÄÐå¿Õ4ã¿Ö\÷Ï—bß¿å#À=R׿šn«é¸Ì¿uLC³Œe³¿ÁKC³Œe³?È™n«é¸Ì?¼#À=R×?±\÷Ï—bß?Æ4ã?ºX§‘ÄÐå?{p„Ó«ç?ËîÆGžè?ÏîÆGžè?"{p„Ó«ç?ÏX§‘ÄÐå?â4ã?ö\÷Ï—bß?$À=R×?tšn«é¸Ì?@MC³Œe³?KC³Œe³¿~™n«é¸Ì¿•#À=R׿“\÷Ï—bß¿¸4㿱X§‘ÄÐå¿{p„Ó«ç¿ÉîÆGžè¿gÒÐì3ä¿Eû2¾+mã¿~{&ïLçá¿á\÷Ï—bß¿©–åðÑÁÙ¿$ |¦#Ó¿8I+a’Ç¿i/{>Ö¯¿B.{>Ö¯?ñH+a’Ç? |¦#Ó?‹–åðÑÁÙ?É\÷Ï—bß?v{&ïLçá?@û2¾+mã?eÒÐì3ä?hÒÐì3ä?Jû2¾+mã?‡{&ïLçá?ö\÷Ï—bß?Ä–åðÑÁÙ?I |¦#Ó?~I+a’Ç?¶0{>Ö¯?-{>Ö¯¿xM!ÙكǿûEÚÓ¿@\ŸÎñ±Ù¿ƒ¡¦?Oß¿îzþCÜῘ2aã¿ÿÂ0y'ä¿å—¡#«óÝ¿±aÍÜ¿LƬëÿŠÚ¿zËaöÝC׿HFÚÓ¿Æ.£Œ‰qÌ¿BðÒòƒÁ¿º]1-¨§¿ß\1-¨§?ÓAðÒòƒÁ?•.£Œ‰qÌ? |¦#Ó?ð#À=R×?Ú¡)f›Ú?¥™uÌÞÜ?½,Þ?ǽ,Þ?Ÿ¥™uÌÞÜ?ó¡)f›Ú?$À=R×?I |¦#Ó?ü.£Œ‰qÌ?Ö¯?$MC³Œe³?šQ\™'!¶?®ó ¸?z§i<¸ø¸?~§i<¸ø¸?%®ó ¸?¯Q\™'!¶?@MC³Œe³?¶0{>Ö¯?²^1-¨§?ÈøL À"?Al­ƒ?j­ƒ¿ hÏÊ¿¼Üño˜™§¿€Ø,£žÂ¯¿C³(˜Y³¿™wLÚƒ¶¿,øL@ô·¿[Ú$ T鸿©¤i<¸ø¸?g«ó ¸?$O\™'!¶?KC³Œe³?û,{>Ö¯?×[1-¨§?&õL À"?8i­ƒ?‚h­ƒ¿ÎôL À"¿®[1-¨§¿Õ,{>Ö¯¿òJC³Œe³¿O\™'!¶¿`«ó ¸¿¦¤i<¸ø¸¿ª¤i<¸ø¸¿m«ó ¸¿.O\™'!¶¿KC³Œe³¿-{>Ö¯¿\1-¨§¿|õL À"¿j­ƒ¿Íg­ƒ?ühÏÊ?.Úño˜™§?Õ,£žÂ¯?ÿ@³(˜Y³?5uLÚƒ¶?”øL@ô·?¨×$ Té¸?ã½qb}Ò?{h®9;ÇÑ?ÒdWpbÐ?j™n«é¸Ì?œH+a’Ç?„AðÒòƒÁ?/yÅ[g’µ?žöL À"?õL À"¿îxÅ[g’µ¿fAðÒòƒÁ¿€H+a’Ç¿T™n«é¸Ì¿ûÑdWpbпuh®9;ÇÑ¿á½qb}Ò¿ä½qb}Ò¿h®9;ÇÑ¿ ÒdWpbп~™n«é¸Ì¿´H+a’Ç¿¦AðÒòƒÁ¿oyÅ[g’µ¿Ï÷L À"¿ƒôL À"?¶xÅ[g’µ?HAðÒòƒÁ?jH+a’Ç?>™n«é¸Ì?ôÑdWpbÐ?qh®9;ÇÑ?à½qb}Ò?$½,Þ?ý¤™uÌÞÜ?Y¡)f›Ú?…#À=R×?Ï |¦#Ó?..£Œ‰qÌ?ªAðÒòƒÁ?<]1-¨§?a\1-¨§¿uAðÒòƒÁ¿ý-£Œ‰qÌ¿¸ |¦#Ó¿s#À=R׿L¡)f›Ú¿õ¤™uÌÞÜ¿"½,Þ¿&½,Þ¿¥™uÌÞÜ¿e¡)f›Ú¿•#À=R׿â |¦#Ó¿e.£Œ‰qÌ¿ÞAðÒòƒÁ¿4^1-¨§¿†[1-¨§?HAðÒòƒÁ?Í-£Œ‰qÌ?¦ |¦#Ó?a#À=R×?A¡)f›Ú?í¤™uÌÞÜ?½,Þ?'ÒÐì3ä?û2¾+mã?F{&ïLçá?~\÷Ï—bß?X–åðÑÁÙ?ç |¦#Ó?îH+a’Ç?/{>Ö¯?Þ-{>Ö¯¿§H+a’ǿƠ|¦#Ó¿:–åðÑÁÙ¿f\÷Ï—bß¿={&ïLçá¿û2¾+mã¿%ÒÐì3ä¿(ÒÐì3ä¿ û2¾+mã¿N{&ïLçá¿“\÷Ï—bß¿s–åðÑÁÙ¿  |¦#Ó¿4I+a’Ç¿R0{>Ö¯¿·,{>Ö¯?jH+a’Ç?¦ |¦#Ó?"–åðÑÁÙ?N\÷Ï—bß?5{&ïLçá?ýú2¾+mã?#ÒÐì3ä?—îÆGžè?èzp„Ó«ç?•X§‘ÄÐå?«4ã?\÷Ï—bß?±#À=R×?ß™n«é¸Ì?JLC³Œe³?–KC³Œe³¿ˆ™n«é¸Ì¿‰#À=R׿k\÷Ï—bß¿œ4㿊X§‘ÄÐå¿ázp„Ó«ç¿”îÆGžè¿˜îÆGžè¿îzp„ӫ翟X§‘ÄÐ忸4㿱\÷Ï—bß¿Þ#À=R׿4šn«é¸Ì¿MC³Œe³¿ãJC³Œe³?>™n«é¸Ì?a#À=R×?N\÷Ï—bß?4ã?X§‘ÄÐå?Úzp„Ó«ç?’îÆGžè?]— üèì?(L;›ë?Q4לãè?¢X§‘ÄÐå?[{&ïLçá?›¡)f›Ú?PÒdWpbÐ?©P\™'!¶?ÜO\™'!¶¿ÒdWpbпn¡)f›Ú¿F{&ïLçá¿‘X§‘ÄÐå¿E4לãè¿ L;›ë¿[— üèì¿_— üèì¿/L;›ë¿]4לã迱X§‘ÄÐå¿n{&ïLçá¿Ï¡)f›Ú¿€ÒdWpbп‘Q\™'!¶¿O\™'!¶?ôÑdWpbÐ?A¡)f›Ú?5{&ïLçá?X§‘ÄÐå?:4לãè?L;›ë?X— üèì?ëô”Ïyî?ÂP‡³Mí?2L;›ë?ÿzp„Ó«ç?&û2¾+mã?P¥™uÌÞÜ?Ôh®9;ÇÑ?­ó ¸?8¬ó ¸¿Ÿh®9;ÇÑ¿¥™uÌÞÜ¿û2¾+mã¿ízp„Ó«ç¿%L;›뿺P‡³Mí¿èô”Ïyî¿íô”Ïyî¿ÊP‡³Mí¿>L;›ë¿{p„Ó«ç¿;û2¾+m㿇¥™uÌÞÜ¿ i®9;ÇÑ¿®ó ¸¿Z«ó ¸?qh®9;ÇÑ?í¤™uÌÞÜ?ýú2¾+mã?Úzp„Ó«ç?L;›ë?²P‡³Mí?æô”Ïyî?S®ûçK±ï?öô”Ïyî?r— üèì?¸îÆGžè?NÒÐì3ä?…½,Þ?G¾qb}Ò?r¦i<¸ø¸?‹¥i<¸ø¸¿¾qb}Ò¿R½,Þ¿6ÒÐì3ä¿¥îÆGžè¿d— üèì¿íô”Ïyî¿P®ûçK±ï¿U®ûçK±ï¿þô”Ïyî¿— üèì¿ÉîÆGžè¿cÒÐì3ä¿¿½,Þ¿~¾qb}Ò¿x§i<¸ø¸¿¤¤i<¸ø¸?à½qb}Ò?½,Þ?#ÒÐì3ä?’îÆGžè?X— üèì?æô”Ïyî?M®ûçK±ï?² 8‚Þ¿5Ñ%Ü¿Yu«J¢Ö׿ÌÛ¶õ5Ò¿„ß¿^NgÈ¿0T馰º¿ÂTÖFÄ £¿^o€u“©C¿ŒÇˆBEC¿Û@•?£¿ÔœMÅ.º¿Œ=ÆŠÄšÈ¿à‡¬«¤^Ò¿6Þý £÷׿:½Dß>Ü¿]a²;¨…Þ¿þ“Ø?†Þ¿ÊG7ò:Ü¿Åó²2"æ×¿„Ûh>©<Ò¿cbÙFO-È¿0Àº‘¹¿# \ûŽ$ ¿6báÊw?˜E|Åšv?{Ó:2K ¿2«µLÆ­¹¿ú¼ R?È¿¿Ó‰wGÒ¿>Œ]ò׿s]ž[GÜ¿&Æ8R”Þ¿ ºÆö*Ü¿%›ÎÙ¿”¤°]VÕ¿‹ïBŠпy Âmß<Ä¿â?<«¨²¿ka­Õ¬‹{¿²k²Cž?Pe²ež?VúÌ—F{¿’‹FuÚ§²¿T£¼.8cÄ¿0’×Ð.п«Æ? p¸Õ¿®î÷Ù¿DY¨n8Ü¿ªzö(À?Ü¿ëãXMùÙ¿ªx `­¡Õ¿cOÎ ëϿݭë5´ŽÃ¿‚b—P(°¿VÐñËùw?L&þ0¦?ÄÑLÿ¦?ĸ¡Aº`v?†Ò¶Ô$I°¿Òýæ ͢ÿ‘ŒXп°1¨¯Õ¿Jnã׿ëOÙ%×ø×¿˜šO4<»Õ¿Ãàìõ[Ñ¿!owÛ@UÇ¿òð@ãuŵ¿ov‡•Mv?¶u1Vc;³?,?¼ÊÂî¼?æzT%Eà¼?Zçö ¬³?̸cÑvðs?G`ÆVòµ¿<ó´L{oÇ¿JŽÐõjÑ¿‹o7›¾ËÕ¿ørÄpS Ø¿€;íq!3Ò¿fÂ[¡Ï¿Lã=§ÄÇ¿6Bëº)¸¿ß`ê¿Ñ`¿ÿìDY8µ?ïaè%MëÂ?”•%·FqÇ?&LðÍtÇ?ÊXöîÂ?õ +õ,µ?Øc§º˜e¿OÕÉÑnq¸¿¬*•+EпK¹R­vÒ¿†ò÷§9È¿ê%¯nÿúÍ_ù†µ¿·$}ì\üc?µ_*,_¸?œ!ÀŽÇ?ÂFàñUÏ?Tqš˜HéÑ?ª~5ÀêÑ?ÑiʬUÏ?Yß7ÁhÇ?ÜQpAG¸?ˆaĦa?6lŠé¦µ¿¯d à5‚ÿ®^U¯…#È¿Q4X֞ȿ ÒÐ$¤kÄ¿Ãf'™ h·¿Epg÷ãi¿ôBœ2¸?W¦¦–´Ç?Ôµ÷¨=ZÐ?w–$ ÉÍÒ?Ñ`øÇÙÈÒ?z7PÐ?Ïbj6žÇ?jž]¨Qç·?¼ F„Líp¿,Ȇž÷´·¿tΑ%—Ä¿š»AGìÖÈ¿æ/eþY๿ëbtØ=°¿sSr¹µ®v?~´åÁÆ·?ì•Q™ÓÇ?øMäØå^Ñ?sÀ¡Õ?ºéo"bº×?H©¹ðC»×?õíß7}Õ?fN#2XÑ?b\ÞÎÇ?‡1ù`PÕ·?lÇ +ešx?¼ŒÏµê °¿=#, y¹¿|{åâ”̺¿Î’Uô˜¼²¿€˜çxŒÎv¿†½Úï4µ?¸ÁÇñíÆ?Ñmé6iIÑ?GÌòeÊÕ?@¸>?Ø?uÒëÛ9Ø?lwÆé¿Õ?–âÊ&4>Ñ?dDÄJÓÆ?]wWlÀ´?pPxD|¿¼àkų¿«ZlLB»¿¶dѾ>É ¿s‹›ä”ov?Ôì!S=³?1Ÿ³Q|ÝÄ?T¼ nÐ?Ú€hVåÕ?v^V-Ú? ˆÊ ¤;Ü?=îÅðü;Ü?s#/3ÿÙ?û¸±çºÚÕ?n«< hÐ?n/,ù çÄ?MÀý $f³?röØ´4z?{ü QÖŸ¿#1DÓ)£¿€çê|¿h„'j¶¿®?`¤êqÕÂ?óؘà7Ï?*jsVlÕ?Ü 6ÅìÙ?ùžè¢xaÜ?j”é\Ü?“Žð.âÙ?¥IÝÈ­aÕ?|Š¥7.Ï?Ônªm·µÂ?÷wô®?/ÍõG½w¿¿ó(Ä$¤¿ '‘„Pkt?TÉeSn„¦?‚MA«J ½?dTú’¯ÀÉ?  ,¾þèÒ?˜pÊx%gØ?ب;³~Ü?gú\¨´Þ?Š=xÕw²Þ?F i‹þtÜ?ø6æGÉPØ?‰uöžÝÒ?<…Ê5ÌÉ?&צ ½?°å©_—‚¦?_1U&y?R]Õ VJ¿4àþ¡¦?„ª탸?&¶¿[Ç?>Í,×=ÛÑ?íþœ;!©×?£8ßÑ'Ü?ü£: ãœÞ?Y=Ëg²™Þ?5IJþ« Ü?ØÇI ×? 7ÅÄÕÏÑ?t{We=Ç?FžÜ?_Å28Ü?D<Ìp øÙ?\Ñ’§*ÔÕ?ê€jŽbÐ?Â[¹Å§ÜÄ?<äV³?•Ìæo‡y?¨iܧ 쟿Qè^•,+£¿¶dxwÂ|¿Æo{KAÆ®?˜û 0œÖÂ?ïa/)8Ï?LGS tkÕ?XÇâ0cêÙ?ƒÌ,üebÜ?ƒí®haeÜ?ö…Ó8êíÙ?n<\%¹iÕ?ÊWÅ ¬)Ï?7׈8«½Â?—ž•:®?yr6¸wõ€¿X>,g½¤¿”wí¢ˆ¹¿ø#ß&¯¿ppGoc_{?ñXÁóù·?(öŒn˜ñÇ?Ýì§wælÑ?1G1f…Õ?¥ëlS-¼×?zoŒŽ¸×?:§,¹vxÕ?aÔÜiˆSÑ?ÉŠØîvÅÇ?šÜÚõnÆ·?Ño+–Ýw?¾œVb°¿tóÁÏ~¹¿$N¸î"Ϻ¿gZÅ’ð_Ï?äĩܨêÑ?tcÇtÝèÑ?Kïá*˜NÏ?Œ{ÜTSÇ?Ft-Ž:¸?×þøqRˆ_?3y}k¢¯µ¿öÓÔ®‚…ÿžÞWÕ%È¿úmDd È¿3o§8ŸlÄ¿d¹»ÊÑh·¿ˆÀß—Âi¿—›íñü¸?À„ûµÇ?™‚QãYÐ?÷CZ’—ÎÒ?¤óQBÎÒ?Š,·ðÔZÐ?ºåXiœºÇ?ç–wê%¸?h9¿ƒ{i¿á/8m{·¿ÄåÔ"ZÄ¿9„-³‡È¿bºº¦-Ò¿sЩ ÌÏ¿Þ<™µ2Ç¿ø¼mðŽ@¸¿p÷¦Y×_¿é©eàKµ?t“ÑãbóÂ?Âov#tÇ?Mš¡#qÇ?žk(²çÂ?ŸÞ jŽ µ?Šˆ+õÐf¿M걇y¸¿Ï”M£…LÇ¿öiþ¹àãÏ¿!Mß9Ò¿BÕœü`Ò¿ kÛÓ2п*c£‘¤Ç¿Íê|ޏ¿£=Âdàö.È¿Ÿ÷wÅ4“¹¿^R±& ¿ºäY2w?rJ%ÖTw?€á¢P `Ÿ¿Öy±åd'¹¿3šl…È¿qu-Ò¿ôšsè´Ý׿¶4Æg‚4Ü¿ˆü6 ‡Þ¿~œÝdrÞ¿ô¡ƒž&Ü¿Añ™ïÑÚ׿°1‘A9Ò¿ìUPð­GÈ¿> ö|ŠÛ¹¿€©%~Z ¿¢¥Š·(w?¬dù x?['=t ¿~x’E‚¹¿Ô¼1ûÉ&È¿|o:“*:Ò¿$[Nÿ{ä׿¬jÇ R9Ü¿›ž«M¦?n¤Zëx?µÕÆ/k°¿06_÷ˆÃ¿ÃUáæÏ¿Ú¡¨ y Õ¿ÈLØÎùÙ¿pó‚Ís@Ü¿­™>,:Ü¿„1DßòùÙ¿…g€K¼Õ¿j·Óô-4п—Œ]!´pÄ¿P'§ŸÐȲ¿áÖ5´‘Ë}¿4ÙÀ°^?$…‘\B?àÂCQŠRz¿9äÃÎD²¿œe«³1*Ä¿l]£…п¯Ï&‚œÕ¿Hx!.ÞÙ¿ƒkiü_&Ü¿^ û†#ð׿Ï-Ç=¬Õ¿è=ÃL|PÑ¿âV^#6Ç¿žnS¶¨µ¿XÁ¼1I|u?ˆî#Œ-³?Bˆá÷úð¼?ê®ÙQQÿ¼?ÖNEK³?üqº*Š)w?›_œºµ¿³9ÕœQÇ¿N[üÉ[Ñ¿­€§º[»Õ¿}pxçýù׿ñ¾ —¬å׿ôË'á“¡Õ¿¬fÅqS\Ñ¿«à¿D¥¥Ç¿YG»ÚFm·¿Ü±9åÍ1w¿Ør±E´®?ôÍò%/{¸?òîæßl¸?îJöòj’®?œ €öv¿û•Æ3~^·¿`Ö‘Ç¿A-Ó.1YÑ¿°–%{4 Õ¿Ý}Ö…æ×¿!’|ÐiÒ¿3)âø§3пáÓÁûB Ç¿ð V!j¸¿WœAžNa? íä¶·?_êÍËÄ?R&°Y³É?S®¥ßjºÉ?+ÃUœõÖÄ?ÿ›î™¤¸·?`žÈÐê[?“ÓîÛV‡¸¿âÉÊœ¢Ç¿4tGì­2п5H{C¼aÒ¿Æ‹FY;Ò¿ ·Â¸=éÏ¿zþ5$TÇ¿H쌂´¸¿Rh–Ê×üi¿®îNL³µ?ãA¡HÕÂ?Á8‹[Ç?Í\X¸5]Ç?ù"­Á!âÂ?êh˜m,µ?XëÊ”‰Le¿$ë‰ùëq¸¿’.¤iMÇ¿¿§ô¯dèÏ¿ ÖqÃûCÒ¿ÔB~M·È¿|à÷hÄ¿ Y¶pÇ|·¿< ]1j¿g½‚¸?”€áe»µÇ?ÕÁ$ÂXÐ?,8`»ŸÏÒ?æºÖÜ”ÓÒ?ö’ÄP_Ð?ü E<ü¼Ç?бd!r(¸?x÷âK?ùh¿Þ°¢ ®e·¿ˆ§($ÈlĿ؇˜{a¢È¿÷nE¤)È¿­‘c1‹Ã¿²uå4w¿µ¿‹\ÎKZ?(K ¸?FwP¯÷ïÆ?XQÓæG:Ï?®Å'€íÛÑ?ÙtGQnÛÑ?”µúI;Ï?R9D%ˆöÆ?8û#¥89¸?X¨9ßca?#8®cÍšµ¿ná÷Ð*rÿ}æ¹P;È¿ô"å罺¿gK’ 0Y²¿ 7Á©9¦w¿¿ÿ<¹Íù´?øNšLyèÆ?@¯$’GÑ?rMíJÇÕ?øö|Ýk@Ø?ºÁH)EØ?¤©¿îêÏÕ?%<…µ NÑ?T°SåôÆ?~77‘ µ?ˆy‹æv¿dà|¡¾²¿ˆÃ>Ú-Ôº¿ž/8š7‡¹¿PM÷Çà°¿Š˜d² év?riÒÎÓ²·?ŸiÿÁ‚¹Ç?Á*.fLÑ?´ÉhæoÕ?ªJ-&W¬×?ØB·…b©×?DaÀUcÕ?¬<”ª=?Ñ?¢TrPµÇ?’2rrÍ·?°\ì ùz?öx—'†¯¿œºÏÛ¦¹¿,8-àB¹¢¿«¥óg„r¿Hàg´Ë·®?vFùôñÏÂ?j. ±:.Ï?ÞnaMJiÕ?«š2èÙ?ÐΣbÜ?¿ég_pgÜ?B.«CòÙ?†üe|÷pÕ?+ˆÌ6S?Ï?ʫ䎸ÚÂ?+ɤˆ!Ë®?Lã\[,í|¿§ 38£¿e©'  ¿î{ƒÞ†Éx?zë$GH³?cÊ›òÔÄ?²ÍåÇ?êö›æoÐÑ?xÕ·®;£×?ë:¹z!Ü?p*ÓùšÞ?ŠÉå• Þ?^ î3ù+Ü?||ù«×?¢ƒñ¾+ÝÑ?¨G{ ^Ç?ø‚œ- …¸?œËå˜?u\Ú1åN¿ 9º×¯0x?0 þ˜W¦?÷{K“Ô½?Æ»þ¼É?3&—§ÔÒ?âDGGØ?6 MfkÜ?bj[H§Þ?n›ÅÖ¥Þ?M¤‹øxYÜ?Èö²A.Ø?²žÛaÁÈÒ?Žš‰Å·É?ì4?ž4½?öÖÐLɦ?.º &Bcs? ¥wK\™e¿ xMö¯œ?<Ìí-"¸?Ü)·Ë1Ç?–ip%ÌÑ?ˆ•EdŽž×?Ty…‰Ü?°@3´!–Þ?~× X”›Þ?Zn½Ý'Ü?ŸUûûQ§×?µÊ´êÙÑ?õø AWÇ?.¨RÉz¸?,×êÎÂ}?È“ÔFOP¿– Õâ"x? ïD/ÖW¦?z¤ÕcT½?¤ÞÒÀºÉ??Jú¸ ÓÒ?ÜÃŽöÄDØ?ä±xevhÜ? M†•²¤Þ?nÈ #/¥Þ?®Ú±Za`Ü?W°MŽ7Ø?bB÷1ÃËÒ?å©7Û°É?i†PaQî¼?Œè H¦?— ÜœuÛq? Äg»¤¿îxøÕ€¿÷™³!K#®?JäFkX³Â?VHêÏ?žkÌq2aÕ?´ª´ áÙ?ØÇ(CZÜ?ùÜ%Íö^Ü?XùKA°éÙ?M€a(ãhÕ?ùƒµ1Ï?"ê|ÙñÎÂ?ÏËk@§®?¦j´é°}¿V\F£¿7N/’L ¿TÖ)¶x? ¯Õf4G³?‹0JÜ’ÓÄ?˜Ð»Öª\Ð?®Qú¬ÐÌÕ?˜X[ŠÿïÙ?ºiÍé§,Ü? ]N+-Ü?.Iv–ðÙ?ƒ¢øÜÌÕ?l3<Ï?BÓÇ65ÝÑ?ú§,ÜÑ?Z«™~±7Ï?D?§èÚëÆ?¦: h¸?r4úe[fS?펺JI浿l£F£Ã¿Á4ãáÍDÈ¿™v0ßkÒ¿}ÎC¸u;п{Mo°ž±Ç¿Nr[Ÿ¸¿à‰Ž)W?ä\~¨·?¹”¡Û=ÏÄ?àCÓ K·É?â_ÍŠ¹É?4ÃA”\ÓÄ? ×*€±·?È>¥IZ?ïʵE¸¿8Û&– ¥Ç¿2KJ5°3п’ÍíbÒ¿ß´ÈI<Ò¿`ÿ~±éÏ¿Š¢=¼SÇ¿Ò=‡ ‹¸¿˜huh¬}i¿•]³áµ?"¡t5ÖÂ?Ù„‹ƒ`[Ç?'Ò1ZÇ?Z3DŽ¢ÑÂ? \£Ûô´?óF…H‘l¿uŸôõª¸¿T½'‰°fÇ¿‚OolþÏ¿!ì„“FÒ¿Š†¬m Ø¿Âám¦ÁÕ¿h§ìê–^Ñ¿oñHç±TÇ¿ðÔoëw¼µ¿œvpFA&w?ÕÝDáL³?w³­È½?×̶ý ½?FúéÓ‰L³?cÎô1.w? ½XQL»µ¿Õ" BCRÇ¿ì%­`[Ñ¿ê"ЎĻտ9C Vú׿¯6¡{äå׿ßÛ§š¡Õ¿®Lî\\Ñ¿ˆgǿÈÃ܆j·¿À¹Y–Hw¿BàÆ¥4³®?[ùDÀ“z¸?ŸÂ¸XZy¸?øìÍæ_¡®?U&ðøÄIx¿XµÓšý…·¿æð~µÇ¿xüŒ¹¬eÑ¿Á-»Ÿ«Õ¿¹G•mï׿é„f5GÜ¿ÊÝeŒÎûÙ¿ªÖëZŸÕ¿ÌéÜ4ÞÏ¿e€>ÙØ~ÿ³˜åà °¿\áý°Ùy?:“’¿›t¦?ãx·¾§o¦?œ·|Èqy?i _Ÿ°¿aÃß0‡Ã¿I„sçåÏ¿lf ? Õ¿zK†óøÙ¿ÒŒ;×n@Ü¿Œ>ÀÆ :Ü¿fÑ:ÚÐùÙ¿%IÖú9¼Õ¿.¡4Ã3пZ\9cÄoÄ¿ÚZšºqDz¿ŠaJ6…É}¿¨éÛä\`?ÆTüx…Y?@ûŸœj~¿ù©iúÛܲ¿ŒÒX¦¦~ĿܟÑ<пaþejÆÕ¿WÀÒAlÚ¿ÑÅ^=,DÜ¿wb?äüŽÞ¿›&£^>9Ü¿mÕÑuéÝ׿‹ð‚½ô,Ò¿¥[Ø,È¿ÞèµÉDh¹¿³'I»üºŸ¿#tí“8gy?a*qñxIy?=Dh5ÕŸ¿ÀLu¶y¹¿Ï÷Ïâ#È¿8­"i39Ò¿š‘Ø£Ùã׿‚C£æ8Ü¿"} Ã †Þ¿´œòz’†Þ¿æ¹LdÖ@Ü¿<ï,,³ú׿ÏÓ’\ábÒ¿zÈQ֥ȿšãƒÈ)Þº¿£ÓO§²T£¿ºŠøÇS¿ò·ÀÚ•T¿F瘴ap£¿y…²7Möº¿ÌñÛº¶È¿MshUÅlÒ¿n¥S:Ø¿CÐÙÞ1MÜ¿bñ+”Þ¿ccseapps-2.5/CCSEApps/iamrlib/test2d/inputs_50000644000175000017500000001370311634153073022200 0ustar amckinstryamckinstry# NOTE: all the values here must be set unless specifically # marked as optional #********************************** #ALGORITHM CONTROLS (defaults shown; these are both optional) #********************************** proj.proj_2 = 1 proj.filter_factor = .1 ns.init_iter=1 #********************************** #RUN CONTROLS #********************************** # MUST SET ONE OR BOTH OF THESE. max_step = 1 # maximum (integer) number of time steps #stop_time = 2.0 # maximum (real) time (in same units as dt) amr.n_cell = 32 32 # indices of the domain at level 0 # (this one is optional) #amr.restart = # set if starting from a restart file, else comment out # This will default to file "probin" if not set amr.probin_file = probin_5 #********************************** #ADAPTIVITY CONTROLS #********************************** amr.max_level = 1 # maximum number of levels of refinement amr.regrid_int = 2 # how often to regrid if max_level > 0 # (this one is optional) amr.regrid_file = fixed_grids_5 # file name for specifying fixed grids # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 2 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 0 proj.v = 1 diffuse.v = 0 amr.v = 1 mg.v = 0 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) #ns.sum_interval = - 1# interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 20 # (integer) number of timesteps between checkpoint files amr.check_int = 2 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 2 # (integer) number of timesteps between plot files #amr.plot_vars = x_velocity y_velocity density tracer amr.derive_plot_vars = avg_pressure #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt #ns.fixed_dt = 0.9 # Time step # (this one is optional) #ns.init_shrink = 1.0 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.0 ns.scal_diff_coefs = 0.01 ns.variable_vel_visc = 0 ns.variable_scal_diff = 0 # (this one is optional) #ns.gravity = 0.0 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** # # NOTE: The domain size must be a multiple of 2 for the BCs to work # properly for the viscous benchmark. # geometry.coord_sys = 0 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 2. 2. # physical dimensions of the high end of the domain geometry.is_periodic = 1 1 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 0 0 # boundary conditions on the low end of the domain ns.hi_bc = 0 0 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING & SOLVER CONTROLS (these are optional) #********************************** amr.blocking_factor = 4 # factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for convergence with this problem mg.usecg = 0 mg.nu_f = 100 # USE THIS ONLY FOR TESTING #amr.max_grid_size = 64 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/inputs_2_xy_yinflow0000644000175000017500000001370611634153073024467 0ustar amckinstryamckinstry# NOTE: all the values here must be set unless specifically # marked as optional #********************************** #ALGORITHM CONTROLS (defaults shown; these are both optional) #********************************** proj.proj_2 = 1 proj.filter_factor = 0. ns.init_iter = 2 ns.do_MLsync_proj = 1 #********************************** #RUN CONTROLS #********************************** # MUST SET ONE OR BOTH OF THESE. max_step = 1 # maximum (integer) number of time steps stop_time = 2.0 # maximum (real) time (in same units as dt) amr.n_cell = 16 16 # indices of the domain at level 0 # (this one is optional) # amr.restart = # set if starting from a restart file, else comment out # This will default to file "probin" if not set amr.probin_file = probin_2 #********************************** #ADAPTIVITY CONTROLS #********************************** amr.max_level = 2 # maximum number of levels of refinement amr.regrid_int = 2 # how often to regrid if max_level > 0 # (this one is optional) amr.regrid_file = fixed_grids_2 # file name for specifying fixed grids # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 4 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio # # Only call LinOp::ApplyBC() on alternate calls to LinOp::Fsmooth() # from within LinOp::smooth(). This is not theoretically correct but # can cut down fairly significantly on communication overhead when # running in Parallel; especially so for periodic problems. # # 0 is false and 1 is true # Lp.alternateApplyBC = 0 #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 1 proj.v = 1 diffuse.v = 1 amr.v = 1 mg.v = 1 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) ns.sum_interval = 5 # interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 50 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 1 # (integer) number of timesteps between plot files #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt # (this is optional) ns.init_shrink = 0.1 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.01 ns.scal_diff_coefs = 0.0 ns.do_temp = 1 # (this is optional) ns.gravity = 9.8 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** geometry.coord_sys = 0 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 1. 1. # physical dimensions of the high end of the domain geometry.is_periodic = 0 0 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 5 1 # boundary conditions on the low end of the domain ns.hi_bc = 5 2 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING CONTROLS (these are optional) #********************************** amr.blocking_factor = 1 # the factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for multigrid convergence mg.usecg = 1 # USE THESE ONLY FOR TESTING #amr.grid_eff = 0.9 # grid efficiency in the grid creation algorithm # amr.max_grid_size = 16 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/inputs_1_xy_xper0000644000175000017500000001370211634153073023751 0ustar amckinstryamckinstry# NOTE: all the values here must be set unless specifically # marked as optional #********************************** #ALGORITHM CONTROLS (defaults shown; these are both optional) #********************************** proj.proj_2 = 1 proj.filter_factor = 0. ns.init_iter = 2 ns.do_MLsync_proj = 1 #********************************** #RUN CONTROLS #********************************** # MUST SET ONE OR BOTH OF THESE. max_step = 1 # maximum (integer) number of time steps stop_time = 2.0 # maximum (real) time (in same units as dt) amr.n_cell = 16 16 # indices of the domain at level 0 # (this one is optional) #amr.restart = # set if starting from a restart file, else comment out # This will default to file "probin" if not set amr.probin_file = probin_1 #********************************** #ADAPTIVITY CONTROLS #********************************** amr.max_level = 2 # maximum number of levels of refinement amr.regrid_int = 2 # how often to regrid if max_level > 0 # (this one is optional) amr.regrid_file = fixed_grids_1 # file name for specifying fixed grids # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 2 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio # # Only call LinOp::ApplyBC() on alternate calls to LinOp::Fsmooth() # from within LinOp::smooth(). This is not theoretically correct but # can cut down fairly significantly on communication overhead when # running in Parallel; especially so for periodic problems. # # 0 is false and 1 is true # Lp.alternateApplyBC = 0 #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 1 proj.v = 1 diffuse.v = 1 amr.v = 1 mg.v = 1 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) ns.sum_interval = 5 # interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 50 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 1 # (integer) number of timesteps between plot files #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt # (this is optional) ns.init_shrink = 0.1 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.01 ns.scal_diff_coefs = 0.0 ns.do_temp = 1 # (this is optional) ns.gravity = 9.8 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** geometry.coord_sys = 0 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 1. 1. # physical dimensions of the high end of the domain geometry.is_periodic = 1 0 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 0 5 # boundary conditions on the low end of the domain ns.hi_bc = 0 2 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING CONTROLS (these are optional) #********************************** amr.blocking_factor = 1 # the factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for multigrid convergence mg.usecg = 1 # USE THESE ONLY FOR TESTING #amr.grid_eff = 0.9 # grid efficiency in the grid creation algorithm amr.max_grid_size = 8 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/fixed_grids_40000644000175000017500000000017411634153073023142 0ustar amckinstryamckinstry1 5 (( 0, 0) ( 3, 3) (0,0)) (( 0,12) ( 3,15) (0,0)) ((12, 0) (15, 3) (0,0)) ((12,12) (15,15) (0,0)) (( 4, 4) (11,11) (0,0)) ccseapps-2.5/CCSEApps/iamrlib/test2d/inputs_2_rz_zsolid0000644000175000017500000001363511634153073024300 0ustar amckinstryamckinstry# NOTE: all the values here must be set unless specifically # marked as optional #********************************** #ALGORITHM CONTROLS (defaults shown; these are both optional) #********************************** proj.proj_2 = 1 proj.filter_factor = 0. ns.init_iter = 2 ns.do_MLsync_proj = 1 #********************************** #RUN CONTROLS #********************************** # MUST SET ONE OR BOTH OF THESE. max_step = 1 # maximum (integer) number of time steps stop_time = 2.0 # maximum (real) time (in same units as dt) amr.n_cell = 16 16 # indices of the domain at level 0 # (this one is optional) #amr.restart = # set if starting from a restart file, else comment out # This will default to file "probin" if not set amr.probin_file = probin_2 #********************************** #ADAPTIVITY CONTROLS #********************************** amr.max_level = 2 # maximum number of levels of refinement amr.regrid_int = 2 # how often to regrid if max_level > 0 # (this one is optional) amr.regrid_file = fixed_grids_2 # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) amr.ref_ratio = 4 2 # integer refinement ratio #amr.ref_ratio_vect # IntVect refinement ratio # # Only call LinOp::ApplyBC() on alternate calls to LinOp::Fsmooth() # from within LinOp::smooth(). This is not theoretically correct but # can cut down fairly significantly on communication overhead when # running in Parallel; especially so for periodic problems. # # 0 is false and 1 is true # Lp.alternateApplyBC = 0 #********************************** #VERBOSITY CONTROLS (these are all optional with defaults shown) #********************************** ns.v = 1 godunov.v = 0 mac.v = 1 proj.v = 1 diffuse.v = 1 amr.v = 1 mg.v = 1 cg.v = 0 proj.Pcode = 1 #********************************** #OUTPUT CONTROLS #********************************** #THESE FILES WILL BE CREATED ONLY IF YOU SPECIFY THE NAME #amr.run_log = runlog # name of the run log file #amr.grid_log = grdlog # name of the grid log file #amr.data_log = datalog # name of the data log file #THESE FILES WILL BE CREATED WITH DEFAULT PREFIX IF YOU DONT SPECIFY OTHERWISE #amr.check_file # prefix of the checkpoint files (default = "chk") #amr.plot_file # prefix of the plot files (default = "plt") # (this one is optional - sums will only be done if this is set to positive) ns.sum_interval = 5 # interval at which to sum the specified quantities # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.check_per # (real) period between checkpoint files (in same units as dt) amr.check_int = 50 # (integer) number of timesteps between checkpoint files # MUST SET ONLY ONE OF THE TWO BELOW (COMMENT OUT THE OTHER) #amr.plot_per # (real) period between plot files (in same units as dt) amr.plot_int = 1 # (integer) number of timesteps between plot files #********************************** #TIME STEP CONTROLS #********************************** ns.cfl = 0.9 # CFL number used to set dt # (this is optional) ns.init_shrink = 0.1 # factor which multiplies the very first time step #********************************** #PHYSICS #********************************** ns.vel_visc_coef = 0.01 ns.temp_cond_coef = 0.01 ns.scal_diff_coefs = 0.0 ns.do_temp = 1 # (this is optional) ns.gravity = 9.8 # forcing term is rho * abs(gravity) "down" #********************************** #GEOMETRY #********************************** geometry.coord_sys = 1 # 0 for x-y (x-y-z), 1 for r-z geometry.prob_lo = 0. 0. # physical dimensions of the low end of the domain geometry.prob_hi = 1. 1. # physical dimensions of the high end of the domain geometry.is_periodic = 0 0 # >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<< # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall ns.lo_bc = 5 5 # boundary conditions on the low end of the domain ns.hi_bc = 5 2 # boundary conditions on the high end of the domain #********************************** #MORE OUTPUT CONTROLS #********************************** # # Select form of FAB output: default is NATIVE # # ASCII (this is very slow) # NATIVE (native binary form on machine -- the default) # IEEE32 (useful if you want 32bit files when running in double precision) # 8BIT (eight-bit run-length-encoded) # fab.format = NATIVE #********************************** #MORE PARALLEL CONTROLS #********************************** # # Initializes DistributionMapping strategy from ParmParse. # # ParmParse options are: # # DistributionMapping.strategy = ROUNDROBIN # DistributionMapping.strategy = KNAPSACK # # The default strategy is ROUNDROBIN. # DistributionMapping.strategy = ROUNDROBIN DistributionMapping.strategy = KNAPSACK #********************************** #GRIDDING CONTROLS (these are optional) #********************************** amr.blocking_factor = 1 # the factor by which every patch must be coarsenable amr.n_error_buf = 2 2 # number of buffer cells around each tagged cell # necessary for multigrid convergence mg.usecg = 1 # USE THESE ONLY FOR TESTING #amr.grid_eff = 0.9 # grid efficiency in the grid creation algorithm # amr.max_grid_size = 16 # maximum linear dimension of any one grid # # StationData.vars -- Names of StateData components to output # StationData.coord -- BL_SPACEDIM array of Reals # StationData.coord -- the next one # StationData.coord -- ditto ... # # e.g. # #StationData.vars = density xmom ymom zmom #StationData.coord = 0.1 0.1 #StationData.coord = 0.11 0.21 #StationData.coord = 0.5 0.5 #StationData.coord = 1.23 1.23 #StationData.coord = 0.23 1.53 #StationData.coord = 2.34 2.34 ccseapps-2.5/CCSEApps/iamrlib/test2d/probin_10000644000175000017500000000023311634153073022135 0ustar amckinstryamckinstry $fortin probtype = 6 xblob = 0.5 yblob = 0.5 radblob = 0.1 denfact = 1.5 adv_dir = 1 adv_vel = 0.0 adverr = 0.1 vorterr = 5.0 $end ccseapps-2.5/CCSEApps/iamrlib/test2d/fixed_grids_30000644000175000017500000000022211634153073023133 0ustar amckinstryamckinstry2 3 ((0,0) (7,11) (0,0)) ((8,4) (11,7) (0,0)) ((12,8) (15,11) (0,0)) 3 ((8,4) (23,15) (0,0)) ((8,16) (23,39) (0,0)) ((24,20) (31,27) (0,0)) ccseapps-2.5/CCSEApps/iamrlib/GODUNOV_2D.F0000644000175000017500000022702511634153073021063 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: GODUNOV_2D.F,v 1.36 2003/02/28 18:35:06 almgren Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "GODUNOV_F.H" #include "ArrayLim.H" #define SDIM 2 #define XVEL 1 #define YVEL 2 subroutine FORT_ESTDT ( & vel,DIMS(vel), & tforces,DIMS(tf), & rho,DIMS(rho), & lo,hi,dt,dx,cfl,u_max) c c ---------------------------------------------------------- c estimate the timestep for this grid and scale by CFL number c This routine sets dt as dt = dt_est*cfl where c dt_est is estimated from the actual velocities and their c total forcing c ---------------------------------------------------------- c REAL_T u, v REAL_T small REAL_T dt_start REAL_T tforce1 REAL_T tforce2 integer i, j integer lo(SDIM), hi(SDIM) REAL_T dt,dx(SDIM),cfl,u_max(SDIM) integer DIMDEC(vel) integer DIMDEC(rho) integer DIMDEC(tf) REAL_T vel(DIMV(vel),SDIM) REAL_T rho(DIMV(rho)) REAL_T tforces(DIMV(tf),SDIM) #if defined(BL_USE_FLOAT) || defined(BL_T3E) || defined(BL_CRAY) small = 1.0e-8 #else small = 1.0d-8 #endif u = zero v = zero tforce1 = zero tforce2 = zero do j = lo(2), hi(2) do i = lo(1), hi(1) u = max(u,abs(vel(i,j,1))) v = max(v,abs(vel(i,j,2))) c tforce1 = max(tforce1,abs(tforces(i,j,1)/rho(i,j))) c tforce2 = max(tforce2,abs(tforces(i,j,2)/rho(i,j))) end do end do u_max(1) = u u_max(2) = v dt_start = 1.0D+20 dt = dt_start if (u .gt. small) dt = min(dt,dx(1)/u) if (v .gt. small) dt = min(dt,dx(2)/v) if (tforce1 .gt. small) then dt = min(dt,sqrt(two*dx(1)/tforce1)) end if if (tforce2 .gt. small) then dt = min(dt,sqrt(two*dx(2)/tforce2)) end if if (dt .eq. dt_start) dt = min(dx(1),dx(2)) dt = dt*cfl end subroutine FORT_TEST_U_RHO( & u,DIMS(u), & v,DIMS(v), & rho,DIMS(rho), & lo,hi,dt,dx,cflmax,u_max,verbose ) c c This subroutine computes the extrema of the density c and velocities at cell centers c integer DIMDEC(u) integer DIMDEC(v) integer DIMDEC(rho) REAL_T u(DIMV(u)) REAL_T v(DIMV(v)) REAL_T rho(DIMV(rho)) integer lo(SDIM) integer hi(SDIM) REAL_T dt REAL_T dx(SDIM) REAL_T cflmax REAL_T u_max(SDIM) integer verbose c REAL_T hx, hy REAL_T umax, vmax, rhomax REAL_T umin, vmin, rhomin integer imin, imax, jmin, jmax integer i, j c hx = dx(1) hy = dx(2) imin = lo(1) imax = hi(1) jmin = lo(2) jmax = hi(2) umax = -1.d200 vmax = -1.d200 umin = 1.d200 vmin = 1.d200 rhomax = -1.d200 rhomin = 1.d200 c do j = jmin, jmax do i = imin, imax umax = max(umax,u(i,j)) umin = min(umin,u(i,j)) vmax = max(vmax,v(i,j)) vmin = min(vmin,v(i,j)) rhomax = max(rhomax,rho(i,j)) rhomin = min(rhomin,rho(i,j)) end do end do u_max(1) = max(abs(umax), abs(umin)) u_max(2) = max(abs(vmax), abs(vmin)) cflmax = dt*max(u_max(1)/hx,u_max(2)/hy) if(verbose.eq.1)then write(6,1000) umax,umin,u_max(1) write(6,1001) vmax,vmin,u_max(2) write(6,1002) rhomax,rhomin #ifndef BL_NO_FORT_FLUSH c call flush(6) #endif end if 1000 format(' U MAX/MIN/AMAX ',e21.14,2x,e21.14,2x,e21.14) 1001 format(' V MAX/MIN/AMAX ',e21.14,2x,e21.14,2x,e21.14) 1002 format('RHO MAX/MIN ',e21.14,2x,e21.14) end subroutine FORT_TEST_UMAC_RHO( & umac,DIMS(umac), & vmac,DIMS(vmac), & rho,DIMS(rho), & lo,hi,dt,dx,cflmax,u_max) c c This subroutine computes the extrema of the density c and mac edge velocities c integer DIMDEC(umac) integer DIMDEC(vmac) integer DIMDEC(rho) integer imin, imax, jmin, jmax integer i, j integer lo(SDIM),hi(SDIM) REAL_T dt, dx(SDIM), u_max(SDIM), cflmax REAL_T hx, hy REAL_T umax, vmax, rhomax REAL_T umin, vmin, rhomin REAL_T umac(DIMV(umac)) REAL_T vmac(DIMV(vmac)) REAL_T rho(DIMV(rho)) hx = dx(1) hy = dx(2) imin = lo(1) imax = hi(1) jmin = lo(2) jmax = hi(2) umax = -1.d200 vmax = -1.d200 umin = 1.d200 vmin = 1.d200 rhomax = -1.d200 rhomin = 1.d200 do j = jmin, jmax do i = imin, imax+1 umax = max(umax,umac(i,j)) umin = min(umin,umac(i,j)) end do end do do j = jmin, jmax+1 do i = imin, imax vmax = max(vmax,vmac(i,j)) vmin = min(vmin,vmac(i,j)) end do end do do j = jmin, jmax do i = imin, imax rhomax = max(rhomax,rho(i,j)) rhomin = min(rhomin,rho(i,j)) end do end do u_max(1) = max(abs(umax), abs(umin)) u_max(2) = max(abs(vmax), abs(vmin)) cflmax = dt*max(u_max(1)/hx,u_max(2)/hy) write(6,1000) umax,umin,u_max(1) write(6,1001) vmax,vmin,u_max(2) write(6,1002) rhomax,rhomin 1000 format('UMAC MAX/MIN/AMAX ',e21.14,2x,e21.14,2x,e21.14) 1001 format('VMAC MAX/MIN/AMAX ',e21.14,2x,e21.14,2x,e21.14) 1002 format('RHO MAX/MIN ',e21.14,2x,e21.14) #ifndef BL_NO_FORT_FLUSH c call flush(6) #endif end subroutine FORT_TRANSVEL( & u, ulo, uhi, sx, ubc, slxscr, & v, vlo, vhi, sy, vbc, slyscr, & DIMS(s), DIMS(work), & lo,hi,dt,dx,use_minion,tforces) c c This subroutine computes the advective velocities used in c the transverse derivatives of the Godunov box c implicit none integer i,j integer ubc(SDIM,2),vbc(SDIM,2) integer lo(SDIM),hi(SDIM) integer imin,jmin,imax,jmax REAL_T hx, hy, dt, dth, dthx, dthy,dx(SDIM) REAL_T uad,vad REAL_T eps,eps_for_bc logical ltm parameter( eps = 1.0D-6 ) parameter( eps_for_bc = 1.0D-10 ) integer DIMDEC(s) integer DIMDEC(work) REAL_T u(DIMV(s)) REAL_T v(DIMV(s)) REAL_T ulo(DIMV(work)),uhi(DIMV(work)) REAL_T vlo(DIMV(work)),vhi(DIMV(work)) REAL_T sx(DIMV(work)) REAL_T sy(DIMV(work)) REAL_T slxscr(DIM1(s), 4) REAL_T slyscr(DIM2(s), 4) integer use_minion REAL_T tforces(DIMV(work),SDIM) dth = half*dt dthx = half*dt / dx(1) dthy = half*dt / dx(2) hx = dx(1) hy = dx(2) imin = lo(1) jmin = lo(2) imax = hi(1) jmax = hi(2) c c -------------------------------------------------------------- c compute the x transverse velocities c -------------------------------------------------------------- c call FORT_SLOPES(u,DIMS(s), & sx,sy,DIMS(work),lo,hi,slxscr,slyscr,ubc) do i = imin, imax+1 do j = jmin-1,jmax+1 ulo(i,j) = u(i-1,j) + (half - dthx*u(i-1,j))*sx(i-1,j) uhi(i,j) = u(i,j) + (-half - dthx*u(i, j))*sx(i,j) end do end do if(use_minion.eq.1)then do i = imin, imax+1 do j = jmin-1,jmax+1 ulo(i,j) = ulo(i,j) + dth*tforces(i-1,j,1) uhi(i,j) = uhi(i,j) + dth*tforces(i, j,1) end do end do end if call trans_xbc(u,DIMS(s), & ulo,uhi,DIMS(work),ulo,DIMS(work),lo,hi,XVEL,ubc,eps_for_bc) do i = imin,imax+1 do j = jmin-1,jmax+1 uad = cvmgp(ulo(i,j),uhi(i,j),ulo(i,j)+uhi(i,j)) ltm = ulo(i,j) .le. zero .and. uhi(i,j) .ge. zero ltm = ltm .or. (abs(ulo(i,j)+uhi(i,j)) .lt. eps) ulo(i,j) = cvmgt(zero,uad,ltm) end do end do c c compute the y transverse velocities c call FORT_SLOPES(v,DIMS(s), & sx,sy,DIMS(work),lo,hi,slxscr,slyscr,vbc) do i = imin-1,imax+1 do j = jmin,jmax+1 vlo(i,j) = v(i,j-1) + (half - dthy*v(i,j-1))*sy(i,j-1) vhi(i,j) = v(i,j) + (-half - dthy*v(i,j ))*sy(i,j) end do end do if(use_minion.eq.1)then do i = imin-1, imax+1 do j = jmin,jmax+1 vlo(i,j) = vlo(i,j) + dth*tforces(i,j-1,2) vhi(i,j) = vhi(i,j) + dth*tforces(i,j, 2) end do end do end if call trans_ybc(v,DIMS(s), & vlo,vhi,DIMS(work),vlo,DIMS(work),lo,hi,YVEL,vbc,eps_for_bc) do i = imin-1,imax+1 do j = jmin,jmax+1 vad = cvmgp(vlo(i,j),vhi(i,j),vlo(i,j)+vhi(i,j)) ltm = vlo(i,j) .le. zero .and. vhi(i,j) .ge. zero ltm = ltm .or. (abs(vlo(i,j)+vhi(i,j)) .lt. eps) vlo(i,j) = cvmgt(zero,vad,ltm) end do end do end subroutine FORT_ESTATE(s, tforces, DIMS(s), & u, xlo, xhi, sx, uad, slxscr, stxlo, stxhi, & uedge, DIMS(uedge), xstate, DIMS(xstate), & v, ylo, yhi, sy, vad, slyscr, stylo, styhi, & vedge, DIMS(vedge), ystate, DIMS(ystate), & DIMS(work), & bc,lo,hi,dt,dx,n,velpred, use_minion) c integer i,j,n,velpred integer lo(SDIM),hi(SDIM),bc(SDIM,2) integer imin,jmin,imax,jmax REAL_T place_to_break REAL_T hx, hy, dt, dth, dthx, dthy, dx(SDIM) REAL_T tr,stx,sty,fu,fv REAL_T eps,eps_for_bc logical ltx,lty parameter( eps = 1.0D-6 ) parameter( eps_for_bc = 1.0D-10 ) integer DIMDEC(s) integer DIMDEC(work) integer DIMDEC(uedge) integer DIMDEC(vedge) integer DIMDEC(xstate) integer DIMDEC(ystate) REAL_T s(DIMV(s)) REAL_T u(DIMV(s)) REAL_T v(DIMV(s)) REAL_T stxlo(DIM1(s)),stxhi(DIM1(s)),slxscr(DIM1(s),4) REAL_T stylo(DIM2(s)),styhi(DIM2(s)),slyscr(DIM2(s),4) REAL_T uedge(DIMV(uedge)), xstate(DIMV(uedge)) REAL_T vedge(DIMV(vedge)), ystate(DIMV(vedge)) REAL_T xlo(DIMV(work)), xhi(DIMV(work)) REAL_T ylo(DIMV(work)), yhi(DIMV(work)) REAL_T sx(DIMV(work)), uad(DIMV(work)) REAL_T sy(DIMV(work)), vad(DIMV(work)) REAL_T tforces(DIMV(work)) integer use_minion dth = half*dt dthx = half*dt/dx(1) dthy = half*dt/dx(2) hx = dx(1) hy = dx(2) imin = lo(1) jmin = lo(2) imax = hi(1) jmax = hi(2) c c compute the slopes c c trace the state to the cell edges c call FORT_SLOPES(s,DIMS(s), & sx,sy,DIMS(work),lo,hi,slxscr,slyscr,bc) c c trace the state to the cell edges c do i = imin, imax+1 do j = jmin-1,jmax+1 xlo(i,j) = s(i-1,j) + (half - dthx*u(i-1,j))*sx(i-1,j) xhi(i,j) = s(i ,j) - (half + dthx*u(i ,j))*sx(i ,j) end do end do if(use_minion.eq.1)then do i = imin, imax+1 do j = jmin-1,jmax+1 xlo(i,j) = xlo(i,j) + dth*tforces(i-1,j) xhi(i,j) = xhi(i,j) + dth*tforces(i, j) end do end do end if call trans_xbc(s,DIMS(s), & xlo,xhi,DIMS(work),uad,DIMS(work),lo,hi,n,bc,eps_for_bc) do i = imin, imax+1 do j = jmin-1,jmax+1 fu = cvmgt(zero,one,abs(uad(i,j)).lt.eps) stx = cvmgp(xlo(i,j),xhi(i,j),uad(i,j)) xlo(i,j) = fu*stx + (one - fu)*half*(xhi(i,j)+xlo(i,j)) end do end do do j = jmin,jmax+1 do i = imin-1,imax+1 ylo(i,j) = s(i,j-1) + (half - dthy*v(i,j-1))*sy(i,j-1) yhi(i,j) = s(i,j ) - (half + dthy*v(i,j ))*sy(i,j ) end do end do if(use_minion.eq.1)then do i = imin-1, imax+1 do j = jmin,jmax+1 ylo(i,j) = ylo(i,j) + dth*tforces(i,j-1) yhi(i,j) = yhi(i,j) + dth*tforces(i,j) end do end do end if call trans_ybc(s,DIMS(s), & ylo,yhi,DIMS(work),vad,DIMS(work),lo,hi,n,bc,eps_for_bc) do j = jmin,jmax+1 do i = imin-1,imax+1 fv = cvmgt(zero,one,abs(vad(i,j)).lt.eps) sty = cvmgp(ylo(i,j),yhi(i,j),vad(i,j)) ylo(i,j) = fv*sty + (one - fv)*half*(yhi(i,j)+ylo(i,j)) end do end do c c compute the xedge state c if ((velpred.ne.1) .or. (n.eq.XVEL)) then do 100 j = jmin,jmax do i = imin-1,imax+1 tr = half* & (vad(i,j+1)+vad(i,j))* & (ylo(i,j+1)-ylo(i,j))/hy stxlo(i+1) = s(i,j) + (half-dthx*u(i,j))*sx(i,j) & - dth*tr & + dth*tforces(i,j) stxhi(i ) = s(i,j) - (half+dthx*u(i,j))*sx(i,j) & - dth*tr & + dth*tforces(i,j) end do if (bc(1,1).eq.EXT_DIR .and. uad(imin,j).ge.zero) then stxhi(imin) = s(imin-1,j) stxlo(imin) = s(imin-1,j) else if (bc(1,1).eq.EXT_DIR .and. uad(imin,j).lt.zero) then stxlo(imin) = stxhi(imin) else if (bc(1,1).eq.FOEXTRAP.or.bc(1,1).eq.HOEXTRAP & .or.bc(1,1).eq.REFLECT_EVEN) then stxlo(imin) = stxhi(imin) else if (bc(1,1).eq.REFLECT_ODD) then stxhi(imin) = zero stxlo(imin) = stxhi(imin) end if if (bc(1,2).eq.EXT_DIR .and. uad(imax+1,j).le.zero) then stxlo(imax+1) = s(imax+1,j) stxhi(imax+1) = s(imax+1,j) else if (bc(1,2).eq.EXT_DIR .and. uad(imax+1,j).gt.zero) then stxhi(imax+1) = stxlo(imax+1) else if (bc(1,2).eq.FOEXTRAP.or.bc(1,2).eq.HOEXTRAP & .or.bc(1,2).eq.REFLECT_EVEN) then stxhi(imax+1) = stxlo(imax+1) else if (bc(1,2).eq.REFLECT_ODD) then stxlo(imax+1) = zero stxhi(imax+1) = zero end if if ( velpred .eq. 1 ) then do i = imin, imax+1 ltx = stxlo(i) .le. zero .and. stxhi(i) .ge. zero ltx = ltx .or. (abs(stxlo(i)+stxhi(i)) .lt. eps) stx = cvmgp(stxlo(i),stxhi(i),stxlo(i)+stxhi(i)) xstate(i,j) = cvmgt(zero,stx,ltx) end do else do i = imin, imax+1 xstate(i,j) = cvmgp(stxlo(i),stxhi(i),uedge(i,j)) xstate(i,j) = cvmgt(half*(stxlo(i)+stxhi(i)),xstate(i,j), & abs(uedge(i,j)).lt.eps) end do end if place_to_break = 1 100 continue end if c c compute the yedge states c if ((velpred.ne.1) .or. (n.eq.YVEL)) then do 200 i = imin, imax do j = jmin-1,jmax+1 tr = half* & (uad(i+1,j)+uad(i,j))* & (xlo(i+1,j)-xlo(i,j))/hx stylo(j+1)= s(i,j) + (half-dthy*v(i,j))*sy(i,j) & - dth*tr & + dth*tforces(i,j) styhi(j )= s(i,j) - (half+dthy*v(i,j))*sy(i,j) & - dth*tr & + dth*tforces(i,j) end do if (bc(2,1).eq.EXT_DIR .and. vad(i,jmin).ge.zero) then styhi(jmin) = s(i,jmin-1) stylo(jmin) = s(i,jmin-1) else if (bc(2,1).eq.EXT_DIR .and. vad(i,jmin).lt.zero) then stylo(jmin) = styhi(jmin) else if (bc(2,1).eq.FOEXTRAP.or.bc(2,1).eq.HOEXTRAP & .or.bc(2,1).eq.REFLECT_EVEN) then stylo(jmin) = styhi(jmin) else if (bc(2,1).eq.REFLECT_ODD) then styhi(jmin) = zero stylo(jmin) = zero end if if (bc(2,2).eq.EXT_DIR .and. vad(i,jmax+1).le.zero) then stylo(jmax+1) = s(i,jmax+1) styhi(jmax+1) = s(i,jmax+1) else if (bc(2,2).eq.EXT_DIR .and. vad(i,jmax+1).gt.zero) then styhi(jmax+1) = stylo(jmax+1) else if (bc(2,2).eq.FOEXTRAP.or.bc(2,2).eq.HOEXTRAP & .or.bc(2,2).eq.REFLECT_EVEN) then styhi(jmax+1) = stylo(jmax+1) else if (bc(2,2).eq.REFLECT_ODD) then stylo(jmax+1) = zero styhi(jmax+1) = zero end if if ( velpred .eq. 1 ) then do j = jmin, jmax+1 lty = stylo(j) .le. zero .and. styhi(j) .ge. zero lty = lty .or. (abs(stylo(j)+styhi(j)) .lt. eps) sty = cvmgp(stylo(j),styhi(j),stylo(j)+styhi(j)) ystate(i,j)=cvmgt(zero,sty,lty) end do else do j=jmin,jmax+1 ystate(i,j) = cvmgp(stylo(j),styhi(j),vedge(i,j)) ystate(i,j) = cvmgt(half*(stylo(j)+styhi(j)),ystate(i,j), & abs(vedge(i,j)).lt.eps) end do end if place_to_break = 1 200 continue end if end subroutine FORT_ESTATE_FPU(s, tforces, divu, DIMS(s), & xlo, xhi, sx, slxscr, stxlo, stxhi, & uedge, DIMS(uedge), xstate, DIMS(xstate), & ylo, yhi, sy, slyscr, stylo, styhi, & vedge, DIMS(vedge), ystate, DIMS(ystate), & DIMS(work), & bc,lo,hi,dt,dx,n,use_minion,iconserv) c c This subroutine computes edges states, right now it uses c a lot of memory, but there becomes a trade off between c simplicity-efficiency in the new way of computing states c and complexity in the old way. By eliminating loops over c state components though, the new way uses much less memory. c integer i,j,n integer lo(SDIM),hi(SDIM),bc(SDIM,2) integer imin,jmin,imax,jmax REAL_T place_to_break REAL_T hx, hy, dt, dth, dthx, dthy REAL_T tr,ubar,vbar,stx,sty,fu,fv,dx(SDIM) REAL_T eps,eps_for_bc logical ltx,lty parameter( eps = 1.0D-6 ) parameter( eps_for_bc = 1.0D-10 ) integer DIMDEC(s) integer DIMDEC(work) integer DIMDEC(uedge) integer DIMDEC(xstate) integer DIMDEC(vedge) integer DIMDEC(ystate) REAL_T s(DIMV(s)) REAL_T stxlo(DIM1(s)),stxhi(DIM1(s)),slxscr(DIM1(s),4) REAL_T stylo(DIM2(s)),styhi(DIM2(s)),slyscr(DIM2(s),4) REAL_T uedge(DIMV(uedge)), xstate(DIMV(xstate)) REAL_T vedge(DIMV(vedge)), ystate(DIMV(ystate)) REAL_T xlo(DIMV(work)), xhi(DIMV(work)) REAL_T ylo(DIMV(work)), yhi(DIMV(work)) REAL_T sx(DIMV(work)) REAL_T sy(DIMV(work)) REAL_T tforces(DIMV(work)) REAL_T divu(DIMV(work)) #if 0 REAL_T extra_work(DIMV(work),6) #endif REAL_T spx,smx,spy,smy,st,denom integer use_minion, iconserv integer inc REAL_T umax dth = half*dt dthx = half*dt / dx(1) dthy = half*dt / dx(2) hx = dx(1) hy = dx(2) imin = lo(1) jmin = lo(2) imax = hi(1) jmax = hi(2) c c compute the slopes c call FORT_SLOPES( & s,DIMS(s), & sx,sy,DIMS(work), & lo,hi,slxscr,slyscr,bc) c c trace the state to the cell edges c do j = jmin-1,jmax+1 do i = imin, imax+1 xlo(i,j) = s(i-1,j) + (half - dthx*uedge(i,j))*sx(i-1,j) xhi(i,j) = s(i, j) + (-half - dthx*uedge(i,j))*sx(i, j) end do end do if(use_minion.eq.1)then do j = jmin-1,jmax+1 do i = imin, imax+1 xlo(i,j) = xlo(i,j) + dth*tforces(i-1,j) xhi(i,j) = xhi(i,j) + dth*tforces(i, j) end do end do if (iconserv .eq. 1) then do j = jmin-1,jmax+1 do i = imin, imax+1 xlo(i,j) = xlo(i,j) - dth*s(i-1,j)*divu(i-1,j) xhi(i,j) = xhi(i,j) - dth*s(i ,j)*divu(i, j) end do end do end if end if call trans_xbc( & s,DIMS(s), & xlo,xhi,DIMS(work),uedge,DIMS(uedge), & lo,hi,n,bc,eps_for_bc) do j = jmin-1,jmax+1 do i = imin, imax+1 fu = cvmgt(zero,one,abs(uedge(i,j)).lt.eps) stx = cvmgp(xlo(i,j),xhi(i,j),uedge(i,j)) xlo(i,j) = fu*stx + (one - fu)*half*(xhi(i,j)+xlo(i,j)) end do end do do j = jmin, jmax+1 do i = imin-1,imax+1 ylo(i,j) = s(i,j-1) + (half - dthy*vedge(i,j))*sy(i,j-1) yhi(i,j) = s(i,j) + (-half - dthy*vedge(i,j))*sy(i,j) end do end do if (use_minion.eq.1)then do j = jmin, jmax+1 do i = imin-1, imax+1 ylo(i,j) = ylo(i,j) + dth*tforces(i,j-1) yhi(i,j) = yhi(i,j) + dth*tforces(i,j ) end do end do if (iconserv .eq. 1) then do j = jmin-1,jmax+1 do i = imin, imax+1 ylo(i,j) = ylo(i,j) - dth*s(i,j-1)*divu(i,j-1) yhi(i,j) = yhi(i,j) - dth*s(i,j )*divu(i,j ) end do end do end if end if call trans_ybc( & s,DIMS(s), & ylo,yhi,DIMS(work),vedge,DIMS(vedge), & lo,hi,n,bc,eps_for_bc) do j = jmin, jmax+1 do i = imin-1,imax+1 fv = cvmgt(zero,one,abs(vedge(i,j)).lt.eps) sty = cvmgp(ylo(i,j),yhi(i,j),vedge(i,j)) ylo(i,j) = fv*sty + (one - fv)*half*(yhi(i,j)+ylo(i,j)) end do end do #if 0 call bdsslope(s,lo(1),lo(2),hi(1),hi(2), $ extra_work(lo(1)-1,lo(2)-1,1), $ extra_work(lo(1)-1,lo(2)-1,2), $ extra_work(lo(1)-1,lo(2)-1,3), $ dx) #endif c c compute the xedge states c do j = jmin,jmax do i = imin-1,imax+1 spx = s(i,j) + half * sx(i,j) smx = s(i,j) - half * sx(i,j) if (iconserv.eq.1) then st = -(vedge(i,j+1)*ylo(i,j+1) - vedge(i,j)*ylo(i,j))/hy & + s(i,j)*(vedge(i,j+1)-vedge(i,j))/hy & - s(i,j)*divu(i,j) else #if 1 if (vedge(i,j)*vedge(i,j+1).le.0.d0) then vbar = 0.5d0*(vedge(i,j)+vedge(i,j+1)) if (vbar.lt.0.d0) then inc = 1 else inc = 0 endif tr = vbar*(s(i,j+inc)-s(i,j+inc-1))/hy else tr = half*(vedge(i,j+1) + vedge(i,j)) * & ( ylo(i,j+1) - ylo(i,j) ) / hy endif #else tr = half*(vedge(i,j+1) + vedge(i,j)) * extra_work(i,j,2) #endif st = -tr endif stxlo(i+1)= spx - dthx*uedge(i+1,j)*sx(i,j) + dth*(st + tforces(i,j)) stxhi(i )= smx - dthx*uedge(i ,j)*sx(i,j) + dth*(st + tforces(i,j)) end do if (bc(1,1).eq.EXT_DIR .and. uedge(imin,j).ge.zero) then stxhi(imin) = s(imin-1,j) stxlo(imin) = s(imin-1,j) else if (bc(1,1).eq.EXT_DIR .and. uedge(imin,j).lt.zero) then stxlo(imin) = stxhi(imin) else if (bc(1,1).eq.FOEXTRAP.or.bc(1,1).eq.HOEXTRAP & .or.bc(1,1).eq.REFLECT_EVEN) then stxlo(imin) = stxhi(imin) else if (bc(1,1).eq.REFLECT_ODD) then stxhi(imin) = zero stxlo(imin) = zero end if if (bc(1,2).eq.EXT_DIR .and. uedge(imax+1,j).le.zero) then stxlo(imax+1) = s(imax+1,j) stxhi(imax+1) = s(imax+1,j) else if (bc(1,2).eq.EXT_DIR .and. uedge(imax+1,j).gt.zero) then stxhi(imax+1) = stxlo(imax+1) else if (bc(1,2).eq.FOEXTRAP.or.bc(1,2).eq.HOEXTRAP & .or.bc(1,2).eq.REFLECT_EVEN) then stxhi(imax+1) = stxlo(imax+1) else if (bc(1,2).eq.REFLECT_ODD) then stxlo(imax+1) = zero stxhi(imax+1) = zero end if do i = imin, imax+1 xstate(i,j) = cvmgp(stxlo(i),stxhi(i),uedge(i,j)) xstate(i,j) = cvmgt(half*(stxlo(i)+stxhi(i)),xstate(i,j) & ,abs(uedge(i,j)).lt.eps) end do place_to_break = 1 end do c c compute the yedge states c do i = imin,imax do j = jmin-1,jmax+1 spy = s(i,j) + half * sy(i,j) smy = s(i,j) - half * sy(i,j) if (iconserv.eq.1) then st = -(uedge(i+1,j)*xlo(i+1,j) - uedge(i,j)*xlo(i,j))/hx & + s(i,j)*(uedge(i+1,j)-uedge(i,j))/hx & - s(i,j)*divu(i,j) else #if 1 if (uedge(i,j)*uedge(i+1,j).le.0.d0) then ubar = 0.5d0*(uedge(i,j)+uedge(i+1,j)) if (ubar.lt.0.d0) then inc = 1 else inc = 0 endif tr = ubar*(s(i+inc,j)-s(i+inc-1,j))/hx else tr = half*(uedge(i+1,j) + uedge(i,j)) * & (xlo(i+1,j) - xlo(i,j) ) / hx endif #else tr = half*(uedge(i+1,j) + uedge(i,j)) * extra_work(i,j,1) #endif st = -tr endif stylo(j+1)= spy - dthy*vedge(i,j+1)*sy(i,j) + dth*(st + tforces(i,j)) styhi(j )= smy - dthy*vedge(i,j )*sy(i,j) + dth*(st + tforces(i,j)) end do if (bc(2,1).eq.EXT_DIR .and. vedge(i,jmin).ge.zero) then styhi(jmin) = s(i,jmin-1) stylo(jmin) = s(i,jmin-1) else if (bc(2,1).eq.EXT_DIR .and. vedge(i,jmin).lt.zero) then stylo(jmin) = styhi(jmin) else if (bc(2,1).eq.FOEXTRAP.or.bc(2,1).eq.HOEXTRAP & .or.bc(2,1).eq.REFLECT_EVEN) then stylo(jmin) = styhi(jmin) else if (bc(2,1).eq.REFLECT_ODD) then styhi(jmin) = zero stylo(jmin) = zero end if if (bc(2,2).eq.EXT_DIR .and. vedge(i,jmax+1).le.zero) then stylo(jmax+1) = s(i,jmax+1) styhi(jmax+1) = s(i,jmax+1) else if (bc(2,2).eq.EXT_DIR .and. vedge(i,jmax+1).gt.zero) then styhi(jmax+1) = stylo(jmax+1) else if (bc(2,2).eq.FOEXTRAP.or.bc(2,2).eq.HOEXTRAP & .or.bc(2,2).eq.REFLECT_EVEN) then styhi(jmax+1) = stylo(jmax+1) else if (bc(2,2).eq.REFLECT_ODD) then stylo(jmax+1) = zero styhi(jmax+1) = zero end if do j=jmin,jmax+1 ystate(i,j) = cvmgp(stylo(j),styhi(j),vedge(i,j)) ystate(i,j) = cvmgt(half*(stylo(j)+styhi(j)),ystate(i,j), & abs(vedge(i,j)).lt.eps) end do place_to_break = 1 end do end subroutine FORT_ADV_FORCING( & aofs,DIMS(aofs), & xflux,DIMS(xflux), & uedge,DIMS(uedge), & areax,DIMS(ax), & yflux,DIMS(yflux), & vedge,DIMS(vedge), & areay,DIMS(ay), & vol,DIMS(vol), & lo,hi,iconserv ) c c This subroutine uses scalar edge states to compute c an advective tendency c implicit none integer i,j integer iconserv REAL_T divux,divuy integer imin,jmin,imax,jmax integer lo(SDIM),hi(SDIM) integer DIMDEC(aofs) integer DIMDEC(vol) integer DIMDEC(uedge) integer DIMDEC(vedge) integer DIMDEC(xflux) integer DIMDEC(yflux) integer DIMDEC(ax) integer DIMDEC(ay) REAL_T aofs(DIMV(aofs)) REAL_T vol(DIMV(vol)) REAL_T uedge(DIMV(uedge)) REAL_T vedge(DIMV(vedge)) REAL_T xflux(DIMV(xflux)) REAL_T yflux(DIMV(yflux)) REAL_T areax(DIMV(ax)) REAL_T areay(DIMV(ay)) imin = lo(1) jmin = lo(2) imax = hi(1) jmax = hi(2) c c if nonconservative initialize the advective tendency as -U*grad(S) c if ( iconserv .ne. 1 ) then do j = jmin,jmax do i = imin,imax divux = ( & areax(i+1,j)*uedge(i+1,j) - & areax(i, j)*uedge(i, j) )/vol(i,j) divuy = ( & areay(i,j+1)*vedge(i,j+1) - & areay(i,j )*vedge(i,j ) )/vol(i,j) aofs(i,j) = & - divux*half*(xflux(i+1,j) + xflux(i,j)) & - divuy*half*(yflux(i,j+1) + yflux(i,j)) end do end do end if c c convert edge states to fluxes c do j = jmin,jmax do i = imin,imax+1 xflux(i,j) = xflux(i,j)*uedge(i,j)*areax(i,j) end do end do do j = jmin,jmax+1 do i = imin,imax yflux(i,j) = yflux(i,j)*vedge(i,j)*areay(i,j) end do end do c c compute part of advective tendency that depends on the flux convergence c if ( iconserv .ne. 1 ) then do j = jmin,jmax do i = imin,imax aofs(i,j) = aofs(i,j) + ( & xflux(i+1,j) - xflux(i,j) + & yflux(i,j+1) - yflux(i,j))/vol(i,j) end do end do else do j = jmin,jmax do i = imin,imax aofs(i,j) = ( & xflux(i+1,j) - xflux(i,j) + & yflux(i,j+1) - yflux(i,j))/vol(i,j) end do end do end if end subroutine FORT_SYNC_ADV_FORCING( & sync,DIMS(sync), & xflux,DIMS(xflux), & ucor,DIMS(ucor), & areax,DIMS(ax), & yflux,DIMS(yflux), & vcor,DIMS(vcor), & areay,DIMS(ay), & vol,DIMS(vol), & lo,hi,iconserv ) c c This subroutine computes the sync advective tendency c for a state variable c implicit none integer i,j integer iconserv integer imin,jmin,imax,jmax integer lo(SDIM),hi(SDIM) integer DIMDEC(sync) integer DIMDEC(vol) integer DIMDEC(ucor) integer DIMDEC(vcor) integer DIMDEC(xflux) integer DIMDEC(yflux) integer DIMDEC(ax) integer DIMDEC(ay) REAL_T sync(DIMV(sync)) REAL_T vol(DIMV(vol)) REAL_T ucor(DIMV(ucor)) REAL_T vcor(DIMV(vcor)) REAL_T xflux(DIMV(xflux)) REAL_T yflux(DIMV(yflux)) REAL_T areax(DIMV(ax)) REAL_T areay(DIMV(ay)) imin = lo(1) jmin = lo(2) imax = hi(1) jmax = hi(2) c c compute corrective fluxes from edge states c and perform conservative update c do j = jmin,jmax do i = imin,imax+1 xflux(i,j) = xflux(i,j)*ucor(i,j)*areax(i,j) end do end do do j = jmin,jmax+1 do i = imin,imax yflux(i,j) = yflux(i,j)*vcor(i,j)*areay(i,j) end do end do do j = jmin,jmax do i = imin,imax sync(i,j) = sync(i,j) + ( & xflux(i+1,j) - xflux(i,j) + & yflux(i,j+1) - yflux(i,j) )/vol(i,j) end do end do end subroutine trans_xbc( & s,DIMS(s), & xlo,xhi,DIMS(xx),uad,DIMS(uad), & lo,hi,n,xbc,eps) c c This subroutine processes boundary conditions on information c traced to cell faces in the x direction. This is used for c computing velocities and edge states used in calculating c transverse derivatives c integer DIMDEC(s), DIMDEC(xx), DIMDEC(uad) integer n integer lo(SDIM), hi(SDIM) REAL_T stx REAL_T s(DIMV(s)) REAL_T xlo(DIMV(xx)) REAL_T xhi(DIMV(xx)) REAL_T uad(DIMV(uad)) REAL_T eps integer xbc(SDIM,2) logical ltest integer j integer imin,jmin,imax,jmax imin = lo(1) jmin = lo(2) imax = hi(1) jmax = hi(2) if (xbc(1,1).eq.EXT_DIR) then if (n .eq. XVEL) then do j = jmin-1,jmax+1 if (uad(imin,j) .ge. zero) then xhi(imin,j) = s(imin-1,j) xlo(imin,j) = s(imin-1,j) else xlo(imin,j) = xhi(imin,j) end if end do else do j = jmin-1,jmax+1 ltest = uad(imin,j).le.eps stx = cvmgt(xhi(imin,j),s(imin-1,j),ltest) xhi(imin,j) = stx xlo(imin,j) = stx end do end if else if (xbc(1,1).eq.FOEXTRAP.or.xbc(1,1).eq.HOEXTRAP & .or.xbc(1,1).eq.REFLECT_EVEN) then do j = jmin-1,jmax+1 xlo(imin,j) = xhi(imin,j) end do else if (xbc(1,1).eq.REFLECT_ODD) then do j = jmin-1,jmax+1 xhi(imin,j) = zero xlo(imin,j) = zero end do end if c if (xbc(1,2).eq.EXT_DIR) then if (n .eq. XVEL) then do j = jmin-1,jmax+1 if (uad(imax+1,j) .le. zero) then xhi(imax+1,j) = s(imax+1,j) xlo(imax+1,j) = s(imax+1,j) else xhi(imax+1,j) = xlo(imax+1,j) end if end do else do j = jmin-1,jmax+1 ltest = uad(imax+1,j).ge.-eps stx = cvmgt(xlo(imax+1,j),s(imax+1,j),ltest) xhi(imax+1,j) = stx xlo(imax+1,j) = stx end do end if else if (xbc(1,2).eq.FOEXTRAP.or.xbc(1,2).eq.HOEXTRAP & .or.xbc(1,2).eq.REFLECT_EVEN) then do j = jmin-1,jmax+1 xhi(imax+1,j) = xlo(imax+1,j) end do else if (xbc(1,2).eq.REFLECT_ODD) then do j = jmin-1,jmax+1 xhi(imax+1,j) = zero xlo(imax+1,j) = zero end do end if end subroutine trans_ybc( & s,DIMS(s), & ylo,yhi,DIMS(yy),vad,DIMS(vad), & lo,hi,n,ybc,eps) c c This subroutine processes boundary conditions on information c traced to cell faces in the y direction. This is used for c computing velocities and edge states used in calculating c transverse derivatives c integer DIMDEC(s), DIMDEC(yy), DIMDEC(vad) integer n integer lo(SDIM), hi(SDIM) REAL_T sty REAL_T s(DIMV(s)) REAL_T ylo(DIMV(yy)) REAL_T yhi(DIMV(yy)) REAL_T vad(DIMV(vad)) REAL_T eps integer ybc(SDIM,2) logical ltest integer i integer imin,jmin,imax,jmax imin = lo(1) jmin = lo(2) imax = hi(1) jmax = hi(2) if (ybc(2,1).eq.EXT_DIR) then if (n .eq. YVEL) then do i = imin-1,imax+1 if (vad(i,jmin).ge.zero) then yhi(i,jmin) = s(i,jmin-1) ylo(i,jmin) = s(i,jmin-1) else ylo(i,jmin) = yhi(i,jmin) end if end do else do i = imin-1,imax+1 ltest = vad(i,jmin).le.eps sty = cvmgt(yhi(i,jmin),s(i,jmin-1),ltest) yhi(i,jmin) = sty ylo(i,jmin) = sty end do end if else if (ybc(2,1).eq.FOEXTRAP.or.ybc(2,1).eq.HOEXTRAP & .or.ybc(2,1).eq.REFLECT_EVEN) then do i = imin-1,imax+1 ylo(i,jmin) = yhi(i,jmin) end do else if (ybc(2,1).eq.REFLECT_ODD) then do i = imin-1,imax+1 yhi(i,jmin) = zero ylo(i,jmin) = zero end do end if if (ybc(2,2).eq.EXT_DIR) then if (n .eq. YVEL) then do i = imin-1,imax+1 if (vad(i,jmax+1).le.zero) then ylo(i,jmax+1) = s(i,jmax+1) yhi(i,jmax+1) = s(i,jmax+1) else yhi(i,jmax+1) = ylo(i,jmax+1) end if end do else do i = imin-1,imax+1 ltest = vad(i,jmax+1).ge.-eps sty = cvmgt(ylo(i,jmax+1),s(i,jmax+1),ltest) yhi(i,jmax+1) = sty ylo(i,jmax+1) = sty end do end if else if (ybc(2,2).eq.FOEXTRAP.or.ybc(2,2).eq.HOEXTRAP & .or.ybc(2,2).eq.REFLECT_EVEN) then do i = imin-1,imax+1 yhi(i,jmax+1) = ylo(i,jmax+1) end do else if (ybc(2,2).eq.REFLECT_ODD) then do i = imin-1,imax+1 ylo(i,jmax+1) = zero yhi(i,jmax+1) = zero end do end if end subroutine FORT_SLOPES (s,DIMS(s),slx,sly,DIMS(sl), & lo,hi,slxscr,slyscr,bc) c c this subroutine computes first, second or forth order slopes of c a 2D scalar field. c c Boundary conditions on interior slopes are handled automatically c by the ghost cells c c Boundary conditions on EXT_DIR and HOEXTRAP slopes are implemented c by setting them to zero outside of the domain and using a c one-sided derivative from the interior c implicit none #include "GODCOMM_F.H" integer lo(SDIM), hi(SDIM) integer bc(SDIM,2) integer DIMDEC(s) integer DIMDEC(sl) REAL_T s(DIMV(s)) REAL_T slx(DIMV(sl)) REAL_T sly(DIMV(sl)) REAL_T slxscr(DIM1(s), 4) REAL_T slyscr(DIM2(s), 4) integer cen,lim,flag,fromm parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) integer imin,jmin,imax,jmax,i,j integer ng REAL_T dpls,dmin,ds REAL_T del,slim,sflg ng = lo(1) - ARG_L1(s) imin = lo(1) jmin = lo(2) imax = hi(1) jmax = hi(2) c c ::: ::::: added to prevent underflow for small s values c do j = lo(2)-ng, hi(2)+ng do i = lo(1)-ng, hi(1)+ng s(i,j) = cvmgt(s(i,j), zero, abs(s(i,j)).gt.1.0D-20) end do end do c c COMPUTE 0TH order slopes c if (slope_order.eq.1) then if (ng .lt. 1) then call bl_abort("FORT_SLOPES: not enough bndry cells for 1st order") end if do j = jmin-1,jmax+1 do i = imin-1,imax+1 slx(i,j) = zero sly(i,j) = zero end do end do end if c c COMPUTE 2nd order slopes c if (slope_order.eq.2) then if (ng .lt. 2) then call bl_abort("SLOPE_2D: not enough bndry cells for 2nd order") end if c c ------------------------ x slopes c if (use_unlimited_slopes) then do j = jmin-1,jmax+1 do i = imin-1,imax+1 slx(i,j) = half*(s(i+1,j)-s(i-1,j)) end do end do if (bc(1,1) .eq. EXT_DIR .or. bc(1,1) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 slx(imin-1,j) = zero slx(imin,j) = (s(imin+1,j)+three*s(imin,j)-four*s(imin-1,j))/three end do end if if (bc(1,2) .eq. EXT_DIR .or. bc(1,2) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 slx(imax+1,j) = zero slx(imax,j) = -(s(imax-1,j)+three*s(imax,j)-four*s(imax+1,j))/three end do end if else do j = jmin-1,jmax+1 do i = imin-1,imax+1 del = half*(s(i+1,j)-s(i-1,j)) dpls = two*(s(i+1,j) - s(i ,j)) dmin = two*(s(i ,j) - s(i-1,j)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slx(i,j)= sflg*min(slim,abs(del)) end do end do if (bc(1,1) .eq. EXT_DIR .or. bc(1,1) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 slx(imin-1,j) = zero del = (s(imin+1,j)+three*s(imin,j)-four*s(imin-1,j))/three dpls = two*(s(imin+1,j) - s(imin ,j)) dmin = two*(s(imin ,j) - s(imin-1,j)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slx(imin,j)= sflg*min(slim,abs(del)) end do end if if (bc(1,2) .eq. EXT_DIR .or. bc(1,2) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 slx(imax+1,j) = zero del = -(s(imax-1,j)+three*s(imax,j)-four*s(imax+1,j))/three dpls = two*(s(imax+1,j) - s(imax ,j)) dmin = two*(s(imax ,j) - s(imax-1,j)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slx(imax,j)= sflg*min(slim,abs(del)) end do end if end if c c ------------------------ y slopes c if (use_unlimited_slopes) then do j = jmin-1,jmax+1 do i = imin-1,imax+1 sly(i,j) = half*(s(i,j+1)-s(i,j-1)) end do end do if (bc(2,1) .eq. EXT_DIR .or. bc(2,1) .eq. HOEXTRAP) then do i = imin-1, imax+1 sly(i,jmin-1) = zero sly(i,jmin) = (s(i,jmin+1)+three*s(i,jmin)-four*s(i,jmin-1))/three end do end if if (bc(2,2) .eq. EXT_DIR .or. bc(2,2) .eq. HOEXTRAP) then do i = imin-1, imax+1 sly(i,jmax+1) = zero sly(i,jmax) = -(s(i,jmax-1)+three*s(i,jmax)-four*s(i,jmax+1))/three end do end if else do j = jmin-1,jmax+1 do i = imin-1,imax+1 del = half*(s(i,j+1)-s(i,j-1)) dpls = two*(s(i,j+1) - s(i,j )) dmin = two*(s(i,j ) - s(i,j-1)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) sly(i,j)= sflg*min(slim,abs(del)) end do end do if (bc(2,1) .eq. EXT_DIR .or. bc(2,1) .eq. HOEXTRAP) then do i = imin-1, imax+1 sly(i,jmin-1) = zero del = (s(i,jmin+1)+three*s(i,jmin)-four*s(i,jmin-1))/three dpls = two*(s(i,jmin+1) - s(i,jmin )) dmin = two*(s(i,jmin ) - s(i,jmin-1)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) sly(i,jmin)= sflg*min(slim,abs(del)) end do end if if (bc(2,2) .eq. EXT_DIR .or. bc(2,2) .eq. HOEXTRAP) then do i = imin-1, imax+1 sly(i,jmax+1) = zero del = -(s(i,jmax-1)+three*s(i,jmax)-four*s(i,jmax+1))/three dpls = two*(s(i,jmax+1) - s(i,jmax )) dmin = two*(s(i,jmax ) - s(i,jmax-1)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) sly(i,jmax)= sflg*min(slim,abs(del)) end do end if end if c c ... end, if slope_order .eq. 2 c end if c c COMPUTE 4TH order slopes c if (slope_order.eq.4) then if (ng .lt. 3) then call bl_abort("SLOPE_2D: not enough bndry cells for 4th order") end if c c ------------------------ x slopes c if (use_unlimited_slopes) then do j = jmin-1,jmax+1 do i = imin-2,imax+2 slxscr(i,cen) = half*(s(i+1,j)-s(i-1,j)) end do do i = imin-1,imax+1 slx(i,j) = two * two3rd * slxscr(i,cen) - & sixth * (slxscr(i+1,cen) + slxscr(i-1,cen)) end do end do if (bc(1,1) .eq. EXT_DIR .or. bc(1,1) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 slx(imin,j) = -sixteen/fifteen*s(imin-1,j) + half*s(imin,j) + & two3rd*s(imin+1,j) - tenth*s(imin+2,j) slx(imin-1,j) = zero end do end if if (bc(1,2) .eq. EXT_DIR .or. bc(1,2) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 slx(imax,j) = -( -sixteen/fifteen*s(imax+1,j) + half*s(imax,j) + & two3rd*s(imax-1,j) - tenth*s(imax-2,j) ) slx(imax+1,j) = zero end do end if else do j = jmin-1,jmax+1 do i = imin-2,imax+2 dmin = two*(s(i, j)-s(i-1,j)) dpls = two*(s(i+1,j)-s(i ,j)) slxscr(i,cen) = half*(s(i+1,j)-s(i-1,j)) slxscr(i,lim) = min(abs(dmin),abs(dpls)) slxscr(i,lim) = cvmgp(slxscr(i,lim),zero,dpls*dmin) slxscr(i,flag) = sign(one,slxscr(i,cen)) slxscr(i,fromm)= slxscr(i,flag)* & min(slxscr(i,lim),abs(slxscr(i,cen))) end do do i = imin-1,imax+1 ds = two * two3rd * slxscr(i,cen) - & sixth * (slxscr(i+1,fromm) + slxscr(i-1,fromm)) slx(i,j) = slxscr(i,flag)*min(abs(ds),slxscr(i,lim)) end do if (bc(1,1) .eq. EXT_DIR .or. bc(1,1) .eq. HOEXTRAP) then del = -sixteen/fifteen*s(imin-1,j) + half*s(imin,j) + & two3rd*s(imin+1,j) - tenth*s(imin+2,j) dmin = two*(s(imin ,j)-s(imin-1,j)) dpls = two*(s(imin+1,j)-s(imin ,j)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slx(imin-1,j) = zero slx(imin, j) = sflg*min(slim,abs(del)) c Recalculate the slope at imin+1 using the revised slxscr(imin,fromm) slxscr(imin,fromm) = slx(imin,j) ds = two * two3rd * slxscr(imin+1,cen) - $ sixth * (slxscr(imin+2,fromm) + slxscr(imin,fromm)) slx(imin+1,j) = slxscr(imin+1,flag)*min(abs(ds),slxscr(imin+1,lim)) end if if (bc(1,2) .eq. EXT_DIR .or. bc(1,2) .eq. HOEXTRAP) then del = -( -sixteen/fifteen*s(imax+1,j) + half*s(imax,j) + & two3rd*s(imax-1,j) - tenth*s(imax-2,j) ) dmin = two*(s(imax ,j)-s(imax-1,j)) dpls = two*(s(imax+1,j)-s(imax ,j)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slx(imax, j) = sflg*min(slim,abs(del)) slx(imax+1,j) = zero c Recalculate the slope at imax-1 using the revised slxscr(imax,fromm) slxscr(imax,fromm) = slx(imax,j) ds = two * two3rd * slxscr(imax-1,cen) - $ sixth * (slxscr(imax-2,fromm) + slxscr(imax,fromm)) slx(imax-1,j) = slxscr(imax-1,flag)*min(abs(ds),slxscr(imax-1,lim)) end if end do end if c c ------------------------ y slopes c if (use_unlimited_slopes) then do i = imin-1,imax+1 do j = jmin-2,jmax+2 slyscr(j,cen) = half*(s(i,j+1)-s(i,j-1)) end do do j = jmin-1,jmax+1 sly(i,j) = two * two3rd * slyscr(j,cen) - & sixth * (slyscr(j+1,cen) + slyscr(j-1,cen)) end do end do if (bc(2,1) .eq. EXT_DIR .or. bc(2,1) .eq. HOEXTRAP) then do i = imin-1, imax+1 sly(i,jmin-1) = zero sly(i,jmin) = -sixteen/fifteen*s(i,jmin-1) + half*s(i,jmin) + & two3rd*s(i,jmin+1) - tenth*s(i,jmin+2) end do end if if (bc(2,2) .eq. EXT_DIR .or. bc(2,2) .eq. HOEXTRAP) then do i = imin-1, imax+1 sly(i,jmax) = -( -sixteen/fifteen*s(i,jmax+1) + half*s(i,jmax) + & two3rd*s(i,jmax-1) - tenth*s(i,jmax-2) ) sly(i,jmax+1) = zero end do end if else do i = imin-1,imax+1 do j = jmin-2,jmax+2 dmin = two*(s(i,j )-s(i,j-1)) dpls = two*(s(i,j+1)-s(i,j )) slyscr(j,cen) = half*(s(i,j+1)-s(i,j-1)) slyscr(j,lim) = min(abs(dmin),abs(dpls)) slyscr(j,lim) = cvmgp(slyscr(j,lim),zero,dpls*dmin) slyscr(j,flag) = sign(one,slyscr(j,cen)) slyscr(j,fromm)= slyscr(j,flag)* & min(slyscr(j,lim),abs(slyscr(j,cen))) end do do j = jmin-1,jmax+1 ds = two * two3rd * slyscr(j,cen) - & sixth * (slyscr(j+1,fromm) + slyscr(j-1,fromm)) sly(i,j) = slyscr(j,flag)*min(abs(ds),slyscr(j,lim)) end do if (bc(2,1) .eq. EXT_DIR .or. bc(2,1) .eq. HOEXTRAP) then del = -sixteen/fifteen*s(i,jmin-1) + half*s(i,jmin) + & two3rd*s(i,jmin+1) - tenth*s(i,jmin+2) dmin = two*(s(i,jmin )-s(i,jmin-1)) dpls = two*(s(i,jmin+1)-s(i,jmin )) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) sly(i,jmin-1) = zero sly(i,jmin ) = sflg*min(slim,abs(del)) c Recalculate the slope at jmin+1 using the revised slyscr(jmin,fromm) slyscr(jmin,fromm) = sly(i,jmin) ds = two * two3rd * slyscr(jmin+1,cen) - $ sixth * (slyscr(jmin+2,fromm) + slyscr(jmin,fromm)) sly(i,jmin+1) = slyscr(jmin+1,flag)*min(abs(ds),slyscr(jmin+1,lim)) end if if (bc(2,2) .eq. EXT_DIR .or. bc(2,2) .eq. HOEXTRAP) then del = -( -sixteen/fifteen*s(i,jmax+1) + half*s(i,jmax) + & two3rd*s(i,jmax-1) - tenth*s(i,jmax-2) ) dmin = two*(s(i,jmax )-s(i,jmax-1)) dpls = two*(s(i,jmax+1)-s(i,jmax )) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) sly(i,jmax ) = sflg*min(slim,abs(del)) sly(i,jmax+1) = zero c Recalculate the slope at jmax-1 using the revised slyscr(jmax,fromm) slyscr(jmax,fromm) = sly(i,jmax) ds = two * two3rd * slyscr(jmax-1,cen) - $ sixth * (slyscr(jmax-2,fromm) + slyscr(jmax,fromm)) sly(i,jmax-1) = slyscr(jmax-1,flag)*min(abs(ds),slyscr(jmax-1,lim)) end if end do end if c c ... end, if slope_order .eq. 4 c end if end subroutine FORT_SCALMINMAX(s,DIMS(s),sn,DIMS(sn), & lo,hi,bc) c c correct an advected field for under/over shoots c integer DIMDEC(s) integer DIMDEC(sn) integer lo(SDIM), hi(SDIM) integer bc(SDIM,2) REAL_T s(DIMV(s)) REAL_T sn(DIMV(sn)) integer i, j, imin, imax, jmin, jmax REAL_T smin, smax imin = lo(1) imax = hi(1) jmin = lo(2) jmax = hi(2) c c set corner values for s c c :: corner ilo, jlo c if (bc(1,1).ne.INT_DIR .or. bc(2,1).ne.INT_DIR) then s(imin-1,jmin-1) = s(imin,jmin) end if c c :: corner ihi, jlo c if (bc(1,2).ne.INT_DIR .or. bc(2,1).ne.INT_DIR) then s(imax+1,jmin-1) = s(imax,jmin) end if c c :: corner ilo, jhi c if (bc(1,1).ne.INT_DIR .or. bc(2,2).ne.INT_DIR) then s(imin-1,jmax+1) = s(imin,jmax) end if c c :: corner ihi, jhi c if (bc(1,2).ne.INT_DIR .or. bc(2,2).ne.INT_DIR) then s(imax+1,jmax+1) = s(imax,jmax) end if c c compute extrema of s c do j = jmin, jmax do i = imin, imax smin = min( & s(i-1,j-1),s(i ,j-1),s(i+1,j-1), & s(i-1,j ),s(i ,j ),s(i+1,j ), & s(i-1,j+1),s(i ,j+1),s(i+1,j+1)) smax = max( & s(i-1,j-1),s(i ,j-1),s(i+1,j-1), & s(i-1,j ),s(i ,j ),s(i+1,j ), & s(i-1,j+1),s(i ,j+1),s(i+1,j+1)) sn(i,j) = max(sn(i,j),smin) sn(i,j) = min(sn(i,j),smax) end do end do end subroutine FORT_SUM_TF_GP( & tforces,DIMS(tf), & gp,DIMS(gp), & rho,DIMS(rho), & lo,hi ) c c sum pressure forcing into tforces c integer i, j, n integer DIMDEC(tf) integer DIMDEC(gp) integer DIMDEC(rho) integer lo(SDIM), hi(SDIM) REAL_T tforces(DIMV(tf),SDIM) REAL_T gp(DIMV(gp),SDIM) REAL_T rho(DIMV(rho)) do n = 1, SDIM do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,n) = ( & tforces(i,j,n) & - gp(i,j,n))/rho(i,j) end do end do end do end subroutine FORT_SUM_TF_GP_VISC( & tforces,DIMS(tf), & visc,DIMS(visc), & gp,DIMS(gp), & rho,DIMS(rho), & lo,hi ) c c sum pressure forcing and viscous forcing into c tforces c integer i, j, n integer DIMDEC(tf) integer DIMDEC(visc) integer DIMDEC(gp) integer DIMDEC(rho) integer lo(SDIM), hi(SDIM) REAL_T tforces(DIMV(tf),SDIM) REAL_T visc(DIMV(visc),SDIM) REAL_T gp(DIMV(gp),SDIM) REAL_T rho(DIMV(rho)) do n = 1, SDIM do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,n) = ( & tforces(i,j,n) & + visc(i,j,n) & - gp(i,j,n))/rho(i,j) end do end do end do end subroutine FORT_SUM_TF_DIVU( & S,DIMS(S), & tforces,DIMS(tf), & divu,DIMS(divu), & rho,DIMS(rho), & lo,hi,nvar,iconserv ) c c sum divU*S into tforces or divide tforces by rho c depending on the value of iconserv c integer nvar, iconserv integer lo(SDIM), hi(SDIM) integer i, j, n integer DIMDEC(S) integer DIMDEC(tf) integer DIMDEC(divu) integer DIMDEC(rho) REAL_T S(DIMV(S),nvar) REAL_T tforces(DIMV(tf),nvar) REAL_T divu(DIMV(divu)) REAL_T rho(DIMV(rho)) if ( iconserv .eq. 1 ) then do n = 1, nvar do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,n) = & tforces(i,j,n) - S(i,j,n)*divu(i,j) end do end do end do else do n = 1, nvar do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,n) = & tforces(i,j,n)/rho(i,j) end do end do end do end if end subroutine FORT_SUM_TF_DIVU_VISC( & S,DIMS(S), & tforces,DIMS(tf), & divu,DIMS(divu), & visc,DIMS(visc), & rho,DIMS(rho), & lo,hi,nvar,iconserv ) c c sum tforces, viscous foricing and divU*S into tforces c depending on the value of iconserv c integer nvar, iconserv integer lo(SDIM), hi(SDIM) integer i, j, n integer DIMDEC(S) integer DIMDEC(tf) integer DIMDEC(divu) integer DIMDEC(visc) integer DIMDEC(rho) REAL_T S(DIMV(S),nvar) REAL_T tforces(DIMV(tf),nvar) REAL_T divu(DIMV(divu)) REAL_T visc(DIMV(visc),nvar) REAL_T rho(DIMV(rho)) if ( iconserv .eq. 1 ) then do n = 1, nvar do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,n) = & tforces(i,j,n) & + visc(i,j,n) & - S(i,j,n)*divu(i,j) end do end do end do else do n = 1, nvar do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,n) = ( & tforces(i,j,n) & + visc(i,j,n) )/rho(i,j) end do end do end do end if end subroutine FORT_UPDATE_TF( & s, DIMS(s), & sn, DIMS(sn), & tforces, DIMS(tf), & lo,hi,dt,nvar) c c update a field with a forcing term c integer i, j, n, nvar integer DIMDEC(s) integer DIMDEC(sn) integer DIMDEC(tf) integer lo(SDIM), hi(SDIM) REAL_T dt REAL_T s(DIMV(s),nvar) REAL_T sn(DIMV(sn),nvar) REAL_T tforces(DIMV(tf),nvar) do n = 1,nvar do j = lo(2), hi(2) do i = lo(1), hi(1) sn(i,j,n) = s(i,j,n) + dt*tforces(i,j,n) end do end do end do end subroutine FORT_CORRECT_TF( & ss, sp, DIMS(ss), & tfs, tfn, DIMS(tfs), & lo,hi,dt,nvar) c c correct 1st order rk to second-order c integer i, j, n, nvar integer lo(SDIM), hi(SDIM) REAL_T dt,hdt integer DIMDEC(ss) integer DIMDEC(tfs) REAL_T ss(DIMV(ss),nvar) REAL_T sp(DIMV(ss),nvar) REAL_T tfs(DIMV(tfs),nvar) REAL_T tfn(DIMV(tfs),nvar) hdt = half*dt do n = 1,nvar do j = lo(2), hi(2) do i = lo(1), hi(1) sp(i,j,n) = ss(i,j,n) & + hdt*(tfs(i,j,n)-tfn(i,j,n)) end do end do end do end subroutine FORT_UPDATE_AOFS_TF( & s, DIMS(s), & sn, DIMS(sn), & aofs, DIMS(aofs), & tforces, DIMS(tf), & lo,hi,dt,nvar) c c update a field with an advective tendency c and a forcing term c integer i, j, n, nvar integer DIMDEC(s) integer DIMDEC(sn) integer DIMDEC(aofs) integer DIMDEC(tf) integer lo(SDIM), hi(SDIM) REAL_T dt REAL_T s(DIMV(s),nvar) REAL_T sn(DIMV(sn),nvar) REAL_T aofs(DIMV(aofs),nvar) REAL_T tforces(DIMV(tf),nvar) do n = 1,nvar do j = lo(2), hi(2) do i = lo(1), hi(1) sn(i,j,n) = s(i,j,n) & - dt*aofs(i,j,n) & + dt*tforces(i,j,n) end do end do end do end subroutine FORT_UPDATE_AOFS_TF_GP( & u, DIMS(u), & un, DIMS(un), & aofs, DIMS(aofs), & tforces, DIMS(tf), & gp, DIMS(gp), & rho, DIMS(rho), & lo, hi, dt) c c update the velocities c integer i, j, n integer DIMDEC(u) integer DIMDEC(un) integer DIMDEC(aofs) integer DIMDEC(rho) integer DIMDEC(gp) integer DIMDEC(tf) integer lo(SDIM), hi(SDIM) REAL_T u(DIMV(u),SDIM) REAL_T un(DIMV(un),SDIM) REAL_T aofs(DIMV(aofs),SDIM) REAL_T rho(DIMV(rho)) REAL_T gp(DIMV(gp),SDIM) REAL_T tforces(DIMV(tf),SDIM) REAL_T dt do n = 1, SDIM do j = lo(2), hi(2) do i = lo(1), hi(1) un(i,j,n) = u(i,j,n) & - dt* aofs(i,j,n) & + dt*tforces(i,j,n)/rho(i,j) & - dt* gp(i,j,n)/rho(i,j) end do end do end do end subroutine bdsslope(s,lo_1,lo_2,hi_1,hi_2,slx,sly,sc,dx) integer lo_1,lo_2,hi_1,hi_2 REAL_T s(lo_1-3:hi_1+3,lo_2-3:hi_2+3) REAL_T slx(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T sly(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T slxy(lo_1-1:hi_1+1,lo_2-1:hi_2+1) REAL_T sint(lo_1-2:hi_1+2,lo_2-2:hi_2+2) REAL_T sc(lo_1-1:hi_1+1,lo_2-1:hi_2+1,4) REAL_T dx(2) REAL_T diff(lo_1-1:hi_1+1,4) REAL_T smin(lo_1-1:hi_1+1,4) REAL_T smax(lo_1-1:hi_1+1,4) REAL_T sumdif(lo_1-1:hi_1+1) REAL_T sgndif(lo_1-1:hi_1+1) integer kdp(lo_1-1:hi_1+1) REAL_T hx,hy,sumloc,redfac,redmax,div REAL_T choice1,choice2 REAL_T eps integer inc1, inc2, inc3, inc4 integer i,j,k,ll,is,ie,js,je hx = dx(1) hy = dx(2) is = lo_1 ie = hi_1 js = lo_2 je = hi_2 eps = 1.d-8 do i = is-2,ie+1 do j = js-2,je+1 sint(i,j) = ( $ s(i-1,j-1) + s(i-1,j+2) + s(i+2,j-1) + s(i+2,j+2) $ - seven*(s(i-1,j ) + s(i-1,j+1) + s(i ,j-1) + s(i+1,j-1) + $ s(i ,j+2) + s(i+1,j+2) + s(i+2,j ) + s(i+2,j+1)) + $ 49.d0*(s(i ,j ) + s(i+1,j ) + s(i ,j+1) + s(i+1,j+1)) ) / 144.d0 enddo enddo do j = js-1,je+1 do i = is-1,ie+1 slx(i,j) = half*(sint(i ,j) + sint(i ,j-1) - $ sint(i-1,j) - sint(i-1,j-1) ) / hx sly(i,j) = half*(sint(i ,j) - sint(i ,j-1) + $ sint(i-1,j) - sint(i-1,j-1) ) / hy slxy(i,j) = (sint(i,j ) - sint(i ,j-1) - $ sint(i-1,j) + sint(i-1,j-1) ) / (hx*hy) enddo enddo do j = js-1,je+1 do i = is-1,ie+1 smin(i,4) = min(s(i,j), s(i+1,j), s(i,j+1), s(i+1,j+1)) smax(i,4) = max(s(i,j), s(i+1,j), s(i,j+1), s(i+1,j+1)) smin(i,3) = min(s(i,j), s(i+1,j), s(i,j-1), s(i+1,j-1)) smax(i,3) = max(s(i,j), s(i+1,j), s(i,j-1), s(i+1,j-1)) smin(i,2) = min(s(i,j), s(i-1,j), s(i,j+1), s(i-1,j+1)) smax(i,2) = max(s(i,j), s(i-1,j), s(i,j+1), s(i-1,j+1)) smin(i,1) = min(s(i,j), s(i-1,j), s(i,j-1), s(i-1,j-1)) smax(i,1) = max(s(i,j), s(i-1,j), s(i,j-1), s(i-1,j-1)) sc(i,j,4) = s(i,j) + half*(hx*slx(i,j) + hy*sly(i,j)) $ + fourth*hx*hy*slxy(i,j) sc(i,j,3) = s(i,j) + half*(hx*slx(i,j) - hy*sly(i,j)) $ - fourth*hx*hy*slxy(i,j) sc(i,j,2) = s(i,j) - half*(hx*slx(i,j) - hy*sly(i,j)) $ - fourth*hx*hy*slxy(i,j) sc(i,j,1) = s(i,j) - half*(hx*slx(i,j) + hy*sly(i,j)) $ + fourth*hx*hy*slxy(i,j) sc(i,j,4) = max(min(sc(i,j,4), smax(i,4)), smin(i,4)) sc(i,j,3) = max(min(sc(i,j,3), smax(i,3)), smin(i,3)) sc(i,j,2) = max(min(sc(i,j,2), smax(i,2)), smin(i,2)) sc(i,j,1) = max(min(sc(i,j,1), smax(i,1)), smin(i,1)) enddo do ll = 1,3 do i = is-1,ie+1 sumloc = fourth*(sc(i,j,4) + sc(i,j,3) + $ sc(i,j,2) + sc(i,j,1)) sumdif(i) = (sumloc - s(i,j))*4. sgndif(i) = sign(one,sumdif(i)) diff(i,4) = (sc(i,j,4) - s(i,j))*sgndif(i) diff(i,3) = (sc(i,j,3) - s(i,j))*sgndif(i) diff(i,2) = (sc(i,j,2) - s(i,j))*sgndif(i) diff(i,1) = (sc(i,j,1) - s(i,j))*sgndif(i) inc1 = cvmgp(1,0,diff(i,1) - eps) inc2 = cvmgp(1,0,diff(i,2) - eps) inc3 = cvmgp(1,0,diff(i,3) - eps) inc4 = cvmgp(1,0,diff(i,4) - eps) kdp(i) = inc1 + inc2 + inc3 + inc4 enddo do k = 1,4 do i = is-1,ie+1 div = cvmgt(one,kdp(i),kdp(i) .lt. 1) choice1 = sumdif(i)*sgndif(i)/div redfac = cvmgt(choice1,zero,diff(i,k).gt.eps) kdp(i) = cvmgt(kdp(i) - 1,kdp(i),diff(i,k) .gt. eps) choice1 = sc(i,j,k) - smin(i,k) choice2 = smax(i,k) - sc(i,j,k) redmax = cvmgp(choice1,choice2,sgndif(i)) redfac = min(redfac,redmax) sumdif(i) = sumdif(i) - redfac*sgndif(i) sc(i,j,k) = sc(i,j,k) - redfac*sgndif(i) enddo enddo enddo do i = is-1,ie+1 slx(i,j) = half*(sc(i,j,4) + sc(i,j,3) - $ sc(i,j,1) - sc(i,j,2))/hx sly(i,j) = half*(sc(i,j,4) + sc(i,j,2) - $ sc(i,j,1) - sc(i,j,3))/hy enddo enddo return end subroutine FORT_ESTATE_BDS(s, tforces, divu, DIMS(s), & xlo, xhi, sx, slxscr, stxlo, stxhi, & uedge, DIMS(uedge), xstate, DIMS(xstate), & ylo, yhi, sy, slyscr, stylo, styhi, & vedge, DIMS(vedge), ystate, DIMS(ystate), & DIMS(work), & bc,lo,hi,dt,dx,n,use_minion,iconserv) c c This subroutine computes edges states, right now it uses c a lot of memory, but there becomes a trade off between c simplicity-efficiency in the new way of computing states c and complexity in the old way. By eliminating loops over c state components though, the new way uses much less memory. c implicit none integer i,j,n integer lo(SDIM),hi(SDIM),bc(SDIM,2) integer is,js,ie,je REAL_T place_to_break REAL_T hx, hy, dt, dth, dthx, dthy REAL_T tr,ubar,vbar,stx,sty,fu,fv,dx(SDIM) REAL_T eps,eps_for_bc logical ltx,lty parameter( eps = 1.0D-6 ) parameter( eps_for_bc = 1.0D-10 ) integer DIMDEC(s) integer DIMDEC(work) integer DIMDEC(uedge) integer DIMDEC(xstate) integer DIMDEC(vedge) integer DIMDEC(ystate) REAL_T s(DIMV(s)) REAL_T stxlo(DIM1(s)),stxhi(DIM1(s)),slxscr(DIM1(s),4) REAL_T stylo(DIM2(s)),styhi(DIM2(s)),slyscr(DIM2(s),4) REAL_T uedge(DIMV(uedge)), xstate(DIMV(xstate)) REAL_T vedge(DIMV(vedge)), ystate(DIMV(ystate)) REAL_T xlo(DIMV(work)), xhi(DIMV(work)) REAL_T ylo(DIMV(work)), yhi(DIMV(work)) REAL_T sx(DIMV(work)) REAL_T sy(DIMV(work)) REAL_T tforces(DIMV(work)) REAL_T divu(DIMV(work)) REAL_T spx,smx,spy,smy,st,denom REAL_T smin,smax REAL_T sc(DIMV(work),4) REAL_T gamp(DIM1(work)) REAL_T gamm(DIM1(work)) REAL_T xm(DIM1(work)) REAL_T ym(DIM1(work)) REAL_T c(DIM1(work),4) REAL_T dt3rd integer choose_hi(DIM1(work)) integer use_minion, iconserv integer inc integer iup,isign,jup,jsign REAL_T vtrans,vmult,vdif,stem,vaddif dth = half*dt dthx = half*dt / dx(1) dthy = half*dt / dx(2) hx = dx(1) hy = dx(2) is = lo(1) js = lo(2) ie = hi(1) je = hi(2) dt3rd = dt * third smax = s(is,js) smin = s(is,js) do j = js,je do i = is,ie smax = max(smax,s(i,j)) smin = min(smin,s(i,j)) enddo enddo call bdsslope(s,lo(1),lo(2),hi(1),hi(2),sx,sy,sc,dx) do j = js,je do i = is-1,ie choose_hi(i+1) = cvmgp(0,1,uedge(i+1,j)) end do if (bc(1,1).eq.FOEXTRAP.or.bc(1,1).eq.HOEXTRAP & .or.bc(1,1).eq.REFLECT_EVEN) then choose_hi(is) = 1 endif if (bc(1,2).eq.FOEXTRAP.or.bc(1,2).eq.HOEXTRAP & .or.bc(1,2).eq.REFLECT_EVEN) then choose_hi(ie+1) = 0 endif do i = is-1,ie iup = cvmgt(i,i+1,choose_hi(i+1).eq.0) isign = cvmgt(1,-1, choose_hi(i+1).eq.0) vtrans = vedge(iup,j+1) jup = cvmgp(j,j+1,vtrans) jsign = cvmgp(1,-1,vtrans) vmult = cvmgp(uedge(i+1,j),half*(uedge(i+1,j)+uedge(i+1,j+1)),vtrans) xm(i) = isign*half*hx - two3rd*dt*vmult xm(i) = cvmgp(xm(i), isign*min(isign*xm(i),hx*half), vtrans) ym(i) = jsign*half*hy - dt3rd*vedge(iup,j+1) c(i,1) = sc(iup,jup,1) c(i,2) = sc(iup,jup,2) c(i,3) = sc(iup,jup,3) c(i,4) = sc(iup,jup,4) enddo call bilin(gamp,c,xm,ym,hx,hy,is-1,ie,lo(1),hi(1)) c Impose BCs on gamp. if (j .eq. je) then do i = is-1, ie if (bc(2,2).eq.EXT_DIR .and.(vedge(i,je+1).le.zero) ) then gamp(i) = s(i,je+1) else if (bc(2,2).eq.REFLECT_ODD) then gamp(i) = zero end if end do end if do i = is-1,ie iup = cvmgt(i,i+1,choose_hi(i+1).eq.0) isign = cvmgt(1,-1, choose_hi(i+1).eq.0) vtrans = vedge(iup,j) jup = cvmgp(j-1,j,vtrans) jsign = cvmgp(1,-1,vtrans) vmult = cvmgp(half*(uedge(i+1,j)+uedge(i+1,j-1)),uedge(i+1,j),vtrans) xm(i) = isign*half*hx - two3rd*dt*vmult xm(i) = cvmgp(isign*min(isign*xm(i),hx*half), xm(i), vtrans) ym(i) = jsign*half*hy - dt3rd*vedge(iup,j) c(i,1) = sc(iup,jup,1) c(i,2) = sc(iup,jup,2) c(i,3) = sc(iup,jup,3) c(i,4) = sc(iup,jup,4) enddo call bilin(gamm,c,xm,ym,hx,hy,is-1,ie,lo(1),hi(1)) c Impose BCs on gamm. if (j .eq. js) then do i = is-1, ie if (bc(2,1).eq.EXT_DIR .and.(vedge(i,js).ge.zero) ) then gamm(i) = s(i,js-1) else if (bc(2,1).eq.REFLECT_ODD) then gamm(i) = zero end if end do end if do i = is-1, ie iup = cvmgt(i,i+1,choose_hi(i+1).eq.0) isign = cvmgt(1,-1, choose_hi(i+1).eq.0) vdif = dth*(vedge(iup,j+1)*gamp(i) - vedge(iup,j )*gamm(i) ) / hy stem = s(iup,j) + (isign*hx - uedge(i+1,j)*dt)*half*sx(iup,j) c vaddif = dth*stem*(uedge(iup+1,j) - uedge(iup,j))/hx vaddif = dth*stem*(divu(iup,j) - (vedge(iup,j+1)-vedge(iup,j))/hy) xstate(i+1,j) = stem - vdif - vaddif + dth*tforces(iup,j) if (iconserv .eq. 0) $ xstate(i+1,j) = xstate(i+1,j) + dth*stem*divu(iup,j) enddo enddo do j = js-1,je do i = is,ie choose_hi(i) = cvmgp(0,1,vedge(i,j+1)) if ( (j .eq. js-1) .and. & (bc(2,1).eq.FOEXTRAP.or.bc(2,1).eq.HOEXTRAP & .or.bc(2,1).eq.REFLECT_EVEN) ) & choose_hi(i) = 1 if ( (j .eq. je) .and. & (bc(2,2).eq.FOEXTRAP.or.bc(2,2).eq.HOEXTRAP & .or.bc(2,2).eq.REFLECT_EVEN) ) & choose_hi(i) = 0 end do do i = is,ie jup = cvmgt(j,j+1,choose_hi(i).eq.0) jsign = cvmgt(1, -1,choose_hi(i).eq.0) vtrans = uedge(i+1,jup) iup = cvmgp(i,i+1,vtrans) isign = cvmgp(1,-1,vtrans) vmult = cvmgp(vedge(i,j+1),half*(vedge(i,j+1)+vedge(i+1,j+1)),vtrans) xm(i) = isign*half*hx - dt3rd*uedge(i+1,jup) ym(i) = jsign*half*hy - two3rd*dt*vmult ym(i) = cvmgp(ym(i),jsign*min(jsign*ym(i),hy*half),vtrans) c(i,1) = sc(iup,jup,1) c(i,2) = sc(iup,jup,2) c(i,3) = sc(iup,jup,3) c(i,4) = sc(iup,jup,4) enddo call bilin(gamp,c,xm,ym,hx,hy,is,ie,lo(1),hi(1)) c Impose BCs on gamp. if (bc(1,2).eq.EXT_DIR .and.(uedge(ie+1,j).le.zero) ) then gamp(ie) = s(ie+1,j) else if (bc(1,2).eq.REFLECT_ODD) then gamp(ie) = zero end if do i = is,ie jup = cvmgt(j,j+1,choose_hi(i).eq.0) jsign = cvmgt(1, -1,choose_hi(i).eq.0) vtrans = uedge(i,jup) iup = cvmgp(i-1,i,vtrans) isign = cvmgp(1,-1,vtrans) vmult = cvmgp(half*(vedge(i,j+1)+vedge(i-1,j+1)),vedge(i,j+1),vtrans) xm(i) = isign*half*hx - dt3rd*uedge(i,jup) ym(i) = jsign*half*hy - two3rd*dt*vmult ym(i) = cvmgp(jsign*min(jsign*ym(i),hy*half),ym(i),vtrans) c(i,1) = sc(iup,jup,1) c(i,2) = sc(iup,jup,2) c(i,3) = sc(iup,jup,3) c(i,4) = sc(iup,jup,4) enddo call bilin(gamm,c,xm,ym,hx,hy,is,ie,lo(1),hi(1)) c Impose BCs on gamm. if (bc(1,1).eq.EXT_DIR .and.(uedge(is,j).ge.zero) ) then gamm(is) = s(is,j) else if (bc(1,1).eq.REFLECT_ODD) then gamm(is) = zero end if do i = is,ie jup = cvmgt(j,j+1,choose_hi(i).eq.0) jsign = cvmgt(1, -1,choose_hi(i).eq.0) vdif = dth*(uedge(i+1,jup)*gamp(i)-uedge(i,jup)*gamm(i))/hx stem = s(i,jup) + (jsign*hy - vedge(i,j+1)*dt)*half*sy(i,jup) c vaddif = dth*stem*(vedge(i,jup+1) - vedge(i,jup))/hy vaddif = dth*stem*(divu(i,jup) - (uedge(i+1,jup)-uedge(i,jup))/hx) ystate(i,j+1) = stem - vdif - vaddif + dth*tforces(i,jup) if (iconserv .eq. 0) $ ystate(i,j+1) = ystate(i,j+1) + dth*stem*divu(i,jup) enddo enddo c c Impose BCs on xstate. c do j = js,je if (bc(1,1).eq.EXT_DIR .and. uedge(is,j).ge.zero) then xstate(is,j) = s(is-1,j) else if (bc(1,1).eq.REFLECT_ODD) then xstate(is,j) = zero end if if (bc(1,2).eq.EXT_DIR .and. uedge(ie+1,j).le.zero) then xstate(ie+1,j) = s(ie+1,j) else if (bc(1,2).eq.REFLECT_ODD) then xstate(ie+1,j) = zero end if enddo c c Impose BCs on ystate. c do i = is,ie if (bc(2,1).eq.EXT_DIR .and.(vedge(i,js).ge.zero) ) then ystate(i,js) = s(i,js-1) else if (bc(2,1).eq.REFLECT_ODD) then ystate(i,js) = zero end if if (bc(2,2).eq.EXT_DIR .and. (vedge(i,je+1).le.zero) ) then ystate(i,je+1) = s(i,je+1) else if (bc(2,2).eq.REFLECT_ODD) then ystate(i,je+1) = zero end if enddo #if 0 do j = js,je do i = is,ie+1 if (xstate(i,j).lt. zero) print *,'NEG XSTATE ',i,j,xstate(i,j) if (abs(xstate(i,j)).gt. 1.e20) print *,'BIG XSTATE ',i,j,xstate(i,j) enddo enddo do j = js,je+1 do i = is,ie if (ystate(i,j).lt. zero) print *,'NEG YSTATE ',i,j,ystate(i,j) if (abs(ystate(i,j)).gt. 1.e20) print *,'BIG YSTATE ',i,j,ystate(i,j) enddo enddo #endif end subroutine bilin(poly,c,x,y,hx,hy,istart,iend,lo_1,hi_1) integer lo_1,hi_1 integer istart,iend REAL_T poly(lo_1-1:hi_1+1) REAL_T x(lo_1-1:hi_1+1) REAL_T y(lo_1-1:hi_1+1) REAL_T c(lo_1-1:hi_1+1,4) REAL_T hx, hy REAL_T centx, centy REAL_T l1,l2,l3,l4 integer i centx = hx/2 centy = hy/2 do i = istart,iend l1 = (-centx - x(i))*(-centy - y(i)) l2 = (-centx - x(i))*( centy - y(i)) l3 = ( centx - x(i))*(-centy - y(i)) l4 = ( centx - x(i))*( centy - y(i)) poly(i) = l2*c(i,3) + l3*c(i,2) - l1*c(i,4) - l4*c(i,1) poly(i) = -poly(i)/(hx*hy) enddo end ccseapps-2.5/CCSEApps/iamrlib/SYNCREG_3D.F0000644000175000017500000003167711634153073021063 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: SYNCREG_3D.F,v 1.13 2002/08/29 22:14:52 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "SYNCREG_F.H" #include "ArrayLim.H" #define SDIM 3 c ::: ----------------------------------------------------------- c ::: coarsen fine grid node centered data along edge of node c ::: centered fine grid array. c ::: c ::: INPUTS/OUTPUTS: c ::: crse <= node centered coarse data c ::: DIMS(crse) => index limits for crse c ::: fine => node centered fine data c ::: DIMS(fine)=> index limits for fine c ::: lo,hi => node centered subregion of crse to define c ::: dir => index direction of normal (0 based) c ::: ratios => IntVect refinement ratio c ::: ----------------------------------------------------------- subroutine FORT_SRCRSEREG(fine,DIMS(fine),crse,DIMS(crse),lo,hi,dir, & ratios) integer DIMDEC(fine) integer DIMDEC(crse) integer lo(SDIM) integer hi(SDIM) integer dir integer ratios(0:SDIM-1) REAL_T fine(DIMV(fine)) REAL_T crse(DIMV(crse)) integer i, j, k, ic, jc, kc integer m, n integer ratiox, ratioy, ratioz REAL_T one28, fourthirds, threefourths REAL_T coeff, denom REAL_T temp one28 = eight * sixteen fourthirds = four * third threefourths = three * fourth c NOTE: the reason that the coefficients add up to 1/ratio_norm and NOT to 1 c is because the divergences and DGphi were computed using the c local dx, so in order to add the fine contribution to the c coarse contribution the fine contribution must be weighted c by dx_fine/dx_coarse = 1/ratio ratiox = ratios(0) ratioy = ratios(1) ratioz = ratios(2) c NOTE: we multiply fine by 1/2 on the edges and 1/3 on the corners c since they are counted in all three directions; later we c multiply by 2 and 3, respectively, to restore them to their c previous values. if (dir .eq. 0) then c ::::: sum in j and k directions ic = lo(1) i = ratiox*ic do kc = lo(3), hi(3) do jc = lo(2), hi(2) crse(ic,jc,kc) = zero end do end do j = ratioy*lo(2) do k = fine_l3, fine_h3 fine(i,j,k) = half*fine(i,j,k) enddo j = ratioy*hi(2) do k = fine_l3, fine_h3 fine(i,j,k) = half*fine(i,j,k) enddo k = ratioz*lo(3) do j = fine_l2, fine_h2 fine(i,j,k) = half*fine(i,j,k) enddo k = ratioz*hi(3) do j = fine_l2, fine_h2 fine(i,j,k) = half*fine(i,j,k) enddo j = ratioy*lo(2) k = ratioz*lo(3) fine(i,j,k) = fourthirds*fine(i,j,k) j = ratioy*hi(2) k = ratioz*lo(3) fine(i,j,k) = fourthirds*fine(i,j,k) j = ratioy*lo(2) k = ratioz*hi(3) fine(i,j,k) = fourthirds*fine(i,j,k) j = ratioy*hi(2) k = ratioz*hi(3) fine(i,j,k) = fourthirds*fine(i,j,k) denom = one / (ratiox * ratioy**2 * ratioz**2) do n = 0, (ratioz-1) do m = 0, (ratioy-1) coeff = (ratioy - m) * (ratioz - n) * denom if (n .eq. 0) coeff = half * coeff if (m .eq. 0) coeff = half * coeff do kc = lo(3), hi(3) k = ratioz*kc do jc = lo(2), hi(2) j = ratioy*jc crse(ic,jc,kc) = crse(ic,jc,kc) + coeff * $ ( fine(i,j+m,k+n) + fine(i,j-m,k+n) $ +fine(i,j+m,k-n) + fine(i,j-m,k-n) ) end do end do end do end do j = ratioy*lo(2) do k = fine_l3, fine_h3 fine(i,j,k) = two*fine(i,j,k) enddo j = ratioy*hi(2) do k = fine_l3, fine_h3 fine(i,j,k) = two*fine(i,j,k) enddo k = ratioz*lo(3) do j = fine_l2, fine_h2 fine(i,j,k) = two*fine(i,j,k) enddo k = ratioz*hi(3) do j = fine_l2, fine_h2 fine(i,j,k) = two*fine(i,j,k) enddo j = ratioy*lo(2) k = ratioz*lo(3) fine(i,j,k) = threefourths*fine(i,j,k) j = ratioy*hi(2) k = ratioz*lo(3) fine(i,j,k) = threefourths*fine(i,j,k) j = ratioy*lo(2) k = ratioz*hi(3) fine(i,j,k) = threefourths*fine(i,j,k) j = ratioy*hi(2) k = ratioz*hi(3) fine(i,j,k) = threefourths*fine(i,j,k) else if (dir .eq. 1) then c c ::::: sum in i and k directions c jc = lo(2) j = ratioy*jc do kc = lo(3), hi(3) do ic = lo(1), hi(1) crse(ic,jc,kc) = zero end do end do i = ratiox*lo(1) do k = fine_l3, fine_h3 fine(i,j,k) = half*fine(i,j,k) enddo i = ratiox*hi(1) do k = fine_l3, fine_h3 fine(i,j,k) = half*fine(i,j,k) enddo k = ratioz*lo(3) do i = fine_l1, fine_h1 fine(i,j,k) = half*fine(i,j,k) enddo k = ratioz*hi(3) do i = fine_l1, fine_h1 fine(i,j,k) = half*fine(i,j,k) enddo i = ratiox*lo(1) k = ratioz*lo(3) fine(i,j,k) = four*third*fine(i,j,k) i = ratiox*hi(1) k = ratioz*lo(3) fine(i,j,k) = four*third*fine(i,j,k) i = ratiox*lo(1) k = ratioz*hi(3) fine(i,j,k) = four*third*fine(i,j,k) i = ratiox*hi(1) k = ratioz*hi(3) fine(i,j,k) = four*third*fine(i,j,k) denom = one / (ratioy * ratiox**2 * ratioz**2) do n = 0, (ratioz-1) do m = 0, (ratiox-1) coeff = (ratiox - m) * (ratioz - n) * denom if (n .eq. 0) coeff = half * coeff if (m .eq. 0) coeff = half * coeff do kc = lo(3), hi(3) k = ratioz*kc do ic = lo(1), hi(1) i = ratiox*ic crse(ic,jc,kc) = crse(ic,jc,kc) + coeff * $ ( fine(i+m,j,k+n) + fine(i-m,j,k+n) $ +fine(i+m,j,k-n) + fine(i-m,j,k-n) ) end do end do end do end do i = ratiox*lo(1) do k = fine_l3, fine_h3 fine(i,j,k) = two*fine(i,j,k) enddo i = ratiox*hi(1) do k = fine_l3, fine_h3 fine(i,j,k) = two*fine(i,j,k) enddo k = ratioz*lo(3) do i = fine_l1, fine_h1 fine(i,j,k) = two*fine(i,j,k) enddo k = ratioz*hi(3) do i = fine_l1, fine_h1 fine(i,j,k) = two*fine(i,j,k) enddo i = ratiox*lo(1) k = ratioz*lo(3) fine(i,j,k) = threefourths*fine(i,j,k) i = ratiox*hi(1) k = ratioz*lo(3) fine(i,j,k) = threefourths*fine(i,j,k) i = ratiox*lo(1) k = ratioz*hi(3) fine(i,j,k) = threefourths*fine(i,j,k) i = ratiox*hi(1) k = ratioz*hi(3) fine(i,j,k) = threefourths*fine(i,j,k) else if (dir .eq. 2) then c ::::: sum in i and j directions kc = lo(3) k = ratioz*kc do jc = lo(2), hi(2) do ic = lo(1), hi(1) crse(ic,jc,kc) = zero end do end do i = ratiox*lo(1) do j = fine_l2, fine_h2 fine(i,j,k) = half*fine(i,j,k) enddo i = ratiox*hi(1) do j = fine_l2, fine_h2 fine(i,j,k) = half*fine(i,j,k) enddo j = ratioy*lo(2) do i = fine_l1, fine_h1 fine(i,j,k) = half*fine(i,j,k) enddo j = ratioy*hi(2) do i = fine_l1, fine_h1 fine(i,j,k) = half*fine(i,j,k) enddo i = ratiox*lo(1) j = ratioy*lo(2) fine(i,j,k) = fourthirds*fine(i,j,k) i = ratiox*hi(1) j = ratioy*lo(2) fine(i,j,k) = fourthirds*fine(i,j,k) i = ratiox*lo(1) j = ratioy*hi(2) fine(i,j,k) = fourthirds*fine(i,j,k) i = ratiox*hi(1) j = ratioy*hi(2) fine(i,j,k) = fourthirds*fine(i,j,k) denom = one / (ratioz * ratiox**2 * ratioy**2) do n = 0, (ratioy-1) do m = 0, (ratiox-1) coeff = (ratiox - m) * (ratioy - n) * denom if (n .eq. 0) coeff = half * coeff if (m .eq. 0) coeff = half * coeff do jc = lo(2), hi(2) j = ratioy*jc do ic = lo(1), hi(1) i = ratiox*ic crse(ic,jc,kc) = crse(ic,jc,kc) + coeff * $ ( fine(i+m,j+n,k) + fine(i-m,j+n,k) $ +fine(i+m,j-n,k) + fine(i-m,j-n,k) ) end do end do end do end do i = ratiox*lo(1) do j = fine_l2, fine_h2 fine(i,j,k) = two*fine(i,j,k) enddo i = ratiox*hi(1) do j = fine_l2, fine_h2 fine(i,j,k) = two*fine(i,j,k) enddo j = ratioy*lo(2) do i = fine_l1, fine_h1 fine(i,j,k) = two*fine(i,j,k) enddo j = ratioy*hi(2) do i = fine_l1, fine_h1 fine(i,j,k) = two*fine(i,j,k) enddo i = ratiox*lo(1) j = ratioy*lo(2) fine(i,j,k) = threefourths*fine(i,j,k) i = ratiox*hi(1) j = ratioy*lo(2) fine(i,j,k) = threefourths*fine(i,j,k) i = ratiox*lo(1) j = ratioy*hi(2) fine(i,j,k) = threefourths*fine(i,j,k) i = ratiox*hi(1) j = ratioy*hi(2) fine(i,j,k) = threefourths*fine(i,j,k) end if end c ::: ----------------------------------------------------------- c ::: create mask at nodes using values at surrounding cells c ::: c ::: INPUTS/OUTPUTS: c ::: mask <= node-centered mask array c ::: DIMS(mask) => index limits for mask c ::: cells => cell-centered array (each value is 0. or 1.) c ::: DIMS(cells) => index limits for cells c ::: ----------------------------------------------------------- subroutine FORT_MAKEMASK(mask,DIMS(mask),cells,DIMS(cells)) integer DIMDEC(mask) integer DIMDEC(cells) REAL_T mask(DIMV(mask)) REAL_T cells(DIMV(cells)) integer i, j, k do k = ARG_L3(mask), ARG_H3(mask) do j = ARG_L2(mask), ARG_H2(mask) do i = ARG_L1(mask), ARG_H1(mask) mask(i,j,k) = cells(i,j ,k ) + cells(i-1,j ,k ) $ + cells(i,j-1,k ) + cells(i-1,j-1,k ) $ + cells(i,j ,k-1) + cells(i-1,j ,k-1) $ + cells(i,j-1,k-1) + cells(i-1,j-1,k-1) end do end do end do end c ::: ----------------------------------------------------------- c ::: modify mask from values 0. through 8. to values 0. or 1. c ::: c ::: INPUTS/OUTPUTS: c ::: mask <= node-centered mask array c ::: DIMS(mask) => index limits for mask c ::: ----------------------------------------------------------- subroutine FORT_CONVERTMASK(mask,DIMS(mask)) integer DIMDEC(mask) REAL_T mask(DIMV(mask)) integer i, j, k do k = ARG_L3(mask), ARG_H3(mask) do j = ARG_L2(mask), ARG_H2(mask) do i = ARG_L1(mask), ARG_H1(mask) if (mask(i,j,k) .gt. 7.5D0) then mask(i,j,k) = zero else mask(i,j,k) = one end if end do end do end do end ccseapps-2.5/CCSEApps/iamrlib/.3rd0000644000175000017500000000001311634153073017761 0ustar amckinstryamckinstryignore rus ccseapps-2.5/CCSEApps/iamrlib/MacOutFlowBC.cpp0000644000175000017500000005677111634153073022247 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MacOutFlowBC.cpp,v 1.26 2003/02/21 22:49:10 car Exp $ // #include #include "MacOutFlowBC.H" #include "MACOUTFLOWBC_F.H" #include "ParmParse.H" #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); #define DEF_CLIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ const Real* fabdat = (fab).dataPtr(); #define DEF_BOX_LIMITS(box,boxlo,boxhi) \ const int* boxlo = (box).loVect(); \ const int* boxhi = (box).hiVect(); #if (BL_SPACEDIM == 3) Real MacOutFlowBC::tol = 1.0e-10; Real MacOutFlowBC::abs_tol = 5.0e-10; int MacOutFlowBC_MG::verbose = 0; bool MacOutFlowBC_MG::useCGbottomSolver = true; Real MacOutFlowBC_MG::cg_tol = 1.0e-2; Real MacOutFlowBC_MG::cg_abs_tol = 5.0e-12; Real MacOutFlowBC_MG::cg_max_jump = 10.0; int MacOutFlowBC_MG::cg_maxiter = 40; int MacOutFlowBC_MG::maxIters = 40; #endif MacOutFlowBC::MacOutFlowBC () { ParmParse pp("macoutflow"); #if (BL_SPACEDIM == 3) pp.query("tol",tol); pp.query("abs_tol",abs_tol); #endif } void MacOutFlowBC::computeBC (FArrayBox velMF[][2*BL_SPACEDIM], FArrayBox divuMF[2*BL_SPACEDIM], FArrayBox rhoMF[2*BL_SPACEDIM], FArrayBox phiMF[2*BL_SPACEDIM], const Geometry& geom, Orientation* outFaces, int numOutFlowFaces, Real gravity) { BL_ASSERT(numOutFlowFaces <= 2*BL_SPACEDIM); int i,iface; int faces[2*BL_SPACEDIM]; for (i = 0; i < numOutFlowFaces; i++) faces[i] = int(outFaces[i]); const Real* dx = geom.CellSize(); const Box& domain = geom.Domain(); int zeroIt[2*BL_SPACEDIM]; for (i = 0; i < numOutFlowFaces; i++) zeroIt[i] = 0; #if (BL_SPACEDIM == 2) Real* redge[2*BL_SPACEDIM]; #endif FArrayBox ccExt[2*BL_SPACEDIM]; int isPeriodic[BL_SPACEDIM]; for (int dir = 0; dir < BL_SPACEDIM; dir++) isPeriodic[dir] = geom.isPeriodic(dir); IntVect loFiltered, hiFiltered; int isPeriodicFiltered[2*BL_SPACEDIM][BL_SPACEDIM]; Real dxFiltered[2*BL_SPACEDIM][BL_SPACEDIM]; for (iface = 0; iface < numOutFlowFaces; iface++) { const int outDir = outFaces[iface].coordDir(); // // Filter out direction we don't care about. // int ncStripWidth = 1; Box origBox = BoxLib::adjCell(domain,outFaces[iface],ncStripWidth); IntVect lo = origBox.smallEnd(); IntVect hi = origBox.bigEnd(); // // Rearrange the box, dx, and isPeriodic so that the dimension that is 1 // is the last dimension. // int cnt = 0; for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (dir != outDir) { loFiltered[cnt] = lo[dir]; hiFiltered[cnt] = hi[dir]; dxFiltered[iface][cnt] = dx[dir]; isPeriodicFiltered[iface][cnt] = isPeriodic[dir]; cnt++; } else { loFiltered[BL_SPACEDIM-1] = lo[dir]; hiFiltered[BL_SPACEDIM-1] = hi[dir]; dxFiltered[iface][BL_SPACEDIM-1] = dx[dir]; isPeriodicFiltered[iface][BL_SPACEDIM-1] = isPeriodic[dir]; } } Box faceBox(loFiltered,hiFiltered); // One for rho, one for divu. ccExt[iface].resize(faceBox,2); #if (BL_SPACEDIM == 2) // // Make edge-centered r (set = 1 if cartesian). // int perpDir = 1 - outDir; int r_len = domain.length()[perpDir]+1; redge[iface] = new Real[r_len]; // Here we know the ordering of faces is XLO,YLO,XHI,YHI. if (CoordSys::IsRZ()) { if (faces[iface] == 0) { for (i=0;i redge; int r_len = 0; #endif DEF_BOX_LIMITS(origBox,origLo,origHi); const int* ccElo = ccExt[iface].loVect(); const int* ccEhi = ccExt[iface].hiVect(); const Real* rhoEPtr = ccExt[iface].dataPtr(0); const Real* divuEPtr = ccExt[iface].dataPtr(1); DEF_LIMITS(divuMF[iface],divuPtr,divulo, divuhi); DEF_LIMITS( rhoMF[iface], rhoPtr, rholo, rhohi); DEF_LIMITS(velMF[0][iface],velXPtr,velXlo,velXhi); DEF_LIMITS(velMF[1][iface],velYPtr,velYlo,velYhi); #if (BL_SPACEDIM == 3) DEF_LIMITS(velMF[2][iface],velZPtr,velZlo,velZhi); #endif // // Extrapolate divu, and rho to the outflow edge in // the shifted coordinate system (where the last dimension is 1), // and replace (divu) by (divu - d/dperpdir (vel)). // FORT_EXTRAP_MAC( ARLIM(velXlo), ARLIM(velXhi), velXPtr, ARLIM(velYlo), ARLIM(velYhi), velYPtr, #if (BL_SPACEDIM == 3) ARLIM(velZlo), ARLIM(velZhi), velZPtr, #endif ARLIM(divulo),ARLIM(divuhi),divuPtr, ARLIM(rholo), ARLIM(rhohi), rhoPtr, #if (BL_SPACEDIM == 2) &r_len, redge[iface], #endif ARLIM(ccElo),ARLIM(ccEhi),divuEPtr, ARLIM(ccElo),ARLIM(ccEhi),rhoEPtr, dx, origLo,origHi,&faces[iface],isPeriodicFiltered[iface],&zeroIt[iface]); } int connected = 0; // Test for whether multiple faces are touching. // therefore not touching. if (numOutFlowFaces == 2) { if (outFaces[0].coordDir() != outFaces[1].coordDir()) connected = 1; } else if (numOutFlowFaces > 2) { connected = 1; } if (connected == 0) for (iface = 0; iface < numOutFlowFaces; iface++) { // HACK HACK zeroIt[iface] = 1; if (zeroIt[iface]) { phiMF[iface].setVal(0); } else { #if (BL_SPACEDIM == 2) int face = int(outFaces[iface]); int outDir = outFaces[iface].coordDir(); int length = ccExt[iface].length()[0]; const int* ccElo = ccExt[iface].loVect(); const int* ccEhi = ccExt[iface].hiVect(); const Real* rhoEPtr = ccExt[iface].dataPtr(0); const Real* divuEPtr = ccExt[iface].dataPtr(1); Box faceBox(ccExt[iface].box()); DEF_BOX_LIMITS(faceBox,faceLo,faceHi); DEF_LIMITS(phiMF[iface], phiPtr,philo,phihi); Real* x = new Real[length]; FORT_MACPHIBC(x, &length, divuEPtr, rhoEPtr, redge[iface], dxFiltered[iface], isPeriodicFiltered[iface]); FORT_MACPHI_FROM_X(ARLIM(philo),ARLIM(phihi),phiPtr, &length,x); delete x; #elif (BL_SPACEDIM == 3) Box faceBox(ccExt[iface].box()); FArrayBox phiFiltered(faceBox,1); phiFiltered.setVal(0.); DEF_LIMITS(phiMF[iface],phiFabPtr,phiFab_lo,phiFab_hi); DEF_LIMITS(phiFiltered,phiFilteredPtr,phiFiltered_lo,phiFiltered_hi); FArrayBox rhs; FArrayBox beta[BL_SPACEDIM-1]; computeCoefficients(rhs,beta, ccExt[iface], faceBox,dxFiltered[iface],isPeriodicFiltered[iface]); // // Need phi to have ghost cells. // Box phiGhostBox = OutFlowBC::SemiGrow(phiFiltered.box(),1,BL_SPACEDIM-1); FArrayBox phi(phiGhostBox,1); phi.setVal(0); phi.copy(phiFiltered); FArrayBox resid(rhs.box(),1); MacOutFlowBC_MG mac_mg(faceBox,&phi,&rhs,&resid,beta, dxFiltered[iface],isPeriodicFiltered[iface]); mac_mg.solve(tol,abs_tol,2,2,mac_mg.MaxIters(),mac_mg.Verbose()); DEF_LIMITS(phi,phiPtr,phi_lo,phi_hi); DEF_BOX_LIMITS(faceBox,lo,hi); // // Subtract the average phi. // // FORT_MACSUBTRACTAVGPHI(ARLIM(phi_lo),ARLIM(phi_hi),phiPtr, // &r_len,redge, // lo,hi,isPeriodicFiltered[iface]); // // Translate the solution back to the original coordinate system. // int face = int(outFaces[iface]); FORT_MAC_RESHIFT_PHI(ARLIM(phiFab_lo),ARLIM(phiFab_hi),phiFabPtr, ARLIM(phi_lo),ARLIM(phi_hi),phiPtr,&face); #endif } } if (connected == 1) { // Define connected region. In both 2-d and 3-d, if there are // multiple outflow faces and it's not just two across from // each other, then the multiple faces form a *single* // connected region. int zeroAll = 1; for (i = 0; i < numOutFlowFaces; i++) if (zeroIt[i] == 0) zeroAll = 0; // HACK HACK zeroAll = 1; if (zeroAll) { for ( i = 0; i < numOutFlowFaces; i++ ) { phiMF[i].setVal(0); } } else { // Since we only use a constant dx in the Fortran, // we'll assume for now we can choose either one. BL_ASSERT(dx[0] == dx[1]); int lenx = domain.length()[0]; int leny = domain.length()[1]; int length = 0; #if (BL_SPACEDIM == 2) // Here we know the ordering of faces is XLO,YLO,XHI,YHI. Real *ccEptr0,*ccEptr1,*ccEptr2,*ccEptr3; for (i=0; i < numOutFlowFaces; i++) { if (faces[i] == 0) { ccEptr0 = ccExt[i].dataPtr(); length = length + leny; } else if (faces[i] == 1) { ccEptr1 = ccExt[i].dataPtr(); length = length + lenx; } else if (faces[i] == 2) { ccEptr2 = ccExt[i].dataPtr(); length = length + leny; } else if (faces[i] == 3) { ccEptr3 = ccExt[i].dataPtr(); length = length + lenx; } } Real *r0,*r1,*r2,*r3; for (i=0; i < numOutFlowFaces; i++) { if (faces[i] == 0) { r0 = redge[i]; } else if (faces[i] == 1) { r1 = redge[i]; } else if (faces[i] == 2) { r2 = redge[i]; } else if (faces[i] == 3) { r3 = redge[i]; } } #elif (BL_SPACEDIM == 3) // Here we know the ordering of faces is XLO,YLO,ZLO,XHI,YHI,ZHI. int lenz = domain.length()[2]; Real *ccEptr0,*ccEptr1,*ccEptr2,*ccEptr3,*ccEptr4,*ccEptr5; for (i=0; i < numOutFlowFaces; i++) { if (faces[i] == 0) { ccEptr0 = ccExt[i].dataPtr(); length = length + leny*lenz; } else if (faces[i] == 1) { ccEptr1 = ccExt[i].dataPtr(); length = length + lenx*lenz; } else if (faces[i] == 2) { ccEptr2 = ccExt[i].dataPtr(); length = length + lenx*leny; } else if (faces[i] == 3) { ccEptr3 = ccExt[i].dataPtr(); length = length + leny*lenz; } else if (faces[i] == 4) { ccEptr4 = ccExt[i].dataPtr(); length = length + lenx*lenz; } else if (faces[i] == 5) { ccEptr5 = ccExt[i].dataPtr(); length = length + lenx*leny; } } #endif IntVect loconn; IntVect hiconn; loconn[0] = 0; hiconn[0] = length-1; #if (BL_SPACEDIM == 3) loconn[1] = 0; hiconn[1] = lenz-1; #endif loconn[BL_SPACEDIM-1] = 0; hiconn[BL_SPACEDIM-1] = 0; Box connected_region(loconn,hiconn); FArrayBox ccE_conn(connected_region,BL_SPACEDIM+1); FArrayBox x(connected_region,1); ccE_conn.setVal(1.e200); int per = (numOutFlowFaces == 2*BL_SPACEDIM) ? 1 : 0; #if (BL_SPACEDIM == 2) Real * redge_conn = new Real[length+1]; FORT_MACFILL_ONED(&lenx,&leny,&length,faces,&numOutFlowFaces, ccEptr0,ccEptr1,ccEptr2,ccEptr3, r0,r1,r2,r3, ccE_conn.dataPtr(),redge_conn); FORT_MACPHIBC(x.dataPtr(), &length, ccE_conn.dataPtr(1), ccE_conn.dataPtr(0), redge_conn, dx, &per); Real *phiptr0, *phiptr1, *phiptr2, *phiptr3; for (int i=0; i < numOutFlowFaces; i++) { if (faces[i] == 0) { phiptr0 = phiMF[i].dataPtr(); } if (faces[i] == 1) { phiptr1 = phiMF[i].dataPtr(); } if (faces[i] == 2) { phiptr2 = phiMF[i].dataPtr(); } if (faces[i] == 3) { phiptr3 = phiMF[i].dataPtr(); } } FORT_MACALLPHI_FROM_X(&lenx,&leny,&length,faces,&numOutFlowFaces, phiptr0, phiptr1, phiptr2, phiptr3, x.dataPtr()); #elif (BL_SPACEDIM == 3) int width = lenz; FORT_MACFILL_TWOD(&lenx,&leny,&length,&width,faces,&numOutFlowFaces, ccEptr0,ccEptr1,ccEptr2,ccEptr3,ccEptr4,ccEptr5, ccE_conn.dataPtr()); Box faceBox(ccExt[iface].box()); FArrayBox phiFiltered(faceBox,1); phiFiltered.setVal(0.); DEF_LIMITS(phiMF[iface],phiFabPtr,phiFab_lo,phiFab_hi); DEF_LIMITS(phiFiltered,phiFilteredPtr,phiFiltered_lo,phiFiltered_hi); FArrayBox rhs; FArrayBox beta[BL_SPACEDIM-1]; computeCoefficients(rhs,beta, ccExt[iface], faceBox,dxFiltered[iface],isPeriodicFiltered[iface]); // // Need phi to have ghost cells. // Box phiGhostBox = OutFlowBC::SemiGrow(phiFiltered.box(),1,BL_SPACEDIM-1); FArrayBox phi(phiGhostBox,1); phi.setVal(0); phi.copy(phiFiltered); FArrayBox resid(rhs.box(),1); MacOutFlowBC_MG mac_mg(faceBox,&phi,&rhs,&resid,beta, dxFiltered[iface],isPeriodicFiltered[iface]); mac_mg.solve(tol,abs_tol,2,2,mac_mg.MaxIters(),mac_mg.Verbose()); DEF_LIMITS(phi,phiPtr,phi_lo,phi_hi); DEF_BOX_LIMITS(faceBox,lo,hi); // // Subtract the average phi. // // FORT_MACSUBTRACTAVGPHI(ARLIM(phi_lo),ARLIM(phi_hi),phiPtr, // &r_len,redge, // lo,hi,isPeriodicFiltered[iface]); // // Translate the solution back to the original coordinate system. // int face = int(outFaces[iface]); FORT_MAC_RESHIFT_PHI(ARLIM(phiFab_lo),ARLIM(phiFab_hi),phiFabPtr, ARLIM(phi_lo),ARLIM(phi_hi),phiPtr,&face); #endif } // end if connected = 1 } } #if (BL_SPACEDIM == 3) void MacOutFlowBC::computeCoefficients (FArrayBox& rhs, FArrayBox* beta, FArrayBox& ccExt, Box& faceBox, Real* dxFiltered, int* isPeriodicFiltered) { rhs.resize(faceBox,1); beta[0].resize(BoxLib::surroundingNodes(faceBox,0),1); beta[1].resize(BoxLib::surroundingNodes(faceBox,1),1); DEF_BOX_LIMITS(faceBox,faceLo,faceHi); const int* ccElo = ccExt.loVect(); const int* ccEhi = ccExt.hiVect(); const Real* rhoEPtr = ccExt.dataPtr(0); const Real* divuEPtr = ccExt.dataPtr(1); DEF_LIMITS(rhs, rhsPtr, rhslo,rhshi); DEF_LIMITS(beta[0],beta0Ptr, beta0lo, beta0hi); DEF_LIMITS(beta[1],beta1Ptr, beta1lo, beta1hi); FORT_COMPUTE_MACCOEFF(ARLIM(rhslo),ARLIM(rhshi),rhsPtr, ARLIM(beta0lo),ARLIM(beta0hi),beta0Ptr, ARLIM(beta1lo),ARLIM(beta1hi),beta1Ptr, ARLIM(ccElo),ARLIM(ccEhi),divuEPtr, ARLIM(ccElo),ARLIM(ccEhi),rhoEPtr, faceLo,faceHi, dxFiltered,isPeriodicFiltered); } MacOutFlowBC_MG::MacOutFlowBC_MG (Box& Domain, FArrayBox* Phi, FArrayBox* Rhs, FArrayBox* Resid, FArrayBox* Beta, Real* H, int* IsPeriodic) : OutFlowBC_MG(Domain,Phi,Rhs,Resid,Beta,H,IsPeriodic,false) { static int first = true; if (first) { first = false; ParmParse pp("mac_mg"); pp.query("v",verbose); pp.query("useCGbottomSolver",useCGbottomSolver); pp.query("cg_tol",cg_tol); pp.query("cg_abs_tol",cg_abs_tol); pp.query("cg_max_jump",cg_max_jump); pp.query("cg_maxiter",cg_maxiter); pp.query("maxIters",maxIters); } const IntVect& len = domain.length(); int min_length = 4; bool test_side[BL_SPACEDIM-1]; for (int dir = 0; dir < BL_SPACEDIM-1; dir++) test_side[dir] = (len[dir]&1) != 0 || len[dir] < min_length; if (D_TERM(1 && ,test_side[0], || test_side[1])) { if (useCGbottomSolver) cgwork = new FArrayBox(domain,4); } else { Real newh[BL_SPACEDIM]; for (int dir = 0; dir < BL_SPACEDIM; dir++) newh[dir] = 2*h[dir]; Box newdomain = OutFlowBC::SemiCoarsen(domain,2,BL_SPACEDIM-1); Box grownBox = OutFlowBC::SemiGrow(newdomain,1,BL_SPACEDIM-1); FArrayBox* newphi = new FArrayBox(grownBox,1); FArrayBox* newresid = new FArrayBox(newdomain,1); FArrayBox* newrhs = new FArrayBox(newdomain,1); FArrayBox* newbeta = new FArrayBox[BL_SPACEDIM-1]; newbeta[0].resize(BoxLib::surroundingNodes(newdomain,0),1); newbeta[1].resize(BoxLib::surroundingNodes(newdomain,1),1); newphi->setVal(0); newresid->setVal(0); newbeta[0].setVal(0); newbeta[1].setVal(0); DEF_BOX_LIMITS(domain,dom_lo,dom_hi); DEF_BOX_LIMITS(newdomain,new_lo,new_hi); DEF_LIMITS(beta[0],beta0Ptr,beta0_lo,beta0_hi); DEF_LIMITS(beta[1],beta1Ptr,beta1_lo,beta1_hi); DEF_LIMITS(newbeta[0],newbeta0Ptr,newbeta0_lo,newbeta0_hi); DEF_LIMITS(newbeta[1],newbeta1Ptr,newbeta1_lo,newbeta1_hi); FORT_COARSIGMA(beta0Ptr,ARLIM(beta0_lo),ARLIM(beta0_hi), #if (BL_SPACEDIM == 3) beta1Ptr,ARLIM(beta1_lo),ARLIM(beta1_hi), #endif newbeta0Ptr,ARLIM(newbeta0_lo),ARLIM(newbeta0_hi), #if (BL_SPACEDIM == 3) newbeta1Ptr,ARLIM(newbeta1_lo),ARLIM(newbeta1_hi), #endif dom_lo,dom_hi,new_lo,new_hi); next = new MacOutFlowBC_MG(newdomain,newphi,newrhs, newresid,newbeta,newh,isPeriodic); } } int MacOutFlowBC_MG::Verbose () { return verbose; } int MacOutFlowBC_MG::MaxIters () { return maxIters; } MacOutFlowBC_MG::~MacOutFlowBC_MG () {} Real MacOutFlowBC_MG::residual () { Real rnorm; DEF_BOX_LIMITS(domain,lo,hi); DEF_LIMITS(*rhs,rhsPtr,rhslo,rhshi); DEF_LIMITS(*resid,residPtr,residlo,residhi); DEF_LIMITS(*phi,phiPtr,philo,phihi); DEF_LIMITS(beta[0],beta0Ptr,beta0lo,beta0hi); DEF_LIMITS(beta[1],beta1Ptr,beta1lo,beta1hi); FORT_MACRESID(ARLIM(rhslo),ARLIM(rhshi),rhsPtr, ARLIM(beta0lo),ARLIM(beta0hi),beta0Ptr, ARLIM(beta1lo),ARLIM(beta1hi),beta1Ptr, ARLIM(philo), ARLIM(phihi),phiPtr, ARLIM(residlo),ARLIM(residhi), residPtr, lo,hi,h,isPeriodic,&rnorm); return rnorm; } void MacOutFlowBC_MG::step (int nGSRB) { if (cgwork != 0) { Real resnorm = 0.0; FArrayBox dest0(phi->box(),1); DEF_BOX_LIMITS(domain,lo,hi); DEF_LIMITS(*phi,phiPtr,phi_lo,phi_hi); DEF_LIMITS(*resid,residPtr,resid_lo,resid_hi); DEF_LIMITS(dest0,dest0Ptr,dest0_lo,dest0_hi); DEF_LIMITS(*rhs,rhsPtr,rhs_lo,rhs_hi); DEF_LIMITS(beta[0], beta0Ptr, beta0_lo,beta0_hi); DEF_LIMITS(beta[1], beta1Ptr, beta1_lo,beta1_hi); DEF_LIMITS(*cgwork,dummPtr,cg_lo,cg_hi); FORT_SOLVEMAC(phiPtr, ARLIM(phi_lo),ARLIM(phi_hi), dest0Ptr,ARLIM(dest0_lo),ARLIM(dest0_hi), rhsPtr, ARLIM(rhs_lo),ARLIM(rhs_hi), beta0Ptr, ARLIM(beta0_lo),ARLIM(beta0_hi), beta1Ptr,ARLIM(beta1_lo),ARLIM(beta1_hi), cgwork->dataPtr(0), ARLIM(cg_lo),ARLIM(cg_hi), cgwork->dataPtr(1), ARLIM(cg_lo),ARLIM(cg_hi), cgwork->dataPtr(2), ARLIM(cg_lo),ARLIM(cg_hi), cgwork->dataPtr(3), ARLIM(cg_lo),ARLIM(cg_hi), residPtr, ARLIM(resid_lo), ARLIM(resid_hi), lo,hi,h,isPeriodic,&cg_maxiter,&cg_tol, &cg_abs_tol,&cg_max_jump,&resnorm); } else { gsrb(nGSRB); } } void MacOutFlowBC_MG::Restrict () { DEF_BOX_LIMITS(domain,lo,hi); DEF_BOX_LIMITS(next->theDomain(),loc,hic); DEF_LIMITS(*resid,residPtr,resid_lo,resid_hi); DEF_LIMITS(*(next->theRhs()),rescPtr,resc_lo,resc_hi); FORT_RESTRICT(residPtr, ARLIM(resid_lo),ARLIM(resid_hi), rescPtr, ARLIM(resc_lo),ARLIM(resc_hi), lo,hi,loc,hic); } void MacOutFlowBC_MG::interpolate () { DEF_BOX_LIMITS(domain,lo,hi); DEF_BOX_LIMITS(next->theDomain(),loc,hic); DEF_LIMITS(*phi,phiPtr,phi_lo,phi_hi); DEF_LIMITS(*(next->thePhi()),deltacPtr,deltac_lo,deltac_hi); FORT_INTERPOLATE(phiPtr, ARLIM(phi_lo),ARLIM(phi_hi), deltacPtr,ARLIM(deltac_lo),ARLIM(deltac_hi), lo,hi,loc,hic); } void MacOutFlowBC_MG::gsrb (int nstep) { DEF_BOX_LIMITS(domain,lo,hi); DEF_LIMITS(*rhs, rhsPtr, rhslo,rhshi); DEF_LIMITS(beta[0], beta0Ptr, beta0lo, beta0hi); DEF_LIMITS(beta[1], beta1Ptr, beta1lo, beta1hi); DEF_LIMITS(*phi,phiPtr,philo,phihi); FORT_MACRELAX(ARLIM(rhslo),ARLIM(rhshi),rhsPtr, ARLIM(beta0lo),ARLIM(beta0hi),beta0Ptr, ARLIM(beta1lo),ARLIM(beta1hi),beta1Ptr, ARLIM(philo),ARLIM(phihi),phiPtr, lo,hi,h,isPeriodic,&nstep); } #endif ccseapps-2.5/CCSEApps/iamrlib/VISCOPERATOR_3D.F0000644000175000017500000001461111634153073021656 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: VISCOPERATOR_3D.F,v 1.5 1998/03/31 17:26:41 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "VISCOPERATOR_F.H" #include "ArrayLim.H" #define SDIM 3 c :: ---------------------------------------------------------- c :: VISCEXTRAP c :: extrapolate viscous terms to ghost zones c :: c :: INPUTS / OUTPUTS: c :: visc <=> array containing visc terms c :: DIMS(visc) => index limits for visc c :: lo,hi => index limits for grid interior c :: ncomp => number of components c :: ---------------------------------------------------------- c :: subroutine FORT_VISCEXTRAP (visc,DIMS(visc),lo,hi,ncomp) integer DIMDEC(visc) integer lo(SDIM), hi(SDIM) integer ncomp REAL_T visc(DIMV(visc),ncomp) integer i, j, k, n do n = 1, ncomp c ::::: left side i = lo(1)-1 do k = lo(3), hi(3) do j = lo(2), hi(2) c visc(i,j,k,n) = two*visc(i+1,j,k,n) - visc(i+2,j,k,n) visc(i,j,k,n) = visc(i+1,j,k,n) end do end do c ::::: right side i = hi(1)+1 do k = lo(3), hi(3) do j = lo(2), hi(2) c visc(i,j,k,n) = two*visc(i-1,j,k,n) - visc(i-2,j,k,n) visc(i,j,k,n) = visc(i-1,j,k,n) end do end do c ::::: bottom side j = lo(2)-1 do k = lo(3), hi(3) do i = lo(1), hi(1) c visc(i,j,k,n) = two*visc(i,j+1,k,n) - visc(i,j+2,k,n) visc(i,j,k,n) = visc(i,j+1,k,n) end do end do c ::::: top side j = hi(2)+1 do k = lo(3), hi(3) do i = lo(1), hi(1) c visc(i,j,k,n) = two*visc(i,j-1,k,n) - visc(i,j-2,k,n) visc(i,j,k,n) = visc(i,j-1,k,n) end do end do c ::::: down side k = lo(3)-1 do j = lo(2), hi(2) do i = lo(1), hi(1) c visc(i,j,k,n) = two*visc(i,j,k+1,n) - visc(i,j,k+2,n) visc(i,j,k,n) = visc(i,j,k+1,n) end do end do c ::::: up side k = hi(3)+1 do j = lo(2), hi(2) do i = lo(1), hi(1) c visc(i,j,k,n) = two*visc(i,j,k-1,n) - visc(i,j,k-2,n) visc(i,j,k,n) = visc(i,j,k-1,n) end do end do c ::::: k-edges i = lo(1)-1 j = lo(2)-1 do k = lo(3), hi(3) visc(i,j,k,n) = visc(i+1,j+1,k,n) end do i = lo(1)-1 j = hi(2)+1 do k = lo(3), hi(3) visc(i,j,k,n) = visc(i+1,j-1,k,n) end do i = hi(1)+1 j = lo(2)-1 do k = lo(3), hi(3) visc(i,j,k,n) = visc(i-1,j+1,k,n) end do i = hi(1)+1 j = hi(2)+1 do k = lo(3), hi(3) visc(i,j,k,n) = visc(i-1,j-1,k,n) end do c ::::: j-edges i = lo(1)-1 k = lo(3)-1 do j = lo(2), hi(2) visc(i,j,k,n) = visc(i+1,j,k+1,n) end do i = lo(1)-1 k = hi(3)+1 do j = lo(2), hi(2) visc(i,j,k,n) = visc(i+1,j,k-1,n) end do i = hi(1)+1 k = lo(3)-1 do j = lo(2), hi(2) visc(i,j,k,n) = visc(i-1,j,k+1,n) end do i = hi(1)+1 k = hi(3)+1 do j = lo(2), hi(2) visc(i,j,k,n) = visc(i-1,j,k-1,n) end do c ::::: i-edges j = lo(2)-1 k = lo(3)-1 do i = lo(1), hi(1) visc(i,j,k,n) = visc(i,j+1,k+1,n) end do j = lo(2)-1 k = hi(3)+1 do i = lo(1), hi(1) visc(i,j,k,n) = visc(i,j+1,k-1,n) end do j = hi(2)+1 k = lo(3)-1 do i = lo(1), hi(1) visc(i,j,k,n) = visc(i,j-1,k+1,n) end do j = hi(2)+1 k = hi(3)+1 do i = lo(1), hi(1) visc(i,j,k,n) = visc(i,j-1,k-1,n) end do c ::::: corners i = lo(1)-1 j = lo(2)-1 k = lo(3)-1 visc(i,j,k,n) = visc(i+1,j+1,k+1,n) i = lo(1)-1 j = hi(2)+1 k = lo(3)-1 visc(i,j,k,n) = visc(i+1,j-1,k+1,n) i = hi(1)+1 j = hi(2)+1 k = lo(3)-1 visc(i,j,k,n) = visc(i-1,j-1,k+1,n) i = hi(1)+1 j = lo(2)-1 k = lo(3)-1 visc(i,j,k,n) = visc(i-1,j+1,k+1,n) i = lo(1)-1 j = lo(2)-1 k = hi(3)+1 visc(i,j,k,n) = visc(i+1,j+1,k-1,n) i = lo(1)-1 j = hi(2)+1 k = hi(3)+1 visc(i,j,k,n) = visc(i+1,j-1,k-1,n) i = hi(1)+1 j = lo(2)-1 k = hi(3)+1 visc(i,j,k,n) = visc(i-1,j+1,k-1,n) i = hi(1)+1 j = hi(2)+1 k = hi(3)+1 visc(i,j,k,n) = visc(i-1,j-1,k-1,n) end do end ccseapps-2.5/CCSEApps/iamrlib/SLABSTAT_NS_2D.F0000644000175000017500000003152311634153073021553 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: SLABSTAT_NS_2D.F,v 1.6 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "SPACE.H" #include "CONSTANTS.H" #include "ArrayLim.H" #include "SLABSTAT_NS_F.H" #define SDIM 2 c c ::: ----------------------------------------------------------- c ::: This is a general routine to calculate the basic running statistics c ::: based on the velocity, density, tracer and pressure. The tracer c ::: passed in to this routine is not a conserved quantity. The data c ::: saved by this routine are sufficient to calculate a core set of c ::: statistics on these fields using both Reynolds and Favre averages. c ::: The state should be passed in to this routine in the order, c ::: Rho, U, V, Tr, P c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: runStats <= Array to contain the running statistics c ::: DIMS(runStats) => Dimensions of the running statistics array c ::: nStats => Number of components in the statistics array c ::: state =) Array containing the state data c ::: DIMS(state) => Dimensions of the state data array c ::: nStateComp => Number of components in the state array c ::: dt => Time step c ::: delta => Grid spacing c ::: ----------------------------------------------------------- c subroutine FORT_NS_BASICSTATS_NCTRAC(state, DIMS(state), nStateComp, $ runStats, DIMS(runStats), nStats, $ dt, delta) implicit none c c ::::: passed variables c integer nStats, nStateComp integer DIMDEC(state) integer DIMDEC(runStats) REAL_T dt REAL_T delta(SDIM) REAL_T runStats(DIMV(runStats),nStats) REAL_T state(DIMV(state),nStateComp) c c ::::: local variables c integer i, j, n, Rho, xVel, yVel, Trac, Pres, $ nStateExpect, nStatsExpect, nGhostExpect, num integer loStats(SDIM), hiStats(SDIM) integer loState(SDIM), hiState(SDIM) PARAMETER (nStateExpect = 5, nStatsExpect = 24, nGhostExpect = 0) c c =================================== c ::: Set the Values of LO and HI ::: c =================================== c call SET_LOHI(DIMS(runStats), loStats, hiStats) call SET_LOHI(DIMS(state), loState, hiState) #ifndef NDEBUG if (nStats .NE. nStatsExpect .or. nStateComp .ne. nStateExpect) then write(*,1000) nStatsExpect, nStateExpect, nStats, nStateComp 1000 format('Incorrect number of statistic and/or state components', $ /'FORT_NS_BASICSTATS_NCTRAC. Should have nStats = ',I5,'and', $ /'nStateComp = ',I5, $ /' nStats = ', I5, 5x, 'nStateComp = ', I5) call bl_abort(" ") endif do n = 1, SDIM if (loState(n) .GT. loStats(n) - nGhostExpect .OR. $ hiState(n) .LT. hiStats(n) + nGhostExpect) then write(*,1010) n, nGhostExpect, loStats, hiStats, loState, hiState 1010 format('Incorrect number of ghost cells in the state date in', $ /'FORT_NS_BASICSTATS_NCTRAC.', $ /' Direction = ', I2, 5x, 'nGhostExpect = ', I2, $ /' loStats = ', SDIM (I2,1x), 5x, 'hiStats = ', SDIM (I2,1x), $ /' loState = ', SDIM (I2,1x), 5x, 'hiState = ', SDIM (I2,1x)) call bl_abort(" ") endif enddo #endif c c ========================= c ::: Set State Indices ::: c ========================= c Rho = 1 xVel = 2 yVel = 3 Trac = 4 Pres = 5 c c ==================================== c ::: Calculate Running Statistics ::: c ==================================== c do j = loStats(2), hiStats(2) do i = loStats(1), hiStats(1) num = 1 do n = 1, 2 runStats(i,j,num) = runStats(i,j,num) + dt * state(i,j,Rho)**n runStats(i,j,num+1) = runStats(i,j,num+1) + dt * state(i,j,xVel)**n runStats(i,j,num+2) = runStats(i,j,num+2) + dt * state(i,j,Rho) $ * state(i,j,xVel)**n runStats(i,j,num+3) = runStats(i,j,num+3) + dt * state(i,j,yVel)**n runStats(i,j,num+4) = runStats(i,j,num+4) + dt * state(i,j,Rho) $ * state(i,j,yVel)**n runStats(i,j,num+5) = runStats(i,j,num+5) + dt * state(i,j,Trac)**n runStats(i,j,num+6) = runStats(i,j,num+6) + dt * state(i,j,Rho) $ * state(i,j,Trac)**n runStats(i,j,num+7) = runStats(i,j,num+7) + dt * state(i,j,Pres)**n num = num + 8 enddo runStats(i,j,num) = runStats(i,j,num) + dt $ * state(i,j,xVel) * state(i,j,yVel) num = num + 1 runStats(i,j,num) = runStats(i,j,num) + dt * state(i,j,Rho) $ * state(i,j,xVel) * state(i,j,yVel) num = num + 1 runStats(i,j,num) = runStats(i,j,num) + dt $ * state(i,j,xVel) * state(i,j,Trac) runStats(i,j,num+1) = runStats(i,j,num+1) + dt $ * state(i,j,yVel) * state(i,j,Trac) num = num + 2 runStats(i,j,num) = runStats(i,j,num) + dt * state(i,j,Rho) $ * state(i,j,xVel) * state(i,j,Trac) runStats(i,j,num+1) = runStats(i,j,num+1) + dt * state(i,j,Rho) $ * state(i,j,yVel) * state(i,j,Trac) num = num + 2 runStats(i,j,num) = runStats(i,j,num) + dt $ * state(i,j,xVel) * state(i,j,Pres) runStats(i,j,num+1) = runStats(i,j,num+1) + dt $ * state(i,j,yVel) * state(i,j,Pres) num = num + 2 enddo enddo c c return end c c ::: ----------------------------------------------------------- c ::: This is a general routine to calculate the basic running statistics c ::: based on the velocity, density, tracer and pressure. The tracer c ::: passed in to this routine is a conserved quantity. The data c ::: saved by this routine are sufficient to calculate a core set of c ::: statistics on these fields using both Reynolds and Favre averages. c ::: The state should be passed in to this routine in the order, c ::: Rho, U, V, Tr, P c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: runStats <= Array to contain the running statistics c ::: DIMS(runStats) => Dimensions of the running statistics array c ::: nStats => Number of components in the statistics array c ::: state =) Array containing the state data c ::: DIMS(state) => Dimensions of the state data array c ::: nStateComp => Number of components in the state array c ::: dt => Time step c ::: delta => Grid spacing c ::: ----------------------------------------------------------- c subroutine FORT_NS_BASICSTATS_CTRAC(state, DIMS(state), nStateComp, $ runStats, DIMS(runStats), nStats, $ dt, delta) implicit none c c ::::: passed variables c integer nStats, nStateComp integer DIMDEC(state) integer DIMDEC(runStats) REAL_T dt REAL_T delta(SDIM) REAL_T runStats(DIMV(runStats),nStats) REAL_T state(DIMV(state),nStateComp) c c ::::: local variables c integer i, j, n, Rho, xVel, yVel, RhoTrac, Pres, $ nStateExpect, nStatsExpect, nGhostExpect, num integer loStats(SDIM), hiStats(SDIM) integer loState(SDIM), hiState(SDIM) REAL_T tracer PARAMETER (nStateExpect = 5, nStatsExpect = 24, nGhostExpect = 0) c c =================================== c ::: Set the Values of LO and HI ::: c =================================== c call SET_LOHI(DIMS(runStats), loStats, hiStats) call SET_LOHI(DIMS(state), loState, hiState) #ifndef NDEBUG if (nStats .NE. nStatsExpect .or. nStateComp .ne. nStateExpect) then write(*,1000) nStatsExpect, nStateExpect, nStats, nStateComp 1000 format('Incorrect number of statistic and/or state components', $ /'FORT_NS_BASICSTATS_CTRAC. Should have nStats = ',I5,'and', $ /'nStateComp = ',I5, $ /' nStats = ', I5, 5x, 'nStateComp = ', I5) call bl_abort(" ") endif do n = 1, SDIM if (loState(n) .GT. loStats(n) - nGhostExpect .OR. $ hiState(n) .LT. hiStats(n) + nGhostExpect) then write(*,1010) n, nGhostExpect, loStats, hiStats, loState, hiState 1010 format('Incorrect number of ghost cells in the state date in', $ /'FORT_NS_BASICSTATS_CTRAC.', $ /' Direction = ', I2, 5x, 'nGhostExpect = ', I2, $ /' loStats = ', SDIM (I2,1x), 5x, 'hiStats = ', SDIM (I2,1x), $ /' loState = ', SDIM (I2,1x), 5x, 'hiState = ', SDIM (I2,1x)) call bl_abort(" ") endif enddo #endif c c ========================= c ::: Set State Indices ::: c ========================= c Rho = 1 xVel = 2 yVel = 3 RhoTrac = 4 Pres = 5 c c ==================================== c ::: Calculate Running Statistics ::: c ==================================== c do j = loStats(2), hiStats(2) do i = loStats(1), hiStats(1) num = 1 tracer = state(i,j,RhoTrac) / state(i,j,Rho) do n = 1, 2 runStats(i,j,num) = runStats(i,j,num) + dt * state(i,j,Rho)**n runStats(i,j,num+1) = runStats(i,j,num+1) + dt * state(i,j,xVel)**n runStats(i,j,num+2) = runStats(i,j,num+2) + dt * state(i,j,Rho) $ * state(i,j,xVel)**n runStats(i,j,num+3) = runStats(i,j,num+3) + dt * state(i,j,yVel)**n runStats(i,j,num+4) = runStats(i,j,num+4) + dt * state(i,j,Rho) $ * state(i,j,yVel)**n runStats(i,j,num+5) = runStats(i,j,num+5) + dt * tracer**n runStats(i,j,num+6) = runStats(i,j,num+6) + dt * state(i,j,Rho) $ * tracer**n runStats(i,j,num+7) = runStats(i,j,num+7) + dt * state(i,j,Pres)**n num = num + 8 enddo runStats(i,j,num) = runStats(i,j,num) + dt $ * state(i,j,xVel) * state(i,j,yVel) num = num + 1 runStats(i,j,num) = runStats(i,j,num) + dt * state(i,j,Rho) $ * state(i,j,xVel) * state(i,j,yVel) num = num + 1 runStats(i,j,num) = runStats(i,j,num) + dt $ * state(i,j,xVel) * tracer runStats(i,j,num+1) = runStats(i,j,num+1) + dt $ * state(i,j,yVel) * tracer num = num + 2 runStats(i,j,num) = runStats(i,j,num) + dt $ * state(i,j,xVel) * state(i,j,RhoTrac) runStats(i,j,num+1) = runStats(i,j,num+1) + dt $ * state(i,j,yVel) * state(i,j,RhoTrac) num = num + 2 runStats(i,j,num) = runStats(i,j,num) + dt $ * state(i,j,xVel) * state(i,j,Pres) runStats(i,j,num+1) = runStats(i,j,num+1) + dt $ * state(i,j,yVel) * state(i,j,Pres) num = num + 2 enddo enddo c c return end ccseapps-2.5/CCSEApps/iamrlib/DIFFUSION_2D.F0000644000175000017500000004441511634153073021270 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: DIFFUSION_2D.F,v 1.8 2002/08/29 22:14:52 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "DIFFUSION_F.H" #include "ArrayLim.H" #define SDIM 2 c :: c :: ---------------------------------------------------------- c :: compute the time averaged viscous flux at the given edge c :: for variable transport coefficients c :: c :: NOTE: c :: These are only computed for a reflux operation, and require c :: that the ghost cells have been filled according to the c :: diffusion operator (maybe this isn't such a good idea...) c :: ---------------------------------------------------------- c :: subroutine FORT_VISCFLUX_VC (s_o,s_n,DIMS(s),lo,hi, $ flux, DIMS(flux), area, DIMS(area), $ bn, bnp1, DIMS(b), $ dx,mult,theta,dir) integer lo(SDIM), hi(SDIM) integer DIMDEC(s) integer DIMDEC(flux) integer DIMDEC(area) integer DIMDEC(b) REAL_T s_o(DIMV(s)) REAL_T s_n(DIMV(s)) REAL_T flux(DIMV(flux)) REAL_T area(DIMV(area)) REAL_T bn(DIMV(b)) REAL_T bnp1(DIMV(b)) REAL_T dx REAL_T mult,theta integer dir integer i, j REAL_T sx1, sx2, sy1, sy2 REAL_T onemintheta onemintheta = one-theta if (dir .EQ. 0) then c ::::: compute X fluxes do j = lo(2), hi(2) do i = lo(1), hi(1)+1 sx1 = (s_o(i,j) - s_o(i-1,j))*bn(i,j) sx2 = (s_n(i,j) - s_n(i-1,j))*bnp1(i,j) flux(i,j) = mult*(onemintheta*sx1 + theta*sx2)*area(i,j)/dx end do end do else c ::::: compute Y fluxes do j = lo(2), hi(2)+1 do i = lo(1), hi(1) sy1 = (s_o(i,j) - s_o(i,j-1))*bn(i,j) sy2 = (s_n(i,j) - s_n(i,j-1))*bnp1(i,j) flux(i,j) = mult*(onemintheta*sy1 + theta*sy2)*area(i,j)/dx end do end do end if end c :: c :: ---------------------------------------------------------- c :: compute the time averaged viscous flux at the given edge c :: for constant transport coefficients c :: c :: NOTE: c :: These are only computed for a reflux operation, and require c :: that the ghost cells have been filled according to the c :: diffusion operator (maybe this isn't such a good idea...) c :: ---------------------------------------------------------- c :: subroutine FORT_VISCFLUX_CC (s_o,s_n,DIMS(s),lo,hi, $ flux, DIMS(flux), area, DIMS(area), $ dx,mult,theta,dir) integer lo(SDIM), hi(SDIM) integer DIMDEC(s) integer DIMDEC(flux) integer DIMDEC(area) REAL_T s_o(DIMV(s)) REAL_T s_n(DIMV(s)) REAL_T flux(DIMV(flux)) REAL_T area(DIMV(area)) REAL_T dx REAL_T mult,theta integer dir integer i, j REAL_T sx1, sx2, sy1, sy2 REAL_T onemintheta onemintheta = one-theta if (dir .EQ. 0) then c ::::: compute X fluxes do j = lo(2), hi(2) do i = lo(1), hi(1)+1 sx1 = s_o(i,j) - s_o(i-1,j) sx2 = s_n(i,j) - s_n(i-1,j) flux(i,j) = mult*(onemintheta*sx1 + theta*sx2)*area(i,j)/dx end do end do else c ::::: compute Y fluxes do j = lo(2), hi(2)+1 do i = lo(1), hi(1) sy1 = s_o(i,j) - s_o(i,j-1) sy2 = s_n(i,j) - s_n(i,j-1) flux(i,j) = mult*(onemintheta*sy1 + theta*sy2)*area(i,j)/dx end do end do end if end subroutine FORT_VISCSYNCFLUX (ssync,DIMS(ssync),lo,hi, $ xflux,DIMS(xf),yflux,DIMS(yf), $ xarea,DIMS(ax),yarea,DIMS(ay),dx,mult) integer lo(2), hi(2) integer DIMDEC(ssync) integer DIMDEC(xf) integer DIMDEC(yf) integer DIMDEC(ax) integer DIMDEC(ay) REAL_T ssync(DIMV(ssync)) REAL_T xflux(DIMV(xf)) REAL_T yflux(DIMV(yf)) REAL_T xarea(DIMV(ax)) REAL_T yarea(DIMV(ay)) REAL_T dx(2) REAL_T mult REAL_T sx REAL_T sy integer i, j c c ::::: compute X fluxes c do j = lo(2), hi(2) do i = lo(1), hi(1)+1 sx = ssync(i,j) - ssync(i-1,j) xflux(i,j) = mult*sx*xarea(i,j)/dx(1) end do end do c c ::::: compute Y fluxes c do j = lo(2), hi(2)+1 do i = lo(1), hi(1) sy = ssync(i,j) - ssync(i,j-1) yflux(i,j) = mult*sy*yarea(i,j)/dx(2) end do end do end c :: ---------------------------------------------------------- c :: HOOPSRC c :: fab(i,j) = fab(i,j) - mu*u/(r(i)^2) c :: c :: INPUTS / OUTPUTS: c :: fab <= array to be modified c :: DIMS(fab) => index limits of fab c :: mu => viscous coefficient c :: ---------------------------------------------------------- c :: subroutine FORT_HOOPSRC (DIMS(grid), fab, DIMS(fab), u, DIMS(u), r, mu) integer DIMDEC(grid) integer DIMDEC(fab) integer DIMDEC(u) REAL_T fab(DIMV(fab)) REAL_T u(DIMV(u)) REAL_T r(DIM1(grid)) REAL_T mu integer i, j c if (ARG_L1(u) .lt. ARG_L1(fab) .or. ARG_H1(u) .gt. ARG_H1(fab)) then c write(6,*) "FORT_HOOPSRC: bad index limits" c stop c end if do j = ARG_L2(grid), ARG_H2(grid) do i = ARG_L1(grid), ARG_H1(grid) fab(i,j) = fab(i,j) - mu*u(i,j)/(r(i)*r(i)) end do end do end c :: ---------------------------------------------------------- c :: HOOPRHS c :: rhs(i,j) = rhs(i,j) - (one-theta)*dt*u*mu*vol/(r(i)^2) c :: c :: INPUTS / OUTPUTS: c :: fab <= array to be modified c :: DIMS(fab) => index limits of fab c :: u => array to be modified c :: DIMS(u) => index limits of u c :: r => 1-D r array (in first coordinate direction) c :: mu => scalar viscosity c :: dt => time step c :: vol => volume array c :: DIMS(vol) => index limits of vol c :: b => (one-theta)*dt c :: ---------------------------------------------------------- c :: subroutine FORT_HOOPRHS (fab, DIMS(fab), u, DIMS(u), r, b, & vol, DIMS(vol)) integer DIMDEC(fab) integer DIMDEC(u) integer DIMDEC(vol) REAL_T fab(DIMV(fab)) REAL_T u(DIMV(u)) REAL_T vol(DIMV(vol)) REAL_T r(DIM1(fab)) REAL_T b integer i, j do j = ARG_L2(fab), ARG_H2(fab) do i = ARG_L1(fab), ARG_H1(fab) fab(i,j) = fab(i,j) - b*vol(i,j)*u(i,j)/(r(i)*r(i)) end do end do end c :: ---------------------------------------------------------- c :: TENSOR_HOOPRHS c :: rhs(i,j) = rhs(i,j) - (1-theta)*dt*u*two*mu_cen*vol/(r(i)^2) c :: ^^^ yes, that is correct c :: for variable mu c :: c :: INPUTS / OUTPUTS: c :: fab <= array to be modified c :: DIMS(fab) => index limits of fab c :: u => array to be modified c :: DIMS(u) => index limits of u c :: r => 1-D r array (in first coordinate direction) c :: mu => scalar viscosity c :: dt => time step c :: vol => volume array c :: DIMS(vol) => index limits of vol c :: b => (1-theta)*dt c :: ---------------------------------------------------------- c :: subroutine FORT_TENSOR_HOOPRHS (xvelcomp, fab, DIMS(fab), u, DIMS(u), & r, b, & vol, DIMS(vol), betax, DIMS(betax), & betay, DIMS(betay)) integer xvelcomp integer DIMDEC(fab) integer DIMDEC(u) integer DIMDEC(vol) integer DIMDEC(betax) integer DIMDEC(betay) REAL_T fab(DIMV(fab),2) REAL_T u(DIMV(u),2) REAL_T vol(DIMV(vol)) REAL_T r(DIM1(fab)) REAL_T betax(DIMV(betax)) REAL_T betay(DIMV(betay)) REAL_T b REAL_T betacen integer i, j do j = ARG_L2(fab), ARG_H2(fab) do i = ARG_L1(fab), ARG_H1(fab) betacen = fourth*(betax(i,j)+betax(i+1,j)+ & betay(i,j)+betay(i,j+1)) fab(i,j,xvelcomp) = fab(i,j,xvelcomp) - & b*two*betacen*vol(i,j)*u(i,j,xvelcomp)/(r(i)*r(i)) end do end do end c :: ---------------------------------------------------------- c :: TENSOR_HOOPSRC c :: fab(i,j) = fab(i,j) - two*mu*u/(r(i)^2) c :: ^^^ yes, that is correct c :: for variable mu c :: c :: INPUTS / OUTPUTS: c :: fab <= array to be modified c :: DIMS(fab) => index limits of fab c :: mu => viscous coefficient c :: ---------------------------------------------------------- c :: subroutine FORT_TENSOR_HOOPSRC (comp, DIMS(grid), fab, DIMS(fab), u, & DIMS(u), r, betax, DIMS(betax), betay, DIMS(betay)) integer comp integer DIMDEC(grid) integer DIMDEC(fab) integer DIMDEC(u) integer DIMDEC(betax) integer DIMDEC(betay) REAL_T fab(DIMV(fab),2) REAL_T u(DIMV(u),2) REAL_T r(DIM1(grid)) REAL_T betax(DIMV(betax)) REAL_T betay(DIMV(betay)) integer i, j REAL_T betacen do j = ARG_L2(grid), ARG_H2(grid) do i = ARG_L1(grid), ARG_H1(grid) betacen = fourth*(betax(i,j)+betax(i+1,j)+ & betay(i,j)+betay(i,j+1)) fab(i,j,comp) = fab(i,j,comp) - two*betacen*u(i,j,comp)/(r(i)*r(i)) end do end do end c :: ---------------------------------------------------------- c :: SETALPHA c :: alpha(i,j) = vol*(1+b/(r(i)^2)) / density c :: c :: INPUTS / OUTPUTS: c :: fab <= array to be modified c :: DIMS(fab) => index limits of fab c :: lo,hi => index limits of box c :: r => 1-d array of radius c :: b => either theta*dt*mu or -(1-theta)*dt*mu c :: vol => volume array c :: DIMS(vol) => index limits of fab c :: denfab => array of density at time n+1/2 c :: DIMS(den) => index limits of fab c :: usehoop => do we add hoop stress? (only if x-vel component) c :: useden => do we divide by density? (only if velocity component) c :: ---------------------------------------------------------- c :: subroutine FORT_SETALPHA (fab, DIMS(fab), lo, hi, r, DIMS(r), $ b, vol, DIMS(vol), & denfab,DIMS(den),usehoop,useden) integer DIMDEC(fab) integer lo(SDIM), hi(SDIM) integer DIMDEC(vol) integer DIMDEC(den) integer DIMDEC(r) REAL_T fab(DIMV(fab)) REAL_T vol(DIMV(vol)) REAL_T denfab(DIMV(den)) REAL_T r(DIM1(r)) REAL_T b integer usehoop,useden integer i, j if (usehoop .eq. 0) then if (useden .eq. 0) then do j = lo(2), hi(2) do i = lo(1), hi(1) fab(i,j) = vol(i,j) end do end do else do j = lo(2), hi(2) do i = lo(1), hi(1) fab(i,j) = vol(i,j) * denfab(i,j) end do end do end if else if (useden .eq. 0) then do j = lo(2), hi(2) do i = lo(1), hi(1) fab(i,j) = vol(i,j) * (one + (b / (r(i)*r(i)))) end do end do else do j = lo(2), hi(2) do i = lo(1), hi(1) fab(i,j) = vol(i,j) * (denfab(i,j) + (b / (r(i)*r(i)))) end do end do end if end if end c :: ---------------------------------------------------------- c :: SET_TENSOR_ALPHA c :: alpha(i,j) = vol*density+b*dr*dz*two*mu_cen/r(i) c :: = vol*(density+b*two*mu_cen*r(i)**2) c :: ^^^ yes, that is correct c :: for variable mu c :: c :: INPUTS / OUTPUTS: c :: fab <= array to be modified c :: DIMS(fab) => index limits of fab c :: lo,hi => index limits of box c :: r => 1-d array of radius c :: b => theta*dt or -(1-theta)*dt c :: vol => volume array c :: DIMS(vol) => index limits of fab c :: denfab => array of density at time n+1/2 c :: DIMS(den) => index limits of fab c :: usehoop => do we add hoop stress? (only if x-vel component) c :: useden => do we divide by density? (only if velocity component) c :: ---------------------------------------------------------- c :: subroutine FORT_SET_TENSOR_ALPHA (alpha, DIMS(alpha), lo, hi, r, DIMS(r), $ b, vol, DIMS(vol), & denfab,DIMS(den),betax,DIMS(betax), & betay,DIMS(betay),isrz) integer DIMDEC(alpha) integer lo(SDIM), hi(SDIM) integer DIMDEC(vol) integer DIMDEC(den) integer DIMDEC(betax) integer DIMDEC(betay) integer DIMDEC(r) REAL_T alpha(DIMV(alpha),2) REAL_T vol(DIMV(vol)) REAL_T denfab(DIMV(den)) REAL_T betax(DIMV(betax)) REAL_T betay(DIMV(betay)) REAL_T r(DIM1(r)) REAL_T b, betacen integer isrz integer i, j if (isrz .eq. 0) then do j = lo(2), hi(2) do i = lo(1), hi(1) alpha(i,j,1) = vol(i,j) * denfab(i,j) alpha(i,j,2) = vol(i,j) * denfab(i,j) end do end do else do j = lo(2), hi(2) do i = lo(1), hi(1) alpha(i,j,2) = vol(i,j) * denfab(i,j) betacen = fourth*(betax(i,j)+betax(i+1,j)+ & betay(i,j)+betay(i,j+1)) alpha(i,j,1) = vol(i,j) * (denfab(i,j)+ & b*two*betacen/(r(i)**2)) end do end do end if end subroutine FORT_DIV_MU_SI(lo, hi, dx, mu, DIMS(divu), divu, & DIMS(divmusi), divmusi) implicit none c c ... inputs c integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM) integer DIMDEC(divu) REAL_T divu(DIMV(divu)) REAL_T mu c c ... outputs c integer DIMDEC(divmusi) REAL_T divmusi(DIMV(divmusi),SDIM) c c ... local c integer i,j REAL_T sleft, sright, stop, sbot c c ... Note: the following IS correct for r-z. Terms from the hoop stress c cancel with terms from tau_rr to eliminate all r dependence. c do j=lo(2),hi(2) do i=lo(1),hi(1) sleft = half*(divu(i-1,j)+divu(i,j)) sright = half*(divu(i+1,j)+divu(i,j)) divmusi(i,j,1) = mu*(sright-sleft)/dx(1) stop = half*(divu(i,j)+divu(i,j+1)) sbot = half*(divu(i,j-1)+divu(i,j)) divmusi(i,j,2) = mu*(stop-sbot)/dx(2) end do end do end subroutine FORT_DIV_VARMU_SI(lo, hi, dx, DIMS(divu), divu, & DIMS(betax), betax, DIMS(betay), betay, DIMS(divmusi), divmusi) implicit none c c ... inputs c integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM) integer DIMDEC(divu) REAL_T divu(DIMV(divu)) integer DIMDEC(betax) REAL_T betax(DIMV(betax)) integer DIMDEC(betay) REAL_T betay(DIMV(betay)) c c ... outputs c integer DIMDEC(divmusi) REAL_T divmusi(DIMV(divmusi),SDIM) c c ... local c integer i,j REAL_T sleft, sright, stop, sbot c c ... Note: the following IS correct for r-z. Terms from the hoop stress c cancel with terms from tau_rr to eliminate all r dependence. c do j=lo(2),hi(2) do i=lo(1),hi(1) sleft = half*(divu(i-1,j)+divu(i,j)) sright = half*(divu(i+1,j)+divu(i,j)) divmusi(i,j,1) = (betax(i+1,j)*sright- & betax(i,j)*sleft)/dx(1) stop = half*(divu(i,j)+divu(i,j+1)) sbot = half*(divu(i,j-1)+divu(i,j)) divmusi(i,j,2) = (betay(i,j+1)*stop- & betay(i,j)*sbot)/dx(2) end do end do end subroutine FORT_CCTOEDGE(lo, hi, DIMS(beta), beta, & DIMS(betax), betax, DIMS(betay), betay) implicit none c c ... inputs c integer lo(SDIM), hi(SDIM) integer DIMDEC(beta) REAL_T beta(DIMV(beta)) integer DIMDEC(betax) integer DIMDEC(betay) c c ... outputs c REAL_T betax(DIMV(betax)) REAL_T betay(DIMV(betay)) c c ... local c integer i,j do j=lo(2),hi(2) do i=lo(1),hi(1)+1 betax(i,j) = .5D0*(beta(i-1,j)+beta(i,j)) end do end do do j=lo(2),hi(2)+1 do i=lo(1),hi(1) betay(i,j) = .5D0*(beta(i,j-1)+beta(i,j)) end do end do end ccseapps-2.5/CCSEApps/iamrlib/Diffusion.H0000644000175000017500000003250411634153073021341 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Diffusion.H,v 1.27 2002/03/26 20:51:08 lijewski Exp $ // #ifndef _Diffusion_H_ #define _Diffusion_H_ // // Comment out this line to use diffusion class outside // the context of NavierStokes and classes derived from it. // #define USE_NAVIERSTOKES 1 #include #include #include #include #include #include #include #include #include #include // // Include files for tensor solve. // #include #include #include #include #include #ifndef _NavierStokes_H_ enum StateType {State_Type=0, Press_Type}; # if (BL_SPACEDIM == 2) enum StateNames { Xvel=0, Yvel, Density}; # else enum StateNames { Xvel=0, Yvel, Zvel, Density}; # endif #endif // // Useful enumeration of the different forms of the diffusion terms // enum DiffusionForm { RhoInverse_Laplacian_S, Laplacian_SoverRho, Laplacian_S }; class Diffusion { public: enum SolveMode {PREDICTOR, CORRECTOR, ONEPASS}; Diffusion (); Diffusion (Amr* Parent, AmrLevel* Caller, Diffusion* coarser, int num_state, FluxRegister* Viscflux_reg, MultiFab& Volume, MultiFab* Area, const Array& _is_diffusive, const Array& _visc_coef); virtual ~Diffusion (); void echo_settings () const; FluxRegister* viscFluxReg (); Real get_scaled_abs_tol (int sigma, const MultiFab* rhs, Real a, Real b, const MultiFab* alpha, const MultiFab* const* beta, Real reduction) const; Real get_scaled_abs_tol (int sigma, const MultiFab* rhs, Real a, Real b, const MultiFab* alpha, const MultiFab* const* betan, const MultiFab* const* betanp1, Real reduction) const; void diffuse_scalar (Real dt, int sigma, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, MultiFab* const* fluxn, MultiFab* const* fluxnp1, int dataComp = 0, MultiFab* delta_rhs = 0, const MultiFab* alpha = 0, const MultiFab* const* betan = 0, const MultiFab* const* betanp1 = 0, const SolveMode& solve_mode = ONEPASS); void diffuse_velocity (Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, MultiFab* delta_rhs = 0, const MultiFab* const* betan = 0, const MultiFab* const* betanp1 = 0); void diffuse_velocity_constant_mu (Real dt, Real be_cn_theta, const MultiFab* rho_half, MultiFab* delta_rhs); void diffuse_tensor_velocity (Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, MultiFab* delta_rhs, const MultiFab* const* betan, const MultiFab* const* betanp1); void diffuse_Vsync (MultiFab* Vsync, Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, const MultiFab* const* beta = 0); void diffuse_Vsync_constant_mu (MultiFab* Vsync, Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag); void diffuse_tensor_Vsync (MultiFab* Vsync, Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, const MultiFab* const* beta); void diffuse_Ssync (MultiFab* Ssync, int sigma, Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, MultiFab* const* flux, int dataComp = 0, const MultiFab* const* beta = 0, const MultiFab* alpha = 0); ABecLaplacian* getViscOp (int src_comp, Real a, Real b, Real time, ViscBndry& visc_bndry, const MultiFab* rho_half, int rho_flag, Real* rhsscale = 0, int dataComp = 0, const MultiFab* const* beta = 0, const MultiFab* alpha_in = 0, bool bndry_already_filled = false); ABecLaplacian* getViscOp (int src_comp, Real a, Real b, const MultiFab* rho_half, int rho_flag, Real* rhsscale = 0, int dataComp = 0, const MultiFab* const* beta = 0, const MultiFab* alpha_in = 0); DivVis* getTensorOp (Real a, Real b, Real time, ViscBndryTensor& visc_bndry, const MultiFab* rho_half, int dataComp, const MultiFab* const* beta); void getTensorBndryData (ViscBndryTensor& bndry, Real time); DivVis* getTensorOp (Real a, Real b, const MultiFab* rho_half, int dataComp, const MultiFab* const* beta); void getViscTerms (MultiFab& visc_terms, int src_comp, int comp, Real time, int rho_flag, int dataComp = 0, const MultiFab* const* beta = 0); void getTensorViscTerms (MultiFab& visc_terms, Real time, int dataComp, const MultiFab* const* beta); void getBndryData (ViscBndry& bndry, int state_ind, int num_comp, Real time, int rho_flag); void getBndryData (ViscBndry& bndry, int state_ind, int num_comp, AmrLevel::TimeLevel the_time, int rho_flag); void getBndryDataGivenS (ViscBndry& bndry, MultiFab& S, MultiFab& S_crse, int state_ind, int src_comp, int num_comp, Real time, int rho_flag); void FillBoundary (BndryRegister& bdry, int src_comp, int dest_comp, int num_comp, Real time, int rho_flag); void checkBetas (const MultiFab* const* beta1, const MultiFab* const* beta2, int& allthere, int& allnull) const; void checkBeta (const MultiFab* const* beta, int& allthere, int& allnull) const; void checkBeta (const MultiFab* const* beta, int& allthere) const; void allocFluxBoxesLevel (MultiFab**& fluxbox, int nghost = 0, int nvar = 1); void removeFluxBoxesLevel (MultiFab**& fluxbox); #ifdef USE_NAVIERSTOKES void compute_divmusi (Real time, const MultiFab* const* beta, MultiFab& divmusi); void compute_divmusi (Real time, Real mu, MultiFab& divmusi); #endif int maxOrder () const; int tensorMaxOrder () const; static int set_rho_flag (const DiffusionForm compDiffusionType); static bool are_any (const Array& diffusionType, const DiffusionForm testForm, const int sComp, const int nComp); static int how_many (const Array& diffusionType, const DiffusionForm testForm, const int sComp, const int nComp); protected: // // Data Required by Derived Classes // Amr* parent; AmrLevel* caller; const BoxArray& grids; const int level; // // Volume and area fractions. // const MultiFab& volume; const MultiFab* area; // // Static data. // static bool use_mg_precond_flag; static int use_cg_solve; static int scale_abec; static Array is_diffusive; // Does variable diffuse? static Array visc_coef; // Const coef viscosity terms static int verbose; static Real visc_tol; static Real visc_abs_tol; private: // // The data. // Diffusion* coarser; Diffusion* finer; int NUM_STATE; IntVect crse_ratio; FluxRegister* viscflux_reg; // // Static data. // static int first; static int do_reflux; static int use_tensor_cg_solve; static int max_order; static int tensor_max_order; static int est_visc_mag; static int Rhs_in_abs_tol; static Array typical_vals; }; #endif ccseapps-2.5/CCSEApps/iamrlib/RegType.H0000644000175000017500000000264311634153073020773 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _RegType_H_ #define _RegType_H_ enum RegType { interior, exterior, periodic, refWall, inflow, outflow, REG_TYPE_SIZE}; #endif ccseapps-2.5/CCSEApps/iamrlib/MACPROJ_3D.F0000644000175000017500000001161711634153073021034 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: MACPROJ_3D.F,v 1.6 2000/06/02 17:25:51 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "MACPROJ_F.H" #include "ArrayLim.H" #define SDIM 3 c :: ---------------------------------------------------------- c :: MACDIV: compute the MAC divergence in generalized coordinates c :: c :: INPUTS / OUTPUTS: c :: dmac <= MAC divergence (cell centered) c :: DIMS(dmac) => index limits for dmac c :: lo,hi => index limits of grid interior c :: ux => X edge velocity c :: DIMS(ux) => index limits for ux c :: uy => Y edge velocity c :: DIMS(uy) => index limits for uy c :: uz => Y edge velocity c :: DIMS(uz) => index limits for uz c :: xarea => area of cell faces in X dircetion c :: DIMS(ax) => index limits for xarea c :: yarea => area of cell faces in Y dircetion c :: DIMS(ay) => index limits for yarea c :: zarea => area of cell faces in Z dircetion c :: DIMS(az) => index limits for zarea c :: vol => cell volume c :: DIMS(vol) => index limits for vol c :: ---------------------------------------------------------- c :: subroutine FORT_MACDIV (dmac,DIMS(dmac),lo,hi, & ux,DIMS(ux),uy,DIMS(uy),uz,DIMS(uz), & xarea,DIMS(ax),yarea,DIMS(ay), & zarea,DIMS(az),vol,DIMS(vol)) integer DIMDEC(dmac) integer lo(SDIM), hi(SDIM) integer DIMDEC(ux) integer DIMDEC(uy) integer DIMDEC(uz) integer DIMDEC(ax) integer DIMDEC(ay) integer DIMDEC(az) integer DIMDEC(vol) REAL_T dmac(DIMV(dmac)) REAL_T ux(DIMV(ux)) REAL_T uy(DIMV(uy)) REAL_T uz(DIMV(uz)) REAL_T xarea(DIMV(ax)) REAL_T yarea(DIMV(ay)) REAL_T zarea(DIMV(az)) REAL_T vol(DIMV(vol)) integer i, j, k do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) dmac(i,j,k) = ( xarea(i+1,j,k)*ux(i+1,j,k) - xarea(i,j,k)*ux(i,j,k) & + yarea(i,j+1,k)*uy(i,j+1,k) - yarea(i,j,k)*uy(i,j,k) & + zarea(i,j,k+1)*uz(i,j,k+1) - zarea(i,j,k)*uz(i,j,k) & )/vol(i,j,k) end do end do end do end c :: ---------------------------------------------------------- c :: UCORUPDT c :: Snew = Snew + mult*Sold*dmac c :: c :: INPUTS / OUTPUTS: c :: snew <= state vector at new time c :: sold => state vector at old time c :: DIMS(s) => index limits for sold and snew c :: lo,hi => index limits of grid interior c :: nvar => number of components in state vector c :: dmac => MAC divergence of Ucorr c :: DIMS(dmac) => index limits for dmac c :: mult => scalar multiplier c :: ---------------------------------------------------------- c :: subroutine FORT_UCORUPDT (snew,sold,DIMS(s),nvar,lo,hi, & dmac,DIMS(dmac),mult) integer DIMDEC(s) integer lo(SDIM), hi(SDIM) integer DIMDEC(dmac) integer nvar REAL_T mult REAL_T snew(DIMV(s),nvar) REAL_T sold(DIMV(s),nvar) REAL_T dmac(DIMV(dmac)) integer i, j, k, n do n = 1, nvar do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) snew(i,j,k,n) = snew(i,j,k,n) + mult*dmac(i,j,k)*sold(i,j,k,n) end do end do end do end do end ccseapps-2.5/CCSEApps/iamrlib/ViscBndryTensor.cpp0000644000175000017500000000663611634153073023113 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ViscBndryTensor.cpp,v 1.7 2001/08/09 22:42:00 marc Exp $ // #include #include #include void ViscBndryTensor::setBndryConds (const BCRec& bc, int ratio, int comp) { BL_ASSERT (comp < MCLinOp::bcComponentsNeeded()); const Real* dx = geom.CellSize(); const Box& domain = geom.Domain(); for (OrientationIter fi; fi; ++fi) { Array& bloc = bcloc[fi()]; Array< Array >& bctag = bcond[fi()]; int dir = fi().coordDir(); Real delta = dx[dir]*ratio; int p_bc = fi().isLow() ? bc.lo(dir): bc.hi(dir); for (int i = 0; i < boxes().size(); i++) { if (domain[fi()] == boxes()[i][fi()] && !geom.isPeriodic(dir)) { // // All physical bc values are located on face. // if (p_bc == EXT_DIR ) { bctag[i][comp] = LO_DIRICHLET; bloc[i] = 0.0; } else if (p_bc == FOEXTRAP || p_bc == HOEXTRAP || p_bc == REFLECT_EVEN) { bctag[i][comp] = LO_NEUMANN; bloc[i] = 0.0; } else if (p_bc == REFLECT_ODD) { bctag[i][comp] = LO_REFLECT_ODD; bloc[i] = 0.0; } } else { // // Internal bndry, distance is half of crse. // bctag[i][comp] = LO_DIRICHLET; bloc[i] = 0.5*delta; } } } } void ViscBndryTensor::setHomogValues (const Array& bc, int ratio) { for (int n = 0; n < bc.size(); ++n) setBndryConds(bc[n], ratio, n); for (OrientationIter fi; fi; ++fi) { for (FabSetIter fsi(bndry[fi()]); fsi.isValid(); ++fsi) { bndry[fi()][fsi].setVal(0); } } } ccseapps-2.5/CCSEApps/iamrlib/run2d/0000755000175000017500000000000011634153073020330 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/run2d/Make.package0000644000175000017500000000025411634153073022523 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.2 1999/01/06 21:55:40 lijewski Exp $ # CEXE_sources += NS_setup.cpp NSBld.cpp FEXE_headers += probdata.H PROB_F.H FEXE_sources += PROB_$(DIM)D.F ccseapps-2.5/CCSEApps/iamrlib/run2d/GNUmakefile0000644000175000017500000001430411634153073022404 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.28 2003/02/21 22:49:10 car Exp $ # PBOXLIB_HOME = ../.. TOP = $(PBOXLIB_HOME) # # Variables for the user to set ... # PRECISION = DOUBLE DEBUG = TRUE PROFILE = FALSE DIM = 2 COMP = g++ FCOMP = Intel USE_MPI = TRUE USE_MPI = FALSE NAMESPACE = TRUE NAMESPACE = FALSE USE_THREADS = TRUE USE_THREADS = FALSE # # Use hgproj-serial -- only for testing. # # Touch Projection.cpp if you want to change the state of USE_HGPROJ_SERIAL. # USE_HGPROJ_SERIAL = TRUE USE_HGPROJ_SERIAL = FALSE # # What stencil do you want to use? # PRVERSION = v5 ifeq ($(USE_HGPROJ_SERIAL),TRUE) DEFINES += -DBL_USE_HGPROJ_SERIAL EBASE = amr-serial else EBASE = amr endif ifeq ($(DIM),2) # # SYNCREG_2D.F builds RHS differently for 5 and 9 point stencils. # # Note that parallel hgproj currently only implements v5. # ifeq ($(findstring 9, $(PRVERSION)), 9) DEFINES += -DBL_PRVERSION=9 else DEFINES += -DBL_PRVERSION=5 endif endif include $(TOP)/mk/Make.defs include ./Make.package BUILD_INPLACE:=FALSE BUILD_INPLACE:=TRUE ifeq ($(BUILD_INPLACE), TRUE) include $(TOP)/iamrlib/Make.package include $(TOP)/mglib/Make.package include $(TOP)/tensorMG/Make.package include $(TOP)/amrlib/Make.package include $(TOP)/bndrylib/Make.package ifeq ($(USE_HGPROJ_SERIAL),FALSE) include $(TOP)/hgproj/Make.package else include $(TOP)/hgproj-serial/Make.package endif include $(TOP)/BoxLib/Make.package INCLUDE_LOCATIONS += . INCLUDE_LOCATIONS += $(TOP)/iamrlib INCLUDE_LOCATIONS += $(TOP)/mglib INCLUDE_LOCATIONS += $(TOP)/tensorMG INCLUDE_LOCATIONS += $(TOP)/amrlib INCLUDE_LOCATIONS += $(TOP)/bndrylib ifeq ($(USE_HGPROJ_SERIAL),FALSE) INCLUDE_LOCATIONS += $(TOP)/hgproj else INCLUDE_LOCATIONS += $(TOP)/hgproj-serial INCLUDE_LOCATIONS += $(TOP)/hgproj-serial/include/$(DIM)d.$(PRVERSION) endif INCLUDE_LOCATIONS += $(TOP)/BoxLib else ifeq ($(USE_HGPROJ_SERIAL),FALSE) INCLUDE_LOCATIONS += . .. $(TOP)/include LIBRARY_LOCATIONS += $(TOP)/lib/$(machineSuffix) LIBRARIES += -liamr$(DIM)d -lmg$(DIM)d -lmcmg$(DIM)d -lamr$(DIM)d -lbndry$(DIM)d -lproj$(DIM)d -lbox$(DIM)d else INCLUDE_LOCATIONS += . .. $(TOP)/hgproj-serial INCLUDE_LOCATIONS += $(TOP)/hgproj-serial/include/$(DIM)d.$(PRVERSION) INCLUDE_LOCATIONS += $(TOP)/include LIBRARY_LOCATIONS += $(TOP)/hgproj-serial/lib/$(machineSuffix) $(TOP)/lib/$(machineSuffix) LIBRARIES += -liamr$(DIM)d -lmg$(DIM)d -lmcmg$(DIM)d -lamr$(DIM)d -lbndry$(DIM)d -lproj$(DIM)d.$(PRVERSION) -lbox$(DIM)d endif endif ifeq ($(MACHINE),OSF1) # # Some additional stuff for our preferred development/debugging environment. # ifeq ($(PRECISION),DOUBLE) FFLAGS += -real_size 64 endif FDEBF += -C FDEBF += -warn argument_checking FDEBF += -warn declarations ifneq ($(FC), f90) FDEBF += -warn truncated_source FDEBF += -warn unused endif endif # # For Running 3rd Only # 3RD = 1 3RD = ifdef 3RD LDFLAGS += --link_command_prefix 3rd LDFLAGS += -non_shared -v endif ifeq ($(BUILD_INPLACE), TRUE) vpath_cpp := . $(TOP)/iamrlib $(TOP)/mglib $(TOP)/tensorMG $(TOP)/amrlib $(TOP)/bndrylib vpath_H := . $(TOP)/iamrlib $(TOP)/mglib $(TOP)/tensorMG $(TOP)/amrlib $(TOP)/bndrylib vpath_FH := . $(TOP)/iamrlib $(TOP)/mglib $(TOP)/tensorMG $(TOP)/amrlib $(TOP)/bndrylib vpath_h := . $(TOP)/iamrlib $(TOP)/mglib $(TOP)/tensorMG $(TOP)/amrlib $(TOP)/bndrylib vpath_F := . $(TOP)/iamrlib $(TOP)/mglib $(TOP)/tensorMG $(TOP)/amrlib $(TOP)/bndrylib ifeq ($(USE_HGPROJ_SERIAL),FALSE) vpath_cpp += $(TOP)/hgproj vpath_H += $(TOP)/hgproj vpath_FH += $(TOP)/hgproj vpath_h += $(TOP)/hgproj vpath_F += $(TOP)/hgproj vpath_f += $(TOP)/hgproj else vpath_cpp += $(TOP)/hgproj-serial vpath_H += $(TOP)/hgproj-serial vpath_FH += $(TOP)/hgproj-serial vpath_h += $(TOP)/hgproj-serial vpath_F += $(TOP)/hgproj-serial vpath_f += $(TOP)/hgproj-serial endif ifeq ($(USE_BL3),TRUE) vpath_cpp += $(BOXLIB3_HOME) vpath_H += $(BOXLIB3_HOME) endif vpath_cpp += $(TOP)/BoxLib vpath_H += $(TOP)/BoxLib vpath_FH += $(TOP)/BoxLib vpath_h += $(TOP)/BoxLib vpath_F += $(TOP)/BoxLib vpath_f += $(TOP)/BoxLib vpath %.cpp $(vpath_cpp) vpath %.H $(vpath_H) vpath %.FH $(vpath_FH) vpath %.h $(vpath_h) vpath %.F $(vpath_F) vpath %.f $(vpath_F) else vpath %.H .. vpath %.cpp .. vpath %.a $(LIBRARY_LOCATIONS) endif all: $(executable) $(executable): $(LIBRARIES) ifneq ($(BUILD_INPLACE), TRUE) # # Build and install all libraries needed in an appropriate order. # MyMakeLine = $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) \ DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) \ USE_HGPROJ_SERIAL=$(USE_HGPROJ_SERIAL) PRVERSION=$(PRVERSION) \ DEFINES="$(DEFINES)" libs: cd $(TOP)/BoxLib; $(MyMakeLine) install cd $(TOP)/bndrylib; $(MyMakeLine) install cd $(TOP)/amrlib; $(MyMakeLine) install ifeq ($(USE_HGPROJ_SERIAL),FALSE) cd $(TOP)/hgproj; $(MyMakeLine) LBASE=proj EBASE= install else cd $(TOP)/hgproj-serial; $(MyMakeLine) LBASE=proj EBASE= endif cd $(TOP)/mglib; $(MyMakeLine) install cd $(TOP)/tensorMG; $(MyMakeLine) install cd $(TOP)/iamrlib; $(MyMakeLine) install # # Cleanup libraries. # cleanlibs: cd $(TOP)/BoxLib; $(MyMakeLine) clean cd $(TOP)/bndrylib; $(MyMakeLine) clean cd $(TOP)/amrlib; $(MyMakeLine) clean ifeq ($(USE_HGPROJ_SERIAL),FALSE) cd $(TOP)/hgproj; $(MyMakeLine) LBASE=proj EBASE= clean else cd $(TOP)/hgproj-serial; $(MyMakeLine) LBASE=proj EBASE= clean endif cd $(TOP)/mglib; $(MyMakeLine) clean cd $(TOP)/tensorMG; $(MyMakeLine) clean cd $(TOP)/iamrlib; $(MyMakeLine) clean endif # # Create MS-IDE dsp file to build this project # DspOlevel = 1 DspFileRoot = $(EBASE)$(DIM)d ifeq ($(DEBUG), TRUE) DspOlevel := 0 endif dsp: $(DspFileRoot).dsp .dspDepends: $(FEXE_sources) $(FEXE_headers) $(fEXE_sources) $(CEXE_headers) $(CEXE_sources) $(INCLUDE_LOCATIONS) @echo $^ > .dspDepends $(DspFileRoot).dsp: .dspDepends @(echo Building DSP file = $(DspFileRoot).dsp;\ $(TOP)/scripts/dsp.mak -p $(DspFileRoot) -t $(TOP) -d $(DIM) -o $(DspFileRoot).dsp -O $(DspOlevel) -f $^) .PHONY: dsp .dspDepends libs cleanlibs nodata touch_hg include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/iamrlib/run2d/.3rd0000644000175000017500000000001311634153073021013 0ustar amckinstryamckinstryignore rus ccseapps-2.5/CCSEApps/iamrlib/run2d/PROB_2D.F0000644000175000017500000014722611634153073021542 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: PROB_2D.F,v 1.22 2002/10/17 20:36:40 marc Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "PROB_AMR_F.H" #include "PROB_NS_F.H" #include "ArrayLim.H" #define SDIM 2 c ::: ----------------------------------------------------------- c ::: This routine is called at problem initialization time c ::: and when restarting from a checkpoint file. c ::: The purpose is (1) to specify the initial time value c ::: (not all problems start at time=0.0) and (2) to read c ::: problem specific data from a namelist or other input c ::: files and possibly store them or derived information c ::: in FORTRAN common blocks for later use. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: init => TRUE if called at start of problem run c ::: FALSE if called from restart c ::: name => name of "probin" file c ::: namlen => length of name c ::: strttime <= start problem with this time variable c ::: c ::: ----------------------------------------------------------- subroutine FORT_PROBINIT (init,name,namlen,problo,probhi) integer init,namlen integer name(namlen) integer untin, i REAL_T problo(SDIM), probhi(SDIM) #include "probdata.H" namelist /fortin/ denerr, vorterr, adverr, temperr, & denfact, xblob, yblob, zblob, radblob, & velfact, probtype, randfact, bubgrad, & rhozero, tempzero, c_d, r_d, & adv_dir, adv_vel, axis_dir, radvort c c Build "probin" filename -- the name of file containing fortin namelist. c integer maxlen parameter (maxlen=256) character probin*(maxlen) if (namlen .gt. maxlen) then write(6,*) 'probin file name too long' stop end if do i = 1, namlen probin(i:i) = char(name(i)) end do untin = 9 if (namlen .eq. 0) then open(untin,file='probin',form='formatted',status='old') else open(untin,file=probin(1:namlen),form='formatted',status='old') end if read(untin,fortin) c write(6,fortin) close(unit=untin) c c Initialize the common blocks c do i=1, SDIM f_problo(i) = problo(i) f_probhi(i) = probhi(i) enddo end c ::: ----------------------------------------------------------- c ::: This routine is called at problem setup time and is used c ::: to initialize data on each grid. The velocity field you c ::: provide does not have to be divergence free and the pressure c ::: field need not be set. A subsequent projection iteration c ::: will define aa divergence free velocity field along with a c ::: consistant pressure. c ::: c ::: NOTE: all arrays have one cell of ghost zones surrounding c ::: the grid interior. Values in these cells need not c ::: be set here. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: level => amr level of grid c ::: time => time at which to init data c ::: lo,hi => index limits of grid interior (cell centered) c ::: nscal => number of scalar quantities. You should know c ::: this already! c ::: vel <= Velocity array c ::: scal <= Scalar array c ::: press <= Pressure array c ::: dx => cell size c ::: xlo,xhi => physical locations of lower left and upper c ::: right hand corner of grid. (does not include c ::: ghost region). c ::: ----------------------------------------------------------- subroutine FORT_INITDATA(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM),hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) #include "probdata.H" if (probtype .eq. 1) then call initspin(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 2) then call initbubble(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 3) then call initvort(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 4) then call initchannel(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 5) then call initpervort(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 6) then call inithotspot(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 7) then call initviscbench(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else write(6,*) "INITDATA: bad probtype = ",probtype end if end c c ::: ----------------------------------------------------------- c subroutine initbubble(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, n REAL_T x, y REAL_T hx, hy REAL_T dist REAL_T x_vel, y_vel #include "probdata.H" hx = dx(1) hy = dx(2) if (adv_dir .eq. 1) then x_vel = adv_vel y_vel = zero else if (adv_dir .eq. 2) then x_vel = zero y_vel = adv_vel else write(6,*) "initbubble: adv_dir = ",adv_dir stop end if do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) c dist = sqrt((x-xblob)**2 + (y-yblob)**2) dist = sqrt((x-xblob)**2) vel(i,j,1) = x_vel vel(i,j,2) = y_vel scal(i,j,1) = one + half*(denfact-one)*(one-tanh(30.*(dist-radblob))) c scal(i,j,1) = cvmgt(denfact,one,dist.lt.radblob) do n = 2,nscal-1 scal(i,j,n) = one end do scal(i,j,nscal) = cvmgt(one,zero,dist.lt.radblob) end do end do end c c ::: ----------------------------------------------------------- c subroutine initspin(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, n REAL_T x, y REAL_T hx, hy REAL_T dist REAL_T x_vel, y_vel REAL_T spx, spy, cpx, cpy #include "probdata.H" hx = dx(1) hy = dx(2) if (adv_dir .eq. 1) then x_vel = adv_vel y_vel = zero else if (adv_dir .eq. 2) then x_vel = zero y_vel = adv_vel else write(6,*) "INITSPIN: adv_dir = ",adv_dir stop end if do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) spy = sin(Pi*y) cpy = cos(Pi*y) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) spx = sin(Pi*x) cpx = cos(Pi*x) vel(i,j,1) = x_vel - velfact*two*spy*cpy*spx**2 vel(i,j,2) = y_vel + velfact*two*spx*cpx*spy**2 dist = sqrt((x-xblob)**2 + (y-yblob)**2) scal(i,j,1) = one + (denfact-one) * tanh(10.*(dist-radblob)) do n = 2,nscal-1 scal(i,j,n) = one end do scal(i,j,nscal) = cvmgt(one,zero,dist.lt.radblob) end do end do end c c ::: ----------------------------------------------------------- c ::: This case is an unsteady viscous benchmark for which the c ::: exact solution is, c ::: u(x,y,t) = - Cos(Pi x) Sin(Pi y) Exp(-2 Pi^2 Nu t) c ::: v(x,y,t) = Sin(Pi x) Cos(Pi y) Exp(-2 Pi^2 Nu t) c ::: p(x,y,t) = - {Cos(2 Pi x) + Cos(2 Pi y)} Exp(-4 Pi^2 Nu t) / 4 c ::: In the utilities, iamrlib/BenchMarks, there is a c ::: tool ViscBench2d.cpp that reads a plot file and compares the c ::: solution against this exact solution. This benchmark was c ::: originally derived by G.I. Taylor (Phil. Mag., Vol. 46, No. 274, c ::: pp. 671-674, 1923) and Ethier and Steinman c ::: (Intl. J. Num. Meth. Fluids, Vol. 19, pp. 369-375, 1994) give c ::: the pressure field. c subroutine initviscbench(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, n REAL_T x, y REAL_T hx, hy REAL_T spx, spy, cpx, cpy #include "probdata.H" hx = dx(1) hy = dx(2) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) spy = sin(Pi*y) cpy = cos(Pi*y) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) spx = sin(Pi*x) cpx = cos(Pi*x) vel(i,j,1) = - cpx*spy vel(i,j,2) = spx*cpy scal(i,j,1) = one do n = 2,nscal scal(i,j,n) = cpx*cpy end do end do end do end c c ::: ----------------------------------------------------------- c subroutine initvort(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, n REAL_T x, y, r REAL_T hx, hy REAL_T c, ux, uy REAL_T umagin, umagout, absu, sinth, costh REAL_T small, a, b, r0 #include "probdata.H" hx = dx(1) hy = dx(2) small = 1.0e-10 r0 = two/three * radvort a = one / ((radvort - r0)*(two*radvort - r0)) b = a * radvort**2 * (radvort - r0) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) - yblob do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) - xblob r = sqrt(x**2 + y**2) c umagin = .5*r - 4*r**3 c umagout = radvort*(.5*radvort - 4*radvort**3)/max(radvort,r) umagin = velfact * (one - a*(r - r0)**2) umagout = velfact * b/max(radvort,r) absu = cvmgp(umagout,umagin,r - radvort) sinth = y/max(r,small*radvort) costh = x/max(r,small*radvort) vel(i,j,1) = -absu*sinth vel(i,j,2) = absu*costh scal(i,j,1) = cvmgt(denfact,one,r.lt.radblob) do n = 2,nscal-1 scal(i,j,n) = one end do scal(i,j,nscal) = cvmgt(one,zero,r.lt.radblob) end do end do end c c ::: ----------------------------------------------------------- c subroutine initchannel(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, n REAL_T x, y REAL_T hx, hy REAL_T dist #include "probdata.H" hx = dx(1) hy = dx(2) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) do i = lo(1), hi(1) vel(i,j,1) = adv_vel vel(i,j,2) = zero scal(i,j,1) = one do n = 2,nscal-1 scal(i,j,n) = one end do x = xlo(1) + hx*(float(i-lo(1)) + half) dist = sqrt((x-xblob)**2 + (y-yblob)**2) scal(i,j,nscal) = cvmgt(one,zero,dist.lt.radblob) end do end do end c c ::: ----------------------------------------------------------- c subroutine initpervort(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, n REAL_T x, y REAL_T hx, hy REAL_T dist #include "probdata.H" hx = dx(1) hy = dx(2) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) vel(i,j,1) = tanh(30.*(.25-abs(y-.5))) vel(i,j,2) = .05*sin(two*Pi*x) scal(i,j,1) = one do n = 2,nscal-1 scal(i,j,n) = one end do dist = sqrt((x-xblob)**2 + (y-yblob)**2) scal(i,j,nscal) = cvmgt(one,zero,dist.lt.radblob) end do end do end c c ::: ----------------------------------------------------------- c subroutine inithotspot(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c ::::: local variables integer i, j, n REAL_T x, y REAL_T hx, hy REAL_T x_vel, y_vel REAL_T dist #include "probdata.H" hx = dx(1) hy = dx(2) if (adv_dir .eq. 1) then x_vel = adv_vel y_vel = zero else if (adv_dir .eq. 2) then x_vel = zero y_vel = adv_vel else write(6,*) "inithotspot: adv_dir = ",adv_dir stop end if do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) dist = sqrt((x-xblob)**2 + (y-yblob)**2) vel(i,j,1) = x_vel vel(i,j,2) = y_vel scal(i,j,1) = one/denfact + (one - one/denfact) & *half*(one + tanh(40.*(dist - radblob))) scal(i,j,2) = cvmgt(one,zero,dist.lt.radblob) do n = 3,nscal-1 scal(i,j,n) = one end do scal(i,j,nscal) = one / scal(i,j,1) end do end do end c ::: ----------------------------------------------------------- c ::: This routine will tag high error cells based on the c ::: density gradient c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: tag <= integer tag array c ::: DIMS(tag) => index extent of tag array c ::: set => integer value to tag cell for refinement c ::: clear => integer value to untag cell c ::: rho => density array c ::: DIMS(rho) => index extent of rho array c ::: lo,hi => index extent of grid c ::: nvar => number of components in rho array (should be 1) c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of tag array c ::: problo => phys loc of lower left corner of prob domain c ::: time => problem evolution time c ::: ----------------------------------------------------------- subroutine FORT_DENERROR (tag,DIMS(tag),set,clear, & rho,DIMS(rho),lo,hi,nvar, & domlo,domhi,dx,xlo, & problo,time,level) integer DIMDEC(rho) integer DIMDEC(tag) integer lo(SDIM), hi(SDIM) integer nvar, set, clear, level integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), problo(SDIM), time integer tag(DIMV(tag)) REAL_T rho(DIMV(rho), nvar) integer i, j #include "probdata.H" do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),rho(i,j,1).lt.denerr) end do end do end c ::: ----------------------------------------------------------- c ::: This routine will tag high error cells based on the c ::: density gradient c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: tag <= integer tag array c ::: DIMS(tag) => index extent of tag array c ::: set => integer value to tag cell for refinement c ::: clear => integer value to untag cell c ::: adv => scalar array c ::: DIMS(adv) => index extent of scalar array c ::: lo,hi => index extent of grid c ::: nvar => number of components in rho array (should be 1) c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of tag array c ::: problo => phys loc of lower left corner of prob domain c ::: time => problem evolution time c ::: ----------------------------------------------------------- subroutine FORT_ADVERROR (tag,DIMS(tag),set,clear, & adv,DIMS(adv),lo,hi,nvar, & domlo,domhi,dx,xlo, & problo,time,level) integer DIMDEC(tag) integer DIMDEC(adv) integer nvar, set, clear, level integer domlo(SDIM), domhi(SDIM) integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM), xlo(SDIM), problo(SDIM), time integer tag(DIMV(tag)) REAL_T adv(DIMV(adv),nvar) REAL_T x, y, ax, ay, aerr, dy integer i, j #include "probdata.H" c probtype = SPIN if (probtype .eq. 1) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),adv(i,j,1).gt.adverr) end do end do c probtype = BUBBLE else if (probtype .eq. 2) then if (level .eq. 0) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),adv(i,j,1).gt.adverr) end do end do end if c probtype = VORTEX IN A BOX else if (probtype .eq. 3) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),adv(i,j,1).gt.adverr) end do end do c probtype = CHANNEL else if (probtype .eq. 4) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),adv(i,j,1).gt.adverr) end do end do c probtype = PERIODIC SHEAR LAYER else if (probtype .eq. 5) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),adv(i,j,1).gt.adverr) end do end do c probtype = HOT SPOT else if (probtype .eq. 6) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),adv(i,j,1).gt.adverr) end do end do c probtype = VISCOUS BENCHMARK else if (probtype .eq. 7) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),adv(i,j,1).gt.adverr) end do end do else print *,'DONT KNOW THIS PROBTYPE IN FORT_ADVERROR ',probtype stop end if end c ::: ----------------------------------------------------------- c ::: This routine will tag high error cells based on the c ::: temperature gradient c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: tag <= integer tag array c ::: DIMS(tag) => index extent of tag array c ::: set => integer value to tag cell for refinement c ::: clear => integer value to untag cell c ::: temp => density array c ::: DIMS(temp)=> index extent of temp array c ::: lo,hi => index extent of grid c ::: nvar => number of components in rho array (should be 1) c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of tag array c ::: problo => phys loc of lower left corner of prob domain c ::: time => problem evolution time c ::: ----------------------------------------------------------- subroutine FORT_TEMPERROR (tag,DIMS(tag),set,clear, & temperature,DIMS(temp),lo,hi,nvar, & domlo,domhi,dx,xlo, & problo,time,level) integer DIMDEC(tag) integer DIMDEC(temp) integer nvar, set, clear, level integer domlo(SDIM), domhi(SDIM) integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM), xlo(SDIM), problo(SDIM), time integer tag(DIMV(tag)) REAL_T temperature(DIMV(temp),nvar) REAL_T x, y, ax, ay, aerr integer i, j #include "probdata.H" c probtype = SPIN if (probtype .eq. 1) then c probtype = BUBBLE else if (probtype .eq. 2) then c probtype = VORTEX IN A BOX else if (probtype .eq. 3) then c probtype = CHANNEL else if (probtype .eq. 4) then c probtype = PERIODIC SHEAR LAYER else if (probtype .eq. 5) then c probtype = HOT SPOT else if (probtype .eq. 6) then if (level .eq. 0) then c ::::: refine around entire hot spot do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),temperature(i,j,1).gt.temperr) end do end do else c ::::: refine where there is temperature gradient do j = lo(2), hi(2) do i = lo(1), hi(1) ax = abs(temperature(i+1,j,1) - temperature(i-1,j,1)) ay = abs(temperature(i,j+1,1) - temperature(i,j-1,1)) aerr = max(ax,ay) tag(i,j) = cvmgt(set,tag(i,j),aerr.gt.bubgrad) end do end do end if c probtype = VISCOUS BENCHMARK else if (probtype .eq. 7) then else print *,'DONT KNOW THIS PROBTYPE IN FORT_TEMPERROR ',probtype stop end if end c ::: ----------------------------------------------------------- c ::: This routine will tag high error cells based on the c ::: magnitude of vorticity c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: tag <= integer tag array c ::: DIMS(tag) => index extent of tag array c ::: set => integer value to tag cell for refinement c ::: clear => integer value to untag cell c ::: vort => array of vorticity values c ::: DIMS(vor) => index extent of vort array c ::: nvar => number of components in vort array (should be 1) c ::: lo,hi => index extent of grid c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of tag array c ::: problo => phys loc of lower left corner of prob domain c ::: time => problem evolution time c ::: ----------------------------------------------------------- subroutine FORT_MVERROR (tag,DIMS(tag),set,clear, & vort,DIMS(vort),lo,hi,nvar, & domlo,domhi,dx,xlo, & problo,time,level) integer DIMDEC(tag) integer DIMDEC(vort) integer nvar, set, clear, level integer lo(SDIM), hi(SDIM) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), problo(SDIM), time integer tag(DIMV(tag)) REAL_T vort(DIMV(vort),nvar) REAL_T x, y integer i, j #include "probdata.H" c probtype = SPIN if (probtype .eq. 1) then c probtype = BUBBLE else if (probtype .eq. 2) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),abs(vort(i,j,1)).gt.vorterr) end do end do c probtype = VORTEX IN A BOX else if (probtype .eq. 3) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),abs(vort(i,j,1)).gt.vorterr) end do end do c probtype = CHANNEL else if (probtype .eq. 4) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),abs(vort(i,j,1)).gt.vorterr) end do end do c probtype = PERIODIC SHEAR LAYER else if (probtype .eq. 5) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),abs(vort(i,j,1)).gt.vorterr) end do end do c probtype = HOT SPOT else if (probtype .eq. 6) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),abs(vort(i,j,1)).gt.vorterr) end do end do c probtype = VISCOUS BENCHMARK else if (probtype .eq. 7) then do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j) = cvmgt(set,tag(i,j),abs(vort(i,j,1)).gt.vorterr) end do end do else print *,'DONT KNOW THIS PROBTYPE IN FORT_MVERROR ',probtype stop end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data and that all non-interior cells have c :: have been filled with a large real number. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: rho <= density array c ::: DIMS(rho) => index extent of rho array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_DENFILL (rho,DIMS(rho),domlo,domhi,dx, & xlo,time,bc ) integer DIMDEC(rho) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T rho(DIMV(rho)) integer bc(SDIM,2) integer i, j #include "probdata.H" call filcc(rho,DIMS(rho),domlo,domhi,dx,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.ARG_L1(rho).lt.domlo(1)) then do i = ARG_L1(rho), domlo(1)-1 do j = ARG_L2(rho), ARG_H2(rho) rho(i,j) = denfact end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(rho).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(rho) do j = ARG_L2(rho), ARG_H2(rho) rho(i,j) = denfact end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(rho).lt.domlo(2)) then do j = ARG_L2(rho), domlo(2)-1 do i = ARG_L1(rho), ARG_H1(rho) rho(i,j) = denfact end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(rho).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(rho) do i = ARG_L1(rho), ARG_H1(rho) rho(i,j) = denfact end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data and that all non-interior cells have c :: have been filled with a large real number. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: adv <= advected quantity array c ::: DIMS(adv) => index extent of adv array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of adv array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_ADVFILL (adv,DIMS(adv),domlo,domhi,dx,xlo,time,bc) integer DIMDEC(adv) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer bc(SDIM,2) integer i, j #include "probdata.H" call filcc(adv,DIMS(adv),domlo,domhi,dx,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.ARG_L1(adv).lt.domlo(1)) then do i = ARG_L1(adv), domlo(1)-1 do j = ARG_L2(adv), ARG_H2(adv) adv(i,j) = zero end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(adv).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(adv) do j = ARG_L2(adv), ARG_H2(adv) adv(i,j) = zero end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(adv).lt.domlo(2)) then do j = ARG_L2(adv), domlo(2)-1 do i = ARG_L1(adv), ARG_H1(adv) adv(i,j) = zero end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(adv).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(adv) do i = ARG_L1(adv), ARG_H1(adv) adv(i,j) = zero end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data and that all non-interior cells have c :: have been filled with a large real number. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: temperature <= temperature array c ::: DIMS(temp) => index extent of adv array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of temperature array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_TEMPFILL (temperature,DIMS(temp),domlo,domhi,dx, & xlo,time,bc ) integer DIMDEC(temp) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T temperature(DIMV(temp)) integer bc(SDIM,2) integer i, j #include "probdata.H" call filcc(temperature,DIMS(temp),domlo,domhi,dx,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.ARG_L1(temp).lt.domlo(1)) then do i = ARG_L1(temp), domlo(1)-1 do j = ARG_L2(temp), ARG_H2(temp) temperature(i,j) = one end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(temp).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(temp) do j = ARG_L2(temp), ARG_H2(temp) temperature(i,j) = one end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(temp).lt.domlo(2)) then do j = ARG_L2(temp), domlo(2)-1 do i = ARG_L1(temp), ARG_H1(temp) temperature(i,j) = one end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(temp).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(temp) do i = ARG_L1(temp), ARG_H1(temp) temperature(i,j) = one end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data and that all non-interior cells have c :: have been filled with a large real number. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: u <= x velocity array c ::: DIMS(u) => index extent of u array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_XVELFILL (u,DIMS(u),domlo,domhi,dx,xlo,time,bc) integer DIMDEC(u) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T u(DIMV(u)) integer bc(SDIM,2) integer i, j REAL_T x_vel #include "probdata.H" if (adv_dir .eq. 1)then x_vel = adv_vel else x_vel = zero end if call filcc(u,DIMS(u),domlo,domhi,dx,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.ARG_L1(u).lt.domlo(1)) then do i = ARG_L1(u), domlo(1)-1 do j = ARG_L2(u), ARG_H2(u) u(i,j) = x_vel end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(u).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(u) do j = ARG_L2(u), ARG_H2(u) u(i,j) = x_vel end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(u).lt.domlo(2)) then do j = ARG_L2(u), domlo(2)-1 do i = ARG_L1(u), ARG_H1(u) u(i,j) = zero end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(u).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(u) do i = ARG_L1(u), ARG_H1(u) u(i,j) = zero end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data and that all non-interior cells have c :: have been filled with a large real number. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: v <= y velocity array c ::: DIMS(v) => index extent of v array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_YVELFILL (v,DIMS(v),domlo,domhi,dx,xlo,time,bc) integer DIMDEC(v) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T v(DIMV(v)) integer bc(SDIM,2) integer i, j REAL_T y_vel #include "probdata.H" if (adv_dir .eq. 2) then y_vel = adv_vel else y_vel = zero end if call filcc(v,DIMS(v),domlo,domhi,dx,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.ARG_L1(v).lt.domlo(1)) then do i = ARG_L1(v), domlo(1)-1 do j = ARG_L2(v),ARG_H2(v) v(i,j) = zero end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(v).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(v) do j = ARG_L2(v), ARG_H2(v) v(i,j) = zero end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(v).lt.domlo(2)) then do j = ARG_L2(v), domlo(2)-1 do i = ARG_L1(v), ARG_H1(v) v(i,j) = y_vel end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(v).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(v) do i = ARG_L1(v), ARG_H1(v) v(i,j) = y_vel end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: p <= pressure array c ::: DIMS(p) => index extent of p array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_PRESFILL (p,DIMS(p),domlo,domhi,dx,xlo,time,bc) integer DIMDEC(p) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T p(DIMV(p)) integer bc(SDIM,2) integer i, j integer ilo, ihi, jlo, jhi logical fix_xlo, fix_xhi, fix_ylo, fix_yhi logical per_xlo, per_xhi, per_ylo, per_yhi fix_xlo = (ARG_L1(p) .lt. domlo(1)) .and. (bc(1,1) .ne. INT_DIR) per_xlo = (ARG_L1(p) .lt. domlo(1)) .and. (bc(1,1) .eq. INT_DIR) fix_xhi = (ARG_H1(p) .gt. domhi(1)) .and. (bc(1,2) .ne. INT_DIR) per_xhi = (ARG_H1(p) .gt. domhi(1)) .and. (bc(1,2) .eq. INT_DIR) fix_ylo = (ARG_L2(p) .lt. domlo(2)) .and. (bc(2,1) .ne. INT_DIR) per_ylo = (ARG_L2(p) .lt. domlo(2)) .and. (bc(2,1) .eq. INT_DIR) fix_yhi = (ARG_H2(p) .gt. domhi(2)) .and. (bc(2,2) .ne. INT_DIR) per_yhi = (ARG_H2(p) .gt. domhi(2)) .and. (bc(2,2) .eq. INT_DIR) ilo = max(ARG_L1(p),domlo(1)) ihi = min(ARG_H1(p),domhi(1)) jlo = max(ARG_L2(p),domlo(2)) jhi = min(ARG_H2(p),domhi(2)) c c ::::: left side c if (fix_xlo) then do i = ARG_L1(p), domlo(1)-1 do j = jlo,jhi p(i,j) = p(ilo,j) end do end do if (fix_ylo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 p(i,j) = p(ilo,jlo) end do end do else if (per_ylo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 p(i,j) = p(ilo,j) end do end do end if if (fix_yhi) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) p(i,j) = p(ilo,jhi) end do end do else if (per_yhi) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) p(i,j) = p(ilo,j) end do end do end if end if c c ::::: right side c if (fix_xhi) then do i = domhi(1)+1, ARG_H1(p) do j = jlo,jhi p(i,j) = p(ihi,j) end do end do if (fix_ylo) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 p(i,j) = p(ihi,jlo) end do end do else if (per_ylo) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 p(i,j) = p(ihi,j) end do end do end if if (fix_yhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) p(i,j) = p(ihi,jhi) end do end do else if (per_yhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) p(i,j) = p(ihi,j) end do end do end if end if if (fix_ylo) then do j = ARG_L2(p), domlo(2)-1 do i = ilo, ihi p(i,j) = p(i,jlo) end do end do if (per_xlo) then do j = ARG_L2(p), domlo(2)-1 do i = ARG_L1(p), domlo(1)-1 p(i,j) = p(i,jlo) end do end do end if if (per_xhi) then do j = ARG_L2(p), domlo(2)-1 do i = domhi(1)+1, ARG_H1(p) p(i,j) = p(i,jlo) end do end do end if end if if (fix_yhi) then do j = domhi(2)+1, ARG_H2(p) do i = ilo, ihi p(i,j) = p(i,jhi) end do end do if (per_xlo) then do j = domhi(2)+1, ARG_H2(p) do i = ARG_L1(p), domlo(1)-1 p(i,j) = p(i,jhi) end do end do end if if (per_xhi) then do j = domhi(2)+1, ARG_H2(p) do i = domhi(1)+1, ARG_H1(p) p(i,j) = p(i,jhi) end do end do end if end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: divu <= divu array c ::: DIMS(divu)=> index extent of p array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_DIVUFILL (divu,DIMS(divu),domlo,domhi,delta, & xlo,time,bc ) integer DIMDEC(divu) integer bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T divu(DIMV(divu)) integer i, j integer ilo, ihi, jlo, jhi REAL_T y integer lo(SDIM), hi(SDIM) lo(1) = ARG_L1(divu) hi(1) = ARG_H1(divu) lo(2) = ARG_L2(divu) hi(2) = ARG_H2(divu) ilo = max(lo(1),domlo(1)) ihi = min(hi(1),domhi(1)) jlo = max(lo(2),domlo(2)) jhi = min(hi(2),domhi(2)) call filcc (divu,DIMS(divu),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then if(jlo.le.jhi)then do j = jlo, jhi do i = lo(1), domlo(1)-1 divu(i,j) = divu(domlo(1),j) end do end do end if if (lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), domlo(1)-1 divu(i,j) = divu(domlo(1),domlo(2)) end do end do end if if(hi(2).gt.domhi(2))then do j = domhi(2)+1, hi(2) do i = lo(1), domlo(1)-1 divu(i,j) = divu(domlo(1),domhi(2)) end do end do end if end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then if(jlo.le.jhi)then do j = jlo,jhi do i = domhi(1)+1,hi(1) divu(i,j) = divu(domhi(1),j) end do end do end if if (lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = domhi(1)+1,hi(1) divu(i,j) = divu(domhi(1),domlo(2)) end do end do end if if(hi(2).gt.domhi(2))then do j = domhi(2)+1, hi(2) do i = domhi(1)+1,hi(1) divu(i,j) = divu(domhi(1),domhi(2)) end do end do end if end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then if(ilo.le.ihi)then do j = lo(2), domlo(2)-1 do i = ilo,ihi divu(i,j) = divu(i,domlo(2)) end do end do end if if (lo(1).lt.domlo(1)) then do j = lo(2), domlo(2)-1 do i = lo(1), domlo(1)-1 divu(i,j) = divu(domlo(1),domlo(2)) end do end do end if if(hi(1).gt.domhi(1))then do j = lo(2), domlo(2)-1 do i = domhi(1)+1, hi(1) divu(i,j) = divu(domhi(1),domlo(2)) end do end do end if end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then if(ilo.le.ihi)then do j = domhi(2)+1, hi(2) do i = ilo,ihi divu(i,j) = divu(i,domhi(2)) end do end do end if if (lo(1).lt.domlo(1)) then do j = domhi(2)+1, hi(2) do i = lo(1), domlo(1)-1 divu(i,j) = divu(domlo(1),domhi(2)) end do end do end if if(hi(1).gt.domhi(1))then do j = domhi(2)+1, hi(2) do i = domhi(1)+1, hi(1) divu(i,j) = divu(domhi(1),domhi(2)) end do end do end if end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: dsdt <= dsdt array c ::: DIMS(dsdt)=> index extent of p array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_DSDTFILL (dsdt,DIMS(dsdt),domlo,domhi,delta, & xlo,time,bc ) integer DIMDEC(dsdt) integer bc(SDIM,2) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM), xlo(SDIM), time REAL_T dsdt(DIMV(dsdt)) integer i, j integer ilo, ihi, jlo, jhi REAL_T y integer lo(SDIM), hi(SDIM) lo(1) = ARG_L1(dsdt) hi(1) = ARG_H1(dsdt) lo(2) = ARG_L2(dsdt) hi(2) = ARG_H2(dsdt) ilo = max(lo(1),domlo(1)) ihi = min(hi(1),domhi(1)) jlo = max(lo(2),domlo(2)) jhi = min(hi(2),domhi(2)) call filcc (dsdt,DIMS(dsdt),domlo,domhi,delta,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do j = lo(2), hi(2) dsdt(i,j) = zero end do end do end if if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do j = lo(2), hi(2) dsdt(i,j) = zero end do end do end if if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do i = lo(1), hi(1) dsdt(i,j) = zero end do end do end if if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do i = lo(1), hi(1) dsdt(i,j) = zero end do end do end if end ccseapps-2.5/CCSEApps/iamrlib/run2d/probin.2d.bubble0000644000175000017500000000023311634153073023300 0ustar amckinstryamckinstry $fortin probtype = 2 xblob = 0.0 yblob = 1.5 radblob = 0.2 denfact = 2.0 adv_dir = 1 adv_vel = 0.0 adverr = 0.1 vorterr = 1.0 $end ccseapps-2.5/CCSEApps/iamrlib/run2d/probin.2d.periodic_shear_layer0000644000175000017500000000017411634153073026225 0ustar amckinstryamckinstry $fortin probtype = 5 xblob = 0.5 yblob = 0.5 radblob = 0.2 denfact = 1.0 adverr = 0.5 vorterr = 0.0 $end ccseapps-2.5/CCSEApps/iamrlib/run2d/probdata.H0000644000175000017500000000402211634153073022233 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ REAL_T denerr, vorterr, adverr, temperr, randfact, bubgrad REAL_T denfact, xblob, yblob, zblob, radblob, velfact REAL_T rhozero, tempzero, r_d, c_d, adv_vel, radvort REAL_T den1,den2,vel1,vel2,delta0,xlev1,zlev1,amag,freq(10),mag(10) REAL_T f_problo(SDIM), f_probhi(SDIM) integer probtype, adv_dir, axis_dir common /probdt1/ probtype, adv_dir, axis_dir common /probdt2/ den1,den2,vel1,vel2,delta0, & xlev1,zlev1,freq,mag common /probdt3/ vorterr, adverr, denerr, temperr common /probdt4/ denfact, xblob, yblob, zblob, radvort, & radblob, velfact, randfact, bubgrad common /probdt5/ rhozero, tempzero, r_d, c_d, adv_vel common /probdt6/f_problo, f_probhi ccseapps-2.5/CCSEApps/iamrlib/run2d/inputs.2d.periodic_shear_layer0000644000175000017500000001046311634153073026260 0ustar amckinstryamckinstry#******************************************************************************* # INPUTS.2D.SPIN #******************************************************************************* #NOTE: You may set *either* max_step or stop_time, or you may set them both. # Maximum number of coarse grid timesteps to be taken, if stop_time is # not reached first. max_step = 50 # Time at which calculation stops, if max_step is not reached first. stop_time = 10.0 #******************************************************************************* # Number of cells in each coordinate direction at the coarsest level amr.n_cell = 32 32 #******************************************************************************* # Maximum level (defaults to 0 for single level calculation) amr.max_level = 1 # maximum number of levels of refinement #******************************************************************************* # Interval (in number of level l timesteps) between regridding amr.regrid_int = 2 #******************************************************************************* # Refinement ratio as a function of level amr.ref_ratio = 2 2 #******************************************************************************* # Sets the "NavierStokes" code to be verbose ns.v = 1 #******************************************************************************* # Sets the "amr" code to be verbose amr.v = 1 #******************************************************************************* # Interval (in number of coarse timesteps) between checkpoint(restart) files amr.check_int = 10 #******************************************************************************* # Interval (in number of coarse timesteps) between plot files amr.plot_int = 10 #******************************************************************************* # CFL number to be used in calculating the time step : dt = dx / max(velocity) ns.cfl = 0.9 # CFL number used to set dt #******************************************************************************* # Factor by which the first time is shrunk relative to CFL constraint ns.init_shrink = 1.0 # factor which multiplies the very first time step #******************************************************************************* # Viscosity coefficient ns.vel_visc_coef = 0.001 #******************************************************************************* # Diffusion coefficient for first scalar ns.scal_diff_coefs = 0.0 #******************************************************************************* # Forcing term defaults to rho * abs("gravity") "down" ns.gravity = 0.0 #******************************************************************************* # Name of the file which specifies problem-specific parameters (defaults to "probin") amr.probin_file = probin.2d.periodic_shear_layer #******************************************************************************* # Set to 0 if x-y coordinate system, set to 1 if r-z. geometry.coord_sys = 0 #******************************************************************************* # Physical dimensions of the low end of the domain. geometry.prob_lo = 0. 0. # Physical dimensions of the high end of the domain. geometry.prob_hi = 1. 1. #******************************************************************************* #Set to 1 if periodic in that direction geometry.is_periodic = 1 1 #******************************************************************************* # Boundary conditions on the low end of the domain. ns.lo_bc = 0 0 # Boundary conditions on the high end of the domain. ns.hi_bc = 0 0 # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall #******************************************************************************* # Factor by which grids must be coarsenable. amr.blocking_factor = 4 #******************************************************************************* # Add vorticity to the variables in the plot files. amr.derive_plot_vars = mag_vort #******************************************************************************* # Grid efficiency (defaults to .70) amr.grid_eff = 0.75 #******************************************************************************* ccseapps-2.5/CCSEApps/iamrlib/run2d/.cvsignore0000644000175000017500000000023411634153073022327 0ustar amckinstryamckinstry*.for Debug Debug3D Release Release3D *.ncb *.opt *.plg grdlog bl3_prof bl3_prof.m ti_files chk[0-9][0-9][0-9][0-9] plt[0-9][0-9][0-9][0-9] *.pixie *.Addrs ccseapps-2.5/CCSEApps/iamrlib/run2d/README.2D0000644000175000017500000000516711634153073021465 0ustar amckinstryamckinstry Included in this run2d directory are two sample inputs files, inputs.2d.periodic_shear_layer and inputs.2d.drop. Also included are the accompanying "probin" files, which supply problem-dependent paramters for each. These are probin.2d.periodic_shear_layer probin.2d.drop, respectively. There are a large number of options which can be specified from the inputs and probin files, as well as significant changes which can be made with relatively small changes to the program files, especially PROB_2D.F and NS_setup.cpp. Most of the options which can be specified from the inputs files are left to their default values in the two sample calculations. This code is a research code, and is continually being modified and improved as our needs evolve. Because the list of options is so extensive, and the updates relatively frequent, we heartily encourage you to contact us directly (email to ASAlmgren@lbl.gov) if you want to modify the code supplied here for your own calculations. There is extensive but undocumented capability. That said, we welcome your comments, suggestions, and other feedback. Again, email to ASALmgren@lbl.gov. The first test case is a periodic shear layer in a constant density fluid. The inputs file is set up for the calculation to run 50 coarse time steps, and to allow one level of refinement with factor 2. The refinement criteria are the presence of a tracer and the magnitude of vorticity. In the PlotFiles/Periodic_Shear_Layer directory, you will find five plotfiles which are generated if you run the code with this inputs file. Run amrvis2d on any of these to view the results. (We have included "amrvis.defaults" and "Palette" files as well.) The second test case is a falling drop in a closed box with a density of twice the surrounding medium. Again the calculation allows one level of factor 2 refinement, and is set up to run 50 coarse time steps. The plot files generated with inputs.2d.drop are in PlotFiles/Drop, and again can be viewed with amrvis2d. Here the refinement criteria are again vorticity and the presence of the tracer, which coincides initially with the heavy drop. As a starting point for code changes: the initial data are specified in PROB_2D.F. We have included several different subroutines for defining different intial data. The variable "probtype," set in the probin file, selects between these subroutines. You may also, of course, write your own by modifying PROB_2D.F. The criteria used for error estimation are specified in NS_setup.cpp, and can depend on any or all of the state variables or derived quantities. The derived quantities are also specified in NS_setup.cpp. ccseapps-2.5/CCSEApps/iamrlib/run2d/PlotFiles/0000755000175000017500000000000011634153073022231 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/run2d/PlotFiles/Drop/0000755000175000017500000000000011634153073023135 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/run2d/PlotFiles/Drop/amrvis.defaults0000644000175000017500000000036711634153073026175 0ustar amckinstryamckinstrypalette Palette initialderived density initialscale 4 numberformat %8.6e maxpixmapsize 1000000 reservesystemcolors 35 showboxes TRUE windowheight 650 windowwidth 1100 ccseapps-2.5/CCSEApps/iamrlib/run2d/PlotFiles/Drop/Palette0000644000175000017500000000140011634153073024451 0ustar amckinstryamckinstry #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúöñíéäàÛ×ÓÎÊÅÁ½¸´¯«§¢ž™•‘Œˆƒ #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ccseapps-2.5/CCSEApps/iamrlib/run2d/PlotFiles/Periodic/0000755000175000017500000000000011634153073023767 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/run2d/PlotFiles/Periodic/amrvis.defaults0000644000175000017500000000037011634153073027021 0ustar amckinstryamckinstrypalette Palette initialderived mag_vort initialscale 4 numberformat %8.6e maxpixmapsize 1000000 reservesystemcolors 35 showboxes TRUE windowheight 650 windowwidth 1100 ccseapps-2.5/CCSEApps/iamrlib/run2d/PlotFiles/Periodic/Palette0000644000175000017500000000140011634153073025303 0ustar amckinstryamckinstry #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúöñíéäàÛ×ÓÎÊÅÁ½¸´¯«§¢ž™•‘Œˆƒ #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ccseapps-2.5/CCSEApps/iamrlib/run2d/inputs.2d.bubble0000644000175000017500000001050711634153073023336 0ustar amckinstryamckinstry#******************************************************************************* # INPUTS.2D.BUBBLE #******************************************************************************* #NOTE: You may set *either* max_step or stop_time, or you may set them both. # Maximum number of coarse grid timesteps to be taken, if stop_time is # not reached first. max_step = 50 # Time at which calculation stops, if max_step is not reached first. stop_time = 1.0 #******************************************************************************* # Number of cells in each coordinate direction at the coarsest level amr.n_cell = 16 32 #******************************************************************************* # Maximum level (defaults to 0 for single level calculation) amr.max_level = 1 # maximum number of levels of refinement #******************************************************************************* # Interval (in number of level l timesteps) between regridding amr.regrid_int = 2 #******************************************************************************* # Refinement ratio as a function of level amr.ref_ratio = 2 2 #******************************************************************************* # Sets the "NavierStokes" code to be verbose ns.v = 1 #******************************************************************************* # Sets the "amr" code to be verbose amr.v = 1 #******************************************************************************* # Interval (in number of coarse timesteps) between checkpoint(restart) files amr.check_int = 10 #******************************************************************************* # Interval (in number of coarse timesteps) between plot files amr.plot_int = 2 #******************************************************************************* # CFL number to be used in calculating the time step : dt = dx / max(velocity) ns.cfl = 0.9 # CFL number used to set dt #******************************************************************************* # Factor by which the first time is shrunk relative to CFL constraint ns.init_shrink = 0.3 # factor which multiplies the very first time step #******************************************************************************* # Viscosity coefficient ns.vel_visc_coef = 0.001 #******************************************************************************* # Diffusion coefficient for first scalar ns.scal_diff_coefs = 0.0 #******************************************************************************* # Forcing term defaults to rho * abs(gravity) "down" ns.gravity = 9.8 #******************************************************************************* # Name of the file which specifies problem-specific parameters (defaults to "probin") amr.probin_file = probin.2d.bubble #******************************************************************************* # Set to 0 if x-y coordinate system, set to 1 if r-z. geometry.coord_sys = 1 #******************************************************************************* # Physical dimensions of the low end of the domain. geometry.prob_lo = 0. 0. # Physical dimensions of the high end of the domain. geometry.prob_hi = 1. 2. #******************************************************************************* #Set to 1 if periodic in that direction geometry.is_periodic = 0 0 #******************************************************************************* # Boundary conditions on the low end of the domain. ns.lo_bc = 3 4 # Boundary conditions on the high end of the domain. ns.hi_bc = 4 4 # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall #******************************************************************************* # For solver reasons, use multigrid iterations as the bottom solve. mg_usecg = 0 #******************************************************************************* # Factor by which grids must be coarsenable. amr.blocking_factor = 4 #******************************************************************************* # Add vorticity to the variables in the plot files. amr.derive_plot_vars = mag_vort #******************************************************************************* ccseapps-2.5/CCSEApps/iamrlib/Diffusion.cpp0000644000175000017500000026560711634153073021750 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Diffusion.cpp,v 1.121 2003/03/10 23:07:39 lijewski Exp $ // // // Comment out this line to use diffusion class outside // the context of NavierStokes and classes derived from it. // #include #define USE_NAVIERSTOKES 1 #include #include #include #include #include #include #include #include #ifdef USE_NAVIERSTOKES #include #endif #include #include #include #include #include #include #include #if defined(BL_OSF1) #if defined(BL_USE_DOUBLE) const Real BL_BOGUS = DBL_QNAN; #else const Real BL_BOGUS = FLT_QNAN; #endif #else const Real BL_BOGUS = 1.e200; #endif const Real BL_SAFE_BOGUS = -666.e200; // // Include files for tensor solve. // #include #include #include #include #include #ifdef MG_USE_HYPRE #include #endif #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); #define DEF_CLIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ const Real* fabdat = (fab).dataPtr(); #define GEOM_GROW 1 Array Diffusion::is_diffusive; Array Diffusion::visc_coef; Real Diffusion::visc_tol = 1.0e-10; // tolerance for viscous solve Real Diffusion::visc_abs_tol = 1.0e-10; // absolute tol. for visc solve int Diffusion::first = 1; int Diffusion::do_reflux = 1; int Diffusion::use_cg_solve = 0; namespace { bool use_hypre_solve = false; } int Diffusion::use_tensor_cg_solve = 0; bool Diffusion::use_mg_precond_flag = false; int Diffusion::verbose = 0; int Diffusion::max_order = 2; int Diffusion::tensor_max_order = 2; int Diffusion::scale_abec = 0; int Diffusion::est_visc_mag = 1; int Diffusion::Rhs_in_abs_tol = 0; Array Diffusion::typical_vals; const Real typical_vals_DEF = 1.0; Diffusion::Diffusion (Amr* Parent, AmrLevel* Caller, Diffusion* Coarser, int num_state, FluxRegister* Viscflux_reg, MultiFab& Volume, MultiFab* Area, const Array& _is_diffusive, const Array& _visc_coef) : parent(Parent), caller(Caller), grids(caller->boxArray()), level(caller->Level()), coarser(Coarser), finer(0), NUM_STATE(num_state), viscflux_reg(Viscflux_reg), volume(Volume), area(Area) { if (first) { first = 0; ParmParse ppdiff("diffuse"); ppdiff.query("v",verbose); ppdiff.query("use_cg_solve",use_cg_solve); #ifdef MG_USE_HYPRE ppdiff.query("use_hypre_solve", use_hypre_solve); #endif ppdiff.query("use_tensor_cg_solve",use_tensor_cg_solve); int use_mg_precond = 0; ppdiff.query("use_mg_precond",use_mg_precond); use_mg_precond_flag = (use_mg_precond ? true : false); ppdiff.query("max_order",max_order); ppdiff.query("tensor_max_order",tensor_max_order); ppdiff.query("scale_abec",scale_abec); ppdiff.query("est_visc_mag",est_visc_mag); ppdiff.query("Rhs_in_abs_tol",Rhs_in_abs_tol); ParmParse pp("ns"); pp.query("do_reflux",do_reflux); do_reflux = (do_reflux ? 1 : 0); pp.query("visc_tol",visc_tol); pp.query("visc_abs_tol",visc_abs_tol); const int n_visc = _visc_coef.size(); const int n_diff = _is_diffusive.size(); if (n_diff < NUM_STATE || n_visc < NUM_STATE) BoxLib::Abort("Diffusion::Diffusion(): is_diffusive and/or visc_coef arrays are not long enough"); visc_coef.resize(NUM_STATE); is_diffusive.resize(NUM_STATE); for (int i = 0; i < NUM_STATE; i++) { is_diffusive[i] = _is_diffusive[i]; visc_coef[i] = _visc_coef[i]; } // // Read in typical state sizes. // typical_vals.resize(NUM_STATE); for (int i = 0; i < NUM_STATE; i++) { typical_vals[i] = typical_vals_DEF; } int n_typical_vals = std::min(NUM_STATE, ppdiff.countval("typical_vals")); if (n_typical_vals > 0) { ppdiff.queryarr("typical_vals",typical_vals,0,n_typical_vals); } echo_settings(); } if (level > 0) { crse_ratio = parent->refRatio(level-1); coarser->finer = this; } } Diffusion::~Diffusion () {} FluxRegister* Diffusion::viscFluxReg () { return viscflux_reg; } Real Diffusion::get_scaled_abs_tol (int sigma, const MultiFab* rhs, Real a, Real b, const MultiFab* alpha, const MultiFab* const * beta, Real reduction) const { return get_scaled_abs_tol(sigma, rhs, a, b, alpha, beta, 0, reduction); } int Diffusion::maxOrder() const { return max_order; } int Diffusion::tensorMaxOrder() const { return tensor_max_order; } void Diffusion::echo_settings () const { // // Print out my settings. // if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "Diffusion settings...\n"; std::cout << " From diffuse:\n"; std::cout << " use_cg_solve = " << use_cg_solve << '\n'; std::cout << " use_tensor_cg_solve = " << use_tensor_cg_solve << '\n'; std::cout << " use_mg_precond_flag = " << use_mg_precond_flag << '\n'; std::cout << " max_order = " << max_order << '\n'; std::cout << " tensor_max_order = " << tensor_max_order << '\n'; std::cout << " scale_abec = " << scale_abec << '\n'; std::cout << " est_visc_mag = " << est_visc_mag << '\n'; std::cout << " Rhs_in_abs_tol = " << Rhs_in_abs_tol << '\n'; std::cout << " typical_vals ="; for (int i = 0; i boxArray()); for (MFIter Rhsmfi(*rhs); Rhsmfi.isValid(); ++Rhsmfi) { norm_est = std::max(norm_est,(*rhs)[Rhsmfi].norm(0)); } ParallelDescriptor::ReduceRealMax(norm_est); } BL_ASSERT(norm_est >= 0); return norm_est*reduction; } void Diffusion::diffuse_scalar (Real dt, int sigma, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, MultiFab* const* fluxn, MultiFab* const* fluxnp1, int dataComp, MultiFab* delta_rhs, const MultiFab* alpha, const MultiFab* const* betan, const MultiFab* const* betanp1, const SolveMode& solve_mode) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::diffuse_scalar()"); // // This routine expects that physical BC's have been loaded into // the grow cells of the old and new state at this level. If rho_flag==2, // the values there are rho.phi, where phi is the quantity being diffused. // Values in these cells will be preserved. Also, if there are any // explicit update terms, these have already incremented the new state // on the valid region (i.e., on the valid region the new state is the old // state + dt*Div(explicit_fluxes), e.g.) // NavierStokes& ns = *(NavierStokes*) &(parent->getLevel(level)); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "... diffusing scalar: " << caller->get_desc_lst()[State_Type].name(sigma) << '\n'; int allnull, allthere; checkBetas(betan, betanp1, allthere, allnull); BL_ASSERT(solve_mode==ONEPASS || (delta_rhs && delta_rhs->boxArray()==grids)); const int finest_level = parent->finestLevel(); // // At this point, S_old has bndry at time N, S_new has bndry at time N+1 // MultiFab& S_old = caller->get_old_data(State_Type); MultiFab& S_new = caller->get_new_data(State_Type); MultiFab Rhs(grids,1,0); MultiFab Soln(grids,1,1); { // // Set up Rhs. // const Real a = 0.0; Real b = -(1.0-be_cn_theta)*dt; if (allnull) b *= visc_coef[sigma]; ViscBndry visc_bndry; const Real prev_time = caller->get_state_data(State_Type).prevTime(); ABecLaplacian* visc_op = getViscOp(sigma,a,b,prev_time,visc_bndry, rho_half,rho_flag,0,dataComp,betan); visc_op->maxOrder(max_order); // // Copy to single-component multifab, then apply op to rho-scaled state // MultiFab::Copy(Soln,S_old,sigma,0,1,0); if (rho_flag == 2) for (MFIter Smfi(Soln); Smfi.isValid(); ++Smfi) Soln[Smfi].divide(S_old[Smfi],Smfi.validbox(),Density,0,1); visc_op->apply(Rhs,Soln); visc_op->compFlux(D_DECL(*fluxn[0],*fluxn[1],*fluxn[2]),Soln,LinOp::Inhomogeneous_BC,false); for (int i = 0; i < BL_SPACEDIM; ++i) (*fluxn[i]).mult(-b/(dt*caller->Geom().CellSize()[i])); delete visc_op; // // If this is a predictor step, put "explicit" updates passed via S_new // into delta_rhs after scaling by rho_half if reqd, so they dont get lost, // pull it off S_new to avoid double counting // (for rho_flag == 1: // S_new = S_old - dt.(U.Grad(phi)); want Rhs -= rho_half.(U.Grad(phi)), // else // S_new = S_old - dt.Div(U.Phi), want Rhs -= Div(U.Phi) ) // FArrayBox tmpfab; if (solve_mode == PREDICTOR) { for (MFIter Smfi(S_new); Smfi.isValid(); ++Smfi) { const Box& box = Smfi.validbox(); tmpfab.resize(box,1); tmpfab.copy(S_new[Smfi],box,sigma,box,0,1); tmpfab.minus(S_old[Smfi],box,sigma,0,1); S_new[Smfi].minus(tmpfab,box,0,sigma,1); // Remove this term from S_new tmpfab.mult(1.0/dt,box,0,1); if (rho_flag == 1) tmpfab.mult((*rho_half)[Smfi],box,0,0,1); if (alpha!=0) tmpfab.mult((*alpha)[Smfi],box,dataComp,0,1); (*delta_rhs)[Smfi].plus(tmpfab,box,0,dataComp,1); } } // // Add body sources // if (delta_rhs != 0) { for (MFIter mfi(*delta_rhs); mfi.isValid(); ++mfi) { const Box& box = mfi.validbox(); tmpfab.resize(box,1); tmpfab.copy((*delta_rhs)[mfi],box,dataComp,box,0,1); tmpfab.mult(dt,box,0,1); tmpfab.mult(volume[mfi],box,0,0,1); Rhs[mfi].plus(tmpfab,box,0,0,1); } } // // Add hoop stress for x-velocity in r-z coordinates // Note: we have to add hoop stress explicitly because the hoop // stress which is added through the operator in getViscOp // is eliminated by setting a = 0. // #if (BL_SPACEDIM == 2) if (sigma == Xvel && CoordSys::IsRZ()) { Array rcen; for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { const int i = Rhsmfi.index(); const Box& bx = Rhsmfi.validbox(); Box sbx = BoxLib::grow(S_old.box(i),S_old.nGrow()); Box vbox = BoxLib::grow(volume.box(i),volume.nGrow()); rcen.resize(bx.length(0)); parent->Geom(level).GetCellLoc(rcen, bx, 0); const int* lo = bx.loVect(); const int* hi = bx.hiVect(); const int* slo = sbx.loVect(); const int* shi = sbx.hiVect(); Real* rhs = Rhs[Rhsmfi].dataPtr(); const Real* sdat = S_old[Rhsmfi].dataPtr(sigma); const Real* rcendat = rcen.dataPtr(); const Real coeff = (1.0-be_cn_theta)*visc_coef[sigma]*dt; const Real* voli = volume[Rhsmfi].dataPtr(); const int* vlo = vbox.loVect(); const int* vhi = vbox.hiVect(); FORT_HOOPRHS(rhs, ARLIM(lo), ARLIM(hi), sdat, ARLIM(slo), ARLIM(shi), rcendat, &coeff, voli, ARLIM(vlo),ARLIM(vhi)); } } #endif // // Increment Rhs with S_old*V (or S_old*V*rho_half if rho_flag==1 // or S_old*V*rho_old if rho_flag==3) // (Note: here S_new holds S_old, but also maybe an explicit increment // from advection if solve_mode != PREDICTOR) // MultiFab::Copy(Soln,S_new,sigma,0,1,0); for (MFIter mfi(Soln); mfi.isValid(); ++mfi) { const Box& box = mfi.validbox(); Soln[mfi].mult(volume[mfi],box,0,0,1); if (rho_flag == 1) Soln[mfi].mult((*rho_half)[mfi],box,0,0,1); if (rho_flag == 3) Soln[mfi].mult((*ns.rho_ptime)[mfi],box,0,0,1); if (alpha!=0) Soln[mfi].mult((*alpha)[mfi],box,dataComp,0,1); Rhs[mfi].plus(Soln[mfi],box,0,0,1); } } // // Construct viscous operator with bndry data at time N+1. // const Real a = 1.0; Real b = be_cn_theta*dt; if (allnull) b *= visc_coef[sigma]; ViscBndry visc_bndry; const Real cur_time = caller->get_state_data(State_Type).curTime(); Real rhsscale = 1.0; ABecLaplacian* visc_op = getViscOp(sigma,a,b,cur_time,visc_bndry,rho_half, rho_flag,&rhsscale,dataComp,betanp1, alpha); Rhs.mult(rhsscale,0,1); visc_op->maxOrder(max_order); // // Make a good guess for Soln // MultiFab::Copy(Soln,S_new,sigma,0,1,0); if (rho_flag == 2) for (MFIter Smfi(Soln); Smfi.isValid(); ++Smfi) Soln[Smfi].divide(S_new[Smfi],Smfi.validbox(),Density,0,1); // // Construct solver and call it. // const Real S_tol = visc_tol; #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA const Real S_tol_abs = -1.0; #else const Real S_tol_abs = get_scaled_abs_tol(sigma, &Rhs, a, b, alpha, betan, betanp1, visc_abs_tol); #endif if (use_cg_solve) { CGSolver cg(*visc_op,use_mg_precond_flag); cg.solve(Soln,Rhs,S_tol,S_tol_abs); } else if ( use_hypre_solve ) { #ifdef MG_USE_HYPRE BoxLib::Error("HypreABec not ready"); Real* dx = 0; HypreABec hp(Soln.boxArray(), visc_bndry, dx, 0, false); hp.setup_solver(S_tol, S_tol_abs, 50); hp.solve(Soln, Rhs, true); hp.clear_solver(); #else BoxLib::Error("HypreABec not in this build"); #endif } else { MultiGrid mg(*visc_op); mg.solve(Soln,Rhs,S_tol,S_tol_abs); } // // Get extensivefluxes from new-time op // visc_op->compFlux(D_DECL(*fluxnp1[0],*fluxnp1[1],*fluxnp1[2]),Soln); for (int i = 0; i < BL_SPACEDIM; ++i) (*fluxnp1[i]).mult(b/(dt*caller->Geom().CellSize()[i])); delete visc_op; // // Copy into state variable at new time, without bc's // MultiFab::Copy(S_new,Soln,0,sigma,1,0); if (rho_flag == 2) for (MFIter Smfi(S_new); Smfi.isValid(); ++Smfi) S_new[Smfi].mult(S_new[Smfi],Smfi.validbox(),Density,sigma,1); } void Diffusion::diffuse_velocity (Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, MultiFab* delta_rhs, const MultiFab* const* betan, const MultiFab* const* betanp1) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::diffuse_velocity()"); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "... diffuse_velocity\n"; int allnull, allthere; checkBetas(betan, betanp1, allthere, allnull); BL_ASSERT( rho_flag == 1 || rho_flag == 3); #ifndef NDEBUG for (int d = 0; d < BL_SPACEDIM; ++d) BL_ASSERT(allnull ? visc_coef[Xvel+d]>=0 : betan[d]->min(0,0) >= 0.0); #endif if (allnull) { MultiFab* *fluxSCn; MultiFab* *fluxSCnp1; const int nGrow = 0; const int nComp = 1; allocFluxBoxesLevel(fluxSCn, nGrow,nComp); allocFluxBoxesLevel(fluxSCnp1,nGrow,nComp); for (int sigma = 0; sigma < BL_SPACEDIM; ++sigma) { const int state_ind = Xvel + sigma; diffuse_scalar(dt,state_ind,be_cn_theta,rho_half,rho_flag, fluxSCn,fluxSCnp1,sigma,delta_rhs); if (do_reflux) { FArrayBox fluxtot; for (int d = 0; d < BL_SPACEDIM; ++d) { for (MFIter fmfi(*fluxSCn[d]); fmfi.isValid(); ++fmfi) { const Box& ebox = (*fluxSCn[d])[fmfi].box(); fluxtot.resize(ebox,nComp); fluxtot.copy((*fluxSCn[d])[fmfi],ebox,0,ebox,0,nComp); fluxtot.plus((*fluxSCnp1[d])[fmfi],ebox,0,0,nComp); if (level < parent->finestLevel()) finer->viscflux_reg->CrseInit(fluxtot,ebox, d,0,sigma,nComp,-dt); if (level > 0) viscflux_reg->FineAdd(fluxtot,d,fmfi.index(), 0,sigma,nComp,dt); } } if (level < parent->finestLevel()) finer->viscflux_reg->CrseInitFinish(); } } removeFluxBoxesLevel(fluxSCn); removeFluxBoxesLevel(fluxSCnp1); } else { diffuse_tensor_velocity(dt,be_cn_theta,rho_half,rho_flag, delta_rhs,betan,betanp1); } } void Diffusion::diffuse_tensor_velocity (Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, MultiFab* delta_rhs, const MultiFab* const* betan, const MultiFab* const* betanp1) { BL_ASSERT(rho_flag == 1 || rho_flag == 3); const int finest_level = parent->finestLevel(); NavierStokes& ns = *(NavierStokes*) &(parent->getLevel(level)); // // At this point, S_old has bndry at time N S_new contains GRAD(SU). // MultiFab& U_old = caller->get_old_data(State_Type); MultiFab& U_new = caller->get_new_data(State_Type); const Real cur_time = caller->get_state_data(State_Type).curTime(); const Real prev_time = caller->get_state_data(State_Type).prevTime(); const int dComp = 0; // FIXME: Start comp for data: dR, betas, should pass in int allnull, allthere; checkBetas(betan, betanp1, allthere, allnull); // // U_new now contains the inviscid update of U. // This is part of the RHS for the viscous solve. // MultiFab Rhs(grids,BL_SPACEDIM,0); Rhs.setVal(0.0); MultiFab** tensorflux_old; { // // Set up Rhs. // const int soln_old_grow = 1; MultiFab Soln_old(grids,BL_SPACEDIM,soln_old_grow); const Real a = 0.0; Real b = -(1.0-be_cn_theta)*dt; if (allnull) b *= visc_coef[Xvel]; ViscBndryTensor visc_bndry; const MultiFab* rho = (rho_flag == 1) ? rho_half : ns.rho_ptime; DivVis* tensor_op = getTensorOp(a,b,prev_time,visc_bndry,rho,dComp,betan); tensor_op->maxOrder(tensor_max_order); // // Copy to single-component multifab. Use Soln as a temporary here. // MultiFab::Copy(Soln_old,U_old,Xvel,0,BL_SPACEDIM,0); tensor_op->apply(Rhs,Soln_old); if (do_reflux && (level0)) { allocFluxBoxesLevel(tensorflux_old,0,BL_SPACEDIM); tensor_op->compFlux(D_DECL(*(tensorflux_old[0]), *(tensorflux_old[1]), *(tensorflux_old[2])),Soln_old); for (int d = 0; d < BL_SPACEDIM; d++) tensorflux_old[d]->mult(-b/(dt*caller->Geom().CellSize()[d]),0); } delete tensor_op; for (int comp = 0; comp < BL_SPACEDIM; comp++) { int sigma = Xvel + comp; // // Complete Rhs by adding body sources. // for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { BL_ASSERT(grids[Rhsmfi.index()] == Rhsmfi.validbox()); // // Scale inviscid part by volume. // U_new[Rhsmfi].mult(volume[Rhsmfi],Rhsmfi.validbox(),0,sigma,1); // // Multiply by density at time nph (if rho_flag==1) // or time n (if rho_flag==3). // if (rho_flag == 1) { const FArrayBox& Rh = (*rho_half)[Rhsmfi]; U_new[Rhsmfi].mult(Rh,Rhsmfi.validbox(),0,sigma,1); } if (rho_flag == 3) { FArrayBox& Rh = (*ns.rho_ptime)[Rhsmfi.index()]; U_new[Rhsmfi].mult(Rh,Rhsmfi.validbox(),0,sigma,1); } // // Add to Rhs which contained operator applied to U_old. // Rhs[Rhsmfi].plus(U_new[Rhsmfi],Rhsmfi.validbox(),sigma,comp,1); } if (delta_rhs != 0) { for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { BL_ASSERT(grids[Rhsmfi.index()] == Rhsmfi.validbox()); (*delta_rhs)[Rhsmfi].mult(dt,comp+dComp,1); (*delta_rhs)[Rhsmfi].mult(volume[Rhsmfi],Rhsmfi.validbox(),0,comp+dComp,1); Rhs[Rhsmfi].plus((*delta_rhs)[Rhsmfi],Rhsmfi.validbox(),comp+dComp,comp,1); } } } #if (BL_SPACEDIM == 2) if (CoordSys::IsRZ()) { int fort_xvel_comp = Xvel+1; for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { const int i = Rhsmfi.index(); const Box& bx = Rhsmfi.validbox(); Box sbx = BoxLib::grow(U_old.box(i),U_old.nGrow()); Array rcen(bx.length(0)); parent->Geom(level).GetCellLoc(rcen, bx, 0); const int* lo = bx.loVect(); const int* hi = bx.hiVect(); const int* slo = sbx.loVect(); const int* shi = sbx.hiVect(); Real* rhs = Rhs[Rhsmfi].dataPtr(); const Real* sdat = U_old[Rhsmfi].dataPtr(Xvel); const Real* rcendat = rcen.dataPtr(); const Real coeff = (1.0-be_cn_theta)*dt; const Real* voli = volume[Rhsmfi].dataPtr(); Box vbox = BoxLib::grow(volume.box(i),volume.nGrow()); const int* vlo = vbox.loVect(); const int* vhi = vbox.hiVect(); const FArrayBox& betax = (*betanp1[0])[Rhsmfi]; const int* betax_lo = betax.loVect(); const int* betax_hi = betax.hiVect(); const Real* betax_dat = betax.dataPtr(dComp); const FArrayBox& betay = (*betanp1[1])[Rhsmfi]; const int* betay_lo = betay.loVect(); const int* betay_hi = betay.hiVect(); const Real* betay_dat = betay.dataPtr(dComp); FORT_TENSOR_HOOPRHS(&fort_xvel_comp, rhs, ARLIM(lo), ARLIM(hi), sdat, ARLIM(slo), ARLIM(shi), rcendat, &coeff, voli, ARLIM(vlo), ARLIM(vhi), betax_dat,ARLIM(betax_lo),ARLIM(betax_hi), betay_dat,ARLIM(betay_lo),ARLIM(betay_hi)); } } #endif } const int soln_grow = 1; MultiFab Soln(grids,BL_SPACEDIM,soln_grow); Soln.setVal(0.0); // // Compute guess of solution. // if (level == 0) { MultiFab::Copy(Soln,U_old,Xvel,0,BL_SPACEDIM,0); } else { caller->FillCoarsePatch(Soln,0,cur_time,State_Type,Xvel,BL_SPACEDIM); } // // Copy guess into U_new. // // The new-time operator is initialized with a "guess" for the new-time // state. We intentionally initialize the grow cells with a bogus // value to emphasize that the values are not to be considered "valid" // (we shouldn't specify any grow cell information), but rather are to // filled by the "physics bc's, etc" in the problem-dependent code. In // the course of this filling (typically while generating/filling the // BndryData object for the solvers), StateData::filcc is called to get // physical bc's. Here 'something computable' has to already exist in // the grow cells (even though filcc ultimately will fill the corner // correctly, if applicable). This is apparently where the // `something computable' is to be set. // int n_comp = BL_SPACEDIM; int n_ghost = 1; U_new.setVal(BL_SAFE_BOGUS,Xvel,n_comp,n_ghost); n_ghost = 0; U_new.copy(Soln,0,Xvel,n_comp); // // Construct viscous operator with bndry data at time N+1. // const Real a = 1.0; Real b = be_cn_theta*dt; if (allnull) b *= visc_coef[Xvel]; ViscBndryTensor visc_bndry; const MultiFab* rho = (rho_flag == 1) ? rho_half : ns.rho_ctime; DivVis* tensor_op = getTensorOp(a,b,cur_time,visc_bndry,rho,dComp,betanp1); tensor_op->maxOrder(tensor_max_order); const MultiFab* alpha = &(tensor_op->aCoefficients()); // // Construct solver and call it. // const Real S_tol = visc_tol; #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA const Real S_tol_abs = -1; #else const Real S_tol_abs = get_scaled_abs_tol(Xvel, &Rhs, a, b, alpha, betan, betanp1, visc_abs_tol); #endif if (use_tensor_cg_solve) { const int use_mg_pre = 0; MCCGSolver cg(*tensor_op,use_mg_pre); cg.solve(Soln,Rhs,S_tol,S_tol_abs); } else { MCMultiGrid mg(*tensor_op); mg.solve(Soln,Rhs,S_tol,S_tol_abs); } int visc_op_lev = 0; tensor_op->applyBC(Soln,visc_op_lev); // This may not be needed. // // Copy into state variable at new time. // n_ghost = soln_grow; MultiFab::Copy(U_new,Soln,0,Xvel,n_comp,n_ghost); // // Modify diffusive fluxes here. // if (do_reflux && (level0)) { MultiFab** tensorflux; allocFluxBoxesLevel(tensorflux,0,BL_SPACEDIM); tensor_op->compFlux(D_DECL(*(tensorflux[0]), *(tensorflux[1]), *(tensorflux[2])),Soln); for (int d = 0; d < BL_SPACEDIM; d++) { tensorflux[d]->mult(b/(dt*caller->Geom().CellSize()[d]),0); tensorflux[d]->plus(*(tensorflux_old[d]),0,BL_SPACEDIM,0); } removeFluxBoxesLevel(tensorflux_old); FArrayBox xflux, yflux, zflux; for (int sigma = Xvel; sigma < BL_SPACEDIM+Xvel; sigma++) { for (MFIter tensorflux0mfi(*(tensorflux[0])); tensorflux0mfi.isValid(); ++tensorflux0mfi) { const int i = tensorflux0mfi.index(); const Box& grd = BoxLib::enclosedCells(tensorflux0mfi.validbox()); BL_ASSERT(grd == grids[tensorflux0mfi.index()]); const int* lo = grd.loVect(); const int* hi = grd.hiVect(); Box xflux_bx(grd); xflux_bx.surroundingNodes(0); xflux.resize(xflux_bx,1); xflux.copy((*(tensorflux[0]))[i],sigma,0,1); Box yflux_bx(grd); yflux_bx.surroundingNodes(1); yflux.resize(yflux_bx,1); yflux.copy((*(tensorflux[1]))[i],sigma,0,1); #if (BL_SPACEDIM == 3) Box zflux_bx(grd); zflux_bx.surroundingNodes(2); zflux.resize(zflux_bx,1); zflux.copy((*(tensorflux[2]))[i],sigma,0,1); #endif if (level < finest_level) { FluxRegister& fr = *finer->viscflux_reg; D_TERM(fr.CrseInit(xflux,xflux_bx,0,0,sigma,1,-dt);, fr.CrseInit(yflux,yflux_bx,1,0,sigma,1,-dt);, fr.CrseInit(zflux,zflux_bx,2,0,sigma,1,-dt);); } if (level > 0) { D_TERM(viscflux_reg->FineAdd(xflux,0,i,0,sigma,1,dt);, viscflux_reg->FineAdd(yflux,1,i,0,sigma,1,dt);, viscflux_reg->FineAdd(zflux,2,i,0,sigma,1,dt);); } } if (level < finest_level) { finer->viscflux_reg->CrseInitFinish(); } } removeFluxBoxesLevel(tensorflux); } delete tensor_op; } void Diffusion::diffuse_Vsync (MultiFab* Vsync, Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, const MultiFab* const* beta) { BL_ASSERT(rho_flag == 1|| rho_flag == 3); int allnull, allthere; checkBeta(beta, allthere, allnull); #ifndef NDEBUG for (int d = 0; d < BL_SPACEDIM; ++d) BL_ASSERT(allnull ? visc_coef[Xvel+d]>=0 : beta[d]->min(0,0) >= 0.0); #endif if (allnull) diffuse_Vsync_constant_mu(Vsync,dt,be_cn_theta,rho_half,rho_flag); else diffuse_tensor_Vsync(Vsync,dt,be_cn_theta,rho_half,rho_flag,beta); // // applyBC has put "incorrect" values in the ghost cells // outside external Dirichlet boundaries. Reset these to zero // so that syncproject and conservative interpolation works correctly. // Box domain = BoxLib::grow(caller->Geom().Domain(),1); for (int n = Xvel; n < Xvel+BL_SPACEDIM; n++) { const BCRec& velbc = caller->get_desc_lst()[State_Type].getBC(n); for (int k = 0; k < BL_SPACEDIM; k++) { if (velbc.hi(k) == EXT_DIR) { IntVect smallend = domain.smallEnd(); smallend.setVal(k,domain.bigEnd(k)); Box top_strip(smallend,domain.bigEnd(),IntVect::TheCellVector()); Vsync->setVal(0.0,top_strip,n-Xvel,1,1); } if (velbc.lo(k) == EXT_DIR) { IntVect bigend = domain.bigEnd(); bigend.setVal(k,domain.smallEnd(k)); Box bottom_strip(domain.smallEnd(),bigend,IntVect::TheCellVector()); Vsync->setVal(0.0,bottom_strip,n-Xvel,1,1); } } } } void Diffusion::diffuse_Vsync_constant_mu (MultiFab* Vsync, Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag) { if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Diffusion::diffuse_Vsync_constant_mu ...\n"; NavierStokes& ns = *(NavierStokes*) &(parent->getLevel(level)); const Real* dx = caller->Geom().CellSize(); const int IOProc = ParallelDescriptor::IOProcessorNumber(); // // At this point in time we can only do decoupled scalar // so we loop over components. // for (int comp = 0; comp < BL_SPACEDIM; comp++) { MultiFab Soln(grids,1,1); MultiFab Rhs(grids,1,0); Soln.setVal(0); MultiFab::Copy(Rhs,*Vsync,comp,0,1,0); if (verbose > 1) { Real r_norm = 0.0; for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { r_norm = std::max(r_norm,Rhs[Rhsmfi].norm(0)); } ParallelDescriptor::ReduceRealMax(r_norm,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "Original max of Vsync " << r_norm << '\n'; } // // Multiply RHS by volume and density. // const MultiFab* rho = (rho_flag == 1) ? rho_half : ns.rho_ctime; for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { Rhs[Rhsmfi].mult(volume[Rhsmfi]); Rhs[Rhsmfi].mult((*rho)[Rhsmfi]); } // // SET UP COEFFICIENTS FOR VISCOUS SOLVER. // const Real a = 1.0; const Real b = be_cn_theta*dt*visc_coef[comp]; Real rhsscale = 1.0; ABecLaplacian* visc_op = getViscOp(comp,a,b,rho,rho_flag,&rhsscale); visc_op->maxOrder(max_order); Rhs.mult(rhsscale,0,1); // // Construct solver and call it. // const Real S_tol = visc_tol; const MultiFab* alpha = &(visc_op->aCoefficients()); #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA const Real S_tol_abs = -1; #else MultiFab const* betan[BL_SPACEDIM]; MultiFab const* betanp1[BL_SPACEDIM]; for (int d = 0; d < BL_SPACEDIM; d++) { betan[d] = &visc_op->bCoefficients(d); betanp1[d] = betan[d]; } const Real S_tol_abs = get_scaled_abs_tol(comp, &Rhs, a, b, alpha, betan, betanp1, visc_abs_tol); #endif if (use_cg_solve) { CGSolver cg(*visc_op,use_mg_precond_flag); cg.solve(Soln,Rhs,S_tol,S_tol_abs); } else if ( use_hypre_solve ) #ifdef MG_USE_HYPRE { BoxLib::Error("HypreABec not ready"); // Real* dx = 0; // HypreABec hp(Soln.boxArray(), visc_bndry, dx, 0, false); // hp.setup_solver(S_tol, S_tol_abs, 50); // hp.solve(Soln, Rhs, true); // hp.clear_solver(); } #else BoxLib::Error("HypreABec not in this build"); #endif else { MultiGrid mg(*visc_op); mg.solve(Soln,Rhs,S_tol,S_tol_abs); } int visc_op_lev = 0; visc_op->applyBC(Soln,0,1,visc_op_lev); MultiFab::Copy(*Vsync,Soln,0,comp,1,1); if (verbose > 1) { Real s_norm = 0.0; for (MFIter Solnmfi(Soln); Solnmfi.isValid(); ++Solnmfi) { s_norm = std::max(s_norm,Soln[Solnmfi].norm(0)); } ParallelDescriptor::ReduceRealMax(s_norm,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "Final max of Vsync " << s_norm << '\n'; } delete visc_op; FArrayBox xflux, yflux; if (level > 0) { for (MFIter Vsyncmfi(*Vsync); Vsyncmfi.isValid(); ++Vsyncmfi) { BL_ASSERT(grids[Vsyncmfi.index()] == Vsyncmfi.validbox()); const int i = Vsyncmfi.index(); const Box& grd = Vsyncmfi.validbox(); const int* lo = grd.loVect(); const int* hi = grd.hiVect(); FArrayBox& u_sync = (*Vsync)[i]; const int* ulo = u_sync.loVect(); const int* uhi = u_sync.hiVect(); Box xflux_bx(grd); xflux_bx.surroundingNodes(0); xflux.resize(xflux_bx,1); DEF_LIMITS(xflux,xflux_dat,xflux_lo,xflux_hi); Box yflux_bx(grd); yflux_bx.surroundingNodes(1); yflux.resize(yflux_bx,1); DEF_LIMITS(yflux,yflux_dat,yflux_lo,yflux_hi); const FArrayBox& xarea = (area[0])[i]; const FArrayBox& yarea = (area[1])[i]; DEF_CLIMITS(xarea,xarea_dat,xarea_lo,xarea_hi); DEF_CLIMITS(yarea,yarea_dat,yarea_lo,yarea_hi); // // The extra factor of dt comes from the fact that Vsync // looks like dV/dt, not just an increment to V. // Real mult = -be_cn_theta*dt*dt*visc_coef[comp]; #if (BL_SPACEDIM == 2) FORT_VISCSYNCFLUX (u_sync.dataPtr(comp), ARLIM(ulo), ARLIM(uhi), lo,hi, xflux_dat,ARLIM(xflux_lo),ARLIM(xflux_hi), yflux_dat,ARLIM(yflux_lo),ARLIM(yflux_hi), xarea_dat,ARLIM(xarea_lo),ARLIM(xarea_hi), yarea_dat,ARLIM(yarea_lo),ARLIM(yarea_hi), dx,&mult); #endif #if (BL_SPACEDIM == 3) FArrayBox zflux; Box zflux_bx(grd); zflux_bx.surroundingNodes(2); zflux.resize(zflux_bx,1); DEF_LIMITS(zflux,zflux_dat,zflux_lo,zflux_hi); const FArrayBox& zarea = (area[2])[i]; DEF_CLIMITS(zarea,zarea_dat,zarea_lo,zarea_hi); FORT_VISCSYNCFLUX (u_sync.dataPtr(comp), ARLIM(ulo), ARLIM(uhi), lo,hi, xflux_dat,ARLIM(xflux_lo),ARLIM(xflux_hi), yflux_dat,ARLIM(yflux_lo),ARLIM(yflux_hi), zflux_dat,ARLIM(zflux_lo),ARLIM(zflux_hi), xarea_dat,ARLIM(xarea_lo),ARLIM(xarea_hi), yarea_dat,ARLIM(yarea_lo),ARLIM(yarea_hi), zarea_dat,ARLIM(zarea_lo),ARLIM(zarea_hi), dx,&mult); #endif Real one = 1.0; D_TERM(viscflux_reg->FineAdd(xflux,0,i,0,comp,1,one);, viscflux_reg->FineAdd(yflux,1,i,0,comp,1,one);, viscflux_reg->FineAdd(zflux,2,i,0,comp,1,one);); } } } } void Diffusion::diffuse_tensor_Vsync (MultiFab* Vsync, Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, const MultiFab* const* beta) { BL_ASSERT(rho_flag == 1 || rho_flag == 3); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Diffusion::diffuse_tensor_Vsync ...\n"; NavierStokes& ns = *(NavierStokes*) &(parent->getLevel(level)); const int finest_level = parent->finestLevel(); const Real* dx = caller->Geom().CellSize(); const int IOProc = ParallelDescriptor::IOProcessorNumber(); const Real cur_time = caller->get_state_data(State_Type).curTime(); MultiFab Soln(grids,BL_SPACEDIM,1); MultiFab Rhs(grids,BL_SPACEDIM,0); Soln.setVal(0); MultiFab::Copy(Rhs,*Vsync,0,0,BL_SPACEDIM,0); if (verbose > 1) { Real r_norm = 0.0; for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { r_norm = std::max(r_norm,Rhs[Rhsmfi].norm(0)); } ParallelDescriptor::ReduceRealMax(r_norm,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "Original max of Vsync " << r_norm << '\n'; } // // Multiply RHS by volume and density. // for (int comp = 0; comp < BL_SPACEDIM; comp++) { for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { Rhs[Rhsmfi].mult(volume[Rhsmfi],0,comp,1); if (rho_flag == 1) Rhs[Rhsmfi].mult((*rho_half)[Rhsmfi],0,comp,1); if (rho_flag == 3) Rhs[Rhsmfi].mult((*ns.rho_ptime)[Rhsmfi],0,comp,1); } } // // SET UP COEFFICIENTS FOR VISCOUS SOLVER. // const Real a = 1.0; const Real b = be_cn_theta*dt; const int dComp = 0; // FIXME: start comp for betas, should be passed in const MultiFab* rho = (rho_flag == 1) ? rho_half : ns.rho_ctime; DivVis* tensor_op = getTensorOp(a,b,rho,dComp,beta); tensor_op->maxOrder(tensor_max_order); // // Construct solver and call it. // const Real S_tol = visc_tol; const MultiFab* alpha = &(tensor_op->aCoefficients()); #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA const Real S_tol_abs = -1.0; #else MultiFab const* betan[BL_SPACEDIM]; MultiFab const* betanp1[BL_SPACEDIM]; for (int d = 0; d < BL_SPACEDIM; d++) { betan[d] = &tensor_op->bCoefficients(d); betanp1[d] = betan[d]; } const Real S_tol_abs = get_scaled_abs_tol(Xvel, &Rhs, a, b, alpha, betan, betanp1, visc_abs_tol); #endif if (use_tensor_cg_solve) { MCCGSolver cg(*tensor_op,use_mg_precond_flag); cg.solve(Soln,Rhs,S_tol,S_tol_abs); } else { MCMultiGrid mg(*tensor_op); mg.solve(Soln,Rhs,S_tol,S_tol_abs); } int visc_op_lev = 0; tensor_op->applyBC(Soln,visc_op_lev); MultiFab::Copy(*Vsync,Soln,0,0,BL_SPACEDIM,1); if (verbose > 1) { Real s_norm = 0.0; for (MFIter Solnmfi(Soln); Solnmfi.isValid(); ++Solnmfi) { s_norm = std::max(s_norm,Soln[Solnmfi].norm(0)); } ParallelDescriptor::ReduceRealMax(s_norm,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "Final max of Vsync " << s_norm << '\n'; } FArrayBox xflux, yflux, zflux; if (level > 0) { MultiFab** tensorflux; allocFluxBoxesLevel(tensorflux,0,BL_SPACEDIM); tensor_op->compFlux(D_DECL(*(tensorflux[0]), *(tensorflux[1]), *(tensorflux[2])),Soln); // // The extra factor of dt comes from the fact that Vsync looks // like dV/dt, not just an increment to V. // // This is to remove the dx scaling in the coeffs // for (int d =0; d mult(b/(dt*caller->Geom().CellSize()[d]),0); for (int sigma = Xvel; sigma < BL_SPACEDIM+Xvel; sigma++) { for (MFIter tensorflux0mfi(*(tensorflux[0])); tensorflux0mfi.isValid(); ++tensorflux0mfi) { const int i = tensorflux0mfi.index(); const Box& grd = BoxLib::enclosedCells(tensorflux0mfi.validbox()); BL_ASSERT(grd==grids[tensorflux0mfi.index()]); const int* lo = grd.loVect(); const int* hi = grd.hiVect(); Box xflux_bx(grd); xflux_bx.surroundingNodes(0); xflux.resize(xflux_bx,1); xflux.copy((*(tensorflux[0]))[i],sigma,0,1); Box yflux_bx(grd); yflux_bx.surroundingNodes(1); yflux.resize(yflux_bx,1); yflux.copy((*(tensorflux[1]))[i],sigma,0,1); #if (BL_SPACEDIM == 3) Box zflux_bx(grd); zflux_bx.surroundingNodes(2); zflux.resize(zflux_bx,1); zflux.copy((*(tensorflux[2]))[i],sigma,0,1); #endif // // Multiply by dt^2: one to make fluxes "extensive", the other to // convert Vsync from accel increment to velocity increment // D_TERM(viscflux_reg->FineAdd(xflux,0,i,0,sigma,1,dt*dt);, viscflux_reg->FineAdd(yflux,1,i,0,sigma,1,dt*dt);, viscflux_reg->FineAdd(zflux,2,i,0,sigma,1,dt*dt);); } } removeFluxBoxesLevel(tensorflux); } delete tensor_op; } void Diffusion::diffuse_Ssync (MultiFab* Ssync, int sigma, Real dt, Real be_cn_theta, const MultiFab* rho_half, int rho_flag, MultiFab* const* flux, int dataComp, const MultiFab* const* beta, const MultiFab* alpha) { const int state_ind = sigma + BL_SPACEDIM; const int IOProc = ParallelDescriptor::IOProcessorNumber(); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Diffusion::diffuse_Ssync: " << caller->get_desc_lst()[State_Type].name(state_ind) << '\n'; int allnull, allthere; checkBeta(beta, allthere, allnull); MultiFab Soln(grids,1,1); MultiFab Rhs(grids,1,0); Soln.setVal(0); MultiFab::Copy(Rhs,*Ssync,sigma,0,1,0); if (verbose > 1) { MultiFab junk(grids,1,0); MultiFab::Copy(junk,Rhs,0,0,1,0); if (rho_flag == 2) { MultiFab& S_new = caller->get_new_data(State_Type); for (MFIter jmfi(junk); jmfi.isValid(); ++jmfi) { junk[jmfi].divide(S_new[jmfi],jmfi.validbox(),Density,0,1); } } Real r_norm = 0.0; for (MFIter jmfi(junk); jmfi.isValid(); ++jmfi) { r_norm = std::max(r_norm,junk[jmfi].norm(0)); } ParallelDescriptor::ReduceRealMax(r_norm,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "Original max of Ssync " << r_norm << '\n'; } // // Compute RHS. // for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { Rhs[Rhsmfi].mult(volume[Rhsmfi]); if (rho_flag == 1) { Rhs[Rhsmfi].mult((*rho_half)[Rhsmfi]); } } // // SET UP COEFFICIENTS FOR VISCOUS SOLVER. // const Real a = 1.0; Real b = be_cn_theta*dt; if (allnull) b *= visc_coef[state_ind]; Real rhsscale = 1.0; ABecLaplacian* visc_op = getViscOp(state_ind,a,b,rho_half,rho_flag, &rhsscale,dataComp,beta,alpha); visc_op->maxOrder(max_order); Rhs.mult(rhsscale,0,1); // // Construct solver and call it. // const Real S_tol = visc_tol; #ifndef CG_USE_OLD_CONVERGENCE_CRITERIA const Real S_tol_abs = -1.0; #else MultiFab const * betan[BL_SPACEDIM]; MultiFab const * betanp1[BL_SPACEDIM]; for (int d = 0; d < BL_SPACEDIM; d++) { betan[d] = &visc_op->bCoefficients(d); betanp1[d] = betan[d]; } const Real S_tol_abs = get_scaled_abs_tol(state_ind, &Rhs, a, b, alpha, betan, betanp1, visc_abs_tol); #endif if (use_cg_solve) { CGSolver cg(*visc_op,use_mg_precond_flag); cg.solve(Soln,Rhs,S_tol,S_tol_abs); } else if (use_hypre_solve) { #ifdef MG_USE_HYPRE BoxLib::Error("HypreABec not ready"); // HypreABec hp(Soln.boxArray(), 00, dx, 0, false); // hp.setup_solver(S_tol, S_tol_abs, 50); // hp.solve(Soln, Rhs, true); // hp.clear_solver(); #else BoxLib::Error("HypreABec not in this build"); #endif } else { MultiGrid mg(*visc_op); mg.solve(Soln,Rhs,S_tol,S_tol_abs); } int flux_allthere, flux_allnull; checkBeta(flux, flux_allthere, flux_allnull); if (flux_allthere) { visc_op->compFlux(D_DECL(*flux[0],*flux[1],*flux[2]),Soln); for (int i = 0; i < BL_SPACEDIM; ++i) (*flux[i]).mult(b/(dt*caller->Geom().CellSize()[i]),0); } MultiFab::Copy(*Ssync,Soln,0,sigma,1,0); if (verbose > 1) { Real s_norm = 0.0; for (MFIter Solnmfi(Soln); Solnmfi.isValid(); ++Solnmfi) { s_norm = std::max(s_norm,Soln[Solnmfi].norm(0)); } ParallelDescriptor::ReduceRealMax(s_norm,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "Final max of Ssync " << s_norm << '\n'; } if (rho_flag == 2) { MultiFab& S_new = caller->get_new_data(State_Type); for (MFIter Ssyncmfi(*Ssync); Ssyncmfi.isValid(); ++Ssyncmfi) { const int i = Ssyncmfi.index(); (*Ssync)[i].mult(S_new[i],Ssyncmfi.validbox(),Density,sigma,1); } } delete visc_op; } DivVis* Diffusion::getTensorOp (Real a, Real b, Real time, ViscBndryTensor& visc_bndry, const MultiFab* rho, int dataComp, const MultiFab* const* beta) { int allthere; checkBeta(beta, allthere); const Real* dx = caller->Geom().CellSize(); getTensorBndryData(visc_bndry,time); DivVis* tensor_op = new DivVis(visc_bndry,dx); tensor_op->maxOrder(tensor_max_order); int isrz = CoordSys::IsRZ(); const int nghost = 1; // Just like Bill. // // alpha should be the same size as volume. // const int nCompAlpha = BL_SPACEDIM == 2 ? 2 : 1; MultiFab alpha(grids,nCompAlpha,nghost); alpha.setVal(0.0,nghost); if (a != 0.0) { for (MFIter alphamfi(alpha); alphamfi.isValid(); ++alphamfi) { const int i = alphamfi.index(); const Box& bx = alphamfi.validbox(); Array rcen(bx.length(0)); parent->Geom(level).GetCellLoc(rcen, bx, 0); const int* lo = bx.loVect(); const int* hi = bx.hiVect(); Real* alpha_dat = alpha[alphamfi].dataPtr(); Box abx = BoxLib::grow(bx,alpha.nGrow()); const int* alo = abx.loVect(); const int* ahi = abx.hiVect(); const Real* rcendat = rcen.dataPtr(); const Real* voli = volume[alphamfi].dataPtr(); Box vbox = BoxLib::grow(volume.box(i),volume.nGrow()); const int* vlo = vbox.loVect(); const int* vhi = vbox.hiVect(); const FArrayBox& Rh = (*rho)[alphamfi]; DEF_CLIMITS(Rh,rho_dat,rlo,rhi); const FArrayBox& betax = (*beta[0])[alphamfi]; const Real* betax_dat = betax.dataPtr(dataComp); const int* betax_lo = betax.loVect(); const int* betax_hi = betax.hiVect(); const FArrayBox& betay = (*beta[1])[alphamfi]; const Real* betay_dat = betay.dataPtr(dataComp); const int* betay_lo = betay.loVect(); const int* betay_hi = betay.hiVect(); #if (BL_SPACEDIM == 3) const FArrayBox& betaz = (*beta[2])[alphamfi]; const Real* betaz_dat = betaz.dataPtr(dataComp); const int* betaz_lo = betaz.loVect(); const int* betaz_hi = betaz.hiVect(); #endif FORT_SET_TENSOR_ALPHA(alpha_dat, ARLIM(alo), ARLIM(ahi), lo, hi, rcendat, ARLIM(lo), ARLIM(hi), &b, voli, ARLIM(vlo), ARLIM(vhi), rho_dat,ARLIM(rlo),ARLIM(rhi), betax_dat,ARLIM(betax_lo),ARLIM(betax_hi), betay_dat,ARLIM(betay_lo),ARLIM(betay_hi), #if (BL_SPACEDIM == 3) betaz_dat,ARLIM(betaz_lo),ARLIM(betaz_hi), #endif &isrz); } } tensor_op->setScalars(a,b); tensor_op->aCoefficients(alpha); for (int n = 0; n < BL_SPACEDIM; n++) { MultiFab bcoeffs(area[n].boxArray(),1,nghost); bcoeffs.setBndry(0); MultiFab::Copy(bcoeffs,area[n],0,0,1,nghost); for (MFIter bcoeffsmfi(bcoeffs); bcoeffsmfi.isValid(); ++bcoeffsmfi) { const int i = bcoeffsmfi.index(); bcoeffs[i].mult(dx[n]); bcoeffs[i].mult((*beta[n])[i],dataComp,0,1); } tensor_op->bCoefficients(bcoeffs,n); } return tensor_op; } DivVis* Diffusion::getTensorOp (Real a, Real b, const MultiFab* rho, int dataComp, const MultiFab* const* beta) { int allthere = beta != 0; if (allthere) { for (int d = 0; d < BL_SPACEDIM; d++) { allthere = allthere && beta[d] != 0; } } if (!allthere) BoxLib::Abort("Diffusion::getTensorOp(): all betas must allocated all 0 or all non-0"); const Real* dx = caller->Geom().CellSize(); const Box& domain = caller->Geom().Domain(); const int nDer = MCLinOp::bcComponentsNeeded(); Array bcarray(nDer,BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR))); for (int id = 0; id < BL_SPACEDIM; id++) { bcarray[id] = caller->get_desc_lst()[State_Type].getBC(Xvel+id); } IntVect ref_ratio = level > 0 ? parent->refRatio(level-1) : IntVect::TheUnitVector(); ViscBndryTensor bndry; bndry.define(grids,nDer,caller->Geom()); bndry.setHomogValues(bcarray, ref_ratio[0]); DivVis* tensor_op = new DivVis(bndry,dx); tensor_op->maxOrder(tensor_max_order); int isrz = CoordSys::IsRZ(); const int nghost = 1; // Just like Bill. // // alpha should be the same size as volume. // const int nCompAlpha = BL_SPACEDIM == 2 ? 2 : 1; MultiFab alpha(grids,nCompAlpha,nghost); alpha.setVal(0.0); if (a != 0.0) { for (MFIter alphamfi(alpha); alphamfi.isValid(); ++alphamfi) { const int i = alphamfi.index(); const Box& bx = alphamfi.validbox(); Array rcen(bx.length(0)); parent->Geom(level).GetCellLoc(rcen, bx, 0); const int* lo = bx.loVect(); const int* hi = bx.hiVect(); Real* alpha_dat = alpha[alphamfi].dataPtr(); Box abx = BoxLib::grow(bx,alpha.nGrow()); const int* alo = abx.loVect(); const int* ahi = abx.hiVect(); const Real* rcendat = rcen.dataPtr(); const Real* voli = volume[alphamfi].dataPtr(); Box vbox = BoxLib::grow(volume.box(i),volume.nGrow()); const int* vlo = vbox.loVect(); const int* vhi = vbox.hiVect(); const FArrayBox& Rh = (*rho)[alphamfi]; DEF_CLIMITS(Rh,rho_dat,rlo,rhi); const FArrayBox& betax = (*beta[0])[alphamfi]; const Real* betax_dat = betax.dataPtr(dataComp); const int* betax_lo = betax.loVect(); const int* betax_hi = betax.hiVect(); const FArrayBox& betay = (*beta[1])[alphamfi]; const Real* betay_dat = betay.dataPtr(dataComp); const int* betay_lo = betay.loVect(); const int* betay_hi = betay.hiVect(); #if (BL_SPACEDIM == 3) const FArrayBox& betaz = (*beta[2])[alphamfi]; const Real* betaz_dat = betaz.dataPtr(dataComp); const int* betaz_lo = betaz.loVect(); const int* betaz_hi = betaz.hiVect(); #endif FORT_SET_TENSOR_ALPHA(alpha_dat, ARLIM(alo), ARLIM(ahi), lo, hi, rcendat, ARLIM(lo), ARLIM(hi), &b, voli, ARLIM(vlo), ARLIM(vhi), rho_dat,ARLIM(rlo),ARLIM(rhi), betax_dat,ARLIM(betax_lo),ARLIM(betax_hi), betay_dat,ARLIM(betay_lo),ARLIM(betay_hi), #if (BL_SPACEDIM == 3) betaz_dat,ARLIM(betaz_lo),ARLIM(betaz_hi), #endif &isrz); } } tensor_op->setScalars(a,b); tensor_op->aCoefficients(alpha); for (int n = 0; n < BL_SPACEDIM; n++) { MultiFab bcoeffs(area[n].boxArray(),1,nghost); bcoeffs.setBndry(0); MultiFab::Copy(bcoeffs,area[n],0,0,1,nghost); for (MFIter bcoeffsmfi(bcoeffs); bcoeffsmfi.isValid(); ++bcoeffsmfi) { const int i = bcoeffsmfi.index(); bcoeffs[i].mult(dx[n]); bcoeffs[i].mult((*beta[n])[i],dataComp,0,1); } tensor_op->bCoefficients(bcoeffs,n); } return tensor_op; } ABecLaplacian* Diffusion::getViscOp (int comp, Real a, Real b, Real time, ViscBndry& visc_bndry, const MultiFab* rho_half, int rho_flag, Real* rhsscale, int dataComp, const MultiFab* const* beta, const MultiFab* alpha_in, bool bndry_already_filled) { int allnull, allthere; checkBeta(beta, allthere, allnull); const Real* dx = caller->Geom().CellSize(); if (!bndry_already_filled) getBndryData(visc_bndry,comp,1,time,rho_flag); ABecLaplacian* visc_op = new ABecLaplacian(visc_bndry,dx); visc_op->maxOrder(max_order); int usehoop = comp == Xvel && (CoordSys::IsRZ()); int useden = rho_flag == 1; // // alpha should be the same size as volume. // MultiFab alpha(grids,1,GEOM_GROW); for (MFIter alphamfi(alpha); alphamfi.isValid(); ++alphamfi) { const int i = alphamfi.index(); const Box& bx = alphamfi.validbox(); Array rcen(bx.length(0)); parent->Geom(level).GetCellLoc(rcen, bx, 0); const int* lo = bx.loVect(); const int* hi = bx.hiVect(); Real* dat = alpha[alphamfi].dataPtr(); Box abx = BoxLib::grow(bx,alpha.nGrow()); const int* alo = abx.loVect(); const int* ahi = abx.hiVect(); const Real* rcendat = rcen.dataPtr(); const Real* voli = volume[alphamfi].dataPtr(); Box vbox = BoxLib::grow(volume.box(i),volume.nGrow()); const int* vlo = vbox.loVect(); const int* vhi = vbox.hiVect(); const FArrayBox& Rh = (*rho_half)[alphamfi]; DEF_CLIMITS(Rh,rho_dat,rlo,rhi); FORT_SETALPHA(dat, ARLIM(alo), ARLIM(ahi), lo, hi, rcendat, ARLIM(lo), ARLIM(hi), &b, voli, ARLIM(vlo), ARLIM(vhi), rho_dat,ARLIM(rlo),ARLIM(rhi),&usehoop,&useden); } if (rho_flag == 2 || rho_flag == 3) { MultiFab& S = caller->get_data(State_Type,time); for (MFIter alphamfi(alpha); alphamfi.isValid(); ++alphamfi) { BL_ASSERT(grids[alphamfi.index()] == alphamfi.validbox()); alpha[alphamfi].mult(S[alphamfi],alphamfi.validbox(),Density,0,1); } } if (alpha_in != 0) { for (MFIter alphamfi(alpha); alphamfi.isValid(); ++alphamfi) { const int i = alphamfi.index(); BL_ASSERT(grids[i] == alphamfi.validbox()); alpha[i].mult((*alpha_in)[i],alphamfi.validbox(),dataComp,0,1); } } if (rhsscale != 0) { *rhsscale = scale_abec ? 1.0/alpha.max(0) : 1.0; visc_op->setScalars(a*(*rhsscale),b*(*rhsscale)); } else { visc_op->setScalars(a,b); } if (allnull) { visc_op->aCoefficients(alpha); for (int n = 0; n < BL_SPACEDIM; n++) { MultiFab bcoeffs(area[n].boxArray(),1,0); bcoeffs.copy(area[n]); bcoeffs.mult(dx[n]); visc_op->bCoefficients(bcoeffs,n); } } else { visc_op->aCoefficients(alpha); for (int n = 0; n < BL_SPACEDIM; n++) { MultiFab bcoeffs(area[n].boxArray(),1,0); bcoeffs.copy(area[n]); for (MFIter bcoeffsmfi(bcoeffs); bcoeffsmfi.isValid(); ++bcoeffsmfi) { const int i = bcoeffsmfi.index(); bcoeffs[i].mult((*beta[n])[i],dataComp,0,1); bcoeffs[i].mult(dx[n]); } visc_op->bCoefficients(bcoeffs,n); } } return visc_op; } ABecLaplacian* Diffusion::getViscOp (int comp, Real a, Real b, const MultiFab* rho, int rho_flag, Real* rhsscale, int dataComp, const MultiFab* const* beta, const MultiFab* alpha_in) { // // Note: This assumes that the "NEW" density is to be used, if rho_flag==2 // int allnull, allthere; checkBeta(beta, allthere, allnull); const Geometry& geom = caller->Geom(); const Real* dx = geom.CellSize(); const Box& domain = geom.Domain(); const BCRec& bc = caller->get_desc_lst()[State_Type].getBC(comp); IntVect ref_ratio = level > 0 ? parent->refRatio(level-1) : IntVect::TheUnitVector(); ViscBndry bndry(grids,1,geom); bndry.setHomogValues(bc, ref_ratio); ABecLaplacian* visc_op = new ABecLaplacian(bndry,dx); visc_op->maxOrder(max_order); int usehoop = ((comp==Xvel) && (CoordSys::IsRZ())); int useden = (rho_flag == 1); // // alpha should be the same size as volume. // MultiFab alpha(grids,1,GEOM_GROW); for (MFIter alphamfi(alpha); alphamfi.isValid(); ++alphamfi) { const int i = alphamfi.index(); const Box& bx = alphamfi.validbox(); Array rcen(bx.length(0)); parent->Geom(level).GetCellLoc(rcen, bx, 0); const int* lo = bx.loVect(); const int* hi = bx.hiVect(); Real* dat = alpha[alphamfi].dataPtr(); Box abx = BoxLib::grow(bx,alpha.nGrow()); const int* alo = abx.loVect(); const int* ahi = abx.hiVect(); const Real* rcendat = rcen.dataPtr(); const Real* voli = volume[alphamfi].dataPtr(); Box vbox = BoxLib::grow(volume.box(i),volume.nGrow()); const int* vlo = vbox.loVect(); const int* vhi = vbox.hiVect(); const FArrayBox& Rh = (*rho)[alphamfi]; DEF_CLIMITS(Rh,rho_dat,rlo,rhi); FORT_SETALPHA(dat, ARLIM(alo), ARLIM(ahi), lo, hi, rcendat, ARLIM(lo), ARLIM(hi), &b, voli, ARLIM(vlo), ARLIM(vhi), rho_dat,ARLIM(rlo),ARLIM(rhi),&usehoop,&useden); } if (rho_flag == 2 || rho_flag == 3) { MultiFab& S = caller->get_new_data(State_Type); for (MFIter alphamfi(alpha); alphamfi.isValid(); ++alphamfi) { BL_ASSERT(grids[alphamfi.index()] == alphamfi.validbox()); alpha[alphamfi].mult(S[alphamfi],alphamfi.validbox(),Density,0,1); } } if (alpha_in != 0) { for (MFIter alphamfi(alpha); alphamfi.isValid(); ++alphamfi) { const int i = alphamfi.index(); BL_ASSERT(grids[i] == alphamfi.validbox()); alpha[i].mult((*alpha_in)[i],alphamfi.validbox(),dataComp,0,1); } } if (rhsscale != 0) { *rhsscale = scale_abec ? 1.0/alpha.max(0) : 1.0; visc_op->setScalars(a*(*rhsscale),b*(*rhsscale)); } else { visc_op->setScalars(a,b); } visc_op->aCoefficients(alpha); if (allnull) { for (int n = 0; n < BL_SPACEDIM; n++) { MultiFab bcoeffs(area[n].boxArray(),1,0); bcoeffs.copy(area[n]); bcoeffs.mult(dx[n],0,1,0); visc_op->bCoefficients(bcoeffs,n); } } else { for (int n = 0; n < BL_SPACEDIM; n++) { MultiFab bcoeffs(area[n].boxArray(),1,0); bcoeffs.copy(area[n]); for (MFIter bcoeffsmfi(bcoeffs); bcoeffsmfi.isValid(); ++bcoeffsmfi) { const int i = bcoeffsmfi.index(); bcoeffs[i].mult((*beta[n])[i],dataComp,0,1); } bcoeffs.mult(dx[n],0,1,0); visc_op->bCoefficients(bcoeffs,n); } } return visc_op; } void Diffusion::getViscTerms (MultiFab& visc_terms, int src_comp, int comp, Real time, int rho_flag, int dataComp, const MultiFab* const* beta) { int allnull, allthere; checkBeta(beta, allthere, allnull); // // Before computing the godunov predictors we may have to // precompute the viscous source terms. To do this we must // construct a Laplacian operator, set the coeficients and apply // it to the time N data. First, however, we must precompute the // fine N bndry values. We will do this for each scalar that diffuses. // // Note: This routine DOES NOT fill grow cells // const Real* dx = caller->Geom().CellSize(); MultiFab& S = caller->get_data(State_Type,time); int ngrow = visc_terms.nGrow(); visc_terms.setVal(0.0,comp-src_comp,1,ngrow); // // FIXME // LinOp classes cannot handle multcomponent MultiFabs yet, // construct the components one at a time and copy to visc_terms. // MultiFab visc_tmp(grids,1,1); MultiFab s_tmp(grids,1,1); if (is_diffusive[comp]) { ViscBndry visc_bndry; getBndryData(visc_bndry,comp,1,time,rho_flag); // // Set up operator and apply to compute viscous terms. // const Real a = 0.0; const Real b = allnull ? -visc_coef[comp] : -1.0; ABecLaplacian visc_op(visc_bndry,dx); visc_op.setScalars(a,b); visc_op.maxOrder(max_order); if (allnull) { for (int n = 0; n < BL_SPACEDIM; n++) { MultiFab bcoeffs(area[n].boxArray(),1,0); bcoeffs.copy(area[n]); bcoeffs.mult(dx[n]); visc_op.bCoefficients(bcoeffs,n); } } else { for (int n = 0; n < BL_SPACEDIM; n++) { MultiFab bcoeffs(area[n].boxArray(),1,0); bcoeffs.copy(area[n]); for (MFIter bcoeffsmfi(bcoeffs); bcoeffsmfi.isValid(); ++bcoeffsmfi) { const int i = bcoeffsmfi.index(); bcoeffs[i].mult((*beta[n])[i],dataComp,0,1); bcoeffs[i].mult(dx[n]); } visc_op.bCoefficients(bcoeffs,n); } } // // Copy to single component multifab for operator classes. // MultiFab::Copy(s_tmp,S,comp,0,1,0); if (rho_flag == 2) { // // We want to evaluate (div beta grad) S, not rho*S. // for (MFIter Smfi(S); Smfi.isValid(); ++Smfi) { const Box& box = Smfi.validbox(); BL_ASSERT(S[Smfi].min(box,Density) > 0.0); s_tmp[Smfi].divide(S[Smfi],box,Density,0,1); } } visc_op.apply(visc_tmp,s_tmp); // // Must divide by volume. // for (MFIter visc_tmpmfi(visc_tmp); visc_tmpmfi.isValid(); ++visc_tmpmfi) { const int i = visc_tmpmfi.index(); BL_ASSERT(grids[i] == visc_tmpmfi.validbox()); visc_tmp[i].divide(volume[i],visc_tmpmfi.validbox(),0,0,1); } #if (BL_SPACEDIM == 2) if (comp == Xvel && CoordSys::IsRZ()) { for (MFIter visc_tmpmfi(visc_tmp); visc_tmpmfi.isValid(); ++visc_tmpmfi) { // // visc_tmp[k] += -mu * u / r^2 // const int i = visc_tmpmfi.index(); const Box& bx = visc_tmpmfi.validbox(); Box vbx = BoxLib::grow(bx,visc_tmp.nGrow()); Box sbx = BoxLib::grow(s_tmp.box(i),s_tmp.nGrow()); Array rcen(bx.length(0)); parent->Geom(level).GetCellLoc(rcen, bx, 0); const int* lo = bx.loVect(); const int* hi = bx.hiVect(); const int* vlo = vbx.loVect(); const int* vhi = vbx.hiVect(); const int* slo = sbx.loVect(); const int* shi = sbx.hiVect(); Real* vdat = visc_tmp[visc_tmpmfi].dataPtr(); Real* sdat = s_tmp[visc_tmpmfi].dataPtr(); const Real* rcendat = rcen.dataPtr(); const Real mu = visc_coef[comp]; FORT_HOOPSRC(ARLIM(lo), ARLIM(hi), vdat, ARLIM(vlo), ARLIM(vhi), sdat, ARLIM(slo), ARLIM(shi), rcendat, &mu); } } #endif MultiFab::Copy(visc_terms,visc_tmp,0,comp-src_comp,1,0); } } void Diffusion::getTensorViscTerms (MultiFab& visc_terms, Real time, int dataComp, const MultiFab* const* beta) { int allthere; checkBeta(beta, allthere); const int src_comp = Xvel; const int ncomp = visc_terms.nComp(); if (ncomp < BL_SPACEDIM) BoxLib::Abort("Diffusion::getTensorViscTerms(): visc_terms needs at least BL_SPACEDIM components"); // // Before computing the godunov predicitors we may have to // precompute the viscous source terms. To do this we must // construct a Laplacian operator, set the coeficients and apply // it to the time N data. First, however, we must precompute the // fine N bndry values. We will do this for each scalar that diffuses. // // Note: This routine DOES NOT fill grow cells // const Real* dx = caller->Geom().CellSize(); MultiFab& S = caller->get_data(State_Type,time); const int ngrd = grids.size(); visc_terms.setVal(0.0,src_comp,BL_SPACEDIM,1); // // FIXME // LinOp classes cannot handle multcomponent MultiFabs yet, // construct the components one at a time and copy to visc_terms. // MultiFab visc_tmp(grids,BL_SPACEDIM,1); MultiFab s_tmp(grids,BL_SPACEDIM,1); if (is_diffusive[src_comp]) { ViscBndryTensor visc_bndry; getTensorBndryData(visc_bndry,time); // // Set up operator and apply to compute viscous terms. // const Real a = 0.0; const Real b = -1.0; DivVis tensor_op(visc_bndry,dx); tensor_op.maxOrder(tensor_max_order); tensor_op.setScalars(a,b); const int nghost = 0; // // alpha should be the same size as volume. // const int nCompAlpha = BL_SPACEDIM == 2 ? 2 : 1; MultiFab alpha(grids,nCompAlpha,nghost); alpha.setVal(0.0); tensor_op.aCoefficients(alpha); for (int n = 0; n < BL_SPACEDIM; n++) { MultiFab bcoeffs(area[n].boxArray(),1,nghost); bcoeffs.setBndry(0); MultiFab::Copy(bcoeffs,area[n],0,0,1,nghost); for (MFIter bcoeffsmfi(bcoeffs); bcoeffsmfi.isValid(); ++bcoeffsmfi) { const int i = bcoeffsmfi.index(); bcoeffs[i].mult(dx[n]); bcoeffs[i].mult((*beta[n])[i],dataComp,0,1); } tensor_op.bCoefficients(bcoeffs,n); } MultiFab::Copy(s_tmp,S,Xvel,0,BL_SPACEDIM,0); tensor_op.apply(visc_tmp,s_tmp); // // Must divide by volume. // for (MFIter visc_tmpmfi(visc_tmp); visc_tmpmfi.isValid(); ++visc_tmpmfi) { const int i = visc_tmpmfi.index(); for (int n = 0; n < BL_SPACEDIM; ++n) visc_tmp[i].divide(volume[i],volume.box(i),0,n,1); } #if (BL_SPACEDIM == 2) if (CoordSys::IsRZ()) { int fort_xvel_comp = Xvel+1; Array rcen; for (MFIter vmfi(visc_tmp); vmfi.isValid(); ++vmfi) { const int k = vmfi.index(); const Box& bx = visc_tmp.box(k); Box vbx = BoxLib::grow(bx,visc_tmp.nGrow()); Box sbx = BoxLib::grow(s_tmp.box(k),s_tmp.nGrow()); rcen.resize(bx.length(0)); parent->Geom(level).GetCellLoc(rcen, bx, 0); const int* lo = bx.loVect(); const int* hi = bx.hiVect(); const int* vlo = vbx.loVect(); const int* vhi = vbx.hiVect(); const int* slo = sbx.loVect(); const int* shi = sbx.hiVect(); Real* vdat = visc_tmp[k].dataPtr(); Real* sdat = s_tmp[k].dataPtr(); const Real* rcendat = rcen.dataPtr(); const FArrayBox& betax = (*beta[0])[k]; const Real* betax_dat = betax.dataPtr(dataComp); const int* betax_lo = betax.loVect(); const int* betax_hi = betax.hiVect(); const FArrayBox& betay = (*beta[1])[k]; const Real* betay_dat = betay.dataPtr(dataComp); const int* betay_lo = betay.loVect(); const int* betay_hi = betay.hiVect(); FORT_TENSOR_HOOPSRC(&fort_xvel_comp,ARLIM(lo), ARLIM(hi), vdat, ARLIM(vlo), ARLIM(vhi), sdat, ARLIM(slo), ARLIM(shi), rcendat, betax_dat,ARLIM(betax_lo),ARLIM(betax_hi), betay_dat,ARLIM(betay_lo),ARLIM(betay_hi)); } } #endif MultiFab::Copy(visc_terms,visc_tmp,0,0,BL_SPACEDIM,0); } } void Diffusion::getBndryData (ViscBndry& bndry, int src_comp, int num_comp, Real time, int rho_flag) { BL_ASSERT(num_comp == 1); // // Fill phys bndry vals of grow cells of (tmp) multifab passed to bndry. // // TODO -- A MultiFab is a huge amount of space in which to pass along // the phys bc's. InterpBndryData needs a more efficient interface. // NavierStokes& ns = *(NavierStokes*) &(parent->getLevel(level)); const int nGrow = 1; const BCRec& bc = caller->get_desc_lst()[State_Type].getBC(src_comp); MultiFab S(grids, num_comp, nGrow); S.setVal(BL_SAFE_BOGUS); bndry.define(grids,num_comp,caller->Geom()); const MultiFab& rhotime = ns.get_rho(time); MFIter Rho_mfi(rhotime); for (FillPatchIterator Phi_fpi(*caller,S,nGrow,time,State_Type,src_comp,num_comp); Rho_mfi.isValid() && Phi_fpi.isValid(); ++Rho_mfi, ++Phi_fpi) { const BoxList gCells = BoxLib::boxDiff(Phi_fpi().box(),Phi_fpi.validbox()); for (BoxList::const_iterator bli = gCells.begin(); bli != gCells.end(); ++bli) { S[Phi_fpi].copy(Phi_fpi(),*bli,0,*bli,0,num_comp); if (rho_flag == 2) for (int n = 0; n < num_comp; ++n) S[Phi_fpi].divide(rhotime[Rho_mfi],*bli,0,n,1); } } if (level == 0) { bndry.setBndryValues(S,0,0,num_comp,bc); } else { BoxArray cgrids = grids; cgrids.coarsen(crse_ratio); BndryRegister crse_br(cgrids,0,1,2,num_comp); // // interp for solvers over ALL c-f brs, need safe data. // crse_br.setVal(BL_BOGUS); coarser->FillBoundary(crse_br,src_comp,0,num_comp,time,rho_flag); bndry.setBndryValues(crse_br,0,S,0,0,num_comp,crse_ratio,bc); } } void Diffusion::getBndryDataGivenS (ViscBndry& bndry, MultiFab& Rho_and_spec, MultiFab& Rho_and_spec_crse, int state_ind, int src_comp, int num_comp, Real time, int rho_flag) { BL_ASSERT(num_comp == 1); const int nGrow = 1; // // Fill phys bndry vals of grow cells of (tmp) multifab passed to bndry. // // TODO -- A MultiFab is a huge amount of space in which to pass along // the phys bc's. InterpBndryData needs a more efficient interface. // const BCRec& bc = caller->get_desc_lst()[State_Type].getBC(state_ind); bndry.define(grids,num_comp,caller->Geom()); if (level == 0) { bndry.setBndryValues(Rho_and_spec,src_comp,0,num_comp,bc); } else { BoxArray cgrids = grids; cgrids.coarsen(crse_ratio); BndryRegister crse_br(cgrids,0,1,2,num_comp); // // interp for solvers over ALL c-f brs, need safe data. // crse_br.setVal(BL_BOGUS); crse_br.copyFrom(Rho_and_spec_crse,nGrow,src_comp,0,num_comp); bndry.setBndryValues(crse_br,0,Rho_and_spec,src_comp,0,num_comp,crse_ratio,bc); } } void Diffusion::FillBoundary (BndryRegister& bdry, int state_ind, int dest_comp, int num_comp, Real time, int rho_flag) { // // Need one grow cell filled for linear solvers. // We assume filPatch gets this right, where possible. // const int nGrow = 1; NavierStokes& ns = *(NavierStokes*) &(parent->getLevel(level)); MultiFab S(caller->boxArray(),num_comp,nGrow); const MultiFab& rhotime = ns.get_rho(time); MFIter Rho_mfi(rhotime); for (FillPatchIterator S_fpi(*caller,S,nGrow,time,State_Type,state_ind,num_comp); Rho_mfi.isValid() && S_fpi.isValid(); ++Rho_mfi, ++S_fpi) { S[S_fpi.index()].copy(S_fpi(),0,0,num_comp); if (rho_flag == 2) { for (int n = 0; n < num_comp; ++n) S[S_fpi.index()].divide(rhotime[Rho_mfi],0,n,1); } } // // Copy into boundary register. // bdry.copyFrom(S,nGrow,0,dest_comp,num_comp); } void Diffusion::getTensorBndryData (ViscBndryTensor& bndry, Real time) { const int num_comp = BL_SPACEDIM; const int src_comp = Xvel; const int nDer = MCLinOp::bcComponentsNeeded(); // // Create the BCRec's interpreted by ViscBndry objects // Array bcarray(nDer, BCRec(D_DECL(EXT_DIR,EXT_DIR,EXT_DIR), D_DECL(EXT_DIR,EXT_DIR,EXT_DIR))); for (int idim = 0; idim < BL_SPACEDIM; idim++) bcarray[idim] = caller->get_desc_lst()[State_Type].getBC(src_comp+idim); bndry.define(grids,nDer,caller->Geom()); const int nGrow = 1; MultiFab S(grids,num_comp,nGrow,Fab_allocate); for (FillPatchIterator Phi_fpi(*caller,S,nGrow,time,State_Type,src_comp,num_comp); Phi_fpi.isValid(); ++Phi_fpi) { const BoxList gCells = BoxLib::boxDiff(Phi_fpi().box(), Phi_fpi.validbox()); for (BoxList::const_iterator bli = gCells.begin(); bli != gCells.end(); ++bli) { S[Phi_fpi].copy(Phi_fpi(),*bli,0,*bli,0,num_comp); } } if (level == 0) { bndry.setBndryValues(S,0,0,num_comp,bcarray); } else { BoxArray cgrids(grids); cgrids.coarsen(crse_ratio); BndryRegister crse_br(cgrids,0,1,1,num_comp); crse_br.setVal(BL_BOGUS); const int rho_flag = 0; coarser->FillBoundary(crse_br,src_comp,0,num_comp,time,rho_flag); bndry.setBndryValues(crse_br,0,S,0,0,num_comp,crse_ratio[0],bcarray); } } void Diffusion::checkBetas (const MultiFab* const* beta1, const MultiFab* const* beta2, int& allthere, int& allnull) const { int allnull1, allnull2, allthere1, allthere2; checkBeta(beta1,allthere1,allnull1); checkBeta(beta2,allthere2,allnull2); allnull = allnull1 && allnull2; allthere = allthere1 && allthere2; if (!(allthere || allnull)) BoxLib::Abort("Diffusion::checkBetas(): betas must either be all 0 or all non-0"); } void Diffusion::checkBeta (const MultiFab* const* beta, int& allthere, int& allnull) const { allnull = 1; allthere = beta != 0; if (allthere) { for (int d = 0; d < BL_SPACEDIM; d++) { allnull = allnull && beta[d] == 0; allthere = allthere && beta[d] != 0; } } if (!(allthere || allnull)) BoxLib::Abort("Diffusion::checkBeta(): betas must be all 0 or all non-0"); } void Diffusion::checkBeta (const MultiFab* const* beta, int& allthere) const { allthere = beta != 0; if (allthere) { for (int d = 0; d < BL_SPACEDIM; d++) allthere = allthere && beta[d] != 0; } if (!allthere) BoxLib::Abort("Diffusion::checkBeta(): betas must be all non-0"); } void Diffusion::allocFluxBoxesLevel (MultiFab**& fluxbox, int nghost, int nvar) { fluxbox = new MultiFab*[BL_SPACEDIM]; for (int dir = 0; dir < BL_SPACEDIM; dir++) { BoxArray edge_boxes(grids); edge_boxes.surroundingNodes(dir); fluxbox[dir] = new MultiFab(edge_boxes,nvar,nghost); } } void Diffusion::removeFluxBoxesLevel (MultiFab**& fluxbox) { if (fluxbox != 0) { for (int i = 0; i 0.0) { const int nGrowDU = 1; const Real* dx = caller->Geom().CellSize(); NavierStokes& ns_level = *(NavierStokes*) &(parent->getLevel(level)); MultiFab* divu_fp = ns_level.getDivCond(nGrowDU,time); for (MFIter divmusimfi(divmusi); divmusimfi.isValid(); ++divmusimfi) { FArrayBox& fab = divmusi[divmusimfi]; FArrayBox& divu = (*divu_fp)[divmusimfi]; const Box& box = divmusimfi.validbox(); FORT_DIV_MU_SI(box.loVect(), box.hiVect(), dx, &mu, ARLIM(divu.loVect()), ARLIM(divu.hiVect()), divu.dataPtr(), ARLIM(fab.loVect()), ARLIM(fab.hiVect()), fab.dataPtr()); } delete divu_fp; } else { const int nGrow = 0; // Not to fill grow cells here divmusi.setVal(0.0,nGrow); } } // // This routine computes the vector div beta SI, where I is the identity // tensor, S = div U, and beta is non-constant. // void Diffusion::compute_divmusi (Real time, const MultiFab* const* beta, MultiFab& divmusi) { const int nGrowDU = 1; const Real* dx = caller->Geom().CellSize(); NavierStokes& ns_level = *(NavierStokes*) &(parent->getLevel(level)); MultiFab* divu_fp = ns_level.getDivCond(nGrowDU,time); for (MFIter divmusimfi(divmusi); divmusimfi.isValid(); ++divmusimfi) { const int i = divmusimfi.index(); FArrayBox& fab = divmusi[divmusimfi]; FArrayBox& divu = (*divu_fp)[divmusimfi]; const Box& box = divmusimfi.validbox(); DEF_CLIMITS((*beta[0])[divmusimfi],betax,betaxlo,betaxhi); DEF_CLIMITS((*beta[1])[divmusimfi],betay,betaylo,betayhi); #if (BL_SPACEDIM==3) DEF_CLIMITS((*beta[2])[divmusimfi],betaz,betazlo,betazhi); #endif BL_ASSERT(grids[divmusimfi.index()] == divmusimfi.validbox()); FORT_DIV_VARMU_SI(box.loVect(),box.hiVect(), dx, ARLIM(divu.loVect()), ARLIM(divu.hiVect()), divu.dataPtr(), ARLIM(betaxlo), ARLIM(betaxhi), betax, ARLIM(betaylo), ARLIM(betayhi), betay, #if (BL_SPACEDIM==3) ARLIM(betazlo), ARLIM(betazhi), betaz, #endif ARLIM(divmusi[i].loVect()), ARLIM(divmusi[i].hiVect()), divmusi[i].dataPtr()); } delete divu_fp; } // // SAS: The following function is a temporary fix in the migration from // using is_conservative and rho_flag over to using advectionType // and diffusionType. // int Diffusion::set_rho_flag(const DiffusionForm compDiffusionType) { int rho_flag; switch (compDiffusionType) { case Laplacian_S: rho_flag = 0; break; case RhoInverse_Laplacian_S: rho_flag = 1; break; case Laplacian_SoverRho: rho_flag = 2; break; default: std::cout << "compDiffusionType = " << compDiffusionType << '\n'; BoxLib::Abort("An unknown NavierStokes::DiffusionForm was used in set_rho_flag"); } return rho_flag; } bool Diffusion::are_any(const Array& diffusionType, const DiffusionForm testForm, const int sComp, const int nComp) { for (int comp = sComp; comp < sComp + nComp; ++comp) { if (diffusionType[comp] == testForm) return true; } return false; } int Diffusion::how_many(const Array& diffusionType, const DiffusionForm testForm, const int sComp, const int nComp) { int counter = 0; for (int comp = sComp; comp < sComp + nComp; ++comp) { if (diffusionType[comp] == testForm) ++counter; } return counter; } /* bool Diffusion::are_any_Laplacian_SoverRho(const Array& diffusionType, const int sComp, const int nComp) { for (int comp = sComp; comp < sComp + nComp; ++comp) { if (diffusionType[comp] == Laplacian_SoverRho) return true; } return false; } */ #endif /*USE_NAVIERSTOKES*/ ccseapps-2.5/CCSEApps/iamrlib/OutFlowBC.H0000644000175000017500000001005711634153073021216 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _OUTFLOWBC_H_ #define _OUTFLOWBC_H_ // // $Id: OutFlowBC.H,v 1.6 2003/02/21 22:49:10 car Exp $ // #include "FArrayBox.H" #include "Geometry.H" #include "Orientation.H" #include "BCRec.H" enum OutFlow_Solver_Type { BC_BACK, // back substitution BC_MG // multigrid }; // // The baseclass for MacOutFlowBC and ProjOutFlowBC. // class OutFlowBC { public: OutFlowBC (); virtual ~OutFlowBC (); virtual void computeBC (FArrayBox velMF[][2*BL_SPACEDIM], FArrayBox divuMF[2*BL_SPACEDIM], FArrayBox rhoMF[2*BL_SPACEDIM], FArrayBox phiMF[2*BL_SPACEDIM], const Geometry& geom, Orientation* outFaces, int numOutFlowFaces, Real gravity = 0.0) = 0; static Box SemiGrow (const Box& baseBox, int nGrow, int direction); static Box SemiCoarsen (const Box& baseBox, int ref_factor, int direction); static void GetOutFlowFaces (bool& haveOutFlow, Orientation* outFaces, BCRec* _phys_bc, int& numOutFlowFaces); static bool HasOutFlowBC (BCRec* _phys_bc); protected: }; // // The baseclass for MacOutFlowBC_MG and ProjOutFlowBC_MG // class OutFlowBC_MG { public: OutFlowBC_MG (const Box& Domain, FArrayBox* Phi, FArrayBox* Rhs, FArrayBox* Resid, FArrayBox* Beta, Real* H, int* IsPeriodic, bool is_scalar); virtual ~OutFlowBC_MG (); void solve (Real tol, Real abs_tol, int i1, int i2, int maxIters, int verbose); Real vcycle (int i1, int i2); const Box& theDomain () const { return domain; } FArrayBox* theRhs () { return rhs; } FArrayBox* thePhi () { return phi; } protected: virtual void Restrict () = 0; virtual void interpolate () = 0; virtual Real residual () = 0; virtual void step (int nSteps) = 0; virtual void gsrb (int nSteps) = 0; // // The per-object data // Box domain; FArrayBox* phi; FArrayBox* rhs; FArrayBox* resid; FArrayBox* cgwork; FArrayBox* beta; Real h[BL_SPACEDIM]; int isPeriodic[BL_SPACEDIM]; OutFlowBC_MG* next; bool beta_is_scalar; }; #endif /*_OUTFLOWBC_H_*/ ccseapps-2.5/CCSEApps/iamrlib/Projection.cpp0000644000175000017500000025105311634153073022124 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Projection.cpp,v 1.150 2003/02/21 23:07:44 car Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #include "ProjOutFlowBC.H" #ifndef _NavierStokes_H_ enum StateType {State_Type=0, Press_Type}; #if (BL_SPACEDIM == 2) enum StateNames { Xvel=0, Yvel, Density}; #else enum StateNames { Xvel=0, Yvel, Zvel, Density}; #endif #endif #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); #define DEF_CLIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ const Real* fabdat = (fab).dataPtr(); #define DEF_BOX_LIMITS(box,boxlo,boxhi) \ const int* boxlo = (box).loVect(); \ const int* boxhi = (box).hiVect(); #define BogusValue 1.e200 #define MAX_LEV 10 // // Initialization of static members. // int Projection::verbose = 0; int Projection::P_code = 0; Real Projection::proj_tol = 1.0e-12; Real Projection::sync_tol = 1.0e-8; Real Projection::proj_abs_tol = 1.0e-16; Real Projection::filter_factor = 0.1; Real Projection::divu_minus_s_factor= 0.0; int Projection::rho_wgt_vel_proj = 0; int Projection::do_outflow_bcs = 1; int Projection::make_sync_solvable = 0; int Projection::proj_0 = 0; int Projection::proj_2 = 0; int Projection::add_vort_proj = 0; #ifndef BL_USE_HGPROJ_SERIAL #if BL_SPACEDIM == 2 #if BL_PRVERSION == 9 static holy_grail_amr_multigrid::stencil hg_stencil = holy_grail_amr_multigrid::full; #else static holy_grail_amr_multigrid::stencil hg_stencil = holy_grail_amr_multigrid::cross; #endif #elif BL_SPACEDIM == 3 static holy_grail_amr_multigrid::stencil hg_stencil = holy_grail_amr_multigrid::cross; #endif #endif // BL_USE_HGPROJ_SERIAL static RegType project_bc [] = { interior, inflow, outflow, refWall, refWall, refWall }; #define LEVEL_PROJ 1001 #define INITIAL_VEL 1002 #define INITIAL_PRESS 1003 #define INITIAL_SYNC 1004 Projection::Projection (Amr* _parent, BCRec* _phys_bc, int _do_sync_proj, int _finest_level, int _radius_grow ) : parent(_parent), phys_bc(_phys_bc), do_sync_proj(_do_sync_proj), finest_level(_finest_level), radius_grow(_radius_grow), LevelData(_finest_level+1), radius(_finest_level+1) { read_params(); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Creating projector\n"; projector_bndry = 0; setUpBcs(); sync_proj = 0; } Projection::~Projection () { if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Deleting projector\n"; delete sync_proj; delete projector_bndry; sync_proj = 0; projector_bndry = 0; } void Projection::read_params () { // // Read parameters from input file and command line. // ParmParse pp("proj"); pp.query("v",verbose); pp.query("Pcode",P_code); pp.query("proj_tol",proj_tol); pp.query("sync_tol",sync_tol); pp.query("proj_abs_tol",proj_abs_tol); pp.query("make_sync_solvable",make_sync_solvable); pp.query("filter_factor",filter_factor); pp.query("proj_0",proj_0); pp.query("proj_2",proj_2); if (proj_0 && proj_2) BoxLib::Error("You can only set proj_0 OR proj_2"); if (!proj_2) BoxLib::Error("With new gravity and outflow stuff, must use proj_2"); pp.query("divu_minus_s_factor",divu_minus_s_factor); pp.query("rho_wgt_vel_proj",rho_wgt_vel_proj); pp.query("do_outflow_bcs",do_outflow_bcs); pp.query("add_vort_proj",add_vort_proj); { #ifndef BL_USE_HGPROJ_SERIAL std::string stencil = "cross"; if ( pp.query("stencil", stencil) ) { if ( stencil == "cross" ) { hg_stencil = holy_grail_amr_multigrid::cross; } else if ( stencil == "terrain" ) { hg_stencil = holy_grail_amr_multigrid::terrain; } else if ( stencil == "full" ) { hg_stencil = holy_grail_amr_multigrid::full; } else { BoxLib::Error("stencil must be cross, terrain, or full"); } } #endif } } void Projection::setUpBcs () { delete projector_bndry; // // Set up projector bndry. // const Geometry& geom = parent->Geom(0); const int* lo_bc = phys_bc->lo(); const int* hi_bc = phys_bc->hi(); RegType proj_bc[BL_SPACEDIM][2]; for (int i = 0; i < BL_SPACEDIM; ++i) { proj_bc[i][0] = project_bc[lo_bc[i]]; proj_bc[i][1] = project_bc[hi_bc[i]]; if (geom.isPeriodic(i)) { proj_bc[i][0] = periodic; proj_bc[i][1] = periodic; } } #ifdef BL_USE_HGPROJ_SERIAL projector_bndry = new inviscid_fluid_boundary_class(proj_bc); #else projector_bndry = new inviscid_fluid_boundary(proj_bc); #endif } // // Install a level of the projection. // void Projection::install_level (int level, AmrLevel* level_data, PArray* _radius) { if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Installing projector level " << level << '\n'; finest_level = parent->finestLevel(); if (level > LevelData.size() - 1) { LevelData.resize(finest_level+1); radius.resize(finest_level+1); } LevelData.clear(level); LevelData.set(level, level_data); radius.clear(level); radius.set(level, _radius); delete sync_proj; sync_proj = 0; } // // Build the aliasLib projection object. // void Projection::bldSyncProject () { const Box& fdomain = parent->Geom(finest_level).Domain(); delete sync_proj; const Array& ref_ratio = parent->refRatio(); // // Build mesh and ratio arrays for entire hierarchy. // Array amesh(finest_level+1); Array gen_ratio(finest_level); for (int lev = 0; lev <= finest_level; lev++) { amesh.set(lev, parent->boxArray(lev)); if (lev > 0) gen_ratio.set(lev-1, ref_ratio[lev-1]); } if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "bldSyncProject:: amr_mesh = \n"; amr_multigrid::mesh_write(amesh, gen_ratio, fdomain, std::cout); } #ifdef BL_USE_HGPROJ_SERIAL #if BL_SPACEDIM == 2 if (CoordSys::IsRZ()) amr_multigrid::SetRZ(); #endif sync_proj = new holy_grail_amr_projector(amesh, gen_ratio, fdomain, 0, finest_level, finest_level, *projector_bndry, P_code); #else sync_proj = new holy_grail_amr_projector(amesh, gen_ratio, fdomain, 0, finest_level, finest_level, *projector_bndry, hg_stencil, P_code); #if BL_SPACEDIM == 2 if (CoordSys::IsRZ()) sync_proj->setCoordSys(holy_grail_amr_multigrid::rz); #endif #endif #ifdef ATMOSPHERE // // This is not the usual way of setting parameters. // sync_proj->line_solve_dim = BL_SPACEDIM - 1; #endif if (make_sync_solvable) sync_proj->make_it_so(); } // // Perform a level projection in the advance function // Explanation of arguments to the level projector: // // rho_half contains rho^{n+1/2} // U_old contains the u^n velocities // U_new starts as u^*, is converted to (u^* - u^n)/dt, // becomes (u^{n+1} - u^n)/dt in the solver, // and is converted back to u^n+1 at the end // P_old contains p^{n-1/2} // P_new gets cleared, initialized to an intial guess for p^{n+1/2} // using coarse grid data if available, // becomes pressure update phi in the solver, // and then converted into final prssure p^{n+1/2} // void Projection::level_project (int level, Real time, Real dt, Real cur_pres_time, Real prev_pres_time, const Geometry& geom, MultiFab& U_old, MultiFab& U_new, MultiFab& P_old, MultiFab& P_new, MultiFab* rho_half, SyncRegister* crse_sync_reg, SyncRegister* fine_sync_reg, int crse_dt_ratio, int** bc, int iteration, int have_divu, int Divu_Type) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::level_project()"); if ( verbose && ParallelDescriptor::IOProcessor() ) std::cout << "... level projector at level " << level << '\n'; if (sync_proj == 0) bldSyncProject(); // // old time velocity has bndry values already // must gen valid bndry data for new time velocity. // must fill bndry cells in pressure with computable values // even though they are not used in calculation. // U_old.setBndry(BogusValue,Xvel,BL_SPACEDIM); U_new.setBndry(BogusValue,Xvel,BL_SPACEDIM); P_old.setBndry(BogusValue); P_new.setBndry(BogusValue); LevelData[level].setPhysBoundaryValues(State_Type,Xvel,BL_SPACEDIM,0); LevelData[level].setPhysBoundaryValues(State_Type,Xvel,BL_SPACEDIM,1); const Real* dx = geom.CellSize(); const BoxArray& grids = LevelData[level].boxArray(); const BoxArray& P_grids = P_old.boxArray(); NavierStokes* ns = dynamic_cast(&parent->getLevel(level)); BL_ASSERT(!(ns==0)); // // NOTE: IT IS IMPORTANT TO DO THE BOUNDARY CONDITIONS BEFORE // MAKING UNEW HOLD U_t OR U/dt, BECAUSE UNEW IS USED IN // CONSTRUCTING THE OUTFLOW BC'S. // // Set boundary values for P_new, to increment, if applicable // // Note: we don't need to worry here about using FillCoarsePatch because // it will automatically use the "new dpdt" to interpolate, // since once we get here at level > 0, we've already defined // a new pressure at level-1. if (level != 0) { LevelData[level].FillCoarsePatch(P_new,0,cur_pres_time,Press_Type,0,1); if (!proj_2) P_new.minus(P_old,0,1,0); // Care about nodes on box boundary } const int nGrow = (level == 0 ? 0 : -1); for (MFIter P_newmfi(P_new); P_newmfi.isValid(); ++P_newmfi) { const int i = P_newmfi.index(); P_new[i].setVal(0.0,BoxLib::grow(P_new.box(i),nGrow),0,1); // // TODO -- also zero fine-fine nodes ??? // } // // Compute Ustar/dt as input to projector for proj_0, // Ustar/dt + Gp for proj_2, // (Ustar-Un)/dt for not proj_0 or proj_2 (ie the original). // // Compute DU/dt for proj_0, // DU/dt for proj_2, // (DU-DU_old)/dt for not proj_0 or proj_2 (ie the original). // MultiFab *divusource = 0, *divuold = 0; if (have_divu) { divusource = ns->getDivCond(1,time+dt); if (!proj_0 && !proj_2) divuold = ns->getDivCond(1,time); } const Real dt_inv = 1./dt; if (proj_0 || proj_2) { U_new.mult(dt_inv,0,BL_SPACEDIM,1); if (have_divu) divusource->mult(dt_inv,0,1,divusource->nGrow()); } else { for (MFIter U_newmfi(U_new); U_newmfi.isValid(); ++U_newmfi) { const int i = U_newmfi.index(); ConvertUnew(U_new[i],U_old[i],dt,U_new.box(i)); } if (have_divu) { divusource->minus(*divuold,0,1,divusource->nGrow()); divusource->mult(dt_inv,0,1,divusource->nGrow()); if (divu_minus_s_factor>0.0 && divu_minus_s_factor<=1.0) { BoxLib::Error("Check this code....not recently tested"); // // Compute relaxation terms to account for approximate projection // add divu_old*divu...factor/dt to divusource. // const Real uoldfactor = divu_minus_s_factor*dt/parent->dtLevel(0); UpdateArg1(*divusource, uoldfactor/dt, *divuold, 1, grids, 1); // // add U_old*divu...factor/dt to U_new // UpdateArg1(U_new, uoldfactor/dt, U_old, BL_SPACEDIM, grids, 1); } } } delete divuold; if (proj_2) { MultiFab Gp(grids,BL_SPACEDIM,1); ns->getGradP(Gp, prev_pres_time); const int n_ghost = 1; rho_half->invert(1.0,n_ghost); for (FillPatchIterator P_fpi(LevelData[level],P_old,1,prev_pres_time,Press_Type,0,1); P_fpi.isValid(); ++P_fpi) { const int idx = P_fpi.index(); for (int i = 0; i < BL_SPACEDIM; i++) Gp[idx].mult((*rho_half)[idx],0,i,1); U_new[idx].plus(Gp[idx],0,0,BL_SPACEDIM); } rho_half->invert(1.0,n_ghost); } // // Outflow uses appropriately constructed "U_new" and "divusource" // so make sure this call comes after those are set, // but before fields are scaled by r or rho is set to 1/rho. // Real gravity = ns->getGravity(); if (OutFlowBC::HasOutFlowBC(phys_bc) && (have_divu || gravity > 0.0) && do_outflow_bcs) { MultiFab* phi[MAX_LEV] = {0}; phi[level] = &LevelData[level].get_new_data(Press_Type); MultiFab* Vel_ML[MAX_LEV] = {0}; Vel_ML[level] = &U_new; MultiFab* Divu_ML[MAX_LEV] = {0}; Divu_ML[level] = divusource; MultiFab* Rho_ML[MAX_LEV] = {0}; Rho_ML[level] = rho_half; set_outflow_bcs(LEVEL_PROJ,phi,Vel_ML,Divu_ML,Rho_ML,level,level,have_divu); } // // Scale the projection variables. // rho_half->setBndry(BogusValue); scaleVar(rho_half, 1, &U_new, grids, level); // // Application specific first guess. // ProjFirstGuess(U_new, P_new, level, grids); // // Enforce periodicity of U_new and rho_half (i.e. coefficient of G phi) // *after* everything has been done to them. // EnforcePeriodicity(U_new, BL_SPACEDIM, grids, geom); EnforcePeriodicity(*rho_half, 1, grids, geom); // // Add the contribution from the un-projected V to syncregisters. // int is_rz = (CoordSys::IsRZ() ? 1 : 0); // // Setup projection (note that u_real is a temporary copy). // // Build amr_real data structures that projection wants. // PArray u_real[BL_SPACEDIM]; PArray p_real(level+1), s_real(level+1); int n; for (n = 0; n < BL_SPACEDIM; n++) { u_real[n].resize(level+1,PArrayManage); u_real[n].set(level, new MultiFab(grids, 1, 1)); for (MFIter u_realmfi(u_real[n][level]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); u_real[n][level][i].copy(U_new[i], n, 0); } } p_real.set(level, &P_new); s_real.set(level, rho_half); // // Project // MultiFab* sync_resid_crse = 0; MultiFab* sync_resid_fine = 0; if (level < finest_level) sync_resid_crse = new MultiFab(P_grids,1,1); if ( level > 0 && ( ((proj_0 || proj_2) && iteration == crse_dt_ratio) || (!proj_0 && !proj_2)) ) { const int ngrow = parent->MaxRefRatio(level-1) - 1; sync_resid_fine = new MultiFab(P_grids,1,ngrow); } if (!have_divu) { sync_proj->project(u_real, p_real, null_amr_real, s_real, sync_resid_crse, sync_resid_fine, geom, (Real*)dx, proj_tol, level, level, proj_abs_tol); } else { bool use_u = true; if (is_rz == 1) radMult(level,*divusource,0); const int nghost = 0; divusource->mult(-1.0,0,1,nghost); // FIXME: this doesn't touch the ghost cells? PArray rhs_real(level+1); rhs_real.set(level, divusource); sync_proj->manual_project(u_real,p_real,rhs_real,null_amr_real,s_real, sync_resid_crse, sync_resid_fine, geom, use_u, (Real*)dx, proj_tol, level, level, proj_abs_tol); } delete divusource; // // Note: this must occur *after* the projection has been done // (but before the modified velocity has been copied back) // because the SyncRegister routines assume the projection // has been set up. // if (do_sync_proj) { if (level < finest_level) { // // Init sync registers between level and level+1. // const Real mult = 1.0; crse_sync_reg->CrseInit(sync_resid_crse,geom,mult); } if ( level > 0 && ( ((proj_0 || proj_2) && iteration == crse_dt_ratio) || (!proj_0 && !proj_2)) ) { // // Increment sync registers between level and level-1. // const Real invrat = 1.0/(double)crse_dt_ratio; const Geometry& crse_geom = parent->Geom(level-1); fine_sync_reg->FineAdd(sync_resid_fine,geom,crse_geom,phys_bc,invrat); } } delete sync_resid_crse; delete sync_resid_fine; // // Copy u_real. // for (n = 0; n < BL_SPACEDIM; n++) { for (MFIter u_realmfi(u_real[n][level]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); U_new[i].copy(u_real[n][level][i], 0, n); } } // // Reset state + pressure data. // // Unscale level projection variables. // rescaleVar(rho_half, 1, &U_new, grids, level); // // Put U_new back to "normal"; subtract U_old*divu...factor/dt from U_new // if ( (!proj_0 && !proj_2) && divu_minus_s_factor>0.0 && divu_minus_s_factor<=1.0 && have_divu) { const Real uoldfactor = -divu_minus_s_factor*dt/parent->dtLevel(0); UpdateArg1(U_new, uoldfactor/dt, U_old, BL_SPACEDIM, grids, 1); } // // Convert U back to a velocity, and phi into p^n+1/2. // if (proj_0 || proj_2) { // // un = dt*un // U_new.mult(dt,0,BL_SPACEDIM,1); } else { // // un = uo+dt*un // UnConvertUnew(U_old, dt, U_new, grids); } if (!proj_2) AddPhi(P_new, P_old, grids); // pn = pn + po if (proj_0) { const Real dt_inv = 1./dt; U_old.mult(-dt_inv,0,BL_SPACEDIM,1); filterP(level,geom,P_old,P_new,U_old,rho_half,bc,time,dt,have_divu); U_old.mult(-dt,0,BL_SPACEDIM,1); } } void Projection::filterP (int level, const Geometry& geom, MultiFab& P_old, MultiFab& P_new, MultiFab& U_old, MultiFab* rho_half, int** bc, Real time, Real dt, int have_divu) { if ( verbose && ParallelDescriptor::IOProcessor() ) std::cout << "... filterP at level " << level << std::endl; int rzflag = CoordSys::IsRZ(); const Real* dx = geom.CellSize(); Box ndomain = BoxLib::surroundingNodes(geom.Domain()); const int* ndlo = ndomain.loVect(); const int* ndhi = ndomain.hiVect(); const BoxArray& grids = LevelData[level].boxArray(); const BoxArray& P_grids = P_old.boxArray(); const int* phys_lo = phys_bc->lo(); const int* phys_hi = phys_bc->hi(); MultiFab* rhs_nd = new MultiFab(P_grids,1,0); MultiFab* temp_phi = new MultiFab(P_grids,1,1); MultiFab* temp_rho = new MultiFab(grids,1,1); MultiFab* temp_vel = new MultiFab(grids,BL_SPACEDIM,1); MultiFab* sync_resid_crse = 0; MultiFab* sync_resid_fine = 0; BL_ASSERT(grids.size() == P_grids.size()); temp_phi->setVal(0); temp_rho->setVal(0); rhs_nd->setVal(0); // // Scale the projection variables. // scaleVar(rho_half, 0, &U_old, grids, level); // // Copy from valid regions only. // temp_rho->copy(*rho_half,0,0,1); temp_rho->FillBoundary(); temp_phi->copy(P_old,0,0,1); temp_phi->FillBoundary(); // // Copy from valid regions + bcs to get inflow values. // int n_ghost = 1; MultiFab::Copy(*temp_vel,U_old,0,0,BL_SPACEDIM,n_ghost); EnforcePeriodicity(*temp_vel, BL_SPACEDIM, grids, geom); EnforcePeriodicity(*temp_rho, 1, grids, geom); EnforcePeriodicity(*temp_phi, 1, P_grids, geom); Real mult = -1.; for (MFIter mfi(*temp_rho); mfi.isValid(); ++mfi) { const int k = mfi.index(); FArrayBox& sfab = (*temp_rho)[k]; const int* s_lo = sfab.loVect(); const int* s_hi = sfab.hiVect(); FArrayBox& pfab = (*temp_phi)[k]; const int* p_lo = pfab.loVect(); const int* p_hi = pfab.hiVect(); const int* r_lo = (*rhs_nd)[k].loVect(); const int* r_hi = (*rhs_nd)[k].hiVect(); const int* n_lo = P_grids[k].loVect(); const int* n_hi = P_grids[k].hiVect(); FORT_FILTRHS(pfab.dataPtr(),ARLIM(p_lo),ARLIM(p_hi), sfab.dataPtr(),ARLIM(s_lo),ARLIM(s_hi), (*rhs_nd)[k].dataPtr(),ARLIM(r_lo),ARLIM(r_hi), n_lo,n_hi,dx,&mult,&rzflag); for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (!geom.isPeriodic(dir)) { Box ndomlo(ndomain), ndomhi(ndomain); ndomlo.setRange(dir,ndlo[dir],1); ndomhi.setRange(dir,ndhi[dir],1); // // Any RHS point on the physical bndry must be multiplied by // two (only for ref-wall, inflow and symmetry) and set to // zero at outflow. // Box blo = P_grids[k] & ndomlo; Box bhi = P_grids[k] & ndomhi; if (blo.ok()) { if (phys_lo[dir] == Outflow) (*rhs_nd)[k].setVal(0,blo,0,1); else (*rhs_nd)[k].mult(2,blo,0,1); } if (bhi.ok()) { if (phys_hi[dir] == Outflow) (*rhs_nd)[k].setVal(0,bhi,0,1); else (*rhs_nd)[k].mult(2,bhi,0,1); } } } } if (have_divu) { const int nghost = 0; MultiFab* divuold = new MultiFab(P_grids,1,nghost); put_divu_in_node_rhs(*divuold,level,nghost,time,rzflag); for (MFIter mfi(*divuold); mfi.isValid(); ++mfi) { (*divuold)[mfi].mult(1.0/dt,0,1); } rhs_nd->plus(*divuold,0,1,nghost); delete divuold; } temp_phi->setVal(0); // // Setup projection . // PArray u_real[BL_SPACEDIM]; PArray p_real(level+1), s_real(level+1); PArray rhs_real(level+1); for (int n = 0; n < BL_SPACEDIM; n++) { u_real[n].resize(level+1,PArrayManage); u_real[n].set(level, new MultiFab(grids, 1, 1)); for (MFIter u_realmfi(u_real[n][level]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); u_real[n][level][i].copy((*temp_vel)[i], n, 0); } } p_real.set(level, temp_phi); s_real.set(level, temp_rho); rhs_real.set(level, rhs_nd); delete temp_vel; delete temp_rho; delete rhs_nd; // // Project ... // const bool use_u = true; if (level < finest_level) sync_resid_crse = new MultiFab(P_grids,1,1); if (level > 0) { const int ngrow = parent->MaxRefRatio(level-1) - 1; sync_resid_fine = new MultiFab(P_grids,1,ngrow); } sync_proj->manual_project(u_real, p_real, rhs_real, null_amr_real, s_real, sync_resid_crse, sync_resid_fine, geom, use_u, (Real*)dx, filter_factor, level, level, proj_abs_tol); // // Reset state + pressure data // AddPhi(P_new, *temp_phi, grids); // // Unscale the projection variables. // rescaleVar(rho_half, 0, &U_old, grids, level); delete temp_phi; delete sync_resid_crse; delete sync_resid_fine; } // // SYNC_PROJECT // #define MAXLEV 10 void Projection::syncProject (int c_lev, MultiFab& pres, MultiFab& vel, MultiFab* rho_half, MultiFab* Vsync, MultiFab& phi, SyncRegister* rhs_sync_reg, SyncRegister* crsr_sync_reg, const BoxArray& sync_boxes, const Geometry& geom, const Real* dx, Real dt_crse, int crse_iteration, int crse_dt_ratio) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::syncProject()"); int rz_flag = (CoordSys::IsRZ() ? 1 : 0); if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "SyncProject: level = " << c_lev << " correction to level " << finest_level << std::endl; } // // Manipulate state + pressure data. // if (sync_proj == 0) bldSyncProject(); // // Gather data. // const BoxArray& grids = LevelData[c_lev].boxArray(); const BoxArray& P_grids = pres.boxArray(); MultiFab rhs(P_grids,1,1); MultiFab& sig = *rho_half; rhs_sync_reg->InitRHS(rhs,geom,phys_bc); phi.setVal(0); sig.setBndry(BogusValue); // // Scale sync projection variables. // scaleVar(&sig,1,Vsync,grids,c_lev); // // If periodic, copy into periodic translates of Vsync. // EnforcePeriodicity(*Vsync, BL_SPACEDIM, grids, geom); // // Build aliaslib structures. // int n; PArray u_real[BL_SPACEDIM]; PArray p_real(c_lev+1), s_real(c_lev+1), rhs_real(c_lev+1); for (n = 0; n < BL_SPACEDIM; n++) { u_real[n].resize(c_lev+1,PArrayManage); u_real[n].set(c_lev, new MultiFab(grids, 1, 1)); for (MFIter u_realmfi(u_real[n][c_lev]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); u_real[n][c_lev][i].copy((*Vsync)[i], n, 0); } } p_real.set(c_lev, &phi); s_real.set(c_lev, &sig); rhs_real.set(c_lev, &rhs); // // PROJECT // if use_u = 0, then solves DGphi = RHS // if use_u = 1, then solves DGphi = RHS + DV // both return phi and (V-Gphi) as V // const bool use_u = true; MultiFab* sync_resid_crse = 0; MultiFab* sync_resid_fine = 0; if (c_lev > 0) { const int ngrow = parent->MaxRefRatio(c_lev-1) - 1; sync_resid_fine = new MultiFab(P_grids,1,ngrow); } sync_proj->manual_project(u_real, p_real, rhs_real, null_amr_real, s_real, sync_resid_crse, sync_resid_fine, geom, use_u, (Real*)dx, sync_tol, c_lev, c_lev, proj_abs_tol); // // Copy u_real. // for (n = 0; n < BL_SPACEDIM; n++) { for (MFIter u_realmfi(u_real[n][c_lev]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); (*Vsync)[i].copy(u_real[n][c_lev][i], 0, n); } } // // If this sync project is not at level 0 then we need to account for // the changes made here in the level c_lev velocity in the sync registers // going into the level (c_lev-1) sync project. Note that this must be // done before rho_half is scaled back. // if (c_lev > 0 && (!proj_2 || crse_iteration == crse_dt_ratio) ) { const Real invrat = 1.0/(double)crse_dt_ratio; const Geometry& crsr_geom = parent->Geom(c_lev-1); crsr_sync_reg->CompAdd(sync_resid_fine,geom,crsr_geom,phys_bc,sync_boxes,invrat); } delete sync_resid_crse; delete sync_resid_fine; // // Reset state + pressure data ... // // Unscale the sync projection variables for rz. // rescaleVar(&sig,1,Vsync,grids,c_lev); // // Add projected Vsync to new velocity at this level & add phi to pressure. // AddPhi(pres, phi, grids); UpdateArg1(vel, dt_crse, *Vsync, BL_SPACEDIM, grids, 1); } // // MULTI-LEVEL SYNC_PROJECT // void Projection::MLsyncProject (int c_lev, MultiFab& pres_crse, MultiFab& vel_crse, MultiFab& cc_rhs_crse, MultiFab& pres_fine, MultiFab& vel_fine, MultiFab& cc_rhs_fine, MultiFab& rho_crse, MultiFab& rho_fine, MultiFab* Vsync, MultiFab& V_corr, MultiFab& phi_fine, SyncRegister* rhs_sync_reg, SyncRegister* crsr_sync_reg, const Real* dx, Real dt_crse, IntVect& ratio, int crse_iteration, int crse_dt_ratio, const Geometry& fine_geom, const Geometry& crse_geom, bool pressure_time_is_interval, bool first_crse_step_after_initial_iters, Real cur_crse_pres_time, Real prev_crse_pres_time, Real cur_fine_pres_time, Real prev_fine_pres_time) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::MLsyncProject()"); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "SyncProject: levels = " << c_lev << ", " << c_lev+1 << '\n'; int rz_flag = (CoordSys::IsRZ() ? 1 : 0); if (sync_proj == 0) bldSyncProject(); // // Set up memory. // MultiFab *phi[MAXLEV]; const BoxArray& grids = LevelData[c_lev].boxArray(); const BoxArray& fine_grids = LevelData[c_lev+1].boxArray(); const BoxArray& Pgrids_crse = pres_crse.boxArray(); phi[c_lev] = new MultiFab(Pgrids_crse,1,1); phi[c_lev]->setVal(0); MultiFab* crse_rhs = new MultiFab(Pgrids_crse,1,1); const BoxArray& Pgrids_fine = pres_fine.boxArray(); phi[c_lev+1] = new MultiFab(Pgrids_fine,1,1); phi[c_lev+1]->setVal(0); PArray u_real[BL_SPACEDIM]; PArray p_real(c_lev+2,PArrayManage); PArray s_real(c_lev+2), crse_rhs_real(c_lev+1); PArray rhs_real(c_lev+2); // // Set up crse RHS // rhs_sync_reg->InitRHS(*crse_rhs,crse_geom,phys_bc); Box P_finedomain(BoxLib::surroundingNodes(crse_geom.Domain())); P_finedomain.refine(ratio); if (Pgrids_fine[0] == P_finedomain) crse_rhs->setVal(0); // // Do necessary scaling // scaleVar(&rho_crse, 0, Vsync, grids, c_lev ); scaleVar(&rho_fine, 0, &V_corr, fine_grids, c_lev+1); // // Set up alias lib. // int n; for (n = 0; n < BL_SPACEDIM; n++) { u_real[n].resize(c_lev+2,PArrayManage); u_real[n].set(c_lev, new MultiFab(grids, 1, 1)); u_real[n].set(c_lev+1, new MultiFab(fine_grids, 1, 1)); for (MFIter u_realmfi(u_real[n][c_lev]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); u_real[n][c_lev][i].copy((*Vsync)[i], n, 0); } for (MFIter u_realfinemfi(u_real[n][c_lev+1]); u_realfinemfi.isValid(); ++u_realfinemfi) { const int i = u_realfinemfi.index(); u_real[n][c_lev+1][i].copy(V_corr[i], n, 0); } restrict_level(u_real[n][c_lev], u_real[n][c_lev+1], ratio); } s_real.set(c_lev, &rho_crse); s_real.set(c_lev+1, &rho_fine); if (CoordSys::IsRZ()) { radMult(c_lev ,cc_rhs_crse,0); radMult(c_lev+1,cc_rhs_fine,0); } rhs_real.set(c_lev , &cc_rhs_crse); rhs_real.set(c_lev+1, &cc_rhs_fine); restrict_level(s_real[c_lev], s_real[c_lev+1], ratio); p_real.set(c_lev, phi[c_lev]); p_real.set(c_lev+1, phi[c_lev+1]); // // Note that crse_rhs_real is only built on the coarsest level. // crse_rhs_real.set(c_lev, crse_rhs); // // The Multilevel Projection // if use_u = false, then solves DGphi = RHS // if use_u = true , then solves DGphi = RHS + DV // both return phi and (V-Gphi) as V // const bool use_u = true; const Real* dx_fine = parent->Geom(c_lev+1).CellSize(); MultiFab* sync_resid_crse = 0; MultiFab* sync_resid_fine = 0; if (c_lev > 0) { int ngrow = parent->MaxRefRatio(c_lev-1) - 1; sync_resid_fine = new MultiFab(Pgrids_crse,1,ngrow); } sync_proj->manual_project(u_real, p_real, rhs_real, crse_rhs_real, s_real, sync_resid_crse, sync_resid_fine, crse_geom, use_u, (Real*)dx_fine, sync_tol, c_lev, c_lev+1, proj_abs_tol); delete crse_rhs; // // Copy u_real. // for (n = 0; n < BL_SPACEDIM; n++) { for (MFIter u_realmfi(u_real[n][c_lev]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); (*Vsync)[i].copy(u_real[n][c_lev][i], 0, n); } for (MFIter u_realfinemfi(u_real[n][c_lev+1]); u_realfinemfi.isValid(); ++u_realfinemfi) { const int i = u_realfinemfi.index(); V_corr[i].copy(u_real[n][c_lev+1][i], 0, n); } } // // If this sync project is not at levels 0-1 then we need to account for // the changes made here in the level c_lev velocity in the sync registers // going into the level (c_lev-1) sync project. Note that this must be // done before rho_half is scaled back. // if (c_lev > 0 && (!proj_2 || crse_iteration == crse_dt_ratio) ) { const Real invrat = 1.0/(double)crse_dt_ratio; const Geometry& crsr_geom = parent->Geom(c_lev-1); BoxArray sync_boxes = pres_fine.boxArray(); sync_boxes.coarsen(ratio); crsr_sync_reg->CompAdd(sync_resid_fine,crse_geom,crsr_geom, phys_bc,sync_boxes,invrat); } delete sync_resid_fine; // // Do necessary un-scaling. // rescaleVar(&rho_crse, 0, Vsync, grids, c_lev ); rescaleVar(&rho_fine, 0, &V_corr, fine_grids, c_lev+1); for (MFIter phimfi(*phi[c_lev+1]); phimfi.isValid(); ++phimfi) { phi_fine[phimfi].copy((*phi[c_lev+1])[phimfi],0,0,1); } // // Add phi to pressure. // AddPhi(pres_crse, *phi[c_lev], grids); if (pressure_time_is_interval) { // // Only update the most recent pressure. // AddPhi(pres_fine, *phi[c_lev+1], fine_grids); } else { MultiFab& pres_fine_old = LevelData[c_lev+1].get_old_data(Press_Type); if (first_crse_step_after_initial_iters) { Real time_since_zero = cur_crse_pres_time - prev_crse_pres_time; Real dt_to_prev_time = prev_fine_pres_time - prev_crse_pres_time; Real dt_to_cur_time = cur_fine_pres_time - prev_crse_pres_time; Real cur_mult_factor = dt_to_cur_time / time_since_zero; (*phi[c_lev+1]).mult(cur_mult_factor); AddPhi(pres_fine, *phi[c_lev+1], fine_grids); Real prev_mult_factor = dt_to_prev_time / dt_to_cur_time; (*phi[c_lev+1]).mult(prev_mult_factor); AddPhi(pres_fine_old, *phi[c_lev+1], fine_grids); } else { AddPhi(pres_fine , *phi[c_lev+1], fine_grids); AddPhi(pres_fine_old, *phi[c_lev+1], fine_grids); } } // // Add projected vel to new velocity. // UpdateArg1(vel_crse, dt_crse, *Vsync, BL_SPACEDIM, grids, 1); UpdateArg1(vel_fine, dt_crse, V_corr, BL_SPACEDIM, fine_grids, 1); } // // The initial velocity projection in post_init. // this function ensures that the velocities are nondivergent // void Projection::initialVelocityProject (int c_lev, Real cur_divu_time, int have_divu) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::initialVelocityProject()"); int lev; int f_lev = finest_level; if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "initialVelocityProject: levels = " << c_lev << " " << f_lev << '\n'; if (rho_wgt_vel_proj) std::cout << "RHO WEIGHTED INITIAL VELOCITY PROJECTION\n"; else std::cout << "CONSTANT DENSITY INITIAL VELOCITY PROJECTION\n"; } if (sync_proj == 0) bldSyncProject(); MultiFab* vel[MAX_LEV] = {0}; MultiFab* phi[MAX_LEV] = {0}; MultiFab* sig[MAX_LEV] = {0}; for (lev = c_lev; lev <= f_lev; lev++) { LevelData[lev].get_old_data(Press_Type).setVal(0); } for (lev = c_lev; lev <= f_lev; lev++) { vel[lev] = &LevelData[lev].get_new_data(State_Type); phi[lev] = &LevelData[lev].get_old_data(Press_Type); const int nghost = 1; const BoxArray& grids = LevelData[lev].boxArray(); sig[lev] = new MultiFab(grids,1,nghost); if (rho_wgt_vel_proj) { LevelData[lev].get_new_data(State_Type).setBndry(BogusValue,Density,1); parent->getLevel(lev).setPhysBoundaryValues(State_Type,Density,1); MultiFab::Copy(*sig[lev], LevelData[lev].get_new_data(State_Type), Density, 0, 1, nghost); } else { sig[lev]->setVal(1,nghost); } } MultiFab* rhs_cc[MAX_LEV] = {0}; const int nghost = 1; for (lev = c_lev; lev <= f_lev; lev++) { vel[lev]->setBndry(BogusValue,Xvel,BL_SPACEDIM); // // Set the physical boundary values. // AmrLevel& amr_level = parent->getLevel(lev); const BoxArray& grids = amr_level.boxArray(); amr_level.setPhysBoundaryValues(State_Type,Xvel,BL_SPACEDIM); if (have_divu) { int Divu_Type, Divu; if (!LevelData[lev].isStateVariable("divu", Divu_Type, Divu)) BoxLib::Error("Projection::initialVelocityProject(): Divu not found"); // // Make sure ghost cells are properly filled. // MultiFab& divu_new = amr_level.get_new_data(Divu_Type); divu_new.FillBoundary(); amr_level.setPhysBoundaryValues(Divu_Type,0,1,cur_divu_time); const BoxArray& grids = amr_level.boxArray(); rhs_cc[lev] = new MultiFab(grids,1,nghost); MultiFab* rhslev = rhs_cc[lev]; put_divu_in_cc_rhs(*rhslev,lev,grids,cur_divu_time); } } if (OutFlowBC::HasOutFlowBC(phys_bc) && do_outflow_bcs) { if (have_divu) set_outflow_bcs(INITIAL_VEL,phi,vel,rhs_cc,sig, c_lev,f_lev,have_divu); if (!have_divu) { MultiFab* divu_dummy[MAX_LEV] = {0}; set_outflow_bcs(INITIAL_VEL,phi,vel,divu_dummy,sig, c_lev,f_lev,have_divu); } } // // Scale the projection variables. // for (lev = c_lev; lev <= f_lev; lev++) { AmrLevel& amr_level = parent->getLevel(lev); const BoxArray& grids = amr_level.boxArray(); scaleVar(sig[lev],1,vel[lev],grids,lev); } // // Setup alias lib. // const Array& full_mesh = sync_proj->mesh(); PArray u_real[BL_SPACEDIM], p_real(f_lev+1); PArray s_real(f_lev+1,PArrayManage); int n; for (n = 0; n < BL_SPACEDIM; n++) u_real[n].resize(f_lev+1,PArrayManage); for (lev = c_lev; lev <= f_lev; lev++) { for (n = 0; n < BL_SPACEDIM; n++) { u_real[n].set(lev, new MultiFab(full_mesh[lev], 1, 1)); for (MFIter u_realmfi(u_real[n][lev]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); u_real[n][lev][i].copy((*vel[lev])[i], Xvel+n, 0); } } p_real.set(lev, phi[lev]); s_real.set(lev, sig[lev]); } // // Project // MultiFab* sync_resid_crse = 0; MultiFab* sync_resid_fine = 0; const Real* dx_lev = parent->Geom(f_lev).CellSize(); if (!have_divu) { sync_proj->project(u_real, p_real, null_amr_real, s_real, sync_resid_crse, sync_resid_fine, parent->Geom(c_lev), (Real*)dx_lev, proj_tol, c_lev, f_lev,proj_abs_tol); } else { const bool use_u = true; PArray rhs_real(f_lev+1,PArrayManage); for (lev = c_lev; lev <= f_lev; lev++) { MultiFab* rhslev = rhs_cc[lev]; if (CoordSys::IsRZ()) radMult(lev,*rhslev,0); rhs_cc[lev]->mult(-1.0,0,1,nghost); rhs_real.set(lev, rhs_cc[lev]); } sync_proj->manual_project(u_real, p_real, rhs_real, null_amr_real, s_real, sync_resid_crse, sync_resid_fine, parent->Geom(c_lev), use_u, (Real*)dx_lev, proj_tol, c_lev, f_lev, proj_abs_tol); } // // Copy u_real. // for (lev = c_lev; lev <= f_lev; lev++) { for (n = 0; n < BL_SPACEDIM; n++) { for (MFIter u_realmfi(u_real[n][lev]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); (*vel[lev])[i].copy(u_real[n][lev][i], 0, Xvel+n); } } } // // Unscale initial projection variables. // for (lev = c_lev; lev <= f_lev; lev++) { const BoxArray& grids = parent->getLevel(lev).boxArray(); rescaleVar(sig[lev],1,vel[lev],grids,lev); } for (lev = c_lev; lev <= f_lev; lev++) { LevelData[lev].get_old_data(Press_Type).setVal(0); LevelData[lev].get_new_data(Press_Type).setVal(0); } } void Projection::initialPressureProject (int c_lev) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::initialPressureProject()"); int lev; int f_lev = finest_level; if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "initialPressureProject: levels = " << c_lev << " " << f_lev << '\n'; MultiFab* vel[MAX_LEV] = {0}; MultiFab* phi[MAX_LEV] = {0}; MultiFab* sig[MAX_LEV] = {0}; for (lev = c_lev; lev <= f_lev; lev++) { vel[lev] = &LevelData[lev].get_new_data(State_Type); phi[lev] = &LevelData[lev].get_old_data(Press_Type); const int nghost = 1; const BoxArray& grids = LevelData[lev].boxArray(); sig[lev] = new MultiFab(grids,1,nghost); LevelData[lev].get_new_data(State_Type).setBndry(BogusValue,Density,1); parent->getLevel(lev).setPhysBoundaryValues(State_Type,Density,1); MultiFab::Copy(*sig[lev], LevelData[lev].get_new_data(State_Type), Density, 0, 1, nghost); } // // Set up outflow bcs. // NavierStokes* ns = dynamic_cast(&LevelData[c_lev]); Real gravity = ns->getGravity(); if (OutFlowBC::HasOutFlowBC(phys_bc) && do_outflow_bcs) { int have_divu_dummy = 0; MultiFab* Divu_ML[MAX_LEV] = {0}; set_outflow_bcs(INITIAL_PRESS,phi,vel,Divu_ML,sig, c_lev,f_lev,have_divu_dummy); } for (lev = c_lev; lev <= f_lev; lev++) { AmrLevel& amr_level = parent->getLevel(lev); const BoxArray& grids = amr_level.boxArray(); // // Scale the projection variables. // scaleVar(sig[lev],1,vel[lev],grids,lev); } // // Setup alias lib. // const Array& full_mesh = sync_proj->mesh(); PArray p_real(f_lev+1); PArray u_real[BL_SPACEDIM]; PArray s_real(f_lev+1,PArrayManage); int n; for (n = 0; n < BL_SPACEDIM; n++) u_real[n].resize(f_lev+1,PArrayManage); for (lev = c_lev; lev <= f_lev; lev++) { for (n = 0; n < BL_SPACEDIM; n++) { u_real[n].set(lev, new MultiFab(full_mesh[lev], 1, 1)); for (MFIter u_realmfi(u_real[n][lev]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); if (n == (BL_SPACEDIM-1)) { u_real[n][lev][i].setVal(-gravity); } else { u_real[n][lev][i].setVal(0.); } } } p_real.set(lev, phi[lev]); s_real.set(lev, sig[lev]); } // // Project // const Real* dx_lev = parent->Geom(f_lev).CellSize(); MultiFab* sync_resid_crse = 0; MultiFab* sync_resid_fine = 0; sync_proj->project(u_real, p_real, null_amr_real, s_real, sync_resid_crse, sync_resid_fine, parent->Geom(c_lev), (Real*)dx_lev, proj_tol, c_lev, f_lev,proj_abs_tol); // // Unscale initial projection variables. // for (lev = c_lev; lev <= f_lev; lev++) { const BoxArray& grids = parent->getLevel(lev).boxArray(); rescaleVar(sig[lev],1,vel[lev],grids,lev); } // // Copy "old" pressure just computed into "new" pressure as well. // for (lev = c_lev; lev <= f_lev; lev++) MultiFab::Copy(LevelData[lev].get_new_data(Press_Type), LevelData[lev].get_old_data(Press_Type), 0, 0, 1, 0); } // // The velocity projection in post_init, which computes the initial // pressure used in the timestepping. // void Projection::initialSyncProject (int c_lev, MultiFab* sig[], Real dt, Real strt_time, Real dt_init, int have_divu) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::initialSyncProject()"); int lev; int f_lev = finest_level; if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "initialSyncProject: levels = " << c_lev << " " << f_lev << '\n'; // // Manipulate state + pressure data. // if (sync_proj == 0) bldSyncProject(); // // Gather data. // MultiFab* vel[MAX_LEV] = {0}; MultiFab* phi[MAX_LEV] = {0}; MultiFab* rhs[MAX_LEV] = {0}; for (lev = c_lev; lev <= f_lev; lev++) { vel[lev] = &LevelData[lev].get_new_data(State_Type); phi[lev] = &LevelData[lev].get_old_data(Press_Type); } const Real dt_inv = 1./dt; if (have_divu) { // // Set up rhs for manual project. // for (lev = c_lev; lev <= f_lev; lev++) { AmrLevel& amr_level = parent->getLevel(lev); int Divu_Type, Divu; if (!LevelData[c_lev].isStateVariable("divu", Divu_Type, Divu)) BoxLib::Error("Projection::initialSyncProject(): Divu not found"); // // Make sure ghost cells are properly filled. // MultiFab& divu_new = amr_level.get_new_data(Divu_Type); divu_new.FillBoundary(); MultiFab& divu_old = amr_level.get_old_data(Divu_Type); divu_old.FillBoundary(); amr_level.setPhysBoundaryValues(Divu_Type,0,1,strt_time); amr_level.setPhysBoundaryValues(Divu_Type,0,1,strt_time+dt); const int nghost = 1; rhs[lev] = new MultiFab(amr_level.boxArray(),1,nghost); MultiFab* rhslev = rhs[lev]; rhslev->setVal(0); NavierStokes* ns = dynamic_cast(&parent->getLevel(lev)); BL_ASSERT(!(ns == 0)); MultiFab* divu = ns->getDivCond(nghost,strt_time); MultiFab* dsdt = ns->getDivCond(nghost,strt_time+dt); for (MFIter mfi(*rhslev); mfi.isValid(); ++mfi) { (*dsdt)[mfi].minus((*divu)[mfi]); (*dsdt)[mfi].mult(dt_inv); (*rhslev)[mfi].copy((*dsdt)[mfi]); } delete divu; delete dsdt; } } for (lev = c_lev; lev <= f_lev; lev++) { MultiFab& P_old = LevelData[lev].get_old_data(Press_Type); P_old.setVal(0); } // // Set velocity bndry values to bogus values. // for (lev = c_lev; lev <= f_lev; lev++) { vel[lev]->setBndry(BogusValue,Xvel,BL_SPACEDIM); MultiFab &u_o = LevelData[lev].get_old_data(State_Type); u_o.setBndry(BogusValue,Xvel,BL_SPACEDIM); sig[lev]->setBndry(BogusValue); } // // Convert velocities to accelerations (we always do this for the // projections in these initial iterations). // for (lev = c_lev; lev <= f_lev; lev++) { LevelData[lev].setPhysBoundaryValues(State_Type,Xvel,BL_SPACEDIM,1); LevelData[lev].setPhysBoundaryValues(State_Type,Xvel,BL_SPACEDIM,0); MultiFab& u_o = LevelData[lev].get_old_data(State_Type); ConvertUnew(*vel[lev], u_o, dt, LevelData[lev].boxArray()); } if (OutFlowBC::HasOutFlowBC(phys_bc) && have_divu && do_outflow_bcs) set_outflow_bcs(INITIAL_SYNC,phi,vel,rhs,sig, c_lev,f_lev,have_divu); // // Scale initial sync projection variables. // for (lev = c_lev; lev <= f_lev; lev++) { AmrLevel& amr_level = parent->getLevel(lev); scaleVar(sig[lev],1,vel[lev],amr_level.boxArray(),lev); if (have_divu && CoordSys::IsRZ()) radMult(lev,*(rhs[lev]),0); } // // Build the aliaslib data structures // const Array& full_mesh = sync_proj->mesh(); PArray u_real[BL_SPACEDIM]; PArray p_real(f_lev+1), s_real(f_lev+1); int n; for (n = 0; n < BL_SPACEDIM; n++) { u_real[n].resize(f_lev+1,PArrayManage); } for (lev = c_lev; lev <= f_lev; lev++) { for (n = 0; n < BL_SPACEDIM; n++) { u_real[n].set(lev, new MultiFab(full_mesh[lev], 1, 1)); for (MFIter u_realmfi(u_real[n][lev]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); u_real[n][lev][i].copy((*vel[lev])[i], Xvel+n, 0); } } p_real.set(lev, phi[lev]); s_real.set(lev, sig[lev]); } for (n = 0; n < BL_SPACEDIM; n++) { for (lev = f_lev; lev >= c_lev+1; lev--) { restrict_level(u_real[n][lev-1],u_real[n][lev], parent->refRatio(lev-1)); } } MultiFab* sync_resid_crse = 0; MultiFab* sync_resid_fine = 0; const Real* dx_lev = parent->Geom(f_lev).CellSize(); // // Project. // if (!have_divu) { // // Zero divu only or debugging. // sync_proj->project(u_real, p_real, null_amr_real, s_real, sync_resid_crse, sync_resid_fine, parent->Geom(c_lev), (Real*)dx_lev, proj_tol, c_lev, f_lev,proj_abs_tol); } else { // // General divu. // bool use_u = true; // // This PArray is managed so it'll remove rhs on exiting scope. // PArray rhs_real(f_lev+1,PArrayManage); for (lev = c_lev; lev <= f_lev; lev++) { rhs[lev]->mult(-1.0,0,1); rhs_real.set(lev, rhs[lev]); } sync_proj->manual_project(u_real, p_real, rhs_real, null_amr_real, s_real, sync_resid_crse, sync_resid_fine, parent->Geom(c_lev), use_u, (Real*)dx_lev, proj_tol, c_lev, f_lev, proj_abs_tol); } // // Copy u_real. // for (lev = c_lev; lev <= f_lev; lev++) { for (n = 0; n < BL_SPACEDIM; n++) { for (MFIter u_realmfi(u_real[n][lev]); u_realmfi.isValid(); ++u_realmfi) { const int i = u_realmfi.index(); (*vel[lev])[i].copy(u_real[n][lev][i], 0, Xvel+n); } } } // // Unscale initial sync projection variables. // for (lev = c_lev; lev <= f_lev; lev++) rescaleVar(sig[lev],1,vel[lev],parent->getLevel(lev).boxArray(),lev); // // Add correction at coarse and fine levels. // for (lev = c_lev; lev <= f_lev; lev++) incrPress(lev, 1.0); } // // Put S in the rhs of the projector -- node based version. // void Projection::put_divu_in_node_rhs (MultiFab& rhs, int level, const int& nghost, Real time, int user_rz) { BL_ASSERT(user_rz >= -1 && user_rz <= 1); rhs.setVal(0); const Geometry& geom = parent->Geom(level); const int bcxlo = phys_bc->lo(0); const int bcxhi = phys_bc->hi(0); int isrz = user_rz == -1 ? CoordSys::IsRZ() : user_rz; const Real* dx = geom.CellSize(); Real hx = dx[0]; const Box& domain = geom.Domain(); const int* domlo = domain.loVect(); const int* domhi = domain.hiVect(); NavierStokes* ns = dynamic_cast(&parent->getLevel(level)); BL_ASSERT(!(ns == 0)); MultiFab* divu = ns->getDivCond(1,time); int imax = geom.Domain().bigEnd()[0]+1; for (MFIter rhsmfi(rhs); rhsmfi.isValid(); ++rhsmfi) { DEF_CLIMITS((*divu)[rhsmfi],divudat,divulo,divuhi); DEF_LIMITS(rhs[rhsmfi],rhsdat,rhslo,rhshi); Array rcen((*divu)[rhsmfi].box().length(0),1.0); if (isrz == 1) geom.GetCellLoc(rcen,(*divu)[rhsmfi].box(),0); FORT_HGC2N(&nghost,ARLIM(divulo),ARLIM(divuhi),divudat, rcen.dataPtr(), ARLIM(rhslo),ARLIM(rhshi),rhsdat, domlo,domhi,&hx,&isrz,&imax); } delete divu; } // // Put S in the rhs of the projector--cell based version. // void Projection::put_divu_in_cc_rhs (MultiFab& rhs, int level, const BoxArray& grids, Real time) { rhs.setVal(0); NavierStokes* ns = dynamic_cast(&parent->getLevel(level)); BL_ASSERT(!(ns == 0)); MultiFab* divu = ns->getDivCond(1,time); for (MFIter mfi(rhs); mfi.isValid(); ++mfi) { rhs[mfi].copy((*divu)[mfi]); } delete divu; } void Projection::EnforcePeriodicity (MultiFab& psi, int nvar, const BoxArray& /*grids*/, const Geometry& geom) { BL_ASSERT(nvar <= psi.nComp()); geom.FillPeriodicBoundary(psi,0,nvar); } // // Convert U from an Accl-like quantity to a velocity: Unew = Uold + alpha*Unew // void Projection::UnConvertUnew (MultiFab& Uold, Real alpha, MultiFab& Unew, const BoxArray& grids) { for (MFIter Uoldmfi(Uold); Uoldmfi.isValid(); ++Uoldmfi) { BL_ASSERT(grids[Uoldmfi.index()] == Uoldmfi.validbox()); UnConvertUnew(Uold[Uoldmfi],alpha,Unew[Uoldmfi],Uoldmfi.validbox()); } } // // Convert U from an Accleration like quantity to a velocity // Unew = Uold + alpha*Unew. // void Projection::UnConvertUnew (FArrayBox& Uold, Real alpha, FArrayBox& Unew, const Box& grd) { BL_ASSERT(Unew.nComp() >= BL_SPACEDIM); BL_ASSERT(Uold.nComp() >= BL_SPACEDIM); BL_ASSERT(Unew.contains(grd) == true); BL_ASSERT(Uold.contains(grd) == true); const int* lo = grd.loVect(); const int* hi = grd.hiVect(); const int* uo_lo = Uold.loVect(); const int* uo_hi = Uold.hiVect(); const Real* uold = Uold.dataPtr(0); const int* un_lo = Unew.loVect(); const int* un_hi = Unew.hiVect(); const Real* unew = Unew.dataPtr(0); FORT_ACCEL_TO_VEL(lo, hi, uold, ARLIM(uo_lo), ARLIM(uo_hi), &alpha, unew, ARLIM(un_lo), ARLIM(un_hi)); } // // Convert U to an Accleration like quantity: Unew = (Unew - Uold)/alpha // void Projection::ConvertUnew (MultiFab& Unew, MultiFab& Uold, Real alpha, const BoxArray& grids) { for (MFIter Uoldmfi(Uold); Uoldmfi.isValid(); ++Uoldmfi) { BL_ASSERT(grids[Uoldmfi.index()] == Uoldmfi.validbox()); ConvertUnew(Unew[Uoldmfi],Uold[Uoldmfi],alpha,Uoldmfi.validbox()); } } // // Convert U to an Accleration like quantity: Unew = (Unew - Uold)/alpha // void Projection::ConvertUnew( FArrayBox &Unew, FArrayBox &Uold, Real alpha, const Box &grd ) { BL_ASSERT(Unew.nComp() >= BL_SPACEDIM); BL_ASSERT(Uold.nComp() >= BL_SPACEDIM); BL_ASSERT(Unew.contains(grd) == true); BL_ASSERT(Uold.contains(grd) == true); const int* lo = grd.loVect(); const int* hi = grd.hiVect(); const int* uo_lo = Uold.loVect(); const int* uo_hi = Uold.hiVect(); const Real* uold = Uold.dataPtr(0); const int* un_lo = Unew.loVect(); const int* un_hi = Unew.hiVect(); const Real* unew = Unew.dataPtr(0); FORT_VEL_TO_ACCEL(lo, hi, unew, ARLIM(un_lo), ARLIM(un_hi), uold, ARLIM(uo_lo), ARLIM(uo_hi), &alpha ); } // // Update a quantity U using the formula: Unew = Unew + alpha*Uold // void Projection::UpdateArg1 (MultiFab& Unew, Real alpha, MultiFab& Uold, int nvar, const BoxArray& grids, int ngrow) { for (MFIter Uoldmfi(Uold); Uoldmfi.isValid(); ++Uoldmfi) { BL_ASSERT(grids[Uoldmfi.index()] == Uoldmfi.validbox()); UpdateArg1(Unew[Uoldmfi],alpha,Uold[Uoldmfi],nvar,Uoldmfi.validbox(),ngrow); } } // // Update a quantity U using the formula // currently only the velocity, but will do the pressure as well. // Unew = Unew + alpha*Uold // void Projection::UpdateArg1 (FArrayBox& Unew, Real alpha, FArrayBox& Uold, int nvar, const Box& grd, int ngrow) { BL_ASSERT(nvar <= Uold.nComp()); BL_ASSERT(nvar <= Unew.nComp()); Box b = BoxLib::grow(grd,ngrow); const Box& bb = Unew.box(); if (bb.ixType() == IndexType::TheNodeType()) b.surroundingNodes(); BL_ASSERT(Uold.contains(b) == true); BL_ASSERT(Unew.contains(b) == true); const int* lo = b.loVect(); const int* hi = b.hiVect(); const int* uo_lo = Uold.loVect(); const int* uo_hi = Uold.hiVect(); const Real* uold = Uold.dataPtr(0); const int* un_lo = Unew.loVect(); const int* un_hi = Unew.hiVect(); const Real* unew = Unew.dataPtr(0); FORT_PROJ_UPDATE(lo,hi,&nvar,&ngrow, unew, ARLIM(un_lo), ARLIM(un_hi), &alpha, uold, ARLIM(uo_lo), ARLIM(uo_hi) ); } // // Add phi to P. // void Projection::AddPhi (MultiFab& p, MultiFab& phi, const BoxArray& grids) { for (MFIter pmfi(p); pmfi.isValid(); ++pmfi) { p[pmfi].plus(phi[pmfi]); } } // // Convert phi into p^n+1/2. // void Projection::incrPress (int level, Real dt) { MultiFab& P_old = LevelData[level].get_old_data(Press_Type); MultiFab& P_new = LevelData[level].get_new_data(Press_Type); const BoxArray& grids = LevelData[level].boxArray(); for (MFIter P_newmfi(P_new); P_newmfi.isValid(); ++P_newmfi) { const int i = P_newmfi.index(); UpdateArg1(P_new[P_newmfi],1.0/dt,P_old[P_newmfi],1,grids[i],1); P_old[P_newmfi].setVal(BogusValue); } } // // This function scales variables at the start of a projection. // void Projection::scaleVar (MultiFab* sig, int sig_nghosts, MultiFab* vel, const BoxArray& grids, int level) { if (sig != 0) BL_ASSERT(sig->nComp() == 1); if (vel != 0) BL_ASSERT(vel->nComp() >= BL_SPACEDIM); // // Convert sigma from rho to 1/rho. // nghosts info needed to avoid divide by zero. // if (sig != 0) sig->invert(1.0,sig_nghosts); // // Scale by radius for RZ. // if (CoordSys::IsRZ()) { if (sig != 0) radMult(level,*sig,0); if (vel != 0) for (int n = 0; n < BL_SPACEDIM; n++) radMult(level,*vel,n); } // // Scale level projection variables for a particular projection. // proj_scale_var(sig,vel,grids,level); } // // This function rescales variables at the end of a projection. // void Projection::rescaleVar (MultiFab* sig, int sig_nghosts, MultiFab* vel, const BoxArray& grids, int level) { if (sig != 0) BL_ASSERT(sig->nComp() == 1); if (vel != 0) BL_ASSERT(vel->nComp() >= BL_SPACEDIM); // // Divide by radius to rescale for RZ coordinates. // if (CoordSys::IsRZ()) { if (sig != 0) radDiv(level,*sig,0); if (vel != 0) for (int n = 0; n < BL_SPACEDIM; n++) radDiv(level,*vel,n); } // // Convert sigma from 1/rho to rho // NOTE: this must come after division by r to be correct, // nghosts info needed to avoid divide by zero. // if (sig != 0) sig->invert(1.0,sig_nghosts); // // Unscale level projection variables for a particular projection. // proj_unscale_var(sig,vel,grids,level); } // // Multiply by a radius for r-z coordinates. // void Projection::radMult (int level, MultiFab& mf, int comp) { BL_ASSERT(radius_grow >= mf.nGrow()); BL_ASSERT(comp >= 0 && comp < mf.nComp()); int ngrow = mf.nGrow(); int nr = radius_grow; const Box& domain = parent->Geom(level).Domain(); const int* domlo = domain.loVect(); const int* domhi = domain.hiVect(); Real bogus_value = BogusValue; for (MFIter mfmfi(mf); mfmfi.isValid(); ++mfmfi) { BL_ASSERT(mf.box(mfmfi.index()) == mfmfi.validbox()); const int* lo = mfmfi.validbox().loVect(); const int* hi = mfmfi.validbox().hiVect(); Real* dat = mf[mfmfi].dataPtr(comp); Real* rad = &radius[level][mfmfi.index()]; FORT_RADMPY(dat,ARLIM(lo),ARLIM(hi),domlo,domhi,&ngrow, rad,&nr,&bogus_value); } } // // Divide by a radius for r-z coordinates. // void Projection::radDiv (int level, MultiFab& mf, int comp) { BL_ASSERT(comp >= 0 && comp < mf.nComp()); BL_ASSERT(radius_grow >= mf.nGrow()); int ngrow = mf.nGrow(); int nr = radius_grow; const Box& domain = parent->Geom(level).Domain(); const int* domlo = domain.loVect(); const int* domhi = domain.hiVect(); Real bogus_value = BogusValue; for (MFIter mfmfi(mf); mfmfi.isValid(); ++mfmfi) { BL_ASSERT(mf.box(mfmfi.index()) == mfmfi.validbox()); const int* lo = mfmfi.validbox().loVect(); const int* hi = mfmfi.validbox().hiVect(); Real* dat = mf[mfmfi].dataPtr(comp); Real* rad = &radius[level][mfmfi.index()]; FORT_RADDIV(dat,ARLIM(lo),ARLIM(hi),domlo,domhi,&ngrow, rad,&nr,&bogus_value); } } // // This projects the initial vorticity field (stored in pressure) // to define an initial velocity field. // void Projection::initialVorticityProject (int c_lev) { #if (BL_SPACEDIM == 2) int f_lev = finest_level; if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "initialVorticityProject: levels = " << c_lev << " " << f_lev << std::endl; } // // Set up projector bndry just for this projection. // const int* lo_bc = phys_bc->lo(); const int* hi_bc = phys_bc->hi(); const Geometry& geom = parent->Geom(0); RegType proj_bc[BL_SPACEDIM][2]; proj_bc[0][0] = outflow; proj_bc[0][1] = outflow; if (geom.isPeriodic(0)) { proj_bc[0][0] = periodic; proj_bc[0][1] = periodic; } proj_bc[1][0] = outflow; proj_bc[1][1] = outflow; if (geom.isPeriodic(1)) { proj_bc[1][0] = periodic; proj_bc[1][1] = periodic; } delete projector_bndry; #ifdef BL_USE_HGPROJ_SERIAL projector_bndry = new inviscid_fluid_boundary_class(proj_bc); #else projector_bndry = new inviscid_fluid_boundary(proj_bc); #endif bldSyncProject(); MultiFab* vel[MAX_LEV] = {0}; PArray p_real(f_lev+1,PArrayManage); PArray s_real(f_lev+1,PArrayManage); for (int lev = c_lev; lev <= f_lev; lev++) { MultiFab& P_new = LevelData[lev].get_new_data(Press_Type); const int nghost = 1; s_real.set(lev,new MultiFab(LevelData[lev].boxArray(),1,nghost)); s_real[lev].setVal(1,nghost); p_real.set(lev,new MultiFab(P_new.boxArray(),1,nghost)); p_real[lev].setVal(0,nghost); } // // Set up outflow bcs. // const Array& full_mesh = sync_proj->mesh(); PArray u_real[BL_SPACEDIM]; PArray rhs_real(f_lev+1,PArrayManage); for (int n = 0; n < BL_SPACEDIM; n++) u_real[n].resize(f_lev+1,PArrayManage); for (int lev = c_lev; lev <= f_lev; lev++) { for (int n = 0; n < BL_SPACEDIM; n++) { u_real[n].set(lev, new MultiFab(full_mesh[lev], 1, 1)); u_real[n][lev].setVal(0); } // // The vorticity is stored in the new pressure variable for now. // MultiFab& P_new = LevelData[lev].get_new_data(Press_Type); rhs_real.set(lev, new MultiFab(P_new.boxArray(), 1, 1)); for (MFIter mfi(rhs_real[lev]); mfi.isValid(); ++mfi) { rhs_real[lev][mfi].setVal(0); rhs_real[lev][mfi].copy(P_new[mfi], 0, 0); } } MultiFab* sync_resid_crse = 0; MultiFab* sync_resid_fine = 0; // // Project. // const Real* dx_lev = parent->Geom(f_lev).CellSize(); const bool use_u = false; sync_proj->manual_project(u_real,p_real,rhs_real,null_amr_real,s_real, sync_resid_crse, sync_resid_fine, parent->Geom(c_lev), use_u,(Real*)dx_lev, proj_tol,c_lev,f_lev,proj_abs_tol); const int idx[2] = {1, 0}; for (int lev = c_lev; lev <= f_lev; lev++) { vel[lev] = &LevelData[lev].get_new_data(State_Type); // // Note: Here u_real from projection is -grad(phi), but if // phi is the stream function, u=dphi/dy, v=-dphi/dx // (u_real[Yvel][lev]).mult(-1,0,1); for (int n = 0; n < BL_SPACEDIM; n++) { for (MFIter mfi(*vel[lev]); mfi.isValid(); ++mfi) { const Box& box = mfi.validbox(); if (add_vort_proj) { (*vel[lev])[mfi].plus(u_real[n][lev][mfi],box,0,Xvel+idx[n], 1); } else { (*vel[lev])[mfi].copy(u_real[n][lev][mfi],box,0,box,Xvel+idx[n], 1); } } } } // // Reset the boundary conditions for all the other projections. // setUpBcs(); // // Remove the sync projector built with these bc's. // delete sync_proj; sync_proj = 0; #else BoxLib::Error("Projection::initialVorticityProject(): not implented yet for 3D"); #endif } void Projection::putDown (MultiFab** phi, FArrayBox* phi_fine_strip, int c_lev, int f_lev, const Orientation* outFaces, int numOutFlowFaces, int ncStripWidth) { // // Put down to coarser levels. // const int nCompPhi = 1; // phi_fine_strip.nComp(); const int nGrow = 0; // phi_fine_strip.nGrow(); IntVect ratio = IntVect::TheUnitVector(); for (int lev = f_lev-1; lev >= c_lev; lev--) { ratio *= parent->refRatio(lev); const Box& domainC = parent->Geom(lev).Domain(); BoxList phiC_strip_bl(IndexType::TheNodeType()); FArrayBox phi_crse_strip[2*BL_SPACEDIM]; // (phiC_strip_ba, nCompPhi, nGrow); for (int iface = 0; iface < numOutFlowFaces; iface++) { Box phiC_strip = BoxLib::surroundingNodes(BoxLib::bdryNode(domainC, outFaces[iface], ncStripWidth)); phiC_strip.grow(nGrow); phi_crse_strip[iface].resize(phiC_strip, nCompPhi); phi_crse_strip[iface].setVal(0); } for ( int iface = 0; iface < numOutFlowFaces; ++iface ) { Box ovlp = BoxLib::coarsen(phi_fine_strip[iface].box(),ratio) & phi_crse_strip[iface].box(); FORT_PUTDOWN (BL_TO_FORTRAN(phi_crse_strip[iface]), BL_TO_FORTRAN(phi_fine_strip[iface]), ovlp.loVect(), ovlp.hiVect(), ratio.getVect()); } for ( int iface = 0; iface < numOutFlowFaces; ++iface ) { phi[lev]->copy(phi_crse_strip[iface]); } } } void Projection::getStreamFunction (PArray& phi) { #if (BL_SPACEDIM == 2) int c_lev = 0; int f_lev = finest_level; if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "getStreamFunction: levels = " << c_lev << " " << f_lev << std::endl; } // // Set up projector bndry just for this projection. // const int* lo_bc = phys_bc->lo(); const int* hi_bc = phys_bc->hi(); const Geometry& geom = parent->Geom(0); RegType proj_bc[BL_SPACEDIM][2]; proj_bc[0][0] = outflow; proj_bc[0][1] = outflow; if (geom.isPeriodic(0)) { proj_bc[0][0] = periodic; proj_bc[0][1] = periodic; } proj_bc[1][0] = outflow; proj_bc[1][1] = outflow; if (geom.isPeriodic(1)) { proj_bc[1][0] = periodic; proj_bc[1][1] = periodic; } delete projector_bndry; #ifdef BL_USE_HGPROJ_SERIAL projector_bndry = new inviscid_fluid_boundary_class(proj_bc); #else projector_bndry = new inviscid_fluid_boundary(proj_bc); #endif bldSyncProject(); MultiFab* vel[MAX_LEV] = {0}; PArray p_real(f_lev+1,PArrayManage); PArray s_real(f_lev+1,PArrayManage); const int nghost = 1; for (int lev = c_lev; lev <= f_lev; lev++) { s_real.set(lev,new MultiFab(LevelData[lev].boxArray(),1,nghost)); s_real[lev].setVal(1,nghost); p_real.set(lev,&phi[lev]); } // // Set up outflow bcs. // const Array& full_mesh = sync_proj->mesh(); PArray u_real[BL_SPACEDIM]; for (int n = 0; n < BL_SPACEDIM; n++) u_real[n].resize(f_lev+1,PArrayManage); // // Copy the velocity field into u_real. // for (int lev = c_lev; lev <= f_lev; lev++) { vel[lev] = &LevelData[lev].get_new_data(State_Type); for (int n = 0; n < BL_SPACEDIM; n++) { u_real[n].set(lev, new MultiFab(full_mesh[lev], 1, 1)); for (int i = 0; i < full_mesh[lev].size(); i++) { vel[lev] = &LevelData[lev].get_new_data(State_Type); u_real[n][lev][i].copy((*vel[lev])[i], n, 0); } } } // // Project. // const Real* dx_lev = parent->Geom(f_lev).CellSize(); sync_proj->stream_func_project(u_real,p_real,s_real, (Real*)dx_lev, proj_tol, c_lev,f_lev,proj_abs_tol); // // Reset the boundary conditions for all the other projections. // setUpBcs(); // // Remove the sync projector built with these bc's. // delete sync_proj; sync_proj = 0; #else BoxLib::Error("Projection::getStreamFunction(): not implented yet for 3D"); #endif } // // Given a nodal pressure P compute the pressure gradient at the // contained cell centers. void Projection::getGradP (FArrayBox& p_fab, FArrayBox& gp, const Box& gpbox_to_fill, const Real* dx) { // // Test to see if p_fab contains gpbox_to_fill // BL_ASSERT(BoxLib::enclosedCells(p_fab.box()).contains(gpbox_to_fill)); const int* plo = p_fab.loVect(); const int* phi = p_fab.hiVect(); const int* glo = gp.box().loVect(); const int* ghi = gp.box().hiVect(); const int* lo = gpbox_to_fill.loVect(); const int* hi = gpbox_to_fill.hiVect(); const Real* p_dat = p_fab.dataPtr(); const Real* gp_dat = gp.dataPtr(); #if (BL_SPACEDIM == 2) int is_full = 0; if (hg_stencil == holy_grail_amr_multigrid::full) is_full = 1; FORT_GRADP(p_dat,ARLIM(plo),ARLIM(phi),gp_dat,ARLIM(glo),ARLIM(ghi),lo,hi,dx, &is_full); #elif (BL_SPACEDIM == 3) FORT_GRADP(p_dat,ARLIM(plo),ARLIM(phi),gp_dat,ARLIM(glo),ARLIM(ghi),lo,hi,dx); #endif } void Projection::set_outflow_bcs (int which_call, MultiFab** phi, MultiFab** Vel_in, MultiFab** Divu_in, MultiFab** Sig_in, int c_lev, int f_lev, int have_divu) { BL_ASSERT((which_call == INITIAL_VEL ) || (which_call == INITIAL_PRESS) || (which_call == INITIAL_SYNC ) || (which_call == LEVEL_PROJ ) ); if (which_call != LEVEL_PROJ) BL_ASSERT(c_lev == 0); if ( verbose && ParallelDescriptor::IOProcessor() ) { std::cout << "...setting outflow bcs for the nodal projection ... " << std::endl; } bool hasOutFlow; Orientation outFaces[2*BL_SPACEDIM]; Orientation outFacesAtThisLevel[MAXLEV][2*BL_SPACEDIM]; int fine_level[2*BL_SPACEDIM]; int numOutFlowFacesAtAllLevels; int numOutFlowFaces[MAXLEV]; OutFlowBC::GetOutFlowFaces(hasOutFlow,outFaces,phys_bc,numOutFlowFacesAtAllLevels); // // Get 2-wide cc box, state_strip, along interior of top. // Get 1-wide nc box, phi_strip , along top. // const int ccStripWidth = 2; const int nCompPhi = 1; const int srcCompVel = Xvel; const int srcCompDivu = 0; const int nCompVel = BL_SPACEDIM; const int nCompDivu = 1; // // Determine the finest level such that the entire outflow face is covered // by boxes at this level (skip if doesnt touch, and bomb if only partially // covered). // Box state_strip[MAXLEV][2*BL_SPACEDIM]; int icount[MAXLEV]; for (int i=0; i < MAXLEV; i++) icount[i] = 0; // // This loop is only to define the number of outflow faces at each level. // Box temp_state_strip; for (int iface = 0; iface < numOutFlowFacesAtAllLevels; iface++) { const int outDir = outFaces[iface].coordDir(); fine_level[iface] = -1; for (int lev = f_lev; lev >= c_lev; lev--) { Box domain = parent->Geom(lev).Domain(); if (outFaces[iface].faceDir() == Orientation::high) { temp_state_strip = Box(BoxLib::adjCellHi(domain,outDir,ccStripWidth)).shift(outDir,-ccStripWidth); } else { temp_state_strip = Box(BoxLib::adjCellLo(domain,outDir,ccStripWidth)).shift(outDir,ccStripWidth); } // Grow the box by one tangentially in order to get velocity bc's. for (int dir = 0; dir < BL_SPACEDIM; dir++) if (dir != outDir) temp_state_strip.grow(dir,1); const BoxArray& Lgrids = parent->getLevel(lev).boxArray(); const Box valid_state_strip = temp_state_strip & domain; const BoxArray uncovered_outflow_ba = BoxLib::complementIn(valid_state_strip,Lgrids); BL_ASSERT( !(uncovered_outflow_ba.size() && BoxLib::intersect(Lgrids,valid_state_strip).size()) ); if ( !(uncovered_outflow_ba.size()) && fine_level[iface] == -1) { int ii = icount[lev]; outFacesAtThisLevel[lev][ii] = outFaces[iface]; state_strip[lev][ii] = temp_state_strip; fine_level[iface] = lev; icount[lev]++; } // end level loop } // end iface loop } for (int lev = f_lev; lev >= c_lev; lev--) { numOutFlowFaces[lev] = icount[lev]; } NavierStokes* ns0 = dynamic_cast(&LevelData[c_lev]); BL_ASSERT(!(ns0 == 0)); int Divu_Type, Divu; Real gravity; if (which_call == INITIAL_SYNC || which_call == INITIAL_VEL) { gravity = 0.; if (!LevelData[c_lev].isStateVariable("divu", Divu_Type, Divu)) BoxLib::Error("Projection::set_outflow_bcs: No divu."); } if (which_call == INITIAL_PRESS || which_call == LEVEL_PROJ) { gravity = ns0->getGravity(); if (!LevelData[c_lev].isStateVariable("divu", Divu_Type, Divu) && (gravity == 0.) ) BoxLib::Error("Projection::set_outflow_bcs: No divu or gravity."); } for (int lev = c_lev; lev <= f_lev; lev++) { if (numOutFlowFaces[lev] > 0) set_outflow_bcs_at_level (which_call,lev,c_lev, state_strip[lev], outFacesAtThisLevel[lev], numOutFlowFaces[lev], phi, Vel_in[lev], Divu_in[lev], Sig_in[lev], have_divu, gravity); } } void Projection::set_outflow_bcs_at_level (int which_call, int lev, int c_lev, Box* state_strip, Orientation* outFacesAtThisLevel, int numOutFlowFaces, MultiFab** phi, MultiFab* Vel_in, MultiFab* Divu_in, MultiFab* Sig_in, int have_divu, Real gravity) { NavierStokes* ns = dynamic_cast(&LevelData[lev]); BL_ASSERT(!(ns == 0)); Box domain = parent->Geom(lev).Domain(); BoxList phi_strip_bl(IndexType::TheNodeType()); BoxList state_strip_bl; const int ncStripWidth = 1; FArrayBox rho[2*BL_SPACEDIM]; FArrayBox dsdt[2*BL_SPACEDIM]; FArrayBox dudt[1][2*BL_SPACEDIM]; FArrayBox phi_fine_strip[2*BL_SPACEDIM]; for (int iface = 0; iface < numOutFlowFaces; iface++) { dsdt[iface].resize(state_strip[iface],1); dudt[0][iface].resize(state_strip[iface],BL_SPACEDIM); rho[iface].resize(state_strip[iface],1); Sig_in->copy(rho[iface]); Box phi_strip = BoxLib::surroundingNodes(BoxLib::bdryNode(domain, outFacesAtThisLevel[iface], ncStripWidth)); phi_fine_strip[iface].resize(phi_strip,1); phi_fine_strip[iface].setVal(0.); } ProjOutFlowBC projBC; if (which_call == INITIAL_PRESS) { projBC.computeRhoG(rho,phi_fine_strip, parent->Geom(lev), outFacesAtThisLevel,numOutFlowFaces,gravity); } else { if (have_divu) { Vel_in->FillBoundary(); // Build a new MultiFab for which the cells outside the domain // are in the valid region instead of being ghost cells, so that // we can copy these values into the dudt array. BoxList grown_vel_bl; for (int i = 0; i < Vel_in->size(); i++) grown_vel_bl.push_back(BoxLib::grow(Vel_in->boxArray()[i],1)); BoxArray grown_vel_ba(grown_vel_bl); MultiFab grown_vel(grown_vel_ba,BL_SPACEDIM,0); for (MFIter vmfi(*Vel_in); vmfi.isValid(); ++vmfi) { grown_vel[vmfi.index()].copy((*Vel_in)[vmfi.index()]); } for (int iface = 0; iface < numOutFlowFaces; iface++) { grown_vel.copy(dudt[0][iface]); Divu_in->copy(dsdt[iface]); } } else { for (int iface = 0; iface < numOutFlowFaces; iface++) { Vel_in->copy(dudt[0][iface]); dsdt[iface].setVal(0.); } } projBC.computeBC(dudt, dsdt, rho, phi_fine_strip, parent->Geom(lev), outFacesAtThisLevel, numOutFlowFaces, gravity); } for ( int iface = 0; iface < numOutFlowFaces; iface++) { phi[lev]->copy(phi_fine_strip[iface]); } if (lev > c_lev) { putDown(phi, phi_fine_strip, c_lev, lev, outFacesAtThisLevel, numOutFlowFaces, ncStripWidth); } } ccseapps-2.5/CCSEApps/iamrlib/run3d/0000755000175000017500000000000011634153073020331 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/run3d/Make.package0000644000175000017500000000025411634153073022524 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.2 1999/01/06 21:28:15 lijewski Exp $ # CEXE_sources += NS_setup.cpp NSBld.cpp FEXE_headers += probdata.H PROB_F.H FEXE_sources += PROB_$(DIM)D.F ccseapps-2.5/CCSEApps/iamrlib/run3d/README.3D0000644000175000017500000000416211634153073021461 0ustar amckinstryamckinstry Included in this run3d directory are a sample inputs file, inputs.3d.euler, and the accompanying "probin" file, probin.3d.euler, that supplies problem-dependent paramters for the calculation. There are a large number of options which can be specified from the inputs and probin files, as well as significant changes which can be made with relatively small changes to the program files, especially PROB_3D.F and NS_setup.cpp. Most of the options which can be specified from the inputs files are left to their default values in the sample calculation. This code is a research code, and is continually being modified and improved as our needs evolve. Because the list of options is so extensive, and the updates relatively frequent, we heartily encourage you to contact us directly (email to ASAlmgren@lbl.gov) if you want to modify the code supplied here for your own calculations. There is extensive but undocumented capability. That said, we welcome your comments, suggestions, and other feedback. Again, email to ASALmgren@lbl.gov. The test case is a "vortex tube" in a constant density fluid in a triply periodic geometry. The inputs file is set up for the calculation to run to time 2.0 (which takes 44 coarse grid time steps), and to allow one level of refinement with factor 2. The refinement criteria are the presence of a tracer and the magnitude of vorticity. In the PlotFiles directory, you will find four of the plotfiles which are generated if you run the code with this inputs file. Run amrvis3d on any of these to view the results. (We have included "amrvis.defaults" and "Palette" files as well.) As a starting point for code changes: the initial data are specified in PROB_3D.F. We have included several different subroutines for defining different intial data. The variable "probtype," set in the probin file, selects between these subroutines. You may also, of course, write your own by modifying PROB_3D.F. The criteria used for error estimation are specified in NS_setup.cpp, and can depend on any or all of the state variables or derived quantities. The derived quantities are also specified in NS_setup.cpp. ccseapps-2.5/CCSEApps/iamrlib/run3d/GNUmakefile0000644000175000017500000001540411634153073022407 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.26 2002/10/04 19:19:32 almgren Exp $ # PBOXLIB_HOME = ../.. TOP = $(PBOXLIB_HOME) # # Variables for the user to set ... # PRECISION = DOUBLE DEBUG = FALSE DEBUG = FALSE DEBUG = TRUE PROFILE = FALSE DIM = 3 COMP = g++ USE_MPI = TRUE USE_MPI = FALSE NAMESPACE = TRUE NAMESPACE = FALSE #STRICTLY = TRUE # # Hypre support # USE_HYPRE=TRUE USE_HYPRE=FALSE # # Use hgproj-serial -- only for testing. # # Touch Projection.cpp if you want to change the state of USE_HGPROJ_SERIAL. # USE_HGPROJ_SERIAL = TRUE USE_HGPROJ_SERIAL = FALSE USE_VAMPIRE = TRUE USE_VAMPIRE = FALSE ifeq ($(USE_HGPROJ_SERIAL),TRUE) # # What stencil do you want to use? # PRVERSION = v7 EBASE = amr-serial DEFINES += -DBL_USE_HGPROJ_SERIAL else EBASE = amr endif include $(TOP)/mk/Make.defs ./Make.package BUILD_INPLACE:=FALSE BUILD_INPLACE:=TRUE ifeq ($(STRICTLY),TRUE) ifeq ($(COMP),KCC) CXXFLAGS += --strict CXXFLAGS += --display_error_number CPPFLAGS += -D__KAI_STRICT CXXFLAGS += --diag_suppress 450 endif endif ifeq ($(BUILD_INPLACE), TRUE) include $(TOP)/iamrlib/Make.package include $(TOP)/mglib/Make.package include $(TOP)/tensorMG/Make.package include $(TOP)/amrlib/Make.package include $(TOP)/bndrylib/Make.package include $(TOP)/hgproj/Make.package include $(TOP)/BoxLib/Make.package INCLUDE_LOCATIONS += . INCLUDE_LOCATIONS += $(TOP)/iamrlib INCLUDE_LOCATIONS += $(TOP)/mglib INCLUDE_LOCATIONS += $(TOP)/tensorMG INCLUDE_LOCATIONS += $(TOP)/amrlib INCLUDE_LOCATIONS += $(TOP)/bndrylib INCLUDE_LOCATIONS += $(TOP)/hgproj INCLUDE_LOCATIONS += $(TOP)/BoxLib ifeq ($(USE_HYPRE),TRUE) HYPRE_DIR := $(PBOXLIB_HOME)/hypre LIBRARY_LOCATIONS += $(HYPRE_DIR)/lib INCLUDE_LOCATIONS += $(HYPRE_DIR)/include INCLUDE_LOCATIONS += $(HYPRE_DIR)/HypreABec HYPRE_LIBS := \ -lHYPRE_ls \ -lHYPRE_mv \ -lHYPRE_parcsr_ls \ -lHYPRE_DistributedMatrixPilutSolver \ -lHYPRE_ParaSails \ -lHYPRE_MatrixMatrix \ -lHYPRE_DistributedMatrix \ -lHYPRE_IJ_mv \ -lHYPRE_parcsr_mv \ -lHYPRE_seq_mv \ -lHYPRE_utilities LIBRARIES += $(HYPRE_LIBS) CPPFLAGS += -DMG_USE_HYPRE include $(HYPRE_DIR)/HypreABec/Make.package endif else ifeq ($(USE_HGPROJ_SERIAL),FALSE) INCLUDE_LOCATIONS += . .. $(TOP)/include LIBRARY_LOCATIONS += $(TOP)/lib/$(machineSuffix) LIBRARIES += -liamr$(DIM)d -lmg$(DIM)d -lmcmg$(DIM)d -lamr$(DIM)d -lbndry$(DIM)d -lproj$(DIM)d -lbox$(DIM)d else INCLUDE_LOCATIONS += . .. $(TOP)/hgproj-serial INCLUDE_LOCATIONS += $(TOP)/hgproj-serial/include/$(DIM)d.$(PRVERSION) INCLUDE_LOCATIONS += $(TOP)/include LIBRARY_LOCATIONS += $(TOP)/hgproj-serial/lib/$(machineSuffix) $(TOP)/lib/$(machineSuffix) LIBRARIES += -liamr$(DIM)d -lmg$(DIM)d -lmcmg$(DIM)d -lamr$(DIM)d -lbndry$(DIM)d -lproj$(DIM)d.$(PRVERSION) -lbox$(DIM)d endif ifeq ($(USE_HYPRE),TRUE) error hypre not here yet endif endif ifeq ($(MACHINE),T3E) ifeq ($(USE_VAMPIRE),TRUE) # use vampir trace LIBRARY_LOCATIONS += /usr/local/pkg/acts/VT151/lib LIBRARY_LOCATIONS += /opt/ctl/mpt/mpt/lib XTRALIBS += -lVT -lpmpi endif endif ifeq ($(USE_ARRAYVIEW),TRUE) DEFINES += -DBL_USE_ARRAYVIEW DEFINES += -DBL_ARRAYVIEW_TAGBOX endif ifeq ($(MACHINE),IRIX64) ifeq ($(WHICHIRIX64),ESCHER) XTRALIBS += -IPA endif endif ifeq ($(MACHINE),OSF1) # # Some additional stuff for our preferred development/debugging environment. # ifeq ($(PRECISION),DOUBLE) FFLAGS += -real_size 64 endif FDEBF += -C FDEBF += -warn argument_checking FDEBF += -warn declarations ifneq ($(FC), f90) FDEBF += -warn truncated_source FDEBF += -warn unused endif endif # # For Running 3rd Only # 3RD = 1 3RD = ifdef 3RD LDFLAGS += --link_command_prefix 3rd LDFLAGS += -non_shared -v endif #XTRALIBS += --backend -lpat --backend pat.cld ifeq ($(BUILD_INPLACE), TRUE) vpath_cpp := . $(TOP)/iamrlib $(TOP)/mglib $(TOP)/tensorMG $(TOP)/amrlib $(TOP)/bndrylib vpath_H := . $(TOP)/iamrlib $(TOP)/mglib $(TOP)/tensorMG $(TOP)/amrlib $(TOP)/bndrylib vpath_FH := . $(TOP)/iamrlib $(TOP)/mglib $(TOP)/tensorMG $(TOP)/amrlib $(TOP)/bndrylib vpath_h := . $(TOP)/iamrlib $(TOP)/mglib $(TOP)/tensorMG $(TOP)/amrlib $(TOP)/bndrylib vpath_F := . $(TOP)/iamrlib $(TOP)/mglib $(TOP)/tensorMG $(TOP)/amrlib $(TOP)/bndrylib vpath_cpp += $(TOP)/hgproj vpath_H += $(TOP)/hgproj vpath_FH += $(TOP)/hgproj vpath_h += $(TOP)/hgproj vpath_F += $(TOP)/hgproj vpath_f += $(TOP)/hgproj ifeq ($(USE_HYPRE),TRUE) vpath_cpp += $(HYPRE_DIR)/HypreABec vpath_H += $(HYPRE_DIR)/HypreABec vpath_F += $(HYPRE_DIR)/HypreABec endif ifeq ($(USE_BL3),TRUE) vpath_cpp += $(BOXLIB3_HOME) vpath_H += $(BOXLIB3_HOME) endif vpath_cpp += $(TOP)/BoxLib vpath_H += $(TOP)/BoxLib vpath_FH += $(TOP)/BoxLib vpath_h += $(TOP)/BoxLib vpath_F += $(TOP)/BoxLib vpath_f += $(TOP)/BoxLib vpath %.cpp $(vpath_cpp) vpath %.H $(vpath_H) vpath %.FH $(vpath_FH) vpath %.h $(vpath_h) vpath %.F $(vpath_F) vpath %.f $(vpath_f) else vpath %.H .. vpath %.cpp .. vpath %.a $(LIBRARY_LOCATIONS) endif all: $(executable) ifeq ($(MACHINE),T3E) # # We don't explicity set the path of the mpi directory on the T3E. # $(executable): $(filter-out $(HYPRE_LIBS) -lmpi, $(LIBRARIES)) else $(executable): $(filter-out $(HYPRE_LIBS), $(LIBRARIES)) endif ifneq ($(BUILD_INPLACE), TRUE) # # Build and install all libraries needed in an appropriate order. # MyMakeLine = $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) \ DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) \ USE_HGPROJ_SERIAL=$(USE_HGPROJ_SERIAL) PRVERSION=$(PRVERSION) \ DEFINES="$(DEFINES)" libs: cd $(TOP)/BoxLib; $(MyMakeLine) install cd $(TOP)/bndrylib; $(MyMakeLine) install cd $(TOP)/amrlib; $(MyMakeLine) install ifeq ($(USE_HGPROJ_SERIAL),FALSE) cd $(TOP)/hgproj; $(MyMakeLine) LBASE=proj EBASE= install else cd $(TOP)/hgproj-serial; $(MyMakeLine) LBASE=proj EBASE= endif ifeq ($(USE_HYPRE),TRUE) cd $(HYPRE_DIR)/HypreABec; $(MyMakeLine) install endif cd $(TOP)/mglib; $(MyMakeLine) install cd $(TOP)/tensorMG; $(MyMakeLine) install cd $(TOP)/iamrlib; $(MyMakeLine) install # # Cleanup libraries. # cleanlibs: cd $(TOP)/BoxLib; $(MyMakeLine) clean cd $(TOP)/bndrylib; $(MyMakeLine) clean cd $(TOP)/amrlib; $(MyMakeLine) clean ifeq ($(USE_HGPROJ_SERIAL),FALSE) cd $(TOP)/hgproj; $(MyMakeLine) LBASE=proj EBASE= clean else cd $(TOP)/hgproj-serial; $(MyMakeLine) LBASE=proj EBASE= clean endif ifeq ($(USE_HYPRE),TRUE) cd $(HYPRE_DIR)/HypreABec; $(MyMakeLine) clean endif cd $(TOP)/mglib; $(MyMakeLine) clean cd $(TOP)/tensorMG; $(MyMakeLine) clean cd $(TOP)/iamrlib; $(MyMakeLine) clean endif include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/iamrlib/run3d/.3rd0000644000175000017500000000001311634153073021014 0ustar amckinstryamckinstryignore rus ccseapps-2.5/CCSEApps/iamrlib/run3d/probin.3d.euler0000644000175000017500000000006111634153073023162 0ustar amckinstryamckinstry $fortin probtype = 7 vorterr = .25 $end ccseapps-2.5/CCSEApps/iamrlib/run3d/probdata.H0000644000175000017500000000407711634153073022246 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ REAL_T denerr, vorterr, adverr, temperr, randfact, bubgrad REAL_T denfact, xblob, yblob, zblob, radblob, velfact REAL_T rhozero, tempzero, r_d, c_d, adv_vel, radvort REAL_T den1,den2,vel1,vel2,delta0,xlev1,zlev1,amag,freq(10),mag(10) REAL_T f_problo(SDIM), f_probhi(SDIM) integer probtype, adv_dir, axis_dir, vb_unifdir common /probdt1/ probtype, adv_dir, axis_dir common /probdt2/ den1,den2,vel1,vel2,delta0, & xlev1,zlev1,freq,mag common /probdt3/ vorterr, adverr, denerr, temperr common /probdt4/ denfact, xblob, yblob, zblob, radvort, & radblob, velfact, randfact, bubgrad common /probdt5/ rhozero, tempzero, r_d, c_d, adv_vel common /probdt6/f_problo, f_probhi common /probdt7/vb_unifdir ccseapps-2.5/CCSEApps/iamrlib/run3d/inputs.3d.euler0000644000175000017500000001001011634153073023206 0ustar amckinstryamckinstry#******************************************************************************* # INPUTS.3D.EULER #******************************************************************************* #NOTE: You may set *either* max_step or stop_time, or you may set them both. # Maximum number of coarse grid timesteps to be taken, if stop_time is # not reached first. max_step = 10000 # Time at which calculation stops, if max_step is not reached first. stop_time = 2.0 #******************************************************************************* # Number of cells in each coordinate direction at the coarsest level amr.n_cell = 16 16 16 #******************************************************************************* # Maximum level (defaults to 0 for single level calculation) amr.max_level = 1 # maximum number of levels of refinement #******************************************************************************* # Interval (in number of level l timesteps) between regridding amr.regrid_int = 2 #******************************************************************************* # Refinement ratio as a function of level amr.ref_ratio = 2 #******************************************************************************* # Sets the "NavierStokes" code to be verbose ns.v = 1 #******************************************************************************* # Sets the "amr" code to be verbose amr.v = 1 #******************************************************************************* # Interval (in number of coarse timesteps) between checkpoint(restart) files amr.check_int = 10 #******************************************************************************* # Interval (in number of coarse timesteps) between plot files amr.plot_int = 10 #******************************************************************************* # CFL number to be used in calculating the time step : dt = dx / max(velocity) ns.cfl = 0.9 # CFL number used to set dt #******************************************************************************* # Factor by which the first time is shrunk relative to CFL constraint ns.init_shrink = 1.0 # factor which multiplies the very first time step #******************************************************************************* # Viscosity coefficient ns.vel_visc_coef = 0.0 #******************************************************************************* # Diffusion coefficient for first scalar ns.scal_diff_coefs = 0.0 #******************************************************************************* # Name of the file which specifies problem-specific parameters (defaults to "probin") amr.probin_file = probin.3d.euler #******************************************************************************* # Set to 0 if x-y coordinate system, set to 1 if r-z (in 2-d). geometry.coord_sys = 0 #******************************************************************************* # Physical dimensions of the low end of the domain. geometry.prob_lo = 0. 0. 0. # Physical dimensions of the high end of the domain. geometry.prob_hi = 1. 1. 1. #******************************************************************************* #Set to 1 if periodic in that direction geometry.is_periodic = 1 1 1 #******************************************************************************* # Boundary conditions on the low end of the domain. ns.lo_bc = 0 0 0 # Boundary conditions on the high end of the domain. ns.hi_bc = 0 0 0 # 0 = Interior/Periodic 3 = Symmetry # 1 = Inflow 4 = SlipWall # 2 = Outflow 5 = NoSlipWall #******************************************************************************* # Factor by which grids must be coarsenable. amr.blocking_factor = 8 #******************************************************************************* # Add vorticity to the variables in the plot files. amr.derive_plot_vars = mag_vort #******************************************************************************* ccseapps-2.5/CCSEApps/iamrlib/run3d/.cvsignore0000644000175000017500000000021011634153073022322 0ustar amckinstryamckinstry*.for Debug Debug3D Release Release3D *.ncb *.opt *.plg grdlog ti_files chk[0-9][0-9][0-9][0-9] plt[0-9][0-9][0-9][0-9] *.pixie *.Addrs ccseapps-2.5/CCSEApps/iamrlib/run3d/PROB_3D.F0000644000175000017500000031153311634153073021536 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: PROB_3D.F,v 1.20 2002/06/03 21:38:01 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "PROB_AMR_F.H" #include "PROB_NS_F.H" #include "ArrayLim.H" #define SDIM 3 c ::: ----------------------------------------------------------- c ::: This routine is called at problem initialization time c ::: and when restarting from a checkpoint file. c ::: The purpose is (1) to specify the initial time value c ::: (not all problems start at time=0.0) and (2) to read c ::: problem specific data from a namelist or other input c ::: files and possibly store them or derived information c ::: in FORTRAN common blocks for later use. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: init => TRUE if called at start of problem run c ::: FALSE if called from restart c ::: name => name of "probin" file c ::: namlen => length of name c ::: strttime <= start problem with this time variable c ::: c ::: ----------------------------------------------------------- subroutine FORT_PROBINIT (init,name,namlen,problo,probhi) integer init,namlen integer name(namlen) integer untin, i REAL_T problo(SDIM), probhi(SDIM) #include "probdata.H" namelist /fortin/ denerr, vorterr, adverr, temperr, & denfact, xblob, yblob, zblob, radblob, & velfact, probtype, randfact, bubgrad, & rhozero, tempzero, c_d, r_d, & adv_dir, adv_vel, axis_dir, radvort, & den1,den2,vel1,vel2,delta0,xlev1,zlev1,amag, & vb_unifdir c c Build "probin" filename -- the name of file containing fortin namelist. c integer maxlen parameter (maxlen=256) REAL_T frecon, onep7 parameter (frecon=.219, onep7=1.7) character probin*(maxlen) if (namlen .gt. maxlen) then write(6,*) 'probin file name too long' stop end if do i = 1, namlen probin(i:i) = char(name(i)) end do untin = 9 if (namlen .eq. 0) then open(untin,file='probin',form='formatted',status='old') else open(untin,file=probin(1:namlen),form='formatted',status='old') end if read(untin,fortin) c write(6,fortin) close(unit=untin) if(probtype.eq.8)then freq(1) = frecon do i=2,10 freq(i)=freq(1)/float(i) enddo mag(1) = amag mag(2) = .75*amag mag(3) = .55*amag mag(4) = .44*amag do i=5,10 mag(i)=onep7*mag(1)/float(i) enddo endif c c Initialize the common blocks c do i=1, SDIM f_problo(i) = problo(i) f_probhi(i) = probhi(i) enddo end c ::: ----------------------------------------------------------- c ::: This routine is called at problem setup time and is used c ::: to initialize data on each grid. The velocity field you c ::: provide does not have to be divergence free and the pressure c ::: field need not be set. A subsequent projection iteration c ::: will define aa divergence free velocity field along with a c ::: consistant pressure. c ::: c ::: NOTE: all arrays have one cell of ghost zones surrounding c ::: the grid interior. Values in these cells need not c ::: be set here. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: level => amr level of grid c ::: time => time at which to init data c ::: lo,hi => index limits of grid interior (cell centered) c ::: nscal => number of scalar quantities. You should know c ::: this already! c ::: vel <= Velocity array c ::: scal <= Scalar array c ::: press <= Pressure array c ::: dx => cell size c ::: xlo,xhi => physical locations of lower left and upper c ::: right hand corner of grid. (does not include c ::: ghost region). c ::: ----------------------------------------------------------- subroutine FORT_INITDATA(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) #include "probdata.H" if (probtype .eq. 1) then call initspin(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 2) then call initbubble(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 3) then call initvort(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 4) then call initchannel(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 5) then call initpervort(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 6) then call inithotspot(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 7) then call initeuler(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 8) then call initbrnrsh(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else if (probtype .eq. 9) then call initviscbench(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) else write(6,*) "INITDATA: bad probtype = ",probtype end if end c c ::: ----------------------------------------------------------- c subroutine initbubble(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, k, n REAL_T x, y, z REAL_T hx, hy, hz REAL_T dist REAL_T x_vel, y_vel, z_vel #include "probdata.H" hx = dx(1) hy = dx(2) hz = dx(3) if (adv_dir .eq. 1) then x_vel = adv_vel y_vel = zero z_vel = zero else if (adv_dir .eq. 2) then x_vel = zero y_vel = adv_vel z_vel = zero else if (adv_dir .eq. 2) then x_vel = zero y_vel = zero z_vel = adv_vel else write(6,*) "initbubble: adv_dir = ",adv_dir stop end if do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) dist = sqrt((x-xblob)**2 + (y-yblob)**2 + (z-zblob)**2) vel(i,j,k,1) = x_vel vel(i,j,k,2) = y_vel vel(i,j,k,3) = z_vel scal(i,j,k,1) = cvmgt(denfact,one,dist.lt.radblob) do n = 2,nscal-1 scal(i,j,k,n) = one end do scal(i,j,k,nscal) = cvmgt(one,zero,dist.lt.radblob) end do end do end do end c c ::: ----------------------------------------------------------- c subroutine initspin(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, k, n REAL_T x, y, z REAL_T hx, hy, hz REAL_T dist REAL_T x_vel, y_vel, z_vel REAL_T spx, spy, cpx, cpy #include "probdata.H" hx = dx(1) hy = dx(2) hz = dx(2) if (adv_dir .eq. 1) then x_vel = adv_vel y_vel = zero z_vel = zero else if (adv_dir .eq. 2) then x_vel = zero y_vel = adv_vel z_vel = zero else if (adv_dir .eq. 2) then x_vel = zero y_vel = zero z_vel = adv_vel else write(6,*) "INITSPIN: adv_dir = ",adv_dir stop end if do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) spy = sin(Pi*y) cpy = cos(Pi*y) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) spx = sin(Pi*x) cpx = cos(Pi*x) vel(i,j,k,1) = x_vel - velfact*two*spy*cpy*spx**2 vel(i,j,k,2) = y_vel + velfact*two*spx*cpx*spy**2 vel(i,j,k,3) = z_vel dist = sqrt((x-xblob)**2 + (y-yblob)**2 + (z-zblob)**2) scal(i,j,k,1) = one + (denfact-one) * tanh(10.*(dist-radblob)) do n = 2,nscal-1 scal(i,j,k,n) = one end do scal(i,j,k,nscal) = cvmgt(one,zero,dist.lt.radblob) end do end do end do end c c ::: ----------------------------------------------------------- c ::: This case is an unsteady viscous benchmark for which the c ::: exact solution is, c ::: u(x,y,t) = - Cos(Pi x) Sin(Pi y) Exp(-2 Pi^2 Nu t) c ::: v(x,y,t) = Sin(Pi x) Cos(Pi y) Exp(-2 Pi^2 Nu t) c ::: p(x,y,t) = - {Cos(2 Pi x) + Cos(2 Pi y)} Exp(-4 Pi^2 Nu t) / 4 c ::: In the utilities, iamrlib/BenchMarks, there is a c ::: tool ViscBench2d.cpp that reads a plot file and compares the c ::: solution against this exact solution. This benchmark was c ::: originally derived by G.I. Taylor (Phil. Mag., Vol. 46, No. 274, c ::: pp. 671-674, 1923) and Ethier and Steinman c ::: (Intl. J. Num. Meth. Fluids, Vol. 19, pp. 369-375, 1994) give c ::: the pressure field. c subroutine initviscbench(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, k, n REAL_T x, y, z REAL_T hx, hy, hz REAL_T spx, spy, spz, cpx, cpy, cpz #include "probdata.H" hx = dx(1) hy = dx(2) hz = dx(3) do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) spz = sin(Pi*z) cpz = cos(Pi*z) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) spy = sin(Pi*y) cpy = cos(Pi*y) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) spx = sin(Pi*x) cpx = cos(Pi*x) c c Uniform in the X-direction c if (vb_unifdir .eq. 0) then vel(i,j,k,1) = zero vel(i,j,k,2) = spz*cpy vel(i,j,k,3) = - cpz*spy scal(i,j,k,1) = one do n = 2, nscal scal(i,j,k,n) = cpz*cpy enddo c c Uniform in the Y-direction c elseif (vb_unifdir .eq. 1) then vel(i,j,k,1) = - cpx*spz vel(i,j,k,2) = zero vel(i,j,k,3) = spx*cpz scal(i,j,k,1) = one do n = 2, nscal scal(i,j,k,n) = cpx*cpz enddo c c Uniform in the Z-direction c elseif (vb_unifdir .eq. 2) then vel(i,j,k,1) = - cpx*spy vel(i,j,k,2) = spx*cpy vel(i,j,k,3) = zero scal(i,j,k,1) = one do n = 2, nscal scal(i,j,k,n) = cpx*cpy enddo endif end do end do end do end c c ::: ----------------------------------------------------------- c subroutine initvort(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, k, n REAL_T x, y, z, r REAL_T hx, hy, hz REAL_T c, ux, uy, uz REAL_T umagin, umagout, absu, sinth, costh REAL_T small, a, b, r0 #include "probdata.H" hx = dx(1) hy = dx(2) hz = dx(3) small = 1.0e-10 r0 = two/three * radvort a = one / ((radvort - r0)*(two*radvort - r0)) b = a * radvort**2 * (radvort - r0) do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) - zblob do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) - yblob do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) - xblob r = sqrt(x**2 + y**2) c umagin = .5*r - 4*r**3 c umagout = radvort*(.5*radvort - 4*radvort**3)/max(radvort,r) umagin = velfact * (one - a*(r - r0)**2) umagout = velfact * b/max(radvort,r) absu = cvmgp(umagout,umagin,r - radvort) sinth = y/max(r,small*radvort) costh = x/max(r,small*radvort) vel(i,j,k,1) = -absu*sinth vel(i,j,k,2) = absu*costh vel(i,j,k,3) = zero scal(i,j,k,1) = cvmgt(denfact,one,r.lt.radblob) do n = 2,nscal-1 scal(i,j,k,n) = one end do scal(i,j,k,nscal) = cvmgt(one,zero,r.lt.radblob) end do end do end do end c c ::: ----------------------------------------------------------- c subroutine initchannel(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, k, n REAL_T x, y, z REAL_T hx, hy, hz REAL_T dist #include "probdata.H" hx = dx(1) hy = dx(2) hz = dx(3) do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) do i = lo(1), hi(1) vel(i,j,k,1) = adv_vel vel(i,j,k,2) = zero vel(i,j,k,3) = zero scal(i,j,k,1) = one do n = 2,nscal-1 scal(i,j,k,n) = one end do x = xlo(1) + hx*(float(i-lo(1)) + half) dist = sqrt((x-xblob)**2 + (y-yblob)**2 + (z-zblob)**2) scal(i,j,k,nscal) = cvmgt(one,zero,dist.lt.radblob) end do end do end do end c c ::: ----------------------------------------------------------- c subroutine initpervort(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, k, n REAL_T x, y, z REAL_T hx, hy, hz REAL_T dist #include "probdata.H" hx = dx(1) hy = dx(2) hz = dx(3) do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) vel(i,j,k,1) = tanh(30.*(.25-abs(y-.5))) vel(i,j,k,2) = .05*sin(two*Pi*x) vel(i,j,k,3) = zero scal(i,j,k,1) = one do n = 2,nscal-1 scal(i,j,k,n) = one end do dist = sqrt((x-xblob)**2 + (y-yblob)**2 + (z-zblob)**2) scal(i,j,k,nscal) = cvmgt(one,zero,dist.lt.radblob) end do end do end do end c c ::: ----------------------------------------------------------- c subroutine inithotspot(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c ::::: local variables integer i, j, k, n REAL_T x, y, z REAL_T hx, hy, hz REAL_T x_vel, y_vel, z_vel REAL_T dist #include "probdata.H" hx = dx(1) hy = dx(2) hz = dx(3) if (adv_dir .eq. 1) then x_vel = adv_vel y_vel = zero z_vel = zero else if (adv_dir .eq. 2) then x_vel = zero y_vel = adv_vel z_vel = zero else if (adv_dir .eq. 3) then x_vel = zero y_vel = zero z_vel = adv_vel else write(6,*) "inithotspot: adv_dir = ",adv_dir stop end if do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) dist = sqrt((x-xblob)**2 + (y-yblob)**2 + (z-zblob)**2) vel(i,j,k,1) = x_vel vel(i,j,k,2) = y_vel vel(i,j,k,3) = z_vel scal(i,j,k,1) = one/denfact + (one - one/denfact) & *half*(one + tanh(40.*(dist - radblob))) scal(i,j,k,2) = cvmgt(one,zero,dist.lt.radblob) do n = 3,nscal-1 scal(i,j,k,n) = one end do scal(i,j,k,nscal) = one / scal(i,j,k,1) end do end do end do end c c ::: ----------------------------------------------------------- c subroutine initeuler(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, k, n REAL_T x, y, z REAL_T hx, hy, hz, r_yz REAL_T eps_input, beta_input, rho_input REAL_T delta_input, kappa_input parameter (eps_input=0.05, rho_input=0.15) parameter (beta_input=15., delta_input=0.0333) parameter (kappa_input=500.) #include "probdata.H" hx = dx(1) hy = dx(2) hz = dx(3) do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) -half do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) -half r_yz = sqrt(y*y+z*z) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) -half vel(i,j,k,1) = tanh( (rho_input - r_yz) / delta_input) vel(i,j,k,2) = zero vel(i,j,k,3) = eps_input * exp(-beta_input * (x*x + y*y) ) scal(i,j,k,1) = one scal(i,j,k,2) = exp( -kappa_input * (rho_input - r_yz)**2 ) do n = 3,nscal scal(i,j,k,n) = one end do end do end do end do end c c ::: ----------------------------------------------------------- c subroutine initbrnrsh(level,time,lo,hi,nscal, & vel,scal,DIMS(state),press,DIMS(press), & dx,xlo,xhi) integer level, nscal integer lo(SDIM), hi(SDIM) integer DIMDEC(state) integer DIMDEC(press) REAL_T time, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T vel(DIMV(state),SDIM) REAL_T scal(DIMV(state),nscal) REAL_T press(DIMV(press)) c c ::::: local variables c integer i, j, k, n REAL_T x, y, z REAL_T hx, hy, hz REAL_T dist REAL_T x_vel, y_vel, z_vel REAL_T umid,rmid,lamv,lamr,rfact #include "probdata.H" hx = dx(1) hy = dx(2) hz = dx(3) umid = (vel1+vel2)*half rmid = (den1+den2)*half lamv = (vel1-vel2)/(vel1+vel2) lamr = (den1-den2)/(den1+den2) do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) do i = lo(1), hi(1) vel(i,j,k,1) = umid*(one+lamv*tanh(two*z/delta0)) vel(i,j,k,2) = zero vel(i,j,k,3) = zero scal(i,j,k,1) = rmid*(one+lamr*tanh(two*z/delta0)) scal(i,j,k,2) = cvmgt(one,zero,z.gt.zero) enddo enddo enddo end c ::: ----------------------------------------------------------- c ::: This routine will tag high error cells based on the c ::: density gradient c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: tag <= integer tag array c ::: DIMS(tag) => index extent of tag array c ::: set => integer value to tag cell for refinement c ::: clear => integer value to untag cell c ::: rho => density array c ::: DIMS(rho) => index extent of rho array c ::: nvar => number of components in rho array (should be 1) c ::: lo,hi => index extent of grid c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of tag array c ::: problo => phys loc of lower left corner of prob domain c ::: time => problem evolution time c ::: ----------------------------------------------------------- subroutine FORT_DENERROR (tag,DIMS(tag),set,clear, & rho,DIMS(rho),lo,hi,nvar, & domlo,domhi,dx,xlo, & problo,time,level) integer DIMDEC(tag) integer DIMDEC(rho) integer lo(SDIM), hi(SDIM) integer nvar, set, clear, level integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), problo(SDIM), time integer tag(DIMV(tag)) REAL_T rho(DIMV(rho),nvar) integer i, j, k #include "probdata.H" do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),rho(i,j,k,1).lt.denerr) end do end do end do end c ::: ----------------------------------------------------------- c ::: This routine will tag high error cells based on the c ::: density gradient c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: tag <= integer tag array c ::: DIMS(tag) => index extent of tag array c ::: set => integer value to tag cell for refinement c ::: clear => integer value to untag cell c ::: adv => scalar array c ::: DIMS(adv) => index extent of adv array c ::: nvar => number of components in rho array (should be 1) c ::: lo,hi => index extent of grid c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of tag array c ::: problo => phys loc of lower left corner of prob domain c ::: time => problem evolution time c ::: ----------------------------------------------------------- subroutine FORT_ADVERROR (tag,DIMS(tag),set,clear, & adv,DIMS(adv),lo,hi,nvar, & domlo,domhi,dx,xlo, & problo,time,level) integer DIMDEC(tag) integer DIMDEC(adv) integer lo(SDIM), hi(SDIM) integer ng, nvar, set, clear, level integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), problo(SDIM), time integer tag(DIMV(tag)) REAL_T adv(DIMV(adv),nvar) REAL_T x, y, z, ax, ay, az, aerr integer i, j, k #include "probdata.H" c probtype = SPIN if (probtype .eq. 1) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),adv(i,j,k,1).gt.adverr) end do end do end do c probtype = BUBBLE else if (probtype .eq. 2) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),adv(i,j,k,1).gt.adverr) end do end do end do c probtype = VORTEX IN A BOX else if (probtype .eq. 3) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),adv(i,j,k,1).gt.adverr) end do end do end do c probtype = CHANNEL else if (probtype .eq. 4) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),adv(i,j,k,1).gt.adverr) end do end do end do c probtype = PERIODIC SHEAR LAYER else if (probtype .eq. 5) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),adv(i,j,k,1).gt.adverr) end do end do end do c probtype = HOT SPOT else if (probtype .eq. 6) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),adv(i,j,k,1).gt.adverr) end do end do end do else if (probtype .eq. 7) then return else if (probtype .eq. 8) then if (level .eq. 0) then do k = lo(3), hi(3) z = xlo(3) + dx(3)*(float(k-lo(3)) + half) do j = lo(2), hi(2) do i = lo(1), hi(1) x = xlo(1) + dx(1)*(float(i-lo(1)) + half) tag(i,j,k) = cvmgt(set,clear,abs(z).lt.zlev1.and.x.lt.xlev1) enddo enddo enddo else do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) x = xlo(1) + dx(1)*(float(i-lo(1)) + half) ax = abs(adv(i+1,j,k,1) - adv(i-1,j,k,1)) ay = abs(adv(i,j+1,k,1) - adv(i,j-1,k,1)) az = abs(adv(i,j,k+1,1) - adv(i,j,k-1,1)) aerr = max(ax,ay,az) tag(i,j,k) = cvmgt(set,tag(i,j,k),aerr.gt.adverr.and. x.lt.xlev1) enddo enddo enddo endif c probtype = VISCOUS BENCHMARK else if (probtype .eq. 9) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),adv(i,j,k,1).gt.adverr) end do end do end do else print *,'DONT KNOW THIS PROBTYPE IN FORT_ADVERROR ',probtype stop end if end c ::: ----------------------------------------------------------- c ::: This routine will tag high error cells based on the c ::: temperature gradient c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: tag <= integer tag array c ::: DIMS(tag) => index extent of tag array c ::: set => integer value to tag cell for refinement c ::: clear => integer value to untag cell c ::: temp => density array c ::: DIMS(temp)=> index extent of temp array c ::: lo,hi => index extent of grid c ::: nvar => number of components in rho array (should be 1) c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of tag array c ::: problo => phys loc of lower left corner of prob domain c ::: time => problem evolution time c ::: ----------------------------------------------------------- subroutine FORT_TEMPERROR (tag,DIMS(tag),set,clear, & temperature,DIMS(temp),lo,hi,nvar, & domlo,domhi,dx,xlo, & problo,time,level) integer DIMDEC(tag) integer DIMDEC(temp) integer nvar, set, clear, level integer domlo(SDIM), domhi(SDIM) integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM), xlo(SDIM), problo(SDIM), time integer tag(DIMV(tag)) REAL_T temperature(DIMV(temp),nvar) REAL_T x, y, z, ax, ay, az, aerr integer i, j, k #include "probdata.H" c probtype = SPIN if (probtype .eq. 1) then c probtype = BUBBLE else if (probtype .eq. 2) then c probtype = VORTEX IN A BOX else if (probtype .eq. 3) then c probtype = CHANNEL else if (probtype .eq. 4) then c probtype = PERIODIC SHEAR LAYER else if (probtype .eq. 5) then c probtype = HOT SPOT else if (probtype .eq. 6) then if (level .eq. 0) then c ::::: refine around entire hot spot do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),temperature(i,j,k,1).gt.temperr) end do end do end do else c ::::: refine where there is temperature gradient do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) ax = abs(temperature(i+1,j,k,1) - temperature(i-1,j,k,1)) ay = abs(temperature(i,j+1,k,1) - temperature(i,j-1,k,1)) az = abs(temperature(i,j,k+1,1) - temperature(i,j,k-1,1)) aerr = max(ax,ay,az) tag(i,j,k) = cvmgt(set,tag(i,j,k),aerr.gt.bubgrad) end do end do end do end if c probtype = VISCOUS BENCHMARK else if (probtype .eq. 9) then else print *,'DONT KNOW THIS PROBTYPE IN FORT_TEMPERROR ',probtype stop end if end c ::: ----------------------------------------------------------- c ::: This routine will tag high error cells based on the c ::: magnitude of vorticity c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: tag <= integer tag array c ::: DIMS(tag) => index extent of tag array c ::: set => integer value to tag cell for refinement c ::: clear => integer value to untag cell c ::: vort => vorticitiy array c ::: DIMS(vort)=> index extent of vort array c ::: nvar => number of components in rho array (should be 1) c ::: lo,hi => index extent of grid c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of tag array c ::: problo => phys loc of lower left corner of prob domain c ::: time => problem evolution time c ::: ----------------------------------------------------------- subroutine FORT_MVERROR (tag,DIMS(tag),set,clear, & vort,DIMS(vort),lo,hi,nvar, & domlo,domhi,dx,xlo, & problo,time,level) integer DIMDEC(tag) integer DIMDEC(vort) integer lo(SDIM), hi(SDIM) integer nvar, set, clear, level integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), problo(SDIM), time integer tag(DIMV(tag)) REAL_T vort(DIMV(vort),nvar) REAL_T x, y, dist integer i, j, k REAL_T radius #include "probdata.H" c probtype = SPIN if (probtype .eq. 1) then c probtype = BUBBLE else if (probtype .eq. 2) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),abs(vort(i,j,k,1)).gt.vorterr) end do end do end do c probtype = VORTEX IN A BOX else if (probtype .eq. 3) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),abs(vort(i,j,k,1)).gt.vorterr) end do end do end do c probtype = CHANNEL else if (probtype .eq. 4) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),abs(vort(i,j,k,1)).gt.vorterr) end do end do end do c probtype = PERIODIC SHEAR LAYER else if (probtype .eq. 5) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),abs(vort(i,j,k,1)).gt.vorterr) end do end do end do c probtype = HOT SPOT else if (probtype .eq. 6) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),abs(vort(i,j,k,1)).gt.vorterr) end do end do end do c probtype = EULER else if (probtype .eq. 7) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k), & abs(dx(1)*vort(i,j,k,1)).gt.vorterr) end do end do end do c probtype = BROWN ROSHKO else if (probtype .eq. 8) then return c probtype = VISCOUS BENCHMARK else if (probtype .eq. 9) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tag(i,j,k) = cvmgt(set,tag(i,j,k),abs(vort(i,j,k,1)).gt.vorterr) end do end do end do else print *,'DONT KNOW THIS PROBTYPE IN FORT_MVERROR ',probtype stop end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: rho <= density array c ::: DIMS(rho) => index extent of rho array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_DENFILL (rho,DIMS(rho),domlo,domhi,dx, & xlo,time,bc ) integer DIMDEC(rho) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T rho(DIMV(rho)) integer bc(SDIM,2) integer lo(SDIM), hi(SDIM) integer i, j, k REAL_T umid,rmid,lamv,lamr,rfact REAL_T hx, hy, hz, gpert, z, y, ypert, magwif, constn parameter (constn=.22089323) #include "probdata.H" call filcc(rho,DIMS(rho),domlo,domhi,dx,xlo,bc) if(probtype .eq.8 ) then lo(1) = ARG_L1(rho) lo(2) = ARG_L2(rho) lo(3) = ARG_L3(rho) hi(1) = ARG_H1(rho) hi(2) = ARG_H2(rho) hi(3) = ARG_H3(rho) umid = (vel1+vel2)*half rmid = (den1+den2)*half lamv = (vel1-vel2)/(vel1+vel2) lamr = (den1-den2)/(den1+den2) hx = dx(1) hy = dx(2) hz = dx(3) magwif = one/ten if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do j = lo(2), hi(2) y = xlo(2)+hy*(float(j-lo(2))+half) ypert = magwif*sin(freq(1)*time)*sin(constn*y) rho(i,j,k) = rmid*(one+lamr*tanh(two*(z-ypert)/delta0)) enddo enddo enddo endif if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do k = lo(3), hi(3) do j = lo(2), hi(2) rho(i,j,k) = denfact enddo enddo enddo endif if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do k = lo(3), hi(3) do i = lo(1), hi(1) rho(i,j,k) = denfact enddo enddo enddo endif if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do k = lo(3), hi(3) do i = lo(1), hi(1) rho(i,j,k) = denfact enddo enddo enddo endif if (bc(3,1).eq.EXT_DIR.and.lo(3).lt.domlo(3)) then do k = lo(3), domlo(3)-1 do j = lo(2), hi(2) do i = lo(1), hi(1) rho(i,j,k) = den2 enddo enddo enddo endif if (bc(3,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do k = domhi(3)+1, hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) rho(i,j,k) = den1 enddo enddo enddo endif else if (bc(1,1).eq.EXT_DIR.and.ARG_L1(rho).lt.domlo(1)) then do i = ARG_L1(rho), domlo(1)-1 do k = ARG_L3(rho), ARG_H3(rho) do j = ARG_L2(rho), ARG_H2(rho) rho(i,j,k) = denfact end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(rho).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(rho) do k = ARG_L3(rho), ARG_H3(rho) do j = ARG_L2(rho), ARG_H2(rho) rho(i,j,k) = denfact end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(rho).lt.domlo(2)) then do j = ARG_L2(rho), domlo(2)-1 do k = ARG_L3(rho), ARG_H3(rho) do i = ARG_L1(rho), ARG_H1(rho) rho(i,j,k) = denfact end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(rho).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(rho) do k = ARG_L3(rho), ARG_H3(rho) do i = ARG_L1(rho), ARG_H1(rho) rho(i,j,k) = denfact end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.ARG_L3(rho).lt.domlo(3)) then do k = ARG_L3(rho), domlo(3)-1 do j = ARG_L2(rho), ARG_H2(rho) do i = ARG_L1(rho), ARG_H1(rho) rho(i,j,k) = denfact end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.ARG_H3(rho).gt.domhi(3)) then do k = domhi(3)+1, ARG_H3(rho) do j = ARG_L2(rho), ARG_H2(rho) do i = ARG_L1(rho), ARG_H1(rho) rho(i,j,k) = denfact end do end do end do end if endif end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: adv <= advected quantity array c ::: DIMS(adv) => index extent of adv array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of adv array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_ADVFILL (adv,DIMS(adv),domlo,domhi,dx, & xlo,time,bc ) integer DIMDEC(adv) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T adv(DIMV(adv)) integer bc(SDIM,2) integer lo(SDIM), hi(SDIM) integer i, j, k REAL_T hx, hy, hz, gpert, z, y, ypert, magwif, constn parameter (constn=.22089323) #include "probdata.H" call filcc(adv,DIMS(adv),domlo,domhi,dx,xlo,bc) if( probtype .eq. 8) then lo(1) = ARG_L1(adv) lo(2) = ARG_L2(adv) lo(3) = ARG_L3(adv) hi(1) = ARG_H1(adv) hi(2) = ARG_H2(adv) hi(3) = ARG_H3(adv) hy = dx(2) hz = dx(3) magwif = one/ten if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then do i = lo(1), domlo(1)-1 do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do j = lo(2), hi(2) y = xlo(2)+hy*(float(j-lo(2))+half) ypert = magwif*sin(freq(1)*time)*sin(constn*y) adv(i,j,k) = cvmgt(one,zero,(z-ypert).gt.zero) enddo enddo enddo endif if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do k = lo(3), hi(3) do j = lo(2), hi(2) adv(i,j,k) = cvmgt(one,zero,z.gt.zero) enddo enddo enddo endif if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do i = lo(1), hi(1) adv(i,j,k) = cvmgt(one,zero,z.gt.zero) enddo enddo enddo endif if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do i = lo(1), hi(1) adv(i,j,k) = cvmgt(one,zero,z.gt.zero) enddo enddo enddo endif if (bc(3,1).eq.EXT_DIR.and.lo(3).lt.domlo(3)) then do k = lo(3), domlo(3)-1 do j = lo(2), hi(2) do i = lo(1), hi(1) adv(i,j,k) = zero enddo enddo enddo endif if (bc(3,2).eq.EXT_DIR.and.hi(3).gt.domhi(3)) then do k = domhi(3)+1, hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) adv(i,j,k) = one enddo enddo enddo endif else if (bc(1,1).eq.EXT_DIR.and.ARG_L1(adv).lt.domlo(1)) then do i = ARG_L1(adv), domlo(1)-1 do k = ARG_L3(adv), ARG_H3(adv) do j = ARG_L2(adv), ARG_H2(adv) adv(i,j,k) = zero end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(adv).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(adv) do k = ARG_L3(adv), ARG_H3(adv) do j = ARG_L2(adv), ARG_H2(adv) adv(i,j,k) = zero end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(adv).lt.domlo(2)) then do j = ARG_L2(adv), domlo(2)-1 do k = ARG_L3(adv), ARG_H3(adv) do i = ARG_L1(adv), ARG_H1(adv) adv(i,j,k) = zero end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(adv).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(adv) do k = ARG_L3(adv), ARG_H3(adv) do i = ARG_L1(adv), ARG_H1(adv) adv(i,j,k) = zero end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.ARG_L3(adv).lt.domlo(3)) then do k = ARG_L3(adv), domlo(3)-1 do j = ARG_L2(adv), ARG_H2(adv) do i = ARG_L1(adv), ARG_H1(adv) adv(i,j,k) = zero end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.ARG_H3(adv).gt.domhi(3)) then do k = domhi(3)+1, ARG_H3(adv) do j = ARG_L2(adv), ARG_H2(adv) do i = ARG_L1(adv), ARG_H1(adv) adv(i,j,k) = zero end do end do end do end if endif end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: temp <= temperature array c ::: DIMS(temp)=> index extent of temp array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of temp array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_TEMPFILL (temp,DIMS(temp),domlo,domhi,dx, & xlo,time,bc ) integer DIMDEC(temp) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T temp(DIMV(temp)) integer bc(SDIM,2) integer i, j, k REAL_T z #include "probdata.H" call filcc(temp,DIMS(temp),domlo,domhi,dx,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.ARG_L1(temp).lt.domlo(1)) then do i = ARG_L1(temp), domlo(1)-1 do k = ARG_L3(temp), ARG_H3(temp) do j = ARG_L2(temp), ARG_H2(temp) temp(i,j,k) = one end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(temp).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(temp) do k = ARG_L3(temp), ARG_H3(temp) do j = ARG_L2(temp), ARG_H2(temp) temp(i,j,k) = one end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(temp).lt.domlo(2)) then do j = ARG_L2(temp), domlo(2)-1 do k = ARG_L3(temp), ARG_H3(temp) do i = ARG_L1(temp), ARG_H1(temp) temp(i,j,k) = one end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(temp).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(temp) do k = ARG_L3(temp), ARG_H3(temp) do i = ARG_L1(temp), ARG_H1(temp) temp(i,j,k) = one end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.ARG_L3(temp).lt.domlo(3)) then do k = ARG_L3(temp), domlo(3)-1 do j = ARG_L2(temp), ARG_H2(temp) do i = ARG_L1(temp), ARG_H1(temp) temp(i,j,k) = one end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.ARG_H3(temp).gt.domhi(3)) then do k = domhi(3)+1, ARG_H3(temp) do j = ARG_L2(temp), ARG_H2(temp) do i = ARG_L1(temp), ARG_H1(temp) temp(i,j,k) = one end do end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: u <= x velocity array c ::: DIMS(u) => index extent of u array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_XVELFILL (u,DIMS(u),domlo,domhi,dx, & xlo,time,bc) integer DIMDEC(u) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T u(DIMV(u)) integer bc(SDIM,2) integer lo(SDIM),hi(SDIM) integer i, j, k REAL_T x_vel REAL_T y, ul, g_t REAL_T umid,rmid,lamv,lamr,rfact REAL_T hx, hy, hz, gpert, z, ypert, magwif, constn parameter (constn=.22089323) #include "probdata.H" if (adv_dir .eq. 1) then x_vel = adv_vel else x_vel = zero end if call filcc(u,DIMS(u),domlo,domhi,dx,xlo,bc) if(probtype .eq. 8) then lo(1) = ARG_L1(u) lo(2) = ARG_L2(u) lo(3) = ARG_L3(u) hi(1) = ARG_H1(u) hi(2) = ARG_H2(u) hi(3) = ARG_H3(u) x_vel = one magwif = one/ten umid = (vel1+vel2)*half rmid = (den1+den2)*half lamv = (vel1-vel2)/(vel1+vel2) lamr = (den1-den2)/(den1+den2) hx = dx(1) hy = dx(2) hz = dx(3) if (bc(1,1).eq.EXT_DIR.and.lo(1).lt.domlo(1)) then gpert = one do i = 1,10 gpert = gpert + mag(i)*sin(freq(i)*time) enddo do i = lo(1), domlo(1)-1 do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) do j = lo(2), hi(2) y = xlo(2)+hy*(float(j-lo(2))+half) ypert = magwif*sin(freq(1)*time)*sin(constn*y) u(i,j,k) = gpert*umid*(one+lamv*tanh(two*(z-ypert)/delta0)) enddo enddo enddo endif if (bc(1,2).eq.EXT_DIR.and.hi(1).gt.domhi(1)) then do i = domhi(1)+1, hi(1) do k = lo(3), hi(3) do j = lo(2), hi(2) u(i,j,k) = x_vel enddo enddo enddo endif if (bc(2,1).eq.EXT_DIR.and.lo(2).lt.domlo(2)) then do j = lo(2), domlo(2)-1 do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,j,k) = x_vel enddo enddo enddo endif if (bc(2,2).eq.EXT_DIR.and.hi(2).gt.domhi(2)) then do j = domhi(2)+1, hi(2) do k = lo(3), hi(3) do i = lo(1), hi(1) u(i,j,k) = x_vel enddo enddo enddo endif if (bc(3,1).eq.EXT_DIR.and.lo(3).lt.domlo(3)) then do k = lo(3), domlo(3)-1 do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j,k) = vel2 enddo enddo enddo endif if (bc(3,2).eq.EXT_DIR.and.hi(3).gt.domhi(3)) then do k = domhi(3)+1, hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) u(i,j,k) = vel1 enddo enddo enddo endif else if (bc(1,1).eq.EXT_DIR.and.ARG_L1(u).lt.domlo(1)) then do i = ARG_L1(u), domlo(1)-1 do k = ARG_L3(u), ARG_H3(u) do j = ARG_L2(u), ARG_H2(u) u(i,j,k) = x_vel end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(u).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(u) do k = ARG_L3(u), ARG_H3(u) do j = ARG_L2(u), ARG_H2(u) u(i,j,k) = x_vel end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(u).lt.domlo(2)) then do j = ARG_L2(u), domlo(2)-1 do k = ARG_L3(u), ARG_H3(u) do i = ARG_L1(u), ARG_H1(u) u(i,j,k) = zero end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(u).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(u) do k = ARG_L3(u), ARG_H3(u) do i = ARG_L1(u), ARG_H1(u) u(i,j,k) = zero end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.ARG_L3(u).lt.domlo(3)) then do k = ARG_L3(u), domlo(3)-1 do j = ARG_L2(u), ARG_H2(u) do i = ARG_L1(u), ARG_H1(u) u(i,j,k) = zero end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.ARG_H3(u).gt.domhi(3)) then do k = domhi(3)+1, ARG_H3(u) do j = ARG_L2(u), ARG_H2(u) do i = ARG_L1(u), ARG_H1(u) u(i,j,k) = zero end do end do end do end if endif end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: v <= y velocity array c ::: DIMS(v) => index extent of v array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_YVELFILL (v,DIMS(v),domlo,domhi,dx, & xlo,time,bc) integer DIMDEC(v) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T v(DIMV(v)) integer bc(SDIM,2) integer i, j, k REAL_T y_vel REAL_T rn #include "probdata.H" if(probtype.eq.8)then y_vel = zero else if (adv_dir .eq. 2) then y_vel = adv_vel else y_vel = zero end if endif call filcc(v,DIMS(v),domlo,domhi,dx,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.ARG_L1(v).lt.domlo(1)) then do i = ARG_L1(v), domlo(1)-1 do k = ARG_L3(v), ARG_H3(v) do j = ARG_L2(v), ARG_H2(v) v(i,j,k) = zero end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(v).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(v) do k = ARG_L3(v), ARG_H3(v) do j = ARG_L2(v), ARG_H2(v) v(i,j,k) = zero end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(v).lt.domlo(2)) then do j = ARG_L2(v), domlo(2)-1 do k = ARG_L3(v), ARG_H3(v) do i = ARG_L1(v), ARG_H1(v) v(i,j,k) = y_vel end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(v).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(v) do k = ARG_L3(v), ARG_H3(v) do i = ARG_L1(v), ARG_H1(v) v(i,j,k) = y_vel end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.ARG_L3(v).lt.domlo(3)) then do k = ARG_L3(v), domlo(3)-1 do j = ARG_L2(v), ARG_H2(v) do i = ARG_L1(v), ARG_H1(v) v(i,j,k) = zero end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.ARG_H3(v).gt.domhi(3)) then do k = domhi(3)+1, ARG_H3(v) do j = ARG_L2(v), ARG_H2(v) do i = ARG_L1(v), ARG_H1(v) v(i,j,k) = zero end do end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: w <= z velocity array c ::: DIMS(w) => index extent of v array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_ZVELFILL (w,DIMS(w),domlo,domhi,dx, & xlo,time,bc) integer DIMDEC(w) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T w(DIMV(w)) integer bc(SDIM,2) integer i, j, k REAL_T z_vel #include "probdata.H" if(probtype.eq.8)then z_vel = zero else if (adv_dir .eq. 3) then z_vel = adv_vel else z_vel = zero end if endif call filcc(w,DIMS(w),domlo,domhi,dx,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.ARG_L1(w).lt.domlo(1)) then do i = ARG_L1(w), domlo(1)-1 do k = ARG_L3(w), ARG_H3(w) do j = ARG_L2(w), ARG_H2(w) w(i,j,k) = zero end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(w).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(w) do k = ARG_L3(w), ARG_H3(w) do j = ARG_L2(w), ARG_H2(w) w(i,j,k) = zero end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(w).lt.domlo(2)) then do j = ARG_L2(w), domlo(2)-1 do k = ARG_L3(w), ARG_H3(w) do i = ARG_L1(w), ARG_H1(w) w(i,j,k) = zero end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(w).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(w) do k = ARG_L3(w), ARG_H3(w) do i = ARG_L1(w), ARG_H1(w) w(i,j,k) = zero end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.ARG_L3(w).lt.domlo(3)) then do k = ARG_L3(w), domlo(3)-1 do j = ARG_L2(w), ARG_H2(w) do i = ARG_L1(w), ARG_H1(w) w(i,j,k) = z_vel end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.ARG_H3(w).gt.domhi(3)) then do k = domhi(3)+1, ARG_H3(w) do j = ARG_L2(w), ARG_H2(w) do i = ARG_L1(w), ARG_H1(w) w(i,j,k) = z_vel end do end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: divu <= divergence of velocity array c ::: DIMS(divu)=> index extent of divu array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_DIVUFILL (divu,DIMS(divu),domlo,domhi,dx, & xlo,time,bc) integer DIMDEC(divu) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T divu(DIMV(divu)) integer bc(SDIM,2) integer i, j, k REAL_T z_vel #include "probdata.H" if (adv_dir .eq. 3) then z_vel = adv_vel else z_vel = zero end if call filcc(divu,DIMS(divu),domlo,domhi,dx,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.ARG_L1(divu).lt.domlo(1)) then do i = ARG_L1(divu), domlo(1)-1 do k = ARG_L3(divu), ARG_H3(divu) do j = ARG_L2(divu), ARG_H2(divu) divu(i,j,k) = z_vel end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(divu).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(divu) do k = ARG_L3(divu), ARG_H3(divu) do j = ARG_L2(divu), ARG_H2(divu) divu(i,j,k) = z_vel end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(divu).lt.domlo(2)) then do j = ARG_L2(divu), domlo(2)-1 do k = ARG_L3(divu), ARG_H3(divu) do i = ARG_L1(divu), ARG_H1(divu) divu(i,j,k) = z_vel end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(divu).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(divu) do k = ARG_L3(divu), ARG_H3(divu) do i = ARG_L1(divu), ARG_H1(divu) divu(i,j,k) = z_vel end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.ARG_L3(divu).lt.domlo(3)) then do k = ARG_L3(divu), domlo(3)-1 do j = ARG_L2(divu), ARG_H2(divu) do i = ARG_L1(divu), ARG_H1(divu) divu(i,j,k) = z_vel end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.ARG_H3(divu).gt.domhi(3)) then do k = domhi(3)+1, ARG_H3(divu) do j = ARG_L2(divu), ARG_H2(divu) do i = ARG_L1(divu), ARG_H1(divu) divu(i,j,k) = z_vel end do end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: dsdt <= dsdt array c ::: DIMS(dsdt)=> index extent of dsdt array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_DSDTFILL (dsdt,DIMS(dsdt),domlo,domhi,dx, & xlo,time,bc) integer DIMDEC(dsdt) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T dsdt(DIMV(dsdt)) integer bc(SDIM,2) integer i, j, k call filcc(dsdt,DIMS(dsdt),domlo,domhi,dx,xlo,bc) if (bc(1,1).eq.EXT_DIR.and.ARG_L1(dsdt).lt.domlo(1)) then do i = ARG_L1(dsdt), domlo(1)-1 do k = ARG_L3(dsdt), ARG_H3(dsdt) do j = ARG_L2(dsdt), ARG_H2(dsdt) dsdt(i,j,k) = zero end do end do end do end if if (bc(1,2).eq.EXT_DIR.and.ARG_H1(dsdt).gt.domhi(1)) then do i = domhi(1)+1, ARG_H1(dsdt) do k = ARG_L3(dsdt), ARG_H3(dsdt) do j = ARG_L2(dsdt), ARG_H2(dsdt) dsdt(i,j,k) = zero end do end do end do end if if (bc(2,1).eq.EXT_DIR.and.ARG_L2(dsdt).lt.domlo(2)) then do j = ARG_L2(dsdt), domlo(2)-1 do k = ARG_L3(dsdt), ARG_H3(dsdt) do i = ARG_L1(dsdt), ARG_H1(dsdt) dsdt(i,j,k) = zero end do end do end do end if if (bc(2,2).eq.EXT_DIR.and.ARG_H2(dsdt).gt.domhi(2)) then do j = domhi(2)+1, ARG_H2(dsdt) do k = ARG_L3(dsdt), ARG_H3(dsdt) do i = ARG_L1(dsdt), ARG_H1(dsdt) dsdt(i,j,k) = zero end do end do end do end if if (bc(3,1).eq.EXT_DIR.and.ARG_L3(dsdt).lt.domlo(3)) then do k = ARG_L3(dsdt), domlo(3)-1 do j = ARG_L2(dsdt), ARG_H2(dsdt) do i = ARG_L1(dsdt), ARG_H1(dsdt) dsdt(i,j,k) = zero end do end do end do end if if (bc(3,2).eq.EXT_DIR.and.ARG_H3(dsdt).gt.domhi(3)) then do k = domhi(3)+1, ARG_H3(dsdt) do j = ARG_L2(dsdt), ARG_H2(dsdt) do i = ARG_L1(dsdt), ARG_H1(dsdt) dsdt(i,j,k) = zero end do end do end do end if end c ::: ----------------------------------------------------------- c ::: This routine is called during a filpatch operation when c ::: the patch to be filled falls outside the interior c ::: of the problem domain. You are requested to supply the c ::: data outside the problem interior in such a way that the c ::: data is consistant with the types of the boundary conditions c ::: you specified in the C++ code. c ::: c ::: NOTE: you can assume all interior cells have been filled c ::: with valid data. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: p <= pressure array c ::: lo,hi => index extent of p array c ::: domlo,hi => index extent of problem domain c ::: dx => cell spacing c ::: xlo => physical location of lower left hand c ::: corner of rho array c ::: time => problem evolution time c ::: bc => array of boundary flags bc(BL_SPACEDIM,lo:hi) c ::: ----------------------------------------------------------- subroutine FORT_PRESFILL (p,DIMS(p),domlo,domhi,dx, & xlo,time,bc) integer DIMDEC(p) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM), xlo(SDIM), time REAL_T p(DIMV(p)) integer bc(SDIM,2) integer i, j, k integer jlo, jhi, ilo, ihi, klo, khi logical fix_xlo, fix_ylo, fix_zlo logical fix_xhi, fix_yhi, fix_zhi logical per_xlo, per_ylo, per_zlo logical per_xhi, per_yhi, per_zhi #include "probdata.H" fix_xlo = (ARG_L1(p) .lt. domlo(1)) .and. (bc(1,1) .ne. INT_DIR) per_xlo = (ARG_L1(p) .lt. domlo(1)) .and. (bc(1,1) .eq. INT_DIR) fix_xhi = (ARG_H1(p) .gt. domhi(1)) .and. (bc(1,2) .ne. INT_DIR) per_xhi = (ARG_H1(p) .gt. domhi(1)) .and. (bc(1,2) .eq. INT_DIR) fix_ylo = (ARG_L2(p) .lt. domlo(2)) .and. (bc(2,1) .ne. INT_DIR) per_ylo = (ARG_L2(p) .lt. domlo(2)) .and. (bc(2,1) .eq. INT_DIR) fix_yhi = (ARG_H2(p) .gt. domhi(2)) .and. (bc(2,2) .ne. INT_DIR) per_yhi = (ARG_H2(p) .gt. domhi(2)) .and. (bc(2,2) .eq. INT_DIR) fix_zlo = (ARG_L3(p) .lt. domlo(3)) .and. (bc(3,1) .ne. INT_DIR) per_zlo = (ARG_L3(p) .lt. domlo(3)) .and. (bc(3,1) .eq. INT_DIR) fix_zhi = (ARG_H3(p) .gt. domhi(3)) .and. (bc(3,2) .ne. INT_DIR) per_zhi = (ARG_H3(p) .gt. domhi(3)) .and. (bc(3,2) .eq. INT_DIR) ilo = max(ARG_L1(p),domlo(1)) ihi = min(ARG_H1(p),domhi(1)) jlo = max(ARG_L2(p),domlo(2)) jhi = min(ARG_H2(p),domhi(2)) Klo = max(ARG_L3(p),domlo(3)) khi = min(ARG_H3(p),domhi(3)) c***************************************************************************** c SETTING XLO c***************************************************************************** if (fix_xlo) then do i = ARG_L1(p), domlo(1)-1 do k = klo, khi do j = jlo,jhi p(i,j,k) = p(ilo,j,k) end do end do end do if (fix_ylo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = klo, khi p(i,j,k) = p(ilo,jlo,k) end do end do end do if (fix_zlo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ilo,jlo,klo) end do end do end do else if (per_zlo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ilo,jlo,k) end do end do end do end if if (fix_zhi) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ilo,jlo,khi) end do end do end do else if (per_zhi) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ilo,jlo,k) end do end do end do end if end if if (fix_yhi) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = klo, khi p(i,j,k) = p(ilo,jhi,k) end do end do end do if (fix_zlo) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ilo,jhi,klo) end do end do end do else if (per_zlo) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ilo,jhi,k) end do end do end do end if if (fix_zhi) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ilo,jhi,khi) end do end do end do else if (per_zhi) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ilo,jhi,k) end do end do end do end if end if if (fix_zlo) then do i = ARG_L1(p), domlo(1)-1 do j = jlo, jhi do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ilo,j,klo) end do end do end do if (per_ylo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ilo,j,klo) end do end do end do end if if (per_yhi) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ilo,j,klo) end do end do end do end if end if if (fix_zhi) then do i = ARG_L1(p), domlo(1)-1 do j = jlo, jhi do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ilo,j,khi) end do end do end do if (per_ylo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ilo,j,khi) end do end do end do end if if (per_yhi) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ilo,j,khi) end do end do end do end if end if if (per_ylo) then do i = ARG_L1(p), domlo(1)-1 do k = klo,khi do j = ARG_L2(p), domlo(2)-1 p(i,j,k) = p(ilo,j,k) end do end do end do end if if (per_yhi) then do i = ARG_L1(p), domlo(1)-1 do k = klo,khi do j = domhi(2)+1, ARG_H2(p) p(i,j,k) = p(ilo,j,k) end do end do end do end if if (per_zlo) then do i = ARG_L1(p), domlo(1)-1 do j = jlo,jhi do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ilo,j,k) end do end do end do end if if (per_zhi) then do i = ARG_L1(p), domlo(1)-1 do j = jlo,jhi do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ilo,j,k) end do end do end do end if if (per_ylo .and. per_zlo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ilo,j,k) end do end do end do end if if (per_ylo .and. per_zhi) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ilo,j,k) end do end do end do end if if (per_yhi .and. per_zlo) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ilo,j,k) end do end do end do end if if (per_yhi .and. per_zhi) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ilo,j,k) end do end do end do end if end if c***************************************************************************** c SETTING XHI c***************************************************************************** if (fix_xhi) then do i = domhi(1)+1, ARG_H1(p) do k = klo, khi do j = jlo,jhi p(i,j,k) = p(ihi,j,k) end do end do end do if (fix_ylo) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = klo, khi p(i,j,k) = p(ihi,jlo,k) end do end do end do if (fix_zlo) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ihi,jlo,klo) end do end do end do else if (per_zlo) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ihi,jlo,k) end do end do end do end if if (fix_zhi) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ihi,jlo,khi) end do end do end do else if (per_zhi) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ihi,jlo,k) end do end do end do end if end if if (fix_yhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = klo, khi p(i,j,k) = p(ihi,jhi,k) end do end do end do if (fix_zlo) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ihi,jhi,klo) end do end do end do else if (per_zlo) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ihi,jhi,k) end do end do end do end if if (fix_zhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ihi,jhi,khi) end do end do end do else if (per_zhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ihi,jhi,k) end do end do end do end if end if if (fix_zlo) then do i = domhi(1)+1, ARG_H1(p) do j = jlo, jhi do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ihi,j,klo) end do end do end do if (per_ylo) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ihi,j,klo) end do end do end do end if if (per_yhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ihi,j,klo) end do end do end do end if end if if (fix_zhi) then do i = domhi(1)+1, ARG_H1(p) do j = jlo, jhi do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ihi,j,khi) end do end do end do if (per_ylo) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ihi,j,khi) end do end do end do end if if (per_yhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ihi,j,khi) end do end do end do end if end if if (per_ylo) then do i = domhi(1)+1, ARG_H1(p) do k = klo,khi do j = ARG_L2(p), domlo(2)-1 p(i,j,k) = p(ihi,j,k) end do end do end do end if if (per_yhi) then do i = domhi(1)+1, ARG_H1(p) do k = klo,khi do j = domhi(2)+1, ARG_H2(p) p(i,j,k) = p(ihi,j,k) end do end do end do end if if (per_zlo) then do i = domhi(1)+1, ARG_H1(p) do j = jlo,jhi do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ihi,j,k) end do end do end do end if if (per_zhi) then do i = domhi(1)+1, ARG_H1(p) do j = jlo,jhi do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ihi,j,k) end do end do end do end if if (per_ylo .and. per_zlo) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ihi,j,k) end do end do end do end if if (per_ylo .and. per_zhi) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ihi,j,k) end do end do end do end if if (per_yhi .and. per_zlo) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(ihi,j,k) end do end do end do end if if (per_yhi .and. per_zhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(ihi,j,k) end do end do end do end if end if c***************************************************************************** c SETTING YLO c***************************************************************************** if (fix_ylo) then do j = ARG_L2(p), domlo(2)-1 do k = klo, khi do i = ilo, ihi p(i,j,k) = p(i,jlo,k) end do end do end do if (fix_zlo) then do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 do i = ilo, ihi p(i,j,k) = p(i,jlo,klo) end do end do end do if (per_xlo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(i,jlo,klo) end do end do end do end if if (per_xhi) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(i,jlo,klo) end do end do end do end if end if if (fix_zhi) then do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) do i = ilo, ihi p(i,j,k) = p(i,jlo,khi) end do end do end do if (per_xlo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(i,jlo,khi) end do end do end do end if if (per_xhi) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(i,jlo,khi) end do end do end do end if end if if (per_xlo) then do j = ARG_L2(p), domlo(2)-1 do k = klo,khi do i = ARG_L1(p), domlo(1)-1 p(i,j,k) = p(i,jlo,k) end do end do end do end if if (per_xhi) then do j = ARG_L2(p), domlo(2)-1 do k = klo,khi do i = domhi(1)+1, ARG_H1(p) p(i,j,k) = p(i,jlo,k) end do end do end do end if if (per_zlo) then do j = ARG_L2(p), domlo(2)-1 do i = ilo,ihi do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(i,jlo,k) end do end do end do end if if (per_zhi) then do j = ARG_L2(p), domlo(2)-1 do i = ilo,ihi do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(i,jlo,k) end do end do end do end if if (per_xlo .and. per_zlo) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(i,jlo,k) end do end do end do end if if (per_xlo .and. per_zhi) then do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(i,jlo,k) end do end do end do end if if (per_xhi .and. per_zlo) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(i,jlo,k) end do end do end do end if if (per_xhi .and. per_zhi) then do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(i,jlo,k) end do end do end do end if end if c***************************************************************************** c SETTING YHI c***************************************************************************** if (fix_yhi) then do j = domhi(2)+1, ARG_H2(p) do k = klo, khi do i = ilo, ihi p(i,j,k) = p(i,jhi,k) end do end do end do if (fix_zlo) then do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 do i = ilo, ihi p(i,j,k) = p(i,jhi,klo) end do end do end do if (per_xlo) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(i,jhi,klo) end do end do end do end if if (per_xhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(i,jhi,klo) end do end do end do end if end if if (fix_zhi) then do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) do i = ilo, ihi p(i,j,k) = p(i,jhi,khi) end do end do end do if (per_xlo) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(i,jhi,khi) end do end do end do end if if (per_xhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(i,jhi,khi) end do end do end do end if end if if (per_xlo) then do j = domhi(2)+1, ARG_H2(p) do k = klo,khi do i = ARG_L1(p), domlo(1)-1 p(i,j,k) = p(i,jhi,k) end do end do end do end if if (per_xhi) then do j = domhi(2)+1, ARG_H2(p) do k = klo,khi do i = domhi(1)+1, ARG_H1(p) p(i,j,k) = p(i,jhi,k) end do end do end do end if if (per_zlo) then do j = domhi(2)+1, ARG_H2(p) do i = ilo,ihi do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(i,jhi,k) end do end do end do end if if (per_zhi) then do j = domhi(2)+1, ARG_H2(p) do i = ilo,ihi do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(i,jhi,k) end do end do end do end if if (per_xlo .and. per_zlo) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(i,jhi,k) end do end do end do end if if (per_xlo .and. per_zhi) then do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(i,jhi,k) end do end do end do end if if (per_xhi .and. per_zlo) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = ARG_L3(p), domlo(3)-1 p(i,j,k) = p(i,jhi,k) end do end do end do end if if (per_xhi .and. per_zhi) then do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) do k = domhi(3)+1, ARG_H3(p) p(i,j,k) = p(i,jhi,k) end do end do end do end if end if c***************************************************************************** c SETTING ZLO c***************************************************************************** if (fix_zlo) then do k = ARG_L3(p), domlo(3)-1 do j = jlo, jhi do i = ilo, ihi p(i,j,k) = p(i,j,klo) end do end do end do if (per_xlo) then do k = ARG_L3(p), domlo(3)-1 do j = jlo,jhi do i = ARG_L1(p), domlo(1)-1 p(i,j,k) = p(i,j,klo) end do end do end do end if if (per_xhi) then do k = ARG_L3(p), domlo(3)-1 do j = jlo,jhi do i = domhi(1)+1, ARG_H1(p) p(i,j,k) = p(i,j,klo) end do end do end do end if if (per_ylo) then do k = ARG_L3(p), domlo(3)-1 do i = ilo,ihi do j = ARG_L2(p), domlo(2)-1 p(i,j,k) = p(i,j,klo) end do end do end do end if if (per_yhi) then do k = ARG_L3(p), domlo(3)-1 do i = ilo,ihi do j = domhi(2)+1, ARG_H2(p) p(i,j,k) = p(i,j,klo) end do end do end do end if if (per_xlo .and. per_ylo) then do k = ARG_L3(p), domlo(3)-1 do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 p(i,j,k) = p(i,j,klo) end do end do end do end if if (per_xlo .and. per_yhi) then do k = ARG_L3(p), domlo(3)-1 do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) p(i,j,k) = p(i,j,klo) end do end do end do end if if (per_xhi .and. per_ylo) then do k = ARG_L3(p), domlo(3)-1 do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 p(i,j,k) = p(i,j,klo) end do end do end do end if if (per_xhi .and. per_yhi) then do k = ARG_L3(p), domlo(3)-1 do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) p(i,j,k) = p(i,j,klo) end do end do end do end if end if c***************************************************************************** c SETTING ZHI c***************************************************************************** if (fix_zhi) then do k = domhi(3)+1, ARG_H3(p) do j = jlo, jhi do i = ilo, ihi p(i,j,k) = p(i,j,khi) end do end do end do if (per_xlo) then do k = domhi(3)+1, ARG_H3(p) do j = jlo,jhi do i = ARG_L1(p), domlo(1)-1 p(i,j,k) = p(i,j,khi) end do end do end do end if if (per_xhi) then do k = domhi(3)+1, ARG_H3(p) do j = jlo,jhi do i = domhi(1)+1, ARG_H1(p) p(i,j,k) = p(i,j,khi) end do end do end do end if if (per_ylo) then do k = domhi(3)+1, ARG_H3(p) do i = ilo,ihi do j = ARG_L2(p), domlo(2)-1 p(i,j,k) = p(i,j,khi) end do end do end do end if if (per_yhi) then do k = domhi(3)+1, ARG_H3(p) do i = ilo,ihi do j = domhi(2)+1, ARG_H2(p) p(i,j,k) = p(i,j,khi) end do end do end do end if if (per_xlo .and. per_ylo) then do k = domhi(3)+1, ARG_H3(p) do i = ARG_L1(p), domlo(1)-1 do j = ARG_L2(p), domlo(2)-1 p(i,j,k) = p(i,j,khi) end do end do end do end if if (per_xlo .and. per_yhi) then do k = domhi(3)+1, ARG_H3(p) do i = ARG_L1(p), domlo(1)-1 do j = domhi(2)+1, ARG_H2(p) p(i,j,k) = p(i,j,khi) end do end do end do end if if (per_xhi .and. per_ylo) then do k = domhi(3)+1, ARG_H3(p) do i = domhi(1)+1, ARG_H1(p) do j = ARG_L2(p), domlo(2)-1 p(i,j,k) = p(i,j,khi) end do end do end do end if if (per_xhi .and. per_yhi) then do k = domhi(3)+1, ARG_H3(p) do i = domhi(1)+1, ARG_H1(p) do j = domhi(2)+1, ARG_H2(p) p(i,j,k) = p(i,j,khi) end do end do end do end if end if c***************************************************************************** end ccseapps-2.5/CCSEApps/iamrlib/run3d/PlotFiles/0000755000175000017500000000000011634153073022232 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/run3d/PlotFiles/Euler/0000755000175000017500000000000011634153073023306 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/run3d/PlotFiles/Euler/amrvis.defaults0000644000175000017500000000036711634153073026346 0ustar amckinstryamckinstrypalette Palette initialderived mag_vort initialscale 2 numberformat %8.5e maxpixmapsize 800000 reservesystemcolors 24 showboxes TRUE windowheight 850 windowwidth 1000 ccseapps-2.5/CCSEApps/iamrlib/run3d/PlotFiles/Euler/Palette0000644000175000017500000000140011634153073024622 0ustar amckinstryamckinstry #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúöñíéäàÛ×ÓÎÊÅÁ½¸´¯«§¢ž™•‘Œˆƒ #'+/37;?CGKOSW[_cgkosw{ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ƒ‡‹“—›Ÿ£§«¯³·»¿ÃÇËÏÓ×Ûßãçëïó÷ûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿû÷óïëçãßÛ×ÓÏËÇÿ»·³¯«§£Ÿ›—“‹‡ƒ{wsokgc_[WSOKGC?;73/+'# ccseapps-2.5/CCSEApps/iamrlib/SLABSTAT_NS_F.H0000644000175000017500000000570011634153073021473 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _SLABSTAT_NS_F_H_ #define _SLABSTAT_NS_F_H_ /* ** $Id: SLABSTAT_NS_F.H,v 1.2 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_NS_BASICSTATS_NCTRAC ns_basicstats_nctrac # define FORT_NS_BASICSTATS_CTRAC ns_basicstats_ctrac #else # ifdef BL_FORT_USE_UPPERCASE # define FORT_NS_BASICSTATS_NCTRAC NS_BASICSTATS_NCTRAC # define FORT_NS_BASICSTATS_CTRAC NS_BASICSTATS_CTRAC # else # ifdef BL_FORT_USE_LOWERCASE # define FORT_NS_BASICSTATS_NCTRAC ns_basicstats_nctrac # define FORT_NS_BASICSTATS_CTRAC ns_basicstats_ctrac # else # define FORT_NS_BASICSTATS_NCTRAC ns_basicstats_nctrac_ # define FORT_NS_BASICSTATS_CTRAC ns_basicstats_ctrac_ # endif # endif extern "C" { void FORT_NS_BASICSTATS_NCTRAC (const Real* src, ARLIM_P(src_lo), ARLIM_P(src_hi), const int* nsrc, Real* dst, ARLIM_P(dst_lo), ARLIM_P(dst_hi), const int* ndst, const Real* dt, const Real* dx); void FORT_NS_BASICSTATS_CTRAC (const Real* src, ARLIM_P(src_lo), ARLIM_P(src_hi), const int* nsrc, Real* dst, ARLIM_P(dst_lo), ARLIM_P(dst_hi), const int* ndst, const Real* dt, const Real* dx); } #endif #endif /*_SLABSTAT_NS_F_H_*/ ccseapps-2.5/CCSEApps/iamrlib/MacBndry.cpp0000644000175000017500000000573711634153073021515 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MacBndry.cpp,v 1.15 2001/08/22 16:42:00 car Exp $ // #include #include #include MacBndry::MacBndry () : InterpBndryData() {} MacBndry::MacBndry (const BoxArray& _grids, int _ncomp, const Geometry& _geom) : InterpBndryData(_grids,_ncomp,_geom) {} void MacBndry::setBndryConds (const BCRec& phys_bc, IntVect& ratio, int comp) { // // ALL BCLOC VALUES ARE NOW DEFINED AS A LENGTH IN PHYSICAL // DIMENSIONS *RELATIVE* TO THE FACE, NOT IN ABSOLUTE PHYSICAL SPACE // const BoxArray& grids = boxes(); const int ngrds = grids.size(); const Real* dx = geom.CellSize(); const Box& domain = geom.Domain(); for (OrientationIter fi; fi; ++fi) { Array& bloc = bcloc[fi()]; Array< Array >& bctag = bcond[fi()]; int dir = fi().coordDir(); Real delta = dx[dir]*ratio[dir]; int p_bc = (fi().isLow() ? phys_bc.lo(dir) : phys_bc.hi(dir)); for (int i = 0; i < ngrds; i++) { const Box& grd = grids[i]; if (domain[fi()] == grd[fi()] && !geom.isPeriodic(dir)) { // // All physical bc values are located on face. // bctag[i][comp] = (p_bc == Outflow) ? LO_DIRICHLET : LO_NEUMANN; bloc[i] = 0; } else { // // Internal bndry. // bctag[i][comp] = LO_DIRICHLET; bloc[i] = 0.5*delta; } } } } ccseapps-2.5/CCSEApps/iamrlib/MacProj.cpp0000644000175000017500000012734411634153073021350 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: MacProj.cpp,v 1.92 2003/03/03 20:24:53 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include #include #ifndef _NavierStokes_H_ enum StateType {State_Type=0, Press_Type}; #if (BL_SPACEDIM == 2) enum StateNames { Xvel=0, Yvel, Density}; #else enum StateNames { Xvel=0, Yvel, Zvel, Density}; #endif #endif #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); #define DEF_CLIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ const Real* fabdat = (fab).dataPtr(); #define DEF_BOX_LIMITS(box,boxlo,boxhi) \ const int* boxlo = (box).loVect(); \ const int* boxhi = (box).hiVect(); #define GEOM_GROW 1 #define HYP_GROW 3 int MacProj::verbose = 0; bool MacProj::use_cg_solve = false; namespace { bool use_hypre_solve = false; } Real MacProj::mac_tol = 1.0e-12; Real MacProj::mac_abs_tol = 1.0e-16; Real MacProj::mac_sync_tol = 1.0e-8; int MacProj::do_outflow_bcs = 1; int MacProj::fix_mac_sync_rhs = 0; int MacProj::check_umac_periodicity = 1; namespace { Real umac_periodic_test_Tol = 1.e-10; } // // Setup functions follow // MacProj::MacProj (Amr* _parent, int _finest_level, BCRec* _phys_bc, int _radius_grow) : parent(_parent), finest_level(_finest_level), phys_bc(_phys_bc), radius_grow(_radius_grow), LevelData(_finest_level+1), phi_bcs(_finest_level+1), mac_phi_crse(_finest_level+1, PArrayManage), mac_reg(_finest_level+1, PArrayManage), volume(_finest_level+1), area(_finest_level+1), radius(_finest_level+1) { read_params(); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Creating mac_projector\n"; finest_level_allocated = finest_level; } MacProj::~MacProj () {} void MacProj::read_params () { ParmParse pp("mac"); pp.query( "v", verbose ); pp.query( "mac_tol", mac_tol ); pp.query( "mac_sync_tol", mac_sync_tol ); pp.query( "use_cg_solve", use_cg_solve ); #if MG_USE_HYPRE pp.query( "use_hypre_solve", use_hypre_solve); #endif pp.query( "mac_abs_tol", mac_abs_tol ); pp.query( "do_outflow_bcs", do_outflow_bcs ); pp.query( "fix_mac_sync_rhs", fix_mac_sync_rhs ); pp.query("check_umac_periodicity",check_umac_periodicity); pp.query("umac_periodic_test_Tol", umac_periodic_test_Tol); if ( use_cg_solve && use_hypre_solve) { BoxLib::Error("MacProj::read_params: cg_solve && .not. hypre_solve"); } } void MacProj::install_level (int level, AmrLevel* level_data, MultiFab& _volume, MultiFab* _area, PArray* _radius ) { if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Installing MacProj level " << level << '\n'; if (parent->finestLevel() < finest_level) for (int lev = parent->finestLevel() + 1; lev <= finest_level; lev++) mac_reg.clear(lev); finest_level = parent->finestLevel(); if (level > finest_level_allocated) { finest_level_allocated = finest_level; LevelData.resize(finest_level+1); phi_bcs.resize(finest_level+1); mac_phi_crse.resize(finest_level+1); mac_reg.resize(finest_level+1); volume.resize(finest_level+1); area.resize(finest_level+1); radius.resize(finest_level+1); } LevelData.clear(level); LevelData.set(level, level_data); volume.clear(level); volume.set(level, &_volume); area.set(level, _area); radius.clear(level); radius.set(level, _radius); BuildPhiBC(level); if (level > 0) { mac_reg.clear(level); mac_reg.set(level,new FluxRegister(LevelData[level].boxArray(), parent->refRatio(level-1),level,1)); } } void MacProj::BuildPhiBC (int level) { const BoxArray& grids = LevelData[level].boxArray(); const Geometry& geom = parent->Geom(level); const int ngrds = grids.size(); phi_bcs[level].resize(ngrds); const Box& domain = geom.Domain(); const int* domlo = domain.loVect(); const int* domhi = domain.hiVect(); const int* phys_lo = phys_bc->lo(); const int* phys_hi = phys_bc->hi(); for (int i = 0; i < ngrds; i++) { BCRec& bc = phi_bcs[level][i]; const int* lo = grids[i].loVect(); const int* hi = grids[i].hiVect(); for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (lo[dir] == domlo[dir]) { bc.setLo(dir,phys_lo[dir]==Outflow ? LO_DIRICHLET : LO_NEUMANN); } else { bc.setLo(dir,LO_DIRICHLET); } if (hi[dir] == domhi[dir]) { bc.setHi(dir,phys_hi[dir]==Outflow ? LO_DIRICHLET : LO_NEUMANN); } else { bc.setHi(dir,LO_DIRICHLET); } } } } void MacProj::setup (int level) { if (level < parent->maxLevel()) { if (!mac_phi_crse.defined(level)) { const BoxArray& grids = LevelData[level].boxArray(); mac_phi_crse.set(level,new MultiFab(grids,1,1)); mac_phi_crse[level].setVal(0.0); } } } void MacProj::cleanup (int level) { if (level < parent->maxLevel()) mac_phi_crse.clear(level); } // // Projection functions follow ... // static bool grids_on_side_of_domain (const BoxArray& grids, const Box& domain, const Orientation& outFace) { const int idir = outFace.coordDir(); if (outFace.isLow()) { for (int igrid = 0; igrid < grids.size(); igrid++) { if (grids[igrid].smallEnd(idir) == domain.smallEnd(idir)) { return true; } } } if (outFace.isHigh()) { for (int igrid = 0; igrid < grids.size(); igrid++) { if (grids[igrid].bigEnd(idir) == domain.bigEnd(idir)) { return true; } } } return false; } // // Compute the level advance mac projection. // void MacProj::mac_project (int level, MultiFab* u_mac, MultiFab& S, Real dt, Real time, const MultiFab& divu, int have_divu) { if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "... mac_project at level " << level << '\n'; const BoxArray& grids = LevelData[level].boxArray(); const Geometry& geom = parent->Geom(level); const Real* dx = geom.CellSize(); const int max_level = parent->maxLevel(); MultiFab* mac_phi = 0; NavierStokes& ns = *(NavierStokes*) &(parent->getLevel(level)); IntVect crse_ratio = level > 0 ? parent->refRatio(level-1) : IntVect::TheZeroVector(); // // If finest level possible no need to make permanent mac_phi for bcs. // if (level == max_level) mac_phi = new MultiFab(grids,1,1); else mac_phi = &mac_phi_crse[level]; mac_phi->setVal(0.0); // // HACK!!! // // Some of the routines we call assume that density has one valid // ghost cell. We enforce that assumption by setting it here. // const MultiFab& rhotime = ns.get_rho(time); for (MFIter mfi(rhotime); mfi.isValid(); ++mfi) S[mfi].copy(rhotime[mfi],0,Density,1); if (OutFlowBC::HasOutFlowBC(phys_bc) && have_divu && do_outflow_bcs) set_outflow_bcs(level, mac_phi, u_mac, S, divu); // // Store the Dirichlet boundary condition for mac_phi in mac_bndry. // MacBndry mac_bndry(grids,1,geom); const int src_comp = 0; const int dest_comp = 0; const int num_comp = 1; if (level == 0) { mac_bndry.setBndryValues(*mac_phi,src_comp,dest_comp,num_comp,*phys_bc); } else { MultiFab& CPhi = mac_phi_crse[level-1]; BoxArray crse_boxes(grids); crse_boxes.coarsen(crse_ratio); const int in_rad = 0; const int out_rad = 1; //const int extent_rad = 1; const int extent_rad = 2; BndryRegister crse_br(crse_boxes,in_rad,out_rad,extent_rad,num_comp); crse_br.copyFrom(CPhi,extent_rad,src_comp,dest_comp,num_comp); mac_bndry.setBndryValues(crse_br,src_comp,*mac_phi,src_comp, dest_comp,num_comp,crse_ratio,*phys_bc); } // // Compute the nondivergent velocities, by creating the linop // and multigrid operator appropriate for the solved system. // // Initialize the rhs with divu. // const Real rhs_scale = 2.0/dt; MultiFab Rhs(grids,1,0); Rhs.copy(divu); int the_solver = 0; if (use_cg_solve) { the_solver = 1; } else if ( use_hypre_solve ) { the_solver = 2; } mac_level_driver(mac_bndry, grids, the_solver, level, Density, dx, dt, mac_tol, mac_abs_tol, rhs_scale, area[level], volume[level], S, Rhs, u_mac, mac_phi); // // Test that u_mac is divergence free // if (verbose) check_div_cond(level, u_mac); // // Store advection velocities in mac registers at crse/fine boundaries. // // Initialize advection velocity registers with coarse grid velocity. // if (level < finest_level) { FluxRegister& mr = mac_reg[level+1]; mr.setVal(0.0); for (int dir = 0; dir < BL_SPACEDIM; dir++) { mr.CrseInit(u_mac[dir],area[level][dir],dir,0,0,1,-1.0); } if (verbose) { Real sumreg = mr.SumReg(0); if (ParallelDescriptor::IOProcessor()) { std::cout << "LEVEL " << level << " MACREG: CrseInit sum = " << sumreg << std::endl; } } } // // Increment in fine grid velocity to velocity registers. // if (level > 0) { const Real mult = 1.0/parent->nCycle(level); for (int dir = 0; dir < BL_SPACEDIM; dir++) { mac_reg[level].FineAdd(u_mac[dir],area[level][dir],dir,0,0,1,mult); } if (verbose) { Real sumreg = mac_reg[level].SumReg(0); if (ParallelDescriptor::IOProcessor()) { std::cout << "LEVEL " << level << " MACREG: FineAdd sum = " << sumreg << std::endl; } } } // // If finest level possible no need to keep phi for boundary conditions. // if (level == max_level) { delete mac_phi; mac_phi = 0; } if (check_umac_periodicity) test_umac_periodic(level,u_mac); } // // Compute the corrective pressure used in the mac_sync. // void MacProj::mac_sync_solve (int level, Real dt, MultiFab* rho_half, IntVect& fine_ratio) { BL_ASSERT(level < finest_level); if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "... mac_sync_solve at level " << level << '\n'; const BoxArray& grids = LevelData[level].boxArray(); const Geometry& geom = parent->Geom(level); const Real* dx = geom.CellSize(); const BoxArray& fine_boxes = LevelData[level+1].boxArray(); IntVect crse_ratio = level > 0 ? parent->refRatio(level-1) : IntVect::TheZeroVector(); // // Reusing storage here, since there should be no more need for the // values in mac_phi at this level and mac_sync_phi only need to last // into the call to mac_sync_compute. Hope this works... (LHH). // MultiFab* mac_sync_phi = &mac_phi_crse[level]; // // Alloc and define RHS by doing a reflux-like operation in coarse // grid cells adjacent to fine grids. The values in these // cells should be SUM{MR/VOL} where the sum is taken over // all edges of a cell that adjoin fine grids, MR = value in // MAC register, VOL = cell volume. All other cells have a // value of zero (including crse cells under fine grids). // MultiFab Rhs(grids,1,0); Rhs.setVal(0.0); // // Reflux subtracts values at hi edge of coarse cell and // adds values at lo edge. We want the opposite here so // set scale to -1 & alloc space for Rhs. // FluxRegister& mr = mac_reg[level+1]; const Real scale = -1.0; mr.Reflux(Rhs,volume[level],scale,0,0,1,geom); for (int kf = 0, nfine = fine_boxes.size(); kf < nfine; kf++) { Box bf = BoxLib::coarsen(fine_boxes[kf],fine_ratio); for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { BL_ASSERT(grids[Rhsmfi.index()] == Rhsmfi.validbox()); Box isect = Rhsmfi.validbox() & bf; if (isect.ok()) { Rhs[Rhsmfi].setVal(0.0,isect,0); } } } // // Remove constant null space component from the rhs of the solve // when appropriate (i.e. when the grids span the whole domain AND // the boundary conditions are Neumann for phi on all sides of the domain.) // Note that Rhs does not yet have the radial scaling in it for r-z // problems so we must do explicit volume-weighting here. // if (fix_mac_sync_rhs) { int all_neumann = 1; for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (phys_bc->lo()[dir] == Outflow || phys_bc->hi()[dir] == Outflow) all_neumann = 0; } long size = 0; for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { size += Rhs[Rhsmfi].box().numPts(); } ParallelDescriptor::ReduceLongSum(size); if (size == geom.Domain().numPts() && all_neumann == 1) { Real sum = 0.0; Real vol = 0.0; FArrayBox vol_wgted_rhs; for (MFIter Rhsmfi(Rhs); Rhsmfi.isValid(); ++Rhsmfi) { vol_wgted_rhs.resize(Rhs[Rhsmfi].box()); vol_wgted_rhs.copy(Rhs[Rhsmfi]); vol_wgted_rhs.mult(volume[level][Rhsmfi]); sum += vol_wgted_rhs.sum(0,1); vol += volume[level][Rhsmfi].sum(Rhs[Rhsmfi].box(),0,1); } ParallelDescriptor::ReduceRealSum(sum); ParallelDescriptor::ReduceRealSum(vol); const Real fix = sum / vol; if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "Average correction on mac sync RHS = " << fix << '\n'; Rhs.plus(-fix, 0); } } mac_sync_phi->setVal(0.0); // // store the Dirichlet boundary condition for mac_sync_phi in mac_bndry // MacBndry mac_bndry(grids,1,geom); const int src_comp = 0; const int dest_comp = 0; const int num_comp = 1; if (level == 0) { mac_bndry.setBndryValues(*mac_sync_phi,src_comp,dest_comp,num_comp, *phys_bc); } else { BoxArray crse_boxes(grids); crse_boxes.coarsen(crse_ratio); const int in_rad = 0; const int out_rad = 1; //const int extent_rad = 1; const int extent_rad = 2; BndryRegister crse_br(crse_boxes,in_rad,out_rad,extent_rad,num_comp); crse_br.setVal(0); mac_bndry.setBndryValues(crse_br,src_comp,*mac_sync_phi,src_comp, dest_comp,num_comp,crse_ratio, *phys_bc); } // // Now define edge centered coefficients and adjust RHS for MAC solve. // const Real rhs_scale = 2.0/dt; // // Solve the sync system. // int the_solver = 0; if (use_cg_solve) { the_solver = 1; } else if ( use_hypre_solve ) { the_solver = 2; } mac_sync_driver(mac_bndry, grids, the_solver, level, dx, dt, mac_sync_tol, mac_abs_tol, rhs_scale, area[level], volume[level], Rhs, rho_half, mac_sync_phi); } // // After solving for mac_sync_phi in mac_sync_solve(), we // can now do the sync advect step. This consists of two steps // // 1. compute u_corr as the gradient of mac_sync_phi // 2. compute advective tendency of u_corr and // add into Vsync or Ssync // // If increment_sync is non-null, the (i-BL_SPACEDIM)-th component // of (*Ssync) is incremented only when increment[i]==1 // This is useful if that component gets incrmnted in a non-standard way. // void MacProj::mac_sync_compute (int level, MultiFab* u_mac, MultiFab* Vsync, MultiFab* Ssync, MultiFab* rho_half, FluxRegister* adv_flux_reg, Array& advectionType, Real prev_time, Real prev_pres_time, Real dt, int NUM_STATE, Real be_cn_theta, bool modify_reflux_normal_vel, int do_mom_diff, const Array& increment_sync) { FArrayBox Rho, tforces, tvelforces; FArrayBox xflux, yflux, zflux; FArrayBox grad_phi[BL_SPACEDIM]; // // Get parameters. // const BoxArray& grids = LevelData[level].boxArray(); const Geometry& geom = parent->Geom(level); const Real* dx = geom.CellSize(); const int numscal = NUM_STATE - BL_SPACEDIM; MultiFab* mac_sync_phi = &mac_phi_crse[level]; NavierStokes& ns_level = *(NavierStokes*) &(parent->getLevel(level)); Godunov* godunov = ns_level.godunov; bool use_forces_in_trans = godunov->useForcesInTrans()?true:false; MultiFab vel_visc_terms(grids,BL_SPACEDIM,1); MultiFab scal_visc_terms(grids,numscal,1); vel_visc_terms.setVal(0,1); // Initialize to make calls below safe scal_visc_terms.setVal(0,1); // Initialize to make calls below safe // // Get viscous forcing. // if (be_cn_theta != 1.0) { int i; bool do_get_visc_terms = false; for (i=0; i < BL_SPACEDIM; ++i) if (!increment_sync.size() || increment_sync[i]==1) do_get_visc_terms = true; if (do_get_visc_terms || use_forces_in_trans) ns_level.getViscTerms(vel_visc_terms,Xvel,BL_SPACEDIM,prev_time); do_get_visc_terms = false; for (i=BL_SPACEDIM; i < increment_sync.size(); ++i) if (!increment_sync.size() || increment_sync[i]==1) do_get_visc_terms = true; if (do_get_visc_terms) ns_level.getViscTerms(scal_visc_terms,BL_SPACEDIM,numscal,prev_time); } Array ns_level_bc, bndry[BL_SPACEDIM]; // // FillPatch()d stuff allocated on heap ... // MultiFab Gp(grids,BL_SPACEDIM,1); ns_level.getGradP(Gp, prev_pres_time); MultiFab* divu_fp = ns_level.getDivCond(1,prev_time); FluxRegister* temp_reg = 0; if (modify_reflux_normal_vel) { temp_reg = new FluxRegister(LevelData[level+1].boxArray(), parent->refRatio(level),level+1, BL_SPACEDIM); temp_reg->setVal(0); } // // Compute the mac sync correction. // for (FillPatchIterator P_fpi(ns_level,ns_level.get_old_data(Press_Type),1,prev_pres_time,Press_Type,0,1), S_fpi(ns_level,vel_visc_terms,HYP_GROW,prev_time,State_Type,0,NUM_STATE); S_fpi.isValid() && P_fpi.isValid(); ++S_fpi, ++P_fpi) { const int i = S_fpi.index(); FArrayBox& S = S_fpi(); FArrayBox& divu = (*divu_fp)[i]; FArrayBox U; U.resize(S.box(),BL_SPACEDIM); U.copy(S_fpi(),0,0,BL_SPACEDIM); // // Step 1: compute ucorr = grad(phi)/rhonph // // Create storage for corrective velocities. // D_TERM(grad_phi[0].resize(BoxLib::surroundingNodes(grids[i],0),1);, grad_phi[1].resize(BoxLib::surroundingNodes(grids[i],1),1);, grad_phi[2].resize(BoxLib::surroundingNodes(grids[i],2),1);); mac_vel_update(1,D_DECL(grad_phi[0],grad_phi[1],grad_phi[2]), (*mac_sync_phi)[S_fpi], &(*rho_half)[S_fpi], 0, grids[i], level, i, dx, dt/2.0); // // Step 2: compute Mac correction by calling GODUNOV box // // Get needed data. // Rho.resize(BoxLib::grow(grids[i],1),1); Rho.copy(S,Density,0,1); ns_level.getForce(tforces,i,1,0,NUM_STATE,Rho); // // Compute total forcing terms. // godunov->Sum_tf_gp_visc(tforces, vel_visc_terms[S_fpi], Gp[i], Rho); godunov->Sum_tf_divu_visc(S, tforces, BL_SPACEDIM, numscal, scal_visc_terms[S_fpi], 0, divu, Rho, 1); if (use_forces_in_trans) { ns_level.getForce(tvelforces,i,1,Xvel,BL_SPACEDIM,Rho); godunov->Sum_tf_gp_visc(tvelforces,vel_visc_terms[S_fpi],Gp[i],Rho); } // // Set up the workspace for the godunov Box. // D_TERM(bndry[0] = ns_level.getBCArray(State_Type,i,0,1);, bndry[1] = ns_level.getBCArray(State_Type,i,1,1);, bndry[2] = ns_level.getBCArray(State_Type,i,2,1);) godunov->Setup(grids[i], dx, dt, 0, xflux, bndry[0].dataPtr(), yflux, bndry[1].dataPtr(), #if (BL_SPACEDIM == 3) zflux, bndry[2].dataPtr(), #endif S, Rho, tvelforces); // // Get the sync FABS. // FArrayBox& u_sync = (*Vsync)[S_fpi]; FArrayBox& s_sync = (*Ssync)[S_fpi]; // // Loop over state components and compute the sync advective component. // for (int comp = 0; comp < NUM_STATE; comp++) { if (!increment_sync.size() || increment_sync[comp]==1) { const int sync_ind = comp < BL_SPACEDIM ? comp : comp-BL_SPACEDIM; FArrayBox& temp = comp < BL_SPACEDIM ? u_sync : s_sync; ns_level_bc = ns_level.getBCArray(State_Type,i,comp,1); int use_conserv_diff = (advectionType[comp] == Conservative) ? true : false; if (do_mom_diff == 1 && comp < BL_SPACEDIM) { S.mult(S, S.box(), S.box(),Density,comp,1); tforces.mult(S,tforces.box(),tforces.box(),Density,comp,1); } godunov->SyncAdvect(grids[i], dx, dt, level, area[level][0][S_fpi], u_mac[0][S_fpi], grad_phi[0], xflux, area[level][1][S_fpi], u_mac[1][S_fpi], grad_phi[1], yflux, #if (BL_SPACEDIM == 3) area[level][2][S_fpi], u_mac[2][S_fpi], grad_phi[2], zflux, #endif U, S, tforces, divu, comp, temp, sync_ind, use_conserv_diff, comp, ns_level_bc.dataPtr(), PRE_MAC, volume[level][S_fpi]); // // NOTE: the signs here are opposite from VELGOD. // NOTE: fluxes expected to be in extensive form. // if (level > 0) { D_TERM(adv_flux_reg->FineAdd(xflux,0,i,0,comp,1,-dt);, adv_flux_reg->FineAdd(yflux,1,i,0,comp,1,-dt);, adv_flux_reg->FineAdd(zflux,2,i,0,comp,1,-dt);); } } } // // Fill temp_reg with the normal fluxes. // int velpred = 0; if (modify_reflux_normal_vel) { for (int comp = 0; comp < BL_SPACEDIM; comp++) { int iconserv_dummy = 0; godunov->edge_states(grids[i], dx, dt, velpred, u_mac[0][S_fpi], xflux, u_mac[1][S_fpi], yflux, #if (BL_SPACEDIM == 3) u_mac[2][S_fpi], zflux, #endif U, S, tforces, divu, comp, comp, ns_level_bc.dataPtr(), iconserv_dummy, PRE_MAC); if (comp == 0) { temp_reg->CrseInit(xflux,xflux.box(),comp,0,comp,1,1.0); } else if (comp == 1) { temp_reg->CrseInit(yflux,yflux.box(),comp,0,comp,1,1.0); #if (BL_SPACEDIM == 3) } else if (comp == 2) { temp_reg->CrseInit(zflux,zflux.box(),comp,0,comp,1,1.0); #endif } } temp_reg->CrseInitFinish(); } // // Include grad_phi in the mac registers corresponding // to the next coarsest interface. // if (level > 0) { const Real mlt = -1.0/( (double) parent->nCycle(level)); D_TERM(mac_reg[level].FineAdd(grad_phi[0],area[level][0][S_fpi],0,i,0,0,1,mlt);, mac_reg[level].FineAdd(grad_phi[1],area[level][1][S_fpi],1,i,0,0,1,mlt);, mac_reg[level].FineAdd(grad_phi[2],area[level][2][S_fpi],2,i,0,0,1,mlt);); } // // Multiply the sync term by dt -- now done in the calling routine. // } if (modify_reflux_normal_vel) { // Multiply the fluxes (stored in temp_reg) // by delta U (area-weighted, stored in mr) on each edge // and store the result in temp_reg. // Then reflux the result into u_sync FluxRegister& mr = mac_reg[level+1]; const Real scale = 1.0; for (int dir = 0; dir < BL_SPACEDIM; dir++) { FabSet& lofabs_temp = (*temp_reg)[Orientation(dir,Orientation::low)]; FabSet& hifabs_temp = (*temp_reg)[Orientation(dir,Orientation::high)]; FabSet& lofabs_mr = mr[Orientation(dir,Orientation::low)]; FabSet& hifabs_mr = mr[Orientation(dir,Orientation::high)]; for (FabSetIter fsi(lofabs_temp); fsi.isValid(); ++fsi) { lofabs_temp[fsi].mult(lofabs_mr[fsi],0,dir,1); } for (FabSetIter fsi(hifabs_temp); fsi.isValid(); ++fsi) { hifabs_temp[fsi].mult(hifabs_mr[fsi],0,dir,1); } } temp_reg->Reflux(*Vsync,volume[level],scale,0,0,BL_SPACEDIM,geom); delete temp_reg; } delete divu_fp; } // // This routine does a sync advect step for a single // scalar component. Unlike the preceding routine, the // half-time edge states are passed in from the calling routine. // This routine is useful when the edge states are computed // in a physics-class-specific manner. (For example, as they are // in the calculation of div rho U h = div U sum_l (rho Y)_l h_l(T)). // void MacProj::mac_sync_compute (int level, MultiFab* Sync, int comp, int s_ind, const MultiFab* const* sync_edges, int eComp, MultiFab* rho_half, FluxRegister* adv_flux_reg, Array& advectionType, bool modify_reflux_normal_vel, Real dt) { FArrayBox xflux, yflux, zflux; FArrayBox grad_phi[BL_SPACEDIM]; const BoxArray& grids = LevelData[level].boxArray(); const Geometry& geom = parent->Geom(level); MultiFab* mac_sync_phi = &mac_phi_crse[level]; NavierStokes& ns_level = *(NavierStokes*) &(parent->getLevel(level)); Godunov godunov(512); FluxRegister* temp_reg = 0; if (modify_reflux_normal_vel && comp < BL_SPACEDIM) { temp_reg = new FluxRegister(LevelData[level+1].boxArray(), parent->refRatio(level),level+1,BL_SPACEDIM); temp_reg->setVal(0.); } // // Compute the mac sync correction. // for (MFIter Syncmfi(*Sync); Syncmfi.isValid(); ++Syncmfi) { // // Step 1: compute ucorr = grad(phi)/rhonph // D_TERM(grad_phi[0].resize(BoxLib::surroundingNodes(grids[Syncmfi.index()],0),1);, grad_phi[1].resize(BoxLib::surroundingNodes(grids[Syncmfi.index()],1),1);, grad_phi[2].resize(BoxLib::surroundingNodes(grids[Syncmfi.index()],2),1);); mac_vel_update(1, D_DECL(grad_phi[0],grad_phi[1],grad_phi[2]), (*mac_sync_phi)[Syncmfi], &(*rho_half)[Syncmfi], 0, grids[Syncmfi.index()], level, Syncmfi.index(), geom.CellSize(), dt/2.0); // // Step 2: compute Mac correction by advecting the edge states. // D_TERM(xflux.resize(BoxLib::surroundingNodes(grids[Syncmfi.index()],0),1);, yflux.resize(BoxLib::surroundingNodes(grids[Syncmfi.index()],1),1);, zflux.resize(BoxLib::surroundingNodes(grids[Syncmfi.index()],2),1);); D_TERM(xflux.copy((*sync_edges[0])[Syncmfi],eComp,0,1);, yflux.copy((*sync_edges[1])[Syncmfi],eComp,0,1);, zflux.copy((*sync_edges[2])[Syncmfi],eComp,0,1);); int use_conserv_diff = (advectionType[comp] == Conservative) ? true : false; godunov.ComputeSyncAofs(grids[Syncmfi.index()], area[level][0][Syncmfi], grad_phi[0], xflux, area[level][1][Syncmfi], grad_phi[1], yflux, #if (BL_SPACEDIM == 3) area[level][2][Syncmfi], grad_phi[2], zflux, #endif volume[level][Syncmfi], (*Sync)[Syncmfi], s_ind, use_conserv_diff); // // NOTE: the signs here are opposite from VELGOD. // NOTE: fluxes expected to be in extensive form. // if (level > 0) { D_TERM(adv_flux_reg->FineAdd(xflux,0,Syncmfi.index(),0,comp,1,-dt);, adv_flux_reg->FineAdd(yflux,1,Syncmfi.index(),0,comp,1,-dt);, adv_flux_reg->FineAdd(zflux,2,Syncmfi.index(),0,comp,1,-dt);); } // // Fill temp_reg with the normal fluxes. // if (modify_reflux_normal_vel && comp < BL_SPACEDIM) { if (comp == 0) { temp_reg->CrseInit((*sync_edges[0])[Syncmfi],(*sync_edges[0])[Syncmfi].box(),eComp,0,comp,1,1.0); } else if (comp == 1) { temp_reg->CrseInit((*sync_edges[1])[Syncmfi],(*sync_edges[1])[Syncmfi].box(),eComp,0,comp,1,1.0); #if (BL_SPACEDIM == 3) } else if (comp == 2) { temp_reg->CrseInit((*sync_edges[2])[Syncmfi],(*sync_edges[2])[Syncmfi].box(),eComp,0,comp,1,1.0); #endif } temp_reg->CrseInitFinish(); } } if (modify_reflux_normal_vel && comp < BL_SPACEDIM) { // Multiply the fluxes (stored in temp_reg) // by delta U (area-weighted, stored in mr) on each edge // and store the result in temp_reg. // Then reflux the result into Sync (which is Vsync in this case) FluxRegister& mr = mac_reg[level+1]; const Real scale = 1.0; int dir = comp; { FabSet& lofabs_temp = (*temp_reg)[Orientation(dir,Orientation::low)]; FabSet& hifabs_temp = (*temp_reg)[Orientation(dir,Orientation::high)]; FabSet& lofabs_mr = mr[Orientation(dir,Orientation::low)]; FabSet& hifabs_mr = mr[Orientation(dir,Orientation::high)]; for (FabSetIter fsi(lofabs_temp); fsi.isValid(); ++fsi) { lofabs_temp[fsi].mult(lofabs_mr[fsi],0,dir,1); } for (FabSetIter fsi(hifabs_temp); fsi.isValid(); ++fsi) { hifabs_temp[fsi].mult(hifabs_mr[fsi],0,dir,1); } } temp_reg->Reflux(*Sync,volume[level],scale,comp,comp,1,geom); delete temp_reg; } } // // Check the mac divergence. // void MacProj::check_div_cond (int level, MultiFab U_edge[]) const { const BoxArray& grids = LevelData[level].boxArray(); Real sum = 0.0; FArrayBox dmac; for (MFIter U_edge0mfi(U_edge[0]); U_edge0mfi.isValid(); ++U_edge0mfi) { dmac.resize(grids[U_edge0mfi.index()],1); const FArrayBox& uxedge = U_edge[0][U_edge0mfi]; const FArrayBox& uyedge = U_edge[1][U_edge0mfi]; const FArrayBox& xarea = area[level][0][U_edge0mfi]; const FArrayBox& yarea = area[level][1][U_edge0mfi]; const FArrayBox& vol = volume[level][U_edge0mfi]; DEF_LIMITS(dmac,dmac_dat,dlo,dhi); DEF_CLIMITS(uxedge,ux_dat,uxlo,uxhi); DEF_CLIMITS(uyedge,uy_dat,uylo,uyhi); DEF_CLIMITS(xarea,ax_dat,axlo,axhi); DEF_CLIMITS(yarea,ay_dat,aylo,ayhi); DEF_CLIMITS(vol,vol_dat,vlo,vhi); #if (BL_SPACEDIM == 2) FORT_MACDIV(dmac_dat,ARLIM(dlo),ARLIM(dhi),dlo,dhi, ux_dat,ARLIM(uxlo),ARLIM(uxhi), uy_dat,ARLIM(uylo),ARLIM(uyhi), ax_dat,ARLIM(axlo),ARLIM(axhi), ay_dat,ARLIM(aylo),ARLIM(ayhi), vol_dat,ARLIM(vlo),ARLIM(vhi)); #endif #if (BL_SPACEDIM == 3) const FArrayBox& uzedge = U_edge[2][U_edge0mfi]; DEF_CLIMITS(uzedge,uz_dat,uzlo,uzhi); const FArrayBox& zarea = area[level][2][U_edge0mfi]; DEF_CLIMITS(zarea,az_dat,azlo,azhi); FORT_MACDIV(dmac_dat,ARLIM(dlo),ARLIM(dhi),dlo,dhi, ux_dat,ARLIM(uxlo),ARLIM(uxhi), uy_dat,ARLIM(uylo),ARLIM(uyhi), uz_dat,ARLIM(uzlo),ARLIM(uzhi), ax_dat,ARLIM(axlo),ARLIM(axhi), ay_dat,ARLIM(aylo),ARLIM(ayhi), az_dat,ARLIM(azlo),ARLIM(azhi), vol_dat,ARLIM(vlo),ARLIM(vhi)); #endif sum += dmac.sum(0); } if (verbose) { const int IOProc = ParallelDescriptor::IOProcessorNumber(); ParallelDescriptor::ReduceRealSum(sum,IOProc); if (ParallelDescriptor::IOProcessor()) std::cout << "SUM of DIV(U_edge) = " << sum << '\n'; } } void MacProj::set_outflow_bcs (int level, MultiFab* mac_phi, const MultiFab* u_mac, const MultiFab& S, const MultiFab& divu) { // This code is very similar to the outflow BC stuff in the Projection // class except that here the the phi to be solved for lives on the // out-directed faces. The projection equation to satisfy is // // (1/r)(d/dr)[r/rho dphi/dr] = dv/dr - S // bool hasOutFlow; Orientation outFaces[2*BL_SPACEDIM]; int numOutFlowFaces; OutFlowBC::GetOutFlowFaces(hasOutFlow,outFaces,phys_bc,numOutFlowFaces); const BoxArray& grids = LevelData[level].boxArray(); const Geometry& geom = parent->Geom(level); const Box& domain = parent->Geom(level).Domain(); // // Create 1-wide cc box just outside boundary to hold phi. // Create 1-wide cc box just inside boundary to hold rho,u,divu. // BoxList ccBoxList; BoxList phiBoxList; for (int iface = 0; iface < numOutFlowFaces; iface++) { if (grids_on_side_of_domain(grids,geom.Domain(),outFaces[iface])) { const int outDir = outFaces[iface].coordDir(); Box ccBndBox; if (outFaces[iface].faceDir() == Orientation::high) { ccBndBox = Box(BoxLib::adjCellHi(domain,outDir,2)).shift(outDir,-2); } else { ccBndBox = Box(BoxLib::adjCellLo(domain,outDir,2)).shift(outDir,2); } ccBoxList.push_back(ccBndBox); Box phiBox = BoxLib::adjCell(domain,outFaces[iface],1); phiBoxList.push_back(phiBox); const Box valid_ccBndBox = ccBndBox & domain; const BoxArray uncovered_outflow_ba = BoxLib::complementIn(valid_ccBndBox,grids); if (uncovered_outflow_ba.size() && BoxLib::intersect(grids,valid_ccBndBox).size()) BoxLib::Error("MacProj: Cannot yet handle partially refined outflow"); } } if ( !ccBoxList.isEmpty() ) { BoxArray ccBoxArray( ccBoxList); BoxArray phiBoxArray(phiBoxList); FArrayBox rhodat[2*BL_SPACEDIM]; FArrayBox divudat[2*BL_SPACEDIM]; FArrayBox phidat[2*BL_SPACEDIM]; for ( int iface = 0; iface < numOutFlowFaces; ++iface) { rhodat[iface].resize(ccBoxArray[iface], 1); divudat[iface].resize(ccBoxArray[iface], 1); phidat[iface].resize(phiBoxArray[iface], 1); phidat[iface].setVal(0.0); divu.copy(divudat[iface]); S.copy(rhodat[iface], Density, 0, 1); } // rhodat.copy(S, Density, 0, 1); // divudat.copy(divu, 0, 0, 1); // // Load ec data. // FArrayBox uedat[BL_SPACEDIM][2*BL_SPACEDIM]; for (int i = 0; i < BL_SPACEDIM; ++i) { BoxArray edgeArray(ccBoxArray); edgeArray.surroundingNodes(i); for ( int iface = 0; iface < numOutFlowFaces; ++iface) { uedat[i][iface].resize(edgeArray[iface], 1); u_mac[i].copy(uedat[i][iface], 0, 0, 1); // uedat[iface][i].copy(u_mac[i], 0, 0, 1); } } MacOutFlowBC macBC; // phidat.setVal(0.0); NavierStokes* ns_level = dynamic_cast(&parent->getLevel(level)); Real gravity = ns_level->getGravity(); macBC.computeBC(uedat, divudat, rhodat, phidat, geom, outFaces, numOutFlowFaces, gravity); // Must do this kind of copy instead of mac_phi->copy(phidat); // because we're copying onto the ghost cells of the FABs, // not the valid regions. for ( int iface =0; iface < numOutFlowFaces; ++iface ) { for (MFIter mfi(*mac_phi); mfi.isValid(); ++mfi) { Box ovlp = (*mac_phi)[mfi].box() & phidat[iface].box(); if (ovlp.ok()) (*mac_phi)[mfi].copy(phidat[iface],ovlp); } } } } // // Structure used by test_umac_periodic(). // struct TURec { TURec () : m_idx(-1), m_dim(-1) {} TURec (int idx, int dim, const Box& srcBox, const Box& dstBox) : m_srcBox(srcBox), m_dstBox(dstBox), m_idx(idx), m_dim(dim) {} FillBoxId m_fbid; Box m_srcBox; Box m_dstBox; int m_idx; int m_dim; }; // // Test that edge-based values agree across periodic boundary. // void MacProj::test_umac_periodic (int level,MultiFab* u_mac) { const Geometry& geom = parent->Geom(level); const BoxArray& grids = LevelData[level].boxArray(); if (!geom.isAnyPeriodic()) return; const int MyProc = ParallelDescriptor::MyProc(); FArrayBox diff; Array pshifts(27); MultiFabCopyDescriptor mfcd; std::vector pirm; MultiFabId mfid[BL_SPACEDIM]; for (int dim = 0; dim < BL_SPACEDIM; dim++) { if (geom.isPeriodic(dim)) { Box eDomain = BoxLib::surroundingNodes(geom.Domain(),dim); mfid[dim] = mfcd.RegisterMultiFab(&u_mac[dim]); for (MFIter mfi(u_mac[dim]); mfi.isValid(); ++mfi) { Box eBox = u_mac[dim].boxArray()[mfi.index()]; geom.periodicShift(eDomain, eBox, pshifts); for (int iiv = 0; iiv < pshifts.size(); iiv++) { eBox += pshifts[iiv]; for (int j = 0; j < grids.size(); j++) { Box srcBox = u_mac[dim].boxArray()[j] & eBox; if (srcBox.ok()) { Box dstBox = srcBox - pshifts[iiv]; TURec r(mfi.index(),dim,srcBox,dstBox); r.m_fbid = mfcd.AddBox(mfid[dim],srcBox,0,j,0,0,1); pirm.push_back(r); } } eBox -= pshifts[iiv]; } } } } mfcd.CollectData(); for (int i = 0; i < pirm.size(); i++) { const int dim = pirm[i].m_dim; BL_ASSERT(pirm[i].m_fbid.box() == pirm[i].m_srcBox); BL_ASSERT(pirm[i].m_srcBox.sameSize(pirm[i].m_dstBox)); BL_ASSERT(u_mac[dim].DistributionMap()[pirm[i].m_idx] == MyProc); diff.resize(pirm[i].m_srcBox, 1); mfcd.FillFab(mfid[dim], pirm[i].m_fbid, diff); diff.minus(u_mac[dim][pirm[i].m_idx],pirm[i].m_dstBox,diff.box(),0,0,1); const Real max_norm = diff.norm(0); if (max_norm > umac_periodic_test_Tol ) { std::cout << "dir = " << dim << ", diff norm = " << max_norm << " for region: " << pirm[i].m_dstBox << std::endl; BoxLib::Error("Periodic bust in u_mac"); } } } ccseapps-2.5/CCSEApps/iamrlib/DERIVE_3D.F0000644000175000017500000011504711634153073020721 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: DERIVE_3D.F,v 1.17 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "DERIVE_F.H" #include "PROB_NS_F.H" #include "ArrayLim.H" #define SDIM 3 c ----------------------------------------------------------- c This file contains functions which compute derived quantities. c All of the argument lists have the same template, shown below c c INPUTS/OUTPUTS: c c e <= the quantity derived c DIMS(e) => index extent of e array c nv => number of components in e array (should be 1) c dat => data neded to derive e c DIMS(dat) => index limits of dat array c ncomp => number of components of dat array (3) c lo,hi => subrange of e array where result is requested c domlo,hi => index extent of problem domain (cell centered) c delta => cell spacing c xlo => physical location of lower left hand c corner of e array c time => problem evolution time c bc => array of bndry types for component values c valid only if component touches bndry c ----------------------------------------------------------- subroutine FORT_DERKENG (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level,grid_no) c c This routine will derive kinetic energy from density c and the velocity field. c integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j,k REAL_T rho, u, v, w do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) rho = dat(i,j,k,1) u = dat(i,j,k,2) v = dat(i,j,k,3) w = dat(i,j,k,4) e(i,j,k,1) = half*rho*(u**2 + v**2 + w**2) end do end do end do end subroutine FORT_DERLOGS (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level, grid_no) c c This routine will derive log of given scalar quantity c integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j,k REAL_T rho REAL_T sml parameter (sml = 1.0D-10) do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) rho = max(dat(i,j,k,1),sml) e(i,j,k,1) = log10(rho) end do end do end do end subroutine FORT_DERMVEL (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level, grid_no) c c ::: This routine will derive the magnitude of the velocity field c ::: from the velocity field c integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j,k REAL_T u, v, w do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) u = dat(i,j,k,1) v = dat(i,j,k,2) w = dat(i,j,k,3) e(i,j,k,1) = sqrt(u**2 + v**2 + w**2) end do end do end do end subroutine FORT_DERDVRHO (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level, grid_no) c c ::: This routine will derive C/RHO c integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j,k do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) e(i,j,k,1) = dat(i,j,k,2)/dat(i,j,k,1) end do end do end do end subroutine FORT_DERMPRHO (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level, grid_no) c c ::: This routine will derive RHO*C c integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j,k do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) e(i,j,k,1) = dat(i,j,k,2)*dat(i,j,k,1) end do end do end do end subroutine FORT_DERLGRHODUST (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level,grid_no) c c ::: This routine will derive log(RHO*C) c integer lo(SDIM), hi(SDIM) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j,k REAL_T dust, small parameter (small = 1.0D-10) do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) dust = max(small,dat(i,j,k,2)*dat(i,j,k,1)) e(i,j,k,1) = log10(dust) end do end do end do end subroutine FORT_DERMGVORT (vort,DIMS(vort),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level,grid_no) c c ::: This routine will derive magnitude of vorticity from c ::: the velocity field c integer lo(SDIM), hi(SDIM) integer DIMDEC(vort) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T vort(DIMV(vort),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j,k REAL_T uy, uz, vx, vz, wx, wy, dx, dy, dz REAL_T uycen, uzcen, uylo, uyhi, uzlo, uzhi REAL_T vxcen, vzcen, vxlo, vxhi, vzlo, vzhi REAL_T wxcen, wycen, wxlo, wxhi, wylo, wyhi REAL_T vorfun logical fixvlo_x, fixwlo_x, fixvhi_x, fixwhi_x logical fixulo_y, fixwlo_y, fixuhi_y, fixwhi_y logical fixulo_z, fixvlo_z, fixuhi_z, fixvhi_z c c ::::: some useful macro definitions c # define U(i,j,k) dat(i,j,k,1) # define V(i,j,k) dat(i,j,k,2) # define W(i,j,k) dat(i,j,k,3) # define ULOY bc(2,1,1) # define UHIY bc(2,2,1) # define ULOZ bc(3,1,1) # define UHIZ bc(3,2,1) # define VLOX bc(1,1,2) # define VHIX bc(1,2,2) # define VLOZ bc(3,1,2) # define VHIZ bc(3,2,2) # define WLOX bc(1,1,3) # define WHIX bc(1,2,3) # define WLOY bc(2,1,3) # define WHIY bc(2,2,3) c c ::::: statement functions that implement stencil c uycen(i,j,k) = half*(U(i,j+1,k)-U(i,j-1,k))/dy uylo(i,j,k) = (U(i,j+1,k)+three*U(i,j,k)-four*U(i,j-1,k))/(three*dy) uyhi(i,j,k) =-(U(i,j-1,k)+three*U(i,j,k)-four*U(i,j+1,k))/(three*dy) uzcen(i,j,k) = half*(U(i,j,k+1)-U(i,j,k-1))/dz uzlo(i,j,k) = (U(i,j,k+1)+three*U(i,j,k)-four*U(i,j,k-1))/(three*dz) uzhi(i,j,k) =-(U(i,j,k-1)+three*U(i,j,k)-four*U(i,j,k+1))/(three*dz) vxcen(i,j,k) = half*(V(i+1,j,k)-V(i-1,j,k))/dx vxlo(i,j,k) = (V(i+1,j,k)+three*V(i,j,k)-four*V(i-1,j,k))/(three*dx) vxhi(i,j,k) =-(V(i-1,j,k)+three*V(i,j,k)-four*V(i+1,j,k))/(three*dx) vzcen(i,j,k) = half*(V(i,j,k+1)-V(i,j,k-1))/dz vzlo(i,j,k) = (V(i,j,k+1)+three*V(i,j,k)-four*V(i,j,k-1))/(three*dz) vzhi(i,j,k) =-(V(i,j,k-1)+three*V(i,j,k)-four*V(i,j,k+1))/(three*dz) wxcen(i,j,k) = half*(W(i+1,j,k)-W(i-1,j,k))/dx wxlo(i,j,k) = (W(i+1,j,k)+three*W(i,j,k)-four*W(i-1,j,k))/(three*dx) wxhi(i,j,k) =-(W(i-1,j,k)+three*W(i,j,k)-four*W(i+1,j,k))/(three*dx) wycen(i,j,k) = half*(W(i,j+1,k)-W(i,j-1,k))/dy wylo(i,j,k) = (W(i,j+1,k)+three*W(i,j,k)-four*W(i,j-1,k))/(three*dy) wyhi(i,j,k) =-(W(i,j-1,k)+three*W(i,j,k)-four*W(i,j+1,k))/(three*dy) vorfun(uy,uz,vx,vz,wx,wy) = sqrt((wy-vz)**2+(uz-wx)**2+(vx-uy)**2) dx = delta(1) dy = delta(2) dz = delta(3) do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) uy = uycen(i,j,k) uz = uzcen(i,j,k) vx = vxcen(i,j,k) vz = vzcen(i,j,k) wx = wxcen(i,j,k) wy = wycen(i,j,k) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end do end do fixvlo_x = ( (lo(1) .eq. domlo(1)) .and. & (VLOX .eq. EXT_DIR .or. VLOX .eq. HOEXTRAP) ) fixvhi_x = ( (hi(1) .eq. domhi(1)) .and. & (VHIX .eq. EXT_DIR .or. VHIX .eq. HOEXTRAP) ) fixwlo_x = ( (lo(1) .eq. domlo(1)) .and. & (WLOX .eq. EXT_DIR .or. WLOX .eq. HOEXTRAP) ) fixwhi_x = ( (hi(1) .eq. domhi(1)) .and. & (WHIX .eq. EXT_DIR .or. WHIX .eq. HOEXTRAP) ) fixulo_y = ( (lo(2) .eq. domlo(2)) .and. & (ULOY .eq. EXT_DIR .or. ULOY .eq. HOEXTRAP) ) fixuhi_y = ( (hi(2) .eq. domhi(2)) .and. & (UHIY .eq. EXT_DIR .or. UHIY .eq. HOEXTRAP) ) fixwlo_y = ( (lo(2) .eq. domlo(2)) .and. & (WLOY .eq. EXT_DIR .or. WLOY .eq. HOEXTRAP) ) fixwhi_y = ( (hi(2) .eq. domhi(2)) .and. & (WHIY .eq. EXT_DIR .or. WHIY .eq. HOEXTRAP) ) fixulo_z = ( (lo(3) .eq. domlo(3)) .and. & (ULOZ .eq. EXT_DIR .or. ULOZ .eq. HOEXTRAP) ) fixuhi_z = ( (hi(3) .eq. domhi(3)) .and. & (UHIZ .eq. EXT_DIR .or. UHIZ .eq. HOEXTRAP) ) fixvlo_z = ( (lo(3) .eq. domlo(3)) .and. & (VLOZ .eq. EXT_DIR .or. VLOZ .eq. HOEXTRAP) ) fixvhi_z = ( (hi(3) .eq. domhi(3)) .and. & (VHIZ .eq. EXT_DIR .or. VHIZ .eq. HOEXTRAP) ) c c First do all the faces c if (fixvlo_x .or. fixwlo_x) then i = lo(1) do k = lo(3),hi(3) do j = lo(2),hi(2) vx = cvmgt(vxlo(i,j,k),vxcen(i,j,k),fixvlo_x) wx = cvmgt(wxlo(i,j,k),wxcen(i,j,k),fixwlo_x) uy = uycen(i,j,k) wy = wycen(i,j,k) uz = uzcen(i,j,k) vz = vzcen(i,j,k) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end do end if if (fixvhi_x .or. fixwhi_x) then i = hi(1) do k = lo(3),hi(3) do j = lo(2),hi(2) vx = cvmgt(vxhi(i,j,k),vxcen(i,j,k),fixvhi_x) wx = cvmgt(wxhi(i,j,k),wxcen(i,j,k),fixwhi_x) uy = uycen(i,j,k) wy = wycen(i,j,k) uz = uzcen(i,j,k) vz = vzcen(i,j,k) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end do end if if (fixulo_y .or. fixwlo_y) then j = lo(2) do k = lo(3),hi(3) do i = lo(1),hi(1) vx = vxcen(i,j,k) wx = wxcen(i,j,k) uy = cvmgt(uylo(i,j,k),uycen(i,j,k),fixulo_y) wy = cvmgt(wylo(i,j,k),wycen(i,j,k),fixwlo_y) uz = uzcen(i,j,k) vz = vzcen(i,j,k) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end do end if if (fixuhi_y .or. fixwhi_y) then j = hi(2) do k = lo(3),hi(3) do i = lo(1),hi(1) vx = vxcen(i,j,k) wx = wxcen(i,j,k) uy = cvmgt(uyhi(i,j,k),uycen(i,j,k),fixuhi_y) wy = cvmgt(wyhi(i,j,k),wycen(i,j,k),fixwhi_y) uz = uzcen(i,j,k) vz = vzcen(i,j,k) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end do end if if (fixulo_z .or. fixvlo_z) then k = lo(3) do j = lo(2),hi(2) do i = lo(1),hi(1) vx = vxcen(i,j,k) wx = wxcen(i,j,k) uy = uycen(i,j,k) wy = wycen(i,j,k) uz = cvmgt(uzlo(i,j,k),uzcen(i,j,k),fixulo_z) vz = cvmgt(vzlo(i,j,k),vzcen(i,j,k),fixvlo_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end do end if if (fixuhi_z .or. fixvhi_z) then k = hi(3) do j = lo(2),hi(2) do i = lo(1),hi(1) vx = vxcen(i,j,k) wx = wxcen(i,j,k) uy = uycen(i,j,k) wy = wycen(i,j,k) uz = cvmgt(uzhi(i,j,k),uzcen(i,j,k),fixuhi_z) vz = cvmgt(vzhi(i,j,k),vzcen(i,j,k),fixvhi_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end do end if c c Next do all the edges c if ((fixvlo_x .or. fixwlo_x) .and. (fixulo_y .or. fixwlo_y)) then i = lo(1) j = lo(2) do k = lo(3),hi(3) vx = cvmgt(vxlo(i,j,k),vxcen(i,j,k),fixvlo_x) wx = cvmgt(wxlo(i,j,k),wxcen(i,j,k),fixwlo_x) uy = cvmgt(uylo(i,j,k),uycen(i,j,k),fixulo_y) wy = cvmgt(wylo(i,j,k),wycen(i,j,k),fixwlo_y) uz = uzcen(i,j,k) vz = vzcen(i,j,k) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixvhi_x .or. fixwhi_x) .and. (fixulo_y .or. fixwlo_y)) then i = hi(1) j = lo(2) do k = lo(3),hi(3) vx = cvmgt(vxhi(i,j,k),vxcen(i,j,k),fixvhi_x) wx = cvmgt(wxhi(i,j,k),wxcen(i,j,k),fixwhi_x) uy = cvmgt(uylo(i,j,k),uycen(i,j,k),fixulo_y) wy = cvmgt(wylo(i,j,k),wycen(i,j,k),fixwlo_y) uz = uzcen(i,j,k) vz = vzcen(i,j,k) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixvlo_x .or. fixwlo_x) .and. (fixuhi_y .or. fixwhi_y)) then i = lo(1) j = hi(2) do k = lo(3),hi(3) vx = cvmgt(vxlo(i,j,k),vxcen(i,j,k),fixvlo_x) wx = cvmgt(wxlo(i,j,k),wxcen(i,j,k),fixwlo_x) uy = cvmgt(uyhi(i,j,k),uycen(i,j,k),fixuhi_y) wy = cvmgt(wyhi(i,j,k),wycen(i,j,k),fixwhi_y) uz = uzcen(i,j,k) vz = vzcen(i,j,k) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixvhi_x .or. fixwhi_x) .and. (fixuhi_y .or. fixwhi_y)) then i = hi(1) j = hi(2) do k = lo(3),hi(3) vx = cvmgt(vxhi(i,j,k),vxcen(i,j,k),fixvhi_x) wx = cvmgt(wxhi(i,j,k),wxcen(i,j,k),fixwhi_x) uy = cvmgt(uyhi(i,j,k),uycen(i,j,k),fixuhi_y) wy = cvmgt(wyhi(i,j,k),wycen(i,j,k),fixwhi_y) uz = uzcen(i,j,k) vz = vzcen(i,j,k) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixvlo_x .or. fixwlo_x) .and. (fixulo_z .or. fixvlo_z)) then i = lo(1) k = lo(3) do j = lo(2),hi(2) vx = cvmgt(vxlo(i,j,k),vxcen(i,j,k),fixvlo_x) wx = cvmgt(wxlo(i,j,k),wxcen(i,j,k),fixwlo_x) uy = uycen(i,j,k) wy = wycen(i,j,k) uz = cvmgt(uzlo(i,j,k),uzcen(i,j,k),fixulo_z) vz = cvmgt(vzlo(i,j,k),vzcen(i,j,k),fixvlo_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixvhi_x .or. fixwhi_x) .and. (fixulo_z .or. fixvlo_z)) then i = hi(1) k = lo(3) do j = lo(2),hi(2) vx = cvmgt(vxhi(i,j,k),vxcen(i,j,k),fixvhi_x) wx = cvmgt(wxhi(i,j,k),wxcen(i,j,k),fixwhi_x) uy = uycen(i,j,k) wy = wycen(i,j,k) uz = cvmgt(uzlo(i,j,k),uzcen(i,j,k),fixulo_z) vz = cvmgt(vzlo(i,j,k),vzcen(i,j,k),fixvlo_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixvlo_x .or. fixwlo_x) .and. (fixuhi_z .or. fixvhi_z)) then i = lo(1) k = hi(3) do j = lo(2),hi(2) vx = cvmgt(vxlo(i,j,k),vxcen(i,j,k),fixvlo_x) wx = cvmgt(wxlo(i,j,k),wxcen(i,j,k),fixwlo_x) uy = uycen(i,j,k) wy = wycen(i,j,k) uz = cvmgt(uzhi(i,j,k),uzcen(i,j,k),fixuhi_z) vz = cvmgt(vzhi(i,j,k),vzcen(i,j,k),fixvhi_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixvhi_x .or. fixwhi_x) .and. (fixuhi_z .or. fixvhi_z)) then i = hi(1) k = hi(3) do j = lo(2),hi(2) vx = cvmgt(vxhi(i,j,k),vxcen(i,j,k),fixvhi_x) wx = cvmgt(wxhi(i,j,k),wxcen(i,j,k),fixwhi_x) uy = uycen(i,j,k) wy = wycen(i,j,k) uz = cvmgt(uzhi(i,j,k),uzcen(i,j,k),fixuhi_z) vz = cvmgt(vzhi(i,j,k),vzcen(i,j,k),fixvhi_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixulo_y .or. fixwlo_y) .and. (fixulo_z .or. fixvlo_z)) then j = lo(2) k = lo(3) do i = lo(1),hi(1) vx = vxcen(i,j,k) wx = wxcen(i,j,k) uy = cvmgt(uylo(i,j,k),uycen(i,j,k),fixulo_y) wy = cvmgt(wylo(i,j,k),wycen(i,j,k),fixwlo_y) uz = cvmgt(uzlo(i,j,k),uzcen(i,j,k),fixulo_z) vz = cvmgt(vzlo(i,j,k),vzcen(i,j,k),fixvlo_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixuhi_y .or. fixwhi_y) .and. (fixulo_z .or. fixvlo_z)) then j = hi(2) k = lo(3) do i = lo(1),hi(1) vx = vxcen(i,j,k) wx = wxcen(i,j,k) uy = cvmgt(uyhi(i,j,k),uycen(i,j,k),fixuhi_y) wy = cvmgt(wyhi(i,j,k),wycen(i,j,k),fixwhi_y) uz = cvmgt(uzlo(i,j,k),uzcen(i,j,k),fixulo_z) vz = cvmgt(vzlo(i,j,k),vzcen(i,j,k),fixvlo_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixulo_y .or. fixwlo_y) .and. (fixuhi_z .or. fixvhi_z)) then j = lo(2) k = hi(3) do i = lo(1),hi(1) vx = vxcen(i,j,k) wx = wxcen(i,j,k) uy = cvmgt(uylo(i,j,k),uycen(i,j,k),fixulo_y) wy = cvmgt(wylo(i,j,k),wycen(i,j,k),fixwlo_y) uz = cvmgt(uzhi(i,j,k),uzcen(i,j,k),fixuhi_z) vz = cvmgt(vzhi(i,j,k),vzcen(i,j,k),fixvhi_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if if ((fixuhi_y .or. fixwhi_y) .and. (fixuhi_z .or. fixvhi_z)) then j = hi(2) k = hi(3) do i = lo(1),hi(1) vx = vxcen(i,j,k) wx = wxcen(i,j,k) uy = cvmgt(uyhi(i,j,k),uycen(i,j,k),fixuhi_y) wy = cvmgt(wyhi(i,j,k),wycen(i,j,k),fixwhi_y) uz = cvmgt(uzhi(i,j,k),uzcen(i,j,k),fixuhi_z) vz = cvmgt(vzhi(i,j,k),vzcen(i,j,k),fixvhi_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end do end if c c Finally do all the corners c if ((fixvlo_x .or. fixwlo_x) .and. (fixulo_y .or. fixwlo_y) .and. $ (fixulo_z .or. fixvlo_z)) then i = lo(1) j = lo(2) k = lo(3) vx = cvmgt(vxlo(i,j,k),vxcen(i,j,k),fixvlo_x) wx = cvmgt(wxlo(i,j,k),wxcen(i,j,k),fixwlo_x) uy = cvmgt(uylo(i,j,k),uycen(i,j,k),fixulo_y) wy = cvmgt(wylo(i,j,k),wycen(i,j,k),fixwlo_y) uz = cvmgt(uzlo(i,j,k),uzcen(i,j,k),fixulo_z) vz = cvmgt(vzlo(i,j,k),vzcen(i,j,k),fixvlo_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end if if ((fixvhi_x .or. fixwhi_x) .and. (fixulo_y .or. fixwlo_y) .and. $ (fixulo_z .or. fixvlo_z)) then i = hi(1) j = lo(2) k = lo(3) vx = cvmgt(vxhi(i,j,k),vxcen(i,j,k),fixvhi_x) wx = cvmgt(wxhi(i,j,k),wxcen(i,j,k),fixwhi_x) uy = cvmgt(uylo(i,j,k),uycen(i,j,k),fixulo_y) wy = cvmgt(wylo(i,j,k),wycen(i,j,k),fixwlo_y) uz = cvmgt(uzlo(i,j,k),uzcen(i,j,k),fixulo_z) vz = cvmgt(vzlo(i,j,k),vzcen(i,j,k),fixvlo_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end if if ((fixvlo_x .or. fixwlo_x) .and. (fixuhi_y .or. fixwhi_y) .and. $ (fixulo_z .or. fixvlo_z)) then i = lo(1) j = hi(2) k = lo(3) vx = cvmgt(vxlo(i,j,k),vxcen(i,j,k),fixvlo_x) wx = cvmgt(wxlo(i,j,k),wxcen(i,j,k),fixwlo_x) uy = cvmgt(uyhi(i,j,k),uycen(i,j,k),fixuhi_y) wy = cvmgt(wyhi(i,j,k),wycen(i,j,k),fixwhi_y) uz = cvmgt(uzlo(i,j,k),uzcen(i,j,k),fixulo_z) vz = cvmgt(vzlo(i,j,k),vzcen(i,j,k),fixvlo_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end if if ((fixvhi_x .or. fixwhi_x) .and. (fixuhi_y .or. fixwhi_y) .and. $ (fixulo_z .or. fixvlo_z)) then i = hi(1) j = hi(2) k = lo(3) vx = cvmgt(vxhi(i,j,k),vxcen(i,j,k),fixvhi_x) wx = cvmgt(wxhi(i,j,k),wxcen(i,j,k),fixwhi_x) uy = cvmgt(uyhi(i,j,k),uycen(i,j,k),fixuhi_y) wy = cvmgt(wyhi(i,j,k),wycen(i,j,k),fixwhi_y) uz = cvmgt(uzlo(i,j,k),uzcen(i,j,k),fixulo_z) vz = cvmgt(vzlo(i,j,k),vzcen(i,j,k),fixvlo_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end if if ((fixvlo_x .or. fixwlo_x) .and. (fixulo_y .or. fixwlo_y) .and. $ (fixuhi_z .or. fixvhi_z)) then i = lo(1) j = lo(2) k = hi(3) vx = cvmgt(vxlo(i,j,k),vxcen(i,j,k),fixvlo_x) wx = cvmgt(wxlo(i,j,k),wxcen(i,j,k),fixwlo_x) uy = cvmgt(uylo(i,j,k),uycen(i,j,k),fixulo_y) wy = cvmgt(wylo(i,j,k),wycen(i,j,k),fixwlo_y) uz = cvmgt(uzhi(i,j,k),uzcen(i,j,k),fixuhi_z) vz = cvmgt(vzhi(i,j,k),vzcen(i,j,k),fixvhi_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end if if ((fixvhi_x .or. fixwhi_x) .and. (fixulo_y .or. fixwlo_y) .and. $ (fixuhi_z .or. fixvhi_z)) then i = hi(1) j = lo(2) k = hi(3) vx = cvmgt(vxhi(i,j,k),vxcen(i,j,k),fixvhi_x) wx = cvmgt(wxhi(i,j,k),wxcen(i,j,k),fixwhi_x) uy = cvmgt(uylo(i,j,k),uycen(i,j,k),fixulo_y) wy = cvmgt(wylo(i,j,k),wycen(i,j,k),fixwlo_y) uz = cvmgt(uzhi(i,j,k),uzcen(i,j,k),fixuhi_z) vz = cvmgt(vzhi(i,j,k),vzcen(i,j,k),fixvhi_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end if if ((fixvlo_x .or. fixwlo_x) .and. (fixuhi_y .or. fixwhi_y) .and. $ (fixuhi_z .or. fixvhi_z)) then i = lo(1) j = hi(2) k = hi(3) vx = cvmgt(vxlo(i,j,k),vxcen(i,j,k),fixvlo_x) wx = cvmgt(wxlo(i,j,k),wxcen(i,j,k),fixwlo_x) uy = cvmgt(uyhi(i,j,k),uycen(i,j,k),fixuhi_y) wy = cvmgt(wyhi(i,j,k),wycen(i,j,k),fixwhi_y) uz = cvmgt(uzhi(i,j,k),uzcen(i,j,k),fixuhi_z) vz = cvmgt(vzhi(i,j,k),vzcen(i,j,k),fixvhi_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end if if ((fixvhi_x .or. fixwhi_x) .and. (fixuhi_y .or. fixwhi_y) .and. $ (fixuhi_z .or. fixvhi_z)) then i = hi(1) j = hi(2) k = hi(3) vx = cvmgt(vxhi(i,j,k),vxcen(i,j,k),fixvhi_x) wx = cvmgt(wxhi(i,j,k),wxcen(i,j,k),fixwhi_x) uy = cvmgt(uyhi(i,j,k),uycen(i,j,k),fixuhi_y) wy = cvmgt(wyhi(i,j,k),wycen(i,j,k),fixwhi_y) uz = cvmgt(uzhi(i,j,k),uzcen(i,j,k),fixuhi_z) vz = cvmgt(vzhi(i,j,k),vzcen(i,j,k),fixvhi_z) vort(i,j,k,1) = vorfun(uy,uz,vx,vz,wx,wy) end if # undef U # undef V # undef W # undef ULOY # undef UHIY # undef ULOZ # undef UHIZ # undef VLOX # undef VHIX # undef VLOZ # undef VHIZ # undef WLOX # undef WHIX # undef WLOY # undef WHIY end subroutine FORT_DERMGDIVU (divu,DIMS(divu),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level,grid_no) c c ::: This routine will derive magnitude of the divergence of velocity c integer lo(SDIM), hi(SDIM) integer DIMDEC(divu) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T divu(DIMV(divu),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j,k REAL_T ux, vy, wz, dx, dy, dz REAL_T uxcen, uxlo, uxhi REAL_T vycen, vylo, vyhi REAL_T wzcen, wzlo, wzhi c c ::::: some useful macro definitions c # define U(i,j,k) dat(i,j,k,1) # define V(i,j,k) dat(i,j,k,2) # define W(i,j,k) dat(i,j,k,3) # define ULOX bc(1,1,1) # define UHIX bc(1,2,1) # define VLOY bc(2,1,2) # define VHIY bc(2,2,2) # define WLOZ bc(3,1,2) # define WHIZ bc(3,2,2) c c ::::: statement functions that implement stencil c uxcen(i,j,k) = half*(U(i+1,j,k)-U(i-1,j,k))/dx uxlo(i,j,k) = (eight*U(i,j,k)-six*U(i+1,j,k)+U(i+2,j,k))/(three*dx) uxhi(i,j,k) = (eight*U(i,j,k)-six*U(i-1,j,k)+U(i-2,j,k))/(three*dx) vycen(i,j,k) = half*(V(i,j+1,k)-V(i,j-1,k))/dy vylo(i,j,k) = (eight*V(i,j,k)-six*V(i,j+1,k)+V(i,j+2,k))/(three*dy) vyhi(i,j,k) = (eight*V(i,j,k)-six*V(i,j-1,k)+V(i,j-2,k))/(three*dy) wzcen(i,j,k) = half*(W(i,j,k+1)-W(i,j,k-1))/dz wzlo(i,j,k) = (eight*W(i,j,k)-six*W(i,j,k+1)+W(i,j,k+2))/(three*dz) wzhi(i,j,k) = (eight*W(i,j,k)-six*W(i,j,k-1)+W(i,j,k-2))/(three*dz) call FORT_XVELFILL(dat(ARG_L1(dat),ARG_L2(dat),ARG_L3(dat),1),DIMS(dat), $ domlo,domhi,delta,xlo,time,bc(1,1,1)) call FORT_YVELFILL(dat(ARG_L1(dat),ARG_L2(dat),ARG_L3(dat),2),DIMS(dat), $ domlo,domhi,delta,xlo,time,bc(1,1,2)) call FORT_ZVELFILL(dat(ARG_L1(dat),ARG_L2(dat),ARG_L3(dat),3),DIMS(dat), $ domlo,domhi,delta,xlo,time,bc(1,1,3)) dx = delta(1) dy = delta(2) dz = delta(3) c c :: at physical bndries where an edge value is prescribed, c :: set the value in the outside cell so that a central c :: difference formula is equivalent to the higher order c :: one sided formula c if (lo(1) .eq. domlo(1)) then i = lo(1) if (ULOX.eq.EXT_DIR) then do k = lo(3), hi(3) do j = lo(2), hi(2) U(i-1,j,k) = two*U(i-1,j,k) - U(i,j,k) end do end do else if (ULOX.eq.HOEXTRAP) then do k = lo(3), hi(3) do j = lo(2), hi(2) U(i-1,j,k) = uxlo(i,j,k) end do end do end if end if if (hi(1) .eq. domhi(1)) then i = hi(1) if (UHIX.eq.EXT_DIR) then do k = lo(3), hi(3) do j = lo(2), hi(2) U(i+1,j,k) = two*U(i+1,j,k) - U(i,j,k) end do end do else if (UHIX.eq.HOEXTRAP) then do k = lo(3), hi(3) do j = lo(2), hi(2) U(i+1,j,k) = uxhi(i,j,k) end do end do end if end if if (lo(2) .eq. domlo(2)) then j = lo(2) if (VLOY.eq.EXT_DIR) then do k = lo(3), hi(3) do i = lo(1), hi(1) V(i,j-1,k) = two*V(i,j-1,k) - V(i,j,k) end do end do else if (VLOY.eq.HOEXTRAP) then do k = lo(3), hi(3) do i = lo(1), hi(1) V(i,j-1,k) = vylo(i,j,k) end do end do end if end if if (hi(2) .eq. domhi(2)) then j = hi(2) if (VHIY.eq.EXT_DIR) then do k = lo(3), hi(3) do i = lo(1), hi(1) V(i,j+1,k) = two*V(i,j+1,k) - V(i,j,k) end do end do else if (VHIY.eq.HOEXTRAP) then do k = lo(3), hi(3) do i = lo(1), hi(1) V(i,j+1,k) = vyhi(i,j,k) end do end do end if end if if (lo(3) .eq. domlo(3)) then k = lo(3) if (WLOZ.eq.EXT_DIR) then do j = lo(2), hi(2) do i = lo(1), hi(1) W(i,j,k-1) = two*W(i,j,k-1) - W(i,j,k) end do end do else if (WLOZ.eq.HOEXTRAP) then do j = lo(2), hi(2) do i = lo(1), hi(1) W(i,j,k-1) = wzlo(i,j,k) end do end do end if end if if (hi(3) .eq. domhi(3)) then k = hi(3) if (WHIZ.eq.EXT_DIR) then do j = lo(2), hi(2) do i = lo(1), hi(1) W(i,j,k+1) = two*W(i,j,k+1) - W(i,j,k) end do end do else if (WHIZ.eq.HOEXTRAP) then do j = lo(2), hi(2) do i = lo(1), hi(1) W(i,j,k+1) = wzhi(i,j,k) end do end do end if end if do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) ux = uxcen(i,j,k) vy = vycen(i,j,k) wz = wzcen(i,j,k) divu(i,j,k,1) = ux + vy + wz end do end do end do c c we overwrote the ghost cells above, so set them back below c call FORT_XVELFILL(dat(ARG_L1(dat),ARG_L2(dat),ARG_L3(dat),1),DIMS(dat), $ domlo,domhi,delta,xlo,time,bc(1,1,1)) call FORT_YVELFILL(dat(ARG_L1(dat),ARG_L2(dat),ARG_L3(dat),1),DIMS(dat), $ domlo,domhi,delta,xlo,time,bc(1,1,2)) call FORT_ZVELFILL(dat(ARG_L1(dat),ARG_L2(dat),ARG_L3(dat),1),DIMS(dat), $ domlo,domhi,delta,xlo,time,bc(1,1,3)) # undef U # undef V # undef W # undef ULOX # undef UHIX # undef VLOY # undef VHIY # undef WLOZ # undef WHIZ end subroutine FORT_GRADP_DIR ( & p,DIMS(p), & gp,DIMS(gp), & lo,hi,dir,dx) c c compute a node centered pressure gradient in direction (dir) c integer DIMDEC(p) integer DIMDEC(gp) integer lo(SDIM), hi(SDIM) integer dir REAL_T dx REAL_T p(DIMV(p)) REAL_T gp(DIMV(gp)) logical invalid integer i,j,k REAL_T d integer ilo, ihi, jlo, jhi, klo, khi d = fourth/dx c c ::::: compute gradient on interior c if (dir .eq. 0) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) gp(i,j,k) = d*( & p(i+1,j,k )-p(i,j,k )+p(i+1,j+1,k )-p(i,j+1,k )+ $ p(i+1,j,k+1)-p(i,j,k+1)+p(i+1,j+1,k+1)-p(i,j+1,k+1)) end do end do end do else if (dir .eq. 1) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) gp(i,j,k) = d*( & p(i,j+1,k )-p(i,j,k )+p(i+1,j+1,k )-p(i+1,j,k )+ $ p(i,j+1,k+1)-p(i,j,k+1)+p(i+1,j+1,k+1)-p(i+1,j,k+1)) end do end do end do else if (dir .eq. 2) then do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) gp(i,j,k) = d*( & p(i, j,k+1)-p(i, j,k)+p(i, j+1,k+1)-p(i, j+1,k)+ $ p(i+1,j,k+1)-p(i+1,j,k)+p(i+1,j+1,k+1)-p(i+1,j+1,k)) end do end do end do else call bl_abort("FORT_GRADP_DIR: invalid dir = ") end if end subroutine FORT_DERGRDPX (grdpx,DIMS(gp),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level,grid_no) c c This routine computes pressure gradient in x direciton c integer lo(SDIM), hi(SDIM) integer DIMDEC(gp) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T grdpx(DIMV(gp),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no c call FORT_GRADP_DIR ( & dat,DIMS(dat),grdpx,DIMS(gp), & lo,hi,0,delta(1)) end subroutine FORT_DERGRDPY (grdpy,DIMS(gp),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level,grid_no) c c This routine computes pressure gradient in Y direciton c integer lo(SDIM), hi(SDIM) integer DIMDEC(gp) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T grdpy(DIMV(gp),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no c call FORT_GRADP_DIR ( & dat,DIMS(dat),grdpy,DIMS(gp), & lo,hi,1,delta(2)) end subroutine FORT_DERGRDPZ (grdpz,DIMS(gp),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level,grid_no) c c This routine computes pressure gradient in Z direciton c integer lo(SDIM), hi(SDIM) integer DIMDEC(gp) integer DIMDEC(dat) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T delta(SDIM), xlo(SDIM) REAL_T time, dt REAL_T grdpz(DIMV(gp),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no c call FORT_GRADP_DIR ( & dat,DIMS(dat),grdpz,DIMS(gp), & lo,hi,2,delta(3)) end subroutine FORT_DERAVGPRES (avgpres,DIMS(gp),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level,grid_no) c c This routine computes cell-centered pressure as average of the eight c surrounding nodal values. c integer DIMDEC(gp) integer DIMDEC(dat) REAL_T avgpres(DIMV(gp)) REAL_T dat(DIMV(dat)) integer nv, ncomp integer lo(SDIM), hi(SDIM) integer domlo(SDIM), domhi(SDIM) REAL_T delta(SDIM) REAL_T xlo(SDIM) REAL_T time, dt integer bc(SDIM,2,ncomp) integer level integer grid_no integer i,j,k do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) avgpres(i,j,k) = eighth*( $ dat(i+1,j,k) + dat(i,j,k) $ + dat(i+1,j+1,k) + dat(i,j+1,k) $ + dat(i+1,j,k+1) + dat(i,j,k+1) $ + dat(i+1,j+1,k+1) + dat(i,j+1,k+1) ) end do end do end do end c========================================================= subroutine FORT_DERGRDP (grdp,DIMS(gp),nv,p,DIMS(p),ncomp, & lo,hi,domlo,domhi,dx,xlo,time,dt, $ bc,level,grid_no) c c This routine computes the magnitude of pressure gradient c integer lo(SDIM), hi(SDIM) integer DIMDEC(gp) integer DIMDEC(p) integer domlo(SDIM), domhi(SDIM) integer nv, ncomp integer bc(SDIM,2,ncomp) REAL_T dx(SDIM), xlo(SDIM), time, dt REAL_T grdp(DIMV(gp),nv) REAL_T p(DIMV(p),ncomp) integer level, grid_no REAL_T gpx, gpy, gpz integer i,j,k c do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) gpx = fourth * (p(i+1,j,k ,1)-p(i,j,k ,1)+p(i+1,j+1,k ,1)-p(i,j+1,k ,1)+ $ p(i+1,j,k+1,1)-p(i,j,k+1,1)+p(i+1,j+1,k+1,1)-p(i,j+1,k+1,1))/dx(1) gpy = fourth * (p(i,j+1,k ,1)-p(i,j,k ,1)+p(i+1,j+1,k ,1)-p(i+1,j,k ,1)+ $ p(i,j+1,k+1,1)-p(i,j,k+1,1)+p(i+1,j+1,k+1,1)-p(i+1,j,k+1,1))/dx(2) gpz = fourth * (p(i, j,k+1,1)-p(i, j,k,1)+p(i, j+1,k+1,1)-p(i, j+1,k,1)+ $ p(i+1,j,k+1,1)-p(i+1,j,k,1)+p(i+1,j+1,k+1,1)-p(i+1,j+1,k,1))/dx(3) grdp(i,j,k,1) = sqrt(gpx**2 + gpy**2 + gpz**2) end do end do end do end ccseapps-2.5/CCSEApps/iamrlib/ViscBndry.H0000644000175000017500000000374211634153073021320 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _VISCBNDRYDATA_H_ #define _VISCBNDRYDATA_H_ // // $Id: ViscBndry.H,v 1.8 2000/10/02 20:50:17 lijewski Exp $ // #include #include class ViscBndry : public InterpBndryData { public: ViscBndry() : InterpBndryData() {} ViscBndry (const BoxArray& _grids, int _ncomp, const Geometry& _geom) : InterpBndryData(_grids,_ncomp,_geom) {} virtual void setBndryConds (const BCRec& phys_bc, /*const*/ IntVect& ratio, int comp=0); void setHomogValues (const BCRec& bc, /*const*/ IntVect& ratio); }; #endif /*_VISCBNDRYDATA_H_*/ ccseapps-2.5/CCSEApps/iamrlib/Projection.H0000644000175000017500000003322611634153073021531 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _Projection_H_ #define _Projection_H_ // // $Id: Projection.H,v 1.41 2003/02/21 22:49:10 car Exp $ // #include #include #include #include #include #include #include class holy_grail_amr_projector; #ifdef BL_USE_HGPROJ_SERIAL class inviscid_fluid_boundary_class; #else class inviscid_fluid_boundary; #endif class Projection { public: Projection (Amr* _parent, BCRec* _phys_bc, int _do_sync_proj, int _finest_level, int _radius_grow ); virtual ~Projection (); // // Set a level in the projector. // void install_level (int level, AmrLevel* level_data, PArray* _radius ); // // Reset finest_level. // void setFinestLevel (int new_finest) { finest_level = new_finest; } // // Compute the level projection in NavierStokes::advance. // void level_project (int level, Real time, Real dt, Real cur_pres_time, Real prev_pres_time, const Geometry& geom, MultiFab& U_old, MultiFab& U_new, MultiFab& P_old, MultiFab& P_new, MultiFab* rho_half, SyncRegister* crse_sync_reg, SyncRegister* fine_sync_reg, int crse_dt_ratio, int** bc, int iteration, int have_divu, int Divu_Type); // solve DG(correction to P_new) = -D G^perp p^(n-half) // or DG(correction to P_new) = -D G^perp p^(n-half) - D(U^n /dt) void filterP(int level, const Geometry& geom, MultiFab &P_old, MultiFab &P_new, MultiFab &U_old, MultiFab * rho_half, int ** bc, Real time, Real dt, int have_divu); // // A sync project involving only the coarse level of a 2 level system. // void syncProject (int crse_level, MultiFab& pres, MultiFab& vel, MultiFab* rho_half, MultiFab* Vsync, MultiFab& phi, SyncRegister* rhs_sync_reg, SyncRegister* crsr_sync_reg, const BoxArray& sync_boxes, const Geometry& geom, const Real* dx, Real dt_crse, int crse_iteration, int crse_dt_ratio); // // A sync project involving the coarse and fine level of a 2 level system. // void MLsyncProject (int crse_level, MultiFab& pres_crse, MultiFab& vel_crse, MultiFab& cc_rhs_crse, MultiFab& pres_fine, MultiFab& vel_fine, MultiFab& cc_rhs_fine, MultiFab& rho_half, MultiFab& rho_fine, MultiFab* Vsync, MultiFab& V_corr, MultiFab& phi, SyncRegister* rhs_sync_reg, SyncRegister* crsr_sync_reg, const Real* dx, Real dt_crse, IntVect& ratio, int crse_iteration, int crse_dt_ratio, const Geometry& fine_geom, const Geometry& crse_geom, bool pressure_time_is_interval, bool first_crse_step_after_initial_iters, Real cur_crse_pres_time, Real prev_crse_pres_time, Real cur_fine_pres_time, Real prev_fine_pres_time); // // This projects an initial vorticity field to define a velocity field. // void initialVorticityProject (int crse_level); // // This computes the stream function, given the velocity field // *AND ASSUMING* no-flow boundaries on all physical boundaries. // void getStreamFunction (PArray&); // // The initial velocity projection in post_init. // This function ensures that the velocities are nondivergent. // void initialVelocityProject (int crse_level, Real divu_time, int have_divu); // // This function creates an initially hydrostatic pressure field // in the case of nonzero gravity. // void initialPressureProject (int crse_level); // // The velocity projection in post_init, which computes the initial // pressure used in the timestepping. // void initialSyncProject (int crse_level, MultiFab* sig[], Real dt, Real strt_time, Real dt_init, int have_divu); // // Enforce periodicity on a multifab. // void EnforcePeriodicity (MultiFab& psi, int nvar, const BoxArray& grids, const Geometry& geom); // // Multiply/divide a MultiFab by radius for r-z coordinates. // These should really be protected. // void radMult (int level, MultiFab& mf, int comp); void radDiv (int level, MultiFab& mf, int comp); // // Put divu in the rhs of the projector. // void put_divu_in_node_rhs (MultiFab& rhs, int level, const int& nghost, Real time, int user_rz = -1); void put_divu_in_cc_rhs (MultiFab& rhs, int level, const BoxArray& grids, Real time); // // Helper function for NavierStokes::getGradP(). // static void getGradP (FArrayBox& p_fab, FArrayBox& gp, const Box& gpbox_to_fill, const Real* dx); protected: // // Read parameters from the input file. // static void read_params (); // // Set up the sync projection. // void bldSyncProject (); // // Convert U from an Accleration like quantity to a velocity // Unew = Uold + alpha*Unew // void UnConvertUnew (MultiFab& Uold, Real alpha, MultiFab& Unew, const BoxArray& grids ); // // Convert U from an Accleration like quantity to a velocity // Unew = Uold + alpha*Unew // void UnConvertUnew (FArrayBox& Uold, Real alpha, FArrayBox& Unew, const Box& grd); // // Convert U to an Accleration like quantity // Unew = (Unew - Uold)/alpha // void ConvertUnew (MultiFab& Unew, MultiFab& Uold, Real alpha, const BoxArray& grids ); // // Convert U to an Accleration like quantity. // Unew = (Unew - Uold)/alpha // void ConvertUnew (FArrayBox& Unew, FArrayBox& Uold, Real alpha, const Box& grd); // // Update a quantity U using the formula // Unew = Unew + alpha*Uold // void UpdateArg1 (MultiFab& Unew, Real alpha, MultiFab& Uold, int nvar, const BoxArray& grids, int ngrow); // // Update a quantity U using the formula // Unew = Unew + alpha*Uold // void UpdateArg1 (FArrayBox& Unew, Real alpha, FArrayBox& Uold, int nvar, const Box& grd, int ngrow); // // Add phi to P. // void AddPhi (MultiFab& p, MultiFab& phi, const BoxArray& grids); // // Convert phi into p^n+1/2. // void incrPress (int level, Real dt); // // This function scales variables at the start of a projection. // void scaleVar (MultiFab* sig, int sig_nghosts, MultiFab* vel, const BoxArray& grids, int level); // // This function rescales variables at the end of a projection. // void rescaleVar (MultiFab* sig, int sig_nghosts, MultiFab* vel, const BoxArray& grids, int level); void setUpBcs (); void set_outflow_bcs (int which_call, MultiFab** phi, MultiFab** Vel_in, MultiFab** Divu_in, MultiFab** Sig_in, int c_lev, int f_lev, int have_divu); void set_outflow_bcs_at_level (int which_call, int lev, int c_lev, Box* state_strip, Orientation* outFacesAtThisLevel, int numOutFlowFaces, MultiFab** phi, MultiFab* Vel_in, MultiFab* Divu_in, MultiFab* Sig_in, int have_divu, Real gravity); #if 0 void computeBC(FArrayBox& vel, FArrayBox& divu, FArrayBox& rho, FArrayBox& phi, const Geometry& geom, const Orientation& outFace, Real gravity = 0.0); void computeRhoG(FArrayBox& rho, FArrayBox& phi, const Geometry& geom, const Orientation& outFace, Real gravity); #endif protected: void putDown(MultiFab** phi, FArrayBox* phi_fine_strip, int c_lev, int f_lev, const Orientation* outFaces, int numOutFlowFaces, int ncStripWidth); // // Pointers to amrlevel and amr. // Amr* parent; PArray LevelData; // // The array of Radii, and number of radii ghost cells. // int radius_grow; PArray< PArray > radius; // // The aliasLib level projector. // holy_grail_amr_projector *sync_proj; // // Boundary objects. // BCRec* phys_bc; #ifdef BL_USE_HGPROJ_SERIAL inviscid_fluid_boundary_class* projector_bndry; #else inviscid_fluid_boundary* projector_bndry; #endif int finest_level; int do_sync_proj; static int verbose; static int P_code; static Real proj_tol; static Real sync_tol; static Real proj_abs_tol; static Real filter_factor; static int proj_0; static int proj_2; static int filter_u; static int rho_wgt_vel_proj; static int do_outflow_bcs; static int make_sync_solvable; static Real divu_minus_s_factor; static int add_vort_proj; }; #endif ccseapps-2.5/CCSEApps/iamrlib/main_amr.cpp0000644000175000017500000000422511634153073021570 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: main_amr.cpp,v 1.18 2001/08/01 21:51:01 lijewski Exp $ // #include #include #include #include #include #include #include #include #include int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); int max_step; Real stop_time; ParmParse pp; #ifndef WIN32 int sleeptime = 0; pp.query("sleep", sleeptime); sleep(sleeptime); #endif max_step = 0; pp.query("max_step",max_step); stop_time =0.0; pp.query("stop_time",stop_time); Amr* amrptr = new Amr; amrptr->init(); while (amrptr->okToContinue() && amrptr->levelSteps(0) < max_step && amrptr->cumTime() < stop_time) { amrptr->coarseTimeStep(stop_time); } delete amrptr; BoxLib::Finalize(); return 0; } ccseapps-2.5/CCSEApps/iamrlib/ProjOutFlowBC.H0000644000175000017500000001000011634153073022035 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _PROJOUTFLOWBC_H_ #define _PROJOUTFLOWBC_H_ // // $Id: ProjOutFlowBC.H,v 1.9 2003/02/21 22:49:10 car Exp $ // #include "FArrayBox.H" #include "Geometry.H" #include "Orientation.H" #include "OutFlowBC.H" // // This class solves the BL_SPACEDIM-1 dimensional problem for the holy-grail // projection at the outflow face. It first extrapolates the interior values // to the outflow edge. Then, it solves using either back substitution or // a multigrid solver. If a multigrid solver is used, the problem is shifted // so that the last dimension is 1. // class ProjOutFlowBC : public OutFlowBC { public: ProjOutFlowBC (); void computeBC (FArrayBox velFab[][2*BL_SPACEDIM], FArrayBox divuFab[2*BL_SPACEDIM], FArrayBox rhoFab[2*BL_SPACEDIM], FArrayBox phiFab[2*BL_SPACEDIM], const Geometry& geom, Orientation* outFaces, int numOutFlowFaces, Real gravity = 0.0); void computeRhoG (FArrayBox* rhoFab, FArrayBox* phiFab, const Geometry& geom, Orientation* outFaces, int numOutFlowFaces, Real gravity); protected: #if (BL_SPACEDIM == 3) void computeCoefficients (FArrayBox& rhs, FArrayBox& beta, FArrayBox& ccExt, Box& faceBox, Real* dxFiltered, int* isPeriodic); // // Static data. // static Real tol; static Real abs_tol; #endif }; #if (BL_SPACEDIM == 3) // // This class is a BL_SPACEDIM-1 multigrid solver for the holy grail // projection. // class ProjOutFlowBC_MG : public OutFlowBC_MG { public: ProjOutFlowBC_MG (const Box& Domain, FArrayBox* Phi, FArrayBox* Rhs, FArrayBox* Resid, FArrayBox* Beta, Real* H, int* isPeriodic); ~ProjOutFlowBC_MG (); static int Verbose () { return verbose; } static int MaxIters () { return maxIters; } protected: void Restrict (); void interpolate (); Real residual (); void step (int nSteps); void gsrb (int nSteps); // // Static data. // static int verbose; static bool useCGbottomSolver; static Real cg_tol; static Real cg_abs_tol; static Real cg_max_jump; static int cg_maxiter; static int maxIters; }; #endif #endif ccseapps-2.5/CCSEApps/iamrlib/DERIVE_2D.F0000644000175000017500000005277211634153073020725 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: DERIVE_2D.F,v 1.16 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "DERIVE_F.H" #include "PROB_NS_F.H" #include "ArrayLim.H" #define SDIM 2 #if defined(BL_USE_FLOAT) || defined(BL_T3E) || defined(BL_CRAY) #define SMALL 1.0e-10 #else #define SMALL 1.0d-10 #endif c ----------------------------------------------------------- c This file contains functions which compute derived quantities. c All of the argument lists have the same template, shown below c c INPUTS/OUTPUTS: c c e <= the quantity derived c DIMS(e) => index extent of e array c nv => number of components in e array (should be 1) c dat => data neded to derive e c DIMS(dat) => index limits of dat array c ncomp => number of components of dat array (3) c lo,hi => subrange of e array where result is requested c domlo,hi => index extent of problem domain (cell centered) c delta => cell spacing c xlo => physical location of lower left hand c corner of e array c time => problem evolution time c bc => array of bndry types for component values c valid only if component touches bndry c ----------------------------------------------------------- subroutine FORT_DERKENG (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c This routine will derive kinetic energy from density c and the velocity field. c integer lo(2), hi(2) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j REAL_T rho, u, v do j = lo(2), hi(2) do i = lo(1), hi(1) rho = dat(i,j,1) u = dat(i,j,2) v = dat(i,j,3) e(i,j,1) = half*rho*(u**2 + v**2) end do end do end subroutine FORT_DERLOGS (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c This routine will derive log of given scalar quantity c integer lo(2), hi(2) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j REAL_T rho do j = lo(2), hi(2) do i = lo(1), hi(1) rho = max(dat(i,j,1),SMALL) e(i,j,1) = log10(rho) end do end do end subroutine FORT_DERMVEL (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c ::: This routine will derive the magnitude of the velocity field c ::: from the velocity field c integer lo(2), hi(2) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j REAL_T u, v do j = lo(2), hi(2) do i = lo(1), hi(1) u = dat(i,j,1) v = dat(i,j,2) e(i,j,1) = sqrt(u**2 + v**2) end do end do end subroutine FORT_DERDVRHO (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c ::: This routine will derive C/RHO c integer lo(2), hi(2) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j do j = lo(2), hi(2) do i = lo(1), hi(1) e(i,j,1) = dat(i,j,2)/dat(i,j,1) end do end do end subroutine FORT_DERMPRHO (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c ::: This routine will derive RHO*C c integer lo(2), hi(2) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j do j = lo(2), hi(2) do i = lo(1), hi(1) e(i,j,1) = dat(i,j,2)*dat(i,j,1) end do end do end subroutine FORT_DERLGRHODUST (e,DIMS(e),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c ::: This routine will derive log(RHO*C) c integer lo(2), hi(2) integer DIMDEC(e) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T e(DIMV(e),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j REAL_T dust do j = lo(2), hi(2) do i = lo(1), hi(1) dust = max(SMALL,dat(i,j,2)*dat(i,j,1)) e(i,j,1) = log10(dust) end do end do end subroutine FORT_DERMGVORT (vort,DIMS(vort),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c ::: This routine will derive magnitude of vorticity from c ::: the velocity field c integer lo(2), hi(2) integer DIMDEC(vort) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T vort(DIMV(vort),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j REAL_T vx, uy, dx, dy logical fixlft, fixrgt, fixbot, fixtop REAL_T vxcen, vxlft, vxrgt, uycen, uybot, uytop, vorfun c c ::::: some useful macro definitions c # define U(i,j) dat(i,j,1) # define V(i,j) dat(i,j,2) # define VLOX bc(1,1,2) # define VHIX bc(1,2,2) # define ULOY bc(2,1,1) # define UHIY bc(2,2,1) c c ::::: statement functions that implement stencil c vxcen(i,j) = half*(V(i+1,j)-V(i-1,j))/dx vxlft(i,j) = (V(i+1,j)+three*V(i,j)-four*V(i-1,j))/(three*dx) vxrgt(i,j) = (four*V(i+1,j)-three*V(i,j)-V(i-1,j))/(three*dx) uycen(i,j) = half*(U(i,j+1)-U(i,j-1))/dy uybot(i,j) = (U(i,j+1)+three*U(i,j)-four*U(i,j-1))/(three*dy) uytop(i,j) = (four*U(i,j+1)-three*U(i,j)-U(i,j-1))/(three*dy) vorfun(vx,uy) = vx - uy dx = delta(1) dy = delta(2) do j = lo(2), hi(2) do i = lo(1), hi(1) vx = vxcen(i,j) uy = uycen(i,j) vort(i,j,1) = vorfun(vx,uy) end do end do fixlft = ( (lo(1) .eq. domlo(1)) .and. & (VLOX .eq. EXT_DIR .or. VLOX .eq. HOEXTRAP) ) fixrgt = ( (hi(1) .eq. domhi(1)) .and. & (VHIX .eq. EXT_DIR .or. VHIX .eq. HOEXTRAP) ) fixbot = ( (lo(2) .eq. domlo(2)) .and. & (ULOY .eq. EXT_DIR .or. ULOY .eq. HOEXTRAP) ) fixtop = ( (hi(2) .eq. domhi(2)) .and. & (UHIY .eq. EXT_DIR .or. UHIY .eq. HOEXTRAP) ) c c ::::: handle special bndry conditions at the left edge c if (fixlft) then i = lo(1) do j = lo(2), hi(2) vx = vxlft(i,j) uy = uycen(i,j) vort(i,j,1) = vorfun(vx,uy) end do end if c c ::::: handle special bndry conditions on the right c if (fixrgt) then i = hi(1) do j = lo(2), hi(2) vx = vxrgt(i,j) uy = uycen(i,j) vort(i,j,1) = vorfun(vx,uy) end do end if c c ::::: handle special bndry conditions on bottom c if (fixbot) then j = lo(2) do i = lo(1), hi(1) vx = vxcen(i,j) uy = uybot(i,j) vort(i,j,1) = vorfun(vx,uy) end do end if c c ::::: handle special bndry conditions on top c if (fixtop) then j = hi(2) do i = lo(1), hi(1) vx = vxcen(i,j) uy = uytop(i,j) vort(i,j,1) = vorfun(vx,uy) end do end if c c ::::: check corners c if (fixlft .and. fixbot) then i = lo(1) j = lo(2) vx = vxlft(i,j) uy = uybot(i,j) vort(i,j,1) = vorfun(vx,uy) end if if (fixlft .and. fixtop) then i = lo(1) j = hi(2) vx = vxlft(i,j) uy = uytop(i,j) vort(i,j,1) = vorfun(vx,uy) end if if (fixrgt .and. fixtop) then i = hi(1) j = hi(2) vx = vxrgt(i,j) uy = uytop(i,j) vort(i,j,1) = vorfun(vx,uy) end if if (fixrgt .and. fixbot) then i = hi(1) j = lo(2) vx = vxrgt(i,j) uy = uybot(i,j) vort(i,j,1) = vorfun(vx,uy) end if # undef U # undef V # undef VLOX # undef VHIX # undef ULOY # undef UHIY end subroutine FORT_DERMGVORT2 (vort,DIMS(vort),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c ::: This routine will derive magnitude of vorticity from c ::: the velocity field c integer lo(2), hi(2) integer DIMDEC(vort) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T vort(DIMV(vort),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j integer nxlo, nxhi, nylo, nyhi REAL_T uy, vx, dx, dy REAL_T uycen, uylo, uyhi REAL_T vxcen, vxlo, vxhi REAL_T vorfun c c ::::: some useful macro definitions c # define U(i,j) dat(i,j,1) # define V(i,j) dat(i,j,2) # define ULOY bc(2,1,1) # define UHIY bc(2,2,1) # define VLOX bc(1,1,2) # define VHIX bc(1,2,2) c c ::::: statement functions that implement stencil c uycen(i,j) = half*(U(i,j+1)-U(i,j-1))/dy uylo(i,j) = (eight*U(i,j)-six*U(i,j+1)+U(i,j+2))/(three*dy) uyhi(i,j) = (eight*U(i,j)-six*U(i,j-1)+U(i,j-2))/(three*dy) vxcen(i,j) = half*(V(i+1,j)-V(i-1,j))/dx vxlo(i,j) = (eight*V(i,j)-six*V(i+1,j)+V(i+2,j))/(three*dx) vxhi(i,j) = (eight*V(i,j)-six*V(i-1,j)+V(i-2,j))/(three*dx) vorfun(vx,uy) = vx - uy dx = delta(1) dy = delta(2) c c :: at physical bndries where an edge value is prescribed, c :: set the value in the outside cell so that a central c :: difference formula is equivalent to the higher order c :: one sided formula c if (lo(1) .eq. domlo(1)) then i = lo(1) if (VLOX.eq.EXT_DIR .or. VLOX.eq.HOEXTRAP) then do j = lo(2), hi(2) V(i-1,j) = vxlo(i,j) end do end if end if if (hi(1) .eq. domhi(1)) then i = hi(1) if (VHIX.eq.EXT_DIR .or. VHIX.eq.HOEXTRAP) then do j = lo(2), hi(2) V(i+1,j) = vxhi(i,j) end do end if end if if (lo(2) .eq. domlo(2)) then j = lo(2) if (ULOY.eq.EXT_DIR .or. ULOY.eq.HOEXTRAP) then do i = lo(1), hi(1) U(i,j-1) = uylo(i,j) end do end if end if if (hi(2) .eq. domhi(2)) then j = hi(2) if (UHIY.eq.EXT_DIR .or. UHIY.eq.HOEXTRAP) then do i = lo(1), hi(1) U(i,j+1) = uyhi(i,j) end do end if end if do j = lo(2), hi(2) do i = lo(1), hi(1) uy = uycen(i,j) vx = vxcen(i,j) vort(i,j,1) = vorfun(vx,uy) end do end do # undef U # undef V # undef ULOY # undef UHIY # undef VLOX # undef VHIX end subroutine FORT_DERMGDIVU (divu,DIMS(divu),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c ::: This routine will derive magnitude of the divergence of velocity c integer lo(2), hi(2) integer DIMDEC(divu) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T divu(DIMV(divu),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no integer i,j integer nxlo, nxhi, nylo, nyhi REAL_T ux, vy, dx, dy REAL_T uxcen, uxlo, uxhi REAL_T vycen, vylo, vyhi c c ::::: some useful macro definitions c # define U(i,j) dat(i,j,1) # define V(i,j) dat(i,j,2) # define ULOX bc(1,1,1) # define UHIX bc(1,2,1) # define VLOY bc(2,1,2) # define VHIY bc(2,2,2) c c ::::: statement functions that implement stencil c uxcen(i,j) = half*(U(i+1,j)-U(i-1,j))/dx uxlo(i,j) = (eight*U(i,j)-six*U(i+1,j)+U(i+2,j))/(three*dx) uxhi(i,j) = (eight*U(i,j)-six*U(i-1,j)+U(i-2,j))/(three*dx) vycen(i,j) = half*(V(i,j+1)-V(i,j-1))/dy vylo(i,j) = (eight*V(i,j)-six*V(i,j+1)+V(i,j+2))/(three*dy) vyhi(i,j) = (eight*V(i,j)-six*V(i,j-1)+V(i,j-2))/(three*dy) call FORT_XVELFILL(dat(ARG_L1(dat),ARG_L2(dat),1),DIMS(dat), $ domlo,domhi,delta,xlo,time,bc(1,1,1)) call FORT_YVELFILL(dat(ARG_L1(dat),ARG_L2(dat),2),DIMS(dat), $ domlo,domhi,delta,xlo,time,bc(1,1,2)) dx = delta(1) dy = delta(2) c c :: at physical bndries where an edge value is prescribed, c :: set the value in the outside cell so that a central c :: difference formula is equivalent to the higher order c :: one sided formula c c boundaries handled by fill routines c if (lo(1) .eq. domlo(1)) then i = lo(1) if (ULOX.eq.EXT_DIR) then do j = lo(2), hi(2) U(i-1,j) = two*U(i-1,j)-U(i,j) end do else if (ULOX.eq.HOEXTRAP) then do j = lo(2), hi(2) U(i-1,j) = uxlo(i,j) end do end if end if if (hi(1) .eq. domhi(1)) then i = hi(1) if (UHIX.eq.EXT_DIR) then do j = lo(2), hi(2) U(i+1,j) = two*U(i+1,j)-U(i,j) end do else if (UHIX.eq.HOEXTRAP) then do j = lo(2), hi(2) U(i+1,j) = uxhi(i,j) end do end if end if if (lo(2) .eq. domlo(2)) then j = lo(2) if (VLOY.eq.EXT_DIR) then do i = lo(1), hi(1) V(i,j-1) = two*V(i,j-1)-V(i,j) end do else if (VLOY.eq.HOEXTRAP) then do i = lo(1), hi(1) V(i,j-1) = vylo(i,j) end do end if end if if (hi(2) .eq. domhi(2)) then j = hi(2) if (VHIY.eq.EXT_DIR) then do i = lo(1), hi(1) V(i,j+1) = two*V(i,j+1)-V(i,j) end do else if (VHIY.eq.HOEXTRAP) then do i = lo(1), hi(1) V(i,j+1) = vyhi(i,j) end do end if end if do j = lo(2), hi(2) do i = lo(1), hi(1) ux = uxcen(i,j) vy = vycen(i,j) divu(i,j,1) = ux + vy end do end do c c we overwrote the ghost cells above, so set them back below c call FORT_XVELFILL(dat(ARG_L1(dat),ARG_L2(dat),1),DIMS(dat), $ domlo,domhi,delta,xlo,time,bc(1,1,1)) call FORT_YVELFILL(dat(ARG_L1(dat),ARG_L2(dat),2),DIMS(dat), $ domlo,domhi,delta,xlo,time,bc(1,1,2)) # undef U # undef V # undef ULOX # undef UHIX # undef VLOY # undef VHIY end subroutine FORT_GRADP_DIR ( & p,DIMS(p), & gp,DIMS(gp), & lo,hi,dir,dx) c c compute a node centered pressure gradient in direction (dir) c integer DIMDEC(p) integer DIMDEC(gp) integer lo(SDIM), hi(SDIM) integer dir REAL_T dx REAL_T p(DIMV(p)) REAL_T gp(DIMV(gp)) integer i,j REAL_T d #if (BL_PRVERSION == 9) d = half #else d = half/dx #endif if (dir .eq. 0) then do j = lo(2), hi(2) do i = lo(1), hi(1) gp(i,j) = d*(p(i+1,j)-p(i,j)+p(i+1,j+1)-p(i,j+1)) end do end do else if (dir .eq. 1) then do j = lo(2), hi(2) do i = lo(1), hi(1) gp(i,j) = d*(p(i,j+1)-p(i,j)+p(i+1,j+1)-p(i+1,j)) end do end do else call bl_abort("FORT_GRADP_DIR: invalid dir") end if end subroutine FORT_DERAVGPRES (avgpres,DIMS(gp),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, & bc,level,grid_no) c c This routine computes cell-centered pressure as average of the four c surrounding nodal values. c integer DIMDEC(gp) integer DIMDEC(dat) REAL_T avgpres(DIMV(gp)) REAL_T dat(DIMV(dat)) integer nv, ncomp integer lo(2), hi(2) integer domlo(2), domhi(2) REAL_T delta(2) REAL_T xlo(2) REAL_T time, dt integer bc(2,2,ncomp) integer level integer grid_no integer i,j do j = lo(2), hi(2) do i = lo(1), hi(1) avgpres(i,j) = fourth*( dat(i+1,j )+dat(i,j ) + $ dat(i+1,j+1)+dat(i,j+1) ) end do end do end c========================================================= subroutine FORT_DERGRDPX (grdpx,DIMS(gp),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c This routine computes pressure gradient in X direction c integer lo(2), hi(2) integer DIMDEC(gp) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T grdpx(DIMV(gp),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no c call FORT_GRADP_DIR ( & dat,DIMS(dat),grdpx,DIMS(gp), & lo,hi,0,delta(1)) end subroutine FORT_DERGRDPY (grdpy,DIMS(gp),nv,dat,DIMS(dat),ncomp, & lo,hi,domlo,domhi,delta,xlo,time,dt, $ bc,level,grid_no) c c This routine computes pressure gradient in Y direction c integer lo(2), hi(2) integer DIMDEC(gp) integer DIMDEC(dat) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T delta(2), xlo(2), time, dt REAL_T grdpy(DIMV(gp),nv) REAL_T dat(DIMV(dat),ncomp) integer level, grid_no c call FORT_GRADP_DIR ( & dat,DIMS(dat),grdpy,DIMS(gp), & lo,hi,1,delta(2)) end c========================================================= subroutine FORT_DERGRDP (grdp,DIMS(gp),nv,p,DIMS(p),ncomp, & lo,hi,domlo,domhi,dx,xlo,time,dt, $ bc,level,grid_no) c c This routine computes the magnitude of pressure gradient c integer lo(2), hi(2) integer DIMDEC(gp) integer DIMDEC(p) integer domlo(2), domhi(2) integer nv, ncomp integer bc(2,2,ncomp) REAL_T dx(2), xlo(2), time, dt REAL_T grdp(DIMV(gp),nv) REAL_T p(DIMV(p),ncomp) integer level, grid_no REAL_T gpx, gpy integer i,j c do j = lo(2), hi(2) do i = lo(1), hi(1) gpx = half * (p(i+1,j,1)-p(i,j,1)+p(i+1,j+1,1)-p(i,j+1,1)) / dx(1) gpy = half * (p(i,j+1,1)-p(i,j,1)+p(i+1,j+1,1)-p(i+1,j,1)) / dx(2) grdp(i,j,1) = sqrt(gpx**2 + gpy**2) end do end do end ccseapps-2.5/CCSEApps/iamrlib/MacProj.H0000644000175000017500000001323311634153073020744 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MacProj_H_ #define _MacProj_H_ // // $Id: MacProj.H,v 1.25 2003/02/06 19:07:22 almgren Exp $ // #include #include #include #include #include #include "Godunov.H" class MacProj { public: MacProj (Amr* parent, int _finest_level, BCRec* _phys_bc, int _radius_grow ); virtual ~MacProj (); void read_params (); void install_level (int level, AmrLevel* level_data, MultiFab& volume, MultiFab* area, PArray* _radius ); void setup (int level); void cleanup (int level); // // The level advance mac projection. // void mac_project (int level, MultiFab* u_mac, MultiFab& S, Real dt, Real prev_time, const MultiFab& divu, int have_divu); void test_umac_periodic (int level, MultiFab* u_mac); // // The sync solve. // void mac_sync_solve (int level, Real dt, MultiFab* rho_half, IntVect& fine_ratio); // // Computing the sync tendency. // void mac_sync_compute (int level, MultiFab* u_mac, MultiFab* Vsync, MultiFab* Ssync, MultiFab* rho_half, FluxRegister* adv_flux_reg, Array& advectionType, Real prev_time, Real prev_pres_time, Real dt, int NUM_STATE, Real be_cn_theta, bool modify_reflux_normal_vel, int do_mom_diff, const Array& increment_sync = Array()); void mac_sync_compute (int level, MultiFab* Sync, int comp, int s_ind, const MultiFab* const* sync_edges, int eComp, MultiFab* rho_half, FluxRegister* adv_flux_reg, Array& advectionType, bool modify_reflux_normal_vel, Real dt); protected: // // Test the divergence constraint. // void check_div_cond (int level, MultiFab U_edge[]) const; // // Boundary conditions. // void BuildPhiBC (int level); void set_outflow_bcs (int level, MultiFab* mac_phi, const MultiFab* u_mac, const MultiFab& S, const MultiFab& divu); // // Pointers to amr,amrlevel. // Amr* parent; PArray LevelData; // // Boundary condition objects. // BCRec* phys_bc; Array< Array > phi_bcs; // // MAC sync correction and solution. // PArray mac_phi_crse; PArray mac_reg; // // Volume and area fractions. // PArray volume; Array area; // // Radius data. // int radius_grow; PArray< PArray > radius; // // Parameters. // int finest_level; int finest_level_allocated; static int verbose; static bool use_cg_solve; static int do_outflow_bcs; static Real mac_tol; static Real mac_abs_tol; static Real mac_sync_tol; static int check_umac_periodicity; #if 1 // this code should go away when Marc makes this option // part of the multigrid code--rbp, 2/13/97 static int fix_mac_sync_rhs; #endif }; #endif ccseapps-2.5/CCSEApps/iamrlib/SlabStatTools/0000755000175000017500000000000011634153073022034 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/SlabStatTools/Make.package0000644000175000017500000000035711634153073024233 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.1 2000/07/13 18:21:06 sstanley Exp $ # CEXE_sources += SlabStatTools.cpp PackArrayArray.cpp CEXE_headers += SlabStatTools.H PackArrayArray.H FEXE_sources += STATS_$(DIM)D.F ARRAYLIM_$(DIM)D.F FEXE_headers += ccseapps-2.5/CCSEApps/iamrlib/SlabStatTools/StatTypes.H0000644000175000017500000001137611634153073024115 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _STATS_FORT_INTERFACE_ #define _STATS_FORT_INTERFACE_ #ifdef BL_LANG_FORT c c ------------------------- c ::: Fortran Interface ::: c ------------------------- c # define FORT_VEL_RA_RND vel_ra_rnd # define FORT_VEL_FA_RND vel_fa_rnd #else // // --------------------------------------- // ::: C Interface to Fortran Routines ::: // --------------------------------------- // #if defined(BL_FORT_USE_UNDERSCORE) # define FORT_VEL_RA_RND vel_ra_rnd_ # define FORT_VEL_FA_RND vel_fa_rnd_ #elif defined(BL_FORT_USE_LOWERCASE) # define FORT_VEL_RA_RND vel_ra_rnd # define FORT_VEL_FA_RND vel_fa_rnd #elif defined(BL_FORT_USE_UPPERCASE) # define FORT_VEL_RA_RND VEL_RA_RND # define FORT_VEL_FA_RND VEL_FA_RND #endif // // Use ARLIM in the following. // extern "C" { void FORT_VEL_RA_RND(const Real *ssData, const int *nSSComp, ARLIM_P(lo), ARLIM_P(hi), const int *nStats, const int *nStns, Real *stats, Real *physStn, const int *vblo, const int *vbhi, const Real *dx, const Real *probLo, const Real *probHi, const int *axialDir, int *nActualStations); void FORT_VEL_FA_RND(const Real *ssData, const int *nSSComp, ARLIM_P(lo), ARLIM_P(hi), const int *nStats, const int *nStns, Real *stats, Real *physStn, const int *vblo, const int *vbhi, const Real *dx, const Real *probLo, const Real *probHi, const int *axialDir, int *nActualStations); // // Typedef needed for defining a pointer to the FORTRAN functions // used in calculating the statistics from DATABOX state variables. // typedef void (*STATS_FUNC) (const Real *ssData, const int *nSSComp, ARLIM_P(lo), ARLIM_P(hi), const int *nStats, const int *nStns, Real *stats, Real *physStn, const int *vblo, const int *vbhi, const Real *dx, const Real *probLo, const Real *probHi, const int *axialDir, int *nActualStations); } // // Set Up the Structure of Available Statistics Types // struct StatsRecord { aString name; // Name of statistics type aString oFileBase; // Base name for output file STATS_FUNC func; // Pointer to function that computes // these statistics int nResStats; // Number of resulting statistic values }; // // The Types // #if (BL_SPACEDIM == 2) extern const struct StatsRecord StatsTypes[] = { { "vel_ra_rnd", "Vel_ra_", FORT_VEL_RA_RND, 6}, { "vel_fa_rnd", "Vel_fa_", FORT_VEL_FA_RND, 6} }; #endif #if (BL_SPACEDIM == 3) extern const struct StatsRecord StatsTypes[] = { { "vel_ra_rnd", "Vel_ra_", FORT_VEL_RA_RND, 10}, { "vel_fa_rnd", "Vel_fa_", FORT_VEL_FA_RND, 10} }; #endif static const int NumStatsTypes = sizeof(StatsTypes)/sizeof(StatsRecord); #endif #endif ccseapps-2.5/CCSEApps/iamrlib/SlabStatTools/GNUmakefile0000644000175000017500000000474411634153073024117 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.2 2000/07/19 21:01:29 sstanley Exp $ # PBOXLIB_HOME = ../.. TOP = $(PBOXLIB_HOME) # # Variables for the user to set ... # PRECISION = DOUBLE DEBUG = TRUE PROFILE = FALSE DIM = 3 COMP = KCC USE_MPI = FALSE # # Control Make Procedure # BUILD_INPLACE:=FALSE BUILD_INPLACE:=TRUE # # Base name of the executable. # EBASE = nsSlabStat CEXE_sources += $(EBASE).cpp DEFINES += -DBL_PARALLEL_IO include $(TOP)/mk/Make.defs ./Make.package # ### Library and Include Search Paths ### ####################################### ifeq ($(BUILD_INPLACE), TRUE) include $(TOP)/pBoxLib_2/Make.package INCLUDE_LOCATIONS += . INCLUDE_LOCATIONS += $(TOP)/SlabStatTools INCLUDE_LOCATIONS += $(TOP)/pBoxLib_2 else INCLUDE_LOCATIONS += . INCLUDE_LOCATIONS += $(TOP)/include LIBRARY_LOCATIONS += $(TOP)/lib/$(machineSuffix) LIBRARIES += -lbox$(DIM)d endif # # # ifeq ($(USE_MPI),TRUE) LIBRARIES += -lmpi ifeq ($(MACHINE),OSF1) INCLUDE_LOCATIONS += /usr/local/mpi/include LIBRARY_LOCATIONS += /usr/local/mpi/lib/alpha/ch_p4 endif ifeq ($(MACHINE),AIX) INCLUDE_LOCATIONS += /usr/lpp/ppe.poe/include LIBRARY_LOCATIONS += /usr/lpp/ppe.poe/lib endif endif ifeq ($(MACHINE),OSF1) # # Some additional stuff for our preferred development/debugging environment. # ifeq ($(PRECISION),DOUBLE) FFLAGS += -real_size 64 endif FDEBF += -C FDEBF += -warn argument_checking FDEBF += -warn declarations ifneq ($(FC), f90) FDEBF += -warn truncated_source FDEBF += -warn unused endif endif # # Set Search Paths # ifeq ($(BUILD_INPLACE), TRUE) vpath %.H . $(TOP)/SlabStatTools $(TOP)/pBoxLib_2 vpath %.cpp . $(TOP)/SlabStatTools $(TOP)/pBoxLib_2 vpath %.F . $(TOP)/SlabStatTools $(TOP)/pBoxLib_2 $(TOP)/amrlib else vpath %.H . $(TOP)/SlabStatTools $(TOP)/include vpath %.cpp . $(TOP)/SlabStatTools vpath %.F . $(TOP)/SlabStatTools $(TOP)/amrlib vpath %.a $(LIBRARY_LOCATIONS) endif # ### Make Rules ### ################## all: $(executable) ifneq ($(BUILD_INPLACE), TRUE) # # Build and install all libraries needed in an appropriate order. # libs: cd $(TOP)/pBoxLib_2; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install # # Cleanup libraries. # cleanlibs: cd $(TOP)/pBoxLib_2; $(MAKE) PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) clean endif include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/iamrlib/SlabStatTools/PackArrayArray.H0000644000175000017500000000547611634153073025035 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: PackArrayArray.H,v 1.1 2000/07/13 18:21:06 sstanley Exp $ // #ifndef _PackArrayArray__ #define _PackArrayArray_ // // Includes required for the interface definition // #include "Array.H" #include "REAL.H" // ================================================================ // ===== Routine: PackArrayArray(int outerDim, int innerDim, // Array< Array > data) // ================================================================ // // This routine pack an Array> into an Array so it // can be passed into Fortran. The ordering of the pack is such that the // inner index in the Array> is the first index in fortran // (the slowest varying). // Array PackArrayArray(int outerDim, int innerDim, Array< Array > data); // ================================================================ // ===== Routine: UnPackArrayArray(int outerDim, int innerDim, // Array data) // ================================================================ // // This routine unpacks an Array into an Array> so it // can be passed into Fortran. The ordering of the pack is such that the // inner index in the Array> is the first index in fortran // (the slowest varying). This is the unpack to go with the pack above. // Array< Array > UnPackArrayArray(int outerDim, int innerDim, Array data); #endif ccseapps-2.5/CCSEApps/iamrlib/SlabStatTools/STATS_2D.F0000644000175000017500000002714511634153073023377 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: STATS_2D.F,v 1.3 2000/07/19 23:30:31 sstanley Exp $ c #include "REAL.H" #include "CONSTANTS.H" #include "ArrayLim.H" #include "StatTypes.H" #define SDIM 2 c ::: ----------------------------------------------------------- c ::: This routine calculates the velocity statistics using Reynolds c ::: averaging. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: ssDat => (const) SlabStat data c ::: nSSComp => (const) Number of components in ssDat c ::: DIMS(dat) => (const) Dimensions of SlabStat data c ::: nStats => (const) Number of statistics to calculate c ::: nStns => (const) Number of stations in the statistic array c ::: stats <= (modify) Array to hold statistics c ::: c ::: Output Values: c ::: TKE c ::: c ::: vblo, vbhi => (const) subregion where statistics are calculated c ::: ----------------------------------------------------------- c subroutine FORT_VEL_RA_RND(ssDat, nSSComp, DIMS(ssdat), $ nStats, nStns, stats, physStn, $ vblo, vbhi, dx, probLo, probHi, $ axialDir, nStations) implicit none c c :::: Passed Variables :::: c integer nSSComp, nStats, nStns, axialDir, nStations integer vblo(SDIM), vbhi(SDIM) integer DIMDEC(ssdat) REAL_T ssDat(DIMV(ssdat),nSSComp) REAL_T stats(nStns,nStats) REAL_T physStn(nStns) REAL_T dx(SDIM), probLo(SDIM), probHi(SDIM) c c ::::: local variables c integer i, j, n, profDir, nSSexpect, nStatsExpect integer flo(SDIM), fhi(SDIM) integer rho, rho2, $ u, u2, rhoU, rhoU2, $ v, v2, rhoV, rhoV2, $ tr, tr2, rhoTr, rhoTr2, $ uV, rhoUV, uTr, vTr, rhoUTr, rhoVTr, p, p2, uP, vP c c ------------------------------ c ::: Define Local Constants ::: c ------------------------------ c parameter (nSSexpect = 24, nStatsExpect = 6) call SET_LOHI(DIMS(ssdat), flo, fhi) c c ----------------------------- c ::: Perform Sanity Checks ::: c ----------------------------- c call SANITY_TEST(nStns, nStats, nSSComp, profDir, $ nSSexpect, nStatsExpect, vblo, vbhi) c c ------------------------------------------ c ::: Define SlabStat Variable Locations ::: c ------------------------------------------ c rho = 1 u = 2 rhoU = 3 v = 4 rhoV = 5 tr = 6 rhoTr = 7 p = 8 rho2 = 9 u2 = 10 rhoU2 = 11 v2 = 12 rhoV2 = 13 tr2 = 14 rhoTr2 = 15 p2 = 16 uV = 17 rhoUV = 18 uTr = 19 vTr = 20 rhoUTr = 21 rhoVTr = 22 uP = 23 vP = 24 c c ---------------------------- c ::: Calculate Statistics ::: c ---------------------------- c nStations = vbhi(profDir) - vblo(profDir) + 1 do n = 1, vbhi(profDir) - vblo(profDir) + 1 physStn(n) = (FLOAT(n) + half) * dx(profDir) if (profDir .eq. 1) then i = n - 1 + vblo(profDir) j = vblo(2) else i = vblo(1) j = n - 1 + vblo(profDir) endif stats(n,1) = ssDat(i,j,u) stats(n,2) = ssDat(i,j,v) stats(n,3) = ssDat(i,j,u2) - ssDat(i,j,u)**2 stats(n,4) = ssDat(i,j,v2) - ssDat(i,j,v)**2 stats(n,5) = ssDat(i,j,uV) - ssDat(i,j,u) * ssDat(i,j,v) stats(n,6) = half * ( stats(n,3) + stats(n,4) ) enddo c c return end c ::: ----------------------------------------------------------- c ::: This routine calculates the velocity statistics using Favre c ::: averaging. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: ssDat => (const) SlabStat data c ::: nSSComp => (const) Number of components in ssDat c ::: DIMS(dat) => (const) Dimensions of SlabStat data c ::: nStats => (const) Number of statistics to calculate c ::: nStns => (const) Number of stations in the statistic array c ::: stats <= (modify) Array to hold statistics c ::: c ::: Output Values: c ::: TKE c ::: c ::: vblo, vbhi => (const) subregion where statistics are calculated c ::: ----------------------------------------------------------- c subroutine FORT_VEL_FA_RND(ssDat, nSSComp, DIMS(ssdat), $ nStats, nStns, stats, physStn, $ vblo, vbhi, dx, probLo, probHi, $ axialDir, nStations) implicit none c c :::: Passed Variables :::: c integer nSSComp, nStats, nStns, axialDir, nStations integer vblo(SDIM), vbhi(SDIM) integer DIMDEC(ssdat) REAL_T ssDat(DIMV(ssdat),nSSComp) REAL_T stats(nStns,nStats) REAL_T physStn(nStns) REAL_T dx(SDIM), probLo(SDIM), probHi(SDIM) c c ::::: local variables c integer i, j, n, profDir, nSSexpect, nStatsExpect integer flo(SDIM), fhi(SDIM) integer rho, rho2, $ u, u2, rhoU, rhoU2, $ v, v2, rhoV, rhoV2, $ tr, tr2, rhoTr, rhoTr2, $ uV, rhoUV, uTr, vTr, rhoUTr, rhoVTr, p, p2, uP, vP c c ------------------------------ c ::: Define Local Constants ::: c ------------------------------ c parameter (nSSexpect = 24, nStatsExpect = 6) call SET_LOHI(DIMS(ssdat), flo, fhi) c c ----------------------------- c ::: Perform Sanity Checks ::: c ----------------------------- c call SANITY_TEST(nStns, nStats, nSSComp, profDir, $ nSSexpect, nStatsExpect, vblo, vbhi) c c ------------------------------------------ c ::: Define SlabStat Variable Locations ::: c ------------------------------------------ c rho = 1 u = 2 rhoU = 3 v = 4 rhoV = 5 tr = 6 rhoTr = 7 p = 8 rho2 = 9 u2 = 10 rhoU2 = 11 v2 = 12 rhoV2 = 13 tr2 = 14 rhoTr2 = 15 p2 = 16 uV = 17 rhoUV = 18 uTr = 19 vTr = 20 rhoUTr = 21 rhoVTr = 22 uP = 23 vP = 24 c c ---------------------------- c ::: Calculate Statistics ::: c ---------------------------- c nStations = vbhi(profDir) - vblo(profDir) + 1 do n = 1, vbhi(profDir) - vblo(profDir) + 1 physStn(n) = (FLOAT(n) + half) * dx(profDir) if (profDir .eq. 1) then i = n - 1 + vblo(profDir) j = vblo(2) else i = vblo(1) j = n - 1 + vblo(profDir) endif stats(n,1) = ssDat(i,j,rhoU) / ssDat(i,j,rho) stats(n,2) = ssDat(i,j,rhoV) / ssDat(i,j,rho) stats(n,3) = ssDat(i,j,rhoU2) / ssDat(i,j,rho) $ - ssDat(i,j,rhoU)**2 / ssDat(i,j,rho)**2 stats(n,4) = ssDat(i,j,rhoV2) / ssDat(i,j,rho) $ - ssDat(i,j,rhoV)**2 / ssDat(i,j,rho)**2 stats(n,5) = ssDat(i,j,rhoUV) / ssDat(i,j,rho) $ - ssDat(i,j,rhoU) * ssDat(i,j,rhoV) / ssDat(i,j,rho)**2 stats(n,6) = half * ( stats(n,3) + stats(n,4) ) enddo c c return end c ::: --------------------------------------------------------------------- c ::: This routine does general sanity testing on the inputs for the c ::: SlabStat statistics routines. This should be called by each of the c ::: actual fortran routines used to calculate statistics. This routine c ::: also sets the profile direction, profDir. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: nStns => (const) Number of stations in the statistic array c ::: nStats => (const) Number of statistics to calculate c ::: nSSComp => (const) Number of components in ssDat c ::: profDir <= Profile direction c ::: nSSexpect => (const) Number of components in ssDat c ::: nStatsExpect => (const) Te number of statistics expected to calculate c ::: vblo, vbhi => (const) subregion where statistics are calculated c ::: --------------------------------------------------------------------- c subroutine SANITY_TEST(nStns, nStats, nSSComp, profDir, $ nSSexpect, nStatsExpect, vblo, vbhi) implicit none c c ::: Passed Variables ::: c integer nStns, nStats, nSSComp, profDir, nSSexpect, nStatsExpect integer vblo(SDIM), vbhi(SDIM) c c ::: Local Variables ::: c integer n c c ----------------------------- c ::: Perform Sanity Checks ::: c ----------------------------- c profDir = -1 do n = 1, SDIM if (vbhi(n) - vblo(n) + 1 .gt. 1) then if (profDir .ne. -1) then write(*,1000) vblo, vbhi 1000 format("Error: Valid region of SlabStat data is dimensioned", $ /" greater than one in more than one direction.", $ /" vblo = ", SDIM(I4,1x), $ /" vbhi = ", SDIM(I4,1x)) call BL_PD_ABORT() endif profDir = n endif enddo if (nStns .lt. vbhi(profDir)-vblo(profDir)) then write(*,1010) nStns, profDir, vblo, vbhi 1010 format("Error: The dimensions of the statistics array are insufficient", $ /" to hold the profile.", $ /" nStns = ", I4, " profDir = ", I1, $ /" vblo = ", SDIM(I4,1x), $ /" vbhi = ", SDIM(I4,1x)) call BL_PD_ABORT() endif if (nSSComp .lt. nSSexpect) then write(*,1020) nSSexpect, nSSComp 1020 format("Error: There are fewer SlabStat components than are expected", $ " from the NavierStokes statistics routines. The", $ " SlabStat components defined in this routine should be", $ " updated to match those saved by the code.", $ " nSSexpect = ", I4, " nSSComp = ", I4) call BL_PD_ABORT() endif if (nStats .ne. nStatsExpect) then write(*,1030) nStatsExpect, nStats 1030 format("Error: The number of statistics passed in do not match what", $ " was expected.", $ " nStatsExpect = ", I4, " nStats = ", I4) call BL_PD_ABORT() endif c c return end ccseapps-2.5/CCSEApps/iamrlib/SlabStatTools/PackArrayArray.cpp0000644000175000017500000000611111634153073025413 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: PackArrayArray.cpp,v 1.1 2000/07/13 18:21:06 sstanley Exp $ // #include "PackArrayArray.H" // ================================================================ // ===== Routine: PackArrayArray(int outerDim, int innerDim, // Array< Array > data) // ================================================================ // // This routine pack an Array> into an Array so it // can be passed into Fortran. The ordering of the pack is such that the // inner index in the Array> is the first index in fortran // (the slowest varying). // Array PackArrayArray(int outerDim, int innerDim, Array< Array > data) { Array dataRet(outerDim*innerDim); for (int no = 0; no < outerDim; no++) { for (int ni = 0; ni < innerDim; ni++) dataRet[ni*outerDim + no] = (data[no])[ni]; } return dataRet; } // ================================================================ // ===== Routine: UnPackArrayArray(int outerDim, int innerDim, // Array data) // ================================================================ // // This routine unpacks an Array into an Array> so it // can be passed into Fortran. The ordering of the pack is such that the // inner index in the Array> is the first index in fortran // (the slowest varying). This is the unpack to go with the pack above. // Array< Array > UnPackArrayArray(int outerDim, int innerDim, Array data) { Array< Array > dataRet(outerDim); for (int no = 0; no < outerDim; no++) dataRet[no].resize(innerDim); for (int no = 0; no < outerDim; no++) { for (int ni = 0; ni < innerDim; ni++) (dataRet[no])[ni] = data[ni*outerDim + no]; } return dataRet; } ccseapps-2.5/CCSEApps/iamrlib/SlabStatTools/nsSlabStat.cpp0000644000175000017500000001642011634153073024621 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifdef BL_ARCH_CRAY #ifdef BL_USE_DOUBLE #error "DOUBLE PRECISION NOT ALLOWED ON CRAY" #endif #endif #ifndef WIN32 #include #endif #include "MultiFab.H" #include "ParmParse.H" #include "Utility.H" #include "ParallelDescriptor.H" #include using std::setprecision; #include #ifndef WIN32 using std::set_new_handler; #endif #include "ArrayLim.H" #include "SlabStatTools.H" #include "StatTypes.H" #include "ValidTypes.H" #include "PackArrayArray.H" static void PrintUsage(const char* progName) { if (ParallelDescriptor::IOProcessor()) { cout << "Usage: " << endl; cout << progName << " [options]" << endl << endl; cout << "\t Options:" << endl; cout << "\t statType = Type of statistics to calculate" << endl; cout << "\t begItime = Beginning integer time" << endl; cout << "\t endItime = Ending integer time" << endl; cout << "\t axialDir = Streamwise direction. (1->x, 2->y)" << endl; cout << endl; cout << "\t Available Statistic Types:" << endl; for (int nclc = 0; nclc < NumStatsTypes; ++nclc) { cout << "\t " << StatsTypes[nclc].name << endl; } exit(0); } } int main (int argc, char* argv[]) { // // Make sure to catch new failures. // #ifndef WIN32 set_new_handler(Utility::OutOfMemory); #endif ParallelDescriptor::StartParallel(&argc, &argv); //-------------// // Print Usage // //-------------// if (argc == 1) PrintUsage(argv[0]); // // Parse the command line // ParmParse pp(argc-1,argv+1); if (pp.contains("help")) PrintUsage(argv[0]); aString statType; pp.query("statType", statType); if (statType.isNull() && ParallelDescriptor::IOProcessor()) BoxLib::Abort("You must specify `statType'"); int statIndx = ValidType(statType); int begItime = -1; pp.query("begItime", begItime); if (begItime == -1 && ParallelDescriptor::IOProcessor()) BoxLib::Abort("You must specify `begItime'"); int endItime = -1; pp.query("endItime", endItime); if (endItime == -1 && ParallelDescriptor::IOProcessor()) BoxLib::Abort("You must specify `endItime'"); int axialDir = -1; pp.query("axialDir", axialDir); if (axialDir == -1 && ParallelDescriptor::IOProcessor()) BoxLib::Abort("You must specify `axialDir'"); //---------------------// // Read SlabStats Data // //---------------------// const aString baseDir("slabstats"); const aString slabStatName("basicStats"); MultiFab ssData; int statLevel; Array dxLevel(BL_SPACEDIM), probLo(BL_SPACEDIM), probHi(BL_SPACEDIM); accumulateStats(baseDir, begItime, endItime, slabStatName, statLevel, dxLevel, probLo, probHi, ssData); cout << statLevel << endl; for (int dir = 0; dir < BL_SPACEDIM; dir++) { cout << dir << " " << probLo[dir] << " " << probHi[dir] << " " << dxLevel[dir] << endl; } //------------------------------// // Calculate and Write Profiles // //------------------------------// for (MultiFabIterator mfi(ssData); mfi.isValid(); ++mfi) { // // Calculate Statistics // const int nComp = mfi().nComp(); const int *vblo = mfi.validbox().loVect(); const int *vbhi = mfi.validbox().hiVect(); const int *fblo = mfi.fabbox().loVect(); const int *fbhi = mfi.fabbox().hiVect(); const int nStats = StatsTypes[statIndx].nResStats; // // Note: This logic assumes that the profiles are always in the // direction having the maximum dimension on the box. This also // assumes that the constant and profile direction are always // in the X or Y directions. So, this essentially assumes that // you never want statistics on constant Z slices or profiles in // the Z-direction. This works for flows which are either // periodic in the Z-direction or are round about the centerline // in either the X and Z or the Y and Z directions. The round // flowfields works since the value of nStns is multiplied by // the Z-dimension if the box is 3-d. // int cnstDir, profDir; cnstDir = (mfi.validbox().length(0) < mfi.validbox().length(1) ? 0 : 1); profDir = 1 - cnstDir; int cnstIndx = mfi.validbox().smallEnd(cnstDir); int nStns = mfi.validbox().length(profDir); if (BL_SPACEDIM > 2) nStns = nStns * mfi.validbox().length(2); Array physStn(nStns); Array< Array > stats(nStns); for (int n = 0; n < nStns; n++) stats[n].resize(nStats); Array passStats(nStns * nStats); passStats = PackArrayArray(nStns, nStats, stats); int nActualStations; StatsTypes[statIndx].func(mfi().dataPtr(), &nComp, ARLIM(fblo), ARLIM(fbhi), &nStats, &nStns, passStats.dataPtr(), physStn.dataPtr(), vblo, vbhi, dxLevel.dataPtr(), probLo.dataPtr(), probHi.dataPtr(), &axialDir, &nActualStations); stats = UnPackArrayArray(nStns, nStats, passStats); // // Write Stats // aString oFile = StatsTypes[statIndx].oFileBase; char* cnstDirChar = (cnstDir == 0 ? "i" : "j"); oFile = oFile + cnstDirChar; oFile = Utility::Concatenate(oFile, cnstIndx); oFile = oFile + ".dat"; ofstream ostr; ostr.open(oFile.c_str()); for (int stn = 0; stn < nActualStations; stn++) { ostr << physStn[stn] << " "; for (int stat = 0; stat < nStats; stat++) ostr << stats[stn][stat] << " "; ostr << endl; } ostr.close(); } } ccseapps-2.5/CCSEApps/iamrlib/SlabStatTools/STATS_3D.F0000644000175000017500000005536511634153073023405 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: STATS_3D.F,v 1.3 2000/07/20 17:37:17 sstanley Exp $ c #include "REAL.H" #include "CONSTANTS.H" #include "ArrayLim.H" #include "StatTypes.H" #define SDIM 3 c ::: ----------------------------------------------------------- c ::: This routine calculates the velocity statistics using Reynolds c ::: averaging. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: ssDat => (const) SlabStat data c ::: nSSComp => (const) Number of components in ssDat c ::: DIMS(dat) => (const) Dimensions of SlabStat data c ::: nStats => (const) Number of statistics to calculate c ::: nStns => (const) Number of stations in the statistic array c ::: stats <= (modify) Array to hold statistics c ::: c ::: Output Values: c ::: TKE c ::: c ::: vblo, vbhi => (const) subregion where statistics are calculated c ::: axialDir => (const) streamwise direction. This must be either c ::: 1 or 2. c ::: ----------------------------------------------------------- c subroutine FORT_VEL_RA_RND(ssDat, nSSComp, DIMS(ssdat), $ nStats, nStns, stats, physStn, $ vblo, vbhi, dx, probLo, probHi, $ axialDir, nStations) implicit none c c :::: Passed Variables :::: c integer nSSComp, nStats, nStns, axialDir, nStations integer vblo(SDIM), vbhi(SDIM) integer DIMDEC(ssdat) REAL_T ssDat(DIMV(ssdat),nSSComp) REAL_T stats(nStns,nStats) REAL_T physStn(nStns) REAL_T dx(SDIM), probLo(SDIM), probHi(SDIM) c c ::::: local variables c integer i, j, k, n, r, profDir, nSSexpect, nStatsExpect integer flo(SDIM), fhi(SDIM) integer rho, rho2, $ u, u2, rhoU, rhoU2, $ v, v2, rhoV, rhoV2, $ w, w2, rhoW, rhoW2, $ tr, tr2, rhoTr, rhoTr2, $ uV, uW, vW, rhoUV, rhoUW, rhoVW, $ uTr, vTr, wTr, rhoUTr, rhoVTr, rhoWTr, $ p, p2, uP, vP, wP integer stnCnt(:) allocatable stnCnt REAL_T tol, x, y, z, rad, xoff, yoff, zoff, VaBar, VrBar, VtBar, $ VaVrBar, VaVtBar, VrVtBar, theta, Va2Bar, Vr2Bar, Vt2Bar REAL_T cl(SDIM) c c ------------------------------ c ::: Define Local Constants ::: c ------------------------------ c parameter (nSSexpect = 35, nStatsExpect = 10) call SET_LOHI(DIMS(ssdat), flo, fhi) do n = 1, SDIM cl(n) = half * (probLo(n) + probHi(n)) enddo allocate(stnCnt(nStns)) c c ----------------------------- c ::: Perform Sanity Checks ::: c ----------------------------- c call SANITY_TEST_RND(nStns, nStats, nSSComp, profDir, $ nSSexpect, nStatsExpect, vblo, vbhi, $ axialDir) c c ------------------------------------------ c ::: Define SlabStat Variable Locations ::: c ------------------------------------------ c rho = 1 u = 2 rhoU = 3 v = 4 rhoV = 5 w = 6 rhoW = 7 tr = 8 rhoTr = 9 p = 10 rho2 = 11 u2 = 12 rhoU2 = 13 v2 = 14 rhoV2 = 15 w2 = 16 rhoW2 = 17 tr2 = 18 rhoTr2 = 19 p2 = 20 uV = 21 uW = 22 vW = 23 rhoUV = 24 rhoUW = 25 rhoVW = 26 uTr = 27 vTr = 28 wTr = 29 rhoUTr = 30 rhoVTr = 31 rhoWTr = 32 uP = 33 vP = 34 wP = 35 c c --------------------------------------- c ::: Calculate The Physical Location ::: c --------------------------------------- c c This logic is for round flowfields only. For planar flowfields the c physical locations are easy. But, for round flowfields we need to c determine which radiuses are defined by the grid spacing of the domain. c if (profDir .ne. axialDir) then c c NOTE: This assumes the axial direction is always 2 (y). c tol = ten**(-10) * SQRT(dx(1)**2 + dx(3)**2) call CLC_RADIUS(vblo(1), vbhi(1), vblo(3), vbhi(3), $ probLo(1), probLo(3), $ dx(1), dx(3), cl(1), cl(3), tol, $ nStns, nStations, physStn) else tol = ten**(-10) * dx(profDir) nStations = vbhi(profDir) - vblo(profDir) + 1 do n = 0, nStations-1 physStn(n+1) = (FLOAT(n) + half) * dx(profDir) enddo endif do n = 1, nStations stnCnt(n) = 0 do i = 1, nStatsExpect stats(n,i) = zero enddo enddo c c ---------------------------- c ::: Calculate Statistics ::: c ---------------------------- c do k = vblo(3), vbhi(3) z = probLo(3) + (half + FLOAT(k)) * dx(3) do j = vblo(2), vbhi(2) y = probLo(2) + (half + FLOAT(j)) * dx(2) do i = vblo(1), vbhi(1) x = probLo(1) + (half + FLOAT(i)) * dx(1) c c ::: Calculate radius and set profile index ::: c if (profDir .ne. axialDir) then xoff = x - cl(1) zoff = z - cl(3) rad = SQRT(xoff**2 + zoff**2) xoff = MIN(one, xoff/rad) xoff = MAX(-one, xoff) theta = SIGN(one, -zoff) * ACOS(xoff) do r = 1, nStations if (physStn(r)-tol .LT. rad .AND. $ rad .LT. physStn(r)+tol) n = r enddo else xoff = x - cl(1) zoff = z - cl(3) rad = SQRT(xoff**2 + zoff**2) xoff = MIN(one, xoff/rad) xoff = MAX(-one, xoff) theta = SIGN(one, -zoff) * ACOS(xoff) n = j + 1 endif c c ::: Calculate Statistics ::: c stnCnt(n) = stnCnt(n) + 1 VaBar = ssDat(i,j,k,v) VrBar = ssDat(i,j,k,u)*cos(theta) - ssDat(i,j,k,w)*sin(theta) VtBar = - ssDat(i,j,k,w)*cos(theta) - ssDat(i,j,k,u)*sin(theta) Va2Bar = ssDat(i,j,k,v2) Vr2Bar = ssDat(i,j,k,u2) * cos(theta)**2 $ - two * ssDat(i,j,k,uW) * cos(theta) * sin(theta) $ + ssDat(i,j,k,w2) * sin(theta)**2 Vt2Bar = ssDat(i,j,k,w2) * cos(theta)**2 $ + two * ssDat(i,j,k,uW) * cos(theta) * sin(theta) $ + ssDat(i,j,k,u2) * sin(theta)**2 VaVrBar = ssDat(i,j,k,uV) * cos(theta) $ - ssDat(i,j,k,vW) * sin(theta) VaVtBar = - ssDat(i,j,k,vW) * cos(theta) $ - ssDat(i,j,k,uV) * sin(theta) VrVtBar = - ssDat(i,j,k,uW) * cos(theta)**2 $ + (ssDat(i,j,k,w2) - ssDat(i,j,k,u2)) $ * cos(theta) * sin(theta) $ - ssDat(i,j,k,uW) * sin(theta)**2 stats(n,1) = stats(n,1) + VaBar stats(n,2) = stats(n,2) + VrBar stats(n,3) = stats(n,3) + VtBar stats(n,4) = stats(n,4) + Va2Bar - VaBar**2 stats(n,5) = stats(n,5) + Vr2Bar - VrBar**2 stats(n,6) = stats(n,6) + Vt2Bar - VtBar**2 stats(n,7) = stats(n,7) + VaVrBar - VaBar * VrBar stats(n,8) = stats(n,8) + VaVtBar - VaBar * VtBar stats(n,9) = stats(n,9) + VrVtBar - VrBar * VtBar stats(n,10) = stats(n,10) + half * ( Va2Bar - VaBar**2 $ + Vr2Bar - VrBar**2 $ + Vt2Bar - VtBar**2) enddo enddo enddo do r = 1, nStations do n = 1, nStats stats(r,n) = stats(r,n) / FLOAT(stnCnt(r)) enddo enddo c c return end c ::: ----------------------------------------------------------- c ::: This routine calculates the velocity statistics using Favre c ::: averaging. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: ssDat => (const) SlabStat data c ::: nSSComp => (const) Number of components in ssDat c ::: DIMS(dat) => (const) Dimensions of SlabStat data c ::: nStats => (const) Number of statistics to calculate c ::: nStns => (const) Number of stations in the statistic array c ::: stats <= (modify) Array to hold statistics c ::: c ::: Output Values: c ::: TKE c ::: c ::: vblo, vbhi => (const) subregion where statistics are calculated c ::: axialDir => (const) streamwise direction. This must be either c ::: 1 or 2. c ::: ----------------------------------------------------------- c subroutine FORT_VEL_FA_RND(ssDat, nSSComp, DIMS(ssdat), $ nStats, nStns, stats, physStn, $ vblo, vbhi, dx, probLo, probHi, $ axialDir, nStations) implicit none c c :::: Passed Variables :::: c integer nSSComp, nStats, nStns, axialDir, nStations integer vblo(SDIM), vbhi(SDIM) integer DIMDEC(ssdat) REAL_T ssDat(DIMV(ssdat),nSSComp) REAL_T stats(nStns,nStats) REAL_T physStn(nStns) REAL_T dx(SDIM), probLo(SDIM), probHi(SDIM) c c ::::: local variables c integer i, j, k, n, r, profDir, nSSexpect, nStatsExpect integer flo(SDIM), fhi(SDIM) integer rho, rho2, $ u, u2, rhoU, rhoU2, $ v, v2, rhoV, rhoV2, $ w, w2, rhoW, rhoW2, $ tr, tr2, rhoTr, rhoTr2, $ uV, uW, vW, rhoUV, rhoUW, rhoVW, $ uTr, vTr, wTr, rhoUTr, rhoVTr, rhoWTr, $ p, p2, uP, vP, wP integer stnCnt(:) allocatable stnCnt REAL_T tol, x, y, z, rad, xoff, yoff, zoff, rVaBar, rVrBar, rVtBar, $ rVaVrBar, rVaVtBar, rVrVtBar, theta, rVa2Bar, rVr2Bar, rVt2Bar, $ rBar REAL_T cl(SDIM) c c ------------------------------ c ::: Define Local Constants ::: c ------------------------------ c parameter (nSSexpect = 35, nStatsExpect = 10) call SET_LOHI(DIMS(ssdat), flo, fhi) do n = 1, SDIM cl(n) = half * (probLo(n) + probHi(n)) enddo allocate(stnCnt(nStns)) c c ----------------------------- c ::: Perform Sanity Checks ::: c ----------------------------- c call SANITY_TEST_RND(nStns, nStats, nSSComp, profDir, $ nSSexpect, nStatsExpect, vblo, vbhi, $ axialDir) c c ------------------------------------------ c ::: Define SlabStat Variable Locations ::: c ------------------------------------------ c rho = 1 u = 2 rhoU = 3 v = 4 rhoV = 5 w = 6 rhoW = 7 tr = 8 rhoTr = 9 p = 10 rho2 = 11 u2 = 12 rhoU2 = 13 v2 = 14 rhoV2 = 15 w2 = 16 rhoW2 = 17 tr2 = 18 rhoTr2 = 19 p2 = 20 uV = 21 uW = 22 vW = 23 rhoUV = 24 rhoUW = 25 rhoVW = 26 uTr = 27 vTr = 28 wTr = 29 rhoUTr = 30 rhoVTr = 31 rhoWTr = 32 uP = 33 vP = 34 wP = 35 c c --------------------------------------- c ::: Calculate The Physical Location ::: c --------------------------------------- c c This logic is for round flowfields only. For planar flowfields the c physical locations are easy. But, for round flowfields we need to c determine which radiuses are defined by the grid spacing of the domain. c if (profDir .ne. axialDir) then c c NOTE: This assumes the axial direction is always 2 (y). c tol = ten**(-10) * SQRT(dx(1)**2 + dx(3)**2) call CLC_RADIUS(vblo(1), vbhi(1), vblo(3), vbhi(3), $ probLo(1), probLo(3), $ dx(1), dx(3), cl(1), cl(3), tol, $ nStns, nStations, physStn) else tol = ten**(-10) * dx(profDir) nStations = vbhi(profDir) - vblo(profDir) + 1 do n = 0, nStations-1 physStn(n+1) = (FLOAT(n) + half) * dx(profDir) enddo endif do n = 1, nStations do i = 1, nStatsExpect stats(n,i) = zero enddo enddo c c ---------------------------- c ::: Calculate Statistics ::: c ---------------------------- c do k = vblo(3), vbhi(3) z = probLo(3) + (half + FLOAT(k)) * dx(3) do j = vblo(2), vbhi(2) y = probLo(2) + (half + FLOAT(j)) * dx(2) do i = vblo(1), vbhi(1) x = probLo(1) + (half + FLOAT(i)) * dx(1) c c ::: Calculate radius and set profile index ::: c if (profDir .ne. axialDir) then xoff = x - cl(1) zoff = z - cl(3) rad = SQRT(xoff**2 + zoff**2) xoff = MIN(one, xoff/rad) xoff = MAX(-one, xoff) theta = SIGN(one, -zoff) * ACOS(xoff) do r = 1, nStations if (physStn(r)-tol .LT. rad .AND. $ rad .LT. physStn(r)+tol) n = r enddo else xoff = x - cl(1) zoff = z - cl(3) rad = SQRT(xoff**2 + zoff**2) xoff = MIN(one, xoff/rad) xoff = MAX(-one, xoff) theta = SIGN(one, -zoff) * ACOS(xoff) n = j + 1 endif c c ::: Calculate Statistics ::: c stnCnt(n) = stnCnt(n) + 1 rBar = ssDat(i,j,k,rho) rVaBar = ssDat(i,j,k,rhoV) rVrBar = ssDat(i,j,k,rhoU)*cos(theta) $ - ssDat(i,j,k,rhoW)*sin(theta) rVtBar = - ssDat(i,j,k,rhoW)*cos(theta) $ - ssDat(i,j,k,rhoU)*sin(theta) rVa2Bar = ssDat(i,j,k,rhoV2) rVr2Bar = ssDat(i,j,k,rhoU2) * cos(theta)**2 $ - two * ssDat(i,j,k,rhoUW) * cos(theta) * sin(theta) $ + ssDat(i,j,k,rhoW2) * sin(theta)**2 rVt2Bar = ssDat(i,j,k,rhoW2) * cos(theta)**2 $ + two * ssDat(i,j,k,rhoUW) * cos(theta) * sin(theta) $ + ssDat(i,j,k,rhoU2) * sin(theta)**2 rVaVrBar = ssDat(i,j,k,rhoUV) * cos(theta) $ - ssDat(i,j,k,rhoVW) * sin(theta) rVaVtBar = - ssDat(i,j,k,rhoVW) * cos(theta) $ - ssDat(i,j,k,rhoUV) * sin(theta) rVrVtBar = - ssDat(i,j,k,rhoUW) * cos(theta)**2 $ + (ssDat(i,j,k,rhoW2) - ssDat(i,j,k,rhoU2)) $ * cos(theta) * sin(theta) $ - ssDat(i,j,k,rhoUW) * sin(theta)**2 stats(n,1) = stats(n,1) + rVaBar / rBar stats(n,2) = stats(n,2) + rVrBar / rBar stats(n,3) = stats(n,3) + rVtBar / rBar stats(n,4) = stats(n,4) + rVa2Bar / rBar - rVaBar**2 / rBar**2 stats(n,5) = stats(n,5) + rVr2Bar / rBar - rVrBar**2 / rBar**2 stats(n,6) = stats(n,6) + rVt2Bar / rBar - rVtBar**2 / rBar**2 stats(n,7) = stats(n,7) + rVaVrBar / rBar $ - rVaBar * rVrBar / rBar**2 stats(n,8) = stats(n,8) + rVaVtBar / rBar $ - rVaBar * rVtBar / rBar**2 stats(n,9) = stats(n,9) + rVrVtBar / rBar $ - rVrBar * rVtBar / rBar**2 stats(n,10) = stats(n,10) + half * ( $ rVa2Bar / rBar - rVaBar**2 / rBar**2 $ + rVr2Bar / rBar - rVrBar**2 / rBar**2 $ + rVt2Bar / rBar - rVtBar**2 / rBar**2 ) enddo enddo enddo do r = 1, nStations do n = 1, nStats stats(r,n) = stats(r,n) / FLOAT(stnCnt(r)) enddo enddo c c return end c ::: --------------------------------------------------------------------- c ::: This routine does general sanity testing on the inputs for the c ::: SlabStat statistics routines. This should be called by each of the c ::: actual fortran routines used to calculate statistics. This routine c ::: also sets the profile direction, profDir. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: nStns => (const) Number of stations in the statistic array c ::: nStats => (const) Number of statistics to calculate c ::: nSSComp => (const) Number of components in ssDat c ::: profDir <= Profile direction c ::: nSSexpect => (const) Number of components in ssDat c ::: nStatsExpect => (const) Te number of statistics expected to calculate c ::: vblo, vbhi => (const) subregion where statistics are calculated c ::: axialDir => (const) streamwise direction c ::: --------------------------------------------------------------------- c subroutine SANITY_TEST_RND(nStns, nStats, nSSComp, profDir, $ nSSexpect, nStatsExpect, vblo, vbhi, $ axialDir) implicit none c c ::: Passed Variables ::: c integer nStns, nStats, nSSComp, profDir, nSSexpect, nStatsExpect, $ axialDir integer vblo(SDIM), vbhi(SDIM) c c ::: Local Variables ::: c integer n, profDim c c ----------------------------- c ::: Perform Sanity Checks ::: c ----------------------------- c profDir = -1 profDim = 1 do n = 1, SDIM - 1 if (vbhi(n) - vblo(n) + 1 .gt. 1) then if (profDir .ne. -1) then write(*,1000) vblo, vbhi 1000 format("Error: Valid region of SlabStat data is dimensioned", $ /" greater than one in more than one direction.", $ /" vblo = ", SDIM(I4,1x), $ /" vbhi = ", SDIM(I4,1x)) call BL_PD_ABORT() endif profDim = vbhi(n) - vblo(n) + 1 profDir = n endif enddo profDim = profDim * (vbhi(3) - vblo(3) + 1) if (nStns .lt. profDim) then write(*,1010) nStns, profDir, profDim, vblo, vbhi 1010 format("Error: The dimensions of the statistics array are insufficient", $ /" to hold the profile.", $ /" nStns = ", I4, 6x, "profDir = ", I1, $ 6x, "profDim = ", I4, $ /" vblo = ", SDIM(I4,1x), $ /" vbhi = ", SDIM(I4,1x)) call BL_PD_ABORT() endif if (nSSComp .lt. nSSexpect) then write(*,1020) nSSexpect, nSSComp 1020 format("Error: There are fewer SlabStat components than are expected", $ " from the NavierStokes statistics routines. The", $ " SlabStat components defined in this routine should be", $ " updated to match those saved by the code.", $ " nSSexpect = ", I4, " nSSComp = ", I4) call BL_PD_ABORT() endif if (nStats .ne. nStatsExpect) then write(*,1030) nStatsExpect, nStats 1030 format("Error: The number of statistics passed in do not match what", $ " was expected.", $ " nStatsExpect = ", I4, " nStats = ", I4) call BL_PD_ABORT() endif if (axialDir .ne. 2) then write(*,1040) axialDir 1040 format("Error: The running statistics routines are only implemented", $ /" for axialDir=2.", $ /" axialDir = ", I1) call BL_PD_ABORT() endif c c return end SUBROUTINE CLC_RADIUS(lo1, hi1, lo2, hi2, probLo1, probLo2, $ dx1, dx2, cl1, cl2, tol, $ nAlloc, nStns, physLoc) c c ***************************** c *** Variable Declarations *** c ***************************** c IMPLICIT NONE c c *** Passed Variables *** c INTEGER lo1, lo2, hi1, hi2, nAlloc, nStns REAL_T cl1, cl2, tol, dx1, dx2, probLo1, probLo2 REAL_T physLoc(nAlloc) c c *** Local Variables *** c INTEGER n, m, r REAL_T rad, xyz1, xyz2 LOGICAL found c c ************************************************** c *** Determine the Values of the Radius Present *** c ************************************************** c c The tolerence is used here to determine whether a radius has already c been added to the physLoc array. All of the distinct radiuses are c added to the list here and then it is sorted below from lowest to c highest. c nStns = 0 DO n = lo1, hi1 xyz1 = probLo1 + (half + FLOAT(n)) * dx1 DO m = lo2, hi2 xyz2 = probLo2 + (half + FLOAT(m)) * dx2 rad = SQRT( (xyz1 - cl1)**2 + (xyz2 - cl2)**2 ) found = .FALSE. DO r = 1, nStns IF (physLoc(r)-tol .LT. rad .AND. rad .LT. physLoc(r)+tol) THEN found = .TRUE. ENDIF ENDDO IF (.NOT.found) THEN nStns = nStns + 1 physLoc(nStns) = rad ENDIF ENDDO ENDDO c c ********************************* c *** Sort the List of Radiuses *** c ********************************* c DO n = 1, nStns - 1 DO m = 1, nStns - n IF (physLoc(m) .GT. physLoc(m+1)) THEN rad = physLoc(m) physLoc(m) = physLoc(m+1) physLoc(m+1) = rad ENDIF ENDDO ENDDO c c RETURN END ccseapps-2.5/CCSEApps/iamrlib/SlabStatTools/ValidTypes.H0000644000175000017500000000454511634153073024241 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ValidTypes.H,v 1.3 2001/10/17 17:53:33 lijewski Exp $ // #ifndef _ValidType_ #define _ValidType_ #include #include "REAL.H" #include "aString.H" #include "ArrayLim.H" #include "StatTypes.H" // ============================================================ // ===== Routine: ValidType(aString reqType) // ============================================================ // // This routine checks the type specified in reqType against those defined // in the structure StatsTypes to make sure that reqType is valid. It then // returns the integer index in StatsTypes[] to the defined type corresponding // to reqType. If reqType is not valid, the code is aborted. // int ValidType (aString reqType) { int whichType = -1; bool foundType = false; for (int nDefined = 0; nDefined < NumStatsTypes; ++nDefined) { if (reqType == StatsTypes[nDefined].name) { foundType = true; whichType = nDefined; break; } } if (!foundType) { cerr << "Invalid statistics type: " << reqType << '\n'; BoxLib::Abort(); } return whichType; } #endif ccseapps-2.5/CCSEApps/iamrlib/Godunov.cpp0000644000175000017500000013652711634153073021441 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: Godunov.cpp,v 1.34 2003/02/19 21:43:52 almgren Exp $ // // // Godunov is the object which calculates advective terms for iamr. // #include #include #include #include #include #include #include #include #include #include #define GEOM_GROW 1 #define HYP_GROW 3 #define XVEL 0 #define YVEL 1 #define ZVEL 2 int Godunov::verbose = 0; int Godunov::slope_order = 4; int Godunov::use_forces_in_trans = 0; const int use_unlimited_slopes_DEF = 0; // // Construct the Godunov Object. // Godunov::Godunov () : max_1d(0) { read_params(); // // Set to 512 initiallly. // ZeroScratch(); SetScratch(512); } // // Size the 1D workspace explicitly. // Godunov::Godunov (int max_size) : max_1d(max_size) { read_params(); ZeroScratch(); SetScratch(max_size); } // // Read parameters from input file and command line. // void Godunov::read_params () { // // Read parameters from input file and command line. // ParmParse pp("godunov"); pp.query("v",verbose); pp.query("slope_order",slope_order); #if (BL_SPACEDIM==2) BL_ASSERT(slope_order==1 || slope_order==2 || slope_order==4); #else BL_ASSERT(slope_order==1 || slope_order==4); #endif pp.query("use_forces_in_trans",use_forces_in_trans); int use_unlimited_slopes=use_unlimited_slopes_DEF; pp.query("use_unlimited_slopes",use_unlimited_slopes); FORT_SET_PARAMS(slope_order,use_unlimited_slopes); } // // Set 1d scratch space as empty. // void Godunov::ZeroScratch () { D_TERM(stxlo=0;, stylo=0;, stzlo=0;); D_TERM(stxhi=0;, styhi=0;, stzhi=0;); D_TERM(slxscr=0;, slyscr=0;, slzscr=0;); } // // Initialize 1d scratch space to a bogus value. // void Godunov::SetBogusScratch () { #ifndef NDEBUG const Real bogus_value = 1.e200; for (int i = 0 ; i < scr_size ; i++) { D_TERM(stxlo[i]=bogus_value;, stylo[i]=bogus_value;, stzlo[i]=bogus_value;); D_TERM(stxhi[i]=bogus_value;, styhi[i]=bogus_value;, stzhi[i]=bogus_value;); D_TERM(slxscr[i]=bogus_value;, slyscr[i]=bogus_value;, slzscr[i]=bogus_value;); } #endif /*NDEBUG*/ } // // Set 1d scratch space. // void Godunov::SetScratch (int max_size) { // // Set sizing parameters. // if (max_size <= max_1d) return; else max_1d = std::max(max_1d,max_size); scr_size = (max_size+2*HYP_GROW)*4; // // Get rid of the old scratch space. // RemScratch(); // // Construct arrays. // D_TERM(stxlo = new Real[scr_size];, stylo = new Real[scr_size];, stzlo = new Real[scr_size];); D_TERM(stxhi = new Real[scr_size];, styhi = new Real[scr_size];, stzhi = new Real[scr_size];); D_TERM(slxscr = new Real[scr_size];, slyscr = new Real[scr_size];, slzscr = new Real[scr_size];); } // // Remove 1D scratch space. // void Godunov::RemScratch () { D_TERM(delete [] stxlo;, delete [] stylo;, delete [] stzlo;); D_TERM(delete [] stxhi;, delete [] styhi;, delete [] stzhi;); D_TERM(delete [] slxscr;, delete [] slyscr;, delete [] slzscr;); } // // Destructor destroys work arrays. // Godunov::~Godunov () { RemScratch(); } // // Set up the farrayboxes for computing edge states, This function // returns, the Farrayboxes where the fluxes are stored as these // are used in NavierStokes. // // It also computes the transverse advective velocities. // // The amount of workspace needed in FArrayBox work is currently 2*SDIM+1. // void Godunov::Setup (const Box& grd, const Real* dx, Real dt, int velpred, FArrayBox& xflux, const int* ubc, FArrayBox& yflux, const int* vbc, #if (BL_SPACEDIM == 3) FArrayBox& zflux, const int* wbc, #endif FArrayBox& U, FArrayBox& rho, const FArrayBox& tforces) { BL_ASSERT(rho.nComp() == 1); BL_ASSERT(U.nComp() >= BL_SPACEDIM); // // Compute the edge boxes. // D_TERM(xflux_bx = grd; xflux_bx.surroundingNodes(0);, yflux_bx = grd; yflux_bx.surroundingNodes(1);, zflux_bx = grd; zflux_bx.surroundingNodes(2);); // // Create storage for fluxes. // if (!velpred) { D_TERM(xflux.resize(xflux_bx,1);, yflux.resize(yflux_bx,1);, zflux.resize(zflux_bx,1);); } // // Ensure 1D scratch space is large enough. // SetScratch(BoxLib::grow(grd,HYP_GROW).longside()); // // Create the advective velocities and FAB workspace for GODUNOV Box. // work_bx = BoxLib::grow(grd,1); work.resize(work_bx,2*BL_SPACEDIM+1); D_TERM(uad.resize(work_bx,1);, vad.resize(work_bx,1);, wad.resize(work_bx,1);); SetBogusScratch(); // // Test the cell-centered velocities. // // Real u_max[3]; // test_u_rho( S, rho, grd, dx, dt, u_max ); // // Create the bounds and pointers. // const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const int *u_lo = U.loVect(); const int *u_hi = U.hiVect(); const int *w_lo = work.loVect(); const int *w_hi = work.hiVect(); const Real *u_dat = U.dataPtr(XVEL); const Real *uad_dat = uad.dataPtr(); const Real *v_dat = U.dataPtr(YVEL); const Real *vad_dat = vad.dataPtr(); #if (BL_SPACEDIM == 3) const Real *w_dat = U.dataPtr(ZVEL); const Real *wad_dat = wad.dataPtr(); const Real *xhi_dat = work.dataPtr(1); const Real *yhi_dat = work.dataPtr(2); const Real *zhi_dat = work.dataPtr(3); const Real *slx_dat = work.dataPtr(4); const Real *sly_dat = work.dataPtr(5); const Real *slz_dat = work.dataPtr(6); #else const Real *xhi_dat = work.dataPtr(1); const Real *yhi_dat = work.dataPtr(2); const Real *slx_dat = work.dataPtr(3); const Real *sly_dat = work.dataPtr(4); #endif const Real* tforcedat = 0; if (use_forces_in_trans) { tforcedat = tforces.dataPtr(); } // // Compute the transverse velocities. // FORT_TRANSVEL(u_dat, uad_dat, xhi_dat, slx_dat, ubc, slxscr, v_dat, vad_dat, yhi_dat, sly_dat, vbc, slyscr, #if (BL_SPACEDIM == 3) w_dat, wad_dat, zhi_dat, slz_dat, wbc, slzscr, #endif ARLIM(u_lo), ARLIM(u_hi), ARLIM(w_lo), ARLIM(w_hi), lo, hi, &dt, dx, &use_forces_in_trans, tforcedat); } // // Advection functions follow. // // // Compute the edge states using the advective transverse velocities // The amount of workspace needed in FArrayBox work is currently 2*SDIM+1. // void Godunov::edge_states (const Box& grd, const Real* dx, Real dt, int velpred, FArrayBox& uedge, FArrayBox& stx, FArrayBox& vedge, FArrayBox& sty, #if (BL_SPACEDIM == 3) FArrayBox& wedge, FArrayBox& stz, #endif FArrayBox& U, FArrayBox& S, FArrayBox& tforces, FArrayBox& divu, int fab_ind, int state_ind, const int* bc, int iconserv, AdvectionScheme advection_scheme) { #if (BL_SPACEDIM == 3) BL_ASSERT(advection_scheme != BDS); #endif if (advection_scheme == PRE_MAC) edge_states_orig(grd,dx,dt,velpred,uedge,stx,vedge,sty, #if (BL_SPACEDIM == 3) wedge,stz, #endif U,S,tforces,fab_ind,state_ind,bc); if (advection_scheme == FPU) edge_states_fpu(grd,dx,dt,velpred,uedge,stx,vedge,sty, #if (BL_SPACEDIM == 3) wedge,stz, #endif S,tforces,divu,fab_ind,state_ind,bc,iconserv); #if (BL_SPACEDIM == 2) if (advection_scheme == BDS) edge_states_bds(grd,dx,dt,velpred,uedge,stx,vedge,sty, S,tforces,divu,fab_ind,state_ind,bc,iconserv); #endif } void Godunov::edge_states_orig (const Box& grd, const Real* dx, Real dt, int velpred, FArrayBox& uedge, FArrayBox& stx, FArrayBox& vedge, FArrayBox& sty, #if (BL_SPACEDIM == 3) FArrayBox& wedge, FArrayBox& stz, #endif FArrayBox& U, FArrayBox& S, FArrayBox& tforces, int fab_ind, int state_ind, const int* bc) { // // Error block. // BL_ASSERT(S.box().contains(work_bx)); BL_ASSERT(U.nComp() >= BL_SPACEDIM); BL_ASSERT(S.nComp() >= fab_ind ); BL_ASSERT(tforces.nComp() >= fab_ind ); BL_ASSERT(uedge.nComp() >= 1 ); BL_ASSERT(stx.nComp() >= 1 ); BL_ASSERT(vedge.nComp() >= 1 ); BL_ASSERT(sty.nComp() >= 1 ); #if (BL_SPACEDIM == 3) BL_ASSERT(wedge.nComp() >= 1 ); BL_ASSERT(stz.nComp() >= 1 ); #endif // // Create the bounds and pointers. // const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const int *s_lo = S.loVect(); const int *s_hi = S.hiVect(); const int *ww_lo = work.loVect(); const int *ww_hi = work.hiVect(); const Real *s_dat = S.dataPtr(fab_ind); const Real *u_dat = U.dataPtr(XVEL); const Real *v_dat = U.dataPtr(YVEL); const Real *tfr_dat = tforces.dataPtr(fab_ind); const Real *uad_dat = uad.dataPtr(); const Real *vad_dat = vad.dataPtr(); const Real *stx_dat = stx.dataPtr(); const Real *sty_dat = sty.dataPtr(); // // Set work space to bogus values. // SetBogusScratch(); #if (BL_SPACEDIM == 3) const Real *w_dat = U.dataPtr(ZVEL); const Real *wad_dat = wad.dataPtr(); const Real *stz_dat = stz.dataPtr(); const Real *xhi_dat = work.dataPtr(0); const Real *yhi_dat = work.dataPtr(0); const Real *zhi_dat = work.dataPtr(0); const Real *xlo_dat = work.dataPtr(1); const Real *ylo_dat = work.dataPtr(2); const Real *zlo_dat = work.dataPtr(3); const Real *slx_dat = work.dataPtr(4); const Real *sly_dat = work.dataPtr(5); const Real *slz_dat = work.dataPtr(6); #else const Real *xhi_dat = work.dataPtr(0); const Real *yhi_dat = work.dataPtr(0); const Real *xlo_dat = work.dataPtr(1); const Real *ylo_dat = work.dataPtr(2); const Real *slx_dat = work.dataPtr(3); const Real *sly_dat = work.dataPtr(4); #endif // // C component indices starts from 0, Fortran from 1 // int fort_ind = state_ind+1; FORT_ESTATE(s_dat, tfr_dat, ARLIM(s_lo), ARLIM(s_hi), u_dat, xlo_dat, xhi_dat, slx_dat, uad_dat, slxscr, stxlo, stxhi, uedge.dataPtr(), ARLIM(uedge.loVect()), ARLIM(uedge.hiVect()), stx.dataPtr(), ARLIM( stx.loVect()), ARLIM( stx.hiVect()), v_dat, ylo_dat, yhi_dat, sly_dat, vad_dat, slyscr, stylo, styhi, vedge.dataPtr(), ARLIM(vedge.loVect()), ARLIM(vedge.hiVect()), sty.dataPtr(), ARLIM( sty.loVect()), ARLIM( sty.hiVect()), #if (BL_SPACEDIM == 3) w_dat, zlo_dat, zhi_dat, slz_dat, wad_dat, slzscr, stzlo, stzhi, wedge.dataPtr(), ARLIM(wedge.loVect()), ARLIM(wedge.hiVect()), stz.dataPtr(), ARLIM( stz.loVect()), ARLIM( stz.hiVect()), #endif ARLIM(ww_lo), ARLIM(ww_hi), bc, lo, hi, &dt, dx, &fort_ind, &velpred, &use_forces_in_trans); } void Godunov::edge_states_fpu (const Box& grd, const Real* dx, Real dt, int velpred, FArrayBox& uedge, FArrayBox& stx, FArrayBox& vedge, FArrayBox& sty, #if (BL_SPACEDIM == 3) FArrayBox& wedge, FArrayBox& stz, #endif FArrayBox& S, FArrayBox& tforces, FArrayBox& divu, int fab_ind, int state_ind, const int* bc, int iconserv) { // // Error block. // BL_ASSERT(S.box().contains(work_bx)); BL_ASSERT(S.nComp() >= fab_ind ); BL_ASSERT(tforces.nComp() >= fab_ind ); BL_ASSERT(uedge.nComp() >= 1 ); BL_ASSERT(stx.nComp() >= 1 ); BL_ASSERT(vedge.nComp() >= 1 ); BL_ASSERT(sty.nComp() >= 1 ); #if (BL_SPACEDIM == 3) BL_ASSERT(wedge.nComp() >= 1 ); BL_ASSERT(stz.nComp() >= 1 ); #endif // // Create the bounds and pointers. // const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const int *s_lo = S.loVect(); const int *s_hi = S.hiVect(); const int *ww_lo = work.loVect(); const int *ww_hi = work.hiVect(); const Real *s_dat = S.dataPtr(fab_ind); const Real *tfr_dat = tforces.dataPtr(fab_ind); const Real *divu_dat = divu.dataPtr(); // // Set work space to bogus values. // SetBogusScratch(); #if (BL_SPACEDIM == 3) const Real *xhi_dat = work.dataPtr(0); const Real *yhi_dat = work.dataPtr(0); const Real *zhi_dat = work.dataPtr(0); const Real *xlo_dat = work.dataPtr(1); const Real *ylo_dat = work.dataPtr(2); const Real *zlo_dat = work.dataPtr(3); const Real *slx_dat = work.dataPtr(4); const Real *sly_dat = work.dataPtr(5); const Real *slz_dat = work.dataPtr(6); #else const Real *xhi_dat = work.dataPtr(0); const Real *yhi_dat = work.dataPtr(0); const Real *xlo_dat = work.dataPtr(1); const Real *ylo_dat = work.dataPtr(2); const Real *slx_dat = work.dataPtr(3); const Real *sly_dat = work.dataPtr(4); #endif // // C component indices starts from 0, Fortran from 1 // int fort_ind = state_ind+1; if (velpred == 1) BoxLib::Error("Call to ESTATE_FPU only valid for velpred = 0"); FORT_ESTATE_FPU(s_dat, tfr_dat, divu_dat, ARLIM(s_lo), ARLIM(s_hi), xlo_dat, xhi_dat, slx_dat, slxscr, stxlo, stxhi, uedge.dataPtr(), ARLIM(uedge.loVect()), ARLIM(uedge.hiVect()), stx.dataPtr(), ARLIM(stx.loVect()), ARLIM(stx.hiVect()), ylo_dat, yhi_dat, sly_dat, slyscr, stylo, styhi, vedge.dataPtr(), ARLIM(vedge.loVect()), ARLIM(vedge.hiVect()), sty.dataPtr(), ARLIM(sty.loVect()), ARLIM(sty.hiVect()), #if (BL_SPACEDIM == 3) zlo_dat, zhi_dat, slz_dat, slzscr, stzlo, stzhi, wedge.dataPtr(), ARLIM(wedge.loVect()), ARLIM(wedge.hiVect()), stz.dataPtr(), ARLIM(stz.loVect()), ARLIM(stz.hiVect()), #endif ARLIM(ww_lo), ARLIM(ww_hi), bc, lo, hi, &dt, dx, &fort_ind, &use_forces_in_trans, &iconserv); } void Godunov::edge_states_bds (const Box& grd, const Real* dx, Real dt, int velpred, FArrayBox& uedge, FArrayBox& stx, FArrayBox& vedge, FArrayBox& sty, #if (BL_SPACEDIM == 3) FArrayBox& wedge, FArrayBox& stz, #endif FArrayBox& S, FArrayBox& tforces, FArrayBox& divu, int fab_ind, int state_ind, const int* bc, int iconserv) { // // Error block. // BL_ASSERT(S.box().contains(work_bx)); BL_ASSERT(S.nComp() >= fab_ind ); BL_ASSERT(tforces.nComp() >= fab_ind ); BL_ASSERT(uedge.nComp() >= 1 ); BL_ASSERT(stx.nComp() >= 1 ); BL_ASSERT(vedge.nComp() >= 1 ); BL_ASSERT(sty.nComp() >= 1 ); #if (BL_SPACEDIM == 3) BL_ASSERT(wedge.nComp() >= 1 ); BL_ASSERT(stz.nComp() >= 1 ); #endif // // Create the bounds and pointers. // const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const int *s_lo = S.loVect(); const int *s_hi = S.hiVect(); const int *ww_lo = work.loVect(); const int *ww_hi = work.hiVect(); const Real *s_dat = S.dataPtr(fab_ind); const Real *tfr_dat = tforces.dataPtr(fab_ind); const Real *divu_dat = divu.dataPtr(); // // Set work space to bogus values. // SetBogusScratch(); #if (BL_SPACEDIM == 3) const Real *xhi_dat = work.dataPtr(0); const Real *yhi_dat = work.dataPtr(0); const Real *zhi_dat = work.dataPtr(0); const Real *xlo_dat = work.dataPtr(1); const Real *ylo_dat = work.dataPtr(2); const Real *zlo_dat = work.dataPtr(3); const Real *slx_dat = work.dataPtr(4); const Real *sly_dat = work.dataPtr(5); const Real *slz_dat = work.dataPtr(6); #else const Real *xhi_dat = work.dataPtr(0); const Real *yhi_dat = work.dataPtr(0); const Real *xlo_dat = work.dataPtr(1); const Real *ylo_dat = work.dataPtr(2); const Real *slx_dat = work.dataPtr(3); const Real *sly_dat = work.dataPtr(4); #endif // // C component indices starts from 0, Fortran from 1 // int fort_ind = state_ind+1; if (velpred == 1) BoxLib::Error("Call to ESTATE_BDS only valid for velpred = 0"); #if (BL_SPACEDIM == 2) FORT_ESTATE_BDS(s_dat, tfr_dat, divu_dat, ARLIM(s_lo), ARLIM(s_hi), xlo_dat, xhi_dat, slx_dat, slxscr, stxlo, stxhi, uedge.dataPtr(), ARLIM(uedge.loVect()), ARLIM(uedge.hiVect()), stx.dataPtr(), ARLIM(stx.loVect()), ARLIM(stx.hiVect()), ylo_dat, yhi_dat, sly_dat, slyscr, stylo, styhi, vedge.dataPtr(), ARLIM(vedge.loVect()), ARLIM(vedge.hiVect()), sty.dataPtr(), ARLIM(sty.loVect()), ARLIM(sty.hiVect()), #if (BL_SPACEDIM == 3) zlo_dat, zhi_dat, slz_dat, slzscr, stzlo, stzhi, wedge.dataPtr(), ARLIM(wedge.loVect()), ARLIM(wedge.hiVect()), stz.dataPtr(), ARLIM(stz.loVect()), ARLIM(stz.hiVect()), #endif ARLIM(ww_lo), ARLIM(ww_hi), bc, lo, hi, &dt, dx, &fort_ind, &use_forces_in_trans, &iconserv); #endif } // // Compute the edge states for The Mac projection. // FArrayBox work sized as in edge_states. // void Godunov::ComputeUmac (const Box& grd, const Real* dx, Real dt, FArrayBox& umac, const int* ubc, FArrayBox& vmac, const int* vbc, #if (BL_SPACEDIM == 3) FArrayBox& wmac, const int* wbc, #endif FArrayBox& U, FArrayBox& tforces) { int velpred = 1; // // 2D calls. // #if (BL_SPACEDIM == 2) edge_states_orig(grd, dx, dt, velpred, umac, umac, vmac, vmac, U, U, tforces, XVEL, XVEL, ubc); edge_states_orig(grd, dx, dt, velpred, umac, umac, vmac, vmac, U, U, tforces, YVEL, YVEL, vbc); #endif // // 3D calls. // #if (BL_SPACEDIM == 3) edge_states_orig(grd, dx, dt, velpred, umac, umac, vmac, vmac, wmac, wmac, U, U, tforces, XVEL, XVEL, ubc); edge_states_orig(grd, dx, dt, velpred, umac, umac, vmac, vmac, wmac, wmac, U, U, tforces, YVEL, YVEL, vbc); edge_states_orig(grd, dx, dt, velpred, umac, umac, vmac, vmac, wmac, wmac, U, U, tforces, ZVEL, ZVEL, wbc); #endif } // // Advect a state component. // This routine assumes uad,vad,wad have been precomputed. // FArrayBox work sized as in edge_states. // void Godunov::AdvectState (const Box& grd, const Real* dx, Real dt, FArrayBox& areax, FArrayBox& uedge, FArrayBox& xflux, FArrayBox& areay, FArrayBox& vedge, FArrayBox& yflux, #if (BL_SPACEDIM == 3) FArrayBox& areaz, FArrayBox& wedge, FArrayBox& zflux, #endif FArrayBox& U, FArrayBox& S, FArrayBox& tforces, FArrayBox& divu, int fab_ind, FArrayBox& aofs, int aofs_ind, int iconserv, int state_ind, const int* bc, AdvectionScheme scheme, FArrayBox& vol) { int velpred = 0; // // Compute edge states for an advected quantity. // edge_states(grd, dx, dt, velpred, uedge, xflux, vedge, yflux, #if (BL_SPACEDIM == 3) wedge, zflux, #endif U, S, tforces, divu, fab_ind, state_ind, bc, iconserv, scheme); // // Compute the advective tendency. // ComputeAofs( grd, areax, uedge, xflux, areay, vedge, yflux, #if (BL_SPACEDIM == 3) areaz, wedge, zflux, #endif vol, aofs, aofs_ind, iconserv); } // // Compute the advective derivative from fluxes. // void Godunov::ComputeAofs (const Box& grd, FArrayBox& areax, FArrayBox& uedge, FArrayBox& xflux, FArrayBox& areay, FArrayBox& vedge, FArrayBox& yflux, #if (BL_SPACEDIM == 3) FArrayBox& areaz, FArrayBox& wedge, FArrayBox& zflux, #endif FArrayBox& vol, FArrayBox& aofs, int aofs_ind, int iconserv ) { const int *lo = grd.loVect(); const int *hi = grd.hiVect(); FORT_ADV_FORCING( aofs.dataPtr(aofs_ind),ARLIM(aofs.loVect()), ARLIM(aofs.hiVect()), xflux.dataPtr(), ARLIM(xflux.loVect()), ARLIM(xflux.hiVect()), uedge.dataPtr(), ARLIM(uedge.loVect()), ARLIM(uedge.hiVect()), areax.dataPtr(), ARLIM(areax.loVect()), ARLIM(areax.hiVect()), yflux.dataPtr(), ARLIM(yflux.loVect()), ARLIM(yflux.hiVect()), vedge.dataPtr(), ARLIM(vedge.loVect()), ARLIM(vedge.hiVect()), areay.dataPtr(), ARLIM(areay.loVect()), ARLIM(areay.hiVect()), #if (BL_SPACEDIM == 3) zflux.dataPtr(), ARLIM(zflux.loVect()), ARLIM(zflux.hiVect()), wedge.dataPtr(), ARLIM(wedge.loVect()), ARLIM(wedge.hiVect()), areaz.dataPtr(), ARLIM(areaz.loVect()), ARLIM(areaz.hiVect()), #endif vol.dataPtr(), ARLIM(vol.loVect()), ARLIM(vol.hiVect()), lo, hi, &iconserv); } // // Sync advect a state component. // This routine assumes uad,vad,wad have been precomputed. // void Godunov::SyncAdvect (const Box& grd, const Real* dx, Real dt, int level, FArrayBox& areax, FArrayBox& uedge, FArrayBox& ucorr, FArrayBox& xflux, FArrayBox& areay, FArrayBox& vedge, FArrayBox& vcorr, FArrayBox& yflux, #if (BL_SPACEDIM == 3) FArrayBox& areaz, FArrayBox& wedge, FArrayBox& wcorr, FArrayBox& zflux, #endif FArrayBox& U, FArrayBox& S, FArrayBox& tforces, FArrayBox& divu, int fab_ind, FArrayBox& sync, int sync_ind, int iconserv, int state_ind, const int* bc, AdvectionScheme scheme, FArrayBox& vol) { int velpred = 0; // // Error block. // BL_ASSERT(S.box().contains(work_bx)); BL_ASSERT(S.nComp() >= BL_SPACEDIM); BL_ASSERT(S.nComp() >= fab_ind ); BL_ASSERT(tforces.nComp() >= fab_ind ); BL_ASSERT(sync.nComp() >= sync_ind ); BL_ASSERT(ucorr.box() == xflux_bx ); BL_ASSERT(ucorr.nComp() >= 1 ); BL_ASSERT(vcorr.box() == yflux_bx ); BL_ASSERT(vcorr.nComp() >= 1 ); #if (BL_SPACEDIM == 3) BL_ASSERT(wcorr.box() == zflux_bx ); BL_ASSERT(wcorr.nComp() >= 1 ); #endif // // Compute the edge states. // edge_states(grd, dx, dt, velpred, uedge, xflux, vedge, yflux, #if (BL_SPACEDIM == 3) wedge, zflux, #endif U, S, tforces, divu, fab_ind, state_ind, bc, iconserv, scheme); // // Compute the advective tendency for the mac sync. // ComputeSyncAofs(grd, areax, ucorr, xflux, areay, vcorr, yflux, #if (BL_SPACEDIM == 3) areaz, wcorr, zflux, #endif vol, sync, sync_ind, iconserv); } // // Compute the advective derivative of corrective fluxes for the mac sync. // void Godunov::ComputeSyncAofs (const Box& grd, FArrayBox& areax, FArrayBox& ucorr, FArrayBox& xflux, FArrayBox& areay, FArrayBox& vcorr, FArrayBox& yflux, #if (BL_SPACEDIM == 3) FArrayBox& areaz, FArrayBox& wcorr, FArrayBox& zflux, #endif FArrayBox& vol, FArrayBox& sync, int sync_ind, int iconserv) { const int *lo = grd.loVect(); const int *hi = grd.hiVect(); FORT_SYNC_ADV_FORCING(sync.dataPtr(sync_ind), ARLIM(sync.loVect()), ARLIM(sync.hiVect()), xflux.dataPtr(),ARLIM(xflux.loVect()),ARLIM(xflux.hiVect()), ucorr.dataPtr(),ARLIM(ucorr.loVect()),ARLIM(ucorr.hiVect()), areax.dataPtr(),ARLIM(areax.loVect()),ARLIM(areax.hiVect()), yflux.dataPtr(),ARLIM(yflux.loVect()),ARLIM(yflux.hiVect()), vcorr.dataPtr(),ARLIM(vcorr.loVect()),ARLIM(vcorr.hiVect()), areay.dataPtr(),ARLIM(areay.loVect()),ARLIM(areay.hiVect()), #if (BL_SPACEDIM == 3) zflux.dataPtr(),ARLIM(zflux.loVect()),ARLIM(zflux.hiVect()), wcorr.dataPtr(),ARLIM(wcorr.loVect()),ARLIM(wcorr.hiVect()), areaz.dataPtr(),ARLIM(areaz.loVect()),ARLIM(areaz.hiVect()), #endif vol.dataPtr(), ARLIM(vol.loVect()), ARLIM(vol.hiVect()), lo, hi, &iconserv); } // // Correct a scalar for under-over shoots. // void Godunov::ScalMinMax (FArrayBox& Sold, FArrayBox& Snew, int ind, const int* bc, const Box& grd) { const int *slo = Sold.loVect(); const int *shi = Sold.hiVect(); const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const Real *Sold_dat = Sold.dataPtr(ind); const Real *Snew_dat = Snew.dataPtr(ind); #if (BL_SPACEDIM == 3) Box flatbox(grd); int zlen = flatbox.length()[BL_SPACEDIM-1]; flatbox.growHi(BL_SPACEDIM-1,3-zlen); FArrayBox smin(flatbox,1); FArrayBox smax(flatbox,1); const Real *smin_dat = smin.dataPtr(); const Real *smax_dat = smax.dataPtr(); #endif FORT_SCALMINMAX (Sold_dat, ARLIM(slo), ARLIM(shi), Snew_dat, ARLIM(slo), ARLIM(shi), #if (BL_SPACEDIM == 3) smin_dat, smax_dat, ARLIM(lo), ARLIM(hi), #endif lo, hi, bc); } // // Diagnostic functions follow // // // Estimate the maximum allowable timestep at a cell center. // Real Godunov::estdt (FArrayBox& U, FArrayBox& tforces, FArrayBox& rho, const Box& grd, const Real* dx, Real cfl, Real* u_max) { BL_ASSERT( U.nComp() >= BL_SPACEDIM ); BL_ASSERT( tforces.nComp() >= BL_SPACEDIM ); BL_ASSERT( rho.nComp() == 1 ); const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const int *vlo = U.loVect(); const int *vhi = U.hiVect(); const int *tlo = tforces.loVect(); const int *thi = tforces.hiVect(); const int *rlo = rho.loVect(); const int *rhi = rho.hiVect(); const Real *Udat = U.dataPtr(); const Real *tfdat = tforces.dataPtr(); const Real *rdat = rho.dataPtr(); Real dt; FORT_ESTDT(Udat, ARLIM(vlo), ARLIM(vhi), tfdat, ARLIM(tlo), ARLIM(thi), rdat, ARLIM(rlo), ARLIM(rhi), lo, hi, &dt, dx, &cfl, u_max); return dt; } // // Estimate the extrema of cell-centered us and rho. // Real Godunov::test_u_rho (FArrayBox& U, FArrayBox& rho, const Box& grd, const Real* dx, const Real dt, const Real* u_max) { BL_ASSERT(U.nComp() >= BL_SPACEDIM); BL_ASSERT(rho.nComp() == 1 ); const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const int *vlo = U.loVect(); const int *vhi = U.hiVect(); const int *rlo = rho.loVect(); const int *rhi = rho.hiVect(); const Real *rh = rho.dataPtr(); D_TERM(const Real *u = U.dataPtr(XVEL);, const Real *v = U.dataPtr(YVEL);, const Real *w = U.dataPtr(ZVEL);); Real cflmax = 0; FORT_TEST_U_RHO(u, ARLIM(vlo), ARLIM(vhi), v, ARLIM(vlo), ARLIM(vhi), #if (BL_SPACEDIM == 3) w, ARLIM(vlo), ARLIM(vhi), #endif rh, ARLIM(rlo), ARLIM(rhi), lo, hi, &dt, dx, &cflmax, u_max, &verbose); return cflmax; } // // Estimate the extrema of umac edge velocities and rho. // Real Godunov::test_umac_rho (FArrayBox& umac, FArrayBox& vmac, #if (BL_SPACEDIM == 3) FArrayBox& wmac, #endif FArrayBox& rho, const Box& grd, const Real* dx, const Real dt, const Real* u_max) { // // Test block. // D_TERM(BL_ASSERT(umac.nComp() == 1);, BL_ASSERT(vmac.nComp() == 1);, BL_ASSERT(wmac.nComp() == 1);); BL_ASSERT(rho.nComp() == 1); const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const int *ulo = umac.loVect(); const int *uhi = umac.hiVect(); const int *vlo = vmac.loVect(); const int *vhi = vmac.hiVect(); const int *rlo = rho.loVect(); const int *rhi = rho.hiVect(); const Real *um = umac.dataPtr(); const Real *vm = vmac.dataPtr(); const Real *rh = rho.dataPtr(); #if (BL_SPACEDIM == 3) const int *wlo = wmac.loVect(); const int *whi = wmac.hiVect(); const Real *wm = wmac.dataPtr(); #endif Real cfl; FORT_TEST_UMAC_RHO(um, ARLIM(ulo), ARLIM(uhi), vm, ARLIM(vlo), ARLIM(vhi), #if (BL_SPACEDIM == 3) wm, ARLIM(wlo), ARLIM(whi), #endif rh, ARLIM(rlo), ARLIM(rhi), lo, hi, &dt, dx, &cfl, u_max); return cfl; } // // Source term functions follow // // // Compute the update rule, this is useful for 1st order RK. // // psi^n+1 = psi^n + dt*tf^n // void Godunov::Add_tf (FArrayBox& Sold, FArrayBox& Snew, int start_ind, int num_comp, FArrayBox& tforces, int tf_ind, const Box& grd, Real dt) { BL_ASSERT(Snew.nComp() >= start_ind + num_comp); BL_ASSERT(Sold.nComp() >= start_ind + num_comp); BL_ASSERT(tforces.nComp() >= tf_ind + num_comp); const int *slo = Sold.loVect(); const int *shi = Sold.hiVect(); const int *tlo = tforces.loVect(); const int *thi = tforces.hiVect(); const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const Real *SOdat = Sold.dataPtr(start_ind); const Real *SNdat = Snew.dataPtr(start_ind); const Real *TFdat = tforces.dataPtr(tf_ind); FORT_UPDATE_TF(SOdat, ARLIM(slo), ARLIM(shi), SNdat, ARLIM(slo), ARLIM(shi), TFdat, ARLIM(tlo), ARLIM(thi), lo, hi, &dt, &num_comp); } // // Correct the 1st order RK to 2nd order via // // psi^n+1 = psi^* + (dt/2)*(tf^* - tf^n) // void Godunov::Correct_tf (FArrayBox& Sstar, FArrayBox& Snp1, int start_ind, int num_comp, FArrayBox& tfstar, FArrayBox& tfn, int tf_ind, const Box& grd, Real dt) { BL_ASSERT(Snp1.nComp() >= start_ind + num_comp); BL_ASSERT(Sstar.nComp() >= start_ind + num_comp); BL_ASSERT(tfstar.nComp() >= tf_ind + num_comp); BL_ASSERT(tfn.nComp() >= tf_ind + num_comp); const int *slo = Sstar.loVect(); const int *shi = Sstar.hiVect(); const int *tlo = tfstar.loVect(); const int *thi = tfstar.hiVect(); const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const Real *SSdat = Sstar.dataPtr(start_ind); const Real *SPdat = Snp1.dataPtr(start_ind); const Real *TSdat = tfstar.dataPtr(tf_ind); const Real *TNdat = tfn.dataPtr(tf_ind); FORT_CORRECT_TF(SSdat, SPdat, ARLIM(slo), ARLIM(shi), TSdat, TNdat, ARLIM(tlo), ARLIM(thi), lo, hi, &dt, &num_comp); } // // Compute the update rule // // psi^n+1 = psi^n - dt*aofs + dt*tforces // void Godunov::Add_aofs_tf (FArrayBox& Sold, FArrayBox& Snew, int start_ind, int num_comp, FArrayBox& Aofs, int aofs_ind, FArrayBox& tforces, int tf_ind, const Box& grd, Real dt) { BL_ASSERT(Snew.nComp() >= start_ind + num_comp); BL_ASSERT(Sold.nComp() >= start_ind + num_comp); BL_ASSERT(Aofs.nComp() >= aofs_ind + num_comp); BL_ASSERT(tforces.nComp() >= tf_ind + num_comp); const int *slo = Sold.loVect(); const int *shi = Sold.hiVect(); const int *alo = Aofs.loVect(); const int *ahi = Aofs.hiVect(); const int *tlo = tforces.loVect(); const int *thi = tforces.hiVect(); const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const Real *SOdat = Sold.dataPtr(start_ind); const Real *SNdat = Snew.dataPtr(start_ind); const Real *AOdat = Aofs.dataPtr(aofs_ind); const Real *TFdat = tforces.dataPtr(tf_ind); FORT_UPDATE_AOFS_TF(SOdat, ARLIM(slo), ARLIM(shi), SNdat, ARLIM(slo), ARLIM(shi), AOdat, ARLIM(alo), ARLIM(ahi), TFdat, ARLIM(tlo), ARLIM(thi), lo, hi, &dt, &num_comp); } // // Compute the update rule for velocities // // psi^n+1 = psi^n - dt*aofs - dt*gp/rho + dt*tforces // void Godunov::Add_aofs_tf_gp (FArrayBox& Uold, FArrayBox& Unew, FArrayBox& Aofs, FArrayBox& tforces, FArrayBox& gp, FArrayBox& rho, const Box& grd, Real dt) { BL_ASSERT(Unew.nComp() >= BL_SPACEDIM); BL_ASSERT(Uold.nComp() >= BL_SPACEDIM); BL_ASSERT(Aofs.nComp() >= BL_SPACEDIM); BL_ASSERT(tforces.nComp() >= BL_SPACEDIM); BL_ASSERT(gp.nComp() == BL_SPACEDIM); BL_ASSERT(rho.nComp() == 1 ); const int *lo = grd.loVect(); const int *hi = grd.hiVect(); const int *ulo = Uold.loVect(); const int *uhi = Uold.hiVect(); const int *alo = Aofs.loVect(); const int *ahi = Aofs.hiVect(); const int *tlo = tforces.loVect(); const int *thi = tforces.hiVect(); const int *glo = gp.loVect(); const int *ghi = gp.hiVect(); const int *rlo = rho.loVect(); const int *rhi = rho.hiVect(); const Real *UOdat = Uold.dataPtr(); const Real *UNdat = Unew.dataPtr(); const Real *AOdat = Aofs.dataPtr(); const Real *TFdat = tforces.dataPtr(); const Real *GPdat = gp.dataPtr(); const Real *RHdat = rho.dataPtr(); FORT_UPDATE_AOFS_TF_GP(UOdat, ARLIM(ulo), ARLIM(uhi), UNdat, ARLIM(ulo), ARLIM(uhi), AOdat, ARLIM(alo), ARLIM(ahi), TFdat, ARLIM(tlo), ARLIM(thi), GPdat, ARLIM(glo), ARLIM(ghi), RHdat, ARLIM(rlo), ARLIM(rhi), lo, hi, &dt); } // // Compute total source term for velocities, weighted by rho. // // tforces = (tforces - gp)/rho // void Godunov::Sum_tf_gp (FArrayBox& tforces, FArrayBox& gp, FArrayBox& rho) { BL_ASSERT(rho.nComp() == 1); BL_ASSERT(tforces.nComp() >= BL_SPACEDIM); BL_ASSERT(gp.nComp() == BL_SPACEDIM); const int *tlo = tforces.loVect(); const int *thi = tforces.hiVect(); const int *glo = gp.loVect(); const int *ghi = gp.hiVect(); const int *rlo = rho.loVect(); const int *rhi = rho.hiVect(); const Real *TFdat = tforces.dataPtr(); const Real *GPdat = gp.dataPtr(); const Real *RHdat = rho.dataPtr(); FORT_SUM_TF_GP(TFdat, ARLIM(tlo), ARLIM(thi), GPdat, ARLIM(glo), ARLIM(ghi), RHdat, ARLIM(rlo), ARLIM(rhi), tlo, thi); } // // Compute total source term for velocities, weighted by rho. // // tforces = (tforces + visc - gp)/rho // void Godunov::Sum_tf_gp_visc (FArrayBox& tforces, FArrayBox& visc, FArrayBox& gp, FArrayBox& rho) { BL_ASSERT(rho.nComp() == 1); BL_ASSERT(tforces.nComp() >= BL_SPACEDIM); BL_ASSERT(visc.nComp() >= BL_SPACEDIM); BL_ASSERT(gp.nComp() == BL_SPACEDIM); const int *vlo = visc.loVect(); const int *vhi = visc.hiVect(); const int *tlo = tforces.loVect(); const int *thi = tforces.hiVect(); const int *glo = gp.loVect(); const int *ghi = gp.hiVect(); const int *rlo = rho.loVect(); const int *rhi = rho.hiVect(); const Real *TFdat = tforces.dataPtr(); const Real *VIdat = visc.dataPtr(); const Real *GPdat = gp.dataPtr(); const Real *RHdat = rho.dataPtr(); FORT_SUM_TF_GP_VISC(TFdat, ARLIM(tlo), ARLIM(thi), VIdat, ARLIM(vlo), ARLIM(vhi), GPdat, ARLIM(glo), ARLIM(ghi), RHdat, ARLIM(rlo), ARLIM(rhi), tlo, thi); } // // Compute total source term for scalars. Note for compatibility // The switch iconserv, determines the form of the total source term // // iconserv==1 => tforces = tforces - divU*S // // iconserv==0 => tforces = (tforces)/rho // void Godunov::Sum_tf_divu (FArrayBox& S, FArrayBox& tforces, int s_ind, int num_comp, FArrayBox& divu, FArrayBox& rho, int iconserv) { BL_ASSERT(S.nComp() >= s_ind+num_comp); BL_ASSERT(tforces.nComp() >= s_ind+num_comp); BL_ASSERT(divu.nComp() == 1 ); BL_ASSERT(rho.nComp() == 1 ); const int *slo = S.loVect(); const int *shi = S.hiVect(); const int *tlo = tforces.loVect(); const int *thi = tforces.hiVect(); const int *dlo = divu.loVect(); const int *dhi = divu.hiVect(); const int *rlo = rho.loVect(); const int *rhi = rho.hiVect(); const Real *Sdat = S.dataPtr(s_ind); const Real *TFdat = tforces.dataPtr(s_ind); const Real *DUdat = divu.dataPtr(); const Real *RHdat = rho.dataPtr(); FORT_SUM_TF_DIVU(Sdat, ARLIM(slo), ARLIM(shi), TFdat, ARLIM(tlo), ARLIM(thi), DUdat, ARLIM(dlo), ARLIM(dhi), RHdat, ARLIM(rlo), ARLIM(rhi), tlo, thi, &num_comp, &iconserv); } // // Compute total source term for scalars. Note for compatibility // The switch iconserv, determines the form of the total source term // // iconserv==1 => tforces = tforces + visc - divU*S // // iconserv==0 => tforces = (tforces+ visc)/rho // void Godunov::Sum_tf_divu_visc (FArrayBox& S, FArrayBox& tforces, int s_ind, int num_comp, FArrayBox& visc, int v_ind, FArrayBox& divu, FArrayBox& rho, int iconserv) { BL_ASSERT(S.nComp() >= s_ind+num_comp); BL_ASSERT(tforces.nComp() >= s_ind+num_comp); BL_ASSERT(divu.nComp() == 1 ); BL_ASSERT(visc.nComp() >= v_ind+num_comp); BL_ASSERT(rho.nComp() == 1 ); const int *slo = S.loVect(); const int *shi = S.hiVect(); const int *tlo = tforces.loVect(); const int *thi = tforces.hiVect(); const int *dlo = divu.loVect(); const int *dhi = divu.hiVect(); const int *vlo = visc.loVect(); const int *vhi = visc.hiVect(); const int *rlo = rho.loVect(); const int *rhi = rho.hiVect(); const Real *Sdat = S.dataPtr(s_ind); const Real *TFdat = tforces.dataPtr(s_ind); const Real *DUdat = divu.dataPtr(); const Real *VIdat = visc.dataPtr(v_ind); const Real *RHdat = rho.dataPtr(); FORT_SUM_TF_DIVU_VISC(Sdat, ARLIM(slo), ARLIM(shi), TFdat, ARLIM(tlo), ARLIM(thi), DUdat, ARLIM(dlo), ARLIM(dhi), VIdat, ARLIM(vlo), ARLIM(vhi), RHdat, ARLIM(rlo), ARLIM(rhi), tlo, thi, &num_comp, &iconserv); } bool Godunov::are_any(const Array& advectionType, const AdvectionForm testForm, const int sComp, const int nComp) { for (int comp = sComp; comp < sComp + nComp; ++comp) { if (advectionType[comp] == testForm) return true; } return false; } int Godunov::how_many(const Array& advectionType, const AdvectionForm testForm, const int sComp, const int nComp) { int counter = 0; for (int comp = sComp; comp < sComp + nComp; ++comp) { if (advectionType[comp] == testForm) ++counter; } return counter; } ccseapps-2.5/CCSEApps/iamrlib/MacOutFlowBC.H0000644000175000017500000000717411634153073021645 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MACOUTFLOWBC_H_ #define _MACOUTFLOWBC_H_ // // $Id: MacOutFlowBC.H,v 1.10 2003/02/21 22:49:10 car Exp $ // #include "FArrayBox.H" #include "Geometry.H" #include "Orientation.H" #include "OutFlowBC.H" // // This class solves the BL_SPACEDIM-1 dimensional problem for the mac // projection at the outflow face. It first extrapolates the interior values // to the outflow edge. Then, it solves using either back substitution or // a multigrid solver. If a multigrid solver is used, the problem is shifted // so that the last dimension is 1. // class MacOutFlowBC : public OutFlowBC { public: MacOutFlowBC (); void computeBC (FArrayBox velMF[][2*BL_SPACEDIM], FArrayBox divuMF[2*BL_SPACEDIM], FArrayBox rhoMF[2*BL_SPACEDIM], FArrayBox phiMF[2*BL_SPACEDIM], const Geometry& geom, Orientation* outFaces, int numOutFlowFaces, Real gravity = 0.0); protected: #if (BL_SPACEDIM == 3) void computeCoefficients (FArrayBox& rhs, FArrayBox* beta, FArrayBox& ccExt, Box& faceBox, Real* dxFiltered, int* isPeriodic); // // Static data. // static Real tol; static Real abs_tol; #endif }; #if (BL_SPACEDIM == 3) // // This class is a BL_SPACEDIM-1 multigrid solver for the mac projection. // class MacOutFlowBC_MG : public OutFlowBC_MG { public: MacOutFlowBC_MG (Box& Domain, FArrayBox* Phi, FArrayBox* Rhs, FArrayBox* Resid, FArrayBox* Beta, Real* H, int* IsPeriodic); ~MacOutFlowBC_MG (); static int Verbose (); static int MaxIters (); protected: void Restrict (); void interpolate (); Real residual (); void step (int nSteps); void gsrb (int nSteps); // // Static data. // static int verbose; static bool useCGbottomSolver; static Real cg_tol; static Real cg_abs_tol; static Real cg_max_jump; static int cg_maxiter; static int maxIters; }; #endif #endif ccseapps-2.5/CCSEApps/iamrlib/ViscBndry.cpp0000644000175000017500000000663511634153073021717 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ViscBndry.cpp,v 1.18 2001/08/09 22:42:00 marc Exp $ // #include #include #include void ViscBndry::setBndryConds (const BCRec& bc, /*const*/ IntVect& ratio, int comp) { // // NOTE: ALL BCLOC VALUES ARE NOW DEFINED AS A LENGTH IN PHYSICAL // DIMENSIONS *RELATIVE* TO THE FACE, NOT IN ABSOLUTE PHYSICAL SPACE // const Real* dx = geom.CellSize(); const Box& domain = geom.Domain(); for (OrientationIter fi; fi; ++fi) { Array& bloc = bcloc[fi()]; Array< Array >& bctag = bcond[fi()]; int dir = fi().coordDir(); const Real delta = dx[dir]*ratio[dir]; int p_bc = (fi().isLow() ? bc.lo(dir) : bc.hi(dir)); for (int i = 0; i < boxes().size(); i++) { if (domain[fi()] == boxes()[i][fi()] && !geom.isPeriodic(dir)) { // // All physical bc values are located on face. // if (p_bc == EXT_DIR) { bctag[i][comp] = LO_DIRICHLET; bloc[i] = 0.; } else if (p_bc == FOEXTRAP || p_bc == HOEXTRAP || p_bc == REFLECT_EVEN) { bctag[i][comp] = LO_NEUMANN; bloc[i] = 0.; } else if (p_bc == REFLECT_ODD) { bctag[i][comp] = LO_REFLECT_ODD; bloc[i] = 0.; } } else { // // Internal bndry. // bctag[i][comp] = LO_DIRICHLET; bloc[i] = 0.5*delta; } } } } void ViscBndry::setHomogValues (const BCRec& bc, /*const*/ IntVect& ratio) { setBndryConds(bc, ratio); for (OrientationIter fi; fi; ++fi) { for (FabSetIter fsi(bndry[fi()]); fsi.isValid(); ++fsi) { bndry[fi()][fsi].setVal(0); } } } ccseapps-2.5/CCSEApps/iamrlib/InflowForce/0000755000175000017500000000000011634153073021513 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/InflowForce/Make.package0000644000175000017500000000053611634153073023711 0ustar amckinstryamckinstryINFLOWFORCE_BASE=EXE ifeq ($(LBASE),iamr) INFLOWFORCE_BASE=LIB endif F$(INFLOWFORCE_BASE)_sources += FLUCTFILE.F F$(INFLOWFORCE_BASE)_headers += FLUCTFILE.H F$(INFLOWFORCE_BASE)_sources += INFL_FORCE_$(DIM)D.F F$(INFLOWFORCE_BASE)_sources += INFL_FORCE_F.F F$(INFLOWFORCE_BASE)_headers += INFL_FORCE_F.H F$(INFLOWFORCE_BASE)_headers += infl_frc.H ccseapps-2.5/CCSEApps/iamrlib/InflowForce/infl_frc.H0000644000175000017500000000267511634153073023420 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c ::: CPP defines to generalize the inflow forcing ::: c #define COMP_FLCTFILE 3 #define FLCT_XVEL 1 #define FLCT_YVEL 2 #define FLCT_ZVEL 3 #undef INFL_FRC_DIAGS ccseapps-2.5/CCSEApps/iamrlib/InflowForce/FLUCTFILE.F0000644000175000017500000002152711634153073023146 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: FLUCTFILE.F,v 1.5 2000/06/29 20:49:05 sstanley Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "SPACE.H" #include "CONSTANTS.H" #include "FLUCTFILE.H" c ::: ----------------------------------------------------------- c ::: This routine sets the values for the lo() and hi() arrays c ::: from the ARG_L1, ARG_H1, ... macros. This is done since c ::: it is more convenient to use the lo() and hi() arrays. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: DIMS(holder) => index extent of place holder array c ::: lo(3) <= lower index limits c ::: hi(3) <= upper index limits c ::: ----------------------------------------------------------- subroutine FF_SET_LOHI(FF_DIMS(holder), lo, hi) implicit none c c :::: Passed Variables :::: c integer FF_DIMDEC(holder) integer lo(3), hi(3) c c -------------------------------------- c :::: Set Values for lo() and hi() :::: c -------------------------------------- c lo(1) = FF_ARG_L1(holder) hi(1) = FF_ARG_H1(holder) lo(2) = FF_ARG_L2(holder) hi(2) = FF_ARG_H2(holder) lo(3) = FF_ARG_L3(holder) hi(3) = FF_ARG_H3(holder) c c return end c ::: ----------------------------------------------------------- c ::: This routine sets the values for the ARG_L1, ARG_H1, ... macros c ::: from the lo() and hi() arrays. This is done since c ::: it is more convenient to use the macros to dimension arrays. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: FF_DIMS(holder) <= index extent of place holder array c ::: lo(3) => lower index limits c ::: hi(3) => upper index limits c ::: ----------------------------------------------------------- subroutine FF_SET_ARGS(FF_DIMS(holder), lo, hi) implicit none c c :::: Passed Variables :::: c integer FF_DIMDEC(holder) integer lo(3), hi(3) c c -------------------------------------- c :::: Set Values for lo() and hi() :::: c -------------------------------------- c FF_ARG_L1(holder) = lo(1) FF_ARG_H1(holder) = hi(1) FF_ARG_L2(holder) = lo(2) FF_ARG_H2(holder) = hi(2) FF_ARG_L3(holder) = lo(3) FF_ARG_H3(holder) = hi(3) c c return end c c ::: ----------------------------------------------------------- c ::: This routine reads the information from the header of a c ::: inflow/initial conditions fluctuations file. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: iunit => Fortran unit for the input fluctuations file c ::: nCmpFile => Number of components in the file c ::: dimFile => Dimensions from the fluctuations file c ::: probSizeFile => Domain size from the fluctuations file c ::: dxFile => Grid spacing from the fluctuations file c ::: ----------------------------------------------------------- c SUBROUTINE RD_SCL_FLCTHD(iunit, nCmpFile, dimFile, probSizeFile, dxFile) c c ***************************** c *** Variable Declarations *** c ***************************** c IMPLICIT NONE c c *** Passed Variables *** c INTEGER iunit, dimFile(3), nCmpFile REAL_T probSizeFile(3), dxFile(3) c c *** Local Variables *** c integer i1bc, j1bc, k1bc c c ************************************* c *** Read Header from Restart File *** c ************************************* c READ(iunit) dimFile, nCmpFile READ(iunit) probSizeFile READ(iunit) i1bc, j1bc, k1bc dxFile(1) = probSizeFile(1)/FLOAT(dimFile(1)-1) dxFile(2) = probSizeFile(2)/FLOAT(dimFile(2)-1) if (dimFile(3) .gt. 1) then dxFile(3) = probSizeFile(3)/FLOAT(dimFile(3)-1) else dxFile(3) = zero endif c c RETURN END c c ::: ----------------------------------------------------------- c ::: This routine reads the information from the header of a c ::: inflow/initial conditions fluctuations file. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: iunit => Fortran unit for the input fluctuations file c ::: dimFile => Dimensions from the fluctuations file c ::: probSizeFile => Domain size from the fluctuations file c ::: dxFile => Grid spacing from the fluctuations file c ::: ----------------------------------------------------------- c SUBROUTINE RD_FLCTHD(iunit, dimFile, probSizeFile, dxFile) c c ***************************** c *** Variable Declarations *** c ***************************** c IMPLICIT NONE c c *** Passed Variables *** c INTEGER iunit, dimFile(3) REAL_T probSizeFile(3), dxFile(3) c c *** Local Variables *** c integer i1bc, j1bc, k1bc c c ************************************* c *** Read Header from Restart File *** c ************************************* c READ(iunit) dimFile READ(iunit) probSizeFile READ(iunit) i1bc, j1bc, k1bc dxFile(1) = probSizeFile(1)/FLOAT(dimFile(1)-1) dxFile(2) = probSizeFile(2)/FLOAT(dimFile(2)-1) if (dimFile(3) .gt. 1) then dxFile(3) = probSizeFile(3)/FLOAT(dimFile(3)-1) else dxFile(3) = zero endif c c RETURN END c ::: ----------------------------------------------------------- c ::: This routine reads a record of data from an inflow/initial c ::: conditions fluctuations file. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: iunit => Fortran unit for the input fluctuations file c ::: dimFile => Dimensions from the header of the fluctuations c ::: arrLo, arrHi => Range of the array to fill. This must satisfy c ::: rdLgth(1) = arrHi(1) - arrLo(1) + 1 c ::: dimFile(1) >= fileLo(1) + rdLgth(1) - 1 c ::: fileLo => Offset into the array in the file indicating the c ::: first point to be read. c ::: FF_DIMS(dat) => Dimensions of the array dat c ::: dat <= Array to fill c ::: ----------------------------------------------------------- c SUBROUTINE RD_FLCTREC(iunit, dimFile, arrLo, arrHi, fileLo, $ FF_DIMS(dat), dat) c c ***************************** c *** Variable Declarations *** c ***************************** c implicit none c c *** Passed Variables *** c integer iunit, dimFile(3) integer arrLo(3), arrHi(3), fileLo(3) integer FF_DIMDEC(dat) REAL_T dat(FF_DIMV(dat)) c c *** Local Variables *** c integer i, j, k, ijoff, ipad, kpad REAL_T dummy c c *********************************** c *** Read Data From Restart File *** c *********************************** c c The logic here seems quite complicated. This is done so that c only the data which is needed to fill the FAB is read from the c disk and stored into memory. This should speed up the I/O as c well as keep the memory usage down. c c *** Skip through records to the K-range desired as *** c *** specified by fileLo(3) *** c do k = 1, fileLo(3)-1 READ(iunit) dummy enddo c c *** Read the Necessary Data *** c ijoff = (fileLo(2) - 1) * dimFile(1) ipad = dimFile(1) - (fileLo(1)-1 + arrHi(1) - arrLo(1) + 1) do k = arrLo(3), arrHi(3) READ(iunit) (dummy, i=1, ijoff), $ ((dummy, i=1, fileLo(1)-1), $ (dat(i,j,k), i=arrLo(1),arrHi(1)), $ (dummy, i=1, ipad), j=arrLo(2),arrHi(2)) enddo c c *** Skip through the remaining records for this variable *** c kpad = dimFile(3) - (fileLo(3)-1 + arrHi(3) - arrLo(3) + 1) do k = 1, kpad READ(iunit) dummy enddo c c RETURN END ccseapps-2.5/CCSEApps/iamrlib/InflowForce/infl_force.fi0000644000175000017500000000060611634153073024143 0ustar amckinstryamckinstryc c ::: Inflow Forcing Common Blocks ::: c integer strmwse_dir, numInflPlanesStore DOUBLE PRECISION convVel logical forceLo, forceHi character flct_file*(80) common /InflFrc_Comms/convVel, strmwse_dir, numInflPlanesStore, $ forceLo, forceHi common /InflFrc_File/ flct_file save /InflFrc_Comms/ save /InflFrc_File/ ccseapps-2.5/CCSEApps/iamrlib/InflowForce/debug/0000755000175000017500000000000011634153073022601 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/InflowForce/debug/makeDummyInflow.f0000644000175000017500000000273711634153073026071 0ustar amckinstryamckinstry program dummydata implicit none integer imax, jmax, kmax parameter (imax=49, jmax=25, kmax=1) integer ibc, jbc, kbc, i, j, k real*8 scalex, scaley, scalez, convVel, dt, t, pi, tMax, dx, x real*8 udat(imax,jmax,kmax), vdat(imax,jmax,kmax), $ wdat(imax,jmax,kmax) c c c convVel = 1.5d0 scalex = 0.7500d+01 scaley = convVel scalez = 0.0000d+00 ibc = 1 jbc = 1 kbc = 1 dt = scaley / FLOAT(jmax-1) / convVel dx = scalex / FLOAT(imax-1) tMax = scaley / convVel pi = ACOS(-1.0d0) do k = 1, kmax do j = 1, jmax do i = 1, imax x = FLOAT(i-1) * dx t = FLOAT(j-1) * dt c udat(i,j,k) = SIN(2.0d0 * pi * t / tMax) c vdat(i,j,k) = COS(2.0d0 * pi * t / tMax) c wdat(i,j,k) = 0.0d0 udat(i,j,k) = SIN(2.0d0 * pi * x / scalex) vdat(i,j,k) = COS(2.0d0 * pi * x / scalex) wdat(i,j,k) = 0.0d0 enddo enddo enddo c c open(1,file='DummyData',form='unformatted') write(1) imax, jmax, kmax write(1) scalex, scaley, scalez write(1) ibc, jbc, kbc do k=1, kmax WRITE(1) ((udat(i,j,k), i=1,imax), j=1,jmax) enddo do k=1, kmax WRITE(1) ((vdat(i,j,k), i=1,imax), j=1,jmax) enddo do k=1, kmax WRITE(1) ((wdat(i,j,k), i=1,imax), j=1,jmax) enddo close(1) c c stop end ccseapps-2.5/CCSEApps/iamrlib/InflowForce/INFL_FORCE_F.F0000644000175000017500000004115711634153073023545 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: INFL_FORCE_F.F,v 1.5 2002/10/17 20:36:40 marc Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "ArrayLim.H" #include "infl_frc.H" #include "FLUCTFILE.H" #include "BC_TYPES.H" #define SDIM BL_SPACEDIM #define FF_UNIT 20 #if defined(BL_T3E) #define OPEN_APPEND position='append' #elif defined(BL_AIX) #define OPEN_APPEND position='append' #else #define OPEN_APPEND access='append' #endif c ::: ----------------------------------------------------------- c ::: This routine is used by INITDATA and the fill routines to c ::: extrapolate the perturbations from the flct_file to c ::: fill the data required for forcing the inflow. Mostly this c ::: routine manages the reading of the data from the flct_file c ::: and then passes off to the XTR_DAT routine to actually c ::: extrapolate the data and fill the arrays. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: fillComp => Component to fill c ::: DIMS(inflDat) => Dimensions of inflDat c ::: inflDat <= Array to fill c ::: dx => Grid spacing c ::: time => Time for the fill c ::: ----------------------------------------------------------- c subroutine INFL_FILL(fillComp, DIMS(inflDat), inflDat, xlo, dx, time, $ bc, probLo, probHi) c c :::: Passed Variables :::: c implicit none integer fillComp integer DIMDEC(inflDat) integer bc(SDIM,2) REAL_T time REAL_T xlo(SDIM), dx(SDIM) REAL_T inflDat(DIMV(inflDat)) REAL_T probLo(SDIM), probHi(SDIM) c c ::::: local variables c integer lo(SDIM), hi(SDIM) integer n, npass, filePnt, storePnt, filePntOld, filePntReqd, $ maxFilePntChng, npassOld REAL_T dtFile, timeMaxFile, timeOffset, timePnt, $ dtEstimate logical is_periodic c c The arrays below are dimensioned as 3-d no matter what the c BL_SPACEDIM is. This is to allow for the fact that the inflow forcing c data arrays are always 3-d. c integer dimFile(3), loStoreDim(3), hiStoreDim(3) integer FF_DIMDEC(storDat) REAL_T dxFile(3), probSizeFile(3), xloFile(3), xhiFile(3) REAL_T storDat(:,:,:,:) allocatable storDat save loStoreDim, hiStoreDim, storDat, $ dimFile, xloFile, xhiFile, dxFile, dtFile, timeMaxFile, $ storePnt, filePnt, maxFilePntChng, timePnt, timeOffset, npass c c ::::: common blocks c #include "INFL_FORCE_F.H" c c -------------------------------------------------------- c :::: Allocate and Fill the Arrays on the First Call :::: c -------------------------------------------------------- c if (.NOT. ALLOCATED(storDat)) then open(FF_UNIT, file=flct_file, form='unformatted') call RD_FLCTHD(FF_UNIT, dimFile, probSizeFile, dxFile) close(FF_UNIT) c c do some size checking c call SET_LOHI(DIMS(inflDat), lo, hi) #if 0 do n= 1,SDIM if (n .NE. strmwse_dir) then is_periodic = bc(n,1) .eq. INT_DIR .and. $ xlo(n) + dx(n)*half .lt. probLo(n) is_periodic = is_periodic .or. (bc(n,2) .eq. INT_DIR .and. $ xlo(n) + dx(n)*(float(hi(n)-lo(n)) + half) .gt. probHi(n)) if (.NOT.is_periodic .AND. $ (probHi(n) - probLo(n) .lt. probSizeFile(n))) then print *, "turbFile is too big in dir ",n,probSizeFile(n), $ probHi(n)-probLo(n) call BL_PD_ABORT() endif if (is_periodic .and. $ probHi(n)-probLo(n) - (probSizeFile(n)-two*dxFile(n)) $ .gt. 0.001d0*dxFile(n)) then print *, "size wrong in periodic dir",n, $ probSizeFile(n)-two*dxFile(n), probHi(n)-probLo(n) call BL_PD_ABORT() endif endif enddo #endif do n = 1, SDIM xloFile(n) = half * (probHi(n) + probLo(n)) - half * probSizeFile(n) xhiFile(n) = xloFile(n) + probSizeFile(n) if (n .ne. strmwse_dir) then write(6,1001) n,probLo(n),probHi(n),xloFile(n),xhiFile(n) endif enddo 1001 format('dir: ',i2,' problem: ',f10.5,2x,f10.5,' file:',f10.5,2x,f10.5) #if (BL_SPACEDIM==2) xloFile(3) = zero xhiFile(3) = zero #endif c c :::: Set the Dimensions for the inflow data array and allocate space c do n = 1, 3 loStoreDim(n) = 1 hiStoreDim(n) = dimFile(n) enddo if (numInflPlanesStore .GT. 0 .AND. $ numInflPlanesStore .LT. hiStoreDim(strmwse_dir)) $ hiStoreDim(strmwse_dir) = numInflPlanesStore call FF_SET_ARGS(FF_DIMS(storDat), loStoreDim, hiStoreDim) ALLOCATE(storDat(FF_DIMV(storDat),COMP_FLCTFILE)) c c :::: Convert the streamwise direction lengths to times :::: c :::: and set up the pointers into the data arrays and file :::: c timeMaxFile = probSizeFile(strmwse_dir) / convVel dtFile = dxFile(strmwse_dir) / convVel npass = INT(time / timeMaxFile) timeOffset = FLOAT(npass) * timeMaxFile filePnt = INT((time - timeOffset) / dtFile) + 1 timePnt = timeOffset + FLOAT(filePnt-1) * dtFile storePnt = 2 maxFilePntChng = 0 c c ::: Fill the data Arrays ::: c call FILL_FRCARRYS(filePnt - 1, 1, dimFile, COMP_FLCTFILE, $ FF_DIMS(storDat), storDat) endif c c ------------------------------------------ c :::: Find Correct Interpolation Point :::: c ------------------------------------------ c call FF_SET_ARGS(FF_DIMS(storDat), loStoreDim, hiStoreDim) #ifdef INFL_FRC_DIAGS OPEN(12,file='LOG.Inflow_Forcing',OPEN_APPEND) if (fillComp .eq. FLCT_XVEL) then WRITE(12,2000) 'X',time, storePnt, filePnt, npass, timeOffset, $ dimFile(strmwse_dir), numInflPlanesStore, maxFilePntChng else if (fillComp .eq. FLCT_YVEL) then WRITE(12,2000) 'Y',time, storePnt, filePnt, npass, timeOffset, $ dimFile(strmwse_dir), numInflPlanesStore, maxFilePntChng else if (fillComp .eq. FLCT_ZVEL) then WRITE(12,2000) 'Z',time, storePnt, filePnt, npass, timeOffset, $ dimFile(strmwse_dir), numInflPlanesStore, maxFilePntChng endif close(12) #endif filePntOld = filePnt npassOld = npass do while ( (time .lt. timePnt - half*dtFile) .or. $ (time .gt. timePnt + half*dtFile) ) if (time .gt. timePnt + half*dtFile) then filePnt = filePnt + 1 storePnt = storePnt + 1 if (filePnt .gt. dimFile(strmwse_dir) - 1) then npass = npass + 1 timeOffset = FLOAT(npass) * timeMaxFile filePnt = filePnt - dimFile(strmwse_dir) + 1 endif else if (time .lt. timePnt - half*dtFile) then filePnt = filePnt - 1 storePnt = storePnt - 1 if (filePnt .lt. 1) then npass = npass - 1 timeOffset = FLOAT(npass) * timeMaxFile filePnt = filePnt + dimFile(strmwse_dir) - 1 endif endif timePnt = timeOffset + FLOAT(filePnt-1) * dtFile enddo if (npass .eq. npassOld) $ maxFilePntChng = MAX(maxFilePntChng, ABS(filePnt-filePntOld)) #ifdef INFL_FRC_DIAGS OPEN(12,file='LOG.Inflow_Forcing',OPEN_APPEND) if (fillComp .eq. FLCT_XVEL) then WRITE(12,2000) 'X',time, storePnt, filePnt, npass, timeOffset, $ dimFile(strmwse_dir), numInflPlanesStore, maxFilePntChng else if (fillComp .eq. FLCT_YVEL) then WRITE(12,2000) 'Y',time, storePnt, filePnt, npass, timeOffset, $ dimFile(strmwse_dir), numInflPlanesStore, maxFilePntChng else if (fillComp .eq. FLCT_ZVEL) then WRITE(12,2000) 'Z',time, storePnt, filePnt, npass, timeOffset, $ dimFile(strmwse_dir), numInflPlanesStore, maxFilePntChng endif 2000 FORMAT(A1,1xE11.3,1x,3(I3,1x),E11.3,1x,3(I3,1x)) close(12) #endif c c ------------------------------------------- c ::: Load Data if off end of stored data ::: c ------------------------------------------- c c *** Stepped off the right edge of the stored data *** c if (storePnt + 1 .gt. hiStoreDim(strmwse_dir)) then filePntReqd = filePnt - maxFilePntChng call FILL_FRCARRYS(filePntReqd - 1, 1, dimFile, COMP_FLCTFILE, $ FF_DIMS(storDat), storDat) storePnt = 2 - filePntReqd + filePnt #ifdef INFL_FRC_DIAGS OPEN(12,file='LOG.Inflow_Forcing',OPEN_APPEND) WRITE(12,2010) storePnt, filePnt, filePntReqd close(12) 2010 FORMAT(12x,3(I3,1x)) #endif c c *** Stepped off the left edge of the stored data *** c c In this case we flush the data array and load it entirely from scratch. c I really should fix the shifting routine to allow the data to be right c shifted as well as left shifted. SAS c else if (storePnt - 1 .lt. 1) then open(11,file='WARNING.Inflow_Forcing',OPEN_APPEND) write(11,1000) storePnt, filePnt, timePnt, npass, timeOffset, $ dtFile, dimFile(strmwse_dir), time 1000 format('** Stepped off the left end of the stored data. Reloading', $ /3x,'the entire data array.', $ /3x,'storePnt = ',I3,2x,'filePnt = ',I3,2x,'timePnt = ',E12.4, $ /3x,'npass = ',I3,2x,'timeOffset = ',E12.4,2x,'dtFile = ',E12.4, $ /3x,'dimFile = ',I3,2x,'time = ',E12.4) close(11) call FILL_FRCARRYS(filePnt - 1, 1, dimFile, COMP_FLCTFILE, $ FF_DIMS(storDat), storDat) storePnt = 2 #ifdef INFL_FRC_DIAGS OPEN(12,file='LOG.Inflow_Forcing',OPEN_APPEND) WRITE(12,2020) storePnt, filePnt close(12) 2020 FORMAT('BACK LOAD',3x,2(I3,1x)) #endif endif c c ----------------------------------------- c :::: Interpolate Data to Fill inflDat ::: c ----------------------------------------- c call INTRP_DATA(time, xlo, dx, storePnt, fillComp, timePnt, dtFile, $ dxFile, xloFile, xhiFile, COMP_FLCTFILE, $ FF_DIMS(storDat), storDat, DIMS(inflDat), inflDat, $ bc, probLo, probHi) c c return end c c ::: ----------------------------------------------------------- c ::: This routine fills the inflow forcing data array from the file. c ::: A basepoint is specified for the array as well as for the file. c ::: These are the points in the strmwse_dir at which reading from the c ::: file is started and at which the array is filled from. c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: baseFilePnt => Basepoint in the file in the strmwse_dir to c ::: start reading from. c ::: baseArrayPnt => Basepoint in the array in the strmwse_dir to c ::: start filling from. The array is filled from c ::: this point in strmwse_dir to the end of the c ::: array. c ::: dimFile => Dimensions from the header of the fluctuations c ::: nComp => Number of components in the array c ::: FF_DIMS(dat) => Dimensions of the array dat c ::: dat <= Array to fill c ::: ----------------------------------------------------------- c subroutine FILL_FRCARRYS(baseFilePnt, baseArrayPnt, dimFile, $ nComp, FF_DIMS(dat), dat) c c ***************************** c *** Variable Declarations *** c ***************************** c implicit none c c *** Passed Variables *** c integer baseFilePnt, baseArrayPnt, nComp, dimFile(3) integer FF_DIMDEC(dat) REAL_T dat(FF_DIMV(dat),nComp) c c *** Local Variables *** c integer intDummy, n integer lo(3), hi(3), loRd(3), hiRd(3), filLo(3) REAL_T realDummy c c ::: Common Blocks ::: c #include "INFL_FORCE_F.H" c c *** Define the LO and HI arrays *** c call FF_SET_LOHI(FF_DIMS(dat), lo, hi) c c ------------------------------------------------------ c *** Wrap baseFilePnt into the box if it is outside *** c ------------------------------------------------------ c c Note: This assumes the first and last point in the file c are the same. This is the case for data generated with mkInitFlct. c if (baseFilePnt .lt. 1) then baseFilePnt = dimFile(strmwse_dir) - (1 - baseFilePnt) endif if (baseFilePnt .gt. dimFile(strmwse_dir) - 1) then baseFilePnt = baseFilePnt - (dimFile(strmwse_dir) - 1) endif c c ---------------------------------------------------- c *** If the data can be filled in one pass, do so *** c ---------------------------------------------------- c if (hi(strmwse_dir) - baseArrayPnt + 1 $ .LE. dimFile(strmwse_dir) - baseFilePnt + 1) then do n = 1, 3 filLo(n) = 1 loRd(n) = lo(n) hiRd(n) = hi(n) enddo loRd(strmwse_dir) = baseArrayPnt filLo(strmwse_dir) = baseFilePnt open(FF_UNIT, file=flct_file, form='unformatted') read(FF_UNIT) intDummy read(FF_UNIT) realDummy read(FF_UNIT) intDummy do n = 1, nComp call RD_FLCTREC(FF_UNIT, dimFile, loRd, hiRd, filLo, FF_DIMS(dat), $ dat(lo(1),lo(2),lo(3),n)) enddo close(FF_UNIT) c c -------------------------------------------------------------- c *** If the data can not be filled in one pass, fill in two *** c *** passes wrapping around in the streamwise direction *** c -------------------------------------------------------------- c c Note: In this case, we are guaranteed that the arrays can be filled c in two passes since the array is guaranteed not to have c dimensions larger than the data in the file. c else c c Fill as much data as can be read without reading beyond the end of c the file c do n = 1, 3 filLo(n) = 1 loRd(n) = lo(n) hiRd(n) = hi(n) enddo filLo(strmwse_dir) = baseFilePnt loRd(strmwse_dir) = baseArrayPnt hiRd(strmwse_dir) = loRd(strmwse_dir) + dimFile(strmwse_dir) $ - baseFilePnt open(FF_UNIT, file=flct_file, form='unformatted') read(FF_UNIT) intDummy read(FF_UNIT) realDummy read(FF_UNIT) intDummy do n = 1, nComp call RD_FLCTREC(FF_UNIT, dimFile, loRd, hiRd, filLo, FF_DIMS(dat), $ dat(lo(1),lo(2),lo(3),n)) enddo close(FF_UNIT) c c Now fill the rest of the array starting from the beginning of the file c c Note: The first point in the file in the streamwise direction is c skipped because it is identical to the last point in the file. c filLo(strmwse_dir) = 2 loRd(strmwse_dir) = hiRd(strmwse_dir) + 1 hiRd(strmwse_dir) = hi(strmwse_dir) open(FF_UNIT, file=flct_file, form='unformatted') read(FF_UNIT) intDummy read(FF_UNIT) realDummy read(FF_UNIT) intDummy do n = 1, nComp call RD_FLCTREC(FF_UNIT, dimFile, loRd, hiRd, filLo, FF_DIMS(dat), $ dat(lo(1),lo(2),lo(3),n)) enddo close(FF_UNIT) endif c c RETURN END ccseapps-2.5/CCSEApps/iamrlib/InflowForce/INFL_FORCE_2D.F0000644000175000017500000002301311634153073023614 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: INFL_FORCE_2D.F,v 1.1 2000/06/06 18:39:24 sstanley Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "ArrayLim.H" #include "infl_frc.H" #include "FLUCTFILE.H" #define SDIM 2 c ::: ----------------------------------------------------------- c ::: This routine does the interpolation of the inflow data c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: time => Time at which to fill the data c ::: xlo => Lower physical location of the inflDat array c ::: dx => Grid spacing in the inflDat array c ::: storePnt => Interpolation point in the strmwse_dir direction c ::: fillComp => Component from the storDat array to use c ::: timePnt => Physical time corresponding to the storePnt point c ::: in the data in storDat c ::: dtFile => Time step in the array storDat c ::: nCompStorDat => Number of components in the storDat array c ::: FF_DIMS(storDat) => Dimensions of storDat c ::: storDat => Array to fill c ::: DIMS(inflDat) => Dimensions of the inflDat array c ::: inflDat <= Array to fill by interpolating from the storDat c ::: array c ::: ----------------------------------------------------------- c ::: c ::: NOTE: When x and y are calculated for each i and j index c ::: in this routine, they are calculated based on formulaes c ::: of the form, c ::: x = probLo(1) + dx(1) * (FLOAT(i) + half) c ::: rather than on the more common form, c ::: x = xlo(1) + dx(1) * (FLOAT(i - lo(1)) + half) c ::: In other words, they are calculated based on the origin c ::: of the problem domain rather than the origin of the FAB c ::: we are working on. This forces the physical location for c ::: some specified index to be identically the same no matter c ::: which FAB we are working on. Seems like a moot point, but c ::: it isn't when we do an integer shift to force points outside c ::: of the domain in periodic directions. c ::: c ::: For instance if we have a domain from 0->63 in a periodic c ::: direction and pass in a FAB to fill with indices from -1 to 5, c ::: the -1 index is integer shifted over to an index of 63 to do c ::: the interpolation for the forcing. c ::: subroutine INTRP_DATA(time, xlo, dx, storePnt, fillComp, timePnt, dtFile, $ dxFile, xloFile, xhiFile, nCompStorDat, $ FF_DIMS(storDat), storDat, $ DIMS(inflDat), inflDat, bc, probLo, probHi) c c :::: Passed Variables :::: c implicit none integer storePnt, fillComp, nCompStorDat integer loStoreDim(3), hiStoreDim(3) integer DIMDEC(inflDat) integer FF_DIMDEC(storDat) integer bc(SDIM,2) REAL_T time, timePnt, dtFile REAL_T xlo(SDIM), dx(SDIM), dxFile(3), xloFile(3), xhiFile(3) REAL_T probLo(SDIM), probHi(SDIM) REAL_T inflDat(DIMV(inflDat)) REAL_T storDat(FF_DIMV(storDat),nCompStorDat) c c :::: local variables :::: c integer i, j, iloc, jloc, kloc, ixcalc, jycalc integer lo(SDIM), hi(SDIM), n_lev_cells(SDIM) integer loStorDim(3), hiStorDim(3) REAL_T tm1, tp1, ctm1, ct0, ctp1, $ x, xm1, x0, xp1, cxm1, cx0, cxp1, $ y, ym1, y0, yp1, cym1, cy0, cyp1, $ valm1, val0, valp1 c c :::: Common Blocks :::: c #include "INFL_FORCE_F.H" c c --------------------------------- c ::: Fill the LO and HI arrays ::: c --------------------------------- c call SET_LOHI(DIMS(inflDat), lo, hi) call FF_SET_LOHI(FF_DIMS(storDat), loStorDim, hiStorDim) do i = 1, SDIM n_lev_cells(i) = (probHi(i) - probLo(i)) / dx(i) enddo c c ---------------------------------------------- c :::: Set the time interpolation constants :::: c ---------------------------------------------- c tm1 = timePnt - dtFile tp1 = timePnt + dtFile ctm1 = (time - timePnt) * (time - tp1) / (tm1 - timePnt) / (tm1 - tp1) ct0 = (time - tm1) * (time - tp1) / (timePnt - tm1) / (timePnt - tp1) ctp1 = (time - tm1) * (time - timePnt) / (tp1 - tm1) / (tp1 - timePnt) c c ---------------------------------------------- c :::: Interpolate to fill the inflow array :::: c ---------------------------------------------- c if (strmwse_dir .eq. FLCT_XVEL) then c c :::: Streamwise X-direction :::: c kloc = 1 do j = lo(2), hi(2) jycalc = j if (bc(2,1) .eq. INT_DIR .and. j .lt. 0) then jycalc = j + n_lev_cells(2) else if (bc(2,2) .eq. INT_DIR .and. j .ge. n_lev_cells(2)) then jycalc = j - n_lev_cells(2) endif y = probLo(2) + dx(2)*(float(jycalc) + half) if ((xloFile(2) .le. y .and. y .le. xhiFile(2))) then jloc = (y - xloFile(2) + half*dxFile(2))/dxFile(2) + 1 jloc = MAX(jloc, loStorDim(2)+1) jloc = MIN(jloc, hiStorDim(2)-1) y0 = FLOAT(jloc-1) * dxFile(2) + xloFile(2) ym1 = y0 - dxFile(2) yp1 = y0 + dxFile(2) cym1 = (y - y0) * (y - yp1) / (ym1 - y0) / (ym1 - yp1) cy0 = (y - ym1) * (y - yp1) / (y0 - ym1) / (y0 - yp1) cyp1 = (y - ym1) * (y - y0) / (yp1 - ym1) / (yp1 - y0) val0 = cym1 * (ctm1 * storDat(storePnt-1,jloc-1,kloc,fillComp) $ + ct0 * storDat(storePnt, jloc-1,kloc,fillComp) $ + ctp1 * storDat(storePnt+1,jloc-1,kloc,fillComp)) $ + cy0 * (ctm1 * storDat(storePnt-1,jloc, kloc,fillComp) $ + ct0 * storDat(storePnt, jloc, kloc,fillComp) $ + ctp1 * storDat(storePnt+1,jloc, kloc,fillComp)) $ + cyp1 * (ctm1 * storDat(storePnt-1,jloc+1,kloc,fillComp) $ + ct0 * storDat(storePnt, jloc+1,kloc,fillComp) $ + ctp1 * storDat(storePnt+1,jloc+1,kloc,fillComp)) else val0 = zero endif do i = lo(1), hi(1) inflDat(i,j) = val0 enddo enddo elseif (strmwse_dir .eq. FLCT_YVEL) then c c :::: Streamwise Y-direction :::: c kloc = 1 do i = lo(1), hi(1) ixcalc = i if (bc(1,1) .eq. INT_DIR .and. i .lt. 0) then ixcalc = i + n_lev_cells(1) else if (bc(1,2) .eq. INT_DIR .and. i .ge. n_lev_cells(1)) then ixcalc = i - n_lev_cells(1) endif x = probLo(1) + dx(1)*(float(ixcalc) + half) if (xloFile(1) .le. x .and. x .le. xhiFile(1)) then iloc = (x - xloFile(1) + half*dxFile(1))/dxFile(1) + 1 iloc = MAX(iloc, loStorDim(1)+1) iloc = MIN(iloc, hiStorDim(1)-1) x0 = FLOAT(iloc-1) * dxFile(1) + xloFile(1) xm1 = x0 - dxFile(1) xp1 = x0 + dxFile(1) cxm1 = (x - x0) * (x - xp1) / (xm1 - x0) / (xm1 - xp1) cx0 = (x - xm1) * (x - xp1) / (x0 - xm1) / (x0 - xp1) cxp1 = (x - xm1) * (x - x0) / (xp1 - xm1) / (xp1 - x0) #ifdef INFL_FRC_DIAGS IF (.NOT.(x0-half*dxFile(1).LE.x.AND.x.LE.x0+half*dxFile(1))) THEN WRITE(33,*) i, iloc WRITE(33,*) ' ',x, x0, dxFile(1) ENDIF #endif val0 = cxm1 * (ctm1 * storDat(iloc-1,storePnt-1,kloc,fillComp) $ + ct0 * storDat(iloc-1,storePnt, kloc,fillComp) $ + ctp1 * storDat(iloc-1,storePnt+1,kloc,fillComp)) $ + cx0 * (ctm1 * storDat(iloc, storePnt-1,kloc,fillComp) $ + ct0 * storDat(iloc, storePnt, kloc,fillComp) $ + ctp1 * storDat(iloc, storePnt+1,kloc,fillComp)) $ + cxp1 * (ctm1 * storDat(iloc+1,storePnt-1,kloc,fillComp) $ + ct0 * storDat(iloc+1,storePnt, kloc,fillComp) $ + ctp1 * storDat(iloc+1,storePnt+1,kloc,fillComp)) else val0 = zero endif do j = lo(2), hi(2) inflDat(i,j) = val0 enddo enddo endif return end ccseapps-2.5/CCSEApps/iamrlib/InflowForce/INFL_FORCE_F.H0000644000175000017500000000320711634153073023541 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c ::: Inflow Forcing Common Blocks ::: c integer strmwse_dir, numInflPlanesStore DOUBLE PRECISION convVel logical forceLo, forceHi character flct_file*(80) common /InflFrc_Comms/convVel, strmwse_dir, numInflPlanesStore, $ forceLo, forceHi common /InflFrc_File/ flct_file save /InflFrc_Comms/, /InflFrc_File/ ccseapps-2.5/CCSEApps/iamrlib/InflowForce/infl_frc.fi0000644000175000017500000000037711634153073023624 0ustar amckinstryamckinstryc c ::: CPP defines to generalize the inflow forcing ::: c INTEGER COMP_FLCTFILE PARAMETER (COMP_FLCTFILE=3) INTEGER FLCT_XVEL,FLCT_YVEL,FLCT_ZVEL PARAMETER (FLCT_XVEL=1, & FLCT_YVEL=2, & FLCT_ZVEL=3) ccseapps-2.5/CCSEApps/iamrlib/InflowForce/INFL_FORCE_3D.F0000644000175000017500000004453611634153073023632 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: INFL_FORCE_3D.F,v 1.1 2000/06/06 18:39:24 sstanley Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "ArrayLim.H" #include "infl_frc.H" #include "FLUCTFILE.H" #define SDIM 3 c ::: ----------------------------------------------------------- c ::: This routine does the interpolation of the inflow data c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: time => Time at which to fill the data c ::: xlo => Lower physical location of the inflDat array c ::: dx => Grid spacing in the inflDat array c ::: storePnt => Interpolation point in the strmwse_dir direction c ::: fillComp => Component from the storDat array to use c ::: timePnt => Physical time corresponding to the storePnt point c ::: in the data in storDat c ::: dtFile => Time step in the array storDat c ::: nCompStorDat => Number of components in the storDat array c ::: FF_DIMS(storDat) => Dimensions of storDat c ::: storDat => Array to fill c ::: DIMS(inflDat) => Dimensions of the inflDat array c ::: inflDat <= Array to fill by interpolating from the storDat c ::: array c ::: ----------------------------------------------------------- c ::: c ::: NOTE: When x, y and z are calculated for each i, j, and k index c ::: in this routine, they are calculated based on formulaes c ::: of the form, c ::: x = probLo(1) + dx(1) * (FLOAT(i) + half) c ::: rather than on the more common form, c ::: x = xlo(1) + dx(1) * (FLOAT(i - lo(1)) + half) c ::: In other words, they are calculated based on the origin c ::: of the problem domain rather than the origin of the FAB c ::: we are working on. This forces the physical location for c ::: some specified index to be identically the same no matter c ::: which FAB we are working on. Seems like a moot point, but c ::: it isn't when we do an integer shift to force points outside c ::: of the domain in periodic directions. c ::: c ::: For instance if we have a domain from 0->63 in a periodic c ::: direction and pass in a FAB to fill with indices from -1 to 5, c ::: the -1 index is integer shifted over to an index of 63 to do c ::: the interpolation for the forcing. c ::: subroutine INTRP_DATA(time, xlo, dx, storePnt, fillComp, timePnt, dtFile, $ dxFile, xloFile, xhiFile, nCompStorDat, $ FF_DIMS(storDat), storDat, $ DIMS(inflDat), inflDat, bc, probLo, probHi) c c :::: Passed Variables :::: c implicit none integer storePnt, fillComp, nCompStorDat integer loStoreDim(3), hiStoreDim(3) integer DIMDEC(inflDat) integer FF_DIMDEC(storDat) integer bc(SDIM,2) REAL_T time, timePnt, dtFile REAL_T xlo(SDIM), dx(SDIM), dxFile(3), xloFile(3), xhiFile(3) REAL_T probLo(SDIM), probHi(SDIM) REAL_T inflDat(DIMV(inflDat)) REAL_T storDat(FF_DIMV(storDat),nCompStorDat) c c :::: local variables :::: c integer i, j, k, iloc, jloc, kloc, ixcalc, jycalc, kzcalc integer lo(SDIM), hi(SDIM), n_lev_cells(SDIM) integer loStorDim(3), hiStorDim(3) REAL_T tm1, tp1, ctm1, ct0, ctp1, $ x, xm1, x0, xp1, cxm1, cx0, cxp1, $ y, ym1, y0, yp1, cym1, cy0, cyp1, $ z, zm1, z0, zp1, czm1, cz0, czp1, $ valm1, val0, valp1 c c :::: Common Blocks :::: c #include "INFL_FORCE_F.H" c c --------------------------------- c ::: Fill the LO and HI arrays ::: c --------------------------------- c call SET_LOHI(DIMS(inflDat), lo, hi) call FF_SET_LOHI(FF_DIMS(storDat), loStorDim, hiStorDim) do i = 1, SDIM n_lev_cells(i) = (probHi(i) - probLo(i)) / dx(i) enddo c c ---------------------------------------------- c :::: Set the time interpolation constants :::: c ---------------------------------------------- c tm1 = timePnt - dtFile tp1 = timePnt + dtFile ctm1 = (time - timePnt) * (time - tp1) / (tm1 - timePnt) / (tm1 - tp1) ct0 = (time - tm1) * (time - tp1) / (timePnt - tm1) / (timePnt - tp1) ctp1 = (time - tm1) * (time - timePnt) / (tp1 - tm1) / (tp1 - timePnt) c c ---------------------------------------------- c :::: Interpolate to fill the inflow array :::: c ---------------------------------------------- c if (strmwse_dir .eq. FLCT_XVEL) then c c :::: Streamwise X-direction :::: c do k = lo(3), hi(3) kzcalc = k if (bc(3,1) .eq. INT_DIR .and. k .lt. 0) then kzcalc = k + n_lev_cells(3) else if (bc(3,2) .eq. INT_DIR .and. k .ge. n_lev_cells(3)) then kzcalc = k - n_lev_cells(3) endif z = probLo(3) + dx(3)*(float(kzcalc) + half) if (xloFile(3) .le. z .and. z .le. xhiFile(3)) then kloc = (z - xloFile(3) + half*dxFile(3))/dxFile(3) + 1 kloc = MAX(kloc, loStorDim(3)+1) kloc = MIN(kloc, hiStorDim(3)-1) z0 = FLOAT(kloc-1) * dxFile(3) + xloFile(3) zm1 = z0 - dxFile(3) zp1 = z0 + dxFile(3) czm1 = (z - z0) * (z - zp1) / (zm1 - z0) / (zm1 - zp1) cz0 = (z - zm1) * (z - zp1) / (z0 - zm1) / (z0 - zp1) czp1 = (z - zm1) * (z - z0) / (zp1 - zm1) / (zp1 - z0) endif do j = lo(2), hi(2) jycalc = j if (bc(2,1) .eq. INT_DIR .and. j .lt. 0) then jycalc = j + n_lev_cells(2) else if (bc(2,2) .eq. INT_DIR .and. j .ge. n_lev_cells(2)) then jycalc = j - n_lev_cells(2) endif y = probLo(2) + dx(2)*(float(jycalc) + half) if ((xloFile(2) .le. y .and. y .le. xhiFile(2)) .and. $ (xloFile(3) .le. z .and. z .le. xhiFile(3))) then jloc = (y - xloFile(2) + half*dxFile(2))/dxFile(2) + 1 jloc = MAX(jloc, loStorDim(2)+1) jloc = MIN(jloc, hiStorDim(2)-1) y0 = FLOAT(jloc-1) * dxFile(2) + xloFile(2) ym1 = y0 - dxFile(2) yp1 = y0 + dxFile(2) cym1 = (y - y0) * (y - yp1) / (ym1 - y0) / (ym1 - yp1) cy0 = (y - ym1) * (y - yp1) / (y0 - ym1) / (y0 - yp1) cyp1 = (y - ym1) * (y - y0) / (yp1 - ym1) / (yp1 - y0) val0 = cym1 * (ctm1 * storDat(storePnt-1,jloc-1,kloc,fillComp) $ + ct0 * storDat(storePnt, jloc-1,kloc,fillComp) $ + ctp1 * storDat(storePnt+1,jloc-1,kloc,fillComp)) $ + cy0 * (ctm1 * storDat(storePnt-1,jloc, kloc,fillComp) $ + ct0 * storDat(storePnt, jloc, kloc,fillComp) $ + ctp1 * storDat(storePnt+1,jloc, kloc,fillComp)) $ + cyp1 * (ctm1 * storDat(storePnt-1,jloc+1,kloc,fillComp) $ + ct0 * storDat(storePnt, jloc+1,kloc,fillComp) $ + ctp1 * storDat(storePnt+1,jloc+1,kloc,fillComp)) valm1 = cym1 * (ctm1 * storDat(storePnt-1,jloc-1,kloc-1,fillComp) $ + ct0 * storDat(storePnt, jloc-1,kloc-1,fillComp) $ + ctp1 * storDat(storePnt+1,jloc-1,kloc-1,fillComp)) $ + cy0 * (ctm1 * storDat(storePnt-1,jloc, kloc-1,fillComp) $ + ct0 * storDat(storePnt, jloc, kloc-1,fillComp) $ + ctp1 * storDat(storePnt+1,jloc, kloc-1,fillComp)) $ + cyp1 * (ctm1 * storDat(storePnt-1,jloc+1,kloc-1,fillComp) $ + ct0 * storDat(storePnt, jloc+1,kloc-1,fillComp) $ + ctp1 * storDat(storePnt+1,jloc+1,kloc-1,fillComp)) valp1 = cym1 * (ctm1 * storDat(storePnt-1,jloc-1,kloc+1,fillComp) $ + ct0 * storDat(storePnt, jloc-1,kloc+1,fillComp) $ + ctp1 * storDat(storePnt+1,jloc-1,kloc+1,fillComp)) $ + cy0 * (ctm1 * storDat(storePnt-1,jloc, kloc+1,fillComp) $ + ct0 * storDat(storePnt, jloc, kloc+1,fillComp) $ + ctp1 * storDat(storePnt+1,jloc, kloc+1,fillComp)) $ + cyp1 * (ctm1 * storDat(storePnt-1,jloc+1,kloc+1,fillComp) $ + ct0 * storDat(storePnt, jloc+1,kloc+1,fillComp) $ + ctp1 * storDat(storePnt+1,jloc+1,kloc+1,fillComp)) val0 = czm1 * valm1 + cz0 * val0 + czp1 * valp1 else val0 = zero endif do i = lo(1), hi(1) inflDat(i,j,k) = val0 enddo enddo enddo elseif (strmwse_dir .eq. FLCT_YVEL) then c c :::: Streamwise Y-direction :::: c do k = lo(3), hi(3) kzcalc = k if (bc(3,1) .eq. INT_DIR .and. k .lt. 0) then kzcalc = k + n_lev_cells(3) else if (bc(3,2) .eq. INT_DIR .and. k .ge. n_lev_cells(3)) then kzcalc = k - n_lev_cells(3) endif z = probLo(3) + dx(3)*(float(kzcalc) + half) if (xloFile(3) .le. z .and. z .le. xhiFile(3)) then kloc = (z - xloFile(3) + half*dxFile(3))/dxFile(3) + 1 kloc = MAX(kloc, loStorDim(3)+1) kloc = MIN(kloc, hiStorDim(3)-1) z0 = FLOAT(kloc-1) * dxFile(3) + xloFile(3) zm1 = z0 - dxFile(3) zp1 = z0 + dxFile(3) czm1 = (z - z0) * (z - zp1) / (zm1 - z0) / (zm1 - zp1) cz0 = (z - zm1) * (z - zp1) / (z0 - zm1) / (z0 - zp1) czp1 = (z - zm1) * (z - z0) / (zp1 - zm1) / (zp1 - z0) endif do i = lo(1), hi(1) ixcalc = i if (bc(1,1) .eq. INT_DIR .and. i .lt. 0) then ixcalc = i + n_lev_cells(1) else if (bc(1,2) .eq. INT_DIR .and. i .ge. n_lev_cells(1)) then ixcalc = i - n_lev_cells(1) endif x = probLo(1) + dx(1)*(float(ixcalc) + half) if ((xloFile(1) .le. x .and. x .le. xhiFile(1)) .and. $ (xloFile(3) .le. z .and. z .le. xhiFile(3))) then iloc = (x - xloFile(1) + half*dxFile(1))/dxFile(1) + 1 iloc = MAX(iloc, loStorDim(1)+1) iloc = MIN(iloc, hiStorDim(1)-1) x0 = FLOAT(iloc-1) * dxFile(1) + xloFile(1) xm1 = x0 - dxFile(1) xp1 = x0 + dxFile(1) cxm1 = (x - x0) * (x - xp1) / (xm1 - x0) / (xm1 - xp1) cx0 = (x - xm1) * (x - xp1) / (x0 - xm1) / (x0 - xp1) cxp1 = (x - xm1) * (x - x0) / (xp1 - xm1) / (xp1 - x0) #ifdef INFL_FRC_DIAGS IF (.NOT.(x0-half*dxFile(1).LE.x.AND.x.LE.x0+half*dxFile(1))) THEN WRITE(33,*) i, iloc WRITE(33,*) ' ',x, x0, dxFile(1) ENDIF #endif val0 = cxm1 * (ctm1 * storDat(iloc-1,storePnt-1,kloc,fillComp) $ + ct0 * storDat(iloc-1,storePnt, kloc,fillComp) $ + ctp1 * storDat(iloc-1,storePnt+1,kloc,fillComp)) $ + cx0 * (ctm1 * storDat(iloc, storePnt-1,kloc,fillComp) $ + ct0 * storDat(iloc, storePnt, kloc,fillComp) $ + ctp1 * storDat(iloc, storePnt+1,kloc,fillComp)) $ + cxp1 * (ctm1 * storDat(iloc+1,storePnt-1,kloc,fillComp) $ + ct0 * storDat(iloc+1,storePnt, kloc,fillComp) $ + ctp1 * storDat(iloc+1,storePnt+1,kloc,fillComp)) valm1 = cxm1 * (ctm1 * storDat(iloc-1,storePnt-1,kloc-1,fillComp) $ + ct0 * storDat(iloc-1,storePnt, kloc-1,fillComp) $ + ctp1 * storDat(iloc-1,storePnt+1,kloc-1,fillComp)) $ + cx0 * (ctm1 * storDat(iloc, storePnt-1,kloc-1,fillComp) $ + ct0 * storDat(iloc, storePnt, kloc-1,fillComp) $ + ctp1 * storDat(iloc, storePnt+1,kloc-1,fillComp)) $ + cxp1 * (ctm1 * storDat(iloc+1,storePnt-1,kloc-1,fillComp) $ + ct0 * storDat(iloc+1,storePnt, kloc-1,fillComp) $ + ctp1 * storDat(iloc+1,storePnt+1,kloc-1,fillComp)) valp1 = cxm1 * (ctm1 * storDat(iloc-1,storePnt-1,kloc+1,fillComp) $ + ct0 * storDat(iloc-1,storePnt, kloc+1,fillComp) $ + ctp1 * storDat(iloc-1,storePnt+1,kloc+1,fillComp)) $ + cx0 * (ctm1 * storDat(iloc, storePnt-1,kloc+1,fillComp) $ + ct0 * storDat(iloc, storePnt, kloc+1,fillComp) $ + ctp1 * storDat(iloc, storePnt+1,kloc+1,fillComp)) $ + cxp1 * (ctm1 * storDat(iloc+1,storePnt-1,kloc+1,fillComp) $ + ct0 * storDat(iloc+1,storePnt, kloc+1,fillComp) $ + ctp1 * storDat(iloc+1,storePnt+1,kloc+1,fillComp)) val0 = czm1 * valm1 + cz0 * val0 + czp1 * valp1 else val0 = zero endif do j = lo(2), hi(2) inflDat(i,j,k) = val0 enddo enddo enddo elseif (strmwse_dir .eq. FLCT_ZVEL) then c c :::: Streamwise Z-direction :::: c do j = lo(2), hi(2) jycalc = j if (bc(2,1) .eq. INT_DIR .and. j .lt. 0) then jycalc = j + n_lev_cells(2) else if (bc(2,2) .eq. INT_DIR .and. j .ge. n_lev_cells(2)) then jycalc = j - n_lev_cells(2) endif y = probLo(2) + dx(2)*(float(jycalc) + half) if (xloFile(2) .le. y .and. y .le. xhiFile(2)) then jloc = (y - xloFile(2) + half*dxFile(2))/dxFile(2) + 1 jloc = MAX(jloc, loStorDim(2)+1) jloc = MIN(jloc, hiStorDim(2)-1) y0 = FLOAT(jloc-1) * dxFile(2) + xloFile(2) ym1 = y0 - dxFile(2) yp1 = y0 + dxFile(2) cym1 = (y - y0) * (y - yp1) / (ym1 - y0) / (ym1 - yp1) cy0 = (y - ym1) * (y - yp1) / (y0 - ym1) / (y0 - yp1) cyp1 = (y - ym1) * (y - y0) / (yp1 - ym1) / (yp1 - y0) endif do i = lo(1), hi(1) ixcalc = i if (bc(1,1) .eq. INT_DIR .and. i .lt. 0) then ixcalc = i + n_lev_cells(1) else if (bc(1,2) .eq. INT_DIR .and. i .ge. n_lev_cells(1)) then ixcalc = i - n_lev_cells(1) endif x = probLo(1) + dx(1)*(float(ixcalc) + half) if ((xloFile(1) .le. x .and. x .le. xhiFile(1)) .and. $ (xloFile(2) .le. y .and. y .le. xhiFile(2))) then iloc = (x - xloFile(1) + half*dxFile(1))/dxFile(1) + 1 iloc = MAX(iloc, loStorDim(1)+1) iloc = MIN(iloc, hiStorDim(1)-1) x0 = FLOAT(iloc-1) * dxFile(1) + xloFile(1) xm1 = x0 - dxFile(1) xp1 = x0 + dxFile(1) cxm1 = (x - x0) * (x - xp1) / (xm1 - x0) / (xm1 - xp1) cx0 = (x - xm1) * (x - xp1) / (x0 - xm1) / (x0 - xp1) cxp1 = (x - xm1) * (x - x0) / (xp1 - xm1) / (xp1 - x0) val0 = cxm1 * (ctm1 * storDat(iloc-1,jloc,storePnt-1,fillComp) $ + ct0 * storDat(iloc-1,jloc,storePnt, fillComp) $ + ctp1 * storDat(iloc-1,jloc,storePnt+1,fillComp)) $ + cx0 * (ctm1 * storDat(iloc, jloc,storePnt-1,fillComp) $ + ct0 * storDat(iloc, jloc,storePnt, fillComp) $ + ctp1 * storDat(iloc, jloc,storePnt+1,fillComp)) $ + cxp1 * (ctm1 * storDat(iloc+1,jloc,storePnt-1,fillComp) $ + ct0 * storDat(iloc+1,jloc,storePnt, fillComp) $ + ctp1 * storDat(iloc+1,jloc,storePnt+1,fillComp)) valm1 = cxm1 * (ctm1 * storDat(iloc-1,jloc-1,storePnt-1,fillComp) $ + ct0 * storDat(iloc-1,jloc-1,storePnt, fillComp) $ + ctp1 * storDat(iloc-1,jloc-1,storePnt+1,fillComp)) $ + cx0 * (ctm1 * storDat(iloc, jloc-1,storePnt-1,fillComp) $ + ct0 * storDat(iloc, jloc-1,storePnt, fillComp) $ + ctp1 * storDat(iloc, jloc-1,storePnt+1,fillComp)) $ + cxp1 * (ctm1 * storDat(iloc+1,jloc-1,storePnt-1,fillComp) $ + ct0 * storDat(iloc+1,jloc-1,storePnt, fillComp) $ + ctp1 * storDat(iloc+1,jloc-1,storePnt+1,fillComp)) valp1 = cxm1 * (ctm1 * storDat(iloc-1,jloc+1,storePnt-1,fillComp) $ + ct0 * storDat(iloc-1,jloc+1,storePnt, fillComp) $ + ctp1 * storDat(iloc-1,jloc+1,storePnt+1,fillComp)) $ + cx0 * (ctm1 * storDat(iloc, jloc+1,storePnt-1,fillComp) $ + ct0 * storDat(iloc, jloc+1,storePnt, fillComp) $ + ctp1 * storDat(iloc, jloc+1,storePnt+1,fillComp)) $ + cxp1 * (ctm1 * storDat(iloc+1,jloc+1,storePnt-1,fillComp) $ + ct0 * storDat(iloc+1,jloc+1,storePnt, fillComp) $ + ctp1 * storDat(iloc+1,jloc+1,storePnt+1,fillComp)) val0 = cym1 * valm1 + cy0 * val0 + cyp1 * valp1 else val0 = zero endif do k = lo(3), hi(3) inflDat(i,j,k) = val0 enddo enddo enddo endif c c return end ccseapps-2.5/CCSEApps/iamrlib/InflowForce/FLUCTFILE.H0000644000175000017500000000527711634153073023154 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: FLUCTFILE.H,v 1.3 2001/02/26 21:18:26 marc Exp $ c c ::: Array dimension definitions which are always 3-d c #if __STDC__==1 #define FF_DIMS(a) a##_l1, a##_l2 , a##_l3, a##_h1, a##_h2, a##_h3 #define FF_DIMDEC(a) a##_l1, a##_l2 , a##_l3, a##_h1, a##_h2, a##_h3 #define FF_DIMV(a) a##_l1:a##_h1, a##_l2:a##_h2, a##_l3:a##_h3 #define FF_DIM1(a) a##_l1:a##_h1 #define FF_DIM2(a) a##_l2:a##_h2 #define FF_DIM3(a) a##_l3:a##_h3 #define FF_DIM12(a) a##_l1:a##_h1, a##_l2:a##_h2 #define FF_DIM23(a) a##_l2:a##_h2, a##_l3:a##_h3 #define FF_DIM13(a) a##_l1:a##_h1, a##_l3:a##_h3 #define FF_ARG_L1(a) a##_l1 #define FF_ARG_L2(a) a##_l2 #define FF_ARG_L3(a) a##_l3 #define FF_ARG_H1(a) a##_h1 #define FF_ARG_H2(a) a##_h2 #define FF_ARG_H3(a) a##_h3 #else #define FF_DIMS(a) a/**/_l1, a/**/_l2 , a/**/_l3, a/**/_h1, a/**/_h2, a/**/_h3 #define FF_DIMDEC(a) a/**/_l1, a/**/_l2 , a/**/_l3, a/**/_h1, a/**/_h2, a/**/_h3 #define FF_DIMV(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2, a/**/_l3:a/**/_h3 #define FF_DIM1(a) a/**/_l1:a/**/_h1 #define FF_DIM2(a) a/**/_l2:a/**/_h2 #define FF_DIM3(a) a/**/_l3:a/**/_h3 #define FF_DIM12(a) a/**/_l1:a/**/_h1, a/**/_l2:a/**/_h2 #define FF_DIM23(a) a/**/_l2:a/**/_h2, a/**/_l3:a/**/_h3 #define FF_DIM13(a) a/**/_l1:a/**/_h1, a/**/_l3:a/**/_h3 #define FF_ARG_L1(a) a/**/_l1 #define FF_ARG_L2(a) a/**/_l2 #define FF_ARG_L3(a) a/**/_l3 #define FF_ARG_H1(a) a/**/_h1 #define FF_ARG_H2(a) a/**/_h2 #define FF_ARG_H3(a) a/**/_h3 #endif ccseapps-2.5/CCSEApps/iamrlib/SLABSTAT_NS_3D.F0000644000175000017500000004050611634153073021555 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: SLABSTAT_NS_3D.F,v 1.5 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "SPACE.H" #include "CONSTANTS.H" #include "ArrayLim.H" #include "SLABSTAT_NS_F.H" #define SDIM 3 c c ::: ----------------------------------------------------------- c ::: This is a general routine to calculate the basic running statistics c ::: based on the velocity, density, tracer and pressure. The tracer c ::: passed in to this routine is not a conserved quantity. The data c ::: saved by this routine are sufficient to calculate a core set of c ::: statistics on these fields using both Reynolds and Favre averages. c ::: The state should be passed in to this routine in the order, c ::: Rho, U, V, W, Tr, P c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: runStats <= Array to contain the running statistics c ::: DIMS(runStats) => Dimensions of the running statistics array c ::: nStats => Number of components in the statistics array c ::: state =) Array containing the state data c ::: DIMS(state) => Dimensions of the state data array c ::: nStateComp => Number of components in the state array c ::: dt => Time step c ::: delta => Grid spacing c ::: ----------------------------------------------------------- c subroutine FORT_NS_BASICSTATS_NCTRAC(state, DIMS(state), nStateComp, $ runStats, DIMS(runStats), nStats, $ dt, delta) implicit none c c ::::: passed variables c integer nStats, nStateComp integer DIMDEC(state) integer DIMDEC(runStats) REAL_T dt REAL_T delta(SDIM) REAL_T runStats(DIMV(runStats),nStats) REAL_T state(DIMV(state),nStateComp) c c ::::: local variables c integer i, j, k, n, Rho, xVel, yVel, zVel, Trac, Pres, $ nStateExpect, nStatsExpect, nGhostExpect, num integer loStats(SDIM), hiStats(SDIM) integer loState(SDIM), hiState(SDIM) PARAMETER (nStateExpect = 6, nStatsExpect = 35, nGhostExpect = 0) c c =================================== c ::: Set the Values of LO and HI ::: c =================================== c call SET_LOHI(DIMS(runStats), loStats, hiStats) call SET_LOHI(DIMS(state), loState, hiState) #ifndef NDEBUG if (nStats .NE. nStatsExpect .or. nStateComp .ne. nStateExpect) then write(*,1000) nStatsExpect, nStateExpect, nStats, nStateComp 1000 format('Incorrect number of statistic and/or state components', $ /'FORT_NS_BASICSTATS_NCTRAC. Should have nStats = ',I5,'and', $ /'nStateComp = ',I5, $ /' nStats = ', I5, 5x, 'nStateComp = ', I5) call bl_abort(" ") endif do n = 1, SDIM if (loState(n) .GT. loStats(n) - nGhostExpect .OR. $ hiState(n) .LT. hiStats(n) + nGhostExpect) then write(*,1010) n, nGhostExpect, loStats, hiStats, loState, hiState 1010 format('Incorrect number of ghost cells in the state date in', $ /'FORT_NS_BASICSTATS_NCTRAC.', $ /' Direction = ', I2, 5x, 'nGhostExpect = ', I2, $ /' loStats = ', SDIM (I2,1x), 5x, 'hiStats = ', SDIM (I2,1x), $ /' loState = ', SDIM (I2,1x), 5x, 'hiState = ', SDIM (I2,1x)) call bl_abort(" ") endif enddo #endif c c ========================= c ::: Set State Indices ::: c ========================= c Rho = 1 xVel = 2 yVel = 3 zVel = 4 Trac = 5 Pres = 6 c c ==================================== c ::: Calculate Running Statistics ::: c ==================================== c do k = loStats(3), hiStats(3) do j = loStats(2), hiStats(2) do i = loStats(1), hiStats(1) num = 1 do n = 1, 2 runStats(i,j,k,num) = runStats(i,j,k,num) $ + dt * state(i,j,k,Rho)**n runStats(i,j,k,num+1) = runStats(i,j,k,num+1) $ + dt * state(i,j,k,xVel)**n runStats(i,j,k,num+2) = runStats(i,j,k,num+2) $ + dt * state(i,j,k,Rho) * state(i,j,k,xVel)**n runStats(i,j,k,num+3) = runStats(i,j,k,num+3) $ + dt * state(i,j,k,yVel)**n runStats(i,j,k,num+4) = runStats(i,j,k,num+4) $ + dt * state(i,j,k,Rho) * state(i,j,k,yVel)**n runStats(i,j,k,num+5) = runStats(i,j,k,num+5) $ + dt * state(i,j,k,zVel)**n runStats(i,j,k,num+6) = runStats(i,j,k,num+6) $ + dt * state(i,j,k,Rho) * state(i,j,k,zVel)**n runStats(i,j,k,num+7) = runStats(i,j,k,num+7) $ + dt * state(i,j,k,Trac)**n runStats(i,j,k,num+8) = runStats(i,j,k,num+8) $ + dt * state(i,j,k,Rho) * state(i,j,k,Trac)**n runStats(i,j,k,num+9) = runStats(i,j,k,num+9) $ + dt * state(i,j,k,Pres)**n num = num + 10 enddo runStats(i,j,k,num) = runStats(i,j,k,num) + dt $ * state(i,j,k,xVel) * state(i,j,k,yVel) runStats(i,j,k,num+1) = runStats(i,j,k,num+1) + dt $ * state(i,j,k,xVel) * state(i,j,k,zVel) runStats(i,j,k,num+2) = runStats(i,j,k,num+2) + dt $ * state(i,j,k,yVel) * state(i,j,k,zVel) num = num + 3 runStats(i,j,k,num) = runStats(i,j,k,num) + dt * state(i,j,k,Rho) $ * state(i,j,k,xVel) * state(i,j,k,yVel) runStats(i,j,k,num+1) = runStats(i,j,k,num+1) + dt *state(i,j,k,Rho) $ * state(i,j,k,xVel) * state(i,j,k,zVel) runStats(i,j,k,num+2) = runStats(i,j,k,num+2) + dt *state(i,j,k,Rho) $ * state(i,j,k,yVel) * state(i,j,k,zVel) num = num + 3 runStats(i,j,k,num) = runStats(i,j,k,num) $ + dt * state(i,j,k,xVel) * state(i,j,k,Trac) runStats(i,j,k,num+1) = runStats(i,j,k,num+1) $ + dt * state(i,j,k,yVel) * state(i,j,k,Trac) runStats(i,j,k,num+2) = runStats(i,j,k,num+2) $ + dt * state(i,j,k,zVel) * state(i,j,k,Trac) num = num + 3 runStats(i,j,k,num) = runStats(i,j,k,num) $ + dt * state(i,j,k,Rho) * state(i,j,k,xVel) $ * state(i,j,k,Trac) runStats(i,j,k,num+1) = runStats(i,j,k,num+1) $ + dt * state(i,j,k,Rho) * state(i,j,k,yVel) $ * state(i,j,k,Trac) runStats(i,j,k,num+2) = runStats(i,j,k,num+2) $ + dt * state(i,j,k,Rho) * state(i,j,k,zVel) $ * state(i,j,k,Trac) num = num + 3 runStats(i,j,k,num) = runStats(i,j,k,num) $ + dt * state(i,j,k,xVel) * state(i,j,k,Pres) runStats(i,j,k,num+1) = runStats(i,j,k,num+1) $ + dt * state(i,j,k,yVel) * state(i,j,k,Pres) runStats(i,j,k,num+2) = runStats(i,j,k,num+2) $ + dt * state(i,j,k,zVel) * state(i,j,k,Pres) num = num + 3 enddo enddo enddo c c return end c c ::: ----------------------------------------------------------- c ::: This is a general routine to calculate the basic running statistics c ::: based on the velocity, density, tracer and pressure. The tracer c ::: passed in to this routine is a conserved quantity. The data c ::: saved by this routine are sufficient to calculate a core set of c ::: statistics on these fields using both Reynolds and Favre averages. c ::: The state should be passed in to this routine in the order, c ::: Rho, U, V, W, Tr, P c ::: c ::: INPUTS/OUTPUTS: c ::: c ::: runStats <= Array to contain the running statistics c ::: DIMS(runStats) => Dimensions of the running statistics array c ::: nStats => Number of components in the statistics array c ::: state =) Array containing the state data c ::: DIMS(state) => Dimensions of the state data array c ::: nStateComp => Number of components in the state array c ::: dt => Time step c ::: delta => Grid spacing c ::: ----------------------------------------------------------- c subroutine FORT_NS_BASICSTATS_CTRAC(state, DIMS(state), nStateComp, $ runStats, DIMS(runStats), nStats, $ dt, delta) implicit none c c ::::: passed variables c integer nStats, nStateComp integer DIMDEC(state) integer DIMDEC(runStats) REAL_T dt REAL_T delta(SDIM) REAL_T runStats(DIMV(runStats),nStats) REAL_T state(DIMV(state),nStateComp) c c ::::: local variables c integer i, j, k, n, Rho, xVel, yVel, zVel, RhoTrac, Pres, $ nStateExpect, nStatsExpect, nGhostExpect, num integer loStats(SDIM), hiStats(SDIM) integer loState(SDIM), hiState(SDIM) REAL_T tracer PARAMETER (nStateExpect = 6, nStatsExpect = 35, nGhostExpect = 0) c c =================================== c ::: Set the Values of LO and HI ::: c =================================== c call SET_LOHI(DIMS(runStats), loStats, hiStats) call SET_LOHI(DIMS(state), loState, hiState) #ifndef NDEBUG if (nStats .NE. nStatsExpect .or. nStateComp .ne. nStateExpect) then write(*,1000) nStatsExpect, nStateExpect, nStats, nStateComp 1000 format('Incorrect number of statistic and/or state components', $ /'FORT_NS_BASICSTATS_NCTRAC. Should have nStats = ',I5,'and', $ /'nStateComp = ',I5, $ /' nStats = ', I5, 5x, 'nStateComp = ', I5) call bl_abort(" ") endif do n = 1, SDIM if (loState(n) .GT. loStats(n) - nGhostExpect .OR. $ hiState(n) .LT. hiStats(n) + nGhostExpect) then write(*,1010) n, nGhostExpect, loStats, hiStats, loState, hiState 1010 format('Incorrect number of ghost cells in the state date in', $ /'FORT_NS_BASICSTATS_NCTRAC.', $ /' Direction = ', I2, 5x, 'nGhostExpect = ', I2, $ /' loStats = ', SDIM (I2,1x), 5x, 'hiStats = ', SDIM (I2,1x), $ /' loState = ', SDIM (I2,1x), 5x, 'hiState = ', SDIM (I2,1x)) call bl_abort(" ") endif enddo #endif c c ========================= c ::: Set State Indices ::: c ========================= c Rho = 1 xVel = 2 yVel = 3 zVel = 4 RhoTrac = 5 Pres = 6 c c ==================================== c ::: Calculate Running Statistics ::: c ==================================== c do k = loStats(3), hiStats(3) do j = loStats(2), hiStats(2) do i = loStats(1), hiStats(1) num = 1 tracer = state(i,j,k,RhoTrac) / state(i,j,k,Rho) do n = 1, 2 runStats(i,j,k,num) = runStats(i,j,k,num) + dt $ * state(i,j,k,Rho)**n runStats(i,j,k,num+1) = runStats(i,j,k,num+1) + dt $ * state(i,j,k,xVel)**n runStats(i,j,k,num+2) = runStats(i,j,k,num+2) + dt $ * state(i,j,k,Rho) * state(i,j,k,xVel)**n runStats(i,j,k,num+3) = runStats(i,j,k,num+3) + dt $ * state(i,j,k,yVel)**n runStats(i,j,k,num+4) = runStats(i,j,k,num+4) + dt $ * state(i,j,k,Rho) * state(i,j,k,yVel)**n runStats(i,j,k,num+5) = runStats(i,j,k,num+5) + dt $ * state(i,j,k,zVel)**n runStats(i,j,k,num+6) = runStats(i,j,k,num+6) + dt $ * state(i,j,k,Rho) * state(i,j,k,zVel)**n runStats(i,j,k,num+7) = runStats(i,j,k,num+7) + dt * tracer**n runStats(i,j,k,num+8) = runStats(i,j,k,num+8) + dt $ * state(i,j,k,Rho) * tracer**n runStats(i,j,k,num+9) = runStats(i,j,k,num+9) + dt $ * state(i,j,k,Pres)**n num = num + 10 enddo runStats(i,j,k,num) = runStats(i,j,k,num) + dt $ * state(i,j,k,xVel) * state(i,j,k,yVel) runStats(i,j,k,num+1) = runStats(i,j,k,num+1) + dt $ * state(i,j,k,xVel) * state(i,j,k,zVel) runStats(i,j,k,num+2) = runStats(i,j,k,num+2) + dt $ * state(i,j,k,yVel) * state(i,j,k,zVel) num = num + 3 runStats(i,j,k,num) = runStats(i,j,k,num) + dt * state(i,j,k,Rho) $ * state(i,j,k,xVel) * state(i,j,k,yVel) runStats(i,j,k,num+1) = runStats(i,j,k,num+1) + dt *state(i,j,k,Rho) $ * state(i,j,k,xVel) * state(i,j,k,zVel) runStats(i,j,k,num+2) = runStats(i,j,k,num+2) + dt *state(i,j,k,Rho) $ * state(i,j,k,yVel) * state(i,j,k,zVel) num = num + 3 runStats(i,j,k,num) = runStats(i,j,k,num) + dt $ * state(i,j,k,xVel) * tracer runStats(i,j,k,num+1) = runStats(i,j,k,num+1) + dt $ * state(i,j,k,yVel) * tracer runStats(i,j,k,num+2) = runStats(i,j,k,num+2) + dt $ * state(i,j,k,zVel) * tracer num = num + 3 runStats(i,j,k,num) = runStats(i,j,k,num) + dt $ * state(i,j,k,xVel) * state(i,j,k,RhoTrac) runStats(i,j,k,num+1) = runStats(i,j,k,num+1) + dt $ * state(i,j,k,yVel) * state(i,j,k,RhoTrac) runStats(i,j,k,num+2) = runStats(i,j,k,num+2) + dt $ * state(i,j,k,zVel) * state(i,j,k,RhoTrac) num = num + 3 runStats(i,j,k,num) = runStats(i,j,k,num) + dt $ * state(i,j,k,xVel) * state(i,j,k,Pres) runStats(i,j,k,num+1) = runStats(i,j,k,num+1) + dt $ * state(i,j,k,yVel) * state(i,j,k,Pres) runStats(i,j,k,num+2) = runStats(i,j,k,num+2) + dt $ * state(i,j,k,zVel) * state(i,j,k,Pres) num = num + 3 enddo enddo enddo c c return end ccseapps-2.5/CCSEApps/iamrlib/NAVIERSTOKES_3D.F0000644000175000017500000005334711634153073021664 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: NAVIERSTOKES_3D.F,v 1.15 2003/01/31 18:47:22 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "NAVIERSTOKES_F.H" #include "ArrayLim.H" #define SDIM 3 subroutine FORT_GRADP( & p,DIMS(p), & gp,DIMS(gp), & lo,hi,dx) c :: c :: ---------------------------------------------------------- c :: Compute a cell centered gradient from a node c :: centered field. Returns all components of GRADP c :: ---------------------------------------------------------- c :: integer DIMDEC(p) integer DIMDEC(gp) integer lo(SDIM), hi(SDIM) integer domlo(SDIM), domhi(SDIM) REAL_T dx(SDIM) REAL_T p(DIMV(p)) REAL_T gp(DIMV(gp),SDIM) logical invalid integer i,j,k REAL_T ddx, ddy, ddz integer ilo, ihi, jlo, jhi, klo, khi ddx = fourth/dx(1) ddy = fourth/dx(2) ddz = fourth/dx(3) do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) gp(i,j,k,1) = ddx*( & p(i+1,j,k )-p(i,j,k )+p(i+1,j+1,k )-p(i,j+1,k )+ & p(i+1,j,k+1)-p(i,j,k+1)+p(i+1,j+1,k+1)-p(i,j+1,k+1)) gp(i,j,k,2) = ddy*( & p(i,j+1,k )-p(i,j,k )+p(i+1,j+1,k )-p(i+1,j,k )+ & p(i,j+1,k+1)-p(i,j,k+1)+p(i+1,j+1,k+1)-p(i+1,j,k+1)) gp(i,j,k,3) = ddz*( & p(i, j,k+1)-p(i, j,k)+p(i, j+1,k+1)-p(i, j+1,k)+ & p(i+1,j,k+1)-p(i+1,j,k)+p(i+1,j+1,k+1)-p(i+1,j+1,k)) end do end do end do end subroutine FORT_AVGDOWN ( & crse,DIMS(crse),nvar, & fine,DIMS(fine), & cv,DIMS(cv), & fv,DIMS(fv), & lo,hi,ratios) c ---------------------------------------------------------- c Volume-weight average the fine grid data onto the coarse c grid. Overlap is given in coarse grid coordinates. c c crse = coarse grid data c nvar = number of components in arrays c fine = fine grid data c cv = coarse grid volume array c fv = fine grid volume array c lo,hi = index limits of overlap (crse grid) c ratios = IntVect refinement ratio c ---------------------------------------------------------- integer DIMDEC(crse) integer DIMDEC(cv) integer DIMDEC(fine) integer DIMDEC(fv) integer lo(SDIM), hi(SDIM) integer nvar integer ratios(SDIM) REAL_T crse(DIMV(crse),nvar) REAL_T cv(DIMV(cv)) REAL_T fine(DIMV(fine),nvar) REAL_T fv(DIMV(fv)) integer i, j, k, n, ic, jc, kc, ioff, joff, koff integer lratx, lraty, lratz lratx = ratios(1) lraty = ratios(2) lratz = ratios(3) do n = 1, nvar c c set coarse grid to zero on overlap c do kc = lo(3), hi(3) do jc = lo(2), hi(2) do ic = lo(1), hi(1) crse(ic,jc,kc,n) = zero end do end do end do c c sum fine data c do koff = 0, lratz-1 do kc = lo(3),hi(3) k = kc*lratz + koff do joff = 0, lraty-1 do jc = lo(2), hi(2) j = jc*lraty + joff do ioff = 0, lratx-1 do ic = lo(1), hi(1) i = ic*lratx + ioff crse(ic,jc,kc,n) = crse(ic,jc,kc,n) + & fv(i,j,k)*fine(i,j,k,n) end do end do end do end do end do end do c c divide out by volume weight c do kc = lo(3), hi(3) do ic = lo(1), hi(1) do jc = lo(2), hi(2) crse(ic,jc,kc,n) = crse(ic,jc,kc,n)/cv(ic,jc,kc) end do end do end do end do end subroutine FORT_TESTINJECT( & crse,DIMS(crse), & fine,DIMS(fine),lo,hi,ratios) c c test for consistency of pressure nodes c integer DIMDEC(crse) integer DIMDEC(fine) integer lo(3), hi(3) integer ratios(3) REAL_T crse(DIMV(crse)) REAL_T fine(DIMV(fine)) REAL_T diff integer ic, jc, kc integer lratx, lraty, lratz lratx = ratios(1) lraty = ratios(2) lratz = ratios(3) diff = zero do kc = lo(3), hi(3) do jc = lo(2), hi(2) do ic = lo(1), hi(1) diff = max( diff, & abs(crse(ic,jc,kc)-fine(lratx*ic,lraty*jc,lratz*kc))) end do end do end do if ( diff .gt. 1.0D-10 ) then call bl_abort('mismatch between fine and coarse nodes') end if end c :: ---------------------------------------------------------- c :: Replace coarse grid pressure data with corresponding c :: fine grid pressure data. c :: c :: INPUTS / OUTPUTS: c :: crse <= coarse grid data c :: DIMS(crse) => index limits of crse c :: fine => fine grid data c :: DIMS(fine) => index limits of fine c :: lo,hi => index limits of overlap (crse grid) c :: ratios => refinement ratio c :: c :: NOTE: c :: Assumes pressure fields are node based c :: ---------------------------------------------------------- c :: subroutine FORT_PUTDOWN (crse,DIMS(crse), & fine,DIMS(fine),lo,hi,ratios) integer DIMDEC(crse) integer DIMDEC(fine) integer lo(SDIM), hi(SDIM) integer ratios(SDIM) REAL_T crse(DIMV(crse)) REAL_T fine(DIMV(fine)) integer ic, jc, kc integer lratx, lraty, lratz lratx = ratios(1) lraty = ratios(2) lratz = ratios(3) do kc = lo(3), hi(3) do jc = lo(2), hi(2) do ic = lo(1), hi(1) crse(ic,jc,kc) = fine(lratx*ic,lraty*jc,lratz*kc) end do end do end do end c :: ---------------------------------------------------------- c :: UTILITY ROUTINE: compute: c :: A += alpha*B on subrange c :: c :: INPUTS / OUTPUTS: c :: a <= output array c :: b => input array c :: alo,ahi => index limits of a array c :: blo,bhi => index limits of a array c :: lo,hi => index limits of update region c :: alpha => multiplicative factor c :: ---------------------------------------------------------- c :: subroutine FORT_INCRMULT(a,DIMS(a),b,DIMS(b),lo,hi,alpha) integer DIMDEC(a) integer DIMDEC(b) integer lo(SDIM), hi(SDIM) REAL_T alpha REAL_T a(DIMV(a)) REAL_T b(DIMV(b)) integer i, j, k do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) a(i,j,k) = a(i,j,k) + alpha*b(i,j,k) end do end do end do end c :: ---------------------------------------------------------- c :: SUMMASS c :: MASS = sum{ vol(i,j)*rho(i,j) } c :: c :: INPUTS / OUTPUTS: c :: rho => density field c :: DIMS(rho) => index limits of rho aray c :: lo,hi => index limits of grid interior c :: delta => cell size c :: mass <= total mass c :: r => radius at cell center c :: tmp => temp column array c :: ---------------------------------------------------------- c :: subroutine FORT_SUMMASS(rho,DIMS(rho),DIMS(grid),delta,mass,tmp) integer DIMDEC(rho) integer DIMDEC(grid) REAL_T mass, delta(SDIM) REAL_T rho(DIMV(rho)) REAL_T tmp(DIM2(grid)) integer i, j, k REAL_T vol vol = delta(1)*delta(2)*delta(3) do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = zero end do do k = ARG_L3(grid), ARG_H3(grid) do i = ARG_L1(grid), ARG_H1(grid) do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = tmp(j) + vol*rho(i,j,k) end do end do end do mass = zero do j = ARG_L2(grid), ARG_H2(grid) mass = mass + tmp(j) end do end c :: ---------------------------------------------------------- c :: SUMMASSSQ c :: MASS = sum{ vol(i,j)*rho(i,j)*rho(i,j) } c :: c :: INPUTS / OUTPUTS: c :: rho => density field c :: DIMS(rho) => index limits of rho aray c :: lo,hi => index limits of grid interior c :: delta => cell size c :: mass <= total mass c :: r => radius at cell center c :: tmp => temp column array c :: ---------------------------------------------------------- c :: subroutine FORT_SUMMASSSQ(rho,DIMS(rho),DIMS(grid),delta,mass,tmp) integer DIMDEC(rho) integer DIMDEC(grid) REAL_T mass, delta(SDIM) REAL_T rho(DIMV(rho)) REAL_T tmp(DIM2(grid)) integer i, j, k REAL_T vol vol = delta(1)*delta(2)*delta(3) do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = zero end do do k = ARG_L3(grid), ARG_H3(grid) do i = ARG_L1(grid), ARG_H1(grid) do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = tmp(j) + vol*rho(i,j,k)*rho(i,j,k) end do end do end do mass = zero do j = ARG_L2(grid), ARG_H2(grid) mass = mass + tmp(j) end do end c :: ---------------------------------------------------------- c :: SUMPRESS c :: SUM = sum{ press(i,j,k) * surroundingVolume(i,j,k) } c :: c :: INPUTS / OUTPUTS: c :: press => pressure field on nodes c :: DIMS(press)=> index limits of press aray c :: vol => volume field (zero-ed out under finer grids) c :: DIMS(vol) => index limits of vol aray c :: lo,hi => index limits of grid interior in nodal space c :: total_press<= sum of volume-weighted nodal pressures c :: total_vol <= sum of volumes c :: ---------------------------------------------------------- c :: subroutine FORT_SUMPRESS(press,DIMS(press),vol,DIMS(vol),lo,hi, $ total_press,total_vol) integer lo(3),hi(3) integer DIMDEC(press) integer DIMDEC(vol) integer DIMDEC(grid) REAL_T press(DIMV(press)) REAL_T vol(DIMV(vol)) REAL_T total_press,total_vol integer i, j, k REAL_T surroundingVolume do k = lo(3),hi(3) do j = lo(2),hi(2) do i = lo(1),hi(1) surroundingVolume = vol(i,j ,k ) + vol(i-1,j ,k ) + $ vol(i,j-1,k ) + vol(i-1,j-1,k ) + $ vol(i,j ,k-1) + vol(i-1,j ,k-1) + $ vol(i,j-1,k-1) + vol(i-1,j-1,k-1) total_press = total_press + press(i,j,k) * surroundingVolume total_vol = total_vol + surroundingVolume end do end do end do end c----------------------------------------------------------------------- c This routine fills an edge-centered fab from a cell-centered c fab using simple linear interpolation. c c INPUTS / OUTPUTS: c lo,hi => index limits of the region of the edge-centered fab c to be filled c DIMS(cfab) => index limits of the cell-centered fab c cfab => cell-centered data c DIMS(efab) => index limits of the edge-centered fab c efab => edge-centered fab to fill c nc => Number of components in the fab to fill c dir => direction data needs to be shifted to get to edges c----------------------------------------------------------------------- c subroutine FORT_CEN2EDG(lo, hi, & DIMS(cfab), cfab, & DIMS(efab), efab, nc, dir, isharm & ) integer lo(SDIM), hi(SDIM), nc, dir, isharm integer DIMDEC(cfab) integer DIMDEC(efab) REAL_T cfab(DIMV(cfab), nc) REAL_T efab(DIMV(efab), nc) integer i,j,k,n if ( isharm .eq. 0 ) then if (dir .EQ. 0) then do n = 1,nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1)+1, hi(1) efab(i,j,k,n) = & half*(cfab(i,j,k,n) + cfab(i-1,j,k,n)) end do end do end do end do else if (dir .EQ. 1) then do n = 1,nc do k = lo(3), hi(3) do j = lo(2)+1, hi(2) do i = lo(1), hi(1) efab(i,j,k,n) = & half*(cfab(i,j,k,n) + cfab(i,j-1,k,n)) end do end do end do end do else if (dir .EQ. 2) then do n = 1,nc do k = lo(3)+1, hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) efab(i,j,k,n) = & half*(cfab(i,j,k,n) + cfab(i,j,k-1,n)) end do end do end do end do end if else if (dir .EQ. 0) then do n = 1,nc do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1)+1, hi(1) if((cfab(i,j,k,n) * cfab(i-1,j,k,n)) .gt.0.d0) & then efab(i,j,k,n) = & 2.d0*(cfab(i,j,k,n) * cfab(i-1,j,k,n))/ & (cfab(i,j,k,n) + cfab(i-1,j,k,n)) else efab(i,j,k,n)=0.d0 endif end do end do end do end do else if (dir .EQ. 1) then do n = 1,nc do k = lo(3), hi(3) do j = lo(2)+1, hi(2) do i = lo(1), hi(1) if((cfab(i,j,k,n) * cfab(i,j-1,k,n)).gt.0.d0) & then efab(i,j,k,n) = & 2.d0*(cfab(i,j,k,n) * cfab(i,j-1,k,n))/ & (cfab(i,j,k,n) + cfab(i,j-1,k,n)) else efab(i,j,k,n)=0.d0 endif end do end do end do end do else if (dir .EQ. 2) then do n = 1,nc do k = lo(3)+1, hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) if((cfab(i,j,k,n) * cfab(i,j,k-1,n)).gt.0.d0) & then efab(i,j,k,n) = & 2.d0*(cfab(i,j,k,n) * cfab(i,j,k-1,n))/ & (cfab(i,j,k,n) + cfab(i,j,k-1,n)) else efab(i,j,k,n)=0.d0 endif end do end do end do end do end if end if end c----------------------------------------------------------------------- subroutine EDGE_INTERP(flo, fhi, nc, ratio, dir, & fine, fine_l0, fine_l1, fine_l2, fine_h0, fine_h1, fine_h2) implicit none integer flo(0:3-1), fhi(0:3-1), nc, ratio(0:3-1), dir integer fine_l0, fine_l1, fine_l2, fine_h0, fine_h1, fine_h2 DOUBLE PRECISION & fine(fine_l0:fine_h0,fine_l1:fine_h1,fine_l2:fine_h2,nc) integer i,j,k,ii,jj,kk,n,P,M,L,clo(0:3-1),chi(0:3-1) DOUBLE PRECISION val, df c Do linear in dir, pc transverse to dir, leave alone the fine values c lining up with coarse edges--assume these have been set to hold the c values you want to interpolate to the rest. if (dir.eq.0) then do n=1,nc do k=flo(2),fhi(2),ratio(2) do j=flo(1),fhi(1),ratio(1) do i=flo(0),fhi(0)-ratio(dir),ratio(0) df = fine(i+ratio(dir),j,k,n)-fine(i,j,k,n) do M=1,ratio(dir)-1 val = fine(i,j,k,n) & + df*dble(M)/dble(ratio(dir)) do P=MAX(j,flo(1)),MIN(j+ratio(1)-1,fhi(1)) do L=MAX(k,flo(2)),MIN(k+ratio(2)-1,fhi(2)) fine(i+M,P,L,n) = val enddo enddo enddo enddo enddo enddo enddo else if (dir.eq.1) then do n=1,nc do k=flo(2),fhi(2),ratio(2) do j=flo(1),fhi(1)-ratio(dir),ratio(1) do i=flo(0),fhi(0) df = fine(i,j+ratio(dir),k,n)-fine(i,j,k,n) do M=1,ratio(dir)-1 val = fine(i,j,k,n) & + df*dble(M)/dble(ratio(dir)) do P=MAX(i,flo(0)),MIN(i+ratio(0)-1,fhi(0)) do L=MAX(k,flo(2)),MIN(k+ratio(2)-1,fhi(2)) fine(P,j+M,L,n) = val enddo enddo enddo enddo enddo enddo enddo else do n=1,nc do k=flo(2),fhi(2)-ratio(dir),ratio(2) do j=flo(1),fhi(1),ratio(1) do i=flo(0),fhi(0),ratio(0) df = fine(i,j,k+ratio(dir),n)-fine(i,j,k,n) do M=1,ratio(dir)-1 val = fine(i,j,k,n) & + df*dble(M)/dble(ratio(dir)) do P=MAX(i,flo(0)),MIN(i+ratio(0)-1,fhi(0)) do L=MAX(j,flo(1)),MIN(j+ratio(1)-1,fhi(1)) fine(P,L,k+M,n) = val enddo enddo enddo enddo enddo enddo enddo endif end c----------------------------------------------------------------------- subroutine PC_EDGE_INTERP(lo, hi, nc, ratio, dir, & crse, crse_l0, crse_l1, crse_l2, crse_h0, crse_h1, crse_h2, & fine, fine_l0, fine_l1, fine_l2, fine_h0, fine_h1, fine_h2) implicit none integer lo(3),hi(3), nc, ratio(0:3-1), dir integer crse_l0, crse_l1, crse_l2, crse_h0, crse_h1, crse_h2 integer fine_l0, fine_l1, fine_l2, fine_h0, fine_h1, fine_h2 DOUBLE PRECISION & crse(crse_l0:crse_h0,crse_l1:crse_h1,crse_l2:crse_h2,nc) DOUBLE PRECISION & fine(fine_l0:fine_h0,fine_l1:fine_h1,fine_l2:fine_h2,nc) integer i,j,k,ii,jj,kk,n,L, P DOUBLE PRECISION val, dc c For edge-based data, fill fine values with piecewise-constant interp of coarse data. c Operate only on faces that overlap--ie, only fill the fine faces that make up each c coarse face, leave the in-between faces alone. if (dir.eq.0) then do n=1,nc do k=lo(3),hi(3) kk = ratio(2)*k do j=lo(2),hi(2) jj = ratio(1)*j do i=lo(1),hi(1) ii = ratio(0)*i do P=0,ratio(2)-1 do L=0,ratio(1)-1 fine(ii,jj+L,kk+P,n) = crse(i,j,k,n) enddo enddo enddo enddo enddo enddo else if (dir.eq.1) then do n=1,nc do k=lo(3),hi(3) kk = ratio(2)*k do j=lo(2),hi(2) jj = ratio(1)*j do i=lo(1),hi(1) ii = ratio(0)*i do P=0,ratio(2)-1 do L=0,ratio(0)-1 fine(ii+L,jj,kk+P,n) = crse(i,j,k,n) enddo enddo enddo enddo enddo enddo else do n=1,nc do k=lo(3),hi(3) kk = ratio(2)*k do j=lo(2),hi(2) jj = ratio(1)*j do i=lo(1),hi(1) ii = ratio(0)*i do P=0,ratio(1)-1 do L=0,ratio(0)-1 fine(ii+L,jj+P,kk,n) = crse(i,j,k,n) enddo enddo enddo enddo enddo enddo endif end ccseapps-2.5/CCSEApps/iamrlib/MACOUTFLOWBC_F.H0000644000175000017500000002417111634153073021546 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MACOUTFLOWBC_F_H #define _MACOUTFLOWBC_F_H #ifdef BL_LANG_FORT # define FORT_MACPHIBC macphibc # define FORT_MACFILL_ONED macfilloned # define FORT_MACFILL_TWOD macfilltwod # define FORT_MACPHI_FROM_X macphifromx # define FORT_MACALLPHI_FROM_X macallphifromx # define FORT_EXTRAP_MAC extrapmac # define FORT_COMPUTE_MACCOEFF computemaccoeff # define FORT_MACRELAX macrelax # define FORT_MAC_RESHIFT_PHI macreshiftphi # define FORT_MAC_SHIFT_PHI macshiftphi # define FORT_MACRESID macresid # define FORT_MACSUBTRACTAVGPHI macsubtractavgphi # define FORT_SOLVEMAC solvemac # define FORT_COARSIGMA coarsigma # define FORT_RESTRICT coarsres # define FORT_INTERPOLATE interp #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_MACPHIBC MACPHIBC # define FORT_MACFILL_ONED MACFILLONED # define FORT_MACFILL_TWOD MACFILLTWOD # define FORT_MACPHI_FROM_X MACPHIFROMX # define FORT_MACALLPHI_FROM_X MACALLPHIFROMX # define FORT_EXTRAP_MAC EXTRAPMAC # define FORT_COMPUTE_MACCOEFF COMPUTEMACCOEFF # define FORT_MACRELAX MACRELAX # define FORT_MAC_RESHIFT_PHI MACRESHIFTPHI # define FORT_MAC_SHIFT_PHI MACSHIFTPHI # define FORT_MACRESID MACRESID # define FORT_MACSUBTRACTAVGPHI MACSUBTRACTAVGPHI # define FORT_SOLVEMAC SOLVEMAC # define FORT_COARSIGMA COARSIGMA # define FORT_RESTRICT COARSRES # define FORT_INTERPOLATE INTERP # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_MACPHIBC macphibc # define FORT_MACFILL_ONED macfilloned # define FORT_MACFILL_TWOD macfilltwod # define FORT_MACPHI_FROM_X macphifromx # define FORT_MACALLPHI_FROM_X macallphifromx # define FORT_EXTRAP_MAC extrapmac # define FORT_COMPUTE_MACCOEFF computemaccoeff # define FORT_MACRELAX macrelax # define FORT_MAC_RESHIFT_PHI macreshiftphi # define FORT_MAC_SHIFT_PHI macshiftphi # define FORT_MACRESID macresid # define FORT_MACSUBTRACTAVGPHI macsubtractavgphi # define FORT_SOLVEMAC solvemac # define FORT_COARSIGMA coarsigma # define FORT_RESTRICT coarsres # define FORT_INTERPOLATE interp # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_MACPHIBC macphibc_ # define FORT_MACFILL_ONED macfilloned_ # define FORT_MACFILL_TWOD macfilltwod_ # define FORT_MACPHI_FROM_X macphifromx_ # define FORT_MACALLPHI_FROM_X macallphifromx_ # define FORT_EXTRAP_MAC extrapmac_ # define FORT_COMPUTE_MACCOEFF computemaccoeff_ # define FORT_MACRELAX macrelax_ # define FORT_MAC_RESHIFT_PHI macreshiftphi_ # define FORT_MAC_SHIFT_PHI macshiftphi_ # define FORT_MACRESID macresid_ # define FORT_MACSUBTRACTAVGPHI macsubtractavgphi_ # define FORT_SOLVEMAC solvemac_ # define FORT_COARSIGMA coarsigma_ # define FORT_RESTRICT coarsres_ # define FORT_INTERPOLATE interp_ # endif #include extern "C" { #if (BL_SPACEDIM == 2) void FORT_MACPHIBC (const Real* phi, int* length, const Real* divuEptr, const Real* rhoEptr, const Real* redge, const Real* hx, const int* isPeriodic); void FORT_MACFILL_ONED(int* lenx, int* leny, int* length, int * faces, int * numOutFlowFaces, const Real* cc0, const Real* cc1, const Real* cc2, const Real* cc3, const Real* r0, const Real* r1, const Real* r2, const Real* r3, Real * cc_conn, Real* redge_conn); void FORT_MACALLPHI_FROM_X(int* lenx, int* leny, int* length, int * faces, int * numOutFlowFaces, const Real* phi0, const Real* phi1, const Real* phi2, const Real* phi3, Real * x); #else void FORT_COMPUTE_MACCOEFF(ARLIM_P(rhslo),ARLIM_P(rhshi),const Real* rhsPtr, ARLIM_P(beta0lo),ARLIM_P(beta0hi),const Real* beta0Ptr, ARLIM_P(beta1lo),ARLIM_P(beta1hi),const Real* beta1Ptr, ARLIM_P(divuElo),ARLIM_P(divuEhi), const Real* divuEPtr, ARLIM_P(rhoElo),ARLIM_P(rhoEhi),const Real* rhoEPtr, const int* faceLo, const int* faceHi, const Real* dx, const int* isPeriodicPerp); void FORT_MACFILL_TWOD(int* lenx, int* leny, int* length, int* width, int * faces, int * numOutFlowFaces, const Real* cc0, const Real* cc1, const Real* cc2, const Real* cc3, const Real* cc4, const Real* cc5, Real * cc_conn); void FORT_MACALLPHI_FROM_X(int* lenx, int* leny, int* lenz, int* length, int* width, int * faces, int * numOutFlowFaces, const Real* phi0, const Real* phi1, const Real* phi2, const Real* phi3, const Real* phi4, const Real* phi5, Real * x, ARLIM_P(x_lo), ARLIM_P(x_hi)); #endif void FORT_MACPHI_FROM_X(ARLIM_P(phi_lo), ARLIM_P(phi_hi), const Real* phi, int * length, Real * x); void FORT_EXTRAP_MAC (ARLIM_P(u0_lo), ARLIM_P(u0_hi), const Real* u0, ARLIM_P(u1_lo), ARLIM_P(u1_hi), const Real* u1, #if (BL_SPACEDIM == 3) ARLIM_P(u2_lo), ARLIM_P(u2_hi), const Real* u2, #endif ARLIM_P(d_lo), ARLIM_P(d_hi), const Real* divcor, ARLIM_P(rho_lo), ARLIM_P(rho_hi), const Real* rho, #if (BL_SPACEDIM == 2) int* r_len, const Real* redge, #endif ARLIM_P(dE_lo), ARLIM_P(dE_hi), const Real* dE, ARLIM_P(rhoE_lo), ARLIM_P(rhoE_hi), const Real* rhoE, const Real* dx, const int* faceLo, const int* faceHi, int* face, int* per, int* zeroIt); void FORT_MACRELAX (ARLIM_P(rhslo), ARLIM_P(rhshi), const Real* rhs, ARLIM_P(beta0lo), ARLIM_P(beta0hi), const Real* beta0, #if (BL_SPACEDIM == 3) ARLIM_P(beta1lo), ARLIM_P(beta1hi), const Real* beta1, #endif ARLIM_P(philo), ARLIM_P(phihi), const Real* phi, const int* faceLo, const int* faceHi, const Real* h, const int* isPeriodic, const int* niter); void FORT_MAC_RESHIFT_PHI( ARLIM_P(outlo),ARLIM_P(outhi),const Real* outPtr, ARLIM_P(inlo),ARLIM_P(inhi),const Real* inPtr, const int* face); void FORT_MAC_SHIFT_PHI( ARLIM_P(outlo),ARLIM_P(outhi),const Real* outPtr, ARLIM_P(inlo),ARLIM_P(inhi),const Real* inPtr, const int* face); void FORT_MACRESID(ARLIM_P(rhslo),ARLIM_P(rhshi),const Real* rhsPtr, ARLIM_P(beta0),ARLIM_P(beta0),const Real* beta0, #if (BL_SPACEDIM == 3) ARLIM_P(beta1),ARLIM_P(beta1),const Real* beta1, #endif ARLIM_P(phi), ARLIM_P(phi),const Real* phi, ARLIM_P(resid),ARLIM_P(resid), const Real* resid, const int* lo, const int* hi, const Real* h, const int* isPeriodic, const Real* maxnorm); void FORT_MACSUBTRACTAVGPHI(ARLIM_P(philo),ARLIM_P(phihi),const Real* phi, #if (BL_SPACEDIM == 2) int* r_lo, int* r_hi, const Real* r, #endif const int* faceLo, const int* faceHi, const int* isPeriodic); void FORT_SOLVEMAC(Real * dest, ARLIM_P(destlo),ARLIM_P(desthi), Real * dest0, ARLIM_P(dest0lo),ARLIM_P(dest0hi), Real *source, ARLIM_P(sourcelo),ARLIM_P(sourcehi), Real * sigmax, ARLIM_P(sigmaxlo),ARLIM_P(simgaxhi), #if (BL_SPACEDIM == 3) Real * sigmay, ARLIM_P(sigmaylo),ARLIM_P(sigmayhi), #endif Real * sum, ARLIM_P(sumlo),ARLIM_P(sumhi), Real * r, ARLIM_P(rlo),ARLIM_P(rhi), Real * w, ARLIM_P(wlo),ARLIM_P(whi), Real * z, ARLIM_P(zlo),ARLIM_P(zhi), Real * work,ARLIM_P(worklo),ARLIM_P(workhi), const int* lo, const int* hi, Real* dxFiltered, int* isPeriodicFiltered, int* maxIter, Real* tol, Real* cg_abs_tol, Real* max_jump,Real * norm); void FORT_COARSIGMA(Real * sigmax , ARLIM_P(sigmax_lo),ARLIM_P(sigmax_hi), #if (BL_SPACEDIM == 3) Real * sigmay, ARLIM_P(sigmay_lo),ARLIM_P(sigmay_hi), #endif Real * sigmaxc, ARLIM_P(sigmaxc_lo),ARLIM_P(sigmaxc_hi), #if (BL_SPACEDIM == 3) Real * sigmayc,ARLIM_P(sigmayc_lo),ARLIM_P(sigmayc_hi), #endif const int* lo, const int* hi, const int* loc, const int* hic); void FORT_RESTRICT(Real * res, ARLIM_P(res_lo),ARLIM_P(res_hi), Real * resc, ARLIM_P(resc_lo),ARLIM_P(resc_hi), const int* lo, const int* hi, const int* loc, const int* hic); void FORT_INTERPOLATE(Real * phi, ARLIM_P(phi_lo),ARLIM_P(phi_hi), Real * deltac,ARLIM_P(deltac_lo),ARLIM_P(deltac_hi), const int* lo, const int* hi, const int* loc, const int* hic); } #endif #endif ccseapps-2.5/CCSEApps/iamrlib/GODCOMM_F.H0000644000175000017500000000264111634153073020744 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ integer slope_order logical use_unlimited_slopes common /xx1godunov/ slope_order common /xx2godunov/ use_unlimited_slopes ccseapps-2.5/CCSEApps/iamrlib/ViscBndryTensor.H0000644000175000017500000000401411634153073022504 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _VISCBNDRYTENSOR_H_ #define _VISCBNDRYTENSOR_H_ // // $Id: ViscBndryTensor.H,v 1.2 1999/02/24 01:56:11 propp Exp $ // #include #include #include class ViscBndryTensor : public MCInterpBndryData { public: ViscBndryTensor () {} ViscBndryTensor (const BoxArray& grids, const Geometry& geom) : MCInterpBndryData(grids,MCLinOp::bcComponentsNeeded(),geom) {} virtual void setBndryConds (const BCRec& phys_bc, int ratio, int comp=0); void setHomogValues (const Array& phys_bc, int ratio); }; #endif /*_VISCBNDRYTENSOR_H_*/ ccseapps-2.5/CCSEApps/iamrlib/NavierStokes.H0000644000175000017500000006330711634153073022035 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _NavierStokes_H_ #define _NavierStokes_H_ // // $Id: NavierStokes.H,v 1.83 2003/03/03 20:24:53 lijewski Exp $ // #include #include #include #include #include #include #include #include #include #include #include // // "Divu_Type" means S, where divergence U = S // "Dsdt_Type" means pd S/pd t, where S is as above // // Determine what you want in the state -- Divu, Dsdt -- in // NavierStokes::variableSetUp in NS_setup.C. Look at the example in // the _tube_flow problem dependent directory // enum StateType {State_Type=0, Press_Type}; // // Note: enumerated value NUM_STATE_TYPE no longer defined // use num_state_type (static int member of NavierStokes) // #if (BL_SPACEDIM == 2) enum StateNames { Xvel=0, Yvel, Density}; #else enum StateNames { Xvel=0, Yvel, Zvel, Density}; #endif enum PressureNames { Pressure=0 }; enum DivuNames { Divu=0}; enum DsDtNames { Dsdt=0}; enum DpDtNames { Dpdt=0}; class NSBld : public LevelBld { virtual void variableSetUp (); virtual void variableCleanUp (); virtual AmrLevel *operator() (); virtual AmrLevel *operator() (Amr& papa, int lev, const Geometry& level_geom, const BoxArray& ba, Real time); }; class NavierStokes : public AmrLevel { public: friend class Projection; friend class MacProj; friend class Diffusion; NavierStokes (); NavierStokes (Amr& papa, int lev, const Geometry& level_geom, const BoxArray& bl, Real time); virtual ~NavierStokes (); virtual void restart (Amr& papa, std::istream& is, bool bReadSpecial = false); // // Define data descriptors. // static void variableSetUp (); // // Cleanup data descriptors at end of run. // static void variableCleanUp (); // // Init grid data at problem start-up. // virtual void initData (); virtual void initDataOtherTypes () {} // // Reset time levels for the initial iterations. // virtual void resetState (Real time, Real dt_old, Real dt_new); // // Set time levels of state data. // virtual void setTimeLevel (Real time, Real dt_old, Real dt_new); // // This function fills a new level n with the best // level n and coarser data available (usually during regrid). // virtual void init (AmrLevel& old); // // Init data on this level after regridding if old level // did not exist previously. // virtual void init (); virtual void allocOldData (); virtual void removeOldData (); void init_additional_state_types (); // // Error estimation for regridding. // virtual void errorEst (TagBoxArray& tb, int clearval, int tagval, Real time, int n_error_buf = 0, int ngrow = 0); // // Integrate derived quantities over domain. // Real sumDerive (const std::string& name, Real time); Real volWgtSum (const std::string& name, Real time); // // A string written as the first item in writePlotFile() at level zero. // It is so we can distinguish between different types of plot files. // // For NavierStokes it has the form: NavierStokes-Vnnn // virtual std::string thePlotFileType () const; // // Write plot file stuff to specified directory. // virtual void writePlotFile (const std::string& dir, std::ostream& os, VisMF::How how); // // Modify list of variables to be plotted // virtual void setPlotVariables(); // // Timestep estimation functions follow ... // virtual Real estTimeStep (); Real initialTimeStep (); virtual void computeInitialDt (int finest_level, int sub_cycle, Array& n_cycle, const Array& ref_ratio, Array& dt_level, Real stop_time); virtual void computeNewDt (int finest_level, int sub_cycle, Array& n_cycle, const Array& ref_ratio, Array& dt_min, Array& dt_level, Real stop_time); // // This function estimates the initial timesteping used by the model. // void post_init_estDT (Real& dt_init, Array& nc_save, Array& dt_save, Real stop_time); // // Estimate the end of the simulation for amrLevel. // virtual int okToContinue (); // // Sync state and pressure at the end of a composite timestep. // virtual void post_timestep (int iteration); // // Build any additional data structures after regrid. // virtual void post_regrid (int lbase, int new_finest); // // Build any additional data structures after restart. // virtual void post_restart (); // // Insure state, and pressure are consistent. // virtual void post_init (Real stop_time); // // Advance grids at this level in time. // virtual Real advance (Real time, Real dt, int iteration, int ncycle); // // Get divU from the state data. // MultiFab* getDivCond (int ngrow, Real time); // // Public so MacProj can access it. // virtual void SetGodunov (); // // Returns the value of "gravity" for use in the projection outflow bcs. // Real getGravity () { return gravity; } protected: void buildMetrics (); // 1-D metric arrays for RZ virtual void buildRho0 (); // Build atmospheric rho0 void initOldPress (); // Initialize old pressure with new void zeroNewPress (); // Set new pressure to zero void zeroOldPress (); // Set old pressure to zero static void read_params (); // Read input file static void read_geometry (); // Set metrics virtual void sum_integrated_quantities (); // // Setup, clean up for a level timestep. // virtual void advance_setup (Real time, Real dt, int iteration, int ncycle); void advance_cleanup (Real dt, int iteration, int ncycle); // // Compute divergent mac velocities, estimate best timestep // from t^n data, and compile cfl number. // Real predict_velocity (Real dt, Real& comp_cfl); // // Create the RHS for the MAC projection. // virtual MultiFab* create_mac_rhs (Real time, Real dt); // // Create a grown-by-1 RHS for the MAC projection, which // is identical to mac_rhs in all the valid regions. // MultiFab* create_mac_rhs_grown (int nGrow, Real time, Real dt); // // Impose divergence constraint on MAC velocities. // void mac_project (Real time, Real dt, MultiFab& S_old, MultiFab* divu, int have_divu); // // Grow by 1 and fillpatch the MAC-projected velocities. // void create_umac_grown (); // // Advect velocities. // void velocity_advection (Real dt); // // Advect scalars. // void scalar_advection (Real dt, int first_scalar, int last_scalar); // // Update scalars, (viscous solve in scalar_update). // void scalar_update (Real dt, int first_scalar, int last_scalar); void scalar_advection_update (Real dt, int first_scalar, int last_scalar); void scalar_diffusion_update (Real dt, int first_scalar, int last_scalar); virtual void diffuse_scalar_setup (Real dt, int sigma, int* rho_flag, MultiFab*& delta_rhs, MultiFab*& alpha, MultiFab**& diffn, MultiFab**& diffnp1); // // Make rho at time n. // virtual void make_rho_prev_time (); // // Make rho at time n+1. // virtual void make_rho_curr_time (); // // Get rho at time n+1/2 -- don't delete the pointer !!! // MultiFab* get_rho_half_time (); // // Get rho at time. // Must be one of AmrOldTime, AmrHalfTime or AmrNewTime. // Aborts if not one of the three above times. // const MultiFab& get_rho (Real time); // // Update velocities (or momentum) after advection. // void velocity_update (Real dt); void velocity_advection_update (Real dt); virtual void velocity_diffusion_update (Real dt); void initial_velocity_diffusion_update (Real dt); virtual void diffuse_velocity_setup (Real dt, MultiFab*& delta_rhs, MultiFab**& viscn, MultiFab**& viscnp1); // // Compute level projection. // void level_projector (Real dt, Real time, int iteration); // // Compute dpdt // void calcDpdt(); // // Ensure state is consistent, i.e. velocity field is nondivergent, // coarse level data are averages of fine level data, pressure is zero. // virtual void post_init_state (); // // Initialize the pressure by iterating the initial timestep. // virtual void post_init_press (Real& dt_init, Array& nc_save, Array& dt_save); // // Interpolate cell-centered cync correction from coarse to fine. // void SyncInterp (MultiFab& CrseSync, int c_lev, MultiFab& FineSync, int f_lev, IntVect& ratio, int src_comp, int dest_comp, int num_comp, int increment, Real dt_clev, int** bc_orig_qty, int which_interp = 0, int state_comp = -1); // // Two virtual hooks for anelastic SyncInterp. // virtual void ScaleCrseSyncInterp (FArrayBox& cdata, int c_lev, int num_comp) {} virtual void reScaleFineSyncInterp (FArrayBox& fdata, int f_lev, int num_comp) {} // // Bilinear interpolate nodal pressures from coarse to fine. // void SyncProjInterp (MultiFab& phi, int c_lev, MultiFab& P_new, MultiFab& P_old, int f_lev, IntVect& ratio, bool first_crse_step_after_initial_iters, Real cur_crse_pres_time, Real prev_crse_pres_time); // // Average a fine multifab down onto a coarse one. // void avgDown (const BoxArray& grids, const BoxArray& fgrids, MultiFab& S_crse, MultiFab& S_fine, MultiFab& volume, MultiFab& fvolume, int c_level, int f_level, int strt_comp, int num_comp, const IntVect& fratio); // // Average fine down to coarse in the ovlp intersection. // void avgDown (const FArrayBox& fine_fab, const FArrayBox& crse_fab, const FArrayBox& fine_vol, const FArrayBox& crse_vol, int f_level, int c_level, const Box& ovlp, int start_comp, int num_comp, const IntVect& fratio); // // Average fine down to coarse in the ovlp intersection. // static void avgDown_doit (const FArrayBox& fine_fab, const FArrayBox& crse_fab, const FArrayBox& fine_vol, const FArrayBox& crse_vol, int f_level, int c_level, const Box& ovlp, int start_comp, int num_comp, const IntVect& fratio); // // Inject fine pressure nodes down onto coarse nodes. // void injectDown (const Box& ovlp, FArrayBox& Pcrse, const FArrayBox& Pfine, IntVect& fine_ratio); // // Test for consistency between fine dirichlet and coarse nodes. // void testInject (const Box& ovlp, FArrayBox& Pcrse, const FArrayBox& Pfine, IntVect& fine_ratio); // // Compute the level sync correction. // virtual void level_sync (int crse_iteration); // // Compute the mac sync correction. // virtual void mac_sync (); virtual void sync_setup (MultiFab*& DeltaSsync); virtual void sync_cleanup (MultiFab*& DeltaSsync); // // Reflux function. // virtual void reflux (); virtual void avgDown (); // Average down for all the state types. void avgDown (int comp); // Average down for a single StateType scalar // // Compile rho_avg in advance. // void initRhoAvg (Real alpha); void incrRhoAvg (Real alpha); void incrRhoAvg (const MultiFab& rho_incr, int sComp, Real alpha); // // Compile p_avg in advance. // void incrPAvg (); // // Virtual function get fluxes out of the advection routines. // virtual void pullFluxes (int gridno, int start_ind, int ncomp, FArrayBox& xflux, FArrayBox& yflux, FArrayBox& zflux, Real dt); // // Compute viscous terms. // virtual void getViscTerms (MultiFab& visc_terms, int src_comp, int num_comp, Real time); // // Calculate divU, which sets them to zero by default. // virtual void calc_divu (Real time, Real dt, MultiFab& fab); // // Calculate dSdT, which sets them to zero by default. // virtual void calc_dsdt (Real time, Real dt, MultiFab& fab); // // Get the forcing term. // void getForce (FArrayBox& force, int gridno, int ngrow, int strt_comp, int num_comp, const FArrayBox& Rho); // // Get state data. // MultiFab* getState (int ngrow, int state_indx, int strt_comp, int num_comp, Real time); // // Get pressure gradient data via fill-patching. // void getGradP (MultiFab& gp, Real time); // // Get dSdt from the state data. // MultiFab* getDsdt (int ngrow, Real time); // // Fill ghost cells of state. // void FillStateBndry (Real time, int state_indx, int src_comp, int num_comp); // // Calculate nonuniform viscosity and diffusivity // virtual void calcViscosity (const Real time, const Real dt, const int iteration, const int ncycle); virtual void calcDiffusivity (const Real time, const Real dt, const int iteration, const int ncycle, const int src_comp = 0, const int num_comp = 1); virtual void getViscosity (MultiFab* viscosity[BL_SPACEDIM], const Real time); virtual void getDiffusivity (MultiFab* diffusivity[BL_SPACEDIM], const Real time, const int state_comp, const int dst_comp, const int num_comp); void center_to_edge_plain (const FArrayBox& ccfab, FArrayBox& ecfab, int sComp, int dComp, int nComp); // // Called in grid_places after other tagging routines to modify // the list of tagged points // virtual void manual_tags_placement (TagBoxArray& tags, Array& bf_lev); NavierStokes& getLevel (int lev) { return *(NavierStokes*) &parent->getLevel(lev); } Diffusion& getDiffusion () { BL_ASSERT(diffusion); return *diffusion; } SyncRegister& getSyncReg () { BL_ASSERT(sync_reg); return *sync_reg; } FluxRegister& getAdvFluxReg () { BL_ASSERT(advflux_reg); return *advflux_reg; } FluxRegister& getAdvFluxReg (int lev) { return getLevel(lev).getAdvFluxReg(); } FluxRegister& getViscFluxReg () { BL_ASSERT(viscflux_reg); return *viscflux_reg; } FluxRegister& getViscFluxReg (int lev) { return getLevel(lev).getViscFluxReg(); } protected: // // MAC edge velocities. // MultiFab* u_mac; MultiFab* u_macG; MultiFab* u_corr; // // Advective update terms. // MultiFab* aofs; // // RHS for the MAC projection. // MultiFab* mac_rhs; Diffusion* diffusion; // // MultiFab arrays for variable viscosity and diffusivity // MultiFab *viscn_cc, *viscnp1_cc; MultiFab *diffn_cc, *diffnp1_cc; // // Volume and area fractions. // MultiFab volume; MultiFab area[BL_SPACEDIM]; // // Sync update quantities. // // Average rho over a composite timestep. // Used only in the multlilevel sync projection // MultiFab* rho_avg; // // Average p over a composite timestep. // Used only to average fine pressure data to coarse. // MultiFab* p_avg; MultiFab* Vsync; // Velocity sync update storage MultiFab* Ssync; // Scalar sync update storage // // Density at time n+1/2 (used in advance). // MultiFab* rho_half; // // Density at prev_time used in advance(). // MultiFab* rho_ptime; // // Density at cur_time used in advance(). // MultiFab* rho_ctime; // // Data structure used to compute RHS for sync project. // SyncRegister* sync_reg; // // Data structures to store advective and viscous refluxing quantities // on coarse-fine grid interfaces. // FluxRegister* advflux_reg; FluxRegister* viscflux_reg; // // Radii for r-z calculations. // PArray radius; // // Flag for doing first step after regrid // bool is_first_step_after_regrid; // // Intersection of current BoxArray with that from before regrid. // BoxArray old_intersect_new; // // Static objects. // static Godunov* godunov; static ErrorList err_list; static BCRec phys_bc; static Projection* projector; static MacProj* mac_projector; // // Internal parameters for timestepping. // static Real init_shrink; // reduction factor of first esimated timestep static int init_iter; // # of timestep iterations for initial pressure static Real cfl; // desired maximum cfl static Real change_max; // maximum change in dt over a timestep static Real fixed_dt; // set > 0 to specify dt static int initial_iter; // flag for initial pressure iterations static int initial_step; // flag for initial iterations static Real dt_cutoff; // minimum dt allowed static int sum_interval; // number of timesteps for conservation stats // // Internal parameters for options. // static int radius_grow; static int verbose; static Real gravity; static int NUM_SCALARS; // number of non-velocity components static int NUM_STATE; // total number of state variables // // Controls over how the convective and diffusive terms are calculated // for each state variable. // static Array advectionType; static Array diffusionType; // // Viscosity parameters. // static Array is_diffusive; // does variable diffuse? static Array visc_coef; // const coef viscosity terms static Real visc_tol; static Real visc_abs_tol; static Real be_cn_theta; static int variable_vel_visc; // variable viscosity flag static int variable_scal_diff; // variable scalar diffusion flag // // Internal switches. // static int Temp; static int do_temp; static int do_sync_proj; static int do_MLsync_proj; static int do_reflux; static int modify_reflux_normal_vel; static int do_mac_proj; static int do_divu_sync; static int do_refine_outflow; // The following three items control static int do_derefine_outflow; // how grids are treated at static int Nbuf_outflow; // outflow boundaries. // // Member when pressure defined at points in time rather than interval // static int Dpdt_Type; // // Members for non-zero divu. // static int additional_state_types_initialized; static int Divu_Type; static int Dsdt_Type; static int num_state_type; static int have_divu; static int have_dsdt; static Real divu_relax_factor; static int S_in_vel_diffusion; static int do_init_vort_proj; static int do_init_proj; // // Running statistics controls // static int do_running_statistics; // // Control velocity vs momentum update // static int do_mom_diff; static int predict_mom_together; static bool def_harm_avg_cen2edge; }; #endif /*_NavierStokes_H_*/ ccseapps-2.5/CCSEApps/iamrlib/PROJECTION_2D.F0000644000175000017500000004554111634153073021417 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: PROJECTION_2D.F,v 1.38 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "PROJECTION_F.H" #include "ArrayLim.H" #define SDIM 2 #if defined(BL_USE_FLOAT) || defined(BL_T3E) || defined(BL_CRAY) #define SMALL 1.0e-10 #else #define SMALL 1.0d-10 #endif subroutine FORT_FILTERP ( & pnew,scratch,DIMS(p), & lo,hi,dx,fac, & wrap_around_x,wrap_around_y) c c ---------------------------------------------------------- c filter the pressure coming out of the level projection c c pnew := pnew - fac * lap_5pt(pnew) c c INPUTS / OUTPUTS: c pnew => c pnew <=> c p_lo,p_hi => index limits of pressure array c lo,hi => index limits of cell centered interior c fac => fudge factor for filtering c wrap_around_x => is this a single periodic box in the x-direction c wrap_around_y => is this a single periodic box in the y-direction c c ---------------------------------------------------------- c integer DIMDEC(p) REAL_T pnew(DIMV(p)) REAL_T scratch(DIMV(p)) integer lo(2), hi(2) REAL_T dx(2) REAL_T fac integer wrap_around_x integer wrap_around_y integer i, j if ( abs(dx(1)-dx(2)) .gt. 1.D-8 .and. fac .gt. 1.D-4 )then print *, 'is filter properly formatted for dx != dy ?' end if do j = lo(2)+1, hi(2) do i = lo(1)+1, hi(1) scratch(i,j) = four * pnew(i,j) - $ (pnew(i-1,j) + pnew(i+1,j) + pnew(i,j-1) + pnew(i,j+1) ) scratch(i,j) = - eighth * scratch(i,j) * fac end do end do if (wrap_around_x .eq. 1) then i = lo(1) do j = lo(2)+1, hi(2) scratch(i,j) = four * pnew(i,j) - $ (pnew(hi(1),j) + pnew(i+1,j) + pnew(i,j-1) + pnew(i,j+1) ) scratch(i,j) = - eighth * scratch(i,j) * fac end do i = hi(1)+1 do j = lo(2)+1, hi(2) scratch(i,j) = four * pnew(i,j) - $ (pnew(i-1,j) + pnew(lo(1)+1,j) + pnew(i,j-1) + pnew(i,j+1) ) scratch(i,j) = - eighth * scratch(i,j) * fac end do end if if (wrap_around_y .eq. 1) then j = lo(2) do i = lo(1)+1, hi(1) scratch(i,j) = four * pnew(i,j) - $ (pnew(i-1,j) + pnew(i+1,j) + pnew(i,hi(2)) + pnew(i,j+1) ) scratch(i,j) = - eighth * scratch(i,j) * fac end do j = hi(2)+1 do i = lo(1)+1, hi(1) scratch(i,j) = four * pnew(i,j) - $ (pnew(i-1,j) + pnew(i+1,j) + pnew(i,j-1) + pnew(i,lo(2)+1) ) scratch(i,j) = - eighth * scratch(i,j) * fac end do end if if (wrap_around_x .eq. 1 .and. wrap_around_y .eq. 1) then i = lo(1) j = lo(2) scratch(i,j) = four * pnew(i,j) - $ (pnew(hi(1),j) + pnew(i+1,j) + pnew(i,hi(2)) + pnew(i,j+1) ) scratch(i,j) = - eighth * scratch(i,j) * fac i = hi(1)+1 j = lo(2) scratch(i,j) = four * pnew(i,j) - $ (pnew(i-1,j) + pnew(lo(1)+1,j) + pnew(i,hi(2)) + pnew(i,j+1) ) scratch(i,j) = - eighth * scratch(i,j) * fac i = lo(1) j = hi(2)+1 scratch(i,j) = four * pnew(i,j) - $ (pnew(hi(1),j) + pnew(i+1,j) + pnew(i,j-1) + pnew(i,lo(2)+1) ) scratch(i,j) = - eighth * scratch(i,j) * fac i = hi(1)+1 j = hi(2)+1 scratch(i,j) = four * pnew(i,j) - $ (pnew(i-1,j) + pnew(lo(1)+1,j) + pnew(i,j-1) + pnew(i,lo(2)+1) ) scratch(i,j) = - eighth * scratch(i,j) * fac end if do j = lo(2)+1, hi(2) do i = lo(1)+1, hi(1) pnew(i,j) = pnew(i,j) + scratch(i,j) end do end do if (wrap_around_x .eq. 1) then do j = lo(2)+1, hi(2) pnew(lo(1) ,j) = pnew(lo(1) ,j) + scratch(lo(1) ,j) pnew(hi(1)+1,j) = pnew(hi(1)+1,j) + scratch(hi(1)+1,j) end do end if if (wrap_around_y .eq. 1) then do i = lo(1)+1, hi(1) pnew(i,lo(2) ) = pnew(i,lo(2) ) + scratch(i,lo(2) ) pnew(i,hi(2)+1) = pnew(i,hi(2)+1) + scratch(i,hi(2)+1) end do end if if (wrap_around_x .eq. 1 .and. wrap_around_y .eq. 1) then pnew(lo(1) ,lo(2) ) = pnew(lo(1) ,lo(2) ) + scratch(lo(1) ,lo(2) ) pnew(hi(1)+1,lo(2) ) = pnew(hi(1)+1,lo(2) ) + scratch(hi(1)+1,lo(2) ) pnew(lo(1) ,hi(2)+1) = pnew(lo(1) ,hi(2)+1) + scratch(lo(1) ,hi(2)+1) pnew(hi(1)+1,hi(2)+1) = pnew(hi(1)+1,hi(2)+1) + scratch(hi(1)+1,hi(2)+1) end if end subroutine FORT_ACCEL_TO_VEL( lo, hi, & uold,DIMS(uold), & dt, & unew,DIMS(unew) ) c c This function converts unew into a velocity via c Unew = Uold + alpha*Unew c integer lo(SDIM), hi(SDIM) REAL_T dt integer DIMDEC(uold),DIMDEC(unew) REAL_T uold(DIMV(uold),SDIM) REAL_T unew(DIMV(unew),SDIM) integer i, j, n do n = 1, SDIM do j = lo(2)-1, hi(2)+1 do i = lo(1)-1, hi(1)+1 unew(i,j,n) = uold(i,j,n) + dt*unew(i,j,n) end do end do end do end subroutine FORT_VEL_TO_ACCEL( lo, hi, & unew,DIMS(unew), & uold,DIMS(uold), & dt ) c c This function converts unew into an acceleration c integer lo(SDIM), hi(SDIM) REAL_T dt integer DIMDEC(unew),DIMDEC(uold) REAL_T uold(DIMV(uold),SDIM) REAL_T unew(DIMV(unew),SDIM) integer i, j, n REAL_T dt_inv dt_inv = one/dt do n = 1, SDIM do j = lo(2)-1, hi(2)+1 do i = lo(1)-1, hi(1)+1 unew(i,j,n) = (unew(i,j,n)-uold(i,j,n))*dt_inv end do end do end do end subroutine FORT_PROJ_UPDATE( & boxlo, boxhi, nvar, ngrow, & un, DIMS(un), & alpha, & uo, DIMS(uo) ) c c This function updates un via un = un + alpha*uo c The loop bounds are determined in the C++ c integer boxlo(SDIM), boxhi(SDIM), nvar, ngrow REAL_T alpha integer DIMDEC(un),DIMDEC(uo) REAL_T un(DIMV(un),nvar) REAL_T uo(DIMV(uo),nvar) integer i, j, n do n = 1, nvar do j = boxlo(2), boxhi(2) do i = boxlo(1), boxhi(1) un(i,j,n) = un(i,j,n) + alpha*uo(i,j,n) end do end do end do end subroutine FORT_RADMPY(a,DIMS(grid),domlo,domhi,ng,r,nr,bogus_value) c c multiply A by Radius r c c c NOTE: THIS ROUTINE HAS BEEN MODIFIED SO THAT ALL VALUES c OUTSIDE THE DOMAIN ARE SET TO BOGUS VALUE c integer ng,nr integer DIMDEC(grid) integer domlo(2), domhi(2) REAL_T a(ARG_L1(grid)-ng:ARG_H1(grid)+ng, $ ARG_L2(grid)-ng:ARG_H2(grid)+ng) REAL_T r(ARG_L1(grid)-nr:ARG_H1(grid)+nr) REAL_T bogus_value integer i, j do j = ARG_L2(grid)-ng, ARG_H2(grid)+ng do i = ARG_L1(grid)-ng, ARG_H1(grid)+ng a(i,j) = r(i)*a(i,j) end do end do if (ARG_L1(grid)-ng .lt. domlo(1)) then do j = ARG_L2(grid)-ng, ARG_H2(grid)+ng do i = ARG_L1(grid)-ng, domlo(1)-1 a(i,j) = bogus_value end do end do end if if (ARG_H1(grid)+ng .gt. domhi(1)) then do j = ARG_L2(grid)-ng, ARG_H2(grid)+ng do i = domhi(1)+1, ARG_H1(grid)+ng a(i,j) = bogus_value end do end do end if end subroutine FORT_RADDIV(a,DIMS(grid),domlo,domhi,ng,r,nr,bogus_value) c c divide A by Radius r c c c NOTE: THIS ROUTINE HAS BEEN MODIFIED SO THAT ALL VALUES c OUTSIDE THE DOMAIN ARE SET TO BOGUS VALUE c integer ng,nr integer DIMDEC(grid) integer domlo(2), domhi(2) REAL_T a(ARG_L1(grid)-ng:ARG_H1(grid)+ng, $ ARG_L2(grid)-ng:ARG_H2(grid)+ng) REAL_T r(ARG_L1(grid)-nr:ARG_H1(grid)+nr) REAL_T bogus_value integer i, j do j = ARG_L2(grid)-ng, ARG_H2(grid)+ng do i = ARG_L1(grid)-ng, ARG_H1(grid)+ng a(i,j) = a(i,j)/r(i) end do end do if (ARG_L1(grid)-ng .lt. domlo(1)) then do j = ARG_L2(grid)-ng, ARG_H2(grid)+ng do i = ARG_L1(grid)-ng, domlo(1)-1 a(i,j) = bogus_value end do end do end if if (ARG_H1(grid)+ng .gt. domhi(1)) then do j = ARG_L2(grid)-ng, ARG_H2(grid)+ng do i = domhi(1)+1, ARG_H1(grid)+ng a(i,j) = bogus_value end do end do end if end subroutine FORT_HGN2C( & isrz,lrweighted, DIMS(nodedat), nodedat, & DIMS(ccdat), lo, hi, ccdat) c ---------------------------------------------------------- c HGN2C c averages node centered data to cell centers for use in c holy grail projection implicit none integer isrz,lrweighted integer lo(SDIM), hi(SDIM) integer DIMDEC(ccdat) integer DIMDEC(nodedat) REAL_T nodedat(DIMV(nodedat)) REAL_T ccdat(DIMV(ccdat)) integer i,j if (ARG_H1(ccdat) .lt. lo(1) .or. & ARG_L1(ccdat) .gt. hi(1) .or. & ARG_H2(ccdat) .lt. lo(2) .or. & ARG_L2(ccdat) .gt. hi(2) .or. & ARG_H1(nodedat) .lt. lo(1)+1 .or. & ARG_L1(nodedat) .gt. hi(1) .or. & ARG_H2(nodedat) .lt. lo(2)+1 .or. & ARG_L2(nodedat) .gt. hi(2) ) then call bl_abort("FORT_HG_CELL_TO_NODE: bad index limits") end if if(isrz.eq.1.and.lrweighted.ne.1)then call bl_abort('FORT_HGN2C: isrz=1 and lrweighted!=1 not implmented') end if do j=lo(2),hi(2) do i=lo(1),hi(1) ccdat(i,j) = fourth*(nodedat(i,j)+nodedat(i+1,j)+ & nodedat(i,j+1)+nodedat(i+1,j+1)) end do end do end subroutine FORT_HGC2N( & nghost, DIMS(dat), dat, rcen, & DIMS(rhs), rhs, & domlo, domhi, dr, is_rz, imax) c c ---------------------------------------------------------- c HGC2N c averages cell centered data to nodes for use in c holy grail projection c c INPUTS / OUTPUTS: c nghost => indicates buffer of rhs that does not need values c dat => cell centered array to be averaged c DIMS(dat) => index limits of dat c rcen => r-coordinate cell centers if geoem is r-z; c otherwise, should be 1 c rhslo,rhshi => index extents of rhs c rhs <= node centered array with results c ---------------------------------------------------------- c implicit none integer nghost integer domlo(SDIM), domhi(SDIM) integer DIMDEC(dat) integer DIMDEC(rhs) REAL_T dr REAL_T rcen(DIM1(dat)) REAL_T dat(DIMV(dat)) REAL_T rhs(DIMV(rhs)) integer is_rz, imax integer i, j REAL_T factor, rhi, rlo if (ARG_L1(rhs)+1 .lt. ARG_L1(dat) .or. $ ARG_H1(rhs)-1 .gt. ARG_H1(dat) .or. & ARG_L2(rhs)+1 .lt. ARG_L2(dat) .or. $ ARG_H2(rhs)-1 .gt. ARG_H2(dat)) then call bl_abort("FORT_HG_CELL_TO_NODE: bad index limits") end if if (is_rz.ne.1) then do j=ARG_L2(rhs)+nghost,ARG_H2(rhs)-nghost do i=ARG_L1(rhs)+nghost,ARG_H1(rhs)-nghost rhs(i,j) = fourth*(dat(i-1,j-1)+dat(i-1,j)+ & dat(i ,j-1)+dat(i ,j) ) end do end do else #if BL_PRVERSION == 9 do j=ARG_L2(rhs)+nghost,ARG_H2(rhs)-nghost do i=ARG_L1(rhs)+nghost,ARG_H1(rhs)-nghost if (i .eq. imax) then rhi = rcen(i-1) else rhi = rcen(i) end if if (i .eq. 0) then rlo = rcen(i) else rlo = rcen(i-1) end if rhs(i,j) = fourth*(rlo * (dat(i-1,j-1) + dat(i-1,j)) + & rhi * (dat(i ,j-1) + dat(i ,j))) end do end do factor = dr/24.0D0 do j=ARG_L2(rhs)+nghost,ARG_H2(rhs)-nghost do i=ARG_L1(rhs)+nghost,ARG_H1(rhs)-nghost if (i .eq. imax) then rhi = -one else rhi = one end if if (i .eq. 0) then rlo = -one else rlo = one end if rhs(i,j) = rhs(i,j) + factor * & (rlo * (dat(i-1,j-1) + dat(i-1,j)) - & rhi * (dat(i ,j-1) + dat(i ,j))) end do end do #else do j=ARG_L2(rhs)+nghost,ARG_H2(rhs)-nghost do i=ARG_L1(rhs)+nghost,ARG_H1(rhs)-nghost if (i .eq. imax) then rhi = rcen(i-1) else rhi = rcen(i) end if if (i .eq. 0) then rlo = rcen(i) else rlo = rcen(i-1) end if rhs(i,j) = fourth*(rlo * (dat(i-1,j-1) + dat(i-1,j)) + & rhi * (dat(i ,j-1) + dat(i ,j))) if (i .eq. 0) rhs(i,j) = half * rhs(i,j) end do end do #endif end if end c ::: ----------------------------------------------------------- c ::: This routine will compute D (U / dt + sigma G^perp phi) c ::: c ::: NOTE: phi is node-centered c ::: sigma is cell-centered c ::: U is cell-centered c ::: c ::: INPUTS/OUTPUTS: c ::: phi => node centered data c ::: DIMS(phi) => index limits for phi c ::: sigma => cell-centered coefficient array c ::: DIMS(sigma)=> index limits for sigma c ::: u => cell-centered velocity array c ::: DIMS(u) => index limits for u c ::: divgp <= node-centered divergence of gradient c ::: DIMS(divgp)=> index limits for divgp c ::: lo,hi => node-centered subregion of divgp to define c ::: dx => cell sizes c ::: mult => scalar multiplicative factor c ::: ----------------------------------------------------------- subroutine FORT_FILTRHS(phi,DIMS(phi),sigma,DIMS(sigma), & divgp,DIMS(divgp), & lo,hi,dx,mult,is_rz) implicit none integer DIMDEC(phi) integer DIMDEC(sigma) integer DIMDEC(divgp) integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM), mult REAL_T phi(DIMV(phi)) REAL_T sigma(DIMV(sigma)) REAL_T divgp(DIMV(divgp)) integer is_rz integer i, j REAL_T p1, p2, p3, p4, denom REAL_T rminv,rpinv,fac REAL_T gpy_ul,gpy_ur,gpy_ll,gpy_lr REAL_T pext, vext #if BL_PRVERSION==9 c FOR NINE-POINT STENCIL denom = one/(twelve*dx(1)**2) + one/(twelve*dx(2)**2) #else c FOR FIVE-POINT STENCIL denom = one/(four*dx(1)**2) + one/(four*dx(2)**2) #endif do j = lo(2), hi(2) do i = lo(1), hi(1) p1 = sigma(i-1,j-1)*(-phi(i-1,j-1) + phi(i ,j-1) & +phi(i-1,j ) - phi(i ,j )) p2 = sigma(i-1,j )*(-phi(i-1,j+1) + phi(i ,j+1) & +phi(i-1,j) - phi(i ,j )) p3 = sigma(i ,j-1)*(-phi(i+1,j-1) + phi(i ,j-1) & +phi(i+1,j) - phi(i ,j )) p4 = sigma(i ,j )*(-phi(i+1,j+1) + phi(i ,j+1) & +phi(i+1,j) - phi(i ,j )) divgp(i,j) = denom*(p1+p2+p3+p4) enddo enddo if (is_rz .eq. 1) then c extra term added to DGphi for cylindrical coordinates do j = lo(2), hi(2) do i = lo(1), hi(1) rpinv = half / (dble(i)+half) rminv = half / (dble(i)-half) pext = ((sigma(i-1,j-1) * (phi(i,j-1) - phi(i,j)) + $ sigma(i-1,j ) * (phi(i,j+1) - phi(i,j))) * rminv - $ (sigma(i ,j-1) * (phi(i,j-1) - phi(i,j)) + $ sigma(i ,j ) * (phi(i,j+1) - phi(i,j))) * rpinv) divgp(i,j) = divgp(i,j) + denom*pext enddo enddo c extra term added to DGbarphi for cylindrical coordinates -- c here we subtract it since we want D G^perp phi fac = one / (twelve * dx(2)**2) do j = lo(2), hi(2) do i = lo(1), hi(1) rminv = fac / (dble(i)-half) rpinv = fac / (dble(i)+half) gpy_ur = half * sigma(i ,j ) * ( phi(i+1,j+1) + phi(i,j+1) $ -phi(i+1,j ) - phi(i,j )) gpy_ul = half * sigma(i-1,j ) * ( phi(i-1,j+1) + phi(i,j+1) $ -phi(i-1,j ) - phi(i,j )) gpy_lr = half * sigma(i ,j-1) * ( phi(i+1,j ) + phi(i,j ) $ -phi(i+1,j-1) - phi(i,j-1)) gpy_ll = half * sigma(i-1,j-1) * ( phi(i-1,j ) + phi(i,j ) $ -phi(i-1,j-1) - phi(i,j-1)) vext = (gpy_lr - gpy_ur)*rpinv $ +(gpy_ul - gpy_ll)*rminv divgp(i,j) = divgp(i,j) - vext enddo enddo endif do j = lo(2), hi(2) do i = lo(1), hi(1) divgp(i,j) = divgp(i,j) * mult enddo enddo end ccseapps-2.5/CCSEApps/iamrlib/DIFFUSION_F.H0000644000175000017500000002273111634153073021207 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _DIFFUSION_F_H #define _DIFFUSION_F_H /* ** $Id: DIFFUSION_F.H,v 1.13 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_VISCFLUX_VC vscflxvc # define FORT_VISCFLUX_CC vscflxcc # define FORT_VISCSYNCFLUX viscsyncflux # define FORT_HOOPSRC hoopsrc # define FORT_HOOPRHS hooprhs # define FORT_TENSOR_HOOPSRC tensorhoopsrc # define FORT_TENSOR_HOOPRHS tensorhooprhs # define FORT_SETALPHA setalpha # define FORT_SET_TENSOR_ALPHA settensoralpha # define FORT_DIV_VARMU_SI divvarmusi # define FORT_DIV_MU_SI divmuusii # define FORT_CCTOEDGE cctoedge #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_VISCFLUX_VC VSCFLXVC # define FORT_VISCFLUX_CC VSCFLXCC # define FORT_VISCSYNCFLUX VISCSYNCFLUX # define FORT_HOOPSRC HOOPSRC # define FORT_HOOPRHS HOOPRHS # define FORT_TENSOR_HOOPSRC TENSORHOOPSRC # define FORT_TENSOR_HOOPRHS TENSORHOOPRHS # define FORT_SETALPHA SETALPHA # define FORT_SET_TENSOR_ALPHA SETTENSORALPHA # define FORT_DIV_VARMU_SI DIVVARMUSI # define FORT_DIV_MU_SI DIVMUUSII # define FORT_CCTOEDGE CCTOEDGE # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_VISCFLUX_VC vscflxvc # define FORT_VISCFLUX_CC vscflxcc # define FORT_VISCSYNCFLUX viscsyncflux # define FORT_HOOPSRC hoopsrc # define FORT_HOOPRHS hooprhs # define FORT_TENSOR_HOOPSRC tensorhoopsrc # define FORT_TENSOR_HOOPRHS tensorhooprhs # define FORT_SETALPHA setalpha # define FORT_SET_TENSOR_ALPHA settensoralpha # define FORT_DIV_VARMU_SI divvarmusi # define FORT_DIV_MU_SI divmuusii # define FORT_CCTOEDGE cctoedge # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_VISCFLUX_VC vscflxvc_ # define FORT_VISCFLUX_CC vscflxcc_ # define FORT_VISCSYNCFLUX viscsyncflux_ # define FORT_HOOPSRC hoopsrc_ # define FORT_HOOPRHS hooprhs_ # define FORT_TENSOR_HOOPSRC tensorhoopsrc_ # define FORT_TENSOR_HOOPRHS tensorhooprhs_ # define FORT_SETALPHA setalpha_ # define FORT_SET_TENSOR_ALPHA settensoralpha_ # define FORT_DIV_VARMU_SI divvarmusi_ # define FORT_DIV_MU_SI divmuusii_ # define FORT_CCTOEDGE cctoedge_ # endif #include extern "C" { void FORT_VISCFLUX_VC (const Real* s_old, const Real* s_new, ARLIM_P(slo), ARLIM_P(shi), const int* lo, const int* hi, const Real* flux, ARLIM_P(f_lo), ARLIM_P(f_hi), const Real* area, ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* betan, const Real* betanp1, ARLIM_P(b_lo), ARLIM_P(b_hi), const Real* dx, const Real* mult, const Real* theta, const int* dir); void FORT_VISCFLUX_CC (const Real* s_old, const Real* s_new, ARLIM_P(slo), ARLIM_P(shi), const int* lo, const int* hi, const Real* flux, ARLIM_P(f_lo), ARLIM_P(f_hi), const Real* area, ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* dx, const Real* mult, const Real* theta, const int* dir); #if (BL_SPACEDIM == 2) void FORT_VISCSYNCFLUX (const Real* ssync, ARLIM_P(slo), ARLIM_P(shi), const int* lo, const int* hi, const Real* xflux, ARLIM_P(xflo), ARLIM_P(xfhi), const Real* yflux, ARLIM_P(yflo), ARLIM_P(yfhi), const Real* xarea, ARLIM_P(axlo), ARLIM_P(axhi), const Real* yarea, ARLIM_P(aylo), ARLIM_P(ayhi), const Real* dx, const Real * mult); #endif #if (BL_SPACEDIM == 3) void FORT_VISCSYNCFLUX (const Real* ssync, ARLIM_P(slo), ARLIM_P(shi), const int* lo, const int* hi, const Real* xflux, ARLIM_P(xflo), ARLIM_P(xfhi), const Real* yflux, ARLIM_P(yflo), ARLIM_P(yfhi), const Real* zflux, ARLIM_P(zflo), ARLIM_P(zfhi), const Real* xarea, ARLIM_P(axlo), ARLIM_P(axhi), const Real* yarea, ARLIM_P(aylo), ARLIM_P(ayhi), const Real* zarea, ARLIM_P(azlo), ARLIM_P(azhi), const Real* dx, const Real * mult); #endif void FORT_HOOPSRC (ARLIM_P(grid_lo), ARLIM_P(grid_hi), Real *fab, ARLIM_P(fab_lo), ARLIM_P(fab_hi), const Real *u, ARLIM_P(u_lo), ARLIM_P(u_hi), const Real *r, const Real* mu); void FORT_HOOPRHS (Real *fab, ARLIM_P(fab_lo), ARLIM_P(fab_hi), const Real *u, ARLIM_P(u_lo), ARLIM_P(u_hi), const Real* r, const Real* b, const Real *vol, ARLIM_P(vol_lo), ARLIM_P(vol_hi)); void FORT_SETALPHA (Real *fab, ARLIM_P(fab_lo), ARLIM_P(fab_hi), const int* lo, const int* hi, const Real* r, ARLIM_P(r_lo), ARLIM_P(r_hi), const Real* b, const Real *vfab, ARLIM_P(v_lo), ARLIM_P(v_hi), const Real *denfab, ARLIM_P(den_lo), ARLIM_P(den_hi), int* usehoop, int* useden); void FORT_SET_TENSOR_ALPHA (Real *fab, ARLIM_P(fab_lo), ARLIM_P(fab_hi), const int* lo, const int* hi, const Real* r, ARLIM_P(r_lo), ARLIM_P(r_hi), const Real* b, const Real *vfab, ARLIM_P(v_lo), ARLIM_P(v_hi), const Real *denfab, ARLIM_P(den_lo), ARLIM_P(den_hi), const Real *betax, ARLIM_P(betax_lo), ARLIM_P(betax_hi), const Real *betay, ARLIM_P(betay_lo), ARLIM_P(betay_hi), #if (BL_SPACEDIM ==3) const Real *betaz, ARLIM_P(betaz_lo), ARLIM_P(betaz_hi), #endif const int* isrz); void FORT_TENSOR_HOOPRHS (const int* xvel_comp, Real *fab, ARLIM_P(fab_lo), ARLIM_P(fab_hi), const Real *u, ARLIM_P(u_lo), ARLIM_P(u_hi), const Real* r, const Real* b, const Real *vol, ARLIM_P(vol_lo), ARLIM_P(vol_hi), const Real *betax, ARLIM_P(betax_lo), ARLIM_P(betax_hi), const Real *betay, ARLIM_P(betay_lo), ARLIM_P(betay_hi)); void FORT_TENSOR_HOOPSRC (const int* xvel_comp, ARLIM_P(grid_lo), ARLIM_P(grid_hi), Real *fab, ARLIM_P(fab_lo), ARLIM_P(fab_hi), const Real *u, ARLIM_P(u_lo), ARLIM_P(u_hi), const Real *r, const Real *betax, ARLIM_P(betax_lo), ARLIM_P(betax_hi), const Real *betay, ARLIM_P(betay_lo), ARLIM_P(betay_hi)); void FORT_CCTOEDGE(const int* lo, const int* hi, ARLIM_P(blo), ARLIM_P(bhi), const Real* betadat, ARLIM_P(betaxlo), ARLIM_P(betaxhi), Real* betax, ARLIM_P(betaylo), ARLIM_P(betayhi), Real* betay #if (BL_SPACEDIM==3) , ARLIM_P(betazlo), ARLIM_P(betazhi), Real* betaz #endif ); void FORT_DIV_MU_SI(const int* lo, const int* hi, const Real* dx, const Real* mu, ARLIM_P(divunlo), ARLIM_P(divunhi), const Real* divun_dat, ARLIM_P(divmusilo), ARLIM_P(divmusihi), const Real* divmusi); void FORT_DIV_VARMU_SI(const int* lo, const int* hi, const Real* dx, ARLIM_P(divunlo), ARLIM_P(divunhi), const Real* divun_dat, ARLIM_P(betaxlo), ARLIM_P(betaxhi), const Real* betax, ARLIM_P(betaylo), ARLIM_P(betayhi), const Real* betay, #if (BL_SPACEDIM==3) ARLIM_P(betazlo), ARLIM_P(betazhi), const Real* betaz, #endif ARLIM_P(divmusilo), ARLIM_P(divmusihi), const Real* divmusi); } #endif #endif /*_DIFFUSION_F_H*/ ccseapps-2.5/CCSEApps/iamrlib/PROB_F.H0000644000175000017500000002067111634153073020424 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _PROB_F_H_ #define _PROB_F_H_ /* ** $Id: PROB_F.H,v 1.9 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_INITDATA initdata # define FORT_DENFILL denfill # define FORT_ADVFILL advfill # define FORT_XVELFILL xvelfill # define FORT_YVELFILL yvelfill # define FORT_ZVELFILL zvelfill # define FORT_PRESFILL presfill # define FORT_TEMPFILL tempfill # define FORT_DIVUFILL divufill # define FORT_DSDTFILL dsdtfill # define FORT_DENERROR denerror # define FORT_ADVERROR adverror # define FORT_TEMPERROR temperror # define FORT_MVERROR mverror #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_INITDATA INITDATA # define FORT_DENFILL DENFILL # define FORT_ADVFILL ADVFILL # define FORT_XVELFILL XVELFILL # define FORT_YVELFILL YVELFILL # define FORT_ZVELFILL ZVELFILL # define FORT_PRESFILL PRESFILL # define FORT_TEMPFILL TEMPFILL # define FORT_DIVUFILL DIVUFILL # define FORT_DSDTFILL DSDTFILL # define FORT_DENERROR DENERROR # define FORT_ADVERROR ADVERROR # define FORT_TEMPERROR TEMPERROR # define FORT_MVERROR MVERROR # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_INITDATA initdata # define FORT_DENFILL denfill # define FORT_ADVFILL advfill # define FORT_XVELFILL xvelfill # define FORT_YVELFILL yvelfill # define FORT_ZVELFILL zvelfill # define FORT_PRESFILL presfill # define FORT_TEMPFILL tempfill # define FORT_DIVUFILL divufill # define FORT_DSDTFILL dsdtfill # define FORT_DENERROR denerror # define FORT_ADVERROR adverror # define FORT_TEMPERROR temperror # define FORT_MVERROR mverror # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_INITDATA initdata_ # define FORT_DENFILL denfill_ # define FORT_ADVFILL advfill_ # define FORT_XVELFILL xvelfill_ # define FORT_YVELFILL yvelfill_ # define FORT_ZVELFILL zvelfill_ # define FORT_PRESFILL presfill_ # define FORT_TEMPFILL tempfill_ # define FORT_DIVUFILL divufill_ # define FORT_DSDTFILL dsdtfill_ # define FORT_DENERROR denerror_ # define FORT_ADVERROR adverror_ # define FORT_TEMPERROR temperror_ # define FORT_MVERROR mverror_ # endif #include "ArrayLim.H" extern "C" { void FORT_INITDATA (const int* level, const Real* time, const int* lo, const int* hi, const int* nscal, Real* vel, Real* scal, ARLIM_P(s_lo), ARLIM_P(s_hi), Real* press, ARLIM_P(p_lo), ARLIM_P(p_hi), const Real* dx, const Real* xlo, const Real* xhi); void FORT_DENFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_ADVFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_XVELFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_YVELFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); #if (BL_SPACEDIM == 3) void FORT_ZVELFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); #endif void FORT_PRESFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_TEMPFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_DIVUFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_DSDTFILL (Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* dom_lo, const int* dom_hi, const Real* dx, const Real* grd_lo, const Real* time, const int* bc); void FORT_DENERROR (int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* lo, const int* hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); void FORT_ADVERROR (int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* lo, const int* hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); void FORT_TEMPERROR (int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* lo, const int* hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); void FORT_MVERROR (int* tag, ARLIM_P(tlo), ARLIM_P(thi), const int* tagval, const int* clearval, Real* data, ARLIM_P(data_lo), ARLIM_P(data_hi), const int* lo, const int* hi, const int* nvar, const int* domain_lo, const int* domain_hi, const Real* dx, const Real* xlo, const Real* prob_lo, const Real* time, const int* level); } #endif #endif /*_PROB_F_H_*/ ccseapps-2.5/CCSEApps/iamrlib/MacOperator.H0000644000175000017500000000606111634153073021626 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MACOPERATOR_H_ #define _MACOPERATOR_H_ // // $Id: MacOperator.H,v 1.9 2001/08/01 21:50:55 lijewski Exp $ // //========================================================================== // This class defines how mass continuity is defined for the projection operators // in class NavierStokes. For the Mac project, this is done through setting a // linop and a few driver functions, while for the mac project this is done // through a few driver functions which scale variables. //========================================================================== #include #include class MacOperator : public ABecLaplacian { public: MacOperator (const BndryData& mgb, const Real* _h); virtual ~MacOperator (); // // Define the gradient coeficients used by the multigrid object. // void setCoefficients (MultiFab* area, MultiFab& rho, int rho_comp, const Real* dx); // // Initialize the rhs for the level solves. // void defRHS (MultiFab* area, MultiFab& vol, MultiFab& rhs, MultiFab* vel, Real scale); // // Apply the pressure gradient to the mac velocities. // void velUpdate (MultiFab* vel, MultiFab& phi, const MultiFab& Rho, int rho_comp, const Real* dx, Real scale); // // Scale the rhs for the sync solves. // void syncRhs (const MultiFab& Volume, MultiFab& Rhs, Real rhs_scale, const Real* dx); }; #endif ccseapps-2.5/CCSEApps/iamrlib/SYNCREG_F.H0000644000175000017500000000476111634153073020776 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _SYNCREG_F_H_ #define _SYNCREG_F_H_ /* ** $Id: SYNCREG_F.H,v 1.11 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_SRCRSEREG srcrsereg # define FORT_MAKEMASK makemask # define FORT_CONVERTMASK convmask #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_SRCRSEREG SRCRSEREG # define FORT_MAKEMASK MAKEMASK # define FORT_CONVERTMASK CONVMASK # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_SRCRSEREG srcrsereg # define FORT_MAKEMASK makemask # define FORT_CONVERTMASK convmask # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_SRCRSEREG srcrsereg_ # define FORT_MAKEMASK makemask_ # define FORT_CONVERTMASK convmask_ # endif #include extern "C" { void FORT_SRCRSEREG (const Real* fine, ARLIM_P(flo), ARLIM_P(fhi), Real* crse, ARLIM_P(clo), ARLIM_P(chi), const int* lo, const int* hi, const int* dir, const int* ratio); void FORT_MAKEMASK (Real* mask , ARLIM_P(mlo), ARLIM_P(mhi), Real* cells, ARLIM_P(clo), ARLIM_P(chi)); void FORT_CONVERTMASK (Real* mask , ARLIM_P(mlo), ARLIM_P(mhi)); } #endif #endif /*_SYNCREG_F_H_*/ ccseapps-2.5/CCSEApps/iamrlib/NSBld.cpp0000644000175000017500000000426611634153073020754 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: NSBld.cpp,v 1.7 2000/10/02 20:50:15 lijewski Exp $ // #include #include // -------------------------------------------------------------------- // ----- NSBld class instantiation // -------------------------------------------------------------------- NSBld nsbld; LevelBld* getLevelBld() { return &nsbld; } // -------------------------------------------------------------------- // ----- NSBld class implementation // -------------------------------------------------------------------- void NSBld::variableSetUp() { NavierStokes::variableSetUp(); } void NSBld::variableCleanUp() { NavierStokes::variableCleanUp(); } AmrLevel* NSBld::operator()() { return new NavierStokes; } AmrLevel* NSBld::operator()(Amr &papa, int lev, const Geometry &level_geom, const BoxArray &ba, Real time) { return new NavierStokes(papa, lev, level_geom, ba, time); } ccseapps-2.5/CCSEApps/iamrlib/MacOpMacDrivers.H0000644000175000017500000000574311634153073022377 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MACOPMACDRIVERS_H_ //==================================================================== // This header file contains declarations for the MacOperator mac projection // driver routines //==================================================================== // the driver functions for the MAC solves void mac_level_driver( const MacBndry &mac_bndry, const BoxArray &grids, int use_cg_solve, int level, int Density, const Real *dx, Real dt, Real mac_tol, Real mac_abs_tol, Real rhs_scale, MultiFab *area, MultiFab &volume, MultiFab &S, MultiFab &Rhs, MultiFab *u_mac, MultiFab *mac_phi ); // a driver function for computing a sync MAC solve void mac_sync_driver( const MacBndry &mac_bndry, const BoxArray &grids, int use_cg_solve, int level, const Real *dx, Real dt, Real mac_sync_tol, Real mac_abs_tol, Real rhs_scale, MultiFab *area, MultiFab &volume, MultiFab &Rhs, MultiFab *rho_half, MultiFab *mac_sync_phi ); // apply the mac pressure gradient to a velocity field // init, means that velocities are initialized here void mac_vel_update( int init, FArrayBox &uvel, FArrayBox &vvel, #if (BL_SPACEDIM == 3 ) FArrayBox &wvel, #endif const FArrayBox &phi, const FArrayBox *rho, int rho_comp, const Box &grd, int level, int n, const Real *dx, Real scale ); #endif ccseapps-2.5/CCSEApps/iamrlib/NavierStokes.cpp0000644000175000017500000052412011634153073022423 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: NavierStokes.cpp,v 1.229 2003/03/10 20:41:12 lijewski Exp $ // // "Divu_Type" means S, where divergence U = S // "Dsdt_Type" means pd S/pd t, where S is as above // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define GEOM_GROW 1 #define HYP_GROW 3 #define PRESS_GROW 1 #define DIVU_GROW 1 #define DSDT_GROW 1 #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); #define DEF_CLIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ const Real* fabdat = (fab).dataPtr(); // // Static objects. // ErrorList NavierStokes::err_list; BCRec NavierStokes::phys_bc; Projection *NavierStokes::projector = 0; MacProj *NavierStokes::mac_projector = 0; Godunov *NavierStokes::godunov = 0; // // Internal parameters. // int NavierStokes::verbose = 0; Real NavierStokes::cfl = 0.8; Real NavierStokes::init_shrink = 1.0; Real NavierStokes::change_max = 1.1; Real NavierStokes::fixed_dt = -1.0; Real NavierStokes::dt_cutoff = 0.0; int NavierStokes::init_iter = 2; Real NavierStokes::gravity = 0.0; int NavierStokes::initial_step = false; int NavierStokes::initial_iter = false; int NavierStokes::radius_grow = 1; int NavierStokes::sum_interval = -1; int NavierStokes::NUM_SCALARS = 0; int NavierStokes::NUM_STATE = 0; Array NavierStokes::advectionType; Array NavierStokes::diffusionType; bool NavierStokes::def_harm_avg_cen2edge = false; // // ----------------------- viscosity parameters. // Real NavierStokes::be_cn_theta = 0.5; Real NavierStokes::visc_tol = 1.0e-10; // tolerance for viscous solve Real NavierStokes::visc_abs_tol = 1.0e-10; // absolute tol. for visc solve int NavierStokes::variable_vel_visc = 0; // variable viscosity flag int NavierStokes::variable_scal_diff = 0; // variable scalar diffusion flag Array NavierStokes::is_diffusive; Array NavierStokes::visc_coef; // // Internal switches. // int NavierStokes::do_temp = 0; int NavierStokes::Temp = -1; int NavierStokes::do_sync_proj = 1; int NavierStokes::do_MLsync_proj = 1; int NavierStokes::do_reflux = 1; int NavierStokes::modify_reflux_normal_vel = 0; int NavierStokes::do_mac_proj = 1; int NavierStokes::do_init_vort_proj = 0; int NavierStokes::do_init_proj = 1; int NavierStokes::do_refine_outflow = 0; int NavierStokes::do_derefine_outflow = 1; int NavierStokes::Nbuf_outflow = 1; int NavierStokes::do_running_statistics = 0; int NavierStokes::Dpdt_Type = -1; int NavierStokes::do_mom_diff = 0; int NavierStokes::predict_mom_together = 0; // // New members for non-zero divu. // int NavierStokes::additional_state_types_initialized = 0; int NavierStokes::Divu_Type = -1; int NavierStokes::Dsdt_Type = -1; int NavierStokes::have_divu = 0; int NavierStokes::have_dsdt = 0; int NavierStokes::S_in_vel_diffusion = 1; Real NavierStokes::divu_relax_factor = 0.0; int NavierStokes::num_state_type = 2; // for backward compatibility int NavierStokes::do_divu_sync = 0; // for debugging new correction to MLSP static BoxArray GetBndryCells(const BoxArray& ba, int n_grow, const Geometry& geom) { const BoxList blgrids = BoxList(ba); BoxDomain bd; for (int i = 0; i < ba.size(); ++i) { BoxList gCells = BoxLib::boxDiff(BoxLib::grow(ba[i],n_grow),ba[i]); for (BoxList::iterator bli = gCells.begin(); bli != gCells.end(); ++bli) bd.add(BoxLib::complementIn(*bli,blgrids)); } BoxList bl; Array pshifts(27); for (BoxDomain::const_iterator bdi = bd.begin(); bdi != bd.end(); ++bdi) { bl.push_back(*bdi); // // Add in periodic ghost cells shifted to valid region. // geom.periodicShift(geom.Domain(), *bdi, pshifts); for (int i = 0; i < pshifts.size(); i++) { Box shftbox = *bdi + pshifts[i]; bl.push_back(geom.Domain() & shftbox); } } bl.simplify(); return BoxArray(bl); } void NavierStokes::variableCleanUp () { desc_lst.clear(); delete projector; projector = 0; delete mac_projector; mac_projector = 0; delete godunov; godunov = 0; } void NavierStokes::read_geometry () { #if (BL_SPACEDIM == 2) // // Must load coord here because CoordSys hasn't read it in yet. // ParmParse pp("geometry"); int coord; pp.get("coord_sys",coord); if ((CoordSys::CoordType) coord == CoordSys::RZ && phys_bc.lo(0) != Symmetry) { phys_bc.setLo(0,Symmetry); if (ParallelDescriptor::IOProcessor()) std::cout << "\nWarning: Setting phys_bc at xlo to Symmetry\n\n"; } #endif } void NavierStokes::read_params () { ParmParse pp("ns"); pp.query("v",verbose); Array lo_bc(BL_SPACEDIM), hi_bc(BL_SPACEDIM); pp.getarr("lo_bc",lo_bc,0,BL_SPACEDIM); pp.getarr("hi_bc",hi_bc,0,BL_SPACEDIM); for (int i = 0; i < BL_SPACEDIM; i++) { phys_bc.setLo(i,lo_bc[i]); phys_bc.setHi(i,hi_bc[i]); } read_geometry(); // // Check phys_bc against possible periodic geometry // if periodic, must have internal BC marked. // if (Geometry::isAnyPeriodic()) { // // Do idiot check. Periodic means interior in those directions. // for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (Geometry::isPeriodic(dir)) { if (lo_bc[dir] != Interior) { std::cerr << "NavierStokes::variableSetUp:periodic in direction " << dir << " but low BC is not Interior\n"; BoxLib::Abort("NavierStokes::read_params()"); } if (hi_bc[dir] != Interior) { std::cerr << "NavierStokes::variableSetUp:periodic in direction " << dir << " but high BC is not Interior\n"; BoxLib::Abort("NavierStokes::read_params()"); } } } } { // // Do idiot check. If not periodic, should be no interior. // for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (!Geometry::isPeriodic(dir)) { if (lo_bc[dir] == Interior) { std::cerr << "NavierStokes::variableSetUp:Interior bc in direction " << dir << " but not defined as periodic\n"; BoxLib::Abort("NavierStokes::read_params()"); } if (hi_bc[dir] == Interior) { std::cerr << "NavierStokes::variableSetUp:Interior bc in direction " << dir << " but not defined as periodic\n"; BoxLib::Abort("NavierStokes::read_params()"); } } } } // // Get timestepping parameters. // pp.get("cfl",cfl); pp.query("init_iter",init_iter); pp.query("init_shrink",init_shrink); pp.query("dt_cutoff",dt_cutoff); pp.query("change_max",change_max); pp.query("fixed_dt",fixed_dt); pp.query("sum_interval",sum_interval); pp.query("gravity",gravity); // // Get run options. // pp.query("do_temp", do_temp ); int initial_do_sync_proj = do_sync_proj; pp.query("do_sync_proj", do_sync_proj ); pp.query("do_MLsync_proj", do_MLsync_proj ); pp.query("do_reflux", do_reflux ); pp.query("modify_reflux_normal_vel", modify_reflux_normal_vel); pp.query("do_init_vort_proj", do_init_vort_proj); pp.query("do_init_proj", do_init_proj ); pp.query("do_mac_proj", do_mac_proj ); pp.query("do_divu_sync", do_divu_sync ); // // Make sure we don't use divu_sync. // if (do_divu_sync) BoxLib::Error("do_divu_sync == 1 is the wrong setting"); // // This test ensures that if the user toggles do_sync_proj, // the user has knowledge that do_MLsync_proj is meaningless. // if (do_MLsync_proj && !do_sync_proj && initial_do_sync_proj != do_sync_proj) { std::cout << "Mismatched options for NavierStokes\n" << "do_MLsync_proj and do_sync_proj are inconsistent\n"; BoxLib::Abort("NavierStokes::read_params()"); } // // Read viscous/diffusive parameters and array of viscous/diffusive coeffs. // NOTE: at this point, we dont know number of state variables // so just read all values listed. // pp.query("visc_tol",visc_tol); pp.query("visc_abs_tol",visc_abs_tol); pp.query("variable_vel_visc",variable_vel_visc); pp.query("variable_scal_diff",variable_scal_diff); const int n_vel_visc_coef = pp.countval("vel_visc_coef"); const int n_temp_cond_coef = pp.countval("temp_cond_coef"); const int n_scal_diff_coefs = pp.countval("scal_diff_coefs"); if (n_vel_visc_coef != 1) BoxLib::Abort("NavierStokes::read_params(): Only one vel_visc_coef allowed"); if (do_temp && n_temp_cond_coef != 1) BoxLib::Abort("NavierStokes::read_params(): Only one temp_cond_coef allowed"); int n_visc = BL_SPACEDIM + 1 + n_scal_diff_coefs; if (do_temp) n_visc++; visc_coef.resize(n_visc); is_diffusive.resize(n_visc); pp.get("vel_visc_coef",visc_coef[0]); for (int i = 1; i < BL_SPACEDIM; i++) visc_coef[i] = visc_coef[0]; // // Here we set the coefficient for density, which does not diffuse. // visc_coef[Density] = -1; // // Set the coefficients for the scalars, but temperature. // Array scal_diff_coefs(n_scal_diff_coefs); pp.getarr("scal_diff_coefs",scal_diff_coefs,0,n_scal_diff_coefs); int scalId = Density; for (int i = 0; i < n_scal_diff_coefs; i++) { visc_coef[++scalId] = scal_diff_coefs[i]; } // // Set the coefficient for temperature. // if (do_temp) { Temp = ++scalId; pp.get("temp_cond_coef",visc_coef[Temp]); } pp.query("divu_relax_factor",divu_relax_factor); pp.query("S_in_vel_diffusion",S_in_vel_diffusion); pp.query("be_cn_theta",be_cn_theta); if (be_cn_theta > 1.0 || be_cn_theta < .5) BoxLib::Abort("NavierStokes::read_params(): Must have be_cn_theta <= 1.0 && >= .5"); // // Set parameters dealing with how grids are treated at outflow boundaries. // pp.query("do_refine_outflow",do_refine_outflow); pp.query("do_derefine_outflow",do_derefine_outflow); if (do_derefine_outflow) do_refine_outflow = 0; pp.query("Nbuf_outflow",Nbuf_outflow); BL_ASSERT(Nbuf_outflow >= 0); BL_ASSERT(!(Nbuf_outflow <= 0 && do_derefine_outflow == 1)); // // Check whether we are doing running statistics. // pp.query("do_running_statistics",do_running_statistics); // // Are we going to do velocity or momentum update? // pp.query("do_mom_diff",do_mom_diff); pp.query("predict_mom_together",predict_mom_together); if (do_mom_diff == 0 && predict_mom_together == 1) { std::cout << "MAKES NO SENSE TO HAVE DO_MOM_DIFF=0 AND PREDICT_MOM_TOGETHER=1" << std::endl; exit(0); } pp.query("harm_avg_cen2edge", def_harm_avg_cen2edge); } NavierStokes::NavierStokes () : radius(PArrayManage) { rho_avg = 0; rho_half = 0; rho_ptime = 0; rho_ctime = 0; p_avg = 0; Vsync = 0; Ssync = 0; sync_reg = 0; advflux_reg = 0; viscflux_reg = 0; u_mac = 0; u_macG = 0; u_corr = 0; mac_rhs = 0; aofs = 0; diffusion = 0; if (!additional_state_types_initialized) init_additional_state_types(); } NavierStokes::NavierStokes (Amr& papa, int lev, const Geometry& level_geom, const BoxArray& bl, Real time) : AmrLevel(papa,lev,level_geom,bl,time), radius(PArrayManage) { if(!additional_state_types_initialized) init_additional_state_types(); const BoxArray& P_grids = state[Press_Type].boxArray(); // // Alloc old_time pressure. // state[Press_Type].allocOldData(); // // Alloc space for density and temporary pressure variables. // p_avg = 0; rho_avg = 0; if (level > 0) { rho_avg = new MultiFab(grids,1,1); p_avg = new MultiFab(P_grids,1,0); } rho_half = new MultiFab(grids,1,1); rho_ptime = new MultiFab(grids,1,1); rho_ctime = new MultiFab(grids,1,1); // // Build metric coefficients for RZ calculations. // buildMetrics(); // // Build base state rho for atmospheric calculations // this is probably an Atmosphere virtual function. // buildRho0(); // // Set up reflux registers. // sync_reg = 0; if (level > 0 && do_sync_proj) { sync_reg = new SyncRegister(grids,crse_ratio,level); } advflux_reg = 0; viscflux_reg = 0; if (level > 0 && do_reflux) { advflux_reg = new FluxRegister(grids,crse_ratio,level,NUM_STATE); viscflux_reg = new FluxRegister(grids,crse_ratio,level,NUM_STATE); } // // Initialize work multifabs. // Vsync = 0; Ssync = 0; u_mac = 0; u_macG = 0; u_corr = 0; mac_rhs = 0; aofs = 0; // // Set up the level projector. // if (projector == 0) { projector = new Projection(parent,&phys_bc,do_sync_proj, parent->finestLevel(),radius_grow); } projector->install_level(level,this,&radius ); // // Set up the godunov box. // SetGodunov(); // // Set up diffusion. // diffusion = new Diffusion(parent,this, (level > 0) ? getLevel(level-1).diffusion : 0, NUM_STATE,viscflux_reg,volume,area, is_diffusive,visc_coef); // // Allocate the storage for variable viscosity and diffusivity // viscn_cc = 0; viscnp1_cc = 0; if (variable_vel_visc) { viscn_cc = new MultiFab(grids, 1, 1); viscnp1_cc = new MultiFab(grids, 1, 1); } diffn_cc = 0; diffnp1_cc = 0; if (variable_scal_diff) { diffn_cc = new MultiFab(grids, NUM_STATE-Density-1, 1); diffnp1_cc = new MultiFab(grids, NUM_STATE-Density-1, 1); } // // Set up the mac projector. // if (mac_projector == 0) { mac_projector = new MacProj(parent,parent->finestLevel(), &phys_bc,radius_grow); } mac_projector->install_level(level,this,volume,area,&radius ); } NavierStokes::~NavierStokes () { delete rho_avg; delete p_avg; delete rho_half; delete rho_ptime; delete rho_ctime; delete Vsync; delete Ssync; delete sync_reg; delete advflux_reg; delete viscflux_reg; delete [] u_mac; delete [] u_macG; delete [] u_corr; if (mac_projector != 0) mac_projector->cleanup(level); // // Remove the arrays for variable viscosity and diffusivity // and delete the Diffusion object // if (variable_vel_visc) { delete viscn_cc; delete viscnp1_cc; } if (variable_scal_diff) { delete diffn_cc; delete diffnp1_cc; } delete diffusion; } void NavierStokes::init_additional_state_types () { additional_state_types_initialized = 1; // // Set "Temp" from user's variable setup. // int dummy_State_Type; int have_temp = isStateVariable("temp", dummy_State_Type, Temp); have_temp &= (dummy_State_Type == State_Type); BL_ASSERT((do_temp && have_temp) || (!do_temp && !have_temp)); int _Divu = -1; int dummy_Divu_Type; have_divu = 0; have_divu = isStateVariable("divu", dummy_Divu_Type, _Divu); have_divu = have_divu && dummy_Divu_Type == Divu_Type; if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "NavierStokes::init_additional_state_types()::have_divu = " << have_divu << '\n'; } if (have_divu && _Divu!=Divu) { std::cout << "divu must be 0-th, Divu_Type component in the state\n"; BoxLib::Abort("NavierStokes::init_additional_state_types()"); } if (have_divu && do_sync_proj && !do_MLsync_proj) { std::cout << "Must run the ML sync project if have_divu is true " << std::endl; std::cout << " because the divu sync is only implemented in the " << std::endl; std::cout << " multilevel sync (MLsyncProject), not in the single level " << std::endl; std::cout << " (syncProject)." << std::endl; BoxLib::Abort("NavierStokes::init_additional_state_types()"); } int _Dsdt = -1; int dummy_Dsdt_Type; have_dsdt = 0; have_dsdt = isStateVariable("dsdt", dummy_Dsdt_Type, _Dsdt); have_dsdt = have_dsdt && dummy_Dsdt_Type==Dsdt_Type; if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "NavierStokes::init_additional_state_types()::have_dsdt = " << have_dsdt << '\n'; } if (have_dsdt && _Dsdt!=Dsdt) { std::cout << "dsdt must be 0-th, Dsdt_Type component in the state\n"; BoxLib::Abort("NavierStokes::init_additional_state_types()"); } if (have_dsdt && !have_divu) { std::cout << "Must have divu in order to have dsdt\n"; BoxLib::Abort("NavierStokes::init_additional_state_types()"); } num_state_type = desc_lst.size(); if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "NavierStokes::init_additional_state_types: num_state_type = " << num_state_type << '\n'; } } // // Since the pressure solver always stores its estimate of the // pressure solver in Pnew, we need to copy it to Pold at the start. // void NavierStokes::initOldPress () { MultiFab& P_new = get_new_data(Press_Type); MultiFab& P_old = get_old_data(Press_Type); for (MFIter mfi(P_new); mfi.isValid(); ++mfi) { P_old[mfi].copy(P_new[mfi]); } } void NavierStokes::zeroNewPress () { get_new_data(Press_Type).setVal(0); } void NavierStokes::zeroOldPress () { get_old_data(Press_Type).setVal(0); } void NavierStokes::allocOldData () { bool init_pres = !(state[Press_Type].hasOldData()); for (int k = 0; k < num_state_type; k++) { state[k].allocOldData(); } if (init_pres) initOldPress(); } void NavierStokes::removeOldData () { AmrLevel::removeOldData(); } void NavierStokes::SetGodunov() { if (godunov == 0) godunov = new Godunov(); } void NavierStokes::restart (Amr& papa, std::istream& is, bool bReadSpecial) { AmrLevel::restart(papa,is,bReadSpecial); if (projector == 0) { projector = new Projection(parent,&phys_bc,do_sync_proj, parent->finestLevel(),radius_grow); } projector->install_level(level, this, &radius ); // // Set the godunov box. // SetGodunov(); if (mac_projector == 0) { mac_projector = new MacProj(parent,parent->finestLevel(), &phys_bc,radius_grow ); } mac_projector->install_level(level,this,volume,area,&radius ); rho_avg = 0; p_avg = 0; const BoxArray& P_grids = state[Press_Type].boxArray(); // // Alloc space for density and temporary pressure variables. // if (level > 0) { rho_avg = new MultiFab(grids,1,1); p_avg = new MultiFab(P_grids,1,0); } rho_half = new MultiFab(grids,1,1); rho_ptime = new MultiFab(grids,1,1); rho_ctime = new MultiFab(grids,1,1); // // Build metric coeficients for RZ calculations. // buildMetrics(); // // Build base state rho for atmospheric calculations. // This is probably an Atmosphere virtual function. // buildRho0(); BL_ASSERT(sync_reg == 0); if (level > 0 && do_sync_proj) { sync_reg = new SyncRegister(grids,crse_ratio,level); } BL_ASSERT(advflux_reg == 0); if (level > 0 && do_reflux) { advflux_reg = new FluxRegister(grids,crse_ratio,level,NUM_STATE); } BL_ASSERT(viscflux_reg == 0); if (level > 0 && do_reflux) { viscflux_reg = new FluxRegister(grids,crse_ratio,level,NUM_STATE); } BL_ASSERT(Vsync == 0); BL_ASSERT(Ssync == 0); if (level < parent->finestLevel()) { Vsync = new MultiFab(grids,BL_SPACEDIM,1); Ssync = new MultiFab(grids,NUM_STATE-BL_SPACEDIM,1); } diffusion = new Diffusion(parent, this, (level > 0) ? getLevel(level-1).diffusion : 0, NUM_STATE, viscflux_reg, volume, area, is_diffusive, visc_coef); // // Allocate the storage for variable viscosity and diffusivity // viscn_cc = 0; viscnp1_cc = 0; if (variable_vel_visc) { viscn_cc = new MultiFab(grids, 1, 1); viscnp1_cc = new MultiFab(grids, 1, 1); } diffn_cc = 0; diffnp1_cc = 0; if (variable_scal_diff) { diffn_cc = new MultiFab(grids, NUM_STATE-Density-1, 1); diffnp1_cc = new MultiFab(grids, NUM_STATE-Density-1, 1); } is_first_step_after_regrid = false; old_intersect_new = grids; } // // Build rho0 arrays as ones for the base class. Empty function for now. // void NavierStokes::buildRho0 () {} void NavierStokes::buildMetrics () { radius.resize(grids.size()); const Real dxr = geom.CellSize()[0]; for (int i = 0; i < grids.size(); i++) { const int ilo = grids[i].smallEnd(0)-radius_grow; const int ihi = grids[i].bigEnd(0)+radius_grow; const int len = ihi - ilo + 1; Real* rad = new Real[len]; radius.set(i,rad); if (CoordSys::IsCartesian()) { for (int j = 0; j < len; j++) rad[j] = 1.0; } else { const Real xlo = grid_loc[i].lo(0) + (0.5 - radius_grow)*dxr; for (int j = 0; j < len; j++) rad[j] = xlo + j*dxr; } } // // Build volume and face area arrays. // geom.GetVolume(volume,grids,GEOM_GROW); for (int dir = 0; dir < BL_SPACEDIM; dir++) { geom.GetFaceArea(area[dir],grids,dir,GEOM_GROW); } } // // Reset the time levels to time (time) and timestep dt. // This is done at the start of the timestep in the pressure iteration section. // void NavierStokes::resetState (Real time, Real dt_old, Real dt_new) { // // Reset state types. // state[State_Type].reset(); state[State_Type].setTimeLevel(time,dt_old,dt_new); initOldPress(); if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Interval) { state[Press_Type].setTimeLevel(time-dt_old,dt_old,dt_new); } else if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) { state[Press_Type].setTimeLevel(time-.5*dt_old,dt_old,dt_old); state[Dpdt_Type].setTimeLevel(time-dt_old,dt_old,dt_old); } // // Reset state types for divu not equal to zero. // if (have_divu) { state[Divu_Type].reset(); state[Divu_Type].setTimeLevel(time,dt_old,dt_new); if (have_dsdt) { // // Dont do this, we want to improve dsdt with press iters // but we do need to make sure time is set correctly.. // state[Dsdt_Type].reset(); state[Dsdt_Type].setTimeLevel(time,dt_old,dt_new); } } } // // Set the time levels to time (time) and timestep dt. // void NavierStokes::setTimeLevel (Real time, Real dt_old, Real dt_new) { state[State_Type].setTimeLevel(time,dt_old,dt_new); if (have_divu) { state[Divu_Type].setTimeLevel(time,dt_old,dt_new); if (have_dsdt) { state[Dsdt_Type].setTimeLevel(time,dt_old,dt_new); } } if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Interval) { state[Press_Type].setTimeLevel(time-dt_old,dt_old,dt_old); } else if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) { state[Press_Type].setTimeLevel(time-.5*dt_old,dt_old,dt_old); state[Dpdt_Type].setTimeLevel(time-dt_old,dt_old,dt_old); } } // // This function initializes the State and Pressure with data. // void NavierStokes::initData () { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::initData()"); // // Initialize the state and the pressure. // int ns = NUM_STATE - BL_SPACEDIM; const Real* dx = geom.CellSize(); MultiFab& S_new = get_new_data(State_Type); MultiFab& P_new = get_new_data(Press_Type); const Real cur_time = state[State_Type].curTime(); for (MFIter snewmfi(S_new); snewmfi.isValid(); ++snewmfi) { BL_ASSERT(grids[snewmfi.index()] == snewmfi.validbox()); P_new[snewmfi].setVal(0); const int i = snewmfi.index(); const int* lo = snewmfi.validbox().loVect(); const int* hi = snewmfi.validbox().hiVect(); const int* s_lo = S_new[snewmfi].loVect(); const int* s_hi = S_new[snewmfi].hiVect(); const int* p_lo = P_new[snewmfi].loVect(); const int* p_hi = P_new[snewmfi].hiVect(); FORT_INITDATA (&level,&cur_time,lo,hi,&ns, S_new[snewmfi].dataPtr(Xvel), S_new[snewmfi].dataPtr(BL_SPACEDIM), ARLIM(s_lo), ARLIM(s_hi), P_new[snewmfi].dataPtr(), ARLIM(p_lo), ARLIM(p_hi), dx,grid_loc[i].lo(),grid_loc[i].hi() ); } make_rho_prev_time(); make_rho_curr_time(); // // Initialize other types. // initDataOtherTypes(); // // Initialize divU and dSdt. // if (have_divu) { const Real dt = 1.0; const Real dtin = -1.0; // Dummy value denotes initialization. const Real cur_time = state[Divu_Type].curTime(); MultiFab& Divu_new = get_new_data(Divu_Type); state[State_Type].setTimeLevel(cur_time,dt,dt); calc_divu(cur_time,dtin,Divu_new); if (have_dsdt) get_new_data(Dsdt_Type).setVal(0); } if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) { get_new_data(Dpdt_Type).setVal(0); } is_first_step_after_regrid = false; old_intersect_new = grids; } // // Fills a new level n with best level n and coarser data available. // void NavierStokes::init (AmrLevel &old) { NavierStokes* oldns = (NavierStokes*) &old; const Real dt_new = parent->dtLevel(level); const Real cur_time = oldns->state[State_Type].curTime(); const Real prev_time = oldns->state[State_Type].prevTime(); const Real dt_old = cur_time - prev_time; MultiFab& S_new = get_new_data(State_Type); MultiFab& P_new = get_new_data(Press_Type); MultiFab& P_old = get_old_data(Press_Type); setTimeLevel(cur_time,dt_old,dt_new); const Real cur_pres_time = state[Press_Type].curTime(); // // Get best state and pressure data. // for (FillPatchIterator fpi(old,S_new,0,cur_time,State_Type,0,NUM_STATE); fpi.isValid(); ++fpi) { S_new[fpi.index()].copy(fpi()); } // // Note: we don't need to worry here about using FillPatch because // it will automatically use the "old dpdt" to interpolate, // since we haven't yet defined a new pressure at the lower level. // for (FillPatchIterator fpi(old,P_new,0,cur_pres_time,Press_Type,0,1); fpi.isValid(); ++fpi) { P_old[fpi.index()].copy(fpi()); P_new[fpi.index()].copy(fpi()); } if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) { MultiFab& Dpdt_new = get_new_data(Dpdt_Type); for (FillPatchIterator fpi(old,Dpdt_new,0,cur_pres_time,Dpdt_Type,0,1); fpi.isValid(); ++fpi) { Dpdt_new[fpi.index()].copy(fpi()); } } // // Get best divu and dSdt data. // if (have_divu) { MultiFab& Divu_new = get_new_data(Divu_Type); for (FillPatchIterator fpi(old,Divu_new,0,cur_time,Divu_Type,0,1); fpi.isValid(); ++fpi) { Divu_new[fpi.index()].copy(fpi()); } if (have_dsdt) { MultiFab& Dsdt_new = get_new_data(Dsdt_Type); for (FillPatchIterator fpi(old,Dsdt_new,0,cur_time,Dsdt_Type,0,1); fpi.isValid(); ++fpi) { Dsdt_new[fpi.index()].copy(fpi()); } } } old_intersect_new = BoxLib::intersect(grids,oldns->boxArray()); is_first_step_after_regrid = true; } void NavierStokes::init () { MultiFab& S_new = get_new_data(State_Type); MultiFab& P_new = get_new_data(Press_Type); MultiFab& P_old = get_old_data(Press_Type); BL_ASSERT(level > 0); const Array& dt_amr = parent->dtLevel(); Array dt_new(level+1); for (int lev = 0; lev < level; lev++) dt_new[lev] = dt_amr[lev]; // // Guess new dt from new data (interpolated from coarser level). // const Real dt = dt_new[level-1]/Real(parent->MaxRefRatio(level-1)); dt_new[level] = dt; parent->setDtLevel(dt_new); // // Compute dt based on old data. // NavierStokes& old = getLevel(level-1); const Real cur_time = old.state[State_Type].curTime(); const Real prev_time = old.state[State_Type].prevTime(); const Real dt_old = (cur_time-prev_time)/Real(parent->MaxRefRatio(level-1)); setTimeLevel(cur_time,dt_old,dt); Real cur_pres_time = state[Press_Type].curTime(); // // Get best coarse state and pressure data. // FillCoarsePatch(S_new,0,cur_time,State_Type,0,NUM_STATE); FillCoarsePatch(P_new,0,cur_pres_time,Press_Type,0,1); if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) FillCoarsePatch(get_new_data(Dpdt_Type),0,cur_time,Dpdt_Type,0,1); for (MFIter mfi(P_new); mfi.isValid(); ++mfi) { P_old[mfi].copy(P_new[mfi]); } // // Get best coarse divU and dSdt data. // if (have_divu) { FillCoarsePatch(get_new_data(Divu_Type),0,cur_time,Divu_Type,0,1); if (have_dsdt) FillCoarsePatch(get_new_data(Dsdt_Type),0,cur_time,Dsdt_Type,0,1); } old_intersect_new = grids; } // // ADVANCE FUNCTIONS // // // This function ensures that the multifab registers and boundary // flux registers needed for syncing the composite grid // // u_mac, umacG, Vsync, Ssync, rhoavg, fr_adv, fr_visc // // are initialized to zero. In general these quantities // along with the pressure sync registers (sync_reg) and // advective velocity registers (mac_reg) are compiled by first // setting them to the coarse value acquired during a coarse timestep // and then incrementing in the fine values acquired during the // subcycled fine timesteps. This compilation procedure occurs in // different parts for different quantities // // * u_mac is set in predict_velocity and mac_project. // * fr_adv, fr_visc are set in velocity_advect and scalar_advect // * Vsync, Ssync are set in subcycled calls to post_timestep // * mac_reg is set in mac_project // * sync_reg is set in level_project // * rhoavg, pavg are set in advance_setup and advance // // After these quantities have been compiled during a coarse // timestep and subcycled fine timesteps. The post_timestep function // uses them to sync the fine and coarse levels. If the coarse level // is not the base level, post_timestep modifies the next coarsest levels // registers appropriately. // // Note :: There is a little ambiguity as to which level owns the // boundary flux registers. The Multifab registers are quantities // sized by the coarse level BoxArray and belong to the coarse level. // The fine levels own the boundary registers, since they are sized by // the boundaries of the fine level BoxArray. // void NavierStokes::advance_setup (Real time, Real dt, int iteration, int ncycle) { const int finest_level = parent->finestLevel(); mac_projector->setup(level); // // Why are they defined here versus the constructor? // if (level < finest_level) { if (Vsync == 0) Vsync = new MultiFab(grids,BL_SPACEDIM,1); if (Ssync == 0) Ssync = new MultiFab(grids,NUM_STATE-BL_SPACEDIM,1); Vsync->setVal(0); Ssync->setVal(0); } // // Set reflux registers to zero. // if (do_reflux && level < finest_level) { getAdvFluxReg(level+1).setVal(0); getViscFluxReg(level+1).setVal(0); } // // Alloc space for edge velocities (normal comp only). // if (u_mac == 0) { u_mac = new MultiFab[BL_SPACEDIM]; for (int dir = 0; dir < BL_SPACEDIM; dir++) { BoxArray edge_grids(grids); edge_grids.surroundingNodes(dir); u_mac[dir].define(edge_grids,1,0,Fab_allocate); } } if (u_macG == 0) { u_macG = new MultiFab[BL_SPACEDIM]; for (int dir = 0; dir < BL_SPACEDIM; dir++) { BoxArray edge_grids(grids); edge_grids.surroundingNodes(dir).grow(1); u_macG[dir].define(edge_grids,1,0,Fab_allocate); } } if (u_corr == 0) { u_corr = new MultiFab[BL_SPACEDIM]; for (int dir = 0; dir < BL_SPACEDIM; dir++) { BoxArray edge_grids(grids); edge_grids.surroundingNodes(dir).grow(1); u_corr[dir].define(edge_grids,1,0,Fab_allocate); } } // // Alloc MultiFab to hold advective update terms. // BL_ASSERT(aofs == 0); aofs = new MultiFab(grids,NUM_STATE,0); // // Alloc MultiFab to hold RHS for MAC projection. // BL_ASSERT(mac_rhs == 0); // // Set rho_avg. // if (!initial_step && level > 0 && iteration == 1) initRhoAvg(0.5/Real(ncycle)); // // Set up state multifabs for the advance. // for (int k = 0; k < num_state_type; k++) { state[k].allocOldData(); state[k].swapTimeLevels(dt); } if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) { const Real new_press_time = .5 * (state[State_Type].prevTime() + state[State_Type].curTime()); state[Press_Type].setNewTimeLevel(new_press_time); } make_rho_prev_time(); // // Calculate the time N viscosity and diffusivity // Note: The viscosity and diffusivity at time N+1 are // initialized here to the time N values just to // have something reasonable. // const Real prev_time = state[State_Type].prevTime(); if (variable_vel_visc) { calcViscosity(prev_time,dt,iteration,ncycle); for (MFIter np1Mfi(*viscnp1_cc); np1Mfi.isValid(); ++np1Mfi) { (*viscnp1_cc)[np1Mfi].copy((*viscn_cc)[np1Mfi],0,0,1); } } if (variable_scal_diff) { const int num_diff = NUM_STATE-Density-1; calcDiffusivity(prev_time,dt,iteration,ncycle,Density+1,num_diff); for (MFIter np1Mfi(*diffnp1_cc); np1Mfi.isValid(); ++np1Mfi) { (*diffnp1_cc)[np1Mfi].copy((*diffn_cc)[np1Mfi],0,0,num_diff); } } } // // Clean up after the advance function. // void NavierStokes::advance_cleanup (Real dt, int iteration, int ncycle) { if (level == parent->finestLevel()) { delete [] u_mac; u_mac = 0; delete [] u_macG; u_macG = 0; delete [] u_corr; u_corr = 0; } delete mac_rhs; mac_rhs = 0; delete aofs; aofs = 0; } // // Compute a timestep at a level. Return largest safe timestep. // Real NavierStokes::advance (Real time, Real dt, int iteration, int ncycle) { if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "Advancing grids at level " << level << " : starting time = " << time << " with dt = " << dt << '\n'; } advance_setup(time,dt,iteration,ncycle); // // Compute traced states for normal comp of velocity at half time level. // Real dummy = 0.0; Real dt_test = predict_velocity(dt,dummy); // // Do MAC projection and update edge velocities. // if (do_mac_proj) { mac_rhs = create_mac_rhs(time,dt); MultiFab& S_old = get_old_data(State_Type); mac_project(time,dt,S_old,mac_rhs,have_divu); } // // Advect velocities. // if (do_mom_diff == 0) velocity_advection(dt); // // Advect scalars. // const int first_scalar = Density; const int last_scalar = first_scalar + NUM_SCALARS - 1; scalar_advection(dt,first_scalar,last_scalar); // // Update Rho. // scalar_update(dt,first_scalar,first_scalar); make_rho_curr_time(); // // Advect momenta after rho^(n+1) has been created. // if (do_mom_diff == 1) velocity_advection(dt); // // Add the advective and other terms to get scalars at t^{n+1}. // scalar_update(dt,first_scalar+1,last_scalar); // // S appears in rhs of the velocity update, so we better do it now. // if (have_divu) { calc_divu(time+dt,dt,get_new_data(Divu_Type)); if (have_dsdt) { calc_dsdt(time,dt,get_new_data(Dsdt_Type)); if (initial_step) MultiFab::Copy(get_old_data(Dsdt_Type), get_new_data(Dsdt_Type),0,0,1,0); } } // // Add the advective and other terms to get velocity at t^{n+1}. // velocity_update(dt); // // Clean up after the predicted value at t^n+1. // Estimate new timestep from umac cfl. // advance_cleanup(dt,iteration,ncycle); // // Increment rho average. // if (!initial_step && level > 0) incrRhoAvg((iteration==ncycle ? 0.5 : 1.0) / Real(ncycle)); // // Do a level project to update the pressure and velocity fields. // if (!initial_step) { if (projector) level_projector(dt,time,iteration); if (level > 0 && iteration == 1) p_avg->setVal(0); } return dt_test; // Return estimate of best new timestep. } MultiFab* NavierStokes::create_mac_rhs (Real time, Real dt) { MultiFab* mac_rhs = getDivCond(0,time); MultiFab* dsdt = getDsdt(0,time); for (MFIter mfi(*mac_rhs); mfi.isValid(); ++mfi) { (*dsdt)[mfi].mult(.5*dt); (*mac_rhs)[mfi].plus((*dsdt)[mfi]); } delete dsdt; return mac_rhs; } MultiFab* NavierStokes::create_mac_rhs_grown (int nGrow, Real time, Real dt) { // // We do all this just to fill the ghost cells. // MultiFab* mac_rhs_grown = 0; if (nGrow > 0) { mac_rhs_grown = getDivCond(nGrow,time); MultiFab* dsdt_grown = getDsdt(nGrow,time); for (MFIter mfi(*mac_rhs_grown); mfi.isValid(); ++mfi) { (*dsdt_grown)[mfi].mult(.5*dt); (*mac_rhs_grown)[mfi].plus((*dsdt_grown)[mfi]); } delete dsdt_grown; } // // Now we copy from the MultiFab mac_rhs which has no ghost cells. // for (MFIter mfi(*mac_rhs_grown); mfi.isValid(); ++mfi) { (*mac_rhs_grown)[mfi].copy((*mac_rhs)[mfi],grids[mfi.index()]); } if (nGrow > 0) mac_rhs_grown->FillBoundary(); return mac_rhs_grown; } void NavierStokes::mac_project (Real time, Real dt, MultiFab& Sold, MultiFab* divu, int have_divu) { if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "... mac_projection\n"; const Real strt_time = ParallelDescriptor::second(); mac_projector->mac_project(level,u_mac,Sold,dt,time,*divu,have_divu); create_umac_grown(); const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real run_time = ParallelDescriptor::second() - strt_time; ParallelDescriptor::ReduceRealMax(run_time,IOProc); if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "NavierStokes:mac_project(): lev: " << level << ", time: " << run_time << std::endl; } } void NavierStokes::level_projector (Real dt, Real time, int iteration) { BL_ASSERT(iteration > 0); MultiFab& U_old = get_old_data(State_Type); MultiFab& U_new = get_new_data(State_Type); MultiFab& P_old = get_old_data(Press_Type); MultiFab& P_new = get_new_data(Press_Type); SyncRegister* crse_ptr = 0; if (level < parent->finestLevel() && do_sync_proj) { crse_ptr = &(getLevel(level+1).getSyncReg()); } Array sync_bc(grids.size()); Array< Array > sync_bc_array(grids.size()); for (int i = 0; i < grids.size(); i++) { sync_bc_array[i] = getBCArray(State_Type,i,Xvel,BL_SPACEDIM); sync_bc[i] = sync_bc_array[i].dataPtr(); } int crse_dt_ratio = (level > 0) ? parent->nCycle(level) : -1; const Real cur_pres_time = state[Press_Type].curTime(); const Real prev_pres_time = state[Press_Type].prevTime(); projector->level_project(level,time,dt,cur_pres_time,prev_pres_time, geom,U_old,U_new,P_old,P_new, get_rho_half_time(),crse_ptr,sync_reg, crse_dt_ratio,sync_bc.dataPtr(),iteration, have_divu,Divu_Type); if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) calcDpdt(); } void NavierStokes::make_rho_prev_time () { const Real prev_time = state[State_Type].prevTime(); FillPatchIterator fpi(*this,*rho_ptime,1,prev_time,State_Type,Density,1); for ( ; fpi.isValid(); ++fpi) { (*rho_ptime)[fpi.index()].copy(fpi()); } } void NavierStokes::make_rho_curr_time () { const Real curr_time = state[State_Type].curTime(); FillPatchIterator fpi(*this,*rho_ctime,1,curr_time,State_Type,Density,1); for ( ; fpi.isValid(); ++fpi) { (*rho_ctime)[fpi.index()].copy(fpi()); } } MultiFab* NavierStokes::get_rho_half_time () { // // Fill it in when needed ... // for (MFIter mfi(*rho_half); mfi.isValid(); ++mfi) { (*rho_half)[mfi].copy((*rho_ptime)[mfi]); (*rho_half)[mfi] += (*rho_ctime)[mfi]; (*rho_half)[mfi].mult(.5); } return rho_half; } const MultiFab& NavierStokes::get_rho (Real time) { const TimeLevel whichTime = which_time(State_Type,time); if (whichTime == AmrOldTime) { return *rho_ptime; } else if (whichTime == AmrNewTime) { return *rho_ctime; } else if (whichTime == AmrHalfTime) { return *get_rho_half_time(); } else { BoxLib::Error("NavierStokes::get_rho(): bad time"); return *rho_ptime; // Got to return something to shut up compiler. } } // // Predict the edge velocities which go into forming u_mac. This // function also returns an estimate of dt for use in variable timesteping. // Real NavierStokes::predict_velocity (Real dt, Real& comp_cfl) { if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "... predict edge velocities\n"; // // Get simulation parameters. // const int nComp = BL_SPACEDIM; const Real* dx = geom.CellSize(); const Real prev_time = state[State_Type].prevTime(); const Real prev_pres_time = state[Press_Type].prevTime(); // // Compute viscous terms at level n. // Ensure reasonable values in 1 grow cell. Here, do extrap for // c-f/phys boundary, since we have no interpolator fn, also, // preserve extrap for corners at periodic/non-periodic intersections. // MultiFab visc_terms(grids,nComp,1); if (be_cn_theta != 1.0) { getViscTerms(visc_terms,Xvel,nComp,prev_time); } else { visc_terms.setVal(0); } // // Set up the timestep estimation. // Real cflgrid,u_max[3]; Real cflmax = 1.0e-10; comp_cfl = (level == 0) ? cflmax : comp_cfl; FArrayBox tforces; Array bndry[BL_SPACEDIM]; MultiFab Gp(grids,BL_SPACEDIM,1); getGradP(Gp, prev_pres_time); FArrayBox* null_fab = 0; for (FillPatchIterator P_fpi(*this,get_old_data(Press_Type),1,prev_pres_time,Press_Type,0,1), U_fpi(*this,visc_terms,HYP_GROW,prev_time,State_Type,Xvel,BL_SPACEDIM); U_fpi.isValid() && P_fpi.isValid(); ++U_fpi, ++P_fpi) { const int i = U_fpi.index(); getForce(tforces,i,1,Xvel,BL_SPACEDIM,(*rho_ptime)[i]); // // Test velocities, rho and cfl. // cflgrid = godunov->test_u_rho(U_fpi(),(*rho_ptime)[i],grids[i],dx,dt,u_max); cflmax = std::max(cflgrid,cflmax); comp_cfl = std::max(cflgrid,comp_cfl); // // Compute the total forcing. // godunov->Sum_tf_gp_visc(tforces,visc_terms[i],Gp[i],(*rho_ptime)[i]); D_TERM(bndry[0] = getBCArray(State_Type,i,0,1);, bndry[1] = getBCArray(State_Type,i,1,1);, bndry[2] = getBCArray(State_Type,i,2,1);) godunov->Setup(grids[i], dx, dt, 1, *null_fab, bndry[0].dataPtr(), *null_fab, bndry[1].dataPtr(), #if (BL_SPACEDIM == 3) *null_fab, bndry[2].dataPtr(), #endif U_fpi(), (*rho_ptime)[i], tforces); godunov->ComputeUmac(grids[i], dx, dt, u_mac[0][i], bndry[0].dataPtr(), u_mac[1][i], bndry[1].dataPtr(), #if (BL_SPACEDIM == 3) u_mac[2][i], bndry[2].dataPtr(), #endif U_fpi(), tforces); } Real tempdt = std::min(change_max,cfl/cflmax); ParallelDescriptor::ReduceRealMin(tempdt); return dt*tempdt; } // // This routine advects the velocities // void NavierStokes::velocity_advection (Real dt) { if (verbose && ParallelDescriptor::IOProcessor()) { if (do_mom_diff == 0) { std::cout << "... advect velocities\n"; } else { if (predict_mom_together == 0) { std::cout << "Must set predict_mom_together == 1 in NavierStokes." << std::endl; exit(0); } std::cout << "... advect momenta\n"; } } const int finest_level = parent->finestLevel(); const Real* dx = geom.CellSize(); const Real prev_time = state[State_Type].prevTime(); const Real prev_pres_time = state[Press_Type].prevTime(); // // Compute viscosity components. // MultiFab visc_terms(grids,BL_SPACEDIM,1); if (be_cn_theta != 1.0) getViscTerms(visc_terms,Xvel,BL_SPACEDIM,prev_time); else visc_terms.setVal(0,1); Array bndry[BL_SPACEDIM]; FArrayBox xflux, yflux, zflux, divu, tforces; int nGrowF = 1; MultiFab* divu_fp = create_mac_rhs_grown(nGrowF,prev_time,dt); #if 0 MultiFab* divu_fp = getDivCond(nGrowF,prev_time); MultiFab* dsdt = getDsdt(nGrowF,prev_time); for (MFIter dsdtmfi(*dsdt); dsdtmfi.isValid(); ++dsdtmfi) { (*dsdt)[dsdtmfi].mult(.5*dt); (*divu_fp)[dsdtmfi].plus((*dsdt)[dsdtmfi]); } delete dsdt; #endif MultiFab Gp(grids,BL_SPACEDIM,1); getGradP(Gp, prev_pres_time); // // Compute the advective forcing. // FArrayBox S; for (FillPatchIterator P_fpi(*this,get_old_data(Press_Type),1,prev_pres_time,Press_Type,0,1), U_fpi(*this,visc_terms,HYP_GROW,prev_time,State_Type,Xvel,BL_SPACEDIM), Rho_fpi(*this,visc_terms,HYP_GROW,prev_time,State_Type,Density,1); U_fpi.isValid() && P_fpi.isValid() && Rho_fpi.isValid(); ++U_fpi, ++P_fpi, ++Rho_fpi) { // // Since all the MultiFabs are on same grid we'll just use indices. // const int i = U_fpi.index(); getForce(tforces,i,1,Xvel,BL_SPACEDIM,(*rho_ptime)[i]); godunov->Sum_tf_gp_visc(tforces,visc_terms[i],Gp[i],(*rho_ptime)[i]); D_TERM(bndry[0] = getBCArray(State_Type,i,0,1);, bndry[1] = getBCArray(State_Type,i,1,1);, bndry[2] = getBCArray(State_Type,i,2,1);) godunov->Setup(grids[i], dx, dt, 0, xflux, bndry[0].dataPtr(), yflux, bndry[1].dataPtr(), #if (BL_SPACEDIM == 3) zflux, bndry[2].dataPtr(), #endif U_fpi(),(*rho_ptime)[i],tforces); // // Loop over the velocity components. // S.resize(U_fpi().box(),BL_SPACEDIM); S.copy(U_fpi(),0,0,BL_SPACEDIM); for (int comp = 0 ; comp < BL_SPACEDIM ; comp++ ) { int use_conserv_diff = (advectionType[comp] == Conservative) ? true : false; if (do_mom_diff == 1) { S.mult(Rho_fpi(),S.box(),S.box(),0,comp,1); tforces.mult((*rho_ptime)[i],tforces.box(),tforces.box(),0,comp,1); } FArrayBox divu_dummy; godunov->AdvectState(grids[i], dx, dt, area[0][i], u_mac[0][i], xflux, area[1][i], u_mac[1][i], yflux, #if (BL_SPACEDIM == 3) area[2][i], u_mac[2][i], zflux, #endif U_fpi(), S, tforces, (*divu_fp)[i], comp, (*aofs)[i],comp,use_conserv_diff, comp,bndry[comp].dataPtr(),PRE_MAC,volume[i]); // // Get fluxes for diagnostics and refluxing. // pullFluxes(i,comp,1,xflux,yflux,zflux,dt); } } delete divu_fp; // // pullFluxes() contains CrseInit() calls -- complete the process. // if (do_reflux && level < finest_level) getAdvFluxReg(level+1).CrseInitFinish(); } // // This routine advects the scalars // void NavierStokes::scalar_advection (Real dt, int fscalar, int lscalar) { if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "... advect scalars\n"; // // Get simulation parameters. // const int num_scalars = lscalar - fscalar + 1; const Real* dx = geom.CellSize(); const Real prev_time = state[State_Type].prevTime(); const Real prev_pres_time = state[Press_Type].prevTime(); // // Get the viscous terms. // MultiFab visc_terms(grids,num_scalars,1); if (be_cn_theta != 1.0) getViscTerms(visc_terms,fscalar,num_scalars,prev_time); else visc_terms.setVal(0,1); // // Set up the grid loop. // FArrayBox xflux, yflux, zflux, tforces, tvelforces; MultiFab Gp(grids,BL_SPACEDIM,1); getGradP(Gp, prev_pres_time); MultiFab vel_visc_terms; const int use_forces_in_trans = godunov->useForcesInTrans(); if (use_forces_in_trans) { vel_visc_terms.define(grids,BL_SPACEDIM,1,Fab_allocate); if (be_cn_theta != 1.0) getViscTerms(vel_visc_terms,Xvel,BL_SPACEDIM,prev_time); else vel_visc_terms.setVal(0,1); } Array state_bc, bndry[BL_SPACEDIM]; MultiFab* divu_fp = getDivCond(1,prev_time); int nGrowF = 1; MultiFab* dsdt = getDsdt(nGrowF,prev_time); for (MFIter dsdtmfi(*dsdt); dsdtmfi.isValid(); ++dsdtmfi) { (*dsdt)[dsdtmfi].mult(.5*dt); (*divu_fp)[dsdtmfi].plus((*dsdt)[dsdtmfi]); } delete dsdt; // // Compute the advective forcing. // for (FillPatchIterator P_fpi(*this,get_old_data(Press_Type),1,prev_pres_time,Press_Type,0,1), U_fpi(*this,visc_terms,HYP_GROW,prev_time,State_Type,Xvel,BL_SPACEDIM), S_fpi(*this,visc_terms,HYP_GROW,prev_time,State_Type,fscalar,num_scalars); U_fpi.isValid() && S_fpi.isValid() && P_fpi.isValid(); ++U_fpi, ++S_fpi, ++P_fpi) { const int i = U_fpi.index(); getForce(tforces,i,1,fscalar,num_scalars,(*rho_ptime)[i]); if (use_forces_in_trans) { getForce(tvelforces,i,1,Xvel,BL_SPACEDIM,(*rho_ptime)[i]); godunov->Sum_tf_gp_visc(tvelforces,vel_visc_terms[i],Gp[i],(*rho_ptime)[i]); } D_TERM(bndry[0] = getBCArray(State_Type,i,0,1);, bndry[1] = getBCArray(State_Type,i,1,1);, bndry[2] = getBCArray(State_Type,i,2,1);) godunov->Setup(grids[i], dx, dt, 0, xflux, bndry[0].dataPtr(), yflux, bndry[1].dataPtr(), #if (BL_SPACEDIM == 3) zflux, bndry[2].dataPtr(), #endif U_fpi(),(*rho_ptime)[i],tvelforces); // // Loop over the scalar components. // for (int comp = 0 ; comp < num_scalars ; comp++) { int state_ind = fscalar + comp; // // Compute total forcing. // int use_conserv_diff = (advectionType[state_ind] == Conservative) ? true : false; AdvectionScheme adv_scheme = PRE_MAC; if (adv_scheme == PRE_MAC) { godunov->Sum_tf_divu_visc(S_fpi(),tforces,comp,1,visc_terms[i], comp,(*divu_fp)[i],(*rho_ptime)[i], use_conserv_diff); } else { FArrayBox junkDivu(tforces.box(),1); junkDivu.setVal(0.); godunov->Sum_tf_divu_visc(S_fpi(),tforces,comp,1,visc_terms[i], comp,junkDivu,(*rho_ptime)[i], use_conserv_diff); } // // Advect scalar. // state_bc = getBCArray(State_Type,i,state_ind,1); godunov->AdvectState(grids[i], dx, dt, area[0][i], u_mac[0][i], xflux, area[1][i], u_mac[1][i], yflux, #if (BL_SPACEDIM == 3) area[2][i], u_mac[2][i], zflux, #endif U_fpi(),S_fpi(),tforces,(*divu_fp)[i],comp, (*aofs)[i],state_ind,use_conserv_diff, state_ind,state_bc.dataPtr(),adv_scheme,volume[i]); // // Get the fluxes for refluxing and diagnostic purposes. // pullFluxes(i, state_ind, 1, xflux, yflux, zflux, dt); } } delete divu_fp; // // pullFluxes() contains CrseInit() calls -- complete the process. // if (do_reflux && level < parent->finestLevel()) getAdvFluxReg(level+1).CrseInitFinish(); } // // This subroutine updates the scalars, before the velocity update // and the level projection // // AT this point in time, all we know is psi^n, rho^n+1/2, and the // general forcing terms at t^n, and after solving in this routine // viscous forcing at t^n+1/2. Note, unless more complicated logic // is invoked earlier, we do not have any estimate of general forcing // terms at t^n+1/2. // void NavierStokes::scalar_update (Real dt, int first_scalar, int last_scalar) { if (verbose && ParallelDescriptor::IOProcessor()) std::cout << "... update scalars\n"; scalar_advection_update(dt, first_scalar, last_scalar); bool do_any_diffuse = false; for (int sigma = first_scalar; sigma <= last_scalar; sigma++) if (is_diffusive[sigma]) do_any_diffuse = true; if (do_any_diffuse) scalar_diffusion_update(dt, first_scalar, last_scalar); } void NavierStokes::scalar_advection_update (Real dt, int first_scalar, int last_scalar) { MultiFab& S_old = get_old_data(State_Type); MultiFab& S_new = get_new_data(State_Type); MultiFab& Aofs = *aofs; const Real halftime = 0.5*(state[State_Type].curTime()+state[State_Type].prevTime()); Array state_bc; FArrayBox tforces; // // Compute inviscid estimate of scalars. // (do rho separate, as we do not have rho at new time yet) // int sComp = first_scalar; if (sComp == Density) { for (MFIter S_oldmfi(S_old); S_oldmfi.isValid(); ++S_oldmfi) { const int i = S_oldmfi.index(); tforces.resize(grids[i],1); tforces.setVal(0); godunov->Add_aofs_tf(S_old[S_oldmfi],S_new[S_oldmfi],Density,1, Aofs[S_oldmfi],Density,tforces,0,grids[i],dt); } ++sComp; } if (sComp <= last_scalar) { const MultiFab& halftime = *get_rho_half_time(); for (MFIter Rho_mfi(halftime); Rho_mfi.isValid(); ++Rho_mfi) { const int i = Rho_mfi.index(); for (int sigma = sComp; sigma <= last_scalar; sigma++) { getForce(tforces,i,0,sigma,1,halftime[Rho_mfi]); godunov->Add_aofs_tf(S_old[Rho_mfi],S_new[Rho_mfi],sigma,1, Aofs[Rho_mfi],sigma,tforces,0,grids[i],dt); } } } } void NavierStokes::scalar_diffusion_update (Real dt, int first_scalar, int last_scalar) { MultiFab** fluxSCn; MultiFab** fluxSCnp1; const int nGrow = 0; const int nComp = 1; diffusion->allocFluxBoxesLevel(fluxSCn, nGrow,nComp); diffusion->allocFluxBoxesLevel(fluxSCnp1,nGrow,nComp); const MultiFab* Rh = get_rho_half_time(); for (int sigma = first_scalar; sigma <= last_scalar; sigma++) { if (is_diffusive[sigma]) { int rho_flag = 0; MultiFab* delta_rhs = 0; MultiFab* alpha = 0; MultiFab** cmp_diffn = 0; MultiFab** cmp_diffnp1 = 0; if (variable_scal_diff) { Real diffTime = state[State_Type].prevTime(); diffusion->allocFluxBoxesLevel(cmp_diffn, 0, 1); getDiffusivity(cmp_diffn, diffTime, sigma, 0, 1); diffTime = state[State_Type].curTime(); diffusion->allocFluxBoxesLevel(cmp_diffnp1, 0, 1); getDiffusivity(cmp_diffnp1, diffTime, sigma, 0, 1); } diffuse_scalar_setup(dt, sigma, &rho_flag, delta_rhs, alpha, cmp_diffn, cmp_diffnp1); diffusion->diffuse_scalar(dt,sigma,be_cn_theta,Rh, rho_flag,fluxSCn,fluxSCnp1,0,delta_rhs, alpha,cmp_diffn,cmp_diffnp1); if (variable_scal_diff) { diffusion->removeFluxBoxesLevel(cmp_diffn); diffusion->removeFluxBoxesLevel(cmp_diffnp1); } delete delta_rhs; delete alpha; // // Increment the viscous flux registers // if (do_reflux) { FArrayBox fluxtot; for (int d = 0; d < BL_SPACEDIM; d++) { for (MFIter fmfi(*fluxSCn[d]); fmfi.isValid(); ++fmfi) { const Box& ebox = (*fluxSCn[d])[fmfi].box(); fluxtot.resize(ebox,nComp); fluxtot.copy((*fluxSCn[d])[fmfi],ebox,0,ebox,0,nComp); fluxtot.plus((*fluxSCnp1[d])[fmfi],ebox,0,0,nComp); if (level < parent->finestLevel()) getLevel(level+1).getViscFluxReg().CrseInit(fluxtot,ebox, d,0,sigma, nComp,-dt); if (level > 0) getViscFluxReg().FineAdd((*fluxSCn[d])[fmfi],d,fmfi.index(), 0,sigma,nComp,dt); } } if (level < parent->finestLevel()) getLevel(level+1).getViscFluxReg().CrseInitFinish(); } } } diffusion->removeFluxBoxesLevel(fluxSCn); diffusion->removeFluxBoxesLevel(fluxSCnp1); } void NavierStokes::diffuse_scalar_setup (Real dt, int sigma, int* rho_flag, MultiFab*& delta_rhs, MultiFab*& alpha, MultiFab**& diffn, MultiFab**& diffnp1) { (*rho_flag) = Diffusion::set_rho_flag(diffusionType[sigma]); } // // This subroutine updates the velocity field before the level projection. // // At this point in time, all we know is u^n, rho^n+1/2, and the // general forcing terms at t^n, and after solving in this routine // viscous forcing at t^n+1/2. Except for a simple buoyancy term, // b = -rho^n+1/2 g, it is usually not possible to estimate more // general forcing terms at t^n+1/2. Since the default getForce, handles // this case automatically, F_new and F_old have been replaced by a single // tforces FArrayBox. // // We assume that if one component of velocity is viscous that all must be. // void NavierStokes::velocity_update (Real dt) { if (verbose && ParallelDescriptor::IOProcessor()) { if (do_mom_diff == 0) { std::cout << "... update velocities \n"; } else { std::cout << "... update momenta \n"; } } velocity_advection_update(dt); if (!initial_iter) velocity_diffusion_update(dt); else initial_velocity_diffusion_update(dt); } void NavierStokes::velocity_advection_update (Real dt) { FArrayBox tforces; MultiFab& U_old = get_old_data(State_Type); MultiFab& U_new = get_new_data(State_Type); MultiFab& P_old = get_old_data(Press_Type); MultiFab& Aofs = *aofs; const Real prev_time = state[State_Type].prevTime(); const Real curr_time = state[State_Type].curTime(); const Real prev_pres_time = state[Press_Type].prevTime(); MultiFab Gp(grids,BL_SPACEDIM,1); getGradP(Gp, prev_pres_time); MultiFab& halftime = *get_rho_half_time(); MFIter Rhohalf_mfi(halftime); FArrayBox S; for (FillPatchIterator P_fpi(*this,P_old,0,prev_pres_time,Press_Type,0,1); Rhohalf_mfi.isValid() && P_fpi.isValid(); ++Rhohalf_mfi, ++P_fpi) { const int i = Rhohalf_mfi.index(); getForce(tforces,i,0,Xvel,BL_SPACEDIM,halftime[i]); // // Do following only at initial iteration--per JBB. // if (initial_iter && is_diffusive[Xvel]) tforces.setVal(0); S.resize(U_old[i].box(),BL_SPACEDIM); S.copy(U_old[i],0,0,BL_SPACEDIM); if (do_mom_diff == 1) { for (int d = 0; d < BL_SPACEDIM; d++) { Gp[i].mult(halftime[i],grids[i],grids[i],0,d,1); tforces.mult(halftime[i],grids[i],grids[i],0,d,1); S.mult((*rho_ptime)[i],grids[i],grids[i],0,d,1); } } godunov->Add_aofs_tf_gp(S,U_new[i],Aofs[i],tforces, Gp[i],halftime[i],grids[i],dt); if (do_mom_diff == 1) { for (int d = 0; d < BL_SPACEDIM; d++) U_new[i].divide((*rho_ctime)[i],grids[i],grids[i],0,d,1); } } } void NavierStokes::velocity_diffusion_update (Real dt) { // // Compute the viscous forcing. // Do following except at initial iteration. // MultiFab& U_old = get_old_data(State_Type); MultiFab& U_new = get_new_data(State_Type); if (is_diffusive[Xvel]) { int rho_flag = (do_mom_diff == 0) ? 1 : 3; MultiFab* delta_rhs = 0; if (S_in_vel_diffusion && have_divu) { delta_rhs = new MultiFab(grids,BL_SPACEDIM,0); delta_rhs->setVal(0); } MultiFab** loc_viscn = 0; MultiFab** loc_viscnp1 = 0; if (variable_vel_visc) { Real viscTime = state[State_Type].prevTime(); diffusion->allocFluxBoxesLevel(loc_viscn, 0, 1); getViscosity(loc_viscn, viscTime); viscTime = state[State_Type].curTime(); diffusion->allocFluxBoxesLevel(loc_viscnp1, 0, 1); getViscosity(loc_viscnp1, viscTime); } diffuse_velocity_setup(dt, delta_rhs, loc_viscn, loc_viscnp1); diffusion->diffuse_velocity(dt,be_cn_theta,get_rho_half_time(),rho_flag, delta_rhs,loc_viscn,loc_viscnp1); if (variable_vel_visc) { diffusion->removeFluxBoxesLevel(loc_viscn); diffusion->removeFluxBoxesLevel(loc_viscnp1); } delete delta_rhs; } } void NavierStokes::diffuse_velocity_setup (Real dt, MultiFab*& delta_rhs, MultiFab**& viscn, MultiFab**& viscnp1) { if (S_in_vel_diffusion && have_divu) { // // Include div mu S*I terms in rhs // (i.e. make nonzero delta_rhs to add into RHS): // // The scalar and tensor solvers incorporate the relevant pieces of // of Div(tau), provided the flow is divergence-free. However, if // Div(U) =/= 0, there is an additional piece not accounted for, // which is of the form A.Div(U). For constant viscosity, Div(tau)_i // = Lapacian(U_i) + mu/3 d[Div(U)]/dx_i. For mu not constant, // Div(tau)_i = d[ mu(du_i/dx_j + du_j/dx_i) ]/dx_i - 2mu/3 d[Div(U)]/dx_i // // As a convenience, we treat this additional term as a "source" in // the diffusive solve, computing Div(U) in the "normal" way we // always do--via a call to calc_divu. This routine computes delta_rhs // if necessary, and stores it as an auxilliary rhs to the viscous solves. // This is a little strange, but probably not bad. // const Real time = state[State_Type].prevTime(); MultiFab divmusi(grids,BL_SPACEDIM,0); if (!variable_vel_visc) { diffusion->compute_divmusi(time,visc_coef[Xvel],divmusi); divmusi.mult((1./3.)*(1.0-be_cn_theta),0,BL_SPACEDIM,0); (*delta_rhs).plus(divmusi,0,BL_SPACEDIM,0); diffusion->compute_divmusi(time+dt,visc_coef[Xvel],divmusi); divmusi.mult((1./3.)*be_cn_theta,0,BL_SPACEDIM,0); (*delta_rhs).plus(divmusi,0,BL_SPACEDIM,0); } else { diffusion->compute_divmusi(time,viscn,divmusi); divmusi.mult((-2./3.)*(1.0-be_cn_theta),0,BL_SPACEDIM,0); (*delta_rhs).plus(divmusi,0,BL_SPACEDIM,0); diffusion->compute_divmusi(time+dt,viscnp1,divmusi); divmusi.mult((-2./3.)*be_cn_theta,0,BL_SPACEDIM,0); (*delta_rhs).plus(divmusi,0,BL_SPACEDIM,0); } } } void NavierStokes::initial_velocity_diffusion_update (Real dt) { // // Do following only at initial iteration. // if (is_diffusive[Xvel]) { MultiFab& U_old = get_old_data(State_Type); MultiFab& U_new = get_new_data(State_Type); MultiFab& Aofs = *aofs; const int nComp = BL_SPACEDIM; const Real prev_time = state[State_Type].prevTime(); const Real prev_pres_time = state[Press_Type].prevTime(); MultiFab Gp(grids,BL_SPACEDIM,1); getGradP(Gp, prev_pres_time); MultiFab visc_terms(grids,nComp,1); if (be_cn_theta != 1.0) { getViscTerms(visc_terms,Xvel,nComp,prev_time); } else { visc_terms.setVal(0); } FArrayBox tforces; FArrayBox S; // // Update U_new with viscosity. // MultiFab* Rh = get_rho_half_time(); for (FillPatchIterator P_fpi(*this,get_old_data(Press_Type),0,prev_pres_time,Press_Type,0,1); P_fpi.isValid(); ++P_fpi) { const int i = P_fpi.index(); getForce(tforces,i,0,Xvel,BL_SPACEDIM,(*rho_ptime)[i]); godunov->Sum_tf_gp_visc(tforces,visc_terms[i],Gp[i],(*Rh)[i]); S.resize(U_old[i].box(),BL_SPACEDIM); S.copy(U_old[i],0,0,BL_SPACEDIM); if (do_mom_diff == 1) { for (int d = 0; d < BL_SPACEDIM; d++) { tforces.mult((*Rh)[i],grids[i],grids[i],0,d,1); S.mult((*rho_ptime)[i],grids[i],grids[i],0,d,1); } } godunov->Add_aofs_tf(S,U_new[i],0,BL_SPACEDIM,Aofs[i], 0,tforces,0,grids[i],dt); if (do_mom_diff == 1) { for (int d = 0; d < BL_SPACEDIM; d++) U_new[i].divide((*rho_ctime)[i],grids[i],grids[i],0,d,1); } } } } void NavierStokes::errorEst (TagBoxArray& tags, int clearval, int tagval, Real time, int n_error_buf, int ngrow) { const int* domain_lo = geom.Domain().loVect(); const int* domain_hi = geom.Domain().hiVect(); const Real* dx = geom.CellSize(); const Real* prob_lo = geom.ProbLo(); Array itags; for (int j = 0; j < err_list.size(); j++) { MultiFab* mf = derive(err_list[j].name(), time, err_list[j].nGrow()); for (MFIter mfi(*mf); mfi.isValid(); ++mfi) { itags = tags[mfi.index()].tags(); FArrayBox& fab = (*mf)[mfi]; int* tptr = itags.dataPtr(); const int* tlo = tags[mfi.index()].box().loVect(); const int* thi = tags[mfi.index()].box().hiVect(); const int* lo = mfi.validbox().loVect(); const int* hi = mfi.validbox().hiVect(); const Real* xlo = grid_loc[mfi.index()].lo(); Real* dat = (*mf)[mfi].dataPtr(); const int* dlo = (*mf)[mfi].box().loVect(); const int* dhi = (*mf)[mfi].box().hiVect(); const int ncomp = (*mf)[mfi].nComp(); err_list[j].errFunc()(tptr, ARLIM(tlo), ARLIM(thi), &tagval, &clearval, dat, ARLIM(dlo), ARLIM(dhi), lo,hi, &ncomp, domain_lo, domain_hi, dx, xlo, prob_lo, &time, &level); // // Don't forget to set the tags in the TagBox. // tags[mfi.index()].tags(itags); } delete mf; } } Real NavierStokes::sumDerive (const std::string& name, Real time) { Real sum = 0.0; MultiFab* mf = derive(name,time,0); BL_ASSERT(!(mf == 0)); for (MFIter mfi(*mf); mfi.isValid(); ++mfi) { if (level < parent->finestLevel()) { const BoxArray& f_box = parent->boxArray(level+1); for (int j = 0; j < f_box.size(); j++) { Box c_box = BoxLib::coarsen(f_box[j],fine_ratio); Box isect = c_box & grids[mfi.index()]; if (isect.ok()) { (*mf)[mfi].setVal(0,isect,0); } } } sum += (*mf)[mfi].sum(0); } delete mf; ParallelDescriptor::ReduceRealSum(sum); return sum; } Real NavierStokes::volWgtSum (const std::string& name, Real time) { Real sum = 0.0; int rz_flag = CoordSys::IsRZ() ? 1 : 0; const Real* dx = geom.CellSize(); MultiFab* mf = derive(name,time,0); Array tmp; for (MFIter mfi(*mf); mfi.isValid(); ++mfi) { FArrayBox& fab = (*mf)[mfi]; if (level < parent->finestLevel()) { const BoxArray& f_box = parent->boxArray(level+1); for (int j = 0; j < f_box.size(); j++) { Box c_box = BoxLib::coarsen(f_box[j],fine_ratio); Box isect = c_box & grids[mfi.index()]; if (isect.ok()) { fab.setVal(0,isect,0); } } } Real s; const Real* dat = fab.dataPtr(); const int* dlo = fab.loVect(); const int* dhi = fab.hiVect(); const int* lo = grids[mfi.index()].loVect(); const int* hi = grids[mfi.index()].hiVect(); Real* rad = &radius[mfi.index()]; tmp.resize(hi[1]-lo[1]+1); #if (BL_SPACEDIM == 2) int irlo = lo[0]-radius_grow; int irhi = hi[0]+radius_grow; // // Note that this routine will do a volume weighted sum of // whatever quantity is passed in, not strictly the "mass". // FORT_SUMMASS(dat,ARLIM(dlo),ARLIM(dhi),ARLIM(lo),ARLIM(hi), dx,&s,rad,&irlo,&irhi,&rz_flag,tmp.dataPtr()); #endif #if (BL_SPACEDIM == 3) // // Note that this routine will do a volume weighted sum of // whatever quantity is passed in, not strictly the "mass". // FORT_SUMMASS(dat,ARLIM(dlo),ARLIM(dhi),ARLIM(lo),ARLIM(hi), dx,&s,tmp.dataPtr()); #endif sum += s; } delete mf; ParallelDescriptor::ReduceRealSum(sum); return sum; } void NavierStokes::sum_integrated_quantities () { const int finest_level = parent->finestLevel(); Real time = state[State_Type].curTime(); Real mass = 0.0; Real trac = 0.0; for (int lev = 0; lev <= finest_level; lev++) { NavierStokes& ns_level = getLevel(lev); mass += ns_level.volWgtSum("density",time); trac += ns_level.volWgtSum("tracer",time); } if (ParallelDescriptor::IOProcessor()) { const int old_prec = std::cout.precision(12); std::cout << '\n'; std::cout << "TIME= " << time << " MASS= " << mass << '\n'; std::cout << "TIME= " << time << " TRAC= " << trac << '\n'; std::cout.precision(old_prec); } } void NavierStokes::setPlotVariables() { AmrLevel::setPlotVariables(); } std::string NavierStokes::thePlotFileType () const { // // Increment this whenever the writePlotFile() format changes. // static const std::string the_plot_file_type("NavierStokes-V1.1"); return the_plot_file_type; } void NavierStokes::writePlotFile (const std::string& dir, std::ostream& os, VisMF::How how) { int i, n; // // The list of indices of State to write to plotfile. // first component of pair is state_type, // second component of pair is component # within the state_type // std::vector > plot_var_map; for (int typ = 0; typ < desc_lst.size(); typ++) for (int comp = 0; comp < desc_lst[typ].nComp();comp++) if (parent->isStatePlotVar(desc_lst[typ].name(comp)) && desc_lst[typ].getType() == IndexType::TheCellType()) plot_var_map.push_back(std::pair(typ,comp)); int num_derive = 0; std::list derive_names; const std::list& dlist = derive_lst.dlist(); for (std::list::const_iterator it = dlist.begin(); it != dlist.end(); ++it) { if (parent->isDerivePlotVar(it->name())) { derive_names.push_back(it->name()); num_derive += it->numDerive(); } } int n_data_items = plot_var_map.size() + num_derive; Real cur_time = state[State_Type].curTime(); if (level == 0 && ParallelDescriptor::IOProcessor()) { // // The first thing we write out is the plotfile type. // os << thePlotFileType() << '\n'; if (n_data_items == 0) BoxLib::Error("Must specify at least one valid data item to plot"); os << n_data_items << '\n'; // // Names of variables -- first state, then derived // for (i =0; i < plot_var_map.size(); i++) { int typ = plot_var_map[i].first; int comp = plot_var_map[i].second; os << desc_lst[typ].name(comp) << '\n'; } for (std::list::const_iterator it = derive_names.begin(); it != derive_names.end(); ++it) { const DeriveRec* rec = derive_lst.get(*it); for (i = 0; i < rec->numDerive(); i++) os << rec->variableName(i) << '\n'; } os << BL_SPACEDIM << '\n'; os << parent->cumTime() << '\n'; int f_lev = parent->finestLevel(); os << f_lev << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << Geometry::ProbLo(i) << ' '; os << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << Geometry::ProbHi(i) << ' '; os << '\n'; for (i = 0; i < f_lev; i++) os << parent->refRatio(i)[0] << ' '; os << '\n'; for (i = 0; i <= f_lev; i++) os << parent->Geom(i).Domain() << ' '; os << '\n'; for (i = 0; i <= f_lev; i++) os << parent->levelSteps(i) << ' '; os << '\n'; for (i = 0; i <= f_lev; i++) { for (int k = 0; k < BL_SPACEDIM; k++) os << parent->Geom(i).CellSize()[k] << ' '; os << '\n'; } os << (int) CoordSys::Coord() << '\n'; os << "0\n"; // Write bndry data. } // Build the directory to hold the MultiFab at this level. // The name is relative to the directory containing the Header file. // static const std::string BaseName = "/Cell"; char buf[64]; sprintf(buf, "Level_%d", level); std::string Level = buf; // // Now for the full pathname of that directory. // std::string FullPath = dir; if (!FullPath.empty() && FullPath[FullPath.length()-1] != '/') FullPath += '/'; FullPath += Level; // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) BoxLib::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); if (ParallelDescriptor::IOProcessor()) { os << level << ' ' << grids.size() << ' ' << cur_time << '\n'; os << parent->levelSteps(level) << '\n'; for (i = 0; i < grids.size(); ++i) { for (n = 0; n < BL_SPACEDIM; n++) os << grid_loc[i].lo(n) << ' ' << grid_loc[i].hi(n) << '\n'; } // // The full relative pathname of the MultiFabs at this level. // The name is relative to the Header file containing this name. // It's the name that gets written into the Header. // if (n_data_items > 0) { std::string PathNameInHeader = Level; PathNameInHeader += BaseName; os << PathNameInHeader << '\n'; } } // // We combine all of the multifabs -- state, derived, etc -- into one // multifab -- plotMF. // NOTE: we are assuming that each state variable has one component, // but a derived variable is allowed to have multiple components. int cnt = 0; int ncomp = 1; const int nGrow = 0; MultiFab plotMF(grids,n_data_items,nGrow); MultiFab* this_dat = 0; // // Cull data from state variables -- use no ghost cells. // for (i = 0; i < plot_var_map.size(); i++) { int typ = plot_var_map[i].first; int comp = plot_var_map[i].second; this_dat = &state[typ].newData(); MultiFab::Copy(plotMF,*this_dat,comp,cnt,ncomp,nGrow); cnt+= ncomp; } // // Cull data from derived variables. // Real plot_time; if (derive_names.size() > 0) { for (std::list::const_iterator it = derive_names.begin(); it != derive_names.end(); ++it) { if (*it == "avg_pressure" || *it == "gradpx" || *it == "gradpy" || *it == "gradpz") { if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Interval) { plot_time = cur_time; } else { int f_lev = parent->finestLevel(); plot_time = getLevel(f_lev).state[Press_Type].curTime(); } } else { plot_time = cur_time; } const DeriveRec* rec = derive_lst.get(*it); ncomp = rec->numDerive(); MultiFab* derive_dat = derive(*it,plot_time,nGrow); MultiFab::Copy(plotMF,*derive_dat,0,cnt,ncomp,nGrow); delete derive_dat; cnt += ncomp; } } // // Use the Full pathname when naming the MultiFab. // std::string TheFullPath = FullPath; TheFullPath += BaseName; VisMF::Write(plotMF,TheFullPath,how,true); } Real NavierStokes::estTimeStep () { if (fixed_dt > 0.0) { Real factor = 1.0; if (!(level == 0)) { int ratio = 1; for (int lev = 1; lev <= level; lev++) { ratio *= parent->nCycle(lev); } factor = 1.0/double(ratio); } return factor*fixed_dt; } const int n_grow = 0; Real estdt = 1.0e+20; const Real cur_time = state[State_Type].curTime(); const Real cur_pres_time = state[Press_Type].curTime(); MultiFab& P_new = get_new_data(Press_Type); MultiFab& U_new = get_new_data(State_Type); const Real* dx = geom.CellSize(); Real gr_max[BL_SPACEDIM], u_max[BL_SPACEDIM] = {0}; FArrayBox p_fab, tforces; MultiFab Gp(grids,BL_SPACEDIM,1); getGradP(Gp, cur_pres_time); for (MFIter Rho_mfi(*rho_ctime); Rho_mfi.isValid(); ++Rho_mfi) { const int i = Rho_mfi.index(); // // Get the pressure. // p_fab.resize(BoxLib::surroundingNodes(grids[i]),1); p_fab.copy(P_new[i],p_fab.box()); // // Get the velocity forcing. For some reason no viscous forcing. // getForce(tforces,i,n_grow,Xvel,BL_SPACEDIM,(*rho_ctime)[i]); tforces.minus(Gp[i],0,0,BL_SPACEDIM); // // Estimate the maximum allowable timestep from the Godunov box. // Real dt = godunov->estdt(U_new[i],tforces,(*rho_ctime)[i],grids[i], geom.CellSize(),cfl,gr_max); for (int k = 0; k < BL_SPACEDIM; k++) { u_max[k] = std::max(u_max[k],gr_max[k]); } estdt = std::min(estdt,dt); } // // Parallel reductions. // for (int k = 0; k < BL_SPACEDIM; k++) { ParallelDescriptor::ReduceRealMax(u_max[k]); } ParallelDescriptor::ReduceRealMin(estdt); if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "estTimeStep :: \n" << "LEV = " << level << " UMAX = "; for (int k = 0; k < BL_SPACEDIM; k++) std::cout << u_max[k] << " "; std::cout << '\n'; } Real vel_max = u_max[0]; for (int k = 1; k < BL_SPACEDIM; k++) { vel_max = std::max(vel_max,u_max[k]); } if (vel_max < 1.0e-10) { const Real grav = std::abs(gravity); Real dx_min = dx[0]; vel_max = (grav > 1.0e-5) ? grav : 1.0; for (int k = 1; k < BL_SPACEDIM; k++) dx_min = std::min(dx_min,dx[k]); estdt = cfl*dx_min/vel_max; } return estdt; } Real NavierStokes::initialTimeStep () { return init_shrink*estTimeStep(); } void NavierStokes::computeNewDt (int finest_level, int sub_cycle, Array& n_cycle, const Array& ref_ratio, Array& dt_min, Array& dt_level, Real stop_time) { // // We are at the end of a coarse grid timecycle. // Compute the timesteps for the next iteration. // if (level > 0) return; // // For Navier Stokes compute the new dt based on current velocity field. // const int max_level = parent->maxLevel(); n_cycle[0] = 1; for (int i = 1; i <= max_level; i++) { n_cycle[i] = sub_cycle ? parent->MaxRefRatio(i-1) : 1; } Real dt_0 = 1.0e+100; int n_factor = 1; for (int i = 0; i <= finest_level; i++) { dt_min[i] = std::min(dt_min[i],getLevel(i).estTimeStep()); if (fixed_dt <= 0.0) dt_min[i] = std::min(dt_min[i],change_max*dt_level[i]); n_factor *= n_cycle[i]; dt_0 = std::min(dt_0,n_factor*dt_min[i]); } const Real eps = 0.0001*dt_0; const Real cur_time = state[State_Type].curTime(); if (stop_time >= 0.0) { if ((cur_time + dt_0) > (stop_time - eps)) dt_0 = stop_time - cur_time; } // // Adjust the time step to be able to output checkpoints at specific times. // const Real check_per = parent->checkPer(); if (check_per > 0.0) { int a = int((cur_time + eps ) / check_per); int b = int((cur_time + dt_0) / check_per); if (a != b) dt_0 = b * check_per - cur_time; } // // Adjust the time step to be able to output plot files at specific times. // const Real plot_per = parent->plotPer(); if (plot_per > 0.0) { int a = int((cur_time + eps ) / plot_per); int b = int((cur_time + dt_0) / plot_per); if (a != b) dt_0 = b * plot_per - cur_time; } n_factor = 1; for (int i = 0; i <= max_level; i++) { n_factor *= n_cycle[i]; dt_level[i] = dt_0/( (float)n_factor ); } } void NavierStokes::computeInitialDt (int finest_level, int sub_cycle, Array& n_cycle, const Array& ref_ratio, Array& dt_level, Real stop_time) { // // Grids have been constructed, compute dt for all levels. // if (level > 0) return; // // For Navier Stokes compute the new dt based on current velocity field. // const int max_level = parent->maxLevel(); n_cycle[0] = 1; for (int i = 1; i <= max_level; i++) { n_cycle[i] = sub_cycle ? parent->MaxRefRatio(i-1) : 1; } Real dt_0 = 1.0e+100; int n_factor = 1; for (int i = 0; i <= finest_level; i++) { dt_level[i] = getLevel(i).initialTimeStep(); n_factor *= n_cycle[i]; dt_0 = std::min(dt_0,n_factor*dt_level[i]); } if (stop_time >= 0.0) { const Real eps = 0.0001*dt_0; const Real cur_time = state[State_Type].curTime(); if ((cur_time + dt_0) > (stop_time - eps)) dt_0 = stop_time - cur_time; } n_factor = 1; for (int i = 0; i <= max_level; i++) { n_factor *= n_cycle[i]; dt_level[i] = dt_0/( (float)n_factor ); } } // // This function estimates the initial timesteping used by the model. // void NavierStokes::post_init_estDT (Real& dt_init, Array& nc_save, Array& dt_save, Real stop_time) { const Real strt_time = state[State_Type].curTime(); const int finest_level = parent->finestLevel(); dt_init = 1.0e+100; int n_factor; for (int k = 0; k <= finest_level; k++) { nc_save[k] = parent->nCycle(k); dt_save[k] = getLevel(k).initialTimeStep(); n_factor = 1; for (int m = finest_level; m > k; m--) n_factor *= parent->nCycle(m); dt_init = std::min( dt_init, dt_save[k]/((float) n_factor) ); } Array dt_level(finest_level+1,dt_init); Array n_cycle(finest_level+1,1); Real dt0 = dt_save[0]; n_factor = 1; for (int k = 0; k <= finest_level; k++) { n_factor *= nc_save[k]; dt0 = std::min(dt0,n_factor*dt_save[k]); } if (stop_time >= 0.0) { const Real eps = 0.0001*dt0; if ((strt_time + dt0) > (stop_time - eps)) dt0 = stop_time - strt_time; } n_factor = 1; for (int k = 0; k <= finest_level; k++) { n_factor *= nc_save[k]; dt_save[k] = dt0/( (float) n_factor); } // // Hack. // parent->setDtLevel(dt_level); parent->setNCycle(n_cycle); for (int k = 0; k <= finest_level; k++) { getLevel(k).setTimeLevel(strt_time,dt_init,dt_init); } } // // Fills in amrLevel okToContinue. // int NavierStokes::okToContinue () { return (level > 0) ? true : (parent->dtLevel(0) > dt_cutoff); } // // THE MAIN HOOKS INTO AMR AND AMRLEVEL // // // Integration cycle on fine level grids is complete . // post_timestep() is responsible for syncing levels together. // // The registers used for level syncing are initialized in the // coarse level advance and incremented in the fine level advance. // These quantities are described in comments above advance_setup. // void NavierStokes::post_timestep (int crse_iteration) { const int finest_level = parent->finestLevel(); if (do_reflux && level < finest_level) reflux(); if (level < finest_level) avgDown(); if (do_mac_proj && level < finest_level) mac_sync(); if (do_sync_proj && (level < finest_level)) level_sync(crse_iteration); // // Test for conservation. // if (level==0 && sum_interval>0 && (parent->levelSteps(0)%sum_interval == 0)) { sum_integrated_quantities(); } if (level > 0) incrPAvg(); old_intersect_new = grids; is_first_step_after_regrid = false; } // // Build any additional data structures after restart. // void NavierStokes::post_restart() { make_rho_prev_time(); make_rho_curr_time(); } // // Build any additional data structures after regrid. // void NavierStokes::post_regrid (int lbase, int new_finest) { if (projector && level == lbase) projector->setFinestLevel(new_finest); } // // Ensure state, and pressure are consistent. // void NavierStokes::post_init (Real stop_time) { if (level > 0) // // Nothing to sync up at level > 0. // return; MultiFab& P_new = get_new_data(Press_Type); MultiFab& P_old = get_old_data(Press_Type); const int finest_level = parent->finestLevel(); Real dt_init = 0.0; Array dt_save(finest_level+1); Array nc_save(finest_level+1); // // Ensure state is consistent, i.e. velocity field is non-divergent, // Coarse levels are fine level averages, pressure is zero. // post_init_state(); // // Estimate the initial timestepping. // post_init_estDT(dt_init, nc_save, dt_save, stop_time); // // Initialize the pressure by iterating the initial timestep. // post_init_press(dt_init, nc_save, dt_save); // // Compute the initial estimate of conservation. // if (sum_interval > 0) sum_integrated_quantities(); } // // MULTILEVEL SYNC FUNCTIONS // void NavierStokes::initRhoAvg (Real alpha) { MultiFab& S_new = get_new_data(State_Type); rho_avg->setVal(0); for (MFIter rho_avgmfi(*rho_avg); rho_avgmfi.isValid(); ++rho_avgmfi) { const int i = rho_avgmfi.index(); (*rho_avg)[i].copy(S_new[i],S_new.box(i),Density,S_new.box(i),0,1); (*rho_avg)[i].mult(alpha); } } void NavierStokes::incrRhoAvg(const MultiFab& rho_incr, int sComp, Real alpha) { for (MFIter mfi(rho_incr); mfi.isValid(); ++mfi) { const int* lo = mfi.validbox().loVect(); const int* hi = mfi.validbox().hiVect(); const int* rlo = rho_incr[mfi].loVect(); const int* rhi = rho_incr[mfi].hiVect(); const Real* rhodat = rho_incr[mfi].dataPtr(sComp); const int* alo = (*rho_avg)[mfi].loVect(); const int* ahi = (*rho_avg)[mfi].hiVect(); Real* avgdat = (*rho_avg)[mfi].dataPtr(); FORT_INCRMULT(avgdat,ARLIM(alo),ARLIM(ahi), rhodat,ARLIM(rlo),ARLIM(rhi),lo,hi,&alpha); } } void NavierStokes::incrRhoAvg (Real alpha) { const MultiFab& S_new = get_new_data(State_Type); incrRhoAvg(S_new,Density,alpha); } void NavierStokes::incrPAvg () { // // Increment p_avg with 1/ncycle times current pressure // MultiFab& P_new = get_new_data(Press_Type); Real alpha = 1.0/Real(parent->nCycle(level)); for (MFIter P_newmfi(P_new); P_newmfi.isValid(); ++P_newmfi) { const int* lo = P_newmfi.validbox().loVect(); const int* hi = P_newmfi.validbox().hiVect(); const int* p_lo = P_new[P_newmfi].loVect(); const int* p_hi = P_new[P_newmfi].hiVect(); const Real* pdat = P_new[P_newmfi].dataPtr(); const int* alo = (*p_avg)[P_newmfi].loVect(); const int* ahi = (*p_avg)[P_newmfi].hiVect(); Real* avgdat = (*p_avg)[P_newmfi].dataPtr(); FORT_INCRMULT(avgdat,ARLIM(alo),ARLIM(ahi), pdat,ARLIM(p_lo),ARLIM(p_hi),lo,hi,&alpha); } } // // This function ensures that the state is initially consistent // with respect to the divergence condition and fields are initially consistent // void NavierStokes::post_init_state () { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::post_init_state()"); const int finest_level = parent->finestLevel(); const Real divu_time = have_divu ? state[Divu_Type].curTime() : state[Press_Type].curTime(); if (do_init_vort_proj) { // // NOTE: this assumes have_divu == 0. // Only used if vorticity is used to initialize the velocity field. // BL_ASSERT(!(projector == 0)); projector->initialVorticityProject(0); } if (do_init_proj && projector) // // Do sync project to define divergence free velocity field. // projector->initialVelocityProject(0,divu_time,have_divu); NavierStokes::initial_step = true; // // Average velocity and scalar data down from finer levels // so that conserved data is consistant between levels. // for (int k = finest_level-1; k>= 0; k--) { getLevel(k).avgDown(); } make_rho_curr_time(); if (do_init_proj && projector && (std::abs(gravity)) > 0.) // // Do projection to establish initially hydrostatic pressure field. // projector->initialPressureProject(0); } // // Initialize the pressure by iterating the initial timestep // void NavierStokes::post_init_press (Real& dt_init, Array& nc_save, Array& dt_save) { const Real strt_time = state[State_Type].curTime(); const int finest_level = parent->finestLevel(); MultiFab& P_new = get_new_data(Press_Type); MultiFab& P_old = get_old_data(Press_Type); NavierStokes::initial_iter = true; // // Iterate over the advance function. // for (int iter = 0; iter < init_iter; iter++) { for (int k = 0; k <= finest_level; k++ ) { getLevel(k).advance(strt_time,dt_init,1,1); } // // This constructs a guess at P, also sets p_old == p_new. // MultiFab** sig = new MultiFab*[finest_level+1]; for (int k = 0; k <= finest_level; k++) { sig[k] = getLevel(k).get_rho_half_time(); } if (projector) projector->initialSyncProject(0,sig,parent->dtLevel(0), strt_time,dt_init,have_divu); delete [] sig; for (int k = finest_level-1; k >= 0; k--) { getLevel(k).avgDown(); } for (int k = 0; k <= finest_level; k++) { // // Reset state variables to initial time, but // do not reset pressure variable, only pressure time. // getLevel(k).resetState(strt_time, dt_init, dt_init); } make_rho_curr_time(); NavierStokes::initial_iter = false; } if (init_iter <= 0) NavierStokes::initial_iter = false; // Just being compulsive -- rbp. NavierStokes::initial_step = false; // // Re-instate timestep. // for (int k = 0; k <= finest_level; k++) { getLevel(k).setTimeLevel(strt_time,dt_save[k],dt_save[k]); if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) { getLevel(k).state[Press_Type].setNewTimeLevel(.5*dt_init); getLevel(k).get_old_data(Dpdt_Type).setVal(0); } } parent->setDtLevel(dt_save); parent->setNCycle(nc_save); } // // Helper function for NavierStokes::SyncInterp(). // static void set_bc_new (int* bc_new, int n, int src_comp, const int* clo, const int* chi, const int* cdomlo, const int* cdomhi, const BoxArray& cgrids, int** bc_orig_qty) { for (int dir = 0; dir < BL_SPACEDIM; dir++) { int bc_index = (n+src_comp)*(2*BL_SPACEDIM) + dir; bc_new[bc_index] = INT_DIR; bc_new[bc_index+BL_SPACEDIM] = INT_DIR; if (clo[dir] < cdomlo[dir] || chi[dir] > cdomhi[dir]) { for (int crse = 0; crse < cgrids.size(); crse++) { const int* c_lo = cgrids[crse].loVect(); const int* c_hi = cgrids[crse].hiVect(); if (clo[dir] < cdomlo[dir] && c_lo[dir] == cdomlo[dir]) bc_new[bc_index] = bc_orig_qty[crse][bc_index]; if (chi[dir] > cdomhi[dir] && c_hi[dir] == cdomhi[dir]) bc_new[bc_index+BL_SPACEDIM] = bc_orig_qty[crse][bc_index+BL_SPACEDIM]; } } } } // // Interpolate A cell centered Sync correction from a // coarse level (c_lev) to a fine level (f_lev). // // This routine interpolates the num_comp components of CrseSync // (starting at src_comp) and either increments or puts the result into // the num_comp components of FineSync (starting at dest_comp) // The components of bc_orig_qty corespond to the quantities of CrseSync. // void NavierStokes::SyncInterp (MultiFab& CrseSync, int c_lev, MultiFab& FineSync, int f_lev, IntVect& ratio, int src_comp, int dest_comp, int num_comp, int increment, Real dt_clev, int** bc_orig_qty, int which_interp, int state_comp) { BL_ASSERT(which_interp >= 0 && which_interp <= 5); Interpolater* interpolater = 0; switch (which_interp) { case 0: interpolater = &cell_cons_interp; break; case 1: interpolater = &pc_interp; break; case 2: interpolater = &unlimited_cc_interp; break; case 3: interpolater = &lincc_interp; break; case 4: interpolater = &nonlincc_interp; break; case 5: interpolater = &protected_interp; break; default: BoxLib::Abort("NavierStokes::SyncInterp(): how did this happen"); } NavierStokes& fine_level = getLevel(f_lev); const BoxArray& fgrids = fine_level.boxArray(); const Geometry& fgeom = parent->Geom(f_lev); const BoxArray& cgrids = getLevel(c_lev).boxArray(); const Geometry& cgeom = parent->Geom(c_lev); const Real* dx_crse = cgeom.CellSize(); Box cdomain = BoxLib::coarsen(fgeom.Domain(),ratio); const int* cdomlo = cdomain.loVect(); const int* cdomhi = cdomain.hiVect(); int* bc_new = new int[2*BL_SPACEDIM*(src_comp+num_comp)]; BoxArray cdataBA(fgrids.size()); for (int i = 0; i < fgrids.size(); i++) cdataBA.set(i,interpolater->CoarseBox(fgrids[i],ratio)); // // Note: The boxes in cdataBA may NOT be disjoint !!! // MultiFab cdataMF(cdataBA,num_comp,0); cdataMF.setVal(0); cdataMF.copy(CrseSync, src_comp, 0, num_comp); // // Set physical boundary conditions in cdataMF. // for (MFIter mfi(cdataMF); mfi.isValid(); ++mfi) { int i = mfi.index(); const Box& grd = fgrids[i]; FArrayBox& cdata = cdataMF[mfi]; const Box& cgrd = cdata.box(); const int* clo = cdata.loVect(); const int* chi = cdata.hiVect(); const Real* xlo = fine_level.grid_loc[i].lo(); for (int n = 0; n < num_comp; n++) { set_bc_new(bc_new,n,src_comp,clo,chi,cdomlo,cdomhi,cgrids,bc_orig_qty); FORT_FILCC(cdata.dataPtr(n), ARLIM(clo), ARLIM(chi), cdomlo, cdomhi, dx_crse, xlo, &(bc_new[2*BL_SPACEDIM*(n+src_comp)])); } } cgeom.FillPeriodicBoundary(cdataMF, 0, num_comp); // // Interpolate from cdataMF to fdata and update FineSync. // Note that FineSync and cdataMF will have the same distribution // since the length of their BoxArrays are equal. // FArrayBox fdata; Array bc_interp(num_comp); MultiFab* fine_stateMF; if (interpolater == &protected_interp) fine_stateMF = &(getLevel(f_lev).get_new_data(State_Type)); for (MFIter mfi(cdataMF); mfi.isValid(); ++mfi) { int i = mfi.index(); FArrayBox& cdata = cdataMF[mfi]; const int* clo = cdata.loVect(); const int* chi = cdata.hiVect(); fdata.resize(fgrids[i], num_comp); // // Set the boundary condition array for interpolation. // for (int n = 0; n < num_comp; n++) { set_bc_new(bc_new,n,src_comp,clo,chi,cdomlo,cdomhi,cgrids,bc_orig_qty); } for (int n = 0; n < num_comp; n++) { for (int dir = 0; dir < BL_SPACEDIM; dir++) { int bc_index = (n+src_comp)*(2*BL_SPACEDIM) + dir; bc_interp[n].setLo(dir,bc_new[bc_index]); bc_interp[n].setHi(dir,bc_new[bc_index+BL_SPACEDIM]); } } ScaleCrseSyncInterp(cdata, c_lev, num_comp); interpolater->interp(cdata,0,fdata,0,num_comp,fgrids[i],ratio, cgeom,fgeom,bc_interp); reScaleFineSyncInterp(fdata, f_lev, num_comp); if (increment) { fdata.mult(dt_clev); if (interpolater == &protected_interp) { cdata.mult(dt_clev); FArrayBox& fine_state = (*fine_stateMF)[i]; interpolater->protect(cdata,0,fdata,0,fine_state,state_comp, num_comp,fgrids[i],ratio, cgeom,fgeom,bc_interp); Real dt_clev_inv = 1./dt_clev; cdata.mult(dt_clev_inv); } FineSync[i].plus(fdata,0,dest_comp,num_comp); } else { FineSync[i].copy(fdata,0,dest_comp,num_comp); } } delete [] bc_new; } // // Interpolate sync pressure correction to a finer level. // void NavierStokes::SyncProjInterp (MultiFab& phi, int c_lev, MultiFab& P_new, MultiFab& P_old, int f_lev, IntVect& ratio, bool first_crse_step_after_initial_iters, Real cur_crse_pres_time, Real prev_crse_pres_time) { const Geometry& fgeom = parent->Geom(f_lev); const BoxArray& P_grids = P_new.boxArray(); const Geometry& cgeom = parent->Geom(c_lev); BoxArray crse_ba(P_grids.size()); for (int i = 0; i < P_grids.size(); i++) { crse_ba.set(i,node_bilinear_interp.CoarseBox(P_grids[i],ratio)); } Array bc(BL_SPACEDIM); MultiFab crse_phi(crse_ba,1,0); crse_phi.setVal(1.e200); crse_phi.copy(phi,0,0,1); FArrayBox fine_phi; NavierStokes& fine_lev = getLevel(f_lev); const Real cur_fine_pres_time = fine_lev.state[Press_Type].curTime(); const Real prev_fine_pres_time = fine_lev.state[Press_Type].prevTime(); if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point && first_crse_step_after_initial_iters) { const Real time_since_zero = cur_crse_pres_time - prev_crse_pres_time; const Real dt_to_prev_time = prev_fine_pres_time - prev_crse_pres_time; const Real dt_to_cur_time = cur_fine_pres_time - prev_crse_pres_time; const Real cur_mult_factor = dt_to_cur_time / time_since_zero; const Real prev_mult_factor = dt_to_prev_time / dt_to_cur_time; for (MFIter mfi(crse_phi); mfi.isValid(); ++mfi) { fine_phi.resize(P_grids[mfi.index()],1); fine_phi.setVal(1.e200); node_bilinear_interp.interp(crse_phi[mfi],0,fine_phi,0,1, fine_phi.box(),ratio,cgeom,fgeom,bc); fine_phi.mult(cur_mult_factor); P_new[mfi.index()].plus(fine_phi); fine_phi.mult(prev_mult_factor); P_old[mfi.index()].plus(fine_phi); } } else { for (MFIter mfi(crse_phi); mfi.isValid(); ++mfi) { fine_phi.resize(P_grids[mfi.index()],1); fine_phi.setVal(1.e200); node_bilinear_interp.interp(crse_phi[mfi],0,fine_phi,0,1, fine_phi.box(),ratio,cgeom,fgeom,bc); P_new[mfi.index()].plus(fine_phi); P_old[mfi.index()].plus(fine_phi); } } } // // Averages a multifab of fine data down onto a multifab of coarse data. // // This should be an Amrlevel or Multifab function // void NavierStokes::avgDown (const BoxArray& cgrids, const BoxArray& fgrids, MultiFab& S_crse, MultiFab& S_fine, MultiFab& cvolume, MultiFab& fvolume, int c_level, int f_level, int scomp, int ncomp, const IntVect& fratio) { BL_ASSERT(cgrids == S_crse.boxArray()); BL_ASSERT(fgrids == S_fine.boxArray()); BL_ASSERT(cvolume.boxArray() == cgrids); BL_ASSERT(fvolume.boxArray() == fgrids); BL_ASSERT(S_crse.nComp() == S_fine.nComp()); BL_ASSERT(fvolume.nComp() == 1 && cvolume.nComp() == 1); // // Coarsen() the fine stuff on processors owning the fine data. // BoxArray crse_S_fine_BA(fgrids.size()); for (int i = 0; i < fgrids.size(); ++i) { crse_S_fine_BA.set(i,BoxLib::coarsen(fgrids[i],fratio)); } MultiFab crse_S_fine(crse_S_fine_BA,ncomp,0); MultiFab crse_fvolume(crse_S_fine_BA,1,0); crse_fvolume.copy(cvolume); for (MFIter mfi(S_fine); mfi.isValid(); ++mfi) { const int i = mfi.index(); avgDown(S_fine[i],crse_S_fine[i],fvolume[i],crse_fvolume[i], f_level,c_level,crse_S_fine_BA[i],scomp,ncomp,fratio); } S_crse.copy(crse_S_fine,0,scomp,ncomp); } // // Average fine down to coarse in the ovlp intersection. // void NavierStokes::avgDown (const FArrayBox& fine_fab, const FArrayBox& crse_fab, const FArrayBox& fine_vol, const FArrayBox& crse_vol, int f_level, int c_level, const Box& ovlp, int scomp, int ncomp, const IntVect& fratio) { avgDown_doit(fine_fab,crse_fab,fine_vol,crse_vol, f_level,c_level,ovlp,scomp,ncomp,fratio); } // // Actually average the data down (this is static) // void NavierStokes::avgDown_doit (const FArrayBox& fine_fab, const FArrayBox& crse_fab, const FArrayBox& fine_vol, const FArrayBox& crse_vol, int f_level, int c_level, const Box& ovlp, int scomp, int ncomp, const IntVect& fratio) { // // NOTE: We copy from component scomp of the fine fab into component 0 of the crse fab // because the crse fab is a temporary which was made starting at comp 0, it is // not the actual state data. // const int* ovlo = ovlp.loVect(); const int* ovhi = ovlp.hiVect(); const int* flo = fine_fab.loVect(); const int* fhi = fine_fab.hiVect(); const Real* f_dat = fine_fab.dataPtr(scomp); const int* fvlo = fine_vol.loVect(); const int* fvhi = fine_vol.hiVect(); const Real* fv_dat = fine_vol.dataPtr(); const int* clo = crse_fab.loVect(); const int* chi = crse_fab.hiVect(); const Real* c_dat = crse_fab.dataPtr(); const int* cvlo = crse_vol.loVect(); const int* cvhi = crse_vol.hiVect(); const Real* cv_dat = crse_vol.dataPtr(); FORT_AVGDOWN(c_dat,ARLIM(clo),ARLIM(chi),&ncomp, f_dat,ARLIM(flo),ARLIM(fhi), cv_dat,ARLIM(cvlo),ARLIM(cvhi), fv_dat,ARLIM(fvlo),ARLIM(fvhi), ovlo,ovhi,fratio.getVect()); } void NavierStokes::level_sync (int crse_iteration) { const Real strt_time = ParallelDescriptor::second(); const Real* dx = geom.CellSize(); IntVect ratio = parent->refRatio(level); const int finest_level = parent->finestLevel(); int crse_dt_ratio = parent->nCycle(level); Real dt = parent->dtLevel(level); const Real half_time = state[State_Type].prevTime() + 0.5*dt; MultiFab& pres = get_new_data(Press_Type); MultiFab& vel = get_new_data(State_Type); SyncRegister& rhs_sync_reg = getLevel(level+1).getSyncReg(); SyncRegister* crsr_sync_ptr = 0; NavierStokes& fine_level = getLevel(level+1); MultiFab& pres_fine = fine_level.get_new_data(Press_Type); MultiFab& vel_fine = fine_level.get_new_data(State_Type); const BoxArray& finegrids = vel_fine.boxArray(); if (level > 0) crsr_sync_ptr = &(getLevel(level).getSyncReg()); // // Get boundary conditions. // Array sync_bc(grids.size()); Array< Array > sync_bc_array(grids.size()); for (int i = 0; i < grids.size(); i++) { sync_bc_array[i] = getBCArray(State_Type,i,Xvel,BL_SPACEDIM); sync_bc[i] = sync_bc_array[i].dataPtr(); } MultiFab cc_rhs_crse(grids,1,1); MultiFab cc_rhs_fine(finegrids,1,1); cc_rhs_crse.setVal(0); cc_rhs_fine.setVal(0); MultiFab new_divu_crse(grids,1,0); MultiFab new_divu_fine(finegrids,1,0); // // At this point the Divu state data is what was used in the original // level project and has not been updated by avgDown or mac_sync. // We want to fill cc_rhs_crse and cc_rhs_fine with the difference // between the divu we now define using calc_divu and the divu which // is in the state data. // We are also copying the new computed value of divu into the Divu state. // if (do_sync_proj && have_divu && do_divu_sync == 1) { const Real cur_time = state[Divu_Type].curTime(); const Real dt_inv = 1.0 / dt; MultiFab& cur_divu_crse = get_new_data(Divu_Type); calc_divu(cur_time,dt,cc_rhs_crse); MultiFab::Copy(new_divu_crse,cc_rhs_crse,0,0,1,0); cc_rhs_crse.minus(cur_divu_crse,0,1,0); MultiFab::Copy(cur_divu_crse,new_divu_crse,0,0,1,0); cc_rhs_crse.mult(dt_inv,0,1,0); NavierStokes& fine_lev = getLevel(level+1); MultiFab& cur_divu_fine = fine_lev.get_new_data(Divu_Type); fine_lev.calc_divu(cur_time,dt,cc_rhs_fine); MultiFab::Copy(new_divu_fine,cc_rhs_fine,0,0,1,0); cc_rhs_fine.minus(cur_divu_fine,0,1,0); MultiFab::Copy(cur_divu_fine,new_divu_fine,0,0,1,0); cc_rhs_fine.mult(dt_inv,0,1,0); // // With new divu's, get new Dsdt, then average down. // calc_dsdt(cur_time, dt, get_new_data(Dsdt_Type)); fine_lev.calc_dsdt(cur_time, dt/crse_dt_ratio, fine_lev.get_new_data(Dsdt_Type)); for (int k = level; k>= 0; k--) { NavierStokes& flev = getLevel(k+1); const BoxArray& fgrids = flev.grids; MultiFab& fvolume = flev.volume; NavierStokes& clev = getLevel(k); const BoxArray& cgrids = clev.grids; MultiFab& cvolume = clev.volume; IntVect& fratio = clev.fine_ratio; NavierStokes::avgDown(cgrids, fgrids, clev.get_new_data(Divu_Type), flev.get_new_data(Divu_Type), cvolume, fvolume, k, k+1, 0, 1, fratio); NavierStokes::avgDown(cgrids, fgrids, clev.get_new_data(Dsdt_Type), flev.get_new_data(Dsdt_Type), cvolume, fvolume, k, k+1, 0, 1, fratio); } } // // Multilevel or single-level sync projection. // MultiFab* Rh = get_rho_half_time(); if (do_MLsync_proj) { MultiFab& vel_fine = fine_level.get_new_data(State_Type); MultiFab& rho_fine = *fine_level.rho_avg; const Geometry& fine_geom = parent->Geom(level+1); const Geometry& crse_geom = parent->Geom(level); const BoxArray& P_finegrids = pres_fine.boxArray(); MultiFab phi(P_finegrids,1,1); MultiFab V_corr(finegrids,BL_SPACEDIM,1); V_corr.setVal(0); // // If periodic, enforce periodicity on Vsync. // projector->EnforcePeriodicity(*Vsync, BL_SPACEDIM, grids, crse_geom); // // Interpolate Vsync to fine grid correction in Vcorr. // SyncInterp(*Vsync, level, V_corr, level+1, ratio, 0, 0, BL_SPACEDIM, 0 , dt, sync_bc.dataPtr()); // // The multilevel projection. This computes the projection and // adds in its contribution to levels (level) and (level+1). // Real cur_crse_pres_time = state[Press_Type].curTime(); Real prev_crse_pres_time = state[Press_Type].prevTime(); NavierStokes& fine_lev = getLevel(level+1); Real cur_fine_pres_time = fine_lev.state[Press_Type].curTime(); Real prev_fine_pres_time = fine_lev.state[Press_Type].prevTime(); bool first_crse_step_after_initial_iters = (prev_crse_pres_time > state[State_Type].prevTime()); bool pressure_time_is_interval = (state[Press_Type].descriptor()->timeType() == StateDescriptor::Interval); projector->MLsyncProject(level,pres,vel,cc_rhs_crse, pres_fine,vel_fine,cc_rhs_fine, *Rh,rho_fine,Vsync,V_corr, phi,&rhs_sync_reg,crsr_sync_ptr, dx,dt,ratio,crse_iteration,crse_dt_ratio, fine_geom,geom,pressure_time_is_interval, first_crse_step_after_initial_iters, cur_crse_pres_time,prev_crse_pres_time, cur_fine_pres_time,prev_fine_pres_time); // // Correct pressure and velocities after the projection. // ratio = IntVect::TheUnitVector(); Array fine_sync_bc(finegrids.size()); Array< Array > fine_sync_bc_array(finegrids.size()); for (int i = 0; i < finegrids.size(); i++) { fine_sync_bc_array[i] = getLevel(level+1).getBCArray(State_Type, i, Xvel, BL_SPACEDIM); fine_sync_bc[i] = fine_sync_bc_array[i].dataPtr(); } for (int lev = level+2; lev <= finest_level; lev++) { ratio *= parent->refRatio(lev-1); NavierStokes& fine_lev = getLevel(lev); MultiFab& P_new = fine_lev.get_new_data(Press_Type); MultiFab& P_old = fine_lev.get_old_data(Press_Type); MultiFab& U_new = fine_lev.get_new_data(State_Type); SyncInterp(V_corr, level+1, U_new, lev, ratio, 0, 0, BL_SPACEDIM, 1 , dt, fine_sync_bc.dataPtr()); SyncProjInterp(phi, level+1, P_new, P_old, lev, ratio, first_crse_step_after_initial_iters, cur_crse_pres_time, prev_crse_pres_time); } if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) calcDpdt(); } else if (do_sync_proj) { MultiFab phi(pres.boxArray(),1,1); BoxArray sync_boxes = pres_fine.boxArray(); sync_boxes.coarsen(ratio); // // The single level projection. This computes the projection and // adds in its contribution to level (level). // projector->syncProject(level,pres,vel,Rh,Vsync,phi, &rhs_sync_reg,crsr_sync_ptr,sync_boxes, geom,dx,dt,crse_iteration,crse_dt_ratio); // // Correct pressure and velocities after the projection. // ratio = IntVect::TheUnitVector(); const Real cur_crse_pres_time = state[Press_Type].curTime(); const Real prev_crse_pres_time = state[Press_Type].prevTime(); bool first_crse_step_after_initial_iters = (prev_crse_pres_time > state[State_Type].prevTime()); for (int lev = level+1; lev <= finest_level; lev++) { ratio *= parent->refRatio(lev-1); NavierStokes& fine_lev = getLevel(lev); MultiFab& P_new = fine_lev.get_new_data(Press_Type); MultiFab& P_old = fine_lev.get_old_data(Press_Type); MultiFab& U_new = fine_lev.get_new_data(State_Type); SyncInterp(*Vsync, level, U_new, lev, ratio, 0, 0, BL_SPACEDIM, 1 , dt, sync_bc.dataPtr()); SyncProjInterp(phi, level, P_new, P_old, lev, ratio, first_crse_step_after_initial_iters, cur_crse_pres_time, prev_crse_pres_time); } if (state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) calcDpdt(); } const int IOProc = ParallelDescriptor::IOProcessorNumber(); Real run_time = ParallelDescriptor::second() - strt_time; ParallelDescriptor::ReduceRealMax(run_time,IOProc); if (verbose && ParallelDescriptor::IOProcessor()) { std::cout << "NavierStokes:level_sync(): lev: " << level << ", time: " << run_time << std::endl; } } // // The Mac Sync correction function // void NavierStokes::mac_sync () { const int numscal = NUM_STATE - BL_SPACEDIM; const Real prev_time = state[State_Type].prevTime(); const Real prev_pres_time = state[Press_Type].prevTime(); const Real dt = parent->dtLevel(level); MultiFab* DeltaSsync = 0;// hold (Delta rho)*q for conserved quantities MultiFab* Rh = get_rho_half_time(); sync_setup(DeltaSsync); // // Compute the u_mac for the correction. // mac_projector->mac_sync_solve(level,dt,Rh,fine_ratio); // // Update coarse grid state by adding correction from mac_sync solve // the correction is the advective tendency of the new velocities. // if (do_reflux) { MultiFab& S_new = get_new_data(State_Type); mac_projector->mac_sync_compute(level,u_mac,Vsync,Ssync,Rh, level > 0 ? &getAdvFluxReg(level) : 0, advectionType, prev_time, prev_pres_time,dt, NUM_STATE,be_cn_theta, modify_reflux_normal_vel, do_mom_diff); // // The following used to be done in mac_sync_compute. Ssync is // the source for a rate of change to S over the time step, so // Ssync*dt is the source to the actual sync amount. // Ssync->mult(dt,Ssync->nGrow()); // // For all conservative variables Q (other than density) // express Q as rho*q and increment sync by -(sync_for_rho)*q // (See Pember, et. al., LBNL-41339, Jan. 1989) // FArrayBox delta_ssync; int iconserved = -1; for (int istate = BL_SPACEDIM; istate < NUM_STATE; istate++) { if (istate != Density && advectionType[istate] == Conservative) { iconserved++; for (MFIter Smfi(S_new); Smfi.isValid(); ++Smfi) { const int i = Smfi.index(); const Box& grd = grids[i]; delta_ssync.resize(grd,1); delta_ssync.copy(S_new[Smfi], grd, istate, grd, 0, 1); delta_ssync.divide(S_new[Smfi], grd, Density, 0, 1); delta_ssync.mult((*Ssync)[Smfi],grd,Density-BL_SPACEDIM,0,1); (*DeltaSsync)[Smfi].copy(delta_ssync,grd,0,grd,iconserved,1); (*Ssync)[Smfi].minus(delta_ssync,grd,0,istate-BL_SPACEDIM,1); } } } if (do_mom_diff == 1) { for (MFIter Vsyncmfi(*Vsync); Vsyncmfi.isValid(); ++Vsyncmfi) { const int i = Vsyncmfi.index(); D_TERM((*Vsync)[i].divide((*rho_ctime)[i],rho_ctime->box(i),0,Xvel,1);, (*Vsync)[i].divide((*rho_ctime)[i],rho_ctime->box(i),0,Yvel,1);, (*Vsync)[i].divide((*rho_ctime)[i],rho_ctime->box(i),0,Zvel,1);); } } // // Compute viscous sync. // if (is_diffusive[Xvel]) { int rho_flag = (do_mom_diff == 0) ? 1 : 3; MultiFab** loc_viscn = 0; if (variable_vel_visc) { Real viscTime = state[State_Type].prevTime(); diffusion->allocFluxBoxesLevel(loc_viscn, 0, 1); getViscosity(loc_viscn, viscTime); } diffusion->diffuse_Vsync(Vsync,dt,be_cn_theta,Rh,rho_flag,loc_viscn); if (variable_vel_visc) { diffusion->removeFluxBoxesLevel(loc_viscn); } } MultiFab** fluxSC = 0; bool any_diffusive = false; for (int sigma = 0; sigma < numscal; sigma++) if (is_diffusive[BL_SPACEDIM+sigma]) any_diffusive = true; if (any_diffusive) diffusion->allocFluxBoxesLevel(fluxSC,0,1); for (int sigma = 0; sigmaallocFluxBoxesLevel(cmp_diffn, 0, 1); getDiffusivity(cmp_diffn, diffTime, BL_SPACEDIM+sigma,0,1); } diffusion->diffuse_Ssync(Ssync,sigma,dt,be_cn_theta, Rh,rho_flag,fluxSC,0,cmp_diffn); if (variable_scal_diff) { diffusion->removeFluxBoxesLevel(cmp_diffn); } // // Increment the viscous flux registers // if (level > 0) { for (int d = 0; d < BL_SPACEDIM; d++) { Real mult = dt; MultiFab& fluxSCd = *fluxSC[d]; for (MFIter fmfi(fluxSCd); fmfi.isValid(); ++fmfi) getViscFluxReg().FineAdd(fluxSCd[fmfi],d, fmfi.index(), 0,state_ind,1,mult); } } } } if (any_diffusive) diffusion->removeFluxBoxesLevel(fluxSC); // // For all conservative variables Q (other than density) // increment sync by (sync_for_rho)*q_presync. // (See Pember, et. al., LBNL-41339, Jan. 1989) // iconserved = -1; for (int istate = BL_SPACEDIM; istate < NUM_STATE; istate++) { if (istate != Density && advectionType[istate] == Conservative) { iconserved++; for (MFIter SsyncMfi(*Ssync); SsyncMfi.isValid(); ++SsyncMfi) { const int i = SsyncMfi.index(); (*Ssync)[i].plus((*DeltaSsync)[i], grids[i], iconserved, istate-BL_SPACEDIM, 1); } } } // // Add the sync correction to the state. // for (int sigma = 0; sigma < numscal; sigma++) { for (MFIter S_newmfi(S_new); S_newmfi.isValid(); ++S_newmfi) { S_new[S_newmfi].plus((*Ssync)[S_newmfi],S_newmfi.validbox(), sigma,BL_SPACEDIM+sigma,1); } } // // Update rho_ctime after rho is updated with Ssync. // make_rho_curr_time(); if (level > 0) incrRhoAvg((*Ssync),Density-BL_SPACEDIM,1.0); // // Get boundary conditions. // Array sync_bc(grids.size()); Array< Array > sync_bc_array(grids.size()); for (int i = 0; i < grids.size(); i++) { sync_bc_array[i] = getBCArray(State_Type,i,Density,numscal); sync_bc[i] = sync_bc_array[i].dataPtr(); } // // Interpolate the sync correction to the finer levels, // and update rho_ctime, rhoAvg at those levels. // IntVect ratio = IntVect::TheUnitVector(); const Real mult = 1.0; for (int lev = level+1; lev <= parent->finestLevel(); lev++) { ratio *= parent->refRatio(lev-1); NavierStokes& fine_lev = getLevel(lev); const BoxArray& fine_grids = fine_lev.boxArray(); MultiFab sync_incr(fine_grids,numscal,0); sync_incr.setVal(0.0); SyncInterp(*Ssync,level,sync_incr,lev,ratio,0,0, numscal,1,mult,sync_bc.dataPtr()); MultiFab& S_new = fine_lev.get_new_data(State_Type); for (MFIter mfi(S_new); mfi.isValid(); ++mfi) S_new[mfi].plus(sync_incr[mfi],fine_grids[mfi.index()],0,Density,numscal); fine_lev.make_rho_curr_time(); fine_lev.incrRhoAvg(sync_incr,Density-BL_SPACEDIM,1.0); } } sync_cleanup(DeltaSsync); } void NavierStokes::sync_setup (MultiFab*& DeltaSsync) { BL_ASSERT(DeltaSsync == 0); int nconserved = Godunov::how_many(advectionType, Conservative, BL_SPACEDIM, NUM_STATE-BL_SPACEDIM); if (nconserved > 0 && level < parent->finestLevel()) { DeltaSsync = new MultiFab(grids, nconserved, 1, Fab_allocate); DeltaSsync->setVal(0,1); } } void NavierStokes::sync_cleanup (MultiFab*& DeltaSsync) { delete DeltaSsync; DeltaSsync = 0; } // // The reflux function // void NavierStokes::reflux () { if (level == parent->finestLevel()) return; BL_ASSERT(do_reflux); MultiFab& S_crse = get_new_data(State_Type); // // First do refluxing step. // FluxRegister& fr_adv = getAdvFluxReg(level+1); FluxRegister& fr_visc = getViscFluxReg(level+1); Real dt_crse = parent->dtLevel(level); Real scale = 1.0/dt_crse; // // It is important, for do_mom_diff == 0, to do the viscous // refluxing first, since this will be divided by rho_half // before the advective refluxing is added. In the case of // do_mom_diff == 1, both components of the refluxing will // be divided by rho^(n+1) in level_sync. // fr_visc.Reflux(*Vsync,volume,scale,0,0,BL_SPACEDIM,geom); fr_visc.Reflux(*Ssync,volume,scale,BL_SPACEDIM,0,NUM_STATE-BL_SPACEDIM,geom); const MultiFab* Rh = get_rho_half_time(); if (do_mom_diff == 0) { for (MFIter Vsyncmfi(*Vsync); Vsyncmfi.isValid(); ++Vsyncmfi) { const int i = Vsyncmfi.index(); D_TERM((*Vsync)[i].divide((*Rh)[i],Rh->box(i),0,Xvel,1);, (*Vsync)[i].divide((*Rh)[i],Rh->box(i),0,Yvel,1);, (*Vsync)[i].divide((*Rh)[i],Rh->box(i),0,Zvel,1);); } } for (int istate = BL_SPACEDIM; istate < NUM_STATE; istate++) { if (advectionType[istate] == NonConservative) { const int sigma = istate - BL_SPACEDIM; for (MFIter Ssyncmfi(*Ssync); Ssyncmfi.isValid(); ++Ssyncmfi) { const int i = Ssyncmfi.index(); (*Ssync)[i].divide((*Rh)[i],Rh->box(i),0,sigma,1); } } } fr_adv.Reflux(*Vsync,volume,scale,0,0,BL_SPACEDIM,geom); fr_adv.Reflux(*Ssync,volume,scale,BL_SPACEDIM,0,NUM_STATE-BL_SPACEDIM,geom); const BoxArray& fine_boxes = getLevel(level+1).boxArray(); const int nfine = fine_boxes.size(); // // This is necessary in order to zero out the contribution to any // coarse grid cells which underlie fine grid cells. // for (int kf = 0; kf < nfine; kf++) { Box bf = BoxLib::coarsen(fine_boxes[kf],fine_ratio); for (MFIter Vsyncmfi(*Vsync); Vsyncmfi.isValid(); ++Vsyncmfi) { const int i = Vsyncmfi.index(); BL_ASSERT(grids[i] == Vsyncmfi.validbox()); Box bx = bf & Vsyncmfi.validbox(); if (bx.ok()) { (*Vsync)[i].setVal(0,bx,0,BL_SPACEDIM); (*Ssync)[i].setVal(0,bx,0,NUM_STATE-BL_SPACEDIM); } } } } // // Average down a single state component. // void NavierStokes::avgDown (int comp) { if (level == parent->finestLevel()) return; NavierStokes& fine_lev = getLevel(level+1); const BoxArray& fgrids = fine_lev.grids; MultiFab& fvolume = fine_lev.volume; MultiFab& S_crse = get_new_data(State_Type); MultiFab& S_fine = fine_lev.get_new_data(State_Type); avgDown(grids,fgrids,S_crse,S_fine,volume,fvolume,level,level+1,comp,1,fine_ratio); if (comp == Density) { // // Fill rho_ctime at current and finer levels with the correct data. // for (int lev = level; lev <= parent->finestLevel(); lev++) { getLevel(lev).make_rho_curr_time(); } } } // // Inject fine pressure nodes down onto coarse nodes. // void NavierStokes::injectDown (const Box& ovlp, FArrayBox& Pcrse, const FArrayBox& Pfine, IntVect& fine_ratio ) { const int* ovlo = ovlp.loVect(); const int* ovhi = ovlp.hiVect(); Real* cpres = Pcrse.dataPtr(); const int* clo = Pcrse.loVect(); const int* chi = Pcrse.hiVect(); const Real* fpres = Pfine.dataPtr(); const int* flo = Pfine.loVect(); const int* fhi = Pfine.hiVect(); FORT_PUTDOWN(cpres,ARLIM(clo),ARLIM(chi), fpres,ARLIM(flo),ARLIM(fhi), ovlo,ovhi,fine_ratio.getVect()); } // // Test for consistency between fine and coarse nodes. // void NavierStokes::testInject (const Box& ovlp, FArrayBox& Pcrse, const FArrayBox& Pfine, IntVect& fine_ratio) { const int* ovlo = ovlp.loVect(); const int* ovhi = ovlp.hiVect(); Real* cpres = Pcrse.dataPtr(); const int* clo = Pcrse.loVect(); const int* chi = Pcrse.hiVect(); const Real* fpres = Pfine.dataPtr(); const int* flo = Pfine.loVect(); const int* fhi = Pfine.hiVect(); FORT_TESTINJECT(cpres,ARLIM(clo),ARLIM(chi), fpres,ARLIM(flo),ARLIM(fhi), ovlo,ovhi,fine_ratio.getVect()); } // // Average fine information from the complete set of state types to coarse. // void NavierStokes::avgDown () { if (level == parent->finestLevel()) return; NavierStokes& fine_lev = getLevel(level+1); const BoxArray& fgrids = fine_lev.grids; MultiFab& fvolume = fine_lev.volume; // // Average down the states at the new time. // MultiFab& S_crse = get_new_data(State_Type); MultiFab& S_fine = fine_lev.get_new_data(State_Type); avgDown(grids,fgrids,S_crse,S_fine,volume,fvolume,level,level+1,0,S_crse.nComp(), fine_ratio); // // Now average down pressure over time n-(n+1) interval. // MultiFab& P_crse = get_new_data(Press_Type); MultiFab& P_fine_init = fine_lev.get_new_data(Press_Type); MultiFab& P_fine_avg = *fine_lev.p_avg; MultiFab& P_fine = initial_step ? P_fine_init : P_fine_avg; const BoxArray& P_cgrids = state[Press_Type].boxArray(); const BoxArray& P_fgrids = fine_lev.state[Press_Type].boxArray(); BoxArray crse_P_fine_BA(P_fgrids.size()); for (int i = 0; i < P_fgrids.size(); ++i) { crse_P_fine_BA.set(i,BoxLib::coarsen(P_fgrids[i],fine_ratio)); } MultiFab crse_P_fine(crse_P_fine_BA,1,0); for (MFIter mfi(P_fine); mfi.isValid(); ++mfi) { const int i = mfi.index(); injectDown(crse_P_fine_BA[i],crse_P_fine[i],P_fine[i],fine_ratio); } P_crse.copy(crse_P_fine); // // Next average down divu and dSdT at new time. // if (have_divu) { MultiFab& Divu_crse = get_new_data(Divu_Type); MultiFab& Divu_fine = fine_lev.get_new_data(Divu_Type); avgDown(grids,fgrids,Divu_crse,Divu_fine,volume,fvolume,level,level+1,0,1,fine_ratio); } if (have_dsdt) { MultiFab& Dsdt_crse = get_new_data(Dsdt_Type); MultiFab& Dsdt_fine = fine_lev.get_new_data(Dsdt_Type); avgDown(grids,fgrids,Dsdt_crse,Dsdt_fine,volume,fvolume,level,level+1,0,1,fine_ratio); } // // Fill rho_ctime at the current and finer levels with the correct data. // for (int lev = level; lev <= parent->finestLevel(); lev++) { getLevel(lev).make_rho_curr_time(); } } // // ACCESS FUNCTIONS FOLLOW // // // Virtual access function for getting the advective flux out of the // advection routines for diagnostics and refluxing. // void NavierStokes::pullFluxes (int i, int start_ind, int ncomp, FArrayBox& xflux, FArrayBox& yflux, FArrayBox& zflux, Real dt) { // // Add fluxes into the refluxing counters. // if (do_reflux) { if (level < parent->finestLevel()) { FluxRegister& fr = getAdvFluxReg(level+1); if (!modify_reflux_normal_vel || start_ind != Xvel) fr.CrseInit(xflux,xflux.box(),0,0,start_ind,ncomp,-dt); if (!modify_reflux_normal_vel || start_ind != Yvel) fr.CrseInit(yflux,yflux.box(),1,0,start_ind,ncomp,-dt); #if (BL_SPACEDIM == 3) if (!modify_reflux_normal_vel || start_ind != Zvel) fr.CrseInit(zflux,zflux.box(),2,0,start_ind,ncomp,-dt); #endif } if (level > 0) { if (!modify_reflux_normal_vel || start_ind != Xvel) advflux_reg->FineAdd(xflux,0,i,0,start_ind,ncomp,dt); if (!modify_reflux_normal_vel || start_ind != Yvel) advflux_reg->FineAdd(yflux,1,i,0,start_ind,ncomp,dt); #if (BL_SPACEDIM == 3) if (!modify_reflux_normal_vel || start_ind != Zvel) advflux_reg->FineAdd(zflux,2,i,0,start_ind,ncomp,dt); #endif } } } // // Virtual access function for getting the forcing terms for the // velocities and scalars. The base version computes a buoyancy. // // As NavierStokes is currently implemented. Velocities are integrated // according to the equation // // ui_t + uj ui_j = S_ui ===> tforces = rho S_ui // // and scalars psi where (psi = rho q) as // // psi_t + (uj psi)_j = S_psi ===> tforces = S_psi = rho S_q // // q is a concentration. This function returns a rho weighted // source term, which requires a division by rho in the predict_velocity // and velocity_advection routines. // void NavierStokes::getForce (FArrayBox& force, int gridno, int ngrow, int scomp, int ncomp, const FArrayBox& Rho) { BL_ASSERT(Rho.nComp() == 1); force.resize(BoxLib::grow(grids[gridno],ngrow),ncomp); BL_ASSERT(Rho.box().contains(force.box())); const Real grav = gravity; for (int dc = 0; dc < ncomp; dc++) { const int sc = scomp + dc; #if (BL_SPACEDIM == 2) if (sc == Yvel && std::abs(grav) > 0.001) #endif #if (BL_SPACEDIM == 3) if (sc == Zvel && std::abs(grav) > 0.001) #endif { // // Set force to -rho*g. // force.copy(Rho,0,dc,1); force.mult(-grav,dc,1); } else { force.setVal(0,dc); } } } void NavierStokes::getGradP (MultiFab& gp, Real time) { const int NGrow = gp.nGrow(); MultiFab& P_old = get_old_data(Press_Type); const Real* dx = geom.CellSize(); if (level > 0 && state[Press_Type].descriptor()->timeType() == StateDescriptor::Point) { // // We want to be sure the intersection of old and new grids is // entirely contained within gp.boxArray() // BL_ASSERT(gp.boxArray() == grids); { // // Build MultiFab whose valid region encompasses NGrow grow cells. // The valid region of the MultiFab will contain overlaps! // const BoxArray& pBA = state[Press_Type].boxArray(); BoxArray ovlpBA(pBA.size()); for (int j = 0; j < ovlpBA.size(); j++) ovlpBA.set(j,BoxLib::grow(pBA[j],NGrow)); MultiFab pMF(ovlpBA,1,0); MultiFab dpdtMF(ovlpBA,1,0); if (time == getLevel(level-1).state[Press_Type].prevTime() || time == getLevel(level-1).state[Press_Type].curTime()) { FillCoarsePatch(pMF,0,time,Press_Type,0,1); } else { Real crse_time; if (time > getLevel(level-1).state[State_Type].prevTime()) { crse_time = getLevel(level-1).state[Press_Type].curTime(); } else { crse_time = getLevel(level-1).state[Press_Type].prevTime(); } FillCoarsePatch(pMF,0,crse_time,Press_Type,0,1); FillCoarsePatch(dpdtMF,0,time,Dpdt_Type,0,1); Real dt_temp = time - crse_time; dpdtMF.mult(dt_temp); pMF.plus(dpdtMF,0,1,0); } for (MFIter mfi(pMF); mfi.isValid(); ++mfi) { Projection::getGradP(pMF[mfi],gp[mfi],gp[mfi].box(),dx); } } // // We've now got good coarse data everywhere in gp. // FillPatch temp version of gp having overlapping valid regions. // BoxArray ovlpBA(gp.boxArray().size()); for (int j = 0; j < gp.boxArray().size(); j++) ovlpBA.set(j,BoxLib::grow(gp.boxArray()[j],NGrow)); MultiFab gpTmp(ovlpBA,gp.nComp(),0); for (FillPatchIterator P_fpi(*this,P_old,NGrow,time,Press_Type,0,1); P_fpi.isValid(); ++P_fpi) { Projection::getGradP(P_fpi(),gpTmp[P_fpi],gpTmp[P_fpi].box(),dx); } // // Now must decide which parts of gpTmp to copy to gp. // BoxArray fineBA(old_intersect_new.size()); for (int j = 0; j < old_intersect_new.size(); j++) { Box bx = old_intersect_new[j]; for (int i = 0; i < BL_SPACEDIM; i++) { if (!geom.isPeriodic(i)) { if (bx.smallEnd(i) == geom.Domain().smallEnd(i)) bx.growLo(i,NGrow); if (bx.bigEnd(i) == geom.Domain().bigEnd(i)) bx.growHi(i,NGrow); } } fineBA.set(j,bx); } for (MFIter mfi(gpTmp); mfi.isValid(); ++mfi) { for (int j = 0; j < fineBA.size(); j++) { Box isect = fineBA[j] & gpTmp[mfi].box(); if (isect.ok()) { gp[mfi].copy(gpTmp[mfi],isect); } } } geom.FillPeriodicBoundary(gp,true); } else { FillPatchIterator P_fpi(*this,P_old,NGrow,time,Press_Type,0,1); for ( ; P_fpi.isValid(); ++P_fpi) { BL_ASSERT(BoxLib::grow(grids[P_fpi.index()],NGrow) == gp[P_fpi].box()); Projection::getGradP(P_fpi(),gp[P_fpi],gp[P_fpi].box(),dx); } } } // // Fill patch divU. // MultiFab* NavierStokes::getDivCond (int ngrow, Real time) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::getDivCond()"); MultiFab* divu = 0; if (!have_divu) { divu = new MultiFab(grids,1,ngrow); divu->setVal(0); } else { divu = getState(ngrow,Divu_Type,0,1,time); } return divu; } // // Fill patch dSdt. // MultiFab* NavierStokes::getDsdt (int ngrow, Real time) { MultiFab* dsdt = 0; if (!(have_dsdt && have_divu)) { dsdt = new MultiFab(grids,1,ngrow); dsdt->setVal(0); } else { dsdt = getState(ngrow,Dsdt_Type,0,1,time); } return dsdt; } // // Fill patch a state component. // MultiFab* NavierStokes::getState (int ngrow, int state_idx, int scomp, int ncomp, Real time) { BL_PROFILE(BL_PROFILE_THIS_NAME() + "::getState()"); MultiFab* mf = new MultiFab(state[state_idx].boxArray(),ncomp,ngrow); FillPatchIterator fpi(*this,*mf,ngrow,time,state_idx,scomp,ncomp); for ( ; fpi.isValid(); ++fpi) { (*mf)[fpi.index()].copy(fpi()); } return mf; } // // Fills ghost cells of state: // void NavierStokes::FillStateBndry (Real time, int state_idx, int src_comp, int ncomp) { MultiFab& S = get_data(state_idx,time); if (S.nGrow() == 0) return; FillPatchIterator fpi(*this,S,S.nGrow(),time,state_idx,src_comp,ncomp); for ( ; fpi.isValid(); ++fpi) { // // Fill all ghost cells interior & exterior to valid region. // BoxList boxes = BoxLib::boxDiff(fpi().box(),grids[fpi.index()]); for (BoxList::iterator bli = boxes.begin(); bli != boxes.end(); ++bli) { S[fpi.index()].copy(fpi(),*bli,0,*bli,src_comp,ncomp); } } } // // Default divU is set to zero. // void NavierStokes::calc_divu (Real time, Real dt, MultiFab& divu) { if (have_divu) { divu.setVal(0); if (do_temp && visc_coef[Temp] > 0.0) { // // Compute Div(U) = Div(cond.Grad(T))/(rho.T) assuming cond = k/cp. // getViscTerms(divu,Temp,1,time); const MultiFab& rhotime = get_rho(time); FillPatchIterator temp_fpi(*this,divu,0,time,State_Type,Temp,1); MFIter rho_mfi(rhotime); for ( ; rho_mfi.isValid() && temp_fpi.isValid(); ++rho_mfi, ++temp_fpi) { const int i = rho_mfi.index(); divu[i].divide(rhotime[i],divu.box(i),0,0,1); divu[i].divide(temp_fpi(),divu.box(i),0,0,1); } } } } // // Default dSdt is set to zero. // void NavierStokes::calc_dsdt (Real time, Real dt, MultiFab& dsdt) { if (have_divu && have_dsdt) { dsdt.setVal(0); if (do_temp) { MultiFab& Divu_new = get_new_data(Divu_Type); MultiFab& Divu_old = get_old_data(Divu_Type); for (MFIter mfi(dsdt); mfi.isValid(); ++mfi) { dsdt[mfi].copy(Divu_new[mfi],mfi.validbox(),0,mfi.validbox(),0,1); dsdt[mfi].minus(Divu_old[mfi],mfi.validbox(),0,0,1); dsdt[mfi].divide(dt,mfi.validbox(),0,1); } } } } void NavierStokes::getViscTerms (MultiFab& visc_terms, int src_comp, int ncomp, Real time) { // // The logic below for selecting between scalar or tensor solves does // not allow for calling NavierStokes::getViscTerms with src_comp=Yvel // or Zvel // #ifndef NDEBUG if (src_compallocFluxBoxesLevel(viscosity, 0, 1); getViscosity(viscosity, time); diffusion->getTensorViscTerms(visc_terms,time,0,viscosity); } else { for (int icomp = Xvel; icomp < BL_SPACEDIM; icomp++) { int rho_flag = Diffusion::set_rho_flag(diffusionType[icomp]); diffusion->getViscTerms(visc_terms,src_comp,icomp,time,rho_flag); } } // // Add Div(u) term if desired, if this is velocity, and if Div(u) // is nonzero. If const-visc, term is mu.Div(u)/3, else // it's -Div(mu.Div(u).I)*2/3 // if (have_divu && S_in_vel_diffusion) { MultiFab divmusi(grids,BL_SPACEDIM,1); if (variable_vel_visc) { diffusion->compute_divmusi(time,viscosity,divmusi); divmusi.mult((-2./3.),0,BL_SPACEDIM,0); } else { diffusion->compute_divmusi(time,visc_coef[Xvel],divmusi); divmusi.mult((1./3.),0,BL_SPACEDIM,0); } visc_terms.plus(divmusi,Xvel,BL_SPACEDIM,0); } // // Clean up variable viscosity arrays // if (variable_vel_visc) diffusion->removeFluxBoxesLevel(viscosity); } // // Get Scalar Diffusive Terms // const int first_scal = (src_comp==Xvel) ? BL_SPACEDIM : src_comp; const int num_scal = (src_comp==Xvel) ? ncomp-BL_SPACEDIM : ncomp; if (num_scal > 0) { for (int icomp = first_scal; icomp < first_scal+num_scal; icomp++) { if (is_diffusive[icomp]) { int rho_flag = Diffusion::set_rho_flag(diffusionType[icomp]); MultiFab** cmp_diffn = 0; if (variable_scal_diff) { diffusion->allocFluxBoxesLevel(cmp_diffn, 0, 1); getDiffusivity(cmp_diffn, time, icomp, 0, 1); } diffusion->getViscTerms(visc_terms,src_comp,icomp, time,rho_flag,0,cmp_diffn); if (variable_scal_diff) { diffusion->removeFluxBoxesLevel(cmp_diffn); } } } } // // Ensure consistent grow cells // if (nGrow > 0) { for (MFIter mfi(visc_terms); mfi.isValid(); ++mfi) { FArrayBox& vt = visc_terms[mfi]; const Box& box = mfi.validbox(); FORT_VISCEXTRAP(vt.dataPtr(),ARLIM(vt.loVect()),ARLIM(vt.hiVect()), box.loVect(),box.hiVect(),&ncomp); } visc_terms.FillBoundary(0,ncomp); // // Note: this is a special periodic fill in that we want to // preserve the extrapolated grow values when periodic -- // usually we preserve only valid data. The scheme relies on // the fact that there is good data in the "non-periodic" grow cells. // ("good" data produced via VISCEXTRAP above) // geom.FillPeriodicBoundary(visc_terms,0,ncomp,true); } } // // Functions for calculating the variable viscosity and diffusivity. // These default to setting the variable viscosity and diffusivity arrays // to the values in visc_coef and diff_coef. These functions would // need to be replaced in any class derived from NavierStokes that // wants variable coefficients. // void NavierStokes::calcViscosity (const Real time, const Real dt, const int iteration, const int ncycle) { const MultiFab& S = get_data(State_Type, time); // // Select time level to work with (N or N+1) // MultiFab* visc_cc; const TimeLevel whichTime = which_time(State_Type,time); BL_ASSERT(whichTime == AmrOldTime || whichTime == AmrNewTime); if (whichTime == AmrOldTime) // time N { visc_cc = viscn_cc; } else if (whichTime == AmrNewTime) // time N+1 { visc_cc = viscnp1_cc; } // // Calculate viscosity // const int nGrow = visc_cc->nGrow(); if (is_diffusive[Xvel]) { if (visc_coef[Xvel] >= 0.0) { visc_cc->setVal(visc_coef[Xvel], 0, 1, nGrow); } else { BoxLib::Abort("NavierStokes::calcViscosity() : must have velocity visc_coef >= 0.0"); } } } void NavierStokes::calcDiffusivity (const Real time, const Real dt, const int iteration, const int ncycle, const int src_comp, const int ncomp) { // // NOTE: The component numbers passed into NavierStokes::calcDiffusivity // correspond to the components in the state. In the diffusivity // arrays, there is an offset since no diffusivity array // is kept for the velocities or the density. So, the scalar // component Density+1 in the state corresponds to component // 0 in the arrays diffn and diffnp1. // BL_ASSERT(src_comp > Density); const MultiFab& S = get_data(State_Type, time); // // Select time level to work with (N or N+1) // MultiFab* diff_cc; const TimeLevel whichTime = which_time(State_Type,time); BL_ASSERT(whichTime == AmrOldTime || whichTime == AmrNewTime); if (whichTime == AmrOldTime) // time N { diff_cc = diffn_cc; } else if (whichTime == AmrNewTime) // time N+1 { diff_cc = diffnp1_cc; } // // Calculate diffusivity // const int nGrow = diff_cc->nGrow(); for (int comp=src_comp; comp= 0.0) { diff_cc->setVal(visc_coef[comp], diff_comp, 1, nGrow); } else { BoxLib::Abort("NavierStokes::calcDiffusivity() : must have scalar diff_coefs >= 0.0"); } } } } void NavierStokes::getViscosity (MultiFab* viscosity[BL_SPACEDIM], const Real time) { // // Select time level to work with (N or N+1) // MultiFab* visc_cc; const TimeLevel whichTime = which_time(State_Type,time); BL_ASSERT(whichTime == AmrOldTime || whichTime == AmrNewTime); if (whichTime == AmrOldTime) // time N { visc_cc = viscn_cc; } else if (whichTime == AmrNewTime) // time N+1 { visc_cc = viscnp1_cc; } // // Fill edge-centered viscosity // for (int dir = 0; dir < BL_SPACEDIM; dir++) { for (MFIter ecMfi(*viscosity[dir]); ecMfi.isValid(); ++ecMfi) { const int i = ecMfi.index(); center_to_edge_plain((*visc_cc)[i],(*viscosity[dir])[i],0,0,1); } } } void NavierStokes::getDiffusivity (MultiFab* diffusivity[BL_SPACEDIM], const Real time, const int state_comp, const int dst_comp, const int ncomp) { BL_ASSERT(state_comp > Density); // // Pick correct diffusivity component // int diff_comp = state_comp - Density - 1; // // Select time level to work with (N or N+1) // MultiFab* diff_cc; const TimeLevel whichTime = which_time(State_Type,time); BL_ASSERT(whichTime == AmrOldTime || whichTime == AmrNewTime); if (whichTime == AmrOldTime) // time N { diff_cc = diffn_cc; } else if (whichTime == AmrNewTime) // time N+1 { diff_cc = diffnp1_cc; } // // Fill edge-centered diffusivities // for (int dir = 0; dir < BL_SPACEDIM; dir++) { for (MFIter ecMfi(*diffusivity[dir]); ecMfi.isValid(); ++ecMfi) { center_to_edge_plain((*diff_cc)[ecMfi],(*diffusivity[dir])[ecMfi], diff_comp,dst_comp,ncomp); } } } void NavierStokes::center_to_edge_plain (const FArrayBox& ccfab, FArrayBox& ecfab, int sComp, int dComp, int nComp) { // // This routine fills an edge-centered FAB from a cell-centered FAB. // It assumes that the data in all cells of the cell-centered FAB is // valid and totally ignores any concept of boundary conditions. // It is assummed that the cell-centered FAB fully contains the // edge-centered FAB. If anything special needs to be done at boundaries, // a varient of this routine needs to be written. See // HeatTransfer::center_to_edge_fancy(). // const Box& ccbox = ccfab.box(); const Box& ecbox = ecfab.box(); const IndexType ixt = ecbox.ixType(); // // Get direction for interpolation to edges // int dir = -1; for (int d = 0; d < BL_SPACEDIM; d++) if (ixt.test(d)) dir = d; // // Miscellanious checks // BL_ASSERT(!(ixt.cellCentered()) && !(ixt.nodeCentered())); BL_ASSERT(BoxLib::grow(ccbox,-BoxLib::BASISV(dir)).contains(BoxLib::enclosedCells(ecbox))); BL_ASSERT(sComp+nComp <= ccfab.nComp() && dComp+nComp <= ecfab.nComp()); // // Shift cell-centered data to edges // Box fillBox = ccbox; for (int d = 0; d < BL_SPACEDIM; d++) if (d != dir) fillBox.setRange(d, ecbox.smallEnd(d), ecbox.length(d)); const int isharm = def_harm_avg_cen2edge; FORT_CEN2EDG(fillBox.loVect(), fillBox.hiVect(), ARLIM(ccfab.loVect()), ARLIM(ccfab.hiVect()), ccfab.dataPtr(sComp), ARLIM(ecfab.loVect()), ARLIM(ecfab.hiVect()), ecfab.dataPtr(dComp), &nComp, &dir, &isharm); } // // Note: this is a temporary function. Eventually this will be moved to a // boundary condition class. // static void getOutFlowFaces (Array& outFaces, BCRec* _phys_bc) { outFaces.resize(0); for (int idir = 0; idir < BL_SPACEDIM; idir++) { if (_phys_bc->lo(idir) == Outflow) { const int len = outFaces.size(); outFaces.resize(len+1); outFaces.set(len,Orientation(idir,Orientation::low)); } if (_phys_bc->hi(idir) == Outflow) { const int len = outFaces.size(); outFaces.resize(len+1); outFaces.set(len,Orientation(idir,Orientation::high)); } } } void NavierStokes::manual_tags_placement (TagBoxArray& tags, Array& bf_lev) { Array outFaces; getOutFlowFaces(outFaces,&phys_bc); if (outFaces.size()>0) { for (int i=0; i 0) hasTags = true; if (hasTags) tags.setVal(BoxArray(&outflowBox,1),TagBox::SET); } else if (do_derefine_outflow) { const int np = parent->nProper(); // // Calculate the number of level 0 cells to be left uncovered // at the outflow. The convoluted logic allows for the fact that // the number of uncovered cells must be a multiple of the level // blocking factor. So, when calculating the number of coarse // cells below, we always round the division up. // int N_coarse_cells = Nbuf_outflow / bf_lev[0][oDir]; if (Nbuf_outflow % bf_lev[0][oDir] != 0) N_coarse_cells++; int N_level_cells = N_coarse_cells * bf_lev[0][oDir]; // // Adjust this to get the number of cells to be left uncovered at // levels higher than 0 // for (int i = 1; i <= level; ++i) { /*** Calculate the minimum cells at this level ***/ const int rat = (parent->refRatio(i-1))[oDir]; N_level_cells = N_level_cells * rat + np; /*** Calculate the required number of coarse cells ***/ N_coarse_cells = N_level_cells / bf_lev[i][oDir]; if (N_level_cells % bf_lev[i][oDir] != 0) N_coarse_cells++; /*** Calculate the corresponding number of level cells ***/ N_level_cells = N_coarse_cells * bf_lev[i][oDir]; } // // Untag the cells near the outflow // if (N_coarse_cells > 0) { // // Generate box at the outflow and grow it in all directions // other than the outflow. This forces outflow cells in the // ghostcells in directions other that oDir to be cleared. // Box outflowBox = BoxLib::adjCell(crse_domain, outFace, 1); for (int dir = 0; dir < BL_SPACEDIM; dir++) if (dir != oDir) outflowBox.grow(dir, 1); // // Now, grow the box into the domain (opposite direction as // outFace) the number of cells we need to clear. // if (outFace.isLow()) outflowBox.growHi(oDir, N_coarse_cells); else outflowBox.growLo(oDir, N_coarse_cells); tags.setVal(BoxArray(&outflowBox,1),TagBox::CLEAR); } } } } } void NavierStokes::calcDpdt () { BL_ASSERT(state[Press_Type].descriptor()->timeType() == StateDescriptor::Point); MultiFab& new_press = get_new_data(Press_Type); MultiFab& old_press = get_old_data(Press_Type); MultiFab& dpdt = get_new_data(Dpdt_Type); const Real dt_for_dpdt = state[Press_Type].curTime()-state[Press_Type].prevTime(); if (dt_for_dpdt != 0.0) { for (MFIter mfi(dpdt); mfi.isValid(); ++mfi) { dpdt[mfi].copy(new_press[mfi],mfi.validbox(),0,mfi.validbox(),0,1); dpdt[mfi].minus(old_press[mfi],mfi.validbox(),0,0,1); dpdt[mfi].divide(dt_for_dpdt,mfi.validbox(),0,1); } } else { dpdt.setVal(0); } } void NavierStokes::create_umac_grown () { for (int n = 0; n < BL_SPACEDIM; ++n) { u_macG[n].copy(u_mac[n]); u_macG[n].FillBoundary(0,1); geom.FillPeriodicBoundary(u_macG[n],0,1); } if (level > 0) { BoxArray f_bnd_ba = GetBndryCells(grids,1,geom); BoxArray c_bnd_ba = BoxArray(f_bnd_ba.size()); for (int i = 0; i < f_bnd_ba.size(); ++i) { c_bnd_ba.set(i,Box(f_bnd_ba[i]).coarsen(crse_ratio)); f_bnd_ba.set(i,Box(c_bnd_ba[i]).refine(crse_ratio)); } const BoxArray& cgrids = getLevel(level-1).boxArray(); for (int n = 0; n < BL_SPACEDIM; ++n) { MultiFab crseT(BoxArray(cgrids).surroundingNodes(n),1,0); crseT.setVal(1.e200); for (MFIter mfi(crseT); mfi.isValid(); ++mfi) crseT[mfi].copy(getLevel(level-1).u_mac[n][mfi]); crseT.FillBoundary(0,1); getLevel(level-1).geom.FillPeriodicBoundary(crseT,0,1); MultiFab crse_src(BoxArray(c_bnd_ba).surroundingNodes(n),1,0); crse_src.setVal(1.e200); crse_src.copy(crseT); crse_src.FillBoundary(0,1); getLevel(level-1).geom.FillPeriodicBoundary(crse_src,0,1); MultiFab fine_src(BoxArray(f_bnd_ba).surroundingNodes(n),1,0); for (MFIter mfi(crse_src); mfi.isValid(); ++mfi) { const int nComp = 1; const Box box = Box(c_bnd_ba[mfi.index()]).surroundingNodes(n); const int* rat = crse_ratio.getVect(); FORT_PC_CF_EDGE_INTERP(box.loVect(), box.hiVect(), &nComp, rat, &n, crse_src[mfi].dataPtr(), ARLIM(crse_src[mfi].loVect()), ARLIM(crse_src[mfi].hiVect()), fine_src[mfi].dataPtr(), ARLIM(fine_src[mfi].loVect()), ARLIM(fine_src[mfi].hiVect())); } // // Replace pc-interpd fine data with preferred u_mac data at // this level u_mac valid only on surrounding faces of valid // region - this op will not fill grow region. // fine_src.copy(u_mac[n]); for (MFIter mfi(fine_src); mfi.isValid(); ++mfi) { // // Interpolate unfilled grow cells using best data from // surrounding faces of valid region, and pc-interpd data // on fine edges overlaying coarse edges. // const int nComp = 1; const Box& fbox = fine_src[mfi.index()].box(); const int* rat = crse_ratio.getVect(); FORT_EDGE_INTERP(fbox.loVect(), fbox.hiVect(), &nComp, rat, &n, fine_src[mfi].dataPtr(), ARLIM(fine_src[mfi].loVect()), ARLIM(fine_src[mfi].hiVect())); } u_macG[n].copy(fine_src); u_macG[n].copy(u_mac[n]); u_macG[n].FillBoundary(0,1); geom.FillPeriodicBoundary(u_macG[n],0,1); } } } ccseapps-2.5/CCSEApps/iamrlib/MACOPERATOR_F.H0000644000175000017500000001301311634153073021426 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MACOPERATOR_F_H_ #define _MACOPERATOR_F_H_ /* ** $Id: MACOPERATOR_F.H,v 1.9 2003/02/05 22:11:42 almgren Exp $ */ #ifdef BL_LANG_FORT # define FORT_MACCOEF maccoef # define FORT_MACRHS macrhs # define FORT_MACUPDATE macupdate # define FORT_MACSYNCRHS macsyncrhs #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_MACCOEF MACCOEF # define FORT_MACRHS MACRHS # define FORT_MACUPDATE MACUPDATE # define FORT_MACSYNCRHS MACSYNCRHS # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_MACCOEF maccoef # define FORT_MACRHS macrhs # define FORT_MACUPDATE macupdate # define FORT_MACSYNCRHS macsyncrhs # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_MACCOEF maccoef_ # define FORT_MACRHS macrhs_ # define FORT_MACUPDATE macupdate_ # define FORT_MACSYNCRHS macsyncrhs_ #endif #include extern "C" { #if (BL_SPACEDIM == 2) void FORT_MACCOEF (Real* cx, ARLIM_P(cxlo), ARLIM_P(cxhi), Real* cy, ARLIM_P(cylo), ARLIM_P(cyhi), const Real* ax, ARLIM_P(axlo), ARLIM_P(axhi), const Real* ay, ARLIM_P(aylo), ARLIM_P(ayhi), const Real* rho, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const Real* dx); void FORT_MACRHS (const Real* ux, ARLIM_P(uxlo), ARLIM_P(uxhi), const Real* uy, ARLIM_P(uylo), ARLIM_P(uyhi), const Real* ax, ARLIM_P(axlo), ARLIM_P(axhi), const Real* ay, ARLIM_P(aylo), ARLIM_P(ayhi), const Real* vol, ARLIM_P(vlo), ARLIM_P(vhi), Real* rhs, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const Real* scale); void FORT_MACUPDATE (const int *init, Real* ux, ARLIM_P(uxlo), ARLIM_P(uxhi), Real* uy, ARLIM_P(uylo), ARLIM_P(uyhi), const Real* phi, ARLIM_P(p_lo), ARLIM_P(p_hi), const Real* rho, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const Real* dx, const Real* scale); #endif #if (BL_SPACEDIM == 3) void FORT_MACCOEF (Real* cx, ARLIM_P(cxlo), ARLIM_P(cxhi), Real* cy, ARLIM_P(cylo), ARLIM_P(cyhi), Real* cz, ARLIM_P(czlo), ARLIM_P(czhi), const Real* ax, ARLIM_P(axlo), ARLIM_P(axhi), const Real* ay, ARLIM_P(aylo), ARLIM_P(ayhi), const Real* az, ARLIM_P(azlo), ARLIM_P(azhi), const Real* rho, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const Real* dx); void FORT_MACRHS (const Real* ux, ARLIM_P(uxlo), ARLIM_P(uxhi), const Real* uy, ARLIM_P(uylo), ARLIM_P(uyhi), const Real* uz, ARLIM_P(uzlo), ARLIM_P(uzhi), const Real* ax, ARLIM_P(axlo), ARLIM_P(axhi), const Real* ay, ARLIM_P(aylo), ARLIM_P(ayhi), const Real* az, ARLIM_P(azlo), ARLIM_P(azhi), const Real* vol, ARLIM_P(vlo), ARLIM_P(vhi), Real* rhs, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const Real* scale); void FORT_MACUPDATE (const int *init, Real* ux, ARLIM_P(uxlo), ARLIM_P(uxhi), Real* uy, ARLIM_P(uylo), ARLIM_P(uyhi), Real* uz, ARLIM_P(uzlo), ARLIM_P(uzhi), const Real* phi, ARLIM_P(p_lo), ARLIM_P(p_hi), const Real* rho, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const Real* dx, const Real* scale); #endif void FORT_MACSYNCRHS (Real* rhs, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const Real* vol, ARLIM_P(vlo), ARLIM_P(vhi), const Real* rhs_scale); } #endif #endif /*_MACOPERATOR_F_H_*/ ccseapps-2.5/CCSEApps/iamrlib/GODUNOV_3D.F0000644000175000017500000031666011634153073021070 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: GODUNOV_3D.F,v 1.28 2003/02/18 21:46:35 almgren Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "GODUNOV_F.H" #include "ArrayLim.H" #define SDIM 3 #define XVEL 1 #define YVEL 2 #define ZVEL 3 #define RHO 4 #define ALL 999 subroutine FORT_ESTDT ( & vel,DIMS(vel), & tforces,DIMS(tf), & rho,DIMS(rho), & lo,hi,dt,dx,cfl,u_max) c c ---------------------------------------------------------- c estimate the timestep for this grid and scale by CFL number c This routine sets dt as dt = dt_est*cfl where c dt_est is estimated from the actual velocities and their c total forcing c ---------------------------------------------------------- c integer i, j, k REAL_T u, v, w REAL_T small REAL_T dt_start REAL_T tforce1,tforce2,tforce3 integer lo(SDIM), hi(SDIM) REAL_T dt,dx(SDIM),cfl,u_max(SDIM) integer DIMDEC(vel) integer DIMDEC(rho) integer DIMDEC(tf) REAL_T vel(DIMV(vel),SDIM) REAL_T rho(DIMV(rho)) REAL_T tforces(DIMV(tf),SDIM) small = 1.0D-8 u = zero v = zero w = zero tforce1 = zero tforce2 = zero tforce3 = zero do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) u = max(u,abs(vel(i,j,k,1))) v = max(v,abs(vel(i,j,k,2))) w = max(w,abs(vel(i,j,k,3))) c tforce1 = max(tforce1,abs(tforces(i,j,k,1)/rho(i,j,k))) c tforce2 = max(tforce2,abs(tforces(i,j,k,2)/rho(i,j,k))) c tforce3 = max(tforce3,abs(tforces(i,j,k,3)/rho(i,j,k))) end do end do end do u_max(1) = u u_max(2) = v u_max(3) = w dt_start = 1.0D+20 dt = dt_start if (u .gt. small) dt = min(dt,dx(1)/u) if (v .gt. small) dt = min(dt,dx(2)/v) if (w .gt. small) dt = min(dt,dx(3)/w) if (tforce1 .gt. small) then dt = min(dt,sqrt(two*dx(1)/tforce1)) end if if (tforce2 .gt. small) then dt = min(dt,sqrt(two*dx(2)/tforce2)) end if if (tforce3 .gt. small) then dt = min(dt,sqrt(two*dx(3)/tforce3)) end if if (dt .eq. dt_start) dt = min(dx(1),dx(2),dx(3)) dt = dt*cfl end subroutine FORT_TEST_U_RHO( & u,DIMS(u), & v,DIMS(v), & w,DIMS(w), & rho,DIMS(rho), & lo,hi,dt,dx,cflmax,u_max,verbose) c c This subroutine computes the extrema of the density c and velocities at cell centers c integer DIMDEC(u) integer DIMDEC(v) integer DIMDEC(w) integer DIMDEC(rho) integer imin, imax, jmin, jmax, kmin, kmax integer i, j, k integer lo(SDIM),hi(SDIM) REAL_T dx(SDIM), u_max(SDIM),cflmax, dt REAL_T hx, hy, hz REAL_T umax, vmax, wmax, rhomax REAL_T umin, vmin, wmin, rhomin REAL_T u(DIMV(u)) REAL_T v(DIMV(v)) REAL_T w(DIMV(w)) REAL_T rho(DIMV(rho)) integer verbose hx = dx(1) hy = dx(2) hz = dx(3) imin = lo(1) imax = hi(1) jmin = lo(2) jmax = hi(2) kmin = lo(3) kmax = hi(3) umax = -1.d200 vmax = -1.d200 wmax = -1.d200 umin = 1.d200 vmin = 1.d200 wmin = 1.d200 rhomax = -1.d200 rhomin = 1.d200 do k = kmin, kmax do j = jmin, jmax do i = imin, imax umax = max(umax,u(i,j,k)) umin = min(umin,u(i,j,k)) vmax = max(vmax,v(i,j,k)) vmin = min(vmin,v(i,j,k)) wmax = max(wmax,w(i,j,k)) wmin = min(wmin,w(i,j,k)) rhomax = max(rhomax,rho(i,j,k)) rhomin = min(rhomin,rho(i,j,k)) end do end do end do u_max(1) = max(abs(umax), abs(umin)) u_max(2) = max(abs(vmax), abs(vmin)) u_max(3) = max(abs(wmax), abs(wmin)) cflmax = dt*max(u_max(1)/hx,u_max(2)/hy,u_max(3)/hz) if(verbose.eq.1)then write(6,1000) umax,umin,u_max(1) write(6,1001) vmax,vmin,u_max(2) write(6,1002) wmax,wmin,u_max(3) write(6,1003) rhomax,rhomin #ifndef BL_NO_FORT_FLUSH c call flush(6) #endif end if 1000 format(' U MAX/MIN/AMAX ',e21.14,2x,e21.14,2x,e21.14) 1001 format(' V MAX/MIN/AMAX ',e21.14,2x,e21.14,2x,e21.14) 1002 format(' W MAX/MIN/AMAX ',e21.14,2x,e21.14,2x,e21.14) 1003 format('RHO MAX/MIN ',e21.14,2x,e21.14) end subroutine FORT_TEST_UMAC_RHO( & umac,DIMS(umac), & vmac,DIMS(vmac), & wmac,DIMS(wmac), & rho,DIMS(rho), & lo,hi,dt,dx,cflmax,u_max) c c This subroutine computes the extrema of the density c and mac edge velocities c integer lo(SDIM),hi(SDIM) REAL_T dt, dx(SDIM), u_max(SDIM), cflmax integer imin, imax, jmin, jmax, kmin, kmax integer i, j, k REAL_T hx, hy, hz REAL_T umax, vmax, wmax, rhomax REAL_T umin, vmin, wmin, rhomin integer DIMDEC(umac) integer DIMDEC(vmac) integer DIMDEC(wmac) integer DIMDEC(rho) REAL_T umac(DIMV(umac)) REAL_T vmac(DIMV(vmac)) REAL_T wmac(DIMV(wmac)) REAL_T rho(DIMV(rho)) hx = dx(1) hy = dx(2) hz = dx(3) imin = lo(1) imax = hi(1) jmin = lo(2) jmax = hi(2) kmin = lo(3) kmax = hi(3) umax = -1.d200 vmax = -1.d200 wmax = -1.d200 umin = 1.d200 vmin = 1.d200 wmin = 1.d200 rhomax = -1.d200 rhomin = 1.d200 do k = kmin, kmax do j = jmin, jmax do i = imin, imax+1 umax = max(umax,umac(i,j,k)) umin = min(umin,umac(i,j,k)) end do end do end do do k = kmin, kmax do j = jmin, jmax+1 do i = imin, imax vmax = max(vmax,vmac(i,j,k)) vmin = min(vmin,vmac(i,j,k)) end do end do end do do k = kmin, kmax+1 do j = jmin, jmax do i = imin, imax wmax = max(wmax,wmac(i,j,k)) wmin = min(wmin,wmac(i,j,k)) end do end do end do do k = kmin, kmax do j = jmin, jmax do i = imin, imax rhomax = max(rhomax,rho(i,j,k)) rhomin = min(rhomin,rho(i,j,k)) end do end do end do u_max(1) = max(abs(umax), abs(umin)) u_max(2) = max(abs(vmax), abs(vmin)) u_max(3) = max(abs(wmax), abs(wmin)) cflmax = dt*max(u_max(1)/hx,u_max(2)/hy,u_max(3)/hz) write(6,1000) umax,umin,u_max(1) write(6,1001) vmax,vmin,u_max(2) write(6,1002) wmax,wmin,u_max(3) write(6,1003) rhomax,rhomin 1000 format('UMAC MAX/MIN/AMAX ',e21.14,2x,e21.14,2x,e21.14) 1001 format('VMAC MAX/MIN/AMAX ',e21.14,2x,e21.14,2x,e21.14) 1002 format('WMAC MAX/MIN/AMAX ',e21.14,2x,e21.14,2x,e21.14) 1003 format('RHO MAX/MIN ',e21.14,2x,e21.14) #ifndef BL_NO_FORT_FLUSH c call flush(6) #endif end subroutine FORT_TRANSVEL( & u, ulo, uhi, sx, ubc, slxscr, & v, vlo, vhi, sy, vbc, slyscr, & w, wlo, whi, sz, wbc, slzscr, & DIMS(s), DIMS(work), & lo,hi,dt,dx,use_minion,tforces) c c This subroutine computes the advective velocities used in c the transverse derivatives of the Godunov box c implicit none integer i,j,k integer ubc(SDIM,2),vbc(SDIM,2),wbc(SDIM,2) integer lo(SDIM),hi(SDIM) integer imin,jmin,kmin,imax,jmax,kmax REAL_T hx, hy, hz, dth, dthx, dthy, dthz REAL_T dt, dx(SDIM) REAL_T eps, eps_for_bc, val, tst logical ltm parameter (eps = 1.d-6 ) parameter (eps_for_bc = 1.d-10) integer DIMDEC(s) integer DIMDEC(work) REAL_T u(DIMV(s)) REAL_T v(DIMV(s)) REAL_T w(DIMV(s)) REAL_T ulo(DIMV(work)),uhi(DIMV(work)) REAL_T vlo(DIMV(work)),vhi(DIMV(work)) REAL_T wlo(DIMV(work)),whi(DIMV(work)) REAL_T sx(DIMV(work)) REAL_T sy(DIMV(work)) REAL_T sz(DIMV(work)) REAL_T slxscr(DIM1(s), 4) REAL_T slyscr(DIM2(s), 4) REAL_T slzscr(DIM3(s), 4) integer use_minion REAL_T tforces(DIMV(work),SDIM) dth = half*dt dthx = half*dt / dx(1) dthy = half*dt / dx(2) dthz = half*dt / dx(3) hx = dx(1) hy = dx(2) hz = dx(3) imin = lo(1) jmin = lo(2) kmin = lo(3) imax = hi(1) jmax = hi(2) kmax = hi(3) c c =============== THE SCREWY ORDER is to maximize comparability c with the old fortran c -------------------------------------------------------------- c compute the x transverse velocities c -------------------------------------------------------------- c -------------------------------------------------------------- c compute the y transverse velocities c -------------------------------------------------------------- c -------------------------------------------------------------- c compute the z transverse velocities c -------------------------------------------------------------- c call FORT_SLOPES( XVEL, & u,DIMS(s), & sx,sy,sz,DIMS(work), & lo,hi,slxscr,slyscr,slzscr,ubc) do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin, imax+1 ulo(i,j,k) = u(i-1,j,k) + (half - dthx*u(i-1,j,k))*sx(i-1,j,k) uhi(i,j,k) = u(i, j,k) + (-half - dthx*u(i, j,k))*sx(i, j,k) end do end do end do if (use_minion .eq. 1 )then do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin, imax+1 ulo(i,j,k) = ulo(i,j,k) + dth*tforces(i-1,j,k,1) uhi(i,j,k) = uhi(i,j,k) + dth*tforces(i, j,k,1) end do end do end do end if call FORT_SLOPES(YVEL, & v,DIMS(s), & sx,sy,sz,DIMS(work), & lo,hi,slxscr,slyscr,slzscr,vbc) do k = kmin-1,kmax+1 do j = jmin, jmax+1 do i = imin-1,imax+1 vlo(i,j,k) = v(i,j-1,k) + (half - dthy*v(i,j-1,k))*sy(i,j-1,k) vhi(i,j,k) = v(i,j, k) + (-half - dthy*v(i,j, k))*sy(i,j, k) end do end do end do if (use_minion .eq. 1 )then do k = kmin-1,kmax+1 do j = jmin, jmax+1 do i = imin-1, imax+1 vlo(i,j,k) = vlo(i,j,k) + dth*tforces(i,j-1,k,2) vhi(i,j,k) = vhi(i,j,k) + dth*tforces(i,j, k,2) end do end do end do end if call FORT_SLOPES(ZVEL, & w,DIMS(s), & sx,sy,sz,DIMS(work), & lo,hi,slxscr,slyscr,slzscr,wbc) do k = kmin,kmax+1 do j = jmin-1,jmax+1 do i = imin-1,imax+1 wlo(i,j,k) = w(i,j,k-1) + (half - dthz*w(i,j,k-1))*sz(i,j,k-1) whi(i,j,k) = w(i,j,k ) + (-half - dthz*w(i,j,k ))*sz(i,j,k ) end do end do end do if (use_minion .eq. 1 )then do k = kmin,kmax+1 do j = jmin-1,jmax+1 do i = imin-1, imax+1 wlo(i,j,k) = wlo(i,j,k) + dth*tforces(i,j,k-1,3) whi(i,j,k) = whi(i,j,k) + dth*tforces(i,j,k, 3) end do end do end do end if call trans_xbc( & u,DIMS(s), & ulo,uhi,DIMS(work),ulo,DIMS(work), & lo,hi,XVEL,ubc,eps_for_bc) call trans_ybc( & v,DIMS(s), & vlo,vhi,DIMS(work),vlo,DIMS(work), & lo,hi,YVEL,vbc,eps_for_bc) call trans_zbc( & w,DIMS(s), & wlo,whi,DIMS(work),wlo,DIMS(work), & lo,hi,ZVEL,wbc,eps_for_bc) do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin, imax+1 tst = ulo(i,j,k)+uhi(i,j,k) val = cvmgp(ulo(i,j,k),uhi(i,j,k),tst) ltm = & ( (ulo(i,j,k) .le. zero) .and. & (uhi(i,j,k) .ge. zero) ) .or. & (abs(tst) .lt. eps ) ulo(i,j,k) = cvmgt(zero,val,ltm) end do end do end do do k = kmin-1,kmax+1 do j = jmin, jmax+1 do i = imin-1,imax+1 tst = vlo(i,j,k)+vhi(i,j,k) val = cvmgp(vlo(i,j,k),vhi(i,j,k),tst) ltm = & ( (vlo(i,j,k) .le. zero) .and. & (vhi(i,j,k) .ge. zero) ) .or. & (abs(tst) .lt. eps ) vlo(i,j,k) = cvmgt(zero,val,ltm) end do end do end do do k = kmin,kmax+1 do j = jmin-1,jmax+1 do i = imin-1,imax+1 tst = wlo(i,j,k)+whi(i,j,k) val = cvmgp(wlo(i,j,k),whi(i,j,k),tst) ltm = & ( (wlo(i,j,k) .le. zero) .and. & (whi(i,j,k) .ge. zero) ) .or. & (abs(tst) .lt. eps ) wlo(i,j,k) = cvmgt(zero,val,ltm) end do end do end do end subroutine FORT_ESTATE(s, tforces, DIMS(s), & u, xlo, xhi, sx, uad, slxscr, stxlo, stxhi, & uedge, DIMS(uedge), xstate, DIMS(xstate), & v, ylo, yhi, sy, vad, slyscr, stylo, styhi, & vedge, DIMS(vedge), ystate, DIMS(ystate), & w, zlo, zhi, sz, wad, slzscr, stzlo, stzhi, & wedge, DIMS(wedge), zstate, DIMS(zstate), & DIMS(work), & bc,lo,hi,dt,dx,n,velpred, use_minion) c c This subroutine computes edges states, right now it uses c a lot of memory, but there becomes a trade off between c simplicity-efficiency in the new way of computing states c and complexity in the old way. By eliminating loops over c state components though, the new way uses much less memory. c integer i,j,k,n,velpred integer lo(SDIM),hi(SDIM),bc(SDIM,2) integer imin,jmin,kmin,imax,jmax,kmax,inc REAL_T place_to_break REAL_T hx, hy, hz, dt, dth, dthx, dthy, dthz REAL_T tr1,tr2,ubar,vbar,wbar,stx,sty,stz,fu,fv,fw,dx(SDIM) REAL_T eps,eps_for_bc logical ltx,lty,ltz parameter (eps = 1.d-6 ) parameter (eps_for_bc = 1.d-10) integer DIMDEC(s) integer DIMDEC(work) integer DIMDEC(uedge) integer DIMDEC(vedge) integer DIMDEC(wedge) integer DIMDEC(xstate) integer DIMDEC(ystate) integer DIMDEC(zstate) REAL_T s(DIMV(s)) REAL_T u(DIMV(s)) REAL_T v(DIMV(s)) REAL_T w(DIMV(s)) REAL_T stxlo(DIM1(s)),stxhi(DIM1(s)),slxscr(DIM1(s),4) REAL_T stylo(DIM2(s)),styhi(DIM2(s)),slyscr(DIM2(s),4) REAL_T stzlo(DIM3(s)),stzhi(DIM3(s)),slzscr(DIM3(s),4) REAL_T uedge(DIMV(uedge)), xstate(DIMV(uedge)) REAL_T vedge(DIMV(vedge)), ystate(DIMV(vedge)) REAL_T wedge(DIMV(wedge)), zstate(DIMV(wedge)) REAL_T xlo(DIMV(work)), xhi(DIMV(work)) REAL_T ylo(DIMV(work)), yhi(DIMV(work)) REAL_T zlo(DIMV(work)), zhi(DIMV(work)) REAL_T sx(DIMV(work)), uad(DIMV(work)) REAL_T sy(DIMV(work)), vad(DIMV(work)) REAL_T sz(DIMV(work)), wad(DIMV(work)) REAL_T tforces(DIMV(work)) integer use_minion dth = half*dt dthx = half*dt / dx(1) dthy = half*dt / dx(2) dthz = half*dt / dx(3) hx = dx(1) hy = dx(2) hz = dx(3) imin = lo(1) jmin = lo(2) kmin = lo(3) imax = hi(1) jmax = hi(2) kmax = hi(3) c c compute the slopes c call FORT_SLOPES(ALL, & s,DIMS(s), & sx,sy,sz,DIMS(work), & lo,hi,slxscr,slyscr,slzscr,bc) c c trace the state to the cell edges c do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin, imax+1 xlo(i,j,k) = s(i-1,j,k) + (half - dthx*u(i-1,j,k))*sx(i-1,j,k) xhi(i,j,k) = s(i, j,k) + (-half - dthx*u(i, j,k))*sx(i, j,k) end do end do end do if(use_minion.eq.1)then do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin, imax+1 xlo(i,j,k) = xlo(i,j,k) + dth*tforces(i-1,j,k) xhi(i,j,k) = xhi(i,j,k) + dth*tforces(i, j,k) end do end do end do end if call trans_xbc( & s,DIMS(s), & xlo,xhi,DIMS(work),uad,DIMS(work), & lo,hi,n,bc,eps_for_bc) do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin, imax+1 fu = cvmgt(zero,one,abs(uad(i,j,k)).lt.eps) stx = cvmgp(xlo(i,j,k),xhi(i,j,k),uad(i,j,k)) xlo(i,j,k) = fu*stx + (one - fu)*half*(xhi(i,j,k)+xlo(i,j,k)) end do end do end do do k = kmin-1,kmax+1 do j = jmin, jmax+1 do i = imin-1,imax+1 ylo(i,j,k) = s(i,j-1,k) + (half - dthy*v(i,j-1,k))*sy(i,j-1,k) yhi(i,j,k) = s(i,j, k) + (-half - dthy*v(i,j, k))*sy(i,j, k) end do end do end do if (use_minion.eq.1)then do k = kmin-1,kmax+1 do j = jmin, jmax+1 do i = imin-1, imax+1 ylo(i,j,k) = ylo(i,j,k) + dth*tforces(i,j-1,k) yhi(i,j,k) = yhi(i,j,k) + dth*tforces(i,j, k) end do end do end do end if call trans_ybc( & s,DIMS(s), & ylo,yhi,DIMS(work),vad,DIMS(work), & lo,hi,n,bc,eps_for_bc) do k = kmin-1,kmax+1 do j = jmin, jmax+1 do i = imin-1,imax+1 fv = cvmgt(zero,one,abs(vad(i,j,k)).lt.eps) sty = cvmgp(ylo(i,j,k),yhi(i,j,k),vad(i,j,k)) ylo(i,j,k) = fv*sty + (one - fv)*half*(yhi(i,j,k)+ylo(i,j,k)) end do end do end do do k = kmin,kmax+1 do j = jmin-1,jmax+1 do i = imin-1,imax+1 zlo(i,j,k) = s(i,j,k-1) + (half - dthz*w(i,j,k-1))*sz(i,j,k-1) zhi(i,j,k) = s(i,j,k ) + (-half - dthz*w(i,j,k ))*sz(i,j,k ) end do end do end do if (use_minion.eq.1)then do k = kmin,kmax+1 do j = jmin-1,jmax+1 do i = imin-1, imax+1 zlo(i,j,k) = zlo(i,j,k) + dth*tforces(i,j,k-1) zhi(i,j,k) = zhi(i,j,k) + dth*tforces(i,j,k) end do end do end do end if call trans_zbc( & s,DIMS(s), & zlo,zhi,DIMS(work),wad,DIMS(work), & lo,hi,n,bc,eps_for_bc) do k = kmin,kmax+1 do j = jmin-1,jmax+1 do i = imin-1,imax+1 fw = cvmgt(zero,one,abs(wad(i,j,k)).lt.eps) stz = cvmgp(zlo(i,j,k),zhi(i,j,k),wad(i,j,k)) zlo(i,j,k) = fw*stz + (one-fw)*half*(zhi(i,j,k)+zlo(i,j,k)) end do end do end do c c compute the xedge states c if ((velpred.ne.1) .or. (n.eq.XVEL)) then do k = kmin,kmax do j = jmin,jmax do i = imin-1,imax+1 if (vad(i,j,k)*vad(i,j+1,k).lt.0.d0) then vbar = 0.5d0*(vad(i,j,k)+vad(i,j+1,k)) if (vbar.lt.0.d0) then inc = 1 else inc = 0 endif tr1 = vbar*(s(i,j+inc,k)-s(i,j+inc-1,k))/hy else tr1 = half* & (vad(i,j+1,k) + vad(i,j,k)) * & (ylo(i,j+1,k) - ylo(i,j,k)) / hy endif if (wad(i,j,k)*wad(i,j,k+1).lt.0.d0) then wbar = 0.5d0*(wad(i,j,k)+wad(i,j,k+1)) if (wbar.lt.0.d0) then inc = 1 else inc = 0 endif tr2 = wbar*(s(i,j,k+inc)-s(i,j,k+inc-1))/hz else tr2 = half* & (wad(i,j,k+1) + wad(i,j,k)) * & (zlo(i,j,k+1) - zlo(i,j,k)) / hz endif stxlo(i+1)= s(i,j,k) + (half-dthx*u(i,j,k))*sx(i,j,k) & - dth*tr1 - dth*tr2 & + dth*tforces(i,j,k) stxhi(i )= s(i,j,k) - (half+dthx*u(i,j,k))*sx(i,j,k) & - dth*tr1 - dth*tr2 & + dth*tforces(i,j,k) end do if (bc(1,1).eq.EXT_DIR .and. uad(imin,j,k).ge.zero) then stxhi(imin) = s(imin-1,j,k) stxlo(imin) = s(imin-1,j,k) else if (bc(1,1).eq.EXT_DIR .and. uad(imin,j,k).lt.zero) then stxlo(imin) = stxhi(imin) else if (bc(1,1).eq.FOEXTRAP.or.bc(1,1).eq.HOEXTRAP & .or.bc(1,1).eq.REFLECT_EVEN) then stxlo(imin) = stxhi(imin) else if (bc(1,1).eq.REFLECT_ODD) then stxhi(imin) = zero stxlo(imin) = zero end if if (bc(1,2).eq.EXT_DIR .and. uad(imax+1,j,k).le.zero) then stxlo(imax+1) = s(imax+1,j,k) stxhi(imax+1) = s(imax+1,j,k) else if (bc(1,2).eq.EXT_DIR .and. uad(imax+1,j,k).gt.zero) then stxhi(imax+1) = stxlo(imax+1) else if (bc(1,2).eq.FOEXTRAP.or.bc(1,2).eq.HOEXTRAP & .or.bc(1,2).eq.REFLECT_EVEN) then stxhi(imax+1) = stxlo(imax+1) else if (bc(1,2).eq.REFLECT_ODD) then stxlo(imax+1) = zero stxhi(imax+1) = zero end if if ( velpred .eq. 1 ) then do i = imin, imax+1 ltx = stxlo(i) .le. zero .and. stxhi(i) .ge. zero ltx = ltx .or. (abs(stxlo(i)+stxhi(i)) .lt. eps) stx = cvmgp(stxlo(i),stxhi(i),stxlo(i)+stxhi(i)) xstate(i,j,k) = cvmgt(zero,stx,ltx) end do else do i = imin, imax+1 xstate(i,j,k) = cvmgp(stxlo(i),stxhi(i),uedge(i,j,k)) xstate(i,j,k) = cvmgt(half*(stxlo(i)+stxhi(i)),xstate(i,j,k) & ,abs(uedge(i,j,k)).lt.eps) end do end if place_to_break = 1 end do end do end if c c compute the yedge states c if ((velpred.ne.1) .or. (n.eq.YVEL)) then do k = kmin,kmax do i = imin,imax do j = jmin-1,jmax+1 if (uad(i,j,k)*uad(i+1,j,k).lt.0.d0) then ubar = 0.5d0*(uad(i,j,k)+uad(i+1,j,k)) if (ubar.lt.0.d0) then inc = 1 else inc = 0 endif tr1 = ubar*(s(i+inc,j,k)-s(i+inc-1,j,k))/hx else tr1 = half* & (uad(i+1,j,k) + uad(i,j,k)) * & (xlo(i+1,j,k) - xlo(i,j,k)) / hx endif if (wad(i,j,k)*wad(i,j,k+1).lt.0.d0) then wbar = 0.5d0*(wad(i,j,k)+wad(i,j,k+1)) if (wbar.lt.0.d0) then inc = 1 else inc = 0 endif tr2 = wbar*(s(i,j,k+inc)-s(i,j,k+inc-1))/hz else tr2 = half* & (wad(i,j,k+1) + wad(i,j,k)) * & (zlo(i,j,k+1) - zlo(i,j,k)) / hz endif stylo(j+1)= s(i,j,k) + (half-dthy*v(i,j,k))*sy(i,j,k) & - dth*tr1 - dth*tr2 & + dth*tforces(i,j,k) styhi(j) = s(i,j,k) - (half+dthy*v(i,j,k))*sy(i,j,k) & - dth*tr1 - dth*tr2 & + dth*tforces(i,j,k) end do if (bc(2,1).eq.EXT_DIR .and. vad(i,jmin,k).ge.zero) then styhi(jmin) = s(i,jmin-1,k) stylo(jmin) = s(i,jmin-1,k) else if (bc(2,1).eq.EXT_DIR .and. vad(i,jmin,k).lt.zero) then stylo(jmin) = styhi(jmin) else if (bc(2,1).eq.FOEXTRAP.or.bc(2,1).eq.HOEXTRAP & .or.bc(2,1).eq.REFLECT_EVEN) then stylo(jmin) = styhi(jmin) else if (bc(2,1).eq.REFLECT_ODD) then styhi(jmin) = zero stylo(jmin) = zero end if if (bc(2,2).eq.EXT_DIR .and. vad(i,jmax+1,k).le.zero) then stylo(jmax+1) = s(i,jmax+1,k) styhi(jmax+1) = s(i,jmax+1,k) else if (bc(2,2).eq.EXT_DIR .and. vad(i,jmax+1,k).gt.zero) then styhi(jmax+1) = stylo(jmax+1) else if (bc(2,2).eq.FOEXTRAP.or.bc(2,2).eq.HOEXTRAP & .or.bc(2,2).eq.REFLECT_EVEN) then styhi(jmax+1) = stylo(jmax+1) else if (bc(2,2).eq.REFLECT_ODD) then stylo(jmax+1) = zero styhi(jmax+1) = zero end if if ( velpred .eq. 1 ) then do j = jmin, jmax+1 lty = stylo(j) .le. zero .and. styhi(j) .ge. zero lty = lty .or. (abs(stylo(j)+styhi(j)) .lt. eps) sty = cvmgp(stylo(j),styhi(j),stylo(j)+styhi(j)) ystate(i,j,k) = cvmgt(zero,sty,lty) end do else do j=jmin,jmax+1 ystate(i,j,k) = cvmgp(stylo(j),styhi(j),vedge(i,j,k)) ystate(i,j,k) = cvmgt(half*(stylo(j)+styhi(j)),ystate(i,j,k), & abs(vedge(i,j,k)).lt.eps) end do end if place_to_break = 1 end do end do end if c c compute the zedge states c if ((velpred.ne.1) .or. (n.eq.ZVEL)) then do j = jmin,jmax do i = imin,imax do k = kmin-1,kmax+1 if (uad(i,j,k)*uad(i+1,j,k).lt.0.d0) then ubar = 0.5d0*(uad(i,j,k)+uad(i+1,j,k)) if (ubar.lt.0.d0) then inc = 1 else inc = 0 endif tr1 = ubar*(s(i+inc,j,k)-s(i+inc-1,j,k))/hx else tr1 = half* & (uad(i+1,j,k) + uad(i,j,k)) * & (xlo(i+1,j,k) - xlo(i,j,k)) / hx endif if (vad(i,j,k)*vad(i,j+1,k).lt.0.d0) then vbar = 0.5d0*(vad(i,j,k)+vad(i,j+1,k)) if (vbar.lt.0.d0) then inc = 1 else inc = 0 endif tr2 = vbar*(s(i,j+inc,k)-s(i,j+inc-1,k))/hy else tr2 = half* & (vad(i,j+1,k) + vad(i,j,k)) * & (ylo(i,j+1,k) - ylo(i,j,k)) / hy endif stzlo(k+1)= s(i,j,k) + (half-dthz*w(i,j,k))*sz(i,j,k) & - dth*tr1 - dth*tr2 & + dth*tforces(i,j,k) stzhi(k) = s(i,j,k) - (half+dthz*w(i,j,k))*sz(i,j,k) & - dth*tr1 - dth*tr2 & + dth*tforces(i,j,k) end do if (bc(3,1).eq.EXT_DIR .and. wad(i,j,kmin).ge.zero) then stzlo(kmin) = s(i,j,kmin-1) stzhi(kmin) = s(i,j,kmin-1) else if (bc(3,1).eq.EXT_DIR .and. wad(i,j,kmin).lt.zero) then stzlo(kmin) = stzhi(kmin) else if (bc(3,1).eq.FOEXTRAP.or.bc(3,1).eq.HOEXTRAP & .or.bc(3,1).eq.REFLECT_EVEN) then stzlo(kmin) = stzhi(kmin) else if (bc(3,1).eq.REFLECT_ODD) then stzlo(kmin) = zero stzhi(kmin) = zero end if if (bc(3,2).eq.EXT_DIR .and. wad(i,j,kmax+1).le.zero) then stzlo(kmax+1) = s(i,j,kmax+1) stzhi(kmax+1) = s(i,j,kmax+1) else if (bc(3,2).eq.EXT_DIR .and. wad(i,j,kmax+1).gt.zero) then stzhi(kmax+1) = stzlo(kmax+1) else if (bc(3,2).eq.FOEXTRAP.or.bc(3,2).eq.HOEXTRAP & .or.bc(3,2).eq.REFLECT_EVEN) then stzhi(kmax+1) = stzlo(kmax+1) else if (bc(3,2).eq.REFLECT_ODD) then stzlo(kmax+1) = zero stzhi(kmax+1) = zero end if if ( velpred .eq. 1 ) then do k = kmin,kmax+1 ltz = stzlo(k) .le. zero .and. stzhi(k) .ge. zero ltz = ltz .or. (abs(stzlo(k)+stzhi(k)) .lt. eps) stz = cvmgp(stzlo(k),stzhi(k),stzlo(k)+stzhi(k)) zstate(i,j,k) = cvmgt(zero,stz,ltz) end do else do k = kmin,kmax+1 zstate(i,j,k) = cvmgp(stzlo(k),stzhi(k),wedge(i,j,k)) zstate(i,j,k) = cvmgt(half*(stzlo(k)+stzhi(k)),zstate(i,j,k), & abs(wedge(i,j,k)).lt.eps) end do end if place_to_break = 1 end do end do end if end subroutine FORT_ESTATE_FPU(s, tforces, divu, DIMS(s), & xlo, xhi, sx, slxscr, stxlo, stxhi, & uedge, DIMS(uedge), xstate, DIMS(xstate), & ylo, yhi, sy, slyscr, stylo, styhi, & vedge, DIMS(vedge), ystate, DIMS(ystate), & zlo, zhi, sz, slzscr, stzlo, stzhi, & wedge, DIMS(wedge), zstate, DIMS(zstate), & DIMS(work), & bc,lo,hi,dt,dx,n,use_minion,iconserv) c c This subroutine computes edges states, right now it uses c a lot of memory, but there becomes a trade off between c simplicity-efficiency in the new way of computing states c and complexity in the old way. By eliminating loops over c state components though, the new way uses much less memory. c c This routine differs from the default ESTATE function above in that c it assumes that the edge velocities are valid in a grow cell outside c the box, and no *ad (unprojected) velocities are used. This routine c will fail if the UMAC coming in hasn't been "fillpatched" c integer i,j,k,n,inc integer lo(SDIM),hi(SDIM),bc(SDIM,2) integer imin,jmin,kmin,imax,jmax,kmax REAL_T place_to_break REAL_T hx, hy, hz, dt, dth, dthx, dthy, dthz REAL_T tr,tr1,tr2,ubar,vbar,wbar,stx,sty,stz,fu,fv,fw,dx(SDIM) REAL_T eps,eps_for_bc logical ltx,lty,ltz parameter (eps = 1.d-6 ) parameter (eps_for_bc = 1.d-10) integer DIMDEC(s) integer DIMDEC(work) integer DIMDEC(uedge) integer DIMDEC(xstate) integer DIMDEC(vedge) integer DIMDEC(ystate) integer DIMDEC(wedge) integer DIMDEC(zstate) REAL_T s(DIMV(s)) REAL_T stxlo(DIM1(s)),stxhi(DIM1(s)),slxscr(DIM1(s),4) REAL_T stylo(DIM2(s)),styhi(DIM2(s)),slyscr(DIM2(s),4) REAL_T stzlo(DIM3(s)),stzhi(DIM3(s)),slzscr(DIM3(s),4) REAL_T uedge(DIMV(uedge)), xstate(DIMV(xstate)) REAL_T vedge(DIMV(vedge)), ystate(DIMV(ystate)) REAL_T wedge(DIMV(wedge)), zstate(DIMV(zstate)) REAL_T xlo(DIMV(work)), xhi(DIMV(work)) REAL_T ylo(DIMV(work)), yhi(DIMV(work)) REAL_T zlo(DIMV(work)), zhi(DIMV(work)) REAL_T sx(DIMV(work)) REAL_T sy(DIMV(work)) REAL_T sz(DIMV(work)) REAL_T tforces(DIMV(work)) REAL_T divu(DIMV(work)) integer use_minion, iconserv REAL_T spx,smx,spy,smy,spz,smz,st,denom dth = half*dt dthx = half*dt / dx(1) dthy = half*dt / dx(2) dthz = half*dt / dx(3) hx = dx(1) hy = dx(2) hz = dx(3) imin = lo(1) jmin = lo(2) kmin = lo(3) imax = hi(1) jmax = hi(2) kmax = hi(3) c c compute the slopes c call FORT_SLOPES(ALL, & s,DIMS(s), & sx,sy,sz,DIMS(work), & lo,hi,slxscr,slyscr,slzscr,bc) c c trace the state to the cell edges c do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin, imax+1 xlo(i,j,k) = s(i-1,j,k) + (half - dthx*uedge(i,j,k))*sx(i-1,j,k) xhi(i,j,k) = s(i, j,k) + (-half - dthx*uedge(i,j,k))*sx(i, j,k) end do end do end do if(use_minion.eq.1)then do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin, imax+1 xlo(i,j,k) = xlo(i,j,k) + dth*tforces(i-1,j,k) xhi(i,j,k) = xhi(i,j,k) + dth*tforces(i, j,k) end do end do end do if (iconserv .eq. 1) then do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin, imax+1 xlo(i,j,k) = xlo(i,j,k) - dth*s(i-1,j,k)*divu(i-1,j,k) xhi(i,j,k) = xhi(i,j,k) - dth*s(i ,j,k)*divu(i, j,k) end do end do end do end if end if call trans_xbc( & s,DIMS(s), & xlo,xhi,DIMS(work),uedge,DIMS(uedge), & lo,hi,n,bc,eps_for_bc) do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin, imax+1 fu = cvmgt(zero,one,abs(uedge(i,j,k)).lt.eps) stx = cvmgp(xlo(i,j,k),xhi(i,j,k),uedge(i,j,k)) xlo(i,j,k) = fu*stx + (one - fu)*half*(xhi(i,j,k)+xlo(i,j,k)) end do end do end do do k = kmin-1,kmax+1 do j = jmin, jmax+1 do i = imin-1,imax+1 ylo(i,j,k) = s(i,j-1,k) + (half - dthy*vedge(i,j,k))*sy(i,j-1,k) yhi(i,j,k) = s(i,j, k) + (-half - dthy*vedge(i,j,k))*sy(i,j, k) end do end do end do if (use_minion.eq.1)then do k = kmin-1,kmax+1 do j = jmin, jmax+1 do i = imin-1, imax+1 ylo(i,j,k) = ylo(i,j,k) + dth*tforces(i,j-1,k) yhi(i,j,k) = yhi(i,j,k) + dth*tforces(i,j, k) end do end do end do if (iconserv .eq. 1) then do k = kmin-1,kmax+1 do j = jmin, jmax+1 do i = imin-1, imax+1 ylo(i,j,k) = ylo(i,j,k) - dth*s(i,j-1,k)*divu(i,j-1,k) yhi(i,j,k) = yhi(i,j,k) - dth*s(i,j ,k)*divu(i,j, k) end do end do end do end if end if call trans_ybc( & s,DIMS(s), & ylo,yhi,DIMS(work),vedge,DIMS(vedge), & lo,hi,n,bc,eps_for_bc) do k = kmin-1,kmax+1 do j = jmin, jmax+1 do i = imin-1,imax+1 fv = cvmgt(zero,one,abs(vedge(i,j,k)).lt.eps) sty = cvmgp(ylo(i,j,k),yhi(i,j,k),vedge(i,j,k)) ylo(i,j,k) = fv*sty + (one - fv)*half*(yhi(i,j,k)+ylo(i,j,k)) end do end do end do do k = kmin,kmax+1 do j = jmin-1,jmax+1 do i = imin-1,imax+1 zlo(i,j,k) = s(i,j,k-1) + (half - dthz*wedge(i,j,k))*sz(i,j,k-1) zhi(i,j,k) = s(i,j,k ) + (-half - dthz*wedge(i,j,k))*sz(i,j,k ) end do end do end do if (use_minion.eq.1)then do k = kmin,kmax+1 do j = jmin-1,jmax+1 do i = imin-1, imax+1 zlo(i,j,k) = zlo(i,j,k) + dth*tforces(i,j,k-1) zhi(i,j,k) = zhi(i,j,k) + dth*tforces(i,j,k) end do end do end do if (iconserv .eq. 1) then do k = kmin,kmax+1 do j = jmin-1,jmax+1 do i = imin-1, imax+1 zlo(i,j,k) = zlo(i,j,k) - dth*s(i,j,k-1)*divu(i,j,k-1) zhi(i,j,k) = zhi(i,j,k) - dth*s(i,j,k )*divu(i,j,k ) end do end do end do end if end if call trans_zbc( & s,DIMS(s), & zlo,zhi,DIMS(work),wedge,DIMS(wedge), & lo,hi,n,bc,eps_for_bc) do k = kmin,kmax+1 do j = jmin-1,jmax+1 do i = imin-1,imax+1 fw = cvmgt(zero,one,abs(wedge(i,j,k)).lt.eps) stz = cvmgp(zlo(i,j,k),zhi(i,j,k),wedge(i,j,k)) zlo(i,j,k) = fw*stz + (one-fw)*half*(zhi(i,j,k)+zlo(i,j,k)) end do end do end do c c compute the xedge states c do k = kmin,kmax do j = jmin,jmax do i = imin-1,imax+1 spx = s(i,j,k) + half*sx(i,j,k) smx = s(i,j,k) - half*sx(i,j,k) if (iconserv.eq.1) then tr = & (vedge(i,j+1,k)*ylo(i,j+1,k) - vedge(i,j,k)*ylo(i,j,k))/hy + & (wedge(i,j,k+1)*zlo(i,j,k+1) - wedge(i,j,k)*zlo(i,j,k))/hz st = -dth*tr + dth*(tforces(i,j,k) - s(i,j,k)*divu(i,j,k)) & + dth*s(i,j,k)*(vedge(i,j+1,k)-vedge(i,j,k))/hy & + dth*s(i,j,k)*(wedge(i,j,k+1)-wedge(i,j,k))/hz c & - dth*s(i,j,k)*(uedge(i+1,j,k)-uedge(i,j,k))/hx else if (vedge(i,j,k)*vedge(i,j+1,k).le.0.d0) then vbar = 0.5d0*(vedge(i,j,k)+vedge(i,j+1,k)) if (vbar.lt.0.d0) then inc = 1 else inc = 0 endif tr1 = vbar*(s(i,j+inc,k)-s(i,j+inc-1,k))/hy else tr1 = half*(vedge(i,j+1,k) + vedge(i,j,k)) * & (ylo(i,j+1,k) - ylo(i,j,k) ) / hy endif if (wedge(i,j,k)*wedge(i,j,k+1).lt.0.d0) then wbar = 0.5d0*(wedge(i,j,k)+wedge(i,j,k+1)) if (wbar.lt.0.d0) then inc = 1 else inc = 0 endif tr2 = wbar*(s(i,j,k+inc)-s(i,j,k+inc-1))/hz else tr2 = half*(wedge(i,j,k+1) + wedge(i,j,k)) * & (zlo(i,j,k+1) - zlo(i,j,k) ) / hz endif st = -dth*(tr1 + tr2) + dth*tforces(i,j,k) endif stxlo(i+1)= spx - dthx*uedge(i+1,j,k)*sx(i,j,k) + st stxhi(i )= smx - dthx*uedge(i ,j,k)*sx(i,j,k) + st end do if (bc(1,1).eq.EXT_DIR .and. uedge(imin,j,k).ge.zero) then stxhi(imin) = s(imin-1,j,k) stxlo(imin) = s(imin-1,j,k) else if (bc(1,1).eq.EXT_DIR .and. uedge(imin,j,k).lt.zero) then stxlo(imin) = stxhi(imin) else if (bc(1,1).eq.FOEXTRAP.or.bc(1,1).eq.HOEXTRAP & .or.bc(1,1).eq.REFLECT_EVEN) then stxlo(imin) = stxhi(imin) else if (bc(1,1).eq.REFLECT_ODD) then stxhi(imin) = zero stxlo(imin) = zero end if if (bc(1,2).eq.EXT_DIR .and. uedge(imax+1,j,k).le.zero) then stxlo(imax+1) = s(imax+1,j,k) stxhi(imax+1) = s(imax+1,j,k) else if (bc(1,2).eq.EXT_DIR .and. uedge(imax+1,j,k).gt.zero) then stxhi(imax+1) = stxlo(imax+1) else if (bc(1,2).eq.FOEXTRAP.or.bc(1,2).eq.HOEXTRAP & .or.bc(1,2).eq.REFLECT_EVEN) then stxhi(imax+1) = stxlo(imax+1) else if (bc(1,2).eq.REFLECT_ODD) then stxlo(imax+1) = zero stxhi(imax+1) = zero end if do i = imin, imax+1 xstate(i,j,k) = cvmgp(stxlo(i),stxhi(i),uedge(i,j,k)) xstate(i,j,k) = cvmgt(half*(stxlo(i)+stxhi(i)),xstate(i,j,k) & ,abs(uedge(i,j,k)).lt.eps) end do place_to_break = 1 end do end do c c compute the yedge states c do k = kmin,kmax do i = imin,imax do j = jmin-1,jmax+1 spy = s(i,j,k) + half*sy(i,j,k) smy = s(i,j,k) - half*sy(i,j,k) if (iconserv.eq.1) then tr = & (uedge(i+1,j,k)*xlo(i+1,j,k) - uedge(i,j,k)*xlo(i,j,k))/hx + & (wedge(i,j,k+1)*zlo(i,j,k+1) - wedge(i,j,k)*zlo(i,j,k))/hz st = -dth*tr + dth*(tforces(i,j,k) - s(i,j,k)*divu(i,j,k)) & + dth*s(i,j,k)*(uedge(i+1,j,k)-uedge(i,j,k))/hx & + dth*s(i,j,k)*(wedge(i,j,k+1)-wedge(i,j,k))/hz c & - dth*s(i,j,k)*(vedge(i,j+1,k)-vedge(i,j,k))/hy else if (uedge(i,j,k)*uedge(i+1,j,k).le.0.d0) then ubar = 0.5d0*(uedge(i,j,k)+uedge(i+1,j,k)) if (ubar.lt.0.d0) then inc = 1 else inc = 0 endif tr1 = ubar*(s(i+inc,j,k)-s(i+inc-1,j,k))/hx else tr1 = half*(uedge(i+1,j,k) + uedge(i,j,k)) * & (xlo(i+1,j,k) - xlo(i,j,k) ) / hx endif if (wedge(i,j,k)*wedge(i,j,k+1).lt.0.d0) then wbar = 0.5d0*(wedge(i,j,k)+wedge(i,j,k+1)) if (wbar.lt.0.d0) then inc = 1 else inc = 0 endif tr2 = wbar*(s(i,j,k+inc)-s(i,j,k+inc-1))/hz else tr2 = half*(wedge(i,j,k+1) + wedge(i,j,k)) * & (zlo(i,j,k+1) - zlo(i,j,k) ) / hz endif st = -dth*(tr1 + tr2) + dth*tforces(i,j,k) endif stylo(j+1)= spy - dthy*vedge(i,j+1,k)*sy(i,j,k) + st styhi(j )= smy - dthy*vedge(i,j ,k)*sy(i,j,k) + st end do if (bc(2,1).eq.EXT_DIR .and. vedge(i,jmin,k).ge.zero) then styhi(jmin) = s(i,jmin-1,k) stylo(jmin) = s(i,jmin-1,k) else if (bc(2,1).eq.EXT_DIR .and. vedge(i,jmin,k).lt.zero) then stylo(jmin) = styhi(jmin) else if (bc(2,1).eq.FOEXTRAP.or.bc(2,1).eq.HOEXTRAP & .or.bc(2,1).eq.REFLECT_EVEN) then stylo(jmin) = styhi(jmin) else if (bc(2,1).eq.REFLECT_ODD) then styhi(jmin) = zero stylo(jmin) = zero end if if (bc(2,2).eq.EXT_DIR .and. vedge(i,jmax+1,k).le.zero) then stylo(jmax+1) = s(i,jmax+1,k) styhi(jmax+1) = s(i,jmax+1,k) else if (bc(2,2).eq.EXT_DIR .and. vedge(i,jmax+1,k).le.zero) then styhi(jmax+1) = stylo(jmax+1) else if (bc(2,2).eq.FOEXTRAP.or.bc(2,2).eq.HOEXTRAP & .or.bc(2,2).eq.REFLECT_EVEN) then styhi(jmax+1) = stylo(jmax+1) else if (bc(2,2).eq.REFLECT_ODD) then stylo(jmax+1) = zero styhi(jmax+1) = zero end if do j=jmin,jmax+1 ystate(i,j,k) = cvmgp(stylo(j),styhi(j),vedge(i,j,k)) ystate(i,j,k) = cvmgt(half*(stylo(j)+styhi(j)),ystate(i,j,k), & abs(vedge(i,j,k)).lt.eps) end do place_to_break = 1 end do end do c c compute the zedge states c do j = jmin,jmax do i = imin,imax do k = kmin-1,kmax+1 spz = s(i,j,k) + half*sz(i,j,k) smz = s(i,j,k) - half*sz(i,j,k) if (iconserv.eq.1) then tr = & (uedge(i+1,j,k)*xlo(i+1,j,k) - uedge(i,j,k)*xlo(i,j,k))/hx + & (vedge(i,j+1,k)*ylo(i,j+1,k) - vedge(i,j,k)*ylo(i,j,k))/hy st = -dth*tr + dth*(tforces(i,j,k) - s(i,j,k)*divu(i,j,k)) & + dth*s(i,j,k)*(uedge(i+1,j,k)-uedge(i,j,k))/hx & + dth*s(i,j,k)*(vedge(i,j+1,k)-vedge(i,j,k))/hy c & - dth*s(i,j,k)*(wedge(i,j,k+1)-wedge(i,j,k))/hz else if (uedge(i,j,k)*uedge(i+1,j,k).le.0.d0) then ubar = 0.5d0*(uedge(i,j,k)+uedge(i+1,j,k)) if (ubar.lt.0.d0) then inc = 1 else inc = 0 endif tr1 = ubar*(s(i+inc,j,k)-s(i+inc-1,j,k))/hx else tr1 = half*(uedge(i+1,j,k) + uedge(i,j,k)) * & (xlo(i+1,j,k) - xlo(i,j,k) ) / hx endif if (vedge(i,j,k)*vedge(i,j+1,k).lt.0.d0) then vbar = 0.5d0*(vedge(i,j,k)+vedge(i,j+1,k)) if (vbar.lt.0.d0) then inc = 1 else inc = 0 endif tr2 = vbar*(s(i,j+inc,k)-s(i,j+inc-1,k))/hy else tr2 = half*(vedge(i,j+1,k) + vedge(i,j,k)) * & (ylo(i,j+1,k) - ylo(i,j,k) ) / hy endif st = -dth*(tr1 + tr2) + dth*tforces(i,j,k) endif stzlo(k+1)= spz - dthz*wedge(i,j,k+1)*sz(i,j,k) + st stzhi(k )= smz - dthz*wedge(i,j,k )*sz(i,j,k) + st end do if (bc(3,1).eq.EXT_DIR .and. wedge(i,j,kmin).ge.zero) then stzlo(kmin) = s(i,j,kmin-1) stzhi(kmin) = s(i,j,kmin-1) else if (bc(3,1).eq.EXT_DIR .and. wedge(i,j,kmin).lt.zero) then stzlo(kmin) = stzhi(kmin) else if (bc(3,1).eq.FOEXTRAP.or.bc(3,1).eq.HOEXTRAP & .or.bc(3,1).eq.REFLECT_EVEN) then stzlo(kmin) = stzhi(kmin) else if (bc(3,1).eq.REFLECT_ODD) then stzlo(kmin) = zero stzhi(kmin) = zero end if if (bc(3,2).eq.EXT_DIR .and. wedge(i,j,kmax+1).le.zero) then stzlo(kmax+1) = s(i,j,kmax+1) stzhi(kmax+1) = s(i,j,kmax+1) else if (bc(3,2).eq.EXT_DIR .and. wedge(i,j,kmax+1).gt.zero) then stzhi(kmax+1) = stzlo(kmax+1) else if (bc(3,2).eq.FOEXTRAP.or.bc(3,2).eq.HOEXTRAP & .or.bc(3,2).eq.REFLECT_EVEN) then stzhi(kmax+1) = stzlo(kmax+1) else if (bc(3,2).eq.REFLECT_ODD) then stzlo(kmax+1) = zero stzhi(kmax+1) = zero end if do k = kmin,kmax+1 zstate(i,j,k) = cvmgp(stzlo(k),stzhi(k),wedge(i,j,k)) zstate(i,j,k) = cvmgt(half*(stzlo(k)+stzhi(k)),zstate(i,j,k), & abs(wedge(i,j,k)).lt.eps) end do place_to_break = 1 end do end do end subroutine FORT_ADV_FORCING( & aofs,DIMS(aofs), & xflux,DIMS(xflux), & uedge,DIMS(uedge), & areax,DIMS(ax), & yflux,DIMS(yflux), & vedge,DIMS(vedge), & areay,DIMS(ay), & zflux,DIMS(zflux), & wedge,DIMS(wedge), & areaz,DIMS(az), & vol,DIMS(vol), & lo,hi,iconserv ) c c This subroutine uses scalar edge states to compute c an advective tendency c implicit none integer i,j,k integer iconserv REAL_T divux,divuy,divuz,rincr integer imin,jmin,kmin,imax,jmax,kmax integer lo(SDIM),hi(SDIM) integer DIMDEC(aofs) integer DIMDEC(vol) integer DIMDEC(uedge) integer DIMDEC(vedge) integer DIMDEC(wedge) integer DIMDEC(xflux) integer DIMDEC(yflux) integer DIMDEC(zflux) integer DIMDEC(ax) integer DIMDEC(ay) integer DIMDEC(az) REAL_T aofs(DIMV(aofs)) REAL_T vol(DIMV(vol)) REAL_T uedge(DIMV(uedge)) REAL_T vedge(DIMV(vedge)) REAL_T wedge(DIMV(wedge)) REAL_T xflux(DIMV(xflux)) REAL_T yflux(DIMV(yflux)) REAL_T zflux(DIMV(zflux)) REAL_T areax(DIMV(ax)) REAL_T areay(DIMV(ay)) REAL_T areaz(DIMV(az)) imin = lo(1) jmin = lo(2) kmin = lo(3) imax = hi(1) jmax = hi(2) kmax = hi(3) c c if nonconservative initialize the advective tendency as -U*grad(S) c if ( iconserv .ne. 1 ) then do k = kmin,kmax do j = jmin,jmax do i = imin,imax divux = ( & areax(i+1,j,k)*uedge(i+1,j,k)- & areax(i, j,k)*uedge(i, j,k))/vol(i,j,k) divuy = ( & areay(i,j+1,k)*vedge(i,j+1,k)- & areay(i,j, k)*vedge(i,j, k))/vol(i,j,k) divuz = ( & areaz(i,j,k+1)*wedge(i,j,k+1)- & areaz(i,j,k )*wedge(i,j,k ))/vol(i,j,k) aofs(i,j,k) = & - divux*half*(xflux(i+1,j,k)+xflux(i,j,k)) & - divuy*half*(yflux(i,j+1,k)+yflux(i,j,k)) & - divuz*half*(zflux(i,j,k+1)+zflux(i,j,k)) end do end do end do end if c c convert edge states to fluxes c do k = kmin,kmax do j = jmin,jmax do i = imin,imax+1 xflux(i,j,k) = xflux(i,j,k)*uedge(i,j,k)*areax(i,j,k) end do end do end do do k = kmin,kmax do j = jmin,jmax+1 do i = imin,imax yflux(i,j,k) = yflux(i,j,k)*vedge(i,j,k)*areay(i,j,k) end do end do end do do k = kmin,kmax+1 do j = jmin,jmax do i = imin,imax zflux(i,j,k) = zflux(i,j,k)*wedge(i,j,k)*areaz(i,j,k) end do end do end do c c compute the part of the advective tendency c that depends on the flux convergence c if ( iconserv .ne. 1 ) then do k = kmin,kmax do j = jmin,jmax do i = imin,imax aofs(i,j,k) = aofs(i,j,k) + ( & xflux(i+1,j,k) - xflux(i,j,k) + & yflux(i,j+1,k) - yflux(i,j,k) + & zflux(i,j,k+1) - zflux(i,j,k))/vol(i,j,k) end do end do end do else do k = kmin,kmax do j = jmin,jmax do i = imin,imax aofs(i,j,k) = ( & xflux(i+1,j,k) - xflux(i,j,k) + & yflux(i,j+1,k) - yflux(i,j,k) + & zflux(i,j,k+1) - zflux(i,j,k))/vol(i,j,k) end do end do end do end if end subroutine FORT_SYNC_ADV_FORCING( & sync ,DIMS(sync), & xflux,DIMS(xflux), & ucor ,DIMS(ucor), & areax,DIMS(ax), & yflux,DIMS(yflux), & vcor ,DIMS(vcor), & areay,DIMS(ay), & zflux,DIMS(zflux), & wcor ,DIMS(wcor), & areaz,DIMS(az), & vol ,DIMS(vol), & lo,hi,iconserv ) c c This subroutine computes the sync advective tendency c for a state variable c implicit none integer i,j,k integer iconserv REAL_T divux,divuy,divuz integer imin,jmin,kmin,imax,jmax,kmax integer lo(SDIM),hi(SDIM) integer DIMDEC(sync) integer DIMDEC(vol) integer DIMDEC(ucor) integer DIMDEC(vcor) integer DIMDEC(wcor) integer DIMDEC(xflux) integer DIMDEC(yflux) integer DIMDEC(zflux) integer DIMDEC(ax) integer DIMDEC(ay) integer DIMDEC(az) REAL_T sync(DIMV(sync)) REAL_T vol(DIMV(vol)) REAL_T ucor(DIMV(ucor)) REAL_T vcor(DIMV(vcor)) REAL_T wcor(DIMV(wcor)) REAL_T xflux(DIMV(xflux)) REAL_T yflux(DIMV(yflux)) REAL_T zflux(DIMV(zflux)) REAL_T areax(DIMV(ax)) REAL_T areay(DIMV(ay)) REAL_T areaz(DIMV(az)) imin = lo(1) jmin = lo(2) kmin = lo(3) imax = hi(1) jmax = hi(2) kmax = hi(3) c c compute corrective fluxes from edge states c and perform conservative update c do k = kmin,kmax do j = jmin,jmax do i = imin,imax+1 xflux(i,j,k) = xflux(i,j,k)*ucor(i,j,k)*areax(i,j,k) end do end do end do do k = kmin,kmax do j = jmin,jmax+1 do i = imin,imax yflux(i,j,k) = yflux(i,j,k)*vcor(i,j,k)*areay(i,j,k) end do end do end do do k = kmin,kmax+1 do j = jmin,jmax do i = imin,imax zflux(i,j,k) = zflux(i,j,k)*wcor(i,j,k)*areaz(i,j,k) end do end do end do do k = kmin,kmax do j = jmin,jmax do i = imin,imax sync(i,j,k) = sync(i,j,k) + ( & xflux(i+1,j,k)-xflux(i,j,k) + & yflux(i,j+1,k)-yflux(i,j,k) + & zflux(i,j,k+1)-zflux(i,j,k) )/vol(i,j,k) end do end do end do end subroutine trans_xbc( & s,DIMS(s), & xlo,xhi,DIMS(xx),uad,DIMS(uad), & lo,hi,n,xbc,eps) c c This subroutine processes boundary conditions on information c traced to cell faces in the x direction. This is used for c computing velocities and edge states used in calculating c transverse derivatives c integer DIMDEC(s) REAL_T s(DIMV(s)) integer DIMDEC(xx) integer DIMDEC(uad) REAL_T xlo(DIMV(xx)) REAL_T xhi(DIMV(xx)) REAL_T uad(DIMV(uad)) REAL_T eps integer lo(SDIM), hi(SDIM) integer n integer xbc(SDIM,2) REAL_T stx logical ltest integer j,k integer imin,jmin,kmin,imax,jmax,kmax imin = lo(1) jmin = lo(2) kmin = lo(3) imax = hi(1) jmax = hi(2) kmax = hi(3) c c -------------- the lower x boundary c if (xbc(1,1).eq.EXT_DIR) then if ( n .eq. XVEL ) then do j = jmin-1,jmax+1 do k = kmin-1,kmax+1 if (uad(imin,j,k) .ge. zero) then xlo(imin,j,k) = s(imin-1,j,k) xhi(imin,j,k) = s(imin-1,j,k) else xlo(imin,j,k) = xhi(imin,j,k) endif end do end do else do j = jmin-1,jmax+1 do k = kmin-1,kmax+1 ltest = uad(imin,j,k).le.eps stx = cvmgt(xhi(imin,j,k),s(imin-1,j,k),ltest) xlo(imin,j,k) = stx xhi(imin,j,k) = stx end do end do end if else if (xbc(1,1).eq.FOEXTRAP.or.xbc(1,1).eq.HOEXTRAP & .or.xbc(1,1).eq.REFLECT_EVEN) then do j = jmin-1,jmax+1 do k = kmin-1,kmax+1 xlo(imin,j,k) = xhi(imin,j,k) end do end do else if (xbc(1,1).eq.REFLECT_ODD) then do j = jmin-1,jmax+1 do k = kmin-1,kmax+1 xhi(imin,j,k) = zero xlo(imin,j,k) = zero end do end do end if c c -------------- the upper x boundary c if (xbc(1,2).eq.EXT_DIR) then if ( n .eq. XVEL ) then do j = jmin-1,jmax+1 do k = kmin-1,kmax+1 if (uad(imax+1,j,k) .le. zero) then xlo(imax+1,j,k) = s(imax+1,j,k) xhi(imax+1,j,k) = s(imax+1,j,k) else xhi(imax+1,j,k) = xlo(imax+1,j,k) endif end do end do else do j = jmin-1,jmax+1 do k = kmin-1,kmax+1 ltest = uad(imax+1,j,k).ge.-eps stx = cvmgt(xlo(imax+1,j,k),s(imax+1,j,k),ltest) xlo(imax+1,j,k) = stx xhi(imax+1,j,k) = stx end do end do end if else if (xbc(1,2).eq.FOEXTRAP.or.xbc(1,2).eq.HOEXTRAP & .or.xbc(1,2).eq.REFLECT_EVEN) then do j = jmin-1,jmax+1 do k = kmin-1,kmax+1 xhi(imax+1,j,k) = xlo(imax+1,j,k) end do end do else if (xbc(1,2).eq.REFLECT_ODD) then do j = jmin-1,jmax+1 do k = kmin-1,kmax+1 xhi(imax+1,j,k) = zero xlo(imax+1,j,k) = zero end do end do end if end subroutine trans_ybc( & s,DIMS(s), & ylo,yhi,DIMS(yy),vad,DIMS(vad), & lo,hi,n,ybc,eps) c c This subroutine processes boundary conditions on information c traced to cell faces in the y direction. This is used for c computing velocities and edge states used in calculating c transverse derivatives c integer DIMDEC(s) REAL_T s(DIMV(s)) integer DIMDEC(yy) integer DIMDEC(vad) REAL_T ylo(DIMV(yy)) REAL_T yhi(DIMV(yy)) REAL_T vad(DIMV(vad)) REAL_T eps integer lo(SDIM), hi(SDIM) integer n integer ybc(SDIM,2) REAL_T sty logical ltest integer i,k integer imin,jmin,kmin,imax,jmax,kmax imin = lo(1) jmin = lo(2) kmin = lo(3) imax = hi(1) jmax = hi(2) kmax = hi(3) c c -------------- the lower y boundary c if (ybc(2,1).eq.EXT_DIR) then if ( n .eq. YVEL ) then do i = imin-1,imax+1 do k = kmin-1,kmax+1 if (vad(i,jmin,k) .ge. zero) then ylo(i,jmin,k) = s(i,jmin-1,k) yhi(i,jmin,k) = s(i,jmin-1,k) else ylo(i,jmin,k) = yhi(i,jmin,k) endif end do end do else do i = imin-1,imax+1 do k = kmin-1,kmax+1 ltest = vad(i,jmin,k).le.eps sty = cvmgt(yhi(i,jmin,k),s(i,jmin-1,k),ltest) ylo(i,jmin,k) = sty yhi(i,jmin,k) = sty end do end do end if else if (ybc(2,1).eq.FOEXTRAP.or.ybc(2,1).eq.HOEXTRAP & .or.ybc(2,1).eq.REFLECT_EVEN) then do i = imin-1,imax+1 do k = kmin-1,kmax+1 ylo(i,jmin,k) = yhi(i,jmin,k) end do end do else if (ybc(2,1).eq.REFLECT_ODD) then do i = imin-1,imax+1 do k = kmin-1,kmax+1 yhi(i,jmin,k) = zero ylo(i,jmin,k) = zero end do end do end if c c -------------- the upper y boundary c if (ybc(2,2).eq.EXT_DIR) then if ( n .eq. YVEL ) then do i = imin-1,imax+1 do k = kmin-1,kmax+1 if (vad(i,jmax+1,k) .le. zero) then ylo(i,jmax+1,k) = s(i,jmax+1,k) yhi(i,jmax+1,k) = s(i,jmax+1,k) else yhi(i,jmax+1,k) = ylo(i,jmax+1,k) endif end do end do else do i = imin-1,imax+1 do k = kmin-1,kmax+1 ltest = vad(i,jmax+1,k).ge.-eps sty = cvmgt(ylo(i,jmax+1,k),s(i,jmax+1,k),ltest) ylo(i,jmax+1,k) = sty yhi(i,jmax+1,k) = sty end do end do end if else if (ybc(2,2).eq.FOEXTRAP.or.ybc(2,2).eq.HOEXTRAP & .or.ybc(2,2).eq.REFLECT_EVEN) then do i = imin-1,imax+1 do k = kmin-1,kmax+1 yhi(i,jmax+1,k) = ylo(i,jmax+1,k) end do end do else if (ybc(2,2).eq.REFLECT_ODD) then do i = imin-1,imax+1 do k = kmin-1,kmax+1 ylo(i,jmax+1,k) = zero yhi(i,jmax+1,k) = zero end do end do end if end subroutine trans_zbc( & s,DIMS(s), & zlo,zhi,DIMS(zz),wad,DIMS(wad), & lo,hi,n,zbc,eps) c c This subroutine processes boundary conditions on information c traced to cell faces in the z direction. This is used for c computing velocities and edge states used in calculating c transverse derivatives c integer DIMDEC(s) REAL_T s(DIMV(s)) integer DIMDEC(zz) integer DIMDEC(wad) REAL_T zlo(DIMV(zz)) REAL_T zhi(DIMV(zz)) REAL_T wad(DIMV(wad)) REAL_T eps integer lo(SDIM), hi(SDIM) integer n integer zbc(SDIM,2) REAL_T stz logical ltest integer i,j integer imin,jmin,kmin,imax,jmax,kmax imin = lo(1) jmin = lo(2) kmin = lo(3) imax = hi(1) jmax = hi(2) kmax = hi(3) c c -------------- the lower z boundary c if (zbc(3,1).eq.EXT_DIR) then if ( n .eq. ZVEL ) then do i = imin-1,imax+1 do j = jmin-1,jmax+1 if (wad(i,j,kmin) .ge. zero) then zhi(i,j,kmin) = s(i,j,kmin-1) zlo(i,j,kmin) = s(i,j,kmin-1) else zlo(i,j,kmin) = zhi(i,j,kmin) endif end do end do else do i = imin-1,imax+1 do j = jmin-1,jmax+1 ltest = wad(i,j,kmin).le.eps stz = cvmgt(zhi(i,j,kmin),s(i,j,kmin-1),ltest) zhi(i,j,kmin) = stz zlo(i,j,kmin) = stz end do end do end if else if (zbc(3,1).eq.FOEXTRAP.or.zbc(3,1).eq.HOEXTRAP & .or.zbc(3,1).eq.REFLECT_EVEN) then do i = imin-1,imax+1 do j = jmin-1,jmax+1 zlo(i,j,kmin) = zhi(i,j,kmin) end do end do else if (zbc(3,1).eq.REFLECT_ODD) then do i = imin-1,imax+1 do j = jmin-1,jmax+1 zhi(i,j,kmin) = zero zlo(i,j,kmin) = zero end do end do end if c c -------------- the upper z boundary c if (zbc(3,2).eq.EXT_DIR) then if ( n .eq. ZVEL ) then do i = imin-1,imax+1 do j = jmin-1,jmax+1 if (wad(i,j,kmax+1) .le. zero) then zlo(i,j,kmax+1) = s(i,j,kmax+1) zhi(i,j,kmax+1) = s(i,j,kmax+1) else zhi(i,j,kmax+1) = zlo(i,j,kmax+1) endif end do end do else do i = imin-1,imax+1 do j = jmin-1,jmax+1 ltest = wad(i,j,kmax+1).ge.-eps stz = cvmgt(zlo(i,j,kmax+1),s(i,j,kmax+1),ltest) zhi(i,j,kmax+1) = stz zlo(i,j,kmax+1) = stz end do end do end if else if (zbc(3,2).eq.FOEXTRAP.or.zbc(3,2).eq.HOEXTRAP & .or.zbc(3,2).eq.REFLECT_EVEN) then do i = imin-1,imax+1 do j = jmin-1,jmax+1 zhi(i,j,kmax+1) = zlo(i,j,kmax+1) end do end do else if (zbc(3,2).eq.REFLECT_ODD) then do i = imin-1,imax+1 do j = jmin-1,jmax+1 zlo(i,j,kmax+1) = zero zhi(i,j,kmax+1) = zero end do end do end if end subroutine FORT_SLOPES( dir, & s,DIMS(s), & slx,sly,slz,DIMS(sl), & lo,hi,slxscr,slyscr,slzscr,bc) c c this subroutine computes first or forth order slopes of c a 3D scalar field. c c (dir) is used to eliminate calculating extra slopes in transvel c c Boundary conditions on interior slopes are handled automatically c by the ghost cells c c Boundary conditions on EXT_DIR and HOEXTRAP slopes are implemented c by setting them to zero outside of the domain and using a c one-sided derivative from the interior c implicit none #include "GODCOMM_F.H" integer dir integer DIMDEC(s) REAL_T s(DIMV(s)) integer DIMDEC(sl) REAL_T slx(DIMV(sl)) REAL_T sly(DIMV(sl)) REAL_T slz(DIMV(sl)) integer lo(SDIM), hi(SDIM) REAL_T slxscr(DIM1(s), 4) REAL_T slyscr(DIM2(s), 4) REAL_T slzscr(DIM3(s), 4) integer bc(SDIM,2) integer imin,jmin,kmin,imax,jmax,kmax,i,j,k integer ng REAL_T dpls,dmin,ds REAL_T del,slim,sflg integer cen,lim,flag,fromm parameter( cen = 1 ) parameter( lim = 2 ) parameter( flag = 3 ) parameter( fromm = 4 ) ng = lo(1) - ARG_L1(s) imin = lo(1) jmin = lo(2) kmin = lo(3) imax = hi(1) jmax = hi(2) kmax = hi(3) c c Added to prevent underflow for small s values. c do k = lo(3)-ng, hi(3)+ng do j = lo(2)-ng, hi(2)+ng do i = lo(1)-ng, hi(1)+ng s(i,j,k) = cvmgt(s(i,j,k), zero, abs(s(i,j,k)).gt.1.0D-20) end do end do end do c c COMPUTE 0TH order slopes c if (slope_order.eq.1) then if (ng .lt. 1) then call bl_abort("FORT_SLOPES: not enough bndry cells for 1st order") end if do k = kmin-1, kmax+1 do j = jmin-1, jmax+1 do i = imin-1, imax+1 slx(i,j,k) = zero sly(i,j,k) = zero slz(i,j,k) = zero end do end do end do return end if c c COMPUTE 2ND order slopes c if (slope_order.eq.2) then if (ng .lt. 2) then call bl_abort("FORT_SLOPES: not enough bndry cells for 2nd order") end if c c ------------------------ x slopes c if ( (dir.eq.XVEL) .or. (dir.eq.ALL) ) then if (use_unlimited_slopes) then do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin-1,imax+1 slx(i,j,k)= half*(s(i+1,j,k) - s(i-1,j,k)) end do end do end do if (bc(1,1) .eq. EXT_DIR .or. bc(1,1) .eq. HOEXTRAP) then do k = kmin-1, kmax+1 do j = jmin-1, jmax+1 slx(imin-1,j,k) = zero slx(imin ,j,k) = (s(imin+1,j,k)+three*s(imin,j,k)-four*s(imin-1,j,k))/three end do end do end if if (bc(1,2) .eq. EXT_DIR .or. bc(1,2) .eq. HOEXTRAP) then do k = kmin-1, kmax+1 do j = jmin-1, jmax+1 slx(imax+1,j,k) = zero slx(imax ,j,k) = -(s(imax-1,j,k)+three*s(imax,j,k)-four*s(imax+1,j,k))/three end do end do end if else do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin-1,imax+1 del = half*(s(i+1,j,k) - s(i-1,j,k)) dpls = two*(s(i+1,j,k) - s(i ,j,k)) dmin = two*(s(i ,j,k) - s(i-1,j,k)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slx(i,j,k)= sflg*min(slim,abs(del)) end do end do end do if (bc(1,1) .eq. EXT_DIR .or. bc(1,1) .eq. HOEXTRAP) then do k = kmin-1, kmax+1 do j = jmin-1, jmax+1 slx(imin-1,j,k) = zero del = (s(imin+1,j,k)+three*s(imin,j,k)-four*s(imin-1,j,k))/three dpls = two*(s(imin+1,j,k) - s(imin ,j,k)) dmin = two*(s(imin ,j,k) - s(imin-1,j,k)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slx(imin,j,k)= sflg*min(slim,abs(del)) end do end do end if if (bc(1,2) .eq. EXT_DIR .or. bc(1,2) .eq. HOEXTRAP) then do k = kmin-1, kmax+1 do j = jmin-1, jmax+1 slx(imax+1,j,k) = zero del = -(s(imax-1,j,k)+three*s(imax,j,k)-four*s(imax+1,j,k))/three dpls = two*(s(imax+1,j,k) - s(imax ,j,k)) dmin = two*(s(imax ,j,k) - s(imax-1,j,k)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slx(imax,j,k)= sflg*min(slim,abs(del)) end do end do end if end if end if c c ------------------------ y slopes c if ( (dir.eq.YVEL) .or. (dir.eq.ALL) ) then if (use_unlimited_slopes) then do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin-1,imax+1 sly(i,j,k) = half*(s(i,j+1,k)-s(i,j-1,k)) end do end do end do if (bc(2,1) .eq. EXT_DIR .or. bc(2,1) .eq. HOEXTRAP) then do k = kmin-1, kmax+1 do i = imin-1, imax+1 sly(i,jmin-1,k) = zero sly(i,jmin ,k) = (s(i,jmin+1,k)+three*s(i,jmin,k)-four*s(i,jmin-1,k))/three end do end do end if if (bc(2,2) .eq. EXT_DIR .or. bc(2,2) .eq. HOEXTRAP) then do k = kmin-1, kmax+1 do i = imin-1, imax+1 sly(i,jmax+1,k) = zero sly(i,jmax ,k) = -(s(i,jmax-1,k)+three*s(i,jmax,k)-four*s(i,jmax+1,k))/three end do end do end if else do j = jmin-1,jmax+1 do k = kmin-1,kmax+1 do i = imin-1,imax+1 del = half*(s(i,j+1,k) - s(i,j-1,k)) dpls = two*(s(i,j+1,k) - s(i,j ,k)) dmin = two*(s(i,j ,k) - s(i,j-1,k)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) sly(i,j,k)= sflg*min(slim,abs(del)) end do end do end do if (bc(2,1) .eq. EXT_DIR .or. bc(2,1) .eq. HOEXTRAP) then do k = kmin-1, kmax+1 do i = imin-1, imax+1 sly(i,jmin-1,k) = zero del = (s(i,jmin+1,k)+three*s(i,jmin,k)-four*s(i,jmin-1,k))/three dpls = two*(s(i,jmin+1,k) - s(i,jmin ,k)) dmin = two*(s(i,jmin ,k) - s(i,jmin-1,k)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) sly(i,jmin,k)= sflg*min(slim,abs(del)) end do end do end if if (bc(2,2) .eq. EXT_DIR .or. bc(2,2) .eq. HOEXTRAP) then do k = kmin-1, kmax+1 do i = imin-1, imax+1 sly(i,jmax+1,k) = zero del = -(s(i,jmax-1,k)+three*s(i,jmax,k)-four*s(i,jmax+1,k))/three dpls = two*(s(i,jmax+1,k) - s(i,jmax ,k)) dmin = two*(s(i,jmax ,k) - s(i,jmax-1,k)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) sly(i,jmax,k)= sflg*min(slim,abs(del)) end do end do end if end if end if c c ------------------------ z slopes c if ( (dir.eq.ZVEL) .or. (dir.eq.ALL) ) then if (use_unlimited_slopes) then do j = jmin-1,jmax+1 do i = imin-1,imax+1 do k = kmin-1,kmax+1 slz(i,j,k) = half*(s(i,j,k+1)-s(i,j,k-1)) end do end do end do if (bc(3,1) .eq. EXT_DIR .or. bc(3,1) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 do i = imin-1, imax+1 slz(i,j,kmin-1) = zero slz(i,j,kmin ) = (s(i,j,kmin+1)+three*s(i,j,kmin)-four*s(i,j,kmin-1))/three end do end do end if if (bc(3,2) .eq. EXT_DIR .or. bc(3,2) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 do i = imin-1, imax+1 slz(i,j,kmax+1) = zero slz(i,j,kmax ) = -(s(i,j,kmax-1)+three*s(i,j,kmax)-four*s(i,j,kmax+1))/three end do end do end if else do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin-1,imax+1 del = half*(s(i,j,k+1) - s(i,j,k-1)) dpls = two*(s(i,j,k+1) - s(i,j,k )) dmin = two*(s(i,j,k ) - s(i,j,k-1)) slim = min(abs(dpls),abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slz(i,j,k)= sflg*min(slim,abs(del)) end do end do end do if (bc(3,1) .eq. EXT_DIR .or. bc(3,1) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 do i = imin-1, imax+1 slz(i,j,kmin-1) = zero del = (s(i,j,kmin+1)+three*s(i,j,kmin)-four*s(i,j,kmin-1))/three dpls = two*(s(i,j,kmin+1) - s(i,j,kmin )) dmin = two*(s(i,j,kmin ) - s(i,j,kmin-1)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slz(i,j,kmin)= sflg*min(slim,abs(del)) end do end do end if if (bc(3,2) .eq. EXT_DIR .or. bc(3,2) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 do i = imin-1, imax+1 slz(i,j,kmax+1) = zero del = -(s(i,j,kmax-1)+three*s(i,j,kmax)-four*s(i,j,kmax+1))/three dpls = two*(s(i,j,kmax+1) - s(i,j,kmax )) dmin = two*(s(i,j,kmax ) - s(i,j,kmax-1)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slz(i,j,kmax)= sflg*min(slim,abs(del)) end do end do end if end if end if c c ... end, if slope_order .eq. 2 c end if c c COMPUTE 4TH order slopes c if (slope_order.eq.4)then if (ng .lt. 3) then call bl_abort("SLOPE_3D: not enough bndry cells for 4th order") end if c c ------------------------ x slopes c if ( (dir.eq.XVEL) .or. (dir.eq.ALL) ) then if (use_unlimited_slopes) then do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin-2,imax+2 slxscr(i,cen) = half*(s(i+1,j,k)-s(i-1,j,k)) end do do i = imin-1,imax+1 slx(i,j,k) = two * two3rd * slxscr(i,cen) - & sixth * (slxscr(i+1,cen) + slxscr(i-1,cen)) end do end do end do if (bc(1,1) .eq. EXT_DIR .or. bc(1,1) .eq. HOEXTRAP) then do k = kmin-1,kmax+1 do j = jmin-1, jmax+1 slx(imin,j,k) = -sixteen/fifteen*s(imin-1,j,k) + half*s(imin,j,k) + & two3rd*s(imin+1,j,k) - tenth*s(imin+2,j,k) slx(imin-1,j,k) = zero end do end do end if if (bc(1,2) .eq. EXT_DIR .or. bc(1,2) .eq. HOEXTRAP) then do k = kmin-1,kmax+1 do j = jmin-1, jmax+1 slx(imax,j,k) = -( -sixteen/fifteen*s(imax+1,j,k) + half*s(imax,j,k) + & two3rd*s(imax-1,j,k) - tenth*s(imax-2,j,k) ) slx(imax+1,j,k) = zero end do end do end if else do k = kmin-1,kmax+1 do j = jmin-1,jmax+1 do i = imin-2,imax+2 dmin = two*(s(i, j,k)-s(i-1,j,k)) dpls = two*(s(i+1,j,k)-s(i, j,k)) slxscr(i,cen) = half*(s(i+1,j,k)-s(i-1,j,k)) slxscr(i,lim) = min(abs(dmin),abs(dpls)) slxscr(i,lim) = cvmgp(slxscr(i,lim),zero,dpls*dmin) slxscr(i,flag) = sign(one,slxscr(i,cen)) slxscr(i,fromm)= slxscr(i,flag)* & min(slxscr(i,lim),abs(slxscr(i,cen))) end do do i = imin-1,imax+1 ds = two * two3rd * slxscr(i,cen) - & sixth * (slxscr(i+1,fromm) + slxscr(i-1,fromm)) slx(i,j,k) = slxscr(i,flag)*min(abs(ds),slxscr(i,lim)) end do if (bc(1,1) .eq. EXT_DIR .or. bc(1,1) .eq. HOEXTRAP) then del = -sixteen/fifteen*s(imin-1,j,k) + half*s(imin,j,k) + & two3rd*s(imin+1,j,k) - tenth*s(imin+2,j,k) dmin = two*(s(imin ,j,k)-s(imin-1,j,k)) dpls = two*(s(imin+1,j,k)-s(imin ,j,k)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slx(imin-1,j,k) = zero slx(imin, j,k) = sflg*min(slim,abs(del)) c Recalculate the slope at imin+1 using the revised slxscr(imin,fromm) slxscr(imin,fromm) = slx(imin,j,k) ds = two * two3rd * slxscr(imin+1,cen) - $ sixth * (slxscr(imin+2,fromm) + slxscr(imin,fromm)) slx(imin+1,j,k) = slxscr(imin+1,flag)*min(abs(ds),slxscr(imin+1,lim)) end if if (bc(1,2) .eq. EXT_DIR .or. bc(1,2) .eq. HOEXTRAP) then del = -( -sixteen/fifteen*s(imax+1,j,k) + half*s(imax,j,k) + & two3rd*s(imax-1,j,k) - tenth*s(imax-2,j,k) ) dmin = two*(s(imax ,j,k)-s(imax-1,j,k)) dpls = two*(s(imax+1,j,k)-s(imax ,j,k)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slx(imax, j,k) = sflg*min(slim,abs(del)) slx(imax+1,j,k) = zero c Recalculate the slope at imax-1 using the revised slxscr(imax,fromm) slxscr(imax,fromm) = slx(imax,j,k) ds = two * two3rd * slxscr(imax-1,cen) - $ sixth * (slxscr(imax-2,fromm) + slxscr(imax,fromm)) slx(imax-1,j,k) = slxscr(imax-1,flag)*min(abs(ds),slxscr(imax-1,lim)) end if end do end do end if end if c c ------------------------ y slopes c if ( (dir.eq.YVEL) .or. (dir.eq.ALL) ) then if (use_unlimited_slopes) then do k = kmin-1,kmax+1 do i = imin-1,imax+1 do j = jmin-2,jmax+2 slyscr(j,cen) = half*(s(i,j+1,k)-s(i,j-1,k)) end do do j = jmin-1,jmax+1 sly(i,j,k) = two * two3rd * slyscr(j,cen) - & sixth * (slyscr(j+1,cen) + slyscr(j-1,cen)) end do end do end do if (bc(2,1) .eq. EXT_DIR .or. bc(2,1) .eq. HOEXTRAP) then do k = kmin-1,kmax+1 do i = imin-1, imax+1 sly(i,jmin-1,k) = zero sly(i,jmin,k) = -sixteen/fifteen*s(i,jmin-1,k) + half*s(i,jmin,k) + & two3rd*s(i,jmin+1,k) - tenth*s(i,jmin+2,k) end do end do end if if (bc(2,2) .eq. EXT_DIR .or. bc(2,2) .eq. HOEXTRAP) then do k = kmin-1,kmax+1 do i = imin-1, imax+1 sly(i,jmax,k) = -( -sixteen/fifteen*s(i,jmax+1,k) + half*s(i,jmax,k) + & two3rd*s(i,jmax-1,k) - tenth*s(i,jmax-2,k) ) sly(i,jmax+1,k) = zero end do end do end if else do k = kmin-1,kmax+1 do i = imin-1,imax+1 do j = jmin-2,jmax+2 dmin = two*(s(i,j, k)-s(i,j-1,k)) dpls = two*(s(i,j+1,k)-s(i,j, k)) slyscr(j,cen) = half*(s(i,j+1,k)-s(i,j-1,k)) slyscr(j,lim) = min(abs(dmin),abs(dpls)) slyscr(j,lim) = cvmgp(slyscr(j,lim),zero,dpls*dmin) slyscr(j,flag) = sign(one,slyscr(j,cen)) slyscr(j,fromm)= slyscr(j,flag)* & min(slyscr(j,lim),abs(slyscr(j,cen))) end do do j = jmin-1,jmax+1 ds = two * two3rd * slyscr(j,cen) - & sixth * (slyscr(j+1,fromm) + slyscr(j-1,fromm)) sly(i,j,k) = slyscr(j,flag)*min(abs(ds),slyscr(j,lim)) end do c if (bc(2,1) .eq. EXT_DIR .or. bc(2,1) .eq. HOEXTRAP) then del = -sixteen/fifteen*s(i,jmin-1,k) + half*s(i,jmin,k) + & two3rd*s(i,jmin+1,k) - tenth*s(i,jmin+2,k) dmin = two*(s(i,jmin ,k)-s(i,jmin-1,k)) dpls = two*(s(i,jmin+1,k)-s(i,jmin ,k)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) sly(i,jmin-1,k) = zero sly(i,jmin, k) = sflg*min(slim,abs(del)) c Recalculate the slope at jmin+1 using the revised slyscr(jmin,fromm) slyscr(jmin,fromm) = sly(i,jmin,k) ds = two * two3rd * slyscr(jmin+1,cen) - $ sixth * (slyscr(jmin+2,fromm) + slyscr(jmin,fromm)) sly(i,jmin+1,k) = slyscr(jmin+1,flag)*min(abs(ds),slyscr(jmin+1,lim)) end if if (bc(2,2) .eq. EXT_DIR .or. bc(2,2) .eq. HOEXTRAP) then del = -( -sixteen/fifteen*s(i,jmax+1,k) + half*s(i,jmax,k) + & two3rd*s(i,jmax-1,k) - tenth*s(i,jmax-2,k) ) dmin = two*(s(i,jmax ,k)-s(i,jmax-1,k)) dpls = two*(s(i,jmax+1,k)-s(i,jmax ,k)) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) sly(i,jmax, k) = sflg*min(slim,abs(del)) sly(i,jmax+1,k) = zero c Recalculate the slope at jmax-1 using the revised slyscr(jmax,fromm) slyscr(jmax,fromm) = sly(i,jmax,k) ds = two * two3rd * slyscr(jmax-1,cen) - $ sixth * (slyscr(jmax-2,fromm) + slyscr(jmax,fromm)) sly(i,jmax-1,k) = slyscr(jmax-1,flag)*min(abs(ds),slyscr(jmax-1,lim)) end if end do end do end if end if c c ------------------------ z slopes c if ( (dir.eq.ZVEL) .or. (dir.eq.ALL) ) then if (use_unlimited_slopes) then do j = jmin-1,jmax+1 do i = imin-1,imax+1 do k = kmin-2,kmax+2 slzscr(k,cen) = half*(s(i,j,k+1)-s(i,j,k-1)) end do do k = kmin-1,kmax+1 slz(i,j,k) = two * two3rd * slzscr(k,cen) - & sixth * (slzscr(k+1,cen) + slzscr(k-1,cen)) end do end do end do if (bc(3,1) .eq. EXT_DIR .or. bc(3,1) .eq. HOEXTRAP) then do i = imin-1, imax+1 do j = jmin-1, jmax+1 slz(i,j,kmin-1) = zero slz(i,j,kmin) = -sixteen/fifteen*s(i,j,kmin-1) + half*s(i,j,kmin) + & two3rd*s(i,j,kmin+1) - tenth*s(i,j,kmin+2) end do end do end if if (bc(3,2) .eq. EXT_DIR .or. bc(3,2) .eq. HOEXTRAP) then do j = jmin-1, jmax+1 do i = imin-1, imax+1 slz(i,j,kmax) = -( -sixteen/fifteen*s(i,j,kmax+1) + half*s(i,j,kmax) + & two3rd*s(i,j,kmax-1) - tenth*s(i,j,kmax-2) ) slz(i,j,kmax+1) = zero end do end do end if else do j = jmin-1,jmax+1 do i = imin-1,imax+1 do k = kmin-2,kmax+2 dmin = two*(s(i,j,k )-s(i,j,k-1)) dpls = two*(s(i,j,k+1)-s(i,j,k )) slzscr(k,cen) = half*(s(i,j,k+1)-s(i,j,k-1)) slzscr(k,lim) = min(abs(dmin),abs(dpls)) slzscr(k,lim) = cvmgp(slzscr(k,lim),zero,dpls*dmin) slzscr(k,flag) = sign(one,slzscr(k,cen)) slzscr(k,fromm)= slzscr(k,flag)* & min(slzscr(k,lim),abs(slzscr(k,cen))) end do do k = kmin-1,kmax+1 ds = two * two3rd * slzscr(k,cen) - & sixth * (slzscr(k+1,fromm) + slzscr(k-1,fromm)) slz(i,j,k) = slzscr(k,flag)*min(abs(ds),slzscr(k,lim)) end do c if (bc(3,1) .eq. EXT_DIR .or. bc(3,1) .eq. HOEXTRAP) then del = -sixteen/fifteen*s(i,j,kmin-1) + half*s(i,j,kmin) + & two3rd*s(i,j,kmin+1) - tenth*s(i,j,kmin+2) dmin = two*(s(i,j,kmin )-s(i,j,kmin-1)) dpls = two*(s(i,j,kmin+1)-s(i,j,kmin )) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slz(i,j,kmin-1) = zero slz(i,j,kmin ) = sflg*min(slim,abs(del)) c Recalculate the slope at jmin+1 using the revised slzscr(kmin,fromm) slzscr(kmin,fromm) = slz(i,j,kmin) ds = two * two3rd * slzscr(kmin+1,cen) - $ sixth * (slzscr(kmin+2,fromm) + slzscr(kmin,fromm)) slz(i,j,kmin+1) = slzscr(kmin+1,flag)*min(abs(ds),slzscr(kmin+1,lim)) end if if (bc(3,2) .eq. EXT_DIR .or. bc(3,2) .eq. HOEXTRAP) then del = sixteen/fifteen*s(i,j,kmax+1) - half*s(i,j,kmax) & - two3rd*s(i,j,kmax-1) + tenth*s(i,j,kmax-2) dmin = two*(s(i,j,kmax )-s(i,j,kmax-1)) dpls = two*(s(i,j,kmax+1)-s(i,j,kmax )) slim = min(abs(dpls), abs(dmin)) slim = cvmgp(slim, zero, dpls*dmin) sflg = sign(one,del) slz(i,j,kmax ) = sflg*min(slim,abs(del)) slz(i,j,kmax+1) = zero c Recalculate the slope at jmax-1 using the revised slzscr(kmax,fromm) slzscr(kmax,fromm) = slz(i,j,kmax) ds = two * two3rd * slzscr(kmax-1,cen) - $ sixth * (slzscr(kmax-2,fromm) + slzscr(kmax,fromm)) slz(i,j,kmax-1) = slzscr(kmax-1,flag)*min(abs(ds),slzscr(kmax-1,lim)) end if end do end do end if end if c c ... end, if slope_order .eq. 4 c end if end subroutine FORT_SCALMINMAX(s,DIMS(s),sn,DIMS(sn), & smin,smax,DIMS(smin), & lo,hi,bc) c c correct an advected field for under/over shoots c integer i, j, k, imin, imax, jmin, jmax, kmin, kmax integer DIMDEC(s) integer DIMDEC(sn) integer DIMDEC(smin) integer lo(SDIM), hi(SDIM) integer bc(SDIM,2), do_minmax REAL_T s(DIMV(s)) REAL_T sn(DIMV(sn)) integer km, kk, kp REAL_T smn, smx REAL_T smin(DIM12(smin),0:2) REAL_T smax(DIM12(smin),0:2) imin = lo(1) imax = hi(1) jmin = lo(2) jmax = hi(2) kmin = lo(3) kmax = hi(3) c c correct the 8 corners c if (bc(1,1).ne.INT_DIR .or. bc(2,1).ne.INT_DIR .or. bc(3,1).ne.INT_DIR) then s(imin-1,jmin-1,kmin-1) = s(imin,jmin,kmin) end if if (bc(1,2).ne.INT_DIR .or. bc(2,1).ne.INT_DIR .or. bc(3,1).ne.INT_DIR) then s(imax+1,jmin-1,kmin-1) = s(imax,jmin,kmin) end if if (bc(1,1).ne.INT_DIR .or. bc(2,2).ne.INT_DIR .or. bc(3,1).ne.INT_DIR) then s(imin-1,jmax+1,kmin-1) = s(imin,jmax,kmin) end if if (bc(1,2).ne.INT_DIR .or. bc(2,2).ne.INT_DIR .or. bc(3,1).ne.INT_DIR) then s(imax+1,jmax+1,kmin-1) = s(imax,jmax,kmin) end if if (bc(1,1).ne.INT_DIR .or. bc(2,1).ne.INT_DIR .or. bc(3,2).ne.INT_DIR) then s(imin-1,jmin-1,kmax+1) = s(imin,jmin,kmax) end if if (bc(1,2).ne.INT_DIR .or. bc(2,1).ne.INT_DIR .or. bc(3,2).ne.INT_DIR) then s(imax+1,jmin-1,kmax+1) = s(imax,jmin,kmax) end if if (bc(1,1).ne.INT_DIR .or. bc(2,2).ne.INT_DIR .or. bc(3,2).ne.INT_DIR) then s(imin-1,jmax+1,kmax+1) = s(imin,jmax,kmax) end if if (bc(1,2).ne.INT_DIR .or. bc(2,2).ne.INT_DIR .or. bc(3,2).ne.INT_DIR) then s(imax+1,jmax+1,kmax+1) = s(imax,jmax,kmax) end if c c correct the 12 edges c if (bc(1,1).ne.INT_DIR .or. bc(2,1).ne.INT_DIR) then do k = kmin,kmax s(imin-1,jmin-1,k) = s(imin,jmin,k) end do end if if (bc(1,1).ne.INT_DIR .or. bc(2,1).ne.INT_DIR) then do k = kmin,kmax s(imax+1,jmin-1,k) = s(imax,jmin,k) end do end if if (bc(1,1).ne.INT_DIR .or. bc(2,2).ne.INT_DIR) then do k = kmin,kmax s(imin-1,jmax+1,k) = s(imin,jmax,k) end do end if if (bc(1,2).ne.INT_DIR .or. bc(2,2).ne.INT_DIR) then do k = kmin,kmax s(imax+1,jmax+1,k) = s(imax,jmax,k) end do end if if (bc(1,1).ne.INT_DIR .or. bc(3,1).ne.INT_DIR) then do j = jmin,jmax s(imin-1,j,kmin-1) = s(imin,j,kmin) end do end if if (bc(1,2).ne.INT_DIR .or. bc(3,1).ne.INT_DIR) then do j = jmin,jmax s(imax+1,j,kmin-1) = s(imax,j,kmin) end do end if if (bc(1,1).ne.INT_DIR .or. bc(3,2).ne.INT_DIR) then do j = jmin,jmax s(imin-1,j,kmax+1) = s(imin,j,kmax) end do end if if (bc(1,2).ne.INT_DIR .or. bc(3,2).ne.INT_DIR) then do j = jmin,jmax s(imax+1,j,kmax+1) = s(imax,j,kmax) end do end if if (bc(2,1).ne.INT_DIR .or. bc(3,1).ne.INT_DIR) then do i = imin,imax s(i,jmin-1,kmin-1) = s(i,jmin,kmin) end do end if if (bc(2,2).ne.INT_DIR .or. bc(3,1).ne.INT_DIR) then do i = imin,imax s(i,jmax+1,kmin-1) = s(i,jmax,kmin) end do end if if (bc(2,1).ne.INT_DIR .or. bc(3,2).ne.INT_DIR) then do i = imin,imax s(i,jmin-1,kmax+1) = s(i,jmin,kmax) end do end if if (bc(2,2).ne.INT_DIR .or. bc(3,2).ne.INT_DIR) then do i = imin,imax s(i,jmax+1,kmax+1) = s(i,jmax,kmax) end do end if c c ::::: compute min/max a slab at a time c ::::: compute min and max of neighbors on kmin-1 slab c km = 0 kk = 1 kp = 2 k = kmin-1 do j = jmin, jmax do i = imin, imax smin(i,j,km) = min(s(i-1,j-1,k),s(i,j-1,k),s(i+1,j-1,k), & s(i-1,j ,k),s(i,j ,k),s(i+1,j ,k), & s(i-1,j+1,k),s(i,j+1,k),s(i+1,j+1,k)) smax(i,j,km) = max(s(i-1,j-1,k),s(i,j-1,k),s(i+1,j-1,k), & s(i-1,j ,k),s(i,j ,k),s(i+1,j ,k), & s(i-1,j+1,k),s(i,j+1,k),s(i+1,j+1,k)) end do end do c c ::::: compute min and max of neighbors on kmin slab c k = kmin do j = jmin, jmax do i = imin, imax smin(i,j,kk) = min(s(i-1,j-1,k),s(i,j-1,k),s(i+1,j-1,k), & s(i-1,j ,k),s(i,j ,k),s(i+1,j ,k), & s(i-1,j+1,k),s(i,j+1,k),s(i+1,j+1,k)) smax(i,j,kk) = max(s(i-1,j-1,k),s(i,j-1,k),s(i+1,j-1,k), & s(i-1,j ,k),s(i,j ,k),s(i+1,j ,k), & s(i-1,j+1,k),s(i,j+1,k),s(i+1,j+1,k)) end do end do do k = kmin, kmax c c ::::: compute min and max of neighbors on k+1 slab c do j = jmin, jmax do i = imin, imax smin(i,j,kp) = min(s(i-1,j-1,k+1),s(i,j-1,k+1),s(i+1,j-1,k+1), & s(i-1,j ,k+1),s(i,j ,k+1),s(i+1,j ,k+1), & s(i-1,j+1,k+1),s(i,j+1,k+1),s(i+1,j+1,k+1)) smax(i,j,kp) = max(s(i-1,j-1,k+1),s(i,j-1,k+1),s(i+1,j-1,k+1), & s(i-1,j ,k+1),s(i,j ,k+1),s(i+1,j ,k+1), & s(i-1,j+1,k+1),s(i,j+1,k+1),s(i+1,j+1,k+1)) c c ::::: compute min/max of cell c smn = min(smin(i,j,km),smin(i,j,kk),smin(i,j,kp)) smx = max(smax(i,j,km),smax(i,j,kk),smax(i,j,kp)) sn(i,j,k) = max(sn(i,j,k),smn) sn(i,j,k) = min(sn(i,j,k),smx) end do end do c c ::::: roll indices for next slab c km = mod(km+1,3) kk = mod(kk+1,3) kp = mod(kp+1,3) end do end subroutine FORT_SUM_TF_GP( & tforces,DIMS(tf), & gp,DIMS(gp), & rho,DIMS(rho), & lo,hi ) c c sum pressure forcing into tforces c integer i, j, k, n integer DIMDEC(tf) integer DIMDEC(visc) integer DIMDEC(gp) integer DIMDEC(rho) integer lo(SDIM), hi(SDIM) REAL_T tforces(DIMV(tf),SDIM) REAL_T gp(DIMV(gp),SDIM) REAL_T rho(DIMV(rho)) do n = 1, SDIM do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,k,n) = ( & tforces(i,j,k,n) - gp(i,j,k,n) & )/rho(i,j,k) end do end do end do end do end subroutine FORT_SUM_TF_GP_VISC( & tforces,DIMS(tf), & visc,DIMS(visc), & gp,DIMS(gp), & rho,DIMS(rho), & lo,hi ) c c sum pressure forcing and viscous forcing into c tforces c integer i, j, k, n integer DIMDEC(tf) integer DIMDEC(visc) integer DIMDEC(gp) integer DIMDEC(rho) integer lo(SDIM), hi(SDIM) REAL_T tforces(DIMV(tf),SDIM) REAL_T visc(DIMV(visc),SDIM) REAL_T gp(DIMV(gp),SDIM) REAL_T rho(DIMV(rho)) do n = 1, SDIM do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,k,n) = ( & tforces(i,j,k,n) & + visc(i,j,k,n) & - gp(i,j,k,n) )/rho(i,j,k) end do end do end do end do end subroutine FORT_SUM_TF_DIVU( & S,DIMS(S), & tforces,DIMS(tf), & divu,DIMS(divu), & rho,DIMS(rho), & lo,hi,nvar,iconserv ) c c sum tforces, viscous forcing and divU*S into tforces c depending on the value of iconserv c integer nvar, iconserv integer lo(SDIM), hi(SDIM) integer i, j, k, n integer DIMDEC(S) integer DIMDEC(tf) integer DIMDEC(divu) integer DIMDEC(rho) REAL_T S(DIMV(S),nvar) REAL_T tforces(DIMV(tf),nvar) REAL_T divu(DIMV(divu)) REAL_T rho(DIMV(rho)) if ( iconserv .eq. 1 ) then do n = 1, nvar do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,k,n) = & tforces(i,j,k,n) - S(i,j,k,n)*divu(i,j,k) end do end do end do end do else do n = 1, nvar do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,k,n) = & tforces(i,j,k,n)/rho(i,j,k) end do end do end do end do end if end subroutine FORT_SUM_TF_DIVU_VISC( & S,DIMS(S), & tforces,DIMS(tf), & divu,DIMS(divu), & visc,DIMS(visc), & rho,DIMS(rho), & lo,hi,nvar,iconserv ) c c sum tforces, viscous forcing and divU*S into tforces c depending on the value of iconserv c integer nvar, iconserv integer lo(SDIM), hi(SDIM) integer i, j, k, n integer DIMDEC(S) integer DIMDEC(tf) integer DIMDEC(divu) integer DIMDEC(visc) integer DIMDEC(rho) REAL_T S(DIMV(S),nvar) REAL_T tforces(DIMV(tf),nvar) REAL_T divu(DIMV(divu)) REAL_T visc(DIMV(visc),nvar) REAL_T rho(DIMV(rho)) if ( iconserv .eq. 1 ) then do n = 1, nvar do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,k,n) = & tforces(i,j,k,n) & + visc(i,j,k,n) & - S(i,j,k,n)*divu(i,j,k) end do end do end do end do else do n = 1, nvar do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) tforces(i,j,k,n) = ( & tforces(i,j,k,n) & + visc(i,j,k,n) )/rho(i,j,k) end do end do end do end do end if end subroutine FORT_UPDATE_TF( & s, DIMS(s), & sn, DIMS(sn), & tforces, DIMS(tf), & lo,hi,dt,nvar) c c update a field with a forcing term c integer i, j, k, n, nvar integer DIMDEC(s) integer DIMDEC(sn) integer DIMDEC(tf) integer lo(SDIM), hi(SDIM) REAL_T dt REAL_T s(DIMV(s),nvar) REAL_T sn(DIMV(sn),nvar) REAL_T tforces(DIMV(tf),nvar) do n = 1,nvar do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) sn(i,j,k,n) = s(i,j,k,n) & + dt*tforces(i,j,k,n) end do end do end do end do end subroutine FORT_CORRECT_TF( & ss, sp, DIMS(ss), & tfs, tfn, DIMS(tfs), & lo,hi,dt,nvar) c c correct 1st order rk to second-order c integer i, j, k, n, nvar integer lo(SDIM), hi(SDIM) REAL_T dt,hdt integer DIMDEC(ss) integer DIMDEC(tfs) REAL_T ss(DIMV(ss),nvar) REAL_T sp(DIMV(ss),nvar) REAL_T tfs(DIMV(tfs),nvar) REAL_T tfn(DIMV(tfs),nvar) hdt = half*dt do n = 1,nvar do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) sp(i,j,k,n) = ss(i,j,k,n) & + hdt*(tfs(i,j,k,n)-tfn(i,j,k,n)) end do end do end do end do end subroutine FORT_UPDATE_AOFS_TF( & s, DIMS(s), & sn, DIMS(sn), & aofs, DIMS(aofs), & tforces, DIMS(tf), & lo,hi,dt,nvar) c c update a field with an advective tendency c and a forcing term c integer i, j, k, n, nvar integer DIMDEC(s) integer DIMDEC(sn) integer DIMDEC(aofs) integer DIMDEC(tf) integer lo(SDIM), hi(SDIM) REAL_T dt REAL_T s(DIMV(s),nvar) REAL_T sn(DIMV(sn),nvar) REAL_T aofs(DIMV(aofs),nvar) REAL_T tforces(DIMV(tf),nvar) do n = 1,nvar do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) sn(i,j,k,n) = s(i,j,k,n) & - dt*aofs(i,j,k,n) & + dt*tforces(i,j,k,n) end do end do end do end do end subroutine FORT_UPDATE_AOFS_TF_GP( & u, DIMS(u), & un, DIMS(un), & aofs, DIMS(aofs), & tforces, DIMS(tf), & gp, DIMS(gp), & rho, DIMS(rho), & lo, hi, dt) c c update the velocities c integer i, j, k, n integer DIMDEC(u) integer DIMDEC(un) integer DIMDEC(aofs) integer DIMDEC(rho) integer DIMDEC(gp) integer DIMDEC(tf) integer lo(SDIM), hi(SDIM) REAL_T u(DIMV(u),SDIM) REAL_T un(DIMV(un),SDIM) REAL_T aofs(DIMV(aofs),SDIM) REAL_T rho(DIMV(rho)) REAL_T gp(DIMV(gp),SDIM) REAL_T tforces(DIMV(tf),SDIM) REAL_T dt do n = 1, SDIM do k = lo(3), hi(3) do j = lo(2), hi(2) do i = lo(1), hi(1) un(i,j,k,n) = u(i,j,k,n) & - dt* aofs(i,j,k,n) & + dt*tforces(i,j,k,n)/rho(i,j,k) & - dt* gp(i,j,k,n)/rho(i,j,k) end do end do end do end do end ccseapps-2.5/CCSEApps/iamrlib/NAVIERSTOKES_2D.F0000644000175000017500000004151411634153073021654 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: NAVIERSTOKES_2D.F,v 1.14 2003/01/30 07:16:29 almgren Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "NAVIERSTOKES_F.H" #include "ArrayLim.H" #define SDIM 2 subroutine FORT_GRADP ( & p,DIMS(p), & gp,DIMS(gp), & lo,hi,dx,is_full) c c Compute a cell centered gradient from a node c centered field. Returns all components of GRADP c integer DIMDEC(p) integer DIMDEC(gp) integer lo(SDIM), hi(SDIM) REAL_T dx(SDIM) REAL_T p(DIMV(p)) REAL_T gp(DIMV(gp),SDIM) integer is_full integer i,j REAL_T ddx, ddy ddx = half/dx(1) ddy = half/dx(2) if (is_full .eq. 0) then do j = lo(2), hi(2) do i = lo(1), hi(1) gp(i,j,1) = ddx*(p(i+1,j)-p(i,j)+p(i+1,j+1)-p(i,j+1)) gp(i,j,2) = ddy*(p(i,j+1)-p(i,j)+p(i+1,j+1)-p(i+1,j)) end do end do else do j = lo(2), hi(2) do i = lo(1), hi(1) gp(i,j,1) = (p(i+1,j)-p(i,j)+p(i+1,j+1)-p(i,j+1)) gp(i,j,2) = (p(i,j+1)-p(i,j)+p(i+1,j+1)-p(i+1,j)) end do end do endif end subroutine FORT_AVGDOWN ( & crse,DIMS(crse),nvar, & fine,DIMS(fine), & cv,DIMS(cv), & fv,DIMS(fv), & lo,hi,ratios) c ---------------------------------------------------------- c Volume-weight average the fine grid data onto the coarse c grid. Overlap is given in coarse grid coordinates. c c crse = coarse grid data c nvar = number of components in arrays c fine = fine grid data c cv = coarse grid volume array c fv = fine grid volume array c lo,hi = index limits of overlap (crse grid) c ratios = IntVect refinement ratio c ---------------------------------------------------------- integer DIMDEC(crse) integer DIMDEC(cv) integer DIMDEC(fine) integer DIMDEC(fv) integer lo(SDIM), hi(SDIM) integer nvar integer ratios(SDIM) REAL_T crse(DIMV(crse),nvar) REAL_T cv(DIMV(cv)) REAL_T fine(DIMV(fine),nvar) REAL_T fv(DIMV(fv)) integer i, j, n, ic, jc, ioff, joff integer lratx,lraty lratx = ratios(1) lraty = ratios(2) do n = 1, nvar c c set coarse grid to zero on overlap c do jc = lo(2), hi(2) do ic = lo(1), hi(1) crse(ic,jc,n) = zero end do end do c c sum fine data c do joff = 0, lraty-1 do jc = lo(2), hi(2) j = jc*lraty + joff do ioff = 0, lratx-1 do ic = lo(1), hi(1) i = ic*lratx + ioff crse(ic,jc,n) = crse(ic,jc,n) + & fv(i,j)*fine(i,j,n) end do end do end do end do c c divide out by volume weight c do ic = lo(1), hi(1) do jc = lo(2), hi(2) crse(ic,jc,n) = crse(ic,jc,n)/cv(ic,jc) end do end do end do end subroutine FORT_TESTINJECT( & crse,DIMS(crse), & fine,DIMS(fine),lo,hi,ratios) c c test for consistency of pressure nodes c integer DIMDEC(crse) integer DIMDEC(fine) integer lo(2), hi(2) integer ratios(2) REAL_T crse(DIMV(crse)) REAL_T fine(DIMV(fine)) REAL_T diff integer ic, jc integer lratx, lraty lratx = ratios(1) lraty = ratios(2) diff = zero do jc = lo(2), hi(2) do ic = lo(1), hi(1) diff = max(diff,abs(crse(ic,jc)-fine(lratx*ic,lraty*jc))) end do end do if ( diff .gt. 1.0D-10 ) then call bl_abort('mismatch between fine and coarse nodes') end if end c :: ---------------------------------------------------------- c :: Replace coarse grid pressure data with corresponding c :: fine grid pressure data. c :: c :: INPUTS / OUTPUTS: c :: crse <= coarse grid data c :: DIMS(crse) => index limits of crse c :: fine => fine grid data c :: DIMS(fine) => index limits of fine c :: lo,hi => index limits of overlap (crse grid) c :: ratios => IntVect refinement ratio c :: c :: NOTE: c :: Assumes pressure fields are node based c :: ---------------------------------------------------------- c :: subroutine FORT_PUTDOWN (crse,DIMS(crse), & fine,DIMS(fine),lo,hi,ratios) integer DIMDEC(crse) integer DIMDEC(fine) integer lo(2), hi(2) integer ratios(2) REAL_T crse(DIMV(crse)) REAL_T fine(DIMV(fine)) integer ic, jc integer lratx, lraty lratx = ratios(1) lraty = ratios(2) do jc = lo(2), hi(2) do ic = lo(1), hi(1) crse(ic,jc) = fine(lratx*ic,lraty*jc) end do end do end c :: ---------------------------------------------------------- c :: UTILITY ROUTINE: compute: c :: A += alpha*B on subrange c :: c :: INPUTS / OUTPUTS: c :: a <= output array c :: b => input array c :: DIMS(a) => index limits of a array c :: DIMS(b) => index limits of a array c :: lo,hi => index limits of update region c :: alpha => multiplicative factor c :: ---------------------------------------------------------- c :: subroutine FORT_INCRMULT(a,DIMS(a),b,DIMS(b),lo,hi,alpha) integer DIMDEC(a) integer DIMDEC(b) integer lo(2), hi(2) REAL_T alpha REAL_T a(DIMV(a)) REAL_T b(DIMV(b)) integer i, j do j = lo(2), hi(2) do i = lo(1), hi(1) a(i,j) = a(i,j) + alpha*b(i,j) end do end do end c :: ---------------------------------------------------------- c :: SUMMASS c :: MASS = sum{ vol(i,j)*rho(i,j) } c :: c :: INPUTS / OUTPUTS: c :: rho => density field c :: DIMS(rho) => index limits of rho aray c :: lo,hi => index limits of grid interior c :: dx => cell size c :: mass <= total mass c :: r => radius at cell center c :: irlo,hi => index limits of r array c :: rz_flag => == 1 if R_Z coords c :: tmp => temp column array c :: ---------------------------------------------------------- c :: subroutine FORT_SUMMASS(rho,DIMS(rho),DIMS(grid),dx,mass, & r,irlo,irhi,rz_flag,tmp) integer irlo, irhi, rz_flag integer DIMDEC(rho) integer DIMDEC(grid) REAL_T mass, dx(2) REAL_T rho(DIMV(rho)) REAL_T r(irlo:irhi) REAL_T tmp(DIM2(grid)) integer i, j REAL_T dr, dz, vol dr = dx(1) dz = dx(2) do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = zero end do do i = ARG_L1(grid), ARG_H1(grid) vol = dr*dz if (rz_flag .eq. 1) vol = vol*two*Pi*r(i) do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = tmp(j) + vol*rho(i,j) end do end do mass = zero do j = ARG_L2(grid), ARG_H2(grid) mass = mass + tmp(j) end do end c :: ---------------------------------------------------------- c :: SUMMASSSQ c :: MASS = sum{ vol(i,j)*rho(i,j)*rho(i,j) } c :: c :: INPUTS / OUTPUTS: c :: rho => density field c :: DIMS(rho) => index limits of rho aray c :: lo,hi => index limits of grid interior c :: ds => cell size c :: mass <= total mass c :: r => radius at cell center c :: irlo,hi => index limits of r array c :: rz_flag => == 1 if R_Z coords c :: tmp => temp column array c :: ---------------------------------------------------------- c :: subroutine FORT_SUMMASSSQ(rho,DIMS(rho),DIMS(grid),dx,mass, & r,irlo,irhi,rz_flag,tmp) integer irlo, irhi, rz_flag integer DIMDEC(rho) integer DIMDEC(grid) REAL_T mass, dx(SDIM) REAL_T rho(DIMV(rho)) REAL_T r(irlo:irhi) REAL_T tmp(DIM2(grid)) integer i, j REAL_T dr, dz, vol dr = dx(1) dz = dx(2) do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = zero end do do i = ARG_L1(grid), ARG_H1(grid) vol = dr*dz if (rz_flag .eq. 1) vol = vol*two*Pi*r(i) do j = ARG_L2(grid), ARG_H2(grid) tmp(j) = tmp(j) + vol*rho(i,j)*rho(i,j) end do end do mass = zero do j = ARG_L2(grid), ARG_H2(grid) mass = mass + tmp(j) end do end c :: ---------------------------------------------------------- c :: SUMPRESS c :: SUM = sum{ press(i,j) * surroundingVolume(i,j) } c :: c :: INPUTS / OUTPUTS: c :: press => pressure field on nodes c :: DIMS(press)=> index limits of press aray c :: vol => volume field (zero-ed out under finer grids) c :: DIMS(vol) => index limits of vol aray c :: lo,hi => index limits of grid interior in nodal space c :: total_press<= sum of volume-weighted nodal pressures c :: total_vol <= sum of volumes c :: ---------------------------------------------------------- c :: subroutine FORT_SUMPRESS(press,DIMS(press),vol,DIMS(vol),lo,hi, $ total_press,total_vol) integer lo(2),hi(2) integer DIMDEC(press) integer DIMDEC(vol) REAL_T press(DIMV(press)) REAL_T vol(DIMV(vol)) REAL_T total_press,total_vol integer i, j REAL_T surroundingVolume do j = lo(2),hi(2) do i = lo(1),hi(1) surroundingVolume = vol(i,j) + vol(i-1,j) + vol(i,j-1) + vol(i-1,j-1) total_press = total_press + press(i,j) * surroundingVolume total_vol = total_vol + surroundingVolume end do end do end c :: c :: ---------------------------------------------------------- c :: This routine fills an edge-centered fab from a cell-centered c :: fab using simple linear interpolation. c :: c :: INPUTS / OUTPUTS: c :: lo,hi => index limits of the of the cell-centered fab c :: DIMS(cfab) => index limits of the cell-centered fab c :: cfab => cell-centered data c :: DIMS(efab) => index limits of the edge-centered fab c :: efab => edge-centered fab to fill c :: nc => Number of components in the fab to fill c :: dir => direction data needs to be shifted to get to edges c :: ---------------------------------------------------------- c :: subroutine FORT_CEN2EDG(lo, hi, & DIMS(cfab), cfab, & DIMS(efab), efab, nc, dir, & isharm) integer lo(SDIM), hi(SDIM), nc, dir, isharm integer DIMDEC(cfab) integer DIMDEC(efab) REAL_T cfab(DIMV(cfab), nc) REAL_T efab(DIMV(efab), nc) integer i,j,n if ( isharm .eq. 0 ) then if (dir .EQ. 0) then do n = 1,nc do j = lo(2), hi(2) do i = lo(1)+1, hi(1) efab(i,j,n) = half*(cfab(i,j,n) + cfab(i-1,j,n)) end do end do end do else do n = 1,nc do j = lo(2)+1, hi(2) do i = lo(1), hi(1) efab(i,j,n) = half*(cfab(i,j,n) + cfab(i,j-1,n)) end do end do end do end if else if (dir .EQ. 0) then do n = 1,nc do j = lo(2), hi(2) do i = lo(1)+1, hi(1) if((cfab(i,j,n) * cfab(i-1,j,n)).gt.0.d0)then efab(i,j,n) & = 2.d0*(cfab(i,j,n) * cfab(i-1,j,n))/ & (cfab(i,j,n) + cfab(i-1,j,n)) else efab(i,j,n)=0.d0 endif end do end do end do else do n = 1,nc do j = lo(2)+1, hi(2) do i = lo(1), hi(1) if((cfab(i,j,n) * cfab(i,j-1,n)).gt.0.d0)then efab(i,j,n) & = 2.d0*(cfab(i,j,n) * cfab(i,j-1,n))/ & (cfab(i,j,n) + cfab(i,j-1,n)) else efab(i,j,n)=0.d0 endif end do end do end do end if end if end c----------------------------------------------------------------------- subroutine EDGE_INTERP(flo, fhi, nc, ratio, dir, & fine, fine_l0, fine_l1, fine_h0, fine_h1) implicit none integer flo(0:2-1), fhi(0:2-1), nc, ratio(0:2-1), dir integer fine_l0, fine_l1, fine_h0, fine_h1 DOUBLE PRECISION fine(fine_l0:fine_h0,fine_l1:fine_h1,nc) integer i,j,ii,jj,n,P,M,clo(0:2-1),chi(0:2-1) DOUBLE PRECISION val, df c Do linear in dir, pc transverse to dir, leave alone the fine values c lining up with coarse edges--assume these have been set to hold the c values you want to interpolate to the rest. if (dir.eq.0) then do n=1,nc do j=flo(1),fhi(1),ratio(1) do i=flo(0),fhi(0)-ratio(dir),ratio(0) df = fine(i+ratio(dir),j,n)-fine(i,j,n) do M=1,ratio(dir)-1 val = fine(i,j,n) + df*dble(M)/dble(ratio(dir)) do P=MAX(j,flo(1)),MIN(j+ratio(1)-1,fhi(1)) fine(i+M,P,n) = val enddo enddo enddo enddo enddo else do n=1,nc do j=flo(1),fhi(1)-ratio(dir),ratio(1) do i=flo(0),fhi(0) df = fine(i,j+ratio(dir),n)-fine(i,j,n) do M=1,ratio(dir)-1 val = fine(i,j,n) + df*dble(M)/dble(ratio(dir)) do P=MAX(i,flo(0)),MIN(i+ratio(0)-1,fhi(0)) fine(P,j+M,n) = val enddo enddo enddo enddo enddo endif end c----------------------------------------------------------------------- subroutine PC_EDGE_INTERP(lo, hi, nc, ratio, dir, & crse, crse_l0, crse_l1, crse_h0, crse_h1, & fine, fine_l0, fine_l1, fine_h0, fine_h1) implicit none integer lo(2),hi(2), nc, ratio(0:2-1), dir integer crse_l0, crse_l1, crse_h0, crse_h1 integer fine_l0, fine_l1, fine_h0, fine_h1 DOUBLE PRECISION crse(crse_l0:crse_h0,crse_l1:crse_h1,nc) DOUBLE PRECISION fine(fine_l0:fine_h0,fine_l1:fine_h1,nc) integer i,j,ii,jj,n,L DOUBLE PRECISION val, dc c For edge-based data, fill fine values with piecewise-constant interp of coarse data. c Operate only on faces that overlap--ie, only fill the fine faces that make up each c coarse face, leave the in-between faces alone. if (dir.eq.0) then do n=1,nc do j=lo(2),hi(2) jj = ratio(1)*j do i=lo(1),hi(1) ii = ratio(0)*i do L=0,ratio(1)-1 fine(ii,jj+L,n) = crse(i,j,n) enddo enddo enddo enddo else do n=1,nc do j=lo(2),hi(2) jj = ratio(1)*j do i=lo(1),hi(1) ii = ratio(0)*i do L=0,ratio(0)-1 fine(ii+L,jj,n) = crse(i,j,n) enddo enddo enddo enddo endif end ccseapps-2.5/CCSEApps/iamrlib/PROJECTION_F.H0000644000175000017500000001342711634153073021337 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _PROJECTION_F_H_ #define _PROJECTION_F_H_ /* ** $Id: PROJECTION_F.H,v 1.17 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_FILTERP filterp # define FORT_VEL_TO_ACCEL veltoaccel # define FORT_ACCEL_TO_VEL acceltovel # define FORT_PROJ_UPDATE projupdate # define FORT_RADMPY radmpy # define FORT_RADDIV raddiv # define FORT_HGC2N hgc2n # define FORT_HGN2C hgn2c # define FORT_FILTRHS filtrhs #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_FILTERP FILTERP # define FORT_VEL_TO_ACCEL VELTOACCEL # define FORT_ACCEL_TO_VEL ACCELTOVEL # define FORT_PROJ_UPDATE PROJUPDATE # define FORT_RADMPY RADMPY # define FORT_RADDIV RADDIV # define FORT_HGC2N HGC2N # define FORT_HGN2C HGN2C # define FORT_FILTRHS FILTRHS # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_FILTERP filterp # define FORT_VEL_TO_ACCEL veltoaccel # define FORT_ACCEL_TO_VEL acceltovel # define FORT_PROJ_UPDATE projupdate # define FORT_RADMPY radmpy # define FORT_RADDIV raddiv # define FORT_HGC2N hgc2n # define FORT_HGN2C hgn2c # define FORT_FILTRHS filtrhs # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_FILTERP filterp_ # define FORT_VEL_TO_ACCEL veltoaccel_ # define FORT_ACCEL_TO_VEL acceltovel_ # define FORT_PROJ_UPDATE projupdate_ # define FORT_RADMPY radmpy_ # define FORT_RADDIV raddiv_ # define FORT_HGC2N hgc2n_ # define FORT_HGN2C hgn2c_ # define FORT_FILTRHS filtrhs_ # endif #include extern "C" { void FORT_FILTERP(Real * pnew, Real * scratch, ARLIM_P(p_lo), ARLIM_P(p_hi), const int* lo, const int* hi, const Real * dx, const Real * fac, #if (BL_SPACEDIM == 2) const int * wrap_around_x, const int * wrap_around_y); #elif (BL_SPACEDIM == 3) const int * wrap_around_x, const int * wrap_around_y, const int * wrap_around_z); #endif void FORT_VEL_TO_ACCEL (const int* lo, const int* hi, const Real* unew, ARLIM_P(u_lo), ARLIM_P(u_hi), const Real* uold, ARLIM_P(u_lo), ARLIM_P(u_hi), const Real* dt ); void FORT_ACCEL_TO_VEL (const int* lo, const int* hi, const Real* uold, ARLIM_P(u_lo), ARLIM_P(u_hi), const Real* dt, const Real* unew, ARLIM_P(u_lo), ARLIM_P(u_hi) ); void FORT_PROJ_UPDATE (const int* lo, const int* hi, const int *nvar, const int *ngrow, const Real* unew, ARLIM_P(u_lo), ARLIM_P(u_hi), const Real* dt, const Real* uold, ARLIM_P(u_lo), ARLIM_P(u_hi) ); void FORT_RADMPY (Real*a, ARLIM_P(grid_lo), ARLIM_P(grid_hi), const int* domlo, const int* domhi, const int* nghost, const Real* radius, const int* nrad, const Real* bogus_value); void FORT_RADDIV (Real*a, ARLIM_P(grid_lo), ARLIM_P(grid_hi), const int* domlo, const int* domhi, const int* nghost, const Real* radius, const int* nrad, const Real* bogus_value); void FORT_HGC2N(const int* nghost, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const Real* dat, const Real* rcen, ARLIM_P(rhs_lo), ARLIM_P(rhs_hi), Real* rhsdat, const int* domlo, const int* domhi, const Real* hr, const int* is_rz, const int* imax); void FORT_HGN2C(const int* isrz, const int* rweighted, ARLIM_P(nodelo),ARLIM_P(nodehi), const Real* nodedat, ARLIM_P(cclo), ARLIM_P(cchi), const int* lo, const int* hi, Real* ccdat); void FORT_FILTRHS (const Real* phi , ARLIM_P(p_lo), ARLIM_P(p_hi), const Real* sig , ARLIM_P(s_lo), ARLIM_P(s_hi), Real* divgp, ARLIM_P(dglo), ARLIM_P(dghi), const int* lo, const int* hi, const Real* dx, const Real* mult, int* is_rz); } #endif #endif /*_PROJECTION_F_H_*/ ccseapps-2.5/CCSEApps/iamrlib/MacBndry.H0000644000175000017500000000341211634153073021106 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _MACBNDRYDATA_H_ #define _MACBNDRYDATA_H_ // // $Id: MacBndry.H,v 1.8 2001/08/01 21:50:55 lijewski Exp $ // #include class MacBndry : public InterpBndryData { public: MacBndry (); MacBndry (const BoxArray& _grids, int _ncomp, const Geometry& _geom); virtual void setBndryConds (const BCRec& phys_bc, IntVect& ratio, int comp=0); }; #endif ccseapps-2.5/CCSEApps/iamrlib/GODUNOV_F.F0000644000175000017500000000406711634153073021002 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: GODUNOV_F.F,v 1.8 2002/11/14 23:04:56 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "GODUNOV_F.H" #include "ArrayLim.H" c========================================================= subroutine FORT_SET_PARAMS(slope_order_in,use_unlim_in) implicit none integer slope_order_in,use_unlim_in #include "GODCOMM_F.H" slope_order = slope_order_in use_unlimited_slopes = (use_unlim_in .eq. 1) if(slope_order.ne.1.and. #if (BL_SPACEDIM==2) & slope_order.ne.2.and. #endif & slope_order.ne.4)then write(6,*)'FORT_SET_PARAMS : illegal value of slope_order = ', & slope_order call bl_abort(" ") end if end ccseapps-2.5/CCSEApps/iamrlib/VISCOPERATOR_2D.F0000644000175000017500000000675311634153073021665 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: VISCOPERATOR_2D.F,v 1.5 1998/03/31 17:26:41 lijewski Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "VISCOPERATOR_F.H" #include "ArrayLim.H" #define SDIM 2 c :: ---------------------------------------------------------- c :: VISCEXTRAP c :: extrapolate viscous terms to ghost zones c :: c :: INPUTS / OUTPUTS: c :: visc <=> array containing visc terms c :: DIMS(visc) => index limits for visc c :: lo,hi => index limits for grid interior c :: ncomp => number of components c :: ---------------------------------------------------------- c :: subroutine FORT_VISCEXTRAP (visc,DIMS(visc),lo,hi,ncomp) integer DIMDEC(visc) integer lo(SDIM), hi(SDIM) integer ncomp REAL_T visc(DIMV(visc),ncomp) integer i, j, n do n = 1, ncomp c ::::: left side i = lo(1)-1 do j = lo(2), hi(2) c visc(i,j,n) = two*visc(i+1,j,n) - visc(i+2,j,n) visc(i,j,n) = visc(i+1,j,n) end do c ::::: right side i = hi(1)+1 do j = lo(2), hi(2) c visc(i,j,n) = two*visc(i-1,j,n) - visc(i-2,j,n) visc(i,j,n) = visc(i-1,j,n) end do c ::::: bottom side j = lo(2)-1 do i = lo(1), hi(1) c visc(i,j,n) = two*visc(i,j+1,n) - visc(i,j+2,n) visc(i,j,n) = visc(i,j+1,n) end do c ::::: top side j = hi(2)+1 do i = lo(1), hi(1) c visc(i,j,n) = two*visc(i,j-1,n) - visc(i,j-2,n) visc(i,j,n) = visc(i,j-1,n) end do c ::::: corners i = lo(1)-1 j = lo(2)-1 c visc(i,j,n) = two*visc(i+1,j+2,n) - visc(i+2,j+2,n) visc(i,j,n) = visc(i+1,j+1,n) j = hi(2)+1 c visc(i,j,n) = two*visc(i+1,j-1,n) - visc(i+2,j-2,n) visc(i,j,n) = visc(i+1,j-1,n) i = hi(1)+1 c visc(i,j,n) = two*visc(i-1,j-1,n) - visc(i-2,j-2,n) visc(i,j,n) = visc(i-1,j-1,n) j = lo(2)-1 c visc(i,j,n) = two*visc(i-1,j+1,n) - visc(i-2,j+2,n) visc(i,j,n) = visc(i-1,j+1,n) end do end ccseapps-2.5/CCSEApps/iamrlib/DERIVE_F.H0000644000175000017500000002460011634153073020634 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _DERIVE_F_H #define _DERIVE_F_H /* ** $Id: DERIVE_F.H,v 1.14 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_DERKENG derkeng # define FORT_DERMGVORT dermgvort # define FORT_DERVORT dervort # define FORT_DERMVEL dermvel # define FORT_DERLOGS derlogs # define FORT_DERDVRHO derdvrho # define FORT_DERMPRHO dermprho # define FORT_DERLGRHODUST derlgrc # define FORT_DERMGDIVU dermgdivu # define FORT_GRADP_DIR gradpdir # define FORT_DERAVGPRES deravgpres # define FORT_DERGRDP dergrdp # define FORT_DERGRDPX dergrdpx # define FORT_DERGRDPY dergrdpy #if (BL_SPACEDIM == 3) # define FORT_DERGRDPZ dergrdpz #endif #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_DERKENG DERKENG # define FORT_DERMGVORT DERMGVORT # define FORT_DERVORT DERVORT # define FORT_DERMVEL DERMVEL # define FORT_DERLOGS DERLOGS # define FORT_DERDVRHO DERDVRHO # define FORT_DERMPRHO DERMPRHO # define FORT_DERLGRHODUST DERLGRC # define FORT_DERMGDIVU DERMGDIVU # define FORT_GRADP_DIR GRADPDIR # define FORT_DERAVGPRES DERAVGPRES # define FORT_DERGRDP DERGRDP # define FORT_DERGRDPX DERGRDPX # define FORT_DERGRDPY DERGRDPY #if (BL_SPACEDIM == 3) # define FORT_DERGRDPZ DERGRDPZ #endif # elif defined (BL_FORT_USE_LOWERCASE) # define FORT_GRADP_DIR gradpdir # define FORT_DERKENG derkeng # define FORT_DERMGVORT dermgvort # define FORT_DERVORT dervort # define FORT_DERMVEL dermvel # define FORT_DERLOGS derlogs # define FORT_DERDVRHO derdvrho # define FORT_DERMPRHO dermprho # define FORT_DERLGRHODUST derlgrc # define FORT_DERMGDIVU dermgdivu # define FORT_GRADP_DIR gradpdir # define FORT_DERAVGPRES deravgpres # define FORT_DERGRDP dergrdp # define FORT_DERGRDPX dergrdpx # define FORT_DERGRDPY dergrdpy #if (BL_SPACEDIM == 3) # define FORT_DERGRDPZ dergrdpz #endif # elif defined (BL_FORT_USE_UNDERSCORE) # define FORT_GRADP_DIR gradpdir_ # define FORT_DERKENG derkeng_ # define FORT_DERMGVORT dermgvort_ # define FORT_DERVORT dervort_ # define FORT_DERMVEL dermvel_ # define FORT_DERLOGS derlogs_ # define FORT_DERDVRHO derdvrho_ # define FORT_DERMPRHO dermprho_ # define FORT_DERLGRHODUST derlgrc_ # define FORT_DERMGDIVU dermgdivu_ # define FORT_GRADP_DIR gradpdir_ # define FORT_DERAVGPRES deravgpres_ # define FORT_DERGRDP dergrdp_ # define FORT_DERGRDPX dergrdpx_ # define FORT_DERGRDPY dergrdpy_ #if (BL_SPACEDIM == 3) # define FORT_DERGRDPZ dergrdpz_ #endif # endif #include extern "C" { void FORT_DERKENG (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERMGVORT (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERVORT (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERMVEL (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERLOGS (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERMPRHO (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERDVRHO (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERLGRHODUST (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERMGDIVU (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_GRADP_DIR (const Real* p, ARLIM_P(p_lo), ARLIM_P(p_hi), const Real* gp, ARLIM_P(gp_lo), ARLIM_P(gp_hi), const int* lo, const int* hi, const int* dir, const Real* dx ); void FORT_DERAVGPRES (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERGRDP (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERGRDPX (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; void FORT_DERGRDPY (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; #if (BL_SPACEDIM == 3) void FORT_DERGRDPZ (Real* data, ARLIM_P(dat_lo), ARLIM_P(dat_hi), const int* nvar, const Real* compdat, ARLIM_P(clo), ARLIM_P(chi), const int* ncomp, const int* lo, const int* hi, const int* domain_lo, const int* domain_hi, const Real* delta, const Real* xlo, const Real* time, const Real* dt, const int* bcrec, const int* level, const int* grid_no) ; #endif } #endif #endif ccseapps-2.5/CCSEApps/iamrlib/NS_setup.cpp0000644000175000017500000002641111634153073021546 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: NS_setup.cpp,v 1.47 2003/02/19 21:42:35 almgren Exp $ // #include #include #include #include #include #include #include #include static Box the_same_box (const Box& b) { return b; } static Box grow_box_by_one (const Box& b) { return BoxLib::grow(b,1); } // // Components are Interior, Inflow, Outflow, Symmetry, SlipWall, NoSlipWall. // static int norm_vel_bc[] = { INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_ODD, EXT_DIR, EXT_DIR }; static int tang_vel_bc[] = { INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_EVEN, HOEXTRAP, EXT_DIR }; static int scalar_bc[] = { INT_DIR, EXT_DIR, FOEXTRAP, REFLECT_EVEN, FOEXTRAP, FOEXTRAP }; static int press_bc[] = { INT_DIR, FOEXTRAP, FOEXTRAP, REFLECT_EVEN, FOEXTRAP, FOEXTRAP }; static int temp_bc[] = { INT_DIR, EXT_DIR, HOEXTRAP, REFLECT_EVEN, REFLECT_EVEN, FOEXTRAP }; static int divu_bc[] = { INT_DIR, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN }; static int dsdt_bc[] = { INT_DIR, EXT_DIR, EXT_DIR, REFLECT_EVEN, REFLECT_EVEN, REFLECT_EVEN }; static void set_x_vel_bc (BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); bc.setLo(0,norm_vel_bc[lo_bc[0]]); bc.setHi(0,norm_vel_bc[hi_bc[0]]); bc.setLo(1,tang_vel_bc[lo_bc[1]]); bc.setHi(1,tang_vel_bc[hi_bc[1]]); #if (BL_SPACEDIM == 3) bc.setLo(2,tang_vel_bc[lo_bc[2]]); bc.setHi(2,tang_vel_bc[hi_bc[2]]); #endif } static void set_y_vel_bc (BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); bc.setLo(0,tang_vel_bc[lo_bc[0]]); bc.setHi(0,tang_vel_bc[hi_bc[0]]); bc.setLo(1,norm_vel_bc[lo_bc[1]]); bc.setHi(1,norm_vel_bc[hi_bc[1]]); #if (BL_SPACEDIM == 3) bc.setLo(2,tang_vel_bc[lo_bc[2]]); bc.setHi(2,tang_vel_bc[hi_bc[2]]); #endif } #if (BL_SPACEDIM == 3) static void set_z_vel_bc (BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); bc.setLo(0,tang_vel_bc[lo_bc[0]]); bc.setHi(0,tang_vel_bc[hi_bc[0]]); bc.setLo(1,tang_vel_bc[lo_bc[1]]); bc.setHi(1,tang_vel_bc[hi_bc[1]]); bc.setLo(2,norm_vel_bc[lo_bc[2]]); bc.setHi(2,norm_vel_bc[hi_bc[2]]); } #endif static void set_scalar_bc (BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); for (int i = 0; i < BL_SPACEDIM; i++) { bc.setLo(i,scalar_bc[lo_bc[i]]); bc.setHi(i,scalar_bc[hi_bc[i]]); } } static void set_temp_bc (BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); for (int i = 0; i < BL_SPACEDIM; i++) { bc.setLo(i,temp_bc[lo_bc[i]]); bc.setHi(i,temp_bc[hi_bc[i]]); } } static void set_pressure_bc (BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); for (int i = 0; i < BL_SPACEDIM; i++) { bc.setLo(i,press_bc[lo_bc[i]]); bc.setHi(i,press_bc[hi_bc[i]]); } } static void set_divu_bc(BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); for (int i = 0; i < BL_SPACEDIM; i++) { bc.setLo(i,divu_bc[lo_bc[i]]); bc.setHi(i,divu_bc[hi_bc[i]]); } } static void set_dsdt_bc(BCRec& bc, const BCRec& phys_bc) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); for (int i = 0; i < BL_SPACEDIM; i++) { bc.setLo(i,dsdt_bc[lo_bc[i]]); bc.setHi(i,dsdt_bc[hi_bc[i]]); } } typedef StateDescriptor::BndryFunc BndryFunc; void NavierStokes::variableSetUp () { BL_ASSERT(desc_lst.size() == 0); for (int dir = 0; dir < BL_SPACEDIM; dir++) { phys_bc.setLo(dir,SlipWall); phys_bc.setHi(dir,SlipWall); } read_params(); BCRec bc; // // Set number of state variables. // NUM_STATE = Density + 1; int Trac = NUM_STATE++; if (do_temp) NUM_STATE++; NUM_SCALARS = NUM_STATE - Density; // // ************** DEFINE VELOCITY VARIABLES ******************** // desc_lst.addDescriptor(State_Type,IndexType::TheCellType(), StateDescriptor::Point,1,NUM_STATE, &cell_cons_interp); set_x_vel_bc(bc,phys_bc); desc_lst.setComponent(State_Type,Xvel,"x_velocity",bc,BndryFunc(FORT_XVELFILL)); set_y_vel_bc(bc,phys_bc); desc_lst.setComponent(State_Type,Yvel,"y_velocity",bc,BndryFunc(FORT_YVELFILL)); #if (BL_SPACEDIM == 3) set_z_vel_bc(bc,phys_bc); desc_lst.setComponent(State_Type,Zvel,"z_velocity",bc,BndryFunc(FORT_ZVELFILL)); #endif // // ************** DEFINE SCALAR VARIABLES ******************** // set_scalar_bc(bc,phys_bc); desc_lst.setComponent(State_Type,Density,"density",bc,BndryFunc(FORT_DENFILL)); desc_lst.setComponent(State_Type,Trac,"tracer",bc,BndryFunc(FORT_ADVFILL)); // // ************** DEFINE TEMPERATURE ******************** // if (do_temp) { set_temp_bc(bc,phys_bc); desc_lst.setComponent(State_Type,Temp,"temp",bc,BndryFunc(FORT_TEMPFILL)); } is_diffusive.resize(NUM_STATE); advectionType.resize(NUM_STATE); diffusionType.resize(NUM_STATE); for (int i = 0; i < NUM_STATE; i++) { advectionType[i] = NonConservative; diffusionType[i] = RhoInverse_Laplacian_S; is_diffusive[i] = false; if (visc_coef[i] > 0.0) is_diffusive[i] = true; } if (do_mom_diff == 1) for (int d = 0; d < BL_SPACEDIM; d++) advectionType[Xvel+d] = Conservative; advectionType[Density] = Conservative; if (do_temp) advectionType[Temp] = NonConservative; advectionType[Trac] = NonConservative; diffusionType[Trac] = Laplacian_S; if (is_diffusive[Density]) { BoxLib::Error("Density cannot diffuse, bad visc_coef"); } // // ---- pressure // #if 1 desc_lst.addDescriptor(Press_Type,IndexType::TheNodeType(), StateDescriptor::Interval,1,1, &node_bilinear_interp); set_pressure_bc(bc,phys_bc); desc_lst.setComponent(Press_Type,Pressure,"pressure",bc,BndryFunc(FORT_PRESFILL)); #else desc_lst.addDescriptor(Press_Type,IndexType::TheNodeType(), StateDescriptor::Point,1,1, &node_bilinear_interp,true); set_pressure_bc(bc,phys_bc); desc_lst.setComponent(Press_Type,Pressure,"pressure",bc,BndryFunc(FORT_PRESFILL)); // // ---- time derivative of pressure // Dpdt_Type = desc_lst.length(); desc_lst.addDescriptor(Dpdt_Type,IndexType::TheNodeType(), StateDescriptor::Interval,1,1, &node_bilinear_interp); set_pressure_bc(bc,phys_bc); desc_lst.setComponent(Dpdt_Type,Dpdt,"dpdt",bc,BndryFunc(FORT_PRESFILL)); #endif if (do_temp) { // stick Divu_Type on the end of the descriptor list Divu_Type = desc_lst.size(); int nGrowDivu = 1; desc_lst.addDescriptor(Divu_Type,IndexType::TheCellType(), StateDescriptor::Point,nGrowDivu,1, &cell_cons_interp); set_divu_bc(bc,phys_bc); desc_lst.setComponent(Divu_Type,Divu,"divu",bc,BndryFunc(FORT_DIVUFILL)); // stick Dsdt_Type on the end of the descriptor list Dsdt_Type = desc_lst.size(); int nGrowDsdt = 0; desc_lst.addDescriptor(Dsdt_Type,IndexType::TheCellType(), StateDescriptor::Point,nGrowDsdt,1, &cell_cons_interp); set_dsdt_bc(bc,phys_bc); desc_lst.setComponent(Dsdt_Type,Dsdt,"dsdt",bc,BndryFunc(FORT_DSDTFILL)); } // // ************** DEFINE DERIVED QUANTITIES ******************** // // kinetic energy // derive_lst.add("energy",IndexType::TheCellType(),1,FORT_DERKENG,the_same_box); derive_lst.addComponent("energy",desc_lst,State_Type,Density,1); derive_lst.addComponent("energy",desc_lst,State_Type,Xvel,BL_SPACEDIM); derive_lst.add("mag_vel",IndexType::TheCellType(),1,FORT_DERMVEL,the_same_box); derive_lst.addComponent("mag_vel",desc_lst,State_Type,Xvel,BL_SPACEDIM); // // magnitude of vorticity // derive_lst.add("mag_vort",IndexType::TheCellType(),1,FORT_DERMGVORT,grow_box_by_one); derive_lst.addComponent("mag_vort",desc_lst,State_Type,Xvel,BL_SPACEDIM); // // divergence of velocity field // derive_lst.add("diveru",IndexType::TheCellType(),1,FORT_DERMGDIVU,grow_box_by_one); derive_lst.addComponent("diveru",desc_lst,State_Type,Xvel,BL_SPACEDIM); // // average pressure // derive_lst.add("avg_pressure",IndexType::TheCellType(),1,FORT_DERAVGPRES, the_same_box); derive_lst.addComponent("avg_pressure",desc_lst,Press_Type,Pressure,1); // // pressure gradient in X direction // derive_lst.add("gradpx",IndexType::TheCellType(),1,FORT_DERGRDPX,the_same_box); derive_lst.addComponent("gradpx",desc_lst,Press_Type,Pressure,1); // // pressure gradient in Y direction // derive_lst.add("gradpy",IndexType::TheCellType(),1,FORT_DERGRDPY,the_same_box); derive_lst.addComponent("gradpy",desc_lst,Press_Type,Pressure,1); // // magnitude of pressure gradient // derive_lst.add("gradp",IndexType::TheCellType(),1,FORT_DERGRDP,the_same_box); derive_lst.addComponent("gradp",desc_lst,Press_Type,Pressure,1); #if (BL_SPACEDIM == 3) // // pressure gradient in Z direction // derive_lst.add("gradpz",IndexType::TheCellType(),1,FORT_DERGRDPZ,the_same_box); derive_lst.addComponent("gradpz",desc_lst,Press_Type,Pressure,1); #endif // // ************** DEFINE ERROR ESTIMATION QUANTITIES ************* // err_list.add("tracer",1,ErrorRec::Special,FORT_ADVERROR); err_list.add("mag_vort",0,ErrorRec::Special,FORT_MVERROR); } ccseapps-2.5/CCSEApps/iamrlib/GODUNOV_F.H0000644000175000017500000003535111634153073021004 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GODUNOV_F_H_ #define _GODUNOV_F_H_ /* ** $Id: GODUNOV_F.H,v 1.14 2003/02/18 21:35:03 almgren Exp $ */ #ifdef BL_LANG_FORT # define FORT_TEST_U_RHO testurho # define FORT_TEST_UMAC_RHO testumacrho # define FORT_ESTDT estmdt # define FORT_TRANSVEL transvel # define FORT_ESTATE estate # define FORT_ESTATE_FPU estatefpu # define FORT_ESTATE_BDS estatebds # define FORT_ADV_FORCING advforcing # define FORT_SYNC_ADV_FORCING syncadvforcing # define FORT_SCALMINMAX scalminmax # define FORT_UPDATE_TF updatetf # define FORT_CORRECT_TF correcttf # define FORT_UPDATE_AOFS_TF updateaofstf # define FORT_UPDATE_AOFS_TF_GP updateaofstfgp # define FORT_SUM_TF_GP_VISC sumtfgpvisc # define FORT_SUM_TF_DIVU_VISC sumtfdivuvisc # define FORT_SUM_TF_GP sumtfgp # define FORT_SUM_TF_DIVU sumtfdivu # define FORT_SET_PARAMS setparams #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_TEST_U_RHO TESTURHO # define FORT_TEST_UMAC_RHO TESTUMACRHO # define FORT_ESTDT ESTMDT # define FORT_TRANSVEL TRANSVEL # define FORT_ESTATE ESTATE # define FORT_ESTATE_FPU ESTATEFPU # define FORT_ESTATE_BDS ESTATEBDS # define FORT_ADV_FORCING ADVFORCING # define FORT_SYNC_ADV_FORCING SYNCADVFORCING # define FORT_SCALMINMAX SCALMINMAX # define FORT_UPDATE_TF UPDATETF # define FORT_CORRECT_TF CORRECTTF # define FORT_UPDATE_AOFS_TF UPDATEAOFSTF # define FORT_UPDATE_AOFS_TF_GP UPDATEAOFSTFGP # define FORT_SUM_TF_GP_VISC SUMTFGPVISC # define FORT_SUM_TF_DIVU_VISC SUMTFDIVUVISC # define FORT_SUM_TF_GP SUMTFGP # define FORT_SUM_TF_DIVU SUMTFDIVU # define FORT_SET_PARAMS SETPARAMS # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_TEST_U_RHO testurho # define FORT_TEST_UMAC_RHO testumacrho # define FORT_ESTDT estmdt # define FORT_TRANSVEL transvel # define FORT_ESTATE estate # define FORT_ESTATE_FPU estatefpu # define FORT_ESTATE_BDS estatebds # define FORT_ADV_FORCING advforcing # define FORT_SYNC_ADV_FORCING syncadvforcing # define FORT_SCALMINMAX scalminmax # define FORT_UPDATE_TF updatetf # define FORT_CORRECT_TF correcttf # define FORT_UPDATE_AOFS_TF updateaofstf # define FORT_UPDATE_AOFS_TF_GP updateaofstfgp # define FORT_SUM_TF_GP_VISC sumtfgpvisc # define FORT_SUM_TF_DIVU_VISC sumtfdivuvisc # define FORT_SUM_TF_GP sumtfgp # define FORT_SUM_TF_DIVU sumtfdivu # define FORT_SET_PARAMS setparams # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_TEST_U_RHO testurho_ # define FORT_TEST_UMAC_RHO testumacrho_ # define FORT_ESTDT estmdt_ # define FORT_TRANSVEL transvel_ # define FORT_ESTATE estate_ # define FORT_ESTATE_FPU estatefpu_ # define FORT_ESTATE_BDS estatebds_ # define FORT_ADV_FORCING advforcing_ # define FORT_SYNC_ADV_FORCING syncadvforcing_ # define FORT_SCALMINMAX scalminmax_ # define FORT_UPDATE_TF updatetf_ # define FORT_CORRECT_TF correcttf_ # define FORT_UPDATE_AOFS_TF updateaofstf_ # define FORT_UPDATE_AOFS_TF_GP updateaofstfgp_ # define FORT_SUM_TF_GP_VISC sumtfgpvisc_ # define FORT_SUM_TF_DIVU_VISC sumtfdivuvisc_ # define FORT_SUM_TF_GP sumtfgp_ # define FORT_SUM_TF_DIVU sumtfdivu_ # define FORT_SET_PARAMS setparams_ # endif #include extern "C" { void FORT_TEST_U_RHO(const Real* u, ARLIM_P(vlo), ARLIM_P(vhi), const Real* v, ARLIM_P(vlo), ARLIM_P(vhi), #if (BL_SPACEDIM == 3) const Real* w, ARLIM_P(vlo), ARLIM_P(vhi), #endif const Real* rh, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const Real* dt, const Real* dx, Real* cflmax, const Real* u_max, int* verbose); void FORT_TEST_UMAC_RHO(const Real* um, ARLIM_P(ulo), ARLIM_P(uhi), const Real* vm, ARLIM_P(vlo), ARLIM_P(vhi), #if (BL_SPACEDIM == 3) const Real* wm, ARLIM_P(wlo), ARLIM_P(whi), #endif const Real* rh, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, const Real* dt, const Real* dx, Real* cfl, const Real* u_max); void FORT_ESTDT(const Real* Udat, ARLIM_P(vlo), ARLIM_P(vhi), const Real* Tfdat, ARLIM_P(tlo), ARLIM_P(thi), const Real* rdat, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, Real* dt, const Real* dx, Real* cfl, Real* u_max); void FORT_TRANSVEL( const Real* u_dat, const Real* uad_dat, const Real* xhi_dat, const Real* slx_dat, const int* ubc, Real* slxscr, const Real* v_dat, const Real* vad_dat, const Real* yhi_dat, const Real* sly_dat, const int* vbc, Real*slyscr, #if (BL_SPACEDIM == 3) const Real* w_dat, const Real* wad_dat, const Real* zhi_dat, const Real* slz_dat, const int* wbc, Real* slzscr, #endif ARLIM_P(u_lo),ARLIM_P(u_hi), ARLIM_P(w_lo),ARLIM_P(w_hi), const int* lo, const int* hi, Real* dt, const Real* dx, int* use_forces_in_trans, const Real* tforcedat); void FORT_ESTATE(const Real* s_dat, const Real* tfr_dat, ARLIM_P(s_lo),ARLIM_P(s_hi), const Real* u_dat, const Real* xlo_dat, const Real* xhi_dat, const Real* slx_dat, const Real* uad_dat, Real* slxscr, Real* stxlo, Real* stxhi, const Real* uedge_dat, ARLIM_P(ue_lo), ARLIM_P(ue_hi), const Real* stx, ARLIM_P(stx_lo),ARLIM_P(stx_hi), const Real* v_dat, const Real* ylo_dat, const Real* yhi_dat, const Real* sly_dat, const Real* vad_dat, Real* slyscr, Real* stylo, Real* styhi, const Real* vedge_dat, ARLIM_P(ve_lo), ARLIM_P(ve_hi), const Real* sty, ARLIM_P(sty_lo),ARLIM_P(sty_hi), #if (BL_SPACEDIM == 3) const Real* w_dat, const Real* zlo_dat, const Real* zhi_dat, const Real* slz_dat, const Real* wad_dat, Real* slzscr, Real* stzlo, Real* stzhi, const Real* wedge_dat, ARLIM_P(we_lo), ARLIM_P(we_hi), const Real* stz, ARLIM_P(stz_lo),ARLIM_P(stz_hi), #endif ARLIM_P(ww_lo),ARLIM_P(ww_hi), const int* bc, const int* lo, const int* hi, Real* dt, const Real* dx, int* fort_ind, int* velpred, int* use_forces_in_trans); void FORT_ESTATE_FPU(const Real* s_dat, const Real* tfr_dat, const Real* divu_dat, ARLIM_P(s_lo),ARLIM_P(s_hi), const Real* xlo_dat, const Real* xhi_dat, const Real* slx_dat, Real* slxscr, Real* stxlo, Real* stxhi, const Real* uedge_dat, ARLIM_P(ue_lo), ARLIM_P(ue_hi), const Real* stx, ARLIM_P(stx_lo),ARLIM_P(stx_hi), const Real* ylo_dat, const Real* yhi_dat, const Real* sly_dat, Real* slyscr, Real* stylo, Real* styhi, const Real* vedge_dat, ARLIM_P(ve_lo), ARLIM_P(ve_hi), const Real* sty, ARLIM_P(sty_lo),ARLIM_P(sty_hi), #if (BL_SPACEDIM == 3) const Real* zlo_dat, const Real* zhi_dat, const Real* slz_dat, Real* slzscr, Real* stzlo, Real* stzhi, const Real* wedge_dat, ARLIM_P(we_lo), ARLIM_P(we_hi), const Real* stz, ARLIM_P(stz_lo),ARLIM_P(stz_hi), #endif ARLIM_P(ww_lo),ARLIM_P(ww_hi), const int* bc, const int* lo, const int* hi, Real* dt, const Real* dx, int* fort_ind, int* use_forces_in_trans, int* iconserv); void FORT_ESTATE_BDS(const Real* s_dat, const Real* tfr_dat, const Real* divu_dat, ARLIM_P(s_lo),ARLIM_P(s_hi), const Real* xlo_dat, const Real* xhi_dat, const Real* slx_dat, Real* slxscr, Real* stxlo, Real* stxhi, const Real* uedge_dat, ARLIM_P(ue_lo), ARLIM_P(ue_hi), const Real* stx, ARLIM_P(stx_lo),ARLIM_P(stx_hi), const Real* ylo_dat, const Real* yhi_dat, const Real* sly_dat, Real* slyscr, Real* stylo, Real* styhi, const Real* vedge_dat, ARLIM_P(ve_lo), ARLIM_P(ve_hi), const Real* sty, ARLIM_P(sty_lo),ARLIM_P(sty_hi), #if (BL_SPACEDIM == 3) const Real* zlo_dat, const Real* zhi_dat, const Real* slz_dat, Real* slzscr, Real* stzlo, Real* stzhi, const Real* wedge_dat, ARLIM_P(we_lo), ARLIM_P(we_hi), const Real* stz, ARLIM_P(stz_lo),ARLIM_P(stz_hi), #endif ARLIM_P(ww_lo),ARLIM_P(ww_hi), const int* bc, const int* lo, const int* hi, Real* dt, const Real* dx, int* fort_ind, int* use_forces_in_trans, int* iconserv); void FORT_ADV_FORCING(const Real* aofs_dat, ARLIM_P(a_lo), ARLIM_P(a_hi), const Real* xflux_dat, ARLIM_P(xflux_lo),ARLIM_P(xflux_hi), const Real* uedge_dat, ARLIM_P(uedge_lo),ARLIM_P(uedge_hi), const Real* areax_dat, ARLIM_P(ax_lo), ARLIM_P(ax_hi), const Real* yflux_dat, ARLIM_P(yflux_lo),ARLIM_P(yflux_hi), const Real* vedge_dat, ARLIM_P(vedge_lo),ARLIM_P(vedge_hi), const Real* areay_dat, ARLIM_P(ay_lo), ARLIM_P(ay_hi), #if (BL_SPACEDIM == 3) const Real* zflux_dat, ARLIM_P(zflux_lo),ARLIM_P(zflux_hi), const Real* wedge_dat, ARLIM_P(wedge_lo),ARLIM_P(wedge_hi), const Real* areaz_dat, ARLIM_P(az_lo), ARLIM_P(az_hi), #endif const Real* vol_dat, ARLIM_P(v_lo),ARLIM_P(v_hi), const int* lo, const int* hi, int* iconserv); void FORT_SYNC_ADV_FORCING(const Real* sync_dat,ARLIM_P(s_lo),ARLIM_P(s_hi), const Real* xflux_dat, ARLIM_P(xflux_lo),ARLIM_P(xflux_hi), const Real* ucorr_dat, ARLIM_P(ucorr_lo),ARLIM_P(ucorr_hi), const Real* areax_dat, ARLIM_P(ax_lo), ARLIM_P(ax_hi), const Real* yflux_dat, ARLIM_P(yflux_lo),ARLIM_P(yflux_hi), const Real* vcorr_dat, ARLIM_P(vcorr_lo),ARLIM_P(vcorr_hi), const Real* areay_dat, ARLIM_P(ay_lo), ARLIM_P(ay_hi), #if (BL_SPACEDIM == 3) const Real* zflux_dat, ARLIM_P(zflux_lo),ARLIM_P(zflux_hi), const Real* wcorr_dat, ARLIM_P(wcorr_lo),ARLIM_P(wcorr_hi), const Real* areaz_dat, ARLIM_P(az_lo), ARLIM_P(az_hi), #endif const Real* vol_dat, ARLIM_P(v_lo),ARLIM_P(v_hi), const int* lo, const int* hi, int* iconserv); void FORT_SCALMINMAX (const Real* Sold_dat, ARLIM_P(slo), ARLIM_P(shi), const Real* Snew_dat, ARLIM_P(slo), ARLIM_P(shi), #if (BL_SPACEDIM == 3) const Real* smin_dat, const Real* smax_dat, ARLIM_P(lo),ARLIM_P(hi), #endif const int* lo, const int* hi, const int* bc); void FORT_UPDATE_TF(const Real* SOdat, ARLIM_P(slo), ARLIM_P(shi), const Real* SNdat, ARLIM_P(slo), ARLIM_P(shi), const Real* Tfdat, ARLIM_P(tlo), ARLIM_P(thi), const int* lo, const int* hi, Real* dt, int* num_comp); void FORT_CORRECT_TF(const Real* SSdat, const Real* SPdat, ARLIM_P(slo), ARLIM_P(shi), const Real* TSdat, const Real* TNdat, ARLIM_P(tlo), ARLIM_P(thi), const int* lo, const int* hi, Real* dt, int* num_comp); void FORT_UPDATE_AOFS_TF(const Real* SOdat, ARLIM_P(slo), ARLIM_P(shi), const Real* SNdat, ARLIM_P(slo), ARLIM_P(shi), const Real* AOdat, ARLIM_P(alo), ARLIM_P(ahi), const Real* Tfdat, ARLIM_P(tlo), ARLIM_P(thi), const int* lo, const int* hi, Real* dt, int* num_comp); void FORT_UPDATE_AOFS_TF_GP(const Real* UOdat, ARLIM_P(ulo), ARLIM_P(uhi), const Real* UNdat, ARLIM_P(ulo), ARLIM_P(uhi), const Real* AOdat, ARLIM_P(alo), ARLIM_P(ahi), const Real* Tfdat, ARLIM_P(tlo), ARLIM_P(thi), const Real* GPdat, ARLIM_P(glo), ARLIM_P(ghi), const Real* RHdat, ARLIM_P(rlo), ARLIM_P(rhi), const int* lo, const int* hi, Real* dt); void FORT_SUM_TF_GP_VISC(const Real* Tfdat, ARLIM_P(tlo), ARLIM_P(thi), const Real* VIdat, ARLIM_P(vlo), ARLIM_P(vhi), const Real* GPdat, ARLIM_P(glo), ARLIM_P(ghi), const Real* RHdat, ARLIM_P(rlo), ARLIM_P(rhi), const int* tlo, const int* thi); void FORT_SUM_TF_DIVU_VISC(const Real* Sdat, ARLIM_P(slo), ARLIM_P(shi), const Real* Tfdat, ARLIM_P(tlo), ARLIM_P(thi), const Real* DUdat, ARLIM_P(dlo), ARLIM_P(dhi), const Real* VIdat, ARLIM_P(vlo), ARLIM_P(vhi), const Real* RHdat, ARLIM_P(rlo), ARLIM_P(rhi), const int* tlo, const int* thi, int* num_comp, int* iconserv); void FORT_SUM_TF_GP(const Real* Tfdat, ARLIM_P(tlo), ARLIM_P(thi), const Real* GPdat, ARLIM_P(glo), ARLIM_P(ghi), const Real* RHdat, ARLIM_P(rlo), ARLIM_P(rhi), const int* tlo, const int* thi); void FORT_SUM_TF_DIVU(const Real* Sdat, ARLIM_P(slo), ARLIM_P(shi), const Real* Tfdat, ARLIM_P(tlo), ARLIM_P(thi), const Real* DUdat, ARLIM_P(dlo), ARLIM_P(dhi), const Real* RHdat, ARLIM_P(rlo), ARLIM_P(rhi), const int* tlo, const int* thi, int* num_comp, int* iconserv); void FORT_SET_PARAMS(const int& slope_order, const int& use_unlimited_slopes); } #endif #endif /*_GODUNOV_F_H_*/ ccseapps-2.5/CCSEApps/iamrlib/OpenSource.txt0000644000175000017500000002434511634153073022131 0ustar amckinstryamckinstrySOURCE CODE LICENSE AGREEMENT Software: IAMR Version: Oct. 12, 2000 Release IMPORTANT - READ CAREFULLY: This License Agreement ("Agreement") is a legal agreement between you (in your capacity as an individual and as an agent for your company, institution or other entity) and The Regents of the University of California, Department of Energy contract-operators of the Ernest Orlando Lawrence Berkeley National Laboratory ("Berkeley Lab"). Downloading, installing, using, or copying of the Software (as defined below) by you or by a third party on your behalf indicates your agreement to be bound by the terms and conditions of this Agreement. If you do not agree to these terms and conditions, do not download, install or use the Software. 1. LICENSE GRANT. Berkeley Lab grants you, and you hereby accept, a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, and distribute the version noted above of the computer software program noted above, in binary and source code format, or any derivative work thereof, together with any associated media, printed materials, and on-line or electronic documentation (if any) provided by Berkeley Lab (collectively, the "Software"), subject to the following terms and conditions: (i) any distribution of the Software shall bind the receiver to the terms and conditions of this Agreement; (ii) any distribution of the Software in modified form shall clearly state that the Software has been modified from the version originally obtained from Berkeley Lab. This version of the Software constitutes a research prototype and may be changed substantially. The license grant set forth above is subject to receipt by Berkeley Lab of any required U.S. Department of Energy approvals. 2. COPYRIGHT; RETENTION OF RIGHTS. The above license grant is conditioned on the following: (i) you must reproduce all copyright notices and other proprietary notices on any copies of the Software and you must not remove such notices; (ii) in the event you compile the Software, you will include the copyright notice with the binary in such a manner as to allow it to be easily viewable; (iii) if you incorporate the Software into other code, you must provide notice that the code contains the Software and include a copy of the copyright notices and other proprietary notices. All copies of the Software shall be subject to the terms of this Agreement. Subject to approval by the U.S. Department of Energy: (a) you hereby acknowledge that the Software is protected by United States copyright law and international treaty provisions; (b) Berkeley Lab, and its licensors (if any), hereby reserve all rights in the Software which are not explicitly granted to you herein; (c) without limiting the generality of the foregoing, Berkeley Lab and its licensors retain all title, copyright, and other proprietary interests in the Software and any copies thereof, and you do not acquire any rights, express or implied, in the Software, other than those specifically set forth in this Agreement. 3. NO MAINTENANCE OR SUPPORT; TREATMENT OF ENHANCEMENTS YOU CHOOSE TO PROVIDE TO BERKELEY LAB. Berkeley Lab is under no obligation whatsoever to: (i) provide maintenance or support for the Software; or (ii) to notify you of bug fixes, patches, or upgrades to the features, functionality or performance of the Software ("Enhancements") (if any), whether developed by Berkeley Lab or third parties. If, in its sole discretion, Berkeley Lab makes an Enhancement available to you and Berkeley Lab does not separately enter into a written license agreement with you relating to such bug fix, patch or upgrade, then it shall be deemed incorporated into the Software and subject to this Agreement. You are under no obligation whatsoever to provide any Enhancements to Berkeley Lab that you may develop over time; however, if you choose to provide Berkeley Lab with Enhancements in source code form that you have developed without contemporaneously requiring Berkeley Lab to enter into a separate written license agreement, then you hereby grant Berkeley Lab a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into the Software or other computer software, distribute, and sublicense your Enhancements or derivative works thereof, in binary and source code form. 4. U.S. GOVERNMENT RIGHTS. The Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights as follows: the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, and perform publicly and display publicly. Beginning five (5) years after the date permission to assert copyright was granted by the U.S. Dept. of Energy, and subject to any subsequent five (5) year renewals, the U.S. Government is granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so. 5. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND. BERKELEY LAB, ITS LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. 6. LIMITATION OF LIABILITY. IN NO EVENT WILL BERKELEY LAB OR ITS LICENSORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF BERKELEY LAB HAS BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. IN NO EVENT SHALL BERKELEY LAB'S LIABILITY FOR DAMAGES ARISING FROM OR IN CONNECTION WITH THIS AGREEMENT EXCEED THE AMOUNT PAID BY YOU FOR THE SOFTWARE. 7. INDEMNITY. You shall indemnify, defend, and hold harmless Berkeley Lab, the U.S. Government, the Software developers, the Software sponsors, and their agents, officers, and employees, against any and all claims, suits, losses, damage, costs, fees, and expenses arising out of or in connection with this Agreement. You shall pay all costs incurred by Berkeley Lab in enforcing this provision, including reasonable attorney fees. 8. TERM AND TERMINATION. The license granted to you under this Agreement will continue perpetually unless terminated by Berkeley Lab in accordance with this Agreement. If you breach any term of this Agreement, and fail to cure such breach within thirty (30) days of the date of written notice, this Agreement shall immediately terminate. Upon such termination, you shall immediately cease using the Software, return to Berkeley Lab, or destroy, all copies of the Software, and provide Berkeley Lab with written certification of your compliance with the foregoing. Termination shall not relieve you from your obligations arising prior to such termination. Notwithstanding any provision of this Agreement to the contrary, Sections 5 through 10 shall survive termination of this Agreement. 9. EXPORT CONTROLS. You shall observe all applicable United States and foreign laws and regulations (if any) with respect to the export, re-export, diversion or transfer of the Software, related technical data and direct products thereof, including, without limitation, the International Traffic in Arms Regulations (ITAR) and the Export Administration Regulations. 10. NO ENDORSEMENT. In accordance with California Education Code Section 92000, you shall not use in advertising, publicity or other promotional activities any name, trade name, trademark, or other designation of the University of California, nor shall you so use "Ernest Orlando Lawrence Berkeley National Laboratory" or "United States Department of Energy" (including any contraction, abbreviation, or simulation of any of the foregoing) without Berkeley Lab's prior written consent. 11. GENERAL. This Agreement shall be governed by the laws of the State of California, excluding its rules governing conflicts of laws. No provision in either party's purchase orders, or in any other business forms employed by either party will supersede the terms of this Agreement, and no modification or amendment of this Agreement is binding, unless in writing signed by a duly authorized representative of each party. This Agreement is binding upon and shall inure to the benefit of Berkeley Lab, its successors and assigns. This Agreement represents the entire understanding of the parties, and supersedes all previous communications, written or oral, relating to the subject of this Agreement. If you have any questions concerning this license, contact Lawrence Berkeley National Laboratory, Technology Transfer Department, One Cyclotron Road, MS 90-1070, Berkeley, CA 94720, Attn: Software Licensing or via e-mail at TTD@lbl.gov. If you have any questions or feedback concerning this Software, contact the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory, One Cyclotron Road, MS 50A-1148, Berkeley, CA 94720 or via email at webmaster@mothra.lbl.gov. Form rev000928 ccseapps-2.5/CCSEApps/iamrlib/PROJOUTFLOWBC_F.H0000644000175000017500000002547111634153073021724 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _PROJOUTFLOWBC_F_H_ #define _PROJOUTFLOWBC_F_H_ #ifdef BL_LANG_FORT # define FORT_OLDHGPHIBC oldhgphibc # define FORT_HGPHIBC hgphibc # define FORT_PHI_FROM_X phifromx # define FORT_ALLPHI_FROM_X allphifromx # define FORT_FILL_ONED filloned # define FORT_FILL_TWOD filltwod # define FORT_RHOGBC rhogbc # define FORT_EXTRAP_PROJ extrapproj # define FORT_COMPUTE_COEFF computecoeff # define FORT_HGRELAX hgrelax # define FORT_HG_RESHIFT_PHI hgreshiftphi # define FORT_HG_SHIFT_PHI hgshiftphi # define FORT_HGRESID hgresid # define FORT_HGSUBTRACTAVGPHI hgsubtractavgphi # define FORT_SOLVEHG solvehg # define FORT_COARSIG coarsigb # define FORT_RESTRICT coarsresb # define FORT_INTERP interphg #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_HGPHIBC HGPHIBC # define FORT_OLDHGPHIBC OLDHGPHIBC # define FORT_RHOGBC RHOGBC # define FORT_PHI_FROM_X PHIFROMX # define FORT_ALLPHI_FROM_X ALLPHIFROMX # define FORT_FILL_ONED FILLONED # define FORT_FILL_TWOD FILLTWOD # define FORT_EXTRAP_PROJ EXTRAPPROJ # define FORT_COMPUTE_COEFF COMPUTECOEFF # define FORT_HGRELAX HGRELAX # define FORT_HG_SHIFT_PHI HGSHIFTPHI # define FORT_HG_RESHIFT_PHI HGRESHIFTPHI # define FORT_HGRESID HGRESID # define FORT_HGSUBTRACTAVGPHI HGSUBTRACTAVGPHI # define FORT_SOLVEHG SOLVEHG # define FORT_COARSIG COARSIGB # define FORT_RESTRICT COARSRESB # define FORT_INTERP INTERPHG # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_HGPHIBC hgphibc # define FORT_OLDHGPHIBC oldhgphibc # define FORT_PHI_FROM_X phifromx # define FORT_ALLPHI_FROM_X allphifromx # define FORT_FILL_ONED filloned # define FORT_FILL_TWOD filltwod # define FORT_RHOGBC rhogbc # define FORT_EXTRAP_PROJ extrapproj # define FORT_COMPUTE_COEFF computecoeff # define FORT_HGRELAX hgrelax # define FORT_HG_RESHIFT_PHI hgreshiftphi # define FORT_HG_SHIFT_PHI hgshiftphi # define FORT_HGRESID hgresid # define FORT_HGSUBTRACTAVGPHI hgsubtractavgphi # define FORT_SOLVEHG solvehg # define FORT_COARSIG coarsigb # define FORT_RESTRICT coarsresb # define FORT_INTERP interphg # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_HGPHIBC hgphibc_ # define FORT_OLDHGPHIBC oldhgphibc_ # define FORT_PHI_FROM_X phifromx_ # define FORT_ALLPHI_FROM_X allphifromx_ # define FORT_FILL_ONED filloned_ # define FORT_FILL_TWOD filltwod_ # define FORT_RHOGBC rhogbc_ # define FORT_EXTRAP_PROJ extrapproj_ # define FORT_COMPUTE_COEFF computecoeff_ # define FORT_HGRELAX hgrelax_ # define FORT_HG_SHIFT_PHI hgshiftphi_ # define FORT_HG_RESHIFT_PHI hgreshiftphi_ # define FORT_HGRESID hgresid_ # define FORT_HGSUBTRACTAVGPHI hgsubtractavgphi_ # define FORT_SOLVEHG solvehg_ # define FORT_COARSIG coarsigb_ # define FORT_RESTRICT coarsresb_ # define FORT_INTERP interphg_ # endif #include extern "C" { #if (BL_SPACEDIM == 2) void FORT_HGPHIBC(const Real* hx, const Real* sigE, const Real* s, const Real* x, const int* length, const int* isPeriodicInX); void FORT_OLDHGPHIBC(const Real* hx, const Real* rcen, const Real* uE, const Real* divE, const Real* rhoE, const Real* x, const Real* flag, const int* length, const int* isPeriodicInX); void FORT_FILL_ONED(int* lenx, int* leny, int* length, int * faces, int * numOutFlowFaces, const Real* cc0, const Real* cc1, const Real* cc2, const Real* cc3, const Real* r0, const Real* r1, const Real* r2, const Real* r3, Real * cc_conn, Real* s, const int* isPeriodic, const Real* hx, const Real* hy); void FORT_ALLPHI_FROM_X(int* lenx, int* leny, int* length, int * faces, int * numOutFlowFaces, const Real* phi0, const Real* phi1, const Real* phi2, const Real* phi3, Real * x); #elif (BL_SPACEDIM == 3) void FORT_FILL_TWOD(int* lenx, int* leny, int* lenz, int* length, int* width, int * faces, int * numOutFlowFaces, const Real* cc0, const Real* cc1, const Real* cc2, const Real* cc3, const Real* cc4, const Real* cc5, Real * cc_conn); void FORT_ALLPHI_FROM_X(int* lenx, int* leny, int* lenz, int* length, int* width, int * faces, int * numOutFlowFaces, const Real* phi0, const Real* phi1, const Real* phi2, const Real* phi3, const Real* phi4, const Real* phi5, Real * x, ARLIM_P(x_lo), ARLIM_P(x_hi)); #endif void FORT_PHI_FROM_X(ARLIM_P(phi_lo), ARLIM_P(phi_hi), const Real* phi, int * length, Real * x, int * isPeriodicInX); void FORT_RHOGBC(const Real* rho, ARLIM_P(rho_lo), ARLIM_P(rho_hi), const Real* phi, ARLIM_P(phi_lo), ARLIM_P(phi_hi), int * face, const Real* gravity, const Real* dx); void FORT_COMPUTE_COEFF(ARLIM_P(rhslo),ARLIM_P(rhshi),const Real* rhsPtr, ARLIM_P(betalo),ARLIM_P(betahi),const Real* betaPtr, ARLIM_P(uElo), ARLIM_P(uEhi), const Real* uExtPtr, ARLIM_P(divuElo),ARLIM_P(divuEhi), const Real* divuEPtr, ARLIM_P(rhoElo),ARLIM_P(rhoEhi),const Real* rhoEPtr, #if (BL_SPACEDIM == 2) int* r_lo,int* r_hi,Real* rcen, #endif const int* faceLo, const int* faceHi, const Real* dx,const int* isPeriodicPerp); void FORT_EXTRAP_PROJ(ARLIM_P(u_lo), ARLIM_P(u_hi), const Real* u, ARLIM_P(d_lo), ARLIM_P(d_hi), const Real* div, ARLIM_P(rho_lo), ARLIM_P(rho_hi), const Real* rho, #if (BL_SPACEDIM == 2) int* r_len, const Real* redge, #endif ARLIM_P(uE_lo), ARLIM_P(uE_hi), const Real* uE, ARLIM_P(dE_lo), ARLIM_P(dE_hi), const Real* divE, ARLIM_P(rhoE_lo), ARLIM_P(rhoE_hi), const Real* rhoE, const int* faceLo, const int* faceHi, int* face, int* zeroIt, const Real* hx); void FORT_HGRELAX (ARLIM_P(rhslo), ARLIM_P(rhshi), const Real* rhs, ARLIM_P(betalo), ARLIM_P(betahi), const Real* beta, ARLIM_P(philo), ARLIM_P(phihi), const Real* phi, ARLIM_P(dgphilo), ARLIM_P(dgphihi), const Real* dgphi, const int* faceLo, const int* faceHi, const Real* h, const int* isPeriodic, const int* niter); void FORT_HG_RESHIFT_PHI(ARLIM_P(outlo),ARLIM_P(outhi),const Real* outPtr, ARLIM_P(inlo),ARLIM_P(inhi),const Real* inPtr, const int* face); void FORT_HG_SHIFT_PHI(ARLIM_P(outlo),ARLIM_P(outhi),const Real* outPtr, ARLIM_P(inlo),ARLIM_P(inhi),const Real* inPtr, const int* face); void FORT_HGRESID (ARLIM_P(rhslo), ARLIM_P(rhshi), const Real* rhs, ARLIM_P(betalo), ARLIM_P(betahi), const Real* beta, ARLIM_P(philo), ARLIM_P(phihi), const Real* phi, ARLIM_P(residlo), ARLIM_P(residhi), const Real* resid, ARLIM_P(dgphilo), ARLIM_P(dgphihi), const Real* dgphi, const int* faceLo, const int* faceHi, const Real* h, const int* isPeriodic, const Real* maxnorm); void FORT_HGSUBTRACTAVGPHI(ARLIM_P(philo),ARLIM_P(phihi),const Real* phi, #if (BL_SPACEDIM == 2) int* r_lo, int* r_hi, const Real* r, #endif const int* faceLo, const int* faceHi, const int* isPeriodic); void FORT_SOLVEHG(Real * dest, ARLIM_P(dest_lo),ARLIM_P(dest_hi), Real * dest0, ARLIM_P(dest0_lo),ARLIM_P(dest0_hi), Real * source, ARLIM_P(source_lo),ARLIM_P(source_hi), Real * sigma, ARLIM_P(sigma_lo),ARLIM_P(sigma_hi), Real * cen, ARLIM_P(cen_lo),ARLIM_P(cen_hi), Real * r, ARLIM_P(r_lo),ARLIM_P(r_hi), Real * w, ARLIM_P(w_lo),ARLIM_P(w_hi), Real * z, ARLIM_P(z_lo),ARLIM_P(z_hi), Real * x, ARLIM_P(x_lo),ARLIM_P(x_hi), const int* lo, const int* hi, Real * dxFiltered, int * isPeriodicFiltered, int * maxiter, Real* tol, Real* abs_tol, Real* max_jump,Real * norm); void FORT_RESTRICT(Real * resid,ARLIM_P(resid_lo),ARLIM_P(resid_hi), Real * resid_crse, ARLIM_P(resc_lo),ARLIM_P(resc_hi), const int* lo, const int* hi, const int* loc, const int* hic, int * isPeriodic); void FORT_COARSIG(Real * sigma, ARLIM_P(si_lo),ARLIM_P(si_hi), Real * sigmac,ARLIM_P(ns_lo),ARLIM_P(ns_hi), const int* lo, const int* hi, const int* loc, const int* hic, int * isPeriodic); void FORT_INTERP(Real* phi, ARLIM_P(phi_lo),ARLIM_P(phi_hi), Real * temp, ARLIM_P(temp_lo),ARLIM_P(temp_hi), Real * phi_crse, ARLIM_P(phic_lo),ARLIM_P(phic_hi), Real * sig, ARLIM_P(sig_lo),ARLIM_P(sig_hi), const int* lo, const int* hi, const int* loc, const int* hic, const int* isPeriodic); } #endif #endif ccseapps-2.5/CCSEApps/iamrlib/ProjOutFlowBC.cpp0000644000175000017500000006273311634153073022454 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ProjOutFlowBC.cpp,v 1.28 2003/02/21 22:49:10 car Exp $ // #include #include "ProjOutFlowBC.H" #include "PROJOUTFLOWBC_F.H" #include "ParmParse.H" #define DEF_LIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ Real* fabdat = (fab).dataPtr(); #define DEF_CLIMITS(fab,fabdat,fablo,fabhi) \ const int* fablo = (fab).loVect(); \ const int* fabhi = (fab).hiVect(); \ const Real* fabdat = (fab).dataPtr(); #define DEF_BOX_LIMITS(box,boxlo,boxhi) \ const int* boxlo = (box).loVect(); \ const int* boxhi = (box).hiVect(); #if (BL_SPACEDIM == 3) Real ProjOutFlowBC::tol = 1.0e-10; Real ProjOutFlowBC::abs_tol = 5.0e-10; int ProjOutFlowBC_MG::verbose = 0; bool ProjOutFlowBC_MG::useCGbottomSolver = true; Real ProjOutFlowBC_MG::cg_tol = 1.0e-2; Real ProjOutFlowBC_MG::cg_abs_tol = 5.0e-12; Real ProjOutFlowBC_MG::cg_max_jump = 10.0; int ProjOutFlowBC_MG::cg_maxiter = 40; int ProjOutFlowBC_MG::maxIters = 40; #endif static Box semiSurroundingNodes (const Box& baseBox, int direction) { Box sBox = BoxLib::surroundingNodes(baseBox); sBox.growHi(direction,-1); return sBox; } ProjOutFlowBC::ProjOutFlowBC () { ParmParse pp("projoutflow"); #if (BL_SPACEDIM == 3) pp.query("tol",tol); pp.query("abs_tol",abs_tol); #endif } #if 1 void ProjOutFlowBC::computeBC (FArrayBox velMF[][2*BL_SPACEDIM], FArrayBox divuMF[2*BL_SPACEDIM], FArrayBox rhoMF[2*BL_SPACEDIM], FArrayBox phiMF[2*BL_SPACEDIM], const Geometry& geom, Orientation* outFaces, int numOutFlowFaces, Real gravity) { BL_ASSERT(numOutFlowFaces <= 2*BL_SPACEDIM); int i,iface; int faces[2*BL_SPACEDIM]; for (i = 0; i < numOutFlowFaces; i++) faces[i] = int(outFaces[i]); const Real* dx = geom.CellSize(); const Box& domain = geom.Domain(); int lenx = domain.length()[0]; int leny = domain.length()[1]; int zeroIt[2*BL_SPACEDIM]; for (int i = 0; i < numOutFlowFaces; i++) zeroIt[i] = 0; #if (BL_SPACEDIM == 2) Real* rcen[2*BL_SPACEDIM]; Real* redge[2*BL_SPACEDIM]; #endif FArrayBox ccExt[2*BL_SPACEDIM]; int isPeriodic[BL_SPACEDIM]; for (int dir = 0; dir < BL_SPACEDIM; dir++) isPeriodic[dir] = geom.isPeriodic(dir); IntVect loFiltered, hiFiltered; int isPeriodicFiltered[2*BL_SPACEDIM][BL_SPACEDIM]; Real dxFiltered[2*BL_SPACEDIM][BL_SPACEDIM]; for (int iface = 0; iface < numOutFlowFaces; iface++) { int outDir = outFaces[iface].coordDir(); // // Filter out the direction we don't care about. // int ncStripWidth = 1; Box origBox = BoxLib::adjCell(domain,outFaces[iface],ncStripWidth); IntVect lo = origBox.smallEnd(); IntVect hi = origBox.bigEnd(); // // Rearrange the box, dx, and isPeriodic so that the dimension that is 1 // is the last dimension. // int cnt = 0; for (int dir = 0; dir < BL_SPACEDIM; dir++) { if (dir != outDir) { loFiltered[cnt] = lo[dir]; hiFiltered[cnt] = hi[dir]; dxFiltered[iface][cnt] = dx[dir]; isPeriodicFiltered[iface][cnt] = isPeriodic[dir]; cnt++; } else { loFiltered[BL_SPACEDIM-1] = lo[dir]; hiFiltered[BL_SPACEDIM-1] = hi[dir]; dxFiltered[iface][BL_SPACEDIM-1] = dx[dir]; isPeriodicFiltered[iface][BL_SPACEDIM-1] = isPeriodic[dir]; } } Box faceBox(loFiltered,hiFiltered); for (int dir = 0; dir < BL_SPACEDIM-1; dir++) faceBox.grow(dir,1); // One for rho, one for divu, (BL_SPACEDIM-1) for velocity. ccExt[iface].resize(faceBox,BL_SPACEDIM+1); #if (BL_SPACEDIM == 2) // // Make edge-centered and cc r (set = 1 if cartesian) // int perpDir = 1 - outDir; int r_len = domain.length()[perpDir]+1; rcen[iface] = new Real[r_len-1]; redge[iface] = new Real[r_len]; // Here we know the ordering of faces is XLO,YLO,XHI,YHI. if (CoordSys::IsRZ()) { if (faces[iface] == 0) { for (i=0;i rcen; int r_len = 0; #endif DEF_BOX_LIMITS(origBox,origLo,origHi); const int* ccElo = ccExt[iface].loVect(); const int* ccEhi = ccExt[iface].hiVect(); const Real* rhoEPtr = ccExt[iface].dataPtr(0); const Real* divuEPtr = ccExt[iface].dataPtr(1); const Real* uEPtr = ccExt[iface].dataPtr(2); DEF_LIMITS(divuMF[iface], divuPtr, divulo, divuhi); DEF_LIMITS( rhoMF[iface], rhoPtr, rholo, rhohi); DEF_LIMITS( velMF[0][iface], velPtr, vello, velhi); // // Extrapolate the velocities, divu, and rho to the outflow edge in // the shifted coordinate system (where the last dimension is 1). // Real hx = dx[0]; FORT_EXTRAP_PROJ(ARLIM(vello), ARLIM(velhi), velPtr, ARLIM(divulo), ARLIM(divuhi), divuPtr, ARLIM(rholo), ARLIM(rhohi),rhoPtr, #if (BL_SPACEDIM == 2) &r_len,redge[iface], #endif ARLIM(ccElo),ARLIM(ccEhi),uEPtr, ARLIM(ccElo),ARLIM(ccEhi),divuEPtr, ARLIM(ccElo),ARLIM(ccEhi),rhoEPtr, origLo,origHi,&faces[iface],&zeroIt[iface],&hx); } int connected = 0; // Test for whether multiple faces are touching. // therefore not touching. int numRegions = 1; if ( (numOutFlowFaces == 2) && (outFaces[0].coordDir() == outFaces[1].coordDir()) ) numRegions = 2; if (numOutFlowFaces == 2) { if (outFaces[0].coordDir() != outFaces[1].coordDir()) connected = 1; } else if (numOutFlowFaces > 2) { connected = 1; } // Since we only use a constant dx in the Fortran, // we'll assume for now we can choose either one. if (numRegions == 1 && numOutFlowFaces > 1) BL_ASSERT(dx[0] == dx[1]); // Note numRegions = 1 or 2, those are the only possibilities. for (int ireg = 0; ireg < numRegions; ireg++) { // Define connected region. In both 2-d and 3-d, if there are // multiple outflow faces and it's not just two across from // each other, then the multiple faces form a *single* // connected region. int zeroAll = zeroIt[ireg]; if (numRegions == 1) for (int i = 0; i < numOutFlowFaces; i++) if (zeroIt[i] == 0) zeroAll = 0; // HACK HACK zeroAll = 1; if (zeroAll) { for (int i=0; i < numOutFlowFaces; i++) { phiMF[i].setVal(0); } } else { int faces[2*BL_SPACEDIM]; int numOutFlowFacesInRegion; if (numRegions == 1) { for (int i=0; i < numOutFlowFaces; i++) faces[i] = int(outFaces[i]); numOutFlowFacesInRegion = numOutFlowFaces; } else if (numRegions == 2) { faces[0] = int(outFaces[ireg]); numOutFlowFacesInRegion = 1; } #if (BL_SPACEDIM == 2) // Here we know the ordering of faces is XLO,XHI,YLO,YHI. int length = 0; Real *ccEptr0,*ccEptr1,*ccEptr2,*ccEptr3; Real *r0,*r1,*r2,*r3; for (int i=0; i < numOutFlowFacesInRegion; i++) { if (faces[i] == 0) { ccEptr0 = ccExt[i].dataPtr(); r0 = rcen[i]; length = length + leny; } else if (faces[i] == 1) { ccEptr1 = ccExt[i].dataPtr(); r1 = rcen[i]; length = length + lenx; } else if (faces[i] == 2) { ccEptr2 = ccExt[i].dataPtr(); r2 = rcen[i]; length = length + leny; } else if (faces[i] == 3) { ccEptr3 = ccExt[i].dataPtr(); r3 = rcen[i]; length = length + lenx; } } IntVect loconn; IntVect hiconn; loconn[0] = 0; hiconn[0] = length-1; loconn[BL_SPACEDIM-1] = 0; hiconn[BL_SPACEDIM-1] = 0; Box connected_region(loconn,hiconn); FArrayBox ccE_conn(connected_region,1); hiconn[0] = length; Box nodal_connected_region(loconn,hiconn); FArrayBox x(nodal_connected_region,1); FArrayBox s(nodal_connected_region,1); s.setVal(0.); ccE_conn.setVal(1.e200); int per = 0; if ( (numOutFlowFaces == 1) || (numRegions == 2) ) per = isPeriodicFiltered[ireg][0]; FORT_FILL_ONED(&lenx,&leny,&length,faces,&numOutFlowFacesInRegion, ccEptr0, ccEptr1, ccEptr2, ccEptr3, r0,r1,r2,r3, ccE_conn.dataPtr(),s.dataPtr(),&per, &(dx[0]),&(dx[1])); if (numOutFlowFaces == 2*BL_SPACEDIM) per = 1; FORT_HGPHIBC(dx, ccE_conn.dataPtr(0), s.dataPtr(), x.dataPtr(), &length,&per); Real *phiptr0,*phiptr1,*phiptr2,*phiptr3; for (int i=0; i < numOutFlowFacesInRegion; i++) { if (faces[i] == 0) { phiptr0 = phiMF[i].dataPtr(); } if (faces[i] == 1) { phiptr1 = phiMF[i].dataPtr(); } if (faces[i] == 2) { phiptr2 = phiMF[i].dataPtr(); } if (faces[i] == 3) { phiptr3 = phiMF[i].dataPtr(); } } FORT_ALLPHI_FROM_X(&lenx,&leny,&length,faces,&numOutFlowFaces, phiptr0, phiptr1, phiptr2, phiptr3, x.dataPtr()); #else // Assert that, if faces are connected, one of the coordinate // directions has no outflow faces. int outx = 0; int outy = 0; int outz = 0; for (int iface = 0; iface < numOutFlowFaces; iface++) { int outDir = outFaces[iface].coordDir(); if (outDir == 0) outx = 1; if (outDir == 1) outy = 1; if (outDir == 2) outz = 1; } int sum_dirs = outx + outy + outz; BL_ASSERT (sum_dirs > 0 && sum_dirs < 3); BL_ASSERT(dx[1] == dx[2]); // Here we know the ordering of faces is XLO,YLO,ZLO,XHI,YHI,ZHI. // FOR NOW: ASSERT THAT NO OUTFLOW FACES IN Z-DIR! BL_ASSERT (outz == 0); int lenz = domain.length()[2]; int length = 0; int width = lenz; Real *ccEptr0,*ccEptr1,*ccEptr2,*ccEptr3,*ccEptr4,*ccEptr5; for (int i=0; i < numOutFlowFaces; i++) { if (faces[i] == 0) { ccEptr0 = ccExt[i].dataPtr(); length = length + leny*lenz; } else if (faces[i] == 1) { ccEptr1 = ccExt[i].dataPtr(); length = length + lenx*lenz; } else if (faces[i] == 2) { ccEptr2 = ccExt[i].dataPtr(); length = length + lenx*leny; } else if (faces[i] == 3) { ccEptr3 = ccExt[i].dataPtr(); length = length + leny*lenz; } else if (faces[i] == 4) { ccEptr4 = ccExt[i].dataPtr(); length = length + lenx*lenz; } else if (faces[i] == 5) { ccEptr5 = ccExt[i].dataPtr(); length = length + lenx*leny; } else { std::cout << "OOPS - DIDNT PROGRAM FOR Z-OUTFLOW FACES! " << i << " " << faces[i] << std::endl; exit(0); } } IntVect loconn; IntVect hiconn; loconn[0] = 0; hiconn[0] = length-1; loconn[1] = 0; hiconn[1] = width-1; loconn[BL_SPACEDIM-1] = 0; hiconn[BL_SPACEDIM-1] = 0; Box connected_region(loconn,hiconn); FArrayBox ccE_conn(connected_region,BL_SPACEDIM+1); hiconn[0] = length; hiconn[1] = width; Box nodal_connected_region(loconn,hiconn); FArrayBox phiFiltered(nodal_connected_region,1); phiFiltered.setVal(0.); FORT_FILL_TWOD(&lenx,&leny,&lenz,&length,&width, faces,&numOutFlowFaces, ccEptr0, ccEptr1, ccEptr2, ccEptr3, ccEptr4, ccEptr5, ccE_conn.dataPtr()); FArrayBox rhs_temp, beta; int* per = new int[2]; per[0] = (numOutFlowFaces == 2*BL_SPACEDIM) ? 1 : 0; per[1] = isPeriodic[BL_SPACEDIM-1]; computeCoefficients(rhs_temp,beta,ccE_conn,connected_region,dxFiltered[0],per); // // Need phi to have ghost cells. // Box phiGhostBox = OutFlowBC::SemiGrow(phiFiltered.box(),1,BL_SPACEDIM-1); FArrayBox phi(phiGhostBox,1); phi.setVal(0); phi.copy(phiFiltered); Box grownRhs = OutFlowBC::SemiGrow(rhs_temp.box(),1,BL_SPACEDIM-1); FArrayBox rhs(grownRhs,1); rhs.setVal(0); rhs.copy(rhs_temp); FArrayBox resid(rhs.box(),1); ProjOutFlowBC_MG proj_mg(connected_region,&phi,&rhs,&resid,&beta, dxFiltered[0],per); proj_mg.solve(tol,abs_tol,2,2,proj_mg.MaxIters(),proj_mg.Verbose()); DEF_LIMITS(phi,phiPtr,phi_lo,phi_hi); DEF_BOX_LIMITS(connected_region,lo,hi); // // Subtract the average phi. // // FORT_HGSUBTRACTAVGPHI(ARLIM(phi_lo),ARLIM(phi_hi),phiPtr, // lo,hi,isPeriodicFiltered); // // Translate the solution back to the original coordinate system. // // FORT_HG_RESHIFT_PHI(ARLIM(phiFab_lo),ARLIM(phiFab_hi),phiFabPtr, // ARLIM(phi_lo),ARLIM(phi_hi),phiPtr,&face); Real *phiptr0,*phiptr1,*phiptr2,*phiptr3,*phiptr4,*phiptr5; for (int i=0; i < numOutFlowFaces; i++) { if (faces[i] == 0) { phiptr0 = phiMF[i].dataPtr(); } else if (faces[i] == 1) { phiptr1 = phiMF[i].dataPtr(); } else if (faces[i] == 2) { phiptr2 = phiMF[i].dataPtr(); } else if (faces[i] == 3) { phiptr3 = phiMF[i].dataPtr(); } else if (faces[i] == 4) { phiptr4 = phiMF[i].dataPtr(); } else if (faces[i] == 5) { phiptr5 = phiMF[i].dataPtr(); } } FORT_ALLPHI_FROM_X(&lenx,&leny,&lenz,&length,&width,faces,&numOutFlowFaces, phiptr0, phiptr1, phiptr2, phiptr3, phiptr4, phiptr5, phi.dataPtr(),ARLIM(phi_lo),ARLIM(phi_hi)); #endif } } if (std::abs(gravity) > 0.) for (int iface = 0; iface < numOutFlowFaces; iface++) { int face = int(outFaces[iface]); int outDir = outFaces[iface].coordDir(); DEF_LIMITS(phiMF[iface], phiPtr,philo,phihi); DEF_LIMITS(rhoMF[iface], rhoPtr,rholo,rhohi); if (outDir != (BL_SPACEDIM-1)) FORT_RHOGBC(rhoPtr,ARLIM(rholo),ARLIM(rhohi), phiPtr,ARLIM(philo),ARLIM(phihi), &face,&gravity,dx); } } #endif void ProjOutFlowBC::computeRhoG (FArrayBox* rhoMF, FArrayBox* phiMF, const Geometry& geom, Orientation* outFaces, int numOutFlowFaces, Real gravity) { const Real* dx = geom.CellSize(); const Box& domain = geom.Domain(); for (int iface = 0; iface < numOutFlowFaces; iface++) { int face = int(outFaces[iface]); int outDir = outFaces[iface].coordDir(); DEF_LIMITS(phiMF[iface], phiPtr,philo,phihi); DEF_LIMITS(rhoMF[iface], rhoPtr,rholo,rhohi); if (outDir != (BL_SPACEDIM-1) && std::abs(gravity) > 0.0) FORT_RHOGBC(rhoPtr,ARLIM(rholo),ARLIM(rhohi), phiPtr,ARLIM(philo),ARLIM(phihi), &face,&gravity,dx); } } #if (BL_SPACEDIM == 3) void ProjOutFlowBC::computeCoefficients (FArrayBox& rhs, FArrayBox& beta, FArrayBox& ccExt, Box& faceBox, Real* dxFiltered, int* isPeriodicFiltered) { Box rhsBox = semiSurroundingNodes(faceBox,BL_SPACEDIM-1); Box betaBox = OutFlowBC::SemiGrow(faceBox,1,BL_SPACEDIM-1); beta.resize(betaBox,1); rhs.resize(rhsBox,1); DEF_BOX_LIMITS(faceBox,faceLo,faceHi); DEF_LIMITS(beta, betaPtr, betalo,betahi); DEF_LIMITS(rhs, rhsPtr, rhslo,rhshi); const int* ccElo = ccExt.loVect(); const int* ccEhi = ccExt.hiVect(); Real* rhoEPtr = ccExt.dataPtr(0); Real* divuEPtr = ccExt.dataPtr(1); Real* uEPtr = ccExt.dataPtr(2); FORT_COMPUTE_COEFF(ARLIM(rhslo),ARLIM(rhshi),rhsPtr, ARLIM(betalo),ARLIM(betahi),betaPtr, ARLIM(ccElo),ARLIM(ccEhi),uEPtr, ARLIM(ccElo),ARLIM(ccEhi),divuEPtr, ARLIM(ccElo),ARLIM(ccEhi),rhoEPtr, faceLo,faceHi, dxFiltered,isPeriodicFiltered); } ProjOutFlowBC_MG::ProjOutFlowBC_MG (const Box& Domain, FArrayBox* Phi, FArrayBox* Rhs, FArrayBox* Resid, FArrayBox* Beta, Real* H, int* IsPeriodic) : OutFlowBC_MG(Domain,Phi,Rhs,Resid,Beta,H,IsPeriodic,true) { static int first = true; if (first) { first = false; ParmParse pp("proj_mg"); pp.query("v",verbose); pp.query("useCGbottomSolver",useCGbottomSolver); pp.query("cg_tol",cg_tol); pp.query("cg_abs_tol",cg_abs_tol); pp.query("cg_max_jump",cg_max_jump); pp.query("cg_maxiter",cg_maxiter); pp.query("maxIters",maxIters); } const IntVect& len = domain.length(); int min_length = 4; bool test_side[BL_SPACEDIM-1]; for (int dir = 0; dir < BL_SPACEDIM-1; dir++) test_side[dir] = (len[dir]&1) != 0 || len[dir] < min_length; if (D_TERM(1 && ,test_side[0], || test_side[1])) { if (useCGbottomSolver) { Box temp1Box = OutFlowBC::SemiGrow(domain,1,BL_SPACEDIM-1); Box temp2Box = semiSurroundingNodes(temp1Box,BL_SPACEDIM-1); cgwork = new FArrayBox(temp2Box,4); } } else { Real newh[BL_SPACEDIM]; for (int dir = 0; dir < BL_SPACEDIM; dir++) newh[dir] = 2*h[dir]; Box newdomain = OutFlowBC::SemiCoarsen(domain,2,BL_SPACEDIM-1); Box grownBox = OutFlowBC::SemiGrow(newdomain,1,BL_SPACEDIM-1); Box nodes = semiSurroundingNodes(newdomain,BL_SPACEDIM-1); Box newp_size = OutFlowBC::SemiGrow(nodes,1,BL_SPACEDIM-1); FArrayBox* newphi = new FArrayBox(newp_size,1); FArrayBox* newresid = new FArrayBox(newp_size,1); FArrayBox* newrhs = new FArrayBox(newp_size,1); FArrayBox* newbeta = new FArrayBox(grownBox,1); newphi->setVal(0); newresid->setVal(0); newbeta->setVal(0); DEF_BOX_LIMITS(domain,dom_lo,dom_hi); DEF_BOX_LIMITS(newdomain,new_lo,new_hi); DEF_LIMITS(*beta,betaPtr,beta_lo,beta_hi); DEF_LIMITS(*newbeta,newbetaPtr,newbeta_lo,newbeta_hi); FORT_COARSIG(betaPtr,ARLIM(beta_lo),ARLIM(beta_hi), newbetaPtr,ARLIM(newbeta_lo),ARLIM(newbeta_hi), dom_lo,dom_hi,new_lo,new_hi,isPeriodic); next = new ProjOutFlowBC_MG(newdomain,newphi,newrhs,newresid, newbeta,newh,isPeriodic); } } ProjOutFlowBC_MG::~ProjOutFlowBC_MG () {} Real ProjOutFlowBC_MG::residual () { Real rnorm; FArrayBox dgphi(semiSurroundingNodes(domain,BL_SPACEDIM-1),1); DEF_BOX_LIMITS(domain,lo,hi); DEF_LIMITS(*rhs,rhsPtr,rhslo,rhshi); DEF_LIMITS(*beta,betaPtr,betalo,betahi); DEF_LIMITS(*phi,phiPtr,philo,phihi); DEF_LIMITS(*resid,residPtr,residlo,residhi); DEF_LIMITS(dgphi,dgphiPtr,dglo,dghi); resid->setVal(0); FORT_HGRESID (ARLIM(rhslo), ARLIM(rhshi), rhsPtr, ARLIM(betalo), ARLIM(betahi), betaPtr, ARLIM(philo), ARLIM(phihi), phiPtr, ARLIM(residlo), ARLIM(residhi), residPtr, ARLIM(dglo), ARLIM(dghi), dgphiPtr, lo, hi, h, isPeriodic, &rnorm); return rnorm; } void ProjOutFlowBC_MG::step (int nGSRB) { if (cgwork != 0) { Real resnorm = 0.0; FArrayBox dest0(phi->box(),1); DEF_BOX_LIMITS(domain,lo,hi); DEF_LIMITS(*phi,phiPtr,phi_lo,phi_hi); DEF_LIMITS(*resid,residPtr,resid_lo,resid_hi); DEF_LIMITS(dest0,dest0Ptr,dest0_lo,dest0_hi); DEF_LIMITS(*rhs,rhsPtr,rhs_lo,rhs_hi); DEF_LIMITS(*beta, betaPtr, beta_lo,beta_hi); DEF_LIMITS(*cgwork,dummPtr,cg_lo,cg_hi); FORT_SOLVEHG(phiPtr,ARLIM(phi_lo),ARLIM(phi_hi), dest0Ptr, ARLIM(dest0_lo),ARLIM(dest0_hi), rhsPtr,ARLIM(rhs_lo),ARLIM(rhs_hi), betaPtr, ARLIM(beta_lo),ARLIM(beta_hi), cgwork->dataPtr(0),ARLIM(cg_lo),ARLIM(cg_hi), cgwork->dataPtr(1), ARLIM(cg_lo),ARLIM(cg_hi), cgwork->dataPtr(2), ARLIM(cg_lo),ARLIM(cg_hi), cgwork->dataPtr(3),ARLIM(cg_lo),ARLIM(cg_hi), residPtr, ARLIM(resid_lo),ARLIM(resid_hi), lo,hi,h,isPeriodic,&cg_maxiter,&cg_tol, &cg_abs_tol,&cg_max_jump,&resnorm); } else { gsrb(nGSRB); } } void ProjOutFlowBC_MG::Restrict () { DEF_BOX_LIMITS(domain,lo,hi); DEF_BOX_LIMITS(next->theDomain(),loc,hic); DEF_LIMITS(*resid,residPtr,resid_lo,resid_hi); DEF_LIMITS(*(next->theRhs()),rescPtr,resc_lo,resc_hi); next->theRhs()->setVal(0); FORT_RESTRICT(residPtr,ARLIM(resid_lo),ARLIM(resid_hi), rescPtr, ARLIM(resc_lo),ARLIM(resc_hi), lo,hi,loc,hic,isPeriodic); } void ProjOutFlowBC_MG::interpolate () { FArrayBox temp(phi->box(),1); temp.setVal(0); DEF_BOX_LIMITS(domain,lo,hi); DEF_BOX_LIMITS(next->theDomain(),loc,hic); DEF_LIMITS(*phi,phiPtr,phi_lo,phi_hi); DEF_LIMITS(temp,tempPtr,temp_lo,temp_hi); DEF_LIMITS(*(next->thePhi()),deltacPtr,deltac_lo,deltac_hi); DEF_LIMITS(*beta,betaPtr,beta_lo,beta_hi); FORT_INTERP(phiPtr, ARLIM(phi_lo),ARLIM(phi_hi), tempPtr, ARLIM(temp_lo),ARLIM(temp_hi), deltacPtr, ARLIM(deltac_lo),ARLIM(deltac_hi), betaPtr, ARLIM(beta_lo),ARLIM(beta_hi), lo,hi,loc,hic,isPeriodic); } void ProjOutFlowBC_MG::gsrb (int nstep) { FArrayBox dgphi(semiSurroundingNodes(domain,BL_SPACEDIM-1),1); DEF_BOX_LIMITS(domain,lo,hi); DEF_LIMITS(*phi,phiPtr,philo,phihi); DEF_LIMITS(*beta, betaPtr, betalo,betahi); DEF_LIMITS(*rhs, rhsPtr, rhslo,rhshi); DEF_LIMITS(dgphi,dgphiPtr,dglo,dghi); FORT_HGRELAX(ARLIM(rhslo),ARLIM(rhshi),rhsPtr, ARLIM(betalo),ARLIM(betahi),betaPtr, ARLIM(philo),ARLIM(phihi),phiPtr, ARLIM(dglo),ARLIM(dghi),dgphiPtr, lo,hi,h,isPeriodic,&nstep); } #endif ccseapps-2.5/CCSEApps/iamrlib/Godunov.H0000644000175000017500000003277111634153073021042 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _GODUNOV_CLASS_H_ #define _GODUNOV_CLASS_H_ // // $Id: Godunov.H,v 1.13 2003/02/18 21:35:03 almgren Exp $ // // // A useful enumeration of the forms for the advective terms // enum AdvectionForm {Conservative = 0, NonConservative}; enum AdvectionScheme {PRE_MAC, FPU, BDS}; //=========================================================== // This header file defines the Godunov driver class. Its // interface simplifies the calling sequence for the Godunov // box //=========================================================== class Godunov { public: // public access functions // ============================================================= // Setup functions follow // ============================================================= // construct the advection object Godunov(); // size 1d work space explicitly Godunov( int max_size ); // read parameters void read_params(); // destruct the advection object ~Godunov(); // set up the Godunov Box virtual void Setup( const Box &grd, const Real *dx, Real dt, int set_fluxes, FArrayBox &xflux, const int *ubc, FArrayBox &yflux, const int *vbc, #if (BL_SPACEDIM == 3 ) FArrayBox &zflux, const int *wbc, #endif FArrayBox &S, FArrayBox &Rho, const FArrayBox& tforces); // ============================================================= // Data access functions // ============================================================== int useForcesInTrans() {return use_forces_in_trans;} // ============================================================= // Advection functions follow // ============================================================= // compute the edge states void edge_states( const Box &grd, const Real *dx, Real dt, int velpred, FArrayBox &uedge, FArrayBox &stx, FArrayBox &vedge, FArrayBox &sty, #if (BL_SPACEDIM == 3 ) FArrayBox &wedge, FArrayBox &stz, #endif FArrayBox &U, FArrayBox &S, FArrayBox &tforces, FArrayBox& divu, int fab_ind, int state_ind, const int *bc, int use_conserv, AdvectionScheme which_scheme); // compute the edge states void edge_states_orig( const Box &grd, const Real *dx, Real dt, int velpred, FArrayBox &uedge, FArrayBox &stx, FArrayBox &vedge, FArrayBox &sty, #if (BL_SPACEDIM == 3 ) FArrayBox &wedge, FArrayBox &stz, #endif FArrayBox &U, FArrayBox &S, FArrayBox &tforces, int fab_ind, int state_ind, const int *bc); // compute the edge states, edges velocities filled in grow cells void edge_states_fpu( const Box &grd, const Real *dx, Real dt, int velpred, FArrayBox &uedge, FArrayBox &stx, FArrayBox &vedge, FArrayBox &sty, #if (BL_SPACEDIM == 3 ) FArrayBox &wedge, FArrayBox &stz, #endif FArrayBox &S, FArrayBox &tforces, FArrayBox& divu, int fab_ind, int state_ind, const int *bc, int inconserv ); // compute the edge states using the BDS algorithm void edge_states_bds( const Box &grd, const Real *dx, Real dt, int velpred, FArrayBox &uedge, FArrayBox &stx, FArrayBox &vedge, FArrayBox &sty, #if (BL_SPACEDIM == 3 ) FArrayBox &wedge, FArrayBox &stz, #endif FArrayBox &S, FArrayBox &tforces, FArrayBox& divu, int fab_ind, int state_ind, const int *bc, int inconserv ); // compute divergent mac velocities void ComputeUmac( const Box &grd, const Real *dx, Real dt, FArrayBox &umac, const int *ubc, FArrayBox &vmac, const int *vbc, #if (BL_SPACEDIM == 3 ) FArrayBox &wmac, const int *wbc, #endif FArrayBox &U, FArrayBox &tforces ); // advect a state component virtual void AdvectState( const Box &grd, const Real *dx, Real dt, FArrayBox &areax, FArrayBox &uedge, FArrayBox &xflux, FArrayBox &areay, FArrayBox &vedge, FArrayBox &yflux, #if (BL_SPACEDIM == 3 ) FArrayBox &areaz, FArrayBox &wedge, FArrayBox &zflux, #endif FArrayBox &U, FArrayBox &S, FArrayBox &tforces, FArrayBox& divu, int fab_ind, FArrayBox &aofs, int aofs_ind, int iconserv, int state_ind, const int *bc, AdvectionScheme scheme, FArrayBox &vol ); // compute the advective derivative from fluxes void ComputeAofs( const Box &grd, FArrayBox &areax, FArrayBox &uedge, FArrayBox &xflux, FArrayBox &areay, FArrayBox &vedge, FArrayBox &yflux, #if (BL_SPACEDIM == 3 ) FArrayBox &areaz, FArrayBox &wedge, FArrayBox &zflux, #endif FArrayBox &vol, FArrayBox &aofs, int aofs_ind, int iconserv ); // sync advect a state component virtual void SyncAdvect( const Box &grd, const Real *dx, Real dt, int level, FArrayBox &areax, FArrayBox &uedge, FArrayBox &ucorr, FArrayBox &xflux, FArrayBox &areay, FArrayBox &vedge, FArrayBox &vcorr, FArrayBox &yflux, #if (BL_SPACEDIM == 3 ) FArrayBox &areaz, FArrayBox &wedge, FArrayBox &wcorr, FArrayBox &zflux, #endif FArrayBox &U, FArrayBox &S, FArrayBox &tforces, FArrayBox& divu, int ind, FArrayBox &sync, int sync_ind, int iconserv, int state_ind, const int *bc, AdvectionScheme scheme, FArrayBox &vol ); // compute the advective derivative of corrective fluxes for the mac sync void ComputeSyncAofs( const Box &grd, FArrayBox &areax, FArrayBox &ucorr, FArrayBox &xflux, FArrayBox &areay, FArrayBox &vcorr, FArrayBox &yflux, #if (BL_SPACEDIM == 3 ) FArrayBox &areaz, FArrayBox &wcorr, FArrayBox &zflux, #endif FArrayBox &vol, FArrayBox &sync, int sync_ind, int iconserv ); // correct a scalar for under-over shoots void ScalMinMax( FArrayBox &Sold, FArrayBox &Snew, int ind, const int *bc, const Box &grd ); // ============================================================= // Diagnostic functions follow // ============================================================= // estimate the timestep from the cell-centered quantities Real estdt( FArrayBox &U, FArrayBox &tforces, FArrayBox &Rho, const Box &grd, const Real *dx, Real cfl, Real *u_max ); // test the cell centered Courant number Real test_u_rho( FArrayBox &U, FArrayBox &Rho, const Box &grd, const Real *dx, const Real dt, const Real *u_max ); // test the mac edge velocity Courant numbers Real test_umac_rho( FArrayBox &umac, FArrayBox &vmac, #if (BL_SPACEDIM == 3 ) FArrayBox &wmac, #endif FArrayBox &Rho, const Box &grd, const Real *dx, const Real dt, const Real *u_max ); static bool are_any(const Array& advectionType, const AdvectionForm testForm, const int sComp, const int nComp); static int how_many(const Array& advectionType, const AdvectionForm testForm, const int sComp, const int nComp); // ============================================================= // Source term functions follow // ============================================================= // compute the update rule, this is useful for 1st order RK // psi^n+1 = psi^n + dt*(tf^n) void Add_tf( FArrayBox &Sold, FArrayBox &Snew, int start_ind, int num_comp, FArrayBox &tforces, int tf_ind, const Box &grd, Real dt ); // correct the 1st order RK to 2nd order via // psi^n+1 = psi^* + (dt/2)*(tf^* - tf^n) void Correct_tf( FArrayBox &Sstar, FArrayBox &Snew, int start_ind, int num_comp, FArrayBox &tfstar, FArrayBox &tfn, int tf_ind, const Box &grd, Real dt ); // compute the update rule // psi^n+1 = psi^n - dt*aofs + dt*tforces void Add_aofs_tf( FArrayBox &Sold, FArrayBox &Snew, int start_ind, int num_comp, FArrayBox &Aofs, int aofs_ind, FArrayBox &tforces, int tf_ind, const Box &grd, Real dt ); // compute the update rule for velocities or momenta // psi^n+1 = psi^n - dt*aofs - dt*gp/rho + dt*tforces void Add_aofs_tf_gp( FArrayBox &Uold, FArrayBox &Unew, FArrayBox &Aofs, FArrayBox &tforces, FArrayBox &gp, FArrayBox &rho, const Box &grd, Real dt); // compute total source term for velocities // tforces = (tforces + visc - gp)/rho void Sum_tf_gp_visc( FArrayBox &tforces, FArrayBox &visc, FArrayBox &gp, FArrayBox &Rho); // iconserv==1 => tforces = tforces + visc - divU*S // iconserv==0 => tforces = (tforces+visc)/rho void Sum_tf_divu_visc( FArrayBox &S, FArrayBox &tforces, int s_ind, int num_comp, FArrayBox &visc, int v_ind, FArrayBox &divu, FArrayBox &rho, int iconserv ); // compute total source term for velocities // tforces = (tforces - gp)/rho void Sum_tf_gp( FArrayBox &tforces, FArrayBox &gp, FArrayBox &Rho ); // iconserv==1 => tforces = tforces - divU*S // iconserv==0 => tforces = (tforces)/rho void Sum_tf_divu( FArrayBox &S, FArrayBox &tforces, int s_ind, int num_comp, FArrayBox &divu, FArrayBox &rho, int iconserv ); //================ for debugging purposes this is made public // internal FABS FArrayBox work; // work space for the Godunov Box FArrayBox uad; // work space for advective transverse velocities FArrayBox vad; #if (BL_SPACEDIM == 3 ) FArrayBox wad; #endif // internal parameters int max_1d; // largest dimension size allowed int scr_size; // actual length of the scratch space // 1D arrays used in computing slopes and edges states Real *stxlo; Real *stxhi; Real *slxscr; Real *stylo; Real *styhi; Real *slyscr; #if (BL_SPACEDIM == 3 ) Real *stzlo; Real *stzhi; Real *slzscr; #endif protected: // protected work functions // manipulate 1d scratch space void ZeroScratch(); void SetBogusScratch(); void SetScratch( int max_size ); void RemScratch(); protected: // protected data members // sizing boxes Box work_bx; Box xflux_bx; Box yflux_bx; #if (BL_SPACEDIM == 3 ) Box zflux_bx; #endif // flags static int verbose; static int use_forces_in_trans; // algorithm control parameters static int slope_order; }; #endif ccseapps-2.5/CCSEApps/iamrlib/benchmarks/0000755000175000017500000000000011634153073021413 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/iamrlib/benchmarks/Make.package0000644000175000017500000000050611634153073023606 0ustar amckinstryamckinstry# # $Id: Make.package,v 1.2 2002/12/18 19:27:58 almgren Exp $ # CEXE_sources += WritePlotFile.cpp ViscBench$(DIM)d.cpp CEXE_headers += FEXE_sources += EXACT_$(DIM)D.F FEXE_headers += # # Shared Routines ################### CEXE_sources += DataServices.cpp AmrData.cpp XYPlotDataList.cpp FEXE_sources += FABUTIL_$(DIM)D.F ccseapps-2.5/CCSEApps/iamrlib/benchmarks/GNUmakefile0000644000175000017500000000413311634153073023466 0ustar amckinstryamckinstry# # $Id: GNUmakefile,v 1.6 2002/12/19 19:03:35 almgren Exp $ # PBOXLIB_HOME = ../.. TOP = $(PBOXLIB_HOME) # # Variables for the user to set ... # PRECISION = DOUBLE DEBUG = TRUE PROFILE = FALSE DIM = 2 COMP = g++ USE_MPI = FALSE DEFINES += -DBL_PARALLEL_IO EBASE = ViscBench include $(TOP)/mk/Make.defs include ./Make.package #include $(TOP)/amrlib/Make.package include $(TOP)/bndrylib/Make.package include $(TOP)/BoxLib/Make.package INCLUDE_LOCATIONS += . #INCLUDE_LOCATIONS += $(TOP)/amrlib INCLUDE_LOCATIONS += $(TOP)/bndrylib INCLUDE_LOCATIONS += $(TOP)/BoxLib INCLUDE_LOCATIONS += $(TOP)/pAmrvis ifeq ($(MACHINE),OSF1) # # Some additional stuff for our preferred development/debugging environment. # ifeq ($(PRECISION),DOUBLE) FFLAGS += -real_size 64 endif FDEBF += -C FDEBF += -warn argument_checking FDEBF += -warn declarations ifneq ($(FC), f90) FDEBF += -warn truncated_source FDEBF += -warn unused endif endif vpath_cpp := . $(TOP)/pAmrvis $(TOP)/amrlib $(TOP)/bndrylib $(TOP)/BoxLib vpath_H := . $(TOP)/pAmrvis $(TOP)/amrlib $(TOP)/bndrylib $(TOP)/BoxLib vpath_FH := . $(TOP)/pAmrvis $(TOP)/amrlib $(TOP)/bndrylib $(TOP)/BoxLib vpath_h := . $(TOP)/pAmrvis $(TOP)/amrlib $(TOP)/bndrylib $(TOP)/BoxLib vpath_F := . $(TOP)/pAmrvis $(TOP)/amrlib $(TOP)/bndrylib $(TOP)/BoxLib vpath_f := . $(TOP)/pAmrvis $(TOP)/amrlib $(TOP)/bndrylib $(TOP)/BoxLib vpath %.cpp $(vpath_cpp) vpath %.H $(vpath_H) vpath %.FH $(vpath_FH) vpath %.h $(vpath_h) vpath %.F $(vpath_F) vpath %.f $(vpath_f) all: $(executable) # # Create MS-IDE dsp file to build this project # DspOlevel = 1 DspFileRoot = $(EBASE)$(DIM)d ifeq ($(DEBUG), TRUE) DspOlevel := 0 endif dsp: $(DspFileRoot).dsp .dspDepends: $(FEXE_sources) $(FEXE_headers) $(fEXE_sources) $(CEXE_headers) $(CEXE_sources) $(INCLUDE_LOCATIONS) @echo $^ > .dspDepends $(DspFileRoot).dsp: .dspDepends @(echo Building DSP file = $(DspFileRoot).dsp;\ $(TOP)/scripts/dsp.mak -p $(DspFileRoot) -t $(TOP) -d $(DIM) -o $(DspFileRoot).dsp -O $(DspOlevel) -f $^) .PHONY: dsp .dspDepends libs cleanlibs nodata include $(TOP)/mk/Make.rules ccseapps-2.5/CCSEApps/iamrlib/benchmarks/WritePlotFile.H0000644000175000017500000000361411634153073024261 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _WritePlotFile_H_ #define _WritePlotFile_H_ #include "MultiFab.H" #include "Geometry.H" #include "AmrData.H" // Write a MultiFab to a plotfile named "name" using the HyperCLawV1.1 parallel // plotfile data format void writePlotFile (const char* name, const MultiFab& mf, const Geometry& geom, const IntVect& refRatio, Real bgVal = 0.0); // Write an array of multifabs pulling all the data from the AmrData void WritePlotFile(const Array mfa, AmrData& amrdToMimic, const std::string& oFile, bool verbose); #endif ccseapps-2.5/CCSEApps/iamrlib/benchmarks/EXACT_F.H0000644000175000017500000000473211634153073022643 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _FORT_INTERFACE_ #define _FORT_INTERFACE_ #ifdef BL_LANG_FORT c c ------------------------- c ::: Fortran Interface ::: c ------------------------- c # define FORT_VISCBENCH viscbench #else // // --------------------------------------- // ::: C Interface to Fortran Routines ::: // --------------------------------------- // #ifdef BL_FORT_USE_UNDERSCORE # define FORT_VISCBENCH viscbench_ #else # define FORT_VISCBENCH VISCBENCH #endif // // Use ARLIM in the following. // extern "C" { #if (BL_SPACEDIM==3) void FORT_VISCBENCH(const Real *time, const Real *nu, const int *unifdir, const int *lo, const int *hi, const int *ncomp, const Real *state, ARLIM_P(lo), ARLIM_P(hi), const Real *delta, const Real *xlo, const Real *xhi); #else void FORT_VISCBENCH(const Real *time, const Real *nu, const int *lo, const int *hi, const int *ncomp, const Real *state, ARLIM_P(lo), ARLIM_P(hi), const Real *delta, const Real *xlo, const Real *xhi); #endif } #endif #endif ccseapps-2.5/CCSEApps/iamrlib/benchmarks/ExSoln_3dIncNS.nb0000644000175000017500000001604411634153073024432 0ustar amckinstryamckinstry(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 4973, 183]*) (*NotebookOutlinePosition[ 5749, 210]*) (* CellTagsIndexPosition[ 5705, 206]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Evaluation of a 3-d Exact Solution for the Viscous, Incompressible \ Navier-Stokes Equations\ \>", "Title", TextAlignment->Center], Cell[CellGroupData[{ Cell["Define Velocity, Pressure and Scalar Fields", "Section"], Cell[BoxData[ \(u\ = \ \(-a\)\ \(( Exp[a\ x]\ Sin[a\ y\ + \ d\ z]\ + \ Exp[a\ z]\ Cos[a\ x\ + \ d\ y])\)\ Exp[\(-d^2\)\ nu\ t]\)], "Input"], Cell[BoxData[ \(v\ = \ \(-a\)\ \((\ Exp[a\ y] Sin[a\ z\ + \ d\ x]\ + \ Exp[a\ x]\ Cos[a\ y\ + \ d\ z])\)\ Exp[\(-d^2\)\ nu\ t]\)], "Input"], Cell[BoxData[ \(w\ = \ \(-a\)\ \((\ Exp[a\ z]\ Sin[a\ x\ + \ d\ y]\ + \ Exp[a\ y]\ Cos[a\ z\ + \ d\ x])\)\ Exp[\(-d^2\)\ nu\ t]\)], "Input"], Cell[BoxData[ \(p\ = \ \(-a^2\)/2\ \((Exp[2\ a\ x]\ + \ Exp[2\ a\ y]\ + \ Exp[2\ a\ z]\ + \ 2\ Sin[a\ x\ + \ d\ y]\ Cos[a\ z\ + \ d\ x]\ Exp[a\ \((y\ + \ z)\)]\ + \ 2\ Sin[a\ y\ + \ d\ z]\ Cos[a\ x\ + \ d\ y]\ Exp[a\ \((z\ + \ x)\)]\ + \ 2\ Sin[a\ z\ + \ d\ x]\ Cos[a\ y\ + \ d\ z]\ Exp[a\ \((x\ + \ y)\)])\)\ Exp[\(-2\)\ d^2\ nu\ t]\)], "Input"], Cell[BoxData[ \(Y\ = \ \.18\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Check Governing Equations", "Section"], Cell[BoxData[ \(Simplify[D[u, x]\ + \ D[v, y]\ + \ D[w, z]\ == \ 0]\)], "Input"], Cell[BoxData[ \(Simplify[ D[u, t]\ + \ u\ D[u, x]\ + \ v\ D[u, y]\ + \ w\ D[u, z]\ == \ \(-\ D[p, x]\)\ + \ nu\ D[u, {x, 2}] + \ nu\ D[u, {y, 2}]\ + \ nu\ D[u, {z, 2}]]\)], "Input"], Cell[BoxData[ \(Simplify[ D[v, t]\ + \ u\ D[v, x]\ + \ v\ D[v, y]\ + \ w\ D[v, z]\ == \ \(-\ D[p, y]\)\ + \ nu\ D[v, {x, 2}] + \ nu\ D[v, {y, 2}]\ + \ nu\ D[v, {z, 2}]]\)], "Input"], Cell[BoxData[ \(Simplify[ D[w, t]\ + \ u\ D[w, x]\ + \ v\ D[w, y]\ + \ w\ D[w, z]\ == \ \(-\ D[p, z]\)\ + \ nu\ D[w, {x, 2}] + \ nu\ D[w, {y, 2}]\ + \ nu\ D[w, {z, 2}]]\)], "Input"], Cell[BoxData[ \(Simplify[ D[Y, t]\ + \ u\ D[Y, x]\ + \ v\ D[Y, y]\ + \ w\ D[Y, z]\ == \ d\ D[Y, {x, 2}]\ + \ d\ D[Y, {y, 2}]\ + \ d\ D[Y, {z, 2}]]\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Evaluate the Fields for a=Pi, d=Pi", "Section"], Cell[BoxData[ \(a\ = \ Pi\)], "Input"], Cell[BoxData[ \(d\ = \ Pi\)], "Input"], Cell[BoxData[ \(u\)], "Input"], Cell[BoxData[ \(v\)], "Input"], Cell[BoxData[ \(w\)], "Input"], Cell[BoxData[ \(p\)], "Input"], Cell[BoxData[ \(t\ = \ 0\)], "Input"], Cell[BoxData[ \(z\ = \ 0\)], "Input"], Cell[BoxData[ \(Remove[a]\)], "Input"], Cell[BoxData[ \(Remove[d]\)], "Input"], Cell[BoxData[ \(Remove[z]\)], "Input"], Cell[BoxData[ \(Remove[t]\)], "Input"], Cell[BoxData[ \(ContourPlot[u, {x, 0, 2}, \ {y, 0, 2}]\)], "Input"], Cell[BoxData[ \(ContourPlot[v, {x, 0, 2}, \ {y, 0, 2}]\)], "Input"], Cell[BoxData[ \(ContourPlot[p, {x, 0, 2}, \ {y, 0, 2}]\)], "Input"], Cell[BoxData[ \(ContourPlot[Y, {x, 0, 2}, \ {y, 0, 2}]\)], "Input"] }, Open ]] }, Open ]] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowSize->{520, 600}, WindowMargins->{{296, Automatic}, {Automatic, 88}}, PrintingPageRange->{Automatic, Automatic}, PrintingOptions->{"PaperSize"->{612, 792}, "PaperOrientation"->"Portrait", "Magnification"->1} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1731, 51, 142, 4, 90, "Title"], Cell[CellGroupData[{ Cell[1898, 59, 62, 0, 47, "Section"], Cell[1963, 61, 180, 5, 43, "Input"], Cell[2146, 68, 181, 5, 43, "Input"], Cell[2330, 75, 182, 5, 43, "Input"], Cell[2515, 82, 465, 9, 91, "Input"], Cell[2983, 93, 45, 1, 27, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3065, 99, 44, 0, 47, "Section"], Cell[3112, 101, 87, 1, 27, "Input"], Cell[3202, 104, 217, 4, 43, "Input"], Cell[3422, 110, 217, 4, 43, "Input"], Cell[3642, 116, 217, 4, 43, "Input"], Cell[3862, 122, 187, 4, 43, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[4086, 131, 53, 0, 47, "Section"], Cell[4142, 133, 43, 1, 27, "Input"], Cell[4188, 136, 43, 1, 27, "Input"], Cell[4234, 139, 34, 1, 27, "Input"], Cell[4271, 142, 34, 1, 27, "Input"], Cell[4308, 145, 34, 1, 27, "Input"], Cell[4345, 148, 34, 1, 27, "Input"], Cell[4382, 151, 42, 1, 27, "Input"], Cell[4427, 154, 42, 1, 27, "Input"], Cell[4472, 157, 42, 1, 27, "Input"], Cell[4517, 160, 42, 1, 27, "Input"], Cell[4562, 163, 42, 1, 27, "Input"], Cell[4607, 166, 42, 1, 27, "Input"], Cell[4652, 169, 71, 1, 27, "Input"], Cell[4726, 172, 71, 1, 27, "Input"], Cell[4800, 175, 71, 1, 27, "Input"], Cell[4874, 178, 71, 1, 27, "Input"] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************) ccseapps-2.5/CCSEApps/iamrlib/benchmarks/BC_TYPES.H0000644000175000017500000001077611634153073023007 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _BC_TYPES_H_ #define _BC_TYPES_H_ #if 0 --------------------------------------------------------------------- CONVERSIONS FROM PHYSICAL TO MATHEMATICAL BCs PHYS BC | Velocity | Temperature | Scalars | --------------------------------------------------------------------- INTERIOR | | | | or | INT_DIR | INT_DIR | INT_DIR | PERIODIC | | | | --------------------------------------------------------------------- | | | | INFLOW | EXT_DIR | EXT_DIR | EXT_DIR | | | | | --------------------------------------------------------------------- | | | | OUTFLOW | FOEXTRAP | FOEXTRAP | FOEXTRAP | | | | | --------------------------------------------------------------------- NO SLIP WALL | | | | with | EXT_DIR | REFLECT_EVEN | HOEXTRAP | ADIABATIC TEMP | U = V = 0 | dT/dn = 0 | | --------------------------------------------------------------------- NO SLIP WALL | | | | with | EXT_DIR | EXT_DIR | HOEXTRAP | FIXED TEMP | U = V = 0 | | | --------------------------------------------------------------------- SLIP WALL | | | | with | Un=0 EXT_DIR | REFLECT_EVEN | HOEXTRAP | ADIABATIC TEMP | Ut HOEXTRAP | dT/dn = 0 | | --------------------------------------------------------------------- SLIP WALL | | | | with | Un=0 EXT_DIR | EXT_DIR | HOEXTRAP | FIXED TEMP | Ut HOEXTRAP | | | --------------------------------------------------------------------- | | | | SYMMETRY | Un REFLECT_ODD | REFLECT_EVEN | REFLECT_EVEN | | Ut REFLECT_EVEN| | | --------------------------------------------------------------------- INT_DIR : data taken from other grids or interpolated EXT_DIR : data specified on EDGE (FACE) of bndry HOEXTRAP : higher order extrapolation to EDGE of bndry FOEXTRAP : first order extrapolation from last cell in interior REFLECT_EVEN : F(-n) = F(n) true reflection from interior cells REFLECT_ODD : F(-n) = -F(n) true reflection from interior cells #endif #ifndef BL_LANG_FORT enum physicalBndryTypes {Interior,Inflow,Outflow,Symmetry, SlipWall,NoSlipWall}; #endif #define BOGUS_BC -666 #define REFLECT_ODD -1 #define INT_DIR 0 #define REFLECT_EVEN 1 #define FOEXTRAP 2 #define EXT_DIR 3 #define HOEXTRAP 4 #define Interior 0 #define Inflow 1 #define Outflow 2 #define Symmetry 3 #define SlipWall 4 #define NoSlipWall 5 #endif ccseapps-2.5/CCSEApps/iamrlib/benchmarks/EXACT_2D.F0000644000175000017500000000653111634153073022720 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: EXACT_2D.F,v 1.3 1999/03/25 23:37:42 sstanley Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "PROB_AMR_F.H" #include "ArrayLim.H" #include "EXACT_F.H" #define SDIM 2 c c ::: ----------------------------------------------------------- c ::: This case is an unsteady viscous benchmark for which the c ::: exact solution is, c ::: u(x,y,t) = - Cos(Pi x) Sin(Pi y) Exp(-2 Pi^2 Nu t) c ::: v(x,y,t) = Sin(Pi x) Cos(Pi y) Exp(-2 Pi^2 Nu t) c ::: p(x,y,t) = - {Cos(2 Pi x) + Cos(2 Pi y)} Exp(-4 Pi^2 Nu t) / 4 c ::: In this dircetory, ViscBench2d.cpp, reads a plot file and compares c ::: the solution against this exact solution. This benchmark was c ::: originally derived by G.I. Taylor (Phil. Mag., Vol. 46, No. 274, c ::: pp. 671-674, 1923) and Ethier and Steinman c ::: (Intl. J. Num. Meth. Fluids, Vol. 19, pp. 369-375, 1994) give c ::: the pressure field. c subroutine FORT_VISCBENCH(time, nu, lo, hi, & ncomp, state, DIMS(state), & dx, xlo, xhi) implicit none integer ncomp integer lo(SDIM), hi(SDIM) integer DIMDEC(state) REAL_T time, nu, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T state(DIMV(state),ncomp) c c ::::: local variables c integer i, j, n REAL_T x, y REAL_T hx, hy REAL_T spx, spy, cpx, cpy REAL_T expterm hx = dx(1) hy = dx(2) expterm = exp(-two*Pi**2*nu*time) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) spy = sin(Pi*y) cpy = cos(Pi*y) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) spx = sin(Pi*x) cpx = cos(Pi*x) state(i,j,1) = - cpx*spy * expterm state(i,j,2) = spx*cpy * expterm state(i,j,3) = one do n = 4, ncomp state(i,j,n) = cpx*cpy * expterm enddo end do end do end ccseapps-2.5/CCSEApps/iamrlib/benchmarks/ViscBench3d.cpp0000644000175000017500000001663511634153073024225 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ // // $Id: ViscBench3d.cpp,v 1.8 2002/12/19 19:05:52 almgren Exp $ // #include #include #include #include #include using std::ios; using std::set_new_handler; #include #include "WritePlotFile.H" #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "ArrayLim.H" #include "EXACT_F.H" #define GARBAGE 666.e+40 static void PrintUsage (const char* progName) { cout << '\n'; cout << "This program reads a plot file and compares the results\n" << "against a 3-d analog to the 2-d viscous benchmark of\n" << "G.I. Taylor. Essentially, this is a 2-d solution that\n" << "is uniform in the third-dimension. But, the uniform\n" << "direction can be in any of the three coordinate directions\n"; cout << "Usage:" << '\n'; cout << progName << '\n'; cout << " infile = inputFileName" << '\n'; cout << " unifdir = uniformDirection" << '\n'; cout << " errfile = ErrorFileOutputFileName" << '\n'; cout << " exfile = ExactSolnOutputFileName" << '\n'; cout << " mu = viscosity" << '\n'; cout << " norm = integer norm (Ie. default is 2 for Ln norm)" << '\n'; cout << " [-help]" << '\n'; cout << " [-verbose]" << '\n'; cout << '\n'; exit(1); } bool amrDatasHaveSameDerives(const AmrData& amrd1, const AmrData& amrd2); int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc == 1) PrintUsage(argv[0]); // // Make sure to catch new failures. // set_new_handler(Utility::OutOfMemory); ParallelDescriptor::StartParallel(&argc, &argv); ParmParse pp; if (pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Scan the arguments. // std::string iFile, errFile, exFile; bool verbose = false; if (pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(true); } pp.query("infile", iFile); if (iFile.empty()) BoxLib::Abort("You must specify `infile'"); pp.query("exfile", exFile); pp.query("errfile", errFile); int unifDir = -1; pp.query("unifdir", unifDir); if (unifDir < 0) BoxLib::Abort("You must specify `unifdir'"); Real mu = -1.0; pp.query("mu", mu); if (mu < 0.0) BoxLib::Abort("You must specify `mu'"); int norm = 2; pp.query("norm", norm); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServicesC(iFile, fileType); if (!dataServicesC.AmrDataOk()) DataServices::Dispatch(DataServices::ExitRequest, NULL); // // Generate AmrData Objects // AmrData& amrDataI = dataServicesC.AmrDataRef(); const int nComp = amrDataI.NComp(); const Real time = amrDataI.Time(); const int finestLevel = amrDataI.FinestLevel(); const Array& derives = amrDataI.PlotVarNames(); // // Compute the error // Array error(finestLevel+1); Array dataE(finestLevel+1); cout << "Level Delta L"<< norm << " norm of Error in Each Component" << endl << "-----------------------------------------------" << endl; for (int iLevel = 0; iLevel <= finestLevel; ++iLevel) { const BoxArray& baI = amrDataI.boxArray(iLevel); Array delI = amrDataI.DxLevel()[iLevel]; error[iLevel] = new MultiFab(baI, nComp, 0); error[iLevel]->setVal(GARBAGE); dataE[iLevel] = new MultiFab(baI, nComp, 0); dataE[iLevel]->setVal(GARBAGE); MultiFab dataI(baI, nComp, 0); for (int iGrid=0; iGrid xlo = amrDataI.GridLocLo()[iLevel][iGrid]; Array xhi = amrDataI.GridLocHi()[iLevel][iGrid]; FORT_VISCBENCH(&time, &mu, &unifDir, lo, hi, &nComp, ((*dataE[iLevel])[iGrid]).dataPtr(), ARLIM(lo), ARLIM(hi), delI.dataPtr(), xlo.dataPtr(), xhi.dataPtr()); } (*error[iLevel]).copy(dataI); (*error[iLevel]).minus((*dataE[iLevel]), 0, nComp, 0); // // Output Statistics // Real cellvol = 1.0; for (int i=0; i& derives1 = amrd1.PlotVarNames(); const Array& derives2 = amrd2.PlotVarNames(); int length = derives1.length(); if (length != derives2.length()) return false; for (int i=0; i #include #include #include #include using std::ios; using std::set_new_handler; #include #include "WritePlotFile.H" #include "REAL.H" #include "Box.H" #include "FArrayBox.H" #include "ParmParse.H" #include "ParallelDescriptor.H" #include "DataServices.H" #include "Utility.H" #include "VisMF.H" #include "ArrayLim.H" #include "EXACT_F.H" #define GARBAGE 666.e+40 static void PrintUsage (const char* progName) { cout << '\n'; cout << "Usage:" << '\n'; cout << progName << '\n'; cout << " infile = inputFileName" << '\n'; cout << " errfile = ErrorFileOutputFileName" << '\n'; cout << " exfile = ExactSolnOutputFileName" << '\n'; cout << " mu = viscosity" << '\n'; cout << " norm = integer norm (Ie. default is 2 for Ln norm)" << '\n'; cout << " [-help]" << '\n'; cout << " [-verbose]" << '\n'; cout << '\n'; exit(1); } bool amrDatasHaveSameDerives(const AmrData& amrd1, const AmrData& amrd2); int main (int argc, char* argv[]) { BoxLib::Initialize(argc,argv); if (argc == 1) PrintUsage(argv[0]); // // Make sure to catch new failures. // set_new_handler(BoxLib::OutOfMemory); ParallelDescriptor::StartParallel(&argc, &argv); ParmParse pp; if (pp.contains("help")) PrintUsage(argv[0]); FArrayBox::setFormat(FABio::FAB_IEEE_32); // // Scan the arguments. // std::string iFile, errFile, exFile; bool verbose = false; if (pp.contains("verbose")) { verbose = true; AmrData::SetVerbose(true); } pp.query("infile", iFile); if (iFile.empty()) BoxLib::Abort("You must specify `infile'"); pp.query("exfile", exFile); pp.query("errfile", errFile); Real mu = -1.0; pp.query("mu", mu); if (mu < 0.0) BoxLib::Abort("You must specify `mu'"); int norm = 2; pp.query("norm", norm); DataServices::SetBatchMode(); FileType fileType(NEWPLT); DataServices dataServicesC(iFile, fileType); if (!dataServicesC.AmrDataOk()) DataServices::Dispatch(DataServices::ExitRequest, NULL); // // Generate AmrData Objects // AmrData& amrDataI = dataServicesC.AmrDataRef(); const int nComp = amrDataI.NComp(); const Real time = amrDataI.Time(); const int finestLevel = amrDataI.FinestLevel(); const Array& derives = amrDataI.PlotVarNames(); // // Compute the error // Array error(finestLevel+1); Array dataE(finestLevel+1); cout << "Level Delta L"<< norm << " norm of Error in Each Component" << endl << "-----------------------------------------------" << endl; for (int iLevel = 0; iLevel <= finestLevel; ++iLevel) { const BoxArray& baI = amrDataI.boxArray(iLevel); Array delI = amrDataI.DxLevel()[iLevel]; error[iLevel] = new MultiFab(baI, nComp, 0); error[iLevel]->setVal(GARBAGE); dataE[iLevel] = new MultiFab(baI, nComp, 0); dataE[iLevel]->setVal(GARBAGE); MultiFab dataI(baI, nComp, 0); for (int iGrid=0; iGrid xlo = amrDataI.GridLocLo()[iLevel][iGrid]; Array xhi = amrDataI.GridLocHi()[iLevel][iGrid]; FORT_VISCBENCH(&time, &mu, lo, hi, &nComp, ((*dataE[iLevel])[iGrid]).dataPtr(), ARLIM(lo), ARLIM(hi), delI.dataPtr(), xlo.dataPtr(), xhi.dataPtr()); } (*error[iLevel]).copy(dataI); (*error[iLevel]).minus((*dataE[iLevel]), 0, nComp, 0); // // Output Statistics // Real cellvol = 1.0; for (int i=0; i& derives1 = amrd1.PlotVarNames(); const Array& derives2 = amrd2.PlotVarNames(); int length = derives1.size(); if (length != derives2.size()) return false; for (int i=0; i #include #ifdef BL_ARCH_CRAY #ifdef BL_USE_DOUBLE #error "DOUBLE PRECISION NOT ALLOWED ON CRAY" #endif #endif #ifndef WIN32 #include #endif #include #include #include #include #include #include using std::setprecision; #ifndef WIN32 using std::set_new_handler; #endif #ifdef BL_USE_SETBUF #define pubsetbuf setbuf #endif #include std::string thePlotFileType () { // // Increment this whenever the writePlotFile() format changes. // static const std::string the_plot_file_type("HyperCLaw-V1.1"); return the_plot_file_type; } void writePlotFile (const std::string& dir, ostream& os, int level, const MultiFab& mf, const Geometry& geom, const IntVect& refRatio, Real bgVal) { // // Faked data // const int NUM_STATE = mf.nComp(); const Real cumTime = 0.0; const Real curTime = cumTime; const int finestLevel = 1; Array< Box > domain(finestLevel+1); const IndexType& ixType = mf.boxArray()[0].ixType(); if (ixType != IndexType::TheCellType()) BoxLib::Error("writePlotfile unable to handle non cell-centered data for now"); Box tmpb = Box(geom.Domain()).convert(ixType); Array corr(BL_SPACEDIM); for (int d = 0; d < BL_SPACEDIM; d++) { corr[d] = (ixType.ixType(d) == IndexType::CELL ? 1 : 0); } for (int M = 0; M < finestLevel; M++) { tmpb.coarsen(refRatio); } domain[0] = tmpb; const int levelSteps = 0; Array< Array< Real > > dx(finestLevel+1); Array< Array > grid_loc(finestLevel+1); const BoxArray& grids = mf.boxArray(); for (int j = 0; j<= finestLevel; j++) { if (j!=0) domain[j] = Box( domain[j-1] ).refine(refRatio); dx[j].resize(BL_SPACEDIM); for (int k = 0; k < BL_SPACEDIM; k++) { dx[j][k] = (Geometry::ProbHi(k) - Geometry::ProbLo(k))/domain[j].length(k); } if (j==0) { grid_loc[j].resize(1); grid_loc[j][0] = RealBox(Geometry::ProbLo(),Geometry::ProbHi()); } else { grid_loc[j].resize(grids.size()); for (int L=0; L < grids.size(); L++) { const Box bx = grids[L]; grid_loc[j][L] = RealBox(D_DECL( dx[j][0]*bx.smallEnd(0), dx[j][1]*bx.smallEnd(1), dx[j][2]*bx.smallEnd(2) ), D_DECL( dx[j][0]*(bx.bigEnd(0)+corr[0]), dx[j][1]*(bx.bigEnd(1)+corr[1]), dx[j][2]*(bx.bigEnd(2)+corr[2]) )); } } } const int Coord = 0; BoxArray tba = BoxArray(&tmpb,1); MultiFab level0_dat(tba,mf.nComp(),mf.nGrow(),Fab_allocate); level0_dat.setVal(bgVal); int i, n; // // There is only one MultiFab written out at each level in HyperCLaw. // static const std::string MultiFabBaseName("/MultiFab"); // // Build the directory to hold the MultiFabs at this level. // The name is relative to the directory containing the Header file. // char buf[64]; sprintf(buf, "Level_%d", level); std::string Level = buf; // // Now for the full pathname of that directory. // std::string FullPath = dir; if (!FullPath.empty() && FullPath[FullPath.size()-1] != '/') FullPath += '/'; FullPath += Level; // // Only the I/O processor makes the directory if it doesn't already exist. // if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(FullPath, 0755)) BoxLib::CreateDirectoryFailed(FullPath); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); if (ParallelDescriptor::IOProcessor()) { if (level == 0) { // // The first thing we write out is the plot file type. // os << thePlotFileType() << '\n'; // Number of components, and names int n_var = NUM_STATE; os << n_var << '\n'; for (n = 0; n < NUM_STATE; n++) { char buff[64]; sprintf(buff, "state_%d", n); os << buff << '\n'; } // dimensionality os << BL_SPACEDIM << '\n'; // time os << cumTime << '\n'; // finest amr level os << finestLevel << '\n'; // prob domain for (i = 0; i < BL_SPACEDIM; i++) os << Geometry::ProbLo(i) << ' '; os << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << Geometry::ProbHi(i) << ' '; os << '\n'; // refinement ratio for (i = 0; i < finestLevel; i++) os << refRatio << ' '; os << '\n'; // int domain for (i = 0; i <= finestLevel; i++) os << domain[i] << ' '; os << '\n'; // level steps for (i = 0; i <= finestLevel; i++) os << levelSteps << ' '; os << '\n'; for (i = 0; i <= finestLevel; i++) { // cell size const Real* dx_lev = dx[i].dataPtr(); for (int k = 0; k < BL_SPACEDIM; k++) os << dx_lev[k] << ' '; os << '\n'; } // coordinate system os << Coord << '\n'; os << "0\n"; // The bndry data. } // // Now write state data. // int ngrds = (level==0 ? 1 : grids.size()); Real cur_time = curTime; const MultiFab& cell_dat = (level==0 ? level0_dat : mf); os << level << ' ' << ngrds << ' ' << cur_time << '\n'; // level steps os << levelSteps << '\n'; for (i = 0; i < cell_dat.boxArray().size(); ++i) { for (n = 0; n < BL_SPACEDIM; n++) // lo/hi position of this grid os <pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); int old_prec; if (ParallelDescriptor::IOProcessor()) { // // Only the IOProcessor() writes to the header file. // HeaderFile.open(HeaderFileName.c_str(), ios::out|ios::trunc); if (!HeaderFile.good()) BoxLib::FileOpenFailed(HeaderFileName); old_prec = HeaderFile.precision(30); } int finest_level = 1; for (int k = 0; k <= finest_level; k++) { writePlotFile(pltfile, HeaderFile, k, mf, geom, refRatio, bgVal); } if (ParallelDescriptor::IOProcessor()) { // // Accumulate # of bytes written to header file. // HeaderFile.precision(old_prec); if (!HeaderFile.good()) BoxLib::Error("Amr::writePlotFile() failed"); } double dPlotFileTime1(ParallelDescriptor::second()); double dPlotFileTime(dPlotFileTime1 - dPlotFileTime0); ParallelDescriptor::ReduceRealMax(dPlotFileTime); if(ParallelDescriptor::IOProcessor()) { cout << "Write plotfile time = " << dPlotFileTime << " seconds." << endl; } } void WritePlotFile(const Array mfa, AmrData& amrdToMimic, const std::string& oFile, bool verbose) { const Array& derives = amrdToMimic.PlotVarNames(); int ntype = amrdToMimic.NComp(); int finestLevel = amrdToMimic.FinestLevel(); if (ParallelDescriptor::IOProcessor()) if (!BoxLib::UtilCreateDirectory(oFile,0755)) BoxLib::CreateDirectoryFailed(oFile); // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); std::string oFileHeader(oFile); oFileHeader += "/Header"; VisMF::IO_Buffer io_buffer(VisMF::IO_Buffer_Size); ofstream os; os.rdbuf()->pubsetbuf(io_buffer.dataPtr(), io_buffer.size()); if (verbose && ParallelDescriptor::IOProcessor()) cout << "Opening file = " << oFileHeader << '\n'; os.open(oFileHeader.c_str(), ios::out|ios::binary); if (os.fail()) BoxLib::FileOpenFailed(oFileHeader); // // Start writing plotfile. // os << amrdToMimic.PlotFileVersion() << '\n'; int n_var = ntype; os << n_var << '\n'; for (int n = 0; n < ntype; n++) os << derives[n] << '\n'; os << BL_SPACEDIM << '\n'; os << amrdToMimic.Time() << '\n'; os << finestLevel << '\n'; int i; for (i = 0; i < BL_SPACEDIM; i++) os << amrdToMimic.ProbLo()[i] << ' '; os << '\n'; for (i = 0; i < BL_SPACEDIM; i++) os << amrdToMimic.ProbHi()[i] << ' '; os << '\n'; for (i = 0; i < finestLevel; i++) os << amrdToMimic.RefRatio()[i] << ' '; os << '\n'; for (i = 0; i <= finestLevel; i++) os << amrdToMimic.ProbDomain()[i] << ' '; os << '\n'; for (i = 0; i <= finestLevel; i++) os << 0 << ' '; os << '\n'; for (i = 0; i <= finestLevel; i++) { for (int k = 0; k < BL_SPACEDIM; k++) os << amrdToMimic.DxLevel()[i][k] << ' '; os << '\n'; } os << amrdToMimic.CoordSys() << '\n'; os << "0\n"; // The bndry data width. // // Write out level by level. // for (int iLevel = 0; iLevel <= finestLevel; ++iLevel) { // // Write state data. // int nGrids = amrdToMimic.boxArray(iLevel).size(); char buf[64]; sprintf(buf, "Level_%d", iLevel); if (ParallelDescriptor::IOProcessor()) { os << iLevel << ' ' << nGrids << ' ' << amrdToMimic.Time() << '\n'; os << 0 << '\n'; for (i = 0; i < nGrids; ++i) { for (int n = 0; n < BL_SPACEDIM; n++) { os << amrdToMimic.GridLocLo()[iLevel][i][n] << ' ' << amrdToMimic.GridLocHi()[iLevel][i][n] << '\n'; } } // // Build the directory to hold the MultiFabs at this level. // std::string Level(oFile); Level += '/'; Level += buf; if (!BoxLib::UtilCreateDirectory(Level, 0755)) BoxLib::CreateDirectoryFailed(Level); } // // Force other processors to wait till directory is built. // ParallelDescriptor::Barrier(); // // Now build the full relative pathname of the MultiFab. // static const std::string MultiFabBaseName("/MultiFab"); std::string PathName(oFile); PathName += '/'; PathName += buf; PathName += MultiFabBaseName; if (ParallelDescriptor::IOProcessor()) { // // The full name relative to the Header file. // std::string RelativePathName(buf); RelativePathName += '/'; RelativePathName += MultiFabBaseName; os << RelativePathName << '\n'; } VisMF::Write(*mfa[iLevel], PathName, VisMF::OneFilePerCPU); } os.close(); } ccseapps-2.5/CCSEApps/iamrlib/benchmarks/ExSoln_2dIncNS.nb0000644000175000017500000130145511634153073024435 0ustar amckinstryamckinstry(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 358257, 9342]*) (*NotebookOutlinePosition[ 359033, 9369]*) (* CellTagsIndexPosition[ 358989, 9365]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Evaluation of a 2-d Exact Solution for the Viscous, Incompressible \ Navier-Stokes Equations\ \>", "Title", TextAlignment->Center], Cell[CellGroupData[{ Cell["Define Velocity, Pressure and Scalar Fields", "Section"], Cell[CellGroupData[{ Cell[BoxData[ \(u\ = \ \(-Cos[Pi\ x]\)\ Sin[Pi\ y]\ Exp[\(-2\)\ Pi^2\ nu\ t]\)], "Input"], Cell[BoxData[ \(\(-E\^\(\(-2\)\ nu\ \[Pi]\^2\ t\)\)\ Cos[\[Pi]\ x]\ Sin[\[Pi]\ y]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(v\ = \ Sin[Pi\ x]\ Cos[Pi\ y]\ Exp[\(-2\)\ Pi^2\ nu\ t]\)], "Input"], Cell[BoxData[ \(E\^\(\(-2\)\ nu\ \[Pi]\^2\ t\)\ Cos[\[Pi]\ y]\ Sin[\[Pi]\ x]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(p\ = \ \(-\ \((Cos[2\ Pi\ x]\ + \ Cos[2\ Pi\ y])\)\)/4\ Exp[\(-4\)\ Pi^2\ nu\ t]\)], "Input"], Cell[BoxData[ \(1\/4\ E\^\(\(-4\)\ nu\ \[Pi]\^2\ t\)\ \((\(-Cos[2\ \[Pi]\ x]\) - Cos[2\ \[Pi]\ y])\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Y\ = \ Cos[Pi\ x]\ Cos[Pi\ y] Exp[\(-\ 2\)\ Pi^2\ d\ t]\)], "Input"], Cell[BoxData[ \(E\^\(\(-2\)\ d\ \[Pi]\^2\ t\)\ Cos[\[Pi]\ x]\ Cos[\[Pi]\ y]\)], "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Check Governing Equations", "Section"], Cell[CellGroupData[{ Cell[BoxData[ \(D[u, x]\ + \ D[v, y]\ == \ 0\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ D[u, t]\ + \ u\ D[u, x]\ + \ v\ D[u, y]\ == \ \(-\ D[p, x]\)\ + \ nu\ D[u, \ {x, 2}] + \ nu\ D[u, \ {y, 2}]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ D[v, t]\ + \ u\ D[v, x]\ + \ v\ D[v, y]\ == \ \(-\ D[p, y]\)\ + \ nu\ D[v, \ {x, 2}] + \ nu\ D[v, \ {y, 2}]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ D[Y, t]\ + \ u\ D[Y, x]\ + \ v\ D[Y, y]\ == \ d\ D[Y, {x, 2}]\ + \ d\ D[Y, {y, 2}]]\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(t\ = \ 0\)], "Input"], Cell[BoxData[ \(0\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ContourPlot[u, {x, 0, 2}, \ {y, 0, 2}]\)], "Input"], Cell[GraphicsData["PostScript", "\<\ %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart /Mabs { Mgmatrix idtransform Mtmatrix dtransform } bind def /Mabsadd { Mabs 3 -1 roll add 3 1 roll add exch } bind def %% ContourGraphics %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10 scalefont setfont % Scaling calculations 0.0192308 0.480769 0.0192308 0.480769 [ [.01923 -0.0125 -3 -9 ] [.01923 -0.0125 3 0 ] [.25962 -0.0125 -9 -9 ] [.25962 -0.0125 9 0 ] [.5 -0.0125 -3 -9 ] [.5 -0.0125 3 0 ] [.74038 -0.0125 -9 -9 ] [.74038 -0.0125 9 0 ] [.98077 -0.0125 -3 -9 ] [.98077 -0.0125 3 0 ] [ 0 0 -0.125 0 ] [-0.0125 .01923 -6 -4.5 ] [-0.0125 .01923 0 4.5 ] [-0.0125 .25962 -18 -4.5 ] [-0.0125 .25962 0 4.5 ] [-0.0125 .5 -6 -4.5 ] [-0.0125 .5 0 4.5 ] [-0.0125 .74038 -18 -4.5 ] [-0.0125 .74038 0 4.5 ] [-0.0125 .98077 -6 -4.5 ] [-0.0125 .98077 0 4.5 ] [ 0 0 -0.125 0 ] [ 0 1 .125 0 ] [ 1 0 .125 0 ] [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath 0 g .25 Mabswid .01923 0 m .01923 .00625 L s [(0)] .01923 -0.0125 0 1 Mshowa .25962 0 m .25962 .00625 L s [(0.5)] .25962 -0.0125 0 1 Mshowa .5 0 m .5 .00625 L s [(1)] .5 -0.0125 0 1 Mshowa .74038 0 m .74038 .00625 L s [(1.5)] .74038 -0.0125 0 1 Mshowa .98077 0 m .98077 .00625 L s [(2)] .98077 -0.0125 0 1 Mshowa .125 Mabswid .06731 0 m .06731 .00375 L s .11538 0 m .11538 .00375 L s .16346 0 m .16346 .00375 L s .21154 0 m .21154 .00375 L s .30769 0 m .30769 .00375 L s .35577 0 m .35577 .00375 L s .40385 0 m .40385 .00375 L s .45192 0 m .45192 .00375 L s .54808 0 m .54808 .00375 L s .59615 0 m .59615 .00375 L s .64423 0 m .64423 .00375 L s .69231 0 m .69231 .00375 L s .78846 0 m .78846 .00375 L s .83654 0 m .83654 .00375 L s .88462 0 m .88462 .00375 L s .93269 0 m .93269 .00375 L s .25 Mabswid 0 0 m 1 0 L s 0 .01923 m .00625 .01923 L s [(0)] -0.0125 .01923 1 0 Mshowa 0 .25962 m .00625 .25962 L s [(0.5)] -0.0125 .25962 1 0 Mshowa 0 .5 m .00625 .5 L s [(1)] -0.0125 .5 1 0 Mshowa 0 .74038 m .00625 .74038 L s [(1.5)] -0.0125 .74038 1 0 Mshowa 0 .98077 m .00625 .98077 L s [(2)] -0.0125 .98077 1 0 Mshowa .125 Mabswid 0 .06731 m .00375 .06731 L s 0 .11538 m .00375 .11538 L s 0 .16346 m .00375 .16346 L s 0 .21154 m .00375 .21154 L s 0 .30769 m .00375 .30769 L s 0 .35577 m .00375 .35577 L s 0 .40385 m .00375 .40385 L s 0 .45192 m .00375 .45192 L s 0 .54808 m .00375 .54808 L s 0 .59615 m .00375 .59615 L s 0 .64423 m .00375 .64423 L s 0 .69231 m .00375 .69231 L s 0 .78846 m .00375 .78846 L s 0 .83654 m .00375 .83654 L s 0 .88462 m .00375 .88462 L s 0 .93269 m .00375 .93269 L s .25 Mabswid 0 0 m 0 1 L s .01923 .99375 m .01923 1 L s .25962 .99375 m .25962 1 L s .5 .99375 m .5 1 L s .74038 .99375 m .74038 1 L s .98077 .99375 m .98077 1 L s .125 Mabswid .06731 .99625 m .06731 1 L s .11538 .99625 m .11538 1 L s .16346 .99625 m .16346 1 L s .21154 .99625 m .21154 1 L s .30769 .99625 m .30769 1 L s .35577 .99625 m .35577 1 L s .40385 .99625 m .40385 1 L s .45192 .99625 m .45192 1 L s .54808 .99625 m .54808 1 L s .59615 .99625 m .59615 1 L s .64423 .99625 m .64423 1 L s .69231 .99625 m .69231 1 L s .78846 .99625 m .78846 1 L s .83654 .99625 m .83654 1 L s .88462 .99625 m .88462 1 L s .93269 .99625 m .93269 1 L s .25 Mabswid 0 1 m 1 1 L s .99375 .01923 m 1 .01923 L s .99375 .25962 m 1 .25962 L s .99375 .5 m 1 .5 L s .99375 .74038 m 1 .74038 L s .99375 .98077 m 1 .98077 L s .125 Mabswid .99625 .06731 m 1 .06731 L s .99625 .11538 m 1 .11538 L s .99625 .16346 m 1 .16346 L s .99625 .21154 m 1 .21154 L s .99625 .30769 m 1 .30769 L s .99625 .35577 m 1 .35577 L s .99625 .40385 m 1 .40385 L s .99625 .45192 m 1 .45192 L s .99625 .54808 m 1 .54808 L s .99625 .59615 m 1 .59615 L s .99625 .64423 m 1 .64423 L s .99625 .69231 m 1 .69231 L s .99625 .78846 m 1 .78846 L s .99625 .83654 m 1 .83654 L s .99625 .88462 m 1 .88462 L s .99625 .93269 m 1 .93269 L s .25 Mabswid 1 0 m 1 1 L s 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath .5 g .01923 .98077 m .98077 .98077 L .98077 .01923 L .01923 .01923 L F 0 g .5 Mabswid .4 g .01923 .48596 m .08791 .4844 L .15659 .47739 L .22527 .43403 L .22654 .43132 L .24138 .36264 L .24501 .29396 L .24501 .22527 L .24138 .15659 L .22654 .08791 L .22527 .0857 L .15659 .04742 L .08791 .03964 L .01923 .03781 L F 0 g .01923 .48596 m .08791 .4844 L .15659 .47739 L .22527 .43403 L .22654 .43132 L .24138 .36264 L .24501 .29396 L .24501 .22527 L .24138 .15659 L .22654 .08791 L .22527 .0857 L .15659 .04742 L .08791 .03964 L .01923 .03781 L s .6 g .01923 .96219 m .08791 .96036 L .15659 .95258 L .22527 .9143 L .22654 .91209 L .24138 .84341 L .24501 .77473 L .24501 .70604 L .24138 .63736 L .22654 .56868 L .22527 .56597 L .15659 .52261 L .08791 .5156 L .01923 .51404 L F 0 g .01923 .96219 m .08791 .96036 L .15659 .95258 L .22527 .9143 L .22654 .91209 L .24138 .84341 L .24501 .77473 L .24501 .70604 L .24138 .63736 L .22654 .56868 L .22527 .56597 L .15659 .52261 L .08791 .5156 L .01923 .51404 L s .7 g .01923 .93333 m .08791 .92913 L .15521 .91209 L .15659 .91009 L .20465 .84341 L .21567 .77473 L .21567 .70604 L .20465 .63736 L .15659 .57067 L .15521 .56868 L .08791 .54788 L .01923 .54293 L F 0 g .01923 .93333 m .08791 .92913 L .15521 .91209 L .15659 .91009 L .20465 .84341 L .21567 .77473 L .21567 .70604 L .20465 .63736 L .15659 .57067 L .15521 .56868 L .08791 .54788 L .01923 .54293 L s .3 g .01923 .45707 m .08791 .45212 L .15521 .43132 L .15659 .42933 L .20465 .36264 L .21567 .29396 L .21567 .22527 L .20465 .15659 L .15659 .08991 L .15521 .08791 L .08791 .07087 L .01923 .06667 L F 0 g .01923 .45707 m .08791 .45212 L .15521 .43132 L .15659 .42933 L .20465 .36264 L .21567 .29396 L .21567 .22527 L .20465 .15659 L .15659 .08991 L .15521 .08791 L .08791 .07087 L .01923 .06667 L s .8 g .01923 .90753 m .08791 .8997 L .15659 .85304 L .16237 .84341 L .18453 .77473 L .18453 .70604 L .16237 .63736 L .15659 .62773 L .08791 .58107 L .01923 .57324 L F 0 g .01923 .90753 m .08791 .8997 L .15659 .85304 L .16237 .84341 L .18453 .77473 L .18453 .70604 L .16237 .63736 L .15659 .62773 L .08791 .58107 L .01923 .57324 L s .2 g .01923 .42676 m .08791 .41893 L .15659 .37227 L .16237 .36264 L .18453 .29396 L .18453 .22527 L .16237 .15659 L .15659 .14696 L .08791 .1003 L .01923 .09247 L F 0 g .01923 .42676 m .08791 .41893 L .15659 .37227 L .16237 .36264 L .18453 .29396 L .18453 .22527 L .16237 .15659 L .15659 .14696 L .08791 .1003 L .01923 .09247 L s .9 g .01923 .87516 m .08791 .85892 L .11825 .84341 L .15309 .77473 L .15309 .70604 L .11825 .63736 L .08791 .62185 L .01923 .60561 L F 0 g .01923 .87516 m .08791 .85892 L .11825 .84341 L .15309 .77473 L .15309 .70604 L .11825 .63736 L .08791 .62185 L .01923 .60561 L s .1 g .01923 .39439 m .08791 .37815 L .11825 .36264 L .15309 .29396 L .15309 .22527 L .11825 .15659 L .08791 .14108 L .01923 .12484 L F 0 g .01923 .39439 m .08791 .37815 L .11825 .36264 L .15309 .29396 L .15309 .22527 L .11825 .15659 L .08791 .14108 L .01923 .12484 L s 1 g .01923 .82869 m .08791 .79783 L .10805 .77473 L .10805 .70604 L .08791 .68294 L .01923 .65208 L F 0 g .01923 .82869 m .08791 .79783 L .10805 .77473 L .10805 .70604 L .08791 .68294 L .01923 .65208 L s .01923 .34792 m .08791 .31706 L .10805 .29396 L .10805 .22527 L .08791 .20217 L .01923 .17131 L F .01923 .34792 m .08791 .31706 L .10805 .29396 L .10805 .22527 L .08791 .20217 L .01923 .17131 L s .6 g .29396 .0857 m .36264 .04742 L .43132 .03964 L .5 .03781 L .56868 .03964 L .63736 .04742 L .70604 .0857 L .70731 .08791 L .72215 .15659 L .72578 .22527 L .72578 .29396 L .72215 .36264 L .70731 .43132 L .70604 .43403 L .63736 .47739 L .56868 .4844 L .5 .48596 L .43132 .4844 L .36264 .47739 L .29396 .43403 L .29269 .43132 L .27785 .36264 L .27422 .29396 L .27422 .22527 L .27785 .15659 L .29269 .08791 L F 0 g .29396 .0857 m .36264 .04742 L .43132 .03964 L .5 .03781 L .56868 .03964 L .63736 .04742 L .70604 .0857 L .70731 .08791 L .72215 .15659 L .72578 .22527 L .72578 .29396 L .72215 .36264 L .70731 .43132 L .70604 .43403 L .63736 .47739 L .56868 .4844 L .5 .48596 L .43132 .4844 L .36264 .47739 L .29396 .43403 L .29269 .43132 L .27785 .36264 L .27422 .29396 L .27422 .22527 L .27785 .15659 L .29269 .08791 L .29396 .0857 L s .4 g .29396 .56597 m .36264 .52261 L .43132 .5156 L .5 .51404 L .56868 .5156 L .63736 .52261 L .70604 .56597 L .70731 .56868 L .72215 .63736 L .72578 .70604 L .72578 .77473 L .72215 .84341 L .70731 .91209 L .70604 .9143 L .63736 .95258 L .56868 .96036 L .5 .96219 L .43132 .96036 L .36264 .95258 L .29396 .9143 L .29269 .91209 L .27785 .84341 L .27422 .77473 L .27422 .70604 L .27785 .63736 L .29269 .56868 L F 0 g .29396 .56597 m .36264 .52261 L .43132 .5156 L .5 .51404 L .56868 .5156 L .63736 .52261 L .70604 .56597 L .70731 .56868 L .72215 .63736 L .72578 .70604 L .72578 .77473 L .72215 .84341 L .70731 .91209 L .70604 .9143 L .63736 .95258 L .56868 .96036 L .5 .96219 L .43132 .96036 L .36264 .95258 L .29396 .9143 L .29269 .91209 L .27785 .84341 L .27422 .77473 L .27422 .70604 L .27785 .63736 L .29269 .56868 L .29396 .56597 L s .3 g .43132 .54788 m .5 .54293 L .56868 .54788 L .63598 .56868 L .63736 .57067 L .68542 .63736 L .69644 .70604 L .69644 .77473 L .68542 .84341 L .63736 .91009 L .63598 .91209 L .56868 .92913 L .5 .93333 L .43132 .92913 L .36402 .91209 L .36264 .91009 L .31458 .84341 L .30356 .77473 L .30356 .70604 L .31458 .63736 L .36264 .57067 L .36402 .56868 L F 0 g .43132 .54788 m .5 .54293 L .56868 .54788 L .63598 .56868 L .63736 .57067 L .68542 .63736 L .69644 .70604 L .69644 .77473 L .68542 .84341 L .63736 .91009 L .63598 .91209 L .56868 .92913 L .5 .93333 L .43132 .92913 L .36402 .91209 L .36264 .91009 L .31458 .84341 L .30356 .77473 L .30356 .70604 L .31458 .63736 L .36264 .57067 L .36402 .56868 L .43132 .54788 L s .7 g .43132 .07087 m .5 .06667 L .56868 .07087 L .63598 .08791 L .63736 .08991 L .68542 .15659 L .69644 .22527 L .69644 .29396 L .68542 .36264 L .63736 .42933 L .63598 .43132 L .56868 .45212 L .5 .45707 L .43132 .45212 L .36402 .43132 L .36264 .42933 L .31458 .36264 L .30356 .29396 L .30356 .22527 L .31458 .15659 L .36264 .08991 L .36402 .08791 L F 0 g .43132 .07087 m .5 .06667 L .56868 .07087 L .63598 .08791 L .63736 .08991 L .68542 .15659 L .69644 .22527 L .69644 .29396 L .68542 .36264 L .63736 .42933 L .63598 .43132 L .56868 .45212 L .5 .45707 L .43132 .45212 L .36402 .43132 L .36264 .42933 L .31458 .36264 L .30356 .29396 L .30356 .22527 L .31458 .15659 L .36264 .08991 L .36402 .08791 L .43132 .07087 L s .2 g .36264 .62773 m .43132 .58107 L .5 .57324 L .56868 .58107 L .63736 .62773 L .64314 .63736 L .6653 .70604 L .6653 .77473 L .64314 .84341 L .63736 .85304 L .56868 .8997 L .5 .90753 L .43132 .8997 L .36264 .85304 L .35686 .84341 L .3347 .77473 L .3347 .70604 L .35686 .63736 L F 0 g .36264 .62773 m .43132 .58107 L .5 .57324 L .56868 .58107 L .63736 .62773 L .64314 .63736 L .6653 .70604 L .6653 .77473 L .64314 .84341 L .63736 .85304 L .56868 .8997 L .5 .90753 L .43132 .8997 L .36264 .85304 L .35686 .84341 L .3347 .77473 L .3347 .70604 L .35686 .63736 L .36264 .62773 L s .8 g .36264 .14696 m .43132 .1003 L .5 .09247 L .56868 .1003 L .63736 .14696 L .64314 .15659 L .6653 .22527 L .6653 .29396 L .64314 .36264 L .63736 .37227 L .56868 .41893 L .5 .42676 L .43132 .41893 L .36264 .37227 L .35686 .36264 L .3347 .29396 L .3347 .22527 L .35686 .15659 L F 0 g .36264 .14696 m .43132 .1003 L .5 .09247 L .56868 .1003 L .63736 .14696 L .64314 .15659 L .6653 .22527 L .6653 .29396 L .64314 .36264 L .63736 .37227 L .56868 .41893 L .5 .42676 L .43132 .41893 L .36264 .37227 L .35686 .36264 L .3347 .29396 L .3347 .22527 L .35686 .15659 L .36264 .14696 L s .1 g .43132 .62185 m .5 .60561 L .56868 .62185 L .59902 .63736 L .63386 .70604 L .63386 .77473 L .59902 .84341 L .56868 .85892 L .5 .87516 L .43132 .85892 L .40098 .84341 L .36614 .77473 L .36614 .70604 L .40098 .63736 L F 0 g .43132 .62185 m .5 .60561 L .56868 .62185 L .59902 .63736 L .63386 .70604 L .63386 .77473 L .59902 .84341 L .56868 .85892 L .5 .87516 L .43132 .85892 L .40098 .84341 L .36614 .77473 L .36614 .70604 L .40098 .63736 L .43132 .62185 L s .9 g .43132 .14108 m .5 .12484 L .56868 .14108 L .59902 .15659 L .63386 .22527 L .63386 .29396 L .59902 .36264 L .56868 .37815 L .5 .39439 L .43132 .37815 L .40098 .36264 L .36614 .29396 L .36614 .22527 L .40098 .15659 L F 0 g .43132 .14108 m .5 .12484 L .56868 .14108 L .59902 .15659 L .63386 .22527 L .63386 .29396 L .59902 .36264 L .56868 .37815 L .5 .39439 L .43132 .37815 L .40098 .36264 L .36614 .29396 L .36614 .22527 L .40098 .15659 L .43132 .14108 L s .43132 .68294 m .5 .65208 L .56868 .68294 L .58882 .70604 L .58882 .77473 L .56868 .79783 L .5 .82869 L .43132 .79783 L .41118 .77473 L .41118 .70604 L F .43132 .68294 m .5 .65208 L .56868 .68294 L .58882 .70604 L .58882 .77473 L .56868 .79783 L .5 .82869 L .43132 .79783 L .41118 .77473 L .41118 .70604 L .43132 .68294 L s 1 g .43132 .20217 m .5 .17131 L .56868 .20217 L .58882 .22527 L .58882 .29396 L .56868 .31706 L .5 .34792 L .43132 .31706 L .41118 .29396 L .41118 .22527 L F 0 g .43132 .20217 m .5 .17131 L .56868 .20217 L .58882 .22527 L .58882 .29396 L .56868 .31706 L .5 .34792 L .43132 .31706 L .41118 .29396 L .41118 .22527 L .43132 .20217 L s .4 g .98077 .48596 m .91209 .4844 L .84341 .47739 L .77473 .43403 L .77346 .43132 L .75862 .36264 L .75499 .29396 L .75499 .22527 L .75862 .15659 L .77346 .08791 L .77473 .0857 L .84341 .04742 L .91209 .03964 L .98077 .03781 L F 0 g .98077 .48596 m .91209 .4844 L .84341 .47739 L .77473 .43403 L .77346 .43132 L .75862 .36264 L .75499 .29396 L .75499 .22527 L .75862 .15659 L .77346 .08791 L .77473 .0857 L .84341 .04742 L .91209 .03964 L .98077 .03781 L s .6 g .98077 .96219 m .91209 .96036 L .84341 .95258 L .77473 .9143 L .77346 .91209 L .75862 .84341 L .75499 .77473 L .75499 .70604 L .75862 .63736 L .77346 .56868 L .77473 .56597 L .84341 .52261 L .91209 .5156 L .98077 .51404 L F 0 g .98077 .96219 m .91209 .96036 L .84341 .95258 L .77473 .9143 L .77346 .91209 L .75862 .84341 L .75499 .77473 L .75499 .70604 L .75862 .63736 L .77346 .56868 L .77473 .56597 L .84341 .52261 L .91209 .5156 L .98077 .51404 L s .7 g .98077 .93333 m .91209 .92913 L .84479 .91209 L .84341 .91009 L .79535 .84341 L .78433 .77473 L .78433 .70604 L .79535 .63736 L .84341 .57067 L .84479 .56868 L .91209 .54788 L .98077 .54293 L F 0 g .98077 .93333 m .91209 .92913 L .84479 .91209 L .84341 .91009 L .79535 .84341 L .78433 .77473 L .78433 .70604 L .79535 .63736 L .84341 .57067 L .84479 .56868 L .91209 .54788 L .98077 .54293 L s .3 g .98077 .45707 m .91209 .45212 L .84479 .43132 L .84341 .42933 L .79535 .36264 L .78433 .29396 L .78433 .22527 L .79535 .15659 L .84341 .08991 L .84479 .08791 L .91209 .07087 L .98077 .06667 L F 0 g .98077 .45707 m .91209 .45212 L .84479 .43132 L .84341 .42933 L .79535 .36264 L .78433 .29396 L .78433 .22527 L .79535 .15659 L .84341 .08991 L .84479 .08791 L .91209 .07087 L .98077 .06667 L s .2 g .98077 .42676 m .91209 .41893 L .84341 .37227 L .83763 .36264 L .81547 .29396 L .81547 .22527 L .83763 .15659 L .84341 .14696 L .91209 .1003 L .98077 .09247 L F 0 g .98077 .42676 m .91209 .41893 L .84341 .37227 L .83763 .36264 L .81547 .29396 L .81547 .22527 L .83763 .15659 L .84341 .14696 L .91209 .1003 L .98077 .09247 L s .8 g .98077 .90753 m .91209 .8997 L .84341 .85304 L .83763 .84341 L .81547 .77473 L .81547 .70604 L .83763 .63736 L .84341 .62773 L .91209 .58107 L .98077 .57324 L F 0 g .98077 .90753 m .91209 .8997 L .84341 .85304 L .83763 .84341 L .81547 .77473 L .81547 .70604 L .83763 .63736 L .84341 .62773 L .91209 .58107 L .98077 .57324 L s .1 g .98077 .39439 m .91209 .37815 L .88175 .36264 L .84691 .29396 L .84691 .22527 L .88175 .15659 L .91209 .14108 L .98077 .12484 L F 0 g .98077 .39439 m .91209 .37815 L .88175 .36264 L .84691 .29396 L .84691 .22527 L .88175 .15659 L .91209 .14108 L .98077 .12484 L s .9 g .98077 .87516 m .91209 .85892 L .88175 .84341 L .84691 .77473 L .84691 .70604 L .88175 .63736 L .91209 .62185 L .98077 .60561 L F 0 g .98077 .87516 m .91209 .85892 L .88175 .84341 L .84691 .77473 L .84691 .70604 L .88175 .63736 L .91209 .62185 L .98077 .60561 L s 1 g .98077 .82869 m .91209 .79783 L .89195 .77473 L .89195 .70604 L .91209 .68294 L .98077 .65208 L F 0 g .98077 .82869 m .91209 .79783 L .89195 .77473 L .89195 .70604 L .91209 .68294 L .98077 .65208 L s .98077 .34792 m .91209 .31706 L .89195 .29396 L .89195 .22527 L .91209 .20217 L .98077 .17131 L F .98077 .34792 m .91209 .31706 L .89195 .29396 L .89195 .22527 L .91209 .20217 L .98077 .17131 L s % End of Graphics MathPictureEnd \ \>"], "Graphics", ImageSize->{288, 288}, ImageMargins->{{43, 0}, {0, 0}}, ImageRegion->{{0, 1}, {0, 1}}, ImageCache->GraphicsData["Bitmap", "\<\ CF5dJ6E]HGAYHf4PAg9QL6QYHgon6Ykno_hn?S`2ook>c/mWIfGmoOol005E[;lC4a000<`00IP00V@00c000 o`0c000c<`0cIP0cV@0cc00co`1V001V<`1VIP1VV@1Vc01Vo`2I002I<`2IIP2IV@2Ic02Io`3<003< <`3I03>IIIS>IVC>Ic3>Ioc?<03?<@000`40000f00030@0000L00`4i0003 0@0000@0000H00040@000CH000@1000120000`40000i00030@0003H000<100001`000`40000j0003 0@0000<0000H00040@000CH000@1000120000`40000g00<1=P030@T000<10000=`00104000450000 6@020CP00P4900@1>0000`40000f00030@0000L0104g00811P000?l08@0001D0o`4;0@40000E0003 0@00008000<100002P000`40000900030@0000X000<100002P000`40000:00030@0000X000<10000 2@000`40000:00030@0000X000<100002P000`40000900030@0000X000<100002P000`40000:0003 0@0000T000<100002P000`40000:00030@0000X000<100002P000`40000900030@0000800@410000 5@000`40000200030@0003d000<10000?@000`40000l00030@0003d000<100000P010@40000E0003 0@000?l01`010@40000>00811@000`40003o00L00@4100003@00104000440081o`0700810@0000d0 00@1000110000`400002003oY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW00D00@4100003@001040004400030@000080 0?l9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`T01@010@40000=00040@000@@000<100000P00ojL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`0500410@0000d000@1000110000`400002003o2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL900D00@4100003P020@D0 00<100000P090@1^2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JLB0@1]2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@0:0@@0 0@4100005@000`40000200T93P40DZL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T>0A:W3P40DZL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`T=0@T91@010@40000E00030@0000805`T90@10Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@T1;ZL90@10Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@T1 5PT500410@0001D000<100000P0P2@D103JW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T50D2W1@40=ZL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@D17`T500410@0001D000<100000P0U2@810389Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`81BZL20@0b2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL20B@91@010@40000E00030@000080 9`T20@0^Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@81CZL20@0^ Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@819PT500410@0001D0 00<100000P0Y2@8102X9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL20E:W 0P40:PVW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`81:0T500410@0001D0 00<100000P0[2@8102JW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@81EZL20@0V Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T20BX91@010@40000E00810`090B@9 0P4090VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90BBW4P4TY`0V0JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@4S2@X10`020@40000E00030@00008000UB2E89DPUB2E80 2`4K2@8101nW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW00816ZL;0@0B2:L8Y`RW2:L8Y`RW 2:L8Y`RW2`4JY`810209Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`816PT:0@09DPUB2E89 DPUB00D00@4100005@000`400002000D2E89DPUB2E89DPUB2E89DPUB2E840AT90P406`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2@020ARW1040:0RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L40ARW0P407:L9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T20AP910404`UB2E89DPUB 2E89DPUB2E89DPT01@010@40000E00030@00008001QB2E89DPUB2E89DPUB2E89DPUB2E89DPT30AP9 0P405jL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW00815ZL40@0`Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L80`4GY`8101P9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL20AH9 10405e89DPUB2E89DPUB2E89DPUB2E89DPUB00D00@4100005@000`400002000K2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E8900@15PT20@0C2JL9Y`VW2JL9Y`VW2JL9Y`VW2@020AFW0`40=`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P0104EY`8101BW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2@815@T30@0K2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E8900D00@410000 5@000`400002000ODPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP040A@901<12JL9Y`VW2JL9 Y`VW2JL9Y`T101>W1040?PRW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW104CY`0D0JL9Y`VW2JL9Y`VW2JL9Y`VW2@4C2@@101h9DPUB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E8500410@0001D000<100000P008`UB2E89DPUB2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E8900814PT04`6W2JL9Y`VW2JL9Y`VW2JL9Y`404JL20@16Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2081 4ZL04P6W2JL9Y`VW2JL9Y`VW2JL90A890P408U89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPT500410@0001D000<100000P050@0Q2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E810149 01<12JL9Y`VW2JL9Y`VW2JL9Y`T1012W02812:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 2@408@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0@0AY`0B0@VW2JL9Y`VW2JL9Y`VW2JL1 4@T08@49DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP050@@00@4100005@000`40000200EB 2@4060UB2E89DPUB2E89DPUB2E89DPUB2E890A4901<1Y`VW2JL9Y`VW2JL9Y`VW2JL1012W01P1Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L:0@T82@4060RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L80A6W0181Y`VW 2JL9Y`VW2JL9Y`VW2@4A2@0H0E89DPUB2E89DPUB2E89DPUB2E89DPUB2@44DPD00@4100005@000`40 000200iB1@4050UB2E89DPUB2E89DPUB2E89DPT14@T04@6W2JL9Y`VW2JL9Y`VW2JL1012W01@1Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`D170P50@0D2:L8Y`RW2:L8Y`RW2:L8Y`RW204AY`0@0JL9Y`VW2JL9Y`VW 2JL90A4901@1DPUB2E89DPUB2E89DPUB2E89DPD13E8500410@0001D000<100000P0CDP8101=B2E89 DPUB2E89DPUB2E89DPT1010901412JL9Y`VW2JL9Y`VW2JL90@0?Y`0C0JL8Y`RW2:L8Y`RW2:L8Y`RW 20020BH80P404jL8Y`RW2:L8Y`RW2:L8Y`RW20404:L04049Y`VW2JL9Y`VW2JL9Y`4@2@0C0E89DPUB 2E89DPUB2E89DPUB2@020A9B1@010@40000E00030@0000805E80505B2E89DPUB2E89DPUB2E89DPT1 3`T04@6W2JL9Y`VW2JL9Y`VW2JL100jW01@1Y`RW2:L8Y`RW2:L8Y`RW2:L80BX801@1Y`RW2:L8Y`RW 2:L8Y`RW2:L80@nW0101Y`VW2JL9Y`VW2JL9Y`T13`T0505B2E89DPUB2E89DPUB2E89DPT155850041 0@0001D000<100000P0FDP810149DPUB2E89DPUB2E89DPUB0@0?2@0A0@VW2JL9Y`VW2JL9Y`VW2@40 3ZL04@48Y`RW2:L8Y`RW2:L8Y`RW0081;0P20@0A2:L8Y`RW2:L8Y`RW2:L8Y`403jL04049Y`VW2JL9 Y`VW2JL9Y`4?2@0A0@UB2E89DPUB2E89DPUB2E800P4EDPD00@4100005@020@<065804P49DPUB2E89 DPUB2E89DPUB0@l900l12JL9Y`VW2JL9Y`VW2@403ZL04P48Y`RW2:L8Y`RW2:L8Y`RW0C0801812:L8 Y`RW2:L8Y`RW2:L8Y`4?Y`0>0@VW2JL9Y`VW2JL9Y`4?2@0B0@UB2E89DPUB2E89DPUB2E815e840081 0@0001D000<100000P0IDP81011B2E89DPUB2E89DPUB2E813PT03`6W2JL9Y`VW2JL9Y`VW0@0=Y`0@ 0@RW2:L8Y`RW2:L8Y`RW20810JL8Y`RW2:L8Y`RW 2:L20AX81@4I208100h8Y`RW2:L8Y`RW2:L80@fW00h1Y`VW2JL9Y`VW2JL90@d900h1DPUB2E89DPUB 2E89DP816E830@@00@4100005@000`40000200030E8100@15e803`49DPUB2E89DPUB2E890@0<2@0? 0@VW2JL9Y`VW2JL9Y`T100^W00l1Y`RW2:L8Y`RW2:L8Y`405`P50@05200800P0104G200?0@RW2:L8 Y`RW2:L8Y`P100bW00h12JL9Y`VW2JL9Y`VW0@`900l1DPUB2E89DPUB2E89DP405e840@03DP4000@0 0@4100005@000`4000020007DP5B0E81DP050A=B0P403E89DPUB2E89DPUB2@4030T03@49Y`VW2JL9 Y`VW2@402jL03@6W2:L8Y`RW2:L8Y`P00P4D20@100h800P0200800P0200800D14`P20@0=Y`RW2:L8 Y`RW2:L80@0DP@100mB0E81DP5B0E81DP5B0E801@010@40000E00030@0000800181DP5B0E81DP5B 0E81DP5B0E830@mB00`12E89DPUB2E89DP4:2@0=0JL9Y`VW2JL9Y`VW0@09Y`0<0@RW2:L8Y`RW2:L1 3PP20@0W200800P0200800P0200800P0200800P0200800P0200800P0200800813`P03048Y`RW2:L8 Y`RW0@ZW00`1Y`VW2JL9Y`VW2@4:2@0<0@UB2E89DPUB2E813U830@0BDP5B0E81DP5B0E81DP5B0E81 1@010@40000E00030@00008001EB0E81DP5B0E81DP5B0E81DP5B0E800P4>DP0<0@UB2E89DPUB2E81 2PT02`6W2JL9Y`VW2JL100VW00d12:L8Y`RW2:L8Y`P100`80P40:`0800P0200800P0200800P02008 00P0200800P0200800P0200800P020000P4>200<0@RW2:L8Y`RW2:L12ZL02P6W2JL9Y`VW2@4:2@0< 0@UB2E89DPUB2E813E820@0EDP5B0E81DP5B0E81DP5B0E81DP5B00D00@4100005@000`400002000F 0E81DP5B0E81DP5B0E81DP5B0E81DP<13580305B2E89DPUB2E890@X900/12JL9Y`VW2JL90@09Y`0< 0JL8Y`RW2:L8Y`P12`P20@0_200800P0200800P0200800P0200800P0200800P0200800P0200800P0 200800P00P4<200<0JL8Y`RW2:L8Y`P12ZL02P49Y`VW2JL9Y`4:2@0<0E89DPUB2E89DPT12e830@0F DP5B0E81DP5B0E81DP5B0E81DP5B0@D00@4100005@000`400002000IDP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP020@]B00`1DPUB2E89DPUB2@492@0;0JL9Y`VW2JL9Y`402:L03@6W2:L8Y`RW2:L8Y`40 2PP0=040200800P0200800P0200800P0200800P0200800P0200800P0200800P0200800P020020@/8 00`1Y`RW2:L8Y`RW2049Y`0:0JL9Y`VW2JL90@T900`1DPUB2E89DPUB2@4;DP0J0E81DP5B0E81DP5B 0E81DP5B0E81DP5B0E8500410@0001D000<100000P006P5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B 0P4:DP0<0@UB2E89DPUB2E812@T02`49Y`VW2JL9Y`T100RW00d12:L8Y`RW2:L8Y`P100X803L12008 00P0200800P0200800P0200800P0200800P0200800P0200800P0200800P0200800P100X800`12:L8 Y`RW2:L8Y`49Y`0:0@VW2JL9Y`VW0@T900`12E89DPUB2E89DP4;DP8101QB0E81DP5B0E81DP5B0E81 DP5B0E81DP4500410@0001D00P43000LDP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0@]B00/12E89 DPUB2E890@092@0;0JL9Y`VW2JL9Y`402:L0306W2:L8Y`RW2:L80@X803P1200800P0200800P02008 00P0200800P0200800P0200800P0200800P0200800P0200800P00@/800/12:L8Y`RW2:L80@09Y`0: 0JL9Y`VW2JL90@T900/1DPUB2E89DPUB0@0;DP8101UB0E81DP5B0E81DP5B0E81DP5B0E81DP5B00@0 0P4100005@000`400002000M0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP402U80305B2E89DPUB 2E890@P900/12JL9Y`VW2JL90@08Y`0<0@RW2:L8Y`RW2:L12PP0>@40200800P0200800P0200800P0 200800P0200800P0200800P0200800P0200800P0200800P00@0:200<0JL8Y`RW2:L8Y`P12:L02P49 Y`VW2JL9Y`492@0;0@UB2E89DPUB2@402e806`5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0@050041 0@0001D000<100000P020@0IDP5B0E81DP5B0E81DP5B0E81DP5B0E81DP020@YB00`12E89DPUB2E89 DP482@0;0JL9Y`VW2JL9Y`401jL03@48Y`RW2:L8Y`RW20402@P07040200800P0200800P0200800P0 200800P020030@0K00P0200800P0200800P0200800P0200800P100X800`12:L8Y`RW2:L8Y`48Y`0: 0JL9Y`VW2JL90@P900`12E89DPUB2E89DP4:DP0J0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E830@@0 0@4100005@000`40000200D101MB0E81DP5B0E81DP5B0E81DP5B0E81DP020@YB00/12E89DPUB2E89 0@082@0;0@VW2JL9Y`VW2@401jL0306W2:L8Y`RW2:L80@X801X1200800P0200800P0200800P02008 00P020810`020@0J200800P0200800P0200800P0200800P02049200<0JL8Y`RW2:L8Y`P12:L02P49 Y`VW2JL9Y`482@0;0E89DPUB2E89DP402e820@0GDP5B0E81DP5B0E81DP5B0E81DP5B0E800`450041 0@0001D000<100000P060@0HDP5B0E81DP5B0E81DP5B0E81DP5B0E812U802`5B2E89DPUB2E8100P9 00/1Y`VW2JL9Y`VW0@07Y`0<0@RW2:L8Y`RW2:L12@P06@4800P0200800P0200800P0200800P02000 0P47008101P0200800P0200800P0200800P02008004:200;0JL8Y`RW2:L8Y`402:L02P6W2JL9Y`VW 2@482@0;0@UB2E89DPUB2@402U820@0EDP5B0E81DP5B0E81DP5B0E81DP5B00H11@010@40000E0003 0@0000802@405U81DP5B0E81DP5B0E81DP5B0E81DP49DP0;0@UB2E89DPUB2@4020T02`49Y`VW2JL9 Y`T100NW00`1Y`RW2:L8Y`RW2049200F0@0800P0200800P0200800P0200800<12`020@0G200800P0 200800P0200800P0200800402@P02`48Y`RW2:L8Y`P100RW00X12JL9Y`VW2JL120T02`5B2E89DPUB 2E8100YB01H1DP5B0E81DP5B0E81DP5B0E81DP5B1`4500410@0001D000<100000P0<0@0ADP5B0E81 DP5B0E81DP5B0E800P4:DP0:0@UB2E89DPUB0@P900/1Y`VW2JL9Y`VW0@07Y`0;0@RW2:L8Y`RW2040 2@P05@40200800P0200800P0200800P020020A000`4050P0200800P0200800P0200800P12@P02`6W 2:L8Y`RW2:L100RW00X1Y`VW2JL9Y`T120T02P49DPUB2E89DP4:DP0D0E81DP5B0E81DP5B0E81DP5B 0E8:0@D00@4100005@000`40000200d1015B0E81DP5B0E81DP5B0E81DP020@UB00/1DPUB2E89DPUB 0@082@0:0JL9Y`VW2JL90@NW00/1Y`RW2:L8Y`RW0@09200B0@P0200800P0200800P020080`4E0081 01<0200800P0200800P0200800P100T800/1Y`RW2:L8Y`RW0@08Y`090JL9Y`VW2JL100P900X1DPUB 2E89DPT12U820@0?DP5B0E81DP5B0E81DP5B00d11@010@40000E00030@00008040404581DP5B0E81 DP5B0E81DP49DP0;0@UB2E89DPUB2@4020T02@49Y`VW2JL90@07Y`0<0JL8Y`RW2:L8Y`P120P04@48 00P0200800P0200800P000816P020@0A200800P0200800P0200800402@P02`48Y`RW2:L8Y`P100RW 00P12JL9Y`VW0@P900/1DPUB2E89DPUB0@09DP8100mB0E81DP5B0E81DP5B0E803P4500410@0001D0 00<100000P0A0@0@DP5B0E81DP5B0E81DP5B0@UB00X12E89DPUB2E8120T02@6W2JL9Y`VW0@07Y`0; 0@RW2:L8Y`RW20402@P03`40200800P0200800P020020Ah00P40400800P0200800P020080048200; 0JL8Y`RW2:L8Y`402:L0206W2JL9Y`T120T02P49DPUB2E89DP4:DP0>0E81DP5B0E81DP5B0E8A0@D0 0@4100005@000`40000201@100]B0E81DP5B0E81DP020@UB00X1DPUB2E89DPT120T02@49Y`VW2JL9 0@07Y`0;0JL8Y`RW2:L8Y`4020P03P40200800P0200800P00P4R008100h800P0200800P020080@P8 00/12:L8Y`RW2:L80@08Y`080@VW2JL9Y`482@0:0E89DPUB2E890@UB00h1DP5B0E81DP5B0E81DQ81 1@010@40000E00030@0000805@402e81DP5B0E81DP5B008125802P49DPUB2E89DP482@090JL9Y`VW 2JL100NW00/12:L8Y`RW2:L80@08200>0@P0200800P02008004V000?0@P0200800P0200800P100P8 00X12:L8Y`RW2:L12:L0206W2JL9Y`T120T02P49DPUB2E89DP49DP8100]B0E81DP5B0E81DP0C0@D0 0@4100005@000`40000201H100aB0E81DP5B0E81DP49DP090@UB2E89DPT100P900T12JL9Y`VW2@40 1jL02P6W2:L8Y`RW2048200>0@P0200800P02008004X000>0@P0200800P020080048200:0JL8Y`RW 2:L80@RW00P12JL9Y`VW0@P900T1DPUB2E89DP402E820@0;DP5B0E81DP5B0E80504500410@0001D0 0P4301L100aB0E81DP5B0E81DP48DP0:0E89DPUB2E890@L900T1Y`VW2JL9Y`401jL02P48Y`RW2:L8 Y`48200>0@0800P0200800P0204Y000>0@P0200800P020080047200;0@RW2:L8Y`RW20401jL0206W 2JL9Y`T120T02@49DPUB2E890@09DP0<0E81DP5B0E81DP5B5@4400810@0001D000<100000P0H0@09 DP5B0E81DP5B008125802P49DPUB2E89DP472@090@VW2JL9Y`T100JW00/12:L8Y`RW2:L80@07200> 0@0800P0200800P0204Z000>0@0800P0200800P02047200;0JL8Y`RW2:L8Y`401jL02049Y`VW2JL1 1`T02P49DPUB2E89DP48DP0<0E81DP5B0E81DP5B5P4500410@0001D000<100000P0I0@09DP5B0E81 DP5B008125802@49DPUB2E890@072@090JL9Y`VW2JL100JW00X1Y`RW2:L8Y`P120P03@4800P02008 00P02040;0003P40200800P0200800P11`P02P6W2:L8Y`RW2047Y`080JL9Y`VW2@472@090E89DPUB 2E8100UB0P402E81DP5B0E81DP0G0@D00@4100005@000`40000201X100YB0E81DP5B0E8125802@5B 2E89DPUB0@072@090@VW2JL9Y`T100JW00X12:L8Y`RW2:L11`P03@4800P0200800P02040;P003@40 200800P0200800401`P02P48Y`RW2:L8Y`47Y`080@VW2JL9Y`472@090@UB2E89DPT100QB0P402E81 DP5B0E81DP0H0@D00@4100005@000`40000201T100UB0E81DP5B0E800P48DP090@UB2E89DPT100L9 00T1Y`VW2JL9Y`401ZL02P6W2:L8Y`RW2047200=0@0800P0200800P00@0^000=0@P0200800P02008 0@07200:0JL8Y`RW2:L80@NW00P1Y`VW2JL90@L900T1DPUB2E89DP402580305B0E81DP5B0E81DQL1 1@010@40000E00030@0000806P402U81DP5B0E81DP48DP090E89DPUB2E8100L900T12JL9Y`VW2@40 1ZL02P48Y`RW2:L8Y`47200=0@P0200800P020080@0^000=0@0800P0200800P00@07200:0@RW2:L8 Y`RW0@NW00P12JL9Y`VW0@L900T12E89DPUB2@4025820@09DP5B0E81DP5B01P11@010@40000E0003 0@0000806@402E81DP5B0E81DP020@QB00T12E89DPUB2@401`T02@6W2JL9Y`VW0@06Y`0:0JL8Y`RW 2:L80@L800d100P0200800P0200102h000d1200800P0200800P100L800X1Y`RW2:L8Y`P11jL0206W 2JL9Y`T11`T02@5B2E89DPUB0@08DP0<0E81DP5B0E81DP5B5`4500410@0001D000<100000P0J0@0: DP5B0E81DP5B0@QB00T1DPUB2E89DP401`T02@49Y`VW2JL90@06Y`0:0@RW2:L8Y`RW0@L800d12008 00P0200800P102h000d100P0200800P0200100L800X12:L8Y`RW2:L11jL02049Y`VW2JL11`T02@49 DPUB2E890@08DP8100UB0E81DP5B0E80604500410@0001D000<100000P0I0@09DP5B0E81DP5B0081 25802@49DPUB2E890@072@090JL9Y`VW2JL100JW00X1Y`RW2:L8Y`P11`P03@40200800P020080040 ;P003@4800P0200800P020401`P02P6W2:L8Y`RW2047Y`080JL9Y`VW2@472@090E89DPUB2E8100QB 00`1DP5B0E81DP5B0E8G0@D00@4100005@000`40000201X100YB0E81DP5B0E8125802@5B2E89DPUB 0@072@090@VW2JL9Y`T100JW00X12:L8Y`RW2:L11`P03@4800P0200800P02040;P003@40200800P0 200800401`P02P48Y`RW2:L8Y`47Y`080@VW2JL9Y`472@090@UB2E89DPT100QB0P402E81DP5B0E81 DP0H0@D00@4100005@000`40000201T100UB0E81DP5B0E800P48DP090@UB2E89DPT100L900T1Y`VW 2JL9Y`401ZL02P6W2:L8Y`RW2047200=0@0800P0200800P00@0^000=0@P0200800P020080@07200: 0JL8Y`RW2:L80@NW00P1Y`VW2JL90@L900T1DPUB2E89DP402580305B0E81DP5B0E81DQL11@010@40 0002008110000`40000200<11@000`40000201X100YB0E81DP5B0E8125802@5B2E89DPUB0@072@09 0@VW2JL9Y`T100JW00X12:L8Y`RW2:L11`P03@4800P0200800P02040;P003@40200800P020080040 1`P02P48Y`RW2:L8Y`47Y`080@VW2JL9Y`472@090@UB2E89DPT100QB0P402E81DP5B0E81DP0H0@D0 0@41000000D00@000@0;00030@0000800P4301T100UB0E81DP5B0E800P48DP090@UB2E89DPT100L9 00T1Y`VW2JL9Y`401ZL02P6W2:L8Y`RW2047200=0@0800P0200800P00@0^000=0@P0200800P02008 0@07200:0JL8Y`RW2:L80@NW00P1Y`VW2JL90@L900T1DPUB2E89DP402580305B0E81DP5B0E81DQL1 10020@4000001@01000100/000<100000P000`40000201X100YB0E81DP5B0E8125802@5B2E89DPUB 0@072@090@VW2JL9Y`T100JW00X12:L8Y`RW2:L11`P03@4800P0200800P02040;P003@40200800P0 200800401`P02P48Y`RW2:L8Y`47Y`080@VW2JL9Y`472@090@UB2E89DPT100QB0P402E81DP5B0E81 DP0H0@D00@41000000D00@000@0800<11@000`40000201T100UB0E81DP5B0E800P48DP090@UB2E89 DPT100L900T1Y`VW2JL9Y`401ZL02P6W2:L8Y`RW2047200=0@0800P0200800P00@0^000=0@P02008 00P020080@07200:0JL8Y`RW2:L80@NW00P1Y`VW2JL90@L900T1DPUB2E89DP402580305B0E81DP5B 0E81DQL11@010@4000001@01000100P000<100001@000`40000201X100YB0E81DP5B0E8125802@5B 2E89DPUB0@072@090@VW2JL9Y`T100JW00X12:L8Y`RW2:L11`P03@4800P0200800P02040;P003@40 200800P0200800401`P02P48Y`RW2:L8Y`47Y`080@VW2JL9Y`472@090@UB2E89DPT100QB0P402E81 DP5B0E81DP0H0@D00@41000000D00@000@0800030@0000D000<100000P0I0@09DP5B0E81DP5B0081 25802@49DPUB2E890@072@090JL9Y`VW2JL100JW00X1Y`RW2:L8Y`P11`P03@40200800P020080040 ;P003@4800P0200800P020401`P02P6W2:L8Y`RW2047Y`080JL9Y`VW2@472@090E89DPUB2E8100QB 00`1DP5B0E81DP5B0E8G0@D00@4100000P020@T0104400030@0000806P402U81DP5B0E81DP48DP09 0E89DPUB2E8100L900T12JL9Y`VW2@401ZL02P48Y`RW2:L8Y`47200=0@P0200800P020080@0^000= 0@0800P0200800P00@07200:0@RW2:L8Y`RW0@NW00P12JL9Y`VW0@L900T12E89DPUB2@4025820@09 DP5B0E81DP5B01P11@010@40000E00030@0000806@402E81DP5B0E81DP020@QB00T12E89DPUB2@40 1`T02@6W2JL9Y`VW0@06Y`0:0JL8Y`RW2:L80@L800d100P0200800P0200102h000d1200800P02008 00P100L800X1Y`RW2:L8Y`P11jL0206W2JL9Y`T11`T02@5B2E89DPUB0@08DP0<0E81DP5B0E81DP5B 5`4500410@0001D000<100000P0J0@0:DP5B0E81DP5B0@QB00T1DPUB2E89DP401`T02@49Y`VW2JL9 0@06Y`0:0@RW2:L8Y`RW0@L800d1200800P0200800P102h000d100P0200800P0200100L800X12:L8 Y`RW2:L11jL02049Y`VW2JL11`T02@49DPUB2E890@08DP8100UB0E81DP5B0E80604500410@0001D0 00<100000P0I0@09DP5B0E81DP5B008125802@49DPUB2E890@072@090JL9Y`VW2JL100JW00X1Y`RW 2:L8Y`P11`P03@40200800P020080040;P003@4800P0200800P020401`P02P6W2:L8Y`RW2047Y`08 0JL9Y`VW2@472@090E89DPUB2E8100QB00`1DP5B0E81DP5B0E8G0@D00@4100005@000`40000201X1 00YB0E81DP5B0E8125802@5B2E89DPUB0@072@090@VW2JL9Y`T100JW00X12:L8Y`RW2:L11`P03@48 00P0200800P02040;P003@40200800P0200800401`P02P48Y`RW2:L8Y`47Y`080@VW2JL9Y`472@09 0@UB2E89DPT100QB0P402E81DP5B0E81DP0H0@D00@4100005@000`40000201T100UB0E81DP5B0E80 0P48DP090@UB2E89DPT100L900T1Y`VW2JL9Y`401ZL02P6W2:L8Y`RW2047200>0@0800P0200800P0 204/000>0@0800P0200800P02047200:0JL8Y`RW2:L80@NW00P1Y`VW2JL90@L900T1DPUB2E89DP40 2580305B0E81DP5B0E81DQL11@010@40000E00030@00008060402E81DP5B0E81DP020@QB00X12E89 DPUB2E811`T02@49Y`VW2JL90@06Y`0;0@RW2:L8Y`RW20401`P03@40200800P020080040;0003@48 00P0200800P020401`P02`6W2:L8Y`RW2:L100NW00P12JL9Y`VW0@L900X12E89DPUB2E812580305B 0E81DP5B0E81DQH11@010@40000E00030@0000805`403581DP5B0E81DP5B0@QB00X1DPUB2E89DPT1 1`T02@6W2JL9Y`VW0@06Y`0;0JL8Y`RW2:L8Y`401`P03P4800P0200800P02001:P003P4800P02008 00P020011`P02`48Y`RW2:L8Y`P100NW00P1Y`VW2JL90@L900X1DPUB2E89DPT125820@0;DP5B0E81 DP5B0E805@4500410@0001D00P4301H100aB0E81DP5B0E81DP49DP090@UB2E89DPT100P900T12JL9 Y`VW2@401jL02P6W2:L8Y`RW2048200>0@P0200800P02008004X000>0@P0200800P020080048200: 0JL8Y`RW2:L80@RW00P12JL9Y`VW0@P900T1DPUB2E89DP402E820@0;DP5B0E81DP5B0E8050440081 0@0001D000<100000P0E0@0;DP5B0E81DP5B0E800P48DP0:0@UB2E89DPUB0@P900T1Y`VW2JL9Y`40 1jL02`48Y`RW2:L8Y`P100L800l100P0200800P0200800409P003`4800P0200800P020080@08200: 0@RW2:L8Y`RW0@RW00P1Y`VW2JL90@P900X12E89DPUB2E8125803P5B0E81DP5B0E81DP5B4`450041 0@0001D000<100000P0D0@0;DP5B0E81DP5B0E800P49DP0:0E89DPUB2E890@P900T12JL9Y`VW2@40 1jL02`6W2:L8Y`RW2:L100P800h100P0200800P020080BH000h100P0200800P020080@P800/12:L8 Y`RW2:L80@08Y`080@VW2JL9Y`482@0:0E89DPUB2E890@UB00`1DP5B0E81DP5B0E8D0@D00@410000 5@000`40000201<100iB0E81DP5B0E81DP5B0@UB00X12E89DPUB2E8120T02@6W2JL9Y`VW0@07Y`0; 0@RW2:L8Y`RW204020P03P4800P0200800P020080P4R008100h0200800P0200800P00@P800/1Y`RW 2:L8Y`RW0@08Y`080JL9Y`VW2@482@0:0@UB2E89DPUB0@UB0P402e81DP5B0E81DP5B01<11@010@40 000E00030@0000804P403U81DP5B0E81DP5B0E812E802`49DPUB2E89DPT100P900T12JL9Y`VW2@40 1jL0306W2:L8Y`RW2:L80@P800l1200800P0200800P020000P4N008100l800P0200800P020080040 2@P02`48Y`RW2:L8Y`P100RW00P12JL9Y`VW0@P900/1DPUB2E89DPUB0@09DP8100eB0E81DP5B0E81 DP5B01011@010@40000E00030@0000803`403e81DP5B0E81DP5B0E81DP020@UB00/1DPUB2E89DPUB 0@082@090JL9Y`VW2JL100NW00`12:L8Y`RW2:L8Y`48200A0@0800P0200800P0200800P00P4J0081 0140200800P0200800P020080@09200;0JL8Y`RW2:L8Y`402:L0206W2JL9Y`T120T02`49DPUB2E89 DPT100UB0101DP5B0E81DP5B0E81DP5B3`4500410@0001D000<100000P0>0@0?DP5B0E81DP5B0E81 DP5B00812U802P49DPUB2E89DP482@0;0JL9Y`VW2JL9Y`401jL02`48Y`RW2:L8Y`P100T8018100P0 200800P0200800P020030AD00P404PP0200800P0200800P020080@T800/1Y`RW2:L8Y`RW0@08Y`0: 0JL9Y`VW2JL90@P900X12E89DPUB2E812U804P5B0E81DP5B0E81DP5B0E81DP`11@010@40000E0003 0@0000802`405581DP5B0E81DP5B0E81DP5B0E812U802P5B2E89DPUB2@482@0;0@VW2JL9Y`VW2@40 1jL02`6W2:L8Y`RW2:L100T801D1200800P0200800P0200800P020000P4@00<101@0200800P02008 00P0200800P00@T800/12:L8Y`RW2:L80@08Y`0:0@VW2JL9Y`VW0@P900X1DPUB2E89DPT12U820@0A DP5B0E81DP5B0E81DP5B0E802`4500410@0001D000<100000P080@0FDP5B0E81DP5B0E81DP5B0E81 DP5B0@YB00/1DPUB2E89DPUB0@082@0;0JL9Y`VW2JL9Y`401jL03048Y`RW2:L8Y`RW0@T801H12008 00P0200800P0200800P020080`4;008101H0200800P0200800P0200800P020012PP02`6W2:L8Y`RW 2:L100RW00X1Y`VW2JL9Y`T120T02`49DPUB2E89DPT100YB0P404e81DP5B0E81DP5B0E81DP5B0E80 204500410@0001D000<100000P070@0EDP5B0E81DP5B0E81DP5B0E81DP5B00812U802`49DPUB2E89 DPT100P900/12JL9Y`VW2JL90@07Y`0<0JL8Y`RW2:L8Y`P12@P06@40200800P0200800P0200800P0 200800P00P47008101P800P0200800P0200800P0200800P0204:200;0@RW2:L8Y`RW20402:L02P49 Y`VW2JL9Y`482@0;0E89DPUB2E89DP402U80605B0E81DP5B0E81DP5B0E81DP5B0E81DPD11@010@40 000E00030@00008010405e81DP5B0E81DP5B0E81DP5B0E81DP5B00812e802`5B2E89DPUB2E8100P9 00/1Y`VW2JL9Y`VW0@07Y`0<0@RW2:L8Y`RW2:L12PP06P40200800P0200800P0200800P0200800P0 0P43008101T0200800P0200800P0200800P0200800P100X800`12:L8Y`RW2:L8Y`48Y`0:0JL9Y`VW 2JL90@P900/12E89DPUB2E890@0;DP0H0E81DP5B0E81DP5B0E81DP5B0E81DP5B104500410@0001D0 00<100000P030@0JDP5B0E81DP5B0E81DP5B0E81DP5B0E81DP4:DP0<0E89DPUB2E89DPT120T02`49 Y`VW2JL9Y`T100NW00d1Y`RW2:L8Y`RW2:L100T801`1200800P0200800P0200800P0200800P02008 0`406`P0200800P0200800P0200800P0200800P00@0:200<0JL8Y`RW2:L8Y`P12:L02P49Y`VW2JL9 Y`482@0<0E89DPUB2E89DPT12U820@0IDP5B0E81DP5B0E81DP5B0E81DP5B0E81DP020@@00@410000 5@000`400002000LDP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0@]B00/12E89DPUB2E890@092@0; 0JL9Y`VW2JL9Y`402:L0306W2:L8Y`RW2:L80@X803P1200800P0200800P0200800P0200800P02008 00P0200800P0200800P0200800P0200800P00@/800/12:L8Y`RW2:L80@09Y`0:0JL9Y`VW2JL90@T9 00/1DPUB2E89DPUB0@0;DP8101UB0E81DP5B0E81DP5B0E81DP5B0E81DP5B00D00@4100005@020@<0 01X1DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP812e802`5B2E89DPUB2E8100T900/12JL9Y`VW2JL9 0@08Y`0<0@RW2:L8Y`RW2:L12PP0>040200800P0200800P0200800P0200800P0200800P0200800P0 200800P0200800P0200800P12`P02`6W2:L8Y`RW2:L100VW00X12JL9Y`VW2JL12@T02`49DPUB2E89 DPT100]B01/1DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP4010020@40000E00030@00008001UB0E81 DP5B0E81DP5B0E81DP5B0E81DP5B00812e80305B2E89DPUB2E890@T900/1Y`VW2JL9Y`VW0@08Y`0= 0JL8Y`RW2:L8Y`RW0@0:200f0@0800P0200800P0200800P0200800P0200800P0200800P0200800P0 200800P0200800P12`P0306W2:L8Y`RW2:L80@VW00X1Y`VW2JL9Y`T12@T0305B2E89DPUB2E890@]B 01X1DP5B0E81DP5B0E81DP5B0E81DP5B0E81DPD00@4100005@000`400002000H0E81DP5B0E81DP5B 0E81DP5B0E81DP5B0`4;DP0<0@UB2E89DPUB2E812@T02`49Y`VW2JL9Y`T100RW00d12:L8Y`RW2:L8 Y`P100X803@1200800P0200800P0200800P0200800P0200800P0200800P0200800P0200800P02008 0P4;200<0@RW2:L8Y`RW2:L12JL02P49Y`VW2JL9Y`492@0<0@UB2E89DPUB2E812e820@0HDP5B0E81 DP5B0E81DP5B0E81DP5B0E811@010@40000E00030@00008001MB0E81DP5B0E81DP5B0E81DP5B0E81 DP020@aB00`12E89DPUB2E89DP4:2@0;0JL9Y`VW2JL9Y`402JL03@48Y`RW2:L8Y`RW20402PP20@0_ 00P0200800P0200800P0200800P0200800P0200800P0200800P0200800P020000P4<200<0@RW2:L8 Y`RW2:L12ZL02P6W2JL9Y`VW2@4:2@0<0@UB2E89DPUB2E812e820@0GDP5B0E81DP5B0E81DP5B0E81 DP5B0E801@010@40000E00030@00008001@1DP5B0E81DP5B0E81DP5B0E81DP<13E803049DPUB2E89 DPUB0@/900/12JL9Y`VW2JL90@0:Y`0<0@RW2:L8Y`RW2:L130P20@0[200800P0200800P0200800P0 200800P0200800P0200800P0200800P020020@d800`12:L8Y`RW2:L8Y`4;Y`0:0@VW2JL9Y`VW0@/9 00`12E89DPUB2E89DP40E89DPUB2E89DPUB2@4=DPD100iB0E81DP5B0E81DP5B0@D00@4100005@000`40 0002000;DP5B0E81DP5B0E801@4@DP0>0E89DPUB2E89DPUB2@4<2@0=0@VW2JL9Y`VW2JL90@0;Y`0> 0JL8Y`RW2:L8Y`RW204@20D101L800P0200800P0200800P0200800P020040A0800h1Y`RW2:L8Y`RW 2:L80@bW00`12JL9Y`VW2JL9Y`4<2@0>0E89DPUB2E89DPUB2@4@DP@100]B0E81DP5B0E81DP050041 0@0001D000<100000P001P5B0E81DPH14U820@0=DPUB2E89DPUB2E890@0=2@0=0JL9Y`VW2JL9Y`VW 0@02@0?0JL9Y`VW 2JL9Y`VW2JL100fW00l12:L8Y`RW2:L8Y`RW2:L00P4d200A0JL8Y`RW2:L8Y`RW2:L8Y`403ZL03P6W 2JL9Y`VW2JL9Y`T13PT03`49DPUB2E89DPUB2E89DP020AUB1@010@40000E00030@0000806E804@5B 2E89DPUB2E89DPUB2E8100l900l12JL9Y`VW2JL9Y`VW2@403ZL04@48Y`RW2:L8Y`RW2:L8Y`P10388 0141Y`RW2:L8Y`RW2:L8Y`RW0@0?Y`0>0@VW2JL9Y`VW2JL9Y`4?2@0A0@UB2E89DPUB2E89DPUB2@40 658500410@0001D00P4301MB0P404E89DPUB2E89DPUB2E89DPT100l900l1Y`VW2JL9Y`VW2JL9Y`40 3ZL04@6W2:L8Y`RW2:L8Y`RW2:L80081;PP20@0AY`RW2:L8Y`RW2:L8Y`RW20403jL03P6W2JL9Y`VW 2JL9Y`T13`T04@5B2E89DPUB2E89DPUB2E8900815U8400810@0001D000<100000P0FDP0C0@UB2E89 DPUB2E89DPUB2E890@0?2@0A0JL9Y`VW2JL9Y`VW2JL9Y`403ZL04`6W2:L8Y`RW2:L8Y`RW2:L8Y`40 ;0P04`48Y`RW2:L8Y`RW2:L8Y`RW20403jL0406W2JL9Y`VW2JL9Y`VW2@4?2@0C0E89DPUB2E89DPUB 2E89DPUB0@0EDPD00@4100005@000`40000201EB01<12E89DPUB2E89DPUB2E89DPT1010901412JL9 Y`VW2JL9Y`VW2JL90@0?Y`0C0JL8Y`RW2:L8Y`RW2:L8Y`RW0@0Z200C0@RW2:L8Y`RW2:L8Y`RW2:L8 0@0@Y`0@0@VW2JL9Y`VW2JL9Y`VW0A0901<1DPUB2E89DPUB2E89DPUB2E8101AB1@010@40000E0003 0@0000804e820@0B2E89DPUB2E89DPUB2E89DPT14@T04@6W2JL9Y`VW2JL9Y`VW2JL1012W0181Y`RW 2:L8Y`RW2:L8Y`RW2:L20BH80P404PRW2:L8Y`RW2:L8Y`RW2:L80A6W0101Y`VW2JL9Y`VW2JL9Y`T1 4@T04P5B2E89DPUB2E89DPUB2E89DP814U8500410@0001D000<100000P0>DPD101AB2E89DPUB2E89 DPUB2E89DPUB0A4901412JL9Y`VW2JL9Y`VW2JL90@0@Y`0D0@RW2:L8Y`RW2:L8Y`RW2:L8Y`P50A`8 1@405:L8Y`RW2:L8Y`RW2:L8Y`RW2:L14JL04049Y`VW2JL9Y`VW2JL9Y`4A2@0D0@UB2E89DPUB2E89 DPUB2E89DPT50@eB1@010@40000E00030@0000801E890@0HDPUB2E89DPUB2E89DPUB2E89DPUB2E81 4@T04`49Y`VW2JL9Y`VW2JL9Y`VW2@404:L06048Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20X12@P90@0H Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L14JL04P49Y`VW2JL9Y`VW2JL9Y`VW0A4901P12E89DPUB2E89 DPUB2E89DPUB2E89DPT90@AB1@010@40000E00030@0000801@408589DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E814PT04`6W2JL9Y`VW2JL9Y`VW2JL9Y`404JL08@48Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`090@0PY`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`4BY`0B0JL9Y`VW 2JL9Y`VW2JL9Y`T14PT08049DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E891@4400410@0001D0 00<100000P008e89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB00814PT04`49Y`VW2JL9 Y`VW2JL9Y`VW2@404JL20@162:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`814ZL04P49Y`VW2JL9Y`VW2JL9Y`VW0A890P408PUB 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E8500410@0001D000<100000P007`UB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DPT0104D2@0C0JL9Y`VW2JL9Y`VW2JL9Y`VW0@0CY`@103jW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20@1 4jL05049Y`VW2JL9Y`VW2JL9Y`VW2JL14`T40@0NDPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 1@010@40000E00030@00008001]B2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E80104F2@8101>W2JL9 Y`VW2JL9Y`VW2JL9Y`VW00815JL30@0gY`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`040AFW0P4050VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0P4E2@<101]B2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E801@010@40000E00030@00008001P9DPUB2E89DPUB2E89DPUB 2E89DPUB2E830AP90P405`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL900815ZL40@0`2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0`4GY`8101RW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`T20AH910405`UB2E89DPUB2E89DPUB2E89DPUB2E8900D00@4100005@000`400002000D DPUB2E89DPUB2E89DPUB2E89DPT40AT90P407:L9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`4IY`@1 02RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8104IY`0N0@VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL16@T40@0CDPUB2E89DPUB2E89DPUB2E89DP0500410@0001D00P43000> 2E89DPUB2E89DPUB2E860A`901l12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW00816jL60@0L 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`H16jL20@0N2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW0P4K2@H100d9DPUB2E89DPUB2E8900@00P4100005@000`4000020005DPUB2E802@4P2@81 0289Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T18:L:0@09Y`RW2:L8Y`RW00T17jL20@0S Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@4080T90@042E89DPD00@4100005@000`40 000200D19`T20@0TY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90P4XY`T19jL09P49 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90P4W2@D110010@40000E00030@000080 :`T0:@49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0081E:L20@0X2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`81:@T500410@0001D000<100000P0Y2@81 02`9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90E:W02h1Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T1:0T500410@0001D000<100000P0W2@81 02jW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90P5>Y`8102jW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90P4V2@D00@4100005@000`40 000202D90P40W2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`020A:W01<12JL9Y`VW2JL9 Y`VW2JL9Y`T101490P40APUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E820A490P4040VW2JL9Y`VW2JL9Y`VW2JL20A6W0P408PRW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L500410@0001D000<100000P009@RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`404ZL04`6W2JL9Y`VW2JL9Y`VW2JL9Y`404@T0BP49 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E814PT04P6W2JL9Y`VW2JL9Y`VW2JL90A:W02@12:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`P500410@0001D000<100000P050@0Q2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L1016W01<12JL9Y`VW2JL9Y`VW2JL9Y`T1010902812E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E892@408@UB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB0@0A2@0B0@VW2JL9 Y`VW2JL9Y`VW2JL14JL08@48Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`050@@00@410000 5@000`40000200D82@4060RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L80A:W01412JL9Y`VW2JL9Y`VW2JL9 0@0A2@0H0E89DPUB2E89DPUB2E89DPUB2E89DPUB2P49DPT101P9DPUB2E89DPUB2E89DPUB2E89DPUB 2@4B2@0@0@VW2JL9Y`VW2JL9Y`VW0A:W01P1Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L90@@81@010@40 000E00030@0000803PP50@0D2:L8Y`RW2:L8Y`RW2:L8Y`RW204AY`0A0JL9Y`VW2JL9Y`VW2JL9Y`40 40T0505B2E89DPUB2E89DPUB2E89DPUB1@4LDPD101@9DPUB2E89DPUB2E89DPUB2E890A490101Y`VW 2JL9Y`VW2JL9Y`T14JL0506W2:L8Y`RW2:L8Y`RW2:L8Y`RW1@4=20D00@4100005@000`40000201<8 0P404jL8Y`RW2:L8Y`RW2:L8Y`RW20404:L04@49Y`VW2JL9Y`VW2JL9Y`T100l901<1DPUB2E89DPUB 2E89DPUB2E8900819U820@0CDPUB2E89DPUB2E89DPUB2E890@0@2@0@0@VW2JL9Y`VW2JL9Y`VW0A2W 01<1Y`RW2:L8Y`RW2:L8Y`RW2:L800814PP500410@0001D000<100000P0E200D0JL8Y`RW2:L8Y`RW 2:L8Y`RW204?Y`0A0JL9Y`VW2JL9Y`VW2JL9Y`403PT0505B2E89DPUB2E89DPUB2E89DPT1:U80505B 2E89DPUB2E89DPUB2E89DPT13`T0406W2JL9Y`VW2JL9Y`VW2@4?Y`0D0JL8Y`RW2:L8Y`RW2:L8Y`RW 204D20D00@4100005@000`40000201H80P404@RW2:L8Y`RW2:L8Y`RW2:L100nW01412JL9Y`VW2JL9 Y`VW2JL90@0>2@0A0@UB2E89DPUB2E89DPUB2E800P4/DP810149DPUB2E89DPUB2E89DPUB0@0?2@0@ 0@VW2JL9Y`VW2JL9Y`VW0@nW01412:L8Y`RW2:L8Y`RW2:L8Y`020AD81@010@40000E00810`0H200B 0@RW2:L8Y`RW2:L8Y`RW2:L13jL03`49Y`VW2JL9Y`VW2JL90@0>2@0B0@UB2E89DPUB2E89DPUB2E81 <5804P49DPUB2E89DPUB2E89DPUB0@l900h12JL9Y`VW2JL9Y`VW0@nW01812:L8Y`RW2:L8Y`RW2:L8 Y`4G20@00P4100005@000`40000201T80P404:L8Y`RW2:L8Y`RW2:L8Y`4>Y`0?0JL9Y`VW2JL9Y`VW 2JL100d901012E89DPUB2E89DPUB2E890P4bDP81011B2E89DPUB2E89DPUB2E813PT03P6W2JL9Y`VW 2JL9Y`T13ZL04048Y`RW2:L8Y`RW2:L8Y`P20AP81@010@40000E00030@0000800P4I200A0JL8Y`RW 2:L8Y`RW2:L8Y`403JL03`49Y`VW2JL9Y`VW2JL90@0=2@0@0E89DPUB2E89DPUB2E890AYB0`4IDP0A 0E89DPUB2E89DPUB2E89DP403@T03P49Y`VW2JL9Y`VW2JL13ZL0406W2:L8Y`RW2:L8Y`RW204I2081 10010@40000E00030@0000<000<80@400P4F208100h8Y`RW2:L8Y`RW2:L80@fW00l1Y`VW2JL9Y`VW 2JL9Y`4030T03P5B2E89DPUB2E89DPUB0P4GDPD100=B0@400`4FDP8100h9DPUB2E89DPUB2E890@d9 00h1Y`VW2JL9Y`VW2JL90@fW00h1Y`RW2:L8Y`RW2:L8Y`815PP40@H00@4100005@000`4000020006 200800P00`4E200?0@RW2:L8Y`RW2:L8Y`P100fW00d1Y`VW2JL9Y`VW2JL100`900l1DPUB2E89DPUB 2E89DP405E840@0;DP5B0E81DP5B0E800`4EDP0?0@UB2E89DPUB2E89DPT100d900`1Y`VW2JL9Y`VW 2@4=Y`0?0JL8Y`RW2:L8Y`RW2:L101@810401@P0200800D00@4100005@000`4000030008200800P0 20040A880P403JL8Y`RW2:L8Y`RW20403:L03@49Y`VW2JL9Y`VW2@402`T03@5B2E89DPUB2E89DPT0 0P4BDPD1015B0E81DP5B0E81DP5B0E81DP040A9B0P403E89DPUB2E89DPUB2@4030T03049Y`VW2JL9 Y`VW0@bW00d1Y`RW2:L8Y`RW2:L800814PP30@0800P0200800P600410@0001D000<100000P003@P0 200800P0200800P0104@200=0JL8Y`RW2:L8Y`RW0@0208101<800P0200800P0200800P0200800D00@410000 5@000`400003000D200800P0200800P0200800P020020@h800`12:L8Y`RW2:L8Y`4:Y`0;0JL9Y`VW 2JL9Y`402@T03@49DPUB2E89DPUB2@4035820@0[DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E81DP020@iB00`12E89DPUB2E89DP4:2@0:0JL9Y`VW2JL90@ZW00`12:L8Y`RW2:L8 Y`4=208101@0200800P0200800P0200800P020H00@4100005@000`400002000G200800P0200800P0 200800P0200800P00P4<200<0JL8Y`RW2:L8Y`P12ZL02`49Y`VW2JL9Y`T100T900`1DPUB2E89DPUB 2@4;DP<102eB0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E800`40@P02008 00P02008004G00410@0001D00P4G000>0@P0200800P02008004920090@RW2:L8Y`P100RW00T12JL9 Y`VW2@401`T02P5B2E89DPUB2@48DP8100]B0E81DP5B0E81DP0[0@00@P0200800P020080048200:0JL8Y`RW2:L80@NW00T1Y`VW2JL9Y`401`T02P49 DPUB2E89DP48DP0<0E81DP5B0E81DP5B;@403581DP5B0E81DP5B0@MB00/12E89DPUB2E890@072@08 0JL9Y`VW2@48Y`090@RW2:L8Y`P100T800h100P0200800P020080AP00@4100005@000`40000H000= 0@P0200800P020080@08200:0@RW2:L8Y`RW0@NW00T12JL9Y`VW2@401PT02`49DPUB2E89DPT100MB 00`1DP5B0E81DP5B0E8]0@0;DP5B0E81DP5B0E800P47DP0;0E89DPUB2E89DP401`T02049Y`VW2JL1 1jL02P48Y`RW2:L8Y`48200>0@0800P0200800P0204I00410@0001D000<100006@003@4800P02008 00P0204020P02@48Y`RW2:L80@07Y`090JL9Y`VW2JL100H900X1DPUB2E89DPT125820@09DP5B0E81 DP5B02l100]B0E81DP5B0E81DP020@MB00X1DPUB2E89DPT11`T0206W2JL9Y`T11jL02@6W2:L8Y`RW 0@09200=0@P0200800P020080@0J00410@0001D000<100006P00304800P0200800P00@P800T1Y`RW 2:L8Y`401jL02@49Y`VW2JL90@062@0:0@UB2E89DPUB0@MB0P402E81DP5B0E81DP0a0@00@0800P0200800P0204I00410@0001D000<100005`003P48 00P0200800P0200120P02P6W2:L8Y`RW2047Y`090JL9Y`VW2JL100L900X12E89DPUB2E812580305B 0E81DP5B0E81DRd100aB0E81DP5B0E81DP47DP0;0@UB2E89DPUB2@401`T0206W2JL9Y`T12:L02@48 Y`RW2:L80@09200>0@0800P0200800P0204H00410@0001D00P4G000>0@P0200800P0200800492009 0@RW2:L8Y`P100RW00T12JL9Y`VW2@401`T02P5B2E89DPUB2@48DP8100]B0E81DP5B0E81DP0[0@0< DP5B0E81DP5B0E8125802P5B2E89DPUB2@482@080@VW2JL9Y`48Y`090JL8Y`RW2:L100T800h12008 00P0200800P00AL00P4100005@000`40000E000?0@P0200800P0200800P100P800X12:L8Y`RW2:L1 2:L02@6W2JL9Y`VW0@072@0;0@UB2E89DPUB2@4025820@0;DP5B0E81DP5B0E80:@402e81DP5B0E81 DP5B008125802P49DPUB2E89DP482@080JL9Y`VW2@48Y`0:0@RW2:L8Y`RW0@T800h1200800P02008 00P00AL00@4100005@000`40000C008100h800P0200800P020080@T800X1Y`RW2:L8Y`P12:L02@49 Y`VW2JL90@072@0;0E89DPUB2E89DP4025803P5B0E81DP5B0E81DP5B9`402e81DP5B0E81DP5B0081 25802`49DPUB2E89DPT100P900P12JL9Y`VW0@RW00X1Y`RW2:L8Y`P12@P03P40200800P0200800P0 0P4E00410@0001D000<100004@020@0@00P0200800P0200800P00@T800X12:L8Y`RW2:L12:L02@6W 2JL9Y`VW0@072@0;0@UB2E89DPUB2@402E803P5B0E81DP5B0E81DP5B8`404581DP5B0E81DP5B0E81 DP48DP0;0E89DPUB2E89DP4020T0206W2JL9Y`T12:L02P48Y`RW2:L8Y`4:200?0@0800P0200800P0 200800814`010@40000E00030@0000l00P404@P0200800P0200800P0200100T800/12:L8Y`RW2:L8 0@08Y`090@VW2JL9Y`T100L900`1DPUB2E89DPUB2@48DP8100mB0E81DP5B0E81DP5B0E807`404581 DP5B0E81DP5B0E81DP49DP0;0@UB2E89DPUB2@4020T02049Y`VW2JL12:L02`6W2:L8Y`RW2:L100T8 0141200800P0200800P0200800020A400@4100005@000`40000=008101<0200800P0200800P02008 00P100T800/1Y`RW2:L8Y`RW0@08Y`0:0JL9Y`VW2JL90@L900/1DPUB2E89DPUB0@09DP8100mB0E81 DP5B0E81DP5B0E806`404E81DP5B0E81DP5B0E81DP5B00812E802`5B2E89DPUB2E8100P900T1Y`VW 2JL9Y`402:L02P6W2:L8Y`RW204:200B0@P0200800P0200800P020080P4?00410@0001D000<10000 2P030@0D200800P0200800P0200800P0204:200:0@RW2:L8Y`RW0@RW00/1Y`VW2JL9Y`VW0@072@0; 0@UB2E89DPUB2@402E80505B0E81DP5B0E81DP5B0E81DP5B5`404E81DP5B0E81DP5B0E81DP5B0081 2E802`5B2E89DPUB2E8100P900X1Y`VW2JL9Y`T12:L02P48Y`RW2:L8Y`4:200D0@0800P0200800P0 200800P020030@`00@4100005@000`400008008101L800P0200800P0200800P0200800P00@09200; 0@RW2:L8Y`RW20402:L02`49Y`VW2JL9Y`T100L900`1DPUB2E89DPUB2@49DP0F0E81DP5B0E81DP5B 0E81DP5B0E81DQ4101IB0E81DP5B0E81DP5B0E81DP5B0E812E802`49DPUB2E89DPT100P900X12JL9 Y`VW2JL12:L02`6W2:L8Y`RW2:L100X801H100P0200800P0200800P0200800P00P4:00410@0001D0 00<100001P020@0H00P0200800P0200800P0200800P020012PP02`6W2:L8Y`RW2:L100RW00/1Y`VW 2JL9Y`VW0@072@0<0@UB2E89DPUB2E812E820@0GDP5B0E81DP5B0E81DP5B0E81DP5B0E802`406581 DP5B0E81DP5B0E81DP5B0E81DP5B0@YB00/1DPUB2E89DPUB0@082@0:0JL9Y`VW2JL90@RW00/12:L8 Y`RW2:L80@0:200H0@P0200800P0200800P0200800P020080P4800410@0001D000<1000010020@0J 200800P0200800P0200800P0200800P0204:200;0@RW2:L8Y`RW20402:L02`49Y`VW2JL9Y`T100L9 00`1DPUB2E89DPUB2@4:DP8101MB0E81DP5B0E81DP5B0E81DP5B0E81DP090@0GDP5B0E81DP5B0E81 DP5B0E81DP5B0E800P49DP0<0E89DPUB2E89DPT120T02P49Y`VW2JL9Y`48Y`0;0JL8Y`RW2:L8Y`40 2`P06@4800P0200800P0200800P0200800P020000P4600410@0001D000<100000P020@0K00P02008 00P0200800P0200800P0200800P100X800`12:L8Y`RW2:L8Y`48Y`0;0JL9Y`VW2JL9Y`401`T03@49 DPUB2E89DPUB2@402E80705B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E830@0IDP5B0E81DP5B0E81 DP5B0E81DP5B0E81DP020@YB00`12E89DPUB2E89DP482@0:0JL9Y`VW2JL90@RW00`12:L8Y`RW2:L8 Y`4:200K0@0800P0200800P0200800P0200800P02008008110010@40000E00030@00008001d800P0 200800P0200800P0200800P0200800P00@0:200<0JL8Y`RW2:L8Y`P12:L02`49Y`VW2JL9Y`T100P9 00`12E89DPUB2E89DP4:DP0i0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B 0E81DP5B0E81DP5B0E8100YB00`1DPUB2E89DPUB2@482@0:0@VW2JL9Y`VW0@VW00/12:L8Y`RW2:L8 0@0;200K0@0800P0200800P0200800P0200800P0200800D00@4100005@000`400003000K200800P0 200800P0200800P0200800P0200100/800/12:L8Y`RW2:L80@09Y`0;0JL9Y`VW2JL9Y`4020T0305B 2E89DPUB2E890@YB0P40=U81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0@]B00/12E89DPUB2E890@092@0:0JL9Y`VW2JL90@VW00/1Y`RW2:L8Y`RW0@0;200J 0@P0200800P0200800P0200800P0200800P600410@0001D00P43000L200800P0200800P0200800P0 200800P020080@X800`12:L8Y`RW2:L8Y`49Y`0;0@VW2JL9Y`VW2@4020T03@49DPUB2E89DPUB2@40 2U820@0cDP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0081 2U803049DPUB2E89DPUB0@T900X12JL9Y`VW2JL12JL03048Y`RW2:L8Y`RW0@/801X1200800P02008 00P0200800P0200800P020@00P4100005@000`400003000H200800P0200800P0200800P0200800P0 0P4;200<0JL8Y`RW2:L8Y`P12JL02`6W2JL9Y`VW2JL100P900d1DPUB2E89DPUB2E8100YB03@1DP5B 0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0P4;DP0<0E89DPUB 2E89DPT12@T02P6W2JL9Y`VW2@49Y`0<0JL8Y`RW2:L8Y`P12`P06@40200800P0200800P0200800P0 200800P01P010@40000E00030@00008001L800P0200800P0200800P0200800P020020@`800`1Y`RW 2:L8Y`RW204:Y`0;0@VW2JL9Y`VW2@402@T0305B2E89DPUB2E890@]B0`40;E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP030@aB00`1DPUB2E89DPUB2@4:2@0:0@VW2JL9 Y`VW0@ZW00`1Y`RW2:L8Y`RW204;208101L800P0200800P0200800P0200800P0200500410@0001D0 00<100000`0050P0200800P0200800P0200800P00P4>200<0@RW2:L8Y`RW2:L12ZL02`6W2JL9Y`VW 2JL100T900d12E89DPUB2E89DPT100aB0P40:e81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E800P4>DP0<0@UB2E89DPUB2E812PT02P6W2JL9Y`VW2@4:Y`0<0@RW2:L8Y`RW2:L1 3@P20@0D00P0200800P0200800P0200800P600410@0001D000<100000P004`P0200800P0200800P0 200800P00P4?200<0@RW2:L8Y`RW2:L12ZL03@6W2JL9Y`VW2JL9Y`402@T03049DPUB2E89DPUB0@iB 0`409E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E800`4?DP0<0@UB2E89DPUB2E81 2PT0306W2JL9Y`VW2JL90@ZW00`12:L8Y`RW2:L8Y`4>208101<800P0200800P0200800P0200800D0 0@4100005@000`400003000@200800P0200800P0200800813`P20@0;2:L8Y`RW2:L8Y`402jL03@49 Y`VW2JL9Y`VW2@402PT02`49DPUB2E89DPUB00813U840@0QDP5B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B00813e820@0;2E89DPUB2E89DP402`T03049Y`VW2JL9Y`VW0@^W00/12:L8Y`RW2:L8 Y`020@h80`403`P0200800P0200800P0200600410@0001D000<100000P003@P0200800P0200800P0 104@200=0JL8Y`RW2:L8Y`RW0@00E89DPUB2E89DPUB 2E820AMB1@400e810@030AIB0P403PUB2E89DPUB2E89DPT13@T03P6W2JL9Y`VW2JL9Y`T13JL03P6W 2:L8Y`RW2:L8Y`RW0P4F20@11P010@40000E00030@0000800P4I200A0JL8Y`RW2:L8Y`RW2:L8Y`40 3JL03`49Y`VW2JL9Y`VW2JL90@0=2@0@0E89DPUB2E89DPUB2E890AYB0`4IDP0A0E89DPUB2E89DPUB 2E89DP403@T03P49Y`VW2JL9Y`VW2JL13ZL0406W2:L8Y`RW2:L8Y`RW204I208110010@40000E0003 0@0000806@P20@0@Y`RW2:L8Y`RW2:L8Y`RW0@jW00l1Y`VW2JL9Y`VW2JL9Y`403@T04049DPUB2E89 DPUB2E89DPT20C9B0P404589DPUB2E89DPUB2E89DP4>2@0>0JL9Y`VW2JL9Y`VW2@4>Y`0@0@RW2:L8 Y`RW2:L8Y`RW208160P500410@0001D00P4301P801812:L8Y`RW2:L8Y`RW2:L8Y`4?Y`0?0@VW2JL9 Y`VW2JL9Y`T100h901812E89DPUB2E89DPUB2E89DP4`DP0B0@UB2E89DPUB2E89DPUB2E813`T03P49 Y`VW2JL9Y`VW2JL13jL04P48Y`RW2:L8Y`RW2:L8Y`RW0AL810020@40000E00030@0000805PP20@0A 2:L8Y`RW2:L8Y`RW2:L8Y`403jL04@49Y`VW2JL9Y`VW2JL9Y`T100h901412E89DPUB2E89DPUB2E89 DP020BaB0P404@UB2E89DPUB2E89DPUB2E8100l901012JL9Y`VW2JL9Y`VW2JL13jL04@48Y`RW2:L8 Y`RW2:L8Y`RW00815@P500410@0001D000<100000P0E200D0JL8Y`RW2:L8Y`RW2:L8Y`RW204?Y`0A 0JL9Y`VW2JL9Y`VW2JL9Y`403PT0505B2E89DPUB2E89DPUB2E89DPT1:U80505B2E89DPUB2E89DPUB 2E89DPT13`T0406W2JL9Y`VW2JL9Y`VW2@4?Y`0D0JL8Y`RW2:L8Y`RW2:L8Y`RW204D20D00@410000 5@000`40000201<80P404jL8Y`RW2:L8Y`RW2:L8Y`RW20404:L04@49Y`VW2JL9Y`VW2JL9Y`T100l9 01<1DPUB2E89DPUB2E89DPUB2E8900819U820@0CDPUB2E89DPUB2E89DPUB2E890@0@2@0@0@VW2JL9 Y`VW2JL9Y`VW0A2W01<1Y`RW2:L8Y`RW2:L8Y`RW2:L800814PP500410@0001D000<100000P0>20D1 01@8Y`RW2:L8Y`RW2:L8Y`RW2:L80A6W0141Y`VW2JL9Y`VW2JL9Y`VW0@0@2@0D0E89DPUB2E89DPUB 2E89DPUB2E850AaB1@4050UB2E89DPUB2E89DPUB2E89DPT14@T0406W2JL9Y`VW2JL9Y`VW2@4AY`0D 0JL8Y`RW2:L8Y`RW2:L8Y`RW2:L50@d81@010@40000E00030@0000801@P90@0H2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`P14ZL04@49Y`VW2JL9Y`VW2JL9Y`T1014901P1DPUB2E89DPUB2E89DPUB2E89DPUB 2E8:0@UB2@4060UB2E89DPUB2E89DPUB2E89DPUB2E890A8901012JL9Y`VW2JL9Y`VW2JL14ZL0606W 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`T110P500410@0001D000<100000P050@0Q2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L1016W01<12JL9Y`VW2JL9Y`VW2JL9Y`T1010902812E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E892@408@UB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB 0@0A2@0B0@VW2JL9Y`VW2JL9Y`VW2JL14JL08@48Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`050@@00@4100005@000`400002000U2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 0@0BY`0C0JL9Y`VW2JL9Y`VW2JL9Y`VW0@0A2@1:0@UB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP4B2@0B0JL9Y`VW2JL9Y`VW 2JL9Y`T14ZL09048Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20D00@4100005@000`40 0002000RY`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20<14ZL04`49Y`VW2JL9Y`VW2JL9 Y`VW2@404@T30@14DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPT30A490P4040VW2JL9Y`VW2JL9Y`VW2JL20A6W0`408JL8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`0500410@0001D000<100000P007PRW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`@14jL20@0C2JL9Y`VW2JL9Y`VW2JL9Y`VW2@020A891040?0UB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP@14PT20@0D Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T20A:W10407@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L800D0 0@4100005@000`400002000IY`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`050AFW0P405jL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW008150T50@0b2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E850A@90P4060VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`815:L50@0H2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW1@010@40000E00030@00008001D8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P0 104HY`8101/9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T00P4G2@@102YB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPT40AL90P407:L9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`T20ANW10405:L8Y`RW2:L8Y`RW2:L8Y`RW2:L81@010@40000E00030@00008000VW2:L8Y`RW2:L0 304JY`8101nW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW00816@T<0@0B2E89DPUB2E89DPUB 2E89DPUB304I2@810209Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`816JL;0@09Y`RW2:L8 Y`RW00D00@4100005@020@<02@4TY`8102@9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2@4T2A8190T09P6W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T18jL:0@<00P410000 5@000`40000202^W0P409ZL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90P5F2@81 02JW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@81:ZL500410@0001D000<10000 0P0YY`8102X9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL20E890P40:PVW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`81::L500410@0001D000<10000 0P0WY`8102jW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90P5>2@81 02jW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90P4VY`D00@410000 5@000`40000202FW0P400A893P40DZL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T=0@VW1@010@40000E00030@0000802@40KPVW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW4P40K@VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T02P4400410@0001D000<10000 0P00o`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2@0500410@0001D000<100000P00ojL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`050041 0@0001D000<100000P00o`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@0500410@0000d0104400030@0000800?nW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL01@010@40000=00030@0000D00P43003o2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL900@00P410000 3P000`40000400030@000?l01`010@40000?00030@0000<000<10000o`0700410@00010000<10000 0P000`40000200030@0003d000<10000?@000`40000l00030@0003d000<100000P010@40000=0004 0@000@@000<100000P000`40000:00030@0000T000<100002P000`40000:00030@0000X000<10000 2P000`40000900030@0000X000<100002P000`40000:00030@0000T000<100002P000`40000:0003 0@0000X000<100002@000`40000:00030@0000X000<100002P000`40000:00030@0000T000<10000 0P010@40000>00811@3o0@/10@000?l08@000?l08@000?l08@000?l08@000001\ \>"], ImageRangeCache->{{{0, 287}, {287, 0}} -> {-0.207, -0.172242, 0.00783272, 0.00783272}}], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] ContourGraphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ContourPlot[v, {x, 0, 2}, \ {y, 0, 2}]\)], "Input"], Cell[GraphicsData["PostScript", "\<\ %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart /Mabs { Mgmatrix idtransform Mtmatrix dtransform } bind def /Mabsadd { Mabs 3 -1 roll add 3 1 roll add exch } bind def %% ContourGraphics %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10 scalefont setfont % Scaling calculations 0.0192308 0.480769 0.0192308 0.480769 [ [.01923 -0.0125 -3 -9 ] [.01923 -0.0125 3 0 ] [.25962 -0.0125 -9 -9 ] [.25962 -0.0125 9 0 ] [.5 -0.0125 -3 -9 ] [.5 -0.0125 3 0 ] [.74038 -0.0125 -9 -9 ] [.74038 -0.0125 9 0 ] [.98077 -0.0125 -3 -9 ] [.98077 -0.0125 3 0 ] [ 0 0 -0.125 0 ] [-0.0125 .01923 -6 -4.5 ] [-0.0125 .01923 0 4.5 ] [-0.0125 .25962 -18 -4.5 ] [-0.0125 .25962 0 4.5 ] [-0.0125 .5 -6 -4.5 ] [-0.0125 .5 0 4.5 ] [-0.0125 .74038 -18 -4.5 ] [-0.0125 .74038 0 4.5 ] [-0.0125 .98077 -6 -4.5 ] [-0.0125 .98077 0 4.5 ] [ 0 0 -0.125 0 ] [ 0 1 .125 0 ] [ 1 0 .125 0 ] [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath 0 g .25 Mabswid .01923 0 m .01923 .00625 L s [(0)] .01923 -0.0125 0 1 Mshowa .25962 0 m .25962 .00625 L s [(0.5)] .25962 -0.0125 0 1 Mshowa .5 0 m .5 .00625 L s [(1)] .5 -0.0125 0 1 Mshowa .74038 0 m .74038 .00625 L s [(1.5)] .74038 -0.0125 0 1 Mshowa .98077 0 m .98077 .00625 L s [(2)] .98077 -0.0125 0 1 Mshowa .125 Mabswid .06731 0 m .06731 .00375 L s .11538 0 m .11538 .00375 L s .16346 0 m .16346 .00375 L s .21154 0 m .21154 .00375 L s .30769 0 m .30769 .00375 L s .35577 0 m .35577 .00375 L s .40385 0 m .40385 .00375 L s .45192 0 m .45192 .00375 L s .54808 0 m .54808 .00375 L s .59615 0 m .59615 .00375 L s .64423 0 m .64423 .00375 L s .69231 0 m .69231 .00375 L s .78846 0 m .78846 .00375 L s .83654 0 m .83654 .00375 L s .88462 0 m .88462 .00375 L s .93269 0 m .93269 .00375 L s .25 Mabswid 0 0 m 1 0 L s 0 .01923 m .00625 .01923 L s [(0)] -0.0125 .01923 1 0 Mshowa 0 .25962 m .00625 .25962 L s [(0.5)] -0.0125 .25962 1 0 Mshowa 0 .5 m .00625 .5 L s [(1)] -0.0125 .5 1 0 Mshowa 0 .74038 m .00625 .74038 L s [(1.5)] -0.0125 .74038 1 0 Mshowa 0 .98077 m .00625 .98077 L s [(2)] -0.0125 .98077 1 0 Mshowa .125 Mabswid 0 .06731 m .00375 .06731 L s 0 .11538 m .00375 .11538 L s 0 .16346 m .00375 .16346 L s 0 .21154 m .00375 .21154 L s 0 .30769 m .00375 .30769 L s 0 .35577 m .00375 .35577 L s 0 .40385 m .00375 .40385 L s 0 .45192 m .00375 .45192 L s 0 .54808 m .00375 .54808 L s 0 .59615 m .00375 .59615 L s 0 .64423 m .00375 .64423 L s 0 .69231 m .00375 .69231 L s 0 .78846 m .00375 .78846 L s 0 .83654 m .00375 .83654 L s 0 .88462 m .00375 .88462 L s 0 .93269 m .00375 .93269 L s .25 Mabswid 0 0 m 0 1 L s .01923 .99375 m .01923 1 L s .25962 .99375 m .25962 1 L s .5 .99375 m .5 1 L s .74038 .99375 m .74038 1 L s .98077 .99375 m .98077 1 L s .125 Mabswid .06731 .99625 m .06731 1 L s .11538 .99625 m .11538 1 L s .16346 .99625 m .16346 1 L s .21154 .99625 m .21154 1 L s .30769 .99625 m .30769 1 L s .35577 .99625 m .35577 1 L s .40385 .99625 m .40385 1 L s .45192 .99625 m .45192 1 L s .54808 .99625 m .54808 1 L s .59615 .99625 m .59615 1 L s .64423 .99625 m .64423 1 L s .69231 .99625 m .69231 1 L s .78846 .99625 m .78846 1 L s .83654 .99625 m .83654 1 L s .88462 .99625 m .88462 1 L s .93269 .99625 m .93269 1 L s .25 Mabswid 0 1 m 1 1 L s .99375 .01923 m 1 .01923 L s .99375 .25962 m 1 .25962 L s .99375 .5 m 1 .5 L s .99375 .74038 m 1 .74038 L s .99375 .98077 m 1 .98077 L s .125 Mabswid .99625 .06731 m 1 .06731 L s .99625 .11538 m 1 .11538 L s .99625 .16346 m 1 .16346 L s .99625 .21154 m 1 .21154 L s .99625 .30769 m 1 .30769 L s .99625 .35577 m 1 .35577 L s .99625 .40385 m 1 .40385 L s .99625 .45192 m 1 .45192 L s .99625 .54808 m 1 .54808 L s .99625 .59615 m 1 .59615 L s .99625 .64423 m 1 .64423 L s .99625 .69231 m 1 .69231 L s .99625 .78846 m 1 .78846 L s .99625 .83654 m 1 .83654 L s .99625 .88462 m 1 .88462 L s .99625 .93269 m 1 .93269 L s .25 Mabswid 1 0 m 1 1 L s 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath .5 g .01923 .98077 m .98077 .98077 L .98077 .01923 L .01923 .01923 L F 0 g .5 Mabswid .6 g .48596 .01923 m .4844 .08791 L .47739 .15659 L .43403 .22527 L .43132 .22654 L .36264 .24138 L .29396 .24501 L .22527 .24501 L .15659 .24138 L .08791 .22654 L .0857 .22527 L .04742 .15659 L .03964 .08791 L .03781 .01923 L F 0 g .48596 .01923 m .4844 .08791 L .47739 .15659 L .43403 .22527 L .43132 .22654 L .36264 .24138 L .29396 .24501 L .22527 .24501 L .15659 .24138 L .08791 .22654 L .0857 .22527 L .04742 .15659 L .03964 .08791 L .03781 .01923 L s .4 g .08791 .29269 m .15659 .27785 L .22527 .27422 L .29396 .27422 L .36264 .27785 L .43132 .29269 L .43403 .29396 L .47739 .36264 L .4844 .43132 L .48596 .5 L .4844 .56868 L .47739 .63736 L .43403 .70604 L .43132 .70731 L .36264 .72215 L .29396 .72578 L .22527 .72578 L .15659 .72215 L .08791 .70731 L .0857 .70604 L .04742 .63736 L .03964 .56868 L .03781 .5 L .03964 .43132 L .04742 .36264 L .0857 .29396 L F 0 g .08791 .29269 m .15659 .27785 L .22527 .27422 L .29396 .27422 L .36264 .27785 L .43132 .29269 L .43403 .29396 L .47739 .36264 L .4844 .43132 L .48596 .5 L .4844 .56868 L .47739 .63736 L .43403 .70604 L .43132 .70731 L .36264 .72215 L .29396 .72578 L .22527 .72578 L .15659 .72215 L .08791 .70731 L .0857 .70604 L .04742 .63736 L .03964 .56868 L .03781 .5 L .03964 .43132 L .04742 .36264 L .0857 .29396 L .08791 .29269 L s .6 g .48596 .98077 m .4844 .91209 L .47739 .84341 L .43403 .77473 L .43132 .77346 L .36264 .75862 L .29396 .75499 L .22527 .75499 L .15659 .75862 L .08791 .77346 L .0857 .77473 L .04742 .84341 L .03964 .91209 L .03781 .98077 L F 0 g .48596 .98077 m .4844 .91209 L .47739 .84341 L .43403 .77473 L .43132 .77346 L .36264 .75862 L .29396 .75499 L .22527 .75499 L .15659 .75862 L .08791 .77346 L .0857 .77473 L .04742 .84341 L .03964 .91209 L .03781 .98077 L s .7 g .45707 .01923 m .45212 .08791 L .43132 .15521 L .42933 .15659 L .36264 .20465 L .29396 .21567 L .22527 .21567 L .15659 .20465 L .08991 .15659 L .08791 .15521 L .07087 .08791 L .06667 .01923 L F 0 g .45707 .01923 m .45212 .08791 L .43132 .15521 L .42933 .15659 L .36264 .20465 L .29396 .21567 L .22527 .21567 L .15659 .20465 L .08991 .15659 L .08791 .15521 L .07087 .08791 L .06667 .01923 L s .3 g .15659 .31458 m .22527 .30356 L .29396 .30356 L .36264 .31458 L .42933 .36264 L .43132 .36402 L .45212 .43132 L .45707 .5 L .45212 .56868 L .43132 .63598 L .42933 .63736 L .36264 .68542 L .29396 .69644 L .22527 .69644 L .15659 .68542 L .08991 .63736 L .08791 .63598 L .07087 .56868 L .06667 .5 L .07087 .43132 L .08791 .36402 L .08991 .36264 L F 0 g .15659 .31458 m .22527 .30356 L .29396 .30356 L .36264 .31458 L .42933 .36264 L .43132 .36402 L .45212 .43132 L .45707 .5 L .45212 .56868 L .43132 .63598 L .42933 .63736 L .36264 .68542 L .29396 .69644 L .22527 .69644 L .15659 .68542 L .08991 .63736 L .08791 .63598 L .07087 .56868 L .06667 .5 L .07087 .43132 L .08791 .36402 L .08991 .36264 L .15659 .31458 L s .7 g .45707 .98077 m .45212 .91209 L .43132 .84479 L .42933 .84341 L .36264 .79535 L .29396 .78433 L .22527 .78433 L .15659 .79535 L .08991 .84341 L .08791 .84479 L .07087 .91209 L .06667 .98077 L F 0 g .45707 .98077 m .45212 .91209 L .43132 .84479 L .42933 .84341 L .36264 .79535 L .29396 .78433 L .22527 .78433 L .15659 .79535 L .08991 .84341 L .08791 .84479 L .07087 .91209 L .06667 .98077 L s .8 g .42676 .01923 m .41893 .08791 L .37227 .15659 L .36264 .16237 L .29396 .18453 L .22527 .18453 L .15659 .16237 L .14696 .15659 L .1003 .08791 L .09247 .01923 L F 0 g .42676 .01923 m .41893 .08791 L .37227 .15659 L .36264 .16237 L .29396 .18453 L .22527 .18453 L .15659 .16237 L .14696 .15659 L .1003 .08791 L .09247 .01923 L s .2 g .15659 .35686 m .22527 .3347 L .29396 .3347 L .36264 .35686 L .37227 .36264 L .41893 .43132 L .42676 .5 L .41893 .56868 L .37227 .63736 L .36264 .64314 L .29396 .6653 L .22527 .6653 L .15659 .64314 L .14696 .63736 L .1003 .56868 L .09247 .5 L .1003 .43132 L .14696 .36264 L F 0 g .15659 .35686 m .22527 .3347 L .29396 .3347 L .36264 .35686 L .37227 .36264 L .41893 .43132 L .42676 .5 L .41893 .56868 L .37227 .63736 L .36264 .64314 L .29396 .6653 L .22527 .6653 L .15659 .64314 L .14696 .63736 L .1003 .56868 L .09247 .5 L .1003 .43132 L .14696 .36264 L .15659 .35686 L s .8 g .42676 .98077 m .41893 .91209 L .37227 .84341 L .36264 .83763 L .29396 .81547 L .22527 .81547 L .15659 .83763 L .14696 .84341 L .1003 .91209 L .09247 .98077 L F 0 g .42676 .98077 m .41893 .91209 L .37227 .84341 L .36264 .83763 L .29396 .81547 L .22527 .81547 L .15659 .83763 L .14696 .84341 L .1003 .91209 L .09247 .98077 L s .9 g .39439 .01923 m .37815 .08791 L .36264 .11825 L .29396 .15309 L .22527 .15309 L .15659 .11825 L .14108 .08791 L .12484 .01923 L F 0 g .39439 .01923 m .37815 .08791 L .36264 .11825 L .29396 .15309 L .22527 .15309 L .15659 .11825 L .14108 .08791 L .12484 .01923 L s .1 g .15659 .40098 m .22527 .36614 L .29396 .36614 L .36264 .40098 L .37815 .43132 L .39439 .5 L .37815 .56868 L .36264 .59902 L .29396 .63386 L .22527 .63386 L .15659 .59902 L .14108 .56868 L .12484 .5 L .14108 .43132 L F 0 g .15659 .40098 m .22527 .36614 L .29396 .36614 L .36264 .40098 L .37815 .43132 L .39439 .5 L .37815 .56868 L .36264 .59902 L .29396 .63386 L .22527 .63386 L .15659 .59902 L .14108 .56868 L .12484 .5 L .14108 .43132 L .15659 .40098 L s .9 g .39439 .98077 m .37815 .91209 L .36264 .88175 L .29396 .84691 L .22527 .84691 L .15659 .88175 L .14108 .91209 L .12484 .98077 L F 0 g .39439 .98077 m .37815 .91209 L .36264 .88175 L .29396 .84691 L .22527 .84691 L .15659 .88175 L .14108 .91209 L .12484 .98077 L s 1 g .34792 .01923 m .31706 .08791 L .29396 .10805 L .22527 .10805 L .20217 .08791 L .17131 .01923 L F 0 g .34792 .01923 m .31706 .08791 L .29396 .10805 L .22527 .10805 L .20217 .08791 L .17131 .01923 L s .22527 .41118 m .29396 .41118 L .31706 .43132 L .34792 .5 L .31706 .56868 L .29396 .58882 L .22527 .58882 L .20217 .56868 L .17131 .5 L .20217 .43132 L F .22527 .41118 m .29396 .41118 L .31706 .43132 L .34792 .5 L .31706 .56868 L .29396 .58882 L .22527 .58882 L .20217 .56868 L .17131 .5 L .20217 .43132 L .22527 .41118 L s 1 g .34792 .98077 m .31706 .91209 L .29396 .89195 L .22527 .89195 L .20217 .91209 L .17131 .98077 L F 0 g .34792 .98077 m .31706 .91209 L .29396 .89195 L .22527 .89195 L .20217 .91209 L .17131 .98077 L s .4 g .96219 .01923 m .96036 .08791 L .95258 .15659 L .9143 .22527 L .91209 .22654 L .84341 .24138 L .77473 .24501 L .70604 .24501 L .63736 .24138 L .56868 .22654 L .56597 .22527 L .52261 .15659 L .5156 .08791 L .51404 .01923 L F 0 g .96219 .01923 m .96036 .08791 L .95258 .15659 L .9143 .22527 L .91209 .22654 L .84341 .24138 L .77473 .24501 L .70604 .24501 L .63736 .24138 L .56868 .22654 L .56597 .22527 L .52261 .15659 L .5156 .08791 L .51404 .01923 L s .6 g .56868 .29269 m .63736 .27785 L .70604 .27422 L .77473 .27422 L .84341 .27785 L .91209 .29269 L .9143 .29396 L .95258 .36264 L .96036 .43132 L .96219 .5 L .96036 .56868 L .95258 .63736 L .9143 .70604 L .91209 .70731 L .84341 .72215 L .77473 .72578 L .70604 .72578 L .63736 .72215 L .56868 .70731 L .56597 .70604 L .52261 .63736 L .5156 .56868 L .51404 .5 L .5156 .43132 L .52261 .36264 L .56597 .29396 L F 0 g .56868 .29269 m .63736 .27785 L .70604 .27422 L .77473 .27422 L .84341 .27785 L .91209 .29269 L .9143 .29396 L .95258 .36264 L .96036 .43132 L .96219 .5 L .96036 .56868 L .95258 .63736 L .9143 .70604 L .91209 .70731 L .84341 .72215 L .77473 .72578 L .70604 .72578 L .63736 .72215 L .56868 .70731 L .56597 .70604 L .52261 .63736 L .5156 .56868 L .51404 .5 L .5156 .43132 L .52261 .36264 L .56597 .29396 L .56868 .29269 L s .4 g .96219 .98077 m .96036 .91209 L .95258 .84341 L .9143 .77473 L .91209 .77346 L .84341 .75862 L .77473 .75499 L .70604 .75499 L .63736 .75862 L .56868 .77346 L .56597 .77473 L .52261 .84341 L .5156 .91209 L .51404 .98077 L F 0 g .96219 .98077 m .96036 .91209 L .95258 .84341 L .9143 .77473 L .91209 .77346 L .84341 .75862 L .77473 .75499 L .70604 .75499 L .63736 .75862 L .56868 .77346 L .56597 .77473 L .52261 .84341 L .5156 .91209 L .51404 .98077 L s .3 g .93333 .01923 m .92913 .08791 L .91209 .15521 L .91009 .15659 L .84341 .20465 L .77473 .21567 L .70604 .21567 L .63736 .20465 L .57067 .15659 L .56868 .15521 L .54788 .08791 L .54293 .01923 L F 0 g .93333 .01923 m .92913 .08791 L .91209 .15521 L .91009 .15659 L .84341 .20465 L .77473 .21567 L .70604 .21567 L .63736 .20465 L .57067 .15659 L .56868 .15521 L .54788 .08791 L .54293 .01923 L s .7 g .63736 .31458 m .70604 .30356 L .77473 .30356 L .84341 .31458 L .91009 .36264 L .91209 .36402 L .92913 .43132 L .93333 .5 L .92913 .56868 L .91209 .63598 L .91009 .63736 L .84341 .68542 L .77473 .69644 L .70604 .69644 L .63736 .68542 L .57067 .63736 L .56868 .63598 L .54788 .56868 L .54293 .5 L .54788 .43132 L .56868 .36402 L .57067 .36264 L F 0 g .63736 .31458 m .70604 .30356 L .77473 .30356 L .84341 .31458 L .91009 .36264 L .91209 .36402 L .92913 .43132 L .93333 .5 L .92913 .56868 L .91209 .63598 L .91009 .63736 L .84341 .68542 L .77473 .69644 L .70604 .69644 L .63736 .68542 L .57067 .63736 L .56868 .63598 L .54788 .56868 L .54293 .5 L .54788 .43132 L .56868 .36402 L .57067 .36264 L .63736 .31458 L s .3 g .93333 .98077 m .92913 .91209 L .91209 .84479 L .91009 .84341 L .84341 .79535 L .77473 .78433 L .70604 .78433 L .63736 .79535 L .57067 .84341 L .56868 .84479 L .54788 .91209 L .54293 .98077 L F 0 g .93333 .98077 m .92913 .91209 L .91209 .84479 L .91009 .84341 L .84341 .79535 L .77473 .78433 L .70604 .78433 L .63736 .79535 L .57067 .84341 L .56868 .84479 L .54788 .91209 L .54293 .98077 L s .2 g .90753 .01923 m .8997 .08791 L .85304 .15659 L .84341 .16237 L .77473 .18453 L .70604 .18453 L .63736 .16237 L .62773 .15659 L .58107 .08791 L .57324 .01923 L F 0 g .90753 .01923 m .8997 .08791 L .85304 .15659 L .84341 .16237 L .77473 .18453 L .70604 .18453 L .63736 .16237 L .62773 .15659 L .58107 .08791 L .57324 .01923 L s .8 g .63736 .35686 m .70604 .3347 L .77473 .3347 L .84341 .35686 L .85304 .36264 L .8997 .43132 L .90753 .5 L .8997 .56868 L .85304 .63736 L .84341 .64314 L .77473 .6653 L .70604 .6653 L .63736 .64314 L .62773 .63736 L .58107 .56868 L .57324 .5 L .58107 .43132 L .62773 .36264 L F 0 g .63736 .35686 m .70604 .3347 L .77473 .3347 L .84341 .35686 L .85304 .36264 L .8997 .43132 L .90753 .5 L .8997 .56868 L .85304 .63736 L .84341 .64314 L .77473 .6653 L .70604 .6653 L .63736 .64314 L .62773 .63736 L .58107 .56868 L .57324 .5 L .58107 .43132 L .62773 .36264 L .63736 .35686 L s .2 g .90753 .98077 m .8997 .91209 L .85304 .84341 L .84341 .83763 L .77473 .81547 L .70604 .81547 L .63736 .83763 L .62773 .84341 L .58107 .91209 L .57324 .98077 L F 0 g .90753 .98077 m .8997 .91209 L .85304 .84341 L .84341 .83763 L .77473 .81547 L .70604 .81547 L .63736 .83763 L .62773 .84341 L .58107 .91209 L .57324 .98077 L s .1 g .87516 .01923 m .85892 .08791 L .84341 .11825 L .77473 .15309 L .70604 .15309 L .63736 .11825 L .62185 .08791 L .60561 .01923 L F 0 g .87516 .01923 m .85892 .08791 L .84341 .11825 L .77473 .15309 L .70604 .15309 L .63736 .11825 L .62185 .08791 L .60561 .01923 L s .9 g .63736 .40098 m .70604 .36614 L .77473 .36614 L .84341 .40098 L .85892 .43132 L .87516 .5 L .85892 .56868 L .84341 .59902 L .77473 .63386 L .70604 .63386 L .63736 .59902 L .62185 .56868 L .60561 .5 L .62185 .43132 L F 0 g .63736 .40098 m .70604 .36614 L .77473 .36614 L .84341 .40098 L .85892 .43132 L .87516 .5 L .85892 .56868 L .84341 .59902 L .77473 .63386 L .70604 .63386 L .63736 .59902 L .62185 .56868 L .60561 .5 L .62185 .43132 L .63736 .40098 L s .1 g .87516 .98077 m .85892 .91209 L .84341 .88175 L .77473 .84691 L .70604 .84691 L .63736 .88175 L .62185 .91209 L .60561 .98077 L F 0 g .87516 .98077 m .85892 .91209 L .84341 .88175 L .77473 .84691 L .70604 .84691 L .63736 .88175 L .62185 .91209 L .60561 .98077 L s .82869 .01923 m .79783 .08791 L .77473 .10805 L .70604 .10805 L .68294 .08791 L .65208 .01923 L F .82869 .01923 m .79783 .08791 L .77473 .10805 L .70604 .10805 L .68294 .08791 L .65208 .01923 L s 1 g .70604 .41118 m .77473 .41118 L .79783 .43132 L .82869 .5 L .79783 .56868 L .77473 .58882 L .70604 .58882 L .68294 .56868 L .65208 .5 L .68294 .43132 L F 0 g .70604 .41118 m .77473 .41118 L .79783 .43132 L .82869 .5 L .79783 .56868 L .77473 .58882 L .70604 .58882 L .68294 .56868 L .65208 .5 L .68294 .43132 L .70604 .41118 L s .82869 .98077 m .79783 .91209 L .77473 .89195 L .70604 .89195 L .68294 .91209 L .65208 .98077 L F .82869 .98077 m .79783 .91209 L .77473 .89195 L .70604 .89195 L .68294 .91209 L .65208 .98077 L s % End of Graphics MathPictureEnd \ \>"], "Graphics", ImageSize->{288, 288}, ImageMargins->{{43, 0}, {0, 0}}, ImageRegion->{{0, 1}, {0, 1}}, ImageCache->GraphicsData["Bitmap", "\<\ CF5dJ6E]HGAYHf4PAg9QL6QYHgon6Ykno_hn?S`2ook>c/mWIfGmoOol005E[;lC4a000<`00IP00V@00c000 o`0c000c<`0cIP0cV@0cc00co`1V001V<`1VIP1VV@1Vc01Vo`2I002I<`2IIP2IV@2Ic02Io`3<003< <`3I03>IIIS>IVC>Ic3>Ioc?<03?<@000`40000f00030@0000L00`4i0003 0@0000@0000H00040@000CH000@1000120000`40000i00030@0003H000<100001`000`40000j0003 0@0000<0000H00040@000CH000@1000120000`40000g00<1=P030@T000<10000=`00104000450000 6@020CP00P4900@1>0000`40000f00030@0000L0104g00811P000?l08@0001D0o`4;0@40000E0003 0@00008000<100002P000`40000900030@0000X000<100002P000`40000:00030@0000X000<10000 2@000`40000:00030@0000X000<100002P000`40000900030@0000X000<100002P000`40000:0003 0@0000T000<100002P000`40000:00030@0000X000<100002P000`40000900030@0000800@410000 5@000`40000200030@0003d000<10000?@000`40000l00030@0003d000<100000P010@40000E0003 0@000?l01`010@40000>00811@000`40003o00L00@4100003@0010400044008120000`4000050003 0@0000<000<100001P000`40000900030@0002`000<100002P000`40000500030@0000D000<10000 1@000`40000400030@0000D000<100001@000`40000600030@0000T000<10000;0000`4000090003 0@0000H000<1000010000`40000400030@0000H00P4100003@001040004400030@00008000JW2JL9 Y`47Y`070@RW2:L80@08200=0@P0200800P020080@0^000>0@0800P0200800P0204720090JL8Y`RW 2:L100NW00P12JL9Y`VW0@L900T12E89DPUB2@4025820@09DP5B0E81DP5B034100aB0E81DP5B0E81 DP48DP080E89DPUB2@462@050@VW2JL01@010@40000=00040@000@@000<100000P001PVW2JL90@NW 00L1Y`RW2:L100P800h100P0200800P020080B`000h100P0200800P020080@P800T12:L8Y`RW2040 1jL0206W2JL9Y`T11`T02@5B2E89DPUB0@08DP0<0E81DP5B0E81DP5B;`402e81DP5B0E81DP5B0081 25802049DPUB2E811PT01@6W2JL900D00@4100003@001040004400030@00008000JW2JL9Y`47Y`07 0@RW2:L80@09200=0@0800P0200800P00@0/000>0@P0200800P02008004820090JL8Y`RW2:L100NW 00P12JL9Y`VW0@L900T12E89DPUB2@402E80305B0E81DP5B0E81DRl100UB0E81DP5B0E800P49DP08 0E89DPUB2@462@050@VW2JL01@010@40000=00040@000@@000<100000P001PVW2JL90@NW00L1Y`RW 2:L100T800h1200800P0200800P00BX000l1200800P0200800P0204020P02@48Y`RW2:L80@07Y`08 0JL9Y`VW2@472@090E89DPUB2E8100UB0P402e81DP5B0E81DP5B02d100aB0E81DP5B0E81DP49DP08 0@UB2E89DP462@050JL9Y`T01@010@40000>00811@000`4000020006Y`VW2JL11jL02048Y`RW2:L1 20P03P40200800P0200800P1:P003`40200800P0200800P00@07200:0@RW2:L8Y`RW0@NW00P12JL9 Y`VW0@L900X12E89DPUB2E812580305B0E81DP5B0E81DRd100]B0E81DP5B0E81DP020@QB00T12E89 DPUB2@401PT01@49Y`VW00D00@4100005@000`40000200062JL9Y`T11jL0206W2:L8Y`P120P03`48 00P0200800P020080@0X000?0@0800P0200800P0200100P800X1Y`RW2:L8Y`P11jL0206W2JL9Y`T1 1`T02P5B2E89DPUB2@48DP8100]B0E81DP5B0E81DP0[0@0>DP5B0E81DP5B0E81DP48DP090E89DPUB 2E8100H900D1Y`VW2@0500410@0001D000<100000P001ZL9Y`VW0@NW00P12:L8Y`RW0@P800l100P0 200800P020080040:0003`4800P0200800P020080@08200:0@RW2:L8Y`RW0@NW00P12JL9Y`VW0@L9 00X12E89DPUB2E8125803P5B0E81DP5B0E81DP5B:`402e81DP5B0E81DP5B008125802@49DPUB2E89 0@062@050@VW2JL01@010@40000E00030@00008000H9Y`VW2@47Y`080JL8Y`RW2049200?0@0800P0 200800P0200102L000l100P0200800P02008004020P02P6W2:L8Y`RW2047Y`080JL9Y`VW2@472@0: 0E89DPUB2E890@UB00`1DP5B0E81DP5B0E8[0@0;DP5B0E81DP5B0E800P49DP090E89DPUB2E8100H9 00D1Y`VW2@0500410@0001D000<100000P001ZL9Y`VW0@NW00P12:L8Y`RW0@T800l1200800P02008 00P020409P004040200800P0200800P02048200:0@RW2:L8Y`RW0@NW00P12JL9Y`VW0@L900X12E89 DPUB2E812E820@0;DP5B0E81DP5B0E80:@403U81DP5B0E81DP5B0E812E802@49DPUB2E890@062@05 0@VW2JL01@010@40000E00030@00008000H9Y`VW2@48Y`070@RW2:L80@09200@0@0800P0200800P0 20080BD000l1200800P0200800P020402@P02@6W2:L8Y`RW0@07Y`0:0@VW2JL9Y`VW0@L900T12E89 DPUB2@402E803P5B0E81DP5B0E81DP5B:@402e81DP5B0E81DP5B00812E80205B2E89DPT11`T01@6W 2JL900D00@4100005@000`4000020006Y`VW2JL12:L01`6W2:L8Y`402@P0404800P0200800P02008 004T000@0@P0200800P0200800P00@T800T12:L8Y`RW20401jL02P6W2JL9Y`VW2@472@090E89DPUB 2E8100UB0P403E81DP5B0E81DP5B0E809`403U81DP5B0E81DP5B0E812E802049DPUB2E811`T01@49 Y`VW00D00@4100005@000`40000200062JL9Y`T12:L01`48Y`RW20402PP0404800P0200800P02008 004S000@0@0800P0200800P020080@T800T1Y`RW2:L8Y`401jL02P49Y`VW2JL9Y`472@090@UB2E89 DPT100YB0P402e81DP5B0E81DP5B02L100iB0E81DP5B0E81DP5B0@YB00P1DPUB2E890@L900D1Y`VW 2@0500410@0001D00P430006Y`VW2JL12:L01`6W2:L8Y`402PP04040200800P0200800P0204S000@ 0@P0200800P0200800P00@T800T12:L8Y`RW20401jL02P6W2JL9Y`VW2@472@090E89DPUB2E8100YB 00h1DP5B0E81DP5B0E81DRL100]B0E81DP5B0E81DP020@YB00P12E89DPUB0@L900D12JL9Y`040081 0@0001D000<100000P001PVW2JL90@RW00L12:L8Y`P100X80141200800P0200800P020080@0Q000@ 0@P0200800P0200800P00@X800T1Y`RW2:L8Y`401jL02P49Y`VW2JL9Y`472@090@UB2E89DPT100YB 0P403E81DP5B0E81DP5B0E809@403U81DP5B0E81DP5B0E812U80205B2E89DPT11`T01@6W2JL900D0 0@4100005@000`4000020006Y`VW2JL12:L0206W2:L8Y`P12@P04@40200800P0200800P020010240 010100P0200800P0200800P12@P02P6W2:L8Y`RW2047Y`0:0JL9Y`VW2JL90@L900X1DPUB2E89DPT1 2E803P5B0E81DP5B0E81DP5B9@403E81DP5B0E81DP5B0E800P49DP090E89DPUB2E8100L900D12JL9 Y`0500410@0001D000<100000P001PVW2JL90@RW00P12:L8Y`RW0@T80181200800P0200800P02008 004O000A0@0800P0200800P0200800402@P02P48Y`RW2:L8Y`47Y`0:0@VW2JL9Y`VW0@L900X12E89 DPUB2E812E820@0=DP5B0E81DP5B0E81DP0S0@0@DP5B0E81DP5B0E81DP5B0@UB00T12E89DPUB2@40 1`T01@6W2JL900D00@4100005@000`4000020006Y`VW2JL12:L0206W2:L8Y`P12PP04@4800P02008 00P0200800P101l00141200800P0200800P020080@09200:0JL8Y`RW2:L80@NW00X1Y`VW2JL9Y`T1 1`T02P5B2E89DPUB2@4:DP8100eB0E81DP5B0E81DP5B02<100iB0E81DP5B0E81DP5B0@YB00T1DPUB 2E89DP401`T01@49Y`VW00D00@4100005@000`40000200062JL9Y`T12:L02048Y`RW2:L12PP04P40 200800P0200800P020080Ad00141200800P0200800P020080@0:200:0@RW2:L8Y`RW0@NW00X12JL9 Y`VW2JL11`T02P49DPUB2E89DP4:DP0@0E81DP5B0E81DP5B0E81DR4100eB0E81DP5B0E81DP5B0081 2U802@49DPUB2E890@072@050JL9Y`T01@010@40000E00030@00008000JW2JL9Y`48Y`080JL8Y`RW 204:200B0@P0200800P0200800P020017@004@40200800P0200800P0200100X800X1Y`RW2:L8Y`P1 1jL02P6W2JL9Y`VW2@472@0:0E89DPUB2E890@YB0P403E81DP5B0E81DP5B0E808@404581DP5B0E81 DP5B0E81DP4:DP090E89DPUB2E8100L900D12JL9Y`0500410@0001D000<100000P001PVW2JL90@RW 00T12:L8Y`RW20402PP04P4800P0200800P0200800P00A/0018100P0200800P0200800P02049200; 0JL8Y`RW2:L8Y`401jL02P49Y`VW2JL9Y`472@0;0@UB2E89DPUB2@402U820@0=DP5B0E81DP5B0E81 DP0O0@0?DP5B0E81DP5B0E81DP5B00812E802P5B2E89DPUB2@472@050JL9Y`T01@010@40000E0003 0@00008000JW2JL9Y`48Y`090JL8Y`RW2:L100X801<100P0200800P0200800P0200101P00P404@08 00P0200800P0200800P100X800X12:L8Y`RW2:L12:L02P6W2JL9Y`VW2@482@0:0@UB2E89DPUB0@YB 0101DP5B0E81DP5B0E81DP5B7@403e81DP5B0E81DP5B0E81DP020@YB00T12E89DPUB2@4020T01@49 Y`VW00D00@4100005@000`40000200062JL9Y`T12JL02@6W2:L8Y`RW0@0:200B0@0800P0200800P0 200800P00P4E000D0@P0200800P0200800P020080049200;0@RW2:L8Y`RW20402:L02P49Y`VW2JL9 Y`482@0;0E89DPUB2E89DP402U80405B0E81DP5B0E81DP5B0E8K0@0BDP5B0E81DP5B0E81DP5B0E81 2E802P49DPUB2E89DP482@050JL9Y`T01@010@40000E00030@00008000JW2JL9Y`49Y`0:0@RW2:L8 Y`RW0@T801D1200800P0200800P0200800P020404`00504800P0200800P0200800P020012@P03048 Y`RW2:L8Y`RW0@RW00X1Y`VW2JL9Y`T120T03049DPUB2E89DPUB0@UB0P404E81DP5B0E81DP5B0E81 DP5B01L1019B0E81DP5B0E81DP5B0E81DP49DP0;0@UB2E89DPUB2@4020T01@49Y`VW00D00@410000 5@000`40000200072JL9Y`VW0@08Y`0;0JL8Y`RW2:L8Y`402@P0504800P0200800P0200800P02008 4`4050P0200800P0200800P0200800P12@P02`6W2:L8Y`RW2:L100VW00/12JL9Y`VW2JL90@082@0< 0@UB2E89DPUB2E812E820@0ADP5B0E81DP5B0E81DP5B0E805@404E81DP5B0E81DP5B0E81DP5B0081 25803049DPUB2E89DPUB0@L900H12JL9Y`T500410@0001D000<100000P001jL9Y`VW2@402:L02`48 Y`RW2:L8Y`P100T803X100P0200800P0200800P0200800P0200800P0200800P0200800P0200800P0 200800P0200800P12@P0306W2:L8Y`RW2:L80@VW00/1Y`VW2JL9Y`VW0@082@0<0E89DPUB2E89DPT1 2E80>05B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B 0P49DP0;0E89DPUB2E89DP4020T01P6W2JL9Y`D00@4100005@020@<000L9Y`VW2JL100VW00/12:L8 Y`RW2:L80@09200i0@0800P0200800P0200800P0200800P0200800P0200800P0200800P0200800P0 200800P0200100P800d1Y`RW2:L8Y`RW2:L100VW00/12JL9Y`VW2JL90@082@0=0@UB2E89DPUB2E89 0@09DP0i0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B 0E8100QB00`1DPUB2E89DPUB2@482@060@VW2JL910020@40000E00030@00008000NW2JL9Y`T100VW 00`1Y`RW2:L8Y`RW2048208103@0200800P0200800P0200800P0200800P0200800P0200800P02008 00P0200800P020080P49200<0@RW2:L8Y`RW2:L12ZL02`6W2JL9Y`VW2JL100T900d12E89DPUB2E89 DPT100QB0P400@UB2E89DPUB2E89 DP4:DP<102]B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B00<12e803@49 DPUB2E89DPUB2@402@T01P6W2JL9Y`D00@4100005@000`40000200072JL9Y`VW0@09Y`0>0@RW2:L8 Y`RW2:L8Y`4<208102P800P0200800P0200800P0200800P0200800P0200800P0200800P00P4=200= 0JL8Y`RW2:L8Y`RW0@0:Y`0<0JL9Y`VW2JL9Y`T12PT03P49DPUB2E89DPUB2E812e820@0YDP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E800P40@UB2E89DPUB2E89DP492@06 0@VW2JL91@010@40000E00030@00008000NW2JL9Y`T100ZW00h12:L8Y`RW2:L8Y`RW0@d80P409008 00P0200800P0200800P0200800P0200800P0200800P020813PP03P6W2:L8Y`RW2:L8Y`P12ZL03049 Y`VW2JL9Y`VW0@X900l1DPUB2E89DPUB2E89DP4035830@0SDP5B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E800`4=DP0?0@UB2E89DPUB2E89DPT100T900H1Y`VW2JL500410@0001D000<10000 0P001`VW2JL9Y`402ZL03P6W2:L8Y`RW2:L8Y`P13`P20@0P200800P0200800P0200800P0200800P0 200800P020020@l800l1Y`RW2:L8Y`RW2:L8Y`402ZL0306W2JL9Y`VW2JL90@X900l12E89DPUB2E89 DPUB2@403U820@0QDP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B00813e803P5B2E89DPUB 2E89DPT12PT01P49Y`VW2@D00@4100005@000`4000020008Y`VW2JL9Y`49Y`0?0@RW2:L8Y`RW2:L8 Y`P101080P40700800P0200800P0200800P0200800P0200800P20A4800h12:L8Y`RW2:L8Y`RW0@^W 00d12JL9Y`VW2JL9Y`T100X900l12E89DPUB2E89DPUB2@403e830@0KDP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B00<145803`5B2E89DPUB2E89DPUB0@092@070@VW2JL9Y`0500410@0001D000<10000 0P0020VW2JL9Y`T12JL0406W2:L8Y`RW2:L8Y`RW204A208101P800P0200800P0200800P0200800P0 20020A8800l12:L8Y`RW2:L8Y`RW20402jL03@6W2JL9Y`VW2JL9Y`402PT0405B2E89DPUB2E89DPUB 2@4@DP8101UB0E81DP5B0E81DP5B0E81DP5B0E81DP5B00814E80405B2E89DPUB2E89DPUB2@492@07 0JL9Y`VW2@0500410@0001D000<100000P002:L9Y`VW2JL12ZL0406W2:L8Y`RW2:L8Y`RW204B2081 01@0200800P0200800P0200800P020814`P04048Y`RW2:L8Y`RW2:L8Y`4;Y`0=0@VW2JL9Y`VW2JL9 0@0:2@0A0@UB2E89DPUB2E89DPUB2@404E830@0CDP5B0E81DP5B0E81DP5B0E81DP030A9B0141DPUB 2E89DPUB2E89DPUB0@092@070@VW2JL9Y`0500410@0001D000<100000P0020VW2JL9Y`T12ZL04048 Y`RW2:L8Y`RW2:L8Y`4D21@15@P03`6W2:L8Y`RW2:L8Y`RW0@0PP20@0?Y`RW2:L8Y`RW2:L8 Y`P100bW00d12JL9Y`VW2JL9Y`T100/90141DPUB2E89DPUB2E89DPUB0@0iDP8100h9DPUB2E89DPUB 2E89DP812PT01`49Y`VW2JL01@010@40000E00030@00008000T9Y`VW2JL9Y`402jL03`48Y`RW2:L8 Y`RW2:L8Y`030C@80`403PRW2:L8Y`RW2:L8Y`RW0P4Y`0?0JL9Y`VW2JL9Y`VW2JL100d901412E89DPUB2E89DPUB2E89DP030BiB0`403`UB2E89DPUB 2E89DPUB2@020@`900P1Y`VW2JL9Y`@00P4100005@000`400002000:2JL9Y`VW2JL90@fW0181Y`RW 2:L8Y`RW2:L8Y`RW2:L30BP80`404`RW2:L8Y`RW2:L8Y`RW2:L8Y`403ZL04@6W2JL9Y`VW2JL9Y`VW 2JL100d901<12E89DPUB2E89DPUB2E89DPUB00<1:5830@0B2E89DPUB2E89DPUB2E89DPT13@T02@6W 2JL9Y`VW2@0500410@0001D000<100000P002ZL9Y`VW2JL9Y`4>Y`0D0JL8Y`RW2:L8Y`RW2:L8Y`RW 2:L40B480`404`RW2:L8Y`RW2:L8Y`RW2:L8Y`P00P4>Y`0B0JL9Y`VW2JL9Y`VW2JL9Y`T13PT20@0C DPUB2E89DPUB2E89DPUB2E89DP030B9B0`4050UB2E89DPUB2E89DPUB2E89DPT13PT02@49Y`VW2JL9 Y`0500410@0001D000<100000P002`VW2JL9Y`VW2JL100jW0P405@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 20030A/80`405PRW2:L8Y`RW2:L8Y`RW2:L8Y`RW204@Y`0C0@VW2JL9Y`VW2JL9Y`VW2JL90@0?2@0F 0E89DPUB2E89DPUB2E89DPUB2E89DP<175830@0D2E89DPUB2E89DPUB2E89DPUB2E820@h900X12JL9 Y`VW2JL91@010@40000E00030@00008000bW2JL9Y`VW2JL9Y`4?Y`0H0@RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L80`4E20<101H8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0P4@Y`0E0@VW2JL9Y`VW2JL9Y`VW2JL9 Y`T100l901P1DPUB2E89DPUB2E89DPUB2E89DPUB2E830AIB0`405`UB2E89DPUB2E89DPUB2E89DPUB 2E81010900X1Y`VW2JL9Y`VW1@010@40000E00030@00008000`9Y`VW2JL9Y`VW2@4@Y`0J0@RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`PE0@0I2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0@0AY`0F0@VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW0A090P4060UB2E89DPUB2E89DPUB2E89DPUB2E89DQH101T9DPUB2E89DPUB 2E89DPUB2E89DPUB2E81010900/1Y`VW2JL9Y`VW2@0500410@0001D000<100000P003JL9Y`VW2JL9 Y`VW2@404:L20@14Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`4BY`0G0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`404@T0A049DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 0P4A2@0;0@VW2JL9Y`VW2JL01@010@40000E00030@00008000h9Y`VW2JL9Y`VW2JL90A6W0441Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 20020A:W01T1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL101490P40@E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPT1018900`12JL9Y`VW2JL9 Y`T500410@0001D000<100000P003ZL9Y`VW2JL9Y`VW2JL14ZL0@06W2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW204CY`0J0JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2@4C2@100E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E890A8900d12JL9Y`VW2JL9Y`VW00D00@4100005@000`400002000? 2JL9Y`VW2JL9Y`VW2JL101:W0P40?0RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L80ABW01/12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@404`T0?05B 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP81 4`T03@6W2JL9Y`VW2JL9Y`T01@010@40000E00030@00008000nW2JL9Y`VW2JL9Y`VW2@405:L0>@48 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`020ABW 01`12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL150T20@0i2E89DPUB2E89DPUB2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E8101@900h1Y`VW2JL9Y`VW2JL9Y`D00@410000 5@000`400002000@2JL9Y`VW2JL9Y`VW2JL90ABW1040<:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20@15JL07P49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0AD9 0`40<@UB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPT0104E2@0> 0@VW2JL9Y`VW2JL9Y`T500410@0001D000<100000P004JL9Y`VW2JL9Y`VW2JL9Y`T101NW1P4090RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`H16JL07`6W2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`405`T60@0UDPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP060AP9 00l12JL9Y`VW2JL9Y`VW2JL01@010@40000E00810`004@VW2JL9Y`VW2JL9Y`VW2JL101fW1P406:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20H17ZL0806W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T1 7@T60@0I2E89DPUB2E89DPUB2E89DPUB2E89DPUB2@060Ah900l1Y`VW2JL9Y`VW2JL9Y`T010020@40 000E00030@00008001:W2JL9Y`VW2JL9Y`VW2JL9Y`4RYaP18jL08P6W2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2@4R2AT18`T0406W2JL9Y`VW2JL9Y`VW2JL500410@0001D000<100000P004PVW 2JL9Y`VW2JL9Y`VW2JL90EfW02812JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL1GPT04049 Y`VW2JL9Y`VW2JL9Y`T500410@0001D000<100000P004jL9Y`VW2JL9Y`VW2JL9Y`VW2@40FjL09049 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0E`901412JL9Y`VW2JL9Y`VW2JL9Y`050041 0@0001D000<100000P004PVW2JL9Y`VW2JL9Y`VW2JL9Y`<1EJL40@0T2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW0`5E2@@10149Y`VW2JL9Y`VW2JL9Y`VW2@0500410@0001D000<10000 0P005JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`060DVW1P40:jL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL01P592@H101FW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL01@010@40000E0003 0@00008001/9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T01P4mY`H103L9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL900H1?@T60@0K2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL900D00@4100005@000`400002000QY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW00d19:L<0@13Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`0<0BD930408JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`0500410@0001D000<100000P00;PVW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JLT0@1K2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@0U0@0]2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL900D00@4100005@000`400002003o Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW00D00@4100005@000`400002003o2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL900D00@410000 0P020@@000<100000P030@D000<100000P00ojL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`0500410@00000500400040 2`000`40000200810`00o`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@0400810@000005004000402`000`4000020003 0@0000800?nW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL01@010@4000001@01000100P00`4500030@0000800?l9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`T01@010@4000001@01000100P000<100001@000`400002003oY`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW00D00@41000000D00@000@0800030@0000D000<100000P00;PVW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JLT0@1K2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2@0U0@0]2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL900D00@410000 0P020@T0104400030@00008002:W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9304T2@`1 04BW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2@/19JL<0@0QY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW00D00@410000 5@000`400002000N2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW104l2@@103`9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL40CbW10407@VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL900D00@4100005@000`400002000IY`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`050D@91@40W 6@4TY`0?0JL9Y`VW2JL9Y`VW2JL900D00@4100005@020@<0016W2JL9Y`VW2JL9Y`VW2JL90@0M2@H1 01P9DPUB2E89DPUB2E89DPUB2E89DPUB2E860Al901l1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL101fW1P406JL8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L01P4NY`0?0@VW2JL9Y`VW2JL9Y`VW00@0 0P4100005@000`400002000@2JL9Y`VW2JL9Y`VW2JL90AP91P409589DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2@H16@T07P49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0ARW1P409@RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P01P4IY`0>0@VW2JL9Y`VW2JL9Y`T50041 0@0001D000<100000P004:L9Y`VW2JL9Y`VW2JL9Y`4D2@@10309DPUB2E89DPUB2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E840AH901d12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 0@0EY`<1036W2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW00@1 5JL03P6W2JL9Y`VW2JL9Y`VW1@010@40000E00030@00008000l9Y`VW2JL9Y`VW2JL9Y`4050T0>@5B 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2@020A@9 01`1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T15:L20@0iY`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P101FW00d1Y`VW2JL9Y`VW2JL900D00@410000 5@000`400002000>Y`VW2JL9Y`VW2JL9Y`4C2@8103aB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP4D2@0J0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2@4DY`0l0@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L80P4CY`0=0@VW2JL9Y`VW2JL9Y`0500410@0001D000<100000P003PVW2JL9Y`VW2JL9Y`T1 4PT0@049DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DP4D2@0I0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@0CY`100@RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0A>W00`12JL9Y`VW2JL9 Y`T500410@0001D000<100000P003JL9Y`VW2JL9Y`VW2@404PT0@@49DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB00814PT06049Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW0A:W0P40@@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L101:W00`1Y`VW2JL9Y`VW2JL500410@0001D000<10000 0P003@VW2JL9Y`VW2JL9Y`4040T20@0G2E89DPUB2E89DPUB2E89DPUB2E89DPT05@4060UB2E89DPUB 2E89DPUB2E89DPUB2E890A8901L12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@0AY`0H0JL8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW5P405PRW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L20A6W00/1Y`VW2JL9Y`VW2@050041 0@0001D000<100000P003:L9Y`VW2JL9Y`VW0A0901L1DPUB2E89DPUB2E89DPUB2E89DPUB2@030AEB 0`405PUB2E89DPUB2E89DPUB2E89DPUB2@4B2@0E0@VW2JL9Y`VW2JL9Y`VW2JL9Y`T1012W0P405JL8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`030AH80`405PRW2:L8Y`RW2:L8Y`RW2:L8Y`RW204@Y`0;0@VW2JL9 Y`VW2JL01@010@40000E00030@00008000/9Y`VW2JL9Y`VW0@0@2@0E0E89DPUB2E89DPUB2E89DPUB 2E8900<16e830@0C2E89DPUB2E89DPUB2E89DPUB2@020A0901@1Y`VW2JL9Y`VW2JL9Y`VW2JL90A2W 01D12:L8Y`RW2:L8Y`RW2:L8Y`RW2:L00`4L20<101@8Y`RW2:L8Y`RW2:L8Y`RW2:L80A2W00X12JL9 Y`VW2JL91@010@40000E00030@00008000^W2JL9Y`VW2JL90@0>2@81015B2E89DPUB2E89DPUB2E89 DP040B5B0`404`UB2E89DPUB2E89DPUB2E89DP4040T04`6W2JL9Y`VW2JL9Y`VW2JL9Y`403jL04`48 Y`RW2:L8Y`RW2:L8Y`RW2:L00`4R20<10148Y`RW2:L8Y`RW2:L8Y`RW20020@jW00X1Y`VW2JL9Y`VW 1@010@40000E00030@00008000X9Y`VW2JL9Y`T13PT04@49DPUB2E89DPUB2E89DPUB00<1:5830@0@ 2E89DPUB2E89DPUB2E89DP813PT04P49Y`VW2JL9Y`VW2JL9Y`VW0@jW0P4040RW2:L8Y`RW2:L8Y`RW 2:L30BP80`404@RW2:L8Y`RW2:L8Y`RW2:L100jW00T1Y`VW2JL9Y`T01@010@40000E00030@000080 00ZW2JL9Y`VW2JL13@T03`49DPUB2E89DPUB2E89DP030BiB0`4040UB2E89DPUB2E89DPUB2@4>2@0A 0@VW2JL9Y`VW2JL9Y`VW2@403JL0406W2:L8Y`RW2:L8Y`RW2:L30Bh80`403`RW2:L8Y`RW2:L8Y`RW 0@0=Y`090@VW2JL9Y`VW00D00@4100005@020@<000T9Y`VW2JL9Y`4030T20@0=2E89DPUB2E89DPUB 2@020CAB0P403e89DPUB2E89DPUB2E890@0>2@0?0@VW2JL9Y`VW2JL9Y`T100fW00l1Y`RW2:L8Y`RW 2:L8Y`P00P4d208100fW2:L8Y`RW2:L8Y`RW00813:L02049Y`VW2JL910020@40000E00030@000080 00VW2JL9Y`VW2@402`T0405B2E89DPUB2E89DPUB2@4hDP8100d9DPUB2E89DPUB2E89008130T03`6W 2JL9Y`VW2JL9Y`VW0@0;Y`8100nW2:L8Y`RW2:L8Y`RW2040>0P0406W2:L8Y`RW2:L8Y`RW204;Y`08 0JL9Y`VW2JL500410@0001D000<100000P0020VW2JL9Y`T12PT20@0?DPUB2E89DPUB2E89DPT103]B 01012E89DPUB2E89DPUB2E8130T03@6W2JL9Y`VW2JL9Y`402jL04@48Y`RW2:L8Y`RW2:L8Y`P103X8 00l1Y`RW2:L8Y`RW2:L8Y`P00P4:Y`070JL9Y`VW2@0500410@0001D000<100000P002:L9Y`VW2JL1 2PT0405B2E89DPUB2E89DPUB2@4DDQ@15E803`49DPUB2E89DPUB2E890@0<2@0=0@VW2JL9Y`VW2JL9 0@0;Y`0@0JL8Y`RW2:L8Y`RW2:L80A<85@4D200@0JL8Y`RW2:L8Y`RW2:L80@ZW00L12JL9Y`VW00D0 0@4100005@000`40000200082JL9Y`VW2@4:2@0@0@UB2E89DPUB2E89DPUB0A9B0`404e81DP5B0E81 DP5B0E81DP5B0E800P4CDP0@0E89DPUB2E89DPUB2E890@/900d1Y`VW2JL9Y`VW2JL100ZW0141Y`RW 2:L8Y`RW2:L8Y`RW0@0A208101D0200800P0200800P0200800P020000P4B200A0@RW2:L8Y`RW2:L8 Y`RW20402JL01`6W2JL9Y`T01@010@40000E00030@00008000RW2JL9Y`VW0@T901012E89DPUB2E89 DPUB2E814E820@0GDP5B0E81DP5B0E81DP5B0E81DP5B0E800`4BDP0?0E89DPUB2E89DPUB2E8100/9 00d12JL9Y`VW2JL9Y`T100ZW01012:L8Y`RW2:L8Y`RW2:L140P20@0I200800P0200800P0200800P0 200800P020020A4801012:L8Y`RW2:L8Y`RW2:L12JL01`49Y`VW2JL01@010@40000E00030@000080 00P9Y`VW2JL90@T900l1DPUB2E89DPUB2E89DP4045830@0KDP5B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B00814E803P5B2E89DPUB2E89DPT12`T03@6W2JL9Y`VW2JL9Y`402ZL03`6W2:L8Y`RW2:L8Y`RW 0@0?208101d0200800P0200800P0200800P0200800P0200800020A0800l12:L8Y`RW2:L8Y`RW2040 2JL01`6W2JL9Y`T01@010@40000E00030@00008000NW2JL9Y`T100X900h12E89DPUB2E89DPUB0@mB 0P407e81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E800`4?DP0?0@UB2E89DPUB2E89DPT100X9 00`12JL9Y`VW2JL9Y`4:Y`0?0JL8Y`RW2:L8Y`RW2:L100h80P408@P0200800P0200800P0200800P0 200800P0200800P020020@l800h12:L8Y`RW2:L8Y`RW0@ZW00H1Y`VW2JL500410@0001D000<10000 0P001`VW2JL9Y`402PT03P5B2E89DPUB2E89DPT13E830@0SDP5B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E800P4>DP0>0@UB2E89DPUB2E89DP4:2@0<0JL9Y`VW2JL9Y`T12ZL03`48Y`RW2:L8 Y`RW2:L80@0<208102D0200800P0200800P0200800P0200800P0200800P0200800P000813@P03`6W 2:L8Y`RW2:L8Y`RW0@09Y`060@VW2JL91@010@40000E00030@00008000NW2JL9Y`T100T900h1DPUB 2E89DPUB2E890@aB0P409e81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP030@eB 00d12E89DPUB2E89DPT100X900`12JL9Y`VW2JL9Y`4:Y`0>0JL8Y`RW2:L8Y`RW204;208102T800P0 200800P0200800P0200800P0200800P0200800P0200800P020020@`800h1Y`RW2:L8Y`RW2:L80@VW 00H1Y`VW2JL500410@0001D000<100000P001`VW2JL9Y`402@T03@49DPUB2E89DPUB2@402e830@0[ DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP020@]B00h1DPUB2E89DPUB 2E890@T900`1Y`VW2JL9Y`VW2@49Y`0>0JL8Y`RW2:L8Y`RW204:208102d0200800P0200800P02008 00P0200800P0200800P0200800P0200800P020000P4;200=0JL8Y`RW2:L8Y`RW0@09Y`060@VW2JL9 1@010@40000E00030@00008000NW2JL9Y`T100T900d1DPUB2E89DPUB2E8100UB0P40;e81DP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B00<12U803@5B2E89DPUB2E89DP40 2PT02`6W2JL9Y`VW2JL100VW00h12:L8Y`RW2:L8Y`RW0@P80P40<@P0200800P0200800P0200800P0 200800P0200800P0200800P0200800P0200800P00P4:200=0JL8Y`RW2:L8Y`RW0@08Y`060JL9Y`VW 1@010@40000E00030@00008000L9Y`VW2JL100T900`12E89DPUB2E89DP48DP<103=B0E81DP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E800P49DP0<0E89DPUB2E89DPT1 2PT02`49Y`VW2JL9Y`T100VW00d1Y`RW2:L8Y`RW2:L100P803H100P0200800P0200800P0200800P0 200800P0200800P0200800P0200800P0200800P020020@P800d12:L8Y`RW2:L8Y`P100RW00H12JL9 Y`T500410@0001D00P430007Y`VW2JL90@092@0;0E89DPUB2E89DP402E820@0eDP5B0E81DP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E800P48DP0=0@UB2E89DPUB2E89 0@092@0;0JL9Y`VW2JL9Y`402:L03@6W2:L8Y`RW2:L8Y`402@P0>@4800P0200800P0200800P02008 00P0200800P0200800P0200800P0200800P0200800P020080@08200<0@RW2:L8Y`RW2:L12:L01P6W 2JL9Y`@00P4100005@000`40000200072JL9Y`VW0@082@0;0E89DPUB2E89DP402E820@0hDP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP49DP0<0@UB2E89 DPUB2E812@T02`49Y`VW2JL9Y`T100RW00`12:L8Y`RW2:L8Y`49200j0@P0200800P0200800P02008 00P0200800P0200800P0200800P0200800P0200800P0200800P00@T800/12:L8Y`RW2:L80@08Y`06 0@VW2JL91@010@40000E00030@00008000NW2JL9Y`T100P900/12E89DPUB2E890@09DP0D0E81DP5B 0E81DP5B0E81DP5B0E8C0@0DDP5B0E81DP5B0E81DP5B0E81DP49DP0;0@UB2E89DPUB2@402@T02`6W 2JL9Y`VW2JL100RW00`1Y`RW2:L8Y`RW2049200C0@0800P0200800P0200800P0200D0@0D00P02008 00P0200800P020080048200<0JL8Y`RW2:L8Y`P11jL01P6W2JL9Y`D00@4100005@000`4000020006 2JL9Y`T12@T02P5B2E89DPUB2@49DP0D0E81DP5B0E81DP5B0E81DP5B0E8E0@0ADP5B0E81DP5B0E81 DP5B0E800P49DP0<0E89DPUB2E89DPT120T02P49Y`VW2JL9Y`48Y`0<0JL8Y`RW2:L8Y`P12@P05040 200800P0200800P0200800P150005040200800P0200800P0200800P12@P02`6W2:L8Y`RW2:L100RW 00D1Y`VW2@0500410@0001D000<100000P001ZL9Y`VW0@T900T12E89DPUB2@402U820@0?DP5B0E81 DP5B0E81DP5B01T1015B0E81DP5B0E81DP5B0E81DP020@UB00/1DPUB2E89DPUB0@082@0:0JL9Y`VW 2JL90@RW00/12:L8Y`RW2:L80@0:200A0@P0200800P0200800P020000P4F000D0@0800P0200800P0 200800P02049200:0JL8Y`RW2:L80@RW00D12JL9Y`0500410@0001D000<100000P001PVW2JL90@P9 00T12E89DPUB2@402U820@0?DP5B0E81DP5B0E81DP5B01d1011B0E81DP5B0E81DP5B0E812U802P5B 2E89DPUB2@482@0:0@VW2JL9Y`VW0@RW00X1Y`RW2:L8Y`P12PP04P4800P0200800P0200800P00AT0 0P404@P0200800P0200800P0200100X800T1Y`RW2:L8Y`402:L01@6W2JL900D00@4100005@000`40 00020006Y`VW2JL120T02@5B2E89DPUB0@0:DP0@0E81DP5B0E81DP5B0E81DQl1011B0E81DP5B0E81 DP5B0E812E802`49DPUB2E89DPT100L900X1Y`VW2JL9Y`T11jL02`6W2:L8Y`RW2:L100X8014100P0 200800P0200800P00@0L000B0@P0200800P0200800P020012@P02P48Y`RW2:L8Y`47Y`050@VW2JL0 1@010@40000E00030@00008000H9Y`VW2@482@080@UB2E89DP4:DP0@0E81DP5B0E81DP5B0E81DR41 00eB0E81DP5B0E81DP5B00812U802P49DPUB2E89DP472@0:0@VW2JL9Y`VW0@NW00X12:L8Y`RW2:L1 2PP04@40200800P0200800P0200101h00141200800P0200800P020080@0:20090@RW2:L8Y`P100NW 00D1Y`VW2@0500410@0001D000<100000P001ZL9Y`VW0@P900P1DPUB2E890@YB0P403e81DP5B0E81 DP5B0E81DP0O0@0@DP5B0E81DP5B0E81DP5B0@YB00X1DPUB2E89DPT11`T02P6W2JL9Y`VW2@47Y`0: 0JL8Y`RW2:L80@X80141200800P0200800P020080@0N000A0@0800P0200800P0200800402PP02@6W 2:L8Y`RW0@07Y`050@VW2JL01@010@40000E00030@00008000H9Y`VW2@482@080@UB2E89DP4:DP0@ 0E81DP5B0E81DP5B0E81DR41011B0E81DP5B0E81DP5B0E812E802P49DPUB2E89DP472@0:0@VW2JL9 Y`VW0@NW00X12:L8Y`RW2:L12PP04040200800P0200800P0204P000@0@0800P0200800P020080@X8 00T12:L8Y`RW20401jL01@6W2JL900D00@4100005@000`4000020006Y`VW2JL120T0205B2E89DPT1 2E80405B0E81DP5B0E81DP5B0E8S0@0=DP5B0E81DP5B0E81DP020@UB00X1DPUB2E89DPT11`T02P6W 2JL9Y`VW2@47Y`0:0JL8Y`RW2:L80@T8014100P0200800P0200800P00@0P000A0@P0200800P02008 00P020402@P02@6W2:L8Y`RW0@07Y`050@VW2JL01@010@40000E00030@00008000H9Y`VW2@482@08 0@UB2E89DP49DP8100eB0E81DP5B0E81DP5B02D100iB0E81DP5B0E81DP5B0@UB00X12E89DPUB2E81 1`T02P49Y`VW2JL9Y`47Y`0:0@RW2:L8Y`RW0@T80101200800P0200800P020018P00404800P02008 00P02008004920090@RW2:L8Y`P100NW00D1Y`VW2@0500410@0001D00P430006Y`VW2JL120T01`5B 2E89DP402U80405B0E81DP5B0E81DP5B0E8S0@0=DP5B0E81DP5B0E81DP020@YB00T12E89DPUB2@40 1`T02P6W2JL9Y`VW2@47Y`090JL8Y`RW2:L100X8010100P0200800P0200800P18P004040200800P0 200800P0204:20080@RW2:L8Y`47Y`050@VW2JL010020@40000E00030@00008000H9Y`VW2@482@07 0@UB2E890@0:DP8100eB0E81DP5B0E81DP5B02D100eB0E81DP5B0E81DP5B00812E802@5B2E89DPUB 0@072@0:0@VW2JL9Y`VW0@NW00T12:L8Y`RW20402PP03`4800P0200800P020080@0T000?0@0800P0 200800P0200100X800P1Y`RW2:L80@NW00D1Y`VW2@0500410@0001D000<100000P001ZL9Y`VW0@P9 00L1DPUB2E8100UB0P403E81DP5B0E81DP5B0E809`403U81DP5B0E81DP5B0E812E802@49DPUB2E89 0@072@0:0JL9Y`VW2JL90@NW00T1Y`RW2:L8Y`402@P0404800P0200800P02008004T000@0@P02008 00P0200800P00@T800P12:L8Y`RW0@NW00D12JL9Y`0500410@0001D000<100000P001PVW2JL90@P9 00L12E89DPT100UB00h1DP5B0E81DP5B0E81DRT100]B0E81DP5B0E81DP020@UB00T1DPUB2E89DP40 1`T02P49Y`VW2JL9Y`47Y`090@RW2:L8Y`P100T800l100P0200800P0200800409P003`4800P02008 00P020080@0920080JL8Y`RW2047Y`050JL9Y`T01@010@40000E00030@00008000JW2JL9Y`482@07 0E89DPUB0@09DP8100eB0E81DP5B0E81DP5B02L100eB0E81DP5B0E81DP5B008125802P49DPUB2E89 DP472@090@VW2JL9Y`T100NW00T1Y`RW2:L8Y`402@P03`4800P0200800P020080@0V000?0@0800P0 200800P0200100T800T12:L8Y`RW20401ZL01@49Y`VW00D00@4100005@000`40000200062JL9Y`T1 1`T0205B2E89DPT12E803P5B0E81DP5B0E81DP5B:@403U81DP5B0E81DP5B0E8125802P5B2E89DPUB 2@472@080JL9Y`VW2@47Y`0:0JL8Y`RW2:L80@T800l100P0200800P0200800409P003`4800P02008 00P020080@0920090JL8Y`RW2:L100JW00D1Y`VW2@0500410@0001D000<100000P001ZL9Y`VW0@L9 00P12E89DPUB0@UB0P402e81DP5B0E81DP5B02/100]B0E81DP5B0E81DP020@QB00X12E89DPUB2E81 1`T02049Y`VW2JL11jL02P48Y`RW2:L8Y`49200>0@P0200800P02008004X000>0@P0200800P02008 004920090@RW2:L8Y`P100JW00D12JL9Y`0500410@0001D000<100000P001PVW2JL90@L900P1DPUB 2E890@QB0P402e81DP5B0E81DP5B02/100iB0E81DP5B0E81DP5B0@QB00X1DPUB2E89DPT11`T0206W 2JL9Y`T11jL02P6W2:L8Y`RW2048200?0@P0200800P0200800P102P000l100P0200800P020080040 20P02@6W2:L8Y`RW0@06Y`050JL9Y`T01@010@40000E00030@00008000JW2JL9Y`472@080@UB2E89 DP48DP0>0E81DP5B0E81DP5B0E8[0@0>DP5B0E81DP5B0E81DP47DP0:0@UB2E89DPUB0@L900P12JL9 Y`VW0@NW00X12:L8Y`RW2:L120P03P40200800P0200800P1:P003P40200800P0200800P120P02@48 Y`RW2:L80@06Y`050@VW2JL01@010@40000E00030@00008000H9Y`VW2@472@070E89DPUB0@09DP81 00]B0E81DP5B0E81DP0]0@0;DP5B0E81DP5B0E800P48DP090@UB2E89DPT100L900P1Y`VW2JL90@NW 00T1Y`RW2:L8Y`402@P03P4800P0200800P02001:P003P4800P0200800P020012@P02048Y`RW2:L1 1ZL01@6W2JL900D00@4100005@000`4000020006Y`VW2JL11`T01`49DPUB2@402E80305B0E81DP5B 0E81DRl100aB0E81DP5B0E81DP48DP090E89DPUB2E8100L900P12JL9Y`VW0@NW00T12:L8Y`RW2040 2@P03@40200800P020080040;0003@4800P0200800P020402@P0206W2:L8Y`P11ZL01@49Y`VW00D0 0@4100005@000`40000200062JL9Y`T11`T01`5B2E89DP402580305B0E81DP5B0E81DRl100]B0E81 DP5B0E81DP020@QB00T12E89DPUB2@401`T0206W2JL9Y`T11jL02@6W2:L8Y`RW0@08200>0@0800P0 200800P0204/000>0@0800P0200800P0204820080@RW2:L8Y`46Y`050JL9Y`T01@010@40000=00@1 10000`4000020006Y`VW2JL11`T01`49DPUB2@4025820@0;DP5B0E81DP5B0E80;`402e81DP5B0E81 DP5B00811e802@5B2E89DPUB0@072@080@VW2JL9Y`47Y`090@RW2:L8Y`P100P800d1200800P02008 00P102h000d100P0200800P0200100P800P1Y`RW2:L80@JW00D12JL9Y`0500410@0000l000<10000 0`020@<000H9Y`VW2@472@070E89DPUB0@08DP0<0E81DP5B0E81DP5B<@403581DP5B0E81DP5B0@MB 00T12E89DPUB2@401`T0206W2JL9Y`T11jL02@6W2:L8Y`RW0@08200=0@0800P0200800P00@0^000= 0@P0200800P020080@0820080@RW2:L8Y`46Y`050JL9Y`T010020@40000?00030@0000<000<10000 0P001ZL9Y`VW0@L900L12E89DPT100QB0P402e81DP5B0E81DP5B02l100]B0E81DP5B0E81DP020@MB 00T1DPUB2E89DP401`T02049Y`VW2JL11jL02@48Y`RW2:L80@08200=0@P0200800P020080@0^000= 0@0800P0200800P00@0820080JL8Y`RW2046Y`050@VW2JL01@010@40000?00030@0000<000<10000 0P001PVW2JL90@L900L1DPUB2E8100QB00`1DP5B0E81DP5B0E8_0@0;DP5B0E81DP5B0E800P48DP09 0@UB2E89DPT100L900P1Y`VW2JL90@NW00T1Y`RW2:L8Y`4020P03P40200800P0200800P1;0003P40 200800P0200800P120P02048Y`RW2:L11ZL01@6W2JL900D00@4100003`000`40000300030@000080 00JW2JL9Y`472@070@UB2E890@09DP0<0E81DP5B0E81DP5B;`403581DP5B0E81DP5B0@QB00T1DPUB 2E89DP401`T02049Y`VW2JL11jL02@48Y`RW2:L80@09200=0@0800P0200800P00@0/000=0@P02008 00P020080@0920080JL8Y`RW2046Y`050@VW2JL01@010@40000=00<11@000`40000200062JL9Y`T1 1`T01`5B2E89DP402E820@0;DP5B0E81DP5B0E80;@402e81DP5B0E81DP5B008125802@49DPUB2E89 0@072@080JL9Y`VW2@47Y`090JL8Y`RW2:L100T800h1200800P0200800P00BX000h1200800P02008 00P00@T800P12:L8Y`RW0@JW00D1Y`VW2@0500410@0000l000<100000`000`4000020006Y`VW2JL1 1`T02049DPUB2E8125803P5B0E81DP5B0E81DP5B:`403U81DP5B0E81DP5B0E811e802P49DPUB2E89 DP472@080@VW2JL9Y`47Y`0:0@RW2:L8Y`RW0@P800h100P0200800P020080BX000h100P0200800P0 20080@P800T12:L8Y`RW20401ZL01@49Y`VW00D00@4100005@000`40000200062JL9Y`T11`T0205B 2E89DPT125820@0;DP5B0E81DP5B0E80:`403U81DP5B0E81DP5B0E8125802P5B2E89DPUB2@472@08 0JL9Y`VW2@47Y`0:0JL8Y`RW2:L80@P800l1200800P0200800P02040:0003`40200800P0200800P0 0@0820090JL8Y`RW2:L100JW00D1Y`VW2@0500410@0001D000<100000P001ZL9Y`VW0@L900P12E89 DPUB0@UB0P402e81DP5B0E81DP5B02/100]B0E81DP5B0E81DP020@QB00X12E89DPUB2E811`T02049 Y`VW2JL11jL02P48Y`RW2:L8Y`49200>0@P0200800P02008004X000>0@P0200800P0200800492009 0@RW2:L8Y`P100JW00D12JL9Y`0500410@0001D000<100000P001PVW2JL90@L900P1DPUB2E890@UB 00h1DP5B0E81DP5B0E81DRT100iB0E81DP5B0E81DP5B0@QB00X1DPUB2E89DPT11`T0206W2JL9Y`T1 1jL02P6W2:L8Y`RW2049200?0@0800P0200800P0200102H000l1200800P0200800P020402@P02@6W 2:L8Y`RW0@06Y`050JL9Y`T01@010@40000E00030@00008000JW2JL9Y`482@070E89DPUB0@09DP81 00eB0E81DP5B0E81DP5B02L100eB0E81DP5B0E81DP5B008125802P49DPUB2E89DP472@090@VW2JL9 Y`T100NW00T1Y`RW2:L8Y`402@P03`4800P0200800P020080@0V000?0@0800P0200800P0200100T8 00T12:L8Y`RW20401ZL01@49Y`VW00D00@4100005@000`40000200062JL9Y`T120T01`49DPUB2@40 2E803P5B0E81DP5B0E81DP5B:@402e81DP5B0E81DP5B00812E802@5B2E89DPUB0@072@0:0@VW2JL9 Y`VW0@NW00T12:L8Y`RW20402@P03`40200800P0200800P00@0V000?0@P0200800P0200800P100T8 00P1Y`RW2:L80@NW00D1Y`VW2@0500410@0001D000<100000P001ZL9Y`VW0@P900L1DPUB2E8100UB 0P403E81DP5B0E81DP5B0E809`403U81DP5B0E81DP5B0E812E802@49DPUB2E890@072@0:0JL9Y`VW 2JL90@NW00T1Y`RW2:L8Y`402@P0404800P0200800P02008004T000@0@P0200800P0200800P00@T8 00P12:L8Y`RW0@NW00D12JL9Y`0500410@0001D000<100000P001PVW2JL90@P900L12E89DPT100YB 0P403E81DP5B0E81DP5B0E809@403E81DP5B0E81DP5B0E800P49DP090E89DPUB2E8100L900X12JL9 Y`VW2JL11jL02@48Y`RW2:L80@0:200?0@P0200800P0200800P102@000l100P0200800P020080040 2PP0206W2:L8Y`P11jL01@6W2JL900D00@4100005@020@<000JW2JL9Y`482@070E89DPUB0@0:DP0@ 0E81DP5B0E81DP5B0E81DR<100eB0E81DP5B0E81DP5B00812U802@49DPUB2E890@072@0:0JL9Y`VW 2JL90@NW00T1Y`RW2:L8Y`402PP04040200800P0200800P0204R000@0@0800P0200800P020080@X8 00P12:L8Y`RW0@NW00D12JL9Y`0400810@0001D000<100000P001PVW2JL90@P900P12E89DPUB0@UB 0P403E81DP5B0E81DP5B0E809@403U81DP5B0E81DP5B0E812E802P49DPUB2E89DP472@0:0@VW2JL9 Y`VW0@NW00X12:L8Y`RW2:L12@P0404800P0200800P02008004R000@0@P0200800P0200800P00@T8 00T12:L8Y`RW20401jL01@6W2JL900D00@4100005@000`4000020006Y`VW2JL120T0205B2E89DPT1 2E80405B0E81DP5B0E81DP5B0E8S0@0=DP5B0E81DP5B0E81DP020@UB00X1DPUB2E89DPT11`T02P6W 2JL9Y`VW2@47Y`0:0JL8Y`RW2:L80@T8014100P0200800P0200800P00@0P000A0@P0200800P02008 00P020402@P02@6W2:L8Y`RW0@07Y`050@VW2JL01@010@40000E00030@00008000H9Y`VW2@482@08 0@UB2E89DP4:DP0@0E81DP5B0E81DP5B0E81DR41011B0E81DP5B0E81DP5B0E812E802P49DPUB2E89 DP472@0:0@VW2JL9Y`VW0@NW00X12:L8Y`RW2:L12PP04040200800P0200800P0204P000@0@0800P0 200800P020080@X800T12:L8Y`RW20401jL01@6W2JL900D00@4100005@000`4000020006Y`VW2JL1 20T0205B2E89DPT12U820@0?DP5B0E81DP5B0E81DP5B01l1011B0E81DP5B0E81DP5B0E812U802P5B 2E89DPUB2@472@0:0JL9Y`VW2JL90@NW00X1Y`RW2:L8Y`P12PP04@4800P0200800P0200800P101h0 014100P0200800P0200800P00@0:20090JL8Y`RW2:L100NW00D12JL9Y`0500410@0001D000<10000 0P001PVW2JL90@P900P12E89DPUB0@YB0101DP5B0E81DP5B0E81DP5B8@403E81DP5B0E81DP5B0E80 0P4:DP0:0@UB2E89DPUB0@L900X12JL9Y`VW2JL11jL02P48Y`RW2:L8Y`4:200A0@0800P0200800P0 200800407P004@4800P0200800P0200800P100X800T12:L8Y`RW20401jL01@6W2JL900D00@410000 5@000`4000020006Y`VW2JL120T02@5B2E89DPUB0@0:DP0@0E81DP5B0E81DP5B0E81DQl1011B0E81 DP5B0E81DP5B0E812E802`49DPUB2E89DPT100L900X1Y`VW2JL9Y`T11jL02`6W2:L8Y`RW2:L100X8 014100P0200800P0200800P00@0L000B0@P0200800P0200800P020012@P02P48Y`RW2:L8Y`47Y`05 0@VW2JL01@010@40000E00030@00008000H9Y`VW2@482@090@UB2E89DPT100YB0P403e81DP5B0E81 DP5B0E81DP0M0@0@DP5B0E81DP5B0E81DP5B0@YB00X1DPUB2E89DPT120T02P49Y`VW2JL9Y`48Y`0: 0JL8Y`RW2:L80@X80181200800P0200800P02008004J000B0@P0200800P0200800P020012PP02@6W 2:L8Y`RW0@08Y`050JL9Y`T01@010@40000E00030@00008000JW2JL9Y`492@090@UB2E89DPT100YB 0P403e81DP5B0E81DP5B0E81DP0K0@0?DP5B0E81DP5B0E81DP5B00812E802`5B2E89DPUB2E8100P9 00X1Y`VW2JL9Y`T12:L02`48Y`RW2:L8Y`P100X80181200800P0200800P02008004H000C0@P02008 00P0200800P020080@09200:0JL8Y`RW2:L80@RW00D12JL9Y`0500410@0001D000<100000P001PVW 2JL90@T900X1DPUB2E89DPT12E804P5B0E81DP5B0E81DP5B0E81DQT100mB0E81DP5B0E81DP5B0E80 0P49DP0<0E89DPUB2E89DPT120T02P49Y`VW2JL9Y`48Y`0<0JL8Y`RW2:L8Y`P12@P04`40200800P0 200800P0200800405P004`4800P0200800P0200800P020402@P02`6W2:L8Y`RW2:L100RW00D1Y`VW 2@0500410@0001D000<100000P001jL9Y`VW2@4020T02P49DPUB2E89DP4:DP0B0E81DP5B0E81DP5B 0E81DP5B5`404U81DP5B0E81DP5B0E81DP5B0@UB00/12E89DPUB2E890@092@0;0JL9Y`VW2JL9Y`40 2:L02`6W2:L8Y`RW2:L100X801<100P0200800P0200800P0200101@001@1200800P0200800P02008 00P00@T800/12:L8Y`RW2:L80@07Y`060JL9Y`VW1@010@40000E00030@00008000L9Y`VW2JL100P9 00/1DPUB2E89DPUB0@09DP81015B0E81DP5B0E81DP5B0E81DP0E0@0BDP5B0E81DP5B0E81DP5B0E81 2E803049DPUB2E89DPUB0@T900/12JL9Y`VW2JL90@08Y`0<0@RW2:L8Y`RW2:L12@P04`4800P02008 00P0200800P0200050404`P0200800P0200800P0200800402@P02`48Y`RW2:L8Y`P100RW00H12JL9 Y`T500410@0001D000<100000P001jL9Y`VW2@402@T02`5B2E89DPUB2E8100UB0P40=E81DP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B00812E80305B2E89DPUB 2E890@T900/1Y`VW2JL9Y`VW0@08Y`0=0JL8Y`RW2:L8Y`RW0@09200i0@P0200800P0200800P02008 00P0200800P0200800P0200800P0200800P0200800P0200800P100P800`12:L8Y`RW2:L8Y`48Y`06 0JL9Y`VW1@010@40000E00810`001`VW2JL9Y`402@T02`49DPUB2E89DPT100UB03H1DP5B0E81DP5B 0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E820@UB00`1DPUB2E89DPUB 2@4:2@0;0@VW2JL9Y`VW2@402JL0306W2:L8Y`RW2:L80@T803P100P0200800P0200800P0200800P0 200800P0200800P0200800P0200800P0200800P020080@T800`1Y`RW2:L8Y`RW2048Y`060@VW2JL9 10020@40000E00030@00008000NW2JL9Y`T100T900`1DPUB2E89DPUB2@49DP<1035B0E81DP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B00812E803@5B2E89DPUB2E89DP40 2PT02`6W2JL9Y`VW2JL100VW00d12:L8Y`RW2:L8Y`P100T80P400JL8Y`RW2:L8Y`RW204:208102h0200800P0200800P0200800P02008 00P0200800P0200800P0200800P020080P4:200=0JL8Y`RW2:L8Y`RW0@09Y`060@VW2JL91@010@40 000E00030@00008000NW2JL9Y`T100T900h1DPUB2E89DPUB2E890@]B0`40:E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B008135803@49DPUB2E89DPUB2@402PT03049Y`VW2JL9 Y`VW0@ZW00h1Y`RW2:L8Y`RW2:L80@/80P40:PP0200800P0200800P0200800P0200800P0200800P0 200800P0200800812`P03P6W2:L8Y`RW2:L8Y`P12JL01P6W2JL9Y`D00@4100005@000`4000020007 2JL9Y`VW0@0:2@0=0E89DPUB2E89DPUB0@0=DP8102EB0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B00<13E803P49DPUB2E89DPUB2E812PT0306W2JL9Y`VW2JL90@ZW00h12:L8Y`RW2:L8 Y`RW0@d80P409P0800P0200800P0200800P0200800P0200800P0200800P020080P4=200>0@RW2:L8 Y`RW2:L8Y`49Y`060@VW2JL91@010@40000E00030@00008000NW2JL9Y`T100X900h12E89DPUB2E89 DPUB0@iB0`408E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP020@mB00h1DPUB2E89DPUB 2E890@X900`12JL9Y`VW2JL9Y`4:Y`0?0JL8Y`RW2:L8Y`RW2:L100h802H100P0200800P0200800P0 200800P0200800P0200800P020080@h800h12:L8Y`RW2:L8Y`RW0@ZW00H1Y`VW2JL500410@0001D0 00<100000P001`VW2JL9Y`402PT03`5B2E89DPUB2E89DPUB0@0?DP8101mB0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E81DP5B00813e803P5B2E89DPUB2E89DPT12`T0306W2JL9Y`VW2JL90@^W00l1Y`RW 2:L8Y`RW2:L8Y`403PP20@0P200800P0200800P0200800P0200800P0200800P020020@h800l12:L8 Y`RW2:L8Y`RW20402ZL01P49Y`VW2@D00@4100005@000`4000020008Y`VW2JL9Y`492@0?0@UB2E89 DPUB2E89DPT1015B0`406E81DP5B0E81DP5B0E81DP5B0E81DP5B0E800`4ADP0>0@UB2E89DPUB2E89 DP4;2@0=0@VW2JL9Y`VW2JL90@0:Y`0?0@RW2:L8Y`RW2:L8Y`P101080P40700800P0200800P02008 00P0200800P0200800P20A0800l1Y`RW2:L8Y`RW2:L8Y`402JL01`49Y`VW2JL01@010@40000E0003 0@00008000P9Y`VW2JL90@X900l12E89DPUB2E89DPUB2@404U820@0GDP5B0E81DP5B0E81DP5B0E81 DP5B0E800P4BDP0?0@UB2E89DPUB2E89DPT100/900d1Y`VW2JL9Y`VW2JL100ZW0101Y`RW2:L8Y`RW 2:L8Y`P14@P20@0H200800P0200800P0200800P0200800P00P4A200@0JL8Y`RW2:L8Y`RW2:L80@VW 00L1Y`VW2JL900D00@4100005@000`4000020008Y`VW2JL9Y`4:2@0@0E89DPUB2E89DPUB2E890A=B 0`404E81DP5B0E81DP5B0E81DP5B00<14e803`49DPUB2E89DPUB2E890@0<2@0=0@VW2JL9Y`VW2JL9 0@0;Y`0@0JL8Y`RW2:L8Y`RW2:L80A880P40500800P0200800P0200800P020080P4B200@0JL8Y`RW 2:L8Y`RW2:L80@ZW00L12JL9Y`VW00D00@4100005@000`40000200082JL9Y`VW2@4:2@0@0@UB2E89 DPUB2E89DPUB0AEB4`4EDP0?0E89DPUB2E89DPUB2E8100`900d1Y`VW2JL9Y`VW2JL100^W01012:L8 Y`RW2:L8Y`RW2:L150PD0A@801012:L8Y`RW2:L8Y`RW2:L12ZL01`6W2JL9Y`T01@010@40000E0003 0@00008000RW2JL9Y`VW0@/901012E89DPUB2E89DPUB2E81>U820@0?DPUB2E89DPUB2E89DPT100`9 00d12JL9Y`VW2JL9Y`T100^W0141Y`RW2:L8Y`RW2:L8Y`RW0@0i208100l8Y`RW2:L8Y`RW2:L8Y`40 2jL01`49Y`VW2JL01@010@40000E00810`002@VW2JL9Y`VW0@0;2@8100eB2E89DPUB2E89DPUB00<1 =5830@0>2E89DPUB2E89DPUB2E820@`900l12JL9Y`VW2JL9Y`VW2@402jL20@0>2:L8Y`RW2:L8Y`RW 2:L30C@80P403ZL8Y`RW2:L8Y`RW2:L80P4;Y`080@VW2JL9Y`T400810@0001D000<100000P002JL9 Y`VW2JL90@0=2@0@0E89DPUB2E89DPUB2E89DP<1;U830@0A2E89DPUB2E89DPUB2E89DP403PT03`6W 2JL9Y`VW2JL9Y`VW0@0=Y`0A0@RW2:L8Y`RW2:L8Y`RW2:L00`4^20<10108Y`RW2:L8Y`RW2:L8Y`P1 3JL0206W2JL9Y`VW1@010@40000E00030@00008000X9Y`VW2JL9Y`T13@T04P5B2E89DPUB2E89DPUB 2E89DP<1:5830@0A2E89DPUB2E89DPUB2E89DPT00P4>2@0A0JL9Y`VW2JL9Y`VW2JL9Y`403JL20@0A Y`RW2:L8Y`RW2:L8Y`RW2:L00`4X20<10188Y`RW2:L8Y`RW2:L8Y`RW204=Y`090JL9Y`VW2JL900D0 0@4100005@000`400002000:Y`VW2JL9Y`VW0@h90P404PUB2E89DPUB2E89DPUB2E89DP@18E830@0D 2E89DPUB2E89DPUB2E89DPUB2@4?2@0B0JL9Y`VW2JL9Y`VW2JL9Y`T13jL0506W2:L8Y`RW2:L8Y`RW 2:L8Y`RW0`4R20<10188Y`RW2:L8Y`RW2:L8Y`RW2:L20@jW00T12JL9Y`VW2JL01@010@40000E0003 0@00008000/9Y`VW2JL9Y`VW0@0?2@0F0@UB2E89DPUB2E89DPUB2E89DPUB2@<16e830@0D2E89DPUB 2E89DPUB2E89DPUB2E820A0901<12JL9Y`VW2JL9Y`VW2JL9Y`T100nW0P4050RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW0`4L20<101D8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`403jL02P49Y`VW2JL9Y`T500410@0001D0 00<100000P003:L9Y`VW2JL9Y`VW0@l90P405U89DPUB2E89DPUB2E89DPUB2E89DPT30AEB0`405`UB 2E89DPUB2E89DPUB2E89DPUB2E81014901D12JL9Y`VW2JL9Y`VW2JL9Y`VW2@404:L05`48Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW00<15PP30@0E2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L800814:L02P6W2JL9Y`VW 2JL500410@0001D000<100000P0030VW2JL9Y`VW2JL90A4901T1DPUB2E89DPUB2E89DPUB2E89DPUB 2E8901D101L9DPUB2E89DPUB2E89DPUB2E89DPUB2@020A4901H12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL1 4JL20@0GY`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L05P4060RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L80A6W 00/1Y`VW2JL9Y`VW2@0500410@0001D000<100000P003JL9Y`VW2JL9Y`VW2@404@T20@122E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPT1 4`T05`6W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL101:W0481Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L20A:W00/12JL9Y`VW2JL9Y`050041 0@0001D000<100000P003PVW2JL9Y`VW2JL9Y`T14PT0?`49DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP020A<901T1Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL101:W0P40?`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW0@0CY`0<0@VW2JL9Y`VW2JL91@010@40000E00030@00008000jW2JL9 Y`VW2JL9Y`VW0A<903h12E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB0A@901X1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90ABW03h12:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0A>W00d12JL9 Y`VW2JL9Y`VW00D00@4100005@000`400002000?2JL9Y`VW2JL9Y`VW2JL101<90P40>589DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E890P4E2@0K0@VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T101BW0P40>:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L80P4DY`0=0JL9Y`VW2JL9Y`VW2@0500410@0001D000<10000 0P003jL9Y`VW2JL9Y`VW2JL90@0E2@@10309DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E840AH901`12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL15ZL30@0aY`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`040AFW00h1Y`VW2JL9Y`VW 2JL9Y`D00@4100005@000`400002000@2JL9Y`VW2JL9Y`VW2JL90AP91P409589DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2@H16@T07P49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0ARW 1P409@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P01P4IY`0>0@VW2JL9Y`VW2JL9 Y`T500410@0001D00P43000AY`VW2JL9Y`VW2JL9Y`VW2@407@T60@0H2E89DPUB2E89DPUB2E89DPUB 2E89DPUB1P4O2@0O0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@0MY`H101VW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW00H17ZL03`49Y`VW2JL9Y`VW2JL9Y`0400810@0001D000<100000P004@VW 2JL9Y`VW2JL9Y`VW2JL102<9604T2@0P0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@4SYaT1 9:L03`6W2JL9Y`VW2JL9Y`VW2@0500410@0001D000<100000P004ZL9Y`VW2JL9Y`VW2JL9Y`VW0Ed9 0281Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T1GZL0406W2JL9Y`VW2JL9Y`VW2JL50041 0@0001D000<100000P004PVW2JL9Y`VW2JL9Y`VW2JL90Ed902812JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL1GZL04049Y`VW2JL9Y`VW2JL9Y`T500410@0001D000<100000P004ZL9Y`VW2JL9 Y`VW2JL9Y`VW2@<1EPT40@0R2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`@1EZL40@0@ 2JL9Y`VW2JL9Y`VW2JL9Y`D00@4100005@000`400002000E2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL900@1 CPT40@0ZY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9105>Y`@101BW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2@D00@4100005@000`400002000IY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`050D@91@40Y`@102ZW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`T40Dh910405:L9Y`VW2JL9Y`VW2JL9Y`VW2JL91@010@40000E00030@000080 01:W2JL9Y`VW2JL9Y`VW2JL9Y`T30EJW10408PVW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL40EH9104040VW2JL9Y`VW2JL9Y`VW2JL500410@0001D000<100000P004PVW2JL9Y`VW2JL9Y`VW 2JL90EfW02812JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL1GPT04049Y`VW2JL9Y`VW2JL9 Y`T500410@0001D000<100000P004ZL9Y`VW2JL9Y`VW2JL9Y`VW0EfW0281Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`T1GPT0406W2JL9Y`VW2JL9Y`VW2JL500410@0001D000<100000P004@VW 2JL9Y`VW2JL9Y`VW2JL102>W604TY`0P0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@4S2AT1 90T03`6W2JL9Y`VW2JL9Y`VW2@0500410@0001D00P43000AY`VW2JL9Y`VW2JL9Y`VW2@407JL60@0H 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW1P4OY`0O0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 0@0M2@H101UB2E89DPUB2E89DPUB2E89DPUB2E89DPUB00H17PT03`49Y`VW2JL9Y`VW2JL9Y`040081 0@0001D000<100000P0040VW2JL9Y`VW2JL9Y`VW2@4HY`H102BW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`P60AVW01h12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`4H2@H102D9DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E8900H16@T03P49Y`VW2JL9Y`VW2JL91@010@40 000E00030@00008000nW2JL9Y`VW2JL9Y`VW2@405JL40@0`2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW104FY`0L0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0AH9 0`40 0JL9Y`VW2JL9Y`VW2JL500410@0001D000<100000P003`VW2JL9Y`VW2JL9Y`VW0@0CY`8103RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20815JL06`49 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@0D2@8103QB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2@8150T03@6W2JL9Y`VW2JL9Y`T01@010@40000E0003 0@00008000jW2JL9Y`VW2JL9Y`VW0A>W03h12:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0ABW01X1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90A@9 03h12E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB0A<900d12JL9Y`VW2JL9Y`VW00D00@4100005@000`400002000>2JL9Y`VW2JL9Y`VW2@4BY`0o 0@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW00814jL06@6W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`404PT20@0o2E89DPUB2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E8101<900`12JL9Y`VW2JL9 Y`T500410@0001D000<100000P003JL9Y`VW2JL9Y`VW2@404JL20@122:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P14jL05`6W2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL101890481DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E820A8900/12JL9Y`VW2JL9Y`0500410@0001D000<10000 0P0030VW2JL9Y`VW2JL90A6W01T1Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L801D101L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW20020A6W01H12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL14@T20@0GDPUB2E89DPUB2E89 DPUB2E89DPUB2E805P4060UB2E89DPUB2E89DPUB2E89DPUB2E890A4900/1Y`VW2JL9Y`VW2@050041 0@0001D000<100000P003:L9Y`VW2JL9Y`VW0@nW0P405ZL8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P30AD8 0`405`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L1016W01D12JL9Y`VW2JL9Y`VW2JL9Y`VW2@4040T05`49 DPUB2E89DPUB2E89DPUB2E89DPUB00<15U830@0E2E89DPUB2E89DPUB2E89DPUB2E89008140T02P6W 2JL9Y`VW2JL500410@0001D000<100000P002`VW2JL9Y`VW2JL100nW01H12:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L80`4K20<101@8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`814:L04`49Y`VW2JL9Y`VW2JL9Y`VW2@40 3`T20@0D2E89DPUB2E89DPUB2E89DPUB2E830AaB0`405@UB2E89DPUB2E89DPUB2E89DPUB0@0?2@0: 0@VW2JL9Y`VW2@D00@4100005@000`400002000:Y`VW2JL9Y`VW0@jW0P404PRW2:L8Y`RW2:L8Y`RW 2:L8Y`@18@P30@0D2:L8Y`RW2:L8Y`RW2:L8Y`RW204?Y`0B0JL9Y`VW2JL9Y`VW2JL9Y`T13`T0505B 2E89DPUB2E89DPUB2E89DPUB0`4RDP<10189DPUB2E89DPUB2E89DPUB2E820@h900T12JL9Y`VW2JL0 1@010@40000E00030@00008000X9Y`VW2JL9Y`T13JL04P6W2:L8Y`RW2:L8Y`RW2:L8Y`<1:0P30@0A 2:L8Y`RW2:L8Y`RW2:L8Y`P00P4>Y`0A0JL9Y`VW2JL9Y`VW2JL9Y`403@T20@0ADPUB2E89DPUB2E89 DPUB2E800`4XDP<10189DPUB2E89DPUB2E89DPUB2@4=2@090JL9Y`VW2JL900D00@4100005@000`40 00020009Y`VW2JL9Y`T100fW0101Y`RW2:L8Y`RW2:L8Y`RW0`4^20<10148Y`RW2:L8Y`RW2:L8Y`RW 0@0>Y`0?0JL9Y`VW2JL9Y`VW2JL100d901412E89DPUB2E89DPUB2E89DP030BiB0`4040UB2E89DPUB 2E89DPUB2@4=2@080JL9Y`VW2JL500410@0001D00P4300092JL9Y`VW2JL100^W0P403JL8Y`RW2:L8 Y`RW2:L00`4d20<100h8Y`RW2:L8Y`RW2:L8Y`813:L03`49Y`VW2JL9Y`VW2JL90@0;2@8100h9DPUB 2E89DPUB2E89DP<1=5820@0>DPUB2E89DPUB2E89DPT20@/900P12JL9Y`VW2@@00P4100005@000`40 00020008Y`VW2JL9Y`4;Y`0@0@RW2:L8Y`RW2:L8Y`RW0CX80P403jL8Y`RW2:L8Y`RW2:L80@0E820@0?2E89DPUB2E89DPUB2E8100/9 00L12JL9Y`VW00D00@4100005@000`40000200082JL9Y`VW2@4:Y`0@0@RW2:L8Y`RW2:L8Y`RW0AD8 4`4E200?0JL8Y`RW2:L8Y`RW2:L100bW00d1Y`VW2JL9Y`VW2JL100/901012E89DPUB2E89DPUB2E81 558D0AAB01012E89DPUB2E89DPUB2E812PT01`6W2JL9Y`T01@010@40000E00030@00008000RW2JL9 Y`VW0@ZW0101Y`RW2:L8Y`RW2:L8Y`P14`P20@0C200800P0200800P0200800P020020A<800l12:L8 Y`RW2:L8Y`RW20403:L03@49Y`VW2JL9Y`VW2@402`T0405B2E89DPUB2E89DPUB2@4BDP8101=B0E81 DP5B0E81DP5B0E81DP5B00<14U80405B2E89DPUB2E89DPUB2@4:2@070@VW2JL9Y`0500410@0001D0 00<100000P0020VW2JL9Y`T12ZL03`48Y`RW2:L8Y`RW2:L80@0B208101L0200800P0200800P02008 00P0200800020A8800l12:L8Y`RW2:L8Y`RW20402jL03@6W2JL9Y`VW2JL9Y`402PT0405B2E89DPUB 2E89DPUB2@4ADP<101MB0E81DP5B0E81DP5B0E81DP5B0E81DP020A5B0101DPUB2E89DPUB2E89DPT1 2@T01`6W2JL9Y`T01@010@40000E00030@00008000RW2JL9Y`VW0@VW00l12:L8Y`RW2:L8Y`RW2040 4@P20@0K200800P0200800P0200800P0200800P0200800814@P03P48Y`RW2:L8Y`RW2:L12jL03@49 Y`VW2JL9Y`VW2@402PT03`49DPUB2E89DPUB2E890@0@DP8101]B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E800`4@DP0?0E89DPUB2E89DPUB2E8100T900L12JL9Y`VW00D00@4100005@000`4000020007 2JL9Y`VW0@0:Y`0?0JL8Y`RW2:L8Y`RW2:L100l80P407`0800P0200800P0200800P0200800P02008 00P020000P4?200>0JL8Y`RW2:L8Y`RW204;Y`0<0JL9Y`VW2JL9Y`T12`T03`5B2E89DPUB2E89DPUB 0@0>DP<101mB0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B00813U803`49DPUB2E89DPUB2E89 0@0:2@060@VW2JL91@010@40000E00030@00008000NW2JL9Y`T100ZW00h12:L8Y`RW2:L8Y`RW0@h8 0P4090P0200800P0200800P0200800P0200800P0200800P020080@l800h1Y`RW2:L8Y`RW2:L80@ZW 00`12JL9Y`VW2JL9Y`4:2@0?0E89DPUB2E89DPUB2E8100iB02@1DP5B0E81DP5B0E81DP5B0E81DP5B 0E81DP5B0E81DP5B0E820@iB00h12E89DPUB2E89DPUB0@X900H1Y`VW2JL500410@0001D000<10000 0P001`VW2JL9Y`402ZL03@6W2:L8Y`RW2:L8Y`403@P20@0V00P0200800P0200800P0200800P02008 00P0200800P0200800P20@d800h12:L8Y`RW2:L8Y`RW0@ZW00`1Y`VW2JL9Y`VW2@4:2@0>0@UB2E89 DPUB2E89DP4=DP8102EB0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B00<13E803P49 DPUB2E89DPUB2E812@T01P49Y`VW2@D00@4100005@000`4000020007Y`VW2JL90@09Y`0>0JL8Y`RW 2:L8Y`RW204;208102X800P0200800P0200800P0200800P0200800P0200800P0200800P020020@`8 00d12:L8Y`RW2:L8Y`P100ZW00`12JL9Y`VW2JL9Y`4:2@0>0E89DPUB2E89DPUB2@4;DP<102UB0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP020@]B00h1DPUB2E89DPUB2E890@T9 00H1Y`VW2JL500410@0001D000<100000P001`VW2JL9Y`402JL03@48Y`RW2:L8Y`RW20402PP20@0^ 00P0200800P0200800P0200800P0200800P0200800P0200800P0200800P020812`P03@48Y`RW2:L8 Y`RW20402JL0306W2JL9Y`VW2JL90@T900h1DPUB2E89DPUB2E890@YB0P40;E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP030@YB00d1DPUB2E89DPUB2E8100T900H12JL9 Y`T500410@0001D000<100000P001jL9Y`VW2@402JL0306W2:L8Y`RW2:L80@T80P40040200800P0200800P0 200800P0200800P0200800P0200800P0200800P0200800P0200800P12@P0306W2:L8Y`RW2:L80@ZW 00/12JL9Y`VW2JL90@092@0<0E89DPUB2E89DPT12E80=P5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B 0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP812E80305B2E89DPUB2E890@P900H12JL9Y`T40081 0@0001D000<100000P001jL9Y`VW2@402JL02`6W2:L8Y`RW2:L100T803T1200800P0200800P02008 00P0200800P0200800P0200800P0200800P0200800P0200800P020402@P0306W2:L8Y`RW2:L80@VW 00/1Y`VW2JL9Y`VW0@082@0=0E89DPUB2E89DPUB0@09DP8103EB0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP020@QB00`12E89DPUB2E89DP482@060JL9Y`VW 1@010@40000E00030@00008000L9Y`VW2JL100RW00/1Y`RW2:L8Y`RW0@09200D0@P0200800P02008 00P0200800PC0@0C200800P0200800P0200800P00@09200<0@RW2:L8Y`RW2:L12JL02`49Y`VW2JL9 Y`T100P900`12E89DPUB2E89DP49DP81015B0E81DP5B0E81DP5B0E81DP0E0@0BDP5B0E81DP5B0E81 DP5B0E812E802`49DPUB2E89DPT100P900H12JL9Y`T500410@0001D000<100000P001jL9Y`VW2@40 2:L02P48Y`RW2:L8Y`4:200D0@0800P0200800P0200800P0204C000D0@P0200800P0200800P02008 0049200;0@RW2:L8Y`RW20402JL02`6W2JL9Y`VW2JL100P900/1DPUB2E89DPUB0@0:DP0B0E81DP5B 0E81DP5B0E81DP5B5`404U81DP5B0E81DP5B0E81DP5B0@UB00/12E89DPUB2E890@072@060JL9Y`VW 1@010@40000E00030@00008000H9Y`VW2@49Y`0:0JL8Y`RW2:L80@T801@100P0200800P0200800P0 20080AD001<1200800P0200800P0200800P100T800`1Y`RW2:L8Y`RW2048Y`0:0@VW2JL9Y`VW0@P9 00`1DPUB2E89DPUB2@49DP0B0E81DP5B0E81DP5B0E81DP5B6@403e81DP5B0E81DP5B0E81DP020@UB 00/1DPUB2E89DPUB0@082@050JL9Y`T01@010@40000E00030@00008000JW2JL9Y`49Y`090@RW2:L8 Y`P100X801<1200800P0200800P0200800P101L001<1200800P0200800P0200800P100T800/1Y`RW 2:L8Y`RW0@08Y`0:0JL9Y`VW2JL90@P900/12E89DPUB2E890@0:DP8100mB0E81DP5B0E81DP5B0E80 6`403e81DP5B0E81DP5B0E81DP020@UB00X1DPUB2E89DPT120T01@49Y`VW00D00@4100005@000`40 000200062JL9Y`T12:L02@48Y`RW2:L80@0:200C0@P0200800P0200800P020080@0I000B0@P02008 00P0200800P020012PP02P6W2:L8Y`RW2048Y`0:0@VW2JL9Y`VW0@P900X1DPUB2E89DPT12U820@0? DP5B0E81DP5B0E81DP5B01d1011B0E81DP5B0E81DP5B0E812U802@5B2E89DPUB0@082@050JL9Y`T0 1@010@40000E00030@00008000JW2JL9Y`48Y`090JL8Y`RW2:L100X8018100P0200800P0200800P0 204K000B0@P0200800P0200800P020012@P02`48Y`RW2:L8Y`P100NW00X1Y`VW2JL9Y`T11`T02`5B 2E89DPUB2E8100YB0101DP5B0E81DP5B0E81DP5B7`404581DP5B0E81DP5B0E81DP49DP0:0@UB2E89 DPUB0@L900D12JL9Y`0500410@0001D000<100000P001PVW2JL90@RW00P12:L8Y`RW0@X8018100P0 200800P0200800P0204M000A0@P0200800P0200800P020402PP02P48Y`RW2:L8Y`47Y`0:0@VW2JL9 Y`VW0@L900X12E89DPUB2E812U80405B0E81DP5B0E81DP5B0E8Q0@0=DP5B0E81DP5B0E81DP020@YB 00T12E89DPUB2@401`T01@6W2JL900D00@4100005@000`4000020006Y`VW2JL12:L0206W2:L8Y`P1 2PP04P4800P0200800P0200800P00Ad0014100P0200800P0200800P00@0:200:0JL8Y`RW2:L80@NW 00X1Y`VW2JL9Y`T11`T02P5B2E89DPUB2@4:DP8100eB0E81DP5B0E81DP5B0241011B0E81DP5B0E81 DP5B0E812U802@5B2E89DPUB0@072@050@VW2JL01@010@40000E00030@00008000H9Y`VW2@48Y`08 0@RW2:L8Y`4:200A0@0800P0200800P0200800407`004@40200800P0200800P0200100T800X12:L8 Y`RW2:L11jL02P49Y`VW2JL9Y`472@0:0@UB2E89DPUB0@YB00h1DP5B0E81DP5B0E81DR<100eB0E81 DP5B0E81DP5B00812U802@49DPUB2E890@072@050JL9Y`T01@010@40000E00030@00008000JW2JL9 Y`48Y`080JL8Y`RW2049200B0@0800P0200800P0200800P17`004@4800P0200800P0200800P100T8 00X1Y`RW2:L8Y`P11jL02P6W2JL9Y`VW2@472@0:0E89DPUB2E890@UB0101DP5B0E81DP5B0E81DP5B 8`403E81DP5B0E81DP5B0E800P49DP090E89DPUB2E8100L900D12JL9Y`0500410@0001D000<10000 0P001PVW2JL90@RW00P12:L8Y`RW0@T80141200800P0200800P020080@0Q000@0@P0200800P02008 00P00@T800X12:L8Y`RW2:L11jL02P49Y`VW2JL9Y`472@0:0@UB2E89DPUB0@UB0P403E81DP5B0E81 DP5B0E809@403U81DP5B0E81DP5B0E812E802@49DPUB2E890@072@050JL9Y`T01@010@40000E0081 0`001ZL9Y`VW0@RW00L1Y`RW2:L100X8014100P0200800P0200800P00@0Q000@0@0800P0200800P0 20080@X800T12:L8Y`RW20401jL02P6W2JL9Y`VW2@472@090E89DPUB2E8100YB00h1DP5B0E81DP5B 0E81DRD100eB0E81DP5B0E81DP5B00812U802049DPUB2E811`T01@49Y`VW00@00P4100005@000`40 000200062JL9Y`T12:L01`48Y`RW20402PP0404800P0200800P02008004S000@0@0800P0200800P0 20080@T800T1Y`RW2:L8Y`401jL02P49Y`VW2JL9Y`472@090@UB2E89DPT100YB0P402e81DP5B0E81 DP5B02L100iB0E81DP5B0E81DP5B0@YB00P1DPUB2E890@L900D1Y`VW2@0500410@0001D000<10000 0P001ZL9Y`VW0@RW00L1Y`RW2:L100T80141200800P0200800P020080@0S000@0@P0200800P02008 00P00@T800T12:L8Y`RW20401jL02P6W2JL9Y`VW2@472@090E89DPUB2E8100UB0P403E81DP5B0E81 DP5B0E809`403U81DP5B0E81DP5B0E812E802049DPUB2E811`T01@49Y`VW00D00@4100005@000`40 000200062JL9Y`T12:L01`48Y`RW20402@P04040200800P0200800P0204U000?0@P0200800P02008 00P100T800T1Y`RW2:L8Y`401jL02P49Y`VW2JL9Y`472@090@UB2E89DPT100UB00h1DP5B0E81DP5B 0E81DRT100]B0E81DP5B0E81DP020@UB00P1DPUB2E890@L900D1Y`VW2@0500410@0001D000<10000 0P001ZL9Y`VW0@RW00L1Y`RW2:L100T80101200800P0200800P020019@004040200800P0200800P0 2048200:0@RW2:L8Y`RW0@NW00T12JL9Y`VW2@401`T02@5B2E89DPUB0@09DP8100]B0E81DP5B0E81 DP0Y0@0>DP5B0E81DP5B0E81DP49DP090@UB2E89DPT100H900D12JL9Y`0500410@0001D000<10000 0P001PVW2JL90@NW00P1Y`RW2:L80@T800l100P0200800P0200800409P00404800P0200800P02008 0048200:0JL8Y`RW2:L80@NW00P1Y`VW2JL90@L900X1DPUB2E89DPT12E803P5B0E81DP5B0E81DP5B :@402e81DP5B0E81DP5B00812E802@5B2E89DPUB0@062@050JL9Y`T01@010@40000E00030@000080 00JW2JL9Y`47Y`080@RW2:L8Y`49200?0@P0200800P0200800P102L000l1200800P0200800P02040 20P02P48Y`RW2:L8Y`47Y`080@VW2JL9Y`472@0:0@UB2E89DPUB0@UB0P402e81DP5B0E81DP5B02/1 00aB0E81DP5B0E81DP49DP090@UB2E89DPT100H900D12JL9Y`0500410@0001D000<100000P001PVW 2JL90@NW00P1Y`RW2:L80@P800l1200800P0200800P02040:0003`40200800P0200800P00@08200: 0JL8Y`RW2:L80@NW00P1Y`VW2JL90@L900X1DPUB2E89DPT125820@0;DP5B0E81DP5B0E80:`403U81 DP5B0E81DP5B0E8125802@5B2E89DPUB0@062@050JL9Y`T01@010@40000E00030@00008000JW2JL9 Y`47Y`080@RW2:L8Y`48200?0@0800P0200800P0200102T000l100P0200800P0200800401`P02P48 Y`RW2:L8Y`47Y`080@VW2JL9Y`472@0:0@UB2E89DPUB0@QB00`1DP5B0E81DP5B0E8]0@0;DP5B0E81 DP5B0E800P48DP090@UB2E89DPT100H900D12JL9Y`0500410@0001D000<100000P001PVW2JL90@NW 00L1Y`RW2:L100T800h1200800P0200800P00BX000l1200800P0200800P0204020P02@48Y`RW2:L8 0@07Y`080JL9Y`VW2@472@090E89DPUB2E8100UB0P402e81DP5B0E81DP5B02d100aB0E81DP5B0E81 DP49DP080@UB2E89DP462@050JL9Y`T01@010@40000E00030@00008000JW2JL9Y`47Y`070@RW2:L8 0@09200>0@0800P0200800P0204[000>0@P0200800P02008004820090JL8Y`RW2:L100NW00P12JL9 Y`VW0@L900T12E89DPUB2@402E80305B0E81DP5B0E81DRl100UB0E81DP5B0E800P49DP080E89DPUB 2@462@050@VW2JL01@010@40000E00030@00008000H9Y`VW2@47Y`070JL8Y`RW0@08200>0@0800P0 200800P0204/000>0@0800P0200800P0204820090@RW2:L8Y`P100NW00P1Y`VW2JL90@L900T1DPUB 2E89DP402580305B0E81DP5B0E81DRl100]B0E81DP5B0E81DP020@QB00P12E89DPUB0@H900D1Y`VW 2@0500410@0000d0104400030@00008000JW2JL9Y`47Y`070@RW2:L80@08200>0@P0200800P02008 004]000>0@0800P0200800P0204720090JL8Y`RW2:L100NW00P12JL9Y`VW0@L900T12E89DPUB2@40 25820@09DP5B0E81DP5B034100aB0E81DP5B0E81DP48DP080E89DPUB2@462@050@VW2JL01@010@40 000=00030@0000D00P4300062JL9Y`T11jL01`6W2:L8Y`4020P03@40200800P020080040;P003P48 00P0200800P020011`P02@48Y`RW2:L80@07Y`080JL9Y`VW2@472@090E89DPUB2E8100QB00`1DP5B 0E81DP5B0E8a0@09DP5B0E81DP5B008125802049DPUB2E811PT01@6W2JL900@00P4100003P000`40 000400030@000?l01`010@40000?00030@0000<000<10000o`0700410@00010000<100000P000`40 000200030@0003d000<10000?@000`40000l00030@0003d000<100000P010@40000=00040@000@@0 00<100000P000`40000:00030@0000T000<100002P000`40000:00030@0000X000<100002P000`40 000900030@0000X000<100002P000`40000:00030@0000T000<100002P000`40000:00030@0000X0 00<100002@000`40000:00030@0000X000<100002P000`40000:00030@0000T000<100000P010@40 000>00811@3o0@/10@000?l08@000?l08@000?l08@000?l08@000001\ \>"], ImageRangeCache->{{{0, 287}, {287, 0}} -> {-0.207, -0.172242, 0.00783272, 0.00783272}}], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] ContourGraphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ContourPlot[p, {x, 0, 2}, \ {y, 0, 2}]\)], "Input"], Cell[GraphicsData["PostScript", "\<\ %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart /Mabs { Mgmatrix idtransform Mtmatrix dtransform } bind def /Mabsadd { Mabs 3 -1 roll add 3 1 roll add exch } bind def %% ContourGraphics %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10 scalefont setfont % Scaling calculations 0.0192308 0.480769 0.0192308 0.480769 [ [.01923 -0.0125 -3 -9 ] [.01923 -0.0125 3 0 ] [.25962 -0.0125 -9 -9 ] [.25962 -0.0125 9 0 ] [.5 -0.0125 -3 -9 ] [.5 -0.0125 3 0 ] [.74038 -0.0125 -9 -9 ] [.74038 -0.0125 9 0 ] [.98077 -0.0125 -3 -9 ] [.98077 -0.0125 3 0 ] [ 0 0 -0.125 0 ] [-0.0125 .01923 -6 -4.5 ] [-0.0125 .01923 0 4.5 ] [-0.0125 .25962 -18 -4.5 ] [-0.0125 .25962 0 4.5 ] [-0.0125 .5 -6 -4.5 ] [-0.0125 .5 0 4.5 ] [-0.0125 .74038 -18 -4.5 ] [-0.0125 .74038 0 4.5 ] [-0.0125 .98077 -6 -4.5 ] [-0.0125 .98077 0 4.5 ] [ 0 0 -0.125 0 ] [ 0 1 .125 0 ] [ 1 0 .125 0 ] [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath 0 g .25 Mabswid .01923 0 m .01923 .00625 L s [(0)] .01923 -0.0125 0 1 Mshowa .25962 0 m .25962 .00625 L s [(0.5)] .25962 -0.0125 0 1 Mshowa .5 0 m .5 .00625 L s [(1)] .5 -0.0125 0 1 Mshowa .74038 0 m .74038 .00625 L s [(1.5)] .74038 -0.0125 0 1 Mshowa .98077 0 m .98077 .00625 L s [(2)] .98077 -0.0125 0 1 Mshowa .125 Mabswid .06731 0 m .06731 .00375 L s .11538 0 m .11538 .00375 L s .16346 0 m .16346 .00375 L s .21154 0 m .21154 .00375 L s .30769 0 m .30769 .00375 L s .35577 0 m .35577 .00375 L s .40385 0 m .40385 .00375 L s .45192 0 m .45192 .00375 L s .54808 0 m .54808 .00375 L s .59615 0 m .59615 .00375 L s .64423 0 m .64423 .00375 L s .69231 0 m .69231 .00375 L s .78846 0 m .78846 .00375 L s .83654 0 m .83654 .00375 L s .88462 0 m .88462 .00375 L s .93269 0 m .93269 .00375 L s .25 Mabswid 0 0 m 1 0 L s 0 .01923 m .00625 .01923 L s [(0)] -0.0125 .01923 1 0 Mshowa 0 .25962 m .00625 .25962 L s [(0.5)] -0.0125 .25962 1 0 Mshowa 0 .5 m .00625 .5 L s [(1)] -0.0125 .5 1 0 Mshowa 0 .74038 m .00625 .74038 L s [(1.5)] -0.0125 .74038 1 0 Mshowa 0 .98077 m .00625 .98077 L s [(2)] -0.0125 .98077 1 0 Mshowa .125 Mabswid 0 .06731 m .00375 .06731 L s 0 .11538 m .00375 .11538 L s 0 .16346 m .00375 .16346 L s 0 .21154 m .00375 .21154 L s 0 .30769 m .00375 .30769 L s 0 .35577 m .00375 .35577 L s 0 .40385 m .00375 .40385 L s 0 .45192 m .00375 .45192 L s 0 .54808 m .00375 .54808 L s 0 .59615 m .00375 .59615 L s 0 .64423 m .00375 .64423 L s 0 .69231 m .00375 .69231 L s 0 .78846 m .00375 .78846 L s 0 .83654 m .00375 .83654 L s 0 .88462 m .00375 .88462 L s 0 .93269 m .00375 .93269 L s .25 Mabswid 0 0 m 0 1 L s .01923 .99375 m .01923 1 L s .25962 .99375 m .25962 1 L s .5 .99375 m .5 1 L s .74038 .99375 m .74038 1 L s .98077 .99375 m .98077 1 L s .125 Mabswid .06731 .99625 m .06731 1 L s .11538 .99625 m .11538 1 L s .16346 .99625 m .16346 1 L s .21154 .99625 m .21154 1 L s .30769 .99625 m .30769 1 L s .35577 .99625 m .35577 1 L s .40385 .99625 m .40385 1 L s .45192 .99625 m .45192 1 L s .54808 .99625 m .54808 1 L s .59615 .99625 m .59615 1 L s .64423 .99625 m .64423 1 L s .69231 .99625 m .69231 1 L s .78846 .99625 m .78846 1 L s .83654 .99625 m .83654 1 L s .88462 .99625 m .88462 1 L s .93269 .99625 m .93269 1 L s .25 Mabswid 0 1 m 1 1 L s .99375 .01923 m 1 .01923 L s .99375 .25962 m 1 .25962 L s .99375 .5 m 1 .5 L s .99375 .74038 m 1 .74038 L s .99375 .98077 m 1 .98077 L s .125 Mabswid .99625 .06731 m 1 .06731 L s .99625 .11538 m 1 .11538 L s .99625 .16346 m 1 .16346 L s .99625 .21154 m 1 .21154 L s .99625 .30769 m 1 .30769 L s .99625 .35577 m 1 .35577 L s .99625 .40385 m 1 .40385 L s .99625 .45192 m 1 .45192 L s .99625 .54808 m 1 .54808 L s .99625 .59615 m 1 .59615 L s .99625 .64423 m 1 .64423 L s .99625 .69231 m 1 .69231 L s .99625 .78846 m 1 .78846 L s .99625 .83654 m 1 .83654 L s .99625 .88462 m 1 .88462 L s .99625 .93269 m 1 .93269 L s .25 Mabswid 1 0 m 1 1 L s 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath .5 g .01923 .98077 m .98077 .98077 L .98077 .01923 L .01923 .01923 L F 0 g .5 Mabswid .4 g .01923 .20178 m .08791 .16652 L .10274 .15659 L .15659 .10274 L .16652 .08791 L .20178 .01923 L .01923 .01923 L F 0 g .01923 .20178 m .08791 .16652 L .10274 .15659 L .15659 .10274 L .16652 .08791 L .20178 .01923 L s .4 g .01923 .68255 m .08791 .64729 L .10274 .63736 L .15659 .58351 L .16652 .56868 L .20178 .5 L .16652 .43132 L .15659 .41649 L .10274 .36264 L .08791 .35271 L .01923 .31745 L F 0 g .01923 .68255 m .08791 .64729 L .10274 .63736 L .15659 .58351 L .16652 .56868 L .20178 .5 L .16652 .43132 L .15659 .41649 L .10274 .36264 L .08791 .35271 L .01923 .31745 L s .4 g .01923 .79822 m .08791 .83348 L .10274 .84341 L .15659 .89726 L .16652 .91209 L .20178 .98077 L .01923 .98077 L F 0 g .01923 .79822 m .08791 .83348 L .10274 .84341 L .15659 .89726 L .16652 .91209 L .20178 .98077 L s .3 g .01923 .16767 m .04817 .15659 L .08791 .14179 L .14179 .08791 L .15659 .04817 L .16767 .01923 L .01923 .01923 L F 0 g .01923 .16767 m .04817 .15659 L .08791 .14179 L .14179 .08791 L .15659 .04817 L .16767 .01923 L s .3 g .01923 .64844 m .04817 .63736 L .08791 .62256 L .14179 .56868 L .15659 .53811 L .16767 .5 L .15659 .46189 L .14179 .43132 L .08791 .37744 L .04817 .36264 L .01923 .35156 L F 0 g .01923 .64844 m .04817 .63736 L .08791 .62256 L .14179 .56868 L .15659 .53811 L .16767 .5 L .15659 .46189 L .14179 .43132 L .08791 .37744 L .04817 .36264 L .01923 .35156 L s .3 g .01923 .83233 m .04817 .84341 L .08791 .85821 L .14179 .91209 L .15659 .95183 L .16767 .98077 L .01923 .98077 L F 0 g .01923 .83233 m .04817 .84341 L .08791 .85821 L .14179 .91209 L .15659 .95183 L .16767 .98077 L s .2 g .01923 .14263 m .08791 .11498 L .11498 .08791 L .14263 .01923 L .01923 .01923 L F 0 g .01923 .14263 m .08791 .11498 L .11498 .08791 L .14263 .01923 L s .2 g .01923 .6234 m .08791 .59574 L .11498 .56868 L .14263 .5 L .11498 .43132 L .08791 .40426 L .01923 .3766 L F 0 g .01923 .6234 m .08791 .59574 L .11498 .56868 L .14263 .5 L .11498 .43132 L .08791 .40426 L .01923 .3766 L s .2 g .01923 .85737 m .08791 .88502 L .11498 .91209 L .14263 .98077 L .01923 .98077 L F 0 g .01923 .85737 m .08791 .88502 L .11498 .91209 L .14263 .98077 L s .1 g .01923 .11622 m .06971 .08791 L .08791 .06971 L .11622 .01923 L .01923 .01923 L F 0 g .01923 .11622 m .06971 .08791 L .08791 .06971 L .11622 .01923 L s .1 g .01923 .59699 m .06971 .56868 L .08791 .55491 L .11622 .5 L .08791 .44509 L .06971 .43132 L .01923 .40301 L F 0 g .01923 .59699 m .06971 .56868 L .08791 .55491 L .11622 .5 L .08791 .44509 L .06971 .43132 L .01923 .40301 L s .1 g .01923 .88378 m .06971 .91209 L .08791 .93029 L .11622 .98077 L .01923 .98077 L F 0 g .01923 .88378 m .06971 .91209 L .08791 .93029 L .11622 .98077 L s .01923 .07191 m .07191 .01923 L .01923 .01923 L F .01923 .07191 m .07191 .01923 L s .01923 .55656 m .07191 .5 L .01923 .44344 L F .01923 .55656 m .07191 .5 L .01923 .44344 L s .01923 .92809 m .07191 .98077 L .01923 .98077 L F .01923 .92809 m .07191 .98077 L s .6 g .22527 .54531 m .29396 .54531 L .31893 .56868 L .36264 .61483 L .38517 .63736 L .43132 .68107 L .45469 .70604 L .45469 .77473 L .43132 .7997 L .38517 .84341 L .36264 .86594 L .31893 .91209 L .29396 .94288 L .22527 .94288 L .2003 .91209 L .15659 .86594 L .13406 .84341 L .08791 .7997 L .05712 .77473 L .05712 .70604 L .08791 .68107 L .13406 .63736 L .15659 .61483 L .2003 .56868 L F 0 g .22527 .54531 m .29396 .54531 L .31893 .56868 L .36264 .61483 L .38517 .63736 L .43132 .68107 L .45469 .70604 L .45469 .77473 L .43132 .7997 L .38517 .84341 L .36264 .86594 L .31893 .91209 L .29396 .94288 L .22527 .94288 L .2003 .91209 L .15659 .86594 L .13406 .84341 L .08791 .7997 L .05712 .77473 L .05712 .70604 L .08791 .68107 L .13406 .63736 L .15659 .61483 L .2003 .56868 L .22527 .54531 L s .6 g .22527 .05712 m .29396 .05712 L .31893 .08791 L .36264 .13406 L .38517 .15659 L .43132 .2003 L .45469 .22527 L .45469 .29396 L .43132 .31893 L .38517 .36264 L .36264 .38517 L .31893 .43132 L .29396 .45469 L .22527 .45469 L .2003 .43132 L .15659 .38517 L .13406 .36264 L .08791 .31893 L .05712 .29396 L .05712 .22527 L .08791 .2003 L .13406 .15659 L .15659 .13406 L .2003 .08791 L F 0 g .22527 .05712 m .29396 .05712 L .31893 .08791 L .36264 .13406 L .38517 .15659 L .43132 .2003 L .45469 .22527 L .45469 .29396 L .43132 .31893 L .38517 .36264 L .36264 .38517 L .31893 .43132 L .29396 .45469 L .22527 .45469 L .2003 .43132 L .15659 .38517 L .13406 .36264 L .08791 .31893 L .05712 .29396 L .05712 .22527 L .08791 .2003 L .13406 .15659 L .15659 .13406 L .2003 .08791 L .22527 .05712 L s .7 g .22527 .58861 m .29396 .58861 L .36261 .63736 L .36264 .63739 L .41139 .70604 L .41139 .77473 L .36264 .84338 L .36261 .84341 L .29396 .89216 L .22527 .89216 L .15662 .84341 L .15659 .84338 L .10784 .77473 L .10784 .70604 L .15659 .63739 L .15662 .63736 L F 0 g .22527 .58861 m .29396 .58861 L .36261 .63736 L .36264 .63739 L .41139 .70604 L .41139 .77473 L .36264 .84338 L .36261 .84341 L .29396 .89216 L .22527 .89216 L .15662 .84341 L .15659 .84338 L .10784 .77473 L .10784 .70604 L .15659 .63739 L .15662 .63736 L .22527 .58861 L s .7 g .22527 .10784 m .29396 .10784 L .36261 .15659 L .36264 .15662 L .41139 .22527 L .41139 .29396 L .36264 .36261 L .36261 .36264 L .29396 .41139 L .22527 .41139 L .15662 .36264 L .15659 .36261 L .10784 .29396 L .10784 .22527 L .15659 .15662 L .15662 .15659 L F 0 g .22527 .10784 m .29396 .10784 L .36261 .15659 L .36264 .15662 L .41139 .22527 L .41139 .29396 L .36264 .36261 L .36261 .36264 L .29396 .41139 L .22527 .41139 L .15662 .36264 L .15659 .36261 L .10784 .29396 L .10784 .22527 L .15659 .15662 L .15662 .15659 L .22527 .10784 L s .8 g .22527 .61796 m .29396 .61796 L .3311 .63736 L .36264 .6689 L .38204 .70604 L .38204 .77473 L .36264 .81187 L .3311 .84341 L .29396 .86281 L .22527 .86281 L .18813 .84341 L .15659 .81187 L .13719 .77473 L .13719 .70604 L .15659 .6689 L .18813 .63736 L F 0 g .22527 .61796 m .29396 .61796 L .3311 .63736 L .36264 .6689 L .38204 .70604 L .38204 .77473 L .36264 .81187 L .3311 .84341 L .29396 .86281 L .22527 .86281 L .18813 .84341 L .15659 .81187 L .13719 .77473 L .13719 .70604 L .15659 .6689 L .18813 .63736 L .22527 .61796 L s .8 g .22527 .13719 m .29396 .13719 L .3311 .15659 L .36264 .18813 L .38204 .22527 L .38204 .29396 L .36264 .3311 L .3311 .36264 L .29396 .38204 L .22527 .38204 L .18813 .36264 L .15659 .3311 L .13719 .29396 L .13719 .22527 L .15659 .18813 L .18813 .15659 L F 0 g .22527 .13719 m .29396 .13719 L .3311 .15659 L .36264 .18813 L .38204 .22527 L .38204 .29396 L .36264 .3311 L .3311 .36264 L .29396 .38204 L .22527 .38204 L .18813 .36264 L .15659 .3311 L .13719 .29396 L .13719 .22527 L .15659 .18813 L .18813 .15659 L .22527 .13719 L s .9 g .22527 .64125 m .29396 .64125 L .35875 .70604 L .35875 .77473 L .29396 .83952 L .22527 .83952 L .16048 .77473 L .16048 .70604 L F 0 g .22527 .64125 m .29396 .64125 L .35875 .70604 L .35875 .77473 L .29396 .83952 L .22527 .83952 L .16048 .77473 L .16048 .70604 L .22527 .64125 L s .9 g .22527 .16048 m .29396 .16048 L .35875 .22527 L .35875 .29396 L .29396 .35875 L .22527 .35875 L .16048 .29396 L .16048 .22527 L F 0 g .22527 .16048 m .29396 .16048 L .35875 .22527 L .35875 .29396 L .29396 .35875 L .22527 .35875 L .16048 .29396 L .16048 .22527 L .22527 .16048 L s 1 g .22527 .67353 m .29396 .67353 L .32647 .70604 L .32647 .77473 L .29396 .80724 L .22527 .80724 L .19276 .77473 L .19276 .70604 L F 0 g .22527 .67353 m .29396 .67353 L .32647 .70604 L .32647 .77473 L .29396 .80724 L .22527 .80724 L .19276 .77473 L .19276 .70604 L .22527 .67353 L s 1 g .22527 .19276 m .29396 .19276 L .32647 .22527 L .32647 .29396 L .29396 .32647 L .22527 .32647 L .19276 .29396 L .19276 .22527 L F 0 g .22527 .19276 m .29396 .19276 L .32647 .22527 L .32647 .29396 L .29396 .32647 L .22527 .32647 L .19276 .29396 L .19276 .22527 L .22527 .19276 L s .4 g .68255 .01923 m .64729 .08791 L .63736 .10274 L .58351 .15659 L .56868 .16652 L .5 .20178 L .43132 .16652 L .41649 .15659 L .36264 .10274 L .35271 .08791 L .31745 .01923 L F 0 g .68255 .01923 m .64729 .08791 L .63736 .10274 L .58351 .15659 L .56868 .16652 L .5 .20178 L .43132 .16652 L .41649 .15659 L .36264 .10274 L .35271 .08791 L .31745 .01923 L s .4 g .43132 .35271 m .5 .31745 L .56868 .35271 L .58351 .36264 L .63736 .41649 L .64729 .43132 L .68255 .5 L .64729 .56868 L .63736 .58351 L .58351 .63736 L .56868 .64729 L .5 .68255 L .43132 .64729 L .41649 .63736 L .36264 .58351 L .35271 .56868 L .31745 .5 L .35271 .43132 L .36264 .41649 L .41649 .36264 L F 0 g .43132 .35271 m .5 .31745 L .56868 .35271 L .58351 .36264 L .63736 .41649 L .64729 .43132 L .68255 .5 L .64729 .56868 L .63736 .58351 L .58351 .63736 L .56868 .64729 L .5 .68255 L .43132 .64729 L .41649 .63736 L .36264 .58351 L .35271 .56868 L .31745 .5 L .35271 .43132 L .36264 .41649 L .41649 .36264 L .43132 .35271 L s .4 g .68255 .98077 m .64729 .91209 L .63736 .89726 L .58351 .84341 L .56868 .83348 L .5 .79822 L .43132 .83348 L .41649 .84341 L .36264 .89726 L .35271 .91209 L .31745 .98077 L F 0 g .68255 .98077 m .64729 .91209 L .63736 .89726 L .58351 .84341 L .56868 .83348 L .5 .79822 L .43132 .83348 L .41649 .84341 L .36264 .89726 L .35271 .91209 L .31745 .98077 L s .3 g .64844 .01923 m .63736 .04817 L .62256 .08791 L .56868 .14179 L .53811 .15659 L .5 .16767 L .46189 .15659 L .43132 .14179 L .37744 .08791 L .36264 .04817 L .35156 .01923 L F 0 g .64844 .01923 m .63736 .04817 L .62256 .08791 L .56868 .14179 L .53811 .15659 L .5 .16767 L .46189 .15659 L .43132 .14179 L .37744 .08791 L .36264 .04817 L .35156 .01923 L s .3 g .5 .35156 m .53811 .36264 L .56868 .37744 L .62256 .43132 L .63736 .46189 L .64844 .5 L .63736 .53811 L .62256 .56868 L .56868 .62256 L .53811 .63736 L .5 .64844 L .46189 .63736 L .43132 .62256 L .37744 .56868 L .36264 .53811 L .35156 .5 L .36264 .46189 L .37744 .43132 L .43132 .37744 L .46189 .36264 L F 0 g .5 .35156 m .53811 .36264 L .56868 .37744 L .62256 .43132 L .63736 .46189 L .64844 .5 L .63736 .53811 L .62256 .56868 L .56868 .62256 L .53811 .63736 L .5 .64844 L .46189 .63736 L .43132 .62256 L .37744 .56868 L .36264 .53811 L .35156 .5 L .36264 .46189 L .37744 .43132 L .43132 .37744 L .46189 .36264 L .5 .35156 L s .3 g .64844 .98077 m .63736 .95183 L .62256 .91209 L .56868 .85821 L .53811 .84341 L .5 .83233 L .46189 .84341 L .43132 .85821 L .37744 .91209 L .36264 .95183 L .35156 .98077 L F 0 g .64844 .98077 m .63736 .95183 L .62256 .91209 L .56868 .85821 L .53811 .84341 L .5 .83233 L .46189 .84341 L .43132 .85821 L .37744 .91209 L .36264 .95183 L .35156 .98077 L s .2 g .6234 .01923 m .59574 .08791 L .56868 .11498 L .5 .14263 L .43132 .11498 L .40426 .08791 L .3766 .01923 L F 0 g .6234 .01923 m .59574 .08791 L .56868 .11498 L .5 .14263 L .43132 .11498 L .40426 .08791 L .3766 .01923 L s .2 g .43132 .40426 m .5 .3766 L .56868 .40426 L .59574 .43132 L .6234 .5 L .59574 .56868 L .56868 .59574 L .5 .6234 L .43132 .59574 L .40426 .56868 L .3766 .5 L .40426 .43132 L F 0 g .43132 .40426 m .5 .3766 L .56868 .40426 L .59574 .43132 L .6234 .5 L .59574 .56868 L .56868 .59574 L .5 .6234 L .43132 .59574 L .40426 .56868 L .3766 .5 L .40426 .43132 L .43132 .40426 L s .2 g .6234 .98077 m .59574 .91209 L .56868 .88502 L .5 .85737 L .43132 .88502 L .40426 .91209 L .3766 .98077 L F 0 g .6234 .98077 m .59574 .91209 L .56868 .88502 L .5 .85737 L .43132 .88502 L .40426 .91209 L .3766 .98077 L s .1 g .59699 .01923 m .56868 .06971 L .55491 .08791 L .5 .11622 L .44509 .08791 L .43132 .06971 L .40301 .01923 L F 0 g .59699 .01923 m .56868 .06971 L .55491 .08791 L .5 .11622 L .44509 .08791 L .43132 .06971 L .40301 .01923 L s .1 g .5 .40301 m .55491 .43132 L .56868 .44509 L .59699 .5 L .56868 .55491 L .55491 .56868 L .5 .59699 L .44509 .56868 L .43132 .55491 L .40301 .5 L .43132 .44509 L .44509 .43132 L F 0 g .5 .40301 m .55491 .43132 L .56868 .44509 L .59699 .5 L .56868 .55491 L .55491 .56868 L .5 .59699 L .44509 .56868 L .43132 .55491 L .40301 .5 L .43132 .44509 L .44509 .43132 L .5 .40301 L s .1 g .59699 .98077 m .56868 .93029 L .55491 .91209 L .5 .88378 L .44509 .91209 L .43132 .93029 L .40301 .98077 L F 0 g .59699 .98077 m .56868 .93029 L .55491 .91209 L .5 .88378 L .44509 .91209 L .43132 .93029 L .40301 .98077 L s .55656 .01923 m .5 .07191 L .44344 .01923 L F .55656 .01923 m .5 .07191 L .44344 .01923 L s .5 .44344 m .55656 .5 L .5 .55656 L .44344 .5 L F .5 .44344 m .55656 .5 L .5 .55656 L .44344 .5 L .5 .44344 L s .55656 .98077 m .5 .92809 L .44344 .98077 L F .55656 .98077 m .5 .92809 L .44344 .98077 L s .6 g .70604 .54531 m .77473 .54531 L .7997 .56868 L .84341 .61483 L .86594 .63736 L .91209 .68107 L .94288 .70604 L .94288 .77473 L .91209 .7997 L .86594 .84341 L .84341 .86594 L .7997 .91209 L .77473 .94288 L .70604 .94288 L .68107 .91209 L .63736 .86594 L .61483 .84341 L .56868 .7997 L .54531 .77473 L .54531 .70604 L .56868 .68107 L .61483 .63736 L .63736 .61483 L .68107 .56868 L F 0 g .70604 .54531 m .77473 .54531 L .7997 .56868 L .84341 .61483 L .86594 .63736 L .91209 .68107 L .94288 .70604 L .94288 .77473 L .91209 .7997 L .86594 .84341 L .84341 .86594 L .7997 .91209 L .77473 .94288 L .70604 .94288 L .68107 .91209 L .63736 .86594 L .61483 .84341 L .56868 .7997 L .54531 .77473 L .54531 .70604 L .56868 .68107 L .61483 .63736 L .63736 .61483 L .68107 .56868 L .70604 .54531 L s .6 g .70604 .05712 m .77473 .05712 L .7997 .08791 L .84341 .13406 L .86594 .15659 L .91209 .2003 L .94288 .22527 L .94288 .29396 L .91209 .31893 L .86594 .36264 L .84341 .38517 L .7997 .43132 L .77473 .45469 L .70604 .45469 L .68107 .43132 L .63736 .38517 L .61483 .36264 L .56868 .31893 L .54531 .29396 L .54531 .22527 L .56868 .2003 L .61483 .15659 L .63736 .13406 L .68107 .08791 L F 0 g .70604 .05712 m .77473 .05712 L .7997 .08791 L .84341 .13406 L .86594 .15659 L .91209 .2003 L .94288 .22527 L .94288 .29396 L .91209 .31893 L .86594 .36264 L .84341 .38517 L .7997 .43132 L .77473 .45469 L .70604 .45469 L .68107 .43132 L .63736 .38517 L .61483 .36264 L .56868 .31893 L .54531 .29396 L .54531 .22527 L .56868 .2003 L .61483 .15659 L .63736 .13406 L .68107 .08791 L .70604 .05712 L s .7 g .70604 .58861 m .77473 .58861 L .84338 .63736 L .84341 .63739 L .89216 .70604 L .89216 .77473 L .84341 .84338 L .84338 .84341 L .77473 .89216 L .70604 .89216 L .63739 .84341 L .63736 .84338 L .58861 .77473 L .58861 .70604 L .63736 .63739 L .63739 .63736 L F 0 g .70604 .58861 m .77473 .58861 L .84338 .63736 L .84341 .63739 L .89216 .70604 L .89216 .77473 L .84341 .84338 L .84338 .84341 L .77473 .89216 L .70604 .89216 L .63739 .84341 L .63736 .84338 L .58861 .77473 L .58861 .70604 L .63736 .63739 L .63739 .63736 L .70604 .58861 L s .7 g .70604 .10784 m .77473 .10784 L .84338 .15659 L .84341 .15662 L .89216 .22527 L .89216 .29396 L .84341 .36261 L .84338 .36264 L .77473 .41139 L .70604 .41139 L .63739 .36264 L .63736 .36261 L .58861 .29396 L .58861 .22527 L .63736 .15662 L .63739 .15659 L F 0 g .70604 .10784 m .77473 .10784 L .84338 .15659 L .84341 .15662 L .89216 .22527 L .89216 .29396 L .84341 .36261 L .84338 .36264 L .77473 .41139 L .70604 .41139 L .63739 .36264 L .63736 .36261 L .58861 .29396 L .58861 .22527 L .63736 .15662 L .63739 .15659 L .70604 .10784 L s .8 g .70604 .61796 m .77473 .61796 L .81187 .63736 L .84341 .6689 L .86281 .70604 L .86281 .77473 L .84341 .81187 L .81187 .84341 L .77473 .86281 L .70604 .86281 L .6689 .84341 L .63736 .81187 L .61796 .77473 L .61796 .70604 L .63736 .6689 L .6689 .63736 L F 0 g .70604 .61796 m .77473 .61796 L .81187 .63736 L .84341 .6689 L .86281 .70604 L .86281 .77473 L .84341 .81187 L .81187 .84341 L .77473 .86281 L .70604 .86281 L .6689 .84341 L .63736 .81187 L .61796 .77473 L .61796 .70604 L .63736 .6689 L .6689 .63736 L .70604 .61796 L s .8 g .70604 .13719 m .77473 .13719 L .81187 .15659 L .84341 .18813 L .86281 .22527 L .86281 .29396 L .84341 .3311 L .81187 .36264 L .77473 .38204 L .70604 .38204 L .6689 .36264 L .63736 .3311 L .61796 .29396 L .61796 .22527 L .63736 .18813 L .6689 .15659 L F 0 g .70604 .13719 m .77473 .13719 L .81187 .15659 L .84341 .18813 L .86281 .22527 L .86281 .29396 L .84341 .3311 L .81187 .36264 L .77473 .38204 L .70604 .38204 L .6689 .36264 L .63736 .3311 L .61796 .29396 L .61796 .22527 L .63736 .18813 L .6689 .15659 L .70604 .13719 L s .9 g .70604 .64125 m .77473 .64125 L .83952 .70604 L .83952 .77473 L .77473 .83952 L .70604 .83952 L .64125 .77473 L .64125 .70604 L F 0 g .70604 .64125 m .77473 .64125 L .83952 .70604 L .83952 .77473 L .77473 .83952 L .70604 .83952 L .64125 .77473 L .64125 .70604 L .70604 .64125 L s .9 g .70604 .16048 m .77473 .16048 L .83952 .22527 L .83952 .29396 L .77473 .35875 L .70604 .35875 L .64125 .29396 L .64125 .22527 L F 0 g .70604 .16048 m .77473 .16048 L .83952 .22527 L .83952 .29396 L .77473 .35875 L .70604 .35875 L .64125 .29396 L .64125 .22527 L .70604 .16048 L s 1 g .70604 .67353 m .77473 .67353 L .80724 .70604 L .80724 .77473 L .77473 .80724 L .70604 .80724 L .67353 .77473 L .67353 .70604 L F 0 g .70604 .67353 m .77473 .67353 L .80724 .70604 L .80724 .77473 L .77473 .80724 L .70604 .80724 L .67353 .77473 L .67353 .70604 L .70604 .67353 L s 1 g .70604 .19276 m .77473 .19276 L .80724 .22527 L .80724 .29396 L .77473 .32647 L .70604 .32647 L .67353 .29396 L .67353 .22527 L F 0 g .70604 .19276 m .77473 .19276 L .80724 .22527 L .80724 .29396 L .77473 .32647 L .70604 .32647 L .67353 .29396 L .67353 .22527 L .70604 .19276 L s .4 g .98077 .20178 m .91209 .16652 L .89726 .15659 L .84341 .10274 L .83348 .08791 L .79822 .01923 L .98077 .01923 L F 0 g .98077 .20178 m .91209 .16652 L .89726 .15659 L .84341 .10274 L .83348 .08791 L .79822 .01923 L s .4 g .98077 .68255 m .91209 .64729 L .89726 .63736 L .84341 .58351 L .83348 .56868 L .79822 .5 L .83348 .43132 L .84341 .41649 L .89726 .36264 L .91209 .35271 L .98077 .31745 L F 0 g .98077 .68255 m .91209 .64729 L .89726 .63736 L .84341 .58351 L .83348 .56868 L .79822 .5 L .83348 .43132 L .84341 .41649 L .89726 .36264 L .91209 .35271 L .98077 .31745 L s .4 g .98077 .79822 m .91209 .83348 L .89726 .84341 L .84341 .89726 L .83348 .91209 L .79822 .98077 L .98077 .98077 L F 0 g .98077 .79822 m .91209 .83348 L .89726 .84341 L .84341 .89726 L .83348 .91209 L .79822 .98077 L s .3 g .98077 .16767 m .95183 .15659 L .91209 .14179 L .85821 .08791 L .84341 .04817 L .83233 .01923 L .98077 .01923 L F 0 g .98077 .16767 m .95183 .15659 L .91209 .14179 L .85821 .08791 L .84341 .04817 L .83233 .01923 L s .3 g .98077 .64844 m .95183 .63736 L .91209 .62256 L .85821 .56868 L .84341 .53811 L .83233 .5 L .84341 .46189 L .85821 .43132 L .91209 .37744 L .95183 .36264 L .98077 .35156 L F 0 g .98077 .64844 m .95183 .63736 L .91209 .62256 L .85821 .56868 L .84341 .53811 L .83233 .5 L .84341 .46189 L .85821 .43132 L .91209 .37744 L .95183 .36264 L .98077 .35156 L s .3 g .98077 .83233 m .95183 .84341 L .91209 .85821 L .85821 .91209 L .84341 .95183 L .83233 .98077 L .98077 .98077 L F 0 g .98077 .83233 m .95183 .84341 L .91209 .85821 L .85821 .91209 L .84341 .95183 L .83233 .98077 L s .2 g .98077 .14263 m .91209 .11498 L .88502 .08791 L .85737 .01923 L .98077 .01923 L F 0 g .98077 .14263 m .91209 .11498 L .88502 .08791 L .85737 .01923 L s .2 g .98077 .6234 m .91209 .59574 L .88502 .56868 L .85737 .5 L .88502 .43132 L .91209 .40426 L .98077 .3766 L F 0 g .98077 .6234 m .91209 .59574 L .88502 .56868 L .85737 .5 L .88502 .43132 L .91209 .40426 L .98077 .3766 L s .2 g .98077 .85737 m .91209 .88502 L .88502 .91209 L .85737 .98077 L .98077 .98077 L F 0 g .98077 .85737 m .91209 .88502 L .88502 .91209 L .85737 .98077 L s .1 g .98077 .11622 m .93029 .08791 L .91209 .06971 L .88378 .01923 L .98077 .01923 L F 0 g .98077 .11622 m .93029 .08791 L .91209 .06971 L .88378 .01923 L s .1 g .98077 .59699 m .93029 .56868 L .91209 .55491 L .88378 .5 L .91209 .44509 L .93029 .43132 L .98077 .40301 L F 0 g .98077 .59699 m .93029 .56868 L .91209 .55491 L .88378 .5 L .91209 .44509 L .93029 .43132 L .98077 .40301 L s .1 g .98077 .88378 m .93029 .91209 L .91209 .93029 L .88378 .98077 L .98077 .98077 L F 0 g .98077 .88378 m .93029 .91209 L .91209 .93029 L .88378 .98077 L s .98077 .07191 m .92809 .01923 L .98077 .01923 L F .98077 .07191 m .92809 .01923 L s .98077 .55656 m .92809 .5 L .98077 .44344 L F .98077 .55656 m .92809 .5 L .98077 .44344 L s .98077 .92809 m .92809 .98077 L .98077 .98077 L F .98077 .92809 m .92809 .98077 L s % End of Graphics MathPictureEnd \ \>"], "Graphics", ImageSize->{288, 288}, ImageMargins->{{43, 0}, {0, 0}}, ImageRegion->{{0, 1}, {0, 1}}, ImageCache->GraphicsData["Bitmap", "\<\ CF5dJ6E]HGAYHf4PAg9QL6QYHgon6Ykno_hn?S`2ook>c/mWIfGmoOol005E[;lC4a000<`00IP00V@00c000 o`0c000c<`0cIP0cV@0cc00co`1V001V<`1VIP1VV@1Vc01Vo`2I002I<`2IIP2IV@2Ic02Io`3<003< <`3I03>IIIS>IVC>Ic3>Ioc?<03?<@000`40000f00030@0000L00`4i0003 0@0000@0000H00040@000CH000@1000120000`40000i00030@0003H000<100001`000`40000j0003 0@0000<0000H00040@000CH000@1000120000`40000g00<1=P030@T000<10000=`00104000450000 6@020CP00P4900@1>0000`40000f00030@0000L0104g00811P000?l08@0001D0o`4;0@40000E0003 0@00008000<100002P000`40000900030@0000X000<100002P000`40000:00030@0000X000<10000 2@000`40000:00030@0000X000<100002P000`40000900030@0000X000<100002P000`40000:0003 0@0000T000<100002P000`40000:00030@0000X000<100002P000`40000900030@0000800@410000 5@000`40000200030@0003d000<10000?@000`40000l00030@0003d000<100000P010@40000E0003 0@000?l01`010@40000>00811@000`40003o00L00@4100003@001040004400814@000`4000090003 0@0000@000<100000`000`40000600030@0001`000<100001P000`40000400030@0000@000<10000 20000`40000K00030@0000L000<1000010000`40000400030@0000H000<1000070000`4000060003 0@0000<000<100001@000`40000800030@0000l00P4100003@001040004400030@0000803P403581 DP5B0E81DP5B0@MB00L12E89DPT100P902012JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@P9 00P1DPUB2E890@MB00X1DP5B0E81DP5B7`402U81DP5B0E81DP46DP080E89DPUB2@482@0P0@VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`482@070E89DPUB0@08DP0:0E81DP5B0E81DPh11@010@40 000=00040@000@@000<100000P0=0@0;DP5B0E81DP5B0E800P46DP070@UB2E890@082@0R0@VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@P900P1DPUB2E890@IB0P402E81DP5B0E81DP0M0@0: DP5B0E81DP5B0@IB00P1DPUB2E890@P902812JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL1 20T01`5B2E89DP401e820@09DP5B0E81DP5B00d11@010@40000=00040@000@@000<100000P0<0@0; DP5B0E81DP5B0E800P47DP070E89DPUB0@082@0R0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL90@P900P12E89DPUB0@MB0P402E81DP5B0E81DP0K0@09DP5B0E81DP5B00811U802049DPUB2E81 20T08P6W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@482@070@UB2E890@08DP8100UB0E81 DP5B0E80304500410@0000d000@1000110000`40000200/100iB0E81DP5B0E81DP5B0@IB00P1DPUB 2E890@L902@1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@482@070@UB2E890@07DP0< 0E81DP5B0E81DP5B6@402E81DP5B0E81DP020@MB00P1DPUB2E890@L902@1Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2@482@070@UB2E890@07DP0<0E81DP5B0E81DP5B2`4500410@0000h0 0P4500030@0000802P403U81DP5B0E81DP5B0E811e801`49DPUB2@4020T09049Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@P900P1DPUB2E890@MB00`1DP5B0E81DP5B0E8G0@00E81DP5B0E81DP5B0E870@D00@410000 5@000`40000200H1011B0E81DP5B0E81DP5B0E811e802049DPUB2E811`T0:049Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`472@080@UB2E89DP48DP0@0E81DP5B0E81DP5B0E81DP/1 011B0E81DP5B0E81DP5B0E811e802049DPUB2E811`T0:049Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`472@080@UB2E89DP48DP0>0E81DP5B0E81DP5B0E860@D00@4100005@000`40 000200D1011B0E81DP5B0E81DP5B0E8125801`5B2E89DP401`T0:P49Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@L900P12E89DPUB0@MB0P403e81DP5B0E81DP5B0E81DP090@0@ DP5B0E81DP5B0E81DP5B0@MB00P12E89DPUB0@L902X12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`472@070@UB2E890@08DP8100eB0E81DP5B0E81DP5B00D11@010@40000E0003 0@00008010403e81DP5B0E81DP5B0E81DP020@MB00P1DPUB2E890@L900`1Y`VW2JL9Y`VW2JLC0@0; Y`VW2JL9Y`VW2@401`T0205B2E89DPT125820@0?DP5B0E81DP5B0E81DP5B00L100mB0E81DP5B0E81 DP5B0E800P47DP080E89DPUB2@472@0;0JL9Y`VW2JL9Y`T050402jL9Y`VW2JL9Y`T100L900P1DPUB 2E890@QB0P403E81DP5B0E81DP5B0E80104500410@0001D000<100000P030@0?DP5B0E81DP5B0E81 DP5B008125802049DPUB2E811PT03@6W2JL9Y`VW2JL9Y`404jL0306W2JL9Y`VW2JL90@H900P12E89 DPUB0@QB0181DP5B0E81DP5B0E81DP5B0E850@0?DP5B0E81DP5B0E81DP5B008125802049DPUB2E81 1PT0306W2JL9Y`VW2JL90ABW00`1Y`VW2JL9Y`VW2@462@080@UB2E89DP48DP0@0E81DP5B0E81DP5B 0E81DP<11@010@40000E00810`020@0BDP5B0E81DP5B0E81DP5B0E8125801`5B2E89DP401`T03049 Y`VW2JL9Y`VW0AFW00/1Y`VW2JL9Y`VW0@072@080@UB2E89DP48DP0B0E81DP5B0E81DP5B0E81DP5B 0`404U81DP5B0E81DP5B0E81DP5B0@MB00P12E89DPUB0@L900`12JL9Y`VW2JL9Y`4EY`0;0JL9Y`VW 2JL9Y`401`T01`49DPUB2@402E80405B0E81DP5B0E81DP5B0E820@@00P4100005@000`400002000C 0E81DP5B0E81DP5B0E81DP5B0@08DP080E89DPUB2@462@0<0@VW2JL9Y`VW2JL15jL02`6W2JL9Y`VW 2JL100H900P1DPUB2E890@QB0P409581DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0@QB 00P1DPUB2E890@H900`12JL9Y`VW2JL9Y`4FY`0<0@VW2JL9Y`VW2JL11PT0205B2E89DPT125820@0? DP5B0E81DP5B0E81DP5B008110010@40000E00030@000080019B0E81DP5B0E81DP5B0E81DP49DP07 0@UB2E890@072@0<0JL9Y`VW2JL9Y`T16:L02P6W2JL9Y`VW2@472@080E89DPUB2@48DP81029B0E81 DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E812580205B2E89DPT11`T02`6W2JL9Y`VW2JL101RW 00/12JL9Y`VW2JL90@072@070E89DPUB0@09DP8100mB0E81DP5B0E81DP5B0E801@010@40000E0003 0@0000800141DP5B0E81DP5B0E81DP5B0@09DP080@UB2E89DP462@0<0JL9Y`VW2JL9Y`T16JL02`49 Y`VW2JL9Y`T100H900P12E89DPUB0@UB0P408581DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81 2E802049DPUB2E811PT02`6W2JL9Y`VW2JL101ZW00/12JL9Y`VW2JL90@062@080@UB2E89DP49DP81 00iB0E81DP5B0E81DP5B0@D00@4100005@000`400002000@DP5B0E81DP5B0E81DP5B0@YB00P1DPUB 2E890@H900/12JL9Y`VW2JL90@0KY`0:0@VW2JL9Y`VW0@H900P1DPUB2E890@UB0201DP5B0E81DP5B 0E81DP5B0E81DP5B0E81DP5B0E81DP812E80205B2E89DPT11PT02`49Y`VW2JL9Y`T101^W00X12JL9 Y`VW2JL11PT0205B2E89DPT12U820@0=DP5B0E81DP5B0E81DP0500410@0001D000<100000P003`5B 0E81DP5B0E81DP5B0@0:DP080E89DPUB2@462@0;0@VW2JL9Y`VW2@407JL02P49Y`VW2JL9Y`462@08 0E89DPUB2@49DP0N0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0P49DP080E89DPUB2@462@0; 0@VW2JL9Y`VW2@407:L02`6W2JL9Y`VW2JL100H900P1DPUB2E890@YB0P403581DP5B0E81DP5B0@D0 0@4100005@000`400002000>DP5B0E81DP5B0E81DP4;DP080@UB2E89DP462@0:0JL9Y`VW2JL90AnW 00T12JL9Y`VW2@401PT02049DPUB2E812U830@0IDP5B0E81DP5B0E81DP5B0E81DP5B0E81DP020@YB 00P12E89DPUB0@H900X1Y`VW2JL9Y`T17ZL02P6W2JL9Y`VW2@462@080@UB2E89DP4;DP8100]B0E81 DP5B0E81DP0500410@0001D000<100000P002P5B0E81DP5B0E830@]B00P12E89DPUB0@H900X1Y`VW 2JL9Y`T18JL02@49Y`VW2JL90@062@080@UB2E89DP4;DP8101EB0E81DP5B0E81DP5B0E81DP5B0E80 0`4;DP080@UB2E89DP462@0:0JL9Y`VW2JL90B2W00X1Y`VW2JL9Y`T11PT02049DPUB2E812e820@0: DP5B0E81DP5B0@D00@4100005@000`4000020009DP5B0E81DP5B008135802049DPUB2E811`T02@49 Y`VW2JL90@0SY`090@VW2JL9Y`T100H900P12E89DPUB0@aB0`404E81DP5B0E81DP5B0E81DP5B0081 35802049DPUB2E811`T02@49Y`VW2JL90@0RY`0:0JL9Y`VW2JL90@H900P12E89DPUB0@aB0`401e81 DP5B0E801@010@40000E00030@00008000H1DP5B0E830@eB00P12E89DPUB0@L900T12JL9Y`VW2@40 9JL02049Y`VW2JL11`T02049DPUB2E813E820@0=DP5B0E81DP5B0E81DP030@eB00P12E89DPUB0@L9 00T12JL9Y`VW2@409:L02@6W2JL9Y`VW0@072@080@UB2E89DP4=DP8100IB0E81DP4500410@0001D0 00<100000P001E81DP5B00813U802049DPUB2E811`T02@49Y`VW2JL90@0WY`080@VW2JL9Y`472@08 0@UB2E89DP4>DP<100UB0E81DP5B0E800P4>DP080@UB2E89DP472@090@VW2JL9Y`T102JW00T1Y`VW 2JL9Y`401`T02049DPUB2E813U830@03DP5B00D00@4100005@000`40000200030E8100813e802049 DPUB2E811`T02@49Y`VW2JL90@0;Ya<12jL02049Y`VW2JL11`T02049DPUB2E813e820@05DP5B0E80 0`4?DP080@UB2E89DP472@090@VW2JL9Y`T100ZW504:Y`090JL9Y`VW2JL100L900P12E89DPUB0@mB 0P400e81000400410@0001D000<100000P000e810@0@DP080@UB2E89DP472@090@VW2JL9Y`T100ZW 0P404jL8Y`RW2:L8Y`RW2:L8Y`RW2:L00P4:Y`080@VW2JL9Y`472@080@UB2E89DP4@DP<100=B0@40 45802049DPUB2E811`T02@49Y`VW2JL90@09Y`8101@8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`812JL02@6W 2JL9Y`VW0@072@080@UB2E89DP4@DP811@010@40000E00810`000`5BDP0>DP8100L9DPUB2E8100L9 00T12JL9Y`VW2@402ZL06@48Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20402JL02@6W2JL9Y`VW0@072@07 0@UB2E89DP020A1B0P4@DP8100L9DPUB2E8100L900T12JL9Y`VW2@402JL06P6W2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`P12JL02@6W2JL9Y`VW0@072@070@UB2E89DP020A1B00@100000P4100005@000`40 000200mB0P402589DPUB2E811`T02@49Y`VW2JL90@09Y`8101X8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L80@VW00T1Y`VW2JL9Y`401`T02049DPUB2E890`4MDP8100QB2E89DPUB0@L900T12JL9Y`VW2@40 2JL0706W2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2049Y`090JL9Y`VW2JL100L900P12E89DPUB2@81 3U8500410@0001D000<100000P02@@1 00=B2E800`4>2@0:0JL9Y`VW2JL90@JW00P12:L8Y`RW0@X801H100P0200800P0200800P0200800P1 2@P02@6W2:L8Y`RW0@06Y`080JL9Y`VW2JL20@l90P400`T0000200810@0001D000<100000P020@l9 0P402JL9Y`VW2JL90@06Y`090@RW2:L8Y`P100X801L1200800P0200800P0200800P020080@0:2008 0@RW2:L8Y`46Y`090JL9Y`VW2JL9008140T30@l90P402JL9Y`VW2JL90@06Y`080@RW2:L8Y`4:200H 0@0800P0200800P0200800P0200800P12@P02@6W2:L8Y`RW0@06Y`0:0JL9Y`VW2JL90A090P440041 0@0001D000<100000P0?2@8100X9Y`VW2JL9Y`T11ZL01`48Y`RW2:L00P4:200I0@P0200800P02008 00P0200800P020080@0:20080@RW2:L8Y`46Y`0:0JL9Y`VW2JL9Y`817PT20@0:2JL9Y`VW2JL90@JW 00P12:L8Y`RW0@X801X100P0200800P0200800P0200800P020080@T80P401`RW2:L8Y`401ZL02@6W 2JL9Y`VW2@020@l91@010@40000E00030@0000803@T20@0;Y`VW2JL9Y`VW2@401ZL02048Y`RW2:L1 2`P06`4800P0200800P0200800P0200800P020080@0:20080@RW2:L8Y`46Y`0;0JL9Y`VW2JL9Y`T0 0P4J2@8100^W2JL9Y`VW2JL90@06Y`080@RW2:L8Y`4:200L0@0800P0200800P0200800P0200800P0 20080@X800P12:L8Y`RW0@JW00X1Y`VW2JL9Y`VW0P4=2@D00@4100005@000`40000200/90P4030VW 2JL9Y`VW2JL90@NW00L1Y`RW2:L100/801d1200800P0200800P0200800P0200800P020080@0:2007 0@RW2:L80@07Y`0<0JL9Y`VW2JL9Y`VW0P4F2@8100`9Y`VW2JL9Y`VW2@47Y`070JL8Y`RW0@0:200N 0@0800P0200800P0200800P0200800P0200800P12PP01`48Y`RW20401jL02`6W2JL9Y`VW2JL90081 2`T500410@0001D000<100000P092@8100fW2JL9Y`VW2JL9Y`T100NW00L1Y`RW2:L100/801l12008 00P0200800P0200800P0200800P0200800P100X800L12:L8Y`P100NW00d1Y`VW2JL9Y`VW2JL90081 4PT20@0=Y`VW2JL9Y`VW2JL90@07Y`070JL8Y`RW0@0:200P0@0800P0200800P0200800P0200800P0 200800P0204:20070@RW2:L80@07Y`0<0JL9Y`VW2JL9Y`VW0P492@D00@4100005@000`40000200L9 0P403PVW2JL9Y`VW2JL9Y`T11jL01`6W2:L8Y`402`P08@4800P0200800P0200800P0200800P02008 00P020080@0:20070@RW2:L80@07Y`0>0JL9Y`VW2JL9Y`VW2JL20@h90P403PVW2JL9Y`VW2JL9Y`T1 1jL01`6W2:L8Y`402PP08P40200800P0200800P0200800P0200800P0200800P0204:20070@RW2:L8 0@07Y`0=0JL9Y`VW2JL9Y`VW2@020@L91@010@40000E00030@0000801@T20@0?Y`VW2JL9Y`VW2JL9 Y`T100RW00L12:L8Y`P100T80P408PP0200800P0200800P0200800P0200800P0200800P0204:2007 0@RW2:L80@07Y`0?0JL9Y`VW2JL9Y`VW2JL900812PT20@0?Y`VW2JL9Y`VW2JL9Y`T100RW00L12:L8 Y`P100T802@100P0200800P0200800P0200800P0200800P0200800P0204:20070@RW2:L80@07Y`0> 0JL9Y`VW2JL9Y`VW2JL20@D91@010@40000E00030@0000800`T20@0@2JL9Y`VW2JL9Y`VW2JL90@RW 00L12:L8Y`P100T800X100P0200800P04`402@0800P020080@0920070JL8Y`RW0@08Y`0@0JL9Y`VW 2JL9Y`VW2JL9Y`811PT20@0@2JL9Y`VW2JL9Y`VW2JL90@RW00L12:L8Y`P100T800T100P0200800P0 50402@0800P020080@0920070JL8Y`RW0@08Y`0?0JL9Y`VW2JL9Y`VW2JL900810`T500410@0001D0 00<100000P0050T10JL9Y`VW2JL9Y`VW2JL9Y`T12:L02048Y`RW2:L120P02`40200800P0200101<0 00X100P0200800P12@P01`6W2:L8Y`402:L04@6W2JL9Y`VW2JL9Y`VW2JL900810PT20@0AY`VW2JL9 Y`VW2JL9Y`VW2@402:L02048Y`RW2:L120P02P40200800P0204D000:0@0800P020080@T800L1Y`RW 2:L100RW0101Y`VW2JL9Y`VW2JL9Y`VW0P400`T0000300410@0001D000<100000P004`49Y`VW2JL9 Y`VW2JL9Y`VW2@402:L02048Y`RW2:L120P02`40200800P0200101D000X100P0200800P120P02048 Y`RW2:L12:L04P6W2JL9Y`VW2JL9Y`VW2JL9Y`810189Y`VW2JL9Y`VW2JL9Y`VW2@48Y`080@RW2:L8 Y`48200:0@0800P020080AH000X100P0200800P120P02048Y`RW2:L12:L04@6W2JL9Y`VW2JL9Y`VW 2JL9008110010@40000E00030@0000800109Y`VW2JL9Y`VW2JL9Y`VW0P49Y`080JL8Y`RW2047200; 0@0800P0200800405`002P40200800P0204820070@RW2:L80@09Y`0T0JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`T12JL0206W2:L8Y`P11`P02P40200800P0204H000:0@0800P020080@P8 00L12:L8Y`P100VW0141Y`VW2JL9Y`VW2JL9Y`VW2@0500410@0001D000<100000P004:L9Y`VW2JL9 Y`VW2JL9Y`4:Y`080JL8Y`RW204720090@0800P0200800816@020@08200800P0204720080JL8Y`RW 2049Y`0R0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@VW00P1Y`RW2:L80@L800X100P0 200800P16P002P40200800P0204720080JL8Y`RW2049Y`8100h9Y`VW2JL9Y`VW2JL9Y`D00@410000 5@020@<000l9Y`VW2JL9Y`VW2JL9Y`402ZL02@6W2:L8Y`RW0@06200:0@0800P020080Ad000T12008 00P020401`P0206W2:L8Y`P12JL20@0N2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T12JL02@6W 2:L8Y`RW0@06200:0@0800P020080A`000X100P0200800P11`P0206W2:L8Y`P12ZL03P49Y`VW2JL9 Y`VW2JL910020@40000E00030@00008000bW2JL9Y`VW2JL9Y`T20@ZW00T1Y`RW2:L8Y`401PP02P40 200800P0204O00090@P0200800P100H800T12:L8Y`RW20402ZL07@49Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`T100VW00T1Y`RW2:L8Y`401PP02P40200800P0204N000:0@0800P020080@H800T12:L8 Y`RW20402ZL03@49Y`VW2JL9Y`VW2JL01@010@40000E00030@00008000`9Y`VW2JL9Y`VW2@42JL9Y`VW2JL9Y`VW2@4;Y`090JL8Y`RW2:L100H800X100P0 200800P17@002@4800P020080@0720080JL8Y`RW204:Y`0O0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL90@09Y`090JL8Y`RW2:L100H800X100P0200800P170002P40200800P0204720080JL8Y`RW 204:Y`8100bW2JL9Y`VW2JL9Y`T500410@0001D00P43000>Y`VW2JL9Y`VW2JL9Y`T20@ZW00P1Y`RW 2:L80@L800X100P0200800P16`002@4800P020080@0720080JL8Y`RW204:Y`0P0@VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`4:Y`080JL8Y`RW2047200:0@0800P020080AX000X100P0200800P1 1`P0206W2:L8Y`P12ZL03`49Y`VW2JL9Y`VW2JL9Y`0400810@0001D000<100000P004@VW2JL9Y`VW 2JL9Y`VW2JL100VW00T12:L8Y`RW20401`P02P40200800P0204I00090@P0200800P100P800P12:L8 Y`RW0@VW02812JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL12JL02@48Y`RW2:L80@072009 0@0800P0200101X000T1200800P0204020P02048Y`RW2:L12JL04049Y`VW2JL9Y`VW2JL9Y`T50041 0@0001D000<100000P004ZL9Y`VW2JL9Y`VW2JL9Y`VW0@VW00P12:L8Y`RW0@P800X100P0200800P1 5`002@4800P020080@0820080@RW2:L8Y`49Y`0T0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL12JL02048Y`RW2:L120P02@40200800P00@0H00090@P0200800P100P800P12:L8Y`RW0@VW 01412JL9Y`VW2JL9Y`VW2JL9Y`0500410@0001D000<100000P004`6W2JL9Y`VW2JL9Y`VW2JL9Y`40 2JL02048Y`RW2:L120P02P40200800P0204E00090@P0200800P100T800L1Y`RW2:L100VW01812JL9 Y`VW2JL9Y`VW2JL9Y`T20@0BY`VW2JL9Y`VW2JL9Y`VW2JL12JL02048Y`RW2:L120P02@40200800P0 0@0F00090@P0200800P100T800L1Y`RW2:L100VW01412JL9Y`VW2JL9Y`VW2JL9Y`020@@00@410000 5@000`400002000D2@412JL9Y`VW2JL9Y`VW2JL9Y`48Y`080JL8Y`RW2049200:0@0800P020080A<0 00T1200800P020402@P0206W2:L8Y`P12:L04@49Y`VW2JL9Y`VW2JL9Y`VW00810PT20@0A2JL9Y`VW 2JL9Y`VW2JL9Y`402:L0206W2:L8Y`P12@P02@40200800P00@0D00090@P0200800P100T800P1Y`RW 2:L80@RW01012JL9Y`VW2JL9Y`VW2JL90P400`T0000300410@0001D000<100000P032@81012W2JL9 Y`VW2JL9Y`VW2JL12:L0206W2:L8Y`P12@P02@40200800P0200C0@09200800P0200100T800L12:L8 Y`P100RW01012JL9Y`VW2JL9Y`VW2JL90P462@81012W2JL9Y`VW2JL9Y`VW2JL12:L0206W2:L8Y`P1 2@P02040200800P050402@P0200800P00@0920070@RW2:L80@08Y`0?0@VW2JL9Y`VW2JL9Y`VW0081 0`T500410@0001D000<100000P052@8100l9Y`VW2JL9Y`VW2JL9Y`402:L01`6W2:L8Y`402PP08`40 200800P0200800P0200800P0200800P0200800P0200100T800L12:L8Y`P100RW00l12JL9Y`VW2JL9 Y`VW2JL00P4:2@8100l9Y`VW2JL9Y`VW2JL9Y`402:L01`6W2:L8Y`402@P0904800P0200800P02008 00P0200800P0200800P0200800P00@T800L12:L8Y`P100RW00h12JL9Y`VW2JL9Y`VW2@811@T50041 0@0001D000<100000P072@8100jW2JL9Y`VW2JL9Y`VW0@RW00L1Y`RW2:L100X8024100P0200800P0 200800P0200800P0200800P0200800402@P01`48Y`RW20402:L03P49Y`VW2JL9Y`VW2JL90P4>2@81 00jW2JL9Y`VW2JL9Y`VW0@RW00L1Y`RW2:L100T80281200800P0200800P0200800P0200800P02008 00P020012@P01`48Y`RW20402:L03@49Y`VW2JL9Y`VW2JL00P472@D00@4100005@000`40000200T9 0P403@VW2JL9Y`VW2JL9Y`401jL02048Y`RW2:L12PP07`40200800P0200800P0200800P0200800P0 200800402@P02048Y`RW2:L11jL03@49Y`VW2JL9Y`VW2JL00P4B2@8100d9Y`VW2JL9Y`VW2JL100NW 00P12:L8Y`RW0@T80201200800P0200800P0200800P0200800P0200800P00@T800P12:L8Y`RW0@NW 00`12JL9Y`VW2JL9Y`T20@T91@010@40000E00030@0000802`T20@0DP030@0000800@4100005@020@<000=B0@403U820@07 DPUB2E890@072@090JL9Y`VW2JL100ZW01T1Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L100VW00T12JL9 Y`VW2@401`T01`5B2E89DPT00P4?DP8100=B0@403U820@07DPUB2E890@072@090JL9Y`VW2JL100VW 01X12:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0@VW00T12JL9Y`VW2@401`T01`5B2E89DPT00P4>DP81 10020@40000E00030@00008000<1DP400P4>DP080E89DPUB2@472@090JL9Y`VW2JL100ZW0P404`RW 2:L8Y`RW2:L8Y`RW2:L8Y`P00P4:Y`080JL9Y`VW2@472@080E89DPUB2@4?DP<100=B0E800`4>DP08 0E89DPUB2@472@090JL9Y`VW2JL100VW0P405:L8Y`RW2:L8Y`RW2:L8Y`RW2:L80P49Y`090@VW2JL9 Y`T100L900P1DPUB2E890@iB0P400e81000400410@0001D000<100000P001U81DP5B0@iB00P1DPUB 2E890@L900T1Y`VW2JL9Y`402jLC0@^W00P1Y`VW2JL90@L900P1DPUB2E890@iB0P402E81DP5B0E81 DP020@eB00P1DPUB2E890@L900T1Y`VW2JL9Y`402ZLD0@ZW00T12JL9Y`VW2@401`T0205B2E89DPT1 3U820@03DP5B00D00@4100005@000`40000200060E81DP5B0P4=DP080E89DPUB2@472@090JL9Y`VW 2JL102NW00P1Y`VW2JL90@L900P1DPUB2E890@eB0`402e81DP5B0E81DP5B00813E80205B2E89DPT1 1`T02@6W2JL9Y`VW0@0VY`090@VW2JL9Y`T100L900P1DPUB2E890@eB0`401581DP4500410@0001D0 00<100000P001e81DP5B0E800P4=DP080E89DPUB2@472@090JL9Y`VW2JL102FW00P1Y`VW2JL90@L9 00P1DPUB2E890@aB0P403e81DP5B0E81DP5B0E81DP030@aB00P1DPUB2E890@L900T1Y`VW2JL9Y`40 9:L02@49Y`VW2JL90@072@080E89DPUB2@4=DP080E81DP5B0E8500410@0001D000<100000P00205B 0E81DP5B0`4W00T1Y`VW2JL9Y`401PT0205B2E89DPT1 2e830@0CDP5B0E81DP5B0E81DP5B0E81DP020@]B00P1DPUB2E890@L900T1Y`VW2JL9Y`408ZL02P49 Y`VW2JL9Y`462@080E89DPUB2@40E81DP5B0E81DP5B0E830@UB00P12E89DPUB0@H9 00/1Y`VW2JL9Y`VW0@0KY`0:0JL9Y`VW2JL90@H900P12E89DPUB0@UB0P408581DP5B0E81DP5B0E81 DP5B0E81DP5B0E81DP5B0E812E802049DPUB2E811PT02`6W2JL9Y`VW2JL101ZW00/12JL9Y`VW2JL9 0@062@080@UB2E89DP49DP8100iB0E81DP5B0E81DP5B0@D00@4100005@000`4000020081011B0E81 DP5B0E81DP5B0E8125802@5B2E89DPUB0@062@0:0JL9Y`VW2JL9Y`815jL20@0:Y`VW2JL9Y`VW0@H9 00P1DPUB2E890@QB0P403e81DP5B0E81DP5B0E81DP030@0@DP5B0E81DP5B0E81DP5B0@QB00T1DPUB 2E89DP401PT02`6W2JL9Y`VW2JL101RW00`12JL9Y`VW2JL9Y`462@080E89DPUB2@48DP81011B0E81 DP5B0E81DP5B0E8110010@40000E00030@0000800`404581DP5B0E81DP5B0E81DP48DP080E89DPUB 2@462@0=0@VW2JL9Y`VW2JL90@0EY`0<0@VW2JL9Y`VW2JL11PT0205B2E89DPT125820@0?DP5B0E81 DP5B0E81DP5B00D1011B0E81DP5B0E81DP5B0E812580205B2E89DPT11PT03049Y`VW2JL9Y`VW0AJW 00`12JL9Y`VW2JL9Y`462@080E89DPUB2@48DP81011B0E81DP5B0E81DP5B0E811@010@40000E0081 0`040@0@DP5B0E81DP5B0E81DP5B0@MB00T12E89DPUB2@401PT03@49Y`VW2JL9Y`VW2@404jL03@49 Y`VW2JL9Y`VW2@401PT02049DPUB2E812580405B0E81DP5B0E81DP5B0E870@0@DP5B0E81DP5B0E81 DP5B0@MB00T12E89DPUB2@401PT03049Y`VW2JL9Y`VW0ABW00d12JL9Y`VW2JL9Y`T100H900P12E89 DPUB0@QB0101DP5B0E81DP5B0E81DP5B0P4400810@0001D000<100000P050@0=DP5B0E81DP5B0E81 DP020@QB00P12E89DPUB0@H900d1Y`VW2JL9Y`VW2JL901<100`9Y`VW2JL9Y`VW2@462@090@UB2E89 DPT100MB0101DP5B0E81DP5B0E81DP5B2@403E81DP5B0E81DP5B0E800P47DP090E89DPUB2E8100H9 00`1Y`VW2JL9Y`VW2JLD0@0<2JL9Y`VW2JL9Y`T11PT02049DPUB2E812580405B0E81DP5B0E81DP5B 0E830@D00@4100005@000`40000200H100eB0E81DP5B0E81DP5B00811e802@5B2E89DPUB0@062@0[ 0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@062@080E89DPUB2@48DP81 00eB0E81DP5B0E81DP5B00/100eB0E81DP5B0E81DP5B00811e802@5B2E89DPUB0@062@0[0JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@062@080E89DPUB2@48DP8100eB0E81 DP5B0E81DP5B00@11@010@40000E00030@0000801`403U81DP5B0E81DP5B0E812580205B2E89DPT1 1PT0:P49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@H900T1DPUB2E89DP40 1e820@0=DP5B0E81DP5B0E81DP0=0@0>DP5B0E81DP5B0E81DP47DP090@UB2E89DPT100H902X12JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`462@080E89DPUB2@48DP8100eB0E81 DP5B0E81DP5B00D11@010@40000E00030@00008020403U81DP5B0E81DP5B0E811e802049DPUB2E81 1`T0:@49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T100H900T12E89DPUB2@40 1e803P5B0E81DP5B0E81DP5B3`403U81DP5B0E81DP5B0E811e802049DPUB2E811`T0:@49Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T100H900P12E89DPUB0@QB00h1DP5B0E81DP5B 0E81DPH11@010@40000E00030@0000802@402e81DP5B0E81DP5B00811e802@5B2E89DPUB0@062@0X 0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@H900T12E89DPUB2@401e803P5B 0E81DP5B0E81DP5B4@402e81DP5B0E81DP5B00811e802@5B2E89DPUB0@062@0X0JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@H900T12E89DPUB2@401e803P5B0E81DP5B0E81DP5B 1`4500410@0001D000<100000P080@0=DP5B0E81DP5B0E81DP020@MB00P1DPUB2E890@L902L1Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`401PT02@5B2E89DPUB0@07DP8100]B0E81 DP5B0E81DP0C0@0;DP5B0E81DP5B0E800P46DP090@UB2E89DPT100L902L1Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`401PT0205B2E89DPT125820@0;DP5B0E81DP5B0E8020450041 0@0001D000<100000P090@0=DP5B0E81DP5B0E81DP020@IB00P12E89DPUB0@L902H12JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@L900P12E89DPUB0@MB0P402e81DP5B0E81DP5B01D1 00aB0E81DP5B0E81DP47DP080@UB2E89DP472@0V0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`472@080@UB2E89DP47DP8100]B0E81DP5B0E81DP090@D00@4100005@000`40000200X1 00iB0E81DP5B0E81DP5B0@MB00P12E89DPUB0@L902D12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`T100L900P1DPUB2E890@MB00`1DP5B0E81DP5B0E8G0@0DP5B0E81DP5B0E81DP46DP08 0E89DPUB2@472@0T0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T11`T02@5B2E89DPUB 0@06DP0<0E81DP5B0E81DP5B6@402E81DP5B0E81DP020@IB00T12E89DPUB2@401`T0906W2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@L900P1DPUB2E890@MB00`1DP5B0E81DP5B0E8;0@D0 0@4100005@000`40000200`100]B0E81DP5B0E81DP020@MB00L1DPUB2E8100P902<1Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@072@080@UB2E89DP47DP8100UB0E81DP5B0E806`402E81 DP5B0E81DP020@IB00P12E89DPUB0@P902<1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 0@072@070@UB2E890@08DP8100UB0E81DP5B0E80304500410@0001D000<100000P0=0@0;DP5B0E81 DP5B0E800P46DP070@UB2E890@082@0R0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@P9 00P1DPUB2E890@IB0P402E81DP5B0E81DP0M0@0:DP5B0E81DP5B0@IB00P1DPUB2E890@P902812JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL120T01`5B2E89DP401e820@09DP5B0E81DP5B00d1 1@010@40000=00@110000`40000200h100aB0E81DP5B0E81DP47DP070@UB2E890@082@0Q0@VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T100L900P1DPUB2E890@MB00X1DP5B0E81DP5B7`402U81 DP5B0E81DP46DP080E89DPUB2@482@0Q0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T100L9 00L1DPUB2E8100QB00X1DP5B0E81DP5B3P4500410@0000l000<100000`020@<03`403581DP5B0E81 DP5B0@IB00L1DPUB2E8100P90201Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@P900P12E89 DPUB0@IB00X1DP5B0E81DP5B8@401e81DP5B0E800P46DP080@UB2E89DP482@0P0JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2@482@070@UB2E890@07DP0:0E81DP5B0E81DPl110020@40000?0003 0@0000<000<100000P0>0@00@D00@4100003`000`40000300030@0000803@402e81DP5B0E81 DP5B00811U801`49DPUB2@4020T08P49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`482@08 0E89DPUB2@46DP8100UB0E81DP5B0E807@402U81DP5B0E81DP46DP080E89DPUB2@482@0R0@VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@P900L1DPUB2E8100MB0P402E81DP5B0E81DP0=0@D0 0@4100003`000`40000300030@00008030402e81DP5B0E81DP5B00811e801`5B2E89DP4020T08`6W 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL100L900P12E89DPUB0@IB00`1DP5B0E81DP5B 0E8K0@09DP5B0E81DP5B00811U802049DPUB2E8120T08`6W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL100L900L12E89DPT100MB00`1DP5B0E81DP5B0E8<0@D00@4100003@030@D000<10000 0P0;0@0>DP5B0E81DP5B0E81DP46DP080E89DPUB2@472@0T0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`T11`T02@5B2E89DPUB0@06DP0<0E81DP5B0E81DP5B6@402E81DP5B0E81DP020@IB 00T12E89DPUB2@401`T0906W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@L900P1DPUB 2E890@MB00`1DP5B0E81DP5B0E8;0@D00@4100003`000`40000300030@0000802P403U81DP5B0E81 DP5B0E811e802049DPUB2E811`T09@49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@40 1`T0205B2E89DPT11U820@0;DP5B0E81DP5B0E805`403581DP5B0E81DP5B0@IB00T1DPUB2E89DP40 1`T09@49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@401`T01`5B2E89DP401e820@0; DP5B0E81DP5B0E802P4500410@0001D000<100000P090@0=DP5B0E81DP5B0E81DP020@IB00P12E89 DPUB0@L902H12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@L900P12E89DPUB0@MB 0P402e81DP5B0E81DP5B01D100aB0E81DP5B0E81DP47DP080@UB2E89DP472@0V0@VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`472@080@UB2E89DP47DP8100]B0E81DP5B0E81DP090@D0 0@4100005@000`40000200P100eB0E81DP5B0E81DP5B00811e80205B2E89DPT11`T09`6W2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@062@090E89DPUB2E8100IB00h1DP5B0E81DP5B 0E81DQ<100]B0E81DP5B0E81DP020@IB00T12E89DPUB2@401`T09`6W2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW0@062@080E89DPUB2@47DP0>0E81DP5B0E81DP5B0E880@D00@410000 5@000`40000200T100iB0E81DP5B0E81DP5B0@IB00T1DPUB2E89DP401PT0:06W2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@462@090@UB2E89DPT100MB00h1DP5B0E81DP5B0E81DQ41 00]B0E81DP5B0E81DP020@MB00T1DPUB2E89DP401PT0:06W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2@462@090@UB2E89DPT100MB00h1DP5B0E81DP5B0E81DPL11@010@40000E0003 0@00008020403U81DP5B0E81DP5B0E811e802049DPUB2E811`T0:@49Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T100H900T12E89DPUB2@401U820@0=DP5B0E81DP5B0E81DP0?0@0> DP5B0E81DP5B0E81DP47DP080@UB2E89DP472@0Y0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2@401PT02049DPUB2E811e820@0=DP5B0E81DP5B0E81DP060@D00@4100005@000`40 000200L100eB0E81DP5B0E81DP5B00811e80205B2E89DPT11PT0:P49Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@H900T1DPUB2E89DP401e820@0=DP5B0E81DP5B0E81DP0=0@0> DP5B0E81DP5B0E81DP47DP090@UB2E89DPT100H902X12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`462@080E89DPUB2@48DP8100eB0E81DP5B0E81DP5B00D11@010@40000E0003 0@0000801P403E81DP5B0E81DP5B0E800P47DP090E89DPUB2E8100H902/1Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL100H900P1DPUB2E890@MB0101DP5B0E81DP5B0E81DP5B 2`403E81DP5B0E81DP5B0E800P47DP090E89DPUB2E8100H902/1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL100H900P1DPUB2E890@MB0101DP5B0E81DP5B0E81DP5B10450041 0@0001D000<100000P050@0@DP5B0E81DP5B0E81DP5B0@MB00P12E89DPUB0@H900d1Y`VW2JL9Y`VW 2JL901<100`9Y`VW2JL9Y`VW2@462@090@UB2E89DPT100MB0101DP5B0E81DP5B0E81DP5B2@403E81 DP5B0E81DP5B0E800P47DP090E89DPUB2E8100H900`1Y`VW2JL9Y`VW2JLD0@0<2JL9Y`VW2JL9Y`T1 1PT02049DPUB2E812580405B0E81DP5B0E81DP5B0E830@D00@4100005@020@<010404581DP5B0E81 DP5B0E81DP47DP090@UB2E89DPT100H900d12JL9Y`VW2JL9Y`T101>W00d12JL9Y`VW2JL9Y`T100H9 00P12E89DPUB0@MB0P403e81DP5B0E81DP5B0E81DP070@0@DP5B0E81DP5B0E81DP5B0@MB00T12E89 DPUB2@401PT03049Y`VW2JL9Y`VW0ABW00d12JL9Y`VW2JL9Y`T100H900P12E89DPUB0@MB0P403e81 DP5B0E81DP5B0E81DP020@@00P4100005@000`40000200<100mB0E81DP5B0E81DP5B0E800P47DP08 0E89DPUB2@462@0=0@VW2JL9Y`VW2JL90@0EY`0<0@VW2JL9Y`VW2JL11PT0205B2E89DPT125820@0? DP5B0E81DP5B0E81DP5B00D1011B0E81DP5B0E81DP5B0E812580205B2E89DPT11PT03049Y`VW2JL9 Y`VW0AJW00`12JL9Y`VW2JL9Y`462@080E89DPUB2@48DP81011B0E81DP5B0E81DP5B0E811@010@40 000E00030@0000800P403e81DP5B0E81DP5B0E81DP020@MB00T1DPUB2E89DP401PT02P6W2JL9Y`VW 2JL20ANW0P402ZL9Y`VW2JL9Y`462@080E89DPUB2@47DP0B0E81DP5B0E81DP5B0E81DP5B0`403e81 DP5B0E81DP5B0E81DP020@MB00T1DPUB2E89DP401PT02`6W2JL9Y`VW2JL101RW00`12JL9Y`VW2JL9 Y`462@080E89DPUB2@47DP0C0E81DP5B0E81DP5B0E81DP5B0@0400410@0001D000<100000P00405B 0E81DP5B0E81DP5B0E820@QB00P12E89DPUB0@H900/1Y`VW2JL9Y`VW0@0KY`0:0JL9Y`VW2JL90@H9 00P12E89DPUB0@QB0281DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0P48DP080@UB2E89 DP462@0;0JL9Y`VW2JL9Y`406ZL02`49Y`VW2JL9Y`T100H900P12E89DPUB0@QB0`403U81DP5B0E81 DP5B0E811@010@40000E00030@00008000eB0E81DP5B0E81DP5B00<12E802@49DPUB2E890@062@0: 0@VW2JL9Y`VW0AfW00X1Y`VW2JL9Y`T11PT02049DPUB2E8125830@0NDP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E812E802@49DPUB2E890@062@0:0@VW2JL9Y`VW0AbW00/12JL9Y`VW2JL90@062@08 0@UB2E89DP49DP8100eB0E81DP5B0E81DP5B00D00@4100005@000`400002000<0E81DP5B0E81DP5B 0P4;DP080E89DPUB2@462@0:0@VW2JL9Y`VW0AnW00T1Y`VW2JL9Y`401PT0205B2E89DPT12U820@0L DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0@YB00P1DPUB2E890@H900X12JL9Y`VW2JL17ZL02P49 Y`VW2JL9Y`462@080E89DPUB2@4;DP0=0E81DP5B0E81DP5B0@0500410@0001D000<100000P002e81 DP5B0E81DP5B00812e80205B2E89DPT11PT02P49Y`VW2JL9Y`4QY`090JL9Y`VW2JL100H900P1DPUB 2E890@YB0P405e81DP5B0E81DP5B0E81DP5B0E81DP5B00<12U80205B2E89DPT11PT02P49Y`VW2JL9 Y`4PY`0:0@VW2JL9Y`VW0@H900P1DPUB2E890@]B0`402E81DP5B0E81DP0500410@0001D000<10000 0P00205B0E81DP5B0`4W00T1Y`VW2JL9Y`401PT0205B 2E89DPT12e830@0CDP5B0E81DP5B0E81DP5B0E81DP020@]B00P1DPUB2E890@L900T1Y`VW2JL9Y`40 8ZL02P49Y`VW2JL9Y`462@080E89DPUB2@4DP07 0@UB2E890@072@090JL9Y`VW2JL102JW00T12JL9Y`VW2@401`T0205B2E89DPT13E830@0;DP5B0E81 DP5B0E800P4>DP070@UB2E890@072@090JL9Y`VW2JL102JW00T12JL9Y`VW2@401`T0205B2E89DPT1 3E830@04DP5B0@D00@4100005@000`4000020006DP5B0E813e801`49DPUB2@401`T02@6W2JL9Y`VW 0@0XY`090@VW2JL9Y`T100L900L1DPUB2E8100mB0P402E81DP5B0E81DP020@iB00L12E89DPT100L9 00T1Y`VW2JL9Y`40::L02@49Y`VW2JL90@072@070E89DPUB0@0?DP8100=B0E801@010@40000E0003 0@00008000<1DP400P4?DP070@UB2E890@072@090JL9Y`VW2JL100bW4`4;Y`090@VW2JL9Y`T100L9 00L1DPUB2E81011B0`400e81DP030@mB00L12E89DPT100L900T1Y`VW2JL9Y`402jLD0@^W00T12JL9 Y`VW2@401`T01`5B2E89DP403e820@03DP4000@00@4100005@000`4000020003DP41011B00L12E89 DPT100L900X1Y`VW2JL9Y`T12ZL20@0CY`RW2:L8Y`RW2:L8Y`RW2:L8Y`020@ZW00T12JL9Y`VW2@40 1`T01`5B2E89DP404E820@03DP41011B00L12E89DPT100L900X1Y`VW2JL9Y`T12JL20@0D2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L20@VW00X1Y`VW2JL9Y`T11`T01`5B2E89DP4045820@D00@4100005@020@<0 00<1DU803U820@072E89DPUB0@062@0:0JL9Y`VW2JL90@ZW01T12:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`P100ZW00T12JL9Y`VW2@401PT01`49DPUB2E800P4ADP030E9B00iB0P401`UB2E89DP401PT02P6W 2JL9Y`VW2@49Y`0J0JL8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2049Y`0:0JL9Y`VW2JL90@H900L12E89 DPUB00814580104000020@40000E00030@0000803e820@08DPUB2E89DP462@0:0JL9Y`VW2JL90@VW 0P406PRW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P12ZL02@49Y`VW2JL90@062@080@UB2E89DPT30AeB 0P402589DPUB2E811PT02P6W2JL9Y`VW2@49Y`0L0JL8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L80@VW 00X1Y`VW2JL9Y`T11PT02049DPUB2E890P4>DPD00@4100005@000`40000200aB0`402@UB2E89DPUB 0@062@0:0JL9Y`VW2JL90@VW01d1Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20020@RW00X1Y`VW 2JL9Y`T11PT02P49DPUB2E89DPT20AQB0`402@UB2E89DPUB0@062@0:0JL9Y`VW2JL90@RW0P407:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P20@RW00X1Y`VW2JL9Y`T11PT02@49DPUB2E89DP030@]B 1@010@40000E00030@0000802E830@0;2E89DPUB2E89DP401PT02P6W2JL9Y`VW2@48Y`81022W2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0@RW00X1Y`VW2JL9Y`T11PT02`49DPUB2E89DPUB00<1 4U830@0;2E89DPUB2E89DP401PT02P6W2JL9Y`VW2@48Y`0R0@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW0@RW00X1Y`VW2JL9Y`T11PT02`49DPUB2E89DPUB00812E8500410@0001D000<10000 0P07DP8100d9DPUB2E89DPUB2E8100L900T12JL9Y`VW2@402:L09048Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW0@RW00T1Y`VW2JL9Y`401`T03@49DPUB2E89DPUB2E800`4=DP8100d9DPUB 2E89DPUB2E8100L900T12JL9Y`VW2@401jL20@0S2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`402:L02@6W2JL9Y`VW0@072@0<0@UB2E89DPUB2E890`46DPD00@4100005@000`40000200AB 0`403U89DPUB2E89DPUB2E811`T02@49Y`VW2JL90@08Y`0:0@RW2:L8Y`RW21<100P8Y`RW2:L8Y`81 1jL02@6W2JL9Y`VW0@072@0?0@UB2E89DPUB2E89DPUB008125830@0>DPUB2E89DPUB2E89DP472@09 0@VW2JL9Y`T100NW00X1Y`RW2:L8Y`RW504020RW2:L8Y`RW0P47Y`090JL9Y`VW2JL100L900h12E89 DPUB2E89DPUB2@<10e8500410@0001D000<100000P02DP81011B2E89DPUB2E89DPUB2E811`T02@49 Y`VW2JL90@07Y`8100P8Y`RW2:L8Y`814`P20@09Y`RW2:L8Y`P100NW00T1Y`VW2JL9Y`401`T04049 DPUB2E89DPUB2E89DPT30@=B0P404589DPUB2E89DPUB2E89DP472@090@VW2JL9Y`T100NW00T1Y`RW 2:L8Y`P00P4D208100VW2:L8Y`RW20401jL02@6W2JL9Y`VW0@072@0@0@UB2E89DPUB2E89DPUB2@81 00=B00000`010@40000E00030@0000800P403`UB2E89DPUB2E89DPUB2@020@L900T12JL9Y`VW2@40 1jL02@6W2:L8Y`RW20020AL80P401`RW2:L8Y`P00P46Y`090JL9Y`VW2JL100L901812E89DPUB2E89 DPUB2E89DPT30@0?2E89DPUB2E89DPUB2E8900811`T02@49Y`VW2JL90@06Y`8100NW2:L8Y`RW0081 60P02@6W2:L8Y`RW20020@JW00T1Y`VW2JL9Y`401`T20@0?DPUB2E89DPUB2E89DPUB008110010@40 000E00030@00008000mB2E89DPUB2E89DPUB2E800P482@090@VW2JL9Y`T100JW0P402JL8Y`RW2:L8 0@0K200:0@RW2:L8Y`RW0@JW00T1Y`VW2JL9Y`401`T20@0ODPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DP020@P900T12JL9Y`VW2@401ZL02P48Y`RW2:L8Y`4K208100T8Y`RW2:L8Y`401ZL02@6W 2JL9Y`VW0@082@<100eB2E89DPUB2E89DPUB00D00@4100005@000`400002000<2E89DPUB2E89DPUB 0`492@090@VW2JL9Y`T100JW00T12:L8Y`RW2:L00P4M208100RW2:L8Y`RW0@JW00T1Y`VW2JL9Y`40 20T20@0K2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E8900812@T02@49Y`VW2JL90@06Y`080@RW2:L8 Y`P20Ah800X12:L8Y`RW2:L11ZL02@6W2JL9Y`VW0@0:2@8100/9DPUB2E89DPUB2@0500410@0001D0 00<100000P002U89DPUB2E89DPT20@/900T12JL9Y`VW2@401JL20@072:L8Y`RW20020B480P401PRW 2:L8Y`<11:L02@6W2JL9Y`VW0@092@8101MB2E89DPUB2E89DPUB2E89DPUB2E89DP020@X900T12JL9 Y`VW2@401:L30@062:L8Y`RW0P4Q208100NW2:L8Y`RW00<11:L02@6W2JL9Y`VW0@0;2@<100P9DPUB 2E89DPD00@4100005@000`40000200072E89DPUB2@030@/90P4020VW2JL9Y`T11JL02P6W2:L8Y`RW 204U20090@RW2:L8Y`P100FW00T1Y`VW2JL9Y`402PT30@0BDPUB2E89DPUB2E89DPUB2E890P4:2@81 00P9Y`VW2JL90@FW00T1Y`RW2:L8Y`409@P02P6W2:L8Y`RW2045Y`090JL9Y`VW2JL100d90`401@UB 2E8900D00@4100005@020@<000AB2E890`4<2@8100VW2JL9Y`VW2@401JL02P6W2:L8Y`RW204:21<1 2PP02@48Y`RW2:L80@05Y`080JL9Y`VW2JL20@/910402PUB2E89DPUB2E840@X90P402JL9Y`VW2JL9 0@05Y`090JL8Y`RW2:L100X85049200:0JL8Y`RW2:L80@FW00P1Y`VW2JL9Y`813PT20@03DPUB00@0 0P4100005@000`40000200042E810@h900/12JL9Y`VW2JL90@06Y`090@RW2:L8Y`P100X801D12008 00P0200800P0200800P020402PP02048Y`RW2:L11ZL02@6W2JL9Y`VW2@020@d910400e89DP030@d9 00/12JL9Y`VW2JL90@06Y`080@RW2:L8Y`4:200F0@0800P0200800P0200800P020080@T800T1Y`RW 2:L8Y`401ZL02@6W2JL9Y`VW2@020@h90P400`T0000300410@0001D000<100000P020@h90P402PVW 2JL9Y`VW2@46Y`090@RW2:L8Y`P100X801L1200800P0200800P0200800P020080@0:20080@RW2:L8 Y`46Y`0:0JL9Y`VW2JL9Y`813`T30@h90P402PVW2JL9Y`VW2@46Y`080@RW2:L8Y`4:200H0@0800P0 200800P0200800P0200800P12@P02@6W2:L8Y`RW0@06Y`0:0JL9Y`VW2JL9Y`813PT20@@00@410000 5@000`40000200h90P402jL9Y`VW2JL9Y`T100JW00L12:L8Y`RW00812PP06@4800P0200800P02008 00P0200800P020402PP02048Y`RW2:L11ZL02`6W2JL9Y`VW2JL9008170T20@0;Y`VW2JL9Y`VW2@40 1ZL02048Y`RW2:L12PP06P40200800P0200800P0200800P0200800P12@P20@072:L8Y`RW0@06Y`0; 0JL9Y`VW2JL9Y`T00P4=2@D00@4100005@000`40000200`90P402PVW2JL9Y`VW2JL20@JW00P12:L8 Y`RW0@/801/1200800P0200800P0200800P0200800P020402PP02048Y`RW2:L11ZL0306W2JL9Y`VW 2JL9Y`8160T20@0:2JL9Y`VW2JL9Y`811ZL02048Y`RW2:L12PP07040200800P0200800P0200800P0 200800P0204:20080@RW2:L8Y`46Y`0<0JL9Y`VW2JL9Y`VW0P4;2@D00@4100005@000`40000200X9 0P403:L9Y`VW2JL9Y`VW0@RW00L1Y`RW2:L100/801d1200800P0200800P0200800P0200800P02008 0@0:20070@RW2:L80@07Y`8100/9Y`VW2JL9Y`VW2@020A@90P403:L9Y`VW2JL9Y`VW0@RW00L1Y`RW 2:L100X801h100P0200800P0200800P0200800P0200800P0204:20070@RW2:L80@07Y`8100/9Y`VW 2JL9Y`VW2@020@T91@010@40000E00030@0000802@T03P49Y`VW2JL9Y`VW2JL12:L01`6W2:L8Y`40 2`P07`4800P0200800P0200800P0200800P0200800P020402PP01`48Y`RW20402:L03@49Y`VW2JL9 Y`VW2JL00P4A2@0>0@VW2JL9Y`VW2JL9Y`48Y`070JL8Y`RW0@0:200P0@0800P0200800P0200800P0 200800P0200800P0204:20070@RW2:L80@08Y`0>0@VW2JL9Y`VW2JL9Y`482@D00@4100005@000`40 000200L90P403@VW2JL9Y`VW2JL9Y`402:L01`6W2:L8Y`402`P08@4800P0200800P0200800P02008 00P0200800P020080@0:20070@RW2:L80@08Y`0>0@VW2JL9Y`VW2JL9Y`T20@d90P403@VW2JL9Y`VW 2JL9Y`402:L01`6W2:L8Y`402PP08P40200800P0200800P0200800P0200800P0200800P0204:2007 0@RW2:L80@08Y`0=0@VW2JL9Y`VW2JL9Y`020@H91@010@40000E00030@0000801@T20@0>Y`VW2JL9 Y`VW2JL9Y`49Y`070@RW2:L80@09208100L800P0200801<100P800P020080@X800L12:L8Y`P100RW 00l12JL9Y`VW2JL9Y`VW2JL00P492@8100jW2JL9Y`VW2JL9Y`VW0@VW00L12:L8Y`P100T800P100P0 200801@100P800P020080@X800L12:L8Y`P100RW00h12JL9Y`VW2JL9Y`VW2@8110T500410@0001D0 00<100000P032@8100l9Y`VW2JL9Y`VW2JL9Y`402JL01`48Y`RW20402@P02P40200800P0204C0009 0@P0200800P100T800L1Y`RW2:L100VW01012JL9Y`VW2JL9Y`VW2JL90P452@8100l9Y`VW2JL9Y`VW 2JL9Y`402JL01`48Y`RW20402@P02@40200800P00@0D00090@P0200800P100T800L1Y`RW2:L100VW 00l12JL9Y`VW2JL9Y`VW2JL00P422@D00@4100005@000`400002000C2@41Y`VW2JL9Y`VW2JL9Y`VW 0@09Y`080@RW2:L8Y`48200:0@0800P020080AD000T1200800P020402@P01`6W2:L8Y`402JL04@49 Y`VW2JL9Y`VW2JL9Y`VW008101<90@6W2JL9Y`VW2JL9Y`VW2JL100VW00P12:L8Y`RW0@P800T100P0 200800405P002@4800P020080@0920070JL8Y`RW0@09Y`0@0@VW2JL9Y`VW2JL9Y`VW2@811@010@40 000E00030@00008001812JL9Y`VW2JL9Y`VW2JL9Y`49Y`080@RW2:L8Y`48200:0@0800P020080AL0 00T1200800P0204020P02048Y`RW2:L12JL09049Y`VW2JL9Y`VW2JL9Y`VW2@49Y`VW2JL9Y`VW2JL9 Y`VW0@VW00P12:L8Y`RW0@P800T100P02008004060002@4800P020080@0820080@RW2:L8Y`49Y`0B 0@VW2JL9Y`VW2JL9Y`VW2JL110010@40000E00030@0000800149Y`VW2JL9Y`VW2JL9Y`VW0@0:Y`08 0JL8Y`RW2047200:0@0800P020080AT000T1200800P0204020P01`48Y`RW20402ZL08P49Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`4:Y`080JL8Y`RW204720090@0800P0200101X000T12008 00P0204020P01`48Y`RW20402ZL04049Y`VW2JL9Y`VW2JL9Y`T500410@0001D00P43000>Y`VW2JL9 Y`VW2JL9Y`T20@ZW00P1Y`RW2:L80@L800X100P0200800P16`002@4800P020080@0720080JL8Y`RW 204:Y`0P0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`4:Y`080JL8Y`RW2047200:0@0800P0 20080AX000X100P0200800P11`P0206W2:L8Y`P12ZL03`49Y`VW2JL9Y`VW2JL9Y`0400810@0001D0 00<100000P003PVW2JL9Y`VW2JL9Y`T12jL02@6W2:L8Y`RW0@06200:0@0800P020080Ad000T12008 00P020401`P0206W2:L8Y`P12ZL07`49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@402JL02@6W 2:L8Y`RW0@06200:0@0800P020080A`000X100P0200800P11`P0206W2:L8Y`P12ZL20@0Y`VW2JL9Y`VW2JL9 Y`49Y`070@RW2:L80@09208100L800P0200801<100P800P020080@X800L12:L8Y`P100RW00l12JL9 Y`VW2JL9Y`VW2JL00P492@8100jW2JL9Y`VW2JL9Y`VW0@VW00L12:L8Y`P100T800P100P0200801@1 00P800P020080@X800L12:L8Y`P100RW00h12JL9Y`VW2JL9Y`VW2@8110T500410@0001D000<10000 0P072@8100d9Y`VW2JL9Y`VW2JL100RW00L1Y`RW2:L100/80241200800P0200800P0200800P02008 00P0200800P020402PP01`48Y`RW20402:L03P49Y`VW2JL9Y`VW2JL90P4=2@8100d9Y`VW2JL9Y`VW 2JL100RW00L1Y`RW2:L100X8028100P0200800P0200800P0200800P0200800P0200800P12PP01`48 Y`RW20402:L03@49Y`VW2JL9Y`VW2JL00P462@D00@4100005@000`40000200T900h12JL9Y`VW2JL9 Y`VW0@RW00L1Y`RW2:L100/801l1200800P0200800P0200800P0200800P0200800P100X800L12:L8 Y`P100RW00d12JL9Y`VW2JL9Y`VW00814@T03P49Y`VW2JL9Y`VW2JL12:L01`6W2:L8Y`402PP08040 200800P0200800P0200800P0200800P0200800P12PP01`48Y`RW20402:L03P49Y`VW2JL9Y`VW2JL1 20T500410@0001D000<100000P0:2@8100bW2JL9Y`VW2JL9Y`48Y`070JL8Y`RW0@0;200M0@P02008 00P0200800P0200800P0200800P020402PP01`48Y`RW20401jL20@0;2JL9Y`VW2JL9Y`T00P4D2@81 00bW2JL9Y`VW2JL9Y`48Y`070JL8Y`RW0@0:200N0@0800P0200800P0200800P0200800P0200800P1 2PP01`48Y`RW20401jL20@0;2JL9Y`VW2JL9Y`T00P492@D00@4100005@000`40000200`90P402PVW 2JL9Y`VW2JL20@JW00P12:L8Y`RW0@/801/1200800P0200800P0200800P0200800P020402PP02048 Y`RW2:L11ZL0306W2JL9Y`VW2JL9Y`8160T20@0:2JL9Y`VW2JL9Y`811ZL02048Y`RW2:L12PP07040 200800P0200800P0200800P0200800P0204:20080@RW2:L8Y`46Y`0<0JL9Y`VW2JL9Y`VW0P4;2@D0 0@4100005@000`40000200h90P402jL9Y`VW2JL9Y`T100JW00L12:L8Y`RW00812PP06@4800P02008 00P0200800P0200800P020402PP02048Y`RW2:L11ZL02`6W2JL9Y`VW2JL9008170T20@0;Y`VW2JL9 Y`VW2@401ZL02048Y`RW2:L12PP06P40200800P0200800P0200800P0200800P12@P20@072:L8Y`RW 0@06Y`0;0JL9Y`VW2JL9Y`T00P4=2@D00@4100005@000`40000200813PT20@0:2JL9Y`VW2JL90@JW 00T12:L8Y`RW20402PP05`4800P0200800P0200800P0200800P100X800P12:L8Y`RW0@JW00X1Y`VW 2JL9Y`VW0P4?2@<13PT20@0:2JL9Y`VW2JL90@JW00P12:L8Y`RW0@X801P100P0200800P0200800P0 200800P0204920090JL8Y`RW2:L100JW00X1Y`VW2JL9Y`VW0P4>2@8110010@40000E00030@000080 00@9DP413PT02`49Y`VW2JL9Y`T100JW00T12:L8Y`RW20402PP05@4800P0200800P0200800P02008 0@0:20080@RW2:L8Y`46Y`090JL9Y`VW2JL900813@T40@03DPUB00<13@T02`49Y`VW2JL9Y`T100JW 00P12:L8Y`RW0@X801H100P0200800P0200800P0200800P12@P02@6W2:L8Y`RW0@06Y`090JL9Y`VW 2JL900813PT20@032@0000<00@4100005@020@<000AB2E890`4<2@8100VW2JL9Y`VW2@401JL02P6W 2:L8Y`RW204:21<12PP02@48Y`RW2:L80@05Y`080JL9Y`VW2JL20@/910402PUB2E89DPUB2E840@X9 0P402JL9Y`VW2JL90@05Y`090JL8Y`RW2:L100X85049200:0JL8Y`RW2:L80@FW00P1Y`VW2JL9Y`81 3PT20@03DPUB00@00P4100005@000`40000200072E89DPUB2@030@/90P4020VW2JL9Y`T11JL20@08 2:L8Y`RW204U20090@RW2:L8Y`P100FW00T1Y`VW2JL9Y`402PT30@0BDPUB2E89DPUB2E89DPUB2E89 0P4:2@8100P9Y`VW2JL90@FW00T1Y`RW2:L8Y`409@P02P6W2:L8Y`RW2045Y`090JL9Y`VW2JL100d9 0`401@UB2E8900D00@4100005@000`400002000:DPUB2E89DPUB2@812`T02@49Y`VW2JL90@05Y`81 00L8Y`RW2:L800818@P20@062:L8Y`RW0P45Y`090JL9Y`VW2JL100T90P405e89DPUB2E89DPUB2E89 DPUB2E89DPUB00812PT02@49Y`VW2JL90@05Y`8100H8Y`RW2:L20B480P401jL8Y`RW2:L00P45Y`09 0JL9Y`VW2JL100/90`4020UB2E89DPUB1@010@40000E00030@00008000`9DPUB2E89DPUB2E830@T9 00T12JL9Y`VW2@401ZL02@48Y`RW2:L8Y`020Ad80P402:L8Y`RW2:L11ZL02@6W2JL9Y`VW0@082@81 01/9DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPT00P492@090@VW2JL9Y`T100JW00P12:L8Y`RW2081 7PP02P48Y`RW2:L8Y`46Y`090JL9Y`VW2JL100X90P402`UB2E89DPUB2E8900D00@4100005@000`40 0002000?DPUB2E89DPUB2E89DPUB008120T02@49Y`VW2JL90@06Y`8100VW2:L8Y`RW20406`P02P48 Y`RW2:L8Y`46Y`090JL9Y`VW2JL100L90P407e89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E80 0P482@090@VW2JL9Y`T100JW00X12:L8Y`RW2:L16`P20@092:L8Y`RW2:L100JW00T1Y`VW2JL9Y`40 20T30@0=DPUB2E89DPUB2E89DP0500410@0001D000<100000P020@0?2E89DPUB2E89DPUB2E890081 1`T02@49Y`VW2JL90@07Y`090JL8Y`RW2:L800815`P20@072:L8Y`RW20020@JW00T1Y`VW2JL9Y`40 1`T04P49DPUB2E89DPUB2E89DPUB2@<100l9DPUB2E89DPUB2E89DPT00P472@090@VW2JL9Y`T100JW 0P401jL8Y`RW2:L00P4H20090JL8Y`RW2:L800811ZL02@6W2JL9Y`VW0@072@8100mB2E89DPUB2E89 DPUB2E800P4400410@0001D000<100000P02DP81011B2E89DPUB2E89DPUB2E811`T02@49Y`VW2JL9 0@07Y`8100P8Y`RW2:L8Y`814`P20@09Y`RW2:L8Y`P100NW00T1Y`VW2JL9Y`401`T04049DPUB2E89 DPUB2E89DPT30@=B0P404589DPUB2E89DPUB2E89DP472@090@VW2JL9Y`T100NW00T1Y`RW2:L8Y`P0 0P4D208100VW2:L8Y`RW20401jL02@6W2JL9Y`VW0@072@0@0@UB2E89DPUB2E89DPUB2@8100=B0000 0`010@40000E00030@00008015830@0>DPUB2E89DPUB2E89DP472@090@VW2JL9Y`T100RW00X12:L8 Y`RW2:L84`4020RW2:L8Y`RW0P47Y`090JL9Y`VW2JL100L900l12E89DPUB2E89DPUB2E800P48DP<1 00iB2E89DPUB2E89DPUB0@L900T12JL9Y`VW2@401jL02P6W2:L8Y`RW2:LD0@082:L8Y`RW2:L20@NW 00T1Y`VW2JL9Y`401`T03P49DPUB2E89DPUB2E890`43DPD00@4100005@000`40000200MB0P403@UB 2E89DPUB2E89DP401`T02@49Y`VW2JL90@08Y`0T0@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L12:L02@6W2JL9Y`VW0@072@0=0@UB2E89DPUB2E89DP030@eB0P403@UB2E89DPUB2E89DP40 1`T02@49Y`VW2JL90@07Y`8102<8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0@08Y`09 0JL9Y`VW2JL100L900`12E89DPUB2E89DPT30@IB1@010@40000E00030@0000802E830@0;2E89DPUB 2E89DP401PT02P6W2JL9Y`VW2@48Y`81022W2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0@RW 00X1Y`VW2JL9Y`T11PT02`49DPUB2E89DPUB00<14U830@0;2E89DPUB2E89DP401PT02P6W2JL9Y`VW 2@48Y`0R0@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0@RW00X1Y`VW2JL9Y`T11PT02`49 DPUB2E89DPUB00812E8500410@0001D000<100000P0DP81 00L9DPUB2E8100H900X1Y`VW2JL9Y`T12JL06P6W2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P12JL02P6W 2JL9Y`VW2@462@070@UB2E89DP020A1B00@100000P4100005@000`4000020003DP41011B00L12E89 DPT100L900X1Y`VW2JL9Y`T12ZL20@0CY`RW2:L8Y`RW2:L8Y`RW2:L8Y`020@ZW00T12JL9Y`VW2@40 1`T01`5B2E89DP404E820@03DP41011B00L12E89DPT100L900X1Y`VW2JL9Y`T12JL20@0D2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L20@VW00X1Y`VW2JL9Y`T11`T01`5B2E89DP4045820@D00@4100005@000`40 000200030E8100813e801`49DPUB2@401`T02@6W2JL9Y`VW0@0DP070@UB2E890@072@090JL9Y`VW2JL102RW00T12JL9Y`VW2@401`T01`5B2E89DP403e820@03 DP5B00D00@4100005@000`40000200060E81DP5B0P4>DP070@UB2E890@072@090JL9Y`VW2JL102JW 00T12JL9Y`VW2@401`T0205B2E89DPT13E830@0;DP5B0E81DP5B0E800P4>DP070@UB2E890@072@09 0JL9Y`VW2JL102JW00T12JL9Y`VW2@401`T0205B2E89DPT13E830@04DP5B0@D00@4100005@000`40 00020007DP5B0E81DP020@eB00P1DPUB2E890@L900T1Y`VW2JL9Y`409JL0206W2JL9Y`T11`T0205B 2E89DPT135820@0?DP5B0E81DP5B0E81DP5B00<13580205B2E89DPT11`T02@6W2JL9Y`VW0@0TY`09 0@VW2JL9Y`T100L900P1DPUB2E890@eB00P1DP5B0E81DPD00@4100005@000`40000200080E81DP5B 0E830@aB00P1DPUB2E890@L900T1Y`VW2JL9Y`408jL02@6W2JL9Y`VW0@062@080E89DPUB2@4;DP<1 01=B0E81DP5B0E81DP5B0E81DP5B00812e80205B2E89DPT11`T02@6W2JL9Y`VW0@0RY`0:0@VW2JL9 Y`VW0@H900P1DPUB2E890@aB0P402581DP5B0E811@010@40000E00030@00008000]B0E81DP5B0E81 DP020@]B00P1DPUB2E890@H900X12JL9Y`VW2JL18JL02@6W2JL9Y`VW0@062@080E89DPUB2@4:DP81 01MB0E81DP5B0E81DP5B0E81DP5B0E81DP030@YB00P1DPUB2E890@H900X12JL9Y`VW2JL18:L02P49 Y`VW2JL9Y`462@080E89DPUB2@4;DP<100UB0E81DP5B0E801@010@40000E00030@00008000`1DP5B 0E81DP5B0E820@]B00P1DPUB2E890@H900X12JL9Y`VW2JL17jL02@6W2JL9Y`VW0@062@080E89DPUB 2@4:DP8101aB0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E812U80205B2E89DPT11PT02P49Y`VW2JL9 Y`4NY`0:0@VW2JL9Y`VW0@H900P1DPUB2E890@]B00d1DP5B0E81DP5B0E8100D00@4100005@000`40 0002000=DP5B0E81DP5B0E81DP020@YB00P12E89DPUB0@L900X12JL9Y`VW2JL17JL02P6W2JL9Y`VW 2@462@080@UB2E89DP49DP8101iB0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP49DP080@UB2E89 DP472@0:0@VW2JL9Y`VW0AbW00/12JL9Y`VW2JL90@062@080@UB2E89DP4:DP0>0E81DP5B0E81DP5B 0E8500410@0001D000<100000P003P5B0E81DP5B0E81DP5B0`49DP080@UB2E89DP462@0;0JL9Y`VW 2JL9Y`406jL02P6W2JL9Y`VW2@462@080@UB2E89DP49DP81021B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0@UB00P12E89DPUB0@H900/1Y`VW2JL9Y`VW0@0KY`0:0JL9Y`VW2JL90@H900P12E89 DPUB0@UB0P403U81DP5B0E81DP5B0E811@010@40000E00030@000080019B0E81DP5B0E81DP5B0E81 DP48DP080E89DPUB2@472@0;0JL9Y`VW2JL9Y`406JL02`6W2JL9Y`VW2JL100H900P1DPUB2E890@QB 0P408U81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP48DP080E89DPUB2@472@0:0JL9Y`VW 2JL90AZW00/1Y`VW2JL9Y`VW0@062@080E89DPUB2@48DP8100mB0E81DP5B0E81DP5B0E801@010@40 000E00030@00008001<1DP5B0E81DP5B0E81DP5B0E8100QB00P1DPUB2E890@H900`12JL9Y`VW2JL9 Y`4HY`0:0@VW2JL9Y`VW0@H900P1DPUB2E890@QB0P409581DP5B0E81DP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0@QB00P1DPUB2E890@H900/12JL9Y`VW2JL90@0HY`0;0JL9Y`VW2JL9Y`401PT0205B 2E89DPT125820@0?DP5B0E81DP5B0E81DP5B008110010@40000E00810`020@0BDP5B0E81DP5B0E81 DP5B0E811e802049DPUB2E811`T02`49Y`VW2JL9Y`T101NW00/12JL9Y`VW2JL90@062@080@UB2E89 DP48DP0B0E81DP5B0E81DP5B0E81DP5B0`404U81DP5B0E81DP5B0E81DP5B0@MB00P12E89DPUB0@L9 00/12JL9Y`VW2JL90@0FY`0<0JL9Y`VW2JL9Y`T11PT02049DPUB2E812580405B0E81DP5B0E81DP5B 0E820@@00P4100005@000`40000200<100mB0E81DP5B0E81DP5B0E800P48DP070@UB2E890@072@0< 0JL9Y`VW2JL9Y`T15JL02`49Y`VW2JL9Y`T100L900P1DPUB2E890@MB0181DP5B0E81DP5B0E81DP5B 0E850@0?DP5B0E81DP5B0E81DP5B00811e80205B2E89DPT11`T0306W2JL9Y`VW2JL90AFW00/12JL9 Y`VW2JL90@072@070E89DPUB0@08DP0@0E81DP5B0E81DP5B0E81DP<11@010@40000E00030@000080 10403e81DP5B0E81DP5B0E81DP020@MB00P1DPUB2E890@L900`1Y`VW2JL9Y`VW2@4CY`0<0@VW2JL9 Y`VW2JL11PT0205B2E89DPT125820@0?DP5B0E81DP5B0E81DP5B00L100mB0E81DP5B0E81DP5B0E80 0P47DP080E89DPUB2@472@0;0JL9Y`VW2JL9Y`405:L03049Y`VW2JL9Y`VW0@H900P1DPUB2E890@QB 0P403E81DP5B0E81DP5B0E80104500410@0001D000<100000P050@0@DP5B0E81DP5B0E81DP5B0@QB 00L1DPUB2E8100L900`12JL9Y`VW2JL9Y`TC0@0;2JL9Y`VW2JL9Y`401`T02049DPUB2E811e820@0? DP5B0E81DP5B0E81DP5B00T1011B0E81DP5B0E81DP5B0E811e802049DPUB2E811`T02`49Y`VW2JL9 Y`VW01@100/9Y`VW2JL9Y`VW0@072@070@UB2E890@08DP8100eB0E81DP5B0E81DP5B00D11@010@40 000E00030@0000801P404581DP5B0E81DP5B0E81DP47DP080@UB2E89DP472@0Y0@VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@401PT02@49DPUB2E890@07DP0@0E81DP5B0E81DP5B 0E81DP/1011B0E81DP5B0E81DP5B0E811e802049DPUB2E811`T0:@49Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T100H900P12E89DPUB0@QB00h1DP5B0E81DP5B0E81DPH11@010@40 000E00030@0000801`403E81DP5B0E81DP5B0E800P47DP080E89DPUB2@472@0X0JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@L900P1DPUB2E890@MB0101DP5B0E81DP5B0E81DP5B 3@403E81DP5B0E81DP5B0E800P47DP080E89DPUB2@472@0X0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL90@L900P1DPUB2E890@MB00h1DP5B0E81DP5B0E81DPL11@010@40000E0003 0@00008020403E81DP5B0E81DP5B0E800P47DP070E89DPUB0@082@0W0JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL100L900P12E89DPUB0@MB0P402e81DP5B0E81DP5B01<100]B0E81 DP5B0E81DP020@IB00P12E89DPUB0@P902L1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`401`T01`49DPUB2@4025820@0;DP5B0E81DP5B0E80204500410@0001D000<100000P090@0= DP5B0E81DP5B0E81DP020@IB00P12E89DPUB0@L902H12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW0@L900P12E89DPUB0@MB0P402e81DP5B0E81DP5B01D100aB0E81DP5B0E81DP47DP08 0@UB2E89DP472@0V0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`472@080@UB2E89 DP47DP8100]B0E81DP5B0E81DP090@D00@4100005@000`40000200X100iB0E81DP5B0E81DP5B0@MB 00L12E89DPT100P902D12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T100L900P1DPUB 2E890@MB00`1DP5B0E81DP5B0E8G0@00@D00@4100003@000`40000500810`0?0@0"], ImageRangeCache->{{{0, 287}, {287, 0}} -> {-0.207, -0.172242, 0.00783272, 0.00783272}}], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] ContourGraphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ContourPlot[Y, {x, 0, 2}, \ {y, 0, 2}]\)], "Input"], Cell[GraphicsData["PostScript", "\<\ %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart /Mabs { Mgmatrix idtransform Mtmatrix dtransform } bind def /Mabsadd { Mabs 3 -1 roll add 3 1 roll add exch } bind def %% ContourGraphics %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10 scalefont setfont % Scaling calculations 0.0192308 0.480769 0.0192308 0.480769 [ [.01923 -0.0125 -3 -9 ] [.01923 -0.0125 3 0 ] [.25962 -0.0125 -9 -9 ] [.25962 -0.0125 9 0 ] [.5 -0.0125 -3 -9 ] [.5 -0.0125 3 0 ] [.74038 -0.0125 -9 -9 ] [.74038 -0.0125 9 0 ] [.98077 -0.0125 -3 -9 ] [.98077 -0.0125 3 0 ] [ 0 0 -0.125 0 ] [-0.0125 .01923 -6 -4.5 ] [-0.0125 .01923 0 4.5 ] [-0.0125 .25962 -18 -4.5 ] [-0.0125 .25962 0 4.5 ] [-0.0125 .5 -6 -4.5 ] [-0.0125 .5 0 4.5 ] [-0.0125 .74038 -18 -4.5 ] [-0.0125 .74038 0 4.5 ] [-0.0125 .98077 -6 -4.5 ] [-0.0125 .98077 0 4.5 ] [ 0 0 -0.125 0 ] [ 0 1 .125 0 ] [ 1 0 .125 0 ] [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath 0 g .25 Mabswid .01923 0 m .01923 .00625 L s [(0)] .01923 -0.0125 0 1 Mshowa .25962 0 m .25962 .00625 L s [(0.5)] .25962 -0.0125 0 1 Mshowa .5 0 m .5 .00625 L s [(1)] .5 -0.0125 0 1 Mshowa .74038 0 m .74038 .00625 L s [(1.5)] .74038 -0.0125 0 1 Mshowa .98077 0 m .98077 .00625 L s [(2)] .98077 -0.0125 0 1 Mshowa .125 Mabswid .06731 0 m .06731 .00375 L s .11538 0 m .11538 .00375 L s .16346 0 m .16346 .00375 L s .21154 0 m .21154 .00375 L s .30769 0 m .30769 .00375 L s .35577 0 m .35577 .00375 L s .40385 0 m .40385 .00375 L s .45192 0 m .45192 .00375 L s .54808 0 m .54808 .00375 L s .59615 0 m .59615 .00375 L s .64423 0 m .64423 .00375 L s .69231 0 m .69231 .00375 L s .78846 0 m .78846 .00375 L s .83654 0 m .83654 .00375 L s .88462 0 m .88462 .00375 L s .93269 0 m .93269 .00375 L s .25 Mabswid 0 0 m 1 0 L s 0 .01923 m .00625 .01923 L s [(0)] -0.0125 .01923 1 0 Mshowa 0 .25962 m .00625 .25962 L s [(0.5)] -0.0125 .25962 1 0 Mshowa 0 .5 m .00625 .5 L s [(1)] -0.0125 .5 1 0 Mshowa 0 .74038 m .00625 .74038 L s [(1.5)] -0.0125 .74038 1 0 Mshowa 0 .98077 m .00625 .98077 L s [(2)] -0.0125 .98077 1 0 Mshowa .125 Mabswid 0 .06731 m .00375 .06731 L s 0 .11538 m .00375 .11538 L s 0 .16346 m .00375 .16346 L s 0 .21154 m .00375 .21154 L s 0 .30769 m .00375 .30769 L s 0 .35577 m .00375 .35577 L s 0 .40385 m .00375 .40385 L s 0 .45192 m .00375 .45192 L s 0 .54808 m .00375 .54808 L s 0 .59615 m .00375 .59615 L s 0 .64423 m .00375 .64423 L s 0 .69231 m .00375 .69231 L s 0 .78846 m .00375 .78846 L s 0 .83654 m .00375 .83654 L s 0 .88462 m .00375 .88462 L s 0 .93269 m .00375 .93269 L s .25 Mabswid 0 0 m 0 1 L s .01923 .99375 m .01923 1 L s .25962 .99375 m .25962 1 L s .5 .99375 m .5 1 L s .74038 .99375 m .74038 1 L s .98077 .99375 m .98077 1 L s .125 Mabswid .06731 .99625 m .06731 1 L s .11538 .99625 m .11538 1 L s .16346 .99625 m .16346 1 L s .21154 .99625 m .21154 1 L s .30769 .99625 m .30769 1 L s .35577 .99625 m .35577 1 L s .40385 .99625 m .40385 1 L s .45192 .99625 m .45192 1 L s .54808 .99625 m .54808 1 L s .59615 .99625 m .59615 1 L s .64423 .99625 m .64423 1 L s .69231 .99625 m .69231 1 L s .78846 .99625 m .78846 1 L s .83654 .99625 m .83654 1 L s .88462 .99625 m .88462 1 L s .93269 .99625 m .93269 1 L s .25 Mabswid 0 1 m 1 1 L s .99375 .01923 m 1 .01923 L s .99375 .25962 m 1 .25962 L s .99375 .5 m 1 .5 L s .99375 .74038 m 1 .74038 L s .99375 .98077 m 1 .98077 L s .125 Mabswid .99625 .06731 m 1 .06731 L s .99625 .11538 m 1 .11538 L s .99625 .16346 m 1 .16346 L s .99625 .21154 m 1 .21154 L s .99625 .30769 m 1 .30769 L s .99625 .35577 m 1 .35577 L s .99625 .40385 m 1 .40385 L s .99625 .45192 m 1 .45192 L s .99625 .54808 m 1 .54808 L s .99625 .59615 m 1 .59615 L s .99625 .64423 m 1 .64423 L s .99625 .69231 m 1 .69231 L s .99625 .78846 m 1 .78846 L s .99625 .83654 m 1 .83654 L s .99625 .88462 m 1 .88462 L s .99625 .93269 m 1 .93269 L s .25 Mabswid 1 0 m 1 1 L s 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath .5 g .01923 .98077 m .98077 .98077 L .98077 .01923 L .01923 .01923 L F 0 g .5 Mabswid .6 g .01923 .24501 m .08791 .2434 L .15659 .23612 L .19287 .22527 L .22527 .19287 L .23612 .15659 L .2434 .08791 L .24501 .01923 L .01923 .01923 L F 0 g .01923 .24501 m .08791 .2434 L .15659 .23612 L .19287 .22527 L .22527 .19287 L .23612 .15659 L .2434 .08791 L .24501 .01923 L s .4 g .01923 .72578 m .08791 .72416 L .15659 .71689 L .19287 .70604 L .22527 .67364 L .23612 .63736 L .2434 .56868 L .24501 .5 L .2434 .43132 L .23612 .36264 L .22527 .32636 L .19287 .29396 L .15659 .28311 L .08791 .27584 L .01923 .27422 L F 0 g .01923 .72578 m .08791 .72416 L .15659 .71689 L .19287 .70604 L .22527 .67364 L .23612 .63736 L .2434 .56868 L .24501 .5 L .2434 .43132 L .23612 .36264 L .22527 .32636 L .19287 .29396 L .15659 .28311 L .08791 .27584 L .01923 .27422 L s .6 g .01923 .75499 m .08791 .7566 L .15659 .76388 L .19287 .77473 L .22527 .80713 L .23612 .84341 L .2434 .91209 L .24501 .98077 L .01923 .98077 L F 0 g .01923 .75499 m .08791 .7566 L .15659 .76388 L .19287 .77473 L .22527 .80713 L .23612 .84341 L .2434 .91209 L .24501 .98077 L s .7 g .01923 .21567 m .08791 .21083 L .15659 .18768 L .18768 .15659 L .21083 .08791 L .21567 .01923 L .01923 .01923 L F 0 g .01923 .21567 m .08791 .21083 L .15659 .18768 L .18768 .15659 L .21083 .08791 L .21567 .01923 L s .3 g .01923 .69644 m .08791 .69159 L .15659 .66845 L .18768 .63736 L .21083 .56868 L .21567 .5 L .21083 .43132 L .18768 .36264 L .15659 .33155 L .08791 .30841 L .01923 .30356 L F 0 g .01923 .69644 m .08791 .69159 L .15659 .66845 L .18768 .63736 L .21083 .56868 L .21567 .5 L .21083 .43132 L .18768 .36264 L .15659 .33155 L .08791 .30841 L .01923 .30356 L s .7 g .01923 .78433 m .08791 .78917 L .15659 .81232 L .18768 .84341 L .21083 .91209 L .21567 .98077 L .01923 .98077 L F 0 g .01923 .78433 m .08791 .78917 L .15659 .81232 L .18768 .84341 L .21083 .91209 L .21567 .98077 L s .8 g .01923 .18453 m .08791 .17501 L .13801 .15659 L .15659 .13801 L .17501 .08791 L .18453 .01923 L .01923 .01923 L F 0 g .01923 .18453 m .08791 .17501 L .13801 .15659 L .15659 .13801 L .17501 .08791 L .18453 .01923 L s .2 g .01923 .6653 m .08791 .65578 L .13801 .63736 L .15659 .61878 L .17501 .56868 L .18453 .5 L .17501 .43132 L .15659 .38122 L .13801 .36264 L .08791 .34422 L .01923 .3347 L F 0 g .01923 .6653 m .08791 .65578 L .13801 .63736 L .15659 .61878 L .17501 .56868 L .18453 .5 L .17501 .43132 L .15659 .38122 L .13801 .36264 L .08791 .34422 L .01923 .3347 L s .8 g .01923 .81547 m .08791 .82499 L .13801 .84341 L .15659 .86199 L .17501 .91209 L .18453 .98077 L .01923 .98077 L F 0 g .01923 .81547 m .08791 .82499 L .13801 .84341 L .15659 .86199 L .17501 .91209 L .18453 .98077 L s .9 g .01923 .15309 m .08791 .14294 L .14294 .08791 L .15309 .01923 L .01923 .01923 L F 0 g .01923 .15309 m .08791 .14294 L .14294 .08791 L .15309 .01923 L s .1 g .01923 .63386 m .08791 .62371 L .14294 .56868 L .15309 .5 L .14294 .43132 L .08791 .37629 L .01923 .36614 L F 0 g .01923 .63386 m .08791 .62371 L .14294 .56868 L .15309 .5 L .14294 .43132 L .08791 .37629 L .01923 .36614 L s .9 g .01923 .84691 m .08791 .85706 L .14294 .91209 L .15309 .98077 L .01923 .98077 L F 0 g .01923 .84691 m .08791 .85706 L .14294 .91209 L .15309 .98077 L s 1 g .01923 .10805 m .05547 .08791 L .08791 .05547 L .10805 .01923 L .01923 .01923 L F 0 g .01923 .10805 m .05547 .08791 L .08791 .05547 L .10805 .01923 L s .01923 .58882 m .05547 .56868 L .08791 .54644 L .10805 .5 L .08791 .45356 L .05547 .43132 L .01923 .41118 L F .01923 .58882 m .05547 .56868 L .08791 .54644 L .10805 .5 L .08791 .45356 L .05547 .43132 L .01923 .41118 L s 1 g .01923 .89195 m .05547 .91209 L .08791 .94453 L .10805 .98077 L .01923 .98077 L F 0 g .01923 .89195 m .05547 .91209 L .08791 .94453 L .10805 .98077 L s .4 g .72578 .01923 m .72416 .08791 L .71689 .15659 L .70604 .19287 L .67364 .22527 L .63736 .23612 L .56868 .2434 L .5 .24501 L .43132 .2434 L .36264 .23612 L .32636 .22527 L .29396 .19287 L .28311 .15659 L .27584 .08791 L .27422 .01923 L F 0 g .72578 .01923 m .72416 .08791 L .71689 .15659 L .70604 .19287 L .67364 .22527 L .63736 .23612 L .56868 .2434 L .5 .24501 L .43132 .2434 L .36264 .23612 L .32636 .22527 L .29396 .19287 L .28311 .15659 L .27584 .08791 L .27422 .01923 L s .6 g .36264 .28311 m .43132 .27584 L .5 .27422 L .56868 .27584 L .63736 .28311 L .67364 .29396 L .70604 .32636 L .71689 .36264 L .72416 .43132 L .72578 .5 L .72416 .56868 L .71689 .63736 L .70604 .67364 L .67364 .70604 L .63736 .71689 L .56868 .72416 L .5 .72578 L .43132 .72416 L .36264 .71689 L .32636 .70604 L .29396 .67364 L .28311 .63736 L .27584 .56868 L .27422 .5 L .27584 .43132 L .28311 .36264 L .29396 .32636 L .32636 .29396 L F 0 g .36264 .28311 m .43132 .27584 L .5 .27422 L .56868 .27584 L .63736 .28311 L .67364 .29396 L .70604 .32636 L .71689 .36264 L .72416 .43132 L .72578 .5 L .72416 .56868 L .71689 .63736 L .70604 .67364 L .67364 .70604 L .63736 .71689 L .56868 .72416 L .5 .72578 L .43132 .72416 L .36264 .71689 L .32636 .70604 L .29396 .67364 L .28311 .63736 L .27584 .56868 L .27422 .5 L .27584 .43132 L .28311 .36264 L .29396 .32636 L .32636 .29396 L .36264 .28311 L s .4 g .72578 .98077 m .72416 .91209 L .71689 .84341 L .70604 .80713 L .67364 .77473 L .63736 .76388 L .56868 .7566 L .5 .75499 L .43132 .7566 L .36264 .76388 L .32636 .77473 L .29396 .80713 L .28311 .84341 L .27584 .91209 L .27422 .98077 L F 0 g .72578 .98077 m .72416 .91209 L .71689 .84341 L .70604 .80713 L .67364 .77473 L .63736 .76388 L .56868 .7566 L .5 .75499 L .43132 .7566 L .36264 .76388 L .32636 .77473 L .29396 .80713 L .28311 .84341 L .27584 .91209 L .27422 .98077 L s .3 g .69644 .01923 m .69159 .08791 L .66845 .15659 L .63736 .18768 L .56868 .21083 L .5 .21567 L .43132 .21083 L .36264 .18768 L .33155 .15659 L .30841 .08791 L .30356 .01923 L F 0 g .69644 .01923 m .69159 .08791 L .66845 .15659 L .63736 .18768 L .56868 .21083 L .5 .21567 L .43132 .21083 L .36264 .18768 L .33155 .15659 L .30841 .08791 L .30356 .01923 L s .7 g .36264 .33155 m .43132 .30841 L .5 .30356 L .56868 .30841 L .63736 .33155 L .66845 .36264 L .69159 .43132 L .69644 .5 L .69159 .56868 L .66845 .63736 L .63736 .66845 L .56868 .69159 L .5 .69644 L .43132 .69159 L .36264 .66845 L .33155 .63736 L .30841 .56868 L .30356 .5 L .30841 .43132 L .33155 .36264 L F 0 g .36264 .33155 m .43132 .30841 L .5 .30356 L .56868 .30841 L .63736 .33155 L .66845 .36264 L .69159 .43132 L .69644 .5 L .69159 .56868 L .66845 .63736 L .63736 .66845 L .56868 .69159 L .5 .69644 L .43132 .69159 L .36264 .66845 L .33155 .63736 L .30841 .56868 L .30356 .5 L .30841 .43132 L .33155 .36264 L .36264 .33155 L s .3 g .69644 .98077 m .69159 .91209 L .66845 .84341 L .63736 .81232 L .56868 .78917 L .5 .78433 L .43132 .78917 L .36264 .81232 L .33155 .84341 L .30841 .91209 L .30356 .98077 L F 0 g .69644 .98077 m .69159 .91209 L .66845 .84341 L .63736 .81232 L .56868 .78917 L .5 .78433 L .43132 .78917 L .36264 .81232 L .33155 .84341 L .30841 .91209 L .30356 .98077 L s .2 g .6653 .01923 m .65578 .08791 L .63736 .13801 L .61878 .15659 L .56868 .17501 L .5 .18453 L .43132 .17501 L .38122 .15659 L .36264 .13801 L .34422 .08791 L .3347 .01923 L F 0 g .6653 .01923 m .65578 .08791 L .63736 .13801 L .61878 .15659 L .56868 .17501 L .5 .18453 L .43132 .17501 L .38122 .15659 L .36264 .13801 L .34422 .08791 L .3347 .01923 L s .8 g .43132 .34422 m .5 .3347 L .56868 .34422 L .61878 .36264 L .63736 .38122 L .65578 .43132 L .6653 .5 L .65578 .56868 L .63736 .61878 L .61878 .63736 L .56868 .65578 L .5 .6653 L .43132 .65578 L .38122 .63736 L .36264 .61878 L .34422 .56868 L .3347 .5 L .34422 .43132 L .36264 .38122 L .38122 .36264 L F 0 g .43132 .34422 m .5 .3347 L .56868 .34422 L .61878 .36264 L .63736 .38122 L .65578 .43132 L .6653 .5 L .65578 .56868 L .63736 .61878 L .61878 .63736 L .56868 .65578 L .5 .6653 L .43132 .65578 L .38122 .63736 L .36264 .61878 L .34422 .56868 L .3347 .5 L .34422 .43132 L .36264 .38122 L .38122 .36264 L .43132 .34422 L s .2 g .6653 .98077 m .65578 .91209 L .63736 .86199 L .61878 .84341 L .56868 .82499 L .5 .81547 L .43132 .82499 L .38122 .84341 L .36264 .86199 L .34422 .91209 L .3347 .98077 L F 0 g .6653 .98077 m .65578 .91209 L .63736 .86199 L .61878 .84341 L .56868 .82499 L .5 .81547 L .43132 .82499 L .38122 .84341 L .36264 .86199 L .34422 .91209 L .3347 .98077 L s .1 g .63386 .01923 m .62371 .08791 L .56868 .14294 L .5 .15309 L .43132 .14294 L .37629 .08791 L .36614 .01923 L F 0 g .63386 .01923 m .62371 .08791 L .56868 .14294 L .5 .15309 L .43132 .14294 L .37629 .08791 L .36614 .01923 L s .9 g .43132 .37629 m .5 .36614 L .56868 .37629 L .62371 .43132 L .63386 .5 L .62371 .56868 L .56868 .62371 L .5 .63386 L .43132 .62371 L .37629 .56868 L .36614 .5 L .37629 .43132 L F 0 g .43132 .37629 m .5 .36614 L .56868 .37629 L .62371 .43132 L .63386 .5 L .62371 .56868 L .56868 .62371 L .5 .63386 L .43132 .62371 L .37629 .56868 L .36614 .5 L .37629 .43132 L .43132 .37629 L s .1 g .63386 .98077 m .62371 .91209 L .56868 .85706 L .5 .84691 L .43132 .85706 L .37629 .91209 L .36614 .98077 L F 0 g .63386 .98077 m .62371 .91209 L .56868 .85706 L .5 .84691 L .43132 .85706 L .37629 .91209 L .36614 .98077 L s .58882 .01923 m .56868 .05547 L .54644 .08791 L .5 .10805 L .45356 .08791 L .43132 .05547 L .41118 .01923 L F .58882 .01923 m .56868 .05547 L .54644 .08791 L .5 .10805 L .45356 .08791 L .43132 .05547 L .41118 .01923 L s 1 g .5 .41118 m .54644 .43132 L .56868 .45356 L .58882 .5 L .56868 .54644 L .54644 .56868 L .5 .58882 L .45356 .56868 L .43132 .54644 L .41118 .5 L .43132 .45356 L .45356 .43132 L F 0 g .5 .41118 m .54644 .43132 L .56868 .45356 L .58882 .5 L .56868 .54644 L .54644 .56868 L .5 .58882 L .45356 .56868 L .43132 .54644 L .41118 .5 L .43132 .45356 L .45356 .43132 L .5 .41118 L s .58882 .98077 m .56868 .94453 L .54644 .91209 L .5 .89195 L .45356 .91209 L .43132 .94453 L .41118 .98077 L F .58882 .98077 m .56868 .94453 L .54644 .91209 L .5 .89195 L .45356 .91209 L .43132 .94453 L .41118 .98077 L s .6 g .98077 .24501 m .91209 .2434 L .84341 .23612 L .80713 .22527 L .77473 .19287 L .76388 .15659 L .7566 .08791 L .75499 .01923 L .98077 .01923 L F 0 g .98077 .24501 m .91209 .2434 L .84341 .23612 L .80713 .22527 L .77473 .19287 L .76388 .15659 L .7566 .08791 L .75499 .01923 L s .4 g .98077 .72578 m .91209 .72416 L .84341 .71689 L .80713 .70604 L .77473 .67364 L .76388 .63736 L .7566 .56868 L .75499 .5 L .7566 .43132 L .76388 .36264 L .77473 .32636 L .80713 .29396 L .84341 .28311 L .91209 .27584 L .98077 .27422 L F 0 g .98077 .72578 m .91209 .72416 L .84341 .71689 L .80713 .70604 L .77473 .67364 L .76388 .63736 L .7566 .56868 L .75499 .5 L .7566 .43132 L .76388 .36264 L .77473 .32636 L .80713 .29396 L .84341 .28311 L .91209 .27584 L .98077 .27422 L s .6 g .98077 .75499 m .91209 .7566 L .84341 .76388 L .80713 .77473 L .77473 .80713 L .76388 .84341 L .7566 .91209 L .75499 .98077 L .98077 .98077 L F 0 g .98077 .75499 m .91209 .7566 L .84341 .76388 L .80713 .77473 L .77473 .80713 L .76388 .84341 L .7566 .91209 L .75499 .98077 L s .7 g .98077 .21567 m .91209 .21083 L .84341 .18768 L .81232 .15659 L .78917 .08791 L .78433 .01923 L .98077 .01923 L F 0 g .98077 .21567 m .91209 .21083 L .84341 .18768 L .81232 .15659 L .78917 .08791 L .78433 .01923 L s .3 g .98077 .69644 m .91209 .69159 L .84341 .66845 L .81232 .63736 L .78917 .56868 L .78433 .5 L .78917 .43132 L .81232 .36264 L .84341 .33155 L .91209 .30841 L .98077 .30356 L F 0 g .98077 .69644 m .91209 .69159 L .84341 .66845 L .81232 .63736 L .78917 .56868 L .78433 .5 L .78917 .43132 L .81232 .36264 L .84341 .33155 L .91209 .30841 L .98077 .30356 L s .7 g .98077 .78433 m .91209 .78917 L .84341 .81232 L .81232 .84341 L .78917 .91209 L .78433 .98077 L .98077 .98077 L F 0 g .98077 .78433 m .91209 .78917 L .84341 .81232 L .81232 .84341 L .78917 .91209 L .78433 .98077 L s .8 g .98077 .18453 m .91209 .17501 L .86199 .15659 L .84341 .13801 L .82499 .08791 L .81547 .01923 L .98077 .01923 L F 0 g .98077 .18453 m .91209 .17501 L .86199 .15659 L .84341 .13801 L .82499 .08791 L .81547 .01923 L s .2 g .98077 .6653 m .91209 .65578 L .86199 .63736 L .84341 .61878 L .82499 .56868 L .81547 .5 L .82499 .43132 L .84341 .38122 L .86199 .36264 L .91209 .34422 L .98077 .3347 L F 0 g .98077 .6653 m .91209 .65578 L .86199 .63736 L .84341 .61878 L .82499 .56868 L .81547 .5 L .82499 .43132 L .84341 .38122 L .86199 .36264 L .91209 .34422 L .98077 .3347 L s .8 g .98077 .81547 m .91209 .82499 L .86199 .84341 L .84341 .86199 L .82499 .91209 L .81547 .98077 L .98077 .98077 L F 0 g .98077 .81547 m .91209 .82499 L .86199 .84341 L .84341 .86199 L .82499 .91209 L .81547 .98077 L s .9 g .98077 .15309 m .91209 .14294 L .85706 .08791 L .84691 .01923 L .98077 .01923 L F 0 g .98077 .15309 m .91209 .14294 L .85706 .08791 L .84691 .01923 L s .1 g .98077 .63386 m .91209 .62371 L .85706 .56868 L .84691 .5 L .85706 .43132 L .91209 .37629 L .98077 .36614 L F 0 g .98077 .63386 m .91209 .62371 L .85706 .56868 L .84691 .5 L .85706 .43132 L .91209 .37629 L .98077 .36614 L s .9 g .98077 .84691 m .91209 .85706 L .85706 .91209 L .84691 .98077 L .98077 .98077 L F 0 g .98077 .84691 m .91209 .85706 L .85706 .91209 L .84691 .98077 L s 1 g .98077 .10805 m .94453 .08791 L .91209 .05547 L .89195 .01923 L .98077 .01923 L F 0 g .98077 .10805 m .94453 .08791 L .91209 .05547 L .89195 .01923 L s .98077 .58882 m .94453 .56868 L .91209 .54644 L .89195 .5 L .91209 .45356 L .94453 .43132 L .98077 .41118 L F .98077 .58882 m .94453 .56868 L .91209 .54644 L .89195 .5 L .91209 .45356 L .94453 .43132 L .98077 .41118 L s 1 g .98077 .89195 m .94453 .91209 L .91209 .94453 L .89195 .98077 L .98077 .98077 L F 0 g .98077 .89195 m .94453 .91209 L .91209 .94453 L .89195 .98077 L s % End of Graphics MathPictureEnd \ \>"], "Graphics", ImageSize->{288, 288}, ImageMargins->{{43, 0}, {0, 0}}, ImageRegion->{{0, 1}, {0, 1}}, ImageCache->GraphicsData["Bitmap", "\<\ CF5dJ6E]HGAYHf4PAg9QL6QYHgon6Ykno_hn?S`2ook>c/mWIfGmoOol005E[;lC4a000<`00IP00V@00c000 o`0c000c<`0cIP0cV@0cc00co`1V001V<`1VIP1VV@1Vc01Vo`2I002I<`2IIP2IV@2Ic02Io`3<003< <`3I03>IIIS>IVC>Ic3>Ioc?<03?<@000`40000f00030@0000L00`4i0003 0@0000@0000H00040@000CH000@1000120000`40000i00030@0003H000<100001`000`40000j0003 0@0000<0000H00040@000CH000@1000120000`40000g00<1=P030@T000<10000=`00104000450000 6@020CP00P4900@1>0000`40000f00030@0000L0104g00811P000?l08@0001D0o`4;0@40000E0003 0@00008000<100002P000`40000900030@0000X000<100002P000`40000:00030@0000X000<10000 2@000`40000:00030@0000X000<100002P000`40000900030@0000X000<100002P000`40000:0003 0@0000T000<100002P000`40000:00030@0000X000<100002P000`40000900030@0000800@410000 5@000`40000200030@0003d000<10000?@000`40000l00030@0003d000<100000P010@40000E0003 0@000?l01`010@40000>00811@000`40003o00L00@4100003@001040004400816`000`4000080003 0@0000H000<100001@000`40000500030@0000D000<1000010000`40000600030@0000D000<10000 2@000`40000/00030@0000T000<100001@000`40000600030@0000D000<1000010000`4000050003 0@0000D000<100001P000`40000900030@0001P00P4100003@001040004400030@0001T000d100P0 200800P0200100P800T1Y`RW2:L8Y`401jL02@49Y`VW2JL90@062@0:0@UB2E89DPUB0@MB0P402e81 DP5B0E81DP5B02l100aB0E81DP5B0E81DP47DP0:0@UB2E89DPUB0@L900P12JL9Y`VW0@NW00T12:L8 Y`RW204020P03P4800P0200800P020016P010@40000=00040@000@@000<100006@003@4800P02008 00P0204020P02@48Y`RW2:L80@07Y`090JL9Y`VW2JL100H900X1DPUB2E89DPT11e80305B0E81DP5B 0E81DRl100]B0E81DP5B0E81DP020@MB00X1DPUB2E89DPT11`T0206W2JL9Y`T11jL02@6W2:L8Y`RW 0@08200>0@0800P0200800P0204J00410@0000d000@1000110000`40000H000>0@P0200800P02008 004820090JL8Y`RW2:L100NW00T12JL9Y`VW2@401PT02P49DPUB2E89DP47DP8100]B0E81DP5B0E81 DP0_0@0DP5B0E81DP5B0E81DP47DP0: 0@UB2E89DPUB0@P900P1Y`VW2JL90@NW00X1Y`RW2:L8Y`P120P0404800P0200800P02008004G0041 0@0001D000<100005@004040200800P0200800P02048200:0@RW2:L8Y`RW0@NW00T12JL9Y`VW2@40 1`T02P5B2E89DPUB2@47DP0@0E81DP5B0E81DP5B0E81DRL100eB0E81DP5B0E81DP5B00811e802P5B 2E89DPUB2@482@080@VW2JL9Y`47Y`0:0@RW2:L8Y`RW0@P8014100P0200800P0200800P00@0F0041 0@0001D000<1000050004@40200800P0200800P0200100L800X12:L8Y`RW2:L11jL02P49Y`VW2JL9 Y`472@0:0@UB2E89DPUB0@QB00h1DP5B0E81DP5B0E81DRL100eB0E81DP5B0E81DP5B008125802P49 DPUB2E89DP472@0:0@VW2JL9Y`VW0@NW00X12:L8Y`RW2:L11`P04@4800P0200800P0200800P101H0 0@4100005@000`40000C000B0@0800P0200800P0200800P11`P02P6W2:L8Y`RW2047Y`0:0JL9Y`VW 2JL90@L900X1DPUB2E89DPT125820@0=DP5B0E81DP5B0E81DP0U0@0@DP5B0E81DP5B0E81DP5B0@QB 00X1DPUB2E89DPT11`T02P6W2JL9Y`VW2@47Y`0:0JL8Y`RW2:L80@L8018100P0200800P0200800P0 204E00410@0001D000<100004P004`40200800P0200800P0200800401`P02P48Y`RW2:L8Y`47Y`0: 0@VW2JL9Y`VW0@L900X12E89DPUB2E812580405B0E81DP5B0E81DP5B0E8U0@0=DP5B0E81DP5B0E81 DP020@QB00X12E89DPUB2E811`T02P49Y`VW2JL9Y`47Y`0:0@RW2:L8Y`RW0@L801<1200800P02008 00P0200800P101@00@4100005@020A8001@100P0200800P0200800P020080@L800X1Y`RW2:L8Y`P1 1jL02P6W2JL9Y`VW2@472@0:0E89DPUB2E890@QB0P403e81DP5B0E81DP5B0E81DP0S0@0@DP5B0E81 DP5B0E81DP5B0@QB00X1DPUB2E89DPT11`T02P6W2JL9Y`VW2@47Y`0:0JL8Y`RW2:L80@L801@100P0 200800P0200800P020080A800P4100005@000`40000@000E0@0800P0200800P0200800P0200100L8 00X12:L8Y`RW2:L11jL02P49Y`VW2JL9Y`472@0:0@UB2E89DPUB0@QB0181DP5B0E81DP5B0E81DP5B 0E8Q0@0?DP5B0E81DP5B0E81DP5B008125802P49DPUB2E89DP472@0:0@VW2JL9Y`VW0@NW00X12:L8 Y`RW2:L11`P05@4800P0200800P0200800P020080@0B00410@0001D000<100004000504800P02008 00P0200800P0200120P02P6W2:L8Y`RW2047Y`0:0JL9Y`VW2JL90@P900X12E89DPUB2E811e820@0? DP5B0E81DP5B0E81DP5B0241019B0E81DP5B0E81DP5B0E81DP47DP0:0@UB2E89DPUB0@P900X1Y`VW 2JL9Y`T11jL02P6W2:L8Y`RW2048200E0@P0200800P0200800P0200800P101400@4100005@000`40 000?000E0@P0200800P0200800P0200800P100L800/1Y`RW2:L8Y`RW0@07Y`0:0@VW2JL9Y`VW0@P9 00X1DPUB2E89DPT125820@0?DP5B0E81DP5B0E81DP5B01l1019B0E81DP5B0E81DP5B0E81DP48DP0: 0E89DPUB2E890@P900X12JL9Y`VW2JL11jL02`48Y`RW2:L8Y`P100L801H100P0200800P0200800P0 200800P140010@40000E00030@0000h001H1200800P0200800P0200800P020011`P02`48Y`RW2:L8 Y`P100NW00X1Y`VW2JL9Y`T120T02P49DPUB2E89DP48DP0B0E81DP5B0E81DP5B0E81DP5B7@404E81 DP5B0E81DP5B0E81DP5B008125802P49DPUB2E89DP482@0:0JL9Y`VW2JL90@NW00/1Y`RW2:L8Y`RW 0@07200G0@P0200800P0200800P0200800P020403`010@40000E00030@0000d001L1200800P02008 00P0200800P020080@07200;0JL8Y`RW2:L8Y`401jL02P49Y`VW2JL9Y`482@0:0E89DPUB2E890@QB 0P404E81DP5B0E81DP5B0E81DP5B01d1019B0E81DP5B0E81DP5B0E81DP48DP0:0E89DPUB2E890@P9 00X12JL9Y`VW2JL11jL02`48Y`RW2:L8Y`P100L801P100P0200800P0200800P0200800P0204>0041 0@0001D000<100002`020@0G200800P0200800P0200800P0200800401`P02`48Y`RW2:L8Y`P100NW 00X1Y`VW2JL9Y`T120T02P49DPUB2E89DP48DP0D0E81DP5B0E81DP5B0E81DP5B0E8K0@0ADP5B0E81 DP5B0E81DP5B0E800P48DP0:0@UB2E89DPUB0@P900X1Y`VW2JL9Y`T11jL02`6W2:L8Y`RW2:L100L8 01T1200800P0200800P0200800P0200800P100d00@4100005@000`400009008101P0200800P02008 00P0200800P020080048200;0JL8Y`RW2:L8Y`401jL02P49Y`VW2JL9Y`482@0:0E89DPUB2E890@UB 01@1DP5B0E81DP5B0E81DP5B0E81DQL101=B0E81DP5B0E81DP5B0E81DP5B00812E802P5B2E89DPUB 2@482@0:0@VW2JL9Y`VW0@NW00/12:L8Y`RW2:L80@08200H0@P0200800P0200800P0200800P02008 0P4;00410@0001D000<100001`020@0I200800P0200800P0200800P0200800P00@08200;0JL8Y`RW 2:L8Y`402:L02P6W2JL9Y`VW2@492@0:0E89DPUB2E890@UB01H1DP5B0E81DP5B0E81DP5B0E81DP5B 4`404e81DP5B0E81DP5B0E81DP5B0E800P49DP0:0E89DPUB2E890@T900X1Y`VW2JL9Y`T12:L02`48 Y`RW2:L8Y`P100P801T1200800P0200800P0200800P0200800P000812@010@40000E00030@0000D0 0P406P0800P0200800P0200800P0200800P020012@P02`48Y`RW2:L8Y`P100RW00X12JL9Y`VW2JL1 2@T02P49DPUB2E89DP4:DP0H0E81DP5B0E81DP5B0E81DP5B0E81DP5B3@405E81DP5B0E81DP5B0E81 DP5B0E81DP020@YB00X12E89DPUB2E812@T02P49Y`VW2JL9Y`48Y`0;0JL8Y`RW2:L8Y`402@P06P48 00P0200800P0200800P0200800P020080P4700410@0001D000<100000`020@0K200800P0200800P0 200800P0200800P0200100T800`12:L8Y`RW2:L8Y`48Y`0:0JL9Y`VW2JL90@T900/1DPUB2E89DPUB 0@0:DP0J0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E870@0GDP5B0E81DP5B0E81DP5B0E81DP5B0E80 0P4:DP0;0@UB2E89DPUB2@402@T02P6W2JL9Y`VW2@49Y`0;0JL8Y`RW2:L8Y`402@P06`4800P02008 00P0200800P0200800P0200800020@D00@4100005@000`400002000M0@0800P0200800P0200800P0 200800P0200800402PP02`6W2:L8Y`RW2:L100VW00/12JL9Y`VW2JL90@092@0:0E89DPUB2E890@]B 01X1DP5B0E81DP5B0E81DP5B0E81DP5B0E81DPD101MB0E81DP5B0E81DP5B0E81DP5B0E81DP020@]B 00X1DPUB2E89DPT12@T0306W2JL9Y`VW2JL90@RW00/12:L8Y`RW2:L80@0:200M0@P0200800P02008 00P0200800P0200800P0204010010@40000E00030@0000<001/800P0200800P0200800P0200800P0 200800402`P02`48Y`RW2:L8Y`P100VW00/1Y`VW2JL9Y`VW0@092@0:0@UB2E89DPUB0@aB03@1DP5B 0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0P4200;0@RW2:L8Y`RW20402ZL02`49Y`VW2JL9Y`T100X900X12E89DPUB2E81 3U80;P5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E820@iB00X12E89 DPUB2E812PT0306W2JL9Y`VW2JL90@ZW00X12:L8Y`RW2:L13PP05`40200800P0200800P0200800P0 200800D00@4100005@000`400003000F200800P0200800P0200800P020080@h800`12:L8Y`RW2:L8 Y`49Y`0<0@VW2JL9Y`VW2JL12PT02`5B2E89DPUB2E8100iB02`1DP5B0E81DP5B0E81DP5B0E81DP5B 0E81DP5B0E81DP5B0E81DP5B0E81DP813U802`49DPUB2E89DPT100X900`12JL9Y`VW2JL9Y`4:Y`0; 0JL8Y`RW2:L8Y`403PP05@40200800P0200800P0200800P0200600410@0001D000<100000P005PP0 200800P0200800P0200800P0204?200;0JL8Y`RW2:L8Y`402ZL0306W2JL9Y`VW2JL90@/900X1DPUB 2E89DPT13e80:P5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP813e802P5B 2E89DPUB2@4;2@0<0JL9Y`VW2JL9Y`T12ZL02`48Y`RW2:L8Y`P100l801D100P0200800P0200800P0 200800P01@010@40000E00030@0000<001@800P0200800P0200800P020080@l800`1Y`RW2:L8Y`RW 204:Y`0<0@VW2JL9Y`VW2JL12`T02`49DPUB2E89DPT100mB02P1DP5B0E81DP5B0E81DP5B0E81DP5B 0E81DP5B0E81DP5B0E81DP5B0P4?DP0;0E89DPUB2E89DP402`T03049Y`VW2JL9Y`VW0@^W00/12:L8 Y`RW2:L80@0?200C0@0800P0200800P0200800P0200600410@0001D000<100000P0050P0200800P0 200800P0200800P140P03048Y`RW2:L8Y`RW0@ZW00`1Y`VW2JL9Y`VW2@4;2@0;0E89DPUB2E89DP40 45809P5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0P4@DP0;0@UB2E89DPUB2@40 2`T0306W2JL9Y`VW2JL90@^W00/1Y`RW2:L8Y`RW0@0@200C0@0800P0200800P0200800P020050041 0@0001D000<100000`003PP0200800P0200800P0104@200<0@RW2:L8Y`RW2:L12jL03@49Y`VW2JL9 Y`VW2@402`T02`5B2E89DPUB2E81011B1@407E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B00@1 45802`49DPUB2E89DPT100/900h1Y`VW2JL9Y`VW2JL90@ZW00`12:L8Y`RW2:L8Y`4@20<100h02008 00P0200800P020H00@4100005@000`4000020009200800P0200800H14`P03@48Y`RW2:L8Y`RW2040 2jL03@6W2JL9Y`VW2JL9Y`402`T03049DPUB2E89DPUB0A=B1P404E81DP5B0E81DP5B0E81DP5B00L1 4e803049DPUB2E89DPUB0@/900h12JL9Y`VW2JL9Y`VW0@^W00`12:L8Y`RW2:L8Y`4B20H100T800P0 200800P01@010@40000E00030@0000<000<800401@4H200>0@RW2:L8Y`RW2:L8Y`4;Y`0=0@VW2JL9 Y`VW2JL90@0;2@0=0E89DPUB2E89DPUB0@0HDPL100EB0E81DP060AQB00d12E89DPUB2E89DPT100/9 00h1Y`VW2JL9Y`VW2JL90@^W00d1Y`RW2:L8Y`RW2:L101L81P400`08000500410@0001D000<10000 0P030Ad800h12:L8Y`RW2:L8Y`RW0@bW00d1Y`VW2JL9Y`VW2JL100`900d1DPUB2E89DPUB2E8101eB 1P4MDP0=0@UB2E89DPUB2E890@0<2@0>0@VW2JL9Y`VW2JL9Y`42:L8Y`RW2:L8Y`RW2040@UB2E89DPUB2E89DPT20CQB0P403U89DPUB2E89DPUB2E813@T03P49 Y`VW2JL9Y`VW2JL13JL03P48Y`RW2:L8Y`RW2:L80P4K20D00@4100005@020@<06@P30@0@2:L8Y`RW 2:L8Y`RW2:L80@fW00l1Y`VW2JL9Y`VW2JL9Y`403@T03`49DPUB2E89DPUB2E89DP030C9B0`403`UB 2E89DPUB2E89DPUB0@0=2@0@0@VW2JL9Y`VW2JL9Y`VW0@fW00l12:L8Y`RW2:L8Y`RW2:L00`4H20@0 0P4100005@000`40000201H80`404PRW2:L8Y`RW2:L8Y`RW2:L80@jW00l12JL9Y`VW2JL9Y`VW2@40 3PT04@49DPUB2E89DPUB2E89DPUB00<1;5830@0A2E89DPUB2E89DPUB2E89DP403PT0406W2JL9Y`VW 2JL9Y`VW2@4>Y`0A0@RW2:L8Y`RW2:L8Y`RW2:L00`4E20D00@4100005@000`40000201@80P404PRW 2:L8Y`RW2:L8Y`RW2:L8Y`813jL03`6W2JL9Y`VW2JL9Y`VW0@0?2@0C0@UB2E89DPUB2E89DPUB2E89 DP020BQB0P404`UB2E89DPUB2E89DPUB2E89DP403`T04049Y`VW2JL9Y`VW2JL9Y`4?Y`0C0@RW2:L8 Y`RW2:L8Y`RW2:L8Y`020A<81@010@40000E00030@0000803PP60@0DY`RW2:L8Y`RW2:L8Y`RW2:L8 Y`4AY`0@0@VW2JL9Y`VW2JL9Y`VW0@l901@12E89DPUB2E89DPUB2E89DPUB2@H175860@0DDPUB2E89 DPUB2E89DPUB2E89DP4@2@0A0JL9Y`VW2JL9Y`VW2JL9Y`403jL05048Y`RW2:L8Y`RW2:L8Y`RW2:L8 1P4=20D00@4100005@000`40000200D82@406@RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`404JL04@49 Y`VW2JL9Y`VW2JL9Y`T1010901T12E89DPUB2E89DPUB2E89DPUB2E89DPUB00X12E890@0I2E89DPUB 2E89DPUB2E89DPUB2E89DPUB0@0@2@0B0JL9Y`VW2JL9Y`VW2JL9Y`T14:L06@48Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L02@4420D00@4100005@000`40000200D10248Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`404ZL04@6W2JL9Y`VW2JL9Y`VW2JL1014902812E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E892@408@UB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB0@0A2@0B0@VW2JL9 Y`VW2JL9Y`VW2JL14JL08@48Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`050@@00@410000 5@000`400002000S2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P00P4CY`0A0@VW2JL9 Y`VW2JL9Y`VW2@404PT20@16DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2@814PT04P6W2JL9Y`VW2JL9Y`VW2JL90A:W0P408ZL8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P500410@0001D000<100000P008:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L80`4DY`0C0@VW2JL9Y`VW2JL9Y`VW2JL90@0C2@<1041B2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 0`4C2@0D0JL9Y`VW2JL9Y`VW2JL9Y`VW2@4CY`<101nW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW00D00@4100005@000`400002000M2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P00`4GY`0C 0JL9Y`VW2JL9Y`VW2JL9Y`VW0@0F2@<103YB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E890`4F2@0D0@VW2JL9Y`VW2JL9Y`VW2JL9Y`4FY`<101bW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L81@010@40000E00030@00008001ZW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW20<16JL05@6W2JL9Y`VW2JL9Y`VW2JL9Y`VW0@0H2@<103AB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E890`4H2@0F0@VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW0ARW0`406JL8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L01@010@40000E00030@00008001L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW20030A^W01L1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0@0J2@<102iB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E890`4J2@0H0@VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL16ZL30@0FY`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20D00@4100005@000`400002000D Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P30AfW01T1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL101`90`40:589 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPT30A`901X12JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW0AbW0`404jL8Y`RW2:L8Y`RW2:L8Y`RW2:L01@010@40000E00030@00008000h8Y`RW 2:L8Y`RW2:L8Y`H17ZL20@0JY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`4N2@H101`9DPUB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB1P4N2@0L0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0AjW1P403@RW 2:L8Y`RW2:L8Y`P01@010@40000E00810`001JL8Y`RW00T18jL07P49Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW0B<92P402E89DPUB2E89DP090B<901h12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`4SY`T100@8Y`RW10020@40000E00030@0000801@4[Y`0P0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`4/2@T1:`T08049Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL1:jL50@@00@410000 5@000`40000202nW02812JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL1GPT08P49Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`4^Y`D00@4100005@000`40000202fW0P408PVW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL20EX90P408PVW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL20BbW1@010@40000E00030@000080:JL40@0VY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`T30E<910409ZL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 0`4YY`D00@4100005@000`40000202JW0`40;@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2@040D`90`40;@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2@040BFW1@010@40000E00030@0000808:L60@0d2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`H1@0T60@0d2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`H17jL500410@0001D000<100000P0GY`T1042W2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 2@4^2@T1042W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL92@4FY`D00@4100005@000`40000201L105:W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 ;P40DZL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`TG0@@00@4100005@000`400002003oY`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW00D00@4100005@000`400002003o2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL900D00@4100000P020@@000<10000 0P030@D000<100000P00ojL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`0500410@000005004000402`000`4000020081 0`00o`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2@0400810@000005004000402`000`40000200030@0000800?nW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL01@010@4000001@01000100P00`4500030@0000800?l9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T0 1@010@4000001@01000100P000<100001@000`400002003oY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW00D00@410000 00D00@000@0800030@0000D000<100000P090@1^Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`TB0@1]Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`0:0@@00@4100000P020@T0104400030@0000802@T>0@1B2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`h14ZL>0@1B2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`d12@T500410@0001D000<10000 0P0G2@T10409Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2@4^Y`T10409Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@4F2@D00@4100005@000`40000202091`40Y`D102P9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW1@4V2@D00@4100005@000`40000202`9 0`408PVW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL30ERW0`408PVW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL30B/91@010@40000E00030@000080;`T08P49Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`5NY`0R0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0Bh9 1@010@40000E00030@000080<0T08049Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL1H:L08049 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL1;`T500410@0001D000<100000P090BP901h12JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`4XYa81::L07P49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW0BL92P4400410@0001D00P4300092E89DPUB2E8900/17PT07049Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`4NY`/101:W2:L8Y`RW2:L8Y`RW2:L8Y`P;0AjW01`12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL17PT:0@092E89DPUB2E8900@00P4100005@000`400002000DDPUB2E89DPUB2E89DPUB2E89 DPT30A`901/12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@406jL30@0XY`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20<16jL0706W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@4K2@<1 01=B2E89DPUB2E89DPUB2E89DPUB00D00@4100005@000`400002000G2E89DPUB2E89DPUB2E89DPUB 2E89DPT00`4J2@0I0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@0IY`<102jW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L80`4IY`0J0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2@4I2@<101IB2E89DPUB2E89DPUB2E89DPUB2E891@010@40000E00030@00008001YB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2@<160T05`49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T101NW0`40=:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P30ANW01P1Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2@4G2@<101UB2E89DPUB2E89DPUB2E89DPUB2E89DPUB00D00@4100005@000`40 0002000M2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPT00`4F2@0E0@VW2JL9Y`VW2JL9Y`VW2JL9 Y`T101FW0`40>ZL8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`P30AFW01H1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T15@T30@0LDPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2@D00@4100005@000`400002000PDPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPT30A@901<12JL9Y`VW2JL9Y`VW2JL9Y`T101>W0`40@:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P30A>W01@1Y`VW2JL9Y`VW2JL9Y`VW 2JL90A<90`407e89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E801@010@40000E00030@000080 02<9DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2@020A8901<1Y`VW2JL9Y`VW2JL9Y`VW 2JL1016W0P40AZL8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P20A6W01@12JL9Y`VW2JL9Y`VW2JL9Y`VW0A490P408U89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPT500410@0001D000<100000P030@0S2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DP404PT04@6W2JL9Y`VW2JL9Y`VW2JL1016W02<12:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`060@0S2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`404JL04P49Y`VW2JL9Y`VW2JL9Y`VW0A4902812E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89104400410@0001D000<100000P03DPH101iB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DP4A2@0A0@VW2JL9Y`VW2JL9Y`VW2@404:L07P48Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20H1 1PP60@0NY`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L14:L04P6W2JL9Y`VW2JL9Y`VW2JL90A09 01d12E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP060@=B1@010@40000E00030@0000802E860@0I 2E89DPUB2E89DPUB2E89DPUB2E89DPUB0@0@2@0A0JL9Y`VW2JL9Y`VW2JL9Y`403jL06@48Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L01P4B20H101T8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L100nW01812JL9 Y`VW2JL9Y`VW2JL9Y`4?2@0H0@UB2E89DPUB2E89DPUB2E89DPUB2E891P49DPD00@4100005@000`40 000200mB1@405@UB2E89DPUB2E89DPUB2E89DPUB0@0@2@0@0JL9Y`VW2JL9Y`VW2JL90@jW01D12:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L01@4N20D101D8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`403jL04@49Y`VW2JL9 Y`VW2JL9Y`T100h901D12E89DPUB2E89DPUB2E89DPUB2E80104?DPD00@4100005@000`40000201AB 0P405589DPUB2E89DPUB2E89DPUB2E813`T03`49Y`VW2JL9Y`VW2JL90@0?Y`0C0JL8Y`RW2:L8Y`RW 2:L8Y`RW20020BP80P404jL8Y`RW2:L8Y`RW2:L8Y`RW20403jL0406W2JL9Y`VW2JL9Y`VW2@4?2@0C 0E89DPUB2E89DPUB2E89DPUB2@020A=B1@010@40000E00030@0000805U830@0BDPUB2E89DPUB2E89 DPUB2E813PT03`6W2JL9Y`VW2JL9Y`VW0@0>Y`0A0JL8Y`RW2:L8Y`RW2:L8Y`P00`4/20<1016W2:L8 Y`RW2:L8Y`RW2:L80@0>Y`0@0@VW2JL9Y`VW2JL9Y`VW0@h90141DPUB2E89DPUB2E89DPUB2@030AEB 1@010@40000E00810`0IDP<1011B2E89DPUB2E89DPUB2E813@T03`49Y`VW2JL9Y`VW2JL90@0=Y`0? 0JL8Y`RW2:L8Y`RW2:L800<10P20@0>2:L8Y`RW2:L8Y`RW 204=Y`0>0JL9Y`VW2JL9Y`VW2@4=2@0>0E89DPUB2E89DPUB2E820A]B1@010@40000E00030@000080 7U820@0>DPUB2E89DPUB2E89DP4<2@0=0JL9Y`VW2JL9Y`VW0@0200^0@0800P0200800P0200800P0200800P0200800P0200800P0200800P020080@h8 00X12:L8Y`RW2:L12jL03049Y`VW2JL9Y`VW0@X900/1DPUB2E89DPUB0@0>DP0F0E81DP5B0E81DP5B 0E81DP5B0E81DPD00@4100005@000`400002000F0E81DP5B0E81DP5B0E81DP5B0E81DP813E80305B 2E89DPUB2E890@T900`1Y`VW2JL9Y`VW2@4:Y`0;0@RW2:L8Y`RW20403@P0<040200800P0200800P0 200800P0200800P0200800P0200800P0200800P020080@d800/1Y`RW2:L8Y`RW0@0:Y`0<0JL9Y`VW 2JL9Y`T12PT02`49DPUB2E89DPT100eB01L1DP5B0E81DP5B0E81DP5B0E81DP5B0@0500410@0001D0 00<100000P005e81DP5B0E81DP5B0E81DP5B0E81DP5B00813E802`5B2E89DPUB2E8100X900/1Y`VW 2JL9Y`VW0@0:Y`0:0JL8Y`RW2:L80@d8038100P0200800P0200800P0200800P0200800P0200800P0 200800P0200800P020080@d800X1Y`RW2:L8Y`P12ZL03049Y`VW2JL9Y`VW0@X900X1DPUB2E89DPT1 3E80605B0E81DP5B0E81DP5B0E81DP5B0E81DPD00@4100005@000`400002000H0E81DP5B0E81DP5B 0E81DP5B0E81DP5B0P40@D00@4100005@000`4000020141 00mB0E81DP5B0E81DP5B0E800P48DP0:0@UB2E89DPUB0@L900X12JL9Y`VW2JL12:L02P6W2:L8Y`RW 2047200B0@0800P0200800P0200800P180004P40200800P0200800P020080@L800X1Y`RW2:L8Y`P1 2:L02P49Y`VW2JL9Y`472@0:0@UB2E89DPUB0@QB0181DP5B0E81DP5B0E81DP5B0E8?0@D00@410000 5@020@<04P403e81DP5B0E81DP5B0E81DP020@MB00X1DPUB2E89DPT11`T02P6W2JL9Y`VW2@47Y`0: 0JL8Y`RW2:L80@P80141200800P0200800P020080@0R000A0@0800P0200800P02008004020P02P6W 2:L8Y`RW2047Y`0:0JL9Y`VW2JL90@L900X1DPUB2E89DPT11e80405B0E81DP5B0E81DP5B0E8B0@@0 0P4100005@000`40000201<1011B0E81DP5B0E81DP5B0E811e802P49DPUB2E89DP472@0:0@VW2JL9 Y`VW0@NW00X12:L8Y`RW2:L120P04040200800P0200800P0204T000@0@0800P0200800P020080@P8 00X12:L8Y`RW2:L11jL02P49Y`VW2JL9Y`472@0:0@UB2E89DPUB0@MB0P403E81DP5B0E81DP5B0E80 4`4500410@0001D000<100000P0D0@0=DP5B0E81DP5B0E81DP020@MB00X1DPUB2E89DPT11`T02P6W 2JL9Y`VW2@47Y`0:0JL8Y`RW2:L80@P80101200800P0200800P020019000404800P0200800P02008 0048200:0JL8Y`RW2:L80@NW00X1Y`VW2JL9Y`T11`T02P5B2E89DPUB2@47DP0@0E81DP5B0E81DP5B 0E81DQ811@010@40000E00030@0000805@403U81DP5B0E81DP5B0E811e802P49DPUB2E89DP472@0: 0@VW2JL9Y`VW0@NW00X12:L8Y`RW2:L120P03`40200800P0200800P00@0V000?0@P0200800P02008 00P100P800X12:L8Y`RW2:L11jL02P49Y`VW2JL9Y`472@0:0@UB2E89DPUB0@MB0P403E81DP5B0E81 DP5B0E804`4500410@0001D000<100000P0F0@0;DP5B0E81DP5B0E800P48DP0:0@UB2E89DPUB0@L9 00T12JL9Y`VW2@401jL02P6W2:L8Y`RW2048200?0@P0200800P0200800P102H0010100P0200800P0 200800P11`P02P6W2:L8Y`RW2048Y`090@VW2JL9Y`T100L900X1DPUB2E89DPT11e803P5B0E81DP5B 0E81DP5B504500410@0001D000<100000P0E0@0>DP5B0E81DP5B0E81DP48DP0:0E89DPUB2E890@L9 00T1Y`VW2JL9Y`401jL02P48Y`RW2:L8Y`47200?0@P0200800P0200800P102P000l100P0200800P0 200800401`P02P48Y`RW2:L8Y`48Y`080JL9Y`VW2@472@0:0E89DPUB2E890@QB0P402e81DP5B0E81 DP5B01D11@010@40000E00030@0000805P402e81DP5B0E81DP5B008125802P49DPUB2E89DP472@09 0@VW2JL9Y`T100NW00X1Y`RW2:L8Y`P11`P03`40200800P0200800P00@0X000?0@P0200800P02008 00P100L800X1Y`RW2:L8Y`P12:L02049Y`VW2JL11`T02P49DPUB2E89DP48DP0>0E81DP5B0E81DP5B 0E8D0@D00@4100005@000`40000201L100aB0E81DP5B0E81DP48DP0:0E89DPUB2E890@L900T1Y`VW 2JL9Y`401jL02P48Y`RW2:L8Y`47200?0@P0200800P0200800P102T000h1200800P0200800P00@L8 00X12:L8Y`RW2:L12:L0206W2JL9Y`T11`T02P5B2E89DPUB2@48DP8100]B0E81DP5B0E81DP0E0@D0 0@4100005@000`40000201P100UB0E81DP5B0E800P48DP0:0@UB2E89DPUB0@L900T12JL9Y`VW2@40 1jL02P6W2:L8Y`RW2047200>0@0800P0200800P0204Z000>0@0800P0200800P02047200:0JL8Y`RW 2:L80@RW00P12JL9Y`VW0@L900X12E89DPUB2E812580305B0E81DP5B0E81DQH11@010@40000E0003 0@0000805`402e81DP5B0E81DP5B00811e802P5B2E89DPUB2@472@090JL9Y`VW2JL100JW00X1Y`RW 2:L8Y`P120P03P4800P0200800P02001:P003P4800P0200800P0200120P02P6W2:L8Y`RW2047Y`08 0JL9Y`VW2@472@0:0E89DPUB2E890@MB00h1DP5B0E81DP5B0E81DQD11@010@40000E00030@000080 60403581DP5B0E81DP5B0@QB00T1DPUB2E89DP401`T02@49Y`VW2JL90@06Y`0:0@RW2:L8Y`RW0@P8 00d100P0200800P0200102`000h1200800P0200800P00@L800X12:L8Y`RW2:L11jL02049Y`VW2JL1 1`T02P49DPUB2E89DP47DP8100]B0E81DP5B0E81DP0F0@D00@4100005@000`40000201T100UB0E81 DP5B0E800P48DP090@UB2E89DPT100L900T1Y`VW2JL9Y`401ZL02P6W2:L8Y`RW2047200>0@0800P0 200800P0204/000>0@0800P0200800P02047200:0JL8Y`RW2:L80@NW00P1Y`VW2JL90@L900T1DPUB 2E89DP402580305B0E81DP5B0E81DQL11@010@40000=00@110000`40000201X100YB0E81DP5B0E81 25802@5B2E89DPUB0@072@090@VW2JL9Y`T100JW00X12:L8Y`RW2:L11`P03@4800P0200800P02040 ;P003@40200800P0200800401`P02P48Y`RW2:L8Y`47Y`080@VW2JL9Y`472@090@UB2E89DPT100QB 0P402E81DP5B0E81DP0H0@D00@4100003`000`40000300810`0I0@09DP5B0E81DP5B008125802@49 DPUB2E890@072@090JL9Y`VW2JL100JW00X1Y`RW2:L8Y`P11`P03@40200800P020080040;P003@48 00P0200800P020401`P02P6W2:L8Y`RW2047Y`080JL9Y`VW2@472@090E89DPUB2E8100QB00`1DP5B 0E81DP5B0E8G0@@00P4100003`000`40000300030@0000806P402U81DP5B0E81DP48DP090E89DPUB 2E8100L900T12JL9Y`VW2@401ZL02P48Y`RW2:L8Y`47200=0@P0200800P020080@0^000=0@0800P0 200800P00@07200:0@RW2:L8Y`RW0@NW00P12JL9Y`VW0@L900T12E89DPUB2@4025820@09DP5B0E81 DP5B01P11@010@40000?00030@0000<000<100000P0I0@09DP5B0E81DP5B008125802@49DPUB2E89 0@072@090JL9Y`VW2JL100JW00X1Y`RW2:L8Y`P11`P03P40200800P0200800P1;0003P40200800P0 200800P11`P02P6W2:L8Y`RW2047Y`080JL9Y`VW2@472@090E89DPUB2E8100QB00`1DP5B0E81DP5B 0E8G0@D00@4100003`000`40000300030@00008060403581DP5B0E81DP5B0@QB00T1DPUB2E89DP40 1`T02@49Y`VW2JL90@06Y`0:0@RW2:L8Y`RW0@P800d100P0200800P0200102`000h1200800P02008 00P00@L800X12:L8Y`RW2:L11jL02049Y`VW2JL11`T02P49DPUB2E89DP47DP8100]B0E81DP5B0E81 DP0F0@D00@4100003@030@D000<100000P0G0@0;DP5B0E81DP5B0E800P47DP0:0E89DPUB2E890@L9 00T1Y`VW2JL9Y`401ZL02P6W2:L8Y`RW2048200>0@P0200800P02008004Z000>0@P0200800P02008 0048200:0JL8Y`RW2:L80@NW00P1Y`VW2JL90@L900X1DPUB2E89DPT11e803P5B0E81DP5B0E81DP5B 5@4500410@0000l000<100000`000`40000201P100UB0E81DP5B0E800P48DP0:0@UB2E89DPUB0@L9 00T12JL9Y`VW2@401jL02P6W2:L8Y`RW2047200>0@0800P0200800P0204Z000>0@0800P0200800P0 2047200:0JL8Y`RW2:L80@RW00P12JL9Y`VW0@L900X12E89DPUB2E812580305B0E81DP5B0E81DQH1 1@010@40000E00030@0000805`403581DP5B0E81DP5B0@QB00X1DPUB2E89DPT11`T02@6W2JL9Y`VW 0@07Y`0:0@RW2:L8Y`RW0@L800l1200800P0200800P02040:@003P4800P0200800P020011`P02P48 Y`RW2:L8Y`48Y`080JL9Y`VW2@472@0:0E89DPUB2E890@QB0P402e81DP5B0E81DP5B01D11@010@40 000E00030@0000805P402e81DP5B0E81DP5B008125802P49DPUB2E89DP472@090@VW2JL9Y`T100NW 00X1Y`RW2:L8Y`P11`P03`40200800P0200800P00@0X000?0@P0200800P0200800P100L800X1Y`RW 2:L8Y`P12:L02049Y`VW2JL11`T02P49DPUB2E89DP48DP0>0E81DP5B0E81DP5B0E8D0@D00@410000 5@000`40000201D100iB0E81DP5B0E81DP5B0@QB00X1DPUB2E89DPT11`T02@6W2JL9Y`VW0@07Y`0: 0@RW2:L8Y`RW0@L800l1200800P0200800P02040:0003`40200800P0200800P00@07200:0@RW2:L8 Y`RW0@RW00P1Y`VW2JL90@L900X1DPUB2E89DPT125820@0;DP5B0E81DP5B0E805@4500410@0001D0 00<100000P0F0@0;DP5B0E81DP5B0E800P48DP0:0@UB2E89DPUB0@L900T12JL9Y`VW2@401jL02P6W 2:L8Y`RW2048200?0@P0200800P0200800P102H0010100P0200800P0200800P11`P02P6W2:L8Y`RW 2048Y`090@VW2JL9Y`T100L900X1DPUB2E89DPT11e803P5B0E81DP5B0E81DP5B504500410@0001D0 00<100000P0E0@0>DP5B0E81DP5B0E81DP47DP0:0@UB2E89DPUB0@L900X12JL9Y`VW2JL11jL02P48 Y`RW2:L8Y`48200?0@0800P0200800P0200102H000l1200800P0200800P0204020P02P48Y`RW2:L8 Y`47Y`0:0@VW2JL9Y`VW0@L900X12E89DPUB2E811e820@0=DP5B0E81DP5B0E81DP0C0@D00@410000 5@000`40000201@100eB0E81DP5B0E81DP5B00811e802P5B2E89DPUB2@472@0:0JL9Y`VW2JL90@NW 00X1Y`RW2:L8Y`P120P0404800P0200800P02008004T000@0@P0200800P0200800P00@P800X1Y`RW 2:L8Y`P11jL02P6W2JL9Y`VW2@472@0:0E89DPUB2E890@MB0101DP5B0E81DP5B0E81DP5B4P450041 0@0001D000<100000P0C0@0@DP5B0E81DP5B0E81DP5B0@MB00X12E89DPUB2E811`T02P49Y`VW2JL9 Y`47Y`0:0@RW2:L8Y`RW0@P8010100P0200800P0200800P190004040200800P0200800P02048200: 0@RW2:L8Y`RW0@NW00X12JL9Y`VW2JL11`T02P49DPUB2E89DP47DP8100eB0E81DP5B0E81DP5B01<1 1@010@40000E00810`0B0@0?DP5B0E81DP5B0E81DP5B00811e802P5B2E89DPUB2@472@0:0JL9Y`VW 2JL90@NW00X1Y`RW2:L8Y`P120P04@4800P0200800P0200800P10280014100P0200800P0200800P0 0@08200:0JL8Y`RW2:L80@NW00X1Y`VW2JL9Y`T11`T02P5B2E89DPUB2@47DP0@0E81DP5B0E81DP5B 0E81DQ8110020@40000E00030@0000804@403e81DP5B0E81DP5B0E81DP020@QB00X12E89DPUB2E81 1`T02P49Y`VW2JL9Y`48Y`0:0JL8Y`RW2:L80@L8018100P0200800P0200800P0204P000B0@0800P0 200800P0200800P11`P02P6W2:L8Y`RW2048Y`0:0@VW2JL9Y`VW0@L900X12E89DPUB2E8125804P5B 0E81DP5B0E81DP5B0E81DPl11@010@40000E00030@00008040404U81DP5B0E81DP5B0E81DP5B0@QB 00X1DPUB2E89DPT11`T02P6W2JL9Y`VW2@48Y`0:0@RW2:L8Y`RW0@P8018100P0200800P0200800P0 204N000C0@0800P0200800P0200800P00@07200:0@RW2:L8Y`RW0@RW00X1Y`VW2JL9Y`T11`T02`5B 2E89DPUB2E8100MB0P404E81DP5B0E81DP5B0E81DP5B00h11@010@40000E00030@0000803`404E81 DP5B0E81DP5B0E81DP5B00811e802`5B2E89DPUB2E8100L900X12JL9Y`VW2JL12:L02P6W2:L8Y`RW 2048200C0@P0200800P0200800P020080@0L000C0@0800P0200800P0200800P00@08200:0JL8Y`RW 2:L80@RW00X12JL9Y`VW2JL11`T02`49DPUB2E89DPT100MB01@1DP5B0E81DP5B0E81DP5B0E81DPd1 1@010@40000E00030@00008030405U81DP5B0E81DP5B0E81DP5B0E81DP47DP0;0@UB2E89DPUB2@40 1`T02P6W2JL9Y`VW2@48Y`0:0@RW2:L8Y`RW0@P801@100P0200800P0200800P020080AX001@100P0 200800P0200800P020080@P800X12:L8Y`RW2:L12:L02P6W2JL9Y`VW2@472@0;0E89DPUB2E89DP40 1e820@0CDP5B0E81DP5B0E81DP5B0E81DP0<0@D00@4100005@000`40000200/101EB0E81DP5B0E81 DP5B0E81DP5B0E800P47DP0;0E89DPUB2E89DP401`T02P49Y`VW2JL9Y`48Y`0:0JL8Y`RW2:L80@P8 01@1200800P0200800P0200800P020815P020@0D00P0200800P0200800P020080048200:0JL8Y`RW 2:L80@RW00X12JL9Y`VW2JL11`T02`49DPUB2E89DPT100MB01P1DP5B0E81DP5B0E81DP5B0E81DP5B 0E890@D00@4100005@000`40000200X101EB0E81DP5B0E81DP5B0E81DP5B0E800P48DP0;0@UB2E89 DPUB2@401`T02P6W2JL9Y`VW2@48Y`0:0@RW2:L8Y`RW0@T801D1200800P0200800P0200800P02000 0P4B008101D800P0200800P0200800P0200800402@P02P48Y`RW2:L8Y`48Y`0:0JL9Y`VW2JL90@L9 00/1DPUB2E89DPUB0@08DP0H0E81DP5B0E81DP5B0E81DP5B0E81DP5B204500410@0001D000<10000 0P090@0EDP5B0E81DP5B0E81DP5B0E81DP5B008125802`49DPUB2E89DPT100P900X12JL9Y`VW2JL1 2JL02P48Y`RW2:L8Y`49200F0@P0200800P0200800P0200800P020813P020@0F00P0200800P02008 00P0200800P00@T800X12:L8Y`RW2:L12JL02P49Y`VW2JL9Y`482@0;0E89DPUB2E89DP402580605B 0E81DP5B0E81DP5B0E81DP5B0E81DPL11@010@40000E00030@0000801P405e81DP5B0E81DP5B0E81 DP5B0E81DP5B00812E802`5B2E89DPUB2E8100P900X1Y`VW2JL9Y`T12JL02P6W2:L8Y`RW204:200G 0@P0200800P0200800P0200800P020000P4:008101L800P0200800P0200800P0200800P00@0:200: 0JL8Y`RW2:L80@VW00X1Y`VW2JL9Y`T120T02`49DPUB2E89DPT100UB01P1DP5B0E81DP5B0E81DP5B 0E81DP5B0E860@D00@4100005@000`40000200D101MB0E81DP5B0E81DP5B0E81DP5B0E81DP020@YB 00/12E89DPUB2E890@082@0:0@VW2JL9Y`VW0@VW00X12:L8Y`RW2:L12`P0604800P0200800P02008 00P0200800P020811P020@0H00P0200800P0200800P0200800P020012`P02P48Y`RW2:L8Y`49Y`0: 0@VW2JL9Y`VW0@P900/1DPUB2E89DPUB0@0:DP0J0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E830@D0 0@4100005@000`40000200@101MB0E81DP5B0E81DP5B0E81DP5B0E81DP020@YB00/12E89DPUB2E89 0@092@0;0JL9Y`VW2JL9Y`402JL02P48Y`RW2:L8Y`4;200I0@P0200800P0200800P0200800P02008 00020@800P406@P0200800P0200800P0200800P0200800402`P02P48Y`RW2:L8Y`49Y`0<0@VW2JL9 Y`VW2JL120T02`5B2E89DPUB2E8100YB01X1DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP811@010@40 000E00030@00008001X1DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP812e802`5B2E89DPUB2E8100T9 00/12JL9Y`VW2JL90@09Y`0:0JL8Y`RW2:L80@`801X1200800P0200800P0200800P0200800P02081 01X0200800P0200800P0200800P0200800P00@`800X1Y`RW2:L8Y`P12JL0306W2JL9Y`VW2JL90@P9 00/12E89DPUB2E890@0;DP0J0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E820@@00@4100005@000`40 0002000IDP5B0E81DP5B0E81DP5B0E81DP5B0E81DP020@aB00/12E89DPUB2E890@092@0;0JL9Y`VW 2JL9Y`402JL02`48Y`RW2:L8Y`P100`803@1200800P0200800P0200800P0200800P0200800P02008 00P0200800P0200800P020013@P02P48Y`RW2:L8Y`49Y`0<0@VW2JL9Y`VW2JL12@T02`49DPUB2E89 DPT100]B01X1DP5B0E81DP5B0E81DP5B0E81DP5B0E81DPD00@4100005@020@<001P1DP5B0E81DP5B 0E81DP5B0E81DP5B0E820@aB00/12E89DPUB2E890@0:2@0;0@VW2JL9Y`VW2@402ZL02P48Y`RW2:L8 Y`4<200d0@0800P0200800P0200800P0200800P0200800P0200800P0200800P0200800P020080@`8 00X12:L8Y`RW2:L12ZL0306W2JL9Y`VW2JL90@T900/1DPUB2E89DPUB0@0200; 0@RW2:L8Y`RW20402ZL03049Y`VW2JL9Y`VW0@X900/1DPUB2E89DPUB0@0>DP0F0E81DP5B0E81DP5B 0E81DP5B0E81DPD00@4100005@000`400002000D0E81DP5B0E81DP5B0E81DP5B0E820@mB00/1DPUB 2E89DPUB0@0:2@0<0JL9Y`VW2JL9Y`T12jL02P6W2:L8Y`RW204?200/0@0800P0200800P0200800P0 200800P0200800P0200800P0200800P0204?200:0JL8Y`RW2:L80@^W00`1Y`VW2JL9Y`VW2@4:2@0; 0@UB2E89DPUB2@403e805@5B0E81DP5B0E81DP5B0E81DP5B0@0500410@0001D000<100000P004e81 DP5B0E81DP5B0E81DP5B0E800P4?DP0<0E89DPUB2E89DPT12PT03049Y`VW2JL9Y`VW0@^W00/12:L8 Y`RW2:L80@0?200Z0@0800P0200800P0200800P0200800P0200800P0200800P0200800P13`P02`6W 2:L8Y`RW2:L100^W00`12JL9Y`VW2JL9Y`4;2@0;0@UB2E89DPUB2@403e80505B0E81DP5B0E81DP5B 0E81DP5B1@010@40000E00030@0000800181DP5B0E81DP5B0E81DP5B0E820A1B00`12E89DPUB2E89 DP4:2@0<0JL9Y`VW2JL9Y`T12jL02`6W2:L8Y`RW2:L1010802P100P0200800P0200800P0200800P0 200800P0200800P0200800P140P02`48Y`RW2:L8Y`P100^W00`1Y`VW2JL9Y`VW2@4;2@0;0E89DPUB 2E89DP4045804`5B0E81DP5B0E81DP5B0E81DP401@010@40000E00030@00008000mB0E81DP5B0E81 DP5B0E80104@DP0<0@UB2E89DPUB2E812`T03@49Y`VW2JL9Y`VW2@402jL02`6W2:L8Y`RW2:L10108 10407PP0200800P0200800P0200800P0200800P0200800@140P02`48Y`RW2:L8Y`P100^W00h1Y`VW 2JL9Y`VW2JL90@/900/1DPUB2E89DPUB0@0@DP<100mB0E81DP5B0E81DP5B0E801@010@40000E0003 0@00008000P1DP5B0E81DPL14e803@49DPUB2E89DPUB2@402`T03@6W2JL9Y`VW2JL9Y`402jL03048 Y`RW2:L8Y`RW0A<81P404P0800P0200800P0200800P020H14`P03048Y`RW2:L8Y`RW0@^W00h12JL9 Y`VW2JL9Y`VW0@/900`12E89DPUB2E89DP4BDPL100QB0E81DP5B0@D00@4100005@000`4000020003 DP5B00H165803P49DPUB2E89DPUB2E812`T03@49Y`VW2JL9Y`VW2@402jL03@6W2:L8Y`RW2:L8Y`40 60P60@06200800P01P4H200=0@RW2:L8Y`RW2:L80@0;Y`0>0JL9Y`VW2JL9Y`VW2@4;2@0=0E89DPUB 2E89DPUB0@0GDPH100=B0E801@010@40000E00030@0000800`4MDP0>0@UB2E89DPUB2E89DP4<2@0= 0JL9Y`VW2JL9Y`VW0@00@RW2:L8Y`RW2:L8 Y`P20CP80P403ZL8Y`RW2:L8Y`RW2:L13JL03P49Y`VW2JL9Y`VW2JL13@T03P49DPUB2E89DPUB2E89 0P4KDP@00P4100005@000`40000201UB0`4040UB2E89DPUB2E89DPUB2@4=2@0?0JL9Y`VW2JL9Y`VW 2JL100fW00l12:L8Y`RW2:L8Y`RW2:L00`4b20<100l8Y`RW2:L8Y`RW2:L8Y`403JL04049Y`VW2JL9 Y`VW2JL9Y`4=2@0?0@UB2E89DPUB2E89DPUB00<1658500410@0001D000<100000P0FDP<10189DPUB 2E89DPUB2E89DPUB2@4>2@0?0@VW2JL9Y`VW2JL9Y`T100jW01412:L8Y`RW2:L8Y`RW2:L8Y`030B`8 0`404@RW2:L8Y`RW2:L8Y`RW2:L100jW0101Y`VW2JL9Y`VW2JL9Y`T13PT04@49DPUB2E89DPUB2E89 DPUB00<15E8500410@0001D000<100000P0DDP810189DPUB2E89DPUB2E89DPUB2E820@l900l1Y`VW 2JL9Y`VW2JL9Y`403jL04`48Y`RW2:L8Y`RW2:L8Y`RW2:L00P4X208101<8Y`RW2:L8Y`RW2:L8Y`RW 2:L100nW01012JL9Y`VW2JL9Y`VW2JL13`T04`49DPUB2E89DPUB2E89DPUB2E800P4CDPD00@410000 5@000`40000200iB1P405589DPUB2E89DPUB2E89DPUB2E8140T04@6W2JL9Y`VW2JL9Y`VW2JL100nW 01@12:L8Y`RW2:L8Y`RW2:L8Y`RW20H170P60@0DY`RW2:L8Y`RW2:L8Y`RW2:L8Y`4?Y`0B0@VW2JL9 Y`VW2JL9Y`VW2JL13`T05049DPUB2E89DPUB2E89DPUB2E891P4=DPD00@4100005@000`40000200EB 2@406@UB2E89DPUB2E89DPUB2E89DPUB2E89DP404@T04@49Y`VW2JL9Y`VW2JL9Y`T1012W01T12:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW00X12@P90@0I2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0@0@Y`0B 0JL9Y`VW2JL9Y`VW2JL9Y`T140T06@49DPUB2E89DPUB2E89DPUB2E89DPUB2E802@44DPD00@410000 5@000`40000200D10249DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP404PT04@6W2JL9Y`VW 2JL9Y`VW2JL1016W02812:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L82@408@RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW0@0AY`0B0@VW2JL9Y`VW2JL9Y`VW2JL14@T08@49DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP050@@00@4100005@000`400002000S2E89DPUB2E89DPUB 2E89DPUB2E89DPUB2E89DPUB2E89DPT00P4B2@0C0JL9Y`VW2JL9Y`VW2JL9Y`VW0@0AY`8104JW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L80P4AY`0D0@VW2JL9Y`VW2JL9Y`VW2JL9Y`4A2@81029B2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E891@010@40000E00030@000080021B2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2@<150T04`49Y`VW2JL9Y`VW2JL9Y`VW2@404jL30@10Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20<14jL0506W2JL9Y`VW2JL9Y`VW 2JL9Y`T14`T30@0ODPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP0500410@0001D000<10000 0P007@UB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E8900<15PT05@49Y`VW2JL9Y`VW2JL9Y`VW2JL9 0@0EY`<103ZW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L80`4EY`0F0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90AD90`407589DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPT500410@0001D000<100000P006U89DPUB2E89DPUB2E89DPUB2E89DPUB2E890`4H2@0G 0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@405jL30@0dY`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20<15jL0606W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90AL90`406E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E801@010@40000E00030@00008001L9DPUB2E89DPUB2E89DPUB 2E89DPUB2@030AX901T12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T101VW0`40;ZL8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P30AVW01X1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL90AT90`405U89DPUB2E89DPUB2E89DPUB2E89DPT500410@0001D000<100000P005589DPUB2E89 DPUB2E89DPUB2E890`4L2@0K0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T101^W0`40::L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P30A^W01`1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`T16`T30@0CDPUB2E89DPUB2E89DPUB2E89DP0500410@0001D00P4300092E89DPUB2E8900/1 7PT07049Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`4NY`/101:W2:L8Y`RW2:L8Y`RW2:L8Y`P;0AjW 01`12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL17PT:0@092E89DPUB2E8900@00P4100005@000`40 000200T1:0T07P49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0BRW4P4XY`0N0@VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL19`T:0@@00@4100005@000`400002030902012JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW0F2W02012JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0Bl91@010@40 000E00030@000080;`T08P49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`5NY`0R0@VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0Bh91@010@40000E00030@000080;@T20@0R2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`81FZL20@0R2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`81;0T500410@0001D000<100000P0Y2@@102JW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2@<1DjL40@0VY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`T30BT91@010@40000E00030@0000809PT30@0]2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL900@1C:L30@0]2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL900@19@T500410@0001D000<100000P0P2@H103@9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW1P50Y`H103@9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW1P4O2@D00@4100005@000`40000201L92@40@:L9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`T90BjW2@40@:L9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`T90AH91@010@40000E00030@0000805`40DZL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`T^0@1BY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2AL110010@40000E00030@0000800?nW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL01@010@40000E00030@0000800?l9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T01@010@4000000`010@020@<0 00<100000P030@D000<100000P00ojL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`0500410@0000<000<100002P000`40 000200810`00o`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@0400810@0000<000<100002P000`40000200030@000080 0?nW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL01@010@40000300030@0000L00`4500030@0000800?l9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`T01@010@40000300030@0000L000<100001@000`400002003oY`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW00D0 0@41000000@00@412@000`40000500030@0000805`40DZL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T^0@1B Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2AL110010@40000300030@0000L0104400030@0000805jL90@10 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2@T1;PT90@10Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2@T15ZL500410@0001D000<100000P0PY`H103@9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW1P502@H103@9Y`VW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW1P4OY`D00@4100005@000`40000202JW 0`40;@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@040D`90`40;@VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@040BFW1@010@40000E0003 0@000080:JL40@0VY`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T30E<910409ZL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90`4YY`D00@4100005@000`40000202fW 0P408PVW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL20EX90P408PVW2JL9Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL20BbW1@010@40000E00030@000080;jL08P49Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`5N2@0R0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW0BjW 1@010@40000E00030@000080<:L08049Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL1H0T08049 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL1;jL500410@0001D000<100000P090BRW01h12JL9 Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`4X2A81:0T07P49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW0BNW2P4400410@0001D00P4300092:L8Y`RW2:L800/17ZL07049Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL9Y`4N2@/1019B2E89DPUB2E89DPUB2E89DPT;0Ah901`12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9 Y`VW2JL17ZL:0@092:L8Y`RW2:L800@00P4100005@000`400002000DY`RW2:L8Y`RW2:L8Y`RW2:L8 Y`P30AbW01/12JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@406`T30@0XDPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2@<16`T0706W2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2@4KY`<1 01>W2:L8Y`RW2:L8Y`RW2:L8Y`RW00D00@4100005@000`400002000G2:L8Y`RW2:L8Y`RW2:L8Y`RW 2:L8Y`P00`4JY`0I0@VW2JL9Y`VW2JL9Y`VW2JL9Y`VW2JL90@0I2@<102iB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E890`4I2@0J0JL9Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`VW 2@4IY`<101JW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L81@010@40000E00030@00008001ZW2:L8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW20<16:L05`49Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T101L90`40=589DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPT30AL901P1Y`VW2JL9Y`VW 2JL9Y`VW2JL9Y`VW2@4GY`<101VW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW00D00@4100005@000`40 0002000M2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P00`4FY`0E0@VW2JL9Y`VW2JL9Y`VW2JL9 Y`T101D90`40>U89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPT30AD901H1Y`VW2JL9Y`VW2JL9Y`VW2JL9Y`T15JL30@0LY`RW2:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW20D00@4100005@000`400002000PY`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8 Y`P30ABW01<12JL9Y`VW2JL9Y`VW2JL9Y`T101<90`40@589DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPT30A<901@1Y`VW2JL9Y`VW2JL9Y`VW 2JL90A>W0`407jL8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L01@010@40000E00030@000080 02<8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW20020A:W01<1Y`VW2JL9Y`VW2JL9Y`VW 2JL101490P40AU89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPT20A4901@12JL9Y`VW2JL9Y`VW2JL9Y`VW0A6W0P408ZL8Y`RW2:L8 Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`P500410@0001D000<100000P050@0Q2:L8Y`RW2:L8Y`RW 2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L101:W0141Y`VW2JL9Y`VW2JL9Y`VW0@0A2@0R0@UB2E89DPUB2E89 DPUB2E89DPUB2E89DPUB2E89DPUB2@T10249DPUB2E89DPUB2E89DPUB2E89DPUB2E89DPUB2E89DP40 4@T04P49Y`VW2JL9Y`VW2JL9Y`VW0A6W02412:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L0 1@4400410@0001D000<100000P0520T101T8Y`RW2:L8Y`RW2:L8Y`RW2:L8Y`RW2:L1016W01412JL9 Y`VW2JL9Y`VW2JL90@0@2@0I0@UB2E89DPUB2E89DPUB2E89DPUB2E89DP0:0@UB2@406@UB2E89DPUB 2E89DPUB2E89DPUB2E89DP4040T04P6W2JL9Y`VW2JL9Y`VW2JL90A2W01T12:L8Y`RW2:L8Y`RW2:L8 Y`RW2:L8Y`RW00T110P500410@0001D000<100000P0>20H101BW2:L8Y`RW2:L8Y`RW2:L8Y`RW0A2W 0141Y`VW2JL9Y`VW2JL9Y`VW0@0?2@0D0@UB2E89DPUB2E89DPUB2E89DPT60AaB1P405589DPUB2E89 DPUB2E89DPUB2E813`T04P49Y`VW2JL9Y`VW2JL9Y`VW0@nW01@12:L8Y`RW2:L8Y`RW2:L8Y`RW20H1 3@P500410@0001D000<100000P0D20810188Y`RW2:L8Y`RW2:L8Y`RW2:L20@nW00l1Y`VW2JL9Y`VW 2JL9Y`403`T04`49DPUB2E89DPUB2E89DPUB2E800P4XDP8101<9DPUB2E89DPUB2E89DPUB2E8100l9 01012JL9Y`VW2JL9Y`VW2JL13jL04`48Y`RW2:L8Y`RW2:L8Y`RW2:L00P4C20D00@4100005@000`40 000201H80`404PRW2:L8Y`RW2:L8Y`RW2:L80@jW00l12JL9Y`VW2JL9Y`VW2@403PT04@49DPUB2E89 DPUB2E89DPUB00<1;5830@0A2E89DPUB2E89DPUB2E89DP403PT0406W2JL9Y`VW2JL9Y`VW2@4>Y`0A 0@RW2:L8Y`RW2:L8Y`RW2:L00`4E20D00@4100005@000`40000201T80`4040RW2:L8Y`RW2:L8Y`RW 204=Y`0?0JL9Y`VW2JL9Y`VW2JL100d900l12E89DPUB2E89DPUB2E800`4bDP<100l9DPUB2E89DPUB 2E89DP403@T04049Y`VW2JL9Y`VW2JL9Y`4=Y`0?0@RW2:L8Y`RW2:L8Y`RW00<160P500410@0001D0 0P4301`80P403jL8Y`RW2:L8Y`RW2:L80@0=Y`0=0JL9Y`VW2JL9Y`VW0@0=2@0>0@UB2E89DPUB2E89 DPT20CQB0P403U89DPUB2E89DPUB2E813@T03P49Y`VW2JL9Y`VW2JL13JL03P48Y`RW2:L8Y`RW2:L8 0P4K20@00P4100005@000`40000201h80P403PRW2:L8Y`RW2:L8Y`P13:L03@49Y`VW2JL9Y`VW2@40 30T03@49DPUB2E89DPUB2E800P4lDP8100d9DPUB2E89DPUB2E8100`900h1Y`VW2JL9Y`VW2JL90@bW 00d12:L8Y`RW2:L8Y`RW00817@P500410@0001D000<100000P030Ad800h12:L8Y`RW2:L8Y`RW0@bW 00d1Y`VW2JL9Y`VW2JL100`900d1DPUB2E89DPUB2E8101eB1P4MDP0=0@UB2E89DPUB2E890@0<2@0> 0@VW2JL9Y`VW2JL9Y`40@RW2:L8Y`RW2:L8Y`4;Y`0=0@VW2JL9Y`VW2JL90@0;2@0=0E89DPUB2E89DPUB0@0HDPL1 00EB0E81DP060AQB00d12E89DPUB2E89DPT100/900h1Y`VW2JL9Y`VW2JL90@^W00d1Y`RW2:L8Y`RW 2:L101L81P400`08000500410@0001D000<100000P002@P0200800P020060A<800d12:L8Y`RW2:L8 Y`P100^W00d1Y`VW2JL9Y`VW2JL100/900`12E89DPUB2E89DP4CDPH1015B0E81DP5B0E81DP5B0E81 DP070A=B00`12E89DPUB2E89DP4;2@0>0@VW2JL9Y`VW2JL9Y`4;Y`0<0@RW2:L8Y`RW2:L14PP60@09 200800P0200800D00@4100005@000`400003000>200800P0200800P020040A0800`12:L8Y`RW2:L8 Y`4;Y`0=0@VW2JL9Y`VW2JL90@0;2@0;0E89DPUB2E89DP4045850@0MDP5B0E81DP5B0E81DP5B0E81 DP5B0E81DP5B0E80104@DP0;0@UB2E89DPUB2@402`T03P6W2JL9Y`VW2JL9Y`T12jL02`6W2:L8Y`RW 2:L101080`403P0800P0200800P020081P010@40000E00030@00008001@800P0200800P0200800P0 20080A0800`12:L8Y`RW2:L8Y`4:Y`0<0JL9Y`VW2JL9Y`T12`T02`5B2E89DPUB2E81011B02H1DP5B 0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP8145802`49DPUB2E89DPT100/900`1Y`VW 2JL9Y`VW2@4;Y`0;0JL8Y`RW2:L8Y`4040P04`40200800P0200800P0200800P01@010@40000E0003 0@0000<001@800P0200800P0200800P020080@l800`1Y`RW2:L8Y`RW204:Y`0<0@VW2JL9Y`VW2JL1 2`T02`49DPUB2E89DPT100mB02P1DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B 0P4?DP0;0E89DPUB2E89DP402`T03049Y`VW2JL9Y`VW0@^W00/12:L8Y`RW2:L80@0?200C0@0800P0 200800P0200800P0200600410@0001D000<100000P005PP0200800P0200800P0200800P0204?200; 0JL8Y`RW2:L8Y`402ZL0306W2JL9Y`VW2JL90@/900X1DPUB2E89DPT13e80:P5B0E81DP5B0E81DP5B 0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP813e802P5B2E89DPUB2@4;2@0<0JL9Y`VW2JL9Y`T1 2ZL02`48Y`RW2:L8Y`P100l801D100P0200800P0200800P0200800P01@010@40000E00030@0000<0 01H800P0200800P0200800P0200800P13PP03048Y`RW2:L8Y`RW0@VW00`12JL9Y`VW2JL9Y`4:2@0; 0E89DPUB2E89DP403U80;05B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B 0P4>DP0;0@UB2E89DPUB2@402PT03049Y`VW2JL9Y`VW0@ZW00/1Y`RW2:L8Y`RW0@0>200E0@0800P0 200800P0200800P0200800H00@4100005@000`400002000H200800P0200800P0200800P0200800P1 3@P0306W2:L8Y`RW2:L80@VW00`1Y`VW2JL9Y`VW2@4:2@0;0@UB2E89DPUB2@403E80;P5B0E81DP5B 0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E820@eB00/1DPUB2E89DPUB0@0:2@0< 0JL9Y`VW2JL9Y`T12ZL02`48Y`RW2:L8Y`P100d801L100P0200800P0200800P0200800P020050041 0@0001D000<100000`0060P0200800P0200800P0200800P020080@d800/1Y`RW2:L8Y`RW0@0:Y`0; 0JL9Y`VW2JL9Y`402PT02P5B2E89DPUB2@4=DP0`0E81DP5B0E81DP5B0E81DP5B0E81DP5B0E81DP5B 0E81DP5B0E81DP5B0E81DP5B0P4=DP0:0E89DPUB2E890@X900`12JL9Y`VW2JL9Y`49Y`0;0@RW2:L8 Y`RW20403@P05`40200800P0200800P0200800P0200800H00@4100005@020@<001X800P0200800P0 200800P0200800P020080@`800/12:L8Y`RW2:L80@0:Y`0;0@VW2JL9Y`VW2@402PT02P49DPUB2E89 DP4DP5B0E81DP5B0E81DP47DP0:0@UB2E89DPUB0@P900P1Y`VW2JL90@NW00X1Y`RW 2:L8Y`P120P0404800P0200800P02008004G00410@0001D000<100005P003`4800P0200800P02008 0@08200:0@RW2:L8Y`RW0@NW00T12JL9Y`VW2@401`T02P5B2E89DPUB2@47DP0>0E81DP5B0E81DP5B 0E8[0@0;DP5B0E81DP5B0E800P47DP0:0E89DPUB2E890@P900P12JL9Y`VW0@NW00X12:L8Y`RW2:L1 20P04040200800P0200800P0204G00410@0001D000<100005P003`40200800P0200800P00@08200: 0JL8Y`RW2:L80@NW00T1Y`VW2JL9Y`401`T02P49DPUB2E89DP47DP8100]B0E81DP5B0E81DP0[0@0> DP5B0E81DP5B0E81DP47DP0:0@UB2E89DPUB0@P900P1Y`VW2JL90@NW00X1Y`RW2:L8Y`P120P03`48 00P0200800P020080@0H00410@0001D000<100005`003P40200800P0200800P120P02P48Y`RW2:L8 Y`47Y`090@VW2JL9Y`T100L900X1DPUB2E89DPT11e803P5B0E81DP5B0E81DP5B:`402e81DP5B0E81 DP5B00811e802P5B2E89DPUB2@482@080@VW2JL9Y`47Y`0:0@RW2:L8Y`RW0@P800l100P0200800P0 2008004060010@40000E00030@0001P000h100P0200800P020080@L800X1Y`RW2:L8Y`P11jL02@6W 2JL9Y`VW0@062@0:0E89DPUB2E890@QB0P402e81DP5B0E81DP5B02d100aB0E81DP5B0E81DP48DP0: 0E89DPUB2E890@L900P1Y`VW2JL90@NW00X1Y`RW2:L8Y`P11`P03`40200800P0200800P00@0I0041 0@0001D000<1000060003P4800P0200800P0200120P02@6W2:L8Y`RW0@07Y`090@VW2JL9Y`T100H9 00X12E89DPUB2E812580305B0E81DP5B0E81DRl100aB0E81DP5B0E81DP47DP0:0@UB2E89DPUB0@L9 00P12JL9Y`VW0@NW00X12:L8Y`RW2:L11`P03`4800P0200800P020080@0I00410@0001D000<10000 6@003@4800P0200800P0204020P02@48Y`RW2:L80@07Y`090JL9Y`VW2JL100H900X1DPUB2E89DPT1 1e80305B0E81DP5B0E81DRl100]B0E81DP5B0E81DP020@MB00X1DPUB2E89DPT11`T0206W2JL9Y`T1 1jL02@6W2:L8Y`RW0@08200>0@0800P0200800P0204J00410@0000d0104400030@0001T000d100P0 200800P0200100P800T1Y`RW2:L8Y`401jL02@49Y`VW2JL90@062@0:0@UB2E89DPUB0@MB0P402e81 DP5B0E81DP5B02l100aB0E81DP5B0E81DP47DP0:0@UB2E89DPUB0@L900P12JL9Y`VW0@NW00T12:L8 Y`RW204020P03P4800P0200800P020016P010@40000=00030@0000D00P4K000<0@0800P0200800P1 20P02@48Y`RW2:L80@07Y`090JL9Y`VW2JL100H900X1DPUB2E89DPT11e80305B0E81DP5B0E81DS41 00UB0E81DP5B0E800P47DP0:0E89DPUB2E890@L900P1Y`VW2JL90@NW00T1Y`RW2:L8Y`4020P03@40 200800P0200800406P020@40000>00030@0000@000<10000o`0700410@0000l000<100000`000`40 003o00L00@41000040000`40000200030@00008000<10000?@000`40000m00030@0003`000<10000 ?@000`40000200410@0000d000@1000110000`40000200030@0000X000<100002@000`40000:0003 0@0000X000<100002P000`40000:00030@0000T000<100002P000`40000:00030@0000X000<10000 2@000`40000:00030@0000X000<100002P000`40000900030@0000X000<100002P000`40000:0003 0@0000X000<100002@000`40000200410@0000h00P450?l12`410000o`0Q0000o`0Q0000o`0Q0000 o`0Q0000\ \>"], ImageRangeCache->{{{0, 287}, {287, 0}} -> {-0.207, -0.172242, 0.00783272, 0.00783272}}], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] ContourGraphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]] }, Open ]] }, Open ]] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowSize->{520, 600}, WindowMargins->{{296, Automatic}, {Automatic, 88}}, PrintingPageRange->{Automatic, Automatic}, PrintingOptions->{"PaperSize"->{612, 792}, "PaperOrientation"->"Portrait", "Magnification"->1} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1731, 51, 142, 4, 90, "Title"], Cell[CellGroupData[{ Cell[1898, 59, 62, 0, 47, "Section"], Cell[CellGroupData[{ Cell[1985, 63, 97, 2, 27, "Input"], Cell[2085, 67, 102, 2, 37, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2224, 74, 89, 1, 27, "Input"], Cell[2316, 77, 97, 2, 37, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2450, 84, 131, 3, 27, "Input"], Cell[2584, 89, 125, 2, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[2746, 96, 89, 1, 27, "Input"], Cell[2838, 99, 93, 1, 37, "Output"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[2980, 106, 44, 0, 47, "Section"], Cell[CellGroupData[{ Cell[3049, 110, 63, 1, 27, "Input"], Cell[3115, 113, 38, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3190, 119, 173, 4, 43, "Input"], Cell[3366, 125, 38, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3441, 131, 173, 4, 43, "Input"], Cell[3617, 137, 38, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3692, 143, 145, 3, 43, "Input"], Cell[3840, 148, 38, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[3915, 154, 42, 1, 27, "Input"], Cell[3960, 157, 35, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[4032, 163, 71, 1, 27, "Input"], Cell[4106, 166, 84568, 2080, 296, 16552, 1236, "GraphicsData", "PostScript", "Graphics"], Cell[88677, 2248, 137, 3, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[88851, 2256, 71, 1, 27, "Input"], Cell[88925, 2259, 84885, 2084, 296, 16553, 1236, "GraphicsData", "PostScript", "Graphics"], Cell[173813, 4345, 137, 3, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[173987, 4353, 71, 1, 27, "Input"], Cell[174061, 4356, 98250, 2756, 296, 24357, 1839, "GraphicsData", "PostScript", "Graphics"], Cell[272314, 7114, 137, 3, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[272488, 7122, 71, 1, 27, "Input"], Cell[272562, 7125, 85515, 2207, 296, 17717, 1365, "GraphicsData", "PostScript", "Graphics"], Cell[358080, 9334, 137, 3, 27, "Output"] }, Open ]] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************) ccseapps-2.5/CCSEApps/iamrlib/benchmarks/EXACT_3D.F0000644000175000017500000001062611634153073022721 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: EXACT_3D.F,v 1.3 1999/03/25 23:37:42 sstanley Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "PROB_AMR_F.H" #include "ArrayLim.H" #include "EXACT_F.H" #define SDIM 3 c c ::: ----------------------------------------------------------- c ::: This case is an unsteady viscous benchmark for which the c ::: exact solution is, c ::: u(x,y,t) = - Cos(Pi x) Sin(Pi y) Exp(-2 Pi^2 Nu t) c ::: v(x,y,t) = Sin(Pi x) Cos(Pi y) Exp(-2 Pi^2 Nu t) c ::: p(x,y,t) = - {Cos(2 Pi x) + Cos(2 Pi y)} Exp(-4 Pi^2 Nu t) / 4 c ::: In this dircetory, ViscBench3d.cpp, reads a plot file and compares c ::: the solution against this exact solution. This benchmark was c ::: originally derived by G.I. Taylor (Phil. Mag., Vol. 46, No. 274, c ::: pp. 671-674, 1923) and Ethier and Steinman c ::: (Intl. J. Num. Meth. Fluids, Vol. 19, pp. 369-375, 1994) give c ::: the pressure field. c subroutine FORT_VISCBENCH(time, nu, unifdir, lo, hi, & ncomp, state, DIMS(state), & dx, xlo, xhi) implicit none integer ncomp, unifdir integer lo(SDIM), hi(SDIM) integer DIMDEC(state) REAL_T time, nu, dx(SDIM) REAL_T xlo(SDIM), xhi(SDIM) REAL_T state(DIMV(state),ncomp) c c ::::: local variables c integer i, j, k, n REAL_T x, y, z REAL_T hx, hy, hz REAL_T spx, spy, spz, cpx, cpy, cpz REAL_T expterm hx = dx(1) hy = dx(2) hz = dx(3) expterm = exp(-two*Pi**2*nu*time) do k = lo(3), hi(3) z = xlo(3) + hz*(float(k-lo(3)) + half) spz = sin(Pi*z) cpz = cos(Pi*z) do j = lo(2), hi(2) y = xlo(2) + hy*(float(j-lo(2)) + half) spy = sin(Pi*y) cpy = cos(Pi*y) do i = lo(1), hi(1) x = xlo(1) + hx*(float(i-lo(1)) + half) spx = sin(Pi*x) cpx = cos(Pi*x) c c Uniform in the X-direction c if (unifdir .eq. 0) then state(i,j,k,1) = zero state(i,j,k,2) = spz*cpy * expterm state(i,j,k,3) = - cpz*spy * expterm state(i,j,k,4) = one do n = 5, ncomp state(i,j,k,n) = cpz*cpy * expterm enddo c c Uniform in the Y-direction c elseif (unifdir .eq. 1) then state(i,j,k,1) = - cpx*spz * expterm state(i,j,k,2) = zero state(i,j,k,3) = spx*cpz * expterm state(i,j,k,4) = one do n = 5, ncomp state(i,j,k,n) = cpx*cpz * expterm enddo c c Uniform in the Z-direction c elseif (unifdir .eq. 2) then state(i,j,k,1) = - cpx*spy * expterm state(i,j,k,2) = spx*cpy * expterm state(i,j,k,3) = zero state(i,j,k,4) = one do n = 5, ncomp state(i,j,k,n) = cpx*cpy * expterm enddo endif end do end do end do end ccseapps-2.5/CCSEApps/iamrlib/VISCOPERATOR_F.H0000644000175000017500000000367711634153073021611 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #ifndef _VISCOPERATOR_F_H_ #define _VISCOPERATOR_F_H_ /* ** $Id: VISCOPERATOR_F.H,v 1.7 2002/04/26 22:10:02 lijewski Exp $ */ #ifdef BL_LANG_FORT # define FORT_VISCEXTRAP viscextrap #else # if defined(BL_FORT_USE_UPPERCASE) # define FORT_VISCEXTRAP VISCEXTRAP # elif defined(BL_FORT_USE_LOWERCASE) # define FORT_VISCEXTRAP viscextrap # elif defined(BL_FORT_USE_UNDERSCORE) # define FORT_VISCEXTRAP viscextrap_ #endif #include extern "C" { void FORT_VISCEXTRAP (Real* visc, ARLIM_P(visclo), ARLIM_P(isclo), const int* lo, const int* hi, const int* comp); } #endif #endif /*_VISCOPERATOR_F_H_*/ ccseapps-2.5/CCSEApps/iamrlib/SYNCREG_2D.F0000644000175000017500000001431111634153073021044 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ c c $Id: SYNCREG_2D.F,v 1.16 2002/08/29 22:14:52 car Exp $ c #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "SYNCREG_F.H" #include "ArrayLim.H" #define SDIM 2 c ::: ----------------------------------------------------------- c ::: coarsen fine grid node centered data along edge of node c ::: centered fine grid array. c ::: c ::: INPUTS/OUTPUTS: c ::: crse <= node centered coarse data c ::: DIMS(crse) => index limits for crse c ::: fine => node centered fine data c ::: DIMS(fine) => index limits for fine c ::: lo,hi => node centered subregion of crse to define c ::: dir => index direction of normal (0 based) c ::: ratio => refinement ratio c ::: ----------------------------------------------------------- subroutine FORT_SRCRSEREG(fine,DIMS(fine),crse,DIMS(crse),lo,hi,dir, & ratios) integer DIMDEC(fine) integer DIMDEC(crse) integer lo(SDIM) integer hi(SDIM) integer dir integer ratios(0:1) REAL_T fine(DIMV(fine)) REAL_T crse(DIMV(crse)) integer i, j, ic, jc integer m, n integer ratiox, ratioy REAL_T coeff, denom c NOTE: the reason that the coefficients add up to 1/ratio and NOT to 1 c is because the divergences and DGphi were computed using the c local dx, so in order to add the fine contribution to the c coarse contribution the fine contribution must be weighted c by dx_fine/dx_coarse = 1/ratio ratiox = ratios(0) ratioy = ratios(1) c NOTE: we halve fine on the corners since the corners are c counted in both directions; later we double them to restore c them to their previous values. if (dir .eq. 0) then c ::::: sum in j direction ic = lo(1) i = ratiox*ic do jc = lo(2), hi(2) crse(ic,jc) = zero end do j = ratioy*lo(2) fine(i,j) = half*fine(i,j) j = ratioy*hi(2) fine(i,j) = half*fine(i,j) denom = one / (ratiox * ratioy**2) do m = 0, (ratioy-1) coeff = (ratioy - m) * denom if (m .eq. 0) coeff = half * coeff do jc = lo(2), hi(2) j = ratioy*jc crse(ic,jc) = crse(ic,jc) + coeff * $ ( fine(i,j+m) + fine(i,j-m) ) end do end do j = ratioy*lo(2) fine(i,j) = two*fine(i,j) j = ratioy*hi(2) fine(i,j) = two*fine(i,j) else c ::::: sum in i direction jc = lo(2) j = ratioy*jc do ic = lo(1), hi(1) crse(ic,jc) = zero end do i = ratiox*lo(1) fine(i,j) = half*fine(i,j) i = ratiox*hi(1) fine(i,j) = half*fine(i,j) denom = one / (ratioy * ratiox**2) do m = 0, (ratiox-1) coeff = (ratiox - m) * denom if (m .eq. 0) coeff = half * coeff do ic = lo(1), hi(1) i = ratiox*ic crse(ic,jc) = crse(ic,jc) + coeff * $ ( fine(i+m,j) + fine(i-m,j) ) end do end do i = ratiox*lo(1) fine(i,j) = two*fine(i,j) i = ratiox*hi(1) fine(i,j) = two*fine(i,j) end if end c ::: ----------------------------------------------------------- c ::: create mask at nodes using values at surrounding cells c ::: c ::: INPUTS/OUTPUTS: c ::: mask <= node-centered mask array c ::: DIMS(mask) => index limits for mask c ::: cells => cell-centered array (each value is 0. or 1.) c ::: DIMS(cells) => index limits for cells c ::: ----------------------------------------------------------- subroutine FORT_MAKEMASK(mask,DIMS(mask),cells,DIMS(cells)) integer DIMDEC(mask) integer DIMDEC(cells) REAL_T mask(DIMV(mask)) REAL_T cells(DIMV(cells)) integer i, j do j = ARG_L2(mask), ARG_H2(mask) do i = ARG_L1(mask), ARG_H1(mask) mask(i,j) = cells(i,j ) + cells(i-1,j ) $ + cells(i,j-1) + cells(i-1,j-1) end do end do end c ::: ----------------------------------------------------------- c ::: modify mask from values 0. through 4. to values 0. or 1. c ::: c ::: INPUTS/OUTPUTS: c ::: mask <= node-centered mask array c ::: DIMS(mask) => index limits for mask c ::: ----------------------------------------------------------- subroutine FORT_CONVERTMASK(mask,DIMS(mask)) integer DIMDEC(mask) REAL_T mask(DIMV(mask)) integer i, j do j = ARG_L2(mask), ARG_H2(mask) do i = ARG_L1(mask), ARG_H1(mask) if (mask(i,j) .gt. 3.5D0) then mask(i,j) = zero else mask(i,j) = one end if end do end do end ccseapps-2.5/CCSEApps/iamrlib/PROJOUTFLOWBC_3D.F0000644000175000017500000015320611634153073022001 0ustar amckinstryamckinstry/* ** (c) 1996-2000 The Regents of the University of California (through ** E.O. Lawrence Berkeley National Laboratory), subject to approval by ** the U.S. Department of Energy. Your use of this software is under ** license -- the license agreement is attached and included in the ** directory as license.txt or you may contact Berkeley Lab's Technology ** Transfer Department at TTD@lbl.gov. NOTICE OF U.S. GOVERNMENT RIGHTS. ** The Software was developed under funding from the U.S. Government ** which consequently retains certain rights as follows: the ** U.S. Government has been granted for itself and others acting on its ** behalf a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, and perform publicly ** and display publicly. Beginning five (5) years after the date ** permission to assert copyright is obtained from the U.S. Department of ** Energy, and subject to any subsequent five (5) year renewals, the ** U.S. Government is granted for itself and others acting on its behalf ** a paid-up, nonexclusive, irrevocable, worldwide license in the ** Software to reproduce, prepare derivative works, distribute copies to ** the public, perform publicly and display publicly, and to permit ** others to do so. */ #undef BL_LANG_CC #ifndef BL_LANG_FORT #define BL_LANG_FORT #endif #include "REAL.H" #include "CONSTANTS.H" #include "BC_TYPES.H" #include "PROJOUTFLOWBC_F.H" #include "ArrayLim.H" #define SDIM 3 #if defined(BL_USE_FLOAT) || defined(BL_T3E) || defined(BL_CRAY) #define SMALL 1.0e-10 #define sixteenth .0625e0 #else #define SMALL 1.0d-10 #define sixteenth .0625d0 #endif subroutine FORT_EXTRAP_PROJ(DIMS(u),u,DIMS(divu),divu,DIMS(rho),rho, & DIMS(uExt),uExt,DIMS(divuExt),divuExt, & DIMS(rhoExt),rhoExt,lo,hi,face, zeroIt) implicit none c compute divu_ave twice due to precision problems integer DIMDEC(u) integer DIMDEC(divu) integer DIMDEC(rho) integer DIMDEC(uExt) integer DIMDEC(divuExt) integer DIMDEC(rhoExt) integer face integer lo(SDIM),hi(SDIM) REAL_T u(DIMV(u),SDIM) REAL_T divu(DIMV(divu)) REAL_T rho(DIMV(rho)) REAL_T uExt(DIMV(uExt),SDIM-1) REAL_T divuExt(DIMV(divuExt)) REAL_T rhoExt(DIMV(rhoExt)) integer zeroIt c local variables integer ics,ice,jcs,jce,kcs,kce integer ife,jfe,kfe integer if,jf,kf REAL_T divu_ave1,divu_ave2 REAL_T max_divu, min_divu REAL_T max_pert, small_pert parameter ( small_pert = SMALL) integer i,j,k #define XLO 0 #define YLO 1 #define ZLO 2 #define XHI 3 #define YHI 4 #define ZHI 5 ics = ARG_L1(u) ice = ARG_H1(u) jcs = ARG_L2(u) jce = ARG_H2(u) kcs = ARG_L3(u) kce = ARG_H3(u) ife = hi(1) jfe = hi(2) kfe = hi(3) zeroIt = 0 if (face .eq. XLO) then if=ife max_divu = divu(ice-1,jcs,kcs) min_divu = max_divu do k = kcs, kce do j = jcs, jce uExt(j,k,if,1) = half*(three*u(ice-1,j,k,2) - u(ice,j,k,2)) uExt(j,k,if,2) = half*(three*u(ice-1,j,k,3) - u(ice,j,k,3)) divuExt(j,k,if) = half*(three*divu(ice-1,j,k) - divu(ice,j,k)) rhoExt(j,k,if) = half*(three*rho(ice-1,j,k) - rho(ice,j,k)) max_divu = max(max_divu,divuExt(j,k,if)) min_divu = min(min_divu,divuExt(j,k,if)) end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(jcs,kcs,if)) do k = kcs, kce do j = jcs, jce max_pert = MAX(max_pert,ABS(divuExt(j,k,if))) end do end do else if (face .eq. YLO) then jf = jfe max_divu = divu(ics,jce-1,kcs) min_divu = max_divu do k = kcs, kce do i = ics, ice uExt(i,k,jf,1) = half*(three*u(i,jce-1,k,1) - u(i,jce,k,1)) uExt(i,k,jf,2) = half*(three*u(i,jce-1,k,3) - u(i,jce,k,3)) divuExt(i,k,jf) = half*(three*divu(i,jce-1,k) - divu(i,jce,k)) rhoExt(i,k,jf) = half*(three*rho(i,jce-1,k) - rho(i,jce,k)) max_divu = max(max_divu,divuExt(i,k,jf)) min_divu = min(min_divu,divuExt(i,k,jf)) end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,kcs,jf)) do k = kcs, kce do i = ics, ice max_pert = MAX(max_pert,ABS(divuExt(i,k,jf))) end do end do else if (face .eq. ZLO) then kf = kfe max_divu = divu(ics,jcs,kce-1) min_divu = max_divu do j = jcs, jce do i = ics, ice uExt(i,j,kf,1) = half*(three*u(i,j,kce-1,2) - u(i,j,kce,2)) uExt(i,j,kf,2) = half*(three*u(i,j,kce-1,3) - u(i,j,kce,3)) divuExt(i,j,kf) = half*(three*divu(i,j,kce-1) - divu(i,j,kce)) rhoExt(i,j,kf) = half*(three*rho(i,j,kce-1) - rho(i,j,kce)) max_divu = max(max_divu,divuExt(i,j,kf)) min_divu = min(min_divu,divuExt(i,j,kf)) end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,jcs,kf)) do j = jcs, jce do i = ics, ice max_pert = MAX(max_pert,ABS(divuExt(i,j,kf))) end do end do else if (face .eq. XHI) then if = ife max_divu = divu(ics+1,jcs,kcs) min_divu = max_divu do k = kcs, kce do j = jcs, jce uExt(j,k,if,1) = half*(three*u(ics+1,j,k,2) - u(ics,j,k,2)) uExt(j,k,if,2) = half*(three*u(ics+1,j,k,3) - u(ics,j,k,3)) divuExt(j,k,if) = half*(three*divu(ics+1,j,k) - divu(ics,j,k)) rhoExt(j,k,if) = half*(three*rho(ics+1,j,k) - rho(ics,j,k)) max_divu = max(max_divu,divuExt(j,k,if)) min_divu = min(min_divu,divuExt(j,k,if)) end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(jcs,kcs,if)) do k = kcs, kce do j = jcs, jce max_pert = MAX(max_pert,ABS(divuExt(j,k,if))) end do end do else if (face .eq. YHI) then jf = jfe max_divu = divu(ics,jcs+1,kcs) min_divu = max_divu do k = kcs, kce do i = ics, ice uExt(i,k,jf,1) = half*(three*u(i,jcs+1,k,1) - u(i,jcs,k,1)) uExt(i,k,jf,2) = half*(three*u(i,jcs+1,k,3) - u(i,jcs,k,3)) divuExt(i,k,jf) = half*(three*divu(i,jcs+1,k) - divu(i,jcs,k)) rhoExt(i,k,jf) = half*(three*rho(i,jcs+1,k) - rho(i,jcs,k)) max_divu = max(max_divu,divuExt(i,k,jf)) min_divu = min(min_divu,divuExt(i,k,jf)) end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,kcs,jf)) do k = kcs, kce do i = ics, ice max_pert = MAX(max_pert,ABS(divuExt(i,k,jf))) end do end do else if (face .eq. ZHI) then kf = kfe max_divu = divu(ics,jcs,kcs+1) min_divu = max_divu do j = jcs, jce do i = ics, ice uExt(i,j,kf,1) = half*(three*u(i,j,kcs+1,1) - u(i,j,kcs,1)) uExt(i,j,kf,2) = half*(three*u(i,j,kcs+1,2) - u(i,j,kcs,2)) divuExt(i,j,kf) = half*(three*divu(i,j,kcs+1) - divu(i,j,kcs)) rhoExt(i,j,kf) = half*(three*rho(i,j,kcs+1) - rho(i,j,kcs)) max_divu = max(max_divu,divuExt(i,j,kf)) min_divu = min(min_divu,divuExt(i,j,kf)) end do end do call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave1,face) call subtractavg(DIMS(divuExt),divuExt,lo,hi,divu_ave2,face) max_pert = ABS(divuExt(ics,jcs,kf)) do j = jcs, jce do i = ics, ice max_pert = MAX(max_pert,ABS(divuExt(i,j,kf))) end do end do endif c check to see if we should zero phi max_pert = max_pert/(ABS(divu_ave1+divu_ave2)+small_pert) if ((max_divu.eq.zero.and.min_divu.eq.zero) & .or.(max_pert.le.small_pert)) then zeroIt = 1 end if #undef XLO #undef YLO #undef ZLO #undef XHI #undef YHI #undef ZHI end subroutine FORT_COMPUTE_COEFF(DIMS(rhs),rhs,DIMS(beta),beta, & DIMS(uExt),uExt,DIMS(divuExt),divuExt, & DIMS(rhoExt),rhoExt, & lo,hi,h,isPeriodic) implicit none integer DIMDEC(rhs) integer DIMDEC(beta) integer DIMDEC(uExt) integer DIMDEC(divuExt) integer DIMDEC(rhoExt) integer lo(SDIM),hi(SDIM) REAL_T uExt(DIM12(uExt),SDIM-1) REAL_T divuExt(DIM12(divuExt)) REAL_T rhoExt(DIM12(rhoExt)) REAL_T beta(DIM12(beta)) REAL_T rhs(DIM12(rhs)) REAL_T h(SDIM) integer isPeriodic(SDIM) integer ics,ice,jcs,jce integer ins,ine,jns,jne integer i,j REAL_T hxm1,hym1 ics = lo(1) ice = hi(1) jcs = lo(2) jce = hi(2) ins = ics jns = jcs ine = ice+1 jne = jce+1 hxm1 = one/h(1) hym1 = one/h(2) do j=jcs,jce do i=ics,ice beta(i,j) = one/rhoExt(i,j) enddo enddo do j=jns+1,jne-1 do i=ins+1,ine-1 rhs(i,j) = half* @ (hxm1 * (uExt(i,j-1,1) - uExt(i-1,j-1,1) + @ uExt(i,j ,1) - uExt(i-1,j ,1)) + @ hym1 * (uExt(i-1,j,2) - uExt(i-1,j-1,2) + @ uExt(i ,j,2) - uExt(i,j-1 ,2))) & - fourth * ( divuExt(i-1,j ) + divuExt(i-1,j-1) + & divuExt(i ,j-1) + divuExt(i ,j ) ) enddo enddo if (isPeriodic(1) .eq. 1) then do j=jcs,jce beta(ics-1,j) = beta(ice,j) beta(ice+1,j) = beta(ics,j) enddo do j = jns+1,jne-1 rhs(ins,j) = half* @ (hxm1 * (uExt(ics,j-1,1) - uExt(ice,j-1,1) + @ uExt(ics,j ,1) - uExt(ice,j,1 )) + @ hym1 * (uExt(ice,j ,2) - uExt(ice,j-1,2) + @ uExt(ics,j ,2) - uExt(ics,j-1,2))) & - fourth * ( divuExt(ice,j ) + divuExt(ice,j-1) + & divuExt(ics,j-1) + divuExt(ics ,j ) ) rhs(ine,j) = rhs(ins,j) enddo else do j=jcs,jce beta(ics-1,j) = zero beta(ice+1,j) = zero enddo do j = jns+1,jne-1 i = ins rhs(i,j) = half* @ (hxm1 * (uExt(i,j-1,1) + uExt(i,j ,1) ) + @ hym1 * (uExt(i ,j,2) - uExt(i,j-1,2))) & - fourth * (divuExt(i,j-1) + divuExt(i,j) ) i = ine rhs(i,j) = half* @ (hxm1 * (- uExt(i-1,j-1,1) - uExt(i-1,j ,1)) + @ hym1 * ( uExt(i-1,j ,2) - uExt(i-1,j-1,2))) & - fourth * ( divuExt(i-1,j ) + divuExt(i-1,j-1) ) enddo endif if (isPeriodic(2) .eq. 1) then do i=ics,ice beta(i,jcs-1) = beta(i,jce) beta(i,jce+1) = beta(i,jcs) enddo do i = ins+1,ine-1 rhs(i,jns) = half* @ (hxm1 * (uExt(i ,jce,1) - uExt(i-1,jce,1) + @ uExt(i ,jcs,1) - uExt(i-1,jcs,1))+ @ hym1 * (uExt(i-1,jcs,2) - uExt(i-1,jce,2) + @ uExt(i ,jcs,2) - uExt(i ,jce,2))) & - fourth * ( divuExt(i-1,jcs) + divuExt(i-1,jce) + & divuExt(i ,jce) + divuExt(i ,jcs) ) rhs(i,jne) = rhs(i,jns) enddo else do i=ics,ice beta(i,jcs-1) = zero beta(i,jce+1) = zero enddo do i = ins+1,ine-1 j = jns rhs(i,j) = half* @ (hxm1 * (uExt(i,j ,1) - uExt(i-1,j ,1)) + @ hym1 * (uExt(i-1,j,2) + uExt(i ,j,2) )) & - fourth * ( divuExt(i-1,j) + divuExt(i,j) ) j = jne rhs(i,j) = half* @ (hxm1 * ( uExt(i ,j-1,1) - uExt(i-1,j-1,1)) + @ hym1 * (-uExt(i-1,j-1,2) - uExt(i ,j-1,2))) & - fourth * ( divuExt(i-1,j-1) + divuExt(i ,j-1)) enddo endif if (isPeriodic(1) .eq. 1 .AND. isPeriodic(2) .eq. 1) then beta(ics-1,jcs-1) = beta(ice,jce) beta(ics-1,jce+1) = beta(ice,jcs) beta(ice+1,jcs-1) = beta(ics,jce) beta(ice+1,jce+1) = beta(ics,jcs) rhs(ins,jns) = half* @ (hxm1 * (uExt(ics,jce,1) - uExt(ice,jce,1) + @ uExt(ics,jcs,1) - uExt(ice,jcs,1)) + @ hym1 * (uExt(ice,jcs,2) - uExt(ice,jce,2) + @ uExt(ics,jcs,2) - uExt(ics,jce,2))) & - fourth * (divuExt(ice,jcs) + divuExt(ice,jce) + & divuExt(ics,jce) + divuExt(ics,jcs) ) rhs(ins,jne) = rhs(ins,jns) rhs(ine,jns) = rhs(ins,jns) rhs(ine,jne) = rhs(ins,jns) else if (isPeriodic(1) .eq. 1 .AND. isPeriodic(2) .NE. 1) then beta(ics-1,jcs-1) = beta(ice,jcs-1) beta(ics-1,jce+1) = beta(ice,jce+1) beta(ice+1,jcs-1) = beta(ics,jcs-1) beta(ice+1,jce+1) = beta(ics,jce+1) rhs(ins,jns) = half* @ (hxm1 * (uExt(ics,jcs,1) - uExt(ice,jcs,1 )) + @ hym1 * (uExt(ice,jcs,2) + uExt(ics,jcs,2) )) & - fourth * ( divuExt(ice,jcs) + divuExt(ics,jcs) ) rhs(ins,jne) = half* @ (hxm1 * ( uExt(ics,jce,1) - uExt(ice,jce,1) ) + @ hym1 * (- uExt(ice,jce,2) - uExt(ics,jce,2))) & - fourth * ( divuExt(ice,jce) + divuExt(ics,jce)) rhs(ine,jns) = rhs(ins,jns) rhs(ine,jne) = rhs(ins,jne) else if (isPeriodic(1) .NE. 1 .AND. isPeriodic(2) .eq. 1) then beta(ics-1,jcs-1) = beta(ics-1,jce) beta(ics-1,jce+1) = beta(ics-1,jcs) beta(ice+1,jcs-1) = beta(ice+1,jce) beta(ice+1,jce+1) = beta(ice+1,jcs) rhs(ins,jns) = half* @ (hxm1 * (uExt(ics,jce,1) + uExt(ics,jcs,1))+ @ hym1 * (uExt(ics,jcs,2) - uExt(ics,jce,2))) & - fourth * ( divuExt(ics,jce) + divuExt(ics,jcs) ) rhs(ine,jns) = half* @ (hxm1 * (uExt(ice,jce,1) - uExt(ice,jcs,1))+ @ hym1 * (uExt(ice,jcs,2) - uExt(ice,jce,2))) & - fourth * ( divuExt(ice,jcs) + divuExt(ice,jce)) rhs(ins,jne) = rhs(ins,jns) rhs(ine,jne) = rhs(ine,jns) else beta(ics-1,jcs-1) = zero beta(ics-1,jce+1) = zero beta(ice+1,jcs-1) = zero beta(ice+1,jce+1) = zero i = ins j = jns rhs(i,j) = half* (hxm1 * (uExt(i,j,1) ) + hym1 * (uExt(i,j,2) )) & - fourth * ( divuExt(i,j) ) i = ine j = jns rhs(i,j) = half* (hxm1 * (-uExt(i-1,j,1))+ hym1 * (uExt(i-1,j,2))) & - fourth * ( divuExt(i-1,j)) i = ins j = jne rhs(i,j) = half* (hxm1 * (uExt(i,j-1,1) ) + hym1 * (-uExt(i,j-1,2))) & - fourth * (divuExt(i ,j-1)) i = ine j = jne rhs(i,j) = half*(hxm1 *(-uExt(i-1,j-1,1)) + hym1 *(-uExt(i-1,j-1,2))) & - fourth * ( divuExt(i-1,j-1)) endif c double rhs at edges if (isPeriodic(1) .ne. 1) then do j=jns,jne rhs(ins,j) = rhs(ins,j) * two rhs(ine,j) = rhs(ine,j) * two enddo endif if (isPeriodic(2) .ne. 1) then do i = ins,ine rhs(i,jns) = rhs(i,jns) * two rhs(i,jne) = rhs(i,jne) * two enddo endif end #define DGXY_5PT half * (hxsqinv * \ ((beta(i-1,j-1) + beta(i-1,j)) * (phi(i-1,j) - phi(i,j)) + \ (beta(i ,j-1) + beta(i ,j)) * (phi(i+1,j) - phi(i,j))) + \ hysqinv * \ ((beta(i-1,j-1) + beta(i,j-1)) *(phi(i,j-1) - phi(i,j)) + \ (beta(i-1,j ) + beta(i,j )) *(phi(i,j+1) - phi(i,j)))) subroutine FORT_HGRELAX(DIMS(rhs),rhs,DIMS(beta),beta,DIMS(phi),phi, & DIMS(dgphi),dgphi,lo,hi,h,isPeriodic,niter) implicit none integer DIMDEC(beta) integer DIMDEC(rhs) integer DIMDEC(phi) integer DIMDEC(dgphi) REAL_T beta(DIM12(beta)) REAL_T rhs(DIM12(rhs)) REAL_T phi(DIM12(phi)) REAL_T dgphi(DIM12(dgphi)) integer isPeriodic(SDIM) REAL_T h(SDIM) integer lo(SDIM),hi(SDIM) integer niter logical setSingularPoint REAL_T lam integer i,j integer redblack,iter integer ins,ine,jns,jne REAL_T hxsqinv, hysqinv integer iinc ins = lo(1) ine = hi(1)+1 jns = lo(2) jne = hi(2)+1 hxsqinv = one/(h(1)*h(1)) hysqinv = one/(h(2)*h(2)) if (h(2). gt. 1.5D0*h(1)) then call bl_abort("line solve for proj_bc not yet implemented") elseif (h(1) .gt. 1.5D0*h(2)) then call bl_abort("line solve for proj_bc not yet implemented") endif setSingularPoint = .false. do iter = 1,niter call setprojbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) do redblack = 0,1 do j=jns,jne iinc = mod(j+redblack,2) do i=ins+iinc,ine,2 dgphi(i,j) = DGXY_5PT lam = (hxsqinv +hysqinv) * (beta(i-1,j-1) + beta(i-1,j) + @ beta(i ,j-1) + beta(i ,j)) c double dgphi at edges if ((i .eq. lo(1) .or. i .eq. hi(1)+1) & .and. isPeriodic(1) .ne. 1) then dgphi(i,j) = dgphi(i,j)*two lam = lam* two endif if ((j .eq. lo(2) .or. j .eq. hi(2)+1) & .and. isPeriodic(2) .ne. 1) then dgphi(i,j) = dgphi(i,j)*two lam = lam*two endif lam = -two/lam phi(i,j) = phi(i,j) + lam*(rhs(i,j)-dgphi(i,j)) enddo enddo end do end do call setprojbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) end subroutine FORT_HGSUBTRACTAVGPHI(DIMS(phi),phi,lo,hi,isPeriodic) implicit none integer DIMDEC(phi) REAL_T phi(DIM12(phi)) integer lo(SDIM),hi(SDIM) integer isPeriodic(SDIM) REAL_T phitot,vtot integer ins,ine,jns,jne integer i,j logical setSingularPoint phitot = zero vtot = zero ins = lo(1) ine = hi(1)+1 jns = lo(2) jne = hi(2)+1 setSingularPoint = .false. do j = jns,jne do i = ins,ine phitot = phitot + phi(i,j) vtot = vtot + one enddo enddo phitot = phitot/vtot do j = jns,jne do i = ins,ine phi(i,j) = phi(i,j) - phitot enddo enddo call setprojbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) end subroutine FORT_HGRESID(DIMS(rhs),rhs,DIMS(beta),beta,DIMS(phi),phi, & DIMS(resid),resid,DIMS(dgphi),dgphi, & lo,hi,h,isPeriodic,maxnorm) integer DIMDEC(beta) integer DIMDEC(rhs) integer DIMDEC(phi) integer DIMDEC(resid) integer DIMDEC(dgphi) REAL_T beta(DIM12(beta)) REAL_T rhs(DIM12(rhs)) REAL_T phi(DIM12(phi)) REAL_T resid(DIM12(resid)) REAL_T dgphi(DIM12(dgphi)) integer isPeriodic(SDIM) REAL_T h(SDIM) integer lo(SDIM),hi(SDIM) REAL_T hxsqinv,hysqinv integer i,j REAL_T maxnorm logical setSingularPoint hxsqinv = one/(h(1)*h(1)) hysqinv = one/(h(2)*h(2)) setSingularPoint = .false. maxnorm = zero call makeprojdgphi(phi,DIMS(phi),dgphi,DIMS(dgphi),beta,DIMS(beta), & lo,hi,h,isPeriodic,setSingularPoint) do j=lo(2),hi(2)+1 do i=lo(1),hi(1)+1 resid(i,j) = rhs(i,j)-dgphi(i,j) maxnorm = max(maxnorm,ABS(resid(i,j))) enddo enddo end subroutine setprojbc(DIMS(phi),phi,lo,hi,isPeriodic,setSingularPoint) implicit none integer DIMDEC(phi) REAL_T phi(DIM12(phi)) integer isPeriodic(SDIM) logical setSingularPoint integer lo(SDIM),hi(SDIM) integer ins,ine,jns,jne integer i,j ins = lo(1) ine = hi(1)+1 jns = lo(2) jne = hi(2)+1 if (isPeriodic(1) .NE. 1 .AND. isPeriodic(2) .NE. 1 & .AND. setSingularPoint) then phi(ine,jne) = zero endif if (isPeriodic(1) .eq. 1) then do j= jns,jne phi(ins-1,j) = phi(ine-1,j) phi(ine,j) = phi(ins,j) phi(ine+1,j) = phi(ins+1,j) enddo else do j= jns,jne phi(ins-1,j) = phi(ins+1,j) phi(ine+1,j) = phi(ine-1,j) enddo endif if (isPeriodic(2) .eq. 1) then do i= ins,ine phi(i,jns-1) = phi(i,jne-1) phi(i,jne) = phi(i,jns) phi(i,jne+1) = phi(i,jns+1) enddo else do i= ins,ine phi(i,jns-1) = phi(i,jns+1) phi(i,jne+1) = phi(i,jne-1) enddo endif end subroutine FORT_HG_SHIFT_PHI(DIMS(out),out,DIMS(in),in,face) implicit none integer face integer DIMDEC(in) integer DIMDEC(out) REAL_T in(DIMV(in)) REAL_T out(DIMV(out)) integer i,j,k #define XLO 0 #define YLO 1 #define ZLO 2 #define XHI 3 #define YHI 4 #define ZHI 5 if (face .eq. XLO .or. face .eq. XHI) then do k = ARG_L3(out), ARG_H3(out) do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j,k) = in(k,i,j) enddo enddo enddo else if (face .eq. YLO .or. face .eq. YHI) then do k = ARG_L3(out), ARG_H3(out) do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j,k) = in(i,k,j) enddo enddo enddo else if (face .eq. ZLO .or. face .eq. ZHI) then do k = ARG_L3(out), ARG_H3(out) do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j,k) = in(i,j,k) enddo enddo enddo endif #undef XLO #undef YLO #undef ZLO #undef XHI #undef YHI #undef ZHI end subroutine FORT_HG_RESHIFT_PHI(DIMS(out),out,DIMS(in),in,face) implicit none integer face integer DIMDEC(in) integer DIMDEC(out) REAL_T in(DIMV(in)) REAL_T out(DIMV(out)) integer i,j,k #define XLO 0 #define YLO 1 #define ZLO 2 #define XHI 3 #define YHI 4 #define ZHI 5 if (face .eq. XLO .or. face .eq. XHI) then do k = ARG_L3(out), ARG_H3(out) do j= ARG_L2(out),ARG_H2(out) out(ARG_L1(out),j,k) = in(j,k,ARG_L3(in)) enddo enddo else if (face .eq. YLO .or. face .eq. YHI) then do k = ARG_L3(out), ARG_H3(out) do i = ARG_L1(out),ARG_H1(out) out(i,ARG_L2(out),k) = in(i,k,ARG_L3(in)) enddo enddo else if (face .eq. ZLO .or. face .eq. ZHI) then do j= ARG_L2(out),ARG_H2(out) do i = ARG_L1(out),ARG_H1(out) out(i,j,ARG_L3(out)) = in(i,j,ARG_L3(in)) enddo enddo endif #undef XLO #undef YLO #undef ZLO #undef XHI #undef YHI #undef ZHI end subroutine FORT_SOLVEHG(p,DIMS(p),dest0,DIMS(dest0), & source,DIMS(source),sigma,DIMS(sigma), & cen,DIMS(cen),r,DIMS(r),w,DIMS(w), & z,DIMS(z),x,DIMS(x), $ lo,hi,h,isPeriodic,maxiter,tol,abs_tol,max_jump,norm) implicit none integer lo(SDIM),hi(SDIM) integer DIMDEC(p) integer DIMDEC(dest0) integer DIMDEC(source) integer DIMDEC(sigma) integer DIMDEC(r) integer DIMDEC(w) integer DIMDEC(z) integer DIMDEC(x) integer DIMDEC(cen) REAL_T p(DIM12(p)) REAL_T dest0(DIM12(dest0)) REAL_T source(DIM12(source)) REAL_T sigma(DIM12(sigma)) REAL_T r(DIM12(r)) REAL_T w(DIM12(w)) REAL_T z(DIM12(z)) REAL_T x(DIM12(x)) REAL_T cen(DIM12(cen)) REAL_T h(SDIM) integer isPeriodic(SDIM) integer maxiter REAL_T norm REAL_T tol REAL_T abs_tol,max_jump c Local variables REAL_T factor REAL_T alpha,beta, rho, rho_old logical testx,testy integer i,j,iter integer istart,iend,jstart,jend REAL_T norm0,goal logical setSingularPoint istart = lo(1) iend = hi(1)+1 jstart = lo(2) jend = hi(2)+1 setSingularPoint = .false. do j = lo(2)-1,hi(2)+2 do i = lo(1)-1,hi(1)+2 dest0(i,j) = p(i,j) p(i,j) = zero enddo enddo do j=ARG_L2(w),ARG_H2(w) do i=ARG_L1(w),ARG_H1(w) w(i,j) = zero enddo enddo call setprojbc(DIMS(dest0),dest0,lo,hi,isPeriodic,setSingularPoint) call makeprojdgphi(dest0,DIMS(dest0),w,DIMS(w),sigma,DIMS(sigma), & lo,hi,h,isPeriodic,setSingularPoint) do j = jstart, jend do i = istart, iend r(i,j) = source(i,j) - w(i,j) enddo enddo c note that all of this factor stuff is due to the problem being doubled c at edges -- both the rhs and the operator. rho = zero norm0 = zero do j = jstart, jend do i = istart, iend factor = one testx = (i .eq. lo(1) .or. i .eq. hi(1)+1) testy = (j .eq. lo(2) .or. j .eq. hi(2)+1) factor = cvmgt(factor*half,factor,testx) factor = cvmgt(factor*half,factor,testy) z(i,j) = r(i,j) rho = rho + factor * z(i,j) * r(i,j) norm0 = max(norm0,abs(r(i,j))) enddo enddo norm = norm0 goal = max(tol * norm0,abs_tol) if (norm0 .le. goal) then do j = jstart, jend do i = istart, iend p(i,j) = dest0(i,j) enddo enddo return endif do j = jstart, jend do i = istart, iend x(i,j) = zero p(i,j) = z(i,j) enddo enddo iter = 0 100 continue do j=ARG_L2(w),ARG_H2(w) do i=ARG_L1(w),ARG_H1(w) w(i,j) = zero enddo enddo call setprojbc(DIMS(p),p,lo,hi,isPeriodic,setSingularPoint) call makeprojdgphi(p,DIMS(p),w,DIMS(w),sigma,DIMS(sigma), & lo,hi,h,isPeriodic,setSingularPoint) alpha = zero do j = jstart, jend do i = istart, iend factor = one testx = (i .eq. lo(1) .or. i .eq. hi(1)+1) testy = (j .eq. lo(2) .or. j .eq. hi(2)+1) factor = cvmgt(factor*half,factor,testx) factor = cvmgt(factor*half,factor,testy) alpha = alpha + factor*p(i,j)*w(i,j) enddo enddo if (alpha .ne. zero) then alpha = rho / alpha else print *, "divide by zero" goto 101 endif rho_old = rho rho = zero norm = zero do j = jstart, jend do i = istart, iend factor = one testx = (i .eq. lo(1) .or. i .eq. hi(1)+1) testy = (j .eq. lo(2) .or. j .eq. hi(2)+1) factor = cvmgt(factor*half,factor,testx) factor = cvmgt(factor*half,factor,testy) x(i,j) = x(i,j) + alpha * p(i,j) r(i,j) = r(i,j) - alpha * w(i,j) z(i,j) = r(i,j) rho = rho + factor * z(i,j) * r(i,j) norm = max(norm,abs(r(i,j))) enddo enddo iter = iter+1 c write(6,*) iter,norm if (iter .gt. maxiter .or. norm .gt. max_jump*norm0) then goto 101 else if (norm .lt. goal) then do j = jstart, jend do i = istart, iend p(i,j) = x(i,j) + dest0(i,j) enddo enddo return else beta = rho / rho_old do j = jstart, jend do i = istart, iend p(i,j) = z(i,j) + beta * p(i,j) enddo enddo goto 100 endif 101 print *, "cg solve in proj failed to coverge" do j = jstart, jend do i = istart, iend p(i,j) = dest0(i,j) enddo enddo return end subroutine makeprojdgphi(phi,DIMS(phi),dgphi,DIMS(dgphi), & beta,DIMS(beta), & lo,hi,h,isPeriodic,setSingularPoint) implicit none integer lo(SDIM),hi(SDIM) integer DIMDEC(phi) integer DIMDEC(dgphi) integer DIMDEC(beta) REAL_T phi(DIM12(phi)) REAL_T dgphi(DIM12(dgphi)) REAL_T beta(DIM12(beta)) integer isPeriodic(SDIM) REAL_T h(SDIM) logical setSingularPoint c Local variables REAL_T hxsqinv, hysqinv integer is,ie,js,je integer i,j is = lo(1) js = lo(2) ie = hi(1) je = hi(2) hxsqinv = one/(h(1)*h(1)) hysqinv = one/(h(2)*h(2)) if (isPeriodic(1) .eq. 1) then do j = js,je+1 phi(ie+2,j) = phi(is+1,j) phi(is-1,j) = phi(ie ,j) enddo endif if (isPeriodic(2) .eq. 1) then do i = is,ie+1 phi(i,je+2) = phi(i,js+1) phi(i,js-1) = phi(i,je ) enddo endif if (isPeriodic(1) .eq. 1 .and. isPeriodic(2) .eq. 1) then phi(is-1,js-1) = phi(ie ,je ) phi(is-1,je+2) = phi(ie ,js+1) phi(ie+2,js-1) = phi(is+1,je ) phi(ie+2,je+2) = phi(is+1,js+1) endif do j = js,je+1 do i = is,ie+1 dgphi(i,j) = DGXY_5PT enddo enddo c double dgphi at edges if (isPeriodic(1) .ne. 1) then do j=js,je+1 dgphi(is,j) = dgphi(is,j) * two dgphi(ie+1,j) = dgphi(ie+1,j) * two enddo endif if (isPeriodic(2) .ne. 1) then do i = is,ie+1 dgphi(i,js) = dgphi(i,js) * two dgphi(i,je+1) = dgphi(i,je+1) * two enddo endif if (setSingularPoint .and. & isPeriodic(1) .NE. 1 .and. isPeriodic(2) .NE. 1) then dgphi(hi(1)+1,hi(2)+1) = zero endif return end c ************************************************************************* c ** COARSIG ** c ** Coarsening of the sig coefficients c ************************************************************************* subroutine FORT_COARSIG(sigma,DIMS(sigma),sigmac,DIMS(sigmac), & lo,hi,loc,hic,isPeriodic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(sigma) integer DIMDEC(sigmac) REAL_T sigma(DIM12(sigma)) REAL_T sigmac(DIM12(sigmac)) integer isPeriodic(SDIM) c Local variables integer i ,j integer i2,j2 do j = loc(2),hic(2) do i = loc(1),hic(1) i2 = 2*(i-loc(1))+lo(1) j2 = 2*(j-loc(2))+lo(2) sigmac(i,j) = (sigma(i2 ,j2) + sigma(i2 ,j2+1)+ $ sigma(i2+1,j2) + sigma(i2+1,j2+1))*fourth enddo enddo if (isPeriodic(1) .eq. 1) then do j = loc(2)-1,hic(2)+1 sigmac(loc(1)-1,j) = sigmac(hic(1),j) sigmac(hic(1)+1,j) = sigmac(loc(1),j) enddo else do j = loc(2)-1,hic(2)+1 sigmac(loc(1)-1,j) = zero sigmac(hic(1)+1,j) = zero enddo endif if (isPeriodic(2) .eq. 1) then do i = loc(1)-1,hic(1)+1 sigmac(i,loc(2)-1) = sigmac(i,hic(2)) sigmac(i,hic(2)+1) = sigmac(i,loc(2)) enddo else do i = loc(1)-1,hic(1)+1 sigmac(i,loc(2)-1) = zero sigmac(i,hic(2)+1) = zero enddo endif return end c ************************************************************************* c ** RESTRICT ** c ** Conservative restriction of the residual c ************************************************************************* subroutine FORT_RESTRICT(res,DIMS(res),resc,DIMS(resc), & lo,hi,loc,hic,isPeriodic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(res) integer DIMDEC(resc) REAL_T res(DIM12(res)) REAL_T resc(DIM12(resc)) integer isPeriodic(SDIM) c Local variables integer i,j,ii,jj integer istart,iend integer jstart,jend istart = loc(1) iend = hic(1)+1 jstart = loc(2) jend = hic(2)+1 if (isPeriodic(1) .eq. 1) then do j = lo(2)-1,hi(2)+2 res(hi(1)+1,j) = res(lo(1) ,j) res(hi(1)+2,j) = res(lo(1)+1,j) res(lo(1)-1,j) = res(hi(1) ,j) enddo endif if (isPeriodic(2) .eq. 1) then do i = lo(1)-1,hi(1)+2 res(i,hi(2)+1) = res(i,lo(2) ) res(i,hi(2)+2) = res(i,lo(2)+1) res(i,lo(2)-1) = res(i,hi(2) ) enddo endif do j = jstart,jend do i = istart,iend ii = 2*(i-loc(1))+lo(1) jj = 2*(j-loc(2))+lo(2) resc(i,j) = fourth*res(ii ,jj) + $ eighth*(res(ii+1,jj ) + res(ii-1,jj ) + $ res(ii ,jj+1) + res(ii ,jj-1) ) + $ sixteenth*(res(ii+1,jj+1) + res(ii+1,jj-1) + $ res(ii-1,jj+1) + res(ii-1,jj-1) ) enddo enddo c the top version is what we use when we double the problem at edges c the bottom version (commented out) is what we would use if we did not c double the problem at edges. if (isPeriodic(1) .NE. 1) then i = loc(1) ii = 2*(i-loc(1))+lo(1) do j = jstart,jend jj = 2*(j-loc(2))+lo(2) resc(i,j) = fourth*(res(ii,jj ) + res(ii+1,jj )) + $ eighth*(res(ii,jj-1) + res(ii+1,jj-1)+ $ res(ii,jj+1) + res(ii+1,jj+1) ) cnd resc(i,j) = fourth*res(ii ,jj) + cnd $ eighth*(res(ii+1,jj ) + cnd $ res(ii ,jj+1) + res(ii ,jj-1) ) + cnd $ sixteenth*(res(ii+1,jj+1) + res(ii+1,jj-1)) enddo i = hic(1)+1 ii = 2*(i-loc(1))+lo(1) do j = jstart,jend jj = 2*(j-loc(2))+lo(2) resc(i,j) = fourth*(res(ii,jj ) + res(ii-1,jj )) + $ eighth*(res(ii,jj-1) + res(ii-1,jj-1)+ $ res(ii,jj+1) + res(ii-1,jj+1) ) cnd resc(i,j) = fourth*res(ii ,jj) + cnd $ eighth*(res(ii-1,jj ) + cnd $ res(ii ,jj+1) + res(ii ,jj-1) ) + cnd $ sixteenth*(res(ii-1,jj+1) + res(ii-1,jj-1) ) enddo endif if (isPeriodic(2) .NE. 1) then j = loc(2) jj = 2*(j-loc(2))+lo(2) do i = istart,iend ii = 2*(i-loc(1))+lo(1) resc(i,j) = fourth*(res(ii ,jj) + res(ii ,jj+1)) + $ eighth*(res(ii+1,jj) + res(ii+1,jj+1)+ $ res(ii-1,jj) + res(ii-1,jj+1) ) cnd resc(i,j) = fourth*res(ii ,jj) + cnd $ eighth*(res(ii+1,jj ) + res(ii-1,jj ) + cnd $ res(ii ,jj+1)) + cnd $ sixteenth*(res(ii+1,jj+1) + res(ii-1,jj+1)) enddo j = hic(2)+1 jj = 2*(j-loc(2))+lo(2) do i = istart,iend ii = 2*(i-loc(1))+lo(1) resc(i,j) = fourth*(res(ii ,jj) + res(ii ,jj-1)) + $ eighth*(res(ii+1,jj) + res(ii+1,jj-1)+ $ res(ii-1,jj) + res(ii-1,jj-1) ) cnd resc(i,j) = fourth*res(ii ,jj) + cnd $ eighth*(res(ii+1,jj ) + res(ii-1,jj ) + cnd $ res(ii ,jj-1) ) + cnd $ sixteenth*(res(ii+1,jj-1) + res(ii-1,jj-1) ) enddo endif if ( isPeriodic(1) .NE. 1 .and. isPeriodic(2) .NE. 1 ) then i = loc(1) j = loc(2) ii = 2*(i-loc(1))+lo(1) jj = 2*(j-loc(2))+lo(2) resc(i,j) = fourth*(res(ii,jj ) + res(ii+1,jj ) + $ res(ii,jj+1) + res(ii+1,jj+1) ) cnd resc(i,j) = fourth*res(ii ,jj) + cnd $ eighth*(res(ii+1,jj ) + res(ii ,jj+1)) + cnd $ sixteenth*(res(ii+1,jj+1)) i = hic(1)+1 j = hic(2)+1 ii = 2*(i-loc(1))+lo(1) jj = 2*(j-loc(2))+lo(2) resc(i,j) = fourth*(res(ii,jj ) + res(ii-1,jj ) + $ res(ii,jj-1) + res(ii-1,jj-1) ) cnd resc(i,j) = fourth*res(ii ,jj) + cnd $ eighth*(res(ii-1,jj ) + res(ii ,jj-1) ) + cnd $ sixteenth*(res(ii-1,jj-1) ) i = loc(1) j = hic(2)+1 ii = 2*(i-loc(1))+lo(1) jj = 2*(j-loc(2))+lo(2) resc(i,j) = fourth*(res(ii,jj ) + res(ii+1,jj ) + $ res(ii,jj-1) + res(ii+1,jj-1) ) cnd resc(i,j) = fourth*res(ii ,jj) + cnd $ eighth*(res(ii+1,jj ) + res(ii ,jj-1) ) + cnd $ sixteenth*(res(ii+1,jj-1) ) i = hic(1)+1 j = loc(2) ii = 2*(i-loc(1))+lo(1) jj = 2*(j-loc(2))+lo(2) resc(i,j) = fourth*(res(ii,jj ) + res(ii-1,jj ) + $ res(ii,jj+1) + res(ii-1,jj+1) ) cnd resc(i,j) = fourth*res(ii ,jj) + cnd $ eighth*(res(ii-1,jj ) + res(ii ,jj+1)) + cnd $ sixteenth*(res(ii-1,jj+1)) endif return end c ************************************************************************* c ** INTERP ** c ** Simple bilinear interpolation c ************************************************************************* subroutine FORT_INTERP(phi,DIMS(phi),temp,DIMS(temp),deltac,DIMS(deltac), & sigma,DIMS(sigma),lo,hi,loc,hic,isPeriodic) implicit none integer lo(SDIM),hi(SDIM) integer loc(SDIM),hic(SDIM) integer DIMDEC(phi) integer DIMDEC(deltac) integer DIMDEC(sigma) integer DIMDEC(temp) REAL_T phi(DIM12(phi)) REAL_T deltac(DIM12(deltac)) REAL_T sigma(DIM12(sigma)) REAL_T temp(DIM12(temp)) integer isPeriodic(SDIM) c Local variables integer ii,jj,ic,jc integer is,ie,js,je,isc,iec,jsc,jec logical setSingularPoint is = lo(1) js = lo(2) ie = hi(1) je = hi(2) isc = loc(1) jsc = loc(2) iec = hic(1) jec = hic(2) do jc = jsc, jec+1 do ic = isc, iec+1 ii = 2*(ic-isc)+is jj = 2*(jc-jsc)+js temp(ii,jj) = deltac(ic,jc) enddo enddo do jc = jsc, jec do ic = isc, iec+1 ii = 2*(ic-isc)+is jj = 2*(jc-jsc)+js temp(ii,jj+1) = half*(deltac(ic,jc) + deltac(ic,jc+1)) enddo enddo do jc = jsc, jec+1 do ic = isc, iec ii = 2*(ic-isc)+is jj = 2*(jc-jsc)+js temp(ii+1,jj) = half*(deltac(ic,jc) + deltac(ic+1,jc)) enddo enddo do jc = jsc, jec do ic = isc, iec ii = 2*(ic-isc)+is jj = 2*(jc-jsc)+js temp(ii+1,jj+1) = fourth*(deltac(ic,jc ) + deltac(ic+1,jc ) + $ deltac(ic,jc+1) + deltac(ic+1,jc+1) ) enddo enddo do jj=js,je+1 do ii = is,ie+1 phi(ii,jj) = phi(ii,jj) + temp(ii,jj) enddo enddo return end subroutine FORT_RHOGBC(rho,DIMS(rho),phi,DIMS(phi), & face,gravity,dx) c c Compute the contribution of gravity to the boundary conditions c for phi at outflow faces only. c implicit none integer DIMDEC(rho) integer DIMDEC(phi) integer face REAL_T rho(DIMV(rho)) REAL_T phi(DIMV(phi)) REAL_T dx(3) REAL_T gravity c Local variables integer i,j,k REAL_T rhog REAL_T rho_i,rho_ip1,rho_im1 REAL_T rho_j,rho_jp1,rho_jm1 REAL_T rhoExt #define XLO 0 #define YLO 1 #define ZLO 2 #define XHI 3 #define YHI 4 #define ZHI 5 if (face .eq. ZLO .or. face .eq. ZHI) $ call bl_abort('SHOULDNT BE IN RHOGBC WITH FACE IN Y-DIR') c Ok to only use low index of phi because phi is only one c node wide in direction of face. if (face .eq. XLO) then i = ARG_L1(phi) j = ARG_L2(phi) rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_i = half * (three*rho(i ,j,k) - rho(i ,j+1,k)) rho_ip1 = half * (three*rho(i+1,j,k) - rho(i+1,j+1,k)) rhoExt = half * (three*rho_i - rho_ip1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do j = ARG_H2(phi) rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_i = half * (three*rho(i ,j-1,k) - rho(i ,j-2,k)) rho_ip1 = half * (three*rho(i+1,j-1,k) - rho(i+1,j-2,k)) rhoExt = half * (three*rho_i - rho_ip1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do do j = ARG_L2(phi)+1,ARG_H2(phi)-1 rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_i = half * (rho(i ,j,k) + rho(i ,j-1,k)) rho_ip1 = half * (rho(i+1,j,k) + rho(i+1,j-1,k)) rhoExt = half * (three*rho_i - rho_ip1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do end do else if (face .eq. XHI) then i = ARG_L1(phi) j = ARG_L2(phi) rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_i = half * (three*rho(i-1,j,k) - rho(i-1,j+1,k)) rho_im1 = half * (three*rho(i-2,j,k) - rho(i-2,j+1,k)) rhoExt = half * (three*rho_i - rho_im1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do j = ARG_H2(phi) rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_i = half * (three*rho(i-1,j-1,k) - rho(i-1,j-2,k)) rho_im1 = half * (three*rho(i-2,j-1,k) - rho(i-2,j-2,k)) rhoExt = half * (three*rho_i - rho_im1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do do j = ARG_L2(phi)+1,ARG_H2(phi)-1 rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_i = half * (rho(i-1,j,k) + rho(i-1,j-1,k)) rho_im1 = half * (rho(i-2,j,k) + rho(i-2,j-1,k)) rhoExt = half * (three*rho_i - rho_im1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do end do else if (face .eq. YLO) then j = ARG_L2(phi) i = ARG_L1(phi) rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_j = half * (three*rho(i,j ,k) - rho(i+1,j ,k)) rho_jp1 = half * (three*rho(i,j+1,k) - rho(i+1,j+1,k)) rhoExt = half * (three*rho_j - rho_jp1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do i = ARG_H1(phi) rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_j = half * (three*rho(i-1,j ,k) - rho(i-2,j ,k)) rho_jp1 = half * (three*rho(i-1,j+1,k) - rho(i-2,j+1,k)) rhoExt = half * (three*rho_j - rho_jp1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do do i = ARG_L1(phi)+1,ARG_H1(phi)-1 rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_j = half * (rho(i,j ,k) + rho(i-1,j ,k)) rho_jp1 = half * (rho(i,j+1,k) + rho(i-1,j+1,k)) rhoExt = half * (three*rho_j - rho_jp1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do end do else if (face .eq. YHI) then j = ARG_L2(phi) i = ARG_L1(phi) rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_j = half * (three*rho(i,j-1,k) - rho(i+1,j-1,k)) rho_jm1 = half * (three*rho(i,j-2,k) - rho(i+1,j-2,k)) rhoExt = half * (three*rho_j - rho_jm1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do i = ARG_H1(phi) rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_j = half * (three*rho(i-1,j-1,k) - rho(i-2,j-1,k)) rho_jm1 = half * (three*rho(i-1,j-2,k) - rho(i-2,j-2,k)) rhoExt = half * (three*rho_j - rho_jm1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do do i = ARG_L1(phi)+1,ARG_H1(phi)-1 rhog = zero do k = ARG_H3(phi)-1,ARG_L3(phi),-1 rho_j = half * (rho(i,j-1,k) + rho(i-1,j-1,k)) rho_jm1 = half * (rho(i,j-2,k) + rho(i-1,j-2,k)) rhoExt = half * (three*rho_j - rho_jm1 ) rhog = rhog + gravity * rhoExt * dx(3) phi(i,j,k) = phi(i,j,k) + rhog end do end do endif #undef XLO #undef YLO #undef ZLO #undef XHI #undef YHI #undef ZHI end c ************************************************************************* c ** FILL_TWOD ** c ************************************************************************* subroutine FORT_FILL_TWOD(lenx,leny,lenz,length,width, $ faces,numOutFlowFaces, $ cc0,cc1,cc2,cc3,cc4,cc5,conn) integer lenx,leny,lenz integer length,width integer faces(6) integer numOutFlowFaces REAL_T cc0(leny,lenz,4) REAL_T cc1(lenx,lenz,4) REAL_T cc2(leny,lenz,4) REAL_T cc3(lenx,lenz,4) REAL_T cc4(lenx,leny,4) REAL_T cc5(lenx,leny,4) REAL_T conn(length,width,4) integer xlo_outflow,ylo_outflow,zlo_outflow integer xhi_outflow,yhi_outflow,zhi_outflow integer i,k,ifinal,n #define XLO 0 #define YLO 1 #define ZLO 2 #define XHI 3 #define YHI 4 #define ZHI 5 c Want to find the single non-outflow face. xlo_outflow = 0 ylo_outflow = 0 zlo_outflow = 0 xhi_outflow = 0 yhi_outflow = 0 zhi_outflow = 0 do i = 1, numOutFlowFaces if (faces(i) .eq. XLO) xlo_outflow = 1 if (faces(i) .eq. YLO) ylo_outflow = 1 if (faces(i) .eq. ZLO) zlo_outflow = 1 if (faces(i) .eq. XHI) xhi_outflow = 1 if (faces(i) .eq. YHI) yhi_outflow = 1 if (faces(i) .eq. ZHI) zhi_outflow = 1 enddo c Possible combinations of faces to come in here: c cc0 cc1 cc2 cc3 cc4 cc5 c XLO YLO c XLO YHI c YLO XHI c YLO YHI c XLO YLO XHI c XLO XHI YHI c XLO YLO YHI c YLO XHI YHI c XLO YLO XHI YHI c We must remember here that the cc* arrays have already been c ordered so that the 3nd dimension is one cell wide. ifinal = 0 if (numOutFlowFaces .eq. 4 .or. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 0) ) then do k = 1,lenz do i = 1,leny conn(i,k,1) = cc0(i,k,1) conn(i,k,2) = cc0(i,k,2) conn(i,k,3) = cc0(i,k,3) conn(i,k,4) = cc0(i,k,4) enddo enddo ifinal = leny endif if (yhi_outflow .eq. 1 .and. $ .not. (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do k = 1,lenz do i = 1,lenx conn(ifinal+i,k,1) = cc4(i,k,1) conn(ifinal+i,k,2) = cc4(i,k,2) conn(ifinal+i,k,3) = cc4(i,k,3) conn(ifinal+i,k,4) = cc4(i,k,4) enddo enddo ifinal = ifinal + lenx endif if (xhi_outflow .eq. 1) then do k = 1,lenz do i = 1,leny conn(ifinal+i,k,1) = cc3(leny+1-i,k,1) conn(ifinal+i,k,2) = cc3(leny+1-i,k,2) conn(ifinal+i,k,3) = cc3(leny+1-i,k,3) conn(ifinal+i,k,4) = cc3(leny+1-i,k,4) enddo enddo ifinal = ifinal + leny endif if (ylo_outflow .eq. 1) then do k = 1,lenz do i = 1,lenx conn(ifinal+i,k,1) = cc1(lenx+1-i,k,1) conn(ifinal+i,k,2) = cc1(lenx+1-i,k,2) conn(ifinal+i,k,3) = cc1(lenx+1-i,k,3) conn(ifinal+i,k,4) = cc1(lenx+1-i,k,4) enddo enddo ifinal = ifinal + lenx endif if (numOutFlowFaces .lt. 4 .and. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 1) ) then do k = 1,lenz do i = 1,leny conn(ifinal+i,k,1) = cc0(i,k,1) conn(ifinal+i,k,2) = cc0(i,k,2) conn(ifinal+i,k,3) = cc0(i,k,3) conn(ifinal+i,k,4) = cc0(i,k,4) enddo enddo ifinal = ifinal + leny endif if (yhi_outflow .eq. 1 .and. $ (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do k = 1,lenz do i = 1,lenx conn(ifinal+i,k,1) = cc4(i,k,1) conn(ifinal+i,k,2) = cc4(i,k,2) conn(ifinal+i,k,3) = cc4(i,k,3) conn(ifinal+i,k,4) = cc4(i,k,4) enddo enddo ifinal = ifinal + lenx endif length = ifinal #undef XLO #undef YLO #undef ZLO #undef XHI #undef YHI #undef ZHI end c ************************************************************************* c ** ALLPHI_FROM_X ** c ************************************************************************* subroutine FORT_ALLPHI_FROM_X(lenx,leny,lenz,length,width, $ faces,numOutFlowFaces, $ phi0,phi1,phi2,phi3,phi4,phi5,x,DIMS(x)) integer DIMDEC(x) integer lenx,leny,lenz,length,width integer numOutFlowFaces integer faces(6) REAL_T phi0(0:leny,0:lenz) REAL_T phi1(0:lenx,0:lenz) REAL_T phi2(0:leny,0:lenz) REAL_T phi3(0:lenx,0:lenz) REAL_T phi4(0:lenx,0:leny) REAL_T phi5(0:lenx,0:leny) REAL_T x(DIMV(x)) integer xlo_outflow,ylo_outflow,zlo_outflow integer xhi_outflow,yhi_outflow,zhi_outflow integer i,j,k,ifinal,n #define XLO 0 #define YLO 1 #define ZLO 2 #define XHI 3 #define YHI 4 #define ZHI 5 c Want to find the single non-outflow face. xlo_outflow = 0 ylo_outflow = 0 zlo_outflow = 0 xhi_outflow = 0 yhi_outflow = 0 zhi_outflow = 0 do i = 1, numOutFlowFaces if (faces(i) .eq. XLO) xlo_outflow = 1 if (faces(i) .eq. YLO) ylo_outflow = 1 if (faces(i) .eq. ZLO) zlo_outflow = 1 if (faces(i) .eq. XHI) xhi_outflow = 1 if (faces(i) .eq. YHI) yhi_outflow = 1 if (faces(i) .eq. ZHI) zhi_outflow = 1 enddo c Possible combinations of faces to come in here: c phi0 phi1 phi2 phi3 phi4 phi5 c XLO YLO c XLO YHI c YLO XHI c YLO YHI c XLO YLO XHI c XLO XHI YHI c XLO YLO YHI c YLO XHI YHI c XLO YLO XHI YHI c We know that the faces are ordered: XLO,XHI,YLO,YHI ifinal = 0 if (numOutFlowFaces .eq. 4 .or. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 0) ) then do k = 0,lenz do j = 0,leny phi0(j,k) = x(j,k,ARG_L3(x)) enddo enddo ifinal = leny endif if (yhi_outflow .eq. 1 .and. $ .not. (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do k = 0,lenz do i = 0,lenx phi4(i,k) = x(i+ifinal,k,ARG_L3(x)) enddo enddo ifinal = ifinal+lenx endif if (xhi_outflow .eq. 1) then do k = 0,lenz do j = 0,leny phi3(leny-j,k) = x(ifinal+j,k,ARG_L3(x)) enddo enddo ifinal = ifinal+leny endif if (ylo_outflow .eq. 1) then if (numOutFlowFaces .eq. 4) then do k = 0,lenz do i = 0,lenx-1 phi1(lenx-i,k) = x(ifinal+i,k,ARG_L3(x)) enddo phi1(0,k) = x(0,k,ARG_L3(x)) enddo else do k = 0,lenz do i = 0,lenx phi1(lenx-i,k) = x(ifinal+i,k,ARG_L3(x)) enddo enddo endif ifinal = ifinal+lenx endif if (numOutFlowFaces .lt. 4 .and. $ (xlo_outflow .eq. 1 .and. ylo_outflow .eq. 1) ) then do k = 0,lenz do j = 0,leny phi0(j,k) = x(j+ifinal,k,ARG_L3(x)) enddo enddo ifinal = ifinal+leny endif if (yhi_outflow .eq. 1 .and. $ (numOutFlowFaces .eq. 3 .and. xhi_outflow .eq. 0) ) then do k = 0,lenz do i = 0,lenx phi4(i,k) = x(i+ifinal,k,ARG_L3(x)) enddo enddo ifinal = ifinal+lenx endif #undef XLO #undef YLO #undef ZLO #undef XHI #undef YHI #undef ZHI end ccseapps-2.5/CCSEApps/volpack/0000755000175000017500000000000011634153073017316 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/volpack/vp_global.h0000644000175000017500000010024611634153073021437 0ustar amckinstryamckinstry/* * vp_global.h * * Non-exported global declarations for VolPack. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2002/11/29 18:28:57 $ * $Revision: 1.9 $ */ /******************************************************************* * Include files. * *******************************************************************/ #include "volpack.h" #include #include #include #define rint(x) ((int)(( (x) < 0.0) ? ceil( (x)-0.5) : floor((x)+0.5))) #include #include /* An ANSI string.h and pre-ANSI memory.h might conflict. */ /* #define index strchr */ /* #define rindex strrchr */ #define bcopy(s, d, n) memcpy ((d), (s), (n)) #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) #define bzero(s, n) memset ((s), 0, (n)) #ifdef USE_TIMER /* use the low-resolution interval timer system call to collect timings */ # include # define DECLARE_TIME(t) struct timeval t # define GET_TIME(vpc, t) gettimeofday(&t, 0) # define STORE_TIME(vpc, code, t0, t1) \ vpc->timer_ticks[code] += ((t1).tv_usec < (t0).tv_usec) ? \ (((t1).tv_sec - (t0).tv_sec)*1000000 - ((t0).tv_usec - (t1).tv_usec)):\ (((t1).tv_sec - (t0).tv_sec)*1000000 + ((t1).tv_usec - (t0).tv_usec)); # define DECLARE_HIRES_TIME(t) DECLARE_TIME(t) # define GET_HIRES_TIME(vpc, t) GET_TIME(vpc, t) # define STORE_HIRES_TIME(vpc, code, t0, t1) STORE_TIME(vpc, code, t0, t1) # define COPY_HIRES_TIME(t0, t1) t0 = t1 #else # define DECLARE_TIME(t) # define GET_TIME(vpc, t) # define STORE_TIME(vpc, code, t0, t1) # define DECLARE_HIRES_TIME(t) # define GET_HIRES_TIME(vpc, t) # define STORE_HIRES_TIME(vpc, code, t0, t1) # define COPY_HIRES_TIME(t0, t1) #endif /******************************************************************* * Constants. * *******************************************************************/ /* rendering algorithms */ #define USE_RLEVOLUME 10 /* use classified, run-length encoded volume */ #define USE_RAWVOLUME 11 /* use raw volume (with octree if present) */ /* shading modes */ #define CALLBACK_SHADER 20 #define LOOKUP_SHADER 21 /* surfaces */ #define EXT_SURFACE 0 #define INT_SURFACE 1 /* material property indexes */ #define MATL_AMB_R 0 /* ambient red coefficient */ #define MATL_DIFF_R 1 /* diffuse red coefficient */ #define MATL_SPEC_R 2 /* specular red coefficient */ #define MATL_AMB_G 3 /* ambient green coefficient */ #define MATL_DIFF_G 4 /* diffuse green coefficient */ #define MATL_SPEC_G 5 /* specular green coefficient */ #define MATL_AMB_B 6 /* ambient blue coefficient */ #define MATL_DIFF_B 7 /* diffuse blue coefficient */ #define MATL_SPEC_B 8 /* specular blue coefficient */ #define MATL_SHINY 9 /* specular exponent */ #define NUM_MATL_PROPS 10 /* default material properties */ #define DEFAULT_AMBIENT (0.1*255.0) #define DEFAULT_DIFFUSE (0.4*255.0) #define DEFAULT_SPECULAR (0.5*255.0) #define DEFAULT_SHINYNESS 10.0 /* default depth cueing parameters */ #define DEFAULT_DC_QUANTIZATION (1./255.) /* quantization */ /* size of lookup table for filter kernel used in the 2D warp */ #define WARP_WEIGHT_INDEX_BITS 6 #define WARP_WEIGHT_ENTRIES (1 << WARP_WEIGHT_INDEX_BITS) /* constants for MinMaxOctree and fast classification */ #define VP_MAX_OCTREE_LEVELS 16 /* maximum number of levels in octree; each side of volume can be at most (2^VP_MAX_OCTREE_LEVELS)* base_node_size */ #define MM_K_BIT 4 /* bits in child_octant field of */ #define MM_J_BIT 2 /* MMOctreeLevel */ #define MM_I_BIT 1 #define MM_EMPTY 0 /* node is transparent */ #define MM_FULL 1 /* node is non-transparent */ #define MM_PARTFULL 2 /* node is neither transparent nor opaque and is not a leaf */ #define INDEX_RUN_IS_ZERO 0x7000 /* bit to indicate a run in an index volume is a zero run */ /******************************************************************* * Macros. * *******************************************************************/ /* #define NULL 0 */ #define MAX(a,b) (((a)<(b)) ? (b) : (a)) #define MIN(a,b) (((a)>(b)) ? (b) : (a)) /* Alloc: allocate memory */ #define Alloc(context, ptr, type, size, use) \ { \ (ptr) = (type)malloc((unsigned)(size)); \ if ((ptr) == NULL) \ VPBug("out of memory"); \ if ((context)->log_alloc_func != NULL) \ (context)->log_alloc_func((ptr),(size),(use), \ __LINE__,__FILE__,(context)->client_data); \ } /* Dealloc: free memory */ #define Dealloc(context, ptr) \ { \ if ((context)->log_free_func != NULL) \ (context)->log_free_func(ptr, (context)->client_data); \ free((void *)ptr); \ } /* Debug: print debugging information */ #ifdef DEBUG #define Debug(x) VPDebug x #else #define Debug(x) #endif /* assertions */ #ifndef NDEBUG #define ASSERT(expr) \ if (!(expr)) \ VPBug("assertion failed on line %d of file %s", \ __LINE__, __FILE__) #else #define ASSERT(expr) #endif /* ReportStatus: call a callback to give a progress report */ #define ReportStatus(context, frac) \ if ((context)->status_func != NULL) \ (context)->status_func(frac, (context)->client_data) /* macros for accessing the fields of a voxel */ #define ByteField(voxel, offset) (*((unsigned char *)(voxel) + (offset))) #define ShortField(voxel, offset) \ ( \ (*((unsigned char *) (voxel) + (offset) + 0) << 8) | \ (*((unsigned char *) (voxel) + (offset) + 1) << 0) \ ) #define ShortFieldSet(voxel, offset, value) \ do \ { \ *((unsigned char *) (voxel) + (offset) + 0) = (unsigned char) (((value) & 0xff00) >> 8); \ *((unsigned char *) (voxel) + (offset) + 1) = (unsigned char) (((value) & 0x00ff) >> 0); \ } \ while(0) #define IntField(voxel, offset) \ ( \ (*((unsigned char *) (voxel) + (offset) + 0) << 24) | \ (*((unsigned char *) (voxel) + (offset) + 1) << 16) | \ (*((unsigned char *) (voxel) + (offset) + 2) << 8) | \ (*((unsigned char *) (voxel) + (offset) + 3) << 0) \ ) #define IntFieldSet(voxel, offset, value) \ do \ { \ *((unsigned char *) (voxel) + (offset) + 0) = (unsigned char) (((value) & 0xff000000) >> 24); \ *((unsigned char *) (voxel) + (offset) + 1) = (unsigned char) (((value) & 0x00ff0000) >> 16); \ *((unsigned char *) (voxel) + (offset) + 2) = (unsigned char) (((value) & 0x0000ff00) >> 8); \ *((unsigned char *) (voxel) + (offset) + 3) = (unsigned char) (((value) & 0x000000ff) >> 0); \ } \ while(0) #define VoxelField(voxel, offset, size) \ (((size) == 1) ? ByteField(voxel, offset) : \ ((size) == 2) ? ShortField(voxel, offset) : \ IntField(voxel, offset)) /******************************************************************* * Type definitions. * *******************************************************************/ /* ScanOffset: offsets to beginning of a run-length encoded voxel scanline */ typedef struct { /* ScanOffset */ int first_len; /* byte offset to first run length */ int first_data; /* byte offset to first voxel data */ } ScanOffset; #ifdef INDEX_VOLUME /* VoxelLocation: pointer to the run containing a voxel and the position of the voxel in the run */ typedef struct { /* VoxelLocation */ unsigned char run_count; /* number of voxels in run starting from this voxel (run_count = run_len for first voxel in run, run_count = 1 for last voxel in run) */ unsigned char len_offset; /* offset in bytes from first run length for scanline to run length for voxel */ short data_offset; /* offset in bytes from first voxel data for scanline to data for voxel, or -1 if voxel has no data (zero run) */ } VoxelLocation; #endif /* INDEX_VOLUME */ /* RLEVoxels: a run-length encoding of a classified volume for one of the three principal viewing axes */ typedef struct { /* RLEVoxels */ int ilen, jlen, klen; /* size of each dimension */ int run_count; /* number of runs */ unsigned char *run_lengths; /* length of each run */ int data_count; /* number of entries in data */ void *data; /* data */ int scan_offsets_per_slice; /* number of entries in scan_offsets for each slice of voxel data */ ScanOffset *scan_offsets; /* array of offsets to scanlines */ int mmapped; /* true if pointers point to memory-mapped data */ #ifdef INDEX_VOLUME VoxelLocation *voxel_index; /* index for experimental ERT code */ #endif } RLEVoxels; /* RunData: statistics about the runs in a scanline of voxels */ typedef struct { /* RunData */ short run_length; /* length of current run */ short next_index; /* index of next voxel in current scanline */ union { struct { /* data for pass 1 (ClassifyRawScanline) */ short run_count; /* number of runs in scanline */ short non_zero_count; /* number of nontransparent voxels in scanline */ } p1; struct { /* data for pass 2 (RepackClassifiedVolume)*/ unsigned data_offset; /* byte offset for storage for voxel */ unsigned length_offset; /* byte offset for storage for runlength */ } p2; } p; } RunData; /* GBuffer: growable buffer (a singly-linked list of buffers) */ #define GBUFFER_SIZE 1024 /* number of bytes per list element (to optimize memory performance, size should be small enough so that at least two buffers fit in the cache) */ typedef struct _gbuffer { /* GBuffer */ int bytes_left; /* size of unallocated space */ char *data_ptr; /* pointer to next available byte */ struct _gbuffer *next; /* next buffer in list */ char data[GBUFFER_SIZE]; /* data */ } GBuffer; /* ConstructionBuffer: buffer for storing data while constructing a classified volume */ typedef struct { /* ConstructionBuffer */ RunData *rundata_y; /* statistics for y-axis runs (2D array) index: x*zlen + z */ RunData *rundata_z; /* statistics for z-axis runs (2D array) index: y*xlen + x */ GBuffer *data_buf_head; /* first buffer for storing voxels */ GBuffer *data_buf_tail; /* last buffer in list */ GBuffer *lengths_buf_head; /* first buffer for storing run lengths */ GBuffer *lengths_buf_tail; /* last buffer in list */ int non_zero_count; /* number of nonzero voxels in data bufs */ int x_run_count; /* number of z-axis runs seen so far */ unsigned char octree_runs[VP_MAX_VOLUME_DIM]; /* estimated run lengths from octree */ int octree_scans_left; /* number of scanlines until octree_runs must be recomputed */ int next_z; /* z coordinate of next scanline */ int next_y; /* y coordinate of next scanline */ } ConstructionBuffer; /* MinMaxOctree: min-max octree representation of the volume for fast classification */ typedef struct { /* MinMaxOctree */ int levels; /* number of levels in octree level 0 = root = lowest detail level levels-1 = base = finest detail */ int root_node_size; /* voxels/side for root level */ int base_node_size; /* voxels/side for base level */ int range_bytes_per_node; /* bytes/node for min/max data */ int base_bytes_per_node; /* bytes/node for base level (min/max data + status) */ int nonbase_bytes_per_node; /* bytes/node for non-base level (min/max data + status + ptr to child) */ int node_offset[VP_MAX_FIELDS]; /* offset to min/max data for each parameter in a node; min comes first */ int status_offset; /* offset to status field */ int child_offset; /* offset to child field */ void *root; /* storage for the octree, and a pointer to the root node */ int octree_bytes; /* bytes of storage for the octree */ /* * Layout of an octree node: * * Nodes at level 0 (root) through levels-2 are nonbase_bytes_per_node * bytes long. This space is divided into a number of fields as follows: * * minimum value for parameter 0 of the classification function * maximum value for parameter 0 * minimum value for parameter 1 * maximum value for parameter 1 * . * . * . * minimum value for parameter num_clsfy_params-1 * maximum value for parameter num_clsfy_params-1 * status field * child field * * The min/max fields are the same size as the corresponding * classification parameters (one or two bytes; four bytes not allowed). * Node_offset[] gives offsets to the min field for each parameter. * * The status field is a one byte field which is filled in during * classification of the volume (VPClassifyOctree). The possible * values are MM_EMPTY (node is transparent), MM_FULL (node has * no transparent children), or MM_PARTFULL. Status_offset * gives the offset to this field from the beginning of the node. * * The child field is a one word field which gives the number of * bytes from the root of the octree to the first child node of * this node. The remaining 7 children follow right after the * first child. Child_offset gives the offset to this field * from the beginning of the node. * * There may be additional bytes of padding in between fields * to satisfy alignment restrictions. This could make the code * non-portable on machines with bizarre requirements. * * Nodes at level levels-1 are base_bytes_per_node long and contain * the same fields except there is no child field. * * NOTE: As you can probably tell, I'm simulating a C structure here. * Unfortunately I can't use a real structure because I don't know the * number of fields in advance: it depends on the number and * size of the classification parameters. */ } MinMaxOctree; /* MMOctreeLevel: data associated with one level of the min-max octree during * a depth first traversal; this data is used to compute which octree * nodes intersect the current scanline of interest */ typedef struct { /* MMOctreeLevel */ int level_size; /* voxels/side for a node at this level */ int child_octant; /* octant number of first child to visit when a scanline intersects a node at this level */ int child_offset1; /* offset (in bytes) of first child to visit relative to child 0 */ int child_offset2; /* offset (in bytes) of second child to visit relative to child 0 */ void *child2; /* points to 2nd child if first is begin visit; NULL otherwise */ } MMOctreeLevel; /* GrayIntPixel: grayscale intermediate image pixel */ typedef struct { /* GrayIntPixel */ float clrflt; /* color */ float opcflt; /* opacity */ short lnk; /* early-ray termination link */ unsigned char zratio; /* integer part of opacity correction exponent (perspective only) */ unsigned char zfrac; /* fractional part of opacity correction exponent (perspective only) */ } GrayIntPixel; /* RGBIntPixel: RGB intermediate image pixel */ typedef struct { /* RGBIntPixel */ float rclrflt; /* color (red channel) */ float gclrflt; /* color (green channel) */ float bclrflt; /* color (blue channel) */ float opcflt; /* opacity */ short lnk; /* early-ray termination link */ unsigned char zratio; /* integer part of opacity correction exponent (perspective only) */ unsigned char zfrac; /* fractional part of opacity correction exponent (perspective only) */ } RGBIntPixel; /* Trapezoid: a trapezoidal region of the output image (used to record * intersection of the intermediate and final images) */ typedef struct { /* all coordinates are in the coordinate system of the final image */ int miny; /* first scanline of the final image which overlaps the trapezoid */ int maxy; /* last scanline of the final image which overlaps the trapezoid */ double x_top_lft; /* left edge of the trapezoid at y = miny */ double x_top_rgt; /* right edge of the trapezoid at y = miny */ double x_incr_lft; /* increment to add to x_top_lft to get the left edge of the trapezoid at the next y */ double x_incr_rgt; /* increment to add to x_top_rgt to get the right edge of the trapezoid at the next y */ } Trapezoid; /* vpContext: rendering context */ struct _vp_context { /* vpContext */ /* *** USER-SPECIFIED PARAMETERS *** */ /* raw volume data layout */ int xlen, ylen, zlen; /* voxels in each dimension */ short raw_bytes_per_voxel; /* size of raw voxel in bytes */ short num_voxel_fields; /* number of fields in the voxel */ short num_shade_fields; /* # of voxel fields for shading */ short field_size[VP_MAX_FIELDS]; /* size of each field in bytes */ short field_offset[VP_MAX_FIELDS]; /* byte offset for each field */ int field_max[VP_MAX_FIELDS]; /* maximum value of each field */ void *raw_voxels; /* voxel data */ int raw_voxels_size; /* size of raw_voxels in bytes */ int xstride, ystride, zstride; /* byte stride for each dimension */ /* classification specification */ double min_opacity; /* low opacity threshold (0.0-1.0) */ int num_clsfy_params; /* # of params for classification */ int param_field[VP_MAX_FIELDS]; /* voxel field # for each param */ float *clsfy_table[VP_MAX_FIELDS]; /* lookup table for each parameter */ int clsfy_table_size[VP_MAX_FIELDS]; /* size of each table in bytes */ /* shading specification */ int color_channels; /* number of color channels */ int shading_mode; /* type of shader to use */ float *shade_color_table; /* lookup table for LOOKUP_SHADER */ int shade_color_table_size; /* size of shade table in bytes */ float *shade_weight_table; /* lookup table for LOOKUP_SHADER */ int shade_weight_table_size; /* size of weight table in bytes */ short num_materials; /* # of material types in tables */ short color_field; /* voxel field # for color index */ short weight_field; /* field # for weight index */ /* material properties for each material and surface side */ double matl_props[VP_MAX_MATERIAL][2][NUM_MATL_PROPS]; /* 0.0-255.0 */ /* lighting properties */ short light_enable[VP_MAX_LIGHTS]; /* enable each light */ vpVector4 light_vector[VP_MAX_LIGHTS]; /* normalized light direction vectors (in eye coordinates) */ vpVector3 light_color[VP_MAX_LIGHTS]; /* light colors (0.0-1.0) */ int light_both_sides; /* use two-sided lighting */ int reverse_surface_sides; /* reverse interior and exterior */ /* depth cueing parameters */ short dc_enable; /* true to enable depth cueing */ double dc_front_factor; /* front depth cueing factor */ double dc_density; /* fog density for depth cueing */ int dc_table_len_hint; /* hint for dc_table_len */ double dc_quantization; /* minimum resolvable depth */ /* view specification */ vpMatrix4 transforms[3]; /* transformation matrices (VP_MODEL, VP_VIEW and VP_PROJECT) */ short current_matrix; /* current matrix */ int concat_left; /* if true, concatenate matrices on left instead of on right */ int axis_override; /* if not equal to VP_NO_AXIS then this is an axis number (e.g. VP_X_AXIS) that overrides the computed value of best_view_axis */ /* result image */ void *image; /* memory for image */ int image_width; /* image dimensions */ int image_height; short image_bytes_per_scan; /* size of scanline (with padding) */ int pixel_type; /* format for pixels (e.g. VP_RGB) */ /* rendering parameters */ double max_opacity; /* high opacity threshold */ short int_image_width_hint; /* hint for size of int. image */ short int_image_height_hint; short clamp_shade_table; /* clamp shade table entries */ /* min-max octree parameters */ int param_maxrange[VP_MAX_FIELDS]; /* max. range of values allowed in an mm_octree node w/o subdividing it */ /* preclassified volume parameters */ short rle_bytes_per_voxel; /* bytes per voxel in RLEVoxels */ int skip_rle_x; /* if true, don't compute rle_x */ int skip_rle_y; /* if true, don't compute rle_y */ int skip_rle_z; /* if true, don't compute rle_z */ /* parameters for rendering shadows */ short enable_shadows; /* if true, enable shadows */ short shadow_light_num; /* light source id (VP_LIGHT#) for the light producing the shadows */ short shadow_width_hint; /* hint for width of shadow buffer */ short shadow_height_hint; /* hint for height of shadow buffer */ float *shadow_color_table; /* lookup table for LOOKUP_SHADER */ int shadow_color_table_size; /* size of shade table in bytes */ int shadow_bias; /* shadow bias distance */ /* *** USER-SPECIFIED PARAMETERS THAT ARE NOT STORED IN CONTEXT FILE *** */ /* dummy variable marking the boundary between state variables stored in volpack context files and those that are not; the value of this variable is never used or set */ int end_of_parameters; /* callback functions */ void (*shade_func) ANSI_ARGS((void*, ...)); /* shade a voxel */ #ifndef WIN32 ssize_t (*write_func) ANSI_ARGS((int, const void *, size_t)); /* write to file */ ssize_t (*read_func) ANSI_ARGS((int, void *, size_t)); /* read from file */ #else int (*write_func) ANSI_ARGS((int, const void*, size_t)); int (*read_func) ANSI_ARGS((int, void*, size_t)); #endif void *(*mmap_func) ANSI_ARGS((int, unsigned, void *));/* memory map file */ void (*log_alloc_func) ANSI_ARGS((void *,int,char *,int,char *,void *)); /* log memory allocation */ void (*log_free_func) ANSI_ARGS((void *, void *)); /* log memory deallocation */ void (*status_func) ANSI_ARGS((double, void *)); /* give progress report */ /* client data */ void *client_data; /* hook for client data structure */ /* resampling filter for vpResample */ int filter_num_taps; /* number of filter taps */ int filter_num_phases; /* number of filter phases */ float *filter_weights; /* table of filter weights (weights[num_phases][num_taps]) */ /* *** INTERNAL DATA STRUCTURES *** */ /* data structures for fast classification */ MinMaxOctree *mm_octree; /* min-max octree version of volume */ unsigned *sum_table; /* summed area table */ int sum_table_size; /* size of summed area table (bytes) */ /* classified, run-length encoded volume data */ RLEVoxels *rle_x; /* RLE data for X viewing axis */ RLEVoxels *rle_y; /* RLE data for Y viewing axis */ RLEVoxels *rle_z; /* RLE data for Z viewing axis */ ConstructionBuffer *cbuf; /* buffer for constructing volume */ /* factored viewing parameters */ short factored_view_ready; /* true if factored view is current */ short affine_view; /* true for affine transformation */ short best_view_axis; /* principal viewing axis */ short reverse_slice_order; /* compositing direction */ short intermediate_width; /* size of intermediate image */ short intermediate_height; double shear_i; /* shear coefficients */ double shear_j; double trans_i; /* translation coefficients */ double trans_j; vpMatrix3 warp_2d; /* final 2D transformation */ double depth_000; /* depth of first voxel in volume */ double depth_di; /* change in depth per unit i */ double depth_dj; /* change in depth per unit j */ double depth_dk; /* change in depth per unit k */ /* work buffers for rendering */ short max_intermediate_width; /* size of intermediate image buffer */ short max_intermediate_height; short max_scan_length; /* size of scanline buffers */ short intermediate_color_channels; /* color channels in int. image */ short pad_int_to_maxwidth; /* pad intermediate image scanlines */ union { /* intermediate image (2D array) */ GrayIntPixel *gray_intim; RGBIntPixel *rgb_intim; } int_image; /* parameters and data structures for shadows */ double shadow_shear_i; /* shear coeffs for light vector */ double shadow_shear_j; double shadow_trans_i; /* trans. coeffs for light vector */ double shadow_trans_j; short shadow_width; /* size of image in shadow buffer */ short shadow_height; short max_shadow_width; /* size of shadow buffer */ short max_shadow_height; short pad_shadow_to_maxwidth; /* pad shadow buffer scanlines */ GrayIntPixel *shadow_buffer; /* 2D shadow buffer */ /* depth cueing */ float *dc_table; /* depth cueing lookup table */ int dc_table_len; /* number of entries in dc_table */ /* opacity correction */ float affine_opac_correct[VP_OPACITY_MAX+1]; /* maps opacity (0-255) to opacity corrected for view (0.0-1.0) */ float shadow_opac_correct[VP_OPACITY_MAX+1]; /* opacity correction for shadow buffer calculation */ /* debugging info */ vpResult error_code; /* result code from first invalid command since last call to vpGetError() */ #ifdef DEBUG short debug_enable[VPDEBUG_COUNT]; /* flags to enable messages */ int trace_u, trace_v; /* intermediate image pixel to trace */ int trace_shadow_k; /* slice of interest for tracing shadow opacity values */ #endif #ifdef USE_TIMER unsigned timer_ticks[VPTIMER_COUNT];/* timer values in ticks */ double timer_usec_per_tick; /* microseconds per tick */ #ifdef HAVE_HIRES_TIMER volatile unsigned *timer_addr; /* address of the timer */ unsigned dummy_timer; /* dummy location */ #endif #endif }; /******************************************************************* * Function prototypes. * *******************************************************************/ /* vp_context.c */ /* vp_check.c */ extern vpResult VPCheckVoxelFields ANSI_ARGS((vpContext *vpc)); extern vpResult VPCheckRawVolume ANSI_ARGS((vpContext *vpc)); extern vpResult VPCheckClassifiedVolume ANSI_ARGS(( vpContext *vpc, int axis)); extern vpResult VPCheckClassifier ANSI_ARGS((vpContext *vpc)); extern vpResult VPCheckShader ANSI_ARGS((vpContext *vpc)); extern vpResult VPCheckImage ANSI_ARGS((vpContext *vpc)); extern vpResult VPCheckShadows ANSI_ARGS((vpContext *vpc)); extern vpResult VPSetError ANSI_ARGS((vpContext *vpc, vpResult code)); /* vp_extract.c */ extern vpResult VPClassifyBlock ANSI_ARGS((vpContext *vpc, int correct, int x0, int y0, int z0, int x1, int y1, int z1, float *opc, int dst_xstride, int dst_ystride, int dst_zstride)); extern float VPClassifyVoxel ANSI_ARGS((vpContext *vpc, void *voxel)); extern vpResult VPShadeBlock ANSI_ARGS((vpContext *vpc, int x0, int y0, int z0, int x1, int y1, int z1, float *shd, int dst_xstride, int dst_ystride, int dst_zstride)); extern void VPQuantize ANSI_ARGS((float *src, int xlen, int ylen, int zlen, double scale, int maxvalue, unsigned char *dst, int dst_xstride, int dst_ystride, int dst_zstride)); /* vp_linalg.c */ extern void VPLoadTranslation ANSI_ARGS((vpMatrix4 m, double tx, double ty, double tz)); extern void VPLoadRotation ANSI_ARGS((vpMatrix4 m, int axis, double degrees)); extern void VPLoadScale ANSI_ARGS((vpMatrix4 m, double sx, double sy, double sz)); /* vp_view.c */ extern vpResult VPFactorView ANSI_ARGS((vpContext *vpc)); extern void VPComputeViewTransform ANSI_ARGS((vpContext *vpc, vpMatrix4 vm)); extern void VPResizeRenderBuffers ANSI_ARGS((vpContext *vpc, int max_width, int max_height, int max_scan)); extern void VPResizeDepthCueTable ANSI_ARGS((vpContext *vpc, int entries, int copy)); extern void VPComputeDepthCueTable ANSI_ARGS((vpContext *vpc, int first, int last)); extern float VPSliceDepthCueRatio ANSI_ARGS((vpContext *vpc)); extern void VPDepthCueIntImage ANSI_ARGS((vpContext *vpc, int slicenum)); extern void VPResizeShadowBuffer ANSI_ARGS((vpContext *vpc, int max_width, int max_height)); /* vp_util.c */ extern void VPBug ANSI_ARGS((char *fmt, ...)); #ifdef DEBUG extern void VPDebug ANSI_ARGS((vpContext *vpc, int debug_code, char *fmt, ...)); #endif /* DEBUG */ /* vp_rle.c */ extern RLEVoxels * VPCreateRLEVoxels ANSI_ARGS((vpContext *vpc, int ilen, int jlen, int klen, int data_count, int run_count, int rle_bytes_per_voxel)); extern void VPDestroyRLEVoxels ANSI_ARGS((vpContext *vpc, RLEVoxels *rle_voxels)); #ifdef INDEX_VOLUME extern vpResult VPComputeRLEScanOffsets ANSI_ARGS(( vpContext *vpc)); #endif #ifdef DEBUG extern void VPCheckScanOffsets ANSI_ARGS(( RLEVoxels *rle_voxels, int rle_bytes_per_voxel)); extern void VPValidateClassifiedVolume ANSI_ARGS(( vpContext *vpc)); extern void VPDumpView ANSI_ARGS((vpContext *vpc)); extern void VPDumpClassifier ANSI_ARGS((vpContext *vpc)); #endif /* vp_renderA.c */ extern void VPRenderAffine ANSI_ARGS((vpContext *vpc, int algorithm, void (*composite_func)(vpContext*,...))); /* vp_octree.c */ extern void VPComputeSummedAreaTable ANSI_ARGS(( vpContext *vpc)); extern void VPClassifyOctree ANSI_ARGS((vpContext *vpc)); extern void VPInitOctreeLevelStack ANSI_ARGS((vpContext *vpc, MMOctreeLevel level_stack[VP_MAX_OCTREE_LEVELS], int axis, int k)); extern int VPComputeScanRuns ANSI_ARGS((vpContext *vpc, MMOctreeLevel level_stack[VP_MAX_OCTREE_LEVELS], unsigned char *run_lengths, int axis, int j, int icount)); extern int VPCheckRuns ANSI_ARGS((vpContext *vpc, unsigned char *run_lengths, int axis, int k, int j)); extern void VPTestMinMaxOctree ANSI_ARGS((vpContext *vpc)); /* vp_warp.c */ extern void VPComputeWarpTables ANSI_ARGS((void)); extern void VPAffineImageOverlap ANSI_ARGS((int in_width, int in_height, int out_width, int out_height, vpMatrix3 warp_matrix, double filter_width, Trapezoid full_overlap[9], Trapezoid part_overlap[9])); ccseapps-2.5/CCSEApps/volpack/vp_resample.c0000644000175000017500000010356511634153073022011 0ustar amckinstryamckinstry/* * vp_resample.c * * Routines to resample an array to a grid with a different resolution. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:04 $ * $Revision: 1.8 $ */ #include "vp_global.h" /* convert a float in the interval [0-1) to a 31-bit fixed point */ #define FLTFRAC_TO_FIX31(f) ((int)((f) * 2147483648.)) typedef struct { int in_ptr_offset; /* offset in bytes from beginning of scanline to first input sample for current output sample */ float *wptr; /* filter weights for the filter phase for current output sample */ int tap_min; /* first tap to evaluate */ int tap_max; /* last tap to evaluate */ } FilterTemplate; static void ResampleUchar ANSI_ARGS((vpContext *vpc, int num_dimens, int *src_dimens, int *dst_dimens, int *src_strides, int *dst_strides, unsigned char *in_array, unsigned char *out_array, FilterTemplate *tmplate)); static void ResampleUshort ANSI_ARGS((vpContext *vpc, int num_dimens, int *src_dimens, int *dst_dimens, int *src_strides, int *dst_strides, unsigned short *in_array, unsigned short *out_array, FilterTemplate *tmplate)); static void ResampleFloat ANSI_ARGS((vpContext *vpc, int num_dimens, int *src_dimens, int *dst_dimens, int *src_strides, int *dst_strides, float *in_array, float *out_array, FilterTemplate *tmplate)); static float *ComputeWeights ANSI_ARGS((vpContext *vpc, int src_xlen, int dst_xlen, int filter_type)); /* * vpSetFilter * * Set the filter to use for resampling. */ vpResult vpSetFilter(vpc, num_taps, num_phases, weights) vpContext *vpc; int num_taps; /* number of filter taps */ int num_phases; /* number of filter phases */ float *weights; /* table of filter weights (weights[num_phases][num_taps]) */ { int num_ones, bit; /* make sure num_taps is positive and num_phases is a power of two */ if (num_taps < 1 || num_phases < 1) return(VPSetError(vpc, VPERROR_BAD_VALUE)); num_ones = 0; for (bit = 0; bit < 32; bit++) { if (num_phases & (1 << bit)) num_ones++; } if (num_ones != 1) return(VPSetError(vpc, VPERROR_BAD_VALUE)); /* store values in context */ vpc->filter_num_taps = num_taps; vpc->filter_num_phases = num_phases; vpc->filter_weights = weights; return(VP_OK); } /* * vpResample * * Resample an array to a grid with a different resolution. */ vpResult vpResample(vpc, num_dimens, src_dimens, dst_dimens, src_strides, dst_strides, element_type, in_array, out_array) vpContext *vpc; int num_dimens; /* number of dimensions in the two arrays */ int *src_dimens; /* sizes of source array dimensions */ int *dst_dimens; /* sizes of destination array dimensions (must be the same, except for first dimension) */ int *src_strides; /* strides of source array dimensions (in bytes) */ int *dst_strides; /* strides of destination dimensions (in bytes) */ int element_type; /* type of array element (VP_UCHAR, VP_USHORT, VP_FLOAT) */ void *in_array; /* input array containing data */ void *out_array; /* storage for output array */ { int num_taps; /* number of filter taps */ int num_phases; /* number of filter phases */ int in_x_count; /* length of input scanlines */ int out_x_count; /* length of output scanlines */ int in_x_stride; /* stride of input scanline elements */ double scale_factor; /* in_x = scale_factor * out_x */ double in_x0; /* location of center of first output sample in the input scanline */ int index0; /* coordinate of input sample corresponding to first filter tap for first output sample */ int phase0; /* filter phase for first output sample */ int index_incr; /* change in index0 for next output sample */ int phase_incr; /* change in phase0 for next output sample */ int unused_phase_bits; /* number of low-order bits of the phase that are ignored for indexing the weight table */ FilterTemplate *tmplate; /* filter template */ float *weights; /* pointer to weight table */ int in_offset; /* offset to input sample */ int index, phase; /* current input sample index and phase */ int out_x; /* current output sample */ int tap_min, tap_max; /* bounds on tap number */ int bit; /* check for errors */ if (vpc->filter_weights == NULL) return(VPSetError(vpc, VPERROR_BAD_SIZE)); /* find where the first output sample maps into the input array and compute the filter phase for that sample; also compute increments to get the input array position and filter phase for the next sample */ num_taps = vpc->filter_num_taps; num_phases = vpc->filter_num_phases; in_x_count = src_dimens[0]; out_x_count = dst_dimens[0]; scale_factor = (double)in_x_count / (double)out_x_count; if (num_taps % 2 == 0) { /* even number of taps */ /* map center of first output voxel (x=0.5) to input voxel space (multiply by scale_factor), then translate by -0.5 to convert input voxels centered at 0.5 to input voxels centered at 0.0 */ in_x0 = 0.5 * scale_factor - 0.5; phase0 = FLTFRAC_TO_FIX31(in_x0 - floor(in_x0)); index0 = (int)floor(in_x0) - num_taps/2 + 1; } else { /* odd number of taps */ /* omit translation by -0.5 since filter phase is offset by 0.5 voxels relative to previous case */ in_x0 = 0.5 * scale_factor; phase0 = FLTFRAC_TO_FIX31(in_x0 - floor(in_x0)); if (in_x0 < 0.5) { index0 = (int)floor(in_x0) - num_taps/2; } else { index0 = (int)floor(in_x0) - num_taps/2 - 1; } } index_incr = (int)floor(scale_factor); phase_incr = FLTFRAC_TO_FIX31(scale_factor - index_incr); unused_phase_bits = 0; for (bit = 0; bit < 32; bit++) { if (num_phases & (1 << bit)) { unused_phase_bits = 31 - bit; break; } } ASSERT(unused_phase_bits != 0); /* compute a template containing input array position and filter weights for each output sample in an output scanline */ Alloc(vpc, tmplate, FilterTemplate *, out_x_count*sizeof(FilterTemplate), "FilterTemplate"); weights = vpc->filter_weights; index = index0; phase = phase0; in_x_stride = src_strides[0]; in_offset = index * in_x_stride; for (out_x = 0; out_x < out_x_count; out_x++) { tap_min = MAX(0, -index); tap_max = MIN(in_x_count - index - 1, num_taps-1); tmplate[out_x].in_ptr_offset = in_offset + tap_min * in_x_stride; tmplate[out_x].wptr = &weights[(phase >> unused_phase_bits) * num_taps + tap_min]; tmplate[out_x].tap_min = tap_min; tmplate[out_x].tap_max = tap_max; phase += phase_incr; if ( (unsigned int) phase & ~0x7FFFFFFF ) { phase &= 0x7FFFFFFF; index += index_incr + 1; in_offset += (index_incr + 1) * in_x_stride; } else { index += index_incr; in_offset += index_incr * in_x_stride; } } /* call a type-specific resampling routine */ switch (element_type) { case VP_UCHAR: ResampleUchar(vpc, num_dimens, src_dimens, dst_dimens, src_strides, dst_strides, (unsigned char*)in_array, (unsigned char*)out_array, tmplate); break; case VP_USHORT: ResampleUshort(vpc, num_dimens, src_dimens, dst_dimens, src_strides, dst_strides, (unsigned short*)in_array, (unsigned short*)out_array, tmplate); break; case VP_FLOAT: ResampleFloat(vpc, num_dimens, src_dimens, dst_dimens, src_strides, dst_strides, (float*)in_array, (float*)out_array, tmplate); break; default: Dealloc(vpc, tmplate); return(VPSetError(vpc, VPERROR_BAD_VALUE)); } Dealloc(vpc, tmplate); return(VP_OK); } /* * ResampleUchar * * Resample an array of unsigned chars. */ static void ResampleUchar(vpc, num_dimens, src_dimens, dst_dimens, src_strides, dst_strides, in_array, out_array, tmplate) vpContext *vpc; int num_dimens; /* number of dimensions in the two arrays */ int *src_dimens; /* sizes of source array dimensions */ int *dst_dimens; /* sizes of destination array dimensions (must be the same, except for first dimension) */ int *src_strides; /* strides of source array dimensions (in bytes) */ int *dst_strides; /* strides of destination dimensions (in bytes) */ unsigned char *in_array;/* input array containing data */ unsigned char *out_array;/* storage for output array */ FilterTemplate *tmplate;/* filter template */ { int out_x; /* current output sample */ float *wptr; /* pointer to filter weights */ float acc; /* accumulator for resampled value */ int tap; /* current tap number */ int tap_min, tap_max; /* bounds on tap number */ unsigned char *in_ptr; /* pointer to first input sample that affects current output sample */ unsigned char *in_scan_ptr; /* pointer to beginning of input scanline */ unsigned char *out_ptr; /* pointer to current output sample */ unsigned char *out_scan_ptr;/* pointer to beginning of output scanline */ FilterTemplate *sample_template; /* template for output sample */ int out_x_count; /* number of elements in output scanline */ int in_x_stride; /* stride for input elements */ int out_x_stride; /* stride for output elements */ int *scan_coord; /* current scanline coordinates */ int done; int dim; /* copy parameters into local variables */ out_x_count = dst_dimens[0]; in_x_stride = src_strides[0]; out_x_stride = dst_strides[0]; /* allocate space for current scanline coordinates */ Alloc(vpc, scan_coord, int *, num_dimens * sizeof(int), "scan_coord"); for (dim = 0; dim < num_dimens; dim++) { scan_coord[dim] = 0; } /* initialize pointers to first scanline */ in_scan_ptr = in_array; out_scan_ptr = out_array; done = 0; while (!done) { /* resample one scanline */ sample_template = tmplate; out_ptr = out_scan_ptr; for (out_x = 0; out_x < out_x_count; out_x++) { in_ptr = in_scan_ptr + sample_template->in_ptr_offset; wptr = sample_template->wptr; tap_min = sample_template->tap_min; tap_max = sample_template->tap_max; acc = 0; for (tap = tap_min; tap <= tap_max; tap++) { acc += (float)(*in_ptr) * *wptr; in_ptr += in_x_stride; wptr++; } if (acc > 255.) *out_ptr = 255; else if (acc < 0.) *out_ptr = 0; else *out_ptr = (int)acc; out_ptr += out_x_stride; sample_template++; } /* for out_x */ /* set pointers to next scanline */ for (dim = 1; dim < num_dimens; dim++) { if (++scan_coord[dim] < src_dimens[dim]) { in_scan_ptr += src_strides[dim]; out_scan_ptr += dst_strides[dim]; break; } else if (dim == num_dimens-1) { done = 1; } else { scan_coord[dim] = 0; in_scan_ptr -= src_strides[dim] * src_dimens[dim]; out_scan_ptr -= dst_strides[dim] * dst_dimens[dim]; } } } /* while scanlines */ /* clean up */ Dealloc(vpc, scan_coord); } /* * ResampleUshort * * Resample an array of unsigned shorts. */ static void ResampleUshort(vpc, num_dimens, src_dimens, dst_dimens, src_strides, dst_strides, in_array, out_array, tmplate) vpContext *vpc; int num_dimens; /* number of dimensions in the two arrays */ int *src_dimens; /* sizes of source array dimensions */ int *dst_dimens; /* sizes of destination array dimensions (must be the same, except for first dimension) */ int *src_strides; /* strides of source array dimensions (in bytes) */ int *dst_strides; /* strides of destination dimensions (in bytes) */ unsigned short *in_array;/* input array containing data */ unsigned short *out_array;/* storage for output array */ FilterTemplate *tmplate;/* filter template */ { int out_x; /* current output sample */ float *wptr; /* pointer to filter weights */ float acc; /* accumulator for resampled value */ int tap; /* current tap number */ int tap_min, tap_max; /* bounds on tap number */ unsigned short *in_ptr; /* pointer to first input sample that affects current output sample */ unsigned short *in_scan_ptr;/* pointer to beginning of input scanline */ unsigned short *out_ptr; /* pointer to current output sample */ unsigned short *out_scan_ptr;/* pointer to beginning of output scanline */ FilterTemplate *sample_template; /* template for output sample */ int out_x_count; /* number of elements in output scanline */ int in_x_stride; /* stride for input elements */ int out_x_stride; /* stride for output elements */ int *scan_coord; /* current scanline coordinates */ int done; int dim; /* copy parameters into local variables */ out_x_count = dst_dimens[0]; in_x_stride = src_strides[0]; out_x_stride = dst_strides[0]; /* allocate space for current scanline coordinates */ Alloc(vpc, scan_coord, int *, num_dimens * sizeof(int), "scan_coord"); for (dim = 0; dim < num_dimens; dim++) { scan_coord[dim] = 0; } /* initialize pointers to first scanline */ in_scan_ptr = in_array; out_scan_ptr = out_array; done = 0; while (!done) { /* resample one scanline */ sample_template = tmplate; out_ptr = out_scan_ptr; for (out_x = 0; out_x < out_x_count; out_x++) { in_ptr = in_scan_ptr + sample_template->in_ptr_offset; wptr = sample_template->wptr; tap_min = sample_template->tap_min; tap_max = sample_template->tap_max; acc = 0; for (tap = tap_min; tap <= tap_max; tap++) { acc += (float)(*in_ptr) * *wptr; in_ptr = (unsigned short *)((char *)in_ptr + in_x_stride); wptr++; } if (acc > 65535.) *out_ptr = 65535; else if (acc < 0.) *out_ptr = 0; else *out_ptr = (int)acc; out_ptr = (unsigned short *)((char *)out_ptr + out_x_stride); sample_template++; } /* for out_x */ /* set pointers to next scanline */ for (dim = 1; dim < num_dimens; dim++) { if (++scan_coord[dim] < src_dimens[dim]) { in_scan_ptr = (unsigned short *)((char *)in_scan_ptr + src_strides[dim]); out_scan_ptr = (unsigned short *)((char *)out_scan_ptr + dst_strides[dim]); break; } else if (dim == num_dimens-1) { done = 1; } else { scan_coord[dim] = 0; in_scan_ptr = (unsigned short *)((char *)in_scan_ptr - src_strides[dim] * src_dimens[dim]); out_scan_ptr = (unsigned short *)((char *)out_scan_ptr - dst_strides[dim] * dst_dimens[dim]); } } } /* while scanlines */ /* clean up */ Dealloc(vpc, scan_coord); } /* * ResampleFloat * * Resample an array of unsigned shorts. */ static void ResampleFloat(vpc, num_dimens, src_dimens, dst_dimens, src_strides, dst_strides, in_array, out_array, tmplate) vpContext *vpc; int num_dimens; /* number of dimensions in the two arrays */ int *src_dimens; /* sizes of source array dimensions */ int *dst_dimens; /* sizes of destination array dimensions (must be the same, except for first dimension) */ int *src_strides; /* strides of source array dimensions (in bytes) */ int *dst_strides; /* strides of destination dimensions (in bytes) */ float *in_array; /* input array containing data */ float *out_array; /* storage for output array */ FilterTemplate *tmplate;/* filter template */ { int out_x; /* current output sample */ float *wptr; /* pointer to filter weights */ float acc; /* accumulator for resampled value */ int tap; /* current tap number */ int tap_min, tap_max; /* bounds on tap number */ float *in_ptr; /* pointer to first input sample that affects current output sample */ float *in_scan_ptr; /* pointer to beginning of input scanline */ float *out_ptr; /* pointer to current output sample */ float *out_scan_ptr; /* pointer to beginning of output scanline */ FilterTemplate *sample_template; /* template for output sample */ int out_x_count; /* number of elements in output scanline */ int in_x_stride; /* stride for input elements */ int out_x_stride; /* stride for output elements */ int *scan_coord; /* current scanline coordinates */ int done; int dim; /* copy parameters into local variables */ out_x_count = dst_dimens[0]; in_x_stride = src_strides[0]; out_x_stride = dst_strides[0]; /* allocate space for current scanline coordinates */ Alloc(vpc, scan_coord, int *, num_dimens * sizeof(int), "scan_coord"); for (dim = 0; dim < num_dimens; dim++) { scan_coord[dim] = 0; } /* initialize pointers to first scanline */ in_scan_ptr = in_array; out_scan_ptr = out_array; done = 0; while (!done) { /* resample one scanline */ sample_template = tmplate; out_ptr = out_scan_ptr; for (out_x = 0; out_x < out_x_count; out_x++) { in_ptr = in_scan_ptr + sample_template->in_ptr_offset; wptr = sample_template->wptr; tap_min = sample_template->tap_min; tap_max = sample_template->tap_max; acc = 0; for (tap = tap_min; tap <= tap_max; tap++) { acc += *in_ptr * *wptr; in_ptr = (float *)((char *)in_ptr + in_x_stride); wptr++; } *out_ptr = acc; out_ptr = (float *)((char *)out_ptr + out_x_stride); sample_template++; } /* for out_x */ /* set pointers to next scanline */ for (dim = 1; dim < num_dimens; dim++) { if (++scan_coord[dim] < src_dimens[dim]) { in_scan_ptr = (float *)((char *)in_scan_ptr + src_strides[dim]); out_scan_ptr = (float *)((char *)out_scan_ptr + dst_strides[dim]); break; } else if (dim == num_dimens-1) { done = 1; } else { scan_coord[dim] = 0; in_scan_ptr = (float *)((char *)in_scan_ptr - src_strides[dim] * src_dimens[dim]); out_scan_ptr = (float *)((char *)out_scan_ptr - dst_strides[dim] * dst_dimens[dim]); } } } /* while scanlines */ /* clean up */ Dealloc(vpc, scan_coord); } /* * vpResample2D * * Resample a 2D array. */ vpResult vpResample2D(in_array, in_x, in_y, out_array, out_x, out_y, element_type, filter_type) void *in_array; /* input array containing data */ int in_x, in_y; /* input array dimensions */ void *out_array; /* storage for output array */ int out_x, out_y; /* output array dimensions */ int element_type; /* type of array element (VP_UCHAR, VP_USHORT, VP_FLOAT) */ int filter_type; /* type of filter (VP_BOX_FILTER, etc.) */ { int src_dimens[2], dst_dimens[2]; int src_strides[2], dst_strides[2]; void *tmp1_array; int element_size; vpResult code; vpContext *vpc; float *weights; /* compute size of array element and allocate intermediate arrays */ switch (element_type) { case VP_UCHAR: element_size = 1; break; case VP_USHORT: element_size = 2; break; case VP_FLOAT: element_size = 4; break; default: return(VPSetError(0, VPERROR_BAD_OPTION)); } vpc = vpCreateContext(); Alloc(vpc, tmp1_array, void *, out_x*in_y*element_size, "resample_tmp1"); /* resample first dimension */ src_dimens[0] = in_x; src_dimens[1] = in_y; dst_dimens[0] = out_x; dst_dimens[1] = in_y; src_strides[0] = element_size; src_strides[1] = src_dimens[0] * src_strides[0]; dst_strides[0] = element_size; dst_strides[1] = dst_dimens[0] * dst_strides[0]; weights = ComputeWeights(vpc, src_dimens[0], dst_dimens[0], filter_type); if (weights == NULL) { Dealloc(vpc, tmp1_array); return(vpc->error_code); } code = vpResample(vpc, 2, src_dimens, dst_dimens, src_strides, dst_strides, element_type, in_array, tmp1_array); Dealloc(vpc, weights); if (code != VP_OK) { Dealloc(vpc, tmp1_array); return(code); } /* resample second dimension */ src_dimens[1] = out_x; src_dimens[0] = in_y; dst_dimens[1] = out_x; dst_dimens[0] = out_y; src_strides[1] = element_size; src_strides[0] = src_dimens[1] * src_strides[1]; dst_strides[1] = element_size; dst_strides[0] = dst_dimens[1] * dst_strides[1]; weights = ComputeWeights(vpc, src_dimens[0], dst_dimens[0], filter_type); if (weights == NULL) { Dealloc(vpc, tmp1_array); return(vpc->error_code); } code = vpResample(vpc, 2, src_dimens, dst_dimens, src_strides, dst_strides, element_type, tmp1_array, out_array); Dealloc(vpc, weights); if (code != VP_OK) { Dealloc(vpc, tmp1_array); return(code); } /* clean up */ Dealloc(vpc, tmp1_array); return(VP_OK); } /* * vpResample3D * * Resample a 3D array. */ vpResult vpResample3D(in_array, in_x, in_y, in_z, out_array, out_x, out_y, out_z, element_type, filter_type) void *in_array; /* input array containing data */ int in_x, in_y, in_z; /* input array dimensions */ void *out_array; /* storage for output array */ int out_x, out_y, out_z;/* output array dimensions */ int element_type; /* type of array element (VP_UCHAR, VP_USHORT, VP_FLOAT) */ int filter_type; /* type of filter (VP_BOX_FILTER, etc.) */ { int src_dimens[3], dst_dimens[3]; int src_strides[3], dst_strides[3]; void *tmp1_array, *tmp2_array; int element_size; vpResult code; vpContext *vpc; float *weights; /* compute size of array element and allocate intermediate arrays */ switch (element_type) { case VP_UCHAR: element_size = 1; break; case VP_USHORT: element_size = 2; break; case VP_FLOAT: element_size = 4; break; default: return(VPSetError(0, VPERROR_BAD_OPTION)); } vpc = vpCreateContext(); Alloc(vpc, tmp1_array, void *, out_x * in_y * in_z * element_size, "resample_tmp1"); Alloc(vpc, tmp2_array, void *, out_x * out_y * in_z * element_size, "resample_tmp2"); /* resample first dimension */ src_dimens[0] = in_x; src_dimens[1] = in_y; src_dimens[2] = in_z; dst_dimens[0] = out_x; dst_dimens[1] = in_y; dst_dimens[2] = in_z; src_strides[0] = element_size; src_strides[1] = src_dimens[0] * src_strides[0]; src_strides[2] = src_dimens[1] * src_strides[1]; dst_strides[0] = element_size; dst_strides[1] = dst_dimens[0] * dst_strides[0]; dst_strides[2] = dst_dimens[1] * dst_strides[1]; weights = ComputeWeights(vpc, src_dimens[0], dst_dimens[0], filter_type); if (weights == NULL) { Dealloc(vpc, tmp1_array); Dealloc(vpc, tmp2_array); return(vpc->error_code); } code = vpResample(vpc, 3, src_dimens, dst_dimens, src_strides, dst_strides, element_type, in_array, tmp1_array); Dealloc(vpc, weights); if (code != VP_OK) { Dealloc(vpc, tmp1_array); Dealloc(vpc, tmp2_array); return(code); } /* resample second dimension */ src_dimens[1] = out_x; src_dimens[0] = in_y; src_dimens[2] = in_z; dst_dimens[1] = out_x; dst_dimens[0] = out_y; dst_dimens[2] = in_z; src_strides[1] = element_size; src_strides[0] = src_dimens[1] * src_strides[1]; src_strides[2] = src_dimens[0] * src_strides[0]; dst_strides[1] = element_size; dst_strides[0] = dst_dimens[1] * dst_strides[1]; dst_strides[2] = dst_dimens[0] * dst_strides[0]; weights = ComputeWeights(vpc, src_dimens[0], dst_dimens[0], filter_type); if (weights == NULL) { Dealloc(vpc, tmp1_array); Dealloc(vpc, tmp2_array); return(vpc->error_code); } code = vpResample(vpc, 3, src_dimens, dst_dimens, src_strides, dst_strides, element_type, tmp1_array, tmp2_array); Dealloc(vpc, weights); if (code != VP_OK) { Dealloc(vpc, tmp1_array); Dealloc(vpc, tmp2_array); return(code); } /* resample third dimension */ src_dimens[1] = out_x; src_dimens[2] = out_y; src_dimens[0] = in_z; dst_dimens[1] = out_x; dst_dimens[2] = out_y; dst_dimens[0] = out_z; src_strides[1] = element_size; src_strides[2] = src_dimens[1] * src_strides[1]; src_strides[0] = src_dimens[2] * src_strides[2]; dst_strides[1] = element_size; dst_strides[2] = dst_dimens[1] * dst_strides[1]; dst_strides[0] = dst_dimens[2] * dst_strides[2]; weights = ComputeWeights(vpc, src_dimens[0], dst_dimens[0], filter_type); if (weights == NULL) { Dealloc(vpc, tmp1_array); Dealloc(vpc, tmp2_array); return(vpc->error_code); } code = vpResample(vpc, 3, src_dimens, dst_dimens, src_strides, dst_strides, element_type, tmp2_array, out_array); Dealloc(vpc, weights); if (code != VP_OK) { Dealloc(vpc, tmp1_array); Dealloc(vpc, tmp2_array); return(code); } /* clean up */ Dealloc(vpc, tmp1_array); Dealloc(vpc, tmp2_array); return(VP_OK); } /* * ComputeWeights * * Allocate and compute a filter weight table for a predefined filter type. */ static float * ComputeWeights(vpc, src_xlen, dst_xlen, filter_type) vpContext *vpc; /* context for storing table */ int src_xlen; /* number of samples in input scanline */ int dst_xlen; /* number of samples in output scanline */ int filter_type; /* type of filter (VP_BOX_FILTER, etc.) */ { double scale_factor; int num_phases, num_taps, support, tap_limit, phases, table_size; int code; float *weights; switch (filter_type) { case VP_BOX_FILTER: support = 1; break; case VP_LINEAR_FILTER: support = 2; break; case VP_GAUSSIAN_FILTER: support = 3; break; case VP_BSPLINE_FILTER: case VP_MITCHELL_FILTER: support = 4; break; default: VPSetError(vpc, VPERROR_BAD_OPTION); return(NULL); } scale_factor = (double)dst_xlen / (double)src_xlen; if (scale_factor >= 1.0) { num_taps = support; num_phases = 1024; } else { num_taps = (double)support / scale_factor; tap_limit = 4; phases = 1024; while (1) { if (num_taps <= tap_limit) { num_phases = phases; break; } tap_limit *= 2; phases /= 2; if (phases <= 1) { num_phases = 1; break; } } } table_size = num_taps * num_phases * sizeof(float); Alloc(vpc, weights, float *, table_size, "weight_table"); switch (filter_type) { case VP_BOX_FILTER: code = vpBoxFilter(num_taps, num_phases, weights, table_size); if (code != VP_OK) { Dealloc(vpc, weights); VPSetError(vpc, code); return(NULL); } break; case VP_LINEAR_FILTER: code = vpLinearFilter(num_taps, num_phases, weights, table_size); if (code != VP_OK) { Dealloc(vpc, weights); VPSetError(vpc, code); return(NULL); } break; case VP_GAUSSIAN_FILTER: code = vpGaussianFilter(VP_GAUSSIAN_SIGMA, num_taps, num_phases, weights, table_size); if (code != VP_OK) { Dealloc(vpc, weights); VPSetError(vpc, code); return(NULL); } break; case VP_BSPLINE_FILTER: code = vpBicubicFilter(1.0, 0.0, num_taps, num_phases, weights, table_size); if (code != VP_OK) { Dealloc(vpc, weights); VPSetError(vpc, code); return(NULL); } break; case VP_MITCHELL_FILTER: code = vpBicubicFilter(1.0/3.0, 1.0/3.0, num_taps, num_phases, weights, table_size); if (code != VP_OK) { Dealloc(vpc, weights); VPSetError(vpc, code); return(NULL); } break; } vpSetFilter(vpc, num_taps, num_phases, weights); return(weights); } /* * vpBoxFilter * * Compute filter weights for box filter. * For abs(x) < 0.5: * k(x) = C * (C is chosen so that k(x) integrates to 1). * Otherwise: * k(x) = 0 */ vpResult vpBoxFilter(num_taps, num_phases, weights, weights_bytes) int num_taps; /* number of filter taps to compute */ int num_phases; /* number of phases to compute */ float *weights; /* array for storing filter weights (num_taps*num_phases entries) */ int weights_bytes; /* size of array (for error checking) */ { int p, t; float *wptr; double value; if (weights_bytes != num_taps * num_phases * sizeof(float)) return(VPERROR_BAD_SIZE); if (num_phases % 2 != 0) return(VPERROR_BAD_VALUE); wptr = weights; value = 1.0 / (double)num_taps; for (p = 0; p < num_phases; p++) { for (t = 0; t < num_taps; t++) { *wptr++ = value; } } return(VP_OK); } /* * vpLinearFilter * * Compute filter weights for linear interpolation. * For abs(x) < 1: * k(x) = C * (1 - abs(x)) * (C is chosen so that k(x) integrates to 1). * Otherwise: * k(x) = 0 */ vpResult vpLinearFilter(num_taps, num_phases, weights, weights_bytes) int num_taps; /* number of filter taps to compute */ int num_phases; /* number of phases to compute */ float *weights; /* array for storing filter weights (num_taps*num_phases entries) */ int weights_bytes; /* size of array (for error checking) */ { int p, t; float *wptr1, *wptr2; double x0, delta_x, x, xa, tap_spacing, sum, normalize, value; if (weights_bytes != num_taps * num_phases * sizeof(float)) return(VPERROR_BAD_SIZE); if (num_phases % 2 != 0) return(VPERROR_BAD_VALUE); wptr1 = weights; tap_spacing = 2.0 / (double)num_taps; x0 = -tap_spacing * ((double)num_taps/2.0 - 1.0); delta_x = tap_spacing / (double)num_phases; for (p = 0; p < num_phases/2; p++) { x = x0; sum = 0; for (t = 0; t < num_taps; t++) { if (x < 0.0) xa = -x; else xa = x; value = 1.0 - xa; wptr1[t] = value; sum += value; x += tap_spacing; } normalize = 1.0 / sum; for (t = 0; t < num_taps; t++) { wptr1[t] *= normalize; } wptr1 += num_taps; x0 -= delta_x; } wptr2 = wptr1; for (p = 0; p < num_phases/2; p++) { for (t = 0; t < num_taps; t++) { *wptr1++ = *--wptr2; } } return(VP_OK); } /* * vpBicubicFilter * * Compute filter weights for a Mitchell bicubic. * * See Mitchell, D.P. and Netravali, A.N., "Reconstruction filters in * computer graphics," Proc. SIGGRAPH '88 (Computer Graphics V22 N4), * p. 221-8. */ vpResult vpBicubicFilter(b_value, c_value, num_taps, num_phases, weights, weights_bytes) double b_value; /* b in the filter kernel equation */ double c_value; /* c in the filter kernel equation */ int num_taps; /* number of filter taps to compute */ int num_phases; /* number of phases to compute */ float *weights; /* array for storing filter weights (num_taps*num_phases entries) */ int weights_bytes; /* size of array (for error checking) */ { int p, t; float *wptr1, *wptr2; double x0, delta_x, x, xa, tap_spacing, sum, normalize, value; if (weights_bytes != num_taps * num_phases * sizeof(float)) return(VPERROR_BAD_SIZE); if (num_phases % 2 != 0) return(VPERROR_BAD_VALUE); wptr1 = weights; tap_spacing = 4.0 / (double)num_taps; x0 = -tap_spacing * ((double)num_taps/2.0 - 1.0); delta_x = tap_spacing / (double)num_phases; for (p = 0; p < num_phases/2; p++) { x = x0; sum = 0; for (t = 0; t < num_taps; t++) { if (x < 0.0) xa = -x; else xa = x; if (xa < 1.0) { value = (((12. - 9.*b_value - 6.*c_value)*xa - 18. + 12.*b_value + 6.*c_value)*xa*xa + 6. - 2.*b_value) * 1./6.; } else { value = ((((-b_value - 6.*c_value)*xa + 6.*b_value + 30.*c_value)*xa - 12.*b_value - 48.*c_value)*xa + 8.*b_value + 24.*c_value)* 1./6.; } wptr1[t] = value; sum += value; x += tap_spacing; } normalize = 1.0 / sum; for (t = 0; t < num_taps; t++) { wptr1[t] *= normalize; } wptr1 += num_taps; x0 -= delta_x; } wptr2 = wptr1; for (p = 0; p < num_phases/2; p++) { for (t = 0; t < num_taps; t++) { *wptr1++ = *--wptr2; } } return(VP_OK); } /* * vpGaussianFilter * * Compute filter weights for a Gaussian. * For abs(x) <= 1.0: * k(x) = C * exp(-x*x/(2*sigma*sigma)) * (C is chosen so that k(x) integrates to 1). * Otherwise: * k(x) = 0 */ vpResult vpGaussianFilter(sigma, num_taps, num_phases, weights, weights_bytes) double sigma; /* standard deviation */ int num_taps; /* number of filter taps to compute */ int num_phases; /* number of phases to compute */ float *weights; /* array for storing filter weights (num_taps*num_phases entries) */ int weights_bytes; /* size of array (for error checking) */ { int p, t; float *wptr1, *wptr2; double x0, delta_x, x, tap_spacing, sigma2_inv, sum, normalize, value; if (weights_bytes != num_taps * num_phases * sizeof(float)) return(VPERROR_BAD_SIZE); if (num_phases % 2 != 0) return(VPERROR_BAD_VALUE); wptr1 = weights; sigma2_inv = -1.0 / (2.0 * sigma * sigma); tap_spacing = 2.0 / (double)num_taps; x0 = -tap_spacing * ((double)num_taps/2.0 - 1.0); delta_x = tap_spacing / (double)num_phases; for (p = 0; p < num_phases/2; p++) { x = x0; sum = 0; for (t = 0; t < num_taps; t++) { value = exp(x*x*sigma2_inv); wptr1[t] = value; sum += value; x += tap_spacing; } normalize = 1.0 / sum; for (t = 0; t < num_taps; t++) { wptr1[t] *= normalize; } wptr1 += num_taps; x0 -= delta_x; } wptr2 = wptr1; for (p = 0; p < num_phases/2; p++) { for (t = 0; t < num_taps; t++) { *wptr1++ = *--wptr2; } } return(VP_OK); } ccseapps-2.5/CCSEApps/volpack/rendervolume.dsp0000644000175000017500000001117411634153073022541 0ustar amckinstryamckinstry# Microsoft Developer Studio Project File - Name="rendervolume" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=rendervolume - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "rendervolume.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "rendervolume.mak" CFG="rendervolume - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "rendervolume - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "rendervolume - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe F90=df.exe RSC=rc.exe !IF "$(CFG)" == "rendervolume - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE F90 /compile_only /nologo /warn:nofileopt # ADD F90 /compile_only /nologo /warn:nofileopt # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W1 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "rendervolume - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "rendervolume___Win32_Debug" # PROP BASE Intermediate_Dir "rendervolume___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "rendervolume___Win32_Debug" # PROP Intermediate_Dir "rendervolume___Win32_Debug" # PROP Target_Dir "" # ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W1 /Gm /GX /ZI /Od /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "rendervolume - Win32 Release" # Name "rendervolume - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" # Begin Source File SOURCE=.\examples\rendervolume.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ccseapps-2.5/CCSEApps/volpack/doc/0000755000175000017500000000000011634153073020063 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/volpack/doc/vp_userguide.html0000644000175000017500000017341511634153073023465 0ustar amckinstryamckinstry VolPack User's Guide

VolPack User's Guide

Version 2.0beta1

Table of Contents

Section 1: Overview
  1. Introduction to VolPack
  2. The Volume Rendering Pipeline
  3. Data Structures and Rendering Algorithms
Section 2: Using VolPack
  1. Include Files and Libraries
  2. Rendering Contexts
  3. Volumes
  4. Classification
  5. Classified Volumes
  6. Min-Max Octrees
  7. View Transformations
  8. Shading and Lighting
  9. Images
  10. Rendering
  11. State Variables
  12. Utility Functions
  13. Result Codes and Error Handling
Section 3: Tips and Pointers
  1. Maximizing Rendering Speed
  2. Maximizing Image Quality
  3. Software Support
  4. Obtaining the Software

Section 1: Overview

Introduction to VolPack

VolPack is a portable software library for volume rendering. It is based on a new family of fast volume rendering algorithms (see Philippe Lacroute and Marc Levoy , Fast Volume Rendering Using a Shear-Warp Factorization of the Viewing Transformation, Proc. SIGGRAPH '94 (Orlando, Florida, July 24-29, 1994). In Computer Graphics Proceedings, Annual Conference Series, 1994, ACM SIGGRAPH, pp. 451-458). The library has the following features:
  • Renders data sampled on a regular, three-dimensional grid.
  • Supports user-specified transfer functions for both opacity and color.
  • Provides a shading model with directional light sources, multiple material types with different reflective properties, depth cueing, and shadows.
  • Produces color (24 bits/pixel) or grayscale (8 bits/pixel) renderings, with or without an alpha channel.
  • Supports arbitrary affine view transformations.
  • Supports a flexible data format that allows an arbitrary C structure to be associated with each grid point.
  • Achieves very fast rendering times without specialized hardware.
The library is intended for use in C or C++ programs but may be useful with other programming languages. The current implementation does not support perspective projections or clipping planes. These features will be added in a future release.

The remainder of this section contains a brief introduction to the conceptual volume rendering pipeline used by VolPack, followed by a high-level description of the data structures and algorithms used by the library. This background material lays the foundation for Section 2 which describes each of the routines provided by VolPack. The routines are grouped by function and are presented roughly in the order that they would be called in a typical application. More detailed descriptions of each command can be found by consulting the man pages for VolPack. Finally, Section 3 covers some tips for maximizing rendering performance and image quality, and describes how to obtain the VolPack software.

The Volume Rendering Pipeline

The input to the volume renderer is a three-dimensional array of data. Each element of the array is a C structure containing any number of fields of data, such as tissue density or temperature. Each element is called a "voxel." The first stage in the volume rendering pipeline is to classify the volume data, which means to assign an opacity to each voxel. Opacity is the inverse of transparency: an opacity of 0.0 indicates a fully-transparent voxel, while an opacity of 1.0 indicates a voxel which completely occludes anything behind it. Intermediate values between 0.0 and 1.0 indicate semi-transparent voxels. The purpose of classification is to assign low opacities to regions of the data set which are uninteresting or distracting and high opacities to regions of the data set which should be visible in the rendering. Intermediate opacity values are used for smooth transitions from transparent to opaque regions, and for effects such as semi-transparent voxels which should not completely occlude objects behind them.

VolPack provides a classification method based on lookup tables. To use this method you specify a transfer function which maps the scalar data in a particular array element into the opacity for that element. Alternatively you can implement other classification techniques such as context-sensitive segmentation and then provide VolPack with a pre-classified volume.

The second rendering stage is to assign a color to each voxel, an operation which is called shading (or more precisely, lighting). VolPack includes support for the standard Phong shading equation. To use this shading technique, the volume data is preprocessed before rendering in order to compute a gradient vector for each voxel. The gradient vector can then be used as a pseudo surface normal to compute how light reflects off of each voxel. The user specifies the position and color of one or more light sources, and the reflective properties of the volume data. See Computer Graphics: Principles and Practice (Chapter 16, 2nd ed.), by Foley, van Dam, Feiner and Hughes, for a detailed discussion of the Phong shading equation. Alternative shading models can be implemented through a callback function.

The third rendering stage is to specify a view transformation and to transform the volume accordingly. This step can be as simple as choosing the position from which to look at the volume, or it can include an arbitrary affine transformation of the volume including non-uniform scaling and shearing. The view transformation also specifies how the volume is projected onto a 2D image plane.

The fourth and final rendering stage is to composite the voxels into an image. Digital compositing is analogous to the compositing process used in the film industry: several layers of semi-transparent film are merged together into a final image. VolPack provides several rendering algorithms that use different techniques to accelerate the compositing stage. The next subsection briefly describes the available algorithms.

Data Structures and Rendering Algorithms

VolPack includes three rendering algorithms which are useful in different situations. The algorithms differ in the degree to which they trade flexibility for speed and in the type of preprocessing required before rendering.

The fastest algorithm allows the user to rapidly render a volume with any view transformation and with any shading parameters while keeping the classification fixed. This algorithm relies on a special data structure which contains run-length encoded, classified volume data. Depending on the volume size it can take several minutes to precompute the run-length encoded volume, so this algorithm is most suitable when many renderings will be made from the same volume without changing the classification.

The steps when using this algorithm to render a classified volume are:

  • load the volume data
  • choose the classification function
  • precompute the classified volume
  • repeat:
    • set the view and shading parameters
    • render with vpRenderClassifiedVolume()

The second algorithm is useful in situations where the classification will be adjusted frequently. It also relies on a special data structure: a min-max octree which contains the minimum and maximum values of each voxel field. This data structure must be computed once when a new volume is acquired. The volume can then be rendered multiple times with any opacity transfer function, any view transformation and any shading parameters.

The steps when using this algorithm to render an unclassified volume are:

  • load the volume data
  • precompute the min-max octree with vpCreateMinMaxOctree()
  • repeat:
    • choose the classification function
    • set the view and shading parameters
    • render with vpRenderRawVolume()

Finally, the third algorithm does not use any precomputed data structures. In most cases it is significantly slower than the other two algorithms and is useful only if you wish to make a single rendering from a volume. The steps for using this algorithm are identical to the previous algorithm except that there is no need to compute the min-max octree.

Section 2: Using VolPack

This section describes how to use the routines provided by VolPack. For more specific information about a particular routine, consult the man pages provided with the library.

Include Files and Libraries

All of the definitions needed by a program which uses VolPack are included in the header file volpack.h. The program must be compiled with the VolPack library by including the switch -lvolpack on the compilation command line. Other useful free libraries you may wish to use are John Ousterhout's Tcl/Tk libraries to build a graphical user interface, and Jef Poskanzer's pbmplus library or Sam Leffler's TIFF library to store images.

The header file defines the following data types:

  • vpContext: a rendering context.
  • vpResult: a result code.
  • vpVector3: a three-element double-precision vector.
  • vpVector4: a four-element double-precision vector.
  • vpMatrix3: a three-by-three double-precision matrix.
  • vpMatrix4: a four-by-four double-precision matrix.

Rendering Contexts

The first argument of most of the routines in the VolPack library is a rendering context, declared as a variable of type vpContext. A rendering context contains all of the information required to render a volume, including the classification and shading parameters, the view transformation, a description of the format of the volume, and private data structures used by the rendering routines. The contents of a rendering context are not directly accessible to the application programmer; instead, you use the routines provided by the library to set, modify and query the state in a context. A program can have multiple active contexts, for instance to render different volumes or to render the same volume with different parameters simultaneously.

To create a new context, use vpCreateContext():

    vpContext *vpCreateContext();
The return value is a pointer to the new context. It contains default values for most of the rendering parameters, but you can change all of them with the routines described later in this section.

To destroy a context and free the memory associated with it, use vpDestroyContext():

    void vpDestroyContext(vpContext *vpc);

Volumes

A volume is simply a 3D array of data. The type of data can be almost anything, but if you choose to use the classification and shading routines provided by VolPack then you must supply the fields these routines require. You may also wish to precompute information required by your shader or classifier and store it in the voxel. Here is an example layout for a voxel:
    typedef unsigned char Scalar;
    typedef unsigned short Normal;
    typedef unsigned char Gradient;
    typedef struct {
        Normal normal;
        Scalar scalar;
        Gradient gradient;
    } Voxel;
In this example the data stored in a voxel includes an 8-bit scalar value and two precomputed fields. The first precomputed field is a surface normal vector encoded in a 16-bit field; this field is used by VolPack's shading routines. The second precomputed field is the gradient-magnitude of the scalar value; this field can be used for detecting surface boundaries during classification, for instance.

Note that the structure fields have been specified in the voxel structure in a very particular order. Many machines have alignment restrictions which require two-byte quantities to be aligned to two-byte boundaries, four-byte quantities to be aligned to four-byte boundaries, and so on. The compiler may have to insert wasted space in between fields to satisfy these requirements if you are not careful. Use the sizeof() operator to make sure the size of the voxel matches your expectations.

You should also place the fields which are required for shading first, followed by any other fields used only for classification. Ordering the fields this way makes it possible to store just the fields for shading when a classified volume is created for the fast rendering algorithm. This saves memory and improves cache performance.

Once you have decided on the format of your volume you must describe it to VolPack. To set the dimensions of the volume use vpSetVolumeSize:

    vpResult
    vpSetVolumeSize(vpContext *vpc, int xlen, int ylen, int zlen);
The first argument is the context whose state you wish to modify, and the remaining arguments are the number of elements in each dimension of the 3D volume array. The return value is a result code (type vpResult, which is an integer). The value VP_OK means the arguments are valid and the routine completed successfully. Other values indicate the type of error which occurred. See the man pages for the specific types of errors which can occur for each routine, or see the list of error codes in the Result Codes and Error Handling section.

Use vpSetVoxelSize() to declare the size of the voxel and the number of fields it contains:

    vpResult
    vpSetVoxelSize(vpContext *vpc, int bytes_per_voxel,
                   int num_voxel_fields, int num_shade_fields,
                   int num_classify_fields);
Bytes_per_voxel is the total size of a voxel in bytes. Num_voxel_fields is the number of fields in the voxel. Num_shade_fields is the number of fields required for shading. Num_classify_fields is the number of fields required for classification. The return value is a result code.

Continuing the earlier example, use the following call:

    #define NUM_FIELDS          3
    #define NUM_SHADE_FIELDS    2
    #define NUM_CLASSIFY_FIELDS 2
    vpSetVoxelSize(vpc, sizeof(Voxel), NUM_FIELDS, NUM_SHADE_FIELDS,
                   NUM_CLASSIFY_FIELDS);

Now call vpSetVoxelField() and the vpFieldOffset() macro once for each field to declare its size and position in the voxel:

    int
    vpFieldOffset(void *voxel_ptr, field_name);

    vpResult
    vpSetVoxelField(vpContext *vpc, int field_num, int field_size,
                    int field_offset, int field_max);
Voxel_ptr is a pointer to a dummy variable of the same type as your voxel, and field_name is the name of the voxel field. The return value of the macro is the byte offset of the field from the beginning of the voxel. Field_num is the ordinal index of the voxel field you are declaring, starting with 0 for the first field. Field_size is the size of the field in bytes. Use the sizeof() operator (e.g. sizeof(voxel_ptr->field_name)). Field_offset is the byte offset returned by vpFieldOffset(). Field_max is the maximum value of the quantity stored in the field. The return value is a result code.

Strictly speaking, the vpSetVoxelField() procedure must be called only for voxel fields which will be used by the VolPack classifier and shader. However, if you declare the other fields too then VolPack can automatically convert volumes that were created on machines with a different byte ordering. Only fields with size 1, 2 or 4 bytes can be declared with vpSetVoxelField().

For the example voxel layout, make the following calls:

    #define NORM_FIELD  0
    #define NORM_MAX    VP_NORM_MAX
    #define SCALAR_FIELD  1
    #define SCALAR_MAX    255
    #define GRAD_FIELD    2
    #define GRAD_MAX      VP_GRAD_MAX
    Voxel *dummy_voxel;
    vpSetVoxelField(vpc, NORM_FIELD, sizeof(dummy_voxel->normal),
                    vpFieldOffset(dummy_voxel, normal), NORM_MAX);
    vpSetVoxelField(vpc, SCALAR_FIELD, sizeof(dummy_voxel->scalar),
                    vpFieldOffset(dummy_voxel, scalar), SCALAR_MAX);
    vpSetVoxelField(vpc, GRAD_FIELD, sizeof(dummy_voxel->gradient),
                    vpFieldOffset(dummy_voxel, gradient), GRAD_MAX);
The constants VP_NORM_MAX and VP_GRAD_MAX are predefined by VolPack. In this example these fields will be computed using standard routines provided by the library.

To specify the volume data itself, use SetRawVoxels():

    vpResult
    vpSetRawVoxels(vpContext *vpc, void *voxels, int size,
                   int xstride, int ystride, int zstride);
Voxels is a pointer to the voxel data. Size is the number of bytes of voxel data. The remaining arguments are the strides in bytes for each of the three dimensions of the volume. For instance, xstride is the byte offset from the beginning of one voxel to the beginning of the next voxel along the x axis. Some of the VolPack routines operate faster if the volume is stored in z-major order (xstride < ystride < zstride), but it is not strictly necessary. If voxels is a pointer to dynamically allocated storage then the caller is responsible for freeing the memory at the appropriate time. VolPack does not free the voxel array when a context is destroyed. The data in the voxel array may be initialized or modified at any time, before or after calling vpSetRawVoxels.

Our running example continues as follows:

    Voxel *volume;
    unsigned size;
    #define VOLUME_XLEN    256
    #define VOLUME_YLEN    256
    #define VOLUME_ZLEN    256
    size = VOLUME_XLEN * VOLUME_YLEN * VOLUME_ZLEN * sizeof(Voxel);
    volume = malloc(size);
    vpSetRawVoxels(vpc, volume, size, sizeof(Voxel),
                   VOLUME_XLEN * sizeof(Voxel),
                   VOLUME_YLEN * VOLUME_XLEN * sizeof(Voxel));

VolPack provides a number of routines to help initialize some of the fields of the volume. If your input data consists of a three-dimensional array of 8-bit values and you wish to compute gradient-magnitude data or encoded normal vectors, then you can use vpVolumeNormals():

    vpResult
    vpVolumeNormals(vpContext *vpc, unsigned char *scalars,
                    int size, int scalar_field,
                    int gradient_field, int normal_field);
Scalars is a pointer to the array of 8-bit values. Size is the size of the array in bytes. It must equal the number of voxels in the volume as previously specified with vpSetVolumeSize(). Scalar_field, gradient_field and normal_field are the voxel field numbers in which to store the scalar values from the array, the gradient-magnitudes of the scalar values, and the encoded surface normals respectively. Any of these field numbers may be equal to the constant VP_SKIP_FIELD if that item should not be stored in the volume. This function computes the specified fields and loads them into the volume array last specified with vpSetRawVolume().

In our example, we can initialize the volume array as follows:

    unsigned char *scalars;
    scalars = LoadScalarData();
    vpVolumeNormals(vpc, scalars, VOLUME_XLEN*VOLUME_YLEN*VOLUME_ZLEN,
                    SCALAR_FIELD, GRAD_FIELD, NORM_FIELD);
LoadScalarData() might be a routine to load volume data from a file.

If your volume is large it may be inefficient to load all of the scalar data into one array and then copy it to the volume array. If this is the case then you can use vpScanlineNormals() to compute one scanline of the volume at a time:

    vpResult
    vpScanlineNormals(vpContext *vpc, int size,
                      unsigned char *scalars,
                      unsigned char *scalars_minus_y,
                      unsigned char *scalars_plus_y,
                      unsigned char *scalars_minus_z,
                      unsigned char *scalars_plus_z,
                      void *voxel_scan, int scalar_field,
                      int gradient_field, int normal_field);
Size is the length in bytes of one scanline of scalar data (which should equal the x dimension of the volume). Scalars points to the beginning of one scanline of scalars. Scalars_minus_y and scalars_plus_y point to the beginning of the previous and next scanlines in the y dimension, respectively. Similarly, scalars_minus_z and scalars_plus_z point to the beginning of the previous and next scanlines in the z dimension. These last four scanlines are the immediately-adjacent neighbors of the first scanline and are used to compute the gradient and surface normal vector. The next argument, voxel_scan, points to the scanline of the voxel array to write the result data into. The last three arguments are the voxel fields to write each type of data into and are identical to the corresponding arguments to vpVolumeNormals(). You can use vpScanlineNormals() in a loop which reads in the scalar data slice-by-slice, keeping at most three slices of data in memory at a time (in addition to the entire volume).

If you wish to compute normal vectors yourself but you still want to use the shading routines provided by VolPack, you can use vpNormalIndex() to encode a vector into the form expected by the shaders:

    int vpNormalIndex(double nx, double ny, double nz);
The arguments are the components of the normal vector, which must be normalized (nx*nx + ny*ny + nz*nz == 1), and the return value is the 16-bit encoded normal. A routine is also provided to decode normals:
    vpResult
    vpNormal(int n, double *nx, double *ny, double *nz);
The encoded normal given by n is decoded, and the normal vector components are stored in the locations specified by the remaining arguments.

Classification

The classification routines provided by VolPack allow you to customize the opacity transfer function by specifying a collection of lookup tables. Each lookup table is associated with one voxel field. To classify a voxel, VolPack uses the value in each of the specified fields of the voxel to index the corresponding tables. The table values are then multiplied together to get the opacity of the voxel. The tables should contain numbers in the range 0.0-1.0 so that the final opacity is also in that range.

A lookup table is specified with vpSetClassifierTable():

    vpResult
    vpSetClassifierTable(vpContext *vpc, int param_num, int param_field,
                         float *table, int table_size);
Param_num is the parameter number associated with the table you are declaring. The total number of tables must equal the num_classify_fields argument to vpSetVoxelSize(). The first table is numbered 0. Param_field is the number of the voxel field which should be used to index the table. Table is a pointer to the lookup table itself, and table_size is the size of the table in bytes (not the number of entries!) Note that even if table is dynamically allocated it is never deallocated by VolPack, even if the rendering context is destroyed. The data in the table may be initialized or modified at any time, before or after calling vpSetClassifierTable.

We could declare a two-parameter classifier for our example using the following calls:

    float scalar_table[SCALAR_MAX+1];
    float gradient_table[GRAD_MAX+1];
    vpSetClassifierTable(vpc, 0, SCALAR_FIELD, scalar_table,
                         sizeof(scalar_table));
    vpSetClassifierTable(vpc, 0, GRAD_FIELD, gradient_table,
                         sizeof(gradient_table));

VolPack provides a useful utility routine for initializing classification tables with piecewise linear ramps:

    vpResult
    vpRamp(float array[], int stride, int num_points,
           int ramp_x[], float ramp_y[]);
Array is the table to be initialized. Stride is the number of bytes from the start of one array element to the start of the next (useful if there are other fields in the array which you want to skip over). Num_points is the number of endpoints of the piecewise linear segments. Ramp_x is an array of x coordinates (table indices), and ramp_y is an array of y coordinates (values to store in the array). vpRamp linearly-interpolates values for the table entries in between the specified x coordinates.

For example, we can initialize our two classification tables as follows:

    #define SCALAR_RAMP_POINTS 3
    int scalar_ramp_x[] =    {  0,  24, 255};
    float scalar_ramp_y[] =  {0.0, 1.0, 1.0};
    vpRamp(scalar_table, sizeof(float), SCALAR_RAMP_POINTS,
           scalar_ramp_x, scalar_ramp_y);

    #define GRAD_RAMP_POINTS 4
    int grad_ramp_x[] =   {  0,   5,  20, 221};
    float grad_ramp_y[] = {0.0, 0.0, 1.0, 1.0};
    vpRamp(gradient_table, sizeof(float), GRAD_RAMP_POINTS,
           grad_ramp_x, grad_ramp_y);

If you wish to use an alternative classification algorithm instead of the lookup-table classifier then you should store the voxel opacities you compute in one of the fields of the voxel and define a lookup table which converts the values in that field into floating-point numbers. For instance, define a 1-byte opacity field which contains values in the range 0-255, and declare a lookup table with a linear ramp mapping those numbers to the range 0.0-1.0.

In addition to setting the classification function, you should also set the minimum opacity threshold with vpSeti. This threshold is used to discard voxels which are so transparent that they do not contribute significantly to the image. The higher the threshold, the faster the rendering algorithms. For example, to discard voxels which are at most 5% opaque, use the following:

    vpSeti(vpc, VP_MIN_VOXEL_OPACITY, 0.05);

Classified Volumes

The fastest rendering algorithm provided by VolPack uses a run-length encoded volume data structure which must be computed before rendering. Three routines are provided to compute this data structure. Remember to set the opacity transfer function and the minimum voxel opacity before calling the functions in this subsection.

If you have already constructed an unclassified volume and defined the classification function as described in the previous subsections then use vpClassifyVolume():

    vpResult
    vpClassifyVolume(vpContext *vpc);
This routine reads data from the currently-defined volume array, classifies it using the current classifier, and then stores it in run-length encoded form in the rendering context. The volume array is not modified or deallocated.

If you wish to load an array of 8-bit scalars and compute a classified volume directly without building an unclassified volume, then use vpClassifyScalars():

    vpResult
    vpClassifyScalars(vpContext *vpc, unsigned char *scalars,
                      int size, int scalar_field,
                      int gradient_field, int normal_field);
The arguments to this routine are identical to those for vpVolumeNormals() described above. The difference between the two routines is that vpClassifyScalars() stores the result as a classified, run-length encoded volume instead of as an unclassified volume. The volume size, voxel size, voxel fields, and classifier must all be declared before calling this routine, but there is no need to call vpSetRawVoxels().

If you wish to classify one scanline of voxel data at a time instead of loading the entire array of scalar data at once then use vpClassifyScanline():

    vpResult
    vpClassifyScanline(vpContext *vpc, void *voxel_scan);
Voxel_scan is a pointer to one scanline of voxel data, in the same format as the full unclassified volume. You could, for instance, use vpScanlineNormals() to compute the fields of the scanline before passing it to vpClassifyScanline(). Each call to this routine appends one new scanline to the current classified volume. Out-of-order calls are not possible, and the volume cannot be rendered until all of the scanlines have been loaded.

Only one classified volume may be stored in a rendering context at a time. If you start classifying a new volume, any old classified volume data is deallocated. You can also force the current classified volume to be deallocated with vpDestroyClassifiedVolume():

    vpResult
    vpDestroyClassifiedVolume(vpContext *vpc);
Note that if you change the contents of the unclassified volume array and you wish the classified volume to reflect those changes then you must call one of the routines in this section to recompute the classified volume.

Min-Max Octrees

A min-max octree is a hierarchical data structure which contains minimum and maximum values for each field used to index the classification tables. This data structure can be used to accelerate rendering unclassified volumes, and it can also accelerate the computation of a classified volume from an unclassified volume.

To compute a min-max octree, first define an unclassified volume with vpSetVolumeSize(), vpSetVoxelSize(), vpSetVoxelField(), and vpSetRawVoxels(). Also be sure to initialize the volume data. Now for each classification table make one call to vpMinMaxOctreeThreshold():

    vpResult
    vpMinMaxOctreeThreshold(vpContext *vpc, int param_num, int range);
Param_num is the same parameter number you passed to vpSetClassifierTable(). Range is a range of table indices for this parameter which you consider to be "small". The opacity of a voxel should not vary much if the table index is changed by the amount specified in range. Choosing a value which is too small or too large may result in a reduced performance benefit during rendering. You may wish to experiment, but the octree should improve performance even if you don't use the optimum range value. You can use the routine vpOctreeMask() to visualize the effectiveness of the octree (see the man pages).

To compute the octree, call vpCreateMinMaxOctree():

    vpResult
    vpCreateMinMaxOctree(vpContext *vpc, int root_node_size,
                         int base_node_size);
Root_node_size is currently not used but is reserved for future use. Base_node_size specifies the size in voxels of one side of the smallest node in the octree. The smaller the value, the better the resolution of the data structure at the expense of an increase in size. A value of 4 is a good starting point. This routine reads the data in the unclassified volume array, computes an octree, and stores it in the rendering context.

Once the octree has been computed it will be used automatically whenever you call vpClassifyVolume() or vpRenderRawVolume(). If you change the data in the volume array you MUST call vpCreateMinMaxOctree to recompute the octree, or else your renderings will be incorrect. You can also destroy the octree by calling vpDestroyMinMaxOctree():

    vpResult
    vpDestroyMinMaxOctree(vpContext *vpc);

View Transformations

VolPack maintains four transformation matrices: a modeling transform, a viewing transform, a projection transform, and a viewport transform. The primary use of these matrices is to specify a transformation from the volume data's coordinate system to the image coordinate system. However, they also affect light direction vectors (and in future releases of the library they will affect the positioning of clipping planes and polygon primitives).

There are five coordinate systems implied by the transformation matrices: object coordinates, world coordinates, eye coordinates, clip coordinates, and image coordinates. In the object coordinate system the volume is entirely contained in a unit cube centered at the origin. The modeling transform is an affine transform which converts object coordinates into world coordinates. The modeling transform is also applied to light direction vectors to transform them to world coordinates. The view transform is an affine transform that converts world coordinates into eye coordinates. In eye coordinates the viewer is looking down the -Z axis. The view transform is typically used to specify the position of the viewer in the world coordinate system. The projection transform converts eye coordinates into clip coordinates. This transform may specify a perspective or a parallel projection, although perspective rendering is not yet supported. Finally, the viewport transform converts the clip coordinate system into image coordinates.

VolPack provides a number of routines to change the modeling matrix, viewing matrix and the projection matrix. First, use vpCurrentMatrix() to select the matrix you wish to modify:

    vpResult
    vpCurrentMatrix(vpContext *vpc, int option);
Option is one of the constants VP_MODEL, VP_VIEW or VP_PROJECT. Now use the following functions to modify the matrix contents (see the man pages for specifics):
vpIdentityMatrix(vpContext *vpc)
Load the identity matrix into the current transformation matrix.
vpTranslate(vpContext *vpc, double tx, double ty, double tz)
Multiply the current transformation matrix by a translation matrix.
vpRotate(vpContext *vpc, int axis, double degrees)
Multiply the current transformation matrix by a rotation matrix. Axis is one of the constants VP_X_AXIS, VP_Y_AXIS or VP_Z_AXIS.
vpScale(vpContext *vpc, double sx, double sy, double sz)
Multiply the current transformation matrix by a scaling matrix.
vpMultMatrix(vpContext *vpc, vpMatrix4 m)
Multiply the current transformation matrix by the given matrix.
vpSetMatrix(vpContext *vpc, vpMatrix4 m)
Load the given matrix into the current transformation matrix.
By default, all of the routines use post-multiplication. For instance, if the current modeling matrix is M and a rotation matrix R is applied, then the new transformation is M*R. If a light direction vector v is now specified (using commands discussed in the section on shading), it is transformed into M*R*v before it is stored in the current rendering context. If you prefer pre-multiplication of matrices then call vpSeti with the CONCAT_MODE argument. Note that vectors are always post-multiplied.

Two special routines are provided for creating projection matrices. These routines always store their result in the projection matrix, not the current matrix. The first is vpWindow():

    vpResult
    vpWindow(vpContext *vpc, int type, double left, double right,
             double bottom, double top, double near, double far);
Type must be the constant VP_PARALLEL to specify a parallel projection. In a future release perspective projections will be allowed. The remaining arguments specify the left, right, bottom, top, near, and far coordinates of the planes bounding the view volume in eye coordinates. This routine works just like the glFrustum() and glOrtho() routines in OpenGL.

The second routine for creating a projection matrix uses the PHIGS viewing model:

    vpResult
    vpWindowPHIGS(vpContext *vpc, vpVector3 vrp, vpVector3 vpn,
             vpVector3 vup, vpVector3 prp, double viewport_umin,
             double viewport_umax, double viewport_vmin,
             double viewport_vmax, double viewport_front,
             double viewport_back, int type);
Vrp is the view reference point, vpn is the view plane normal, vup is the view up vector, prp is the projection reference point, the next six arguments are the bounds of the viewing volume in view reference coordinates, and type is the constant VP_PARALLEL to specify a parallel projection. Since these parameters specify a viewpoint as well as a viewing volume, typically the view matrix contains the identity. See Computer Graphics: Principles and Practice (Chapter 6, 2nd ed.), by Foley, van Dam, Feiner and Hughes for a complete discussion of the PHIGS viewing model.

The viewport transform is set automatically when you set the size of the image, which is discussed in the next subsection.

Here is an example showing all the steps to set the view transformation:

    vpCurrentMatrix(vpc, VP_MODEL);
    vpIdentityMatrix(vpc);
    vpRotate(vpc, VP_X_AXIS, 90.0);
    vpRotate(vpc, VP_Y_AXIS, 23.0);
    vpCurrentMatrix(vpc, VP_VIEW);
    vpIdentityMatrix(vpc);
    vpTranslate(vpc, 0.1, 0.0, 0.0);
    vpCurrentMatrix(vpc, VP_PROJECT);
    vpWindow(vpc, VP_PARALLEL, -0.5, 0.5, -0.5, 0.5, -0.5, 0.5);

Note that light direction vectors are transformed according to the modeling matrix in effect at the time of the call to vpSetLight, and volumes are transformed according to the modeling matrix in effect at the time of rendering. The same viewing, projection and viewport transforms are applied to everything at the time of rendering.

Shading and Lighting

VolPack supports two shading methods: shading via lookup tables, and shading via callback functions. In addition, routines are provided to initialize shading tables for the Phong illumination model.

The built-in routines are designed to support the multiple-material voxel model described in Volume Rendering by Drebin, Carpenter and Hanrahan in Proceedings of SIGGRAPH 88. Each voxel is assumed to contain a mixture of basic material types. Each material type has its own shading parameters, such as color and shinyness. The color of a voxel is found by computing a color for each material type and then combining the colors in proportion to the fraction of each material in the voxel.

This functionality is implemented by storing two table indices in each voxel and using two lookup tables. One voxel field must contain an encoded surface normal vector as computed by vpNormalIndex(). This field is used to index a table which contains a color for each of the material types. The actual colors retrieved from the table depend on the surface normal, so directional lights can be implemented by storing appropriate values in the table. The second voxel field contains a value which is used to index the second table. Each row of the second table contains a fractional occupancy for each material type. These fractional occupancies are used as weights to determine the relative strength of each color retrieved from the first table.

To declare a lookup-table shader, use vpSetLookupShader():

    vpResult
    vpSetLookupShader(vpContext *vpc, int color_channels,
                      int num_materials, int color_field,
                      float *color_table, int color_table_size,
                      int weight_field,
                      float *weight_table, int weight_table_size);
Color_channels is 1 for grayscale renderings or 3 for color (RGB) renderings. Num_materials is the number of material types. Color_field is the voxel field number for the color lookup table index. Color_table is the corresponding lookup table, and color_table_size is the size of the table in bytes. Weight_field, weight_table and weight_table_size are the field number, lookup table and table size for the second table which contains weights for each material type. The color table must be an array with the following dimensions:
    float color_table[n][num_materials][color_channels];
where n is the number of possible values for the color field. The colors are values in the range 0.0-1.0 (zero intensity to full intensity). The weight table must be an array with the following dimensions:
    float weight_table[m][num_materials];
where m is the number of possible values for the weight field. Weights are in the range 0.0-1.0. If there is only one material type then the weight table is not used and the corresponding parameters may be set to 0.

Returning to our example, the following code declares an RGB shader with two material types:

    #define COLOR_CHANNELS   3
    #define MATERIALS        2
    float color_table[NORM_MAX+1][MATERIALS][COLOR_CHANNELS];
    float weight_table[SCALAR_MAX+1][MATERIALS];
    vpSetLookupShader(vpc, COLOR_CHANNELS, MATERIALS,
                      NORM_FIELD, color_table, sizeof(color_table),
                      SCALAR_FIELD, weight_table, sizeof(weight_table));

The weight table can be initialized using the vpRamp() function previously described, or using a loop which fills in values in whatever way you choose. To initialize the color table, VolPack provides a routine called vpShadeTable(). Before calling the routine you must set the lighting and shading parameters as follows.

To set the lighting parameters, use vpSetLight():

    vpResult
    vpSetLight(vpContext *vpc, int light_num, int property,
               double n0, double n1, double n2);
Light_num is one of the constants VP_LIGHT0, VP_LIGHT1, ..., VP_LIGHT5 and indicates which of the six light sources you wish to adjust. Property is either VP_COLOR or VP_DIRECTION. For VP_COLOR the remaining three arguments are the RGB components of the light color, in the range 0.0-1.0. For VP_DIRECTION the remaining three arguments are the x, y and z components of the direction of the light source. This vector is transformed by the current modeling matrix before it is stored in the rendering context (see View Transformations). You must also call vpEnable() to enable the light. By default, light 0 is enabled and all others are disabled.

For example, to create a cyan light coming from above the viewer's right shoulder, use the following:

    vpSetLight(vpc, VP_LIGHT1, VP_COLOR,      0.0,  1.0,  1.0);
    vpSetLight(vpc, VP_LIGHT1, VP_DIRECTION, -0.6,  0.6,  1.0);
    vpEnable(vpc, VP_LIGHT1, 1);

You can also select "two-sided" lights using vpEnable() with the VP_LIGHT_BOTH_SIDES option. Under this lighting model each directional light shines in two directions, both in the specified direction and in the opposite direction.

To set the material parameters for a particular material type, call vpSetMaterial():

    vpResult
    vpSetMaterial(vpContext *vpc, int material_num, int property,
                  int surface_side, double r, double g, double b);
Material_num is one of the constants VP_MATERIAL0, VP_MATERIAL1, ..., VP_MATERIAL5 and indicates which material you wish to adjust. Property is one of the following:
VP_AMBIENT
Set the R, G and B ambient light reflection coefficients.
VP_DIFFUSE
Set the R, G and B diffuse light reflection coefficients.
VP_SPECULAR
Set the R, G and B specular light reflection coefficients.
VP_SHINYNESS
Set the specular exponent. The g and b arguments are not used.
Surface_side is either VP_EXTERIOR, VP_INTERIOR, or VP_BOTH_SIDES. In the first case the parameters will only affect voxels on the "exterior" side of a surface, which by default means that the voxel's gradient points towards the viewer (you can use vpEnable() with the VP_REVERSE_SURFACE_SIDES option to reverse the meaning of exterior and interior). In the second case the parameters will only affect voxels whose gradient points away from the viewer. In the third case, all voxels are affected.

Here is an example which sets surface 0 to reflect red and green ambient and diffuse light, and to have fairly strong specular highlights which retain the color of the light source:

    vpSetMaterial(vpc, VP_MATERIAL0, VP_AMBIENT,
                  VP_BOTHSIDES, 0.1, 0.1, 0.0);
    vpSetMaterial(vpc, VP_MATERIAL0, VP_DIFFUSE,
                  VP_BOTHSIDES, 0.4, 0.4, 0.0);
    vpSetMaterial(vpc, VP_MATERIAL0, VP_SPECULAR,
                  VP_BOTHSIDES, 0.5, 0.5, 0.5);
    vpSetMaterial(vpc, VP_MATERIAL0, VP_SHINYNESS,
                  VP_BOTHSIDES, 10.0, 0.0, 0.0);

Now that all of the lighting and shading parameters have been set, the color lookup table has been declared with vpSetLookupShader(), and the viewing parameters have been set, you can call vpShadeTable() to recompute the entries of the lookup table:

    vpResult
    vpShadeTable(vpContext *vpc);
This routine computes all of the entries in the currently-defined color table using the current lighting and material parameters and the current view transformation. You should call vpShadeTable() after any changes to the shading or viewing parameters, but before calling any of the rendering routines.

If you wish to use some other shading model you have two options. One approach is to create your own routine to initialize the shading lookup tables. If you take this approach then you may define tables of any size (there is no need to use VolPack's encoded normal vectors). For example, you could use a color transfer function which assigns a unique color to each possible value of the scalar field in your volume. The second option is to define a callback routine which will be called to shade each voxel during rendering. You do so by calling vpSetCallback() instead of vpSetLookupShader(). For example, to declare a grayscale shading callback function use the following call:

    void myshader();
    vpSetCallback(vpc, VP_GRAY_SHADE_FUNC, myshader);
The function myshader() can do whatever you like to compute a color. See the man page for vpSetCallback() for more details. Using callback functions can lead to significant performance degradation during rendering.

There is one more shading option which is independent of the shading model you choose: depth cueing. Depth cueing allows you to introduce black "fog" which makes more distant voxels appear darker then voxels which are close to the viewer, thereby making it easier to distinguish foreground objects from background objects. To enable depth cueing call vpEnable():

    vpEnable(vpc, VP_DEPTH_CUE, 1);
You can use vpSetDepthCueing() to change the depth cueing parameters:
    vpResult
    vpSetDepthCueing(vpContext *vpc, double front_factor,
                     double density);
Front_factor is the transparency of the fog at the front plane of the viewing volume. It must be a positive number and it is usually less than 1.0 (although larger numbers can be used to brighten the foreground). Density controls the "density" of the fog, or how rapidly objects recede into darkness. The equation for the transparency of the fog is:
T = front_factor * exp(-density * depth)
where "depth" is 0 at the front plane of the viewing volume and 1 at the back plane. Each voxel color component is multiplied by the fog transparency during rendering.

VolPack also supports a fast one-pass shadow algorithm implemented with lookup tables (in a similar fashion to the procedure described above). See the man page for vpSetShadowLookupShader.

Images

The last step before rendering is to declare the array that VolPack should store the image into. Use vpSetImage:
    vpResult
    vpSetImage(vpContext *vpc, unsigned char *image, int width,
               int height, int bytes_per_scan, int pixel_type);
Image is a pointer to the array for the image. The next two arguments are the size of the image. These arguments also implicitly determine the viewport transformation: the clip coordinates are scaled to make the left, right, top and bottom planes of the viewing volume align with the sides of the image. The next argument is the number of bytes in one scanline of the image. This argument can be used to add padding to the end of each scanline in case the image display routines on your system impose alignment restrictions on the beginning of each scanline. Finally, the last argument is a code that specifies the format of the pixels in the image. The following formats are allowed:
VP_ALPHA
opacity (1 byte/pixel)
VP_LUMINANCE
grayscale color (1 byte/pixel)
VP_LUMINANCEA
grayscale color plus opacity (2 bytes/pixel)
VP_RGB
RGB color (3 bytes/pixel)
VP_RGBA
RGB color plus opacity (4 bytes/pixel)
VP_BGR
RGB color, byte-swapped (3 bytes/pixel)
VP_ABGR
RGB color plus opacity, bytes-swapped (4 bytes/pixel)
Use the luminance formats only with grayscale shaders, and the RGB formats only with color shaders. The image should have dimensions:
    unsigned char image[bytes_per_scan][height][bytes_per_pixel];
where bytes_per_pixel is the size of the pixel as determined by the pixel format.

Rendering

VolPack provides two rendering routines. The first routine is used to render pre-classified volumes which are created with the routines in the Classified Volumes subsection:
    vpResult
    vpRenderClassifiedVolume(vpContext *vpc);
This routine uses the current viewing and shading parameters to render the classified volume stored in the rendering context. The result is placed in the image buffer declared with vpSetImage().

The second routine is used to render unclassified volumes which are created with the routines in the Volumes subsection:

    vpResult
    vpRenderRawVolume(vpContext *vpc);
This routine is identical to vpRenderClassifiedVolume() except that the source of the volume data is the raw volume data stored in the rendering context, and the volume data is classified on-the-fly during rendering. If a min-max octree data structure is present in the rendering context then it is used to accelerate rendering. However, even with the octree this routine is slower than vpRenderClassifiedVolume() because of the additional work which must be performed.

There is one important state variable which can be used to improve rendering performance: the maximum ray opacity threshold. During compositing, if the opacity of an image pixel reaches this threshold then no more voxel data is composited into the pixel. The threshold should be a number slightly less than one (0.95 is a good value), so that there is very little image degradation but voxels which do not make a significant contribution to the image can be skipped. You set the threshold with vpSetd() and the VP_MAX_RAY_OPACITY option. For example:

    vpSetd(vpc, VP_MAX_RAY_OPACITY, 0.95);

State Variables

The previous subsections have described many routines which set state variables in a rendering context. This subsection briefly mentions the routines available to retrieve the values of these variables.

The function vpGeti() is used to retrieve integer state variables:

    vpResult
    vpGeti(vpContext *vpc, int option, int *iptr);
Option is a constant indicating the particular value you wish to get. The man page for vpGeti lists all of the options. The value is stored in the integer pointed to by iptr. As always, the return value of the routine is a result code (not the state variable value).

To retrieve floating-point state variables used vpGetd():

    vpResult
    vpGetd(vpContext *vpc, int option, double *dptr);
This routine stores its result in the double pointed to by dptr. To retrieve pointers (e.g. the current raw volume data pointer) use vpGetp:
    vpResult
    vpGetp(vpContext *vpc, int option, void **pptr);
Pptr is a pointer to a pointer, so the value of the state variable is stored in *ptr. To retrieve pointers to callback functions use vpGetCallBackp:
    vpResult
    vpGetCallBackp(vpContext* vpc, int option, void(**funcPtr)());
FuncPtr is a pointer to a pointer to a function. Transformation matrices can be retrieved with vpGetMatrix():
    vpResult
    vpGetMatrix(vpContext *vpc, int option, vpMatrix4 m);
The matrix values are stored in m.

Lighting and material parameters can be retrieved with vpGetLight() and vpGetMaterial() which have arguments which are similar to the corresponding functions to set these parameters.

Utility Functions

VolPack provides a small collection of convenient utility functions. First, there are routines to store volume data structures in files and load them back into a rendering context. They allow you to perform all of the time-consuming preprocessing steps once and save the results in a file. See the man pages for the following routines:
  • vpStoreRawVolume()
  • vpLoadRawVolume()
  • vpStoreClassifiedVolume()
  • vpLoadClassifiedVolume()
  • vpStoreMinMaxOctree()
  • vpLoadMinMaxOctree()

The routine vpExtract() allows you to extract a rectangular solid region from either the raw volume data or the classified volume data. You can extract individual fields of the volume (e.g. just the scalar data), or computed values (e.g. opacity computed with the current classification function).

The routine vpTranspose() allows you to transpose the raw volume data. This can be useful to improve rendering performance for very large volumes. You can use vpGeti with the VP_VIEW_AXIS option to determine how the volume should be transposed for optimum performance given the current viewing parameters.

The routine vpResample() allows you to scale a volume to a different resolution using a variety of resampling filters. It is useful for scaling very large volumes down to a smaller size for fast previewing, or to filter low-resolution data sets to a higher resolution with a high-quality filter before rendering.

Result Codes and Error Handling

Almost all of the routines in VolPack return a result of type vpResult which is an integer. Routines return the value VP_OK to indicate success. Any other value indicates an error. See the man page for each function for the possible error codes and their specific meanings.

When an error occurs VolPack also records the error code in the rendering context. You can retrieve the error code later by calling vpGetError(). If another error occurs before you call vpGetError() then only the first one is returned. The recorded value is then reset.

The routine vpGetErrorString() can be used to convert an error code into a printable string.

Section 3: Tips and Pointers

Maximizing Rendering Speed

There are several techniques to keep in mind to get the maximum possible performance out of VolPack. First of all, use the appropriate rendering algorithm for the task at hand. If you want to render a volume from several viewpoints without changing the classification function then it is well worth the time to preprocess the volume into the run-length encoded format before rendering. Use the min-max octree data structure if the classification function does change for every rendering but the volume data remains fixed.

Second, choose the various thresholds carefully. Changing the minimum opacity threshold for classification and the maximum ray opacity for rendering can have a big impact on rendering speed. Changing the parameter range thresholds for the min-max octree can also improve performance.

Third, minimize the need for reallocating internal data structures by predeclaring their sizes. Internal buffers are used to store an intermediate image during rendering and a depth cueing lookup table. The sizes of these tables can change as the viewing parameters change, so the tables may have to be reallocated over the course of a multi-frame rendering loop. You can give VolPack "hints" for the sizes of these data structures using vpSeti() with the VP_INT_WIDTH_HINT, VP_INT_HEIGHT_HINT and VP_DEPTH_CUE_SIZE_HINT options.

Finally, if you are using vpRenderRawVolume() with a large volume then you may need to transpose the volume as the viewing direction changes from one principal axis to another.

Maximizing Image Quality

There are two important techniques which will help you to produce images free from distracting aliasing artifacts. The first is to choose classification functions that are fairly smooth. Functions with discontinuities or very abrupt transitions introduce very sharp transitions in the classified volume, and these transitions may be too sharp to be properly sampled. The result can be jagged boundaries and spurious patterns in the rendered image. These artifacts may be difficult to distinguish from the information in the data set. To diagnose this problem, try extracting slices of classified volume data with vpExtract() and check if the opacity images contain a lot of aliasing. Smooth transitions will produce the best images.

The second technique is to prefilter the volume data with a high-quality filter before scaling or zooming, rather than using the viewing transformation to do the scaling. There are two reasons that prefiltering may help. The rendering routines use a simple bilinear reconstruction filter, but if you prefilter you can use a higher-quality filter which does a better job of reconstruction. Furthermore, the resolution of the rendered image is limited by the number of samples in the volume, so very large magnification factors produce visible aliasing artifacts. Upscaling the volume with a high-quality filter before rendering can solve this problem. Several utility routines, described in the vpResample() man page, are provided for prefiltering a volume.

Software Support

If you have problems, bug reports or bug fixes, please send mail to:
volpack@graphics.stanford.edu
The author makes no commitment to fix bugs or provide support. However, future releases with fixes and enhancements are planned.

If you wish to be informed of future updates to the software then you should subscribe to the volpack-announce mailing list. To do so, send an email message to

majordomo@lists.stanford.edu
with the following message body:
subscribe volpack-announce
To be removed from the list, send the message:
unsubscribe volpack-announce
Mail will be sent to the list only to announce bug fixes and new releases.

If you like the library then drop us a note describing what you use it for!

Obtaining the Software

VolPack is available from the Stanford Computer Graphics Laboratory's Web page (http://www-graphics.stanford.edu/software/volpack/#Distribution) or via anonymous ftp (ftp://www-graphics.stanford.edu/pub/volpack/).
Last update: 16 December 1994
volpack@graphics.stanford.edu
ccseapps-2.5/CCSEApps/volpack/doc/vp_userguide.ps0000644000175000017500000025003111634153073023131 0ustar amckinstryamckinstry%!PS-Adobe-1.0 %%Title: VolPack User's Guide %%DocumentFonts: Times-Roman Times-Bold Times-Italic Courier Courier-Bold Courier-Oblique %%Creator: NCSA Mosaic, Postscript by Ameet Raval & Frans van Hoesel %%Pages: (atend) %%EndComments save /D {def} def /E {exch} D /M {moveto} D /S {show} D /R {rmoveto} D /L {lineto} D /RL {rlineto} D /SQ {newpath 0 0 M 0 1 L 1 1 L 1 0 L closepath} D /U {gsave currentpoint currentfont /FontInfo get /UnderlinePosition get 0 E currentfont /FontMatrix get dtransform E pop add newpath moveto dup stringwidth rlineto stroke grestore S } D /B {/r E D gsave -13 0 R currentpoint newpath r 0 360 arc closepath fill grestore } D /OB {/r E D gsave -13 0 R currentpoint newpath r 0 360 arc closepath stroke grestore } D /NP {xmargin topmargin translate scalfac dup scale } D /HR {/l E D gsave l 0 RL stroke grestore } D /SF {E findfont E scalefont setfont } D /FF {/Courier } D /FB {/Courier-Bold } D /FI {/Courier-Oblique } D /RF {/Times-Roman} D /BF {/Times-Bold} D /IF {/Times-Italic} D /reencodeISO { dup dup findfont dup length dict begin { 1 index /FID ne { def }{ pop pop } ifelse } forall /Encoding ISOLatin1Encoding D currentdict end definefont } D /ISOLatin1Encoding [ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright /parenleft/parenright/asterisk/plus/comma/minus/period/slash /zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon /less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N /O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright /asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m /n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/dotlessi/grave/acute/circumflex/tilde/macron/breve /dotaccent/dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut /ogonek/caron/space/exclamdown/cent/sterling/currency/yen/brokenbar /section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot /hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior /acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine /guillemotright/onequarter/onehalf/threequarters/questiondown /Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla /Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute /Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis /aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave /iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex /otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis /yacute/thorn/ydieresis ] D [RF BF IF FF FB FI] {reencodeISO D} forall /xmargin 43 D /topmargin 720 D /scalfac 0.54351 D %%EndProlog %%Page: 1 1 save NP 0 -20 M BF 24 SF 0 -20 R (VolPack User's Guide)S 0 -48 M 0 -65 M IF 17 SF 0 -13 R (Version 2.0beta1)S RF 17 SF ( )S 0 -84 M 0 -101 M BF 18 SF 0 -15 R (Table of Contents)S 0 -122 M 0 -139 M RF 17 SF 0 -13 R (Section 1: Overview )S 76 -158 M 0 -13 R (1. )S (Introduction to VolPack )S 76 -177 M 0 -13 R (2. )S (The Volume Rendering Pipeline )S 76 -196 M 0 -13 R (3. )S (Data Structures and Rendering Algorithms )S 0 -215 M 0 -13 R (Section 2: Using VolPack )S 76 -234 M 0 -13 R (1. )S (Include Files and Libraries )S 76 -253 M 0 -13 R (2. )S (Rendering Contexts )S 76 -272 M 0 -13 R (3. )S (Volumes )S 76 -291 M 0 -13 R (4. )S (Classification )S 76 -310 M 0 -13 R (5. )S (Classified Volumes )S 76 -329 M 0 -13 R (6. )S (Min-Max Octrees )S 76 -348 M 0 -13 R (7. )S (View Transformations )S 76 -367 M 0 -13 R (8. )S (Shading and Lighting )S 76 -386 M 0 -13 R (9. )S (Images )S 68 -405 M 0 -13 R (10. )S (Rendering )S 68 -424 M 0 -13 R (11. )S (State Variables )S 68 -443 M 0 -13 R (12. )S (Utility Functions )S 68 -462 M 0 -13 R (13. )S (Result Codes and Error Handling )S 0 -481 M 0 -13 R (Section 3: Tips and Pointers )S 76 -500 M 0 -13 R (1. )S (Maximizing Rendering Speed )S 76 -519 M 0 -13 R (2. )S (Maximizing Image Quality )S 76 -538 M 0 -13 R (3. )S (Software Support )S 76 -557 M 0 -13 R (4. )S (Obtaining the Software )S 48 -576 M 0 -593 M BF 18 SF 0 -15 R (Section 1: Overview )S 0 -614 M 0 -631 M BF 17 SF 0 -14 R (Introduction to VolPack )S 0 -651 M 0 -668 M RF 17 SF 0 -13 R (VolPack is a portable software library for volume rendering. It is based on a new family of fast volume rendering)S 0 -687 M 0 -13 R (algorithms \(see )S (Philippe Lacroute )S (and )S (Marc Levoy )S (, )S IF 17 SF (Fast Volume Rendering Using a Shear-Warp Factorization of)S 0 -706 M 0 -13 R (the Viewing Transformation)S RF 17 SF (, Proc. SIGGRAPH '94 \(Orlando, Florida, July 24-29, 1994\). In Computer Graphics)S 0 -725 M 0 -13 R (Proceedings, Annual Conference Series, 1994, ACM SIGGRAPH, pp. 451-458\). The library has the following)S 0 -744 M 0 -13 R (features: )S 0 -763 M 48 -780 M 0 -9 R 3.454545 B 0 -4 R (Renders data sampled on a regular, three-dimensional grid. )S 48 -799 M 0 -9 R 3.454545 B 0 -4 R (Supports user-specified transfer functions for both opacity and color. )S 48 -818 M 0 -9 R 3.454545 B 0 -4 R (Provides a shading model with directional light sources, multiple material types with different reflective)S 48 -837 M 0 -13 R (properties, depth cueing, and shadows. )S 48 -856 M 0 -9 R 3.454545 B 0 -4 R (Produces color \(24 bits/pixel\) or grayscale \(8 bits/pixel\) renderings, with or without an alpha channel. )S 48 -875 M 0 -9 R 3.454545 B 0 -4 R (Supports arbitrary affine view transformations. )S 48 -894 M 0 -9 R 3.454545 B 0 -4 R (Supports a flexible data format that allows an arbitrary C structure to be associated with each grid point. )S 48 -913 M 0 -9 R 3.454545 B 0 -4 R (Achieves very fast rendering times without specialized hardware. )S 48 -932 M 0 -949 M 0 -13 R (The library is intended for use in C or C++ programs but may be useful with other programming languages. The)S 0 -968 M 0 -13 R (current implementation does not support perspective projections or clipping planes. These features will be added in a)S 0 -987 M 0 -13 R (future release. )S 0 -1006 M 0 -1023 M 0 -13 R (The remainder of this section contains a brief introduction to the conceptual volume rendering pipeline used by)S 0 -1042 M 0 -13 R (VolPack, followed by a high-level description of the data structures and algorithms used by the library. This)S 0 -1061 M 0 -13 R (background material lays the foundation for )S (Section 2)S ( which describes each of the routines provided by VolPack.)S 0 -1080 M 0 -13 R (The routines are grouped by function and are presented roughly in the order that they would be called in a typical)S 0 -1099 M 0 -13 R (application. More detailed descriptions of each command can be found by consulting the man pages for VolPack.)S 0 -1118 M 0 -13 R (Finally, )S (Section 3)S ( covers some tips for maximizing rendering performance and image quality, and describes how to)S 0 -1137 M 0 -13 R (obtain the VolPack software. )S 0 -1156 M 0 -1173 M BF 17 SF 0 -14 R (The Volume Rendering Pipeline )S 0 -1193 M 0 -1210 M RF 17 SF 0 -13 R (The input to the volume renderer is a three-dimensional array of data. Each element of the array is a C structure)S showpage restore %%Page: 2 2 save NP RF 17 SF 0 0 M 0 -13 R (containing any number of fields of data, such as tissue density or temperature. Each element is called a "voxel." The)S 0 -19 M 0 -13 R (first stage in the volume rendering pipeline is to )S IF 17 SF (classify)S RF 17 SF ( the volume data, which means to assign an opacity to each)S 0 -38 M 0 -13 R (voxel. Opacity is the inverse of transparency: an opacity of 0.0 indicates a fully-transparent voxel, while an opacity)S 0 -57 M 0 -13 R (of 1.0 indicates a voxel which completely occludes anything behind it. Intermediate values between 0.0 and 1.0)S 0 -76 M 0 -13 R (indicate semi-transparent voxels. The purpose of classification is to assign low opacities to regions of the data set)S 0 -95 M 0 -13 R (which are uninteresting or distracting and high opacities to regions of the data set which should be visible in the)S 0 -114 M 0 -13 R (rendering. Intermediate opacity values are used for smooth transitions from transparent to opaque regions, and for)S 0 -133 M 0 -13 R (effects such as semi-transparent voxels which should not completely occlude objects behind them. )S 0 -152 M 0 -169 M 0 -13 R (VolPack provides a classification method based on lookup tables. To use this method you specify a transfer function)S 0 -188 M 0 -13 R (which maps the scalar data in a particular array element into the opacity for that element. Alternatively you can)S 0 -207 M 0 -13 R (implement other classification techniques such as context-sensitive segmentation and then provide VolPack with a)S 0 -226 M 0 -13 R (pre-classified volume. )S 0 -245 M 0 -262 M 0 -13 R (The second rendering stage is to assign a color to each voxel, an operation which is called )S IF 17 SF (shading)S RF 17 SF ( \(or more)S 0 -281 M 0 -13 R (precisely, )S IF 17 SF (lighting)S RF 17 SF (\). VolPack includes support for the standard Phong shading equation. To use this shading)S 0 -300 M 0 -13 R (technique, the volume data is preprocessed before rendering in order to compute a gradient vector for each voxel.)S 0 -319 M 0 -13 R (The gradient vector can then be used as a pseudo surface normal to compute how light reflects off of each voxel. The)S 0 -338 M 0 -13 R (user specifies the position and color of one or more light sources, and the reflective properties of the volume data.)S 0 -357 M 0 -13 R (See )S IF 17 SF (Computer Graphics: Principles and Practice)S RF 17 SF ( \(Chapter 16, 2nd ed.\), by Foley, van Dam, Feiner and Hughes, for a)S 0 -376 M 0 -13 R (detailed discussion of the Phong shading equation. Alternative shading models can be implemented through a)S 0 -395 M 0 -13 R (callback function. )S 0 -414 M 0 -431 M 0 -13 R (The third rendering stage is to specify a view transformation and to transform the volume accordingly. This step can)S 0 -450 M 0 -13 R (be as simple as choosing the position from which to look at the volume, or it can include an arbitrary affine)S 0 -469 M 0 -13 R (transformation of the volume including non-uniform scaling and shearing. The view transformation also specifies)S 0 -488 M 0 -13 R (how the volume is projected onto a 2D image plane. )S 0 -507 M 0 -524 M 0 -13 R (The fourth and final rendering stage is to composite the voxels into an image. Digital compositing is analogous to)S 0 -543 M 0 -13 R (the compositing process used in the film industry: several layers of semi-transparent film are merged together into a)S 0 -562 M 0 -13 R (final image. VolPack provides several rendering algorithms that use different techniques to accelerate the)S 0 -581 M 0 -13 R (compositing stage. The next subsection briefly describes the available algorithms. )S 0 -600 M 0 -617 M BF 17 SF 0 -14 R (Data Structures and Rendering Algorithms )S 0 -637 M 0 -654 M RF 17 SF 0 -13 R (VolPack includes three rendering algorithms which are useful in different situations. The algorithms differ in the)S 0 -673 M 0 -13 R (degree to which they trade flexibility for speed and in the type of preprocessing required before rendering. )S 0 -692 M 0 -709 M 0 -13 R (The fastest algorithm allows the user to rapidly render a volume with any view transformation and with any shading)S 0 -728 M 0 -13 R (parameters while keeping the classification fixed. This algorithm relies on a special data structure which contains)S 0 -747 M 0 -13 R (run-length encoded, classified volume data. Depending on the volume size it can take several minutes to precompute)S 0 -766 M 0 -13 R (the run-length encoded volume, so this algorithm is most suitable when many renderings will be made from the)S 0 -785 M 0 -13 R (same volume without changing the classification. )S 0 -804 M 0 -821 M 0 -13 R (The steps when using this algorithm to render a classified volume are: )S 0 -840 M 48 -857 M 0 -9 R 3.454545 B 0 -4 R (load the volume data )S 48 -876 M 0 -9 R 3.454545 B 0 -4 R (choose the classification function )S 48 -895 M 0 -9 R 3.454545 B 0 -4 R (precompute the classified volume )S 48 -914 M 0 -9 R 3.454545 B 0 -4 R (repeat: )S 96 -933 M 0 -9 R 3.454545 OB 0 -4 R (set the view and shading parameters )S 96 -952 M 0 -9 R 3.454545 OB 0 -4 R (render with )S FF 17 SF (vpRenderClassifiedVolume\(\))S RF 17 SF ( )S 48 -971 M 0 -988 M 0 -13 R (The second algorithm is useful in situations where the classification will be adjusted frequently. It also relies on a)S 0 -1007 M 0 -13 R (special data structure: a min-max octree which contains the minimum and maximum values of each voxel field. This)S 0 -1026 M 0 -13 R (data structure must be computed once when a new volume is acquired. The volume can then be rendered multiple)S 0 -1045 M 0 -13 R (times with any opacity transfer function, any view transformation and any shading parameters. )S 0 -1064 M 0 -1081 M 0 -13 R (The steps when using this algorithm to render an unclassified volume are: )S 0 -1100 M 48 -1117 M 0 -9 R 3.454545 B 0 -4 R (load the volume data )S 48 -1136 M 0 -9 R 3.454545 B 0 -4 R (precompute the min-max octree with )S FF 17 SF (vpCreateMinMaxOctree\(\))S RF 17 SF ( )S 48 -1155 M 0 -9 R 3.454545 B 0 -4 R (repeat: )S 96 -1174 M 0 -9 R 3.454545 OB 0 -4 R (choose the classification function )S 96 -1193 M 0 -9 R 3.454545 OB 0 -4 R (set the view and shading parameters )S 96 -1212 M 0 -9 R 3.454545 OB 0 -4 R (render with )S FF 17 SF (vpRenderRawVolume\(\))S RF 17 SF ( )S showpage restore %%Page: 3 3 save NP RF 17 SF 48 0 M 0 -17 M 0 -13 R (Finally, the third algorithm does not use any precomputed data structures. In most cases it is significantly slower)S 0 -36 M 0 -13 R (than the other two algorithms and is useful only if you wish to make a single rendering from a volume. The steps for)S 0 -55 M 0 -13 R (using this algorithm are identical to the previous algorithm except that there is no need to compute the min-max)S 0 -74 M 0 -13 R (octree. )S 0 -93 M 0 -110 M BF 18 SF 0 -15 R (Section 2: Using VolPack )S 0 -131 M 0 -148 M RF 17 SF 0 -13 R (This section describes how to use the routines provided by VolPack. For more specific information about a)S 0 -167 M 0 -13 R (particular routine, consult the man pages provided with the library. )S 0 -186 M 0 -203 M BF 17 SF 0 -14 R (Include Files and Libraries )S 0 -223 M 0 -240 M RF 17 SF 0 -13 R (All of the definitions needed by a program which uses VolPack are included in the header file )S FF 17 SF (volpack.h)S RF 17 SF (. The)S 0 -259 M 0 -13 R (program must be compiled with the VolPack library by including the switch )S FF 17 SF (-lvolpack)S RF 17 SF ( on the compilation)S 0 -278 M 0 -13 R (command line. Other useful free libraries you may wish to use are John Ousterhout's Tcl/Tk libraries to build a)S 0 -297 M 0 -13 R (graphical user interface, and Jef Poskanzer's pbmplus library or Sam Leffler's TIFF library to store images. )S 0 -316 M 0 -333 M 0 -13 R (The header file defines the following data types: )S 0 -352 M 48 -369 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpContext)S RF 17 SF (: a rendering context. )S 48 -388 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpResult)S RF 17 SF (: a result code. )S 48 -407 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpVector3)S RF 17 SF (: a three-element double-precision vector. )S 48 -426 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpVector4)S RF 17 SF (: a four-element double-precision vector. )S 48 -445 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpMatrix3)S RF 17 SF (: a three-by-three double-precision matrix. )S 48 -464 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpMatrix4)S RF 17 SF (: a four-by-four double-precision matrix. )S 48 -483 M 0 -500 M BF 17 SF 0 -14 R (Rendering Contexts )S 0 -520 M 0 -537 M RF 17 SF 0 -13 R (The first argument of most of the routines in the VolPack library is a )S IF 17 SF (rendering context)S RF 17 SF (, declared as a variable of)S 0 -556 M 0 -13 R (type )S FF 17 SF (vpContext)S RF 17 SF (. A rendering context contains all of the information required to render a volume, including the)S 0 -575 M 0 -13 R (classification and shading parameters, the view transformation, a description of the format of the volume, and)S 0 -594 M 0 -13 R (private data structures used by the rendering routines. The contents of a rendering context are not directly accessible)S 0 -613 M 0 -13 R (to the application programmer; instead, you use the routines provided by the library to set, modify and query the)S 0 -632 M 0 -13 R (state in a context. A program can have multiple active contexts, for instance to render different volumes or to render)S 0 -651 M 0 -13 R (the same volume with different parameters simultaneously. )S 0 -670 M 0 -687 M 0 -13 R (To create a new context, use )S FF 17 SF (vpCreateContext\(\))S RF 17 SF (: )S 0 -706 M 0 -723 M FF 14 SF 0 -10 R ( vpContext *vpCreateContext\(\);)S 0 -738 M 0 -755 M RF 17 SF 0 -13 R (The return value is a pointer to the new context. It contains default values for most of the rendering parameters, but)S 0 -774 M 0 -13 R (you can change all of them with the routines described later in this section. )S 0 -793 M 0 -810 M 0 -13 R (To destroy a context and free the memory associated with it, use )S FF 17 SF (vpDestroyContext\(\))S RF 17 SF (: )S 0 -829 M 0 -846 M FF 14 SF 0 -10 R ( void vpDestroyContext\(vpContext *vpc\);)S 0 -861 M 0 -878 M BF 17 SF 0 -14 R (Volumes )S 0 -898 M 0 -915 M RF 17 SF 0 -13 R (A volume is simply a 3D array of data. The type of data can be almost anything, but if you choose to use the)S 0 -934 M 0 -13 R (classification and shading routines provided by VolPack then you must supply the fields these routines require. You)S 0 -953 M 0 -13 R (may also wish to precompute information required by your shader or classifier and store it in the voxel. Here is an)S 0 -972 M 0 -13 R (example layout for a voxel: )S 0 -991 M 0 -1008 M FF 14 SF 0 -10 R ( typedef unsigned char Scalar;)S 0 -1023 M 0 -10 R ( typedef unsigned short Normal;)S 0 -1038 M 0 -10 R ( typedef unsigned char Gradient;)S 0 -1053 M 0 -10 R ( typedef struct {)S 0 -1068 M 0 -10 R ( Normal normal;)S 0 -1083 M 0 -10 R ( Scalar scalar;)S 0 -1098 M 0 -10 R ( Gradient gradient;)S 0 -1113 M 0 -10 R ( } Voxel;)S 0 -1128 M 0 -1145 M RF 17 SF 0 -13 R (In this example the data stored in a voxel includes an 8-bit scalar value and two precomputed fields. The first)S 0 -1164 M 0 -13 R (precomputed field is a surface normal vector encoded in a 16-bit field; this field is used by VolPack's shading)S 0 -1183 M 0 -13 R (routines. The second precomputed field is the gradient-magnitude of the scalar value; this field can be used for)S 0 -1202 M 0 -13 R (detecting surface boundaries during classification, for instance. )S showpage restore %%Page: 4 4 save NP RF 17 SF 0 0 M 0 -17 M 0 -13 R (Note that the structure fields have been specified in the voxel structure in a very particular order. Many machines)S 0 -36 M 0 -13 R (have alignment restrictions which require two-byte quantities to be aligned to two-byte boundaries, four-byte)S 0 -55 M 0 -13 R (quantities to be aligned to four-byte boundaries, and so on. The compiler may have to insert wasted space in between)S 0 -74 M 0 -13 R (fields to satisfy these requirements if you are not careful. Use the )S FF 17 SF (sizeof\(\))S RF 17 SF ( operator to make sure the size of the)S 0 -93 M 0 -13 R (voxel matches your expectations. )S 0 -112 M 0 -129 M 0 -13 R (You should also place the fields which are required for shading first, followed by any other fields used only for)S 0 -148 M 0 -13 R (classification. Ordering the fields this way makes it possible to store just the fields for shading when a classified)S 0 -167 M 0 -13 R (volume is created for the fast rendering algorithm. This saves memory and improves cache performance. )S 0 -186 M 0 -203 M 0 -13 R (Once you have decided on the format of your volume you must describe it to VolPack. To set the dimensions of the)S 0 -222 M 0 -13 R (volume use )S FF 17 SF (vpSetVolumeSize)S RF 17 SF (: )S 0 -241 M 0 -258 M FF 14 SF 0 -10 R ( vpResult)S 0 -273 M 0 -10 R ( vpSetVolumeSize\(vpContext *vpc, int xlen, int ylen, int zlen\);)S 0 -288 M 0 -305 M RF 17 SF 0 -13 R (The first argument is the context whose state you wish to modify, and the remaining arguments are the number of)S 0 -324 M 0 -13 R (elements in each dimension of the 3D volume array. The return value is a result code \(type )S FF 17 SF (vpResult)S RF 17 SF (, which is an)S 0 -343 M 0 -13 R (integer\). The value VP_OK means the arguments are valid and the routine completed successfully. Other values)S 0 -362 M 0 -13 R (indicate the type of error which occurred. See the man pages for the specific types of errors which can occur for each)S 0 -381 M 0 -13 R (routine, or see the list of error codes in the )S (Result Codes and Error Handling)S ( section. )S 0 -400 M 0 -417 M 0 -13 R (Use )S FF 17 SF (vpSetVoxelSize\(\))S RF 17 SF ( to declare the size of the voxel and the number of fields it contains: )S 0 -436 M 0 -453 M FF 14 SF 0 -10 R ( vpResult)S 0 -468 M 0 -10 R ( vpSetVoxelSize\(vpContext *vpc, int bytes_per_voxel,)S 0 -483 M 0 -10 R ( int num_voxel_fields, int num_shade_fields,)S 0 -498 M 0 -10 R ( int num_classify_fields\);)S 0 -513 M 0 -530 M FF 17 SF 0 -13 R (Bytes_per_voxel)S RF 17 SF ( is the total size of a voxel in bytes. )S FF 17 SF (Num_voxel_fields)S RF 17 SF ( is the number of fields in the)S 0 -549 M 0 -13 R (voxel. )S FF 17 SF (Num_shade_fields)S RF 17 SF ( is the number of fields required for shading. )S FF 17 SF (Num_classify_fields)S RF 17 SF ( is the)S 0 -568 M 0 -13 R (number of fields required for classification. The return value is a result code. )S 0 -587 M 0 -604 M 0 -13 R (Continuing the earlier example, use the following call: )S 0 -623 M 0 -640 M FF 14 SF 0 -10 R ( #define NUM_FIELDS 3)S 0 -655 M 0 -10 R ( #define NUM_SHADE_FIELDS 2)S 0 -670 M 0 -10 R ( #define NUM_CLASSIFY_FIELDS 2)S 0 -685 M 0 -10 R ( vpSetVoxelSize\(vpc, sizeof\(Voxel\), NUM_FIELDS, NUM_SHADE_FIELDS,)S 0 -700 M 0 -10 R ( NUM_CLASSIFY_FIELDS\);)S 0 -715 M 0 -732 M RF 17 SF 0 -13 R (Now call )S FF 17 SF (vpSetVoxelField\(\))S RF 17 SF ( and the )S FF 17 SF (vpFieldOffset\(\))S RF 17 SF ( macro once for each field to declare its size and)S 0 -751 M 0 -13 R (position in the voxel: )S 0 -770 M 0 -787 M FF 14 SF 0 -10 R ( int)S 0 -802 M 0 -10 R ( vpFieldOffset\(void *voxel_ptr, field_name\);)S 0 -817 M 0 -832 M 0 -10 R ( vpResult)S 0 -847 M 0 -10 R ( vpSetVoxelField\(vpContext *vpc, int field_num, int field_size,)S 0 -862 M 0 -10 R ( int field_offset, int field_max\);)S 0 -877 M 0 -894 M FF 17 SF 0 -13 R (Voxel_ptr)S RF 17 SF ( is a pointer to a dummy variable of the same type as your voxel, and )S FF 17 SF (field_name)S RF 17 SF ( is the name of the)S 0 -913 M 0 -13 R (voxel field. The return value of the macro is the byte offset of the field from the beginning of the voxel. )S 0 -932 M FF 17 SF 0 -13 R (Field_num)S RF 17 SF ( is the ordinal index of the voxel field you are declaring, starting with 0 for the first field. )S 0 -951 M FF 17 SF 0 -13 R (Field_size)S RF 17 SF ( is the size of the field in bytes. Use the )S FF 17 SF (sizeof\(\))S RF 17 SF ( operator \(e.g. )S 0 -970 M FF 17 SF 0 -13 R (sizeof\(voxel_ptr->field_name\))S RF 17 SF (\). )S FF 17 SF (Field_offset)S RF 17 SF ( is the byte offset returned by )S 0 -989 M FF 17 SF 0 -13 R (vpFieldOffset\(\))S RF 17 SF (. )S FF 17 SF (Field_max)S RF 17 SF ( is the maximum value of the quantity stored in the field. The return value is a)S 0 -1008 M 0 -13 R (result code. )S 0 -1027 M 0 -1044 M 0 -13 R (Strictly speaking, the )S FF 17 SF (vpSetVoxelField\(\))S RF 17 SF ( procedure must be called only for voxel fields which will be used by)S 0 -1063 M 0 -13 R (the VolPack classifier and shader. However, if you declare the other fields too then VolPack can automatically)S 0 -1082 M 0 -13 R (convert volumes that were created on machines with a different byte ordering. Only fields with size 1, 2 or 4 bytes)S 0 -1101 M 0 -13 R (can be declared with )S FF 17 SF (vpSetVoxelField\(\))S RF 17 SF (. )S 0 -1120 M 0 -1137 M 0 -13 R (For the example voxel layout, make the following calls: )S 0 -1156 M 0 -1173 M FF 14 SF 0 -10 R ( #define NORM_FIELD 0)S 0 -1188 M 0 -10 R ( #define NORM_MAX VP_NORM_MAX)S 0 -1203 M 0 -10 R ( #define SCALAR_FIELD 1)S showpage restore %%Page: 5 5 save NP FF 14 SF 0 0 M 0 -10 R ( #define SCALAR_MAX 255)S 0 -15 M 0 -10 R ( #define GRAD_FIELD 2)S 0 -30 M 0 -10 R ( #define GRAD_MAX VP_GRAD_MAX)S 0 -45 M 0 -10 R ( Voxel *dummy_voxel;)S 0 -60 M 0 -10 R ( vpSetVoxelField\(vpc, NORM_FIELD, sizeof\(dummy_voxel->normal\),)S 0 -75 M 0 -10 R ( vpFieldOffset\(dummy_voxel, normal\), NORM_MAX\);)S 0 -90 M 0 -10 R ( vpSetVoxelField\(vpc, SCALAR_FIELD, sizeof\(dummy_voxel->scalar\),)S 0 -105 M 0 -10 R ( vpFieldOffset\(dummy_voxel, scalar\), SCALAR_MAX\);)S 0 -120 M 0 -10 R ( vpSetVoxelField\(vpc, GRAD_FIELD, sizeof\(dummy_voxel->gradient\),)S 0 -135 M 0 -10 R ( vpFieldOffset\(dummy_voxel, gradient\), GRAD_MAX\);)S 0 -150 M 0 -167 M RF 17 SF 0 -13 R (The constants )S FF 17 SF (VP_NORM_MAX)S RF 17 SF ( and )S FF 17 SF (VP_GRAD_MAX)S RF 17 SF ( are predefined by VolPack. In this example these fields will be)S 0 -186 M 0 -13 R (computed using standard routines provided by the library. )S 0 -205 M 0 -222 M 0 -13 R (To specify the volume data itself, use )S FF 17 SF (SetRawVoxels\(\))S RF 17 SF (: )S 0 -241 M 0 -258 M FF 14 SF 0 -10 R ( vpResult)S 0 -273 M 0 -10 R ( vpSetRawVoxels\(vpContext *vpc, void *voxels, int size,)S 0 -288 M 0 -10 R ( int xstride, int ystride, int zstride\);)S 0 -303 M 0 -320 M FF 17 SF 0 -13 R (Voxels)S RF 17 SF ( is a pointer to the voxel data. )S FF 17 SF (Size)S RF 17 SF ( is the number of bytes of voxel data. The remaining arguments are the)S 0 -339 M 0 -13 R (strides in bytes for each of the three dimensions of the volume. For instance, )S FF 17 SF (xstride)S RF 17 SF ( is the byte offset from the)S 0 -358 M 0 -13 R (beginning of one voxel to the beginning of the next voxel along the x axis. Some of the VolPack routines operate)S 0 -377 M 0 -13 R (faster if the volume is stored in z-major order \(xstride < ystride < zstride\), but it is not strictly necessary. If )S 0 -396 M FF 17 SF 0 -13 R (voxels)S RF 17 SF ( is a pointer to dynamically allocated storage then the caller is responsible for freeing the memory at the)S 0 -415 M 0 -13 R (appropriate time. VolPack does not free the voxel array when a context is destroyed. The data in the voxel array may)S 0 -434 M 0 -13 R (be initialized or modified at any time, before or after calling )S FF 17 SF (vpSetRawVoxels)S RF 17 SF (. )S 0 -453 M 0 -470 M 0 -13 R (Our running example continues as follows: )S 0 -489 M 0 -506 M FF 14 SF 0 -10 R ( Voxel *volume;)S 0 -521 M 0 -10 R ( unsigned size;)S 0 -536 M 0 -10 R ( #define VOLUME_XLEN 256)S 0 -551 M 0 -10 R ( #define VOLUME_YLEN 256)S 0 -566 M 0 -10 R ( #define VOLUME_ZLEN 256)S 0 -581 M 0 -10 R ( size = VOLUME_XLEN * VOLUME_YLEN * VOLUME_ZLEN * sizeof\(Voxel\);)S 0 -596 M 0 -10 R ( volume = malloc\(size\);)S 0 -611 M 0 -10 R ( vpSetRawVoxels\(vpc, volume, size, sizeof\(Voxel\),)S 0 -626 M 0 -10 R ( VOLUME_XLEN * sizeof\(Voxel\),)S 0 -641 M 0 -10 R ( VOLUME_YLEN * VOLUME_XLEN * sizeof\(Voxel\)\);)S 0 -656 M 0 -673 M RF 17 SF 0 -13 R (VolPack provides a number of routines to help initialize some of the fields of the volume. If your input data consists)S 0 -692 M 0 -13 R (of a three-dimensional array of 8-bit values and you wish to compute gradient-magnitude data or encoded normal)S 0 -711 M 0 -13 R (vectors, then you can use )S FF 17 SF (vpVolumeNormals\(\))S RF 17 SF (: )S 0 -730 M 0 -747 M FF 14 SF 0 -10 R ( vpResult)S 0 -762 M 0 -10 R ( vpVolumeNormals\(vpContext *vpc, unsigned char *scalars,)S 0 -777 M 0 -10 R ( int size, int scalar_field,)S 0 -792 M 0 -10 R ( int gradient_field, int normal_field\);)S 0 -807 M 0 -824 M FF 17 SF 0 -13 R (Scalars)S RF 17 SF ( is a pointer to the array of 8-bit values. )S FF 17 SF (Size)S RF 17 SF ( is the size of the array in bytes. It must equal the number)S 0 -843 M 0 -13 R (of voxels in the volume as previously specified with )S FF 17 SF (vpSetVolumeSize\(\))S RF 17 SF (. )S FF 17 SF (Scalar_field)S RF 17 SF (, )S 0 -862 M FF 17 SF 0 -13 R (gradient_field)S RF 17 SF ( and )S FF 17 SF (normal_field)S RF 17 SF ( are the voxel field numbers in which to store the scalar values from the)S 0 -881 M 0 -13 R (array, the gradient-magnitudes of the scalar values, and the encoded surface normals respectively. Any of these field)S 0 -900 M 0 -13 R (numbers may be equal to the constant )S FF 17 SF (VP_SKIP_FIELD)S RF 17 SF ( if that item should not be stored in the volume. This)S 0 -919 M 0 -13 R (function computes the specified fields and loads them into the volume array last specified with )S 0 -938 M FF 17 SF 0 -13 R (vpSetRawVolume\(\))S RF 17 SF (. )S 0 -957 M 0 -974 M 0 -13 R (In our example, we can initialize the volume array as follows: )S 0 -993 M 0 -1010 M FF 14 SF 0 -10 R ( unsigned char *scalars;)S 0 -1025 M 0 -10 R ( scalars = LoadScalarData\(\);)S 0 -1040 M 0 -10 R ( vpVolumeNormals\(vpc, scalars, VOLUME_XLEN*VOLUME_YLEN*VOLUME_ZLEN,)S 0 -1055 M 0 -10 R ( SCALAR_FIELD, GRAD_FIELD, NORM_FIELD\);)S 0 -1070 M 0 -1087 M FF 17 SF 0 -13 R (LoadScalarData\(\))S RF 17 SF ( might be a routine to load volume data from a file. )S 0 -1106 M 0 -1123 M 0 -13 R (If your volume is large it may be inefficient to load all of the scalar data into one array and then copy it to the)S 0 -1142 M 0 -13 R (volume array. If this is the case then you can use )S FF 17 SF (vpScanlineNormals\(\))S RF 17 SF ( to compute one scanline of the volume)S 0 -1161 M 0 -13 R (at a time: )S 0 -1180 M 0 -1197 M FF 14 SF 0 -10 R ( vpResult)S 0 -1212 M 0 -10 R ( vpScanlineNormals\(vpContext *vpc, int size,)S showpage restore %%Page: 6 6 save NP FF 14 SF 0 0 M 0 -10 R ( unsigned char *scalars,)S 0 -15 M 0 -10 R ( unsigned char *scalars_minus_y,)S 0 -30 M 0 -10 R ( unsigned char *scalars_plus_y,)S 0 -45 M 0 -10 R ( unsigned char *scalars_minus_z,)S 0 -60 M 0 -10 R ( unsigned char *scalars_plus_z,)S 0 -75 M 0 -10 R ( void *voxel_scan, int scalar_field,)S 0 -90 M 0 -10 R ( int gradient_field, int normal_field\);)S 0 -105 M 0 -122 M FF 17 SF 0 -13 R (Size)S RF 17 SF ( is the length in bytes of one scanline of scalar data \(which should equal the x dimension of the volume\). )S 0 -141 M FF 17 SF 0 -13 R (Scalars)S RF 17 SF ( points to the beginning of one scanline of scalars. )S FF 17 SF (Scalars_minus_y)S RF 17 SF ( and )S FF 17 SF (scalars_plus_y)S RF 17 SF ( point)S 0 -160 M 0 -13 R (to the beginning of the previous and next scanlines in the y dimension, respectively. Similarly, )S 0 -179 M FF 17 SF 0 -13 R (scalars_minus_z)S RF 17 SF ( and )S FF 17 SF (scalars_plus_z)S RF 17 SF ( point to the beginning of the previous and next scanlines in the z)S 0 -198 M 0 -13 R (dimension. These last four scanlines are the immediately-adjacent neighbors of the first scanline and are used to)S 0 -217 M 0 -13 R (compute the gradient and surface normal vector. The next argument, )S FF 17 SF (voxel_scan)S RF 17 SF (, points to the scanline of the)S 0 -236 M 0 -13 R (voxel array to write the result data into. The last three arguments are the voxel fields to write each type of data into)S 0 -255 M 0 -13 R (and are identical to the corresponding arguments to )S FF 17 SF (vpVolumeNormals\(\))S RF 17 SF (. You can use )S 0 -274 M FF 17 SF 0 -13 R (vpScanlineNormals\(\))S RF 17 SF ( in a loop which reads in the scalar data slice-by-slice, keeping at most three slices of)S 0 -293 M 0 -13 R (data in memory at a time \(in addition to the entire volume\). )S 0 -312 M 0 -329 M 0 -13 R (If you wish to compute normal vectors yourself but you still want to use the shading routines provided by VolPack,)S 0 -348 M 0 -13 R (you can use )S FF 17 SF (vpNormalIndex\(\))S RF 17 SF ( to encode a vector into the form expected by the shaders: )S 0 -367 M 0 -384 M FF 14 SF 0 -10 R ( int vpNormalIndex\(double nx, double ny, double nz\);)S 0 -399 M 0 -416 M RF 17 SF 0 -13 R (The arguments are the components of the normal vector, which must be normalized \(nx*nx + ny*ny + nz*nz == 1\),)S 0 -435 M 0 -13 R (and the return value is the 16-bit encoded normal. A routine is also provided to decode normals: )S 0 -454 M 0 -471 M FF 14 SF 0 -10 R ( vpResult)S 0 -486 M 0 -10 R ( vpNormal\(int n, double *nx, double *ny, double *nz\);)S 0 -501 M 0 -518 M RF 17 SF 0 -13 R (The encoded normal given by )S FF 17 SF (n)S RF 17 SF ( is decoded, and the normal vector components are stored in the locations specified)S 0 -537 M 0 -13 R (by the remaining arguments. )S 0 -556 M 0 -573 M BF 17 SF 0 -14 R (Classification )S 0 -593 M 0 -610 M RF 17 SF 0 -13 R (The classification routines provided by VolPack allow you to customize the opacity transfer function by specifying a)S 0 -629 M 0 -13 R (collection of lookup tables. Each lookup table is associated with one voxel field. To classify a voxel, VolPack uses)S 0 -648 M 0 -13 R (the value in each of the specified fields of the voxel to index the corresponding tables. The table values are then)S 0 -667 M 0 -13 R (multiplied together to get the opacity of the voxel. The tables should contain numbers in the range 0.0-1.0 so that the)S 0 -686 M 0 -13 R (final opacity is also in that range. )S 0 -705 M 0 -722 M 0 -13 R (A lookup table is specified with )S FF 17 SF (vpSetClassifierTable\(\))S RF 17 SF (: )S 0 -741 M 0 -758 M FF 14 SF 0 -10 R ( vpResult)S 0 -773 M 0 -10 R ( vpSetClassifierTable\(vpContext *vpc, int param_num, int param_field,)S 0 -788 M 0 -10 R ( float *table, int table_size\);)S 0 -803 M 0 -820 M FF 17 SF 0 -13 R (Param_num)S RF 17 SF ( is the parameter number associated with the table you are declaring. The total number of tables must)S 0 -839 M 0 -13 R (equal the )S FF 17 SF (num_classify_fields)S RF 17 SF ( argument to )S FF 17 SF (vpSetVoxelSize\(\))S RF 17 SF (. The first table is numbered 0. )S 0 -858 M FF 17 SF 0 -13 R (Param_field)S RF 17 SF ( is the number of the voxel field which should be used to index the table. )S FF 17 SF (Table)S RF 17 SF ( is a pointer to the)S 0 -877 M 0 -13 R (lookup table itself, and )S FF 17 SF (table_size)S RF 17 SF ( is the size of the table in bytes \(not the number of entries!\) Note that even if )S 0 -896 M FF 17 SF 0 -13 R (table)S RF 17 SF ( is dynamically allocated it is never deallocated by VolPack, even if the rendering context is destroyed. The)S 0 -915 M 0 -13 R (data in the table may be initialized or modified at any time, before or after calling )S FF 17 SF (vpSetClassifierTable)S RF 17 SF (. )S 0 -934 M 0 -951 M 0 -13 R (We could declare a two-parameter classifier for our example using the following calls: )S 0 -970 M 0 -987 M FF 14 SF 0 -10 R ( float scalar_table[SCALAR_MAX+1];)S 0 -1002 M 0 -10 R ( float gradient_table[GRAD_MAX+1];)S 0 -1017 M 0 -10 R ( vpSetClassifierTable\(vpc, 0, SCALAR_FIELD, scalar_table,)S 0 -1032 M 0 -10 R ( sizeof\(scalar_table\)\);)S 0 -1047 M 0 -10 R ( vpSetClassifierTable\(vpc, 0, GRAD_FIELD, gradient_table,)S 0 -1062 M 0 -10 R ( sizeof\(gradient_table\)\);)S 0 -1077 M 0 -1094 M RF 17 SF 0 -13 R (VolPack provides a useful utility routine for initializing classification tables with piecewise linear ramps: )S 0 -1113 M 0 -1130 M FF 14 SF 0 -10 R ( vpResult)S 0 -1145 M 0 -10 R ( vpRamp\(float array[], int stride, int num_points,)S 0 -1160 M 0 -10 R ( int ramp_x[], float ramp_y[]\);)S 0 -1175 M 0 -1192 M FF 17 SF 0 -13 R (Array)S RF 17 SF ( is the table to be initialized. )S FF 17 SF (Stride)S RF 17 SF ( is the number of bytes from the start of one array element to the start)S 0 -1211 M 0 -13 R (of the next \(useful if there are other fields in the array which you want to skip over\). )S FF 17 SF (Num_points)S RF 17 SF ( is the number)S showpage restore %%Page: 7 7 save NP RF 17 SF 0 0 M 0 -13 R (of endpoints of the piecewise linear segments. )S FF 17 SF (Ramp_x)S RF 17 SF ( is an array of x coordinates \(table indices\), and )S FF 17 SF (ramp_y)S RF 17 SF ( is)S 0 -19 M 0 -13 R (an array of y coordinates \(values to store in the array\). )S FF 17 SF (vpRamp)S RF 17 SF ( linearly-interpolates values for the table entries in)S 0 -38 M 0 -13 R (between the specified x coordinates. )S 0 -57 M 0 -74 M 0 -13 R (For example, we can initialize our two classification tables as follows: )S 0 -93 M 0 -110 M FF 14 SF 0 -10 R ( #define SCALAR_RAMP_POINTS 3)S 0 -125 M 0 -10 R ( int scalar_ramp_x[] = { 0, 24, 255};)S 0 -140 M 0 -10 R ( float scalar_ramp_y[] = {0.0, 1.0, 1.0};)S 0 -155 M 0 -10 R ( vpRamp\(scalar_table, sizeof\(float\), SCALAR_RAMP_POINTS,)S 0 -170 M 0 -10 R ( scalar_ramp_x, scalar_ramp_y\);)S 0 -185 M 0 -200 M 0 -10 R ( #define GRAD_RAMP_POINTS 4)S 0 -215 M 0 -10 R ( int grad_ramp_x[] = { 0, 5, 20, 221};)S 0 -230 M 0 -10 R ( float grad_ramp_y[] = {0.0, 0.0, 1.0, 1.0};)S 0 -245 M 0 -10 R ( vpRamp\(gradient_table, sizeof\(float\), GRAD_RAMP_POINTS,)S 0 -260 M 0 -10 R ( grad_ramp_x, grad_ramp_y\);)S 0 -275 M 0 -292 M RF 17 SF 0 -13 R (If you wish to use an alternative classification algorithm instead of the lookup-table classifier then you should store)S 0 -311 M 0 -13 R (the voxel opacities you compute in one of the fields of the voxel and define a lookup table which converts the values)S 0 -330 M 0 -13 R (in that field into floating-point numbers. For instance, define a 1-byte opacity field which contains values in the)S 0 -349 M 0 -13 R (range 0-255, and declare a lookup table with a linear ramp mapping those numbers to the range 0.0-1.0. )S 0 -368 M 0 -385 M 0 -13 R (In addition to setting the classification function, you should also set the minimum opacity threshold with )S FF 17 SF (vpSeti)S RF 17 SF (.)S 0 -404 M 0 -13 R (This threshold is used to discard voxels which are so transparent that they do not contribute significantly to the)S 0 -423 M 0 -13 R (image. The higher the threshold, the faster the rendering algorithms. For example, to discard voxels which are at)S 0 -442 M 0 -13 R (most 5% opaque, use the following: )S 0 -461 M 0 -478 M FF 14 SF 0 -10 R ( vpSeti\(vpc, VP_MIN_VOXEL_OPACITY, 0.05\);)S 0 -493 M 0 -510 M BF 17 SF 0 -14 R (Classified Volumes )S 0 -530 M 0 -547 M RF 17 SF 0 -13 R (The fastest rendering algorithm provided by VolPack uses a run-length encoded volume data structure which must)S 0 -566 M 0 -13 R (be computed before rendering. Three routines are provided to compute this data structure. Remember to set the)S 0 -585 M 0 -13 R (opacity transfer function and the minimum voxel opacity before calling the functions in this subsection. )S 0 -604 M 0 -621 M 0 -13 R (If you have already constructed an unclassified volume and defined the classification function as described in the)S 0 -640 M 0 -13 R (previous subsections then use )S FF 17 SF (vpClassifyVolume\(\))S RF 17 SF (: )S 0 -659 M 0 -676 M FF 14 SF 0 -10 R ( vpResult)S 0 -691 M 0 -10 R ( vpClassifyVolume\(vpContext *vpc\);)S 0 -706 M 0 -723 M RF 17 SF 0 -13 R (This routine reads data from the currently-defined volume array, classifies it using the current classifier, and then)S 0 -742 M 0 -13 R (stores it in run-length encoded form in the rendering context. The volume array is not modified or deallocated. )S 0 -761 M 0 -778 M 0 -13 R (If you wish to load an array of 8-bit scalars and compute a classified volume directly without building an)S 0 -797 M 0 -13 R (unclassified volume, then use )S FF 17 SF (vpClassifyScalars\(\))S RF 17 SF (: )S 0 -816 M 0 -833 M FF 14 SF 0 -10 R ( vpResult)S 0 -848 M 0 -10 R ( vpClassifyScalars\(vpContext *vpc, unsigned char *scalars,)S 0 -863 M 0 -10 R ( int size, int scalar_field,)S 0 -878 M 0 -10 R ( int gradient_field, int normal_field\);)S 0 -893 M 0 -910 M RF 17 SF 0 -13 R (The arguments to this routine are identical to those for )S FF 17 SF (vpVolumeNormals\(\))S RF 17 SF ( described above. The difference)S 0 -929 M 0 -13 R (between the two routines is that )S FF 17 SF (vpClassifyScalars\(\))S RF 17 SF ( stores the result as a classified, run-length encoded)S 0 -948 M 0 -13 R (volume instead of as an unclassified volume. The volume size, voxel size, voxel fields, and classifier must all be)S 0 -967 M 0 -13 R (declared before calling this routine, but there is no need to call )S FF 17 SF (vpSetRawVoxels\(\))S RF 17 SF (. )S 0 -986 M 0 -1003 M 0 -13 R (If you wish to classify one scanline of voxel data at a time instead of loading the entire array of scalar data at once)S 0 -1022 M 0 -13 R (then use )S FF 17 SF (vpClassifyScanline\(\))S RF 17 SF (: )S 0 -1041 M 0 -1058 M FF 14 SF 0 -10 R ( vpResult)S 0 -1073 M 0 -10 R ( vpClassifyScanline\(vpContext *vpc, void *voxel_scan\);)S 0 -1088 M 0 -1105 M FF 17 SF 0 -13 R (Voxel_scan)S RF 17 SF ( is a pointer to one scanline of voxel data, in the same format as the full unclassified volume. You)S 0 -1124 M 0 -13 R (could, for instance, use )S FF 17 SF (vpScanlineNormals\(\))S RF 17 SF ( to compute the fields of the scanline before passing it to )S 0 -1143 M FF 17 SF 0 -13 R (vpClassifyScanline\(\))S RF 17 SF (. Each call to this routine appends one new scanline to the current classified volume.)S 0 -1162 M 0 -13 R (Out-of-order calls are not possible, and the volume cannot be rendered until all of the scanlines have been loaded. )S 0 -1181 M 0 -1198 M 0 -13 R (Only one classified volume may be stored in a rendering context at a time. If you start classifying a new volume, any)S showpage restore %%Page: 8 8 save NP RF 17 SF 0 0 M 0 -13 R (old classified volume data is deallocated. You can also force the current classified volume to be deallocated with )S 0 -19 M FF 17 SF 0 -13 R (vpDestroyClassifiedVolume\(\))S RF 17 SF (: )S 0 -38 M 0 -55 M FF 14 SF 0 -10 R ( vpResult)S 0 -70 M 0 -10 R ( vpDestroyClassifiedVolume\(vpContext *vpc\);)S 0 -85 M 0 -102 M RF 17 SF 0 -13 R (Note that if you change the contents of the unclassified volume array and you wish the classified volume to reflect)S 0 -121 M 0 -13 R (those changes then you must call one of the routines in this section to recompute the classified volume. )S 0 -140 M 0 -157 M BF 17 SF 0 -14 R (Min-Max Octrees )S 0 -177 M 0 -194 M RF 17 SF 0 -13 R (A min-max octree is a hierarchical data structure which contains minimum and maximum values for each field used)S 0 -213 M 0 -13 R (to index the classification tables. This data structure can be used to accelerate rendering unclassified volumes, and it)S 0 -232 M 0 -13 R (can also accelerate the computation of a classified volume from an unclassified volume. )S 0 -251 M 0 -268 M 0 -13 R (To compute a min-max octree, first define an unclassified volume with )S FF 17 SF (vpSetVolumeSize\(\))S RF 17 SF (, )S 0 -287 M FF 17 SF 0 -13 R (vpSetVoxelSize\(\))S RF 17 SF (, )S FF 17 SF (vpSetVoxelField\(\))S RF 17 SF (, and )S FF 17 SF (vpSetRawVoxels\(\))S RF 17 SF (. Also be sure to initialize the)S 0 -306 M 0 -13 R (volume data. Now for each classification table make one call to )S FF 17 SF (vpMinMaxOctreeThreshold\(\))S RF 17 SF (: )S 0 -325 M 0 -342 M FF 14 SF 0 -10 R ( vpResult)S 0 -357 M 0 -10 R ( vpMinMaxOctreeThreshold\(vpContext *vpc, int param_num, int range\);)S 0 -372 M 0 -389 M FF 17 SF 0 -13 R (Param_num)S RF 17 SF ( is the same parameter number you passed to )S FF 17 SF (vpSetClassifierTable\(\))S RF 17 SF (. )S FF 17 SF (Range)S RF 17 SF ( is a range of)S 0 -408 M 0 -13 R (table indices for this parameter which you consider to be "small". The opacity of a voxel should not vary much if the)S 0 -427 M 0 -13 R (table index is changed by the amount specified in )S FF 17 SF (range)S RF 17 SF (. Choosing a value which is too small or too large may)S 0 -446 M 0 -13 R (result in a reduced performance benefit during rendering. You may wish to experiment, but the octree should)S 0 -465 M 0 -13 R (improve performance even if you don't use the optimum range value. You can use the routine )S FF 17 SF (vpOctreeMask\(\))S 0 -484 M RF 17 SF 0 -13 R (to visualize the effectiveness of the octree \(see the man pages\). )S 0 -503 M 0 -520 M 0 -13 R (To compute the octree, call )S FF 17 SF (vpCreateMinMaxOctree\(\))S RF 17 SF (: )S 0 -539 M 0 -556 M FF 14 SF 0 -10 R ( vpResult)S 0 -571 M 0 -10 R ( vpCreateMinMaxOctree\(vpContext *vpc, int root_node_size,)S 0 -586 M 0 -10 R ( int base_node_size\);)S 0 -601 M 0 -618 M FF 17 SF 0 -13 R (Root_node_size)S RF 17 SF ( is currently not used but is reserved for future use. )S FF 17 SF (Base_node_size)S RF 17 SF ( specifies the size in)S 0 -637 M 0 -13 R (voxels of one side of the smallest node in the octree. The smaller the value, the better the resolution of the data)S 0 -656 M 0 -13 R (structure at the expense of an increase in size. A value of 4 is a good starting point. This routine reads the data in the)S 0 -675 M 0 -13 R (unclassified volume array, computes an octree, and stores it in the rendering context. )S 0 -694 M 0 -711 M 0 -13 R (Once the octree has been computed it will be used automatically whenever you call )S FF 17 SF (vpClassifyVolume\(\))S RF 17 SF ( or )S 0 -730 M FF 17 SF 0 -13 R (vpRenderRawVolume\(\))S RF 17 SF (. If you change the data in the volume array you MUST call )S 0 -749 M FF 17 SF 0 -13 R (vpCreateMinMaxOctree)S RF 17 SF ( to recompute the octree, or else your renderings will be incorrect. You can also)S 0 -768 M 0 -13 R (destroy the octree by calling )S FF 17 SF (vpDestroyMinMaxOctree\(\))S RF 17 SF (: )S 0 -787 M 0 -804 M FF 14 SF 0 -10 R ( vpResult)S 0 -819 M 0 -10 R ( vpDestroyMinMaxOctree\(vpContext *vpc\);)S 0 -834 M 0 -851 M BF 17 SF 0 -14 R (View Transformations )S 0 -871 M 0 -888 M RF 17 SF 0 -13 R (VolPack maintains four transformation matrices: a modeling transform, a viewing transform, a projection)S 0 -907 M 0 -13 R (transform, and a viewport transform. The primary use of these matrices is to specify a transformation from the)S 0 -926 M 0 -13 R (volume data's coordinate system to the image coordinate system. However, they also affect light direction vectors)S 0 -945 M 0 -13 R (\(and in future releases of the library they will affect the positioning of clipping planes and polygon primitives\). )S 0 -964 M 0 -981 M 0 -13 R (There are five coordinate systems implied by the transformation matrices: object coordinates, world coordinates, eye)S 0 -1000 M 0 -13 R (coordinates, clip coordinates, and image coordinates. In the object coordinate system the volume is entirely contained)S 0 -1019 M 0 -13 R (in a unit cube centered at the origin. The modeling transform is an affine transform which converts object)S 0 -1038 M 0 -13 R (coordinates into world coordinates. The modeling transform is also applied to light direction vectors to transform)S 0 -1057 M 0 -13 R (them to world coordinates. The view transform is an affine transform that converts world coordinates into eye)S 0 -1076 M 0 -13 R (coordinates. In eye coordinates the viewer is looking down the -Z axis. The view transform is typically used to)S 0 -1095 M 0 -13 R (specify the position of the viewer in the world coordinate system. The projection transform converts eye coordinates)S 0 -1114 M 0 -13 R (into clip coordinates. This transform may specify a perspective or a parallel projection, although perspective)S 0 -1133 M 0 -13 R (rendering is not yet supported. Finally, the viewport transform converts the clip coordinate system into image)S 0 -1152 M 0 -13 R (coordinates. )S 0 -1171 M 0 -1188 M 0 -13 R (VolPack provides a number of routines to change the modeling matrix, viewing matrix and the projection matrix.)S 0 -1207 M 0 -13 R (First, use )S FF 17 SF (vpCurrentMatrix\(\))S RF 17 SF ( to select the matrix you wish to modify: )S showpage restore %%Page: 9 9 save NP RF 17 SF 0 0 M 0 -17 M FF 14 SF 0 -10 R ( vpResult)S 0 -32 M 0 -10 R ( vpCurrentMatrix\(vpContext *vpc, int option\);)S 0 -47 M 0 -64 M FF 17 SF 0 -13 R (Option)S RF 17 SF ( is one of the constants )S FF 17 SF (VP_MODEL)S RF 17 SF (, )S FF 17 SF (VP_VIEW)S RF 17 SF ( or )S FF 17 SF (VP_PROJECT)S RF 17 SF (. Now use the following functions to)S 0 -83 M 0 -13 R (modify the matrix contents \(see the man pages for specifics\): )S 0 -102 M 0 -119 M FF 17 SF 0 -13 R (vpIdentityMatrix\(vpContext *vpc\))S RF 17 SF ( )S 48 -138 M 0 -13 R (Load the identity matrix into the current transformation matrix. )S 0 -157 M FF 17 SF 0 -13 R (vpTranslate\(vpContext *vpc, double tx, double ty, double tz\))S RF 17 SF ( )S 48 -176 M 0 -13 R (Multiply the current transformation matrix by a translation matrix. )S 0 -195 M FF 17 SF 0 -13 R (vpRotate\(vpContext *vpc, int axis, double degrees\))S RF 17 SF ( )S 48 -214 M 0 -13 R (Multiply the current transformation matrix by a rotation matrix. )S FF 17 SF (Axis)S RF 17 SF ( is one of the constants )S FF 17 SF (VP_X_AXIS)S RF 17 SF (, )S 48 -233 M FF 17 SF 0 -13 R (VP_Y_AXIS)S RF 17 SF ( or )S FF 17 SF (VP_Z_AXIS)S RF 17 SF (. )S 0 -252 M FF 17 SF 0 -13 R (vpScale\(vpContext *vpc, double sx, double sy, double sz\))S RF 17 SF ( )S 48 -271 M 0 -13 R (Multiply the current transformation matrix by a scaling matrix. )S 0 -290 M FF 17 SF 0 -13 R (vpMultMatrix\(vpContext *vpc, vpMatrix4 m\))S RF 17 SF ( )S 48 -309 M 0 -13 R (Multiply the current transformation matrix by the given matrix. )S 0 -328 M FF 17 SF 0 -13 R (vpSetMatrix\(vpContext *vpc, vpMatrix4 m\))S RF 17 SF ( )S 48 -347 M 0 -13 R (Load the given matrix into the current transformation matrix. )S 48 -366 M 0 -383 M 0 -13 R (By default, all of the routines use post-multiplication. For instance, if the current modeling matrix is M and a)S 0 -402 M 0 -13 R (rotation matrix R is applied, then the new transformation is M*R. If a light direction vector v is now specified)S 0 -421 M 0 -13 R (\(using commands discussed in the section on shading\), it is transformed into M*R*v before it is stored in the current)S 0 -440 M 0 -13 R (rendering context. If you prefer pre-multiplication of matrices then call )S FF 17 SF (vpSeti)S RF 17 SF ( with the )S FF 17 SF (CONCAT_MODE)S 0 -459 M RF 17 SF 0 -13 R (argument. Note that vectors are always post-multiplied. )S 0 -478 M 0 -495 M 0 -13 R (Two special routines are provided for creating projection matrices. These routines always store their result in the)S 0 -514 M 0 -13 R (projection matrix, not the current matrix. The first is )S FF 17 SF (vpWindow\(\))S RF 17 SF (: )S 0 -533 M 0 -550 M FF 14 SF 0 -10 R ( vpResult)S 0 -565 M 0 -10 R ( vpWindow\(vpContext *vpc, int type, double left, double right,)S 0 -580 M 0 -10 R ( double bottom, double top, double near, double far\);)S 0 -595 M 0 -612 M FF 17 SF 0 -13 R (Type)S RF 17 SF ( must be the constant )S FF 17 SF (VP_PARALLEL)S RF 17 SF ( to specify a parallel projection. In a future release perspective)S 0 -631 M 0 -13 R (projections will be allowed. The remaining arguments specify the left, right, bottom, top, near, and far coordinates)S 0 -650 M 0 -13 R (of the planes bounding the view volume in eye coordinates. This routine works just like the )S FF 17 SF (glFrustum\(\))S RF 17 SF ( and )S 0 -669 M FF 17 SF 0 -13 R (glOrtho\(\))S RF 17 SF ( routines in OpenGL. )S 0 -688 M 0 -705 M 0 -13 R (The second routine for creating a projection matrix uses the PHIGS viewing model: )S 0 -724 M 0 -741 M FF 14 SF 0 -10 R ( vpResult)S 0 -756 M 0 -10 R ( vpWindowPHIGS\(vpContext *vpc, vpVector3 vrp, vpVector3 vpn,)S 0 -771 M 0 -10 R ( vpVector3 vup, vpVector3 prp, double viewport_umin,)S 0 -786 M 0 -10 R ( double viewport_umax, double viewport_vmin,)S 0 -801 M 0 -10 R ( double viewport_vmax, double viewport_front,)S 0 -816 M 0 -10 R ( double viewport_back, int type\);)S 0 -831 M 0 -848 M FF 17 SF 0 -13 R (Vrp)S RF 17 SF ( is the view reference point, )S FF 17 SF (vpn)S RF 17 SF ( is the view plane normal, )S FF 17 SF (vup)S RF 17 SF ( is the view up vector, )S FF 17 SF (prp)S RF 17 SF ( is the projection)S 0 -867 M 0 -13 R (reference point, the next six arguments are the bounds of the viewing volume in view reference coordinates, and )S 0 -886 M FF 17 SF 0 -13 R (type)S RF 17 SF ( is the constant )S FF 17 SF (VP_PARALLEL)S RF 17 SF ( to specify a parallel projection. Since these parameters specify a viewpoint as)S 0 -905 M 0 -13 R (well as a viewing volume, typically the view matrix contains the identity. See )S IF 17 SF (Computer Graphics: Principles and)S 0 -924 M 0 -13 R (Practice)S RF 17 SF ( \(Chapter 6, 2nd ed.\), by Foley, van Dam, Feiner and Hughes for a complete discussion of the PHIGS)S 0 -943 M 0 -13 R (viewing model. )S 0 -962 M 0 -979 M 0 -13 R (The viewport transform is set automatically when you set the size of the image, which is discussed in the next)S 0 -998 M 0 -13 R (subsection. )S 0 -1017 M 0 -1034 M 0 -13 R (Here is an example showing all the steps to set the view transformation: )S 0 -1053 M 0 -1070 M FF 14 SF 0 -10 R ( vpCurrentMatrix\(vpc, VP_MODEL\);)S 0 -1085 M 0 -10 R ( vpIdentityMatrix\(vpc\);)S 0 -1100 M 0 -10 R ( vpRotate\(vpc, VP_X_AXIS, 90.0\);)S 0 -1115 M 0 -10 R ( vpRotate\(vpc, VP_Y_AXIS, 23.0\);)S 0 -1130 M 0 -10 R ( vpCurrentMatrix\(vpc, VP_VIEW\);)S 0 -1145 M 0 -10 R ( vpIdentityMatrix\(vpc\);)S 0 -1160 M 0 -10 R ( vpTranslate\(vpc, 0.1, 0.0, 0.0\);)S 0 -1175 M 0 -10 R ( vpCurrentMatrix\(vpc, VP_PROJECT\);)S 0 -1190 M 0 -10 R ( vpWindow\(vpc, VP_PARALLEL, -0.5, 0.5, -0.5, 0.5, -0.5, 0.5\);)S 0 -1205 M showpage restore %%Page: 10 10 save NP FF 14 SF 0 0 M RF 17 SF 0 -13 R (Note that light direction vectors are transformed according to the modeling matrix in effect at the time of the call to )S 0 -19 M FF 17 SF 0 -13 R (vpSetLight)S RF 17 SF (, and volumes are transformed according to the modeling matrix in effect at the time of rendering.)S 0 -38 M 0 -13 R (The same viewing, projection and viewport transforms are applied to everything at the time of rendering. )S 0 -57 M 0 -74 M BF 17 SF 0 -14 R (Shading and Lighting )S 0 -94 M 0 -111 M RF 17 SF 0 -13 R (VolPack supports two shading methods: shading via lookup tables, and shading via callback functions. In addition,)S 0 -130 M 0 -13 R (routines are provided to initialize shading tables for the Phong illumination model. )S 0 -149 M 0 -166 M 0 -13 R (The built-in routines are designed to support the multiple-material voxel model described in )S IF 17 SF (Volume Rendering)S RF 17 SF ( by)S 0 -185 M 0 -13 R (Drebin, Carpenter and Hanrahan in Proceedings of SIGGRAPH 88. Each voxel is assumed to contain a mixture of)S 0 -204 M 0 -13 R (basic material types. Each material type has its own shading parameters, such as color and shinyness. The color of a)S 0 -223 M 0 -13 R (voxel is found by computing a color for each material type and then combining the colors in proportion to the)S 0 -242 M 0 -13 R (fraction of each material in the voxel. )S 0 -261 M 0 -278 M 0 -13 R (This functionality is implemented by storing two table indices in each voxel and using two lookup tables. One voxel)S 0 -297 M 0 -13 R (field must contain an encoded surface normal vector as computed by )S FF 17 SF (vpNormalIndex\(\))S RF 17 SF (. This field is used to)S 0 -316 M 0 -13 R (index a table which contains a color for each of the material types. The actual colors retrieved from the table depend)S 0 -335 M 0 -13 R (on the surface normal, so directional lights can be implemented by storing appropriate values in the table. The)S 0 -354 M 0 -13 R (second voxel field contains a value which is used to index the second table. Each row of the second table contains a)S 0 -373 M 0 -13 R (fractional occupancy for each material type. These fractional occupancies are used as weights to determine the)S 0 -392 M 0 -13 R (relative strength of each color retrieved from the first table. )S 0 -411 M 0 -428 M 0 -13 R (To declare a lookup-table shader, use )S FF 17 SF (vpSetLookupShader\(\))S RF 17 SF (: )S 0 -447 M 0 -464 M FF 14 SF 0 -10 R ( vpResult)S 0 -479 M 0 -10 R ( vpSetLookupShader\(vpContext *vpc, int color_channels,)S 0 -494 M 0 -10 R ( int num_materials, int color_field,)S 0 -509 M 0 -10 R ( float *color_table, int color_table_size,)S 0 -524 M 0 -10 R ( int weight_field,)S 0 -539 M 0 -10 R ( float *weight_table, int weight_table_size\);)S 0 -554 M 0 -571 M FF 17 SF 0 -13 R (Color_channels)S RF 17 SF ( is 1 for grayscale renderings or 3 for color \(RGB\) renderings. )S FF 17 SF (Num_materials)S RF 17 SF ( is the)S 0 -590 M 0 -13 R (number of material types. )S FF 17 SF (Color_field)S RF 17 SF ( is the voxel field number for the color lookup table index. )S 0 -609 M FF 17 SF 0 -13 R (Color_table)S RF 17 SF ( is the corresponding lookup table, and )S FF 17 SF (color_table_size)S RF 17 SF ( is the size of the table in bytes. )S 0 -628 M FF 17 SF 0 -13 R (Weight_field)S RF 17 SF (, )S FF 17 SF (weight_table)S RF 17 SF ( and )S FF 17 SF (weight_table_size)S RF 17 SF ( are the field number, lookup table and table)S 0 -647 M 0 -13 R (size for the second table which contains weights for each material type. The color table must be an array with the)S 0 -666 M 0 -13 R (following dimensions: )S 0 -685 M 0 -702 M FF 14 SF 0 -10 R ( float color_table[n][num_materials][color_channels];)S 0 -717 M 0 -734 M RF 17 SF 0 -13 R (where )S FF 17 SF (n)S RF 17 SF ( is the number of possible values for the color field. The colors are values in the range 0.0-1.0 \(zero)S 0 -753 M 0 -13 R (intensity to full intensity\). The weight table must be an array with the following dimensions: )S 0 -772 M 0 -789 M FF 14 SF 0 -10 R ( float weight_table[m][num_materials];)S 0 -804 M 0 -821 M RF 17 SF 0 -13 R (where )S FF 17 SF (m)S RF 17 SF ( is the number of possible values for the weight field. Weights are in the range 0.0-1.0. If there is only one)S 0 -840 M 0 -13 R (material type then the weight table is not used and the corresponding parameters may be set to 0. )S 0 -859 M 0 -876 M 0 -13 R (Returning to our example, the following code declares an RGB shader with two material types: )S 0 -895 M 0 -912 M FF 14 SF 0 -10 R ( #define COLOR_CHANNELS 3)S 0 -927 M 0 -10 R ( #define MATERIALS 2)S 0 -942 M 0 -10 R ( float color_table[NORM_MAX+1][MATERIALS][COLOR_CHANNELS];)S 0 -957 M 0 -10 R ( float weight_table[SCALAR_MAX+1][MATERIALS];)S 0 -972 M 0 -10 R ( vpSetLookupShader\(vpc, COLOR_CHANNELS, MATERIALS,)S 0 -987 M 0 -10 R ( NORM_FIELD, color_table, sizeof\(color_table\),)S 0 -1002 M 0 -10 R ( SCALAR_FIELD, weight_table, sizeof\(weight_table\)\);)S 0 -1017 M 0 -1034 M RF 17 SF 0 -13 R (The weight table can be initialized using the )S FF 17 SF (vpRamp\(\))S RF 17 SF ( function previously described, or using a loop which fills)S 0 -1053 M 0 -13 R (in values in whatever way you choose. To initialize the color table, VolPack provides a routine called )S 0 -1072 M FF 17 SF 0 -13 R (vpShadeTable\(\))S RF 17 SF (. Before calling the routine you must set the lighting and shading parameters as follows. )S 0 -1091 M 0 -1108 M 0 -13 R (To set the lighting parameters, use )S FF 17 SF (vpSetLight\(\))S RF 17 SF (: )S 0 -1127 M 0 -1144 M FF 14 SF 0 -10 R ( vpResult)S 0 -1159 M 0 -10 R ( vpSetLight\(vpContext *vpc, int light_num, int property,)S 0 -1174 M 0 -10 R ( double n0, double n1, double n2\);)S 0 -1189 M 0 -1206 M FF 17 SF 0 -13 R (Light_num)S RF 17 SF ( is one of the constants )S FF 17 SF (VP_LIGHT0)S RF 17 SF (, )S FF 17 SF (VP_LIGHT1)S RF 17 SF (, ..., )S FF 17 SF (VP_LIGHT5)S RF 17 SF ( and indicates which of the six)S showpage restore %%Page: 11 11 save NP RF 17 SF 0 0 M 0 -13 R (light sources you wish to adjust. )S FF 17 SF (Property)S RF 17 SF ( is either )S FF 17 SF (VP_COLOR)S RF 17 SF ( or )S FF 17 SF (VP_DIRECTION)S RF 17 SF (. For )S FF 17 SF (VP_COLOR)S RF 17 SF ( the)S 0 -19 M 0 -13 R (remaining three arguments are the RGB components of the light color, in the range 0.0-1.0. For )S FF 17 SF (VP_DIRECTION)S 0 -38 M RF 17 SF 0 -13 R (the remaining three arguments are the x, y and z components of the direction of the light source. This vector is)S 0 -57 M 0 -13 R (transformed by the current modeling matrix before it is stored in the rendering context \(see )S (View Transformations)S (\).)S 0 -76 M 0 -13 R (You must also call )S FF 17 SF (vpEnable\(\))S RF 17 SF ( to enable the light. By default, light 0 is enabled and all others are disabled. )S 0 -95 M 0 -112 M 0 -13 R (For example, to create a cyan light coming from above the viewer's right shoulder, use the following: )S 0 -131 M 0 -148 M FF 14 SF 0 -10 R ( vpSetLight\(vpc, VP_LIGHT1, VP_COLOR, 0.0, 1.0, 1.0\);)S 0 -163 M 0 -10 R ( vpSetLight\(vpc, VP_LIGHT1, VP_DIRECTION, -0.6, 0.6, 1.0\);)S 0 -178 M 0 -10 R ( vpEnable\(vpc, VP_LIGHT1, 1\);)S 0 -193 M 0 -210 M RF 17 SF 0 -13 R (You can also select "two-sided" lights using )S FF 17 SF (vpEnable\(\))S RF 17 SF ( with the )S FF 17 SF (VP_LIGHT_BOTH_SIDES)S RF 17 SF ( option. Under)S 0 -229 M 0 -13 R (this lighting model each directional light shines in two directions, both in the specified direction and in the opposite)S 0 -248 M 0 -13 R (direction. )S 0 -267 M 0 -284 M 0 -13 R (To set the material parameters for a particular material type, call )S FF 17 SF (vpSetMaterial\(\))S RF 17 SF (: )S 0 -303 M 0 -320 M FF 14 SF 0 -10 R ( vpResult)S 0 -335 M 0 -10 R ( vpSetMaterial\(vpContext *vpc, int material_num, int property,)S 0 -350 M 0 -10 R ( int surface_side, double r, double g, double b\);)S 0 -365 M 0 -382 M FF 17 SF 0 -13 R (Material_num)S RF 17 SF ( is one of the constants )S FF 17 SF (VP_MATERIAL0)S RF 17 SF (, )S FF 17 SF (VP_MATERIAL1)S RF 17 SF (, ..., )S FF 17 SF (VP_MATERIAL5)S RF 17 SF ( and indicates)S 0 -401 M 0 -13 R (which material you wish to adjust. )S FF 17 SF (Property)S RF 17 SF ( is one of the following: )S 0 -420 M 0 -437 M FF 17 SF 0 -13 R (VP_AMBIENT)S RF 17 SF ( )S 48 -456 M 0 -13 R (Set the R, G and B ambient light reflection coefficients. )S 0 -475 M FF 17 SF 0 -13 R (VP_DIFFUSE)S RF 17 SF ( )S 48 -494 M 0 -13 R (Set the R, G and B diffuse light reflection coefficients. )S 0 -513 M FF 17 SF 0 -13 R (VP_SPECULAR)S RF 17 SF ( )S 48 -532 M 0 -13 R (Set the R, G and B specular light reflection coefficients. )S 0 -551 M FF 17 SF 0 -13 R (VP_SHINYNESS)S RF 17 SF ( )S 48 -570 M 0 -13 R (Set the specular exponent. The )S FF 17 SF (g)S RF 17 SF ( and )S FF 17 SF (b)S RF 17 SF ( arguments are not used. )S 48 -589 M 0 -606 M FF 17 SF 0 -13 R (Surface_side)S RF 17 SF ( is either )S FF 17 SF (VP_EXTERIOR)S RF 17 SF (, )S FF 17 SF (VP_INTERIOR)S RF 17 SF (, or )S FF 17 SF (VP_BOTH_SIDES)S RF 17 SF (. In the first case the)S 0 -625 M 0 -13 R (parameters will only affect voxels on the "exterior" side of a surface, which by default means that the voxel's)S 0 -644 M 0 -13 R (gradient points towards the viewer \(you can use )S FF 17 SF (vpEnable\(\))S RF 17 SF ( with the )S FF 17 SF (VP_REVERSE_SURFACE_SIDES)S RF 17 SF ( option)S 0 -663 M 0 -13 R (to reverse the meaning of exterior and interior\). In the second case the parameters will only affect voxels whose)S 0 -682 M 0 -13 R (gradient points away from the viewer. In the third case, all voxels are affected. )S 0 -701 M 0 -718 M 0 -13 R (Here is an example which sets surface 0 to reflect red and green ambient and diffuse light, and to have fairly strong)S 0 -737 M 0 -13 R (specular highlights which retain the color of the light source: )S 0 -756 M 0 -773 M FF 14 SF 0 -10 R ( vpSetMaterial\(vpc, VP_MATERIAL0, VP_AMBIENT,)S 0 -788 M 0 -10 R ( VP_BOTHSIDES, 0.1, 0.1, 0.0\);)S 0 -803 M 0 -10 R ( vpSetMaterial\(vpc, VP_MATERIAL0, VP_DIFFUSE,)S 0 -818 M 0 -10 R ( VP_BOTHSIDES, 0.4, 0.4, 0.0\);)S 0 -833 M 0 -10 R ( vpSetMaterial\(vpc, VP_MATERIAL0, VP_SPECULAR,)S 0 -848 M 0 -10 R ( VP_BOTHSIDES, 0.5, 0.5, 0.5\);)S 0 -863 M 0 -10 R ( vpSetMaterial\(vpc, VP_MATERIAL0, VP_SHINYNESS,)S 0 -878 M 0 -10 R ( VP_BOTHSIDES, 10.0, 0.0, 0.0\);)S 0 -893 M 0 -910 M RF 17 SF 0 -13 R (Now that all of the lighting and shading parameters have been set, the color lookup table has been declared with )S 0 -929 M FF 17 SF 0 -13 R (vpSetLookupShader\(\))S RF 17 SF (, and the viewing parameters have been set, you can call )S FF 17 SF (vpShadeTable\(\))S RF 17 SF ( to)S 0 -948 M 0 -13 R (recompute the entries of the lookup table: )S 0 -967 M 0 -984 M FF 14 SF 0 -10 R ( vpResult)S 0 -999 M 0 -10 R ( vpShadeTable\(vpContext *vpc\);)S 0 -1014 M 0 -1031 M RF 17 SF 0 -13 R (This routine computes all of the entries in the currently-defined color table using the current lighting and material)S 0 -1050 M 0 -13 R (parameters and the current view transformation. You should call )S FF 17 SF (vpShadeTable\(\))S RF 17 SF ( after any changes to the)S 0 -1069 M 0 -13 R (shading or viewing parameters, but before calling any of the rendering routines. )S 0 -1088 M 0 -1105 M 0 -13 R (If you wish to use some other shading model you have two options. One approach is to create your own routine to)S 0 -1124 M 0 -13 R (initialize the shading lookup tables. If you take this approach then you may define tables of any size \(there is no need)S 0 -1143 M 0 -13 R (to use VolPack's encoded normal vectors\). For example, you could use a color transfer function which assigns a)S 0 -1162 M 0 -13 R (unique color to each possible value of the scalar field in your volume. The second option is to define a callback)S 0 -1181 M 0 -13 R (routine which will be called to shade each voxel during rendering. You do so by calling )S FF 17 SF (vpSetCallback\(\))S 0 -1200 M RF 17 SF 0 -13 R (instead of )S FF 17 SF (vpSetLookupShader\(\))S RF 17 SF (. For example, to declare a grayscale shading callback function use the)S showpage restore %%Page: 12 12 save NP RF 17 SF 0 0 M 0 -13 R (following call: )S 0 -19 M 0 -36 M FF 14 SF 0 -10 R ( void myshader\(\);)S 0 -51 M 0 -10 R ( vpSetCallback\(vpc, VP_GRAY_SHADE_FUNC, myshader\);)S 0 -66 M 0 -83 M RF 17 SF 0 -13 R (The function )S FF 17 SF (myshader\(\))S RF 17 SF ( can do whatever you like to compute a color. See the man page for )S 0 -102 M FF 17 SF 0 -13 R (vpSetCallback\(\))S RF 17 SF ( for more details. Using callback functions can lead to significant performance degradation)S 0 -121 M 0 -13 R (during rendering. )S 0 -140 M 0 -157 M 0 -13 R (There is one more shading option which is independent of the shading model you choose: depth cueing. Depth cueing)S 0 -176 M 0 -13 R (allows you to introduce black "fog" which makes more distant voxels appear darker then voxels which are close to)S 0 -195 M 0 -13 R (the viewer, thereby making it easier to distinguish foreground objects from background objects. To enable depth)S 0 -214 M 0 -13 R (cueing call )S FF 17 SF (vpEnable\(\))S RF 17 SF (: )S 0 -233 M 0 -250 M FF 14 SF 0 -10 R ( vpEnable\(vpc, VP_DEPTH_CUE, 1\);)S 0 -265 M 0 -282 M RF 17 SF 0 -13 R (You can use )S FF 17 SF (vpSetDepthCueing\(\))S RF 17 SF ( to change the depth cueing parameters: )S 0 -301 M 0 -318 M FF 14 SF 0 -10 R ( vpResult)S 0 -333 M 0 -10 R ( vpSetDepthCueing\(vpContext *vpc, double front_factor,)S 0 -348 M 0 -10 R ( double density\);)S 0 -363 M 0 -380 M FF 17 SF 0 -13 R (Front_factor)S RF 17 SF ( is the transparency of the fog at the front plane of the viewing volume. It must be a positive)S 0 -399 M 0 -13 R (number and it is usually less than 1.0 \(although larger numbers can be used to brighten the foreground\). )S FF 17 SF (Density)S 0 -418 M RF 17 SF 0 -13 R (controls the "density" of the fog, or how rapidly objects recede into darkness. The equation for the transparency of)S 0 -437 M 0 -13 R (the fog is: )S 0 -456 M 20 -473 M 0 -13 R (T = front_factor * exp\(-density * depth\) )S 20 -492 M 0 -509 M 0 -13 R (where "depth" is 0 at the front plane of the viewing volume and 1 at the back plane. Each voxel color component is)S 0 -528 M 0 -13 R (multiplied by the fog transparency during rendering. )S 0 -547 M 0 -564 M 0 -13 R (VolPack also supports a fast one-pass shadow algorithm implemented with lookup tables \(in a similar fashion to the)S 0 -583 M 0 -13 R (procedure described above\). See the man page for )S FF 17 SF (vpSetShadowLookupShader)S RF 17 SF (. )S 0 -602 M 0 -619 M BF 17 SF 0 -14 R (Images )S 0 -639 M 0 -656 M RF 17 SF 0 -13 R (The last step before rendering is to declare the array that VolPack should store the image into. Use )S FF 17 SF (vpSetImage)S RF 17 SF (: )S 0 -675 M 0 -692 M FF 14 SF 0 -10 R ( vpResult)S 0 -707 M 0 -10 R ( vpSetImage\(vpContext *vpc, unsigned char *image, int width,)S 0 -722 M 0 -10 R ( int height, int bytes_per_scan, int pixel_type\);)S 0 -737 M 0 -754 M FF 17 SF 0 -13 R (Image)S RF 17 SF ( is a pointer to the array for the image. The next two arguments are the size of the image. These arguments)S 0 -773 M 0 -13 R (also implicitly determine the viewport transformation: the clip coordinates are scaled to make the left, right, top and)S 0 -792 M 0 -13 R (bottom planes of the viewing volume align with the sides of the image. The next argument is the number of bytes in)S 0 -811 M 0 -13 R (one scanline of the image. This argument can be used to add padding to the end of each scanline in case the image)S 0 -830 M 0 -13 R (display routines on your system impose alignment restrictions on the beginning of each scanline. Finally, the last)S 0 -849 M 0 -13 R (argument is a code that specifies the format of the pixels in the image. The following formats are allowed: )S 0 -868 M 0 -885 M FF 17 SF 0 -13 R (VP_ALPHA)S RF 17 SF ( )S 48 -904 M 0 -13 R (opacity \(1 byte/pixel\) )S 0 -923 M FF 17 SF 0 -13 R (VP_LUMINANCE)S RF 17 SF ( )S 48 -942 M 0 -13 R (grayscale color \(1 byte/pixel\) )S 0 -961 M FF 17 SF 0 -13 R (VP_LUMINANCEA)S RF 17 SF ( )S 48 -980 M 0 -13 R (grayscale color plus opacity \(2 bytes/pixel\) )S 0 -999 M FF 17 SF 0 -13 R (VP_RGB)S RF 17 SF ( )S 48 -1018 M 0 -13 R (RGB color \(3 bytes/pixel\) )S 0 -1037 M FF 17 SF 0 -13 R (VP_RGBA)S RF 17 SF ( )S 48 -1056 M 0 -13 R (RGB color plus opacity \(4 bytes/pixel\) )S 0 -1075 M FF 17 SF 0 -13 R (VP_BGR)S RF 17 SF ( )S 48 -1094 M 0 -13 R (RGB color, byte-swapped \(3 bytes/pixel\) )S 0 -1113 M FF 17 SF 0 -13 R (VP_ABGR)S RF 17 SF ( )S 48 -1132 M 0 -13 R (RGB color plus opacity, bytes-swapped \(4 bytes/pixel\) )S 48 -1151 M 0 -1168 M 0 -13 R (Use the luminance formats only with grayscale shaders, and the RGB formats only with color shaders. The image)S 0 -1187 M 0 -13 R (should have dimensions: )S 0 -1206 M showpage restore %%Page: 13 13 save NP RF 17 SF 0 0 M FF 14 SF 0 -10 R ( unsigned char image[bytes_per_scan][height][bytes_per_pixel];)S 0 -15 M 0 -32 M RF 17 SF 0 -13 R (where )S FF 17 SF (bytes_per_pixel)S RF 17 SF ( is the size of the pixel as determined by the pixel format. )S 0 -51 M 0 -68 M BF 17 SF 0 -14 R (Rendering )S 0 -88 M 0 -105 M RF 17 SF 0 -13 R (VolPack provides two rendering routines. The first routine is used to render pre-classified volumes which are)S 0 -124 M 0 -13 R (created with the routines in the )S (Classified Volumes)S ( subsection: )S 0 -143 M 0 -160 M FF 14 SF 0 -10 R ( vpResult)S 0 -175 M 0 -10 R ( vpRenderClassifiedVolume\(vpContext *vpc\);)S 0 -190 M 0 -207 M RF 17 SF 0 -13 R (This routine uses the current viewing and shading parameters to render the classified volume stored in the rendering)S 0 -226 M 0 -13 R (context. The result is placed in the image buffer declared with )S FF 17 SF (vpSetImage\(\))S RF 17 SF (. )S 0 -245 M 0 -262 M 0 -13 R (The second routine is used to render unclassified volumes which are created with the routines in the )S (Volumes)S 0 -281 M 0 -13 R (subsection: )S 0 -300 M 0 -317 M FF 14 SF 0 -10 R ( vpResult)S 0 -332 M 0 -10 R ( vpRenderRawVolume\(vpContext *vpc\);)S 0 -347 M 0 -364 M RF 17 SF 0 -13 R (This routine is identical to )S FF 17 SF (vpRenderClassifiedVolume\(\))S RF 17 SF ( except that the source of the volume data is the)S 0 -383 M 0 -13 R (raw volume data stored in the rendering context, and the volume data is classified on-the-fly during rendering. If a)S 0 -402 M 0 -13 R (min-max octree data structure is present in the rendering context then it is used to accelerate rendering. However,)S 0 -421 M 0 -13 R (even with the octree this routine is slower than )S FF 17 SF (vpRenderClassifiedVolume\(\))S RF 17 SF ( because of the additional)S 0 -440 M 0 -13 R (work which must be performed. )S 0 -459 M 0 -476 M 0 -13 R (There is one important state variable which can be used to improve rendering performance: the maximum ray)S 0 -495 M 0 -13 R (opacity threshold. During compositing, if the opacity of an image pixel reaches this threshold then no more voxel)S 0 -514 M 0 -13 R (data is composited into the pixel. The threshold should be a number slightly less than one \(0.95 is a good value\), so)S 0 -533 M 0 -13 R (that there is very little image degradation but voxels which do not make a significant contribution to the image can)S 0 -552 M 0 -13 R (be skipped. You set the threshold with )S FF 17 SF (vpSetd\(\))S RF 17 SF ( and the )S FF 17 SF (VP_MAX_RAY_OPACITY)S RF 17 SF ( option. For example: )S 0 -571 M 0 -588 M FF 14 SF 0 -10 R ( vpSetd\(vpc, VP_MAX_RAY_OPACITY, 0.95\);)S 0 -603 M 0 -620 M BF 17 SF 0 -14 R (State Variables )S 0 -640 M 0 -657 M RF 17 SF 0 -13 R (The previous subsections have described many routines which set state variables in a rendering context. This)S 0 -676 M 0 -13 R (subsection briefly mentions the routines available to retrieve the values of these variables. )S 0 -695 M 0 -712 M 0 -13 R (The function )S FF 17 SF (vpGeti\(\))S RF 17 SF ( is used to retrieve integer state variables: )S 0 -731 M 0 -748 M FF 14 SF 0 -10 R ( vpResult)S 0 -763 M 0 -10 R ( vpGeti\(vpContext *vpc, int option, int *iptr\);)S 0 -778 M 0 -795 M FF 17 SF 0 -13 R (Option)S RF 17 SF ( is a constant indicating the particular value you wish to get. The man page for )S FF 17 SF (vpGeti)S RF 17 SF ( lists all of the)S 0 -814 M 0 -13 R (options. The value is stored in the integer pointed to by )S FF 17 SF (iptr)S RF 17 SF (. As always, the return value of the routine is a result)S 0 -833 M 0 -13 R (code \(not the state variable value\). )S 0 -852 M 0 -869 M 0 -13 R (To retrieve floating-point state variables used )S FF 17 SF (vpGetd\(\))S RF 17 SF (: )S 0 -888 M 0 -905 M FF 14 SF 0 -10 R ( vpResult)S 0 -920 M 0 -10 R ( vpGetd\(vpContext *vpc, int option, double *dptr\);)S 0 -935 M 0 -952 M RF 17 SF 0 -13 R (This routine stores its result in the double pointed to by )S FF 17 SF (dptr)S RF 17 SF (. To retrieve pointers \(e.g. the current raw volume data)S 0 -971 M 0 -13 R (pointer\) use )S FF 17 SF (vpGetp)S RF 17 SF (: )S 0 -990 M 0 -1007 M FF 14 SF 0 -10 R ( vpResult)S 0 -1022 M 0 -10 R ( vpGetp\(vpContext *vpc, int option, void **pptr\);)S 0 -1037 M 0 -1054 M FF 17 SF 0 -13 R (Pptr)S RF 17 SF ( is a pointer to a pointer, so the value of the state variable is stored in )S FF 17 SF (*ptr)S RF 17 SF (. Transformation matrices can be)S 0 -1073 M 0 -13 R (retrieved with )S FF 17 SF (vpGetMatrix\(\))S RF 17 SF (: )S 0 -1092 M 0 -1109 M FF 14 SF 0 -10 R ( vpResult)S 0 -1124 M 0 -10 R ( vpGetMatrix\(vpContext *vpc, int option, vpMatrix4 m\);)S 0 -1139 M 0 -1156 M RF 17 SF 0 -13 R (The matrix values are stored in )S FF 17 SF (m)S RF 17 SF (. )S 0 -1175 M 0 -1192 M 0 -13 R (Lighting and material parameters can be retrieved with )S FF 17 SF (vpGetLight\(\))S RF 17 SF ( and )S FF 17 SF (vpGetMaterial\(\))S RF 17 SF ( which have)S 0 -1211 M 0 -13 R (arguments which are similar to the corresponding functions to set these parameters. )S showpage restore %%Page: 14 14 save NP RF 17 SF 0 0 M 0 -17 M BF 17 SF 0 -14 R (Utility Functions )S 0 -37 M 0 -54 M RF 17 SF 0 -13 R (VolPack provides a small collection of convenient utility functions. First, there are routines to store volume data)S 0 -73 M 0 -13 R (structures in files and load them back into a rendering context. They allow you to perform all of the)S 0 -92 M 0 -13 R (time-consuming preprocessing steps once and save the results in a file. See the man pages for the following routines:)S 0 -111 M 48 -128 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpStoreRawVolume\(\))S RF 17 SF ( )S 48 -147 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpLoadRawVolume\(\))S RF 17 SF ( )S 48 -166 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpStoreClassifiedVolume\(\))S RF 17 SF ( )S 48 -185 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpLoadClassifiedVolume\(\))S RF 17 SF ( )S 48 -204 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpStoreMinMaxOctree\(\))S RF 17 SF ( )S 48 -223 M 0 -10 R 3.454545 B FF 17 SF 0 -3 R (vpLoadMinMaxOctree\(\))S RF 17 SF ( )S 48 -242 M 0 -259 M 0 -13 R (The routine )S FF 17 SF (vpExtract\(\))S RF 17 SF ( allows you to extract a rectangular solid region from either the raw volume data or the)S 0 -278 M 0 -13 R (classified volume data. You can extract individual fields of the volume \(e.g. just the scalar data\), or computed values)S 0 -297 M 0 -13 R (\(e.g. opacity computed with the current classification function\). )S 0 -316 M 0 -333 M 0 -13 R (The routine )S FF 17 SF (vpTranspose\(\))S RF 17 SF ( allows you to transpose the raw volume data. This can be useful to improve)S 0 -352 M 0 -13 R (rendering performance for very large volumes. You can use )S FF 17 SF (vpGeti)S RF 17 SF ( with the )S FF 17 SF (VP_VIEW_AXIS)S RF 17 SF ( option to)S 0 -371 M 0 -13 R (determine how the volume should be transposed for optimum performance given the current viewing parameters. )S 0 -390 M 0 -407 M 0 -13 R (The routine )S FF 17 SF (vpResample\(\))S RF 17 SF ( allows you to scale a volume to a different resolution using a variety of resampling)S 0 -426 M 0 -13 R (filters. It is useful for scaling very large volumes down to a smaller size for fast previewing, or to filter)S 0 -445 M 0 -13 R (low-resolution data sets to a higher resolution with a high-quality filter before rendering. )S 0 -464 M 0 -481 M BF 17 SF 0 -14 R (Result Codes and Error Handling )S 0 -501 M 0 -518 M RF 17 SF 0 -13 R (Almost all of the routines in VolPack return a result of type )S FF 17 SF (vpResult)S RF 17 SF ( which is an integer. Routines return the)S 0 -537 M 0 -13 R (value )S FF 17 SF (VP_OK)S RF 17 SF ( to indicate success. Any other value indicates an error. See the man page for each function for the)S 0 -556 M 0 -13 R (possible error codes and their specific meanings. )S 0 -575 M 0 -592 M 0 -13 R (When an error occurs VolPack also records the error code in the rendering context. You can retrieve the error code)S 0 -611 M 0 -13 R (later by calling )S FF 17 SF (vpGetError\(\))S RF 17 SF (. If another error occurs before you call )S FF 17 SF (vpGetError\(\))S RF 17 SF ( then only the first one)S 0 -630 M 0 -13 R (is returned. The recorded value is then reset. )S 0 -649 M 0 -666 M 0 -13 R (The routine )S FF 17 SF (vpGetErrorString\(\))S RF 17 SF ( can be used to convert an error code into a printable string. )S 0 -685 M 0 -702 M BF 18 SF 0 -15 R (Section 3: Tips and Pointers )S 0 -723 M 0 -740 M BF 17 SF 0 -14 R (Maximizing Rendering Speed )S 0 -760 M 0 -777 M RF 17 SF 0 -13 R (There are several techniques to keep in mind to get the maximum possible performance out of VolPack. First of all,)S 0 -796 M 0 -13 R (use the appropriate rendering algorithm for the task at hand. If you want to render a volume from several viewpoints)S 0 -815 M 0 -13 R (without changing the classification function then it is well worth the time to preprocess the volume into the)S 0 -834 M 0 -13 R (run-length encoded format before rendering. Use the min-max octree data structure if the classification function)S 0 -853 M 0 -13 R (does change for every rendering but the volume data remains fixed. )S 0 -872 M 0 -889 M 0 -13 R (Second, choose the various thresholds carefully. Changing the minimum opacity threshold for classification and the)S 0 -908 M 0 -13 R (maximum ray opacity for rendering can have a big impact on rendering speed. Changing the parameter range)S 0 -927 M 0 -13 R (thresholds for the min-max octree can also improve performance. )S 0 -946 M 0 -963 M 0 -13 R (Third, minimize the need for reallocating internal data structures by predeclaring their sizes. Internal buffers are)S 0 -982 M 0 -13 R (used to store an intermediate image during rendering and a depth cueing lookup table. The sizes of these tables can)S 0 -1001 M 0 -13 R (change as the viewing parameters change, so the tables may have to be reallocated over the course of a multi-frame)S 0 -1020 M 0 -13 R (rendering loop. You can give VolPack "hints" for the sizes of these data structures using )S FF 17 SF (vpSeti\(\))S RF 17 SF ( with the )S 0 -1039 M FF 17 SF 0 -13 R (VP_INT_WIDTH_HINT)S RF 17 SF (, )S FF 17 SF (VP_INT_HEIGHT_HINT)S RF 17 SF ( and )S FF 17 SF (VP_DEPTH_CUE_SIZE_HINT)S RF 17 SF ( options. )S 0 -1058 M 0 -1075 M 0 -13 R (Finally, if you are using )S FF 17 SF (vpRenderRawVolume\(\))S RF 17 SF ( with a large volume then you may need to transpose the)S 0 -1094 M 0 -13 R (volume as the viewing direction changes from one principal axis to another. )S 0 -1113 M 0 -1130 M BF 17 SF 0 -14 R (Maximizing Image Quality )S 0 -1150 M 0 -1167 M RF 17 SF 0 -13 R (There are two important techniques which will help you to produce images free from distracting aliasing artifacts.)S 0 -1186 M 0 -13 R (The first is to choose classification functions that are fairly smooth. Functions with discontinuities or very abrupt)S 0 -1205 M 0 -13 R (transitions introduce very sharp transitions in the classified volume, and these transitions may be too sharp to be)S showpage restore %%Page: 15 15 save NP RF 17 SF 0 0 M 0 -13 R (properly sampled. The result can be jagged boundaries and spurious patterns in the rendered image. These artifacts)S 0 -19 M 0 -13 R (may be difficult to distinguish from the information in the data set. To diagnose this problem, try extracting slices)S 0 -38 M 0 -13 R (of classified volume data with )S FF 17 SF (vpExtract\(\))S RF 17 SF ( and check if the opacity images contain a lot of aliasing. Smooth)S 0 -57 M 0 -13 R (transitions will produce the best images. )S 0 -76 M 0 -93 M 0 -13 R (The second technique is to prefilter the volume data with a high-quality filter before scaling or zooming, rather than)S 0 -112 M 0 -13 R (using the viewing transformation to do the scaling. There are two reasons that prefiltering may help. The rendering)S 0 -131 M 0 -13 R (routines use a simple bilinear reconstruction filter, but if you prefilter you can use a higher-quality filter which does)S 0 -150 M 0 -13 R (a better job of reconstruction. Furthermore, the resolution of the rendered image is limited by the number of samples)S 0 -169 M 0 -13 R (in the volume, so very large magnification factors produce visible aliasing artifacts. Upscaling the volume with a)S 0 -188 M 0 -13 R (high-quality filter before rendering can solve this problem. Several utility routines, described in the )S 0 -207 M FF 17 SF 0 -13 R (vpResample\(\))S RF 17 SF ( man page, are provided for prefiltering a volume. )S 0 -226 M 0 -243 M BF 17 SF 0 -14 R (Software Support )S 0 -263 M 0 -280 M RF 17 SF 0 -13 R (If you have problems, bug reports or bug fixes, please send mail to: )S 0 -299 M 20 -316 M IF 17 SF 0 -13 R (volpack@graphics.stanford.edu )S 20 -335 M 0 -352 M RF 17 SF 0 -13 R (The author makes no commitment to fix bugs or provide support. However, future releases with fixes and)S 0 -371 M 0 -13 R (enhancements are planned. )S 0 -390 M 0 -407 M 0 -13 R (If you wish to be informed of future updates to the software then you should subscribe to the volpack-announce)S 0 -426 M 0 -13 R (mailing list. To do so, send an email message to )S 0 -445 M 20 -462 M IF 17 SF 0 -13 R (majordomo@lists.stanford.edu )S 20 -481 M 0 -498 M RF 17 SF 0 -13 R (with the following message body: )S 0 -517 M 20 -534 M 0 -13 R (subscribe volpack-announce )S 20 -553 M 0 -570 M 0 -13 R (To be removed from the list, send the message: )S 0 -589 M 20 -606 M 0 -13 R (unsubscribe volpack-announce )S 20 -625 M 0 -642 M 0 -13 R (Mail will be sent to the list only to announce bug fixes and new releases. )S 0 -661 M 0 -678 M 0 -13 R (If you like the library then drop us a note describing what you use it for! )S 0 -697 M 0 -714 M BF 17 SF 0 -14 R (Obtaining the Software )S 0 -734 M 0 -751 M RF 17 SF 0 -13 R (VolPack is available from the Stanford Computer Graphics Laboratory's Web page )S 0 -770 M 0 -13 R (\(http://www-graphics.stanford.edu/software/volpack/#Distribution\) )S (or via anonymous ftp)S 0 -789 M 0 -13 R (\(ftp://www-graphics.stanford.edu/pub/volpack/\). )S 0 -808 M 805 HR 0 -827 M 0 -13 R (Last update: 16 December 1994 )S 0 -846 M IF 17 SF 0 -13 R (volpack@graphics.stanford.edu )S showpage restore %%Trailer restore %%Pages: 15 ccseapps-2.5/CCSEApps/volpack/vp_view.c0000644000175000017500000010403511634153073021144 0ustar amckinstryamckinstry/* * vp_view.c * * Routines to compute quantities derived from the view transformation. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:04 $ * $Revision: 1.2 $ */ #include "vp_global.h" static int FactorAffineView ANSI_ARGS((vpContext *vpc, vpMatrix4 vm)); static int FactorPerspectiveView ANSI_ARGS((vpContext *vpc, vpMatrix4 vm)); static void ComputeAffineOpacityCorrection ANSI_ARGS((vpContext *vpc, double shear_i, double shear_j, float table[VP_OPACITY_MAX+1])); static void CheckRenderBuffers ANSI_ARGS((vpContext *vpc)); static void ComputeLightViewTransform ANSI_ARGS((vpContext *vpc,vpMatrix4 vm)); static int FactorLightView ANSI_ARGS((vpContext *vpc, vpMatrix4 vm)); static void CheckShadowBuffer ANSI_ARGS((vpContext *vpc)); /* * VPFactorView * * Factor the viewing matrix. */ vpResult VPFactorView(vpc) vpContext *vpc; { vpMatrix4 vm; int retcode; if (vpc->factored_view_ready) { CheckRenderBuffers(vpc); return(VP_OK); } /* compute the overall view transformation */ VPComputeViewTransform(vpc, vm); /* check if transformation is affine and factor it */ if (fabs(vm[3][0]) < VP_EPS && fabs(vm[3][1]) < VP_EPS && fabs(vm[3][2]) < VP_EPS && fabs(vm[3][3]-1.) < VP_EPS) { if ((retcode = FactorAffineView(vpc, vm)) != VP_OK) return(retcode); ComputeAffineOpacityCorrection(vpc, vpc->shear_i, vpc->shear_j, vpc->affine_opac_correct); } else { FactorPerspectiveView(vpc, vm); } CheckRenderBuffers(vpc); /* compute viewing transformation from the point of view of the light source (for calculating shadows) */ if ((retcode = VPCheckShadows(vpc)) != VP_OK) return(retcode); if (vpc->enable_shadows) { ComputeLightViewTransform(vpc, vm); if ((retcode = FactorLightView(vpc, vm)) != VP_OK) return(retcode); ComputeAffineOpacityCorrection(vpc, vpc->shadow_shear_i, vpc->shadow_shear_j, vpc->shadow_opac_correct); CheckShadowBuffer(vpc); } return(VP_OK); } /* * VPComputeViewTransform * * Compute the overall view transformation. */ void VPComputeViewTransform(vpc, vm) vpContext *vpc; vpMatrix4 vm; /* storage for result */ { vpMatrix4 prematrix; /* transform volume to unit cube */ vpMatrix4 viewportm; /* viewport matrix */ vpMatrix4 tmp1m, tmp2m, tmp3m; /* temporary matrices */ int maxdim; double scale; /* compute prematrix */ vpIdentity4(prematrix); maxdim = vpc->xlen; if (vpc->ylen > maxdim) maxdim = vpc->ylen; if (vpc->zlen > maxdim) maxdim = vpc->zlen; scale = 1. / (double)maxdim; prematrix[0][0] = scale; prematrix[1][1] = scale; prematrix[2][2] = scale; prematrix[0][3] = -vpc->xlen * scale * 0.5; prematrix[1][3] = -vpc->ylen * scale * 0.5; prematrix[2][3] = -vpc->zlen * scale * 0.5; /* compute the viewport matrix */ vpIdentity4(viewportm); viewportm[0][0] = 0.5 * vpc->image_width; viewportm[0][3] = 0.5 * vpc->image_width; viewportm[1][1] = 0.5 * vpc->image_height; viewportm[1][3] = 0.5 * vpc->image_height; viewportm[2][2] = -0.5; /* minus sign: switch to left-handed coords. */ viewportm[2][3] = 0.5; /* compute the view matrix */ vpMatrixMult4(tmp1m, vpc->transforms[VP_MODEL], prematrix); vpMatrixMult4(tmp2m, vpc->transforms[VP_VIEW], tmp1m); vpMatrixMult4(tmp3m, vpc->transforms[VP_PROJECT], tmp2m); vpMatrixMult4(vm, viewportm, tmp3m); } /* * FactorAffineView * * Factor an affine viewing matrix into two parts: * 1) A shear and translation which map object coordinates into * intermediate image coordinates. * 2) An affine warp which transforms intermediate image coordinates to * image coordinates. * Return value is a result code. */ static int FactorAffineView(vpc, vm) vpContext *vpc; vpMatrix4 vm; { vpMatrix4 p; /* permutation matrix */ vpMatrix4 pvm; /* permutation of the viewing matrix */ int icount, jcount, kcount; /* dimensions of volume in rotated space */ vpVector4 xobj, yobj, zobj; vpVector4 xim, yim, zim; double x, y, z, denom; Debug((vpc, VPDEBUG_VIEW, "FactorAffineView\n")); vpc->affine_view = 1; /* * Transform the unit x, y and z object-coordinate vectors into image * space and see which one is most aligned with the view direction * (which is the z-axis in image coordinates). */ vpSetVector4(xobj, 1., 0., 0., 0.); vpSetVector4(yobj, 0., 1., 0., 0.); vpSetVector4(zobj, 0., 0., 1., 0.); vpMatrixVectorMult4(xim, vm, xobj); vpMatrixVectorMult4(yim, vm, yobj); vpMatrixVectorMult4(zim, vm, zobj); x = fabs((vpNormalize3(xim) == VPERROR_SINGULAR) ? 0. : xim[2]); y = fabs((vpNormalize3(yim) == VPERROR_SINGULAR) ? 0. : yim[2]); z = fabs((vpNormalize3(zim) == VPERROR_SINGULAR) ? 0. : zim[2]); if (x >= y) { if (x >= z) { vpc->best_view_axis = VP_X_AXIS; } else { vpc->best_view_axis = VP_Z_AXIS; } } else { if (y >= z) { vpc->best_view_axis = VP_Y_AXIS; } else { vpc->best_view_axis = VP_Z_AXIS; } } switch (vpc->axis_override) { case VP_X_AXIS: if (x < VP_EPS) return(VPSetError(vpc, VPERROR_SINGULAR)); vpc->best_view_axis = VP_X_AXIS; break; case VP_Y_AXIS: if (y < VP_EPS) return(VPSetError(vpc, VPERROR_SINGULAR)); vpc->best_view_axis = VP_Y_AXIS; break; case VP_Z_AXIS: if (z < VP_EPS) return(VPSetError(vpc, VPERROR_SINGULAR)); vpc->best_view_axis = VP_Z_AXIS; break; default: break; } /* permute the rows of the viewing matrix so that the third axis is most parallel to the viewing direction */ bzero(p, sizeof(vpMatrix4)); switch (vpc->best_view_axis) { case VP_X_AXIS: p[0][2] = 1.; p[1][0] = 1.; p[2][1] = 1.; p[3][3] = 1.; icount = vpc->ylen; jcount = vpc->zlen; kcount = vpc->xlen; break; case VP_Y_AXIS: p[0][1] = 1.; p[1][2] = 1.; p[2][0] = 1.; p[3][3] = 1.; icount = vpc->zlen; jcount = vpc->xlen; kcount = vpc->ylen; break; case VP_Z_AXIS: p[0][0] = 1.; p[1][1] = 1.; p[2][2] = 1.; p[3][3] = 1.; icount = vpc->xlen; jcount = vpc->ylen; kcount = vpc->zlen; break; } vpMatrixMult4(pvm, vm, p); /* compute the shear coefficients */ denom = pvm[0][0]*pvm[1][1] - pvm[0][1]*pvm[1][0]; if (fabs(denom) < VP_EPS) return(VPSetError(vpc, VPERROR_SINGULAR)); vpc->shear_i = (pvm[0][2]*pvm[1][1] - pvm[0][1]*pvm[1][2]) / denom; vpc->shear_j = (pvm[0][0]*pvm[1][2] - pvm[1][0]*pvm[0][2]) / denom; if (pvm[2][0]*vpc->shear_i + pvm[2][1]*vpc->shear_j - pvm[2][2] > 0) vpc->reverse_slice_order = 0; else vpc->reverse_slice_order = 1; /* compute the intermediate image size */ vpc->intermediate_width = icount + 1 + (int)ceil((kcount-1)* fabs(vpc->shear_i)); vpc->intermediate_height = jcount + 1 + (int)ceil((kcount-1)* fabs(vpc->shear_j)); /* compute the translation coefficients */ if (vpc->shear_i >= 0.) vpc->trans_i = 1.; else vpc->trans_i = 1. - vpc->shear_i * (kcount - 1); if (vpc->shear_j >= 0.) vpc->trans_j = 1.; else vpc->trans_j = 1. - vpc->shear_j * (kcount - 1); /* compute the depth coefficients */ vpc->depth_di = pvm[2][0]; vpc->depth_dj = pvm[2][1]; vpc->depth_dk = pvm[2][2]; vpc->depth_000 = pvm[2][3]; /* compute the mapping from compositing space to image space */ vpc->warp_2d[0][0] = pvm[0][0]; vpc->warp_2d[0][1] = pvm[0][1]; vpc->warp_2d[0][2] = pvm[0][3] - pvm[0][0]*vpc->trans_i - pvm[0][1]*vpc->trans_j; vpc->warp_2d[1][0] = pvm[1][0]; vpc->warp_2d[1][1] = pvm[1][1]; vpc->warp_2d[1][2] = pvm[1][3] - pvm[1][0]*vpc->trans_i - pvm[1][1]*vpc->trans_j; vpc->warp_2d[2][0] = 0.; vpc->warp_2d[2][1] = 0.; vpc->warp_2d[2][2] = 1.; vpc->factored_view_ready = 1; Debug((vpc, VPDEBUG_VIEW, " best_view_axis: %c%c\n", vpc->reverse_slice_order ? '-' : '+', vpc->best_view_axis == VP_X_AXIS ? 'x' : (vpc->best_view_axis == VP_Y_AXIS ? 'y' : 'z'))); Debug((vpc, VPDEBUG_VIEW, " shear factors: %g %g\n", vpc->shear_i, vpc->shear_j)); Debug((vpc, VPDEBUG_VIEW, " translation: %g %g\n", vpc->trans_i, vpc->trans_j)); Debug((vpc, VPDEBUG_VIEW, " depth: d000: %g\n", vpc->depth_000)); Debug((vpc, VPDEBUG_VIEW, " di: %g\n", vpc->depth_di)); Debug((vpc, VPDEBUG_VIEW, " dj: %g\n", vpc->depth_dj)); Debug((vpc, VPDEBUG_VIEW, " dk: %g\n", vpc->depth_dk)); Debug((vpc, VPDEBUG_VIEW, " intermediate image size: %d %d\n", vpc->intermediate_width, vpc->intermediate_height)); return(VP_OK); } /* * FactorPerspectiveView * * Factor a perspective view matrix into two parts: * 1) A shear, translation and scale which map object coordinates into * intermediate image coordinates. * 2) A perspective warp which transforms intermediate image coordinates to * image coordinates. */ static int FactorPerspectiveView(vpc, vm) vpContext *vpc; vpMatrix4 vm; { vpc->affine_view = 0; return(VP_OK); #ifdef notdef Matrix4 p; /* permutation matrix */ Matrix4 pvm; /* permutation of the viewing matrix */ Matrix4 m2d; /* final warp */ Matrix4 t; double alpha1, alpha2, alpha3, alpha4; int icount, jcount, kcount; /* dimensions of volume in rotated space */ Vector4 xobj, yobj, zobj; double x, y, z, denom; double i0, j0, i1, j1; double imin, imax, jmin, jmax; Debug((DEBUG_VIEW, "FactorPerspectiveView\n")); rbuf->perspective_proj = 1; /* * Transform the unit x, y and z object-coordinate vectors into image * space and see which one is most aligned with the view direction * (which is the z-axis in image coordinates). */ xobj[0] = 1.; xobj[1] = 0.; xobj[2] = 0.; xobj[3] = 0.; yobj[0] = 0.; yobj[1] = 1.; yobj[2] = 0.; yobj[3] = 0.; zobj[0] = 0.; zobj[1] = 0.; zobj[2] = 1.; zobj[3] = 0.; TransformVector4(xobj, view->view_matrix); TransformVector4(yobj, view->view_matrix); TransformVector4(zobj, view->view_matrix); /* normalize each vector to unit length and compare the absolute value of the z component; note that the w component drops out */ xobj[2] = fabs(xobj[2]); yobj[2] = fabs(yobj[2]); zobj[2] = fabs(zobj[2]); x = (xobj[2] < EPS) ? 0. : (xobj[2] / sqrt(xobj[0]*xobj[0] + xobj[1]*xobj[1] + xobj[2]*xobj[2])); y = (yobj[2] < EPS) ? 0. : (yobj[2] / sqrt(yobj[0]*yobj[0] + yobj[1]*yobj[1] + yobj[2]*yobj[2])); z = (zobj[2] < EPS) ? 0. : (zobj[2] / sqrt(zobj[0]*zobj[0] + zobj[1]*zobj[1] + zobj[2]*zobj[2])); if (x >= y) { if (x >= z) { rbuf->best_view_axis = VP_XAXIS; } else { rbuf->best_view_axis = VP_ZAXIS; } } else { if (y >= z) { rbuf->best_view_axis = VP_YAXIS; } else { rbuf->best_view_axis = VP_ZAXIS; } } /* permute the rows of the viewing matrix so that the third axis is most parallel to the viewing direction */ bzero(p, sizeof(Matrix4)); switch (rbuf->best_view_axis) { case VP_XAXIS: p[0][2] = 1.; p[1][0] = 1.; p[2][1] = 1.; p[3][3] = 1.; icount = ylen; jcount = zlen; kcount = xlen; break; case VP_YAXIS: p[0][1] = 1.; p[1][2] = 1.; p[2][0] = 1.; p[3][3] = 1.; icount = zlen; jcount = xlen; kcount = ylen; break; case VP_ZAXIS: p[0][0] = 1.; p[1][1] = 1.; p[2][2] = 1.; p[3][3] = 1.; icount = xlen; jcount = ylen; kcount = zlen; break; default: VPBug("wierd value for best_view_axis in FactorPerspectiveView\n"); } MatrixMult4(pvm, view->view_matrix, p); /* compute the magic alpha coefficients */ alpha1 = pvm[3][1] * (pvm[0][3]*pvm[1][2] - pvm[0][2]*pvm[1][3]) + pvm[3][2] * (pvm[0][1]*pvm[1][3] - pvm[0][3]*pvm[1][1]) + pvm[3][3] * (pvm[0][2]*pvm[1][1] - pvm[0][1]*pvm[1][2]); alpha2 = pvm[3][0] * (pvm[0][2]*pvm[1][3] - pvm[0][3]*pvm[1][2]) + pvm[3][2] * (pvm[0][3]*pvm[1][0] - pvm[0][0]*pvm[1][3]) + pvm[3][3] * (pvm[0][0]*pvm[1][2] - pvm[0][2]*pvm[1][0]); alpha3 = pvm[3][0] * (pvm[0][1]*pvm[1][2] - pvm[0][2]*pvm[1][1]) + pvm[3][1] * (pvm[0][2]*pvm[1][0] - pvm[0][0]*pvm[1][2]) + pvm[3][2] * (pvm[0][0]*pvm[1][1] - pvm[0][1]*pvm[1][0]); alpha4 = pvm[3][0] * (pvm[0][1]*pvm[1][3] - pvm[0][3]*pvm[1][1]) + pvm[3][1] * (pvm[0][3]*pvm[1][0] - pvm[0][0]*pvm[1][3]) + pvm[3][3] * (pvm[0][0]*pvm[1][1] - pvm[0][1]*pvm[1][0]); /* determine the order of the slices */ if (pvm[2][2] - (pvm[2][0]*alpha1 + pvm[2][1]*alpha2)/(alpha3+alpha4) > 0) rbuf->reverse_k_order = 1; else rbuf->reverse_k_order = 0; /* compute the scale coefficients */ rbuf->w_factor = alpha3 / alpha4; if (rbuf->reverse_k_order) rbuf->normalize_scale = 1. + rbuf->w_factor*(kcount-1); else rbuf->normalize_scale = 1.; /* compute the bounding box of the image in compositing space */ denom = 1. / (alpha4 + alpha3*(kcount-1)); i0 = rbuf->normalize_scale*alpha1*(kcount-1) * denom; j0 = rbuf->normalize_scale*alpha2*(kcount-1) * denom; i1 = rbuf->normalize_scale*(alpha4*icount + alpha1*(kcount-1)) * denom; j1 = rbuf->normalize_scale*(alpha4*jcount + alpha2*(kcount-1)) * denom; imin = MIN(0, i0); imax = MAX(rbuf->normalize_scale*icount, i1); jmin = MIN(0, j0); jmax = MAX(rbuf->normalize_scale*jcount, j1); /* compute the size of the intermediate image */ rbuf->intermediate_width = (int)ceil(imax - imin); rbuf->intermediate_height = (int)ceil(jmax - jmin); /* compute the translation and shear coefficients */ rbuf->shear_i = (rbuf->normalize_scale*alpha1 - alpha3*imin) / alpha4; rbuf->shear_j = (rbuf->normalize_scale*alpha2 - alpha3*jmin) / alpha4; rbuf->trans_i = -imin; rbuf->trans_j = -jmin; /* compute the depth coefficients */ rbuf->depth_di = pvm[2][0]; rbuf->depth_dj = pvm[2][1]; rbuf->depth_dk = pvm[2][2]; rbuf->depth_000 = pvm[2][3]; rbuf->w_di = pvm[3][0]; rbuf->w_dj = pvm[3][1]; rbuf->w_dk = pvm[3][2]; rbuf->w_000 = pvm[3][3]; /* compute the mapping from compositing space to image space */ Identity4(t); t[0][0] = 1. / rbuf->normalize_scale; t[1][1] = 1. / rbuf->normalize_scale; t[0][2] = -alpha1 / alpha4; t[1][2] = -alpha2 / alpha4; t[3][2] = -alpha3 / alpha4; t[0][3] = imin / rbuf->normalize_scale; t[1][3] = jmin / rbuf->normalize_scale; MatrixMult4(m2d, pvm, t); rbuf->warp_2d[0][0] = m2d[0][0]; rbuf->warp_2d[1][0] = m2d[1][0]; rbuf->warp_2d[2][0] = m2d[3][0]; rbuf->warp_2d[0][1] = m2d[0][1]; rbuf->warp_2d[1][1] = m2d[1][1]; rbuf->warp_2d[2][1] = m2d[3][1]; rbuf->warp_2d[0][2] = m2d[0][3]; rbuf->warp_2d[1][2] = m2d[1][3]; rbuf->warp_2d[2][2] = m2d[3][3]; #endif /* notdef */ } /* * ComputeAffineOpacityCorrection * * Precompute a lookup table which corrects opacity for an affine viewing * transformation. (Opacity correction accounts for variations in the * apparent thickness of a voxel depending on viewpoint.) */ static void ComputeAffineOpacityCorrection(vpc, shear_i, shear_j, table) vpContext *vpc; double shear_i; double shear_j; float table[VP_OPACITY_MAX+1]; { float voxel_size; int i; Debug((vpc, VPDEBUG_OPCCORRECT, "Computing affine opacity correction table.\n")); voxel_size = sqrt(1 + shear_i*shear_i + shear_j*shear_j); for (i = 0; i <= VP_OPACITY_MAX; i++) { #ifdef NO_OPAC_CORRECT table[i] = (double)i / (double)VP_OPACITY_MAX; #else table[i] = 1.-pow(1.-(double)i/(double)VP_OPACITY_MAX,voxel_size); #endif } } /* * CheckRenderBuffers * * Resize the buffers used during rendering, if necessary. */ static void CheckRenderBuffers(vpc) vpContext *vpc; { int new_max_width, new_max_height, new_max_scan; int resize = 0; /* determine if resizing is necessary */ if (vpc->intermediate_width > vpc->max_intermediate_width) { new_max_width = MAX(vpc->intermediate_width, vpc->int_image_width_hint); resize = 1; } else { new_max_width = MAX(vpc->max_intermediate_width, vpc->int_image_width_hint); } if (vpc->intermediate_height > vpc->max_intermediate_height) { new_max_height = MAX(vpc->intermediate_height, vpc->int_image_height_hint); resize = 1; } else { new_max_height = MAX(vpc->max_intermediate_height, vpc->int_image_height_hint); } new_max_scan = vpc->xlen; if (vpc->ylen > new_max_scan) new_max_scan = vpc->ylen; if (vpc->zlen > new_max_scan) new_max_scan = vpc->zlen; if (new_max_scan > vpc->max_scan_length) resize = 1; if (vpc->color_channels != vpc->intermediate_color_channels) resize = 1; /* resize */ if (resize) VPResizeRenderBuffers(vpc, new_max_width, new_max_height,new_max_scan); } /* * VPResizeRenderBuffers * * Resize the rendering buffers. */ void VPResizeRenderBuffers(vpc, max_width, max_height, max_scan) vpContext *vpc; int max_width; /* new width of the intermediate image */ int max_height; /* new height of the intermediate image */ int max_scan; /* new max. scanline length */ { /* free old buffers */ if (vpc->int_image.gray_intim != NULL) { Debug((vpc, VPDEBUG_RBUF, "Freeing old RenderBuffer(%d,%d,%d,%d)\n", vpc->max_intermediate_width, vpc->max_intermediate_height, vpc->max_scan_length, vpc->intermediate_color_channels)); Dealloc(vpc, vpc->int_image.gray_intim); } /* allocate new buffers */ Debug((vpc, VPDEBUG_RBUF, "Allocating RenderBuffer(%d,%d,%d,%d)\n", max_width, max_height, max_scan, vpc->color_channels)); vpc->max_intermediate_width = max_width; vpc->max_intermediate_height = max_height; vpc->max_scan_length = max_scan; vpc->intermediate_color_channels = vpc->color_channels; if (max_width > 0) { if (vpc->color_channels == 1) { Alloc(vpc, vpc->int_image.gray_intim, GrayIntPixel *, max_width * max_height * sizeof(GrayIntPixel), "int_image"); } else { Alloc(vpc, vpc->int_image.rgb_intim, RGBIntPixel *, max_width * max_height * sizeof(RGBIntPixel), "int_image"); } } else { vpc->int_image.gray_intim = NULL; } } /* * VPResizeDepthCueTable * * Resize the depth cueing table. */ void VPResizeDepthCueTable(vpc, entries, copy) vpContext *vpc; int entries; /* new number of table entries */ int copy; /* if true, copy old entries */ { float *new_dc_table; Debug((vpc, VPDEBUG_DEPTHCUE, "resizing dctable to %d entries (%s)\n", entries, copy ? "copy" : "nocopy")); if (entries == 0) { if (vpc->dc_table != NULL) { Dealloc(vpc, vpc->dc_table); vpc->dc_table = NULL; } vpc->dc_table_len = 0; } else { Alloc(vpc, new_dc_table, float *, entries * sizeof(float), "dc_table"); if (vpc->dc_table != NULL) { if (copy && vpc->dc_table_len > 0) { bcopy(vpc->dc_table, new_dc_table, MIN(vpc->dc_table_len, entries) * sizeof(float)); } Dealloc(vpc, vpc->dc_table); } vpc->dc_table = new_dc_table; vpc->dc_table_len = entries; } } /* * VPComputeDepthCueTable * * Compute entries in the depth cueing lookup table. */ void VPComputeDepthCueTable(vpc, first, last) vpContext *vpc; int first; /* first entry to compute */ int last; /* last entry to compute */ { int c; double delta_depth, front_factor, density; Debug((vpc, VPDEBUG_DEPTHCUE, "computing dctable entries %d to %d\n", first, last)); delta_depth = vpc->dc_quantization; front_factor = vpc->dc_front_factor; density = vpc->dc_density; for (c = first; c <= last; c++) vpc->dc_table[c] = front_factor * exp(-density*(1.0 - c*delta_depth)); } /* * VPSliceDepthCueRatio * * Return the ratio of the depth cueing factor for two adjacent slices * for an affine view. A constant factor is applied to all voxels in a * slice, and then a fixup is applied to the pixels of the intermediate * image. This produces the correct answer without having to compute * the depth of each voxel. */ float VPSliceDepthCueRatio(vpc) vpContext *vpc; { float delta_depth; /* change in depth between adjacent slices */ float slice_dc_ratio; /* return value */ if (!vpc->dc_enable) return(1.); delta_depth = vpc->depth_dk - vpc->depth_di*vpc->shear_i - vpc->depth_dj*vpc->shear_j; if (vpc->reverse_slice_order) delta_depth = -delta_depth; /* slice_dc_ratio = exp(-vpc->dc_density * (-delta_depth)) */ slice_dc_ratio = exp(vpc->dc_density * delta_depth); Debug((vpc, VPDEBUG_DEPTHCUE, "slice_dc_ratio = %f\n", slice_dc_ratio)); return(slice_dc_ratio); } /* * VPDepthCueIntImage * * Perform depth cueing on the intermediate image. */ void VPDepthCueIntImage(vpc, slicenum) vpContext *vpc; int slicenum; /* slice number corresponding to location of int. image */ { float pixel_depth_quant; /* depth of current pixel in image (multiplied by depth_quant) */ int pixel_depth_int; /* pixel_depth truncated to an integer */ float left_depth; /* depth of pixel on left edge of current scanline in image */ float left_depth_quant; /* left_depth * depth_quant */ float *dc_table; /* depth cueing table */ float depth_di, depth_dj; /* change in depth for a unit change in each rotated object space coordinate */ float depth_quant; /* number of quantization levels for depth */ float depth_di_quant; /* depth_di * depth_quant */ float depth_dj_quant; /* depth_dj * depth_quant */ float max_depth; /* maximum (closest) depth in image */ int max_depth_int; /* maximum quantized depth */ int i, j; /* intermediate image coordinates */ float slice_u, slice_v; /* sheared object space coordinates */ GrayIntPixel *gray_intim; /* image data (grayscale) */ RGBIntPixel *rgb_intim; /* image data (RGB) */ int width, height; /* size of intermediate image */ int c; #ifdef DEBUG float pix_depth; #endif Debug((vpc, VPDEBUG_DEPTHCUE, "depth cueing intermediate image\n")); /* check the size of the depth cueing table and enlarge if necessary */ width = vpc->intermediate_width; height = vpc->intermediate_height; depth_quant = 1.0 / vpc->dc_quantization; depth_di = vpc->depth_di; depth_dj = vpc->depth_dj; slice_u = vpc->shear_i * slicenum + vpc->trans_i; slice_v = vpc->shear_j * slicenum + vpc->trans_j; left_depth = vpc->depth_000 + vpc->depth_dk*slicenum - slice_u*depth_di - slice_v*depth_dj; if (depth_di > 0) { if (depth_dj > 0) { max_depth = left_depth + depth_di*width + depth_dj*height; } else { max_depth = left_depth + depth_di*width; } } else { if (depth_dj > 0) { max_depth = left_depth + depth_dj*height; } else { max_depth = left_depth; } } max_depth_int = max_depth * depth_quant; if (max_depth_int >= vpc->dc_table_len) { c = vpc->dc_table_len; VPResizeDepthCueTable(vpc, max_depth_int+1, 1); VPComputeDepthCueTable(vpc, c, vpc->dc_table_len-1); } dc_table = vpc->dc_table; depth_di_quant = depth_di * depth_quant; depth_dj_quant = depth_dj * depth_quant; left_depth_quant = left_depth * depth_quant; #ifdef DEBUG Debug((vpc, VPDEBUG_DEPTHCUE, "depth cueing at image corners:\n")); pix_depth = left_depth + 0*depth_di + 0*depth_dj; pixel_depth_int = (int)(pix_depth * depth_quant); if (pixel_depth_int < 0) pixel_depth_int = 0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d: depth = %10.6f, factor = %10.6f, table[%d] = %10.6f\n", 0, 0, pix_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - pix_depth)), pixel_depth_int, dc_table[pixel_depth_int])); pix_depth = left_depth + width*depth_di + 0*depth_dj; pixel_depth_int = (int)(pix_depth * depth_quant); if (pixel_depth_int < 0) pixel_depth_int = 0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d: depth = %10.6f, factor = %10.6f, table[%d] = %10.6f\n", width, 0, pix_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - pix_depth)), pixel_depth_int, dc_table[pixel_depth_int])); pix_depth = left_depth + width*depth_di + height*depth_dj; pixel_depth_int = (int)(pix_depth * depth_quant); if (pixel_depth_int < 0) pixel_depth_int = 0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d: depth = %10.6f, factor = %10.6f, table[%d] = %10.6f\n", width, height, pix_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - pix_depth)), pixel_depth_int, dc_table[pixel_depth_int])); pix_depth = left_depth + 0*depth_di + height*depth_dj; pixel_depth_int = (int)(pix_depth * depth_quant); if (pixel_depth_int < 0) pixel_depth_int = 0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d: depth = %10.6f, factor = %10.6f, table[%d] = %10.6f\n", 0, height, pix_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - pix_depth)), pixel_depth_int, dc_table[pixel_depth_int])); #endif /* DEBUG */ /* foreach pixel, compute depth and scale color by dc factor */ if (vpc->color_channels == 1) { gray_intim = vpc->int_image.gray_intim; for (j = height; j > 0; j--) { pixel_depth_quant = left_depth_quant; left_depth_quant += depth_dj_quant; for (i = width; i > 0; i--) { pixel_depth_int = pixel_depth_quant; pixel_depth_quant += depth_di_quant; if (pixel_depth_int < 0) pixel_depth_int = 0; if (pixel_depth_int >= vpc->dc_table_len) { VPBug("VPDepthCueIntImage: depth too large (%d >= %d)", pixel_depth_int, vpc->dc_table_len); } gray_intim->clrflt *= dc_table[pixel_depth_int]; gray_intim++; } /* for i */ } /* for j */ } else { rgb_intim = vpc->int_image.rgb_intim; for (j = height; j > 0; j--) { pixel_depth_quant = left_depth_quant; left_depth_quant += depth_dj_quant; for (i = width; i > 0; i--) { pixel_depth_int = pixel_depth_quant; pixel_depth_quant += depth_di_quant; if (pixel_depth_int < 0) pixel_depth_int = 0; if (pixel_depth_int >= vpc->dc_table_len) { VPBug("VPDepthCueIntImage: depth too large (%d >= %d)", pixel_depth_int, vpc->dc_table_len); } rgb_intim->rclrflt *= dc_table[pixel_depth_int]; rgb_intim->gclrflt *= dc_table[pixel_depth_int]; rgb_intim->bclrflt *= dc_table[pixel_depth_int]; rgb_intim++; } /* for i */ } /* for j */ } } /* * ComputeLightViewTransform * * Compute the view transformation from the point of view of the one * light source that produces shadows. */ static void ComputeLightViewTransform(vpc, vm) vpContext *vpc; vpMatrix4 vm; /* storage for result */ { vpMatrix4 prematrix; /* transform volume to unit cube */ vpMatrix4 viewportm; /* viewport matrix */ vpVector3 vpn; /* view plane normal */ vpVector3 vup; /* view up vector */ vpVector3 tmp1v, tmp2v; /* temporary vectors */ vpMatrix4 view; /* transform world coordinates to eye coordinates, with view direction equal to light vector */ vpMatrix4 tmp1m, tmp2m; /* temporary matrices */ double lx, ly, lz; /* components of light vector */ int light_index; int maxdim; double scale; /* check for errors */ ASSERT(vpc->shadow_light_num >= VP_LIGHT0 && vpc->shadow_light_num <= VP_LIGHT5); ASSERT(vpc->light_enable[vpc->shadow_light_num - VP_LIGHT0]); /* compute prematrix */ vpIdentity4(prematrix); maxdim = vpc->xlen; if (vpc->ylen > maxdim) maxdim = vpc->ylen; if (vpc->zlen > maxdim) maxdim = vpc->zlen; scale = 1. / (double)maxdim; prematrix[0][0] = scale; prematrix[1][1] = scale; prematrix[2][2] = scale; prematrix[0][3] = -vpc->xlen * scale * 0.5; prematrix[1][3] = -vpc->ylen * scale * 0.5; prematrix[2][3] = -vpc->zlen * scale * 0.5; /* compute the world-to-eye coordinate transformation */ light_index = vpc->shadow_light_num - VP_LIGHT0; lx = vpc->light_vector[light_index][0]; ly = vpc->light_vector[light_index][1]; lz = vpc->light_vector[light_index][2]; vpSetVector3(vpn, lx, ly, lz); if (fabs(lx) < fabs(ly)) { if (fabs(lx) < fabs(lz)) { vpSetVector3(vup, 1.0, 0.0, 0.0); } else { vpSetVector3(vup, 0.0, 0.0, 1.0); } } else { if (fabs(ly) < fabs(lz)) { vpSetVector3(vup, 0.0, 1.0, 0.0); } else { vpSetVector3(vup, 0.0, 0.0, 1.0); } } vpCrossProduct(tmp1v, vup, vpn); vpCrossProduct(tmp2v, vpn, tmp1v); vpIdentity4(view); view[0][0] = tmp1v[0]; view[0][1] = tmp1v[1]; view[0][2] = tmp1v[2]; view[1][0] = tmp2v[0]; view[1][1] = tmp2v[1]; view[1][2] = tmp2v[2]; view[2][0] = vpn[0]; view[2][1] = vpn[1]; view[2][2] = vpn[2]; /* initialize matrix to switch to left-handed coords. */ vpIdentity4(viewportm); viewportm[2][2] = -1.0; /* compute the view matrix */ vpMatrixMult4(tmp1m, vpc->transforms[VP_MODEL], prematrix); vpMatrixMult4(tmp2m, view, tmp1m); vpMatrixMult4(vm, viewportm, tmp2m); } /* * FactorLightView * * Factor an affine viewing matrix that specifies the view seen by * a light source. Most of the parameters of the factorization are * taken from the factorization of the normal viewing matrix. */ static int FactorLightView(vpc, vm) vpContext *vpc; vpMatrix4 vm; { vpMatrix4 p; /* permutation matrix */ vpMatrix4 pvm; /* permutation of the viewing matrix */ int icount, jcount, kcount; /* dimensions of volume in rotated space */ double denom; Debug((vpc, VPDEBUG_SHADOW, "FactorLightView\n")); /* permute the rows of the viewing matrix according to the best viewing axis for the viewing direction */ bzero(p, sizeof(vpMatrix4)); switch (vpc->best_view_axis) { case VP_X_AXIS: p[0][2] = 1.; p[1][0] = 1.; p[2][1] = 1.; p[3][3] = 1.; icount = vpc->ylen; jcount = vpc->zlen; kcount = vpc->xlen; break; case VP_Y_AXIS: p[0][1] = 1.; p[1][2] = 1.; p[2][0] = 1.; p[3][3] = 1.; icount = vpc->zlen; jcount = vpc->xlen; kcount = vpc->ylen; break; case VP_Z_AXIS: p[0][0] = 1.; p[1][1] = 1.; p[2][2] = 1.; p[3][3] = 1.; icount = vpc->xlen; jcount = vpc->ylen; kcount = vpc->zlen; break; } vpMatrixMult4(pvm, vm, p); /* compute the shear coefficients */ denom = pvm[0][0]*pvm[1][1] - pvm[0][1]*pvm[1][0]; if (fabs(denom) < VP_EPS) return(VPSetError(vpc, VPERROR_SINGULAR)); vpc->shadow_shear_i = (pvm[0][2]*pvm[1][1] - pvm[0][1]*pvm[1][2]) / denom; vpc->shadow_shear_j = (pvm[0][0]*pvm[1][2] - pvm[1][0]*pvm[0][2]) / denom; /* check that light direction is compatible with compositing direction */ if (pvm[2][0]*vpc->shadow_shear_i + pvm[2][1]*vpc->shadow_shear_j - pvm[2][2] > 0) { if (vpc->reverse_slice_order != 0) return(VPERROR_BAD_SHADOW); } else { if (vpc->reverse_slice_order != 1) return(VPERROR_BAD_SHADOW); } /* compute the shadow buffer image size */ vpc->shadow_width = (int)ceil((kcount-1)*fabs(vpc->shadow_shear_i)) + icount + 1; vpc->shadow_height = (int)ceil((kcount-1)*fabs(vpc->shadow_shear_j)) + jcount + 1; /* compute the translation coefficients */ if (vpc->shadow_shear_i >= 0.) vpc->shadow_trans_i = 1.; else vpc->shadow_trans_i = 1. - vpc->shadow_shear_i * (kcount - 1); if (vpc->shadow_shear_j >= 0.) vpc->shadow_trans_j = 1.; else vpc->shadow_trans_j = 1. - vpc->shadow_shear_j * (kcount - 1); Debug((vpc, VPDEBUG_SHADOW, " shadow shear factors: %g %g\n", vpc->shadow_shear_i, vpc->shadow_shear_j)); Debug((vpc, VPDEBUG_SHADOW, " shadow translation: %g %g\n", vpc->shadow_trans_i, vpc->shadow_trans_j)); return(VP_OK); } /* * CheckShadowBuffer * * Resize the shadow buffer, if necessary. */ static void CheckShadowBuffer(vpc) vpContext *vpc; { int new_max_width, new_max_height; int resize = 0; /* determine if resizing is necessary */ if (vpc->shadow_width > vpc->max_shadow_width) { new_max_width = MAX(vpc->shadow_width, vpc->shadow_width_hint); resize = 1; } else { new_max_width = MAX(vpc->max_shadow_width, vpc->shadow_width_hint); } if (vpc->shadow_height > vpc->max_shadow_height) { new_max_height = MAX(vpc->shadow_height, vpc->shadow_height_hint); resize = 1; } else { new_max_height = MAX(vpc->max_shadow_height, vpc->shadow_height_hint); } /* resize */ if (resize) VPResizeShadowBuffer(vpc, new_max_width, new_max_height); } /* * VPResizeShadowBuffer * * Resize the shadow buffer. */ void VPResizeShadowBuffer(vpc, max_width, max_height) vpContext *vpc; int max_width; /* new width of the intermediate image */ int max_height; /* new height of the intermediate image */ { /* free old buffers */ if (vpc->shadow_buffer != NULL) { Dealloc(vpc, vpc->shadow_buffer); } /* allocate new buffers */ vpc->max_shadow_width = max_width; vpc->max_shadow_height = max_height; if (max_width > 0) { Alloc(vpc, vpc->shadow_buffer, GrayIntPixel *, max_width * max_height * sizeof(GrayIntPixel), "shadow_buffer"); } else { vpc->shadow_buffer = NULL; } } ccseapps-2.5/CCSEApps/volpack/examples.dsp0000644000175000017500000000352511634153073021651 0ustar amckinstryamckinstry# Microsoft Developer Studio Project File - Name="examples" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Generic Project" 0x010a CFG=examples - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "examples.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "examples.mak" CFG="examples - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "examples - Win32 Release" (based on "Win32 (x86) Generic Project") !MESSAGE "examples - Win32 Debug" (based on "Win32 (x86) Generic Project") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" MTL=midl.exe !IF "$(CFG)" == "examples - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "examples___Win32_Release" # PROP BASE Intermediate_Dir "examples___Win32_Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "examples___Win32_Release" # PROP Intermediate_Dir "examples___Win32_Release" # PROP Target_Dir "" !ELSEIF "$(CFG)" == "examples - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "examples___Win32_Debug" # PROP BASE Intermediate_Dir "examples___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "examples___Win32_Debug" # PROP Intermediate_Dir "examples___Win32_Debug" # PROP Target_Dir "" !ENDIF # Begin Target # Name "examples - Win32 Release" # Name "examples - Win32 Debug" # End Target # End Project ccseapps-2.5/CCSEApps/volpack/README0000644000175000017500000001626111634153073020204 0ustar amckinstryamckinstry VolPack version 1.0beta3 ------------------------ Phil Lacroute volpack@graphics.stanford.edu 16 December 1994 1. Introduction --------------- VolPack is a portable library of fast volume rendering algorithms that produce high-quality images. 2. Installation --------------- To build the library, do the following: A. Type "./configure" in this directory. This will run a shell script that determines the features of your operating system and then automatically chooses compiler flags and configuration constants for VolPack. Configure takes a number of options, but only the commonly-used ones are described here. You can specify the top-level installation directory with the "--prefix=" option, and the top-level installation directory for architecture-dependent binaries with "--exec_prefix=". Both options default to /usr/local. If you want, you can look at the Makefile configure builds and override some of the options. B. Type "make". This creates a library archive call "libvolpack.a". C. To compile the example programs type "make examples", or move to the examples directory and type "make". D. Type "make install" to install the library, include files, and manual entries. E. Look at the User's Guide in the "doc" directory for a tutorial introduction, and look at the examples programs in the "examples" directory (see examples/README). If you have a version of "m4" that does not understand the -D option then the compilation will fail (usually "make" will appear to hang after the first call to m4). Some systems have two versions of m4; you can choose the correct one by editting the "M4" macro in Makefile.in or by setting the M4 environment variable to the correct path before running configure. You can also install GNU m4. If your optimizer has trouble or takes a long time on some of the files you may want to use a lower optimization level for them. All of the files with names like vp_comp*.c are special-case versions of the rendering routine and you may choose to optimize only the ones you plan to use frequently. An important note for HP-UX users: The math library rint() function is broken in HP-UX 9.01 (and maybe other releases), causing the VolPack test programs to generate blank images. This is fixed by HP patch "PHSS_3597", which HP-UX users can get from HP support. 3. Documentation ---------------- The doc directory contains a user's guide to VolPack in HTML format (volpack.html) which you can read using Mosaic or any other Web browser. A PostScript version is also available. The man directory contains manual pages for each routine in the library. 4. Support ---------- If you have problems, bug reports or bug fixes, please send mail to: volpack@graphics.stanford.edu The author makes no commitment to fix bugs or provide support. However, future releases with fixes and enhancements are planned. If you like the library then drop us a note describing what you use it for! If you decide to use the software then please add yourself to our mailing list so we can tell you about bug fixes and new versions of the software. Just send a message to majordomo@lists.stanford.edu with the message body: subscribe volpack-announce 5. Data Sets and Other Goodies ------------------------------ One sample data set is provided in the examples directory. Some larger data sets and a more complete demonstration application, vprender, are available from the Stanford Computer Graphics Laboratory's ftp site: graphics.stanford.edu:pub/volpack or http://www-graphics.stanford.edu/ 6. Changes ---------- Release 1.0beta3 includes the following additions to release 1.0beta2: - a new shader for rendering shadows (see vpSetShadowLookupShader) - filtering routines for resampling volumes to different resolutions - the capability to produce images with different pixel formats, including formats with alpha channels - several important bug fixes, including a problem with depth cueing that caused "flashing" artifacts in rotation sequences - upgraded configuration script to autoconf 2.0 for even easier installation See the "changes" file for a complete list. There are minor incompatible changes to the functions vpSetImage and vpGetImage. 7. Copyright ------------ VolPack is covered by the following copyright notice: Copyright (c) 1994 The Board of Trustees of The Leland Stanford Junior University. All rights reserved. Permission to use, copy, modify and distribute this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice and this permission notice appear in all copies of this software and that you do not sell the software. Commercial licensing is available by contacting the author. THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. This version of the VolPack library is a modified version of the original available from Stanford University. Modifications were made by the Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory. Modifications to VolPack (c) 2000 The Regents of the University of California (through E.O. Lawrence Berkeley National Laboratory), subject to approval by the U.S. Department of Energy. Your use of this software is under license from Stanford University with respect to the underlying original VolPack code (see copyright notice and permission above) and The Regents of the University of California with respect to modifications thereto (see AmrVis license.txt file for applicable license terms). Contact Berkeley Lab's Center for Computational Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley Lab's Technology Transfer Department at TTD@lbl.gov for questions or to receive more information. 8. Credits ---------- VolPack was written by Phil Lacroute at the Computer Graphics Laboratory, Stanford University. The algorithms are based on Phil's Ph.D. thesis research and are described in the following paper: Philippe Lacroute and Marc Levoy, Fast Volume Rendering Using a Shear-Warp Factorization of the Viewing Transformation, Proc. SIGGRAPH '94 (Orlando, Florida, July 24-29, 1994). In Computer Graphics Proceedings, Annual Conference Series, 1994, ACM SIGGRAPH, pp. 451-458. If you publish a rendering made using VolPack and you would like to make an attribution, the following form is suggested: Image generated using the Stanford VolPack volume renderer. An appropriate longer attribution could omit the word Stanford but would include a citation of the SIGGRAPH '94 paper: Image generated using the VolPack volume renderer [#]. [#] Philippe Lacroute and Marc Levoy, Fast Volume Rendering Using a Shear-Warp Factorization of the Viewing Transformation, Proc. SIGGRAPH '94 (Orlando, Florida, July 24-29, 1994). In Computer Graphics Proceedings, Annual Conference Series, 1994, ACM SIGGRAPH, pp. 451-458. ccseapps-2.5/CCSEApps/volpack/volpack.dsw0000644000175000017500000000540711634153073021502 0ustar amckinstryamckinstryMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "classifyvolume"=.\classifyvolume.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name volpack End Project Dependency }}} ############################################################################### Project: "examples"=.\examples.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name classifyvolume End Project Dependency Begin Project Dependency Project_Dep_Name glr End Project Dependency Begin Project Dependency Project_Dep_Name makeoctree End Project Dependency Begin Project Dependency Project_Dep_Name makevolume End Project Dependency Begin Project Dependency Project_Dep_Name rendervolume End Project Dependency Begin Project Dependency Project_Dep_Name scalevolume End Project Dependency }}} ############################################################################### Project: "glr"=.\glr.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name volpack End Project Dependency }}} ############################################################################### Project: "makeoctree"=.\makeoctree.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name volpack End Project Dependency }}} ############################################################################### Project: "makevolume"=.\makevolume.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name volpack End Project Dependency }}} ############################################################################### Project: "rendervolume"=.\rendervolume.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name volpack End Project Dependency }}} ############################################################################### Project: "scalevolume"=.\scalevolume.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name volpack End Project Dependency }}} ############################################################################### Project: "volpack"=.\volpack.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### ccseapps-2.5/CCSEApps/volpack/vp_rle.c0000644000175000017500000013416011634153073020756 0ustar amckinstryamckinstry/* * vp_rle.c * * Routines for run-length encoding classified volume data. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:04 $ * $Revision: 1.4 $ */ #include "vp_global.h" static void EncodeScanline ANSI_ARGS((vpContext *vpc, void *voxels, MinMaxOctree *octree, MMOctreeLevel level_stack[VP_MAX_OCTREE_LEVELS])); static void InitRLE ANSI_ARGS((vpContext *vpc)); static void CacheVoxel ANSI_ARGS((vpContext *vpc, double opacity, void *rawvoxel)); static void CacheLength ANSI_ARGS((vpContext *vpc, int length)); static void CountNonZeroVoxel ANSI_ARGS((RunData *rundata, int index, int end_of_scan, vpContext *vpc)); static void RepackClassifiedVolume ANSI_ARGS((vpContext *vpc)); static RLEVoxels *CreateEmptyRLEVoxels ANSI_ARGS((vpContext *vpc, int ilen, int jlen, int klen)); static RLEVoxels *CreateRLEVoxelsFromRunData ANSI_ARGS((vpContext *vpc, int ilen, int jlen, int klen, int non_zero_count, RunData *run_data, int rle_bytes_per_voxel)); static void StoreNonZeroVoxel ANSI_ARGS((void *voxel, int rle_bytes_per_voxel, void *data, unsigned char *lengths, RunData *rundata, int index)); static void PadScanlines ANSI_ARGS((int ilen, int jlen, int klen, RunData *run_data, unsigned char *lengths)); static ConstructionBuffer *CreateConstructionBuffer ANSI_ARGS(( vpContext *vpc)); static void DestroyConstructionBuffer ANSI_ARGS((vpContext *vpc, ConstructionBuffer *cbuf)); static GBuffer *CreateGBuffer ANSI_ARGS((vpContext *vpc)); static void DestroyGBuffer ANSI_ARGS((vpContext *vpc, GBuffer *gbuf)); #ifdef INDEX_VOLUME static vpResult ComputeIndex ANSI_ARGS((vpContext *vpc, RLEVoxels *rle_voxels)); #endif static vpResult ComputeScanOffsets ANSI_ARGS((vpContext *vpc, RLEVoxels *rle_voxels)); #ifdef DEBUG static void ValidateRLEVoxels ANSI_ARGS((vpContext *vpc, RLEVoxels *rle, int istride, int jstride, int kstride, int axis)); #endif /* * vpClassifyScalars * * Classify an array of scalars and store the result in the classified volume. */ vpResult vpClassifyScalars(vpc, scalar_data, length, scalar_field, grad_field, norm_field) vpContext *vpc; /* context */ unsigned char *scalar_data; /* 3D array of scalar data */ int length; /* number of scalars in scalar_data */ int scalar_field; /* voxel field for scalar, or VP_SKIP_FIELD */ int grad_field; /* voxel field for gradient, or VP_SKIP_FIELD */ int norm_field; /* voxel field for normal, or VP_SKIP_FIELD */ { int xlen, ylen, zlen; /* volume dimensions */ int y, z; /* loop indices */ unsigned char *scalar; /* pointer to current scalar */ int scalar_ystride; /* stride to next scalar scanline */ int scalar_zstride; /* stride to next scalar slice */ char *voxel; /* pointer to current voxel */ unsigned char *s_py, *s_my, *s_pz, *s_mz; /* ptrs to adjacent scans */ int retcode; /* return code from vpScanlineNormals */ void *voxel_scan; /* buffer for storing one scan of raw voxels */ /* check for errors */ xlen = vpc->xlen; ylen = vpc->ylen; zlen = vpc->zlen; if (xlen == 0 || ylen == 0 || zlen == 0 || vpc->raw_bytes_per_voxel == 0) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); if (xlen * ylen * zlen != length) return(VPSetError(vpc, VPERROR_BAD_SIZE)); /* initialize */ scalar = scalar_data; scalar_ystride = xlen; scalar_zstride = xlen*ylen; Alloc(vpc, voxel_scan, void *, xlen*vpc->raw_bytes_per_voxel,"voxel_scan"); /* compute volume data */ for (z = 0; z < zlen; z++) { ReportStatus(vpc, (double)z / (double)zlen); for (y = 0; y < ylen; y++) { s_my = (y == 0) ? NULL : scalar - scalar_ystride; s_py = (y == ylen-1) ? NULL : scalar + scalar_ystride; s_mz = (z == 0) ? NULL : scalar - scalar_zstride; s_pz = (z == zlen-1) ? NULL : scalar + scalar_zstride; voxel = (char*)voxel_scan; retcode = vpScanlineNormals(vpc, xlen, scalar, s_my, s_py, s_mz, s_pz, voxel, scalar_field, grad_field, norm_field); if (retcode != VP_OK) { Dealloc(vpc, voxel_scan); return(retcode); } retcode = vpClassifyScanline(vpc, voxel_scan); if (retcode != VP_OK) { Dealloc(vpc, voxel_scan); return(retcode); } scalar += scalar_ystride; } scalar += scalar_zstride - ylen*scalar_ystride; } ReportStatus(vpc, 1.0); Dealloc(vpc, voxel_scan); return(VP_OK); } /* * vpClassifyVolume * * Classify the current raw volume and store the result in the * classified volume. */ vpResult vpClassifyVolume(vpc) vpContext *vpc; /* context */ { int xlen, ylen, zlen; /* volume dimensions */ int y, z; /* loop indices */ char *voxel; /* pointer to current voxel */ int voxel_ystride; /* stride to next voxel scanline */ int voxel_zstride; /* stride to next voxel slice */ int retcode; /* return code */ MinMaxOctree *octree; /* octree for fast classification */ MMOctreeLevel level_stack[VP_MAX_OCTREE_LEVELS]; /* stack for octree */ /* check for errors */ if ((retcode = VPCheckRawVolume(vpc)) != VP_OK) return(retcode); if ((retcode = VPCheckClassifier(vpc)) != VP_OK) return(retcode); /* initialize */ vpDestroyClassifiedVolume(vpc); InitRLE(vpc); xlen = vpc->xlen; ylen = vpc->ylen; zlen = vpc->zlen; voxel = (char*)vpc->raw_voxels; voxel_ystride = vpc->ystride; voxel_zstride = vpc->zstride; octree = vpc->mm_octree; if (octree != NULL) { VPComputeSummedAreaTable(vpc); VPClassifyOctree(vpc); } /* compute volume data */ for (z = 0; z < zlen; z++) { ReportStatus(vpc, (double)z / (double)zlen); if (octree != NULL) VPInitOctreeLevelStack(vpc, level_stack, VP_Z_AXIS, z); for (y = 0; y < ylen; y++) { EncodeScanline(vpc, voxel, octree, level_stack); voxel += voxel_ystride; } voxel += voxel_zstride - ylen*voxel_ystride; } ReportStatus(vpc, 1.0); return(VP_OK); } /* * vpClassifyScanline * * Apply the classification function to a scanline of raw voxels and append * it to the classified volume. */ vpResult vpClassifyScanline(vpc, voxels) vpContext *vpc; /* context */ void *voxels; /* voxel scanline */ { int retcode; /* initialize if this is the first scanline */ if (vpc->cbuf == NULL) { if ((retcode = VPCheckClassifier(vpc)) != VP_OK) return(retcode); vpDestroyClassifiedVolume(vpc); InitRLE(vpc); } /* encode scanline */ EncodeScanline(vpc, voxels, NULL, NULL); return(VP_OK); } /* * EncodeScanline * * Classify and run-length encode one scanline of voxels. */ static void EncodeScanline(vpc, voxels, octree, level_stack) vpContext *vpc; /* context */ void *voxels; /* voxel scanline */ MinMaxOctree *octree; /* octree for fast classification */ MMOctreeLevel level_stack[VP_MAX_OCTREE_LEVELS]; /* stack for octree */ { ConstructionBuffer *cbuf; /* state preserved between calls */ RunData rundata_x; /* statistics for current x-axis run */ RunData *rundata_y; /* statistics for all y-axis runs */ RunData *rundata_z; /* statistics for all z-axis runs */ int skip_rle_x; /* if true, do not compute rle_x */ int skip_rle_y; /* if true, do not compute rle_y */ int skip_rle_z; /* if true, do not compute rle_z */ int y, z; /* y and z coordinates of scanline */ int x; /* index of current voxel in scanline */ int xlen, ylen, zlen; /* volume dimensions */ float opacity; /* current value of the opacity (0.0-1.0) */ float min_opacity; /* low opacity threshold */ int raw_bytes_per_voxel; /* bytes in unclassified voxel */ char *rawvoxel; /* current unclassified voxel */ unsigned char *octree_run_ptr; /* pointer to current run */ int voxel_count; /* voxels remaining in current run */ /* initialize */ cbuf = vpc->cbuf; xlen = vpc->xlen; ylen = vpc->ylen; zlen = vpc->zlen; bzero(&rundata_x, sizeof(RunData)); rundata_y = &cbuf->rundata_y[cbuf->next_z]; rundata_z = &cbuf->rundata_z[cbuf->next_y * xlen]; skip_rle_x = vpc->skip_rle_x; skip_rle_y = vpc->skip_rle_y; skip_rle_z = vpc->skip_rle_z; min_opacity = vpc->min_opacity; raw_bytes_per_voxel = vpc->raw_bytes_per_voxel; rawvoxel = (char*)voxels; y = cbuf->next_y; z = cbuf->next_z; if (octree != NULL) { if (cbuf->octree_scans_left == 0) { cbuf->octree_scans_left = VPComputeScanRuns(vpc, level_stack, cbuf->octree_runs, VP_Z_AXIS, y, xlen); } cbuf->octree_scans_left--; octree_run_ptr = cbuf->octree_runs; } /* loop over voxels in the scanline */ x = 0; while (x < xlen) { if (octree == NULL) { /* no octree available, so process all of the voxels in the scan */ voxel_count = xlen; } else do { /* skip over a run of zero voxels */ voxel_count = *octree_run_ptr++; rundata_y += zlen * voxel_count; rundata_z += voxel_count; rawvoxel += raw_bytes_per_voxel * voxel_count; x += voxel_count; /* get length of nonzero voxel run */ voxel_count = *octree_run_ptr++; } while (voxel_count == 0 && x < xlen); /* process the voxels in the nonzero run */ while (voxel_count-- > 0) { /* compute opacity */ opacity = VPClassifyVoxel(vpc, rawvoxel); /* compare opacity to threshold */ if (opacity > min_opacity) { /* voxel is non-transparent, so save it */ CacheVoxel(vpc, opacity, rawvoxel); if (!skip_rle_x) { rundata_y->p.p1.non_zero_count++; CountNonZeroVoxel(rundata_y, y, 0, NULL); } if (!skip_rle_y) { rundata_z->p.p1.non_zero_count++; CountNonZeroVoxel(rundata_z, z, 0, NULL); } rundata_x.p.p1.non_zero_count++; CountNonZeroVoxel(&rundata_x, x, 0, vpc); } rundata_y += zlen; rundata_z++; rawvoxel += raw_bytes_per_voxel; x++; } /* while (voxel_count) */ } /* for x */ /* finish off the statistics for the scanline */ CountNonZeroVoxel(&rundata_x, x, 1, vpc); /* update saved state */ cbuf->non_zero_count += rundata_x.p.p1.non_zero_count; cbuf->x_run_count += rundata_x.p.p1.run_count; /* check if this is the last scanline in the volume */ if (++cbuf->next_y == ylen) { cbuf->next_y = 0; cbuf->octree_scans_left = 0; if (++cbuf->next_z == zlen) { RepackClassifiedVolume(vpc); DestroyConstructionBuffer(vpc, vpc->cbuf); vpc->cbuf = NULL; #ifdef DEBUG printf("\r"); if (!skip_rle_x) { printf("Checking X scanline offsets....\n"); VPCheckScanOffsets(vpc->rle_x, vpc->rle_bytes_per_voxel); } if (!skip_rle_y) { printf("Checking Y scanline offsets....\n"); VPCheckScanOffsets(vpc->rle_y, vpc->rle_bytes_per_voxel); } if (!skip_rle_z) { printf("Checking Z scanline offsets....\n"); VPCheckScanOffsets(vpc->rle_z, vpc->rle_bytes_per_voxel); } VPValidateClassifiedVolume(vpc); #endif } } } /* * InitRLE * * Initialize in preparation for creating a new run-length encoded volume. */ static void InitRLE(vpc) vpContext *vpc; { int f; int rle_bytes_per_voxel, size, offset; int maxsize = 0; /* find out how many bytes of the raw voxel are used for shading */ rle_bytes_per_voxel = 0; for (f = 0; f < vpc->num_shade_fields; f++) { size = vpc->field_size[f]; offset = vpc->field_offset[f] + size; if (offset > rle_bytes_per_voxel) rle_bytes_per_voxel = offset; if (size > maxsize) maxsize = size; } /* add one byte for opacity and then pad to the byte boundary of the largest field in the voxel; this ensures alignment; the opacity is always stored in the last byte (so the padding is in between the shading fields and the opacity field) */ rle_bytes_per_voxel++; rle_bytes_per_voxel = (rle_bytes_per_voxel + maxsize-1) & ~(maxsize-1); vpc->rle_bytes_per_voxel = rle_bytes_per_voxel; /* initialize construction buffer */ vpc->cbuf = CreateConstructionBuffer(vpc); } /* * CacheVoxel * * Cache one voxel's data in the ConstructionBuffer. */ static void CacheVoxel(vpc, opacity, rawvoxel) vpContext *vpc; /* context */ double opacity; /* voxel's opacity */ void *rawvoxel; /* raw voxel data */ { ConstructionBuffer *cbuf; /* state during construction of volume */ GBuffer *data_buf; /* storage for cached voxels */ void *data_ptr; /* pointer to current voxel's storage */ int rle_bytes_per_voxel; /* bytes per voxel after classification */ int opc_int; /* quantized opacity */ /* initialize */ cbuf = vpc->cbuf; data_buf = cbuf->data_buf_tail; rle_bytes_per_voxel = vpc->rle_bytes_per_voxel; /* allocate more memory if necessary */ if (data_buf->bytes_left < rle_bytes_per_voxel) { /* allocate more memory */ data_buf->next = CreateGBuffer(vpc); data_buf = data_buf->next; cbuf->data_buf_tail = data_buf; } data_ptr = data_buf->data_ptr; /* copy the voxel fields required for shading */ bcopy(rawvoxel, data_ptr, rle_bytes_per_voxel-1); /* quantize and store the opacity */ opc_int = opacity*255.; if (opc_int > 255) opc_int = 255; else if (opc_int < 0) opc_int = 0; ByteField(data_ptr, rle_bytes_per_voxel-1) = opc_int; data_buf->data_ptr += rle_bytes_per_voxel; data_buf->bytes_left -= rle_bytes_per_voxel; } /* * CacheLength * * Cache one run length in the ConstructionBuffer. */ static void CacheLength(vpc, length) vpContext *vpc; int length; { GBuffer *lengths_buf; lengths_buf = vpc->cbuf->lengths_buf_tail; if (lengths_buf->bytes_left == 0) { /* allocate more memory */ lengths_buf->next = CreateGBuffer(vpc); lengths_buf = lengths_buf->next; vpc->cbuf->lengths_buf_tail = lengths_buf; } *(lengths_buf->data_ptr)++ = length; lengths_buf->bytes_left--; } /* * CountNonZeroVoxel * * Update the run count and nonzero voxel count for a voxel scanline. * This routine adds one non-zero voxel to the scanline. Index * indicates the position of the voxel in the scanline. If that * position is not immediately adjacent to the last non-zero voxel then * a run of zero voxels is added as well. * * If the vpc argument is non-NULL then the lengths of any completed * runs are written out to the run length buffer. */ static void CountNonZeroVoxel(rundata, index, end_of_scan, vpc) RunData *rundata; /* statistics for the scanline */ int index; /* index of voxel in scanline */ int end_of_scan; /* if true then finish the scanline instead of adding a voxel */ vpContext *vpc; /* context in which run lengths should be stored */ { int run_length; if (rundata->next_index != index) { /* a run of zero voxels intervenes between the current index and the last nonzero voxel that was processed */ if (rundata->next_index != 0) { /* add the last nonzero run to the statistics */ run_length = rundata->run_length; while (run_length > 255) { /* run is too long, so split it */ run_length -= 255; rundata->p.p1.run_count += 2; if (vpc != NULL) { CacheLength(vpc, 255); CacheLength(vpc, 0); } } rundata->p.p1.run_count++; if (vpc != NULL) CacheLength(vpc, run_length); } /* add the last zero run to the statistics */ run_length = index - rundata->next_index; while (run_length > 255) { /* run is too long, so split it */ run_length -= 255; rundata->p.p1.run_count += 2; if (vpc != NULL) { CacheLength(vpc, 255); CacheLength(vpc, 0); } } rundata->p.p1.run_count++; if (vpc != NULL) CacheLength(vpc, run_length); if (end_of_scan) { /* add a zero-length nonzero run to finish the scanline */ rundata->p.p1.run_count++; if (vpc != NULL) CacheLength(vpc, 0); } else { /* start the new run */ rundata->run_length = 1; rundata->next_index = index + 1; } } else if (!end_of_scan) { /* add a nonzero voxel to the current run */ if (rundata->next_index == 0) { rundata->p.p1.run_count++; /* count initial zero run */ if (vpc != NULL) CacheLength(vpc, 0); } rundata->run_length++; rundata->next_index = index + 1; } else { /* scanline ends with a nonzero voxel run */ run_length = rundata->run_length; while (run_length > 255) { /* run is too long, so split it */ run_length -= 255; rundata->p.p1.run_count += 2; if (vpc != NULL) { CacheLength(vpc, 255); CacheLength(vpc, 0); } } rundata->p.p1.run_count++; if (vpc != NULL) CacheLength(vpc, run_length); } } /* * RepackClassifiedVolume * * Repack the data in the ConstructionBuffer after the last call to * vpClassifyScanline. This procedure creates the three run-length * encoded copies of the classified voxels. */ static void RepackClassifiedVolume(vpc) vpContext *vpc; { int xlen, ylen, zlen; /* volume dimensions */ int x, y, z; /* voxel coordinates */ int non_zero_count; /* number of nonzero voxels in volume */ int rle_bytes_per_voxel; /* bytes per classified voxel */ int skip_rle_x; /* if true, compute rle_x */ int skip_rle_y; /* if true, compute rle_y */ int skip_rle_z; /* if true, compute rle_z */ char *x_data; /* voxel data for x viewpoint */ char *y_data; /* voxel data for y viewpoint */ char *z_data; /* voxel data for z viewpoint */ unsigned char *x_lengths; /* run length for x viewpoint */ unsigned char *y_lengths; /* run length for y viewpoint */ unsigned char *z_lengths; /* run length for z viewpoint */ int z_data_offset; /* offset to current data value in z volume */ int z_length_offset; /* offset to current length value in z volume*/ GBuffer *data_buf; /* next GBuffer containing voxel data */ char *data; /* pointer to next voxel */ int data_bytes_left; /* bytes of data left in data buffer */ GBuffer *lengths_buf; /* next GBuffer containing length data */ unsigned char *lengths; /* pointer to next length */ int lengths_bytes_left; /* bytes of data left in lengths buffer */ int x_run_length; /* length of current x-scanline run */ int is_non_zero; /* true if current x-scanline run is nonzero */ RunData *rundata_y; /* statistics for y-axis runs */ RunData *rundata_z; /* statistics for z-axis runs */ /* initialize */ xlen = vpc->xlen; ylen = vpc->ylen; zlen = vpc->zlen; non_zero_count = vpc->cbuf->non_zero_count; rle_bytes_per_voxel = vpc->rle_bytes_per_voxel; skip_rle_x = vpc->skip_rle_x; skip_rle_y = vpc->skip_rle_y; skip_rle_z = vpc->skip_rle_z; /* check for empty volume */ if (non_zero_count == 0) { if (!skip_rle_x) vpc->rle_x = CreateEmptyRLEVoxels(vpc, ylen, zlen, xlen); if (!skip_rle_y) vpc->rle_y = CreateEmptyRLEVoxels(vpc, zlen, xlen, ylen); if (!skip_rle_z) vpc->rle_z = CreateEmptyRLEVoxels(vpc, xlen, ylen, zlen); return; } /* allocate space for y-axis runs (used for the x viewing axis) */ if (!skip_rle_x) { vpc->rle_x = CreateRLEVoxelsFromRunData(vpc, ylen, zlen, xlen, non_zero_count, vpc->cbuf->rundata_y, rle_bytes_per_voxel); x_data = (char*)vpc->rle_x->data; x_lengths = vpc->rle_x->run_lengths; } /* allocate space for z-axis runs (used for the y viewing axis) */ if (!skip_rle_y) { vpc->rle_y = CreateRLEVoxelsFromRunData(vpc, zlen, xlen, ylen, non_zero_count, vpc->cbuf->rundata_z, rle_bytes_per_voxel); y_data = (char*)vpc->rle_y->data; y_lengths = vpc->rle_y->run_lengths; } /* allocate space for x-axis runs (used for the z viewing axis) */ if (!skip_rle_z) { vpc->rle_z = VPCreateRLEVoxels(vpc, xlen, ylen, zlen, non_zero_count, vpc->cbuf->x_run_count, rle_bytes_per_voxel); Alloc(vpc, vpc->rle_z->scan_offsets, ScanOffset *, zlen*sizeof(ScanOffset), "scan_offsets"); vpc->rle_z->scan_offsets_per_slice = 1; z_data = (char*)vpc->rle_z->data; z_lengths = vpc->rle_z->run_lengths; z_data_offset = 0; z_length_offset = 0; } /* copy data into the three RLEVoxels structures */ data_buf = vpc->cbuf->data_buf_head; data = NULL; data_bytes_left = 0; lengths_buf = vpc->cbuf->lengths_buf_head; lengths = NULL; lengths_bytes_left = 0; x_run_length = 0; is_non_zero = 1; for (z = 0; z < zlen; z++) { ReportStatus(vpc, (double)z / (double)zlen); if (!skip_rle_z) { vpc->rle_z->scan_offsets[z].first_data = z_data_offset; vpc->rle_z->scan_offsets[z].first_len = (z_length_offset & 0x1) ? z_length_offset + 1 : z_length_offset; } rundata_z = vpc->cbuf->rundata_z; for (y = 0; y < ylen; y++) { rundata_y = &vpc->cbuf->rundata_y[z]; for (x = 0; x < xlen; x++) { while (x_run_length == 0) { /* find length of next run */ if (lengths_bytes_left <= 0) { /* go to next lengths buffer */ lengths = (unsigned char *)lengths_buf->data; lengths_bytes_left = GBUFFER_SIZE - lengths_buf->bytes_left; lengths_buf = lengths_buf->next; if (!skip_rle_z) { bcopy(lengths, z_lengths, lengths_bytes_left); z_lengths += lengths_bytes_left; } } x_run_length = *lengths++; lengths_bytes_left--; is_non_zero = !is_non_zero; z_length_offset++; } x_run_length--; /* consume one voxel */ if (is_non_zero) { /* find the data for this voxel */ if (data_bytes_left <= 0) { data = data_buf->data; data_bytes_left = GBUFFER_SIZE - data_buf->bytes_left; data_buf = data_buf->next; if (!skip_rle_z) { bcopy(data, z_data, data_bytes_left); z_data = (char *)z_data + data_bytes_left; } } /* store voxel */ if (!skip_rle_x) { StoreNonZeroVoxel(data, rle_bytes_per_voxel, x_data, x_lengths, rundata_y, y); } if (!skip_rle_y) { StoreNonZeroVoxel(data, rle_bytes_per_voxel, y_data, y_lengths, rundata_z, z); } data += rle_bytes_per_voxel; data_bytes_left -= rle_bytes_per_voxel; z_data_offset += rle_bytes_per_voxel; } rundata_y += zlen; rundata_z++; } /* for x */ } /* for y */ } /* for z */ ReportStatus(vpc, 1.0); if (!skip_rle_x) PadScanlines(ylen, zlen, xlen, vpc->cbuf->rundata_y, x_lengths); if (!skip_rle_y) PadScanlines(zlen, xlen, ylen, vpc->cbuf->rundata_z, y_lengths); } /* * CreateEmptyRLEVoxels * * Create an empty RLEVoxels object (all voxels transparent). */ static RLEVoxels * CreateEmptyRLEVoxels(vpc, ilen, jlen, klen) vpContext *vpc; int ilen, jlen, klen; { RLEVoxels *rle_voxels; int j, k; unsigned char *run_lengths; ScanOffset *scan_offsets; rle_voxels = VPCreateRLEVoxels(vpc, ilen, jlen, klen, 1, 2*jlen*klen, 1); Alloc(vpc, rle_voxels->scan_offsets, ScanOffset *, klen*sizeof(ScanOffset), "scan_offsets"); rle_voxels->scan_offsets_per_slice = 1; run_lengths = rle_voxels->run_lengths; scan_offsets = rle_voxels->scan_offsets; for (k = 0; k < klen; k++) { scan_offsets->first_len = k*jlen*2; scan_offsets->first_data = 0; scan_offsets++; for (j = 0; j < jlen; j++) { *run_lengths++ = ilen; *run_lengths++ = 0; } } return(rle_voxels); } /* * CreateRLEVoxelsFromRunData * * Allocate an RLEVoxels structure using the data in a RunData array * in order to determine the required size. Also reinitialize the RunData * array with pointers to the RLEVoxels data for the beginning of * each scanline. */ static RLEVoxels * CreateRLEVoxelsFromRunData(vpc, ilen, jlen, klen, non_zero_count, run_data, rle_bytes_per_voxel) vpContext *vpc; /* context */ int ilen, jlen, klen; /* size of volume in rotated object space */ int non_zero_count; /* number of nonzero voxels in volume */ RunData *run_data; /* array of run statistics (jlen*klen entries) */ int rle_bytes_per_voxel;/* number of bytes to allocate for each voxel */ { int j, k; /* scanline and slice number */ int scan_run_count; /* runs in current scanline */ int run_count; /* runs in entire volume */ int scan_non_zero_count; /* nonzero voxels in scanline */ int data_offset; /* scanline's offset in RLEVoxels->data */ int length_offset; /* scanline's offset in RLEVoxels->run_lengths */ ScanOffset *slice_offset; /* offsets for each slice */ RLEVoxels *rle_voxels; /* return value */ Alloc(vpc, slice_offset, ScanOffset *, klen*sizeof(ScanOffset), "scan_offsets"); /* accumulate the statistics for the last run in each scanline, count the total number of runs, and store the data and length offsets for the beginning of the scanline */ data_offset = 0; length_offset = 0; run_count = 0; for (k = 0; k < klen; k++) { slice_offset[k].first_data = data_offset; slice_offset[k].first_len = length_offset; for (j = 0; j < jlen; j++) { CountNonZeroVoxel(run_data, ilen, 1, NULL); scan_non_zero_count = run_data->p.p1.non_zero_count; scan_run_count = run_data->p.p1.run_count; run_data->run_length = 0; run_data->next_index = 0; run_data->p.p2.data_offset = data_offset; run_data->p.p2.length_offset = length_offset; data_offset += scan_non_zero_count * rle_bytes_per_voxel; length_offset += scan_run_count * sizeof(unsigned char); run_count += scan_run_count; run_data++; } } /* allocate space */ rle_voxels = VPCreateRLEVoxels(vpc, ilen, jlen, klen, non_zero_count, run_count, rle_bytes_per_voxel); rle_voxels->scan_offsets_per_slice = 1; rle_voxels->scan_offsets = slice_offset; return(rle_voxels); } /* * StoreNonZeroVoxel * * Store a nonzero voxel in an RLEVoxels object. This function is * just like CountNonZeroVoxel except that it actually stores voxel data. */ static void StoreNonZeroVoxel(voxel, rle_bytes_per_voxel, data, lengths, rundata, index) void *voxel; /* input voxel data */ int rle_bytes_per_voxel;/* size of voxel */ void *data; /* location to store voxel */ unsigned char *lengths; /* location to store run lengths */ RunData *rundata; /* run length statistics for current voxel scanline */ int index; /* index of voxel in scanline */ { int run_length; /* store the voxel */ if (voxel != NULL) { bcopy(voxel, (char *)data + rundata->p.p2.data_offset, rle_bytes_per_voxel); rundata->p.p2.data_offset += rle_bytes_per_voxel; } /* update run lengths */ if (rundata->next_index != index) { /* a run of zero voxels intervenes between the current index and the last nonzero voxel that was processed */ if (rundata->next_index != 0) { /* add the last nonzero run to the statistics */ run_length = rundata->run_length; while (run_length > 255) { /* run is too long, so split it */ run_length -= 255; lengths[rundata->p.p2.length_offset++] = 255; lengths[rundata->p.p2.length_offset++] = 0; } lengths[rundata->p.p2.length_offset++] = run_length; } /* add the last zero run to the statistics */ run_length = index - rundata->next_index; while (run_length > 255) { /* run is too long, so split it */ run_length -= 255; lengths[rundata->p.p2.length_offset++] = 255; lengths[rundata->p.p2.length_offset++] = 0; } lengths[rundata->p.p2.length_offset++] = run_length; if (voxel == NULL) { /* add a zero-length nonzero run to finish the scanline */ lengths[rundata->p.p2.length_offset++] = 0; } else { /* start the new run */ rundata->run_length = 1; rundata->next_index = index + 1; } } else if (voxel != NULL) { /* add a nonzero voxel to the current run */ if (rundata->next_index == 0) { lengths[rundata->p.p2.length_offset++] = 0; } rundata->run_length++; rundata->next_index = index + 1; } else { /* scanline ends with a nonzero voxel run */ run_length = rundata->run_length; while (run_length > 255) { /* run is too long, so split it */ run_length -= 255; lengths[rundata->p.p2.length_offset++] = 255; lengths[rundata->p.p2.length_offset++] = 0; } lengths[rundata->p.p2.length_offset++] = run_length; } } /* * PadScanlines * * Make sure each scanline has an even number of runs. */ static void PadScanlines(ilen, jlen, klen, run_data, lengths) int ilen, jlen, klen; /* size of volume in rotated object space */ RunData *run_data; /* array of run statistics (jlen*klen entries) */ unsigned char *lengths; /* beginning of run lengths array */ { int scan_count; /* number of scanlines */ int scan; /* current scanline number */ scan_count = jlen * klen; for (scan = 0; scan < scan_count; scan++) { StoreNonZeroVoxel(NULL, 0, NULL, lengths, run_data, ilen); run_data++; } } /* * VPCreateRLEVoxels * * * Allocate a new RLEVoxels object. */ RLEVoxels * VPCreateRLEVoxels(vpc, ilen, jlen, klen, data_count, run_count, rle_bytes_per_voxel) vpContext *vpc; /* context */ int ilen, jlen, klen; /* dimensions in rotated object space */ int data_count; /* number of nonzero voxels */ int run_count; /* number of runs */ int rle_bytes_per_voxel;/* bytes of storage for one voxel */ { RLEVoxels *rle_voxels; Alloc(vpc, rle_voxels, RLEVoxels *, sizeof(RLEVoxels), "RLEVoxels"); rle_voxels->ilen = ilen; rle_voxels->jlen = jlen; rle_voxels->klen = klen; rle_voxels->run_count = run_count; if (run_count > 0) { Alloc(vpc, rle_voxels->run_lengths, unsigned char *, run_count, "run_lengths"); } else { rle_voxels->run_lengths = NULL; } rle_voxels->data_count = data_count; if (data_count > 0) { Alloc(vpc, rle_voxels->data, void *, data_count * rle_bytes_per_voxel, "voxeldata"); } else { rle_voxels->data = NULL; } rle_voxels->scan_offsets_per_slice = 0; rle_voxels->scan_offsets = NULL; rle_voxels->mmapped = 0; #ifdef INDEX_VOLUME rle_voxels->voxel_index = NULL; #endif return(rle_voxels); } /* * VPDestroyRLEVoxels * * Destroy an RLEVoxels object. */ void VPDestroyRLEVoxels(vpc, rle_voxels) vpContext *vpc; RLEVoxels *rle_voxels; { if (!rle_voxels->mmapped) { if (rle_voxels->run_lengths != NULL) Dealloc(vpc, rle_voxels->run_lengths); if (rle_voxels->data != NULL) Dealloc(vpc, rle_voxels->data); if (rle_voxels->scan_offsets != NULL) Dealloc(vpc, rle_voxels->scan_offsets); } #ifdef INDEX_VOLUME if (rle_voxels->voxel_index != NULL) Dealloc(vpc, rle_voxels->voxel_index); #endif Dealloc(vpc, rle_voxels); } /* * CreateConstructionBuffer * * Create a ConstructionBuffer object. */ static ConstructionBuffer * CreateConstructionBuffer(vpc) vpContext *vpc; { ConstructionBuffer *cbuf; int xlen, ylen, zlen; xlen = vpc->xlen; ylen = vpc->ylen; zlen = vpc->zlen; Alloc(vpc, cbuf, ConstructionBuffer *, sizeof(ConstructionBuffer), "ConstructionBuffer"); Alloc(vpc, cbuf->rundata_y, RunData *, xlen*zlen*sizeof(RunData), "rundata_y"); Alloc(vpc, cbuf->rundata_z, RunData *, ylen*xlen*sizeof(RunData), "rundata_z"); bzero(cbuf->rundata_y, xlen*zlen*sizeof(RunData)); bzero(cbuf->rundata_z, ylen*xlen*sizeof(RunData)); cbuf->data_buf_head = CreateGBuffer(vpc); cbuf->data_buf_tail = cbuf->data_buf_head; cbuf->lengths_buf_head = CreateGBuffer(vpc); cbuf->lengths_buf_tail = cbuf->lengths_buf_head; cbuf->non_zero_count = 0; cbuf->x_run_count = 0; cbuf->octree_scans_left = 0; cbuf->next_z = 0; cbuf->next_y = 0; return(cbuf); } /* * DestroyConstructionBuffer * * Destroy a ConstructionBuffer object. */ static void DestroyConstructionBuffer(vpc, cbuf) vpContext *vpc; ConstructionBuffer *cbuf; { GBuffer *gbuf, *next_gbuf; Dealloc(vpc, cbuf->rundata_y); Dealloc(vpc, cbuf->rundata_z); for (gbuf = cbuf->data_buf_head; gbuf != NULL; gbuf = next_gbuf) { next_gbuf = gbuf->next; DestroyGBuffer(vpc, gbuf); } for (gbuf = cbuf->lengths_buf_head; gbuf != NULL; gbuf = next_gbuf) { next_gbuf = gbuf->next; DestroyGBuffer(vpc, gbuf); } Dealloc(vpc, cbuf); } /* * CreateGBuffer * * Create a GBuffer object. */ static GBuffer * CreateGBuffer(vpc) vpContext *vpc; { GBuffer *gbuf; Alloc(vpc, gbuf, GBuffer *, sizeof(GBuffer), "GBuffer"); gbuf->bytes_left = GBUFFER_SIZE; gbuf->data_ptr = gbuf->data; gbuf->next = NULL; return(gbuf); } /* * DestroyGBuffer * * Destroy a GBuffer. */ static void DestroyGBuffer(vpc, gbuf) vpContext *vpc; GBuffer *gbuf; { Dealloc(vpc, gbuf); } /* * vpDestroyClassifiedVolume * * Free all memory associated with a classified volume. */ vpResult vpDestroyClassifiedVolume(vpc) vpContext *vpc; { if (vpc->cbuf != NULL) { DestroyConstructionBuffer(vpc, vpc->cbuf); vpc->cbuf = NULL; } if (vpc->rle_x != NULL) { VPDestroyRLEVoxels(vpc, vpc->rle_x); vpc->rle_x = NULL; } if (vpc->rle_y != NULL) { VPDestroyRLEVoxels(vpc, vpc->rle_y); vpc->rle_y = NULL; } if (vpc->rle_z != NULL) { VPDestroyRLEVoxels(vpc, vpc->rle_z); vpc->rle_z = NULL; } return(VP_OK); } #ifdef INDEX_VOLUME /* * vpComputeRLEIndex * * Compute indexes for the classified volume data in a context. */ vpResult vpComputeRLEIndex(vpc) vpContext *vpc; { vpResult result; if ((result = VPComputeRLEScanOffsets(vpc)) != VP_OK) return(result); if (vpc->rle_x != NULL) { if ((result = ComputeIndex(vpc, vpc->rle_x)) != VP_OK) return(result); } if (vpc->rle_y != NULL) { if ((result = ComputeIndex(vpc, vpc->rle_y)) != VP_OK) return(result); } if (vpc->rle_z != NULL) { if ((result = ComputeIndex(vpc, vpc->rle_z)) != VP_OK) return(result); } return(VP_OK); } /* * ComputeIndex * * Compute an index that maps 3D voxel coordinates to the RLE run data * for the corresponding voxel. The values stored in the index are * byte offsets to the beginning of the run containing the voxel, * plus a count indicating the position of the voxel in the run. * Return value is a result code. */ static vpResult ComputeIndex(vpc, rle_voxels) vpContext *vpc; RLEVoxels *rle_voxels; { int ilen, jlen, klen; /* size of volume */ unsigned char *RLElen; /* pointer to current run length */ VoxelLocation *index; /* pointer to current index entry */ int i, j, k; /* current voxel coordinates */ unsigned len_offset; /* offset in bytes from beginning of scanline to current run length */ unsigned data_offset; /* offset in bytes from beginning of scanline to current voxel data */ int run_is_zero; /* true if current run is a zero run */ int run_count; /* voxels left in current run */ int voxel_size; /* size of a voxel in bytes */ ilen = rle_voxels->ilen; jlen = rle_voxels->jlen; klen = rle_voxels->klen; RLElen = rle_voxels->run_lengths; if (rle_voxels->scan_offsets_per_slice != jlen) return(VPERROR_BAD_VOLUME); if (rle_voxels->voxel_index == NULL) { Alloc(vpc, rle_voxels->voxel_index, VoxelLocation *, ilen * jlen * klen * sizeof(VoxelLocation), "voxel_index"); } index = rle_voxels->voxel_index; voxel_size = vpc->rle_bytes_per_voxel; run_is_zero = 0; run_count = 0; for (k = 0; k < klen; k++) { for (j = 0; j < jlen; j++) { ASSERT(run_is_zero == 0); ASSERT(run_count == 0); len_offset = 0; data_offset = 0; for (i = 0; i < ilen; i++) { /* record index for current voxel */ if (len_offset > 256) { Dealloc(vpc, rle_voxels->voxel_index); rle_voxels->voxel_index = NULL; return(VPERROR_LIMIT_EXCEEDED); } index->run_count = run_count; index->len_offset = len_offset; if (run_is_zero) index->data_offset = data_offset | INDEX_RUN_IS_ZERO; else index->data_offset = data_offset; index++; /* go on to next voxel */ while (run_count == 0) { run_count = *RLElen++; run_is_zero = !run_is_zero; len_offset++; } run_count--; if (!run_is_zero) data_offset += voxel_size; } ASSERT(run_count == 0); if (run_is_zero) { run_count = *RLElen++; run_is_zero = !run_is_zero; len_offset++; } } } return(VP_OK); } #endif /* INDEX_VOLUME */ /* * VPComputeRLEScanOffsets * * Recompute the scan_offsets arrays for the classified volume data in * a context. Return value is a result code. */ vpResult VPComputeRLEScanOffsets(vpc) vpContext *vpc; { vpResult result; if (vpc->rle_x != NULL) { if ((result = ComputeScanOffsets(vpc, vpc->rle_x)) != VP_OK) return(result); #ifdef DEBUG VPCheckScanOffsets(vpc->rle_x, vpc->rle_bytes_per_voxel); #endif } if (vpc->rle_y != NULL) { if ((result = ComputeScanOffsets(vpc, vpc->rle_y)) != VP_OK) return(result); #ifdef DEBUG VPCheckScanOffsets(vpc->rle_y, vpc->rle_bytes_per_voxel); #endif } if (vpc->rle_z != NULL) { if ((result = ComputeScanOffsets(vpc, vpc->rle_z)) != VP_OK) return(result); #ifdef DEBUG VPCheckScanOffsets(vpc->rle_z, vpc->rle_bytes_per_voxel); #endif } return(VP_OK); } /* * ComputeScanOffsets * * Recompute the scan_offsets array for a classified volume. * Return value is a result code. */ static vpResult ComputeScanOffsets(vpc, rle_voxels) vpContext *vpc; RLEVoxels *rle_voxels; { int ilen, jlen, klen; /* size of volume */ unsigned char *RLElen; /* pointer to current run length */ ScanOffset *scan_offset; /* pointer to current scanline offset */ int i, j, k; /* current voxel coordinates */ unsigned len_offset; /* offset in bytes from beginning of run lengths to current run length */ unsigned data_offset; /* offset in bytes from beginning of voxel data to current voxel data */ int voxel_size; /* size of a voxel in bytes */ int zerocount, nonzerocount; if (rle_voxels->mmapped) return(VPERROR_IO); ilen = rle_voxels->ilen; jlen = rle_voxels->jlen; klen = rle_voxels->klen; RLElen = rle_voxels->run_lengths; if (rle_voxels->scan_offsets_per_slice != jlen) { if (rle_voxels->scan_offsets != NULL) Dealloc(vpc, rle_voxels->scan_offsets); Alloc(vpc, rle_voxels->scan_offsets, ScanOffset *, klen * jlen * sizeof(ScanOffset), "scan_offsets"); rle_voxels->scan_offsets_per_slice = jlen; } scan_offset = rle_voxels->scan_offsets; len_offset = 0; data_offset = 0; voxel_size = vpc->rle_bytes_per_voxel; for (k = 0; k < klen; k++) { for (j = 0; j < jlen; j++) { scan_offset->first_len = len_offset; scan_offset->first_data = data_offset; scan_offset++; for (i = 0; i < ilen; ) { zerocount = *RLElen++; /* get length of run of zeros */ nonzerocount = *RLElen++;/* get length of run of non-zeros */ len_offset += 2; data_offset += nonzerocount * voxel_size; i += zerocount + nonzerocount; } ASSERT(i == ilen); } } return(VP_OK); } #ifdef DEBUG /* * VPCheckScanOffsets * * Check the scan_offsets field of an RLEVolume for internal consistency. */ void VPCheckScanOffsets(rle_voxels, rle_bytes_per_voxel) RLEVoxels *rle_voxels; { int i, j, k; int ilen, jlen, klen; int run_length; int is_non_zero; unsigned char *run_length_ptr; int length_offset; int data_offset; int scan_offsets_per_slice; ScanOffset *scan_offset; scan_offsets_per_slice = rle_voxels->scan_offsets_per_slice; if (scan_offsets_per_slice == 0) return; ilen = rle_voxels->ilen; jlen = rle_voxels->jlen; klen = rle_voxels->klen; run_length_ptr = rle_voxels->run_lengths; run_length = 0; is_non_zero = 1; length_offset = 0; data_offset = 0; for (k = 0; k < klen; k++) { for (j = 0; j < jlen; j++) { if (j < scan_offsets_per_slice) { scan_offset = &rle_voxels->scan_offsets[ k*scan_offsets_per_slice + j]; if (scan_offset->first_len != length_offset) { printf("Bad length offset on slice %d, scanline %d: ",k,j); printf("%d should be %d\n", scan_offset->first_len, length_offset); } if (scan_offset->first_data != data_offset) { printf("Bad data offset on slice %d, scanline %d: ",k,j); printf("%d should be %d\n", scan_offset->first_data, data_offset); } } for (i = 0; i < ilen; i++) { while (run_length == 0) { run_length = *run_length_ptr++; is_non_zero = !is_non_zero; length_offset++; } run_length--; if (is_non_zero) data_offset += rle_bytes_per_voxel; } if (run_length != 0) { printf("Run did not terminate at end of scanline "); printf("on slice %d, scanline %d\n", k, j); } if (!is_non_zero) { if (*run_length_ptr++ != 0) { printf("Missing zero run at end of scanline "); printf("on slice %d, scanline %d\n", k, j); } is_non_zero = !is_non_zero; length_offset++; } } } } /* * VPValidateClassifiedVolume * * Compare the classified volume to the unclassified volume. */ void VPValidateClassifiedVolume(vpc) vpContext *vpc; { if (vpc->raw_voxels == NULL) return; if (vpc->rle_z != NULL) { printf("Checking Z view....\n"); ValidateRLEVoxels(vpc, vpc->rle_z, vpc->xstride, vpc->ystride, vpc->zstride, VP_Z_AXIS); } if (vpc->rle_y != NULL) { printf("Checking Y view....\n"); ValidateRLEVoxels(vpc, vpc->rle_y, vpc->zstride, vpc->xstride, vpc->ystride, VP_Y_AXIS); } if (vpc->rle_x != NULL) { printf("Checking X view....\n"); ValidateRLEVoxels(vpc, vpc->rle_x, vpc->ystride, vpc->zstride, vpc->xstride, VP_X_AXIS); } } static void ValidateRLEVoxels(vpc, rle, istride, jstride, kstride, axis) vpContext *vpc; RLEVoxels *rle; int istride, jstride, kstride; int axis; { char *rawvoxel; char *rlevoxel; unsigned char *lengths; int i, j, k; int count; int is_non_zero; int num_runs; float opacity; int ilen, jlen, klen; int founderror; int raw_opc_int; int rle_opc_int; int rle_bytes_per_voxel; rawvoxel = (char *)vpc->raw_voxels; rlevoxel = (char *)rle->data; lengths = rle->run_lengths; ilen = rle->ilen; jlen = rle->jlen; klen = rle->klen; rle_bytes_per_voxel = vpc->rle_bytes_per_voxel; founderror = 0; for (k = 0; k < klen; k++) { for (j = 0; j < jlen; j++) { count = 0; is_non_zero = 1; num_runs = 0; for (i = 0; i < ilen; i++) { while (count == 0) { count = *lengths++; is_non_zero = !is_non_zero; if (++num_runs > rle->ilen) VPBug("runaway scan detected by ValidateRLEVoxels"); } opacity = VPClassifyVoxel(vpc, rawvoxel); if (is_non_zero) { if (opacity <= vpc->min_opacity && fabs(opacity - vpc->min_opacity) > 0.001) { printf("\n"); printf("**** zero rawvoxel in nonzero rlerun ****\n"); printf("voxel (i,j,k)=(%d,%d,%d), viewaxis %d\n", i, j, k, axis); printf("Actual opacity: %17.15f\n", opacity); printf("Threshold: %17.15f\n", vpc->min_opacity); founderror = 1; } raw_opc_int = (int)rint(opacity*255.); rle_opc_int = ByteField(rlevoxel, rle_bytes_per_voxel-1); if (abs(raw_opc_int - rle_opc_int) > 1) { printf("\n"); printf("**** rawvoxel and rlevoxel disagree ****\n"); printf("voxel (i,j,k)=(%d,%d,%d), viewaxis %d\n", i, j, k, axis); printf("Raw opacity: %3d\n", raw_opc_int); printf("RLE opacity: %3d\n", rle_opc_int); founderror = 1; } rlevoxel += rle_bytes_per_voxel; } else { if (opacity > vpc->min_opacity && fabs(opacity - vpc->min_opacity) > 0.001) { printf("\n"); printf("**** nonzero rawvoxel in zero rlerun ****\n"); printf("voxel (i,j,k)=(%d,%d,%d), viewaxis %d\n", i, j, k, axis); printf("Actual opacity: %17.15f\n", opacity); printf("Threshold: %17.15f\n", vpc->min_opacity); founderror = 1; } } if (founderror) { VPDumpClassifier(vpc); VPBug("ValidateRLEVoxels found a problem"); } rawvoxel += istride; count--; } if (count != 0) VPBug("Run did not terminate at end of scanline"); if (!is_non_zero) { if (*lengths++ != 0) VPBug("Missing zero run at end of scanline"); is_non_zero = !is_non_zero; } rawvoxel += jstride - ilen*istride; } rawvoxel += kstride - jlen*jstride; } } #endif void VPDumpView(vpc) vpContext *vpc; { int c; printf("MODEL:\n"); for (c = 0; c < 4; c++) { printf(" %12.6f %12.6f %12.6f %12.6f\n", vpc->transforms[VP_MODEL][c][0], vpc->transforms[VP_MODEL][c][1], vpc->transforms[VP_MODEL][c][2], vpc->transforms[VP_MODEL][c][3]); } printf("VIEW:\n"); for (c = 0; c < 4; c++) { printf(" %12.6f %12.6f %12.6f %12.6f\n", vpc->transforms[VP_MODEL][c][0], vpc->transforms[VP_MODEL][c][1], vpc->transforms[VP_MODEL][c][2], vpc->transforms[VP_MODEL][c][3]); } printf("PROJECT:\n"); for (c = 0; c < 4; c++) { printf(" %12.6f %12.6f %12.6f %12.6f\n", vpc->transforms[VP_MODEL][c][0], vpc->transforms[VP_MODEL][c][1], vpc->transforms[VP_MODEL][c][2], vpc->transforms[VP_MODEL][c][3]); } } void VPDumpClassifier(vpc) vpContext *vpc; { int c, d; for (d = 0; d < vpc->num_clsfy_params; d++) { printf("CLASSIFIER PARAM %d:\n ", d); for (c = 0; c < vpc->field_max[vpc->param_field[d]]; c++) { printf(" %8.6f", vpc->clsfy_table[d][c]); if (c % 8 == 7) printf("\n "); } printf("\n"); } } ccseapps-2.5/CCSEApps/volpack/scalevolume.dsp0000644000175000017500000001126511634153073022352 0ustar amckinstryamckinstry# Microsoft Developer Studio Project File - Name="scalevolume" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=scalevolume - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "scalevolume.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "scalevolume.mak" CFG="scalevolume - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "scalevolume - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "scalevolume - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe F90=df.exe RSC=rc.exe !IF "$(CFG)" == "scalevolume - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE F90 /compile_only /nologo /warn:nofileopt # ADD F90 /compile_only /nologo /warn:nofileopt # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W1 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "scalevolume - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "scalevolume___Win32_Debug" # PROP BASE Intermediate_Dir "scalevolume___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "scalevolume___Win32_Debug" # PROP Intermediate_Dir "scalevolume___Win32_Debug" # PROP Target_Dir "" # ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W1 /Gm /GX /ZI /Od /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "scalevolume - Win32 Release" # Name "scalevolume - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" # Begin Source File SOURCE=.\examples\denfile.c # End Source File # Begin Source File SOURCE=.\examples\scalevolume.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ccseapps-2.5/CCSEApps/volpack/makevolume.dsp0000644000175000017500000001114511634153073022175 0ustar amckinstryamckinstry# Microsoft Developer Studio Project File - Name="makevolume" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=makevolume - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "makevolume.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "makevolume.mak" CFG="makevolume - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "makevolume - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "makevolume - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe F90=df.exe RSC=rc.exe !IF "$(CFG)" == "makevolume - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE F90 /compile_only /nologo /warn:nofileopt # ADD F90 /compile_only /nologo /warn:nofileopt # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W1 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "makevolume - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "makevolume___Win32_Debug" # PROP BASE Intermediate_Dir "makevolume___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "makevolume___Win32_Debug" # PROP Intermediate_Dir "makevolume___Win32_Debug" # PROP Target_Dir "" # ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD F90 /browser /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W1 /Gm /GX /ZI /Od /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "makevolume - Win32 Release" # Name "makevolume - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" # Begin Source File SOURCE=.\examples\makevolume.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ccseapps-2.5/CCSEApps/volpack/ChangeLog0000644000175000017500000001035211634153073021071 0ustar amckinstryamckinstry--------------- Released version 1.0 beta1 --------------- 1. Bug Fix: vpCreateMinMaxOctree caused a segmentation fault for volume sizes that were not a power of two. 2. Debug Feature: Added debugging code for compositing calculation. 3. Debug Feature: Added intermediate image coordinates to vpTracePixel output. 4. Bug Fix: Added a check in vpRamp for non-increasing x coordinates to prevent a divide-by-zero error. 5. Bug Fix: Added a version of the compositing routine (vp_compAn.m4) that does not have unrolled loops, since some compilers have trouble with the unrolled version (too many basic blocks to run the optimizer in a reasonable amount of time). The unrolled version is now in vp_compAu.m4 instead of vp_compA.m4. The Makefile can be modified to choose one or the other version. 6. Feature: Added complete man pages for all library routines. 7. Bug Fix: In vpSetCallback, revert to default behavior if the function argument is NULL (instead of causing a NULL dereference later on). 8. Feature: Added vpStoreContext and vpLoadContext to save and restore rendering contexts (and to make it easier to reproduce bugs). 9. Feature: Changed vpLoadRawVolume to memory-map the file if requested 10. Bug Fix: Fixed missing and incorrect function prototypes. 11. Feature: Changed makefile and headers to use GNU autoconf. --------------- Released version 1.0 beta2 --------------- 12. Bug Fix: Fixed minus-sign error in formula for depth cueing factor. This eliminates the brightness changes that occurred when rotating a volume past a 45 degree point with depth cueing enabled. 13. Debug Feature: Added code to collect rendering statistics for performance analysis. 14. Debug Feature: Allow negative opacity threshold (to experiment with disabling the benefit of spatial data structures). 15. Bug Fix: Fixed the result of vpGeti with the VP_VIEW_Y_SIZE or VP_VIEW_Z_SIZE options. 16. Reorganization and renaming of compositing functions to make it easier to conditionally compile in just some of the special-case versions. Also merged code for unrolled loops with code for non-unrolled loops into one M4 source file. 17. Feature: Added experimental "index volume" code for faster early-ray termination. 18. Debug Feature: Added define flags to conditionally remove early-ray termination and resampling loops for performance analysis runs. 19. Feature: Added experimental brute-force raycaster for performance comparisons. 20. Feature: Implemented shadows. 21. Bug Fix: Added missing return value in vpDestroyClassifiedVolume. 22. Feature: Implemented resampling filters for scaling volume data (vpSetFilter(), vpResample(), vpBoxFilter(), vpLinearFilter(), vpBicubicFilter(), vpGaussianFilter()). 23. Feature: Added capability to produce images with a variety of pixel formats, including an optional alpha channel. *** INCOMPATIBLE CHANGE TO vpSetImage *** 24. Feature: Changed vpGetImage to produce images with the same pixel formats supported by vpSetImage, and to allow reading back the shadow buffer. *** INCOMPATIBLE CHANGE TO vpGetImage *** 25. Reorganized macros in vp_compA.m4 and vp_warpA.m4. 26. Bug Fix: Refactor view if shadows are turned on. 27. Feature: The callback functions for VP_LOG_ALLOC_FUNC, VP_LOG_FREE_FUNC and VP_STATUS_FUNC now get one additional argument, the client_data pointer associated with the context. 28. Bug Fix: Check if intermediate image buffer must be resized even if view has not changed (since number of color channels may be different). 29. Feature: Allow clamping to be disabled when computing shading lookup table (vpShadeTable). 30. Debug Feature: Added options to override default compositing direction and to retrieve compositing order. 31. Bug Fix: Check for invalid voxel field sizes when using lookup table shading. 32. Bug Fix: Don't destroy classified volume when raw voxel array is set to NULL pointer. 33. Bug Fix: Fixed error in vpNormalIndex (also affecting vpScanlineNormals and vpVolumeNormals) that resulted in incorrect calculation of isolated surface normals due to a roundoff error. This sometimes also resulted in index values greater than the maximum permissible value. ccseapps-2.5/CCSEApps/volpack/vp_renderC.c0000644000175000017500000002612011634153073021552 0ustar amckinstryamckinstry/* * vp_renderC.c * * Function to render classified volumes. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:03 $ * $Revision: 1.3 $ */ #include "vp_global.h" #define COMP_AC1PB_FUNC VPCompAC1PB extern void VPCompAC1PB( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ GrayIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, unsigned char *run_lengths, /* run lengths for slice */ void *voxel_data /* voxel data for slice */ ); #define COMP_AC3PB_FUNC VPCompAC3PB extern void VPCompAC3PB( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ RGBIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, unsigned char *run_lengths, /* run lengths for slice */ void *voxel_data /* voxel data for slice */ ); #ifdef COMP_AC11B #define COMP_AC11B_FUNC VPCompAC11B extern void VPCompAC11B( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ GrayIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, unsigned char *run_lengths, /* run lengths for slice */ void *voxel_data /* voxel data for slice */ ); #else #define COMP_AC11B_FUNC VPCompAC1NB #endif #ifdef COMP_AC31B #define COMP_AC31B_FUNC VPCompAC31B extern void VPCompAC31B( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ RGBIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, unsigned char *run_lengths, /* run lengths for slice */ void *voxel_data /* voxel data for slice */ ); #else #define COMP_AC31B_FUNC VPCompAC3NB #endif #ifdef COMP_AC12B #define COMP_AC12B_FUNC VPCompAC12B extern void VPCompAC12B(); #else #define COMP_AC12B_FUNC VPCompAC1NB #endif #ifdef COMP_AC32B #define COMP_AC32B_FUNC VPCompAC32B extern void VPCompAC32B( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ RGBIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, unsigned char *run_lengths, /* run lengths for slice */ void *voxel_data /* voxel data for slice */ ); #else #define COMP_AC32B_FUNC VPCompAC3NB #endif #define COMP_AC1NB_FUNC VPCompAC1NB extern void VPCompAC1NB( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ GrayIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, unsigned char *run_lengths, /* run lengths for slice */ void *voxel_data /* voxel data for slice */ ); #define COMP_AC3NB_FUNC VPCompAC3NB extern void VPCompAC3NB( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ RGBIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, unsigned char *run_lengths, /* run lengths for slice */ void *voxel_data /* voxel data for slice */ ); #define COMP_AC1PS_FUNC VPCompAC1PB #define COMP_AC3PS_FUNC VPCompAC3PB #ifdef COMP_AC11S #define COMP_AC11S_FUNC VPCompAC11S extern void VPCompAC11S(); #else #define COMP_AC11S_FUNC VPCompAC1NS #endif #ifdef COMP_AC31S #define COMP_AC31S_FUNC VPCompAC31S extern void VPCompAC31S(); #else #define COMP_AC31S_FUNC VPCompAC3NS #endif #ifdef COMP_AC12S #define COMP_AC12S_FUNC VPCompAC12S extern void VPCompAC12S(); #else #define COMP_AC12S_FUNC VPCompAC1NS #endif #ifdef COMP_AC32S #define COMP_AC32S_FUNC VPCompAC32S extern void VPCompAC32S(); #else #define COMP_AC32S_FUNC VPCompAC3NS #endif #define COMP_AC1NS_FUNC VPCompAC1NS extern void VPCompAC1NS( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ GrayIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, unsigned char *run_lengths, /* run lengths for slice */ void *voxel_data, /* voxel data for slice */ GrayIntPixel *shadow_buffer ); #define COMP_AC3NS_FUNC VPCompAC3NS extern void VPCompAC3NS( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ RGBIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, unsigned char *run_lengths, /* run lengths for slice */ void *voxel_data, /* voxel data for slice */ GrayIntPixel *shadow_buffer ); #ifdef INDEX_VOLUME extern void VPCompAI11B(); #endif #define SHADOWS_OFF 0 #define SHADOWS_ON 1 #define SHADOW_OPTS 2 #define MATERIAL_CALLBACK 0 #define MATERIAL_ONE 1 #define MATERIAL_TWO 2 #define MATERIAL_MORE 3 #define MATERIAL_OPTS 4 #define COLOR_GRAY 0 #define COLOR_RGB 1 #define COLOR_OPTS 2 static void (*AffineProcTable[SHADOW_OPTS][MATERIAL_OPTS][COLOR_OPTS])(vpContext*,...) = { { { (void(*)(vpContext*,...))COMP_AC1PB_FUNC, (void(*)(vpContext*,...))COMP_AC3PB_FUNC }, { (void(*)(vpContext*,...))COMP_AC11B_FUNC, (void(*)(vpContext*,...))COMP_AC31B_FUNC }, { (void(*)(vpContext*,...))COMP_AC12B_FUNC, (void(*)(vpContext*,...))COMP_AC32B_FUNC }, { (void(*)(vpContext*,...))COMP_AC1NB_FUNC, (void(*)(vpContext*,...))COMP_AC3NB_FUNC } }, { { (void(*)(vpContext*,...))COMP_AC1PS_FUNC, (void(*)(vpContext*,...))COMP_AC3PS_FUNC }, { (void(*)(vpContext*,...))COMP_AC11S_FUNC, (void(*)(vpContext*,...))COMP_AC31S_FUNC }, { (void(*)(vpContext*,...))COMP_AC12S_FUNC, (void(*)(vpContext*,...))COMP_AC32S_FUNC }, { (void(*)(vpContext*,...))COMP_AC1NS_FUNC, (void(*)(vpContext*,...))COMP_AC3NS_FUNC } } }; /* * vpRenderClassifiedVolume * * Render a classified, run-length encoded volume using the shear-warp * algorithm. */ vpResult vpRenderClassifiedVolume(vpc) vpContext *vpc; { int retcode; void (*composite_func)(vpContext*,...); int shadow_option, material_option, color_option; #ifdef INDEX_VOLUME int have_index; #endif /* check for errors and initialize */ if ((retcode = VPCheckShader(vpc)) != VP_OK) return(retcode); if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); if ((retcode = VPCheckClassifiedVolume(vpc, vpc->best_view_axis)) != VP_OK) return(retcode); if ((retcode = VPCheckImage(vpc)) != VP_OK) return(retcode); if ((retcode = VPCheckShadows(vpc)) != VP_OK) return(retcode); #ifdef INDEX_VOLUME switch (vpc->best_view_axis) { case VP_X_AXIS: if (vpc->rle_x->voxel_index != NULL) have_index = 1; else have_index = 0; break; case VP_Y_AXIS: if (vpc->rle_y->voxel_index != NULL) have_index = 1; else have_index = 0; break; case VP_Z_AXIS: if (vpc->rle_z->voxel_index != NULL) have_index = 1; else have_index = 0; break; default: VPBug("invalid viewing axis in vpRenderClassifiedVolume"); } #endif /* INDEX_VOLUME */ Debug((vpc, VPDEBUG_RENDER, "Algorithm: affine RLEvolume\n")); /* determine which options are enabled */ if (vpc->enable_shadows) shadow_option = SHADOWS_ON; else shadow_option = SHADOWS_OFF; if (vpc->shading_mode == CALLBACK_SHADER) material_option = MATERIAL_CALLBACK; else if (vpc->num_materials == 1) material_option = MATERIAL_ONE; else if (vpc->num_materials == 2) material_option = MATERIAL_TWO; else material_option = MATERIAL_MORE; if (vpc->color_channels == 1) color_option = COLOR_GRAY; else color_option = COLOR_RGB; /* render */ if (vpc->affine_view) { /* choose a compositing function */ composite_func = AffineProcTable[shadow_option][material_option] [color_option]; #ifdef INDEX_VOLUME if (have_index && shadow_option == SHADOWS_OFF && material_option == MATERIAL_ONE && color_option == COLOR_GRAY) { composite_func = VPCompAI11B; } #endif VPRenderAffine(vpc, USE_RLEVOLUME, composite_func); } else { /* XXX perspective rendering not available yet */ return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } ccseapps-2.5/CCSEApps/volpack/vp_context.c0000644000175000017500000015276611634153073021674 0ustar amckinstryamckinstry/* * vp_context.c * * Routines to create, modify and destroy vpContext objects. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2002/01/30 23:34:35 $ * $Revision: 1.9 $ */ #include "vp_global.h" #ifdef WIN32 #include #else #include #endif static void InitContext ANSI_ARGS((vpContext *vpc)); #ifdef HAVE_HIRES_TIMER static void StartHiResTimer ANSI_ARGS((vpContext *vpc)); #endif #ifdef STATISTICS int vpResampleCount = 0; int vpCompositeCount = 0; int vpERTSkipCount = 0; int vpERTSkipAgainCount = 0; int vpERTUpdateCount = 0; int vpSpecialZeroSkipCount = 0; int vpRunFragmentCount = 0; #endif /* * InitContext * * Initialize the fields of a context that have defaults. */ static void InitContext(vpc) vpContext *vpc; { int m, l; vpc->xlen = 0; vpc->ylen = 0; vpc->zlen = 0; vpc->raw_bytes_per_voxel = 0; vpc->num_voxel_fields = 0; vpc->num_shade_fields = 0; vpc->min_opacity = 0.0; vpc->num_clsfy_params = 0; vpc->color_channels = 1; vpc->shading_mode = LOOKUP_SHADER; vpc->num_materials = 1; vpc->color_field = 0; vpc->weight_field = 0; for (m = 0; m < VP_MAX_MATERIAL; m++) { vpc->matl_props[m][EXT_SURFACE][MATL_AMB_R] = DEFAULT_AMBIENT; vpc->matl_props[m][EXT_SURFACE][MATL_DIFF_R] = DEFAULT_DIFFUSE; vpc->matl_props[m][EXT_SURFACE][MATL_SPEC_R] = DEFAULT_SPECULAR; vpc->matl_props[m][EXT_SURFACE][MATL_AMB_G] = DEFAULT_AMBIENT; vpc->matl_props[m][EXT_SURFACE][MATL_DIFF_G] = DEFAULT_DIFFUSE; vpc->matl_props[m][EXT_SURFACE][MATL_SPEC_G] = DEFAULT_SPECULAR; vpc->matl_props[m][EXT_SURFACE][MATL_AMB_B] = DEFAULT_AMBIENT; vpc->matl_props[m][EXT_SURFACE][MATL_DIFF_B] = DEFAULT_DIFFUSE; vpc->matl_props[m][EXT_SURFACE][MATL_SPEC_B] = DEFAULT_SPECULAR; vpc->matl_props[m][EXT_SURFACE][MATL_SHINY] = DEFAULT_SHINYNESS; vpc->matl_props[m][INT_SURFACE][MATL_AMB_R] = DEFAULT_AMBIENT; vpc->matl_props[m][INT_SURFACE][MATL_DIFF_R] = DEFAULT_DIFFUSE; vpc->matl_props[m][INT_SURFACE][MATL_SPEC_R] = DEFAULT_SPECULAR; vpc->matl_props[m][INT_SURFACE][MATL_AMB_G] = DEFAULT_AMBIENT; vpc->matl_props[m][INT_SURFACE][MATL_DIFF_G] = DEFAULT_DIFFUSE; vpc->matl_props[m][INT_SURFACE][MATL_SPEC_G] = DEFAULT_SPECULAR; vpc->matl_props[m][INT_SURFACE][MATL_AMB_B] = DEFAULT_AMBIENT; vpc->matl_props[m][INT_SURFACE][MATL_DIFF_B] = DEFAULT_DIFFUSE; vpc->matl_props[m][INT_SURFACE][MATL_SPEC_B] = DEFAULT_SPECULAR; vpc->matl_props[m][INT_SURFACE][MATL_SHINY] = DEFAULT_SHINYNESS; } for (l = 0; l < VP_MAX_LIGHTS; l++) { vpc->light_enable[l] = 0; vpSetVector4(vpc->light_vector[l], 0.57735, 0.57735, 0.57735, 1.); vpSetVector3(vpc->light_color[l], 1., 1., 1.); } vpc->light_enable[0] = 1; vpc->light_both_sides = 0; vpc->reverse_surface_sides = 0; vpc->dc_enable = 0; vpc->dc_front_factor = 1.; vpc->dc_density = 1.; vpc->dc_quantization = DEFAULT_DC_QUANTIZATION; vpIdentity4(vpc->transforms[VP_MODEL]); vpIdentity4(vpc->transforms[VP_VIEW]); vpIdentity4(vpc->transforms[VP_PROJECT]); vpWindow(vpc, VP_PARALLEL, -0.5, 0.5, -0.5, 0.5, -0.5, 0.5); vpc->current_matrix = VP_MODEL; vpc->concat_left = 0; vpc->axis_override = VP_NO_AXIS; vpc->max_opacity = 1.0; vpc->factored_view_ready = 0; vpc->int_image_width_hint = 0; vpc->int_image_height_hint = 0; vpc->clamp_shade_table = 1; vpc->enable_shadows = 0; vpc->shadow_light_num = VP_LIGHT0; vpc->shadow_width_hint = 0; vpc->shadow_height_hint = 0; vpc->shadow_bias = 4; #ifdef WIN32 vpc->write_func = _write; vpc->read_func = _read; #else vpc->write_func = write; vpc->read_func = read; #endif vpc->read_func = read; vpc->mmap_func = NULL; vpc->log_alloc_func = NULL; vpc->log_free_func = NULL; vpc->status_func = NULL; vpc->client_data = NULL; vpc->error_code = VP_OK; #ifdef DEBUG bzero(vpc->debug_enable, VPDEBUG_COUNT * sizeof(short)); vpc->trace_u = -1; vpc->trace_v = -1; vpc->trace_shadow_k = 0; #endif #ifdef USE_TIMER bzero(vpc->timer_ticks, VPTIMER_COUNT * sizeof(unsigned)); #ifdef HAVE_LORES_TIMER vpc->timer_usec_per_tick = 1.0; #endif #ifdef HAVE_HIRES_TIMER StartHiResTimer(vpc); #endif #endif /* USE_TIMER */ } /* * vpCreateContext * * Create a rendering context. */ vpContext * vpCreateContext() { vpContext *vpc; /* NOTE: cannot use Alloc() to allocate a context since it requires a context as an argument */ if ((vpc = (vpContext *)malloc(sizeof(vpContext))) == NULL) VPBug("out of memory"); bzero(vpc, sizeof(vpContext)); InitContext(vpc); return(vpc); } /* * vpDestroyContext * * Destroy a rendering context. */ void vpDestroyContext(vpc) vpContext *vpc; { VPResizeDepthCueTable(vpc, 0, 0); VPResizeRenderBuffers(vpc, 0, 0, 0); vpDestroyClassifiedVolume(vpc); vpDestroyMinMaxOctree(vpc); if (vpc->sum_table != NULL) Dealloc(vpc, vpc->sum_table); VPResizeShadowBuffer(vpc, 0, 0); /* NOTE: don't use Dealloc() to deallocate a context since it wasn't created with Alloc() */ free((void *)vpc); } /* * vpSetVolumeSize * * Set the size of the volume. */ vpResult vpSetVolumeSize(vpc, xlen, ylen, zlen) vpContext *vpc; int xlen, ylen, zlen; { vpc->xlen = xlen; vpc->ylen = ylen; vpc->zlen = zlen; vpc->factored_view_ready = 0; vpDestroyClassifiedVolume(vpc); vpDestroyMinMaxOctree(vpc); return(VP_OK); } /* * vpSetVoxelSize * * Set the size of a voxel. */ vpResult vpSetVoxelSize(vpc, bytes_per_voxel, num_voxel_fields, num_shade_fields, num_clsfy_fields) vpContext *vpc; int bytes_per_voxel; int num_voxel_fields; int num_shade_fields; int num_clsfy_fields; { if (num_voxel_fields >= VP_MAX_FIELDS) return(VPSetError(vpc, VPERROR_LIMIT_EXCEEDED)); if (num_clsfy_fields < 0 || num_clsfy_fields > num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (num_shade_fields < 0 || num_shade_fields > num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->raw_bytes_per_voxel = bytes_per_voxel; vpc->num_voxel_fields = num_voxel_fields; vpc->num_shade_fields = num_shade_fields; vpc->num_clsfy_params = num_clsfy_fields; vpDestroyClassifiedVolume(vpc); vpDestroyMinMaxOctree(vpc); return(VP_OK); } /* * vpSetVoxelField * * Set the size and position of a voxel field. */ vpResult vpSetVoxelField(vpc, field_num, field_size, field_offset, field_max) vpContext *vpc; int field_num; int field_size; int field_offset; int field_max; { if (field_num < 0 || field_num >= vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (field_size != 1 && field_size != 2 && field_size != 4) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (field_offset < 0 || field_offset >= vpc->raw_bytes_per_voxel) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->field_size[field_num] = field_size; vpc->field_offset[field_num] = field_offset; vpc->field_max[field_num] = field_max; vpDestroyClassifiedVolume(vpc); vpDestroyMinMaxOctree(vpc); return(VP_OK); } /* * vpSetRawVoxels * * Set the array of unclassified voxels. */ vpResult vpSetRawVoxels(vpc, raw_voxels, raw_voxels_size, xstride, ystride, zstride) vpContext *vpc; int xstride, ystride, zstride; void *raw_voxels; int raw_voxels_size; { vpc->raw_voxels = raw_voxels; vpc->raw_voxels_size = raw_voxels_size; vpc->xstride = xstride; vpc->ystride = ystride; vpc->zstride = zstride; if (raw_voxels_size != 0) vpDestroyClassifiedVolume(vpc); vpDestroyMinMaxOctree(vpc); return(VP_OK); } /* * vpSetClassifierTable * * Specify a lookup table for one of the classification function's * parameters. */ vpResult vpSetClassifierTable(vpc, param_num, param_field, table, table_size) vpContext *vpc; int param_num; int param_field; float *table; int table_size; { if (param_num < 0 || param_num >= vpc->num_clsfy_params) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (param_field < 0 || param_field >= vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->param_field[param_num] = param_field; vpc->clsfy_table[param_num] = table; vpc->clsfy_table_size[param_num] = table_size; return(VP_OK); } /* * vpSetLookupShader * * Define a lookup shader. */ vpResult vpSetLookupShader(vpc, color_channels, num_materials, color_field, color_table, color_table_size, weight_field, weight_table, weight_table_size) vpContext *vpc; int color_channels; int num_materials; int color_field; float *color_table; int color_table_size; int weight_field; float *weight_table; int weight_table_size; { if (color_channels != 1 && color_channels != 3) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (num_materials <= 0 || num_materials >= VP_MAX_MATERIAL) return(VPSetError(vpc, VPERROR_LIMIT_EXCEEDED)); if (color_field < 0 || color_field >= vpc->num_voxel_fields || color_table == NULL || color_table_size == 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (num_materials > 1) { if (weight_field < 0 || weight_field >= vpc->num_voxel_fields || weight_table == NULL || weight_table_size == 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); } vpc->color_channels = color_channels; vpc->shading_mode = LOOKUP_SHADER; vpc->shade_color_table = color_table; vpc->shade_color_table_size = color_table_size; vpc->shade_weight_table = weight_table; vpc->shade_weight_table_size = weight_table_size; vpc->num_materials = num_materials; vpc->color_field = color_field; vpc->weight_field = weight_field; return(VP_OK); } /* * vpSetShadowLookupShader * * Define a lookup shader that support shadows. */ vpResult vpSetShadowLookupShader(vpc, color_channels, num_materials, color_field, color_table, color_table_size, weight_field, weight_table, weight_table_size, shadow_table, shadow_table_size) vpContext *vpc; int color_channels; int num_materials; int color_field; float *color_table; int color_table_size; int weight_field; float *weight_table; int weight_table_size; float *shadow_table; int shadow_table_size; { if (color_channels != 1 && color_channels != 3) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (num_materials <= 0 || num_materials >= VP_MAX_MATERIAL) return(VPSetError(vpc, VPERROR_LIMIT_EXCEEDED)); if (color_field < 0 || color_field >= vpc->num_voxel_fields || color_table == NULL || color_table_size == 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (num_materials > 1) { if (weight_field < 0 || weight_field >= vpc->num_voxel_fields || weight_table == NULL || weight_table_size == 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); } if (shadow_table_size != color_table_size) return(VPSetError(vpc, VPERROR_BAD_SIZE)); vpc->color_channels = color_channels; vpc->shading_mode = LOOKUP_SHADER; vpc->shade_color_table = color_table; vpc->shade_color_table_size = color_table_size; vpc->shade_weight_table = weight_table; vpc->shade_weight_table_size = weight_table_size; vpc->num_materials = num_materials; vpc->color_field = color_field; vpc->weight_field = weight_field; vpc->shadow_color_table = shadow_table; vpc->shadow_color_table_size = shadow_table_size; return(VP_OK); } /* * vpSetMaterial * * Set material parameters. */ vpResult vpSetMaterial(vpc, material, property, surface_side, r, g, b) vpContext *vpc; int material; int property; int surface_side; double r, g, b; { material -= VP_MATERIAL0; if (material < 0 || material >= vpc->num_materials) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (surface_side == 0 || (surface_side & ~VP_BOTH_SIDES) != 0) return(VPSetError(vpc, VPERROR_BAD_OPTION)); if (property != VP_SHINYNESS) { if (r < 0. || g < 0. || b < 0.) return(VPSetError(vpc, VPERROR_BAD_VALUE)); } switch (property) { case VP_AMBIENT: if (surface_side & VP_EXTERIOR) { vpc->matl_props[material][EXT_SURFACE][MATL_AMB_R] = r * 255.; vpc->matl_props[material][EXT_SURFACE][MATL_AMB_G] = g * 255.; vpc->matl_props[material][EXT_SURFACE][MATL_AMB_B] = b * 255.; } if (surface_side & VP_INTERIOR) { vpc->matl_props[material][INT_SURFACE][MATL_AMB_R] = r * 255.; vpc->matl_props[material][INT_SURFACE][MATL_AMB_G] = g * 255.; vpc->matl_props[material][INT_SURFACE][MATL_AMB_B] = b * 255.; } break; case VP_DIFFUSE: if (surface_side & VP_EXTERIOR) { vpc->matl_props[material][EXT_SURFACE][MATL_DIFF_R] = r * 255.; vpc->matl_props[material][EXT_SURFACE][MATL_DIFF_G] = g * 255.; vpc->matl_props[material][EXT_SURFACE][MATL_DIFF_B] = b * 255.; } if (surface_side & VP_INTERIOR) { vpc->matl_props[material][INT_SURFACE][MATL_DIFF_R] = r * 255.; vpc->matl_props[material][INT_SURFACE][MATL_DIFF_G] = g * 255.; vpc->matl_props[material][INT_SURFACE][MATL_DIFF_B] = b * 255.; } break; case VP_SPECULAR: if (surface_side & VP_EXTERIOR) { vpc->matl_props[material][EXT_SURFACE][MATL_SPEC_R] = r * 255.; vpc->matl_props[material][EXT_SURFACE][MATL_SPEC_G] = g * 255.; vpc->matl_props[material][EXT_SURFACE][MATL_SPEC_B] = b * 255.; } if (surface_side & VP_INTERIOR) { vpc->matl_props[material][INT_SURFACE][MATL_SPEC_R] = r * 255.; vpc->matl_props[material][INT_SURFACE][MATL_SPEC_G] = g * 255.; vpc->matl_props[material][INT_SURFACE][MATL_SPEC_B] = b * 255.; } break; case VP_SHINYNESS: if (surface_side & VP_EXTERIOR) vpc->matl_props[material][EXT_SURFACE][MATL_SHINY] = r; if (surface_side & VP_INTERIOR) vpc->matl_props[material][INT_SURFACE][MATL_SHINY] = r; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpSetLight * * Set the properties of a directional light source. */ vpResult vpSetLight(vpc, light_num, property, n0, n1, n2) vpContext *vpc; int light_num; int property; double n0, n1, n2; { vpVector4 v1, v2; light_num -= VP_LIGHT0; if (light_num < 0 || light_num >= VP_MAX_LIGHTS) return(VPSetError(vpc, VPERROR_LIMIT_EXCEEDED)); switch (property) { case VP_DIRECTION: vpSetVector4(v1, n0, n1, n2, 1.); if (vpNormalize3(v1) != VP_OK) return(VPSetError(vpc, VPERROR_SINGULAR)); vpMatrixVectorMult4(v2, vpc->transforms[VP_MODEL], v1); vpc->light_vector[light_num][0] = v2[0]; vpc->light_vector[light_num][1] = v2[1]; vpc->light_vector[light_num][2] = v2[2]; vpc->light_vector[light_num][3] = v2[3]; break; case VP_COLOR: if (n0 < 0. || n0 > 1. || n1 < 0. || n1 > 1. || n2 < 0. || n2 > 1.) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->light_color[light_num][0] = n0; vpc->light_color[light_num][1] = n1; vpc->light_color[light_num][2] = n2; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpEnable * * Enable or disable an option. */ vpResult vpEnable(vpc, option, value) vpContext *vpc; int option; int value; { switch (option) { case VP_LIGHT0: case VP_LIGHT1: case VP_LIGHT2: case VP_LIGHT3: case VP_LIGHT4: case VP_LIGHT5: if (value == 0) vpc->light_enable[option - VP_LIGHT0] = 0; else vpc->light_enable[option - VP_LIGHT0] = 1; break; case VP_LIGHT_BOTH_SIDES: if (value == 0) vpc->light_both_sides = 0; else vpc->light_both_sides = 1; break; case VP_REVERSE_SURFACE_SIDES: if (value == 0) vpc->reverse_surface_sides = 0; else vpc->reverse_surface_sides = 1; break; case VP_DEPTH_CUE: if (value == 0) vpc->dc_enable = 0; else vpc->dc_enable = 1; break; case VP_VIEW_X_AXIS: if (value == 0) vpc->skip_rle_x = 1; else vpc->skip_rle_x = 0; break; case VP_VIEW_Y_AXIS: if (value == 0) vpc->skip_rle_y = 1; else vpc->skip_rle_y = 0; break; case VP_VIEW_Z_AXIS: if (value == 0) vpc->skip_rle_z = 1; else vpc->skip_rle_z = 0; break; case VP_SHADOW: if (value == 0) { vpc->enable_shadows = 0; } else { vpc->enable_shadows = 1; } vpc->factored_view_ready = 0; break; case VP_CLAMP_SHADE_TABLE: if (value == 0) vpc->clamp_shade_table = 0; else vpc->clamp_shade_table = 1; break; default: return(VPSetError(vpc, VPERROR_BAD_VALUE)); } return(VP_OK); } /* * vpSetDepthCueing * * Set depth cueing parameters. */ vpResult vpSetDepthCueing(vpc, front_factor, density) vpContext *vpc; double front_factor; double density; { if (front_factor <= 0.) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->dc_front_factor = front_factor; vpc->dc_density = density; if (vpc->dc_table_len > 0) VPComputeDepthCueTable(vpc, 0, vpc->dc_table_len-1); return(VP_OK); } /* * vpCurrentMatrix * * Set the current matrix. */ vpResult vpCurrentMatrix(vpc, option) vpContext *vpc; int option; { switch (option) { case VP_MODEL: case VP_VIEW: case VP_PROJECT: vpc->current_matrix = option; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpIdentityMatrix * * Load the identity into the current matrix. */ vpResult vpIdentityMatrix(vpc) vpContext *vpc; { vpIdentity4(vpc->transforms[vpc->current_matrix]); vpc->factored_view_ready = 0; return(VP_OK); } /* * vpSetMatrix * * Load the elements of the current matrix. */ vpResult vpSetMatrix(vpc, matrix) vpContext *vpc; vpMatrix4 matrix; { bcopy(matrix, vpc->transforms[vpc->current_matrix], sizeof(vpMatrix4)); vpc->factored_view_ready = 0; return(VP_OK); } /* * vpGetMatrix * * Get the elements of the indicated matrix. */ vpResult vpGetMatrix(vpc, matrix_code, matrix) vpContext *vpc; int matrix_code; vpMatrix4 matrix; { switch (matrix_code) { case VP_MODEL: case VP_VIEW: case VP_PROJECT: bcopy(vpc->transforms[matrix_code], matrix, sizeof(vpMatrix4)); break; case VP_SCREEN: VPComputeViewTransform(vpc, matrix); break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpMultMatrix * * Multiply the current matrix by the given matrix. */ vpResult vpMultMatrix(vpc, matrix) vpContext *vpc; vpMatrix4 matrix; { vpMatrix4 tmp; if (vpc->concat_left) vpMatrixMult4(tmp, matrix, vpc->transforms[vpc->current_matrix]); else vpMatrixMult4(tmp, vpc->transforms[vpc->current_matrix], matrix); bcopy(tmp, vpc->transforms[vpc->current_matrix], sizeof(vpMatrix4)); vpc->factored_view_ready = 0; return(VP_OK); } /* * vpTranslate * * Multiply the current matrix by a translation matrix. */ vpResult vpTranslate(vpc, tx, ty, tz) vpContext *vpc; double tx, ty, tz; { vpMatrix4 t, tmp; VPLoadTranslation(t, tx, ty, tz); if (vpc->concat_left) vpMatrixMult4(tmp, t, vpc->transforms[vpc->current_matrix]); else vpMatrixMult4(tmp, vpc->transforms[vpc->current_matrix], t); bcopy(tmp, vpc->transforms[vpc->current_matrix], sizeof(vpMatrix4)); vpc->factored_view_ready = 0; return(VP_OK); } /* * vpRotate * * Multiply the current matrix by a rotation matrix. */ vpResult vpRotate(vpc, axis, degrees) vpContext *vpc; int axis; double degrees; { vpMatrix4 r, tmp; if (axis != VP_X_AXIS && axis != VP_Y_AXIS && axis != VP_Z_AXIS) return(VPSetError(vpc, VPERROR_BAD_OPTION)); VPLoadRotation(r, axis, degrees); if (vpc->concat_left) vpMatrixMult4(tmp, r, vpc->transforms[vpc->current_matrix]); else vpMatrixMult4(tmp, vpc->transforms[vpc->current_matrix], r); bcopy(tmp, vpc->transforms[vpc->current_matrix], sizeof(vpMatrix4)); vpc->factored_view_ready = 0; return(VP_OK); } /* * vpScale * * Multiply the current matrix by a scale matrix. */ vpResult vpScale(vpc, sx, sy, sz) vpContext *vpc; double sx, sy, sz; { vpMatrix4 s, tmp; VPLoadScale(s, sx, sy, sz); if (vpc->concat_left) vpMatrixMult4(tmp, s, vpc->transforms[vpc->current_matrix]); else vpMatrixMult4(tmp, vpc->transforms[vpc->current_matrix], s); bcopy(tmp, vpc->transforms[vpc->current_matrix], sizeof(vpMatrix4)); vpc->factored_view_ready = 0; return(VP_OK); } /* * vpWindow * * Set the projection matrix for a perspective or * orthographic viewing volume. */ vpResult vpWindow(vpc, type, left, right, bottom, top, nnear, ffar) vpContext *vpc; int type; double left, right, bottom, top, nnear, ffar; { vpMatrix4 projectm, tmp; if (left >= right || bottom >= top || nnear >= ffar) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (type == VP_PERSPECTIVE) { if (nnear <= 0 || ffar <= 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); } else if (type != VP_PARALLEL) { return(VPSetError(vpc, VPERROR_BAD_OPTION)); } vpIdentity4(projectm); if (type == VP_PARALLEL) { projectm[0][0] = 2. / (right - left); projectm[1][1] = 2. / (top - bottom); projectm[2][2] = 2. / (ffar - nnear); projectm[0][3] = (left + right) / (left - right); projectm[1][3] = (bottom + top) / (bottom - top); projectm[2][3] = (nnear + ffar) / (nnear - ffar); } else { /* XXX perspective rendering not available yet */ return(VPSetError(vpc, VPERROR_BAD_OPTION)); #ifdef notdef projectm[0][0] = 2. * nnear / (right - left); projectm[1][1] = 2. * nnear / (top - bottom); projectm[2][2] = (nnear + ffar) / (nnear - ffar); projectm[0][2] = (right + left) / (right - left); projectm[1][2] = (top + bottom) / (top - bottom); projectm[3][2] = -1.; projectm[2][3] = 2. * ffar * nnear / (nnear - ffar); #endif } if (vpc->concat_left) vpMatrixMult4(tmp, projectm, vpc->transforms[VP_PROJECT]); else vpMatrixMult4(tmp, vpc->transforms[VP_PROJECT], projectm); bcopy(tmp, vpc->transforms[VP_PROJECT], sizeof(vpMatrix4)); vpc->factored_view_ready = 0; return(VP_OK); } /* * vpWindowPHIGS * * Setting the projection matrix using a PHIGS view specification. */ vpResult vpWindowPHIGS(vpc, vrp, vpn, vup, prp, viewport_umin, viewport_umax, viewport_vmin, viewport_vmax, viewport_front, viewport_back, projection_type) vpContext *vpc; vpVector3 vrp; vpVector3 vpn; vpVector3 vup; vpVector3 prp; double viewport_umin; double viewport_umax; double viewport_vmin; double viewport_vmax; double viewport_front; double viewport_back; int projection_type; { vpMatrix4 m1, m2, m3; double cw_x, cw_y; /* center of window */ double newz; if (viewport_umax <= viewport_umin || viewport_vmax <= viewport_vmin || viewport_front <= viewport_back) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (projection_type != VP_PARALLEL && projection_type != VP_PERSPECTIVE) return(VPSetError(vpc, VPERROR_BAD_OPTION)); /* perspective rendering not available yet */ if (projection_type == VP_PERSPECTIVE) return(VPSetError(vpc, VPERROR_BAD_OPTION)); /* translate view reference point to the origin */ VPLoadTranslation(m1, -vrp[0], -vrp[1], -vrp[2]); /* rotate VRC axes into world coordinate axes */ vpIdentity4(m2); m2[2][0] = vpn[0]; m2[2][1] = vpn[1]; m2[2][2] = vpn[2]; if (vpNormalize3(m2[2]) != VP_OK) return(VPSetError(vpc, VPERROR_SINGULAR)); vpCrossProduct(m2[0], vup, m2[2]); if (vpNormalize3(m2[0]) != VP_OK) return(VPSetError(vpc, VPERROR_SINGULAR)); vpCrossProduct(m2[1], m2[2], m2[0]); vpMatrixMult4(m3, m2, m1); if (projection_type == VP_PERSPECTIVE) { /* translate center of projection to the origin */ VPLoadTranslation(m1, -prp[0], -prp[1], -prp[2]); vpMatrixMult4(m2, m1, m3); bcopy(m2, m3, sizeof(vpMatrix4)); } /* shear to make DOP equal to the z axis */ if (fabs(prp[2]) < VP_EPS) return(VPSetError(vpc, VPERROR_SINGULAR)); vpIdentity4(m1); cw_x = 0.5 * (viewport_umin + viewport_umax); cw_y = 0.5 * (viewport_vmin + viewport_vmax); m1[0][2] = (cw_x - prp[0]) / prp[2]; m1[1][2] = (cw_y - prp[1]) / prp[2]; vpMatrixMult4(m2, m1, m3); if (projection_type == VP_PARALLEL) { /* translate to clip origin */ VPLoadTranslation(m3, -cw_x, -cw_y, -viewport_back); vpMatrixMult4(m1, m3, m2); /* scale to clip coordinates */ VPLoadScale(m2, 2. / (viewport_umax - viewport_umin), 2. / (viewport_vmax - viewport_vmin), 1. / (viewport_front - viewport_back)); vpMatrixMult4(m3, m2, m1); } else { /* scale into canonical perspective view volume */ if (fabs(prp[2] - viewport_back) < VP_EPS) return(VPSetError(vpc, VPERROR_SINGULAR)); vpIdentity4(m3); m3[0][0] = 2*prp[2] / ((viewport_umax - viewport_umin) * (prp[2] - viewport_back)); m3[1][1] = 2*prp[2] / ((viewport_vmax - viewport_vmin) * (prp[2] - viewport_back)); m3[2][2] = 1. / (prp[2] - viewport_back); vpMatrixMult4(m1, m3, m2); /* transform into clip coordinates */ vpIdentity4(m2); newz = (prp[2] - viewport_front) / (viewport_back - prp[2]); m2[2][2] = 1. / (1. + newz); m2[2][3] = newz / (-1. - newz); m2[3][2] = -1.; m2[3][3] = 0.; vpMatrixMult4(m3, m2, m1); } if (vpc->concat_left) vpMatrixMult4(m1, m3, vpc->transforms[VP_PROJECT]); else vpMatrixMult4(m1, vpc->transforms[VP_PROJECT], m3); bcopy(m1, vpc->transforms[VP_PROJECT], sizeof(vpMatrix4)); vpc->factored_view_ready = 0; return(VP_OK); } /* * vpSetImage * * Set the buffer to store the image into. */ vpResult vpSetImage(vpc, image, width, height, bytes_per_scan, pixel_type) vpContext *vpc; unsigned char *image; int width, height; int bytes_per_scan; int pixel_type; { int bytes_per_pixel; /* check for errors */ switch (pixel_type) { case VP_ALPHA: case VP_LUMINANCE: bytes_per_pixel = 1; break; case VP_LUMINANCEA: bytes_per_pixel = 2; break; case VP_RGB: case VP_BGR: bytes_per_pixel = 3; break; case VP_RGBA: case VP_ABGR: bytes_per_pixel = 4; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } if (bytes_per_scan < width * bytes_per_pixel) return(VPSetError(vpc, VPERROR_BAD_SIZE)); /* update context */ if (width != vpc->image_width || height != vpc->image_height) { vpc->image_width = width; vpc->image_height = height; vpc->factored_view_ready = 0; } vpc->image = image; vpc->image_bytes_per_scan = bytes_per_scan; vpc->pixel_type = pixel_type; return(VP_OK); } /* * vpSeti * * Set a rendering option with an integer value. */ vpResult vpSeti(vpc, option, value) vpContext *vpc; int option; int value; { switch (option) { case VP_CONCAT_MODE: if (value == VP_CONCAT_LEFT) vpc->concat_left = 1; else if (value == VP_CONCAT_RIGHT) vpc->concat_left = 0; else return(VPSetError(vpc, VPERROR_BAD_OPTION)); break; case VP_DEPTH_CUE_SIZE_HINT: if (value < 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->dc_table_len_hint = value; break; case VP_INT_WIDTH_HINT: if (value < 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->int_image_width_hint = value; break; case VP_INT_HEIGHT_HINT: if (value < 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->int_image_height_hint = value; break; case VP_SHADOW_LIGHT: if (value < VP_LIGHT0 || value > VP_LIGHT5) return(VPSetError(vpc, VPERROR_BAD_OPTION)); vpc->shadow_light_num = value; break; case VP_SHADOW_WIDTH_HINT: if (value < 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->shadow_width_hint = value; break; case VP_SHADOW_HEIGHT_HINT: if (value < 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->shadow_height_hint = value; break; case VP_SHADOW_BIAS: if (value < 0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->shadow_bias = value; vpc->factored_view_ready = 0; break; case VP_AXIS_OVERRIDE: switch (value) { case VP_X_AXIS: case VP_Y_AXIS: case VP_Z_AXIS: case VP_NO_AXIS: vpc->axis_override = value; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); /*NOTREACHED*/ break; } vpc->factored_view_ready = 0; break; case VP_TRACE_SHADOW_K: #ifdef DEBUG vpc->trace_shadow_k = value; #endif break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpSetd * * Set a rendering option with a double-precision value. */ vpResult vpSetd(vpc, option, value) vpContext *vpc; int option; double value; { switch (option) { case VP_DEPTH_CUE_QUANTIZATION: if (value <= 0. || value >= 1.) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->dc_quantization = value; VPResizeDepthCueTable(vpc, 0, 0); break; case VP_MAX_RAY_OPACITY: if (value < 0. || value > 1.) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->max_opacity = value; break; case VP_MIN_VOXEL_OPACITY: if ((value < 0. || value > 1.) && value != -1.0) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->min_opacity = value; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpMinMaxOctreeThreshold * * Set the threshold of a parameter for constructing the min-max octree. */ vpResult vpMinMaxOctreeThreshold(vpc, param, range) vpContext *vpc; int param; int range; { if (param >= vpc->num_clsfy_params) return(VPSetError(vpc, VPERROR_BAD_VALUE)); vpc->param_maxrange[param] = range; return(VP_OK); } /* * vpSetCallback * * Set one of the callback functions. */ vpResult vpSetCallback(vpc, option, func) vpContext *vpc; int option; void (*func)(); { switch (option) { case VP_LOG_ALLOC_FUNC: vpc->log_alloc_func = (void (*)(void*, int, char*, int, char*, void*))func; break; case VP_LOG_FREE_FUNC: vpc->log_free_func = (void(*)(void*, void*))func; break; case VP_STATUS_FUNC: vpc->status_func = (void(*)(double, void*))func; break; case VP_READ_FUNC: if (func == NULL) vpc->read_func = read; else #ifdef WIN32 vpc->read_func = (int (*)(int, void*, size_t))func; #else vpc->read_func = (ssize_t (*)(int, void*, size_t))func; #endif break; case VP_WRITE_FUNC: if (func == NULL) vpc->write_func = write; else #ifdef WIN32 vpc->write_func = (int(*)(int, const void*, size_t))func; #else vpc->write_func = (ssize_t (*)(int, const void*, size_t))func; #endif break; case VP_MMAP_FUNC: vpc->mmap_func = (void*(*)(int, unsigned int, void*))func; break; case VP_GRAY_SHADE_FUNC: if (func == NULL) { vpc->shading_mode = LOOKUP_SHADER; } else { vpc->color_channels = 1; vpc->shading_mode = CALLBACK_SHADER; vpc->shade_func = (void(*)(void*,...))func; } break; case VP_RGB_SHADE_FUNC: if (func == NULL) { vpc->shading_mode = LOOKUP_SHADER; } else { vpc->color_channels = 3; vpc->shading_mode = CALLBACK_SHADER; vpc->shade_func = (void(*)(void*,...))func; } break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpSetClientData * * Set the client_data hook. */ vpResult vpSetClientData(vpc, client_data) vpContext *vpc; void *client_data; { vpc->client_data = client_data; return(VP_OK); } /* * vpSetDebug * * Set the value of a debugging flag. */ vpResult vpSetDebug(vpc, flag, value) vpContext *vpc; int flag; int value; { if (flag < 0 || flag >= VPDEBUG_COUNT) return(VPSetError(vpc, VPERROR_BAD_OPTION)); #ifdef DEBUG vpc->debug_enable[flag] = value; #endif return(VP_OK); } /* * vpTracePixel * * Trace one pixel of the intermediate image. */ vpResult vpTracePixel(vpc, trace_u, trace_v) vpContext *vpc; int trace_u, trace_v; /* pixel coordinates */ { #ifdef DEBUG vpc->trace_u = trace_u; vpc->trace_v = trace_v; #endif return(VP_OK); } /* * vpGeti * * Retrieve an integer-valued piece of state. */ vpResult vpGeti(vpc, option, iptr) vpContext *vpc; int option; int *iptr; { int c; int retcode; switch (option) { case VP_XLEN: *iptr = vpc->xlen; break; case VP_YLEN: *iptr = vpc->ylen; break; case VP_ZLEN: *iptr = vpc->zlen; break; case VP_BYTES_PER_VOXEL: *iptr = vpc->raw_bytes_per_voxel; break; case VP_VOXEL_FIELD_COUNT: *iptr = vpc->num_voxel_fields; break; case VP_SHADE_FIELD_COUNT: *iptr = vpc->num_shade_fields; break; case VP_FIELD_SIZES: for (c = 0; c < vpc->num_voxel_fields; c++) iptr[c] = vpc->field_size[c]; break; case VP_FIELD_OFFSETS: for (c = 0; c < vpc->num_voxel_fields; c++) iptr[c] = vpc->field_offset[c]; break; case VP_FIELD_MAXES: for (c = 0; c < vpc->num_voxel_fields; c++) iptr[c] = vpc->field_max[c]; break; case VP_VOXEL_DATA_SIZE: *iptr = vpc->raw_voxels_size; break; case VP_VOXEL_XSTRIDE: *iptr = vpc->xstride; break; case VP_VOXEL_YSTRIDE: *iptr = vpc->ystride; break; case VP_VOXEL_ZSTRIDE: *iptr = vpc->zstride; break; case VP_CLASSIFY_FIELD_COUNT: *iptr = vpc->num_clsfy_params; break; case VP_CLASSIFY_FIELDS: for (c = 0; c < vpc->num_clsfy_params; c++) iptr[c] = vpc->param_field[c]; break; case VP_CLASSIFY_TABLE_SIZES: for (c = 0; c < vpc->num_clsfy_params; c++) iptr[c] = vpc->clsfy_table_size[c]; break; case VP_COLOR_CHANNELS: *iptr = vpc->color_channels; break; case VP_SHADE_COLOR_SIZE: *iptr = vpc->shade_color_table_size; break; case VP_SHADE_WEIGHT_SIZE: *iptr = vpc->shade_weight_table_size; break; case VP_MATERIAL_COUNT: *iptr = vpc->num_materials; break; case VP_SHADE_COLOR_FIELD: *iptr = vpc->color_field; break; case VP_SHADE_WEIGHT_FIELD: *iptr = vpc->weight_field; break; case VP_LIGHT0: case VP_LIGHT1: case VP_LIGHT2: case VP_LIGHT3: case VP_LIGHT4: case VP_LIGHT5: *iptr = vpc->light_enable[option - VP_LIGHT0]; break; case VP_LIGHT_BOTH_SIDES: *iptr = vpc->light_both_sides; break; case VP_REVERSE_SURFACE_SIDES: *iptr = vpc->reverse_surface_sides; break; case VP_DEPTH_CUE: *iptr = vpc->dc_enable; break; case VP_DEPTH_CUE_TABLE_SIZE: *iptr = vpc->dc_table_len; break; case VP_DEPTH_CUE_SIZE_HINT: *iptr = vpc->dc_table_len_hint; break; case VP_CURRENT_MATRIX: *iptr = vpc->current_matrix; break; case VP_CONCAT_MODE: if (vpc->concat_left) *iptr = VP_CONCAT_LEFT; else *iptr = VP_CONCAT_RIGHT; break; case VP_IMAGE_WIDTH: *iptr = vpc->image_width; break; case VP_IMAGE_HEIGHT: *iptr = vpc->image_height; break; case VP_IMAGE_SCAN_SIZE: *iptr = vpc->image_bytes_per_scan; break; case VP_VIEW_AXIS: if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); *iptr = vpc->best_view_axis; break; case VP_INTERMEDIATE_WIDTH: if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); *iptr = vpc->intermediate_width; break; case VP_INTERMEDIATE_HEIGHT: if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); *iptr = vpc->intermediate_height; break; case VP_INTERMEDIATE_COLOR: if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); *iptr = vpc->intermediate_color_channels; break; case VP_INT_WIDTH_HINT: *iptr = vpc->int_image_width_hint; break; case VP_INT_HEIGHT_HINT: *iptr = vpc->int_image_height_hint; break; case VP_VIEW_X_AXIS: *iptr = !vpc->skip_rle_x; break; case VP_VIEW_Y_AXIS: *iptr = !vpc->skip_rle_y; break; case VP_VIEW_Z_AXIS: *iptr = !vpc->skip_rle_z; break; case VP_VIEW_X_SIZE: if (vpc->rle_x == NULL) { *iptr = 0; } else { *iptr = sizeof(RLEVoxels) + vpc->rle_x->run_count + vpc->rle_x->data_count*vpc->rle_bytes_per_voxel + vpc->rle_x->klen*vpc->rle_x->scan_offsets_per_slice* sizeof(ScanOffset); } break; case VP_VIEW_Y_SIZE: if (vpc->rle_y == NULL) { *iptr = 0; } else { *iptr = sizeof(RLEVoxels) + vpc->rle_y->run_count + vpc->rle_y->data_count*vpc->rle_bytes_per_voxel + vpc->rle_y->klen*vpc->rle_y->scan_offsets_per_slice* sizeof(ScanOffset); } break; case VP_VIEW_Z_SIZE: if (vpc->rle_z == NULL) { *iptr = 0; } else { *iptr = sizeof(RLEVoxels) + vpc->rle_z->run_count + vpc->rle_z->data_count*vpc->rle_bytes_per_voxel + vpc->rle_z->klen*vpc->rle_z->scan_offsets_per_slice* sizeof(ScanOffset); } break; case VP_MMOCTREE_THRESHOLDS: for (c = 0; c < vpc->num_clsfy_params; c++) iptr[c] = vpc->param_maxrange[c]; break; case VP_MMOCTREE_SIZE: if (vpc->mm_octree == NULL) *iptr = 0; else *iptr = sizeof(MinMaxOctree) + vpc->mm_octree->octree_bytes; break; case VP_SHADOW: *iptr = vpc->enable_shadows; break; case VP_SHADOW_LIGHT: *iptr = vpc->shadow_light_num; break; case VP_SHADOW_WIDTH_HINT: *iptr = vpc->shadow_width_hint; break; case VP_SHADOW_HEIGHT_HINT: *iptr = vpc->shadow_height_hint; break; case VP_SHADOW_WIDTH: if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); *iptr = vpc->shadow_width; break; case VP_SHADOW_HEIGHT: if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); *iptr = vpc->shadow_height; break; case VP_SHADOW_COLOR_SIZE: *iptr = vpc->shadow_color_table_size; break; case VP_SHADOW_BIAS: *iptr = vpc->shadow_bias; break; case VP_PIXEL_TYPE: *iptr = vpc->pixel_type; break; case VP_CLAMP_SHADE_TABLE: *iptr = vpc->clamp_shade_table; break; case VP_COMPOSITE_ORDER: if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); if (vpc->reverse_slice_order) *iptr = -1; else *iptr = 1; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpGetd * * Retrieve a double-precision-valued piece of state. */ vpResult vpGetd(vpc, option, dptr) vpContext *vpc; int option; double *dptr; { switch (option) { case VP_MIN_VOXEL_OPACITY: *dptr = vpc->min_opacity; break; case VP_DEPTH_CUE_FRONT: *dptr = vpc->dc_front_factor; break; case VP_DEPTH_CUE_DENSITY: *dptr = vpc->dc_density; break; case VP_DEPTH_CUE_QUANTIZATION: *dptr = vpc->dc_quantization; break; case VP_MAX_RAY_OPACITY: *dptr = vpc->max_opacity; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpGetp * * Retrieve a pointer-valued piece of state. */ vpResult vpGetp(vpc, option, pptr) vpContext *vpc; int option; void **pptr; { int c; switch (option) { case VP_VOXEL_DATA: *pptr = vpc->raw_voxels; break; case VP_CLASSIFY_TABLES: for (c = 0; c < vpc->num_clsfy_params; c++) pptr[c] = vpc->clsfy_table[c]; break; case VP_SHADE_COLOR_TABLE: *pptr = vpc->shade_color_table; break; case VP_SHADE_WEIGHT_TABLE: *pptr = vpc->shade_weight_table; break; case VP_SHADOW_COLOR_TABLE: *pptr = vpc->shadow_color_table; break; case VP_IMAGE: *pptr = vpc->image; break; case VP_CLIENT_DATA: *pptr = vpc->client_data; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } vpResult vpGetCallbackp( vpContext *vpc, int option, void (**pptr)() ) { switch (option) { case VP_SHADE_FUNC: *pptr = (void(*)()) vpc->shade_func; break; case VP_LOG_ALLOC_FUNC: *pptr = (void(*)()) vpc->log_alloc_func; break; case VP_LOG_FREE_FUNC: *pptr = (void(*)()) vpc->log_free_func; break; case VP_STATUS_FUNC: *pptr = (void(*)()) vpc->status_func; break; case VP_READ_FUNC: *pptr = (void(*)()) vpc->read_func; break; case VP_WRITE_FUNC: *pptr = (void(*)()) vpc->write_func; break; case VP_MMAP_FUNC: *pptr = (void(*)()) vpc->mmap_func; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpGetMaterial * * Get material parameters. */ vpResult vpGetMaterial(vpc, material, property, surface_side, r, g, b) vpContext *vpc; int material; int property; int surface_side; double *r, *g, *b; { material -= VP_MATERIAL0; if (material < 0 || material >= vpc->num_materials) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (surface_side != VP_EXTERIOR && surface_side != VP_INTERIOR) return(VPSetError(vpc, VPERROR_BAD_OPTION)); switch (property) { case VP_AMBIENT: if (surface_side == VP_EXTERIOR) { *r = vpc->matl_props[material][EXT_SURFACE][MATL_AMB_R] / 255.; *g = vpc->matl_props[material][EXT_SURFACE][MATL_AMB_G] / 255.; *b = vpc->matl_props[material][EXT_SURFACE][MATL_AMB_B] / 255.; } else { *r = vpc->matl_props[material][INT_SURFACE][MATL_AMB_R] / 255.; *g = vpc->matl_props[material][INT_SURFACE][MATL_AMB_G] / 255.; *b = vpc->matl_props[material][INT_SURFACE][MATL_AMB_B] / 255.; } break; case VP_DIFFUSE: if (surface_side == VP_EXTERIOR) { *r = vpc->matl_props[material][EXT_SURFACE][MATL_DIFF_R] / 255.; *g = vpc->matl_props[material][EXT_SURFACE][MATL_DIFF_G] / 255.; *b = vpc->matl_props[material][EXT_SURFACE][MATL_DIFF_B] / 255.; } else { *r = vpc->matl_props[material][INT_SURFACE][MATL_DIFF_R] / 255.; *g = vpc->matl_props[material][INT_SURFACE][MATL_DIFF_G] / 255.; *b = vpc->matl_props[material][INT_SURFACE][MATL_DIFF_B] / 255.; } break; case VP_SPECULAR: if (surface_side == VP_EXTERIOR) { *r = vpc->matl_props[material][EXT_SURFACE][MATL_SPEC_R] / 255.; *g = vpc->matl_props[material][EXT_SURFACE][MATL_SPEC_G] / 255.; *b = vpc->matl_props[material][EXT_SURFACE][MATL_SPEC_B] / 255.; } else { *r = vpc->matl_props[material][INT_SURFACE][MATL_SPEC_R] / 255.; *g = vpc->matl_props[material][INT_SURFACE][MATL_SPEC_G] / 255.; *b = vpc->matl_props[material][INT_SURFACE][MATL_SPEC_B] / 255.; } break; case VP_SHINYNESS: if (surface_side & VP_EXTERIOR) *r = vpc->matl_props[material][EXT_SURFACE][MATL_SHINY]; else *r = vpc->matl_props[material][INT_SURFACE][MATL_SHINY]; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpGetLight * * Get the properties of a directional light source. */ vpResult vpGetLight(vpc, light_num, property, n0, n1, n2) vpContext *vpc; int light_num; int property; double *n0, *n1, *n2; { light_num -= VP_LIGHT0; if (light_num < 0 || light_num >= VP_MAX_LIGHTS) return(VPSetError(vpc, VPERROR_LIMIT_EXCEEDED)); switch (property) { case VP_DIRECTION: *n0 = vpc->light_vector[light_num][0]; *n1 = vpc->light_vector[light_num][1]; *n2 = vpc->light_vector[light_num][2]; break; case VP_COLOR: *n0 = vpc->light_color[light_num][0]; *n1 = vpc->light_color[light_num][1]; *n2 = vpc->light_color[light_num][2]; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpGetImage * * Get one of the intermediate rendering buffers. */ vpResult vpGetImage(vpc, image, width, height, scan_bytes, pixel_type, image_type) vpContext *vpc; /* context */ void *image; /* buffer for storing result */ int width; /* expected width of image in buffer */ int height; /* expected height of image in buffer */ int scan_bytes; /* bytes per scanline in buffer */ int pixel_type; /* type of pixel to store in buffer */ int image_type; /* rendering buffer to extract from (VP_IMAGE_BUFFER or VP_SHADOW_BUFFER) */ { int x, y; unsigned char *dst_ptr; GrayIntPixel *gray_pixel; RGBIntPixel *rgb_pixel; int value; int color_channels; switch (image_type) { case VP_IMAGE_BUFFER: if (width != vpc->intermediate_width || height != vpc->intermediate_height) return(VPSetError(vpc, VPERROR_BAD_SIZE)); color_channels = vpc->intermediate_color_channels; dst_ptr = (unsigned char*) image; switch (pixel_type) { case VP_ALPHA: if (scan_bytes < width) return(VPSetError(vpc, VPERROR_BAD_SIZE)); if (color_channels == 1) { for (y = 0; y < height; y++) { gray_pixel = vpc->int_image.gray_intim + (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width*y : vpc->intermediate_width*y); dst_ptr = (unsigned char *)image + y * scan_bytes; for (x = 0; x < width; x++) { value = (int)rint(gray_pixel->opcflt * 255.); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; gray_pixel++; } } } else { for (y = 0; y < height; y++) { rgb_pixel = vpc->int_image.rgb_intim + (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width*y : vpc->intermediate_width*y); dst_ptr = (unsigned char *)image + y * scan_bytes; for (x = 0; x < width; x++) { value = (int)rint(rgb_pixel->opcflt * 255.); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; rgb_pixel++; } } } break; case VP_LUMINANCE: if (color_channels != 1) return(VPSetError(vpc, VPERROR_BAD_OPTION)); if (scan_bytes < width) return(VPSetError(vpc, VPERROR_BAD_SIZE)); for (y = 0; y < height; y++) { gray_pixel = vpc->int_image.gray_intim + (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width*y : vpc->intermediate_width*y); dst_ptr = (unsigned char *)image + y * scan_bytes; for (x = 0; x < width; x++) { value = (int)rint(gray_pixel->clrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; gray_pixel++; } } break; case VP_LUMINANCEA: if (color_channels != 1) return(VPSetError(vpc, VPERROR_BAD_OPTION)); if (scan_bytes < 2*width) return(VPSetError(vpc, VPERROR_BAD_SIZE)); for (y = 0; y < height; y++) { gray_pixel = vpc->int_image.gray_intim + (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width*y : vpc->intermediate_width*y); dst_ptr = (unsigned char *)image + y * scan_bytes; for (x = 0; x < width; x++) { value = (int)rint(gray_pixel->clrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(gray_pixel->opcflt * 255.); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; gray_pixel++; } } break; case VP_RGB: if (color_channels != 3) return(VPSetError(vpc, VPERROR_BAD_OPTION)); if (scan_bytes < 3*width) return(VPSetError(vpc, VPERROR_BAD_SIZE)); for (y = 0; y < height; y++) { rgb_pixel = vpc->int_image.rgb_intim + (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width*y : vpc->intermediate_width*y); dst_ptr = (unsigned char *)image + y * scan_bytes; for (x = 0; x < width; x++) { value = (int)rint(rgb_pixel->rclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(rgb_pixel->gclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(rgb_pixel->bclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; rgb_pixel++; } } break; case VP_RGBA: if (color_channels != 3) return(VPSetError(vpc, VPERROR_BAD_OPTION)); if (scan_bytes < 4*width) return(VPSetError(vpc, VPERROR_BAD_SIZE)); for (y = 0; y < height; y++) { rgb_pixel = vpc->int_image.rgb_intim + (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width*y : vpc->intermediate_width*y); dst_ptr = (unsigned char *)image + y * scan_bytes; for (x = 0; x < width; x++) { value = (int)rint(rgb_pixel->rclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(rgb_pixel->gclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(rgb_pixel->bclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(rgb_pixel->opcflt*255.); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; rgb_pixel++; } } break; case VP_BGR: if (color_channels != 3) return(VPSetError(vpc, VPERROR_BAD_OPTION)); if (scan_bytes < 3*width) return(VPSetError(vpc, VPERROR_BAD_SIZE)); for (y = 0; y < height; y++) { rgb_pixel = vpc->int_image.rgb_intim + (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width*y : vpc->intermediate_width*y); dst_ptr = (unsigned char *)image + y * scan_bytes; for (x = 0; x < width; x++) { value = (int)rint(rgb_pixel->bclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(rgb_pixel->gclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(rgb_pixel->rclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; rgb_pixel++; } } break; case VP_ABGR: if (color_channels != 3) return(VPSetError(vpc, VPERROR_BAD_OPTION)); if (scan_bytes < 4*width) return(VPSetError(vpc, VPERROR_BAD_SIZE)); for (y = 0; y < height; y++) { rgb_pixel = vpc->int_image.rgb_intim + (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width*y : vpc->intermediate_width*y); dst_ptr = (unsigned char *)image + y * scan_bytes; for (x = 0; x < width; x++) { value = (int)rint(rgb_pixel->opcflt*255.); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(rgb_pixel->bclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(rgb_pixel->gclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; value = (int)rint(rgb_pixel->rclrflt); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; rgb_pixel++; } } break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } break; case VP_SHADOW_BUFFER: if (pixel_type != VP_ALPHA) return(VPSetError(vpc, VPERROR_BAD_OPTION)); if (width != vpc->shadow_width || height != vpc->shadow_height) return(VPSetError(vpc, VPERROR_BAD_SIZE)); if (scan_bytes < width) return(VPSetError(vpc, VPERROR_BAD_SIZE)); for (y = 0; y < height; y++) { gray_pixel = vpc->shadow_buffer + (vpc->pad_shadow_to_maxwidth ? vpc->max_shadow_width*y : vpc->shadow_width*y); dst_ptr = (unsigned char *)image + y * scan_bytes; for (x = 0; x < width; x++) { value = (int)rint(gray_pixel->opcflt * 255.); if (value > 255) *dst_ptr = 255; else *dst_ptr = value; dst_ptr++; gray_pixel++; } } break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * vpGetTimer * * Get the value of one of the timers. */ vpResult vpGetTimer(vpc, option, iptr) vpContext *vpc; int option; int *iptr; { if (option < 0 || option >= VPTIMER_COUNT) return(VPSetError(vpc, VPERROR_BAD_OPTION)); #ifdef USE_TIMER *iptr = (int)(vpc->timer_ticks[option] * vpc->timer_usec_per_tick); #else *iptr = 0; #endif return(VP_OK); } /* * vpClearTimer * * Reset the value of one of the timers to zero. */ vpResult vpClearTimer(vpc, option) vpContext *vpc; int option; { if (option < 0 || option >= VPTIMER_COUNT) return(VPSetError(vpc, VPERROR_BAD_OPTION)); #ifdef USE_TIMER vpc->timer_ticks[option] = 0; #endif return(VP_OK); } #ifdef HAVE_HIRES_TIMER /* * StartHiResTimer * * Initialize the high-resolution memory mapped timer (available on * some models of SGI hardware). On machines with a 64-bit timer * (e.g. Challenge or ONYX), HAVE_64BIT_TIMER must be defined for * proper operation. */ static void StartHiResTimer(vpc) vpContext *vpc; { volatile unsigned timer_resolution; /* resolution of timer in psec. */ unsigned phys_addr; /* hardware address of timer */ unsigned page_addr; /* address of page containing timer */ int fd; /* file descriptor for file to be mapped */ volatile unsigned *timer_addr; /* memory-mapped address of timer */ /* set values to harmless defaults in case hardware doesn't really support a high-resolution timer */ vpc->timer_usec_per_tick = 0.; vpc->timer_addr = &vpc->dummy_timer; vpc->dummy_timer = 0; phys_addr = syssgi(SGI_QUERY_CYCLECNTR, &timer_resolution); if ((int)phys_addr == -1) return; if ((fd = open("/dev/mmem", O_RDONLY)) < 0) return; page_addr = phys_addr & ~POFFMASK; timer_addr = (volatile unsigned *)mmap(0, POFFMASK, PROT_READ, MAP_PRIVATE, fd, (int)page_addr); close(fd); if ((int)timer_addr == -1) return; vpc->timer_addr = (unsigned *)((unsigned)timer_addr + poff(phys_addr)); #ifdef HAVE_64BIT_TIMER vpc->timer_addr++; printf("Timer configured for 64 bits.\n"); #endif vpc->timer_usec_per_tick = timer_resolution * 1.0e-6; printf("Timer resolution is %d psec.\n", timer_resolution); } #endif /* HAVE_HIRES_TIMER */ ccseapps-2.5/CCSEApps/volpack/vp_shade.c0000644000175000017500000006362411634153073021266 0ustar amckinstryamckinstry/* * vp_shade.c * * Routines to implement the Phong shading equation using a lookup-table. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:04 $ * $Revision: 1.4 $ */ #include "vp_global.h" /* * Lookup Table Shading and Normal Vector Encoding * * The shader defined in this file implements the Phong shading equation * (I = Ia + Id*(N.L) + Is*(N.H)^n) using lookup tables. To use this * shader you must include a "normal" field in each voxel. This field * is computed by preprocessing the volume to estimate a surface normal * vector for each voxel (using the central-difference gradient operator) * and then encoding the normal in an index (13 bits in this program). * An index is stored in the normal field of each voxel. At rendering * time the index is used to look up a color for the voxel in a table. * * There are many ways a normal vector can be encoded using the 13 bits of * the index. A straight-forward method is to use 6 bits for the x component * of the vector, 6 bits for the y component, and 1 bit to indicate the sign * of the z component. Assuming that the vector is normalized the z * component can be reconstructed from x and y. Unfortunately this method * results in an uneven distribution of code points: the distance between * exactly-representable vectors is much smaller near N = +z or -z than * N = +x, -x, +y or -z (where x, y and z are the unit vectors). This * can result in significant quantization error near the "equator", or more * table storage than necessary near the "poles". * * The normal vector encoding scheme used here is derived from a recursive * tesselation of a regular octahedron (an eight-sided solid with * equilateral triangular faces). Consider subdividing each triangular * face into four smaller equilateral triangles, and then subdividing those * triangles recursively until a sufficiently large number of triangles * have been generated. The representable normal vectors are the vectors * connecting the center of the solid to the vertices of the triangles. * The distribution of these vectors is not perfectly uniform (the density * is lower at the "mid-latitudes"), but the variation is relatively small. * * Each normal vector is now assigned a unique index as follows. Let the * origin be at the center of the solid, and the x, y and z axes each * intersect a vertex of the original octahedron. Use one bit of the index * to indicate the sign of the z component of the normal. Now project the * subdivided triangle vertices onto the x-y plane. This forms a square * grid of dots rotated 45 degrees relative to the x-y axes. Starting at * (x=0, y=max), assign sequential integers to each normal vector projection, * proceeding left-to-right and top-to-bottom. Finally, append the sign bit * for the z component to the least-significant end of the integer to get * the normal vector encoding. * * This scheme is useful because it is easy to compute the vector components * from an index and conversely to find the closest index for a given vector, * yet the distribution of representable vectors is pretty uniform. * * XXX better method is to rotate 45 degrees (M = [1 -1 ; 1 1]) and then * assign points in scanline order; no lookup tables needed; implement this! * * The layout of the shading lookup table is as follows: * float shade_table[MAX_NORMAL+1][materials][color_channels] * where materials is the number of materials and color_channels is 1 * for grayscale intensities or 3 for RGB intensities (stored in R,G,B * order). */ /* define normal index parameters; if you change these then you must change VP_NORM_MAX in volpack.h */ #define NORM_13 /* use 13 bit normals */ #undef NORM_15 /* don't use 15 bit normals */ #ifdef NORM_13 /* parameters for 13 bit normals */ #define NORM_N 44 /* N parameter for normal computation */ #define NORM_BITS 13 /* number of bits to encode a normal: (1+ceil(log2(2*(N*N+N+1)))) */ #define MAX_NORMAL 7923 /* maximum normal index */ #endif #ifdef NORM_15 /* parameters for 15 bit normals */ #define NORM_N 90 #define NORM_BITS 15 #define MAX_NORMAL 16131 #endif /* static lookup tables (computed only once, used for all vpContexts) */ static int NormalTablesInitialized = 0; /* set to 1 after initialization */ static short *NormalPy; /* NormalPy[py] = normal index for the normal whose projection in the x-y plane is (0,py) and whose z component is + (py = -NORM_N to +NORM_N) */ static short NormalPyStorage[1+2*NORM_N]; /* storage for NormalPy */ static short *NormalXLimit; /* max abs(x) allowed for a given y */ static short NormalXLimitStorage[1+2*NORM_N]; /* storage for NormalXLimit */ static void InitNormalTables ANSI_ARGS((void)); /* * InitNormalTables * * Initialize lookup tables for computing normal indices. */ static void InitNormalTables() { int y, xcount, codepoint; /* initialize NormalPy */ xcount = 1; codepoint = 2; NormalPy = &NormalPyStorage[NORM_N]; NormalXLimit = &NormalXLimitStorage[NORM_N]; for (y = -NORM_N; y <= NORM_N; y++) { NormalPy[y] = codepoint + (((xcount-1)/2) << 1); codepoint += (xcount << 1); NormalXLimit[y] = (xcount-1)/2; if (y < 0) xcount += 2; else xcount -= 2; } NormalTablesInitialized = 1; } /* * vpNormalIndex * * Return the best normal index for the given normal vector. */ int vpNormalIndex(nx, ny, nz) double nx, ny, nz; { int n, x, y, xlimit; double denom, denominv; if (!NormalTablesInitialized) InitNormalTables(); denom = (nx < 0) ? -nx : nx; denom += (ny < 0) ? -ny : ny; denom += (nz < 0) ? -nz : nz; denominv = (double)NORM_N / denom; x = (int)rint(nx * denominv); y = (int)rint(ny * denominv); /* clamp x */ xlimit = NormalXLimit[y]; if (x < 0) { if (-x > xlimit) x = -xlimit; } else { if (x > xlimit) x = xlimit; } n = NormalPy[y] + (x << 1); if (nz < 0) n |= 1; ASSERT(n >= 0 && n <= VP_NORM_MAX); return(n); } /* * vpNormal * * Compute normal vector components given a normal vector index. */ vpResult vpNormal(n, nx, ny, nz) int n; /* normal index */ double *nx, *ny, *nz; /* storage for result */ { int py, px, pz, pxlimit2; double pxd, pyd, pzd, plength; if (!NormalTablesInitialized) InitNormalTables(); for (py = -NORM_N; py <= NORM_N; py++) { pxlimit2 = 2 * ((py<0) ? (NORM_N + py) : (NORM_N - py)); if (NormalPy[py] - pxlimit2 <= n && NormalPy[py] + pxlimit2 + 1 >= n) { break; } } if (py > NORM_N) { return(VPERROR_BAD_VALUE); } else { px = (n - NormalPy[py]) >> 1; pz = NORM_N; if (px < 0) pz += px; else pz -= px; if (py < 0) pz += py; else pz -= py; if (n & 1) pz = -pz; pxd = (double)px; pyd = (double)py; pzd = (double)pz; plength = 1. / sqrt(pxd*pxd+pyd*pyd+pzd*pzd); *nx = pxd * plength; *ny = pyd * plength; *nz = pzd * plength; } return(VP_OK); } /* * vpScanlineNormals * * Compute normals and/or gradients for a scanline of voxels. */ vpResult vpScanlineNormals(vpc, length, scalar_data, scalar_minus_y, scalar_plus_y, scalar_minus_z, scalar_plus_z, voxel_data, scalar_field, grad_field, norm_field) vpContext *vpc; /* context */ int length; /* number of scalars in scanline */ unsigned char *scalar_data; /* scanline of scalar data */ unsigned char *scalar_minus_y; /* adjacent scanline of scalar data (-y) */ unsigned char *scalar_plus_y; /* adjacent scanline of scalar data (+y) */ unsigned char *scalar_minus_z; /* adjacent scanline of scalar data (-z) */ unsigned char *scalar_plus_z; /* adjacent scanline of scalar data (+z) */ void *voxel_data; /* location to store first voxel */ int scalar_field; /* voxel field for scalar, or VP_SKIP_FIELD */ int grad_field; /* voxel field for gradient, or VP_SKIP_FIELD */ int norm_field; /* voxel field for normal, or VP_SKIP_FIELD */ { int x; /* voxel index */ double grad_x; /* components of the gradient vector */ double grad_y; double grad_z; double twice_grad_mag; /* twice the magnitude of the gradient */ int grad; /* gradient magnitude */ int norm; /* normal index */ int edge; /* true if this scanline is on the edge of the volume */ int voxel_size; /* size of a voxel in bytes */ int scalar_offset; /* byte offset for scalar in voxel */ int grad_offset; /* byte offset for gradient in voxel */ int norm_offset; /* byte offset for normal in voxel */ char *voxel; /* pointer to current voxel */ int retcode; /* check for errors */ if ((retcode = VPCheckVoxelFields(vpc)) != VP_OK) return(retcode); if (scalar_field != VP_SKIP_FIELD) { if (scalar_field < 0 || scalar_field >= vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (vpc->field_size[scalar_field] != VP_SCALAR_SIZE) return(VPSetError(vpc, VPERROR_BAD_VALUE)); scalar_offset = vpc->field_offset[scalar_field]; } if (grad_field != VP_SKIP_FIELD) { if (grad_field < 0 || grad_field >= vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (vpc->field_size[grad_field] != VP_GRAD_SIZE) return(VPSetError(vpc, VPERROR_BAD_VALUE)); grad_offset = vpc->field_offset[grad_field]; } if (norm_field != VP_SKIP_FIELD) { if (norm_field < 0 || norm_field >= vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (vpc->field_size[norm_field] != VP_NORM_SIZE) return(VPSetError(vpc, VPERROR_BAD_VALUE)); norm_offset = vpc->field_offset[norm_field]; } voxel_size = vpc->raw_bytes_per_voxel; /* compute the scanline */ voxel = (char*)voxel_data; if (scalar_minus_y == NULL || scalar_plus_y == NULL || scalar_minus_z == NULL || scalar_plus_z == NULL) { edge = 1; } else { edge = 0; } for (x = 0; x < length; x++) { /* compute gradient and normal for voxel x and store */ if (edge || x == 0 || x == length-1) { if (scalar_field != VP_SKIP_FIELD) ByteField(voxel, scalar_offset) = scalar_data[x]; if (grad_field != VP_SKIP_FIELD) ByteField(voxel, grad_offset) = 0; if (norm_field != VP_SKIP_FIELD) ShortFieldSet(voxel, norm_offset, 0); } else { grad_x = (int)scalar_data[x+1] - (int)scalar_data[x-1]; grad_y = (int)scalar_plus_y[x] - (int)scalar_minus_y[x]; grad_z = (int)scalar_plus_z[x] - (int)scalar_minus_z[x]; twice_grad_mag = sqrt(grad_x*grad_x+grad_y*grad_y+grad_z*grad_z); if (scalar_field != VP_SKIP_FIELD) ByteField(voxel, scalar_offset) = scalar_data[x]; if (grad_field != VP_SKIP_FIELD) { grad = (int)rint(0.5 * twice_grad_mag); ASSERT(grad >= 0 && grad <= VP_GRAD_MAX); ByteField(voxel, grad_offset) = grad; } if (norm_field != VP_SKIP_FIELD) { if (twice_grad_mag < VP_EPS) norm = 0; else norm = vpNormalIndex(grad_x / twice_grad_mag, grad_y / twice_grad_mag, grad_z / twice_grad_mag); ShortFieldSet(voxel, norm_offset, norm); } } /* go on to next voxel */ voxel += voxel_size; } return(VP_OK); } /* * vpVolumeNormals * * Compute normals and/or gradients for a volume. Result is stored * in raw_voxels in the current context. */ vpResult vpVolumeNormals(vpc, scalar_data, length, scalar_field, grad_field, norm_field) vpContext *vpc; /* context */ unsigned char *scalar_data; /* 3D array of scalar data */ int length; /* number of scalars in scalar_data */ int scalar_field; /* voxel field for scalar, or VP_SKIP_FIELD */ int grad_field; /* voxel field for gradient, or VP_SKIP_FIELD */ int norm_field; /* voxel field for normal, or VP_SKIP_FIELD */ { int xlen, ylen, zlen; /* volume dimensions */ int y, z; /* loop indices */ unsigned char *scalar; /* pointer to current scalar */ int scalar_ystride; /* stride to next scalar scanline */ int scalar_zstride; /* stride to next scalar slice */ char *voxel; /* pointer to current voxel */ int voxel_ystride; /* stride to next voxel scanline */ int voxel_zstride; /* stride to next voxel slice */ unsigned char *s_py, *s_my, *s_pz, *s_mz; /* ptrs to adjacent scans */ int retcode; /* check for errors */ if ((retcode = VPCheckRawVolume(vpc)) != VP_OK) return(retcode); xlen = vpc->xlen; ylen = vpc->ylen; zlen = vpc->zlen; if (xlen * ylen * zlen != length) return(VPSetError(vpc, VPERROR_BAD_SIZE)); /* initialize */ scalar = scalar_data; scalar_ystride = xlen; scalar_zstride = xlen*ylen; voxel = (char*)vpc->raw_voxels; voxel_ystride = vpc->ystride; voxel_zstride = vpc->zstride; /* compute volume data */ for (z = 0; z < zlen; z++) { ReportStatus(vpc, (double)z / (double)zlen); for (y = 0; y < ylen; y++) { s_my = (y == 0) ? NULL : scalar - scalar_ystride; s_py = (y == ylen-1) ? NULL : scalar + scalar_ystride; s_mz = (z == 0) ? NULL : scalar - scalar_zstride; s_pz = (z == zlen-1) ? NULL : scalar + scalar_zstride; retcode = vpScanlineNormals(vpc, xlen, scalar, s_my, s_py, s_mz, s_pz, voxel, scalar_field, grad_field, norm_field); if (retcode != VP_OK) return(retcode); scalar += scalar_ystride; voxel += voxel_ystride; } scalar += scalar_zstride - ylen*scalar_ystride; voxel += voxel_zstride - ylen*voxel_ystride; } ReportStatus(vpc, 1.0); return(VP_OK); } /* * vpShadeTable * * Compute a shading lookup table for the current lighting and * model matrix. */ vpResult vpShadeTable(vpc) vpContext *vpc; { int num_lights; /* number of enabled lights */ vpVector3 light_color[VP_MAX_LIGHTS]; /* light colors */ vpVector4 obj_light[VP_MAX_LIGHTS]; /* light_vector in object space */ vpVector4 obj_highlight[VP_MAX_LIGHTS]; /* halfway-vector */ vpVector4 obj_viewpoint; /* viewpoint in object coordinates */ vpMatrix4 a; /* linear system matrix */ double *rhs[VP_MAX_LIGHTS+1];/* right-hand-side/solution vectors */ int px, py, pz; /* code point coordinates (integers) */ double pxd, pyd, pzd; /* code point coordinates (doubles) */ double plength; int pxlimit; /* maximum absolute value of px for this py */ double nx, ny, nz; /* normal vector components */ double n_dot_v_xy; /* normal_vector dot obj_viewpoint (x&y) */ double n_dot_v_z; /* normal_vector dot obj_viewpoint (z) */ double n_dot_v; /* normal_vector dot obj_viewpoint */ double n_dot_l_xy; /* normal_vector dot light_vector (x&y) */ double n_dot_l_z; /* normal_vector dot light_vector (z) */ double n_dot_l; /* normal_vector dot light_vector */ double n_dot_h_xy; /* normal_vector dot halfway_vector (x&y) */ double n_dot_h_z; /* normal_vector dot halfway_vector (z) */ double n_dot_h; /* normal_vector dot halfway_vector */ float *table_row; /* pointer to table row for current normal */ float *table; /* pointer to table entry */ float *shadow_table_row; /* pointer to table row for current normal */ float *shadow_table; /* pointer to shadow table entry */ int surface_side; /* EXT_SURFACE or INT_SURFACE */ int znegative; /* true iff nz is negative */ int light_both_sides; /* use two-sided lighting */ int reverse_surface_sides; /* reverse interior and exterior */ int color_channels; /* number of color channels */ int num_materials; /* number of materials */ int retcode; double *matl_props; /* material properties */ int enable_shadows; /* true if shadows are enabled */ int shadow_light; /* light index for light casting shadows */ int clamp; /* true if table entries should be clamped */ int c, l, m; #ifdef DEBUG vpVector4 tmpv; #endif DECLARE_TIME(t0); DECLARE_TIME(t1); /* error checking */ if (vpc->shading_mode != LOOKUP_SHADER) return(VP_OK); if ((retcode = VPCheckShader(vpc)) != VP_OK) return(retcode); if ((retcode = VPCheckShadows(vpc)) != VP_OK) return(retcode); ASSERT(vpc->color_channels == 1 || vpc->color_channels == 3); /* start timer */ GET_TIME(vpc, t0); /* transform viewpoint vector and light vectors to object space */ vpSetVector4(obj_viewpoint, 0., 0., 1., 1.); rhs[0] = obj_viewpoint; num_lights = 0; for (c = 0; c < VP_MAX_LIGHTS; c++) { if (vpc->light_enable[c]) { bcopy(vpc->light_color[c], light_color[num_lights], sizeof(vpVector3)); bcopy(vpc->light_vector[c], obj_light[num_lights], sizeof(vpVector4)); rhs[num_lights+1] = obj_light[num_lights]; num_lights++; } } bcopy(vpc->transforms[VP_MODEL], a, sizeof(vpMatrix4)); retcode = vpSolveSystem4(a, rhs, num_lights+1); if (retcode != VP_OK) return(retcode); #ifdef DEBUG /* make sure the solver gave the right answer */ vpMatrixVectorMult4(tmpv, vpc->transforms[VP_MODEL], obj_viewpoint); if (fabs(tmpv[0]) > VP_EPS || fabs(tmpv[1]) > VP_EPS || fabs(tmpv[2] - 1.) > VP_EPS || fabs(tmpv[3] - 1.) > VP_EPS) { printf("\n"); printf("Modelview:\n"); printf(" %12.8f %12.8f %12.8f %12.8f\n", vpc->transforms[VP_MODEL][0][0], vpc->transforms[VP_MODEL][0][1], vpc->transforms[VP_MODEL][0][2], vpc->transforms[VP_MODEL][0][3]); printf(" %12.8f %12.8f %12.8f %12.8f\n", vpc->transforms[VP_MODEL][1][0], vpc->transforms[VP_MODEL][1][1], vpc->transforms[VP_MODEL][1][2], vpc->transforms[VP_MODEL][1][3]); printf(" %12.8f %12.8f %12.8f %12.8f\n", vpc->transforms[VP_MODEL][2][0], vpc->transforms[VP_MODEL][2][1], vpc->transforms[VP_MODEL][2][2], vpc->transforms[VP_MODEL][2][3]); printf(" %12.8f %12.8f %12.8f %12.8f\n", vpc->transforms[VP_MODEL][3][0], vpc->transforms[VP_MODEL][3][1], vpc->transforms[VP_MODEL][3][2], vpc->transforms[VP_MODEL][3][3]); VPBug("SolveSystem failed on viewpoint"); } l = 0; for (c = 0; c < VP_MAX_LIGHTS; c++) { if (vpc->light_enable[c]) { vpMatrixVectorMult4(tmpv, vpc->transforms[VP_MODEL], obj_light[l]); if (fabs(tmpv[0] - vpc->light_vector[c][0]) > VP_EPS || fabs(tmpv[1] - vpc->light_vector[c][1]) > VP_EPS || fabs(tmpv[2] - vpc->light_vector[c][2]) > VP_EPS || fabs(tmpv[3] - vpc->light_vector[c][3]) > VP_EPS) VPBug("SolveSystem failed on light %d\n", c); l++; } } #endif /* compute highlight vectors */ for (l = 0; l < num_lights; l++) { obj_highlight[l][0] = obj_light[l][0] + obj_viewpoint[0]; obj_highlight[l][1] = obj_light[l][1] + obj_viewpoint[1]; obj_highlight[l][2] = obj_light[l][2] + obj_viewpoint[2]; vpNormalize3(obj_highlight[l]); } /* initialize options */ light_both_sides = vpc->light_both_sides; reverse_surface_sides = vpc->reverse_surface_sides; color_channels = vpc->color_channels; num_materials = vpc->num_materials; table = vpc->shade_color_table; enable_shadows = vpc->enable_shadows; if (enable_shadows) { shadow_table = vpc->shadow_color_table; shadow_light = vpc->shadow_light_num - VP_LIGHT0; bzero(shadow_table, vpc->shadow_color_table_size); } else { shadow_table = NULL; shadow_light = -1; } clamp = vpc->clamp_shade_table; /* store shade table entries for the zero-vector */ for (znegative = 0; znegative <= 1; znegative++) { if (znegative) { if (reverse_surface_sides) surface_side = EXT_SURFACE; else surface_side = INT_SURFACE; } else { if (reverse_surface_sides) surface_side = INT_SURFACE; else surface_side = EXT_SURFACE; } for (m = 0; m < num_materials; m++) { matl_props = vpc->matl_props[m][surface_side]; *table++ = matl_props[MATL_AMB_R]; if (color_channels == 3) { *table++ = matl_props[MATL_AMB_G]; *table++ = matl_props[MATL_AMB_B]; } } } table_row = table; if (enable_shadows) { for (znegative = 0; znegative <= 1; znegative++) { for (m = 0; m < num_materials; m++) { *shadow_table++ = 0; if (color_channels == 3) { *shadow_table++ = 0; *shadow_table++ = 0; } } } } shadow_table_row = shadow_table; /* compute the shade table entries for nonzero normals */ for (py = -NORM_N; py <= NORM_N; py++) { pxlimit = (py < 0) ? (NORM_N + py) : (NORM_N - py); pz = -1; pxd = (double)(-pxlimit-1); pyd = (double)py; pzd = (double)(-1); for (px = -pxlimit; px <= pxlimit; px++) { /* compute normal vector components for this code point */ pxd += 1.0; if (px <= 0) { pz++; pzd += 1.0; } else { pz--; pzd -= 1.0; } plength = 1. / sqrt(pxd*pxd + pyd*pyd + pzd*pzd); nx = pxd * plength; ny = pyd * plength; nz = pzd * plength; /* compute n dot v (for determining surface side) */ n_dot_v_xy = nx*obj_viewpoint[0] + ny*obj_viewpoint[1]; n_dot_v_z = nz*obj_viewpoint[2]; /* store ambient light terms */ table = table_row; for (znegative = 0; znegative <= 1; znegative++) { if (znegative) n_dot_v = n_dot_v_xy - n_dot_v_z; else n_dot_v = n_dot_v_xy + n_dot_v_z; if (reverse_surface_sides) n_dot_v = -n_dot_v; if (n_dot_v >= 0) surface_side = EXT_SURFACE; else surface_side = INT_SURFACE; for (m = 0; m < num_materials; m++) { matl_props = vpc->matl_props[m][surface_side]; *table++ = matl_props[MATL_AMB_R]; if (color_channels == 3) { *table++ = matl_props[MATL_AMB_G]; *table++ = matl_props[MATL_AMB_B]; } } } /* loop over lights */ for (l = 0; l < num_lights; l++) { if (l == shadow_light) table = shadow_table_row; else table = table_row; /* compute n dot l and n dot h */ n_dot_l_xy = nx*obj_light[l][0] + ny*obj_light[l][1]; n_dot_l_z = nz*obj_light[l][2]; n_dot_h_xy = nx*obj_highlight[l][0] + ny*obj_highlight[l][1]; n_dot_h_z = nz*obj_highlight[l][2]; /* loop over the two signs for z */ for (znegative = 0; znegative <= 1; znegative++) { if (znegative) { n_dot_v = n_dot_v_xy - n_dot_v_z; n_dot_l = n_dot_l_xy - n_dot_l_z; n_dot_h = n_dot_h_xy - n_dot_h_z; } else { n_dot_v = n_dot_v_xy + n_dot_v_z; n_dot_l = n_dot_l_xy + n_dot_l_z; n_dot_h = n_dot_h_xy + n_dot_h_z; } if (reverse_surface_sides) { n_dot_v = -n_dot_v; n_dot_l = -n_dot_l; n_dot_h = -n_dot_h; } if (n_dot_v >= 0) surface_side = EXT_SURFACE; else surface_side = INT_SURFACE; if (light_both_sides) { n_dot_l = fabs(n_dot_l); n_dot_h = fabs(n_dot_h); } else if (surface_side == EXT_SURFACE) { n_dot_l = MAX(n_dot_l, 0.0); n_dot_h = MAX(n_dot_h, 0.0); } else { n_dot_l = MAX(-n_dot_l, 0.0); n_dot_h = MAX(-n_dot_h, 0.0); } /* loop over material types */ for (m = 0; m < num_materials; m++) { matl_props = vpc->matl_props[m][surface_side]; *table++ += light_color[l][0]*(matl_props[MATL_DIFF_R]* n_dot_l + matl_props[MATL_SPEC_R]* pow(n_dot_h, matl_props[MATL_SHINY])); if (color_channels == 3) { *table++ += light_color[l][1]* (matl_props[MATL_DIFF_G]* n_dot_l + matl_props[MATL_SPEC_G]* pow(n_dot_h, matl_props[MATL_SHINY])); *table++ += light_color[l][2]* (matl_props[MATL_DIFF_B]* n_dot_l + matl_props[MATL_SPEC_B]* pow(n_dot_h, matl_props[MATL_SHINY])); } } /* for m */ } /* for znegative */ } /* for l */ /* clamp */ if (clamp) { if (enable_shadows) { table = table_row; shadow_table = shadow_table_row; for (znegative = 0; znegative <= 1; znegative++) { for (m = 0; m < num_materials; m++) { for (c = 0; c < color_channels; c++) { if (*table > 255.) *table = 255.; if (*table + *shadow_table > 255.) *shadow_table = 255. - *table; shadow_table++; table++; } } } } else { table = table_row; for (znegative = 0; znegative <= 1; znegative++) { for (m = 0; m < num_materials; m++) { for (c = 0; c < color_channels; c++) { if (*table > 255.) *table = 255.; table++; } } } } } if (num_materials == 1) { table_row += 2*color_channels; } else { if (color_channels == 1) table_row += 2*num_materials; else table_row += 6*num_materials; } if (enable_shadows) { if (num_materials == 1) { shadow_table_row += 2*color_channels; } else { if (color_channels == 1) shadow_table_row += 2*num_materials; else shadow_table_row += 6*num_materials; } } } /* for px */ } /* for py */ /* stop timer */ GET_TIME(vpc, t1); STORE_TIME(vpc, VPTIMER_SHADE, t0, t1); return(VP_OK); } ccseapps-2.5/CCSEApps/volpack/vp_extract.c0000644000175000017500000005363411634153073021654 0ustar amckinstryamckinstry/* * vp_extract.c * * Routines to extract fields from a volume. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:03 $ * $Revision: 1.4 $ */ #include "vp_global.h" static int ExtractRawVolume ANSI_ARGS((vpContext *vpc, int x0, int y0, int z0, int x1, int y1, int z1, int field, void *dst, int dst_xstride, int dst_ystride, int dst_zstride)); static int ClassifyRawVolume ANSI_ARGS((vpContext *vpc, int correct, int x0, int y0, int z0, int x1, int y1, int z1, unsigned char *dst, int dst_xstride, int dst_ystride, int dst_zstride)); static int ShadeRawVolume ANSI_ARGS((vpContext *vpc, int x0, int y0, int z0, int x1, int y1, int z1, unsigned char *dst, int dst_xstride, int dst_ystride, int dst_zstride)); static float CorrectOpacity ANSI_ARGS((vpContext *vpc, int quant_opc, int x, int y, int z)); static void ShadeVoxel ANSI_ARGS((vpContext *vpc, void *voxel, int x, int y, int z, float *dst)); static int ExtractClassifiedVolume ANSI_ARGS((vpContext *vpc, int axis, int x0, int y0, int z0, int x1, int y1, int z1, int field, void *dst, int dst_xstride, int dst_ystride, int dst_zstride)); /* * vpExtract * * Extract a field from a volume. */ vpResult vpExtract(vpc, volume_type, x0, y0, z0, x1, y1, z1, field, dst, dst_size, dst_xstride, dst_ystride, dst_zstride) vpContext *vpc; /* context */ int volume_type; /* which volume representation to extract from */ int x0, y0, z0; /* origin of extracted region */ int x1, y1, z1; /* opposite corner of extracted region */ int field; /* field to extract */ void *dst; /* buffer to store result into */ int dst_size; /* size of dst in bytes */ int dst_xstride; /* stride (in bytes) for destination array */ int dst_ystride; int dst_zstride; { int field_size; int xrange, yrange, zrange; int retcode; int axis; /* check for errors */ if (x0 < 0 || y0 < 0 || z0 < 0 || x1 >= vpc->xlen || y1 >= vpc->ylen || z1 >= vpc->zlen || x0 > x1 || y0 > y1 || z0 > z1) return(VPSetError(vpc, VPERROR_BAD_VALUE)); if (field == VP_OPACITY_FIELD || field == VP_CORRECTED_OPAC_FIELD) field_size = 1; else if (field == VP_COLOR_FIELD) field_size = vpc->color_channels; else if (field < 0 || field >= vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VALUE)); else if (volume_type != VP_RAW_VOLUME && field >= vpc->num_shade_fields) return(VPSetError(vpc, VPERROR_BAD_VALUE)); else field_size = vpc->field_size[field]; if (dst == NULL || dst_size != field_size*(x1-x0+1)*(y1-y0+1)*(z1-z0+1)) return(VPSetError(vpc, VPERROR_BAD_SIZE)); /* choose axis */ switch (volume_type) { case VP_CLASSIFIED_VOLUME: xrange = x1 - x0; yrange = y1 - y0; zrange = z1 - z0; if (vpc->rle_z != NULL && zrange < xrange && zrange < yrange) axis = VP_Z_AXIS; else if (vpc->rle_x != NULL && xrange < yrange && xrange < zrange) axis = VP_X_AXIS; else if (vpc->rle_z != NULL && yrange < zrange && yrange < xrange) axis = VP_Y_AXIS; else if (vpc->rle_z != NULL && xrange >= yrange && xrange >= zrange) axis = VP_Z_AXIS; else if (vpc->rle_x != NULL && yrange >= zrange) axis = VP_X_AXIS; else if (vpc->rle_y != NULL) axis = VP_Y_AXIS; else if (vpc->rle_z != NULL) axis = VP_Z_AXIS; else if (vpc->rle_x != NULL) axis = VP_X_AXIS; else return(VPSetError(vpc, VPERROR_BAD_VOLUME)); break; case VP_CLX_VOLUME: axis = VP_X_AXIS; break; case VP_CLY_VOLUME: axis = VP_Y_AXIS; break; case VP_CLZ_VOLUME: axis = VP_Z_AXIS; break; case VP_RAW_VOLUME: break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } /* compute result */ if (volume_type == VP_RAW_VOLUME) { if ((retcode = VPCheckRawVolume(vpc)) != VP_OK) return(retcode); if (field == VP_OPACITY_FIELD) return(ClassifyRawVolume(vpc, 0, x0, y0, z0, x1, y1, z1, (unsigned char*)dst, dst_xstride, dst_ystride, dst_zstride)); else if (field == VP_CORRECTED_OPAC_FIELD) return(ClassifyRawVolume(vpc, 1, x0, y0, z0, x1, y1, z1, (unsigned char*)dst, dst_xstride, dst_ystride, dst_zstride)); else if (field == VP_COLOR_FIELD) return(ShadeRawVolume(vpc, x0, y0, z0, x1, y1, z1, (unsigned char*)dst, dst_xstride, dst_ystride, dst_zstride)); else return(ExtractRawVolume(vpc, x0, y0, z0, x1, y1, z1, field, dst, dst_xstride, dst_ystride, dst_zstride)); } else { if ((retcode = VPCheckClassifiedVolume(vpc, axis)) != VP_OK) return(retcode); if (field == VP_COLOR_FIELD) { return(VPSetError(vpc, VPERROR_BAD_VALUE)); } else { return(ExtractClassifiedVolume(vpc, axis, x0, y0, z0, x1, y1, z1, field, dst, dst_xstride, dst_ystride, dst_zstride)); } } } /* * ExtractRawVolume * * Extract a field from a raw volume into an array. */ static int ExtractRawVolume(vpc, x0, y0, z0, x1, y1, z1, field, dst, dst_xstride, dst_ystride, dst_zstride) vpContext *vpc; /* context */ int x0, y0, z0; /* origin of extracted region */ int x1, y1, z1; /* opposite corner of extracted region */ int field; /* field to extract */ void *dst; /* buffer to store result into */ int dst_xstride; /* stride (in bytes) for destination array */ int dst_ystride; int dst_zstride; { int x, y, z; unsigned char *voxel, *dstptr; int field_size; int field_offset; int xstride, ystride, zstride; field_size = vpc->field_size[field]; field_offset = vpc->field_offset[field]; xstride = vpc->xstride; ystride = vpc->ystride; zstride = vpc->zstride; voxel = (unsigned char*)vpc->raw_voxels; voxel += x0*xstride + y0*ystride + z0*zstride; dstptr = (unsigned char*)dst; for (z = z0; z <= z1; z++) { for (y = y0; y <= y1; y++) { for (x = x0; x <= x1; x++) { if (field_size == 1) ByteField(dstptr, 0) = ByteField(voxel, field_offset); else if (field_size == 2) ShortFieldSet(dstptr, 0, ShortField(voxel, field_offset)); else IntFieldSet(dstptr, 0, IntField(voxel, field_offset)); dstptr += dst_xstride; voxel += xstride; } dstptr += dst_ystride - (x1-x0+1)*dst_xstride; voxel += ystride - (x1-x0+1)*xstride; } dstptr += dst_zstride - (y1-y0+1)*dst_ystride; voxel += zstride - (y1-y0+1)*ystride; } return(VP_OK); } /* * ClassifyRawVolume * * Classify a portion of a raw volume, quantize the result, and store * as an array of 8-bit opacities. */ static int ClassifyRawVolume(vpc, correct, x0, y0, z0, x1, y1, z1, dst, dst_xstride, dst_ystride, dst_zstride) vpContext *vpc; /* context */ int correct; /* if true then correct for view */ int x0, y0, z0; /* origin of extracted region */ int x1, y1, z1; /* opposite corner of extracted region */ unsigned char *dst; /* buffer to store result into */ int dst_xstride; /* stride (in bytes) for destination array */ int dst_ystride; int dst_zstride; { float *opc; int num_voxels; int retcode; /* check for errors */ if ((retcode = VPCheckClassifier(vpc)) != VP_OK) return(retcode); /* compute opacities */ num_voxels = (x1-x0+1)*(y1-y0+1)*(z1-z0+1); Alloc(vpc, opc, float *, num_voxels*sizeof(float), "opacity_block"); VPClassifyBlock(vpc, correct, x0, y0, z0, x1, y1, z1, opc, sizeof(float), (x1-x0+1)*sizeof(float), (x1-x0+1)*(y1-y0+1)*sizeof(float)); /* quantize opacities */ VPQuantize(opc, x1-x0+1, y1-y0+1, z1-z0+1, 255., 255, dst, dst_xstride, dst_ystride, dst_zstride); Dealloc(vpc, opc); return(VP_OK); } /* * ShadeRawVolume * * Shade a portion of a raw volume, quantize the result, and store * as an array of 8-bit intensities. */ static int ShadeRawVolume(vpc, x0, y0, z0, x1, y1, z1, dst, dst_xstride, dst_ystride, dst_zstride) vpContext *vpc; /* context */ int x0, y0, z0; /* origin of extracted region */ int x1, y1, z1; /* opposite corner of extracted region */ unsigned char *dst; /* buffer to store result into */ int dst_xstride; /* stride (in bytes) for destination array */ int dst_ystride; int dst_zstride; { float *shd; int num_colors; int retcode; int xstride, ystride, zstride; /* check for errors */ if ((retcode = VPCheckShader(vpc)) != VP_OK) return(retcode); /* compute colors */ num_colors = (x1-x0+1)*(y1-y0+1)*(z1-z0+1)*vpc->color_channels; Alloc(vpc, shd, float *, num_colors*sizeof(float), "color_block"); xstride = vpc->color_channels * sizeof(float); ystride = xstride * (x1-x0+1); zstride = ystride * (y1-y0+1); VPShadeBlock(vpc, x0, y0, z0, x1, y1, z1, shd, xstride, ystride, zstride); /* quantize colors */ VPQuantize(shd, x1-x0+1, y1-y0+1, z1-z0+1, 1., 255, dst, dst_xstride, dst_ystride, dst_zstride); Dealloc(vpc, shd); return(VP_OK); } /* * VPClassifyBlock * * Classify a block of the current raw volume. The result is an * array of floating point opacities in the range 0.0-1.0. */ vpResult VPClassifyBlock(vpc, correct, x0, y0, z0, x1, y1, z1, opc, dst_xstride, dst_ystride, dst_zstride) vpContext *vpc; /* context */ int correct; /* if true then correct for view */ int x0, y0, z0; /* origin of extracted region */ int x1, y1, z1; /* opposite corner of extracted region */ float *opc; /* buffer to store result into */ int dst_xstride; /* stride (in bytes) for destination array */ int dst_ystride; int dst_zstride; { unsigned char *voxel; int xstride, ystride, zstride; int x, y, z; float opacity; int quant_opc; int retcode; if (correct) { if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); } xstride = vpc->xstride; ystride = vpc->ystride; zstride = vpc->zstride; voxel = (unsigned char*)vpc->raw_voxels; voxel += x0*xstride + y0*ystride + z0*zstride; for (z = z0; z <= z1; z++) { for (y = y0; y <= y1; y++) { for (x = x0; x <= x1; x++) { opacity = VPClassifyVoxel(vpc, voxel); if (correct) { quant_opc = opacity * 255.; if (quant_opc > 255) quant_opc = 255; else if (quant_opc < 0) quant_opc = 0; opacity = CorrectOpacity(vpc, quant_opc, x, y, z); } *opc = opacity; opc = (float *)((char *)opc + dst_xstride); voxel += xstride; } opc = (float *)((char *)opc + dst_ystride - (x1-x0+1)*dst_xstride); voxel += ystride - (x1-x0+1)*xstride; } opc = (float *)((char *)opc + dst_zstride - (y1-y0+1)*dst_ystride); voxel += zstride - (y1-y0+1)*ystride; } return(VP_OK); } /* * VPClassifyVoxel * * Classify a single voxel. Return value is an opacity. */ float VPClassifyVoxel(vpc, voxel) vpContext *vpc; /* context */ void *voxel; /* pointer to voxel */ { int num_params; /* number of parameters to classifier */ int p; /* current parameter number */ int field; /* field for the parameter */ int field_size; /* size of the field */ int field_offset; /* offset for the field */ int index; /* index for table lookup */ float opacity; /* current value of the opacity */ num_params = vpc->num_clsfy_params; opacity = 1; for (p = 0; p < num_params; p++) { /* get table index */ field = vpc->param_field[p]; field_offset = vpc->field_offset[field]; field_size = vpc->field_size[field]; index = VoxelField(voxel, field_offset, field_size); /* load table value */ opacity *= vpc->clsfy_table[p][index]; } return(opacity); } /* * CorrectOpacity * * Correct an opacity for the current view. * Return value is the corrected opacity. */ static float CorrectOpacity(vpc, quant_opc, x, y, z) vpContext *vpc; /* context */ int quant_opc; /* input opacity (0-255) */ int x, y, z; /* voxel coordinates in object space */ { float opacity; if (vpc->affine_view) { opacity = vpc->affine_opac_correct[quant_opc]; } else { /* XXX perspective rendering not available yet */ opacity = (float)quant_opc / (float)255.; } return(opacity); } /* * VPShadeBlock * * Shade a block of the current raw volume. The result is an * array of floating point colors in the range 0.0-255.0. */ vpResult VPShadeBlock(vpc, x0, y0, z0, x1, y1, z1, shd, dst_xstride, dst_ystride, dst_zstride) vpContext *vpc; /* context */ int x0, y0, z0; /* origin of extracted region */ int x1, y1, z1; /* opposite corner of extracted region */ float *shd; /* buffer to store result into */ int dst_xstride; /* stride (in bytes) for destination array */ int dst_ystride; int dst_zstride; { unsigned char *voxel; int xstride, ystride, zstride; int x, y, z; int color_channels; color_channels = vpc->color_channels; xstride = vpc->xstride; ystride = vpc->ystride; zstride = vpc->zstride; voxel = (unsigned char*)vpc->raw_voxels; voxel += x0*xstride + y0*ystride + z0*zstride; for (z = z0; z <= z1; z++) { for (y = y0; y <= y1; y++) { for (x = x0; x <= x1; x++) { ShadeVoxel(vpc, voxel, x, y, z, shd); shd = (float *)((char *)shd + dst_xstride); voxel += xstride; } shd = (float *)((char *)shd + dst_ystride - (x1-x0+1)*dst_xstride); voxel += ystride - (x1-x0+1)*xstride; } shd = (float *)((char *)shd + dst_zstride - (y1-y0+1)*dst_ystride); voxel += zstride - (y1-y0+1)*ystride; } return(VP_OK); } /* * ShadeVoxel * * Shade a voxel. */ static void ShadeVoxel(vpc, voxel, x, y, z, dst) vpContext *vpc; /* context */ void *voxel; /* voxel data */ int x, y, z; /* voxel coordinates */ float *dst; /* storage for result (1 or 3 intensities, 0-255) */ { int num_materials; int color_channels; int color_index_size, color_index_offset, color_index, color_table_offset; int weight_index_size, weight_index_offset, weight_index; int weight_table_offset; int m; float r, g, b; float *color_table; float *weight_table; /* check shading mode */ if (vpc->shading_mode == CALLBACK_SHADER) { if (vpc->color_channels == 1) vpc->shade_func(voxel, dst, vpc->client_data); else vpc->shade_func(voxel, dst, dst+1, dst+2, vpc->client_data); return; } else if (vpc->shading_mode != LOOKUP_SHADER) { VPBug("unknown shader type"); } /* compute table indices */ num_materials = vpc->num_materials; color_channels = vpc->color_channels; color_index_size = vpc->field_size[vpc->color_field]; color_index_offset = vpc->field_offset[vpc->color_field]; color_index = VoxelField(voxel, color_index_offset, color_index_size); color_table_offset = color_index * num_materials; weight_index_size = vpc->field_size[vpc->weight_field]; weight_index_offset = vpc->field_offset[vpc->weight_field]; weight_index = VoxelField(voxel, weight_index_offset, weight_index_size); weight_table_offset = weight_index * num_materials; /* look up values in tables */ if (color_channels == 1) { color_table = vpc->shade_color_table + color_table_offset; weight_table = vpc->shade_weight_table + weight_table_offset; if (num_materials == 1) { r = *color_table; } else { r = 0; for (m = 0; m < num_materials; m++) r += *color_table++ * *weight_table++; } *dst = r; } else { color_table = vpc->shade_color_table + 3*color_table_offset; weight_table = vpc->shade_weight_table + weight_table_offset; if (num_materials == 1) { r = *color_table++; g = *color_table++; b = *color_table; } else { r = 0; g = 0; b = 0; for (m = 0; m < num_materials; m++) { r += *color_table++ * *weight_table; g += *color_table++ * *weight_table; b += *color_table++ * *weight_table; } } dst[0] = r; dst[1] = g; dst[2] = b; } } /* * VPQuantize * * Quantize a floating point array and store the result in a byte array. */ void VPQuantize(src, xlen, ylen, zlen, scale, maxvalue, dst, dst_xstride, dst_ystride, dst_zstride) float *src; /* floating point array */ int xlen, ylen, zlen; /* array dimensions */ double scale; /* scale to apply to each array element */ int maxvalue; /* clamp each array element to this value */ unsigned char *dst; /* store results here */ int dst_xstride; /* stride (in bytes) for destination array */ int dst_ystride; int dst_zstride; { int value; int x, y, z; for (z = 0; z < zlen; z++) { for (y = 0; y < ylen; y++) { for (x = 0; x < xlen; x++) { value = (int)rint(*src++ * scale); if (value > maxvalue) value = maxvalue; else if (value < 0) value = 0; *dst = value; dst += dst_xstride; } dst += dst_ystride - xlen*dst_xstride; } dst += dst_zstride - ylen*dst_ystride; } } /* * ExtractClassifiedVolume * * Extract a field from a classified volume into an array. */ static int ExtractClassifiedVolume(vpc, axis, x0, y0, z0, x1, y1, z1, field, dst, dst_xstride, dst_ystride, dst_zstride) vpContext *vpc; /* context */ int axis; /* which axis to extract from */ int x0, y0, z0; /* origin of extracted region */ int x1, y1, z1; /* opposite corner of extracted region */ int field; /* field to extract */ void *dst; /* buffer to store result into */ int dst_xstride; /* stride (in bytes) for destination array */ int dst_ystride; int dst_zstride; { int i, j, k; /* voxel coordinates in rotated object space */ int i0, j0, k0; /* origin of extracted region */ int i1, j1, k1; /* opposite corner of extracted region */ int dst_istride; /* stride (in bytes) for destination array */ int dst_jstride; int dst_kstride; int ilen, jlen, klen; /* volume size */ RLEVoxels *rle_voxels; /* run-length encoded, classified volume */ unsigned char *voxel; /* pointer to current voxel in volume */ unsigned char *dstptr; /* pointer to destination */ unsigned char *length; /* pointer to current run length */ int run_length; /* length of current run */ int is_non_zero; /* true if current run is nonzero */ int rle_bytes_per_voxel; /* size of unclassified voxel */ ScanOffset *slice_runs; /* offsets to start of runs for a slice */ int field_size; /* size of field in bytes */ int field_offset; /* byte offset for voxel field */ /* initialize */ switch (axis) { case VP_X_AXIS: rle_voxels = vpc->rle_x; i0 = y0; j0 = z0; k0 = x0; i1 = y1; j1 = z1; k1 = x1; dst_istride = dst_ystride; dst_jstride = dst_zstride; dst_kstride = dst_xstride; break; case VP_Y_AXIS: rle_voxels = vpc->rle_y; i0 = z0; j0 = x0; k0 = y0; i1 = z1; j1 = x1; k1 = y1; dst_istride = dst_zstride; dst_jstride = dst_xstride; dst_kstride = dst_ystride; break; case VP_Z_AXIS: rle_voxels = vpc->rle_z; i0 = x0; j0 = y0; k0 = z0; i1 = x1; j1 = y1; k1 = z1; dst_istride = dst_xstride; dst_jstride = dst_ystride; dst_kstride = dst_zstride; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } if (rle_voxels == NULL) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); if (rle_voxels->scan_offsets_per_slice < 1) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); ilen = rle_voxels->ilen; jlen = rle_voxels->jlen; klen = rle_voxels->klen; rle_bytes_per_voxel = vpc->rle_bytes_per_voxel; if (field == VP_OPACITY_FIELD || field == VP_CORRECTED_OPAC_FIELD) { field_size = 1; field_offset = rle_bytes_per_voxel - 1; } else { field_size = vpc->field_size[field]; field_offset = vpc->field_offset[field]; } /* extract slice */ dstptr = (unsigned char*)dst; for (k = k0; k <= k1; k++) { slice_runs = &rle_voxels->scan_offsets[k * rle_voxels->scan_offsets_per_slice]; voxel = (unsigned char *)rle_voxels->data + slice_runs->first_data; length = rle_voxels->run_lengths + slice_runs->first_len; run_length = 0; is_non_zero = 1; for (j = 0; j < jlen; j++) { for (i = 0; i < ilen; i++) { while (run_length == 0) { run_length = *length++; is_non_zero = !is_non_zero; } run_length--; if (i >= i0 && i <= i1 && j >= j0 && j <= j1) { if (is_non_zero) { if (field_size == 1) ByteField(dstptr, 0) = ByteField(voxel, field_offset); else if (field_size == 2) ShortFieldSet(dstptr, 0, ShortField(voxel,field_offset)); else IntFieldSet(dstptr, 0, IntField(voxel,field_offset)); voxel += rle_bytes_per_voxel; } else { if (field_size == 1) ByteField(dstptr, 0) = 0; else if (field_size == 2) ShortFieldSet(dstptr, 0, 0); else IntFieldSet(dstptr, 0, 0); } dstptr += dst_istride; } else { if (is_non_zero) voxel += rle_bytes_per_voxel; } } if (j >= j0 && j <= j1) dstptr += dst_jstride - (i1-i0+1)*dst_istride; } dstptr += dst_kstride - (j1-j0+1)*dst_jstride; } return(VP_OK); } ccseapps-2.5/CCSEApps/volpack/glr.dsp0000644000175000017500000001104011634153073020606 0ustar amckinstryamckinstry# Microsoft Developer Studio Project File - Name="glr" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=glr - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "glr.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "glr.mak" CFG="glr - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "glr - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "glr - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe F90=df.exe RSC=rc.exe !IF "$(CFG)" == "glr - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "glr___Win32_Release" # PROP BASE Intermediate_Dir "glr___Win32_Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "glr___Win32_Release" # PROP Intermediate_Dir "glr___Win32_Release" # PROP Target_Dir "" # ADD BASE F90 /compile_only /nologo /warn:nofileopt # ADD F90 /compile_only /nologo /warn:nofileopt # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "glr - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "glr___Win32_Debug" # PROP BASE Intermediate_Dir "glr___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "glr___Win32_Debug" # PROP Intermediate_Dir "glr___Win32_Debug" # PROP Target_Dir "" # ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "glr - Win32 Release" # Name "glr - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" # Begin Source File SOURCE=.\examples\glr.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ccseapps-2.5/CCSEApps/volpack/vp_util.c0000644000175000017500000000765611634153073021162 0ustar amckinstryamckinstry/* * vp_util.c * * Miscellaneous utility routines. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:04 $ * $Revision: 1.3 $ */ #include "vp_global.h" /* * vpRamp * * Fill a float array with a ramp (a piecewise linear function). */ vpResult vpRamp(dst, stride, num_points, ramp_x, ramp_y) float *dst; /* array to store ramp into */ int stride; /* stride (in bytes) for dst */ int num_points; /* number of linear segment endpoints */ int *ramp_x; /* x coordinates of the endpoints (and indexes into dst) */ float *ramp_y; /* y coordinates of the endpoints */ { int i, x; int lastx, nextx; double lasty, nexty, dydx, y; if (num_points < 1) return(VPERROR_BAD_VALUE); for (i = 1; i < num_points; i++) if (ramp_x[i] <= ramp_x[i-1]) return(VPERROR_BAD_VALUE); dst[*ramp_x * stride/sizeof(float)] = *ramp_y; if (num_points == 1) return(VP_OK); for (i = 1; i < num_points; i++) { lastx = ramp_x[i-1]; lasty = ramp_y[i-1]; nextx = ramp_x[i]; nexty = ramp_y[i]; dydx = (double)(nexty - lasty) / (double)(nextx - lastx); for (x = lastx+1, y = lasty+dydx; x < nextx; x++, y += dydx) dst[x * stride/sizeof(float)] = y; dst[x * stride/sizeof(float)] = nexty; } return(VP_OK); } /* * VPBug * * Print an error message and exit. The argument is a printf-style format * string followed by parameters. */ #ifdef ANSI_C void VPBug(char *fmt, ...) #else void VPBug(fmt, va_alist) char *fmt; va_dcl #endif { va_list args; extern void exit ANSI_ARGS((int status)); fprintf(stderr, "BUG: "); #ifdef ANSI_C va_start(args, fmt); #else va_start(args); #endif vfprintf(stderr, fmt, args); va_end(args); fprintf(stderr, "\n"); exit(1); } #ifdef DEBUG /* * VPDebug * * Print a debugging message. * VPDebug(debug_code, format, parameters, ...) */ #ifdef ANSI_C void VPDebug(vpContext *vpc, int debug_code, char *fmt, ...) #else void VPDebug(vpc, debug_code, fmt, va_alist) vpContext *vpc; int debug_code; char *fmt; va_dcl #endif { va_list args; if (vpc->debug_enable[debug_code]) { #ifdef ANSI_C va_start(args, fmt); #else va_start(args); #endif vfprintf(stdout, fmt, args); va_end(args); } } #endif /* DEBUG */ ccseapps-2.5/CCSEApps/volpack/vp_file.c0000644000175000017500000011613111634153073021111 0ustar amckinstryamckinstry/* * vp_file.c * * Routines for loading and storing volume data in disk files. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:03 $ * $Revision: 1.4 $ */ #include "vp_global.h" static int StoreRLEVoxels ANSI_ARGS((vpContext *vpc, int fd, RLEVoxels *rle_voxels)); static int LoadRLEVoxels ANSI_ARGS((vpContext *vpc, int fd, RLEVoxels *rle_voxels, int offsets, int swab)); static void SwapWords ANSI_ARGS((void *data, unsigned size)); static void SwapVoxels ANSI_ARGS((vpContext *vpc, void *voxels, int num_voxels, int fields, int bytes_per_voxel)); #ifdef DEBUG void VPCheckScanOffsets ANSI_ARGS((RLEVoxels *rle_voxels, int rle_bytes_per_voxel)); #endif static void SwapOctreeNode ANSI_ARGS((vpContext *vpc, int level, void *node)); static int StoreTable ANSI_ARGS((vpContext *vpc, int fd, float *ptr, unsigned size)); static int LoadTable ANSI_ARGS((vpContext *vpc, int fd, float **ptr_ptr, unsigned *size_ptr)); /******************************************************************* * Classified Volume Files. * *******************************************************************/ /* file header structure */ typedef struct { unsigned magic; /* magic number for identification */ unsigned xlen; /* voxels in each dimension */ unsigned ylen; unsigned zlen; unsigned bytes_per_voxel; /* size of a classified voxel */ unsigned num_shade_fields; /* number of fields in a classified voxel (not including opacity) */ unsigned num_x_runs; /* number of run lengths for X view */ unsigned num_x_voxels; /* number of nonzero voxels for X view */ unsigned num_x_offsets; /* number of offsets per slice for X view */ unsigned num_y_runs; /* number of run lengths for Y view */ unsigned num_y_voxels; /* number of nonzero voxels for Y view */ unsigned num_y_offsets; /* number of offsets per slice for Y view */ unsigned num_z_runs; /* number of run lengths for Z view */ unsigned num_z_voxels; /* number of nonzero voxels for Z view */ unsigned num_z_offsets; /* number of offsets per slice for Z view */ float min_opacity; /* low opacity threshold */ } RLEVoxelHdr; /* * File layout: * RLEVoxelHdr hdr; * unsigned field_size[hdr.num_shade_fields]; (size of each voxel field) * unsigned field_offset[hdr.num_shade_fields]; (offset for each field) * unsigned field_max[hdr.num_shade_fields]; (max. value of each field) * padding to align to double word * unsigned char x_run_lengths[hdr.num_x_runs]; (run lengths for X view) * padding to align to double word * char x_data[hdr.num_x_voxels*hdr.bytes_per_voxel]; (voxel data for X view) * padding to align to double word * ScanOffset x_offsets[hdr.num_x_offsets]; (scanline offset for X view) * padding to align to double word * unsigned char y_run_lengths[hdr.num_y_runs]; (run lengths for Y view) * padding to align to double word * char y_data[hdr.num_y_voxels*hdr.bytes_per_voxel]; (voxel data for Y view) * padding to align to double word * ScanOffset y_offsets[hdr.num_y_offsets]; (scanline offset for Y view) * padding to align to double word * unsigned char z_run_lengths[hdr.num_z_runs]; (run lengths for Z view) * padding to align to double word * char z_data[hdr.num_z_voxels*hdr.bytes_per_voxel]; (voxel data for Z view) * padding to align to double word * ScanOffset z_offsets[hdr.num_z_offsets]; (scanline offset for Z view) * * The padding ensures that voxel data can be mapped into memory * without any word alignment problems. */ /* * vpStoreClassifiedVolume * * Store a run-length encoded, classified volume to a file. */ vpResult vpStoreClassifiedVolume(vpc, fd) vpContext *vpc; /* context containing the volume */ int fd; /* UNIX file descriptor open for writing */ { RLEVoxelHdr header; unsigned field_data[3*VP_MAX_FIELDS]; int nsf, c; unsigned size; char pad_data[8]; int pad_bytes; int retcode; /* check for errors */ if ((retcode = VPCheckVoxelFields(vpc)) != VP_OK) return(retcode); /* write header */ header.magic = VP_CVFILE_MAGIC; header.xlen = vpc->xlen; header.ylen = vpc->ylen; header.zlen = vpc->zlen; header.bytes_per_voxel = vpc->rle_bytes_per_voxel; header.num_shade_fields = vpc->num_shade_fields; if (vpc->rle_x == NULL) { header.num_x_runs = 0; header.num_x_voxels = 0; header.num_x_offsets = 0; } else { if ((retcode = VPCheckClassifiedVolume(vpc, VP_X_AXIS)) != VP_OK) return(retcode); header.num_x_runs = vpc->rle_x->run_count; header.num_x_voxels = vpc->rle_x->data_count; header.num_x_offsets = vpc->rle_x->scan_offsets_per_slice; } if (vpc->rle_y == NULL) { header.num_y_runs = 0; header.num_y_voxels = 0; header.num_y_offsets = 0; } else { if ((retcode = VPCheckClassifiedVolume(vpc, VP_Y_AXIS)) != VP_OK) return(retcode); header.num_y_runs = vpc->rle_y->run_count; header.num_y_voxels = vpc->rle_y->data_count; header.num_y_offsets = vpc->rle_y->scan_offsets_per_slice; } if (vpc->rle_z == NULL) { header.num_z_runs = 0; header.num_z_voxels = 0; header.num_z_offsets = 0; } else { if ((retcode = VPCheckClassifiedVolume(vpc, VP_Z_AXIS)) != VP_OK) return(retcode); header.num_z_runs = vpc->rle_z->run_count; header.num_z_voxels = vpc->rle_z->data_count; header.num_z_offsets = vpc->rle_z->scan_offsets_per_slice; } header.min_opacity = vpc->min_opacity; if (vpc->write_func(fd, &header, sizeof(header)) != sizeof(header)) return(VPSetError(vpc, VPERROR_IO)); /* write voxel layout information */ nsf = vpc->num_shade_fields; for (c = 0; c < nsf; c++) { field_data[c] = vpc->field_size[c]; field_data[nsf + c] = vpc->field_offset[c]; field_data[2*nsf + c] = vpc->field_max[c]; } size = 3*nsf*sizeof(unsigned); if (vpc->write_func(fd, field_data, size) != size) return(VPSetError(vpc, VPERROR_IO)); /* padding after header */ pad_bytes = (8 - ((sizeof(header) + size) % 8)) & 0x7; if (pad_bytes > 0) { bzero(pad_data, pad_bytes); if (vpc->write_func(fd, pad_data, pad_bytes) != pad_bytes) return(VPSetError(vpc, VPERROR_IO)); } /* write data */ if (vpc->rle_x != NULL) { if ((c = StoreRLEVoxels(vpc, fd, vpc->rle_x)) != VP_OK) return(c); } if (vpc->rle_y != NULL) { if ((c = StoreRLEVoxels(vpc, fd, vpc->rle_y)) != VP_OK) return(c); } if (vpc->rle_z != NULL) { if ((c = StoreRLEVoxels(vpc, fd, vpc->rle_z)) != VP_OK) return(c); } return(VP_OK); } /* * StoreRLEVoxels * * Write an RLEVoxels structure to a file. */ static int StoreRLEVoxels(vpc, fd, rle_voxels) vpContext *vpc; int fd; RLEVoxels *rle_voxels; { int size; char pad_data[8]; int pad_bytes; bzero(pad_data, sizeof(pad_data)); if (rle_voxels->run_count > 0) { size = rle_voxels->run_count; if (vpc->write_func(fd, rle_voxels->run_lengths, size) != size) return(VPSetError(vpc, VPERROR_IO)); pad_bytes = (8 - (size % 8)) & 0x7; if (pad_bytes > 0) { if (vpc->write_func(fd, pad_data, pad_bytes) != pad_bytes) return(VPSetError(vpc, VPERROR_IO)); } } if (rle_voxels->data_count > 0) { size = rle_voxels->data_count * vpc->rle_bytes_per_voxel; if (vpc->write_func(fd, rle_voxels->data, size) != size) return(VPSetError(vpc, VPERROR_IO)); pad_bytes = (8 - (size % 8)) & 0x7; if (pad_bytes > 0) { if (vpc->write_func(fd, pad_data, pad_bytes) != pad_bytes) return(VPSetError(vpc, VPERROR_IO)); } } if (rle_voxels->scan_offsets_per_slice > 0) { size = rle_voxels->scan_offsets_per_slice * rle_voxels->klen * sizeof(ScanOffset); if (vpc->write_func(fd, rle_voxels->scan_offsets, size) != size) return(VPSetError(vpc, VPERROR_IO)); pad_bytes = (8 - (size % 8)) & 0x7; if (pad_bytes > 0) { if (vpc->write_func(fd, pad_data, pad_bytes) != pad_bytes) return(VPSetError(vpc, VPERROR_IO)); } } return(VP_OK); } /* * vpLoadClassifiedVolume * * Load a run-length encoded, classified volume from a file. */ vpResult vpLoadClassifiedVolume(vpc, fd) vpContext *vpc; /* context to store the volume into */ int fd; /* UNIX file descriptor open for reading */ { RLEVoxelHdr header; unsigned field_data[3*VP_MAX_FIELDS]; int nsf, c, swab; unsigned size; unsigned char *data; char pad_data[8]; int pad_bytes; unsigned x_run_offset; unsigned x_data_offset; unsigned x_offset_offset; unsigned y_run_offset; unsigned y_data_offset; unsigned y_offset_offset; unsigned z_run_offset; unsigned z_data_offset; unsigned z_offset_offset; int current_offset; int destroy_old_volume; /* read header */ if (vpc->read_func(fd, &header, sizeof(header)) != sizeof(header)) return(VPSetError(vpc, VPERROR_IO)); swab = 0; if (header.magic != VP_CVFILE_MAGIC) { SwapWords(&header, sizeof(header)); if (header.magic != VP_CVFILE_MAGIC) return(VPSetError(vpc, VPERROR_BAD_FILE)); swab = 1; } /* read voxel layout information */ size = 3 * header.num_shade_fields * sizeof(unsigned); if (vpc->read_func(fd, field_data, size) != size) return(VPSetError(vpc, VPERROR_IO)); if (swab) SwapWords(field_data, size); /* padding after header */ pad_bytes = (8 - ((sizeof(header) + size) % 8)) & 0x7; if (pad_bytes > 0) { if (vpc->read_func(fd, pad_data, pad_bytes) != pad_bytes) return(VPSetError(vpc, VPERROR_IO)); } /* check for consistency with old volume data */ destroy_old_volume = 0; if (vpc->xlen != header.xlen || vpc->ylen != header.ylen || vpc->zlen != header.zlen || vpc->raw_bytes_per_voxel < header.bytes_per_voxel || vpc->num_voxel_fields < header.num_shade_fields) destroy_old_volume = 1; nsf = header.num_shade_fields; for (c = 0; c < nsf; c++) { if (vpc->field_size[c] != field_data[c] || vpc->field_offset[c] != field_data[nsf + c] || vpc->field_max[c] != field_data[2*nsf + c]) destroy_old_volume = 1; } if (destroy_old_volume) { vpDestroyClassifiedVolume(vpc); vpDestroyMinMaxOctree(vpc); vpc->raw_voxels = NULL; vpc->raw_voxels_size = 0; vpc->xstride = 0; vpc->ystride = 0; vpc->zstride = 0; } /* load new volume size */ if (destroy_old_volume) { vpc->xlen = header.xlen; vpc->ylen = header.ylen; vpc->zlen = header.zlen; vpc->raw_bytes_per_voxel = header.bytes_per_voxel; nsf = header.num_shade_fields; vpc->num_voxel_fields = nsf; for (c = 0; c < nsf; c++) { vpc->field_size[c] = field_data[c]; vpc->field_offset[c] = field_data[nsf + c]; vpc->field_max[c] = field_data[2*nsf + c]; } } vpc->num_shade_fields = nsf; vpc->min_opacity = header.min_opacity; vpc->rle_bytes_per_voxel = header.bytes_per_voxel; /* load new volume data */ if (vpc->mmap_func != NULL && !swab) { /* compute file offsets */ current_offset = sizeof(header) + size; current_offset += (8 - (current_offset % 8)) & 0x7; x_run_offset = current_offset; current_offset += header.num_x_runs; current_offset += (8 - (current_offset % 8)) & 0x7; x_data_offset = current_offset; current_offset += header.num_x_voxels * header.bytes_per_voxel; current_offset += (8 - (current_offset % 8)) & 0x7; x_offset_offset = current_offset; current_offset += header.num_x_offsets * sizeof(ScanOffset); current_offset += (8 - (current_offset % 8)) & 0x7; y_run_offset = current_offset; current_offset += header.num_y_runs; current_offset += (8 - (current_offset % 8)) & 0x7; y_data_offset = current_offset; current_offset += header.num_y_voxels * header.bytes_per_voxel; current_offset += (8 - (current_offset % 8)) & 0x7; y_offset_offset = current_offset; current_offset += header.num_y_offsets * sizeof(ScanOffset); current_offset += (8 - (current_offset % 8)) & 0x7; z_run_offset = current_offset; current_offset += header.num_z_runs; current_offset += (8 - (current_offset % 8)) & 0x7; z_data_offset = current_offset; current_offset += header.num_z_voxels * header.bytes_per_voxel; current_offset += (8 - (current_offset % 8)) & 0x7; z_offset_offset = current_offset; current_offset += header.num_z_offsets * sizeof(ScanOffset); /* memory-map the data */ if ((data = (unsigned char*)vpc->mmap_func(fd, current_offset, vpc->client_data)) == NULL) return(VPSetError(vpc, VPERROR_IO)); /* assign pointers to x view data */ vpc->rle_x = VPCreateRLEVoxels(vpc, header.ylen, header.zlen, header.xlen, 0, 0, 0); vpc->rle_x->run_count = header.num_x_runs; if (header.num_x_runs > 0) vpc->rle_x->run_lengths = (unsigned char *)(data + x_run_offset); vpc->rle_x->data_count = header.num_x_voxels; if (header.num_x_voxels > 0) vpc->rle_x->data = (void *)(data + x_data_offset); vpc->rle_x->scan_offsets_per_slice = header.num_x_offsets; if (header.num_x_offsets > 0) vpc->rle_x->scan_offsets = (ScanOffset *)(data + x_offset_offset); vpc->rle_x->mmapped = 1; /* assign pointers to y view data */ vpc->rle_y = VPCreateRLEVoxels(vpc, header.zlen, header.xlen, header.ylen, 0, 0, 0); vpc->rle_y->run_count = header.num_y_runs; if (header.num_y_runs > 0) vpc->rle_y->run_lengths = (unsigned char *)(data + y_run_offset); vpc->rle_y->data_count = header.num_y_voxels; if (header.num_y_voxels > 0) vpc->rle_y->data = (void *)(data + y_data_offset); vpc->rle_y->scan_offsets_per_slice = header.num_y_offsets; if (header.num_y_offsets > 0) vpc->rle_y->scan_offsets = (ScanOffset *)(data + y_offset_offset); vpc->rle_y->mmapped = 1; /* assign pointers to z view data */ vpc->rle_z = VPCreateRLEVoxels(vpc, header.xlen, header.ylen, header.zlen, 0, 0, 0); vpc->rle_z->run_count = header.num_z_runs; if (header.num_z_runs > 0) vpc->rle_z->run_lengths = (unsigned char *)(data + z_run_offset); vpc->rle_z->data_count = header.num_z_voxels; if (header.num_z_voxels > 0) vpc->rle_z->data = (void *)(data + z_data_offset); vpc->rle_z->scan_offsets_per_slice = header.num_z_offsets; if (header.num_z_offsets > 0) vpc->rle_z->scan_offsets = (ScanOffset *)(data + z_offset_offset); vpc->rle_z->mmapped = 1; } else { /* read the x view data into memory */ if (header.num_x_runs != 0) { vpc->rle_x = VPCreateRLEVoxels(vpc, header.ylen, header.zlen, header.xlen, header.num_x_voxels, header.num_x_runs, header.bytes_per_voxel); if ((c = LoadRLEVoxels(vpc, fd, vpc->rle_x, header.num_x_offsets, swab)) != VP_OK) return(c); } /* read the y view data into memory */ if (header.num_y_runs != 0) { vpc->rle_y = VPCreateRLEVoxels(vpc, header.zlen, header.xlen, header.ylen, header.num_y_voxels, header.num_y_runs, header.bytes_per_voxel); if ((c = LoadRLEVoxels(vpc, fd, vpc->rle_y, header.num_y_offsets, swab)) != VP_OK) return(c); } /* read the z view data into memory */ if (header.num_z_runs != 0) { vpc->rle_z = VPCreateRLEVoxels(vpc, header.xlen, header.ylen, header.zlen, header.num_z_voxels, header.num_z_runs, header.bytes_per_voxel); if ((c = LoadRLEVoxels(vpc, fd, vpc->rle_z, header.num_z_offsets, swab)) != VP_OK) return(c); } } #ifdef DEBUG if (vpc->rle_x != NULL) { printf("Checking X scanline offsets....\n"); VPCheckScanOffsets(vpc->rle_x, vpc->rle_bytes_per_voxel); } if (vpc->rle_y != NULL) { printf("Checking Y scanline offsets....\n"); VPCheckScanOffsets(vpc->rle_y, vpc->rle_bytes_per_voxel); } if (vpc->rle_z != NULL) { printf("Checking Z scanline offsets....\n"); VPCheckScanOffsets(vpc->rle_z, vpc->rle_bytes_per_voxel); } #endif return(VP_OK); } /* * LoadRLEVoxels * * Load an RLEVoxels structure from a file. */ static int LoadRLEVoxels(vpc, fd, rle_voxels, offsets, swab) vpContext *vpc; int fd; RLEVoxels *rle_voxels; int offsets; int swab; { int size; char pad_data[8]; int pad_bytes; if (rle_voxels->run_count > 0) { size = rle_voxels->run_count; if (vpc->read_func(fd, rle_voxels->run_lengths, size) != size) return(VPSetError(vpc, VPERROR_IO)); pad_bytes = (8 - (size % 8)) & 0x7; if (pad_bytes > 0) { if (vpc->read_func(fd, pad_data, pad_bytes) != pad_bytes) return(VPSetError(vpc, VPERROR_IO)); } } if (rle_voxels->data_count > 0) { size = rle_voxels->data_count * vpc->rle_bytes_per_voxel; if (vpc->read_func(fd, rle_voxels->data, size) != size) return(VPSetError(vpc, VPERROR_IO)); if (swab) SwapVoxels(vpc, rle_voxels->data, rle_voxels->data_count, vpc->num_shade_fields, vpc->rle_bytes_per_voxel); pad_bytes = (8 - (size % 8)) & 0x7; if (pad_bytes > 0) { if (vpc->read_func(fd, pad_data, pad_bytes) != pad_bytes) return(VPSetError(vpc, VPERROR_IO)); } } if (offsets > 0) { rle_voxels->scan_offsets_per_slice = offsets; size = rle_voxels->klen * offsets * sizeof(ScanOffset); Alloc(vpc, rle_voxels->scan_offsets, ScanOffset *, size, "scan_offsets"); if (vpc->read_func(fd, rle_voxels->scan_offsets, size) != size) return(VPSetError(vpc, VPERROR_IO)); if (swab) SwapWords(rle_voxels->scan_offsets, size); pad_bytes = (8 - (size % 8)) & 0x7; if (pad_bytes > 0) { if (vpc->read_func(fd, pad_data, pad_bytes) != pad_bytes) return(VPSetError(vpc, VPERROR_IO)); } } return(VP_OK); } /* * SwapWords * * Byte-swap word data to change the endianess. */ static void SwapWords(data, size) void *data; unsigned size; { unsigned char *ptr; int tmp1, tmp2; ptr = (unsigned char*)data; while (size >= 4) { tmp1 = ptr[0]; ptr[0] = ptr[3]; ptr[3] = tmp1; tmp2 = ptr[1]; ptr[1] = ptr[2]; ptr[2] = tmp2; size -= 4; ptr += 4; } } /* * SwapVoxels * * Byte-swap voxel data to change the endianess. */ static void SwapVoxels(vpc, voxels, num_voxels, fields, bytes_per_voxel) vpContext *vpc; /* context */ void *voxels; /* array of voxels */ int num_voxels; /* number of voxels in the array */ int fields; /* number of fields in voxel */ int bytes_per_voxel; /* size of voxel in bytes */ { int f, size, offset; unsigned char *voxel_ptr; int tmp1, tmp2; /* check if any of the fields of the voxel need swapping */ size = 0; for (f = 0; f < fields; f++) { if (vpc->field_size[f] > size) size = vpc->field_size[f]; } if (size <= 1) return; /* do the swapping */ voxel_ptr = (unsigned char*)voxels; while (num_voxels-- > 0) { for (f = 0; f < fields; f++) { size = vpc->field_size[f]; if (size == 1) continue; offset = vpc->field_offset[f]; if (size == 2) { tmp1 = voxel_ptr[offset]; voxel_ptr[offset] = voxel_ptr[offset+1]; voxel_ptr[offset+1] = tmp1; } else { tmp1 = voxel_ptr[offset]; voxel_ptr[offset] = voxel_ptr[offset+3]; voxel_ptr[offset+3] = tmp1; tmp2 = voxel_ptr[offset+1]; voxel_ptr[offset+1] = voxel_ptr[offset+2]; voxel_ptr[offset+2] = tmp2; } } voxel_ptr += bytes_per_voxel; } } /******************************************************************* * Min-Max Octree Files. * *******************************************************************/ /* file header structure */ typedef struct { unsigned magic; /* magic number for identification */ unsigned xlen; /* voxels in each dimension */ unsigned ylen; unsigned zlen; int num_clsfy_params; /* # of params for classification */ int levels; /* number of levels in octree */ int root_node_size; /* voxels/side for root level */ int base_node_size; /* voxels/side for base level */ int range_bytes_per_node; /* bytes/node for min/max data */ int base_bytes_per_node; /* bytes/node for base level */ int nonbase_bytes_per_node; /* bytes/node for non-base level */ int status_offset; /* offset to status field */ int child_offset; /* offset to child field */ unsigned octree_bytes; /* bytes of storage for the octree */ } MinMaxOctreeHdr; /* * File layout: * MinMaxOctreeHdr hdr; * unsigned param_size[hdr.num_clsfy_params]; (size of each parameter, bytes) * unsigned param_max[hdr.num_clsfy_params]; (max. value of each parameter) * unsigned node_offset[hdr.num_clsfy_params];(node offset to min/max data) * char data[octree_bytes]; (octree data) */ /* * vpStoreMinMaxOctree * * Store a min-max octree to a file. */ vpResult vpStoreMinMaxOctree(vpc, fd) vpContext *vpc; /* context containing the octree */ int fd; /* UNIX file descriptor open for writing */ { MinMaxOctreeHdr header; unsigned field_data[3*VP_MAX_FIELDS]; int ncp, c; unsigned size; if (vpc->mm_octree == NULL) return(VPSetError(vpc, VPERROR_BAD_SIZE)); /* write header */ bzero(&header, sizeof(MinMaxOctreeHdr)); header.magic = VP_OCTFILE_MAGIC; header.xlen = vpc->xlen; header.ylen = vpc->ylen; header.zlen = vpc->zlen; header.num_clsfy_params = vpc->num_clsfy_params; header.levels = vpc->mm_octree->levels; header.root_node_size = vpc->mm_octree->root_node_size; header.base_node_size = vpc->mm_octree->base_node_size; header.range_bytes_per_node = vpc->mm_octree->range_bytes_per_node; header.base_bytes_per_node = vpc->mm_octree->base_bytes_per_node; header.nonbase_bytes_per_node = vpc->mm_octree->nonbase_bytes_per_node; header.status_offset = vpc->mm_octree->status_offset; header.child_offset = vpc->mm_octree->child_offset; header.octree_bytes = vpc->mm_octree->octree_bytes; if (vpc->write_func(fd, &header, sizeof(header)) != sizeof(header)) return(VPSetError(vpc, VPERROR_IO)); /* write parameter size/offset information */ ncp = vpc->num_clsfy_params; for (c = 0; c < ncp; c++) { field_data[c] = vpc->field_size[vpc->param_field[c]]; field_data[ncp + c] = vpc->field_max[vpc->param_field[c]]; field_data[2*ncp + c] = vpc->mm_octree->node_offset[c]; } size = 3*ncp*sizeof(unsigned); if (vpc->write_func(fd, field_data, size) != size) return(VPSetError(vpc, VPERROR_IO)); /* write octree data */ size = vpc->mm_octree->octree_bytes; if (vpc->write_func(fd, vpc->mm_octree->root, size) != size) return(VPSetError(vpc, VPERROR_IO)); return(VP_OK); } /* * vpLoadMinMaxOctree * * Load a min-max octree from a file. */ vpResult vpLoadMinMaxOctree(vpc, fd) vpContext *vpc; /* context to store the octree into */ int fd; /* UNIX file descriptor open for reading */ { MinMaxOctreeHdr header; unsigned field_data[3*VP_MAX_FIELDS]; int ncp, c, swab; unsigned size; /* read header */ if (vpc->read_func(fd, &header, sizeof(header)) != sizeof(header)) return(VPSetError(vpc, VPERROR_IO)); swab = 0; if (header.magic != VP_OCTFILE_MAGIC) { SwapWords(&header, sizeof(header)); if (header.magic != VP_OCTFILE_MAGIC) return(VPSetError(vpc, VPERROR_BAD_FILE)); swab = 1; } /* read parameter size/offset information */ size = 3 * header.num_clsfy_params * sizeof(unsigned); if (vpc->read_func(fd, field_data, size) != size) return(VPSetError(vpc, VPERROR_IO)); if (swab) SwapWords(field_data, size); /* check for consistency with current volume data */ if ((c = VPCheckRawVolume(vpc)) != VP_OK) return(c); if (header.xlen != vpc->xlen || header.ylen != vpc->ylen || header.zlen != vpc->zlen || header.num_clsfy_params != vpc->num_clsfy_params) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); ncp = vpc->num_clsfy_params; for (c = 0; c < ncp; c++) { if (field_data[c] != vpc->field_size[vpc->param_field[c]] || field_data[ncp + c] != vpc->field_max[vpc->param_field[c]]) return(VPSetError(vpc, VPERROR_BAD_VOXEL)); } /* clear old octree */ vpDestroyMinMaxOctree(vpc); /* initialize new octree */ Alloc(vpc, vpc->mm_octree, MinMaxOctree *, sizeof(MinMaxOctree), "MinMaxOctree"); bzero(vpc->mm_octree, sizeof(MinMaxOctree)); vpc->mm_octree->levels = header.levels; vpc->mm_octree->root_node_size = header.root_node_size; vpc->mm_octree->base_node_size = header.base_node_size; vpc->mm_octree->range_bytes_per_node = header.range_bytes_per_node; vpc->mm_octree->base_bytes_per_node = header.base_bytes_per_node; vpc->mm_octree->nonbase_bytes_per_node = header.nonbase_bytes_per_node; vpc->mm_octree->status_offset = header.status_offset; vpc->mm_octree->child_offset = header.child_offset; vpc->mm_octree->octree_bytes = header.octree_bytes; ncp = header.num_clsfy_params; for (c = 0; c < ncp; c++) vpc->mm_octree->node_offset[c] = field_data[2*ncp + c]; /* load octree data */ size = header.octree_bytes; Alloc(vpc, vpc->mm_octree->root, void *, size, "mm_octree"); if (vpc->read_func(fd, vpc->mm_octree->root, size) != size) return(VPSetError(vpc, VPERROR_IO)); if (swab) SwapOctreeNode(vpc, 0, vpc->mm_octree->root); return(VP_OK); } /* * SwapOctreeNode * * Recursive depth-first traversal of an octree to byte-swap each node's * data (in order to switch the endianess). */ static void SwapOctreeNode(vpc, level, node) vpContext *vpc; int level; void *node; { int p, field, size, offset, tmp1, tmp2; int child_bytes_per_node; char *node_ptr = (char*)node; /* byte swap min-max data */ for (p = 0; p < vpc->num_clsfy_params; p++) { field = vpc->param_field[p]; size = vpc->field_size[field]; if (size != 1) { ASSERT(size == 2); offset = vpc->mm_octree->node_offset[p]; tmp1 = node_ptr[offset]; node_ptr[offset] = node_ptr[offset+1]; node_ptr[offset+1] = tmp1; tmp2 = node_ptr[offset+2]; node_ptr[offset+2] = node_ptr[offset+3]; node_ptr[offset+3] = tmp2; } } /* byte swap child pointer and recurse */ if (level != vpc->mm_octree->levels-1) { offset = vpc->mm_octree->child_offset; tmp1 = node_ptr[offset]; node_ptr[offset] = node_ptr[offset+3]; node_ptr[offset+3] = tmp1; tmp2 = node_ptr[offset+1]; node_ptr[offset+1] = node_ptr[offset+2]; node_ptr[offset+2] = tmp2; ASSERT(IntField(node, offset) != 0); node_ptr = (char *)vpc->mm_octree->root + IntField(node, offset); if (level == vpc->mm_octree->levels-2) child_bytes_per_node = vpc->mm_octree->base_bytes_per_node; else child_bytes_per_node = vpc->mm_octree->nonbase_bytes_per_node; SwapOctreeNode(vpc, level+1, node_ptr); node_ptr += child_bytes_per_node; SwapOctreeNode(vpc, level+1, node_ptr); node_ptr += child_bytes_per_node; SwapOctreeNode(vpc, level+1, node_ptr); node_ptr += child_bytes_per_node; SwapOctreeNode(vpc, level+1, node_ptr); node_ptr += child_bytes_per_node; SwapOctreeNode(vpc, level+1, node_ptr); node_ptr += child_bytes_per_node; SwapOctreeNode(vpc, level+1, node_ptr); node_ptr += child_bytes_per_node; SwapOctreeNode(vpc, level+1, node_ptr); node_ptr += child_bytes_per_node; SwapOctreeNode(vpc, level+1, node_ptr); } } /******************************************************************* * Raw Volume Files. * *******************************************************************/ /* file header structure */ typedef struct { unsigned magic; /* magic number for identification */ unsigned xlen; /* voxels in each dimension */ unsigned ylen; unsigned zlen; unsigned bytes_per_voxel; /* size of a raw voxel */ unsigned num_voxel_fields; /* number of fields in a voxel */ unsigned num_shade_fields; /* number of fields for shading */ unsigned num_clsfy_fields; /* number of fields for classification */ int xstride; /* strides for voxel data */ int ystride; int zstride; } RawVoxelHdr; /* * File layout: * RawVoxelHdr hdr; * unsigned field_size[hdr.num_shade_fields]; (size of each voxel field) * unsigned field_offset[hdr.num_shade_fields]; (offset for each field) * unsigned field_max[hdr.num_shade_fields]; (max. value of each field) * char data[hdr.xlen*hdr.ylen*hdr.zlen*hdr.bytes_per_voxel]; (volume data) */ /* * vpStoreRawVolume * * Store an unclassified volume to a file. */ vpResult vpStoreRawVolume(vpc, fd) vpContext *vpc; /* context containing the volume */ int fd; /* UNIX file descriptor open for writing */ { RawVoxelHdr header; unsigned field_data[3*VP_MAX_FIELDS]; int nvf, c; unsigned size; int retcode; /* check for errors */ if ((retcode = VPCheckRawVolume(vpc)) != VP_OK) return(retcode); /* write header */ header.magic = VP_RVFILE_MAGIC; header.xlen = vpc->xlen; header.ylen = vpc->ylen; header.zlen = vpc->zlen; header.bytes_per_voxel = vpc->raw_bytes_per_voxel; header.num_voxel_fields = vpc->num_voxel_fields; header.num_shade_fields = vpc->num_shade_fields; header.num_clsfy_fields = vpc->num_clsfy_params; header.xstride = vpc->xstride; header.ystride = vpc->ystride; header.zstride = vpc->zstride; if (vpc->write_func(fd, &header, sizeof(header)) != sizeof(header)) return(VPSetError(vpc, VPERROR_IO)); /* write voxel layout information */ nvf = vpc->num_voxel_fields; for (c = 0; c < nvf; c++) { field_data[c] = vpc->field_size[c]; field_data[nvf + c] = vpc->field_offset[c]; field_data[2*nvf + c] = vpc->field_max[c]; } size = 3*nvf*sizeof(unsigned); if (vpc->write_func(fd, field_data, size) != size) return(VPSetError(vpc, VPERROR_IO)); /* write data */ if (vpc->write_func(fd, vpc->raw_voxels, vpc->raw_voxels_size) != vpc->raw_voxels_size) return(VPSetError(vpc, VPERROR_IO)); return(VP_OK); } /* * vpLoadRawVolume * * Load an unclassified volume from a file. */ vpResult vpLoadRawVolume(vpc, fd) vpContext *vpc; /* context to store the volume into */ int fd; /* UNIX file descriptor open for reading */ { RawVoxelHdr header; unsigned field_data[3*VP_MAX_FIELDS]; int nvf, c, swab; unsigned size; unsigned voxel_offset; /* read header */ if (vpc->read_func(fd, &header, sizeof(header)) != sizeof(header)) return(VPSetError(vpc, VPERROR_IO)); swab = 0; if (header.magic != VP_RVFILE_MAGIC) { SwapWords(&header, sizeof(header)); if (header.magic != VP_RVFILE_MAGIC) return(VPSetError(vpc, VPERROR_BAD_FILE)); swab = 1; } /* read voxel layout information */ size = 3 * header.num_voxel_fields * sizeof(unsigned); if (vpc->read_func(fd, field_data, size) != size) return(VPSetError(vpc, VPERROR_IO)); if (swab) SwapWords(field_data, size); voxel_offset = sizeof(header) + size; /* destroy old volume data */ vpDestroyClassifiedVolume(vpc); vpDestroyMinMaxOctree(vpc); /* load new volume size */ vpc->xlen = header.xlen; vpc->ylen = header.ylen; vpc->zlen = header.zlen; vpc->raw_bytes_per_voxel = header.bytes_per_voxel; vpc->num_voxel_fields = header.num_voxel_fields; vpc->num_shade_fields = header.num_shade_fields; vpc->num_clsfy_params = header.num_clsfy_fields; vpc->xstride = header.xstride; vpc->ystride = header.ystride; vpc->zstride = header.zstride; nvf = header.num_voxel_fields; for (c = 0; c < nvf; c++) { vpc->field_size[c] = field_data[c]; vpc->field_offset[c] = field_data[nvf + c]; vpc->field_max[c] = field_data[2*nvf + c]; } /* load new volume data */ size = vpc->xlen*vpc->ylen*vpc->zlen*vpc->raw_bytes_per_voxel; vpc->raw_voxels_size = size; if (vpc->mmap_func != NULL && !swab) { if ((vpc->raw_voxels = vpc->mmap_func(fd, voxel_offset, vpc->client_data)) == NULL) return(VPSetError(vpc, VPERROR_IO)); } else { Alloc(vpc, vpc->raw_voxels, void *, size, "raw_voxels"); if (vpc->read_func(fd, vpc->raw_voxels, size) != size) return(VPSetError(vpc, VPERROR_IO)); if (swab) { SwapVoxels(vpc, vpc->raw_voxels, vpc->xlen*vpc->ylen*vpc->zlen, vpc->num_voxel_fields, vpc->raw_bytes_per_voxel); } } return(VP_OK); } /******************************************************************* * Rendering Context Dump Files. * *******************************************************************/ /* file header structure */ typedef struct { unsigned magic; /* magic number for identification */ unsigned major_version; /* major version number */ unsigned minor_version; /* minor version number */ unsigned max_fields; /* value of VP_MAX_FIELDS */ unsigned max_material; /* value of VP_MAX_MATERIAL */ unsigned max_lights; /* value of VP_MAX_LIGHTS */ } VpcHdr; /* * File layout: * VpcHdr hdr; * vpContext vpc; --> truncated just before "end_of_parameters" field * unsigned shade_color_table_size; * float shade_color_table[shade_color_table_size]; * unsigned shade_weight_table_size; * float shade_weight_table[shade_weight_table_size]; * for i = 1 to vpc.num_clsfy_params: * int clsfy_table_size; * float clsfy_table[clsfy_table_size]; */ /* * vpStoreContext * * Store the contents of a volpack context to a file. All state parameters * stored directly in the vpContext structure are stored. User-supplied * lookup tables are also stored. Volume data and octrees are not stored * (use the routines specifically for storing those data structures), and * internal tables that can be computed from other state variables * (e.g. depth cueing lookup table) are not stored. */ vpResult vpStoreContext(vpc, fd) vpContext *vpc; int fd; { VpcHdr header; int i; unsigned vpc_size; header.magic = VP_VPCFILE_MAGIC; header.major_version = VP_MAJOR_VERSION; header.minor_version = VP_MINOR_VERSION; header.max_fields = VP_MAX_FIELDS; header.max_material = VP_MAX_MATERIAL; header.max_lights = VP_MAX_LIGHTS; vpc_size = vpFieldOffset(vpc, end_of_parameters); if (vpc->write_func(fd, &header, sizeof(header)) != sizeof(header)) return(VPSetError(vpc, VPERROR_IO)); if (vpc->write_func(fd, vpc, vpc_size) != vpc_size) return(VPSetError(vpc, VPERROR_IO)); if (!StoreTable(vpc, fd, vpc->shade_color_table, vpc->shade_color_table_size)) return(VPSetError(vpc, VPERROR_IO)); if (!StoreTable(vpc, fd, vpc->shade_weight_table, vpc->shade_weight_table_size)) return(VPSetError(vpc, VPERROR_IO)); for (i = 0; i < vpc->num_clsfy_params; i++) { if (!StoreTable(vpc, fd, vpc->clsfy_table[i], vpc->clsfy_table_size[i])) return(VPSetError(vpc, VPERROR_IO)); } return(VP_OK); } /* * StoreTable * * Store a table to a file and check for errors. Return value is 1 for * success, 0 for failure. */ static int StoreTable(vpc, fd, ptr, size) vpContext *vpc; int fd; float *ptr; unsigned size; { if (size == 0 || ptr == NULL) { size = 0; if (vpc->write_func(fd, &size, sizeof(size)) != sizeof(size)) return(0); } else { if (vpc->write_func(fd, &size, sizeof(size)) != sizeof(size)) return(0); if (vpc->write_func(fd, ptr, size) != size) return(0); } return(1); } /* * vpLoadContext * * Load a volpack context from a file. The old contents of the context are * destroyed, including any volume data. Lookup tables for shading and * classification that are loaded from the file are stored in newly-allocated * memory, but the application is responsible for freeing the tables; * existing tables in the context are not overwritten (since there is no * way for the application to predict the right table sizes), and the new * tables are not freed when vpDestroyContext is called (since volpack * normally does not manage the tables). Byte swapping is not performed. */ vpResult vpLoadContext(vpc, fd) vpContext *vpc; int fd; { VpcHdr header; int swab, i; unsigned vpc_size; /* read header */ if (vpc->read_func(fd, &header, sizeof(header)) != sizeof(header)) return(VPSetError(vpc, VPERROR_IO)); swab = 0; if (header.magic != VP_VPCFILE_MAGIC) return(VPSetError(vpc, VPERROR_BAD_FILE)); if (header.major_version != VP_MAJOR_VERSION || header.minor_version != VP_MINOR_VERSION || header.max_fields != VP_MAX_FIELDS || header.max_material != VP_MAX_MATERIAL || header.max_lights != VP_MAX_LIGHTS) { return(VPSetError(vpc, VPERROR_BAD_VALUE)); } /* destroy old data structures */ vpDestroyMinMaxOctree(vpc); vpDestroyClassifiedVolume(vpc); /* load new context */ vpc_size = vpFieldOffset(vpc, end_of_parameters); if (vpc->read_func(fd, vpc, vpc_size) != vpc_size) return(VPSetError(vpc, VPERROR_IO)); vpc->raw_voxels = NULL; for (i = 0; i < VP_MAX_FIELDS; i++) vpc->clsfy_table[i] = NULL; vpc->shade_color_table = NULL; vpc->shade_weight_table = NULL; vpc->image = NULL; if (vpc->shade_func == NULL) vpc->shading_mode = LOOKUP_SHADER; if (!LoadTable(vpc, fd, &vpc->shade_color_table, (unsigned *)&vpc->shade_color_table_size)) goto failed; if (!LoadTable(vpc, fd, &vpc->shade_weight_table, (unsigned *)&vpc->shade_weight_table_size)) goto failed; for (i = 0; i < vpc->num_clsfy_params; i++) { if (!LoadTable(vpc, fd, &vpc->clsfy_table[i], (unsigned *)&vpc->clsfy_table_size[i])) goto failed; } return(VP_OK); failed: if (vpc->shade_color_table != NULL) { Dealloc(vpc, vpc->shade_color_table); vpc->shade_color_table = NULL; } if (vpc->shade_weight_table != NULL) { Dealloc(vpc, vpc->shade_weight_table); vpc->shade_weight_table = NULL; } for (i = 0; i < vpc->num_clsfy_params; i++) { if (vpc->clsfy_table[i] != NULL) { Dealloc(vpc, vpc->clsfy_table[i]); vpc->clsfy_table[i] = NULL; } } return(VPSetError(vpc, VPERROR_IO)); } /* * LoadTable * * Load a table from a file and check for errors. Return value is 1 for * success, 0 for failure. */ static int LoadTable(vpc, fd, ptr_ptr, size_ptr) vpContext *vpc; int fd; float **ptr_ptr; unsigned *size_ptr; { if (vpc->read_func(fd, size_ptr, sizeof(unsigned)) != sizeof(unsigned)) return(0); if (*size_ptr != 0) { Alloc(vpc, *ptr_ptr, float*, *size_ptr, "lookup table"); if (vpc->read_func(fd, *ptr_ptr, *size_ptr) != *size_ptr) return(0); } return(1); } ccseapps-2.5/CCSEApps/volpack/vp_renderB.c0000644000175000017500000006250411634153073021557 0ustar amckinstryamckinstry/* * vp_renderB.c * * Brute-force shear-warp volume rendering algorithm. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:03 $ * $Revision: 1.4 $ */ #include "vp_global.h" static void AffineBruteForceRender ANSI_ARGS((vpContext *vpc)); static void ClassifySlice ANSI_ARGS((vpContext *vpc, int slicenum, float *opc_slice)); static void ShadeSlice ANSI_ARGS((vpContext *vpc, int slicenum, float *clr_slice)); #ifdef FAST_DEPTH_CUEING static void ScaleColors ANSI_ARGS((double scale, float *clr_slice, int width, int height, int color_channels)); #endif static void AlphaScaleColors ANSI_ARGS((float *opc_slice, float *clr_slice, int width, int height, int color_channels)); static void DepthCueSlice ANSI_ARGS((vpContext *vpc, float *clr_slice, int width, int height, int color_channels, double depth_00k, double depth_di, double depth_dj)); static void TranslateSlice ANSI_ARGS((float *opc_slice, float *clr_slice, int width, int height, double WgtTL_d, double WgtBL_d, double WgtTR_d, double WgtBR_d, int color_channels, float *resamp_opc_slice, float *resmp_clr_slice)); static void CompositeSlice ANSI_ARGS((float *resamp_opc, float *resamp_clr, int width, int height, int color_channels, void *int_image_ptr, int int_image_width, double min_opacity)); static void AffineBruteForceWarp ANSI_ARGS((vpContext *vpc)); /* * vpBruteForceRender * * Render an unclassified volume using the basic shear-warp algorithm * without any optimizations (no spatial data structure is used and * coherence is ignored). Use this routine as a standard for * correctness checking. */ vpResult vpBruteForceRender(vpc) vpContext *vpc; { int retcode; /* check for errors and initialize */ if ((retcode = VPCheckRawVolume(vpc)) != VP_OK) return(retcode); if ((retcode = VPCheckClassifier(vpc)) != VP_OK) return(retcode); if ((retcode = VPCheckShader(vpc)) != VP_OK) return(retcode); if ((retcode = VPCheckImage(vpc)) != VP_OK) return(retcode); if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); /* render */ if (vpc->affine_view) AffineBruteForceRender(vpc); else return(VPSetError(vpc, VPERROR_BAD_OPTION)); return(VP_OK); } /* * AffineBruteForceRender * * Render an unclassified volume using the brute-force shear-warp * algorithm for an affine view transformation. */ static void AffineBruteForceRender(vpc) vpContext *vpc; { int icount; /* voxels per voxel scanline */ int jcount; /* voxel scanlines per voxel slice */ int kcount; /* voxel slices in the volume */ int k; /* voxel slice index */ int kstart, kstop; /* values of k for first and last slices */ int kincr; /* value to add to k to get to the next slice (either 1 or -1) */ float slice_u, slice_v; /* sheared object space coordinates of the top-left corner of the current constant-k slice of the volume data */ int slice_u_int; /* integer part of slice_u and slice_v */ int slice_v_int; float slice_u_frac; /* fractional part of slice_u and slice_v */ float slice_v_frac; int slice_start_index; /* index of top-left int. image pixel */ float WgtTL, WgtBL, /* weights in the range 0..1 which give the */ WgtTR, WgtBR; /* fractional contribution of the */ /* neighboring voxels to the current */ /* intermediate image pixel */ int color_channels; /* number of color channels to compute */ float *opc_slice; /* opacities after correction for viewpoint */ float *resamp_opc_slice; /* opacities after resampling */ float *clr_slice; /* colors for current voxel slice */ float *resamp_clr_slice; /* colors after resampling */ #ifdef FAST_DEPTH_CUEING float slice_depth_cueing; /* depth cueing factor for current slice */ float slice_dc_ratio; /* multiplier to get depth cueing factor for the next slice */ #endif void *intim; /* intermediate image pointer */ Debug((vpc, VPDEBUG_RENDER, "Algorithm: affine brute force\n")); /* find size of volume */ switch (vpc->best_view_axis) { case VP_X_AXIS: icount = vpc->ylen; jcount = vpc->zlen; kcount = vpc->xlen; break; case VP_Y_AXIS: icount = vpc->zlen; jcount = vpc->xlen; kcount = vpc->ylen; break; case VP_Z_AXIS: icount = vpc->xlen; jcount = vpc->ylen; kcount = vpc->zlen; break; default: VPBug("invalid viewing axis in AffineBruteForceRender"); } /* initialize intermediate image */ color_channels = vpc->color_channels; vpc->pad_int_to_maxwidth = 0; if (color_channels == 1) { bzero(vpc->int_image.gray_intim, vpc->intermediate_width * vpc->intermediate_height * sizeof(GrayIntPixel)); } else { ASSERT(color_channels == 3); bzero(vpc->int_image.rgb_intim, vpc->intermediate_width * vpc->intermediate_height * sizeof(RGBIntPixel)); } /* allocate memory for shaded and resampled voxel slices */ Alloc(vpc, opc_slice, float *, icount*jcount*sizeof(float), "opc_slice"); Alloc(vpc, resamp_opc_slice, float *, (icount+1)*(jcount+1)*sizeof(float), "resamp_opc_slice"); Alloc(vpc, clr_slice, float *, color_channels*icount*jcount*sizeof(float), "clr_slice"); Alloc(vpc, resamp_clr_slice, float *, color_channels*(icount+1)*(jcount+1)*sizeof(float), "resamp_clr_slice"); #ifdef FAST_DEPTH_CUEING /* initialize depth cueing */ if (vpc->dc_enable) { slice_dc_ratio = VPSliceDepthCueRatio(vpc); slice_depth_cueing = 1.; } #endif /* compute outer loop bounds */ if (vpc->reverse_slice_order) { kstart = kcount-1; kstop = -1; kincr = -1; } else { kstart = 0; kincr = 1; kstop = kcount; } /* loop over slices of the voxel data in front-to-back order */ for (k = kstart; k != kstop; k += kincr) { ReportStatus(vpc, (double)(k - kstart) / (double)(kstop - kstart)); /* compute coordinates of top-left corner of slice in sheared object space */ slice_u = vpc->shear_i * k + vpc->trans_i; slice_v = vpc->shear_j * k + vpc->trans_j; slice_u_int = (int)ceil(slice_u) - 1; slice_v_int = (int)ceil(slice_v) - 1; /* compute resampling weights for this slice */ slice_u_frac = slice_u - slice_u_int; slice_v_frac = slice_v - slice_v_int; WgtTL = slice_u_frac * slice_v_frac; WgtBL = slice_u_frac * ((float)1. - slice_v_frac); WgtTR = ((float)1. - slice_u_frac) * slice_v_frac; WgtBR = ((float)1. - slice_u_frac) * ((float)1. - slice_v_frac); /* classify the slice of voxels */ ClassifySlice(vpc, k, opc_slice); /* shade the slice of voxels */ ShadeSlice(vpc, k, clr_slice); /* perform depth cueing on the slice */ if (vpc->dc_enable) { #ifdef FAST_DEPTH_CUEING ScaleColors(slice_depth_cueing, clr_slice, icount, jcount, color_channels); slice_depth_cueing *= slice_dc_ratio; #else DepthCueSlice(vpc, clr_slice, icount, jcount, color_channels, vpc->depth_000 + k*vpc->depth_dk, vpc->depth_di, vpc->depth_dj); #endif } /* weight the voxels colors by the voxel opacities */ AlphaScaleColors(opc_slice, clr_slice, icount, jcount, color_channels); /* resample the slice of voxels */ TranslateSlice(opc_slice, clr_slice, icount, jcount, WgtTL, WgtBL, WgtTR, WgtBR, color_channels, resamp_opc_slice, resamp_clr_slice); /* composite the slice of resampled voxels */ slice_start_index = slice_u_int + slice_v_int*vpc->intermediate_width; if (color_channels == 1) intim = &vpc->int_image.gray_intim[slice_start_index]; else intim = &vpc->int_image.rgb_intim[slice_start_index]; CompositeSlice(resamp_opc_slice, resamp_clr_slice, icount+1, jcount+1, color_channels, intim, vpc->intermediate_width, vpc->min_opacity); } ReportStatus(vpc, 1.0); #ifdef FAST_DEPTH_CUEING /* depth cue the intermediate image */ if (vpc->dc_enable) VPDepthCueIntImage(vpc, vpc->reverse_slice_order ? kcount-1 : 0); #endif /* warp the intermediate image into the final image */ AffineBruteForceWarp(vpc); /* clean up */ Dealloc(vpc, opc_slice); Dealloc(vpc, resamp_opc_slice); Dealloc(vpc, clr_slice); Dealloc(vpc, resamp_clr_slice); } /* * ClassifySlice * * Classify a slice of voxels. */ static void ClassifySlice(vpc, slicenum, opc_slice) vpContext *vpc; int slicenum; float *opc_slice; { switch (vpc->best_view_axis) { case VP_X_AXIS: VPClassifyBlock(vpc, 1, slicenum, 0, 0, slicenum, vpc->ylen-1, vpc->zlen-1, opc_slice, 0, sizeof(float), vpc->ylen*sizeof(float)); break; case VP_Y_AXIS: VPClassifyBlock(vpc, 1, 0, slicenum, 0, vpc->xlen-1, slicenum, vpc->zlen-1, opc_slice, vpc->zlen*sizeof(float), 0, sizeof(float)); break; case VP_Z_AXIS: VPClassifyBlock(vpc, 1, 0, 0, slicenum, vpc->xlen-1, vpc->ylen-1, slicenum, opc_slice, sizeof(float), vpc->xlen*sizeof(float), 0); break; } } /* * ShadeSlice * * Shade a slice of voxels. */ static void ShadeSlice(vpc, slicenum, clr_slice) vpContext *vpc; int slicenum; float *clr_slice; { int color_bytes; color_bytes = sizeof(float) * vpc->color_channels; switch (vpc->best_view_axis) { case VP_X_AXIS: VPShadeBlock(vpc, slicenum, 0, 0, slicenum, vpc->ylen-1, vpc->zlen-1, clr_slice, 0, color_bytes, vpc->ylen*color_bytes); break; case VP_Y_AXIS: VPShadeBlock(vpc, 0, slicenum, 0, vpc->xlen-1, slicenum, vpc->zlen-1, clr_slice, vpc->zlen*color_bytes, 0, color_bytes); break; case VP_Z_AXIS: VPShadeBlock(vpc, 0, 0, slicenum, vpc->xlen-1, vpc->ylen-1, slicenum, clr_slice, color_bytes, vpc->xlen*color_bytes, 0); break; } } #ifdef FAST_DEPTH_CUEING /* * ScaleColors * * Weight voxel colors by a constant factor for the whole slice. */ static void ScaleColors(scale, clr_slice, width, height, color_channels) double scale; float *clr_slice; int width; int height; int color_channels; { int i, j; float s; s = scale; for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { if (color_channels == 1) { clr_slice[0] *= s; } else { clr_slice[0] *= s; clr_slice[1] *= s; clr_slice[2] *= s; } clr_slice += color_channels; } } } #endif /* * AlphaScaleColors * * Weight voxel colors by voxels opacities. */ static void AlphaScaleColors(opc_slice, clr_slice, width, height, color_channels) float *opc_slice; /* 2D array of opacities (width by height) */ float *clr_slice; /* 2D array of colors (width by height) */ int width; /* size of voxel slice */ int height; int color_channels; /* number of color channels in clr_slice */ { int i, j; for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { if (color_channels == 1) { clr_slice[0] *= opc_slice[0]; } else { clr_slice[0] *= opc_slice[0]; clr_slice[1] *= opc_slice[0]; clr_slice[2] *= opc_slice[0]; } clr_slice += color_channels; opc_slice++; } } } /* * DepthCueSlice * * Apply depth cueing factor to each voxel in a slice. */ static void DepthCueSlice(vpc, clr_slice, width, height, color_channels, depth_00k, depth_di, depth_dj) vpContext *vpc; float *clr_slice; int width; int height; int color_channels; double depth_00k; /* depth of top-left voxel in slice */ double depth_di, depth_dj; /* change in depth for unit change in i/j directions */ { int i, j; double depth, depth_0jk, factor; double dc_front_factor, dc_density; dc_front_factor = vpc->dc_front_factor; dc_density = vpc->dc_density; depth_0jk = depth_00k; for (j = 0; j < height; j++) { depth = depth_0jk; for (i = 0; i < width; i++) { if (depth < 0.0) factor = dc_front_factor * exp(-dc_density); else factor = dc_front_factor * exp(-dc_density * (1.0 - depth)); if (color_channels == 1) { clr_slice[0] *= factor; } else { clr_slice[0] *= factor; clr_slice[1] *= factor; clr_slice[2] *= factor; } clr_slice += color_channels; depth += depth_di; } depth_0jk += depth_dj; } } /* * TranslateSlice * * Translate and resample a slice of voxels. */ static void TranslateSlice(opc_slice, clr_slice, width, height, WgtTL_d, WgtBL_d, WgtTR_d, WgtBR_d, color_channels, resamp_opc_slice, resamp_clr_slice) float *opc_slice; /* 2D array of opacities (width by height) */ float *clr_slice; /* 2D array of colors (width by height) */ int width; /* size of voxel slice */ int height; double WgtTL_d; /* resampling weights */ double WgtBL_d; double WgtTR_d; double WgtBR_d; int color_channels; /* number of color channels in clr_slice */ float *resamp_opc_slice;/* 2D array for storing resampled opacities (width+1 by height+1) */ float *resamp_clr_slice;/* 2D array for storing resampled colors (width+1 by height+1) */ { int i, j; float WgtTL, WgtBL, WgtTR, WgtBR; float OpcAcc, RClrAcc, GClrAcc, BClrAcc; WgtTL = WgtTL_d; WgtBL = WgtBL_d; WgtTR = WgtTR_d; WgtBR = WgtBR_d; for (j = 0; j <= height; j++) { for (i = 0; i <= width; i++) { OpcAcc = 0.; RClrAcc = 0.; GClrAcc = 0.; BClrAcc = 0.; if (i > 0 && j > 0) { OpcAcc += WgtTL * opc_slice[-1-width]; if (color_channels == 1) { RClrAcc += WgtTL * clr_slice[-1-width]; } else { RClrAcc += WgtTL * clr_slice[3*(-1-width)]; GClrAcc += WgtTL * clr_slice[3*(-1-width)+1]; BClrAcc += WgtTL * clr_slice[3*(-1-width)+2]; } } if (i > 0 && j < height) { OpcAcc += WgtBL * opc_slice[-1]; if (color_channels == 1) { RClrAcc += WgtBL * clr_slice[-1]; } else { RClrAcc += WgtBL * clr_slice[3*(-1)]; GClrAcc += WgtBL * clr_slice[3*(-1)+1]; BClrAcc += WgtBL * clr_slice[3*(-1)+2]; } } if (i < width && j > 0) { OpcAcc += WgtTR * opc_slice[-width]; if (color_channels == 1) { RClrAcc += WgtTR * clr_slice[-width]; } else { RClrAcc += WgtTR * clr_slice[3*(-width)]; GClrAcc += WgtTR * clr_slice[3*(-width)+1]; BClrAcc += WgtTR * clr_slice[3*(-width)+2]; } } if (i < width && j < height) { OpcAcc += WgtBR * opc_slice[0]; if (color_channels == 1) { RClrAcc += WgtBR * clr_slice[0]; } else { RClrAcc += WgtBR * clr_slice[3*(0)]; GClrAcc += WgtBR * clr_slice[3*(0)+1]; BClrAcc += WgtBR * clr_slice[3*(0)+2]; } } *resamp_opc_slice = OpcAcc; if (color_channels == 1) { *resamp_clr_slice = RClrAcc; } else { resamp_clr_slice[0] = RClrAcc; resamp_clr_slice[1] = GClrAcc; resamp_clr_slice[2] = BClrAcc; } resamp_opc_slice++; resamp_clr_slice += color_channels; if (i != width) { opc_slice++; clr_slice += color_channels;; } } } } /* * CompositeSlice * * Composite a resampled slice of voxels into the intermediate image. */ static void CompositeSlice(resamp_opc, resamp_clr, width, height, color_channels, int_image_ptr, int_image_width, min_opacity) float *resamp_opc; /* array of resampled opacities (width by height) */ float *resamp_clr; /* array of resampled colors (width by height) */ int width; /* size of resampled voxel arrays */ int height; int color_channels; /* number of color channels */ void *int_image_ptr; /* pointer to intermediate image pixel corresponding to top-left resampled voxel */ int int_image_width; /* number of pixels in intermediate image scanline */ double min_opacity; /* low opacity threshold */ { int i, j; float old_opc, old_r, old_g, old_b; float new_opc, new_r, new_g, new_b; GrayIntPixel *gray_intim; RGBIntPixel *rgb_intim; if (color_channels == 1) gray_intim = (GrayIntPixel*)int_image_ptr; else rgb_intim = (RGBIntPixel*)int_image_ptr; for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { if (*resamp_opc > min_opacity) { if (color_channels == 1) { old_opc = gray_intim->opcflt; old_r = gray_intim->clrflt; new_opc = old_opc + *resamp_opc * ((float)1. - old_opc); new_r = old_r + *resamp_clr * ((float)1. - old_opc); gray_intim->opcflt = new_opc; gray_intim->clrflt = new_r; } else { old_opc = rgb_intim->opcflt; old_r = rgb_intim->rclrflt; old_g = rgb_intim->gclrflt; old_b = rgb_intim->bclrflt; new_opc = old_opc + *resamp_opc * ((float)1. - old_opc); new_r = old_r + resamp_clr[0] * ((float)1. - old_opc); new_g = old_g + resamp_clr[1] * ((float)1. - old_opc); new_b = old_b + resamp_clr[2] * ((float)1. - old_opc); rgb_intim->opcflt = new_opc; rgb_intim->rclrflt = new_r; rgb_intim->gclrflt = new_g; rgb_intim->bclrflt = new_b; } } resamp_opc++; if (color_channels == 1) { resamp_clr++; gray_intim++; } else { resamp_clr += 3; rgb_intim++; } } /* for i */ if (color_channels == 1) gray_intim += int_image_width - width; else rgb_intim += int_image_width - width; } /* for j */ } /* * AffineBruteForceWarp * * Warp the intermediate image into the final image (brute-force version, * affine transformations only). */ static void AffineBruteForceWarp(vpc) vpContext *vpc; { unsigned char *int_image; /* pointer to start of intermediate image (GrayIntPixel or RGBIntPixel) */ int int_width; /* size of intermediate image */ int int_height; int int_scanbytes; /* bytes per scanline in intermediate image */ unsigned char *image; /* final image pixel */ int i, j; /* coordinates of final image pixel */ float int_i_flt, int_j_flt; /* position of final image pixel in intermediate image coordinates */ float int_i_int, int_j_int; /* truncated int_i_flt, int_j_flt */ int int_i, int_j; /* integer int_i_int, int_j_int */ double alpha_i, alpha_j; /* separable interpolation weights */ double wgt; /* interpolation weight */ GrayIntPixel *gray_pix; /* intermediate image pixel (grayscale) */ RGBIntPixel *rgb_pix; /* intermediate image pixel (RGB) */ double denom; double ma, mb, mc, md, me, mf; float r, g, b, alpha; int r_int, g_int, b_int, alpha_int; int color_channels; /* number of color channels in int. image */ int pixel_type; /* type of output image pixel */ /* initialize */ color_channels = vpc->color_channels; pixel_type = vpc->pixel_type; int_width = vpc->intermediate_width; int_height = vpc->intermediate_height; if (vpc->color_channels == 1) { int_image = (unsigned char *)vpc->int_image.gray_intim; if (vpc->pad_int_to_maxwidth) int_scanbytes = vpc->max_intermediate_width*sizeof(GrayIntPixel); else int_scanbytes = vpc->intermediate_width*sizeof(GrayIntPixel); } else { int_image = (unsigned char *)vpc->int_image.rgb_intim; if (vpc->pad_int_to_maxwidth) int_scanbytes = vpc->max_intermediate_width*sizeof(RGBIntPixel); else int_scanbytes = vpc->intermediate_width*sizeof(RGBIntPixel); } /* compute transformation from final image pixel to intermediate image pixel */ denom = 1. / (vpc->warp_2d[0][0]*vpc->warp_2d[1][1] - vpc->warp_2d[0][1]*vpc->warp_2d[1][0]); ma = vpc->warp_2d[1][1] * denom; mb = -vpc->warp_2d[0][1] * denom; mc = (vpc->warp_2d[0][1]*vpc->warp_2d[1][2] - vpc->warp_2d[1][1]*vpc->warp_2d[0][2]) * denom; md = -vpc->warp_2d[1][0] * denom; me = vpc->warp_2d[0][0] * denom; mf = (vpc->warp_2d[1][0]*vpc->warp_2d[0][2] - vpc->warp_2d[0][0]*vpc->warp_2d[1][2]) * denom; /* loop over the pixels of the final image */ for (j = 0; j < vpc->image_height; j++) { image = (unsigned char *)vpc->image + j*vpc->image_bytes_per_scan; for (i = 0; i < vpc->image_width; i++) { /* reverse-map final image pixel into intermediate image */ int_i_flt = ma*i + mb*j + mc; int_j_flt = md*i + me*j + mf; /* compute interpolation weights */ int_i_int = floor(int_i_flt); int_j_int = floor(int_j_flt); alpha_i = int_i_flt - int_i_int; alpha_j = int_j_flt - int_j_int; int_i = (int)int_i_int; int_j = (int)int_j_int; /* interpolate */ r = 0; g = 0; b = 0; alpha = 0; if (int_i >= 0 && int_i < int_width && int_j >= 0 && int_j < int_height) { wgt = (1. - alpha_i) * (1. - alpha_j); if (color_channels == 1) { gray_pix = (GrayIntPixel *)(int_image + int_j* int_scanbytes) + int_i; r += gray_pix->clrflt*wgt; alpha += gray_pix->opcflt*wgt; } else { rgb_pix = (RGBIntPixel *)(int_image + int_j* int_scanbytes) + int_i; r += rgb_pix->rclrflt*wgt; g += rgb_pix->gclrflt*wgt; b += rgb_pix->bclrflt*wgt; alpha += rgb_pix->opcflt*wgt; } } if (int_i >= 0 && int_i < int_width && int_j >= -1 && int_j < int_height-1) { wgt = (1. - alpha_i) * alpha_j; if (color_channels == 1) { gray_pix = (GrayIntPixel *)(int_image + (int_j+1)* int_scanbytes) + int_i; r += gray_pix->clrflt*wgt; alpha += gray_pix->opcflt*wgt; } else { rgb_pix = (RGBIntPixel *)(int_image + (int_j+1)* int_scanbytes) + int_i; r += rgb_pix->rclrflt*wgt; g += rgb_pix->gclrflt*wgt; b += rgb_pix->bclrflt*wgt; alpha += rgb_pix->opcflt*wgt; } } if (int_i >= -1 && int_i < int_width-1 && int_j >= 0 && int_j < int_height) { wgt = alpha_i * (1. - alpha_j); if (color_channels == 1) { gray_pix = (GrayIntPixel *)(int_image + int_j* int_scanbytes) + int_i+1; r += gray_pix->clrflt*wgt; alpha += gray_pix->opcflt*wgt; } else { rgb_pix = (RGBIntPixel *)(int_image + int_j* int_scanbytes) + int_i+1; r += rgb_pix->rclrflt*wgt; g += rgb_pix->gclrflt*wgt; b += rgb_pix->bclrflt*wgt; alpha += rgb_pix->opcflt*wgt; } } if (int_i >= -1 && int_i < int_width-1 && int_j >= -1 && int_j < int_height-1) { wgt = alpha_i * alpha_j; if (color_channels == 1) { gray_pix = (GrayIntPixel *)(int_image + (int_j+1)* int_scanbytes) + int_i+1; r += gray_pix->clrflt*wgt; alpha += gray_pix->opcflt*wgt; } else { rgb_pix = (RGBIntPixel *)(int_image + (int_j+1)* int_scanbytes) + int_i+1; r += rgb_pix->rclrflt*wgt; g += rgb_pix->gclrflt*wgt; b += rgb_pix->bclrflt*wgt; alpha += rgb_pix->opcflt*wgt; } } /* clamp the pixel */ if (alpha > 255.) alpha_int = 255; else if (alpha < 0.) alpha_int = 0; else alpha_int = alpha; if (r > 255.) r_int = 255; else if (r < 0) r_int = 0; else r_int = r; if (color_channels == 3) { if (g > 255.) g_int = 255; else if (g < 0.) g_int = 0; else g_int = g; if (b > 255.) b_int = 255; else if (b < 0.) b_int = 0; else b_int = b; } /* store the pixel */ switch (pixel_type) { case VP_ALPHA: *image++ = alpha_int; break; case VP_LUMINANCE: *image++ = r_int; break; case VP_LUMINANCEA: *image++ = r_int; *image++ = alpha_int; break; case VP_RGB: *image++ = r_int; *image++ = g_int; *image++ = b_int; break; case VP_RGBA: *image++ = r_int; *image++ = g_int; *image++ = b_int; *image++ = alpha_int; break; case VP_BGR: *image++ = b_int; *image++ = g_int; *image++ = r_int; break; case VP_ABGR: *image++ = alpha_int; *image++ = b_int; *image++ = g_int; *image++ = r_int; break; default: VPBug("bad pixel type"); } } /* for i */ } /* for j */ } #if 0 && defined(DEBUG) void StoreFloatImage(data, width, height, scale, filename) float *data; /* array of input data */ int width, height; /* size of array */ double scale; /* factor for scaling pixel values */ char *filename; /* name of file to store result */ { unsigned char *image, *imptr; int i, j; image = (unsigned char *)malloc(width*height); imptr = image; for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { *imptr++ = (int)rint(scale * *data++); } } VprWriteGrayscaleTIFF(filename, width, height, width, image); free(image); } #endif ccseapps-2.5/CCSEApps/volpack/vp_CompA.m40000644000175000017500000016544711634153073021305 0ustar amckinstryamckinstry/* * vp_compA.m4 * * Compositing routine for affine viewing transformations. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:02 $ * $Revision: 1.3 $ */ #include "vp_global.h" dnl Description: dnl This is an m4 source file which defines a C procedure to resample dnl and composite one slice of a volume. The macro definitions allow dnl the procedure to be specialized for a particular volume data dnl structure (run-length encoded classified volume, or unclassified dnl volume with or without a min-max octree), a particular number of dnl color channels (1 or 3), and a particular number of material types. dnl The definitions are a bit messy, but they keep the body of the dnl procedure pretty clean. Inlined procedures would be better but dnl many compilers do not support them. dnl dnl To produce a C source file, run this file through m4 with the dnl following m4 macros defined: dnl dnl FuncName name of the C function to produce dnl VolumeType "rlevolume" or "rawvolume" dnl ColorChannels number of color channels (1 or 3) dnl NumMaterials number of materials (a small integer or "n" dnl for a routine which handles any number) dnl dnl OR, define "SourceFile" to be a file name of the form dnl vp_compA????.c dnl where the four wildcard characters (call them W, X, Y and Z) dnl can have the following values: dnl W: volume type ("C" for classified volumes, "R" for raw volumes) dnl X: number of color channels ("1" for grayscale, "3" for RGB) dnl Y: number of materials ("1", "2", "N" for any number, "P" for dnl callback procedure to replace the material shading model) dnl Z: special options ("S" for rendering shadows, "G" for dnl generating shadow buffer, "N" for nearest-neighbor filter, dnl "I" to use index volume, "B" for normal case (bilinear dnl filter, no shadows, no index volume) dnl ifdef(`SourceFile', ` define(FuncNameStr, `substr(SourceFile, 7, 5)') define(VolumeTypeChar, `substr(SourceFile, 8, 1)') define(ColorChannels, `substr(SourceFile, 9, 1)') define(NumMaterials, `substr(SourceFile, 10, 1)') define(SpecialChar, `substr(SourceFile, 11, 1)') define(FuncName, `VPComp'FuncNameStr()) ifelse(VolumeTypeChar, `C', `define(VolumeType, `rlevolume')', VolumeTypeChar, `R', `define(VolumeType, `rawvolume')') ifelse(SpecialChar, `S', ` #define USE_SHADOW_BUFFER define(ShadowBuffer)') ifelse(SpecialChar, `G', ` #define COMPUTE_SHADOW_BUFFER') ifelse(SpecialChar, `I', ` define(`IndexVolume')') ') dnl Turn off unrolling of the run loop for the non-specialized routines. ifelse(NumMaterials, `N', `#undef UNROLL_RUN_LOOP', NumMaterials, `P', `#undef UNROLL_RUN_LOOP') dnl dnl LoadTopLeft() dnl dnl Load, classify and shade the voxel above and left of the current pixel. dnl define(LoadTopLeft, ` ClassifyVox(top_opc, topRLEdata - voxel_istride); ShadeVox(top, topRLEdata - voxel_istride)') dnl dnl LoadTopRight() dnl dnl Load, classify and shade the voxel above and right of the current pixel. dnl define(LoadTopRight, ` ClassifyVox(top_opc, topRLEdata); ShadeVox(top, topRLEdata)') dnl dnl LoadBotLeft() dnl dnl Load, classify and shade the voxel below and left of the current pixel. dnl define(LoadBotLeft, ` ClassifyVox(bot_opc, botRLEdata - voxel_istride); ShadeVox(bot, botRLEdata - voxel_istride)') dnl dnl LoadBotRight() dnl dnl Load, classify and shade the voxel below and right of the current pixel. dnl define(LoadBotRight, ` ClassifyVox(bot_opc, botRLEdata); ShadeVox(bot, botRLEdata)') dnl dnl ShadeVox(scan, voxel) dnl dnl Shade the voxel pointed to by "voxel" and store the result in the dnl color variables for scanline scan (either "top" or "bot"). dnl define(ShadeVox, ` ifelse(ColorChannels, 0, `', ` ComputeShadeIndex($2); ComputeWeightIndex($2); CallShader($1, $2); shade_factor = $1_opc * slice_depth_cueing; AttenuateColor($1); AttenuateShadowColor($1)')') dnl dnl ComputeShadeIndex(voxel) dnl dnl Compute the offset into the shade and shadow tables for the specified dnl voxel. dnl define(ComputeShadeIndex, ifelse(NumMaterials, `P', `', `shade_index=MaterialCount()*ColorChannels()*ShortField($1,norm_offset)')) dnl dnl ComputeWeightIndex(voxel) dnl dnl Compute the offset into the material weight table for the specified dnl voxel. dnl define(ComputeWeightIndex, ifelse(NumMaterials, `P', `', NumMaterials, `1', `', `weight_index = MaterialCount() * ByteField($1, wgt_offset)')) dnl dnl MaterialCount() dnl dnl Return the number of materials, as a constant if possible. dnl define(MaterialCount, `ifelse(NumMaterials, `N', `num_materials', NumMaterials)') dnl dnl CallShader(scan, voxel) dnl dnl Invoke the appropriate shader code to compute the color of the dnl voxel pointed to by "voxel". Store the result in the dnl color variables for scanline scan (either "top" or "bot"). dnl ifelse(NumMaterials, `P', `ifelse(ColorChannels, 1, `define(CallShader, `shade_func($2, &($1_clr), client_data)')', `define(CallShader, `shade_func($2, &($1_rclr), &($1_gclr), &($1_bclr), client_data)')')', NumMaterials, `1', `define(CallShader, `ShadeMaterial($1, 0, =)')', NumMaterials, `2', `define(CallShader, ` ShadeMaterial($1, 0, =); ShadeMaterial($1, 1, +=)')', `define(CallShader, ` ShadeMaterial($1, 0, =); for (m = 1; m < num_materials; m++) { ShadeMaterial($1, m, +=); }')') dnl Preprocessor definitions that cause local variables specific to the dnl shader to be allocated. ifelse(NumMaterials, 1, , NumMaterials, `P', ` #define CALLBACK', ` #define MULTIPLE_MATERIALS') dnl dnl ShadeMaterial(scan, material, op) dnl dnl Compute the contribution of material number "material" to the dnl color of the current voxel. The result is stored in the color dnl variables for scanline scan (either "top" or "bot") using dnl operation op ("=" or "+="). dnl ifelse(ColorChannels, 1, `define(ShadeMaterial, ` ShadeComponent($1_clr, $2, $3, 0); ShadeShadowComponent($1_sclr, $2, $3, 0)')', `define(ShadeMaterial, ` ShadeComponent($1_rclr, $2, $3, 0); ShadeComponent($1_gclr, $2, $3, 1); ShadeComponent($1_bclr, $2, $3, 2); ShadeShadowComponent($1_rsclr, $2, $3, 0); ShadeShadowComponent($1_gsclr, $2, $3, 1); ShadeShadowComponent($1_bsclr, $2, $3, 2)')') dnl dnl ShadeComponent(dst, material, op, component) dnl dnl Compute the contribution of material number "material" to channel dnl number "component" (0 = red, 1 = green, 2 = blue) of the dnl color of the current voxel. The result is stored in dst using dnl operator "op" ("=" or "+="). This macro uses non-shadow lighting only. dnl define(ShadeComponent, ` $1 $3 ShadeLookup($2, $4) * MaterialWeight($2)') dnl dnl ShadeLookup(material, component) dnl dnl Compute the contribution of material number "material" to channel dnl number "component" (0 = red, 1 = green, 2 = blue) of the current dnl voxel (which determines the contents of shade_index). Use the dnl value in the shading lookup table (which does not contain the dnl contribution of lights that may produce shadows). The result is dnl returned. dnl define(ShadeLookup, ` shade_table[shade_index + ColorChannels*$1 + $2]') dnl dnl ShadeShadowComponent(dst, material, op, component) dnl dnl Compute the contribution of material number "material" to channel dnl number "component" (0 = red, 1 = green, 2 = blue) of the dnl color of the current voxel. The result is stored in dst using dnl operator "op" ("=" or "+="). This macro uses shadow lighting only. dnl ifdef(`ShadowBuffer', `define(ShadeShadowComponent, ` $1 $3 ShadowLookup($2, $4) * MaterialWeight($2)')', `define(ShadeShadowComponent, `')') dnl dnl ShadowLookup(material, component) dnl dnl Compute the contribution of material number "material" to channel dnl number "component" (0 = red, 1 = green, 2 = blue) of the current dnl voxel (which determines the contents of shade_index). Use the dnl value in the shadow lookup table (which contains only the dnl contribution of lights that may produce shadows). The result is dnl returned. dnl define(ShadowLookup, ` shadow_table[shade_index + ColorChannels*$1 + $2]') dnl dnl MaterialWeight(material) dnl dnl Return the weight associated with the specified material number dnl for the current voxel. dnl ifelse( NumMaterials, 1, `define(MaterialWeight, `(float)1.0')', NumMaterials, `N', `define(MaterialWeight, ` ifelse($1, 0, `((num_materials > 1) ? weight_table[weight_index] : (float)1.0)', `weight_table[weight_index + $1]')')', `define(MaterialWeight, `weight_table[weight_index + $1]')') dnl dnl AttenuateColor(scan) dnl dnl Scale the color for the current voxel in scanline scan ("top" or "bot") dnl by the current shading factor (the voxel's opacity multiplied by dnl the depth cueing factor). This macro uses non-shadow lighting only. dnl ifelse(ColorChannels, 1, `define(AttenuateColor, ` $1_clr *= shade_factor')', `define(AttenuateColor, ` $1_rclr *= shade_factor; $1_gclr *= shade_factor; $1_bclr *= shade_factor')') dnl dnl AttenuateShadowColor(scan) dnl dnl Scale the color for the current voxel in scanline scan ("top" or "bot") dnl by the current shading factor (the voxel's opacity multiplied by dnl the depth cueing factor). This macro uses shadow lighting only. dnl ifdef(`ShadowBuffer', `ifelse(ColorChannels, 1, `define(AttenuateShadowColor, ` $1_sclr *= shade_factor')', `define(AttenuateShadowColor, ` $1_rsclr *= shade_factor; $1_gsclr *= shade_factor; $1_bsclr *= shade_factor')')', `define(AttenuateShadowColor, `')') dnl dnl ClearAccum() dnl dnl Clear the voxel opacity/color accumulator. dnl define(ClearAccum, ` acc_opc = 0; ClearColorAccum()') dnl dnl Accum(scan, wgt, op) dnl dnl Accumulate opacity and color for scan (either "top" or "bot") dnl weighted by one of the four weights ("TL", "BL", "TR" or "BR") using dnl operation op ("+=" or "="). dnl define(Accum, ` acc_opc $3 $1_opc * wgt$2; AccumColor($1, $2, $3); Trace($1, $2)') dnl dnl Composite() dnl dnl Composite the current resampled voxel. dnl define(Composite, ` COUNT_RESAMPLE; if (acc_opc > min_opacity) { COUNT_COMPOSITE; iopc = ipixel->opcflt; # ifndef SKIP_ERT ASSERT(iopc < max_opacity); # endif iopc_inv = (float)1. - iopc; CompositeColor(); iopc += acc_opc * iopc_inv; ipixel->opcflt = iopc; PrintTrace(); # ifndef SKIP_ERT if (iopc >= max_opacity) { ASSERT(ipixel->lnk == 0); ipixel->lnk = 1; } # endif }') dnl dnl NextIntPixel(c) dnl dnl Increment intermediate image pointer by c pixels. dnl ifdef(`ShadowBuffer', `define(NextIntPixel, `ipixel += $1; shadow_pixel += $1')', `define(NextIntPixel, `ipixel += $1')') dnl dnl Macros that depend on the number of color channels: dnl IntPixelType type of an intermediate image pixel dnl (GrayIntPixel or RGBIntPixel) dnl ClearColorAccum clear the pixel color accumulator dnl AccumColor(scan, wgt, op) dnl accumulate color for scan (either "top" dnl or "bot") weighted by one of the four dnl weights ("TL", "BL", "TR" or "BR") using dnl operation op ("+=" or "=") dnl CompositeColor composite color for current resampled voxel dnl shadow buffer (0 color channels) ifelse(ColorChannels, 0, ` define(IntPixelType, `GrayIntPixel') define(ClearColorAccum, `') define(AccumColor, `') define(CompositeColor, `')') dnl grayscale image (1 color channel) ifelse(ColorChannels, 1, ` #define GRAYSCALE define(IntPixelType, `GrayIntPixel') define(ClearColorAccum, `acc_clr = 0') ifdef(`ShadowBuffer', `define(AccumColor, `acc_clr $3 ($1_clr + $1_sclr * ((float)1.0 - shadow_pixel->opcflt)) * wgt$2')', `define(AccumColor, `acc_clr $3 $1_clr * wgt$2')') define(CompositeColor, `ipixel->clrflt += acc_clr * iopc_inv')') dnl RGB image (3 color channels) ifelse(ColorChannels, 3, ` #define RGB define(IntPixelType, `RGBIntPixel') define(ClearColorAccum, `acc_rclr = acc_gclr = acc_bclr = 0') ifdef(`ShadowBuffer', `define(AccumColor, ` acc_rclr $3 ($1_rclr + $1_rsclr * ((float)1.0 - shadow_pixel->opcflt)) * wgt$2; acc_gclr $3 ($1_gclr + $1_gsclr * ((float)1.0 - shadow_pixel->opcflt)) * wgt$2; acc_bclr $3 ($1_bclr + $1_bsclr * ((float)1.0 - shadow_pixel->opcflt)) * wgt$2')', `define(AccumColor, ` acc_rclr $3 $1_rclr * wgt$2; acc_gclr $3 $1_gclr * wgt$2; acc_bclr $3 $1_bclr * wgt$2')') define(CompositeColor, ` ipixel->rclrflt += acc_rclr * iopc_inv; ipixel->gclrflt += acc_gclr * iopc_inv; ipixel->bclrflt += acc_bclr * iopc_inv')') dnl dnl Macros that depend on the type of volume data structure: dnl VolumeArgs list of function arguments for volume data dnl VolumeArgsDecl declaration of VolumeArgs dnl NextNonZeroTopVoxel(c) increment top voxel ptr. by c nonzero voxels dnl NextZeroTopVoxel(c) increment top voxel ptr. by c zero voxels dnl NextNonZeroBotVoxel(c) increment bot voxel ptr. by c nonzero voxels dnl NextZeroBotVoxel(c) increment bot voxel ptr. by c zero voxels dnl ClassifyVox(opc, vox) classify a voxel and store the result in opc dnl dnl rlevolume (run-length encoded volume) ifelse(VolumeType, `rlevolume', ` #define RLEVOLUME define(VolumeArgs, `run_lengths, voxel_data') define(VolumeArgsDecl, ` unsigned char *run_lengths; /* run lengths for slice */ void *voxel_data; /* voxel data for slice */') define(NextNonZeroTopVoxel, `topRLEdata += $1 * voxel_istride') define(NextZeroTopVoxel, `') define(NextNonZeroBotVoxel, `botRLEdata += $1 * voxel_istride') define(NextZeroBotVoxel, `') define(ClassifyVox, `$1 = opac_correct[ByteField($2, voxel_istride-1)]')') dnl rawvolume (3D volume array, optionally with a min-max octree) ifelse(VolumeType, `rawvolume', ` #define RAWVOLUME define(VolumeArgs, `voxel_data, voxel_istride, voxel_jstride') define(VolumeArgsDecl, ` void *voxel_data; /* voxel data for slice */ int voxel_istride; /* strides for voxel data */ int voxel_jstride;') define(NextNonZeroTopVoxel, `topRLEdata += $1 * voxel_istride') define(NextZeroTopVoxel, `topRLEdata += $1 * voxel_istride') define(NextNonZeroBotVoxel, `botRLEdata += $1 * voxel_istride') define(NextZeroBotVoxel, `botRLEdata += $1 * voxel_istride') define(ClassifyVox, ` opac_param = VoxelField($2, param0_offset, param0_size); opacity = param0_table[opac_param]; if (param1_size != 0) { opac_param = VoxelField($2, param1_offset, param1_size); opacity *= param1_table[opac_param]; if (param2_size != 0) { opac_param = VoxelField($2, param2_offset, param2_size); opacity *= param2_table[opac_param]; } } if (opacity > min_opacity) { opacity_int = opacity*255.; $1 = opac_correct[opacity_int]; } else { $1 = (float)0.; }')') dnl rlevolume + IndexVolume (experimental data structure that contains dnl a mapping from voxel coordinates to location of voxel in rlevolume) ifdef(`IndexVolume', ` #define INDEX_VOLUME define(`VolumeArgs', `run_lengths, voxel_data, voxel_index') define(`VolumeArgsDecl', ` unsigned char *run_lengths; /* run lengths for slice */ void *voxel_data; /* voxel data for slice */ VoxelLocation *voxel_index; /* index for ERT */')', ` #undef INDEX_VOLUME') dnl dnl Macros for rendering shadows: dnl ShadowArgs list of function arguments for shadow buffer dnl ShadowArgsDecl declaration of ShadowArgs dnl ifdef(`ShadowBuffer', ` define(ShadowArgs, `, shadow_buffer') define(ShadowArgsDecl, `GrayIntPixel *shadow_buffer;')',` define(ShadowArgs, `') define(ShadowArgsDecl, `')') dnl dnl Macros for pixel tracing (a printout of all of the voxels and dnl filter weights that contribute to one intermediate image pixel). dnl dnl dnl NewPixel() dnl dnl Prepare to process a new pixel by clearing tracing buffers. dnl define(NewPixel, ` #ifdef DEBUG if (ipixel == trace_pixel_ptr) { trace_opcTL = 0.; trace_opcBL = 0.; trace_opcTR = 0.; trace_opcBR = 0.; trace_rsclrTL=0.; trace_rsclrBL=0.; trace_rsclrTR=0.; trace_rsclrBR=0.; trace_rclrTL= 0.; trace_rclrBL= 0.; trace_rclrTR= 0.; trace_rclrBR= 0.; trace_gclrTL= 0.; trace_gclrBL= 0.; trace_gclrTR= 0.; trace_gclrBR= 0.; trace_bclrTL= 0.; trace_bclrBL= 0.; trace_bclrTR= 0.; trace_bclrBR= 0.; } #endif ') dnl dnl Trace(scan, wgt) dnl dnl Store voxel opacity and color from the specified scanline ("top" or "bot") dnl in the tracing buffer associated with the specified weight ("TR", "BR", dnl "TL", "BL"). dnl define(Trace, ` #ifdef DEBUG if (ipixel == trace_pixel_ptr) { trace_opc$2 = $1_opc; ifelse(ColorChannels, 1, `trace_rclr$2 = $1_clr;', ColorChannels, 3, `trace_rclr$2 = $1_rclr; trace_gclr$2 = $1_gclr; trace_bclr$2 = $1_bclr;') ifdef(`ShadowBuffer', `ifelse(ColorChannels, 1, `trace_rsclr$2 = $1_sclr;')') } #endif ') dnl dnl PrintTrace() dnl dnl Print one line of the trace. dnl define(PrintTrace, ` #ifdef DEBUG if (ipixel == trace_pixel_ptr) { #ifdef COMPUTE_SHADOW_BUFFER printf("{%3d} %3d %3d", k, icount-i-count, j); #else printf("[%3d] %3d %3d", k, icount-i-count, j); #endif printf(" %3.0f %3.0f %3.0f",trace_opcTL*255.,trace_rclrTL,wgtTL*100.); printf(" %3.0f %3.0f %3.0f",trace_opcBL*255.,trace_rclrBL,wgtBL*100.); printf(" %3.0f %3.0f %3.0f",trace_opcTR*255.,trace_rclrTR,wgtTR*100.); printf(" %3.0f %3.0f %3.0f",trace_opcBR*255.,trace_rclrBR,wgtBR*100.); printf(" %3.0f %3.0f\n", iopc*255., ifelse(ColorChannels, 3, `ipixel->rclrflt', ColorChannels, 1, `ipixel->clrflt', `0')); ifdef(`ShadowBuffer', ` printf(" "); printf(" %3.0f ",trace_rsclrTL); printf(" %3.0f ",trace_rsclrBL); printf(" %3.0f ",trace_rsclrTR); printf(" %3.0f ",trace_rsclrBR); printf(" %3.0f\n", shadow_pixel->opcflt * 255.);') ifelse(ColorChannels, 3, ` printf(" "); printf(" %3.0f ",trace_gclrTL); printf(" %3.0f ",trace_gclrBL); printf(" %3.0f ",trace_gclrTR); printf(" %3.0f ",trace_gclrBR); printf(" %3.0f\n", ipixel->gclrflt); printf(" "); printf(" %3.0f ",trace_bclrTL); printf(" %3.0f ",trace_bclrBL); printf(" %3.0f ",trace_bclrTR); printf(" %3.0f ",trace_bclrBR); printf(" %3.0f\n", ipixel->bclrflt);') } #endif /* DEBUG */ ') /* codes indicating the types of a pair of runs in adjacent scanlines */ #define ALL_ZERO 0 /* both runs are runs of zeros */ #define TOP_NONZERO 1 /* run for top scanline has nonzero data */ #define BOT_NONZERO 2 /* run for bottom scanline has nonzero data */ #define ALL_NONZERO 3 /* both runs have nonzero data */ /* codes indicating the types for the current left and right voxel pairs */ #define ALL_ZERO__ALL_ZERO ((ALL_ZERO << 2) | ALL_ZERO) #define ALL_ZERO__TOP_NONZERO ((ALL_ZERO << 2) | TOP_NONZERO) #define ALL_ZERO__BOT_NONZERO ((ALL_ZERO << 2) | BOT_NONZERO) #define ALL_ZERO__ALL_NONZERO ((ALL_ZERO << 2) | ALL_NONZERO) #define TOP_NONZERO__ALL_ZERO ((TOP_NONZERO << 2) | ALL_ZERO) #define TOP_NONZERO__TOP_NONZERO ((TOP_NONZERO << 2) | TOP_NONZERO) #define TOP_NONZERO__BOT_NONZERO ((TOP_NONZERO << 2) | BOT_NONZERO) #define TOP_NONZERO__ALL_NONZERO ((TOP_NONZERO << 2) | ALL_NONZERO) #define BOT_NONZERO__ALL_ZERO ((BOT_NONZERO << 2) | ALL_ZERO) #define BOT_NONZERO__TOP_NONZERO ((BOT_NONZERO << 2) | TOP_NONZERO) #define BOT_NONZERO__BOT_NONZERO ((BOT_NONZERO << 2) | BOT_NONZERO) #define BOT_NONZERO__ALL_NONZERO ((BOT_NONZERO << 2) | ALL_NONZERO) #define ALL_NONZERO__ALL_ZERO ((ALL_NONZERO << 2) | ALL_ZERO) #define ALL_NONZERO__TOP_NONZERO ((ALL_NONZERO << 2) | TOP_NONZERO) #define ALL_NONZERO__BOT_NONZERO ((ALL_NONZERO << 2) | BOT_NONZERO) #define ALL_NONZERO__ALL_NONZERO ((ALL_NONZERO << 2) | ALL_NONZERO) #ifdef SKIP_ERT #define PIXEL_IS_OPAQUE(ipixel) 0 #else #define PIXEL_IS_OPAQUE(ipixel) ((ipixel)->lnk != 0) #endif #ifdef STATISTICS extern int vpResampleCount; extern int vpCompositeCount; extern int vpERTSkipCount; extern int vpERTSkipAgainCount; extern int vpERTUpdateCount; extern int vpSpecialZeroSkipCount; extern int vpRunFragmentCount; #define COUNT_RESAMPLE vpResampleCount++ #define COUNT_COMPOSITE vpCompositeCount++ #define COUNT_ERT_SKIP vpERTSkipCount++ #define COUNT_ERT_SKIP_AGAIN vpERTSkipAgainCount++ #define COUNT_ERT_UPDATE vpERTUpdateCount++ #define COUNT_SPECIAL_ZERO_SKIP vpSpecialZeroSkipCount++ #define COUNT_RUN_FRAGMENT vpRunFragmentCount++ #else #define COUNT_RESAMPLE #define COUNT_COMPOSITE #define COUNT_ERT_SKIP #define COUNT_ERT_SKIP_AGAIN #define COUNT_ERT_UPDATE #define COUNT_SPECIAL_ZERO_SKIP #define COUNT_RUN_FRAGMENT #endif /* STATISTICS */ /* * FuncName * * Compositing routine for run-length encoded volume data slices. * Decode and resample one slice of volume data, and composite * it into the intermediate image. The resampling filter is a bilirp. */ void FuncName (vpc, icount, jcount, k, slice_depth_cueing_dbl, intimage, weightTLdbl, weightBLdbl, weightTRdbl, weightBRdbl, VolumeArgs ShadowArgs) vpContext *vpc; /* context */ int icount; /* slice size */ int jcount; int k; /* slice number */ double slice_depth_cueing_dbl; /* depth cueing factor for slice */ IntPixelType *intimage; /* intermediate image pixels */ double weightTLdbl; /* resampling weights */ double weightBLdbl; double weightTRdbl; double weightBRdbl; VolumeArgsDecl ShadowArgsDecl { int i, j; /* voxel index in rotated object space */ IntPixelType *ipixel; /* current intermediate image pixel */ IntPixelType *ipixel2; /* another intermediate image pixel */ int update_interval; /* # of pixels to skip when updating links */ float iopc; /* intermediate pixel opacity (0-1) */ float iopc_inv; /* 1-iopc */ float acc_opc; /* accumulator for resampled voxel opacity */ float top_opc, bot_opc; /* voxel opacity (top and bottom scanlines) */ #ifdef NO_REUSE_VOXEL #define voxels_loaded 0 #define CLEAR_VOXELS_LOADED #define SET_VOXELS_LOADED #else int voxels_loaded; /* if true, top/bot_opc contain valid data loaded during the last resample */ #define CLEAR_VOXELS_LOADED voxels_loaded = 0 #define SET_VOXELS_LOADED voxels_loaded = 1 #endif float wgtTL, wgtBL, /* weights in the range 0..1 which give the */ wgtTR, wgtBR; /* fractional contribution of the */ /* neighboring voxels to the current */ /* intermediate image pixel */ unsigned char *topRLElen; /* length of current run in top scanline */ unsigned char *botRLElen; /* length of current run in bottom scanline */ char *topRLEdata; /* data for current run in top scanline */ char *botRLEdata; /* data for current run in bottom scanline */ int toprun_count; /* number of voxels left in top run */ int botrun_count; /* number of voxels left in bottom run */ int last_run_state; /* run state code for last resample */ int run_state; /* run state code for this resample */ int final_run_state; /* run state code for end of scanline */ float min_opacity; /* low opacity threshold */ float max_opacity; /* high opacity threshold */ float slice_depth_cueing; /* depth cueing factor for slice */ float *opac_correct; /* opacity correction table */ int ert_skip_count; /* number of pixels to skip for ERT */ int intermediate_width; /* width of intermediate image in pixels */ int count; /* voxels left in current run */ float *shade_table; /* shade lookup table */ int norm_offset; /* byte offset to shade table index in voxel */ int shade_index; /* shade index */ float shade_factor; /* attenuation factor for color (voxel opacity * depth cueing) */ #ifdef MULTIPLE_MATERIALS float *weight_table; /* weight lookup table */ int wgt_offset; /* byte offset to weight table index */ int weight_index; /* weight index */ int m, num_materials; float weight1, weight2; #endif /* MULTIPLE_MATERIALS */ #ifdef GRAYSCALE float acc_clr; /* accumulator for resampled color */ float top_clr, bot_clr; /* voxel color (top and bottom scanlines) */ #endif /* GRAYSCALE */ #ifdef RGB float acc_rclr; /* accumulator for resampled color */ float acc_gclr; float acc_bclr; float top_rclr; /* voxel color (top and bottom scanlines) */ float bot_rclr; float top_gclr; float bot_gclr; float top_bclr; float bot_bclr; #endif #ifdef RLEVOLUME int voxel_istride; /* size of a voxel in bytes */ #endif #ifdef RAWVOLUME int use_octree; /* if true then use the min-max octree */ MMOctreeLevel level_stack[VP_MAX_OCTREE_LEVELS]; /* stack for traversal of min-max octree */ int scans_left; /* scanlines until next octree traversal */ int best_view_axis; /* viewing axis */ unsigned char runlen_buf1[VP_MAX_VOLUME_DIM]; /* buffers for run lengths */ unsigned char runlen_buf2[VP_MAX_VOLUME_DIM]; unsigned char *top_len_base;/* first run length for top scanline */ unsigned char *bot_len_base;/* first run length for bottom scanline */ int opac_param; /* parameter to opacity transfer function */ float opacity; /* voxel opacity */ int opacity_int; /* voxel opacity truncated to an integer */ int param0_offset; /* offset to first parameter in voxel */ int param0_size; /* size of first parameter in bytes */ float *param0_table; /* lookup table for first parameter */ int param1_offset; /* offset to second parameter in voxel */ int param1_size; /* size of second parameter in bytes */ float *param1_table; /* lookup table for second parameter */ int param2_offset; /* offset to third parameter in voxel */ int param2_size; /* size of third parameter in bytes */ float *param2_table; /* lookup table for third parameter */ #endif /* RAWVOLUME */ #ifdef INDEX_VOLUME unsigned char *scanline_topRLElen; /* first topRLElen in scanline */ unsigned char *scanline_botRLElen; /* first botRLElen in scanline */ char *scanline_topRLEdata; /* first topRLEdata in scanline */ char *scanline_botRLEdata; /* first botRLEdata in scanline */ VoxelLocation *top_voxel_index; /* voxel indexes for top scanline */ VoxelLocation *bot_voxel_index; /* voxel indexes for bot scanline */ VoxelLocation *vindex; int next_i; /* i coordinate of voxel to skip to */ int next_scan; /* true if skipped to next scanline */ #endif /* INDEX_VOLUME */ #ifdef CALLBACK /* shading callback function */ #ifdef GRAYSCALE void (*shade_func) ANSI_ARGS((void *, float *, void *)); #endif #ifdef RGB void (*shade_func) ANSI_ARGS((void *, float *, float *, float *, void *)); #endif void *client_data; /* client data handle */ #endif /* CALLBACK */ #ifdef USE_SHADOW_BUFFER float *shadow_table; /* color lookup table for shadows */ int shadow_width; /* width of shadow buffer */ GrayIntPixel *shadow_pixel; /* current shadow buffer pixel */ #ifdef GRAYSCALE float top_sclr, bot_sclr; /* shadow color (top and bottom scanlines) */ #endif /* GRAYSCALE */ #ifdef RGB float top_rsclr; /* shadow color (top and bottom scanlines) */ float bot_rsclr; float top_gsclr; float bot_gsclr; float top_bsclr; float bot_bsclr; #endif #endif /* SHADOW_BUFFER */ #ifdef DEBUG float trace_opcTL, trace_opcBL, trace_opcTR, trace_opcBR; float trace_rsclrTL, trace_rsclrBL, trace_rsclrTR, trace_rsclrBR; float trace_rclrTL, trace_rclrBL, trace_rclrTR, trace_rclrBR; float trace_gclrTL, trace_gclrBL, trace_gclrTR, trace_gclrBR; float trace_bclrTL, trace_bclrBL, trace_bclrTR, trace_bclrBR; IntPixelType *trace_pixel_ptr; #ifdef COMPUTE_SHADOW_BUFFER int slice_u_int, shadow_slice_u_int; int slice_v_int, shadow_slice_v_int; #endif #endif /* DEBUG */ DECLARE_HIRES_TIME(t0); DECLARE_HIRES_TIME(t1); /******************************************************************* * Copy parameters from the rendering context into local variables. *******************************************************************/ GET_HIRES_TIME(vpc, t0); wgtTL = weightTLdbl; wgtBL = weightBLdbl; wgtTR = weightTRdbl; wgtBR = weightBRdbl; slice_depth_cueing = slice_depth_cueing_dbl; min_opacity = vpc->min_opacity; max_opacity = vpc->max_opacity; #ifdef USE_SHADOW_BUFFER opac_correct = vpc->shadow_opac_correct; #else opac_correct = vpc->affine_opac_correct; #endif #ifdef COMPUTE_SHADOW_BUFFER intermediate_width = vpc->shadow_width; #else intermediate_width = vpc->intermediate_width; #endif #ifdef USE_SHADOW_BUFFER shadow_table = vpc->shadow_color_table; shadow_width = vpc->shadow_width; shadow_pixel = shadow_buffer; #endif ipixel = intimage; shade_table = vpc->shade_color_table; norm_offset = vpc->field_offset[vpc->color_field]; #ifdef MULTIPLE_MATERIALS weight_table = vpc->shade_weight_table; wgt_offset = vpc->field_offset[vpc->weight_field]; num_materials = vpc->num_materials; #endif /* MULTIPLE_MATERIALS */ #ifdef RLEVOLUME topRLEdata = (char*)voxel_data; botRLEdata = (char*)voxel_data; topRLElen = run_lengths; botRLElen = run_lengths; voxel_istride = vpc->rle_bytes_per_voxel; #endif /* RLEVOLUME */ #ifdef RAWVOLUME ASSERT(vpc->num_clsfy_params > 0); ASSERT(vpc->num_clsfy_params < 3); param0_offset = vpc->field_offset[vpc->param_field[0]]; param0_size = vpc->field_size[vpc->param_field[0]]; param0_table = vpc->clsfy_table[0]; if (vpc->num_clsfy_params > 1) { param1_offset = vpc->field_offset[vpc->param_field[1]]; param1_size = vpc->field_size[vpc->param_field[1]]; param1_table = vpc->clsfy_table[1]; } else { param1_offset = 0; param1_size = 0; param1_table = NULL; } if (vpc->num_clsfy_params > 2) { param2_offset = vpc->field_offset[vpc->param_field[2]]; param2_size = vpc->field_size[vpc->param_field[2]]; param2_table = vpc->clsfy_table[2]; } else { param2_offset = 0; param2_size = 0; param2_table = NULL; } if (vpc->mm_octree == NULL) { use_octree = 0; } else { use_octree = 1; best_view_axis = vpc->best_view_axis; VPInitOctreeLevelStack(vpc, level_stack, best_view_axis, k); scans_left = 0; bot_len_base = runlen_buf1; } #endif /* RAWVOLUME */ #ifdef CALLBACK #ifdef GRAYSCALE shade_func = (void(*)(void*, float*, void*))vpc->shade_func; #endif #ifdef RGB shade_func = (void(*)(void*, float*, float*, float*, void*))vpc->shade_func; #endif client_data = vpc->client_data; ASSERT(shade_func != NULL); #endif #ifdef DEBUG trace_pixel_ptr = 0; if (vpc->trace_u >= 0 && vpc->trace_v >= 0) { #ifdef GRAYSCALE trace_pixel_ptr = &vpc->int_image.gray_intim[vpc->trace_u + vpc->trace_v*vpc->intermediate_width]; #endif #ifdef RGB trace_pixel_ptr = &vpc->int_image.rgb_intim[vpc->trace_u + vpc->trace_v*vpc->intermediate_width]; #endif #ifdef COMPUTE_SHADOW_BUFFER slice_u_int = (int)ceil(vpc->shear_i * vpc->trace_shadow_k + vpc->trans_i) - 1; shadow_slice_u_int = (int)ceil(vpc->shadow_shear_i * vpc->trace_shadow_k + vpc->shadow_trans_i) - 1; slice_v_int = (int)ceil(vpc->shear_j * vpc->trace_shadow_k + vpc->trans_j) - 1; shadow_slice_v_int = (int)ceil(vpc->shadow_shear_j * vpc->trace_shadow_k + vpc->shadow_trans_j) - 1; trace_pixel_ptr = &vpc->shadow_buffer[vpc->trace_u + shadow_slice_u_int - slice_u_int + (vpc->trace_v + shadow_slice_v_int - slice_v_int)*vpc->shadow_width]; #endif } #endif /* DEBUG */ /******************************************************************* * Loop over voxel scanlines. *******************************************************************/ for (j = 0; j <= jcount; j++) { /*************************************************************** * Initialize counters and flags. ***************************************************************/ i = icount; CLEAR_VOXELS_LOADED; last_run_state = ALL_ZERO; #ifdef RAWVOLUME botRLEdata = (char *)voxel_data + j*voxel_jstride; topRLEdata = botRLEdata - voxel_jstride; if (!use_octree) { if (j == 0) { run_state = BOT_NONZERO; toprun_count = icount+2; botrun_count = icount; } else if (j == jcount) { run_state = TOP_NONZERO; toprun_count = icount; botrun_count = icount+2; } else { run_state = ALL_NONZERO; toprun_count = icount; botrun_count = icount; } } else #endif /* RAWVOLUME */ if (j == 0) { run_state = BOT_NONZERO; toprun_count = icount+2; botrun_count = 0; } else if (j == jcount) { run_state = TOP_NONZERO; toprun_count = 0; botrun_count = icount+2; } else { run_state = ALL_NONZERO; toprun_count = 0; botrun_count = 0; } #ifdef INDEX_VOLUME scanline_topRLElen = topRLElen; scanline_botRLElen = botRLElen; scanline_topRLEdata = topRLEdata; scanline_botRLEdata = botRLEdata; if (j == 0) { top_voxel_index = voxel_index; bot_voxel_index = voxel_index; } else { top_voxel_index = bot_voxel_index; bot_voxel_index += icount; } #endif /* INDEX_VOLUME */ /*************************************************************** * If the volume is not run-length encoded, use the min-max * to find run lengths for the current voxel scanline. ***************************************************************/ #ifdef RAWVOLUME if (use_octree) { top_len_base = bot_len_base; if (scans_left == 0) { if (bot_len_base == runlen_buf1) bot_len_base = runlen_buf2; else bot_len_base = runlen_buf1; GET_HIRES_TIME(vpc, t1); STORE_HIRES_TIME(vpc, VPTIMER_TRAVERSE_RUNS, t0, t1); COPY_HIRES_TIME(t0, t1); scans_left = VPComputeScanRuns(vpc, level_stack, bot_len_base, best_view_axis, j, icount); GET_HIRES_TIME(vpc, t1); STORE_HIRES_TIME(vpc, VPTIMER_TRAVERSE_OCTREE, t0, t1); COPY_HIRES_TIME(t0, t1); } #ifdef DEBUG if (j > 0) VPCheckRuns(vpc, top_len_base, best_view_axis, k, j-1); if (j < jcount) VPCheckRuns(vpc, bot_len_base, best_view_axis, k, j); #endif scans_left--; topRLElen = top_len_base; botRLElen = bot_len_base; } #endif /* RAWVOLUME */ /*************************************************************** * Loop over runs in the voxel scanline. ***************************************************************/ Debug((vpc, VPDEBUG_COMPOSITE, "StartIScan(u=%d,v=%d)\n", (((int)ipixel - (int)vpc->int_image.gray_intim) / sizeof(IntPixelType)) % vpc->intermediate_width, (((int)ipixel - (int)vpc->int_image.gray_intim) / sizeof(IntPixelType)) / vpc->intermediate_width)); #ifdef UNROLL_RUN_LOOP while (i > 0) { #else while (i >= 0) { #endif /*********************************************************** * Skip over any empty runs at beginning of scanline. ***********************************************************/ if (last_run_state == ALL_ZERO) { #ifndef UNROLL_RUN_LOOP if (i == 0) { Debug((vpc, VPDEBUG_COMPOSITE, "ZeroSkip(1)End\n")); NextIntPixel(1); final_run_state = ALL_ZERO; i = -1; break; /* scanline is done */ } #endif /* check if this is the start of a new run */ while (toprun_count == 0) { toprun_count = *topRLElen++; run_state ^= 1; } while (botrun_count == 0) { botrun_count = *botRLElen++; run_state ^= 2; } if (run_state == ALL_ZERO) { COUNT_SPECIAL_ZERO_SKIP; /* find the union of the two runs of voxels */ count = MIN(toprun_count, botrun_count); toprun_count -= count; botrun_count -= count; NextIntPixel(count); NextZeroTopVoxel(count); NextZeroBotVoxel(count); i -= count; ASSERT(i >= 0); Debug((vpc, VPDEBUG_COMPOSITE, "ZeroSkip(%d)\n", count)); continue; } } #ifndef SKIP_ERT /*********************************************************** * Skip over opaque pixels (early-ray termination). ***********************************************************/ if ((ert_skip_count = ipixel->lnk) != 0) { GET_HIRES_TIME(vpc, t1); STORE_HIRES_TIME(vpc, VPTIMER_TRAVERSE_RUNS, t0, t1); COPY_HIRES_TIME(t0, t1); COUNT_ERT_SKIP; #ifndef UNROLL_RUN_LOOP if (i == 0) { NextIntPixel(1); final_run_state = last_run_state; i = -1; Debug((vpc, VPDEBUG_COMPOSITE, "ERTSkip(1)End\n")); break; /* scanline is done */ } #endif /* find out how many pixels to skip */ if (ert_skip_count < i && (count = ipixel[ert_skip_count].lnk) != 0) { /* follow pointer chain */ do { COUNT_ERT_SKIP_AGAIN; ert_skip_count += count; } while (ert_skip_count < i && (count = ipixel[ert_skip_count].lnk) != 0); /* update some of the lnk pointers in the run of opaque pixels; the more links we update the longer it will take to perform the update, but we will potentially save time in future slices by not having to follow long pointer chains */ ipixel2 = ipixel; update_interval = 1; count = ert_skip_count - 1; while (count > 0) { COUNT_ERT_UPDATE; ipixel2 += update_interval; if (count > 255) ipixel2->lnk = 255; else ipixel2->lnk = count; update_interval *= 2; count -= update_interval; } /* update the current link */ COUNT_ERT_UPDATE; if (ert_skip_count > 255) ert_skip_count = 255; ipixel->lnk = ert_skip_count; } /* skip over the opaque pixels */ if (ert_skip_count > i) ert_skip_count = i; Debug((vpc, VPDEBUG_COMPOSITE,"ERTSkip(%d)\n",ert_skip_count)); NextIntPixel(ert_skip_count); CLEAR_VOXELS_LOADED; #ifdef INDEX_VOLUME /* compute i coordinate of voxel to skip to */ next_i = icount - i + ert_skip_count; if (next_i == icount) { next_i--; next_scan = 1; } else { next_scan = 0; } /* skip over voxels in top scanline */ vindex = &top_voxel_index[next_i]; toprun_count = vindex->run_count; topRLElen = scanline_topRLElen + vindex->len_offset; if (vindex->data_offset & INDEX_RUN_IS_ZERO) { run_state &= ~1; topRLEdata = scanline_topRLEdata + (vindex->data_offset & ~INDEX_RUN_IS_ZERO); } else { run_state |= 1; topRLEdata = scanline_topRLEdata + vindex->data_offset; } /* skip over voxels in bottom scanline */ vindex = &bot_voxel_index[next_i]; botrun_count = vindex->run_count; botRLElen = scanline_botRLElen + vindex->len_offset; if (vindex->data_offset & INDEX_RUN_IS_ZERO) { run_state &= ~2; botRLEdata = scanline_botRLEdata + (vindex->data_offset & ~INDEX_RUN_IS_ZERO); } else { run_state |= 2; botRLEdata = scanline_botRLEdata + vindex->data_offset; } /* special case to skip over last voxel in scanline */ if (next_scan) { /* advance to beginning of next top scanline */ while (toprun_count == 0) { toprun_count = *topRLElen++; run_state ^= 1; } toprun_count--; if (run_state & 1) { NextNonZeroTopVoxel(1); } else { NextZeroTopVoxel(1); } /* advance to beginning of next bottom scanline */ while (botrun_count == 0) { botrun_count = *botRLElen++; run_state ^= 2; } botrun_count--; if (run_state & 2) { NextNonZeroBotVoxel(1); } else { NextZeroBotVoxel(1); } } #else /* !INDEX_VOLUME */ /* skip over voxels in top scanline */ count = ert_skip_count; for (;;) { if (toprun_count >= count) { toprun_count -= count; if (run_state & 1) { NextNonZeroTopVoxel(count); } else { NextZeroTopVoxel(count); } break; } else { count -= toprun_count; if (run_state & 1) { NextNonZeroTopVoxel(toprun_count); } else { NextZeroTopVoxel(toprun_count); } toprun_count = *topRLElen++; if (toprun_count == 0) toprun_count = *topRLElen++; else run_state ^= 1; } } /* skip over voxels in bottom scanline */ count = ert_skip_count; for (;;) { if (botrun_count >= count) { botrun_count -= count; if (run_state & 2) { NextNonZeroBotVoxel(count); } else { NextZeroBotVoxel(count); } break; } else { count -= botrun_count; if (run_state & 2) { NextNonZeroBotVoxel(botrun_count); } else { NextZeroBotVoxel(botrun_count); } botrun_count = *botRLElen++; if (botrun_count == 0) botrun_count = *botRLElen++; else run_state ^= 2; } } #endif /* INDEX_VOLUME */ i -= ert_skip_count; last_run_state = run_state; if (i == 0) { #ifdef UNROLL_RUN_LOOP break; #else if (last_run_state == ALL_ZERO) { NextIntPixel(1); final_run_state = ALL_ZERO; i = -1; Debug((vpc, VPDEBUG_COMPOSITE, "ZeroSkip(1)End\n")); break; /* scanline is done */ } if (ipixel->lnk != 0) { NextIntPixel(1); final_run_state = last_run_state; i = -1; Debug((vpc, VPDEBUG_COMPOSITE, "ERTSkip(1)End\n")); break; /* scanline is done */ } #endif /* UNROLL_RUN_LOOP */ } GET_HIRES_TIME(vpc, t1); STORE_HIRES_TIME(vpc, VPTIMER_ERT, t0, t1); COPY_HIRES_TIME(t0, t1); } ASSERT(ipixel->opcflt < max_opacity); #endif /* SKIP_ERT */ /*********************************************************** * Compute the length of the current run. ***********************************************************/ #ifndef UNROLL_RUN_LOOP if (i == 0) { final_run_state = last_run_state; run_state = ALL_ZERO; i = -1; count = 1; Debug((vpc, VPDEBUG_COMPOSITE, "Run(1)End\n")); } else { #endif /* check if this is the start of a new run */ while (toprun_count == 0) { toprun_count = *topRLElen++; run_state ^= 1; } while (botrun_count == 0) { botrun_count = *botRLElen++; run_state ^= 2; } /* find the union of the two runs of voxels */ count = MIN(toprun_count, botrun_count); toprun_count -= count; botrun_count -= count; i -= count; Debug((vpc, VPDEBUG_COMPOSITE, "Run(%d)\n", count)); ASSERT(i >= 0); #ifndef UNROLL_RUN_LOOP } #endif COUNT_RUN_FRAGMENT; /*********************************************************** * composite the voxels in the current run. ***********************************************************/ GET_HIRES_TIME(vpc, t1); STORE_HIRES_TIME(vpc, VPTIMER_TRAVERSE_RUNS, t0, t1); COPY_HIRES_TIME(t0, t1); #ifdef SKIP_COMPOSITE switch (run_state) { case ALL_ZERO: NextIntPixel(count); NextZeroTopVoxel(count); NextZeroBotVoxel(count); count = 0; break; case TOP_NONZERO: NextIntPixel(count); NextNonZeroTopVoxel(count); NextZeroBotVoxel(count); count = 0; break; case BOT_NONZERO: NextIntPixel(count); NextZeroTopVoxel(count); NextNonZeroBotVoxel(count); count = 0; break; case ALL_NONZERO: NextIntPixel(count); NextNonZeroTopVoxel(count); NextNonZeroBotVoxel(count); count = 0; break; } #else /* !SKIP_COMPOSITE */ #ifdef UNROLL_RUN_LOOP /* this run contains pixels, so process them */ switch ((last_run_state << 2) | run_state) { case ALL_ZERO__ALL_ZERO: /* no voxels contribute to the pixels in this run */ NextIntPixel(count); NextZeroTopVoxel(count); NextZeroBotVoxel(count); count = 0; break; case TOP_NONZERO__ALL_ZERO: /* only the top-left voxel contributes to the first pixel of the run, and the rest are zero */ if (!voxels_loaded) { LoadTopLeft(); } NewPixel(); Accum(top, TL, =); Composite(); NextIntPixel(count); NextZeroTopVoxel(count); NextZeroBotVoxel(count); count = 0; break; case BOT_NONZERO__ALL_ZERO: /* only the bottom left voxel contributes to the first pixel of the run, and the rest are zero */ if (!voxels_loaded) { LoadBotLeft(); } NewPixel(); Accum(bot, BL, =); Composite(); NextIntPixel(count); NextZeroTopVoxel(count); NextZeroBotVoxel(count); count = 0; break; case ALL_NONZERO__ALL_ZERO: /* the top and bottom left voxels contribute to the first pixel of the run, and the rest are zero */ if (!voxels_loaded) { LoadTopLeft(); LoadBotLeft(); } NewPixel(); Accum(top, TL, =); Accum(bot, BL, +=); Composite(); NextIntPixel(count); NextZeroTopVoxel(count); NextZeroBotVoxel(count); count = 0; break; case ALL_ZERO__TOP_NONZERO: /* first pixel: only the top-right voxel contributes */ LoadTopRight(); NewPixel(); Accum(top, TR, =); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextZeroBotVoxel(1); count--; SET_VOXELS_LOADED; /* do the rest of the pixels in this run; the top-left and top-right voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadTopLeft(); } NewPixel(); Accum(top, TL, =); LoadTopRight(); Accum(top, TR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case TOP_NONZERO__TOP_NONZERO: /* do the pixels in this run; the top-left and top-right voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadTopLeft(); } NewPixel(); Accum(top, TL, =); LoadTopRight(); Accum(top, TR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case BOT_NONZERO__TOP_NONZERO: /* first pixel: bottom-left and top-right voxels contribute */ if (!voxels_loaded) { LoadBotLeft(); } NewPixel(); Accum(bot, BL, =); LoadTopRight(); Accum(top, TR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextZeroBotVoxel(1); count--; SET_VOXELS_LOADED; /* do the rest of the pixels in this run; the top-left and top-right voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadTopLeft(); } NewPixel(); Accum(top, TL, =); LoadTopRight(); Accum(top, TR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case ALL_NONZERO__TOP_NONZERO: /* first pixel: top-left, bottom-left and top-right voxels contribute */ if (!voxels_loaded) { LoadTopLeft(); LoadBotLeft(); } NewPixel(); Accum(top, TL, =); Accum(bot, BL, +=); LoadTopRight(); Accum(top, TR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextZeroBotVoxel(1); count--; SET_VOXELS_LOADED; /* do the rest of the pixels in this run; the top-left and top-right voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadTopLeft(); } NewPixel(); Accum(top, TL, =); LoadTopRight(); Accum(top, TR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case ALL_ZERO__BOT_NONZERO: /* first pixel: only the bottom-right voxel contributes */ LoadBotRight(); NewPixel(); Accum(bot, BR, =); Composite(); NextIntPixel(1); NextZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; /* do the rest of the pixels in this run; bottom-left and bottom-right voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadBotLeft(); } NewPixel(); Accum(bot, BL, =); LoadBotRight(); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case TOP_NONZERO__BOT_NONZERO: /* first pixel: top-left and bottom-right voxels contribute */ if (!voxels_loaded) { LoadTopLeft(); } NewPixel(); Accum(top, TL, =); LoadBotRight(); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; /* do the rest of the pixels in this run; bottom-left and bottom-right voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadBotLeft(); } NewPixel(); Accum(bot, BL, =); LoadBotRight(); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case BOT_NONZERO__BOT_NONZERO: /* do the pixels in this run; bottom-left and bottom-right voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadBotLeft(); } NewPixel(); Accum(bot, BL, =); LoadBotRight(); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case ALL_NONZERO__BOT_NONZERO: /* first pixel: top-left, bottom-left and bottom-right voxels contribute */ if (!voxels_loaded) { LoadTopLeft(); LoadBotLeft(); } NewPixel(); Accum(top, TL, =); Accum(bot, BL, +=); LoadBotRight(); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; /* do the rest of the pixels in this run; bottom-left and bottom-right voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadBotLeft(); } NewPixel(); Accum(bot, BL, =); LoadBotRight(); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case ALL_ZERO__ALL_NONZERO: /* first pixel: top-right and bottom-right voxels contribute */ LoadTopRight(); LoadBotRight(); NewPixel(); Accum(top, TR, =); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; /* do the rest of the pixels in this run; all four voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadTopLeft(); LoadBotLeft(); } NewPixel(); Accum(top, TL, =); Accum(bot, BL, +=); LoadTopRight(); LoadBotRight(); Accum(top, TR, +=); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case TOP_NONZERO__ALL_NONZERO: /* first pixel: top-left, top-right and bottom-right voxels contribute */ if (!voxels_loaded) { LoadTopLeft(); } NewPixel(); Accum(top, TL, =); LoadTopRight(); LoadBotRight(); Accum(top, TR, +=); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; /* do the rest of the pixels in this run; all four voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadTopLeft(); LoadBotLeft(); } NewPixel(); Accum(top, TL, =); Accum(bot, BL, +=); LoadTopRight(); LoadBotRight(); Accum(top, TR, +=); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case BOT_NONZERO__ALL_NONZERO: /* first pixel: bottom-left, top-right and bottom-right voxels contribute */ if (!voxels_loaded) { LoadBotLeft(); } NewPixel(); Accum(bot, BL, =); LoadTopRight(); LoadBotRight(); Accum(top, TR, +=); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; /* do the rest of the pixels in this run; all four voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadTopLeft(); LoadBotLeft(); } NewPixel(); Accum(top, TL, =); Accum(bot, BL, +=); LoadTopRight(); LoadBotRight(); Accum(top, TR, +=); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; case ALL_NONZERO__ALL_NONZERO: /* do the pixels in this run; all four voxels contribute */ while (count > 0) { if (PIXEL_IS_OPAQUE(ipixel)) break; if (!voxels_loaded) { LoadTopLeft(); LoadBotLeft(); } NewPixel(); Accum(top, TL, =); Accum(bot, BL, +=); LoadTopRight(); LoadBotRight(); Accum(top, TR, +=); Accum(bot, BR, +=); Composite(); NextIntPixel(1); NextNonZeroTopVoxel(1); NextNonZeroBotVoxel(1); count--; SET_VOXELS_LOADED; } break; default: VPBug("illegal value for run states in compositing loop"); } #else /* UNROLL_RUN_LOOP */ /* this run contains pixels, so process them */ while (count > 0) { if (last_run_state == ALL_ZERO && run_state == ALL_ZERO) { NextIntPixel(count); if (i != -1) { NextZeroTopVoxel(count); NextZeroBotVoxel(count); } count = 0; break; } if (ipixel->lnk != 0) break; NewPixel(); ClearAccum(); if (last_run_state & TOP_NONZERO) { if (!voxels_loaded) { LoadTopLeft(); } Accum(top, TL, +=); } if (last_run_state & BOT_NONZERO) { if (!voxels_loaded) { LoadBotLeft(); } Accum(bot, BL, +=); } if (run_state & TOP_NONZERO) { LoadTopRight(); Accum(top, TR, +=); NextNonZeroTopVoxel(1); } else { if (i != -1) { NextZeroTopVoxel(1); } } if (run_state & BOT_NONZERO) { LoadBotRight(); Accum(bot, BR, +=); NextNonZeroBotVoxel(1); } else { if (i != -1) { NextZeroBotVoxel(1); } } Composite(); NextIntPixel(1); count--; SET_VOXELS_LOADED; last_run_state = run_state; } #endif /* UNROLL_RUN_LOOP */ GET_HIRES_TIME(vpc, t1); STORE_HIRES_TIME(vpc, VPTIMER_PROCESS_VOXELS, t0, t1); COPY_HIRES_TIME(t0, t1); if (count > 0) { Debug((vpc, VPDEBUG_COMPOSITE, "Backup(%d)\n", count)); toprun_count += count; botrun_count += count; i += count; } #endif /* SKIP_COMPOSITE */ /*********************************************************** * Go on to next voxel run. ***********************************************************/ last_run_state = run_state; } /* while (i > 0) */ /*************************************************************** * Finish processing voxel scanline and go on to next one. ***************************************************************/ #ifdef UNROLL_RUN_LOOP ASSERT(i == 0); #else ASSERT(i == -1); #endif #ifndef SKIP_COMPOSITE #ifdef UNROLL_RUN_LOOP /* do the last pixel (to the right of the last voxel) */ if (last_run_state != ALL_ZERO && !PIXEL_IS_OPAQUE(ipixel)) { /* last voxels are nonzero and the pixel is not opaque yet so there is work to be done */ Debug((vpc, VPDEBUG_COMPOSITE, "Run(1)End\n")); switch (last_run_state) { case TOP_NONZERO: /* only the top-left voxel contributes */ if (!voxels_loaded) { LoadTopLeft(); } NewPixel(); Accum(top, TL, =); Composite(); break; case BOT_NONZERO: /* only the bottom left voxel contributes */ if (!voxels_loaded) { LoadBotLeft(); } NewPixel(); Accum(bot, BL, =); Composite(); break; case ALL_NONZERO: /* the top and bottom left voxels contribute */ if (!voxels_loaded) { LoadTopLeft(); LoadBotLeft(); } NewPixel(); Accum(top, TL, =); Accum(bot, BL, +=); Composite(); break; default: VPBug("illegal value for run state at end of scanline"); } } else if (last_run_state == ALL_ZERO) { Debug((vpc, VPDEBUG_COMPOSITE, "ZeroSkip(1)End\n")); } else { Debug((vpc, VPDEBUG_COMPOSITE, "ERTSkip(1)End\n")); } #endif /* UNROLL_RUN_LOOP */ #endif /* SKIP_COMPOSITE */ #ifndef UNROLL_RUN_LOOP run_state = final_run_state; #endif /* skip over any zero-length runs remaining in this scanline */ if (j != 0 && ((run_state & 1) == 0)) { toprun_count = *topRLElen++; ASSERT(toprun_count == 0); } if (j != jcount && ((run_state & 2) == 0)) { botrun_count = *botRLElen++; ASSERT(botrun_count == 0); } /* go to next intermediate image scanline */ #ifdef UNROLL_RUN_LOOP ipixel += intermediate_width - icount; #ifdef USE_SHADOW_BUFFER shadow_pixel += shadow_width - icount; #endif #else /* UNROLL_RUN_LOOP */ ipixel += intermediate_width - (icount+1); #ifdef USE_SHADOW_BUFFER shadow_pixel += shadow_width - (icount+1); #endif #endif /* UNROLL_RUN_LOOP */ Debug((vpc, VPDEBUG_COMPOSITE, "ScanDone\n")); } /* for j */ /*************************************************************** * Finish processing the voxel slice. ***************************************************************/ GET_HIRES_TIME(vpc, t1); STORE_HIRES_TIME(vpc, VPTIMER_TRAVERSE_RUNS, t0, t1); Debug((vpc, VPDEBUG_COMPOSITE, "SliceDone\n")); } ccseapps-2.5/CCSEApps/volpack/vp_octree.c0000644000175000017500000014613011634153073021455 0ustar amckinstryamckinstry/* * vp_octree.c * * Routines to create and destroy MinMaxOctree objects for fast classification. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:03 $ * $Revision: 1.5 $ */ #include "vp_global.h" /* * OctantOrder: octant traversal order, depending on best_view_axis */ static int OctantOrder[3][8] = { { 0, 2, 4, 6, 1, 3, 5, 7 }, /* VP_X_AXIS */ { 0, 4, 1, 5, 2, 6, 3, 7 }, /* VP_Y_AXIS */ { 0, 1, 2, 3, 4, 5, 6, 7 } /* VP_Z_AXIS */ }; static void CreatePyramid ANSI_ARGS((vpContext *vpc, void *mm_pyramid[VP_MAX_OCTREE_LEVELS])); static void DescendPyramid ANSI_ARGS((vpContext *vpc, void *mm_pyramid[VP_MAX_OCTREE_LEVELS], int level, int x, int y, int z, int nodes_per_side, void *parent_node, int *octree_offset)); static void Compute1DSummedAreaTable ANSI_ARGS((vpContext *vpc)); static void Compute2DSummedAreaTable ANSI_ARGS((vpContext *vpc)); static void ClassifyOctree1 ANSI_ARGS((vpContext *vpc)); static void ClassifyOctree2 ANSI_ARGS((vpContext *vpc)); static void ComputeOctreeMask ANSI_ARGS((vpContext *vpc, int level, int xn, int yn, int zn, int node_size, void *parent_node, unsigned char *array, int max_level)); /* * vpCreateMinMaxOctree * * Create a MinMaxOctree representation of the volume for fast classification. */ vpResult vpCreateMinMaxOctree(vpc, root_node_size, base_node_size) vpContext *vpc; int root_node_size; /* ignored for now */ int base_node_size; /* controls level of detail of smallest nodes */ { int max_dim, retcode, p, f; int bytes_per_node; int level_size, levels; void *mm_pyramid[VP_MAX_OCTREE_LEVELS]; int octree_offset; /* check for errors */ if ((retcode = VPCheckRawVolume(vpc)) != VP_OK) return(retcode); if (vpc->num_clsfy_params <= 0 || vpc->num_clsfy_params > vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VOXEL)); for (p = 0; p < vpc->num_clsfy_params; p++) { f = vpc->param_field[p]; if (f < 0 || f >= vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_CLASSIFIER)); if (p > 0 && f <= vpc->param_field[p-1]) return(VPSetError(vpc, VPERROR_BAD_CLASSIFIER)); } max_dim = vpc->xlen; if (vpc->ylen > max_dim) max_dim = vpc->ylen; if (vpc->zlen > max_dim) max_dim = vpc->zlen; switch (base_node_size) { /* must be a power of 2 */ case 1: case 2: case 4: case 8: case 16: case 32: case 64: case 128: case 256: case 512: break; default: return(VPSetError(vpc, VPERROR_BAD_VALUE)); } for (p = 0; p < vpc->num_clsfy_params; p++) { if (vpc->field_size[vpc->param_field[p]] == 4) return(VPSetError(vpc, VPERROR_BAD_CLASSIFIER)); } /* allocate mm_octree structure */ Alloc(vpc, vpc->mm_octree, MinMaxOctree *, sizeof(MinMaxOctree), "MinMaxOctree"); bzero(vpc->mm_octree, sizeof(MinMaxOctree)); vpc->mm_octree->base_node_size = base_node_size; /* compute field sizes */ bytes_per_node = 0; for (p = 0; p < vpc->num_clsfy_params; p++) { vpc->mm_octree->node_offset[p] = bytes_per_node; bytes_per_node += 2 * vpc->field_size[vpc->param_field[p]]; } vpc->mm_octree->range_bytes_per_node = bytes_per_node; vpc->mm_octree->status_offset = bytes_per_node; bytes_per_node++; /* add byte for status field */ bytes_per_node = (bytes_per_node + 1) & ~1; /* align to short boundary */ vpc->mm_octree->base_bytes_per_node = bytes_per_node; bytes_per_node = (bytes_per_node + 3) & ~3; /* align to word boundary */ vpc->mm_octree->child_offset = bytes_per_node; bytes_per_node += sizeof(unsigned); /* add word for child field */ vpc->mm_octree->nonbase_bytes_per_node = bytes_per_node; /* compute number of levels */ levels = 1; level_size = base_node_size; while (level_size < max_dim) { level_size *= 2; levels++; } if (levels >= VP_MAX_OCTREE_LEVELS) { vpDestroyMinMaxOctree(vpc); return(VPSetError(vpc, VPERROR_LIMIT_EXCEEDED)); } vpc->mm_octree->levels = levels; vpc->mm_octree->root_node_size = level_size; /* build a min-max pyramid representation of the volume */ CreatePyramid(vpc, mm_pyramid); /* determine how much space is needed for the octree nodes */ octree_offset = vpc->mm_octree->nonbase_bytes_per_node; /* root node */ DescendPyramid(vpc, mm_pyramid, 0, 0, 0, 0, 1, NULL, &octree_offset); /* create the min-max octree nodes */ Alloc(vpc, vpc->mm_octree->root, void *, octree_offset, "mm_octree"); vpc->mm_octree->octree_bytes = octree_offset; octree_offset = vpc->mm_octree->nonbase_bytes_per_node; Debug((vpc, VPDEBUG_OCTREE, "Octree:\n")); DescendPyramid(vpc, mm_pyramid, 0, 0, 0, 0, 1, vpc->mm_octree->root, &octree_offset); /* clean up and return */ Dealloc(vpc, mm_pyramid[0]); return(VP_OK); } /* * vpDestroyMinMaxOctree * * Destroy the MinMaxOctree representation of the volume. */ vpResult vpDestroyMinMaxOctree(vpc) vpContext *vpc; { if (vpc->mm_octree != NULL) { if (vpc->mm_octree->root != NULL) { Dealloc(vpc, vpc->mm_octree->root); vpc->mm_octree->root = NULL; } Dealloc(vpc, vpc->mm_octree); vpc->mm_octree = NULL; } return(VP_OK); } /* * CreatePyramid * * Create a min-max pyramid representation of the volume. */ static void CreatePyramid(vpc, mm_pyramid) vpContext *vpc; void *mm_pyramid[VP_MAX_OCTREE_LEVELS]; { int pyr_size; /* size of pyramid in bytes */ int level, pyr_levels; /* current, total pyramid levels */ int level_offset; /* byte offset to beginning of level */ int nodes_per_side; /* nodes per side at current level */ int node_size; /* voxels per side in node */ char *pyr_node; /* current node of pyramid */ char *pyr_src; /* pyramid node being read */ char *pyr_dst; /* pyramid node being written */ char *voxel; /* voxel being read */ int x, y, z; /* coordinates of current pyramid node */ int nx, ny, nz; /* coordinates of voxel within node */ int xlen, ylen, zlen; /* size of volume */ int voxel_xstride; /* volume strides */ int voxel_ystride; int voxel_zstride; int param_size[VP_MAX_FIELDS]; /* size of each parameter */ int param_offset[VP_MAX_FIELDS];/* voxel offset of each parameter */ int node_offset[VP_MAX_FIELDS]; /* offset of parameter in octree node */ int max_value[VP_MAX_FIELDS]; /* max. value of each parameter in node */ int min_value[VP_MAX_FIELDS]; /* min. value of each parameter in node */ int num_params; /* number of params for classifier */ int p; /* parameter number */ int value; /* parameter value */ int pyr_bytes_per_node; /* size of node in bytes */ int pyr_offsets[8]; /* offsets from pyr_src to each of its neighbors (0,+X,+Y,+XY,+Z,+XZ,+YZ,+XYZ) */ int elem; /* index into pyr_offsets */ /* allocate space for pyramid */ ASSERT(vpc->mm_octree != NULL); ASSERT(vpc->mm_octree->levels > 0); ASSERT(vpc->xlen > 0); ASSERT(vpc->raw_voxels != NULL); ASSERT(vpc->num_clsfy_params > 0); pyr_levels = vpc->mm_octree->levels; pyr_size = vpc->mm_octree->base_bytes_per_node; pyr_bytes_per_node = vpc->mm_octree->range_bytes_per_node; for (level = pyr_levels; level > 0; level--) pyr_size = pyr_size*8 + pyr_bytes_per_node; Alloc(vpc, mm_pyramid[0], void *, pyr_size, "mm_pyramid"); level_offset = pyr_bytes_per_node; nodes_per_side = 1; for (level = 1; level < vpc->mm_octree->levels; level++) { mm_pyramid[level] = (char *)mm_pyramid[level-1] + level_offset; level_offset *= 8; nodes_per_side *= 2; } /* build the base level of the pyramid */ xlen = vpc->xlen; ylen = vpc->ylen; zlen = vpc->zlen; voxel_xstride = vpc->xstride; voxel_ystride = vpc->ystride; voxel_zstride = vpc->zstride; voxel = (char*)vpc->raw_voxels; num_params = vpc->num_clsfy_params; for (p = 0; p < num_params; p++) { param_size[p] = vpc->field_size[vpc->param_field[p]]; param_offset[p] = vpc->field_offset[vpc->param_field[p]]; node_offset[p] = vpc->mm_octree->node_offset[p]; } node_size = vpc->mm_octree->base_node_size; pyr_dst = (char*)mm_pyramid[pyr_levels-1]; Debug((vpc, VPDEBUG_PYRAMID, "Pyramid Level %d:\n", pyr_levels-1)); for (z = 0; z < nodes_per_side; z++) { ReportStatus(vpc, (double)z / (double)nodes_per_side); for (y = 0; y < nodes_per_side; y++) { for (x = 0; x < nodes_per_side; x++) { /* clear the min/max values for the current node */ for (p = 0; p < num_params; p++) { max_value[p] = -1; min_value[p] = 65536; } /* loop over voxels in the node */ if (z * node_size >= zlen || y * node_size >= ylen || x * node_size >= xlen) { for (p = 0; p < num_params; p++) { max_value[p] = 0; min_value[p] = 0; } voxel += node_size * voxel_zstride; } else for (nz = 0; nz < node_size; nz++) { if (z * node_size + nz >= zlen) { voxel += (node_size - nz) * voxel_zstride; break; } for (ny = 0; ny < node_size; ny++) { if (y * node_size + ny >= ylen) { voxel += (node_size - ny) * voxel_ystride; break; } for (nx = 0; nx < node_size; nx++) { if (x * node_size + nx >= xlen) { voxel += (node_size - nx) * voxel_xstride; break; } /* compare each field against current min/max */ for (p = 0; p < num_params; p++) { ASSERT(voxel == (char *)vpc->raw_voxels + (x*node_size+nx)*voxel_xstride + (y*node_size+ny)*voxel_ystride + (z*node_size+nz)*voxel_zstride); value = VoxelField(voxel, param_offset[p], param_size[p]); if (value > max_value[p]) max_value[p] = value; if (value < min_value[p]) min_value[p] = value; } voxel += voxel_xstride; } /* for nx */ voxel += voxel_ystride - node_size*voxel_xstride; } /* for ny */ voxel += voxel_zstride - node_size*voxel_ystride; } /* for nz */ /* store the min/max values for this node */ Debug((vpc, VPDEBUG_PYRAMID, " Node %d,%d,%d:\n", x, y, z)); for (p = 0; p < num_params; p++) { ASSERT(max_value[p] >= 0 && max_value[p] < 65536); ASSERT(min_value[p] >= 0 && min_value[p] < 65536); Debug((vpc, VPDEBUG_PYRAMID, " Param %d: min %d, max %d\n", p, min_value[p], max_value[p])); if (param_size[p] == 1) { ByteField(pyr_dst, node_offset[p]) = min_value[p]; ByteField(pyr_dst, node_offset[p]+1) = max_value[p]; } else { ASSERT(param_size[p] == 2); ShortFieldSet(pyr_dst, node_offset[p], min_value[p]); ShortFieldSet(pyr_dst, node_offset[p]+2, max_value[p]); } } pyr_dst += pyr_bytes_per_node; voxel += node_size * (voxel_xstride - voxel_zstride); } /* for x */ voxel += node_size*(voxel_ystride - nodes_per_side*voxel_xstride); } /* for y */ voxel += node_size*(voxel_zstride - nodes_per_side*voxel_ystride); } /* for z */ ReportStatus(vpc, 1.0); /* build the rest of the pyramid */ for (level = pyr_levels-2; level >= 0; level--) { ReportStatus(vpc, 1. - (double)(level+1)/(double)(pyr_levels-1)); Debug((vpc, VPDEBUG_PYRAMID, "Pyramid Level %d:\n", level)); pyr_dst = (char*)mm_pyramid[level]; pyr_node = (char*)mm_pyramid[level+1]; pyr_offsets[0] = 0; pyr_offsets[1] = pyr_bytes_per_node; pyr_offsets[2] = nodes_per_side * pyr_bytes_per_node; pyr_offsets[3] = pyr_offsets[2] + pyr_bytes_per_node; pyr_offsets[4] = pyr_offsets[2] * nodes_per_side; pyr_offsets[5] = pyr_offsets[4] + pyr_bytes_per_node; pyr_offsets[6] = pyr_offsets[4] + pyr_offsets[2]; pyr_offsets[7] = pyr_offsets[6] + pyr_bytes_per_node; node_size *= 2; nodes_per_side /= 2; for (z = 0; z < nodes_per_side; z++) { for (y = 0; y < nodes_per_side; y++) { for (x = 0; x < nodes_per_side; x++) { /* clear the min/max values for the current node */ for (p = 0; p < num_params; p++) { max_value[p] = -1; min_value[p] = 65536; } /* loop over the eight children of this node */ for (elem = 0; elem < 8; elem++) { pyr_src = pyr_node + pyr_offsets[elem]; /* compare min/max values of children with current min/max values for the node */ for (p = 0; p < num_params; p++) { value = VoxelField(pyr_src, node_offset[p], param_size[p]); if (value < min_value[p]) min_value[p] = value; value = VoxelField(pyr_src, node_offset[p] + param_size[p], param_size[p]); if (value > max_value[p]) max_value[p] = value; } } /* store the min/max values for this node */ Debug((vpc, VPDEBUG_PYRAMID, " Node %d,%d,%d:\n",x,y,z)); for (p = 0; p < num_params; p++) { ASSERT(max_value[p] >= 0 && max_value[p] < 65536); ASSERT(min_value[p] >= 0 && min_value[p] < 65536); Debug((vpc, VPDEBUG_PYRAMID, " Param %d: min %d, max %d\n", p, min_value[p], max_value[p])); if (param_size[p] == 1) { ByteField(pyr_dst, node_offset[p]) = min_value[p]; ByteField(pyr_dst, node_offset[p]+1)=max_value[p]; } else { ASSERT(param_size[p] == 2); ShortFieldSet(pyr_dst, node_offset[p], min_value[p]); ShortFieldSet(pyr_dst, node_offset[p]+2, max_value[p]); } } /* go on to the next node */ pyr_dst += pyr_bytes_per_node; pyr_node += 2*pyr_bytes_per_node; } /* for x */ pyr_node += (2*nodes_per_side)*pyr_bytes_per_node; } /* for y */ pyr_node += (2*nodes_per_side)*(2*nodes_per_side)* pyr_bytes_per_node; } /* for z */ } /* for level */ ReportStatus(vpc, 1.0); } /* * DescendPyramid * * Descend the pyramid recursively, either to count how many nodes will * be copied to the octree (if parent_node == NULL) or to actually copy them. */ static void DescendPyramid(vpc, mm_pyramid, level, x, y, z, nodes_per_side, parent_node, octree_offset) vpContext *vpc; /* context */ void *mm_pyramid[VP_MAX_OCTREE_LEVELS]; /* min-max pyramid */ int level; /* current level */ int x, y, z; /* current node coordinates (in coordinate system of the current level) */ int nodes_per_side; /* # nodes at current level per side of volume */ void *parent_node; /* parent octree node (or NULL) */ int *octree_offset; /* bytes from root of octree to next free location */ { char *pyr_ptr; char *child_node; int p; MinMaxOctree *mm_octree; int pyr_bytes_per_node; int base_bytes_per_node; int nonbase_bytes_per_node; int child_bytes_per_node; int field_size; int field_offset; int child_offset; int range; int subdivide; ASSERT(vpc->mm_octree != NULL); mm_octree = vpc->mm_octree; pyr_bytes_per_node = mm_octree->range_bytes_per_node; base_bytes_per_node = mm_octree->base_bytes_per_node; nonbase_bytes_per_node = mm_octree->nonbase_bytes_per_node; child_offset = mm_octree->child_offset; pyr_ptr = (char *)mm_pyramid[level] + ((z*nodes_per_side + y) * nodes_per_side + x) * pyr_bytes_per_node; /* copy min/max data from pyramid node to octree node */ if (parent_node != NULL) { Debug((vpc, VPDEBUG_OCTREE, " Node at level %d, coords %d,%d,%d, addr 0x%08x\n", level, x, y, z, parent_node)); for (p = 0; p < pyr_bytes_per_node; p++) ByteField(parent_node, p) = ByteField(pyr_ptr, p); } /* descend to next level */ if (level < mm_octree->levels-1) { /* check if we should subdivide node or not */ subdivide = 0; for (p = 0; p < vpc->num_clsfy_params; p++) { field_size = vpc->field_size[vpc->param_field[p]]; field_offset = mm_octree->node_offset[p]; if (field_size == 1) { range = ByteField(pyr_ptr, field_offset+1) - ByteField(pyr_ptr, field_offset); } else { ASSERT(field_size == 2); range = ShortField(pyr_ptr, field_offset+2) - ShortField(pyr_ptr, field_offset); } if (range > vpc->param_maxrange[p]) { subdivide = 1; break; } } if (subdivide) { /* store offset to child */ if (parent_node != NULL) { child_node = (char *)mm_octree->root + *octree_offset; IntFieldSet(parent_node, child_offset, *octree_offset); Debug((vpc, VPDEBUG_OCTREE, " Storing children at offset = %d, addr = 0x%08x\n", *octree_offset, child_node)); } if (level == mm_octree->levels-2) child_bytes_per_node = base_bytes_per_node; else child_bytes_per_node = nonbase_bytes_per_node; *octree_offset += 8 * child_bytes_per_node; if (parent_node == NULL) { child_node = NULL; child_bytes_per_node = 0; } /* visit children */ DescendPyramid(vpc, mm_pyramid, level+1, x*2, y*2, z*2, nodes_per_side*2, child_node, octree_offset); child_node += child_bytes_per_node; DescendPyramid(vpc, mm_pyramid, level+1, x*2+1, y*2, z*2, nodes_per_side*2, child_node, octree_offset); child_node += child_bytes_per_node; DescendPyramid(vpc, mm_pyramid, level+1, x*2, y*2+1, z*2, nodes_per_side*2, child_node, octree_offset); child_node += child_bytes_per_node; DescendPyramid(vpc, mm_pyramid, level+1, x*2+1, y*2+1, z*2, nodes_per_side*2, child_node, octree_offset); child_node += child_bytes_per_node; DescendPyramid(vpc, mm_pyramid, level+1, x*2, y*2, z*2+1, nodes_per_side*2, child_node, octree_offset); child_node += child_bytes_per_node; DescendPyramid(vpc, mm_pyramid, level+1, x*2+1, y*2, z*2+1, nodes_per_side*2, child_node, octree_offset); child_node += child_bytes_per_node; DescendPyramid(vpc, mm_pyramid, level+1, x*2, y*2+1, z*2+1, nodes_per_side*2, child_node, octree_offset); child_node += child_bytes_per_node; DescendPyramid(vpc, mm_pyramid, level+1, x*2+1,y*2+1,z*2+1, nodes_per_side*2, child_node, octree_offset); } else { /* node has no children; store NULL pointer */ Debug((vpc, VPDEBUG_OCTREE, " Not subdividing.\n")); if (parent_node != NULL) { IntFieldSet(parent_node, child_offset, 0); } } } } /* * VPComputeSummedAreaTable * * Build the summed-area table for fast-classification. */ void VPComputeSummedAreaTable(vpc) vpContext *vpc; { /* use a special-case version for lower dimensions (faster since C optimizer does a better job) */ switch (vpc->num_clsfy_params) { case 1: Compute1DSummedAreaTable(vpc); break; case 2: Compute2DSummedAreaTable(vpc); break; default: /* XXX add code for ND classifiers */ VPBug("VPComputeSummedAreaTable can only handle 1D or 2D classifiers"); break; } } /* * Compute1DSummedAreaTable * * Build a 1D summed area table. */ static void Compute1DSummedAreaTable(vpc) vpContext *vpc; { int p0max, p0value; unsigned table_size; float opacity, min_opacity, *p0table; unsigned sum; unsigned *entry; p0max = vpc->field_max[vpc->param_field[0]]; table_size = (p0max+1) * sizeof(unsigned); p0table = vpc->clsfy_table[0]; min_opacity = vpc->min_opacity; if (vpc->sum_table == NULL || table_size != vpc->sum_table_size) { if (vpc->sum_table != NULL) Dealloc(vpc, vpc->sum_table); Alloc(vpc, vpc->sum_table, unsigned *, table_size, "sum_table"); vpc->sum_table_size = table_size; } entry = vpc->sum_table; for (p0value = 0; p0value <= p0max; p0value++) { opacity = p0table[p0value]; if (opacity > min_opacity) sum = 1; else sum = 0; if (p0value > 0) sum += entry[-1]; entry[0] = sum; entry++; } } /* * Compute2DSummedAreaTable * * Build a 2D summed area table. */ static void Compute2DSummedAreaTable(vpc) vpContext *vpc; { int p0max, p0value, p1max, p1value; unsigned table_size; float opacity, min_opacity, *p0table, *p1table; unsigned sum; unsigned *entry; p0max = vpc->field_max[vpc->param_field[0]]; p1max = vpc->field_max[vpc->param_field[1]]; table_size = (p0max+1) * (p1max+1) * sizeof(unsigned); p0table = vpc->clsfy_table[0]; p1table = vpc->clsfy_table[1]; min_opacity = vpc->min_opacity; if (vpc->sum_table == NULL || table_size != vpc->sum_table_size) { if (vpc->sum_table != NULL) Dealloc(vpc, vpc->sum_table); Alloc(vpc, vpc->sum_table, unsigned *, table_size, "sum_table"); vpc->sum_table_size = table_size; } entry = vpc->sum_table; for (p0value = 0; p0value <= p0max; p0value++) { for (p1value = 0; p1value <= p1max; p1value++) { opacity = p0table[p0value] * p1table[p1value]; if (opacity > min_opacity) sum = 1; else sum = 0; if (p1value > 0) { sum += entry[-1]; if (p0value > 0) { sum += entry[-(p1max+1)]; sum -= entry[-(p1max+1)-1]; } } else if (p0value > 0) { sum += entry[-(p1max+1)]; } entry[0] = sum; entry++; } } } /* * VPClassifyOctree * * Descend an octree and classify each node as full, empty or partfull. */ void VPClassifyOctree(vpc) vpContext *vpc; { /* use a special-case version for lower dimensions (faster since C optimizer does a better job) */ switch (vpc->num_clsfy_params) { case 1: ClassifyOctree1(vpc); break; case 2: ClassifyOctree2(vpc); break; default: /* XXX add code for ND classifiers */ VPBug("VPClassifyOctree can only handle 2D classifiers"); break; } } /* * ClassifyOctree1 * * Descend an octree and classify each node as full, empty or partfull. * Specialized for a 1 parameter classification function (1D summed * area table). */ static void ClassifyOctree1(vpc) vpContext *vpc; { char *node_stack[VP_MAX_OCTREE_LEVELS]; /* stack of node addresses */ int count_stack[VP_MAX_OCTREE_LEVELS]; /* stack of node child counts; when count drops to zero, pop up a level */ int level; /* current octree level */ int max_level; /* highest octree level */ char *octree_root; /* root node of octree */ char *node; /* current octree node */ unsigned area; /* area computed from the summed-area table */ int status; /* classification status of current node */ unsigned *sum_table; /* summed area table */ int p0max, p0min; /* parameter 0 extrema */ int p0size; /* parameter size */ int child_offset; /* offset of child field in node */ int status_offset; /* offset of status field in node */ int base_bytes_per_node; /* size of base node in bytes */ int nonbase_bytes_per_node; /* size of nonbase node in bytes */ int child_count; /* children left at current level */ /* initialize */ ASSERT(vpc->sum_table != NULL); ASSERT(vpc->mm_octree != NULL); ASSERT(vpc->mm_octree->root != NULL); ASSERT(vpc->sum_table_size == sizeof(unsigned) * (vpc->field_max[vpc->param_field[0]]+1)); sum_table = vpc->sum_table; max_level = vpc->mm_octree->levels - 1; octree_root = (char*)vpc->mm_octree->root; p0size = vpc->field_size[vpc->param_field[0]]; status_offset = vpc->mm_octree->status_offset; child_offset = vpc->mm_octree->child_offset; base_bytes_per_node = vpc->mm_octree->base_bytes_per_node; nonbase_bytes_per_node = vpc->mm_octree->nonbase_bytes_per_node; node = octree_root; level = 0; /* do a depth-first, preorder traversal of the octree */ Debug((vpc, VPDEBUG_CLSFYOCTREE, "Classifying octree:\n")); while (1) { /* find min/max values for both parameters in this node */ if (p0size == 1) { p0min = ByteField(node, 0)-1; p0max = ByteField(node, 1); } else { p0min = ShortField(node, 0)-1; p0max = ShortField(node, 2); } /* integrate the opacities in the node using the summed area table */ area = sum_table[p0max]; if (p0min >= 0) area -= sum_table[p0min]; /* decide if node is full, empty or partfull */ if (area == 0) { status = MM_EMPTY; } else if (level != max_level && IntField(node, child_offset) != 0 && area != (p0max - p0min)) { status = MM_PARTFULL; } else { status = MM_FULL; } ByteField(node, status_offset) = status; Debug((vpc, VPDEBUG_CLSFYOCTREE, " Level %d: node is %s (addr 0x%08x)\n", level, status == MM_EMPTY ? "empty" : (status == MM_FULL ? "full" : "partfull"), node)); /* move to next node in tree traversal */ if (status == MM_PARTFULL) { /* move down to first child in next level */ node = octree_root + IntField(node, child_offset); Debug((vpc, VPDEBUG_CLSFYOCTREE, " Descending. Children at offset %d, addr 0x%08x\n", IntField(node, child_offset), node)); node_stack[level] = node; count_stack[level] = 7; /* number of remaining children */ level++; ASSERT(level <= max_level); } else { do { /* move up to a node with unvisited children */ Debug((vpc, VPDEBUG_CLSFYOCTREE, " Ascending.\n")); level--; if (level < 0) break; child_count = count_stack[level]--; ASSERT(child_count >= 0 && child_count <= 7); } while (child_count == 0); if (level < 0) break; /* traversal of octree is done! */ /* descend to the next child of this node */ if (level == max_level-1) node = node_stack[level] + base_bytes_per_node; else node = node_stack[level] + nonbase_bytes_per_node; Debug((vpc, VPDEBUG_CLSFYOCTREE, " Descending to child at 0x%08x.\n", node)); node_stack[level] = node; level++; ASSERT(level <= max_level); } } /* while (1) */ } /* * ClassifyOctree2 * * Descend an octree and classify each node as full, empty or partfull. * Specialized for a 2 parameter classification function (2D summed * area table). */ static void ClassifyOctree2(vpc) vpContext *vpc; { char *node_stack[VP_MAX_OCTREE_LEVELS]; /* stack of node addresses */ int count_stack[VP_MAX_OCTREE_LEVELS]; /* stack of node child counts; when count drops to zero, pop up a level */ int level; /* current octree level */ int max_level; /* highest octree level */ char *octree_root; /* root node of octree */ char *node; /* current octree node */ unsigned area; /* area computed from the summed-area table */ int status; /* classification status of current node */ unsigned *sum_table; /* summed area table */ int sum_table_dim1; /* size of last dimension of sum_table */ int p0max, p0min; /* parameter 0 extrema */ int p1max, p1min; /* parameter 1 extrema */ int p0size, p1size; /* parameter sizes */ int child_offset; /* offset of child field in node */ int status_offset; /* offset of status field in node */ int base_bytes_per_node; /* size of base node in bytes */ int nonbase_bytes_per_node; /* size of nonbase node in bytes */ int child_count; /* children left at current level */ /* initialize */ ASSERT(vpc->sum_table != NULL); ASSERT(vpc->mm_octree != NULL); ASSERT(vpc->mm_octree->root != NULL); ASSERT(vpc->sum_table_size == sizeof(unsigned) * (vpc->field_max[vpc->param_field[0]]+1) * (vpc->field_max[vpc->param_field[1]]+1)); sum_table = vpc->sum_table; max_level = vpc->mm_octree->levels - 1; octree_root = (char*)vpc->mm_octree->root; p0size = vpc->field_size[vpc->param_field[0]]; p1size = vpc->field_size[vpc->param_field[1]]; sum_table_dim1 = vpc->field_max[vpc->param_field[1]] + 1; status_offset = vpc->mm_octree->status_offset; child_offset = vpc->mm_octree->child_offset; base_bytes_per_node = vpc->mm_octree->base_bytes_per_node; nonbase_bytes_per_node = vpc->mm_octree->nonbase_bytes_per_node; node = octree_root; level = 0; /* do a depth-first, preorder traversal of the octree */ Debug((vpc, VPDEBUG_CLSFYOCTREE, "Classifying octree:\n")); while (1) { /* find min/max values for both parameters in this node */ if (p0size == 1) { p0min = ByteField(node, 0)-1; p0max = ByteField(node, 1); } else { p0min = ShortField(node, 0)-1; p0max = ShortField(node, 2); } if (p1size == 1) { p1min = ByteField(node, 2*p0size)-1; p1max = ByteField(node, 2*p0size+1); } else { p1min = ShortField(node, 2*p0size)-1; p1max = ShortField(node, 2*p0size+2); } /* integrate the opacities in the node using the summed area table */ area = sum_table[p0max * sum_table_dim1 + p1max]; if (p0min >= 0) { if (p1min >= 0) { area += sum_table[p0min * sum_table_dim1 + p1min]; area -= sum_table[p0max * sum_table_dim1 + p1min]; } area -= sum_table[p0min * sum_table_dim1 + p1max]; } else { if (p1min >= 0) area -= sum_table[p0max * sum_table_dim1 + p1min]; } /* decide if node is full, empty or partfull */ if (area == 0) { status = MM_EMPTY; } else if (level != max_level && IntField(node, child_offset) != 0 && area != (p1max - p1min)*(p0max - p0min)) { status = MM_PARTFULL; } else { status = MM_FULL; } ByteField(node, status_offset) = status; Debug((vpc, VPDEBUG_CLSFYOCTREE, " Level %d: node is %s (addr 0x%08x)\n", level, status == MM_EMPTY ? "empty" : (status == MM_FULL ? "full" : "partfull"), node)); /* move to next node in tree traversal */ if (status == MM_PARTFULL) { /* move down to first child in next level */ node = octree_root + IntField(node, child_offset); Debug((vpc, VPDEBUG_CLSFYOCTREE, " Descending. Children at offset %d, addr 0x%08x\n", IntField(node, child_offset), node)); node_stack[level] = node; count_stack[level] = 7; /* number of remaining children */ level++; ASSERT(level <= max_level); } else { do { /* move up to a node with unvisited children */ Debug((vpc, VPDEBUG_CLSFYOCTREE, " Ascending.\n")); level--; if (level < 0) break; child_count = count_stack[level]--; ASSERT(child_count >= 0 && child_count <= 7); } while (child_count == 0); if (level < 0) break; /* traversal of octree is done! */ /* descend to the next child of this node */ if (level == max_level-1) node = node_stack[level] + base_bytes_per_node; else node = node_stack[level] + nonbase_bytes_per_node; Debug((vpc, VPDEBUG_CLSFYOCTREE, " Descending to child at 0x%08x.\n", node)); node_stack[level] = node; level++; ASSERT(level <= max_level); } } /* while (1) */ } /* * VPInitOctreeLevelStack * * Initialize an MMOctreeLevel stack. */ void VPInitOctreeLevelStack(vpc, level_stack, axis, k) vpContext *vpc; MMOctreeLevel level_stack[VP_MAX_OCTREE_LEVELS]; int axis; /* principle viewing axis */ int k; /* current slice number */ { int max_level, level, last_node_size; int child_octant, child_bytes_per_node; int *octant_order; ASSERT(vpc->mm_octree != NULL); max_level = vpc->mm_octree->levels-1; level_stack[max_level].level_size = vpc->mm_octree->base_node_size; level_stack[max_level].child_octant = -1; level_stack[max_level].child_offset1 = -1; level_stack[max_level].child_offset2 = -1; level_stack[max_level].child2 = NULL; last_node_size = vpc->mm_octree->base_node_size; octant_order = OctantOrder[axis]; Debug((vpc, VPDEBUG_OCTREETRAVERSE, "Octants for next scanline:\n")); for (level = max_level-1; level >= 0; level--) { level_stack[level].level_size = last_node_size * 2; child_octant = ((k / last_node_size) & 1) * MM_K_BIT; last_node_size *= 2; level_stack[level].child_octant = child_octant; if (level == max_level-1) child_bytes_per_node = vpc->mm_octree->base_bytes_per_node; else child_bytes_per_node = vpc->mm_octree->nonbase_bytes_per_node; ASSERT(child_octant >= 0 && child_octant < 7); ASSERT(octant_order[child_octant] >= 0 && octant_order[child_octant] < 8); level_stack[level].child_offset1 = octant_order[child_octant] * child_bytes_per_node; level_stack[level].child_offset2 = octant_order[child_octant+1] * child_bytes_per_node; Debug((vpc, VPDEBUG_OCTREETRAVERSE, " Level %d: %d, then %d\n", level,octant_order[child_octant],octant_order[child_octant+1])); } } /* * VPComputeScanRuns * * For a given voxel scanline, produce a sequence of run lengths * which give a conservative estimate of the non-transparent portions * of the scanline. The runs are computed by finding which nodes * of the classified min-max octree are intersected by the scanline. * * The return value is the number of scanlines for which this run data * is valid. */ int VPComputeScanRuns(vpc, level_stack, run_lengths, axis, j, icount) vpContext *vpc; MMOctreeLevel level_stack[VP_MAX_OCTREE_LEVELS]; /* saved state */ unsigned char *run_lengths; /* storage for run lengths */ int axis; /* principle viewing axis */ int j; /* scanline number */ int icount; /* scanline length */ { int octree_maxlevel; int level; int max_level = vpc->mm_octree->levels-1; int child_octant, child_bytes_per_node; int base_bytes_per_node, nonbase_bytes_per_node; int i; char *octree_root, *node; int run_type; int run_length; int run_piece; int status_offset; int child_offset; int status; int *octant_order; Debug((vpc, VPDEBUG_OCTREERUNS, "Runs for scanline %d:\n", j)); Debug((vpc, VPDEBUG_OCTREETRAVERSE, "Traversal for scanline %d:\n", j)); ASSERT(vpc->mm_octree != NULL); ASSERT(vpc->mm_octree->root != NULL); base_bytes_per_node = vpc->mm_octree->base_bytes_per_node; nonbase_bytes_per_node = vpc->mm_octree->nonbase_bytes_per_node; status_offset = vpc->mm_octree->status_offset; child_offset = vpc->mm_octree->child_offset; octree_maxlevel = -1; i = icount; octree_root = (char*)vpc->mm_octree->root; node = octree_root; level = 0; run_type = MM_EMPTY; run_length = 0; octant_order = OctantOrder[axis]; /* traverse the octree */ while (1) { /* descend tree to next node which is not partfull */ while (1) { status = ByteField(node, status_offset); Debug((vpc, VPDEBUG_OCTREETRAVERSE, " Node at level %d: %s\n", level, status == MM_PARTFULL ? "partfull" : (status == MM_FULL ? "full" : "empty"))); ASSERT(status == MM_PARTFULL || status == MM_FULL || status == MM_EMPTY); if (status != MM_PARTFULL) break; ASSERT(IntField(node, child_offset) != 0); Debug((vpc, VPDEBUG_OCTREETRAVERSE, " Children at base %d, offsets %d, %d; ", IntField(node, child_offset), level_stack[level].child_offset1, level_stack[level].child_offset2)); Debug((vpc, VPDEBUG_OCTREETRAVERSE, "status %d, %d\n", ByteField(octree_root + IntField(node, child_offset) + level_stack[level].child_offset1, status_offset), ByteField(octree_root + IntField(node, child_offset) + level_stack[level].child_offset2, status_offset))); node = octree_root + IntField(node, child_offset); level_stack[level].child2 = node+level_stack[level].child_offset2; node += level_stack[level].child_offset1; level++; Debug((vpc, VPDEBUG_OCTREETRAVERSE, " Descending.\n")); ASSERT(level < vpc->mm_octree->levels); } if (level > octree_maxlevel) octree_maxlevel = level; /* add current node to the list of runs */ run_piece = MIN(level_stack[level].level_size, i); i -= run_piece; if (status == run_type) { run_length += run_piece; } else { Debug((vpc, VPDEBUG_OCTREETRAVERSE, " New run.\n")); while (run_length > 255) { Debug((vpc, VPDEBUG_OCTREERUNS, " 255 0")); *run_lengths++ = 255; *run_lengths++ = 0; run_length -= 255; } Debug((vpc, VPDEBUG_OCTREERUNS, " %d", run_length)); *run_lengths++ = run_length; run_type ^= 1; run_length = run_piece; } Debug((vpc, VPDEBUG_OCTREETRAVERSE, " Added %d to run.\n", run_piece)); if (i == 0) break; /* traversal is done */ /* move back up the tree to the next node with unvisited children */ do { Debug((vpc, VPDEBUG_OCTREETRAVERSE, " Ascending.\n")); level--; ASSERT(level >= 0); } while (level_stack[level].child2 == NULL); /* descend to next child */ Debug((vpc, VPDEBUG_OCTREETRAVERSE, " Next child--descending.\n")); node = (char*)level_stack[level].child2; level_stack[level].child2 = NULL; level++; ASSERT(level < vpc->mm_octree->levels); } /* while (1) */ /* write out the last run */ while (run_length > 255) { Debug((vpc, VPDEBUG_OCTREERUNS, " 255 0")); *run_lengths++ = 255; *run_lengths++ = 0; run_length -= 255; } Debug((vpc, VPDEBUG_OCTREERUNS, " %d", run_length)); *run_lengths++ = run_length; if (run_type == MM_EMPTY) { Debug((vpc, VPDEBUG_OCTREERUNS, " 0")); *run_lengths++ = 0; } Debug((vpc, VPDEBUG_OCTREERUNS, "\n")); Debug((vpc, VPDEBUG_OCTREETRAVERSE, "Covered %d scanlines.\n", level_stack[octree_maxlevel].level_size)); /* update state for next scanline: adjust child_octant and then use it to compute child_offset1 and child_offset2 */ j += level_stack[octree_maxlevel].level_size; max_level = vpc->mm_octree->levels-1; Debug((vpc, VPDEBUG_OCTREETRAVERSE, "Octants for next scanline:\n")); for (level = max_level-1; level >= 0; level--) { child_octant = level_stack[level].child_octant; if (level >= octree_maxlevel) child_octant &= MM_K_BIT; else if ((j & (level_stack[level].level_size/2)) == 0) child_octant &= ~MM_J_BIT; else child_octant |= MM_J_BIT; level_stack[level].child_octant = child_octant; if (level == max_level-1) child_bytes_per_node = base_bytes_per_node; else child_bytes_per_node = nonbase_bytes_per_node; level_stack[level].child_offset1 = octant_order[child_octant] * child_bytes_per_node; level_stack[level].child_offset2 = octant_order[child_octant+1] * child_bytes_per_node; Debug((vpc, VPDEBUG_OCTREETRAVERSE, " Level %d: %d, then %d\n", level,octant_order[child_octant],octant_order[child_octant+1])); } /* return the number of scanlines for which the run lengths are valid (which is the size of the smallest octree node the scanline hit) */ return(level_stack[octree_maxlevel].level_size); } /* * vpOctreeMask * * Fill a 3D array with a mask computed from an octree. * Each array element is set to one of three values depending upon * the value of the corresponding voxel in the octree: * 0 voxel is definitely transparent * 255 voxel may be non-transparent * 128 voxel may be non-transparent, and more detailed information * is available at deeper levels of the octree which were not * visited */ vpResult vpOctreeMask(vpc, array, array_size, max_level) vpContext *vpc; /* context */ unsigned char *array; /* array for result */ int array_size; /* size of array in bytes */ int max_level; { int retcode; /* error checks */ if (vpc->mm_octree == NULL) return(VPSetError(vpc, VPERROR_BAD_SIZE)); if ((retcode = VPCheckClassifier(vpc)) == 0) return(retcode); if (array_size != vpc->xlen*vpc->ylen*vpc->zlen) return(VPSetError(vpc, VPERROR_BAD_SIZE)); /* classify the octree */ VPComputeSummedAreaTable(vpc); VPClassifyOctree(vpc); ComputeOctreeMask(vpc, 0, 0, 0, 0, vpc->mm_octree->root_node_size, vpc->mm_octree->root, array, max_level); return(VP_OK); } /* * ComputeOctreeMask * * Recursive helper function for vpOctreeMask. */ static void ComputeOctreeMask(vpc, level, xn, yn, zn, node_size, parent_node, array, max_level) vpContext *vpc; /* context */ int level; /* current level */ int xn, yn, zn; /* current node coordinates (in coordinate system of the current level) */ int node_size; /* voxel per side of node at this level */ void *parent_node; /* parent octree node */ unsigned char *array; /* array for storing result */ int max_level; /* deepest level of the tree to visit */ { char *child_node, *octree_root; int child_bytes_per_node; int child_offset; int status_offset; int status, value; int x, y, z, x0, y0, z0, x1, y1, z1; int array_ystride, array_zstride; /* initialize */ status_offset = vpc->mm_octree->status_offset; child_offset = vpc->mm_octree->child_offset; if (level == vpc->mm_octree->levels-2) child_bytes_per_node = vpc->mm_octree->base_bytes_per_node; else child_bytes_per_node = vpc->mm_octree->nonbase_bytes_per_node; octree_root = (char*)vpc->mm_octree->root; /* base case */ status = ByteField(parent_node, status_offset); if (level == max_level || status != MM_PARTFULL) { if (status == MM_EMPTY) value = 0; else if (status == MM_FULL) value = 255; else if (status == MM_PARTFULL) value = 128; else VPBug("bad status value in ComputeOctreeMask, nodeaddr = 0x%08x", parent_node); x0 = xn * node_size; y0 = yn * node_size; z0 = zn * node_size; x1 = MIN(x0 + node_size, vpc->xlen) - 1; y1 = MIN(y0 + node_size, vpc->ylen) - 1; z1 = MIN(z0 + node_size, vpc->zlen) - 1; array_ystride = vpc->xlen; array_zstride = vpc->xlen * vpc->ylen; for (z = z0; z <= z1; z++) { for (y = y0; y <= y1; y++) { for (x = x0; x <= x1; x++) { array[z*array_zstride + y*array_ystride + x] = value; } } } return; } ASSERT(IntField(parent_node, child_offset) != 0); /* visit children */ child_node = octree_root + IntField(parent_node, child_offset); ComputeOctreeMask(vpc, level+1, xn*2, yn*2, zn*2, node_size/2, child_node, array, max_level); child_node += child_bytes_per_node; ComputeOctreeMask(vpc, level+1, xn*2+1, yn*2, zn*2, node_size/2, child_node, array, max_level); child_node += child_bytes_per_node; ComputeOctreeMask(vpc, level+1, xn*2, yn*2+1, zn*2, node_size/2, child_node, array, max_level); child_node += child_bytes_per_node; ComputeOctreeMask(vpc, level+1, xn*2+1, yn*2+1, zn*2, node_size/2, child_node, array, max_level); child_node += child_bytes_per_node; ComputeOctreeMask(vpc, level+1, xn*2, yn*2, zn*2+1, node_size/2, child_node, array, max_level); child_node += child_bytes_per_node; ComputeOctreeMask(vpc, level+1, xn*2+1, yn*2, zn*2+1, node_size/2, child_node, array, max_level); child_node += child_bytes_per_node; ComputeOctreeMask(vpc, level+1, xn*2, yn*2+1, zn*2+1, node_size/2, child_node, array, max_level); child_node += child_bytes_per_node; ComputeOctreeMask(vpc, level+1, xn*2+1,yn*2+1,zn*2+1, node_size/2, child_node, array, max_level); } #ifdef DEBUG /* * VPCheckRuns * * Check a scanline of run lengths for validity by comparing it to * the raw volume data. Return value is the number of voxels in * nonzero runs which are actually zero (due to conservative * approximations.) If an error is detected then VPBug is called. */ int VPCheckRuns(vpc, run_lengths, axis, k, j) vpContext *vpc; unsigned char *run_lengths;/* run lengths */ int axis; /* principle viewing axis */ int k; /* slice number */ int j; /* scanline number */ { char *voxel; int i; int icount; int count; int is_non_zero; int num_runs; float opacity; int badpredictions; int istride; switch (axis) { case VP_X_AXIS: voxel = (char *)vpc->raw_voxels + k*vpc->xstride + j*vpc->zstride; istride = vpc->ystride; icount = vpc->ylen; break; case VP_Y_AXIS: voxel = (char *)vpc->raw_voxels + k*vpc->ystride + j*vpc->xstride; istride = vpc->zstride; icount = vpc->zlen; break; case VP_Z_AXIS: voxel = (char *)vpc->raw_voxels + k*vpc->zstride + j*vpc->ystride; istride = vpc->xstride; icount = vpc->xlen; break; default: VPBug("bad axis in VPCheckRuns"); } count = 0; is_non_zero = 1; num_runs = 0; badpredictions = 0; for (i = 0; i < icount; i++) { while (count == 0) { count = *run_lengths++; is_non_zero = !is_non_zero; if (++num_runs > icount) VPBug("runaway scanline detected by VPCheckRuns"); } opacity = VPClassifyVoxel(vpc, voxel); if (opacity > vpc->min_opacity && fabs(opacity - vpc->min_opacity) > 0.001) { if (!is_non_zero) { printf("\n"); printf("VPCheckRuns: error on voxel (i,j,k)=(%d,%d,%d), ", i, j, k); printf("viewaxis %d\n", axis); printf("Actual opacity: %17.15f\n", opacity); printf("Threshold: %17.15f\n", vpc->min_opacity); VPDumpView(vpc); VPDumpClassifier(vpc); VPBug("nonzero voxel in zero run detected by VPCheckRuns"); } } else { if (is_non_zero) badpredictions++; } voxel += istride; count--; } if (count != 0) VPBug("run that overshoots end of scanline detected by VPCheckRuns"); if (!is_non_zero) { if (*run_lengths != 0) VPBug("missing 0 run at end of scanline detected by VPCheckRuns"); } return(badpredictions); } /* * VPTestMinMaxOctree * * Test out the MinMaxOctree routines. */ void VPTestMinMaxOctree(vpc) vpContext *vpc; { int x, y, z; MMOctreeLevel level_stack[VP_MAX_OCTREE_LEVELS]; unsigned char run_lengths[VP_MAX_VOLUME_DIM]; int badpredictions; int scans_left; float accuracy; ASSERT(vpc->mm_octree != NULL); VPComputeSummedAreaTable(vpc); VPClassifyOctree(vpc); badpredictions = 0; printf("Checking +Z axis runs...\n"); for (z = 0; z < vpc->zlen; z++) { ReportStatus(vpc, (double)z / (double)vpc->zlen); Debug((vpc, VPDEBUG_OCTREERUNS, "*** Slice %d ***\n", z)); VPInitOctreeLevelStack(vpc, level_stack, VP_Z_AXIS, z); scans_left = 0; for (y = 0; y < vpc->ylen; y++) { if (scans_left == 0) { scans_left = VPComputeScanRuns(vpc, level_stack, run_lengths, VP_Z_AXIS, y, vpc->xlen); } scans_left--; badpredictions += VPCheckRuns(vpc, run_lengths, VP_Z_AXIS, z, y); } } ReportStatus(vpc, 1.0); accuracy = 1. - ((double)badpredictions / (double)(vpc->xlen*vpc->ylen*vpc->zlen)); printf("VPTestMinMaxOctree: PASSED.\n"); printf("Prediction accuracy: %.1f%% (%d bad predictions)\n", accuracy*100., badpredictions); badpredictions = 0; printf("Checking +Y axis runs...\n"); for (y = 0; y < vpc->ylen; y++) { ReportStatus(vpc, (double)y / (double)vpc->ylen); Debug((vpc, VPDEBUG_OCTREERUNS, "*** Slice %d ***\n", y)); VPInitOctreeLevelStack(vpc, level_stack, VP_Y_AXIS, y); scans_left = 0; for (x = 0; x < vpc->xlen; x++) { if (scans_left == 0) { scans_left = VPComputeScanRuns(vpc, level_stack, run_lengths, VP_Y_AXIS, x, vpc->zlen); } scans_left--; badpredictions += VPCheckRuns(vpc, run_lengths, VP_Y_AXIS, y, x); } } ReportStatus(vpc, 1.0); accuracy = 1. - ((double)badpredictions / (double)(vpc->xlen*vpc->ylen*vpc->zlen)); printf("VPTestMinMaxOctree: PASSED.\n"); printf("Prediction accuracy: %.1f%% (%d bad predictions)\n", accuracy*100., badpredictions); badpredictions = 0; printf("Checking +X axis runs...\n"); for (x = 0; x < vpc->xlen; x++) { ReportStatus(vpc, (double)x / (double)vpc->xlen); Debug((vpc, VPDEBUG_OCTREERUNS, "*** Slice %d ***\n", x)); VPInitOctreeLevelStack(vpc, level_stack, VP_X_AXIS, x); scans_left = 0; for (z = 0; z < vpc->zlen; z++) { if (scans_left == 0) { scans_left = VPComputeScanRuns(vpc, level_stack, run_lengths, VP_X_AXIS, z, vpc->ylen); } scans_left--; badpredictions += VPCheckRuns(vpc, run_lengths, VP_X_AXIS, x, z); } } ReportStatus(vpc, 1.0); accuracy = 1. - ((double)badpredictions / (double)(vpc->xlen*vpc->ylen*vpc->zlen)); printf("VPTestMinMaxOctree: PASSED.\n"); printf("Prediction accuracy: %.1f%% (%d bad predictions)\n", accuracy*100., badpredictions); badpredictions = 0; printf("Checking -Z axis runs...\n"); for (z = vpc->zlen-1; z >= 0; z--) { ReportStatus(vpc, (double)(vpc->zlen-1-z) / (double)vpc->zlen); Debug((vpc, VPDEBUG_OCTREERUNS, "*** Slice %d ***\n", z)); VPInitOctreeLevelStack(vpc, level_stack, VP_Z_AXIS, z); scans_left = 0; for (y = 0; y < vpc->ylen; y++) { if (scans_left == 0) { scans_left = VPComputeScanRuns(vpc, level_stack, run_lengths, VP_Z_AXIS, y, vpc->xlen); } scans_left--; badpredictions += VPCheckRuns(vpc, run_lengths, VP_Z_AXIS, z, y); } } ReportStatus(vpc, 1.0); accuracy = 1. - ((double)badpredictions / (double)(vpc->xlen*vpc->ylen*vpc->zlen)); printf("VPTestMinMaxOctree: PASSED.\n"); printf("Prediction accuracy: %.1f%% (%d bad predictions)\n", accuracy*100., badpredictions); badpredictions = 0; printf("Checking -Y axis runs...\n"); for (y = vpc->ylen-1; y >= 0; y--) { ReportStatus(vpc, (double)(vpc->ylen-1-y) / (double)vpc->ylen); Debug((vpc, VPDEBUG_OCTREERUNS, "*** Slice %d ***\n", y)); VPInitOctreeLevelStack(vpc, level_stack, VP_Y_AXIS, y); scans_left = 0; for (x = 0; x < vpc->xlen; x++) { if (scans_left == 0) { scans_left = VPComputeScanRuns(vpc, level_stack, run_lengths, VP_Y_AXIS, x, vpc->zlen); } scans_left--; badpredictions += VPCheckRuns(vpc, run_lengths, VP_Y_AXIS, y, x); } } ReportStatus(vpc, 1.0); accuracy = 1. - ((double)badpredictions / (double)(vpc->xlen*vpc->ylen*vpc->zlen)); printf("VPTestMinMaxOctree: PASSED.\n"); printf("Prediction accuracy: %.1f%% (%d bad predictions)\n", accuracy*100., badpredictions); badpredictions = 0; printf("Checking -X axis runs...\n"); for (x = vpc->xlen-1; x >= 0; x--) { ReportStatus(vpc, (double)(vpc->xlen-1-x) / (double)vpc->xlen); Debug((vpc, VPDEBUG_OCTREERUNS, "*** Slice %d ***\n", x)); VPInitOctreeLevelStack(vpc, level_stack, VP_X_AXIS, x); scans_left = 0; for (z = 0; z < vpc->zlen; z++) { if (scans_left == 0) { scans_left = VPComputeScanRuns(vpc, level_stack, run_lengths, VP_X_AXIS, z, vpc->ylen); } scans_left--; badpredictions += VPCheckRuns(vpc, run_lengths, VP_X_AXIS, x, z); } } ReportStatus(vpc, 1.0); accuracy = 1. - ((double)badpredictions / (double)(vpc->xlen*vpc->ylen*vpc->zlen)); printf("VPTestMinMaxOctree: PASSED.\n"); printf("Prediction accuracy: %.1f%% (%d bad predictions)\n", accuracy*100., badpredictions); } #else int VPCheckRuns(vpc, run_lengths, axis, k, j) vpContext *vpc; unsigned char *run_lengths;/* run lengths */ int axis; /* principle viewing axis */ int k; /* slice number */ int j; /* scanline number */ { return 0; } void VPTestMinMaxOctree(vpc) vpContext *vpc; { } #endif /* DEBUG */ ccseapps-2.5/CCSEApps/volpack/.cvsignore0000644000175000017500000000027611634153073021323 0ustar amckinstryamckinstryconfig.log Makefile config.cache config.status config.h vp_opts.c vp_compA????.c vp_warpA????.c makeopts ti_files Debug Release *__Win32_Debug *__Win32_Release volpack.ncb volpack.opt *.plg ccseapps-2.5/CCSEApps/volpack/classifyvolume.dsp0000644000175000017500000001123411634153073023074 0ustar amckinstryamckinstry# Microsoft Developer Studio Project File - Name="classifyvolume" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=classifyvolume - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "classifyvolume.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "classifyvolume.mak" CFG="classifyvolume - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "classifyvolume - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "classifyvolume - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe F90=df.exe RSC=rc.exe !IF "$(CFG)" == "classifyvolume - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE F90 /compile_only /nologo /warn:nofileopt # ADD F90 /compile_only /nologo /warn:nofileopt # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W1 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "classifyvolume - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "classifyvolume___Win32_Debug" # PROP BASE Intermediate_Dir "classifyvolume___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "classifyvolume___Win32_Debug" # PROP Intermediate_Dir "classifyvolume___Win32_Debug" # PROP Target_Dir "" # ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W1 /Gm /GX /ZI /Od /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "classifyvolume - Win32 Release" # Name "classifyvolume - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" # Begin Source File SOURCE=.\examples\classifyvolume.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ccseapps-2.5/CCSEApps/volpack/man/0000755000175000017500000000000011634153073020071 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/volpack/man/src/0000755000175000017500000000000011634153073020660 5ustar amckinstryamckinstryccseapps-2.5/CCSEApps/volpack/man/src/Timer.30000644000175000017500000001056211634153073022030 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpGetTimer 3 "" VolPack .SH NAME vpGetTimer, vpClearTimer \- interval timer facility .SH SYNOPSIS #include .sp .FS vpResult \fBvpGetTimer(\fIvpc, option, iptr\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FA int *\fIiptr;\fR; .FE .sp .FS vpResult \fBvpClearTimer(\fIvpc, option\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIoption\fR Constant that specifies a particular timer. .IP \fIiptr\fR Location for storing the timer value. .SH DESCRIPTION These functions are used for measuring the performance of the VolPack library. To use them, the library must be compiled with a special flag: either -DHAVE_LORES_TIMER (for machine that support the gettimeofday C library call) or -DHAVE_HIRES_TIMER (for SGI machines that support high-resolution memory-mapped I/O timers; on a Challenge or ONYX, the -DHAVE_64BIT_TIMER must also be specified). If one of these flags is specified at compile time then VolPack maintains a table recording the accumulated time spent in various operations. Note that some of the operations can only be timed with a high-resolution timer; time values will not be recorded and will appear to be zero if a low resolution timer is specified at compile time. .PP \fBvpGetTimer\fR retrieves the accumulated time for a particular operation. The \fIoption\fR argument specifies which operation: .IP VPTIMER_SHADE Time the routine that computes the contents of the shading lookup table. .IP VPTIMER_RENDER Time the routine that renders a volume (includes VPTIMER_CLSFY_OCTREE, VPTIMER_COMPOSITE, VPTIMER_DEPTHCUE, and VPTIMER_WARP). .IP VPTIMER_COMPOSITE Time the routine that computes the intermediate image from the volume (includes VPTIMER_CLEAR, VPTIMER_TRAVERSE_OCTREE, VPTIMER_ERT, VPTIMER_TRAVERSE_RUNS, and VPTIMER_PROCESS_VOXELS). .IP VPTIMER_DEPTHCUE Time the routine that performs the depth cueing fixup on the intermediate image. .IP VPTIMER_WARP Time the routine that warps the intermediate image into the final image. .IP VPTIMER_TRAVERSE_RUNS Time the portion of the compositing routine devoted to traversing the volume data structures. .IP VPTIMER_PROCESS_VOXELS Time the portion of the compositing routine devoted to compositing voxels into the intermediate image. .IP VPTIMER_ERT Time the early-ray termination checks during compositing. .IP VPTIMER_CLSFY_OCTREE Time the octree classification stage. .IP VPTIMER_TRAVERSE_OCTREE Time the portion of the compositing routine devoted to traversing the octree. .IP VPTIMER_CLEAR Time the routine that clears the intermediate image at the beginning of compositing. .LP The routine stores the accumulated time since the last call to \fIvpClearTimer\fR (or since the beginning of the program) in the location specified by \fIiptr.\fR The units of the value are microseconds. .PP \fIvpClearTimer\fR sets the specified timer value back to zero. .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_OPTION The \fIoption\fR argument is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3) ccseapps-2.5/CCSEApps/volpack/man/src/Extract.30000644000175000017500000001502311634153073022357 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpExtract 3 "" VolPack .SH NAME vpExtract \- extract one field from a rectangular region of a volume .SH SYNOPSIS #include .sp .FS vpResult \fBvpExtract(\fIvpc, volume_type, x0, y0, z0, x1, y1, z1, field, dst, dst_size, dst_xstride, dst_ystride, dst_zstride\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIvolume_type;\fR .FA int \fIx0, y0, z0;\fR .FA int \fIx1, y1, z1;\fR .FA int \fIfield;\fR .FA void *\fIdst;\fR .FA int \fIdst_size;\fR .FA int \fIdst_xstride, dst_ystride, dst_zstride;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIvolume_type\fR A code indicating which volume data structure to extract the region from (VP_RAW_VOLUME, VP_CLASSIFIED_VOLUME, VP_CLX_VOLUME, VP_CLY_VOLUME or VP_CLZ_VOLUME) .IP "\fIx0, y0, z0\fR" Origin of the extracted region in the voxel array. .IP "\fIx1, y1, z1\fR" Opposite corner of the extracted region in the voxel array. .IP \fIfield\fR A voxel field number identifying the field to extract, or one of these special codes: VP_OPACITY_FIELD, VP_CORRECTED_OPAC_FIELD, VP_COLOR_FIELD. .IP \fIdst\fR Destination array. .IP \fIdst_size\fR Size of destination array in bytes. .IP "\fIdst_xstride, dst_ystride, dst_zstride\fR" Strides (in bytes) for the X, Y and Z dimensions of the destination array. .SH DESCRIPTION \fBvpExtract\fR is used to extract one field from a rectangular region of the 3D voxel array or the preclassified volume and store the result in a separate array. It is also possible to retrieve computed voxel opacities or colors. .PP The \fIvolume_type\fR argument is used to choose which data structure the region should be extracted from. The choices are: .IP VP_RAW_VOLUME Extract from the 3D voxel array (see vpSetRawVoxels(3)). .IP VP_CLASSIFIED_VOLUME Extract from the preclassified volume (see vpClassifyVolume(3)). The are three copies of the voxel data in the preclassified volume, one for each principal viewing axis. The copy which will result in the fastest access (best memory stride) is selected. .IP VP_CLX_VOLUME Extract from the preclassified volume used for X-axis viewing. .IP VP_CLY_VOLUME Extract from the preclassified volume used for Y-axis viewing. .IP VP_CLZ_VOLUME Extract from the preclassified volume used for Z-axis viewing. .PP The last three choices for the \fIvolume_type\fR argument are usually used only for debugging. .PP The next six arguments give the coordinates of the corners of the extracted region in the volume. The coordinates are indexes into the array. .PP The \fIfield\fR argument is used to select which voxel field to extract. Any of the voxel field numbers previously specified with \fBvpVoxelField\fR may be specified. The output array must be sized appropriately for the dimensions of the region and the size of the extracted field. The following special constants may also be used instead of a voxel field number: .IP VP_OPACITY_FIELD Return voxel opacities for voxels in the indicated region. If the 3D voxel array is selected then the opacities are computed on-the-fly using the current opacity transfer function. The minimum opacity threshold is ignored. If the preclassified volume is selected then the precomputed opacities are extracted. Opacities below the minimum opacity threshold at the time the volume was classified are set to 0. The output array should have type unsigned char, and the opacities are stored as number between 0 (transparent) and 255 (opaque). .IP VP_CORRECTED_OPAC_FIELD This option is the same as the VP_OPACITY_FIELD option, except that voxel opacities are corrected for the current view transformation. The opacity transfer function is assumed to produce the opacity of a voxel viewed perpendicular to one face of the volume with no scale factor. If the voxel has been scaled or rotated with respect to the viewer then the apparent opacity must be corrected. .IP VP_COLOR_FIELD Return voxel colors for voxels in the indicated region. The colors are computed on-the-fly using the current shading, lighting and material parameters. The output array should have type unsigned char, and each color channel is stored as number between 0 (off) and 255 (full intensity). The number of color channels per pixels is determined by the current shading parameters. (Not currently supported for preclassified volumes.) .PP The remaining arguments specify the output array, its size (for error checking), and the stride for each dimension (to allow padding the end of scanlines or storing the result in a higher-dimension array). .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VALUE The volume coordinates are out of bounds or invalid (x0 > x1, etc.), or the field number is invalid. .IP VPERROR_BAD_SIZE The destination array size is incorrect. .IP VPERROR_BAD_VOLUME The volume data does not exist. .IP VPERROR_BAD_OPTION The \fIvolume_type\fR argument is invalid. .IP VPERROR_BAD_VOLUME The volume size or data is missing or invalid. .IP VPERROR_BAD_VOXEL The voxel fields are incorrectly defined. .IP VPERROR_BAD_CLASSIFIER The opacity transfer function is incorrectly specified. .IP VPERROR_BAD_SHADER The shading parameters have been incorrectly specified. .IP VPERROR_SINGULAR One or more of the view transformation matrices is singular. .SH SEE ALSO VolPack(3), vpCreateContext(3) ccseapps-2.5/CCSEApps/volpack/man/src/VolumeSize.30000644000175000017500000000444011634153073023050 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetVolumeSize 3 "" VolPack .SH NAME vpSetVolumeSize \- define the dimensions of a volume .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetVolumeSize(\fIvpc, xlen, ylen, zlen\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIxlen, ylen, zlen;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIxlen\fR Size of first dimension of the volume in voxels. .IP \fIylen\fR Size of the second dimension of the volume in voxels. .IP \fIzlen\fR Size of the third dimension of the volume in voxels. .SH DESCRIPTION \fBvpSetVolumeSize\fR is used to define the dimensions of a volume. It must be called before volume data is loaded into a rendering context. Any existing precomputed volume data structures in the context are destroyed. .SH "STATE VARIABLES" The current volume dimensions may be retrieved with the following state variable codes (see vpGeti(3)): VP_XLEN, VP_YLEN, VP_ZLEN. .SH ERRORS The return value is always VP_OK. .SH SEE ALSO VolPack(3), vpCreateContext(3)ccseapps-2.5/CCSEApps/volpack/man/src/Transpose.30000644000175000017500000000601011634153073022717 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpTranspose 3 "" VolPack .SH NAME vpTranspose \- transpose a volume .SH SYNOPSIS #include .sp .FS vpResult \fBvpTranspose(\fIvpc, axis\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIaxis;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIaxis\fR Axis which should have the smallest stride after transposing (VP_X_AXIS, VP_Y_AXIS or VP_Z_AXIS). .SH DESCRIPTION \fBvpTranspose\fR is used to transpose the 3D voxel array to optimize the memory stride for a particular principal viewing axis. The intended way to use this function is to set the viewing transformation, call \fBvpGeti\fR with the VP_VIEW_AXIS argument to find the corresponding viewing axis, and then call \fBvpTranspose\fR with that axis. Transposing the data changes the arrangement of the data stored in the 3D voxel array. The voxel stride state variables are updated to reflect this change, so the viewing transformation does not need to be changed after transposing. If the volume is already transposed for the requested axis then it returns immediately without modifying the voxel array. .PP This function is useful only for rendering large 3D voxel arrays. This function has no affect on the preclassified volume data. .SH "STATE VARIABLES" Relevant variables may be retrieved with the following state variable codes (see vpGeti(3)): VP_VIEW_AXIS, VP_VOXEL_XSTRIDE, VP_VOXEL_YSTRIDE, VP_VOXEL_ZSTRIDE. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_OPTION The \fIaxis\fR argument is invalid. .IP VPERROR_BAD_VOLUME The 3D voxel array is missing or invalid. .IP VPERROR_BAD_VOXEL The voxel fields are incorrectly specified. .SH SEE ALSO VolPack(3), vpCreateContext(3) ccseapps-2.5/CCSEApps/volpack/man/src/Resample.30000644000175000017500000001461611634153073022524 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpResample 3 "" VolPack .SH NAME vpResample, vpResample2D, vpResample3D \- resample an array .SH SYNOPSIS #include .sp .FS vpResult \fBvpResample(\fIvpc, num_dimens, src_dimens, dst_dimens, src_strides, dst_strides, element_type, src_array, dst_array\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fInum_dimens;\fR .FA int \fI*src_dimens, *dst_dimens;\fR .FA int \fI*src_strides, *dst_strides;\fR .FA int \fIelement_type;\fR .FA void \fI*src_array, *dst_array;\fR .FE .sp .FS vpResult \fBvpResample2D(\fIsrc_array, src_x, src_y, dst_array, dst_x, dst_y, element_type, filter_type\fB)\fR .FA void *\fIsrc_array;\fR .FA int \fIsrc_x, src_y;\fR .FA void *\fIdst_array;\fR .FA int \fIdst_x, dst_y;\fR .FA int \fIelement_type;\fR .FA int \fIfilter_type;\fR .FE .sp .FS vpResult \fBvpResample3D(\fIsrc_array, src_x, src_y, src_z, dst_array, dst_x, dst_y, dst_z, element_type, filter_type\fB)\fR .FA void *\fIsrc_array;\fR .FA int \fIsrc_x, src_y, src_z;\fR .FA void *\fIdst_array;\fR .FA int \fIdst_x, dst_y, dst_z;\fR .FA int \fIelement_type;\fR .FA int \fIfilter_type;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fInum_dimens\fR Number of dimensions in the input and output arrays. .IP \fIsrc_dimens\fR Array containing the dimensions of the input array. .IP \fIdst_dimens\fR Array containing the dimensions of the output array. .IP \fIsrc_strides\fR Array containing the strides for each dimension of the input array. .IP \fIdst_strides\fR Array containing the strides for each dimension of the output array. .IP \fIelement_type\fR Constant specifying the data type of the array elements (VP_UCHAR, VP_USHORT, VP_FLOAT). .IP \fIsrc_array\fR Input array containing input data. .IP \fIdst_array\fR Output array for result data. .IP "\fIsrc_x, src_y, src_z\fR" Dimensions of the input array. .IP "\fIdst_x, dst_y, dst_z\fR" Dimensions of the result array. .IP \fIfilter_type\fR Constant specifying one of the predefined filters (VP_BOX_FILTER, VP_LINEAR_FILTER, VP_GAUSSIAN_FILTER, VP_BSPLINE_FILTER, VP_MITCHELL_FILTER). .SH DESCRIPTION \fBvpResample\fR is used to resample an array to a new grid with a different resolution. It can be used to scale up or decimate an array of volume data, for instance. An arbitrary separable space-invariant resampling filter can be specified via a lookup table containing filter weights. The input array may have an arbitrary number of dimensions, but on each call to \fBvpResample\fR only one dimension of the array is resampled. To scale all dimensions call the routine once for each dimension. Transformations other than scales (e.g. rotations and shears) are not supported by these routines. .PP The routines \fBvpResample2D\fR and \fBvpResample3D\fR provide a simpler (but less flexible) interface to \fBvpResample\fR. They take as arguments an input array with its dimensions, an output array with its dimensions, and a constant specifying a filter. The input array is resampled once for each dimension and then stored in the output array. These two routines automatically create a filter weight table and arrays for temporary results. .PP The remainder of this man page describe \fBvpResample\fR. The \fIvpc\fR argument is a VolPack context that contains a description of the resampling filter. Use \fBvpSetFilter\fR to define the filter. The volume data and rendering parameters currently stored in the context are not affected by calls to \fBvpResample\fR. .PP The remaining arguments to \fBvpResample\fR describe the size and layout of the input and output arrays. The two arrays must have the same number of dimensions, specified by \fInum_dimens.\fR The sizes of the dimensions are specified by \fIsrc_dimens\fR and \fIdst_dimens\fR which are 1D arrays with \fInum_dimens\fR elements in each array. \fIsrc_dimens[0]\fR is the size of the input dimension to be resampled. \fIdst_dimens[0]\fR is the size of the output dimension after resampling, so the scale factor is dst_dimens[0] / src_dimens[0]. The remaining elements of \fIsrc_dimens\fR give the sizes of the other input array dimensions in any order (although some orderings result in faster execution due to lower memory overhead). The other output array dimensions are ignored (although they should be the same as the corresponding input array dimensions since only one dimensions is resampled). .PP The \fIsrc_strides\fR and \fIdst_stride\fR arguments are 1D arrays that contain a stride in bytes for each dimension of the input and output arrays, stored in the same order as the dimensions sizes in \fIsrc_dimens\fR. .PP The \fIelement_type\fR argument specifies the data type of each element of the input and output data arrays. The supported types are: .IP VP_UCHAR Unsigned character (1 byte per element). .IP VP_USHORT Unsigned short (2 bytes per element). .IP VP_FLOAT Single-precision floating point (4 bytes per element). .PP Finally, the last two arguments to \fBvpResample\fR are pointers to the first elements of the input and output arrays. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_SIZE No filter weight table has been specified. .SH SEE ALSO VolPack(3), vpSetFilter(3) ccseapps-2.5/CCSEApps/volpack/man/src/MultMatrix.30000644000175000017500000000452611634153073023061 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpMultMatrix 3 "" VolPack .SH NAME vpMultMatrix \- multiply the current transformation matrix by another matrix .SH SYNOPSIS #include .sp .FS vpResult \fBvpMultMatrix(\fIvpc, m\fB)\fR .FA vpContext *\fIvpc;\fR .FA vpMatrix4 \fIm;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIm\fR Input matrix. .SH DESCRIPTION \fBvpMultMatrix\fR is used to multiply the current transformation matrix by an arbitrary 4-by-4 transformation matrix. Use \fBvpCurrentMatrix\fR to set the current transformation matrix. By default, the matrix is post-multiplied (N = N*\fIm\fR where N is the current matrix and \fIm\fR is the argument to \fBvpMultMatrix\fR). The VP_CONCAT_MODE option to \fBvpSeti\fR can be used to select pre-multiplication. .SH "STATE VARIABLES" The current matrix concatenation parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_CURRENT_MATRIX, VP_CONCAT_MODE. .SH ERRORS The return value is always VP_OK. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCurrentMatrix(3) ccseapps-2.5/CCSEApps/volpack/man/src/Material.30000644000175000017500000001434711634153073022513 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetMaterial 3 "" VolPack .SH NAME vpSetMaterial \- set material properties .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetMaterial(\fIvpc, material, property, surface_side, r, g, b\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fImaterial;\fR .FA int \fIproperty;\fR .FA int \fIsurface_side;\fR .FA double \fIr, g, b;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fImaterial\fR A constant specifying a particular material number (VP_MATERIAL0, VP_MATERIAL1, ..., VP_MATERIAL5). .IP \fIproperty\fR A constant specifying one material property (VP_AMBIENT, VP_DIFFUSE, VP_SPECULAR or VP_SHINYNESS). .IP \fIsurface_side\fR A constant specifying which side of the material surface the properties apply to (VP_EXTERIOR, VP_INTERIOR or VP_BOTH_SIDES). .IP "\fIr, g, b\fR" RGB components of the color associated with the property. For VP_SHINYNESS, \fIg\fR and \fIb\fR are not used. .SH DESCRIPTION \fBvpSetMaterial\fR is used to set the properties of a material type. Each voxel may be composed of a mixture of several different material types, as described in vpSetLookupShader(3). Each material type has its own color and light reflection properties. The properties are used as parameters to the Phong shading equation for computing the color of the material given a set of light sources and a viewing direction (see vpShadeTable(3)). .PP To initialize the material parameters, call \fBvpSetMaterial\fR for each property of each material type to be used. The total number of materials is specified as an argument to \fBvpSetLookupShader\fR. The first material is specified by the constant VP_MATERIAL0, the second is VP_MATERIAL1, and so on. .PP The VP_AMBIENT property specifies the RGB ambient light coefficients of the material. This term represents the intensity of background light reflected by the material. Each of the RGB components specifies the coefficient for the corresponding light basis function. The values of the coefficients should be in the range 0.0-1.0. Default: 0.1 .PP The VP_DIFFUSE property specifies the RGB diffuse light coefficients of the material. This term represents the fraction of incident light intensity that is reflected diffusely (with a dull, matte appearance). The values of the coefficients should be in the range 0.0-1.0. Default: 0.4 .PP The VP_SPECULAR property specifies the RGB specular light coefficients of the material. This term represents the fraction of incident light intensity that is reflected specularly (with a shiny, mirror-like appearance). The values of the coefficients should be in the range 0.0-1.0. Default: 0.5 .PP The VP_SHINYNESS property specifies a single exponent that modifies the spread of specular highlights. The higher the number, the smaller and more intense the specular highlights. The exponent is specified with the \fIr\fR argument and can have any value; the generally-useful range is 1.0 to 100.0. The \fIg\fR and \fIb\fR arguments are ignored for this property. Default: 10.0 .PP The \fIsurface_side\fR argument specifies which side of the material surface the properties apply to. By default, the "interior" side of a voxel is the side in the direction of the surface normal. During rendering, if the normal points closer to the direction of the viewer than the opposite of the normal then the viewer is looking at the exterior side of the voxel rather than the interior. Different material parameters can be applied to the two surface sides by calling \fBvpSetMaterial\fR separately for each side. The option VP_BOTH_SIDES allows the same property to be set for both sides with only one function call. It is possible to reverse the definition of interior and exterior sides by calling \fBvpEnable\fR with the VP_REVERSE_SURFACE_SIDES option. .PP Voxels are shaded using the following equation: .DS I = A + L * (D * n_dot_l + S * pow(n_dot_h, E)) .sp .ta 12 I intensity for one color channel .br A ambient intensity coefficient .br D diffuse reflection coefficient .br S specular reflection coefficient .br E shinyness .br L light intensity .br n_dot_l dot product of normal and light vectors .br n_dot_h dot product of normal and highlight vectors .DE This equation is evaluated separately for each color channel. If multiple light sources are enabled an additional term identical to the second term above is added for each light source (with different values for L, n_dot_l and n_dot_h corresponding to the particular light source). .SH "STATE VARIABLES" Information about the current material properties can be retrieved with the following state variable codes (see vpGeti(3)): VP_MATERIAL_COUNT, VP_REVERSE_SURFACE_SIDES .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VALUE Either the material number or the RGB components are invalid. .IP VPERROR_BAD_OPTION Either the \fIsurface_side\fR or \fIproperty\fR arguments are invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetLookupShader(3), vpShadeTable(3), vpGetMaterial(3) ccseapps-2.5/CCSEApps/volpack/man/src/GetMaterial.30000644000175000017500000000553211634153073023147 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpGetMaterial 3 "" VolPack .SH NAME vpGetMaterial \- get material properties .SH SYNOPSIS #include .sp .FS vpResult \fBvpGetMaterial(\fIvpc, material, property, surface_side, r_ptr, g_ptr, b_ptr\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fImaterial;\fR .FA int \fIproperty;\fR .FA int \fIsurface_side;\fR .FA double *\fIr_ptr,\fR *\fIg_ptr,\fR *\fIb_ptr;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fImaterial\fR A constant specifying a particular material number (VP_MATERIAL0, VP_MATERIAL1, ..., VP_MATERIAL5). .IP \fIproperty\fR A constant specifying one material property (VP_AMBIENT, VP_DIFFUSE, VP_SPECULAR or VP_SHINYNESS). .IP \fIsurface_side\fR A constant specifying one side of the material surface (VP_EXTERIOR or VP_INTERIOR). .IP "\fIr_ptr, g_ptr, b_ptr\fR" Locations to store the RGB components of the color associated with the property. For VP_SHINYNESS, \fIg_ptr\fR and \fIb_ptr\fR are not used. .SH DESCRIPTION \fBvpGetMaterial\fR is used to get the properties of a material type. The arguments are exactly analogous to \fBvpSetMaterial\fR except that the \fIsurface_side\fR argument may not be VP_BOTH_SIDES, and the final three arguments are pointers to locations for storing the material properties. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VALUE The material number is invalid. .IP VPERROR_BAD_OPTION Either the \fIsurface_side\fR or \fIproperty\fR arguments are invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetMaterial(3) ccseapps-2.5/CCSEApps/volpack/man/src/LookupShader.30000644000175000017500000002127511634153073023353 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetLookupShader 3 "" VolPack .SH NAME vpSetLookupShader \- specify shading lookup tables .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetLookupShader(\fIvpc, color_channels, num_materials, color_field, color_table, color_table_size, weight_field, weight_table, weight_table_size\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIcolor_channels, num_materials;\fR .FA int \fIcolor_field;\fR .FA float *\fIcolor_table;\fR .FA int \fIcolor_table_size;\fR .FA int \fIweight_field;\fR .FA float *\fIweight_table;\fR .FA int \fIweight_table_size;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIcolor_channels\fR The number of color channels per pixel (1 or 3). .IP \fInum_materials\fR The number of material types. .IP \fIcolor_field\fR Field number for voxel field containing color lookup table index. .IP \fIcolor_table\fR Color lookup table. .IP \fIcolor_table_size\fR Size of color lookup table in bytes. .IP \fIweight_field\fR Field number for voxel field containing material weight lookup table index. .IP \fIweight_table\fR Material weight lookup table. .IP \fIweight_table_size\fR Size of material weight lookup table in bytes. .SH DESCRIPTION \fBvpSetLookupShader\fR is used to specify lookup tables that define a shading function. The lookup-table shading algorithm provided by VolPack is designed to support the following shading model. Each voxel is assumed to contain a mixture of some set of basic material types. Each material type has its own shading parameters for the Phong shading equation (for example, the diffuse color components and the shinyness). The color of a voxel is found by computing a color for each material type and then combining the colors in proportion to the fraction of each material in the voxel. The shading model also supports directional (infinite-distance) light sources. .PP This shading model is implemented using lookup tables. The tables can be precomputed so that the shading equation does not have to be evaluated for every voxel. VolPack provides routines to compute the lookup tables (see vpShadeTable(3)). The lookup tables can also be used to implement other shading models by using a user-supplied routine to compute the contents of the tables. See vpSetDepthCueing(3) for information about depth cueing. .PP It is also possible to define a callback function that will be called to shade each voxel during rendering, instead of using a lookup table. This method allows more general shading models but slows down rendering. To define a callback shader, call \fBvpSetCallback\fR with the VP_GRAY_SHADE_FUNC or VP_RGB_SHADE_FUNC option code (see vpSetCallback(3)). The lookup tables are used if the last successful call to \fBvpSetLookupShader\fR occurred after the last successful call to \fBvpSetCallback\fR with one of the VP_*_SHADE_FUNC options. .PP The \fIcolor_channels\fR argument determines whether the shading table will contain grayscale (1 channel) or RGB (3 channel) pixels. The \fInum_materials\fR argument specifies the number of basic material types out of which each voxel can be composed (at least 1). The \fIcolor_table\fR and \fIweight_table\fR arguments specify two lookup tables, and the \fIcolor_field\fR and \fIweight_field\fR arguments specify two voxel fields that are used to index the tables. The size of the \fIcolor_table\fR array must be: .DS float \fIcolor_table[n][num_materials][color_channels];\fR .DE where \fIn\fR is the number of possible values in the \fIcolor_field\fR field of the voxel (the maximum value plus one). The size of the \fIweight_table\fR argument must be: .DS float \fIweight_table[m][num_materials];\fR .DE where \fIm\fR is the number of possible values in the \fIweight_field\fR field of the voxel (the maximum value plus one). If there is only one material then \fIweight_table\fR is not used and may be a NULL pointer. .PP During rendering the shading lookup tables are accessed as follows. Suppose a particular voxel to be shaded has the value \fIcolor_index\fR in the field specified by \fIcolor_field\fR and the value \fIweight_index\fR in the field specified by \fIweight_field\fR. For each material number \fImaterial_index,\fR a weighted color is computed from the formula: .DS color =\kx color_table[color_index][material_index] * .br \h'\nxu' weight_table[weight_index][material_index] .DE Then the weighted colors for each material type are added up to give the voxel color. If \fIcolor_table\fR contains RGB values then each component is treated separately using the above formula. If there is only one material type then the constant 1.0 is substituted for the \fIweight_table\fR value. .PP The suggested way to use the tables is as follows. The voxel field specified by \fIcolor_field\fR should contain an encoded surface normal vector; this should be the same field as the \fInorm_field\fR argument to \fBvpVolumeNormals\fR or \fBvpClassifyScalars\fR. In the \fIcolor_table\fR array, for each possible encoded surface normal (the \fIcolor\fR index) and material type (the \fImaterial\fR index) the array should contain the color of the material given the current viewing direction and lighting arrangement. The color is independent of the voxel location because the light sources are assumed to be infinitely distant. The function \fBvpShadeTable\fR initializes the contents of \fIcolor_table\fR in this way. .PP The voxel field specified by \fIweight_field\fR should contain some quantity that determines the material composition of the voxel. For example, a field containing the scalar value could be used. In the \fIweight_table\fR array, for each possible value of \fIweight_field\fR there should be one row of material occupancy fractions. Each entry should be a number in the range 0.0-1.0 that specifies the fraction of the voxel occupied by the corresponding material. For example, if there are two material types and a voxel's \fIweight_field\fR contains the value 62, then \fIweight_table\fR[62][0] gives the fraction of the voxel occupied by material 0, and \fIweight_table\fR[62][1] gives the fraction of the voxel occupied by material 1. Normally, the numbers in a given row of \fIweight_table\fR should add up to 1.0 (although special effects can be achieved by bending the rules). The function \fBvpRamp\fR is useful for initializing the weight table with piece-wise linear ramps. .PP The values in the shading lookup tables may be initialized before or after calling \fBvpSetLookupShader.\fR Typically \fBvpSetLookupShader\fR is called once at the beginning of a rendering session, and then the values in the shading tables are modified as the user changes the lighting and shading parameters or the viewing direction. .SH "STATE VARIABLES" Information about the current shading table parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_COLOR_CHANNELS, VP_SHADE_COLOR_TABLE, VP_SHADE_COLOR_SIZE, VP_SHADE_WEIGHT_TABLE, VP_SHADE_WEIGHT_SIZE, VP_SHADE_COLOR_FIELD, VP_SHADE_WEIGHT_FIELD, VP_MATERIAL_COUNT .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VALUE One or more of the arguments has an invalid value or is out of range. .IP VPERROR_LIMIT_EXCEEDED The \fInum_materials\fR argument has exceeded an internal limit. Change the value of VP_MAX_MATERIAL in volpack.h and recompile the VolPack library. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpShadeTable(3), vpSetCallback(3), vpRamp(3), vpVolumeNormals(3), vpClassifyScalars(3), vpSetDepthCueing(3) ccseapps-2.5/CCSEApps/volpack/man/src/GetLight.30000644000175000017500000000510611634153073022455 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpGetLight 3 "" VolPack .SH NAME vpGetLight \- get lighting properties .SH SYNOPSIS #include .sp .FS vpResult \fBvpGetLight(\fIvpc, light_num, property, n0_ptr, n1_ptr, n2_ptr\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIlight_num;\fR .FA int \fIproperty;\fR .FA double *\fIn0_ptr,\fR *\fIn1_ptr,\fR *\fIn2_ptr;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIlight_num\fR A constant specifying a particular light source (VP_LIGHT0, VP_LIGHT1, ..., VP_LIGHT5). .IP \fIproperty\fR A constant specifying one lighting property (VP_COLOR or VP_DIRECTION). .IP "\fIn0_ptr, n1_ptr, n2_ptr\fR" Locations for storing the result: components of an RGB color (for VP_COLOR) or a direction vector (for VP_DIRECTION). .SH DESCRIPTION \fBvpGetLight\fR is used to get the properties of a light source. The arguments are exactly analogous to \fBvpSetLight\fR except that the final three arguments are pointers to locations for storing the lighting properties. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_LIMIT_EXCEEDED The light number is invalid or exceeds an implementation limit. .IP VPERROR_BAD_OPTION The \fIproperty\fR argument is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetLight(3) ccseapps-2.5/CCSEApps/volpack/man/src/VolumeNormals.30000644000175000017500000001173611634153073023557 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpVolumeNormals 3 "" VolPack .SH NAME vpVolumeNormals \- compute surface normal vectors and gradient magnitudes for a volume .SH SYNOPSIS #include .sp .FS vpResult \fBvpVolumeNormals(\fIvpc, scalar_data, length, scalar_field, grad_field, norm_field\fB)\fR .FA vpContext *\fIvpc;\fR .FA unsigned char *\fIscalar_data;\fR .FA int \fIlength;\fR .FA int \fIscalar_field;\fR .FA int \fIgrad_field;\fR .FA int \fInorm_field;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIscalar_data\fR 3D array of scalar samples. .IP \fIlength\fR Size of \fIscalar_data\fR array in bytes. .IP \fIscalar_field\fR Voxel field number indicating the field in which to store the scalar samples. .IP \fIgrad_field\fR Voxel field number indicating the field in which to store the gradient magnitudes of the scalar samples. .IP \fInorm_field\fR Voxel field number indicating the field in which to store encoded surface normal vectors. .SH DESCRIPTION \fBvpVolumeNormals\fR is used to precompute values for voxel fields used in classification and shading algorithms. The input is a 3D array of scalar values; a separate routine is provided for processing scanlines of voxel data (see vpScanlineNormals(3)). For each voxel, the routine computes an approximation for the gradient of the scalar field (using a central-difference operator). From this vector the routine can compute the magnitude of the gradient, which is useful for some classification schemes (see vpSetClassifierTable(3)), and a surface normal vector in the direction of the gradient vector, which is used to implement lighting models (see vpShadeTable(3)). The scalar value, gradient magnitude and surface normal vector are then stored into the fields of the voxel array, which is separate from the array of scalar values. .PP The scalar array must be an array of 8-bit values (other sizes are not currently supported). The dimensions of the array must match the volume dimensions previously specified with \fBvpSetVolumeSize\fR. The \fIsize\fR argument is used to make sure the array has the correct size. The voxel array must also be initialized by calling \fBvpSetRawVoxels\fR prior to calling \fBvpVolumeNormals\fR. .PP The three voxel field number arguments indicate which voxel fields the computed information should be stored into, and which field the scalar samples should be copied to. The field numbers must correspond to appropriately-sized voxel fields previously specified with \fBvpSetVoxelField\fR. Any of these arguments can be the constant VP_SKIP_FIELD, in which case the corresponding quantity is not computed or copied. The voxel fields for the scalar value and the gradient magnitude must be one-byte fields, and the field for the surface normal vector must be a two-byte field. The constants VP_SCALAR_MAX, VP_GRAD_MAX and VP_NORM_MAX give the maximum value that might be stored in each field, respectively. The value stored in the surface normal vector field is actually an encoded surface normal; see vpNormalIndex(3). .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_SIZE The size of the scalar array does not match the volume dimensions. .IP VPERROR_BAD_VALUE One or more of the voxel fields specified is invalid, or the corresponding voxel field has the wrong size. .IP VPERROR_BAD_VOXEL The voxel size or the voxel fields have not been specified or have been incorrectly specified. .IP VPERROR_BAD_VOLUME The volume array or volume dimensions have not been specified, or the size of the volume array does not match the volume dimensions. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpNormalIndex(3), vpScanlineNormals(3), vpSetClassifierTable(3), vpSetLookupShader(3) ccseapps-2.5/CCSEApps/volpack/man/src/Load.30000644000175000017500000001524611634153073021633 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpLoadRawVolume 3 "" VolPack .SH NAME vpLoadRawVolume, vpLoadMinMaxOctree, vpLoadClassifiedVolume, vpLoadContext \- load volume data structures from a file .SH SYNOPSIS #include .sp .FS vpResult \fBvpLoadRawVolume(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .sp .FS vpResult \fBvpLoadMinMaxOctree(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .sp .FS vpResult \fBvpLoadClassifiedVolume(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .sp .FS vpResult \fBvpLoadContext(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIfd\fR File descriptor from \fBopen\fR(2), open for reading. .SH DESCRIPTION These functions are used to load volume data structures into a rendering context from files in the format written by the VolPack file storing routines (see vpStoreRawVolume(3)). .PP \fBvpLoadRawVolume\fR loads a 3D voxel array file. The file includes information about the size of the volume and the layout of the voxels as well as the volume data itself. A new voxel array is allocated, the data is read into the array, and the array is stored in the rendering context. Note that the array will not be freed automatically when the context is destroyed; the application is responsible for freeing the array when appropriate (by using \fBvpGetp\fR with the VP_VOXEL_DATA state variable code to retrieve the array pointer), or for unmapping the voxel array if it has been memory mapped (see below). .PP Any existing min-max octree or preclassified volume data is destroyed when \fBvpLoadRawVolume\fR is called. The information loaded from the file includes all of the parameters set with \fBvpSetVolumeSize\fR, \fBvpSetVoxelSize\fR, \fBvpSetVoxelField\fR and \fBvpSetRawVoxels\fR. The data in the file is automatically byte-swapped if the file was written on an architecture with different byte ordering than the current architecture. A magic constant in the file is used to determine if byte-swapping is necessary. Volume fields that have not been explicitly declared (by calling \fBvpSetVoxelField\fR before storing the voxel array file) cannot be byte-swapped. .PP \fBvpLoadMinMaxOctree\fR loads a min-max octree file. The current 3D voxel array size and voxel layout must match the data in the octree file before the file is loaded; consistency checks are performed. Any existing octree is destroyed and the new octree is stored in the rendering context. Byte-swapping is performed if necessary. .PP \fBvpLoadClassifiedVolume\fR loads a preclassified volume data file. The file includes information about the size of the volume and the layout of the voxels as well as the volume data itself. If the volume matches the size and layout of any existing volume data in the rendering context then the data in the file replaces only the current preclassified volume; otherwise, the old octree is destroyed, the 3D voxel array parameters are zeroed out, and the new size and layout parameters are loaded. The information loaded from the file includes all of the parameters set with \fBvpSetVolumeSize\fR, \fBvpSetVoxelSize\fR and \fBvpSetVoxelField\fR. Byte-swapping is performed if necessary. .PP \fBvpLoadContext\fR loads a rendering context file. The file includes all rendering parameters except volume data and callback functions. The contents of any lookup tables for shading and classification are also loaded. Any existing preclassified volume data or octree are destroyed and the 3D voxel array parameters pointer is zeroed out. The lookup tables are loaded into dynamically allocated arrays, and the application is responsible for freeing those array when necessary; the arrays are not automatically freed when \fBvpDestroyContext\fR is called. In the current implementation byte swapping is not performed so context files from other architectures cannot be read. .PP The function used to read data from the files can be set by calling \fBvpSetCallback\fR with the VP_READ_FUNC option. This could be used to implement a file-compression system, for example. It is also possible to memory-map data from files by setting the VP_MMAP_FUNC option. If this function is set then large data structures are memory mapped from files instead of being copied into memory, when possible. Data that must be byte-swapped cannot be memory mapped. Memory mapping has the advantages that less swap space is required and data is loaded into memory only as it is used. .SH "STATE VARIABLES" The current file I/O parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_READ_FUNC, VP_MMAP_FUNC. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_IO The file reading or memory mapping function returned an error value (in which case the external variable \fBerrno\fR should contain an operating-system specific error code), or the end of the file was reached prematurely. .IP VPERROR_BAD_FILE The data in the file is invalid, usually meaning that it isn't a file written by the appropriate VolPack function. .IP VPERROR_BAD_VOLUME The data in a min-max octree file does not match the current volume size (\fBvpLoadMinMaxOctree\fR only). .IP VPERROR_BAD_VOXEL The data in a min-max octree file does not match the current voxel layout parameters (\fBvpLoadMinMaxOctree\fR only). .SH SEE ALSO VolPack(3), vpCreateContext(3), vpStoreRawVolume(3) ccseapps-2.5/CCSEApps/volpack/man/src/VoxelField.30000644000175000017500000001326211634153073023011 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetVoxelField 3 "" VolPack .SH NAME vpSetVoxelField, vpFieldOffset \- define the size and location of a voxel field .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetVoxelField(\fIvpc, field_num, field_size, field_offset, field_max\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfield_num;\fR .FA int \fIfield_size;\fR .FA int \fIfield_offset;\fR .FA int \fIfield_max;\fR .FE .sp .FS int \fBvpFieldOffset(\fIvoxel_ptr, field_name\fB)\fR .FA vpContext *\fIvpc;\fR .FA LITERAL \fIfield_name;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIfield_num\fR Field number for the field to define (first field is 0). .IP \fIfield_size\fR Size of the field in bytes. .IP \fIfield_offset\fR Number of bytes from the beginning of the voxel to the beginning of the field. .IP \fIfield_max\fR Maximum possible value of the field. .IP \fIvoxel_ptr\fR Pointer to a C structure defining the fields in the voxel. .IP \fIfield_name\fR Literal name of the voxel field in the C structure. .SH DESCRIPTION \fBvpSetVoxelField\fR is used to define the size and location of each field in a voxel. Once you have chosen the sizes and order for the voxel fields, call \fBvpSetVoxelSize\fR once and then call \fBvpSetVoxelField\fR once for each field. Each field has a unique field number (the \fIfield_num\fR argument); the first field is 0, the next is 1, and so on, up to one less than the total number of fields defined with \fIVpSetVoxelSize\fR. The \fIfield_max\fR argument is used to determine the required size for lookup tables indexed by the value in a particular field; the maximum field value may be any number from 0 to the maximum unsigned integer representable by the field size. .PP If you have declared the layout of a voxel using a C structure then you can use the \fIsizeof\fR operator and the \fBvpFieldOffset\fR macro to compute the field sizes and offsets. \fBvpFieldOffset\fR returns the number of bytes from the beginning of a C structure to the beginning of a particular field in the structure. For example, the following code shows how to declare the size and offset for one voxel field: .DS .ta 18 .nf struct voxel { char field0; char field1; short field2; } *dummy_voxel; #define SIZE_0 sizeof(char) #define OFFSET_0 vpFieldOffset(dummy_voxel, field0) #define MAX_0 127 vpSetVoxelField(vpc, 0, SIZE_0, OFFSET_0, MAX_0); .DE .PP The size of each field must be 1, 2 or 4 bytes. You must also obey any byte-alignment restrictions required by your hardware. On many machines, two-byte fields must begin on a two-byte boundary and four-byte fields must begin on a four-byte boundary. The total size of a voxel may also need to be padded so that voxels packed one after the other still obey the alignment restrictions. If you declare your voxel as a C structure and use the \fIsizeof\fR operator and the \fBvpFieldOffset\fR macro then you should always get correct results. However, if you do not consider alignment restrictions when choosing the voxel field ordering the compiler may have to insert padding for you, resulting in wasted memory. .PP Some of the VolPack routines require you to declare fields of a particular size in order to store their results. The functions to precompute surface normals and gradient magnitudes (see vpVolumeNormals(3), vpScanlineNormals(3), vpClassifyVolume(3), vpClassifyScalars(3) and vpClassifyScanline(3)) can optionally store a one-byte scalar value, a one-byte gradient magnitude, and a two-byte surface normal value in each voxel. The following constants defined in volpack.h give the corresponding maximum field values: VP_SCALAR_MAX, VP_GRAD_MAX, and VP_NORM_MAX. If you choose not to use these functions then there is no need to declare these fields. .PP It is usually not necessary to declare a field for the voxel opacity if the opacity can be computed from the other voxel fields. See vpSetClassifierTable(3) for further discussion. .PP If the call to \fBvpSetVoxelSize\fR succeeds, any existing precomputed volume data structures in the context are destroyed. .SH "STATE VARIABLES" The current voxel field parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_FIELD_SIZES, VP_FIELD_OFFSETS, VP_FIELD_MAXES. .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_VALUE The field number, size or offset is out of range. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetVoxelSize(3) ccseapps-2.5/CCSEApps/volpack/man/src/Scale.30000644000175000017500000000517211634153073022000 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpScale 3 "" VolPack .SH NAME vpScale \- multiply the current transformation matrix by a scaling matrix .SH SYNOPSIS #include .sp .FS vpResult \fBvpScale(\fIvpc, sx, sy, sz\fB)\fR .FA vpContext \fI*vpc;\fR .FA double \fIsx\R; .FA double \fIsy\R; .FA double \fIsz\R; .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIsx\fR Scale factor for the X dimension. .IP \fIsy\fR Scale factor for the Y dimension. .IP \fIsz\fR Scale factor for the Z dimension. .SH DESCRIPTION \fBvpScale\fR is used to multiply the current transformation matrix by a 4-by-4 scaling matrix. The arguments specify independent scale factors for each of the three cartesian axes. The scaling matrix is: .DS .ta 2C 6C 10C 14C sx 0 0 0 .br 0 sy 0 0 .br 0 0 sz 0 .br 0 0 0 1 .DE Use \fBvpCurrentMatrix\fR to set the current transformation matrix. By default, the scaling matrix is post-multiplied (M = M*S where M is the current matrix and S is the scaling matrix). The VP_CONCAT_MODE option to \fBvpSeti\fR can be used to select pre-multiplication. .SH "STATE VARIABLES" The current matrix concatenation parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_CURRENT_MATRIX, VP_CONCAT_MODE. .SH ERRORS The return value is always VP_OK. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCurrentMatrix(3) ccseapps-2.5/CCSEApps/volpack/man/src/LinAlgebra.30000644000175000017500000001064011634153073022745 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH LinearAlgebra 3 "" VolPack .SH NAME vpIdentity3, vpIdentity4, vpNormalize3, vpMatrixVectorMult4, vpMatrixMult4, vpCrossProduct, vpSolveSystem4, vpSetVector3, vpSetVector4 \- linear algebra routines .SH SYNOPSIS #include .sp .FS void \fBvpIdentity3(\fIm_dst\fB)\fR .FA vpMatrix3 \fIm_dst;\fR .FE .sp .FS void \fBvpIdentity4(\fIm_dst\fB)\fR .FA vpMatrix4 \fIm_dst;\fR .FE .sp .FS vpResult \fBvpNormalize3(\fIv_src1\fB)\fR .FA vpVector3 \fIv_src1;\fR .FE .sp .FS void \fBvpMatrixVectorMult4(\fIv_dst, m_src1, v_src1\fB)\fR .FA vpVector4 \fIv_dst;\fR .FA vpMatrix4 \fIm_src1;\fR .FA vpVector4 \fIv_src1;\fR .FE .sp .FS void \fBvpMatrixMult4(\fIm_dst, m_src1, m_src2\fB)\fR .FA vpVector4 \fIm_dst, m_src1, m_src2;\fR .FE .sp .FS void \fBvpCrossProduct(\fIv_dst, v_src1, v_src2\fB)\fR .FA vpVector3 \fIv_dst, v_src1, v_src2;\fR .FE .sp .FS vpResult \fBvpSolveSystem4(\fIm_src1, b, count\fB)\fR .FA vpMatrix4 \fIm_src1;\fR .FA vpVector4 \fIb[];\fR .FA int \fIcount;\fR .FE .sp .FS void \fBvpSetVector3(\fIv_dst, x, y, z\fB)\fR .FA vpVector3 \fIv_dst;\fR .FA double \fIx, y, z;\fR .FE .sp .FS void \fBvpSetVector4(\fIv_dst, x, y, z, w\fB)\fR .FA vpVector4 \fIv_dst;\fR .FA double \fIx, y, z, w;\fR .FE .SH ARGUMENTS .IP "\fIm_src1, m_src2, m_dst\fR" Source and destination matrices. .IP "\fIv_src1, v_src2, v_dst\fR" Source and destination vectors. .IP \fIb\fR Array of right-hand-side vectors. .IP \fIcount\fR Number of right-hand-side vectors. .IP "\fIx, y, z, w\fR" Vector components. .SH DESCRIPTION These routines form a simple linear algebra package used internally by VolPack. The routines are also available as utility routines for use by the application. .PP \fBvpIdentity3\fR assigns the identity matrix to a 3-by-3 matrix. .PP \fBvpIdentity4\fR assigns the identity matrix to a 4-by-4 matrix. .PP \fBvpNormalize3\fR normalizes a 3-element vector (so the magnitude is 1.0). The result overwrites the source vector. .PP \fBvpMatrixVectorMult4\fR multiplies a 4-by-4 matrix by a 4-element column vector and stores the result in the destination vector \fI(v_dst = m . v_src)\fR. .PP \fBvpMatrixMult4\fR multiplies two 4-by-4 matrices and stores the result in the destination matrix \fI(m_dst = m_src1 . m_src2)\fR. .PP \fBvpCrossProduct\fR computes the cross product of two 3-element vectors and stores the result in the destination vector \fI(v_dst = v_src1 x v_src2)\fR. .PP \fBvpSolveSystem4\fR solves the linear system \fIm . x = b\fR for each right-hand-side vector in the \fIb\fR array. The solution vectors overwrite the vectors in the \fIb\fR array. The solution is computed using Gauss-Jordan elimination with partial pivoting and implicit scaling. .PP \fBvpSetVector3\fR initializes the components of a 3-element vector \fI(v_dst = [x, y, z]).\fR It is a macro. .PP \fBvpSetVector4\fR initializes the components of a 4-element vector \fI(v_dst = [x, y, z, w]).\fR It is a macro. .SH ERRORS \fBvpNormalize3\fR and \fBvpSolveSystem4\fR normally return VP_OK. The following error return value is possible: .IP VPERROR_SINGULAR The vector is a 0 vector (\fBvpNormalize3\fR only), or the matrix is singular (\fBvpSolveSystem4\fR only). .SH SEE ALSO VolPack(3) ccseapps-2.5/CCSEApps/volpack/man/src/RawVoxels.30000644000175000017500000000704611634153073022705 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetRawVoxels 3 "" VolPack .SH NAME vpSetRawVoxels \- specify an array of volume data .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetRawVoxels(\fIvpc, voxels, size, xstride, ystride, zstride\fB)\fR .FA vpContext *\fIvpc;\fR .FA void *\fIvoxels;\fR .FA int \fIsize;\fR .FA int \fIxstride, ystride, zstride;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIvoxels\fR 3D array of voxels. .IP \fIsize\fR Size of the voxel array in bytes. .IP \fIxstride\fR Number of bytes from the beginning of one voxel to the beginning of the next voxel in the first array dimension. .IP \fIystride\fR Number of bytes from the beginning of one voxel to the beginning of the next voxel in the second array dimension. .IP \fIzstride\fR Number of bytes from the beginning of one voxel to the beginning of the next voxel in the third array dimension. .SH DESCRIPTION \fBvpSetRawVoxels\fR is used to specify a 3D array that contains the volume data. The array must be large enough for the volume dimensions specified with \fBvpSetVolumeSize\fR and the voxel size specified with \fBvpSetVoxelSize\fR. The data in the array may be initialized before or after calling \fBvpSetRawVoxels\fR. .PP Some of the VolPack routines operate faster if the volume is stored in z-major order (\fIxstride < ystride < zstride\fR) but it is not strictly necessary. .PP The voxel array is not automatically deallocated when the context is destroyed with \fBvpDestroyContext\fR. The application is responsible for managing the memory associated with the volume array. .PP The voxel array can be a very large data structure, possibly larger than available main memory. It is sometimes possible to precompute the optimized data structures required for the fast rendering algorithm without explicitly allocating a voxel array. See vpClassifyScalars(3). .PP During the call to \fBvpSetRawVoxels\fR, any existing precomputed volume data structures in the context are destroyed. .SH "STATE VARIABLES" The current voxel array parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_VOXEL_DATA, VP_VOXEL_DATA_SIZE, VP_VOXEL_XSTRIDE, VP_VOXEL_YSTRIDE, VP_VOXEL_ZSTRIDE. .SH ERRORS The routine always returns VP_OK. .SH SEE ALSO VolPack(3), vpCreateContext(3) ccseapps-2.5/CCSEApps/volpack/man/src/Store.30000644000175000017500000000772411634153073022052 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpStoreRawVolume 3 "" VolPack .SH NAME vpStoreRawVolume, vpStoreMinMaxOctree, vpStoreClassifiedVolume, vpStoreContext \- store volume data structures to a file .SH SYNOPSIS #include .sp .FS vpResult \fBvpStoreRawVolume(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .sp .FS vpResult \fBvpStoreMinMaxOctree(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .sp .FS vpResult \fBvpStoreClassifiedVolume(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .sp .FS vpResult \fBvpStoreContext(\fIvpc, fd\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIfd;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIfd\fR File descriptor from \fBopen\fR(2), open for writing. .SH DESCRIPTION These functions are used to store volume data structures from a rendering context into files in the format read by the VolPack file reading routines (see vpLoadRawVolume(3)). .PP \fBvpStoreRawVolume\fR creates a 3D voxel array file. The file includes information about the size of the volume and the layout of the voxels as well as the volume data itself. .PP \fBvpStoreMinMaxOctree\fR creates a min-max octree file. The file includes information about the size of the volume and the layout of the voxels as well as the octree itself. .PP \fBvpStoreClassifiedVolume\fR creates a preclassified volume data file. The file includes information about the size of the volume and the layout of the voxels as well as the volume data itself. .PP \fBvpStoreContext\fR creates a rendering context file. The file includes all rendering parameters except volume data and callback functions. The contents of any lookup tables for shading and classification are also stored. .PP The function used to write data to the files can be set by calling \fBvpSetCallback\fR with the VP_WRITE_FUNC option. This could be used to implement a file-compression system, for example. .SH "STATE VARIABLES" The current file I/O parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_WRITE_FUNC. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_IO The file writing function returned an error value (in which case the external variable \fBerrno\fR should contain an operating-system specific error code), or the file system is full. .IP VPERROR_BAD_VOLUME The volume dimensions are invalid, or there is no voxel data in the context. .IP VPERROR_BAD_SIZE There is no min-max octree in the volume (\fBvpStoreMinMaxOctree\fR only). .IP VPERROR_BAD_VOXEL The voxel fields in the rendering context have not been properly defined. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpLoadRawVolume(3) ccseapps-2.5/CCSEApps/volpack/man/src/Identity.30000644000175000017500000000364211634153073022542 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpIdentityMatrix 3 "" VolPack .SH NAME vpIdentityMatrix \- load the identity matrix into the current transformation matrix .SH SYNOPSIS #include .sp .FS vpResult \fBvpIdentityMatrix(\fIvpc\fB)\fR .FA vpContext \fI*vpc;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .SH DESCRIPTION \fBvpIdentityMatrix\fR is used to load a 4-by-4 identity matrix into the current transformation matrix. Use \fBvpCurrentMatrix\fR to set the current transformation matrix. .SH ERRORS The return value is always VP_OK. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpGetMatrix(3) ccseapps-2.5/CCSEApps/volpack/man/src/VolPack.30000644000175000017500000001427511634153073022314 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH VolPack 3 "" VolPack .SH NAME VolPack \- introduction to VolPack, a library for volume rendering .SH SYNOPSIS #include .sp cc file.c -lvolpack -lm .SH DESCRIPTION VolPack is a portable software library for volume rendering. It is based on a new family of fast volume rendering algorithms (see Philippe Lacroute and Marc Levoy, Fast Volume Rendering Using a Shear-Warp Factorization of the Viewing Transformation, Proc.\ SIGGRAPH '94, in \fIComputer Graphics\fR, Annual Conference Series, 1994, pp. 451-458). For a tutorial introduction to the library see the \fIVolPack User's Guide.\fR .PP The following list includes all of the functions in the library grouped by general function, along with the corresponding man pages. .ta 30 .SS "Rendering Contexts" vpCreateContext vpCreateContext(3) .br vpDestroyContext vpCreateContext(3) .br .SS Volumes vpSetVolumeSize vpSetVolumeSize(3) .br vpSetVoxelSize vpSetVoxelSize(3) .br vpSetVoxelField vpSetVoxelField(3) .br vpFieldOffset vpSetVoxelField(3) .br vpSetRawVoxels vpSetRawVoxels(3) .br vpVolumeNormals vpVolumeNormals(3) .br vpScanlineNormals vpScanlineNormals(3) .br vpNormalIndex vpNormalIndex(3) .br vpNormal vpNormalIndex(3) .SS "Classified Volumes" vpSetClassifierTable vpSetClassifierTable(3) .br vpClassifyVolume vpClassifyVolume(3) .br vpDestroyClassifiedVolume vpClassifyVolume(3) .br vpClassifyScalars vpClassifyScalars(3) .br vpClassifyScanline vpClassifyScanline(3) .SS "Min-Max Octrees" vpCreateMinMaxOctree vpCreateMinMaxOctree(3) .br vpMinMaxOctreeThreshold vpCreateMinMaxOctree(3) .br vpDestroyMinMaxOctree vpCreateMinMaxOctree(3) .br vpOctreeMask vpOctreeMask(3) .SS "View Transformations" vpCurrentMatrix vpCurrentMatrix(3) .br vpIdentityMatrix vpIdentityMatrix(3) .br vpTranslate vpTranslate(3) .br vpRotate vpRotate(3) .br vpScale vpScale(3) .br vpMultMatrix vpMultMatrix(3) .br vpSetMatrix vpSetMatrix(3) .br vpWindow vpWindow(3) .br vpWindowPHIGS vpWindowPHIGS(3) .SS "Shading and Lighting" vpSetLookupShader vpSetLookupShader(3) .br vpSetShadowLookupShader vpSetShadowLookupShader(3) .br vpSetLight vpSetLight(3) .br vpSetMaterial vpSetMaterial(3) .br vpShadeTable vpShadeTable(3) .br vpSetDepthCueing vpSetDepthCueing(3) .SS Rendering vpSetImage vpSetImage(3) .br vpRenderClassifiedVolume vpRenderRawVolume(3) .br vpRenderRawVolume vpRenderRawVolume(3) .SS "State Variables" vpEnable vpEnable(3) .br vpSeti vpSeti(3) .br vpSetd vpSeti(3) .br vpGeti vpGeti(3) .br vpGetd vpGeti(3) .br vpGetp vpGeti(3) .br vpGetMatrix vpGetMatrix(3) .br vpGetMaterial vpGetvpSetMaterial(3) .br vpGetLight vpGetvpSetLight(3) .br vpSetCallback vpSetCallback(3) .br vpSetClientData vpSetClientData(3) .SS "File I/O" vpLoadClassifiedVolume vpLoadRawVolume(3) .br vpLoadMinMaxOctree vpLoadRawVolume(3) .br vpLoadRawVolume vpLoadRawVolume(3) .br vpLoadContext vpLoadRawVolume(3) .br vpStoreClassifiedVolume vpStoreRawVolume(3) .br vpStoreMinMaxOctree vpStoreRawVolume(3) .br vpStoreRawVolume vpStoreRawVolume(3) .br vpStoreContext vpStoreRawVolume(3) .SS "Utility Functions" vpRamp vpRamp(3) .br vpExtract vpExtract(3) .br vpTranspose vpTranspose(3) .br vpResample vpResample(3) .br vpSetFilter vpSetFilter(3) .br vpBoxFilter vpBoxFilter(3) .br vpLinearFilter vpBoxFilter(3) .br vpBicubicFilter vpBoxFilter(3) .br vpGaussianFilter vpBoxFilter(3) .br vpIdentity3 LinearAlgebra(3) .br vpIdentity4 LinearAlgebra(3) .br vpSetVector3 LinearAlgebra(3) .br vpSetVector4 LinearAlgebra(3) .br vpNormalize3 LinearAlgebra(3) .br vpMatrixVectorMult4 LinearAlgebra(3) .br vpMatrixMult4 LinearAlgebra(3) .br vpCrossProduct LinearAlgebra(3) .br vpSolveSystem4 LinearAlgebra(3) .SS "Error Handling" vpGetError vpGetError(3) .br vpGetErrorString vpGetError(3) .SS Debugging vpSetDebug vpSetDebug(3) .br vpTracePixel vpTracePixel(3) .br vpGetImage vpGetvpSetImage(3) .br vpBruteForceRender vpBruteForceRender(3) .SH "DATA TYPES" The following data types are declared in the VolPack header file (volpack.h): .IP vpContext An opaque handle for a rendering context. A context contains all of the information required to render a volume, including classification and shading parameters, the view transformation, a description of the format of the volume data, and private data structures used by the rendering routines. .IP vpResult A result code. Most of the library routines return the code VP_OK upon successful completion, or an error code if the library call fails. .IP vpVector3 A three-element linear array of double-precision elements (double[3]). .IP vpVector4 A four-element linear array of double-precisions elements (double[4]). .IP vpMatrix3 A three-by-three array of double-precision elements (double[3][3]). .IP vpMatrix4 A four-by-four array of double-precision elements (double[4][4]). .SH AVAILABILITY Source code and documentation for VolPack are available free via the World Wide Web (http://www-graphics.stanford.edu/software/volpack) or by anonymous ftp (ftp://graphics.stanford.edu/pub/volpack). .SH SEE ALSO \fIVolPack User's Guide\fR ccseapps-2.5/CCSEApps/volpack/man/src/ClsfyScan.30000644000175000017500000000673011634153073022637 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpClassifyScanline 3 "" VolPack .SH NAME vpClassifyScanline \- incrementally create a preclassified volume from scanlines of scalar data .SH SYNOPSIS #include .sp .FS vpResult \fBvpClassifyScanline(\fIvpc, voxels\fB)\fR .FA vpContext *\fIvpc;\fR .FA void *\fIvoxels;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIvoxels\fR 1D array of voxel data. .SH DESCRIPTION \fBvpClassifyScanline\fR is used to incrementally compute a preclassified volume by classifying one scanline of voxels and storing the result in the current preclassified volume. .PP The \fIvoxels\fR argument is a 1D array containing voxels in the format previously specified with \fBvpSetVoxelSize\fR and \fBvpSetVoxelField\fR. \fBvpVolumeSize\fR must be called to declare the size of the volume before the first call to \fBvpClassifyScanline\fR, and the length of the 1D voxel array must be equal to the length of the X dimension of the volume. The 1D voxel array may be initialized with \fBvpScanlineNormals\fR or a user-defined function. .PP The voxels in the array are classified using the current opacity transfer function (see vpSetClassifierTable(3)) and appended to the preclassified volume (see vpClassifyVolume(3)). Scanlines must be processed in Z-major order: all of the scanlines in the Z=0 slice are processed from Y=0 onward, then the Z=1 slice is processed, and so on. When the last scanline in the volume has been processed the preclassified data structure is ready to be used for rendering. Rendering is not possible until all scanlines have been processed. .PP When the first scanline of a volume is passed to \fBvpClassifyScanline\fR, any existing preclassified volume data is destroyed. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VOXEL The voxel size or the voxel fields have not been specified or have been incorrectly specified. .IP VPERROR_BAD_CLASSIFIER The opacity transfer function tables have invalid sizes or are associated with invalid voxel fields or have been incorrectly specified. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetClassifierTable(3), vpClassifyVolume(3), vpClassifyScalars(3) ccseapps-2.5/CCSEApps/volpack/man/src/DepthCueing.30000644000175000017500000001215011634153073023142 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetDepthCueing 3 "" VolPack .SH NAME vpSetDepthCueing \- set depth cueing parameters .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetDepthCueing(\fIvpc, front_factor, density\fB)\fR .FA vpContext *\fIvpc;\fR .FA double \fIfront_factor;\fR .FA double \fIdensity;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIfront_factor\fR Depth cueing factor at the front clipping plane. .IP \fIdensity\fR Fog density. .SH DESCRIPTION \fBvpSetDepthCueing\fR is used to set the parameters for depth cueing. Depth cueing is a simulated fog that makes objects in the distance appear darker than foreground objects. Depth cueing is independent of the shading method. It can be used with lookup-table shading or callback-function shading. Depth cueing is not stored in the shading lookup table; it is always applied to voxels at rendering time. .PP The \fIfront_factor\fR argument is the transparency of the fog at the front clipping plane (see vpWindow(3) or vpWindowPHIGS(3)). It must be a positive number and is usually less than 1.0 (although larger numbers can be used to brighten the foreground). The \fIdensity\fR argument controls the "density" of the fog. Increasing the density causes objects to recede into darkness over a shorter distance. The equation for the transparency of the fog at a particular voxel is: .DS T = front_factor * exp(-density * depth) .DE where \fIdepth\fR is 0 at the front clipping plane and 1 at the back clipping plane. Each voxel color component is multiplied by the fog transparency during rendering. .PP By default, depth cueing is not enabled. To enable it, call \fBvpEnable\fR with the VP_DEPTH_CUE option. .PP Depth cueing is implemented using an internal lookup table (unrelated to the shading lookup table). There are several VolPack state variables that affect the depth cueing table, although they should not usually be changed. The table contains depth cueing factors as a function of depth. The table must contain entries for depths in the range 0.0-1.0, and possibly for negative depths depending upon the current viewing parameters (the reason for this is beyond the scope of a man page). The VP_DEPTH_CUE_QUANTIZATION variable (which can be set by calling \fBvpSetd\fR) determines the depth difference between two adjacent entries in the depth cueing table. For instance, the default quantization of 1/255 specifies that each entry in the table represents 1/255 times the distance between the front and back clipping planes. Reducing the quantization increases the size and accuracy of the depth cueing table. .PP Normally the depth cueing table is resized and recomputed only when necessary. Recomputation may be required if the viewpoint changes, increasing the range of voxel depths that are encountered (recall that there is no lower bound on the depth). You can use \fBvpGeti\fR with the VP_DEPTH_CUE_TABLE_SIZE state variable code to get the current number of table entries. You can also set the value of VP_DEPTH_CUE_TABLE_SIZE_HINT (using \fBvpSeti\fR) to suggest a size for the table. This might be desirable if you plan to compute an animation loop and want to ensure that the depth cueing table does not need to be recomputed in the middle of the sequence. However, since recomputing the table is relatively inexpensive, it should not be necessary to use this option. .SH "STATE VARIABLES" Information about the current depth cueing properties can be retrieved with the following state variable codes (see vpGeti(3)): VP_DEPTH_CUE, VP_DEPTH_CUE_FRONT, VP_DEPTH_CUE_DENSITY, VP_DEPTH_CUE_TABLE_SIZE, VP_DEPTH_CUE_SIZE_HINT, VP_DEPTH_CUE_QUANTIZATION. .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_VALUE The value of \fIfront_factor\fR is not positive. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetLookupShader(3) ccseapps-2.5/CCSEApps/volpack/man/src/Image.30000644000175000017500000001210211634153073021762 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetImage 3 "" VolPack .SH NAME vpSetImage \- specify an image array .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetImage(\fIvpc, image, width, height, scan_bytes, pixel_type\fB)\fR .FA vpContext *\fIvpc;\fR .FA unsigned char *\fIimage;\fR .FA int \fIwidth, height;\fR .FA int \fIscan_bytes;\fR .FA int \fIpixel_type;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIimage\fR 2D array for storing result images. .IP \fIwidth\fR Width of image in pixels. .IP \fIheight\fR Height of image in pixels. .IP \fIscan_bytes\fR Number of bytes per scanline in image array. .IP \fIpixel_type\fR Code indicating the format of each pixel in the array. .SH DESCRIPTION \fBvpSetImage\fR is used to specify a buffer for storing the result image during rendering. The \fIwidth\fR and \fIheight\fR parameters specify the size of the result image. The clipping window (see vpWindow(3) or vpWindowPHIGS(3)) is scaled to exactly match the specified size. The \fIscan_bytes\fR argument specifies the size of a scanline in the image array, in bytes. This argument can be used to add padding to the end of each scanline to satisfy alignment restrictions (e.g.\ raster operations sometimes require the beginning of each scanline to lie on a word boundary). The \fIpixel_type\fR argument specifies the format of a pixel. The following formats are supported: .IP VP_ALPHA Each pixel is one byte and contains an 8-bit alpha channel (containing an opacity or coverage value for the pixel). .IP VP_LUMINANCE Each pixel is one byte and contains an 8-bit grayscale intensity. .IP VP_LUMINANCEA Each pixel is two bytes and contains an 8-bit grayscale intensity followed by an 8-bit alpha channel. .IP VP_RGB Each pixel is three bytes and contains an RGB color (8 bits/channel). The R channel is stored first, followed by G and then B. .IP VP_RGBA Each pixel is four bytes and contains an RGBA color with an alpha channel (8 bits/channel). The R channel is stored first, followed by G, B and A. .IP VP_BGR Each pixel is three bytes and contains an RGB color (8 bits/channel). The B channel is stored first, follow by G and then R. .IP VP_ABGR Each pixel is four bytes and contains an RGBA color with an alpha channel (8 bits/channel). The A channel is stored first, followed by B, G and R. .PP The formats VP_LUMINANCE and VP_LUMINANCEA may only be used with grayscale shaders (the \fIcolor_channels\fR argument to \fBvpSetLookupShader\fR must be 1, or if you are using a callback function for shading you must use the VP_GRAY_SHADE_FUNC argument to \fBvpSetCallback\fR). The formats VP_RGB, VP_RGBA, VP_BGR and VP_ABGR may only be used with color shaders. The format VP_ALPHA may be used with either type of shader. .PP The size of the \fIimage\fR array must be: .DS unsigned char \fIimage[height][scan_bytes];\fR .DE The \fIscan_bytes\fR argument must be at least \fIwidth\fR times the number of bytes per pixel. Pixels in a horizontal scanline are packed next to each other, regardless of the size of the pixel. Any extra padding bytes at the end of a scanline are not modified. .PP The alpha channel may be used to composite the rendered image against a background image. Alpha gives the fraction of the background that is visible through the rendered image (0 for fully visible, 255 for fully obscured). As an example, to change the background color of the image to a solid color C, modify the color of each pixel in the image according to the formula: .DS color(x,y) += C * (1 - alpha(x,y)/255) .DE .SH "STATE VARIABLES" The current image array properties can be retrieved with the following state variable codes (see vpGeti(3)): VP_IMAGE, VP_IMAGE_WIDTH, VP_IMAGE_HEIGHT, VP_IMAGE_SCAN_SIZE, VP_PIXEL_TYPE. .SH ERRORS The return value is always VP_OK. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpRenderRawVolume(3) ccseapps-2.5/CCSEApps/volpack/man/src/Error.30000644000175000017500000000441411634153073022040 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpGetError 3 "" VolPack .SH NAME vpGetError, vpGetErrorString \- retrieve error codes .SH SYNOPSIS #include .sp .FS vpResult \fBvpGetError(\fIvpc\fB)\fR .FA vpContext *\fIvpc;\fR .FE .sp .FS "char *" \fBvpGetErrorString(\fIcode\fB)\fR .FA vpResult \fIcode;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIcode\fR A VolPack error result code. .SH DESCRIPTION These routines are used for error handling. \fBvpGetError\fR return the error code from the first function call that failed since the last call to \fBvpGetError\fR. \fBvpGetErrorString\fR returns a descriptive string corresponding to an error code. The string is stored in a global array so it does not need to be copied to separate memory. .SH ERRORS \fBvpGetError\fR cannot fail. A return value not equal to VP_OK means that some previous function call has failed. \fBvpGetErrorString\fR returns NULL if \fIcode\fB is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3) ccseapps-2.5/CCSEApps/volpack/man/src/GetMatrix.30000644000175000017500000000451511634153073022655 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpGetMatrix 3 "" VolPack .SH NAME vpGetMatrix \- retrieve the contents of a transformation matrix .SH SYNOPSIS #include .sp .FS vpResult \fBvpGetMatrix(\fIvpc, matrix_code, matrix\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fImatrix_code;\fR .FA vpMatrix4 \fImatrix;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fImatrix_code\fR A code specifying one of the VolPack transformation matrices (VP_MODEL, VP_VIEW, VP_PROJECT or VP_SCREEN). .IP \fImatrix\fR Matrix for storing the result. .SH DESCRIPTION \fBvpGetMatrix\fR retrieves the contents of one of the transformation matrices (see vpCurrentMatrix(3)). The special code VP_SCREEN causes the function to compute the transformation from object coordinates to image coordinates and return a matrix describing this transformation. .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_OPTION The \fImatrix_code\fR argument is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCurrentMatrix(3) ccseapps-2.5/CCSEApps/volpack/man/src/BruteForce.30000644000175000017500000000354311634153073023011 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpBruteForceRender 3 "" VolPack .SH NAME vpBruteForceRender \- render using a simple brute-force method .SH SYNOPSIS #include .sp .FS vpResult \fBvpBruteForceRender(\fIvpc\fB)\fR .FA vpContext *\fIvpc;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .SH DESCRIPTION This function is for debugging purposes only. It performs the same function as \fBvpRenderRawVolume\fR, but uses a simpler, very inefficient algorithm. The two functions should produce identical results. .SH SEE ALSO VolPack(3), vpRenderRawVolume(3) ccseapps-2.5/CCSEApps/volpack/man/src/VoxelSize.30000644000175000017500000001022111634153073022670 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetVoxelSize 3 "" VolPack .SH NAME vpSetVoxelSize \- define the size of a voxel .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetVoxelSize(\fIvpc, bytes_per_voxel, num_voxel_fields, num_shade_fields, num_classify_fields\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIbytes_per_voxel;\fR .FA int \fInum_voxel_fields;\fR .FA int \fInum_shade_fields;\fR .FA int \fInum_classify_fields;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIbytes_per_voxel\fR Size of one voxel in bytes. .IP \fInum_voxel_fields\fR Number of fields in a voxel. .IP \fInum_shade_fields\fR Number of voxel fields that are arguments to the shading function. .IP \fInum_classify_fields\fR Number of voxel fields that are arguments to the opacity transfer function. .SH DESCRIPTION \fBvpSetVoxelSize\fR is used to define the size in bytes and the number of fields in a voxel. Each voxel field is analogous to a field in a C structure and the contents of each field is user-defined. See the \fBvpSetVoxelField\fR function (vpSetVoxelField(3)) for setting the size and offset of each field. \fBvpSetVoxelSize\fR should be called before \fBvpSetVoxelField\fR and before any functions that access the contents of a voxel. .PP Typically, some of the voxel fields are used as arguments to a shading function and some (possibly the same) fields are used as arguments to an opacity transfer function (for classification). The fields that are used for shading should come first, i.e.\ they should have the smallest offsets, followed by any fields that are only used for classification. The classification fields can then be stripped off to save space during the precomputation stage for the fast rendering algorithm. The parameter \fInum_shade_fields\fR indicates the number of fields (starting from the first) that must not be stripped off. .PP The parameter \fInum_clsfy_fields\fR indicates the total number of fields that are used as parameters to the opacity transfer function. These fields do not necessarily have to be contiguous, although any fields that are not also used for shading should be the last fields in the voxel. .PP If the call to \fBvpSetVoxelSize\fR succeeds, any existing precomputed volume data structures in the context are destroyed. .SH "STATE VARIABLES" The current voxel size parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_BYTES_PER_VOXEL, VP_VOXEL_FIELD_COUNT, VP_SHADE_FIELD_COUNT, VP_CLASSIFY_FIELD_COUNT. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_LIMIT_EXCEEDED The number of voxel fields exceeds the implementation limit. This limit can be increased by editing volpack.h and recompiling the library. .IP VPERROR_BAD_VALUE Either \fInum_clsfy_fields\fR or \fInum_shade_fields\fR is out of range. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetVoxelField(3) ccseapps-2.5/CCSEApps/volpack/man/src/NormalIndex.30000644000175000017500000000713111634153073023166 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpNormalIndex 3 "" VolPack .SH NAME vpNormalIndex, vpNormal \- encode/decode a surface normal vector .SH SYNOPSIS #include .sp .FS int \fBvpNormalIndex(\fInx, ny, nz\fB)\fR .FA double \fInx, ny, nz;\fR .FE .sp .FS vpResult \fBvpNormal(\fIn, nx_ptr, ny_ptr, nz_ptr\fB)\fR .FA int \fIn;\fR .FA double *\fInx_ptr,\fR *\fIny_ptr,\fR *\fInz_ptr;\fR .FE .SH ARGUMENTS .IP \fInx\fR X component of surface normal vector. .IP \fIny\fR Y component of surface normal vector. .IP \fInz\fR Z component of surface normal vector. .IP \fIn\fR Encoded surface normal vector. .IP \fInx_ptr\fR Pointer to storage for returning X component of surface normal vector. .IP \fIny_ptr\fR Pointer to storage for returning Y component of surface normal vector. .IP \fInz_ptr\fR Pointer to storage for returning Z component of surface normal vector. .SH DESCRIPTION These two routines are used to convert surface normal vectors between encoded and unencoded forms. An unencoded vector is described by its three components (stored as double-precision floating point numbers) in an orthogonal coordinate system. An encoded vector is described by a single integer that is suitable for use as an index in a shading lookup table. VolPack's built-in shading routines require the use of surface normal vectors encoded using \fBvpNormalIndex\fR (or one of the higher-level normal vector computation routines, \fBvpVolumeNormals\fR or \fBvpScanlineNormals\fR). User-defined shading routines or lookup tables are not required to use encoded normal vectors. .PP \fBvpNormalIndex\fR computes an encoded vector from the components of an unencoded vector. The vector must be normalized (\fInx*nx + ny*ny + nz*nz = 1\fR). The maximum possible value of an encoded normal is given by the constant VP_NORM_MAX. .PP \fBvpNormal\fR computes the components of a vector from the encoded integer form. The encoded normal has less resolution than the unencoded form, so the vector computed by \fBvpNormal\fR may not be equal to the original vector passed to \fBvpNormalIndex\fR. .SH ERRORS \fBvpNormalIndex\fR always returns a valid encoded normal vector. .PP \fBvpNormal\fR normally returns the value VP_OK. The following return value is possible: .IP VPERROR_BAD_VALUE The encoded normal vector is invalid. .SH SEE ALSO VolPack(3), vpVolumeNormals(3), vpScanlineNormals(3) ccseapps-2.5/CCSEApps/volpack/man/src/MinMaxOctree.30000644000175000017500000001455711634153073023313 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpCreateMinMaxOctree 3 "" VolPack .SH NAME vpCreateMinMaxOctree, vpMinMaxOctreeThreshold, vpDestroyMinMaxOctree \- create/destroy a min-max octree for optimized rendering .SH SYNOPSIS #include .sp .FS vpResult \fBvpCreateMinMaxOctree(\fIvpc, root_node_size, base_node_size\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIroot_node_size, base_node_size;\fR .FE .sp .FS vpResult \fBvpMinMaxOctreeThreshold(\fIvpc, param_num, range\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIparam_num, range;\fR .FE .sp .FS vpResult \fBvpDestroyMinMaxOctree(\fIvpc\fB)\fR .FA vpContext *\fIvpc;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIroot_node_size\fR Number of voxels per side in the top level (largest nodes) of the octree. Not currently used. .IP \fIbase_node_size\fR Number of voxels per side in the bottom level (smallest nodes) of the octree. Must be a power of 2. .IP \fIparam_num\fR Identifying number of one parameter of the opacity transfer function. .IP \fIrange\fR Range threshold for one parameter of the opacity transfer function. If an octree node spans a larger range then it is subdivided. .SH DESCRIPTION These routines are used to create and destroy a min-max octree, an internal data structure that is used to accelerate classifying and rendering volume data in a 3D voxel array. The octree is a hierarchical data structure that contains minimum and maximum values for each voxel field. It does not duplicate the data in the voxel array. The octree is not used with preclassified volumes (see vpClassifyVolume(3)). .PP Before creating an octree, declare a 3D voxel array using \fBvpSetVolumeSize, vpSetVoxelSize, vpSetVoxelField\fR and \fBvpSetRawVoxels,\fR and initialize parameters for the opacity transfer function by calling \fBvpSetClassifierTable\fR. Then initialize the voxel data in the array. The lookup tables for the opacity transfer function do not need to be initialized. .PP Now call \fBvpMinMaxOctreeThreshold\fR once for each parameter to the opacity transfer function. The parameter number is the same number as the parameter number you would pass to \fBvpClassifierTable.\fR The \fIrange\fR argument specifies a "small" range of values for the corresponding parameter. The opacity of a voxel should not vary much for voxels within this range of parameter space. Choosing a value which is too small or too large may result in a reduced performance benefit during rendering. The function \fBvpOctreeMask\fR can be used to visualize the effectiveness of various parameter ranges. Note that you must choose the voxel field associated with each opacity transfer function parameter in advance of creating the octree (by calling \fBvpSetClassiferTable\fR), but the opacity transfer function itself does not need to be known since the lookup tables do not need to be initialized. In the current implementation all of the parameters must be one or two-byte voxel fields; four-byte fields are not allowed. .PP Finally, call \fBvpCreateMinMaxOctree\fR to actually compute the octree. The arguments specify the largest and smallest node size. These values can be used to trade off storage size of the octree for increased resolution. The octree is stored in the rendering context and is used automatically in subsequent calls to \fBvpClassifyVolume\fR and \fBvpRenderRawVolume.\fR Only one octree may be stored in a context at a time. If an octree already exists when \fBvpCreateMinMaxOctree\fR is called then the old octree is destroyed. .PP If the data in the voxel array changes then the min-max octree must be explicitly recomputed by calling \fBvpCreateMinMaxOctree\fR again before the next call to \fBvpClassifyVolume\fR or \fBvpRenderRawVolume.\fR .PP \fBvpDestroyMinMaxOctree\fR destroys the current min-max octree and frees the associated storage. .SH "STATE VARIABLES" The current octree parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_CLASSIFY_FIELD_COUNT, VP_CLASSIFY_FIELDS, VP_MMOCTREE_THRESHOLDS, VP_MMOCTREE_SIZE. .SH ERRORS The normal return value for all three functions is VP_OK. \fBvpMinMaxOctreeThreshold\fR can return the following error value: .IP VPERROR_BAD_VALUE The parameter number is invalid. .PP \fBvpCreateMinMaxOctree\fR can return the following error values: .IP VPERROR_BAD_VALUE The node size arguments are not a power of two. .IP VPERROR_BAD_VOXEL The voxel size or the voxel fields have not been specified or have been incorrectly specified, or the number of parameters to the opacity transfer function has been incorrectly specified. .IP VPERROR_BAD_VOLUME The volume array or volume dimensions have not been specified, or the size of the volume array does not match the volume dimensions. .IP VPERROR_BAD_CLASSIFIER The fields specified as parameters to the opacity transfer function are invalid or do not have valid sizes. .IP VPERROR_LIMIT_EXCEEDED The volume is too large, so the maximum size of the octree has been exceeded. Change the constant VP_MAX_OCTREE_LEVELS in volpack.h and recompile the VolPack library. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpClassifyVolume(3), vpOctreeMask(3), vpRenderRawVolume(3) ccseapps-2.5/CCSEApps/volpack/man/src/FilterTab.30000644000175000017500000001060411634153073022621 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpBoxFilter 3 "" VolPack .SH NAME vpBoxFilter, vpLinearFilter, vpBicubicFilter, vpGaussianFilter \- initialize a filter weight table .SH SYNOPSIS #include .sp .FS vpResult \fBvpBoxFilter(\fInum_taps, num_phases, weights, weights_bytes\fB)\fR .FA int \fInum_taps, num_phases\fR; .FA float *\fIweights\fR; .FA int \fIweights_bytes\fR; .FE .sp .FS vpResult \fBvpLinearFilter(\fInum_taps, num_phases, weights, weights_bytes\fB)\fR .FA int \fInum_taps, num_phases\fR; .FA float *\fIweights\fR; .FA int \fIweights_bytes\fR; .FE .sp .FS vpResult \fBvpBicubicFilter(\fIb_value, c_value, num_taps, num_phases, weights, weights_bytes\fB)\fR .FA double \fIb_value, c_value\fR; .FA int \fInum_taps, num_phases\fR; .FA float *\fIweights\fR; .FA int \fIweights_bytes\fR; .FE .sp .FS vpResult \fBvpGaussianFilter(\fIsigma, num_taps, num_phases, weights, weights_bytes\fB)\fR .FA double \fIsigma\fR; .FA int \fInum_taps, num_phases\fR; .FA float *\fIweights\fR; .FA int \fIweights_bytes\fR; .FE .SH ARGUMENTS .IP \fInum_taps\fR Number of filter taps. .IP \fInum_phases\fR Number of filter phases. .IP \fIweights\fR Array containing filter weights. .IP \fIweights_bytes\fR Size (in bytes) of array containing filter weights. .IP \fIb_value\fR "B" parameter in the formula for a Mitchell bicubic. .IP \fIc_value\fR "C" parameter in the formula for a Mitchell bicubic. .IP \fIsigma\fR Standard deviation for a Gaussian. .SH DESCRIPTION These routines can be used to initialize filter weight tables for use with \fBvpSetFilter\fR and \fBvpResample\fR. See the \fBvpSetFilter\fR man page for information on the \fInum_taps\fR and \fInum_phases\fR arguments. .PP \fBvpBoxFilter\fR creates a filter table for a box filter (a zero-order filter). With \fInum_taps\fR equal to 1 the filter is a nearest-neighbor filter, suitable for low-quality upsampling. To create a decimation filter that averages down, the number of taps should equal the decimation factor (as nearly as possible). .PP \fBvpLinearFilter\fR creates a filter table for a linear filter (a first-order or tent filter). With \fInum_taps\fR equal to 2 the filter performs linear interpolation. .PP \fBvpBicubicFilter\fR creates a filter table for a Mitchell bicubic filter. The first two arguments can be used to modify the shape of the filter kernel. Some standard parameter values are: .IP "\fIb_value\fR = 1, \fIc_value = 0\fR" Cubic B-spline. .IP "\fIb_value\fR = 0, \fIc_value = 0.5\fR" Catmull-Rom spline. .PP With four filter taps the cubic B-spline filter is suitable for upsampling. For more details, see the following paper: Mitchell, D.P. and Netravali, A.N., "Reconstruction filters in computer graphics," Proc. SIGGRAPH '88 (Computer Graphics V22 N4), p. 221-8. .PP \fBvpGaussianFilter\fR creates a filter table for a gaussian filter. The first argument is the standard deviation of the gaussian. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_SIZE The filter weight table size is invalid. .IP VPERROR_BAD_VALUE The number of phases is not a positive power of two. .SH SEE ALSO VolPack(3), vpResample(3), vpSetFilter(3) ccseapps-2.5/CCSEApps/volpack/man/src/Translate.30000644000175000017500000000510111634153073022676 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpTranslate 3 "" VolPack .SH NAME vpTranslate \- multiply the current transformation matrix by a translation matrix .SH SYNOPSIS #include .sp .FS vpResult \fBvpTranslate(\fIvpc, tx, ty, tz\fB)\fR .FA vpContext \fI*vpc;\fR .FA double *\fItx,\fR *\fIty,\fR *\fItz;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fItx\fR X component of translation vector. .IP \fIty\fR Y component of translation vector. .IP \fItz\fR Z component of translation vector. .SH DESCRIPTION \fBvpTranslate\fR is used to multiply the current transformation matrix by a 4-by-4 translation matrix. The translation matrix is: .DS .ta 2C 6C 10C 14C 1 0 0 tx .br 0 1 0 ty .br 0 0 1 tz .br 0 0 0 1 .DE .PP Use \fBvpCurrentMatrix\fR to set the current transformation matrix. By default, the transformation matrix is post-multiplied (M = M*T where M is the current matrix and T is the translation matrix). The VP_CONCAT_MODE option to \fBvpSeti\fR can be used to select pre-multiplication. .SH "STATE VARIABLES" The current matrix concatenation parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_CURRENT_MATRIX, VP_CONCAT_MODE. .SH ERRORS The return value is always VP_OK. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCurrentMatrix(3) ccseapps-2.5/CCSEApps/volpack/man/src/ClientData.30000644000175000017500000000411011634153073022750 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetClientData 3 "" VolPack .SH NAME vpSetClientData \- define a client data pointer .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetClientData(\fIvpc, client_data\fB)\fR .FA vpContext *\fIvpc;\fR .FA void *\fIclient_data;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIclient_data\fR Pointer to application-specific client data. .SH DESCRIPTION \fBvpSetClientData\fR is used to store a pointer to application-specific client data in the VolPack context. This pointer is passed to some of the callback routines (see vpSetCallback(3)) to allow the application to define its own state variables. The pointer is not used by VolPack. .SH ERRORS The return value is always VP_OK. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetCallback(3) ccseapps-2.5/CCSEApps/volpack/man/src/makelinks0000644000175000017500000000426011634153073022563 0ustar amckinstryamckinstry#!/bin/csh -f cd ../man3 ln -s ../src/BruteForce.3 vpBruteForceRender.3 ln -s ../src/Callback.3 vpSetCallback.3 ln -s ../src/ClientData.3 vpSetClientData.3 ln -s ../src/ClsfyScalar.3 vpClassifyScalars.3 ln -s ../src/ClsfyScan.3 vpClassifyScanline.3 ln -s ../src/ClsfyTable.3 vpSetClassifierTable.3 ln -s ../src/ClsfyVolume.3 vpClassifyVolume.3 ln -s ../src/Context.3 vpCreateContext.3 ln -s ../src/CurrentMatrix.3 vpCurrentMatrix.3 ln -s ../src/Debug.3 vpSetDebug.3 ln -s ../src/DepthCueing.3 vpSetDepthCueing.3 ln -s ../src/Enable.3 vpEnable.3 ln -s ../src/Error.3 vpGetError.3 ln -s ../src/Extract.3 vpExtract.3 ln -s ../src/Filter.3 vpSetFilter.3 ln -s ../src/FilterTab.3 vpBoxFilter.3 ln -s ../src/Get.3 vpGeti.3 ln -s ../src/GetImage.3 vpGetImage.3 ln -s ../src/GetLight.3 vpGetLight.3 ln -s ../src/GetMaterial.3 vpGetMaterial.3 ln -s ../src/GetMatrix.3 vpGetMatrix.3 ln -s ../src/Identity.3 vpIdentityMatrix.3 ln -s ../src/Image.3 vpSetImage.3 ln -s ../src/Light.3 vpSetLight.3 ln -s ../src/LinAlgebra.3 LinearAlgebra.3 ln -s ../src/Load.3 vpLoadRawVolume.3 ln -s ../src/LookupShader.3 vpSetLookupShader.3 ln -s ../src/Material.3 vpSetMaterial.3 ln -s ../src/MinMaxOctree.3 vpCreateMinMaxOctree.3 ln -s ../src/MultMatrix.3 vpMultMatrix.3 ln -s ../src/NormalIndex.3 vpNormalIndex.3 ln -s ../src/OctreeMask.3 vpOctreeMask.3 ln -s ../src/Ramp.3 vpRamp.3 ln -s ../src/RawVoxels.3 vpSetRawVoxels.3 ln -s ../src/Render.3 vpRenderRawVolume.3 ln -s ../src/Resample.3 vpResample.3 ln -s ../src/Rotate.3 vpRotate.3 ln -s ../src/Scale.3 vpScale.3 ln -s ../src/ScanNormals.3 vpScanlineNormals.3 ln -s ../src/Set.3 vpSeti.3 ln -s ../src/SetMatrix.3 vpSetMatrix.3 ln -s ../src/ShadeTable.3 vpShadeTable.3 ln -s ../src/Shadow.3 vpSetShadowLookupShader.3 ln -s ../src/Store.3 vpStoreRawVolume.3 ln -s ../src/Timer.3 vpGetTimer.3 ln -s ../src/TracePixel.3 vpTracePixel.3 ln -s ../src/Translate.3 vpTranslate.3 ln -s ../src/Transpose.3 vpTranspose.3 ln -s ../src/VolPack.3 VolPack.3 ln -s ../src/VolumeNormals.3 vpVolumeNormals.3 ln -s ../src/VolumeSize.3 vpSetVolumeSize.3 ln -s ../src/VoxelField.3 vpSetVoxelField.3 ln -s ../src/VoxelSize.3 vpSetVoxelSize.3 ln -s ../src/Window.3 vpWindow.3 ln -s ../src/WindowPHIGS.3 vpWindowPHIGS.3 ccseapps-2.5/CCSEApps/volpack/man/src/Window.30000644000175000017500000001004111634153073022207 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpWindow 3 "" VolPack .SH NAME vpWindow \- multiply the projection matrix by a perspective or orthographic matrix .SH SYNOPSIS #include .sp .FS vpResult \fBvpWindow(\fIvpc, type, left, right, bottom, top, near, far\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fItype;\fR .FA double \fIleft, right;\fR .FA double \fIbottom, top;\fR .FA double \fInear, far;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fItype\fR Projection type code. Currently, must be VP_PARALLEL. .IP \fIleft\fR Coordinate of the left vertical clipping plane. .IP \fIright\fR Coordinate of the right vertical clipping plane. .IP \fIbottom\fR Coordinate of the bottom horizontal clipping plane. .IP \fItop\fR Coordinate of the top horizontal clipping plane. .IP \fInear\fR Coordinate of the near depth clipping plane. .IP \fIfar\fR Coordinate of the far depth clipping plane. .SH DESCRIPTION \fBvpWindow\fR is used to multiply the current projection matrix by a perspective or orthographic projection matrix. The new projection matrix is defined by the coordinates of six clipping planes in the eye coordinate system (see vpCurrentMatrix(3)). The matrix maps the points \fI(left, bottom, near)\fR and \fI(right, top, near)\fR to the lower left and upper right corners of the clipping window. For an alternative means of specifying the projection matrix, see vpWindowPHIGS(3). .PP Currently, only orthographic projections are supported. Perspective projections will be added in a future release. .PP The matrix for parallel projections is: .DS .ta 2C 6C 10C 14C A 0 0 D .br 0 B 0 E .br 0 0 C F .br 0 0 0 1 .sp A = 2 / \fI(right \- left)\fR .br B = 2 / \fI(top \- bottom)\fR .br C = 2 / \fI(far \- near)\fR .br D = \fI(left + right) / (left \- right)\fR .br E = \fI(bottom + top) / (bottom \- top)\fR .br F = \fI(near + far) / (near \- far)\fR .DE The matrix is multiplied into the projection matrix, even if the projection matrix is not the current matrix. By default, the matrix is post-multiplied (N = N*\fIm\fR where N is the current matrix and \fIm\fR is the argument to \fBvpMultMatrix\fR). The VP_CONCAT_MODE option to \fBvpSeti\fR can be used to select pre-multiplication. The default window is a parallel projection with left = bottom = near = -0.5, and right = top = far = 0.5. .SH "STATE VARIABLES" The current matrix concatenation parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_CONCAT_MODE. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VALUE The clipping plane coordinates are invalid (\fIleft >= right\fR, etc.). .IP VPERROR_BAD_OPTION The \fItype\fR argument is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpWindowPHIGS(3) ccseapps-2.5/CCSEApps/volpack/man/src/Callback.30000644000175000017500000001652411634153073022450 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetCallback 3 "" VolPack .SH NAME vpSetCallback \- define a callback function .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetCallback(\fIvpc, option, func\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FA void \fI(*func)();\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIoption\fR A code specifying which callback function to set. .IP \fIfunc\fR A pointer to the callback function. .SH DESCRIPTION \fBvpSetCallback\fR is used to set a callback function. The following list gives the possible values for \fIoption:\fR .IP VP_GRAY_SHADE_FUNC The \fIfunc\fR argument is a shading callback function that produces a floating point grayscale pixel intensity. The function should be declared: .RS .DS void \fIfunc\fR(\kxvoid *\fIvoxel_ptr,\fR float *\fIi_ptr\fR, .br \h'\nxu'void *\fIclient_data\fR); .DE .IP \fIvoxel_ptr\fR Pointer to the beginning of a voxel that must be shaded. .IP \fIi_ptr\fR Location into which the function should store the grayscale intensity result. It should be a single-precision floating point in the range 0.0 (black) to 1.0 (white). .IP \fIclient_data\fR Pointer to the application-defined client data (see vpSetClientData(3)). .PP The callback can be used to implement custom shading routines that cannot be implemented with a lookup table. See vpSetLookupShader(3) for more information. .RE .IP VP_RGB_SHADE_FUNC The \fIfunc\fR argument is a shading callback function that produces a floating point RGB pixel intensity. The function should be declared: .RS .DS void \fIfunc\fR(\kxvoid *\fIvoxel_ptr,\fR float *\fIr_ptr\fR, .br \h'\nxu'float *\fIr_ptr\fR, float *\fIr_ptr\fR, .br \h'\nxu'void *\fIclient_data\fR); .DE .IP \fIvoxel_ptr\fR Pointer to the beginning of a voxel that must be shaded. .IP "\fIr_ptr, g_ptr, b_ptr\fR" Location into which the function should store the RGB intensities of the result. Each intensity should be a single-precision floating point in the range 0.0 (no intensity) to 1.0 (full intensity). .IP \fIclient_data\fR Pointer to the application-defined client data (see vpSetClientData(3)). .PP The callback can be used to implement custom shading routines that cannot be implemented with a lookup table. See vpSetLookupShader(3) for more information. .RE .IP VP_READ_FUNC The \fIfunc\fR argument is a callback function that takes the same arguments and returns the same result as the \fBread\fR(2) system call. This function is used to read data from files (see vpLoadRawVolume(3)). By default, the \fBread\fR system call is used. The callback can be used to implement a custom I/O interface, for example a compression/decompression system. .IP VP_WRITE_FUNC The \fIfunc\fR argument is a callback function that takes the same arguments and returns the same result as the \fBwrite\fR(2) system call. This function is used to write data to files (see vpStoreRawVolume(3)). By default, the \fBwrite\fR system call is used. The callback can be used to implement a custom I/O interface, for example a compression/decompression system. .IP VP_MMAP_FUNC The \fIfunc\fR argument is a callback function that is called to memory map data from a file instead of copying the data into memory (see vpLoadRawVolume(3)). The function should be declared: .RS .DS void *\fIfunc\fR(\kxint \fIfd,\fR unsigned \fIoffset,\fR .br \h'\nxu'void *\fIclient_data\fR); .DE .IP \fIfd\fR File descriptor from \fBopen\fR(2) open for reading. .IP \fIoffset\fR Byte offset in the file to the beginning of the memory to be mapped. .IP \fIclient_data\fR Pointer to the application-defined client data (see vpSetClientData(3)). .PP The function should map the entire file into memory and return a pointer to the memory location that corresponds to the file offset. By default, memory mapping is disabled. .RE .IP VP_STATUS_FUNC The \fIfunc\fR argument is a callback function that is called periodically during long-running operations such as during preprocessing of a volume. The function should be declared: .RS .DS void \fIfunc\fR(double \fIfrac\fR, void *\fIclient_data\fR); .DE .IP \fIfrac\fR An estimate of the fraction of the current operation that is complete. .IP \fIclient_data\fR Pointer to the client data associated with the context. .PP The callback can be used to print a status report or to process time-critical events such as user input. However, the callback should not make any calls to VolPack functions since the internal VolPack state may be inconsistent. .RE .IP VP_LOG_ALLOC_FUNC The \fIfunc\fR argument is a callback function that is called whenever VolPack allocates memory. The function should be declared: .RS .DS void \fIfunc\fR(\kxvoid *\fIptr,\fR int \fIsize\fR, char *\fIuse\fR, .br \h'\nxu'int \fIline\fR, char *\fIfile\fR, void *\fIclient_data\fR); .DE .IP \fIptr\fR Address of the allocated memory. .IP \fIsize\fR Size (in bytes) of the allocated memory. .IP \fIuse\fR Short description of the use of the allocated memory. .IP \fIline\fR Source code line number for the call to the memory allocator. .IP \fIfile\fR Source code file name for the call to the memory allocator. .IP \fIclient_data\fR Pointer to the client data associated with the context. .PP The callback can be used to track memory allocations (primarily for debugging memory leaks). .RE .IP VP_LOG_FREE_FUNC The \fIfunc\fR argument is a callback function that is called whenever VolPack deallocates memory. The function should be declared: .RS .DS void \fIfunc\fR(void *\fIptr\fR, void *\fIclient_data\fR) .DE .IP \fIptr\fR Address of the deallocated memory. .IP \fIclient_data\fR Pointer to the client data associated with the context. .PP The callback can be used to track memory deallocations (primarily for debugging memory leaks). .RE .PP If the \fIfunc\fR argument is NULL then the corresponding callback function is reset to the default behavior or disabled if there is no default behavior. .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_OPTION The \fIoption\fR argument is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetClientData(3), vpSetLookupShader(3), vpLoadRawVolume(3), vpStoreRawVolume(3) ccseapps-2.5/CCSEApps/volpack/man/src/CurrentMatrix.30000644000175000017500000001041411634153073023553 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpCurrentMatrix 3 "" VolPack .SH NAME vpCurrentMatrix \- choose the current transformation matrix .SH SYNOPSIS #include .sp .FS vpResult \fBvpCurrentMatrix(\fIvpc, option\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIoption\fR A code specifying one of the VolPack transformation matrices (VP_MODEL, VP_VIEW or VP_PROJECT). .SH DESCRIPTION \fBvpCurrentMatrix\fR is used to choose the current transformation matrix. The \fIoption\fR parameter must be one of the following: .DS .ta 15 VP_MODEL modeling transformation .br VP_VIEW viewing transformation .br VP_PROJECT projection transformation .DE Subsequent calls to the matrix transformation functions (\fBvpIdentityMatrix, vpTranslate, vpRotate, vpScale, vpMultMatrix\fR and \fBvpSetMatrix\fR) are applied to the new current transformation matrix. .PP Typically the modeling transformation is used to specify a transformation from object coordinates to world coordinates. In object coordinates the volume data is located inside a unit cube centered at the origin (corners at (-0.5, -0.5, -0.5) and (0.5, 0.5, 0.5)). The default modeling transformation is the identity, so the volume is initially located inside the unit cube in world coordinates. By default, the current matrix is VP_MODEL. The modeling transformation is also applied to light direction vectors (see vpSetLight(3)). .PP The viewing transformation is used for transforming world coordinates into eye coordinates. In eye coordinates the viewer is looking down the Z axis in the negative direction. The default value of the matrix is also the identity, so the viewer is looking down the Z axis in world coordinates as well. Typically this transformation matrix is used to specify the location and direction of the viewer. It is also possible to combine the modeling and viewing matrices (as in the OpenGL viewing model), in which case you can store the composite transformation in either the model or the view matrix set the other matrix to the identity. .PP The projection transformation specifies the transformation from eye coordinates to clip coordinates. In the clip coordinate system the entire viewing frustum lies inside a cube defined by the planes X=1, X=-1, Y=1, Y=-1, Z=1 and Z=-1. This transformation also specifies the type of projection used to produce a 2D image. The 2D image is computed by projecting along the Z axis in the clip coordinate system and then scaling in the X and Y dimensions to the final image size. The routines \fBvpWindow\fR and \fBvpWindowPHIGS\fR are useful for computing projection transformations. .SH "STATE VARIABLES" The current transformation matrix code can be retrieved with the following state variable codes (see vpGeti(3)): VP_CURRENT_MATRIX. .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_OPTION The \fIoption\fR argument is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpGetMatrix(3) ccseapps-2.5/CCSEApps/volpack/man/src/Filter.30000644000175000017500000001016011634153073022167 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetFilter 3 "" VolPack .SH NAME vpSetFilter \- define a resampling filter .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetFilter(\fIvpc, num_taps, num_phases, weights\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fInum_taps, num_phases;\fR .FA float *\fIweights;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fInum_taps\fR Number of filter taps. .IP \fInum_phases\fR Number of filter phases. .IP \fIweights\fR Array containing filter weights. .SH DESCRIPTION \fBvpSetFilter\fR is used to specify a table of filter weights before resampling an array with \fBvpResample\fR. The table can be used to specify an arbitrary separable space-invariant filter. .PP The \fIvpc\fR argument is a VolPack context for storing a description of the resampling filter. The volume data and rendering parameters currently stored in the context are not affected by calls to \fBvpSetFilter\fR or \fBvpResample\fR. .PP The \fInum_taps\fR argument specifies the number of filter taps. When an array is resampled, the number of filter taps is equal to the number of input array elements that contribute to one element of the output array. A filter weight is associated with each tap and determines the contribution of the corresponding input array element to the output array element. Note that when upsampling the number of taps depends only on the support of the filter kernel. When downsampling, the number of taps should also depend on the scale factor (since the filter kernel must also be scaled). .PP The \fInum_phases\fR argument specifies the number of filter phases, which is equal to the number of times the filter kernel is sampled. The more filter phases, the more accurate the filtering operation. However, there is a point of diminishing returns where increasing the number of phases results in very little increase in accuracy, and has the disadvantages of increased storage requirements and potentially poor cache performance. To allow for an efficient implementation, \fInum_phases\fR must be a power of two. .PP The \fIweights\fR array contains the filter weights themselves. The array should have dimensions: .DS float weights[num_phases][num_taps]; .DE Each element should normally be a number between 0.0 and 1.0 (negative values are also possible but can lead to ringing), and for any particular phase the entries for all of the taps should sum to 1.0 (or else ripple is introduced into constant regions of the filtered array). .PP The easiest way to initialize the weight table is to call one of the predefined routines described in the vpBoxFilter(3) man page. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VALUE Either \fInum_taps\fR is non-positive or \fInum_phases\fR is not a positive power of two. .SH SEE ALSO VolPack(3), vpBoxFilter(3), vpResample(3) ccseapps-2.5/CCSEApps/volpack/man/src/Get.30000644000175000017500000003074111634153073021470 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/07 21:55:58 $ '\" $Revision: 1.2 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpGeti 3 "" VolPack .SH NAME vpGeti, vpGetd, vpGetp, vpGetCallbackp \- get the value of an option .SH SYNOPSIS #include .sp .FS vpResult \fBvpGeti(\fIvpc, option, iptr\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FA int *\fIiptr;\fR .FE .sp .FS vpResult \fBvpGetd(\fIvpc, option, dptr\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FA double *\fIdptr;\fR .FE .sp .FS vpResult \fBvpGetp(\fIvpc, option, pptr\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FA void *\fIpptr;\fR .FE .sp .FS vpResult \fBvpGetCallbackp(\fIvpc, option, pptr\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FA void (**\fIfptr)();\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIoption\fR Constant that specifies the option to be retrieved. .IP \fIiptr\fR Location to store an integer result. .IP \fIdptr\fR Location to store a double result. .IP \fIpptr\fR Location to store a pointer result. .IP \fIfptr\fR Location to store a function pointer result. .SH DESCRIPTION These functions are used the get the values of integer-, double- or pointer-valued state variables in a rendering context. The following list summarizes the integer-valued options that can be retrieved with \fBvpGeti\fR. The value of the option is stored in the location given by \fIiptr;\fR the return value of \fBvpGeti\fR is not the value of the option. Unless otherwise noted, the result is a single integer and \fIiptr\fR should point to a single integer location. .IP VP_XLEN Get the length of the X dimension of the volume in voxels. .IP VP_YLEN Get the length of the Y dimension of the volume in voxels. .IP VP_ZLEN Get the length of the Y dimension of the volume in voxels. .IP VP_BYTES_PER_VOXEL Get the size of a voxel in bytes. .IP VP_VOXEL_FIELD_COUNT Get the number of fields in a voxel. .IP VP_SHADE_FIELD_COUNT Get the number of fields in a voxel used as parameters for shading the voxel. .IP VP_FIELD_SIZES Get the size of each voxel field in bytes. \fIiptr\fR must point to an array of integers containing one entry for each voxel field (use VP_VOXEL_FIELD_COUNT to determine the number of fields). .IP VP_FIELD_OFFSETS Get the byte offset from the beginning of a voxel for each voxel field. \fIiptr\fR must point to an array of integers containing one entry for each voxel field (use VP_VOXEL_FIELD_COUNT to determine the number of fields). .IP VP_FIELD_MAXES Get the maximum value of the quantity stored in each voxel field. \fIiptr\fR must point to an array of integers containing one entry for each voxel field (use VP_VOXEL_FIELD_COUNT to determine the number of fields). .IP VP_VOXEL_DATA_SIZE Get the size (in bytes) of the 3D voxel array. .IP VP_VOXEL_XSTRIDE Get the stride (in bytes) for the X dimension of the 3D voxel array. .IP VP_VOXEL_YSTRIDE Get the stride (in bytes) for the Y dimension of the 3D voxel array. .IP VP_VOXEL_ZSTRIDE Get the stride (in bytes) for the Z dimension of the 3D voxel array. .IP VP_CLASSIFY_FIELD_COUNT Get the number of fields in a voxel used as parameters for classifying the voxel (the number of arguments to the opacity transfer function). .IP VP_CLASSIFY_FIELDS Get the field numbers for the arguments to the opacity transfer function. \fIiptr\fR must point to an array of integers containing one entry for each argument (use VP_CLASSIFY_FIELD_COUNT to determine the number of arguments). .IP VP_CLASSIFY_TABLE_SIZES Get the size (in bytes) of each lookup table used for the opacity transfer function. \fIiptr\fR must point to an array of integers containing one entry for each lookup table (use VP_CLASSIFY_FIELD_COUNT to determine the number of lookup tables, which equals the number of arguments to the opacity transfer function). .IP VP_COLOR_CHANNELS Get the number of color channels that the current shading lookup tables or shading callback function will produce. .IP VP_SHADE_COLOR_SIZE Get the size of the shading lookup table for color values (see vpSetLookupShader(3)). .IP VP_SHADE_WEIGHT_SIZE Get the size of the shading lookup table for weight values (see vpSetLookupShader(3)). .IP VP_MATERIAL_COUNT Get the number of material types used by the current lookup shader (see vpSetLookupShader(3)). .IP VP_SHADE_COLOR_FIELD Get the field number used for indexing the shading lookup table for color values (see vpSetLookupShader(3)). .IP VP_SHADE_WEIGHT_FIELD Get the field number used for indexing the shading lookup table for weight values (see vpSetLookupShader(3)). .IP VP_LIGHT0 .PD 0 .IP VP_LIGHT1 .IP VP_LIGHT2 .IP VP_LIGHT3 .IP VP_LIGHT4 .IP VP_LIGHT5 The retrieved value is nonzero if the corresponding light is enabled, or 0 if it is disabled. .PD .IP VP_LIGHT_BOTH_SIDES The retrieved value is nonzero if two-sided lighting is enabled (see vpSetLight(3)), or 0 if it is disabled. .IP VP_REVERSE_SURFACE_SIDES The retrieved value is nonzero if the definitions of interior and exterior surfaces have been reversed (see vpSetMaterial(3)), or 0 if they have not. .IP VP_DEPTH_CUE The retrieved value is nonzero if depth cueing is enabled, or 0 if it is disabled. .IP VP_DEPTH_CUE_TABLE_SIZE Get the current number of entries in the depth cueing table (see vpSetDepthCueing(3)). .IP VP_DEPTH_CUE_SIZE_HINT Get the current hint for the number of entries in the depth cueing table (see vpSetDepthCueing(3)). .IP VP_CURRENT_MATRIX Get the identifier for the current transformation matrix (VP_MODEL, VP_VIEW or VP_PROJECT). .IP VP_CONCAT_MODE Get the identifier for the current matrix concatenation mode (VP_CONCAT_LEFT or VP_CONCAT_RIGHT). .IP VP_IMAGE_WIDTH Get the width (in pixels) of the output image array. .IP VP_IMAGE_HEIGHT Get the height (in pixels) of the output image array. .IP VP_IMAGE_SCAN_SIZE Get the number bytes per scanline in the output image array. .IP VP_VIEW_AXIS Get the identifier for the current major viewing axis in the object coordinate system (VP_X_AXIS, VP_Y_AXIS or VP_Z_AXIS). The axis depends on the viewing transformation. .IP VP_INTERMEDIATE_WIDTH Get the width (in pixels) of the intermediate image required to render the current volume with the current viewing transformation (see vpRenderRawVolume(3)). .IP VP_INTERMEDIATE_HEIGHT Get the height (in pixels) of the intermediate image required to render the current volume with the current viewing transformation (see vpRenderRawVolume(3)). .IP VP_INTERMEDIATE_COLOR Get the number of color channels in the intermediate image (see vpRenderRawVolume(3)). .IP VP_INT_WIDTH_HINT Get the current hint for the width (in pixels) of the intermediate image (see vpRenderRawVolume(3)). .IP VP_INT_HEIGHT_HINT Get the current hint for the height (in pixels) of the intermediate image (see vpRenderRawVolume(3)). .IP VP_VIEW_X_AXIS .PD 0 .IP VP_VIEW_Y_AXIS .IP VP_VIEW_Z_AXIS The retrieved value is non-zero if computing a preclassified volume for the corresponding major viewing axis is enabled (see vpClassifyVolume(3)). .PD .IP VP_VIEW_X_SIZE .PD 0 .IP VP_VIEW_Y_SIZE .IP VP_VIEW_Z_SIZE Get the size (in bytes) of the preclassified volume for the corresponding major viewing axis. .PD .IP VP_MMOCTREE_THRESHOLDS Get the current min-max octree range thresholds. \fIiptr\fR must point to an array of integers containing one entry for each threshold (use VP_CLASSIFY_FIELD_COUNT to determine the number of thresholds, which equals the number of arguments to the opacity transfer function). .IP VP_MMOCTREE_SIZE Get the size (in bytes) of the min-max octree. .IP VP_SHADOW The retrieved value is nonzero if shadows are enabled (see vpSetShadowLookupShader(3)). .IP VP_SHADOW_LIGHT Get the constant (e.g. VP_LIGHT0) associated with the current shadow light (see vpSetShadowLookupShader(3)). .IP VP_SHADOW_WIDTH_HINT Get the current hint for the width (in pixels) of the shadow buffer (see vpSetShadowLookupShader(3)). .IP VP_SHADOW_HEIGHT_HINT Get the current hint for the height (in pixels) of the shadow buffer (see vpSetShadowLookupShader(3)). .IP VP_SHADOW_COLOR_SIZE Get the size of the shading lookup table for shadowed color values (see vpSetShadowLookupShader(3)). .IP VP_SHADOW_BIAS Get the current shadow bias value (see vpSetShadowLookupShader(3)). .IP VP_PIXEL_TYPE Get the current image pixel type (see vpSetImage(3)). .IP VP_CLAMP_SHADE_TABLE The retrieved value is nonzero if clamping is enabled for shade table entries, or 0 if it is disabled (see vpShadeTable(3)). .IP VP_COMPOSITE_ORDER This value is used for debugging only. It returns 1 if the current major viewing axis (VP_VIEW_AXIS) points in the same direction as the viewing direction, or -1 if they point in opposite directions. .PP The following list summarizes the double-valued options that can be retrieved with \fBvpGetd\fR. The result is always a single double and \fIdptr\fR should point to a single double location. .IP VP_MIN_VOXEL_OPACITY Get the minimum opacity threshold (see vpSeti(3)). .IP VP_DEPTH_CUE_FRONT Get the front depth cueing factor (see vpSetDepthCueing(3)). .IP VP_DEPTH_CUE_DENSITY Get the depth cueing density (see vpSetDepthCueing(3)). .IP VP_DEPTH_CUE_QUANTIZATION Get the depth cueing quantization (see vpSetDepthCueing(3)). .IP VP_MAX_RAY_OPACITY Get the maximum opacity threshold (see vpSeti(3)). .PP The following list summarizes the pointer-valued options that can be retrieved with \fBvpGetp\fR. Unless otherwise noted, the result is a single pointer and \fIpptr\fR should point to a single pointer location. .IP VP_VOXEL_DATA Get a pointer to the 3D voxel array. .IP VP_CLASSIFY_TABLES Get pointers to each of the lookup tables for the opacity transfer function. \fIpptr\fR must point to an array of pointers containing one entry for each table (use VP_CLASSIFY_FIELD_COUNT to determine the number of tables, which is equal to the number of arguments to the opacity transfer function). .IP VP_SHADE_COLOR_TABLE Get a pointer to the shading lookup table for colors (see vpSetLookupShader(3)). .IP VP_SHADE_WEIGHT_TABLE Get a pointer to the shading lookup table for weights (see vpSetLookupShader(3)). .IP VP_IMAGE Get a pointer to the output image array (see vpSetImage(3)). .IP VP_CLIENT_DATA Get a pointer to the client data (see vpSetClientData(3)). .IP VP_SHADOW_COLOR_TABLE Get a pointer to the shading lookup table for shadowed color values (see vpSetShadowLookupShader(3)). .PP The following list summarizes the function pointer-valued options that can be retrieved with \fBvpGetCallbackp\fR. Unless otherwise noted, the result is a single pointer and \fIfptr\fR should point to a single pointer location. .IP VP_SHADE_FUNC Get the shading callback function (see vpSetLookupShader(3)). .IP VP_LOG_ALLOC_FUNC Get a pointer to the memory allocator logging function (see vpSetCallback(3)). .IP VP_LOG_FREE_FUNC Get a pointer to the memory deallocator logging function (see vpSetCallback(3)). .IP VP_READ_FUNC Get a pointer to the file I/O read function (see vpSetCallback(3)). .IP VP_WRITE_FUNC Get a pointer to the file I/O write function (see vpSetCallback(3)). .IP VP_MMAP_FUNC Get a pointer to the file I/O memory mapping function (see vpSetCallback(3)). .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_OPTION The \fIoption\fR argument is invalid. .IP VPERROR_SINGULAR One of the current view transformation matrices is singular. (Only possible for options that depend on the current view transformation). .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSeti(3) ccseapps-2.5/CCSEApps/volpack/man/src/ShadeTable.30000644000175000017500000000726411634153073022751 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpShadeTable 3 "" VolPack .SH NAME vpShadeTable \- compute the contents of the shading lookup table .SH SYNOPSIS #include .sp .FS vpResult \fBvpShadeTable(\fIvpc\fB)\fR .FA vpContext *\fIvpc;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .SH DESCRIPTION \fBvpShadeTable\fR computes the contents of the shading lookup table previously specified with \fBvpLookupShader\fR. For each entry in the table, the Phong shading equation is evaluated using the current lighting properties (as specified with \fBvpSetLight\fR), material properties (as specified with \fBvpSetMaterial\fR), and viewing parameters (as specified with the view transformation commands). See vpSetMaterial(3) for a description of the shading calculation. .PP This function should be called before rendering a volume if any of the lighting or material properties have changed or if the viewpoint has changed since the last call to \fBvpShadeTable\fR. It should not be called if shading is performed using a callback function or if the shading lookup tables are initialized by a user-defined routine. .PP There is one state variable that affects the operation of \fBvpShadeTable\fR. If VP_CLAMP_SHADE_TABLE is enabled (see vpEnable(3)), then values are clamped to the range 0.0-255.0 before they are stored in the table. If this option is not enabled then no clamping is performed. Clamping is enabled by default, but can be turned off to achieve special effects. For example, if all of the voxels in a data set have very low opacity then the rendered image may be very dark. To brighten it, multiply all of the material parameter coefficients by a constant, possibly making the values exceed 1.0, and turn off clamping. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_SINGULAR One of the current view transformation matrices is singular. .IP VPERROR_BAD_SHADER The shading lookup tables are sized incorrectly, or one of the voxel fields used to index the tables is invalid, or the number of material types is invalid. .IP VPERROR_BAD_SHADOW The angle between the shadow light vector and the viewing direction is too large (must be less than 45 degrees). Either change the light direction or disable shadows (see vpSetShadowLookupShader). .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpSetLookupShader(3), vpSetLight(3), vpSetMaterial(3) ccseapps-2.5/CCSEApps/volpack/man/src/Shadow.30000644000175000017500000002072611634153073022200 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetShadowLookupShader 3 "" VolPack .SH NAME vpSetShadowLookupShader \- specify shading lookup tables for rendering shadows .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetShadowLookupShader(\fIvpc, color_channels, num_materials, color_field, color_table, color_table_size, weight_field, weight_table, weight_table_size, shadow_table, shadow_table_size\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIcolor_channels, num_materials;\fR .FA int \fIcolor_field;\fR .FA float *\fIcolor_table;\fR .FA int \fIcolor_table_size;\fR .FA int \fIweight_field;\fR .FA float *\fIweight_table;\fR .FA int \fIweight_table_size;\fR .FA float *\fIshadow_table;\fR .FA int \fIshadow_table_size;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIcolor_channels\fR The number of color channels per pixel (1 or 3). .IP \fInum_materials\fR The number of material types. .IP \fIcolor_field\fR Field number for voxel field containing color lookup table index. .IP \fIcolor_table\fR Color lookup table. .IP \fIcolor_table_size\fR Size of color lookup table in bytes. .IP \fIweight_field\fR Field number for voxel field containing material weight lookup table index. .IP \fIweight_table\fR Material weight lookup table. .IP \fIweight_table_size\fR Size of material weight lookup table in bytes. .IP \fIshadow_table\fR Shadow color lookup table. .IP \fIshadow_table_size\fR Size of shadow color lookup table in bytes. .SH DESCRIPTION \fBvpSetShadowLookupShader\fR is used to specify lookup tables that define a shading function for rendering a volume with shadows. It should be used instead of \fBvpSetLookupShader\fR when shadows are enabled. .PP VolPack supports a fast, one-pass shadow algorithm. The algorithm computes the fraction of light from a given light source that reaches each voxel. The fraction is then used to attenuate the diffuse and specular shading terms associated with that light source, producing a dark shadow in areas that are hidden from the light source. The implementation uses lookup tables so that most of the shading calculation can be precomputed. .PP In order to compute the shadows in a single pass the algorithm places a restriction on the direction of the light source: the light casting the shadows must not be more than 45 degrees from the viewing direction. The quality of the shadows may degrade if the angle approaches 45 degrees. The current implementation allows shadows to be cast only from one light source. Additional lights may be enabled, but they will not cast shadows. .PP To make a rendering with shadows, the following steps must be performed: .IP Call \fBvpSetShadowLookupShader\fR to define the lookup tables (see discussion below). .IP Call \fBvpSeti\fR with the VP_SHADOW_LIGHT option to specify which light will cast shadows. The current implementation only allows one light to be specified. .IP Call \fBvpSeti\fR with the VP_SHADOW_BIAS option to set the shadow bias value (see discussion below). .IP Call \fBvpEnable\fR with the VP_SHADOW option to enable shadows. .IP Call \fBvpShadeTable\fR as usual to initialize the lookup tables. .IP Call one of the rendering routines. .PP \fBvpSetShadowLookupShader\fR defines the lookup tables required for the shading and shadowing algorithm. The first nine arguments are identical to the arguments for \fBvpSetLookupShader\fR (see the corresponding man page). The remaining two arguments specify an additional color lookup table, \fIshadow_table,\fR with the same dimensions as \fIcolor_table\fR. The contents of the table will be initialized by \fBvpShadeTable\fR. .PP The call to \fBvpSeti\fR with the VP_SHADOW_BIAS option specifies an offset to eliminate self-shadowing. Self-shadowing is an intrinsic problem when implementing shadow algorithms for volume rendering. Consider a single voxelized object consisting of an opaque core surrounded by a "halo" of lower-opacity voxels (necessary for the scene to be band-limited). As a light ray pierces the halo its strength is attenuated. By the time the light reaches the high-opacity region a significant fraction of the light may be obscured, resulting in a general darkening of the image even if no shadows should be present. The problem can be corrected by moving the shadow a small distance along the direction of the light rays. VP_SHADOW_BIAS specifies the distance of the bias in units of voxels. The optimal value depends on the data set. Increase the bias until it has no more effect on overall image brightness, but do not increase it too far or small features in the data will no longer produce correct shadows. .PP \fBvpShadeTable\fR initializes the shading lookup tables. It operates differently when shadows are enabled. Instead of computing one color for each surface normal vector and storing the results in \fIcolor_table,\fR the routine computes two colors terms. The first term is the portion of the voxel color due to the diffuse and specular components of the shadow light. This value is stored in \fIshadow_table\fR. The second term contains the contribution of all other light source and the ambient light term, and is stored in \fIcolor_table.\fR During rendering the color of a voxel is computed by extracting a surface normal from the voxel, using the surface normal to index both \fIcolor_table\fR and \fIshadow_table,\fR attenuating the value from \fIshadow_table\fR by the local strength of the shadow light, and then adding the two terms together. The local strength of the shadow light is found by extracting a value from the shadow buffer, an internal data structure that is updated during rendering. .PP The values in the shading lookup tables may be initialized before or after calling \fBvpSetShadowLookupShader.\fR Typically \fBvpSetShadowLookupShader\fR is called once at the beginning of a rendering session, and then \fBvpShadeTable\fR is called whenever the user changes the lighting and shading parameters or the viewing direction. .PP The shadow buffer is an internal 2D array used to maintain state during rendering. There are several state variables that can be used to query its current size in pixels (VP_SHADOW_WIDTH and VP_SHADOW_HEIGHT) and to suggest a size (VP_SHADOW_WIDTH_HINT and VP_SHADOW_HEIGHT_HINT). The required size depends on the volume size and the shadow light's direction. Normally the buffer is automatically resized when necessary. .SH "STATE VARIABLES" Information about the current shading table parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_COLOR_CHANNELS, VP_SHADE_COLOR_TABLE, VP_SHADE_COLOR_SIZE, VP_SHADE_WEIGHT_TABLE, VP_SHADE_WEIGHT_SIZE, VP_SHADE_COLOR_FIELD, VP_SHADE_WEIGHT_FIELD, VP_MATERIAL_COUNT, VP_SHADOW, VP_SHADOW_LIGHT, VP_SHADOW_WIDTH_HINT, VP_SHADOW_HEIGHT_HINT, VP_SHADOW_WIDTH, VP_SHADOW_HEIGHT, VP_SHADOW_COLOR_TABLE, VP_SHADOW_COLOR_SIZE, VP_SHADOW_BIAS .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VALUE One or more of the arguments has an invalid value or is out of range. .IP VPERROR_LIMIT_EXCEEDED The \fInum_materials\fR argument has exceeded an internal limit. Change the value of VP_MAX_MATERIAL in volpack.h and recompile the VolPack library. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpShadeTable(3), vpSetLookupShader(3) ccseapps-2.5/CCSEApps/volpack/man/src/Rotate.30000644000175000017500000000651111634153073022205 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpRotate 3 "" VolPack .SH NAME vpRotate \- multiply the current transformation matrix by a rotation matrix .SH SYNOPSIS #include .sp .FS vpResult \fBvpRotate(\fIvpc, axis, degrees\fB)\fR .FA vpContext \fI*vpc;\fR .FA int \fIaxis;\fR .FA double \fIdegrees;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIaxis\fR Rotation axis code (VP_X_AXIS, VP_Y_AXIS or VP_Z_AXIS). .IP \fIdegrees\fR Number of degrees to rotate. .SH DESCRIPTION \fBvpRotate\fR is used to multiply the current transformation matrix by a 4-by-4 rotation matrix. The rotation axis must be one of the three principal viewing axes and is specified with one of the following codes: .DA .ta 15 VP_X_AXIS X axis .br VP_Y_AXIS Y axis .br VP_Z_AXIS Z axis .DE The rotation angle is specified in degrees. A positive angle indicates a clockwise rotation when looking towards the positive direction along the axis. For an X-axis rotation, the rotation matrix is: .DS .ta 4C 12C 20C 28C 1 0 0 0 .br 0 cos(d) sin(d) 0 .br 0 -sin(d) cos(d) 0 .br 0 0 0 1 .DE where d stands for the \fIdegrees\fR argument. For a Y-axis rotation, the rotation matrix is: .DS .ta 4C 12C 20C 28C cos(d) 0 -sin(d) 0 .br 0 1 0 0 .br sin(d) 0 cos(d) 0 .br 0 0 0 1 .DE For a Z-axis rotation, the rotation matrix is: .DS .ta 4C 12C 20C 28C cos(d) sin(d) 0 0 .br -sin(d) cos(d) 0 0 .br 0 0 1 0 .br 0 0 0 1 .DE .PP Use \fBvpCurrentMatrix\fR to set the current transformation matrix. By default, the rotation matrix is post-multiplied (M = M*R where M is the current matrix and R is the rotation matrix). The VP_CONCAT_MODE option to \fBvpSeti\fR can be used to select pre-multiplication. .SH "STATE VARIABLES" The current matrix concatenation parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_CURRENT_MATRIX, VP_CONCAT_MODE. .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_OPTION The \fIaxis\fR argument is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCurrentMatrix(3) ccseapps-2.5/CCSEApps/volpack/man/src/ClsfyVolume.30000644000175000017500000001200711634153073023214 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpClassifyVolume 3 "" VolPack .SH NAME vpClassifyVolume, vpDestroyClassifiedVolume \- create/destroy a preclassified volume for fast rendering .SH SYNOPSIS #include .sp .FS vpResult \fBvpClassifyVolume(\fIvpc\fB)\fR .FA vpContext *\fIvpc;\fR .FE .sp .FS vpResult \fBvpDestroyClassifyVolume(\fIvpc\fB)\fR .FA vpContext *\fIvpc;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .SH DESCRIPTION \fBvpClassifyVolume\fR is used to compute a preclassified volume for the fast rendering algorithm. The preclassified volume is an internal data structure optimized for rendering speed. \fBvpClassifyVolume\fR should be called after a voxel array has been defined (with \fBvpSetVolumeSize, vpSetVoxelSize, vpSetVoxelField,\fR and \fBvpSetRawVoxels\fR) and initialized (with \fBvpVolumeNormals\fR or a user-defined routine). An opacity transfer function must also be defined with \fBvpSetClassifierTable,\fR and the minimum opacity threshold should be set with the VP_MIN_VOXEL_OPACITY parameter to \fBvpSeti\fR. Two alternative routines are provided to compute a preclassified volume directly from a 3D scalar array or a sequence of scalar scanlines in order to avoid allocating a large 3D voxel array (see vpClassifyScalars(3) and vpClassifyScanline(3)). .PP \fBvpClassifyVolume\fR classifies and processes the data in the voxel array and creates a separate preclassified volume. The preclassified data is stored in a run-length encoded format, and voxels that have opacities less than or equal to the minimum opacity threshold are discarded. Normally, three copies of the preclassified volume are created, one for each of the three principal viewing axis. If only one or two copies are necessary for the required range of viewpoints then \fBvpSeti\fR may be called with one or more of the following parameters to specify which copies are required: VP_VIEW_X_AXIS, VP_VIEW_Y_AXIS, VP_VIEW_Z_AXIS. Using these parameters is not recommended unless swap space is lacking. .PP If a min-max octree is present in the rendering context (see vpCreateMinMaxOctree(3)) then it is used to accelerate computation of the preclassified volume. It is advantageous to create a min-max octree if the same volume data will be classified multiple times (with different opacity transfer functions). .PP Once \fBvpClassifyVolume\fR is finished, the original voxel array is no longer necessary for rendering as long as the opacity transfer function and the volume data do not change. If any changes are made, then the preclassified volume must be explicitly recomputed by calling \fBvpClassifyVolume\fR again. Only one preclassified volume may be stored in a rendering context at a time. Calling \fBvpClassifyVolume\fR causes any existing preclassified volume to be destroyed. .PP \fBvpDestroyClassifiedVolume\fR destroys the current preclassified volume and frees the associated space. .SH "STATE VARIABLES" Information about the current preclassified volume can be retrieved with the following state variable codes (see vpGeti(3)): VP_VIEW_X_SIZE, VP_VIEW_Y_SIZE, VP_VIEW_Z_SIZE, VP_VIEW_X_AXIS, VP_VIEW_Y_AXIS, VP_VIEW_Z_AXIS. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VOXEL The voxel size or the voxel fields have not been specified or have been incorrectly specified. .IP VPERROR_BAD_VOLUME The volume array or volume dimensions have not been specified, or the size of the volume array does not match the volume dimensions. .IP VPERROR_BAD_CLASSIFIER The opacity transfer function tables have invalid sizes or are associated with invalid voxel fields or have been incorrectly specified. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetClassifierTable(3), vpClassifyScalars(3), vpClassifyScanline(3) ccseapps-2.5/CCSEApps/volpack/man/src/TracePixel.30000644000175000017500000000427211634153073023011 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpTracePixel 3 "" VolPack .SH NAME vpTracePixel \- print a trace of the voxels composited into a pixel .SH SYNOPSIS #include .sp .FS vpResult \fBvpTracePixel(\fIvpc, trace_u, trace_v\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fItrace_u, trace_v;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP "\fItrace_u, trace_v\fR" Intermediate image coordinates of the pixel to trace. .SH DESCRIPTION This routine is for debugging the rendering algorithms. If \fI(trace_u, trace_v)\fR is a valid set of coordinates in the intermediate image then a printout appears during rendering showing a trace of all of the voxels that contribute to the pixel. The intermediate image is not the same as the final image; see vpGetvpSetImage(3). .PP The VolPack library must be compiled with the -DDEBUG compiler option for this function to have any effect. .SH SEE ALSO VolPack(3) ccseapps-2.5/CCSEApps/volpack/man/src/GetImage.30000644000175000017500000001030211634153073022422 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpGetImage 3 "" VolPack .SH NAME vpGetImage \- get a field of the intermediate image .SH SYNOPSIS #include .sp .FS vpResult \fBvpGetImage(\fIvpc, image, width, height, scan_bytes, pixel_type, image_type\fB)\fR .FA vpContext *\fIvpc;\fR .FA void *\fIimage;\fR .FA int \fIwidth, height;\fR .FA int \fIscan_bytes;\fR .FA int \fIpixel_type, image_type;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIimage\fR 2D array for storing result image. .IP \fIwidth\fR Width of array in pixels. .IP \fIheight\fR Height of array in pixels. .IP \fIscan_bytes\fR Number of bytes per scanline in array. .IP \fIpixel_type\fR Code indicating the format of each pixel in the array. .IP \fIimage_type\fR Code indicating the source of the image data (VP_IMAGE_BUFFER or VP_SHADOW_BUFFER). .SH DESCRIPTION This is a debugging function. It is used to retrieve the contents of one of the temporary rendering buffers used during rendering, namely the intermediate image or the shadow buffer. Rendering consists of two stages: the volume is resampled and composited into the intermediate image to produce a distorted volume rendering, and then the intermediate image is warped into the final image. If shadows are enabled then the shadow buffer is used during the first stage to incrementally compute which voxels are illuminated by the light source. This function returns images produced during the first stage, before the final warp. .PP This function may be called after a call to one of the rendering routines (see vpRenderRawVolume(3)). If the \fIimage_type\fR argument is VP_IMAGE_BUFFER then data will be copied from the intermediate image. The \fIpixel_type\fR argument specifies what information to copy and the format for storing the data in the output array. The possible values for \fIpixel_type\fR are the same as for the \fIpixel_type\fR argument to \fBvpSetImage.\fR For instance, use VP_LUMINANCE to extract the grayscale intensity (assuming the current shader produces grayscale pixels). .PP If the \fIimage_type\fR argument is VP_SHADOW_BUFFER then data will be copied from the shadow buffer. The only valid option for \fIpixel_type\fR is VP_ALPHA, since no color information is stored in the shadow buffer. .PP See \fBvpSetImage\fR for details on the pixel formats, the layout of the output array, and the remaining arguments. .PP To find the required size for the result array, use \fBvpGeti\fR with the VP_INTERMEDIATE_WIDTH and VP_INTERMEDIATE_HEIGHT options (when \fIimage_type\fR is VP_IMAGE_BUFFER) or the VP_SHADOW_WIDTH and VP_SHADOW_HEIGHT options (when \fIimage_type\fR is VP_SHADOW_BUFFER). .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_SIZE The destination array size is incorrect or there is no intermediate image. .IP VPERROR_BAD_OPTION The \fIfield\fR argument is invalid. .SH SEE ALSO VolPack(3), vpRenderRawVolume(3), vpGeti(3) ccseapps-2.5/CCSEApps/volpack/man/src/ClsfyTable.30000644000175000017500000001314311634153073022776 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetClassifierTable 3 "" VolPack .SH NAME vpSetClassifierTable \- specify an opacity transfer function .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetClassifierTable(\fIvpc, param_num, param_field, table, table_size\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIparam_num, param_field;\fR .FA float *\fItable;\fR .FA int \fItable_size;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIparam_num\fR Parameter number identifying one parameter of the opacity transfer function. .IP \fIparam_field\fR Field number identifying a voxel field that contains the parameter. .IP \fItable\fR Lookup table that defines the mapping from the voxel field value to the opacity. .IP \fItable_size\fR Size of \fItable\fR in bytes. .SH DESCRIPTION \fBvpSetClassifierTable\fR is used to specify lookup tables that define an opacity transfer function. The opacity transfer function must be of the form: .DS opacity = f0(param0) * f1(param1) * ... * fN(paramN) .DE where each of the factors is a function of one voxel field (see below for implementing more general classification models). \fBvpSetClassifierTable\fR must be called once for each factor to specify a lookup table that defines the factor. After the function has been specified, opacities are computed by calling one of the classification functions: \fBvpClassifyScalars, vpClassifyVolume,\fR or \fBvpClassifyScanline.\fR To classify a voxel, these functions use the values in the fields of the voxel as indexes into the opacity transfer function tables, retrieve one value from each table, and multiply the values together to compute the opacity for the voxel. The opacity should be a number in the range 0.0-1.0, so normally each table contains numbers that are also in this range. .PP The parameters of the opacity transfer function are numbered from zero, and the total number of parameters must be specified using \fBvpSetVoxelSize\fR before calling \fBvpSetClassifierTable\fR. The number of parameters is independent of the number of voxel fields: some fields may not be used as parameters, and one field could be used multiple times (although this is inefficient since all of the tables indexed by the same parameter could be merged into one table). .PP Each table should be a 1D array of numbers with one entry for each possible value of the corresponding voxel field. The voxel field must contain an unsigned integer quantity. Normally each table would be declared: .DS float table[MAX_FIELD_VALUE + 1]; .DE where MAX_FIELD_VALUE is the maximum possible value in the voxel field as specified with \fBvpSetVoxelField.\fR The table may also be dynamically allocated. Note that VolPack will never free the table, even if the VolPack context is destroyed with \fBvpDestroyContext,\fR so the application is responsible for freeing the memory when appropriate. The values in the table may be initialized or modified at any time before or after calling \fBvpSetClassifierTable,\fR but before calling one of the classification routines. See the function \fBvpRamp\fR for a convenient way to initialize tables with piece-wise linear ramps. .PP Classification functions that are not expressible in the form above can be handled as follows. First, write your own routine that computes the opacity for each voxel. Next, quantize the opacities using somewhere between 8 and 16 bits per voxel, and store the quantized values in one field of each voxel. Finally, define an opacity transfer function table that maps the quantized opacities into a floating point number in the range 0.0-1.0 and use the table to define a single-parameter opacity transfer function by calling \fBvpSetClassifierTable.\fR .PP The minimum opacity threshold should be set at the same time as the opacity transfer function. See the VP_MIN_VOXEL_OPACITY argument to \fBvpSetd\fR. .SH "STATE VARIABLES" The current classification function parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_CLASSIFY_FIELD_COUNT, VP_CLASSIFY_FIELDS, VP_CLASSIFY_TABLES, VP_CLASSIFY_TABLE_SIZES, VP_MIN_VOXEL_OPACITY .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_VALUE Either \fIparam_num\fR or \fIfield_num\fR is out of range. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpClassifyScanline(3), vpClassifyScalars(3), vpClassifyVolume(3), vpRamp(3) ccseapps-2.5/CCSEApps/volpack/man/src/Context.30000644000175000017500000000433211634153073022372 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpCreateContext 3 "" VolPack .SH NAME vpCreateContext, vpDestroyContext \- create/destroy a rendering context .SH SYNOPSIS #include .sp .FS "vpContext *" \fBvpCreateContext()\fR .FE .sp .FS void \fBvpDestroyContext(vpc)\fR .FA vpContext *\fIvpc;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .SH DESCRIPTION \fBvpCreateContext\fR returns a handle for a new rendering context. It contains default values for most of the rendering parameters. .PP \fBvpDestroyContext\fR destroys a rendering context and frees the associated memory. Only data structures allocated by the library are freed; application-defined data structures that are referenced in the rendering context through a pointer are not freed (e.g.\ arrays of volume data and shading lookup tables). The application is responsible for keeping track of such data structures and freeing them when appropriate. .SH SEE ALSO VolPack(3) ccseapps-2.5/CCSEApps/volpack/man/src/OctreeMask.30000644000175000017500000001011711634153073023001 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpOctreeMask 3 "" VolPack .SH NAME vpOctreeMask \- compute a mask representing one level of a min-max octree .SH SYNOPSIS #include .sp .FS vpResult \fBvpOctreeMask(\fIvpc, array, array_size, max_level\fB)\fR .FA vpContext \fI*vpc;\fR .FA unsigned char *\fIarray;\fR .FA int \fIarray_size;\fR .FA int \fImax_level;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIarray\fR A 3D array for storing the mask. .IP \fIarray_size\fR Size of \fIarray\fR in bytes. .IP \fImax_level\fR Maximum octree level to descend to. .SH DESCRIPTION \fBvpOctreeMask\fR is used for performance debugging when rendering volumes with a min-max octree. During rendering the min-max octree is used to help determine which voxels are transparent. The time required to make this determination can be minimized by an appropriate choice for the range parameters for \fBvpMinMaxOctreeThreshold\fR and the node size parameters for \fBvpCreateMinMaxOctree\fR. \fBvpOctreeMask\fR provides information that can help to determine whether a set of parameters works effectively or not. .PP The output of the routine is stored in a 3D array of bytes that has the same dimensions as the volume (although each element is only one byte, regardless of the size of a voxel). For each voxel in the volume the corresponding byte in the output array is set by \fBvpOctreeMask\fR to one of three values: 0 if the voxel is definitely transparent, 255 if the voxel may be non-transparent, or 128 if the voxel may be non-transparent and there is more detailed information available at unvisited levels of the octree. The \fImax_level\fR argument specifies the deepest level of the octree to be visited (the root level is level 0). .PP A suggested way to use this routine is to compute an octree using a particular set of parameters and then call \fBvpOctreeMask\fR with several different values for \fImax_level.\fR For each resulting mask array, look at slices (or create a volume rendering!) and see how accurately the mask captures the general shape of the data in the original volume. The best set of parameters results in a mask that captures the general shape without an excessively small value for the minimum octree node size (which would result in a very large data structure and a lot of traversal overhead). .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_SIZE There is no octree or the output array has the wrong size. .IP VPERROR_BAD_VOXEL The voxel size or the voxel fields have not been specified or have been incorrectly specified. .IP VPERROR_BAD_CLASSIFIER The opacity transfer function tables have invalid sizes or are associated with invalid voxel fields or have been incorrectly specified. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCreateMinMaxOctree(3) ccseapps-2.5/CCSEApps/volpack/man/src/Light.30000644000175000017500000001150411634153073022014 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetLight 3 "" VolPack .SH NAME vpSetLight \- set lighting properties .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetLight(\fIvpc, light_num, property, n0, n1, n2\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIlight_num;\fR .FA int \fIproperty;\fR .FA double \fIn0, n1, n2;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIlight_num\fR A constant specifying a particular light source (VP_LIGHT0, VP_LIGHT1, ..., VP_LIGHT5). .IP \fIproperty\fR A constant specifying one lighting property (VP_COLOR or VP_DIRECTION). .IP "\fIn0, n1, n2\fR" Components of an RGB color (for VP_COLOR) or a direction vector (for VP_DIRECTION). .SH DESCRIPTION \fBvpSetLight\fR is used to set the properties of a light source. VolPack currently only supports directional light sources: each light is infinitely distant, so it can be fully characterized by a direction vector and a color. The lighting properties are used by \fBvpShadeTable\fR to compute the shading lookup table, which is then used to compute a color for each voxel. .PP To initialize the lighting environment, call \fBvpSetLight\fR twice for each light source which will be enabled. One call should set the RGB components of the light color (by using the VP_COLOR code for the \fIproperty\fR parameter), and one call should set the XYZ components of the light direction vector (by using the VP_DIRECTION code for the \fIproperty\fR parameter). The particular light source is specified with one of the light source codes defined in volpack.h: VP_LIGHT0, VP_LIGHT1, ..., VP_LIGHT5. In the current implementation, at most six light sources may be specified. .PP The RGB components of a light color should be numbers in the range 0.0 (zero intensity) to 1.0 (full intensity). For grayscale renderings only the first (red) component is used and the other components may be set to any legal value. The default is white light (1.0, 1.0, 1.0). .PP The light direction vector points from the light source towards the lit object. It is transformed by the current contents of the modeling matrix (see \fBvpCurrentMatrix\fR). This allows the direction vector to be specified in an arbitrary coordinate system, provided the current modeling matrix properly transforms the vector into world coordinates. The default is the vector (1,1,1). .PP Each light source contributes to the shading computation only if it is enabled by calling \fBvpEnable.\fR By default, VP_LIGHT0 is enabled and all other lights are disabled. The more light sources that are enabled, the longer it takes to precompute the contents of the shading lookup table. .PP One additional property of the light sources can be set with \fBvpEnable\fR: VP_LIGHT_BOTH_SIDES. With this option enabled each light source shines in two opposing directions, as if there were two light sources facing each other with opposite direction vectors. No additional computation is required when this option is enabled. .SH "STATE VARIABLES" Information about the current lighting properties can be retrieved with the following state variable codes (see vpGeti(3)): VP_LIGHT_BOTH_SIDES. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_LIMIT_EXCEEDED The light number is invalid or exceeds an implementation limit. .IP VPERROR_SINGULAR The light direction vector is a zero vector. .IP VPERROR_BAD_VALUE The RGB color components are out of range. .IP VPERROR_BAD_OPTION The \fIproperty\fR argument is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpSetLookupShader(3), vpShadeTable(3), vpGetLight(3) ccseapps-2.5/CCSEApps/volpack/man/src/Set.30000644000175000017500000001244411634153073021504 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSeti 3 "" VolPack .SH NAME vpSeti, vpSetd \- set the value of an option .SH SYNOPSIS #include .sp .FS vpResult \fBvpSeti(\fIvpc, option, value\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FA int \fIvalue;\fR .FE .sp .FS vpResult \fBvpSetd(\fIvpc, option, value\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FA double \fIvalue;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIoption\fR Constant that specifies the option to be set. .IP \fIvalue\fR New value for the option. .SH DESCRIPTION These functions are used to set the values of integer- or double-valued options in a rendering context. The following list summarizes the integer-valued options that can be set with \fBvpSeti\fR: .IP VP_CONCAT_MODE Choose whether transformation matrices are premultiplied or postmultiplied. If \fIvalue\fR is VP_CONCAT_LEFT then matrices are premultiplied. If \fIvalue\fR is VP_CONCAT_RIGHT then matrices are postmultiplied. Default: VP_CONCAT_RIGHT. .IP VP_DEPTH_CUE_SIZE_HINT Set the suggested number of entries in the depth cueing lookup table. See vpSetDepthCueing(3). Default: none .IP VP_INT_WIDTH_HINT Set the suggested width (in pixels) of the intermediate image work buffer. See vpRenderRawVolume(3). Default: none .IP VP_INT_HEIGHT_HINT Set the suggested height (in pixels) of the intermediate image work buffer. See vpRenderRawVolume(3). Default: none .IP VP_SHADOW_LIGHT Get the current shadow light (see vpSetShadowLookupShader(3)). Legal values are VP_LIGHT0, VP_LIGHT1, ..., VP_LIGHT5. Default: VP_LIGHT0 .IP VP_SHADOW_WIDTH_HINT Set the suggested width (in pixels) of the shadow buffer (see vpSetShadowLookupShader(3)). Default: none .IP VP_SHADOW_HEIGHT_HINT Set the suggested height (in pixels) of the shadow buffer (see vpSetShadowLookupShader(3)). Default: none .IP VP_SHADOW_BIAS Set the current shadow bias value (see vpSetShadowLookupShader(3)). The value is an integral distance in units of voxels. Default: 4 .IP VP_AXIS_OVERRIDE Force the rendering routine to composite along a particular principle viewing axis, regardless of the current viewing direction. Legal values are VP_X_AXIS, VP_Y_AXIS or VP_Z_AXIS. Set the value to VP_NO_AXIS to let VolPack choose the optimal axis automatically (the default). This option is normally used only for debugging. .IP VP_TRACE_SHADOW_K When pixel tracing is enabled (see vpTracePixel(3)) and shadows are enabled (the VP_SHADOW option to vpEnable(3)), this option is used to choose one shadow buffer pixel to trace. The value must be a voxel slice number. The shadow buffer pixel that gets traced is the shadow pixel that affects the traced image pixel at the indicated slice. .PP The following list summarizes the double-valued options that can be set with \fBvpSetd\fR: .IP VP_DEPTH_CUE_QUANTIZATION Set the difference in depth between two adjacent entries in the depth cueing lookup table (see vpSetDepthCueing(3)). Must be greater than 0.0 and less than 1.0. Default: 1/255 .IP VP_MAX_RAY_OPACITY Set the maximum opacity threshold. During rendering, when a pixel's opacity reaches this threshold no more voxels are composited into the pixel. To maximize performance, the value should be as low as possible without adversely affecting image quality. Must be in the range 0.0-1.0 (1.0 is the default and 0.95 is the suggested value). Default: 1.0 .IP VP_MIN_VOXEL_OPACITY Set the minimum opacity threshold. During classification, if a voxel's opacity is less than or equal to this threshold then the voxel is discarded before rendering. To maximize performance, the value should be as high as possible without adversely affecting image quality. Must be in the range 0.0-1.0 (0.0 is the default and 0.05 is the suggested value). Default: 0.0 .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_OPTION The \fIoption\fR argument is invalid. .IP VPERROR_BAD_VALUE The \fIvalue\fR argument is invalid or out of range. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpGeti(3) ccseapps-2.5/CCSEApps/volpack/man/src/Enable.30000644000175000017500000000612111634153073022132 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpEnable 3 "" VolPack .SH NAME vpEnable \- enable or disable options .SH SYNOPSIS #include .sp .FS vpResult \fBvpEnable(\fIvpc, option, value\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIoption;\fR .FA int \fIvalue;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIoption\fR Constant that specifies the option to be adjusted. .IP \fIvalue\fR New value for the option (boolean: 0 or 1). .SH DESCRIPTION \fBvpEnable\fR is used to enable or disable boolean options in a rendering context. If the \fIvalue\fR option is 0 then the option is disabled; otherwise it is enabled. The following list summarizes all available options: .IP VP_LIGHT0 .PD 0 .IP VP_LIGHT1 .IP VP_LIGHT2 .IP VP_LIGHT3 .IP VP_LIGHT4 .IP VP_LIGHT5 Enable the corresponding light source (see vpSetLight(3)). Default: VP_LIGHT0 is enabled, and all others are disabled. .PD .IP VP_LIGHT_BOTH_SIDES Enable two-sided lighting (see vpSetLight(3)). Default: disabled .IP VP_REVERSE_SURFACE_SIDES Reverse the definition of interior and exterior surfaces (see vpSetMaterial(3)). Default: disabled .IP VP_DEPTH_CUE Enable depth cueing (see vpSetDepthCueing(3)). Default: disabled .IP VP_VIEW_X_AXIS .PD 0 .IP VP_VIEW_Y_AXIS .IP VP_VIEW_Z_AXIS Enable computing a preclassified volume for the corresponding major viewing axis (see vpClassifyVolume(3)). Default: enabled .PD .IP VP_SHADOW Enable rendering shadows (see vpSetShadowLookupShader(3)). Default: disabled .IP VP_CLAMP_SHADE_TABLE Enable clamping the color components in a shade table to the range 0.0-255.0. This option affects vpShadeTable(). Default: enabled .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_VALUE The \fIoption\fR argument is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3) ccseapps-2.5/CCSEApps/volpack/man/src/WindowPHIGS.30000644000175000017500000001247211634153073023014 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpWindowPHIGS 3 "" VolPack .SH NAME vpWindowPHIGS \- multiply the projection matrix by a PHIGS viewing matrix .SH SYNOPSIS #include .sp .FS vpResult \fBvpWindowPHIGS(\fIvpc, vrp, vpn, vup, prp, umin, umax, vmin, vmax, front, back, projection_type\fB)\fR .FA vpContext *\fIvpc;\fR .FA vpVector3 \fIvrp, vpn, vup;\fR .FA vpVector3 \fIprp;\fR .FA double \fIumin, umax, vmin, vmax, front, back;\fR .FA int \fIprojection_type;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIvrp\fR Point specifying the view reference point. .IP \fIvpn\fR Vector specifying the view plane normal. .IP \fIvup\fR Vector specifying the view up vector. .IP \fIprp\fR Point specifying the projection reference point (in view reference coordinates). .IP \fIumin\fR Left coordinate of clipping window (in view reference coordinates). .IP \fIumax\fR Right coordinate of clipping window (in view reference coordinates). .IP \fIvmin\fR Bottom coordinate of clipping window (in view reference coordinates). .IP \fIvmax\fR Top coordinate of clipping window (in view reference coordinates). .IP \fIfront\fR Coordinate of the near depth clipping plane (in view reference coordinates). .IP \fIback\fR Coordinate of the far depth clipping plane (in view reference coordinates). .IP \fIprojection_type\fR Projection type code. Currently, must be VP_PARALLEL. .SH DESCRIPTION \fBvpWindowPHIGS\fR is used to multiply the current projection matrix by a viewing and projection matrix specified by means of the PHIGS viewing model. This model combines specification of the viewpoint, projection and clipping parameters. The resulting matrix is stored in the projection transformation matrix. Since both the view and the projection are specified in this one matrix, normally the view transformation matrix is not used in conjunction with \fBvpWindowPHIGS\fR (it should be set to the identity). Currently, only parallel projections may be specified. For an alternative view specification model, see vpWindow(3). .PP Assuming that the view transformation matrix is the identity, the matrix produced by \fBvpWindowPHIGS\fR should transform world coordinates into clip coordinates. This transformation is specified as follows. First, the projection plane (called the view plane) is defined by a point on the plane (the view reference point, \fIvrp\fR) and a vector normal to the plane (the view plane normal, \fIvpn\fR). Next, a coordinate system called the view reference coordinate (VRC) system is specified by means of the view plane normal and the view up vector, \fIvup.\fR The origin of VRC coordinates is the view reference point. The basis vectors of VRC coordinates are: .DS \fBu\fR = v cross n .br \fBv\fR = the projection of \fIvup\fR parallel to \fIvpn\fR onto the view plane .br \fBn\fR = \fIvpn\fR .DE This coordinate system is used to specify the direction of projection and the clipping window. The clipping window bounds in the projection plane are given by \fIumin, umax, vmin\fR and \fIvmax.\fR The direction of projection is the vector from the center of the clipping window to the projection reference point \fI(prp),\fR which is also specified in VRC coordinates. Finally, the front and back clipping planes are given by n=\fIfront\fR and n=\fIback\fR in VRC coordinates. .PP For a more detailed explanation of this view specification model, see \fIComputer Graphics: Principles and Practice\fR by Foley, vanDam, Feiner and Hughes. .SH "STATE VARIABLES" The current matrix concatenation parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_CONCAT_MODE. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VALUE The clipping plane coordinates are invalid (\fIumin >= umax\fR, etc.). .IP VPERROR_BAD_OPTION The \fItype\fR argument is invalid. .IP VPERROR_SINGULAR The vectors defining view reference coordinates are not mutually orthogonal, or the projection reference point lies in the view plane. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpWindow(3) ccseapps-2.5/CCSEApps/volpack/man/src/ClsfyScalar.30000644000175000017500000001035311634153073023154 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpClassifyScalars 3 "" VolPack .SH NAME vpClassifyScalars \- create a preclassified volume from scalar data .SH SYNOPSIS #include .sp .FS vpResult \fBvpClassifyScalars(\fIvpc, scalar_data, length, scalar_field, gradient_field, norm_field\fB)\fR .FA vpContext *\fIvpc;\fR .FA unsigned char *\fIscalars;\fR .FA int \fIsize;\fR .FA int \fIscalar_field, gradient_field, norm_field;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIscalar_data\fR A 3D array containing one 8-bit scalar value for each voxel in the volume. .IP \fIlength\fR Size of \fIscalar_data\fR in bytes. .IP \fIscalar_field\fR Field number identifying a voxel field for storing the scalar value. .IP \fIgradient_field\fR Field number identifying a voxel field for storing the gradient magnitude of the scalar value. .IP \fInorm_field\fR Field number identifying a voxel field for storing the surface normal vector for the voxel. .SH DESCRIPTION \fBvpClassifyScalars\fR combines the functionality of \fBvpVolumeNormals\fR and \fBvpClassifyVolume\fR to produce a preclassified volume directly from a 3D array of scalar values without creating a 3D voxel array. This routine is useful for preparing large data sets for rendering with a fixed classification function, especially if the 3D voxel array would be too large to fit in main memory. The primary limitation is that the only fields each voxel may contain are the fields produced by \fBvpVolumeNormals\fR: an 8-bit scalar value, and 8-bit gradient and/or a 16-bit surface normal vector. See also \fBvpClassifyScanline\fR for processing one scanline of a scalar array at a time. .PP To use the function, first define the volume size, voxel size, and voxel fields as you would before calling \fBvpVolumeNormals\fR. However, there is no need to call \fBvpSetRawVoxels.\fR Also define the opacity transfer function (see vpSetClassifierTable(3)). Then call \fBvpClassifyScalars\fR with the same arguments you would use for \fBvpVolumeNormals;\fR see vpVolumeNormals(3) for more details. The result is a preclassified volume, as described in vpClassifyVolume(3). If a voxel array has been declared it is not used or modified. .PP Any existing preclassified volume data is destroyed. .SH "STATE VARIABLES" Information about the current preclassified volume can be retrieved with the following state variable codes (see vpGeti(3)): VP_VIEW_X_SIZE, VP_VIEW_Y_SIZE, VP_VIEW_Z_SIZE, VP_VIEW_X_AXIS, VP_VIEW_Y_AXIS, VP_VIEW_Z_AXIS. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VOXEL The voxel size or the voxel fields have not been specified or have been incorrectly specified. .IP VPERROR_BAD_CLASSIFIER The opacity transfer function tables have invalid sizes or are associated with invalid voxel fields or have been incorrectly specified. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpVolumeNormals(3), vpSetClassifierTable(3), vpClassifyVolume(3), vpClassifyScanline(3) ccseapps-2.5/CCSEApps/volpack/man/src/Render.30000644000175000017500000001404111634153073022163 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpRenderRawVolume 3 "" VolPack .SH NAME vpRenderRawVolume, vpRenderClassifiedVolume \- render a volume .SH SYNOPSIS #include .sp .FS vpResult \fBvpRenderRawVolume(\fIvpc\fB)\fR .FA vpContext *\fIvpc;\fR .FE .sp .FS vpResult \fBvpRenderClassifiedVolume(\fIvpc\fB)\fR .FA vpContext *\fIvpc;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .SH DESCRIPTION These routines are used to render a volume using the parameters in a rendering context. \fBvpRenderRawVolume\fR renders the data in the current voxel array and stores the result in the current image array. If an octree is present in the context (see vpCreateMinMaxOctree(3)) then it is used to accelerate rendering. \fBvpRenderClassifiedVolume\fR is identical in function except that it renders the current preclassified volume (see vpClassifyVolume(3)) instead of the voxel array, and the octree is not used. .PP \fBvpRenderClassifiedVolume\fR should be used when the same volume is rendered multiple times with the same opacity transfer function. This rendering mode is the fastest. The opacity transfer function must not change because the voxel opacities must be fixed to compute a preclassified volume. .PP \fBvpRenderRawVolume\fR should be used when the volume data or the opacity transfer function changes in between renderings. If the volume data remains fixed then a min-max octree should be computed to accelerate rendering. Rendering is significantly faster with an octree than without, although it is still slower than rendering with \fBvpRenderClassifiedVolume\fR. .PP Before the rendering routines are called the rendering context must be initialized to set the volume parameters, classification parameters (\fBvpRenderRawVolume\fR only), viewing parameters, shading and lighting parameters, and image array. See VolPack(3) for a list of relevant functions. .PP One important state variable should be adjusted before calling the rendering routines: the maximum opacity threshold. This number specifies a threshold value for the opacity of an image pixel. If the opacity of the pixel reaches the threshold then no more voxels are composited into the pixel. The threshold should be a number slightly less than one (0.95 is a good value); numbers closer to 1.0 result in longer rendering times, but less error. The value of the threshold is changed by calling \fBvpSetd\fR with the VP_MAX_RAY_OPACITY option. The default value is 1.0. .PP There are two additional state variables that can be adjusted to set the size of an internal data structure. During rendering, a work buffer called the intermediate image is used to hold temporary results. The size of this data structure depends on the size of the volume and the current view transformation matrix. Over the course of an animation sequence the intermediate image may have to be enlarged multiple times, resulting in many calls to the memory allocator. Normally the overhead of reallocating the data structure is negligible and can be ignored. However, this overhead can be eliminated by specifying hints for the maximum size of the intermediate image. The data structure will then be allocated once, and will never be reallocated unless an even larger intermediate image is required. To set the size hints, call \fBvpSeti\fR with the VP_INT_WIDTH_HINT and VP_INT_HEIGHT_HINT state variable codes. If the viewing transformation does not include any scaling, then the maximum possible size of each dimension of the intermediate image is twice the size of the largest dimension of the volume. To get a more precise bound, the intermediate image size required for rendering a volume with the current viewing parameters can be found by calling \fBvpGeti\fR with the VP_INTERMEDIATE_WIDTH and VP_INTERMEDIATE_HEIGHT state variable codes. .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_SHADER The shading lookup tables are sized incorrectly, or one of the voxel fields used to index the tables is invalid, or the number of material types is invalid. .IP VPERROR_SINGULAR One of the current view transformation matrices is singular. .IP VPERROR_BAD_VOLUME The volume size has not been set or is invalid, or there is no volume data. .IP VPERROR_BAD_VOXEL The voxel size or the voxel fields have not been specified or have been incorrectly specified. .IP VPERROR_BAD_CLASSIFIER The opacity transfer function tables have invalid sizes or are associated with invalid voxel fields or have been incorrectly specified. (\fBvpRenderRawVolume\fR only) .IP VPERROR_BAD_SHADOW The angle between the shadow light vector and the viewing direction is too large (must be less than 45 degrees). Either change the light direction or disable shadows (see vpSetShadowLookupShader). .SH SEE ALSO VolPack(3), vpCreateContext(3) ccseapps-2.5/CCSEApps/volpack/man/src/SetMatrix.30000644000175000017500000000413511634153073022667 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetMatrix 3 "" VolPack .SH NAME vpSetMatrix \- load a matrix into the current transformation matrix .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetMatrix(\fIvpc, m\fB)\fR .FA vpContext *\fIvpc;\fR .FA vpMatrix4 \fIm;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIm\fR Input matrix. .SH DESCRIPTION \fBvpSetMatrix\fR is used to load a 4-by-4 transformation matrix into the current transformation matrix. Use \fBvpCurrentMatrix\fR to set the current transformation matrix. .SH "STATE VARIABLES" The current transformation matrix parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP_CURRENT_MATRIX. .SH ERRORS The return value is always VP_OK. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpGetMatrix(3) ccseapps-2.5/CCSEApps/volpack/man/src/Debug.30000644000175000017500000000570611634153073022002 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:21 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpSetDebug 3 "" VolPack .SH NAME vpSetDebug \- enable/disable debugging options .SH SYNOPSIS #include .sp .FS vpResult \fBvpSetDebug(\fIvpc, flag, value\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIflag;\fR .FA int \fIvalue;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIflag\fR Constant that specifies the debugging option to be adjusted. .IP \fIvalue\fR New value for the option (boolean: 0 or 1). .SH DESCRIPTION \fBvpSetDebug\fR is used to enable or disable a debugging option in a rendering context. The debugging options cause messages to be printed during execution. These messages are probably useless without a good understanding of the source code. If the \fIvalue\fR option is 0 then the option is disabled; otherwise it is enabled. The following list summarizes all available options: .IP VPDEBUG_VIEW view transform calculations .IP VPDEBUG_RENDER high-level rendering stages .IP VPDEBUG_RBUF intermediate image (render buffer) allocation .IP VPDEBUG_OPCCORRECT opacity correction .IP VPDEBUG_DEPTHCUE depth cueing .IP VPDEBUG_PYRAMID pyramid construction .IP VPDEBUG_OCTREE octree construction .IP VPDEBUG_CLSFYOCTREE octree classification .IP VPDEBUG_OCTREERUNS runs computed from octree .IP VPDEBUG_OCTREETRAVERSE octree traversal .IP VPDEBUG_TRANSPOSE volume transposing .IP VPDEBUG_COMPOSITE compositing .PP The VolPack library must be compiled with the -DDEBUG compiler option for this function to have any effect. .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_OPTION The \fIflag\fR argument is invalid. .SH SEE ALSO VolPack(3), vpCreateContext(3) ccseapps-2.5/CCSEApps/volpack/man/src/ScanNormals.30000644000175000017500000001302711634153073023167 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpScanlineNormals 3 "" VolPack .SH NAME vpScanlineNormals \- compute surface normal vectors and gradient magnitudes for a scanline .SH SYNOPSIS #include .sp .FS vpResult \fBvpScanlineNormals(\fIvpc, length, scalar_data, scalar_minus_y, scalar_plus_y, scalar_minus_z, scalar_plus_z, voxel_data, scalar_field, grad_field, norm_field\fB)\fR .FA vpContext *\fIvpc;\fR .FA int \fIlength;\fR .FA unsigned char *\fIscalar_data;\fR .FA unsigned char *\fIscalar_minus_y,\fR *\fIscalar_plus_y;\fR .FA unsigned char *\fIscalar_minus_z,\fR *\fIscalar_plus_z;\fR .FA void *\fIvoxel_data;\fR .FA int \fIscalar_field;\fR .FA int \fIgrad_field;\fR .FA int \fInorm_field;\fR .FE .SH ARGUMENTS .IP \fIvpc\fR VolPack context from \fBvpCreateContext.\fR .IP \fIlength\fR Size of \fIscalar_data\fR array in bytes. .IP \fIscalar_data\fR 1D array of scalar samples. .IP \fIscalar_minus_y\fR 1D array of scalar samples adjacent to \fIscalar_data\fR in the -Y direction. .IP \fIscalar_plus_y\fR 1D array of scalar samples adjacent to \fIscalar_data\fR in the +Y direction. .IP \fIscalar_minus_z\fR 1D array of scalar samples adjacent to \fIscalar_data\fR in the -Z direction. .IP \fIscalar_plus_z\fR 1D array of scalar samples adjacent to \fIscalar_data\fR in the +Z direction. .IP \fIvoxel_data\fR 1D array of voxels for storing results. .IP \fIscalar_field\fR Voxel field number indicating the field in which to store the scalar samples. .IP \fIgrad_field\fR Voxel field number indicating the field in which to store the gradient magnitudes of the scalar samples. .IP \fInorm_field\fR Voxel field number indicating the field in which to store encoded surface normal vectors. .SH DESCRIPTION \fBvpScanlineNormals\fR is used to precompute values for voxel fields used in classification and shading algorithms. The input is a collection of 5 adjacent 1D arrays of scalar values; a separate routine is provided for processing a full 3D array of voxel data (see vpVolumeNormals(3)). \fBvpScanlineNormals\fR is useful for loading large volumes into memory scanline-by-scanline and precomputing voxel fields incrementally, instead of loading a complete copy of the 3D scalar array in addition to the voxel array. In all other respects this routine is identical in function to \fBvpVolumeNormals\fR. .PP The 1D scalar arrays must be arrays of 8-bit values (other sizes are not currently supported). The \fIlength\fR parameter indicates both the size and the number of elements in each of the scalar arrays. \fBvpScanlineNormals\fR performs the computation described in vpVolumeNormals(3), but only for the single scanline specified by \fIscalar_data\fR. The other four scanline arguments must be the immediately adjacent scanlines and are used to compute the gradient. .PP The results are stored in the \fIvoxel_data\fR array which must have space for the same number of voxels as the length of one scalar scanline. The size of a voxel must be specified with \fBvpSetVoxelSize\fR before calling \fBvpScanlineNormals,\fR but it is not necessary to call \fBvpSetRawVoxels.\fR The arguments \fIscalar_field, grad_field\fR and \fInorm_field\fR specify which voxel fields the computed quantities should be stored into. The field numbers must correspond to appropriately-sized voxel fields previously specified with \fBvpSetVoxelField\fR. Any of these arguments can be the constant VP_SKIP_FIELD, in which case the corresponding quantity is not computed or copied. The voxel fields for the scalar value and the gradient magnitude must be one-byte fields, and the field for the surface normal vector must be a two-byte field. The constants VP_SCALAR_MAX, VP_GRAD_MAX and VP_NORM_MAX give the maximum value that might be stored in each field, respectively. The value stored in the surface normal vector field is actually an encoded surface normal; see vpNormalIndex(3). .SH ERRORS The normal return value is VP_OK. The following error return values are possible: .IP VPERROR_BAD_VALUE One or more of the voxel fields specified is invalid, or the corresponding voxel field has the wrong size. .IP VPERROR_BAD_VOXEL The voxel size or the voxel fields have not been specified or have been incorrectly specified. .SH SEE ALSO VolPack(3), vpCreateContext(3), vpNormalIndex(3), vpVolumeNormals(3), vpSetClassifierTable(3), vpSetLookupShader(3) ccseapps-2.5/CCSEApps/volpack/man/src/Ramp.30000644000175000017500000000604411634153073021647 0ustar amckinstryamckinstry'\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford '\" Junior University. All rights reserved. '\" '\" Permission to use, copy, modify and distribute this software and its '\" documentation for any purpose is hereby granted without fee, provided '\" that the above copyright notice and this permission notice appear in '\" all copies of this software and that you do not sell the software. '\" Commercial licensing is available by contacting the author. '\" '\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, '\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY '\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. '\" '\" Author: '\" Phil Lacroute '\" Computer Systems Laboratory '\" Electrical Engineering Dept. '\" Stanford University '\" '\" $Date: 1999/12/06 17:29:22 $ '\" $Revision: 1.1.1.1 $ '\" '\" Macros '\" .FS -- function start '\" is return type of function '\" name and arguments follow on next line .de FS .PD 0v .PP \\$1 .HP 8 .. '\" .FA -- function arguments '\" one argument declaration follows on next line .de FA .IP " " 4 .. '\" .FE -- function end '\" end of function declaration .de FE .PD .. '\" .DS -- display start .de DS .IP " " 4 .. '\" .DE -- display done .de DE .LP .. .TH vpRamp 3 "" VolPack .SH NAME vpRamp \- initialize an array with a piecewise-linear ramp .SH SYNOPSIS #include .sp .FS vpResult \fBvpRamp(\fIarray, stride, num_points, ramp_x, ramp_y\fB)\fR .FA float *\fIarray;\fR .FA int \fIstride;\fR .FA int \fInum_points;\fR .FA int *\fIramp_x;\fR .FA float *\fIramp_y;\fR .FE .SH ARGUMENTS .IP \fIarray\fR Output array. .IP \fIstride\fR Stride from one array element to the next, in bytes. .IP \fInum_points\fR Number of entries in the input arrays (\fIramp_x\fR and \fIramp_y\fR). .IP \fIramp_x\fR Input array containing indices into \fIarray\fR. .IP \fIramp_y\fR Input array containing values to store into \fIarray\fR. .SH DESCRIPTION \fBvpRamp\fR is a utility routine for initializing linear arrays of floating-point numbers with piecewise-linear ramps. A ramp is defined by a set of (x, y) pairs. The X coordinates are integers that index entries in the \fIarray\fR argument, and the Y coordinates are floating-point values to store into the array. Linearly-interpolated Y values are stored in array elements with indexes in between two of the X values. .PP The values in \fIramp_x\fR most be strictly increasing. The \fIstride\fR argument may be used to skip array elements or to initialize arrays with a non-standard stride. If the output array is a simple linear array of type float then the stride should be sizeof(float). .PP This function is useful for creating lookup tables used for opacity transfer functions (see vpSetClassifierTable(3)) and shading functions (see vpSetLookupShader(3)). .SH ERRORS The normal return value is VP_OK. The following error return value is possible: .IP VPERROR_BAD_VALUE The number of points is less than one or the X values are not strictly increasing. .SH SEE ALSO VolPack(3) ccseapps-2.5/CCSEApps/volpack/vp_renderA.c0000644000175000017500000010154011634153073021550 0ustar amckinstryamckinstry/* * vp_renderA.c * * Shear-warp volume rendering algorithm for affine view transformations. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2002/01/30 23:34:35 $ * $Revision: 1.5 $ */ #include "vp_global.h" /*#define DUMP_SHADOW_VOLUME*/ /*#define DUMP_GRAY_VOLUME*/ #if defined(DUMP_SHADOW_VOLUME) || defined(DUMP_GRAY_VOLUME) #ifdef WIN32 #include #else #include #define O_BINARY 0 #endif #endif extern void VPCompAC00G ANSI_ARGS((vpContext *vpc, int icount, int jcount, int k, double slice_depth_cueing_dbl, GrayIntPixel *intimage, double weightTLdbl, double weightBLdbl, double weightTRdbl, double weightBRdbl, unsigned char *run_lengths, void *voxel_data)); extern void VPCompAR00G ANSI_ARGS((vpContext *vpc, int icount, int jcount, int k, double slice_depth_cueing_dbl, GrayIntPixel *intimage, double weightTLdbl, double weightBLdbl, double weightTRdbl, double weightBRdbl, void *voxel_data, int voxel_istride, int voxel_jstride)); extern void VPWarpA101N ANSI_ARGS((GrayIntPixel *in_image, int in_width, int in_height, int in_bytes_per_scan, unsigned char *out_image, int out_width, int out_height, int out_bytes_per_scan, vpMatrix3 warp_matrix)); extern void VPWarpA110N ANSI_ARGS((GrayIntPixel *in_image, int in_width, int in_height, int in_bytes_per_scan, unsigned char *out_image, int out_width, int out_height, int out_bytes_per_scan, vpMatrix3 warp_matrix)); extern void VPWarpA111N ANSI_ARGS((GrayIntPixel *in_image, int in_width, int in_height, int in_bytes_per_scan, unsigned char *out_image, int out_width, int out_height, int out_bytes_per_scan, vpMatrix3 warp_matrix)); extern void VPWarpA301N ANSI_ARGS((RGBIntPixel *in_image, int in_width, int in_height, int in_bytes_per_scan, unsigned char *out_image, int out_width, int out_height, int out_bytes_per_scan, vpMatrix3 warp_matrix)); extern void VPWarpA330N ANSI_ARGS((RGBIntPixel *in_image, int in_width, int in_height, int in_bytes_per_scan, unsigned char *out_image, int out_width, int out_height, int out_bytes_per_scan, vpMatrix3 warp_matrix)); extern void VPWarpA331N ANSI_ARGS((RGBIntPixel *in_image, int in_width, int in_height, int in_bytes_per_scan, unsigned char *out_image, int out_width, int out_height, int out_bytes_per_scan, vpMatrix3 warp_matrix)); extern void VPWarpA330R ANSI_ARGS((RGBIntPixel *in_image, int in_width, int in_height, int in_bytes_per_scan, unsigned char *out_image, int out_width, int out_height, int out_bytes_per_scan, vpMatrix3 warp_matrix)); extern void VPWarpA331R ANSI_ARGS((RGBIntPixel *in_image, int in_width, int in_height, int in_bytes_per_scan, unsigned char *out_image, int out_width, int out_height, int out_bytes_per_scan, vpMatrix3 warp_matrix)); #ifdef STATISTICS extern int vpResampleCount; extern int vpCompositeCount; extern int vpERTSkipCount; extern int vpERTSkipAgainCount; extern int vpERTUpdateCount; extern int vpSpecialZeroSkipCount; extern int vpRunFragmentCount; #endif /* * VPRenderAffine * * Render a classified volume with an affine viewing transformation. */ void VPRenderAffine(vpc, algorithm, composite_func) vpContext *vpc; int algorithm; /* USE_RLEVOLUME or USE_RAWVOLUME */ void (*composite_func)(vpContext*, ...); /* function to do the compositing */ { int icount; /* voxels per voxel scanline */ int jcount; /* voxel scanlines per voxel slice */ int kcount; /* voxel slices in the volume */ int istride; /* strides for each dimension of raw volume */ int jstride; int kstride; int k; /* voxel slice index */ int kstart, kstop; /* values of k for first and last slices */ int kincr; /* value to add to k to get to the next slice (either 1 or -1) */ RLEVoxels *rle_voxels; /* run-length encoded volume */ float slice_u, slice_v; /* sheared object space coordinates of the top-left corner of the current constant-k slice of the volume data */ int slice_u_int; /* integer part of slice_u and slice_v */ int slice_v_int; float slice_u_frac; /* fractional part of slice_u and slice_v */ float slice_v_frac; int slice_start_index; /* index of top-left int. image pixel */ float WgtTL, WgtBL, /* weights in the range 0..1 which give the */ WgtTR, WgtBR; /* fractional contribution of the */ /* neighboring voxels to the current */ /* intermediate image pixel */ int color_channels; /* number of color channels to compute */ float slice_depth_cueing; /* depth cueing factor for current slice */ float slice_dc_ratio; /* multiplier to get depth cueing factor for the next slice */ unsigned char *run_lengths; /* run lengths for slice */ void *voxel_data; /* voxel data for slice */ void *intimage; /* first intermediate image pixel for slice */ int scan_offset_index; /* index into scan_offsets for this slice */ float shadow_slice_u; /* top-left corner of voxel slice in shadow */ float shadow_slice_v; /* buffer coordinates */ int shadow_slice_u_int; /* integer part of shadow_slice_u/v */ int shadow_slice_v_int; int shadow_slice_start_index;/* index of top-left shadow buffer pixel */ GrayIntPixel *shadow_image; /* first shadow buffer pixel for slice */ int shadow_k; /* voxel slice number plus shadow bias */ #ifdef DUMP_SHADOW_VOLUME unsigned char *shadow_dump; #endif #ifdef DUMP_GRAY_VOLUME unsigned char *gray_dump; #endif #ifdef DUMP_SHADOW_VOLUME int dump_fd; int dump_value; #else #ifdef DUMP_GRAY_VOLUME int dump_fd; int dump_value; #endif #endif #ifdef DEBUG GrayIntPixel *trace_gray_ptr = &vpc->int_image.gray_intim[vpc->trace_u + vpc->trace_v*vpc->intermediate_width]; RGBIntPixel *trace_rgb_ptr = &vpc->int_image.rgb_intim[vpc->trace_u + vpc->trace_v*vpc->intermediate_width]; float vox_depth; #endif DECLARE_TIME(t0); DECLARE_TIME(t1); DECLARE_TIME(tA); DECLARE_TIME(tB); #ifdef STATISTICS vpResampleCount = 0; vpCompositeCount = 0; vpERTSkipCount = 0; vpERTSkipAgainCount = 0; vpERTUpdateCount = 0; vpSpecialZeroSkipCount = 0; vpRunFragmentCount = 0; #endif GET_TIME(vpc, tA); /* initialize for the fast classification algorithm */ if (algorithm == USE_RAWVOLUME && vpc->mm_octree != NULL) { ASSERT(vpc->raw_voxels != NULL); GET_TIME(vpc, t0); VPComputeSummedAreaTable(vpc); VPClassifyOctree(vpc); GET_TIME(vpc, t1); STORE_TIME(vpc, VPTIMER_CLSFY_OCTREE, t0, t1); } /* find size of volume */ if (algorithm == USE_RLEVOLUME) { switch (vpc->best_view_axis) { case VP_X_AXIS: rle_voxels = vpc->rle_x; break; case VP_Y_AXIS: rle_voxels = vpc->rle_y; break; case VP_Z_AXIS: rle_voxels = vpc->rle_z; break; default: VPBug("invalid viewing axis in AffineRender"); } icount = rle_voxels->ilen; jcount = rle_voxels->jlen; kcount = rle_voxels->klen; } else { switch (vpc->best_view_axis) { case VP_X_AXIS: icount = vpc->ylen; jcount = vpc->zlen; kcount = vpc->xlen; istride = vpc->ystride; jstride = vpc->zstride; kstride = vpc->xstride; break; case VP_Y_AXIS: icount = vpc->zlen; jcount = vpc->xlen; kcount = vpc->ylen; istride = vpc->zstride; jstride = vpc->xstride; kstride = vpc->ystride; break; case VP_Z_AXIS: icount = vpc->xlen; jcount = vpc->ylen; kcount = vpc->zlen; istride = vpc->xstride; jstride = vpc->ystride; kstride = vpc->zstride; break; default: VPBug("invalid viewing axis in AffineRender"); } } GET_TIME(vpc, t0); /* initialize intermediate image */ color_channels = vpc->color_channels; vpc->pad_int_to_maxwidth = 0; if (color_channels == 1) { bzero(vpc->int_image.gray_intim, vpc->intermediate_width * vpc->intermediate_height * sizeof(GrayIntPixel)); } else { ASSERT(color_channels == 3); bzero(vpc->int_image.rgb_intim, vpc->intermediate_width * vpc->intermediate_height * sizeof(RGBIntPixel)); } /* initialize shadow buffer */ if (vpc->enable_shadows) { vpc->pad_shadow_to_maxwidth = 0; bzero(vpc->shadow_buffer, vpc->shadow_width * vpc->shadow_height * sizeof(GrayIntPixel)); } #ifdef DUMP_SHADOW_VOLUME Alloc(vpc, shadow_dump, char *, vpc->shadow_width * vpc->shadow_height * kcount, "shadow_dump"); #endif #ifdef DUMP_GRAY_VOLUME Alloc(vpc, gray_dump, char *, vpc->intermediate_width * vpc->intermediate_height * kcount, "gray_dump"); #endif GET_TIME(vpc, t1); STORE_TIME(vpc, VPTIMER_CLEAR, t0, t1); /* initialize depth cueing */ slice_dc_ratio = VPSliceDepthCueRatio(vpc); slice_depth_cueing = 1.; #ifdef DEBUG Debug((vpc, VPDEBUG_DEPTHCUE, "depth cueing at cube corners:\n")); vox_depth = vpc->depth_000 + 0*vpc->depth_di + 0*vpc->depth_dj + 0*vpc->depth_dk; if (vox_depth < 0.0) vox_depth = 0.0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d %3d: depth = %12.6f, factor = %12.6f\n", 0, 0, 0, vox_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - vox_depth)))); vox_depth = vpc->depth_000 + icount*vpc->depth_di + 0*vpc->depth_dj + 0*vpc->depth_dk; if (vox_depth < 0.0) vox_depth = 0.0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d %3d: depth = %12.6f, factor = %12.6f\n", icount, 0, 0, vox_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - vox_depth)))); vox_depth = vpc->depth_000 + icount*vpc->depth_di + jcount*vpc->depth_dj + 0*vpc->depth_dk; if (vox_depth < 0.0) vox_depth = 0.0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d %3d: depth = %12.6f, factor = %12.6f\n", icount, jcount, 0, vox_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - vox_depth)))); vox_depth = vpc->depth_000 + 0*vpc->depth_di + jcount*vpc->depth_dj + 0*vpc->depth_dk; if (vox_depth < 0.0) vox_depth = 0.0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d %3d: depth = %12.6f, factor = %12.6f\n", 0, jcount, 0, vox_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - vox_depth)))); vox_depth = vpc->depth_000 + 0*vpc->depth_di + 0*vpc->depth_dj + kcount*vpc->depth_dk; if (vox_depth < 0.0) vox_depth = 0.0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d %3d: depth = %12.6f, factor = %12.6f\n", 0, 0, kcount, vox_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - vox_depth)))); vox_depth = vpc->depth_000 + icount*vpc->depth_di + 0*vpc->depth_dj + kcount*vpc->depth_dk; if (vox_depth < 0.0) vox_depth = 0.0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d %3d: depth = %12.6f, factor = %12.6f\n", icount, 0, kcount, vox_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - vox_depth)))); vox_depth = vpc->depth_000 + icount*vpc->depth_di + jcount*vpc->depth_dj + kcount*vpc->depth_dk; if (vox_depth < 0.0) vox_depth = 0.0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d %3d: depth = %12.6f, factor = %12.6f\n", icount, jcount, kcount, vox_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - vox_depth)))); vox_depth = vpc->depth_000 + 0*vpc->depth_di + jcount*vpc->depth_dj + kcount*vpc->depth_dk; if (vox_depth < 0.0) vox_depth = 0.0; Debug((vpc, VPDEBUG_DEPTHCUE, " %3d %3d %3d: depth = %12.6f, factor = %12.6f\n", 0, jcount, kcount, vox_depth, vpc->dc_front_factor * exp(-vpc->dc_density * (1.0 - vox_depth)))); #endif /* DEBUG */ #ifdef DEBUG /* initialize pixel tracing */ if (vpc->trace_u != -1) { if (vpc->trace_u < 0 || vpc->trace_v < 0 || vpc->trace_u >= vpc->intermediate_width || vpc->trace_v >= vpc->intermediate_height) { printf("Traced pixel is out of bounds.\n"); } else { printf("Trace for pixel u=%d, v=%d", vpc->trace_u, vpc->trace_v); if (vpc->enable_shadows) printf(", shadow_k=%d", vpc->trace_shadow_k); printf(" (View %c, slice size %d,%d)\n", vpc->best_view_axis + 'X', icount, jcount); printf("Slice Slice TopLft BotLft "); printf("TopRgt BotRgt Compos.\n"); printf(" BRX/BRY Opc/Clr/Wgt Opc/Clr/Wgt Opc/Clr/Wgt "); printf("Opc/Clr/Wgt Opc/Clr\n"); } } #endif /* compute outer loop bounds */ if (vpc->reverse_slice_order) { kstart = kcount-1; kstop = -1; kincr = -1; } else { kstart = 0; kincr = 1; kstop = kcount; } shadow_k = kstart - vpc->shadow_bias * kincr; /* loop over slices of the voxel data in front-to-back order */ for (k = kstart; k != kstop; k += kincr) { ReportStatus(vpc, (double)(k - kstart)/(double)(kstop - kstart)); /* update shadow buffer */ if (vpc->enable_shadows && shadow_k >= 0 && shadow_k < kcount) { /* compute coordinates of slice in shadow buffer; shadow bias determines which slice (usually a few slices old in order to eliminate self-shadowing) */ shadow_slice_u = vpc->shadow_shear_i * shadow_k + vpc->shadow_trans_i; shadow_slice_v = vpc->shadow_shear_j * shadow_k + vpc->shadow_trans_j; shadow_slice_u_int = (int)ceil(shadow_slice_u) - 1; shadow_slice_v_int = (int)ceil(shadow_slice_v) - 1; shadow_slice_start_index = shadow_slice_u_int + shadow_slice_v_int*vpc->shadow_width; shadow_image = &vpc->shadow_buffer[shadow_slice_start_index]; /* compute resampling weights for voxel slice in shadow buffer */ slice_u_frac = shadow_slice_u - shadow_slice_u_int; slice_v_frac = shadow_slice_v - shadow_slice_v_int; WgtTL = slice_u_frac * slice_v_frac; WgtBL = slice_u_frac * ((float)1. - slice_v_frac); WgtTR = ((float)1. - slice_u_frac) * slice_v_frac; WgtBR = ((float)1. - slice_u_frac) * ((float)1. - slice_v_frac); /* composite voxel opacities into shadow buffer */ if (algorithm == USE_RLEVOLUME) { scan_offset_index = shadow_k * rle_voxels->scan_offsets_per_slice; run_lengths = rle_voxels->run_lengths + rle_voxels->scan_offsets[scan_offset_index].first_len; voxel_data = (void *)((char *)rle_voxels->data + rle_voxels->scan_offsets[scan_offset_index].first_data); VPCompAC00G(vpc, icount, jcount, shadow_k, slice_depth_cueing, shadow_image, WgtTL, WgtBL, WgtTR, WgtBR, run_lengths, voxel_data); } else { voxel_data = (void *)((char *)vpc->raw_voxels + shadow_k*kstride); VPCompAR00G(vpc, icount, jcount, shadow_k, slice_depth_cueing, shadow_image, WgtTL, WgtBL, WgtTR, WgtBR, voxel_data, istride, jstride); } } shadow_k += kincr; /* compute coordinates of top-left corner of voxel slice in intermediate image */ slice_u = vpc->shear_i * k + vpc->trans_i; slice_v = vpc->shear_j * k + vpc->trans_j; slice_u_int = (int)ceil(slice_u) - 1; slice_v_int = (int)ceil(slice_v) - 1; slice_start_index = slice_u_int + slice_v_int*vpc->intermediate_width; if (color_channels == 1) intimage = &vpc->int_image.gray_intim[slice_start_index]; else intimage = &vpc->int_image.rgb_intim[slice_start_index]; /* compute resampling weights for this slice */ slice_u_frac = slice_u - slice_u_int; slice_v_frac = slice_v - slice_v_int; WgtTL = slice_u_frac * slice_v_frac; WgtBL = slice_u_frac * ((float)1. - slice_v_frac); WgtTR = ((float)1. - slice_u_frac) * slice_v_frac; WgtBR = ((float)1. - slice_u_frac) * ((float)1. - slice_v_frac); /* compute coordinates of voxel slice in shadow buffer */ if (vpc->enable_shadows) { shadow_slice_u = vpc->shadow_shear_i * k + vpc->shadow_trans_i; shadow_slice_v = vpc->shadow_shear_j * k + vpc->shadow_trans_j; shadow_slice_u_int = (int)ceil(shadow_slice_u) - 1; shadow_slice_v_int = (int)ceil(shadow_slice_v) - 1; shadow_slice_start_index = shadow_slice_u_int + shadow_slice_v_int*vpc->shadow_width; shadow_image = &vpc->shadow_buffer[shadow_slice_start_index]; } /* find voxel data for this slice and composite */ if (algorithm == USE_RLEVOLUME) { scan_offset_index = k * rle_voxels->scan_offsets_per_slice; run_lengths = rle_voxels->run_lengths + rle_voxels->scan_offsets[scan_offset_index].first_len; voxel_data = (void *)((char *)rle_voxels->data + rle_voxels->scan_offsets[scan_offset_index].first_data); #ifdef INDEX_VOLUME composite_func(vpc, icount, jcount, k, slice_depth_cueing, intimage, WgtTL, WgtBL, WgtTR, WgtBR, run_lengths, voxel_data, rle_voxels->voxel_index + k * icount * jcount, shadow_image); #else composite_func(vpc, icount, jcount, k, slice_depth_cueing, intimage, WgtTL, WgtBL, WgtTR, WgtBR, run_lengths, voxel_data, shadow_image); #endif } else { voxel_data = (void *)((char *)vpc->raw_voxels + k*kstride); composite_func(vpc, icount, jcount, k, slice_depth_cueing, intimage, WgtTL, WgtBL, WgtTR, WgtBR, voxel_data, istride, jstride, shadow_image); } /* update depth cueing factor */ slice_depth_cueing *= slice_dc_ratio; #ifdef DUMP_SHADOW_VOLUME vpGetImage(vpc, shadow_dump + k * vpc->shadow_width * vpc->shadow_height, vpc->shadow_width, vpc->shadow_height, vpc->shadow_width, VP_ALPHA, VP_SHADOW_BUFFER); #endif #ifdef DUMP_GRAY_VOLUME vpGetImage(vpc, gray_dump + k * vpc->intermediate_width * vpc->intermediate_height, vpc->intermediate_width, vpc->intermediate_height, VP_LUMINANCE, VP_IMAGE_BUFFER); #endif } ReportStatus(vpc, 1.0); GET_TIME(vpc, t1); STORE_TIME(vpc, VPTIMER_COMPOSITE, t0, t1); #ifdef DEBUG /* print traced pixel before depth cueing */ if (vpc->trace_u != -1) { if (vpc->trace_u >= 0 && vpc->trace_v >= 0 && vpc->trace_u < vpc->intermediate_width && vpc->trace_v < vpc->intermediate_height) { if (color_channels == 1) { printf("Before depth cueing: opc = %.9f = %d", trace_gray_ptr->opcflt*255., (int)(trace_gray_ptr->opcflt*255.)); printf(" clr = %.9f = %d\n", trace_gray_ptr->clrflt, (int)trace_gray_ptr->clrflt); } else { printf("Before depth cueing: opc = %14.9f = %3d", trace_rgb_ptr->opcflt*255., (int)(trace_rgb_ptr->opcflt*255.)); printf(" r = %14.9f = %d\n", trace_rgb_ptr->rclrflt, (int)trace_rgb_ptr->rclrflt); printf(" "); printf(" g = %14.9f = %d\n", trace_rgb_ptr->gclrflt, (int)trace_rgb_ptr->gclrflt); printf(" "); printf(" b = %14.9f = %d\n", trace_rgb_ptr->bclrflt, (int)trace_rgb_ptr->bclrflt); } } } #endif /* depth cue the intermediate image */ if (vpc->dc_enable) { GET_TIME(vpc, t0); VPDepthCueIntImage(vpc, vpc->reverse_slice_order ? kcount-1 : 0); GET_TIME(vpc, t1); STORE_TIME(vpc, VPTIMER_DEPTHCUE, t0, t1); } #ifdef DEBUG /* print final value of traced pixel */ if (vpc->trace_u != -1) { if (vpc->trace_u >= 0 && vpc->trace_v >= 0 && vpc->trace_u < vpc->intermediate_width && vpc->trace_v < vpc->intermediate_height) { if (color_channels == 1) { printf("Final pixel value: opc = %.9f = %d", trace_gray_ptr->opcflt*255., (int)(trace_gray_ptr->opcflt*255.)); printf(" clr = %.9f = %d\n", trace_gray_ptr->clrflt, (int)trace_gray_ptr->clrflt); } else { printf("Final pixel value: opc = %14.9f = %3d", trace_rgb_ptr->opcflt*255., (int)(trace_rgb_ptr->opcflt*255.)); printf(" r = %14.9f = %d\n", trace_rgb_ptr->rclrflt, (int)trace_rgb_ptr->rclrflt); printf(" "); printf(" g = %14.9f = %d\n", trace_rgb_ptr->gclrflt, (int)trace_rgb_ptr->gclrflt); printf(" "); printf(" b = %14.9f = %d\n", trace_rgb_ptr->bclrflt, (int)trace_rgb_ptr->bclrflt); } } } #endif /* warp the intermediate image into the final image */ GET_TIME(vpc, t0); switch (vpc->pixel_type) { case VP_ALPHA: if (color_channels == 1) { VPWarpA101N(vpc->int_image.gray_intim, vpc->intermediate_width, vpc->intermediate_height, sizeof(GrayIntPixel) * (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width:vpc->intermediate_width), (unsigned char*)vpc->image, vpc->image_width, vpc->image_height, vpc->image_bytes_per_scan, vpc->warp_2d); } else { VPWarpA301N(vpc->int_image.rgb_intim, vpc->intermediate_width, vpc->intermediate_height, sizeof(RGBIntPixel) * (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width:vpc->intermediate_width), (unsigned char*)vpc->image, vpc->image_width, vpc->image_height, vpc->image_bytes_per_scan, vpc->warp_2d); } break; case VP_LUMINANCE: ASSERT(color_channels == 1); VPWarpA110N(vpc->int_image.gray_intim, vpc->intermediate_width, vpc->intermediate_height, sizeof(GrayIntPixel) * (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width:vpc->intermediate_width), (unsigned char*)vpc->image, vpc->image_width, vpc->image_height, vpc->image_bytes_per_scan, vpc->warp_2d); break; case VP_LUMINANCEA: ASSERT(color_channels == 1); VPWarpA111N(vpc->int_image.gray_intim, vpc->intermediate_width, vpc->intermediate_height, sizeof(GrayIntPixel) * (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width:vpc->intermediate_width), (unsigned char*)vpc->image, vpc->image_width, vpc->image_height, vpc->image_bytes_per_scan, vpc->warp_2d); break; case VP_RGB: ASSERT(color_channels == 3); VPWarpA330N(vpc->int_image.rgb_intim, vpc->intermediate_width, vpc->intermediate_height, sizeof(RGBIntPixel) * (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width:vpc->intermediate_width), (unsigned char*)vpc->image, vpc->image_width, vpc->image_height, vpc->image_bytes_per_scan, vpc->warp_2d); break; case VP_RGBA: ASSERT(color_channels == 3); VPWarpA331N(vpc->int_image.rgb_intim, vpc->intermediate_width, vpc->intermediate_height, sizeof(RGBIntPixel) * (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width:vpc->intermediate_width), (unsigned char*)vpc->image, vpc->image_width, vpc->image_height, vpc->image_bytes_per_scan, vpc->warp_2d); break; case VP_BGR: ASSERT(color_channels == 3); VPWarpA330R(vpc->int_image.rgb_intim, vpc->intermediate_width, vpc->intermediate_height, sizeof(RGBIntPixel) * (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width:vpc->intermediate_width), (unsigned char*)vpc->image, vpc->image_width, vpc->image_height, vpc->image_bytes_per_scan, vpc->warp_2d); break; case VP_ABGR: ASSERT(color_channels == 3); VPWarpA331R(vpc->int_image.rgb_intim, vpc->intermediate_width, vpc->intermediate_height, sizeof(RGBIntPixel) * (vpc->pad_int_to_maxwidth ? vpc->max_intermediate_width:vpc->intermediate_width), (unsigned char*)vpc->image, vpc->image_width, vpc->image_height, vpc->image_bytes_per_scan, vpc->warp_2d); break; default: VPBug("bad pixel type"); } GET_TIME(vpc, t1); STORE_TIME(vpc, VPTIMER_WARP, t0, t1); GET_TIME(vpc, tB); STORE_TIME(vpc, VPTIMER_RENDER, tA, tB); #ifdef DUMP_SHADOW_VOLUME printf("Dumping shadow map images to shadow.dump...."); fflush(stdout); if ((dump_fd = open("shadow.dump", O_BINARY|O_CREAT|O_TRUNC|O_WRONLY, 0644)) < 0) VPBug("open failed"); dump_value = vpc->shadow_width; write(dump_fd, &dump_value, sizeof(int)); dump_value = vpc->shadow_height; write(dump_fd, &dump_value, sizeof(int)); dump_value = kcount; write(dump_fd, &dump_value, sizeof(int)); write(dump_fd, shadow_dump, vpc->shadow_width * vpc->shadow_height * kcount); close(dump_fd); printf("\n"); Dealloc(vpc, shadow_dump); #endif #ifdef DUMP_GRAY_VOLUME printf("Dumping grayscale intermediate images to gray.dump...."); fflush(stdout); if ((dump_fd = open("gray.dump", O_BINARY|O_CREAT|O_TRUNC|O_WRONLY, 0644)) < 0) VPBug("open failed"); dump_value = vpc->intermediate_width; write(dump_fd, &dump_value, sizeof(int)); dump_value = vpc->intermediate_height; write(dump_fd, &dump_value, sizeof(int)); dump_value = kcount; write(dump_fd, &dump_value, sizeof(int)); write(dump_fd, gray_dump, vpc->intermediate_width * vpc->intermediate_height * kcount); close(dump_fd); printf("\n"); Dealloc(vpc, gray_dump); #endif } #ifdef DEBUG /* * vpPrintRayPath * * Print a trace of the voxels that contribute to the pixel specified * with vpTracePixel. */ vpResult vpPrintRayPath(vpc) vpContext *vpc; { int icount; /* voxels per voxel scanline */ int jcount; /* voxel scanlines per voxel slice */ int kcount; /* voxel slices in the volume */ int k; /* voxel slice index */ int kstart, kstop; /* values of k for first and last slices */ int kincr; /* value to add to k to get to the next slice (either 1 or -1) */ float slice_u, slice_v; /* sheared object space coordinates of the top-left corner of the current constant-k slice of the volume data */ int slice_u_int; /* integer part of slice_u and slice_v */ int slice_v_int; float slice_u_frac; /* fractional part of slice_u and slice_v */ float slice_v_frac; float WgtTL, WgtBL, /* weights in the range 0..1 which give the */ WgtTR, WgtBR; /* fractional contribution of the */ /* neighboring voxels to the current */ /* intermediate image pixel */ int i, j; /* voxel coordinates in current slice of the voxel to the BR of the ray */ int shadow_trace_u; /* coords. of shadow buffer pixel to trace */ int shadow_trace_v; int retcode; /* check for errors and initialize */ if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); if (vpc->trace_u < 0 || vpc->trace_v < 0 || vpc->trace_u >= vpc->intermediate_width || vpc->trace_v >= vpc->intermediate_height) { printf("Traced pixel is out of bounds.\n"); return(VP_OK); } /* find size of volume */ switch (vpc->best_view_axis) { case VP_X_AXIS: icount = vpc->ylen; jcount = vpc->zlen; kcount = vpc->xlen; break; case VP_Y_AXIS: icount = vpc->zlen; jcount = vpc->xlen; kcount = vpc->ylen; break; case VP_Z_AXIS: icount = vpc->xlen; jcount = vpc->ylen; kcount = vpc->zlen; break; default: VPBug("invalid viewing axis in vpPrintRayPath"); } /* print column headings */ printf("Ray path for pixel u=%d, v=%d", vpc->trace_u, vpc->trace_v); if (vpc->enable_shadows) printf(", shadow_k=%d", vpc->trace_shadow_k); printf(" (View %c, slice size %d,%d)\n", vpc->best_view_axis + 'X', icount, jcount); printf("Slice TopLft BotLft TopRgt"); printf(" BotRgt\n"); printf(" _X_/_Y_/_Z_/Wgt _X_/_Y_/_Z_/Wgt _X_/_Y_/_Z_/Wgt"); printf(" _X_/_Y_/_Z_/Wgt\n"); /* compute outer loop bounds */ if (vpc->reverse_slice_order) { kstart = kcount-1; kstop = -1; kincr = -1; } else { kstart = 0; kincr = 1; kstop = kcount; } /* loop over slices of the voxel data in front-to-back order */ for (k = kstart; k != kstop; k += kincr) { /* compute coordinates of top-left corner of voxel slice in intermediate image */ slice_u = vpc->shear_i * k + vpc->trans_i; slice_v = vpc->shear_j * k + vpc->trans_j; slice_u_int = (int)ceil(slice_u) - 1; slice_v_int = (int)ceil(slice_v) - 1; /* compute resampling weights for this slice */ slice_u_frac = slice_u - slice_u_int; slice_v_frac = slice_v - slice_v_int; WgtTL = slice_u_frac * slice_v_frac; WgtBL = slice_u_frac * ((float)1. - slice_v_frac); WgtTR = ((float)1. - slice_u_frac) * slice_v_frac; WgtBR = ((float)1. - slice_u_frac) * ((float)1. - slice_v_frac); /* compute intersection of the ray with this slice */ i = vpc->trace_u - slice_u_int; j = vpc->trace_v - slice_v_int; /* print ray location at this slice */ printf("[%3d]", k); switch (vpc->best_view_axis) { case VP_X_AXIS: printf("%4d%4d%4d %3d ", k, i-1, j-1, (int)(WgtTL*100.)); printf("%4d%4d%4d %3d ", k, i-1, j, (int)(WgtBL*100.)); printf("%4d%4d%4d %3d ", k, i, j-1, (int)(WgtTR*100.)); printf("%4d%4d%4d %3d\n", k, i, j, (int)(WgtBR*100.)); break; case VP_Y_AXIS: printf("%4d%4d%4d %3d ", j-1, k, i-1, (int)(WgtTL*100.)); printf("%4d%4d%4d %3d ", j, k, i-1, (int)(WgtBL*100.)); printf("%4d%4d%4d %3d ", j-1, k, i, (int)(WgtTR*100.)); printf("%4d%4d%4d %3d\n", j, k, i, (int)(WgtBR*100.)); break; case VP_Z_AXIS: printf("%4d%4d%4d %3d ", i-1, j-1, k, (int)(WgtTL*100.)); printf("%4d%4d%4d %3d ", i-1, j, k, (int)(WgtBL*100.)); printf("%4d%4d%4d %3d ", i, j-1, k, (int)(WgtTR*100.)); printf("%4d%4d%4d %3d\n", i, j, k, (int)(WgtBR*100.)); break; } } /* for k */ if (!vpc->enable_shadows) return(VP_OK); /* compute coordinates of shadow buffer pixel to trace */ shadow_trace_u = vpc->trace_u + (int)ceil(vpc->shadow_shear_i*vpc->trace_shadow_k+vpc->shadow_trans_i)- (int)ceil(vpc->shear_i * vpc->trace_shadow_k + vpc->trans_i); shadow_trace_v = vpc->trace_v + (int)ceil(vpc->shadow_shear_j*vpc->trace_shadow_k+vpc->shadow_trans_j)- (int)ceil(vpc->shear_j * vpc->trace_shadow_k + vpc->trans_j); /* print column headings for shadow trace */ printf("\nShadow Ray Path (intersecting traced pixel at k=%d):\n", vpc->trace_shadow_k); printf("Slice TopLft BotLft TopRgt"); printf(" BotRgt\n"); printf(" _X_/_Y_/_Z_/Wgt _X_/_Y_/_Z_/Wgt _X_/_Y_/_Z_/Wgt"); printf(" _X_/_Y_/_Z_/Wgt\n"); /* loop over slices of the voxel data in front-to-back order */ for (k = kstart; k != kstop; k += kincr) { /* compute coordinates of top-left corner of voxel slice in intermediate image */ slice_u = vpc->shadow_shear_i * k + vpc->shadow_trans_i; slice_v = vpc->shadow_shear_j * k + vpc->shadow_trans_j; slice_u_int = (int)ceil(slice_u) - 1; slice_v_int = (int)ceil(slice_v) - 1; /* compute resampling weights for this slice */ slice_u_frac = slice_u - slice_u_int; slice_v_frac = slice_v - slice_v_int; WgtTL = slice_u_frac * slice_v_frac; WgtBL = slice_u_frac * ((float)1. - slice_v_frac); WgtTR = ((float)1. - slice_u_frac) * slice_v_frac; WgtBR = ((float)1. - slice_u_frac) * ((float)1. - slice_v_frac); /* compute intersection of the ray with this slice */ i = shadow_trace_u - slice_u_int; j = shadow_trace_v - slice_v_int; /* print ray location at this slice */ printf("[%3d]", k); switch (vpc->best_view_axis) { case VP_X_AXIS: printf("%4d%4d%4d %3d ", k, i-1, j-1, (int)(WgtTL*100.)); printf("%4d%4d%4d %3d ", k, i-1, j, (int)(WgtBL*100.)); printf("%4d%4d%4d %3d ", k, i, j-1, (int)(WgtTR*100.)); printf("%4d%4d%4d %3d\n", k, i, j, (int)(WgtBR*100.)); break; case VP_Y_AXIS: printf("%4d%4d%4d %3d ", j-1, k, i-1, (int)(WgtTL*100.)); printf("%4d%4d%4d %3d ", j, k, i-1, (int)(WgtBL*100.)); printf("%4d%4d%4d %3d ", j-1, k, i, (int)(WgtTR*100.)); printf("%4d%4d%4d %3d\n", j, k, i, (int)(WgtBR*100.)); break; case VP_Z_AXIS: printf("%4d%4d%4d %3d ", i-1, j-1, k, (int)(WgtTL*100.)); printf("%4d%4d%4d %3d ", i-1, j, k, (int)(WgtBL*100.)); printf("%4d%4d%4d %3d ", i, j-1, k, (int)(WgtTR*100.)); printf("%4d%4d%4d %3d\n", i, j, k, (int)(WgtBR*100.)); break; } } /* for k */ return(VP_OK); } #endif /* DEBUG */ ccseapps-2.5/CCSEApps/volpack/vp_renderR.c0000644000175000017500000002460211634153073021574 0ustar amckinstryamckinstry/* * vp_renderR.c * * Function to render raw (unclassified) volumes. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:04 $ * $Revision: 1.3 $ */ #include "vp_global.h" #define COMP_AR1PB_FUNC VPCompAR1PB extern void VPCompAR1PB( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ GrayIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, void *voxel_data, /* voxel data for slice */ int voxel_istride, /* strides for voxel data */ int voxel_jstride ); #define COMP_AR3PB_FUNC VPCompAR3PB extern void VPCompAR3PB( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ RGBIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, void *voxel_data, /* voxel data for slice */ int voxel_istride, /* strides for voxel data */ int voxel_jstride ); #ifdef COMP_AR11B #define COMP_AR11B_FUNC VPCompAR11B extern void VPCompAR11B( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ GrayIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, void *voxel_data, /* voxel data for slice */ int voxel_istride, /* strides for voxel data */ int voxel_jstride ); #else #define COMP_AR11B_FUNC VPCompAR1NB #endif #ifdef COMP_AR31B #define COMP_AR31B_FUNC VPCompAR31B extern void VPCompAR31B( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ RGBIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, void *voxel_data, /* voxel data for slice */ int voxel_istride, /* strides for voxel data */ int voxel_jstride ); #else #define COMP_AR31B_FUNC VPCompAR3NB #endif #ifdef COMP_AR12B #define COMP_AR12B_FUNC VPCompAR12B extern void VPCompAR12B(); #else #define COMP_AR12B_FUNC VPCompAR1NB #endif #ifdef COMP_AR32B #define COMP_AR32B_FUNC VPCompAR32B extern void VPCompAR32B( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ RGBIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, void *voxel_data, /* voxel data for slice */ int voxel_istride, /* strides for voxel data */ int voxel_jstride ); #else #define COMP_AR32B_FUNC VPCompAR3NB #endif #define COMP_AR1NB_FUNC VPCompAR1NB extern void VPCompAR1NB( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ GrayIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, void *voxel_data, /* voxel data for slice */ int voxel_istride, /* strides for voxel data */ int voxel_jstride ); #define COMP_AR3NB_FUNC VPCompAR3NB extern void VPCompAR3NB( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ RGBIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, void *voxel_data, /* voxel data for slice */ int voxel_istride, /* strides for voxel data */ int voxel_jstride ); #define COMP_AR1PS_FUNC VPCompAR1PB #define COMP_AR3PS_FUNC VPCompAR3PB #ifdef COMP_AR11S #define COMP_AR11S_FUNC VPCompAR11S extern void VPCompAR11S(); #else #define COMP_AR11S_FUNC VPCompAR1NS #endif #ifdef COMP_AR31S #define COMP_AR31S_FUNC VPCompAR31S extern void VPCompAR31S(); #else #define COMP_AR31S_FUNC VPCompAR3NS #endif #ifdef COMP_AR12S #define COMP_AR12S_FUNC VPCompAR12S extern void VPCompAR12S(); #else #define COMP_AR12S_FUNC VPCompAR1NS #endif #ifdef COMP_AR32S #define COMP_AR32S_FUNC VPCompAR32S extern void VPCompAR32S(); #else #define COMP_AR32S_FUNC VPCompAR3NS #endif #define COMP_AR1NS_FUNC VPCompAR1NS extern void VPCompAR1NS( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ GrayIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, void *voxel_data, /* voxel data for slice */ int voxel_istride, /* strides for voxel data */ int voxel_jstride, GrayIntPixel *shadow_buffer ); #define COMP_AR3NS_FUNC VPCompAR3NS extern void VPCompAR3NS( vpContext *vpc, /* context */ int icount, /* slice size */ int jcount, int k, /* slice number */ double slice_depth_cueing_dbl, /* depth cueing factor for slice */ RGBIntPixel *intimage, /* intermediate image pixels */ double weightTLdbl, /* resampling weights */ double weightBLdbl, double weightTRdbl, double weightBRdbl, void *voxel_data, /* voxel data for slice */ int voxel_istride, /* strides for voxel data */ int voxel_jstride, GrayIntPixel *shadow_buffer ); #ifdef INDEX_VOLUME extern void VPCompAI11B(); #endif #define SHADOWS_OFF 0 #define SHADOWS_ON 1 #define SHADOW_OPTS 2 #define MATERIAL_CALLBACK 0 #define MATERIAL_ONE 1 #define MATERIAL_TWO 2 #define MATERIAL_MORE 3 #define MATERIAL_OPTS 4 #define COLOR_GRAY 0 #define COLOR_RGB 1 #define COLOR_OPTS 2 static void (*AffineProcTable[SHADOW_OPTS][MATERIAL_OPTS][COLOR_OPTS])() = { { { (void(*)())COMP_AR1PB_FUNC, (void(*)())COMP_AR3PB_FUNC }, { (void(*)())COMP_AR11B_FUNC, (void(*)())COMP_AR31B_FUNC }, { (void(*)())COMP_AR12B_FUNC, (void(*)())COMP_AR32B_FUNC }, { (void(*)())COMP_AR1NB_FUNC, (void(*)())COMP_AR3NB_FUNC } }, { { (void(*)())COMP_AR1PS_FUNC, (void(*)())COMP_AR3PS_FUNC }, { (void(*)())COMP_AR11S_FUNC, (void(*)())COMP_AR31S_FUNC }, { (void(*)())COMP_AR12S_FUNC, (void(*)())COMP_AR32S_FUNC }, { (void(*)())COMP_AR1NS_FUNC, (void(*)())COMP_AR3NS_FUNC } } }; /* * vpRenderRawVolume * * Render an uclassified volume using the shear-warp algorithm. */ vpResult vpRenderRawVolume(vpc) vpContext *vpc; { int retcode; void (*composite_func)(vpContext*,...); int shadow_option, material_option, color_option; /* check for errors and initialize */ if ((retcode = VPCheckRawVolume(vpc)) != VP_OK) return(retcode); if ((retcode = VPCheckClassifier(vpc)) != VP_OK) return(retcode); if ((retcode = VPCheckShader(vpc)) != VP_OK) return(retcode); if ((retcode = VPCheckImage(vpc)) != VP_OK) return(retcode); if (vpc->num_clsfy_params > 2) return(VPSetError(vpc, VPERROR_LIMIT_EXCEEDED)); if ((retcode = VPFactorView(vpc)) != VP_OK) return(retcode); Debug((vpc, VPDEBUG_RENDER, "Algorithm: affine RAWvolume (%s)\n", vpc->mm_octree == NULL ? "no octree" : "with octree")); /* determine which options are enabled */ if (vpc->enable_shadows) shadow_option = SHADOWS_ON; else shadow_option = SHADOWS_OFF; if (vpc->shading_mode == CALLBACK_SHADER) material_option = MATERIAL_CALLBACK; else if (vpc->num_materials == 1) material_option = MATERIAL_ONE; else if (vpc->num_materials == 2) material_option = MATERIAL_TWO; else material_option = MATERIAL_MORE; if (vpc->color_channels == 1) color_option = COLOR_GRAY; else color_option = COLOR_RGB; /* render */ if (vpc->affine_view) { /* choose a compositing function */ composite_func = (void(*)(vpContext*,...))AffineProcTable[shadow_option][material_option] [color_option]; VPRenderAffine(vpc, USE_RAWVOLUME, composite_func); } else { /* XXX perspective rendering not available yet */ return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } ccseapps-2.5/CCSEApps/volpack/vp_WarpA.m40000644000175000017500000004775311634153073021317 0ustar amckinstryamckinstry/* * vp_warpA.m4 * * One-pass image warping routine for affine transformations. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:03 $ * $Revision: 1.6 $ */ #include "vp_global.h" dnl Description: dnl This is an m4 source file which defines a C procedure to warp dnl a 2D image according to an affine transformation. The macro dnl definitions allow the procedure to be specialized for a particular dnl output pixel type. dnl dnl To produce a C source file, run this file through m4 with the dnl following m4 macros defined: dnl dnl FuncName name of the C function to produce dnl IntPixelType intermediate image element type (GrayIntPixel dnl or RGBIntPixel) dnl BGRPixel 1 to store color pixel in BGR order, dnl 0 otherwise dnl ColorChannels number of channels for color (0, 1 or 3) dnl OpacityChannels number of channels for opacity (0, 1) dnl dnl OR, define "SourceFile" to be a file name of the form dnl vp_warpA????.c dnl where the four wildcard characters (call them W, X, Y and Z) dnl can have one of the following values: dnl W: number of color channels in intermediate image ("1" or "3") dnl X: number of color channels in the output image ("0", "1" or "3") dnl Y: number of opacity channels in output image ("0" or "1") dnl Z: "R" to store color pixel in reverse order (ABGR), dnl "N" to store color pixel in normal order (RGBA) ifdef(`SourceFile', ` define(FuncNameStr, `substr(SourceFile, 7, 5)') define(ColorChannelsIn, `substr(SourceFile, 8, 1)') define(ColorChannels, `substr(SourceFile, 9, 1)') define(OpacityChannels, `substr(SourceFile, 10, 1)') define(ReverseOrder, `substr(SourceFile, 11, 1)') define(FuncName, `VPWarp'FuncNameStr()) ifelse(ColorChannelsIn, `1', `define(IntPixelType, GrayIntPixel)', ColorChannelsIn, `3', `define(IntPixelType, RGBIntPixel)') ifelse(ReverseOrder, `R', `define(BGRPixel, 1)', `define(BGRPixel, 0)') ') dnl Macros defined below: dnl DeclareAccumulator() declare a pixel accumulator dnl ClearAccumulator() clear the pixel accumulator dnl Accumulate1(wgt, ipixel) multiply ipixel by wgt and add to accumulator dnl Accumulate4(wgt0, ipixel0, wgt1, ipixel1, wgt2, ipixel2, wgt3, ipixel3) dnl multiply each pixel by corresponding weight dnl and store in accumulator dnl StoreAccumulator(dst) write the pixel accumulator to dst dnl dnl dnl Definitions that depend on the number of color channels. dnl ifelse(ColorChannels, 0, ` define(`DeclareColorAccumulator', `') define(`ClearColorAccumulator', `') define(`ColorAccumulate1', `') define(`ColorAccumulate4', `') define(`StoreColorAccumulator', `')') ifelse(ColorChannels, 1, ` define(`DeclareColorAccumulator', `float gray_acc; int gray_acc_int;') define(`ClearColorAccumulator', `gray_acc = 0;') define(`ColorAccumulate1', `gray_acc += ($1) * ($2.clrflt);') define(`ColorAccumulate4', ` gray_acc = ($1) * ($2.clrflt) + ($3) * ($4.clrflt) + ($5) * ($6.clrflt) + ($7) * ($8.clrflt);') define(`StoreColorAccumulator', ` gray_acc_int = gray_acc; if (gray_acc_int > 255) gray_acc_int = 255; ($1) = gray_acc_int;')') ifelse(ColorChannels, 3, ` define(`DeclareColorAccumulator', `float r_acc, g_acc, b_acc; int r_acc_int, g_acc_int, b_acc_int;') define(`ClearColorAccumulator', `r_acc = g_acc = b_acc = 0;') define(`ColorAccumulate1', ` r_acc += ($1) * ($2.rclrflt); g_acc += ($1) * ($2.gclrflt); b_acc += ($1) * ($2.bclrflt);') define(`ColorAccumulate4', ` r_acc = ($1) * ($2.rclrflt) + ($3) * ($4.rclrflt) + ($5) * ($6.rclrflt) + ($7) * ($8.rclrflt); g_acc = ($1) * ($2.gclrflt) + ($3) * ($4.gclrflt) + ($5) * ($6.gclrflt) + ($7) * ($8.gclrflt); b_acc = ($1) * ($2.bclrflt) + ($3) * ($4.bclrflt) + ($5) * ($6.bclrflt) + ($7) * ($8.bclrflt);') define(`StoreColorAccumulator', ` r_acc_int = r_acc; if (r_acc_int > 255) r_acc_int = 255; ($1) = r_acc_int; g_acc_int = g_acc; if (g_acc_int > 255) g_acc_int = 255; ($2) = g_acc_int; b_acc_int = b_acc; if (b_acc_int > 255) b_acc_int = 255; ($3) = b_acc_int;')') dnl dnl Definitions that depend on the number of opacity channels. dnl ifelse(OpacityChannels, 0, ` define(`DeclareOpacityAccumulator', `') define(`ClearOpacityAccumulator', `') define(`OpacityAccumulate1', `') define(`OpacityAccumulate4', `') define(`StoreOpacityAccumulator', `')') ifelse(OpacityChannels, 1, ` define(`DeclareOpacityAccumulator', `float opc_acc; int opc_acc_int;') define(`ClearOpacityAccumulator', `opc_acc = 0;') define(`OpacityAccumulate1', `opc_acc += ($1) * ($2.opcflt);') define(`OpacityAccumulate4', ` opc_acc = ($1) * ($2.opcflt) + ($3) * ($4.opcflt) + ($5) * ($6.opcflt) + ($7) * ($8.opcflt);') define(`StoreOpacityAccumulator', ` opc_acc_int = opc_acc * (float)255.; if (opc_acc_int > 255) opc_acc_int = 255; ($1) = opc_acc_int;')') dnl dnl Other defintions. dnl define(`OutputChannels', ((ColorChannels) + (OpacityChannels))) define(`DeclareAccumulator', ` DeclareColorAccumulator DeclareOpacityAccumulator') define(`ClearAccumulator', ` ClearColorAccumulator ClearOpacityAccumulator') define(`Accumulate1', ` ColorAccumulate1($1, $2) OpacityAccumulate1($1, $2)') define(`Accumulate4', ` ColorAccumulate4($1, $2, $3, $4, $5, $6, $7, $8) OpacityAccumulate4($1, $2, $3, $4, $5, $6, $7, $8)') ifelse(BGRPixel, 0, ` define(`StoreAccumulator', ` StoreColorAccumulator(($1)[0], ($1)[1], ($1)[2]) StoreOpacityAccumulator(($1)[ColorChannels])')', ` define(`StoreAccumulator', ` StoreOpacityAccumulator(($1)[0]) StoreColorAccumulator(($1)[OpacityChannels+2], ($1)[OpacityChannels+1], ($1)[OpacityChannels+0])')') /* convert a float in the interval [0-1) to a 31-bit fixed point */ #define FLTFRAC_TO_FIX31(f) ((int)((f) * 2147483648.)) /* convert a 31-bit fixed point to a weight table index */ #define FIX31_TO_WGTIND(f) ((f) >> (31 - WARP_WEIGHT_INDEX_BITS)) extern float VPBilirpWeight[WARP_WEIGHT_ENTRIES][WARP_WEIGHT_ENTRIES][4]; /* * FuncName * * One-pass warper. Transforms in_image to out_image according to * the affine warp specified by warp_matrix. The resampling filter * is a bilirp (suitable for upsampling only). */ void FuncName (in_image, in_width, in_height, in_bytes_per_scan, out_image, out_width, out_height, out_bytes_per_scan, warp_matrix) IntPixelType *in_image; /* input image data */ int in_width; /* size of input image */ int in_height; int in_bytes_per_scan; /* bytes per scanline in input image */ unsigned char *out_image; /* output image data */ int out_width; /* size of output image */ int out_height; int out_bytes_per_scan; /* bytes per scanline in output image */ vpMatrix3 warp_matrix; /* [ outx ] [ inx ] */ /* [ outy ] = warp_matrix * [ iny ] */ /* [ 1 ] [ 1 ] */ { Trapezoid full_overlap[9]; /* description of the area of overlap of output image (shrunk by the size of the filter kernel) with input image */ Trapezoid part_overlap[9]; /* description of the area of overlap of output image (unlarged by the size of the filter kernel) with input image */ int region; /* index into full/part_overlap */ unsigned char *out_ptr; /* pointer to current pixel of output image */ int out_scan_y; /* coordinate of current output scanline */ int scans_to_next_vertex; /* number of scans left to process before the next vertex is reached */ IntPixelType *in_ptr; /* pointer to current pixel of input image */ double x_lft_full, x_rgt_full; /* intersection of scan with full_overlap */ double x_lft_part, x_rgt_part; /* intersection of scan with part_overlap */ int no_full_pixels; /* true if full_overlap is empty for scan */ double in_x, in_y; /* exact coordinates in the input image of the current output image pixel */ int in_x_int, in_y_int; /* coordinates of the nearest input image pixel to the upper-left of the current output image pixel */ int xfrac, yfrac; /* in_x - in_x_int and in_y - in_y_int, stored as a fixed-point number with 31 bits of fraction */ int xfrac_incr, yfrac_incr; /* increments to xfrac and yfrac to give the fractions for the next output image pixel in the current scan */ double in_x_incr, in_y_incr;/* increments to in_x and in_y to give the input image coordinates of the next output image pixel in the current scan (equal to dx_in/dx_out and dy_in/dx_out) */ int in_x_incr_int, in_y_incr_int; /* integer part of in_x/y_incr */ int in_x_incr_dlt, in_y_incr_dlt; /* sign of in_x/y_incr */ float *wptr; /* pointer into weight table */ int lft_zero_cnt; /* # zero pixels on left edge of scan */ int lft_edge_cnt; /* # pixels on left w/ part filter overlap */ int full_cnt; /* # pixels w/ full filter overlap */ int rgt_edge_cnt; /* # pixels on rgt w/ part filter overlap */ int rgt_zero_cnt; /* # zero pixels on right edge of scan */ int x; /* pixel index */ DeclareAccumulator /* pixel accumulator */ double denom; int c; #ifdef DEBUG { int y; for (y = 0; y < out_height; y++) { out_ptr = out_image + y*out_bytes_per_scan; for (x = 0; x < out_width; x++) { for (c = 0; c < OutputChannels; c++) *out_ptr++ = 255; } } } #endif /* initialize tables */ VPComputeWarpTables(); /* compute the intersection of the input image and the output image */ /* filter width = 2.0 in input image space (triangle filter) */ VPAffineImageOverlap(in_width, in_height, out_width, out_height, warp_matrix, 2., full_overlap, part_overlap); /* compute the output image */ out_ptr = out_image; out_scan_y = 0; denom = 1. / (warp_matrix[0][0] * warp_matrix[1][1] - warp_matrix[0][1] * warp_matrix[1][0]); in_x_incr = warp_matrix[1][1]*denom; in_y_incr = -warp_matrix[1][0]*denom; if (in_x_incr < 0) { in_x_incr_int = (int)ceil(in_x_incr); in_x_incr_dlt = -1; } else { in_x_incr_int = (int)floor(in_x_incr); in_x_incr_dlt = 1; } if (in_y_incr < 0) { in_y_incr_int = (int)ceil(in_y_incr); in_y_incr_dlt = -1; } else { in_y_incr_int = (int)floor(in_y_incr); in_y_incr_dlt = 1; } xfrac_incr = FLTFRAC_TO_FIX31(in_x_incr - in_x_incr_int); yfrac_incr = FLTFRAC_TO_FIX31(in_y_incr - in_y_incr_int); for (region = 0; region < 9; region++) { /* check for empty region */ if (part_overlap[region].miny >= out_height) { break; } /* check if this region of the output image is unaffected by the input image */ if (part_overlap[region].x_top_lft > part_overlap[region].x_top_rgt) { c = (part_overlap[region].maxy - part_overlap[region].miny + 1) * out_bytes_per_scan; bzero(out_ptr, c); out_ptr += c; out_scan_y += part_overlap[region].maxy - part_overlap[region].miny + 1; continue; } /* process scanlines of this region */ scans_to_next_vertex = part_overlap[region].maxy - part_overlap[region].miny + 1; x_lft_full = full_overlap[region].x_top_lft; x_rgt_full = full_overlap[region].x_top_rgt; x_lft_part = part_overlap[region].x_top_lft; x_rgt_part = part_overlap[region].x_top_rgt; if (x_lft_full > x_rgt_full) no_full_pixels = 1; else no_full_pixels = 0; ASSERT(scans_to_next_vertex > 0); ASSERT(out_scan_y == part_overlap[region].miny); while (scans_to_next_vertex > 0) { /* compute the portions of the scanline which are zero and which intersect the full and partially-full regions */ lft_zero_cnt = (int)floor(x_lft_part); if (lft_zero_cnt < 0) lft_zero_cnt = 0; else if (lft_zero_cnt > out_width) lft_zero_cnt = out_width; if (no_full_pixels) { lft_edge_cnt = (int)ceil(x_rgt_part); if (lft_edge_cnt < 0) lft_edge_cnt = 0; else if (lft_edge_cnt > out_width) lft_edge_cnt = out_width; lft_edge_cnt -= lft_zero_cnt; if (lft_edge_cnt < 0) lft_edge_cnt = 0; full_cnt = 0; rgt_edge_cnt = 0; rgt_zero_cnt = out_width - lft_zero_cnt - lft_edge_cnt; } else { lft_edge_cnt = (int)ceil(x_lft_full); if (lft_edge_cnt < 0) lft_edge_cnt = 0; else if (lft_edge_cnt > out_width) lft_edge_cnt = out_width; lft_edge_cnt -= lft_zero_cnt; if (lft_edge_cnt < 0) lft_edge_cnt = 0; full_cnt = (int)floor(x_rgt_full); if (full_cnt < 0) full_cnt = 0; else if (full_cnt > out_width) full_cnt = out_width; full_cnt -= lft_edge_cnt + lft_zero_cnt; if (full_cnt < 0) full_cnt = 0; rgt_edge_cnt = (int)ceil(x_rgt_part); if (rgt_edge_cnt < 0) rgt_edge_cnt = 0; else if (rgt_edge_cnt > out_width) rgt_edge_cnt = out_width; rgt_edge_cnt -= full_cnt + lft_edge_cnt + lft_zero_cnt; if (rgt_edge_cnt < 0) rgt_edge_cnt = 0; rgt_zero_cnt = out_width - lft_zero_cnt - lft_edge_cnt - full_cnt - rgt_edge_cnt; } /* reverse map the first left-edge output pixel coordinate into the input image coordinate system */ in_x = ((lft_zero_cnt - warp_matrix[0][2]) * warp_matrix[1][1] - (out_scan_y - warp_matrix[1][2])*warp_matrix[0][1])*denom; in_y = (-(lft_zero_cnt - warp_matrix[0][2]) * warp_matrix[1][0] + (out_scan_y - warp_matrix[1][2])*warp_matrix[0][0])*denom; in_x_int = (int)floor(in_x); in_y_int = (int)floor(in_y); in_ptr = (IntPixelType *)(((char *)in_image + in_y_int * in_bytes_per_scan)) + in_x_int; /* compute the weight lookup table indices and increments */ xfrac = FLTFRAC_TO_FIX31(in_x - in_x_int); yfrac = FLTFRAC_TO_FIX31(in_y - in_y_int); /* zero out unaffected pixels on left edge of scan */ if (lft_zero_cnt > 0) { bzero(out_ptr, lft_zero_cnt * OutputChannels); out_ptr += lft_zero_cnt * OutputChannels; } /* process left edge case pixels */ for (x = lft_zero_cnt; x < lft_zero_cnt + lft_edge_cnt; x++) { wptr = VPBilirpWeight[FIX31_TO_WGTIND(yfrac)] [FIX31_TO_WGTIND(xfrac)]; ClearAccumulator(); if (in_x_int >= 0 && in_x_int < in_width) { if (in_y_int >= 0 && in_y_int < in_height) { Accumulate1(wptr[0], in_ptr[0]); } if (in_y_int+1 >= 0 && in_y_int+1 < in_height) { Accumulate1(wptr[2], in_ptr[in_width]); } } if (in_x_int+1 >= 0 && in_x_int+1 < in_width) { if (in_y_int >= 0 && in_y_int < in_height) { Accumulate1(wptr[1], in_ptr[1]); } if (in_y_int+1 >= 0 && in_y_int+1 < in_height) { Accumulate1(wptr[3], in_ptr[in_width + 1]); } } StoreAccumulator(out_ptr); out_ptr += OutputChannels; xfrac += xfrac_incr; yfrac += yfrac_incr; if ( (unsigned int)xfrac & ~0x7FFFFFFF ) { xfrac &= 0x7FFFFFFF; in_x_int += in_x_incr_int + in_x_incr_dlt; in_ptr += in_x_incr_int + in_x_incr_dlt; } else { in_x_int += in_x_incr_int; in_ptr += in_x_incr_int; } if ( (unsigned int)yfrac & ~0x7FFFFFFF ) { yfrac &= 0x7FFFFFFF; in_y_int += in_y_incr_int + in_y_incr_dlt; in_ptr += in_width * (in_y_incr_int + in_y_incr_dlt); } else { in_y_int += in_y_incr_int; in_ptr += in_width * in_y_incr_int; } } /* process output pixels affected by four input pixels */ for (x = lft_zero_cnt + lft_edge_cnt; x < lft_zero_cnt + lft_edge_cnt + full_cnt; x++) { ASSERT(in_x_int >= 0 && in_x_int < in_width-1); ASSERT(in_y_int >= 0 && in_y_int < in_height-1); ASSERT((IntPixelType *)(((char *)in_image + in_y_int * in_bytes_per_scan)) + in_x_int == in_ptr); wptr = VPBilirpWeight[FIX31_TO_WGTIND(yfrac)] [FIX31_TO_WGTIND(xfrac)]; Accumulate4(wptr[0], in_ptr[0], wptr[2], in_ptr[in_width], wptr[1], in_ptr[1], wptr[3], in_ptr[in_width+1]); StoreAccumulator(out_ptr); out_ptr += OutputChannels; xfrac += xfrac_incr; yfrac += yfrac_incr; if ( (unsigned int)xfrac & ~0X7FFFFFFF ) { xfrac &= 0x7FFFFFFF; in_x_int += in_x_incr_int + in_x_incr_dlt; in_ptr += in_x_incr_int + in_x_incr_dlt; } else { in_x_int += in_x_incr_int; in_ptr += in_x_incr_int; } if ( (unsigned int)yfrac & ~0X7FFFFFFF ) { yfrac &= 0x7FFFFFFF; in_y_int += in_y_incr_int + in_y_incr_dlt; in_ptr += in_width * (in_y_incr_int + in_y_incr_dlt); } else { in_y_int += in_y_incr_int; in_ptr += in_width * in_y_incr_int; } } /* process right edge case pixels */ for (x = lft_zero_cnt + lft_edge_cnt + full_cnt; x < lft_zero_cnt + lft_edge_cnt + full_cnt + rgt_edge_cnt; x++) { wptr = VPBilirpWeight[FIX31_TO_WGTIND(yfrac)] [FIX31_TO_WGTIND(xfrac)]; ClearAccumulator(); if (in_x_int >= 0 && in_x_int < in_width) { if (in_y_int >= 0 && in_y_int < in_height) { Accumulate1(wptr[0], in_ptr[0]); } if (in_y_int+1 >= 0 && in_y_int+1 < in_height) { Accumulate1(wptr[2], in_ptr[in_width]); } } if (in_x_int+1 >= 0 && in_x_int+1 < in_width) { if (in_y_int >= 0 && in_y_int < in_height) { Accumulate1(wptr[1], in_ptr[1]); } if (in_y_int+1 >= 0 && in_y_int+1 < in_height) { Accumulate1(wptr[3], in_ptr[in_width + 1]); } } StoreAccumulator(out_ptr); out_ptr += OutputChannels; xfrac += xfrac_incr; yfrac += yfrac_incr; if ( (unsigned int)xfrac & ~0X7FFFFFFF ) { xfrac &= 0x7FFFFFFF; in_x_int += in_x_incr_int + in_x_incr_dlt; in_ptr += in_x_incr_int + in_x_incr_dlt; } else { in_x_int += in_x_incr_int; in_ptr += in_x_incr_int; } if ( (unsigned int)yfrac & ~0X7FFFFFFF ) { yfrac &= 0x7FFFFFFF; in_y_int += in_y_incr_int + in_y_incr_dlt; in_ptr += in_width * (in_y_incr_int + in_y_incr_dlt); } else { in_y_int += in_y_incr_int; in_ptr += in_width * in_y_incr_int; } } /* zero out unaffected pixels on right edge of scan */ if (rgt_zero_cnt > 0) { bzero(out_ptr, rgt_zero_cnt * OutputChannels); out_ptr += rgt_zero_cnt * OutputChannels; } /* go on to next scan */ scans_to_next_vertex--; out_scan_y++; out_ptr += out_bytes_per_scan - out_width * OutputChannels; x_lft_full += full_overlap[region].x_incr_lft; x_rgt_full += full_overlap[region].x_incr_rgt; x_lft_part += part_overlap[region].x_incr_lft; x_rgt_part += part_overlap[region].x_incr_rgt; } /* next scanline in region */ } /* next region */ ASSERT(out_scan_y == out_height); } ccseapps-2.5/CCSEApps/volpack/volpack.dsp0000644000175000017500000003422511634153073021473 0ustar amckinstryamckinstry# Microsoft Developer Studio Project File - Name="volpack" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=volpack - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "volpack.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "volpack.mak" CFG="volpack - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "volpack - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "volpack - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe F90=df.exe RSC=rc.exe !IF "$(CFG)" == "volpack - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE F90 /compile_only /nologo /warn:nofileopt # ADD F90 /compile_only /nologo /warn:nofileopt # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /W1 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "COMP_AC11B" /D "COMP_AC31B" /D "COMP_AC32B" /D "COMP_AR11B" /D "COMP_AR31B" /D "COMP_AR32B" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ELSEIF "$(CFG)" == "volpack - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD CPP /nologo /W1 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "COMP_AC11B" /D "COMP_AC31B" /D "COMP_AC32B" /D "COMP_AR11B" /D "COMP_AR31B" /D "COMP_AR32B" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ENDIF # Begin Target # Name "volpack - Win32 Release" # Name "volpack - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" # Begin Source File SOURCE=.\vp_check.c # End Source File # Begin Source File SOURCE=.\vp_compAC00G.c # End Source File # Begin Source File SOURCE=.\vp_compAC11B.c # End Source File # Begin Source File SOURCE=.\vp_compAC1NB.c # End Source File # Begin Source File SOURCE=.\vp_compAC1NS.c # End Source File # Begin Source File SOURCE=.\vp_compAC1PB.c # End Source File # Begin Source File SOURCE=.\vp_compAC31B.c # End Source File # Begin Source File SOURCE=.\vp_compAC32B.c # End Source File # Begin Source File SOURCE=.\vp_compAC3NB.c # End Source File # Begin Source File SOURCE=.\vp_compAC3NS.c # End Source File # Begin Source File SOURCE=.\vp_compAC3PB.c # End Source File # Begin Source File SOURCE=.\vp_compAR00G.c # End Source File # Begin Source File SOURCE=.\vp_compAR11B.c # End Source File # Begin Source File SOURCE=.\vp_compAR1NB.c # End Source File # Begin Source File SOURCE=.\vp_compAR1NS.c # End Source File # Begin Source File SOURCE=.\vp_compAR1PB.c # End Source File # Begin Source File SOURCE=.\vp_compAR31B.c # End Source File # Begin Source File SOURCE=.\vp_compAR32B.c # End Source File # Begin Source File SOURCE=.\vp_compAR3NB.c # End Source File # Begin Source File SOURCE=.\vp_compAR3NS.c # End Source File # Begin Source File SOURCE=.\vp_compAR3PB.c # End Source File # Begin Source File SOURCE=.\vp_context.c # End Source File # Begin Source File SOURCE=.\vp_extract.c # End Source File # Begin Source File SOURCE=.\vp_file.c # End Source File # Begin Source File SOURCE=.\vp_linalg.c # End Source File # Begin Source File SOURCE=.\vp_octree.c # End Source File # Begin Source File SOURCE=.\vp_renderA.c # End Source File # Begin Source File SOURCE=.\vp_renderB.c # End Source File # Begin Source File SOURCE=.\vp_renderC.c # End Source File # Begin Source File SOURCE=.\vp_renderR.c # End Source File # Begin Source File SOURCE=.\vp_resample.c # End Source File # Begin Source File SOURCE=.\vp_rle.c # End Source File # Begin Source File SOURCE=.\vp_shade.c # End Source File # Begin Source File SOURCE=.\vp_transpose.c # End Source File # Begin Source File SOURCE=.\vp_util.c # End Source File # Begin Source File SOURCE=.\vp_view.c # End Source File # Begin Source File SOURCE=.\vp_warp.c # End Source File # Begin Source File SOURCE=.\vp_warpA101N.c # End Source File # Begin Source File SOURCE=.\vp_warpA110N.c # End Source File # Begin Source File SOURCE=.\vp_warpA111N.c # End Source File # Begin Source File SOURCE=.\vp_warpA301N.c # End Source File # Begin Source File SOURCE=.\vp_warpA330N.c # End Source File # Begin Source File SOURCE=.\vp_warpA330R.c # End Source File # Begin Source File SOURCE=.\vp_warpA331N.c # End Source File # Begin Source File SOURCE=.\vp_warpA331R.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # Begin Source File SOURCE=.\volpack.h # End Source File # Begin Source File SOURCE=.\vp_global.h # End Source File # End Group # Begin Source File SOURCE=.\vp_CompA.m4 !IF "$(CFG)" == "volpack - Win32 Release" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=.\vp_CompA.m4 BuildCmds= \ m4 -s -DSourceFile=vp_compAC1NB.c vp_CompA.m4 > vp_compAC1NB.c \ m4 -s -DSourceFile=vp_compAC3NB.c vp_CompA.m4 > vp_compAC3NB.c \ m4 -s -DSourceFile=vp_compAR1NB.c vp_CompA.m4 > vp_compAR1NB.c \ m4 -s -DSourceFile=vp_compAR3NB.c vp_CompA.m4 > vp_compAR3NB.c \ m4 -s -DSourceFile=vp_compAC1PB.c vp_CompA.m4 > vp_compAC1PB.c \ m4 -s -DSourceFile=vp_compAC3PB.c vp_CompA.m4 > vp_compAC3PB.c \ m4 -s -DSourceFile=vp_compAR1PB.c vp_CompA.m4 > vp_compAR1PB.c \ m4 -s -DSourceFile=vp_compAR3PB.c vp_CompA.m4 > vp_compAR3PB.c \ m4 -s -DSourceFile=vp_compAC00G.c vp_CompA.m4 > vp_compAC00G.c \ m4 -s -DSourceFile=vp_compAR00G.c vp_CompA.m4 > vp_compAR00G.c \ m4 -s -DSourceFile=vp_compAC1NS.c vp_CompA.m4 > vp_compAC1NS.c \ m4 -s -DSourceFile=vp_compAC3NS.c vp_CompA.m4 > vp_compAC3NS.c \ m4 -s -DSourceFile=vp_compAR1NS.c vp_CompA.m4 > vp_compAR1NS.c \ m4 -s -DSourceFile=vp_compAR3NS.c vp_CompA.m4 > vp_compAR3NS.c \ m4 -s -DSourceFile=vp_compAC11B.c vp_CompA.m4 > vp_compAC11B.c \ m4 -s -DSourceFile=vp_compAC31B.c vp_CompA.m4 > vp_compAC31B.c \ m4 -s -DSourceFile=vp_compAC32B.c vp_CompA.m4 > vp_compAC32B.c \ m4 -s -DSourceFile=vp_compAR11B.c vp_CompA.m4 > vp_compAR11B.c \ m4 -s -DSourceFile=vp_compAR31B.c vp_CompA.m4 > vp_compAR31B.c \ m4 -s -DSourceFile=vp_compAR32B.c vp_CompA.m4 > vp_compAR32B.c \ "vp_compAC1NB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC3NB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR1NB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR3NB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC1PB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC3PB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR1PB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR3PB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC00G.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR00G.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC1NS.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC3NS.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR1NS.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR3NS.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC11B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC31B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC32B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR11B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR31B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR32B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build !ELSEIF "$(CFG)" == "volpack - Win32 Debug" # PROP Ignore_Default_Tool 1 # Begin Custom Build InputPath=.\vp_CompA.m4 BuildCmds= \ m4 -s -DSourceFile=vp_compAC1NB.c vp_CompA.m4 > vp_compAC1NB.c \ m4 -s -DSourceFile=vp_compAC3NB.c vp_CompA.m4 > vp_compAC3NB.c \ m4 -s -DSourceFile=vp_compAR1NB.c vp_CompA.m4 > vp_compAR1NB.c \ m4 -s -DSourceFile=vp_compAR3NB.c vp_CompA.m4 > vp_compAR3NB.c \ m4 -s -DSourceFile=vp_compAC1PB.c vp_CompA.m4 > vp_compAC1PB.c \ m4 -s -DSourceFile=vp_compAC3PB.c vp_CompA.m4 > vp_compAC3PB.c \ m4 -s -DSourceFile=vp_compAR1PB.c vp_CompA.m4 > vp_compAR1PB.c \ m4 -s -DSourceFile=vp_compAR3PB.c vp_CompA.m4 > vp_compAR3PB.c \ m4 -s -DSourceFile=vp_compAC00G.c vp_CompA.m4 > vp_compAC00G.c \ m4 -s -DSourceFile=vp_compAR00G.c vp_CompA.m4 > vp_compAR00G.c \ m4 -s -DSourceFile=vp_compAC1NS.c vp_CompA.m4 > vp_compAC1NS.c \ m4 -s -DSourceFile=vp_compAC3NS.c vp_CompA.m4 > vp_compAC3NS.c \ m4 -s -DSourceFile=vp_compAR1NS.c vp_CompA.m4 > vp_compAR1NS.c \ m4 -s -DSourceFile=vp_compAR3NS.c vp_CompA.m4 > vp_compAR3NS.c \ m4 -s -DSourceFile=vp_compAC11B.c vp_CompA.m4 > vp_compAC11B.c \ m4 -s -DSourceFile=vp_compAC31B.c vp_CompA.m4 > vp_compAC31B.c \ m4 -s -DSourceFile=vp_compAC32B.c vp_CompA.m4 > vp_compAC32B.c \ m4 -s -DSourceFile=vp_compAR11B.c vp_CompA.m4 > vp_compAR11B.c \ m4 -s -DSourceFile=vp_compAR31B.c vp_CompA.m4 > vp_compAR31B.c \ m4 -s -DSourceFile=vp_compAR32B.c vp_CompA.m4 > vp_compAR32B.c \ "vp_compAC1NB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC3NB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR1NB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR3NB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC1PB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC3PB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR1PB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR3PB.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC00G.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR00G.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC1NS.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC3NS.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR1NS.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR3NS.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC11B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC31B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAC32B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR11B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR31B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_compAR32B.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build !ENDIF # End Source File # Begin Source File SOURCE=.\vp_WarpA.m4 !IF "$(CFG)" == "volpack - Win32 Release" # Begin Custom Build InputPath=.\vp_WarpA.m4 BuildCmds= \ m4 -s -DSourceFile=vp_warpA101N.c vp_WarpA.m4 > vp_warpA101N.c \ m4 -s -DSourceFile=vp_warpA301N.c vp_WarpA.m4 > vp_warpA301N.c \ m4 -s -DSourceFile=vp_warpA110N.c vp_WarpA.m4 > vp_warpA110N.c \ m4 -s -DSourceFile=vp_warpA111N.c vp_WarpA.m4 > vp_warpA111N.c \ m4 -s -DSourceFile=vp_warpA330N.c vp_WarpA.m4 > vp_warpA330N.c \ m4 -s -DSourceFile=vp_warpA331N.c vp_WarpA.m4 > vp_warpA331N.c \ m4 -s -DSourceFile=vp_warpA330R.c vp_WarpA.m4 > vp_warpA330R.c \ m4 -s -DSourceFile=vp_warpA331R.c vp_WarpA.m4 > vp_warpA331R.c \ "vp_warpA101N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA301N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA110N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA111N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA330N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA331N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA330R.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA331R.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build !ELSEIF "$(CFG)" == "volpack - Win32 Debug" # Begin Custom Build InputPath=.\vp_WarpA.m4 BuildCmds= \ m4 -s -DSourceFile=vp_warpA101N.c vp_WarpA.m4 > vp_warpA101N.c \ m4 -s -DSourceFile=vp_warpA301N.c vp_WarpA.m4 > vp_warpA301N.c \ m4 -s -DSourceFile=vp_warpA110N.c vp_WarpA.m4 > vp_warpA110N.c \ m4 -s -DSourceFile=vp_warpA111N.c vp_WarpA.m4 > vp_warpA111N.c \ m4 -s -DSourceFile=vp_warpA330N.c vp_WarpA.m4 > vp_warpA330N.c \ m4 -s -DSourceFile=vp_warpA331N.c vp_WarpA.m4 > vp_warpA331N.c \ m4 -s -DSourceFile=vp_warpA330R.c vp_WarpA.m4 > vp_warpA330R.c \ m4 -s -DSourceFile=vp_warpA331R.c vp_WarpA.m4 > vp_warpA331R.c \ "vp_warpA101N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA301N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA110N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA111N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA330N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA331N.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA330R.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) "vp_warpA331R.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build !ENDIF # End Source File # End Target # End Project ccseapps-2.5/CCSEApps/volpack/vp_check.c0000644000175000017500000002212611634153073021247 0ustar amckinstryamckinstry/* * vp_check.c * * Consistency and error checking routines. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:03 $ * $Revision: 1.4 $ */ #include "vp_global.h" /* error strings for vpGetErrorString() */ static char *ErrorString[] = { "limit exceeded", "singular matrix or vector", "I/O error", "invalid buffer size", "invalid image definition", "invalid shader definition", "invalid classifier definition", "invalid volume definition", "invalid voxel definition", "invalid option", "argument out of range", "invalid file", "cannot compute shadow buffer", }; /* * VPCheckVoxelFields * * Check the voxel field information for validity. */ vpResult VPCheckVoxelFields(vpc) vpContext *vpc; { int f; int size, offset; if (vpc->raw_bytes_per_voxel <= 0) return(VPSetError(vpc, VPERROR_BAD_VOXEL)); if (vpc->num_voxel_fields <= 0) return(VPSetError(vpc, VPERROR_BAD_VOXEL)); for (f = 0; f < vpc->num_voxel_fields; f++) { size = vpc->field_size[f]; offset = vpc->field_offset[f]; if (size != 1 && size != 2 && size != 4) return(VPSetError(vpc, VPERROR_BAD_VOXEL)); if (offset < 0 || offset + size > vpc->raw_bytes_per_voxel) return(VPSetError(vpc, VPERROR_BAD_VOXEL)); if (f > 0 && offset < vpc->field_size[f-1] + vpc->field_offset[f-1]) return(VPSetError(vpc, VPERROR_BAD_VOXEL)); } return(VP_OK); } /* * VPCheckRawVolume * * Check the raw volume for consistency. */ vpResult VPCheckRawVolume(vpc) vpContext *vpc; { int retcode; if ((retcode = VPCheckVoxelFields(vpc)) != VP_OK) return(retcode); if (vpc->xlen <= 0 || vpc->ylen <= 0 || vpc->zlen <= 0) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); if (vpc->raw_voxels == NULL) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); if (vpc->raw_bytes_per_voxel * vpc->xlen * vpc->ylen * vpc->zlen != vpc->raw_voxels_size) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); return(VP_OK); } /* * VPCheckClassifiedVolume * * Check the classified volume for consistency. */ vpResult VPCheckClassifiedVolume(vpc, axis) vpContext *vpc; int axis; { int retcode; if ((retcode = VPCheckVoxelFields(vpc)) != VP_OK) return(retcode); if (vpc->xlen <= 0 || vpc->ylen <= 0 || vpc->zlen <= 0) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); if (vpc->rle_bytes_per_voxel == 0) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); switch (axis) { case VP_X_AXIS: if (vpc->rle_x == NULL) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); ASSERT(vpc->rle_x->ilen == vpc->ylen); ASSERT(vpc->rle_x->jlen == vpc->zlen); ASSERT(vpc->rle_x->klen == vpc->xlen); break; case VP_Y_AXIS: if (vpc->rle_y == NULL) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); ASSERT(vpc->rle_y->ilen == vpc->zlen); ASSERT(vpc->rle_y->jlen == vpc->xlen); ASSERT(vpc->rle_y->klen == vpc->ylen); break; case VP_Z_AXIS: if (vpc->rle_z == NULL) return(VPSetError(vpc, VPERROR_BAD_VOLUME)); ASSERT(vpc->rle_z->ilen == vpc->xlen); ASSERT(vpc->rle_z->jlen == vpc->ylen); ASSERT(vpc->rle_z->klen == vpc->zlen); break; default: VPBug("bad axis in VPCheckClassifiedVolume"); } return(VP_OK); } /* * VPCheckClassifier * * Check the classification parameters for consistency. */ vpResult VPCheckClassifier(vpc) vpContext *vpc; { int p, f; int retcode; if ((retcode = VPCheckVoxelFields(vpc)) != VP_OK) return(retcode); if (vpc->num_shade_fields <= 0 || vpc->num_shade_fields > vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VOXEL)); if (vpc->num_clsfy_params <= 0 || vpc->num_clsfy_params > vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_VOXEL)); for (p = 0; p < vpc->num_clsfy_params; p++) { f = vpc->param_field[p]; if (f < 0 || f >= vpc->num_voxel_fields) return(VPSetError(vpc, VPERROR_BAD_CLASSIFIER)); if (vpc->clsfy_table[p] == NULL || vpc->clsfy_table_size[p] != (vpc->field_max[f]+1)*sizeof(float)) return(VPSetError(vpc, VPERROR_BAD_CLASSIFIER)); if (p > 0 && f <= vpc->param_field[p-1]) return(VPSetError(vpc, VPERROR_BAD_CLASSIFIER)); } return(VP_OK); } /* * VPCheckShader * * Check the shading parameters for consistency. */ vpResult VPCheckShader(vpc) vpContext *vpc; { if (vpc->shading_mode == LOOKUP_SHADER) { if (vpc->color_field < 0 || vpc->color_field >= vpc->num_voxel_fields || vpc->color_field >= vpc->num_shade_fields) return(VPSetError(vpc, VPERROR_BAD_SHADER)); if (vpc->shade_color_table == NULL) return(VPSetError(vpc, VPERROR_BAD_SHADER)); if (vpc->shade_color_table_size != vpc->color_channels*sizeof(float)* (vpc->field_max[vpc->color_field]+1)*vpc->num_materials) return(VPSetError(vpc, VPERROR_BAD_SHADER)); if (vpc->field_size[vpc->color_field] != 2) return(VPSetError(vpc, VPERROR_BAD_SHADER)); if (vpc->num_materials < 1) return(VPSetError(vpc, VPERROR_BAD_SHADER)); if (vpc->num_materials > 1) { if (vpc->weight_field < 0 || vpc->weight_field >= vpc->num_voxel_fields || vpc->weight_field >= vpc->num_shade_fields) return(VPSetError(vpc, VPERROR_BAD_SHADER)); if (vpc->shade_weight_table == NULL) return(VPSetError(vpc, VPERROR_BAD_SHADER)); if (vpc->shade_weight_table_size != (vpc->field_max[vpc->weight_field]+1) * sizeof(float) * vpc->num_materials) return(VPSetError(vpc, VPERROR_BAD_SHADER)); if (vpc->field_size[vpc->weight_field] != 1) return(VPSetError(vpc, VPERROR_BAD_SHADER)); } } return(VP_OK); } /* * VPCheckImage * * Check the image buffer for validity. */ vpResult VPCheckImage(vpc) vpContext *vpc; { if (vpc->image == NULL || vpc->image_width <= 0 || vpc->image_height <= 0) return(VPSetError(vpc, VPERROR_BAD_IMAGE)); switch (vpc->pixel_type) { case VP_ALPHA: break; case VP_LUMINANCE: case VP_LUMINANCEA: if (vpc->color_channels != 1) return(VPSetError(vpc, VPERROR_BAD_OPTION)); break; case VP_RGB: case VP_BGR: case VP_RGBA: case VP_ABGR: if (vpc->color_channels != 3) return(VPSetError(vpc, VPERROR_BAD_OPTION)); break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } return(VP_OK); } /* * VPCheckShadows * * Check the shadow specification for validity. */ vpResult VPCheckShadows(vpc) vpContext *vpc; { if (vpc->enable_shadows) { if (vpc->shadow_light_num < VP_LIGHT0 || vpc->shadow_light_num > VP_LIGHT5) return(VPSetError(vpc, VPERROR_BAD_OPTION)); if (!vpc->light_enable[vpc->shadow_light_num - VP_LIGHT0]) vpc->enable_shadows = 0; if (vpc->shadow_color_table_size != vpc->shade_color_table_size || vpc->shadow_color_table == NULL) return(VPSetError(vpc, VPERROR_BAD_SIZE)); } return(VP_OK); } /* * vpGetError * * Return the error code from the first invalid command since the last * call to vpGetError(). */ vpResult vpGetError(vpc) vpContext *vpc; { vpResult code; code = vpc->error_code; vpc->error_code = VP_OK; return(code); } /* * vpGetErrorString * * Return a descriptive string for an error code. */ char * vpGetErrorString(code) vpResult code; { if (code == VP_OK) return("no error"); else if (code < VPERROR_FIRST || code > VPERROR_LAST) return(NULL); else return(ErrorString[code - VPERROR_FIRST]); } /* * VPSetError * * Set the error code in vpc. */ vpResult VPSetError(vpContext* vpc, vpResult code) { if (vpc && vpc->error_code == VP_OK) vpc->error_code = code; return(code); } ccseapps-2.5/CCSEApps/volpack/makeopts.c0000644000175000017500000000531111634153073021305 0ustar amckinstryamckinstry/* * makeopts.c * * Create a C source file containing an initialized string with the * compiler options used to compile VolPack. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:02 $ * $Revision: 1.3 $ */ #include #include /* * Usage: makeopts output_file [compiler_options ...] */ int main(argc, argv) int argc; char **argv; { FILE *fp; int c; if (argc < 2) { fprintf(stderr, "Usage: %s output_file [compiler_options ...]\n", argv[0]); exit(1); } if ((fp = fopen(argv[1], "w")) == NULL) { fprintf(stderr, "%s: could not open %s\n", argv[0], argv[1]); exit(1); } fprintf(fp, "/*\n"); fprintf(fp, " * DO NOT EDIT THIS FILE! It was created automatically by %s.\n", argv[0]); fprintf(fp, " */\n\n"); fprintf(fp, "char *vpCompilerOptions = \""); for (c = 2; c < argc; c++) { if (c > 2) fprintf(fp, " "); fprintf(fp, "%s", argv[c]); } fprintf(fp, "\";\n"); exit(0); } ccseapps-2.5/CCSEApps/volpack/vp_warp.c0000644000175000017500000003723611634153073021153 0ustar amckinstryamckinstry/* * vp_warp.c * * Support routines for 1-pass image warping. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:05 $ * $Revision: 1.3 $ */ #include "vp_global.h" /* weights for bilirp filter; index with (yfrac, xfrac, tap number) */ float VPBilirpWeight[WARP_WEIGHT_ENTRIES][WARP_WEIGHT_ENTRIES][4]; static int BilirpWeightsReady = 0; /* true if weight table initialized */ static void OrderCoords ANSI_ARGS((double coords[4][2], double lft[3][2], double rgt[3][2])); /* * VPComputeWarpTables * * Precompute lookup tables for fast filter convolution during warping. */ void VPComputeWarpTables() { float *wptr; /* pointer into weight table */ int x, y; double in_x, in_y; if (BilirpWeightsReady) return; #ifdef MEMSPY bin_init(BinNumber(__LINE__, __FILE__, "VPBilirpWeight"), -1, -1, VPBilirpWeight, sizeof(VPBilirpWeight), "VPBilirpWeight"); #endif wptr = &VPBilirpWeight[0][0][0]; for (y = 0; y < WARP_WEIGHT_ENTRIES; y++) { in_y = (double)y / (WARP_WEIGHT_ENTRIES-1); for (x = 0; x < WARP_WEIGHT_ENTRIES; x++) { in_x = (double)x / (WARP_WEIGHT_ENTRIES-1); *wptr++ = (1. - in_x)*(1. - in_y); *wptr++ = in_x * (1. - in_y); *wptr++ = (1. - in_x) * in_y; *wptr = 1. - wptr[-1] - wptr[-2] - wptr[-3]; ++wptr; } } BilirpWeightsReady = 1; } /* * VPAffineComputeImageOverlap * * Compute the intersection of the intermediate image and the final image. * This intersection is broken up into a series of trapezoids whose * bases are parallel to the scanlines of the final image (for ease * of scan conversion). Two sets of trapezoids are computed: one set * gives the region of the final image for which the filter kernel is * completely contained within the intermedaite image. The second set of * trapezoids gives the region of the final image for which the filter * kernel overlaps at least some of the intermedaite image, but may or may not * be completely contained. Any region of the final image which is not * within the second set of trapezoids is not affected by the intermediate * image at all and should be set to the background color. */ void VPAffineImageOverlap(in_width, in_height, out_width, out_height, warp_matrix, filter_width, full_overlap, part_overlap) int in_width, in_height; /* input (intermediate) image size */ int out_width, out_height; /* output (final) image size */ vpMatrix3 warp_matrix; /* affine transformation from input image to output image */ double filter_width; /* filter kernel width in input image coordinates */ Trapezoid full_overlap[9]; /* portion of the intersection with full filter kernel overlap */ Trapezoid part_overlap[9]; /* portion of the intersection with partial filter kernel overlap */ { double int_lft[3][2]; /* coordinates bounding the left side of the full_overlap region in output coordinates, sorted from top (lowest y) to bottom */ double int_rgt[3][2]; /* right side of full_overlap region */ double ext_lft[3][2]; /* left side of part_overlap region */ double ext_rgt[3][2]; /* right side of part_overlap region */ double coords[4][2]; double inset; int ilft, irgt, elft, ergt; int region; int lasty, nexty, y; /* compute the bounding box of the full_overlap region and store it in int_lft and int_rgt */ inset = -1.0 + filter_width / 2.0 + 1.0e-5; coords[0][0] = warp_matrix[0][0] * inset + warp_matrix[0][1] * inset + warp_matrix[0][2]; coords[0][1] = warp_matrix[1][0] * inset + warp_matrix[1][1] * inset + warp_matrix[1][2]; coords[1][0] = warp_matrix[0][0] * (in_width - 1 - inset) + warp_matrix[0][1] * inset + warp_matrix[0][2]; coords[1][1] = warp_matrix[1][0] * (in_width - 1 - inset) + warp_matrix[1][1] * inset + warp_matrix[1][2]; coords[2][0] = warp_matrix[0][0] * (in_width - 1 - inset) + warp_matrix[0][1] * (in_height - 1 - inset) + warp_matrix[0][2]; coords[2][1] = warp_matrix[1][0] * (in_width - 1 - inset) + warp_matrix[1][1] * (in_height - 1 - inset) + warp_matrix[1][2]; coords[3][0] = warp_matrix[0][0] * inset + warp_matrix[0][1] * (in_height - 1 - inset) + warp_matrix[0][2]; coords[3][1] = warp_matrix[1][0] * inset + warp_matrix[1][1] * (in_height - 1 - inset) + warp_matrix[1][2]; OrderCoords(coords, int_lft, int_rgt); /* compute the bounding box of the part_overlap region and store it in int_lft and int_rgt */ inset = -filter_width / 2.0; coords[0][0] = warp_matrix[0][0] * inset + warp_matrix[0][1] * inset + warp_matrix[0][2]; coords[0][1] = warp_matrix[1][0] * inset + warp_matrix[1][1] * inset + warp_matrix[1][2]; coords[1][0] = warp_matrix[0][0] * (in_width - 1 - inset) + warp_matrix[0][1] * inset + warp_matrix[0][2]; coords[1][1] = warp_matrix[1][0] * (in_width - 1 - inset) + warp_matrix[1][1] * inset + warp_matrix[1][2]; coords[2][0] = warp_matrix[0][0] * (in_width - 1 - inset) + warp_matrix[0][1] * (in_height - 1 - inset) + warp_matrix[0][2]; coords[2][1] = warp_matrix[1][0] * (in_width - 1 - inset) + warp_matrix[1][1] * (in_height - 1 - inset) + warp_matrix[1][2]; coords[3][0] = warp_matrix[0][0] * inset + warp_matrix[0][1] * (in_height - 1 - inset) + warp_matrix[0][2]; coords[3][1] = warp_matrix[1][0] * inset + warp_matrix[1][1] * (in_height - 1 - inset) + warp_matrix[1][2]; OrderCoords(coords, ext_lft, ext_rgt); for (ilft = 0; ilft < 3 && int_lft[ilft][1] <= 0.; ilft++); for (irgt = 0; irgt < 3 && int_rgt[irgt][1] <= 0.; irgt++); for (elft = 0; elft < 3 && ext_lft[elft][1] <= 0.; elft++); for (ergt = 0; ergt < 3 && ext_rgt[ergt][1] <= 0.; ergt++); region = 0; lasty = -1; while (lasty < out_height-1) { ASSERT(region < 9); /* find nexty */ nexty = out_height - 1; if (ilft < 3) { y = (int)floor(int_lft[ilft][1]); if (nexty > y) nexty = y; } if (irgt < 3) { y = (int)floor(int_rgt[irgt][1]); if (nexty > y) nexty = y; } if (elft < 3) { y = (int)floor(ext_lft[elft][1]); if (nexty > y) nexty = y; } if (ergt < 3) { y = (int)floor(ext_rgt[ergt][1]); if (nexty > y) nexty = y; } ASSERT((ilft == 0 && (int)floor(int_lft[0][1]) >= nexty) || (ilft == 3 && (int)floor(int_lft[2][1]) <= lasty) || (((int)floor(int_lft[ilft-1][1]) <= lasty || lasty == -1) && (int)floor(int_lft[ilft][1]) >= nexty)); ASSERT((irgt == 0 && (int)floor(int_rgt[0][1]) >= nexty) || (irgt == 3 && (int)floor(int_rgt[2][1]) <= lasty) || (((int)floor(int_rgt[irgt-1][1]) <= lasty || lasty == -1) && (int)floor(int_rgt[irgt][1]) >= nexty)); ASSERT((elft == 0 && (int)floor(ext_lft[0][1]) >= nexty) || (elft == 3 && (int)floor(ext_lft[2][1]) <= lasty) || (((int)floor(ext_lft[elft-1][1]) <= lasty || lasty == -1) && (int)floor(ext_lft[elft][1]) >= nexty)); ASSERT((ergt == 0 && (int)floor(ext_rgt[0][1]) >= nexty) || (ergt == 3 && (int)floor(ext_rgt[2][1]) <= lasty) || (((int)floor(ext_rgt[ergt-1][1]) <= lasty || lasty == -1) && (int)floor(ext_rgt[ergt][1]) >= nexty)); full_overlap[region].miny = lasty + 1; full_overlap[region].maxy = nexty; part_overlap[region].miny = lasty + 1; part_overlap[region].maxy = nexty; if (ilft == 0 || ilft == 3) { /* this trapezoid does not intersect full_overlap */ full_overlap[region].x_top_lft = 0; full_overlap[region].x_top_rgt = -1; full_overlap[region].x_incr_lft = 0; full_overlap[region].x_incr_rgt = 0; } else { full_overlap[region].x_incr_lft = (int_lft[ilft][0] - int_lft[ilft-1][0]) / (int_lft[ilft][1] - int_lft[ilft-1][1]); full_overlap[region].x_top_lft = int_lft[ilft-1][0] + (lasty+1 - int_lft[ilft-1][1]) * full_overlap[region].x_incr_lft; full_overlap[region].x_incr_rgt = (int_rgt[irgt][0] - int_rgt[irgt-1][0]) / (int_rgt[irgt][1] - int_rgt[irgt-1][1]); full_overlap[region].x_top_rgt = int_rgt[irgt-1][0] + (lasty+1 - int_rgt[irgt-1][1]) * full_overlap[region].x_incr_rgt; } if (elft == 0 || elft == 3) { /* this trapezoid does not intersect part_overlap */ part_overlap[region].x_top_lft = 0; part_overlap[region].x_top_rgt = -1; part_overlap[region].x_incr_lft = 0; part_overlap[region].x_incr_rgt = 0; } else { part_overlap[region].x_incr_lft = (ext_lft[elft][0] - ext_lft[elft-1][0]) / (ext_lft[elft][1] - ext_lft[elft-1][1]); part_overlap[region].x_top_lft = ext_lft[elft-1][0] + (lasty+1 - ext_lft[elft-1][1]) * part_overlap[region].x_incr_lft; part_overlap[region].x_incr_rgt = (ext_rgt[ergt][0] - ext_rgt[ergt-1][0]) / (ext_rgt[ergt][1] - ext_rgt[ergt-1][1]); part_overlap[region].x_top_rgt = ext_rgt[ergt-1][0] + (lasty+1 - ext_rgt[ergt-1][1]) * part_overlap[region].x_incr_rgt; } ASSERT(!(full_overlap[region].x_top_lft <= full_overlap[region].x_top_rgt && part_overlap[region].x_top_lft > part_overlap[region].x_top_rgt)); for (; ilft < 3 && (int)floor(int_lft[ilft][1]) <= nexty; ilft++); for (; irgt < 3 && (int)floor(int_rgt[irgt][1]) <= nexty; irgt++); for (; elft < 3 && (int)floor(ext_lft[elft][1]) <= nexty; elft++); for (; ergt < 3 && (int)floor(ext_rgt[ergt][1]) <= nexty; ergt++); region++; lasty = nexty; } for (; region < 9; region++) { full_overlap[region].miny = out_height; full_overlap[region].maxy = out_height; part_overlap[region].miny = out_height; part_overlap[region].maxy = out_height; full_overlap[region].x_top_lft = 0; full_overlap[region].x_top_rgt = -1; full_overlap[region].x_incr_lft = 0; full_overlap[region].x_incr_rgt = 0; part_overlap[region].x_top_lft = 0; part_overlap[region].x_top_rgt = -1; part_overlap[region].x_incr_lft = 0; part_overlap[region].x_incr_rgt = 0; } #ifdef DEBUG_OVERLAP for (region = 0; region < 9; region++) { printf("region %d: y = %d to %d, [%d+%g [%d+%g %d+%g] %d+%g]\n", region, full_overlap[region].miny, full_overlap[region].maxy, (int)part_overlap[region].x_top_lft, part_overlap[region].x_incr_lft, (int)full_overlap[region].x_top_lft, full_overlap[region].x_incr_lft, (int)full_overlap[region].x_top_rgt, full_overlap[region].x_incr_rgt, (int)part_overlap[region].x_top_rgt, part_overlap[region].x_incr_rgt); } #endif } /* * OrderCoords * * Sort an array of coordinates. */ static void OrderCoords(coords, lft, rgt) double coords[4][2]; /* inputs */ double lft[3][2]; /* outputs */ double rgt[3][2]; { int index; double sorted_coords[4][2]; double xmid; /* sort the coordinates as follows: coords[0]: smallest y value; if there is a tie, then smallest x value to break the tie; this is the top or top left corner coords[1]: next coordinate in CCW order; this is the left or bottom left corner coords[2]: next coordinate in CCW order; this is the bottom or bottom right corner coords[3]: next coordinate in CCW order; this is the right or top right corner */ /* search for coords[0] */ index = 0; if (coords[1][1] < coords[index][1] || (coords[1][1] == coords[index][1] && coords[1][0] < coords[index][0])) index = 1; if (coords[2][1] < coords[index][1] || (coords[2][1] == coords[index][1] && coords[2][0] < coords[index][0])) index = 2; if (coords[3][1] < coords[index][1] || (coords[3][1] == coords[index][1] && coords[3][0] < coords[index][0])) index = 3; sorted_coords[0][0] = coords[index][0]; sorted_coords[0][1] = coords[index][1]; /* coords[2] is the opposite corner */ sorted_coords[2][0] = coords[(index+2)%4][0]; sorted_coords[2][1] = coords[(index+2)%4][1]; /* determine which of the remaining two coordinates is to the left of the line joining coords[0] and coords[2]; this coordinate is coords[1], and the final remaining coordinate is coords[3] */ index = (index + 1) % 4; if (fabs(sorted_coords[0][1] - sorted_coords[2][1]) < VP_EPS) { /* input image is degenerate (transforms to a horizontal line) */ lft[0][0] = sorted_coords[0][0]; lft[0][1] = sorted_coords[0][1]; lft[1][0] = sorted_coords[0][0]; lft[1][1] = sorted_coords[0][1]; lft[2][0] = sorted_coords[0][0]; lft[2][1] = sorted_coords[0][1]; rgt[0][0] = sorted_coords[2][0]; rgt[0][1] = sorted_coords[2][1]; rgt[1][0] = sorted_coords[2][0]; rgt[1][1] = sorted_coords[2][1]; rgt[2][0] = sorted_coords[2][0]; rgt[2][1] = sorted_coords[2][1]; return; } xmid = sorted_coords[0][0] + (coords[index][1] - sorted_coords[0][1]) * (sorted_coords[2][0] - sorted_coords[0][0]) / (sorted_coords[2][1] - sorted_coords[0][1]); if (coords[index][0] < xmid) { sorted_coords[1][0] = coords[index][0]; sorted_coords[1][1] = coords[index][1]; sorted_coords[3][0] = coords[(index+2)%4][0]; sorted_coords[3][1] = coords[(index+2)%4][1]; } else { sorted_coords[1][0] = coords[(index+2)%4][0]; sorted_coords[1][1] = coords[(index+2)%4][1]; sorted_coords[3][0] = coords[index][0]; sorted_coords[3][1] = coords[index][1]; } /* store the results in the output array */ lft[0][0] = sorted_coords[0][0]; lft[0][1] = sorted_coords[0][1]; lft[1][0] = sorted_coords[1][0]; lft[1][1] = sorted_coords[1][1]; if (sorted_coords[1][1] == sorted_coords[2][1]) { lft[2][0] = sorted_coords[1][0]; lft[2][1] = sorted_coords[1][1]; } else { lft[2][0] = sorted_coords[2][0]; lft[2][1] = sorted_coords[2][1]; } if (sorted_coords[0][1] == sorted_coords[3][1]) { rgt[0][0] = sorted_coords[3][0]; rgt[0][1] = sorted_coords[3][1]; rgt[1][0] = sorted_coords[2][0]; rgt[1][1] = sorted_coords[2][1]; rgt[2][0] = sorted_coords[2][0]; rgt[2][1] = sorted_coords[2][1]; } else { rgt[0][0] = sorted_coords[0][0]; rgt[0][1] = sorted_coords[0][1]; rgt[1][0] = sorted_coords[3][0]; rgt[1][1] = sorted_coords[3][1]; rgt[2][0] = sorted_coords[2][0]; rgt[2][1] = sorted_coords[2][1]; } } ccseapps-2.5/CCSEApps/volpack/Makefile0000644000175000017500000001110611634153073020755 0ustar amckinstryamckinstry# (c) 1996-2000 The Regents of # the University of California (through E.O. Lawrence Berkeley National # Laboratory), subject to approval by the U.S. Department of Energy. # Your use of this software is under license -- the license agreement is # attached and included in the directory as license.txt or you may # contact Berkeley Lab's Technology Transfer Department at TTD@lbl.gov. # NOTICE OF U.S. GOVERNMENT RIGHTS. The Software was developed under # funding from the U.S. Government which consequently retains certain # rights as follows: the U.S. Government has been granted for itself and # others acting on its behalf a paid-up, nonexclusive, irrevocable, # worldwide license in the Software to reproduce, prepare derivative # works, and perform publicly and display publicly. Beginning five (5) # years after the date permission to assert copyright is obtained from # the U.S. Department of Energy, and subject to any subsequent five (5) # year renewals, the U.S. Government is granted for itself and others # acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide # license in the Software to reproduce, prepare derivative works, # distribute copies to the public, perform publicly and display # publicly, and to permit others to do so. COMP := KCC COMP := xlc COMP := Intel COMP := g++ DEBUG := TRUE DEBUG := FALSE #PROFILE := TRUE include Include.mk M4 := m4 M4FLAGS := -s M4FLAGS := RANLIB := ranlib # loop unrolling optimization: if the following line is not commented # out then the library will be built with a special version of the # rendering code that has been hand-optimized; use this unless your # compiler's optimizer has trouble with procedures that have a large # number of basic blocks #CPPFLAGS += -DUNROLL_RUN_LOOP CPPFLAGS += -DUSE_TIMER ifeq ($(DEBUG),TRUE) CPPFLAGS += -DDEBUG endif ifeq ($(MPI),ON) CPPFLAGS += -DVP_MPI endif # list of optional C source files to build with code specialized # for particular shaders and resampling filters optional_comp_sources = vp_compAC11B.c vp_compAC31B.c vp_compAC32B.c \ vp_compAR11B.c vp_compAR31B.c vp_compAR32B.c optional_comp_objects = $(optional_comp_sources:.c=.o) # C define flags corresponding to COMP_SRCS; these tell the dispatch # routines in the library which object files are available CPPFLAGS += -DCOMP_AC11B -DCOMP_AC31B -DCOMP_AC32B \ -DCOMP_AR11B -DCOMP_AR31B -DCOMP_AR32B CPPFLAGS += -I. c_sources = vp_check.c vp_context.c vp_extract.c vp_file.c vp_linalg.c vp_octree.c \ vp_renderA.c vp_renderB.c vp_renderC.c vp_renderR.c vp_resample.c \ vp_rle.c vp_shade.c vp_transpose.c vp_util.c vp_view.c vp_warp.c c_headers = volpack.h vp_global.h m4_sources = vp_CompA.m4 vp_WarpA.m4 comp_sources = vp_compAC1NB.c vp_compAC3NB.c vp_compAR1NB.c vp_compAR3NB.c \ vp_compAC1PB.c vp_compAC3PB.c vp_compAR1PB.c vp_compAR3PB.c \ vp_compAC00G.c vp_compAR00G.c vp_compAC1NS.c vp_compAC3NS.c \ vp_compAR1NS.c vp_compAR3NS.c $(optional_comp_sources) comp_objects = $(comp_sources:.c=.o) $(optional_comp_objects) warp_sources = vp_warpA101N.c vp_warpA301N.c vp_warpA110N.c vp_warpA111N.c \ vp_warpA330N.c vp_warpA331N.c vp_warpA330R.c vp_warpA331R.c warp_objects = $(warp_sources:.c=.o) generated = vp_opts.c $(comp_sources) $(warp_sources) objects = $(c_sources:.c=.o) vp_opts.o $(comp_objects) $(warp_objects) comp_input = no_edit_header vp_CompA.m4 warp_input = no_edit_header vp_WarpA.m4 sources = $(c_sources) $(c_headers) $(m4_sources) all: libvolpack.a TAGS: $(sources) etags $(sources) libvolpack.a: $(objects) $(RM) libvolpack.a $(AR) $(ARFLAGS) libvolpack.a $(objects) $(RANLIB) libvolpack.a $(objects): volpack.h vp_global.h makeopts: makeopts.c $(CC) -o makeopts makeopts.c vp_opts.c: makeopts Makefile Include.mk ./makeopts vp_opts.c $(CXXFLAGS) $(CPPFLAGS) vp_compA%.c: $(comp_input) @$(RM) $@ @echo "$(M4) $(M4FLAGS) -DSourceFile=$@ $(comp_input) > $@" @$(M4) $(M4FLAGS) -DSourceFile=$@ $(comp_input) > $@ @chmod -w $@ vp_warpA%.c: $(warp_input) @$(RM) $@ @echo "$(M4) $(M4FLAGS) -DSourceFile=$@ $(warp_input) > $@" @$(M4) $(M4FLAGS) -DSourceFile=$@ $(warp_input) > $@ @chmod -w $@ examples: libvolpack.a make -C examples COMP=$(COMP) MPI=$(MPI) DEBUG=$(DEBUG) PROFILE=$(PROFILE) clean: $(RM) $(objects) $(generated) makeopts rm -f libvolpack.a $(RM) TAGS $(RM) *~ make -C examples clean realclean: clean .PHONY: clean examples .PRECIOUS: $(generated) ifndef COMPILE.cpp LINK.cpp = $(LINK.cc) COMPILE.cpp=$(COMPILE.cc) %.cpp: %: %.cpp $(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@ %.o: %.cpp $(COMPILE.cpp) $< $(OUTPUT_OPTION) endif ccseapps-2.5/CCSEApps/volpack/makeoctree.dsp0000644000175000017500000001113411634153073022145 0ustar amckinstryamckinstry# Microsoft Developer Studio Project File - Name="makeoctree" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=makeoctree - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "makeoctree.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "makeoctree.mak" CFG="makeoctree - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "makeoctree - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "makeoctree - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe F90=df.exe RSC=rc.exe !IF "$(CFG)" == "makeoctree - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE F90 /compile_only /nologo /warn:nofileopt # ADD F90 /compile_only /nologo /warn:nofileopt # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /W1 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "makeoctree - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "makeoctree___Win32_Debug" # PROP BASE Intermediate_Dir "makeoctree___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "makeoctree___Win32_Debug" # PROP Intermediate_Dir "makeoctree___Win32_Debug" # PROP Target_Dir "" # ADD BASE F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD F90 /check:bounds /compile_only /dbglibs /debug:full /nologo /traceback /warn:argument_checking /warn:nofileopt # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W1 /Gm /GX /ZI /Od /I "." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "makeoctree - Win32 Release" # Name "makeoctree - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;f90;for;f;fpp" # Begin Source File SOURCE=.\examples\makeoctree.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project ccseapps-2.5/CCSEApps/volpack/vp_linalg.c0000644000175000017500000002053011634153073021435 0ustar amckinstryamckinstry/* * vp_linalg.c * * A simple linear algebra package. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:03 $ * $Revision: 1.3 $ */ #include "vp_global.h" static void MatrixMult ANSI_ARGS((double* p, double *a, double *b, int l, int m, int n)); /* * vpIdentity3 * * Initialize a Matrix3 to the identity. */ void vpIdentity3(m) vpMatrix3 m; { m[0][0] = 1.; m[0][1] = 0.; m[0][2] = 0.; m[1][0] = 0.; m[1][1] = 1.; m[1][2] = 0.; m[2][0] = 0.; m[2][1] = 0.; m[2][2] = 1.; } /* * vpIdentity4 * * Initialize a Matrix4 to the identity. */ void vpIdentity4(m) vpMatrix4 m; { m[0][0] = 1.; m[0][1] = 0.; m[0][2] = 0.; m[0][3] = 0.; m[1][0] = 0.; m[1][1] = 1.; m[1][2] = 0.; m[1][3] = 0.; m[2][0] = 0.; m[2][1] = 0.; m[2][2] = 1.; m[2][3] = 0.; m[3][0] = 0.; m[3][1] = 0.; m[3][2] = 0.; m[3][3] = 1.; } /* * vpNormalize3 * * Normalize a vector (divide it by its magnitude). Return VPERROR_SINGULAR * if the magnitude is too small. */ vpResult vpNormalize3(v) vpVector3 v; { double magsqr, invmag; int i; magsqr = 0.; for (i = 0; i < 3; i++) magsqr += v[i]*v[i]; if (fabs(magsqr) < VP_EPS) return(VPERROR_SINGULAR); invmag = 1. / sqrt(magsqr); for (i = 0; i < 3; i++) v[i] *= invmag; return(VP_OK); } /* * vpMatrixVectorMult4 * * Perform the matrix-vector multiplication v2 = m*v1. */ void vpMatrixVectorMult4(v2, m, v1) vpVector4 v2, v1; vpMatrix4 m; { int i, j; for (i = 0; i < 4; i++) { v2[i] = 0; for (j = 0; j < 4; j++) v2[i] += m[i][j] * v1[j]; } } /* * vpMatrixMult4 * * Perform the matrix multiplication m3 = m2 * m1. */ void vpMatrixMult4(m3, m2, m1) vpMatrix4 m3, m2, m1; { MatrixMult((double *)m3, (double *)m2, (double *)m1, 4, 4, 4); } /* * MatrixMult * * Perform the matrix multiplication p = a * b. */ static void MatrixMult(p, a, b, l, m, n) double *p; /* result matrix, size l by n */ double *a; /* first factor, size l by m */ double *b; /* second factor, size m by n */ int l, m, n; { int i, j, k; if (l <= 0 || m <= 0 || n <= 0) VPBug("MatrixMult called with non-positive matrix size"); for (i = 0; i < l; i++) { for (j = 0; j < n; j++) { p[i*n+j] = 0; for (k = 0; k < m; k++) p[i*n+j] += a[i*n+k] * b[k*n+j]; } } } /* * vpCrossProduct * * Compute the cross product p = v * w. */ void vpCrossProduct(p, v, w) vpVector3 p, v, w; { p[0] = v[1]*w[2] - v[2]*w[1]; p[1] = v[2]*w[0] - v[0]*w[2]; p[2] = v[0]*w[1] - v[1]*w[0]; } /* * vpSolveSystem4 * * Solve the linear system a*xi = bi where a is a 4-by-4 matrix and bi * is a column of the 4-by-m matrix b. Each column bi in b is replaced * by the corresponding solution vector xi. The matrix a is destroyed. * The method used is Gauss-Jordan elimination with partial pivoting and * implicit scaling (based on the discussion in Numerical Recipes in C * by Press, Flannery, Teukolsky and Vetterling). * * Return VPERROR_SINGULAR if matrix is singular. */ vpResult vpSolveSystem4(a, b, m) vpMatrix4 a; /* linear system matrix */ double **b; /* RHS vectors on input, solution vectors on output; b[i] is a Vector4 */ int m; /* number of vectors in b */ { vpVector4 row_scale_factor; /* normalization for each row */ int ipivot; /* row containing pivot */ int pivot[4]; /* after the reduction loop, row i has been pivoted to row pivot[i] */ int i, j, k, l; /* loop indices */ double *aptr; /* pointer into a */ double entry; /* entry in a */ double max_entry; /* maximum entry in row */ double inv_entry; /* inverse of an entry in a */ vpVector4 tmpv; /* temporary vector for undoing row interchange in solution vectors */ /* initialize */ for (i = 0; i < 4; i++) pivot[i] = -1; /* find the largest element in each row and compute normalization for implicit scaling */ aptr = &a[0][0]; for (i = 0; i < 4; i++) { max_entry = 0.; for (j = 0; j < 4; j++) { if (*aptr < 0) { if (-*aptr > max_entry) max_entry = -*aptr; } else { if (*aptr > max_entry) max_entry = *aptr; } aptr++; } if (fabs(max_entry) < VP_EPS) return(VPERROR_SINGULAR); row_scale_factor[i] = 1. / max_entry; } /* loop over the columns of a */ for (j = 0; j < 4; j++) { /* loop over the rows of a and choose a pivot element in the current column, ignoring rows containing previous pivots */ max_entry = 0.; for (i = 0; i < 4; i++) { if (pivot[i] < 0) { entry = a[i][j] * row_scale_factor[i]; if (entry < 0) { if (-entry > max_entry) { max_entry = -entry; ipivot = i; } } else { if (entry > max_entry) { max_entry = entry; ipivot = i; } } } } if (fabs(max_entry) < VP_EPS) return(VPERROR_SINGULAR); pivot[ipivot] = j; inv_entry = 1. / a[ipivot][j]; /* scale the pivot row by the pivot element */ for (l = j+1; l < 4; l++) a[ipivot][l] *= inv_entry; for (l = 0; l < m; l++) b[l][ipivot] *= inv_entry; /* subtract a multiple of the pivot row from the other rows */ for (k = 0; k < 4; k++) { if (k != ipivot) { entry = a[k][j]; for (l = j+1; l < 4; l++) a[k][l] -= a[ipivot][l] * entry; for (l = 0; l < m; l++) b[l][k] -= b[l][ipivot] * entry; } } } /* undo row interchanges in solution vectors */ for (j = 0; j < m; j++) { for (i = 0; i < 4; i++) tmpv[pivot[i]] = b[j][i]; for (i = 0; i < 4; i++) b[j][i] = tmpv[i]; } return(VP_OK); } /* * VPLoadTranslation * * Load a translation matrix. */ void VPLoadTranslation(m, tx, ty, tz) vpMatrix4 m; double tx, ty, tz; { vpIdentity4(m); m[0][3] = tx; m[1][3] = ty; m[2][3] = tz; } /* * VPLoadRotation * * Load a rotation matrix. */ void VPLoadRotation(m, axis, degrees) vpMatrix4 m; int axis; double degrees; { double radians, sintheta, costheta; double m_pi = 4.0*atan(1.0); radians = degrees * m_pi / 180.; sintheta = sin(radians); costheta = cos(radians); vpIdentity4(m); switch (axis) { case VP_X_AXIS: m[1][1] = costheta; m[1][2] = sintheta; m[2][1] = -sintheta; m[2][2] = costheta; break; case VP_Y_AXIS: m[0][0] = costheta; m[0][2] = -sintheta; m[2][0] = sintheta; m[2][2] = costheta; break; case VP_Z_AXIS: m[0][0] = costheta; m[0][1] = sintheta; m[1][0] = -sintheta; m[1][1] = costheta; break; default: VPBug("bad axis in VPLoadRotation"); } } /* * VPLoadScale * * Load a scale matrix. */ void VPLoadScale(m, sx, sy, sz) vpMatrix4 m; double sx, sy, sz; { vpIdentity4(m); m[0][0] = sx; m[1][1] = sy; m[2][2] = sz; } ccseapps-2.5/CCSEApps/volpack/Include.mk0000644000175000017500000000451711634153073021241 0ustar amckinstryamckinstry# (c) 1996-2000 The Regents of # the University of California (through E.O. Lawrence Berkeley National # Laboratory), subject to approval by the U.S. Department of Energy. # Your use of this software is under license -- the license agreement is # attached and included in the directory as license.txt or you may # contact Berkeley Lab's Technology Transfer Department at TTD@lbl.gov. # NOTICE OF U.S. GOVERNMENT RIGHTS. The Software was developed under # funding from the U.S. Government which consequently retains certain # rights as follows: the U.S. Government has been granted for itself and # others acting on its behalf a paid-up, nonexclusive, irrevocable, # worldwide license in the Software to reproduce, prepare derivative # works, and perform publicly and display publicly. Beginning five (5) # years after the date permission to assert copyright is obtained from # the U.S. Department of Energy, and subject to any subsequent five (5) # year renewals, the U.S. Government is granted for itself and others # acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide # license in the Software to reproduce, prepare derivative works, # distribute copies to the public, perform publicly and display # publicly, and to permit others to do so. ifndef COMP COMP = gcc endif ifndef DEBUG DEBUG = TRUE endif ifndef PROFILE PROFILE = FALSE endif ifeq ($(COMP),KCC) CXX = KCC CC = KCC --c endif ifeq ($(COMP),g++) CXX = g++ CC = gcc endif ifeq ($(COMP),CC) CXX = CC CC = cc endif ifeq ($(COMP),xlc) CXX = xlC CC = xlc endif ifeq ($(COMP),Intel) CXX = icc CC = icc endif ifeq ($(PROFILE),TRUE) CXXFLAGS += -pg endif ifneq ($(DEBUG),TRUE) CPPFLAGS += -DNDEBUG endif ifeq ($(COMP),KCC) CXXFLAGS += --strict CXXFLAGS += --display_error_number CXXFLAGS += --diag_suppress 450 CFLAGS += --strict CFLAGS += --display_error_number # CFLAGS += --diag_suppress 267 ifneq ($(DEBUG),FALSE) CXXFLAGS += +K0 -g CFLAGS += +K0 -g else CXXFLAGS += +K3 -O3 -g CFLAGS += +K3 -O3 -g endif else ifeq ($(COMP),g++) # CXXFLAGS += -ansi # CXXFLAGS += -Wall endif CXXFLAGS += -g -O CFLAGS += -g -O # CFLAGS += -ansi # CFLAGS += -Wall ifeq ($(DEBUG),FALSE) CXXFLAGS += -O3 CFLAGS += -O3 endif ifeq ($(COMP),Intel) CXXFLAGS += -axK CFLAGS += -axK endif endif ccseapps-2.5/CCSEApps/volpack/volpack.h0000644000175000017500000006357711634153073021150 0ustar amckinstryamckinstry/* * volpack.h * * Header file for VolPack. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2002/01/29 20:48:33 $ * $Revision: 1.4 $ */ #ifndef _VOLPACK #define _VOLPACK /******************************************************************* * Definitions to customize declarations for different C dialects. * *******************************************************************/ #ifdef __STDC__ #ifndef NO_PROTOTYPE #define ANSI_C #endif #endif #ifdef WIN32 #define ANSI_C #endif #ifdef __cplusplus #define ANSI_C #define EXTERN extern "C" #else #define EXTERN extern #endif #ifdef ANSI_C #define ANSI_ARGS(x) x #else #define ANSI_ARGS(x) () #endif /******************************************************************* * Configuration constants. * *******************************************************************/ #define VP_EPS 1.0e-11 /* smallest reasonable nonzero number */ #define VP_MAX_VOLUME_DIM 1024 /* maximum length of a voxel scanline */ #define VP_MAX_FIELDS 6 /* maximum number of fields in a voxel */ #define VP_MAX_MATERIAL 6 /* maximum number of materials in a volume */ #define VP_MAX_LIGHTS 6 /* maximum number of lights */ /* magic numbers for disk files */ #define VP_CVFILE_MAGIC 0x4F4F5F5F /* classified volume file */ #define VP_OCTFILE_MAGIC 0x4F4F6F6F /* min-max octree file */ #define VP_RVFILE_MAGIC 0x4F4F7F7F /* raw volume file */ #define VP_VPCFILE_MAGIC 0x4F4F8F8F /* rendering context dump */ #define VP_VERSION "1.1" /* version string */ #define VP_MAJOR_VERSION 1 /* major version number */ #define VP_MINOR_VERSION 1 /* minor version number */ /******************************************************************* * Global constants. * *******************************************************************/ /* options for vpGet* and vpSet* */ #define VP_XLEN 1000 /* x dimension of volume */ #define VP_YLEN 1001 /* y dimension of volume */ #define VP_ZLEN 1002 /* z dimension of volume */ #define VP_BYTES_PER_VOXEL 1003 /* size of raw voxel in bytes */ #define VP_VOXEL_FIELD_COUNT 1004 /* number of fields in a voxel */ #define VP_SHADE_FIELD_COUNT 1005 /* number of fields for shading */ #define VP_FIELD_SIZES 1006 /* size of each field */ #define VP_FIELD_OFFSETS 1007 /* byte offsets for each field */ #define VP_FIELD_MAXES 1008 /* max. value for each field */ #define VP_VOXEL_DATA 1009 /* pointer to voxel data */ #define VP_VOXEL_DATA_SIZE 1010 /* size of voxel data in bytes */ #define VP_VOXEL_XSTRIDE 1011 /* voxel data strides */ #define VP_VOXEL_YSTRIDE 1012 /* voxel data strides */ #define VP_VOXEL_ZSTRIDE 1013 /* voxel data strides */ #define VP_MIN_VOXEL_OPACITY 1014 /* thresh. for classification */ #define VP_CLASSIFY_FIELD_COUNT 1015 /* number of fields for classifier */ #define VP_CLASSIFY_FIELDS 1016 /* classification field numbers */ #define VP_CLASSIFY_TABLES 1017 /* classification tables */ #define VP_CLASSIFY_TABLE_SIZES 1018 /* classification table sizes */ #define VP_COLOR_CHANNELS 1019 /* number of color channels */ #define VP_SHADE_FUNC 1020 /* shading callback */ #define VP_GRAY_SHADE_FUNC 1021 /* grayscale shading function */ #define VP_RGB_SHADE_FUNC 1022 /* RGB shading function */ #define VP_SHADE_COLOR_TABLE 1023 /* shading color lookup table */ #define VP_SHADE_COLOR_SIZE 1024 /* size of shading color table */ #define VP_SHADE_WEIGHT_TABLE 1025 /* shading weight lookup table */ #define VP_SHADE_WEIGHT_SIZE 1026 /* size of shading weight table */ #define VP_SHADE_COLOR_FIELD 1027 /* field for color table index */ #define VP_SHADE_WEIGHT_FIELD 1028 /* field for weight table index */ #define VP_LIGHT_BOTH_SIDES 1029 /* use two-sided lighting */ #define VP_REVERSE_SURFACE_SIDES 1030 /* reverse interior and exterior */ #define VP_DEPTH_CUE 1031 /* depth cueing */ #define VP_DEPTH_CUE_FRONT 1032 /* depth cueing front factor */ #define VP_DEPTH_CUE_DENSITY 1034 /* depth cueing density */ #define VP_DEPTH_CUE_TABLE_SIZE 1035 /* # of entries in depth-cue table */ #define VP_DEPTH_CUE_SIZE_HINT 1036 /* hint for # of entries */ #define VP_DEPTH_CUE_QUANTIZATION 1037 /* smallest resolvable depth */ #define VP_CONCAT_MODE 1038 /* VP_CONCAT_LEFT or VP_CONCAT_RIGHT */ #define VP_IMAGE 1039 /* image array */ #define VP_IMAGE_WIDTH 1040 /* image width */ #define VP_IMAGE_HEIGHT 1041 /* image height */ #define VP_IMAGE_SCAN_SIZE 1042 /* bytes per scan in image */ #define VP_MAX_RAY_OPACITY 1043 /* thresh. for early ray termination */ #define VP_VIEW_AXIS 1044 /* principal viewing axis */ #define VP_INTERMEDIATE_WIDTH 1045 /* width of intermediate image */ #define VP_INTERMEDIATE_HEIGHT 1046 /* height of intermediate image */ #define VP_INTERMEDIATE_COLOR 1047 /* color channels in int. image */ #define VP_INT_WIDTH_HINT 1048 /* hint for intermediate image */ #define VP_INT_HEIGHT_HINT 1049 /* hint for intermediate height */ #define VP_VIEW_X_AXIS 1050 /* enable X viewing axis */ #define VP_VIEW_Y_AXIS 1051 /* enable Y viewing axis */ #define VP_VIEW_Z_AXIS 1052 /* enable Z viewing axis */ #define VP_VIEW_X_SIZE 1053 /* size of X view data */ #define VP_VIEW_Y_SIZE 1054 /* size of Y view data */ #define VP_VIEW_Z_SIZE 1055 /* size of Z view data */ #define VP_MMOCTREE_THRESHOLDS 1056 /* thresholds for min-max octree */ #define VP_MMOCTREE_SIZE 1057 /* size of min-max octree */ #define VP_LOG_ALLOC_FUNC 1058 /* function to log allocations */ #define VP_LOG_FREE_FUNC 1059 /* function to log deallocations */ #define VP_STATUS_FUNC 1060 /* function to give progress reports */ #define VP_READ_FUNC 1061 /* function to read from file */ #define VP_WRITE_FUNC 1062 /* function to write to file */ #define VP_MMAP_FUNC 1063 /* function to memory map a file */ #define VP_CLIENT_FUNC 1064 /* client data */ #define VP_MATERIAL_COUNT 1065 /* number of materials */ #define VP_CURRENT_MATRIX 1066 /* current transformation matrix */ #define VP_CLIENT_DATA 1067 /* client data */ #define VP_SHADOW 1068 /* enable shadows */ #define VP_SHADOW_LIGHT 1069 /* light number for shadows */ #define VP_SHADOW_WIDTH_HINT 1070 /* hint for width of shadow buffer */ #define VP_SHADOW_HEIGHT_HINT 1071 /* hint for height of shadow buffer */ #define VP_SHADOW_WIDTH 1072 /* width of shadow image */ #define VP_SHADOW_HEIGHT 1073 /* height of shadow image */ #define VP_SHADOW_COLOR_TABLE 1074 /* shadow color lookup table */ #define VP_SHADOW_COLOR_SIZE 1075 /* size of shadow color table */ #define VP_SHADOW_BIAS 1076 /* shadow bias distance */ #define VP_PIXEL_TYPE 1077 /* image pixel type */ #define VP_CLAMP_SHADE_TABLE 1078 /* clamp shade table entries */ #define VP_COMPOSITE_ORDER 1079 /* slice compositing order */ #define VP_AXIS_OVERRIDE 1080 /* override for best_view_axis */ #define VP_TRACE_SHADOW_K 1081 /* slice number for shadow tracing */ /* light numbers for vpSetLight */ #define VP_LIGHT0 2000 #define VP_LIGHT1 2001 #define VP_LIGHT2 2002 #define VP_LIGHT3 2003 #define VP_LIGHT4 2004 #define VP_LIGHT5 2005 /* property codes for vpSetLight */ #define VP_COLOR 2100 /* light color */ #define VP_DIRECTION 2101 /* light direction */ /* material numbers for vpSetMaterial */ #define VP_MATERIAL0 2200 #define VP_MATERIAL1 2201 #define VP_MATERIAL2 2202 #define VP_MATERIAL3 2203 #define VP_MATERIAL4 2204 #define VP_MATERIAL5 2205 /* property codes for vpSetMaterial */ #define VP_AMBIENT 2300 /* ambient material coefficients */ #define VP_DIFFUSE 2301 /* diffuse material coefficients */ #define VP_SPECULAR 2302 /* specular material coefficients */ #define VP_SHINYNESS 2303 /* specular exponent */ /* projection types for vpWindow and vpWindowPHIGS */ #define VP_PARALLEL 2400 /* parallel projection */ #define VP_PERSPECTIVE 2401 /* perspective projection */ /* volume type codes for vpExtract */ #define VP_RAW_VOLUME 2500 /* unclassified volume */ #define VP_CLASSIFIED_VOLUME 2501 /* classified volume, optimal view */ #define VP_CLX_VOLUME 2502 /* classified volume, X view */ #define VP_CLY_VOLUME 2503 /* classified volume, Y view */ #define VP_CLZ_VOLUME 2504 /* classified volume, Z view */ /* matrix concatenation modes for vpSeti(VP_CONCAT_MODE) */ #define VP_CONCAT_RIGHT 2600 /* concatenate matrices on right */ #define VP_CONCAT_LEFT 2601 /* concatenate matrices on left */ /* surface side codes for vpSetMaterial (these are bit fields) */ #define VP_EXTERIOR 1 #define VP_INTERIOR 2 #define VP_BOTH_SIDES (VP_EXTERIOR | VP_INTERIOR) /* principal axes (used as array indexes) */ #define VP_X_AXIS 0 #define VP_Y_AXIS 1 #define VP_Z_AXIS 2 #define VP_NO_AXIS -1 /* transformation matrices (used as array indexes) */ #define VP_MODEL 0 /* modelling transform (object -> world) */ #define VP_VIEW 1 /* viewing transform (world -> eye) */ #define VP_PROJECT 2 /* projection transform (eye -> clip) */ #define VP_SCREEN 8 /* screen transform (object -> screen) */ /* special field type codes */ #define VP_SKIP_FIELD -1 /* ignore a field */ #define VP_OPACITY_FIELD -2 /* compute opacity */ #define VP_CORRECTED_OPAC_FIELD -3 /* compute opac. corrected for view */ #define VP_COLOR_FIELD -4 /* compute color */ /* buffer codes */ #define VP_IMAGE_BUFFER 4000 /* intermediate image buffer */ #define VP_SHADOW_BUFFER 4001 /* shadow buffer */ /* pixel formats */ #define VP_ALPHA 5000 /* opacity */ #define VP_LUMINANCE 5001 /* grayscale color */ #define VP_LUMINANCEA 5002 /* grayscale color + opacity */ #define VP_RGB 5003 /* RGB color */ #define VP_RGBA 5004 /* RGB color + opacity */ #define VP_BGR 5005 /* RGB color, reverse byte order */ #define VP_ABGR 5006 /* RGB color + opacity, reverse order*/ /* voxel fields computed by vpScanlineNormals */ #define VP_NORM_SIZE 2 /* 2 byte normal index */ #define VP_SCALAR_SIZE 1 /* 1 byte scalar value */ #define VP_GRAD_SIZE 1 /* 1 byte gradient magnitude */ #define VP_NORM_MAX 7923 /* maximum value of a 13 bit normal */ #define VP_SCALAR_MAX 255 /* maximum value of a scalar */ #define VP_GRAD_MAX 221 /* maximum value of a gradient */ #define VP_OPACITY_MAX 255 /* maximum value of an opacity */ /* data types */ #define VP_UCHAR 1200 /* unsigned char */ #define VP_USHORT 1201 /* unsigned short */ #define VP_FLOAT 1202 /* float */ /* filter types */ #define VP_BOX_FILTER 1300 /* box filter */ #define VP_LINEAR_FILTER 1301 /* linear filter (triangle) */ #define VP_GAUSSIAN_FILTER 1302 /* gaussian, sigma defined below */ #define VP_BSPLINE_FILTER 1303 /* cubic bspline filter */ #define VP_MITCHELL_FILTER 1304 /* Mitchell bicubic filter */ #define VP_GAUSSIAN_SIGMA 0.4 /******************************************************************* * Macros. * *******************************************************************/ /* set fields of a vector */ #define vpSetVector3(v, v0, v1, v2) v[0]=v0; v[1]=v1; v[2]=v2 #define vpSetVector4(v, v0, v1, v2, v3) v[0]=v0; v[1]=v1; v[2]=v2; v[3]=v3 /* compute an offset to a field in a structure */ #define vpFieldOffset(ptr, field) ((char *)&(ptr)->field - (char *)(ptr)) /******************************************************************* * Data type definitions. * *******************************************************************/ typedef unsigned vpResult; /* result code */ typedef double vpVector3[3]; /* 3 element vector */ typedef double vpVector4[4]; /* 4 element vector */ typedef double vpMatrix3[3][3]; /* 3 by 3 element matrix */ typedef double vpMatrix4[4][4]; /* 4 by 4 element matrix */ typedef struct _vp_context vpContext; /******************************************************************* * Debugging codes. * *******************************************************************/ #define VPDEBUG_VIEW 0 /* view transform calculations */ #define VPDEBUG_RENDER 1 /* high-level rendering stages */ #define VPDEBUG_RBUF 2 /* render buffer allocation */ #define VPDEBUG_OPCCORRECT 3 /* opacity correction */ #define VPDEBUG_DEPTHCUE 4 /* depth cueing */ #define VPDEBUG_PYRAMID 5 /* pyramid construction */ #define VPDEBUG_OCTREE 6 /* octree construction */ #define VPDEBUG_CLSFYOCTREE 7 /* octree classification */ #define VPDEBUG_OCTREERUNS 8 /* runs computed from octree */ #define VPDEBUG_OCTREETRAVERSE 9 /* octree traversal */ #define VPDEBUG_TRANSPOSE 10 /* volume transposing */ #define VPDEBUG_COMPOSITE 11 /* compositing */ #define VPDEBUG_SHADOW 12 /* shadows */ #define VPDEBUG_COUNT 13 /* total number of codes */ /******************************************************************* * Timer codes. * *******************************************************************/ #define VPTIMER_SHADE 0 /* compute shading lookup table */ #define VPTIMER_COMPOSITE 1 /* compositing loop */ #define VPTIMER_DEPTHCUE 2 /* depth cueing fixup loop */ #define VPTIMER_WARP 3 /* 2D warp */ #define VPTIMER_TRAVERSE_RUNS 4 /* traverse runs during compositing */ #define VPTIMER_PROCESS_VOXELS 5 /* process voxels during compositing */ #define VPTIMER_ERT 6 /* early ray termination overhead */ #define VPTIMER_CLSFY_OCTREE 7 /* classify octree nodes */ #define VPTIMER_TRAVERSE_OCTREE 8 /* traverse octree nodes */ #define VPTIMER_RENDER 9 /* render */ #define VPTIMER_CLEAR 10 /* clear intermediate image */ #define VPTIMER_COUNT 11 /* total number of codes */ /******************************************************************* * Error codes. * *******************************************************************/ #define VP_OK 0 /* successful return */ #define VPERROR_FIRST 1000 #define VPERROR_LIMIT_EXCEEDED 1000 /* exceeded a built-in limit */ #define VPERROR_SINGULAR 1001 /* singular vector or matrix */ #define VPERROR_IO 1002 /* file I/O error */ #define VPERROR_BAD_SIZE 1003 /* invalid buffer size */ #define VPERROR_BAD_IMAGE 1004 /* invalid image definition */ #define VPERROR_BAD_SHADER 1005 /* invalid shader definition */ #define VPERROR_BAD_CLASSIFIER 1006 /* invalid classifier definition */ #define VPERROR_BAD_VOLUME 1007 /* invalid volume definition */ #define VPERROR_BAD_VOXEL 1008 /* invalid voxel definition */ #define VPERROR_BAD_OPTION 1009 /* invalid option code */ #define VPERROR_BAD_VALUE 1010 /* argument out of range */ #define VPERROR_BAD_FILE 1011 /* file has bad magic number */ #define VPERROR_BAD_SHADOW 1012 /* cannot compute shadow buffer */ #define VPERROR_LAST 1012 /******************************************************************* * Global variables. * *******************************************************************/ EXTERN char *vpCompilerOptions; /******************************************************************* * Function declarations. * *******************************************************************/ /* contexts */ EXTERN vpContext * vpCreateContext ANSI_ARGS((void)); EXTERN void vpDestroyContext ANSI_ARGS((vpContext *vpc)); /* volumes */ EXTERN vpResult vpSetVolumeSize ANSI_ARGS((vpContext *vpc, int xlen, int ylen, int zlen)); EXTERN vpResult vpSetVoxelSize ANSI_ARGS((vpContext *vpc, int bytes_per_voxel, int num_voxel_fields, int num_shade_fields, int num_clsfy_fields)); EXTERN vpResult vpSetVoxelField ANSI_ARGS((vpContext *vpc, int field_num, int field_size, int field_offset, int field_max)); EXTERN vpResult vpSetRawVoxels ANSI_ARGS((vpContext *vpc, void *raw_voxels, int raw_voxels_size, int xstride, int ystride, int zstride)); /* classification */ EXTERN vpResult vpSetClassifierTable ANSI_ARGS((vpContext *vpc, int param_num, int param_field, float *table, int table_size)); EXTERN vpResult vpClassifyScalars ANSI_ARGS((vpContext *vpc, unsigned char *scalar_data, int length, int scalar_field, int grad_field, int norm_field)); EXTERN vpResult vpClassifyVolume ANSI_ARGS((vpContext *vpc)); EXTERN vpResult vpClassifyScanline ANSI_ARGS((vpContext *vpc, void *voxels)); EXTERN vpResult vpDestroyClassifiedVolume ANSI_ARGS(( vpContext *vpc)); EXTERN vpResult vpMinMaxOctreeThreshold ANSI_ARGS((vpContext *vpc, int param, int range)); EXTERN vpResult vpCreateMinMaxOctree ANSI_ARGS((vpContext *vpc, int root_node_size, int base_node_size)); EXTERN vpResult vpDestroyMinMaxOctree ANSI_ARGS((vpContext *vpc)); EXTERN vpResult vpOctreeMask ANSI_ARGS((vpContext *vpc, unsigned char *array, int array_size, int max_level)); /* shading */ EXTERN vpResult vpSetLookupShader ANSI_ARGS((vpContext *vpc, int color_channels, int num_materials, int color_field, float *color_table, int color_table_size, int weight_field, float *weight_table, int weight_table_size)); EXTERN vpResult vpSetShadowLookupShader ANSI_ARGS((vpContext *vpc, int color_channels, int num_materials, int color_field, float *color_table, int color_table_size, int weight_field, float *weight_table, int weight_table_size, float *shadow_table, int shadow_table_size)); EXTERN vpResult vpSetMaterial ANSI_ARGS((vpContext *vpc, int material, int property, int surface_side, double r, double g, double b)); EXTERN vpResult vpSetLight ANSI_ARGS((vpContext *vpc, int light_num, int property, double n0, double n1, double n2)); EXTERN vpResult vpSetDepthCueing ANSI_ARGS((vpContext *vpc, double front_factor, double density)); EXTERN int vpNormalIndex ANSI_ARGS((double nx, double ny, double nz)); EXTERN vpResult vpNormal ANSI_ARGS((int n, double *nx, double *ny, double *nz)); EXTERN vpResult vpScanlineNormals ANSI_ARGS((vpContext *vpc, int length, unsigned char *scalar_data, unsigned char *scalar_minus_y, unsigned char *scalar_plus_y, unsigned char *scalar_minus_z, unsigned char *scalar_plus_z, void *voxel_data, int scalar_field, int grad_field, int norm_field)); EXTERN vpResult vpVolumeNormals ANSI_ARGS((vpContext *vpc, unsigned char *scalar_data, int length, int scalar_field, int grad_field, int norm_field)); EXTERN vpResult vpShadeTable ANSI_ARGS((vpContext *vpc)); /* view */ EXTERN vpResult vpCurrentMatrix ANSI_ARGS((vpContext *vpc, int option)); EXTERN vpResult vpIdentityMatrix ANSI_ARGS((vpContext *vpc)); EXTERN vpResult vpSetMatrix ANSI_ARGS((vpContext *vpc, vpMatrix4 matrix)); EXTERN vpResult vpMultMatrix ANSI_ARGS((vpContext *vpc, vpMatrix4 matrix)); EXTERN vpResult vpTranslate ANSI_ARGS((vpContext *vpc, double tx, double ty, double tz)); EXTERN vpResult vpRotate ANSI_ARGS((vpContext *vpc, int axis, double degrees)); EXTERN vpResult vpScale ANSI_ARGS((vpContext *vpc, double sx, double sy, double sz)); EXTERN vpResult vpWindow ANSI_ARGS((vpContext *vpc, int type, double left, double right, double bottom, double top, double nnear, double ffar)); EXTERN vpResult vpWindowPHIGS ANSI_ARGS((vpContext *vpc, vpVector3 vrp, vpVector3 vpn, vpVector3 vup, vpVector3 prp, double viewport_umin, double viewport_umax, double viewport_vmin, double viewport_vmax, double viewport_front, double viewport_back, int projection_type)); /* images */ EXTERN vpResult vpSetImage ANSI_ARGS((vpContext *vpc, unsigned char *image, int width, int height, int bytes_per_scan, int pixel_type)); /* other options */ EXTERN vpResult vpEnable ANSI_ARGS((vpContext *vpc, int option, int value)); EXTERN vpResult vpSeti ANSI_ARGS((vpContext *vpc, int option, int value)); EXTERN vpResult vpSetd ANSI_ARGS((vpContext *vpc, int option, double value)); EXTERN vpResult vpSetCallback ANSI_ARGS((vpContext *vpc, int option, void (*func)())); EXTERN vpResult vpSetClientData ANSI_ARGS((vpContext *vpc, void *client_data)); EXTERN vpResult vpSetDebug ANSI_ARGS((vpContext *vpc, int flag, int value)); EXTERN vpResult vpTracePixel ANSI_ARGS((vpContext *vpc, int trace_u, int trace_v)); EXTERN vpResult vpGetTimer ANSI_ARGS((vpContext *vpc, int option, int *iptr)); EXTERN vpResult vpClearTimer ANSI_ARGS((vpContext *vpc, int option)); /* rendering */ EXTERN vpResult vpRenderClassifiedVolume ANSI_ARGS(( vpContext *vpc)); EXTERN vpResult vpRenderRawVolume ANSI_ARGS((vpContext *vpc)); EXTERN vpResult vpBruteForceRender ANSI_ARGS((vpContext *vpc)); /* retrieving state */ EXTERN vpResult vpGeti ANSI_ARGS((vpContext *vpc, int option, int *iptr)); EXTERN vpResult vpGetd ANSI_ARGS((vpContext *vpc, int option, double *dptr)); EXTERN vpResult vpGetp ANSI_ARGS((vpContext *vpc, int option, void **pptr)); EXTERN vpResult vpGetCallbackp ANSI_ARGS((vpContext* vpc, int option, void (**func)())); EXTERN vpResult vpGetMatrix ANSI_ARGS((vpContext *vpc, int matrix_code, vpMatrix4 matrix)); EXTERN vpResult vpGetMaterial ANSI_ARGS((vpContext *vpc, int material, int property, int surface_side, double *r, double *g, double *b)); EXTERN vpResult vpGetLight ANSI_ARGS((vpContext *vpc, int light_num, int property, double *n0, double *n1, double *n2)); EXTERN vpResult vpGetImage ANSI_ARGS((vpContext *vpc, void *image, int width, int height, int scan_bytes, int pixel_type, int image_type)); EXTERN vpResult vpGetError ANSI_ARGS((vpContext *vpc)); EXTERN char * vpGetErrorString ANSI_ARGS((vpResult code)); /* linear algebra */ EXTERN void vpIdentity3 ANSI_ARGS((vpMatrix3 m)); EXTERN void vpIdentity4 ANSI_ARGS((vpMatrix4 m)); EXTERN vpResult vpNormalize3 ANSI_ARGS((vpVector3 v)); EXTERN void vpMatrixVectorMult4 ANSI_ARGS((vpVector4 v2, vpMatrix4 m, vpVector4 v1)); EXTERN void vpMatrixMult4 ANSI_ARGS((vpMatrix4 m3, vpMatrix4 m2, vpMatrix4 m1)); EXTERN void vpCrossProduct ANSI_ARGS((vpVector3 p, vpVector3 v, vpVector3 w)); EXTERN vpResult vpSolveSystem4 ANSI_ARGS((vpMatrix4 a, double **b, int m)); /* file I/O */ EXTERN vpResult vpStoreClassifiedVolume ANSI_ARGS((vpContext *vpc, int fd)); EXTERN vpResult vpLoadClassifiedVolume ANSI_ARGS((vpContext *vpc, int fd)); EXTERN vpResult vpStoreMinMaxOctree ANSI_ARGS((vpContext *vpc, int fd)); EXTERN vpResult vpLoadMinMaxOctree ANSI_ARGS((vpContext *vpc, int fd)); EXTERN vpResult vpStoreRawVolume ANSI_ARGS((vpContext *vpc, int fd)); EXTERN vpResult vpLoadRawVolume ANSI_ARGS((vpContext *vpc, int fd)); EXTERN vpResult vpStoreContext ANSI_ARGS((vpContext *vpc, int fd)); EXTERN vpResult vpLoadContext ANSI_ARGS((vpContext *vpc, int fd)); /* misc. utilities */ EXTERN vpResult vpExtract ANSI_ARGS((vpContext *vpc, int volume_type, int x0, int y0, int z0, int x1, int y1, int z1, int field, void *dst, int dst_size, int dst_xstride, int dst_ystride, int dst_zstride)); EXTERN vpResult vpRamp ANSI_ARGS((float *dst, int stride, int num_points, int *ramp_x, float *ramp_y)); EXTERN vpResult vpTranspose ANSI_ARGS((vpContext *vpc, int kaxis)); EXTERN vpResult vpSetFilter ANSI_ARGS((vpContext *vpc, int num_taps, int num_phases, float *weights)); EXTERN vpResult vpResample ANSI_ARGS((vpContext *vpc, int num_dimens, int *src_dimens, int *dst_dimens, int *src_strides, int *dst_strides, int element_type, void *in_array, void *out_array)); EXTERN vpResult vpResample2D ANSI_ARGS(( void *in_array, int in_x, int in_y, void *out_array, int out_x, int out_y, int element_type, int filter_type)); EXTERN vpResult vpResample3D ANSI_ARGS(( void *in_array, int in_x, int in_y, int in_z, void *out_array, int out_x, int out_y, int out_z, int element_type, int filter_type)); EXTERN vpResult vpBoxFilter ANSI_ARGS((int num_taps, int num_phases, float *weights, int weights_bytes)); EXTERN vpResult vpLinearFilter ANSI_ARGS((int num_taps, int num_phases, float *weights, int weights_bytes)); EXTERN vpResult vpBicubicFilter ANSI_ARGS((double b_value, double c_value, int num_taps, int num_phases, float *weights, int weights_bytes)); EXTERN vpResult vpGaussianFilter ANSI_ARGS((double sigma, int num_taps, int num_phases, float *weights, int weights_bytes)); #endif /* _VOLPACK */ ccseapps-2.5/CCSEApps/volpack/vp_transpose.c0000644000175000017500000001253111634153073022207 0ustar amckinstryamckinstry/* * vp_transpose.c * * Routines to transpose a raw volume. * * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */ /* * $Date: 2000/10/02 18:12:04 $ * $Revision: 1.4 $ */ #include "vp_global.h" static void TransposeBlock ANSI_ARGS((void *src, int src_xstride, int src_ystride, int src_zstride, void *dst, int dst_xstride, int dst_ystride, int dst_zstride, int xlen, int ylen, int zlen, int bytes_per_voxel)); /* * vpTranspose * * Transpose the raw volume data. */ vpResult vpTranspose(vpc, kaxis) vpContext *vpc; /* context */ int kaxis; /* axis which will have the largest stride after transposing */ { void *blk; /* buffer to store data during transpose */ int xlen, ylen, zlen; /* volume size */ int src_xstride, src_ystride, src_zstride; /* strides of src voxels */ int dst_xstride, dst_ystride, dst_zstride; /* strides of dst voxels */ int bytes_per_voxel; /* size of voxel */ int retcode; /* XXX replace with a blocked algorithm to conserve memory and improve cache performance */ /* check for errors */ if ((retcode = VPCheckRawVolume(vpc)) != VP_OK) return(retcode); /* decide on the new strides */ xlen = vpc->xlen; ylen = vpc->ylen; zlen = vpc->zlen; src_xstride = vpc->xstride; src_ystride = vpc->ystride; src_zstride = vpc->zstride; bytes_per_voxel = vpc->raw_bytes_per_voxel; switch (kaxis) { case VP_X_AXIS: dst_xstride = ylen*zlen*bytes_per_voxel; dst_ystride = bytes_per_voxel; dst_zstride = ylen*bytes_per_voxel; break; case VP_Y_AXIS: dst_xstride = zlen*bytes_per_voxel; dst_ystride = zlen*xlen*bytes_per_voxel; dst_zstride = bytes_per_voxel; break; case VP_Z_AXIS: dst_xstride = bytes_per_voxel; dst_ystride = xlen*bytes_per_voxel; dst_zstride = xlen*ylen*bytes_per_voxel; break; default: return(VPSetError(vpc, VPERROR_BAD_OPTION)); } if (src_xstride == dst_xstride && src_ystride == dst_ystride && src_zstride == dst_zstride) return(VP_OK); /* transpose volume */ Alloc(vpc, blk, void *, xlen*ylen*zlen*bytes_per_voxel, "transpose_tmp"); TransposeBlock(vpc->raw_voxels, src_xstride, src_ystride, src_zstride, blk, dst_xstride, dst_ystride, dst_zstride, xlen, ylen, zlen, bytes_per_voxel); bcopy(blk, vpc->raw_voxels, xlen*ylen*zlen*bytes_per_voxel); Dealloc(vpc, blk); vpc->xstride = dst_xstride; vpc->ystride = dst_ystride; vpc->zstride = dst_zstride; return(VP_OK); } /* * TransposeBlock * * Transpose a block of volume data by copying it from a source array * to a destination array using the indicated strides. */ static void TransposeBlock(src, src_xstride, src_ystride, src_zstride, dst, dst_xstride, dst_ystride, dst_zstride, xlen, ylen, zlen, bytes_per_voxel) void *src; /* source array */ int src_xstride; /* strides for source array */ int src_ystride; int src_zstride; void *dst; /* destination array */ int dst_xstride; /* strides for destination array */ int dst_ystride; int dst_zstride; int xlen, ylen, zlen; /* size of block in voxels per side */ int bytes_per_voxel; /* size of a voxel */ { int x, y, z, b; unsigned char *src_ptr; unsigned char *dst_ptr; src_ptr = (unsigned char*)src; dst_ptr = (unsigned char*)dst; for (z = 0; z < zlen; z++) { for (y = 0; y < ylen; y++) { for (x = 0; x < xlen; x++) { for (b = 0; b < bytes_per_voxel; b++) dst_ptr[b] = src_ptr[b]; src_ptr += src_xstride; dst_ptr += dst_xstride; } src_ptr += src_ystride - xlen*src_xstride; dst_ptr += dst_ystride - xlen*dst_xstride; } src_ptr += src_zstride - ylen*src_ystride; dst_ptr += dst_zstride - ylen*dst_ystride; } } ccseapps-2.5/CCSEApps/volpack/no_edit_header0000644000175000017500000000352411634153073022176 0ustar amckinstryamckinstry/* * DO NOT EDIT THIS FILE! It was created automatically by m4. */ /* * Copyright (c) 1994 The Board of Trustees of The Leland Stanford * Junior University. All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice and this permission notice appear in * all copies of this software and that you do not sell the software. * Commercial licensing is available by contacting the author. * * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * Author: * Phil Lacroute * Computer Systems Laboratory * Electrical Engineering Dept. * Stanford University * * This version of the VolPack library is a modified version of the * original available from Stanford University. Modifications were * made by the Center for Computational Sciences and Engineering, * Lawrence Berkeley National Laboratory. Modifications to VolPack * (c) 2000 The Regents of the University of California (through * E.O. Lawrence Berkeley National Laboratory), subject to approval by * the U.S. Department of Energy. Your use of this software is under * license from Stanford University with respect to the underlying * original VolPack code (see copyright notice and permission above) * and The Regents of the University of California with respect to * modifications thereto (see AmrVis license.txt file for applicable * license terms). Contact Berkeley Lab's Center for Computational * Sciences and Engineering at webmaster@mothra.lbl.gov or Berkeley * Lab's Technology Transfer Department at TTD@lbl.gov for questions * or to receive more information. * */